From 63bb33836d4d6e7d066124f503d57395146d3a23 Mon Sep 17 00:00:00 2001 From: iserge Date: Thu, 2 Feb 2017 14:11:04 +0300 Subject: [PATCH] Up to Cesium version 1.30 --- .../org/cesiumjs/public/cs/Cesium/Cesium.js | 124 +- .../cs/Cesium/ThirdParty/Workers/deflate.js | 2 +- .../cs/Cesium/ThirdParty/Workers/inflate.js | 2 +- .../cs/Cesium/Widgets/Geocoder/Geocoder.css | 2 +- .../public/cs/Cesium/Widgets/widgets.css | 2 +- .../Workers/cesiumWorkerBootstrapper.js | 2 +- .../cs/Cesium/Workers/combineGeometry.js | 12 +- .../cs/Cesium/Workers/createBoxGeometry.js | 8 +- .../Workers/createBoxOutlineGeometry.js | 8 +- .../cs/Cesium/Workers/createCircleGeometry.js | 14 +- .../Workers/createCircleOutlineGeometry.js | 10 +- .../Cesium/Workers/createCorridorGeometry.js | 14 +- .../Workers/createCorridorOutlineGeometry.js | 14 +- .../Cesium/Workers/createCylinderGeometry.js | 8 +- .../Workers/createCylinderOutlineGeometry.js | 8 +- .../Cesium/Workers/createEllipseGeometry.js | 14 +- .../Workers/createEllipseOutlineGeometry.js | 8 +- .../Cesium/Workers/createEllipsoidGeometry.js | 8 +- .../Workers/createEllipsoidOutlineGeometry.js | 8 +- .../cs/Cesium/Workers/createGeometry.js | 12 +- .../cs/Cesium/Workers/createPointGeometry.js | 8 +- .../Cesium/Workers/createPolygonGeometry.js | 16 +- .../Workers/createPolygonOutlineGeometry.js | 16 +- .../Cesium/Workers/createPolylineGeometry.js | 10 +- .../Workers/createPolylineVolumeGeometry.js | 16 +- .../createPolylineVolumeOutlineGeometry.js | 14 +- .../Cesium/Workers/createRectangleGeometry.js | 12 +- .../Workers/createRectangleOutlineGeometry.js | 10 +- .../Workers/createSimplePolylineGeometry.js | 10 +- .../cs/Cesium/Workers/createSphereGeometry.js | 8 +- .../Workers/createSphereOutlineGeometry.js | 8 +- .../Workers/createVerticesFromHeightmap.js | 14 +- .../createVerticesFromQuantizedTerrainMesh.js | 14 +- .../cs/Cesium/Workers/createWallGeometry.js | 14 +- .../Workers/createWallOutlineGeometry.js | 14 +- .../Cesium/Workers/transferTypedArrayTest.js | 2 +- .../Workers/upsampleQuantizedTerrainMesh.js | 14 +- .../public/cs/CesiumUnminified/Cesium.js | 8181 +++++++++-------- .../ThirdParty/Workers/deflate.js | 2 +- .../ThirdParty/Workers/inflate.js | 2 +- .../Widgets/Geocoder/Geocoder.css | 27 + .../Workers/cesiumWorkerBootstrapper.js | 5 +- .../Workers/combineGeometry.js | 2305 ++--- .../Workers/createBoxGeometry.js | 1902 ++-- .../Workers/createBoxOutlineGeometry.js | 1716 ++-- .../Workers/createCircleGeometry.js | 2959 +++--- .../Workers/createCircleOutlineGeometry.js | 1979 ++-- .../Workers/createCorridorGeometry.js | 2522 ++--- .../Workers/createCorridorOutlineGeometry.js | 2319 ++--- .../Workers/createCylinderGeometry.js | 1986 ++-- .../Workers/createCylinderOutlineGeometry.js | 1906 ++-- .../Workers/createEllipseGeometry.js | 2945 +++--- .../Workers/createEllipseOutlineGeometry.js | 1973 ++-- .../Workers/createEllipsoidGeometry.js | 1964 ++-- .../Workers/createEllipsoidOutlineGeometry.js | 1716 ++-- .../Workers/createGeometry.js | 2305 ++--- .../Workers/createPointGeometry.js | 1716 ++-- .../Workers/createPolygonGeometry.js | 2928 +++--- .../Workers/createPolygonOutlineGeometry.js | 2764 +++--- .../Workers/createPolylineGeometry.js | 1822 ++-- .../Workers/createPolylineVolumeGeometry.js | 2950 +++--- .../createPolylineVolumeOutlineGeometry.js | 2507 ++--- .../Workers/createRectangleGeometry.js | 3044 +++--- .../Workers/createRectangleOutlineGeometry.js | 2150 ++--- .../Workers/createSimplePolylineGeometry.js | 1792 ++-- .../Workers/createSphereGeometry.js | 1970 ++-- .../Workers/createSphereOutlineGeometry.js | 1716 ++-- .../Workers/createVerticesFromHeightmap.js | 2384 ++--- .../createVerticesFromQuantizedTerrainMesh.js | 2656 ++---- .../Workers/createWallGeometry.js | 2553 ++--- .../Workers/createWallOutlineGeometry.js | 2489 ++--- .../Workers/transferTypedArrayTest.js | 2 +- .../Workers/upsampleQuantizedTerrainMesh.js | 2650 ++---- 73 files changed, 29378 insertions(+), 47909 deletions(-) diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Cesium.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Cesium.js index a705e6e7..1cde7c72 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Cesium.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Cesium.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -419,64 +419,64 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * MIT license **/ -!function(){var e,t,i;!function(r){function n(e,t){return w.call(e,t)}function o(e,t){var i,r,n,o,a,s,l,u,c,h,d,p,m=t&&t.split("/"),f=y.map,_=f&&f["*"]||{};if(e){for(e=e.split("/"),a=e.length-1,y.nodeIdCompat&&E.test(e[a])&&(e[a]=e[a].replace(E,"")),"."===e[0].charAt(0)&&m&&(p=m.slice(0,m.length-1),e=p.concat(e)),c=0;c0&&(e.splice(c-1,2),c-=2)}e=e.join("/")}if((m||_)&&f){for(i=e.split("/"),c=i.length;c>0;c-=1){if(r=i.slice(0,c).join("/"),m)for(h=m.length;h>0;h-=1)if(n=f[m.slice(0,h).join("/")],n&&(n=n[r])){o=n,s=c;break}if(o)break;!l&&_&&_[r]&&(l=_[r],u=c)}!o&&l&&(o=l,s=u),o&&(i.splice(0,s,o),e=i.join("/"))}return e}function a(e,t){return function(){var i=S.call(arguments,0);return"string"!=typeof i[0]&&1===i.length&&i.push(null),m.apply(r,i.concat([e,t]))}}function s(e){return function(t){return o(t,e)}}function l(e){return function(t){g[e]=t}}function u(e){if(n(v,e)){var t=v[e];delete v[e],C[e]=!0,p.apply(r,t)}if(!n(g,e)&&!n(C,e))throw new Error("No "+e);return g[e]}function c(e){var t,i=e?e.indexOf("!"):-1;return i>-1&&(t=e.substring(0,i),e=e.substring(i+1,e.length)),[t,e]}function h(e){return e?c(e):[]}function d(e){return function(){return y&&y.config&&y.config[e]||{}}}var p,m,f,_,g={},v={},y={},C={},w=Object.prototype.hasOwnProperty,S=[].slice,E=/\.js$/;f=function(e,t){var i,r=c(e),n=r[0],a=t[1];return e=r[1],n&&(n=o(n,a),i=u(n)),n?e=i&&i.normalize?i.normalize(e,s(a)):o(e,a):(e=o(e,a),r=c(e),n=r[0],e=r[1],n&&(i=u(n))),{f:n?n+"!"+e:e,n:e,pr:n,p:i}},_={require:function(e){return a(e)},exports:function(e){var t=g[e];return"undefined"!=typeof t?t:g[e]={}},module:function(e){return{id:e,uri:"",exports:g[e],config:d(e)}}},p=function(e,t,i,o){var s,c,d,p,m,y,w,S=[],E=typeof i;if(o=o||e,y=h(o),"undefined"===E||"function"===E){for(t=!t.length&&i.length?["require","exports","module"]:t,m=0;m>>0,u=Math.max(0,Math.min(i,v)),h=[],c=v-u+1,d=[],p=a(),u)for(_=p.progress,f=function(e){d.push(e),--c||(m=f=g,p.reject(d))},m=function(e){h.push(e),--u||(m=f=g,p.resolve(h))},y=0;y>>0,r=[],u=a(),o)for(s=function(t,n){e(t,i).then(function(e){r[n]=e,--o||u.resolve(r)},u.reject)},l=0;l2;return e(t,function(e){return e=n?r:e,i.resolve(e),e},function(e){return i.reject(e),o(e)},i.progress)}function f(e,t){for(var i,r=0;i=e[r++];)i(t)}function _(e,t){for(var i,r=t.length;r>e;)if(i=t[--r],null!=i&&"function"!=typeof i)throw new Error("arg "+r+" must be a function")}function g(){}function v(e){return e}var y,C,w;return e.defer=a,e.resolve=t,e.reject=i,e.join=h,e.all=c,e.map=d,e.reduce=p,e.any=u,e.some=l,e.chain=m,e.isPromise=s,r.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(w,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return c(t,function(t){return e.apply(w,t)})})}},C=[].slice,y=[].reduce||function(e){var t,i,r,n,o;if(o=0,t=Object(this),n=t.length>>>0,i=arguments,i.length<=1)for(;;){if(o in t){r=t[o++];break}if(++o>=n)throw new TypeError}else r=i[1];for(;ot)throw new i("Expected "+e+" to be at most "+t)},a.numeric.minimum=function(e,t){if(a.typeOf.number(e),a.typeOf.number(t),e>>0,this.mti=1;this.mti>>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 i;for(this.mti==this.N+1&&this.init_genrand(5489),i=0;i>>1^t[1&e];for(;i>>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^=e<<7&2636928640,e^=e<<15&4022730752,e^=e>>>18,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),i("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,i,r){"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:e<0?-1:0},n.signNotZero=function(e){return e<0?-1:1},n.toSNorm=function(e,i){return i=t(i,255),Math.round((.5*n.clamp(e,-1,1)+.5)*i)},n.fromSNorm=function(e,i){return i=t(i,255),n.clamp(e,0,i)/i*2-1},n.sinh=function(e){var t=Math.pow(Math.E,e),i=Math.pow(Math.E,-1*e);return.5*(t-i)},n.cosh=function(e){var t=Math.pow(Math.E,e),i=Math.pow(Math.E,-1*e);return.5*(t+i)},n.lerp=function(e,t,i){return(1-i)*e+i*t},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=3*Math.PI*.5,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){return e*n.RADIANS_PER_DEGREE},n.toDegrees=function(e){return e*n.DEGREES_PER_RADIAN},n.convertLongitudeRange=function(e){var t=n.TWO_PI,i=e-Math.floor(e/t)*t;return i<-Math.PI?i+t:i>=Math.PI?i-t:i},n.clampToLatitudeRange=function(e){return n.clamp(e,-1*n.PI_OVER_TWO,n.PI_OVER_TWO)},n.negativePiToPi=function(e){return n.zeroToTwoPi(e+n.PI)-n.PI},n.zeroToTwoPi=function(e){var t=n.mod(e,n.TWO_PI);return Math.abs(t)n.EPSILON14?n.TWO_PI:t},n.mod=function(e,t){return(e%t+t)%t},n.equalsEpsilon=function(e,i,r,n){n=t(n,r);var o=Math.abs(e-i);return o<=n||o<=r*Math.max(Math.abs(e),Math.abs(i))};var o=[1];n.factorial=function(e){var t=o.length;if(e>=t)for(var i=o[t-1],r=t;r<=e;r++)o.push(i*r);return o[e]},n.incrementWrap=function(e,i,r){return r=t(r,0),++e,e>i&&(e=r),e},n.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},n.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},n.clamp=function(e,t,i){return ei?i:e};var a=new e;return n.setRandomNumberSeed=function(t){a=new e(t)},n.nextRandomNumber=function(){return a.random()},n.acosClamped=function(e){return Math.acos(n.clamp(e,-1,1))},n.asinClamped=function(e){return Math.asin(n.clamp(e,-1,1))},n.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},n.logBase=function(e,t){return Math.log(e)/Math.log(t)},n.fog=function(e,t){var i=e*t;return 1-Math.exp(-(i*i))},n}),i("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,i,r,n,o){"use strict";function a(e,i,r){this.x=t(e,0),this.y=t(i,0),this.z=t(r,0)}a.fromSpherical=function(e,r){i(r)||(r=new a);var n=e.clock,o=e.cone,s=t(e.magnitude,1),l=s*Math.sin(o);return r.x=l*Math.cos(n),r.y=l*Math.sin(n),r.z=s*Math.cos(o),r},a.fromElements=function(e,t,r,n){return i(n)?(n.x=e,n.y=t,n.z=r,n):new a(e,t,r)},a.clone=function(e,t){if(i(e))return i(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new a(e.x,e.y,e.z)},a.fromCartesian4=a.clone,a.packedLength=3,a.pack=function(e,i,r){return r=t(r,0),i[r++]=e.x,i[r++]=e.y,i[r]=e.z,i},a.unpack=function(e,r,n){return r=t(r,0),i(n)||(n=new a),n.x=e[r++],n.y=e[r++],n.z=e[r],n},a.packArray=function(e,t){var r=e.length;i(t)?t.length=3*r:t=new Array(3*r);for(var n=0;nr.EPSILON12);return t(u)?(u.x=c*P,u.y=h*D,u.z=d*M,u):new e(c*P,h*D,d*M)}var o=new e,a=new e;return n}),i("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,i,r,n,o,a){"use strict";function s(e,i,r){this.longitude=t(e,0),this.latitude=t(i,0),this.height=t(r,0)}s.fromRadians=function(e,r,n,o){return n=t(n,0),i(o)?(o.longitude=e,o.latitude=r,o.height=n,o):new s(e,r,n)},s.fromDegrees=function(e,t,i,r){return e=o.toRadians(e),t=o.toRadians(t),s.fromRadians(e,t,i,r)};var l=new e,u=new e,c=new e,h=new e(1/6378137,1/6378137,1/6356752.314245179),d=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),p=o.EPSILON1;return s.fromCartesian=function(t,r,n){var m=i(r)?r.oneOverRadii:h,f=i(r)?r.oneOverRadiiSquared:d,_=i(r)?r._centerToleranceSquared:p,g=a(t,m,f,_,u);if(i(g)){var v=e.multiplyComponents(g,f,l);v=e.normalize(v,v);var y=e.subtract(t,g,c),C=Math.atan2(v.y,v.x),w=Math.asin(v.z),S=o.sign(e.dot(y,t))*e.magnitude(y);return i(n)?(n.longitude=C,n.latitude=w,n.height=S,n):new s(C,w,S)}},s.clone=function(e,t){if(i(e))return i(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new s(e.longitude,e.latitude,e.height)},s.equals=function(e,t){return e===t||i(e)&&i(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},s.equalsEpsilon=function(e,t,r){return e===t||i(e)&&i(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},s.ZERO=n(new s(0,0,0)),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.longitude+", "+this.latitude+", "+this.height+")"},s}),i("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(t,r,n,o){r=i(r,0),n=i(n,0),o=i(o,0),t._radii=new e(r,n,o),t._radiiSquared=new e(r*r,n*n,o*o),t._radiiToTheFourth=new e(r*r*r*r,n*n*n*n,o*o*o*o),t._oneOverRadii=new e(0===r?0:1/r,0===n?0:1/n,0===o?0:1/o),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===n?0:1/(n*n),0===o?0:1/(o*o)),t._minimumRadius=Math.min(r,n,o),t._maximumRadius=Math.max(r,n,o),t._centerToleranceSquared=s.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function c(e,t,i){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,u(this,e,t,i)}n(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,i){if(r(t)){var n=t._radii;return r(i)?(e.clone(n,i._radii),e.clone(t._radiiSquared,i._radiiSquared),e.clone(t._radiiToTheFourth,i._radiiToTheFourth),e.clone(t._oneOverRadii,i._oneOverRadii),e.clone(t._oneOverRadiiSquared,i._oneOverRadiiSquared),i._minimumRadius=t._minimumRadius,i._maximumRadius=t._maximumRadius,i._centerToleranceSquared=t._centerToleranceSquared,i):new c(n.x,n.y,n.z)}},c.fromCartesian3=function(e,t){return r(t)||(t=new c),r(e)?(u(t,e.x,e.y,e.z),t):t},c.WGS84=a(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=a(new c(1,1,1)),c.MOON=a(new c(s.LUNAR_RADIUS,s.LUNAR_RADIUS,s.LUNAR_RADIUS)),c.prototype.clone=function(e){return c.clone(this,e)},c.packedLength=e.packedLength,c.pack=function(t,r,n){return n=i(n,0),e.pack(t._radii,r,n),r},c.unpack=function(t,r,n){r=i(r,0);var o=e.unpack(t,r);return c.fromCartesian3(o,n)},c.prototype.geocentricSurfaceNormal=e.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(t,i){var n=t.longitude,o=t.latitude,a=Math.cos(o),s=a*Math.cos(n),l=a*Math.sin(n),u=Math.sin(o);return r(i)||(i=new e),i.x=s,i.y=l,i.z=u,e.normalize(i,i)},c.prototype.geodeticSurfaceNormal=function(t,i){return r(i)||(i=new e),i=e.multiplyComponents(t,this._oneOverRadiiSquared,i),e.normalize(i,i)};var h=new e,d=new e;c.prototype.cartographicToCartesian=function(t,i){var n=h,o=d;this.geodeticSurfaceNormalCartographic(t,n),e.multiplyComponents(this._radiiSquared,n,o);var a=Math.sqrt(e.dot(n,o));return e.divideByScalar(o,a,o),e.multiplyByScalar(n,t.height,n),r(i)||(i=new e),e.add(o,n,i)},c.prototype.cartographicArrayToCartesianArray=function(e,t){var i=e.length;r(t)?t.length=i:t=new Array(i);for(var n=0;n=this._radii.z-n))return o},c}),i("Core/Event",["./defined","./defineProperties","./DeveloperError"],function(e,t,i){"use strict";function r(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}return t(r.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}}),r.prototype.addEventListener=function(e,t){this._listeners.push(e),this._scopes.push(t);var i=this;return function(){i.removeEventListener(e,t)}},r.prototype.removeEventListener=function(e,t){for(var i=this._listeners,r=this._scopes,n=-1,o=0;o=0?p.longitude:p.longitude+s.TWO_PI;o=Math.min(o,m),a=Math.max(a,m)}return n-r>a-o&&(r=o,n=a,n>s.PI&&(n-=s.TWO_PI),r>s.PI&&(r-=s.TWO_PI)),i(t)?(t.west=r,t.south=u,t.east=n,t.north=c,t):new l(r,u,n,c)},l.fromCartesianArray=function(e,t,r){for(var n=Number.MAX_VALUE,o=-Number.MAX_VALUE,a=Number.MAX_VALUE,u=-Number.MAX_VALUE,c=Number.MAX_VALUE,h=-Number.MAX_VALUE,d=0,p=e.length;d=0?m.longitude:m.longitude+s.TWO_PI;a=Math.min(a,f),u=Math.max(u,f)}return o-n>u-a&&(n=a,o=u,o>s.PI&&(o-=s.TWO_PI),n>s.PI&&(n-=s.TWO_PI)),i(r)?(r.west=n,r.south=c,r.east=o,r.north=h,r):new l(n,c,o,h)},l.clone=function(e,t){if(i(e))return i(t)?(t.west=e.west, -t.south=e.south,t.east=e.east,t.north=e.north,t):new l(e.west,e.south,e.east,e.north)},l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equals=function(e,t){return e===t||i(e)&&i(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},l.prototype.equalsEpsilon=function(e,t){return i(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},l.validate=function(e){},l.southwest=function(t,r){return i(r)?(r.longitude=t.west,r.latitude=t.south,r.height=0,r):new e(t.west,t.south)},l.northwest=function(t,r){return i(r)?(r.longitude=t.west,r.latitude=t.north,r.height=0,r):new e(t.west,t.north)},l.northeast=function(t,r){return i(r)?(r.longitude=t.east,r.latitude=t.north,r.height=0,r):new e(t.east,t.north)},l.southeast=function(t,r){return i(r)?(r.longitude=t.east,r.latitude=t.south,r.height=0,r):new e(t.east,t.south)},l.center=function(t,r){var n=t.east,o=t.west;n0?n+=s.TWO_PI:a0&&(a+=s.TWO_PI),n=p))return i(r)?(r.west=c,r.south=d,r.east=h,r.north=p,r):new l(c,d,h,p)}},l.simpleIntersection=function(e,t,r){var n=Math.max(e.west,t.west),o=Math.max(e.south,t.south),a=Math.min(e.east,t.east),s=Math.min(e.north,t.north);if(!(o>=s||n>=a))return i(r)?(r.west=n,r.south=o,r.east=a,r.north=s,r):new l(n,o,a,s)},l.union=function(e,t,r){i(r)||(r=new l);var n=e.east,o=e.west,a=t.east,u=t.west;n0?n+=s.TWO_PI:a0&&(a+=s.TWO_PI),nn||s.equalsEpsilon(i,n,s.EPSILON14))&&(i=e.south&&r<=e.north};var u=new e;return l.subsample=function(e,r,n,a){r=t(r,o.WGS84),n=t(n,0),i(a)||(a=[]);var c=0,h=e.north,d=e.south,p=e.east,m=e.west,f=u;f.height=n,f.longitude=m,f.latitude=h,a[c]=r.cartographicToCartesian(f,a[c]),c++,f.longitude=p,a[c]=r.cartographicToCartesian(f,a[c]),c++,f.latitude=d,a[c]=r.cartographicToCartesian(f,a[c]),c++,f.longitude=m,a[c]=r.cartographicToCartesian(f,a[c]),c++,h<0?f.latitude=h:d>0?f.latitude=d:f.latitude=0;for(var _=1;_<8;++_)f.longitude=-Math.PI+_*s.PI_OVER_TWO,l.contains(e,f)&&(a[c]=r.cartographicToCartesian(f,a[c]),c++);return 0===f.latitude&&(f.longitude=m,a[c]=r.cartographicToCartesian(f,a[c]),c++,f.longitude=p,a[c]=r.cartographicToCartesian(f,a[c]),c++),a.length=c,a},l.MAX_VALUE=a(new l(-Math.PI,-s.PI_OVER_TWO,Math.PI,s.PI_OVER_TWO)),l}),i("Core/GeographicTilingScheme",["./Cartesian2","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./GeographicProjection","./Math","./Rectangle"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(e){e=t(e,{}),this._ellipsoid=t(e.ellipsoid,o.WGS84),this._rectangle=t(e.rectangle,l.MAX_VALUE),this._projection=new a(this._ellipsoid),this._numberOfLevelZeroTilesX=t(e.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=t(e.numberOfLevelZeroTilesY,1)}return r(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}}),u.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<=a&&(p=a-1);var m=(o.north-t.latitude)/h|0;return m>=u&&(m=u-1),i(n)?(n.x=p,n.y=m,n):new e(p,m)}},u}),i("Core/getImagePixels",["./defined"],function(e){"use strict";function t(t,r,n){e(r)||(r=t.width),e(n)||(n=t.height);var o=i[r];e(o)||(o={},i[r]=o);var a=o[n];if(!e(a)){var s=document.createElement("canvas");s.width=r,s.height=n,a=s.getContext("2d"),a.globalCompositeOperation="copy",o[n]=a}return a.drawImage(t,0,0,r,n),a.getImageData(0,0,r,n).data}var i={};return t}),i("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),i("Core/AxisAlignedBoundingBox",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Intersect"],function(e,t,i,r,n){"use strict";function o(r,n,o){this.minimum=e.clone(t(r,e.ZERO)),this.maximum=e.clone(t(n,e.ZERO)),i(o)?o=e.clone(o):(o=e.add(this.minimum,this.maximum,new e),e.multiplyByScalar(o,.5,o)),this.center=o}o.fromPoints=function(t,r){if(i(r)||(r=new o),!i(t)||0===t.length)return r.minimum=e.clone(e.ZERO,r.minimum),r.maximum=e.clone(e.ZERO,r.maximum),r.center=e.clone(e.ZERO,r.center),r;for(var n=t[0].x,a=t[0].y,s=t[0].z,l=t[0].x,u=t[0].y,c=t[0].z,h=t.length,d=1;d0?n.INSIDE:l+s<0?n.OUTSIDE:n.INTERSECTING},o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.intersectPlane=function(e){return o.intersectPlane(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o}),i("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,i){this.start=e(t,0),this.stop=e(i,0)}return t}),i("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,i,r,n,o,a){"use strict";function s(e,i,r,n,o,a,s,l,u){this[0]=t(e,0),this[1]=t(n,0),this[2]=t(s,0),this[3]=t(i,0),this[4]=t(o,0),this[5]=t(l,0),this[6]=t(r,0),this[7]=t(a,0),this[8]=t(u,0)}function l(e){for(var t=0,i=0;i<9;++i){var r=e[i];t+=r*r}return Math.sqrt(t)}function u(e){for(var t=0,i=0;i<3;++i){var r=e[s.getElementIndex(m[i],p[i])];t+=2*r*r}return Math.sqrt(t)}function c(e,t){for(var i=a.EPSILON15,r=0,n=1,o=0;o<3;++o){var l=Math.abs(e[s.getElementIndex(m[o],p[o])]);l>r&&(n=o,r=l)}var u=1,c=0,h=p[n],d=m[n];if(Math.abs(e[s.getElementIndex(d,h)])>i){var f,_=e[s.getElementIndex(d,d)],g=e[s.getElementIndex(h,h)],v=e[s.getElementIndex(d,h)],y=(_-g)/2/v;f=y<0?-1/(-y+Math.sqrt(1+y*y)):1/(y+Math.sqrt(1+y*y)),u=1/Math.sqrt(1+f*f),c=f*u}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(h,h)]=t[s.getElementIndex(d,d)]=u,t[s.getElementIndex(d,h)]=c,t[s.getElementIndex(h,d)]=-c,t}s.packedLength=9,s.pack=function(e,i,r){return r=t(r,0),i[r++]=e[0],i[r++]=e[1],i[r++]=e[2],i[r++]=e[3],i[r++]=e[4],i[r++]=e[5],i[r++]=e[6],i[r++]=e[7],i[r++]=e[8],i},s.unpack=function(e,r,n){return r=t(r,0),i(n)||(n=new s),n[0]=e[r++],n[1]=e[r++],n[2]=e[r++],n[3]=e[r++],n[4]=e[r++],n[5]=e[r++],n[6]=e[r++],n[7]=e[r++],n[8]=e[r++],n},s.clone=function(e,t){if(i(e))return i(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 s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,r,n){return r=t(r,0),i(n)||(n=new s),n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],n[4]=e[r+4],n[5]=e[r+5],n[6]=e[r+6],n[7]=e[r+7],n[8]=e[r+8],n},s.fromColumnMajorArray=function(e,t){return s.clone(e,t)},s.fromRowMajorArray=function(e,t){return i(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 s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var r=e.x*e.x,n=e.x*e.y,o=e.x*e.z,a=e.x*e.w,l=e.y*e.y,u=e.y*e.z,c=e.y*e.w,h=e.z*e.z,d=e.z*e.w,p=e.w*e.w,m=r-l-h+p,f=2*(n-d),_=2*(o+c),g=2*(n+d),v=-r+l-h+p,y=2*(u-a),C=2*(o-c),w=2*(u+a),S=-r-l+h+p;return i(t)?(t[0]=m,t[1]=g,t[2]=C,t[3]=f,t[4]=v,t[5]=w,t[6]=_,t[7]=y,t[8]=S,t):new s(m,f,_,g,v,y,C,w,S)},s.fromHeadingPitchRoll=function(e,t){var r=Math.cos(-e.pitch),n=Math.cos(-e.heading),o=Math.cos(e.roll),a=Math.sin(-e.pitch),l=Math.sin(-e.heading),u=Math.sin(e.roll),c=r*n,h=-o*l+u*a*n,d=u*l+o*a*n,p=r*l,m=o*n+u*a*l,f=-a*o+o*a*l,_=-a,g=u*r,v=o*r;return i(t)?(t[0]=c,t[1]=p,t[2]=_,t[3]=h,t[4]=m,t[5]=g,t[6]=d,t[7]=f,t[8]=v,t):new s(c,h,d,p,m,f,_,g,v)},s.fromScale=function(e,t){return i(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 s(e.x,0,0,0,e.y,0,0,0,e.z)},s.fromUniformScale=function(e,t){return i(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 s(e,0,0,0,e,0,0,0,e)},s.fromCrossProduct=function(e,t){return i(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 s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var r=Math.cos(e),n=Math.sin(e);return i(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=r,t[5]=n,t[6]=0,t[7]=-n,t[8]=r,t):new s(1,0,0,0,r,-n,0,n,r)},s.fromRotationY=function(e,t){var r=Math.cos(e),n=Math.sin(e);return i(t)?(t[0]=r,t[1]=0,t[2]=-n,t[3]=0,t[4]=1,t[5]=0,t[6]=n,t[7]=0,t[8]=r,t):new s(r,0,n,0,1,0,-n,0,r)},s.fromRotationZ=function(e,t){var r=Math.cos(e),n=Math.sin(e);return i(t)?(t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(r,-n,0,n,r,0,0,0,1)},s.toArray=function(e,t){return i(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]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,i){var r=3*t,n=e[r],o=e[r+1],a=e[r+2];return i.x=n,i.y=o,i.z=a,i},s.setColumn=function(e,t,i,r){r=s.clone(e,r);var n=3*t;return r[n]=i.x,r[n+1]=i.y,r[n+2]=i.z,r},s.getRow=function(e,t,i){var r=e[t],n=e[t+3],o=e[t+6];return i.x=r,i.y=n,i.z=o,i},s.setRow=function(e,t,i,r){return r=s.clone(e,r),r[t]=i.x,r[t+3]=i.y,r[t+6]=i.z,r};var h=new e;s.getScale=function(t,i){return i.x=e.magnitude(e.fromElements(t[0],t[1],t[2],h)),i.y=e.magnitude(e.fromElements(t[3],t[4],t[5],h)),i.z=e.magnitude(e.fromElements(t[6],t[7],t[8],h)),i};var d=new e;s.getMaximumScale=function(t){return s.getScale(t,d),e.maximumComponent(d)},s.multiply=function(e,t,i){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],n=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],o=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],a=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],s=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],l=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],u=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],c=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],h=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return i[0]=r,i[1]=n,i[2]=o,i[3]=a,i[4]=s,i[5]=l,i[6]=u,i[7]=c,i[8]=h,i},s.add=function(e,t,i){return i[0]=e[0]+t[0],i[1]=e[1]+t[1],i[2]=e[2]+t[2],i[3]=e[3]+t[3],i[4]=e[4]+t[4],i[5]=e[5]+t[5],i[6]=e[6]+t[6],i[7]=e[7]+t[7],i[8]=e[8]+t[8],i},s.subtract=function(e,t,i){return i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],i[3]=e[3]-t[3],i[4]=e[4]-t[4],i[5]=e[5]-t[5],i[6]=e[6]-t[6],i[7]=e[7]-t[7],i[8]=e[8]-t[8],i},s.multiplyByVector=function(e,t,i){var r=t.x,n=t.y,o=t.z,a=e[0]*r+e[3]*n+e[6]*o,s=e[1]*r+e[4]*n+e[7]*o,l=e[2]*r+e[5]*n+e[8]*o;return i.x=a,i.y=s,i.z=l,i},s.multiplyByScalar=function(e,t,i){return i[0]=e[0]*t,i[1]=e[1]*t,i[2]=e[2]*t,i[3]=e[3]*t,i[4]=e[4]*t,i[5]=e[5]*t,i[6]=e[6]*t,i[7]=e[7]*t,i[8]=e[8]*t,i},s.multiplyByScale=function(e,t,i){return i[0]=e[0]*t.x,i[1]=e[1]*t.x,i[2]=e[2]*t.x,i[3]=e[3]*t.y,i[4]=e[4]*t.y,i[5]=e[5]*t.y,i[6]=e[6]*t.z,i[7]=e[7]*t.z,i[8]=e[8]*t.z,i},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},s.transpose=function(e,t){var i=e[0],r=e[3],n=e[6],o=e[1],a=e[4],s=e[7],l=e[2],u=e[5],c=e[8];return t[0]=i,t[1]=r,t[2]=n,t[3]=o,t[4]=a,t[5]=s,t[6]=l,t[7]=u,t[8]=c,t};var p=[1,0,0],m=[2,2,1],f=new s,_=new s;return s.computeEigenDecomposition=function(e,t){var r=a.EPSILON20,n=10,o=0,h=0;i(t)||(t={});for(var d=t.unitary=s.clone(s.IDENTITY,t.unitary),p=t.diagonal=s.clone(e,t.diagonal),m=r*l(p);hm;)c(p,f),s.transpose(f,_),s.multiply(p,f,p),s.multiply(_,p,p),s.multiply(d,f,d),++o>2&&(++h,o=0);return 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},s.determinant=function(e){var t=e[0],i=e[3],r=e[6],n=e[1],o=e[4],a=e[7],s=e[2],l=e[5],u=e[8];return t*(o*u-l*a)+n*(l*r-i*u)+s*(i*a-o*r)},s.inverse=function(e,t){var i=e[0],r=e[1],n=e[2],o=e[3],a=e[4],l=e[5],u=e[6],c=e[7],h=e[8],d=s.determinant(e);t[0]=a*h-c*l,t[1]=c*n-r*h,t[2]=r*l-a*n,t[3]=u*l-o*h,t[4]=i*h-u*n,t[5]=o*n-i*l,t[6]=o*c-u*a,t[7]=u*r-i*c,t[8]=i*a-o*r;var p=1/d;return s.multiplyByScalar(t,p,t)},s.equals=function(e,t){return e===t||i(e)&&i(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]},s.equalsEpsilon=function(e,t,r){return e===t||i(e)&&i(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,r(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,i){return e[0]===t[i]&&e[1]===t[i+1]&&e[2]===t[i+2]&&e[3]===t[i+3]&&e[4]===t[i+4]&&e[5]===t[i+5]&&e[6]===t[i+6]&&e[7]===t[i+7]&&e[8]===t[i+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),i("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,i,r,n){"use strict";function o(t,i,r,n){this.x=e(t,0),this.y=e(i,0),this.z=e(r,0),this.w=e(n,0)}o.fromElements=function(e,i,r,n,a){return t(a)?(a.x=e,a.y=i,a.z=r,a.w=n,a):new o(e,i,r,n)},o.fromColor=function(e,i){return t(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,i){if(t(e))return t(i)?(i.x=e.x,i.y=e.y,i.z=e.z,i.w=e.w,i):new o(e.x,e.y,e.z,e.w)},o.packedLength=4,o.pack=function(t,i,r){return r=e(r,0),i[r++]=t.x,i[r++]=t.y,i[r++]=t.z,i[r]=t.w,i},o.unpack=function(i,r,n){return r=e(r,0),t(n)||(n=new o),n.x=i[r++],n.y=i[r++],n.z=i[r++],n.w=i[r],n},o.packArray=function(e,i){var r=e.length;t(i)?i.length=4*r:i=new Array(4*r);for(var n=0;nl.x&&e.clone(n,l),Au.y&&e.clone(n,u),Pc.z&&e.clone(n,c)}var D=e.magnitudeSquared(e.subtract(l,o,C)),M=e.magnitudeSquared(e.subtract(u,a,C)),I=e.magnitudeSquared(e.subtract(c,s,C)),R=o,O=l,N=D;M>N&&(N=M,R=a,O=u),I>N&&(N=I,R=s,O=c);var L=w;L.x=.5*(R.x+O.x),L.y=.5*(R.y+O.y),L.z=.5*(R.z+O.z);var B=e.magnitudeSquared(e.subtract(O,L,C)),F=Math.sqrt(B),V=S;V.x=o.x,V.y=a.y,V.z=s.z;var k=E;k.x=l.x,k.y=u.y,k.z=c.z;var z=e.multiplyByScalar(e.add(V,k,C),.5,b),U=0;for(T=0;TU&&(U=G);var W=e.magnitudeSquared(e.subtract(n,L,C));if(W>B){var H=Math.sqrt(W);F=.5*(F+H),B=F*F;var q=H-F;L.x=(F*L.x+q*n.x)/H,L.y=(F*L.y+q*n.y)/H,L.z=(F*L.z+q*n.z)/H}}return Fh.x&&e.clone(s,h),MT.y&&e.clone(s,T),Ix.z&&e.clone(s,x)}var R=e.magnitudeSquared(e.subtract(h,l,C)),O=e.magnitudeSquared(e.subtract(T,u,C)),N=e.magnitudeSquared(e.subtract(x,c,C)),L=l,B=h,F=R;O>F&&(F=O,L=u,B=T),N>F&&(F=N,L=c,B=x);var V=w;V.x=.5*(L.x+B.x),V.y=.5*(L.y+B.y),V.z=.5*(L.z+B.z);var k=e.magnitudeSquared(e.subtract(B,V,C)),z=Math.sqrt(k),U=S;U.x=l.x,U.y=u.y,U.z=c.z;var G=E;G.x=h.x,G.y=T.y,G.z=x.z;var W=e.multiplyByScalar(e.add(U,G,C),.5,b),H=0;for(P=0;PH&&(H=q);var j=e.magnitudeSquared(e.subtract(s,V,C));if(j>k){var Y=Math.sqrt(j);z=.5*(z+Y),k=z*z;var X=Y-z;V.x=(z*V.x+X*s.x)/Y,V.y=(z*V.y+X*s.y)/Y,V.z=(z*V.z+X*s.z)/Y}}return zu.x&&e.clone(o,u),Pc.y&&e.clone(o,c),Dh.z&&e.clone(o,h)}var M=e.magnitudeSquared(e.subtract(u,a,C)),I=e.magnitudeSquared(e.subtract(c,s,C)),R=e.magnitudeSquared(e.subtract(h,l,C)),O=a,N=u,L=M;I>L&&(L=I,O=s,N=c),R>L&&(L=R,O=l,N=h);var B=w;B.x=.5*(O.x+N.x),B.y=.5*(O.y+N.y),B.z=.5*(O.z+N.z);var F=e.magnitudeSquared(e.subtract(N,B,C)),V=Math.sqrt(F),k=S;k.x=a.x,k.y=s.y,k.z=l.z;var z=E;z.x=u.x,z.y=c.y,z.z=h.z;var U=e.multiplyByScalar(e.add(k,z,C),.5,b),G=0;for(x=0;xG&&(G=W);var H=e.magnitudeSquared(e.subtract(o,B,C));if(H>F){var q=Math.sqrt(H);V=.5*(V+q),F=V*V;var j=q-V;B.x=(V*B.x+j*o.x)/q,B.y=(V*B.y+j*o.y)/q,B.z=(V*B.z+j*o.z)/q}}return V=c+l)return t.clone(n),n;if(l>=c+a)return i.clone(n),n;var h=.5*(a+c+l),p=e.multiplyByScalar(u,(-a+h)/c,B);return e.add(p,o,p),e.clone(p,n.center),n.radius=h,n};var F=new e;d.expand=function(t,i,r){r=d.clone(t,r);var n=e.magnitude(e.subtract(i,r.center,F));return n>r.radius&&(r.radius=n),r},d.intersectPlane=function(t,i){var r=t.center,n=t.radius,o=i.normal,a=e.dot(o,r)+i.distance;return a<-n?s.OUTSIDE:a0:o>r&&o*o/t.magnitudeSquared(n)>r;return!a},s.prototype.computeHorizonCullingPoint=function(e,i,n){r(n)||(n=new t);for(var o=this._ellipsoid,a=c(o,e),s=0,h=0,d=i.length;hs&&s/a0?[d/e,n/d]:[n/d,d/e]},r}),i("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function i(e,t,i,r){var n,o,a=e,s=t/3,l=i/3,u=r,c=a*l,h=s*u,d=s*s,p=l*l,m=a*l-d,f=a*u-s*l,_=s*u-p,g=4*m*_-f*f;if(g<0){var v,y,C;d*h>=c*p?(v=a,y=m,C=-2*s*m+a*f):(v=u,y=_,C=-u*f+2*l*_);var w=C<0?-1:1,S=-w*Math.abs(v)*Math.sqrt(-g);o=-C+S;var E=o/2,b=E<0?-Math.pow(-E,1/3):Math.pow(E,1/3),T=o===S?-b:-y/b;return n=y<=0?b+T:-C/(b*b+T*T+y),d*h>=c*p?[(n-s)/a]:[-u/(n+l)]}var x=m,A=-2*s*m+a*f,P=_,D=-u*f+2*l*_,M=Math.sqrt(g),I=Math.sqrt(3)/2,R=Math.abs(Math.atan2(a*M,-A)/3);n=2*Math.sqrt(-x);var O=Math.cos(R);o=n*O;var N=n*(-O/2-I*Math.sin(R)),L=o+N>2*s?o-s:N-s,B=a,F=L/B;R=Math.abs(Math.atan2(u*M,-D)/3),n=2*Math.sqrt(-P),O=Math.cos(R),o=n*O,N=n*(-O/2-I*Math.sin(R));var V=-u,k=o+N<2*l?o+l:N+l,z=V/k,U=B*k,G=-L*k-B*V,W=L*V,H=(l*G-s*W)/(-s*G+l*U);return F<=H?F<=z?H<=z?[F,H,z]:[F,z,H]:[z,F,H]:F<=z?[H,F,z]:H<=z?[H,z,F]:[z,H,F]}var r={};return r.computeDiscriminant=function(e,t,i,r){var n=e*e,o=t*t,a=i*i,s=r*r,l=18*e*t*i*r+o*a-27*n*s-4*(e*a*i+o*t*r);return l},r.computeRealRoots=function(e,r,n,o){var a,s;if(0===e)return t.computeRealRoots(r,n,o);if(0===r){if(0===n){if(0===o)return[0,0,0];s=-o/e;var l=s<0?-Math.pow(-s,1/3):Math.pow(s,1/3);return[l,l,l]}return 0===o?(a=t.computeRealRoots(e,0,n),0===a.Length?[0]:[a[0],0,a[1]]):i(e,0,n,o)}return 0===n?0===o?(s=-r/e,s<0?[s,0,0]:[0,0,s]):i(e,r,0,o):0===o?(a=t.computeRealRoots(e,r,n),0===a.length?[0]:a[1]<=0?[a[0],a[1],0]:a[0]>=0?[0,a[0],a[1]]:[a[0],0,a[1]]):i(e,r,n,o)},r}),i("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,i,r){"use strict";function n(t,n,o,a){var s=t*t,l=n-3*s/8,u=o-n*t/2+s*t/8,c=a-o*t/4+n*s/16-3*s*s/256,h=e.computeRealRoots(1,2*l,l*l-4*c,-u*u);if(h.length>0){var d=-t/4,p=h[h.length-1];if(Math.abs(p)=0&&g>=0){var v=Math.sqrt(_),y=Math.sqrt(g);return[d-y,d-v,d+v,d+y]}if(_>=0&&g<0)return f=Math.sqrt(_),[d-f,d+f];if(_<0&&g>=0)return f=Math.sqrt(g),[d-f,d+f]}return[]}if(p>0){var C=Math.sqrt(p),w=(l+p-u/C)/2,S=(l+p+u/C)/2,E=r.computeRealRoots(1,C,w),b=r.computeRealRoots(1,-C,S);return 0!==E.length?(E[0]+=d,E[1]+=d,0!==b.length?(b[0]+=d,b[1]+=d,E[1]<=b[0]?[E[0],E[1],b[0],b[1]]:b[1]<=E[0]?[b[0],b[1],E[0],E[1]]:E[0]>=b[0]&&E[1]<=b[1]?[b[0],E[0],E[1],b[1]]:b[0]>=E[0]&&b[1]<=E[1]?[E[0],b[0],b[1],E[1]]:E[0]>b[0]&&E[0]0){var m,f,_=p[0],g=n-_,v=g*g,y=t/2,C=g/2,w=v-4*a,S=v+4*Math.abs(a),E=u-4*_,b=u+4*Math.abs(_);if(_<0||w*b=R[0]&&I[1]<=R[1]?[R[0],I[0],I[1],R[1]]:R[0]>=I[0]&&R[1]<=I[1]?[I[0],R[0],R[1],I[1]]:I[0]>R[0]&&I[0]0){var o=1/(2*e),a=Math.sqrt(n),s=(-t+a)*o,l=(-t-a)*o;return s0?y.push(new e(n,u*B,u*-k)):0!==k?(y.push(new e(n,u*B,u*-k)),y.push(new e(n,u*B,u*k)),++N):y.push(new e(n,u*B,u*k))}return y}var m={};m.rayPlane=function(t,i,n){r(n)||(n=new e);var a=t.origin,s=t.direction,l=i.normal,u=e.dot(l,s);if(!(Math.abs(u)E)return;if(u=e.cross(l,C,y),h=e.dot(m,u),h<0||c+h>E)return;d=e.dot(w,u)/E}else{if(Math.abs(E)1)return;if(u=e.cross(l,C,y),h=e.dot(m,u)*b,h<0||c+h>1)return;d=e.dot(w,u)*b}return d},m.rayTriangle=function(t,i,n,o,a,s){var l=m.rayTriangleParametric(t,i,n,o,a);if(r(l)&&!(l<0))return r(s)||(s=new e),e.multiplyByScalar(t.direction,l,s),e.add(t.origin,s,s)};var C=new u;m.lineSegmentTriangle=function(t,i,n,o,a,s,l){var u=C;e.clone(t,u.origin),e.subtract(i,t,u.direction),e.normalize(u.direction,u.direction);var c=m.rayTriangleParametric(u,n,o,a,s);if(!(!r(c)||c<0||c>e.distance(t,i)))return r(l)||(l=new e),e.multiplyByScalar(u.direction,c,l),e.add(u.origin,l,l)};var w={root0:0,root1:0};m.raySphere=function(e,t,i){if(i=h(e,t,i),r(i)&&!(i.stop<0))return i.start=Math.max(i.start,0),i};var S=new u;m.lineSegmentSphere=function(t,i,n,o){var a=S;e.clone(t,a.origin);var s=e.subtract(i,t,a.direction),l=e.magnitude(s);if(e.normalize(s,s),o=h(a,n,o),!(!r(o)||o.stop<0||o.start>l))return o.start=Math.max(o.start,0),o.stop=Math.min(o.stop,l),o};var E=new e,b=new e;m.rayEllipsoid=function(t,i){var r,n,o,a,s,l=i.oneOverRadii,u=e.multiplyComponents(l,t.origin,E),c=e.multiplyComponents(l,t.direction,b),h=e.magnitudeSquared(u),d=e.dot(u,c);if(h>1){if(d>=0)return;var p=d*d;if(r=h-1,n=e.magnitudeSquared(c),o=n*r,po){a=d*d-o,s=-d+Math.sqrt(a);var m=s/n,f=r/s;return m=0)return n}var u=r(this.rayEllipsoid(t,i)),c=i.transformPositionToScaledSpace(s,T),h=e.normalize(c,c),d=e.mostOrthogonalAxis(c,P),m=e.normalize(e.cross(d,h,x),x),f=e.normalize(e.cross(h,m,A),A),_=M;_[0]=h.x,_[1]=h.y,_[2]=h.z,_[3]=m.x,_[4]=m.y,_[5]=m.z,_[6]=f.x,_[7]=f.y,_[8]=f.z;var g=a.transpose(_,I),v=a.fromScale(i.radii,R),y=a.fromScale(i.oneOverRadii,O),C=N;C[0]=0,C[1]=-s.z,C[2]=s.y,C[3]=s.z,C[4]=0,C[5]=-s.x,C[6]=-s.y,C[7]=s.x,C[8]=0;var w,S,E=a.multiply(a.multiply(g,y,L),C,L),b=a.multiply(a.multiply(E,v,B),_,B),z=a.multiplyByVector(E,n,D),U=p(b,e.negate(z,T),0,0,1),G=U.length;if(G>0){for(var W=e.clone(e.ZERO,V),H=Number.NEGATIVE_INFINITY,q=0;qH&&(H=Y,W=e.clone(w,W))}var X=i.cartesianToCartographic(W,k);return H=o.clamp(H,0,1),S=e.magnitude(e.subtract(W,n,P))*Math.sqrt(1-H*H),S=u?-S:S,X.height=S,i.cartographicToCartesian(X,new e)}};var z=new e;return m.lineSegmentPlane=function(t,i,n,a){r(a)||(a=new e);var s=e.subtract(i,t,z),l=n.normal,u=e.dot(l,s);if(!(Math.abs(u)1))return e.multiplyByScalar(s,h,a),e.add(t,a,a),a}},m.trianglePlaneIntersection=function(t,i,r,n){var o=n.normal,a=n.distance,s=e.dot(o,t)+a<0,l=e.dot(o,i)+a<0,u=e.dot(o,r)+a<0,c=0;c+=s?1:0,c+=l?1:0,c+=u?1:0;var h,d;if(1!==c&&2!==c||(h=new e,d=new e),1===c){if(s)return m.lineSegmentPlane(t,i,n,h),m.lineSegmentPlane(t,r,n,d),{positions:[t,i,r,h,d],indices:[0,3,4,1,2,4,1,4,3]};if(l)return m.lineSegmentPlane(i,r,n,h),m.lineSegmentPlane(i,t,n,d),{positions:[t,i,r,h,d],indices:[1,3,4,2,0,4,2,4,3]};if(u)return m.lineSegmentPlane(r,t,n,h),m.lineSegmentPlane(r,i,n,d),{positions:[t,i,r,h,d],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===c){if(!s)return m.lineSegmentPlane(i,t,n,h),m.lineSegmentPlane(r,t,n,d),{positions:[t,i,r,h,d],indices:[1,2,4,1,4,3,0,3,4]};if(!l)return m.lineSegmentPlane(r,i,n,h),m.lineSegmentPlane(t,i,n,d),{positions:[t,i,r,h,d],indices:[2,0,4,2,4,3,1,3,4]};if(!u)return m.lineSegmentPlane(t,r,n,h),m.lineSegmentPlane(i,r,n,d),{positions:[t,i,r,h,d],indices:[0,1,4,0,4,3,2,3,4]}}},m}),i("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,i,r){"use strict";function n(t,i){this.normal=e.clone(t),this.distance=i}n.fromPointNormal=function(i,r,o){var a=-e.dot(r,i);return t(o)?(e.clone(r,o.normal),o.distance=a,o):new n(r,a)};var o=new e;return n.fromCartesian4=function(i,r){var a=e.fromCartesian4(i,o),s=i.w;return t(r)?(e.clone(a,r.normal),r.distance=s,r):new n(a,s)},n.getPointDistance=function(t,i){return e.dot(t.normal,i)+t.distance},n.ORIGIN_XY_PLANE=r(new n(e.UNIT_Z,0)),n.ORIGIN_YZ_PLANE=r(new n(e.UNIT_X,0)),n.ORIGIN_ZX_PLANE=r(new n(e.UNIT_Y,0)),n}),i("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(i,r){t(n[i])||(n[i]=!0,console.log(e(r,i)))}var n={};return r.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.",r}),i("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,i){"use strict";function r(e,t){i(e,t)}return r}),i("Core/binarySearch",["./defined","./DeveloperError"],function(e,t){"use strict";function i(e,t,i){for(var r,n,o=0,a=e.length-1;o<=a;)if(r=~~((o+a)/2),n=i(e[r],t),n<0)o=r+1;else{if(!(n>0))return r;a=r-1}return~(a+1)}return i}),i("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,i,r,n){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=i,this.yPoleOffset=r,this.ut1MinusUtc=n}return e}),i("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,i=0,r=t[i++],n=function(e,t,i,r){i||(i=" ");var n=e.length>=t?"":Array(1+t-e.length>>>0).join(i);return r?e+n:n+e},o=function(e,t,i,r,o,a){var s=r-e.length;return s>0&&(e=i||!o?n(e,r,a,i):e.slice(0,t.length)+n("",s,"0",!0)+e.slice(t.length)),e},a=function(e,t,i,r,a,s,l){var u=e>>>0;return i=i&&u&&{2:"0b",8:"0",16:"0x"}[t]||"",e=i+n(u.toString(t),s||0,"0",!1),o(e,i,r,a,l)},s=function(e,t,i,r,n,a){return null!=r&&(e=e.slice(0,r)),o(e,"",t,i,n,a)},l=function(e,r,l,u,c,h,d){var p,m,f,_,g;if("%%"==e)return"%";for(var v=!1,y="",C=!1,w=!1,S=" ",E=l.length,b=0;l&&b-1?6:"d"==d?0:void 0,g=r?t[r.slice(0,-1)]:t[i++],d){case"s":return s(String(g),v,u,h,C,S);case"c":return s(String.fromCharCode(+g),v,u,h,C);case"b":return a(g,2,w,v,u,h,C);case"o":return a(g,8,w,v,u,h,C);case"x":return a(g,16,w,v,u,h,C);case"X":return a(g,16,w,v,u,h,C).toUpperCase();case"u":return a(g,10,w,v,u,h,C);case"i":case"d":return p=+g||0,p=Math.round(p-p%1),m=p<0?"-":y,g=m+n(String(Math.abs(p)),h,"0",!1),o(g,m,v,u,C);case"e":case"E":case"f":case"F":case"g":case"G":return p=+g,m=p<0?"-":y,f=["toExponential","toFixed","toPrecision"]["efg".indexOf(d.toLowerCase())],_=["toString","toUpperCase"]["eEfFgG".indexOf(d)%2],g=m+Math.abs(p)[f](h),o(g,m,v,u,C)[_]();default:return e}};return r.replace(e,l)}return e}),i("Core/GregorianDate",[],function(){"use strict";function e(e,t,i,r,n,o,a,s){this.year=e,this.month=t,this.day=i,this.hour=r,this.minute=n,this.second=o,this.millisecond=a,this.isLeapSecond=s}return e}),i("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),i("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),i("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e(t)}),i("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),i("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e,t){return f.compare(e.julianDate,t.julianDate)}function h(e){y.julianDate=e;var i=f.leapSeconds,r=t(i,y,c);r<0&&(r=~r),r>=i.length&&(r=i.length-1);var n=i[r].offset;if(r>0){var o=f.secondsDifference(i[r].julianDate,e);o>n&&(r--,n=i[r].offset)}f.addSeconds(e,n,e)}function d(e,i){y.julianDate=e;var r=f.leapSeconds,n=t(r,y,c);if(n<0&&(n=~n),0===n)return f.addSeconds(e,-r[0].offset,i);if(n>=r.length)return f.addSeconds(e,-r[n-1].offset,i);var o=f.secondsDifference(r[n].julianDate,e);return 0===o?f.addSeconds(e,-r[n].offset,i):o<=1?void 0:f.addSeconds(e,-r[--n].offset,i)}function p(e,t,i){var r=t/l.SECONDS_PER_DAY|0;return e+=r,t-=l.SECONDS_PER_DAY*r,t<0&&(e--,t+=l.SECONDS_PER_DAY),i.dayNumber=e,i.secondsOfDay=t,i}function m(e,t,i,r,n,o,a){var s=(t-14)/12|0,u=e+4800+s,c=(1461*u/4|0)+(367*(t-2-12*s)/12|0)-(3*((u+100)/100|0)/4|0)+i-32075;r-=12,r<0&&(r+=24);var h=o+(r*l.SECONDS_PER_HOUR+n*l.SECONDS_PER_MINUTE+a*l.SECONDS_PER_MILLISECOND);return h>=43200&&(c-=1),[c,h]}function f(e,t,r){this.dayNumber=void 0,this.secondsOfDay=void 0,e=i(e,0),t=i(t,0),r=i(r,u.UTC);var n=0|e;t+=(e-n)*l.SECONDS_PER_DAY,p(n,t,this),r===u.UTC&&h(this)}var _=new o,g=[31,28,31,30,31,30,31,31,30,31,30,31],v=29,y=new s,C=/^(\d{4})$/,w=/^(\d{4})-(\d{2})$/,S=/^(\d{4})-?(\d{3})$/,E=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,b=/^(\d{4})-?(\d{2})-?(\d{2})$/,T=/([Z+\-])?(\d{2})?:?(\d{2})?$/,x=/^(\d{2})(\.\d+)?/.source+T.source,A=/^(\d{2}):?(\d{2})(\.\d+)?/.source+T.source,P=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+T.source;f.fromDate=function(e,t){var i=m(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r(t)?(p(i[0],i[1],t),h(t),t):new f(i[0],i[1],u.UTC)},f.fromIso8601=function(e,t){e=e.replace(",",".");var i,n,o,s=e.split("T"),l=1,c=1,d=0,_=0,y=0,T=0,D=s[0],M=s[1];if(s=D.match(b),null!==s)i=+s[1],l=+s[2],c=+s[3];else if(s=D.match(w),null!==s)i=+s[1],l=+s[2];else if(s=D.match(C),null!==s)i=+s[1];else{var I;if(s=D.match(S),null!==s)i=+s[1],I=+s[2],o=a(i);else if(s=D.match(E),null!==s){i=+s[1];var R=+s[2],O=+s[3]||0,N=new Date(Date.UTC(i,0,4)); -I=7*R+O-N.getUTCDay()-3}n=new Date(Date.UTC(i,0,1)),n.setUTCDate(I),l=n.getUTCMonth()+1,c=n.getUTCDate()}o=a(i);var L;if(r(M)){s=M.match(P),null!==s?(d=+s[1],_=+s[2],y=+s[3],T=1e3*+(s[4]||0),L=5):(s=M.match(A),null!==s?(d=+s[1],_=+s[2],y=60*+(s[3]||0),L=4):(s=M.match(x),null!==s&&(d=+s[1],_=60*+(s[2]||0),L=3)));var B=s[L],F=+s[L+1],V=+(s[L+2]||0);switch(B){case"+":d-=F,_-=V;break;case"-":d+=F,_+=V;break;case"Z":break;default:_+=new Date(Date.UTC(i,l-1,c,d,_)).getTimezoneOffset()}}else _+=new Date(i,l-1,c).getTimezoneOffset();var k=60===y;for(k&&y--;_>=60;)_-=60,d++;for(;d>=24;)d-=24,c++;for(n=o&&2===l?v:g[l-1];c>n;)c-=n,l++,l>12&&(l-=12,i++),n=o&&2===l?v:g[l-1];for(;_<0;)_+=60,d--;for(;d<0;)d+=24,c--;for(;c<1;)l--,l<1&&(l+=12,i--),n=o&&2===l?v:g[l-1],c+=n;var z=m(i,l,c,d,_,y,T);return r(t)?(p(z[0],z[1],t),h(t)):t=new f(z[0],z[1],u.UTC),k&&f.addSeconds(t,1,t),t},f.now=function(e){return f.fromDate(new Date,e)};var D=new f(0,0,u.TAI);return f.toGregorianDate=function(e,t){var i=!1,n=d(e,D);r(n)||(f.addSeconds(e,-1,D),n=d(D,D),i=!0);var a=n.dayNumber,s=n.secondsOfDay;s>=43200&&(a+=1);var u=a+68569|0,c=4*u/146097|0;u=u-((146097*c+3)/4|0)|0;var h=4e3*(u+1)/1461001|0;u=u-(1461*h/4|0)+31|0;var p=80*u/2447|0,m=u-(2447*p/80|0)|0;u=p/11|0;var _=p+2-12*u|0,g=100*(c-49)+h+u|0,v=s/l.SECONDS_PER_HOUR|0,y=s-v*l.SECONDS_PER_HOUR,C=y/l.SECONDS_PER_MINUTE|0;y-=C*l.SECONDS_PER_MINUTE;var w=0|y,S=(y-w)/l.SECONDS_PER_MILLISECOND;return v+=12,v>23&&(v-=24),i&&(w+=1),r(t)?(t.year=g,t.month=_,t.day=m,t.hour=v,t.minute=C,t.second=w,t.millisecond=S,t.isLeapSecond=i,t):new o(g,_,m,v,C,w,S,i)},f.toDate=function(e){var t=f.toGregorianDate(e,_),i=t.second;return t.isLeapSecond&&(i-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,i,t.millisecond))},f.toIso8601=function(t,i){var n,o=f.toGregorianDate(t,o);return r(i)||0===o.millisecond?r(i)&&0!==i?(n=(.01*o.millisecond).toFixed(i).replace(".","").slice(0,i),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",o.year,o.month,o.day,o.hour,o.minute,o.second,n)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",o.year,o.month,o.day,o.hour,o.minute,o.second):(n=(.01*o.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",o.year,o.month,o.day,o.hour,o.minute,o.second,n))},f.clone=function(e,t){if(r(e))return r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new f(e.dayNumber,e.secondsOfDay,u.TAI)},f.compare=function(e,t){var i=e.dayNumber-t.dayNumber;return 0!==i?i:e.secondsOfDay-t.secondsOfDay},f.equals=function(e,t){return e===t||r(e)&&r(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},f.equalsEpsilon=function(e,t,i){return e===t||r(e)&&r(t)&&Math.abs(f.secondsDifference(e,t))<=i},f.totalDays=function(e){return e.dayNumber+e.secondsOfDay/l.SECONDS_PER_DAY},f.secondsDifference=function(e,t){var i=(e.dayNumber-t.dayNumber)*l.SECONDS_PER_DAY;return i+(e.secondsOfDay-t.secondsOfDay)},f.daysDifference=function(e,t){var i=e.dayNumber-t.dayNumber,r=(e.secondsOfDay-t.secondsOfDay)/l.SECONDS_PER_DAY;return i+r},f.computeTaiMinusUtc=function(e){y.julianDate=e;var i=f.leapSeconds,r=t(i,y,c);return r<0&&(r=~r,--r,r<0&&(r=0)),i[r].offset},f.addSeconds=function(e,t,i){return p(e.dayNumber,e.secondsOfDay+t,i)},f.addMinutes=function(e,t,i){var r=e.secondsOfDay+t*l.SECONDS_PER_MINUTE;return p(e.dayNumber,r,i)},f.addHours=function(e,t,i){var r=e.secondsOfDay+t*l.SECONDS_PER_HOUR;return p(e.dayNumber,r,i)},f.addDays=function(e,t,i){var r=e.dayNumber+t;return p(r,e.secondsOfDay,i)},f.lessThan=function(e,t){return f.compare(e,t)<0},f.lessThanOrEquals=function(e,t){return f.compare(e,t)<=0},f.greaterThan=function(e,t){return f.compare(e,t)>0},f.greaterThanOrEquals=function(e,t){return f.compare(e,t)>=0},f.prototype.clone=function(e){return f.clone(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f.prototype.equalsEpsilon=function(e,t){return f.equalsEpsilon(this,e,t)},f.prototype.toString=function(){return f.toIso8601(this)},f.leapSeconds=[new s(new f(2441317,43210,u.TAI),10),new s(new f(2441499,43211,u.TAI),11),new s(new f(2441683,43212,u.TAI),12),new s(new f(2442048,43213,u.TAI),13),new s(new f(2442413,43214,u.TAI),14),new s(new f(2442778,43215,u.TAI),15),new s(new f(2443144,43216,u.TAI),16),new s(new f(2443509,43217,u.TAI),17),new s(new f(2443874,43218,u.TAI),18),new s(new f(2444239,43219,u.TAI),19),new s(new f(2444786,43220,u.TAI),20),new s(new f(2445151,43221,u.TAI),21),new s(new f(2445516,43222,u.TAI),22),new s(new f(2446247,43223,u.TAI),23),new s(new f(2447161,43224,u.TAI),24),new s(new f(2447892,43225,u.TAI),25),new s(new f(2448257,43226,u.TAI),26),new s(new f(2448804,43227,u.TAI),27),new s(new f(2449169,43228,u.TAI),28),new s(new f(2449534,43229,u.TAI),29),new s(new f(2450083,43230,u.TAI),30),new s(new f(2450630,43231,u.TAI),31),new s(new f(2451179,43232,u.TAI),32),new s(new f(2453736,43233,u.TAI),33),new s(new f(2454832,43234,u.TAI),34),new s(new f(2456109,43235,u.TAI),35),new s(new f(2457204,43236,u.TAI),36),new s(new f(2457754,43237,u.TAI),37)],f}),i("Core/clone",["./defaultValue"],function(e){"use strict";function t(i,r){if(null===i||"object"!=typeof i)return i;r=e(r,!1);var n=new i.constructor;for(var o in i)if(i.hasOwnProperty(o)){var a=i[o];r&&(a=t(a,r)),n[o]=a}return n}return t}),i("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var i=e.split("\r\n"),r=0;r0){var a=n.substring(0,o),s=n.substring(o+2);t[a]=s}}return t}return e}),i("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function i(e,i,r){this.statusCode=e,this.response=i,this.responseHeaders=r,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return i.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},i}),i("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var i=r.exec(t);this.scheme=i[1],this.authority=i[2],this.path=i[3],this.query=i[4],this.fragment=i[5]}}function t(e){var t=unescape(e);return o.test(t)?t:e.toUpperCase()}function i(e,t,i,r){return(t||"")+i.toLowerCase()+(r||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var r=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(a,i).replace(n,t)),this.path&&(this.path=this.path.replace(n,t)),this.query&&(this.query=this.query.replace(n,t)),this.fragment&&(this.fragment=this.fragment.replace(n,t))};var n=/%[0-9a-z]{2}/gi,o=/[a-zA-Z0-9\-\._~]/,a=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var i=new e;return this.scheme?(i.scheme=this.scheme,i.authority=this.authority,i.path=this.path,i.query=this.query):(i.scheme=t.scheme,this.authority?(i.authority=this.authority,i.path=this.path,i.query=this.query):(i.authority=t.authority,""==this.path?(i.path=t.path,i.query=this.query||t.query):("/"==this.path.charAt(0)?(i.path=this.path,i.removeDotSegments()):(t.authority&&""==t.path?i.path="/"+this.path:i.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,i.removeDotSegments()),i.query=this.query))),i.fragment=this.fragment,i},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),i=[],r=""==t[0];r&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?i.pop():"."!=e&&i.push(e);"."!=e&&".."!=e||i.push(""),r&&i.unshift(""),this.path=i.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),i("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(i){var r=new e(i);r.normalize();var n=r.getAuthority();if(t(n)){if(n.indexOf("@")!==-1){var o=n.split("@");n=o[1]}if(n.indexOf(":")===-1){var a=r.getScheme();if(t(a)||(a=window.location.protocol,a=a.substring(0,a.length-1)),"http"===a)n+=":80";else{if("https"!==a)return;n+=":443"}}return n}}var n={},o={};return n.add=function(e,i){var r=e.toLowerCase()+":"+i;t(o[r])||(o[r]=!0)},n.remove=function(e,i){var r=e.toLowerCase()+":"+i;t(o[r])&&delete o[r]},n.contains=function(e){var i=r(e);return!(!t(i)||!t(o[i]))},n.clear=function(){o={}},n}),i("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,i,r,n,o,a){"use strict";function s(i){i=t(i,t.EMPTY_OBJECT);var r=i.responseType,n=t(i.method,"GET"),o=i.data,a=i.headers,l=i.overrideMimeType;return e(i.url,function(t){var i=e.defer();return s.load(t,r,n,o,a,i,l),i.promise})}function l(e,t){var i=decodeURIComponent(t);return e?atob(i):i}function u(e,t){for(var i=l(e,t),r=new ArrayBuffer(i.length),n=new Uint8Array(r),o=0;o=300)return void u.reject(new n(m.status,m.response,m.getAllResponseHeaders()));var e=m.response,r=m.responseType;if(!i(e)||i(t)&&r!==t)if("json"===t&&"string"==typeof e)try{u.resolve(JSON.parse(e))}catch(e){u.reject(e)}else(""===r||"document"===r)&&i(m.responseXML)&&m.responseXML.hasChildNodes()?u.resolve(m.responseXML):""!==r&&"text"!==r||!i(m.responseText)?u.reject(new o("Invalid XMLHttpRequest response type.")):u.resolve(m.responseText);else u.resolve(e)},m.onerror=function(e){u.reject(new n)},m.send(s)},s.defaultLoad=s.load,s}),i("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,i){return e({url:t,headers:i})}return t}),i("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,i,r){"use strict";function n(i,n){return t(n)?t(n.Accept)||(n=e(n),n.Accept=o.Accept):n=o,r(i,n).then(function(e){return JSON.parse(e)})}var o={Accept:"application/json,*/*;q=0.01"};return n}),i("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,i,r,n,o,a,s,l,u,c,h){"use strict";function d(t){if(t=i(t,i.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=i(t.addNewLeapSeconds,!0),r(t.data))m(this,t.data);else if(r(t.url)){var n=this;this._downloadPromise=e(l(t.url),function(e){m(n,e)},function(){n._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else m(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function p(e,t){return a.compare(e.julianDate,t)}function m(e,i){if(!r(i.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!r(i.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var n=i.columnNames.indexOf("modifiedJulianDateUtc"),o=i.columnNames.indexOf("xPoleWanderRadians"),l=i.columnNames.indexOf("yPoleWanderRadians"),u=i.columnNames.indexOf("ut1MinusUtcSeconds"),d=i.columnNames.indexOf("xCelestialPoleOffsetRadians"),m=i.columnNames.indexOf("yCelestialPoleOffsetRadians"),f=i.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||o<0||l<0||u<0||d<0||m<0||f<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var _=e._samples=i.samples,g=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=o,e._yPoleWanderRadiansColumn=l,e._ut1MinusUtcSecondsColumn=u,e._xCelestialPoleOffsetRadiansColumn=d,e._yCelestialPoleOffsetRadiansColumn=m,e._taiMinusUtcSecondsColumn=f,e._columnCount=i.columnNames.length,e._lastIndex=void 0;for(var v,y=e._addNewLeapSeconds,C=0,w=_.length;Ct.length-1)return s.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;var u=t[n],c=t[o];if(u.equals(c)||r.equals(u))return f(e,i,n,l,s),s;if(r.equals(c))return f(e,i,o,l,s),s;var h=a.secondsDifference(r,u)/a.secondsDifference(c,u),d=n*l,p=o*l,m=i[d+e._ut1MinusUtcSecondsColumn],g=i[p+e._ut1MinusUtcSecondsColumn],v=g-m;if(v>.5||v<-.5){var y=i[d+e._taiMinusUtcSecondsColumn],C=i[p+e._taiMinusUtcSecondsColumn];y!==C&&(c.equals(r)?m=g:g-=C-y)}return s.xPoleWander=_(h,i[d+e._xPoleWanderRadiansColumn],i[p+e._xPoleWanderRadiansColumn]),s.yPoleWander=_(h,i[d+e._yPoleWanderRadiansColumn],i[p+e._yPoleWanderRadiansColumn]),s.xPoleOffset=_(h,i[d+e._xCelestialPoleOffsetRadiansColumn],i[p+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=_(h,i[d+e._yCelestialPoleOffsetRadiansColumn],i[p+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=_(h,m,g),s}return d.NONE=o({getPromiseToLoad:function(){return e()},compute:function(e,t){return r(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new n(0,0,0,0,0),t}}),d.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},d.prototype.compute=function(e,i){if(r(this._samples)){if(r(i)||(i=new n(0,0,0,0,0)),0===this._samples.length)return i.xPoleWander=0,i.yPoleWander=0,i.xPoleOffset=0,i.yPoleOffset=0,i.ut1MinusUtc=0,i;var o=this._dates,s=this._lastIndex,l=0,c=0;if(r(s)){var h=o[s],d=o[s+1],p=a.lessThanOrEquals(h,e),m=!r(d),f=m||a.greaterThanOrEquals(d,e);if(p&&f)return l=s,!m&&d.equals(e)&&++l,c=l+1,g(this,o,this._samples,e,l,c,i),i}var _=t(o,e,a.compare,this._dateColumn);return _>=0?(_=this._totalSamples&&(l=this._totalSamples-1);for(var h=s/this._samplesPerXysFile|0,d=l/this._samplesPerXysFile|0,p=[],m=h;m<=d;++m)p.push(c(this,m));return e.all(p)},l.prototype.computeXysRadians=function(e,t,i){var o=u(this,e,t);if(!(o<0)){var a=o/this._stepSizeDays|0;if(!(a>=this._totalSamples)){var s=this._interpolationOrder,l=a-(s/2|0);l<0&&(l=0);var h=l+s;h>=this._totalSamples&&(h=this._totalSamples-1,l=h-s,l<0&&(l=0));var d=!1,p=this._samples;if(r(p[3*l])||(c(this,l/this._samplesPerXysFile|0),d=!0),r(p[3*h])||(c(this,h/this._samplesPerXysFile|0),d=!0),!d){r(i)?(i.x=0,i.y=0,i.s=0):i=new n(0,0,0);var m,f,_=o-l*this._stepSizeDays,g=this._work,v=this._denominators,y=this._coef,C=this._xTable;for(m=0;m<=s;++m)g[m]=_-C[m];for(m=0;m<=s;++m){for(y[m]=1,f=0;f<=s;++f)f!==m&&(y[m]*=g[f]);y[m]*=v[m];var w=3*(l+m);i.x+=y[m]*p[w++],i.y+=y[m]*p[w++],i.s+=y[m]*p[w]}return i}}}},l}),i("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var i,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},n={};return t(n,{element:{get:function(){if(n.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(n.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(n.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(n.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(n.supportsFullscreen())return null!==n.element}}}),n.supportsFullscreen=function(){if(e(i))return i;i=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",i=!0;for(var n,o=["webkit","moz","o","ms","khtml"],a=0,s=o.length;a0)r=Math.sqrt(f+1),u=.5*r,r=.5/r,n=(e[s.COLUMN1ROW2]-e[s.COLUMN2ROW1])*r,o=(e[s.COLUMN2ROW0]-e[s.COLUMN0ROW2])*r,a=(e[s.COLUMN0ROW1]-e[s.COLUMN1ROW0])*r;else{var _=c,g=0;p>d&&(g=1),m>d&&m>p&&(g=2);var v=_[g],y=_[v];r=Math.sqrt(e[s.getElementIndex(g,g)]-e[s.getElementIndex(v,v)]-e[s.getElementIndex(y,y)]+1);var C=h;C[g]=.5*r,r=.5/r,u=(e[s.getElementIndex(y,v)]-e[s.getElementIndex(v,y)])*r,C[v]=(e[s.getElementIndex(v,g)]+e[s.getElementIndex(g,v)])*r,C[y]=(e[s.getElementIndex(y,g)]+e[s.getElementIndex(g,y)])*r,n=-C[0],o=-C[1],a=-C[2]}return i(t)?(t.x=n,t.y=o,t.z=a,t.w=u,t):new l(n,o,a,u)};var d=new l;l.fromHeadingPitchRoll=function(t,i,r,n){var o=l.fromAxisAngle(e.UNIT_X,r,d),a=l.fromAxisAngle(e.UNIT_Y,-i,n);n=l.multiply(a,o,a);var s=l.fromAxisAngle(e.UNIT_Z,-t,d);return l.multiply(s,n,n)};var p=new e,m=new e,f=new l,_=new l,g=new l;l.packedLength=4,l.pack=function(e,i,r){return r=t(r,0),i[r++]=e.x,i[r++]=e.y,i[r++]=e.z,i[r]=e.w,i},l.unpack=function(e,r,n){return r=t(r,0),i(n)||(n=new l),n.x=e[r],n.y=e[r+1],n.z=e[r+2],n.w=e[r+3],n},l.packedInterpolationLength=3,l.convertPackedArrayForInterpolation=function(e,t,i,r){l.unpack(e,4*i,g),l.conjugate(g,g);for(var n=0,o=i-t+1;n=0?n=1:(n=-1,o=-o);for(var a=o-1,s=1-i,u=i*i,c=s*s,h=7;h>=0;--h)M[h]=(P[h]*u-D[h])*a,I[h]=(P[h]*c-D[h])*a;var d=n*i*(1+M[0]*(1+M[1]*(1+M[2]*(1+M[3]*(1+M[4]*(1+M[5]*(1+M[6]*(1+M[7])))))))),p=s*(1+I[0]*(1+I[1]*(1+I[2]*(1+I[3]*(1+I[4]*(1+I[5]*(1+I[6]*(1+I[7])))))))),m=l.multiplyByScalar(e,p,x);return l.multiplyByScalar(t,d,r),l.add(m,r,r)},l.fastSquad=function(e,t,i,r,n,o){var a=l.fastSlerp(e,t,n,b),s=l.fastSlerp(i,r,n,T); -return l.fastSlerp(a,s,2*n*(1-n),o)},l.equals=function(e,t){return e===t||i(e)&&i(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},l.equalsEpsilon=function(e,t,r){return e===t||i(e)&&i(t)&&Math.abs(e.x-t.x)<=r&&Math.abs(e.y-t.y)<=r&&Math.abs(e.z-t.z)<=r&&Math.abs(e.w-t.w)<=r},l.ZERO=o(new l(0,0,0,0)),l.IDENTITY=o(new l(0,0,0,1)),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},l}),i("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./defaultValue","./defined","./deprecationWarning","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./HeadingPitchRoll","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C){"use strict";var w={},S=new i,E=new i,b=new i;w.eastNorthUpToFixedFrame=function(e,t,r){if(_.equalsEpsilon(e.x,0,_.EPSILON14)&&_.equalsEpsilon(e.y,0,_.EPSILON14)){var n=_.sign(e.z);return a(r)?(r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=-n,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=n,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new v(0,-n,0,e.x,1,0,0,e.y,0,0,n,e.z,0,0,0,1)}var s=S,l=E,u=b;return t=o(t,h.WGS84),t.geodeticSurfaceNormal(e,s),l.x=-e.y,l.y=e.x,l.z=0,i.normalize(l,l),i.cross(s,l,u),a(r)?(r[0]=l.x,r[1]=l.y,r[2]=l.z,r[3]=0,r[4]=u.x,r[5]=u.y,r[6]=u.z,r[7]=0,r[8]=s.x,r[9]=s.y,r[10]=s.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new v(l.x,u.x,s.x,e.x,l.y,u.y,s.y,e.y,l.z,u.z,s.z,e.z,0,0,0,1)};var T=new i,x=new i,A=new i;w.northEastDownToFixedFrame=function(e,t,r){if(_.equalsEpsilon(e.x,0,_.EPSILON14)&&_.equalsEpsilon(e.y,0,_.EPSILON14)){var n=_.sign(e.z);return a(r)?(r[0]=-n,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=-n,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new v(-n,0,0,e.x,0,1,0,e.y,0,0,-n,e.z,0,0,0,1)}var s=T,l=x,u=A;return t=o(t,h.WGS84),t.geodeticSurfaceNormal(e,s),l.x=-e.y,l.y=e.x,l.z=0,i.normalize(l,l),i.cross(s,l,u),a(r)?(r[0]=u.x,r[1]=u.y,r[2]=u.z,r[3]=0,r[4]=l.x,r[5]=l.y,r[6]=l.z,r[7]=0,r[8]=-s.x,r[9]=-s.y,r[10]=-s.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new v(u.x,l.x,-s.x,e.x,u.y,l.y,-s.y,e.y,u.z,l.z,-s.z,e.z,0,0,0,1)},w.northUpEastToFixedFrame=function(e,t,r){if(_.equalsEpsilon(e.x,0,_.EPSILON14)&&_.equalsEpsilon(e.y,0,_.EPSILON14)){var n=_.sign(e.z);return a(r)?(r[0]=-n,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=n,r[7]=0,r[8]=0,r[9]=1,r[10]=0,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new v(-n,0,0,e.x,0,0,1,e.y,0,n,0,e.z,0,0,0,1)}var s=S,l=E,u=b;return t=o(t,h.WGS84),t.geodeticSurfaceNormal(e,s),l.x=-e.y,l.y=e.x,l.z=0,i.normalize(l,l),i.cross(s,l,u),a(r)?(r[0]=u.x,r[1]=u.y,r[2]=u.z,r[3]=0,r[4]=s.x,r[5]=s.y,r[6]=s.z,r[7]=0,r[8]=l.x,r[9]=l.y,r[10]=l.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new v(u.x,s.x,l.x,e.x,u.y,s.y,l.y,e.y,u.z,s.z,l.z,e.z,0,0,0,1)},w.northWestUpToFixedFrame=function(e,t,r){if(_.equalsEpsilon(e.x,0,_.EPSILON14)&&_.equalsEpsilon(e.y,0,_.EPSILON14)){var n=_.sign(e.z);return a(r)?(r[0]=-n,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=n,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new v(-n,0,0,e.x,0,-1,0,e.y,0,0,n,e.z,0,0,0,1)}var s=S,l=E,u=b;return t=o(t,h.WGS84),t.geodeticSurfaceNormal(e,s),l.x=-e.y,l.y=e.x,l.z=0,i.normalize(l,l),i.cross(s,l,u),a(r)?(r[0]=u.x,r[1]=u.y,r[2]=u.z,r[3]=0,r[4]=-l.x,r[5]=-l.y,r[6]=-l.z,r[7]=0,r[8]=s.x,r[9]=s.y,r[10]=s.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new v(u.x,-l.x,s.x,e.x,u.y,-l.y,s.y,e.y,u.z,-l.z,s.z,e.z,0,0,0,1)};var P=new y,D=new i(1,1,1),M=new v;w.headingPitchRollToFixedFrame=function(e,t,r,n,o,a){var l;"object"==typeof t?(o=r,a=n,l=t.heading,r=t.pitch,n=t.roll):(s("headingPitchRollToFixedFrame","headingPitchRollToFixedFrame with separate heading, pitch, and roll arguments was deprecated in 1.27. It will be removed in 1.30. Use a HeadingPitchRoll object."),l=t);var u=y.fromHeadingPitchRoll(l,r,n,P),c=v.fromTranslationQuaternionRotationScale(i.ZERO,u,D,M);return a=w.eastNorthUpToFixedFrame(e,o,a),v.multiply(a,c,a)};var I=new d,R=new v,O=new g;w.headingPitchRollQuaternion=function(e,t,i,r,n,o){var a;"object"==typeof t?(a=t,n=i,o=r):(s("headingPitchRollQuaternion","headingPitchRollQuaternion with separate heading, pitch, and roll arguments was deprecated in 1.27. It will be removed in 1.30. Use a HeadingPitchRoll object."),I.heading=t,I.pitch=i,I.roll=r,a=I);var l=w.headingPitchRollToFixedFrame(e,a,n,R),u=v.getRotation(l,O);return y.fromRotationMatrix(u,o)};var N=24110.54841,L=8640184.812866,B=.093104,F=-62e-7,V=1.1772758384668e-19,k=72921158553e-15,z=_.TWO_PI/86400,U=new f;w.computeTemeToPseudoFixedMatrix=function(e,t){U=f.addSeconds(e,-f.computeTaiMinusUtc(e),U);var i,r=U.dayNumber,n=U.secondsOfDay,o=r-2451545;i=n>=43200?(o+.5)/C.DAYS_PER_JULIAN_CENTURY:(o-.5)/C.DAYS_PER_JULIAN_CENTURY;var s=N+i*(L+i*(B+i*F)),l=s*z%_.TWO_PI,u=k+V*(r-2451545.5),c=(n+.5*C.SECONDS_PER_DAY)%C.SECONDS_PER_DAY,h=l+u*c,d=Math.cos(h),p=Math.sin(h);return a(t)?(t[0]=d,t[1]=-p,t[2]=0,t[3]=p,t[4]=d,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new g(d,p,0,-p,d,0,0,0,1)},w.iau2006XysData=new p,w.earthOrientationParameters=u.NONE;var G=32.184,W=2451545;w.preloadIcrfFixed=function(t){var i=t.start.dayNumber,r=t.start.secondsOfDay+G,n=t.stop.dayNumber,o=t.stop.secondsOfDay+G,a=w.iau2006XysData.preload(i,r,n,o),s=w.earthOrientationParameters.getPromiseToLoad();return e.all([a,s])},w.computeIcrfToFixedMatrix=function(e,t){a(t)||(t=new g);var i=w.computeFixedToIcrfMatrix(e,t);if(a(i))return g.transpose(i,t)};var H=new m(0,0,0),q=new c(0,0,0,0,0,0),j=new g,Y=new g;w.computeFixedToIcrfMatrix=function(e,t){a(t)||(t=new g);var i=w.earthOrientationParameters.compute(e,q);if(a(i)){var r=e.dayNumber,n=e.secondsOfDay+G,o=w.iau2006XysData.computeXysRadians(r,n,H);if(a(o)){var s=o.x+i.xPoleOffset,l=o.y+i.yPoleOffset,u=1/(1+Math.sqrt(1-s*s-l*l)),c=j;c[0]=1-u*s*s,c[3]=-u*s*l,c[6]=s,c[1]=-u*s*l,c[4]=1-u*l*l,c[7]=l,c[2]=-s,c[5]=-l,c[8]=1-u*(s*s+l*l);var h=g.fromRotationZ(-o.s,Y),d=g.multiply(c,h,j),p=e.dayNumber,m=e.secondsOfDay-f.computeTaiMinusUtc(e)+i.ut1MinusUtc,v=p-2451545,y=m/C.SECONDS_PER_DAY,S=.779057273264+y+.00273781191135448*(v+y);S=S%1*_.TWO_PI;var E=g.fromRotationZ(S,Y),b=g.multiply(d,E,j),T=Math.cos(i.xPoleWander),x=Math.cos(i.yPoleWander),A=Math.sin(i.xPoleWander),P=Math.sin(i.yPoleWander),D=r-W+n/C.SECONDS_PER_DAY;D/=36525;var M=-47e-6*D*_.RADIANS_PER_DEGREE/3600,I=Math.cos(M),R=Math.sin(M),O=Y;return O[0]=T*I,O[1]=T*R,O[2]=A,O[3]=-x*R+P*A*I,O[4]=x*I+P*A*R,O[5]=-P*T,O[6]=-P*R-x*A*I,O[7]=P*I-x*A*R,O[8]=x*T,g.multiply(b,O,t)}}};var X=new r;w.pointToWindowCoordinates=function(e,t,i,r){return r=w.pointToGLWindowCoordinates(e,t,i,r),r.y=2*t[5]-r.y,r},w.pointToGLWindowCoordinates=function(e,i,n,o){a(o)||(o=new t);var s=X;return v.multiplyByVector(e,r.fromElements(n.x,n.y,n.z,1,s),s),r.multiplyByScalar(s,1/s.w,s),v.multiplyByVector(i,s,s),t.fromCartesian4(s,o)};var Z=new i,K=new i,Q=new i;w.rotationMatrixFromPositionVelocity=function(e,t,r,n){var s=o(r,h.WGS84).geodeticSurfaceNormal(e,Z),l=i.cross(t,s,K);i.equalsEpsilon(l,i.ZERO,_.EPSILON6)&&(l=i.clone(i.UNIT_X,l));var u=i.cross(l,t,Q);return i.cross(t,u,l),i.negate(l,l),a(n)||(n=new g),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=l.x,n[4]=l.y,n[5]=l.z,n[6]=u.x,n[7]=u.y,n[8]=u.z,n};var J=new n,$=new i,ee=new i,te=new r,ie=new r,re=new r,ne=new r,oe=new r,ae=new v,se=new v;return w.basisTo2D=function(e,t,n){var o=e.ellipsoid,a=v.getColumn(t,3,te),s=o.cartesianToCartographic(a,J),l=w.eastNorthUpToFixedFrame(a,o,ae),u=v.inverseTransformation(l,se),c=e.project(s,$),h=ie;h.x=c.z,h.y=c.x,h.z=c.y,h.w=1;var d=v.getColumn(t,0,ee),p=i.magnitude(d),m=v.multiplyByVector(u,d,re);r.fromElements(m.z,m.x,m.y,0,m);var f=v.getColumn(t,1,ee),_=i.magnitude(f),g=v.multiplyByVector(u,f,ne);r.fromElements(g.z,g.x,g.y,0,g);var y=v.getColumn(t,2,ee),C=i.magnitude(y),S=oe;return i.cross(m,g,S),i.normalize(S,S),i.cross(g,S,m),i.normalize(m,m),i.cross(S,m,g),i.normalize(g,g),i.multiplyByScalar(m,p,m),i.multiplyByScalar(g,_,g),i.multiplyByScalar(S,C,S),v.setColumn(n,0,m,n),v.setColumn(n,1,g,n),v.setColumn(n,2,S,n),v.setColumn(n,3,h,n),n},w}),i("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p){"use strict";function m(e,t){t=n(t,l.WGS84),e=t.scaleToGeodeticSurface(e);var r=p.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=i.fromCartesian4(c.getColumn(r,0,f)),this._yAxis=i.fromCartesian4(c.getColumn(r,1,f));var o=i.fromCartesian4(c.getColumn(r,2,f));this._plane=h.fromPointNormal(e,o)}var f=new r;a(m.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var _=new e;m.fromPoints=function(t,i){var r=e.fromPoints(t,_);return new m(r.center,i)};var g=new d,v=new i;m.prototype.projectPointOntoPlane=function(e,r){var n=g;n.origin=e,i.normalize(e,n.direction);var a=u.rayPlane(n,this._plane,v);if(o(a)||(i.negate(n.direction,n.direction),a=u.rayPlane(n,this._plane,v)),o(a)){var s=i.subtract(a,this._origin,a),l=i.dot(this._xAxis,s),c=i.dot(this._yAxis,s);return o(r)?(r.x=l,r.y=c,r):new t(l,c)}},m.prototype.projectPointsOntoPlane=function(e,t){o(t)||(t=[]);for(var i=0,r=e.length,n=0;n0?0:a.latitude;w.latitude=C.latitude=y.latitude=e.south,S.latitude=v.latitude=b,d.latitude=f.latitude=g.latitude=e.north,w.longitude=S.longitude=d.longitude=e.west,C.longitude=f.longitude=E,y.longitude=v.longitude=g.longitude=e.east,g.height=f.height=d.height=S.height=w.height=C.height=y.height=v.height=i,r.cartographicArrayToCartesianArray(D,M),c.projectPointsToNearestOnPlane(M,I);var T=Math.min(I[6].x,I[7].x,I[0].x),x=Math.max(I[2].x,I[3].x,I[4].x),R=Math.min(I[4].y,I[5].y,I[6].y),O=Math.max(I[0].y,I[1].y,I[2].y);g.height=d.height=y.height=w.height=t,r.cartographicArrayToCartesianArray(D,M);var N=Math.min(p.getPointDistance(h,M[0]),p.getPointDistance(h,M[2]),p.getPointDistance(h,M[4]),p.getPointDistance(h,M[6])),L=i;return _(c,T,x,R,O,N,L,o)},f.clone=function(e,t){if(o(e))return o(t)?(i.clone(e.center,t.center),d.clone(e.halfAxes,t.halfAxes),t):new f(e.center,e.halfAxes)},f.intersectPlane=function(e,t){var r=e.center,n=t.normal,o=e.halfAxes,a=n.x,s=n.y,l=n.z,c=Math.abs(a*o[d.COLUMN0ROW0]+s*o[d.COLUMN0ROW1]+l*o[d.COLUMN0ROW2])+Math.abs(a*o[d.COLUMN1ROW0]+s*o[d.COLUMN1ROW1]+l*o[d.COLUMN1ROW2])+Math.abs(a*o[d.COLUMN2ROW0]+s*o[d.COLUMN2ROW1]+l*o[d.COLUMN2ROW2]),h=i.dot(n,r)+t.distance;return h<=-c?u.OUTSIDE:h>=c?u.INSIDE:u.INTERSECTING};var R=new i,O=new i,N=new i,L=new i;f.distanceSquaredTo=function(e,t){var r=i.subtract(t,e.center,T),n=e.halfAxes,o=d.getColumn(n,0,R),a=d.getColumn(n,1,O),s=d.getColumn(n,2,N),l=i.magnitude(o),u=i.magnitude(a),c=i.magnitude(s);i.normalize(o,o),i.normalize(a,a),i.normalize(s,s);var h=L;h.x=i.dot(r,o),h.y=i.dot(r,a),h.z=i.dot(r,s);var p,m=0;return h.x<-l?(p=h.x+l,m+=p*p):h.x>l&&(p=h.x-l,m+=p*p),h.y<-u?(p=h.y+u,m+=p*p):h.y>u&&(p=h.y-u,m+=p*p),h.z<-c?(p=h.z+c,m+=p*p):h.z>c&&(p=h.z-c,m+=p*p),m};var B=new i,F=new i;f.computePlaneDistances=function(e,t,r,n){o(n)||(n=new c);var a=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,l=e.center,u=e.halfAxes,h=d.getColumn(u,0,R),p=d.getColumn(u,1,O),m=d.getColumn(u,2,N),f=i.add(h,p,B);i.add(f,m,f),i.add(f,l,f);var _=i.subtract(f,t,F),g=i.dot(r,_);return a=Math.min(g,a),s=Math.max(g,s),i.add(l,h,f),i.add(f,p,f),i.subtract(f,m,f),i.subtract(f,t,_),g=i.dot(r,_),a=Math.min(g,a),s=Math.max(g,s),i.add(l,h,f),i.subtract(f,p,f),i.add(f,m,f),i.subtract(f,t,_),g=i.dot(r,_),a=Math.min(g,a),s=Math.max(g,s),i.add(l,h,f),i.subtract(f,p,f),i.subtract(f,m,f),i.subtract(f,t,_),g=i.dot(r,_),a=Math.min(g,a),s=Math.max(g,s),i.subtract(l,h,f),i.add(f,p,f),i.add(f,m,f),i.subtract(f,t,_),g=i.dot(r,_),a=Math.min(g,a),s=Math.max(g,s),i.subtract(l,h,f),i.add(f,p,f),i.subtract(f,m,f),i.subtract(f,t,_),g=i.dot(r,_),a=Math.min(g,a),s=Math.max(g,s),i.subtract(l,h,f),i.subtract(f,p,f),i.add(f,m,f),i.subtract(f,t,_),g=i.dot(r,_),a=Math.min(g,a),s=Math.max(g,s),i.subtract(l,h,f),i.subtract(f,p,f),i.subtract(f,m,f),i.subtract(f,t,_),g=i.dot(r,_),a=Math.min(g,a),s=Math.max(g,s),n.start=a,n.stop=s,n};var V=new e;return f.isOccluded=function(t,i){var r=e.fromOrientedBoundingBox(t,V);return!i.isBoundingSphereVisible(r)},f.prototype.intersectPlane=function(e){return f.intersectPlane(this,e)},f.prototype.distanceSquaredTo=function(e){return f.distanceSquaredTo(this,e)},f.prototype.computePlaneDistances=function(e,t,i){return f.computePlaneDistances(this,e,t,i)},f.prototype.isOccluded=function(e){return f.isOccluded(this,e)},f.equals=function(e,t){return e===t||o(e)&&o(t)&&i.equals(e.center,t.center)&&d.equals(e.halfAxes,t.halfAxes)},f.prototype.clone=function(e){return f.clone(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f}),i("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,i,r,n){"use strict";var o={};o.octEncodeInRange=function(e,t,i){if(i.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),i.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var r=i.x,o=i.y;i.x=(1-Math.abs(o))*n.signNotZero(r),i.y=(1-Math.abs(r))*n.signNotZero(o)}return i.x=n.toSNorm(i.x,t),i.y=n.toSNorm(i.y,t),i},o.octEncode=function(e,t){return o.octEncodeInRange(e,255,t)},o.octDecodeInRange=function(e,i,r,o){if(o.x=n.fromSNorm(e,r),o.y=n.fromSNorm(i,r),o.z=1-(Math.abs(o.x)+Math.abs(o.y)),o.z<0){var a=o.x;o.x=(1-Math.abs(o.y))*n.signNotZero(a),o.y=(1-Math.abs(a))*n.signNotZero(o.y)}return t.normalize(o,o)},o.octDecode=function(e,t,i){return o.octDecodeInRange(e,t,255,i)},o.octPackFloat=function(e){return 256*e.x+e.y};var a=new e;return o.octEncodeFloat=function(e){return o.octEncode(e,a),o.octPackFloat(a)},o.octDecodeFloat=function(e,t){var i=e/256,r=Math.floor(i),n=256*(i-r);return o.octDecode(r,n,t)},o.octPack=function(e,t,i,r){var n=o.octEncodeFloat(e),s=o.octEncodeFloat(t),l=o.octEncode(i,a);return r.x=65536*l.x+n,r.y=65536*l.y+s,r},o.octUnpack=function(e,t,i,r){var n=e.x/65536,a=Math.floor(n),s=65536*(n-a);n=e.y/65536;var l=Math.floor(n),u=65536*(n-l);o.octDecodeFloat(s,t),o.octDecodeFloat(u,i),o.octDecode(a,l,r)},o.compressTextureCoordinates=function(e){var t=4095*e.x|0,i=4095*e.y|0;return 4096*t+i},o.decompressTextureCoordinates=function(e,t){var i=e/4096,r=Math.floor(i);return t.x=r/4095,t.y=(e-4096*r)/4095,t},o}),i("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503};return e(t)}),i("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,i,r,n,o){"use strict";if(!r.supportsTypedArrays())return{};var a={BYTE:o.BYTE,UNSIGNED_BYTE:o.UNSIGNED_BYTE,SHORT:o.SHORT,UNSIGNED_SHORT:o.UNSIGNED_SHORT,INT:o.INT,UNSIGNED_INT:o.UNSIGNED_INT,FLOAT:o.FLOAT,DOUBLE:o.DOUBLE};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.INT:return Int32Array.BYTES_PER_ELEMENT;case a.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case a.FLOAT: -return Float32Array.BYTES_PER_ELEMENT;case a.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},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 Int32Array?a.INT:e instanceof Uint32Array?a.UNSIGNED_INT: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.INT||e===a.UNSIGNED_INT||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.INT:return new Int32Array(t);case a.UNSIGNED_INT:return new Uint32Array(t);case a.FLOAT:return new Float32Array(t);case a.DOUBLE:return new Float64Array(t)}},a.createArrayBufferView=function(t,i,r,n){switch(r=e(r,0),n=e(n,(i.byteLength-r)/a.getSizeInBytes(t)),t){case a.BYTE:return new Int8Array(i,r,n);case a.UNSIGNED_BYTE:return new Uint8Array(i,r,n);case a.SHORT:return new Int16Array(i,r,n);case a.UNSIGNED_SHORT:return new Uint16Array(i,r,n);case a.INT:return new Int32Array(i,r,n);case a.UNSIGNED_INT:return new Uint32Array(i,r,n);case a.FLOAT:return new Float32Array(i,r,n);case a.DOUBLE:return new Float64Array(i,r,n)}},a.fromName=function(e){switch(e){case"BYTE":return a.BYTE;case"UNSIGNED_BYTE":return a.UNSIGNED_BYTE;case"SHORT":return a.SHORT;case"UNSIGNED_SHORT":return a.UNSIGNED_SHORT;case"INT":return a.INT;case"UNSIGNED_INT":return a.UNSIGNED_INT;case"FLOAT":return a.FLOAT;case"DOUBLE":return a.DOUBLE}},n(a)}),i("Core/TerrainQuantization",["./freezeObject"],function(e){"use strict";var t={NONE:0,BITS12:1};return e(t)}),i("Core/TerrainEncoding",["./AttributeCompression","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./Math","./Matrix4","./TerrainQuantization"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(e,t,r,a,u,d){var _,g,v,y;if(o(e)&&o(t)&&o(r)&&o(a)){var C=e.minimum,w=e.maximum,S=i.subtract(w,C,h),E=r-t,b=Math.max(i.maximumComponent(S),E);_=bl.MaximumLatitude?e=l.MaximumLatitude:e<-l.MaximumLatitude&&(e=-l.MaximumLatitude);var t=Math.sin(e);return.5*Math.log((1+t)/(1-t))},l.MaximumLatitude=l.mercatorAngleToGeodeticLatitude(Math.PI),l.prototype.project=function(t,i){var n=this._semimajorAxis,o=t.longitude*n,a=l.geodeticLatitudeToMercatorAngle(t.latitude)*n,s=t.height;return r(i)?(i.x=o,i.y=a,i.z=s,i):new e(o,a,s)},l.prototype.unproject=function(e,i){var n=this._oneOverSemimajorAxis,o=e.x*n,a=l.mercatorAngleToGeodeticLatitude(e.y*n),s=e.z;return r(i)?(i.longitude=o,i.latitude=a,i.height=s,i):new t(o,a,s)},l}),i("Core/HeightmapTessellator",["./AxisAlignedBoundingBox","./BoundingSphere","./Cartesian2","./Cartesian3","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidalOccluder","./freezeObject","./Math","./Matrix4","./OrientedBoundingBox","./Rectangle","./TerrainEncoding","./Transforms","./WebMercatorProjection"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_){"use strict";var g={};g.DEFAULT_STRUCTURE=u({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var v=new r,y=new h,C=new r,w=new r;return g.computeVertices=function(a){var u,S,E,b,T=Math.cos,x=Math.sin,A=Math.sqrt,P=Math.atan,D=Math.exp,M=c.PI_OVER_TWO,I=c.toRadians,R=a.heightmap,O=a.width,N=a.height,L=a.skirtHeight,B=n(a.isGeographic,!0),F=n(a.ellipsoid,s.WGS84),V=1/F.maximumRadius,k=a.nativeRectangle,z=a.rectangle;o(z)?(u=z.west,S=z.south,E=z.east,b=z.north):B?(u=I(k.west),S=I(k.south),E=I(k.east),b=I(k.north)):(u=k.west*V,S=M-2*P(D(-k.south*V)),E=k.east*V,b=M-2*P(D(-k.north*V)));var U=a.relativeToCenter,G=o(U);U=G?U:r.ZERO;var W,H,q=n(a.exaggeration,1),j=n(a.includeWebMercatorT,!1),Y=n(a.structure,g.DEFAULT_STRUCTURE),X=n(Y.heightScale,g.DEFAULT_STRUCTURE.heightScale),Z=n(Y.heightOffset,g.DEFAULT_STRUCTURE.heightOffset),K=n(Y.elementsPerHeight,g.DEFAULT_STRUCTURE.elementsPerHeight),Q=n(Y.stride,g.DEFAULT_STRUCTURE.stride),J=n(Y.elementMultiplier,g.DEFAULT_STRUCTURE.elementMultiplier),$=n(Y.isBigEndian,g.DEFAULT_STRUCTURE.isBigEndian),ee=p.computeWidth(k)/(O-1),te=p.computeHeight(k)/(N-1),ie=F.radiiSquared,re=ie.x,ne=ie.y,oe=ie.z,ae=65536,se=-65536,le=f.eastNorthUpToFixedFrame(U,F),ue=h.inverseTransformation(le,y);j&&(W=_.geodeticLatitudeToMercatorAngle(S),H=1/(_.geodeticLatitudeToMercatorAngle(b)-W));var ce=C;ce.x=Number.POSITIVE_INFINITY,ce.y=Number.POSITIVE_INFINITY,ce.z=Number.POSITIVE_INFINITY;var he=w;he.x=Number.NEGATIVE_INFINITY,he.y=Number.NEGATIVE_INFINITY,he.z=Number.NEGATIVE_INFINITY;var de=Number.POSITIVE_INFINITY,pe=O+(L>0?2:0),me=N+(L>0?2:0),fe=pe*me,_e=new Array(fe),ge=new Array(fe),ve=new Array(fe),ye=j?new Array(fe):[],Ce=0,we=N,Se=0,Ee=O;L>0&&(--Ce,++we,--Se,++Ee);for(var be=0,Te=Ce;Te=N&&(xe=N-1);var Ae=k.north-te*xe;Ae=B?I(Ae):M-2*P(D(-Ae*V));var Pe=T(Ae),De=x(Ae),Me=oe*De,Ie=(Ae-S)/(b-S);Ie=c.clamp(Ie,0,1);var Re;j&&(Re=(_.geodeticLatitudeToMercatorAngle(Ae)-W)*H);for(var Oe=Se;Oe=O&&(Ne=O-1);var Le=k.west+ee*Ne;B?Le=I(Le):Le*=V;var Be,Fe=xe*(O*Q)+Ne*Q;if(1===K)Be=R[Fe];else{Be=0;var Ve;if($)for(Ve=0;Ve=0;--Ve)Be=Be*J+R[Fe+Ve]}Be=(Be*X+Z)*q,se=Math.max(se,Be),ae=Math.min(ae,Be),Oe===Ne&&Te===xe||(Be-=L);var ke=Pe*T(Le),ze=Pe*x(Le),Ue=re*ke,Ge=ne*ze,We=A(Ue*ke+Ge*ze+Me*De),He=1/We,qe=Ue*He,je=Ge*He,Ye=Me*He,Xe=new r;Xe.x=qe+ke*Be,Xe.y=je+ze*Be,Xe.z=Ye+De*Be,_e[be]=Xe,ge[be]=Be;var Ze=(Le-u)/(E-u);Ze=c.clamp(Ze,0,1),ve[be]=new i(Ze,Ie),j&&(ye[be]=Re),be++,h.multiplyByPoint(ue,Xe,v),r.minimumByComponent(v,ce,ce),r.maximumByComponent(v,he,he),de=Math.min(de,Be)}}var Ke,Qe=t.fromPoints(_e);o(z)&&z.width=this._maximumActiveTasks)){++this._activeTasks;var n=this;return e(c(),function(o){r(i)?o||(i.length=0):i=g;var a=n._nextID++,s=e.defer();return n._deferreds[a]=s,n._worker.postMessage({id:a,parameters:t,canTransferArrayBuffer:o},i),s.promise})}},f.prototype.isDestroyed=function(){return!1},f.prototype.destroy=function(){return r(this._worker)&&this._worker.terminate(),n(this)},f._defaultWorkerModulePrefix="Workers/",f._workerModulePrefix=f._defaultWorkerModulePrefix,f._loaderConfig=void 0,f._canTransferArrayBuffer=void 0,f}),i("Core/TerrainMesh",["./defaultValue"],function(e){"use strict";function t(t,i,r,n,o,a,s,l,u,c,h){this.center=t,this.vertices=i,this.stride=e(l,6),this.indices=r,this.minimumHeight=n,this.maximumHeight=o,this.boundingSphere3D=a,this.occludeePointInScaledSpace=s,this.orientedBoundingBox=u,this.encoding=c,this.exaggeration=h}return t}),i("Core/TerrainProvider",["./defined","./defineProperties","./DeveloperError","./Math"],function(e,t,i,r){"use strict";function n(){i.throwInstantiationError()}t(n.prototype,{errorEvent:{get:i.throwInstantiationError},credit:{get:i.throwInstantiationError},tilingScheme:{get:i.throwInstantiationError},ready:{get:i.throwInstantiationError},readyPromise:{get:i.throwInstantiationError},hasWaterMask:{get:i.throwInstantiationError},hasVertexNormals:{get:i.throwInstantiationError}});var o=[];return n.getRegularGridIndices=function(t,i){var r=o[t];e(r)||(o[t]=r=[]);var n=r[i];if(!e(n)){n=r[i]=new Uint16Array((t-1)*(i-1)*6);for(var a=0,s=0,l=0;l=a&&(p=a-1,d=a-2);var m=0|h,f=m+1;f>=s&&(f=s-1,m=s-2);var v=c-d,y=h-m;m=s-1-m,f=s-1-f;var C=g(e,t,i,r,n,m*a+d),w=g(e,t,i,r,n,m*a+p),S=g(e,t,i,r,n,f*a+d),E=g(e,t,i,r,n,f*a+p);return _(v,y,C,w,S,E)}function f(e,t,i,r,n,o,a,s,l,u,c){var h=(l-o.west)*(a-1)/(o.east-o.west),d=(u-o.south)*(s-1)/(o.north-o.south);n>0&&(h+=1,d+=1,a+=2,s+=2);var p=n>0?a-1:a,m=0|h,f=m+1;f>=p&&(f=a-1,m=a-2);var g=n>0?s-1:s,v=0|d,y=v+1;y>=g&&(y=s-1,v=s-2);var C=h-m,w=d-v;v=s-1-v,y=s-1-y;var S=(t.decodeHeight(e,v*a+m)/c-i)/r,E=(t.decodeHeight(e,v*a+f)/c-i)/r,b=(t.decodeHeight(e,y*a+m)/c-i)/r,T=(t.decodeHeight(e,y*a+f)/c-i)/r;return _(C,w,S,E,b,T)}function _(e,t,i,r,n,o){return t=0;--a)s=s*i+e[o+a];return s}function v(e,t,i,r,n,o,a,s){a*=n;var l;if(o)for(l=0;l0;--l)e[a+l]=s/r|0,s-=e[a+l]*r,r/=i;e[a+l]=s}r(p.prototype,{waterMask:{get:function(){return this._waterMask}}});var y=new u("createVerticesFromHeightmap");return p.prototype.createMesh=function(r,n,a,s,u){var p=r.ellipsoid,m=r.tileXYToNativeRectangle(n,a,s),f=r.tileXYToRectangle(n,a,s);u=t(u,1);var _=p.cartographicToCartesian(l.center(f)),g=this._structure,v=d.getEstimatedLevelZeroGeometricErrorForAHeightmap(p,this._width,r.getNumberOfXTilesAtLevel(0)),C=v/(1<h.highestEncodedHeight?h.highestEncodedHeight:N,v(_,x,A,D,m,P,M*u+R,N)}return new p({buffer:_,width:u,height:c,childTileMask:0,structure:this._structure,createdByUpsampling:!0})}},p.prototype.isChildAvailable=function(e,t,i,r){var n=2;return i!==2*e&&++n,r!==2*t&&(n-=2),0!==(this._childTileMask&1<=n.maximumRequestsPerServer))return o[s]=l+1,t(a(e),function(e){return o[s]--,e}).otherwise(function(e){return o[s]--,t.reject(e)})}var o={},a="undefined"!=typeof document?new e(document.location.href):new e;return n.maximumRequestsPerServer=6,n}),i("Core/ArcGisImageServerTerrainProvider",["../ThirdParty/when","./Credit","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Event","./GeographicTilingScheme","./getImagePixels","./HeightmapTerrainData","./loadImage","./Math","./TerrainProvider","./throttleRequestByServer"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m){"use strict";function f(n){this._url=n.url,this._token=n.token,this._tilingScheme=n.tilingScheme,r(this._tilingScheme)||(this._tilingScheme=new l({ellipsoid:i(n.ellipsoid,a.WGS84)})),this._heightmapWidth=65,this._levelZeroMaximumGeometricError=p.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,this._heightmapWidth,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._proxy=n.proxy,this._terrainDataStructure={heightScale:.001,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0,lowestEncodedHeight:0,highestEncodedHeight:16777215},this._errorEvent=new s;var o=n.credit;"string"==typeof o&&(o=new t(o)),this._credit=o,this._readyPromise=e.resolve(!0)}return n(f.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return!0}},readyPromise:{get:function(){return this._readyPromise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}}}),f.prototype.requestTileGeometry=function(t,i,n){var o=this._tilingScheme.tileXYToRectangle(t,i,n),a=(o.east-o.west)/(this._heightmapWidth-1),s=(o.north-o.south)/(this._heightmapWidth-1);o.west-=.5*a,o.east+=.5*a,o.south-=.5*s,o.north+=.5*s;var l=d.toDegrees(o.west)+"%2C"+d.toDegrees(o.south)+"%2C"+d.toDegrees(o.east)+"%2C"+d.toDegrees(o.north),p=this._url+"/exportImage?interpolation=RSP_BilinearInterpolation&format=tiff&f=image&size="+this._heightmapWidth+"%2C"+this._heightmapWidth+"&bboxSR=4326&imageSR=4326&bbox="+l;this._token&&(p+="&token="+this._token);var f=this._proxy;r(f)&&(p=f.getURL(p));var _=m(p,h);if(r(_)){var g=this;return e(_,function(e){return new c({buffer:u(e),width:g._heightmapWidth,height:g._heightmapWidth,childTileMask:15,structure:g._terrainDataStructure})})}},f.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<1&&r(c[0],c[c.length-1],o)&&c.shift(),c}}var o=r.EPSILON10;return n}),i("Core/AssociativeArray",["./defined","./defineProperties","./DeveloperError"],function(e,t,i){"use strict";function r(){this._array=[],this._hash={}}return t(r.prototype,{length:{get:function(){return this._array.length}},values:{get:function(){return this._array}}}),r.prototype.contains=function(t){return e(this._hash[t])},r.prototype.set=function(e,t){var i=this._hash[e];t!==i&&(this.remove(e),this._hash[e]=t,this._array.push(t))},r.prototype.get=function(e){return this._hash[e]},r.prototype.remove=function(t){var i=this._hash[t],r=e(i);if(r){var n=this._array;n.splice(n.indexOf(i),1),delete this._hash[t]}return r},r.prototype.removeAll=function(){var e=this._array;e.length>0&&(this._hash={},e.length=0)},r}),i("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./defined","./DeveloperError"],function(e,t,i,r){"use strict";function n(r,n,l,u,c){i(c)||(c=new t);var h,d,p,m,f,_,g,v;i(n.z)?(h=t.subtract(l,n,o),d=t.subtract(u,n,a),p=t.subtract(r,n,s),m=t.dot(h,h),f=t.dot(h,d),_=t.dot(h,p),g=t.dot(d,d),v=t.dot(d,p)):(h=e.subtract(l,n,o),d=e.subtract(u,n,a),p=e.subtract(r,n,s),m=e.dot(h,h),f=e.dot(h,d),_=e.dot(h,p),g=e.dot(d,d),v=e.dot(d,p));var y=1/(m*g-f*f);return c.y=(g*_-f*v)*y,c.z=(m*v-f*_)*y,c.x=1-c.y-c.z,c}var o=new t,a=new t,s=new t;return n}),i("Core/BingMapsApi",["./Credit","./defined"],function(e,t){"use strict";var i={};i.defaultKey=void 0;var r,n=!1,o="This application is using Cesium's default Bing Maps key. Please create a new key for the application as soon as possible and prior to deployment by visiting https://www.bingmapsportal.com/, and provide your key to Cesium by setting the Cesium.BingMapsApi.defaultKey property before constructing the CesiumWidget or any other object that uses the Bing Maps API.";return i.getKey=function(e){return t(e)?e:t(i.defaultKey)?i.defaultKey:(n||(console.log(o),n=!0),"AhiQlDaPOwKbStA_3nJIdimUj4PRYkp0yHwcNpvxVlLNPRo5ZJWY5oX_h6B_dMbm")},i.getErrorCredit=function(n){if(!t(n)&&!t(i.defaultKey))return t(r)||(r=new e(o)),r},i}),i("Core/BoundingRectangle",["./Cartesian2","./Cartographic","./defaultValue","./defined","./DeveloperError","./GeographicProjection","./Intersect","./Rectangle"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,t,r,n){this.x=i(e,0),this.y=i(t,0),this.width=i(r,0),this.height=i(n,0)}l.packedLength=4,l.pack=function(e,t,r){return r=i(r,0),t[r++]=e.x,t[r++]=e.y,t[r++]=e.width,t[r]=e.height,t},l.unpack=function(e,t,n){return t=i(t,0),r(n)||(n=new l),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n},l.fromPoints=function(e,t){if(r(t)||(t=new l),!r(e)||0===e.length)return t.x=0,t.y=0,t.width=0,t.height=0,t;for(var i=e.length,n=e[0].x,o=e[0].y,a=e[0].x,s=e[0].y,u=1;ui.width?i.width=r:r<0&&(i.width-=r,i.x=t.x),n>i.height?i.height=n:n<0&&(i.height-=n,i.y=t.y),i},l.intersect=function(e,t){var i=e.x,r=e.y,n=t.x,o=t.y;return i>n+t.width||i+e.widtho+t.height?a.OUTSIDE:a.INTERSECTING},l.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height},l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.intersect=function(e){return l.intersect(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l}),i("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),i("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var i={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===i.POINTS||e===i.LINES||e===i.LINE_LOOP||e===i.LINE_STRIP||e===i.TRIANGLES||e===i.TRIANGLE_STRIP||e===i.TRIANGLE_FAN}};return e(i)}),i("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,i,r,n){"use strict";function o(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,n.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return o.computeNumberOfVertices=function(e){var i=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var n=e.attributes[r],o=n.values.length/n.componentsPerAttribute;i=o}return i},o}),i("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(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 r}),i("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.binormal=t.binormal,this.tangent=t.tangent,this.color=t.color}return t}),i("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,i,r){"use strict";function n(t){t=e(t,e.EMPTY_OBJECT),this.position=e(t.position,!1),this.normal=e(t.normal,!1),this.st=e(t.st,!1),this.binormal=e(t.binormal,!1),this.tangent=e(t.tangent,!1),this.color=e(t.color,!1)}return n.POSITION_ONLY=r(new n({position:!0})),n.POSITION_AND_NORMAL=r(new n({position:!0,normal:!0})),n.POSITION_NORMAL_AND_ST=r(new n({position:!0,normal:!0,st:!0})),n.POSITION_AND_ST=r(new n({position:!0,st:!0})),n.POSITION_AND_COLOR=r(new n({position:!0,color:!0})),n.ALL=r(new n({position:!0,normal:!0,st:!0,binormal:!0,tangent:!0})),n.DEFAULT=n.POSITION_NORMAL_AND_ST,n.packedLength=6,n.pack=function(t,i,r){return r=e(r,0),i[r++]=t.position?1:0,i[r++]=t.normal?1:0,i[r++]=t.st?1:0,i[r++]=t.binormal?1:0,i[r++]=t.tangent?1:0,i[r++]=t.color?1:0,i},n.unpack=function(i,r,o){return r=e(r,0),t(o)||(o=new n),o.position=1===i[r++],o.normal=1===i[r++],o.st=1===i[r++],o.binormal=1===i[r++],o.tangent=1===i[r++],o.color=1===i[r++],o},n.clone=function(e,i){if(t(e))return t(i)||(i=new n),i.position=e.position,i.normal=e.normal,i.st=e.st,i.binormal=e.binormal,i.tangent=e.tangent,i.color=e.color,i},n}),i("Core/BoxGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./PrimitiveType","./VertexFormat"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(e){e=r(e,r.EMPTY_OBJECT);var i=e.minimum,n=e.maximum,o=r(e.vertexFormat,c.DEFAULT);this._minimum=t.clone(i),this._maximum=t.clone(n),this._vertexFormat=o,this._workerName="createBoxGeometry"}var d=new t;h.fromDimensions=function(e){e=r(e,r.EMPTY_OBJECT);var i=e.dimensions,n=t.multiplyByScalar(i,.5,new t);return new h({minimum:t.negate(n,new t),maximum:n,vertexFormat:e.vertexFormat})},h.fromAxisAlignedBoundingBox=function(e){return new h({minimum:e.minimum,maximum:e.maximum})},h.packedLength=2*t.packedLength+c.packedLength,h.pack=function(e,i,n){return n=r(n,0),t.pack(e._minimum,i,n),t.pack(e._maximum,i,n+t.packedLength),c.pack(e._vertexFormat,i,n+2*t.packedLength),i};var p=new t,m=new t,f=new c,_={minimum:p,maximum:m,vertexFormat:f};return h.unpack=function(e,i,o){i=r(i,0);var a=t.unpack(e,i,p),s=t.unpack(e,i+t.packedLength,m),l=c.unpack(e,i+2*t.packedLength,f);return n(o)?(o._minimum=t.clone(a,o._minimum), -o._maximum=t.clone(s,o._maximum),o._vertexFormat=c.clone(l,o._vertexFormat),o):new h(_)},h.createGeometry=function(r){var n=r._minimum,o=r._maximum,c=r._vertexFormat;if(!t.equals(n,o)){var h,p,m=new l;if(c.position&&(c.st||c.normal||c.binormal||c.tangent)){if(c.position&&(p=new Float64Array(72),p[0]=n.x,p[1]=n.y,p[2]=o.z,p[3]=o.x,p[4]=n.y,p[5]=o.z,p[6]=o.x,p[7]=o.y,p[8]=o.z,p[9]=n.x,p[10]=o.y,p[11]=o.z,p[12]=n.x,p[13]=n.y,p[14]=n.z,p[15]=o.x,p[16]=n.y,p[17]=n.z,p[18]=o.x,p[19]=o.y,p[20]=n.z,p[21]=n.x,p[22]=o.y,p[23]=n.z,p[24]=o.x,p[25]=n.y,p[26]=n.z,p[27]=o.x,p[28]=o.y,p[29]=n.z,p[30]=o.x,p[31]=o.y,p[32]=o.z,p[33]=o.x,p[34]=n.y,p[35]=o.z,p[36]=n.x,p[37]=n.y,p[38]=n.z,p[39]=n.x,p[40]=o.y,p[41]=n.z,p[42]=n.x,p[43]=o.y,p[44]=o.z,p[45]=n.x,p[46]=n.y,p[47]=o.z,p[48]=n.x,p[49]=o.y,p[50]=n.z,p[51]=o.x,p[52]=o.y,p[53]=n.z,p[54]=o.x,p[55]=o.y,p[56]=o.z,p[57]=n.x,p[58]=o.y,p[59]=o.z,p[60]=n.x,p[61]=n.y,p[62]=n.z,p[63]=o.x,p[64]=n.y,p[65]=n.z,p[66]=o.x,p[67]=n.y,p[68]=o.z,p[69]=n.x,p[70]=n.y,p[71]=o.z,m.position=new s({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:p})),c.normal){var f=new Float32Array(72);f[0]=0,f[1]=0,f[2]=1,f[3]=0,f[4]=0,f[5]=1,f[6]=0,f[7]=0,f[8]=1,f[9]=0,f[10]=0,f[11]=1,f[12]=0,f[13]=0,f[14]=-1,f[15]=0,f[16]=0,f[17]=-1,f[18]=0,f[19]=0,f[20]=-1,f[21]=0,f[22]=0,f[23]=-1,f[24]=1,f[25]=0,f[26]=0,f[27]=1,f[28]=0,f[29]=0,f[30]=1,f[31]=0,f[32]=0,f[33]=1,f[34]=0,f[35]=0,f[36]=-1,f[37]=0,f[38]=0,f[39]=-1,f[40]=0,f[41]=0,f[42]=-1,f[43]=0,f[44]=0,f[45]=-1,f[46]=0,f[47]=0,f[48]=0,f[49]=1,f[50]=0,f[51]=0,f[52]=1,f[53]=0,f[54]=0,f[55]=1,f[56]=0,f[57]=0,f[58]=1,f[59]=0,f[60]=0,f[61]=-1,f[62]=0,f[63]=0,f[64]=-1,f[65]=0,f[66]=0,f[67]=-1,f[68]=0,f[69]=0,f[70]=-1,f[71]=0,m.normal=new s({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:f})}if(c.st){var _=new Float32Array(48);_[0]=0,_[1]=0,_[2]=1,_[3]=0,_[4]=1,_[5]=1,_[6]=0,_[7]=1,_[8]=1,_[9]=0,_[10]=0,_[11]=0,_[12]=0,_[13]=1,_[14]=1,_[15]=1,_[16]=0,_[17]=0,_[18]=1,_[19]=0,_[20]=1,_[21]=1,_[22]=0,_[23]=1,_[24]=1,_[25]=0,_[26]=0,_[27]=0,_[28]=0,_[29]=1,_[30]=1,_[31]=1,_[32]=1,_[33]=0,_[34]=0,_[35]=0,_[36]=0,_[37]=1,_[38]=1,_[39]=1,_[40]=0,_[41]=0,_[42]=1,_[43]=0,_[44]=1,_[45]=1,_[46]=0,_[47]=1,m.st=new s({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:_})}if(c.tangent){var g=new Float32Array(72);g[0]=1,g[1]=0,g[2]=0,g[3]=1,g[4]=0,g[5]=0,g[6]=1,g[7]=0,g[8]=0,g[9]=1,g[10]=0,g[11]=0,g[12]=-1,g[13]=0,g[14]=0,g[15]=-1,g[16]=0,g[17]=0,g[18]=-1,g[19]=0,g[20]=0,g[21]=-1,g[22]=0,g[23]=0,g[24]=0,g[25]=1,g[26]=0,g[27]=0,g[28]=1,g[29]=0,g[30]=0,g[31]=1,g[32]=0,g[33]=0,g[34]=1,g[35]=0,g[36]=0,g[37]=-1,g[38]=0,g[39]=0,g[40]=-1,g[41]=0,g[42]=0,g[43]=-1,g[44]=0,g[45]=0,g[46]=-1,g[47]=0,g[48]=-1,g[49]=0,g[50]=0,g[51]=-1,g[52]=0,g[53]=0,g[54]=-1,g[55]=0,g[56]=0,g[57]=-1,g[58]=0,g[59]=0,g[60]=1,g[61]=0,g[62]=0,g[63]=1,g[64]=0,g[65]=0,g[66]=1,g[67]=0,g[68]=0,g[69]=1,g[70]=0,g[71]=0,m.tangent=new s({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:g})}if(c.binormal){var v=new Float32Array(72);v[0]=0,v[1]=1,v[2]=0,v[3]=0,v[4]=1,v[5]=0,v[6]=0,v[7]=1,v[8]=0,v[9]=0,v[10]=1,v[11]=0,v[12]=0,v[13]=1,v[14]=0,v[15]=0,v[16]=1,v[17]=0,v[18]=0,v[19]=1,v[20]=0,v[21]=0,v[22]=1,v[23]=0,v[24]=0,v[25]=0,v[26]=1,v[27]=0,v[28]=0,v[29]=1,v[30]=0,v[31]=0,v[32]=1,v[33]=0,v[34]=0,v[35]=1,v[36]=0,v[37]=0,v[38]=1,v[39]=0,v[40]=0,v[41]=1,v[42]=0,v[43]=0,v[44]=1,v[45]=0,v[46]=0,v[47]=1,v[48]=0,v[49]=0,v[50]=1,v[51]=0,v[52]=0,v[53]=1,v[54]=0,v[55]=0,v[56]=1,v[57]=0,v[58]=0,v[59]=1,v[60]=0,v[61]=0,v[62]=1,v[63]=0,v[64]=0,v[65]=1,v[66]=0,v[67]=0,v[68]=1,v[69]=0,v[70]=0,v[71]=1,m.binormal=new s({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:v})}h=new Uint16Array(36),h[0]=0,h[1]=1,h[2]=2,h[3]=0,h[4]=2,h[5]=3,h[6]=6,h[7]=5,h[8]=4,h[9]=7,h[10]=6,h[11]=4,h[12]=8,h[13]=9,h[14]=10,h[15]=8,h[16]=10,h[17]=11,h[18]=14,h[19]=13,h[20]=12,h[21]=15,h[22]=14,h[23]=12,h[24]=18,h[25]=17,h[26]=16,h[27]=19,h[28]=18,h[29]=16,h[30]=20,h[31]=21,h[32]=22,h[33]=20,h[34]=22,h[35]=23}else p=new Float64Array(24),p[0]=n.x,p[1]=n.y,p[2]=n.z,p[3]=o.x,p[4]=n.y,p[5]=n.z,p[6]=o.x,p[7]=o.y,p[8]=n.z,p[9]=n.x,p[10]=o.y,p[11]=n.z,p[12]=n.x,p[13]=n.y,p[14]=o.z,p[15]=o.x,p[16]=n.y,p[17]=o.z,p[18]=o.x,p[19]=o.y,p[20]=o.z,p[21]=n.x,p[22]=o.y,p[23]=o.z,m.position=new s({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:p}),h=new Uint16Array(36),h[0]=4,h[1]=5,h[2]=6,h[3]=4,h[4]=6,h[5]=7,h[6]=1,h[7]=0,h[8]=3,h[9]=1,h[10]=3,h[11]=2,h[12]=1,h[13]=6,h[14]=5,h[15]=1,h[16]=2,h[17]=6,h[18]=2,h[19]=3,h[20]=7,h[21]=2,h[22]=7,h[23]=6,h[24]=3,h[25]=0,h[26]=4,h[27]=3,h[28]=4,h[29]=7,h[30]=0,h[31]=1,h[32]=5,h[33]=0,h[34]=5,h[35]=4;var y=t.subtract(o,n,d),C=.5*t.magnitude(y);return new a({attributes:m,indices:h,primitiveType:u.TRIANGLES,boundingSphere:new e(t.ZERO,C)})}},h}),i("Core/BoxOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./PrimitiveType"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e){e=r(e,r.EMPTY_OBJECT);var i=e.minimum,n=e.maximum;this._min=t.clone(i),this._max=t.clone(n),this._workerName="createBoxOutlineGeometry"}var h=new t;c.fromDimensions=function(e){e=r(e,r.EMPTY_OBJECT);var i=e.dimensions,n=t.multiplyByScalar(i,.5,new t);return new c({minimum:t.negate(n,new t),maximum:n})},c.fromAxisAlignedBoundingBox=function(e){return new c({minimum:e.minimum,maximum:e.maximum})},c.packedLength=2*t.packedLength,c.pack=function(e,i,n){return n=r(n,0),t.pack(e._min,i,n),t.pack(e._max,i,n+t.packedLength),i};var d=new t,p=new t,m={minimum:d,maximum:p};return c.unpack=function(e,i,o){i=r(i,0);var a=t.unpack(e,i,d),s=t.unpack(e,i+t.packedLength,p);return n(o)?(o._min=t.clone(a,o._min),o._max=t.clone(s,o._max),o):new c(m)},c.createGeometry=function(r){var n=r._min,o=r._max;if(!t.equals(n,o)){var c=new l,d=new Uint16Array(24),p=new Float64Array(24);p[0]=n.x,p[1]=n.y,p[2]=n.z,p[3]=o.x,p[4]=n.y,p[5]=n.z,p[6]=o.x,p[7]=o.y,p[8]=n.z,p[9]=n.x,p[10]=o.y,p[11]=n.z,p[12]=n.x,p[13]=n.y,p[14]=o.z,p[15]=o.x,p[16]=n.y,p[17]=o.z,p[18]=o.x,p[19]=o.y,p[20]=o.z,p[21]=n.x,p[22]=o.y,p[23]=o.z,c.position=new s({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:p}),d[0]=4,d[1]=5,d[2]=5,d[3]=6,d[4]=6,d[5]=7,d[6]=7,d[7]=4,d[8]=0,d[9]=1,d[10]=1,d[11]=2,d[12]=2,d[13]=3,d[14]=3,d[15]=0,d[16]=0,d[17]=4,d[18]=1,d[19]=5,d[20]=2,d[21]=6,d[22]=3,d[23]=7;var m=t.subtract(o,n,h),f=.5*t.magnitude(m);return new a({attributes:c,indices:d,primitiveType:u.LINES,boundingSphere:new e(t.ZERO,f)})}},c}),i("Core/cancelAnimationFrame",["./defined"],function(e){"use strict";function t(e){i(e)}if("undefined"!=typeof window){var i=window.cancelAnimationFrame;return function(){if(!e(i))for(var t=["webkit","moz","ms","o"],r=0,n=t.length;r=r[i]){if(i+1=0&&t>=r[i-1])return i-1;var o;if(t>r[i])for(o=i;o=r[o]&&t=0&&!(t>=r[o]&&t=0;--o)l[o]=e.subtract(s[o],e.multiplyByScalar(l[o+1],a[o],l[o]),l[o]);return l},r}),i("Core/HermiteSpline",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./LinearSpline","./Matrix4","./Spline","./TridiagonalSystemSolver"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(t,i,n){var o=p,a=f,s=m,l=_;o.length=a.length=t.length-1,s.length=l.length=t.length;var c;o[0]=s[0]=1,a[0]=0;var h=l[0];for(r(h)||(h=l[0]=new e),e.clone(i,h),c=1;c2&&(r(a)||(a=m,e.multiplyByScalar(n[1],2,a),e.subtract(a,n[2],a),e.subtract(a,n[0],a),e.multiplyByScalar(a,.5,a)),!r(s))){var l=n.length-1;s=f,e.multiplyByScalar(n[l-1],2,s),e.subtract(n[l],s,s),e.add(s,n[l-2],s),e.multiplyByScalar(s,.5,s)}this._times=o,this._points=n,this._firstTangent=e.clone(a),this._lastTangent=e.clone(s),this._evaluateFunction=u(this),this._lastTimeIndex=0}var h=new t,d=new e,p=new e,m=new e,f=new e;return n(c.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},firstTangent:{get:function(){return this._firstTangent}},lastTangent:{get:function(){return this._lastTangent}}}),c.catmullRomCoefficientMatrix=new s(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0),c.prototype.findTimeInterval=l.prototype.findTimeInterval,c.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)},c}),i("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,i,r,n){"use strict";var o={UNSIGNED_BYTE:n.UNSIGNED_BYTE,UNSIGNED_SHORT:n.UNSIGNED_SHORT,UNSIGNED_INT:n.UNSIGNED_INT};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>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},o.createTypedArrayFromArrayBuffer=function(e,t,i,n){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,i,n):new Uint16Array(t,i,n)},i(o)}),i("Core/loadArrayBuffer",["./loadWithXhr"],function(e){"use strict";function t(t,i){return e({url:t,responseType:"arraybuffer",headers:i})}return t}),i("Core/Intersections2D",["./Cartesian3","./defined","./DeveloperError"],function(e,t,i){"use strict";var r={};return r.clipTriangleAtAxisAlignedThreshold=function(e,i,r,n,o,a){t(a)?a.length=0:a=[];var s,l,u;i?(s=re,l=n>e,u=o>e);var c,h,d,p,m,f,_=s+l+u;return 1===_?s?(c=(e-r)/(n-r),h=(e-r)/(o-r),a.push(1),a.push(2),1!==h&&(a.push(-1),a.push(0),a.push(2),a.push(h)),1!==c&&(a.push(-1),a.push(0),a.push(1),a.push(c))):l?(d=(e-n)/(o-n),p=(e-n)/(r-n),a.push(2),a.push(0),1!==p&&(a.push(-1),a.push(1),a.push(0),a.push(p)),1!==d&&(a.push(-1),a.push(1),a.push(2),a.push(d))):u&&(m=(e-o)/(r-o),f=(e-o)/(n-o),a.push(0),a.push(1),1!==f&&(a.push(-1),a.push(2),a.push(1),a.push(f)),1!==m&&(a.push(-1),a.push(2),a.push(0),a.push(m))):2===_?s||r===e?l||n===e?u||o===e||(h=(e-r)/(o-r),d=(e-n)/(o-n),a.push(2),a.push(-1),a.push(0),a.push(2),a.push(h),a.push(-1),a.push(1),a.push(2),a.push(d)):(f=(e-o)/(n-o),c=(e-r)/(n-r),a.push(1),a.push(-1),a.push(2),a.push(1),a.push(f),a.push(-1),a.push(0),a.push(1),a.push(c)):(p=(e-n)/(r-n),m=(e-o)/(r-o),a.push(0),a.push(-1),a.push(1),a.push(0),a.push(p),a.push(-1),a.push(2),a.push(0),a.push(m)):3!==_&&(a.push(0),a.push(1),a.push(2)),a},r.computeBarycentricCoordinates=function(i,r,n,o,a,s,l,u,c){var h=n-l,d=l-a,p=s-u,m=o-u,f=1/(p*h+d*m),_=r-u,g=i-l,v=(p*g+d*_)*f,y=(-m*g+h*_)*f,C=1-v-y;return t(c)?(c.x=v,c.y=y,c.z=C,c):new e(v,y,C)},r}),i("Core/QuantizedMeshTerrainData",["../ThirdParty/when","./BoundingSphere","./Cartesian2","./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./IndexDatatype","./Intersections2D","./Math","./OrientedBoundingBox","./TaskProcessor","./TerrainEncoding","./TerrainMesh"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m){"use strict";function f(e){function t(e,t){return a[e]-a[t]}function i(e,t){return o[e]-o[t]}this._quantizedVertices=e.quantizedVertices,this._encodedNormals=e.encodedNormals,this._indices=e.indices,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._boundingSphere=e.boundingSphere,this._orientedBoundingBox=e.orientedBoundingBox,this._horizonOcclusionPoint=e.horizonOcclusionPoint;var r=this._quantizedVertices.length/3,o=this._uValues=this._quantizedVertices.subarray(0,r),a=this._vValues=this._quantizedVertices.subarray(r,2*r);this._heightValues=this._quantizedVertices.subarray(2*r,3*r),this._westIndices=_(e.westIndices,t,r),this._southIndices=_(e.southIndices,i,r),this._eastIndices=_(e.eastIndices,t,r),this._northIndices=_(e.northIndices,i,r),this._westSkirtHeight=e.westSkirtHeight,this._southSkirtHeight=e.southSkirtHeight,this._eastSkirtHeight=e.eastSkirtHeight,this._northSkirtHeight=e.northSkirtHeight,this._childTileMask=n(e.childTileMask,15),this._createdByUpsampling=n(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._mesh=void 0}function _(e,t,i){y.length=e.length;for(var r=!1,n=0,o=e.length;n0&&t(e[n-1],e[n])>0;return r?(y.sort(t),l.createTypedArray(i,y)):e}function g(e,t,i){for(var r=e._mesh,n=r.vertices,o=r.encoding,a=r.indices,s=0,l=a.length;s=-1e-15&&_.y>=-1e-15&&_.z>=-1e-15){var g=o.decodeHeight(n,c),v=o.decodeHeight(n,h),y=o.decodeHeight(n,d);return _.x*g+_.y*v+_.z*y}}}function v(e,t,i){for(var r=e._uValues,n=e._vValues,o=e._heightValues,a=e._indices,s=0,l=a.length;s=-1e-15&&C.y>=-1e-15&&C.z>=-1e-15){var w=C.x*o[h]+C.y*o[d]+C.z*o[p];return c.lerp(e._minimumHeight,e._maximumHeight,w/S)}}}a(f.prototype,{waterMask:{get:function(){return this._waterMask}}});var y=[],C=new d("createVerticesFromQuantizedTerrainMesh");f.prototype.createMesh=function(t,i,r,a,s){var u=t.ellipsoid,c=t.tileXYToRectangle(i,r,a);s=n(s,1);var h=C.scheduleTask({minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,quantizedVertices:this._quantizedVertices,octEncodedNormals:this._encodedNormals,includeWebMercatorT:!0,indices:this._indices,westIndices:this._westIndices,southIndices:this._southIndices,eastIndices:this._eastIndices,northIndices:this._northIndices,westSkirtHeight:this._westSkirtHeight,southSkirtHeight:this._southSkirtHeight,eastSkirtHeight:this._eastSkirtHeight,northSkirtHeight:this._northSkirtHeight,rectangle:c,relativeToCenter:this._boundingSphere.center,ellipsoid:u,exaggeration:s});if(o(h)){var d=this;return e(h,function(e){var t=d._quantizedVertices.length/3;t+=d._westIndices.length+d._southIndices.length+d._eastIndices.length+d._northIndices.length;var i=l.createTypedArray(t,e.indices),r=new Float32Array(e.vertices),o=e.center,a=e.minimumHeight,u=e.maximumHeight,c=n(e.boundingSphere,d._boundingSphere),h=n(e.orientedBoundingBox,d._orientedBoundingBox),f=d._horizonOcclusionPoint,_=e.vertexStride,g=p.clone(e.encoding);return d._skirtIndex=e.skirtIndex,d._vertexCountWithoutSkirts=d._quantizedVertices.length/3,d._mesh=new m(o,r,i,a,u,c,f,_,h,g,s),d._quantizedVertices=void 0,d._encodedNormals=void 0,d._indices=void 0,d._uValues=void 0,d._vValues=void 0,d._heightValues=void 0,d._westIndices=void 0,d._southIndices=void 0,d._eastIndices=void 0,d._northIndices=void 0,d._mesh})}};var w=new d("upsampleQuantizedTerrainMesh");f.prototype.upsample=function(i,n,a,s,u,c,d){var p=this._mesh;if(o(this._mesh)){var m=2*n!==u,_=2*a===c,g=i.ellipsoid,v=i.tileXYToRectangle(u,c,d),y=w.scheduleTask({vertices:p.vertices,vertexCountWithoutSkirts:this._vertexCountWithoutSkirts,indices:p.indices,skirtIndex:this._skirtIndex,encoding:p.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:m,isNorthChild:_,childRectangle:v,ellipsoid:g,exaggeration:p.exaggeration});if(o(y)){var C=Math.min(this._westSkirtHeight,this._eastSkirtHeight);C=Math.min(C,this._southSkirtHeight),C=Math.min(C,this._northSkirtHeight);var S=m?.5*C:this._westSkirtHeight,E=_?.5*C:this._southSkirtHeight,b=m?this._eastSkirtHeight:.5*C,T=_?this._northSkirtHeight:.5*C;return e(y,function(e){var i,n=new Uint16Array(e.vertices),a=l.createTypedArray(n.length/3,e.indices);return o(e.encodedNormals)&&(i=new Uint8Array(e.encodedNormals)),new f({quantizedVertices:n,indices:a,encodedNormals:i,minimumHeight:e.minimumHeight,maximumHeight:e.maximumHeight,boundingSphere:t.clone(e.boundingSphere),orientedBoundingBox:h.clone(e.orientedBoundingBox),horizonOcclusionPoint:r.clone(e.horizonOcclusionPoint),westIndices:e.westIndices,southIndices:e.southIndices,eastIndices:e.eastIndices,northIndices:e.northIndices,westSkirtHeight:S,southSkirtHeight:E,eastSkirtHeight:b,northSkirtHeight:T,childTileMask:0,createdByUpsampling:!0})})}}};var S=32767,E=new r;f.prototype.interpolateHeight=function(e,t,i){var r=c.clamp((t-e.west)/e.width,0,1);r*=S;var n=c.clamp((i-e.south)/e.height,0,1);return n*=S,o(this._mesh)?void g(this,r,n):v(this,r,n)};var b=new i,T=new i,x=new i;return f.prototype.isChildAvailable=function(e,t,i,r){var n=2;return i!==2*e&&++n,r!==2*t&&(n-=2),0!==(this._childTileMask&1<0?o.raiseEvent(d):console.log('An error occurred in "'+n.constructor.name+'": '+i(a)),d.retry&&t(c)&&c(),d},r.handleSuccess=function(e){t(e)&&(e.timesRetried=-1)},r}),i("Core/CesiumTerrainProvider",["../ThirdParty/Uri","../ThirdParty/when","./BoundingSphere","./Cartesian3","./Credit","./defaultValue","./defined","./defineProperties","./DeveloperError","./Event","./GeographicTilingScheme","./HeightmapTerrainData","./IndexDatatype","./joinUrls","./loadArrayBuffer","./loadJson","./Math","./OrientedBoundingBox","./QuantizedMeshTerrainData","./TerrainProvider","./throttleRequestByServer","./TileProviderError"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w){"use strict";function S(i){function r(t){var i;if(!t.format)return i="The tile format is not specified in the layer.json file.",void(m=w.handleError(m,_,_._errorEvent,i,void 0,void 0,void 0,l));if(!t.tiles||0===t.tiles.length)return i="The layer.json file does not specify any tile URL templates.",void(m=w.handleError(m,_,_._errorEvent,i,void 0,void 0,void 0,l));if("heightmap-1.0"===t.format)_._heightmapStructure={heightScale:.2,heightOffset:-1e3,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1,lowestEncodedHeight:0,highestEncodedHeight:65535},_._hasWaterMask=!0,_._requestWaterMask=!0;else if(0!==t.format.indexOf("quantized-mesh-1."))return i='The tile format "'+t.format+'" is invalid or not supported.',void(m=w.handleError(m,_,_._errorEvent,i,void 0,void 0,void 0,l));_._tileUrlTemplates=t.tiles;for(var r=0;r<_._tileUrlTemplates.length;++r){var o=new e(_._tileUrlTemplates[r]),s=new e(_._url);o.authority&&!s.authority&&(s.authority=o.authority,s.scheme=o.scheme),_._tileUrlTemplates[r]=p(s,o).toString().replace("{version}",t.version)}_._availableTiles=t.available,!a(_._credit)&&a(t.attribution)&&null!==t.attribution&&(_._credit=new n(t.attribution)),a(t.extensions)&&t.extensions.indexOf("octvertexnormals")!==-1?_._hasVertexNormals=!0:a(t.extensions)&&t.extensions.indexOf("vertexnormals")!==-1&&(_._hasVertexNormals=!0,_._littleEndianExtensionSize=!1),a(t.extensions)&&t.extensions.indexOf("watermask")!==-1&&(_._hasWaterMask=!0),_._ready=!0,_._readyPromise.resolve(!0)}function s(e){if(a(e)&&404===e.statusCode)return void r({tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]});var t="An error occurred while accessing "+d+".";m=w.handleError(m,_,_._errorEvent,t,void 0,void 0,void 0,l)}function l(){var e=f(d);t(e,r,s)}this._url=i.url,this._proxy=i.proxy,this._tilingScheme=new c({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:i.ellipsoid}),this._heightmapWidth=65,this._levelZeroMaximumGeometricError=y.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,this._heightmapWidth,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._heightmapStructure=void 0,this._hasWaterMask=!1,this._hasVertexNormals=!1,this._requestVertexNormals=o(i.requestVertexNormals,!1),this._littleEndianExtensionSize=!0,this._requestWaterMask=o(i.requestWaterMask,!1),this._errorEvent=new u;var h=i.credit;"string"==typeof h&&(h=new n(h)),this._credit=h,this._ready=!1,this._readyPromise=t.defer();var d=p(this._url,"layer.json");a(this._proxy)&&(d=this._proxy.getURL(d));var m,_=this;l()}function E(e){if(a(e)&&0!==e.length){var t=e.join("-");return{Accept:"application/vnd.quantized-mesh;extensions="+t+",application/octet-stream;q=0.9,*/*;q=0.01"}}return{Accept:"application/vnd.quantized-mesh,application/octet-stream;q=0.9,*/*;q=0.01"}}function b(e,t,i,r,n,o){var a=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new h({buffer:a,childTileMask:new Uint8Array(t,a.byteLength,1)[0],waterMask:new Uint8Array(t,a.byteLength+1,t.byteLength-a.byteLength-1),width:e._heightmapWidth,height:e._heightmapWidth,structure:e._heightmapStructure})}function T(e,t,n,o,a,s){function l(e){return e>>1^-(1&e)}var u=0,c=3,h=c+1,p=Float64Array.BYTES_PER_ELEMENT*c,m=Float64Array.BYTES_PER_ELEMENT*h,f=3,y=Uint16Array.BYTES_PER_ELEMENT*f,C=3,w=Uint16Array.BYTES_PER_ELEMENT,S=w*C,E=new DataView(t),b=new r(E.getFloat64(u,!0),E.getFloat64(u+8,!0),E.getFloat64(u+16,!0));u+=p;var T=E.getFloat32(u,!0);u+=Float32Array.BYTES_PER_ELEMENT;var A=E.getFloat32(u,!0);u+=Float32Array.BYTES_PER_ELEMENT;var D=new i(new r(E.getFloat64(u,!0),E.getFloat64(u+8,!0),E.getFloat64(u+16,!0)),E.getFloat64(u+p,!0));u+=m;var M=new r(E.getFloat64(u,!0),E.getFloat64(u+8,!0),E.getFloat64(u+16,!0));u+=p;var I=E.getUint32(u,!0);u+=Uint32Array.BYTES_PER_ELEMENT;var R=new Uint16Array(t,u,3*I);u+=I*y,I>65536&&(w=Uint32Array.BYTES_PER_ELEMENT,S=w*C);var O,N=R.subarray(0,I),L=R.subarray(I,2*I),B=R.subarray(2*I,3*I),F=0,V=0,k=0;for(O=0;O=n.length)return 0;var a=n[o],s=0;return s|=A(a,2*i,2*r)?1:0,s|=A(a,2*i+1,2*r)?2:0,s|=A(a,2*i,2*r+1)?4:0,s|=A(a,2*i+1,2*r+1)?8:0}function A(e,t,i){for(var r=0,n=e.length;r=o.startX&&t<=o.endX&&i>=o.startY&&i<=o.endY)return!0}return!1}var P={OCT_VERTEX_NORMALS:1,WATER_MASK:2};return S.prototype.requestTileGeometry=function(e,i,r,n){function s(e){return m(e,E(f))}var l=this._tileUrlTemplates;if(0!==l.length){var u=this._tilingScheme.getNumberOfYTilesAtLevel(r),c=u-i-1,h=l[(e+c+r)%l.length].replace("{z}",r).replace("{x}",e).replace("{y}",c),d=this._proxy;a(d)&&(h=d.getURL(h));var p,f=[];if(this._requestVertexNormals&&this._hasVertexNormals&&f.push(this._littleEndianExtensionSize?"octvertexnormals":"vertexnormals"),this._requestWaterMask&&this._hasWaterMask&&f.push("watermask"),n=o(n,!0)){if(p=C(h,s),!a(p))return}else p=s(h);var _=this;return t(p,function(t){return a(_._heightmapStructure)?b(_,t,r,e,i,c):T(_,t,r,e,i,c)})}},s(S.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},hasWaterMask:{get:function(){return this._hasWaterMask&&this._requestWaterMask}},hasVertexNormals:{get:function(){return this._hasVertexNormals&&this._requestVertexNormals}},requestVertexNormals:{get:function(){return this._requestVertexNormals}},requestWaterMask:{get:function(){return this._requestWaterMask}}}),S.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<=r.length)return!1;var n=r[i],o=this._tilingScheme.getNumberOfYTilesAtLevel(i),a=o-t-1;return A(n,e,a)}},S}),i("Core/EllipseGeometryLibrary",["./Cartesian3","./Math","./Matrix3","./Quaternion"],function(e,t,i,r){"use strict";function n(t,n,o,c,h,d,p,m,f,_){var g=t+n;e.multiplyByScalar(c,Math.cos(g),a),e.multiplyByScalar(o,Math.sin(g),s),e.add(a,s,a);var v=Math.cos(t);v*=v;var y=Math.sin(t);y*=y;var C=d/Math.sqrt(p*v+h*y),w=C/m;return r.fromAxisAngle(a,w,l),i.fromQuaternion(l,u),i.multiplyByVector(u,f,_),e.normalize(_,_),e.multiplyByScalar(_,m,_),_}var o={},a=new e,s=new e,l=new r,u=new i,c=new e,h=new e,d=new e,p=new e;o.raisePositionsToHeight=function(t,i,r){for(var n=i.ellipsoid,o=i.height,a=i.extrudedHeight,s=r?t.length/3*2:t.length/3,l=new Float64Array(3*s),u=t.length,m=r?u:0,f=0;f1;--A){if(x=t.PI_OVER_TWO-(A-1)*T,L=n(-x,l,E,S,g,y,v,C,w,L),B=n(x+Math.PI,l,E,S,g,y,v,C,w,B),r){for(O[N++]=L.x,O[N++]=L.y,O[N++]=L.z,D=2*(A-1)+2,P=1;P=0?(r=65536*Math.floor(e/65536),i.high=r,i.low=e-r):(r=65536*Math.floor(-e/65536),i.high=-r,i.low=e+r),i};var n={high:0,low:0};r.fromCartesian=function(e,i){t(i)||(i=new r);var o=i.high,a=i.low;return r.encode(e.x,n),o.x=n.high,a.x=n.low,r.encode(e.y,n),o.y=n.high,a.y=n.low,r.encode(e.z,n),o.z=n.high,a.z=n.low,i};var o=new r;return r.writeElements=function(e,t,i){r.fromCartesian(e,o);var n=o.high,a=o.low;t[i]=n.x,t[i+1]=n.y,t[i+2]=n.z,t[i+3]=a.x,t[i+4]=a.y,t[i+5]=a.z},r}),i("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t,i){"use strict";var r={};return r.calculateACMR=function(i){i=e(i,e.EMPTY_OBJECT);var r=i.indices,n=i.maximumIndex,o=e(i.cacheSize,24),a=r.length;if(!t(n)){n=0;for(var s=0,l=r[s];sn&&(n=l),++s,l=r[s]}for(var u=[],c=0;co&&(u[r[d]]=h,++h);return(h-o+1)/(a/3)},r.tipsify=function(i){function r(e,t,i,r){for(;t.length>=1;){var n=t[t.length-1];if(t.splice(t.length-1,1),e[n].numLiveTriangles>0)return n}for(;o0)return++o,o-1;++o}return-1}function n(e,t,i,n,o,a,s){for(var l,u=-1,c=-1,h=0;hc||c===-1)&&(c=l,u=d)),++h}return u===-1?r(n,a,e,s):u}i=e(i,e.EMPTY_OBJECT);var o,a=i.indices,s=i.maximumIndex,l=e(i.cacheSize,24),u=a.length,c=0,h=0,d=a[h],p=u;if(t(s))c=s+1;else{for(;hc&&(c=d),++h,d=a[h];if(c===-1)return 0;++c}for(var m=[],f=0;fl&&(y.timeStamp=v,++v),++h}g=n(a,l,w,m,v,S,c)}return b},r}),i("Core/GeometryPipeline",["./AttributeCompression","./barycentricCoordinates","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EncodedCartesian3","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryType","./IndexDatatype","./Intersect","./IntersectionTests","./Math","./Matrix3","./Matrix4","./Plane","./PrimitiveType","./Tipsify"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b){"use strict";function T(e,t,i,r,n){e[t++]=i,e[t++]=r,e[t++]=r,e[t++]=n,e[t++]=n,e[t]=i}function x(e){for(var t=e.length,i=t/3*6,r=_.createTypedArray(t,i),n=0,o=0;o=3){var i=6*(t-2),r=_.createTypedArray(t,i);T(r,0,e[0],e[1],e[2]);for(var n=6,o=3;o0){for(var t=e.length-1,i=6*(t-1),r=_.createTypedArray(t,i),n=e[0],o=0,a=1;aD&&(D=M)}return new p({attributes:g,indices:v,primitiveType:f,boundingSphere:u(P)?new i(P,D):void 0})}function L(e){if(u(e.indices))return e;for(var t=p.computeNumberOfVertices(e),i=_.createTypedArray(t,t),r=0;r3&&(i[3]=0,i[4]=2,i[5]=3);for(var r=6,n=3;no?n>a?y.sign(e.y):y.sign(i.y):o>a?y.sign(t.y):y.sign(i.y);var s=r<0;G(e,s),G(t,s),G(i,s)}function H(e,t,i,r){n.add(e,n.multiplyByScalar(n.subtract(t,e,Ce),e.y/(e.y-t.y),Ce),i),n.clone(i,r),G(i,!0),G(r,!1)}function q(e,t,i){if(!(e.x>=0||t.x>=0||i.x>=0)){W(e,t,i);var r=e.y<0,n=t.y<0,o=i.y<0,a=0;a+=r?1:0,a+=n?1:0,a+=o?1:0;var s=Te.indices;1===a?(s[1]=3,s[2]=4,s[5]=6,s[7]=6,s[8]=5,r?(H(e,t,we,Ee),H(e,i,Se,be),s[0]=0,s[3]=1,s[4]=2,s[6]=1):n?(H(t,i,we,Ee),H(t,e,Se,be),s[0]=1,s[3]=2,s[4]=0,s[6]=2):o&&(H(i,e,we,Ee),H(i,t,Se,be),s[0]=2,s[3]=0,s[4]=1,s[6]=0)):2===a&&(s[2]=4,s[4]=4,s[5]=3,s[7]=5,s[8]=6,r?n?o||(H(i,e,we,Ee),H(i,t,Se,be),s[0]=0,s[1]=1,s[3]=0,s[6]=2):(H(t,i,we,Ee),H(t,e,Se,be),s[0]=2,s[1]=0,s[3]=2,s[6]=1):(H(e,t,we,Ee),H(e,i,Se,be),s[0]=1,s[1]=2,s[3]=1,s[6]=0));var l=Te.positions;return l[0]=e,l[1]=t,l[2]=i,l.length=3,1!==a&&2!==a||(l[3]=we,l[4]=Se,l[5]=Ee,l[6]=be,l.length=7),Te}}function j(e,t){var r=e.attributes;if(0!==r.position.values.length){for(var n in r)if(r.hasOwnProperty(n)&&u(r[n])&&u(r[n].values)){var o=r[n];o.values=s.createTypedArray(o.componentDatatype,o.values)}var a=p.computeNumberOfVertices(e);return e.indices=_.createTypedArray(a,e.indices),t&&(e.boundingSphere=i.fromVertices(r.position.values)),e}}function Y(e){var t=e.attributes,i={};for(var r in t)if(t.hasOwnProperty(r)&&u(t[r])&&u(t[r].values)){var n=t[r];i[r]=new m({componentDatatype:n.componentDatatype,componentsPerAttribute:n.componentsPerAttribute,normalize:n.normalize,values:[]})}return new p({attributes:i,indices:[],primitiveType:e.primitiveType})}function X(e,t,i){var r=u(e.geometry.boundingSphere);t=j(t,r),i=j(i,r),u(i)&&!u(t)?e.geometry=i:!u(i)&&u(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=i,e.geometry=void 0)}function Z(e,i,o,a,s,l,c,h,d,p,m){if(u(l)||u(c)||u(h)||u(d)){var f=n.fromArray(s,3*e,xe),_=n.fromArray(s,3*i,Ae),g=n.fromArray(s,3*o,Pe),v=t(a,f,_,g,De);if(u(l)){var y=n.fromArray(l,3*e,xe),C=n.fromArray(l,3*i,Ae),w=n.fromArray(l,3*o,Pe);n.multiplyByScalar(y,v.x,y),n.multiplyByScalar(C,v.y,C),n.multiplyByScalar(w,v.z,w);var S=n.add(y,C,y);n.add(S,w,S),n.normalize(S,S),n.pack(S,p.normal.values,3*m)}if(u(c)){var E=n.fromArray(c,3*e,xe),b=n.fromArray(c,3*i,Ae),T=n.fromArray(c,3*o,Pe);n.multiplyByScalar(E,v.x,E),n.multiplyByScalar(b,v.y,b),n.multiplyByScalar(T,v.z,T);var x=n.add(E,b,E);n.add(x,T,x),n.normalize(x,x),n.pack(x,p.binormal.values,3*m)}if(u(h)){var A=n.fromArray(h,3*e,xe),P=n.fromArray(h,3*i,Ae),D=n.fromArray(h,3*o,Pe);n.multiplyByScalar(A,v.x,A),n.multiplyByScalar(P,v.y,P),n.multiplyByScalar(D,v.z,D);var M=n.add(A,P,A);n.add(M,D,M),n.normalize(M,M),n.pack(M,p.tangent.values,3*m)}if(u(d)){var I=r.fromArray(d,2*e,Me),R=r.fromArray(d,2*i,Ie),O=r.fromArray(d,2*o,Re);r.multiplyByScalar(I,v.x,I),r.multiplyByScalar(R,v.y,R),r.multiplyByScalar(O,v.z,O);var N=r.add(I,R,I);r.add(N,O,N),r.pack(N,p.st.values,2*m)}}}function K(e,t,i,r,n,o){var a=e.position.values.length/3;if(n!==-1){var s=r[n],l=i[s];return l===-1?(i[s]=a,e.position.values.push(o.x,o.y,o.z),t.push(a),a):(t.push(l),l)}return e.position.values.push(o.x,o.y,o.z),t.push(a),a}function Q(e){var t,i,r,o,a,s=e.geometry,l=s.attributes,c=l.position.values,h=u(l.normal)?l.normal.values:void 0,d=u(l.binormal)?l.binormal.values:void 0,p=u(l.tangent)?l.tangent.values:void 0,m=u(l.st)?l.st.values:void 0,f=s.indices,_=Y(s),g=Y(s),v=[];v.length=c.length/3;var y=[];for(y.length=c.length/3,a=0;a3)for(var P=A.positions,D=A.indices,M=D.length,I=0;I0)){var u=n.unpack(r,s,ke);(l.y<0&&u.y>0||l.y>0&&u.y<0)&&(s-3>0?(r[s]=i[s-3],r[s+1]=i[s-2],r[s+2]=i[s-1]):n.pack(l,r,s));var c=n.unpack(o,s,ze);(l.y<0&&c.y>0||l.y>0&&c.y<0)&&(s+3n&&(n=i[o]);e.indices=b.tipsify({indices:i,maximumIndex:n,cacheSize:t})}return e},te.fitToUnsignedShortIndices=function(e){var t=[],i=p.computeNumberOfVertices(e);if(u(e.indices)&&i>=y.SIXTY_FOUR_KILOBYTES){var r,n=[],o=[],a=0,s=D(e.attributes),l=e.indices,c=l.length;e.primitiveType===E.TRIANGLES?r=3:e.primitiveType===E.LINES?r=2:e.primitiveType===E.POINTS&&(r=1);for(var h=0;h=y.SIXTY_FOUR_KILOBYTES&&(t.push(new p({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),n=[],o=[],a=0,s=D(e.attributes))}0!==o.length&&t.push(new p({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var ie=new n,re=new a;te.projectTo2D=function(e,t,i,r,o){var a=e.attributes[t];o=u(o)?o:new d;for(var l=o.ellipsoid,c=a.values,h=new Float64Array(c.length),p=0,f=0;f0&&a.push(N(t,"geometry")),i.length>0&&(a.push(N(i,"westHemisphereGeometry")),a.push(N(i,"eastHemisphereGeometry"))),a};var ue=new n,ce=new n,he=new n,de=new n;te.computeNormal=function(e){for(var t=e.indices,i=e.attributes,r=i.position.values,o=i.position.values.length/3,a=t.length,l=new Array(o),u=new Array(a/3),c=new Array(a),h=0;h0){for(n.clone(n.ZERO,ue),d=0;d0||i.intersectPlane(r,S.ORIGIN_ZX_PLANE)!==g.INTERSECTING)return e}if(t.geometryType!==f.NONE)switch(t.geometryType){case f.POLYLINES:ee(e);break;case f.TRIANGLES:Q(e);break;case f.LINES:J(e)}else U(t),t.primitiveType===E.TRIANGLES?Q(e):t.primitiveType===E.LINES&&J(e);return e},te}),i("Core/EllipseGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError","./EllipseGeometryLibrary","./Ellipsoid","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix3","./Matrix4","./PrimitiveType","./Quaternion","./Rectangle","./Transforms","./VertexFormat"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T){"use strict";function x(e,r,o){var a=r.vertexFormat,s=r.center,l=r.semiMajorAxis,c=r.semiMinorAxis,d=r.ellipsoid,f=r.stRotation,_=o?e.length/3*2:e.length/3,g=a.st?new Float32Array(2*_):void 0,v=a.normal?new Float32Array(3*_):void 0,C=a.tangent?new Float32Array(3*_):void 0,w=a.binormal?new Float32Array(3*_):void 0,E=0,b=U,T=G,x=W,A=new h(d),P=A.project(d.cartesianToCartographic(s,H),q),D=d.scaleToGeodeticSurface(s,N);d.geodeticSurfaceNormal(D,D);for(var M=S.fromAxisAngle(D,f,z),I=y.fromQuaternion(M,k),R=t.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,j),O=t.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Y),F=e.length,X=o?F:0,Z=X/3*2,K=0;K1;--n){for(a[s++]=t++,a[s++]=t,a[s++]=r,i=2*n,o=0;o1,p=o(e.vertexFormat,T.DEFAULT);this._center=i.clone(t),this._semiMajorAxis=n,this._semiMinorAxis=s,this._ellipsoid=c.clone(r),this._rotation=o(e.rotation,0),this._stRotation=o(e.stRotation,0),this._height=u,this._granularity=l,this._vertexFormat=T.clone(p),this._extrudedHeight=o(h,u),this._extrude=d,this._workerName="createEllipseGeometry",this._rectangle=R(this._center,this._ellipsoid,n,s,this._rotation)}var N=new i,L=new i,B=new i,F=new i,V=new t,k=new y,z=new S,U=new i,G=new i,W=new i,H=new r,q=new i,j=new t,Y=new t,X=new i,Z=new e,K=new e,Q=new C,J=new C,$=new y,ee=[new i,new i,new i,new i],te=[new r,new r,new r,new r];O.packedLength=i.packedLength+c.packedLength+T.packedLength+E.packedLength+8,O.pack=function(e,t,r){return r=o(r,0),i.pack(e._center,t,r),r+=i.packedLength,c.pack(e._ellipsoid,t,r),r+=c.packedLength,T.pack(e._vertexFormat,t,r),r+=T.packedLength,E.pack(e._rectangle,t,r),r+=E.packedLength,t[r++]=e._semiMajorAxis,t[r++]=e._semiMinorAxis,t[r++]=e._rotation,t[r++]=e._stRotation,t[r++]=e._height,t[r++]=e._granularity,t[r++]=e._extrudedHeight,t[r]=e._extrude?1:0,t};var ie=new i,re=new c,ne=new T,oe=new E,ae={center:ie,ellipsoid:re,vertexFormat:ne,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0};return O.unpack=function(e,t,r){t=o(t,0);var n=i.unpack(e,t,ie);t+=i.packedLength;var s=c.unpack(e,t,re);t+=c.packedLength;var l=T.unpack(e,t,ne);t+=T.packedLength;var u=E.unpack(e,t,oe);t+=E.packedLength;var h=e[t++],d=e[t++],p=e[t++],m=e[t++],f=e[t++],_=e[t++],g=e[t++],v=1===e[t];return a(r)?(r._center=i.clone(n,r._center),r._ellipsoid=c.clone(s,r._ellipsoid),r._vertexFormat=T.clone(l,r._vertexFormat),r._semiMajorAxis=h,r._semiMinorAxis=d,r._rotation=p,r._stRotation=m,r._height=f,r._granularity=_,r._extrudedHeight=g,r._extrude=v,r._rectangle=E.clone(u),r):(ae.height=f,ae.extrudedHeight=g,ae.granularity=_,ae.stRotation=m,ae.rotation=p,ae.semiMajorAxis=h,ae.semiMinorAxis=d,new O(ae))},O.createGeometry=function(e){if(!(e._semiMajorAxis<=0||e._semiMinorAxis<=0)){e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);var t,i={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:e._height,extrudedHeight:e._extrudedHeight,granularity:e._granularity,vertexFormat:e._vertexFormat,stRotation:e._stRotation};return e._extrude?(i.extrudedHeight=Math.min(e._extrudedHeight,e._height),i.height=Math.max(e._extrudedHeight,e._height),t=I(i)):t=P(i),new d({attributes:t.attributes,indices:t.indices,primitiveType:w.TRIANGLES,boundingSphere:t.boundingSphere})}},O.createShadowVolume=function(e,t,i){var r=e._granularity,n=e._ellipsoid,o=t(r,n),a=i(r,n);return new O({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:n,rotation:e._rotation,stRotation:e._stRotation,granularity:r,extrudedHeight:o,height:a,vertexFormat:T.POSITION_ONLY})},s(O.prototype,{rectangle:{get:function(){return this._rectangle}}}),O}),i("Core/CircleGeometry",["./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./EllipseGeometry","./Ellipsoid","./VertexFormat"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){e=t(e,t.EMPTY_OBJECT);var i=e.radius,r={center:e.center,semiMajorAxis:i,semiMinorAxis:i,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,vertexFormat:e.vertexFormat,stRotation:e.stRotation};this._ellipseGeometry=new o(r),this._workerName="createCircleGeometry"}l.packedLength=o.packedLength,l.pack=function(e,t,i){return o.pack(e._ellipseGeometry,t,i)};var u=new o({center:new e,semiMajorAxis:1,semiMinorAxis:1}),c={center:new e,radius:void 0,ellipsoid:a.clone(a.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new s,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};return l.unpack=function(t,r,n){var h=o.unpack(t,r,u);return c.center=e.clone(h._center,c.center),c.ellipsoid=a.clone(h._ellipsoid,c.ellipsoid),c.height=h._height,c.extrudedHeight=h._extrudedHeight,c.granularity=h._granularity,c.vertexFormat=s.clone(h._vertexFormat,c.vertexFormat),c.stRotation=h._stRotation,i(n)?(c.semiMajorAxis=h._semiMajorAxis,c.semiMinorAxis=h._semiMinorAxis,n._ellipseGeometry=new o(c),n):(c.radius=h._semiMajorAxis,new l(c))},l.createGeometry=function(e){return o.createGeometry(e._ellipseGeometry)},l.createShadowVolume=function(e,t,i){var r=e._ellipseGeometry._granularity,n=e._ellipseGeometry._ellipsoid,o=t(r,n),a=i(r,n);return new l({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:n,stRotation:e._ellipseGeometry._stRotation,granularity:r,extrudedHeight:o,height:a,vertexFormat:s.POSITION_ONLY})},r(l.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}}}),l}),i("Core/EllipseOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EllipseGeometryLibrary","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p){"use strict";function m(r){var n=r.center;v=t.multiplyByScalar(r.ellipsoid.geodeticSurfaceNormal(n,v),r.height,v),v=t.add(n,v,v);for(var o=new e(v,r.semiMajorAxis),s=a.computeEllipsePositions(r,!1,!0).outerPositions,l=new c({position:new u({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:a.raisePositionsToHeight(s,r,!1)})}),d=s.length/3,p=h.createTypedArray(d,2*d),m=0,f=0;f0){var x=Math.min(w,v);T=Math.round(v/x);var A=Math.min(T*w,v);for(E=0;E1;this._center=t.clone(i),this._semiMajorAxis=a,this._semiMinorAxis=l,this._ellipsoid=s.clone(o),this._rotation=r(e.rotation,0),this._height=c,this._granularity=u,this._extrudedHeight=h,this._extrude=p,this._numberOfVerticalLines=Math.max(r(e.numberOfVerticalLines,16),0),this._workerName="createEllipseOutlineGeometry"}var g=new t,v=new t,y=new e,C=new e;_.packedLength=t.packedLength+s.packedLength+9,_.pack=function(e,i,o){return o=r(o,0),t.pack(e._center,i,o),o+=t.packedLength,s.pack(e._ellipsoid,i,o),o+=s.packedLength,i[o++]=e._semiMajorAxis,i[o++]=e._semiMinorAxis,i[o++]=e._rotation,i[o++]=e._height,i[o++]=e._granularity,i[o++]=n(e._extrudedHeight)?1:0,i[o++]=r(e._extrudedHeight,0),i[o++]=e._extrude?1:0,i[o]=e._numberOfVerticalLines,i};var w=new t,S=new s,E={center:w,ellipsoid:S,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0};return _.unpack=function(e,i,o){i=r(i,0);var a=t.unpack(e,i,w);i+=t.packedLength;var l=s.unpack(e,i,S);i+=s.packedLength;var u=e[i++],c=e[i++],h=e[i++],d=e[i++],p=e[i++],m=e[i++],f=e[i++],g=1===e[i++],v=e[i];return n(o)?(o._center=t.clone(a,o._center),o._ellipsoid=s.clone(l,o._ellipsoid),o._semiMajorAxis=u,o._semiMinorAxis=c,o._rotation=h,o._height=d,o._granularity=p,o._extrudedHeight=m?f:void 0,o._extrude=g,o._numberOfVerticalLines=v,o):(E.height=d,E.extrudedHeight=m?f:void 0,E.granularity=p,E.rotation=h,E.semiMajorAxis=u,E.semiMinorAxis=c,E.numberOfVerticalLines=v,new _(E))},_.createGeometry=function(e){if(!(e._semiMajorAxis<=0||e._semiMinorAxis<=0)){e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);var t,i={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:e._height,extrudedHeight:e._extrudedHeight,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines};return e._extrude?(i.extrudedHeight=Math.min(e._extrudedHeight,e._height),i.height=Math.max(e._extrudedHeight,e._height),t=f(i)):t=m(i),new l({attributes:t.attributes,indices:t.indices,primitiveType:p.LINES,boundingSphere:t.boundingSphere})}},_}),i("Core/CircleOutlineGeometry",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./EllipseOutlineGeometry","./Ellipsoid"],function(e,t,i,r,n,o){"use strict";function a(e){e=t(e,t.EMPTY_OBJECT);var i=e.radius,r={center:e.center,semiMajorAxis:i,semiMinorAxis:i,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,numberOfVerticalLines:e.numberOfVerticalLines};this._ellipseGeometry=new n(r),this._workerName="createCircleOutlineGeometry"}a.packedLength=n.packedLength,a.pack=function(e,t,i){return n.pack(e._ellipseGeometry,t,i)};var s=new n({center:new e,semiMajorAxis:1,semiMinorAxis:1}),l={center:new e,radius:void 0,ellipsoid:o.clone(o.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};return a.unpack=function(t,r,u){var c=n.unpack(t,r,s);return l.center=e.clone(c._center,l.center),l.ellipsoid=o.clone(c._ellipsoid,l.ellipsoid),l.height=c._height,l.extrudedHeight=c._extrudedHeight,l.granularity=c._granularity,l.numberOfVerticalLines=c._numberOfVerticalLines,i(u)?(l.semiMajorAxis=c._semiMajorAxis,l.semiMinorAxis=c._semiMinorAxis,u._ellipseGeometry=new n(l),u):(l.radius=c._semiMajorAxis,new a(l))},a.createGeometry=function(e){return n.createGeometry(e._ellipseGeometry)},a}),i("Core/ClockRange",["./freezeObject"],function(e){"use strict";var t={UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2};return e(t)}),i("Core/ClockStep",["./freezeObject"],function(e){"use strict";var t={TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2};return e(t)}),i("Core/getTimestamp",["./defined"],function(e){"use strict";var t;return t="undefined"!=typeof performance&&e(performance.now)?function(){return performance.now()}:function(){return Date.now()}}),i("Core/Clock",["./ClockRange","./ClockStep","./defaultValue","./defined","./defineProperties","./DeveloperError","./Event","./getTimestamp","./JulianDate"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(n){n=i(n,i.EMPTY_OBJECT);var o=n.currentTime,u=n.startTime,c=n.stopTime;o=r(o)?l.clone(o):r(u)?l.clone(u):r(c)?l.addDays(c,-1,new l):l.now(),u=r(u)?l.clone(u):l.clone(o),c=r(c)?l.clone(c):l.addDays(u,1,new l),this.startTime=u,this.stopTime=c,this.clockRange=i(n.clockRange,e.UNBOUNDED),this.canAnimate=i(n.canAnimate,!0),this.onTick=new a,this._currentTime=void 0,this._multiplier=void 0,this._clockStep=void 0,this._shouldAnimate=void 0,this._lastSystemTime=s(),this.currentTime=o,this.multiplier=i(n.multiplier,1),this.clockStep=i(n.clockStep,t.SYSTEM_CLOCK_MULTIPLIER),this.shouldAnimate=i(n.shouldAnimate,!0)}return n(u.prototype,{currentTime:{get:function(){return this._currentTime},set:function(e){l.equals(this._currentTime,e)||(this._clockStep===t.SYSTEM_CLOCK&&(this._clockStep=t.SYSTEM_CLOCK_MULTIPLIER),this._currentTime=e)}},multiplier:{get:function(){return this._multiplier},set:function(e){this._multiplier!==e&&(this._clockStep===t.SYSTEM_CLOCK&&(this._clockStep=t.SYSTEM_CLOCK_MULTIPLIER),this._multiplier=e)}},clockStep:{get:function(){return this._clockStep},set:function(e){e===t.SYSTEM_CLOCK&&(this._multiplier=1,this._shouldAnimate=!0,this._currentTime=l.now()),this._clockStep=e}},shouldAnimate:{get:function(){return this._shouldAnimate},set:function(e){this._shouldAnimate!==e&&(this._clockStep===t.SYSTEM_CLOCK&&(this._clockStep=t.SYSTEM_CLOCK_MULTIPLIER),this._shouldAnimate=e)}}}),u.prototype.tick=function(){var i=s(),r=l.clone(this._currentTime);if(this.canAnimate&&this._shouldAnimate){var n=this._clockStep;if(n===t.SYSTEM_CLOCK)r=l.now(r);else{var o=this._multiplier;if(n===t.TICK_DEPENDENT)r=l.addSeconds(r,o,r);else{var a=i-this._lastSystemTime;r=l.addSeconds(r,o*(a/1e3),r)}var u=this.clockRange,c=this.startTime,h=this.stopTime;if(u===e.CLAMPED)l.lessThan(r,c)?r=l.clone(c,r):l.greaterThan(r,h)&&(r=l.clone(h,r));else if(u===e.LOOP_STOP)for(l.lessThan(r,c)&&(r=l.clone(c,r));l.greaterThan(r,h);)r=l.addSeconds(c,l.secondsDifference(r,h),r)}}return this._currentTime=r,this._lastSystemTime=i,this.onTick.raiseEvent(this),r},u}),i("Core/Color",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math"],function(e,t,i,r,n,o){"use strict";function a(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),6*i<1?e+6*(t-e)*i:2*i<1?t:3*i<2?e+(t-e)*(2/3-i)*6:e}function s(t,i,r,n){this.red=e(t,1),this.green=e(i,1),this.blue=e(r,1),this.alpha=e(n,1)}s.fromCartesian4=function(e,i){return t(i)?(i.red=e.x,i.green=e.y,i.blue=e.z,i.alpha=e.w,i):new s(e.x,e.y,e.z,e.w)},s.fromBytes=function(i,r,n,o,a){return i=s.byteToFloat(e(i,255)),r=s.byteToFloat(e(r,255)),n=s.byteToFloat(e(n,255)),o=s.byteToFloat(e(o,255)),t(a)?(a.red=i,a.green=r,a.blue=n,a.alpha=o,a):new s(i,r,n,o)},s.fromAlpha=function(e,i,r){return t(r)?(r.red=e.red,r.green=e.green,r.blue=e.blue,r.alpha=i,r):new s(e.red,e.green,e.blue,i)};var l,u,c;r.supportsTypedArrays()&&(l=new ArrayBuffer(4),u=new Uint32Array(l),c=new Uint8Array(l)),s.fromRgba=function(e,t){return u[0]=e,s.fromBytes(c[0],c[1],c[2],c[3],t)},s.fromHsl=function(i,r,n,o,l){i=e(i,0)%1,r=e(r,0),n=e(n,0),o=e(o,1);var u=n,c=n,h=n;if(0!==r){var d;d=n<.5?n*(1+r):n+r-n*r;var p=2*n-d;u=a(p,d,i+1/3),c=a(p,d,i),h=a(p,d,i-1/3)}return t(l)?(l.red=u,l.green=c,l.blue=h,l.alpha=o,l):new s(u,c,h,o)},s.fromRandom=function(i,r){i=e(i,e.EMPTY_OBJECT);var n=i.red;if(!t(n)){var a=e(i.minimumRed,0),l=e(i.maximumRed,1);n=a+o.nextRandomNumber()*(l-a)}var u=i.green;if(!t(u)){var c=e(i.minimumGreen,0),h=e(i.maximumGreen,1);u=c+o.nextRandomNumber()*(h-c)}var d=i.blue;if(!t(d)){var p=e(i.minimumBlue,0),m=e(i.maximumBlue,1);d=p+o.nextRandomNumber()*(m-p)}var f=i.alpha;if(!t(f)){var _=e(i.minimumAlpha,0),g=e(i.maximumAlpha,1);f=_+o.nextRandomNumber()*(g-_)}return t(r)?(r.red=n,r.green=u,r.blue=d,r.alpha=f,r):new s(n,u,d,f)};var h=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i,d=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i,p=/^rgba?\(\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)(?:\s*,\s*([0-9.]+))?\s*\)$/i,m=/^hsla?\(\s*([0-9.]+)\s*,\s*([0-9.]+%)\s*,\s*([0-9.]+%)(?:\s*,\s*([0-9.]+))?\s*\)$/i;return s.fromCssColorString=function(i,r){t(r)||(r=new s);var n=s[i.toUpperCase()];if(t(n))return s.clone(n,r),r;var o=h.exec(i);return null!==o?(r.red=parseInt(o[1],16)/15,r.green=parseInt(o[2],16)/15,r.blue=parseInt(o[3],16)/15,r.alpha=1,r):(o=d.exec(i),null!==o?(r.red=parseInt(o[1],16)/255,r.green=parseInt(o[2],16)/255,r.blue=parseInt(o[3],16)/255,r.alpha=1,r):(o=p.exec(i),null!==o?(r.red=parseFloat(o[1])/("%"===o[1].substr(-1)?100:255),r.green=parseFloat(o[2])/("%"===o[2].substr(-1)?100:255),r.blue=parseFloat(o[3])/("%"===o[3].substr(-1)?100:255),r.alpha=parseFloat(e(o[4],"1.0")),r):(o=m.exec(i),null!==o?s.fromHsl(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,parseFloat(e(o[4],"1.0")),r):r=void 0)))},s.packedLength=4,s.pack=function(t,i,r){return r=e(r,0),i[r++]=t.red,i[r++]=t.green,i[r++]=t.blue,i[r]=t.alpha,i},s.unpack=function(i,r,n){return r=e(r,0),t(n)||(n=new s),n.red=i[r++],n.green=i[r++],n.blue=i[r++],n.alpha=i[r],n},s.byteToFloat=function(e){return e/255},s.floatToByte=function(e){return 1===e?255:256*e|0},s.clone=function(e,i){if(t(e))return t(i)?(i.red=e.red,i.green=e.green,i.blue=e.blue,i.alpha=e.alpha,i):new s(e.red,e.green,e.blue,e.alpha)},s.equals=function(e,i){return e===i||t(e)&&t(i)&&e.red===i.red&&e.green===i.green&&e.blue===i.blue&&e.alpha===i.alpha},s.equalsArray=function(e,t,i){return e.red===t[i]&&e.green===t[i+1]&&e.blue===t[i+2]&&e.alpha===t[i+3]},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,i){return this===e||t(e)&&Math.abs(this.red-e.red)<=i&&Math.abs(this.green-e.green)<=i&&Math.abs(this.blue-e.blue)<=i&&Math.abs(this.alpha-e.alpha)<=i},s.prototype.toString=function(){return"("+this.red+", "+this.green+", "+this.blue+", "+this.alpha+")"},s.prototype.toCssColorString=function(){var e=s.floatToByte(this.red),t=s.floatToByte(this.green),i=s.floatToByte(this.blue);return 1===this.alpha?"rgb("+e+","+t+","+i+")":"rgba("+e+","+t+","+i+","+this.alpha+")"},s.prototype.toBytes=function(e){var i=s.floatToByte(this.red),r=s.floatToByte(this.green),n=s.floatToByte(this.blue),o=s.floatToByte(this.alpha);return t(e)?(e[0]=i,e[1]=r,e[2]=n,e[3]=o,e):[i,r,n,o]},s.prototype.toRgba=function(){return c[0]=s.floatToByte(this.red),c[1]=s.floatToByte(this.green),c[2]=s.floatToByte(this.blue),c[3]=s.floatToByte(this.alpha),u[0]},s.prototype.brighten=function(e,t){return e=1-e,t.red=1-(1-this.red)*e,t.green=1-(1-this.green)*e,t.blue=1-(1-this.blue)*e,t.alpha=this.alpha,t},s.prototype.darken=function(e,t){return e=1-e,t.red=this.red*e,t.green=this.green*e,t.blue=this.blue*e,t.alpha=this.alpha,t},s.prototype.withAlpha=function(e,t){return s.fromAlpha(this,e,t)},s.add=function(e,t,i){return i.red=e.red+t.red,i.green=e.green+t.green,i.blue=e.blue+t.blue,i.alpha=e.alpha+t.alpha,i},s.subtract=function(e,t,i){return i.red=e.red-t.red,i.green=e.green-t.green,i.blue=e.blue-t.blue,i.alpha=e.alpha-t.alpha,i},s.multiply=function(e,t,i){return i.red=e.red*t.red,i.green=e.green*t.green,i.blue=e.blue*t.blue,i.alpha=e.alpha*t.alpha,i},s.divide=function(e,t,i){return i.red=e.red/t.red,i.green=e.green/t.green,i.blue=e.blue/t.blue,i.alpha=e.alpha/t.alpha,i},s.mod=function(e,t,i){return i.red=e.red%t.red,i.green=e.green%t.green,i.blue=e.blue%t.blue,i.alpha=e.alpha%t.alpha,i},s.multiplyByScalar=function(e,t,i){return i.red=e.red*t,i.green=e.green*t,i.blue=e.blue*t,i.alpha=e.alpha*t,i},s.divideByScalar=function(e,t,i){return i.red=e.red/t,i.green=e.green/t,i.blue=e.blue/t,i.alpha=e.alpha/t,i},s.ALICEBLUE=n(s.fromCssColorString("#F0F8FF")),s.ANTIQUEWHITE=n(s.fromCssColorString("#FAEBD7")),s.AQUA=n(s.fromCssColorString("#00FFFF")),s.AQUAMARINE=n(s.fromCssColorString("#7FFFD4")),s.AZURE=n(s.fromCssColorString("#F0FFFF")),s.BEIGE=n(s.fromCssColorString("#F5F5DC")),s.BISQUE=n(s.fromCssColorString("#FFE4C4")),s.BLACK=n(s.fromCssColorString("#000000")),s.BLANCHEDALMOND=n(s.fromCssColorString("#FFEBCD")),s.BLUE=n(s.fromCssColorString("#0000FF")),s.BLUEVIOLET=n(s.fromCssColorString("#8A2BE2")),s.BROWN=n(s.fromCssColorString("#A52A2A")),s.BURLYWOOD=n(s.fromCssColorString("#DEB887")),s.CADETBLUE=n(s.fromCssColorString("#5F9EA0")),s.CHARTREUSE=n(s.fromCssColorString("#7FFF00")),s.CHOCOLATE=n(s.fromCssColorString("#D2691E")),s.CORAL=n(s.fromCssColorString("#FF7F50")),s.CORNFLOWERBLUE=n(s.fromCssColorString("#6495ED")),s.CORNSILK=n(s.fromCssColorString("#FFF8DC")),s.CRIMSON=n(s.fromCssColorString("#DC143C")),s.CYAN=n(s.fromCssColorString("#00FFFF")),s.DARKBLUE=n(s.fromCssColorString("#00008B")),s.DARKCYAN=n(s.fromCssColorString("#008B8B")),s.DARKGOLDENROD=n(s.fromCssColorString("#B8860B")),s.DARKGRAY=n(s.fromCssColorString("#A9A9A9")),s.DARKGREEN=n(s.fromCssColorString("#006400")),s.DARKGREY=s.DARKGRAY,s.DARKKHAKI=n(s.fromCssColorString("#BDB76B")),s.DARKMAGENTA=n(s.fromCssColorString("#8B008B")),s.DARKOLIVEGREEN=n(s.fromCssColorString("#556B2F")),s.DARKORANGE=n(s.fromCssColorString("#FF8C00")),s.DARKORCHID=n(s.fromCssColorString("#9932CC")),s.DARKRED=n(s.fromCssColorString("#8B0000")),s.DARKSALMON=n(s.fromCssColorString("#E9967A")),s.DARKSEAGREEN=n(s.fromCssColorString("#8FBC8F")),s.DARKSLATEBLUE=n(s.fromCssColorString("#483D8B")),s.DARKSLATEGRAY=n(s.fromCssColorString("#2F4F4F")),s.DARKSLATEGREY=s.DARKSLATEGRAY,s.DARKTURQUOISE=n(s.fromCssColorString("#00CED1")),s.DARKVIOLET=n(s.fromCssColorString("#9400D3")),s.DEEPPINK=n(s.fromCssColorString("#FF1493")),s.DEEPSKYBLUE=n(s.fromCssColorString("#00BFFF")),s.DIMGRAY=n(s.fromCssColorString("#696969")),s.DIMGREY=s.DIMGRAY,s.DODGERBLUE=n(s.fromCssColorString("#1E90FF")),s.FIREBRICK=n(s.fromCssColorString("#B22222")),s.FLORALWHITE=n(s.fromCssColorString("#FFFAF0")),s.FORESTGREEN=n(s.fromCssColorString("#228B22")),s.FUSCHIA=n(s.fromCssColorString("#FF00FF")),s.GAINSBORO=n(s.fromCssColorString("#DCDCDC")),s.GHOSTWHITE=n(s.fromCssColorString("#F8F8FF")),s.GOLD=n(s.fromCssColorString("#FFD700")),s.GOLDENROD=n(s.fromCssColorString("#DAA520")),s.GRAY=n(s.fromCssColorString("#808080")),s.GREEN=n(s.fromCssColorString("#008000")),s.GREENYELLOW=n(s.fromCssColorString("#ADFF2F")),s.GREY=s.GRAY,s.HONEYDEW=n(s.fromCssColorString("#F0FFF0")),s.HOTPINK=n(s.fromCssColorString("#FF69B4")),s.INDIANRED=n(s.fromCssColorString("#CD5C5C")),s.INDIGO=n(s.fromCssColorString("#4B0082")),s.IVORY=n(s.fromCssColorString("#FFFFF0")),s.KHAKI=n(s.fromCssColorString("#F0E68C")),s.LAVENDER=n(s.fromCssColorString("#E6E6FA")),s.LAVENDAR_BLUSH=n(s.fromCssColorString("#FFF0F5")),s.LAWNGREEN=n(s.fromCssColorString("#7CFC00")),s.LEMONCHIFFON=n(s.fromCssColorString("#FFFACD")),s.LIGHTBLUE=n(s.fromCssColorString("#ADD8E6")),s.LIGHTCORAL=n(s.fromCssColorString("#F08080")),s.LIGHTCYAN=n(s.fromCssColorString("#E0FFFF")),s.LIGHTGOLDENRODYELLOW=n(s.fromCssColorString("#FAFAD2")),s.LIGHTGRAY=n(s.fromCssColorString("#D3D3D3")),s.LIGHTGREEN=n(s.fromCssColorString("#90EE90")),s.LIGHTGREY=s.LIGHTGRAY,s.LIGHTPINK=n(s.fromCssColorString("#FFB6C1")),s.LIGHTSEAGREEN=n(s.fromCssColorString("#20B2AA")),s.LIGHTSKYBLUE=n(s.fromCssColorString("#87CEFA")),s.LIGHTSLATEGRAY=n(s.fromCssColorString("#778899")),s.LIGHTSLATEGREY=s.LIGHTSLATEGRAY,s.LIGHTSTEELBLUE=n(s.fromCssColorString("#B0C4DE")),s.LIGHTYELLOW=n(s.fromCssColorString("#FFFFE0")),s.LIME=n(s.fromCssColorString("#00FF00")),s.LIMEGREEN=n(s.fromCssColorString("#32CD32")),s.LINEN=n(s.fromCssColorString("#FAF0E6")),s.MAGENTA=n(s.fromCssColorString("#FF00FF")),s.MAROON=n(s.fromCssColorString("#800000")),s.MEDIUMAQUAMARINE=n(s.fromCssColorString("#66CDAA")),s.MEDIUMBLUE=n(s.fromCssColorString("#0000CD")),s.MEDIUMORCHID=n(s.fromCssColorString("#BA55D3")),s.MEDIUMPURPLE=n(s.fromCssColorString("#9370DB")),s.MEDIUMSEAGREEN=n(s.fromCssColorString("#3CB371")),s.MEDIUMSLATEBLUE=n(s.fromCssColorString("#7B68EE")),s.MEDIUMSPRINGGREEN=n(s.fromCssColorString("#00FA9A")),s.MEDIUMTURQUOISE=n(s.fromCssColorString("#48D1CC")),s.MEDIUMVIOLETRED=n(s.fromCssColorString("#C71585")),s.MIDNIGHTBLUE=n(s.fromCssColorString("#191970")),s.MINTCREAM=n(s.fromCssColorString("#F5FFFA")),s.MISTYROSE=n(s.fromCssColorString("#FFE4E1")),s.MOCCASIN=n(s.fromCssColorString("#FFE4B5")),s.NAVAJOWHITE=n(s.fromCssColorString("#FFDEAD")),s.NAVY=n(s.fromCssColorString("#000080")),s.OLDLACE=n(s.fromCssColorString("#FDF5E6")),s.OLIVE=n(s.fromCssColorString("#808000")),s.OLIVEDRAB=n(s.fromCssColorString("#6B8E23")),s.ORANGE=n(s.fromCssColorString("#FFA500")),s.ORANGERED=n(s.fromCssColorString("#FF4500")),s.ORCHID=n(s.fromCssColorString("#DA70D6")),s.PALEGOLDENROD=n(s.fromCssColorString("#EEE8AA")),s.PALEGREEN=n(s.fromCssColorString("#98FB98")),s.PALETURQUOISE=n(s.fromCssColorString("#AFEEEE")),s.PALEVIOLETRED=n(s.fromCssColorString("#DB7093")),s.PAPAYAWHIP=n(s.fromCssColorString("#FFEFD5")),s.PEACHPUFF=n(s.fromCssColorString("#FFDAB9")),s.PERU=n(s.fromCssColorString("#CD853F")),s.PINK=n(s.fromCssColorString("#FFC0CB")),s.PLUM=n(s.fromCssColorString("#DDA0DD")),s.POWDERBLUE=n(s.fromCssColorString("#B0E0E6")),s.PURPLE=n(s.fromCssColorString("#800080")),s.RED=n(s.fromCssColorString("#FF0000")),s.ROSYBROWN=n(s.fromCssColorString("#BC8F8F")),s.ROYALBLUE=n(s.fromCssColorString("#4169E1")),s.SADDLEBROWN=n(s.fromCssColorString("#8B4513")),s.SALMON=n(s.fromCssColorString("#FA8072")),s.SANDYBROWN=n(s.fromCssColorString("#F4A460")),s.SEAGREEN=n(s.fromCssColorString("#2E8B57")),s.SEASHELL=n(s.fromCssColorString("#FFF5EE")),s.SIENNA=n(s.fromCssColorString("#A0522D")),s.SILVER=n(s.fromCssColorString("#C0C0C0")),s.SKYBLUE=n(s.fromCssColorString("#87CEEB")),s.SLATEBLUE=n(s.fromCssColorString("#6A5ACD")),s.SLATEGRAY=n(s.fromCssColorString("#708090")),s.SLATEGREY=s.SLATEGRAY,s.SNOW=n(s.fromCssColorString("#FFFAFA")),s.SPRINGGREEN=n(s.fromCssColorString("#00FF7F")),s.STEELBLUE=n(s.fromCssColorString("#4682B4")),s.TAN=n(s.fromCssColorString("#D2B48C")),s.TEAL=n(s.fromCssColorString("#008080")),s.THISTLE=n(s.fromCssColorString("#D8BFD8")),s.TOMATO=n(s.fromCssColorString("#FF6347")),s.TURQUOISE=n(s.fromCssColorString("#40E0D0")),s.VIOLET=n(s.fromCssColorString("#EE82EE")),s.WHEAT=n(s.fromCssColorString("#F5DEB3")),s.WHITE=n(s.fromCssColorString("#FFFFFF")),s.WHITESMOKE=n(s.fromCssColorString("#F5F5F5")),s.YELLOW=n(s.fromCssColorString("#FFFF00")),s.YELLOWGREEN=n(s.fromCssColorString("#9ACD32")),s.TRANSPARENT=n(new s(0,0,0,0)),s}),i("Core/ColorGeometryInstanceAttribute",["./Color","./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError"],function(e,t,i,r,n,o){"use strict";function a(t,r,n,o){t=i(t,1),r=i(r,1),n=i(n,1),o=i(o,1),this.value=new Uint8Array([e.floatToByte(t),e.floatToByte(r),e.floatToByte(n),e.floatToByte(o)])}return n(a.prototype,{componentDatatype:{get:function(){return t.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}}),a.fromColor=function(e){return new a(e.red,e.green,e.blue,e.alpha)},a.toValue=function(e,t){return r(t)?e.toBytes(t):new Uint8Array(e.toBytes())},a.equals=function(e,t){return e===t||r(e)&&r(t)&&e.value[0]===t.value[0]&&e.value[1]===t.value[1]&&e.value[2]===t.value[2]&&e.value[3]===t.value[3]},a}),i("Core/combine",["./defaultValue","./defined"],function(e,t){"use strict";function i(r,n,o){o=e(o,!1);var a,s,l,u={},c=t(r),h=t(n);if(c)for(a in r)r.hasOwnProperty(a)&&(s=r[a],h&&o&&"object"==typeof s&&n.hasOwnProperty(a)?(l=n[a],"object"==typeof l?u[a]=i(s,l,o):u[a]=s):u[a]=s);if(h)for(a in n)n.hasOwnProperty(a)&&!u.hasOwnProperty(a)&&(l=n[a],u[a]=l);return u}return i}),i("Core/CornerType",["./freezeObject"],function(e){"use strict";var t={ROUNDED:0,MITERED:1,BEVELED:2};return e(t)}),i("Core/EllipsoidGeodesic",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){var t=e._uSquared,i=e._ellipsoid.maximumRadius,r=e._ellipsoid.minimumRadius,n=(i-r)/i,o=Math.cos(e._startHeading),a=Math.sin(e._startHeading),s=(1-n)*Math.tan(e._start.latitude),l=1/Math.sqrt(1+s*s),u=l*s,c=Math.atan2(s,o),h=l*a,d=h*h,p=1-d,m=Math.sqrt(p),f=t/4,_=f*f,g=_*f,v=_*_,y=1+f-3*_/4+5*g/4-175*v/64,C=1-f+15*_/8-35*g/8,w=1-3*f+35*_/4,S=1-5*f,E=y*c-C*Math.sin(2*c)*f/2-w*Math.sin(4*c)*_/16-S*Math.sin(6*c)*g/48-5*Math.sin(8*c)*v/512,b=e._constants;b.a=i,b.b=r,b.f=n,b.cosineHeading=o,b.sineHeading=a,b.tanU=s,b.cosineU=l,b.sineU=u,b.sigma=c,b.sineAlpha=h,b.sineSquaredAlpha=d,b.cosineSquaredAlpha=p,b.cosineAlpha=m,b.u2Over4=f,b.u4Over16=_,b.u6Over64=g,b.u8Over256=v,b.a0=y,b.a1=C,b.a2=w,b.a3=S,b.distanceRatio=E}function u(e,t){return e*t*(4+e*(4-3*t))/16}function c(e,t,i,r,n,o,a){var s=u(e,i);return(1-s)*e*t*(r+s*n*(a+s*o*(2*a*a-1)))}function h(e,t,i,r,n,o,a){var l,u,h,d,p,m=(t-i)/t,f=o-r,_=Math.atan((1-m)*Math.tan(n)),g=Math.atan((1-m)*Math.tan(a)),v=Math.cos(_),y=Math.sin(_),C=Math.cos(g),w=Math.sin(g),S=v*C,E=v*w,b=y*w,T=y*C,x=f,A=s.TWO_PI,P=Math.cos(x),D=Math.sin(x);do{P=Math.cos(x),D=Math.sin(x);var M=E-T*P;h=Math.sqrt(C*C*D*D+M*M),u=b+S*P,l=Math.atan2(h,u);var I;0===h?(I=0,d=1):(I=S*D/h,d=1-I*I),A=x,p=u-2*b/d,isNaN(p)&&(p=0),x=f+c(m,I,d,l,h,u,p)}while(Math.abs(x-A)>s.EPSILON12);var R=d*(t*t-i*i)/(i*i),O=1+R*(4096+R*(R*(320-175*R)-768))/16384,N=R*(256+R*(R*(74-47*R)-128))/1024,L=p*p,B=N*h*(p+N*(u*(2*L-1)-N*p*(4*h*h-3)*(4*L-3)/6)/4),F=i*O*(l-B),V=Math.atan2(C*D,E-T*P),k=Math.atan2(v*D,E*P-T);e._distance=F,e._startHeading=V,e._endHeading=k,e._uSquared=R}function d(i,r,n,o){e.normalize(o.cartographicToCartesian(r,f),m),e.normalize(o.cartographicToCartesian(n,f),f);h(i,o.maximumRadius,o.minimumRadius,r.longitude,r.latitude,n.longitude,n.latitude),i._start=t.clone(r,i._start),i._end=t.clone(n,i._end),i._start.height=0,i._end.height=0,l(i)}function p(e,n,o){var s=i(o,a.WGS84);this._ellipsoid=s,this._start=new t,this._end=new t,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,r(e)&&r(n)&&d(this,e,n,s)}var m=new e,f=new e;return n(p.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return this._startHeading}},endHeading:{get:function(){return this._endHeading}}}),p.prototype.setEndPoints=function(e,t){d(this,e,t,this._ellipsoid)},p.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},p.prototype.interpolateUsingSurfaceDistance=function(e,i){var n=this._constants,o=n.distanceRatio+e/n.b,a=Math.cos(2*o),s=Math.cos(4*o),l=Math.cos(6*o),u=Math.sin(2*o),h=Math.sin(4*o),d=Math.sin(6*o),p=Math.sin(8*o),m=o*o,f=o*m,_=n.u8Over256,g=n.u2Over4,v=n.u6Over64,y=n.u4Over16,C=2*f*_*a/3+o*(1-g+7*y/4-15*v/4+579*_/64-(y-15*v/4+187*_/16)*a-(5*v/4-115*_/16)*s-29*_*l/16)+(g/2-y+71*v/32-85*_/16)*u+(5*y/16-5*v/4+383*_/96)*h-m*((v-11*_/2)*u+5*_*h/2)+(29*v/96-29*_/16)*d+539*_*p/1536,w=Math.asin(Math.sin(C)*n.cosineAlpha),S=Math.atan(n.a/n.b*Math.tan(w));C-=n.sigma;var E=Math.cos(2*n.sigma+C),b=Math.sin(C),T=Math.cos(C),x=n.cosineU*T,A=n.sineU*b,P=Math.atan2(b*n.sineHeading,x-A*n.cosineHeading),D=P-c(n.f,n.sineAlpha,n.cosineSquaredAlpha,C,b,T,E);return r(i)?(i.longitude=this._start.longitude+D,i.latitude=S,i.height=0,i):new t(this._start.longitude+D,S,0)},p}),i("Core/PolylinePipeline",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidGeodesic","./IntersectionTests","./isArray","./Math","./Matrix4","./Plane"],function(e,t,i,r,n,o,a,s,l,u,c,h){"use strict";function d(e,t,i){var r=b;r.length=e;var n;if(t===i){for(n=0;n0){n=i(n,c.IDENTITY);var l=c.inverseTransformation(n,_),u=c.multiplyByPoint(l,e.ZERO,g),d=c.multiplyByPointAsVector(l,e.UNIT_Y,v),p=h.fromPointNormal(u,d,y),m=c.multiplyByPointAsVector(l,e.UNIT_X,C),f=h.fromPointNormal(u,m,w),b=1;o.push(e.clone(t[0]));for(var T=o[0],x=t.length,A=1;A=0?-c:c}function f(e,i,r,n,o,a,u,c){var d=k,p=z;L=h.eastNorthUpToFixedFrame(e,o,L),d=l.multiplyByPointAsVector(L,N,d),d=t.normalize(d,d);var f=m(d,i,e,o);F=s.fromRotationZ(f,F),U.z=a,L=l.multiplyTransformation(L,l.fromRotationTranslation(F,U,B),L);var _=V;_[0]=u;for(var g=0;g0)for(var w=m?2:1,S=0;S=0};var X=new t,Z=new t;return R.computePositions=function(e,i,r,o,s){var l=o._ellipsoid,c=d(e,l),h=o._granularity,m=o._cornerType,I=s?g(i,r):v(i,r),O=s?v(i,r):void 0,N=r.height/2,L=r.width/2,B=e.length,F=[],V=s?[]:void 0,k=w,z=S,U=E,G=b,W=T,H=x,q=A,j=P,Y=D,K=e[0],Q=e[1];G=l.geodeticSurfaceNormal(K,G),k=t.subtract(Q,K,k),k=t.normalize(k,k),j=t.cross(G,k,j),j=t.normalize(j,j);var J=c[0],$=c[1];s&&(V=f(K,j,O,V,l,J+N,1,1)),Y=t.clone(K,Y),K=Q,z=t.negate(k,z);for(var ee,te,ie=1;ie80*n){c=d=e[0],h=p=e[1];for(var g=n;gd&&(d=m),f>p&&(p=f);_=Math.max(d-c,p-h)}return r(s,u,n,c,h,_),u}function t(e,t,i,r,n){var o,a;if(n===P(e,t,i,r)>0)for(o=t;o=t;o-=r)a=T(o,e[o],e[o+1],a);return a&&y(a,a.next)&&(x(a),a=a.next),a}function i(e,t){if(!e)return e;t||(t=e);var i,r=e;do if(i=!1,r.steiner||!y(r,r.next)&&0!==v(r.prev,r,r.next))r=r.next;else{if(x(r),r=t=r.prev,r===r.next)return null;i=!0}while(i||r!==t);return t}function r(e,t,l,u,c,h,p){if(e){!p&&h&&d(e,u,c,h);for(var m,f,_=e;e.prev!==e.next;)if(m=e.prev,f=e.next,h?o(e,u,c,h):n(e))t.push(m.i/l),t.push(e.i/l),t.push(f.i/l),x(e),e=f.next,_=f.next;else if(e=f,e===_){p?1===p?(e=a(e,t,l),r(e,t,l,u,c,h,2)):2===p&&s(e,t,l,u,c,h):r(i(e),t,l,u,c,h,1);break}}}function n(e){var t=e.prev,i=e,r=e.next;if(v(t,i,r)>=0)return!1;for(var n=e.next.next;n!==e.prev;){if(_(t.x,t.y,i.x,i.y,r.x,r.y,n.x,n.y)&&v(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function o(e,t,i,r){var n=e.prev,o=e,a=e.next;if(v(n,o,a)>=0)return!1;for(var s=n.xo.x?n.x>a.x?n.x:a.x:o.x>a.x?o.x:a.x,c=n.y>o.y?n.y>a.y?n.y:a.y:o.y>a.y?o.y:a.y,h=m(s,l,t,i,r),d=m(u,c,t,i,r),p=e.nextZ;p&&p.z<=d;){if(p!==e.prev&&p!==e.next&&_(n.x,n.y,o.x,o.y,a.x,a.y,p.x,p.y)&&v(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(p=e.prevZ;p&&p.z>=h;){if(p!==e.prev&&p!==e.next&&_(n.x,n.y,o.x,o.y,a.x,a.y,p.x,p.y)&&v(p.prev,p,p.next)>=0)return!1;p=p.prevZ}return!0}function a(e,t,i){var r=e;do{var n=r.prev,o=r.next.next;!y(n,o)&&C(n,r,r.next,o)&&S(n,o)&&S(o,n)&&(t.push(n.i/i),t.push(r.i/i),t.push(o.i/i),x(r),x(r.next),r=e=o),r=r.next}while(r!==e);return r}function s(e,t,n,o,a,s){var l=e;do{for(var u=l.next.next;u!==l.prev;){if(l.i!==u.i&&g(l,u)){var c=b(l,u);return l=i(l,l.next),c=i(c,c.next),r(l,t,n,o,a,s),void r(c,t,n,o,a,s)}u=u.next}l=l.next}while(l!==e)}function l(e,r,n,o){var a,s,l,h,d,p=[];for(a=0,s=r.length;a=r.next.y){var s=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=n&&s>a){if(a=s,s===n){if(o===r.y)return r;if(o===r.next.y)return r.next}i=r.x=r.x&&r.x>=c&&_(oi.x)&&S(r,e)&&(i=r,d=l)),r=r.next;return i}function d(e,t,i,r){var n=e;do null===n.z&&(n.z=m(n.x,n.y,t,i,r)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next;while(n!==e);n.prevZ.nextZ=null,n.prevZ=null,p(n)}function p(e){var t,i,r,n,o,a,s,l,u=1;do{for(i=e,e=null,o=null,a=0;i;){for(a++,r=i,s=0,t=0;t0||l>0&&r;)0===s?(n=r,r=r.nextZ,l--):0!==l&&r?i.z<=r.z?(n=i,i=i.nextZ,s--):(n=r,r=r.nextZ,l--):(n=i,i=i.nextZ,s--),o?o.nextZ=n:e=n,n.prevZ=o,o=n;i=r}o.nextZ=null,u*=2}while(a>1);return e}function m(e,t,i,r,n){return e=32767*(e-i)/n,t=32767*(t-r)/n,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function f(e){var t=e,i=e;do t.x=0&&(e-a)*(r-s)-(i-a)*(t-s)>=0&&(i-a)*(o-s)-(n-a)*(r-s)>=0}function g(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!w(e,t)&&S(e,t)&&S(t,e)&&E(e,t)}function v(e,t,i){return(t.y-e.y)*(i.x-t.x)-(t.x-e.x)*(i.y-t.y)}function y(e,t){return e.x===t.x&&e.y===t.y}function C(e,t,i,r){return!!(y(e,t)&&y(i,r)||y(e,r)&&y(i,t))||v(e,t,i)>0!=v(e,t,r)>0&&v(i,r,e)>0!=v(i,r,t)>0}function w(e,t){var i=e;do{if(i.i!==e.i&&i.next.i!==e.i&&i.i!==t.i&&i.next.i!==t.i&&C(i,i.next,e,t))return!0;i=i.next}while(i!==e);return!1}function S(e,t){return v(e.prev,e,e.next)<0?v(e,t,e.next)>=0&&v(e,e.prev,t)>=0:v(e,t,e.prev)<0||v(e,e.next,t)<0}function E(e,t){var i=e,r=!1,n=(e.x+t.x)/2,o=(e.y+t.y)/2;do i.y>o!=i.next.y>o&&n<(i.next.x-i.x)*(o-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next;while(i!==e);return r}function b(e,t){var i=new A(e.i,e.x,e.y),r=new A(t.i,t.x,t.y),n=e.next,o=t.prev;return e.next=t,t.prev=e,i.next=n,n.prev=i,r.next=i,i.prev=r,o.next=r,r.prev=o,r}function T(e,t,i,r){var n=new A(e,t,i);return r?(n.next=r.next,n.prev=r,r.next.prev=n,r.next=n):(n.prev=n,n.next=n),n}function x(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function A(e,t,i){this.i=e,this.x=t,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function P(e,t,i,r){for(var n=0,o=t,a=i-r;o0&&(r+=e[n-1].length,i.holes.push(r))}return i},e}),i("Core/WindingOrder",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var i={CLOCKWISE:t.CW,COUNTER_CLOCKWISE:t.CCW,validate:function(e){return e===i.CLOCKWISE||e===i.COUNTER_CLOCKWISE}};return e(i)}),i("Core/PolygonPipeline",["../ThirdParty/earcut-2.1.1","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./Math","./PrimitiveType","./WindingOrder"],function(e,t,i,r,n,o,a,s,l,u,c,h,d){"use strict";var p=new i,m=new i,f={};f.computeArea2D=function(e){for(var t=e.length,i=0,r=t-1,n=0;n0?d.COUNTER_CLOCKWISE:d.CLOCKWISE},f.triangulate=function(i,r){var n=t.packArray(i);return e(n,r,2)};var _=new i,g=new i,v=new i,y=new i,C=new i,w=new i,S=new i;return f.computeSubdivision=function(e,t,a,s){s=n(s,c.RADIANS_PER_DEGREE);var d,p=a.slice(0),m=t.length,f=new Array(3*m),E=0;for(d=0;d0;){var M,I,R=p.pop(),O=p.pop(),N=p.pop(),L=i.fromArray(f,3*N,_),B=i.fromArray(f,3*O,g),F=i.fromArray(f,3*R,v),V=i.multiplyByScalar(i.normalize(L,y),A,y),k=i.multiplyByScalar(i.normalize(B,C),A,C),z=i.multiplyByScalar(i.normalize(F,w),A,w),U=i.magnitudeSquared(i.subtract(V,k,S)),G=i.magnitudeSquared(i.subtract(k,z,S)),W=i.magnitudeSquared(i.subtract(z,V,S)),H=Math.max(U,G,W);H>D?U===H?(M=Math.min(N,O)+" "+Math.max(N,O),d=x[M],o(d)||(I=i.add(L,B,S),i.multiplyByScalar(I,.5,I),f.push(I.x,I.y,I.z),d=f.length/3-1,x[M]=d),p.push(N,d,R),p.push(d,O,R)):G===H?(M=Math.min(O,R)+" "+Math.max(O,R),d=x[M],o(d)||(I=i.add(B,F,S),i.multiplyByScalar(I,.5,I),f.push(I.x,I.y,I.z),d=f.length/3-1,x[M]=d),p.push(O,d,N),p.push(d,R,N)):W===H&&(M=Math.min(R,N)+" "+Math.max(R,N),d=x[M],o(d)||(I=i.add(F,L,S),i.multiplyByScalar(I,.5,I),f.push(I.x,I.y,I.z),d=f.length/3-1,x[M]=d),p.push(R,d,O),p.push(d,N,O)):(T.push(N),T.push(O),T.push(R))}return new l({attributes:{position:new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:f})},indices:T,primitiveType:h.TRIANGLES})},f.scaleToGeodeticHeight=function(e,t,r,a){r=n(r,s.WGS84);var l=p,u=m;if(t=n(t,0),a=n(a,!0),o(e))for(var c=e.length,h=0;hwe;s--)Ce=_.PI_OVER_TWO-s*ye,ge[ve++]=1-fe*(1+Math.cos(Ce)),ge[ve++]=.5*(1+Math.sin(Ce));for(s=we;s>0;s--)Ce=_.PI_OVER_TWO-ye*s,ge[ve++]=1-_e*(1+Math.cos(Ce)),ge[ve++]=.5*(1+Math.sin(Ce));for(s=C-T;s>0;s--)ge[ve++]=s*_e,ge[ve++]=1;for(s=1;s0;s--)ge[ve++]=(s-1)*_e,ge[ve++]=1}y.st=new p({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:ge})}return t.normal&&(y.normal=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:q.normals})),t.tangent&&(y.tangent=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:q.tangents})),t.binormal&&(y.binormal=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:q.binormals})),{attributes:y,indices:Q}}function E(e,t){if(!(t.normal||t.binormal||t.tangent||t.st))return e;var r,n,o=e.position.values;(t.normal||t.binormal)&&(r=e.normal.values,n=e.binormal.values);var s,l=e.position.values.length/18,u=3*l,c=2*l,h=2*u;if(t.normal||t.binormal||t.tangent){var d=t.normal?new Float32Array(6*u):void 0,p=t.binormal?new Float32Array(6*u):void 0,m=t.tangent?new Float32Array(6*u):void 0,f=D,_=M,g=I,v=R,y=O,C=N,w=h;for(s=0;s0){var w=Math.min(_,f);g=Math.round(f/w),C+=w}for(var S=h.createTypedArray(v,2*C),E=0,b=0;b0)for(b=0;b1?1:u;var C=p(u);for(t in n){var w=r[t]||0,S=n[t];S instanceof Array?i[t]=m(S,C):("string"==typeof S&&(S=w+parseFloat(S,10)),"number"==typeof S&&(i[t]=w+(S-w)*C))}if(null!==v&&v.call(i,C),1==u){if(s>0){isFinite(s)&&s--;for(t in o){if("string"==typeof n[t]&&(o[t]=o[t]+parseFloat(n[t],10)),l){var E=o[t];o[t]=n[t],n[t]=E}r[t]=o[t]}return l&&(c=!c),d=e+h,!0}null!==y&&y.call(i);for(var b=0,T=f.length;b1?a(t[r],t[r-1],r-n):a(t[o],t[o+1>r?r:o+1],n-o)},Bezier:function(t,i){var r,n=0,o=t.length-1,a=Math.pow,s=e.Interpolation.Utils.Bernstein;for(r=0;r<=o;r++)n+=a(1-i,o-r)*a(i,r)*t[r]*s(o,r);return n},CatmullRom:function(t,i){var r=t.length-1,n=r*i,o=Math.floor(n),a=e.Interpolation.Utils.CatmullRom;return t[0]===t[r]?(i<0&&(o=Math.floor(n=r*(1+i))),a(t[(o-1+r)%r],t[o],t[(o+1)%r],t[(o+2)%r],n-o)):i<0?t[0]-(a(t[0],t[0],t[1],t[1],-n)-t[0]):i>1?t[r]-(a(t[r],t[r],t[r-1],t[r-1],n-r)-t[r]):a(t[o?o-1:0],t[o],t[r1;i--)r*=i;return e[t]=r}}(),CatmullRom:function(e,t,i,r,n){var o=.5*(i-e),a=.5*(r-t),s=n*n,l=n*s;return(2*t-2*i+o+a)*l+(-3*t+3*i-2*o-a)*s+o*n+t}}},e}),i("Core/EasingFunction",["../ThirdParty/Tween","./freezeObject"],function(e,t){"use strict";var i={LINEAR_NONE:e.Easing.Linear.None,QUADRACTIC_IN:e.Easing.Quadratic.In,QUADRACTIC_OUT:e.Easing.Quadratic.Out,QUADRACTIC_IN_OUT:e.Easing.Quadratic.InOut,CUBIC_IN:e.Easing.Cubic.In,CUBIC_OUT:e.Easing.Cubic.Out,CUBIC_IN_OUT:e.Easing.Cubic.InOut,QUARTIC_IN:e.Easing.Quartic.In,QUARTIC_OUT:e.Easing.Quartic.Out,QUARTIC_IN_OUT:e.Easing.Quartic.InOut,QUINTIC_IN:e.Easing.Quintic.In,QUINTIC_OUT:e.Easing.Quintic.Out,QUINTIC_IN_OUT:e.Easing.Quintic.InOut,SINUSOIDAL_IN:e.Easing.Sinusoidal.In,SINUSOIDAL_OUT:e.Easing.Sinusoidal.Out,SINUSOIDAL_IN_OUT:e.Easing.Sinusoidal.InOut,EXPONENTIAL_IN:e.Easing.Exponential.In,EXPONENTIAL_OUT:e.Easing.Exponential.Out,EXPONENTIAL_IN_OUT:e.Easing.Exponential.InOut,CIRCULAR_IN:e.Easing.Circular.In,CIRCULAR_OUT:e.Easing.Circular.Out,CIRCULAR_IN_OUT:e.Easing.Circular.InOut,ELASTIC_IN:e.Easing.Elastic.In,ELASTIC_OUT:e.Easing.Elastic.Out,ELASTIC_IN_OUT:e.Easing.Elastic.InOut,BACK_IN:e.Easing.Back.In,BACK_OUT:e.Easing.Back.Out,BACK_IN_OUT:e.Easing.Back.InOut,BOUNCE_IN:e.Easing.Bounce.In,BOUNCE_OUT:e.Easing.Bounce.Out,BOUNCE_IN_OUT:e.Easing.Bounce.InOut};return t(i)}),i("Core/EllipsoidGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./VertexFormat"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m){"use strict";function f(e){e=n(e,n.EMPTY_OBJECT);var t=n(e.radii,w),r=n(e.stackPartitions,64),o=n(e.slicePartitions,64),a=n(e.vertexFormat,m.DEFAULT);this._radii=i.clone(t),this._stackPartitions=r,this._slicePartitions=o,this._vertexFormat=m.clone(a),this._workerName="createEllipsoidGeometry"}var _=new i,g=new i,v=new i,y=new i,C=new i,w=new i(1,1,1),S=Math.cos,E=Math.sin;f.packedLength=i.packedLength+m.packedLength+2,f.pack=function(e,t,r){return r=n(r,0),i.pack(e._radii,t,r),r+=i.packedLength,m.pack(e._vertexFormat,t,r),r+=m.packedLength,t[r++]=e._stackPartitions,t[r]=e._slicePartitions,t};var b=new i,T=new m,x={radii:b,vertexFormat:T,stackPartitions:void 0,slicePartitions:void 0};return f.unpack=function(e,t,r){t=n(t,0);var a=i.unpack(e,t,b);t+=i.packedLength;var s=m.unpack(e,t,T);t+=m.packedLength;var l=e[t++],u=e[t];return o(r)?(r._radii=i.clone(a,r._radii),r._vertexFormat=m.clone(s,r._vertexFormat),r._stackPartitions=l,r._slicePartitions=u,r):(x.stackPartitions=l,x.slicePartitions=u,new f(x))},f.createGeometry=function(n){var o=n._radii;if(!(o.x<=0||o.y<=0||o.z<=0)){var a,m,f=s.fromCartesian3(o),w=n._vertexFormat,b=n._slicePartitions+1,T=n._stackPartitions+1,x=T*b,A=new Float64Array(3*x),P=6*(b-1)*(T-2),D=h.createTypedArray(x,P),M=w.normal?new Float32Array(3*x):void 0,I=w.tangent?new Float32Array(3*x):void 0,R=w.binormal?new Float32Array(3*x):void 0,O=w.st?new Float32Array(2*x):void 0,N=new Array(b),L=new Array(b),B=0;for(a=0;aA.length&&(B=3*(a-b*Math.floor(.5*T))),i.fromArray(A,B,K),f.geodeticSurfaceNormal(K,K),t.negate(K,K)),O[H++]=Math.atan2(K.y,K.x)/d.TWO_PI+.5,O[H++]=Math.asin(Z.z)/Math.PI+.5}if(w.normal&&(M[q++]=Z.x,M[q++]=Z.y,M[q++]=Z.z),w.tangent||w.binormal){var Q=v;if(ax-b-1?(i.cross(i.UNIT_X,Z,Q),i.normalize(Q,Q)):(i.cross(i.UNIT_Z,Z,Q),i.normalize(Q,Q)),w.tangent&&(I[j++]=Q.x,I[j++]=Q.y,I[j++]=Q.z),w.binormal){var J=i.cross(Z,Q,y);i.normalize(J,J),R[Y++]=J.x,R[Y++]=J.y,R[Y++]=J.z}}}w.st&&(W.st=new u({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:O})),w.normal&&(W.normal=new u({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:M})),w.tangent&&(W.tangent=new u({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:I})),w.binormal&&(W.binormal=new u({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:R}))}for(B=0,m=0;mN-w-1;--o)x[A++]=N,x[A++]=o;var L=new u({position:new l({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:T})});return new s({attributes:L,indices:x,primitiveType:d.LINES,boundingSphere:e.fromEllipsoid(y)})}},p}),i("Core/EllipsoidTerrainProvider",["../ThirdParty/when","./defaultValue","./defined","./defineProperties","./Ellipsoid","./Event","./GeographicTilingScheme","./HeightmapTerrainData","./TerrainProvider"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(r){r=t(r,{}),this._tilingScheme=r.tilingScheme,i(this._tilingScheme)||(this._tilingScheme=new a({ellipsoid:t(r.ellipsoid,n.WGS84)})),this._levelZeroMaximumGeometricError=l.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new o,this._readyPromise=e.resolve(!0)}return r(u.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return!0}},readyPromise:{get:function(){return this._readyPromise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}}}),u.prototype.requestTileGeometry=function(e,t,i,r){var n=16,o=16;return new s({buffer:new Uint8Array(n*o),width:n,height:o})},u.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<0){for(l=0;l=h||t(f,_,i)<=0)?(e[m]=f,++l):u=a)){var s=Math.floor(.5*(o+a));r(e,t,n,o,s),r(e,t,n,s+1,a),i(e,t,n,o,s,a)}}function n(e,t,i){var n=e.length,s=Math.ceil(.5*n);o.length=s,a.length=s,r(e,t,i,0,n-1),o.length=0,a.length=0}var o=[],a=[];return n}),i("Core/NearFarScalar",["./defaultValue","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(t,i,r,n){this.near=e(t,0),this.nearValue=e(i,0),this.far=e(r,1),this.farValue=e(n,0)}return r.clone=function(e,i){if(t(e))return t(i)?(i.near=e.near,i.nearValue=e.nearValue,i.far=e.far,i.farValue=e.farValue,i):new r(e.near,e.nearValue,e.far,e.farValue)},r.packedLength=4,r.pack=function(t,i,r){return r=e(r,0),i[r++]=t.near,i[r++]=t.nearValue,i[r++]=t.far,i[r]=t.farValue,i},r.unpack=function(i,n,o){return n=e(n,0),t(o)||(o=new r),o.near=i[n++],o.nearValue=i[n++],o.far=i[n++],o.farValue=i[n],o},r.equals=function(e,i){return e===i||t(e)&&t(i)&&e.near===i.near&&e.nearValue===i.nearValue&&e.far===i.far&&e.farValue===i.farValue},r.prototype.clone=function(e){return r.clone(this,e)},r.prototype.equals=function(e){return r.equals(this,e)},r}),i("Core/Visibility",["./freezeObject"],function(e){"use strict";var t={NONE:-1,PARTIAL:0,FULL:1};return e(t)}),i("Core/Occluder",["./BoundingSphere","./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math","./Rectangle","./Visibility"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e,i){this._occluderPosition=t.clone(e.center),this._occluderRadius=e.radius,this._horizonDistance=0,this._horizonPlaneNormal=void 0,this._horizonPlanePosition=void 0,this._cameraPosition=void 0,this.cameraPosition=i}var h=new t;n(c.prototype,{position:{get:function(){return this._occluderPosition}},radius:{get:function(){return this._occluderRadius}},cameraPosition:{set:function(e){e=t.clone(e,this._cameraPosition);var i,r,n,o=t.subtract(this._occluderPosition,e,h),a=t.magnitudeSquared(o),s=this._occluderRadius*this._occluderRadius;if(a>s){i=Math.sqrt(a-s),a=1/Math.sqrt(a),r=t.multiplyByScalar(o,a,h);var l=i*i*a;n=t.add(e,t.multiplyByScalar(r,l,h),h)}else i=Number.MAX_VALUE;this._horizonDistance=i,this._horizonPlaneNormal=r,this._horizonPlanePosition=n,this._cameraPosition=e}}}),c.fromBoundingSphere=function(e,i,n){return r(n)?(t.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=i,n):new c(e,i)};var d=new t;c.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){var i=t.subtract(e,this._occluderPosition,d),r=this._occluderRadius;if(r=t.magnitudeSquared(i)-r*r,r>0)return r=Math.sqrt(r)+this._horizonDistance,i=t.subtract(e,this._cameraPosition,i),r*r>t.magnitudeSquared(i)}return!1};var p=new t;c.prototype.isBoundingSphereVisible=function(e){var i=t.clone(e.center,p),r=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){var n=t.subtract(i,this._occluderPosition,d),o=this._occluderRadius-r;if(o=t.magnitudeSquared(n)-o*o,r0&&(o=Math.sqrt(o)+this._horizonDistance,n=t.subtract(i,this._cameraPosition,n),o*o+r*r>t.magnitudeSquared(n));if(o>0){n=t.subtract(i,this._cameraPosition,n);var a=t.magnitudeSquared(n),s=this._occluderRadius*this._occluderRadius,l=r*r;return(this._horizonDistance*this._horizonDistance+s)*l>a*s||(o=Math.sqrt(o)+this._horizonDistance,o*o+l>a)}return!0}return!1};var m=new t;c.prototype.computeVisibility=function(e){var i=t.clone(e.center),r=e.radius;if(r>this._occluderRadius)return u.FULL;if(this._horizonDistance!==Number.MAX_VALUE){var n=t.subtract(i,this._occluderPosition,m),o=this._occluderRadius-r,a=t.magnitudeSquared(n);if(o=a-o*o,o>0){o=Math.sqrt(o)+this._horizonDistance,n=t.subtract(i,this._cameraPosition,n);var s=t.magnitudeSquared(n);return o*o+r*r0?(o=Math.sqrt(o)+this._horizonDistance,s-r?u.PARTIAL:u.FULL))}}return u.NONE};var f=new t;c.computeOccludeePoint=function(e,i,r){var n=t.clone(i),o=t.clone(e.center),a=e.radius,s=r.length,l=t.normalize(t.subtract(n,o,f),f),u=-t.dot(l,o),h=c._anyRotationVector(o,l,u),d=c._horizonToPlaneNormalDotProduct(e,l,u,h,r[0]);if(d){for(var p,m=1;mn.y?0:1;(0===o&&n.z>n.x||1===o&&n.z>n.y)&&(o=2);var a,s=new t;0===o?(n.x=e.x,n.y=e.y+1,n.z=e.z+1,a=t.UNIT_X):1===o?(n.x=e.x+1,n.y=e.y,n.z=e.z+1,a=t.UNIT_Y):(n.x=e.x+1,n.y=e.y+1,n.z=e.z,a=t.UNIT_Z);var l=(t.dot(i,n)+r)/-t.dot(i,a);return t.normalize(t.subtract(t.add(n,t.multiplyByScalar(a,l,s),n),e,n),n)};var v=new t;c._rotationVector=function(e,i,r,n,o){var a=t.subtract(n,e,v);if(a=t.normalize(a,a),t.dot(i,a)<.9999999847691291){var l=t.cross(i,a,a),u=t.magnitude(l);if(u>s.EPSILON13)return t.normalize(l,new t)}return o};var y=new t,C=new t,w=new t,S=new t;return c._horizonToPlaneNormalDotProduct=function(e,i,r,n,o){var a=t.clone(o,y),s=t.clone(e.center,C),l=e.radius,u=t.subtract(s,a,w),c=t.magnitudeSquared(u),h=l*l;if(c"+i,document.body.appendChild(h),o.leading=1.2*s;var d=e(h,"height");if(d=d.replace("px",""),d>=2*s&&(o.leading=d/2|0),document.body.removeChild(h),c)o.ascent=0,o.descent=0,o.bounds={minx:0,maxx:o.width,miny:0,maxy:0},o.height=0;else{var p=document.createElement("canvas"),m=100;p.width=o.width+m,p.height=3*s,p.style.opacity=1,p.style.fontFamily=a,p.style.fontSize=s,p.style.fontStyle=l,p.style.fontWeight=u;var f=p.getContext("2d");f.font=l+" "+u+" "+s+"px "+a;var _=p.width,g=p.height,v=g/2;f.fillStyle="white",f.fillRect(-1,-1,_+2,g+2),r&&(f.strokeStyle="black",f.lineWidth=t.lineWidth,f.strokeText(i,m/2,v)),n&&(f.fillStyle="black",f.fillText(i,m/2,v));for(var y=f.getImageData(0,0,_,g).data,C=0,w=4*_,S=y.length;++C0&&255===y[C];);var b=C/w|0;for(C=0;C=S&&(C=C-S+4);var T=C%w/4|0,x=1;for(C=S-3;C>=0&&255===y[C];)C-=w,C<0&&(C=S-3-4*x++);var A=C%w/4+1|0;o.ascent=v-E,o.descent=b-v,o.bounds={minx:T-m/2,maxx:A-m/2,miny:0,maxy:b-E},o.height=1+(b-E)}return o};return t}),i("Core/writeTextToCanvas",["../ThirdParty/measureText","./Color","./defaultValue","./defined","./DeveloperError"],function(e,t,i,r,n){"use strict";function o(n,o){if(""!==n){o=i(o,i.EMPTY_OBJECT);var s=i(o.font,"10px sans-serif"),l=i(o.stroke,!1),u=i(o.fill,!0),c=i(o.strokeWidth,1),h=i(o.backgroundColor,t.TRANSPARENT),d=i(o.padding,0),p=2*d,m=document.createElement("canvas");m.width=1,m.height=1,m.style.font=s;var f=m.getContext("2d");r(a)||(r(f.imageSmoothingEnabled)?a="imageSmoothingEnabled":r(f.mozImageSmoothingEnabled)?a="mozImageSmoothingEnabled":r(f.webkitImageSmoothingEnabled)?a="webkitImageSmoothingEnabled":r(f.msImageSmoothingEnabled)&&(a="msImageSmoothingEnabled")),f.font=s,f.lineJoin="round",f.lineWidth=c,f[a]=!1,f.textBaseline=i(o.textBaseline,"bottom"),m.style.visibility="hidden",document.body.appendChild(m);var _=e(f,n,l,u);m.dimensions=_,document.body.removeChild(m),m.style.visibility="";var g=-_.bounds.minx,v=Math.ceil(_.width)+g+p,y=_.height+p,C=y-_.ascent+p,w=y-C+p;if(m.width=v,m.height=y,f.font=s,f.lineJoin="round",f.lineWidth=c,f[a]=!1,h!==t.TRANSPARENT&&(f.fillStyle=h.toCssColorString(),f.fillRect(0,0,m.width,m.height)),l){var S=i(o.strokeColor,t.BLACK);f.strokeStyle=S.toCssColorString(),f.strokeText(n,g+d,w)}if(u){var E=i(o.fillColor,t.WHITE);f.fillStyle=E.toCssColorString(),f.fillText(n,g+d,w)}return m}}var a;return o}),i("Core/PinBuilder",["./buildModuleUrl","./Color","./defined","./DeveloperError","./loadImage","./writeTextToCanvas"],function(e,t,i,r,n,o){"use strict";function a(){this._cache={}}function s(e,t,i){e.save(),e.scale(i/24,i/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,c).toCssColorString(),e.lineWidth=.846,e.beginPath(),e.moveTo(6.72,.422),e.lineTo(17.28,.422),e.bezierCurveTo(18.553,.422,19.577,1.758,19.577,3.415),e.lineTo(19.577,10.973),e.bezierCurveTo(19.577,12.63,18.553,13.966,17.282,13.966),e.lineTo(14.386,14.008),e.lineTo(11.826,23.578),e.lineTo(9.614,14.008),e.lineTo(6.719,13.965),e.bezierCurveTo(5.446,13.983,4.422,12.629,4.422,10.972),e.lineTo(4.422,3.416),e.bezierCurveTo(4.423,1.76,5.447,.423,6.718,.423),e.closePath(),e.fill(),e.stroke(),e.restore()}function l(e,i,r){var n=r/2.5,o=n,a=n;i.width>i.height?a=n*(i.height/i.width):i.width0&&r.y>0&&r.z>0}var r=new t;return i}),i("Core/Queue",["./defineProperties"],function(e){"use strict";function t(){this._array=[],this._offset=0,this._length=0}return e(t.prototype,{length:{get:function(){return this._length}}}),t.prototype.enqueue=function(e){this._array.push(e),this._length++},t.prototype.dequeue=function(){if(0!==this._length){var e=this._array,t=this._offset,i=e[t];return e[t]=void 0,t++,t>10&&2*t>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,i}},t.prototype.peek=function(){if(0!==this._length)return this._array[this._offset]},t.prototype.contains=function(e){return this._array.indexOf(e)!==-1},t.prototype.clear=function(){this._array.length=this._offset=this._length=0},t.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)},t}),i("Core/PolygonGeometryLibrary",["./arrayRemoveDuplicates","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryPipeline","./IndexDatatype","./Math","./PolygonPipeline","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f){"use strict";function _(e,i,r,n){return t.subtract(i,e,v),t.multiplyByScalar(v,r/n,v),t.add(e,v,v),[v.x,v.y,v.z]}var g={};g.computeHierarchyPackedLength=function(e){for(var i=0,r=[e];r.length>0;){var o=r.pop();if(n(o)){i+=2;var a=o.positions,s=o.holes;if(n(a)&&(i+=a.length*t.packedLength),n(s))for(var l=s.length,u=0;u0;){var a=o.pop();if(n(a)){var s=a.positions,l=a.holes;if(i[r++]=n(s)?s.length:0,i[r++]=n(l)?l.length:0,n(s))for(var u=s.length,c=0;c0?new Array(n):void 0,s=0;s0?new Array(u):void 0;for(s=0;sw?(h=o.TWO_PI-S+w,n=Math.ceil(h/d)+1,a=Math.ceil(T/d)+1,u=h/(n-1),c=T/(a-1)):(h=w-S,n=Math.ceil(h/d)+1,a=Math.ceil(T/d)+1,u=h/(n-1),c=T/(a-1)),i=s.northwest(t,i);var x=s.center(t,f);0===v&&0===y||(x.longitude1||v>1))for(var w=0;w0;t-=c)H=D(H,j,3*t,v,E),j+=6,r.st&&(q=M(q,Y,2*t,b),Y+=4);for(t=c-1;t>=0;t--)H=D(H,j,3*t,v,E),j+=6,r.st&&(q=M(q,Y,2*t,b),Y+=4);var Z=A(H,r,d);r.st&&(Z.attributes.st=new h({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:q}));var K,Q,J,$,ee=f.createTypedArray(U,6*z);C=H.length/3;var te=0;for(t=0;t=0;t--)_.computePosition(e,d,t,p),a[s++]=p.x,a[s++]=p.y,a[s++]=p.z;for(t=0,d=n-2;d>0;d--)_.computePosition(e,d,t,p),a[s++]=p.x,a[s++]=p.y,a[s++]=p.z;for(var f=a.length/3*2,g=h.createTypedArray(a.length/3,f),v=0,y=0;yI.mouseEmulationIgnoreMilliseconds}function v(e,i){if(g(e)){var n=i.button;e._buttonDown=n;var o;if(n===R.LEFT)o=u.LEFT_DOWN;else if(n===R.MIDDLE)o=u.MIDDLE_DOWN;else{if(n!==R.RIGHT)return;o=u.RIGHT_DOWN}var a=c(e,i,e._primaryPosition);t.clone(a,e._primaryStartPosition),t.clone(a,e._primaryPreviousPosition);var s=d(i),l=e.getInputAction(o,s);r(l)&&(t.clone(a,O.position),l(O),i.preventDefault())}}function y(e,i){if(g(e)){var n=i.button;e._buttonDown=void 0;var o,a;if(n===R.LEFT)o=u.LEFT_UP,a=u.LEFT_CLICK;else if(n===R.MIDDLE)o=u.MIDDLE_UP,a=u.MIDDLE_CLICK;else{if(n!==R.RIGHT)return;o=u.RIGHT_UP,a=u.RIGHT_CLICK}var s=d(i),l=e.getInputAction(o,s),h=e.getInputAction(a,s);if(r(l)||r(h)){var p=c(e,i,e._primaryPosition);if(r(l)&&(t.clone(p,N.position),l(N)),r(h)){var m=e._primaryStartPosition,f=m.x-p.x,_=m.y-p.y,v=Math.sqrt(f*f+_*_);v0?t.detail*-120:t.wheelDelta;if(r(i)){var o=d(t),a=e.getInputAction(u.WHEEL,o);r(a)&&(a(i),t.preventDefault())}}function E(e,i){_(e);var r,n,o,a=i.changedTouches,s=a.length,l=e._positions;for(r=0;rD;++r){a=o;var s=a-t*Math.sin(a)-e,l=1-t*Math.cos(a);o=a-s/l}return a=o+i*n.TWO_PI}function m(e,t){var i=Math.floor(e/n.TWO_PI);e-=i*n.TWO_PI;var r=Math.cos(e)-t,o=Math.sin(e)*Math.sqrt(1-t*t),a=Math.atan2(o,r);return a=n.zeroToTwoPi(a),e<0&&(a-=n.TWO_PI),a+=i*n.TWO_PI}function f(e,i,r,n){var a=Math.cos(e),s=Math.sin(e),l=Math.cos(i),u=Math.sin(i),c=Math.cos(r),h=Math.sin(r);return t(n)?(n[0]=c*a-h*s*l,n[1]=h*a+c*s*l,n[2]=s*u,n[3]=-c*s-h*a*l,n[4]=-h*s+c*a*l,n[5]=a*u,n[6]=h*u,n[7]=-c*u,n[8]=l):n=new o(c*a-h*s*l,-c*s-h*a*l,h*u,h*a+c*s*l,-h*s+c*a*l,-c*u,s*u,a*u,l),n}function _(e,t){u(e,Ae);var i=Ae.dayNumber-S.dayNumber+(Ae.secondsOfDay-S.secondsOfDay)/a.SECONDS_PER_DAY,r=i/(10*a.DAYS_PER_JULIAN_CENTURY),n=.3595362*r,o=M+U*Math.cos(O*n)+Z*Math.sin(O*n)+G*Math.cos(N*n)+K*Math.sin(N*n)+W*Math.cos(L*n)+Q*Math.sin(L*n)+H*Math.cos(B*n)+J*Math.sin(B*n)+q*Math.cos(F*n)+$*Math.sin(F*n)+j*Math.cos(V*n)+ee*Math.sin(V*n)+Y*Math.cos(k*n)+te*Math.sin(k*n)+X*Math.cos(z*n)+ie*Math.sin(z*n),s=I+R*r+he*Math.cos(re*n)+ye*Math.sin(re*n)+de*Math.cos(ne*n)+Ce*Math.sin(ne*n)+pe*Math.cos(oe*n)+we*Math.sin(oe*n)+me*Math.cos(ae*n)+Se*Math.sin(ae*n)+fe*Math.cos(se*n)+Ee*Math.sin(se*n)+_e*Math.cos(le*n)+be*Math.sin(le*n)+ge*Math.cos(ue*n)+Te*Math.sin(ue*n)+ve*Math.cos(ce*n)+xe*Math.sin(ce*n),l=.0167086342-.0004203654*r,h=102.93734808*b+11612.3529*T*r,d=469.97289*T*r,p=174.87317577*b-8679.27034*T*r;return c(o,l,d,h,p,s,t)}function g(e,t){u(e,Ae);var i=Ae.dayNumber-S.dayNumber+(Ae.secondsOfDay-S.secondsOfDay)/a.SECONDS_PER_DAY,r=i/a.DAYS_PER_JULIAN_CENTURY,n=r*r,o=n*r,s=o*r,l=383397.7725+.004*r,h=.055545526-1.6e-8*r,d=5.15668983*b,p=-8e-5*r+.02966*n-42e-6*o-1.3e-7*s,m=83.35324312*b,f=14643420.2669*r-38.2702*n-.045047*o+21301e-8*s,_=125.04455501*b,g=-6967919.3631*r+6.3602*n+.007625*o-3586e-8*s,v=218.31664563*b,y=1732559343.4847*r-6.391*n+.006588*o-3169e-8*s,C=297.85019547*b+T*(1602961601.209*r-6.3706*n+.006593*o-3169e-8*s),w=93.27209062*b+T*(1739527262.8478*r-12.7512*n-.001037*o+417e-8*s),x=134.96340251*b+T*(1717915923.2178*r+31.8792*n+.051635*o-2447e-7*s),A=357.52910918*b+T*(129596581.0481*r-.5532*n+136e-6*o-1149e-8*s),P=310.17137918*b-T*(6967051.436*r+6.2068*n+.007618*o-3219e-8*s),D=2*C,M=4*C,I=6*C,R=2*x,O=3*x,N=4*x,L=2*w;l+=3400.4*Math.cos(D)-635.6*Math.cos(D-x)-235.6*Math.cos(x)+218.1*Math.cos(D-A)+181*Math.cos(D+x),h+=.014216*Math.cos(D-x)+.008551*Math.cos(D-R)-.001383*Math.cos(x)+.001356*Math.cos(D+x)-.001147*Math.cos(M-O)-914e-6*Math.cos(M-R)+869e-6*Math.cos(D-A-x)-627e-6*Math.cos(D)-394e-6*Math.cos(M-N)+282e-6*Math.cos(D-A-R)-279e-6*Math.cos(C-x)-236e-6*Math.cos(R)+231e-6*Math.cos(M)+229e-6*Math.cos(I-N)-201e-6*Math.cos(R-L),p+=486.26*Math.cos(D-L)-40.13*Math.cos(D)+37.51*Math.cos(L)+25.73*Math.cos(R-L)+19.97*Math.cos(D-A-L),f+=-55609*Math.sin(D-x)-34711*Math.sin(D-R)-9792*Math.sin(x)+9385*Math.sin(M-O)+7505*Math.sin(M-R)+5318*Math.sin(D+x)+3484*Math.sin(M-N)-3417*Math.sin(D-A-x)-2530*Math.sin(I-N)-2376*Math.sin(D)-2075*Math.sin(D-O)-1883*Math.sin(R)-1736*Math.sin(I-5*x)+1626*Math.sin(A)-1370*Math.sin(I-O),g+=-5392*Math.sin(D-L)-540*Math.sin(A)-441*Math.sin(D)+423*Math.sin(L)-288*Math.sin(R-L),y+=-3332.9*Math.sin(D)+1197.4*Math.sin(D-x)-662.5*Math.sin(A)+396.3*Math.sin(x)-218*Math.sin(D-A);var B=2*P,F=3*P;p+=46.997*Math.cos(P)*r-.614*Math.cos(D-L+P)*r+.614*Math.cos(D-L-P)*r-.0297*Math.cos(B)*n-.0335*Math.cos(P)*n+.0012*Math.cos(D-L+B)*n-16e-5*Math.cos(P)*o+4e-5*Math.cos(F)*o+4e-5*Math.cos(B)*o;var V=2.116*Math.sin(P)*r-.111*Math.sin(D-L-P)*r-.0015*Math.sin(P)*n;f+=V,y+=V,g+=-520.77*Math.sin(P)*r+13.66*Math.sin(D-L+P)*r+1.12*Math.sin(D-P)*r-1.06*Math.sin(L-P)*r+.66*Math.sin(B)*n+.371*Math.sin(P)*n-.035*Math.sin(D-L+B)*n-.015*Math.sin(D-L+P)*n+.0014*Math.sin(P)*o-.0011*Math.sin(F)*o-9e-4*Math.sin(B)*o,l*=E;var k=d+p*T,z=m+f*T,U=v+y*T,G=_+g*T;return c(l,h,k,z,G,U,t)}function v(t,i){return i=g(t,i),e.multiplyByScalar(i,De,i)}var y={},C=32.184,w=2451545,S=new r(2451545,0,s.TAI),E=1e3,b=n.RADIANS_PER_DEGREE,T=n.RADIANS_PER_ARCSECOND,x=14959787e4,A=new o,P=50,D=n.EPSILON8,M=1.0000010178*x,I=100.46645683*b,R=1295977422.83429*T,O=16002,N=21863,L=32004,B=10931,F=14529,V=16368,k=15318,z=32794,U=64e-7*x,G=-152e-7*x,W=62e-7*x,H=-8e-7*x,q=32e-7*x,j=-41e-7*x,Y=19e-7*x,X=-11e-7*x,Z=1e-7*-150*x,K=-46e-7*x,Q=68*1e-7*x,J=54e-7*x,$=14e-7*x,ee=24e-7*x,te=-28e-7*x,ie=22e-7*x,re=10,ne=16002,oe=21863,ae=10931,se=1473,le=32004,ue=4387,ce=73,he=-325e-7,de=-322e-7,pe=1e-7*-79,me=232*1e-7,fe=1e-7*-52,_e=97e-7,ge=55e-7,ve=-41e-7,ye=-105e-7,Ce=-137e-7,we=258e-7,Se=35e-7,Ee=1e-7*-116,be=-88e-7,Te=-112e-7,xe=-8e-6,Ae=new r(0,0,s.TAI),Pe=.012300034,De=Pe/(Pe+1)*-1,Me=new o(1.0000000000000002,5.619723173785822e-16,4.690511510146299e-19,-5.154129427414611e-16,.9174820620691819,-.39777715593191376,-2.23970096136568e-16,.39777715593191376,.9174820620691819),Ie=new e;return y.computeSunPositionInEarthInertialFrame=function(i,n){return t(i)||(i=r.now()),t(n)||(n=new e),Ie=_(i,Ie),n=e.negate(Ie,n),v(i,Ie),e.subtract(n,Ie,n),o.multiplyByVector(Me,n,n),n},y.computeMoonPositionInEarthInertialFrame=function(e,i){return t(e)||(e=r.now()),i=g(e,i),o.multiplyByVector(Me,i,i),i},y}),i("Core/SimplePolylineGeometry",["./BoundingSphere","./Cartesian3","./Color","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolylinePipeline","./PrimitiveType"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m){"use strict";function f(e,t,r,n,o,a,s){var l,u=p.numberOfPoints(e,t,o),c=r.red,h=r.green,d=r.blue,m=r.alpha,f=n.red,_=n.green,g=n.blue,v=n.alpha;if(i.equals(r,n)){for(l=0;l0?new Array(u):void 0;for(l=0;l0&&(t.pack(j,s,H),H+=3,w=E[a-1],C[q++]=i.floatToByte(w.red),C[q++]=i.floatToByte(w.green),C[q++]=i.floatToByte(w.blue),C[q++]=i.floatToByte(w.alpha)),D&&a===M-1)break;t.pack(j,s,H),H+=3,o(E)&&(w=E[a],C[q++]=i.floatToByte(w.red),C[q++]=i.floatToByte(w.green),C[q++]=i.floatToByte(w.blue),C[q++]=i.floatToByte(w.alpha))}}var Y=new c;Y.position=new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:s}),o(E)&&(Y.color=new u({componentDatatype:r.UNSIGNED_BYTE,componentsPerAttribute:4,values:C,normalize:!0})),_=s.length/3;var X=2*(_-1),Z=h.createTypedArray(_,X),K=0;for(a=0;a<_-1;++a)Z[K++]=a,Z[K++]=a+1;return new l({attributes:Y,indices:Z,primitiveType:m.LINES,boundingSphere:e.fromPoints(S)})},_}),i("Core/SphereGeometry",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./EllipsoidGeometry","./VertexFormat"],function(e,t,i,r,n,o){"use strict";function a(i){var r=t(i.radius,1),o=new e(r,r,r),a={radii:o,stackPartitions:i.stackPartitions,slicePartitions:i.slicePartitions,vertexFormat:i.vertexFormat};this._ellipsoidGeometry=new n(a),this._workerName="createSphereGeometry"}a.packedLength=n.packedLength,a.pack=function(e,t,i){return n.pack(e._ellipsoidGeometry,t,i)};var s=new n,l={radius:void 0,radii:new e,vertexFormat:new o,stackPartitions:void 0,slicePartitions:void 0};return a.unpack=function(t,r,u){var c=n.unpack(t,r,s);return l.vertexFormat=o.clone(c._vertexFormat,l.vertexFormat),l.stackPartitions=c._stackPartitions,l.slicePartitions=c._slicePartitions,i(u)?(e.clone(c._radii,l.radii),u._ellipsoidGeometry=new n(l),u):(l.radius=c._radii.x,new a(l))},a.createGeometry=function(e){return n.createGeometry(e._ellipsoidGeometry)},a}),i("Core/SphereOutlineGeometry",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./EllipsoidOutlineGeometry"],function(e,t,i,r,n){"use strict";function o(i){var r=t(i.radius,1),o=new e(r,r,r),a={radii:o,stackPartitions:i.stackPartitions,slicePartitions:i.slicePartitions,subdivisions:i.subdivisions};this._ellipsoidGeometry=new n(a),this._workerName="createSphereOutlineGeometry"}o.packedLength=n.packedLength,o.pack=function(e,t,i){return n.pack(e._ellipsoidGeometry,t,i)};var a=new n,s={radius:void 0,radii:new e,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};return o.unpack=function(t,r,l){var u=n.unpack(t,r,a);return s.stackPartitions=u._stackPartitions,s.slicePartitions=u._slicePartitions,s.subdivisions=u._subdivisions,i(l)?(e.clone(u._radii,s.radii),l._ellipsoidGeometry=new n(s),l):(s.radius=u._radii.x,new o(s))},o.createGeometry=function(e){return n.createGeometry(e._ellipsoidGeometry)},o}),i("Core/Spherical",["./defaultValue","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(t,i,r){this.clock=e(t,0),this.cone=e(i,0),this.magnitude=e(r,1)}return r.fromCartesian3=function(e,i){var n=e.x,o=e.y,a=e.z,s=n*n+o*o;return t(i)||(i=new r),i.clock=Math.atan2(o,n),i.cone=Math.atan2(Math.sqrt(s),a),i.magnitude=Math.sqrt(s+a*a),i},r.clone=function(e,i){if(t(e))return t(i)?(i.clock=e.clock,i.cone=e.cone,i.magnitude=e.magnitude,i):new r(e.clock,e.cone,e.magnitude)},r.normalize=function(e,i){return t(i)?(i.clock=e.clock,i.cone=e.cone,i.magnitude=1,i):new r(e.clock,e.cone,1)},r.equals=function(e,i){return e===i||t(e)&&t(i)&&e.clock===i.clock&&e.cone===i.cone&&e.magnitude===i.magnitude},r.equalsEpsilon=function(i,r,n){return n=e(n,0),i===r||t(i)&&t(r)&&Math.abs(i.clock-r.clock)<=n&&Math.abs(i.cone-r.cone)<=n&&Math.abs(i.magnitude-r.magnitude)<=n},r.prototype.equals=function(e){ -return r.equals(this,e)},r.prototype.clone=function(e){return r.clone(this,e)},r.prototype.equalsEpsilon=function(e,t){return r.equalsEpsilon(this,e,t)},r.prototype.toString=function(){return"("+this.clock+", "+this.cone+", "+this.magnitude+")"},r}),i("Core/subdivideArray",["./defined","./DeveloperError"],function(e,t){"use strict";function i(e,t){for(var i=[],r=e.length,n=0;n0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))},u.prototype.findIntervalContainingDate=function(e){var t=this.indexOf(e);return t>=0?this._intervals[t]:void 0},u.prototype.findDataForIntervalContainingDate=function(e){var t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0},u.prototype.contains=function(e){return this.indexOf(e)>=0};var c=new s;return u.prototype.indexOf=function(t){var i=this._intervals;c.start=t,c.stop=t;var r=e(i,c,l);return r>=0?i[r].isStartIncluded?r:r>0&&i[r-1].stop.equals(t)&&i[r-1].isStopIncluded?r-1:~r:(r=~r,r>0&&r-10&&t.isStartIncluded&&u[o-1].isStartIncluded&&u[o-1].start.equals(t.start)?--o:o0&&(n=a.compare(u[o-1].stop,t.start),(n>0||0===n&&(u[o-1].isStopIncluded||t.isStartIncluded))&&((i(r)?r(u[o-1].data,t.data):u[o-1].data===t.data)?(t=new s(a.greaterThan(t.stop,u[o-1].stop)?{start:u[o-1].start,stop:t.stop,isStartIncluded:u[o-1].isStartIncluded,isStopIncluded:t.isStopIncluded,data:t.data}:{start:u[o-1].start,stop:u[o-1].stop,isStartIncluded:u[o-1].isStartIncluded,isStopIncluded:u[o-1].isStopIncluded||t.stop.equals(u[o-1].stop)&&t.isStopIncluded,data:t.data}),u.splice(o-1,1),--o):(n=a.compare(u[o-1].stop,t.stop),n>0||0===n&&u[o-1].isStopIncluded&&!t.isStopIncluded?u.splice(o-1,1,new s({start:u[o-1].start,stop:t.start,isStartIncluded:u[o-1].isStartIncluded,isStopIncluded:!t.isStartIncluded,data:u[o-1].data}),new s({start:t.stop,stop:u[o-1].stop,isStartIncluded:!t.isStopIncluded,isStopIncluded:u[o-1].isStopIncluded,data:u[o-1].data})):u[o-1]=new s({start:u[o-1].start,stop:t.start,isStartIncluded:u[o-1].isStartIncluded,isStopIncluded:!t.isStartIncluded,data:u[o-1].data}))));o0||0===n&&(t.isStopIncluded||u[o].isStartIncluded));)if(i(r)?r(u[o].data,t.data):u[o].data===t.data)t=new s({start:t.start,stop:a.greaterThan(u[o].stop,t.stop)?u[o].stop:t.stop,isStartIncluded:t.isStartIncluded,isStopIncluded:a.greaterThan(u[o].stop,t.stop)?u[o].isStopIncluded:t.isStopIncluded,data:t.data}),u.splice(o,1);else{if(u[o]=new s({start:t.stop,stop:u[o].stop,isStartIncluded:!t.isStopIncluded,isStopIncluded:u[o].isStopIncluded,data:u[o].data}),!u[o].isEmpty)break;u.splice(o,1)}u.splice(o,0,t),this._changedEvent.raiseEvent(this)}},u.prototype.removeInterval=function(t){if(t.isEmpty)return!1;var i=!1,r=this._intervals,n=e(r,t,l);n<0&&(n=~n);var o=t.start,u=t.stop,c=t.isStartIncluded,h=t.isStopIncluded;if(n>0){var d=r[n-1],p=d.stop;(a.greaterThan(p,o)||s.equals(p,o)&&d.isStopIncluded&&c)&&(i=!0,(a.greaterThan(p,u)||d.isStopIncluded&&!h&&s.equals(p,u))&&r.splice(n,0,new s({start:u,stop:p,isStartIncluded:!h,isStopIncluded:d.isStopIncluded,data:d.data})),r[n-1]=new s({start:d.start,stop:o,isStartIncluded:d.isStartIncluded,isStopIncluded:!c,data:d.data}))}var m=r[n];for(nd?d:h<0?0:h;var m=s?e(this.tolerance,1):.001;Math.abs(l-p)>m&&(this._seeking=!0,r.currentTime=l)}},a}),i("Core/VRTheWorldTerrainProvider",["../ThirdParty/when","./Credit","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Event","./GeographicTilingScheme","./getImagePixels","./HeightmapTerrainData","./loadImage","./loadXML","./Math","./Rectangle","./TerrainProvider","./throttleRequestByServer","./TileProviderError"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g){"use strict";function v(e,t){this.rectangle=e,this.maxLevel=t}function y(r){function n(e){var t=e.getElementsByTagName("SRS")[0].textContent;if("EPSG:4326"!==t)return void o("SRS "+t+" is not supported.");_._tilingScheme=new l({ellipsoid:y});var i=e.getElementsByTagName("TileFormat")[0];_._heightmapWidth=parseInt(i.getAttribute("width"),10),_._heightmapHeight=parseInt(i.getAttribute("height"),10),_._levelZeroMaximumGeometricError=f.getEstimatedLevelZeroGeometricErrorForAHeightmap(y,Math.min(_._heightmapWidth,_._heightmapHeight),_._tilingScheme.getNumberOfXTilesAtLevel(0));for(var r=e.getElementsByTagName("DataExtent"),n=0;n0&&"/"!==this._url[this._url.length-1]&&(this._url+="/"),this._errorEvent=new s,this._ready=!1,this._readyPromise=e.defer(),this._proxy=r.proxy,this._terrainDataStructure={heightScale:.001,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0,lowestEncodedHeight:0,highestEncodedHeight:16777215};var c=r.credit;"string"==typeof c&&(c=new t(c)),this._credit=c,this._tilingScheme=void 0,this._rectangles=[];var h,_=this,y=i(r.ellipsoid,a.WGS84);u()}function C(e,t,i,n){for(var o=e._tilingScheme,a=e._rectangles,s=o.tileXYToRectangle(t,i,n),l=0,u=0;u=3){var g=i.fromPoints(s,e),v=g.projectPointsOntoPlane(s);n.computeWindingOrder2D(v)===a.CLOCKWISE&&(s.reverse(),u.reverse(),c.reverse())}var y,C,w=s.length,S=w-2,E=r.chordLength(h,e.maximumRadius),b=m;if(b.minDistance=E,b.ellipsoid=e,f){var T,x=0;for(T=0;T0)for(c=new Array(l),s=0;s0)for(h=new Array(l),s=0;s0)for(c=new Array(l),s=0;s0)for(h=new Array(l),s=0;s=s&&(g=s-1);var v=_/d|0;return v>=l&&(v=l-1),i(n)?(n.x=g,n.y=v,n):new e(g,v)}},s}),i("Core/wrapFunction",["./DeveloperError"],function(e){"use strict";function t(e,t,i){return function(){i.apply(e,arguments),t.apply(e,arguments)}}return t}),i("DataSources/ConstantProperty",["../Core/defined","../Core/defineProperties","../Core/Event"],function(e,t,i){"use strict";function r(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new i,this.setValue(e)}return t(r.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}}),r.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value},r.prototype.setValue=function(t){var i=this._value;if(i!==t){var r=e(t),n=r&&"function"==typeof t.clone,o=r&&"function"==typeof t.equals;this._hasClone=n,this._hasEquals=o;var a=!o||!t.equals(i);a&&(this._value=n?t.clone():t,this._definitionChanged.raiseEvent(this))}},r.prototype.equals=function(e){return this===e||e instanceof r&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))},r}),i("DataSources/createPropertyDescriptor",["../Core/defaultValue","../Core/defined","./ConstantProperty"],function(e,t,i){"use strict";function r(e,i,r,n,o){return{configurable:n,get:function(){return this[i]},set:function(n){var a=this[i],s=this[r];t(s)&&(s(),this[r]=void 0);var l=t(n);l&&!t(n.getValue)&&t(o)&&(n=o(n)),a!==n&&(this[i]=n,this._definitionChanged.raiseEvent(this,e,n,a)),t(n)&&t(n.definitionChanged)&&(this[r]=n.definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this,e,n,n)},this))}}}function n(e){return new i(e)}function o(t,i,o){return r(t,"_"+t.toString(),"_"+t.toString()+"Subscription",e(i,!1),e(o,n))}return o}),i("DataSources/BillboardGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createPropertyDescriptor"],function(e,t,i,r,n,o){"use strict";function a(t){this._image=void 0,this._imageSubscription=void 0,this._imageSubRegion=void 0,this._imageSubRegionSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._alignedAxis=void 0,this._alignedAxisSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._sizeInMeters=void 0,this._sizeInMetersSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},image:o("image"),imageSubRegion:o("imageSubRegion"),scale:o("scale"),rotation:o("rotation"),alignedAxis:o("alignedAxis"),horizontalOrigin:o("horizontalOrigin"),verticalOrigin:o("verticalOrigin"),color:o("color"),eyeOffset:o("eyeOffset"),heightReference:o("heightReference"),pixelOffset:o("pixelOffset"),show:o("show"),width:o("width"),height:o("height"),scaleByDistance:o("scaleByDistance"),translucencyByDistance:o("translucencyByDistance"),pixelOffsetScaleByDistance:o("pixelOffsetScaleByDistance"),sizeInMeters:o("sizeInMeters"),distanceDisplayCondition:o("distanceDisplayCondition")}),a.prototype.clone=function(e){return t(e)?(e.color=this._color,e.eyeOffset=this._eyeOffset,e.heightReference=this._heightReference,e.horizontalOrigin=this._horizontalOrigin,e.image=this._image,e.imageSubRegion=this._imageSubRegion,e.pixelOffset=this._pixelOffset,e.scale=this._scale,e.rotation=this._rotation,e.alignedAxis=this._alignedAxis,e.show=this._show,e.verticalOrigin=this._verticalOrigin,e.width=this._width,e.height=this._height,e.scaleByDistance=this._scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance,e.sizeInMeters=this._sizeInMeters,e.distanceDisplayCondition=this._distanceDisplayCondition,e):new a(this)},a.prototype.merge=function(t){this.color=e(this._color,t.color),this.eyeOffset=e(this._eyeOffset,t.eyeOffset),this.heightReference=e(this._heightReference,t.heightReference),this.horizontalOrigin=e(this._horizontalOrigin,t.horizontalOrigin),this.image=e(this._image,t.image),this.imageSubRegion=e(this._imageSubRegion,t.imageSubRegion),this.pixelOffset=e(this._pixelOffset,t.pixelOffset),this.scale=e(this._scale,t.scale),this.rotation=e(this._rotation,t.rotation),this.alignedAxis=e(this._alignedAxis,t.alignedAxis),this.show=e(this._show,t.show),this.verticalOrigin=e(this._verticalOrigin,t.verticalOrigin),this.width=e(this._width,t.width),this.height=e(this._height,t.height),this.scaleByDistance=e(this._scaleByDistance,t.scaleByDistance),this.translucencyByDistance=e(this._translucencyByDistance,t.translucencyByDistance),this.pixelOffsetScaleByDistance=e(this._pixelOffsetScaleByDistance,t.pixelOffsetScaleByDistance),this.sizeInMeters=e(this._sizeInMeters,t.sizeInMeters),this.distanceDisplayCondition=e(this._distanceDisplayCondition,t.distanceDisplayCondition)},a}),i("Scene/HeightReference",["../Core/freezeObject"],function(e){"use strict";var t={NONE:0,CLAMP_TO_GROUND:1,RELATIVE_TO_GROUND:2};return e(t)}),i("Scene/HorizontalOrigin",["../Core/freezeObject"],function(e){"use strict";var t={CENTER:0,LEFT:1,RIGHT:-1};return e(t)}),i("Scene/VerticalOrigin",["../Core/freezeObject"],function(e){"use strict";var t={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1};return e(t)}),i("DataSources/BoundingSphereState",["../Core/freezeObject"],function(e){"use strict";var t={DONE:0,PENDING:1,FAILED:2};return e(t)}),i("DataSources/Property",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError"],function(e,t,i,r){"use strict";function n(){r.throwInstantiationError()}return i(n.prototype,{isConstant:{get:r.throwInstantiationError},definitionChanged:{get:r.throwInstantiationError -}}),n.prototype.getValue=r.throwInstantiationError,n.prototype.equals=r.throwInstantiationError,n.equals=function(e,i){return e===i||t(e)&&e.equals(i)},n.arrayEquals=function(e,i){if(e===i)return!0;if(!t(e)||!t(i)||e.length!==i.length)return!1;for(var r=e.length,o=0;o-1;n--)a=t[n],o(a._billboard)&&o(a._position)&&s.set(a.id,new f(a));for(n=r.length-1;n>-1;n--)a=r[n],o(a._billboard)&&o(a._position)?s.contains(a.id)||s.set(a.id,new f(a)):(g(s.get(a.id),a,l),s.remove(a.id));for(n=i.length-1;n>-1;n--)a=i[n],g(s.get(a.id),a,l),s.remove(a.id)},_}),i("Shaders/Appearances/AllMaterialAppearanceFS",[],function(){"use strict";return"varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec3 v_tangentEC;\nvarying vec3 v_binormalEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec3 positionToEyeEC = -v_positionEC;\nmat3 tangentToEyeMatrix = czm_tangentToEyeSpaceMatrix(v_normalEC, v_tangentEC, v_binormalEC);\nvec3 normalEC = normalize(v_normalEC);\n#ifdef FACE_FORWARD\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.tangentToEyeMatrix = tangentToEyeMatrix;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nmaterialInput.st = v_st;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\n#endif\n}\n"}),i("Shaders/Appearances/AllMaterialAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute vec3 tangent;\nattribute vec3 binormal;\nattribute vec2 st;\nattribute float batchId;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec3 v_tangentEC;\nvarying vec3 v_binormalEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_normalEC = czm_normal * normal;\nv_tangentEC = czm_normal * tangent;\nv_binormalEC = czm_normal * binormal;\nv_st = st;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),i("Shaders/Appearances/BasicMaterialAppearanceFS",[],function(){"use strict";return"varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvoid main()\n{\nvec3 positionToEyeEC = -v_positionEC;\nvec3 normalEC = normalize(v_normalEC);\n#ifdef FACE_FORWARD\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\n#endif\n}\n"}),i("Shaders/Appearances/BasicMaterialAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute float batchId;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_normalEC = czm_normal * normal;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),i("Shaders/Appearances/TexturedMaterialAppearanceFS",[],function(){"use strict";return"varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec3 positionToEyeEC = -v_positionEC;\nvec3 normalEC = normalize(v_normalEC);;\n#ifdef FACE_FORWARD\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nmaterialInput.st = v_st;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\n#endif\n}\n"}),i("Shaders/Appearances/TexturedMaterialAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute vec2 st;\nattribute float batchId;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_normalEC = czm_normal * normal;\nv_st = st;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),i("Scene/BlendEquation",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={ADD:t.FUNC_ADD,SUBTRACT:t.FUNC_SUBTRACT,REVERSE_SUBTRACT:t.FUNC_REVERSE_SUBTRACT};return e(i)}),i("Scene/BlendFunction",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={ZERO:t.ZERO,ONE:t.ONE,SOURCE_COLOR:t.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:t.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:t.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:t.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:t.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:t.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:t.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:t.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:t.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:t.ONE_MINUS_CONSTANT_ALPHA,CONSTANT_ALPHA:t.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:t.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:t.SRC_ALPHA_SATURATE};return e(i)}),i("Scene/BlendingState",["../Core/freezeObject","./BlendEquation","./BlendFunction"],function(e,t,i){"use strict";var r={DISABLED:e({enabled:!1}),ALPHA_BLEND:e({enabled:!0,equationRgb:t.ADD,equationAlpha:t.ADD,functionSourceRgb:i.SOURCE_ALPHA,functionSourceAlpha:i.SOURCE_ALPHA,functionDestinationRgb:i.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:i.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:e({enabled:!0,equationRgb:t.ADD,equationAlpha:t.ADD,functionSourceRgb:i.ONE,functionSourceAlpha:i.ONE,functionDestinationRgb:i.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:i.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:e({enabled:!0,equationRgb:t.ADD,equationAlpha:t.ADD,functionSourceRgb:i.SOURCE_ALPHA,functionSourceAlpha:i.SOURCE_ALPHA,functionDestinationRgb:i.ONE,functionDestinationAlpha:i.ONE})};return e(r)}),i("Scene/CullFace",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={FRONT:t.FRONT,BACK:t.BACK,FRONT_AND_BACK:t.FRONT_AND_BACK};return e(i)}),i("Scene/Appearance",["../Core/clone","../Core/combine","../Core/defaultValue","../Core/defined","../Core/defineProperties","./BlendingState","./CullFace"],function(e,t,i,r,n,o,a){"use strict";function s(e){e=i(e,i.EMPTY_OBJECT),this.material=e.material,this.translucent=i(e.translucent,!0),this._vertexShaderSource=e.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource,this._renderState=e.renderState,this._closed=i(e.closed,!1)}return n(s.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}}}),s.prototype.getFragmentShaderSource=function(){var e=[];return this.flat&&e.push("#define FLAT"),this.faceForward&&e.push("#define FACE_FORWARD"),r(this.material)&&e.push(this.material.shaderSource),e.push(this.fragmentShaderSource),e.join("\n")},s.prototype.isTranslucent=function(){return r(this.material)&&this.material.isTranslucent()||!r(this.material)&&this.translucent},s.prototype.getRenderState=function(){var t=this.isTranslucent(),i=e(this.renderState,!1);return t?(i.depthMask=!1,i.blending=o.ALPHA_BLEND):i.depthMask=!0,i},s.getDefaultRenderState=function(e,i,n){var s={depthTest:{enabled:!0}};return e&&(s.depthMask=!1,s.blending=o.ALPHA_BLEND),i&&(s.cull={enabled:!0,face:a.BACK}),r(n)&&(s=t(n,s,!0)),s},s}),i("Renderer/ContextLimits",["../Core/defineProperties"],function(e){"use strict";var t={_maximumCombinedTextureImageUnits:0,_maximumCubeMapSize:0,_maximumFragmentUniformVectors:0,_maximumTextureImageUnits:0,_maximumRenderbufferSize:0,_maximumTextureSize:0,_maximumVaryingVectors:0,_maximumVertexAttributes:0,_maximumVertexTextureImageUnits:0,_maximumVertexUniformVectors:0,_minimumAliasedLineWidth:0,_maximumAliasedLineWidth:0,_minimumAliasedPointSize:0,_maximumAliasedPointSize:0,_maximumViewportWidth:0,_maximumViewportHeight:0,_maximumTextureFilterAnisotropy:0,_maximumDrawBuffers:0,_maximumColorAttachments:0,_highpFloatSupported:!1,_highpIntSupported:!1};return e(t,{maximumCombinedTextureImageUnits:{get:function(){return t._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return t._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return t._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return t._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return t._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return t._maximumTextureSize}},maximumVaryingVectors:{get:function(){return t._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return t._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return t._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return t._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return t._minimumAliasedLineWidth}},maximumAliasedLineWidth:{get:function(){return t._maximumAliasedLineWidth}},minimumAliasedPointSize:{get:function(){return t._minimumAliasedPointSize}},maximumAliasedPointSize:{get:function(){return t._maximumAliasedPointSize}},maximumViewportWidth:{get:function(){return t._maximumViewportWidth}},maximumViewportHeight:{get:function(){return t._maximumViewportHeight}},maximumTextureFilterAnisotropy:{get:function(){return t._maximumTextureFilterAnisotropy}},maximumDrawBuffers:{get:function(){return t._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return t._maximumColorAttachments}},highpFloatSupported:{get:function(){return t._highpFloatSupported}},highpIntSupported:{get:function(){return t._highpIntSupported}}}),t}),i("Renderer/PixelDatatype",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={UNSIGNED_BYTE:t.UNSIGNED_BYTE,UNSIGNED_SHORT:t.UNSIGNED_SHORT,UNSIGNED_INT:t.UNSIGNED_INT,FLOAT:t.FLOAT,UNSIGNED_INT_24_8:t.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:t.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:t.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:t.UNSIGNED_SHORT_5_6_5,validate:function(e){return e===i.UNSIGNED_BYTE||e===i.UNSIGNED_SHORT||e===i.UNSIGNED_INT||e===i.FLOAT||e===i.UNSIGNED_INT_24_8||e===i.UNSIGNED_SHORT_4_4_4_4||e===i.UNSIGNED_SHORT_5_5_5_1||e===i.UNSIGNED_SHORT_5_6_5}};return e(i)}),i("Renderer/CubeMapFace",["../Core/defaultValue","../Core/defineProperties","../Core/DeveloperError","./PixelDatatype"],function(e,t,i,r){"use strict";function n(e,t,i,r,n,o,a,s,l){this._gl=e,this._texture=t,this._textureTarget=i,this._targetFace=r,this._pixelFormat=n,this._pixelDatatype=o,this._size=a,this._preMultiplyAlpha=s,this._flipY=l}return t(n.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}}),n.prototype.copyFrom=function(t,i,r){i=e(i,0),r=e(r,0);var n=this._gl,o=this._textureTarget;n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this._preMultiplyAlpha),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,this._flipY),n.activeTexture(n.TEXTURE0),n.bindTexture(o,this._texture),t.arrayBufferView?n.texSubImage2D(this._targetFace,0,i,r,t.width,t.height,this._pixelFormat,this._pixelDatatype,t.arrayBufferView):n.texSubImage2D(this._targetFace,0,i,r,this._pixelFormat,this._pixelDatatype,t),n.bindTexture(o,null)},n.prototype.copyFromFramebuffer=function(t,i,r,n,o,a){t=e(t,0),i=e(i,0),r=e(r,0),n=e(n,0),o=e(o,this._size),a=e(a,this._size);var s=this._gl,l=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(l,this._texture),s.copyTexSubImage2D(this._targetFace,0,t,i,r,n,o,a),s.bindTexture(l,null)},n}),i("Renderer/MipmapHint",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={DONT_CARE:t.DONT_CARE,FASTEST:t.FASTEST,NICEST:t.NICEST,validate:function(e){return e===i.DONT_CARE||e===i.FASTEST||e===i.NICEST}};return e(i)}),i("Renderer/TextureMagnificationFilter",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={NEAREST:t.NEAREST,LINEAR:t.LINEAR,validate:function(e){return e===i.NEAREST||e===i.LINEAR}};return e(i)}),i("Renderer/TextureMinificationFilter",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={NEAREST:t.NEAREST,LINEAR:t.LINEAR,NEAREST_MIPMAP_NEAREST:t.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:t.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:t.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:t.LINEAR_MIPMAP_LINEAR,validate:function(e){return e===i.NEAREST||e===i.LINEAR||e===i.NEAREST_MIPMAP_NEAREST||e===i.LINEAR_MIPMAP_NEAREST||e===i.NEAREST_MIPMAP_LINEAR||e===i.LINEAR_MIPMAP_LINEAR}};return e(i)}),i("Renderer/TextureWrap",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={CLAMP_TO_EDGE:t.CLAMP_TO_EDGE,REPEAT:t.REPEAT,MIRRORED_REPEAT:t.MIRRORED_REPEAT,validate:function(e){return e===i.CLAMP_TO_EDGE||e===i.REPEAT||e===i.MIRRORED_REPEAT}};return e(i)}),i("Renderer/Sampler",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","./TextureMagnificationFilter","./TextureMinificationFilter","./TextureWrap"],function(e,t,i,r,n,o,a){"use strict";function s(i){i=e(i,e.EMPTY_OBJECT);var r=e(i.wrapS,a.CLAMP_TO_EDGE),s=e(i.wrapT,a.CLAMP_TO_EDGE),l=e(i.minificationFilter,o.LINEAR),u=e(i.magnificationFilter,n.LINEAR),c=t(i.maximumAnisotropy)?i.maximumAnisotropy:1;this._wrapS=r,this._wrapT=s,this._minificationFilter=l,this._magnificationFilter=u,this._maximumAnisotropy=c}return i(s.prototype,{wrapS:{get:function(){return this._wrapS}},wrapT:{get:function(){return this._wrapT}},minificationFilter:{get:function(){return this._minificationFilter}},magnificationFilter:{get:function(){return this._magnificationFilter}},maximumAnisotropy:{get:function(){return this._maximumAnisotropy}}}),s}),i("Renderer/CubeMap",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Math","../Core/PixelFormat","./ContextLimits","./CubeMapFace","./MipmapHint","./PixelDatatype","./Sampler","./TextureMagnificationFilter","./TextureMinificationFilter"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p){"use strict";function m(i){function r(e,t){t.arrayBufferView?v.texImage2D(e,0,m,p,p,0,m,f,t.arrayBufferView):v.texImage2D(e,0,m,m,f,t)}i=e(i,e.EMPTY_OBJECT);var n,o,s=i.context,u=i.source;if(t(u)){var d=[u.positiveX,u.negativeX,u.positiveY,u.negativeY,u.positiveZ,u.negativeZ];n=d[0].width,o=d[0].height}else n=i.width,o=i.height;var p=n,m=e(i.pixelFormat,a.RGBA),f=e(i.pixelDatatype,c.UNSIGNED_BYTE),_=i.preMultiplyAlpha||m===a.RGB||m===a.LUMINANCE,g=e(i.flipY,!0),v=s._gl,y=v.TEXTURE_CUBE_MAP,C=v.createTexture();v.activeTexture(v.TEXTURE0),v.bindTexture(y,C),t(u)?(v.pixelStorei(v.UNPACK_PREMULTIPLY_ALPHA_WEBGL,_),v.pixelStorei(v.UNPACK_FLIP_Y_WEBGL,g),r(v.TEXTURE_CUBE_MAP_POSITIVE_X,u.positiveX),r(v.TEXTURE_CUBE_MAP_NEGATIVE_X,u.negativeX),r(v.TEXTURE_CUBE_MAP_POSITIVE_Y,u.positiveY),r(v.TEXTURE_CUBE_MAP_NEGATIVE_Y,u.negativeY),r(v.TEXTURE_CUBE_MAP_POSITIVE_Z,u.positiveZ),r(v.TEXTURE_CUBE_MAP_NEGATIVE_Z,u.negativeZ)):(v.texImage2D(v.TEXTURE_CUBE_MAP_POSITIVE_X,0,m,p,p,0,m,f,null),v.texImage2D(v.TEXTURE_CUBE_MAP_NEGATIVE_X,0,m,p,p,0,m,f,null),v.texImage2D(v.TEXTURE_CUBE_MAP_POSITIVE_Y,0,m,p,p,0,m,f,null),v.texImage2D(v.TEXTURE_CUBE_MAP_NEGATIVE_Y,0,m,p,p,0,m,f,null),v.texImage2D(v.TEXTURE_CUBE_MAP_POSITIVE_Z,0,m,p,p,0,m,f,null),v.texImage2D(v.TEXTURE_CUBE_MAP_NEGATIVE_Z,0,m,p,p,0,m,f,null)),v.bindTexture(y,null),this._gl=v,this._textureFilterAnisotropic=s._textureFilterAnisotropic,this._textureTarget=y,this._texture=C,this._pixelFormat=m,this._pixelDatatype=f,this._size=p,this._preMultiplyAlpha=_,this._flipY=g,this._sampler=void 0,this._positiveX=new l(v,C,y,v.TEXTURE_CUBE_MAP_POSITIVE_X,m,f,p,_,g),this._negativeX=new l(v,C,y,v.TEXTURE_CUBE_MAP_NEGATIVE_X,m,f,p,_,g),this._positiveY=new l(v,C,y,v.TEXTURE_CUBE_MAP_POSITIVE_Y,m,f,p,_,g),this._negativeY=new l(v,C,y,v.TEXTURE_CUBE_MAP_NEGATIVE_Y,m,f,p,_,g),this._positiveZ=new l(v,C,y,v.TEXTURE_CUBE_MAP_POSITIVE_Z,m,f,p,_,g),this._negativeZ=new l(v,C,y,v.TEXTURE_CUBE_MAP_NEGATIVE_Z,m,f,p,_,g),this.sampler=t(i.sampler)?i.sampler:new h}return i(m.prototype,{positiveX:{get:function(){return this._positiveX}},negativeX:{get:function(){return this._negativeX}},positiveY:{get:function(){return this._positiveY}},negativeY:{get:function(){return this._negativeY}},positiveZ:{get:function(){return this._positiveZ}},negativeZ:{get:function(){return this._negativeZ}},sampler:{get:function(){return this._sampler},set:function(e){var i=e.minificationFilter,r=e.magnificationFilter,n=i===p.NEAREST_MIPMAP_NEAREST||i===p.NEAREST_MIPMAP_LINEAR||i===p.LINEAR_MIPMAP_NEAREST||i===p.LINEAR_MIPMAP_LINEAR;this._pixelDatatype===c.FLOAT&&(i=n?p.NEAREST_MIPMAP_NEAREST:p.NEAREST,r=d.NEAREST);var o=this._gl,a=this._textureTarget;o.activeTexture(o.TEXTURE0),o.bindTexture(a,this._texture),o.texParameteri(a,o.TEXTURE_MIN_FILTER,i),o.texParameteri(a,o.TEXTURE_MAG_FILTER,r),o.texParameteri(a,o.TEXTURE_WRAP_S,e.wrapS),o.texParameteri(a,o.TEXTURE_WRAP_T,e.wrapT),t(this._textureFilterAnisotropic)&&o.texParameteri(a,this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,e.maximumAnisotropy),o.bindTexture(a,null),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},width:{get:function(){return this._size}},height:{get:function(){return this._size}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},_target:{get:function(){return this._textureTarget}}}),m.prototype.generateMipmap=function(t){t=e(t,u.DONT_CARE);var i=this._gl,r=this._textureTarget;i.hint(i.GENERATE_MIPMAP_HINT,t),i.activeTexture(i.TEXTURE0),i.bindTexture(r,this._texture),i.generateMipmap(r),i.bindTexture(r,null)},m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){return this._gl.deleteTexture(this._texture),this._positiveX=r(this._positiveX),this._negativeX=r(this._negativeX),this._positiveY=r(this._positiveY),this._negativeY=r(this._negativeY),this._positiveZ=r(this._positiveZ),this._negativeZ=r(this._negativeZ),r(this)},m}),i("Renderer/Texture",["../Core/Cartesian2","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Math","../Core/PixelFormat","../Core/WebGLConstants","./ContextLimits","./MipmapHint","./PixelDatatype","./Sampler","./TextureMagnificationFilter","./TextureMinificationFilter"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m){"use strict";function f(r){r=t(r,t.EMPTY_OBJECT);var n=r.context,o=r.width,a=r.height,u=r.source;i(u)&&(i(o)||(o=t(u.videoWidth,u.width)),i(a)||(a=t(u.videoHeight,u.height)));var c=t(r.pixelFormat,s.RGBA),p=t(r.pixelDatatype,h.UNSIGNED_BYTE),m=c;n.webgl2&&(c===s.DEPTH_STENCIL?m=l.DEPTH24_STENCIL8:c===s.DEPTH_COMPONENT&&(p===h.UNSIGNED_SHORT?m=l.DEPTH_COMPONENT16:p===h.UNSIGNED_INT&&(m=l.DEPTH_COMPONENT24)));var f=r.preMultiplyAlpha||c===s.RGB||c===s.LUMINANCE,_=t(r.flipY,!0),g=n._gl,v=g.TEXTURE_2D,y=g.createTexture();g.activeTexture(g.TEXTURE0),g.bindTexture(v,y),i(u)?(g.pixelStorei(g.UNPACK_PREMULTIPLY_ALPHA_WEBGL,f),g.pixelStorei(g.UNPACK_FLIP_Y_WEBGL,_),i(u.arrayBufferView)?g.texImage2D(v,0,m,o,a,0,c,p,u.arrayBufferView):i(u.framebuffer)?(u.framebuffer!==n.defaultFramebuffer&&u.framebuffer._bind(),g.copyTexImage2D(v,0,m,u.xOffset,u.yOffset,o,a,0),u.framebuffer!==n.defaultFramebuffer&&u.framebuffer._unBind()):g.texImage2D(v,0,m,c,p,u)):g.texImage2D(v,0,m,o,a,0,c,p,null),g.bindTexture(v,null),this._context=n,this._textureFilterAnisotropic=n._textureFilterAnisotropic,this._textureTarget=v,this._texture=y,this._pixelFormat=c,this._pixelDatatype=p,this._width=o,this._height=a,this._dimensions=new e(o,a),this._preMultiplyAlpha=f,this._flipY=_,this._sampler=void 0,this.sampler=i(r.sampler)?r.sampler:new d}return f.fromFramebuffer=function(e){e=t(e,t.EMPTY_OBJECT);var r=e.context,n=r._gl,o=t(e.pixelFormat,s.RGB),a=t(e.framebufferXOffset,0),l=t(e.framebufferYOffset,0),u=t(e.width,n.drawingBufferWidth),c=t(e.height,n.drawingBufferHeight),h=e.framebuffer,d=new f({context:r,width:u,height:c,pixelFormat:o,source:{framebuffer:i(h)?h:r.defaultFramebuffer,xOffset:a,yOffset:l,width:u,height:c}});return d},r(f.prototype,{sampler:{get:function(){return this._sampler},set:function(e){var t=e.minificationFilter,r=e.magnificationFilter,n=t===m.NEAREST_MIPMAP_NEAREST||t===m.NEAREST_MIPMAP_LINEAR||t===m.LINEAR_MIPMAP_NEAREST||t===m.LINEAR_MIPMAP_LINEAR;this._pixelDatatype===h.FLOAT&&(t=n?m.NEAREST_MIPMAP_NEAREST:m.NEAREST,r=p.NEAREST);var o=this._context._gl,a=this._textureTarget;o.activeTexture(o.TEXTURE0),o.bindTexture(a,this._texture),o.texParameteri(a,o.TEXTURE_MIN_FILTER,t),o.texParameteri(a,o.TEXTURE_MAG_FILTER,r),o.texParameteri(a,o.TEXTURE_WRAP_S,e.wrapS),o.texParameteri(a,o.TEXTURE_WRAP_T,e.wrapT),i(this._textureFilterAnisotropic)&&o.texParameteri(a,this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,e.maximumAnisotropy),o.bindTexture(a,null),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},dimensions:{get:function(){return this._dimensions}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},_target:{get:function(){return this._textureTarget}}}),f.prototype.copyFrom=function(e,i,r){i=t(i,0),r=t(r,0);var n=this._context._gl,o=this._textureTarget;n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this._preMultiplyAlpha),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,this._flipY),n.activeTexture(n.TEXTURE0),n.bindTexture(o,this._texture),e.arrayBufferView?n.texSubImage2D(o,0,i,r,e.width,e.height,this._pixelFormat,this._pixelDatatype,e.arrayBufferView):n.texSubImage2D(o,0,i,r,this._pixelFormat,this._pixelDatatype,e),n.bindTexture(o,null)},f.prototype.copyFromFramebuffer=function(e,i,r,n,o,a){e=t(e,0),i=t(i,0),r=t(r,0),n=t(n,0),o=t(o,this._width),a=t(a,this._height);var s=this._context._gl,l=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(l,this._texture),s.copyTexSubImage2D(l,0,e,i,r,n,o,a),s.bindTexture(l,null)},f.prototype.generateMipmap=function(e){e=t(e,c.DONT_CARE);var i=this._context._gl,r=this._textureTarget;i.hint(i.GENERATE_MIPMAP_HINT,e),i.activeTexture(i.TEXTURE0),i.bindTexture(r,this._texture),i.generateMipmap(r),i.bindTexture(r,null)},f.prototype.isDestroyed=function(){return!1},f.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),n(this)},f}),i("Shaders/Materials/BumpMapMaterial",[],function(){"use strict";return"uniform sampler2D image;\nuniform float strength;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nvec2 centerPixel = fract(repeat * st);\nfloat centerBump = texture2D(image, centerPixel).channel;\nfloat imageWidth = float(imageDimensions.x);\nvec2 rightPixel = fract(repeat * (st + vec2(1.0 / imageWidth, 0.0)));\nfloat rightBump = texture2D(image, rightPixel).channel;\nfloat imageHeight = float(imageDimensions.y);\nvec2 leftPixel = fract(repeat * (st + vec2(0.0, 1.0 / imageHeight)));\nfloat topBump = texture2D(image, leftPixel).channel;\nvec3 normalTangentSpace = normalize(vec3(centerBump - rightBump, centerBump - topBump, clamp(1.0 - strength, 0.1, 1.0)));\nvec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace;\nmaterial.normal = normalEC;\nmaterial.diffuse = vec3(0.01);\nreturn material;\n}\n"}),i("Shaders/Materials/CheckerboardMaterial",[],function(){"use strict";return"uniform vec4 lightColor;\nuniform vec4 darkColor;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat b = mod(floor(repeat.s * st.s) + floor(repeat.t * st.t), 2.0);\nfloat scaledWidth = fract(repeat.s * st.s);\nscaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));\nfloat scaledHeight = fract(repeat.t * st.t);\nscaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));\nfloat value = min(scaledWidth, scaledHeight);\nvec4 currentColor = mix(lightColor, darkColor, b);\nvec4 color = czm_antialias(lightColor, darkColor, currentColor, value, 0.03);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n"}),i("Shaders/Materials/DotMaterial",[],function(){"use strict";return"uniform vec4 lightColor;\nuniform vec4 darkColor;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat b = smoothstep(0.3, 0.32, length(fract(repeat * materialInput.st) - 0.5));\nvec4 color = mix(lightColor, darkColor, b);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n"}),i("Shaders/Materials/FadeMaterial",[],function(){"use strict";return"uniform vec4 fadeInColor;\nuniform vec4 fadeOutColor;\nuniform float maximumDistance;\nuniform bool repeat;\nuniform vec2 fadeDirection;\nuniform vec2 time;\nfloat getTime(float t, float coord)\n{\nfloat scalar = 1.0 / maximumDistance;\nfloat q = distance(t, coord) * scalar;\nif (repeat)\n{\nfloat r = distance(t, coord + 1.0) * scalar;\nfloat s = distance(t, coord - 1.0) * scalar;\nq = min(min(r, s), q);\n}\nreturn clamp(q, 0.0, 1.0);\n}\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat s = getTime(time.x, st.s) * fadeDirection.s;\nfloat t = getTime(time.y, st.t) * fadeDirection.t;\nfloat u = length(vec2(s, t));\nvec4 color = mix(fadeInColor, fadeOutColor, u);\nmaterial.emission = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n"}),i("Shaders/Materials/GridMaterial",[],function(){"use strict";return"#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\nuniform vec4 color;\nuniform float cellAlpha;\nuniform vec2 lineCount;\nuniform vec2 lineThickness;\nuniform vec2 lineOffset;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat scaledWidth = fract(lineCount.s * st.s - lineOffset.s);\nscaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));\nfloat scaledHeight = fract(lineCount.t * st.t - lineOffset.t);\nscaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));\nfloat value;\n#ifdef GL_OES_standard_derivatives\nconst float fuzz = 1.2;\nvec2 thickness = (lineThickness * czm_resolutionScale) - 1.0;\nvec2 dx = abs(dFdx(st));\nvec2 dy = abs(dFdy(st));\nvec2 dF = vec2(max(dx.s, dy.s), max(dx.t, dy.t)) * lineCount;\nvalue = min(\nsmoothstep(dF.s * thickness.s, dF.s * (fuzz + thickness.s), scaledWidth),\nsmoothstep(dF.t * thickness.t, dF.t * (fuzz + thickness.t), scaledHeight));\n#else\nconst float fuzz = 0.05;\nvec2 range = 0.5 - (lineThickness * 0.05);\nvalue = min(\n1.0 - smoothstep(range.s, range.s + fuzz, scaledWidth),\n1.0 - smoothstep(range.t, range.t + fuzz, scaledHeight));\n#endif\nfloat dRim = 1.0 - abs(dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC)));\nfloat sRim = smoothstep(0.8, 1.0, dRim);\nvalue *= (1.0 - sRim);\nvec3 halfColor = color.rgb * 0.5;\nmaterial.diffuse = halfColor;\nmaterial.emission = halfColor;\nmaterial.alpha = color.a * (1.0 - ((1.0 - cellAlpha) * value));\nreturn material;\n}\n"}),i("Shaders/Materials/NormalMapMaterial",[],function(){"use strict";return"uniform sampler2D image;\nuniform float strength;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec4 textureValue = texture2D(image, fract(repeat * materialInput.st));\nvec3 normalTangentSpace = textureValue.channels;\nnormalTangentSpace.xy = normalTangentSpace.xy * 2.0 - 1.0;\nnormalTangentSpace.z = clamp(1.0 - strength, 0.1, 1.0);\nnormalTangentSpace = normalize(normalTangentSpace);\nvec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace;\nmaterial.normal = normalEC;\nreturn material;\n}\n"; -}),i("Shaders/Materials/PolylineArrowMaterial",[],function(){"use strict";return"#extension GL_OES_standard_derivatives : enable\nuniform vec4 color;\nvarying float v_width;\nfloat getPointOnLine(vec2 p0, vec2 p1, float x)\n{\nfloat slope = (p0.y - p1.y) / (p0.x - p1.x);\nreturn slope * (x - p0.x) + p0.y;\n}\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat base = 1.0 - abs(fwidth(st.s)) * 10.0;\nvec2 center = vec2(1.0, 0.5);\nfloat ptOnUpperLine = getPointOnLine(vec2(base, 1.0), center, st.s);\nfloat ptOnLowerLine = getPointOnLine(vec2(base, 0.0), center, st.s);\nfloat halfWidth = 0.15;\nfloat s = step(0.5 - halfWidth, st.t);\ns *= 1.0 - step(0.5 + halfWidth, st.t);\ns *= 1.0 - step(base, st.s);\nfloat t = step(base, materialInput.st.s);\nt *= 1.0 - step(ptOnUpperLine, st.t);\nt *= step(ptOnLowerLine, st.t);\nfloat dist;\nif (st.s < base)\n{\nfloat d1 = abs(st.t - (0.5 - halfWidth));\nfloat d2 = abs(st.t - (0.5 + halfWidth));\ndist = min(d1, d2);\n}\nelse\n{\nfloat d1 = czm_infinity;\nif (st.t < 0.5 - halfWidth && st.t > 0.5 + halfWidth)\n{\nd1 = abs(st.s - base);\n}\nfloat d2 = abs(st.t - ptOnUpperLine);\nfloat d3 = abs(st.t - ptOnLowerLine);\ndist = min(min(d1, d2), d3);\n}\nvec4 outsideColor = vec4(0.0);\nvec4 currentColor = mix(outsideColor, color, clamp(s + t, 0.0, 1.0));\nvec4 outColor = czm_antialias(outsideColor, color, currentColor, dist);\nmaterial.diffuse = outColor.rgb;\nmaterial.alpha = outColor.a;\nreturn material;\n}\n"}),i("Shaders/Materials/PolylineGlowMaterial",[],function(){"use strict";return"uniform vec4 color;\nuniform float glowPower;\nvarying float v_width;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat glow = glowPower / abs(st.t - 0.5) - (glowPower / 0.5);\nmaterial.emission = max(vec3(glow - 1.0 + color.rgb), color.rgb);\nmaterial.alpha = clamp(0.0, 1.0, glow) * color.a;\nreturn material;\n}\n"}),i("Shaders/Materials/PolylineOutlineMaterial",[],function(){"use strict";return"uniform vec4 color;\nuniform vec4 outlineColor;\nuniform float outlineWidth;\nvarying float v_width;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat halfInteriorWidth = 0.5 * (v_width - outlineWidth) / v_width;\nfloat b = step(0.5 - halfInteriorWidth, st.t);\nb *= 1.0 - step(0.5 + halfInteriorWidth, st.t);\nfloat d1 = abs(st.t - (0.5 - halfInteriorWidth));\nfloat d2 = abs(st.t - (0.5 + halfInteriorWidth));\nfloat dist = min(d1, d2);\nvec4 currentColor = mix(outlineColor, color, b);\nvec4 outColor = czm_antialias(outlineColor, color, currentColor, dist);\nmaterial.diffuse = outColor.rgb;\nmaterial.alpha = outColor.a;\nreturn material;\n}\n"}),i("Shaders/Materials/RimLightingMaterial",[],function(){"use strict";return"uniform vec4 color;\nuniform vec4 rimColor;\nuniform float width;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat d = 1.0 - dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC));\nfloat s = smoothstep(1.0 - width, 1.0, d);\nmaterial.diffuse = color.rgb;\nmaterial.emission = rimColor.rgb * s;\nmaterial.alpha = mix(color.a, rimColor.a, s);\nreturn material;\n}\n"}),i("Shaders/Materials/StripeMaterial",[],function(){"use strict";return"uniform vec4 evenColor;\nuniform vec4 oddColor;\nuniform float offset;\nuniform float repeat;\nuniform bool horizontal;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat coord = mix(materialInput.st.s, materialInput.st.t, float(horizontal));\nfloat value = fract((coord - offset) * (repeat * 0.5));\nfloat dist = min(value, min(abs(value - 0.5), 1.0 - value));\nvec4 currentColor = mix(evenColor, oddColor, step(0.5, value));\nvec4 color = czm_antialias(evenColor, oddColor, currentColor, dist);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n"}),i("Shaders/Materials/Water",[],function(){"use strict";return"uniform sampler2D specularMap;\nuniform sampler2D normalMap;\nuniform vec4 baseWaterColor;\nuniform vec4 blendColor;\nuniform float frequency;\nuniform float animationSpeed;\nuniform float amplitude;\nuniform float specularIntensity;\nuniform float fadeFactor;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat time = czm_frameNumber * animationSpeed;\nfloat fade = max(1.0, (length(materialInput.positionToEyeEC) / 10000000000.0) * frequency * fadeFactor);\nfloat specularMapValue = texture2D(specularMap, materialInput.st).r;\nvec4 noise = czm_getWaterNoise(normalMap, materialInput.st * frequency, time, 0.0);\nvec3 normalTangentSpace = noise.xyz * vec3(1.0, 1.0, (1.0 / amplitude));\nnormalTangentSpace.xy /= fade;\nnormalTangentSpace = mix(vec3(0.0, 0.0, 50.0), normalTangentSpace, specularMapValue);\nnormalTangentSpace = normalize(normalTangentSpace);\nfloat tsPerturbationRatio = clamp(dot(normalTangentSpace, vec3(0.0, 0.0, 1.0)), 0.0, 1.0);\nmaterial.alpha = specularMapValue;\nmaterial.diffuse = mix(blendColor.rgb, baseWaterColor.rgb, specularMapValue);\nmaterial.diffuse += (0.1 * tsPerturbationRatio);\nmaterial.normal = normalize(materialInput.tangentToEyeMatrix * normalTangentSpace);\nmaterial.specular = specularIntensity;\nmaterial.shininess = 10.0;\nreturn material;\n}\n"}),i("Scene/Material",["../Core/Cartesian2","../Core/clone","../Core/Color","../Core/combine","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/isArray","../Core/loadImage","../Core/Matrix2","../Core/Matrix3","../Core/Matrix4","../Renderer/CubeMap","../Renderer/Texture","../Shaders/Materials/BumpMapMaterial","../Shaders/Materials/CheckerboardMaterial","../Shaders/Materials/DotMaterial","../Shaders/Materials/FadeMaterial","../Shaders/Materials/GridMaterial","../Shaders/Materials/NormalMapMaterial","../Shaders/Materials/PolylineArrowMaterial","../Shaders/Materials/PolylineGlowMaterial","../Shaders/Materials/PolylineOutlineMaterial","../Shaders/Materials/RimLightingMaterial","../Shaders/Materials/StripeMaterial","../Shaders/Materials/Water","../ThirdParty/when"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A,P,D){"use strict";function M(e){this.type=void 0,this.shaderSource=void 0,this.materials=void 0,this.uniforms=void 0,this._uniforms=void 0,this.translucent=void 0,this._strict=void 0,this._template=void 0,this._count=void 0,this._texturePaths={},this._loadedImages=[],this._loadedCubeMaps=[],this._textures={},this._updateFunctions=[],this._defaultTexture=void 0,I(e,this),s(this,{type:{value:this.type,writable:!1}}),a(M._uniformList[this.type])||(M._uniformList[this.type]=Object.keys(this._uniforms))}function I(e,i){e=o(e,o.EMPTY_OBJECT),i._strict=o(e.strict,!1),i._count=o(e.count,0),i._template=t(o(e.fabric,o.EMPTY_OBJECT)),i._template.uniforms=t(o(i._template.uniforms,o.EMPTY_OBJECT)),i._template.materials=t(o(i._template.materials,o.EMPTY_OBJECT)),i.type=a(i._template.type)?i._template.type:n(),i.shaderSource="",i.materials={},i.uniforms={},i._uniforms={},i._translucentFunctions=[];var s,l=M._materialCache.getMaterial(i.type);if(a(l)){var u=t(l.fabric,!0);i._template=r(i._template,u,!0),s=l.translucent}L(i),a(l)||M._materialCache.addMaterial(i.type,i),B(i),k(i),G(i);var c=0===i._translucentFunctions.length||void 0;if(s=o(s,c),s=o(e.translucent,s),a(s))if("function"==typeof s){var h=function(){return s(i)};i._translucentFunctions.push(h)}else i._translucentFunctions.push(s)}function R(e,t,i,r){if(a(e))for(var n in e)if(e.hasOwnProperty(n)){var o=t.indexOf(n)!==-1;(r&&!o||!r&&o)&&i(n,t)}}function O(e,t){}function N(e,t){}function L(e){var t=e._template,i=t.uniforms,r=t.materials,n=t.components;R(t,q,O,!0),R(n,j,O,!0);var o=[];for(var a in r)r.hasOwnProperty(a)&&o.push(a);R(i,o,N,!1)}function B(e){var t=e._template.components,i=e._template.source;if(a(i))e.shaderSource+=i+"\n";else{if(e.shaderSource+="czm_material czm_getMaterial(czm_materialInput materialInput)\n{\n",e.shaderSource+="czm_material material = czm_getDefaultMaterial(materialInput);\n",a(t))for(var r in t)t.hasOwnProperty(r)&&(e.shaderSource+="material."+r+" = "+t[r]+";\n");e.shaderSource+="return material;\n}\n"}}function F(e){var t;return function(i,r){var n=i.uniforms,o=n[e],s=t!==o;t=o;var l,u,c=i._textures[e];if(o instanceof HTMLVideoElement)if(o.readyState>=2){if(s&&a(c)&&(c!==r.defaultTexture&&c.destroy(),c=void 0),!a(c)||c===r.defaultTexture)return c=new _({context:r,source:o}),void(i._textures[e]=c);c.copyFrom(o)}else a(c)||(i._textures[e]=r.defaultTexture);else{if(o instanceof _&&o!==c){i._texturePaths[e]=void 0;var d=i._textures[e];return d!==i._defaultTexture&&d.destroy(),i._textures[e]=o,l=e+"Dimensions",void(n.hasOwnProperty(l)&&(u=n[l],u.x=o._width,u.y=o._height))}a(c)||(i._texturePaths[e]=void 0,a(i._defaultTexture)||(i._defaultTexture=r.defaultTexture),c=i._textures[e]=i._defaultTexture,l=e+"Dimensions",n.hasOwnProperty(l)&&(u=n[l],u.x=c._width,u.y=c._height)),o!==M.DefaultImageId&&o!==i._texturePaths[e]&&("string"==typeof o?D(h(o),function(t){i._loadedImages.push({id:e,image:t})}):o instanceof HTMLCanvasElement&&i._loadedImages.push({id:e,image:o}),i._texturePaths[e]=o)}}}function V(e){return function(t,i){var r=t.uniforms[e];if(r instanceof f){var n=t._textures[e];return n!==t._defaultTexture&&n.destroy(),t._texturePaths[e]=void 0,void(t._textures[e]=r)}if(a(t._textures[e])||(t._texturePaths[e]=void 0,t._textures[e]=i.defaultCubeMap),r!==M.DefaultCubeMapId){var o=r.positiveX+r.negativeX+r.positiveY+r.negativeY+r.positiveZ+r.negativeZ;if(o!==t._texturePaths[e]){var s=[h(r.positiveX),h(r.negativeX),h(r.positiveY),h(r.negativeY),h(r.positiveZ),h(r.negativeZ)];D.all(s).then(function(i){t._loadedCubeMaps.push({id:e,images:i})}),t._texturePaths[e]=o}}}}function k(e){var t=e._template.uniforms;for(var i in t)t.hasOwnProperty(i)&&z(e,i)}function z(e,t){var i,r=(e._strict,e._template.uniforms),n=r[t],o=U(n);if("channels"===o)i=W(e,t,n,!1);else{if("sampler2D"===o){var a=t+"Dimensions";H(e,a)>0&&(r[a]={type:"ivec3",x:1,y:1},z(e,a))}var s=new RegExp("uniform\\s+"+o+"\\s+"+t+"\\s*;");if(!s.test(e.shaderSource)){var l="uniform "+o+" "+t+";";e.shaderSource=l+e.shaderSource}var u=t+"_"+e._count++;if(i=W(e,t,u),e.uniforms[t]=n,"sampler2D"===o)e._uniforms[u]=function(){return e._textures[t]},e._updateFunctions.push(F(t));else if("samplerCube"===o)e._uniforms[u]=function(){return e._textures[t]},e._updateFunctions.push(V(t));else if(o.indexOf("mat")!==-1){var c=new Y[o];e._uniforms[u]=function(){return Y[o].fromColumnMajorArray(e.uniforms[t],c)}}else e._uniforms[u]=function(){return e.uniforms[t]}}}function U(e){var t=e.type;if(!a(t)){var i=typeof e;if("number"===i)t="float";else if("boolean"===i)t="bool";else if("string"===i||e instanceof HTMLCanvasElement)t=/^([rgba]){1,4}$/i.test(e)?"channels":e===M.DefaultCubeMapId?"samplerCube":"sampler2D";else if("object"===i)if(c(e))4!==e.length&&9!==e.length&&16!==e.length||(t="mat"+Math.sqrt(e.length));else{var r=0;for(var n in e)e.hasOwnProperty(n)&&(r+=1);r>=2&&r<=4?t="vec"+r:6===r&&(t="samplerCube")}}return t}function G(e){var t=e._strict,i=e._template.materials;for(var n in i)if(i.hasOwnProperty(n)){var o=new M({strict:t,fabric:i[n],count:e._count});e._count=o._count,e._uniforms=r(e._uniforms,o._uniforms,!0),e.materials[n]=o,e._translucentFunctions=e._translucentFunctions.concat(o._translucentFunctions);var a="czm_getMaterial",s=a+"_"+e._count++;W(o,a,s),e.shaderSource=o.shaderSource+e.shaderSource;var l=s+"(materialInput)";W(e,n,l)}}function W(e,t,i,r){r=o(r,!0);var n=0,a="([\\w])?",s="([\\w"+(r?".":"")+"])?",l=new RegExp(s+t+a,"g");return e.shaderSource=e.shaderSource.replace(l,function(e,t,r){return t||r?e:(n+=1,i)}),n}function H(e,t,i){return W(e,t,t,i)}M._uniformList={},M.fromType=function(e,t){var i=new M({fabric:{type:e}});if(a(t))for(var r in t)t.hasOwnProperty(r)&&(i.uniforms[r]=t[r]);return i},M.prototype.isTranslucent=function(){if(a(this.translucent))return"function"==typeof this.translucent?this.translucent():this.translucent;for(var e=!0,t=this._translucentFunctions,i=t.length,r=0;r0&&console.log(C+"Vertex shader compile log: "+h)),f&&(h=e.getShaderInfoLog(s),t(h)&&h.length>0&&console.log(C+"Fragment shader compile log: "+h)),f&&(h=e.getProgramInfoLog(l),t(h)&&h.length>0&&console.log(C+"Shader program link log: "+h)),l}function m(e,t,i){for(var r={},n=0;n=0){if(f=r[d.slice(0,y)],!t(f))continue;_=f._locations,_.length<=1&&(g=f.value,v=e.getUniformLocation(i,d),null!==v&&(_.push(v),g.push(e.getUniform(i,v))))}else{_=[];for(var C=0;C czm_piOverTwo)\n{\nif (angle < 0.0)\n{\nreturn -cordic(angle + czm_pi);\n}\nelse\n{\nreturn -cordic(angle - czm_pi);\n}\n}\nelse\n{\nreturn cordic(angle);\n}\n}\n"}),i("Shaders/Builtin/Functions/decompressTextureCoordinates",[],function(){"use strict";return"vec2 czm_decompressTextureCoordinates(float encoded)\n{\nfloat temp = encoded / 4096.0;\nfloat xZeroTo4095 = floor(temp);\nfloat stx = xZeroTo4095 / 4095.0;\nfloat sty = (encoded - xZeroTo4095 * 4096.0) / 4095.0;\nreturn vec2(stx, sty);\n}\n"}),i("Shaders/Builtin/Functions/eastNorthUpToEyeCoordinates",[],function(){"use strict";return"mat3 czm_eastNorthUpToEyeCoordinates(vec3 positionMC, vec3 normalEC)\n{\nvec3 tangentMC = normalize(vec3(-positionMC.y, positionMC.x, 0.0));\nvec3 tangentEC = normalize(czm_normal3D * tangentMC);\nvec3 bitangentEC = normalize(cross(normalEC, tangentEC));\nreturn mat3(\ntangentEC.x, tangentEC.y, tangentEC.z,\nbitangentEC.x, bitangentEC.y, bitangentEC.z,\nnormalEC.x, normalEC.y, normalEC.z);\n}\n"}),i("Shaders/Builtin/Functions/ellipsoidContainsPoint",[],function(){"use strict";return"bool czm_ellipsoidContainsPoint(czm_ellipsoid ellipsoid, vec3 point)\n{\nvec3 scaled = ellipsoid.inverseRadii * (czm_inverseModelView * vec4(point, 1.0)).xyz;\nreturn (dot(scaled, scaled) <= 1.0);\n}\n"}),i("Shaders/Builtin/Functions/ellipsoidNew",[],function(){"use strict";return"czm_ellipsoid czm_ellipsoidNew(vec3 center, vec3 radii)\n{\nvec3 inverseRadii = vec3(1.0 / radii.x, 1.0 / radii.y, 1.0 / radii.z);\nvec3 inverseRadiiSquared = inverseRadii * inverseRadii;\nczm_ellipsoid temp = czm_ellipsoid(center, radii, inverseRadii, inverseRadiiSquared);\nreturn temp;\n}\n"}),i("Shaders/Builtin/Functions/ellipsoidWgs84TextureCoordinates",[],function(){"use strict";return"vec2 czm_ellipsoidWgs84TextureCoordinates(vec3 normal)\n{\nreturn vec2(atan(normal.y, normal.x) * czm_oneOverTwoPi + 0.5, asin(normal.z) * czm_oneOverPi + 0.5);\n}\n"}),i("Shaders/Builtin/Functions/equalsEpsilon",[],function(){"use strict";return"bool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon) {\nreturn all(lessThanEqual(abs(left - right), vec4(epsilon)));\n}\nbool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon) {\nreturn all(lessThanEqual(abs(left - right), vec3(epsilon)));\n}\nbool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon) {\nreturn all(lessThanEqual(abs(left - right), vec2(epsilon)));\n}\nbool czm_equalsEpsilon(float left, float right, float epsilon) {\nreturn (abs(left - right) <= epsilon);\n}\n"}),i("Shaders/Builtin/Functions/eyeOffset",[],function(){"use strict";return"vec4 czm_eyeOffset(vec4 positionEC, vec3 eyeOffset)\n{\nvec4 p = positionEC;\nvec4 zEyeOffset = normalize(p) * eyeOffset.z;\np.xy += eyeOffset.xy + zEyeOffset.xy;\np.z += zEyeOffset.z;\nreturn p;\n}\n"}),i("Shaders/Builtin/Functions/eyeToWindowCoordinates",[],function(){"use strict";return"vec4 czm_eyeToWindowCoordinates(vec4 positionEC)\n{\nvec4 q = czm_projection * positionEC;\nq.xyz /= q.w;\nq.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz;\nreturn q;\n}\n"}),i("Shaders/Builtin/Functions/fog",[],function(){"use strict";return"vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor)\n{\nfloat scalar = distanceToCamera * czm_fogDensity;\nfloat fog = 1.0 - exp(-(scalar * scalar));\nreturn mix(color, fogColor, fog);\n}\n"}),i("Shaders/Builtin/Functions/geodeticSurfaceNormal",[],function(){"use strict";return"vec3 czm_geodeticSurfaceNormal(vec3 positionOnEllipsoid, vec3 ellipsoidCenter, vec3 oneOverEllipsoidRadiiSquared)\n{\nreturn normalize((positionOnEllipsoid - ellipsoidCenter) * oneOverEllipsoidRadiiSquared);\n}\n"}),i("Shaders/Builtin/Functions/getDefaultMaterial",[],function(){"use strict";return"czm_material czm_getDefaultMaterial(czm_materialInput materialInput)\n{\nczm_material material;\nmaterial.diffuse = vec3(0.0);\nmaterial.specular = 0.0;\nmaterial.shininess = 1.0;\nmaterial.normal = materialInput.normalEC;\nmaterial.emission = vec3(0.0);\nmaterial.alpha = 1.0;\nreturn material;\n}\n"}),i("Shaders/Builtin/Functions/getLambertDiffuse",[],function(){"use strict";return"float czm_getLambertDiffuse(vec3 lightDirectionEC, vec3 normalEC)\n{\nreturn max(dot(lightDirectionEC, normalEC), 0.0);\n}\n"}),i("Shaders/Builtin/Functions/getSpecular",[],function(){"use strict";return"float czm_getSpecular(vec3 lightDirectionEC, vec3 toEyeEC, vec3 normalEC, float shininess)\n{\nvec3 toReflectedLight = reflect(-lightDirectionEC, normalEC);\nfloat specular = max(dot(toReflectedLight, toEyeEC), 0.0);\nreturn pow(specular, max(shininess, czm_epsilon2));\n}\n"}),i("Shaders/Builtin/Functions/getWaterNoise",[],function(){"use strict";return"vec4 czm_getWaterNoise(sampler2D normalMap, vec2 uv, float time, float angleInRadians)\n{\nfloat cosAngle = cos(angleInRadians);\nfloat sinAngle = sin(angleInRadians);\nvec2 s0 = vec2(1.0/17.0, 0.0);\nvec2 s1 = vec2(-1.0/29.0, 0.0);\nvec2 s2 = vec2(1.0/101.0, 1.0/59.0);\nvec2 s3 = vec2(-1.0/109.0, -1.0/57.0);\ns0 = vec2((cosAngle * s0.x) - (sinAngle * s0.y), (sinAngle * s0.x) + (cosAngle * s0.y));\ns1 = vec2((cosAngle * s1.x) - (sinAngle * s1.y), (sinAngle * s1.x) + (cosAngle * s1.y));\ns2 = vec2((cosAngle * s2.x) - (sinAngle * s2.y), (sinAngle * s2.x) + (cosAngle * s2.y));\ns3 = vec2((cosAngle * s3.x) - (sinAngle * s3.y), (sinAngle * s3.x) + (cosAngle * s3.y));\nvec2 uv0 = (uv/103.0) + (time * s0);\nvec2 uv1 = uv/107.0 + (time * s1) + vec2(0.23);\nvec2 uv2 = uv/vec2(897.0, 983.0) + (time * s2) + vec2(0.51);\nvec2 uv3 = uv/vec2(991.0, 877.0) + (time * s3) + vec2(0.71);\nuv0 = fract(uv0);\nuv1 = fract(uv1);\nuv2 = fract(uv2);\nuv3 = fract(uv3);\nvec4 noise = (texture2D(normalMap, uv0)) +\n(texture2D(normalMap, uv1)) +\n(texture2D(normalMap, uv2)) +\n(texture2D(normalMap, uv3));\nreturn ((noise / 4.0) - 0.5) * 2.0;\n}\n"}),i("Shaders/Builtin/Functions/getWgs84EllipsoidEC",[],function(){"use strict";return"czm_ellipsoid czm_getWgs84EllipsoidEC()\n{\nvec3 radii = vec3(6378137.0, 6378137.0, 6356752.314245);\nvec3 inverseRadii = vec3(1.0 / radii.x, 1.0 / radii.y, 1.0 / radii.z);\nvec3 inverseRadiiSquared = inverseRadii * inverseRadii;\nczm_ellipsoid temp = czm_ellipsoid(czm_view[3].xyz, radii, inverseRadii, inverseRadiiSquared);\nreturn temp;\n}\n"}),i("Shaders/Builtin/Functions/hue",[],function(){"use strict";return"vec3 czm_hue(vec3 rgb, float adjustment)\n{\nconst mat3 toYIQ = mat3(0.299, 0.587, 0.114,\n0.595716, -0.274453, -0.321263,\n0.211456, -0.522591, 0.311135);\nconst mat3 toRGB = mat3(1.0, 0.9563, 0.6210,\n1.0, -0.2721, -0.6474,\n1.0, -1.107, 1.7046);\nvec3 yiq = toYIQ * rgb;\nfloat hue = atan(yiq.z, yiq.y) + adjustment;\nfloat chroma = sqrt(yiq.z * yiq.z + yiq.y * yiq.y);\nvec3 color = vec3(yiq.x, chroma * cos(hue), chroma * sin(hue));\nreturn toRGB * color;\n}\n"}),i("Shaders/Builtin/Functions/isEmpty",[],function(){"use strict";return"bool czm_isEmpty(czm_raySegment interval)\n{\nreturn (interval.stop < 0.0);\n}\n"}),i("Shaders/Builtin/Functions/isFull",[],function(){"use strict";return"bool czm_isFull(czm_raySegment interval)\n{\nreturn (interval.start == 0.0 && interval.stop == czm_infinity);\n}\n"}),i("Shaders/Builtin/Functions/latitudeToWebMercatorFraction",[],function(){"use strict";return"float czm_latitudeToWebMercatorFraction(float latitude, float southMercatorY, float oneOverMercatorHeight)\n{\nfloat sinLatitude = sin(latitude);\nfloat mercatorY = 0.5 * log((1.0 + sinLatitude) / (1.0 - sinLatitude));\nreturn (mercatorY - southMercatorY) * oneOverMercatorHeight;\n}\n"}),i("Shaders/Builtin/Functions/luminance",[],function(){"use strict";return"float czm_luminance(vec3 rgb)\n{\nconst vec3 W = vec3(0.2125, 0.7154, 0.0721);\nreturn dot(rgb, W);\n}\n"}),i("Shaders/Builtin/Functions/metersPerPixel",[],function(){"use strict";return"float czm_metersPerPixel(vec4 positionEC)\n{\nfloat width = czm_viewport.z;\nfloat height = czm_viewport.w;\nfloat pixelWidth;\nfloat pixelHeight;\nfloat top = czm_frustumPlanes.x;\nfloat bottom = czm_frustumPlanes.y;\nfloat left = czm_frustumPlanes.z;\nfloat right = czm_frustumPlanes.w;\nif (czm_sceneMode == czm_sceneMode2D)\n{\nfloat frustumWidth = right - left;\nfloat frustumHeight = top - bottom;\npixelWidth = frustumWidth / width;\npixelHeight = frustumHeight / height;\n}\nelse\n{\nfloat distanceToPixel = -positionEC.z;\nfloat inverseNear = 1.0 / czm_currentFrustum.x;\nfloat tanTheta = top * inverseNear;\npixelHeight = 2.0 * distanceToPixel * tanTheta / height;\ntanTheta = right * inverseNear;\npixelWidth = 2.0 * distanceToPixel * tanTheta / width;\n}\nreturn max(pixelWidth, pixelHeight);\n}\n"}),i("Shaders/Builtin/Functions/modelToWindowCoordinates",[],function(){"use strict";return"vec4 czm_modelToWindowCoordinates(vec4 position)\n{\nvec4 q = czm_modelViewProjection * position;\nq.xyz /= q.w;\nq.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz;\nreturn q;\n}\n"}),i("Shaders/Builtin/Functions/multiplyWithColorBalance",[],function(){"use strict";return"vec3 czm_multiplyWithColorBalance(vec3 left, vec3 right)\n{\nconst vec3 W = vec3(0.2125, 0.7154, 0.0721);\nvec3 target = left * right;\nfloat leftLuminance = dot(left, W);\nfloat rightLuminance = dot(right, W);\nfloat targetLuminance = dot(target, W);\nreturn ((leftLuminance + rightLuminance) / (2.0 * targetLuminance)) * target;\n}\n"}),i("Shaders/Builtin/Functions/nearFarScalar",[],function(){"use strict";return"float czm_nearFarScalar(vec4 nearFarScalar, float cameraDistSq)\n{\nfloat valueAtMin = nearFarScalar.y;\nfloat valueAtMax = nearFarScalar.w;\nfloat nearDistanceSq = nearFarScalar.x * nearFarScalar.x;\nfloat farDistanceSq = nearFarScalar.z * nearFarScalar.z;\nfloat t = (cameraDistSq - nearDistanceSq) / (farDistanceSq - nearDistanceSq);\nt = pow(clamp(t, 0.0, 1.0), 0.2);\nreturn mix(valueAtMin, valueAtMax, t);\n}\n"}),i("Shaders/Builtin/Functions/octDecode",[],function(){"use strict";return"vec3 czm_octDecode(vec2 encoded)\n{\nencoded = encoded / 255.0 * 2.0 - 1.0;\nvec3 v = vec3(encoded.x, encoded.y, 1.0 - abs(encoded.x) - abs(encoded.y));\nif (v.z < 0.0)\n{\nv.xy = (1.0 - abs(v.yx)) * czm_signNotZero(v.xy);\n}\nreturn normalize(v);\n}\nvec3 czm_octDecode(float encoded)\n{\nfloat temp = encoded / 256.0;\nfloat x = floor(temp);\nfloat y = (temp - x) * 256.0;\nreturn czm_octDecode(vec2(x, y));\n}\nvoid czm_octDecode(vec2 encoded, out vec3 vector1, out vec3 vector2, out vec3 vector3)\n{\nfloat temp = encoded.x / 65536.0;\nfloat x = floor(temp);\nfloat encodedFloat1 = (temp - x) * 65536.0;\ntemp = encoded.y / 65536.0;\nfloat y = floor(temp);\nfloat encodedFloat2 = (temp - y) * 65536.0;\nvector1 = czm_octDecode(encodedFloat1);\nvector2 = czm_octDecode(encodedFloat2);\nvector3 = czm_octDecode(vec2(x, y));\n}\n"}),i("Shaders/Builtin/Functions/packDepth",[],function(){"use strict";return"vec4 czm_packDepth(float depth)\n{\nvec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * depth;\nenc = fract(enc);\nenc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\nreturn enc;\n}\n"}),i("Shaders/Builtin/Functions/phong",[],function(){"use strict";return"float czm_private_getLambertDiffuseOfMaterial(vec3 lightDirectionEC, czm_material material)\n{\nreturn czm_getLambertDiffuse(lightDirectionEC, material.normal);\n}\nfloat czm_private_getSpecularOfMaterial(vec3 lightDirectionEC, vec3 toEyeEC, czm_material material)\n{\nreturn czm_getSpecular(lightDirectionEC, toEyeEC, material.normal, material.shininess);\n}\nvec4 czm_phong(vec3 toEye, czm_material material)\n{\nfloat diffuse = czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 0.0, 1.0), material);\nif (czm_sceneMode == czm_sceneMode3D) {\ndiffuse += czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 1.0, 0.0), material);\n}\nfloat specular = czm_private_getSpecularOfMaterial(czm_sunDirectionEC, toEye, material) + czm_private_getSpecularOfMaterial(czm_moonDirectionEC, toEye, material);\nvec3 materialDiffuse = material.diffuse * 0.5;\nvec3 ambient = materialDiffuse;\nvec3 color = ambient + material.emission;\ncolor += materialDiffuse * diffuse;\ncolor += material.specular * specular;\nreturn vec4(color, material.alpha);\n}\nvec4 czm_private_phong(vec3 toEye, czm_material material)\n{\nfloat diffuse = czm_private_getLambertDiffuseOfMaterial(czm_sunDirectionEC, material);\nfloat specular = czm_private_getSpecularOfMaterial(czm_sunDirectionEC, toEye, material);\nvec3 ambient = vec3(0.0);\nvec3 color = ambient + material.emission;\ncolor += material.diffuse * diffuse;\ncolor += material.specular * specular;\nreturn vec4(color, material.alpha);\n}\n"}),i("Shaders/Builtin/Functions/pointAlongRay",[],function(){"use strict";return"vec3 czm_pointAlongRay(czm_ray ray, float time)\n{\nreturn ray.origin + (time * ray.direction);\n}\n"}),i("Shaders/Builtin/Functions/rayEllipsoidIntersectionInterval",[],function(){"use strict";return"czm_raySegment czm_rayEllipsoidIntersectionInterval(czm_ray ray, czm_ellipsoid ellipsoid)\n{\nvec3 q = ellipsoid.inverseRadii * (czm_inverseModelView * vec4(ray.origin, 1.0)).xyz;\nvec3 w = ellipsoid.inverseRadii * (czm_inverseModelView * vec4(ray.direction, 0.0)).xyz;\nq = q - ellipsoid.inverseRadii * (czm_inverseModelView * vec4(ellipsoid.center, 1.0)).xyz;\nfloat q2 = dot(q, q);\nfloat qw = dot(q, w);\nif (q2 > 1.0)\n{\nif (qw >= 0.0)\n{\nreturn czm_emptyRaySegment;\n}\nelse\n{\nfloat qw2 = qw * qw;\nfloat difference = q2 - 1.0;\nfloat w2 = dot(w, w);\nfloat product = w2 * difference;\nif (qw2 < product)\n{\nreturn czm_emptyRaySegment;\n}\nelse if (qw2 > product)\n{\nfloat discriminant = qw * qw - product;\nfloat temp = -qw + sqrt(discriminant);\nfloat root0 = temp / w2;\nfloat root1 = difference / temp;\nif (root0 < root1)\n{\nczm_raySegment i = czm_raySegment(root0, root1);\nreturn i;\n}\nelse\n{\nczm_raySegment i = czm_raySegment(root1, root0);\nreturn i;\n}\n}\nelse\n{\nfloat root = sqrt(difference / w2);\nczm_raySegment i = czm_raySegment(root, root);\nreturn i;\n}\n}\n}\nelse if (q2 < 1.0)\n{\nfloat difference = q2 - 1.0;\nfloat w2 = dot(w, w);\nfloat product = w2 * difference;\nfloat discriminant = qw * qw - product;\nfloat temp = -qw + sqrt(discriminant);\nczm_raySegment i = czm_raySegment(0.0, temp / w2);\nreturn i;\n}\nelse\n{\nif (qw < 0.0)\n{\nfloat w2 = dot(w, w);\nczm_raySegment i = czm_raySegment(0.0, -qw / w2);\nreturn i;\n}\nelse\n{\nreturn czm_emptyRaySegment;\n}\n}\n}\n"}),i("Shaders/Builtin/Functions/RGBToXYZ",[],function(){"use strict";return"vec3 czm_RGBToXYZ(vec3 rgb)\n{\nconst mat3 RGB2XYZ = mat3(0.4124, 0.2126, 0.0193,\n0.3576, 0.7152, 0.1192,\n0.1805, 0.0722, 0.9505);\nvec3 xyz = RGB2XYZ * rgb;\nvec3 Yxy;\nYxy.r = xyz.g;\nfloat temp = dot(vec3(1.0), xyz);\nYxy.gb = xyz.rg / temp;\nreturn Yxy;\n}\n"}),i("Shaders/Builtin/Functions/saturation",[],function(){"use strict";return"vec3 czm_saturation(vec3 rgb, float adjustment)\n{\nconst vec3 W = vec3(0.2125, 0.7154, 0.0721);\nvec3 intensity = vec3(dot(rgb, W));\nreturn mix(intensity, rgb, adjustment);\n}\n"}),i("Shaders/Builtin/Functions/shadowDepthCompare",[],function(){"use strict";return"float czm_sampleShadowMap(samplerCube shadowMap, vec3 d)\n{\nreturn czm_unpackDepth(textureCube(shadowMap, d));\n}\nfloat czm_sampleShadowMap(sampler2D shadowMap, vec2 uv)\n{\n#ifdef USE_SHADOW_DEPTH_TEXTURE\nreturn texture2D(shadowMap, uv).r;\n#else\nreturn czm_unpackDepth(texture2D(shadowMap, uv));\n#endif\n}\nfloat czm_shadowDepthCompare(samplerCube shadowMap, vec3 uv, float depth)\n{\nreturn step(depth, czm_sampleShadowMap(shadowMap, uv));\n}\nfloat czm_shadowDepthCompare(sampler2D shadowMap, vec2 uv, float depth)\n{\nreturn step(depth, czm_sampleShadowMap(shadowMap, uv));\n}\n"}),i("Shaders/Builtin/Functions/shadowVisibility",[],function(){"use strict";return"float czm_private_shadowVisibility(float visibility, float nDotL, float normalShadingSmooth, float darkness)\n{\n#ifdef USE_NORMAL_SHADING\n#ifdef USE_NORMAL_SHADING_SMOOTH\nfloat strength = clamp(nDotL / normalShadingSmooth, 0.0, 1.0);\n#else\nfloat strength = step(0.0, nDotL);\n#endif\nvisibility *= strength;\n#endif\nvisibility = max(visibility, darkness);\nreturn visibility;\n}\n#ifdef USE_CUBE_MAP_SHADOW\nfloat czm_shadowVisibility(samplerCube shadowMap, czm_shadowParameters shadowParameters)\n{\nfloat depthBias = shadowParameters.depthBias;\nfloat depth = shadowParameters.depth;\nfloat nDotL = shadowParameters.nDotL;\nfloat normalShadingSmooth = shadowParameters.normalShadingSmooth;\nfloat darkness = shadowParameters.darkness;\nvec3 uvw = shadowParameters.texCoords;\ndepth -= depthBias;\nfloat visibility = czm_shadowDepthCompare(shadowMap, uvw, depth);\nreturn czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness);\n}\n#else\nfloat czm_shadowVisibility(sampler2D shadowMap, czm_shadowParameters shadowParameters)\n{\nfloat depthBias = shadowParameters.depthBias;\nfloat depth = shadowParameters.depth;\nfloat nDotL = shadowParameters.nDotL;\nfloat normalShadingSmooth = shadowParameters.normalShadingSmooth;\nfloat darkness = shadowParameters.darkness;\nvec2 uv = shadowParameters.texCoords;\ndepth -= depthBias;\n#ifdef USE_SOFT_SHADOWS\nvec2 texelStepSize = shadowParameters.texelStepSize;\nfloat radius = 1.0;\nfloat dx0 = -texelStepSize.x * radius;\nfloat dy0 = -texelStepSize.y * radius;\nfloat dx1 = texelStepSize.x * radius;\nfloat dy1 = texelStepSize.y * radius;\nfloat visibility = (\nczm_shadowDepthCompare(shadowMap, uv, depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy0), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy0), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy0), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx0, 0.0), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx1, 0.0), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy1), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy1), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy1), depth)\n) * (1.0 / 9.0);\n#else\nfloat visibility = czm_shadowDepthCompare(shadowMap, uv, depth);\n#endif\nreturn czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness);\n}\n#endif\n"}),i("Shaders/Builtin/Functions/signNotZero",[],function(){"use strict";return"float czm_signNotZero(float value)\n{\nreturn value >= 0.0 ? 1.0 : -1.0;\n}\nvec2 czm_signNotZero(vec2 value)\n{\nreturn vec2(czm_signNotZero(value.x), czm_signNotZero(value.y));\n}\nvec3 czm_signNotZero(vec3 value)\n{\nreturn vec3(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z));\n}\nvec4 czm_signNotZero(vec4 value)\n{\nreturn vec4(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z), czm_signNotZero(value.w));\n}\n"}),i("Shaders/Builtin/Functions/tangentToEyeSpaceMatrix",[],function(){"use strict";return"mat3 czm_tangentToEyeSpaceMatrix(vec3 normalEC, vec3 tangentEC, vec3 binormalEC)\n{\nvec3 normal = normalize(normalEC);\nvec3 tangent = normalize(tangentEC);\nvec3 binormal = normalize(binormalEC);\nreturn mat3(tangent.x, tangent.y, tangent.z,\nbinormal.x, binormal.y, binormal.z,\nnormal.x, normal.y, normal.z);\n}\n"}),i("Shaders/Builtin/Functions/translateRelativeToEye",[],function(){"use strict";return"vec4 czm_translateRelativeToEye(vec3 high, vec3 low)\n{\nvec3 highDifference = high - czm_encodedCameraPositionMCHigh;\nvec3 lowDifference = low - czm_encodedCameraPositionMCLow;\nreturn vec4(highDifference + lowDifference, 1.0);\n}\n"}),i("Shaders/Builtin/Functions/translucentPhong",[],function(){"use strict";return"vec4 czm_translucentPhong(vec3 toEye, czm_material material)\n{\nfloat diffuse = czm_getLambertDiffuse(vec3(0.0, 0.0, 1.0), material.normal);\nif (czm_sceneMode == czm_sceneMode3D) {\ndiffuse += czm_getLambertDiffuse(vec3(0.0, 1.0, 0.0), material.normal);\n}\ndiffuse = clamp(diffuse, 0.0, 1.0);\nfloat specular = czm_getSpecular(czm_sunDirectionEC, toEye, material.normal, material.shininess);\nspecular += czm_getSpecular(czm_moonDirectionEC, toEye, material.normal, material.shininess);\nvec3 materialDiffuse = material.diffuse * 0.5;\nvec3 ambient = materialDiffuse;\nvec3 color = ambient + material.emission;\ncolor += materialDiffuse * diffuse;\ncolor += material.specular * specular;\nreturn vec4(color, material.alpha);\n}\n"}),i("Shaders/Builtin/Functions/transpose",[],function(){"use strict";return"mat2 czm_transpose(mat2 matrix)\n{\nreturn mat2(\nmatrix[0][0], matrix[1][0],\nmatrix[0][1], matrix[1][1]);\n}\nmat3 czm_transpose(mat3 matrix)\n{\nreturn mat3(\nmatrix[0][0], matrix[1][0], matrix[2][0],\nmatrix[0][1], matrix[1][1], matrix[2][1],\nmatrix[0][2], matrix[1][2], matrix[2][2]);\n}\nmat4 czm_transpose(mat4 matrix)\n{\nreturn mat4(\nmatrix[0][0], matrix[1][0], matrix[2][0], matrix[3][0],\nmatrix[0][1], matrix[1][1], matrix[2][1], matrix[3][1],\nmatrix[0][2], matrix[1][2], matrix[2][2], matrix[3][2],\nmatrix[0][3], matrix[1][3], matrix[2][3], matrix[3][3]);\n}\n"}),i("Shaders/Builtin/Functions/unpackDepth",[],function(){"use strict";return"float czm_unpackDepth(vec4 packedDepth)\n{\nreturn dot(packedDepth, vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0));\n}\n"}),i("Shaders/Builtin/Functions/windowToEyeCoordinates",[],function(){"use strict";return"vec4 czm_windowToEyeCoordinates(vec4 fragmentCoordinate)\n{\nfloat x = 2.0 * (fragmentCoordinate.x - czm_viewport.x) / czm_viewport.z - 1.0;\nfloat y = 2.0 * (fragmentCoordinate.y - czm_viewport.y) / czm_viewport.w - 1.0;\nfloat z = (fragmentCoordinate.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];\nvec4 q = vec4(x, y, z, 1.0);\nq /= fragmentCoordinate.w;\nq = czm_inverseProjection * q;\nreturn q;\n}\n"}),i("Shaders/Builtin/Functions/XYZToRGB",[],function(){"use strict";return"vec3 czm_XYZToRGB(vec3 Yxy)\n{\nconst mat3 XYZ2RGB = mat3( 3.2405, -0.9693, 0.0556,\n-1.5371, 1.8760, -0.2040,\n-0.4985, 0.0416, 1.0572);\nvec3 xyz;\nxyz.r = Yxy.r * Yxy.g / Yxy.b;\nxyz.g = Yxy.r;\nxyz.b = Yxy.r * (1.0 - Yxy.g - Yxy.b) / Yxy.b;\nreturn XYZ2RGB * xyz;\n}\n"}),i("Shaders/Builtin/CzmBuiltins",["./Constants/degreesPerRadian","./Constants/depthRange","./Constants/epsilon1","./Constants/epsilon2","./Constants/epsilon3","./Constants/epsilon4","./Constants/epsilon5","./Constants/epsilon6","./Constants/epsilon7","./Constants/infinity","./Constants/oneOverPi","./Constants/oneOverTwoPi","./Constants/passCompute","./Constants/passEnvironment","./Constants/passGlobe","./Constants/passGround","./Constants/passOpaque","./Constants/passOverlay","./Constants/passTranslucent","./Constants/pi","./Constants/piOverFour","./Constants/piOverSix","./Constants/piOverThree","./Constants/piOverTwo","./Constants/radiansPerDegree","./Constants/sceneMode2D","./Constants/sceneMode3D","./Constants/sceneModeColumbusView","./Constants/sceneModeMorphing","./Constants/solarRadius","./Constants/threePiOver2","./Constants/twoPi","./Constants/webMercatorMaxLatitude","./Structs/depthRangeStruct","./Structs/ellipsoid","./Structs/material","./Structs/materialInput","./Structs/ray","./Structs/raySegment","./Structs/shadowParameters","./Functions/alphaWeight","./Functions/antialias","./Functions/cascadeColor","./Functions/cascadeDistance","./Functions/cascadeMatrix","./Functions/cascadeWeights","./Functions/columbusViewMorph","./Functions/computePosition","./Functions/cosineAndSine","./Functions/decompressTextureCoordinates","./Functions/eastNorthUpToEyeCoordinates","./Functions/ellipsoidContainsPoint","./Functions/ellipsoidNew","./Functions/ellipsoidWgs84TextureCoordinates","./Functions/equalsEpsilon","./Functions/eyeOffset","./Functions/eyeToWindowCoordinates","./Functions/fog","./Functions/geodeticSurfaceNormal","./Functions/getDefaultMaterial","./Functions/getLambertDiffuse","./Functions/getSpecular","./Functions/getWaterNoise","./Functions/getWgs84EllipsoidEC","./Functions/hue","./Functions/isEmpty","./Functions/isFull","./Functions/latitudeToWebMercatorFraction","./Functions/luminance","./Functions/metersPerPixel","./Functions/modelToWindowCoordinates","./Functions/multiplyWithColorBalance","./Functions/nearFarScalar","./Functions/octDecode","./Functions/packDepth","./Functions/phong","./Functions/pointAlongRay","./Functions/rayEllipsoidIntersectionInterval","./Functions/RGBToXYZ","./Functions/saturation","./Functions/shadowDepthCompare","./Functions/shadowVisibility","./Functions/signNotZero","./Functions/tangentToEyeSpaceMatrix","./Functions/translateRelativeToEye","./Functions/translucentPhong","./Functions/transpose","./Functions/unpackDepth","./Functions/windowToEyeCoordinates","./Functions/XYZToRGB"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I,R,O,N,L,B,F,V,k,z,U,G,W,H,q,j,Y,X,Z,K,Q,J,$,ee,te,ie,re,ne,oe,ae,se,le,ue,ce,he,de,pe,me,fe,_e,ge,ve,ye,Ce,we,Se,Ee,be,Te,xe,Ae,Pe,De,Me,Ie,Re,Oe,Ne,Le){ -"use strict";return{czm_degreesPerRadian:e,czm_depthRange:t,czm_epsilon1:i,czm_epsilon2:r,czm_epsilon3:n,czm_epsilon4:o,czm_epsilon5:a,czm_epsilon6:s,czm_epsilon7:l,czm_infinity:u,czm_oneOverPi:c,czm_oneOverTwoPi:h,czm_passCompute:d,czm_passEnvironment:p,czm_passGlobe:m,czm_passGround:f,czm_passOpaque:_,czm_passOverlay:g,czm_passTranslucent:v,czm_pi:y,czm_piOverFour:C,czm_piOverSix:w,czm_piOverThree:S,czm_piOverTwo:E,czm_radiansPerDegree:b,czm_sceneMode2D:T,czm_sceneMode3D:x,czm_sceneModeColumbusView:A,czm_sceneModeMorphing:P,czm_solarRadius:D,czm_threePiOver2:M,czm_twoPi:I,czm_webMercatorMaxLatitude:R,czm_depthRangeStruct:O,czm_ellipsoid:N,czm_material:L,czm_materialInput:B,czm_ray:F,czm_raySegment:V,czm_shadowParameters:k,czm_alphaWeight:z,czm_antialias:U,czm_cascadeColor:G,czm_cascadeDistance:W,czm_cascadeMatrix:H,czm_cascadeWeights:q,czm_columbusViewMorph:j,czm_computePosition:Y,czm_cosineAndSine:X,czm_decompressTextureCoordinates:Z,czm_eastNorthUpToEyeCoordinates:K,czm_ellipsoidContainsPoint:Q,czm_ellipsoidNew:J,czm_ellipsoidWgs84TextureCoordinates:$,czm_equalsEpsilon:ee,czm_eyeOffset:te,czm_eyeToWindowCoordinates:ie,czm_fog:re,czm_geodeticSurfaceNormal:ne,czm_getDefaultMaterial:oe,czm_getLambertDiffuse:ae,czm_getSpecular:se,czm_getWaterNoise:le,czm_getWgs84EllipsoidEC:ue,czm_hue:ce,czm_isEmpty:he,czm_isFull:de,czm_latitudeToWebMercatorFraction:pe,czm_luminance:me,czm_metersPerPixel:fe,czm_modelToWindowCoordinates:_e,czm_multiplyWithColorBalance:ge,czm_nearFarScalar:ve,czm_octDecode:ye,czm_packDepth:Ce,czm_phong:we,czm_pointAlongRay:Se,czm_rayEllipsoidIntersectionInterval:Ee,czm_RGBToXYZ:be,czm_saturation:Te,czm_shadowDepthCompare:xe,czm_shadowVisibility:Ae,czm_signNotZero:Pe,czm_tangentToEyeSpaceMatrix:De,czm_translateRelativeToEye:Me,czm_translucentPhong:Ie,czm_transpose:Re,czm_unpackDepth:Oe,czm_windowToEyeCoordinates:Ne,czm_XYZToRGB:Le}}),i("Renderer/ShaderSource",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Shaders/Builtin/CzmBuiltins","./AutomaticUniforms"],function(e,t,i,r,n){"use strict";function o(e){return e=e.replace(/\/\/.*/g,""),e.replace(/\/\*\*[\s\S]*?\*\//gm,function(e){for(var t=e.match(/\n/gm).length,i="",r=0;r0;){var r=e.pop();i.push(r),0===r.requiredBy.length&&t.push(r)}for(;t.length>0;){var n=t.shift();e.push(n);for(var o=0;o=0;--n)r=r+t[n].glslSource+"\n";return r.replace(i.glslSource,"")}function c(e,i){var r,n,a="",s=e.sources;if(t(s))for(r=0,n=s.length;r0&&(a.glVertexAttribDivisor(t,this.instanceDivisor),a._vertexAttribDivisors[t]=this.instanceDivisor,a._previousDrawInstanced=!0)},c.disableVertexAttribArray=function(e){e.disableVertexAttribArray(this.index),this.instanceDivisor>0&&a.glVertexAttribDivisor(o,0)};else{switch(c.componentsPerAttribute){case 1:c.vertexAttrib=function(e){e.vertexAttrib1fv(this.index,this.value)};break;case 2:c.vertexAttrib=function(e){e.vertexAttrib2fv(this.index,this.value)};break;case 3:c.vertexAttrib=function(e){e.vertexAttrib3fv(this.index,this.value)};break;case 4:c.vertexAttrib=function(e){e.vertexAttrib4fv(this.index,this.value)}}c.disableVertexAttribArray=function(e){}}r.push(c)}function m(e,t,r){for(var n=0;n0){h=!0;break}var g;o.vertexArrayObject&&(g=o.glCreateVertexArray(),o.glBindVertexArray(g),m(a,u,l),o.glBindVertexArray(null)),this._numberOfVertices=c,this._hasInstancedAttributes=h,this._context=o,this._gl=a,this._vao=g,this._attributes=u,this._indexBuffer=l}function _(e){return e.values.length/e.componentsPerAttribute}function g(t){return e.getSizeInBytes(t.componentDatatype)*t.componentsPerAttribute}function v(t){var r,n,o,a=[];for(n in t)t.hasOwnProperty(n)&&i(t[n])&&i(t[n].values)&&(a.push(n),t[n].componentDatatype===e.DOUBLE&&(t[n].componentDatatype=e.FLOAT,t[n].values=e.createTypedArray(e.FLOAT,t[n].values)));var s,l=a.length;if(l>0)for(s=_(t[a[0]]),r=1;r0){var p=e.getSizeInBytes(t[a[0]].componentDatatype),m=h%p;0!==m&&(h+=p-m);var f=s*h,v=new ArrayBuffer(f),y={};for(r=0;r0&&(t.glVertexAttribDivisor(r,0),n[r]=0)}}return f.fromGeometry=function(r){r=t(r,t.EMPTY_OBJECT);var n,o,u,d=r.context,p=t(r.geometry,t.EMPTY_OBJECT),m=t(r.bufferUsage,h.DYNAMIC_DRAW),_=t(r.attributeLocations,t.EMPTY_OBJECT),g=t(r.interleave,!1),y=r.vertexArrayAttributes,C=i(y)?y:[],w=p.attributes;if(g){var S=v(w);if(i(S)){u=c.createVertexBuffer({context:d,typedArray:S.buffer,usage:m});var E=S.offsetsInBytes,b=S.vertexSizeInBytes;for(n in w)w.hasOwnProperty(n)&&i(w[n])&&(o=w[n],i(o.values)?C.push({index:_[n],vertexBuffer:u,componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,offsetInBytes:E[n],strideInBytes:b}):C.push({index:_[n],value:o.value,componentDatatype:o.componentDatatype,normalize:o.normalize}))}}else for(n in w)if(w.hasOwnProperty(n)&&i(w[n])){o=w[n];var T=o.componentDatatype;T===e.DOUBLE&&(T=e.FLOAT),u=void 0,i(o.values)&&(u=c.createVertexBuffer({context:d,typedArray:e.createTypedArray(T,o.values),usage:m})),C.push({index:_[n],vertexBuffer:u,value:o.value,componentDatatype:T,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize})}var x,A=p.indices;return i(A)&&(x=a.computeNumberOfVertices(p)>=l.SIXTY_FOUR_KILOBYTES&&d.elementIndexUint?c.createIndexBuffer({context:d,typedArray:new Uint32Array(A),usage:m,indexDatatype:s.UNSIGNED_INT}):c.createIndexBuffer({context:d,typedArray:new Uint16Array(A),usage:m,indexDatatype:s.UNSIGNED_SHORT})),new f({context:d,attributes:C,indexBuffer:x})},r(f.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}}),f.prototype.getAttribute=function(e){return this._attributes[e]},f.prototype._bind=function(){i(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&y(this)):m(this._gl,this._attributes,this._indexBuffer)},f.prototype._unBind=function(){if(i(this._vao))this._context.glBindVertexArray(null);else{for(var e=this._attributes,t=this._gl,r=0;r=U)return r<0?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY;var n=r*e.x*V;return n+=r*e.y*k,n+=r*e.z*z,n*Math.pow(10,i)}function b(e,t,r){var n=i.unpack(e,t,N),o=E(n);n=i.unpack(e,t+4,N);var a=E(n);n=i.unpack(e,t+8,N);var s=E(n);n=i.unpack(e,t+12,N);var l=E(n);return i.fromElements(o,a,s,l,r)}function T(e,t){if(G[0]=e,e=G[0],0===e)return i.clone(i.ZERO,t);var r,n=e<0?1:0;isFinite(e)?(e=Math.abs(e),r=Math.floor(u.logBase(e,10))+1,e/=Math.pow(10,r)):(e=.1,r=U);var o=e*L;return t.x=Math.floor(o),o=(o-t.x)*L,t.y=Math.floor(o),o=(o-t.y)*L,t.z=Math.floor(o),t.w=2*(r+U)+n,t}function x(e,t,r){var n=T(e.x,N);i.pack(n,t,r),n=T(e.y,n),i.pack(n,t,r+4),n=T(e.z,n),i.pack(n,t,r+8),n=T(e.w,n),i.pack(n,t,r+12)}function A(e,t){var i=e._textureDimensions;e._texture=new f({context:t,pixelFormat:c.RGBA,pixelDatatype:e._pixelDatatype,width:i.x,height:i.y,sampler:new m({minificationFilter:g.NEAREST,magnificationFilter:_.NEAREST})})}function P(e){var t=e._textureDimensions;e._texture.copyFrom({width:t.x,height:t.y,arrayBufferView:e._batchValues})}function D(e){var t=e._stride;return 1===e._textureDimensions.y?"uniform vec4 batchTextureStep; \nvec2 computeSt(float batchId) \n{ \n float stepX = batchTextureStep.x; \n float centerX = batchTextureStep.y; \n float numberOfAttributes = float("+t+"); \n return vec2(centerX + (batchId * numberOfAttributes * stepX), 0.5); \n} \n":"uniform vec4 batchTextureStep; \nuniform vec2 batchTextureDimensions; \nvec2 computeSt(float batchId) \n{ \n float stepX = batchTextureStep.x; \n float centerX = batchTextureStep.y; \n float stepY = batchTextureStep.z; \n float centerY = batchTextureStep.w; \n float numberOfAttributes = float("+t+"); \n float xId = mod(batchId * numberOfAttributes, batchTextureDimensions.x); \n float yId = floor(batchId * numberOfAttributes / batchTextureDimensions.x); \n return vec2(centerX + (xId * stepX), 1.0 - (centerY + (yId * stepY))); \n} \n"}function M(e){return e._packFloats?"float unpackFloat(vec4 value) \n{ \n value *= 255.0; \n float temp = value.w / 2.0; \n float exponent = floor(temp); \n float sign = (temp - exponent) * 2.0; \n exponent = exponent - float("+U+"); \n sign = sign * 2.0 - 1.0; \n sign = -sign; \n float unpacked = sign * value.x * float("+V+"); \n unpacked += sign * value.y * float("+k+"); \n unpacked += sign * value.z * float("+z+"); \n return unpacked * pow(10.0, exponent); \n} \n":""}function I(e){return 1===e?"float":"vec"+e}function R(e){return 1===e?".x":2===e?".xy":3===e?".xyz":""}function O(e,t){var i=e._attributes,r=i[t],o=r.componentsPerAttribute,a=r.functionName,s=I(o),l=R(o),u=e._offsets[t],c=s+" "+a+"(float batchId) \n{ \n vec2 st = computeSt(batchId); \n st.x += batchTextureStep.x * float("+u+"); \n";return c+=e._packFloats&&r.componentDatatype!==p.UNSIGNED_BYTE?"vec4 textureValue; \ntextureValue.x = unpackFloat(texture2D(batchTexture, st)); \ntextureValue.y = unpackFloat(texture2D(batchTexture, st + vec2(batchTextureStep.x, 0.0))); \ntextureValue.z = unpackFloat(texture2D(batchTexture, st + vec2(batchTextureStep.x * 2.0, 0.0))); \ntextureValue.w = unpackFloat(texture2D(batchTexture, st + vec2(batchTextureStep.x * 3.0, 0.0))); \n":" vec4 textureValue = texture2D(batchTexture, st); \n",c+=" "+s+" value = textureValue"+l+"; \n",e._pixelDatatype!==p.UNSIGNED_BYTE||r.componentDatatype!==n.UNSIGNED_BYTE||r.normalize?e._pixelDatatype===p.FLOAT&&r.componentDatatype===n.UNSIGNED_BYTE&&r.normalize&&(c+="value /= 255.0; \n"):c+="value *= 255.0; \n",c+=" return value; \n} \n"}a(v.prototype,{attributes:{get:function(){return this._attributes}},numberOfInstances:{get:function(){return this._numberOfInstances}}});var N=new i,L=256,B=65536,F=16777216,V=1/L,k=1/B,z=1/F,U=38,G=new Float32Array(1),W=new i;v.prototype.getBatchedAttribute=function(e,t,r){var n,a=this._attributes,s=this._offsets[t],l=this._stride,u=4*l*e+4*s;n=this._packFloats&&a[t].componentDatatype!==p.UNSIGNED_BYTE?b(this._batchValues,u,W):i.unpack(this._batchValues,u,W);var c=C(a,t);return o(c.fromCartesian4)?c.fromCartesian4(n,r):o(c.clone)?c.clone(n,r):n.x};var H=[void 0,void 0,new e,new t,new i],q=new i;return v.prototype.setBatchedAttribute=function(e,t,r){var n=this._attributes,a=H[n[t].componentsPerAttribute],s=this.getBatchedAttribute(e,t,a),l=C(this._attributes,t),u=o(l.equals)?l.equals(s,r):s===r;if(!u){var c=q;c.x=o(r.x)?r.x:r,c.y=o(r.y)?r.y:0,c.z=o(r.z)?r.z:0,c.w=o(r.w)?r.w:0;var h=this._offsets[t],d=this._stride,m=4*d*e+4*h;this._packFloats&&n[t].componentDatatype!==p.UNSIGNED_BYTE?x(c,this._batchValues,m):i.pack(c,this._batchValues,m),this._batchValuesDirty=!0}},v.prototype.update=function(e){o(this._texture)&&!this._batchValuesDirty||0===this._attributes.length||(this._batchValuesDirty=!1,o(this._texture)||A(this,e.context),P(this))},v.prototype.getUniformMapCallback=function(){var e=this;return function(t){if(0===e._attributes.length)return t;var i={batchTexture:function(){return e._texture},batchTextureDimensions:function(){return e._textureDimensions},batchTextureStep:function(){return e._textureStep}};return r(t,i)}},v.prototype.getVertexShaderCallback=function(){var e=this._attributes;if(0===e.length)return function(e){return e};var t="uniform sampler2D batchTexture; \n";t+=D(this)+"\n",t+=M(this)+"\n";for(var i=e.length,r=0;r1){var s=e[0].modelMatrix;for(n=1;n=0){var u=n[l];o=u.offset+u.count,s=u.index,a=r[s].indices.length}else o=0,s=0,a=r[s].indices.length;for(var c=e.length,h=0;ha&&(o=0,a=r[++s].indices.length),n.push({index:s,offset:o,count:m}),o+=m}}}function y(e,t){var i=[];return v(e,"geometry",t,i),v(e,"westHemisphereGeometry",t,i),v(e,"eastHemisphereGeometry",t,i),i}function C(e,t){var r=e.attributes;for(var n in r)if(r.hasOwnProperty(n)){var o=r[n];i(o)&&i(o.values)&&t.push(o.values.buffer)}i(e.indices)&&t.push(e.indices.buffer)}function w(e,t){for(var i=e.length,r=0;r0&&(r=g(t),r.length>0&&(n=c.createAttributeLocations(r[0])));var s;t.createPickOffsets&&r.length>0&&(s=y(o,r));for(var l=new Array(a),u=new Array(a),h=0;h0&&(n.set(c.indices,l),l+=C)}}return r.push(n.buffer),{stringTable:o,packedData:n}},A.unpackCreateGeometryResults=function(i){for(var r,n=i.stringTable,o=i.packedData,a=new Array(o[0]),c=0,d=1;d0){var M=w.length/S;for(D=h.createTypedArray(M,C),r=0;r1?"vec"+a:"float",l="compressedAttributes",u="attribute "+s+" "+l+";",c="",h="";if(r){c+="vec2 st;\n";var d=a>1?l+".x":l;h+=" st = czm_decompressTextureCoordinates("+d+");\n"}i&&n&&o?(c+="vec3 normal;\nvec3 tangent;\nvec3 binormal;\n",h+=" czm_octDecode("+l+"."+(r?"yz":"xy")+", normal, tangent, binormal);\n"):(i&&(c+="vec3 normal;\n",h+=" normal = czm_octDecode("+l+(a>1?"."+(r?"y":"x"):"")+");\n"),n&&(c+="vec3 tangent;\n",h+=" tangent = czm_octDecode("+l+"."+(r&&i?"z":"y")+");\n"),o&&(c+="vec3 binormal;\n",h+=" binormal = czm_octDecode("+l+"."+(r&&i?"z":"y")+");\n"));var p=t;p=p.replace(/attribute\s+vec3\s+normal;/g,""),p=p.replace(/attribute\s+vec2\s+st;/g,""),p=p.replace(/attribute\s+vec3\s+tangent;/g,""),p=p.replace(/attribute\s+vec3\s+binormal;/g,""),p=M.replaceMain(p,"czm_non_compressed_main");var m="void main() \n{ \n"+h+" czm_non_compressed_main(); \n}";return[u,c,p,m].join("\n")}function Y(e,t){e.vertexAttributes}function X(e,t){return function(){return e[t]}}function Z(e,t){var i,r,n,o,a=e._instanceIds;if(e._state===B.READY){i=y(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];var s=e._numberOfInstances=i.length,l=[],h=[];for(n=0;n0){var g=new Float64Array(p);for(_=[g.buffer],o=0;o0?e._state=B.COMBINED:se(e,t,B.FAILED,void 0)}).otherwise(function(i){se(e,t,B.FAILED,i)})}}function K(e,t){var i,r,n=y(e.geometryInstances)?e.geometryInstances:[e.geometryInstances],o=e._numberOfInstances=n.length,a=new Array(o),s=e._instanceIds,l=0;for(r=0;r0?e._state=B.COMBINED:se(e,t,B.FAILED,void 0)}function Q(t,i){var r=c(t._batchTableAttributeIndices.distanceDisplayCondition);if(r||!t._batchTableBoundingSpheresUpdated){for(var n=t._batchTableBoundingSphereAttributeIndices,o=n.center3DHigh,a=n.center3DLow,s=n.center2DHigh,l=n.center2DLow,u=n.radius,h=i.mapProjection,d=h.ellipsoid,p=t._batchTable,f=t._instanceBoundingSpheres,_=f.length,g=0;g<_;++g){var v=f[g];if(c(v)){var y=t.modelMatrix;if(c(y)&&(v=e.transform(v,y,v)),r){var C=v.center,w=v.radius,S=m.fromCartesian(C,fe);p.setBatchedAttribute(g,o,S.high),p.setBatchedAttribute(g,a,S.low);var E=d.cartesianToCartographic(C,_e),b=h.project(E,ge);S=m.fromCartesian(b,fe),p.setBatchedAttribute(g,s,S.high),p.setBatchedAttribute(g,l,S.low),p.setBatchedAttribute(g,u,w)}}}t._batchTableBoundingSpheresUpdated=!0}}function J(t,i){for(var r=t._attributeLocations,n=t._geometries,o=i.scene3DOnly,a=i.context,s=[],l=n.length,u=0;u0){if(0===T.maximumVertexTextureImageUnits)throw new w("Vertex texture fetch support is required to render primitives with per-instance attributes. The maximum number of vertex texture image units must be greater than zero.");this._batchTable.update(e)}if(this._state!==B.COMPLETE&&this._state!==B.COMBINED&&(this.asynchronous?Z(this,e):K(this,e)),this._state===B.COMBINED&&(Q(this,e),J(this,e)),this.show&&this._state===B.COMPLETE){var i=this.appearance,r=i.material,n=!1,o=!1;this._appearance!==i?(this._appearance=i,this._material=r,n=!0,o=!0):this._material!==r&&(this._material=r,o=!0);var a=this._appearance.isTranslucent();this._translucent!==a&&(this._translucent=a,n=!0),c(this._material)&&this._material.update(t);var s=i.closed&&a;if(n){var l=u(this._createRenderStatesFunction,$);l(this,t,i,s)}if(o){var h=u(this._createShaderProgramFunction,ee);h(this,e,i)}if(n||o){var d=u(this._createCommandsFunction,te);d(this,i,r,a,s,this._colorCommands,this._pickCommands,e)}var p=u(this._updateAndQueueCommandsFunction,re);p(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,s)}}}},k.prototype.getGeometryInstanceAttributes=function(e){for(var t=-1,i=this._lastPerInstanceAttributeIndex,r=this._instanceIds,n=r.length,o=0;o-1;c--)r=n[c],u(e,w,p,r);for(i=_-1;i>=0;i--)for(d=f[i],d.collectionChanged.addEventListener(h.prototype._onCollectionChanged,e),n=d.values,p=d.id,c=n.length-1;c>-1;c--){r=n[c],l(e,w,p,r);var S=C.getById(r.id);t(S)||(S=y.getById(r.id),t(S)?s(S):(m.id=r.id,S=new o(m)),C.add(S)),S.merge(r)}e._collectionsCopy=f.slice(0),y.suspendEvents(),y.removeAll();var E=C.values;for(i=0;i=0;d--)p=n[d].getById(C),t(p)&&(t(f)||(f=c.getById(C),s(f)),f.merge(p));t(f)||c.removeById(C),f=void 0}var w=i.length;for(h=0;h=0;d--)p=n[d].getById(E),t(p)&&(t(f)||(f=c.getById(E),t(f)?s(f):(m.id=E,f=new o(m),c.add(f))),f.merge(p));f=void 0}c.resumeEvents()},h.prototype._onDefinitionChanged=function(e,i,r,n){for(var o=this._collections,a=this._composite,s=o.length,l=e.id,u=a.getById(l),c=u[i],h=!t(c),d=!0,p=s-1;p>=0;p--){var m=o[p].getById(e.id);if(t(m)){var f=m[i];if(t(f)){if(d){if(d=!1,!t(f.merge)||!t(f.clone)){c=f;break}c=f.clone(c)}c.merge(f)}}}h&&u.propertyNames.indexOf(i)===-1&&u.addProperty(i),u[i]=c},h}),i("DataSources/CompositeProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/EventHelper","../Core/TimeIntervalCollection","./Property"],function(e,t,i,r,n,o,a){"use strict";function s(t,i,r,n){function o(){r.raiseEvent(t)}var a=[];i.removeAll();for(var s=n.length,l=0;l1&&(t=X),this._primitiveOptions={geometryInstances:void 0,appearance:i,vertexCacheOptimize:s(e.vertexCacheOptimize,!1),interleave:s(e.interleave,!1),releaseGeometryInstances:s(e.releaseGeometryInstances,!0),allowPicking:s(e.allowPicking,!0),asynchronous:s(e.asynchronous,!0),compressVertices:s(e.compressVertices,!0),_readOnlyInstanceAttributes:t,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_createPickOffsets:!0}}function L(e){return function(t,i){var r=i.maximumRadius,n=r/Math.cos(.5*t)-r;return e._maxHeight+n}}function B(e){return function(t,i){return e._minHeight}}function F(e,t){var i=e.mapProjection.ellipsoid;{if(l(t.attributes)&&l(t.attributes.position3DHigh)){for(var n=t.attributes.position3DHigh.values,o=t.attributes.position3DLow.values,a=n.length,s=Number.POSITIVE_INFINITY,u=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,h=Number.NEGATIVE_INFINITY,d=0;da?a:s-1}}function k(e,t,i){var n=V(t),o=N._defaultMinTerrainHeight,a=N._defaultMaxTerrainHeight;if(l(n)){var s=n.level+"-"+n.x+"-"+n.y,u=N._terrainHeights[s];l(u)&&(o=u[0],a=u[1]),i.cartographicToCartesian(v.northeast(t,ue),se),i.cartographicToCartesian(v.southwest(t,ue),le),r.subtract(le,se,ce),r.add(se,r.multiplyByScalar(ce,.5,ce),ce);var c=i.scaleToGeodeticSurface(ce,he);if(l(c)){var h=r.distance(ce,c);o=Math.min(o,-h)}else o=N._defaultMinTerrainHeight}e._minTerrainHeight=Math.max(N._defaultMinTerrainHeight,o),e._maxTerrainHeight=a}function z(t,i){var r=V(t),n=N._defaultMaxTerrainHeight;if(l(r)){var o=r.level+"-"+r.x+"-"+r.y,a=N._terrainHeights[o];l(a)&&(n=a[1])}var s=e.fromRectangle3D(t,i,0);return e.fromRectangle3D(t,i,n,de),e.union(s,de,s)}function U(t,i,n){var o=i.mapProjection.ellipsoid,a=F(i,n);if(a.width<_.PI){var s=g.fromRectangle(a,t._maxHeight,t._minHeight,o);t._boundingVolumes.push(s)}else{var l=n.attributes.position3DHigh.values,u=n.attributes.position3DLow.values;t._boundingVolumes.push(e.fromEncodedCartesianVertices(l,u))}if(!i.scene3DOnly){var c=i.mapProjection,h=e.fromRectangleWithHeights2D(a,c,t._maxHeight,t._minHeight);r.fromElements(h.center.z,h.center.x,h.center.y,h.center),t._boundingVolumes2D.push(h)}}function G(e,t,i,r){l(e._rsStencilPreloadPass)||(e._rsStencilPreloadPass=w.fromCache(Z),e._rsStencilDepthPass=w.fromCache(K),e._rsColorPass=w.fromCache(Q),e._rsPickPass=w.fromCache(J))}function W(e,t,i){if(!l(e._sp)){var r=t.context,n=T;n=e._primitive._batchTable.getVertexShaderCallback()(n),n=M._appendShowToShader(e._primitive,n),n=M._appendDistanceDisplayConditionToShader(e._primitive,n),n=M._modifyShaderPosition(e,n,t.scene3DOnly),n=M._updateColorAttribute(e._primitive,n);var o=b,a=e._primitive._attributeLocations;if(e._sp=S.replaceCache({context:r,shaderProgram:e._sp,vertexShaderSource:n,fragmentShaderSource:o,attributeLocations:a}),e._primitive.allowPicking){var s=E.createPickVertexShaderSource(n);s=M._updatePickColorAttribute(s);var u=new E({sources:[o],pickColorQualifier:"varying"});e._spPick=S.replaceCache({context:r,shaderProgram:e._spPick,vertexShaderSource:s,fragmentShaderSource:u,attributeLocations:a})}else e._spPick=S.fromCache({context:r,vertexShaderSource:n,fragmentShaderSource:o,attributeLocations:a})}}function H(e,t){var i=e._primitive,r=3*i._va.length;t.length=r;for(var n=0,o=i._batchTable.getUniformMapCallback()(e._uniformMap),a=0;a=E.clientWidth)x=!0;else{if(B.x>.5*E.clientWidth){b.width=B.x,T.frustum.right=D.x-N,m=h(y,n,T,m),d.clipToGLWindowCoordinates(b,m,_),b.x+=B.x,T.position.x=-T.position.x;var F=T.frustum.right;T.frustum.right=-T.frustum.left,T.frustum.left=-F,m=h(y,n,T,m),d.clipToGLWindowCoordinates(b,m,g)}else{b.x+=B.x,b.width-=B.x,T.frustum.left=-D.x-N,m=h(y,n,T,m),d.clipToGLWindowCoordinates(b,m,_),b.x=b.x-b.width,T.position.x=-T.position.x;var V=T.frustum.left;T.frustum.left=-T.frustum.right,T.frustum.right=-V,m=h(y,n,T,m),d.clipToGLWindowCoordinates(b,m,g)}i.clone(M,T.position),T.frustum=I.clone(),a=t.clone(_,a),(a.x<0||a.x>E.clientWidth)&&(a.x=g.x)}}if(v.mode!==c.SCENE2D||x){if(m=h(y,n,T,m),m.z<0&&v.mode!==c.SCENE2D)return;a=d.clipToGLWindowCoordinates(b,m,a)}return a.y=E.clientHeight-a.y,a}},d.wgs84ToDrawingBufferCoordinates=function(e,t,i){if(i=d.wgs84ToWindowCoordinates(e,t,i),o(i))return d.transformWindowToDrawingBuffer(e,i,i)};var E=new i,b=new n;d.computeActualWgs84Position=function(e,t,r){var n=e.mode;if(n===c.SCENE3D)return i.clone(t,r);var a=e.mapProjection,l=a.ellipsoid.cartesianToCartographic(t,b);if(o(l)){if(a.project(l,E),n===c.COLUMBUS_VIEW)return i.fromElements(E.z,E.x,E.y,r);if(n===c.SCENE2D)return i.fromElements(0,E.x,E.y,r);var u=e.morphTime;return i.fromElements(s.lerp(E.z,t.x,u),s.lerp(E.x,t.y,u),s.lerp(E.y,t.z,u),r)}};var T=new i,x=new i,A=new l;d.clipToGLWindowCoordinates=function(e,r,n){return i.divideByScalar(r,r.w,T),l.computeViewportTransformation(e,0,1,A),l.multiplyByPoint(A,T,x),t.fromCartesian3(x,n)},d.clipToDrawingBufferCoordinates=function(e,r,n){return i.divideByScalar(r,r.w,T),l.computeViewportTransformation(e,0,1,A),l.multiplyByPoint(A,T,x),t.fromCartesian3(x,n)},d.transformWindowToDrawingBuffer=function(e,i,r){var n=e.canvas,o=e.drawingBufferWidth/n.clientWidth,a=e.drawingBufferHeight/n.clientHeight;return t.fromElements(i.x*o,i.y*a,r)};var P=new r,D=new r;return d.drawingBufferToWgs84Coordinates=function(e,t,n,o){var a=e.context,s=a.uniformState,u=e._passState.viewport,c=r.clone(r.UNIT_W,P);c.x=(t.x-u.x)/u.width*2-1,c.y=(t.y-u.y)/u.height*2-1,c.z=2*n-1,c.w=1;var h=l.multiplyByVector(s.inverseViewProjection,c,D),d=1/h.w;return i.multiplyByScalar(h,d,h),i.fromCartesian4(h,o)},d}),i("Scene/Billboard",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/Color","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/Matrix4","../Core/NearFarScalar","./HeightReference","./HorizontalOrigin","./SceneMode","./SceneTransforms","./VerticalOrigin"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v){"use strict";function y(e,r){e=s(e,s.EMPTY_OBJECT),this._show=s(e.show,!0),this._position=i.clone(s(e.position,i.ZERO)),this._actualPosition=i.clone(this._position),this._pixelOffset=t.clone(s(e.pixelOffset,t.ZERO)),this._translate=new t(0,0),this._eyeOffset=i.clone(s(e.eyeOffset,i.ZERO)),this._heightReference=s(e.heightReference,m.NONE),this._verticalOrigin=s(e.verticalOrigin,v.CENTER),this._horizontalOrigin=s(e.horizontalOrigin,f.CENTER),this._scale=s(e.scale,1),this._color=o.clone(s(e.color,o.WHITE)),this._rotation=s(e.rotation,0),this._alignedAxis=i.clone(s(e.alignedAxis,i.ZERO)),this._width=e.width,this._height=e.height,this._scaleByDistance=e.scaleByDistance,this._translucencyByDistance=e.translucencyByDistance,this._pixelOffsetScaleByDistance=e.pixelOffsetScaleByDistance,this._sizeInMeters=s(e.sizeInMeters,!1),this._distanceDisplayCondition=e.distanceDisplayCondition,this._id=e.id,this._collection=s(e.collection,r),this._pickId=void 0,this._pickPrimitive=s(e._pickPrimitive,this),this._billboardCollection=r,this._dirty=!1,this._index=-1,this._imageIndex=-1,this._imageIndexPromise=void 0,this._imageId=void 0,this._image=void 0,this._imageSubRegion=void 0,this._imageWidth=void 0,this._imageHeight=void 0;var n=e.image,u=e.imageId;l(n)&&(l(u)||(u="string"==typeof n?n:l(n.src)?n.src:a()),this._imageId=u,this._image=n),l(e.imageSubRegion)&&(this._imageId=u,this._imageSubRegion=e.imageSubRegion),l(this._billboardCollection._textureAtlas)&&this._loadImage(),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=_.SCENE3D,this._clusterShow=!0,this._updateClamping()}function C(e,t){var i=e._billboardCollection;l(i)&&(i._updateBillboard(e,t),e._dirty=!0)}var w=y.SHOW_INDEX=0,S=y.POSITION_INDEX=1,E=y.PIXEL_OFFSET_INDEX=2,b=y.EYE_OFFSET_INDEX=3,T=y.HORIZONTAL_ORIGIN_INDEX=4,x=y.VERTICAL_ORIGIN_INDEX=5,A=y.SCALE_INDEX=6,P=y.IMAGE_INDEX_INDEX=7,D=y.COLOR_INDEX=8,M=y.ROTATION_INDEX=9,I=y.ALIGNED_AXIS_INDEX=10,R=y.SCALE_BY_DISTANCE_INDEX=11,O=y.TRANSLUCENCY_BY_DISTANCE_INDEX=12,N=y.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,L=y.DISTANCE_DISPLAY_CONDITION=14;y.NUMBER_OF_PROPERTIES=15,u(y.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,C(this,w))}},position:{get:function(){return this._position},set:function(e){var t=this._position;i.equals(t,e)||(i.clone(e,t),i.clone(e,this._actualPosition),this._updateClamping(),C(this,S))}},heightReference:{get:function(){return this._heightReference},set:function(e){var t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),C(this,S))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){var i=this._pixelOffset;t.equals(i,e)||(t.clone(e,i),C(this,E))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){var t=this._scaleByDistance;p.equals(t,e)||(this._scaleByDistance=p.clone(e,t),C(this,R))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){var t=this._translucencyByDistance;p.equals(t,e)||(this._translucencyByDistance=p.clone(e,t),C(this,O))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){var t=this._pixelOffsetScaleByDistance;p.equals(t,e)||(this._pixelOffsetScaleByDistance=p.clone(e,t),C(this,N))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){var t=this._eyeOffset;i.equals(t,e)||(i.clone(e,t),C(this,b))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,C(this,T))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,C(this,x))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,C(this,A))}},color:{get:function(){return this._color},set:function(e){var t=this._color;o.equals(t,e)||(o.clone(e,t),C(this,D))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,C(this,M))}},alignedAxis:{ -get:function(){return this._alignedAxis},set:function(e){var t=this._alignedAxis;i.equals(t,e)||(i.clone(e,t),C(this,I))}},width:{get:function(){return s(this._width,this._imageWidth)},set:function(e){this._width!==e&&(this._width=e,C(this,P))}},height:{get:function(){return s(this._height,this._imageHeight)},set:function(e){this._height!==e&&(this._height=e,C(this,P))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,C(this,D))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){h.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=h.clone(e,this._distanceDisplayCondition),C(this,L))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickPrimitive:{get:function(){return this._pickPrimitive},set:function(e){this._pickPrimitive=e,l(this._pickId)&&(this._pickId.object.primitive=e)}},image:{get:function(){return this._imageId},set:function(e){l(e)?"string"==typeof e?this.setImage(e,e):l(e.src)?this.setImage(e.src,e):this.setImage(a(),e):(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=void 0,this._image=void 0,this._imageIndexPromise=void 0,C(this,P))}},ready:{get:function(){return this._imageIndex!==-1}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=i.clone(e,this._actualClampedPosition),C(this,S)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,C(this,w))}}}),y.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId},y.prototype._updateClamping=function(){y._updateClamping(this._billboardCollection,this)};var B=new n,F=new i;y._updateClamping=function(e,t){function r(e){if(t._heightReference===m.RELATIVE_TO_GROUND)if(t._mode===_.SCENE3D){var r=s.cartesianToCartographic(e,B);r.height+=d.height,s.cartographicToCartesian(r,e)}else e.x+=d.height;t._clampedPosition=i.clone(e,t._clampedPosition)}var o=e._scene;if(l(o)){var a=o.globe,s=a.ellipsoid,u=a._surface,c=o.frameState.mode,h=c!==t._mode;if(t._mode=c,(t._heightReference===m.NONE||h)&&l(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0),t._heightReference!==m.NONE&&l(t._position)){var d=s.cartesianToCartographic(t._position);if(l(d)){l(t._removeCallbackFunc)&&t._removeCallbackFunc(),t._removeCallbackFunc=u.updateHeight(d,r),n.clone(d,B);var p=a.getHeight(d);l(p)&&(B.height=p),s.cartographicToCartesian(B,F),r(F)}}}},y.prototype._loadImage=function(){var t,i=this._billboardCollection._textureAtlas,r=this._imageId,n=this._image,o=this._imageSubRegion;if(l(n)&&(t=i.addImage(r,n)),l(o)&&(t=i.addSubRegion(r,o)),this._imageIndexPromise=t,l(t)){var a=this;t.then(function(t){if(a._imageId===r&&a._image===n&&e.equals(a._imageSubRegion,o)){var s=i.textureCoordinates[t];a._imageWidth=i.texture.width*s.width,a._imageHeight=i.texture.height*s.height,a._imageIndex=t,a._ready=!0,a._image=void 0,a._imageIndexPromise=void 0,C(a,P)}}).otherwise(function(e){console.error("Error loading image for billboard: "+e),a._imageIndexPromise=void 0})}},y.prototype.setImage=function(e,t){this._imageId!==e&&(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=e,this._image=t,l(this._billboardCollection._textureAtlas)&&this._loadImage())},y.prototype.setImageSubRegion=function(t,i){this._imageId===t&&e.equals(this._imageSubRegion,i)||(this._imageIndex=-1,this._imageId=t,this._imageSubRegion=e.clone(i),l(this._billboardCollection._textureAtlas)&&this._loadImage())},y.prototype._setTranslate=function(e){var i=this._translate;t.equals(i,e)||(t.clone(e,i),C(this,E))},y.prototype._getActualPosition=function(){return l(this._clampedPosition)?this._clampedPosition:this._actualPosition},y.prototype._setActualPosition=function(e){l(this._clampedPosition)||i.clone(e,this._actualPosition),C(this,S)};var V=new r;y._computeActualPosition=function(e,t,i,r){return l(e._clampedPosition)?(i.mode!==e._mode&&e._updateClamping(),e._clampedPosition):i.mode===_.SCENE3D?t:(d.multiplyByPoint(r,t,V),g.computeActualWgs84Position(i,V))};var k=new i;y._computeScreenSpacePosition=function(e,i,r,n,o,a){var s=d.multiplyByPoint(e,i,k),u=g.wgs84WithEyeOffsetToWindowCoordinates(o,s,r,a);if(l(u))return t.add(u,n,u),u};var z=new t(0,0);return y.prototype.computeScreenSpacePosition=function(e,i){var r=this._billboardCollection;l(i)||(i=new t),t.clone(this._pixelOffset,z),t.add(z,this._translate,z);var n=r.modelMatrix,o=this._getActualPosition(),a=y._computeScreenSpacePosition(n,o,this._eyeOffset,z,e,i);return a},y.getScreenSpaceBoundingBox=function(t,i,r){var n=t.width,o=t.height,a=t.scale;n*=a,o*=a;var s=i.x;t.horizontalOrigin===f.RIGHT?s-=n:t.horizontalOrigin===f.CENTER&&(s-=.5*n);var u=i.y;return t.verticalOrigin===v.BOTTOM||t.verticalOrigin===v.BASELINE?u-=o:t.verticalOrigin===v.CENTER&&(u-=.5*o),l(r)||(r=new e),r.x=s,r.y=u,r.width=n,r.height=o,r},y.prototype.equals=function(r){return this===r||l(r)&&this._id===r._id&&i.equals(this._position,r._position)&&this._imageId===r._imageId&&this._show===r._show&&this._scale===r._scale&&this._verticalOrigin===r._verticalOrigin&&this._horizontalOrigin===r._horizontalOrigin&&this._heightReference===r._heightReference&&e.equals(this._imageSubRegion,r._imageSubRegion)&&o.equals(this._color,r._color)&&t.equals(this._pixelOffset,r._pixelOffset)&&t.equals(this._translate,r._translate)&&i.equals(this._eyeOffset,r._eyeOffset)&&p.equals(this._scaleByDistance,r._scaleByDistance)&&p.equals(this._translucencyByDistance,r._translucencyByDistance)&&p.equals(this._pixelOffsetScaleByDistance,r._pixelOffsetScaleByDistance)&&h.equals(this._distanceDisplayCondition,r._distanceDisplayCondition)},y.prototype._destroy=function(){l(this._customData)&&(this._billboardCollection._scene.globe._surface.removeTileCustomData(this._customData),this._customData=void 0),l(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this.image=void 0,this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0},y}),i("Renderer/VertexArrayFacade",["../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Math","./Buffer","./BufferUsage","./VertexArray"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(r,n,o,a){function s(t,i){return e.getSizeInBytes(i.componentDatatype)-e.getSizeInBytes(t.componentDatatype)}var l=u._verifyAttributes(n);o=t(o,0);for(var c,h,d=[],p={},m=l.length,f=0;f0){t.needsCommit=!1;var r=t.vertexBuffer,n=e._size*t.vertexSizeInBytes,o=i(r);if(!o||r.sizeInBytes0){var r=e.vertexSizeInBytes*t,n=e.vertexSizeInBytes*i;e.vertexBuffer.copyFromArrayView(new Uint8Array(e.arrayBuffer,r,n),r)}}function d(e){var t=e.va;if(i(t)){for(var r=t.length,n=0;n0?e.getSizeInBytes(t[0].componentDatatype):0,s=a>0?i%a:0,l=0===s?0:a-s;return i+=l},u._createArrayViews=function(t,i){for(var r=[],n=0,o=t.length,a=0;a0){var n=new ArrayBuffer(r*t.vertexSizeInBytes);if(i(t.arrayBuffer))for(var o=new Uint8Array(n),a=new Uint8Array(t.arrayBuffer),s=a.length,l=0;l 0.0;\n#else\nvec3 alignedAxis = vec3(0.0);\nbool validAlignedAxis = false;\n#endif\n#ifdef RENDER_FOR_PICK\ntemp = compressedAttribute2.y;\n#else\ntemp = compressedAttribute2.x;\n#endif\nvec4 color;\ntemp = temp * SHIFT_RIGHT8;\ncolor.b = (temp - floor(temp)) * SHIFT_LEFT8;\ntemp = floor(temp) * SHIFT_RIGHT8;\ncolor.g = (temp - floor(temp)) * SHIFT_LEFT8;\ncolor.r = floor(temp);\ntemp = compressedAttribute2.z * SHIFT_RIGHT8;\nbool sizeInMeters = floor((temp - floor(temp)) * SHIFT_LEFT7) > 0.0;\ntemp = floor(temp) * SHIFT_RIGHT8;\n#ifdef RENDER_FOR_PICK\ncolor.a = (temp - floor(temp)) * SHIFT_LEFT8;\nvec4 pickColor = color / 255.0;\n#else\ncolor.a = floor(temp);\ncolor /= 255.0;\n#endif\nvec4 p = czm_translateRelativeToEye(positionHigh, positionLow);\nvec4 positionEC = czm_modelViewRelativeToEye * p;\npositionEC = czm_eyeOffset(positionEC, eyeOffset.xyz);\npositionEC.xyz *= show;\n#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(EYE_DISTANCE_PIXEL_OFFSET) || defined(DISTANCE_DISPLAY_CONDITION)\nfloat lengthSq;\nif (czm_sceneMode == czm_sceneMode2D)\n{\nlengthSq = czm_eyeHeight2D.y;\n}\nelse\n{\nlengthSq = dot(positionEC.xyz, positionEC.xyz);\n}\n#endif\n#ifdef EYE_DISTANCE_SCALING\nscale *= czm_nearFarScalar(scaleByDistance, lengthSq);\nif (scale == 0.0)\n{\npositionEC.xyz = vec3(0.0);\n}\n#endif\nfloat translucency = 1.0;\n#ifdef EYE_DISTANCE_TRANSLUCENCY\ntranslucency = czm_nearFarScalar(translucencyByDistance, lengthSq);\nif (translucency == 0.0)\n{\npositionEC.xyz = vec3(0.0);\n}\n#endif\n#ifdef EYE_DISTANCE_PIXEL_OFFSET\nfloat pixelOffsetScale = czm_nearFarScalar(pixelOffsetScaleByDistance, lengthSq);\npixelOffset *= pixelOffsetScale;\n#endif\n#ifdef DISTANCE_DISPLAY_CONDITION\nfloat nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x;\nfloat farSq = distanceDisplayCondition.y * distanceDisplayCondition.y;\nif (lengthSq < nearSq || lengthSq > farSq)\n{\npositionEC.xyz = vec3(0.0);\n}\n#endif\nvec4 positionWC = computePositionWindowCoordinates(positionEC, imageSize, scale, direction, origin, translate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters);\ngl_Position = czm_viewportOrthographic * vec4(positionWC.xy, -positionWC.z, 1.0);\nv_textureCoordinates = textureCoordinates;\n#ifdef RENDER_FOR_PICK\nv_pickColor = pickColor;\n#else\nv_color = color;\nv_color.a *= translucency;\n#endif\n}\n"}),i("Renderer/Framebuffer",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/PixelFormat","./ContextLimits"],function(e,t,i,r,n,o,a){"use strict";function s(e,t,i){var r=e._gl;r.framebufferTexture2D(r.FRAMEBUFFER,t,i._target,i._texture,0)}function l(e,t,i){var r=e._gl;r.framebufferRenderbuffer(r.FRAMEBUFFER,t,r.RENDERBUFFER,i._getRenderbuffer())}function u(i){i=e(i,e.EMPTY_OBJECT);var r=i.context._gl;a.maximumColorAttachments;this._gl=r,this._framebuffer=r.createFramebuffer(),this._colorTextures=[],this._colorRenderbuffers=[],this._activeColorAttachments=[],this._depthTexture=void 0,this._depthRenderbuffer=void 0,this._stencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this.destroyAttachments=e(i.destroyAttachments,!0);t(i.depthTexture)||t(i.depthRenderbuffer),t(i.depthStencilTexture)||t(i.depthStencilRenderbuffer);this._bind();var n,o,u,c,h;if(t(i.colorTextures)){var d=i.colorTextures;for(c=this._colorTextures.length=this._activeColorAttachments.length=d.length,u=0;u0){for(var l=e._texture.width,u=e._texture.height,c=a*(l+i.width+s),p=a*(u+i.height+s),f=l/c,_=u/p,g=new m(new t(l+s,s),new t(c,u)),v=new m(new t,new t(c,u),e._root,g),y=new m(new t(s,u+s),new t(c,p)),C=new m(new t,new t(c,p),v,y),w=0;wl){i.childNode1=new m(new t(i.bottomLeft.x,i.bottomLeft.y),new t(i.bottomLeft.x+r.width,i.topRight.y));var u=i.bottomLeft.x+r.width+e._borderWidthInPixels;u0){this._vaf=k(n,r,this._buffersUsage,this._instanced),_=this._vaf.writers;for(var P=0;P0){var R=Re;R.length=0,(h[ee]||h[le]||h[oe])&&R.push(z),(h[ae]||h[te]||h[re]||h[ne]||h[$])&&(R.push(U),this._instanced&&R.push(H)),(h[ae]||h[ue]||h[he])&&(R.push(G),R.push(W)),(h[ae]||h[se])&&R.push(W),h[ie]&&R.push(H),h[ce]&&R.push(q),h[de]&&R.push(j),h[pe]&&R.push(Y);var O=R.length;if(_=this._vaf.writers,c/r>.1){for(var N=0;N1.5*r&&(u.length=r),s(this._vaf)&&s(this._vaf.va)){this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,t.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));var we,Se=m.IDENTITY;e.mode===M.SCENE3D?(Se=this.modelMatrix,we=t.clone(this._baseVolumeWC,this._boundingVolume)):we=t.clone(this._baseVolume2D,this._boundingVolume),Q(this,e,we);var Ee,be,Te,xe,Ae,Pe,De=e.commandList;if(g.render){var Me=this._colorCommands;for(s(this._rs)||(this._rs=C.fromCache({depthTest:{enabled:!0,func:f.LEQUAL},blending:A.ALPHA_BLEND})),s(this._sp)&&this._shaderRotation===this._compiledShaderRotation&&this._shaderAlignedAxis===this._compiledShaderAlignedAxis&&this._shaderScaleByDistance===this._compiledShaderScaleByDistance&&this._shaderTranslucencyByDistance===this._compiledShaderTranslucencyByDistance&&this._shaderPixelOffsetScaleByDistance===this._compiledShaderPixelOffsetScaleByDistance&&this._shaderDistanceDisplayCondition===this._compiledShaderDistanceDisplayCondition||(xe=new S({sources:[T]}),this._instanced&&xe.defines.push("INSTANCED"),this._shaderRotation&&xe.defines.push("ROTATION"),this._shaderAlignedAxis&&xe.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&xe.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&xe.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&xe.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&xe.defines.push("DISTANCE_DISPLAY_CONDITION"),this._sp=w.replaceCache({context:n,shaderProgram:this._sp,vertexShaderSource:xe,fragmentShaderSource:b,attributeLocations:J}),this._compiledShaderRotation=this._shaderRotation,this._compiledShaderAlignedAxis=this._shaderAlignedAxis,this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistance=this._shaderPixelOffsetScaleByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition),Ee=this._vaf.va,be=Ee.length,Me.length=be,Pe=0;Pe0,d=t._backgroundBillboard,p=e._backgroundBillboardCollection;c?(n(d)||(d=p.add({collection:e,image:P,imageSubRegion:M}),t._backgroundBillboard=d),d.color=t._backgroundColor,d.show=t._show,d.position=t._position,d.eyeOffset=t._eyeOffset,d.pixelOffset=t._pixelOffset,d.horizontalOrigin=h.LEFT,d.verticalOrigin=t._verticalOrigin,d.heightReference=t._heightReference,d.scale=t._scale,d.pickPrimitive=t,d.id=t._id,d.translucencyByDistance=t._translucencyByDistance,d.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,d.distanceDisplayCondition=t._distanceDisplayCondition):n(d)&&(p.remove(d),t._backgroundBillboard=d=void 0);var m=e._glyphTextureCache;for(o=0;o0&&I.height>0&&w(e._textureAtlas,A,I,D)}if(i=l[o],n(i)?D.index===-1?C(e,i):n(i.textureInfo)&&(i.textureInfo=void 0):(i=new _,l[o]=i),i.textureInfo=D,i.dimensions=D.dimensions,D.index!==-1){var R=i.billboard,O=e._spareBillboards;n(R)||(R=O.length>0?O.pop():e._billboardCollection.add({collection:e}),i.billboard=R),R.show=t._show,R.position=t._position,R.eyeOffset=t._eyeOffset,R.pixelOffset=t._pixelOffset,R.horizontalOrigin=h.LEFT,R.verticalOrigin=t._verticalOrigin,R.heightReference=t._heightReference,R.scale=t._scale,R.pickPrimitive=t,R.id=t._id,R.image=A,R.translucencyByDistance=t._translucencyByDistance,R.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,R.distanceDisplayCondition=t._distanceDisplayCondition}}t._repositionAllGlyphs=!0}function E(e,t,i){return t===h.CENTER?-e/2:t===h.RIGHT?-(e+i.x):i.x}function b(e,i){var r,o,a=e._glyphs,s=e._text,l=0,u=0,c=[],d=Number.NEGATIVE_INFINITY,p=0,m=1,_=0,g=a.length,v=e._backgroundBillboard,y=O;for(t.clone(n(v)?e._backgroundPadding:t.ZERO,y),_=0;_0&&(P=S===h.CENTER?-u/2-y.x:S===h.RIGHT?-(u+2*y.x):0,R.x=P*w*i,b===f.TOP?R.y=C-p-d:b===f.CENTER?R.y=(C-p)/2-d:b===f.BASELINE?R.y=-y.y-d:R.y=0,R.y=R.y*w*i,v.width=u+2*y.x,v.height=C+M+2*y.y,v._setTranslate(R))}function T(e,t){for(var i=t._glyphs,r=0,o=i.length;r farSq) {\npositionEC.xyz = vec3(0.0);\n}\n#endif\nvec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\ngl_Position = czm_viewportOrthographic * vec4(positionWC.xy, -positionWC.z, 1.0);\nv_color = color;\nv_color.a *= translucency;\nv_outlineColor = outlineColor;\nv_outlineColor.a *= translucency;\nv_innerPercent = 1.0 - outlinePercent;\nv_pixelDistance = 2.0 / totalSize;\ngl_PointSize = totalSize;\n#ifdef RENDER_FOR_PICK\nv_pickColor = pickColor;\n#endif\n}\n"}),i("Scene/PointPrimitiveCollection",["../Core/BoundingSphere","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EncodedCartesian3","../Core/Math","../Core/Matrix4","../Core/PrimitiveType","../Core/WebGLConstants","../Renderer/BufferUsage","../Renderer/ContextLimits","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArrayFacade","../Shaders/PointPrimitiveCollectionFS","../Shaders/PointPrimitiveCollectionVS","./BlendingState","./PointPrimitive","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T){"use strict";function x(t){t=r(t,r.EMPTY_OBJECT),this._sp=void 0,this._rs=void 0,this._vaf=void 0,this._spPick=void 0,this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._compiledShaderScaleByDistancePick=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistancePick=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayConditionPick=!1,this._propertiesChanged=new Uint32Array(X),this._maxPixelSize=1,this._baseVolume=new e,this._baseVolumeWC=new e,this._baseVolume2D=new e,this._boundingVolume=new e,this._boundingVolumeDirty=!1,this._colorCommands=[],this._pickCommands=[],this.modelMatrix=c.clone(r(t.modelMatrix,c.IDENTITY)),this._modelMatrix=c.clone(c.IDENTITY),this.debugShowBoundingVolume=r(t.debugShowBoundingVolume,!1),this._mode=T.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW];var i=this;this._uniforms={u_maxTotalPointSize:function(){return i._maxTotalPointSize}}}function A(e){for(var t=e.length,i=0;i0){this._vaf=D(p,o,this._buffersUsage),i=this._vaf.writers;for(var A=0;A0){var K=$;K.length=0,(l[z]||l[W]||l[H])&&K.push(M),(l[U]||l[G])&&K.push(I),(l[k]||l[j])&&K.push(R),l[q]&&K.push(O),l[Y]&&K.push(N);var Q=K.length;if(i=this._vaf.writers,s/o>.1){for(var J=0;J1.5*o&&(a.length=o),n(this._vaf)&&n(this._vaf.va)){this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,e.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));var oe,ae=c.IDENTITY;t.mode===T.SCENE3D?(ae=this.modelMatrix,oe=e.clone(this._baseVolumeWC,this._boundingVolume)):oe=e.clone(this._baseVolume2D,this._boundingVolume),V(this,t,oe);var se,le,ue,ce,he,de,pe=t.commandList;if(C.render){var me=this._colorCommands;for(n(this._rs)||(this._rs=g.fromCache({depthTest:{enabled:!0,func:d.LEQUAL},blending:E.ALPHA_BLEND})),(!n(this._sp)||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition)&&(he=new y({sources:[S]}),this._shaderScaleByDistance&&he.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&he.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&he.defines.push("DISTANCE_DISPLAY_CONDITION"),this._sp=v.replaceCache({context:p,shaderProgram:this._sp,vertexShaderSource:he,fragmentShaderSource:w,attributeLocations:Z}),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition),se=this._vaf.va,le=se.length,me.length=le,ce=0;ce=i&&s<=n&&l>=r&&l<=o&&c.push(e[m]);else{var f=Math.floor((p+d)/2);s=t[2*f],l=t[2*f+1],s>=i&&s<=n&&l>=r&&l<=o&&c.push(e[f]);var _=(h+1)%2;(0===h?i<=s:r<=l)&&(u.push(p),u.push(f-1),u.push(_)),(0===h?n>=s:o>=l)&&(u.push(f+1),u.push(d),u.push(_))}}return c}function o(e,t,i,r,n,s){if(!(n-r<=i)){var l=Math.floor((r+n)/2);a(e,t,l,r,n,s%2),o(e,t,i,r,l-1,s+1),o(e,t,i,l+1,n,s+1)}}function a(e,t,i,r,n,o){for(;n>r;){if(n-r>600){var l=n-r+1,u=i-r+1,c=Math.log(l),h=.5*Math.exp(2*c/3),d=.5*Math.sqrt(c*h*(l-h)/l)*(u-l/2<0?-1:1),p=Math.max(r,Math.floor(i-u*h/l+d)),m=Math.min(n,Math.floor(i+(l-u)*h/l+d));a(e,t,i,p,m,o)}var f=t[2*i+o],_=r,g=n;for(s(e,t,r,i),t[2*n+o]>f&&s(e,t,r,n);_f;)g--}t[2*r+o]===f?s(e,t,r,g):(g++,s(e,t,g,n)),g<=i&&(r=g+1),i<=g&&(n=g-1)}}function s(e,t,i,r){l(e,i,r),l(t,2*i,2*r),l(t,2*i+1,2*r+1)}function l(e,t,i){var r=e[t];e[t]=e[i],e[i]=r}function u(e,t,i,r,n,o){for(var a=[0,e.length-1,0],s=[],l=n*n;a.length;){var u=a.pop(),h=a.pop(),d=a.pop();if(h-d<=o)for(var p=d;p<=h;p++)c(t[2*p],t[2*p+1],i,r)<=l&&s.push(e[p]);else{var m=Math.floor((d+h)/2),f=t[2*m],_=t[2*m+1];c(f,_,i,r)<=l&&s.push(e[m]);var g=(u+1)%2;(0===u?i-n<=f:r-n<=_)&&(a.push(d),a.push(m-1),a.push(g)),(0===u?i+n>=f:r+n>=_)&&(a.push(m+1),a.push(h),a.push(g))}}return s}function c(e,t,i,r){var n=e-i,o=t-r;return n*n+o*o}return t.prototype={range:function(e,t,i,r){return n(this.ids,this.coords,e,t,i,r,this.nodeSize)},within:function(e,t,i){return u(this.ids,this.coords,e,t,i,this.nodeSize)}},e}),i("DataSources/EntityCluster",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/EllipsoidalOccluder","../Core/Event","../Core/Matrix4","../Scene/Billboard","../Scene/BillboardCollection","../Scene/Label","../Scene/LabelCollection","../Scene/PointPrimitive","../Scene/PointPrimitiveCollection","../ThirdParty/kdbush"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f){"use strict";function _(e){e=r(e,r.EMPTY_OBJECT),this._enabled=r(e.enabled,!1),this._pixelRange=r(e.pixelRange,80),this._minimumClusterSize=r(e.minimumClusterSize,2),this._clusterBillboards=r(e.clusterBillboards,!0),this._clusterLabels=r(e.clusterLabels,!0),this._clusterPoints=r(e.clusterPoints,!0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity={},this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._clusterDirty=!1,this._cluster=void 0,this._removeEventListener=void 0,this._clusterEvent=new s}function g(e){return e.coord.x}function v(e){return e.coord.y}function y(e,t){e.x-=t,e.y-=t,e.width+=2*t,e.height+=2*t}function C(t,i,r,o,a){if(n(t._labelCollection)&&o._clusterLabels?a=h.getScreenSpaceBoundingBox(t,i,a):n(t._billboardCollection)&&o._clusterBillboards?a=u.getScreenSpaceBoundingBox(t,i,a):n(t._pointPrimitiveCollection)&&o._clusterPoints&&(a=p.getScreenSpaceBoundingBox(t,i,a)),y(a,r),o._clusterLabels&&!n(t._labelCollection)&&n(t.id)&&E(o,t.id)&&n(t.id._label)){var s=o._collectionIndicesByEntity[t.id],l=o._labelCollection.get(s),c=h.getScreenSpaceBoundingBox(l,i,M);y(c,r),a=e.union(a,c,a)}return a}function w(e,t){if(e.clusterShow=!0,!n(e._labelCollection)&&n(e.id)&&E(t,e.id)&&n(e.id._label)){var i=t._collectionIndicesByEntity[e.id],r=t._labelCollection.get(i);r.clusterShow=!0}}function S(e,t,i,r){var n={billboard:r._clusterBillboardCollection.add(),label:r._clusterLabelCollection.add(),point:r._clusterPointCollection.add()};n.billboard.show=!1,n.point.show=!1,n.label.show=!0,n.label.text=t.toLocaleString(),n.billboard.position=n.label.position=n.point.position=e,r._clusterEvent.raiseEvent(i,n)}function E(e,t){return n(e)&&n(e._collectionIndicesByEntity[t])&&n(e._collectionIndicesByEntity[t].labelIndex)}function b(e,t,i,r,o){if(n(e))for(var a=e.length,s=0;s=A)for(S(J.position,X,Y,r),D.push(J),z=0;z=A){var pe=i.multiplyByScalar(ce,1/X,ce);for(S(pe,X,Y,r),D.push({position:pe,width:ue.width,height:ue.height,minimumWidth:G.width,minimumHeight:G.height}),z=0;z0?(l=c.pop(),u=a.get(l)):(u=a.add(),l=a.length-1),s[r]=l,this._clusterDirty=!0,u}}function A(e,t){var i=e._collectionIndicesByEntity[t];n(i.billboardIndex)||n(i.labelIndex)||n(i.pointIndex)||delete e._collectionIndicesByEntity[t]}function P(e){if(n(e))for(var t=e.length,i=0;i0&&0===this._labelCollection.get(0)._glyphs.length){var t=e.commandList;e.commandList=[],this._labelCollection.update(e),e.commandList=t}this._enabledDirty&&(this._enabledDirty=!1,D(this),this._clusterDirty=!0),this._clusterDirty&&(this._clusterDirty=!1,this._cluster()),n(this._clusterLabelCollection)&&this._clusterLabelCollection.update(e),n(this._clusterBillboardCollection)&&this._clusterBillboardCollection.update(e),n(this._clusterPointCollection)&&this._clusterPointCollection.update(e),n(this._labelCollection)&&this._labelCollection.update(e),n(this._billboardCollection)&&this._billboardCollection.update(e), -n(this._pointCollection)&&this._pointCollection.update(e)},_.prototype.destroy=function(){this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._pointCollection=this._pointCollection&&this._pointCollection.destroy(),this._clusterLabelCollection=this._clusterLabelCollection&&this._clusterLabelCollection.destroy(),this._clusterBillboardCollection=this._clusterBillboardCollection&&this._clusterBillboardCollection.destroy(),this._clusterPointCollection=this._clusterPointCollection&&this._clusterPointCollection.destroy(),n(this._removeEventListener)&&(this._removeEventListener(),this._removeEventListener=void 0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity=void 0,this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._pixelRangeDirty=!1,this._minimumClusterSizeDirty=!1},_}),i("DataSources/CustomDataSource",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./DataSource","./EntityCluster","./EntityCollection"],function(e,t,i,r,n,o,a){"use strict";function s(e){this._name=e,this._clock=void 0,this._changed=new r,this._error=new r,this._isLoading=!1,this._loading=new r,this._entityCollection=new a(this),this._entityCluster=new o}return t(s.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._changed.raiseEvent(this))}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading},set:function(e){n.setLoading(this,e)}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}}),s}),i("DataSources/CylinderGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/CylinderGeometry","../Core/CylinderOutlineGeometry","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E){"use strict";function b(e){this.id=e,this.vertexFormat=void 0,this.length=void 0,this.topRadius=void 0,this.bottomRadius=void 0,this.slices=void 0,this.numberOfVerticalLines=void 0}function T(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(T.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new h,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._options=new b(e),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)}function x(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new b(t._entity)}var A=new y(e.WHITE),P=new C(!0),D=new C(!0),M=new C(!1),I=new C(e.BLACK),R=new C(v.DISABLED),O=new C(new u),N=new e;return a(T,{perInstanceColorAppearanceType:{value:_},materialAppearanceType:{value:f}}),a(T.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!o(this._entity.availability)&&E.isConstant(this._showProperty)&&E.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!o(this._entity.availability)&&E.isConstant(this._showProperty)&&E.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!0},geometryChanged:{get:function(){return this._geometryChanged}}}),T.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},T.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},T.prototype.createFillGeometryInstance=function(r){var n,a,s=this._entity,l=s.isAvailable(r),u=new m(l&&s.isShowing&&this._showProperty.getValue(r)&&this._fillProperty.getValue(r)),h=this._distanceDisplayConditionProperty.getValue(r),f=c.fromDistanceDisplayCondition(h);if(this._materialProperty instanceof y){var _=e.WHITE;o(this._materialProperty.color)&&(this._materialProperty.color.isConstant||l)&&(_=this._materialProperty.color.getValue(r)),a=t.fromColor(_),n={show:u,distanceDisplayCondition:f,color:a}}else n={show:u,distanceDisplayCondition:f};return new d({id:s,geometry:new i(this._options),modelMatrix:s._getModelMatrix(p.MINIMUM_VALUE),attributes:n})},T.prototype.createOutlineGeometryInstance=function(i){var n=this._entity,o=n.isAvailable(i),a=E.getValueOrDefault(this._outlineColorProperty,i,e.BLACK),s=this._distanceDisplayConditionProperty.getValue(i);return new d({id:n,geometry:new r(this._options),modelMatrix:n._getModelMatrix(p.MINIMUM_VALUE),attributes:{show:new m(o&&n.isShowing&&this._showProperty.getValue(i)&&this._showOutlineProperty.getValue(i)),color:t.fromColor(a),distanceDisplayCondition:c.fromDistanceDisplayCondition(s)}})},T.prototype.isDestroyed=function(){return!1},T.prototype.destroy=function(){this._entitySubscription(),s(this)},T.prototype._onEntityPropertyChanged=function(e,t,i,r){if("availability"===t||"position"===t||"orientation"===t||"cylinder"===t){var a=e.cylinder;if(!o(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!o(s)||!s.isConstant||s.getValue(p.MINIMUM_VALUE),u=a.outline,c=o(u);if(c&&u.isConstant&&(c=u.getValue(p.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var h=e.position,d=a.length,m=a.topRadius,g=a.bottomRadius,v=a.show;if(o(v)&&v.isConstant&&!v.getValue(p.MINIMUM_VALUE)||!o(h)||!o(d)||!o(m)||!o(g))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var C=n(a.material,A),w=C instanceof y;this._materialProperty=C,this._fillProperty=n(s,D),this._showProperty=n(v,P),this._showOutlineProperty=n(a.outline,M),this._outlineColorProperty=c?n(a.outlineColor,I):void 0,this._shadowsProperty=n(a.shadows,R),this._distanceDisplayConditionProperty=n(a.distanceDisplayCondition,O);var S=a.slices,b=a.outlineWidth,T=a.numberOfVerticalLines;if(this._fillEnabled=l,this._outlineEnabled=c,h.isConstant&&E.isConstant(e.orientation)&&d.isConstant&&m.isConstant&&g.isConstant&&E.isConstant(S)&&E.isConstant(b)&&E.isConstant(T)){var x=this._options;x.vertexFormat=w?_.VERTEX_FORMAT:f.MaterialSupport.TEXTURED.vertexFormat,x.length=d.getValue(p.MINIMUM_VALUE),x.topRadius=m.getValue(p.MINIMUM_VALUE),x.bottomRadius=g.getValue(p.MINIMUM_VALUE),x.slices=o(S)?S.getValue(p.MINIMUM_VALUE):void 0,x.numberOfVerticalLines=o(T)?T.getValue(p.MINIMUM_VALUE):void 0,this._outlineWidth=o(b)?b.getValue(p.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},T.prototype.createDynamicUpdater=function(e){return new x(e,this)},x.prototype.update=function(n){var a=this._primitives;a.removeAndDestroy(this._primitive),a.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0;var s=this._geometryUpdater,l=s._entity,u=l.cylinder;if(l.isShowing&&l.isAvailable(n)&&E.getValueOrDefault(u.show,n,!0)){var h=this._options,p=l._getModelMatrix(n),m=E.getValueOrUndefined(u.length,n),v=E.getValueOrUndefined(u.topRadius,n),y=E.getValueOrUndefined(u.bottomRadius,n);if(o(p)&&o(m)&&o(v)&&o(y)){h.length=m,h.topRadius=v,h.bottomRadius=y,h.slices=E.getValueOrUndefined(u.slices,n),h.numberOfVerticalLines=E.getValueOrUndefined(u.numberOfVerticalLines,n);var C=this._geometryUpdater.shadowsProperty.getValue(n),w=this._geometryUpdater.distanceDisplayConditionProperty,b=w.getValue(n),T=c.fromDistanceDisplayCondition(b);if(E.getValueOrDefault(u.fill,n,!0)){var x=S.getValue(n,s.fillMaterialProperty,this._material);this._material=x;var A=new f({material:x,translucent:x.isTranslucent(),closed:!0});h.vertexFormat=A.vertexFormat,this._primitive=a.add(new g({geometryInstances:new d({id:l,geometry:new i(h),modelMatrix:p,attributes:{distanceDisplayCondition:T}}),appearance:A,asynchronous:!1,shadows:C}))}if(E.getValueOrDefault(u.outline,n,!1)){h.vertexFormat=_.VERTEX_FORMAT;var P=E.getValueOrClonedDefault(u.outlineColor,n,e.BLACK,N),D=E.getValueOrDefault(u.outlineWidth,n,1),M=1!==P.alpha;this._outlinePrimitive=a.add(new g({geometryInstances:new d({id:l,geometry:new r(h),modelMatrix:p,attributes:{color:t.fromColor(P),distanceDisplayCondition:T}}),appearance:new _({flat:!0,translucent:M,renderState:{lineWidth:s._scene.clampLineWidth(D)}}),asynchronous:!1,shadows:C}))}}}},x.prototype.getBoundingSphere=function(e,t){return w(e,this._primitive,this._outlinePrimitive,t)},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),s(this)},T}),i("Scene/ColorBlendMode",["../Core/freezeObject","../Core/Math"],function(e,t){"use strict";var i={HIGHLIGHT:0,REPLACE:1,MIX:2};return i.getColorBlend=function(e,r){return e===i.HIGHLIGHT?0:e===i.REPLACE?1:e===i.MIX?t.clamp(r,t.EPSILON4,1):void 0},e(i)}),i("DataSources/DataSourceClock",["../Core/Clock","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/JulianDate","./createRawPropertyDescriptor"],function(e,t,i,r,n,o,a,s){"use strict";function l(){this._startTime=void 0,this._stopTime=void 0,this._currentTime=void 0,this._clockRange=void 0,this._clockStep=void 0,this._multiplier=void 0,this._definitionChanged=new o}return r(l.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:s("startTime"),stopTime:s("stopTime"),currentTime:s("currentTime"),clockRange:s("clockRange"),clockStep:s("clockStep"),multiplier:s("multiplier")}),l.prototype.clone=function(e){return i(e)||(e=new l),e.startTime=this.startTime,e.stopTime=this.stopTime,e.currentTime=this.currentTime,e.clockRange=this.clockRange,e.clockStep=this.clockStep,e.multiplier=this.multiplier,e},l.prototype.equals=function(e){return this===e||i(e)&&a.equals(this.startTime,e.startTime)&&a.equals(this.stopTime,e.stopTime)&&a.equals(this.currentTime,e.currentTime)&&this.clockRange===e.clockRange&&this.clockStep===e.clockStep&&this.multiplier===e.multiplier},l.prototype.merge=function(e){this.startTime=t(this.startTime,e.startTime),this.stopTime=t(this.stopTime,e.stopTime),this.currentTime=t(this.currentTime,e.currentTime),this.clockRange=t(this.clockRange,e.clockRange),this.clockStep=t(this.clockStep,e.clockStep),this.multiplier=t(this.multiplier,e.multiplier)},l.prototype.getValue=function(r){return i(r)||(r=new e),r.startTime=t(this.startTime,r.startTime),r.stopTime=t(this.stopTime,r.stopTime),r.currentTime=t(this.currentTime,r.currentTime),r.clockRange=t(this.clockRange,r.clockRange),r.multiplier=t(this.multiplier,r.multiplier),r.clockStep=t(this.clockStep,r.clockStep),r},l}),i("DataSources/GridMaterialProperty",["../Core/Cartesian2","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){e=i(e,i.EMPTY_OBJECT),this._definitionChanged=new o,this._color=void 0,this._colorSubscription=void 0,this._cellAlpha=void 0,this._cellAlphaSubscription=void 0,this._lineCount=void 0,this._lineCountSubscription=void 0,this._lineThickness=void 0,this._lineThicknessSubscription=void 0,this._lineOffset=void 0,this._lineOffsetSubscription=void 0,this.color=e.color,this.cellAlpha=e.cellAlpha,this.lineCount=e.lineCount,this.lineThickness=e.lineThickness,this.lineOffset=e.lineOffset}var u=t.WHITE,c=.1,h=new e(8,8),d=new e(0,0),p=new e(1,1);return n(l.prototype,{isConstant:{get:function(){return s.isConstant(this._color)&&s.isConstant(this._cellAlpha)&&s.isConstant(this._lineCount)&&s.isConstant(this._lineThickness)&&s.isConstant(this._lineOffset)}},definitionChanged:{get:function(){return this._definitionChanged}},color:a("color"),cellAlpha:a("cellAlpha"),lineCount:a("lineCount"),lineThickness:a("lineThickness"),lineOffset:a("lineOffset")}),l.prototype.getType=function(e){return"Grid"},l.prototype.getValue=function(e,t){return r(t)||(t={}),t.color=s.getValueOrClonedDefault(this._color,e,u,t.color),t.cellAlpha=s.getValueOrDefault(this._cellAlpha,e,c),t.lineCount=s.getValueOrClonedDefault(this._lineCount,e,h,t.lineCount),t.lineThickness=s.getValueOrClonedDefault(this._lineThickness,e,p,t.lineThickness),t.lineOffset=s.getValueOrClonedDefault(this._lineOffset,e,d,t.lineOffset),t},l.prototype.equals=function(e){return this===e||e instanceof l&&s.equals(this._color,e._color)&&s.equals(this._cellAlpha,e._cellAlpha)&&s.equals(this._lineCount,e._lineCount)&&s.equals(this._lineThickness,e._lineThickness)&&s.equals(this._lineOffset,e._lineOffset)},l}),i("DataSources/PolylineArrowMaterialProperty",["../Core/Color","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,i,r,n,o){"use strict";function a(e){this._definitionChanged=new r,this._color=void 0,this._colorSubscription=void 0,this.color=e}return i(a.prototype,{isConstant:{get:function(){return o.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:n("color")}),a.prototype.getType=function(e){return"PolylineArrow"},a.prototype.getValue=function(i,r){return t(r)||(r={}),r.color=o.getValueOrClonedDefault(this._color,i,e.WHITE,r.color),r},a.prototype.equals=function(e){return this===e||e instanceof a&&o.equals(this._color,e._color)},a}),i("DataSources/PolylineGlowMaterialProperty",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,i,r,n,o,a){"use strict";function s(e){e=t(e,t.EMPTY_OBJECT),this._definitionChanged=new n,this._color=void 0,this._colorSubscription=void 0,this._glowPower=void 0,this._glowPowerSubscription=void 0,this.color=e.color,this.glowPower=e.glowPower}var l=e.WHITE,u=.25;return r(s.prototype,{isConstant:{get:function(){return a.isConstant(this._color)&&a.isConstant(this._glow)}},definitionChanged:{get:function(){return this._definitionChanged}},color:o("color"),glowPower:o("glowPower")}),s.prototype.getType=function(e){return"PolylineGlow"},s.prototype.getValue=function(e,t){return i(t)||(t={}),t.color=a.getValueOrClonedDefault(this._color,e,l,t.color),t.glowPower=a.getValueOrDefault(this._glowPower,e,u,t.glowPower),t},s.prototype.equals=function(e){return this===e||e instanceof s&&a.equals(this._color,e._color)&&a.equals(this._glowPower,e._glowPower)},s}),i("DataSources/PolylineOutlineMaterialProperty",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,i,r,n,o,a){"use strict";function s(e){e=t(e,t.EMPTY_OBJECT),this._definitionChanged=new n,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this.color=e.color,this.outlineColor=e.outlineColor,this.outlineWidth=e.outlineWidth}var l=e.WHITE,u=e.BLACK,c=1;return r(s.prototype,{isConstant:{get:function(){return a.isConstant(this._color)&&a.isConstant(this._outlineColor)&&a.isConstant(this._outlineWidth)}},definitionChanged:{get:function(){return this._definitionChanged}},color:o("color"),outlineColor:o("outlineColor"),outlineWidth:o("outlineWidth")}),s.prototype.getType=function(e){return"PolylineOutline"},s.prototype.getValue=function(e,t){return i(t)||(t={}),t.color=a.getValueOrClonedDefault(this._color,e,l,t.color),t.outlineColor=a.getValueOrClonedDefault(this._outlineColor,e,u,t.outlineColor),t.outlineWidth=a.getValueOrDefault(this._outlineWidth,e,c),t},s.prototype.equals=function(e){return this===e||e instanceof s&&a.equals(this._color,e._color)&&a.equals(this._outlineColor,e._outlineColor)&&a.equals(this._outlineWidth,e._outlineWidth)},s}),i("DataSources/PositionPropertyArray",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/EventHelper","../Core/ReferenceFrame","./Property"],function(e,t,i,r,n,o,a,s){"use strict";function l(t,i){this._value=void 0,this._definitionChanged=new n,this._eventHelper=new o,this._referenceFrame=e(i,a.FIXED),this.setValue(t)}return i(l.prototype,{isConstant:{get:function(){var e=this._value;if(!t(e))return!0;for(var i=e.length,r=0;r=t;r--)e[r]=e[s--]}for(r=0;r=0||i(g)&&s.compare(_,g)>=0));){for(m[y++]=_,v+=1,l=0;l0&&(f.length=C,u(n,p,f),m.length=y,u(r,d,m))}else{for(l=0;ll)return;if(this._backwardExtrapolationType===a.HOLD)return u.unpack(c,0,r)}if(h>=o){h=o-1;var p=n[h];if(l=this._forwardExtrapolationDuration,this._forwardExtrapolationType===a.NONE||0!==l&&s.secondsDifference(t,p)>l)return;if(this._forwardExtrapolationType===a.HOLD)return h=o-1,u.unpack(c,h*u.packedLength,r)}var m=this._xTable,f=this._yTable,_=this._interpolationAlgorithm,g=this._packedInterpolationLength,v=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;var y=Math.min(_.getRequiredDataPoints(this._interpolationDegree,v),o);y!==this._numberOfPoints&&(this._numberOfPoints=y,m.length=y,f.length=y*g)}var C=this._numberOfPoints-1;if(C<1)return;var w=0,S=o-1,E=S-w+1;if(E>=C+1){var b=h-(C/2|0)-1;bS&&(T=S,b=T-C,b0){n=new Array(r);for(var s=0;sh);var g="function"==typeof e.unpack&&e!==we;if(!d&&!_)return void(f?t[i]=Me(a,r.reference):g?t[i]=new Z(e.unpack(p,0)):t[i]=new Z(p));var v,y=t[i],S=r.epoch;if(c(S)&&(v=w.fromIso8601(S)),d&&!_)return y instanceof Ee||(y=new Ee(e),t[i]=y),y.addSamplesPackedArray(p,v),void Ge(r,y);var E;if(!d&&_)return s=s.clone(),f?s.data=Me(a,r.reference):g?s.data=e.unpack(p,0):s.data=p,c(y)||(y=f?new Y:new Ae,t[i]=y),void(!f&&y instanceof Ae?y.intervals.addInterval(s):y instanceof Y?(s.data=f?s.data:new Z(s.data),y.intervals.addInterval(s)):(E=C.MAXIMUM_INTERVAL.clone(),E.data=y,y=new Y,t[i]=y,y.intervals.addInterval(E),s.data=f?s.data:new Z(s.data),y.intervals.addInterval(s)));c(y)||(y=new Y,t[i]=y),y instanceof Y||(E=C.MAXIMUM_INTERVAL.clone(),E.data=y,y=new Y,t[i]=y,y.intervals.addInterval(E));var b=y.intervals;E=b.findInterval(s),c(E)&&E.data instanceof Ee||(E=s.clone(),E.data=new Ee(e),b.addInterval(E)),E.data.addSamplesPackedArray(p,v),Ge(r,E.data)}function He(e,t,i,r,n,o,a){if(c(r))if(y(r))for(var s=0,l=r.length;s_),!m&&!v)return void(g?e[t]=Me(a,r.reference):e[t]=new X(i.unpack(d),h));var y,S=e[t],E=r.epoch;if(c(E)&&(y=w.fromIso8601(E)),m&&!v)return S instanceof Se&&(!c(h)||S.referenceFrame===h)||(S=new Se(h,f),e[t]=S),S.addSamplesPackedArray(d,y),void Ge(r,S);var b;if(!m&&v)return s=s.clone(),g?s.data=Me(a,r.reference):s.data=i.unpack(d),c(S)||(S=g?new j(h):new xe(h),e[t]=S),void(!g&&S instanceof xe&&c(h)&&S.referenceFrame===h?S.intervals.addInterval(s):S instanceof j?(s.data=g?s.data:new X(s.data,h),S.intervals.addInterval(s)):(b=C.MAXIMUM_INTERVAL.clone(),b.data=S,S=new j(S.referenceFrame),e[t]=S,S.intervals.addInterval(b),s.data=g?s.data:new X(s.data,h),S.intervals.addInterval(s)));c(S)?S instanceof j||(b=C.MAXIMUM_INTERVAL.clone(),b.data=S,S=new j(S.referenceFrame),e[t]=S,S.intervals.addInterval(b)):(S=new j(h),e[t]=S);var T=S.intervals;b=T.findInterval(s),c(b)&&b.data instanceof Se&&(!c(h)||b.data.referenceFrame===h)||(b=s.clone(),b.data=new Se(h,f),T.addInterval(b)),b.data.addSamplesPackedArray(d,y),Ge(r,b.data)}function je(e,t,i,r,n,o){if(c(i))if(y(i))for(var a=0,s=i.length;a. version format.");var n=t._documentPacket;c(e.name)&&(n.name=e.name);var o=e.clock;if(c(o)){var a=n.clock;c(a)?(a.interval=u(o.interval,a.interval),a.currentTime=u(o.currentTime,a.currentTime),a.range=u(o.range,a.range),a.step=u(o.step,a.step),a.multiplier=u(o.multiplier,a.multiplier)):n.clock={interval:o.interval,currentTime:o.currentTime,range:o.range,step:o.step,multiplier:o.multiplier}}}function ht(e,t,i,r){var n=t.ellipse;if(c(n)){var o,s=n.interval;c(s)&&(Nt.iso8601=s,o=R.fromIso8601(Nt));var l=e.ellipse;c(l)||(e.ellipse=l=new ee),He(Boolean,l,"show",n.show,o,r,i),He(Number,l,"semiMajorAxis",n.semiMajorAxis,o,r,i),He(Number,l,"semiMinorAxis",n.semiMinorAxis,o,r,i),He(Number,l,"height",n.height,o,r,i),He(Number,l,"extrudedHeight",n.extrudedHeight,o,r,i),He(we,l,"rotation",n.rotation,o,r,i),He(we,l,"stRotation",n.stRotation,o,r,i),He(Number,l,"granularity",n.granularity,o,r,i),He(Boolean,l,"fill",n.fill,o,r,i),Xe(l,"material",n.material,o,r,i),He(Boolean,l,"outline",n.outline,o,r,i),He(a,l,"outlineColor",n.outlineColor,o,r,i),He(Number,l,"outlineWidth",n.outlineWidth,o,r,i),He(Number,l,"numberOfVerticalLines",n.numberOfVerticalLines,o,r,i),He(V,l,"shadows",n.shadows,o,r,i)}}function dt(e,t,r,n){var o=t.ellipsoid;if(c(o)){var s,l=o.interval;c(l)&&(Nt.iso8601=l,s=R.fromIso8601(Nt));var u=e.ellipsoid;c(u)||(e.ellipsoid=u=new te),He(Boolean,u,"show",o.show,s,n,r),He(i,u,"radii",o.radii,s,n,r),He(Boolean,u,"fill",o.fill,s,n,r),Xe(u,"material",o.material,s,n,r),He(Boolean,u,"outline",o.outline,s,n,r),He(a,u,"outlineColor",o.outlineColor,s,n,r),He(Number,u,"outlineWidth",o.outlineWidth,s,n,r),He(Number,u,"stackPartitions",o.stackPartitions,s,n,r),He(Number,u,"slicePartitions",o.slicePartitions,s,n,r),He(Number,u,"subdivisions",o.subdivisions,s,n,r),He(V,u,"shadows",o.shadows,s,n,r)}}function pt(e,r,n,o){var s=r.label;if(c(s)){var l,u=s.interval;c(u)&&(Nt.iso8601=u,l=R.fromIso8601(Nt));var h=e.label;c(h)||(e.label=h=new ae),He(Boolean,h,"show",s.show,l,o,n),He(String,h,"text",s.text,l,o,n),He(String,h,"font",s.font,l,o,n),He(F,h,"style",s.style,l,o,n),He(Number,h,"scale",s.scale,l,o,n),He(Boolean,h,"showBackground",s.showBackground,l,o,n),He(a,h,"backgroundColor",s.backgroundColor,l,o,n),He(t,h,"backgroundPadding",s.backgroundPadding,l,o,n),He(t,h,"pixelOffset",s.pixelOffset,l,o,n),He(i,h,"eyeOffset",s.eyeOffset,l,o,n),He(B,h,"horizontalOrigin",s.horizontalOrigin,l,o,n),He(k,h,"verticalOrigin",s.verticalOrigin,l,o,n),He(L,h,"heightReference",s.heightReference,l,o,n),He(a,h,"fillColor",s.fillColor,l,o,n),He(a,h,"outlineColor",s.outlineColor,l,o,n),He(Number,h,"outlineWidth",s.outlineWidth,l,o,n),He(x,h,"translucencyByDistance",s.translucencyByDistance,l,o,n),He(x,h,"pixelOffsetScaleByDistance",s.pixelOffsetScaleByDistance,l,o,n)}}function mt(e,t,i,r){var n=t.model;if(c(n)){var o,s=n.interval;c(s)&&(Nt.iso8601=s,o=R.fromIso8601(Nt));var l=e.model;c(l)||(e.model=l=new se),He(Boolean,l,"show",n.show,o,r,i),He(z,l,"uri",n.gltf,o,r,i),He(Number,l,"scale",n.scale,o,r,i),He(Number,l,"minimumPixelSize",n.minimumPixelSize,o,r,i),He(Number,l,"maximumScale",n.maximumScale,o,r,i),He(Boolean,l,"incrementallyLoadTextures",n.incrementallyLoadTextures,o,r,i),He(Boolean,l,"runAnimations",n.runAnimations,o,r,i),He(V,l,"shadows",n.shadows,o,r,i),He(L,l,"heightReference",n.heightReference,o,r,i),He(a,l,"silhouetteColor",n.silhouetteColor,o,r,i),He(Number,l,"silhouetteSize",n.silhouetteSize,o,r,i),He(a,l,"color",n.color,o,r,i),He(N,l,"colorBlendMode",n.colorBlendMode,o,r,i),He(Number,l,"colorBlendAmount",n.colorBlendAmount,o,r,i);var u=n.nodeTransformations;if(c(u))if(y(u))for(var h=0,d=u.length;h-1;u--)i[u](a,e,t,r)}Pt=void 0}function Et(e){var t,i=e._documentPacket.clock;if(!c(i)){if(!c(e._clock)){var r=e._entityCollection.computeAvailability();if(!r.start.equals(C.MINIMUM_VALUE)){var a=r.start,s=r.stop,l=w.secondsDifference(s,a),h=Math.round(l/120);return t=new $,t.startTime=w.clone(a),t.stopTime=w.clone(s),t.clockRange=n.LOOP_STOP,t.multiplier=h,t.currentTime=w.clone(a),t.clockStep=o.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}if(c(e._clock)?t=e._clock.clone():(t=new $,t.startTime=C.MINIMUM_VALUE.clone(),t.stopTime=C.MAXIMUM_VALUE.clone(),t.currentTime=C.MINIMUM_VALUE.clone(),t.clockRange=n.LOOP_STOP,t.clockStep=o.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1),c(i.interval)){Nt.iso8601=i.interval;var d=R.fromIso8601(Nt);t.startTime=d.start,t.stopTime=d.stop}return c(i.currentTime)&&(t.currentTime=w.fromIso8601(i.currentTime)),c(i.range)&&(t.clockRange=u(n[i.range],n.LOOP_STOP)),c(i.step)&&(t.clockStep=u(o[i.step],o.SYSTEM_CLOCK_MULTIPLIER)),c(i.multiplier)&&(t.multiplier=i.multiplier),!t.equals(e._clock)&&(e._clock=t.clone(e._clock),!0)}function bt(e,t,i,r){i=u(i,u.EMPTY_OBJECT);var n=t,o=i.sourceUri;return"string"==typeof t&&(n=b(t),o=u(o,t)),J.setLoading(e,!0),U(n,function(t){return Tt(e,t,o,r)}).otherwise(function(t){return J.setLoading(e,!1),e._error.raiseEvent(e,t),console.log(t),U.reject(t)})}function Tt(e,t,i,r){J.setLoading(e,!0);var n=e._entityCollection;r&&(e._version=void 0,e._documentPacket=new xt,n.removeAll()),At._processCzml(t,n,i,void 0,e);var o=Et(e),a=e._documentPacket;return c(a.name)&&e._name!==a.name?(e._name=a.name,o=!0):!c(e._name)&&c(i)&&(e._name=g(i),o=!0),J.setLoading(e,!1),o&&e._changed.raiseEvent(e),e}function xt(){this.name=void 0, -this.clock=void 0}function At(e){this._name=e,this._changed=new m,this._error=new m,this._isLoading=!1,this._loading=new m,this._clock=void 0,this._documentPacket=new xt,this._version=void 0,this._entityCollection=new re(this),this._entityCluster=new ie}var Pt,Dt=new i,Mt=new I,It=new r,Rt=new R,Ot={HERMITE:v,LAGRANGE:S,LINEAR:E},Nt={iso8601:void 0};return At.load=function(e,t){return(new At).load(e,t)},h(At.prototype,{name:{get:function(){return this._name}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}}),At.updaters=[at,st,lt,ut,ht,dt,pt,mt,Ze,Ke,_t,gt,vt,yt,Ct,Qe,Je,wt,$e,nt],At.prototype.process=function(e,t){return bt(this,e,t,!1)},At.prototype.load=function(e,t){return bt(this,e,t,!0)},At.processPacketData=He,At.processPositionPacketData=je,At.processMaterialPacketData=Xe,At._processCzml=function(e,t,i,r,n){if(r=c(r)?r:At.updaters,y(e))for(var o=0,a=e.length;o0){for(r(f)&&(r(this.oldPrimitive)?_.remove(f):this.oldPrimitive=f),c=0;c0)for(t=0;t0)for(t=0;t0||a>0)&&(r=this._solidBatch.update(e)&&r,r=this._translucentBatch.update(e)&&r),r},h.prototype.getBoundingSphere=function(e,t){return this._solidBatch.contains(e)?this._solidBatch.getBoundingSphere(e,t):this._translucentBatch.contains(e)?this._translucentBatch.getBoundingSphere(e,t):l.FAILED},h.prototype.removeAllPrimitives=function(){this._solidBatch.removeAllPrimitives(),this._translucentBatch.removeAllPrimitives()},h}),i("DataSources/StaticGeometryPerMaterialBatch",["../Core/AssociativeArray","../Core/defined","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/ShowGeometryInstanceAttribute","../Scene/Primitive","./BoundingSphereState","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(t,i,r,n,o){this.primitives=t,this.appearanceType=i,this.materialProperty=r,this.closed=n,this.shadows=o,this.updaters=new e,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new e,this.material=void 0,this.updatersWithAttributes=new e,this.attributes=new e,this.invalidated=!1,this.removeMaterialSubscription=r.definitionChanged.addEventListener(u.prototype.onMaterialChanged,this),this.subscriptions=new e,this.showsUpdated=new e}function c(e,t,i,r){this._items=[],this._primitives=e,this._appearanceType=t,this._closed=i,this._shadows=r}var h=new i;return u.prototype.onMaterialChanged=function(){this.invalidated=!0},u.prototype.isMaterial=function(e){var i=this.materialProperty,r=e.fillMaterialProperty;return r===i||!!t(i)&&i.equals(r)},u.prototype.add=function(e,t){var i=t.entity.id;if(this.updaters.set(i,t),this.geometry.set(i,t.createFillGeometryInstance(e)),t.hasConstantFill&&t.fillMaterialProperty.isConstant&&l.isConstant(t.distanceDisplayConditionProperty)){var r=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(e,i,n,o){"isShowing"===i&&r.showsUpdated.set(e.id,t)}))}else this.updatersWithAttributes.set(i,t);this.createPrimitive=!0},u.prototype.remove=function(e){var i=e.entity.id;if(this.createPrimitive=this.geometry.remove(i)||this.createPrimitive,this.updaters.remove(i)){this.updatersWithAttributes.remove(i);var r=this.subscriptions.get(i);t(r)&&(r(),this.subscriptions.remove(i))}return this.createPrimitive},u.prototype.update=function(e){var a,u,c=!0,d=this.primitive,p=this.primitives,m=this.geometry.values;if(this.createPrimitive){var f=m.length;if(f>0){for(t(d)&&(t(this.oldPrimitive)?p.remove(d):this.oldPrimitive=d),u=0;u=0;r--){var n=t[r];if(n.remove(e)){0===n.updaters.length&&(t.splice(r,1),n.destroy());break}}},c.prototype.update=function(e){var t,i=this._items,r=i.length;for(t=r-1;t>=0;t--){var n=i[t];if(n.invalidated){i.splice(t,1);for(var o=n.updaters.values,a=o.length,s=0;s0){for(i(f)&&(i(this.oldPrimitive)?_.remove(f):this.oldPrimitive=f),u=0;u0){for(r(_)&&(r(this.oldPrimitive)?g.remove(_):this.oldPrimitive=_),h=0;h0)for(h=!0,t=0;t0)for(h=!0,t=0;t-1;t--)i=c[t],r=i.id,n=this._updaters.get(r),n.entity===i?(p(this,n),m(this,e,n)):(l.push(i),a.push(i));for(t=l.length-1;t>-1;t--)i=l[t],r=i.id,n=this._updaters.get(r),p(this,n),n.destroy(),this._updaters.remove(r),this._subscriptions.get(r)(),this._subscriptions.remove(r);for(t=a.length-1;t>-1;t--)i=a[t],r=i.id,n=new this._type(i,this._scene),this._updaters.set(r,n),m(this,e,n),this._subscriptions.set(r,n.geometryChanged.addEventListener(f._onGeometryChanged,this));o.removeAll(),s.removeAll(),u.removeAll();var h=!0,d=this._batches,_=d.length;for(t=0;t<_;t++)h=d[t].update(e)&&h;return h};var g=[],v=new t;return f.prototype.getBoundingSphere=function(e,i){for(var r=g,n=v,o=0,s=a.DONE,l=this._batches,u=l.length,c=0;c-1;r--)o=i[r],n=o.id,a.remove(n)||(s.set(n,o),l.remove(n));for(r=t.length-1;r>-1;r--)o=t[r],n=o.id,s.remove(n)?l.set(n,o):a.set(n,o)},f}),i("DataSources/LabelVisualizer",["../Core/AssociativeArray","../Core/Cartesian2","../Core/Cartesian3","../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/NearFarScalar","../Scene/HeightReference","../Scene/HorizontalOrigin","../Scene/LabelStyle","../Scene/VerticalOrigin","./BoundingSphereState","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f){"use strict";function _(e){this.entity=e,this.label=void 0,this.index=void 0}function g(t,i){i.collectionChanged.addEventListener(g.prototype._onCollectionChanged,this),this._cluster=t,this._entityCollection=i,this._items=new e,this._onCollectionChanged(i,i.values,[],[])}function v(e,t,i){o(e)&&(e.label=void 0,i.removeLabel(t))}var y=1,C="30px sans-serif",w=d.FILL,S=r.WHITE,E=r.BLACK,b=1,T=!1,x=new r(.165,.165,.165,.8),A=new t(7,5),P=t.ZERO,D=i.ZERO,M=c.NONE,I=h.CENTER,R=p.CENTER,O=new i,N=new r,L=new r,B=new r,F=new t,V=new i,k=new t,z=new u,U=new u,G=new l;return g.prototype.update=function(e){for(var t=this._items.values,i=this._cluster,r=0,n=t.length;r-1;n--)a=t[n],o(a._label)&&o(a._position)&&s.set(a.id,new _(a));for(n=r.length-1;n>-1;n--)a=r[n],o(a._label)&&o(a._position)?s.contains(a.id)||s.set(a.id,new _(a)):(v(s.get(a.id),a,l),s.remove(a.id));for(n=i.length-1;n>-1;n--)a=i[n],v(s.get(a.id),a,l),s.remove(a.id)},g}),i("ThirdParty/gltfDefaults",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/Quaternion","../Core/WebGLConstants"],function(e,t,i,r,n){"use strict";function o(e){i(e.accessors)||(e.accessors={});var r=e.accessors;for(var n in r)if(r.hasOwnProperty(n)){var o=r[n];o.byteStride=t(o.byteStride,0)}}function a(e){i(e.animations)||(e.animations={});var r=e.animations;for(var n in r)if(r.hasOwnProperty(n)){var o=r[n];i(o.channels)||(o.channels=[]),i(o.parameters)||(o.parameters={}),i(o.samplers)||(o.samplers={});var a=r.samplers;for(var s in a)if(a.hasOwnProperty(s)){var l=a[s];l.interpolation=t(l.interpolation,"LINEAR")}}}function s(e){i(e.asset)||(e.asset={});var r=e.asset;i(r.profile)&&"string"!=typeof r.profile||(r.profile={});var n=r.profile;r.premultipliedAlpha=t(r.premultipliedAlpha,!1),n.api=t(n.api,"WebGL"),n.version=t(n.version,"1.0.2"),i(e.version)&&(r.version=t(r.version,e.version),delete e.version),"number"==typeof r.version&&(r.version=r.version.toFixed(1).toString())}function l(e){i(e.buffers)||(e.buffers={});var r=e.buffers;for(var n in r)if(r.hasOwnProperty(n)){var o=r[n];o.type=t(o.type,"arraybuffer")}}function u(e){i(e.bufferViews)||(e.bufferViews={})}function c(e){i(e.cameras)||(e.cameras={})}function h(e){i(e.images)||(e.images={})}function d(e){i(e.extensions)||(e.extensions={});var r=e.extensions;i(r.KHR_materials_common)||(r.KHR_materials_common={});var n=r.KHR_materials_common;i(e.lights)?(n.lights=e.lights,delete e.lights):i(n.lights)||(n.lights={});var o=n.lights;for(var a in o)if(o.hasOwnProperty(a)){var s=o[a];if("ambient"===s.type){i(s.ambient)||(s.ambient={});var l=s.ambient;i(l.color)||(l.color=[1,1,1])}else if("directional"===s.type){i(s.directional)||(s.directional={});var u=s.directional;i(u.color)||(u.color=[1,1,1])}else if("point"===s.type){i(s.point)||(s.point={});var c=s.point;i(c.color)||(c.color=[1,1,1]),c.constantAttenuation=t(c.constantAttenuation,1),c.linearAttenuation=t(c.linearAttenuation,0),c.quadraticAttenuation=t(c.quadraticAttenuation,0)}else if("spot"===s.type){i(s.spot)||(s.spot={});var h=s.spot;i(h.color)||(h.color=[1,1,1]),h.constantAttenuation=t(h.constantAttenuation,1),h.fallOffAngle=t(h.fallOffAngle,3.14159265),h.fallOffExponent=t(h.fallOffExponent,0),h.linearAttenuation=t(h.linearAttenuation,0),h.quadraticAttenuation=t(h.quadraticAttenuation,0)}}}function p(e){i(e.materials)||(e.materials={});var t=e.materials;for(var r in t)if(t.hasOwnProperty(r)){var o=t[r],a=o.instanceTechnique;if(i(a)&&(o.technique=a.technique,o.values=a.values,delete o.instanceTechnique),!i(o.extensions))if(i(o.technique))i(o.values)||(o.values={});else{delete o.values,o.extensions={KHR_materials_common:{technique:"CONSTANT",transparent:!1,values:{emission:{type:n.FLOAT_VEC4,value:[.5,.5,.5,1]}}}},i(e.extensionsUsed)||(e.extensionsUsed=[]);var s=e.extensionsUsed;s.indexOf("KHR_materials_common")===-1&&s.push("KHR_materials_common")}}}function m(e){i(e.meshes)||(e.meshes={});var r=e.meshes;for(var o in r)if(r.hasOwnProperty(o)){var a=r[o];i(a.primitives)||(a.primitives=[]);for(var s=a.primitives.length,l=s.length,u=0;u=0,E=_.loop===u.REPEAT||_.loop===u.MIRRORED_REPEAT,b=(S||E&&!i(_.startTime))&&(w<=1||E)&&(!i(C)||a.lessThanOrEquals(l,C));if(b){if(_._state===c.STOPPED&&(_._state=c.ANIMATING,_.start.numberOfListeners>0&&e.afterRender.push(_._raiseStartEvent)),_.loop===u.REPEAT)w-=Math.floor(w);else if(_.loop===u.MIRRORED_REPEAT){var T=Math.floor(w),x=w-T;w=T%2===1?1-x:x}_.reverse&&(w=1-w);var A=w*y*_.speedup;A=s.clamp(A,g.startTime,g.stopTime),d(g,A),_.update.numberOfListeners>0&&(_._updateEventTime=A,e.afterRender.push(_._raiseUpdateEvent)),o=!0}else S&&_._state===c.ANIMATING&&(_._state=c.STOPPED,_.stop.numberOfListeners>0&&e.afterRender.push(_._raiseStopEvent),_.removeOnStop&&m.push(_))}n=m.length;for(var P=0;P0,C=a.values,w="precision highp float;\n",S="precision highp float;\n",E=o(m,"technique",c),b=o(f,"vertexShader",h),T=o(f,"fragmentShader",d),x=o(_,"program",p),A="CONSTANT"!==g,P={modelViewMatrix:{semantic:"MODELVIEW",type:i.FLOAT_MAT4},projectionMatrix:{semantic:"PROJECTION",type:i.FLOAT_MAT4}};A&&(P.normalMatrix={semantic:"MODELVIEWINVERSETRANSPOSE",type:i.FLOAT_MAT3}),y&&(P.jointMatrix={count:v,semantic:"JOINTMATRIX",type:i.FLOAT_MAT4});var D,M=!1;for(var I in C)if(C.hasOwnProperty(I)&&"transparent"!==I&&"doubleSided"!==I){var R=s(I,C[I]);D=I.toLowerCase(),M||R!==i.SAMPLER_2D||(M=!0),P[D]={type:R}}if(t(l))for(var O in l)l.hasOwnProperty(O)&&(P[O]=l[O]);var N={};for(var L in P)if(P.hasOwnProperty(L)){var B=P[L];N["u_"+L]=L;var F=t(B.count)?"["+B.count+"]":"";B.type!==i.FLOAT_MAT3&&B.type!==i.FLOAT_MAT4||B.useInFragment?(S+="uniform "+r(B.type)+" u_"+L+F+";\n",delete B.useInFragment):w+="uniform "+r(B.type)+" u_"+L+F+";\n"}var V="";y&&(V+=" mat4 skinMat = a_weight.x * u_jointMatrix[int(a_joint.x)];\n",V+=" skinMat += a_weight.y * u_jointMatrix[int(a_joint.y)];\n",V+=" skinMat += a_weight.z * u_jointMatrix[int(a_joint.z)];\n",V+=" skinMat += a_weight.w * u_jointMatrix[int(a_joint.w)];\n");var k={a_position:"position"};P.position={semantic:"POSITION",type:i.FLOAT_VEC3},w+="attribute vec3 a_position;\n",w+="varying vec3 v_positionEC;\n",V+=y?" vec4 pos = u_modelViewMatrix * skinMat * vec4(a_position,1.0);\n":" vec4 pos = u_modelViewMatrix * vec4(a_position,1.0);\n",V+=" v_positionEC = pos.xyz;\n",V+=" gl_Position = u_projectionMatrix * pos;\n",S+="varying vec3 v_positionEC;\n",A&&(k.a_normal="normal",P.normal={semantic:"NORMAL",type:i.FLOAT_VEC3},w+="attribute vec3 a_normal;\n",w+="varying vec3 v_normal;\n",V+=y?" v_normal = u_normalMatrix * mat3(skinMat) * a_normal;\n":" v_normal = u_normalMatrix * a_normal;\n",S+="varying vec3 v_normal;\n");var z;M&&(k.a_texcoord_0="texcoord_0",P.texcoord_0={semantic:"TEXCOORD_0",type:i.FLOAT_VEC2},z="v_texcoord_0",w+="attribute vec2 a_texcoord_0;\n",w+="varying vec2 "+z+";\n",V+=" "+z+" = a_texcoord_0;\n",S+="varying vec2 "+z+";\n"),y&&(k.a_joint="joint",P.joint={semantic:"JOINT",type:i.FLOAT_VEC4},k.a_weight="weight",P.weight={semantic:"WEIGHT",type:i.FLOAT_VEC4},w+="attribute vec4 a_joint;\n",w+="attribute vec4 a_weight;\n");var U=A&&("BLINN"===g||"PHONG"===g)&&t(P.specular)&&t(P.shininess),G=!1,W=!1,H="";for(var q in u)if(u.hasOwnProperty(q)){var j=u[q],Y=j.type.toLowerCase(),X=j.baseName;H+=" {\n";var Z,K,Q="u_"+X+"Color";"ambient"===Y?(W=!0,H+=" ambientLight += "+Q+";\n"):A&&(G=!0,Z="v_"+X+"Direction",K="v_"+X+"Position","point"!==Y&&(w+="varying vec3 "+Z+";\n",S+="varying vec3 "+Z+";\n",V+=" "+Z+" = mat3(u_"+X+"Transform) * vec3(0.,0.,1.);\n","directional"===Y&&(H+=" vec3 l = normalize("+Z+");\n")),"directional"!==Y?(w+="varying vec3 "+K+";\n",S+="varying vec3 "+K+";\n",V+=" "+K+" = u_"+X+"Transform[3].xyz;\n",H+=" vec3 VP = "+K+" - v_positionEC;\n",H+=" vec3 l = normalize(VP);\n",H+=" float range = length(VP);\n",H+=" float attenuation = 1.0 / (u_"+X+"Attenuation.x + ",H+="(u_"+X+"Attenuation.y * range) + ",H+="(u_"+X+"Attenuation.z * range * range));\n"):H+=" float attenuation = 1.0;\n","spot"===Y&&(H+=" float spotDot = dot(l, normalize("+Z+"));\n",H+=" if (spotDot < cos(u_"+X+"FallOff.x * 0.5))\n",H+=" {\n",H+=" attenuation = 0.0;\n",H+=" }\n",H+=" else\n",H+=" {\n",H+=" attenuation *= max(0.0, pow(spotDot, u_"+X+"FallOff.y));\n",H+=" }\n"),H+=" diffuseLight += "+Q+"* max(dot(normal,l), 0.) * attenuation;\n",U&&("BLINN"===g?(H+=" vec3 h = normalize(l + viewDir);\n",H+=" float specularIntensity = max(0., pow(max(dot(normal, h), 0.), u_shininess)) * attenuation;\n"):(H+=" vec3 reflectDir = reflect(-l, normal);\n",H+=" float specularIntensity = max(0., pow(max(dot(reflectDir, viewDir), 0.), u_shininess)) * attenuation;\n"),H+=" specularLight += "+Q+" * specularIntensity;\n")),H+=" }\n"}W||(H+=" ambientLight += vec3(0.2, 0.2, 0.2);\n"),G||"CONSTANT"===g||(H+=" vec3 l = normalize(czm_sunDirectionEC);\n",H+=" diffuseLight += vec3(1.0, 1.0, 1.0) * max(dot(normal,l), 0.);\n",U&&("BLINN"===g?(H+=" vec3 h = normalize(l + viewDir);\n",H+=" float specularIntensity = max(0., pow(max(dot(normal, h), 0.), u_shininess));\n"):(H+=" vec3 reflectDir = reflect(-l, normal);\n",H+=" float specularIntensity = max(0., pow(max(dot(reflectDir, viewDir), 0.), u_shininess));\n"),H+=" specularLight += vec3(1.0, 1.0, 1.0) * specularIntensity;\n")),w+="void main(void) {\n",w+=V,w+="}\n",S+="void main(void) {\n";var J=" vec3 color = vec3(0.0, 0.0, 0.0);\n";A&&(S+=" vec3 normal = normalize(v_normal);\n",a.doubleSided&&(S+=" if (gl_FrontFacing == false)\n",S+=" {\n",S+=" normal = -normal;\n",S+=" }\n"));var $;"CONSTANT"!==g?(t(P.diffuse)&&(S+=P.diffuse.type===i.SAMPLER_2D?" vec4 diffuse = texture2D(u_diffuse, "+z+");\n":" vec4 diffuse = u_diffuse;\n",S+=" vec3 diffuseLight = vec3(0.0, 0.0, 0.0);\n",J+=" color += diffuse.rgb * diffuseLight;\n"),U&&(S+=P.specular.type===i.SAMPLER_2D?" vec3 specular = texture2D(u_specular, "+z+").rgb;\n":" vec3 specular = u_specular.rgb;\n",S+=" vec3 specularLight = vec3(0.0, 0.0, 0.0);\n",J+=" color += specular * specularLight;\n"),$=t(P.transparency)?" gl_FragColor = vec4(color * diffuse.a, diffuse.a * u_transparency);\n":" gl_FragColor = vec4(color * diffuse.a, diffuse.a);\n"):$=t(P.transparency)?" gl_FragColor = vec4(color, u_transparency);\n":" gl_FragColor = vec4(color, 1.0);\n",t(P.emission)&&(S+=P.emission.type===i.SAMPLER_2D?" vec3 emission = texture2D(u_emission, "+z+").rgb;\n":" vec3 emission = u_emission.rgb;\n",J+=" color += emission;\n"),(t(P.ambient)||"CONSTANT"!==g)&&(S+=t(P.ambient)?P.ambient.type===i.SAMPLER_2D?" vec3 ambient = texture2D(u_ambient, "+z+").rgb;\n":" vec3 ambient = u_ambient.rgb;\n":" vec3 ambient = diffuse.rgb;\n",J+=" color += ambient * ambientLight;\n"),S+=" vec3 viewDir = -normalize(v_positionEC);\n",S+=" vec3 ambientLight = vec3(0.0, 0.0, 0.0);\n",S+=H,S+=J,S+=$,S+="}\n";var ee;ee=a.transparent?{enable:[i.DEPTH_TEST,i.BLEND],depthMask:!1,functions:{blendEquationSeparate:[i.FUNC_ADD,i.FUNC_ADD],blendFuncSeparate:[i.ONE,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA]}}:a.doubleSided?{enable:[i.DEPTH_TEST]}:{enable:[i.CULL_FACE,i.DEPTH_TEST]},m[E]={attributes:k,parameters:P,program:x,states:ee,uniforms:N},f[b]={type:i.VERTEX_SHADER,uri:"",extras:{source:w}},f[T]={type:i.FRAGMENT_SHADER,uri:"",extras:{source:S}};var te=Object.keys(k);return _[x]={attributes:te,fragmentShader:T,vertexShader:b},E}function s(e,r){var n;switch(n=t(r.value)?r.value:r,e){case"ambient":return n instanceof String||"string"==typeof n?i.SAMPLER_2D:i.FLOAT_VEC4;case"diffuse":return n instanceof String||"string"==typeof n?i.SAMPLER_2D:i.FLOAT_VEC4;case"emission":return n instanceof String||"string"==typeof n?i.SAMPLER_2D:i.FLOAT_VEC4;case"specular":return n instanceof String||"string"==typeof n?i.SAMPLER_2D:i.FLOAT_VEC4;case"shininess":return i.FLOAT;case"transparency":return i.FLOAT;case"transparent":return i.BOOL;case"doubleSided":return i.BOOL}}function l(t){var i="";i+="technique:"+t.technique+";";for(var r=t.values,n=Object.keys(r).sort(),o=n.length,a=0;a0;){d=s.pop();var p=d._transformToRoot,m=d.meshes;if(u(m))for(var f=m.length,_=0;_0;){var a=i.buffersToCreate.dequeue();r=n[a];var s=N.createVertexBuffer({context:t,typedArray:i.getBuffer(r),usage:L.STATIC_DRAW});s.vertexArrayDestroyable=!1,o[a]=s}var l=e.gltf.accessors;for(var c in l)if(l.hasOwnProperty(c)){var h=l[c];if(r=n[h.bufferView],r.target===O.ELEMENT_ARRAY_BUFFER&&!u(o[h.bufferView])){var d=N.createIndexBuffer({context:t,typedArray:i.getBuffer(r),usage:L.STATIC_DRAW,indexDatatype:h.componentType});d.vertexArrayDestroyable=!1,o[h.bufferView]=d}}}}function Be(e,t){var i,r={},n=t.length;for(i=1;i2?"vec"+(y-1):"float",e=C+" "+v+";\n"+e;var w="";5===y?(e="uniform mat4 "+h+";\n"+e,e="uniform vec4 "+d+";\n"+e,w="\nvoid main() {\n "+v+" = "+h+" * "+f+" + "+d+";\n "+g+"();\n}\n",n[h]={mat:4},n[d]={vec:4}):(e="uniform mat"+y+" "+c+";\n"+e,w="\nvoid main() {\n "+v+" = "+C+"("+c+" * vec"+y+"("+f+",1.0));\n "+g+"();\n}\n",n[c]={mat:y}),e=U.replaceMain(e,g),e+=w}}}}return i._programPrimitives[t]=void 0,e}function We(e){var t=e.gltf;return!!u(t.asset)&&l(t.asset.premultipliedAlpha,!1)}function He(e,t){return e=U.replaceMain(e,"gltf_blend_main"),e+="uniform vec4 gltf_color; \nuniform float gltf_colorBlend; \nvoid main() \n{ \n gltf_blend_main(); \n",t&&(e+=" float alpha = 1.0 - ceil(gl_FragColor.a) + gl_FragColor.a; \n gl_FragColor.rgb /= alpha; \n"),e+=" gl_FragColor.rgb = mix(gl_FragColor.rgb, gltf_color.rgb, gltf_colorBlend); \n float highlight = ceil(gltf_colorBlend); \n gl_FragColor.rgb *= mix(gltf_color.rgb, vec3(1.0), highlight); \n gl_FragColor.a *= gltf_color.a; \n} \n"}function qe(e,t,i){return u(i)&&(e=i(e,t)),e}function je(e,t,i){var r=t.gltf.programs,n=t._loadResources.shaders,o=r[e],a=Be(t,o.attributes),s=Fe(t,n[o.vertexShader]),l=Fe(t,n[o.fragmentShader]),c=o.attributes.length,h=t._precreatedAttributes;if(u(h))for(var d in h)h.hasOwnProperty(d)&&(a[d]=c++);Ne(t,"WEB3D_quantized_attributes")&&(s=Ge(s,e,t,i));var p=We(t),m=He(l,p),f=qe(s,e,t._vertexShaderLoaded),_=qe(m,e,t._fragmentShaderLoaded);if(t._rendererResources.programs[e]=z.fromCache({context:i,vertexShaderSource:f,fragmentShaderSource:_,attributeLocations:a}),t.allowPicking){var g=qe(s,e,t._pickVertexShaderLoaded),v=qe(l,e,t._pickFragmentShaderLoaded);t._pickFragmentShaderLoaded||(v=U.createPickFragmentShaderSource(l,"uniform")),t._rendererResources.pickPrograms[e]=z.fromCache({context:i,vertexShaderSource:g,fragmentShaderSource:v,attributeLocations:a})}}function Ye(e,t){var i,r=e._loadResources;if(0===r.pendingShaderLoads&&0===r.pendingBufferLoads)if(e.asynchronous)r.programsToCreate.length>0&&(i=r.programsToCreate.dequeue(),je(i,e,t));else for(;r.programsToCreate.length>0;)i=r.programsToCreate.dequeue(),je(i,e,t)}function Xe(e,t){return function(i){e.texturesToCreate.enqueue({id:t.id,image:i,bufferView:void 0}),--e.pendingBufferViewToImage}}function Ze(e){var t=e._loadResources;if(0===t.pendingBufferLoads)for(;t.texturesToCreateFromBufferView.length>0;){var i=t.texturesToCreateFromBufferView.dequeue(),r=e.gltf,n=r.bufferViews[i.bufferView],o=Xe(t,i),a=Ce(e,"image","id: "+i.id+", bufferView: "+i.bufferView);S(t.getBuffer(n),i.mimeType).then(o).otherwise(a),++t.pendingBufferViewToImage}}function Ke(e,t){var i=e._loadResources;if(i.createSamplers){i.createSamplers=!1;var r=e._rendererResources.samplers,n=e.gltf.samplers;for(var o in n)if(n.hasOwnProperty(o)){var a=n[o];r[o]=new k({wrapS:a.wrapS,wrapT:a.wrapT,minificationFilter:a.minFilter,magnificationFilter:a.magFilter})}}}function Qe(e,t,i){var r=t.gltf.textures,n=r[e.id],o=t._rendererResources.samplers,a=o[n.sampler],s=a.minificationFilter===W.NEAREST_MIPMAP_NEAREST||a.minificationFilter===W.NEAREST_MIPMAP_LINEAR||a.minificationFilter===W.LINEAR_MIPMAP_NEAREST||a.minificationFilter===W.LINEAR_MIPMAP_LINEAR,l=s||a.wrapS===H.REPEAT||a.wrapS===H.MIRRORED_REPEAT||a.wrapT===H.REPEAT||a.wrapT===H.MIRRORED_REPEAT,u=e.image,c=!b.isPowerOfTwo(u.width)||!b.isPowerOfTwo(u.height);if(l&&c){var h=document.createElement("canvas");h.width=b.nextPowerOfTwo(u.width),h.height=b.nextPowerOfTwo(u.height);var d=h.getContext("2d");d.drawImage(u,0,0,u.width,u.height,0,0,h.width,h.height),u=h}var p;n.target===O.TEXTURE_2D&&(p=new G({context:i,source:u,pixelFormat:n.internalFormat,pixelDatatype:n.type,sampler:a,flipY:!1})),s&&p.generateMipmap(),t._rendererResources.textures[e.id]=p}function Je(e,t){var i,r=e._loadResources;if(e.asynchronous)r.texturesToCreate.length>0&&(i=r.texturesToCreate.dequeue(),Qe(i,e,t));else for(;r.texturesToCreate.length>0;)i=r.texturesToCreate.dequeue(),Qe(i,e,t)}function $e(e,t){var i=e.gltf,r=i.techniques,n=i.materials,o={},a=r[n[t.material].technique],s=a.parameters,l=a.attributes,c=e._rendererResources.programs[a.program].vertexAttributes;for(var h in c)if(c.hasOwnProperty(h)){var d=l[h],p=c[h].index;if(u(d)){var m=s[d];o[m.semantic]=p}else o[h]=p}return o}function et(e,t,i){for(var r=e.length,n=0;n0;){var a=o.pop(),s=i[a];if(s.jointName===t)return a;for(var l=s.children,u=l.length,c=0;c0;){var f=p.pop(),_=f.parentRuntimeNode,g=f.gltfNode,v=a[f.id];if(0===v.parents.length)if(u(g.matrix))v.matrix=A.fromColumnMajorArray(g.matrix);else{var y=g.rotation;v.translation=i.fromArray(g.translation),v.rotation=D.unpack(y),v.scale=i.fromArray(g.scale)}u(_)?(_.children.push(v),v.parents.push(_)):o.push(v),u(g.meshes)&&Dt(e,g,v,t,r);for(var C=g.children,w=C.length,S=0;S0;){m=h.pop();var f=m.transformToRoot,_=m.commands;if(m.dirtyNumber===a||r||n){var g=A.multiplyTransformation(d,f,m.computedMatrix),v=_.length;if(v>0)for(var y=0;y0;){o=r.pop();for(var a=o.computedShow,s=o.commands,l=s.length,u=0;u0&&r<1){var n=e._nodeCommands,o=n.length;if(!u(n[0].translucentCommand))for(var a=0;a0&&e.silhouetteColor.alpha>0&&u(e._normalAttributeName)}function jt(e){for(var t=e._nodeCommands,i=t.length,r=0;r0&&e.color.alpha<1}function Xt(e){return 0===e.color.alpha}function Zt(e,t){return Math.floor(e)!==Math.floor(t)||Math.ceil(e)!==Math.ceil(t)}function Kt(e,t){for(var i=++xi%255,r=jt(e)||Yt(e)||e.silhouetteColor.alpha<1,n=e._rendererResources.silhouettePrograms,a=t.scene3DOnly,l=e._nodeCommands,c=l.length,h=0;h=o&&r<=a}if(!m.supportsTypedArrays())return{};var li=A.fromRotationTranslation(x.fromRotationX(b.PI_OVER_TWO)),ui=new i,ci={NEEDS_LOAD:0,LOADING:1,LOADED:2,FAILED:3},hi="model/vnd.gltf.binary,model/vnd.gltf+json,model/gltf.binary,model/gltf+json;q=0.8,application/json;q=0.2,*/*;q=0.01";le.prototype.getBuffer=function(e){return me(this.buffers[e.buffer],e.byteOffset,e.byteLength)},le.prototype.finishedPendingBufferLoads=function(){return 0===this.pendingBufferLoads},le.prototype.finishedBuffersCreation=function(){return 0===this.pendingBufferLoads&&0===this.buffersToCreate.length},le.prototype.finishedProgramCreation=function(){return 0===this.pendingShaderLoads&&0===this.programsToCreate.length},le.prototype.finishedTextureCreation=function(){var e=0===this.pendingTextureLoads,t=0===this.texturesToCreate.length&&0===this.texturesToCreateFromBufferView.length;return e&&t},le.prototype.finishedEverythingButTextureCreation=function(){var e=0===this.pendingBufferLoads&&0===this.pendingShaderLoads,t=0===this.buffersToCreate.length&&0===this.programsToCreate.length&&0===this.pendingBufferViewToImage;return e&&t},le.prototype.finished=function(){return this.finishedTextureCreation()&&this.finishedEverythingButTextureCreation()},c(ce.prototype,{gltf:{set:function(e){this._gltf=re(j(e))},get:function(){return this._gltf}},bgltf:{get:function(){return this._bgltf}}}),ce.prototype.makeReady=function(e,t){this.gltf=e,this._bgltf=t;for(var i=this.modelsToLoad,r=i.length,n=0;nL||M.center.y-M.radiusL||M.center.y-M.radiusL||M.center.y-M.radius-1;r--)f(this,e[r],t,i);return n(this)},m.prototype.getBoundingSphere=function(e,i){var n=this._modelHash[e.id];if(!r(n))return d.FAILED;var o=n.modelPrimitive;if(!r(o)||!o.show)return d.FAILED;if(!o.ready)return d.PENDING;if(o.heightReference===l.NONE)t.transform(o.boundingSphere,o.modelMatrix,i);else{if(!r(o._clampedModelMatrix))return d.PENDING;t.transform(o.boundingSphere,o._clampedModelMatrix,i)}return d.DONE},m.prototype._onCollectionChanged=function(e,t,i,n){var o,a,s=this._entitiesToVisualize,l=this._modelHash,u=this._primitives;for(o=t.length-1;o>-1;o--)a=t[o],r(a._model)&&r(a._position)&&s.set(a.id,a);for(o=n.length-1;o>-1;o--)a=n[o],r(a._model)&&r(a._position)?(_(a,l),s.set(a.id,a)):(f(this,a,l,u),s.remove(a.id));for(o=i.length-1;o>-1;o--)a=i[o],f(this,a,l,u),s.remove(a.id)},m}),i("Shaders/PolylineCommon",[],function(){"use strict";return"void clipLineSegmentToNearPlane(\nvec3 p0,\nvec3 p1,\nout vec4 positionWC,\nout bool clipped,\nout bool culledByNearPlane)\n{\nculledByNearPlane = false;\nclipped = false;\nvec3 p1ToP0 = p1 - p0;\nfloat magnitude = length(p1ToP0);\nvec3 direction = normalize(p1ToP0);\nfloat endPoint0Distance = -(czm_currentFrustum.x + p0.z);\nfloat denominator = -direction.z;\nif (endPoint0Distance < 0.0 && abs(denominator) < czm_epsilon7)\n{\nculledByNearPlane = true;\n}\nelse if (endPoint0Distance < 0.0 && abs(denominator) > czm_epsilon7)\n{\nfloat t = (czm_currentFrustum.x + p0.z) / denominator;\nif (t < 0.0 || t > magnitude)\n{\nculledByNearPlane = true;\n}\nelse\n{\np0 = p0 + t * direction;\nclipped = true;\n}\n}\npositionWC = czm_eyeToWindowCoordinates(vec4(p0, 1.0));\n}\nvec4 getPolylineWindowCoordinates(vec4 position, vec4 previous, vec4 next, float expandDirection, float width, bool usePrevious) {\nvec4 endPointWC, p0, p1;\nbool culledByNearPlane, clipped;\nvec4 positionEC = czm_modelViewRelativeToEye * position;\nvec4 prevEC = czm_modelViewRelativeToEye * previous;\nvec4 nextEC = czm_modelViewRelativeToEye * next;\nclipLineSegmentToNearPlane(prevEC.xyz, positionEC.xyz, p0, clipped, culledByNearPlane);\nclipLineSegmentToNearPlane(nextEC.xyz, positionEC.xyz, p1, clipped, culledByNearPlane);\nclipLineSegmentToNearPlane(positionEC.xyz, usePrevious ? prevEC.xyz : nextEC.xyz, endPointWC, clipped, culledByNearPlane);\nif (culledByNearPlane)\n{\nreturn vec4(0.0, 0.0, 0.0, 1.0);\n}\nvec2 prevWC = normalize(p0.xy - endPointWC.xy);\nvec2 nextWC = normalize(p1.xy - endPointWC.xy);\nfloat expandWidth = width * 0.5;\nvec2 direction;\nif (czm_equalsEpsilon(previous.xyz - position.xyz, vec3(0.0), czm_epsilon1) || czm_equalsEpsilon(prevWC, -nextWC, czm_epsilon1))\n{\ndirection = vec2(-nextWC.y, nextWC.x);\n}\nelse if (czm_equalsEpsilon(next.xyz - position.xyz, vec3(0.0), czm_epsilon1) || clipped)\n{\ndirection = vec2(prevWC.y, -prevWC.x);\n}\nelse\n{\nvec2 normal = vec2(-nextWC.y, nextWC.x);\ndirection = normalize((nextWC + prevWC) * 0.5);\nif (dot(direction, normal) < 0.0)\n{\ndirection = -direction;\n}\nfloat sinAngle = abs(direction.x * nextWC.y - direction.y * nextWC.x);\nexpandWidth = clamp(expandWidth / sinAngle, 0.0, width * 2.0);\n}\nvec2 offset = direction * expandDirection * expandWidth * czm_resolutionScale;\nreturn vec4(endPointWC.xy + offset, -endPointWC.z, 1.0);\n}\n"}),i("Shaders/PolylineFS",[],function(){"use strict";return"varying vec2 v_st;\nvoid main()\n{\nczm_materialInput materialInput;\nmaterialInput.s = v_st.s;\nmaterialInput.st = v_st;\nmaterialInput.str = vec3(v_st, 0.0);\nczm_material material = czm_getMaterial(materialInput);\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n}\n"}),i("Shaders/PolylineVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 position2DHigh;\nattribute vec3 position2DLow;\nattribute vec3 prevPosition3DHigh;\nattribute vec3 prevPosition3DLow;\nattribute vec3 prevPosition2DHigh;\nattribute vec3 prevPosition2DLow;\nattribute vec3 nextPosition3DHigh;\nattribute vec3 nextPosition3DLow;\nattribute vec3 nextPosition2DHigh;\nattribute vec3 nextPosition2DLow;\nattribute vec4 texCoordExpandAndBatchIndex;\nvarying vec2 v_st;\nvarying float v_width;\nvarying vec4 czm_pickColor;\nvoid main()\n{\nfloat texCoord = texCoordExpandAndBatchIndex.x;\nfloat expandDir = texCoordExpandAndBatchIndex.y;\nbool usePrev = texCoordExpandAndBatchIndex.z < 0.0;\nfloat batchTableIndex = texCoordExpandAndBatchIndex.w;\nvec2 widthAndShow = batchTable_getWidthAndShow(batchTableIndex);\nfloat width = widthAndShow.x + 0.5;\nfloat show = widthAndShow.y;\nif (width < 1.0)\n{\nshow = 0.0;\n}\nvec4 pickColor = batchTable_getPickColor(batchTableIndex);\nvec4 p, prev, next;\nif (czm_morphTime == 1.0)\n{\np = czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz);\nprev = czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz);\nnext = czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz);\n}\nelse if (czm_morphTime == 0.0)\n{\np = czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy);\nprev = czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy);\nnext = czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy);\n}\nelse\n{\np = czm_columbusViewMorph(\nczm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy),\nczm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz),\nczm_morphTime);\nprev = czm_columbusViewMorph(\nczm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy),\nczm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz),\nczm_morphTime);\nnext = czm_columbusViewMorph(\nczm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy),\nczm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz),\nczm_morphTime);\n}\n#ifdef DISTANCE_DISPLAY_CONDITION\nvec3 centerHigh = batchTable_getCenterHigh(batchTableIndex);\nvec4 centerLowAndRadius = batchTable_getCenterLowAndRadius(batchTableIndex);\nvec3 centerLow = centerLowAndRadius.xyz;\nfloat radius = centerLowAndRadius.w;\nvec2 distanceDisplayCondition = batchTable_getDistanceDisplayCondition(batchTableIndex);\nfloat lengthSq;\nif (czm_sceneMode == czm_sceneMode2D)\n{\nlengthSq = czm_eyeHeight2D.y;\n}\nelse\n{\nvec4 center = czm_translateRelativeToEye(centerHigh.xyz, centerLow.xyz);\nlengthSq = max(0.0, dot(center.xyz, center.xyz) - radius * radius);\n}\nfloat nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x;\nfloat farSq = distanceDisplayCondition.y * distanceDisplayCondition.y;\nif (lengthSq < nearSq || lengthSq > farSq)\n{\nshow = 0.0;\n}\n#endif\nvec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev);\ngl_Position = czm_viewportOrthographic * positionWC * show;\nv_st = vec2(texCoord, clamp(expandDir, 0.0, 1.0));\nv_width = width;\nczm_pickColor = pickColor;\n}\n"}),i("Scene/Polyline",["../Core/arrayRemoveDuplicates","../Core/BoundingSphere","../Core/Cartesian3","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/Matrix4","../Core/PolylinePipeline","./Material"],function(e,t,i,r,n,o,a,s,l,u,c,h){"use strict";function d(a,s){a=n(a,n.EMPTY_OBJECT),this._show=n(a.show,!0),this._width=n(a.width,1),this._loop=n(a.loop,!1),this._distanceDisplayCondition=a.distanceDisplayCondition,this._material=a.material,o(this._material)||(this._material=h.fromType(h.ColorType,{color:new r(1,1,1,1)}));var l=a.positions;o(l)||(l=[]),this._positions=l,this._actualPositions=e(l,i.equalsEpsilon),this._loop&&this._actualPositions.length>2&&(this._actualPositions===this._positions&&(this._actualPositions=l.slice()),this._actualPositions.push(i.clone(this._actualPositions[0]))),this._length=this._actualPositions.length,this._id=a.id;var d;o(s)&&(d=u.clone(s.modelMatrix)),this._modelMatrix=d,this._segments=c.wrapLongitude(this._actualPositions,d),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(C),this._polylineCollection=s,this._dirty=!1,this._pickId=void 0,this._boundingVolume=t.fromPoints(this._actualPositions),this._boundingVolumeWC=t.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new t}function p(e,t){++e._propertiesChanged[t];var i=e._polylineCollection;o(i)&&(i._updatePolyline(e,t),e._dirty=!0)}var m=d.POSITION_INDEX=0,f=d.SHOW_INDEX=1,_=d.WIDTH_INDEX=2,g=d.MATERIAL_INDEX=3,v=d.POSITION_SIZE_INDEX=4,y=d.DISTANCE_DISPLAY_CONDITION=5,C=d.NUMBER_OF_PROPERTIES=6;return a(d.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e,p(this,f))}},positions:{get:function(){return this._positions},set:function(r){var n=e(r,i.equalsEpsilon);this._loop&&n.length>2&&(n===r&&(n=r.slice()),n.push(i.clone(n[0]))),this._actualPositions.length===n.length&&this._actualPositions.length===this._length||p(this,v),this._positions=r,this._actualPositions=n,this._length=n.length,this._boundingVolume=t.fromPoints(this._actualPositions,this._boundingVolume),this._boundingVolumeWC=t.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),p(this,m),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,p(this,g))}},width:{get:function(){return this._width},set:function(e){var t=this._width;e!==t&&(this._width=e,p(this,_))}},loop:{get:function(){return this._loop},set:function(e){if(e!==this._loop){var t=this._actualPositions;e?t.length>2&&!i.equals(t[0],t[t.length-1])&&(t.length===this._positions.length&&(this._actualPositions=t=this._positions.slice()),t.push(i.clone(t[0]))):t.length>2&&i.equals(t[0],t[t.length-1])&&(t.length-1===this._positions.length?this._actualPositions=this._positions:t.pop()),this._loop=e,p(this,v)}}},id:{get:function(){return this._id},set:function(e){this._id=e,o(this._pickId)&&(this._pickId.object.id=e)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){l.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=l.clone(e,this._distanceDisplayCondition),p(this,y))}}}),d.prototype.update=function(){var e=u.IDENTITY;o(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);var i=this._segments.positions.length,r=this._segments.lengths,n=this._propertiesChanged[m]>0||this._propertiesChanged[v]>0;if(u.equals(e,this._modelMatrix)&&!n||(this._segments=c.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=t.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=e,this._segments.positions.length!==i)p(this,v);else for(var a=r.length,s=0;s0){var F=T.isTranslucent();c>=u?(x=new S({owner:t}),r.push(x)):x=r[c],++c,x.boundingVolume=e.clone(le,x.boundingVolume),x.modelMatrix=n,x.shaderProgram=D,x.vertexArray=v.va,x.renderState=F?t._translucentRS:t._opaqueRS,x.pass=F?E.TRANSLUCENT:E.OPAQUE,x.debugShowBoundingVolume=!!o&&p,x.uniformMap=f(T._uniforms),x.count=R,x.offset=P,P+=R,R=0,h=!0,s.push(x)}T=N._material,T.update(a),b=B}for(var V=N._locatorBuckets,k=V.length,z=0;z0&&(c>=u?(x=new S({owner:t}),r.push(x)):x=r[c],++c,x.boundingVolume=e.clone(le,x.boundingVolume),x.modelMatrix=n,x.shaderProgram=D,x.vertexArray=v.va,x.renderState=T.isTranslucent()?t._translucentRS:t._opaqueRS,x.pass=T.isTranslucent()?E.TRANSLUCENT:E.OPAQUE,x.debugShowBoundingVolume=!!o&&p,x.uniformMap=f(T._uniforms),x.count=R,x.offset=P,h=!0,s.push(x)),b=void 0}r.length=c}function k(e){var t=!1,i=e._propertiesChanged,r=e._positionBufferUsage;return i[$]?r.bufferUsage!==C.STREAM_DRAW?(t=!0,r.bufferUsage=C.STREAM_DRAW,r.frameCount=100):r.frameCount=100:r.bufferUsage!==C.STATIC_DRAW&&(0===r.frameCount?(t=!0,r.bufferUsage=C.STATIC_DRAW):r.frameCount--),t}function z(e,t,i){e._createVertexArray=!1,q(e),j(e),G(e);var r,n,o=[[]],s=o[0],u=e._batchTable,c=[0],h=0,d=[[]],m=0,_=e._polylineBuckets;for(r in _)_.hasOwnProperty(r)&&(n=_[r],n.updateShader(t,u),m+=n.lengthOfPositions);if(m>0){var g,v=e._mode,w=new Float32Array(6*m*3),S=new Float32Array(4*m),E=0,b=0,T=0;for(r in _)if(_.hasOwnProperty(r)){n=_[r],n.write(w,S,E,b,T,u,t,i),v===L.MORPHING&&(l(g)||(g=new Float32Array(6*m*3)),n.writeForMorph(g,E));var x=n.lengthOfPositions;E+=6*x*3,b+=4*x,T+=4*x,h=n.updateIndices(o,c,d,h)}var P=e._positionBufferUsage.bufferUsage,D=C.STATIC_DRAW;e._positionBuffer=y.createVertexBuffer({context:t,typedArray:w,usage:P});var M;l(g)&&(M=y.createVertexBuffer({context:t,typedArray:g,usage:P})),e._texCoordExpandAndBatchIndexBuffer=y.createVertexBuffer({context:t,typedArray:S,usage:D});for(var I=3*Float32Array.BYTES_PER_ELEMENT,R=4*Float32Array.BYTES_PER_ELEMENT,O=0,N=o.length,B=0;B0){var F=new Uint16Array(s),V=y.createIndexBuffer({context:t,typedArray:F,usage:C.STATIC_DRAW,indexDatatype:p.UNSIGNED_SHORT});O+=c[B];var k,z,U,W,H=6*(B*(I*f.SIXTY_FOUR_KILOBYTES)-O*I),Y=I+H,X=I+Y,Z=I+X,K=I+Z,Q=I+K,J=B*(R*f.SIXTY_FOUR_KILOBYTES)-O*R,$=[{index:ne.position3DHigh,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:H,strideInBytes:6*I},{index:ne.position3DLow,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:Y,strideInBytes:6*I},{index:ne.position2DHigh,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:H,strideInBytes:6*I},{index:ne.position2DLow,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:Y,strideInBytes:6*I},{index:ne.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:X,strideInBytes:6*I},{index:ne.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:Z,strideInBytes:6*I},{index:ne.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:X,strideInBytes:6*I},{index:ne.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:Z,strideInBytes:6*I},{index:ne.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:K,strideInBytes:6*I},{index:ne.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:Q,strideInBytes:6*I},{index:ne.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:K,strideInBytes:6*I},{index:ne.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:Q,strideInBytes:6*I},{index:ne.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:a.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:J}];v===L.SCENE3D?(k=e._positionBuffer,z="vertexBuffer",U=ce,W="value"):v===L.SCENE2D||v===L.COLUMBUS_VIEW?(k=ce,z="value",U=e._positionBuffer,W="vertexBuffer"):(k=M,z="vertexBuffer",U=e._positionBuffer,W="vertexBuffer"),$[0][z]=k,$[1][z]=k,$[2][W]=U,$[3][W]=U,$[4][z]=k,$[5][z]=k,$[6][W]=U,$[7][W]=U,$[8][z]=k,$[9][z]=k,$[10][W]=U,$[11][W]=U;var ee=new A({context:t,attributes:$,indexBuffer:V});e._vertexArrays.push({va:ee,buckets:d[B]})}}}function U(e){var t=O._uniformList[e.type],i=t.length;he.length=2*i;for(var r=0,n=0;n1){s.update();var u=s.material,c=r[u.type];l(c)||(c=r[u.type]=new Z(u,t,i)),c.addPolyline(s)}}}function W(e,t){var i=t.mode;e._mode===i&&_.equals(e._modelMatrix,e.modelMatrix)||(e._mode=i,e._modelMatrix=_.clone(e.modelMatrix),e._createVertexArray=!0)}function H(e){if(e._polylinesRemoved){e._polylinesRemoved=!1;for(var t=[],i=e._polylines.length,r=0,n=0;r2){if(a[$]||a[te]){var C=e.mode===L.SCENE2D?i._boundingVolume2D:i._boundingVolumeWC,S=d.fromCartesian(C.center,oe),E=r.fromElements(S.low.x,S.low.y,S.low.z,C.radius,ae);this._batchTable.setBatchedAttribute(i._index,2,S.high),this._batchTable.setBatchedAttribute(i._index,3,E)}if(a[ie]){var T=se;T.x=0,T.y=Number.MAX_VALUE;var x=i.distanceDisplayCondition;l(x)&&(T.x=x.near,T.x=x.far),this._batchTable.setBatchedAttribute(i._index,4,T)}}i._clean()}s.length=0,this._polylinesUpdated=!1}a=this._propertiesChanged;for(var A=0;A0,E=C._index,b=this.getSegments(C,h),T=b.positions,x=b.lengths,A=T.length,P=C.getPickId(c).color,D=0,M=0,I=0;I0||de.x>0&&pe.x<0)&&i.clone(de,pe),(de.x<0&&me.x>0||de.x>0&&me.x<0)&&i.clone(de,me));for(var B=O?2:0,F=N?2:4,V=B;V2&&(u.setBatchedAttribute(E,2,H),u.setBatchedAttribute(E,3,q),u.setBatchedAttribute(E,4,j))}};var ve=new i,ye=new i,Ce=new i,we=new i;Z.prototype.writeForMorph=function(e,t){for(var r=this.modelMatrix,n=this.polylines,o=n.length,a=0;a0&&(l=s[s.length-1]+1);for(var u=this.polylines,c=u.length,h=0;h0))continue;p[0]=m}else p=d._segments.lengths;var _=p.length;if(_>0){for(var g=0,v=0;v<_;++v)for(var y=p[v]-1,C=0;C=f.SIXTY_FOUR_KILOBYTES-2&&(d._locatorBuckets.push({locator:o,count:g}),g=0,t.push(4),s=[],e.push(s),l=0,o.count=a,a=0,r=0,o=new X(0,0,this),i[++n]=[o]),s.push(l,l+2,l+1),s.push(l+1,l+2,l+3),g+=6,a+=6,r+=6,l+=4;d._locatorBuckets.push({locator:o,count:g}),l+4>=f.SIXTY_FOUR_KILOBYTES-2&&(t.push(0),s=[],e.push(s),l=0,o.count=a,r=0,a=0,o=new X(0,0,this),i[++n]=[o])}d._clean()}return o.count=a,r},Z.prototype.getPolylineStartIndex=function(e){for(var t=this.polylines,i=0,r=t.length,n=0;n0){t._boundingVolume2D=e.fromPoints(s,t._boundingVolume2D);var d=t._boundingVolume2D.center;t._boundingVolume2D.center=new i(d.z,d.x,d.y)}return Ee.positions=s,Ee.lengths=t._segments.lengths,Ee};var Ae;return Z.prototype.writeUpdate=function(e,t,r,n){var o=this.mode,a=n.ellipsoid.maximumRadius*f.PI,s=t._actualLength;if(s){e+=this.getPolylineStartIndex(t);var u=Ae,c=6*s*3;!l(u)||u.lengthc&&(u=new Float32Array(u.buffer,0,c));var h,p=this.getSegments(t,n),m=p.positions,_=p.lengths,g=0,v=0,y=0;s=m.length;for(var C=0;C0||de.x>0&&pe.x<0)&&i.clone(de,pe),(de.x<0&&me.x>0||de.x>0&&me.x<0)&&i.clone(de,me));for(var b=S?2:0,T=E?2:4,x=b;x0&&!w){var S=n[g+1],E=o.secondsDifference(S,y);w=E>l,w&&(p=Math.ceil(E/l),m=0,f=E/Math.max(p,2),p=Math.max(p-1,1))}if(w&&m0){var b=S.pop();c=this._polylineCollection.get(b),t.index=b}else t.index=this._polylineCollection.length,c=this._polylineCollection.add();c.id=a,t.polyline=c}var T=_.getValueOrDefault(s._resolution,e,I);c.show=!0,c.positions=P(l,r,n,e,this._referenceFrame,T,c.positions.slice()),c.material=f.getValue(e,s._material,c.material),c.width=_.getValueOrDefault(s._width,e,R),c.distanceDisplayCondition=_.getValueOrUndefined(s._distanceDisplayCondition,e,c.distanceDisplayCondition)},D.prototype.removeObject=function(e){var t=e.polyline;i(t)&&(this._unusedIndexes.push(e.index),e.polyline=void 0,t.show=!1,t.id=void 0,e.index=void 0)},D.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),r(this)},M.prototype.update=function(e){var t=this._updaters;for(var r in t)t.hasOwnProperty(r)&&t[r].update(e);for(var n=this._items.values,o=0,a=n.length;o-1;o--)a=t[o],i(a._path)&&i(a._position)&&l.set(a.id,new w(a));for(o=n.length-1;o>-1;o--)a=n[o],i(a._path)&&i(a._position)?l.contains(a.id)||l.set(a.id,new w(a)):(s=l.get(a.id),i(s)&&(s.updater.removeObject(s),l.remove(a.id)));for(o=r.length-1;o>-1;o--)a=r[o],s=l.get(a.id),i(s)&&(i(s.updater)&&s.updater.removeObject(s),l.remove(a.id))},M._subSample=P,M}),i("DataSources/PointVisualizer",["../Core/AssociativeArray","../Core/Cartesian3","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/NearFarScalar","../Scene/HeightReference","./BoundingSphereState","./Property"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(e){this.entity=e,this.pointPrimitive=void 0,this.billboard=void 0,this.color=void 0,this.outlineColor=void 0,this.pixelSize=void 0,this.outlineWidth=void 0}function d(t,i){i.collectionChanged.addEventListener(d.prototype._onCollectionChanged,this),this._cluster=t,this._entityCollection=i,this._items=new e,this._onCollectionChanged(i,i.values,[],[])}function p(e,t,i){if(r(e)){var n=e.pointPrimitive;if(r(n))return e.pointPrimitive=void 0,void i.removePoint(t);var o=e.billboard;r(o)&&(e.billboard=void 0,i.removeBillboard(t))}}function m(e,t,i,r,n){return function(o){var a=document.createElement("canvas"),s=n+2*r;a.height=a.width=s;var l=a.getContext("2d");return l.clearRect(0,0,s,s),0!==r&&(l.beginPath(),l.arc(s/2,s/2,s/2,0,2*Math.PI,!0),l.closePath(),l.fillStyle=i,l.fill(),e<1&&(l.save(),l.globalCompositeOperation="destination-out",l.beginPath(),l.arc(s/2,s/2,n/2,0,2*Math.PI,!0),l.closePath(),l.fillStyle="black",l.fill(),l.restore())),l.beginPath(),l.arc(s/2,s/2,n/2,0,2*Math.PI,!0),l.closePath(),l.fillStyle=t,l.fill(),a}}var f=i.WHITE,_=i.BLACK,g=0,v=1,y=new i,C=new t,w=new i,S=new s,E=new s,b=new a;return d.prototype.update=function(e){for(var t=this._items.values,n=this._cluster,o=0,a=t.length;o0?(T.scale=1,P=P||I!==s.outlineWidth||R!==s.pixelSize||!i.equals(D,s.color)||!i.equals(M,s.outlineColor)):(T.scale=R/50,R=50,P=P||I!==s.outlineWidth||!i.equals(D,s.color)||!i.equals(M,s.outlineColor)),P){s.color=i.clone(D,s.color),s.outlineColor=i.clone(M,s.outlineColor),s.pixelSize=R,s.outlineWidth=I;var O=D.alpha,N=D.toCssColorString(),L=M.toCssColorString(),B=JSON.stringify([N,R,L,I]);T.setImage(B,m(O,N,L,I,R))}}}else p(s,u,n)}return!0},d.prototype.getBoundingSphere=function(e,i){var n=this._items.get(e.id);if(!r(n)||!r(n.pointPrimitive)&&!r(n.billboard))return u.FAILED;if(r(n.pointPrimitive))i.center=t.clone(n.pointPrimitive.position,i.center);else{var o=n.billboard;if(!r(o._clampedPosition))return u.PENDING;i.center=t.clone(o._clampedPosition,i.center)}return i.radius=0,u.DONE},d.prototype.isDestroyed=function(){return!1},d.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(d.prototype._onCollectionChanged,this);for(var e=this._entityCollection.values,t=0;t-1;o--)a=t[o],r(a._point)&&r(a._position)&&s.set(a.id,new h(a));for(o=n.length-1;o>-1;o--)a=n[o],r(a._point)&&r(a._position)?s.contains(a.id)||s.set(a.id,new h(a)):(p(s.get(a.id),a,l),s.remove(a.id));for(o=i.length-1;o>-1;o--)a=i[o],p(s.get(a.id),a,l),s.remove(a.id)},d}),i("DataSources/PolygonGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/isArray","../Core/Iso8601","../Core/oneTimeWarning","../Core/PolygonGeometry","../Core/PolygonHierarchy","../Core/PolygonOutlineGeometry","../Core/ShowGeometryInstanceAttribute","../Scene/GroundPrimitive","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A){"use strict";function P(e){this.id=e,this.vertexFormat=void 0,this.polygonHierarchy=void 0,this.perPositionHeight=void 0,this.closeTop=void 0,this.closeBottom=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0}function D(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(D.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._isClosed=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new u,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._onTerrain=!1,this._options=new P(e),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}function M(e,t,i){this._primitives=e,this._groundPrimitives=t,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=i,this._options=new P(i._entity)}var I=new E(e.WHITE),R=new b(!0),O=new b(!0),N=new b(!1),L=new b(e.BLACK),B=new b(S.DISABLED),F=new b(new s),V=new e;return n(D,{perInstanceColorAppearanceType:{value:C},materialAppearanceType:{value:y}}),n(D.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!r(this._entity.availability)&&A.isConstant(this._showProperty)&&A.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!r(this._entity.availability)&&A.isConstant(this._showProperty)&&A.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},onTerrain:{get:function(){return this._onTerrain}},geometryChanged:{get:function(){return this._geometryChanged}}}),D.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},D.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},D.prototype.createFillGeometryInstance=function(i){var n,o,a=this._entity,s=a.isAvailable(i),u=new g(s&&a.isShowing&&this._showProperty.getValue(i)&&this._fillProperty.getValue(i)),h=this._distanceDisplayConditionProperty.getValue(i),d=l.fromDistanceDisplayCondition(h);if(this._materialProperty instanceof E){var p=e.WHITE;r(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(p=this._materialProperty.color.getValue(i)),o=t.fromColor(p),n={show:u,distanceDisplayCondition:d,color:o}}else n={show:u,distanceDisplayCondition:d};return new c({id:a,geometry:new m(this._options),attributes:n})},D.prototype.createOutlineGeometryInstance=function(i){var r=this._entity,n=r.isAvailable(i),o=A.getValueOrDefault(this._outlineColorProperty,i,e.BLACK),a=this._distanceDisplayConditionProperty.getValue(i);return new c({id:r,geometry:new _(this._options),attributes:{show:new g(n&&r.isShowing&&this._showProperty.getValue(i)&&this._showOutlineProperty.getValue(i)),color:t.fromColor(o),distanceDisplayCondition:l.fromDistanceDisplayCondition(a)}})},D.prototype.isDestroyed=function(){return!1},D.prototype.destroy=function(){this._entitySubscription(),o(this)},D.prototype._onEntityPropertyChanged=function(e,t,n,o){if("availability"===t||"polygon"===t){var a=this._entity.polygon;if(!r(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!r(s)||!s.isConstant||s.getValue(d.MINIMUM_VALUE),u=a.perPositionHeight,c=r(u)&&(!u.isConstant||u.getValue(d.MINIMUM_VALUE)),m=a.outline,_=r(m);if(_&&m.isConstant&&(_=m.getValue(d.MINIMUM_VALUE)),!l&&!_)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var g=a.hierarchy,w=a.show;if(r(w)&&w.isConstant&&!w.getValue(d.MINIMUM_VALUE)||!r(g))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var S=i(a.material,I),b=S instanceof E;this._materialProperty=S,this._fillProperty=i(s,O),this._showProperty=i(w,R),this._showOutlineProperty=i(a.outline,N),this._outlineColorProperty=_?i(a.outlineColor,L):void 0,this._shadowsProperty=i(a.shadows,B),this._distanceDisplayConditionProperty=i(a.distanceDisplayCondition,F);var T=a.height,x=a.extrudedHeight,P=a.granularity,D=a.stRotation,M=a.outlineWidth,V=l&&!r(T)&&!r(x)&&b&&!c&&v.isSupported(this._scene);_&&V&&(p(p.geometryOutlines),_=!1);var k=a.perPositionHeight,z=a.closeTop,U=a.closeBottom;if(this._fillEnabled=l,this._onTerrain=V,this._outlineEnabled=_,g.isConstant&&A.isConstant(T)&&A.isConstant(x)&&A.isConstant(P)&&A.isConstant(D)&&A.isConstant(M)&&A.isConstant(u)&&A.isConstant(k)&&A.isConstant(z)&&A.isConstant(U)&&(!V||A.isConstant(S))){var G=this._options;G.vertexFormat=b?C.VERTEX_FORMAT:y.MaterialSupport.TEXTURED.vertexFormat;var W=g.getValue(d.MINIMUM_VALUE);h(W)&&(W=new f(W));var H=A.getValueOrUndefined(T,d.MINIMUM_VALUE),q=A.getValueOrDefault(z,d.MINIMUM_VALUE,!0),j=A.getValueOrDefault(U,d.MINIMUM_VALUE,!0),Y=A.getValueOrUndefined(x,d.MINIMUM_VALUE);G.polygonHierarchy=W,G.height=H,G.extrudedHeight=Y,G.granularity=A.getValueOrUndefined(P,d.MINIMUM_VALUE),G.stRotation=A.getValueOrUndefined(D,d.MINIMUM_VALUE),G.perPositionHeight=A.getValueOrUndefined(k,d.MINIMUM_VALUE),G.closeTop=q,G.closeBottom=j,this._outlineWidth=A.getValueOrDefault(M,d.MINIMUM_VALUE,1),this._isClosed=r(Y)&&Y!==H&&q&&j,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},D.prototype.createDynamicUpdater=function(e,t){return new M(e,t,this)},M.prototype.update=function(i){var n=this._geometryUpdater,o=n._onTerrain,a=this._primitives,s=this._groundPrimitives;o?s.removeAndDestroy(this._primitive):(a.removeAndDestroy(this._primitive),a.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;var l=n._entity,u=l.polygon;if(l.isShowing&&l.isAvailable(i)&&A.getValueOrDefault(u.show,i,!0)){var d=this._options,p=A.getValueOrUndefined(u.hierarchy,i);if(r(p)){h(p)?d.polygonHierarchy=new f(p):d.polygonHierarchy=p;var g=A.getValueOrDefault(u.closeTop,i,!0),S=A.getValueOrDefault(u.closeBottom,i,!0);d.height=A.getValueOrUndefined(u.height,i),d.extrudedHeight=A.getValueOrUndefined(u.extrudedHeight,i),d.granularity=A.getValueOrUndefined(u.granularity,i),d.stRotation=A.getValueOrUndefined(u.stRotation,i),d.perPositionHeight=A.getValueOrUndefined(u.perPositionHeight,i),d.closeTop=g,d.closeBottom=S;var E=this._geometryUpdater.shadowsProperty.getValue(i);if(A.getValueOrDefault(u.fill,i,!0)){var b=n.fillMaterialProperty,T=x.getValue(i,b,this._material);if(this._material=T,o){var P=e.WHITE;r(b.color)&&(P=b.color.getValue(i)),this._primitive=s.add(new v({geometryInstances:new c({id:l,geometry:new m(d),attributes:{color:t.fromColor(P)}}),asynchronous:!1,shadows:E}))}else{var D=new y({material:T,translucent:T.isTranslucent(),closed:r(d.extrudedHeight)&&d.extrudedHeight!==d.height&&g&&S});d.vertexFormat=D.vertexFormat,this._primitive=a.add(new w({geometryInstances:new c({id:l,geometry:new m(d)}),appearance:D,asynchronous:!1,shadows:E}))}}if(!o&&A.getValueOrDefault(u.outline,i,!1)){d.vertexFormat=C.VERTEX_FORMAT;var M=A.getValueOrClonedDefault(u.outlineColor,i,e.BLACK,V),I=A.getValueOrDefault(u.outlineWidth,i,1),R=1!==M.alpha;this._outlinePrimitive=a.add(new w({geometryInstances:new c({id:l,geometry:new _(d),attributes:{color:t.fromColor(M)}}),appearance:new C({flat:!0,translucent:R,renderState:{lineWidth:n._scene.clampLineWidth(I)}}),asynchronous:!1,shadows:E}))}}}},M.prototype.getBoundingSphere=function(e,t){return T(e,this._primitive,this._outlinePrimitive,t)},M.prototype.isDestroyed=function(){return!1},M.prototype.destroy=function(){var e=this._primitives,t=this._groundPrimitives;this._geometryUpdater._onTerrain?t.removeAndDestroy(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),o(this)},D}),i("Shaders/Appearances/PolylineColorAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 prevPosition3DHigh;\nattribute vec3 prevPosition3DLow;\nattribute vec3 nextPosition3DHigh;\nattribute vec3 nextPosition3DLow;\nattribute vec2 expandAndWidth;\nattribute vec4 color;\nattribute float batchId;\nvarying vec4 v_color;\nvoid main()\n{\nfloat expandDir = expandAndWidth.x;\nfloat width = abs(expandAndWidth.y) + 0.5;\nbool usePrev = expandAndWidth.y < 0.0;\nvec4 p = czm_computePosition();\nvec4 prev = czm_computePrevPosition();\nvec4 next = czm_computeNextPosition();\nv_color = color;\nvec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev);\ngl_Position = czm_viewportOrthographic * positionWC;\n}\n"}),i("Scene/PolylineColorAppearance",["../Core/defaultValue","../Core/defineProperties","../Core/VertexFormat","../Shaders/Appearances/PerInstanceFlatColorAppearanceFS","../Shaders/Appearances/PolylineColorAppearanceVS","../Shaders/PolylineCommon","./Appearance"],function(e,t,i,r,n,o,a){"use strict";function s(t){t=e(t,e.EMPTY_OBJECT);var i=e(t.translucent,!0),r=!1,n=s.VERTEX_FORMAT;this.material=void 0,this.translucent=i,this._vertexShaderSource=e(t.vertexShaderSource,l),this._fragmentShaderSource=e(t.fragmentShaderSource,u),this._renderState=a.getDefaultRenderState(i,r,t.renderState),this._closed=r,this._vertexFormat=n}var l=o+"\n"+n,u=r;return t(s.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}}),s.VERTEX_FORMAT=i.POSITION_ONLY,s.prototype.getFragmentShaderSource=a.prototype.getFragmentShaderSource,s.prototype.isTranslucent=a.prototype.isTranslucent,s.prototype.getRenderState=a.prototype.getRenderState,s}),i("Shaders/Appearances/PolylineMaterialAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 prevPosition3DHigh;\nattribute vec3 prevPosition3DLow;\nattribute vec3 nextPosition3DHigh;\nattribute vec3 nextPosition3DLow;\nattribute vec2 expandAndWidth;\nattribute vec2 st;\nattribute float batchId;\nvarying float v_width;\nvarying vec2 v_st;\nvoid main()\n{\nfloat expandDir = expandAndWidth.x;\nfloat width = abs(expandAndWidth.y) + 0.5;\nbool usePrev = expandAndWidth.y < 0.0;\nvec4 p = czm_computePosition();\nvec4 prev = czm_computePrevPosition();\nvec4 next = czm_computeNextPosition();\nv_width = width;\nv_st = st;\nvec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev);\ngl_Position = czm_viewportOrthographic * positionWC;\n}\n"}),i("Scene/PolylineMaterialAppearance",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/VertexFormat","../Shaders/Appearances/PolylineMaterialAppearanceVS","../Shaders/PolylineCommon","../Shaders/PolylineFS","./Appearance","./Material"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(i){i=e(i,e.EMPTY_OBJECT);var r=e(i.translucent,!0),n=!1,o=u.VERTEX_FORMAT;this.material=t(i.material)?i.material:l.fromType(l.ColorType),this.translucent=r,this._vertexShaderSource=e(i.vertexShaderSource,c),this._fragmentShaderSource=e(i.fragmentShaderSource,h),this._renderState=s.getDefaultRenderState(r,n,i.renderState),this._closed=n,this._vertexFormat=o}var c=o+"\n"+n,h=a;return i(u.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}}),u.VERTEX_FORMAT=r.POSITION_AND_ST,u.prototype.getFragmentShaderSource=s.prototype.getFragmentShaderSource,u.prototype.isTranslucent=s.prototype.isTranslucent,u.prototype.getRenderState=s.prototype.getRenderState,u}),i("DataSources/PolylineGeometryUpdater",["../Core/BoundingSphere","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/PolylineGeometry","../Core/PolylinePipeline","../Core/ShowGeometryInstanceAttribute","../Scene/PolylineCollection","../Scene/PolylineColorAppearance","../Scene/PolylineMaterialAppearance","../Scene/ShadowMode","./BoundingSphereState","./ColorMaterialProperty","./ConstantProperty","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b){"use strict";function T(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.followSurface=void 0,this.granularity=void 0}function x(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(x.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._geometryChanged=new c,this._showProperty=void 0,this._materialProperty=void 0,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._options=new T(e),this._onEntityPropertyChanged(e,"polyline",e.polyline,void 0)}function A(e,t){var i=t._scene.id,r=P[i];!n(r)||r.isDestroyed()?(r=new _,P[i]=r,e.add(r)):e.contains(r)||e.add(r);var o=r.add();o.id=t._entity,this._line=o,this._primitives=e,this._geometryUpdater=t,this._positions=[],O.ellipsoid=t._scene.globe.ellipsoid}var P={},D=new w(t.WHITE),M=new S(!0),I=new S(y.DISABLED),R=new S(new l);o(x,{perInstanceColorAppearanceType:{value:g},materialAppearanceType:{value:v}}),o(x.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!n(this._entity.availability)&&b.isConstant(this._showProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{value:!1},hasConstantOutline:{value:!0},outlineColorProperty:{value:void 0},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!1},geometryChanged:{get:function(){return this._geometryChanged}}}),x.prototype.isOutlineVisible=function(e){return!1},x.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)},x.prototype.createFillGeometryInstance=function(e){var r,o,a=this._entity,s=a.isAvailable(e),l=new f(s&&a.isShowing&&this._showProperty.getValue(e)),c=this._distanceDisplayConditionProperty.getValue(e),d=u.fromDistanceDisplayCondition(c);if(this._materialProperty instanceof w){var m=t.WHITE;n(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(m=this._materialProperty.color.getValue(e)),r=i.fromColor(m),o={show:l,distanceDisplayCondition:d,color:r}}else o={show:l,distanceDisplayCondition:d};return new h({id:a,geometry:new p(this._options),attributes:o})},x.prototype.createOutlineGeometryInstance=function(e){},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){this._entitySubscription(),a(this)},x.prototype._onEntityPropertyChanged=function(e,t,i,o){if("availability"===t||"polyline"===t){var a=this._entity.polyline;if(!n(a))return void(this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.positions,l=a.show;if(n(l)&&l.isConstant&&!l.getValue(d.MINIMUM_VALUE)||!n(s))return void(this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)));var u=r(a.material,D),c=u instanceof w;this._materialProperty=u,this._showProperty=r(l,M),this._shadowsProperty=r(a.shadows,I),this._distanceDisplayConditionProperty=r(a.distanceDisplayCondition,R),this._fillEnabled=!0;var h=a.width,p=a.followSurface,m=a.granularity;if(s.isConstant&&b.isConstant(h)&&b.isConstant(p)&&b.isConstant(m)){var f=this._options,_=s.getValue(d.MINIMUM_VALUE,f.positions);if(!n(_)||_.length<2)return void(this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)));f.vertexFormat=c?g.VERTEX_FORMAT:v.VERTEX_FORMAT,f.positions=_,f.width=n(h)?h.getValue(d.MINIMUM_VALUE):void 0,f.followSurface=n(p)?p.getValue(d.MINIMUM_VALUE):void 0,f.granularity=n(m)?m.getValue(d.MINIMUM_VALUE):void 0,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},x.prototype.createDynamicUpdater=function(e){return new A(e,this)};var O={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};return A.prototype.update=function(e){var t=this._geometryUpdater,i=t._entity,r=i.polyline,o=this._line;if(!i.isShowing||!i.isAvailable(e)||!b.getValueOrDefault(r._show,e,!0))return void(o.show=!1);var a=r.positions,s=b.getValueOrUndefined(a,e,this._positions);if(!n(s)||s.length<2)return void(o.show=!1);var l=b.getValueOrDefault(r._followSurface,e,!0);l&&(O.positions=s,O.granularity=b.getValueOrUndefined(r._granularity,e),O.height=m.extractHeights(s,this._geometryUpdater._scene.globe.ellipsoid),s=m.generateCartesianArc(O)),o.show=!0,o.positions=s.slice(),o.material=E.getValue(e,t.fillMaterialProperty,o.material),o.width=b.getValueOrDefault(r._width,e,1),o.distanceDisplayCondition=b.getValueOrUndefined(r._distanceDisplayCondition,e,o.distanceDisplayCondition)},A.prototype.getBoundingSphere=function(t,i){var r=this._line;return r.show&&r.positions.length>0?(e.fromPoints(r.positions,i),C.DONE):C.FAILED},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){var e=this._geometryUpdater,t=e._scene.id,i=P[t];i.remove(this._line),0===i.length&&(this._primitives.removeAndDestroy(i),delete P[t]),a(this)},x}),i("DataSources/PolylineVolumeGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/PolylineVolumeGeometry","../Core/PolylineVolumeOutlineGeometry","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E){ -"use strict";function b(e){this.id=e,this.vertexFormat=void 0,this.polylinePositions=void 0,this.shapePositions=void 0,this.cornerType=void 0,this.granularity=void 0}function T(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(T.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new u,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._options=new b(e),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)}function x(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new b(t._entity)}var A=new y(e.WHITE),P=new C(!0),D=new C(!0),M=new C(!1),I=new C(e.BLACK),R=new C(v.DISABLED),O=new C(new s),N=new e;return n(T,{perInstanceColorAppearanceType:{value:_},materialAppearanceType:{value:f}}),n(T.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!r(this._entity.availability)&&E.isConstant(this._showProperty)&&E.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!r(this._entity.availability)&&E.isConstant(this._showProperty)&&E.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!0},geometryChanged:{get:function(){return this._geometryChanged}}}),T.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},T.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},T.prototype.createFillGeometryInstance=function(i){var n,o,a=this._entity,s=a.isAvailable(i),u=new m(s&&a.isShowing&&this._showProperty.getValue(i)&&this._fillProperty.getValue(i)),h=this._distanceDisplayConditionProperty.getValue(i),p=l.fromDistanceDisplayCondition(h);if(this._materialProperty instanceof y){var f=e.WHITE;r(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(f=this._materialProperty.color.getValue(i)),o=t.fromColor(f),n={show:u,distanceDisplayCondition:p,color:o}}else n={show:u,distanceDisplayCondition:p};return new c({id:a,geometry:new d(this._options),attributes:n})},T.prototype.createOutlineGeometryInstance=function(i){var r=this._entity,n=r.isAvailable(i),o=E.getValueOrDefault(this._outlineColorProperty,i,e.BLACK),a=this._distanceDisplayConditionProperty.getValue(i);return new c({id:r,geometry:new p(this._options),attributes:{show:new m(n&&r.isShowing&&this._showProperty.getValue(i)&&this._showOutlineProperty.getValue(i)),color:t.fromColor(o),distanceDisplayCondition:l.fromDistanceDisplayCondition(a)}})},T.prototype.isDestroyed=function(){return!1},T.prototype.destroy=function(){this._entitySubscription(),o(this)},T.prototype._onEntityPropertyChanged=function(e,t,n,o){if("availability"===t||"polylineVolume"===t){var a=this._entity.polylineVolume;if(!r(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!r(s)||!s.isConstant||s.getValue(h.MINIMUM_VALUE),u=a.outline,c=r(u);if(c&&u.isConstant&&(c=u.getValue(h.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var d=a.positions,p=a.shape,m=a.show;if(!r(d)||!r(p)||r(m)&&m.isConstant&&!m.getValue(h.MINIMUM_VALUE))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var g=i(a.material,A),v=g instanceof y;this._materialProperty=g,this._fillProperty=i(s,D),this._showProperty=i(m,P),this._showOutlineProperty=i(a.outline,M),this._outlineColorProperty=c?i(a.outlineColor,I):void 0,this._shadowsProperty=i(a.shadows,R),this._distanceDisplayConditionProperty=i(a.distanceDisplayCondition,O);var C=a.granularity,w=a.outlineWidth,S=a.cornerType;if(this._fillEnabled=l,this._outlineEnabled=c,d.isConstant&&p.isConstant&&E.isConstant(C)&&E.isConstant(w)&&E.isConstant(S)){var b=this._options;b.vertexFormat=v?_.VERTEX_FORMAT:f.MaterialSupport.TEXTURED.vertexFormat,b.polylinePositions=d.getValue(h.MINIMUM_VALUE,b.polylinePositions),b.shapePositions=p.getValue(h.MINIMUM_VALUE,b.shape),b.granularity=r(C)?C.getValue(h.MINIMUM_VALUE):void 0,b.cornerType=r(S)?S.getValue(h.MINIMUM_VALUE):void 0,this._outlineWidth=r(w)?w.getValue(h.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},T.prototype.createDynamicUpdater=function(e){return new x(e,this)},x.prototype.update=function(i){var n=this._primitives;n.removeAndDestroy(this._primitive),n.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0;var o=this._geometryUpdater,a=o._entity,s=a.polylineVolume;if(a.isShowing&&a.isAvailable(i)&&E.getValueOrDefault(s.show,i,!0)){var l=this._options,u=E.getValueOrUndefined(s.positions,i,l.polylinePositions),h=E.getValueOrUndefined(s.shape,i);if(r(u)&&r(h)){l.polylinePositions=u,l.shapePositions=h,l.granularity=E.getValueOrUndefined(s.granularity,i),l.cornerType=E.getValueOrUndefined(s.cornerType,i);var m=this._geometryUpdater.shadowsProperty.getValue(i);if(!r(s.fill)||s.fill.getValue(i)){var v=S.getValue(i,o.fillMaterialProperty,this._material);this._material=v;var y=new f({material:v,translucent:v.isTranslucent(),closed:!0});l.vertexFormat=y.vertexFormat,this._primitive=n.add(new g({geometryInstances:new c({id:a,geometry:new d(l)}),appearance:y,asynchronous:!1,shadows:m}))}if(r(s.outline)&&s.outline.getValue(i)){l.vertexFormat=_.VERTEX_FORMAT;var C=E.getValueOrClonedDefault(s.outlineColor,i,e.BLACK,N),w=E.getValueOrDefault(s.outlineWidth,i,1),b=1!==C.alpha;this._outlinePrimitive=n.add(new g({geometryInstances:new c({id:a,geometry:new p(l),attributes:{color:t.fromColor(C)}}),appearance:new _({flat:!0,translucent:b,renderState:{lineWidth:o._scene.clampLineWidth(w)}}),asynchronous:!1,shadows:m}))}}}},x.prototype.getBoundingSphere=function(e,t){return w(e,this._primitive,this._outlinePrimitive,t)},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),o(this)},T}),i("DataSources/RectangleGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/oneTimeWarning","../Core/RectangleGeometry","../Core/RectangleOutlineGeometry","../Core/ShowGeometryInstanceAttribute","../Scene/GroundPrimitive","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T){"use strict";function x(e){this.id=e,this.vertexFormat=void 0,this.rectangle=void 0,this.closeBottom=void 0,this.closeTop=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.rotation=void 0}function A(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(A.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._isClosed=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new u,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._onTerrain=!1,this._options=new x(e),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}function P(e,t,i){this._primitives=e,this._groundPrimitives=t,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=i,this._options=new x(i._entity)}var D=new w(e.WHITE),M=new S(!0),I=new S(!0),R=new S(!1),O=new S(e.BLACK),N=new S(C.DISABLED),L=new S(new s),B=new e;return n(A,{perInstanceColorAppearanceType:{value:v},materialAppearanceType:{value:g}}),n(A.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!r(this._entity.availability)&&T.isConstant(this._showProperty)&&T.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!r(this._entity.availability)&&T.isConstant(this._showProperty)&&T.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},onTerrain:{get:function(){return this._onTerrain}},geometryChanged:{get:function(){return this._geometryChanged}}}),A.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},A.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},A.prototype.createFillGeometryInstance=function(i){var n,o,a=this._entity,s=a.isAvailable(i),u=new f(s&&a.isShowing&&this._showProperty.getValue(i)&&this._fillProperty.getValue(i)),h=this._distanceDisplayConditionProperty.getValue(i),d=l.fromDistanceDisplayCondition(h);if(this._materialProperty instanceof w){var m=e.WHITE;r(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(m=this._materialProperty.color.getValue(i)),o=t.fromColor(m),n={show:u,distanceDisplayCondition:d,color:o}}else n={show:u,distanceDisplayCondition:d};return new c({id:a,geometry:new p(this._options),attributes:n})},A.prototype.createOutlineGeometryInstance=function(i){var r=this._entity,n=r.isAvailable(i),o=T.getValueOrDefault(this._outlineColorProperty,i,e.BLACK),a=this._distanceDisplayConditionProperty.getValue(i);return new c({id:r,geometry:new m(this._options),attributes:{show:new f(n&&r.isShowing&&this._showProperty.getValue(i)&&this._showOutlineProperty.getValue(i)),color:t.fromColor(o),distanceDisplayCondition:l.fromDistanceDisplayCondition(a)}})},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){this._entitySubscription(),o(this)},A.prototype._onEntityPropertyChanged=function(e,t,n,o){if("availability"===t||"rectangle"===t){var a=this._entity.rectangle;if(!r(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!r(s)||!s.isConstant||s.getValue(h.MINIMUM_VALUE),u=a.outline,c=r(u);if(c&&u.isConstant&&(c=u.getValue(h.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var p=a.coordinates,m=a.show;if(r(m)&&m.isConstant&&!m.getValue(h.MINIMUM_VALUE)||!r(p))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var f=i(a.material,D),y=f instanceof w;this._materialProperty=f,this._fillProperty=i(s,I),this._showProperty=i(m,M),this._showOutlineProperty=i(a.outline,R),this._outlineColorProperty=c?i(a.outlineColor,O):void 0,this._shadowsProperty=i(a.shadows,N),this._distanceDisplayConditionProperty=i(a.distanceDisplayCondition,L);var C=a.height,S=a.extrudedHeight,E=a.granularity,b=a.stRotation,x=a.rotation,A=a.outlineWidth,P=a.closeBottom,B=a.closeTop,F=l&&!r(C)&&!r(S)&&y&&_.isSupported(this._scene);if(c&&F&&(d(d.geometryOutlines),c=!1),this._fillEnabled=l,this._onTerrain=F,this._outlineEnabled=c,p.isConstant&&T.isConstant(C)&&T.isConstant(S)&&T.isConstant(E)&&T.isConstant(b)&&T.isConstant(x)&&T.isConstant(A)&&T.isConstant(P)&&T.isConstant(B)&&(!F||T.isConstant(f))){var V=this._options;V.vertexFormat=y?v.VERTEX_FORMAT:g.MaterialSupport.TEXTURED.vertexFormat,V.rectangle=p.getValue(h.MINIMUM_VALUE,V.rectangle),V.height=r(C)?C.getValue(h.MINIMUM_VALUE):void 0,V.extrudedHeight=r(S)?S.getValue(h.MINIMUM_VALUE):void 0,V.granularity=r(E)?E.getValue(h.MINIMUM_VALUE):void 0,V.stRotation=r(b)?b.getValue(h.MINIMUM_VALUE):void 0,V.rotation=r(x)?x.getValue(h.MINIMUM_VALUE):void 0,V.closeBottom=r(P)?P.getValue(h.MINIMUM_VALUE):void 0,V.closeTop=r(B)?B.getValue(h.MINIMUM_VALUE):void 0,this._isClosed=r(S)&&r(V.closeTop)&&r(V.closeBottom)&&V.closeTop&&V.closeBottom,this._outlineWidth=r(A)?A.getValue(h.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},A.prototype.createDynamicUpdater=function(e,t){return new P(e,t,this)},P.prototype.update=function(i){var n=this._geometryUpdater,o=n._onTerrain,a=this._primitives,s=this._groundPrimitives;o?s.removeAndDestroy(this._primitive):(a.removeAndDestroy(this._primitive),a.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;var l=n._entity,u=l.rectangle;if(l.isShowing&&l.isAvailable(i)&&T.getValueOrDefault(u.show,i,!0)){var h=this._options,d=T.getValueOrUndefined(u.coordinates,i,h.rectangle);if(r(d)){h.rectangle=d,h.height=T.getValueOrUndefined(u.height,i),h.extrudedHeight=T.getValueOrUndefined(u.extrudedHeight,i),h.granularity=T.getValueOrUndefined(u.granularity,i),h.stRotation=T.getValueOrUndefined(u.stRotation,i),h.rotation=T.getValueOrUndefined(u.rotation,i),h.closeBottom=T.getValueOrUndefined(u.closeBottom,i),h.closeTop=T.getValueOrUndefined(u.closeTop,i);var f=this._geometryUpdater.shadowsProperty.getValue(i);if(T.getValueOrDefault(u.fill,i,!0)){var C=n.fillMaterialProperty,w=b.getValue(i,C,this._material);if(this._material=w,o){var S=e.WHITE;r(C.color)&&(S=C.color.getValue(i)),this._primitive=s.add(new _({geometryInstances:new c({id:l,geometry:new p(h),attributes:{color:t.fromColor(S)}}),asynchronous:!1,shadows:f}))}else{var E=new g({material:w,translucent:w.isTranslucent(),closed:r(h.extrudedHeight)});h.vertexFormat=E.vertexFormat,this._primitive=a.add(new y({geometryInstances:new c({id:l,geometry:new p(h)}),appearance:E,asynchronous:!1,shadows:f}))}}if(!o&&T.getValueOrDefault(u.outline,i,!1)){h.vertexFormat=v.VERTEX_FORMAT;var x=T.getValueOrClonedDefault(u.outlineColor,i,e.BLACK,B),A=T.getValueOrDefault(u.outlineWidth,i,1),P=1!==x.alpha;this._outlinePrimitive=a.add(new y({geometryInstances:new c({id:l,geometry:new m(h),attributes:{color:t.fromColor(x)}}),appearance:new v({flat:!0,translucent:P,renderState:{lineWidth:n._scene.clampLineWidth(A)}}),asynchronous:!1,shadows:f}))}}}},P.prototype.getBoundingSphere=function(e,t){return E(e,this._primitive,this._outlinePrimitive,t)},P.prototype.isDestroyed=function(){return!1},P.prototype.destroy=function(){var e=this._primitives,t=this._groundPrimitives;this._geometryUpdater._onTerrain?t.removeAndDestroy(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),o(this)},A}),i("DataSources/WallGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/ShowGeometryInstanceAttribute","../Core/WallGeometry","../Core/WallOutlineGeometry","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E){"use strict";function b(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.minimumHeights=void 0,this.maximumHeights=void 0,this.granularity=void 0}function T(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(T.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new u,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._options=new b(e),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)}function x(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new b(t._entity)}var A=new y(e.WHITE),P=new C(!0),D=new C(!0),M=new C(!1),I=new C(e.BLACK),R=new C(v.DISABLED),O=new C(new s),N=new e;return n(T,{perInstanceColorAppearanceType:{value:_},materialAppearanceType:{value:f}}),n(T.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!r(this._entity.availability)&&E.isConstant(this._showProperty)&&E.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!r(this._entity.availability)&&E.isConstant(this._showProperty)&&E.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return!1}},geometryChanged:{get:function(){return this._geometryChanged}}}),T.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},T.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},T.prototype.createFillGeometryInstance=function(i){var n,o,a=this._entity,s=a.isAvailable(i),u=new d(s&&a.isShowing&&this._showProperty.getValue(i)&&this._fillProperty.getValue(i)),h=this._distanceDisplayConditionProperty.getValue(i),m=l.fromDistanceDisplayCondition(h);if(this._materialProperty instanceof y){var f=e.WHITE;r(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(f=this._materialProperty.color.getValue(i)),o=t.fromColor(f),n={show:u,distanceDisplayCondition:m,color:o}}else n={show:u,distanceDisplayCondition:m};return new c({id:a,geometry:new p(this._options),attributes:n})},T.prototype.createOutlineGeometryInstance=function(i){var r=this._entity,n=r.isAvailable(i),o=E.getValueOrDefault(this._outlineColorProperty,i,e.BLACK),a=this._distanceDisplayConditionProperty.getValue(i);return new c({id:r,geometry:new m(this._options),attributes:{show:new d(n&&r.isShowing&&this._showProperty.getValue(i)&&this._showOutlineProperty.getValue(i)),color:t.fromColor(o),distanceDisplayCondition:l.fromDistanceDisplayCondition(a)}})},T.prototype.isDestroyed=function(){return!1},T.prototype.destroy=function(){this._entitySubscription(),o(this)},T.prototype._onEntityPropertyChanged=function(e,t,n,o){if("availability"===t||"wall"===t){var a=this._entity.wall;if(!r(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!r(s)||!s.isConstant||s.getValue(h.MINIMUM_VALUE),u=a.outline,c=r(u);if(c&&u.isConstant&&(c=u.getValue(h.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var d=a.positions,p=a.show;if(r(p)&&p.isConstant&&!p.getValue(h.MINIMUM_VALUE)||!r(d))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var m=i(a.material,A),g=m instanceof y;this._materialProperty=m,this._fillProperty=i(s,D),this._showProperty=i(p,P),this._showOutlineProperty=i(a.outline,M),this._outlineColorProperty=c?i(a.outlineColor,I):void 0,this._shadowsProperty=i(a.shadows,R),this._distanceDisplayConditionProperty=i(a.distanceDisplayCondition,O);var v=a.minimumHeights,C=a.maximumHeights,w=a.outlineWidth,S=a.granularity;if(this._fillEnabled=l,this._outlineEnabled=c,d.isConstant&&E.isConstant(v)&&E.isConstant(C)&&E.isConstant(w)&&E.isConstant(S)){var b=this._options;b.vertexFormat=g?_.VERTEX_FORMAT:f.MaterialSupport.TEXTURED.vertexFormat,b.positions=d.getValue(h.MINIMUM_VALUE,b.positions),b.minimumHeights=r(v)?v.getValue(h.MINIMUM_VALUE,b.minimumHeights):void 0,b.maximumHeights=r(C)?C.getValue(h.MINIMUM_VALUE,b.maximumHeights):void 0,b.granularity=r(S)?S.getValue(h.MINIMUM_VALUE):void 0,this._outlineWidth=r(w)?w.getValue(h.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},T.prototype.createDynamicUpdater=function(e){return new x(e,this)},x.prototype.update=function(i){var n=this._primitives;n.removeAndDestroy(this._primitive),n.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0;var o=this._geometryUpdater,a=o._entity,s=a.wall;if(a.isShowing&&a.isAvailable(i)&&E.getValueOrDefault(s.show,i,!0)){var l=this._options,u=E.getValueOrUndefined(s.positions,i,l.positions);if(r(u)){l.positions=u,l.minimumHeights=E.getValueOrUndefined(s.minimumHeights,i,l.minimumHeights),l.maximumHeights=E.getValueOrUndefined(s.maximumHeights,i,l.maximumHeights),l.granularity=E.getValueOrUndefined(s.granularity,i);var h=this._geometryUpdater.shadowsProperty.getValue(i);if(E.getValueOrDefault(s.fill,i,!0)){var d=S.getValue(i,o.fillMaterialProperty,this._material);this._material=d;var v=new f({material:d,translucent:d.isTranslucent(),closed:r(l.extrudedHeight)});l.vertexFormat=v.vertexFormat,this._primitive=n.add(new g({geometryInstances:new c({id:a,geometry:new p(l)}),appearance:v,asynchronous:!1,shadows:h}))}if(E.getValueOrDefault(s.outline,i,!1)){l.vertexFormat=_.VERTEX_FORMAT;var y=E.getValueOrClonedDefault(s.outlineColor,i,e.BLACK,N),C=E.getValueOrDefault(s.outlineWidth,i,1),w=1!==y.alpha;this._outlinePrimitive=n.add(new g({geometryInstances:new c({id:a,geometry:new m(l),attributes:{color:t.fromColor(y)}}),appearance:new _({flat:!0,translucent:w,renderState:{lineWidth:o._scene.clampLineWidth(C)}}),asynchronous:!1,shadows:h}))}}}},x.prototype.getBoundingSphere=function(e,t){return w(e,this._primitive,this._outlinePrimitive,t)},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),o(this)},T}),i("DataSources/DataSourceDisplay",["../Core/BoundingSphere","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EventHelper","../Scene/GroundPrimitive","./BillboardVisualizer","./BoundingSphereState","./BoxGeometryUpdater","./CorridorGeometryUpdater","./CustomDataSource","./CylinderGeometryUpdater","./EllipseGeometryUpdater","./EllipsoidGeometryUpdater","./GeometryVisualizer","./LabelVisualizer","./ModelVisualizer","./PathVisualizer","./PointVisualizer","./PolygonGeometryUpdater","./PolylineGeometryUpdater","./PolylineVolumeGeometryUpdater","./RectangleGeometryUpdater","./WallGeometryUpdater"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T){"use strict";function x(e){s.initializeTerrainHeights();var i=e.scene,r=e.dataSourceCollection;this._eventHelper=new a,this._eventHelper.add(r.dataSourceAdded,this._onDataSourceAdded,this),this._eventHelper.add(r.dataSourceRemoved,this._onDataSourceRemoved,this),this._dataSourceCollection=r,this._scene=i,this._visualizersCallback=t(e.visualizersCallback,x.defaultVisualizersCallback);for(var n=0,o=r.length;nx*p.maximumRadius?(P=C,e.normalize(A,P),e.negate(P,P),M=e.clone(e.UNIT_Z,w),D=e.cross(M,P,y),e.magnitude(D)>l.EPSILON7&&(e.normalize(P,P),e.normalize(D,D),M=e.cross(P,D,w),e.normalize(M,M),I=!0)):e.equalsEpsilon(A,R,l.EPSILON7)||(M=C,e.normalize(B,M),e.normalize(F,F),D=e.cross(M,F,w),e.equalsEpsilon(D,e.ZERO,l.EPSILON7)||(P=e.cross(D,M,y),u.multiplyByVector(O,P,P),u.multiplyByVector(O,D,D),u.multiplyByVector(O,M,M),e.normalize(P,P),e.normalize(D,D),e.normalize(M,M),I=!0))}}i(t.boundingSphere)&&(A=t.boundingSphere.center);var U,G,W;o&&(U=e.clone(r.position,S),G=e.clone(r.direction,E),W=e.clone(r.up,b));var H=v;I?(H[0]=P.x,H[1]=P.y,H[2]=P.z,H[3]=0,H[4]=D.x,H[5]=D.y,H[6]=D.z,H[7]=0,H[8]=M.x,H[9]=M.y,H[10]=M.z,H[11]=0,H[12]=A.x,H[13]=A.y,H[14]=A.z,H[15]=0):h.eastNorthUpToFixedFrame(A,p,H),r._setTransform(H),o&&(e.clone(U,r.position),e.clone(G,r.direction),e.clone(W,r.up),e.cross(G,W,r.right))}if(n){var q=m===d.SCENE2D||e.equals(t._offset3D,e.ZERO)?void 0:t._offset3D;r.lookAtTransform(r.transform,q)}}function m(i,r,n){this.entity=i,this.scene=r,this.ellipsoid=t(n,o.WGS84),this.boundingSphere=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new e,this._defaultOffset3D=void 0,this._offset3D=new e}var f=new u,_=new u,g=new u,v=new c,y=new e,C=new e,w=new e,S=new e,E=new e,b=new e,T=new s,x=1.25;r(m,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(t){this._defaultOffset3D=e.clone(t,new e)}}}),m.defaultOffset3D=new e(-14e3,3500,3500);var A=new a,P=new e;return m.prototype.update=function(t,r){var n=this.scene,o=this.entity,a=this.ellipsoid,s=n.mode;if(s!==d.MORPHING){var u=o.position,c=o!==this._lastEntity,h=s!==this._mode,f=this._offset3D,_=n.camera,g=c||h,v=!0;if(c){var y=o.viewFrom,C=i(y);if(!C&&i(r)){var w=n.screenSpaceCameraController;w.minimumZoomDistance=Math.min(w.minimumZoomDistance,.5*r.radius),A.pitch=-l.PI_OVER_FOUR,A.range=0;var S=u.getValue(t,P);if(i(S)){var E=2-1/Math.max(1,e.magnitude(S)/a.maximumRadius);A.pitch*=E}_.viewBoundingSphere(r,A),this.boundingSphere=r,g=!1,v=!1}else C&&i(y.getValue(t,f))||e.clone(m._defaultOffset3D,f)}else h||n.mode===d.MORPHING||this._mode===d.SCENE2D||e.clone(_.position,f);this._lastEntity=o,this._mode=n.mode!==d.MORPHING?n.mode:this._mode,n.mode!==d.MORPHING&&p(this,_,g,v,u,t,a)}},m}),!function(){function e(e,t){function i(t){var i,r=e.arcs[t<0?~t:t],n=r[0];return e.transform?(i=[0,0],r.forEach(function(e){i[0]+=e[0],i[1]+=e[1]})):i=r[r.length-1],t<0?[i,n]:[n,i]}function r(e,t){for(var i in e){var r=e[i];delete t[r.start],delete r.start,delete r.end,r.forEach(function(e){n[e<0?~e:e]=1}),s.push(r)}}var n={},o={},a={},s=[],l=-1;return t.forEach(function(i,r){var n,o=e.arcs[i<0?~i:i];o.length<3&&!o[1][0]&&!o[1][1]&&(n=t[++l],t[l]=i,t[r]=n)}),t.forEach(function(e){var t,r,n=i(e),s=n[0],l=n[1];if(t=a[s])if(delete a[t.end],t.push(e), -t.end=l,r=o[l]){delete o[r.start];var u=r===t?t:t.concat(r);o[u.start=t.start]=a[u.end=r.end]=u}else o[t.start]=a[t.end]=t;else if(t=o[l])if(delete o[t.start],t.unshift(e),t.start=s,r=a[s]){delete a[r.end];var c=r===t?t:r.concat(t);o[c.start=r.start]=a[c.end=t.end]=c}else o[t.start]=a[t.end]=t;else t=[e],o[t.start=s]=a[t.end=l]=t}),r(a,o),r(o,a),t.forEach(function(e){n[e<0?~e:e]||s.push([e])}),s}function t(t,i,r){function n(e){var t=e<0?~e:e;(c[t]||(c[t]=[])).push({i:e,g:u})}function o(e){e.forEach(n)}function a(e){e.forEach(o)}function s(e){"GeometryCollection"===e.type?e.geometries.forEach(s):e.type in h&&(u=e,h[e.type](e.arcs))}var l=[];if(arguments.length>1){var u,c=[],h={LineString:o,MultiLineString:a,Polygon:a,MultiPolygon:function(e){e.forEach(a)}};s(i),c.forEach(arguments.length<3?function(e){l.push(e[0].i)}:function(e){r(e[0].g,e[e.length-1].g)&&l.push(e[0].i)})}else for(var d=0,p=t.arcs.length;d0}var a={},l=[],u=[];return i.forEach(function(e){"Polygon"===e.type?r(e.arcs):"MultiPolygon"===e.type&&e.arcs.forEach(r)}),l.forEach(function(e){if(!e._){var t=[],i=[e];for(e._=1,u.push(t);e=i.pop();)t.push(e),e.forEach(function(e){e.forEach(function(e){a[e<0?~e:e].forEach(function(e){e._||(e._=1,i.push(e))})})})}}),l.forEach(function(e){delete e._}),{type:"MultiPolygon",arcs:u.map(function(i){var r=[];if(i.forEach(function(e){e.forEach(function(e){e.forEach(function(e){a[e<0?~e:e].length<2&&r.push(e)})})}),r=e(t,r),(n=r.length)>1)for(var s,l=o(i[0][0]),u=0;u>>1;e[n]0;){var i=(t+1>>1)-1,n=r[i];if(m(e,n)>=0)break;r[n._=t]=n,r[e._=t=i]=e}}function t(e,t){for(;;){var i=t+1<<1,o=i-1,a=t,s=r[a];if(o0&&(e=r[n],t(r[e._=0]=e,0)),i}},i.remove=function(i){var o,a=i._;if(r[a]===i)return a!==--n&&(o=r[n],(m(o,i)<0?e:t)(r[o._=a]=o,a)),a},i}function _(e){if(!e)return v;var t,i,r=e.scale[0],n=e.scale[1],o=e.translate[0],a=e.translate[1];return function(e,s){s||(t=i=0),e[0]=(t+=e[0])*r+o,e[1]=(i+=e[1])*n+a}}function g(e){if(!e)return v;var t,i,r=e.scale[0],n=e.scale[1],o=e.translate[0],a=e.translate[1];return function(e,s){s||(t=i=0);var l=(e[0]-o)/r|0,u=(e[1]-a)/n|0;e[0]=l-t,e[1]=u-i,t=l,i=u}}function v(){}var y={version:"1.6.18",mesh:function(e){return s(e,t.apply(this,arguments))},meshArcs:t,merge:function(e){return s(e,r.apply(this,arguments))},mergeArcs:r,feature:o,neighbors:c,presimplify:h};"function"==typeof i&&i.amd?i("ThirdParty/topojson",y):"object"==typeof module&&module.exports?module.exports=y:this.topojson=y}(),i("DataSources/GeoJsonDataSource",["../Core/Cartesian3","../Core/Color","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/getFilenameFromUri","../Core/loadJson","../Core/PinBuilder","../Core/PolygonHierarchy","../Core/RuntimeError","../Scene/HeightReference","../Scene/VerticalOrigin","../ThirdParty/topojson","../ThirdParty/when","./BillboardGraphics","./CallbackProperty","./ColorMaterialProperty","./ConstantPositionProperty","./ConstantProperty","./CorridorGraphics","./DataSource","./EntityCluster","./EntityCollection","./PolygonGraphics","./PolylineGraphics"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A){"use strict";function P(t){return e.fromDegrees(t[0],t[1],t[2])}function D(e,t){var i="";for(var r in e)if(e.hasOwnProperty(r)){if(r===t||ue.indexOf(r)!==-1)continue;var o=e[r];n(o)&&(i+="object"==typeof o?""+r+""+D(o)+"":""+r+""+o+"")}return i.length>0&&(i=''+i+"
"),i}function M(e,t,i){var r;return function(o,a){return n(r)||(r=e(t,i)),r}}function I(e,t){return new v(M(D,e,t),!0)}function R(e,t,r){var o=e.id;if(n(o)&&"Feature"===e.type){for(var a=2,s=o;n(t.getById(s));)s=o+"_"+a,a++;o=s}else o=i();var l=t.getOrCreateEntity(o),u=e.properties;if(n(u)){l.addProperty("properties"),l.properties=u;var c,h=u.title;if(n(h))l.name=h,c="title";else{var d=Number.MAX_VALUE;for(var p in u)if(u.hasOwnProperty(p)&&u[p]){var m=p.toLowerCase();if(d>1&&"title"===m){d=1,c=p;break}d>2&&"name"===m?(d=2,c=p):d>3&&/title/i.test(p)?(d=3,c=p):d>4&&/name/i.test(p)&&(d=4,c=p)}n(c)&&(l.name=u[c])}var f=u.description;null!==f&&(l.description=n(f)?new w(f):r(u,c))}return l}function O(e,t){for(var i=new Array(e.length),r=0;r2?v.perPositionHeight=new w(!0):a.clampToGround||(v.height=0);var T=R(i,e._entityCollection,a.describe);T.polygon=v}}function H(e,t,i,r,n){W(e,t,r,i.coordinates,n)}function q(e,t,i,r,n){for(var o=i.coordinates,a=0;at&&(i=null==i?"..":i,e=e.substring(0,t-i.length)+i),e},indexOf:function(e,t){if(Array.prototype.indexOf)return e.indexOf(t);for(var i=0,r=e.length;i",this.getInnerHtml(),""].join("")},buildAttrsStr:function(){if(!this.attrs)return"";var e=this.getAttrs(),t=[];for(var i in e)e.hasOwnProperty(i)&&t.push(i+'="'+e[i]+'"');return t.join(" ")}}),e.AnchorTagBuilder=e.Util.extend(Object,{constructor:function(t){e.Util.assign(this,t)},build:function(t){var i=new e.HtmlTag({tagName:"a",attrs:this.createAttrs(t.getType(),t.getAnchorHref()),innerHtml:this.processAnchorText(t.getAnchorText())});return i},createAttrs:function(e,t){var i={href:t},r=this.createCssClass(e);return r&&(i.class=r),this.newWindow&&(i.target="_blank"),i},createCssClass:function(e){var t=this.className;return t?t+" "+t+"-"+e:""},processAnchorText:function(e){return e=this.doTruncate(e)},doTruncate:function(t){return e.Util.ellipsis(t,this.truncate||Number.POSITIVE_INFINITY)}}),e.htmlParser.HtmlParser=e.Util.extend(Object,{htmlRegex:function(){var e=/!--([\s\S]+?)--/,t=/[0-9a-zA-Z][0-9a-zA-Z:]*/,i=/[^\s\0"'>\/=\x01-\x1F\x7F]+/,r=/(?:"[^"]*?"|'[^']*?'|[^'"=<>`\s]+)/,n=i.source+"(?:\\s*=\\s*"+r.source+")?";return new RegExp(["(?:","<(!DOCTYPE)","(?:","\\s+","(?:",n,"|",r.source+")",")*",">",")","|","(?:","<(/)?","(?:",e.source,"|","(?:","("+t.source+")","(?:","\\s+",n,")*","\\s*/?",")",")",">",")"].join(""),"gi")}(),htmlCharacterEntitiesRegex:/( | |<|<|>|>|"|"|')/gi,parse:function(e){for(var t,i,r=this.htmlRegex,n=0,o=[];null!==(t=r.exec(e));){var a=t[0],s=t[3],l=t[1]||t[4],u=!!t[2],c=e.substring(n,t.index);c&&(i=this.parseTextAndEntityNodes(c),o.push.apply(o,i)),s?o.push(this.createCommentNode(a,s)):o.push(this.createElementNode(a,l,u)),n=t.index+a.length}if(n>>8^n[255&(e^i[r])]},t.get=function(){return~e}}function n(e,t,i){return e.slice?e.slice(t,t+i):e.webkitSlice?e.webkitSlice(t,t+i):e.mozSlice?e.mozSlice(t,t+i):e.msSlice?e.msSlice(t,t+i):void 0}function o(e,t){var i,r;return i=new ArrayBuffer(e),r=new Uint8Array(i),t&&r.set(t,0),{buffer:i,array:r,view:new DataView(i)}}function a(){}function s(e){function t(t,i){var o=new Blob([e],{type:z});r=new u(o),r.init(function(){n.size=r.size,t()},i)}function i(e,t,i,n){r.readUint8Array(e,t,i,n)}var r,n=this;n.size=0,n.init=t,n.readUint8Array=i}function l(e){function t(t){for(var i=e.length;"="==e.charAt(i-1);)i--;r=e.indexOf(",")+1,n.size=Math.floor(.75*(i-r)),t()}function i(t,i,n){var a,s=o(i),l=4*Math.floor(t/3),u=4*Math.ceil((t+i)/3),c=window.atob(e.substring(l+r,u+r)),h=t-3*Math.floor(l/4);for(a=h;a2?o+=window.btoa(n):a=n,t()}function r(e){e(o+window.btoa(a))}var n=this,o="",a="";n.init=t,n.writeUint8Array=i,n.getData=r}function p(e){function t(t){n=new Blob([],{type:e}),t()}function i(t,i){n=new Blob([n,P?t:t.buffer],{type:e}),i()}function r(e){e(n)}var n,o=this;o.init=t,o.writeUint8Array=i,o.getData=r}function m(e,t,i,r,n,o,a,s,l,u){function c(){e.removeEventListener(U,h,!1),s(m)}function h(e){ -var t=e.data,r=t.data;t.onappend&&(m+=r.length,i.writeUint8Array(r,function(){o(!1,r),d()},u)),t.onflush&&(r?(m+=r.length,i.writeUint8Array(r,function(){o(!1,r),c()},u)):c()),t.progress&&a&&a(p+t.current,n)}function d(){p=f*F,p127?n[i-128]:String.fromCharCode(i);return r}function C(e){return decodeURIComponent(escape(e))}function w(e){var t,i="";for(t=0;t>16,i=65535&e;try{return new Date(1980+((65024&t)>>9),((480&t)>>5)-1,31&t,(63488&i)>>11,(2016&i)>>5,2*(31&i),0)}catch(e){}}function E(e,t,i,r,n){return e.version=t.view.getUint16(i,!0),e.bitFlag=t.view.getUint16(i+2,!0),e.compressionMethod=t.view.getUint16(i+4,!0),e.lastModDateRaw=t.view.getUint32(i+6,!0),e.lastModDate=S(e.lastModDateRaw),1===(1&e.bitFlag)?void n(M):((r||8!=(8&e.bitFlag))&&(e.crc32=t.view.getUint32(i+10,!0),e.compressedSize=t.view.getUint32(i+14,!0),e.uncompressedSize=t.view.getUint32(i+18,!0)),4294967295===e.compressedSize||4294967295===e.uncompressedSize?void n(I):(e.filenameLength=t.view.getUint16(i+22,!0),void(e.extraFieldLength=t.view.getUint16(i+24,!0))))}function b(e,t){function i(){}function r(i,n){e.readUint8Array(e.size-i,i,function(e){var t=o(e.length,e).view;1347093766!=t.getUint32(0)?r(i+1,n):n(t)},function(){t(R)})}return i.prototype.getData=function(i,r,n,a){function s(e,t){d&&d.terminate(),d=null,e&&e(t)}function l(e){var t=o(4);return t.view.setUint32(0,e),p.crc32==t.view.getUint32(0)}function u(e,t){a&&!l(t)?c():i.getData(function(e){s(r,e)})}function c(){s(t,L)}function h(){s(t,N)}var d,p=this;e.readUint8Array(p.offset,30,function(r){var s,l=o(r.length,r);return 1347093252!=l.view.getUint32(0)?void t(D):(E(p,l,4,!1,t),s=p.offset+30+p.filenameLength+p.extraFieldLength,void i.init(function(){0===p.compressionMethod?v(e,i,s,p.compressedSize,a,u,n,c,h):d=_(e,i,s,p.compressedSize,a,u,n,c,h)},h))},c)},{getEntries:function(n){return e.size<22?void t(D):void r(22,function(r){var a,s;a=r.getUint32(16,!0),s=r.getUint16(8,!0),e.readUint8Array(a,e.size-a,function(e){var r,a,l,u,c=0,h=[],d=o(e.length,e);for(r=0;r>>1^3988292384:i>>>=1;r[e]=i}return r}(),s.prototype=new a,s.prototype.constructor=s,l.prototype=new a,l.prototype.constructor=l,u.prototype=new a,u.prototype.constructor=u,c.prototype.getData=function(e){e(this.data)},h.prototype=new c,h.prototype.constructor=h,d.prototype=new c,d.prototype.constructor=d,p.prototype=new c,p.prototype.constructor=p,i.zip={Reader:a,Writer:c,BlobReader:u,Data64URIReader:l,TextReader:s,BlobWriter:p,Data64URIWriter:d,TextWriter:h,createReader:function(e,t,i){e.init(function(){t(b(e,i))},i)},createWriter:function(e,t,i,r){e.init(function(){t(A(e,i,r))},i)},useWebWorkers:!0};var G;t(i.zip,{workerScriptsPath:{get:function(){return"undefined"==typeof G&&(G=e("ThirdParty/Workers/")),G}}})}(i),i.zip}),i("DataSources/KmlDataSource",["../Core/AssociativeArray","../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/ClockRange","../Core/ClockStep","../Core/Color","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Ellipsoid","../Core/Event","../Core/getAbsoluteUri","../Core/getExtensionFromUri","../Core/getFilenameFromUri","../Core/Iso8601","../Core/joinUrls","../Core/JulianDate","../Core/loadBlob","../Core/loadXML","../Core/Math","../Core/NearFarScalar","../Core/PinBuilder","../Core/PolygonHierarchy","../Core/Rectangle","../Core/RuntimeError","../Core/TimeInterval","../Core/TimeIntervalCollection","../Scene/HeightReference","../Scene/HorizontalOrigin","../Scene/LabelStyle","../Scene/SceneMode","../ThirdParty/Autolinker","../ThirdParty/Uri","../ThirdParty/when","../ThirdParty/zip","./BillboardGraphics","./CompositePositionProperty","./CorridorGraphics","./DataSource","./DataSourceClock","./Entity","./EntityCluster","./EntityCollection","./LabelGraphics","./PathGraphics","./PolygonGraphics","./PolylineGraphics","./PositionPropertyArray","./RectangleGraphics","./ReferenceProperty","./SampledPositionProperty","./ScaledPositionProperty","./TimeIntervalCollectionProperty","./WallGraphics"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I,R,O,N,L,B,F,V,k,z,U,G,W,H,q,j,Y,X,Z,K,Q,J,$,ee,te,ie,re){"use strict";function ne(e){var t=e.slice(0,Math.min(4,e.size)),i=F.defer(),r=new FileReader;return r.addEventListener("load",function(){i.resolve(1347093252===new DataView(r.result).getUint32(0,!1))}),r.addEventListener("error",function(){i.reject(r.error)}),r.readAsArrayBuffer(t),i.promise}function oe(e){var t=F.defer(),i=new FileReader;return i.addEventListener("load",function(){t.resolve(i.result)}),i.addEventListener("error",function(){t.reject(i.error)}),i.readAsText(e),t.promise}function ae(e,t,i,r){t.getData(new V.TextWriter,function(e){i.kml=gt.parseFromString(e,"application/xml"),r.resolve()})}function se(e,t,i,r){var n=u(_t.detectFromFilename(t.filename),"application/octet-stream");t.getData(new V.Data64URIWriter(n),function(e){i[t.filename]=e,r.resolve()})}function le(e,t,i,r){for(var n=r.keys,o=new B("."),a=e.querySelectorAll(t),s=0;s0?Pt.maximumRed=o:Pt.red=0,n>0?Pt.maximumGreen=n:Pt.green=0,r>0?Pt.maximumBlue=r:Pt.blue=0,Pt.alpha=i,s.fromRandom(Pt)):new s(o,n,r,i)}}function be(e,t,i){var r=Ce(e,t,i);if(c(r))return Ee(r,"random"===Ce(e,"colorMode",i))}function Te(e){var t=_e(e,"TimeStamp",At.kmlgx),i=Ce(t,"when",At.kmlgx);if(c(t)&&c(i)&&0!==i.length){var r=C.fromIso8601(i),n=new M;return n.addInterval(new D({start:r,stop:v.MAXIMUM_VALUE})),n}}function xe(e){var t=_e(e,"TimeSpan",At.kmlgx);if(c(t)){var i,r=_e(t,"begin",At.kmlgx),n=c(r)?C.fromIso8601(r.textContent):void 0,o=_e(t,"end",At.kmlgx),a=c(o)?C.fromIso8601(o.textContent):void 0;if(c(n)&&c(a)){if(C.lessThan(a,n)){var s=n;n=a,a=s}i=new M,i.addInterval(new D({start:n,stop:a}))}else c(n)?(i=new M,i.addInterval(new D({start:n,stop:v.MAXIMUM_VALUE}))):c(a)&&(i=new M,i.addInterval(new D({start:v.MINIMUM_VALUE,stop:a})));return i}}function Ae(){var e=new k;return e.width=yt,e.height=yt,e.scaleByDistance=new b(Ct,wt,St,Et),e.pixelOffsetScaleByDistance=new b(Ct,wt,St,Et),e}function Pe(){var e=new Z;return e.outline=!0,e.outlineColor=s.WHITE,e}function De(){var e=new Y;return e.translucencyByDistance=new b(3e6,1,5e6,0),e.pixelOffset=new i(17,0),e.horizontalOrigin=R.LEFT,e.font="16px sans-serif",e.style=O.FILL_AND_OUTLINE,e}function Me(e,t,i,r,n){var o=Ce(e,"href",At.kml);if(c(o)&&0!==o.length){if(0===o.indexOf("root://icons/palette-")){var a=o.charAt(21),s=u(ye(e,"x",At.gx),0),l=u(ye(e,"y",At.gx),0);s=Math.min(s/32,7),l=7-Math.min(l/32,7);var h=8*l+s;o="https://maps.google.com/mapfiles/kml/pal"+a+"/icon"+h+".png"}if(o=Se(o,t._proxy,i,r),n){var d=Ce(e,"refreshMode",At.kml),p=Ce(e,"viewRefreshMode",At.kml);"onInterval"===d||"onExpire"===d?console.log("KML - Unsupported Icon refreshMode: "+d):"onStop"!==p&&"onRegion"!==p||console.log("KML - Unsupported Icon viewRefreshMode: "+p);var m=u(Ce(e,"viewBoundScale",At.kml),1),f="onStop"===p?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",_=u(Ce(e,"viewFormat",At.kml),f),g=Ce(e,"httpQuery",At.kml),v=ot(_,g),C=y(o,v,!1);return at(t._camera,t._canvas,C,m,t._lastCameraView.bbox)}return o}}function Ie(e,n,o,a,s){var l=ye(n,"scale",At.kml),h=ye(n,"heading",At.kml),d=be(n,"color",At.kml),p=_e(n,"Icon",At.kml),m=Me(p,e,a,s,!1),f=ye(p,"x",At.gx),_=ye(p,"y",At.gx),g=ye(p,"w",At.gx),v=ye(p,"h",At.gx),y=_e(n,"hotSpot",At.kml),C=me(y,"x"),w=me(y,"y"),S=fe(y,"xunits"),b=fe(y,"yunits"),T=o.billboard;c(T)||(T=Ae(),o.billboard=T),T.image=m,T.scale=l,T.color=d,(c(f)||c(_)||c(g)||c(v))&&(T.imageSubRegion=new t(f,_,g,v)),c(h)&&0!==h&&(T.rotation=E.toRadians(-h),T.alignedAxis=r.UNIT_Z),l=u(l,1);var x,A;c(C)&&("pixels"===S?x=-C*l:"insetPixels"===S?x=(C-yt)*l:"fraction"===S&&(x=-C*yt*l),x+=.5*yt*l),c(w)&&("pixels"===b?A=w*l:"insetPixels"===b?A=(-w+yt)*l:"fraction"===b&&(A=w*yt*l),A-=.5*yt*l),(c(x)||c(A))&&(T.pixelOffset=new i(x,A))}function Re(e,t,i,r,n){for(var o=0,a=t.childNodes.length;o:clampToSeaFloor is currently not supported, using :clampToGround."),I.CLAMP_TO_GROUND):"relativeToSeaFloor"===t?(console.log("KML - :relativeToSeaFloor is currently not supported, using :relativeToGround."),I.RELATIVE_TO_GROUND):(c(e)?console.log("KML - Unknown :"+e+", using :CLAMP_TO_GROUND."):console.log("KML - Unknown :"+t+", using :CLAMP_TO_GROUND."),I.CLAMP_TO_GROUND)}function Ve(e,t,i){return"relativeToSeaFloor"===i||"absolute"===t||"relativeToGround"===t?e:((c(t)&&"clampToGround"!==t||c(i)&&"clampToSeaFloor"!==i)&&console.log("KML - Unknown altitudeMode: "+u(t,i)),new te(e))}function ke(e,t,i){if(c(e)){if("relativeToSeaFloor"===i||"absolute"===t||"relativeToGround"===t)return e;(c(t)&&"clampToGround"!==t||c(i)&&"clampToSeaFloor"!==i)&&console.log("KML - Unknown altitudeMode: "+u(t,i));for(var r=e.length,n=0;n0&&console.log("KML - gx:angles are not supported in gx:Tracks");for(var d=Math.min(s.length,u.length),p=[],m=[],f=0;f0&&r.availability.addInterval(new D({start:m[0],stop:m[m.length-1]})),h&&c&&Be(t,r,n),!0}function je(e,t,i,r,n,o,a,s,l){var u=e[0],c=e[e.length-1],h=new ee;h.addSamples(e,t),i.intervals.addInterval(new D({start:u,stop:c,isStartIncluded:l,isStopIncluded:l,data:Ve(h,a,s)})),r.addInterval(new D({start:u,stop:c,isStartIncluded:l,isStopIncluded:l})),n.intervals.addInterval(new D({start:u,stop:c,isStartIncluded:l,isStopIncluded:l,data:o}))}function Ye(e,t,i,r,n){for(var o,a,s,l=we(i,"interpolate",At.gx),u=ve(i,"Track",At.gx),h=!1,d=new ie,p=new M,m=new z,f=0,_=u.length;f<_;f++){var g=u[f],v=ve(g,"when",At.kml),y=ve(g,"coord",At.gx),w=Ce(g,"altitudeMode",At.kml),S=Ce(g,"altitudeMode",At.gx),E=he(w,S),b=we(g,"extrude",At.kml),T=Math.min(y.length,v.length),x=[];o=[];for(var A=0;A0)){for(_='',n=0;n";_+="
"+u(g.displayName,o)+""+u(g.value,"")+"
"}if(c(_)){_=vt.link(_),Dt.innerHTML=_;var S=Dt.querySelectorAll("a");for(n=0;n1&&(le(Dt,"a","href",r),le(Dt,"img","src",r));var E='
",Dt.innerHTML="",t.description=E}}function Je(e,t,i,r,n,o,a,s,l){function h(e){return!e||e.show&&h(e.parent)}var d=ce(i,r,l),p=d.kml,m=Oe(d,e,i,n,o,a),f=Ce(i,"name",At.kml);d.name=f,d.parent=t;var _=xe(i);c(_)||(_=Te(i)),d.availability=_,pt(d);var g=we(i,"visibility",At.kml);d.show=h(t)&&u(g,!0);var v=_e(i,"author",At.atom),y=p.author;y.name=Ce(v,"name",At.atom),y.uri=Ce(v,"uri",At.atom),y.email=Ce(v,"email",At.atom);var C=_e(i,"link",At.atom),w=p.link;return w.href=fe(C,"href"),w.hreflang=fe(C,"hreflang"),w.rel=fe(C,"rel"),w.type=fe(C,"type"),w.title=fe(C,"title"),w.length=fe(C,"length"),p.address=Ce(i,"address",At.kml),p.phoneNumber=Ce(i,"phoneNumber",At.kml),p.snippet=Ce(i,"Snippet",At.kml),Ke(i,d),Qe(i,d,m,a),c(_e(i,"Camera",At.kml))&&console.log("KML - Unsupported view: Camera"),c(_e(i,"LookAt",At.kml))&&console.log("KML - Unsupported view: LookAt"),c(_e(i,"Region",At.kml))&&console.log("KML - Placemark Regions are unsupported"),{entity:d,styleEntity:m}}function $e(e,t,i,r,n,o,a,s,l){for(var u=Object.keys(Bt),c=u.length,h=0;h0||c(t)&&t.length>0)&&(i+=y(nt(e),nt(t),!1)),i}function at(e,t,i,n,o){function a(e){return e<-E.PI_OVER_TWO?-E.PI_OVER_TWO:e>E.PI_OVER_TWO?E.PI_OVER_TWO:e}function s(e){return e>E.PI?e-E.TWO_PI:e<-E.PI?e+E.TWO_PI:e}if(c(e)&&e._mode!==N.MORPHING){var l,h,d=p.WGS84;if(o=u(o,Rt),c(t)&&(Nt.x=.5*t.clientWidth,Nt.y=.5*t.clientHeight,l=e.pickEllipsoid(Nt,d,Lt)),c(l)?h=d.cartesianToCartographic(l,Ot):(h=A.center(o,Ot),l=d.cartographicToCartesian(h)),c(n)&&!E.equalsEpsilon(n,1,E.EPSILON9)){var m=o.width*n*.5,f=o.height*n*.5;o=new A(s(h.longitude-m),a(h.latitude-f),s(h.longitude+m),a(h.latitude+f))}i=i.replace("[bboxWest]",E.toDegrees(o.west).toString()),i=i.replace("[bboxSouth]",E.toDegrees(o.south).toString()),i=i.replace("[bboxEast]",E.toDegrees(o.east).toString()),i=i.replace("[bboxNorth]",E.toDegrees(o.north).toString());var _=E.toDegrees(h.longitude).toString(),g=E.toDegrees(h.latitude).toString();i=i.replace("[lookatLon]",_),i=i.replace("[lookatLat]",g),i=i.replace("[lookatTilt]",E.toDegrees(e.pitch).toString()),i=i.replace("[lookatHeading]",E.toDegrees(e.heading).toString()),i=i.replace("[lookatRange]",r.distance(e.positionWC,l)),i=i.replace("[lookatTerrainLon]",_),i=i.replace("[lookatTerrainLat]",g),i=i.replace("[lookatTerrainAlt]",h.height.toString()),d.cartesianToCartographic(e.positionWC,Ot),i=i.replace("[cameraLon]",E.toDegrees(Ot.longitude).toString()),i=i.replace("[cameraLat]",E.toDegrees(Ot.latitude).toString()),i=i.replace("[cameraAlt]",E.toDegrees(Ot.height).toString());var v=e.frustum,y=v.aspectRatio,C="",w="";if(c(y)){var S=E.toDegrees(v.fov);y>1?(C=S,w=S/y):(w=S,C=S*y)}i=i.replace("[horizFov]",C.toString()),i=i.replace("[vertFov]",w.toString())}else i=i.replace("[bboxWest]","-180"),i=i.replace("[bboxSouth]","-90"),i=i.replace("[bboxEast]","180"),i=i.replace("[bboxNorth]","90"),i=i.replace("[lookatLon]",""),i=i.replace("[lookatLat]",""),i=i.replace("[lookatRange]",""),i=i.replace("[lookatTilt]",""),i=i.replace("[lookatHeading]",""),i=i.replace("[lookatTerrainLon]",""),i=i.replace("[lookatTerrainLat]",""),i=i.replace("[lookatTerrainAlt]",""),i=i.replace("[cameraLon]",""),i=i.replace("[cameraLat]",""),i=i.replace("[cameraAlt]",""),i=i.replace("[horizFov]",""),i=i.replace("[vertFov]","");return c(t)?(i=i.replace("[horizPixels]",t.clientWidth),i=i.replace("[vertPixels]",t.clientHeight)):(i=i.replace("[horizPixels]",""),i=i.replace("[vertPixels]","")),i=i.replace("[terrainEnabled]","1"),i=i.replace("[clientVersion]","1"), -i=i.replace("[kmlVersion]","2.2"),i=i.replace("[clientName]","Cesium"),i=i.replace("[language]","English")}function st(e,t,i,r,n,o,a,s,h){var d=Je(e,t,i,r,n,o,a,s,h),p=d.entity,m=_e(i,"Link",At.kml);if(c(m)||(m=_e(i,"Url",At.kml)),c(m)){var _=Ce(m,"href",At.kml);if(c(_)){var g=_;_=Se(_,void 0,o,a);var v;if(/^data:/.test(_))v=_,/\.kmz/i.test(o)||(g=f(g,o));else{g=_;var w=Ce(m,"viewRefreshMode",At.kml),S=u(Ce(m,"viewBoundScale",At.kml),1),E="onStop"===w?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",b=u(Ce(m,"viewFormat",At.kml),E),T=Ce(m,"httpQuery",At.kml),x=ot(b,T);v=at(e._camera,e._canvas,y(_,x,!1),S,e._lastCameraView.bbox)}var A={sourceUri:g,uriResolver:a,context:p.id},P=new j,D=ht(e,P,v,A).then(function(t){var i=e._entityCollection,r=P.values;i.suspendEvents();for(var n=0;n0||"onExpire"===a||"onStop"===w){var h=_e(t,"NetworkLinkControl",At.kml),d=c(h),f=C.now(),g={id:l(),href:_,cookie:"",queryString:x,lastUpdated:f,updating:!1,entity:p,viewBoundScale:S,needsUpdate:!1,cameraUpdateTime:f},v=0;if(d&&(g.cookie=u(Ce(h,"cookie",At.kml),""),v=u(ye(h,"minRefreshPeriod",At.kml),0)),"onInterval"===a)d&&(s=Math.max(v,s)),g.refreshMode=It.INTERVAL,g.time=s;else if("onExpire"===a){var y;if(d&&(y=Ce(h,"expires",At.kml)),c(y))try{var E=C.fromIso8601(y),b=C.secondsDifference(E,f);b>0&&b0&&ge.time&&(r=!0):e.refreshMode===It.EXPIRE?C.greaterThan(o,e.time)&&(r=!0):e.refreshMode===It.STOP&&(s&&(e.needsUpdate=!0,e.cameraUpdateTime=o),e.needsUpdate&&C.secondsDifference(o,e.cameraUpdateTime)>=e.time&&(r=!0)),r){i(t),e.updating=!0;var n=new j,u=y(e.href,ot(e.cookie,e.queryString),!1);u=at(a._camera,a._canvas,u,e.viewBoundScale,l.bbox),ht(a,n,u,{context:t.id}).then(mt(a,e,n,h,u)).otherwise(function(t){var i="NetworkLink "+e.href+" refresh failed: "+t;console.log(i),a._error.raiseEvent(a,i)}),d=!0}}h.set(e.id,e)}}),d&&(this._networkLinks=h,this._changed.raiseEvent(this)),!0},dt}),i("DataSources/VelocityOrientationProperty",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Ellipsoid","../Core/Event","../Core/Matrix3","../Core/Quaternion","../Core/Transforms","./Property","./VelocityVectorProperty"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(e,i){this._velocityVectorProperty=new c(e,!0),this._subscription=void 0,this._ellipsoid=void 0,this._definitionChanged=new o,this.ellipsoid=t(i,n.WGS84);var r=this;this._velocityVectorProperty.definitionChanged.addEventListener(function(){r._definitionChanged.raiseEvent(r)})}r(h.prototype,{isConstant:{get:function(){return u.isConstant(this._velocityVectorProperty)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._velocityVectorProperty.position},set:function(e){this._velocityVectorProperty.position=e}},ellipsoid:{get:function(){return this._ellipsoid},set:function(e){var t=this._ellipsoid;t!==e&&(this._ellipsoid=e,this._definitionChanged.raiseEvent(this))}}});var d=new e,p=new e,m=new a;return h.prototype.getValue=function(e,t){var r=this._velocityVectorProperty._getValue(e,p,d);if(i(r))return l.rotationMatrixFromPositionVelocity(d,r,this._ellipsoid,m),s.fromRotationMatrix(m,t)},h.prototype.equals=function(e){return this===e||e instanceof h&&u.equals(this._velocityVectorProperty,e._velocityVectorProperty)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))},h}),i("DataSources/Visualizer",["../Core/DeveloperError"],function(e){"use strict";function t(){e.throwInstantiationError()}return t.prototype.update=e.throwInstantiationError,t.prototype.getBoundingSphere=e.throwInstantiationError,t.prototype.isDestroyed=e.throwInstantiationError,t.prototype.destroy=e.throwInstantiationError,t}),i("Renderer/ClearCommand",["../Core/Color","../Core/defaultValue","../Core/freezeObject"],function(e,t,i){"use strict";function r(e){e=t(e,t.EMPTY_OBJECT),this.color=e.color,this.depth=e.depth,this.stencil=e.stencil,this.renderState=e.renderState,this.framebuffer=e.framebuffer,this.owner=e.owner}return r.ALL=i(new r({color:new e(0,0,0,0),depth:1,stencil:0})),r.prototype.execute=function(e,t){e.clear(this,t)},r}),i("Renderer/ComputeCommand",["../Core/defaultValue","./Pass"],function(e,t){"use strict";function i(i){i=e(i,e.EMPTY_OBJECT),this.vertexArray=i.vertexArray,this.fragmentShaderSource=i.fragmentShaderSource,this.shaderProgram=i.shaderProgram,this.uniformMap=i.uniformMap,this.outputTexture=i.outputTexture,this.preExecute=i.preExecute,this.postExecute=i.postExecute,this.persists=e(i.persists,!1),this.pass=t.COMPUTE,this.owner=i.owner}return i.prototype.execute=function(e){e.execute(this)},i}),i("Shaders/ViewportQuadVS",[],function(){"use strict";return"attribute vec4 position;\nattribute vec2 textureCoordinates;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_Position = position;\nv_textureCoordinates = textureCoordinates;\n}\n"}),i("Renderer/ComputeEngine",["../Core/BoundingRectangle","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/PrimitiveType","../Shaders/ViewportQuadVS","./ClearCommand","./DrawCommand","./Framebuffer","./RenderState","./ShaderProgram"],function(e,t,i,r,n,o,a,s,l,u,c,h){"use strict";function d(e){this._context=e}function p(e,t){return new u({context:e,colorTextures:[t],destroyAttachments:!1})}function m(e,t){return h.fromCache({context:e,vertexShaderSource:a,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}function f(t,r){return i(_)&&_.viewport.width===t&&_.viewport.height===r||(_=c.fromCache({viewport:new e(0,0,t,r)})),_}var _,g=new l({primitiveType:o.TRIANGLES}),v=new s({color:new t(0,0,0,0)});return d.prototype.execute=function(e){i(e.preExecute)&&e.preExecute(e);var t=e.outputTexture,r=t.width,n=t.height,o=this._context,a=i(e.vertexArray)?e.vertexArray:o.getViewportQuadVertexArray(),s=i(e.shaderProgram)?e.shaderProgram:m(o,e.fragmentShaderSource),l=p(o,t),u=f(r,n),c=e.uniformMap,h=v;h.framebuffer=l,h.renderState=u,h.execute(o);var d=g;d.vertexArray=a,d.renderState=u,d.shaderProgram=s,d.uniformMap=c,d.framebuffer=l,d.execute(o),l.destroy(),e.persists||(s.destroy(),i(e.vertexArray)&&a.destroy()),i(e.postExecute)&&e.postExecute(t)},d.prototype.isDestroyed=function(){return!1},d.prototype.destroy=function(){return r(this)},d}),i("Renderer/PassState",[],function(){"use strict";function e(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0}return e}),i("Renderer/RenderbufferFormat",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={RGBA4:t.RGBA4,RGB5_A1:t.RGB5_A1,RGB565:t.RGB565,DEPTH_COMPONENT16:t.DEPTH_COMPONENT16,STENCIL_INDEX8:t.STENCIL_INDEX8,DEPTH_STENCIL:t.DEPTH_STENCIL,validate:function(e){return e===i.RGBA4||e===i.RGB5_A1||e===i.RGB565||e===i.DEPTH_COMPONENT16||e===i.STENCIL_INDEX8||e===i.DEPTH_STENCIL}};return e(i)}),i("Renderer/Renderbuffer",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","./ContextLimits","./RenderbufferFormat"],function(e,t,i,r,n,o,a){"use strict";function s(i){i=e(i,e.EMPTY_OBJECT);var r=i.context,n=r._gl,s=(o.maximumRenderbufferSize,e(i.format,a.RGBA4)),l=t(i.width)?i.width:n.drawingBufferWidth,u=t(i.height)?i.height:n.drawingBufferHeight;this._gl=n,this._format=s,this._width=l,this._height=u,this._renderbuffer=this._gl.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,this._renderbuffer),n.renderbufferStorage(n.RENDERBUFFER,s,l,u),n.bindRenderbuffer(n.RENDERBUFFER,null)}return i(s.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}}),s.prototype._getRenderbuffer=function(){return this._renderbuffer},s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),r(this)},s}),i("Renderer/PickFramebuffer",["../Core/BoundingRectangle","../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","./Framebuffer","./PassState","./Renderbuffer","./RenderbufferFormat","./Texture"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(t){var i=new a(t);i.blendingEnabled=!1,i.scissorTest={enabled:!0,rectangle:new e},i.viewport=new e,this._context=t,this._fb=void 0,this._passState=i,this._width=0,this._height=0}c.prototype.begin=function(t){var i=this._context,n=i.drawingBufferWidth,a=i.drawingBufferHeight;return e.clone(t,this._passState.scissorTest.rectangle),r(this._fb)&&this._width===n&&this._height===a||(this._width=n,this._height=a,this._fb=this._fb&&this._fb.destroy(),this._fb=new o({context:i,colorTextures:[new u({context:i,width:n,height:a})],depthStencilRenderbuffer:new s({context:i,format:l.DEPTH_STENCIL})}),this._passState.framebuffer=this._fb),this._passState.viewport.width=n,this._passState.viewport.height=a,this._passState};var h=new t;return c.prototype.end=function(e){for(var n=i(e.width,1),o=i(e.height,1),a=this._context,s=a.readPixels({x:e.x,y:e.y,width:n,height:o,framebuffer:this._fb}),l=Math.max(n,o),u=l*l,c=Math.floor(.5*n),d=Math.floor(.5*o),p=0,m=0,f=0,_=-1,g=0;g0&&p===1-m){var C=f;f=-_,_=C}p+=f,m+=_}},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){return this._fb=this._fb&&this._fb.destroy(),n(this)},c}),i("Renderer/ShaderCache",["../Core/defined","../Core/defineProperties","../Core/destroyObject","./ShaderProgram","./ShaderSource"],function(e,t,i,r,n){"use strict";function o(e){this._context=e,this._shaders={},this._numberOfShaders=0,this._shadersToRelease={}}return t(o.prototype,{numberOfShaders:{get:function(){return this._numberOfShaders}}}),o.prototype.replaceShaderProgram=function(t){return e(t.shaderProgram)&&t.shaderProgram.destroy(),this.getShaderProgram(t)},o.prototype.getShaderProgram=function(e){var t=e.vertexShaderSource,i=e.fragmentShaderSource,o=e.attributeLocations;"string"==typeof t&&(t=new n({sources:[t]})),"string"==typeof i&&(i=new n({sources:[i]}));var a,s=t.createCombinedVertexShader(),l=i.createCombinedFragmentShader(),u=s+l+JSON.stringify(o);if(this._shaders[u])a=this._shaders[u],delete this._shadersToRelease[u];else{var c=this._context,h=new r({gl:c._gl,logShaderCompilation:c.logShaderCompilation,debugShaders:c.debugShaders,vertexShaderSource:t,vertexShaderText:s,fragmentShaderSource:i,fragmentShaderText:l,attributeLocations:o});a={cache:this,shaderProgram:h,keyword:u,count:0},h._cachedShader=a,this._shaders[u]=a,++this._numberOfShaders}return++a.count,a.shaderProgram},o.prototype.destroyReleasedShaderPrograms=function(){var e=this._shadersToRelease;for(var t in e)if(e.hasOwnProperty(t)){var i=e[t];delete this._shaders[i.keyword],i.shaderProgram.finalDestroy(),--this._numberOfShaders}this._shadersToRelease={}},o.prototype.releaseShaderProgram=function(t){if(e(t)){var i=t._cachedShader;i&&0===--i.count&&(this._shadersToRelease[i.keyword]=i)}},o.prototype.isDestroyed=function(){return!1},o.prototype.destroy=function(){var e=this._shaders;for(var t in e)e.hasOwnProperty(t)&&e[t].shaderProgram.finalDestroy();return i(this)},o}),i("Renderer/UniformState",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/defined","../Core/defineProperties","../Core/EncodedCartesian3","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/Simon1994PlanetaryPositions","../Core/Transforms","../Scene/SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p){"use strict";function m(){this.globeDepthTexture=void 0,this._viewport=new e,this._viewportCartesian4=new r,this._viewportDirty=!1,this._viewportOrthographicMatrix=c.clone(c.IDENTITY),this._viewportTransformation=c.clone(c.IDENTITY),this._model=c.clone(c.IDENTITY),this._view=c.clone(c.IDENTITY),this._inverseView=c.clone(c.IDENTITY),this._projection=c.clone(c.IDENTITY),this._infiniteProjection=c.clone(c.IDENTITY),this._entireFrustum=new t,this._currentFrustum=new t,this._frustumPlanes=new r,this._frameState=void 0,this._temeToPseudoFixed=u.clone(c.IDENTITY),this._view3DDirty=!0,this._view3D=new c,this._inverseView3DDirty=!0,this._inverseView3D=new c,this._inverseModelDirty=!0,this._inverseModel=new c,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new u,this._viewRotation=new u,this._inverseViewRotation=new u,this._viewRotation3D=new u,this._inverseViewRotation3D=new u,this._inverseProjectionDirty=!0,this._inverseProjection=new c,this._inverseProjectionOITDirty=!0,this._inverseProjectionOIT=new c,this._modelViewDirty=!0,this._modelView=new c,this._modelView3DDirty=!0,this._modelView3D=new c,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new c,this._inverseModelViewDirty=!0,this._inverseModelView=new c,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new c,this._viewProjectionDirty=!0,this._viewProjection=new c,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new c,this._modelViewProjectionDirty=!0,this._modelViewProjection=new c,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new c,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new c,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new c,this._normalDirty=!0,this._normal=new u,this._normal3DDirty=!0,this._normal3D=new u,this._inverseNormalDirty=!0,this._inverseNormal=new u,this._inverseNormal3DDirty=!0,this._inverseNormal3D=new u,this._encodedCameraPositionMCDirty=!0,this._encodedCameraPositionMC=new s,this._cameraPosition=new i,this._sunPositionWC=new i,this._sunPositionColumbusView=new i,this._sunDirectionWC=new i,this._sunDirectionEC=new i,this._moonDirectionEC=new i,this._pass=void 0,this._mode=void 0,this._mapProjection=void 0,this._cameraDirection=new i,this._cameraRight=new i,this._cameraUp=new i,this._frustum2DWidth=0,this._eyeHeight2D=new t,this._resolutionScale=1,this._fogDensity=void 0}function f(e,t){c.clone(t,e._view),c.getRotation(t,e._viewRotation),e._view3DDirty=!0,e._inverseView3DDirty=!0,e._modelViewDirty=!0,e._modelView3DDirty=!0,e._modelViewRelativeToEyeDirty=!0,e._inverseModelViewDirty=!0,e._inverseModelView3DDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0,e._modelViewInfiniteProjectionDirty=!0,e._normalDirty=!0,e._inverseNormalDirty=!0,e._normal3DDirty=!0,e._inverseNormal3DDirty=!0}function _(e,t){c.clone(t,e._inverseView),c.getRotation(t,e._inverseViewRotation)}function g(e,t){c.clone(t,e._projection),e._inverseProjectionDirty=!0,e._inverseProjectionOITDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function v(e,t){c.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}function y(e,t){i.clone(t.positionWC,e._cameraPosition),i.clone(t.directionWC,e._cameraDirection),i.clone(t.rightWC,e._cameraRight),i.clone(t.upWC,e._cameraUp),e._encodedCameraPositionMCDirty=!0}function C(e,t){o(d.computeIcrfToFixedMatrix(t.time,W))||(W=d.computeTemeToPseudoFixedMatrix(t.time,W));var r=h.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);u.multiplyByVector(W,r,r),i.normalize(r,e._sunDirectionWC),r=u.multiplyByVector(e.viewRotation3D,r,e._sunDirectionEC),i.normalize(r,r),r=h.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),u.multiplyByVector(W,r,r),u.multiplyByVector(e.viewRotation3D,r,r),i.normalize(r,r);var n=t.mapProjection,a=n.ellipsoid,s=a.cartesianToCartographic(e._sunPositionWC,H);n.project(s,e._sunPositionColumbusView)}function w(e){if(e._viewportDirty){var t=e._viewport;c.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),c.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}function S(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,c.inverse(e._projection,e._inverseProjection))}function E(e){e._inverseProjectionOITDirty&&(e._inverseProjectionOITDirty=!1,e._mode!==p.SCENE2D&&e._mode!==p.MORPHING?c.inverse(e._projection,e._inverseProjectionOIT):c.clone(c.IDENTITY,e._inverseProjectionOIT))}function b(e){e._modelViewDirty&&(e._modelViewDirty=!1,c.multiplyTransformation(e._view,e._model,e._modelView))}function T(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,c.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function x(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,c.inverse(e.modelView,e._inverseModelView))}function A(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,c.inverse(e.modelView3D,e._inverseModelView3D))}function P(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,c.multiply(e._projection,e._view,e._viewProjection))}function D(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,c.inverse(e.viewProjection,e._inverseViewProjection))}function M(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,c.multiply(e._projection,e.modelView,e._modelViewProjection))}function I(e){if(e._modelViewRelativeToEyeDirty){e._modelViewRelativeToEyeDirty=!1;var t=e.modelView,i=e._modelViewRelativeToEye;i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5],i[6]=t[6],i[7]=t[7],i[8]=t[8],i[9]=t[9],i[10]=t[10],i[11]=t[11],i[12]=0,i[13]=0,i[14]=0,i[15]=t[15]}}function R(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,c.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function O(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,c.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function N(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,c.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function L(e){if(e._normalDirty){e._normalDirty=!1;var t=e._normal;c.getRotation(e.inverseModelView,t),u.transpose(t,t)}}function B(e){if(e._normal3DDirty){e._normal3DDirty=!1;var t=e._normal3D;c.getRotation(e.inverseModelView3D,t),u.transpose(t,t)}}function F(e){e._inverseNormalDirty&&(e._inverseNormalDirty=!1,c.getRotation(e.inverseModelView,e._inverseNormal))}function V(e){e._inverseNormal3DDirty&&(e._inverseNormal3DDirty=!1,c.getRotation(e.inverseModelView3D,e._inverseNormal3D))}function k(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,c.multiplyByPoint(e.inverseModel,e._cameraPosition,q),s.fromCartesian(q,e._encodedCameraPositionMC))}function z(e,t,r,n,a,s,u,h){var m=j;m.x=e.y,m.y=e.z,m.z=e.x;var f=Y;f.x=r.y,f.y=r.z,f.z=r.x;var _=X;_.x=n.y,_.y=n.z,_.z=n.x;var g=Z;g.x=t.y,g.y=t.z,g.z=t.x,s===p.SCENE2D&&(m.z=.5*a);var v=u.unproject(m,K);v.longitude=l.clamp(v.longitude,-Math.PI,Math.PI),v.latitude=l.clamp(v.latitude,-l.PI_OVER_TWO,l.PI_OVER_TWO);var y=u.ellipsoid,C=y.cartographicToCartesian(v,Q),w=d.eastNorthUpToFixedFrame(C,y,J);return c.multiplyByPointAsVector(w,f,f),c.multiplyByPointAsVector(w,_,_),c.multiplyByPointAsVector(w,g,g),o(h)||(h=new c),h[0]=f.x,h[1]=_.x,h[2]=-g.x,h[3]=0,h[4]=f.y,h[5]=_.y,h[6]=-g.y,h[7]=0,h[8]=f.z,h[9]=_.z,h[10]=-g.z,h[11]=0,h[12]=-i.dot(f,C),h[13]=-i.dot(_,C),h[14]=i.dot(g,C),h[15]=1,h}function U(e){e._view3DDirty&&(e._mode===p.SCENE3D?c.clone(e._view,e._view3D):z(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),c.getRotation(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function G(e){e._inverseView3DDirty&&(c.inverseTransformation(e.view3D,e._inverseView3D),c.getRotation(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}a(m.prototype,{frameState:{get:function(){return this._frameState}},viewport:{get:function(){return this._viewport},set:function(t){if(!e.equals(t,this._viewport)){e.clone(t,this._viewport);var i=this._viewport,r=this._viewportCartesian4;r.x=i.x,r.y=i.y,r.z=i.width,r.w=i.height,this._viewportDirty=!0}}},viewportCartesian4:{get:function(){return this._viewportCartesian4}},viewportOrthographic:{get:function(){return w(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return w(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){c.clone(e,this._model),this._modelView3DDirty=!0,this._inverseModelView3DDirty=!0,this._inverseModelDirty=!0,this._inverseTransposeModelDirty=!0,this._modelViewDirty=!0,this._inverseModelViewDirty=!0,this._modelViewRelativeToEyeDirty=!0,this._inverseModelViewDirty=!0,this._modelViewProjectionDirty=!0,this._inverseModelViewProjectionDirty=!0,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewInfiniteProjectionDirty=!0,this._normalDirty=!0,this._inverseNormalDirty=!0,this._normal3DDirty=!0,this._inverseNormal3DDirty=!0,this._encodedCameraPositionMCDirty=!0}},inverseModel:{get:function(){return this._inverseModelDirty&&(this._inverseModelDirty=!1,c.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTransposeModel:{get:function(){var e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,c.getRotation(this.inverseModel,e),u.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return U(this),this._view3D}},viewRotation:{get:function(){return U(this),this._viewRotation}},viewRotation3D:{get:function(){return U(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return G(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return G(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return S(this),this._inverseProjection}},inverseProjectionOIT:{get:function(){return E(this),this._inverseProjectionOIT}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return b(this),this._modelView}},modelView3D:{get:function(){return T(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return I(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return x(this),this._inverseModelView; -}},inverseModelView3D:{get:function(){return A(this),this._inverseModelView3D}},viewProjection:{get:function(){return P(this),this._viewProjection}},inverseViewProjection:{get:function(){return D(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return M(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return R(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return O(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return N(this),this._modelViewInfiniteProjection}},normal:{get:function(){return L(this),this._normal}},normal3D:{get:function(){return B(this),this._normal3D}},inverseNormal:{get:function(){return F(this),this._inverseNormal}},inverseNormal3D:{get:function(){return V(this),this._inverseNormal3D}},entireFrustum:{get:function(){return this._entireFrustum}},currentFrustum:{get:function(){return this._currentFrustum}},frustumPlanes:{get:function(){return this._frustumPlanes}},eyeHeight2D:{get:function(){return this._eyeHeight2D}},sunPositionWC:{get:function(){return this._sunPositionWC}},sunPositionColumbusView:{get:function(){return this._sunPositionColumbusView}},sunDirectionWC:{get:function(){return this._sunDirectionWC}},sunDirectionEC:{get:function(){return this._sunDirectionEC}},moonDirectionEC:{get:function(){return this._moonDirectionEC}},encodedCameraPositionMCHigh:{get:function(){return k(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return k(this),this._encodedCameraPositionMC.low}},temeToPseudoFixedMatrix:{get:function(){return this._temeToPseudoFixed}},resolutionScale:{get:function(){return this._resolutionScale}},fogDensity:{get:function(){return this._fogDensity}},pass:{get:function(){return this._pass}}});var W=new u,H=new n;m.prototype.updateCamera=function(e){f(this,e.viewMatrix),_(this,e.inverseViewMatrix),y(this,e),this._entireFrustum.x=e.frustum.near,this._entireFrustum.y=e.frustum.far,this.updateFrustum(e.frustum)},m.prototype.updateFrustum=function(e){g(this,e.projectionMatrix),o(e.infiniteProjectionMatrix)&&v(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far,o(e.top)||(e=e._offCenterFrustum),this._frustumPlanes.x=e.top,this._frustumPlanes.y=e.bottom,this._frustumPlanes.z=e.left,this._frustumPlanes.w=e.right},m.prototype.updatePass=function(e){this._pass=e},m.prototype.update=function(e){this._mode=e.mode,this._mapProjection=e.mapProjection;var t=e.context._canvas;this._resolutionScale=t.width/t.clientWidth;var i=e.camera;this.updateCamera(i),e.mode===p.SCENE2D?(this._frustum2DWidth=i.frustum.right-i.frustum.left,this._eyeHeight2D.x=.5*this._frustum2DWidth,this._eyeHeight2D.y=this._eyeHeight2D.x*this._eyeHeight2D.x):(this._frustum2DWidth=0,this._eyeHeight2D.x=0,this._eyeHeight2D.y=0),C(this,e),this._fogDensity=e.fog.density,this._frameState=e,this._temeToPseudoFixed=d.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed)};var q=new i,j=new i,Y=new i,X=new i,Z=new i,K=new n,Q=new i,J=new c;return m}),i("Renderer/Context",["../Core/clone","../Core/Color","../Core/ComponentDatatype","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Geometry","../Core/GeometryAttribute","../Core/Matrix4","../Core/PrimitiveType","../Core/RuntimeError","../Core/WebGLConstants","../Shaders/ViewportQuadVS","./BufferUsage","./ClearCommand","./ContextLimits","./CubeMap","./DrawCommand","./PassState","./PickFramebuffer","./RenderState","./ShaderCache","./ShaderProgram","./Texture","./UniformState","./VertexArray"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A,P){"use strict";function D(e,t){var i="WebGL Error: ";switch(t){case e.INVALID_ENUM:i+="INVALID_ENUM";break;case e.INVALID_VALUE:i+="INVALID_VALUE";break;case e.INVALID_OPERATION:i+="INVALID_OPERATION";break;case e.OUT_OF_MEMORY:i+="OUT_OF_MEMORY";break;case e.CONTEXT_LOST_WEBGL:i+="CONTEXT_LOST_WEBGL lost";break;default:i+="Unknown ("+t+")"}return i}function M(e,t,i,r){for(var n=D(e,r)+": "+t.name+"(",o=0;o=8}},antialias:{get:function(){return this._antialias}},standardDerivatives:{get:function(){return this._standardDerivatives}},elementIndexUint:{get:function(){return this._elementIndexUint||this._webgl2}},depthTexture:{get:function(){return this._depthTexture}},floatingPointTexture:{get:function(){return this._textureFloat}},textureFilterAnisotropic:{get:function(){return!!this._textureFilterAnisotropic}},vertexArrayObject:{get:function(){return this._vertexArrayObject||this._webgl2}},fragmentDepth:{get:function(){return this._fragDepth}},instancedArrays:{get:function(){return this._instancedArrays||this._webgl2}},drawBuffers:{get:function(){return this._drawBuffers||this._webgl2}},debugShaders:{get:function(){return this._debugShaders}},throwOnWebGLError:{get:function(){return this._throwOnWebGLError},set:function(e){this._throwOnWebGLError=e,this._gl=O(this._originalGLContext,e?I:null)}},defaultTexture:{get:function(){return void 0===this._defaultTexture&&(this._defaultTexture=new x({context:this,source:{width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])}})),this._defaultTexture}},defaultCubeMap:{get:function(){if(void 0===this._defaultCubeMap){var e={width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])};this._defaultCubeMap=new y({context:this,source:{positiveX:e,negativeX:e,positiveY:e,negativeY:e,positiveZ:e,negativeZ:e}})}return this._defaultCubeMap}},drawingBufferHeight:{get:function(){return this._gl.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._gl.drawingBufferWidth}},defaultFramebuffer:{get:function(){return G}}});var W;"undefined"!=typeof WebGLRenderingContext&&(W=[m.BACK]);var H=new g;L.prototype.clear=function(e,i){e=n(e,H),i=n(i,this._defaultPassState);var r=this._gl,a=0,s=e.color,l=e.depth,u=e.stencil;o(s)&&(t.equals(this._clearColor,s)||(t.clone(s,this._clearColor),r.clearColor(s.red,s.green,s.blue,s.alpha)),a|=r.COLOR_BUFFER_BIT),o(l)&&(l!==this._clearDepth&&(this._clearDepth=l,r.clearDepth(l)),a|=r.DEPTH_BUFFER_BIT),o(u)&&(u!==this._clearStencil&&(this._clearStencil=u,r.clearStencil(u)),a|=r.STENCIL_BUFFER_BIT);var c=n(e.renderState,this._defaultRenderState);F(this,c,i,!0);var h=n(e.framebuffer,i.framebuffer);V(this,h),r.clear(a)},L.prototype.draw=function(e,t){t=n(t,this._defaultPassState);var i=n(e._framebuffer,t.framebuffer);k(this,i,e,t),z(this,e)},L.prototype.endFrame=function(){var e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);var t=W;this.drawBuffers&&this.glDrawBuffers(t);var i=this._maxFrameTextureUnitIndex;this._maxFrameTextureUnitIndex=0;for(var r=0;r0&&(o=!1)}o&&(n=void 0)}l._missingImagePixels=n,l._isReady=!0}function s(){l._missingImagePixels=void 0,l._isReady=!0}i=e(i,e.EMPTY_OBJECT),this._pixelsToCheck=i.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;var l=this;o(n(i.missingImageUrl),a,s)}return a.prototype.isReady=function(){return this._isReady},a.prototype.shouldDiscardImage=function(e){var i=this._pixelsToCheck,n=this._missingImagePixels;if(!t(n))return!1;if(t(e.blob)&&e.blob.size!==this._missingImageByteLength)return!1;for(var o=r(e),a=e.width,s=0,l=i.length;s1&&"name"===o?(r=1,i=n):r>2&&"title"===o?(r=2,i=n):r>3&&/name/i.test(n)?(r=3,i=n):r>4&&/title/i.test(n)&&(r=4,i=n)}e(i)&&(this.name=t[i])},t.prototype.configureDescriptionFromProperties=function(t){function i(t){var r='';for(var n in t)if(t.hasOwnProperty(n)){var o=t[n];e(o)&&(r+="object"==typeof o?"":"")}return r+="
"+n+""+i(o)+"
"+n+""+o+"
"}this.description=i(t)},t}),i("Scene/ImageryProvider",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/loadImage","../Core/loadImageViaBlob","../Core/throttleRequestByServer"],function(e,t,i,r,n,o){"use strict";function a(){this.defaultAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=void 0,i.throwInstantiationError()}return t(a.prototype,{ready:{get:i.throwInstantiationError},readyPromise:{get:i.throwInstantiationError},rectangle:{get:i.throwInstantiationError},tileWidth:{get:i.throwInstantiationError},tileHeight:{get:i.throwInstantiationError},maximumLevel:{get:i.throwInstantiationError},minimumLevel:{get:i.throwInstantiationError},tilingScheme:{get:i.throwInstantiationError},tileDiscardPolicy:{get:i.throwInstantiationError},errorEvent:{get:i.throwInstantiationError},credit:{get:i.throwInstantiationError},proxy:{get:i.throwInstantiationError},hasAlphaChannel:{get:i.throwInstantiationError}}),a.prototype.getTileCredits=i.throwInstantiationError,a.prototype.requestImage=i.throwInstantiationError,a.prototype.pickFeatures=i.throwInstantiationError,a.loadImage=function(t,i){return e(t.tileDiscardPolicy)?o(i,n):o(i,r)},a}),i("Scene/ArcGisMapServerImageryProvider",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/GeographicTilingScheme","../Core/loadJson","../Core/loadJsonp","../Core/Math","../Core/Rectangle","../Core/RuntimeError","../Core/TileProviderError","../Core/WebMercatorProjection","../Core/WebMercatorTilingScheme","../ThirdParty/when","./DiscardMissingTileImagePolicy","./ImageryLayerFeatureInfo","./ImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w){"use strict";function S(i){function a(n){var a=n.tileInfo;if(o(a)){if(C._tileWidth=a.rows,C._tileHeight=a.cols,102100===a.spatialReference.wkid||102113===a.spatialReference.wkid)C._tilingScheme=new g({ellipsoid:i.ellipsoid});else{if(4326!==n.tileInfo.spatialReference.wkid){var s="Tile spatial reference WKID "+n.tileInfo.spatialReference.wkid+" is not supported.";return void(d=f.handleError(d,C,C._errorEvent,s,void 0,void 0,void 0,c))}C._tilingScheme=new u({ellipsoid:i.ellipsoid})}if(C._maximumLevel=n.tileInfo.lods.length-1,o(n.fullExtent)){if(o(n.fullExtent.spatialReference)&&o(n.fullExtent.spatialReference.wkid))if(102100===n.fullExtent.spatialReference.wkid||102113===n.fullExtent.spatialReference.wkid){var l=new _,h=n.fullExtent,m=l.unproject(new t(Math.max(h.xmin,-C._tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.max(h.ymin,-C._tilingScheme.ellipsoid.maximumRadius*Math.PI),0)),v=l.unproject(new t(Math.min(h.xmax,C._tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.min(h.ymax,C._tilingScheme.ellipsoid.maximumRadius*Math.PI),0));C._rectangle=new p(m.longitude,m.latitude,v.longitude,v.latitude)}else{if(4326!==n.fullExtent.spatialReference.wkid){var w="fullExtent.spatialReference WKID "+n.fullExtent.spatialReference.wkid+" is not supported.";return void(d=f.handleError(d,C,C._errorEvent,w,void 0,void 0,void 0,c))}C._rectangle=p.fromDegrees(n.fullExtent.xmin,n.fullExtent.ymin,n.fullExtent.xmax,n.fullExtent.ymax)}}else C._rectangle=C._tilingScheme.rectangle;o(C._tileDiscardPolicy)||(C._tileDiscardPolicy=new y({missingImageUrl:E(C,0,0,C._maximumLevel),pixelsToCheck:[new e(0,0),new e(200,20),new e(20,200),new e(80,110),new e(160,130)],disableCheckIfAllPixelsAreTransparent:!0})),C._useTiles=!0}else C._useTiles=!1;o(n.copyrightText)&&n.copyrightText.length>0&&(C._credit=new r(n.copyrightText)),C._ready=!0,C._readyPromise.resolve(!0),f.handleSuccess(d)}function s(e){var t="An error occurred while accessing "+C._url+".";d=f.handleError(d,C,C._errorEvent,t,void 0,void 0,void 0,c),C._readyPromise.reject(new m(t))}function c(){var e={f:"json"};o(C._token)&&(e.token=C._token);var t=h(C._url,{parameters:e,proxy:C._proxy});v(t,a,s)}i=n(i,{}),this._url=i.url,this._token=i.token,this._tileDiscardPolicy=i.tileDiscardPolicy,this._proxy=i.proxy,this._tileWidth=n(i.tileWidth,256),this._tileHeight=n(i.tileHeight,256),this._maximumLevel=i.maximumLevel,this._tilingScheme=n(i.tilingScheme,new u({ellipsoid:i.ellipsoid})),this._credit=void 0,this._useTiles=n(i.usePreCachedTilesIfAvailable,!0),this._rectangle=n(i.rectangle,this._tilingScheme.rectangle),this._layers=i.layers,this.enablePickFeatures=n(i.enablePickFeatures,!0),this._errorEvent=new l,this._ready=!1,this._readyPromise=v.defer();var d,C=this;this._useTiles?c():(this._ready=!0,this._readyPromise.resolve(!0))}function E(e,t,i,r){var n;if(e._useTiles)n=e._url+"/tile/"+r+"/"+i+"/"+t;else{var a=e._tilingScheme.tileXYToNativeRectangle(t,i,r),s=a.west+"%2C"+a.south+"%2C"+a.east+"%2C"+a.north;n=e._url+"/export?",n+="bbox="+s,n+=e._tilingScheme instanceof u?"&bboxSR=4326&imageSR=4326":"&bboxSR=3857&imageSR=3857",n+="&size="+e._tileWidth+"%2C"+e._tileHeight,n+="&format=png&transparent=true&f=image",e.layers&&(n+="&layers=show:"+e.layers)}var l=e._token;o(l)&&(n.indexOf("?")===-1&&(n+="?"),"?"!==n[n.length-1]&&(n+="&"),n+="token="+l);var c=e._proxy;return o(c)&&(n=c.getURL(n)),n}return a(S.prototype,{url:{get:function(){return this._url}},token:{get:function(){return this._token}},proxy:{get:function(){return this._proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},usingPrecachedTiles:{get:function(){return this._useTiles}},hasAlphaChannel:{get:function(){return!0}},layers:{get:function(){return this._layers}}}),S.prototype.getTileCredits=function(e,t,i){},S.prototype.requestImage=function(e,t,i){var r=E(this,e,t,i);return w.loadImage(this,r)},S.prototype.pickFeatures=function(e,r,n,a,s){if(this.enablePickFeatures){var l,h,p,m=this._tilingScheme.tileXYToNativeRectangle(e,r,n);if(this._tilingScheme instanceof u)l=d.toDegrees(a),h=d.toDegrees(s),p="4326";else{var f=this._tilingScheme.projection.project(new i(a,s,0));l=f.x,h=f.y,p="3857"}var g=this._url+"/identify?f=json&tolerance=2&geometryType=esriGeometryPoint";return g+="&geometry="+l+","+h,g+="&mapExtent="+m.west+","+m.south+","+m.east+","+m.north,g+="&imageDisplay="+this._tileWidth+","+this._tileHeight+",96",g+="&sr="+p,g+="&layers=visible",o(this._layers)&&(g+=":"+this._layers),o(this._token)&&(g+="&token="+this._token),o(this._proxy)&&(g=this._proxy.getURL(g)),c(g).then(function(e){var r=[],n=e.results;if(!o(n))return r;for(var a=0;a=p.zoomMin&&t<=p.zoomMax){var m=c.intersection(i,p.bbox,S);n(m)&&(u=!0)}}u&&r.push(s.credit)}return r}o(v.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._proxy}},key:{get:function(){return this._key}},mapStyle:{get:function(){return this._mapStyle}},culture:{get:function(){return this._culture}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!1}}});var w=new c;v.prototype.getTileCredits=function(e,t,i){var r=this._tilingScheme.tileXYToRectangle(e,t,i,w),o=C(this._attributionList,i,r);return n(this._keyErrorCredit)&&o.push(this._keyErrorCredit),o},v.prototype.requestImage=function(e,t,i){var r=y(this,e,t,i);return g.loadImage(this,r)},v.prototype.pickFeatures=function(){},v._logoData="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD0AAAAaCAYAAAAEy1RnAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAB3RJTUUH3gIDEgcPTMnXOQAAClZJREFUWMPdWGtsFNcV/u689uH1+sXaONhlWQzBENtxiUFBpBSLd60IpXHSNig4URtSYQUkRJNSi0igViVVVBJBaBsiAgKRQJSG8AgEHCCWU4iBCprY2MSgXfOI16y9D3s9Mzsztz9yB12WNU2i9Ecy0tHOzN4793zn3POdcy7BnRfJ8I7iB3SRDPeEExswLz8Y0DZIAYDIRGAgLQAm+7Xle31J3L3Anp1MZPY+BUBjorN332vgYhpgV1FRUd6TTz45ubq6OtDV1SXpuu5g//Oept9wNwlMyAi8IXDjyF245TsDTdivDMATCATGNDU1/WbhwoWPTZs2bWx1dXWhx+Oxrl+/PqTrus5t9W8KWEzjinTAYhro/xuBStwiIgBnJBLxKIoy1u/3V/r9/krDMMz3339/Z3t7e38ikUgCMDLEt8W+Q0cAI3McYTDDmZxh7DESG5Ni43jg9Gsa+X+OsxWxPSJTSj3JZFK5ZRVJErOzs8e6XC4fgGwALhbzDgAKU1hK28KEA6PMmTMn56233qpevnz5PQDcbJ7EzVUAuMrLy3MBeABkcWOEDELSyFe4y7iMoHkriZZlKYZh8ASHZDKpJJPJHAC5APIA5APIAeBlCjo5TwlpXnbOmTPHP3fu3KZVq1atZKBcDJQ9x7V48WJfc3Pzhp6enj+tXLnyR8w4MjdG4gyVDk7KICMClzKlLUrpbQMNw5AkScppbGz8cWdn57WjR4/2caw+DEBlYjO8wX1foZQWuN3uKZIklQD4G+fhlG0Yl8uVm5WVVW6app6dne0D0G8vnxbjJntHubCUOK/badZICyWanrJuAaeUknTQpmlKkUhEWbx48U8LCwtHhUKha+fPn+85fPhwV0tLyzUACSZx9jvMFhIByNFoVDEMw/qKB5HPvJfkUqBr9+7deklJyZ/j8bi5ffv2OAslieMLsG+m2DybT2QuzEQOsF5SUqJfvXo1yc2l6Xn6rgSRSCSEc+fOhVeuXLmwoqJixvTp0wcWLFgQ7unpudHR0dF97ty5z/fu3XseQJh5adjeerquy5ZlCalUivh8Pt8HH3ywzOPxyD09PZ81NjZ+2NnZaQEQx40b54vFYqaqquEVK1b4a2tr/WvWrDn18ssv144fP36SqqoD69ev371nz57rDLwAwHHkyJGfjRs3rtowDOv06dOnu7q6rs6bN2/s7Nmz9zIjDKenWoFZKg/AlMLCwl82Nzf/m3LX22+/fXb06NF/ALC8u7u7m6ZdkUhksL29/UpLS0vzunXrVgAoBzAaQBGAiY2NjUui0ei1RCLRFwwG/9PX19cVi8WCqqoOdHd3HysrK6sDMCccDl8IBoOtiqIsOnbs2D+i0eiV3t7ez8Ph8GeRSKRT07TB/v7+i1OnTp0HYBqABzs7O/+paVo0Fot1RyKRi/F4/Gp/f39XIpHoZnoUMn6wU+ZtRDaymwmxZFk2AWjvvvvuJ/F4PMn/n5+fn1VeXu6fOXNmbU1NzUOM4Bz8QqIoyg6HwxuLxfq3bdu2a+vWrW/09/dfKy0tffDVV199BEC20+n0ud3uQgBup9Pp83g8JYqieE+ePPnxxo0bt33xxRen8/Ly7n3hhRcWASh47bXX5pWVldWFw+GuXbt27XjzzTd3BoPBDq/XG1AUZRRHmAKPVfqaoKkgCCkA+oYNG84Eg0FHTU1N5ezZs8eWlJQ4CSF8/LvZYhJPQoQQpFKpwcrKyo1su9HBwUF99erVv588eXINgOOmacIwDEopdaZSKUIpxYkTJz6sr68/BMBav379RcMwZk2aNOl+AP+qq6t7xDTNVEVFxR+j0WgSAJk4ceKlTz/9tNzpdHpZvIvpjVW6pykhhBJCbkvwgiAQQogEQL558ybdtGlTsLm5OWJZdxZmlmWll5OUEEJN0zSGhob6GcOrALSzZ8/2apqWcLlc2axGACNRkRAimqaph0Kh68xIwwB0y7IMSZKcABz5+fkl8Xj8y2g0apOb5na7rYGBgS/JV54Q0qpAAoBKaS0jBWClg1ZVFeFw2AlgVF1dXeDpp5+eWVFRUVpcXOzgvQwAbrcbDJhdudlGpKZpGtx6JCcnRxIEQbQsS2PjbjM+AMvlchnMSBaXkr7ymCCIhmEYfMoVRVESBEHI0CaTTNubssUsQRBuubCtra33pZdeCk6YMCGwZs2aipqaGn9paWmuJEl3JP0bN258eeTIkRMABrm0YomiaImiKGVlZeWxLecAgBkzZvgdDkfWjRs3ggA0bpfpoiiahBCqKEqKAy2yULMA6MlkMp6Xl3cP1x2SWCwmFhQU+CmlFhfHNFOevpX4LcvSJUkyAeDQoUOh119//fpTTz01Zf78+UWBQCBHUZQ7yE/TNGPfvn0n33vvvSP79+//BECMeZsCMGRZNgRBgNPpHHXx4sVVDQ0Nf1+wYMGYJ554YikAevDgwUMA4oIgQJZlSggZdDqdBiGEZGdn6ww0tQlJURTT4/EMHz9+/MCjjz7622AwuHbZsmVbiouLvWvXrm1wOp3ZqVRqaKQTIInf1gAMl8ulU0q1CxcuBGOxmL5u3bryQCDgycrKEjORXGtra8eOHTsOHz169OyVK1cuA+hlRYrGlNRkWR7UNO2mYRiaz+cb3dLS8gYhhOi6Hj116tSOVatWHQNALcsaME0zLghClBDSZ9+zQsZ2SoJS2udwOKLPPffcvsrKyrJAIPDQ/v37txiGofX19V3r7e29UlBQMHqEVpjwnrYA6PF4PK6q6s2qqqqpZWVlitvtljOB7enpiWzbtu3wgQMHTre1tV0E0MeKkkGuIhMAqHv37u30er3Px+NxlyiKygMPPOAnhFiXLl0Kbd68uYPNsXbu3Lk6mUwaqqr2btmyZUdtbe3hd955pwvAEFNcO3jw4K/b2tqiqqpGIpGI4/HHH/9rQ0PDCa/XOyoSidDLly8PNTU1PcZ4QuNK1ju6NYHFRAGASXPnzv1Fa2vrxzTDpapqateuXR/Nnz+/SVGUhwFMBzCBFSLZLF75DsrJGpXRAH4EIABgPIBxAEoBFAPwARjFif1sNzZ25+VlOhaxufcCqAFQC+BhAPVLliz5XSqVUkOhUAuAKWnFyR3dlsw+fg+A+8eMGfPzTZs2bY9GozEb8JkzZ9qXLl36l+Li4l8B+AmAyQDGsGrOzfXNPGPawG2l85jksmcPm+vihH+2W1iF3bvZPN+sWbPuGx4eDrW3t+85fvz41o6OjmZN04Y0TYvV19cvYIbN5QqUjG2mwj5YAqDK4XDMe+aZZ55vbW09+sorr2yuqqpqYFatAuBn3uB7XzJCY297XeaUd2RoGzOJmHb6IjFj5D777LP3DQwMfDw8PBxSVbUvkUj0hEKhj1588cXH2O7zMSPdplumoxveMx5Zlj3jx4/39vb26gMDA4MsvgYZo+p8Pr7LqQX5Ds/U7d0jFxUVZS1atKg4Nzc317Isp67rZldXV6y5ufkmI78hFtcmrx8ZweMit6XsUs4+6kmlgbW+peLf9gyMZNCR374G0y/FxEzX8b/8+bkXEBxKFwAAAABJRU5ErkJggg==", -v.tileXYToQuadKey=function(e,t,i){for(var r="",n=i;n>=0;--n){var o=1<=0;--n){var o=1<e+Math.PI?e+=s.TWO_PI:ts.PI&&(C.longitude+=s.TWO_PI);var S=d(h,n,_.height,C.height,u);return c}function _(i,r,n,o,a,l,u){function c(t){var i=t.time/r;h.setView({orientation:{heading:s.lerp(f,o,i)}}),e.lerp(m,n,i,h.position);var a=g(i),l=h.frustum,u=l.top/l.right,c=.5*(a-(l.right-l.left));l.right+=c,l.left-=c,l.top=u*l.right,l.bottom=-l.top}var h=i.camera,m=t.clone(h.position,S),f=p(h.heading,o),_=h.frustum.right-h.frustum.left,g=d(h,n,_,n.z,u);return c}function g(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function v(e,t){function i(){"function"==typeof t&&t(),e.enableInputs=!0}return i}var y={},C=new t,w=new t,S=new t,E=new i,b=new i,T=new i,x=new t;return y.createTween=function(i,o){o=r(o,r.EMPTY_OBJECT);var l=o.destination,u=i.mode;if(u===c.MORPHING)return g();var h=r(o.convert,!0),d=i.mapProjection,p=d.ellipsoid,y=o.maximumHeight,C=o.easingFunction;h&&u!==c.SCENE3D&&(p.cartesianToCartographic(l,T),l=d.project(T,x));var w=i.camera,S=o.endTransform;n(S)&&w._setTransform(S);var E=o.duration;n(E)||(E=Math.ceil(t.distance(w.position,l)/1e6)+2,E=Math.min(E,3));var b=r(o.heading,0),A=r(o.pitch,-s.PI_OVER_TWO),P=r(o.roll,0),D=i.screenSpaceCameraController;D.enableInputs=!1;var M=v(D,o.complete),I=v(D,o.cancel),R=w.frustum,O=i.mode===c.SCENE2D;if(O=O&&e.equalsEpsilon(w.position,l,s.EPSILON6),O=O&&s.equalsEpsilon(Math.max(R.right-R.left,R.top-R.bottom),l.z,s.EPSILON6),O=O||i.mode!==c.SCENE2D&&t.equalsEpsilon(l,w.position,s.EPSILON10),O=O&&s.equalsEpsilon(s.negativePiToPi(b),s.negativePiToPi(w.heading),s.EPSILON10)&&s.equalsEpsilon(s.negativePiToPi(A),s.negativePiToPi(w.pitch),s.EPSILON10)&&s.equalsEpsilon(s.negativePiToPi(P),s.negativePiToPi(w.roll),s.EPSILON10))return g(M,I);var N=new Array(4);if(N[c.SCENE2D]=_,N[c.SCENE3D]=f,N[c.COLUMBUS_VIEW]=m,E<=0){var L=function(){var e=N[u](i,1,l,b,A,P,y);e({time:1}),"function"==typeof M&&M()};return g(L,I)}var B=N[u](i,E,l,b,A,P,y);if(!n(C)){var F=w.positionCartographic.height,V=u===c.SCENE3D?p.cartesianToCartographic(l).height:l.z;C=F>V&&F>11500?a.CUBIC_OUT:a.QUINTIC_IN_OUT}return{duration:E,easingFunction:C,startObject:{time:0},stopObject:{time:E},update:B,complete:M,cancel:I}},y}),i("Scene/MapMode2D",["../Core/freezeObject"],function(e){"use strict";var t={ROTATE:0,INFINITE_SCROLL:1};return e(t)}),i("Scene/Camera",["../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/EasingFunction","../Core/Ellipsoid","../Core/EllipsoidGeodesic","../Core/Event","../Core/HeadingPitchRange","../Core/Intersect","../Core/IntersectionTests","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/Quaternion","../Core/Ray","../Core/Rectangle","../Core/Transforms","./CameraFlightPath","./MapMode2D","./PerspectiveFrustum","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x){"use strict";function A(e){this._scene=e,this._transform=v.clone(v.IDENTITY),this._invTransform=v.clone(v.IDENTITY),this._actualTransform=v.clone(v.IDENTITY),this._actualInvTransform=v.clone(v.IDENTITY),this._transformChanged=!1,this.position=new i,this._position=new i,this._positionWC=new i,this._positionCartographic=new n,this.direction=new i,this._direction=new i,this._directionWC=new i,this.up=new i,this._up=new i,this._upWC=new i,this.right=new i,this._right=new i,this._rightWC=new i,this.frustum=new T,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=_.toRadians(60),this.defaultMoveAmount=1e5,this.defaultLookAmount=Math.PI/60,this.defaultRotateAmount=Math.PI/3600,this.defaultZoomAmount=1e5,this.constrainedAxis=void 0,this.maximumZoomFactor=1.5,this._moveStart=new d,this._moveEnd=new d,this._changed=new d,this._changedPosition=void 0,this._changedDirection=void 0,this._changedFrustum=void 0,this.percentageChanged=.5,this._viewMatrix=new v,this._invViewMatrix=new v,P(this),this._mode=x.SCENE3D,this._modeChanged=!0;var t=e.mapProjection;this._projection=t,this._maxCoord=t.project(new n(Math.PI,_.PI_OVER_TWO)),this._max2Dfrustum=void 0,this._suspendTerrainAdjustment=!1,j(this,A.DEFAULT_VIEW_RECTANGLE,this.position,!0);var r=i.magnitude(this.position);r+=r*A.DEFAULT_VIEW_FACTOR,i.normalize(this.position,this.position),i.multiplyByScalar(this.position,r,this.position)}function P(e){v.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),v.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),v.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function D(e){S.basisTo2D(e._projection,e._transform,e._actualTransform)}function M(e){var t=e._projection,n=t.ellipsoid,o=v.getColumn(e._transform,3,de),a=n.cartesianToCartographic(o,ue),s=t.project(a,ce),l=pe;l.x=s.z,l.y=s.x,l.z=s.y,l.w=1;var u=r.clone(r.UNIT_X,_e),c=r.add(v.getColumn(e._transform,0,he),o,he);n.cartesianToCartographic(c,a),t.project(a,s);var h=me;h.x=s.z,h.y=s.x,h.z=s.y,h.w=0,i.subtract(h,l,h),h.x=0;var d=fe;if(i.magnitudeSquared(h)>_.EPSILON10)i.cross(u,h,d);else{var p=r.add(v.getColumn(e._transform,1,he),o,he);n.cartesianToCartographic(p,a),t.project(a,s),d.x=s.z,d.y=s.x,d.z=s.y,d.w=0,i.subtract(d,l,d),d.x=0,i.magnitudeSquared(d)<_.EPSILON10&&(r.clone(r.UNIT_Y,h),r.clone(r.UNIT_Z,d))}i.cross(d,u,h),i.normalize(h,h),i.cross(u,h,d),i.normalize(d,d),v.setColumn(e._actualTransform,0,h,e._actualTransform),v.setColumn(e._actualTransform,1,d,e._actualTransform),v.setColumn(e._actualTransform,2,u,e._actualTransform),v.setColumn(e._actualTransform,3,l,e._actualTransform)}function I(e){var t=e._mode,r=!1,n=0;t===x.SCENE2D&&(n=e.frustum.right-e.frustum.left,r=n!==e._positionCartographic.height);var o=e._position,a=!i.equals(o,e.position)||r;a&&(o=i.clone(e.position,e._position));var s=e._direction,l=!i.equals(s,e.direction);l&&(i.normalize(e.direction,e.direction),s=i.clone(e.direction,e._direction));var u=e._up,c=!i.equals(u,e.up);c&&(i.normalize(e.up,e.up),u=i.clone(e.up,e._up));var h=e._right,d=!i.equals(h,e.right);d&&(i.normalize(e.right,e.right),h=i.clone(e.right,e._right));var p=e._transformChanged||e._modeChanged;e._transformChanged=!1,p&&(v.inverseTransformation(e._transform,e._invTransform),e._mode===x.COLUMBUS_VIEW||e._mode===x.SCENE2D?v.equals(v.IDENTITY,e._transform)?v.clone(A.TRANSFORM_2D,e._actualTransform):e._mode===x.COLUMBUS_VIEW?D(e):M(e):v.clone(e._transform,e._actualTransform),v.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);var m=e._actualTransform;if(a||p)if(e._positionWC=v.multiplyByPoint(m,o,e._positionWC),t===x.SCENE3D||t===x.MORPHING)e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic);else{var f=ge;f.x=e._positionWC.y,f.y=e._positionWC.z,f.z=e._positionWC.x,t===x.SCENE2D&&(f.z=n),e._projection.unproject(f,e._positionCartographic)}if(l||c||d){var g=i.dot(s,i.cross(u,h,ge));if(Math.abs(1-g)>_.EPSILON2){var y=1/i.magnitudeSquared(u),C=i.dot(u,s)*y,w=i.multiplyByScalar(s,C,ge);u=i.normalize(i.subtract(u,w,e._up),e._up),i.clone(u,e.up),h=i.cross(s,u,e._right),i.clone(h,e.right)}}(l||p)&&(e._directionWC=v.multiplyByPointAsVector(m,s,e._directionWC)),(c||p)&&(e._upWC=v.multiplyByPointAsVector(m,u,e._upWC)),(d||p)&&(e._rightWC=v.multiplyByPointAsVector(m,h,e._rightWC)),(a||l||c||d||p)&&P(e)}function R(e,t){var i;return i=_.equalsEpsilon(Math.abs(e.z),1,_.EPSILON3)?Math.atan2(t.y,t.x)-_.PI_OVER_TWO:Math.atan2(e.y,e.x)-_.PI_OVER_TWO,_.TWO_PI-_.zeroToTwoPi(i)}function O(e){return _.PI_OVER_TWO-_.acosClamped(e.z)}function N(e,t,i){var r=0;return _.equalsEpsilon(Math.abs(e.z),1,_.EPSILON3)||(r=Math.atan2(-i.z,t.z),r=_.zeroToTwoPi(r+_.TWO_PI)),r}function L(e,t,r,n,o){var a=v.clone(e.transform,be),s=S.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,Te);e._setTransform(s),i.clone(i.ZERO,e.position);var l=y.fromHeadingPitchRoll(r-_.PI_OVER_TWO,n,o,xe),u=g.fromQuaternion(l,Ae);g.getColumn(u,0,e.direction),g.getColumn(u,2,e.up),i.cross(e.direction,e.up,e.right),e._setTransform(a)}function B(e,t,r,n,o,a){var s=v.clone(e.transform,be);if(e._setTransform(v.IDENTITY),!i.equals(t,e.positionWC)){if(a){var l=e._projection,u=l.ellipsoid.cartesianToCartographic(t,Pe);t=l.project(u,Ee)}i.clone(t,e.position)}var c=y.fromHeadingPitchRoll(r-_.PI_OVER_TWO,n,o,xe),h=g.fromQuaternion(c,Ae);g.getColumn(h,0,e.direction),g.getColumn(h,2,e.up),i.cross(e.direction,e.up,e.right),e._setTransform(s)}function F(e,r,n,o){var a=-_.PI_OVER_TWO,s=0,l=v.clone(e.transform,be);if(e._setTransform(v.IDENTITY),!i.equals(r,e.positionWC)){if(o){var u=e._projection,c=u.ellipsoid.cartesianToCartographic(r,Pe);r=u.project(c,Ee)}t.clone(r,e.position);var h=.5*-r.z,d=-h,p=e.frustum;if(d>h){var m=p.top/p.right;p.right=d,p.left=h,p.top=p.right*m,p.bottom=-p.top}}if(e._scene.mapMode2D===b.ROTATE){var f=y.fromHeadingPitchRoll(n-_.PI_OVER_TWO,a,s,xe),C=g.fromQuaternion(f,Ae);g.getColumn(C,2,e.up),i.cross(e.direction,e.up,e.right)}e._setTransform(l)}function V(e,t,r,n){var o=i.clone(r.direction,De),a=i.clone(r.up,Me);if(e._scene.mode===x.SCENE3D){var s=e._projection.ellipsoid,l=S.eastNorthUpToFixedFrame(t,s,ve),u=v.inverseTransformation(l,ye);v.multiplyByPointAsVector(u,o,o),v.multiplyByPointAsVector(u,a,a)}var c=i.cross(o,a,Ie);return n.heading=R(o,a),n.pitch=O(o),n.roll=N(o,a,c),n}function k(e,t){var i,r,n=e._scene.mapMode2D===b.ROTATE,o=e._maxCoord.x,a=e._maxCoord.y;n?(r=o,i=-r):(r=t.x-2*o,i=t.x+2*o),t.x>o&&(t.x=r),t.x<-o&&(t.x=i),t.y>a&&(t.y=a),t.y<-a&&(t.y=-a)}function z(e,t){var r=e.position,n=i.normalize(r,ke);if(a(e.constrainedAxis)){var o=i.equalsEpsilon(n,e.constrainedAxis,_.EPSILON2),s=i.equalsEpsilon(n,i.negate(e.constrainedAxis,Ge),_.EPSILON2);if(o||s)(o&&t<0||s&&t>0)&&e.rotate(e.right,t);else{var l=i.normalize(e.constrainedAxis,ze),u=i.dot(n,l),c=_.acosClamped(u);t>0&&t>c&&(t=c-_.EPSILON4),u=i.dot(n,i.negate(l,Ge)),c=_.acosClamped(u),t<0&&-t>c&&(t=-c+_.EPSILON4);var h=i.cross(l,n,Ue);e.rotate(h,t)}}else e.rotate(e.right,t)}function U(e,t){a(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function G(e,t){var i=e.frustum;t=.5*t;var r=i.right-t,n=i.left+t,o=e._maxCoord.x;e._scene.mapMode2D===b.ROTATE&&(o*=e.maximumZoomFactor),r>o&&(r=o,n=-o),r<=n&&(r=1,n=-1);var a=i.top/i.right;i.right=r,i.left=n,i.top=i.right*a,i.bottom=-i.top}function W(e,t){e.move(e.direction,t)}function H(e,t,r){t=_.clamp(t,-_.PI_OVER_TWO,_.PI_OVER_TWO),e=_.zeroToTwoPi(e)-_.PI_OVER_TWO;var n=y.fromAxisAngle(i.UNIT_Y,-t,qe),o=y.fromAxisAngle(i.UNIT_Z,-e,je),a=y.multiply(o,n,o),s=g.fromQuaternion(a,Ye),l=i.clone(i.UNIT_X,He);return g.multiplyByVector(s,l,l),i.negate(l,l),i.multiplyByScalar(l,r,l),l}function q(e,t,r,n){var o=Math.abs(i.dot(t,r));return o/n-i.dot(e,r)}function j(e,t,r,n){var o=e._projection.ellipsoid,s=n?e:ot,l=t.north,u=t.south,c=t.east,d=t.west;d>c&&(c+=_.TWO_PI);var p,m=.5*(d+c);if(u<-_.PI_OVER_TWO+_.RADIANS_PER_DEGREE&&l>_.PI_OVER_TWO-_.RADIANS_PER_DEGREE)p=0;else{var f=Ze;f.longitude=m,f.latitude=l,f.height=0;var g=Ke;g.longitude=m,g.latitude=u,g.height=0;var v=Xe;a(v)&&v.ellipsoid===o||(Xe=v=new h(void 0,void 0,o)),v.setEndPoints(f,g),p=v.interpolateUsingFraction(.5,Ze).latitude}var y=Ze;y.longitude=m,y.latitude=p,y.height=0;var C=o.cartographicToCartesian(y,rt),w=Ze;w.longitude=c,w.latitude=l;var S=o.cartographicToCartesian(w,Qe);w.longitude=d;var E=o.cartographicToCartesian(w,$e);w.longitude=m;var b=o.cartographicToCartesian(w,tt);w.latitude=u;var T=o.cartographicToCartesian(w,it);w.longitude=c;var x=o.cartographicToCartesian(w,et);w.longitude=d;var A=o.cartographicToCartesian(w,Je);i.subtract(E,C,E),i.subtract(x,C,x),i.subtract(S,C,S),i.subtract(A,C,A),i.subtract(b,C,b),i.subtract(T,C,T);var P=o.geodeticSurfaceNormal(C,s.direction);i.negate(P,P);var D=i.cross(P,i.UNIT_Z,s.right);i.normalize(D,D);var M=i.cross(D,P,s.up),I=Math.tan(.5*e.frustum.fovy),R=e.frustum.aspectRatio*I,O=Math.max(q(P,M,E,I),q(P,M,x,I),q(P,M,S,I),q(P,M,A,I),q(P,M,b,I),q(P,M,T,I),q(P,D,E,R),q(P,D,x,R),q(P,D,S,R),q(P,D,A,R),q(P,D,b,R),q(P,D,T,R));if(u<0&&l>0){var N=Ze;N.longitude=d,N.latitude=0,N.height=0;var L=o.cartographicToCartesian(N,nt);i.subtract(L,C,L),O=Math.max(O,q(P,M,L,I),q(P,D,L,R)),N.longitude=c,L=o.cartographicToCartesian(N,nt),i.subtract(L,C,L),O=Math.max(O,q(P,M,L,I),q(P,D,L,R))}return i.add(C,i.multiplyByScalar(P,-O,nt),r)}function Y(e,t,i){var r=e._projection;t.west>t.east&&(t=w.MAX_VALUE);var n=e._actualTransform,o=e._actualInvTransform,a=at;a.longitude=t.east,a.latitude=t.north;var s=r.project(a,st);v.multiplyByPoint(n,s,s),v.multiplyByPoint(o,s,s),a.longitude=t.west,a.latitude=t.south;var l=r.project(a,lt);v.multiplyByPoint(n,l,l),v.multiplyByPoint(o,l,l);var u=Math.tan(.5*e.frustum.fovy),c=e.frustum.aspectRatio*u;return i.x=.5*(s.x-l.x)+l.x,i.y=.5*(s.y-l.y)+l.y,i.z=.5*Math.max((s.x-l.x)/c,(s.y-l.y)/u),i}function X(e,t,i){var r=e._projection;t.west>t.east&&(t=w.MAX_VALUE);var n=ut;n.longitude=t.east,n.latitude=t.north;var o=r.project(n,ct);n.longitude=t.west,n.latitude=t.south;var a,s,l=r.project(n,ht),u=.5*Math.abs(o.x-l.x),c=.5*Math.abs(o.y-l.y),h=e.frustum.right/e.frustum.top,d=c*h;return u>d?(a=u,s=a/h):(s=c,a=d),c=Math.max(2*a,2*s),i.x=.5*(o.x-l.x)+l.x,i.y=.5*(o.y-l.y)+l.y,n=r.unproject(i,n),n.height=c,i=r.project(n,i)}function Z(e,t,i,r){i=o(i,c.WGS84);var n=e.getPickRay(t,dt),a=f.rayEllipsoid(n,i);if(a){var s=a.start>0?a.start:a.stop;return C.getPoint(n,s,r)}}function K(e,t,i,r){var n=e.getPickRay(t,pt),o=n.origin;o.z=0;var a=i.unproject(o);if(!(a.latitude<-_.PI_OVER_TWO||a.latitude>_.PI_OVER_TWO))return i.ellipsoid.cartographicToCartesian(a,r)}function Q(e,t,r,n){var o=e.getPickRay(t,mt),a=-o.origin.x/o.direction.x;C.getPoint(o,a,n);var s=r.unproject(new i(n.y,n.z,0));if(!(s.latitude<-_.PI_OVER_TWO||s.latitude>_.PI_OVER_TWO||s.longitude<-Math.PI||s.longitude>Math.PI))return r.ellipsoid.cartographicToCartesian(s,n)}function J(e,t,r){var n=e._scene.canvas,o=n.clientWidth,a=n.clientHeight,s=Math.tan(.5*e.frustum.fovy),l=e.frustum.aspectRatio*s,u=e.frustum.near,c=2/o*t.x-1,h=2/a*(a-t.y)-1,d=e.positionWC;i.clone(d,r.origin);var p=i.multiplyByScalar(e.directionWC,u,ft);i.add(d,p,p);var m=i.multiplyByScalar(e.rightWC,c*u*l,_t),f=i.multiplyByScalar(e.upWC,h*u*s,gt),_=i.add(p,m,r.direction);return i.add(_,f,_),i.subtract(_,d,_),i.normalize(_,_),r}function $(e,t,r){var n=e._scene.canvas,o=n.clientWidth,a=n.clientHeight,s=2/o*t.x-1;s*=.5*(e.frustum.right-e.frustum.left);var l=2/a*(a-t.y)-1;l*=.5*(e.frustum.top-e.frustum.bottom);var u=r.origin;return i.clone(e.position,u),i.multiplyByScalar(e.right,s,vt),i.add(vt,u,u),i.multiplyByScalar(e.up,l,vt),i.add(vt,u,u),i.clone(e.directionWC,r.direction),r}function ee(e,t,r,n,o,a){function s(r){var n=i.lerp(t,l,r.time,new i);e.worldToCameraCoordinatesPoint(n,e.position)}var l=i.clone(t);return r.y>n?l.y-=r.y-n:r.y<-n&&(l.y+=-n-r.y),r.z>o?l.z-=r.z-o:r.z<-o&&(l.z+=-o-r.z),{easingFunction:u.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:a,update:s}}function te(e,t){var r=e.position,n=e.direction,o=e.worldToCameraCoordinatesVector(i.UNIT_X,St),a=-i.dot(o,r)/i.dot(o,n),s=i.add(r,i.multiplyByScalar(n,a,Et),Et);e.cameraToWorldCoordinatesPoint(s,s),r=e.cameraToWorldCoordinatesPoint(e.position,bt);var l=Math.tan(.5*e.frustum.fovy),u=e.frustum.aspectRatio*l,c=i.magnitude(i.subtract(r,s,Tt)),h=u*c,d=l*c,p=e._maxCoord.x,m=e._maxCoord.y,f=Math.max(h-p,p),_=Math.max(d-m,m);if(r.z<-f||r.z>f||r.y<-_||r.y>_){var g=s.y<-f||s.y>f,v=s.z<-_||s.z>_;if(g||v)return ee(e,r,s,f,_,t)}}function ie(e,t){var i=e.frustum,r=Math.tan(.5*i.fovy),n=i.aspectRatio*r;return Math.max(t/n,t/r)}function re(e,t){var i,r,n=e.frustum,o=n.right/n.top,a=t*o;return t>a?(i=t,r=i/o):(r=t,i=a),1.5*Math.max(i,r)}function ne(e,t,i){a(i)||(i=p.clone(Pt));var r=i.range;if(!a(r)||0===r){var n=t.radius;0===n?i.range=Dt:i.range=e._mode===x.SCENE2D?re(e,n):ie(e,n)}return i}function oe(e,t){var r,n,o=t.radii,a=e.positionWC,s=i.multiplyComponents(t.oneOverRadii,a,Vt),l=i.magnitude(s),u=i.normalize(s,kt);i.equalsEpsilon(u,i.UNIT_Z,_.EPSILON10)?(r=new i(0,1,0),n=new i(0,0,1)):(r=i.normalize(i.cross(i.UNIT_Z,u,zt),zt),n=i.normalize(i.cross(u,r,Ut),Ut));var c=Math.sqrt(i.magnitudeSquared(s)-1),h=i.multiplyByScalar(u,1/l,Vt),d=c/l,p=i.multiplyByScalar(r,d,kt),m=i.multiplyByScalar(n,d,zt),f=i.add(h,m,Gt[0]);i.subtract(f,p,f),i.multiplyComponents(o,f,f);var g=i.subtract(h,m,Gt[1]);i.subtract(g,p,g),i.multiplyComponents(o,g,g);var v=i.subtract(h,m,Gt[2]);i.add(v,p,v),i.multiplyComponents(o,v,v);var y=i.add(h,m,Gt[3]);return i.add(y,p,y),i.multiplyComponents(o,y,y),Gt}function ae(e,t,i,r,n,o){Wt.x=e,Wt.y=t;var s=r.pickEllipsoid(Wt,n,Ht);return a(s)?(qt[i]=n.cartesianToCartographic(s,qt[i]),1):(qt[i]=n.cartesianToCartographic(o[i],qt[i]),0)}A.TRANSFORM_2D=new v(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),A.TRANSFORM_2D_INVERSE=v.inverseTransformation(A.TRANSFORM_2D,new v),A.DEFAULT_VIEW_RECTANGLE=w.fromDegrees(-95,-20,-70,90),A.DEFAULT_VIEW_FACTOR=.5,A.prototype._updateCameraChanged=function(){var e=this;if(0!==e._changed.numberOfListeners){var t=e.percentageChanged;if(e._mode===x.SCENE2D){if(!a(e._changedFrustum))return e._changedPosition=i.clone(e.position,e._changedPosition),void(e._changedFrustum=e.frustum.clone());var r,n=e.position,o=e._changedPosition,s=e.frustum,l=e._changedFrustum,u=n.x+s.left,c=n.x+s.right,h=o.x+l.left,d=o.x+l.right,p=n.y+s.bottom,m=n.y+s.top,f=o.y+l.bottom,g=o.y+l.top,v=Math.max(u,h),y=Math.min(c,d),C=Math.max(p,f),w=Math.min(m,g);if(v>=y||C>=m)r=1;else{var S=l;ud&&pg&&(S=s),r=1-(y-v)*(w-C)/((S.right-S.left)*(S.top-S.bottom))}return void(r>t&&(e._changed.raiseEvent(r),e._changedPosition=i.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone(e._changedFrustum)))}if(!a(e._changedDirection))return e._changedPosition=i.clone(e.positionWC,e._changedPosition),void(e._changedDirection=i.clone(e.directionWC,e._changedDirection));var E=_.acosClamped(i.dot(e.directionWC,e._changedDirection)),b=E/(.5*e.frustum.fovy),T=i.distance(e.positionWC,e._changedPosition),A=T/e.positionCartographic.height;(b>t||A>t)&&(e._changed.raiseEvent(Math.max(b,A)),e._changedPosition=i.clone(e.positionWC,e._changedPosition),e._changedDirection=i.clone(e.directionWC,e._changedDirection))}};var se=new v,le=new n;A.prototype._adjustHeightForTerrain=function(){var e=this._scene,t=e.screenSpaceCameraController,r=t.enableCollisionDetection,n=t.minimumCollisionTerrainHeight,o=t.minimumZoomDistance;if(!this._suspendTerrainAdjustment&&r){var s=this._mode,l=e.globe;if(a(l)&&s!==x.SCENE2D&&s!==x.MORPHING){var u,c,h=l.ellipsoid,d=e.mapProjection;v.equals(this.transform,v.IDENTITY)||(u=v.clone(this.transform,se),c=i.magnitude(this.position),this._setTransform(v.IDENTITY));var p=le;s===x.SCENE3D?h.cartesianToCartographic(this.position,p):d.unproject(this.position,p);var m=!1;if(p.height_.PI?_.TWO_PI-C:C,g=y}return _.equalsEpsilon(Math.abs(f),_.TWO_PI,_.EPSILON9)&&(r.west=-_.PI,r.east=_.PI,qt[0].latitude>=0?r.north=_.PI_OVER_TWO:r.south=-_.PI_OVER_TWO),r}},A.clone=function(e,t){return a(t)||(t=new A(e._scene)),i.clone(e.position,t.position),i.clone(e.direction,t.direction),i.clone(e.up,t.up),i.clone(e.right,t.right),v.clone(e._transform,t.transform),t._transformChanged=!0,t},A}),i("Scene/CameraEventType",["../Core/freezeObject"],function(e){"use strict";var t={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4};return e(t)}),i("Scene/CameraEventAggregator",["../Core/Cartesian2","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/KeyboardEventModifier","../Core/Math","../Core/ScreenSpaceEventHandler","../Core/ScreenSpaceEventType","./CameraEventType"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e,i){var r=e;return t(i)&&(r+="+"+i),r}function h(t,i){e.clone(t.distance.startPosition,i.distance.startPosition),e.clone(t.distance.endPosition,i.distance.endPosition),e.clone(t.angleAndHeight.startPosition,i.angleAndHeight.startPosition),e.clone(t.angleAndHeight.endPosition,i.angleAndHeight.endPosition)}function d(i,r,n){var o=c(u.PINCH,r),a=i._update,s=i._isDown,d=i._eventStartPosition,p=i._pressTime,m=i._releaseTime;a[o]=!0,s[o]=!1,d[o]=new e;var f=i._movement[o];t(f)||(f=i._movement[o]={}),f.distance={startPosition:new e,endPosition:new e},f.angleAndHeight={startPosition:new e,endPosition:new e},f.prevAngle=0,i._eventHandler.setInputAction(function(t){i._buttonsDown++,s[o]=!0,p[o]=new Date,e.lerp(t.position1,t.position2,.5,d[o])},l.PINCH_START,r),i._eventHandler.setInputAction(function(){i._buttonsDown=Math.max(i._buttonsDown-1,0),s[o]=!1,m[o]=new Date},l.PINCH_END,r),i._eventHandler.setInputAction(function(t){if(s[o]){a[o]?(h(t,f),a[o]=!1,f.prevAngle=f.angleAndHeight.startPosition.x):(e.clone(t.distance.endPosition,f.distance.endPosition),e.clone(t.angleAndHeight.endPosition,f.angleAndHeight.endPosition));for(var i=f.angleAndHeight.endPosition.x,r=f.prevAngle,l=2*Math.PI;i>=r+Math.PI;)i-=l;for(;i0||e}}}),g.prototype.isMoving=function(e,t){var i=c(e,t);return!this._update[i]},g.prototype.getMovement=function(e,t){var i=c(e,t),r=this._movement[i];return r},g.prototype.getLastMovement=function(e,t){var i=c(e,t),r=this._lastMovement[i];if(r.valid)return r},g.prototype.isButtonDown=function(e,t){var i=c(e,t);return this._isDown[i]},g.prototype.getStartMousePosition=function(e,t){if(e===u.WHEEL)return this._currentMousePosition;var i=c(e,t);return this._eventStartPosition[i]},g.prototype.getButtonPressTime=function(e,t){var i=c(e,t);return this._pressTime[i]},g.prototype.getButtonReleaseTime=function(e,t){var i=c(e,t);return this._releaseTime[i]},g.prototype.reset=function(){for(var e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)},g.prototype.isDestroyed=function(){return!1},g.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),r(this)},g}),i("Scene/UrlTemplateImageryProvider",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/combine","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/GeographicTilingScheme","../Core/isArray","../Core/loadJson","../Core/loadText","../Core/loadWithXhr","../Core/loadXML","../Core/Math","../Core/Rectangle","../Core/WebMercatorTilingScheme","../ThirdParty/when","./ImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C){"use strict";function w(e){this._errorEvent=new u,this._url=void 0,this._urlSchemeZeroPadding=void 0,this._pickFeaturesUrl=void 0,this._proxy=void 0,this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._minimumLevel=void 0,this._tilingScheme=void 0,this._rectangle=void 0,this._tileDiscardPolicy=void 0,this._credit=void 0,this._hasAlphaChannel=void 0,this._readyPromise=void 0,this.enablePickFeatures=!0,this.reinitialize(e)}function S(e,t,i,r){return re=!1,oe=!1,b(e,e._urlParts,function(n){return n(e,t,i,r)})}function E(e,t,i,r,n,o,a){return re=!1,oe=!1,se=!1,ce=!1,b(e,e._pickFeaturesUrlParts,function(s){return s(e,t,i,r,n,o,a)})}function b(e,t,i){for(var r="",n=0;n=0&&u1&&(i=i.length>=n?i:new Array(n-i.toString().length+1).join("0")+i)}}return i}function A(e,t,i,r){return x(e,"{x}",t)}function P(e,t,i,r){var n=e.tilingScheme.getNumberOfXTilesAtLevel(r)-t-1;return x(e,"{reverseX}",n)}function D(e,t,i,r){return x(e,"{y}",i)}function M(e,t,i,r){var n=e.tilingScheme.getNumberOfYTilesAtLevel(r)-i-1;return x(e,"{reverseY}",n)}function I(e,t,i,r){var n=e.maximumLevel,o=a(n)&&r0?t._subdomains=t._subdomains.split(""):t._subdomains=["a","b","c"],t._tileWidth=o(e.tileWidth,256),t._tileHeight=o(e.tileHeight,256),t._minimumLevel=o(e.minimumLevel,0),t._maximumLevel=e.maximumLevel,t._tilingScheme=o(e.tilingScheme,new v({ellipsoid:e.ellipsoid})),t._rectangle=o(e.rectangle,t._tilingScheme.rectangle),t._rectangle=g.intersection(t._rectangle,t._tilingScheme.rectangle),t._hasAlphaChannel=o(e.hasAlphaChannel,!0);var i=e.credit;return"string"==typeof i&&(i=new n(i)),t._credit=i,t._urlParts=T(t._url,pe),t._pickFeaturesUrlParts=T(t._pickFeaturesUrl,me),!0})},w.prototype.getTileCredits=function(e,t,i){},w.prototype.requestImage=function(e,t,i){var r=S(this,e,t,i);return C.loadImage(this,r)},w.prototype.pickFeatures=function(e,t,i,r,n){function o(e,t){return e.callback(t)}function s(){if(l>=u._getFeatureInfoFormats.length)return y([]);var a=u._getFeatureInfoFormats[l],c=E(u,e,t,i,r,n,a.format);return++l,"json"===a.type?d(c).then(a.callback).otherwise(s):"xml"===a.type?f(c).then(a.callback).otherwise(s):"text"===a.type||"html"===a.type?p(c).then(a.callback).otherwise(s):m({url:c,responseType:a.format}).then(o.bind(void 0,a)).otherwise(s)}if(this.enablePickFeatures&&a(this._pickFeaturesUrl)&&0!==this._getFeatureInfoFormats.length){var l=0,u=this;return s()}};var re=!1,ne=new g,oe=!1,ae=new g,se=!1,le=new e,ue=new g,ce=!1,he=new t,de=new i,pe={"{x}":A,"{y}":D,"{z}":R,"{s}":O,"{reverseX}":P,"{reverseY}":M,"{reverseZ}":I,"{westDegrees}":L,"{southDegrees}":B,"{eastDegrees}":F,"{northDegrees}":V,"{westProjected}":z,"{southProjected}":U,"{eastProjected}":G,"{northProjected}":W,"{width}":H,"{height}":q},me=r(pe,{"{i}":j,"{j}":Y,"{reverseI}":X,"{reverseJ}":Z,"{longitudeDegrees}":Q,"{latitudeDegrees}":J,"{longitudeProjected}":$,"{latitudeProjected}":ee,"{format}":ie});return w}),i("Scene/createOpenStreetMapImageryProvider",["../Core/Credit","../Core/defaultValue","../Core/DeveloperError","../Core/Rectangle","../Core/WebMercatorTilingScheme","./UrlTemplateImageryProvider"],function(e,t,i,r,n,o){"use strict";function a(i){i=t(i,{});var a=t(i.url,"https://a.tile.openstreetmap.org/");s.test(a)||(a+="/");var u=t(i.fileExtension,"png"),c=new n({ellipsoid:i.ellipsoid}),h=256,d=256,p=t(i.minimumLevel,0),m=i.maximumLevel,f=t(i.rectangle,c.rectangle),_=c.positionToTileXY(r.southwest(f),p),g=c.positionToTileXY(r.northeast(f),p),v=((Math.abs(g.x-_.x)+1)*(Math.abs(g.y-_.y)+1),t(i.credit,l));"string"==typeof v&&(v=new e(v));var y=a+"{z}/{x}/{y}."+u;return new o({url:y,proxy:i.proxy,credit:v,tilingScheme:c,tileWidth:h,tileHeight:d,minimumLevel:p,maximumLevel:m,rectangle:f})}var s=/\/$/,l=new e("MapQuest, Open Street Map and contributors, CC-BY-SA");return a}),i("Scene/createTangentSpaceDebugPrimitive",["../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/GeometryInstance","../Core/GeometryPipeline","../Core/Matrix4","./PerInstanceColorAppearance","./Primitive"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(r){r=t(r,t.EMPTY_OBJECT);var u=[],c=r.geometry;i(c.attributes)&&i(c.primitiveType)||(c=c.constructor.createGeometry(c));var h=c.attributes,d=a.clone(t(r.modelMatrix,a.IDENTITY)),p=t(r.length,1e4);if(i(h.normal)&&u.push(new n({geometry:o.createLineSegmentsForVectors(c,"normal",p),attributes:{color:new e(1,0,0,1)},modelMatrix:d})),i(h.binormal)&&u.push(new n({geometry:o.createLineSegmentsForVectors(c,"binormal",p),attributes:{color:new e(0,1,0,1)},modelMatrix:d})),i(h.tangent)&&u.push(new n({geometry:o.createLineSegmentsForVectors(c,"tangent",p),attributes:{color:new e(0,0,1,1)},modelMatrix:d})),u.length>0)return new l({asynchronous:!1,geometryInstances:u,appearance:new s({flat:!0,translucent:!1})})}return u}),i("Scene/createTileMapServiceImageryProvider",["../Core/Cartesian2","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/GeographicTilingScheme","../Core/joinUrls","../Core/loadXML","../Core/Rectangle","../Core/RuntimeError","../Core/TileProviderError","../Core/WebMercatorTilingScheme","../ThirdParty/when","./UrlTemplateImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p){"use strict";function m(n){function m(s){for(var d,p,m,f,w=/tileformat/i,S=/tileset/i,E=/tilesets/i,b=/boundingbox/i,T=/srs/i,x=[],A=s.childNodes[0].childNodes,P=0;PF.rectangle.east&&(k.east=F.rectangle.east),k.southF.rectangle.north&&(k.north=F.rectangle.north);var Y=F.positionToTileXY(l.southwest(k),N),X=F.positionToTileXY(l.northeast(k),N),Z=(Math.abs(X.x-Y.x)+1)*(Math.abs(X.y-Y.y)+1);Z>4&&(N=0);var K=a(v,"{z}/{x}/{reverseY}."+I);y.resolve({url:K,tilingScheme:F,rectangle:k,tileWidth:R,tileHeight:O,minimumLevel:N,maximumLevel:L,proxy:n.proxy,tileDiscardPolicy:n.tileDiscardPolicy,credit:n.credit})}function f(e){var t=i(n.fileExtension,"png"),o=i(n.tileWidth,256),s=i(n.tileHeight,256),l=i(n.minimumLevel,0),u=n.maximumLevel,c=r(n.tilingScheme)?n.tilingScheme:new h({ellipsoid:n.ellipsoid}),d=i(n.rectangle,c.rectangle),p=a(v,"{z}/{x}/{reverseY}."+t);y.resolve({url:p,tilingScheme:c,rectangle:d,tileWidth:o,tileHeight:s,minimumLevel:l,maximumLevel:u,proxy:n.proxy,tileDiscardPolicy:n.tileDiscardPolicy,credit:n.credit})}function _(){var e=a(v,"tilemapresource.xml"),t=n.proxy;r(t)&&(e=t.getURL(e)),s(e).then(m).otherwise(f)}n=i(n,{});var g,v=n.url,y=d.defer(),C=new p(y.promise);return _(),C}return m}),i("Scene/CreditDisplay",["../Core/Credit","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError"],function(e,t,i,r,n){"use strict";function o(e,t,r){if(!i(e.element)){var n=e.text,o=e.link,a=document.createElement("span");if(e.hasLink()){var s=document.createElement("a");s.textContent=n,s.href=o,s.target="_blank",a.appendChild(s)}else a.textContent=n;a.className="cesium-credit-text",e.element=a}if(t.hasChildNodes()){var l=document.createElement("span");l.textContent=r,l.className="cesium-credit-delimiter",t.appendChild(l)}t.appendChild(e.element)}function a(e,t){if(!i(e.element)){var r=e.text,n=e.link,o=document.createElement("span"),a=document.createElement("img");if(a.src=e.imageUrl,a.style["vertical-align"]="bottom",i(r)&&(a.alt=r,a.title=r),e.hasLink()){var s=document.createElement("a");s.appendChild(a),s.href=n,s.target="_blank",o.appendChild(s)}else o.appendChild(a);o.className="cesium-credit-image",e.element=o}t.appendChild(e.element)}function s(t,i){for(var r=t.length,n=0;n= 0.0) {\nt1 = (-b - sqrt(discriminant)) * 0.5;\nt2 = (-b + sqrt(discriminant)) * 0.5;\n}\nif (t1 < 0.0 && t2 < 0.0) {\ndiscard;\n}\nfloat t = min(t1, t2);\nif (t < 0.0) {\nt = 0.0;\n}\nczm_ellipsoid ellipsoid = czm_ellipsoidNew(ellipsoidCenter, u_radii);\nczm_ray ray = czm_ray(t * direction, direction);\nczm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid);\nif (czm_isEmpty(intersection))\n{\ndiscard;\n}\nvec4 outsideFaceColor = (intersection.start != 0.0) ? computeEllipsoidColor(ray, intersection.start, 1.0) : vec4(0.0);\nvec4 insideFaceColor = (outsideFaceColor.a < 1.0) ? computeEllipsoidColor(ray, intersection.stop, -1.0) : vec4(0.0);\ngl_FragColor = mix(insideFaceColor, outsideFaceColor, outsideFaceColor.a);\ngl_FragColor.a = 1.0 - (1.0 - insideFaceColor.a) * (1.0 - outsideFaceColor.a);\n#ifdef WRITE_DEPTH\n#ifdef GL_EXT_frag_depth\nt = (intersection.start != 0.0) ? intersection.start : intersection.stop;\nvec3 positionEC = czm_pointAlongRay(ray, t);\nvec4 positionCC = czm_projection * vec4(positionEC, 1.0);\nfloat z = positionCC.z / positionCC.w;\nfloat n = czm_depthRange.near;\nfloat f = czm_depthRange.far;\ngl_FragDepthEXT = (z * (f - n) + f + n) * 0.5;\n#endif\n#endif\n}\n"}),i("Shaders/EllipsoidVS",[],function(){"use strict";return"attribute vec3 position;\nuniform vec3 u_radii;\nvarying vec3 v_positionEC;\nvoid main()\n{\nvec4 p = vec4(u_radii * position, 1.0);\nv_positionEC = (czm_modelView * p).xyz;\ngl_Position = czm_modelViewProjection * p;\ngl_Position.z = clamp(gl_Position.z, czm_depthRange.near, czm_depthRange.far);\n}\n"}),i("Scene/EllipsoidPrimitive",["../Core/BoundingSphere","../Core/BoxGeometry","../Core/Cartesian3","../Core/combine","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Matrix4","../Core/VertexFormat","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArray","../Shaders/EllipsoidFS","../Shaders/EllipsoidVS","./BlendingState","./CullFace","./Material","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S){"use strict";function E(t){t=n(t,n.EMPTY_OBJECT),this.center=i.clone(n(t.center,i.ZERO)),this._center=new i,this.radii=i.clone(t.radii),this._radii=new i,this._oneOverEllipsoidRadiiSquared=new i,this._boundingSphere=new e,this.modelMatrix=l.clone(n(t.modelMatrix,l.IDENTITY)),this._modelMatrix=new l,this._computedModelMatrix=new l,this.show=n(t.show,!0),this.material=n(t.material,w.fromType(w.ColorType)),this._material=void 0,this._translucent=void 0,this.id=t.id,this._id=void 0,this.debugShowBoundingVolume=n(t.debugShowBoundingVolume,!1),this.onlySunLighting=n(t.onlySunLighting,!1),this._onlySunLighting=!1,this._depthTestEnabled=n(t.depthTestEnabled,!0),this._sp=void 0,this._rs=void 0,this._va=void 0,this._pickSP=void 0,this._pickId=void 0,this._colorCommand=new h({owner:n(t._owner,this)}),this._pickCommand=new h({owner:n(t._owner,this)});var r=this;this._uniforms={u_radii:function(){return r.radii},u_oneOverEllipsoidRadiiSquared:function(){return r._oneOverEllipsoidRadiiSquared}},this._pickUniforms={czm_pickColor:function(){return r._pickId.color}}}function b(e){var r=e.cache.ellipsoidPrimitive_vertexArray;if(o(r))return r;var n=t.createGeometry(t.fromDimensions({dimensions:new i(2,2,2),vertexFormat:u.POSITION_ONLY}));return r=_.fromGeometry({context:e,geometry:n,attributeLocations:T,bufferUsage:c.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=r,r}var T={position:0};return E.prototype.update=function(t){if(this.show&&t.mode===S.SCENE3D&&o(this.center)&&o(this.radii)){var n=t.context,a=this.material.isTranslucent(),s=this._translucent!==a;o(this._rs)&&!s||(this._translucent=a,this._rs=p.fromCache({cull:{enabled:!0,face:C.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!a&&n.fragmentDepth,blending:a?y.ALPHA_BLEND:void 0})),o(this._va)||(this._va=b(n));var u=!1,c=this.radii;if(!i.equals(this._radii,c)){i.clone(c,this._radii);var h=this._oneOverEllipsoidRadiiSquared;h.x=1/(c.x*c.x),h.y=1/(c.y*c.y),h.z=1/(c.z*c.z),u=!0}l.equals(this.modelMatrix,this._modelMatrix)&&i.equals(this.center,this._center)||(l.clone(this.modelMatrix,this._modelMatrix),i.clone(this.center,this._center),l.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),u=!0),u&&(i.clone(i.ZERO,this._boundingSphere.center),this._boundingSphere.radius=i.maximumComponent(c),e.transform(this._boundingSphere,this._computedModelMatrix,this._boundingSphere));var _=this._material!==this.material;this._material=this.material,this._material.update(n);var w=this.onlySunLighting!==this._onlySunLighting;this._onlySunLighting=this.onlySunLighting;var E,x=this._colorCommand;(_||w||s)&&(E=new f({sources:[this.material.shaderSource,g]}),this.onlySunLighting&&E.defines.push("ONLY_SUN_LIGHTING"),!a&&n.fragmentDepth&&E.defines.push("WRITE_DEPTH"),this._sp=m.replaceCache({context:n,shaderProgram:this._sp,vertexShaderSource:v,fragmentShaderSource:E,attributeLocations:T}),x.vertexArray=this._va,x.renderState=this._rs,x.shaderProgram=this._sp,x.uniformMap=r(this._uniforms,this.material._uniforms),x.executeInClosestFrustum=a);var A=t.commandList,P=t.passes;if(P.render&&(x.boundingVolume=this._boundingSphere,x.debugShowBoundingVolume=this.debugShowBoundingVolume,x.modelMatrix=this._computedModelMatrix,x.pass=a?d.TRANSLUCENT:d.OPAQUE,A.push(x)),P.pick){var D=this._pickCommand;o(this._pickId)&&this._id===this.id||(this._id=this.id,this._pickId=this._pickId&&this._pickId.destroy(),this._pickId=n.createPickId({primitive:this,id:this.id})),(_||w||!o(this._pickSP))&&(E=new f({sources:[this.material.shaderSource,g],pickColorQualifier:"uniform"}),this.onlySunLighting&&E.defines.push("ONLY_SUN_LIGHTING"),!a&&n.fragmentDepth&&E.defines.push("WRITE_DEPTH"),this._pickSP=m.replaceCache({context:n,shaderProgram:this._pickSP,vertexShaderSource:v,fragmentShaderSource:E,attributeLocations:T}),D.vertexArray=this._va,D.renderState=this._rs,D.shaderProgram=this._pickSP,D.uniformMap=r(r(this._uniforms,this._pickUniforms),this.material._uniforms),D.executeInClosestFrustum=a),D.boundingVolume=this._boundingSphere,D.modelMatrix=this._computedModelMatrix,D.pass=a?d.TRANSLUCENT:d.OPAQUE,A.push(D)}}},E.prototype.isDestroyed=function(){return!1},E.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._pickSP=this._pickSP&&this._pickSP.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),a(this)},E}),i("Shaders/Appearances/EllipsoidSurfaceAppearanceFS",[],function(){"use strict";return"varying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec2 v_st;\nvoid main()\n{\nczm_materialInput materialInput;\nvec3 normalEC = normalize(czm_normal3D * czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)));\n#ifdef FACE_FORWARD\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\nmaterialInput.s = v_st.s;\nmaterialInput.st = v_st;\nmaterialInput.str = vec3(v_st, 0.0);\nmaterialInput.normalEC = normalEC;\nmaterialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, materialInput.normalEC);\nvec3 positionToEyeEC = -v_positionEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\n#endif\n}\n"}),i("Shaders/Appearances/EllipsoidSurfaceAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec2 st;\nattribute float batchId;\nvarying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionMC = position3DHigh + position3DLow;\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_st = st;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),i("Scene/EllipsoidSurfaceAppearance",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/VertexFormat","../Shaders/Appearances/EllipsoidSurfaceAppearanceFS","../Shaders/Appearances/EllipsoidSurfaceAppearanceVS","./Appearance","./Material"],function(e,t,i,r,n,o,a,s){"use strict";function l(i){i=e(i,e.EMPTY_OBJECT);var r=e(i.translucent,!0),l=e(i.aboveGround,!1);this.material=t(i.material)?i.material:s.fromType(s.ColorType),this.translucent=e(i.translucent,!0),this._vertexShaderSource=e(i.vertexShaderSource,o),this._fragmentShaderSource=e(i.fragmentShaderSource,n),this._renderState=a.getDefaultRenderState(r,!l,i.renderState),this._closed=!1,this._flat=e(i.flat,!1),this._faceForward=e(i.faceForward,l),this._aboveGround=l}return i(l.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return l.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}}),l.VERTEX_FORMAT=r.POSITION_AND_ST,l.prototype.getFragmentShaderSource=a.prototype.getFragmentShaderSource,l.prototype.isTranslucent=a.prototype.isTranslucent,l.prototype.getRenderState=a.prototype.getRenderState,l}),i("Scene/Fog",["../Core/Cartesian3","../Core/defined","../Core/Math","./SceneMode"],function(e,t,i,r){"use strict";function n(){this.enabled=!0,this.density=2e-4,this.screenSpaceErrorFactor=2}function o(e){var t=a,i=t.length;if(et[i-1])return d=i-2;if(e>=t[d]){if(d+1=0&&e>=t[d-1])return--d,d;var r;for(r=0;r=t[r]&&e8e5||n.mode!==r.SCENE3D)return void(n.fog.enabled=!1);var m=d.height,f=o(m),_=i.clamp((m-a[f])/(a[f+1]-a[f]),0,1),g=i.lerp(s[f],s[f+1],_),v=1e6*this.density,y=v/u*c;g=g*(v-y)*1e-6;var C=e.normalize(h.positionWC,p),w=i.clamp(e.dot(h.directionWC,C),0,1);g*=1-w,n.fog.density=g,n.fog.sse=this.screenSpaceErrorFactor}},n}),i("Scene/FrameRateMonitor",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/getTimestamp","../Core/TimeConstants"],function(e,t,i,r,n,o,a,s){"use strict";function l(i){function r(){c(n)}this._scene=i.scene,this.samplingWindow=e(i.samplingWindow,l.defaultSettings.samplingWindow),this.quietPeriod=e(i.quietPeriod,l.defaultSettings.quietPeriod),this.warmupPeriod=e(i.warmupPeriod,l.defaultSettings.warmupPeriod),this.minimumFrameRateDuringWarmup=e(i.minimumFrameRateDuringWarmup,l.defaultSettings.minimumFrameRateDuringWarmup),this.minimumFrameRateAfterWarmup=e(i.minimumFrameRateAfterWarmup,l.defaultSettings.minimumFrameRateAfterWarmup),this._lowFrameRate=new o,this._nominalFrameRate=new o,this._frameTimes=[],this._needsQuietPeriod=!0,this._quietPeriodEndTime=0,this._warmupPeriodEndTime=0,this._frameRateIsLow=!1,this._lastFramesPerSecond=void 0,this._pauseCount=0;var n=this;this._preRenderRemoveListener=this._scene.preRender.addEventListener(function(e,t){u(n,t)}),this._hiddenPropertyName=void 0!==document.hidden?"hidden":void 0!==document.mozHidden?"mozHidden":void 0!==document.msHidden?"msHidden":void 0!==document.webkitHidden?"webkitHidden":void 0;var a=void 0!==document.hidden?"visibilitychange":void 0!==document.mozHidden?"mozvisibilitychange":void 0!==document.msHidden?"msvisibilitychange":void 0!==document.webkitHidden?"webkitvisibilitychange":void 0;this._visibilityChangeRemoveListener=void 0,t(a)&&(document.addEventListener(a,r,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(a,r,!1)})}function u(e,t){if(!(e._pauseCount>0)){var i=a();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=i+e.quietPeriod/s.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/s.SECONDS_PER_MILLISECOND;else if(i>=e._quietPeriodEndTime){e._frameTimes.push(i);var r=i-e.samplingWindow/s.SECONDS_PER_MILLISECOND;if(e._frameTimes.length>=2&&e._frameTimes[0]<=r){for(;e._frameTimes.length>=2&&e._frameTimes[1]e._warmupPeriodEndTime?e.minimumFrameRateAfterWarmup:e.minimumFrameRateDuringWarmup);n>o?e._frameRateIsLow||(e._frameRateIsLow=!0,e._needsQuietPeriod=!0,e.lowFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond)):e._frameRateIsLow&&(e._frameRateIsLow=!1,e._needsQuietPeriod=!0,e.nominalFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond))}}}}function c(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}return l.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8},l.fromScene=function(e){return t(e._frameRateMonitor)&&!e._frameRateMonitor.isDestroyed()||(e._frameRateMonitor=new l({scene:e})),e._frameRateMonitor},i(l.prototype,{scene:{get:function(){return this._scene}},lowFrameRate:{get:function(){return this._lowFrameRate}},nominalFrameRate:{get:function(){return this._nominalFrameRate}},lastFramesPerSecond:{get:function(){return this._lastFramesPerSecond}}}),l.prototype.pause=function(){++this._pauseCount,1===this._pauseCount&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)},l.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)},l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return this._preRenderRemoveListener(),t(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),r(this)},l}),i("Scene/FrameState",["./SceneMode"],function(e){"use strict";function t(t,i){this.context=t,this.commandList=[],this.shadowMaps=[],this.mode=e.SCENE3D,this.morphTime=e.getMorphTime(e.SCENE3D),this.frameNumber=0,this.time=void 0,this.mapProjection=void 0,this.camera=void 0,this.cullingVolume=void 0,this.occluder=void 0,this.passes={render:!1,pick:!1},this.creditDisplay=i,this.afterRender=[],this.scene3DOnly=!1,this.fog={enabled:!1,density:void 0,sse:void 0},this.terrainExaggeration=1,this.shadowHints={shadowsEnabled:!0,shadowMaps:[],lightShadowMaps:[],nearPlane:1,farPlane:5e3,closestObjectSize:1e3,lastDirtyTime:0,outOfView:!0}}return t}),i("Scene/FrustumCommands",["../Core/defaultValue","../Renderer/Pass"],function(e,t){"use strict";function i(i,r){this.near=e(i,0),this.far=e(r,0);for(var n=t.NUMBER_OF_PASSES,o=new Array(n),a=new Array(n),s=0;s= edgeVert;\nfloat lengthSign = horzSpan ? -rcpFrame.y : -rcpFrame.x;\nif(!horzSpan)\n{\nlumaN = lumaW;\nlumaS = lumaE;\n}\nfloat gradientN = abs(lumaN - lumaM);\nfloat gradientS = abs(lumaS - lumaM);\nlumaN = (lumaN + lumaM) * 0.5;\nlumaS = (lumaS + lumaM) * 0.5;\nif (gradientN < gradientS)\n{\nlumaN = lumaS;\nlumaN = lumaS;\ngradientN = gradientS;\nlengthSign *= -1.0;\n}\nvec2 posN;\nposN.x = pos.x + (horzSpan ? 0.0 : lengthSign * 0.5);\nposN.y = pos.y + (horzSpan ? lengthSign * 0.5 : 0.0);\ngradientN *= FXAA_SEARCH_THRESHOLD;\nvec2 posP = posN;\nvec2 offNP = horzSpan ? vec2(rcpFrame.x, 0.0) : vec2(0.0, rcpFrame.y);\nfloat lumaEndN = lumaN;\nfloat lumaEndP = lumaN;\nbool doneN = false;\nbool doneP = false;\nposN += offNP * vec2(-1.0, -1.0);\nposP += offNP * vec2( 1.0, 1.0);\nfor(int i = 0; i < FXAA_SEARCH_STEPS; i++) {\nif(!doneN)\n{\nlumaEndN = FxaaLuma(texture2D(tex, posN.xy).xyz);\n}\nif(!doneP)\n{\nlumaEndP = FxaaLuma(texture2D(tex, posP.xy).xyz);\n}\ndoneN = doneN || (abs(lumaEndN - lumaN) >= gradientN);\ndoneP = doneP || (abs(lumaEndP - lumaN) >= gradientN);\nif(doneN && doneP)\n{\nbreak;\n}\nif(!doneN)\n{\nposN -= offNP;\n}\nif(!doneP)\n{\nposP += offNP;\n}\n}\nfloat dstN = horzSpan ? pos.x - posN.x : pos.y - posN.y;\nfloat dstP = horzSpan ? posP.x - pos.x : posP.y - pos.y;\nbool directionN = dstN < dstP;\nlumaEndN = directionN ? lumaEndN : lumaEndP;\nif(((lumaM - lumaN) < 0.0) == ((lumaEndN - lumaN) < 0.0))\n{\nlengthSign = 0.0;\n}\nfloat spanLength = (dstP + dstN);\ndstN = directionN ? dstN : dstP;\nfloat subPixelOffset = (0.5 + (dstN * (-1.0/spanLength))) * lengthSign;\nvec3 rgbF = texture2D(tex, vec2(\npos.x + (horzSpan ? 0.0 : subPixelOffset),\npos.y + (horzSpan ? subPixelOffset : 0.0))).xyz;\nreturn FxaaLerp3(rgbL, rgbF, blendL);\n}\nuniform sampler2D u_texture;\nuniform vec2 u_step;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = vec4(FxaaPixelShader(v_textureCoordinates, u_texture, u_step), 1.0);\n}\n"; -}),i("Scene/FXAA",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Color","../Core/defined","../Core/destroyObject","../Core/PixelFormat","../Renderer/ClearCommand","../Renderer/Framebuffer","../Renderer/PixelDatatype","../Renderer/Renderbuffer","../Renderer/RenderbufferFormat","../Renderer/RenderState","../Renderer/Texture","../Shaders/PostProcessFilters/FXAA"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p){"use strict";function m(t){this._texture=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._fbo=void 0,this._command=void 0,this._viewport=new e,this._rs=void 0;var r=new a({color:new i(0,0,0,0),depth:1,owner:this});this._clearCommand=r}function f(e){e._fbo=e._fbo&&e._fbo.destroy(),e._texture=e._texture&&e._texture.destroy(),e._depthStencilTexture=e._depthStencilTexture&&e._depthStencilTexture.destroy(),e._depthStencilRenderbuffer=e._depthStencilRenderbuffer&&e._depthStencilRenderbuffer.destroy(),e._fbo=void 0,e._texture=void 0,e._depthStencilTexture=void 0,e._depthStencilRenderbuffer=void 0,r(e._command)&&(e._command.shaderProgram=e._command.shaderProgram&&e._command.shaderProgram.destroy(),e._command=void 0)}return m.prototype.update=function(i){var n=i.drawingBufferWidth,a=i.drawingBufferHeight,m=this._texture,f=!r(m)||m.width!==n||m.height!==a;if(f&&(this._texture=this._texture&&this._texture.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),this._texture=new d({context:i,width:n,height:a,pixelFormat:o.RGBA,pixelDatatype:l.UNSIGNED_BYTE}),i.depthTexture?this._depthStencilTexture=new d({context:i,width:n,height:a,pixelFormat:o.DEPTH_STENCIL,pixelDatatype:l.UNSIGNED_INT_24_8}):this._depthStencilRenderbuffer=new u({context:i,width:n,height:a,format:c.DEPTH_STENCIL})),r(this._fbo)&&!f||(this._fbo=this._fbo&&this._fbo.destroy(),this._fbo=new s({context:i,colorTextures:[this._texture],depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1})),r(this._command)||(this._command=i.createViewportQuadCommand(p,{owner:this})),this._viewport.width=n,this._viewport.height=a,r(this._rs)&&e.equals(this._rs.viewport,this._viewport)||(this._rs=h.fromCache({viewport:this._viewport})),this._command.renderState=this._rs,f){var _=this,g=new t(1/this._texture.width,1/this._texture.height);this._command.uniformMap={u_texture:function(){return _._texture},u_step:function(){return g}}}},m.prototype.execute=function(e,t){this._command.execute(e,t)},m.prototype.clear=function(e,t,r){var n=t.framebuffer;t.framebuffer=this._fbo,i.clone(r,this._clearCommand.color),this._clearCommand.execute(e,t),t.framebuffer=n},m.prototype.getColorFramebuffer=function(){return this._fbo},m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){return f(this),n(this)},m}),i("Scene/GetFeatureInfoFormat",["../Core/Cartographic","../Core/defined","../Core/DeveloperError","../Core/RuntimeError","./ImageryLayerFeatureInfo"],function(e,t,i,r,n){"use strict";function o(e,i,r){this.type=e,t(i)||("json"===e?i="application/json":"xml"===e?i="text/xml":"html"===e?i="text/html":"text"===e&&(i="text/plain")),this.format=i,t(r)||("json"===e?r=a:"xml"===e?r=s:"html"===e?r=f:"text"===e&&(r=f)),this.callback=r}function a(i){for(var r=[],o=i.features,a=0;a0)for(var o=0;o1&&(t=i[1]);var r=new n;return r.name=t,r.description=e,r.data=e,[r]}}var _="http://www.mapinfo.com/mxp",g="http://www.esri.com/wms",v="http://www.opengis.net/wfs",y="http://www.opengis.net/gml",C=/\s*<\/body>/im,w=//im,S=/([\s\S]*)<\/title>/im;return o}),i("Shaders/GlobeFS",[],function(){"use strict";return"uniform vec4 u_initialColor;\n#if TEXTURE_UNITS > 0\nuniform sampler2D u_dayTextures[TEXTURE_UNITS];\nuniform vec4 u_dayTextureTranslationAndScale[TEXTURE_UNITS];\nuniform bool u_dayTextureUseWebMercatorT[TEXTURE_UNITS];\n#ifdef APPLY_ALPHA\nuniform float u_dayTextureAlpha[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_BRIGHTNESS\nuniform float u_dayTextureBrightness[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_CONTRAST\nuniform float u_dayTextureContrast[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_HUE\nuniform float u_dayTextureHue[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_SATURATION\nuniform float u_dayTextureSaturation[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_GAMMA\nuniform float u_dayTextureOneOverGamma[TEXTURE_UNITS];\n#endif\nuniform vec4 u_dayTextureTexCoordsRectangle[TEXTURE_UNITS];\n#endif\n#ifdef SHOW_REFLECTIVE_OCEAN\nuniform sampler2D u_waterMask;\nuniform vec4 u_waterMaskTranslationAndScale;\nuniform float u_zoomedOutOceanSpecularIntensity;\n#endif\n#ifdef SHOW_OCEAN_WAVES\nuniform sampler2D u_oceanNormalMap;\n#endif\n#ifdef ENABLE_DAYNIGHT_SHADING\nuniform vec2 u_lightingFadeDistance;\n#endif\nvarying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec3 v_textureCoordinates;\nvarying vec3 v_normalMC;\nvarying vec3 v_normalEC;\n#ifdef FOG\nvarying float v_distance;\nvarying vec3 v_rayleighColor;\nvarying vec3 v_mieColor;\n#endif\nvec4 sampleAndBlend(\nvec4 previousColor,\nsampler2D texture,\nvec2 tileTextureCoordinates,\nvec4 textureCoordinateRectangle,\nvec4 textureCoordinateTranslationAndScale,\nfloat textureAlpha,\nfloat textureBrightness,\nfloat textureContrast,\nfloat textureHue,\nfloat textureSaturation,\nfloat textureOneOverGamma)\n{\nvec2 alphaMultiplier = step(textureCoordinateRectangle.st, tileTextureCoordinates);\ntextureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;\nalphaMultiplier = step(vec2(0.0), textureCoordinateRectangle.pq - tileTextureCoordinates);\ntextureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;\nvec2 translation = textureCoordinateTranslationAndScale.xy;\nvec2 scale = textureCoordinateTranslationAndScale.zw;\nvec2 textureCoordinates = tileTextureCoordinates * scale + translation;\nvec4 value = texture2D(texture, textureCoordinates);\nvec3 color = value.rgb;\nfloat alpha = value.a;\n#ifdef APPLY_BRIGHTNESS\ncolor = mix(vec3(0.0), color, textureBrightness);\n#endif\n#ifdef APPLY_CONTRAST\ncolor = mix(vec3(0.5), color, textureContrast);\n#endif\n#ifdef APPLY_HUE\ncolor = czm_hue(color, textureHue);\n#endif\n#ifdef APPLY_SATURATION\ncolor = czm_saturation(color, textureSaturation);\n#endif\n#ifdef APPLY_GAMMA\ncolor = pow(color, vec3(textureOneOverGamma));\n#endif\nfloat sourceAlpha = alpha * textureAlpha;\nfloat outAlpha = mix(previousColor.a, 1.0, sourceAlpha);\nvec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha;\nreturn vec4(outColor, outAlpha);\n}\nvec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates);\nvec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float specularMapValue);\nvoid main()\n{\nvec4 color = computeDayColor(u_initialColor, clamp(v_textureCoordinates, 0.0, 1.0));\n#ifdef SHOW_TILE_BOUNDARIES\nif (v_textureCoordinates.x < (1.0/256.0) || v_textureCoordinates.x > (255.0/256.0) ||\nv_textureCoordinates.y < (1.0/256.0) || v_textureCoordinates.y > (255.0/256.0))\n{\ncolor = vec4(1.0, 0.0, 0.0, 1.0);\n}\n#endif\n#if defined(SHOW_REFLECTIVE_OCEAN) || defined(ENABLE_DAYNIGHT_SHADING)\nvec3 normalMC = czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0));\nvec3 normalEC = czm_normal3D * normalMC;\n#endif\n#ifdef SHOW_REFLECTIVE_OCEAN\nvec2 waterMaskTranslation = u_waterMaskTranslationAndScale.xy;\nvec2 waterMaskScale = u_waterMaskTranslationAndScale.zw;\nvec2 waterMaskTextureCoordinates = v_textureCoordinates.xy * waterMaskScale + waterMaskTranslation;\nfloat mask = texture2D(u_waterMask, waterMaskTextureCoordinates).r;\nif (mask > 0.0)\n{\nmat3 enuToEye = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalEC);\nvec2 ellipsoidTextureCoordinates = czm_ellipsoidWgs84TextureCoordinates(normalMC);\nvec2 ellipsoidFlippedTextureCoordinates = czm_ellipsoidWgs84TextureCoordinates(normalMC.zyx);\nvec2 textureCoordinates = mix(ellipsoidTextureCoordinates, ellipsoidFlippedTextureCoordinates, czm_morphTime * smoothstep(0.9, 0.95, normalMC.z));\ncolor = computeWaterColor(v_positionEC, textureCoordinates, enuToEye, color, mask);\n}\n#endif\n#ifdef ENABLE_VERTEX_LIGHTING\nfloat diffuseIntensity = clamp(czm_getLambertDiffuse(czm_sunDirectionEC, normalize(v_normalEC)) * 0.9 + 0.3, 0.0, 1.0);\nvec4 finalColor = vec4(color.rgb * diffuseIntensity, color.a);\n#elif defined(ENABLE_DAYNIGHT_SHADING)\nfloat diffuseIntensity = clamp(czm_getLambertDiffuse(czm_sunDirectionEC, normalEC) * 5.0 + 0.3, 0.0, 1.0);\nfloat cameraDist = length(czm_view[3]);\nfloat fadeOutDist = u_lightingFadeDistance.x;\nfloat fadeInDist = u_lightingFadeDistance.y;\nfloat t = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.0, 1.0);\ndiffuseIntensity = mix(1.0, diffuseIntensity, t);\nvec4 finalColor = vec4(color.rgb * diffuseIntensity, color.a);\n#else\nvec4 finalColor = color;\n#endif\n#ifdef FOG\nconst float fExposure = 2.0;\nvec3 fogColor = v_mieColor + finalColor.rgb * v_rayleighColor;\nfogColor = vec3(1.0) - exp(-fExposure * fogColor);\ngl_FragColor = vec4(czm_fog(v_distance, finalColor.rgb, fogColor), finalColor.a);\n#else\ngl_FragColor = finalColor;\n#endif\n}\n#ifdef SHOW_REFLECTIVE_OCEAN\nfloat waveFade(float edge0, float edge1, float x)\n{\nfloat y = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);\nreturn pow(1.0 - y, 5.0);\n}\nfloat linearFade(float edge0, float edge1, float x)\n{\nreturn clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);\n}\nconst float oceanFrequencyLowAltitude = 825000.0;\nconst float oceanAnimationSpeedLowAltitude = 0.004;\nconst float oceanOneOverAmplitudeLowAltitude = 1.0 / 2.0;\nconst float oceanSpecularIntensity = 0.5;\nconst float oceanFrequencyHighAltitude = 125000.0;\nconst float oceanAnimationSpeedHighAltitude = 0.008;\nconst float oceanOneOverAmplitudeHighAltitude = 1.0 / 2.0;\nvec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float maskValue)\n{\nvec3 positionToEyeEC = -positionEyeCoordinates;\nfloat positionToEyeECLength = length(positionToEyeEC);\nvec3 normalizedpositionToEyeEC = normalize(normalize(positionToEyeEC));\nfloat waveIntensity = waveFade(70000.0, 1000000.0, positionToEyeECLength);\n#ifdef SHOW_OCEAN_WAVES\nfloat time = czm_frameNumber * oceanAnimationSpeedHighAltitude;\nvec4 noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyHighAltitude, time, 0.0);\nvec3 normalTangentSpaceHighAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeHighAltitude);\ntime = czm_frameNumber * oceanAnimationSpeedLowAltitude;\nnoise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyLowAltitude, time, 0.0);\nvec3 normalTangentSpaceLowAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeLowAltitude);\nfloat highAltitudeFade = linearFade(0.0, 60000.0, positionToEyeECLength);\nfloat lowAltitudeFade = 1.0 - linearFade(20000.0, 60000.0, positionToEyeECLength);\nvec3 normalTangentSpace =\n(highAltitudeFade * normalTangentSpaceHighAltitude) +\n(lowAltitudeFade * normalTangentSpaceLowAltitude);\nnormalTangentSpace = normalize(normalTangentSpace);\nnormalTangentSpace.xy *= waveIntensity;\nnormalTangentSpace = normalize(normalTangentSpace);\n#else\nvec3 normalTangentSpace = vec3(0.0, 0.0, 1.0);\n#endif\nvec3 normalEC = enuToEye * normalTangentSpace;\nconst vec3 waveHighlightColor = vec3(0.3, 0.45, 0.6);\nfloat diffuseIntensity = czm_getLambertDiffuse(czm_sunDirectionEC, normalEC) * maskValue;\nvec3 diffuseHighlight = waveHighlightColor * diffuseIntensity;\n#ifdef SHOW_OCEAN_WAVES\nfloat tsPerturbationRatio = normalTangentSpace.z;\nvec3 nonDiffuseHighlight = mix(waveHighlightColor * 5.0 * (1.0 - tsPerturbationRatio), vec3(0.0), diffuseIntensity);\n#else\nvec3 nonDiffuseHighlight = vec3(0.0);\n#endif\nfloat specularIntensity = czm_getSpecular(czm_sunDirectionEC, normalizedpositionToEyeEC, normalEC, 10.0) + 0.25 * czm_getSpecular(czm_moonDirectionEC, normalizedpositionToEyeEC, normalEC, 10.0);\nfloat surfaceReflectance = mix(0.0, mix(u_zoomedOutOceanSpecularIntensity, oceanSpecularIntensity, waveIntensity), maskValue);\nfloat specular = specularIntensity * surfaceReflectance;\nreturn vec4(imageryColor.rgb + diffuseHighlight + nonDiffuseHighlight + specular, imageryColor.a);\n}\n#endif // #ifdef SHOW_REFLECTIVE_OCEAN\n"}),i("Shaders/GlobeVS",[],function(){"use strict";return"#ifdef QUANTIZATION_BITS12\nattribute vec4 compressed0;\nattribute float compressed1;\n#else\nattribute vec4 position3DAndHeight;\nattribute vec4 textureCoordAndEncodedNormals;\n#endif\nuniform vec3 u_center3D;\nuniform mat4 u_modifiedModelView;\nuniform mat4 u_modifiedModelViewProjection;\nuniform vec4 u_tileRectangle;\nuniform vec2 u_southAndNorthLatitude;\nuniform vec2 u_southMercatorYAndOneOverHeight;\nvarying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec3 v_textureCoordinates;\nvarying vec3 v_normalMC;\nvarying vec3 v_normalEC;\n#ifdef FOG\nvarying float v_distance;\nvarying vec3 v_mieColor;\nvarying vec3 v_rayleighColor;\n#endif\nvec4 getPosition(vec3 position, float height, vec2 textureCoordinates);\nfloat get2DYPositionFraction(vec2 textureCoordinates);\nvec4 getPosition3DMode(vec3 position, float height, vec2 textureCoordinates)\n{\nreturn u_modifiedModelViewProjection * vec4(position, 1.0);\n}\nfloat get2DMercatorYPositionFraction(vec2 textureCoordinates)\n{\nconst float maxTileWidth = 0.003068;\nfloat positionFraction = textureCoordinates.y;\nfloat southLatitude = u_southAndNorthLatitude.x;\nfloat northLatitude = u_southAndNorthLatitude.y;\nif (northLatitude - southLatitude > maxTileWidth)\n{\nfloat southMercatorY = u_southMercatorYAndOneOverHeight.x;\nfloat oneOverMercatorHeight = u_southMercatorYAndOneOverHeight.y;\nfloat currentLatitude = mix(southLatitude, northLatitude, textureCoordinates.y);\ncurrentLatitude = clamp(currentLatitude, -czm_webMercatorMaxLatitude, czm_webMercatorMaxLatitude);\npositionFraction = czm_latitudeToWebMercatorFraction(currentLatitude, southMercatorY, oneOverMercatorHeight);\n}\nreturn positionFraction;\n}\nfloat get2DGeographicYPositionFraction(vec2 textureCoordinates)\n{\nreturn textureCoordinates.y;\n}\nvec4 getPositionPlanarEarth(vec3 position, float height, vec2 textureCoordinates)\n{\nfloat yPositionFraction = get2DYPositionFraction(textureCoordinates);\nvec4 rtcPosition2D = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0);\nreturn u_modifiedModelViewProjection * rtcPosition2D;\n}\nvec4 getPosition2DMode(vec3 position, float height, vec2 textureCoordinates)\n{\nreturn getPositionPlanarEarth(position, 0.0, textureCoordinates);\n}\nvec4 getPositionColumbusViewMode(vec3 position, float height, vec2 textureCoordinates)\n{\nreturn getPositionPlanarEarth(position, height, textureCoordinates);\n}\nvec4 getPositionMorphingMode(vec3 position, float height, vec2 textureCoordinates)\n{\nvec3 position3DWC = position + u_center3D;\nfloat yPositionFraction = get2DYPositionFraction(textureCoordinates);\nvec4 position2DWC = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0);\nvec4 morphPosition = czm_columbusViewMorph(position2DWC, vec4(position3DWC, 1.0), czm_morphTime);\nreturn czm_modelViewProjection * morphPosition;\n}\n#ifdef QUANTIZATION_BITS12\nuniform vec2 u_minMaxHeight;\nuniform mat4 u_scaleAndBias;\n#endif\nvoid main()\n{\n#ifdef QUANTIZATION_BITS12\nvec2 xy = czm_decompressTextureCoordinates(compressed0.x);\nvec2 zh = czm_decompressTextureCoordinates(compressed0.y);\nvec3 position = vec3(xy, zh.x);\nfloat height = zh.y;\nvec2 textureCoordinates = czm_decompressTextureCoordinates(compressed0.z);\nheight = height * (u_minMaxHeight.y - u_minMaxHeight.x) + u_minMaxHeight.x;\nposition = (u_scaleAndBias * vec4(position, 1.0)).xyz;\n#if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)) && defined(INCLUDE_WEB_MERCATOR_Y)\nfloat webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x;\nfloat encodedNormal = compressed1;\n#elif defined(INCLUDE_WEB_MERCATOR_Y)\nfloat webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x;\nfloat encodedNormal = 0.0;\n#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)\nfloat webMercatorT = textureCoordinates.y;\nfloat encodedNormal = compressed0.w;\n#else\nfloat webMercatorT = textureCoordinates.y;\nfloat encodedNormal = 0.0;\n#endif\n#else\nvec3 position = position3DAndHeight.xyz;\nfloat height = position3DAndHeight.w;\nvec2 textureCoordinates = textureCoordAndEncodedNormals.xy;\n#if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)) && defined(INCLUDE_WEB_MERCATOR_Y)\nfloat webMercatorT = textureCoordAndEncodedNormals.z;\nfloat encodedNormal = textureCoordAndEncodedNormals.w;\n#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)\nfloat webMercatorT = textureCoordinates.y;\nfloat encodedNormal = textureCoordAndEncodedNormals.z;\n#elif defined(INCLUDE_WEB_MERCATOR_Y)\nfloat webMercatorT = textureCoordAndEncodedNormals.z;\nfloat encodedNormal = 0.0;\n#else\nfloat webMercatorT = textureCoordinates.y;\nfloat encodedNormal = 0.0;\n#endif\n#endif\nvec3 position3DWC = position + u_center3D;\ngl_Position = getPosition(position, height, textureCoordinates);\nv_textureCoordinates = vec3(textureCoordinates, webMercatorT);\n#if defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)\nv_positionEC = (u_modifiedModelView * vec4(position, 1.0)).xyz;\nv_positionMC = position3DWC;\nv_normalMC = czm_octDecode(encodedNormal);\nv_normalEC = czm_normal3D * v_normalMC;\n#elif defined(SHOW_REFLECTIVE_OCEAN) || defined(ENABLE_DAYNIGHT_SHADING) || defined(GENERATE_POSITION)\nv_positionEC = (u_modifiedModelView * vec4(position, 1.0)).xyz;\nv_positionMC = position3DWC;\n#endif\n#ifdef FOG\nAtmosphereColor atmosColor = computeGroundAtmosphereFromSpace(position3DWC);\nv_mieColor = atmosColor.mie;\nv_rayleighColor = atmosColor.rayleigh;\nv_distance = length((czm_modelView3D * vec4(position3DWC, 1.0)).xyz);\n#endif\n}\n"}),i("Shaders/GroundAtmosphere",[],function(){"use strict";return"const float fInnerRadius = 6378137.0;\nconst float fOuterRadius = 6378137.0 * 1.025;\nconst float fOuterRadius2 = fOuterRadius * fOuterRadius;\nconst float Kr = 0.0025;\nconst float Km = 0.0015;\nconst float ESun = 15.0;\nconst float fKrESun = Kr * ESun;\nconst float fKmESun = Km * ESun;\nconst float fKr4PI = Kr * 4.0 * czm_pi;\nconst float fKm4PI = Km * 4.0 * czm_pi;\nconst float fScale = 1.0 / (fOuterRadius - fInnerRadius);\nconst float fScaleDepth = 0.25;\nconst float fScaleOverScaleDepth = fScale / fScaleDepth;\nstruct AtmosphereColor\n{\nvec3 mie;\nvec3 rayleigh;\n};\nconst int nSamples = 2;\nconst float fSamples = 2.0;\nfloat scale(float fCos)\n{\nfloat x = 1.0 - fCos;\nreturn fScaleDepth * exp(-0.00287 + x*(0.459 + x*(3.83 + x*(-6.80 + x*5.25))));\n}\nAtmosphereColor computeGroundAtmosphereFromSpace(vec3 v3Pos)\n{\nvec3 v3InvWavelength = vec3(1.0 / pow(0.650, 4.0), 1.0 / pow(0.570, 4.0), 1.0 / pow(0.475, 4.0));\nvec3 v3Ray = v3Pos - czm_viewerPositionWC;\nfloat fFar = length(v3Ray);\nv3Ray /= fFar;\nfloat fCameraHeight = length(czm_viewerPositionWC);\nfloat fCameraHeight2 = fCameraHeight * fCameraHeight;\nfloat B = 2.0 * length(czm_viewerPositionWC) * dot(normalize(czm_viewerPositionWC), v3Ray);\nfloat C = fCameraHeight2 - fOuterRadius2;\nfloat fDet = max(0.0, B*B - 4.0 * C);\nfloat fNear = 0.5 * (-B - sqrt(fDet));\nvec3 v3Start = czm_viewerPositionWC + v3Ray * fNear;\nfFar -= fNear;\nfloat fDepth = exp((fInnerRadius - fOuterRadius) / fScaleDepth);\nfloat fLightAngle = 1.0;\nfloat fCameraAngle = dot(-v3Ray, v3Pos) / length(v3Pos);\nfloat fCameraScale = scale(fCameraAngle);\nfloat fLightScale = scale(fLightAngle);\nfloat fCameraOffset = fDepth*fCameraScale;\nfloat fTemp = (fLightScale + fCameraScale);\nfloat fSampleLength = fFar / fSamples;\nfloat fScaledLength = fSampleLength * fScale;\nvec3 v3SampleRay = v3Ray * fSampleLength;\nvec3 v3SamplePoint = v3Start + v3SampleRay * 0.5;\nvec3 v3FrontColor = vec3(0.0);\nvec3 v3Attenuate = vec3(0.0);\nfor(int i=0; i<nSamples; i++)\n{\nfloat fHeight = length(v3SamplePoint);\nfloat fDepth = exp(fScaleOverScaleDepth * (fInnerRadius - fHeight));\nfloat fScatter = fDepth*fTemp - fCameraOffset;\nv3Attenuate = exp(-fScatter * (v3InvWavelength * fKr4PI + fKm4PI));\nv3FrontColor += v3Attenuate * (fDepth * fScaledLength);\nv3SamplePoint += v3SampleRay;\n}\nAtmosphereColor color;\ncolor.mie = v3FrontColor * (v3InvWavelength * fKrESun + fKmESun);\ncolor.rayleigh = v3Attenuate;\nreturn color;\n}\n"}),i("Scene/GlobeSurfaceShaderSet",["../Core/defined","../Core/destroyObject","../Core/TerrainQuantization","../Renderer/ShaderProgram","../Scene/SceneMode"],function(e,t,i,r,n){"use strict";function o(e,t,i){this.numberOfDayTextures=e,this.flags=t,this.shaderProgram=i}function a(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this._pickShaderPrograms=[]}function s(e){var t,i="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPosition3DMode(position, height, textureCoordinates); }",r="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionColumbusViewMode(position, height, textureCoordinates); }",o="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionMorphingMode(position, height, textureCoordinates); }";switch(e){case n.SCENE3D:t=i;break;case n.SCENE2D:case n.COLUMBUS_VIEW:t=r;break;case n.MORPHING:t=o}return t}function l(e){var t="float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }",i="float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }";return e?i:t}return a.prototype.getShaderProgram=function(t,n,a,u,c,h,d,p,m,f,_,g,v,y,C){var w=0,S="",E=n.pickTerrain.mesh.encoding,b=E.quantization;b===i.BITS12&&(w=1,S="QUANTIZATION_BITS12");var T=t.mode,x=T|u<<2|c<<3|h<<4|d<<5|p<<6|m<<7|f<<8|_<<9|g<<10|v<<11|y<<12|C<<13|w<<14,A=n.surfaceShader;if(e(A)&&A.numberOfDayTextures===a&&A.flags===x)return A.shaderProgram;var P=this._shadersByTexturesFlags[a];if(e(P)||(P=this._shadersByTexturesFlags[a]=[]),A=P[x],!e(A)){var D=this.baseVertexShaderSource.clone(),M=this.baseFragmentShaderSource.clone();D.defines.push(S),M.defines.push("TEXTURE_UNITS "+a),u&&M.defines.push("APPLY_BRIGHTNESS"),c&&M.defines.push("APPLY_CONTRAST"),h&&M.defines.push("APPLY_HUE"),d&&M.defines.push("APPLY_SATURATION"),p&&M.defines.push("APPLY_GAMMA"),m&&M.defines.push("APPLY_ALPHA"),f&&(M.defines.push("SHOW_REFLECTIVE_OCEAN"),D.defines.push("SHOW_REFLECTIVE_OCEAN")),_&&M.defines.push("SHOW_OCEAN_WAVES"),g&&(v?(D.defines.push("ENABLE_VERTEX_LIGHTING"),M.defines.push("ENABLE_VERTEX_LIGHTING")):(D.defines.push("ENABLE_DAYNIGHT_SHADING"),M.defines.push("ENABLE_DAYNIGHT_SHADING"))),D.defines.push("INCLUDE_WEB_MERCATOR_Y"),M.defines.push("INCLUDE_WEB_MERCATOR_Y"),C&&(D.defines.push("FOG"),M.defines.push("FOG"));for(var I=" vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates)\n {\n vec4 color = initialColor;\n",R=0;R<a;++R)I+=" color = sampleAndBlend(\n color,\n u_dayTextures["+R+"],\n u_dayTextureUseWebMercatorT["+R+"] ? textureCoordinates.xz : textureCoordinates.xy,\n u_dayTextureTexCoordsRectangle["+R+"],\n u_dayTextureTranslationAndScale["+R+"],\n "+(m?"u_dayTextureAlpha["+R+"]":"1.0")+",\n "+(u?"u_dayTextureBrightness["+R+"]":"0.0")+",\n "+(c?"u_dayTextureContrast["+R+"]":"0.0")+",\n "+(h?"u_dayTextureHue["+R+"]":"0.0")+",\n "+(d?"u_dayTextureSaturation["+R+"]":"0.0")+",\n "+(p?"u_dayTextureOneOverGamma["+R+"]":"0.0")+"\n );\n";I+=" return color;\n }",M.sources.push(I),D.sources.push(s(T)),D.sources.push(l(y));var O=r.fromCache({context:t.context,vertexShaderSource:D,fragmentShaderSource:M,attributeLocations:E.getAttributeLocations()});A=P[x]=new o(a,x,O)}return n.surfaceShader=A,A.shaderProgram},a.prototype.getPickShaderProgram=function(t,n,o){var a=0,u="",c=n.pickTerrain.mesh.encoding,h=c.quantization;h===i.BITS12&&(a=1,u="QUANTIZATION_BITS12");var d=t.mode,p=d|o<<2|a<<3,m=this._pickShaderPrograms[p];if(!e(m)){var f=this.baseVertexShaderSource.clone();f.defines.push(u),f.sources.push(s(d)),f.sources.push(l(o));var _="void main()\n{\n gl_FragColor = vec4(1.0, 1.0, 0.0, 1.0);\n}\n";m=this._pickShaderPrograms[p]=r.fromCache({context:t.context,vertexShaderSource:f,fragmentShaderSource:_,attributeLocations:c.getAttributeLocations()})}return m},a.prototype.destroy=function(){var i,r,n=this._shadersByTexturesFlags;for(var o in n)if(n.hasOwnProperty(o)){var a=n[o];if(!e(a))continue;for(i in a)a.hasOwnProperty(i)&&(r=a[i],e(r)&&r.shaderProgram.destroy())}var s=this._pickShaderPrograms;for(i in s)s.hasOwnProperty(i)&&(r=s[i],r.destroy());return t(this)},a}),i("Scene/ImageryState",["../Core/freezeObject"],function(e){"use strict";var t={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7};return e(t)}),i("Scene/QuadtreeTileLoadState",["../Core/freezeObject"],function(e){"use strict";var t={START:0,LOADING:1,DONE:2,FAILED:3};return e(t)}),i("Scene/TerrainState",["../Core/freezeObject"],function(e){"use strict";var t={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6};return e(t)}),i("Scene/TileBoundingBox",["../Core/Cartesian3","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/Ellipsoid","../Core/Rectangle","./SceneMode"],function(e,t,i,r,n,o,a,s){"use strict";function l(t,i,r){r.cartographicToCartesian(a.southwest(i),t.southwestCornerCartesian),r.cartographicToCartesian(a.northeast(i),t.northeastCornerCartesian),m.longitude=i.west,m.latitude=.5*(i.south+i.north),m.height=0;var n=r.cartographicToCartesian(m,d),o=e.cross(n,e.UNIT_Z,c);e.normalize(o,t.westNormal),m.longitude=i.east;var s=r.cartographicToCartesian(m,p),l=e.cross(e.UNIT_Z,s,c);e.normalize(l,t.eastNormal);var u=r.geodeticSurfaceNormalCartographic(a.southeast(i),h),f=e.subtract(n,s,c),_=e.cross(u,f,h);e.normalize(_,t.southNormal);var g=r.geodeticSurfaceNormalCartographic(a.northwest(i),h),v=e.cross(f,g,h);e.normalize(v,t.northNormal)}var u=function(t){t=i(t,i.EMPTY_OBJECT),this.rectangle=a.clone(t.rectangle),this.minimumHeight=i(t.minimumHeight,0),this.maximumHeight=i(t.maximumHeight,0),this.southwestCornerCartesian=new e,this.northeastCornerCartesian=new e,this.westNormal=new e,this.southNormal=new e,this.eastNormal=new e,this.northNormal=new e;var r=i(t.ellipsoid,o.WGS84);l(this,t.rectangle,r)},c=new e,h=new e,d=new e,p=new e,m=new t,f=new e,_=new e,g=new e(0,-1,0),v=new e(0,0,-1),y=new e;return u.prototype.distanceToCamera=function(t){var i=t.camera,r=i.positionWC,n=i.positionCartographic,o=0;if(!a.contains(this.rectangle,n)){var l=this.southwestCornerCartesian,u=this.northeastCornerCartesian,c=this.westNormal,h=this.southNormal,d=this.eastNormal,p=this.northNormal;t.mode!==s.SCENE3D&&(l=t.mapProjection.project(a.southwest(this.rectangle),f),l.z=l.y,l.y=l.x,l.x=0,u=t.mapProjection.project(a.northeast(this.rectangle),_),u.z=u.y,u.y=u.x,u.x=0,c=g,d=e.UNIT_Y,h=v,p=e.UNIT_Z);var m=e.subtract(r,l,y),C=e.dot(m,c),w=e.dot(m,h),S=e.subtract(r,u,y),E=e.dot(S,d),b=e.dot(S,p);C>0?o+=C*C:E>0&&(o+=E*E),w>0?o+=w*w:b>0&&(o+=b*b)}var T;T=t.mode===s.SCENE3D?n.height:r.x;var x=t.mode===s.SCENE3D?this.maximumHeight:0,A=T-x;return A>0&&(o+=A*A),Math.sqrt(o)},u}),i("Scene/TileTerrain",["../Core/BoundingSphere","../Core/Cartesian3","../Core/defined","../Core/DeveloperError","../Core/IndexDatatype","../Core/OrientedBoundingBox","../Core/TileProviderError","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/VertexArray","../ThirdParty/when","./TerrainState","./TileBoundingBox"],function(e,t,i,r,n,o,a,s,l,u,c,h,d){"use strict";function p(e){this.state=h.UNLOADED,this.data=void 0,this.mesh=void 0,this.vertexArray=void 0,this.upsampleDetails=e}function m(e,t,r,n,o){function s(t){e.data=t,e.state=h.RECEIVED}function l(){e.state=h.FAILED;var i="Failed to obtain terrain tile X: "+r+" Y: "+n+" Level: "+o+".";t._requestError=a.handleError(t._requestError,t,t.errorEvent,i,r,n,o,u)}function u(){e.data=t.requestTileGeometry(r,n,o),i(e.data)?(e.state=h.RECEIVING,c(e.data,s,l)):e.state=h.UNLOADED}u()}function f(e,t,r,n,o,a){var s=r.tilingScheme,l=e.data,u=l.createMesh(s,n,o,a,t.terrainExaggeration);i(u)&&(e.state=h.TRANSFORMING,c(u,function(t){e.mesh=t,e.state=h.TRANSFORMED},function(){e.state=h.FAILED}))}function _(e,t,r,o,a,c){var d=e.mesh.vertices,p=s.createVertexBuffer({context:t,typedArray:d,usage:l.STATIC_DRAW}),m=e.mesh.encoding.getAttributes(p),f=e.mesh.indices.indexBuffers||{},_=f[t.id];if(!i(_)||_.isDestroyed()){var g=e.mesh.indices,v=2===g.BYTES_PER_ELEMENT?n.UNSIGNED_SHORT:n.UNSIGNED_INT;_=s.createIndexBuffer({context:t,typedArray:g,usage:l.STATIC_DRAW,indexDatatype:v}),_.vertexArrayDestroyable=!1,_.referenceCount=1,f[t.id]=_, -e.mesh.indices.indexBuffers=f}else++_.referenceCount;e.vertexArray=new u({context:t,attributes:m,indexBuffer:_}),e.state=h.READY}return p.prototype.freeResources=function(){if(this.state=h.UNLOADED,this.data=void 0,this.mesh=void 0,i(this.vertexArray)){var e=this.vertexArray.indexBuffer;this.vertexArray.destroy(),this.vertexArray=void 0,!e.isDestroyed()&&i(e.referenceCount)&&(--e.referenceCount,0===e.referenceCount&&e.destroy())}},p.prototype.publishToTile=function(i){var r=i.data,n=this.mesh;t.clone(n.center,r.center),r.minimumHeight=n.minimumHeight,r.maximumHeight=n.maximumHeight,r.boundingSphere3D=e.clone(n.boundingSphere3D,r.boundingSphere3D),r.orientedBoundingBox=o.clone(n.orientedBoundingBox,r.orientedBoundingBox),r.tileBoundingBox=new d({rectangle:i.rectangle,minimumHeight:n.minimumHeight,maximumHeight:n.maximumHeight,ellipsoid:i.tilingScheme.ellipsoid}),i.data.occludeePointInScaledSpace=t.clone(n.occludeePointInScaledSpace,r.occludeePointInScaledSpace)},p.prototype.processLoadStateMachine=function(e,t,i,r,n){this.state===h.UNLOADED&&m(this,t,i,r,n),this.state===h.RECEIVED&&f(this,e,t,i,r,n),this.state===h.TRANSFORMED&&_(this,e.context,t,i,r,n)},p.prototype.processUpsampleStateMachine=function(e,t,r,n,o){if(this.state===h.UNLOADED){var a=this.upsampleDetails,s=a.data,l=a.x,u=a.y,d=a.level;if(this.data=s.upsample(t.tilingScheme,l,u,d,r,n,o),!i(this.data))return;this.state=h.RECEIVING;var p=this;c(this.data,function(e){p.data=e,p.state=h.RECEIVED},function(){p.state=h.FAILED})}this.state===h.RECEIVED&&f(this,e,t,r,n,o),this.state===h.TRANSFORMED&&_(this,e.context,t,r,n,o)},p}),i("Scene/GlobeSurfaceTile",["../Core/BoundingSphere","../Core/Cartesian3","../Core/Cartesian4","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/IntersectionTests","../Core/PixelFormat","../Renderer/PixelDatatype","../Renderer/Sampler","../Renderer/Texture","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","./ImageryState","./QuadtreeTileLoadState","./SceneMode","./TerrainState","./TileTerrain"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v){"use strict";function y(){this.imagery=[],this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new i(0,0,1,1),this.terrainData=void 0,this.center=new t,this.vertexArray=void 0,this.minimumHeight=0,this.maximumHeight=0,this.boundingSphere3D=new e,this.boundingSphere2D=new e,this.orientedBoundingBox=void 0,this.tileBoundingBox=void 0,this.occludeePointInScaledSpace=new t,this.loadedTerrain=void 0,this.upsampledTerrain=void 0,this.pickBoundingSphere=new e,this.pickTerrain=void 0,this.surfaceShader=void 0}function C(e,i,r,o,a,s){if(e.decodePosition(o,a,s),n(i)&&i!==_.SCENE3D){var l=r.ellipsoid,u=l.cartesianToCartographic(s);r.project(u,s),t.fromElements(s.z,s.x,s.y,s)}return s}function w(e,t,i){var r=e.data,o=E(e);n(o)&&(r.upsampledTerrain=new v(o)),P(e,t)&&(r.loadedTerrain=new v);for(var a=0,s=i.length;a<s;++a){var l=i.get(a);l.show&&l._createTileImagerySkeletons(e,t)}}function S(e,t,i,o){var a=e.data,s=a.loadedTerrain,l=a.upsampledTerrain,u=!1;n(s)&&(s.processLoadStateMachine(t,i,e.x,e.y,e.level),s.state>=g.RECEIVED&&(a.terrainData!==s.data&&(a.terrainData=s.data,M(t.context,a),x(e)),u=!0),s.state===g.READY?(s.publishToTile(e),n(e.data.vertexArray)&&o.push(e.data.vertexArray),e.data.vertexArray=s.vertexArray,s.vertexArray=void 0,a.pickTerrain=r(a.loadedTerrain,a.upsampledTerrain),a.loadedTerrain=void 0,a.upsampledTerrain=void 0):s.state===g.FAILED&&(a.loadedTerrain=void 0)),!u&&n(l)&&(l.processUpsampleStateMachine(t,i,e.x,e.y,e.level),l.state>=g.RECEIVED&&a.terrainData!==l.data&&(a.terrainData=l.data,i.hasWaterMask&&I(e),b(e)),l.state===g.READY?(l.publishToTile(e),n(e.data.vertexArray)&&o.push(e.data.vertexArray),e.data.vertexArray=l.vertexArray,l.vertexArray=void 0,a.pickTerrain=a.upsampledTerrain,a.upsampledTerrain=void 0):l.state===g.FAILED&&(a.upsampledTerrain=void 0))}function E(e){for(var t=e.parent;n(t)&&n(t.data)&&!n(t.data.terrainData);)t=t.parent;if(n(t)&&n(t.data))return{data:t.data.terrainData,x:t.x,y:t.y,level:t.level}}function b(e){T(e,e._southwestChild),T(e,e._southeastChild),T(e,e._northwestChild),T(e,e._northeastChild)}function T(e,t){if(n(t)&&t.state!==f.START){var i=t.data;if(n(i.terrainData)&&!i.terrainData.wasCreatedByUpsampling())return;n(i.upsampledTerrain)&&i.upsampledTerrain.freeResources(),i.upsampledTerrain=new v({data:e.data.terrainData,x:e.x,y:e.y,level:e.level}),t.state=f.LOADING}}function x(e){var t=e.data;A(e,t,e.southwestChild),A(e,t,e.southeastChild),A(e,t,e.northwestChild),A(e,t,e.northeastChild)}function A(e,t,i){if(i.state!==f.START){var r=i.data;if(n(r.terrainData)&&!r.terrainData.wasCreatedByUpsampling())return;n(r.upsampledTerrain)&&r.upsampledTerrain.freeResources(),r.upsampledTerrain=new v({data:t.terrainData,x:e.x,y:e.y,level:e.level}),t.terrainData.isChildAvailable(e.x,e.y,i.x,i.y)&&(n(r.loadedTerrain)||(r.loadedTerrain=new v)),i.state=f.LOADING}}function P(e,t){var i=t.getTileDataAvailable(e.x,e.y,e.level);if(n(i))return i;var r=e.parent;return!n(r)||!(!n(r.data)||!n(r.data.terrainData))&&r.data.terrainData.isChildAvailable(r.x,r.y,e.x,e.y)}function D(e){var t=e.cache.tile_waterMaskData;if(!n(t)){var i=new c({context:e,pixelFormat:s.LUMINANCE,pixelDatatype:l.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});i.referenceCount=1;var r=new u({wrapS:p.CLAMP_TO_EDGE,wrapT:p.CLAMP_TO_EDGE,minificationFilter:d.LINEAR,magnificationFilter:h.LINEAR});t={allWaterTexture:i,sampler:r,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function M(e,t){var r=t.waterMaskTexture;n(r)&&(--r.referenceCount,0===r.referenceCount&&r.destroy(),t.waterMaskTexture=void 0);var o=t.terrainData.waterMask;if(n(o)){var a,u=D(e),h=o.length;if(1===h){if(0===o[0])return;a=u.allWaterTexture}else{var d=Math.sqrt(h);a=new c({context:e,pixelFormat:s.LUMINANCE,pixelDatatype:l.UNSIGNED_BYTE,source:{width:d,height:d,arrayBufferView:o},sampler:u.sampler}),a.referenceCount=0}++a.referenceCount,t.waterMaskTexture=a,i.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}}function I(e){for(var t=e.data,i=e.parent;n(i)&&!n(i.data.terrainData)||i.data.terrainData.wasCreatedByUpsampling();)i=i.parent;if(n(i)&&n(i.data.waterMaskTexture)){t.waterMaskTexture=i.data.waterMaskTexture,++t.waterMaskTexture.referenceCount;var r=i.rectangle,o=e.rectangle,a=o.width,s=o.height,l=a/r.width,u=s/r.height;t.waterMaskTranslationAndScale.x=l*(o.west-r.west)/a,t.waterMaskTranslationAndScale.y=u*(o.south-r.south)/s,t.waterMaskTranslationAndScale.z=l,t.waterMaskTranslationAndScale.w=u}}o(y.prototype,{eligibleForUnloading:{get:function(){for(var e=this.loadedTerrain,t=n(e)&&(e.state===g.RECEIVING||e.state===g.TRANSFORMING),i=this.upsampledTerrain,r=n(i)&&(i.state===g.RECEIVING||i.state===g.TRANSFORMING),o=!t&&!r,a=this.imagery,s=0,l=a.length;o&&s<l;++s){var u=a[s];o=!n(u.loadingImagery)||u.loadingImagery.state!==m.TRANSITIONING}return o}}});var R=new t,O=new t,N=new t,L=new t;return y.prototype.pick=function(e,i,r,o,s){var l=this.pickTerrain;if(n(l)){var u=l.mesh;if(n(u))for(var c=u.vertices,h=u.indices,d=u.encoding,p=h.length,m=0;m<p;m+=3){var f=h[m],_=h[m+1],g=h[m+2],v=C(d,i,r,c,f,R),y=C(d,i,r,c,_,O),w=C(d,i,r,c,g,N),S=a.rayTriangle(e,v,y,w,o,L);if(n(S))return t.clone(S,s)}}},y.prototype.freeResources=function(){n(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,0===this.waterMaskTexture.referenceCount&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),this.terrainData=void 0,n(this.loadedTerrain)&&(this.loadedTerrain.freeResources(),this.loadedTerrain=void 0),n(this.upsampledTerrain)&&(this.upsampledTerrain.freeResources(),this.upsampledTerrain=void 0),n(this.pickTerrain)&&(this.pickTerrain.freeResources(),this.pickTerrain=void 0);var e,t,i=this.imagery;for(e=0,t=i.length;e<t;++e)i[e].freeResources();this.imagery.length=0,this.freeVertexArray()},y.prototype.freeVertexArray=function(){var e;n(this.vertexArray)&&(e=this.vertexArray.indexBuffer,this.vertexArray=this.vertexArray.destroy(),!e.isDestroyed()&&n(e.referenceCount)&&(--e.referenceCount,0===e.referenceCount&&e.destroy())),n(this.wireframeVertexArray)&&(e=this.wireframeVertexArray.indexBuffer,this.wireframeVertexArray=this.wireframeVertexArray.destroy(),!e.isDestroyed()&&n(e.referenceCount)&&(--e.referenceCount,0===e.referenceCount&&e.destroy()))},y.processStateMachine=function(e,t,i,r,o){var a=e.data;n(a)||(a=e.data=new y),e.state===f.START&&(w(e,i,r),e.state=f.LOADING),e.state===f.LOADING&&S(e,t,i,o);for(var s=n(a.vertexArray),l=!n(a.loadedTerrain)&&!n(a.upsampledTerrain),u=n(a.terrainData)&&a.terrainData.wasCreatedByUpsampling(),c=a.imagery,h=0,d=c.length;h<d;++h){var p=c[h];if(n(p.loadingImagery)){if(p.loadingImagery.state===m.PLACEHOLDER){var _=p.loadingImagery.imageryLayer;if(_.imageryProvider.ready){p.freeResources(),c.splice(h,1),_._createTileImagerySkeletons(e,i,h),--h,d=c.length;continue}u=!1}var g=p.processStateMachine(e,t);l=l&&g,s=s&&(g||n(p.readyImagery)),u=u&&n(p.loadingImagery)&&(p.loadingImagery.state===m.FAILED||p.loadingImagery.state===m.INVALID)}else u=!1}e.upsampledFromParent=u,h===d&&(s&&(e.renderable=!0),l&&(e.state=f.DONE))},y}),i("Shaders/ReprojectWebMercatorFS",[],function(){"use strict";return"uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = texture2D(u_texture, v_textureCoordinates);\n}\n"}),i("Shaders/ReprojectWebMercatorVS",[],function(){"use strict";return"attribute vec4 position;\nattribute float webMercatorT;\nuniform vec2 u_textureDimensions;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nv_textureCoordinates = vec2(position.x, webMercatorT);\ngl_Position = czm_viewportOrthographic * (position * vec4(u_textureDimensions, 1.0, 1.0));\n}\n"}),i("Scene/Imagery",["../Core/defined","../Core/destroyObject","./ImageryState"],function(e,t,i){"use strict";function r(t,r,n,o,a){if(this.imageryLayer=t,this.x=r,this.y=n,this.level=o,0!==o){var s=r/2|0,l=n/2|0,u=o-1;this.parent=t.getImageryFromCache(s,l,u)}if(this.state=i.UNLOADED,this.imageUrl=void 0,this.image=void 0,this.texture=void 0,this.textureWebMercator=void 0,this.credits=void 0,this.referenceCount=0,!e(a)&&t.imageryProvider.ready){var c=t.imageryProvider.tilingScheme;a=c.tileXYToRectangle(r,n,o)}this.rectangle=a}return r.createPlaceholder=function(e){var t=new r(e,0,0,0);return t.addReference(),t.state=i.PLACEHOLDER,t},r.prototype.addReference=function(){++this.referenceCount},r.prototype.releaseReference=function(){return--this.referenceCount,0===this.referenceCount?(this.imageryLayer.removeImageryFromCache(this),e(this.parent)&&this.parent.releaseReference(),e(this.image)&&e(this.image.destroy)&&this.image.destroy(),e(this.texture)&&this.texture.destroy(),e(this.textureWebMercator)&&this.texture!==this.textureWebMercator&&this.textureWebMercator.destroy(),t(this),0):this.referenceCount},r.prototype.processStateMachine=function(e,t){this.state===i.UNLOADED&&(this.state=i.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===i.RECEIVED&&(this.state=i.TRANSITIONING,this.imageryLayer._createTexture(e.context,this));var r=this.state===i.READY&&t&&!this.texture;(this.state===i.TEXTURE_LOADED||r)&&(this.state=i.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))},r}),i("Scene/TileImagery",["../Core/defined","./ImageryState"],function(e,t){"use strict";function i(e,t,i){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=i}return i.prototype.freeResources=function(){e(this.readyImagery)&&this.readyImagery.releaseReference(),e(this.loadingImagery)&&this.loadingImagery.releaseReference()},i.prototype.processStateMachine=function(i,r){var n=this.loadingImagery,o=n.imageryLayer;if(n.processStateMachine(r,!this.useWebMercatorT),n.state===t.READY)return e(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=this.loadingImagery,this.loadingImagery=void 0,this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(i,this),!0;for(var a,s=n.parent;e(s)&&s.state!==t.READY;)s.state!==t.FAILED&&s.state!==t.INVALID&&(a=a||s),s=s.parent;return this.readyImagery!==s&&(e(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=s,e(s)&&(s.addReference(),this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(i,this))),(n.state===t.FAILED||n.state===t.INVALID)&&(!e(a)||(a.processStateMachine(r,!this.useWebMercatorT),!1))},i}),i("Scene/ImageryLayer",["../Core/Cartesian2","../Core/Cartesian4","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/FeatureDetection","../Core/GeographicTilingScheme","../Core/IndexDatatype","../Core/Math","../Core/PixelFormat","../Core/Rectangle","../Core/TerrainProvider","../Core/TileProviderError","../Core/WebMercatorProjection","../Core/WebMercatorTilingScheme","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/ComputeCommand","../Renderer/ContextLimits","../Renderer/MipmapHint","../Renderer/Sampler","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/Texture","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","../Renderer/VertexArray","../Shaders/ReprojectWebMercatorFS","../Shaders/ReprojectWebMercatorVS","../ThirdParty/when","./Imagery","./ImageryState","./TileImagery"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I,R,O,N){"use strict";function L(e,t){this._imageryProvider=e,t=i(t,{}),this.alpha=i(t.alpha,i(e.defaultAlpha,1)),this.brightness=i(t.brightness,i(e.defaultBrightness,L.DEFAULT_BRIGHTNESS)),this.contrast=i(t.contrast,i(e.defaultContrast,L.DEFAULT_CONTRAST)),this.hue=i(t.hue,i(e.defaultHue,L.DEFAULT_HUE)),this.saturation=i(t.saturation,i(e.defaultSaturation,L.DEFAULT_SATURATION)),this.gamma=i(t.gamma,i(e.defaultGamma,L.DEFAULT_GAMMA)),this.show=i(t.show,!0),this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=i(t.rectangle,h.MAX_VALUE),this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new N(R.createPlaceholder(this)),this._show=!0,this._layerIndex=-1,this._isBaseLayer=!1,this._requestImageError=void 0,this._reprojectComputeCommands=[]}function B(e,t,n,o){if(u.isPowerOfTwo(o.width)&&u.isPowerOfTwo(o.height)){var a=t.cache.imageryLayer_mipmapSampler;if(!r(a)){var s=y.maximumTextureFilterAnisotropy;a=t.cache.imageryLayer_mipmapSampler=new w({wrapS:A.CLAMP_TO_EDGE,wrapT:A.CLAMP_TO_EDGE,minificationFilter:x.LINEAR_MIPMAP_LINEAR,magnificationFilter:T.LINEAR,maximumAnisotropy:Math.min(s,i(e._maximumAnisotropy,s))})}o.generateMipmap(C.NICEST),o.sampler=a}else{var l=t.cache.imageryLayer_nonMipmapSampler;r(l)||(l=t.cache.imageryLayer_nonMipmapSampler=new w({wrapS:A.CLAMP_TO_EDGE,wrapT:A.CLAMP_TO_EDGE,minificationFilter:x.LINEAR,magnificationFilter:T.LINEAR})),o.sampler=l}n.state=O.READY}function F(e,t,i){return JSON.stringify([e,t,i])}function V(e,t,i,n){var o=t.cache.imageryLayer_reproject;if(!r(o)){o=t.cache.imageryLayer_reproject={vertexArray:void 0,shaderProgram:void 0,sampler:void 0,destroy:function(){r(this.framebuffer)&&this.framebuffer.destroy(),r(this.vertexArray)&&this.vertexArray.destroy(),r(this.shaderProgram)&&this.shaderProgram.destroy()}};for(var a=new Float32Array(256),s=0,c=0;c<64;++c){var h=c/63;a[s++]=0,a[s++]=h,a[s++]=1,a[s++]=h}var p={position:0,webMercatorT:1},m=d.getRegularGridIndices(2,64),f=_.createIndexBuffer({context:t,typedArray:m,usage:g.STATIC_DRAW,indexDatatype:l.UNSIGNED_SHORT});o.vertexArray=new P({context:t,attributes:[{index:p.position,vertexBuffer:_.createVertexBuffer({context:t,typedArray:a,usage:g.STATIC_DRAW}),componentsPerAttribute:2},{index:p.webMercatorT,vertexBuffer:_.createVertexBuffer({context:t,sizeInBytes:512,usage:g.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:f});var v=new E({sources:[M]});o.shaderProgram=S.fromCache({context:t,vertexShaderSource:v,fragmentShaderSource:D,attributeLocations:p}),o.sampler=new w({wrapS:A.CLAMP_TO_EDGE,wrapT:A.CLAMP_TO_EDGE,minificationFilter:x.LINEAR,magnificationFilter:T.LINEAR})}i.sampler=o.sampler;var y=i.width,I=i.height;H.textureDimensions.x=y,H.textureDimensions.y=I,H.texture=i;var R=Math.sin(n.south),O=.5*Math.log((1+R)/(1-R));R=Math.sin(n.north);var N=.5*Math.log((1+R)/(1-R)),L=1/(N-O),B=new b({context:t,width:y,height:I,pixelFormat:i.pixelFormat,pixelDatatype:i.pixelDatatype,preMultiplyAlpha:i.preMultiplyAlpha});u.isPowerOfTwo(y)&&u.isPowerOfTwo(I)&&B.generateMipmap(C.NICEST);for(var F=n.south,V=n.north,k=q,z=0,U=0;U<64;++U){var G=U/63,W=u.lerp(F,V,G);R=Math.sin(W);var j=.5*Math.log((1+R)/(1-R)),Y=(j-O)*L;k[z++]=Y,k[z++]=Y}o.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(k),e.shaderProgram=o.shaderProgram,e.outputTexture=B,e.uniformMap=H,e.vertexArray=o.vertexArray}function k(e,t,i){var r=e._imageryProvider,n=r.tilingScheme,o=n.ellipsoid,a=e._imageryProvider.tilingScheme instanceof s?1:Math.cos(i),l=n.rectangle,u=o.maximumRadius*l.width*a/(r.tileWidth*n.getNumberOfXTilesAtLevel(0)),c=u/t,h=Math.log(c)/Math.log(2),d=Math.round(h);return 0|d}n(L.prototype,{imageryProvider:{get:function(){return this._imageryProvider}},rectangle:{get:function(){return this._rectangle}}}),L.DEFAULT_BRIGHTNESS=1,L.DEFAULT_CONTRAST=1,L.DEFAULT_HUE=0,L.DEFAULT_SATURATION=1,L.DEFAULT_GAMMA=1,L.prototype.isBaseLayer=function(){return this._isBaseLayer},L.prototype.isDestroyed=function(){return!1},L.prototype.destroy=function(){return o(this)};var z=new h,U=new h,G=new h,W=new h;L.prototype.getViewableRectangle=function(){var e=this._imageryProvider,t=this._rectangle;return e.readyPromise.then(function(){return h.intersection(e.rectangle,t)})},L.prototype._createTileImagerySkeletons=function(e,i,n){var o=e.data;if(r(this._minimumTerrainLevel)&&e.level<this._minimumTerrainLevel)return!1;if(r(this._maximumTerrainLevel)&&e.level>this._maximumTerrainLevel)return!1;var a=this._imageryProvider;if(r(n)||(n=o.imagery.length),!a.ready)return this._skeletonPlaceholder.loadingImagery.addReference(),o.imagery.splice(n,0,this._skeletonPlaceholder),!0;var s=a.tilingScheme instanceof f&&e.rectangle.north<m.MaximumLatitude&&e.rectangle.south>-m.MaximumLatitude,l=h.intersection(a.rectangle,this._rectangle,z),u=h.intersection(e.rectangle,l,U);if(!r(u)){if(!this.isBaseLayer())return!1;var c=l,d=e.rectangle;u=U,d.south>=c.north?u.north=u.south=c.north:d.north<=c.south?u.north=u.south=c.south:(u.south=Math.max(d.south,c.south),u.north=Math.min(d.north,c.north)),d.west>=c.east?u.west=u.east=c.east:d.east<=c.west?u.west=u.east=c.west:(u.west=Math.max(d.west,c.west),u.east=Math.min(d.east,c.east))}var p=0;u.south>0?p=u.south:u.north<0&&(p=u.north);var _=1,g=_*i.getLevelMaximumGeometricError(e.level),v=k(this,g,p);v=Math.max(0,v);var y=a.maximumLevel;if(v>y&&(v=y),r(a.minimumLevel)){var C=a.minimumLevel;v<C&&(v=C)}var w=a.tilingScheme,S=w.positionToTileXY(h.northwest(u),v),E=w.positionToTileXY(h.southeast(u),v),b=e.rectangle.width/512,T=e.rectangle.height/512,x=w.tileXYToRectangle(S.x,S.y,v);Math.abs(x.south-e.rectangle.north)<T&&S.y<E.y&&++S.y,Math.abs(x.east-e.rectangle.west)<b&&S.x<E.x&&++S.x;var A=w.tileXYToRectangle(E.x,E.y,v);Math.abs(A.north-e.rectangle.south)<T&&E.y>S.y&&--E.y,Math.abs(A.west-e.rectangle.east)<b&&E.x>S.x&&--E.x;var P,D=h.clone(e.rectangle,W),M=w.tileXYToRectangle(S.x,S.y,v),I=h.intersection(M,l,G);s?(w.rectangleToNativeRectangle(D,D),w.rectangleToNativeRectangle(M,M),w.rectangleToNativeRectangle(I,I),w.rectangleToNativeRectangle(l,l),P=w.tileXYToNativeRectangle.bind(w),b=D.width/512,T=D.height/512):P=w.tileXYToRectangle.bind(w);var R,O,L=0,B=1;!this.isBaseLayer()&&Math.abs(I.west-D.west)>=b&&(L=Math.min(1,(I.west-D.west)/D.width)),!this.isBaseLayer()&&Math.abs(I.north-D.north)>=T&&(B=Math.max(0,(I.north-D.south)/D.height));for(var F=B,V=S.x;V<=E.x;V++)if(R=L,M=P(V,S.y,v),I=h.simpleIntersection(M,l,G),r(I)){L=Math.min(1,(I.east-D.west)/D.width),V===E.x&&(this.isBaseLayer()||Math.abs(I.east-D.east)<b)&&(L=1),B=F;for(var H=S.y;H<=E.y;H++)if(O=B,M=P(V,H,v),I=h.simpleIntersection(M,l,G),r(I)){B=Math.max(0,(I.south-D.south)/D.height),H===E.y&&(this.isBaseLayer()||Math.abs(I.south-D.south)<T)&&(B=0);var q=new t(R,B,L,O),j=this.getImageryFromCache(V,H,v);o.imagery.splice(n,0,new N(j,q,s)),++n}}return!0},L.prototype._calculateTextureTranslationAndScale=function(e,i){var r=i.readyImagery.rectangle,n=e.rectangle;if(i.useWebMercatorT){var o=i.readyImagery.imageryLayer.imageryProvider.tilingScheme;r=o.rectangleToNativeRectangle(r,z),n=o.rectangleToNativeRectangle(n,W)}var a=n.width,s=n.height,l=a/r.width,u=s/r.height;return new t(l*(n.west-r.west)/a,u*(n.south-r.south)/s,l,u)},L.prototype._requestImagery=function(e){function t(t){return r(t)?(e.image=t,e.state=O.RECEIVED,void p.handleSuccess(a._requestImageError)):i()}function i(t){e.state=O.FAILED;var i="Failed to obtain image tile X: "+e.x+" Y: "+e.y+" Level: "+e.level+".";a._requestImageError=p.handleError(a._requestImageError,o,o.errorEvent,i,e.x,e.y,e.level,n,t)}function n(){e.state=O.TRANSITIONING;var n=o.requestImage(e.x,e.y,e.level);return r(n)?(r(o.getTileCredits)&&(e.credits=o.getTileCredits(e.x,e.y,e.level)),void I(n,t,i)):void(e.state=O.UNLOADED)}var o=this._imageryProvider,a=this;n()},L.prototype._createTexture=function(e,t){var i=this._imageryProvider;if(r(i.tileDiscardPolicy)){var n=i.tileDiscardPolicy;if(r(n)){if(!n.isReady())return void(t.state=O.RECEIVED);if(n.shouldDiscardImage(t.image))return void(t.state=O.INVALID)}}var o=new b({context:e,source:t.image,pixelFormat:i.hasAlphaChannel?c.RGBA:c.RGB});i.tilingScheme instanceof f?t.textureWebMercator=o:t.texture=o,t.image=void 0,t.state=O.TEXTURE_LOADED},L.prototype._reprojectTexture=function(e,t,r){var n=t.textureWebMercator||t.texture,o=t.rectangle,a=e.context;if(r=i(r,!0),r&&!(this._imageryProvider.tilingScheme instanceof s)&&o.width/n.width>1e-5){var l=this;t.addReference();var u=new v({persists:!0,owner:this,preExecute:function(e){V(e,a,n,t.rectangle)},postExecute:function(e){t.texture=e,B(l,a,t,e),t.releaseReference()}});this._reprojectComputeCommands.push(u)}else r&&(t.texture=n),B(this,a,t,n)},L.prototype.queueReprojectionCommands=function(e){for(var t=this._reprojectComputeCommands,i=t.length,r=0;r<i;++r)e.commandList.push(t[r]);t.length=0},L.prototype.cancelReprojections=function(){this._reprojectComputeCommands.length=0},L.prototype.getImageryFromCache=function(e,t,i,n){var o=F(e,t,i),a=this._imageryCache[o];return r(a)||(a=new R(this,e,t,i,n),this._imageryCache[o]=a),a.addReference(),a},L.prototype.removeImageryFromCache=function(e){var t=F(e.x,e.y,e.level);delete this._imageryCache[t]};var H={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new e,texture:void 0},q=a.supportsTypedArrays()?new Float32Array(128):void 0;return L}),i("Scene/GlobeSurfaceTileProvider",["../Core/BoundingSphere","../Core/BoxOutlineGeometry","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/GeometryInstance","../Core/GeometryPipeline","../Core/IndexDatatype","../Core/Intersect","../Core/Math","../Core/Matrix4","../Core/OrientedBoundingBox","../Core/PrimitiveType","../Core/Rectangle","../Core/SphereOutlineGeometry","../Core/TerrainQuantization","../Core/Visibility","../Core/WebMercatorProjection","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/ContextLimits","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/VertexArray","../Scene/BlendingState","../Scene/DepthFunction","../Scene/PerInstanceColorAppearance","../Scene/Primitive","./GlobeSurfaceTile","./ImageryLayer","./QuadtreeTileLoadState","./SceneMode","./ShadowMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I,R,O,N,L,B,F,V,k,z,U){"use strict";function G(e){this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.hasWaterMask=!1,this.oceanNormalMap=void 0,this.zoomedOutOceanSpecularIntensity=.5,this.enableLighting=!1,this.shadows=U.RECEIVE_ONLY,this._quadtree=void 0,this._terrainProvider=e.terrainProvider,this._imageryLayers=e.imageryLayers,this._surfaceShaderSet=e.surfaceShaderSet,this._renderState=void 0,this._blendRenderState=void 0,this._pickRenderState=void 0,this._errorEvent=new d,this._imageryLayers.layerAdded.addEventListener(G.prototype._onLayerAdded,this),this._imageryLayers.layerRemoved.addEventListener(G.prototype._onLayerRemoved,this),this._imageryLayers.layerMoved.addEventListener(G.prototype._onLayerMoved,this),this._imageryLayers.layerShownOrHidden.addEventListener(G.prototype._onLayerShownOrHidden,this),this._layerOrderChanged=!1,this._tilesToRenderByTextureCount=[],this._drawCommands=[],this._uniformMaps=[],this._pickCommands=[],this._usedDrawCommands=0,this._usedPickCommands=0,this._vertexArraysToDestroy=[],this._debug={wireframe:!1,boundingSphereTile:void 0},this._baseColor=void 0,this._firstPassInitialColor=void 0,this.baseColor=new o(0,0,.5,1)}function W(e,t){var i=e.loadingImagery;l(i)||(i=e.readyImagery);var r=t.loadingImagery;return l(r)||(r=t.readyImagery),i.imageryLayer._layerIndex-r.imageryLayer._layerIndex}function H(e){var t=e.indexBuffer;e.destroy(),!t.isDestroyed()&&l(t.referenceCount)&&(--t.referenceCount,0===t.referenceCount&&t.destroy())}function q(e){var t={u_initialColor:function(){return this.properties.initialColor},u_zoomedOutOceanSpecularIntensity:function(){return this.properties.zoomedOutOceanSpecularIntensity},u_oceanNormalMap:function(){return this.properties.oceanNormalMap},u_lightingFadeDistance:function(){return this.properties.lightingFadeDistance},u_center3D:function(){return this.properties.center3D},u_tileRectangle:function(){return this.properties.tileRectangle},u_modifiedModelView:function(){var t=e.context.uniformState.view,i=v.multiplyByPoint(t,this.properties.rtc,te);return v.setTranslation(t,i,Q),Q},u_modifiedModelViewProjection:function(){var t=e.context.uniformState.view,i=e.context.uniformState.projection,r=v.multiplyByPoint(t,this.properties.rtc,te);return v.setTranslation(t,r,J),v.multiply(i,J,J),J},u_dayTextures:function(){return this.properties.dayTextures},u_dayTextureTranslationAndScale:function(){return this.properties.dayTextureTranslationAndScale},u_dayTextureTexCoordsRectangle:function(){return this.properties.dayTextureTexCoordsRectangle},u_dayTextureUseWebMercatorT:function(){return this.properties.dayTextureUseWebMercatorT},u_dayTextureAlpha:function(){return this.properties.dayTextureAlpha},u_dayTextureBrightness:function(){return this.properties.dayTextureBrightness},u_dayTextureContrast:function(){return this.properties.dayTextureContrast},u_dayTextureHue:function(){return this.properties.dayTextureHue},u_dayTextureSaturation:function(){return this.properties.dayTextureSaturation},u_dayTextureOneOverGamma:function(){return this.properties.dayTextureOneOverGamma},u_dayIntensity:function(){return this.properties.dayIntensity},u_southAndNorthLatitude:function(){return this.properties.southAndNorthLatitude},u_southMercatorYAndOneOverHeight:function(){return this.properties.southMercatorYAndOneOverHeight},u_waterMask:function(){return this.properties.waterMask},u_waterMaskTranslationAndScale:function(){return this.properties.waterMaskTranslationAndScale},u_minMaxHeight:function(){return this.properties.minMaxHeight},u_scaleAndBias:function(){return this.properties.scaleAndBias},properties:{initialColor:new n(0,0,.5,1),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new i(65e5,9e6),center3D:void 0,rtc:new r,modifiedModelView:new v,tileRectangle:new n,dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayIntensity:0,southAndNorthLatitude:new i,southMercatorYAndOneOverHeight:new i,waterMask:void 0,waterMaskTranslationAndScale:new n,minMaxHeight:new i,scaleAndBias:new v}};return t}function j(e,t,i){var r=i.data;l(r.wireframeVertexArray)||l(r.terrainData)&&l(r.terrainData._mesh)&&(r.wireframeVertexArray=Y(e,r.vertexArray,r.terrainData._mesh))}function Y(e,t,i){var r={indices:i.indices,primitiveType:C.TRIANGLES};m.toWireframe(r);var n=r.indices,o=x.createIndexBuffer({context:e,typedArray:n,usage:A.STATIC_DRAW,indexDatatype:f.UNSIGNED_SHORT});return new R({context:e,attributes:t._attributes,indexBuffer:o})}function X(t,i,a){var s=i.data,u=P.maximumTextureImageUnits,c=s.waterMaskTexture,h=t.hasWaterMask&&l(c),d=t.oceanNormalMap,p=h&&l(d),m=t.terrainProvider.ready&&t.terrainProvider.hasVertexNormals,f=a.fog.enabled,_=U.castShadows(t.shadows),S=U.receiveShadows(t.shadows);h&&--u,p&&--u;var b=s.center,x=s.pickTerrain.mesh.encoding,A=$,I=0,R=0,O=0,N=0,L=!1;if(a.mode!==z.SCENE3D){var B=a.mapProjection,F=B.project(w.southwest(i.rectangle),ie),k=B.project(w.northeast(i.rectangle),re);if(A.x=F.x,A.y=F.y,A.z=k.x,A.w=k.y,a.mode!==z.MORPHING&&(b=ee,b.x=0,b.y=.5*(A.z+A.x),b.z=.5*(A.w+A.y),A.x-=b.y,A.y-=b.z,A.z-=b.y,A.w-=b.z),a.mode===z.SCENE2D&&x.quantization===E.BITS12){var G=1/(Math.pow(2,12)-1)*.5,W=(A.z-A.x)*G,H=(A.w-A.y)*G;A.x-=W,A.y-=H,A.z+=W,A.w+=H}B instanceof T&&(I=i.rectangle.south,R=i.rectangle.north,O=T.geodeticLatitudeToMercatorAngle(I),N=1/(T.geodeticLatitudeToMercatorAngle(R)-O),L=!0)}var Y=s.imagery,X=0,Z=Y.length,K=t._renderState,Q=t._blendRenderState,J=K,te=t._firstPassInitialColor,le=a.context;l(t._debug.boundingSphereTile)||ae();do{var ue,ce,he=0;t._drawCommands.length<=t._usedDrawCommands?(ue=new D,ue.owner=i,ue.cull=!1,ue.boundingVolume=new e,ue.orientedBoundingBox=void 0,ce=q(a),t._drawCommands.push(ue),t._uniformMaps.push(ce)):(ue=t._drawCommands[t._usedDrawCommands],ce=t._uniformMaps[t._usedDrawCommands]),ue.owner=i,++t._usedDrawCommands,i===t._debug.boundingSphereTile&&(l(s.orientedBoundingBox)?ne(s.orientedBoundingBox,o.RED).update(a):l(s.boundingSphere3D)&&oe(s.boundingSphere3D,o.RED).update(a));var de=ce.properties;n.clone(te,de.initialColor),de.oceanNormalMap=d,de.lightingFadeDistance.x=t.lightingFadeOutDistance,de.lightingFadeDistance.y=t.lightingFadeInDistance,de.zoomedOutOceanSpecularIntensity=t.zoomedOutOceanSpecularIntensity,de.center3D=s.center,r.clone(b,de.rtc),n.clone(A,de.tileRectangle),de.southAndNorthLatitude.x=I,de.southAndNorthLatitude.y=R,de.southMercatorYAndOneOverHeight.x=O,de.southMercatorYAndOneOverHeight.y=N;for(var pe=f&&g.fog(i._distance,a.fog.density)>g.EPSILON3,me=!1,fe=!1,_e=!1,ge=!1,ve=!1,ye=!1;he<u&&X<Z;){var Ce=Y[X],we=Ce.readyImagery;if(++X,l(we)&&0!==we.imageryLayer.alpha){var Se=Ce.useWebMercatorT?we.textureWebMercator:we.texture,Ee=we.imageryLayer;if(l(Ce.textureTranslationAndScale)||(Ce.textureTranslationAndScale=Ee._calculateTextureTranslationAndScale(i,Ce)),de.dayTextures[he]=Se,de.dayTextureTranslationAndScale[he]=Ce.textureTranslationAndScale,de.dayTextureTexCoordsRectangle[he]=Ce.textureCoordinateRectangle,de.dayTextureUseWebMercatorT[he]=Ce.useWebMercatorT,de.dayTextureAlpha[he]=Ee.alpha,ye=ye||1!==de.dayTextureAlpha[he],de.dayTextureBrightness[he]=Ee.brightness,me=me||de.dayTextureBrightness[he]!==V.DEFAULT_BRIGHTNESS,de.dayTextureContrast[he]=Ee.contrast,fe=fe||de.dayTextureContrast[he]!==V.DEFAULT_CONTRAST,de.dayTextureHue[he]=Ee.hue,_e=_e||de.dayTextureHue[he]!==V.DEFAULT_HUE,de.dayTextureSaturation[he]=Ee.saturation,ge=ge||de.dayTextureSaturation[he]!==V.DEFAULT_SATURATION,de.dayTextureOneOverGamma[he]=1/Ee.gamma,ve=ve||de.dayTextureOneOverGamma[he]!==1/V.DEFAULT_GAMMA,l(we.credits))for(var be=a.creditDisplay,Te=we.credits,xe=0,Ae=Te.length;xe<Ae;++xe)be.addCredit(Te[xe]); -++he}}de.dayTextures.length=he,de.waterMask=c,n.clone(s.waterMaskTranslationAndScale,de.waterMaskTranslationAndScale),de.minMaxHeight.x=x.minimumHeight,de.minMaxHeight.y=x.maximumHeight,v.clone(x.matrix,de.scaleAndBias),ue.shaderProgram=t._surfaceShaderSet.getShaderProgram(a,s,he,me,fe,_e,ge,ve,ye,h,p,t.enableLighting,m,L,pe),ue.castShadows=_,ue.receiveShadows=S,ue.renderState=J,ue.primitiveType=C.TRIANGLES,ue.vertexArray=s.vertexArray,ue.uniformMap=ce,ue.pass=M.GLOBE,t._debug.wireframe&&(j(le,t,i),l(s.wireframeVertexArray)&&(ue.vertexArray=s.wireframeVertexArray,ue.primitiveType=C.LINES));var Pe=ue.boundingVolume,De=ue.orientedBoundingBox;a.mode!==z.SCENE3D?(e.fromRectangleWithHeights2D(i.rectangle,a.mapProjection,s.minimumHeight,s.maximumHeight,Pe),r.fromElements(Pe.center.z,Pe.center.x,Pe.center.y,Pe.center),a.mode===z.MORPHING&&(Pe=e.union(s.boundingSphere3D,Pe,Pe))):(ue.boundingVolume=e.clone(s.boundingSphere3D,Pe),ue.orientedBoundingBox=y.clone(s.orientedBoundingBox,De)),a.commandList.push(ue),J=Q,te=se}while(X<Z)}function Z(e,t,i){var r;e._pickCommands.length<=e._usedPickCommands?(r=new D,r.cull=!1,e._pickCommands.push(r)):r=e._pickCommands[e._usedPickCommands],++e._usedPickCommands;var n=t.owner.data,o=i.projection instanceof T;r.shaderProgram=e._surfaceShaderSet.getPickShaderProgram(i,n,o),r.renderState=e._pickRenderState,r.owner=t.owner,r.primitiveType=t.primitiveType,r.vertexArray=t.vertexArray,r.uniformMap=t.uniformMap,r.boundingVolume=t.boundingVolume,r.orientedBoundingBox=t.orientedBoundingBox,r.pass=t.pass,i.commandList.push(r)}u(G.prototype,{baseColor:{get:function(){return this._baseColor},set:function(e){this._baseColor=e,this._firstPassInitialColor=n.fromColor(e,this._firstPassInitialColor)}},quadtree:{get:function(){return this._quadtree},set:function(e){this._quadtree=e}},ready:{get:function(){return this._terrainProvider.ready&&(0===this._imageryLayers.length||this._imageryLayers.get(0).imageryProvider.ready)}},tilingScheme:{get:function(){return this._terrainProvider.tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){this._terrainProvider!==e&&(this._terrainProvider=e,l(this._quadtree)&&this._quadtree.invalidateAllTiles())}}}),G.prototype.initialize=function(e){var t=this._imageryLayers;t._update(),t.queueReprojectionCommands(e),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(e){e.data.imagery.sort(W)}));var i=e.creditDisplay;this._terrainProvider.ready&&l(this._terrainProvider.credit)&&i.addCredit(this._terrainProvider.credit);for(var r=0,n=t.length;r<n;++r){var o=t.get(r).imageryProvider;o.ready&&l(o.credit)&&i.addCredit(o.credit)}for(var a=this._vertexArraysToDestroy,s=a.length,u=0;u<s;++u)H(a[u]);a.length=0},G.prototype.beginUpdate=function(e){for(var t=this._tilesToRenderByTextureCount,i=0,r=t.length;i<r;++i){var n=t[i];l(n)&&(n.length=0)}this._usedDrawCommands=0},G.prototype.endUpdate=function(e){l(this._renderState)||(this._renderState=I.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:N.LESS}}),this._blendRenderState=I.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:N.LESS_OR_EQUAL},blending:O.ALPHA_BLEND}));for(var t=this._tilesToRenderByTextureCount,i=0,r=t.length;i<r;++i){var n=t[i];if(l(n))for(var o=0,a=n.length;o<a;++o)X(this,n[o],e)}},G.prototype.updateForPick=function(e){l(this._pickRenderState)||(this._pickRenderState=I.fromCache({colorMask:{red:!1,green:!1,blue:!1,alpha:!1},depthTest:{enabled:!0}})),this._usedPickCommands=0;for(var t=this._drawCommands,i=0,r=this._usedDrawCommands;i<r;++i)Z(this,t[i],e)},G.prototype.cancelReprojections=function(){this._imageryLayers.cancelReprojections()},G.prototype.getLevelMaximumGeometricError=function(e){return this._terrainProvider.getLevelMaximumGeometricError(e)},G.prototype.loadTile=function(e,t){F.processStateMachine(t,e,this._terrainProvider,this._imageryLayers,this._vertexArraysToDestroy)};var K=new e;G.prototype.computeTileVisibility=function(t,i,n){var o=this.computeDistanceToTile(t,i);if(t._distance=o,i.fog.enabled&&g.fog(o,i.fog.density)>=1)return b.NONE;var a=t.data,u=i.cullingVolume,c=s(a.orientedBoundingBox,a.boundingSphere3D);i.mode!==z.SCENE3D&&(c=K,e.fromRectangleWithHeights2D(t.rectangle,i.mapProjection,a.minimumHeight,a.maximumHeight,c),r.fromElements(c.center.z,c.center.x,c.center.y,c.center),i.mode===z.MORPHING&&(c=e.union(a.boundingSphere3D,c,c)));var h=u.computeVisibility(c);if(h===_.OUTSIDE)return b.NONE;if(i.mode===z.SCENE3D){var d=a.occludeePointInScaledSpace;return l(d)?n.ellipsoid.isScaledSpacePointVisible(d)?h:b.NONE:h}return h};var Q=new v,J=new v,$=new n,ee=new r,te=new r,ie=new r,re=new r;G.prototype.showTileThisFrame=function(e,t){for(var i=0,r=e.data.imagery,n=0,o=r.length;n<o;++n){var a=r[n];l(a.readyImagery)&&0!==a.readyImagery.imageryLayer.alpha&&++i}var s=this._tilesToRenderByTextureCount[i];l(s)||(s=[],this._tilesToRenderByTextureCount[i]=s),s.push(e);var u=this._debug;++u.tilesRendered,u.texturesRendered+=i},G.prototype.computeDistanceToTile=function(e,t){var i=e.data,r=i.tileBoundingBox;return r.distanceToCamera(t)},G.prototype.isDestroyed=function(){return!1},G.prototype.destroy=function(){return this._tileProvider=this._tileProvider&&this._tileProvider.destroy(),c(this)},G.prototype._onLayerAdded=function(e,t){if(e.show){var i=this._terrainProvider;this._quadtree.forEachLoadedTile(function(t){e._createTileImagerySkeletons(t,i)&&(t.state=k.LOADING)}),this._layerOrderChanged=!0}},G.prototype._onLayerRemoved=function(e,t){this._quadtree.forEachLoadedTile(function(t){for(var i=t.data.imagery,r=-1,n=0,o=0,a=i.length;o<a;++o){var s=i[o],u=s.loadingImagery;if(l(u)||(u=s.readyImagery),u.imageryLayer===e)r===-1&&(r=o),s.freeResources(),++n;else if(r!==-1)break}r!==-1&&i.splice(r,n)})},G.prototype._onLayerMoved=function(e,t,i){this._layerOrderChanged=!0},G.prototype._onLayerShownOrHidden=function(e,t,i){i?this._onLayerAdded(e,t):this._onLayerRemoved(e,t)};var ne,oe,ae;!function(){function e(e){return new B({geometryInstances:e,appearance:new L({translucent:!1,flat:!0}),asynchronous:!1})}var i,n,o=new p({geometry:t.fromDimensions({dimensions:new r(2,2,2)})}),s=new p({geometry:new S({radius:1})}),u=new v;ne=function(t,r){return t===i?n:(ae(),i=t,u=v.fromRotationTranslation(t.halfAxes,t.center,u),o.modelMatrix=u,o.attributes.color=a.fromColor(r),n=e(o))},oe=function(t,r){return t===i?n:(ae(),i=t,u=v.fromTranslation(t.center,u),u=v.multiplyByUniformScale(u,t.radius,u),s.modelMatrix=u,s.attributes.color=a.fromColor(r),n=e(s))},ae=function(){l(n)&&(n.destroy(),n=void 0,i=void 0)}}();var se=new n(0,0,0,0);return G}),i("Scene/ImageryLayerCollection",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/Math","../Core/Rectangle","../ThirdParty/when","./ImageryLayer"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(){this._layers=[],this.layerAdded=new o,this.layerRemoved=new o,this.layerMoved=new o,this.layerShownOrHidden=new o}function h(e,t){var i=e.indexOf(t);return i}function d(e,t,i){var r=e._layers;if(t=a.clamp(t,0,r.length-1),i=a.clamp(i,0,r.length-1),t!==i){var n=r[t];r[t]=r[i],r[i]=n,e._update(),e.layerMoved.raiseEvent(n,i,t)}}i(c.prototype,{length:{get:function(){return this._layers.length}}}),c.prototype.add=function(e,i){var r=t(i);r?this._layers.splice(i,0,e):(i=this._layers.length,this._layers.push(e)),this._update(),this.layerAdded.raiseEvent(e,i)},c.prototype.addImageryProvider=function(e,t){var i=new u(e);return this.add(i,t),i},c.prototype.remove=function(t,i){i=e(i,!0);var r=this._layers.indexOf(t);return r!==-1&&(this._layers.splice(r,1),this._update(),this.layerRemoved.raiseEvent(t,r),i&&t.destroy(),!0)},c.prototype.removeAll=function(t){t=e(t,!0);for(var i=this._layers,r=0,n=i.length;r<n;r++){var o=i[r];this.layerRemoved.raiseEvent(o,r),t&&o.destroy()}this._layers=[]},c.prototype.contains=function(e){return this.indexOf(e)!==-1},c.prototype.indexOf=function(e){return this._layers.indexOf(e)},c.prototype.get=function(e){return this._layers[e]},c.prototype.raise=function(e){var t=h(this._layers,e);d(this,t,t+1)},c.prototype.lower=function(e){var t=h(this._layers,e);d(this,t,t-1)},c.prototype.raiseToTop=function(e){var t=h(this._layers,e);t!==this._layers.length-1&&(this._layers.splice(t,1),this._layers.push(e),this._update(),this.layerMoved.raiseEvent(e,this._layers.length-1,t))},c.prototype.lowerToBottom=function(e){var t=h(this._layers,e);0!==t&&(this._layers.splice(t,1),this._layers.splice(0,0,e),this._update(),this.layerMoved.raiseEvent(e,0,t))};var p=new s;return c.prototype.pickImageryLayerFeatures=function(e,i){var r=i.globe.pick(e,i);if(t(r)){for(var n,o=i.globe.ellipsoid.cartesianToCartographic(r),u=i.globe._surface._tilesToRender,c=0;!t(n)&&c<u.length;++c){var h=u[c];s.contains(h.rectangle,o)&&(n=h)}if(t(n)){for(var d=n.data.imagery,m=[],f=[],_=d.length-1;_>=0;--_){var g=d[_],v=g.readyImagery;if(t(v)){var y=v.imageryLayer.imageryProvider;if(t(y.pickFeatures)&&s.contains(v.rectangle,o)){var C=p,w=1/1024;if(C.west=a.lerp(n.rectangle.west,n.rectangle.east,g.textureCoordinateRectangle.x-w),C.east=a.lerp(n.rectangle.west,n.rectangle.east,g.textureCoordinateRectangle.z+w),C.south=a.lerp(n.rectangle.south,n.rectangle.north,g.textureCoordinateRectangle.y-w),C.north=a.lerp(n.rectangle.south,n.rectangle.north,g.textureCoordinateRectangle.w+w),s.contains(C,o)){var S=y.pickFeatures(v.x,v.y,v.level,o.longitude,o.latitude);t(S)&&(m.push(S),f.push(v.imageryLayer))}}}}if(0!==m.length)return l.all(m,function(e){for(var i=[],r=0;r<e.length;++r){var n=e[r],a=f[r];if(t(n)&&n.length>0)for(var s=0;s<n.length;++s){var l=n[s];l.imageryLayer=a,t(l.position)||(l.position=o),i.push(l)}}return i})}}},c.prototype.queueReprojectionCommands=function(e){for(var t=this._layers,i=0,r=t.length;i<r;++i)t[i].queueReprojectionCommands(e)},c.prototype.cancelReprojections=function(){for(var e=this._layers,t=0,i=e.length;t<i;++t)e[t].cancelReprojections()},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){return this.removeAll(!0),r(this)},c.prototype._update=function(){for(var e,i,r=!0,n=this._layers,o=0,a=n.length;o<a;++o)i=n[o],i._layerIndex=o,i.show?(i._isBaseLayer=r,r=!1):i._isBaseLayer=!1,i.show!==i._show&&(t(i._show)&&(t(e)||(e=[]),e.push(i)),i._show=i.show);if(t(e))for(o=0,a=e.length;o<a;++o)i=e[o],this.layerShownOrHidden.raiseEvent(i,i._layerIndex,i.show)},c}),i("Scene/QuadtreeOccluders",["../Core/Cartesian3","../Core/defineProperties","../Core/EllipsoidalOccluder"],function(e,t,i){"use strict";function r(t){this._ellipsoid=new i(t.ellipsoid,e.ZERO)}return t(r.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),r}),i("Scene/QuadtreeTile",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Rectangle","./QuadtreeTileLoadState"],function(e,t,i,r,n){"use strict";function o(e){this._tilingScheme=e.tilingScheme,this._x=e.x,this._y=e.y,this._level=e.level,this._parent=e.parent,this._rectangle=this._tilingScheme.tileXYToRectangle(this._x,this._y,this._level),this._southwestChild=void 0,this._southeastChild=void 0,this._northwestChild=void 0,this._northeastChild=void 0,this._replacementPrevious=void 0,this._replacementNext=void 0,this._distance=0,this._customData=[],this._frameUpdated=void 0,this._frameRendered=void 0,this.state=n.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}function a(t){e(t)&&t.freeResources()}return o.createLevelZeroTiles=function(e){for(var t=e.getNumberOfXTilesAtLevel(0),i=e.getNumberOfYTilesAtLevel(0),r=new Array(t*i),n=0,a=0;a<i;++a)for(var s=0;s<t;++s)r[n++]=new o({tilingScheme:e,x:s,y:a,level:0});return r},o.prototype._updateCustomData=function(t,i,n){var o,a,s,l=this.customData;if(e(i)&&e(n)){for(l=l.filter(function(e){return n.indexOf(e)===-1}),this._customData=l,s=this._rectangle,o=0;o<i.length;++o)a=i[o],r.contains(s,a.positionCartographic)&&l.push(a);this._frameUpdated=t}else{var u=this._parent;if(e(u)&&this._frameUpdated!==u._frameUpdated){l.length=0,s=this._rectangle;var c=u.customData;for(o=0;o<c.length;++o)a=c[o],r.contains(s,a.positionCartographic)&&l.push(a);this._frameUpdated=u._frameUpdated}}},t(o.prototype,{tilingScheme:{get:function(){return this._tilingScheme}},x:{get:function(){return this._x}},y:{get:function(){return this._y}},level:{get:function(){return this._level}},parent:{get:function(){return this._parent}},rectangle:{get:function(){return this._rectangle}},children:{get:function(){return[this.northwestChild,this.northeastChild,this.southwestChild,this.southeastChild]}},southwestChild:{get:function(){return e(this._southwestChild)||(this._southwestChild=new o({tilingScheme:this.tilingScheme,x:2*this.x,y:2*this.y+1,level:this.level+1,parent:this})),this._southwestChild}},southeastChild:{get:function(){return e(this._southeastChild)||(this._southeastChild=new o({tilingScheme:this.tilingScheme,x:2*this.x+1,y:2*this.y+1,level:this.level+1,parent:this})),this._southeastChild}},northwestChild:{get:function(){return e(this._northwestChild)||(this._northwestChild=new o({tilingScheme:this.tilingScheme,x:2*this.x,y:2*this.y,level:this.level+1,parent:this})),this._northwestChild}},northeastChild:{get:function(){return e(this._northeastChild)||(this._northeastChild=new o({tilingScheme:this.tilingScheme,x:2*this.x+1,y:2*this.y,level:this.level+1,parent:this})),this._northeastChild}},customData:{get:function(){return this._customData}},needsLoading:{get:function(){return this.state<n.DONE}},eligibleForUnloading:{get:function(){var t=!0;return e(this.data)&&(t=this.data.eligibleForUnloading,e(t)||(t=!0)),t}}}),o.prototype.freeResources=function(){this.state=n.START,this.renderable=!1,this.upsampledFromParent=!1,e(this.data)&&e(this.data.freeResources)&&this.data.freeResources(),a(this._southwestChild),this._southwestChild=void 0,a(this._southeastChild),this._southeastChild=void 0,a(this._northwestChild),this._northwestChild=void 0,a(this._northeastChild),this._northeastChild=void 0},o}),i("Scene/TileReplacementQueue",["../Core/defined"],function(e){"use strict";function t(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}function i(e,t){var i=t.replacementPrevious,r=t.replacementNext;t===e._lastBeforeStartOfFrame&&(e._lastBeforeStartOfFrame=r),t===e.head?e.head=r:i.replacementNext=r,t===e.tail?e.tail=i:r.replacementPrevious=i,t.replacementPrevious=void 0,t.replacementNext=void 0,--e.count}return t.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head},t.prototype.trimTiles=function(t){for(var r=this.tail,n=!0;n&&e(this._lastBeforeStartOfFrame)&&this.count>t&&e(r);){n=r!==this._lastBeforeStartOfFrame;var o=r.replacementPrevious;r.eligibleForUnloading&&(r.freeResources(),i(this,r)),r=o}},t.prototype.markTileRendered=function(t){var r=this.head;return r===t?void(t===this._lastBeforeStartOfFrame&&(this._lastBeforeStartOfFrame=t.replacementNext)):(++this.count,e(r)?((e(t.replacementPrevious)||e(t.replacementNext))&&i(this,t),t.replacementPrevious=void 0,t.replacementNext=r,r.replacementPrevious=t,void(this.head=t)):(t.replacementPrevious=void 0,t.replacementNext=void 0,this.head=t,void(this.tail=t)))},t}),i("Scene/QuadtreePrimitive",["../Core/Cartesian3","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/getTimestamp","../Core/Math","../Core/Queue","../Core/Ray","../Core/Rectangle","../Core/Visibility","./QuadtreeOccluders","./QuadtreeTile","./QuadtreeTileLoadState","./SceneMode","./TileReplacementQueue"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g){"use strict";function v(e){this._tileProvider=e.tileProvider,this._tileProvider.quadtree=this,this._debug={enableDebugOutput:!1,maxDepth:0,tilesVisited:0,tilesCulled:0,tilesRendered:0,tilesWaitingForChildren:0,lastMaxDepth:-1,lastTilesVisited:-1,lastTilesCulled:-1,lastTilesRendered:-1,lastTilesWaitingForChildren:-1,suspendLodUpdate:!1};var t=this._tileProvider.tilingScheme,r=t.ellipsoid;this._tilesToRender=[],this._tileLoadQueueHigh=[],this._tileLoadQueueMedium=[],this._tileLoadQueueLow=[],this._tileReplacementQueue=new g,this._levelZeroTiles=void 0,this._levelZeroTilesReady=!1,this._loadQueueTimeSlice=5,this._addHeightCallbacks=[],this._removeHeightCallbacks=[],this._tileToUpdateHeights=[],this._lastTileIndex=0,this._updateHeightsTimeSlice=2,this.maximumScreenSpaceError=i(e.maximumScreenSpaceError,2),this.tileCacheSize=i(e.tileCacheSize,100),this._occluders=new p({ellipsoid:r}),this._tileLoadProgressEvent=new a,this._lastTileLoadQueueLength=0}function y(e,t){var i=h.center(e.rectangle,L),r=i.longitude-N.longitude,n=i.latitude-N.latitude;i=h.center(t.rectangle,L);var o=i.longitude-N.longitude,a=i.latitude-N.latitude;return r*r+n*n-(o*o+a*a)}function C(e,t){var i=e._debug;if(!i.suspendLodUpdate){var n,o,a=e._tilesToRender;if(a.length=0,!r(e._levelZeroTiles)){if(!e._tileProvider.ready)return;var s=e._tileProvider.tilingScheme;e._levelZeroTiles=m.createLevelZeroTiles(s)}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;var l,u=e._tileProvider,c=e._occluders,h=e._levelZeroTiles;N=t.camera.positionCartographic,h.sort(y);var p=e._addHeightCallbacks,f=e._removeHeightCallbacks,_=t.frameNumber;if(p.length>0||f.length>0){for(n=0,o=h.length;n<o;++n)l=h[n],l._updateCustomData(_,p,f);p.length=0,f.length=0}for(n=0,o=h.length;n<o;++n)l=h[n],e._tileReplacementQueue.markTileRendered(l),l.renderable?u.computeTileVisibility(l,t,c)!==d.NONE?w(e,t,l):(l.needsLoading&&e._tileLoadQueueLow.push(l),++i.tilesCulled):(l.needsLoading&&e._tileLoadQueueHigh.push(l),++i.tilesWaitingForChildren);x(e)}}function w(e,t,i){var r=e._debug;if(++r.tilesVisited,e._tileReplacementQueue.markTileRendered(i),i._updateCustomData(t.frameNumber),i.level>r.maxDepth&&(r.maxDepth=i.level),A(e,t,i)<e.maximumScreenSpaceError)return i.needsLoading&&e._tileLoadQueueMedium.push(i),void D(e,i);var n=i.southwestChild,o=i.southeastChild,a=i.northwestChild,s=i.northeastChild,l=n.renderable&&o.renderable&&a.renderable&&s.renderable,u=n.upsampledFromParent&&o.upsampledFromParent&&a.upsampledFromParent&&s.upsampledFromParent;l?u?(D(e,i),S(e,t.camera.positionCartographic,n,o,a,s),i.needsLoading&&e._tileLoadQueueMedium.push(i)):(b(e,n,o,a,s,t),i.needsLoading&&e._tileLoadQueueLow.push(i)):(S(e,t.camera.positionCartographic,n,o,a,s),D(e,i),i.needsLoading&&e._tileLoadQueueLow.push(i))}function S(e,t,i,r,n,o){t.longitude<i.east?t.latitude<i.north?(E(e,i),E(e,r),E(e,n),E(e,o)):(E(e,n),E(e,i),E(e,o),E(e,r)):t.latitude<i.north?(E(e,r),E(e,i),E(e,o),E(e,n)):(E(e,o),E(e,n),E(e,r),E(e,i))}function E(e,t){e._tileReplacementQueue.markTileRendered(t),t.needsLoading&&(t.renderable?e._tileLoadQueueLow.push(t):e._tileLoadQueueHigh.push(t))}function b(e,t,i,r,n,o){var a=o.camera.positionCartographic,s=e._tileProvider,l=e._occluders;a.longitude<t.rectangle.east?a.latitude<t.rectangle.north?(T(e,t,s,o,l),T(e,i,s,o,l),T(e,r,s,o,l),T(e,n,s,o,l)):(T(e,r,s,o,l),T(e,t,s,o,l),T(e,n,s,o,l),T(e,i,s,o,l)):a.latitude<t.rectangle.north?(T(e,i,s,o,l),T(e,t,s,o,l),T(e,n,s,o,l),T(e,r,s,o,l)):(T(e,n,s,o,l),T(e,r,s,o,l),T(e,i,s,o,l),T(e,t,s,o,l))}function T(e,t,i,r,n){i.computeTileVisibility(t,r,n)!==d.NONE?w(e,r,t):(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t))}function x(e){var t=e._tileLoadQueueHigh.length+e._tileLoadQueueMedium.length+e._tileLoadQueueLow.length;t!==e._lastTileLoadQueueLength&&(e._tileLoadProgressEvent.raiseEvent(t),e._lastTileLoadQueueLength=t)}function A(e,t,i){if(t.mode===_.SCENE2D)return P(e,t,i);var r=e._tileProvider.getLevelMaximumGeometricError(i.level),n=i._distance,o=t.context.drawingBufferHeight,a=t.camera.frustum.sseDenominator,s=r*o/(n*a);return t.fog.enabled&&(s-=l.fog(n,t.fog.density)*t.fog.sse),s}function P(e,t,i){var r=t.camera,n=r.frustum,o=t.context,a=o.drawingBufferWidth,s=o.drawingBufferHeight,l=e._tileProvider.getLevelMaximumGeometricError(i.level),u=Math.max(n.top-n.bottom,n.right-n.left)/Math.max(a,s);return l/u}function D(e,t){e._tilesToRender.push(t),++e._debug.tilesRendered}function M(e,t){var i=e._tileLoadQueueHigh,r=e._tileLoadQueueMedium,n=e._tileLoadQueueLow,o=e._tileProvider;if(0!==i.length||0!==r.length||0!==n.length){e._tileReplacementQueue.trimTiles(e.tileCacheSize);var a=s()+e._loadQueueTimeSlice;I(e,t,o,a,i),I(e,t,o,a,r),I(e,t,o,a,n)}}function I(e,t,i,r,n){for(var o=0,a=n.length;o<a&&s()<r;++o){var l=n[o];e._tileReplacementQueue.markTileRendered(l),i.loadTile(t,l)}}function R(n,o){for(var a=n._tileToUpdateHeights,l=n._tileProvider.terrainProvider,u=s(),c=n._updateHeightsTimeSlice,d=u+c,p=o.mode,m=o.mapProjection,f=m.ellipsoid;a.length>0;){for(var g=a[0],v=g.customData,y=v.length,C=!1,w=n._lastTileIndex;w<y;++w){var S=v[w];if(g.level>S.level){if(r(S.positionOnEllipsoidSurface)||(S.positionOnEllipsoidSurface=e.fromRadians(S.positionCartographic.longitude,S.positionCartographic.latitude,0,f)),p===_.SCENE3D){var E=f.geodeticSurfaceNormal(S.positionOnEllipsoidSurface,B.direction),b=f.getSurfaceNormalIntersectionWithZAxis(S.positionOnEllipsoidSurface,11500,B.origin);if(!r(b)){var T=Math.min(i(g.data.minimumHeight,0),-11500),x=e.multiplyByScalar(E,Math.abs(T)+1,V);e.subtract(S.positionOnEllipsoidSurface,x,B.origin)}}else t.clone(S.positionCartographic,F),F.height=-11500,m.project(F,V),e.fromElements(V.z,V.x,V.y,V),e.clone(V,B.origin),e.clone(e.UNIT_X,B.direction);var A=g.data.pick(B,p,m,!1,V);r(A)&&S.callback(A),S.level=g.level}else if(g.level===S.level){for(var P,D=g.children,M=D.length,I=0;I<M&&(P=D[I],!h.contains(P.rectangle,S.positionCartographic));++I);var R=l.getTileDataAvailable(P.x,P.y,P.level),O=g.parent;(r(R)&&!R||r(O)&&r(O.data)&&r(O.data.terrainData)&&!O.data.terrainData.isChildAvailable(O.x,O.y,P.x,P.y))&&S.removeFunc()}if(s()>=d){C=!0;break}}if(C){n._lastTileIndex=w;break}n._lastTileIndex=0,a.shift()}}function O(e,t){for(var i=e._tileProvider,r=e._tilesToRender,n=e._tileToUpdateHeights,o=0,a=r.length;o<a;++o){var s=r[o];i.showTileThisFrame(s,t),s._frameRendered!==t.frameNumber-1&&n.push(s),s._frameRendered=t.frameNumber}}n(v.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}}}),v.prototype.invalidateAllTiles=function(){var e=this._tileReplacementQueue;e.head=void 0,e.tail=void 0,e.count=0;var t=this._levelZeroTiles;if(r(t))for(var i=0;i<t.length;++i){for(var n=t[i],o=n.customData,a=o.length,s=0;s<a;++s){var l=o[s];l.level=0,this._addHeightCallbacks.push(l)}t[i].freeResources()}this._levelZeroTiles=void 0,this._tileProvider.cancelReprojections()},v.prototype.forEachLoadedTile=function(e){for(var t=this._tileReplacementQueue.head;r(t);)t.state!==f.START&&e(t),t=t.replacementNext},v.prototype.forEachRenderedTile=function(e){for(var t=this._tilesToRender,i=0,r=t.length;i<r;++i)e(t[i])},v.prototype.updateHeight=function(e,t){var i=this,r={positionOnEllipsoidSurface:void 0,positionCartographic:e,level:-1,callback:t};return r.removeFunc=function(){for(var e=i._addHeightCallbacks,t=e.length,n=0;n<t;++n)if(e[n]===r){e.splice(n,1);break}i._removeHeightCallbacks.push(r)},i._addHeightCallbacks.push(r),r.removeFunc},v.prototype.beginFrame=function(e){var t=e.passes;if(t.render){this._tileProvider.initialize(e);var i=this._debug;i.suspendLodUpdate||(i.maxDepth=0,i.tilesVisited=0,i.tilesCulled=0,i.tilesRendered=0,i.tilesWaitingForChildren=0,this._tileLoadQueueHigh.length=0,this._tileLoadQueueMedium.length=0,this._tileLoadQueueLow.length=0,this._tileReplacementQueue.markStartOfRenderFrame())}},v.prototype.update=function(e){var t=e.passes;t.render&&(this._tileProvider.beginUpdate(e),C(this,e),O(this,e),this._tileProvider.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&this._tileProvider.updateForPick(e)},v.prototype.endFrame=function(e){var t=e.passes;if(t.render&&e.mode!==_.MORPHING){M(this,e),R(this,e);var i=this._debug;i.suspendLodUpdate||i.enableDebugOutput&&(i.tilesVisited===i.lastTilesVisited&&i.tilesRendered===i.lastTilesRendered&&i.tilesCulled===i.lastTilesCulled&&i.maxDepth===i.lastMaxDepth&&i.tilesWaitingForChildren===i.lastTilesWaitingForChildren||(console.log("Visited "+i.tilesVisited+", Rendered: "+i.tilesRendered+", Culled: "+i.tilesCulled+", Max Depth: "+i.maxDepth+", Waiting for children: "+i.tilesWaitingForChildren),i.lastTilesVisited=i.tilesVisited,i.lastTilesRendered=i.tilesRendered,i.lastTilesCulled=i.tilesCulled,i.lastMaxDepth=i.maxDepth,i.lastTilesWaitingForChildren=i.tilesWaitingForChildren))}},v.prototype.isDestroyed=function(){return!1},v.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var N,L=new t,B=new c,F=new t,V=new e;return v}),i("Scene/Globe",["../Core/BoundingSphere","../Core/buildModuleUrl","../Core/Cartesian3","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Ellipsoid","../Core/EllipsoidTerrainProvider","../Core/Event","../Core/IntersectionTests","../Core/loadImage","../Core/Math","../Core/Ray","../Core/Rectangle","../Renderer/ShaderSource","../Renderer/Texture","../Shaders/GlobeFS","../Shaders/GlobeVS","../Shaders/GroundAtmosphere","../ThirdParty/when","./GlobeSurfaceShaderSet","./GlobeSurfaceTileProvider","./ImageryLayerCollection","./QuadtreePrimitive","./SceneMode","./ShadowMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A,P){"use strict";function D(e){e=n(e,u.WGS84);var i=new c({ellipsoid:e}),r=new T;this._ellipsoid=e,this._imageryLayerCollection=r,this._surfaceShaderSet=new E,this._surfaceShaderSet.baseVertexShaderSource=new g({sources:[w,C]}),this._surfaceShaderSet.baseFragmentShaderSource=new g({sources:[y]}),this._surface=new x({tileProvider:new b({terrainProvider:i,imageryLayers:r,surfaceShaderSet:this._surfaceShaderSet})}),this._terrainProvider=i,this._terrainProviderChanged=new h,this.show=!0,this.oceanNormalMapUrl=t("Assets/Textures/waterNormalsSmall.jpg"),this._oceanNormalMapUrl=void 0,this.maximumScreenSpaceError=2,this.tileCacheSize=100,this.enableLighting=!1,this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.showWaterEffect=!0,this.depthTestAgainstTerrain=!1,this.shadows=P.RECEIVE_ONLY,this._oceanNormalMap=void 0,this._zoomedOutOceanSpecularIntensity=.5}function M(t){return function(i,r){var n=e.distanceSquaredTo(i.pickBoundingSphere,t),o=e.distanceSquaredTo(r.pickBoundingSphere,t);return n-o}}function I(e,t){return _.contains(e.rectangle,t)?e:void 0}a(D.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},imageryLayers:{get:function(){return this._imageryLayerCollection}},baseColor:{get:function(){return this._surface.tileProvider.baseColor},set:function(e){this._surface.tileProvider.baseColor=e}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){e!==this._terrainProvider&&(this._terrainProvider=e,this._terrainProviderChanged.raiseEvent(e))}},terrainProviderChanged:{get:function(){return this._terrainProviderChanged}},tileLoadProgressEvent:{get:function(){return this._surface.tileLoadProgressEvent}}});var R=[],O={start:0,stop:0};D.prototype.pick=function(t,r,n){var a=r.mode,s=r.mapProjection,l=R;l.length=0;var u,c,h=this._surface._tilesToRender,p=h.length;for(c=0;c<p;++c){u=h[c];var m=u.data;if(o(m)){var f=m.pickBoundingSphere;a!==A.SCENE3D?(e.fromRectangleWithHeights2D(u.rectangle,s,m.minimumHeight,m.maximumHeight,f),i.fromElements(f.center.z,f.center.x,f.center.y,f.center)):e.clone(m.boundingSphere3D,f);var _=d.raySphere(t,f,O);o(_)&&l.push(m)}}l.sort(M(t.origin));var g;for(p=l.length,c=0;c<p&&(g=l[c].pick(t,r.mode,r.mapProjection,!0,n),!o(g));++c);return g};var N=new i,L=new i,B=new r,F=new f;return D.prototype.getHeight=function(e){var t=this._surface._levelZeroTiles;if(o(t)){var r,a,s=t.length;for(a=0;a<s&&(r=t[a],!_.contains(r.rectangle,e));++a);if(o(r)&&_.contains(r.rectangle,e)){for(;r.renderable;)r=I(r.southwestChild,e)||I(r.southeastChild,e)||I(r.northwestChild,e)||r.northeastChild;for(;o(r)&&(!o(r.data)||!o(r.data.pickTerrain));)r=r.parent;if(o(r)){var l=this._surface._tileProvider.tilingScheme.ellipsoid,u=i.fromRadians(e.longitude,e.latitude,0,l,N),c=F,h=l.geodeticSurfaceNormal(u,c.direction),d=l.getSurfaceNormalIntersectionWithZAxis(u,11500,c.origin);if(!o(d)){var p=Math.min(n(r.data.minimumHeight,0),-11500),m=i.multiplyByScalar(h,Math.abs(p)+1,L);i.subtract(u,m,c.origin)}var f=r.data.pick(c,void 0,void 0,!1,L);if(o(f))return l.cartesianToCartographic(f,B).height}}}},D.prototype.beginFrame=function(e){if(this.show){var t=this._surface,i=t.tileProvider,r=this.terrainProvider,n=this.showWaterEffect&&r.ready&&r.hasWaterMask;if(n&&this.oceanNormalMapUrl!==this._oceanNormalMapUrl){var a=this.oceanNormalMapUrl;if(this._oceanNormalMapUrl=a,o(a)){var s=this;S(p(a),function(t){a===s.oceanNormalMapUrl&&(s._oceanNormalMap=s._oceanNormalMap&&s._oceanNormalMap.destroy(),s._oceanNormalMap=new v({context:e.context,source:t}))})}else this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy()}var l=e.mode,u=e.passes;u.render&&(l===A.SCENE3D?this._zoomedOutOceanSpecularIntensity=.5:this._zoomedOutOceanSpecularIntensity=0,t.maximumScreenSpaceError=this.maximumScreenSpaceError,t.tileCacheSize=this.tileCacheSize,i.terrainProvider=this.terrainProvider,i.lightingFadeOutDistance=this.lightingFadeOutDistance,i.lightingFadeInDistance=this.lightingFadeInDistance,i.zoomedOutOceanSpecularIntensity=this._zoomedOutOceanSpecularIntensity,i.hasWaterMask=n,i.oceanNormalMap=this._oceanNormalMap,i.enableLighting=this.enableLighting,i.shadows=this.shadows,t.beginFrame(e))}},D.prototype.update=function(e){if(this.show){var t=this._surface,i=e.passes;i.render&&t.update(e),i.pick&&t.update(e)}},D.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)},D.prototype.isDestroyed=function(){return!1},D.prototype.destroy=function(){return this._surfaceShaderSet=this._surfaceShaderSet&&this._surfaceShaderSet.destroy(),this._surface=this._surface&&this._surface.destroy(),this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy(),s(this)},D}),i("Shaders/PostProcessFilters/PassThrough",[],function(){"use strict";return"uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = texture2D(u_texture, v_textureCoordinates);\n}\n"}),i("Scene/GlobeDepth",["../Core/BoundingRectangle","../Core/Color","../Core/defined","../Core/destroyObject","../Core/PixelFormat","../Renderer/ClearCommand","../Renderer/Framebuffer","../Renderer/PixelDatatype","../Renderer/RenderState","../Renderer/Texture","../Shaders/PostProcessFilters/PassThrough"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(){this._colorTexture=void 0,this._depthStencilTexture=void 0,this._globeDepthTexture=void 0,this.framebuffer=void 0,this._copyDepthFramebuffer=void 0,this._clearColorCommand=void 0,this._copyColorCommand=void 0,this._copyDepthCommand=void 0,this._viewport=new e,this._rs=void 0,this._debugGlobeDepthViewportCommand=void 0}function d(e,t,r){if(!i(e._debugGlobeDepthViewportCommand)){var n="uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n float z_window = czm_unpackDepth(texture2D(u_texture, v_textureCoordinates));\n float n_range = czm_depthRange.near;\n float f_range = czm_depthRange.far;\n float z_ndc = (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n float scale = pow(z_ndc * 0.5 + 0.5, 8.0);\n gl_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0);\n}\n";e._debugGlobeDepthViewportCommand=t.createViewportQuadCommand(n,{uniformMap:{u_texture:function(){return e._globeDepthTexture}},owner:e})}e._debugGlobeDepthViewportCommand.execute(t,r)}function p(e){e._colorTexture=e._colorTexture&&!e._colorTexture.isDestroyed()&&e._colorTexture.destroy(),e._depthStencilTexture=e._depthStencilTexture&&!e._depthStencilTexture.isDestroyed()&&e._depthStencilTexture.destroy(), -e._globeDepthTexture=e._globeDepthTexture&&!e._globeDepthTexture.isDestroyed()&&e._globeDepthTexture.destroy()}function m(e){e.framebuffer=e.framebuffer&&!e.framebuffer.isDestroyed()&&e.framebuffer.destroy(),e._copyDepthFramebuffer=e._copyDepthFramebuffer&&!e._copyDepthFramebuffer.isDestroyed()&&e._copyDepthFramebuffer.destroy()}function f(e,t,i,r){e._colorTexture=new u({context:t,width:i,height:r,pixelFormat:n.RGBA,pixelDatatype:s.UNSIGNED_BYTE}),e._depthStencilTexture=new u({context:t,width:i,height:r,pixelFormat:n.DEPTH_STENCIL,pixelDatatype:s.UNSIGNED_INT_24_8}),e._globeDepthTexture=new u({context:t,width:i,height:r,pixelFormat:n.RGBA,pixelDatatype:s.UNSIGNED_BYTE})}function _(e,t,i,r){e.framebuffer=new a({context:t,colorTextures:[e._colorTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._copyDepthFramebuffer=new a({context:t,colorTextures:[e._globeDepthTexture],destroyAttachments:!1})}function g(e,t,r,n){var o=e._colorTexture,a=!i(o)||o.width!==r||o.height!==n;i(e.framebuffer)&&!a||(p(e),m(e),f(e,t,r,n),_(e,t,r,n))}function v(r,n,a,s){if(r._viewport.width=a,r._viewport.height=s,i(r._rs)&&e.equals(r._viewport,r._rs.viewport)||(r._rs=l.fromCache({viewport:r._viewport})),!i(r._copyDepthCommand)){var u="uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n gl_FragColor = czm_packDepth(texture2D(u_texture, v_textureCoordinates).r);\n}\n";r._copyDepthCommand=n.createViewportQuadCommand(u,{uniformMap:{u_texture:function(){return r._depthStencilTexture}},owner:r})}r._copyDepthCommand.framebuffer=r._copyDepthFramebuffer,i(r._copyColorCommand)||(r._copyColorCommand=n.createViewportQuadCommand(c,{uniformMap:{u_texture:function(){return r._colorTexture}},owner:r})),r._copyDepthCommand.renderState=r._rs,r._copyColorCommand.renderState=r._rs,i(r._clearColorCommand)||(r._clearColorCommand=new o({color:new t(0,0,0,0),stencil:0,owner:r})),r._clearColorCommand.framebuffer=r.framebuffer}return h.prototype.executeDebugGlobeDepth=function(e,t){d(this,e,t)},h.prototype.update=function(e){var t=e.drawingBufferWidth,i=e.drawingBufferHeight;g(this,e,t,i),v(this,e,t,i),e.uniformState.globeDepthTexture=void 0},h.prototype.executeCopyDepth=function(e,t){i(this._copyDepthCommand)&&(this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._globeDepthTexture)},h.prototype.executeCopyColor=function(e,t){i(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)},h.prototype.clear=function(e,r,n){var o=this._clearColorCommand;i(o)&&(t.clone(n,o.color),o.execute(e,r))},h.prototype.isDestroyed=function(){return!1},h.prototype.destroy=function(){p(this),m(this),i(this._copyColorCommand)&&(this._copyColorCommand.shaderProgram=this._copyColorCommand.shaderProgram.destroy()),i(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=this._copyDepthCommand.shaderProgram.destroy());var e=this._debugGlobeDepthViewportCommand;return i(e)&&(e.shaderProgram=e.shaderProgram.destroy()),r(this)},h}),i("Scene/GoogleEarthImageryProvider",["../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/GeographicTilingScheme","../Core/loadText","../Core/Rectangle","../Core/RuntimeError","../Core/TileProviderError","../Core/WebMercatorTilingScheme","../ThirdParty/when","./ImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p){"use strict";function m(r){function n(e){var t;try{t=JSON.parse(e)}catch(i){t=JSON.parse(e.replace(/([\[\{,])[\n\r ]*([A-Za-z0-9]+)[\n\r ]*:/g,'$1"$2":'))}for(var n,o=0;o<t.layers.length;o++)if(t.layers[o].id===v._channel){n=t.layers[o];break}var s;if(!i(n))throw s="Could not find layer with channel (id) of "+v._channel+".",_=c.handleError(_,v,v._errorEvent,s,void 0,void 0,void 0,f),new u(s);if(!i(n.version))throw s="Could not find a version in channel (id) "+v._channel+".",_=c.handleError(_,v,v._errorEvent,s,void 0,void 0,void 0,f),new u(s);if(v._version=n.version,i(t.projection)&&"flat"===t.projection)v._tilingScheme=new a({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new l(-Math.PI,-Math.PI,Math.PI,Math.PI),ellipsoid:r.ellipsoid});else{if(i(t.projection)&&"mercator"!==t.projection)throw s="Unsupported projection "+t.projection+".",_=c.handleError(_,v,v._errorEvent,s,void 0,void 0,void 0,f),new u(s);v._tilingScheme=new h({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:r.ellipsoid})}v._imageUrlTemplate=v._imageUrlTemplate.replace("{request}",v._requestType).replace("{channel}",v._channel).replace("{version}",v._version),v._ready=!0,v._readyPromise.resolve(!0),c.handleSuccess(_)}function p(e){var t="An error occurred while accessing "+g+".";_=c.handleError(_,v,v._errorEvent,t,void 0,void 0,void 0,f),v._readyPromise.reject(new u(t))}function f(){var e=i(v._proxy)?v._proxy.getURL(g):g,t=s(e);d(t,n,p)}r=t(r,{}),this._url=r.url,this._path=t(r.path,"/default_map"),this._tileDiscardPolicy=r.tileDiscardPolicy,this._proxy=r.proxy,this._channel=r.channel,this._requestType="ImageryMaps",this._credit=new e("Google Imagery",m._logoData,"http://www.google.com/enterprise/mapsearth/products/earthenterprise.html"),this.defaultGamma=1.9,this._tilingScheme=void 0,this._version=void 0,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=r.maximumLevel,this._imageUrlTemplate=this._url+this._path+"/query?request={request}&channel={channel}&version={version}&x={x}&y={y}&z={zoom}",this._errorEvent=new o,this._ready=!1,this._readyPromise=d.defer();var _,g=this._url+this._path+"/query?request=Json&vars=geeServerDefs&is2d=t",v=this;f()}function f(e,t,r,n){var o=e._imageUrlTemplate;o=o.replace("{x}",t),o=o.replace("{y}",r),o=o.replace("{zoom}",n+1);var a=e._proxy;return i(a)&&(o=a.getURL(o)),o}return r(m.prototype,{url:{get:function(){return this._url}},path:{get:function(){return this._path}},proxy:{get:function(){return this._proxy}},channel:{get:function(){return this._channel}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},version:{get:function(){return this._version}},requestType:{get:function(){return this._requestType}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}}),m.prototype.getTileCredits=function(e,t,i){},m.prototype.requestImage=function(e,t,i){var r=f(this,e,t,i);return p.loadImage(this,r)},m.prototype.pickFeatures=function(){},m._logoData="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALQAAAAnCAYAAACmP2LfAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAAAHdElNRQfcDB4TJDr1mp5kAAAAGnRFWHRTb2Z0d2FyZQBQYWludC5ORVQgdjMuNS4xMDD0cqEAAB1zSURBVHhe7ZwHeFTFFsf/u+l9N70npOxuSAKEFFIhCSH0qhEQUHkgKCgWUFGBB6IoCAoo0ntooaRvEkIIBBBpoYSa3nvvfd+5u4sQUigPfMX8v2/Y3Tkzs3fv/d0z58zcgF69Ql1SY+MM1wQJem44ZeiJk8beEOqPwG6uC7ZqyElb9eo/JZEIkH2nRQkBIlNMauuPCS3uGN/kjkmNDghoskBAgzrZ2NLmf1+JwIKQpYsoxdmIV9+N07onCegzBPM9bOdmYKnazF6g/1N6UySPqSJzvCaaiLHtP8G/Phq+FRfgU5ogKWUXMLT6Mvzqr2BE40mMadqO8c3zMabBC6PqDDC8SlY60t9HByCLVTKu+ERmHr5TWI9wjVxEaOZivWo1pil8D1tZeWnLXv1l8iZ3PF2kjymiWRgvCoJv5U243IyAXcQq8A9Mg9W+4bDe6wv+kVGwCZkL+4Sf4ZR+BZ5VGQR3EkbWn8Hopm3wq54Lz2JD6ah/P21XGopQ9Qoc16jGSqVyTJWbQbUsibFXf42mihTwZpsvAtp3k0dOhFOSEH1+ngaDefrgjFCgFkxY8fCisCBvKgODzxRh9qslBFGfYmDGLbiV5mBwRRo8KtPhVBgPu8teMP7u73chD6kMRYRGBY5xqrFKqQwz5SdTbS/Qf5mmUYw8rf01CjHC4VP7AHZxO6E3qy9ZZCQNnio2rE/4o9/tkxiQUYp+KRXgx8XC5FsXcLz/hkCrDUU4pxLHuDVYpdwL9F+qqSJZKlPwenskfOoI5tN7YPCJGVme7wKYr5EBXzgYfW+mwTI0Gjrznaj2WW+I/y8dVPdDGLcKRzXrsEqlHO8oTKHaXqAZWe9hQXCi63NhHWYI3ilfWIW/YLjqL2JRiOFBJRz+LffhcPs09D+0J8vzn3zXdBnYnp8Mi6NboTWzH9X8fVc+DhDQodxqAroe36lU9AJNWr4cEAjNwI8OAC9cT1rbUfzwGeCfKiL7dGnNc+q1NiO80b4BY1oT4V6WDcsdc6j2xbyq4wMWrA9rQmeWFn36ey/jBaoPQ4hmLYI0G/AtAf22fC/QDols8ITrIYi/Bl6knbS2o3gRbxHQxQQ0k0S/gCa2v4OJovPwacqAQ1ICjL40klr+UrWoQbFBETo18jCpZsOoFODkvuCNJYoHW3QKXFEM7ETRcKfiQe8d6NVIFImXvg4skhY40mxnQYVRIIeA1qrHEc1GrFSpxFtP99AiFbDbNKDZpAzzGkVYVcvBuBJQEo/9/6C+dyjPitwLwak74D8V6Bfw0P5VShjXFoTR7TfhUZkL29M/wfATJan1lauWC3aDOgyaVDCuTgbf1bFkfmtkye1ogsK2asivLYfCglIoD8qCknI2NHuG4QSVGMgQyMbt0fioRYh9VYcRU7QX55uDcaHtFOJEsThMtmWtQgxsDodsWaC0c3ea3MzGBJEqxrfbYmzr6xjfPAeTmt5HQPO7eK1xDibUz8eY+k8xtHYJPCtXwvHOu7AXMrMTsF/TH8HajTis1YwVqpWY0TXQDKy1OpBr5EJA52Fukxx+bmKxtjWx2DuaWawNlZD5qhzyo9KhpHAbKpJO/6t65UCPbPHA2PYrGNacgkElabCJJDev/MpDhUKKnuq44LRoYEK1IiswkS1zYCfk5y+F0qjvoTwqBOof34dGeAnUL1ZCLboEnJ9zoe0QD/Nuj00UBVXRabzVLETM3S0ICfwA8yc7Y6C3ANYbZsA7aQ1W1xzEfZEQ6dT2BkG9pP4ouo7jGE1u42JS20QMrzkCr4xwuN4+AM+cYII3EaNar2J86zmMrP8DHulCON4NhU3YWuhOYy6SZENpH9cfx7WacFC7BSvUqjBDsRPQIiugURvazeqYVaqAw6dYrJ9WQy7gayj4nYDy3HtQOVQGpYRqKEWXQf2HdGha/AFdae9Xr4czz0ubISRA75ECbSut7agegO75OLxpahze8j5GtifBpzEDLiV30Dd2mNT6StWiCbVmLt5rUkBQCEt2zWzIMSA8HgrIBkLD+Sp0jhHISYXQ/KMYukfvQ3fQxq68XCTBHId/tMTg7LV1CFs4BszJ6hBarBgHlcRv8H7tbuSKQpFPYGe0BmND+nZ0npECaPKf0r4UIxsuoF/IMpitsAVnrA4s15uh3x8fwLXkLobUZGJIXTqcUzbDaJE5FAVq0t4S7dEcjqMEc6B2K5arVWN6Z6AbdOmm5mJelQKOHWSxF44Cy4CqxW0s6RwchCovFRohdGNfLgX3WiZ0N4aD++y7jfwYJUrAPCle/ZjKV+BFTSegrGAZIm3QjXhBytTWB3zhByzryMUU986jz16wD+96ijCNUIAgmkc3tS6G7GERjCbgR82B4OTbEESqIiCIcqsIYzoGGyrBEMSmgh8xBoIIAR2fAHZhj8Z9DOhl9FHeKkSDvn809fuc+iyCddRYaiOZBTvIt1YJfs0b4N+WDO+GHPLQN2Ab7S61vjJV60C9SRPvNSqzTpxlyQfS1dGUmjppK7gW16B/LhN6abnQu5cDwzO3YNhhqqK4WJY887sEdGzWFpxfOxmDpKZOOvgWFB8sx9L6nShvP4FyUQjKGg5gScpGKEqbUE7RxiGYv6QQ4zIG/r4D2m88sjEy/EIW/a6+TQ4gHe5VhXCvy4JL7gLYnesI2i6t4Tii04r92u1YKt767gB0ozrkGzmY26zEOh7Hkt+kAKhLTX9qOVVdg9aoNOjcToR+wUVKLYKgN0Zq7l7884wn9CKgr4AfWw/B6SwqKQRKOdXVghe9CpbherASSjtIpGpxRIHFjwygNreoXy0lb+lU7lHJBP9kPcGXQnBNghUB/Lh44fbUp5JA+5Hs71LbPPLCVRDEJZDNGIJgeQI6mG6KegKzldq1U7tGKjQmHR8vwl86kgRoAQN0xBw6ztn0nQ/ocxEdQ7L4d/BjG6g+m8aZTL/xsXPuW82Fb8t+DG1Ox5D6XAwqvQ67OA+p9ZWoUQPsei78mjSwNU9GLmEzVGZJTd3qFPTn3YZhXgYMMjNhlHsDxms/hNWfoUdrNPgEc2h7BG5d/Bo7Blt0BuNxXf4MVmXrkdRyEHWiY6hr2oc7mevRX2wc18gioEeI1+N9a+/CNnImVAZ0mhEoNOPAJT8MHjUF8KTiWhqHgbfMpVaJdhLQh3XasU9bJAZ6ekeg6zQwgEKuLSWysmd3QGmatLqD8qDNug3dCX/AIPk4jGr2wDB/JXTmkan70IvmZTY/rB9BdZlKLkG0lG0d5klAObKsw1+jzyFiWPnRawiaDrMYwTyMwMwh220WP2IWFVfqN4CKO8E3n0C6R/ZUej9Y2kUiMdDRFTRePH3nA3q/m7xpAEtAXl0QrkTwscnmS/3eptdzNEYevZLnZ5booqk8tuYs9tAny+n1LL1mghezlcULH0VtHamOZhvhIvoNOXQsd2EZIbluYnlWaMO75TCFG9kYXJ8H14o76H/10Z3yClSrCm6jGtbWK7LC7kIlYRfUmY2XHnUa+mbXYRSfCuNCptyE6b1jMBD/EPKwchQPLxGdxOWWI8iKXYBPqLozgI8pfA5YBWvxbfMeNLUfRmPTLjRnr8YKsdGvRQ5j2zZTSSRQ78H+7GhxfScFAINypsG9ukDspZ0LKKE+O0pqlGi71ggcIqD3dga6RhFKjSqYT+VEFkvu/E9Q+HNWKaE2VVDgVkPFqwAaay5CN3En9M59BM2vfKDs7AvljjPGE5LlharQdL+LoCmhOHU0rIUyD+NgVTOa+q2iVQiIcAKpHtbhXuJOjPqeVCRYThNE6VTvKNs3hM3cHGIxntxKyCbP7Erj1lHZJbVIJAG6iiCroZCAPGukvOyASJbvCgoaAoKoAQ1kHcGC7nmZDkmhBR2PfSQLtkcl4zCSAE2eO6qExYuYxrE4KqdvelBiM4+ncYQy1IY8d0wbhUSLJAZGbsUceNYdwJCGPAyuy4NbZToG3JoO1Qk9AvHvqF4ejo0KCKlisyl04Jw+AE1ma71HRUJP+QqM1t2HcVEyTEoSYVYQCuN3HenCt4XDhGA+KorAnYZ9KIj5ELOl3XpU/k/wrt+OmraDaG7cjpacbxFvYAAZDG5Vw/DWCxjRdp+ATsWAS6+D69H1+XDNsoVb1T06b0VwzCmBIOYdqUWibTojcFBH1CXQctBtUcA6Oh/RmVC4sBmKA5j6erC1qqE4sRpqG25A43QIOHuXgvOmP5R4ZH6m5UY2L9SSLjZ5sKjjsI/o8olH8ngjCZoSgmw9DMIl3t42Up0g+pq89/sEjLK47knZhSkSuDepJP4JOyNJyEFAR8VQKMOR1nbWM69yxNJYwh+VLE90ffPyxLE3EwL9Jq0huWQqwL1iA7zq8+FVl0+epgBO6T+gb2TH+OglqgastxtZrNNlkLt8E5oJx6HZdab7mFZBk3UZRjMewCT7HkzLfodZxREYr5sBjiIBPYiAPt8ehvSGPSg5vwjzpd16VNkmmDTswp22QDTXbkJrxhJkzHGDFoUQmvBpvo2hrZl0TnLhlLIYfUO7nt7dSg3hURcP1/JiDEgphuXBqVKLRFsfA3oJAf3mI6Cr2OjTwGYdqWGzzmZD6WoYVCfehdqsZKjuuwS1oB1Q+5piHac3oaxBzZ9vLZ4nHEeesoXg6niDPSYWP9yUgD5PHu48eKE64krHcErchHIEuRysTpAXjObQWIYEHiV4EQYEojp5aEoyY+IIpOQugKYYOnIdJXrdJ63PtWwXMQM6m6SVT4gfZkbHV0XHsVtaQ3K8yoJr0YfwoHDDq5ZiQSqDik/B4Q9taYtn18gyNia1qGJsmTrGlUjK2FJ1jCjRwOASDnkxDvN95ZD/og5yl0qgfCMJ2leDoeksHaFHXYOJVyrMkm/DrPwMzGr2wmjnLGipthyHL0W7t9pDkduwF2U3lmGFtvbTdyirt0OreT+iWwPRUrUBbSkLkT/fCUZwKVYikBMwpDlPXNzLwuAQ2rWX8KzUh2dDDJyLSmB7/S5Mf3WRWiR6CPSezkCXQs6qBnLCKsheyoXqnTCoL9oOFd9/Qtl9KJT6UJMX3/zhCz8iuCjhiviSYtMx3ZTJBN8lCE7eIRgF0p6krRRaRBDskTTGySBKws5SuUjJHYUiMQdpzCUE0Q3y5MnSDhJJQg5JUvjSgO5hHZofaioGmvc40IycMgbRtJktjgOZ5Ma9irzSg46xYHcaVEZevkgBHqUWGFK+FENKQ+BdGAq/wiMYWbwHI6h4FwTDOes0BMKFMHxPNg9qn1dANakYanfuQSs5FJoTpaP1qBswsSGgb9+EeUU0Af0LDH4dBhXlmv3wajuOpPYQFDcEojxtNQ6sn9ZzUsiofjfUWg/iYOt+tJatRtvN95DqZgxNuKTKwLV4Jdyqc8Wz1uCGTLjmDIVDQqewQ8anwpJi6GsYkF4Ey2O/QvsfXKlJIgboAwT07s5AZ0G1TylUIsuhdKMI6vcuQ3PVAqg+9UZ8JvGEywiuNoIwD4IzaV2X+HSa1otgE3+NwJImVkycG0kx8snfyUZJW+QFApeSu+hN9BpIn6n+ZBp9bqDv+C8Fum+8IpzzJNOmR3UhTaGFcC07iAHXmamuZw28C/S/aIt+CcthF7+ToN0EQdhqOFzcBu/Sm/ApvAGX3DzYXIiF9jtWTJf74L6ZC83UfGg8SId2xnloSZKxp+gWjC0J6KSrMK8KhmnlSugtInpkCzaBV78Hl5oPoaLpECrLt+Bi4jfgS7t1q+YDUGsPwj5KDFsLlqD97JuIpmpZmP+TftM1ezjlxsOllM4H3eReDWHwKrOBW84jqMeK5OBTv4Bu6HxxgqU1s/N3MkAHSoH+ioCe+gjoJHB0s8ENLID6/UJo3E+GVlwoNEwY278tXhR50RhmeexzgmM8JXjdF36MHwEoiXn70Csv6gxBm8PiRc6gJFD1HDzFpq1cP0omo5QJZAfqQzH0f6uHZjQgeR4cC/IJZCnUtSkYVPAWBiX2/CdU/S7Ql+9TgtFCTaiP0qAEXA2yRsqwuzECziWZcM4tgv2DSljF7ID+l+JNh9+hY38HuvcYmLOhk5EEnVPfQOmpW+33YGaXhj53E2BWuxvGebOh5cPUX/sWSgXrsa9mB2qaDqCK4C7I2IA3jn8u7tat2g6D034MIbWb0fZgHlr2DscXUhNNuYdkYRPrg/7JiXDMLYBrZS6GNEZgVJM/JjWY4I16G4xr/BCDq2nKjjoAvY+Zpwo7eXBskQK9Swr0lEdAn4a2wk3o/DMNWmn54KYUQIuZsebGQuXFQ42H4kfNk4QckSOkNZ1lGkGAUoInOKkAm2jJsVtH+om9Nj9ytZxNcNdhljXByo+JJXj/i4G2u2xM02YInPJLxFB7VudTPH0ZHkWu0hbPpwHpfnAszoFDVgVsb1fDMmoL9L8S7wTFQE/1AvR33oB+QSp0czKgl34B2iO9uwJCKib5SGaZjbqLPlkhMG1YDr1gQyioSs24vQTDitagsnIL6loCUVu9C2EJK9FjYtsWBNP2Q7hb9A155zdwY5mTeGexo0w32hEcy2F7JQaOqZfgk38KY6rDMKFBiGHNt+iGPgCNYd0/s/sbAb2fgN5JQC9Wq8bkR0AzioOOx3Xo30mGbnY+tNMKoJOQCm03qfnFxRf6E1yUFAqZJcyuZRWuQmB+TWHJcgJfkjPxImcSSIUsXviMx/O9DvqfALrPDjb6nhuBAWkZ5JFKKTYuIqhz4FUdAo9CGwzO7Ra2LjUg0w9OxdlwyKxAXzHQm8lDi4HeAT1WMPSHnYXR7aswKE6Gfl4K9PdfgZ6+uG8XSmMbKyXD/LsEmFduglH2NHA7rA3Hvg+Ve1/gYO4KNFRvQUPLQVRU7MG4yn1dJ4eiULAo3JhW9xsa77+Hml8GY8FQ425uAM5wRRivNoPlTjs4XhoH35oLGFZ/S/wglyDkbWmrrsUAvY+A3kHlSwJ6ihKzCvLnuQyElmIs9LdfhmHxA+jn5kI3jcrRFOjxU6DTbTx9DybsOBh0f034EeYEVyaFD0IYhnQ9y1pTIsiPvU5AnKYkUBL78yKmQhDLgDRPSWtPp/HFkFtHqFCfRBr73wX67qsD+qFsEubCnqKBAZllcCkkT12RjSHVMfApH0bJXfcH+aQGZg6FU1EWeeoK2NwgoMM3Q++zP/fq/Smf2g392ZEwzk2Acfl9GBHURmuSYPyn132oHBizH8B8wjX0SadQI2cWtOZZQbHTdEgRn8XN93EiczFayn5GU3Mg7lJMPab5SEeoCWZZ0TF4Ne/A/ZSPUbXdDz9Qdddrrk/KtcwR7jX34VXDzGCFGFT0GzyLu922x069kdiv145tOu34jlOHBWoz4arUAZQt0LYOhmFcHJ2H6zAsYnZDc2FwKhv60+m9UQrLUJ4hSYQAVhpM1O6jj30EDD33Q6frZyoY8cMVaWZZR560kuB5V9H6iVUas+Py5L1/IHsT2ZldR4nEkMdkUd8Y8tYd43mLIMhYhenDWvgjQSQiGFOkiEv0rEAzK2u8yG10M2WwBWFdb6q9NKDNd6rCOuYD9L2VI/57QMfcEniU5cCnJgG+lR9haAnz4MzT5ZjmA4e8HBqnGtYXamF+nK7bpx0uwHxoqGyE3sKD5HHjYVJ1C6Z5qTD5Ph2G1hnQEV/0LBhxU2E+4yYsbgTCJGsuNBfYQrnjA0CPxDo2CRYJ0xGesgD1ZWvQ3LQbKeSJ54uC0UcUDVVRGExFR/FB2y7cSf4C+Zv9sXSUeQ9P2z2pQdnmBHQsPKqKqFCyWJsM75o1GMw8O/iEhFZs/KK9CD9wRfhCTYTP1dqwnBOHrQYz8IuuH5ZxxI/MLQZH5kfoeu6D4cVQGNecgXHFbRgXZsD4Xg5MjqfDeE0KTBbRDLXsLiwOR8HkxCJoOs+Eavdr08ZBBGdYP7rYzAZILsH3LYUYtgSsAXlYRwLqW0r8Ksl2id4/Onaz47IE+kayUfwddYhsgwkqXRrLgOpHEuyhVF9B7ytoTAL//qNjeFagGfGEi5nvYPEifqOx/ek4p1J/8aKBWC8N6Icy2+oL6zOhECTmw46SuoHZpXBn/pK7/DK8K1bCp3Q0vAv7wqfIBD55OuS9teFVYASPfAFccseThw+E4Ho5LOMqYB6ZCeOdK6H1bleJH2sOOPZradqlC3otDqY5F2GafQmmCZdgFnMBZteEML2yCnprh0CZWVp66gbDuD5Q2uSLUacm43jSB0gq+h55JeuRX7wRqUUbkJL8DS4GTcPqCdZgduZ6XiZjgvcp9fIY3aAH/yY+3KvcMDBjLSXQBXDML4VbaQG8a9PgUxcOzyIneKY/Or6FHDO8q7INY+RiMFJaJijE4i2VeEylej/FDs99TAPH8Dvofv8bDK/vhVHxMRhX0W+vOgXTijiY5UXANGkNnYeRUGN2VrsPNx6XVaQNgRNM03sBgUjeOKJJ/Cr+LNzFsg61YB5/elyKtic0qM031CaZAG0gqJnVEuYBIoI49gy9D6DXrQR3GoU2j3YE+WE2FI9TGBG1FLywnhNbPt1Y/OhY+o5iGqsGNmdLaVxfqZUB+g0Iztwi2AOkNZ3FCzOm30bHeHK9tKYHKfPZMFhlAtM9c2EpjALv93zY3qlE/8xyOOUVUTiSBrfy83CvDIdbRZC4uJSGwzHzd0qgkmEVfRnGW/dC79vPobtkFLRmm0HDpVt43MnrzoOm/dfQeeOf0P3wB+guJogXrIDuhHfAsdOFbKdQ5GkaYQbNNYNht2c8/AOnYNKB6Ri//Q14zRwIuohdPC76pCbWKGFCkx9GNC7B0NZD8CiJh8Odi7A59zud7EuwvU4hVUYZBhUXwqsqA56V0RiUM1Dam36UoiyFuprQhc6fRZuKKhV5+rcLKD2hrPQ+NPsvgNb0j6C9eCG0v/kU2l9/BK0ZM8EdRJQ833noG8Qib6lDkA0lYD6i8GIJlffZ/IhhbJtQjW4TP164EiWWztTnH9T+a4L/MxpjAn02hWWYDAQnefSZzm7Io7zDOpiSzGh3grwPwd3zDccPZdH4phBEkXcWBrD4wlE07qObw5pmBUGsK43T/YPfgmAFWEe5U2EeCXhGcV5nQ3u2KrTf6w+jdTNhtud7mB/ZC4vg43QAwbAMDYLF0e3os+8HGP80D7oLx0F9dD+oj9AGZ4Y85K0Yj/Vs3kQiFgeybFPIySiDzdwAz9O3JzHjPNtYk8gjv948FOOatlGodR0Dk07Bau9n0F8wFBp+luBO1CXeuDD51Q3830PRP7UIzgUlcC0vhHPRSdic6eI53ecT3W0sKyjI2EFRxhzyz3sOO8voBkEUTclYhAyshCwr642PR79diwlbBOEs8vLMFjgbbuelhpeoz5rEDxsNNl/+9ON5RWJOLsXCysQdh5IhWWbzhUmoel6v/l/RxGpZTKgbh3EtEZQMp5AX2ASd2f3AVu7695ky/7nOuc2U/BZSCFIGp+I82F/rfprsVa/+Mk0sZ2F0tTvGNZ+gRO8B7C/HQ92beWine+/IDWDBbJUmbBN/hUNOGRyyStH34vfQeP3ZV4R61atXIu9Kefg1rIB/XRJciwso9nymLXmxbP+wxcCsVAxIKwfv1AZoDH96jN6rXr1SuVeowKsuFINrs+BSXATbc59JLU/XwCwdDMw7B/vUEpgHfQYZ7v9HCNar/2E55ynDpSwYrhXF4uKUeQiY0/Oy3kM555nCITcJgmvp0F30Yo8L9KpXL1X9E2XhkPoVBuYWwbmolKDOhmv+WHiXyGNkgbTRE1pOublXkRycCz+AfUoRzPdsgKJN1w/19KpXf7n6xlnCPikE/SkWdswrozDkNoZUfIWhFTYYWaPy4a6NkgSR2XAZXSOLIWUWcCv7FP1T7sH8wFZwp7ycxz971auXIm4AG+b77MFLEKLv7ULJMy0FefCsPAOv0t0YUrIMg0s+gVfxYrgVbIJLUSzsrl2F2ZZl4L7J/Pdp/956ca969UrEna0O41/HwSJ4F3in42Fz5Trsbt5Bv3u30e9uImyvnoV15GGY/LIA6kOZP1966pZ8r3r1n5eqhwZ0F/aB4ToHGK9zh/FPHjD60RE6H1tDaaA2cdy7mvFfI+BffksPNrEksu0AAAAASUVORK5CYII=",m}),i("Scene/GridImageryProvider",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","../Core/GeographicTilingScheme","../ThirdParty/when"],function(e,t,i,r,n,o,a){"use strict";function s(e){e=t(e,t.EMPTY_OBJECT),this._tilingScheme=i(e.tilingScheme)?e.tilingScheme:new o({ellipsoid:e.ellipsoid}),this._cells=t(e.cells,8),this._color=t(e.color,l),this._glowColor=t(e.glowColor,u),this._glowWidth=t(e.glowWidth,6),this._backgroundColor=t(e.backgroundColor,c),this._errorEvent=new n,this._tileWidth=t(e.tileWidth,256),this._tileHeight=t(e.tileHeight,256),this._canvasSize=t(e.canvasSize,256),this._canvas=this._createGridCanvas(),this._readyPromise=a.resolve(!0)}var l=new e(1,1,1,.4),u=new e(0,1,0,.05),c=new e(0,.5,0,.2);return r(s.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return!0}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}}),s.prototype._drawGrid=function(e){for(var t=0,i=this._canvasSize,r=0;r<=this._cells;++r){var n=r/this._cells,o=1+n*(i-1);e.moveTo(o,t),e.lineTo(o,i),e.moveTo(t,o),e.lineTo(i,o)}e.stroke()},s.prototype._createGridCanvas=function(){var e=document.createElement("canvas");e.width=this._canvasSize,e.height=this._canvasSize;var t=0,i=this._canvasSize,r=e.getContext("2d"),n=this._backgroundColor.toCssColorString();r.fillStyle=n,r.fillRect(t,t,i,i);var o=this._glowColor.toCssColorString();r.strokeStyle=o,r.lineWidth=this._glowWidth,r.strokeRect(t,t,i,i),this._drawGrid(r),r.lineWidth=.5*this._glowWidth,r.strokeRect(t,t,i,i),this._drawGrid(r);var a=this._color.toCssColorString();return r.strokeStyle=a,r.lineWidth=2,r.strokeRect(t,t,i,i),r.lineWidth=1,this._drawGrid(r),e},s.prototype.getTileCredits=function(e,t,i){},s.prototype.requestImage=function(e,t,i){return this._canvas},s.prototype.pickFeatures=function(){},s}),i("Scene/MapboxImageryProvider",["../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/MapboxApi","./UrlTemplateImageryProvider"],function(e,t,i,r,n,o,a){"use strict";function s(r){r=t(r,t.EMPTY_OBJECT);var n=r.mapId,s=t(r.url,"https://api.mapbox.com/v4/");this._url=s,this._mapId=n,this._accessToken=o.getAccessToken(r.accessToken),this._accessTokenErrorCredit=o.getErrorCredit(r.key);var h=t(r.format,"png");/\./.test(h)||(h="."+h),this._format=h;var d=s;if(l.test(s)||(d+="/"),d+=n+"/{z}/{x}/{y}"+this._format,i(this._accessToken)&&(d+="?access_token="+this._accessToken),i(r.credit)){var p=r.credit;"string"==typeof p&&(p=new e(p)),u=p,c.length=0}this._imageryProvider=new a({url:d,proxy:r.proxy,credit:u,ellipsoid:r.ellipsoid,minimumLevel:r.minimumLevel,maximumLevel:r.maximumLevel,rectangle:r.rectangle})}var l=/\/$/,u=new e("© Mapbox © OpenStreetMap",void 0,"https://www.mapbox.com/about/maps/"),c=[new e("Improve this map",void 0,"https://www.mapbox.com/map-feedback/")];return r(s.prototype,{url:{get:function(){return this._url}},ready:{get:function(){return this._imageryProvider.ready}},readyPromise:{get:function(){return this._imageryProvider.readyPromise}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}}),s.prototype.getTileCredits=function(e,t,r){var n=c.slice();return i(this._accessTokenErrorCredit)&&n.push(this._accessTokenErrorCredit),n},s.prototype.requestImage=function(e,t,i){return this._imageryProvider.requestImage(e,t,i)},s.prototype.pickFeatures=function(e,t,i,r,n){return this._imageryProvider.pickFeatures(e,t,i,r,n)},s}),i("Scene/Moon",["../Core/buildModuleUrl","../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/Ellipsoid","../Core/IauOrientationAxes","../Core/Matrix3","../Core/Matrix4","../Core/Simon1994PlanetaryPositions","../Core/Transforms","./EllipsoidPrimitive","./Material"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p){"use strict";function m(t){t=i(t,i.EMPTY_OBJECT);var n=t.textureUrl;r(n)||(n=e("Assets/Textures/moonSmall.jpg")),this.show=i(t.show,!0),this.textureUrl=n,this._ellipsoid=i(t.ellipsoid,a.MOON),this.onlySunLighting=i(t.onlySunLighting,!0),this._ellipsoidPrimitive=new d({radii:this.ellipsoid.radii,material:p.fromType(p.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new s}n(m.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var f=new l,_=new l,g=new t,v=[];return m.prototype.update=function(e){if(this.show){var t=this._ellipsoidPrimitive;t.material.uniforms.image=this.textureUrl,t.onlySunLighting=this.onlySunLighting;var i=e.time;r(h.computeIcrfToFixedMatrix(i,f))||h.computeTemeToPseudoFixedMatrix(i,f);var n=this._axes.evaluate(i,_);l.transpose(n,n),l.multiply(f,n,n);var o=c.computeMoonPositionInEarthInertialFrame(i,g);l.multiplyByVector(f,o,o),u.fromRotationTranslation(n,o,t.modelMatrix);var a=e.commandList;return e.commandList=v,v.length=0,t.update(e),e.commandList=a,1===v.length?v[0]:void 0}},m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),o(this)},m}),i("Scene/NeverTileDiscardPolicy",[],function(){"use strict";function e(e){}return e.prototype.isReady=function(){return!0},e.prototype.shouldDiscardImage=function(e){return!1},e}),i("Shaders/AdjustTranslucentFS",[],function(){"use strict";return"#ifdef MRT\n#extension GL_EXT_draw_buffers : enable\n#endif\nuniform vec4 u_bgColor;\nuniform sampler2D u_depthTexture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nif (texture2D(u_depthTexture, v_textureCoordinates).r < 1.0)\n{\n#ifdef MRT\ngl_FragData[0] = u_bgColor;\ngl_FragData[1] = vec4(u_bgColor.a);\n#else\ngl_FragColor = u_bgColor;\n#endif\nreturn;\n}\ndiscard;\n}\n"}),i("Shaders/CompositeOITFS",[],function(){"use strict";return"uniform sampler2D u_opaque;\nuniform sampler2D u_accumulation;\nuniform sampler2D u_revealage;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec4 opaque = texture2D(u_opaque, v_textureCoordinates);\nvec4 accum = texture2D(u_accumulation, v_textureCoordinates);\nfloat r = texture2D(u_revealage, v_textureCoordinates).r;\n#ifdef MRT\nvec4 transparent = vec4(accum.rgb / clamp(r, 1e-4, 5e4), accum.a);\n#else\nvec4 transparent = vec4(accum.rgb / clamp(accum.a, 1e-4, 5e4), r);\n#endif\ngl_FragColor = (1.0 - transparent.a) * transparent + transparent.a * opaque;\n}\n"}),i("Scene/OIT",["../Core/BoundingRectangle","../Core/Color","../Core/defined","../Core/destroyObject","../Core/PixelFormat","../Core/WebGLConstants","../Renderer/ClearCommand","../Renderer/DrawCommand","../Renderer/Framebuffer","../Renderer/PixelDatatype","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/Texture","../Shaders/AdjustTranslucentFS","../Shaders/CompositeOITFS","./BlendEquation","./BlendFunction"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g){"use strict";function v(i){this._translucentMultipassSupport=!1,this._translucentMRTSupport=!1;var r=i.floatingPointTexture&&i.depthTexture;this._translucentMRTSupport=i.drawBuffers&&r,this._translucentMultipassSupport=!this._translucentMRTSupport&&r,this._opaqueFBO=void 0,this._opaqueTexture=void 0,this._depthStencilTexture=void 0,this._accumulationTexture=void 0,this._translucentFBO=void 0,this._alphaFBO=void 0,this._adjustTranslucentFBO=void 0,this._adjustAlphaFBO=void 0,this._opaqueClearCommand=new a({color:new t(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new a({color:new t(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new a({color:new t(0,0,0,0),owner:this}),this._alphaClearCommand=new a({color:new t(1,1,1,1),owner:this}),this._translucentRenderStateCache={},this._alphaRenderStateCache={},this._translucentShaderCache={},this._alphaShaderCache={},this._compositeCommand=void 0,this._adjustTranslucentCommand=void 0,this._adjustAlphaCommand=void 0,this._viewport=new e,this._rs=void 0}function y(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function C(e){e._translucentFBO=e._translucentFBO&&!e._translucentFBO.isDestroyed()&&e._translucentFBO.destroy(),e._alphaFBO=e._alphaFBO&&!e._alphaFBO.isDestroyed()&&e._alphaFBO.destroy(),e._adjustTranslucentFBO=e._adjustTranslucentFBO&&!e._adjustTranslucentFBO.isDestroyed()&&e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO=e._adjustAlphaFBO&&!e._adjustAlphaFBO.isDestroyed()&&e._adjustAlphaFBO.destroy()}function w(e){y(e),C(e)}function S(e,t,i,r){y(e);var o=new Float32Array(i*r*4);e._accumulationTexture=new p({context:t,pixelFormat:n.RGBA,pixelDatatype:u.FLOAT,source:{arrayBufferView:o,width:i,height:r}}),e._revealageTexture=new p({context:t,pixelFormat:n.RGBA,pixelDatatype:u.FLOAT,source:{arrayBufferView:o,width:i,height:r}})}function E(e,t){C(e);var i=o.FRAMEBUFFER_COMPLETE,r=!0;if(e._translucentMRTSupport&&(e._translucentFBO=new l({context:t,colorTextures:[e._accumulationTexture,e._revealageTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._adjustTranslucentFBO=new l({context:t,colorTextures:[e._accumulationTexture,e._revealageTexture],destroyAttachments:!1}),e._translucentFBO.status===i&&e._adjustTranslucentFBO.status===i||(C(e),e._translucentMRTSupport=!1)),!e._translucentMRTSupport){e._translucentFBO=new l({context:t,colorTextures:[e._accumulationTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._alphaFBO=new l({context:t,colorTextures:[e._revealageTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._adjustTranslucentFBO=new l({context:t,colorTextures:[e._accumulationTexture],destroyAttachments:!1}),e._adjustAlphaFBO=new l({context:t,colorTextures:[e._revealageTexture],destroyAttachments:!1});var n=e._translucentFBO.status===i,a=e._alphaFBO.status===i,s=e._adjustTranslucentFBO.status===i,u=e._adjustAlphaFBO.status===i;n&&a&&s&&u||(w(e),e._translucentMultipassSupport=!1,r=!1)}return r}function b(e,t,r,n){var o=r[n.id];if(!i(o)){var a=c.getState(n);a.depthMask=!1,a.blending=t,o=c.fromCache(a),r[n.id]=o}return o}function T(e,t,i){return b(t,N,e._translucentRenderStateCache,i)}function x(e,t,i){return b(t,L,e._translucentRenderStateCache,i)}function A(e,t,i){return b(t,B,e._alphaRenderStateCache,i)}function P(e,t,r,n){var o=t.id,a=r[o];if(!i(a)){var s=t._attributeLocations,l=t.fragmentShaderSource.clone();l.sources=l.sources.map(function(e){return e=d.replaceMain(e,"czm_translucent_main"),e=e.replace(/gl_FragColor/g,"czm_gl_FragColor"),e=e.replace(/\bdiscard\b/g,"czm_discard = true"),e=e.replace(/czm_phong/g,"czm_translucentPhong")}),l.sources.splice(0,0,(n.indexOf("gl_FragData")!==-1?"#extension GL_EXT_draw_buffers : enable \n":"")+"vec4 czm_gl_FragColor;\nbool czm_discard = false;\n"),l.sources.push("void main()\n{\n czm_translucent_main();\n if (czm_discard)\n {\n discard;\n }\n"+n+"}\n"),a=h.fromCache({context:e,vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:l,attributeLocations:s}),r[o]=a}return a}function D(e,t,i){return P(t,i,e._translucentShaderCache,F)}function M(e,t,i){return P(t,i,e._translucentShaderCache,V)}function I(e,t,i){return P(t,i,e._alphaShaderCache,k)}function R(e,t,i,r,n){var o,a,s,l=t.context,u=r.framebuffer,c=n.length,h=t.frameState.shadowHints.shadowsEnabled;r.framebuffer=e._adjustTranslucentFBO,e._adjustTranslucentCommand.execute(l,r),r.framebuffer=e._adjustAlphaFBO,e._adjustAlphaCommand.execute(l,r);var d=e._opaqueFBO;for(r.framebuffer=e._translucentFBO,s=0;s<c;++s)o=n[s],a=h&&o.receiveShadows?o.derivedCommands.oit.shadows.translucentCommand:o.derivedCommands.oit.translucentCommand,i(a,t,l,r,d);for(r.framebuffer=e._alphaFBO,s=0;s<c;++s)o=n[s],a=h&&o.receiveShadows?o.derivedCommands.oit.shadows.alphaCommand:o.derivedCommands.oit.alphaCommand,i(a,t,l,r,d);r.framebuffer=u}function O(e,t,i,r,n){var o=t.context,a=r.framebuffer,s=n.length,l=t.frameState.shadowHints.shadowsEnabled;r.framebuffer=e._adjustTranslucentFBO,e._adjustTranslucentCommand.execute(o,r);var u=e._opaqueFBO;r.framebuffer=e._translucentFBO;for(var c=0;c<s;++c){var h=n[c],d=l&&h.receiveShadows?h.derivedCommands.oit.shadows.translucentCommand:h.derivedCommands.oit.translucentCommand;i(d,t,o,r,u)}r.framebuffer=a}v.prototype.update=function(t,r){if(this.isSupported()){this._opaqueFBO=r,this._opaqueTexture=r.getColorTexture(0),this._depthStencilTexture=r.depthStencilTexture;var n=this._opaqueTexture.width,o=this._opaqueTexture.height,a=this._accumulationTexture,s=!i(a)||a.width!==n||a.height!==o;if(s&&S(this,t,n,o),i(this._translucentFBO)&&!s||E(this,t)){var l,u,h=this;i(this._compositeCommand)||(l=new d({sources:[f]}),this._translucentMRTSupport&&l.defines.push("MRT"),u={u_opaque:function(){return h._opaqueTexture},u_accumulation:function(){return h._accumulationTexture},u_revealage:function(){return h._revealageTexture}},this._compositeCommand=t.createViewportQuadCommand(l,{uniformMap:u,owner:this})),i(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(l=new d({defines:["MRT"],sources:[m]}),u={u_bgColor:function(){return h._translucentMRTClearCommand.color},u_depthTexture:function(){return h._depthStencilTexture}},this._adjustTranslucentCommand=t.createViewportQuadCommand(l,{uniformMap:u,owner:this})):this._translucentMultipassSupport&&(l=new d({sources:[m]}),u={u_bgColor:function(){return h._translucentMultipassClearCommand.color},u_depthTexture:function(){return h._depthStencilTexture}},this._adjustTranslucentCommand=t.createViewportQuadCommand(l,{uniformMap:u,owner:this}),u={u_bgColor:function(){return h._alphaClearCommand.color; -},u_depthTexture:function(){return h._depthStencilTexture}},this._adjustAlphaCommand=t.createViewportQuadCommand(l,{uniformMap:u,owner:this}))),this._viewport.width=n,this._viewport.height=o,i(this._rs)&&e.equals(this._viewport,this._rs.viewport)||(this._rs=c.fromCache({viewport:this._viewport})),i(this._compositeCommand)&&(this._compositeCommand.renderState=this._rs),this._adjustTranslucentCommand&&(this._adjustTranslucentCommand.renderState=this._rs),i(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.renderState=this._rs)}}};var N={enabled:!0,color:new t(0,0,0,0),equationRgb:_.ADD,equationAlpha:_.ADD,functionSourceRgb:g.ONE,functionDestinationRgb:g.ONE,functionSourceAlpha:g.ZERO,functionDestinationAlpha:g.ONE_MINUS_SOURCE_ALPHA},L={enabled:!0,color:new t(0,0,0,0),equationRgb:_.ADD,equationAlpha:_.ADD,functionSourceRgb:g.ONE,functionDestinationRgb:g.ONE,functionSourceAlpha:g.ONE,functionDestinationAlpha:g.ONE},B={enabled:!0,color:new t(0,0,0,0),equationRgb:_.ADD,equationAlpha:_.ADD,functionSourceRgb:g.ZERO,functionDestinationRgb:g.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:g.ZERO,functionDestinationAlpha:g.ONE_MINUS_SOURCE_ALPHA},F=" vec3 Ci = czm_gl_FragColor.rgb * czm_gl_FragColor.a;\n float ai = czm_gl_FragColor.a;\n float wzi = czm_alphaWeight(ai);\n gl_FragData[0] = vec4(Ci * wzi, ai);\n gl_FragData[1] = vec4(ai * wzi);\n",V=" vec3 Ci = czm_gl_FragColor.rgb * czm_gl_FragColor.a;\n float ai = czm_gl_FragColor.a;\n float wzi = czm_alphaWeight(ai);\n gl_FragColor = vec4(Ci, ai) * wzi;\n",k=" float ai = czm_gl_FragColor.a;\n gl_FragColor = vec4(ai);\n";return v.prototype.createDerivedCommands=function(e,t,r){if(i(r)||(r={}),this._translucentMRTSupport){var n,o;i(r.translucentCommand)&&(n=r.translucentCommand.shaderProgram,o=r.translucentCommand.renderState),r.translucentCommand=s.shallowClone(e,r.translucentCommand),i(n)&&r.shaderProgramId===e.shaderProgram.id?(r.translucentCommand.shaderProgram=n,r.translucentCommand.renderState=o):(r.translucentCommand.shaderProgram=D(this,t,e.shaderProgram),r.translucentCommand.renderState=T(this,t,e.renderState),r.shaderProgramId=e.shaderProgram.id)}else{var a,l,u,c;i(r.translucentCommand)&&(a=r.translucentCommand.shaderProgram,l=r.translucentCommand.renderState,u=r.alphaCommand.shaderProgram,c=r.alphaCommand.renderState),r.translucentCommand=s.shallowClone(e,r.translucentCommand),r.alphaCommand=s.shallowClone(e,r.alphaCommand),i(a)&&r.shaderProgramId===e.shaderProgram.id?(r.translucentCommand.shaderProgram=a,r.translucentCommand.renderState=l,r.alphaCommand.shaderProgram=u,r.alphaCommand.renderState=c):(r.translucentCommand.shaderProgram=M(this,t,e.shaderProgram),r.translucentCommand.renderState=x(this,t,e.renderState),r.alphaCommand.shaderProgram=I(this,t,e.shaderProgram),r.alphaCommand.renderState=A(this,t,e.renderState),r.shaderProgramId=e.shaderProgram.id)}return r},v.prototype.executeCommands=function(e,t,i,r){return this._translucentMRTSupport?void O(this,e,t,i,r):void R(this,e,t,i,r)},v.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)},v.prototype.clear=function(e,i,r){var n=i.framebuffer;i.framebuffer=this._opaqueFBO,t.clone(r,this._opaqueClearCommand.color),this._opaqueClearCommand.execute(e,i),i.framebuffer=this._translucentFBO;var o=this._translucentMRTSupport?this._translucentMRTClearCommand:this._translucentMultipassClearCommand;o.execute(e,i),this._translucentMultipassSupport&&(i.framebuffer=this._alphaFBO,this._alphaClearCommand.execute(e,i)),i.framebuffer=n},v.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport},v.prototype.isDestroyed=function(){return!1},v.prototype.destroy=function(){w(this),i(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),i(this._adjustTranslucentCommand)&&(this._adjustTranslucentCommand.shaderProgram=this._adjustTranslucentCommand.shaderProgram&&this._adjustTranslucentCommand.shaderProgram.destroy()),i(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.shaderProgram=this._adjustAlphaCommand.shaderProgram&&this._adjustAlphaCommand.shaderProgram.destroy());var e,t=this._translucentShaderCache;for(e in t)t.hasOwnProperty(e)&&i(t[e])&&t[e].destroy();this._translucentShaderCache={},t=this._alphaShaderCache;for(e in t)t.hasOwnProperty(e)&&i(t[e])&&t[e].destroy();return this._alphaShaderCache={},r(this)},v}),i("Scene/OrthographicFrustum",["../Core/Cartesian3","../Core/Cartesian4","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Matrix4","./CullingVolume"],function(e,t,i,r,n,o,a){"use strict";function s(){this.left=void 0,this._left=void 0,this.right=void 0,this._right=void 0,this.top=void 0,this._top=void 0,this.bottom=void 0,this._bottom=void 0,this.near=1,this._near=this.near,this.far=5e8,this._far=this.far,this._cullingVolume=new a,this._orthographicMatrix=new o}function l(e){e.top===e._top&&e.bottom===e._bottom&&e.left===e._left&&e.right===e._right&&e.near===e._near&&e.far===e._far||(e._left=e.left,e._right=e.right,e._top=e.top,e._bottom=e.bottom,e._near=e.near,e._far=e.far,e._orthographicMatrix=o.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix))}r(s.prototype,{projectionMatrix:{get:function(){return l(this),this._orthographicMatrix}}});var u=new e,c=new e,h=new e,d=new e;return s.prototype.computeCullingVolume=function(r,n,o){var a=this._cullingVolume.planes,s=this.top,l=this.bottom,p=this.right,m=this.left,f=this.near,_=this.far,g=e.cross(n,o,u),v=c;e.multiplyByScalar(n,f,v),e.add(r,v,v);var y=h;e.multiplyByScalar(g,m,y),e.add(v,y,y);var C=a[0];return i(C)||(C=a[0]=new t),C.x=g.x,C.y=g.y,C.z=g.z,C.w=-e.dot(g,y),e.multiplyByScalar(g,p,y),e.add(v,y,y),C=a[1],i(C)||(C=a[1]=new t),C.x=-g.x,C.y=-g.y,C.z=-g.z,C.w=-e.dot(e.negate(g,d),y),e.multiplyByScalar(o,l,y),e.add(v,y,y),C=a[2],i(C)||(C=a[2]=new t),C.x=o.x,C.y=o.y,C.z=o.z,C.w=-e.dot(o,y),e.multiplyByScalar(o,s,y),e.add(v,y,y),C=a[3],i(C)||(C=a[3]=new t),C.x=-o.x,C.y=-o.y,C.z=-o.z,C.w=-e.dot(e.negate(o,d),y),C=a[4],i(C)||(C=a[4]=new t),C.x=n.x,C.y=n.y,C.z=n.z,C.w=-e.dot(n,v),e.multiplyByScalar(n,_,y),e.add(r,y,y),C=a[5],i(C)||(C=a[5]=new t),C.x=-n.x,C.y=-n.y,C.z=-n.z,C.w=-e.dot(e.negate(n,d),y),this._cullingVolume},s.prototype.getPixelDimensions=function(e,t,i,r){l(this);var n=this.right-this.left,o=this.top-this.bottom,a=n/e,s=o/t;return r.x=a,r.y=s,r},s.prototype.clone=function(e){return i(e)||(e=new s),e.left=this.left,e.right=this.right,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e},s.prototype.equals=function(e){return i(e)&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far},s}),i("Widgets/getElement",["../Core/DeveloperError"],function(e){"use strict";function t(e){if("string"==typeof e){var t=document.getElementById(e);e=t}return e}return t}),i("Scene/PerformanceDisplay",["../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/getTimestamp","../Widgets/getElement"],function(e,t,i,r,n,o){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT);var i=o(t.container);this._container=i;var r=document.createElement("div");r.className="cesium-performanceDisplay";var n=document.createElement("div");n.className="cesium-performanceDisplay-fps",this._fpsText=document.createTextNode(""),n.appendChild(this._fpsText);var a=document.createElement("div");a.className="cesium-performanceDisplay-ms",this._msText=document.createTextNode(""),a.appendChild(this._msText),r.appendChild(a),r.appendChild(n),this._container.appendChild(r),this._lastFpsSampleTime=void 0,this._frameCount=0,this._time=void 0,this._fps=0,this._frameTime=0}return a.prototype.update=function(){if(!t(this._time))return this._lastFpsSampleTime=n(),void(this._time=n());var e=this._time,i=n();this._time=i;var r=i-e;this._frameCount++;var o=this._fps,a=i-this._lastFpsSampleTime;a>1e3&&(o=1e3*this._frameCount/a|0,this._lastFpsSampleTime=i,this._frameCount=0),o!==this._fps&&(this._fpsText.nodeValue=o+" FPS",this._fps=o),r!==this._frameTime&&(this._msText.nodeValue=r.toFixed(2)+" MS",this._frameTime=r)},a.prototype.destroy=function(){return i(this)},a}),i("Scene/PickDepth",["../Core/defined","../Core/destroyObject","../Core/PixelFormat","../Renderer/Framebuffer","../Renderer/PixelDatatype","../Renderer/RenderState","../Renderer/Texture"],function(e,t,i,r,n,o,a){"use strict";function s(){this.framebuffer=void 0,this._depthTexture=void 0,this._textureToCopy=void 0,this._copyDepthCommand=void 0,this._debugPickDepthViewportCommand=void 0}function l(t,i,r){if(!e(t._debugPickDepthViewportCommand)){var n="uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n float z_window = czm_unpackDepth(texture2D(u_texture, v_textureCoordinates));\n float n_range = czm_depthRange.near;\n float f_range = czm_depthRange.far;\n float z_ndc = (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n float scale = pow(z_ndc * 0.5 + 0.5, 8.0);\n gl_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0);\n}\n";t._debugPickDepthViewportCommand=i.createViewportQuadCommand(n,{uniformMap:{u_texture:function(){return t._depthTexture}},owner:t})}t._debugPickDepthViewportCommand.execute(i,r)}function u(e){e._depthTexture=e._depthTexture&&!e._depthTexture.isDestroyed()&&e._depthTexture.destroy()}function c(e){e.framebuffer=e.framebuffer&&!e.framebuffer.isDestroyed()&&e.framebuffer.destroy()}function h(e,t,r,o){e._depthTexture=new a({context:t,width:r,height:o,pixelFormat:i.RGBA,pixelDatatype:n.UNSIGNED_BYTE})}function d(e,t,i,n){u(e),c(e),h(e,t,i,n),e.framebuffer=new r({context:t,colorTextures:[e._depthTexture],destroyAttachments:!1})}function p(t,i,r){var n=r.width,o=r.height,a=t._depthTexture,s=!e(a)||a.width!==n||a.height!==o;e(t.framebuffer)&&!s||d(t,i,n,o)}function m(t,i,r){if(!e(t._copyDepthCommand)){var n="uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n gl_FragColor = czm_packDepth(texture2D(u_texture, v_textureCoordinates).r);\n}\n";t._copyDepthCommand=i.createViewportQuadCommand(n,{renderState:o.fromCache(),uniformMap:{u_texture:function(){return t._textureToCopy}},owner:t})}t._textureToCopy=r,t._copyDepthCommand.framebuffer=t.framebuffer}return s.prototype.executeDebugPickDepth=function(e,t){l(this,e,t)},s.prototype.update=function(e,t){p(this,e,t),m(this,e,t)},s.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)},s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return u(this),c(this),this._copyDepthCommand.shaderProgram=e(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy(),t(this)},s}),i("Shaders/Appearances/PointAppearanceFS",[],function(){"use strict";return"uniform vec4 highlightColor;\nvarying vec3 v_color;\nvoid main()\n{\ngl_FragColor = vec4(v_color * highlightColor.rgb, highlightColor.a);\n}\n"}),i("Shaders/Appearances/PointAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 color;\nattribute float batchId;\nuniform float pointSize;\nvarying vec3 v_positionEC;\nvarying vec3 v_color;\nvoid main()\n{\nv_color = color;\ngl_Position = czm_modelViewProjectionRelativeToEye * czm_computePosition();\ngl_PointSize = pointSize;\n}\n"}),i("Scene/PointAppearance",["../Core/Color","../Core/combine","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/VertexFormat","../Shaders/Appearances/PointAppearanceFS","../Shaders/Appearances/PointAppearanceVS","./Appearance"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(n){n=i(n,i.EMPTY_OBJECT),this._vertexShaderSource=i(n.vertexShaderSource,s),this._fragmentShaderSource=i(n.fragmentShaderSource,a),this._renderState=l.getDefaultRenderState(!1,!1,n.renderState),this._pointSize=i(n.pointSize,2),this._highlightColor=r(n.highlightColor)?n.highlightColor:new e,this.material=void 0,this.translucent=i(n.translucent,!1),this.uniforms={highlightColor:this._highlightColor,pointSize:this._pointSize};var o=n.uniforms;this.uniforms=t(this.uniforms,o,!0)}return n(u.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return!1}},vertexFormat:{get:function(){return u.VERTEX_FORMAT}},pixelSize:{get:function(){return this._pointSize}}}),u.VERTEX_FORMAT=o.POSITION_AND_COLOR,u.prototype.getFragmentShaderSource=l.prototype.getFragmentShaderSource,u.prototype.isTranslucent=l.prototype.isTranslucent,u.prototype.getRenderState=l.prototype.getRenderState,u});i("Scene/PrimitiveCollection",["../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError"],function(e,t,i,r,n,o){"use strict";function a(i){i=t(i,t.EMPTY_OBJECT),this._primitives=[],this._guid=e(),this.show=t(i.show,!0),this.destroyPrimitives=t(i.destroyPrimitives,!0)}function s(e,t){return e._primitives.indexOf(t)}return r(a.prototype,{length:{get:function(){return this._primitives.length}}}),a.prototype.add=function(e){var t=e._external=e._external||{},i=t._composites=t._composites||{};return i[this._guid]={collection:this},this._primitives.push(e),e},a.prototype.remove=function(e){if(this.contains(e)){var t=this._primitives.indexOf(e);if(t!==-1)return this._primitives.splice(t,1),delete e._external._composites[this._guid],this.destroyPrimitives&&e.destroy(),!0}return!1},a.prototype.removeAndDestroy=function(e){var t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t},a.prototype.removeAll=function(){if(this.destroyPrimitives)for(var e=this._primitives,t=e.length,i=0;i<t;++i)e[i].destroy();this._primitives=[]},a.prototype.contains=function(e){return!!(i(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])},a.prototype.raise=function(e){if(i(e)){var t=s(this,e),r=this._primitives;if(t!==r.length-1){var n=r[t];r[t]=r[t+1],r[t+1]=n}}},a.prototype.raiseToTop=function(e){if(i(e)){var t=s(this,e),r=this._primitives;t!==r.length-1&&(r.splice(t,1),r.push(e))}},a.prototype.lower=function(e){if(i(e)){var t=s(this,e),r=this._primitives;if(0!==t){var n=r[t];r[t]=r[t-1],r[t-1]=n}}},a.prototype.lowerToBottom=function(e){if(i(e)){var t=s(this,e),r=this._primitives;0!==t&&(r.splice(t,1),r.unshift(e))}},a.prototype.get=function(e){return this._primitives[e]},a.prototype.update=function(e){if(this.show)for(var t=this._primitives,i=0;i<t.length;++i)t[i].update(e)},a.prototype.isDestroyed=function(){return!1},a.prototype.destroy=function(){return this.removeAll(),n(this)},a});i("Scene/QuadtreeTileProvider",["../Core/defineProperties","../Core/DeveloperError"],function(e,t){"use strict";function i(){t.throwInstantiationError()}return i.computeDefaultLevelZeroMaximumGeometricError=function(e){return 2*e.ellipsoid.maximumRadius*Math.PI*.25/(65*e.getNumberOfXTilesAtLevel(0))},e(i.prototype,{quadtree:{get:t.throwInstantiationError,set:t.throwInstantiationError},ready:{get:t.throwInstantiationError},tilingScheme:{get:t.throwInstantiationError},errorEvent:{get:t.throwInstantiationError}}),i.prototype.beginUpdate=t.throwInstantiationError,i.prototype.endUpdate=t.throwInstantiationError,i.prototype.getLevelMaximumGeometricError=t.throwInstantiationError,i.prototype.loadTile=t.throwInstantiationError,i.prototype.computeTileVisibility=t.throwInstantiationError,i.prototype.showTileThisFrame=t.throwInstantiationError,i.prototype.computeDistanceToTile=t.throwInstantiationError,i.prototype.isDestroyed=t.throwInstantiationError,i.prototype.destroy=t.throwInstantiationError,i}),i("Scene/SceneTransitioner",["../Core/Cartesian3","../Core/Cartographic","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/EasingFunction","../Core/Math","../Core/Matrix4","../Core/Ray","../Core/ScreenSpaceEventHandler","../Core/ScreenSpaceEventType","../Core/Transforms","./Camera","./OrthographicFrustum","./PerspectiveFrustum","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f){"use strict";function _(e){this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0}function g(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new u(e._scene.canvas,!1);var i=function(){e._morphCancelled=!0,t(e)};e._completeMorph=i,e._morphHandler.setInputAction(i,c.LEFT_DOWN),e._morphHandler.setInputAction(i,c.MIDDLE_DOWN),e._morphHandler.setInputAction(i,c.RIGHT_DOWN),e._morphHandler.setInputAction(i,c.WHEEL)}}function v(e){for(var t=e._currentTweens,i=0;i<t.length;++i)t[i].cancelTween();e._currentTweens.length=0,e._morphHandler=e._morphHandler&&e._morphHandler.destroy()}function y(e,t){var i=e._scene,r=i.camera,n=Y,o=n.position,a=n.direction,l=n.up,u=i.mapProjection.unproject(r.position,H);t.cartographicToCartesian(u,o);var c=t.scaleToGeodeticSurface(o,q),d=h.eastNorthUpToFixedFrame(c,t,j);return s.multiplyByPointAsVector(d,r.direction,a),s.multiplyByPointAsVector(d,r.up,l),n}function C(t,i,r,n){function a(t){S(c,m,t.time,u.position),S(h,f,t.time,u.direction),S(p,_,t.time,u.up),e.cross(u.direction,u.up,u.right),e.normalize(u.right,u.right)}i*=.5;var l=t._scene,u=l.camera,c=e.clone(u.position,X),h=e.clone(u.direction,Z),p=e.clone(u.up,K),m=s.multiplyByPoint(d.TRANSFORM_2D_INVERSE,r.position,Q),f=s.multiplyByPointAsVector(d.TRANSFORM_2D_INVERSE,r.direction,J),_=s.multiplyByPointAsVector(d.TRANSFORM_2D_INVERSE,r.up,$),g=l.tweens.add({duration:i,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:a,complete:function(){D(t,l,0,1,i,n)}});t._currentTweens.push(g)}function w(t,i,r){function n(t){S(d,_,t.time,l.position),S(p,v,t.time,l.direction),S(m,w,t.time,l.up),e.cross(l.direction,l.up,l.right),e.normalize(l.right,l.right);var i=l.frustum;i.right=a.lerp(E,b,t.time),i.left=-i.right,i.top=i.right*(s.drawingBufferHeight/s.drawingBufferWidth),i.bottom=-i.top,l.position.z=2*s.mapProjection.ellipsoid.maximumRadius}i/=3;var s=t._scene,l=s.camera,u=ee;u.aspectRatio=s.drawingBufferWidth/s.drawingBufferHeight,u.fov=a.toRadians(60);var c;i>0?(c=Y,e.fromDegrees(0,0,5*r.maximumRadius,r,c.position),e.negate(c.position,c.direction),e.normalize(c.direction,c.direction),e.clone(e.UNIT_Z,c.up)):(l.position.z=l.frustum.right-l.frustum.left,c=y(t,r)),c.frustum=u;var h=M(c);g(t,h);var d=e.clone(l.position,ve),p=e.clone(l.direction,ye),m=e.clone(l.up,Ce),_=e.fromElements(0,0,5*r.maximumRadius,we),v=e.negate(e.UNIT_Z,Se),w=e.clone(e.UNIT_Y,Ee),E=l.frustum.right,b=.5*_.z;if(i>0){var T=s.tweens.add({duration:i,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:n,complete:function(){s._mode=f.MORPHING,x(t,i,c,function(){C(t,i,c,h)})}});t._currentTweens.push(T)}else x(t,i,c,function(){C(t,i,c,h)})}function S(t,i,r,n){return e.lerp(t,i,r,n)}function E(e,t,i,r,n){function s(e){u.frustum.fov=a.lerp(c,h,e.time);var t=d/Math.tan(.5*u.frustum.fov);r(u,t)}var l=e._scene,u=l.camera,c=u.frustum.fov,h=.5*a.RADIANS_PER_DEGREE,d=i.position.z*Math.tan(.5*c);u.frustum.far=d/Math.tan(.5*h)+1e7;var p=l.tweens.add({duration:t,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:s,complete:function(){u.frustum=i.frustum.clone(),n(e)}});e._currentTweens.push(p)}function b(t,r){function n(t){S(c,_,t.time,u.position),S(h,m,t.time,u.direction),S(p,f,t.time,u.up),e.cross(u.direction,u.up,u.right),e.normalize(u.right,u.right)}function a(e,t){e.position.z=t}r*=.5;var l=t._scene,u=l.camera,c=e.clone(u.position,te),h=e.clone(u.direction,ie),p=e.clone(u.up,re),m=e.negate(e.UNIT_Z,oe),f=e.clone(e.UNIT_Y,ae),_=ne;if(r>0)e.clone(e.ZERO,ne),_.z=5*l.mapProjection.ellipsoid.maximumRadius;else{e.clone(c,ne);var v=le;s.multiplyByPoint(d.TRANSFORM_2D,c,v.origin),s.multiplyByPointAsVector(d.TRANSFORM_2D,h,v.direction);var y=l.globe;if(i(y)){var C=y.pick(v,l,ue);i(C)&&(s.multiplyByPoint(d.TRANSFORM_2D_INVERSE,C,_),_.z+=e.distance(c,_))}}var w=se;w.right=.5*_.z,w.left=-w.right,w.top=w.right*(l.drawingBufferHeight/l.drawingBufferWidth),w.bottom=-w.top;var b=ce;b.position=_,b.direction=m,b.up=f,b.frustum=w;var T=I(b);g(t,T);var x=l.tweens.add({duration:r,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:n,complete:function(){E(t,r,b,a,T)}});t._currentTweens.push(x)}function T(t,r,n){function o(e,t){e.position.x=t}function a(){E(t,r,c,o,b)}r*=.5;var l=t._scene,u=l.camera,c=de;if(r>0)e.clone(e.ZERO,c.position),c.position.z=5*n.maximumRadius,e.negate(e.UNIT_Z,c.direction),e.clone(e.UNIT_Y,c.up);else{n.cartesianToCartographic(u.positionWC,he),l.mapProjection.project(he,c.position),e.negate(e.UNIT_Z,c.direction),e.clone(e.UNIT_Y,c.up);var p=fe;e.clone(c.position2D,p.origin);var m=e.clone(u.directionWC,p.direction),f=n.scaleToGeodeticSurface(u.positionWC,ge),_=h.eastNorthUpToFixedFrame(f,n,_e);s.inverseTransformation(_,_),s.multiplyByPointAsVector(_,m,m),s.multiplyByPointAsVector(d.TRANSFORM_2D,m,m);var v=l.globe;if(i(v)){var y=v.pick(p,l,me);if(i(y)){var C=e.distance(c.position2D,y);y.x+=C,e.clone(y,c.position2D)}}}s.multiplyByPoint(d.TRANSFORM_2D,c.position,c.position2D),s.multiplyByPointAsVector(d.TRANSFORM_2D,c.direction,c.direction2D),s.multiplyByPointAsVector(d.TRANSFORM_2D,c.up,c.up2D);var w=c.frustum;w.right=.5*c.position.z,w.left=-w.right,w.top=w.right*(l.drawingBufferHeight/l.drawingBufferWidth),w.bottom=-w.top;var S=pe;s.multiplyByPoint(d.TRANSFORM_2D_INVERSE,c.position2D,S.position),e.clone(c.direction,S.direction),e.clone(c.up,S.up),S.frustum=w;var b=I(S);g(t,b),P(t,r,c,a)}function x(e,t,i,r){function n(e){l.frustum.fov=a.lerp(h,c,e.time),l.position.z=d/Math.tan(.5*l.frustum.fov)}var s=e._scene,l=s.camera,u=l.frustum.right-l.frustum.left;l.frustum=i.frustum.clone();var c=l.frustum.fov,h=.5*a.RADIANS_PER_DEGREE,d=u*Math.tan(.5*c);l.frustum.far=d/Math.tan(.5*h)+1e7,l.frustum.fov=h;var p=s.tweens.add({duration:t,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:n,complete:function(){r(e)}});e._currentTweens.push(p)}function A(t,i,r,n){function s(t){S(c,p,t.time,u.position),S(h,m,t.time,u.direction),S(d,_,t.time,u.up),e.cross(u.direction,u.up,u.right),e.normalize(u.right,u.right);var i=u.frustum;i.right=a.lerp(g,v,t.time),i.left=-i.right,i.top=i.right*(l.drawingBufferHeight/l.drawingBufferWidth),i.bottom=-i.top,u.position.z=2*l.mapProjection.ellipsoid.maximumRadius}i*=.5;var l=t._scene,u=l.camera,c=e.clone(u.position,ve),h=e.clone(u.direction,ye),d=e.clone(u.up,Ce),p=e.clone(r.position,we),m=e.clone(r.direction,Se),_=e.clone(r.up,Ee),g=u.frustum.right,v=.5*p.z,y=l.tweens.add({duration:i,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:s,complete:function(){l._mode=f.MORPHING,x(t,i,r,n)}});t._currentTweens.push(y)}function P(t,i,r,n){function a(t){S(u,d,t.time,l.position),S(c,p,t.time,l.direction),S(h,m,t.time,l.up),e.cross(l.direction,l.up,l.right),e.normalize(l.right,l.right)}var s=t._scene,l=s.camera,u=e.clone(l.position,ve),c=e.clone(l.direction,ye),h=e.clone(l.up,Ce),d=e.clone(r.position2D,we),p=e.clone(r.direction2D,Se),m=e.clone(r.up2D,Ee),f=s.tweens.add({duration:i,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:a,complete:function(){D(t,s,1,0,i,n)}});t._currentTweens.push(f)}function D(e,t,r,n,a,s){var l={object:t,property:"morphTime",startValue:r,stopValue:n,duration:a,easingFunction:o.QUARTIC_OUT};i(s)&&(l.complete=function(){s(e)});var u=t.tweens.addProperty(l);e._currentTweens.push(u)}function M(t){return function(r){var n=r._scene;if(n._mode=f.SCENE3D,n.morphTime=f.getMorphTime(f.SCENE3D),v(r),r._previousMode!==f.MORPHING||r._morphCancelled){r._morphCancelled=!1;var o=n.camera;e.clone(t.position,o.position),e.clone(t.direction,o.direction),e.clone(t.up,o.up),e.cross(o.direction,o.up,o.right),e.normalize(o.right,o.right),i(t.frustum)&&(o.frustum=t.frustum.clone())}var a=i(r._completeMorph);r._completeMorph=void 0,n.camera.update(n.mode),r._scene.morphComplete.raiseEvent(r,r._previousMode,f.SCENE3D,a)}}function I(t){return function(r){var n=r._scene;n._mode=f.SCENE2D,n.morphTime=f.getMorphTime(f.SCENE2D),v(r);var o=n.camera;e.clone(t.position,o.position),o.position.z=2*n.mapProjection.ellipsoid.maximumRadius,e.clone(t.direction,o.direction),e.clone(t.up,o.up),e.cross(o.direction,o.up,o.right),e.normalize(o.right,o.right),o.frustum=t.frustum.clone();var a=i(r._completeMorph);r._completeMorph=void 0,n.camera.update(n.mode),r._scene.morphComplete.raiseEvent(r,r._previousMode,f.SCENE2D,a)}}function R(t){return function(r){var n=r._scene;if(n._mode=f.COLUMBUS_VIEW,n.morphTime=f.getMorphTime(f.COLUMBUS_VIEW),v(r),n.camera.frustum=t.frustum.clone(),r._previousModeMode!==f.MORPHING||r._morphCancelled){r._morphCancelled=!1;var o=n.camera;e.clone(t.position,o.position),e.clone(t.direction,o.direction),e.clone(t.up,o.up),e.cross(o.direction,o.up,o.right),e.normalize(o.right,o.right)}var a=i(r._completeMorph);r._completeMorph=void 0,n.camera.update(n.mode),r._scene.morphComplete.raiseEvent(r,r._previousMode,f.COLUMBUS_VIEW,a)}}_.prototype.completeMorph=function(){i(this._completeMorph)&&this._completeMorph()},_.prototype.morphTo2D=function(e,t){i(this._completeMorph)&&this._completeMorph();var r=this._scene;this._previousMode=r.mode,this._previousMode!==f.SCENE2D&&this._previousMode!==f.MORPHING&&(this._scene.morphStart.raiseEvent(this,this._previousMode,f.SCENE2D,!0),r._mode=f.MORPHING,r.camera._setTransform(s.IDENTITY),this._previousMode===f.COLUMBUS_VIEW?b(this,e):T(this,e,t),0===e&&i(this._completeMorph)&&this._completeMorph())};var O=new e,N=new e,L=new e,B=new e,F=new e,V=new e,k=new e,z=new t,U=new s,G=new m,W={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};_.prototype.morphToColumbusView=function(t,r){i(this._completeMorph)&&this._completeMorph();var n=this._scene;if(this._previousMode=n.mode,this._previousMode!==f.COLUMBUS_VIEW&&this._previousMode!==f.MORPHING){this._scene.morphStart.raiseEvent(this,this._previousMode,f.COLUMBUS_VIEW,!0),n.camera._setTransform(s.IDENTITY);var o=O,l=N,u=L;if(t>0)o.x=0,o.y=0,o.z=5*r.maximumRadius,e.negate(e.UNIT_Z,l),e.clone(e.UNIT_Y,u);else{var c=n.camera;if(this._previousMode===f.SCENE2D)e.clone(c.position,o),o.z=c.frustum.right-c.frustum.left,e.negate(e.UNIT_Z,l),e.clone(e.UNIT_Y,u);else{e.clone(c.positionWC,o),e.clone(c.directionWC,l),e.clone(c.upWC,u);var p=r.scaleToGeodeticSurface(o,k),m=h.eastNorthUpToFixedFrame(p,r,U);s.inverseTransformation(m,m),n.mapProjection.project(r.cartesianToCartographic(o,z),o),s.multiplyByPointAsVector(m,l,l),s.multiplyByPointAsVector(m,u,u)}}var _=G;_.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,_.fov=a.toRadians(60);var v=W;v.position=o,v.direction=l,v.up=u,v.frustum=_;var y=R(v);g(this,y),this._previousMode===f.SCENE2D?A(this,t,v,y):(v.position2D=s.multiplyByPoint(d.TRANSFORM_2D,o,B),v.direction2D=s.multiplyByPointAsVector(d.TRANSFORM_2D,l,F),v.up2D=s.multiplyByPointAsVector(d.TRANSFORM_2D,u,V),n._mode=f.MORPHING,P(this,t,v,y)),0===t&&i(this._completeMorph)&&this._completeMorph()}},_.prototype.morphTo3D=function(t,r){i(this._completeMorph)&&this._completeMorph();var n=this._scene;if(this._previousMode=n.mode,this._previousMode!==f.SCENE3D&&this._previousMode!==f.MORPHING){if(this._scene.morphStart.raiseEvent(this,this._previousMode,f.SCENE3D,!0),n._mode=f.MORPHING,n.camera._setTransform(s.IDENTITY),this._previousMode===f.SCENE2D)w(this,t,r);else{var o;t>0?(o=Y,e.fromDegrees(0,0,5*r.maximumRadius,r,o.position),e.negate(o.position,o.direction),e.normalize(o.direction,o.direction),e.clone(e.UNIT_Z,o.up)):o=y(this,r);var a=M(o);g(this,a),C(this,t,o,a)}0===t&&i(this._completeMorph)&&this._completeMorph()}},_.prototype.isDestroyed=function(){return!1},_.prototype.destroy=function(){return v(this),r(this)};var H=new t,q=new e,j=new s,Y={position:new e,direction:new e,up:new e,frustum:void 0},X=new e,Z=new e,K=new e,Q=new e,J=new e,$=new e,ee=new m,te=new e,ie=new e,re=new e,ne=new e,oe=new e,ae=new e,se=new p,le=new l,ue=new e,ce={position:void 0,direction:void 0,up:void 0,frustum:void 0},he=new t,de={position:new e,direction:new e,up:new e,position2D:new e,direction2D:new e,up2D:new e,frustum:new p},pe={position:new e,direction:new e,up:new e,frustum:void 0},me=new e,fe=new l,_e=new s,ge=new e,ve=new e,ye=new e,Ce=new e,we=new e,Se=new e,Ee=new e;return _}),i("Scene/TweenCollection",["../Core/clone","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/EasingFunction","../Core/getTimestamp","../Core/TimeConstants","../ThirdParty/Tween"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(t,i,r,n,o,a,s,l,u,c){this._tweens=t,this._tweenjs=i,this._startObject=e(r),this._stopObject=e(n),this._duration=o,this._delay=a,this._easingFunction=s,this._update=l,this._complete=u,this.cancel=c,this.needsStart=!0}function c(){this._tweens=[]}return r(u.prototype,{startObject:{get:function(){return this._startObject}},stopObject:{get:function(){return this._stopObject}},duration:{get:function(){return this._duration}},delay:{get:function(){return this._delay}},easingFunction:{get:function(){return this._easingFunction}},update:{get:function(){return this._update}},complete:{get:function(){return this._complete}},tweenjs:{get:function(){return this._tweenjs}}}),u.prototype.cancelTween=function(){this._tweens.remove(this)},r(c.prototype,{length:{get:function(){return this._tweens.length}}}),c.prototype.add=function(r){if(r=t(r,t.EMPTY_OBJECT),0===r.duration)return i(r.complete)&&r.complete(),new u(this);var n=r.duration/s.SECONDS_PER_MILLISECOND,a=t(r.delay,0),c=a/s.SECONDS_PER_MILLISECOND,h=t(r.easingFunction,o.LINEAR_NONE),d=r.startObject,p=new l.Tween(d);p.to(e(r.stopObject),n),p.delay(c),p.easing(h),i(r.update)&&p.onUpdate(function(){r.update(d)}),p.onComplete(t(r.complete,null)),p.repeat(t(r._repeat,0));var m=new u(this,p,r.startObject,r.stopObject,r.duration,a,h,r.update,r.complete,r.cancel);return this._tweens.push(m),m},c.prototype.addProperty=function(e){function i(e){r[n]=e.value}e=t(e,t.EMPTY_OBJECT);var r=e.object,n=e.property,o=e.startValue,a=e.stopValue;return this.add({startObject:{value:o},stopObject:{value:a},duration:t(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:i,complete:e.complete,cancel:e.cancel,_repeat:e._repeat})},c.prototype.addAlpha=function(e){function r(e){for(var t=o.length,i=0;i<t;++i)n.uniforms[o[i]].alpha=e.alpha}e=t(e,t.EMPTY_OBJECT);var n=e.material,o=[];for(var a in n.uniforms)n.uniforms.hasOwnProperty(a)&&i(n.uniforms[a])&&i(n.uniforms[a].alpha)&&o.push(a);return this.add({startObject:{alpha:t(e.startValue,0)},stopObject:{alpha:t(e.stopValue,1)},duration:t(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:r,complete:e.complete,cancel:e.cancel})},c.prototype.addOffsetIncrement=function(e){e=t(e,t.EMPTY_OBJECT);var i=e.material,r=i.uniforms;return this.addProperty({object:r,property:"offset",startValue:r.offset,stopValue:r.offset+1,duration:e.duration,delay:e.delay,easingFunction:e.easingFunction,update:e.update,cancel:e.cancel,_repeat:1/0})},c.prototype.remove=function(e){if(!i(e))return!1;var t=this._tweens.indexOf(e);return t!==-1&&(e.tweenjs.stop(),i(e.cancel)&&e.cancel(),this._tweens.splice(t,1),!0)},c.prototype.removeAll=function(){for(var e=this._tweens,t=0;t<e.length;++t){var r=e[t];r.tweenjs.stop(),i(r.cancel)&&r.cancel()}e.length=0},c.prototype.contains=function(e){return i(e)&&this._tweens.indexOf(e)!==-1},c.prototype.get=function(e){return this._tweens[e]},c.prototype.update=function(e){var t=this._tweens,r=0;for(e=i(e)?e/s.SECONDS_PER_MILLISECOND:a();r<t.length;){var n=t[r],o=n.tweenjs;n.needsStart?(n.needsStart=!1,o.start(e)):o.update(e)?r++:(o.stop(), -t.splice(r,1))}},c}),i("Scene/ScreenSpaceCameraController",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Ellipsoid","../Core/IntersectionTests","../Core/isArray","../Core/KeyboardEventModifier","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/Plane","../Core/Quaternion","../Core/Ray","../Core/Transforms","./CameraEventAggregator","./CameraEventType","./MapMode2D","./SceneMode","./SceneTransforms","./TweenCollection"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b){"use strict";function T(i){this.enableInputs=!0,this.enableTranslate=!0,this.enableZoom=!0,this.enableRotate=!0,this.enableTilt=!0,this.enableLook=!0,this.inertiaSpin=.9,this.inertiaTranslate=.9,this.inertiaZoom=.8,this.maximumMovementRatio=.1,this.bounceAnimationTime=3,this.minimumZoomDistance=1,this.maximumZoomDistance=Number.POSITIVE_INFINITY,this.translateEventTypes=C.LEFT_DRAG,this.zoomEventTypes=[C.RIGHT_DRAG,C.WHEEL,C.PINCH],this.rotateEventTypes=C.LEFT_DRAG,this.tiltEventTypes=[C.MIDDLE_DRAG,C.PINCH,{eventType:C.LEFT_DRAG,modifier:h.CTRL},{eventType:C.RIGHT_DRAG,modifier:h.CTRL}],this.lookEventTypes={eventType:C.LEFT_DRAG,modifier:h.SHIFT},this.minimumPickingTerrainHeight=15e4,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight,this.minimumCollisionTerrainHeight=15e3,this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight,this.minimumTrackBallHeight=75e5,this._minimumTrackBallHeight=this.minimumTrackBallHeight,this.enableCollisionDetection=!0,this._scene=i,this._globe=void 0,this._ellipsoid=void 0,this._aggregator=new y(i.canvas),this._lastInertiaSpinMovement=void 0,this._lastInertiaZoomMovement=void 0,this._lastInertiaTranslateMovement=void 0,this._lastInertiaTiltMovement=void 0,this._tweens=new b,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new e(-1,-1),this._tiltCenter=new t,this._rotateMousePosition=new e(-1,-1),this._rotateStartPosition=new t,this._strafeStartPosition=new t,this._zoomMouseStart=new e(-1,-1),this._zoomWorldPosition=new t,this._useZoomWorldPosition=!1,this._tiltCVOffMap=!1,this._looking=!1,this._rotating=!1,this._strafing=!1,this._zoomingOnVector=!1,this._rotatingZoom=!1;var n=i.mapProjection;this._maxCoord=n.project(new r(Math.PI,d.PI_OVER_TWO)),this._zoomFactor=5,this._rotateFactor=void 0,this._rotateRateRangeAdjustment=void 0,this._maximumRotateRate=1.77,this._minimumRotateRate=2e-4,this._minimumZoomRate=20,this._maximumZoomRate=5906376272e3}function x(e,t){if(e<0)return 0;var i=25*(1-t);return Math.exp(-i*e)}function A(t){return e.equalsEpsilon(t.startPosition,t.endPosition,d.EPSILON14)}function P(t,i,r,n,a,s,l){var u=s[l];o(u)||(u=s[l]={startPosition:new e,endPosition:new e,motion:new e,active:!1});var c=t.getButtonPressTime(i,r),h=t.getButtonReleaseTime(i,r),d=c&&h&&(h.getTime()-c.getTime())/1e3,p=new Date,m=h&&(p.getTime()-h.getTime())/1e3;if(c&&h&&d<$){var f=x(m,n);if(u.active)u.startPosition=e.clone(u.endPosition,u.startPosition),u.endPosition=e.multiplyByScalar(u.motion,f,u.endPosition),u.endPosition=e.add(u.startPosition,u.endPosition,u.endPosition),u.motion=e.clone(e.ZERO,u.motion);else{var _=t.getLastMovement(i,r);if(!o(_)||A(_))return;u.motion.x=.5*(_.endPosition.x-_.startPosition.x),u.motion.y=.5*(_.endPosition.y-_.startPosition.y),u.startPosition=e.clone(_.startPosition,u.startPosition),u.endPosition=e.multiplyByScalar(u.motion,f,u.endPosition),u.endPosition=e.add(u.startPosition,u.endPosition,u.endPosition),u.active=!0}if(isNaN(u.endPosition.x)||isNaN(u.endPosition.y)||e.distance(u.startPosition,u.endPosition)<.5)return void(u.active=!1);if(!t.isButtonDown(i,r)){var g=t.getStartMousePosition(i,r);a(s,g,u)}}else u.active=!1}function D(e,t,i,r,n,a){if(o(i)){var s=e._aggregator;c(i)||(ee[0]=i,i=ee);for(var l=i.length,u=0;u<l;++u){var h=i[u],d=o(h.eventType)?h.eventType:h,p=h.modifier,m=s.isMoving(d,p)&&s.getMovement(d,p),f=s.getStartMousePosition(d,p);e.enableInputs&&t&&(m?r(e,f,m):n<1&&P(s,d,p,n,r,e,a))}}}function M(i,r,n,a,s,l){var u=1;o(l)&&(u=d.clamp(Math.abs(l),.25,1));var c=i.minimumZoomDistance*u,h=i.maximumZoomDistance,p=s-c,m=a*p;m=d.clamp(m,i._minimumZoomRate,i._maximumZoomRate);var f=n.endPosition.y-n.startPosition.y,_=f/i._scene.canvas.clientHeight;_=Math.min(_,i.maximumMovementRatio);var g=m*_;if(!(g>0&&Math.abs(s-c)<1||g<0&&Math.abs(s-h)<1)){s-g<c?g=s-c-1:s-g>h&&(g=s-h);var v,y=i._scene,C=y.camera,w=y.mode,b=e.equals(r,i._zoomMouseStart),T=i._zoomingOnVector,x=i._rotatingZoom;if(b||(i._zoomMouseStart=e.clone(r,i._zoomMouseStart),o(i._globe)&&(v=w!==S.SCENE2D?B(i,r,ie):C.getPickRay(r,te).origin),o(v)?(i._useZoomWorldPosition=!0,i._zoomWorldPosition=t.clone(v,i._zoomWorldPosition)):i._useZoomWorldPosition=!1,T=i._zoomingOnVector=!1,x=i._rotatingZoom=!1),!i._useZoomWorldPosition)return void C.zoomIn(g);var A=w===S.COLUMBUS_VIEW;if(C.positionCartographic.height<2e6&&(x=!0),!b||x){if(w===S.SCENE2D){var P=i._zoomWorldPosition,D=C.position;if(!t.equals(P,D)&&C.positionCartographic.height<2*i._maxCoord.x){var M=C.position.x,I=t.subtract(P,D,ne);t.normalize(I,I);var R=t.distance(P,D)*g/(.5*C.getMagnitude());C.move(I,.5*R),(C.position.x<0&&M>0||C.position.x>0&&M<0)&&(v=C.getPickRay(r,te).origin,i._zoomWorldPosition=t.clone(v,i._zoomWorldPosition))}}else if(w===S.SCENE3D){var O=t.normalize(C.position,ce);if(C.positionCartographic.height<3e3&&Math.abs(t.dot(C.direction,O))<.6)A=!0;else{var N=y.canvas,L=oe;L.x=N.clientWidth/2,L.y=N.clientHeight/2;var F=B(i,L,ae);if(o(F)&&C.positionCartographic.height<1e6){var V=de;t.clone(C.position,V);var k=i._zoomWorldPosition,z=he;if(z=t.normalize(k,z),t.dot(z,O)<0)return;var U=Ce,G=fe;t.clone(C.direction,G),t.add(V,t.multiplyByScalar(G,1e3,we),U);var W=_e,H=ge;t.subtract(k,V,W),t.normalize(W,H);var q=Math.acos(-t.dot(O,H)),j=t.magnitude(V),Y=t.magnitude(k),X=j-g,Z=t.magnitude(W),K=Math.asin(d.clamp(Z/Y*Math.sin(q),-1,1)),Q=Math.asin(d.clamp(X/Y*Math.sin(q),-1,1)),J=K-Q+q,$=pe;t.normalize(V,$);var ee=me;ee=t.cross(H,$,ee),ee=t.normalize(ee,ee),t.normalize(t.cross($,ee,we),G),t.multiplyByScalar(t.normalize(U,we),t.magnitude(U)-g,U),t.normalize(V,V),t.multiplyByScalar(V,X,V);var be=ve;t.multiplyByScalar(t.add(t.multiplyByScalar($,Math.cos(J)-1,Se),t.multiplyByScalar(G,Math.sin(J),Ee),we),X,be),t.add(V,be,V),t.normalize(U,$),t.normalize(t.cross($,ee,we),G);var Te=ye;return t.multiplyByScalar(t.add(t.multiplyByScalar($,Math.cos(J)-1,Se),t.multiplyByScalar(G,Math.sin(J),Ee),we),t.magnitude(U),Te),t.add(U,Te,U),t.clone(V,C.position),t.normalize(t.subtract(U,V,we),C.direction),t.clone(C.direction,C.direction),t.cross(C.direction,C.up,C.right),void t.cross(C.right,C.direction,C.up)}if(o(F)){var xe=t.normalize(F,se),Ae=t.normalize(i._zoomWorldPosition,le),Pe=t.dot(Ae,xe);if(Pe>0&&Pe<1){var De=d.acosClamped(Pe),Me=t.cross(Ae,xe,ue),Ie=Math.abs(De)>d.toRadians(20)?.75*C.positionCartographic.height:C.positionCartographic.height-g,Re=g/Ie;C.rotate(Me,De*Re)}}else A=!0}}i._rotatingZoom=!A}if(!b&&A||T){var Oe,Ne=E.wgs84ToWindowCoordinates(y,i._zoomWorldPosition,re);Oe=w!==S.COLUMBUS_VIEW&&e.equals(r,i._zoomMouseStart)&&o(Ne)?C.getPickRay(Ne,te):C.getPickRay(r,te);var Le=Oe.direction;w===S.COLUMBUS_VIEW&&t.fromElements(Le.y,Le.z,Le.x,Le),C.move(Le,g),i._zoomingOnVector=!0}else C.zoomIn(g)}}function I(e,i,r){var n=e._scene,o=n.camera,a=o.getPickRay(r.startPosition,be).origin,s=o.getPickRay(r.endPosition,Te).origin,l=t.subtract(a,s,xe),u=t.magnitude(l);u>0&&(t.normalize(l,l),o.move(l,u))}function R(e,t,i){o(i.distance)&&(i=i.distance);var r=e._scene,n=r.camera;M(e,t,i,e._zoomFactor,n.getMagnitude())}function O(t,i,r){if(o(r.angleAndHeight))return void N(t,i,r.angleAndHeight);var n=t._scene,a=n.camera,s=n.canvas,l=s.clientWidth,u=s.clientHeight,c=Ae;c.x=2/l*r.startPosition.x-1,c.y=2/u*(u-r.startPosition.y)-1,c=e.normalize(c,c);var h=Pe;h.x=2/l*r.endPosition.x-1,h.y=2/u*(u-r.endPosition.y)-1,h=e.normalize(h,h);var p=d.acosClamped(c.x);c.y<0&&(p=d.TWO_PI-p);var m=d.acosClamped(h.x);h.y<0&&(m=d.TWO_PI-m);var f=m-p;a.twistRight(f)}function N(e,t,i){var r=e._rotateFactor*e._rotateRateRangeAdjustment;r>e._maximumRotateRate&&(r=e._maximumRotateRate),r<e._minimumRotateRate&&(r=e._minimumRotateRate);var n=e._scene,o=n.camera,a=n.canvas,s=(i.endPosition.x-i.startPosition.x)/a.clientWidth;s=Math.min(s,e.maximumMovementRatio);var l=r*s*Math.PI*4;o.twistRight(l)}function L(e){var t=e._scene.mapMode2D===w.ROTATE;m.equals(m.IDENTITY,e._scene.camera.transform)?(D(e,e.enableTranslate,e.translateEventTypes,I,e.inertiaTranslate,"_lastInertiaTranslateMovement"),D(e,e.enableZoom,e.zoomEventTypes,R,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&D(e,e.enableRotate,e.tiltEventTypes,O,e.inertiaSpin,"_lastInertiaTiltMovement")):(D(e,e.enableZoom,e.zoomEventTypes,R,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&D(e,e.enableRotate,e.translateEventTypes,O,e.inertiaSpin,"_lastInertiaSpinMovement"))}function B(e,i,r){var n=e._scene,a=e._globe,s=n.camera;if(o(a)){var l;n.pickPositionSupported&&(l=n.pickPosition(i,Me));var u=s.getPickRay(i,De),c=a.pick(u,n,Ie),h=o(l)?t.distance(l,s.positionWC):Number.POSITIVE_INFINITY,d=o(c)?t.distance(c,s.positionWC):Number.POSITIVE_INFINITY;return h<d?t.clone(l,r):t.clone(c,r)}}function F(i,r,n){if(t.equals(r,i._translateMousePosition)||(i._looking=!1),t.equals(r,i._strafeMousePosition)||(i._strafing=!1),i._looking)return void Q(i,r,n);if(i._strafing)return void W(i,r,n);var a,s=i._scene,l=s.camera,c=e.clone(n.startPosition,ke),h=e.clone(n.endPosition,ze),p=l.getPickRay(c,Re),m=t.clone(t.ZERO,Fe),_=t.UNIT_X;if(l.position.z<i._minimumPickingTerrainHeight&&(a=B(i,c,Ne),o(a)&&(m.x=a.x)),m.x>l.position.z&&o(a))return t.clone(a,i._strafeStartPosition),i._strafing=!0,W(i,r,n),void(i._strafeMousePosition=e.clone(r,i._strafeMousePosition));var g=f.fromPointNormal(m,_,Ve);p=l.getPickRay(c,Re);var v=u.rayPlane(p,g,Ne),y=l.getPickRay(h,Oe),C=u.rayPlane(y,g,Le);if(!o(v)||!o(C))return i._looking=!0,Q(i,r,n),void e.clone(r,i._translateMousePosition);var w=t.subtract(v,C,Be),S=w.x;w.x=w.y,w.y=w.z,w.z=S;var E=t.magnitude(w);E>d.EPSILON6&&(t.normalize(w,w),l.move(w,E))}function V(t,i,r){if(o(r.angleAndHeight)&&(r=r.angleAndHeight),e.equals(i,t._tiltCenterMousePosition)||(t._tiltCVOffMap=!1,t._looking=!1),t._looking)return void Q(t,i,r);var n=t._scene,a=n.camera,s=t._maxCoord,l=Math.abs(a.position.x)-s.x<0&&Math.abs(a.position.y)-s.y<0;t._tiltCVOffMap||!l||a.position.z>t._minimumPickingTerrainHeight?(t._tiltCVOffMap=!0,k(t,i,r)):z(t,i,r)}function k(i,r,n){var a=i._scene,s=a.camera,u=a.canvas,c=Ue;c.x=u.clientWidth/2,c.y=u.clientHeight/2;var h,p=s.getPickRay(c,Ge),f=t.UNIT_X,_=p.origin,g=p.direction,y=t.dot(f,g);if(Math.abs(y)>d.EPSILON6&&(h=-t.dot(f,_)/y),!o(h)||h<=0)return i._looking=!0,Q(i,r,n),void e.clone(r,i._tiltCenterMousePosition);var C=t.multiplyByScalar(g,h,We);t.add(_,C,C);var w=a.mapProjection,S=w.ellipsoid;t.fromElements(C.y,C.z,C.x,C);var E=w.unproject(C,Ke);S.cartographicToCartesian(E,C);var b=v.eastNorthUpToFixedFrame(C,S,qe),T=i._globe,x=i._ellipsoid;i._globe=void 0,i._ellipsoid=l.UNIT_SPHERE,i._rotateFactor=1,i._rotateRateRangeAdjustment=1;var A=m.clone(s.transform,Qe);s._setTransform(b),q(i,r,n,t.UNIT_Z),s._setTransform(A),i._globe=T,i._ellipsoid=x;var P=x.maximumRadius;i._rotateFactor=1/P,i._rotateRateRangeAdjustment=P}function z(i,r,n){var a,s,c=i._scene,h=c.camera,g=t.UNIT_X;if(e.equals(r,i._tiltCenterMousePosition))a=t.clone(i._tiltCenter,We);else{if(h.position.z<i._minimumPickingTerrainHeight&&(a=B(i,r,We)),!o(a)){s=h.getPickRay(r,Ge);var y,C=s.origin,w=s.direction,S=t.dot(g,w);if(Math.abs(S)>d.EPSILON6&&(y=-t.dot(g,C)/S),!o(y)||y<=0)return i._looking=!0,Q(i,r,n),void e.clone(r,i._tiltCenterMousePosition);a=t.multiplyByScalar(w,y,We),t.add(C,a,a)}e.clone(r,i._tiltCenterMousePosition),t.clone(a,i._tiltCenter)}var E=c.canvas,b=Ue;b.x=E.clientWidth/2,b.y=i._tiltCenterMousePosition.y,s=h.getPickRay(b,Ge);var T=t.clone(t.ZERO,Ye);T.x=a.x;var x=f.fromPointNormal(T,g,Xe),A=u.rayPlane(s,x,He),P=h._projection,D=P.ellipsoid;t.fromElements(a.y,a.z,a.x,a);var M=P.unproject(a,Ke);D.cartographicToCartesian(M,a);var I,R=v.eastNorthUpToFixedFrame(a,D,qe);o(A)?(t.fromElements(A.y,A.z,A.x,A),M=P.unproject(A,Ke),D.cartographicToCartesian(M,A),I=v.eastNorthUpToFixedFrame(A,D,je)):I=R;var O=i._globe,N=i._ellipsoid;i._globe=void 0,i._ellipsoid=l.UNIT_SPHERE,i._rotateFactor=1,i._rotateRateRangeAdjustment=1;var L=t.UNIT_Z,F=m.clone(h.transform,Qe);h._setTransform(R);var V=t.cross(t.UNIT_Z,t.normalize(h.position,Ze),Ze),k=t.dot(h.right,V);if(q(i,r,n,L,!1,!0),h._setTransform(I),k<0){n.startPosition.y>n.endPosition.y&&(L=void 0);var z=h.constrainedAxis;h.constrainedAxis=void 0,q(i,r,n,L,!0,!1),h.constrainedAxis=z}else q(i,r,n,L,!0,!1);if(o(h.constrainedAxis)){var U=t.cross(h.direction,h.constrainedAxis,Dt);t.equalsEpsilon(U,t.ZERO,d.EPSILON6)||(t.dot(U,h.right)<0&&t.negate(U,U),t.cross(U,h.direction,h.up),t.cross(h.direction,h.up,h.right),t.normalize(h.up,h.up),t.normalize(h.right,h.right))}h._setTransform(F),i._globe=O,i._ellipsoid=N;var G=N.maximumRadius;i._rotateFactor=1/G,i._rotateRateRangeAdjustment=G;var W=t.clone(h.positionWC,Ze);if(h._adjustHeightForTerrain(),!t.equals(h.positionWC,W)){h._setTransform(I),h.worldToCameraCoordinatesPoint(W,W);var H=t.magnitudeSquared(W);t.magnitudeSquared(h.position)>H&&(t.normalize(h.position,h.position),t.multiplyByScalar(h.position,Math.sqrt(H),h.position));var j=t.angleBetween(W,h.position),Y=t.cross(W,h.position,W);t.normalize(Y,Y);var X=_.fromAxisAngle(Y,j,Je),Z=p.fromQuaternion(X,$e);p.multiplyByVector(Z,h.direction,h.direction),p.multiplyByVector(Z,h.up,h.up),t.cross(h.direction,h.up,h.right),t.cross(h.right,h.direction,h.up),h._setTransform(F)}}function U(e,i,r){o(r.distance)&&(r=r.distance);var n=e._scene,a=n.camera,s=n.canvas,l=et;l.x=s.clientWidth/2,l.y=s.clientHeight/2;var u,c=a.getPickRay(l,tt);a.position.z<e._minimumPickingTerrainHeight&&(u=B(e,l,it));var h;if(o(u))h=t.distance(c.origin,u);else{var d=t.UNIT_X,p=c.origin,m=c.direction;h=-t.dot(d,p)/t.dot(d,m)}M(e,i,r,e._zoomFactor,h)}function G(e){var t=e._scene,i=t.camera;if(m.equals(m.IDENTITY,i.transform)){var r=e._tweens;if(e._aggregator.anyButtonDown&&r.removeAll(),D(e,e.enableTilt,e.tiltEventTypes,V,e.inertiaSpin,"_lastInertiaTiltMovement"),D(e,e.enableTranslate,e.translateEventTypes,F,e.inertiaTranslate,"_lastInertiaTranslateMovement"),D(e,e.enableZoom,e.zoomEventTypes,U,e.inertiaZoom,"_lastInertiaZoomMovement"),D(e,e.enableLook,e.lookEventTypes,Q),!(e._aggregator.anyButtonDown||o(e._lastInertiaZoomMovement)&&e._lastInertiaZoomMovement.active||o(e._lastInertiaTranslateMovement)&&e._lastInertiaTranslateMovement.active||r.contains(e._tween))){var n=i.createCorrectPositionTween(e.bounceAnimationTime);o(n)&&(e._tween=r.add(n))}r.update()}else D(e,e.enableRotate,e.rotateEventTypes,q,e.inertiaSpin,"_lastInertiaSpinMovement"),D(e,e.enableZoom,e.zoomEventTypes,Y,e.inertiaZoom,"_lastInertiaZoomMovement")}function W(e,i,r){var n=e._scene,a=n.camera,s=B(e,r.startPosition,ut);if(o(s)){var l=r.endPosition,c=a.getPickRay(l,rt),h=t.clone(a.direction,at);n.mode===S.COLUMBUS_VIEW&&t.fromElements(h.z,h.x,h.y,h);var d=f.fromPointNormal(s,h,nt),p=u.rayPlane(c,d,ot);o(p)&&(h=t.subtract(s,p,h),n.mode===S.COLUMBUS_VIEW&&t.fromElements(h.y,h.z,h.x,h),t.add(a.position,h,a.position))}}function H(i,r,n){var a=i._scene,s=a.camera;if(!m.equals(s.transform,m.IDENTITY))return void q(i,r,n);var u,c,h,d,p=i._ellipsoid.geodeticSurfaceNormal(s.position,dt),f=i._ellipsoid.cartesianToCartographic(s.positionWC,lt).height,_=i._globe,g=!1;if(o(_)&&f<i._minimumPickingTerrainHeight&&(d=B(i,n.startPosition,ut),o(d))){var v=s.getPickRay(n.startPosition,De),y=i._ellipsoid.geodeticSurfaceNormal(d);g=Math.abs(t.dot(v.direction,y))<.05,g&&!i._looking&&(i._rotating=!1,i._strafing=!0)}return e.equals(r,i._rotateMousePosition)?void(i._looking?Q(i,r,n,p):i._rotating?q(i,r,n):i._strafing?(t.clone(d,i._strafeStartPosition),W(i,r,n)):(u=t.magnitude(i._rotateStartPosition),c=ct,c.x=c.y=c.z=u,h=l.fromCartesian3(c,ht),j(i,r,n,h))):(i._looking=!1,i._rotating=!1,i._strafing=!1,o(_)&&f<i._minimumPickingTerrainHeight?o(d)?t.magnitude(s.position)<t.magnitude(d)?(t.clone(d,i._strafeStartPosition),i._strafing=!0,W(i,r,n)):(u=t.magnitude(d),c=ct,c.x=c.y=c.z=u,h=l.fromCartesian3(c,ht),j(i,r,n,h),t.clone(d,i._rotateStartPosition)):(i._looking=!0,Q(i,r,n,p)):o(s.pickEllipsoid(n.startPosition,i._ellipsoid,st))?(j(i,r,n,i._ellipsoid),t.clone(st,i._rotateStartPosition)):f>i._minimumTrackBallHeight?(i._rotating=!0,q(i,r,n)):(i._looking=!0,Q(i,r,n,p)),void e.clone(r,i._rotateMousePosition))}function q(e,i,r,a,s,l){s=n(s,!1),l=n(l,!1);var u=e._scene,c=u.camera,h=u.canvas,d=c.constrainedAxis;o(a)&&(c.constrainedAxis=a);var p=t.magnitude(c.position),m=e._rotateFactor*(p-e._rotateRateRangeAdjustment);m>e._maximumRotateRate&&(m=e._maximumRotateRate),m<e._minimumRotateRate&&(m=e._minimumRotateRate);var f=(r.startPosition.x-r.endPosition.x)/h.clientWidth,_=(r.startPosition.y-r.endPosition.y)/h.clientHeight;f=Math.min(f,e.maximumMovementRatio),_=Math.min(_,e.maximumMovementRatio);var g=m*f*Math.PI*2,v=m*_*Math.PI;s||c.rotateRight(g),l||c.rotateUp(v),c.constrainedAxis=d}function j(i,r,n,a){var s=i._scene,l=s.camera,u=e.clone(n.startPosition,yt),c=e.clone(n.endPosition,Ct),h=l.pickEllipsoid(u,a,pt),p=l.pickEllipsoid(c,a,mt);if(!o(h)||!o(p))return i._rotating=!0,void q(i,r,n);if(h=l.worldToCameraCoordinates(h,h),p=l.worldToCameraCoordinates(p,p),o(l.constrainedAxis)){var m=l.constrainedAxis,f=t.mostOrthogonalAxis(m,ft);t.cross(f,m,f),t.normalize(f,f);var _=t.cross(m,f,_t),g=t.magnitude(h),v=t.dot(m,h),y=Math.acos(v/g),C=t.multiplyByScalar(m,v,gt);t.subtract(h,C,C),t.normalize(C,C);var w=t.magnitude(p),S=t.dot(m,p),E=Math.acos(S/w),b=t.multiplyByScalar(m,S,vt);t.subtract(p,b,b),t.normalize(b,b);var T=Math.acos(t.dot(C,f));t.dot(C,_)<0&&(T=d.TWO_PI-T);var x=Math.acos(t.dot(b,f));t.dot(b,_)<0&&(x=d.TWO_PI-x);var A,P=T-x;A=t.equalsEpsilon(m,l.position,d.EPSILON2)?l.right:t.cross(m,l.position,ft);var D,M=t.cross(m,A,ft),I=t.dot(M,t.subtract(h,m,_t)),R=t.dot(M,t.subtract(p,m,_t));D=I>0&&R>0?E-y:I>0&&R<=0?t.dot(l.position,m)>0?-y-E:y+E:y-E,l.rotateRight(P),l.rotateUp(D)}else{t.normalize(h,h),t.normalize(p,p);var O=t.dot(h,p),N=t.cross(h,p,ft);if(O<1&&!t.equalsEpsilon(N,t.ZERO,d.EPSILON14)){var L=Math.acos(O);l.rotate(N,L)}}}function Y(e,i,r){o(r.distance)&&(r=r.distance);var n=e._ellipsoid,a=e._scene,s=a.camera,l=a.canvas,u=et;u.x=l.clientWidth/2,u.y=l.clientHeight/2;var c,h=s.getPickRay(u,tt),d=n.cartesianToCartographic(s.position,St).height;d<e._minimumPickingTerrainHeight&&(c=B(e,u,it));var p;p=o(c)?t.distance(h.origin,c):d;var m=t.normalize(s.position,wt);M(e,i,r,e._zoomFactor,p,t.dot(m,s.direction))}function X(t,i,r){var n=t._scene,a=n.camera;if(m.equals(a.transform,m.IDENTITY)){if(o(r.angleAndHeight)&&(r=r.angleAndHeight),e.equals(i,t._tiltCenterMousePosition)||(t._tiltOnEllipsoid=!1,t._looking=!1),t._looking){var s=t._ellipsoid.geodeticSurfaceNormal(a.position,Nt);return void Q(t,i,r,s)}var l=t._ellipsoid,u=l.cartesianToCartographic(a.position,Ot);t._tiltOnEllipsoid||u.height>t._minimumCollisionTerrainHeight?(t._tiltOnEllipsoid=!0,Z(t,i,r)):K(t,i,r)}}function Z(i,r,n){var a=i._ellipsoid,s=i._scene,c=s.camera,h=.25*i.minimumZoomDistance,p=a.cartesianToCartographic(c.positionWC,Lt).height;if(!(p-h-1<d.EPSILON3&&n.endPosition.y-n.startPosition.y<0)){var f=s.canvas,_=Et;_.x=f.clientWidth/2,_.y=f.clientHeight/2;var y,C=c.getPickRay(_,bt),w=u.rayEllipsoid(C,a);if(o(w))y=g.getPoint(C,w.start,Tt);else{if(!(p>i._minimumTrackBallHeight)){i._looking=!0;var S=i._ellipsoid.geodeticSurfaceNormal(c.position,Nt);return Q(i,r,n,S),void e.clone(r,i._tiltCenterMousePosition)}var E=u.grazingAltitudeLocation(C,a);if(!o(E))return;var b=a.cartesianToCartographic(E,Ot);b.height=0,y=a.cartographicToCartesian(b,Tt)}var T=v.eastNorthUpToFixedFrame(y,a,At),x=i._globe,A=i._ellipsoid;i._globe=void 0,i._ellipsoid=l.UNIT_SPHERE,i._rotateFactor=1,i._rotateRateRangeAdjustment=1;var P=m.clone(c.transform,Mt);c._setTransform(T),q(i,r,n,t.UNIT_Z),c._setTransform(P),i._globe=x,i._ellipsoid=A;var D=A.maximumRadius;i._rotateFactor=1/D,i._rotateRateRangeAdjustment=D}}function K(i,r,n){var a,s,c,h=i._ellipsoid,f=i._scene,y=f.camera;if(e.equals(r,i._tiltCenterMousePosition))a=t.clone(i._tiltCenter,Tt);else{if(a=B(i,r,Tt),!o(a)){if(s=y.getPickRay(r,bt),c=u.rayEllipsoid(s,h),!o(c)){var C=h.cartesianToCartographic(y.position,Ot);if(C.height<=i._minimumTrackBallHeight){i._looking=!0;var w=i._ellipsoid.geodeticSurfaceNormal(y.position,Nt);Q(i,r,n,w),e.clone(r,i._tiltCenterMousePosition)}return}a=g.getPoint(s,c.start,Tt)}e.clone(r,i._tiltCenterMousePosition),t.clone(a,i._tiltCenter)}var S=f.canvas,E=Et;E.x=S.clientWidth/2,E.y=i._tiltCenterMousePosition.y,s=y.getPickRay(E,bt);var b=t.magnitude(a),T=t.fromElements(b,b,b,ct),x=l.fromCartesian3(T,ht);if(c=u.rayEllipsoid(s,x),o(c)){var A=t.magnitude(s.origin)>b?c.start:c.stop,P=g.getPoint(s,A,xt),D=v.eastNorthUpToFixedFrame(a,h,At),M=v.eastNorthUpToFixedFrame(P,x,Pt),I=i._globe,R=i._ellipsoid;i._globe=void 0,i._ellipsoid=l.UNIT_SPHERE,i._rotateFactor=1,i._rotateRateRangeAdjustment=1;var O=t.UNIT_Z,N=m.clone(y.transform,Mt);y._setTransform(D);var L=t.cross(P,y.positionWC,Dt),F=t.dot(y.rightWC,L);if(q(i,r,n,O,!1,!0),y._setTransform(M),F<0){n.startPosition.y>n.endPosition.y&&(O=void 0);var V=y.constrainedAxis;y.constrainedAxis=void 0,q(i,r,n,O,!0,!1),y.constrainedAxis=V}else q(i,r,n,O,!0,!1);if(o(y.constrainedAxis)){var k=t.cross(y.direction,y.constrainedAxis,Dt);t.equalsEpsilon(k,t.ZERO,d.EPSILON6)||(t.dot(k,y.right)<0&&t.negate(k,k),t.cross(k,y.direction,y.up),t.cross(y.direction,y.up,y.right),t.normalize(y.up,y.up),t.normalize(y.right,y.right))}y._setTransform(N),i._globe=I,i._ellipsoid=R;var z=R.maximumRadius;i._rotateFactor=1/z,i._rotateRateRangeAdjustment=z;var U=t.clone(y.positionWC,Dt);if(y._adjustHeightForTerrain(),!t.equals(y.positionWC,U)){y._setTransform(M),y.worldToCameraCoordinatesPoint(U,U);var G=t.magnitudeSquared(U);t.magnitudeSquared(y.position)>G&&(t.normalize(y.position,y.position),t.multiplyByScalar(y.position,Math.sqrt(G),y.position));var W=t.angleBetween(U,y.position),H=t.cross(U,y.position,U);t.normalize(H,H);var j=_.fromAxisAngle(H,W,It),Y=p.fromQuaternion(j,Rt);p.multiplyByVector(Y,y.direction,y.direction),p.multiplyByVector(Y,y.up,y.up),t.cross(y.direction,y.up,y.right),t.cross(y.right,y.direction,y.up),y._setTransform(N)}}}function Q(e,i,r,a){var s=e._scene,l=s.camera,u=Bt;u.x=r.startPosition.x,u.y=0;var c=Ft;c.x=r.endPosition.x,c.y=0;var h=l.getPickRay(u,Vt).direction,p=l.getPickRay(c,kt).direction,m=0,f=t.dot(h,p);f<1&&(m=Math.acos(f)),m=r.startPosition.x>r.endPosition.x?-m:m;var _=e._horizontalRotationAxis;if(o(a)?l.look(a,-m):o(_)?l.look(_,-m):l.lookLeft(m),u.x=0,u.y=r.startPosition.y,c.x=0,c.y=r.endPosition.y,h=l.getPickRay(u,Vt).direction,p=l.getPickRay(c,kt).direction,m=0,f=t.dot(h,p),f<1&&(m=Math.acos(f)),m=r.startPosition.y>r.endPosition.y?-m:m,a=n(a,_),o(a)){var g=l.direction,v=t.negate(a,zt),y=t.equalsEpsilon(g,a,d.EPSILON2),C=t.equalsEpsilon(g,v,d.EPSILON2);if(y||C)(y&&m<0||C&&m>0)&&l.look(l.right,-m);else{f=t.dot(g,a);var w=d.acosClamped(f);m>0&&m>w&&(m=w-d.EPSILON4),f=t.dot(g,v),w=d.acosClamped(f),m<0&&-m>w&&(m=-w+d.EPSILON4);var S=t.cross(a,g,Ut);l.look(S,m)}}else l.lookUp(m)}function J(e){D(e,e.enableRotate,e.rotateEventTypes,H,e.inertiaSpin,"_lastInertiaSpinMovement"),D(e,e.enableZoom,e.zoomEventTypes,Y,e.inertiaZoom,"_lastInertiaZoomMovement"),D(e,e.enableTilt,e.tiltEventTypes,X,e.inertiaSpin,"_lastInertiaTiltMovement"),D(e,e.enableLook,e.lookEventTypes,Q)}var $=.4,ee=[],te=new g,ie=new t,re=new e,ne=new t,oe=new e,ae=new t,se=new t,le=new t,ue=new t,ce=new t,he=new t,de=new t,pe=new t,me=new t,fe=new t,_e=new t,ge=new t,ve=new t,ye=new t,Ce=new t,we=new t,Se=new t,Ee=new t,be=new g,Te=new g,xe=new t,Ae=new e,Pe=new e,De=new g,Me=new t,Ie=new t,Re=new g,Oe=new g,Ne=new t,Le=new t,Be=new t,Fe=new t,Ve=new f(t.ZERO,0),ke=new e,ze=new e,Ue=new e,Ge=new g,We=new t,He=new t,qe=new m,je=new m,Ye=new t,Xe=new f(t.ZERO,0),Ze=new t,Ke=new r,Qe=new m,Je=new _,$e=new p,et=new e,tt=new g,it=new t,rt=new g,nt=new f(t.ZERO,0),ot=new t,at=new t,st=new t,lt=new r,ut=new t,ct=new t,ht=new l,dt=new t,pt=i.clone(i.UNIT_W),mt=i.clone(i.UNIT_W),ft=new t,_t=new t,gt=new t,vt=new t,yt=new e,Ct=new e,wt=new t,St=new r,Et=new e,bt=new g,Tt=new t,xt=new t,At=new m,Pt=new m,Dt=new t,Mt=new m,It=new _,Rt=new p,Ot=new r,Nt=new t,Lt=new r,Bt=new e,Ft=new e,Vt=new g,kt=new g,zt=new t,Ut=new t;return T.prototype.update=function(){m.equals(this._scene.camera.transform,m.IDENTITY)?(this._globe=this._scene.globe,this._ellipsoid=o(this._globe)?this._globe.ellipsoid:this._scene.mapProjection.ellipsoid):(this._globe=void 0,this._ellipsoid=l.UNIT_SPHERE),this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight*this._scene.terrainExaggeration,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight*this._scene.terrainExaggeration,this._minimumTrackBallHeight=this.minimumTrackBallHeight*this._scene.terrainExaggeration;var e=this._ellipsoid.maximumRadius;this._rotateFactor=1/e,this._rotateRateRangeAdjustment=e;var i=this._scene,r=i.mode;r===S.SCENE2D?L(this):r===S.COLUMBUS_VIEW?(this._horizontalRotationAxis=t.UNIT_Z,G(this)):r===S.SCENE3D&&(this._horizontalRotationAxis=void 0,J(this)),this._aggregator.reset()},T.prototype.isDestroyed=function(){return!1},T.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),a(this)},T}),i("Scene/ShadowMapShader",["../Core/defined","../Renderer/ShaderSource"],function(e,t){"use strict";function i(){}return i.createShadowCastVertexShader=function(i,r,n){var o=i.defines.slice(0),a=i.sources.slice(0);n&&o.push("GENERATE_POSITION");var s=t.findPositionVarying(i),l=e(s);if(r&&!l){for(var u=a.length,c=0;c<u;++c)a[c]=t.replaceMain(a[c],"czm_shadow_cast_main");var h="varying vec3 v_positionEC; \nvoid main() \n{ \n czm_shadow_cast_main(); \n v_positionEC = (czm_inverseProjection * gl_Position).xyz; \n}";a.push(h)}return new t({defines:o,sources:a})},i.createShadowCastFragmentShader=function(i,r,n,o){var a=i.defines.slice(0),s=i.sources.slice(0),l=t.findPositionVarying(i),u=e(l);u||(l="v_positionEC");for(var c=s.length,h=0;h<c;++h)s[h]=t.replaceMain(s[h],"czm_shadow_cast_main");var d="";return r&&(u||(d+="varying vec3 v_positionEC; \n"),d+="uniform vec4 shadowMap_lightPositionEC; \n"),d+=o?"void main() \n{ \n":"void main() \n{ \n czm_shadow_cast_main(); \n if (gl_FragColor.a == 0.0) \n { \n discard; \n } \n",d+=r?"float distance = length("+l+"); \ndistance /= shadowMap_lightPositionEC.w; // radius \ngl_FragColor = czm_packDepth(distance); \n":n?"gl_FragColor = vec4(1.0); \n":"gl_FragColor = czm_packDepth(gl_FragCoord.z); \n",d+="} \n",s.push(d),new t({defines:a,sources:s})},i.createShadowReceiveVertexShader=function(e,i,r){var n=e.defines.slice(0),o=e.sources.slice(0);return i&&(r?n.push("GENERATE_POSITION_AND_NORMAL"):n.push("GENERATE_POSITION")),new t({defines:n,sources:o})},i.createShadowReceiveFragmentShader=function(i,r,n,o,a){for(var s=t.findNormalVarying(i),l=!o&&e(s)||o&&a,u=t.findPositionVarying(i),c=e(u),h=r._usesDepthTexture,d=r._polygonOffsetSupported,p=r._isPointLight,m=r._isSpotLight,f=r._numberOfCascades>1,_=r.debugCascadeColors,g=r.softShadows,v=p?r._pointBias:o?r._terrainBias:r._primitiveBias,y=i.defines.slice(0),C=i.sources.slice(0),w=C.length,S=0;S<w;++S)C[S]=t.replaceMain(C[S],"czm_shadow_receive_main");p?y.push("USE_CUBE_MAP_SHADOW"):h&&y.push("USE_SHADOW_DEPTH_TEXTURE"),g&&!p&&y.push("USE_SOFT_SHADOWS"),f&&n&&o&&(l?y.push("ENABLE_VERTEX_LIGHTING"):y.push("ENABLE_DAYNIGHT_SHADING")),n&&v.normalShading&&l&&(y.push("USE_NORMAL_SHADING"),v.normalShadingSmooth>0&&y.push("USE_NORMAL_SHADING_SMOOTH"));var E="";return E+=p?"uniform samplerCube shadowMap_textureCube; \n":"uniform sampler2D shadowMap_texture; \n",E+="uniform mat4 shadowMap_matrix; \nuniform vec3 shadowMap_lightDirectionEC; \nuniform vec4 shadowMap_lightPositionEC; \nuniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness; \nuniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth; \nvec4 getPositionEC() \n{ \n"+(c?" return vec4("+u+", 1.0); \n":" return czm_windowToEyeCoordinates(gl_FragCoord); \n")+"} \nvec3 getNormalEC() \n{ \n"+(l?" return normalize("+s+"); \n":" return vec3(1.0); \n")+"} \nvoid applyNormalOffset(inout vec4 positionEC, vec3 normalEC, float nDotL) \n{ \n"+(v.normalOffset&&l?" float normalOffset = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.x; \n float normalOffsetScale = 1.0 - nDotL; \n vec3 offset = normalOffset * normalOffsetScale * normalEC; \n positionEC.xyz += offset; \n":"")+"} \n",E+="void main() \n{ \n czm_shadow_receive_main(); \n vec4 positionEC = getPositionEC(); \n vec3 normalEC = getNormalEC(); \n float depth = -positionEC.z; \n",E+=" czm_shadowParameters shadowParameters; \n shadowParameters.texelStepSize = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy; \n shadowParameters.depthBias = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z; \n shadowParameters.normalShadingSmooth = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w; \n shadowParameters.darkness = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w; \n",o?E+=" shadowParameters.depthBias *= max(depth * 0.01, 1.0); \n":d||(E+=" shadowParameters.depthBias *= mix(1.0, 100.0, depth * 0.0015); \n"),E+=p?" vec3 directionEC = positionEC.xyz - shadowMap_lightPositionEC.xyz; \n float distance = length(directionEC); \n directionEC = normalize(directionEC); \n float radius = shadowMap_lightPositionEC.w; \n // Stop early if the fragment is beyond the point light radius \n if (distance > radius) \n { \n return; \n } \n vec3 directionWC = czm_inverseViewRotation * directionEC; \n shadowParameters.depth = distance / radius; \n shadowParameters.nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); \n shadowParameters.texCoords = directionWC; \n float visibility = czm_shadowVisibility(shadowMap_textureCube, shadowParameters); \n":m?" vec3 directionEC = normalize(positionEC.xyz - shadowMap_lightPositionEC.xyz); \n float nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); \n applyNormalOffset(positionEC, normalEC, nDotL); \n vec4 shadowPosition = shadowMap_matrix * positionEC; \n // Spot light uses a perspective projection, so perform the perspective divide \n shadowPosition /= shadowPosition.w; \n // Stop early if the fragment is not in the shadow bounds \n if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) \n { \n return; \n } \n shadowParameters.texCoords = shadowPosition.xy; \n shadowParameters.depth = shadowPosition.z; \n shadowParameters.nDotL = nDotL; \n float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); \n":f?" float maxDepth = shadowMap_cascadeSplits[1].w; \n // Stop early if the eye depth exceeds the last cascade \n if (depth > maxDepth) \n { \n return; \n } \n // Get the cascade based on the eye-space depth \n vec4 weights = czm_cascadeWeights(depth); \n // Apply normal offset \n float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); \n applyNormalOffset(positionEC, normalEC, nDotL); \n // Transform position into the cascade \n vec4 shadowPosition = czm_cascadeMatrix(weights) * positionEC; \n // Get visibility \n shadowParameters.texCoords = shadowPosition.xy; \n shadowParameters.depth = shadowPosition.z; \n shadowParameters.nDotL = nDotL; \n float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); \n // Fade out shadows that are far away \n float shadowMapMaximumDistance = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.z; \n float fade = max((depth - shadowMapMaximumDistance * 0.8) / (shadowMapMaximumDistance * 0.2), 0.0); \n visibility = mix(visibility, 1.0, fade); \n"+(_?" // Draw cascade colors for debugging \n gl_FragColor *= czm_cascadeColor(weights); \n":""):" float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); \n applyNormalOffset(positionEC, normalEC, nDotL); \n vec4 shadowPosition = shadowMap_matrix * positionEC; \n // Stop early if the fragment is not in the shadow bounds \n if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) \n { \n return; \n } \n shadowParameters.texCoords = shadowPosition.xy; \n shadowParameters.depth = shadowPosition.z; \n shadowParameters.nDotL = nDotL; \n float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); \n", -E+=" gl_FragColor.rgb *= visibility; \n} \n",C.push(E),new t({defines:y,sources:C})},i}),i("Scene/ShadowMap",["../Core/BoundingRectangle","../Core/BoundingSphere","../Core/BoxOutlineGeometry","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/clone","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/combine","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/FeatureDetection","../Core/GeometryInstance","../Core/Intersect","../Core/Math","../Core/Matrix4","../Core/PixelFormat","../Core/Quaternion","../Core/SphereOutlineGeometry","../Core/WebGLConstants","../Renderer/ClearCommand","../Renderer/ContextLimits","../Renderer/CubeMap","../Renderer/DrawCommand","../Renderer/Framebuffer","../Renderer/Pass","../Renderer/PassState","../Renderer/PixelDatatype","../Renderer/Renderbuffer","../Renderer/RenderbufferFormat","../Renderer/RenderState","../Renderer/Sampler","../Renderer/ShaderProgram","../Renderer/Texture","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","./Camera","./CullFace","./CullingVolume","./DebugCameraPrimitive","./OrthographicFrustum","./PerInstanceColorAppearance","./PerspectiveFrustum","./Primitive","./ShadowMapShader"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I,R,O,N,L,B,F,V,k,z,U,G,W,H,q,j,Y,X,Z,K){"use strict";function Q(e){e=h(e,h.EMPTY_OBJECT);var i=e.context;this._enabled=h(e.enabled,!0),this._softShadows=h(e.softShadows,!1),this.dirty=!0,this.fromLightSource=h(e.fromLightSource,!0),this.darkness=h(e.darkness,.3),this._darkness=this.darkness,this.maximumDistance=h(e.maximumDistance,5e3),this._outOfView=!1,this._outOfViewPrevious=!1,this._needsUpdate=!0;var a=!0;(_.isInternetExplorer()||_.isEdge()||(_.isChrome()||_.isFirefox())&&_.isWindows()&&!i.depthTexture)&&(a=!1),this._polygonOffsetSupported=a,this._terrainBias={polygonOffset:a,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:!0,normalOffsetScale:.5,normalShading:!0,normalShadingSmooth:.3,depthBias:1e-4},this._primitiveBias={polygonOffset:a,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:!0,normalOffsetScale:.1,normalShading:!0,normalShadingSmooth:.05,depthBias:2e-5},this._pointBias={polygonOffset:!1,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:!1,normalOffsetScale:0,normalShading:!0,normalShadingSmooth:.1,depthBias:5e-4},this._depthAttachment=void 0,this._colorAttachment=void 0,this._shadowMapMatrix=new C,this._shadowMapTexture=void 0,this._lightDirectionEC=new n,this._lightPositionEC=new o,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new fe,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new t,this._isPointLight=h(e.isPointLight,!1),this._pointLightRadius=h(e.pointLightRadius,100),this._cascadesEnabled=!this._isPointLight&&h(e.cascadesEnabled,!0),this._numberOfCascades=this._cascadesEnabled?h(e.numberOfCascades,4):0,this._fitNearFar=!0,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new r,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new j:d(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new o,new o],this._cascadeMatrices=[new C,new C,new C,new C],this._cascadeDistances=new o;var s;s=this._isPointLight?6:this._cascadesEnabled?this._numberOfCascades:1,this._passes=new Array(s);for(var u=0;u<s;++u)this._passes[u]=new J(i);this.debugShow=!1,this.debugFreezeFrame=!1,this._debugFreezeFrame=!1,this._debugCascadeColors=!1,this._debugLightFrustum=void 0,this._debugCameraFrustum=void 0,this._debugCascadeFrustums=new Array(this._numberOfCascades),this._debugShadowViewCommand=void 0,this._usesDepthTexture=i.depthTexture,this._isPointLight&&(this._usesDepthTexture=!1),this._primitiveRenderState=void 0,this._terrainRenderState=void 0,this._pointRenderState=void 0,ee(this),this._clearCommand=new T({depth:1,color:new l}),this._clearPassState=new I(i),this._size=h(e.size,2048),this.size=this._size}function J(e){this.camera=new fe,this.passState=new I(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function $(e,t){return L.fromCache({cull:{enabled:!0,face:W.BACK},depthTest:{enabled:!0},colorMask:{red:e,green:e,blue:e,alpha:e},depthMask:!0,polygonOffset:{enabled:t.polygonOffset,factor:t.polygonOffsetFactor,units:t.polygonOffsetUnits}})}function ee(e){var t=!e._usesDepthTexture;e._primitiveRenderState=$(t,e._primitiveBias),e._terrainRenderState=$(t,e._terrainBias),e._pointRenderState=$(t,e._pointBias)}function te(e){for(var t=e._passes.length,i=0;i<t;++i){var r=e._passes[i],n=r.framebuffer;d(n)&&!n.isDestroyed()&&n.destroy(),r.framebuffer=void 0}e._depthAttachment=e._depthAttachment&&e._depthAttachment.destroy(),e._colorAttachment=e._colorAttachment&&e._colorAttachment.destroy()}function ie(){return new B({wrapS:U.CLAMP_TO_EDGE,wrapT:U.CLAMP_TO_EDGE,minificationFilter:z.NEAREST,magnificationFilter:k.NEAREST})}function re(e,t){for(var i=new O({context:t,width:e._textureSize.x,height:e._textureSize.y,format:N.DEPTH_COMPONENT16}),r=new V({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:w.RGBA,pixelDatatype:R.UNSIGNED_BYTE,sampler:ie()}),n=new D({context:t,depthRenderbuffer:i,colorTextures:[r],destroyAttachments:!1}),o=e._passes.length,a=0;a<o;++a){var s=e._passes[a];s.framebuffer=n,s.passState.framebuffer=n}e._shadowMapTexture=r,e._depthAttachment=i,e._colorAttachment=r}function ne(e,t){for(var i=new V({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:w.DEPTH_STENCIL,pixelDatatype:R.UNSIGNED_INT_24_8,sampler:ie()}),r=new D({context:t,depthStencilTexture:i,destroyAttachments:!1}),n=e._passes.length,o=0;o<n;++o){var a=e._passes[o];a.framebuffer=r,a.passState.framebuffer=r}e._shadowMapTexture=i,e._depthAttachment=i}function oe(e,t){for(var i=new O({context:t,width:e._textureSize.x,height:e._textureSize.y,format:N.DEPTH_COMPONENT16}),r=new A({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:w.RGBA,pixelDatatype:R.UNSIGNED_BYTE,sampler:ie()}),n=[r.negativeX,r.negativeY,r.negativeZ,r.positiveX,r.positiveY,r.positiveZ],o=0;o<6;++o){var a=new D({context:t,depthRenderbuffer:i,colorTextures:[n[o]],destroyAttachments:!1}),s=e._passes[o];s.framebuffer=a,s.passState.framebuffer=a}e._shadowMapTexture=r,e._depthAttachment=i,e._colorAttachment=r}function ae(e,t){e._isPointLight?oe(e,t):e._usesDepthTexture?ne(e,t):re(e,t)}function se(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==b.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,ee(e),te(e),ae(e,t))}function le(e,t){d(e._passes[0].framebuffer)&&e._shadowMapTexture.width===e._textureSize.x||(te(e),ae(e,t),se(e,t),ue(e,t))}function ue(e,t,i){i=h(i,0),(e._isPointLight||0===i)&&(e._clearCommand.framebuffer=e._passes[i].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function ce(t,i){t._size=i;var r=t._passes,n=r.length,o=t._textureSize;if(t._isPointLight){i=x.maximumCubeMapSize>=i?i:x.maximumCubeMapSize,o.x=i,o.y=i;var a=new e(0,0,i,i);r[0].passState.viewport=a,r[1].passState.viewport=a,r[2].passState.viewport=a,r[3].passState.viewport=a,r[4].passState.viewport=a,r[5].passState.viewport=a}else 1===n?(i=x.maximumTextureSize>=i?i:x.maximumTextureSize,o.x=i,o.y=i,r[0].passState.viewport=new e(0,0,i,i)):4===n&&(i=x.maximumTextureSize>=2*i?i:x.maximumTextureSize/2,o.x=2*i,o.y=2*i,r[0].passState.viewport=new e(0,0,i,i),r[1].passState.viewport=new e(i,0,i,i),r[2].passState.viewport=new e(0,i,i,i),r[3].passState.viewport=new e(i,i,i,i));t._clearPassState.viewport=new e(0,0,o.x,o.y);for(var s=0;s<n;++s){var l=r[s],u=l.passState.viewport,c=u.x/o.x,h=u.y/o.y,d=u.width/o.x,p=u.height/o.y;l.textureOffsets=new C(d,0,0,c,0,p,0,h,0,0,1,0,0,0,0,1)}}function he(e,t){var i;i=e._isPointLight?"uniform samplerCube shadowMap_textureCube; \nvarying vec2 v_textureCoordinates; \nvoid main() \n{ \n vec2 uv = v_textureCoordinates; \n vec3 dir; \n \n if (uv.y < 0.5) \n { \n if (uv.x < 0.333) \n { \n dir.x = -1.0; \n dir.y = uv.x * 6.0 - 1.0; \n dir.z = uv.y * 4.0 - 1.0; \n } \n else if (uv.x < 0.666) \n { \n dir.y = -1.0; \n dir.x = uv.x * 6.0 - 3.0; \n dir.z = uv.y * 4.0 - 1.0; \n } \n else \n { \n dir.z = -1.0; \n dir.x = uv.x * 6.0 - 5.0; \n dir.y = uv.y * 4.0 - 1.0; \n } \n } \n else \n { \n if (uv.x < 0.333) \n { \n dir.x = 1.0; \n dir.y = uv.x * 6.0 - 1.0; \n dir.z = uv.y * 4.0 - 3.0; \n } \n else if (uv.x < 0.666) \n { \n dir.y = 1.0; \n dir.x = uv.x * 6.0 - 3.0; \n dir.z = uv.y * 4.0 - 3.0; \n } \n else \n { \n dir.z = 1.0; \n dir.x = uv.x * 6.0 - 5.0; \n dir.y = uv.y * 4.0 - 3.0; \n } \n } \n \n float shadow = czm_unpackDepth(textureCube(shadowMap_textureCube, dir)); \n gl_FragColor = vec4(vec3(shadow), 1.0); \n} \n":"uniform sampler2D shadowMap_texture; \nvarying vec2 v_textureCoordinates; \nvoid main() \n{ \n"+(e._usesDepthTexture?" float shadow = texture2D(shadowMap_texture, v_textureCoordinates).r; \n":" float shadow = czm_unpackDepth(texture2D(shadowMap_texture, v_textureCoordinates)); \n")+" gl_FragColor = vec4(vec3(shadow), 1.0); \n} \n";var r=t.createViewportQuadCommand(i,{uniformMap:{shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture}}});return r.pass=M.OVERLAY,r}function de(t,i){var r=i.context,n=i.context.drawingBufferWidth,o=i.context.drawingBufferHeight,a=.3*Math.min(n,o),s=Ee;s.x=n-a,s.y=0,s.width=a,s.height=a;var l=t._debugShadowViewCommand;d(l)||(l=he(t,r),t._debugShadowViewCommand=l),d(l.renderState)&&e.equals(l.renderState.viewport,s)||(l.renderState=L.fromCache({viewport:e.clone(s)})),i.commandList.push(t._debugShadowViewCommand)}function pe(e,t){var r=new g({geometry:new i({minimum:new n(-.5,-.5,-.5),maximum:new n(.5,.5,.5)}),attributes:{color:u.fromColor(t)}}),o=new g({geometry:new E({radius:.5}),attributes:{color:u.fromColor(t)}});return new Z({geometryInstances:[r,o],appearance:new Y({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}function me(e,t){de(e,t);var i=e.debugFreezeFrame&&!e._debugFreezeFrame;if(e._debugFreezeFrame=e.debugFreezeFrame,e.debugFreezeFrame&&(i&&(e._debugCameraFrustum=e._debugCameraFrustum&&e._debugCameraFrustum.destroy(),e._debugCameraFrustum=new q({camera:e._sceneCamera,color:l.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){i&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new q({camera:e._shadowMapCamera,color:l.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t);for(var r=0;r<e._numberOfCascades;++r)i&&(e._debugCascadeFrustums[r]=e._debugCascadeFrustums[r]&&e._debugCascadeFrustums[r].destroy(),e._debugCascadeFrustums[r]=new q({camera:e._passes[r].camera,color:Pe[r],updateOnChange:!1})),e._debugCascadeFrustums[r].update(t)}}else if(e._isPointLight){if(!d(e._debugLightFrustum)||e._needsUpdate){var o=e._shadowMapCamera.positionWC,a=S.IDENTITY,s=2*e._pointLightRadius,u=n.fromElements(s,s,s,De),c=C.fromTranslationQuaternionRotationScale(o,a,u,Te);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=pe(c,l.YELLOW)}e._debugLightFrustum.update(t)}else d(e._debugLightFrustum)&&!e._needsUpdate||(e._debugLightFrustum=new q({camera:e._shadowMapCamera,color:l.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function fe(){this.viewMatrix=new C,this.inverseViewMatrix=new C,this.frustum=void 0,this.positionCartographic=new a,this.positionWC=new n,this.directionWC=n.clone(n.UNIT_Z),this.upWC=n.clone(n.UNIT_Y),this.rightWC=n.clone(n.UNIT_X),this.viewProjectionMatrix=new C}function _e(e,t){var i,r=e._shadowMapCamera,a=e._sceneCamera,s=a.frustum.near,l=a.frustum.far,u=e._numberOfCascades,c=l-s,h=l/s,d=.9,p=!1;t.shadowHints.closestObjectSize<200&&(p=!0,d=.9);var m=Oe,f=Ie;for(f[0]=s,f[u]=l,i=0;i<u;++i){var _=(i+1)/u,g=s*Math.pow(h,_),v=s+c*_,w=y.lerp(v,g,d);f[i+1]=w,m[i]=w-f[i]}if(p){for(i=0;i<u;++i)m[i]=Math.min(m[i],e._maximumCascadeDistances[i]);var S=f[0];for(i=0;i<u-1;++i)S+=m[i],f[i+1]=S}o.unpack(f,0,e._cascadeSplits[0]),o.unpack(f,1,e._cascadeSplits[1]),o.unpack(m,0,e._cascadeDistances);var E=r.frustum,b=E.left,T=E.right,x=E.bottom,A=E.top,P=E.near,D=E.far,M=r.positionWC,I=r.directionWC,R=r.upWC,O=a.frustum.clone(Re),N=r.getViewProjection();for(i=0;i<u;++i){O.near=f[i],O.far=f[i+1];for(var L=C.multiply(O.projectionMatrix,a.viewMatrix,Te),B=C.inverse(L,Te),F=C.multiply(N,B,Te),V=n.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Fe),k=n.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Ve),z=0;z<8;++z){var U=o.clone(be[z],xe[z]);C.multiplyByVector(F,U,U),n.divideByScalar(U,U.w,U),n.minimumByComponent(U,V,V),n.maximumByComponent(U,k,k)}V.x=Math.max(V.x,0),V.y=Math.max(V.y,0),V.z=0,k.x=Math.min(k.x,1),k.y=Math.min(k.y,1),k.z=Math.min(k.z,1);var G=e._passes[i],W=G.camera;W.clone(r);var H=W.frustum;H.left=b+V.x*(T-b),H.right=b+k.x*(T-b),H.bottom=x+V.y*(A-x),H.top=x+k.y*(A-x),H.near=P+V.z*(D-P),H.far=P+k.z*(D-P),G.cullingVolume=W.frustum.computeCullingVolume(M,I,R);var q=e._cascadeMatrices[i];C.multiply(W.getViewProjection(),a.inverseViewMatrix,q),C.multiply(G.textureOffsets,q,q)}}function ge(e,t){var i=e._shadowMapCamera,r=e._sceneCamera,a=C.multiply(r.frustum.projectionMatrix,r.viewMatrix,Te),s=C.inverse(a,Te),l=i.directionWC,u=r.directionWC,c=n.cross(l,u,Le);u=n.cross(c,l,Be),n.normalize(u,u),n.normalize(c,c);for(var h=n.fromElements(0,0,0,ke),d=C.computeView(h,l,u,c,Ne),p=C.multiply(d,s,Te),m=n.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Fe),f=n.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Ve),_=0;_<8;++_){var g=o.clone(be[_],xe[_]);C.multiplyByVector(p,g,g),n.divideByScalar(g,g.w,g),n.minimumByComponent(g,m,m),n.maximumByComponent(g,f,f)}f.z+=1e3,m.z-=10;var v=ke;v.x=-(.5*(m.x+f.x)),v.y=-(.5*(m.y+f.y)),v.z=-f.z;var y=C.fromTranslation(v,Te);d=C.multiply(y,d,d);var w=.5*(f.x-m.x),S=.5*(f.y-m.y),E=f.z-m.z,b=i.frustum;b.left=-w,b.right=w,b.bottom=-S,b.top=S,b.near=.01,b.far=E,C.clone(d,i.viewMatrix),C.inverse(d,i.inverseViewMatrix),C.getTranslation(i.inverseViewMatrix,i.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(i.positionWC,i.positionCartographic),n.clone(l,i.directionWC),n.clone(u,i.upWC),n.clone(c,i.rightWC)}function ve(e,t){var i=new X;i.fov=y.PI_OVER_TWO,i.near=1,i.far=e._pointLightRadius,i.aspectRatio=1;for(var r=0;r<6;++r){var n=e._passes[r].camera;n.positionWC=e._shadowMapCamera.positionWC,n.positionCartographic=t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),n.directionWC=ze[r],n.upWC=Ue[r],n.rightWC=Ge[r],C.computeView(n.positionWC,n.directionWC,n.upWC,n.rightWC,n.viewMatrix),C.inverse(n.viewMatrix,n.inverseViewMatrix),n.frustum=i}}function ye(e,i){var r=e._sceneCamera,o=e._shadowMapCamera,a=qe;if(e._cascadesEnabled){if(r.frustum.near>=e.maximumDistance)return e._outOfView=!0,void(e._needsUpdate=!1);var s=i.mapProjection.ellipsoid.geodeticSurfaceNormal(r.positionWC,We),l=n.negate(o.directionWC,He),u=n.dot(s,l),c=y.clamp(u/.1,0,1);if(e._darkness=y.lerp(1,e.darkness,c),u<0)return e._outOfView=!0,void(e._needsUpdate=!1);e._needsUpdate=!0,e._outOfView=!1}else if(e._isPointLight)a.center=o.positionWC,a.radius=e._pointLightRadius,e._outOfView=i.cullingVolume.computeVisibility(a)===v.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(a),t.clone(a,e._boundingSphere);else{var h=o.frustum.far/2,d=n.add(o.positionWC,n.multiplyByScalar(o.directionWC,h,je),je);a.center=d,a.radius=h,e._outOfView=i.cullingVolume.computeVisibility(a)===v.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(a),t.clone(a,e._boundingSphere)}}function Ce(e,t){var i=t.camera,r=e._lightCamera,o=e._sceneCamera,a=e._shadowMapCamera;e._cascadesEnabled?n.clone(r.directionWC,a.directionWC):e._isPointLight?n.clone(r.positionWC,a.positionWC):a.clone(r);var s=e._lightDirectionEC;C.multiplyByPointAsVector(i.viewMatrix,a.directionWC,s),n.normalize(s,s),n.negate(s,s),C.multiplyByPoint(i.viewMatrix,a.positionWC,e._lightPositionEC),e._lightPositionEC.w=e._pointLightRadius;var l,u;e._fitNearFar?(l=Math.min(t.shadowHints.nearPlane,e.maximumDistance),u=Math.min(t.shadowHints.farPlane,e.maximumDistance+1)):(l=i.frustum.near,u=e.maximumDistance),e._sceneCamera=G.clone(i,o),i.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=l,e._sceneCamera.frustum.far=u,e._distance=u-l,ye(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}function we(e,t,i){var r=e._isPointLight?e._pointBias:i?e._terrainBias:e._primitiveBias,n={shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture},shadowMap_matrix:function(){return e._shadowMapMatrix},shadowMap_cascadeSplits:function(){return e._cascadeSplits},shadowMap_cascadeMatrices:function(){return e._cascadeMatrices},shadowMap_lightDirectionEC:function(){return e._lightDirectionEC},shadowMap_lightPositionEC:function(){return e._lightPositionEC},shadowMap_cascadeDistances:function(){return e._cascadeDistances},shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:function(){var t=Ye;return t.x=1/e._textureSize.x,t.y=1/e._textureSize.y,o.fromElements(t.x,t.y,r.depthBias,r.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return o.fromElements(r.normalOffsetScale,e._distance,e.maximumDistance,e._darkness,this.combinedUniforms2)},combinedUniforms1:new o,combinedUniforms2:new o};return c(t,n,!1)}function Se(e,t,i,r,n,o){var a,l,u;if(d(o)&&(a=o.shaderProgram,l=o.renderState,u=o.uniformMap),o=P.shallowClone(i,o),o.castShadows=!0,o.receiveShadows=!1,!d(a)||n!==i.shaderProgram.id||t){d(a)&&a.destroy();var c=i.shaderProgram,h=c.vertexShaderSource,p=c.fragmentShaderSource,m=i.pass===M.GLOBE,f=i.pass!==M.TRANSLUCENT,_=e._isPointLight,g=e._usesDepthTexture,v=K.createShadowCastVertexShader(h,_,m),y=K.createShadowCastFragmentShader(p,_,g,f);a=F.fromCache({context:r,vertexShaderSource:v,fragmentShaderSource:y,attributeLocations:c._attributeLocations}),l=e._primitiveRenderState,_?l=e._pointRenderState:m&&(l=e._terrainRenderState);var C=i.renderState.cull.enabled;C||(l=s(l,!1),l.cull.enabled=!1,l=L.fromCache(l)),u=we(e,i.uniformMap,m)}return o.shaderProgram=a,o.renderState=l,o.uniformMap=u,o}Q.MAXIMUM_DISTANCE=2e4,Q.prototype.debugCreateRenderStates=function(){ee(this)},p(Q.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this.dirty=this._enabled!==e,this._enabled=e}},softShadows:{get:function(){return this._softShadows},set:function(e){this.dirty=this._softShadows!==e,this._softShadows=e}},size:{get:function(){return this._size},set:function(e){ce(this,e)}},outOfView:{get:function(){return this._outOfView}},shadowMapCullingVolume:{get:function(){return this._shadowMapCullingVolume}},passes:{get:function(){return this._passes}},isPointLight:{get:function(){return this._isPointLight}},debugCascadeColors:{get:function(){return this._debugCascadeColors},set:function(e){this.dirty=this._debugCascadeColors!==e,this._debugCascadeColors=e}}});var Ee=new e,be=new Array(8);be[0]=new o(-1,-1,-1,1),be[1]=new o(1,-1,-1,1),be[2]=new o(1,1,-1,1),be[3]=new o(-1,1,-1,1),be[4]=new o(-1,-1,1,1),be[5]=new o(1,-1,1,1),be[6]=new o(1,1,1,1),be[7]=new o(-1,1,1,1);for(var Te=new C,xe=new Array(8),Ae=0;Ae<8;++Ae)xe[Ae]=new o;var Pe=[l.RED,l.GREEN,l.BLUE,l.MAGENTA],De=new n;fe.prototype.clone=function(e){C.clone(e.viewMatrix,this.viewMatrix),C.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),a.clone(e.positionCartographic,this.positionCartographic),n.clone(e.positionWC,this.positionWC),n.clone(e.directionWC,this.directionWC),n.clone(e.upWC,this.upWC),n.clone(e.rightWC,this.rightWC)};var Me=new C(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);fe.prototype.getViewProjection=function(){var e=this.viewMatrix,t=this.frustum.projectionMatrix;return C.multiply(t,e,this.viewProjectionMatrix),C.multiply(Me,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var Ie=new Array(5),Re=new X,Oe=new Array(4),Ne=new C,Le=new n,Be=new n,Fe=new n,Ve=new n,ke=new n,ze=[new n(-1,0,0),new n(0,-1,0),new n(0,0,-1),new n(1,0,0),new n(0,1,0),new n(0,0,1)],Ue=[new n(0,-1,0),new n(0,0,-1),new n(0,-1,0),new n(0,-1,0),new n(0,0,1),new n(0,-1,0)],Ge=[new n(0,0,1),new n(1,0,0),new n(-1,0,0),new n(0,0,-1),new n(1,0,0),new n(1,0,0)],We=new n,He=new n,qe=new t,je=qe.center;Q.prototype.update=function(e){if(Ce(this,e),this._needsUpdate)if(le(this,e.context),this._isPointLight&&ve(this,e),this._cascadesEnabled&&(ge(this,e),this._numberOfCascades>1&&_e(this,e)),this._isPointLight)this._shadowMapCullingVolume=H.fromBoundingSphere(this._boundingSphere);else{var t=this._shadowMapCamera,i=t.positionWC,r=t.directionWC,n=t.upWC;this._shadowMapCullingVolume=t.frustum.computeCullingVolume(i,r,n),1===this._passes.length&&this._passes[0].camera.clone(t)}if(1===this._passes.length){var o=this._sceneCamera.inverseViewMatrix;C.multiply(this._shadowMapCamera.getViewProjection(),o,this._shadowMapMatrix)}this.debugShow&&me(this,e)},Q.prototype.updatePass=function(e,t){ue(this,e,t)};var Ye=new r;return Q.createDerivedCommands=function(e,t,i,r,n,o){d(o)||(o={});var a=t.length>0,s=i.shaderProgram,l=s.vertexShaderSource,u=s.fragmentShaderSource,c=i.pass===M.GLOBE,h=!1;if(c&&(h=i.owner.data.pickTerrain.mesh.encoding.hasVertexNormals),i.castShadows){var p=o.castCommands;d(p)||(p=o.castCommands=[]);var m=o.castShaderProgramId,f=e.length;p.length=f;for(var _=0;_<f;++_)p[_]=Se(e[_],r,i,n,m,p[_]);o.castShaderProgramId=i.shaderProgram.id}if(i.receiveShadows&&a){var g,v;d(o.receiveCommand)&&(g=o.receiveCommand.shaderProgram,v=o.receiveCommand.uniformMap),o.receiveCommand=P.shallowClone(i,o.receiveCommand),o.castShadows=!1,o.receiveShadows=!0;var y=o.receiveShaderCastShadows!==i.castShadows,C=o.receiveShaderProgramId!==i.shaderProgram.id;if(!d(g)||C||r||y){d(g)&&g.destroy();var w=K.createShadowReceiveVertexShader(l,c,h),S=K.createShadowReceiveFragmentShader(u,t[0],i.castShadows,c,h);g=F.fromCache({context:n,vertexShaderSource:w,fragmentShaderSource:S,attributeLocations:s._attributeLocations}),v=we(t[0],i.uniformMap,c)}o.receiveCommand.shaderProgram=g,o.receiveCommand.uniformMap=v,o.receiveShaderProgramId=i.shaderProgram.id,o.receiveShaderCastShadows=i.castShadows}return o},Q.prototype.isDestroyed=function(){return!1},Q.prototype.destroy=function(){te(this),this._debugLightFrustum=this._debugLightFrustum&&this._debugLightFrustum.destroy(),this._debugCameraFrustum=this._debugCameraFrustum&&this._debugCameraFrustum.destroy(),this._debugShadowViewCommand=this._debugShadowViewCommand&&this._debugShadowViewCommand.shaderProgram&&this._debugShadowViewCommand.shaderProgram.destroy();for(var e=0;e<this._numberOfCascades;++e)this._debugCascadeFrustums[e]=this._debugCascadeFrustums[e]&&this._debugCascadeFrustums[e].destroy();return m(this)},Q}),i("Shaders/PostProcessFilters/AdditiveBlend",[],function(){"use strict";return"uniform sampler2D u_texture0;\nuniform sampler2D u_texture1;\nuniform vec2 u_center;\nuniform float u_radius;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec4 color0 = texture2D(u_texture0, v_textureCoordinates);\nvec4 color1 = texture2D(u_texture1, v_textureCoordinates);\nfloat x = length(gl_FragCoord.xy - u_center) / u_radius;\nfloat t = smoothstep(0.5, 0.8, x);\ngl_FragColor = mix(color0 + color1, color0, t);\n}\n"}),i("Shaders/PostProcessFilters/BrightPass",[],function(){"use strict";return"uniform sampler2D u_texture;\nuniform float u_avgLuminance;\nuniform float u_threshold;\nuniform float u_offset;\nvarying vec2 v_textureCoordinates;\nfloat key(float avg)\n{\nfloat guess = 1.5 - (1.5 / (avg * 0.1 + 1.0));\nreturn max(0.0, guess) + 0.1;\n}\nvoid main()\n{\nvec4 color = texture2D(u_texture, v_textureCoordinates);\nvec3 xyz = czm_RGBToXYZ(color.rgb);\nfloat luminance = xyz.r;\nfloat scaledLum = key(u_avgLuminance) * luminance / u_avgLuminance;\nfloat brightLum = max(scaledLum - u_threshold, 0.0);\nfloat brightness = brightLum / (u_offset + brightLum);\nxyz.r = brightness;\ngl_FragColor = vec4(czm_XYZToRGB(xyz), 1.0);\n}\n"}),i("Shaders/PostProcessFilters/GaussianBlur1D",[],function(){"use strict";return"#define SAMPLES 8\nuniform float delta;\nuniform float sigma;\nuniform float direction;\nuniform sampler2D u_texture;\nuniform vec2 u_step;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec2 st = v_textureCoordinates;\nvec2 dir = vec2(1.0 - direction, direction);\nvec3 g;\ng.x = 1.0 / (sqrt(czm_twoPi) * sigma);\ng.y = exp((-0.5 * delta * delta) / (sigma * sigma));\ng.z = g.y * g.y;\nvec4 result = texture2D(u_texture, st) * g.x;\nfor (int i = 1; i < SAMPLES; ++i)\n{\ng.xy *= g.yz;\nvec2 offset = float(i) * dir * u_step;\nresult += texture2D(u_texture, st - offset) * g.x;\nresult += texture2D(u_texture, st + offset) * g.x;\n}\ngl_FragColor = result;\n}\n"}),i("Scene/SunPostProcess",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian4","../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/Math","../Core/Matrix4","../Core/PixelFormat","../Core/Transforms","../Renderer/ClearCommand","../Renderer/Framebuffer","../Renderer/PassState","../Renderer/PixelDatatype","../Renderer/Renderbuffer","../Renderer/RenderbufferFormat","../Renderer/RenderState","../Renderer/Texture","../Shaders/PostProcessFilters/AdditiveBlend","../Shaders/PostProcessFilters/BrightPass","../Shaders/PostProcessFilters/GaussianBlur1D","../Shaders/PostProcessFilters/PassThrough"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S){"use strict";function E(){this._fbo=void 0,this._downSampleFBO1=void 0,this._downSampleFBO2=void 0,this._clearFBO1Command=void 0,this._clearFBO2Command=void 0,this._downSampleCommand=void 0,this._brightPassCommand=void 0,this._blurXCommand=void 0,this._blurYCommand=void 0,this._blendCommand=void 0,this._fullScreenCommand=void 0,this._downSamplePassState=new p,this._downSamplePassState.scissorTest={enable:!0,rectangle:new e},this._upSamplePassState=new p,this._upSamplePassState.scissorTest={enabled:!0,rectangle:new e},this._uCenter=new t,this._uRadius=void 0,this._blurStep=new t}E.prototype.clear=function(e,t){var i=this._clearFBO1Command;r.clone(n(t,r.BLACK),i.color),i.execute(e),i=this._clearFBO2Command,r.clone(n(t,r.BLACK),i.color),i.execute(e)},E.prototype.execute=function(e,t){this._downSampleCommand.execute(e,this._downSamplePassState),this._brightPassCommand.execute(e,this._downSamplePassState),this._blurXCommand.execute(e,this._downSamplePassState),this._blurYCommand.execute(e,this._downSamplePassState),this._fullScreenCommand.framebuffer=t,this._blendCommand.framebuffer=t,this._fullScreenCommand.execute(e),this._blendCommand.execute(e,this._upSamplePassState)};var b=new e,T=new e,x=new i,A=new t,P=new t,D=new l;return E.prototype.update=function(e){var i=e.context,n=e.viewport,a=i.drawingBufferWidth,p=i.drawingBufferHeight,E=this;if(!o(this._downSampleCommand)){this._clearFBO1Command=new h({color:new r}),this._clearFBO2Command=new h({color:new r});var M={};this._downSampleCommand=i.createViewportQuadCommand(S,{uniformMap:M,owner:this}),M={u_avgLuminance:function(){return.5},u_threshold:function(){return.25},u_offset:function(){return.1}},this._brightPassCommand=i.createViewportQuadCommand(C,{uniformMap:M,owner:this});var I=1,R=2;M={delta:function(){return I},sigma:function(){return R},direction:function(){return 0}},this._blurXCommand=i.createViewportQuadCommand(w,{uniformMap:M,owner:this}),M={delta:function(){return I},sigma:function(){return R},direction:function(){return 1}},this._blurYCommand=i.createViewportQuadCommand(w,{uniformMap:M,owner:this}),M={u_center:function(){return E._uCenter},u_radius:function(){return E._uRadius}},this._blendCommand=i.createViewportQuadCommand(y,{uniformMap:M,owner:this}),M={},this._fullScreenCommand=i.createViewportQuadCommand(S,{uniformMap:M,owner:this})}var O=Math.pow(2,Math.ceil(Math.log(a)/Math.log(2))-2),N=Math.pow(2,Math.ceil(Math.log(p)/Math.log(2))-2),L=Math.max(1,O,N),B=T;B.width=L,B.height=L;var F=this._fbo,V=o(F)&&F.getColorTexture(0)||void 0;if(!o(V)||V.width!==a||V.height!==p){F=F&&F.destroy(),this._downSampleFBO1=this._downSampleFBO1&&this._downSampleFBO1.destroy(),this._downSampleFBO2=this._downSampleFBO2&&this._downSampleFBO2.destroy(),this._blurStep.x=this._blurStep.y=1/L;var k=[new v({context:i,width:a,height:p})];F=i.depthTexture?this._fbo=new d({context:i,colorTextures:k,depthTexture:new v({context:i,width:a,height:p,pixelFormat:u.DEPTH_COMPONENT,pixelDatatype:m.UNSIGNED_SHORT})}):this._fbo=new d({context:i,colorTextures:k,depthRenderbuffer:new f({context:i,format:_.DEPTH_COMPONENT16})}),this._downSampleFBO1=new d({context:i,colorTextures:[new v({context:i,width:L,height:L})]}),this._downSampleFBO2=new d({context:i,colorTextures:[new v({context:i,width:L,height:L})]}),this._clearFBO1Command.framebuffer=this._downSampleFBO1,this._clearFBO2Command.framebuffer=this._downSampleFBO2,this._downSampleCommand.framebuffer=this._downSampleFBO1,this._brightPassCommand.framebuffer=this._downSampleFBO2,this._blurXCommand.framebuffer=this._downSampleFBO1,this._blurYCommand.framebuffer=this._downSampleFBO2;var z=g.fromCache({viewport:B});this._downSampleCommand.uniformMap.u_texture=function(){return F.getColorTexture(0)},this._downSampleCommand.renderState=z,this._brightPassCommand.uniformMap.u_texture=function(){return E._downSampleFBO1.getColorTexture(0)},this._brightPassCommand.renderState=z,this._blurXCommand.uniformMap.u_texture=function(){return E._downSampleFBO2.getColorTexture(0)},this._blurXCommand.uniformMap.u_step=function(){return E._blurStep},this._blurXCommand.renderState=z,this._blurYCommand.uniformMap.u_texture=function(){return E._downSampleFBO1.getColorTexture(0)},this._blurYCommand.uniformMap.u_step=function(){return E._blurStep},this._blurYCommand.renderState=z;var U=b;U.width=a,U.height=p;var G=g.fromCache({viewport:U});this._blendCommand.uniformMap.u_texture0=function(){return F.getColorTexture(0)},this._blendCommand.uniformMap.u_texture1=function(){return E._downSampleFBO2.getColorTexture(0)},this._blendCommand.renderState=G,this._fullScreenCommand.uniformMap.u_texture=function(){return F.getColorTexture(0)},this._fullScreenCommand.renderState=G}var W=i.uniformState,H=W.sunPositionWC,q=W.view,j=W.viewProjection,Y=W.projection,X=l.computeViewportTransformation(n,0,1,D),Z=l.multiplyByPoint(q,H,x),K=c.pointToGLWindowCoordinates(j,X,H,A);Z.x+=s.SOLAR_RADIUS;var Q=c.pointToGLWindowCoordinates(Y,X,Z,Z),J=30*t.magnitude(t.subtract(Q,K,Q))*2,$=P;$.x=J,$.y=J;var ee=this._upSamplePassState.scissorTest.rectangle;return ee.x=Math.max(K.x-.5*$.x,0),ee.y=Math.max(K.y-.5*$.y,0),ee.width=Math.min($.x,a),ee.height=Math.min($.y,p),this._uCenter=t.clone(K,this._uCenter),this._uRadius=.5*Math.max($.x,$.y),X=l.computeViewportTransformation(B,0,1,D),K=c.pointToGLWindowCoordinates(j,X,H,A),$.x*=O/a,$.y*=N/p,ee=this._downSamplePassState.scissorTest.rectangle,ee.x=Math.max(K.x-.5*$.x,0),ee.y=Math.max(K.y-.5*$.y,0),ee.width=Math.min($.x,a),ee.height=Math.min($.y,p),this._downSamplePassState.context=i,this._upSamplePassState.context=i,this._fbo},E.prototype.isDestroyed=function(){return!1},E.prototype.destroy=function(){return this._fbo=this._fbo&&this._fbo.destroy(),this._downSampleFBO1=this._downSampleFBO1&&this._downSampleFBO1.destroy(),this._downSampleFBO2=this._downSampleFBO2&&this._downSampleFBO2.destroy(), -this._downSampleCommand=this._downSampleCommand&&this._downSampleCommand.shaderProgram&&this._downSampleCommand.shaderProgram.destroy(),this._brightPassCommand=this._brightPassCommand&&this._brightPassCommand.shaderProgram&&this._brightPassCommand.shaderProgram.destroy(),this._blurXCommand=this._blurXCommand&&this._blurXCommand.shaderProgram&&this._blurXCommand.shaderProgram.destroy(),this._blurYCommand=this._blurYCommand&&this._blurYCommand.shaderProgram&&this._blurYCommand.shaderProgram.destroy(),this._blendCommand=this._blendCommand&&this._blendCommand.shaderProgram&&this._blendCommand.shaderProgram.destroy(),this._fullScreenCommand=this._fullScreenCommand&&this._fullScreenCommand.shaderProgram&&this._fullScreenCommand.shaderProgram.destroy(),a(this)},E}),i("Scene/Scene",["../Core/BoundingRectangle","../Core/BoundingSphere","../Core/BoxGeometry","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EllipsoidGeometry","../Core/Event","../Core/GeographicProjection","../Core/GeometryInstance","../Core/GeometryPipeline","../Core/getTimestamp","../Core/Intersect","../Core/Interval","../Core/JulianDate","../Core/Math","../Core/Matrix4","../Core/mergeSort","../Core/Occluder","../Core/ShowGeometryInstanceAttribute","../Core/Transforms","../Renderer/ClearCommand","../Renderer/ComputeEngine","../Renderer/Context","../Renderer/ContextLimits","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/PassState","../Renderer/ShaderProgram","../Renderer/ShaderSource","./Camera","./CreditDisplay","./CullingVolume","./DepthPlane","./DeviceOrientationCameraController","./Fog","./FrameState","./FrustumCommands","./FXAA","./GlobeDepth","./MapMode2D","./OIT","./OrthographicFrustum","./PerformanceDisplay","./PerInstanceColorAppearance","./PerspectiveFrustum","./PerspectiveOffCenterFrustum","./PickDepth","./Primitive","./PrimitiveCollection","./SceneMode","./SceneTransforms","./SceneTransitioner","./ScreenSpaceCameraController","./ShadowMap","./SunPostProcess","./TweenCollection"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I,R,O,N,L,B,F,V,k,z,U,G,W,H,q,j,Y,X,Z,K,Q,J,$,ee,te,ie,re,ne,oe,ae,se,le,ue,ce,he){"use strict";function de(t){t=c(t,c.EMPTY_OBJECT);var i=t.canvas,r=t.contextOptions,n=t.creditContainer,o=new R(i,r);h(n)||(n=document.createElement("div"),n.style.position="absolute",n.style.bottom="0",n.style["text-shadow"]="0 0 2px #000000",n.style.color="#ffffff",n.style["font-size"]="10px",n.style["padding-right"]="5px",i.parentNode.appendChild(n)),this._id=u(),this._frameState=new q(o,new z(n)),this._frameState.scene3DOnly=c(t.scene3DOnly,!1);var a=new B(o);a.viewport=new e,a.viewport.x=0,a.viewport.y=0,a.viewport.width=o.drawingBufferWidth,a.viewport.height=o.drawingBufferHeight,this._passState=a,this._canvas=i,this._context=o,this._computeEngine=new I(o),this._globe=void 0,this._primitives=new ne,this._groundPrimitives=new ne,this._tweens=new he,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._frustumCommandsList=[],this._overlayCommandList=[],this._pickFramebuffer=void 0,this._useOIT=c(t.orderIndependentTranslucency,!0),this._executeOITFunction=void 0;var l;o.depthTexture&&(l=new X);var d;this._useOIT&&h(l)&&(d=new K(o)),this._globeDepth=l,this._depthPlane=new G,this._oit=d,this._fxaa=new Y,this._clearColorCommand=new M({color:new s,stencil:0,owner:this}),this._depthClearCommand=new M({depth:1,owner:this}),this._stencilClearCommand=new M({stencil:0}),this._pickDepths=[],this._debugGlobeDepths=[],this._transitioner=new se(this),this._renderError=new _,this._preRender=new _,this._postRender=new _,this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new _,this.morphComplete=new _,this.skyBox=void 0,this.skyAtmosphere=void 0,this.sun=void 0,this.sunBloom=!0,this._sunBloom=void 0,this.moon=void 0,this.backgroundColor=s.clone(s.BLACK),this._mode=oe.SCENE3D,this._mapProjection=h(t.mapProjection)?t.mapProjection:new g,this.morphTime=1,this.farToNearRatio=1e3,this.nearToFarDistance2D=175e4,this.debugCommandFilter=void 0,this.debugShowCommands=!1,this.debugShowFrustums=!1,this._debugFrustumStatistics=void 0,this.debugShowFramesPerSecond=!1,this.debugShowGlobeDepth=!1,this.debugShowDepthFrustum=1,this.fxaa=!0,this.useDepthPicking=!0,this.cameraEventWaitTime=500,this.copyGlobeDepth=!1,this.fog=new H,this._sunCamera=new k(this),this.shadowMap=new ue({context:o,lightCamera:this._sunCamera,enabled:c(t.shadows,!1)}),this._terrainExaggeration=c(t.terrainExaggeration,1),this._performanceDisplay=void 0,this._debugVolume=void 0;var p=new k(this);this._camera=p,this._cameraClone=k.clone(p),this._screenSpaceCameraController=new le(this),this._mapMode2D=c(t.mapMode2D,Z.INFINITE_SCROLL),this._environmentState={skyBoxCommand:void 0,skyAtmosphereCommand:void 0,sunDrawCommand:void 0,sunComputeCommand:void 0,moonCommand:void 0,isSunVisible:!1,isMoonVisible:!1,isReadyForAtmosphere:!1,isSkyAtmosphereVisible:!1,clearGlobeDepth:!1,useDepthPlane:!1,originalFramebuffer:void 0,useGlobeDepthFramebuffer:!1,useOIT:!1,useFXAA:!1},this._useWebVR=!1,this._cameraVR=void 0,this._aspectRatioVR=void 0;var m=p.frustum.near,f=p.frustum.far,v=Math.ceil(Math.log(f/m)/Math.log(this.farToNearRatio));ye(m,f,this.farToNearRatio,v,this._frustumCommandsList,!1,void 0),ve(this,0,E.now()),this.initializeFrame()}function pe(e,t){var i=Math.max(Math.abs(e.x),Math.abs(t.x)),r=Math.max(Math.abs(e.y),Math.abs(t.y)),n=Math.max(Math.abs(e.z),Math.abs(t.z));return Math.max(Math.max(i,r),n)}function me(e,t,i){var r=1/Math.max(1,pe(e.position,t.position));return n.multiplyByScalar(e.position,r,Qe),n.multiplyByScalar(t.position,r,Je),n.equalsEpsilon(Qe,Je,i)&&n.equalsEpsilon(e.direction,t.direction,i)&&n.equalsEpsilon(e.up,t.up,i)&&n.equalsEpsilon(e.right,t.right,i)&&T.equalsEpsilon(e.transform,t.transform,i)}function fe(e,t){var i=e.frameState,r=e._context,n=i.shadowHints.shadowsEnabled,o=i.shadowHints.shadowMaps,a=i.shadowHints.lightShadowMaps,s=n&&a.length>0,l=!1,u=i.shadowHints.lastDirtyTime;if(t.lastDirtyTime!==u&&(t.lastDirtyTime=u,t.dirty=!0,l=!0),t.dirty){t.dirty=!1;var c=t.derivedCommands;n&&(t.receiveShadows||t.castShadows)&&(c.shadows=ue.createDerivedCommands(o,a,t,l,r,c.shadows));var d=e._oit;t.pass===L.TRANSLUCENT&&h(d)&&d.isSupported()&&(s&&t.receiveShadows?(c.oit=h(c.oit)?c.oit:{},c.oit.shadows=d.createDerivedCommands(t.derivedCommands.shadows.receiveCommand,r,c.oit.shadows)):c.oit=d.createDerivedCommands(t,r,c.oit))}}function _e(e){var t=e.globe;if(e._mode===oe.SCENE3D&&h(t)){var i=t.ellipsoid;return $e.radius=i.minimumRadius,Ke=A.fromBoundingSphere($e,e._camera.positionWC,Ke)}}function ge(e){e.render=!1,e.pick=!1}function ve(e,t,i){var r=e._camera,n=e._frameState;n.commandList.length=0,n.shadowMaps.length=0,n.mode=e._mode,n.morphTime=e.morphTime,n.mapProjection=e.mapProjection,n.frameNumber=t,n.time=E.clone(i,n.time),n.camera=r,n.cullingVolume=r.frustum.computeCullingVolume(r.positionWC,r.directionWC,r.upWC),n.occluder=_e(e),n.terrainExaggeration=e._terrainExaggeration,ge(n.passes)}function ye(e,t,i,r,n,o,a){n.length=r;for(var s=0;s<r;++s){var l,u;o?(l=Math.min(t-a,e+s*a),u=Math.min(t,l+a)):(l=Math.max(e,Math.pow(i,s)*e),u=Math.min(t,i*l));var c=n[s];h(c)?(c.near=l,c.far=u):c=n[s]=new j(l,u)}}function Ce(e,t,i){e.debugShowFrustums&&(t.debugOverlappingFrustums=0),e.frameState.passes.pick||fe(e,t);for(var r=e._frustumCommandsList,n=r.length,o=0;o<n;++o){var a=r[o],s=a.near,l=a.far;if(!(i.start>l)){if(i.stop<s)break;var u=t instanceof M?L.OPAQUE:t.pass,c=a.indices[u]++;if(a.commands[u][c]=t,e.debugShowFrustums&&(t.debugOverlappingFrustums|=1<<o),t.executeInClosestFrustum)break}}if(e.debugShowFrustums){var d=e._debugFrustumStatistics.commandsInFrustums;d[t.debugOverlappingFrustums]=h(d[t.debugOverlappingFrustums])?d[t.debugOverlappingFrustums]+1:1,++e._debugFrustumStatistics.totalCommands}}function we(e,t,i){return h(e)&&(!h(e.boundingVolume)||!e.cull||t.computeVisibility(e.boundingVolume)!==w.OUTSIDE&&(!h(i)||!e.boundingVolume.isOccluded(i)))}function Se(e){var t=e._frameState,i=t.camera,r=i.directionWC,n=i.positionWC,o=e._computeCommandList,a=e._overlayCommandList,s=t.commandList;e.debugShowFrustums&&(e._debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});for(var l=e._frustumCommandsList,u=l.length,c=L.NUMBER_OF_PASSES,d=0;d<u;++d)for(var p=0;p<c;++p)l[d].indices[p]=0;o.length=0,a.length=0;for(var m=Number.MAX_VALUE,f=-Number.MAX_VALUE,_=!1,g=t.shadowHints.shadowsEnabled,v=Number.MAX_VALUE,y=-Number.MAX_VALUE,C=Number.MAX_VALUE,w=t.mode===oe.SCENE3D?t.occluder:void 0,S=t.cullingVolume,E=et.planes,b=0;b<5;++b)E[b]=S.planes[b];S=et;var T=e._environmentState;T.isSkyAtmosphereVisible=h(T.skyAtmosphereCommand)&&T.isReadyForAtmosphere,T.isSunVisible=we(T.sunDrawCommand,S,w),T.isMoonVisible=we(T.moonCommand,S,w);for(var x=s.length,A=0;A<x;++A){var P=s[A],D=P.pass;if(D===L.COMPUTE)o.push(P);else if(D===L.OVERLAY)a.push(P);else{var I=P.boundingVolume;if(h(I)){if(!we(P,S,w))continue;if(tt=I.computePlaneDistances(n,r,tt),m=Math.min(m,tt.start),f=Math.max(f,tt.stop),g&&P.receiveShadows&&tt.start<ue.MAXIMUM_DISTANCE&&!(D===L.GLOBE&&tt.start<-100&&tt.stop>100)){var R=tt.stop-tt.start;D!==L.GLOBE&&tt.start<100&&(C=Math.min(C,R)),v=Math.min(v,tt.start),y=Math.max(y,tt.stop)}}else tt.start=i.frustum.near,tt.stop=i.frustum.far,_=!(P instanceof M);Ce(e,P,tt)}}_?(m=i.frustum.near,f=i.frustum.far):(m=Math.min(Math.max(m,i.frustum.near),i.frustum.far),f=Math.max(Math.min(f,i.frustum.far),m),g&&(v=Math.min(Math.max(v,i.frustum.near),i.frustum.far),y=Math.max(Math.min(y,i.frustum.far),v))),g&&(t.shadowHints.nearPlane=v,t.shadowHints.farPlane=y,t.shadowHints.closestObjectSize=C);var O,N=e.mode===oe.SCENE2D,B=e.farToNearRatio;N?(f=Math.min(f,i.position.z+e.nearToFarDistance2D),m=Math.min(m,f),O=Math.ceil(Math.max(1,f-m)/e.nearToFarDistance2D)):O=Math.ceil(Math.log(f/m)/Math.log(B)),m!==Number.MAX_VALUE&&(O!==u||0!==l.length&&(m<l[0].near||f>l[u-1].far))&&(ye(m,f,B,O,l,N,e.nearToFarDistance2D),Se(e))}function Ee(e){var t={},i=e.vertexAttributes;for(var r in i)i.hasOwnProperty(r)&&(t[r]=i[r].index);return t}function be(e,t,i){var r=t.context,n=c(i,e.shaderProgram),o=n.fragmentShaderSource.clone();o.sources=o.sources.map(function(e){return e=V.replaceMain(e,"czm_Debug_main")});var a="void main() \n{ \n czm_Debug_main(); \n";if(t.debugShowCommands){h(e._debugColor)||(e._debugColor=s.fromRandom());var l=e._debugColor;a+=" gl_FragColor.rgb *= vec3("+l.red+", "+l.green+", "+l.blue+"); \n"}if(t.debugShowFrustums){var u=1&e.debugOverlappingFrustums?"1.0":"0.0",d=2&e.debugOverlappingFrustums?"1.0":"0.0",p=4&e.debugOverlappingFrustums?"1.0":"0.0";a+=" gl_FragColor.rgb *= vec3("+u+", "+d+", "+p+"); \n"}a+="}",o.sources.push(a);var m=Ee(n);return F.fromCache({context:r,vertexShaderSource:n.vertexShaderSource,fragmentShaderSource:o,attributeLocations:m})}function Te(e,t,i){var r=N.shallowClone(e);r.shaderProgram=be(e,t),r.execute(t.context,i),r.shaderProgram.destroy()}function xe(e,t,r,o,a){if(!h(t.debugCommandFilter)||t.debugCommandFilter(e)){var s=t.frameState.shadowHints.shadowsEnabled,u=s&&t.frameState.shadowHints.lightShadowMaps.length>0;if(t.debugShowCommands||t.debugShowFrustums?Te(e,t,o):u&&e.receiveShadows&&h(e.derivedCommands.shadows)?e.derivedCommands.shadows.receiveCommand.execute(r,o):e.execute(r,o),e.debugShowBoundingVolume&&h(e.boundingVolume)){var c=t._frameState,d=e.boundingVolume;h(t._debugVolume)&&t._debugVolume.destroy();var p,m=n.clone(d.center);if(c.mode!==oe.SCENE3D){m=T.multiplyByPoint(it,m,m);var _=c.mapProjection,g=_.unproject(m);m=_.ellipsoid.cartographicToCartesian(g)}if(h(d.radius)){var C=d.radius;p=y.toWireframe(f.createGeometry(new f({radii:new n(C,C,C),vertexFormat:$.FLAT_VERTEX_FORMAT}))),t._debugVolume=new re({geometryInstances:new v({geometry:p,modelMatrix:T.multiplyByTranslation(T.IDENTITY,m,new T),attributes:{color:new l(1,0,0,1)}}),appearance:new $({flat:!0,translucent:!1}),asynchronous:!1})}else{var w=d.halfAxes;p=y.toWireframe(i.createGeometry(i.fromDimensions({dimensions:new n(2,2,2),vertexFormat:$.FLAT_VERTEX_FORMAT}))),t._debugVolume=new re({geometryInstances:new v({geometry:p,modelMatrix:T.fromRotationTranslation(w,m,new T),attributes:{color:new l(1,0,0,1)}}),appearance:new $({flat:!0,translucent:!1}),asynchronous:!1})}var S=c.commandList,E=c.commandList=[];t._debugVolume.update(c);var b;h(a)&&(b=o.framebuffer,o.framebuffer=a),E[0].execute(r,o),h(b)&&(o.framebuffer=b),c.commandList=S}}}function Ae(e,t,i){return t.boundingVolume.distanceSquaredTo(i)-e.boundingVolume.distanceSquaredTo(i)}function Pe(e,t,i,r){var n=e.context;x(r,Ae,e._camera.positionWC);for(var o=r.length,a=0;a<o;++a)t(r[a],e,n,i)}function De(e,t){var i=e._debugGlobeDepths[t];return!h(i)&&e.context.depthTexture&&(i=new X,e._debugGlobeDepths[t]=i),i}function Me(e,t){var i=e._pickDepths[t];return h(i)||(i=new ie,e._pickDepths[t]=i),i}function Ie(e,t){var i=e._camera,r=e.context,n=r.uniformState;n.updateCamera(i);var o;o=h(i.frustum.fov)?i.frustum.clone(rt):h(i.frustum.infiniteProjectionMatrix)?i.frustum.clone(nt):i.frustum.clone(ot),o.near=i.frustum.near,o.far=i.frustum.far,n.updateFrustum(o),n.updatePass(L.ENVIRONMENT);var a=e._environmentState,s=a.skyBoxCommand;h(s)&&xe(s,e,r,t),a.isSkyAtmosphereVisible&&xe(a.skyAtmosphereCommand,e,r,t);var l=e._useWebVR&&e.mode!==oe.SCENE2D;if(a.isSunVisible&&(a.sunDrawCommand.execute(r,t),e.sunBloom&&!l)){var u;u=a.useGlobeDepthFramebuffer?e._globeDepth.framebuffer:a.useFXAA?e._fxaa.getColorFramebuffer():a.originalFramebuffer,e._sunPostProcess.execute(r,u),t.framebuffer=u}a.isMoonVisible&&a.moonCommand.execute(r,t);var c;a.useOIT?(h(e._executeOITFunction)||(e._executeOITFunction=function(e,t,i,r){e._oit.executeCommands(e,t,i,r)}),c=e._executeOITFunction):c=Pe;for(var d,p=a.clearGlobeDepth,m=a.useDepthPlane,f=e._depthClearCommand,_=e._depthPlane,g=i.position.z,v=e._frustumCommandsList,y=v.length,C=0;C<y;++C){var w=y-C-1,S=v[w];e.mode===oe.SCENE2D?(i.position.z=g-S.near+1,o.far=Math.max(1,S.far-S.near),o.near=1,n.update(e.frameState),n.updateFrustum(o)):(o.near=0!==w?S.near*Ze:S.near,o.far=S.far,n.updateFrustum(o));var E,b=e.debugShowGlobeDepth?De(e,w):e._globeDepth;e.debugShowGlobeDepth&&h(b)&&a.useGlobeDepthFramebuffer&&(E=t.framebuffer,t.framebuffer=b.framebuffer),f.execute(r,t),n.updatePass(L.GLOBE);var T=S.commands[L.GLOBE],x=S.indices[L.GLOBE];for(d=0;d<x;++d)xe(T[d],e,r,t);for(h(b)&&a.useGlobeDepthFramebuffer&&(e.copyGlobeDepth||e.debugShowGlobeDepth)&&(b.update(r),b.executeCopyDepth(r,t)),e.debugShowGlobeDepth&&h(b)&&a.useGlobeDepthFramebuffer&&(t.framebuffer=E),n.updatePass(L.GROUND),T=S.commands[L.GROUND],x=S.indices[L.GROUND],d=0;d<x;++d)xe(T[d],e,r,t);x>0&&r.stencilBuffer&&e._stencilClearCommand.execute(r,t),p&&(f.execute(r,t),m&&_.execute(r,t));for(var A=L.GROUND+1,P=L.TRANSLUCENT,D=A;D<P;++D)for(n.updatePass(D),T=S.commands[D],x=S.indices[D],d=0;d<x;++d)xe(T[d],e,r,t);if(0!==w&&e.mode!==oe.SCENE2D&&(o.near=S.near,n.updateFrustum(o)),n.updatePass(L.TRANSLUCENT),T=S.commands[L.TRANSLUCENT],T.length=S.indices[L.TRANSLUCENT],c(e,xe,t,T),h(b)&&a.useGlobeDepthFramebuffer&&e.useDepthPicking){var M=Me(e,w);M.update(r,b.framebuffer.depthStencilTexture),M.executeCopyDepth(r,t)}}}function Re(e){var t=e.context.uniformState;t.updatePass(L.COMPUTE);var i=e._environmentState.sunComputeCommand;h(i)&&i.execute(e._computeEngine);for(var r=e._computeCommandList,n=r.length,o=0;o<n;++o)r[o].execute(e._computeEngine)}function Oe(e,t){var i=e.context.uniformState;i.updatePass(L.OVERLAY);for(var r=e.context,n=e._overlayCommandList,o=n.length,a=0;a<o;++a)n[a].execute(r,t)}function Ne(e,t,i){for(var r=i.shadowMapCullingVolume,n=i.isPointLight,o=i.passes,a=o.length,s=t.length,l=0;l<s;++l){var u=t[l];if(fe(e,u),u.castShadows&&(u.pass===L.GLOBE||u.pass===L.OPAQUE||u.pass===L.TRANSLUCENT)&&we(u,r))if(n)for(var c=0;c<a;++c)o[c].commandList.push(u);else if(1===a)o[0].commandList.push(u);else for(var h=!1,d=a-1;d>=0;--d){var p=o[d].cullingVolume;if(we(u,p))o[d].commandList.push(u),h=!0;else if(h)break}}}function Le(e){var t=e.frameState,i=t.shadowHints.shadowMaps,r=i.length;if(t.shadowHints.shadowsEnabled)for(var n=e.context,o=n.uniformState,a=0;a<r;++a){var s=i[a];if(!s.outOfView){var l,u=s.passes,c=u.length;for(l=0;l<c;++l)u[l].commandList.length=0;var h=e.frameState.commandList;for(Ne(e,h,s),l=0;l<c;++l){var d=s.passes[l];o.updateCamera(d.camera),s.updatePass(n,l);for(var p=d.commandList.length,m=0;m<p;++m){var f=d.commandList[m];o.updatePass(f.pass),xe(f.derivedCommands.shadows.castCommands[a],e,n,d.passState)}}}}}function Be(e,t,i,r){var o=e._context,a=t.viewport,s=e._frameState,l=s.camera,u=s.mode;if(e._useWebVR&&u!==oe.SCENE2D){Ue(e),Se(e),Ge(e,t,i,r),Re(e),Le(e),a.x=0,a.y=0,a.width=.5*o.drawingBufferWidth,a.height=o.drawingBufferHeight;var c=k.clone(l,e._cameraVR),h=l.frustum.near,d=5*h,p=d/30,m=n.multiplyByScalar(c.right,.5*p,pt);l.frustum.aspectRatio=a.width/a.height;var f=.5*p*h/d;n.add(c.position,m,l.position),l.frustum.xOffset=f,Ie(e,t),a.x=t.viewport.width,n.subtract(c.position,m,l.position),l.frustum.xOffset=-f,Ie(e,t),k.clone(c,l)}else a.x=0,a.y=0,a.width=o.drawingBufferWidth,a.height=o.drawingBufferHeight,u!==oe.SCENE2D||e._mapMode2D===Z.ROTATE?Ve(!0,e,t,i,r):Fe(e,t,i,r)}function Fe(e,t,i,r){var o=e.context,a=e.frameState,s=e.camera,l=t.viewport,u=at,c=st,h=e.mapProjection;h.project(u,c);var d=n.clone(s.position,lt),p=T.clone(s.transform,ct),m=s.frustum.clone();s._setTransform(T.IDENTITY);var f=T.computeViewportTransformation(l,0,1,ut),_=s.frustum.projectionMatrix,g=s.positionWC.y,v=n.fromElements(b.sign(g)*c.x-g,0,-s.positionWC.x,ht),y=D.pointToGLWindowCoordinates(_,f,v,dt);y.x=Math.floor(y.x);var C=l.x,w=l.width;if(0===g||y.x<=0||y.x>=o.drawingBufferWidth)Ve(!0,e,t,i,r);else if(Math.abs(.5*o.drawingBufferWidth-y.x)<1)l.width=y.x,s.position.x*=b.sign(s.position.x),s.frustum.right=0,a.cullingVolume=s.frustum.computeCullingVolume(s.positionWC,s.directionWC,s.upWC),o.uniformState.update(a),Ve(!0,e,t,i,r),l.x=l.width,s.position.x=-s.position.x,s.frustum.right=-s.frustum.left,s.frustum.left=0,a.cullingVolume=s.frustum.computeCullingVolume(s.positionWC,s.directionWC,s.upWC),o.uniformState.update(a),Ve(!1,e,t,i,r);else if(y.x>.5*o.drawingBufferWidth){l.width=y.x;var S=s.frustum.right;s.frustum.right=c.x-g,a.cullingVolume=s.frustum.computeCullingVolume(s.positionWC,s.directionWC,s.upWC),o.uniformState.update(a),Ve(!0,e,t,i,r),l.x+=y.x,l.width=o.drawingBufferWidth-y.x,s.position.x=-s.position.x,s.frustum.left=-s.frustum.right,s.frustum.right=S-2*s.frustum.right,a.cullingVolume=s.frustum.computeCullingVolume(s.positionWC,s.directionWC,s.upWC),o.uniformState.update(a),Ve(!1,e,t,i,r)}else{l.x=y.x,l.width=o.drawingBufferWidth-y.x;var E=s.frustum.left;s.frustum.left=-c.x-g,a.cullingVolume=s.frustum.computeCullingVolume(s.positionWC,s.directionWC,s.upWC),o.uniformState.update(a),Ve(!0,e,t,i,r),l.x=0,l.width=y.x,s.position.x=-s.position.x,s.frustum.right=-s.frustum.left,s.frustum.left=E-2*s.frustum.left,a.cullingVolume=s.frustum.computeCullingVolume(s.positionWC,s.directionWC,s.upWC),o.uniformState.update(a),Ve(!1,e,t,i,r)}s._setTransform(p),n.clone(d,s.position),s.frustum=m.clone(),l.x=C,l.width=w}function Ve(e,t,i,r,n){e||(t.frameState.commandList.length=0),Ue(t),Se(t),e&&(Ge(t,i,r,n),Re(t),Le(t)),Ie(t,i)}function ke(e){var t=e._frameState,i=e._environmentState,r=t.passes.render;i.skyBoxCommand=r&&h(e.skyBox)?e.skyBox.update(t):void 0;var n=e.skyAtmosphere,o=e.globe;h(n)&&h(o)&&(n.setDynamicAtmosphereColor(o.enableLighting),i.isReadyForAtmosphere=i.isReadyForAtmosphere||o._surface._tilesToRender.length>0),i.skyAtmosphereCommand=r&&h(n)?n.update(t):void 0;var a=r&&h(e.sun)?e.sun.update(e):void 0;i.sunDrawCommand=h(a)?a.drawCommand:void 0,i.sunComputeCommand=h(a)?a.computeCommand:void 0,i.moonCommand=r&&h(e.moon)?e.moon.update(t):void 0;var s=i.clearGlobeDepth=h(o)&&(!o.depthTestAgainstTerrain||e.mode===oe.SCENE2D),l=i.useDepthPlane=s&&e.mode===oe.SCENE3D;l&&e._depthPlane.update(t)}function ze(e){var t=e._frameState,i=t.shadowMaps,r=i.length,n=r>0&&!t.passes.pick&&e.mode===oe.SCENE3D;if(n!==t.shadowHints.shadowsEnabled&&(++t.shadowHints.lastDirtyTime,t.shadowHints.shadowsEnabled=n),n){for(var o=0;o<r;++o)if(i[o]!==t.shadowHints.shadowMaps[o]){++t.shadowHints.lastDirtyTime;break}t.shadowHints.shadowMaps.length=0,t.shadowHints.lightShadowMaps.length=0;for(var a=0;a<r;++a){var s=i[a];s.update(t),t.shadowHints.shadowMaps.push(s),s.fromLightSource&&t.shadowHints.lightShadowMaps.push(s),s.dirty&&(++t.shadowHints.lastDirtyTime,s.dirty=!1)}}}function Ue(e){var t=e._frameState;e._groundPrimitives.update(t),e._primitives.update(t),ze(e),e._globe&&e._globe.update(t)}function Ge(e,t,i,r){var n=e._context,o=e._environmentState,a=e._useWebVR&&e.mode!==oe.SCENE2D;o.originalFramebuffer=t.framebuffer,h(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!a?e._sunPostProcess=new ce:h(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy()),e._sunBloom=e.sunBloom):!h(e.sun)&&h(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy(),e._sunBloom=!1);var l=e._clearColorCommand;s.clone(i,l.color),l.execute(n,t);var u=o.useGlobeDepthFramebuffer=!r&&h(e._globeDepth);u&&(e._globeDepth.update(n),e._globeDepth.clear(n,t,i));for(var c=!1,d=e._frustumCommandsList,p=d.length,m=0;m<p;++m)if(d[m].indices[L.TRANSLUCENT]>0){c=!0;break}var f=o.useOIT=!r&&c&&h(e._oit)&&e._oit.isSupported();f&&(e._oit.update(n,e._globeDepth.framebuffer),e._oit.clear(n,t,i),o.useOIT=e._oit.isSupported());var _=o.useFXAA=!r&&e.fxaa;_&&(e._fxaa.update(n),e._fxaa.clear(n,t,i)),o.isSunVisible&&e.sunBloom&&!a?t.framebuffer=e._sunPostProcess.update(t):u?t.framebuffer=e._globeDepth.framebuffer:_&&(t.framebuffer=e._fxaa.getColorFramebuffer()),h(t.framebuffer)&&l.execute(n,t)}function We(e,t){var i=e._context,r=e._environmentState,n=r.useGlobeDepthFramebuffer;if(e.debugShowGlobeDepth&&n){var o=De(e,e.debugShowDepthFrustum-1);o.executeDebugGlobeDepth(i,t)}if(e.debugShowPickDepth&&n){var a=Me(e,e.debugShowDepthFrustum-1);a.executeDebugPickDepth(i,t)}var s=r.useOIT,l=r.useFXAA;s&&(t.framebuffer=l?e._fxaa.getColorFramebuffer():void 0,e._oit.execute(i,t)),l&&(!s&&n&&(t.framebuffer=e._fxaa.getColorFramebuffer(),e._globeDepth.executeCopyColor(i,t)),t.framebuffer=r.originalFramebuffer,e._fxaa.execute(i,t)),s||l||!n||(t.framebuffer=r.originalFramebuffer,e._globeDepth.executeCopyColor(i,t))}function He(e){for(var t=e.afterRender,i=0,r=t.length;i<r;++i)t[i]();t.length=0}function qe(e,t){h(t)||(t=E.now());var i=e._camera;me(i,e._cameraClone,b.EPSILON6)?e._cameraStartFired&&C()-e._cameraMovedTime>e.cameraEventWaitTime&&(i.moveEnd.raiseEvent(),e._cameraStartFired=!1):(e._cameraStartFired||(i.moveStart.raiseEvent(),e._cameraStartFired=!0),e._cameraMovedTime=C(),k.clone(i,e._cameraClone)),e._preRender.raiseEvent(e,t);var r=e.context,o=r.uniformState,a=e._frameState,l=b.incrementWrap(a.frameNumber,15e6,1);ve(e,l,t),a.passes.render=!0,a.creditDisplay.beginFrame(),e.fog.update(a),o.update(a);var u=e.shadowMap;h(u)&&u.enabled&&(n.negate(o.sunDirectionWC,e._sunCamera.direction),a.shadowMaps.push(u)),e._computeCommandList.length=0,e._overlayCommandList.length=0;var d=e._passState;if(d.framebuffer=void 0,d.blendingEnabled=void 0,d.scissorTest=void 0,h(e.globe)&&e.globe.beginFrame(a),ke(e),Be(e,d,c(e.backgroundColor,s.BLACK)),We(e,d),Oe(e,d),h(e.globe)&&e.globe.endFrame(a),a.creditDisplay.endFrame(),e.debugShowFramesPerSecond){if(!h(e._performanceDisplay)){var p=document.createElement("div");p.className="cesium-performanceDisplay-defaultContainer";var m=e._canvas.parentNode;m.appendChild(p);var f=new J({container:p});e._performanceDisplay=f,e._performanceContainer=p}e._performanceDisplay.update()}else h(e._performanceDisplay)&&(e._performanceDisplay=e._performanceDisplay&&e._performanceDisplay.destroy(),e._performanceContainer.parentNode.removeChild(e._performanceContainer));r.endFrame(),He(a),e._postRender.raiseEvent(e,t)}function je(e,t,i,r){var o=e._camera,a=o.frustum,s=e._passState.viewport,l=2*(t.x-s.x)/s.width-1;l*=.5*(a.right-a.left);var u=2*(s.height-t.y-s.y)/s.height-1;u*=.5*(a.top-a.bottom);var c=T.clone(o.transform,vt);o._setTransform(T.IDENTITY);var h=n.clone(o.position,ft);n.multiplyByScalar(o.right,l,_t),n.add(_t,h,h),n.multiplyByScalar(o.up,u,_t),n.add(_t,h,h),o._setTransform(c),n.fromElements(h.z,h.x,h.y,h);var d=a.getPixelDimensions(s.width,s.height,1,gt),p=mt;return p.right=.5*d.x,p.left=-p.right,p.top=.5*d.y,p.bottom=-p.top,p.near=a.near,p.far=a.far,p.computeCullingVolume(h,o.directionWC,o.upWC)}function Ye(e,t,i,r){var n=e._camera,o=n.frustum,a=o.near,s=Math.tan(.5*o.fovy),l=o.aspectRatio*s,u=e._passState.viewport,c=2*(t.x-u.x)/u.width-1,h=2*(u.height-t.y-u.y)/u.height-1,d=c*a*l,p=h*a*s,m=o.getPixelDimensions(u.width,u.height,1,gt),f=m.x*i*.5,_=m.y*r*.5,g=yt;return g.top=p+_,g.bottom=p-_,g.right=d+f,g.left=d-f,g.near=a,g.far=o.far,g.computeCullingVolume(n.positionWC,n.directionWC,n.upWC)}function Xe(e,t,i,r){return e._mode===oe.SCENE2D?je(e,t,i,r):Ye(e,t,i,r)}var Ze=.99;d(de.prototype,{canvas:{get:function(){return this._canvas}},drawingBufferHeight:{get:function(){return this._context.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._context.drawingBufferWidth}},maximumAliasedLineWidth:{get:function(){return O.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return O.maximumCubeMapSize}},pickPositionSupported:{get:function(){return this._context.depthTexture}},globe:{get:function(){return this._globe},set:function(e){this._globe=this._globe&&this._globe.destroy(),this._globe=e}},primitives:{get:function(){return this._primitives}},groundPrimitives:{get:function(){return this._groundPrimitives}},camera:{get:function(){return this._camera}},screenSpaceCameraController:{get:function(){return this._screenSpaceCameraController}},mapProjection:{get:function(){return this._mapProjection}},frameState:{get:function(){return this._frameState}},tweens:{get:function(){return this._tweens}},imageryLayers:{get:function(){return this.globe.imageryLayers}},terrainProvider:{get:function(){return this.globe.terrainProvider},set:function(e){this.globe.terrainProvider=e}},terrainProviderChanged:{get:function(){return this.globe.terrainProviderChanged}},renderError:{get:function(){return this._renderError}},preRender:{get:function(){return this._preRender}},postRender:{get:function(){return this._postRender}},context:{get:function(){return this._context}},debugFrustumStatistics:{get:function(){return this._debugFrustumStatistics}},scene3DOnly:{get:function(){return this._frameState.scene3DOnly}},orderIndependentTranslucency:{get:function(){return h(this._oit)}},id:{get:function(){return this._id}},mode:{get:function(){return this._mode},set:function(e){e===oe.SCENE2D?this.morphTo2D(0):e===oe.SCENE3D?this.morphTo3D(0):e===oe.COLUMBUS_VIEW&&this.morphToColumbusView(0),this._mode=e}},numberOfFrustums:{get:function(){return this._frustumCommandsList.length}},terrainExaggeration:{get:function(){return this._terrainExaggeration}},useWebVR:{get:function(){return this._useWebVR},set:function(e){this._useWebVR=e,this._useWebVR?(this._frameState.creditDisplay.container.style.visibility="hidden",this._cameraVR=new k(this),h(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new W(this)),this._aspectRatioVR=this._camera.frustum.aspectRatio):(this._frameState.creditDisplay.container.style.visibility="visible",this._cameraVR=void 0,this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this._camera.frustum.aspectRatio=this._aspectRatioVR,this._camera.frustum.xOffset=0)}},mapMode2D:{get:function(){return this._mapMode2D}}});var Ke,Qe=new n,Je=new n,$e=new t,et=new U,tt=new S,it=new T(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);it=T.inverseTransformation(it,it);var rt=new ee,nt=new te,ot=new Q,at=new a(Math.PI,b.PI_OVER_TWO),st=new n,lt=new n,ut=new T,ct=new T,ht=new n,dt=new n;de.prototype.initializeFrame=function(){120===this._shaderFrameCount++&&(this._shaderFrameCount=0,this._context.shaderCache.destroyReleasedShaderPrograms()),this._tweens.update(),this._screenSpaceCameraController.update(),h(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this._camera.update(this._mode),this._camera._updateCameraChanged()};var pt=new n;de.prototype.render=function(e){try{qe(this,e)}catch(e){if(this._renderError.raiseEvent(this,e),this.rethrowRenderErrors)throw e}},de.prototype.clampLineWidth=function(e){return Math.max(O.minimumAliasedLineWidth,Math.min(e,O.maximumAliasedLineWidth))};var mt=new Q,ft=new n,_t=new n,gt=new r,vt=new T,yt=new te,Ct=3,wt=3,St=new e(0,0,Ct,wt),Et=new s(0,0,0,0),bt=new r;de.prototype.pick=function(e){var t=this._context,i=t.uniformState,r=this._frameState,n=ae.transformWindowToDrawingBuffer(this,e,bt);h(this._pickFramebuffer)||(this._pickFramebuffer=t.createPickFramebuffer()),ve(this,r.frameNumber,r.time),r.cullingVolume=Xe(this,n,Ct,wt),r.passes.pick=!0,i.update(r),St.x=n.x-.5*(Ct-1),St.y=this.drawingBufferHeight-n.y-.5*(wt-1);var o=this._pickFramebuffer.begin(St);Be(this,o,Et,!0),We(this,o);var a=this._pickFramebuffer.end(St);return t.endFrame(),He(r),a};var Tt=new o,xt=new o(1,1/255,1/65025,1/16581375);return de.prototype.pickPosition=function(e,t){if(this.useDepthPicking){var i=this._context,r=i.uniformState,n=ae.transformWindowToDrawingBuffer(this,e,bt);n.y=this.drawingBufferHeight-n.y;var a,s=this._camera;h(s.frustum.fov)?a=s.frustum.clone(rt):h(s.frustum.infiniteProjectionMatrix)&&(a=s.frustum.clone(nt));for(var l=this.numberOfFrustums,u=0;u<l;++u){var c=Me(this,u),d=i.readPixels({x:n.x,y:n.y,width:1,height:1,framebuffer:c.framebuffer}),p=o.unpack(d,0,Tt);o.divideByScalar(p,255,p);var m=o.dot(p,xt);if(m>0&&m<1){var f=this._frustumCommandsList[u];return a.near=f.near*(0!==u?Ze:1),a.far=f.far,r.updateFrustum(a),ae.drawingBufferToWgs84Coordinates(this,n,m,t)}}}},de.prototype.drillPick=function(e,t){var i,r,n=[],o=[],a=[];h(t)||(t=Number.MAX_VALUE);for(var s=this.pick(e);h(s)&&h(s.primitive)&&(n.push(s),!(0>=--t));){var l=s.primitive,u=!1;"function"==typeof l.getGeometryInstanceAttributes&&h(s.id)&&(r=l.getGeometryInstanceAttributes(s.id),h(r)&&h(r.show)&&(u=!0,r.show=P.toValue(!1,r.show),a.push(r))),u||(l.show=!1,o.push(l)),s=this.pick(e)}for(i=0;i<o.length;++i)o[i].show=!0;for(i=0;i<a.length;++i)r=a[i],r.show=P.toValue(!0,r.show);return n},de.prototype.completeMorph=function(){this._transitioner.completeMorph()},de.prototype.morphTo2D=function(e){var t,i=this.globe;t=h(i)?i.ellipsoid:this.mapProjection.ellipsoid,e=c(e,2),this._transitioner.morphTo2D(e,t)},de.prototype.morphToColumbusView=function(e){var t,i=this.globe;t=h(i)?i.ellipsoid:this.mapProjection.ellipsoid,e=c(e,2),this._transitioner.morphToColumbusView(e,t)},de.prototype.morphTo3D=function(e){var t,i=this.globe;t=h(i)?i.ellipsoid:this.mapProjection.ellipsoid,e=c(e,2),this._transitioner.morphTo3D(e,t)},de.prototype.isDestroyed=function(){return!1},de.prototype.destroy=function(){return this._tweens.removeAll(),this._computeEngine=this._computeEngine&&this._computeEngine.destroy(),this._screenSpaceCameraController=this._screenSpaceCameraController&&this._screenSpaceCameraController.destroy(),this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this._pickFramebuffer=this._pickFramebuffer&&this._pickFramebuffer.destroy(),this._primitives=this._primitives&&this._primitives.destroy(),this._groundPrimitives=this._groundPrimitives&&this._groundPrimitives.destroy(), -this._globe=this._globe&&this._globe.destroy(),this.skyBox=this.skyBox&&this.skyBox.destroy(),this.skyAtmosphere=this.skyAtmosphere&&this.skyAtmosphere.destroy(),this._debugSphere=this._debugSphere&&this._debugSphere.destroy(),this.sun=this.sun&&this.sun.destroy(),this._sunPostProcess=this._sunPostProcess&&this._sunPostProcess.destroy(),this._depthPlane=this._depthPlane&&this._depthPlane.destroy(),this._transitioner.destroy(),h(this._globeDepth)&&this._globeDepth.destroy(),h(this._oit)&&this._oit.destroy(),this._fxaa.destroy(),this._context=this._context&&this._context.destroy(),this._frameState.creditDisplay.destroy(),h(this._performanceDisplay)&&(this._performanceDisplay=this._performanceDisplay&&this._performanceDisplay.destroy(),this._performanceContainer.parentNode.removeChild(this._performanceContainer)),p(this)},de}),i("Scene/SingleTileImageryProvider",["../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/GeographicTilingScheme","../Core/loadImage","../Core/Rectangle","../Core/RuntimeError","../Core/TileProviderError","../ThirdParty/when"],function(e,t,i,r,n,o,a,s,l,u,c,h){"use strict";function d(r){function n(e){w._image=e,w._tileWidth=e.width,w._tileHeight=e.height,w._ready=!0,w._readyPromise.resolve(!0),c.handleSuccess(w._errorEvent)}function d(e){var t="Failed to load image "+v+".";C=c.handleError(C,w,w._errorEvent,t,0,0,0,p,e),w._readyPromise.reject(new u(t))}function p(){h(s(v),n,d)}r=t(r,{});var m=r.url;this._url=m;var f=r.proxy;this._proxy=f;var _=t(r.rectangle,l.MAX_VALUE),g=new a({rectangle:_,numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:r.ellipsoid});this._tilingScheme=g,this._image=void 0,this._texture=void 0,this._tileWidth=0,this._tileHeight=0,this._errorEvent=new o,this._ready=!1,this._readyPromise=h.defer();var v=m;i(f)&&(v=f.getURL(v));var y=r.credit;"string"==typeof y&&(y=new e(y)),this._credit=y;var C,w=this;p()}return r(d.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return 0}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}}),d.prototype.getTileCredits=function(e,t,i){},d.prototype.requestImage=function(e,t,i){return this._image},d.prototype.pickFeatures=function(){},d}),i("Shaders/SkyAtmosphereFS",[],function(){"use strict";return"#ifdef COLOR_CORRECT\nuniform vec3 u_hsbShift;\n#endif\nconst float g = -0.95;\nconst float g2 = g * g;\nconst vec4 K_RGB2HSB = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);\nconst vec4 K_HSB2RGB = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\nvarying vec3 v_rayleighColor;\nvarying vec3 v_mieColor;\nvarying vec3 v_toCamera;\nvarying vec3 v_positionEC;\n#ifdef COLOR_CORRECT\nvec3 rgb2hsb(vec3 rgbColor)\n{\nvec4 p = mix(vec4(rgbColor.bg, K_RGB2HSB.wz), vec4(rgbColor.gb, K_RGB2HSB.xy), step(rgbColor.b, rgbColor.g));\nvec4 q = mix(vec4(p.xyw, rgbColor.r), vec4(rgbColor.r, p.yzx), step(p.x, rgbColor.r));\nfloat d = q.x - min(q.w, q.y);\nreturn vec3(abs(q.z + (q.w - q.y) / (6.0 * d + czm_epsilon7)), d / (q.x + czm_epsilon7), q.x);\n}\nvec3 hsb2rgb(vec3 hsbColor)\n{\nvec3 p = abs(fract(hsbColor.xxx + K_HSB2RGB.xyz) * 6.0 - K_HSB2RGB.www);\nreturn hsbColor.z * mix(K_HSB2RGB.xxx, clamp(p - K_HSB2RGB.xxx, 0.0, 1.0), hsbColor.y);\n}\n#endif\nvoid main (void)\n{\nfloat cosAngle = dot(czm_sunDirectionWC, normalize(v_toCamera)) / length(v_toCamera);\nfloat rayleighPhase = 0.75 * (1.0 + cosAngle * cosAngle);\nfloat miePhase = 1.5 * ((1.0 - g2) / (2.0 + g2)) * (1.0 + cosAngle * cosAngle) / pow(1.0 + g2 - 2.0 * g * cosAngle, 1.5);\nconst float exposure = 2.0;\nvec3 rgb = rayleighPhase * v_rayleighColor + miePhase * v_mieColor;\nrgb = vec3(1.0) - exp(-exposure * rgb);\nfloat l = czm_luminance(rgb);\n#ifdef COLOR_CORRECT\nvec3 hsb = rgb2hsb(rgb);\nhsb.x += u_hsbShift.x;\nhsb.y = clamp(hsb.y + u_hsbShift.y, 0.0, 1.0);\nhsb.z = hsb.z > czm_epsilon7 ? hsb.z + u_hsbShift.z : 0.0;\nrgb = hsb2rgb(hsb);\nl = min(l, czm_luminance(rgb));\n#endif\ngl_FragColor = vec4(rgb, min(smoothstep(0.0, 0.1, l), 1.0) * smoothstep(0.0, 1.0, czm_morphTime));\n}\n"}),i("Shaders/SkyAtmosphereVS",[],function(){"use strict";return"attribute vec4 position;\nuniform vec4 u_cameraAndRadiiAndDynamicAtmosphereColor;\nconst float Kr = 0.0025;\nconst float Kr4PI = Kr * 4.0 * czm_pi;\nconst float Km = 0.0015;\nconst float Km4PI = Km * 4.0 * czm_pi;\nconst float ESun = 15.0;\nconst float KmESun = Km * ESun;\nconst float KrESun = Kr * ESun;\nconst vec3 InvWavelength = vec3(\n5.60204474633241,\n9.473284437923038,\n19.643802610477206);\nconst float rayleighScaleDepth = 0.25;\nconst int nSamples = 2;\nconst float fSamples = 2.0;\nvarying vec3 v_rayleighColor;\nvarying vec3 v_mieColor;\nvarying vec3 v_toCamera;\nfloat scale(float cosAngle)\n{\nfloat x = 1.0 - cosAngle;\nreturn rayleighScaleDepth * exp(-0.00287 + x*(0.459 + x*(3.83 + x*(-6.80 + x*5.25))));\n}\nvoid main(void)\n{\nfloat cameraHeight = u_cameraAndRadiiAndDynamicAtmosphereColor.x;\nfloat outerRadius = u_cameraAndRadiiAndDynamicAtmosphereColor.y;\nfloat innerRadius = u_cameraAndRadiiAndDynamicAtmosphereColor.z;\nvec3 positionV3 = position.xyz;\nvec3 ray = positionV3 - czm_viewerPositionWC;\nfloat far = length(ray);\nray /= far;\nfloat atmosphereScale = 1.0 / (outerRadius - innerRadius);\n#ifdef SKY_FROM_SPACE\nfloat B = 2.0 * dot(czm_viewerPositionWC, ray);\nfloat C = cameraHeight * cameraHeight - outerRadius * outerRadius;\nfloat det = max(0.0, B*B - 4.0 * C);\nfloat near = 0.5 * (-B - sqrt(det));\nvec3 start = czm_viewerPositionWC + ray * near;\nfar -= near;\nfloat startAngle = dot(ray, start) / outerRadius;\nfloat startDepth = exp(-1.0 / rayleighScaleDepth );\nfloat startOffset = startDepth*scale(startAngle);\n#else // SKY_FROM_ATMOSPHERE\nvec3 start = czm_viewerPositionWC;\nfloat height = length(start);\nfloat depth = exp((atmosphereScale / rayleighScaleDepth ) * (innerRadius - cameraHeight));\nfloat startAngle = dot(ray, start) / height;\nfloat startOffset = depth*scale(startAngle);\n#endif\nfloat sampleLength = far / fSamples;\nfloat scaledLength = sampleLength * atmosphereScale;\nvec3 sampleRay = ray * sampleLength;\nvec3 samplePoint = start + sampleRay * 0.5;\nvec3 frontColor = vec3(0.0, 0.0, 0.0);\nvec3 lightDir = (u_cameraAndRadiiAndDynamicAtmosphereColor.w > 0.0) ? czm_sunPositionWC - czm_viewerPositionWC : czm_viewerPositionWC;\nlightDir = normalize(lightDir);\nfor(int i=0; i<nSamples; i++)\n{\nfloat height = length(samplePoint);\nfloat depth = exp((atmosphereScale / rayleighScaleDepth ) * (innerRadius - height));\nfloat fLightAngle = dot(lightDir, samplePoint) / height;\nfloat fCameraAngle = dot(ray, samplePoint) / height;\nfloat fScatter = (startOffset + depth*(scale(fLightAngle) - scale(fCameraAngle)));\nvec3 attenuate = exp(-fScatter * (InvWavelength * Kr4PI + Km4PI));\nfrontColor += attenuate * (depth * scaledLength);\nsamplePoint += sampleRay;\n}\nv_mieColor = frontColor * KmESun;\nv_rayleighColor = frontColor * (InvWavelength * KrESun);\nv_toCamera = czm_viewerPositionWC - positionV3;\ngl_Position = czm_modelViewProjection * position;\n}\n"}),i("Scene/SkyAtmosphere",["../Core/Cartesian3","../Core/Cartesian4","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/Ellipsoid","../Core/EllipsoidGeometry","../Core/GeometryPipeline","../Core/Math","../Core/VertexFormat","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArray","../Shaders/SkyAtmosphereFS","../Shaders/SkyAtmosphereVS","./BlendingState","./CullFace","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w){"use strict";function S(r){r=i(r,a.WGS84),this.show=!0,this._ellipsoid=r,this._command=new d({owner:this}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._spSkyFromSpaceColorCorrect=void 0,this._spSkyFromAtmosphereColorCorrect=void 0,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this._hueSaturationBrightness=new e;var n=new t;n.w=0,n.y=e.maximumComponent(e.multiplyByScalar(r.radii,1.025,new e)),n.z=r.maximumRadius,this._cameraAndRadiiAndDynamicAtmosphereColor=n;var o=this;this._command.uniformMap={u_cameraAndRadiiAndDynamicAtmosphereColor:function(){return o._cameraAndRadiiAndDynamicAtmosphereColor},u_hsbShift:function(){return o._hueSaturationBrightness.x=o.hueShift,o._hueSaturationBrightness.y=o.saturationShift,o._hueSaturationBrightness.z=o.brightnessShift,o._hueSaturationBrightness}}}function E(e){return!(u.equalsEpsilon(e.hueShift,0,u.EPSILON7)&&u.equalsEpsilon(e.saturationShift,0,u.EPSILON7)&&u.equalsEpsilon(e.brightnessShift,0,u.EPSILON7))}return n(S.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),S.prototype.setDynamicAtmosphereColor=function(e){this._cameraAndRadiiAndDynamicAtmosphereColor.w=e?1:0},S.prototype.update=function(t){if(this.show&&(t.mode===w.SCENE3D||t.mode===w.MORPHING)&&t.passes.render){var i=this._command;if(!r(i.vertexArray)){var n=t.context,o=s.createGeometry(new s({radii:e.multiplyByScalar(this._ellipsoid.radii,1.025,new e),slicePartitions:256,stackPartitions:256,vertexFormat:c.POSITION_ONLY}));i.vertexArray=_.fromGeometry({context:n,geometry:o,attributeLocations:l.createAttributeLocations(o),bufferUsage:h.STATIC_DRAW}),i.renderState=p.fromCache({cull:{enabled:!0,face:C.FRONT},blending:y.ALPHA_BLEND});var a=new f({defines:["SKY_FROM_SPACE"],sources:[v]});this._spSkyFromSpace=m.fromCache({context:n,vertexShaderSource:a,fragmentShaderSource:g}),a=new f({defines:["SKY_FROM_ATMOSPHERE"],sources:[v]}),this._spSkyFromAtmosphere=m.fromCache({context:n,vertexShaderSource:a,fragmentShaderSource:g})}var u=E(this);if(u&&(!r(this._spSkyFromSpaceColorCorrect)||!r(this._spSkyFromAtmosphereColorCorrect))){var d=t.context,S=new f({defines:["SKY_FROM_SPACE"],sources:[v]}),b=new f({defines:["COLOR_CORRECT"],sources:[g]});this._spSkyFromSpaceColorCorrect=m.fromCache({context:d,vertexShaderSource:S,fragmentShaderSource:b}),S=new f({defines:["SKY_FROM_ATMOSPHERE"],sources:[v]}),this._spSkyFromAtmosphereColorCorrect=m.fromCache({context:d,vertexShaderSource:S,fragmentShaderSource:b})}var T=t.camera.positionWC,x=e.magnitude(T);return this._cameraAndRadiiAndDynamicAtmosphereColor.x=x,x>this._cameraAndRadiiAndDynamicAtmosphereColor.y?i.shaderProgram=u?this._spSkyFromSpaceColorCorrect:this._spSkyFromSpace:i.shaderProgram=u?this._spSkyFromAtmosphereColorCorrect:this._spSkyFromAtmosphere,i}},S.prototype.isDestroyed=function(){return!1},S.prototype.destroy=function(){var e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyFromSpace=this._spSkyFromSpace&&this._spSkyFromSpace.destroy(),this._spSkyFromAtmosphere=this._spSkyFromAtmosphere&&this._spSkyFromAtmosphere.destroy(),this._spSkyFromSpaceColorCorrect=this._spSkyFromSpaceColorCorrect&&this._spSkyFromSpaceColorCorrect.destroy(),this._spSkyFromAtmosphereColorCorrect=this._spSkyFromAtmosphereColorCorrect&&this._spSkyFromAtmosphereColorCorrect.destroy(),o(this)},S}),i("Shaders/SkyBoxFS",[],function(){"use strict";return"uniform samplerCube u_cubeMap;\nvarying vec3 v_texCoord;\nvoid main()\n{\nvec3 rgb = textureCube(u_cubeMap, normalize(v_texCoord)).rgb;\ngl_FragColor = vec4(rgb, czm_morphTime);\n}\n"}),i("Shaders/SkyBoxVS",[],function(){"use strict";return"attribute vec3 position;\nvarying vec3 v_texCoord;\nvoid main()\n{\nvec3 p = czm_viewRotation * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position));\ngl_Position = czm_projection * vec4(p, 1.0);\nv_texCoord = position.xyz;\n}\n"}),i("Scene/SkyBox",["../Core/BoxGeometry","../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/GeometryPipeline","../Core/Matrix4","../Core/VertexFormat","../Renderer/BufferUsage","../Renderer/CubeMap","../Renderer/DrawCommand","../Renderer/loadCubeMap","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/VertexArray","../Shaders/SkyBoxFS","../Shaders/SkyBoxVS","./BlendingState","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y){"use strict";function C(e){this.sources=e.sources,this._sources=void 0,this.show=i(e.show,!0),this._command=new h({modelMatrix:s.clone(s.IDENTITY),owner:this}),this._cubeMap=void 0}return C.prototype.update=function(i){if(this.show&&(i.mode===y.SCENE3D||i.mode===y.MORPHING)&&i.passes.render){var n=i.context;if(this._sources!==this.sources){this._sources=this.sources;var o=this.sources;"string"==typeof o.positiveX?d(n,this._sources).then(function(e){h._cubeMap=h._cubeMap&&h._cubeMap.destroy(),h._cubeMap=e}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new c({context:n,source:o}))}var s=this._command;if(!r(s.vertexArray)){var h=this;s.uniformMap={u_cubeMap:function(){return h._cubeMap}};var C=e.createGeometry(e.fromDimensions({dimensions:new t(2,2,2),vertexFormat:l.POSITION_ONLY})),w=a.createAttributeLocations(C);s.vertexArray=f.fromGeometry({context:n,geometry:C,attributeLocations:w,bufferUsage:u.STATIC_DRAW}),s.shaderProgram=m.fromCache({context:n,vertexShaderSource:g,fragmentShaderSource:_,attributeLocations:w}),s.renderState=p.fromCache({blending:v.ALPHA_BLEND})}if(r(this._cubeMap))return s}},C.prototype.isDestroyed=function(){return!1},C.prototype.destroy=function(){var e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),n(this)},C}),i("Shaders/SunFS",[],function(){"use strict";return"uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = texture2D(u_texture, v_textureCoordinates);\n}\n"}),i("Shaders/SunTextureFS",[],function(){"use strict";return"uniform float u_glowLengthTS;\nuniform float u_radiusTS;\nvarying vec2 v_textureCoordinates;\nvec2 rotate(vec2 p, vec2 direction)\n{\nreturn vec2(p.x * direction.x - p.y * direction.y, p.x * direction.y + p.y * direction.x);\n}\nvec4 addBurst(vec2 position, vec2 direction)\n{\nvec2 rotatedPosition = rotate(position, direction) * vec2(25.0, 0.75);\nfloat radius = length(rotatedPosition);\nfloat burst = 1.0 - smoothstep(0.0, 0.55, radius);\nreturn vec4(burst);\n}\nvoid main()\n{\nvec2 position = v_textureCoordinates - vec2(0.5);\nfloat radius = length(position);\nfloat surface = step(radius, u_radiusTS);\nvec4 color = vec4(1.0, 1.0, surface + 0.2, surface);\nfloat glow = 1.0 - smoothstep(0.0, 0.55, radius);\ncolor.ba += mix(vec2(0.0), vec2(1.0), glow) * 0.75;\nvec4 burst = vec4(0.0);\nburst += 0.4 * addBurst(position, vec2(0.38942, 0.92106));\nburst += 0.4 * addBurst(position, vec2(0.99235, 0.12348));\nburst += 0.4 * addBurst(position, vec2(0.60327, -0.79754));\nburst += 0.3 * addBurst(position, vec2(0.31457, 0.94924));\nburst += 0.3 * addBurst(position, vec2(0.97931, 0.20239));\nburst += 0.3 * addBurst(position, vec2(0.66507, -0.74678));\ncolor += clamp(burst, vec4(0.0), vec4(1.0)) * 0.15;\ngl_FragColor = clamp(color, vec4(0.0), vec4(1.0));\n}\n"}),i("Shaders/SunVS",[],function(){"use strict";return"attribute vec2 direction;\nuniform float u_size;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec4 position;\nif (czm_morphTime == 1.0)\n{\nposition = vec4(czm_sunPositionWC, 1.0);\n}\nelse\n{\nposition = vec4(czm_sunPositionColumbusView.zxy, 1.0);\n}\nvec4 positionEC = czm_view * position;\nvec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\nvec2 halfSize = vec2(u_size * 0.5);\nhalfSize *= ((direction * 2.0) - 1.0);\ngl_Position = czm_viewportOrthographic * vec4(positionWC.xy + halfSize, -positionWC.z, 1.0);\nv_textureCoordinates = direction;\n}\n"}),i("Scene/Sun",["../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/ComponentDatatype","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/IndexDatatype","../Core/Math","../Core/Matrix4","../Core/PixelFormat","../Core/PrimitiveType","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/ComputeCommand","../Renderer/DrawCommand","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/Texture","../Renderer/VertexArray","../Shaders/SunFS","../Shaders/SunTextureFS","../Shaders/SunVS","./BlendingState","./SceneMode","./SceneTransforms"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x){"use strict";function A(){this.show=!0,this._drawCommand=new _({primitiveType:d.TRIANGLES,boundingVolume:new e,owner:this}),this._commands={drawCommand:this._drawCommand,computeCommand:void 0},this._boundingVolume=new e,this._boundingVolume2D=new e,this._texture=void 0,this._drawingBufferWidth=void 0,this._drawingBufferHeight=void 0,this._radiusTS=void 0,this._size=void 0,this.glowFactor=1,this._glowFactorDirty=!1;var t=this;this._uniformMap={u_texture:function(){return t._texture},u_size:function(){return t._size}}}a(A.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var P=new t,D=new t,M=new r,I=new r;return A.prototype.update=function(r){var a=r._passState,s=r.frameState,d=r.context;if(this.show){var _=s.mode;if(_!==T.SCENE2D&&_!==T.MORPHING&&s.passes.render){var A=a.viewport.width,R=a.viewport.height;if(!o(this._texture)||A!==this._drawingBufferWidth||R!==this._drawingBufferHeight||this._glowFactorDirty){this._texture=this._texture&&this._texture.destroy(),this._drawingBufferWidth=A,this._drawingBufferHeight=R,this._glowFactorDirty=!1;var O=Math.max(A,R);O=Math.pow(2,Math.ceil(Math.log(O)/Math.log(2))-2),O=Math.max(1,O),this._texture=new y({context:d,width:O,height:O,pixelFormat:h.RGBA}),this._glowLengthTS=5*this._glowFactor,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;var N=this,L={u_glowLengthTS:function(){return N._glowLengthTS},u_radiusTS:function(){return N._radiusTS}};this._commands.computeCommand=new f({fragmentShaderSource:S,outputTexture:this._texture,uniformMap:L,persists:!1,owner:this,postExecute:function(){N._commands.computeCommand=void 0}})}var B=this._drawCommand;if(!o(B.vertexArray)){var F={direction:0},V=new Uint8Array(8);V[0]=0,V[1]=0,V[2]=255,V[3]=0,V[4]=255,V[5]=255,V[6]=0,V[7]=255;var k=p.createVertexBuffer({context:d,typedArray:V,usage:m.STATIC_DRAW}),z=[{index:F.direction,vertexBuffer:k,componentsPerAttribute:2,normalize:!0,componentDatatype:n.UNSIGNED_BYTE}],U=p.createIndexBuffer({context:d,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:m.STATIC_DRAW,indexDatatype:l.UNSIGNED_SHORT});B.vertexArray=new C({context:d,attributes:z,indexBuffer:U}),B.shaderProgram=v.fromCache({context:d,vertexShaderSource:E,fragmentShaderSource:w,attributeLocations:F}),B.renderState=g.fromCache({blending:b.ALPHA_BLEND}),B.uniformMap=this._uniformMap}var G=d.uniformState.sunPositionWC,W=d.uniformState.sunPositionColumbusView,H=this._boundingVolume,q=this._boundingVolume2D;i.clone(G,H.center),q.center.x=W.z,q.center.y=W.x,q.center.z=W.y,H.radius=u.SOLAR_RADIUS+u.SOLAR_RADIUS*this._glowLengthTS,q.radius=H.radius,_===T.SCENE3D?e.clone(H,B.boundingVolume):_===T.COLUMBUS_VIEW&&e.clone(q,B.boundingVolume);var j=x.computeActualWgs84Position(s,G,I),Y=i.magnitude(i.subtract(j,r.camera.position,I)),X=d.uniformState.projection,Z=M;Z.x=0,Z.y=0,Z.z=-Y,Z.w=1;var K=c.multiplyByVector(X,Z,I),Q=x.clipToDrawingBufferCoordinates(a.viewport,K,P);Z.x=u.SOLAR_RADIUS;var J=c.multiplyByVector(X,Z,I),$=x.clipToDrawingBufferCoordinates(a.viewport,J,D);return this._size=Math.ceil(t.magnitude(t.subtract($,Q,I))),this._size=2*this._size*(1+2*this._glowLengthTS),this._commands}}},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){var e=this._drawCommand;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._texture=this._texture&&this._texture.destroy(),s(this)},A}),i("Scene/TileCoordinatesImageryProvider",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","../Core/GeographicTilingScheme","../ThirdParty/when"],function(e,t,i,r,n,o,a){"use strict";function s(r){r=t(r,t.EMPTY_OBJECT),this._tilingScheme=i(r.tilingScheme)?r.tilingScheme:new o({ellipsoid:r.ellipsoid}),this._color=t(r.color,e.YELLOW),this._errorEvent=new n,this._tileWidth=t(r.tileWidth,256),this._tileHeight=t(r.tileHeight,256),this._readyPromise=a.resolve(!0)}return r(s.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return!0}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}}),s.prototype.getTileCredits=function(e,t,i){},s.prototype.requestImage=function(e,t,i){var r=document.createElement("canvas");r.width=256,r.height=256;var n=r.getContext("2d"),o=this._color.toCssColorString();n.strokeStyle=o,n.lineWidth=2,n.strokeRect(1,1,255,255);var a="L"+i+"X"+e+"Y"+t;return n.font="bold 25px Arial",n.textAlign="center",n.fillStyle="black",n.fillText(a,127,127),n.fillStyle=o,n.fillText(a,124,124),r},s.prototype.pickFeatures=function(){},s}),i("Scene/TileDiscardPolicy",["../Core/DeveloperError"],function(e){"use strict";function t(t){e.throwInstantiationError()}return t.prototype.isReady=e.throwInstantiationError,t.prototype.shouldDiscardImage=e.throwInstantiationError,t}),i("Scene/TileState",["../Core/freezeObject"],function(e){"use strict";var t={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3};return e(t)}),i("Shaders/ViewportQuadFS",[],function(){"use strict";return"varying vec2 v_textureCoordinates;\nvoid main()\n{\nczm_materialInput materialInput;\nmaterialInput.s = v_textureCoordinates.s;\nmaterialInput.st = v_textureCoordinates;\nmaterialInput.str = vec3(v_textureCoordinates, 0.0);\nmaterialInput.normalEC = vec3(0.0, 0.0, -1.0);\nczm_material material = czm_getMaterial(materialInput);\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n}\n"}),i("Scene/ViewportQuad",["../Core/BoundingRectangle","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderSource","../Shaders/ViewportQuadFS","./BlendingState","./Material"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(r,n){this.show=!0,i(r)||(r=new e),this.rectangle=e.clone(r),i(n)||(n=c.fromType(c.ColorType,{color:new t(1,1,1,1)})),this.material=n,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}return h.prototype.update=function(t){if(this.show){var r=this._rs;i(r)&&e.equals(r.viewport,this.rectangle)||(this._rs=a.fromCache({blending:u.ALPHA_BLEND,viewport:this.rectangle}));var n=t.passes;if(n.render){var c=t.context;if(this._material!==this.material||!i(this._overlayCommand)){this._material=this.material,i(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();var h=new s({sources:[this._material.shaderSource,l]});this._overlayCommand=c.createViewportQuadCommand(h,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=o.OVERLAY}this._material.update(c),this._overlayCommand.uniformMap=this._material._uniforms,t.commandList.push(this._overlayCommand)}}},h.prototype.isDestroyed=function(){return!1},h.prototype.destroy=function(){return i(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),r(this)},h}),i("Scene/WebMapServiceImageryProvider",["../Core/combine","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/freezeObject","../Core/GeographicTilingScheme","../Core/objectToQuery","../Core/queryToObject","../Core/WebMercatorTilingScheme","../ThirdParty/Uri","./GetFeatureInfoFormat","./UrlTemplateImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,h,d){"use strict";function p(r){function n(e,t){i(f[e])||(f[e]=t),i(v)&&!i(v[e])&&(v[e]=t)}r=t(r,t.EMPTY_OBJECT),this._url=r.url,this._layers=r.layers;var o=t(r.getFeatureInfoFormats,p.DefaultGetFeatureInfoFormats),h=new c(r.url),f=l(t(h.query,"")),_=e(m(t(r.parameters,t.EMPTY_OBJECT)),p.DefaultParameters);f=e(_,f);var g,v;g=new c(r.url),v=l(t(g.query,""));var y=e(m(t(r.getFeatureInfoParameters,t.EMPTY_OBJECT)),p.GetFeatureInfoDefaultParameters);v=e(y,v),n("layers",r.layers),n("srs",r.tilingScheme instanceof u?"EPSG:3857":"EPSG:4326"),n("bbox","{westProjected},{southProjected},{eastProjected},{northProjected}"),n("width","{width}"),n("height","{height}"),h.query=s(f);var C,w=h.toString().replace(/%7B/g,"{").replace(/%7D/g,"}");i(v)&&(i(v.query_layers)||(v.query_layers=r.layers),i(v.x)||(v.x="{i}"),i(v.y)||(v.y="{j}"),i(v.info_format)||(v.info_format="{format}"),g.query=s(v),C=g.toString().replace(/%7B/g,"{").replace(/%7D/g,"}")),this._tileProvider=new d({url:w,pickFeaturesUrl:C,tilingScheme:t(r.tilingScheme,new a({ellipsoid:r.ellipsoid})),rectangle:r.rectangle,tileWidth:r.tileWidth,tileHeight:r.tileHeight,minimumLevel:r.minimumLevel,maximumLevel:r.maximumLevel,proxy:r.proxy,subdomains:r.subdomains,tileDiscardPolicy:r.tileDiscardPolicy,credit:r.credit,getFeatureInfoFormats:o,enablePickFeatures:r.enablePickFeatures})}function m(e){var t={};for(var i in e)e.hasOwnProperty(i)&&(t[i.toLowerCase()]=e[i]);return t}return r(p.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._tileProvider.proxy}},layers:{get:function(){return this._layers}},tileWidth:{get:function(){return this._tileProvider.tileWidth}},tileHeight:{get:function(){return this._tileProvider.tileHeight}},maximumLevel:{get:function(){return this._tileProvider.maximumLevel}},minimumLevel:{get:function(){return this._tileProvider.minimumLevel}},tilingScheme:{get:function(){return this._tileProvider.tilingScheme}},rectangle:{get:function(){return this._tileProvider.rectangle}},tileDiscardPolicy:{get:function(){return this._tileProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._tileProvider.errorEvent}},ready:{get:function(){return this._tileProvider.ready}},readyPromise:{get:function(){return this._tileProvider.readyPromise}},credit:{get:function(){return this._tileProvider.credit}},hasAlphaChannel:{get:function(){return this._tileProvider.hasAlphaChannel}},enablePickFeatures:{get:function(){return this._tileProvider.enablePickFeatures},set:function(e){this._tileProvider.enablePickFeatures=e}}}),p.prototype.getTileCredits=function(e,t,i){return this._tileProvider.getTileCredits(e,t,i)},p.prototype.requestImage=function(e,t,i){return this._tileProvider.requestImage(e,t,i)},p.prototype.pickFeatures=function(e,t,i,r,n){return this._tileProvider.pickFeatures(e,t,i,r,n)},p.DefaultParameters=o({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"}),p.GetFeatureInfoDefaultParameters=o({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"}),p.DefaultGetFeatureInfoFormats=o([o(new h("json","application/json")),o(new h("xml","text/xml")),o(new h("text","text/html"))]),p}),i("Scene/WebMapTileServiceImageryProvider",["../Core/combine","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/freezeObject","../Core/isArray","../Core/objectToQuery","../Core/queryToObject","../Core/Rectangle","../Core/WebMercatorTilingScheme","../ThirdParty/Uri","../ThirdParty/when","./ImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f){"use strict";function _(e){e=i(e,i.EMPTY_OBJECT),this._url=e.url,this._layer=e.layer,this._style=e.style,this._tileMatrixSetID=e.tileMatrixSetID,this._tileMatrixLabels=e.tileMatrixLabels,this._format=i(e.format,"image/jpeg"),this._proxy=e.proxy,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=r(e.tilingScheme)?e.tilingScheme:new d({ellipsoid:e.ellipsoid}),this._tileWidth=i(e.tileWidth,256),this._tileHeight=i(e.tileHeight,256),this._minimumLevel=i(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._rectangle=i(e.rectangle,this._tilingScheme.rectangle),this._readyPromise=m.resolve(!0);var n=this._tilingScheme.positionToTileXY(h.southwest(this._rectangle),this._minimumLevel),o=this._tilingScheme.positionToTileXY(h.northeast(this._rectangle),this._minimumLevel);(Math.abs(o.x-n.x)+1)*(Math.abs(o.y-n.y)+1);this._errorEvent=new a;var s=e.credit;this._credit="string"==typeof s?new t(s):s,this._subdomains=e.subdomains,l(this._subdomains)?this._subdomains=this._subdomains.slice():r(this._subdomains)&&this._subdomains.length>0?this._subdomains=this._subdomains.split(""):this._subdomains=["a","b","c"]}function g(t,n,o,a){var s,l=t._tileMatrixLabels,h=r(l)?l[a]:a.toString(),d=t._subdomains;if(t._url.indexOf("{")>=0)s=t._url.replace("{style}",t._style).replace("{Style}",t._style).replace("{TileMatrixSet}",t._tileMatrixSetID).replace("{TileMatrix}",h).replace("{TileRow}",o.toString()).replace("{TileCol}",n.toString()).replace("{s}",d[(n+o+a)%d.length]);else{var m=new p(t._url),f=c(i(m.query,""));f=e(v,f),f.tilematrix=h,f.layer=t._layer,f.style=t._style,f.tilerow=o,f.tilecol=n,f.tilematrixset=t._tileMatrixSetID,f.format=t._format,m.query=u(f),s=m.toString()}var _=t._proxy;return r(_)&&(s=_.getURL(s)),s}var v=s({service:"WMTS",version:"1.0.0",request:"GetTile"});return n(_.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},format:{get:function(){return this._format}},ready:{value:!0},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}}),_.prototype.getTileCredits=function(e,t,i){},_.prototype.requestImage=function(e,t,i){var r=g(this,e,t,i);return f.loadImage(this,r)},_.prototype.pickFeatures=function(){},_}),function(){!function(e){var t=this||(0,eval)("this"),r=t.document,n=t.navigator,o=t.jQuery,a=t.JSON;!function(e){"function"==typeof i&&i.amd?i("ThirdParty/knockout-3.4.0",["exports","require"],e):e("object"==typeof exports&&"object"==typeof module?module.exports||exports:t.ko={})}(function(i,s){function l(e,t){return(null===e||typeof e in _)&&e===t}function u(t,i){var r;return function(){r||(r=f.a.setTimeout(function(){r=e,t()},i))}}function c(e,t){var i;return function(){clearTimeout(i),i=f.a.setTimeout(e,t)}}function h(e,t){t&&t!==g?"beforeChange"===t?this.Kb(e):this.Ha(e,t):this.Lb(e)}function d(e,t){null!==t&&t.k&&t.k()}function p(e,t){var i=this.Hc,r=i[S];r.R||(this.lb&&this.Ma[t]?(i.Pb(t,e,this.Ma[t]),this.Ma[t]=null,--this.lb):r.r[t]||i.Pb(t,e,r.s?{ia:e}:i.uc(e)))}function m(e,t,i,r){f.d[e]={init:function(e,n,o,a,s){var l,u;return f.m(function(){var o=f.a.c(n()),a=!i!=!o,c=!u;(c||t||a!==l)&&(c&&f.va.Aa()&&(u=f.a.ua(f.f.childNodes(e),!0)),a?(c||f.f.da(e,f.a.ua(u)),f.eb(r?r(s,o):s,e)):f.f.xa(e),l=a)},null,{ -i:e}),{controlsDescendantBindings:!0}}},f.h.ta[e]=!1,f.f.Z[e]=!0}var f="undefined"!=typeof i?i:{};f.b=function(e,t){for(var i=e.split("."),r=f,n=0;n<i.length-1;n++)r=r[i[n]];r[i[i.length-1]]=t},f.G=function(e,t,i){e[t]=i},f.version="3.4.0",f.b("version",f.version),f.options={deferUpdates:!1,useOnlyNativeEvents:!1},f.a=function(){function i(e,t){for(var i in e)e.hasOwnProperty(i)&&t(i,e[i])}function s(e,t){if(t)for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e}function l(e,t){return e.__proto__=t,e}function u(e,t,i,r){var n=e[t].match(g)||[];f.a.q(i.match(g),function(e){f.a.pa(n,e,r)}),e[t]=n.join(" ")}var c={__proto__:[]}instanceof Array,h="function"==typeof Symbol,d={},p={};d[n&&/Firefox\/2/i.test(n.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],d.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),i(d,function(e,t){if(t.length)for(var i=0,r=t.length;i<r;i++)p[t[i]]=e});var m={propertychange:!0},_=r&&function(){for(var t=3,i=r.createElement("div"),n=i.getElementsByTagName("i");i.innerHTML="<!--[if gt IE "+ ++t+"]><i></i><![endif]-->",n[0];);return 4<t?t:e}(),g=/\S+/g;return{cc:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],q:function(e,t){for(var i=0,r=e.length;i<r;i++)t(e[i],i)},o:function(e,t){if("function"==typeof Array.prototype.indexOf)return Array.prototype.indexOf.call(e,t);for(var i=0,r=e.length;i<r;i++)if(e[i]===t)return i;return-1},Sb:function(e,t,i){for(var r=0,n=e.length;r<n;r++)if(t.call(i,e[r],r))return e[r];return null},La:function(e,t){var i=f.a.o(e,t);0<i?e.splice(i,1):0===i&&e.shift()},Tb:function(e){e=e||[];for(var t=[],i=0,r=e.length;i<r;i++)0>f.a.o(t,e[i])&&t.push(e[i]);return t},fb:function(e,t){e=e||[];for(var i=[],r=0,n=e.length;r<n;r++)i.push(t(e[r],r));return i},Ka:function(e,t){e=e||[];for(var i=[],r=0,n=e.length;r<n;r++)t(e[r],r)&&i.push(e[r]);return i},ra:function(e,t){if(t instanceof Array)e.push.apply(e,t);else for(var i=0,r=t.length;i<r;i++)e.push(t[i]);return e},pa:function(e,t,i){var r=f.a.o(f.a.zb(e),t);0>r?i&&e.push(t):i||e.splice(r,1)},ka:c,extend:s,Xa:l,Ya:c?l:s,D:i,Ca:function(e,t){if(!e)return e;var i,r={};for(i in e)e.hasOwnProperty(i)&&(r[i]=t(e[i],i,e));return r},ob:function(e){for(;e.firstChild;)f.removeNode(e.firstChild)},jc:function(e){e=f.a.V(e);for(var t=(e[0]&&e[0].ownerDocument||r).createElement("div"),i=0,n=e.length;i<n;i++)t.appendChild(f.$(e[i]));return t},ua:function(e,t){for(var i=0,r=e.length,n=[];i<r;i++){var o=e[i].cloneNode(!0);n.push(t?f.$(o):o)}return n},da:function(e,t){if(f.a.ob(e),t)for(var i=0,r=t.length;i<r;i++)e.appendChild(t[i])},qc:function(e,t){var i=e.nodeType?[e]:e;if(0<i.length){for(var r=i[0],n=r.parentNode,o=0,a=t.length;o<a;o++)n.insertBefore(t[o],r);for(o=0,a=i.length;o<a;o++)f.removeNode(i[o])}},za:function(e,t){if(e.length){for(t=8===t.nodeType&&t.parentNode||t;e.length&&e[0].parentNode!==t;)e.splice(0,1);for(;1<e.length&&e[e.length-1].parentNode!==t;)e.length--;if(1<e.length){var i=e[0],r=e[e.length-1];for(e.length=0;i!==r;)e.push(i),i=i.nextSibling;e.push(r)}}return e},sc:function(e,t){7>_?e.setAttribute("selected",t):e.selected=t},$a:function(t){return null===t||t===e?"":t.trim?t.trim():t.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},nd:function(e,t){return e=e||"",!(t.length>e.length)&&e.substring(0,t.length)===t},Mc:function(e,t){if(e===t)return!0;if(11===e.nodeType)return!1;if(t.contains)return t.contains(3===e.nodeType?e.parentNode:e);if(t.compareDocumentPosition)return 16==(16&t.compareDocumentPosition(e));for(;e&&e!=t;)e=e.parentNode;return!!e},nb:function(e){return f.a.Mc(e,e.ownerDocument.documentElement)},Qb:function(e){return!!f.a.Sb(e,f.a.nb)},A:function(e){return e&&e.tagName&&e.tagName.toLowerCase()},Wb:function(e){return f.onError?function(){try{return e.apply(this,arguments)}catch(e){throw f.onError&&f.onError(e),e}}:e},setTimeout:function(e,t){return setTimeout(f.a.Wb(e),t)},$b:function(e){setTimeout(function(){throw f.onError&&f.onError(e),e},0)},p:function(e,t,i){var r=f.a.Wb(i);if(i=_&&m[t],f.options.useOnlyNativeEvents||i||!o)if(i||"function"!=typeof e.addEventListener){if("undefined"==typeof e.attachEvent)throw Error("Browser doesn't support addEventListener or attachEvent");var n=function(t){r.call(e,t)},a="on"+t;e.attachEvent(a,n),f.a.F.oa(e,function(){e.detachEvent(a,n)})}else e.addEventListener(t,r,!1);else o(e).bind(t,r)},Da:function(e,i){if(!e||!e.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var n;if("input"===f.a.A(e)&&e.type&&"click"==i.toLowerCase()?(n=e.type,n="checkbox"==n||"radio"==n):n=!1,f.options.useOnlyNativeEvents||!o||n)if("function"==typeof r.createEvent){if("function"!=typeof e.dispatchEvent)throw Error("The supplied element doesn't support dispatchEvent");n=r.createEvent(p[i]||"HTMLEvents"),n.initEvent(i,!0,!0,t,0,0,0,0,0,!1,!1,!1,!1,0,e),e.dispatchEvent(n)}else if(n&&e.click)e.click();else{if("undefined"==typeof e.fireEvent)throw Error("Browser doesn't support triggering events");e.fireEvent("on"+i)}else o(e).trigger(i)},c:function(e){return f.H(e)?e():e},zb:function(e){return f.H(e)?e.t():e},bb:function(e,t,i){var r;t&&("object"==typeof e.classList?(r=e.classList[i?"add":"remove"],f.a.q(t.match(g),function(t){r.call(e.classList,t)})):"string"==typeof e.className.baseVal?u(e.className,"baseVal",t,i):u(e,"className",t,i))},Za:function(t,i){var r=f.a.c(i);null!==r&&r!==e||(r="");var n=f.f.firstChild(t);!n||3!=n.nodeType||f.f.nextSibling(n)?f.f.da(t,[t.ownerDocument.createTextNode(r)]):n.data=r,f.a.Rc(t)},rc:function(e,t){if(e.name=t,7>=_)try{e.mergeAttributes(r.createElement("<input name='"+e.name+"'/>"),!1)}catch(e){}},Rc:function(e){9<=_&&(e=1==e.nodeType?e:e.parentNode,e.style&&(e.style.zoom=e.style.zoom))},Nc:function(e){if(_){var t=e.style.width;e.style.width=0,e.style.width=t}},hd:function(e,t){e=f.a.c(e),t=f.a.c(t);for(var i=[],r=e;r<=t;r++)i.push(r);return i},V:function(e){for(var t=[],i=0,r=e.length;i<r;i++)t.push(e[i]);return t},Yb:function(e){return h?Symbol(e):e},rd:6===_,sd:7===_,C:_,ec:function(e,t){for(var i=f.a.V(e.getElementsByTagName("input")).concat(f.a.V(e.getElementsByTagName("textarea"))),r="string"==typeof t?function(e){return e.name===t}:function(e){return t.test(e.name)},n=[],o=i.length-1;0<=o;o--)r(i[o])&&n.push(i[o]);return n},ed:function(e){return"string"==typeof e&&(e=f.a.$a(e))?a&&a.parse?a.parse(e):new Function("return "+e)():null},Eb:function(e,t,i){if(!a||!a.stringify)throw Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js");return a.stringify(f.a.c(e),t,i)},fd:function(e,t,n){n=n||{};var o=n.params||{},a=n.includeFields||this.cc,s=e;if("object"==typeof e&&"form"===f.a.A(e))for(var s=e.action,l=a.length-1;0<=l;l--)for(var u=f.a.ec(e,a[l]),c=u.length-1;0<=c;c--)o[u[c].name]=u[c].value;t=f.a.c(t);var h=r.createElement("form");h.style.display="none",h.action=s,h.method="post";for(var d in t)e=r.createElement("input"),e.type="hidden",e.name=d,e.value=f.a.Eb(f.a.c(t[d])),h.appendChild(e);i(o,function(e,t){var i=r.createElement("input");i.type="hidden",i.name=e,i.value=t,h.appendChild(i)}),r.body.appendChild(h),n.submitter?n.submitter(h):h.submit(),setTimeout(function(){h.parentNode.removeChild(h)},0)}}}(),f.b("utils",f.a),f.b("utils.arrayForEach",f.a.q),f.b("utils.arrayFirst",f.a.Sb),f.b("utils.arrayFilter",f.a.Ka),f.b("utils.arrayGetDistinctValues",f.a.Tb),f.b("utils.arrayIndexOf",f.a.o),f.b("utils.arrayMap",f.a.fb),f.b("utils.arrayPushAll",f.a.ra),f.b("utils.arrayRemoveItem",f.a.La),f.b("utils.extend",f.a.extend),f.b("utils.fieldsIncludedWithJsonPost",f.a.cc),f.b("utils.getFormFields",f.a.ec),f.b("utils.peekObservable",f.a.zb),f.b("utils.postJson",f.a.fd),f.b("utils.parseJson",f.a.ed),f.b("utils.registerEventHandler",f.a.p),f.b("utils.stringifyJson",f.a.Eb),f.b("utils.range",f.a.hd),f.b("utils.toggleDomNodeCssClass",f.a.bb),f.b("utils.triggerEvent",f.a.Da),f.b("utils.unwrapObservable",f.a.c),f.b("utils.objectForEach",f.a.D),f.b("utils.addOrRemoveItem",f.a.pa),f.b("utils.setTextContent",f.a.Za),f.b("unwrap",f.a.c),Function.prototype.bind||(Function.prototype.bind=function(e){var t=this;if(1===arguments.length)return function(){return t.apply(e,arguments)};var i=Array.prototype.slice.call(arguments,1);return function(){var r=i.slice(0);return r.push.apply(r,arguments),t.apply(e,r)}}),f.a.e=new function(){function t(t,o){var a=t[r];if(!a||"null"===a||!n[a]){if(!o)return e;a=t[r]="ko"+i++,n[a]={}}return n[a]}var i=0,r="__ko__"+(new Date).getTime(),n={};return{get:function(i,r){var n=t(i,!1);return n===e?e:n[r]},set:function(i,r,n){n===e&&t(i,!1)===e||(t(i,!0)[r]=n)},clear:function(e){var t=e[r];return!!t&&(delete n[t],e[r]=null,!0)},I:function(){return i++ +r}}},f.b("utils.domData",f.a.e),f.b("utils.domData.clear",f.a.e.clear),f.a.F=new function(){function t(t,i){var n=f.a.e.get(t,r);return n===e&&i&&(n=[],f.a.e.set(t,r,n)),n}function i(e){var r=t(e,!1);if(r)for(var r=r.slice(0),n=0;n<r.length;n++)r[n](e);if(f.a.e.clear(e),f.a.F.cleanExternalData(e),a[e.nodeType])for(r=e.firstChild;e=r;)r=e.nextSibling,8===e.nodeType&&i(e)}var r=f.a.e.I(),n={1:!0,8:!0,9:!0},a={1:!0,9:!0};return{oa:function(e,i){if("function"!=typeof i)throw Error("Callback must be a function");t(e,!0).push(i)},pc:function(i,n){var o=t(i,!1);o&&(f.a.La(o,n),0==o.length&&f.a.e.set(i,r,e))},$:function(e){if(n[e.nodeType]&&(i(e),a[e.nodeType])){var t=[];f.a.ra(t,e.getElementsByTagName("*"));for(var r=0,o=t.length;r<o;r++)i(t[r])}return e},removeNode:function(e){f.$(e),e.parentNode&&e.parentNode.removeChild(e)},cleanExternalData:function(e){o&&"function"==typeof o.cleanData&&o.cleanData([e])}}},f.$=f.a.F.$,f.removeNode=f.a.F.removeNode,f.b("cleanNode",f.$),f.b("removeNode",f.removeNode),f.b("utils.domNodeDisposal",f.a.F),f.b("utils.domNodeDisposal.addDisposeCallback",f.a.F.oa),f.b("utils.domNodeDisposal.removeDisposeCallback",f.a.F.pc),function(){var i=[0,"",""],n=[1,"<table>","</table>"],a=[3,"<table><tbody><tr>","</tr></tbody></table>"],s=[1,"<select multiple='multiple'>","</select>"],l={thead:n,tbody:n,tfoot:n,tr:[2,"<table><tbody>","</tbody></table>"],td:a,th:a,option:s,optgroup:s},u=8>=f.a.C;f.a.ma=function(e,n){var a;if(o){if(o.parseHTML)a=o.parseHTML(e,n)||[];else if((a=o.clean([e],n))&&a[0]){for(var s=a[0];s.parentNode&&11!==s.parentNode.nodeType;)s=s.parentNode;s.parentNode&&s.parentNode.removeChild(s)}}else{(a=n)||(a=r);var c,s=a.parentWindow||a.defaultView||t,h=f.a.$a(e).toLowerCase(),d=a.createElement("div");for(c=(h=h.match(/^<([a-z]+)[ >]/))&&l[h[1]]||i,h=c[0],c="ignored<div>"+c[1]+e+c[2]+"</div>","function"==typeof s.innerShiv?d.appendChild(s.innerShiv(c)):(u&&a.appendChild(d),d.innerHTML=c,u&&d.parentNode.removeChild(d));h--;)d=d.lastChild;a=f.a.V(d.lastChild.childNodes)}return a},f.a.Cb=function(t,i){if(f.a.ob(t),i=f.a.c(i),null!==i&&i!==e)if("string"!=typeof i&&(i=i.toString()),o)o(t).html(i);else for(var r=f.a.ma(i,t.ownerDocument),n=0;n<r.length;n++)t.appendChild(r[n])}}(),f.b("utils.parseHtmlFragment",f.a.ma),f.b("utils.setHtml",f.a.Cb),f.M=function(){function t(e,i){if(e)if(8==e.nodeType){var r=f.M.lc(e.nodeValue);null!=r&&i.push({Lc:e,cd:r})}else if(1==e.nodeType)for(var r=0,n=e.childNodes,o=n.length;r<o;r++)t(n[r],i)}var i={};return{wb:function(e){if("function"!=typeof e)throw Error("You can only pass a function to ko.memoization.memoize()");var t=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);return i[t]=e,"<!--[ko_memo:"+t+"]-->"},xc:function(t,r){var n=i[t];if(n===e)throw Error("Couldn't find any memo with ID "+t+". Perhaps it's already been unmemoized.");try{return n.apply(null,r||[]),!0}finally{delete i[t]}},yc:function(e,i){var r=[];t(e,r);for(var n=0,o=r.length;n<o;n++){var a=r[n].Lc,s=[a];i&&f.a.ra(s,i),f.M.xc(r[n].cd,s),a.nodeValue="",a.parentNode&&a.parentNode.removeChild(a)}},lc:function(e){return(e=e.match(/^\[ko_memo\:(.*?)\]$/))?e[1]:null}}}(),f.b("memoization",f.M),f.b("memoization.memoize",f.M.wb),f.b("memoization.unmemoize",f.M.xc),f.b("memoization.parseMemoText",f.M.lc),f.b("memoization.unmemoizeDomNodeAndDescendants",f.M.yc),f.Y=function(){function e(){if(o)for(var e,t=o,i=0;s<o;)if(e=n[s++]){if(s>t){if(5e3<=++i){s=o,f.a.$b(Error("'Too much recursion' after processing "+i+" task groups."));break}t=o}try{e()}catch(e){f.a.$b(e)}}}function i(){e(),s=o=n.length=0}var n=[],o=0,a=1,s=0;return{scheduler:t.MutationObserver?function(e){var t=r.createElement("div");return new MutationObserver(e).observe(t,{attributes:!0}),function(){t.classList.toggle("foo")}}(i):r&&"onreadystatechange"in r.createElement("script")?function(e){var t=r.createElement("script");t.onreadystatechange=function(){t.onreadystatechange=null,r.documentElement.removeChild(t),t=null,e()},r.documentElement.appendChild(t)}:function(e){setTimeout(e,0)},Wa:function(e){return o||f.Y.scheduler(i),n[o++]=e,a++},cancel:function(e){e-=a-o,e>=s&&e<o&&(n[e]=null)},resetForTesting:function(){var e=o-s;return s=o=n.length=0,e},md:e}}(),f.b("tasks",f.Y),f.b("tasks.schedule",f.Y.Wa),f.b("tasks.runEarly",f.Y.md),f.ya={throttle:function(e,t){e.throttleEvaluation=t;var i=null;return f.B({read:e,write:function(r){clearTimeout(i),i=f.a.setTimeout(function(){e(r)},t)}})},rateLimit:function(e,t){var i,r,n;"number"==typeof t?i=t:(i=t.timeout,r=t.method),e.cb=!1,n="notifyWhenChangesStop"==r?c:u,e.Ta(function(e){return n(e,i)})},deferred:function(t,i){if(!0!==i)throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");t.cb||(t.cb=!0,t.Ta(function(i){var r;return function(){f.Y.cancel(r),r=f.Y.Wa(i),t.notifySubscribers(e,"dirty")}}))},notify:function(e,t){e.equalityComparer="always"==t?null:l}};var _={undefined:1,boolean:1,number:1,string:1};f.b("extenders",f.ya),f.vc=function(e,t,i){this.ia=e,this.gb=t,this.Kc=i,this.R=!1,f.G(this,"dispose",this.k)},f.vc.prototype.k=function(){this.R=!0,this.Kc()},f.J=function(){f.a.Ya(this,v),v.rb(this)};var g="change",v={rb:function(e){e.K={},e.Nb=1},X:function(e,t,i){var r=this;i=i||g;var n=new f.vc(r,t?e.bind(t):e,function(){f.a.La(r.K[i],n),r.Ia&&r.Ia(i)});return r.sa&&r.sa(i),r.K[i]||(r.K[i]=[]),r.K[i].push(n),n},notifySubscribers:function(e,t){if(t=t||g,t===g&&this.zc(),this.Pa(t))try{f.l.Ub();for(var i,r=this.K[t].slice(0),n=0;i=r[n];++n)i.R||i.gb(e)}finally{f.l.end()}},Na:function(){return this.Nb},Uc:function(e){return this.Na()!==e},zc:function(){++this.Nb},Ta:function(e){var t,i,r,n=this,o=f.H(n);n.Ha||(n.Ha=n.notifySubscribers,n.notifySubscribers=h);var a=e(function(){n.Mb=!1,o&&r===n&&(r=n()),t=!1,n.tb(i,r)&&n.Ha(i=r)});n.Lb=function(e){n.Mb=t=!0,r=e,a()},n.Kb=function(e){t||(i=e,n.Ha(e,"beforeChange"))}},Pa:function(e){return this.K[e]&&this.K[e].length},Sc:function(e){if(e)return this.K[e]&&this.K[e].length||0;var t=0;return f.a.D(this.K,function(e,i){"dirty"!==e&&(t+=i.length)}),t},tb:function(e,t){return!this.equalityComparer||!this.equalityComparer(e,t)},extend:function(e){var t=this;return e&&f.a.D(e,function(e,i){var r=f.ya[e];"function"==typeof r&&(t=r(t,i)||t)}),t}};f.G(v,"subscribe",v.X),f.G(v,"extend",v.extend),f.G(v,"getSubscriptionsCount",v.Sc),f.a.ka&&f.a.Xa(v,Function.prototype),f.J.fn=v,f.hc=function(e){return null!=e&&"function"==typeof e.X&&"function"==typeof e.notifySubscribers},f.b("subscribable",f.J),f.b("isSubscribable",f.hc),f.va=f.l=function(){function e(e){r.push(i),i=e}function t(){i=r.pop()}var i,r=[],n=0;return{Ub:e,end:t,oc:function(e){if(i){if(!f.hc(e))throw Error("Only subscribable things can act as dependencies");i.gb.call(i.Gc,e,e.Cc||(e.Cc=++n))}},w:function(i,r,n){try{return e(),i.apply(r,n||[])}finally{t()}},Aa:function(){if(i)return i.m.Aa()},Sa:function(){if(i)return i.Sa}}}(),f.b("computedContext",f.va),f.b("computedContext.getDependenciesCount",f.va.Aa),f.b("computedContext.isInitial",f.va.Sa),f.b("ignoreDependencies",f.qd=f.l.w);var y=f.a.Yb("_latestValue");f.N=function(e){function t(){return 0<arguments.length?(t.tb(t[y],arguments[0])&&(t.ga(),t[y]=arguments[0],t.fa()),this):(f.l.oc(t),t[y])}return t[y]=e,f.a.ka||f.a.extend(t,f.J.fn),f.J.fn.rb(t),f.a.Ya(t,C),f.options.deferUpdates&&f.ya.deferred(t,!0),t};var C={equalityComparer:l,t:function(){return this[y]},fa:function(){this.notifySubscribers(this[y])},ga:function(){this.notifySubscribers(this[y],"beforeChange")}};f.a.ka&&f.a.Xa(C,f.J.fn);var w=f.N.gd="__ko_proto__";C[w]=f.N,f.Oa=function(t,i){return null!==t&&t!==e&&t[w]!==e&&(t[w]===i||f.Oa(t[w],i))},f.H=function(e){return f.Oa(e,f.N)},f.Ba=function(e){return!!("function"==typeof e&&e[w]===f.N||"function"==typeof e&&e[w]===f.B&&e.Vc)},f.b("observable",f.N),f.b("isObservable",f.H),f.b("isWriteableObservable",f.Ba),f.b("isWritableObservable",f.Ba),f.b("observable.fn",C),f.G(C,"peek",C.t),f.G(C,"valueHasMutated",C.fa),f.G(C,"valueWillMutate",C.ga),f.la=function(e){if(e=e||[],"object"!=typeof e||!("length"in e))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");return e=f.N(e),f.a.Ya(e,f.la.fn),e.extend({trackArrayChanges:!0})},f.la.fn={remove:function(e){for(var t=this.t(),i=[],r="function"!=typeof e||f.H(e)?function(t){return t===e}:e,n=0;n<t.length;n++){var o=t[n];r(o)&&(0===i.length&&this.ga(),i.push(o),t.splice(n,1),n--)}return i.length&&this.fa(),i},removeAll:function(t){if(t===e){var i=this.t(),r=i.slice(0);return this.ga(),i.splice(0,i.length),this.fa(),r}return t?this.remove(function(e){return 0<=f.a.o(t,e)}):[]},destroy:function(e){var t=this.t(),i="function"!=typeof e||f.H(e)?function(t){return t===e}:e;this.ga();for(var r=t.length-1;0<=r;r--)i(t[r])&&(t[r]._destroy=!0);this.fa()},destroyAll:function(t){return t===e?this.destroy(function(){return!0}):t?this.destroy(function(e){return 0<=f.a.o(t,e)}):[]},indexOf:function(e){var t=this();return f.a.o(t,e)},replace:function(e,t){var i=this.indexOf(e);0<=i&&(this.ga(),this.t()[i]=t,this.fa())}},f.a.ka&&f.a.Xa(f.la.fn,f.N.fn),f.a.q("pop push reverse shift sort splice unshift".split(" "),function(e){f.la.fn[e]=function(){var t=this.t();this.ga(),this.Vb(t,e,arguments);var i=t[e].apply(t,arguments);return this.fa(),i===t?this:i}}),f.a.q(["slice"],function(e){f.la.fn[e]=function(){var t=this();return t[e].apply(t,arguments)}}),f.b("observableArray",f.la),f.ya.trackArrayChanges=function(e,t){function i(){if(!n){n=!0;var t=e.notifySubscribers;e.notifySubscribers=function(e,i){return i&&i!==g||++a,t.apply(this,arguments)};var i=[].concat(e.t()||[]);o=null,r=e.X(function(t){if(t=[].concat(t||[]),e.Pa("arrayChange")){var r;(!o||1<a)&&(o=f.a.ib(i,t,e.hb)),r=o}i=t,o=null,a=0,r&&r.length&&e.notifySubscribers(r,"arrayChange")})}}if(e.hb={},t&&"object"==typeof t&&f.a.extend(e.hb,t),e.hb.sparse=!0,!e.Vb){var r,n=!1,o=null,a=0,s=e.sa,l=e.Ia;e.sa=function(t){s&&s.call(e,t),"arrayChange"===t&&i()},e.Ia=function(t){l&&l.call(e,t),"arrayChange"!==t||e.Pa("arrayChange")||(r.k(),n=!1)},e.Vb=function(e,t,i){function r(e,t,i){return s[s.length]={status:e,value:t,index:i}}if(n&&!a){var s=[],l=e.length,u=i.length,c=0;switch(t){case"push":c=l;case"unshift":for(t=0;t<u;t++)r("added",i[t],c+t);break;case"pop":c=l-1;case"shift":l&&r("deleted",e[c],c);break;case"splice":t=Math.min(Math.max(0,0>i[0]?l+i[0]:i[0]),l);for(var l=1===u?l:Math.min(t+(i[1]||0),l),u=t+u-2,c=Math.max(l,u),h=[],d=[],p=2;t<c;++t,++p)t<l&&d.push(r("deleted",e[t],t)),t<u&&h.push(r("added",i[p],t));f.a.dc(d,h);break;default:return}o=s}}}};var S=f.a.Yb("_state");f.m=f.B=function(t,i,r){function n(){if(0<arguments.length){if("function"!=typeof o)throw Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.");return o.apply(a.pb,arguments),this}return f.l.oc(n),(a.S||a.s&&n.Qa())&&n.aa(),a.T}if("object"==typeof t?r=t:(r=r||{},t&&(r.read=t)),"function"!=typeof r.read)throw Error("Pass a function that returns the value of the ko.computed");var o=r.write,a={T:e,S:!0,Ra:!1,Fb:!1,R:!1,Va:!1,s:!1,jd:r.read,pb:i||r.owner,i:r.disposeWhenNodeIsRemoved||r.i||null,wa:r.disposeWhen||r.wa,mb:null,r:{},L:0,bc:null};return n[S]=a,n.Vc="function"==typeof o,f.a.ka||f.a.extend(n,f.J.fn),f.J.fn.rb(n),f.a.Ya(n,E),r.pure?(a.Va=!0,a.s=!0,f.a.extend(n,b)):r.deferEvaluation&&f.a.extend(n,T),f.options.deferUpdates&&f.ya.deferred(n,!0),a.i&&(a.Fb=!0,a.i.nodeType||(a.i=null)),a.s||r.deferEvaluation||n.aa(),a.i&&n.ba()&&f.a.F.oa(a.i,a.mb=function(){n.k()}),n};var E={equalityComparer:l,Aa:function(){return this[S].L},Pb:function(e,t,i){if(this[S].Va&&t===this)throw Error("A 'pure' computed must not be called recursively");this[S].r[e]=i,i.Ga=this[S].L++,i.na=t.Na()},Qa:function(){var e,t,i=this[S].r;for(e in i)if(i.hasOwnProperty(e)&&(t=i[e],t.ia.Uc(t.na)))return!0},bd:function(){this.Fa&&!this[S].Ra&&this.Fa()},ba:function(){return this[S].S||0<this[S].L},ld:function(){this.Mb||this.ac()},uc:function(e){if(e.cb&&!this[S].i){var t=e.X(this.bd,this,"dirty"),i=e.X(this.ld,this);return{ia:e,k:function(){t.k(),i.k()}}}return e.X(this.ac,this)},ac:function(){var e=this,t=e.throttleEvaluation;t&&0<=t?(clearTimeout(this[S].bc),this[S].bc=f.a.setTimeout(function(){e.aa(!0)},t)):e.Fa?e.Fa():e.aa(!0)},aa:function(e){var t=this[S],i=t.wa;if(!t.Ra&&!t.R){if(t.i&&!f.a.nb(t.i)||i&&i()){if(!t.Fb)return void this.k()}else t.Fb=!1;t.Ra=!0;try{this.Qc(e)}finally{t.Ra=!1}t.L||this.k()}},Qc:function(t){var i=this[S],r=i.Va?e:!i.L,n={Hc:this,Ma:i.r,lb:i.L};f.l.Ub({Gc:n,gb:p,m:this,Sa:r}),i.r={},i.L=0,n=this.Pc(i,n),this.tb(i.T,n)&&(i.s||this.notifySubscribers(i.T,"beforeChange"),i.T=n,i.s?this.zc():t&&this.notifySubscribers(i.T)),r&&this.notifySubscribers(i.T,"awake")},Pc:function(e,t){try{var i=e.jd;return e.pb?i.call(e.pb):i()}finally{f.l.end(),t.lb&&!e.s&&f.a.D(t.Ma,d),e.S=!1}},t:function(){var e=this[S];return(e.S&&!e.L||e.s&&this.Qa())&&this.aa(),e.T},Ta:function(e){f.J.fn.Ta.call(this,e),this.Fa=function(){this.Kb(this[S].T),this[S].S=!0,this.Lb(this)}},k:function(){var e=this[S];!e.s&&e.r&&f.a.D(e.r,function(e,t){t.k&&t.k()}),e.i&&e.mb&&f.a.F.pc(e.i,e.mb),e.r=null,e.L=0,e.R=!0,e.S=!1,e.s=!1,e.i=null}},b={sa:function(e){var t=this,i=t[S];if(!i.R&&i.s&&"change"==e){if(i.s=!1,i.S||t.Qa())i.r=null,i.L=0,i.S=!0,t.aa();else{var r=[];f.a.D(i.r,function(e,t){r[t.Ga]=e}),f.a.q(r,function(e,r){var n=i.r[e],o=t.uc(n.ia);o.Ga=r,o.na=n.na,i.r[e]=o})}i.R||t.notifySubscribers(i.T,"awake")}},Ia:function(t){var i=this[S];i.R||"change"!=t||this.Pa("change")||(f.a.D(i.r,function(e,t){t.k&&(i.r[e]={ia:t.ia,Ga:t.Ga,na:t.na},t.k())}),i.s=!0,this.notifySubscribers(e,"asleep"))},Na:function(){var e=this[S];return e.s&&(e.S||this.Qa())&&this.aa(),f.J.fn.Na.call(this)}},T={sa:function(e){"change"!=e&&"beforeChange"!=e||this.t()}};f.a.ka&&f.a.Xa(E,f.J.fn);var x=f.N.gd;f.m[x]=f.N,E[x]=f.m,f.Xc=function(e){return f.Oa(e,f.m)},f.Yc=function(e){return f.Oa(e,f.m)&&e[S]&&e[S].Va},f.b("computed",f.m),f.b("dependentObservable",f.m),f.b("isComputed",f.Xc),f.b("isPureComputed",f.Yc),f.b("computed.fn",E),f.G(E,"peek",E.t),f.G(E,"dispose",E.k),f.G(E,"isActive",E.ba),f.G(E,"getDependenciesCount",E.Aa),f.nc=function(e,t){return"function"==typeof e?f.m(e,t,{pure:!0}):(e=f.a.extend({},e),e.pure=!0,f.m(e,t))},f.b("pureComputed",f.nc),function(){function t(n,o,a){if(a=a||new r,n=o(n),"object"!=typeof n||null===n||n===e||n instanceof RegExp||n instanceof Date||n instanceof String||n instanceof Number||n instanceof Boolean)return n;var s=n instanceof Array?[]:{};return a.save(n,s),i(n,function(i){var r=o(n[i]);switch(typeof r){case"boolean":case"number":case"string":case"function":s[i]=r;break;case"object":case"undefined":var l=a.get(r);s[i]=l!==e?l:t(r,o,a)}}),s}function i(e,t){if(e instanceof Array){for(var i=0;i<e.length;i++)t(i);"function"==typeof e.toJSON&&t("toJSON")}else for(i in e)t(i)}function r(){this.keys=[],this.Ib=[]}f.wc=function(e){if(0==arguments.length)throw Error("When calling ko.toJS, pass the object you want to convert.");return t(e,function(e){for(var t=0;f.H(e)&&10>t;t++)e=e();return e})},f.toJSON=function(e,t,i){return e=f.wc(e),f.a.Eb(e,t,i)},r.prototype={save:function(e,t){var i=f.a.o(this.keys,e);0<=i?this.Ib[i]=t:(this.keys.push(e),this.Ib.push(t))},get:function(t){return t=f.a.o(this.keys,t),0<=t?this.Ib[t]:e}}}(),f.b("toJS",f.wc),f.b("toJSON",f.toJSON),function(){f.j={u:function(t){switch(f.a.A(t)){case"option":return!0===t.__ko__hasDomDataOptionValue__?f.a.e.get(t,f.d.options.xb):7>=f.a.C?t.getAttributeNode("value")&&t.getAttributeNode("value").specified?t.value:t.text:t.value;case"select":return 0<=t.selectedIndex?f.j.u(t.options[t.selectedIndex]):e;default:return t.value}},ha:function(t,i,r){switch(f.a.A(t)){case"option":switch(typeof i){case"string":f.a.e.set(t,f.d.options.xb,e),"__ko__hasDomDataOptionValue__"in t&&delete t.__ko__hasDomDataOptionValue__,t.value=i;break;default:f.a.e.set(t,f.d.options.xb,i),t.__ko__hasDomDataOptionValue__=!0,t.value="number"==typeof i?i:""}break;case"select":""!==i&&null!==i||(i=e);for(var n,o=-1,a=0,s=t.options.length;a<s;++a)if(n=f.j.u(t.options[a]),n==i||""==n&&i===e){o=a;break}(r||0<=o||i===e&&1<t.size)&&(t.selectedIndex=o);break;default:null!==i&&i!==e||(i=""),t.value=i}}}}(),f.b("selectExtensions",f.j),f.b("selectExtensions.readValue",f.j.u),f.b("selectExtensions.writeValue",f.j.ha),f.h=function(){function e(e){e=f.a.$a(e),123===e.charCodeAt(0)&&(e=e.slice(1,-1));var t,i=[],a=e.match(r),s=[],l=0;if(a){a.push(",");for(var u,c=0;u=a[c];++c){var h=u.charCodeAt(0);if(44===h){if(0>=l){i.push(t&&s.length?{key:t,value:s.join("")}:{unknown:t||s.join("")}),t=l=0,s=[];continue}}else if(58===h){if(!l&&!t&&1===s.length){t=s.pop();continue}}else 47===h&&c&&1<u.length?(h=a[c-1].match(n))&&!o[h[0]]&&(e=e.substr(e.indexOf(u)+1),a=e.match(r),a.push(","),c=-1,u="/"):40===h||123===h||91===h?++l:41===h||125===h||93===h?--l:t||s.length||34!==h&&39!==h||(u=u.slice(1,-1));s.push(u)}}return i}var t=["true","false","null","undefined"],i=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,r=RegExp("\"(?:[^\"\\\\]|\\\\.)*\"|'(?:[^'\\\\]|\\\\.)*'|/(?:[^/\\\\]|\\\\.)*/w*|[^\\s:,/][^,\"'{}()/:[\\]]*[^\\s,\"'{}()/:[\\]]|[^\\s]","g"),n=/[\])"'A-Za-z0-9_$]+$/,o={in:1,return:1,typeof:1},a={};return{ta:[],ea:a,yb:e,Ua:function(r,n){function o(e,r){var n;if(!c){var h=f.getBindingHandler(e);if(h&&h.preprocess&&!(r=h.preprocess(r,e,o)))return;(h=a[e])&&(n=r,0<=f.a.o(t,n)?n=!1:(h=n.match(i),n=null!==h&&(h[1]?"Object("+h[1]+")"+h[2]:n)),h=n),h&&l.push("'"+e+"':function(_z){"+n+"=_z}")}u&&(r="function(){return "+r+" }"),s.push("'"+e+"':"+r)}n=n||{};var s=[],l=[],u=n.valueAccessors,c=n.bindingParams,h="string"==typeof r?e(r):r;return f.a.q(h,function(e){o(e.key||e.unknown,e.value)}),l.length&&o("_ko_property_writers","{"+l.join(",")+" }"),s.join(",")},ad:function(e,t){for(var i=0;i<e.length;i++)if(e[i].key==t)return!0;return!1},Ea:function(e,t,i,r,n){e&&f.H(e)?!f.Ba(e)||n&&e.t()===r||e(r):(e=t.get("_ko_property_writers"))&&e[i]&&e[i](r)}}}(),f.b("expressionRewriting",f.h),f.b("expressionRewriting.bindingRewriteValidators",f.h.ta),f.b("expressionRewriting.parseObjectLiteral",f.h.yb),f.b("expressionRewriting.preProcessBindings",f.h.Ua),f.b("expressionRewriting._twoWayBindings",f.h.ea),f.b("jsonExpressionRewriting",f.h),f.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",f.h.Ua),function(){function e(e){return 8==e.nodeType&&a.test(o?e.text:e.nodeValue)}function t(e){return 8==e.nodeType&&s.test(o?e.text:e.nodeValue)}function i(i,r){for(var n=i,o=1,a=[];n=n.nextSibling;){if(t(n)&&(o--,0===o))return a;a.push(n),e(n)&&o++}if(!r)throw Error("Cannot find closing comment tag to match: "+i.nodeValue);return null}function n(e,t){var r=i(e,t);return r?0<r.length?r[r.length-1].nextSibling:e.nextSibling:null}var o=r&&"<!--test-->"===r.createComment("test").text,a=o?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,s=o?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,l={ul:!0,ol:!0};f.f={Z:{},childNodes:function(t){return e(t)?i(t):t.childNodes},xa:function(t){if(e(t)){t=f.f.childNodes(t);for(var i=0,r=t.length;i<r;i++)f.removeNode(t[i])}else f.a.ob(t)},da:function(t,i){if(e(t)){f.f.xa(t);for(var r=t.nextSibling,n=0,o=i.length;n<o;n++)r.parentNode.insertBefore(i[n],r)}else f.a.da(t,i)},mc:function(t,i){e(t)?t.parentNode.insertBefore(i,t.nextSibling):t.firstChild?t.insertBefore(i,t.firstChild):t.appendChild(i)},gc:function(t,i,r){r?e(t)?t.parentNode.insertBefore(i,r.nextSibling):r.nextSibling?t.insertBefore(i,r.nextSibling):t.appendChild(i):f.f.mc(t,i)},firstChild:function(i){return e(i)?!i.nextSibling||t(i.nextSibling)?null:i.nextSibling:i.firstChild},nextSibling:function(i){return e(i)&&(i=n(i)),i.nextSibling&&t(i.nextSibling)?null:i.nextSibling},Tc:e,pd:function(e){return(e=(o?e.text:e.nodeValue).match(a))?e[1]:null},kc:function(i){if(l[f.a.A(i)]){var r=i.firstChild;if(r)do if(1===r.nodeType){var o;o=r.firstChild;var a=null;if(o)do if(a)a.push(o);else if(e(o)){var s=n(o,!0);s?o=s:a=[o]}else t(o)&&(a=[o]);while(o=o.nextSibling);if(o=a)for(a=r.nextSibling,s=0;s<o.length;s++)a?i.insertBefore(o[s],a):i.appendChild(o[s])}while(r=r.nextSibling)}}}}(),f.b("virtualElements",f.f),f.b("virtualElements.allowedBindings",f.f.Z),f.b("virtualElements.emptyNode",f.f.xa),f.b("virtualElements.insertAfter",f.f.gc),f.b("virtualElements.prepend",f.f.mc),f.b("virtualElements.setDomNodeChildren",f.f.da),function(){f.Q=function(){this.Fc={}},f.a.extend(f.Q.prototype,{nodeHasBindings:function(e){switch(e.nodeType){case 1:return null!=e.getAttribute("data-bind")||f.g.getComponentNameForNode(e);case 8:return f.f.Tc(e);default:return!1}},getBindings:function(e,t){var i=this.getBindingsString(e,t),i=i?this.parseBindingsString(i,t,e):null;return f.g.Ob(i,e,t,!1)},getBindingAccessors:function(e,t){var i=this.getBindingsString(e,t),i=i?this.parseBindingsString(i,t,e,{valueAccessors:!0}):null;return f.g.Ob(i,e,t,!0)},getBindingsString:function(e){switch(e.nodeType){case 1:return e.getAttribute("data-bind");case 8:return f.f.pd(e);default:return null}},parseBindingsString:function(e,t,i,r){try{var n,o=this.Fc,a=e+(r&&r.valueAccessors||"");if(!(n=o[a])){var s,l="with($context){with($data||{}){return{"+f.h.Ua(e,r)+"}}}";s=new Function("$context","$element",l),n=o[a]=s}return n(t,i)}catch(t){throw t.message="Unable to parse bindings.\nBindings value: "+e+"\nMessage: "+t.message,t}}}),f.Q.instance=new f.Q}(),f.b("bindingProvider",f.Q),function(){function i(e){return function(){return e}}function r(e){return e()}function n(e){return f.a.Ca(f.l.w(e),function(t,i){return function(){return e()[i]}})}function a(e,t,r){return"function"==typeof e?n(e.bind(null,t,r)):f.a.Ca(e,i)}function s(e,t){return n(this.getBindings.bind(this,e,t))}function l(e,t,i){var r,n=f.f.firstChild(t),o=f.Q.instance,a=o.preprocessNode;if(a){for(;r=n;)n=f.f.nextSibling(r),a.call(o,r);n=f.f.firstChild(t)}for(;r=n;)n=f.f.nextSibling(r),u(e,r,i)}function u(e,t,i){var r=!0,n=1===t.nodeType;n&&f.f.kc(t),(n&&i||f.Q.instance.nodeHasBindings(t))&&(r=h(t,null,e,i).shouldBindDescendants),r&&!p[f.a.A(t)]&&l(e,t,!n)}function c(e){var t=[],i={},r=[];return f.a.D(e,function n(o){if(!i[o]){var a=f.getBindingHandler(o);a&&(a.after&&(r.push(o),f.a.q(a.after,function(t){if(e[t]){if(-1!==f.a.o(r,t))throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+r.join(", "));n(t)}}),r.length--),t.push({key:o,fc:a})),i[o]=!0}}),t}function h(t,i,n,o){var a=f.a.e.get(t,m);if(!i){if(a)throw Error("You cannot apply bindings multiple times to the same element.");f.a.e.set(t,m,!0)}!a&&o&&f.tc(t,n);var l;if(i&&"function"!=typeof i)l=i;else{var u=f.Q.instance,h=u.getBindingAccessors||s,d=f.B(function(){return(l=i?i(n,t):h.call(u,t,n))&&n.P&&n.P(),l},null,{i:t});l&&d.ba()||(d=null)}var p;if(l){var _=d?function(e){return function(){return r(d()[e])}}:function(e){return l[e]},g=function(){return f.a.Ca(d?d():l,r)};g.get=function(e){return l[e]&&r(_(e)); -},g.has=function(e){return e in l},o=c(l),f.a.q(o,function(i){var r=i.fc.init,o=i.fc.update,a=i.key;if(8===t.nodeType&&!f.f.Z[a])throw Error("The binding '"+a+"' cannot be used with virtual elements");try{"function"==typeof r&&f.l.w(function(){var i=r(t,_(a),g,n.$data,n);if(i&&i.controlsDescendantBindings){if(p!==e)throw Error("Multiple bindings ("+p+" and "+a+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");p=a}}),"function"==typeof o&&f.B(function(){o(t,_(a),g,n.$data,n)},null,{i:t})}catch(e){throw e.message='Unable to process binding "'+a+": "+l[a]+'"\nMessage: '+e.message,e}})}return{shouldBindDescendants:p===e}}function d(e){return e&&e instanceof f.U?e:new f.U(e)}f.d={};var p={script:!0,textarea:!0,template:!0};f.getBindingHandler=function(e){return f.d[e]},f.U=function(t,i,r,n){var o,a=this,s="function"==typeof t&&!f.H(t),l=f.B(function(){var e=s?t():t,o=f.a.c(e);return i?(i.P&&i.P(),f.a.extend(a,i),l&&(a.P=l)):(a.$parents=[],a.$root=o,a.ko=f),a.$rawData=e,a.$data=o,r&&(a[r]=o),n&&n(a,i,o),a.$data},null,{wa:function(){return o&&!f.a.Qb(o)},i:!0});l.ba()&&(a.P=l,l.equalityComparer=null,o=[],l.Ac=function(t){o.push(t),f.a.F.oa(t,function(t){f.a.La(o,t),o.length||(l.k(),a.P=l=e)})})},f.U.prototype.createChildContext=function(e,t,i){return new f.U(e,this,t,function(e,t){e.$parentContext=t,e.$parent=t.$data,e.$parents=(t.$parents||[]).slice(0),e.$parents.unshift(e.$parent),i&&i(e)})},f.U.prototype.extend=function(e){return new f.U(this.P||this.$data,this,null,function(t,i){t.$rawData=i.$rawData,f.a.extend(t,"function"==typeof e?e():e)})};var m=f.a.e.I(),_=f.a.e.I();f.tc=function(e,t){return 2!=arguments.length?f.a.e.get(e,_):(f.a.e.set(e,_,t),void(t.P&&t.P.Ac(e)))},f.Ja=function(e,t,i){return 1===e.nodeType&&f.f.kc(e),h(e,t,d(i),!0)},f.Dc=function(e,t,i){return i=d(i),f.Ja(e,a(t,i,e),i)},f.eb=function(e,t){1!==t.nodeType&&8!==t.nodeType||l(d(e),t,!0)},f.Rb=function(e,i){if(!o&&t.jQuery&&(o=t.jQuery),i&&1!==i.nodeType&&8!==i.nodeType)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");i=i||t.document.body,u(d(e),i,!0)},f.kb=function(t){switch(t.nodeType){case 1:case 8:var i=f.tc(t);if(i)return i;if(t.parentNode)return f.kb(t.parentNode)}return e},f.Jc=function(t){return(t=f.kb(t))?t.$data:e},f.b("bindingHandlers",f.d),f.b("applyBindings",f.Rb),f.b("applyBindingsToDescendants",f.eb),f.b("applyBindingAccessorsToNode",f.Ja),f.b("applyBindingsToNode",f.Dc),f.b("contextFor",f.kb),f.b("dataFor",f.Jc)}(),function(e){function t(t,r){var a,s=n.hasOwnProperty(t)?n[t]:e;s?s.X(r):(s=n[t]=new f.J,s.X(r),i(t,function(e,i){var r=!(!i||!i.synchronous);o[t]={definition:e,Zc:r},delete n[t],a||r?s.notifySubscribers(e):f.Y.Wa(function(){s.notifySubscribers(e)})}),a=!0)}function i(e,t){r("getConfig",[e],function(i){i?r("loadComponent",[e,i],function(e){t(e,i)}):t(null,null)})}function r(t,i,n,o){o||(o=f.g.loaders.slice(0));var a=o.shift();if(a){var s=a[t];if(s){var l=!1;if(s.apply(a,i.concat(function(e){l?n(null):null!==e?n(e):r(t,i,n,o)}))!==e&&(l=!0,!a.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else r(t,i,n,o)}else n(null)}var n={},o={};f.g={get:function(i,r){var n=o.hasOwnProperty(i)?o[i]:e;n?n.Zc?f.l.w(function(){r(n.definition)}):f.Y.Wa(function(){r(n.definition)}):t(i,r)},Xb:function(e){delete o[e]},Jb:r},f.g.loaders=[],f.b("components",f.g),f.b("components.get",f.g.get),f.b("components.clearCachedDefinition",f.g.Xb)}(),function(){function e(e,t,i,r){function n(){0===--s&&r(o)}var o={},s=2,l=i.template;i=i.viewModel,l?a(t,l,function(t){f.g.Jb("loadTemplate",[e,t],function(e){o.template=e,n()})}):n(),i?a(t,i,function(t){f.g.Jb("loadViewModel",[e,t],function(e){o[c]=e,n()})}):n()}function i(e,t,r){if("function"==typeof t)r(function(e){return new t(e)});else if("function"==typeof t[c])r(t[c]);else if("instance"in t){var n=t.instance;r(function(){return n})}else"viewModel"in t?i(e,t.viewModel,r):e("Unknown viewModel value: "+t)}function n(e){switch(f.a.A(e)){case"script":return f.a.ma(e.text);case"textarea":return f.a.ma(e.value);case"template":if(o(e.content))return f.a.ua(e.content.childNodes)}return f.a.ua(e.childNodes)}function o(e){return t.DocumentFragment?e instanceof DocumentFragment:e&&11===e.nodeType}function a(e,i,r){"string"==typeof i.require?s||t.require?(s||t.require)([i.require],r):e("Uses require, but no AMD loader is present"):r(i)}function l(e){return function(t){throw Error("Component '"+e+"': "+t)}}var u={};f.g.register=function(e,t){if(!t)throw Error("Invalid configuration for "+e);if(f.g.ub(e))throw Error("Component "+e+" is already registered");u[e]=t},f.g.ub=function(e){return u.hasOwnProperty(e)},f.g.od=function(e){delete u[e],f.g.Xb(e)},f.g.Zb={getConfig:function(e,t){t(u.hasOwnProperty(e)?u[e]:null)},loadComponent:function(t,i,r){var n=l(t);a(n,i,function(i){e(t,n,i,r)})},loadTemplate:function(e,i,a){if(e=l(e),"string"==typeof i)a(f.a.ma(i));else if(i instanceof Array)a(i);else if(o(i))a(f.a.V(i.childNodes));else if(i.element)if(i=i.element,t.HTMLElement?i instanceof HTMLElement:i&&i.tagName&&1===i.nodeType)a(n(i));else if("string"==typeof i){var s=r.getElementById(i);s?a(n(s)):e("Cannot find element with ID "+i)}else e("Unknown element type: "+i);else e("Unknown template value: "+i)},loadViewModel:function(e,t,r){i(l(e),t,r)}};var c="createViewModel";f.b("components.register",f.g.register),f.b("components.isRegistered",f.g.ub),f.b("components.unregister",f.g.od),f.b("components.defaultLoader",f.g.Zb),f.g.loaders.push(f.g.Zb),f.g.Bc=u}(),function(){function e(e,i){var r=e.getAttribute("params");if(r){var r=t.parseBindingsString(r,i,e,{valueAccessors:!0,bindingParams:!0}),r=f.a.Ca(r,function(t){return f.m(t,null,{i:e})}),n=f.a.Ca(r,function(t){var i=t.t();return t.ba()?f.m({read:function(){return f.a.c(t())},write:f.Ba(i)&&function(e){t()(e)},i:e}):i});return n.hasOwnProperty("$raw")||(n.$raw=r),n}return{$raw:{}}}f.g.getComponentNameForNode=function(e){var t=f.a.A(e);if(f.g.ub(t)&&(-1!=t.indexOf("-")||"[object HTMLUnknownElement]"==""+e||8>=f.a.C&&e.tagName===t))return t},f.g.Ob=function(t,i,r,n){if(1===i.nodeType){var o=f.g.getComponentNameForNode(i);if(o){if(t=t||{},t.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var a={name:o,params:e(i,r)};t.component=n?function(){return a}:a}}return t};var t=new f.Q;9>f.a.C&&(f.g.register=function(e){return function(t){return r.createElement(t),e.apply(this,arguments)}}(f.g.register),r.createDocumentFragment=function(e){return function(){var t,i=e(),r=f.g.Bc;for(t in r)r.hasOwnProperty(t)&&i.createElement(t);return i}}(r.createDocumentFragment))}(),function(e){function t(e,t,i){if(t=t.template,!t)throw Error("Component '"+e+"' has no template");e=f.a.ua(t),f.f.da(i,e)}function i(e,t,i,r){var n=e.createViewModel;return n?n.call(e,r,{element:t,templateNodes:i}):r}var r=0;f.d.component={init:function(n,o,a,s,l){function u(){var e=c&&c.dispose;"function"==typeof e&&e.call(c),h=c=null}var c,h,d=f.a.V(f.f.childNodes(n));return f.a.F.oa(n,u),f.m(function(){var a,s,p=f.a.c(o());if("string"==typeof p?a=p:(a=f.a.c(p.name),s=f.a.c(p.params)),!a)throw Error("No component name specified");var m=h=++r;f.g.get(a,function(r){if(h===m){if(u(),!r)throw Error("Unknown component '"+a+"'");t(a,r,n);var o=i(r,n,d,s);r=l.createChildContext(o,e,function(e){e.$component=o,e.$componentTemplateNodes=d}),c=o,f.eb(r,n)}})},null,{i:n}),{controlsDescendantBindings:!0}}},f.f.Z.component=!0}();var A={class:"className",for:"htmlFor"};f.d.attr={update:function(t,i){var r=f.a.c(i())||{};f.a.D(r,function(i,r){r=f.a.c(r);var n=!1===r||null===r||r===e;n&&t.removeAttribute(i),8>=f.a.C&&i in A?(i=A[i],n?t.removeAttribute(i):t[i]=r):n||t.setAttribute(i,r.toString()),"name"===i&&f.a.rc(t,n?"":r.toString())})}},function(){f.d.checked={after:["value","attr"],init:function(t,i,r){function n(){var e=t.checked,n=p?a():e;if(!f.va.Sa()&&(!l||e)){var o=f.l.w(i);if(c){var s=h?o.t():o;d!==n?(e&&(f.a.pa(s,n,!0),f.a.pa(s,d,!1)),d=n):f.a.pa(s,n,e),h&&f.Ba(o)&&o(s)}else f.h.Ea(o,r,"checked",n,!0)}}function o(){var e=f.a.c(i());t.checked=c?0<=f.a.o(e,a()):s?e:a()===e}var a=f.nc(function(){return r.has("checkedValue")?f.a.c(r.get("checkedValue")):r.has("value")?f.a.c(r.get("value")):t.value}),s="checkbox"==t.type,l="radio"==t.type;if(s||l){var u=i(),c=s&&f.a.c(u)instanceof Array,h=!(c&&u.push&&u.splice),d=c?a():e,p=l||c;l&&!t.name&&f.d.uniqueName.init(t,function(){return!0}),f.m(n,null,{i:t}),f.a.p(t,"click",n),f.m(o,null,{i:t}),u=e}}},f.h.ea.checked=!0,f.d.checkedValue={update:function(e,t){e.value=f.a.c(t())}}}(),f.d.css={update:function(e,t){var i=f.a.c(t());null!==i&&"object"==typeof i?f.a.D(i,function(t,i){i=f.a.c(i),f.a.bb(e,t,i)}):(i=f.a.$a(String(i||"")),f.a.bb(e,e.__ko__cssValue,!1),e.__ko__cssValue=i,f.a.bb(e,i,!0))}},f.d.enable={update:function(e,t){var i=f.a.c(t());i&&e.disabled?e.removeAttribute("disabled"):i||e.disabled||(e.disabled=!0)}},f.d.disable={update:function(e,t){f.d.enable.update(e,function(){return!f.a.c(t())})}},f.d.event={init:function(e,t,i,r,n){var o=t()||{};f.a.D(o,function(o){"string"==typeof o&&f.a.p(e,o,function(e){var a,s=t()[o];if(s){try{var l=f.a.V(arguments);r=n.$data,l.unshift(r),a=s.apply(r,l)}finally{!0!==a&&(e.preventDefault?e.preventDefault():e.returnValue=!1)}!1===i.get(o+"Bubble")&&(e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation())}})})}},f.d.foreach={ic:function(e){return function(){var t=e(),i=f.a.zb(t);return i&&"number"!=typeof i.length?(f.a.c(t),{foreach:i.data,as:i.as,includeDestroyed:i.includeDestroyed,afterAdd:i.afterAdd,beforeRemove:i.beforeRemove,afterRender:i.afterRender,beforeMove:i.beforeMove,afterMove:i.afterMove,templateEngine:f.W.sb}):{foreach:t,templateEngine:f.W.sb}}},init:function(e,t){return f.d.template.init(e,f.d.foreach.ic(t))},update:function(e,t,i,r,n){return f.d.template.update(e,f.d.foreach.ic(t),i,r,n)}},f.h.ta.foreach=!1,f.f.Z.foreach=!0,f.d.hasfocus={init:function(e,t,i){function r(r){e.__ko_hasfocusUpdating=!0;var n=e.ownerDocument;if("activeElement"in n){var o;try{o=n.activeElement}catch(e){o=n.body}r=o===e}n=t(),f.h.Ea(n,i,"hasfocus",r,!0),e.__ko_hasfocusLastValue=r,e.__ko_hasfocusUpdating=!1}var n=r.bind(null,!0),o=r.bind(null,!1);f.a.p(e,"focus",n),f.a.p(e,"focusin",n),f.a.p(e,"blur",o),f.a.p(e,"focusout",o)},update:function(e,t){var i=!!f.a.c(t());e.__ko_hasfocusUpdating||e.__ko_hasfocusLastValue===i||(i?e.focus():e.blur(),!i&&e.__ko_hasfocusLastValue&&e.ownerDocument.body.focus(),f.l.w(f.a.Da,null,[e,i?"focusin":"focusout"]))}},f.h.ea.hasfocus=!0,f.d.hasFocus=f.d.hasfocus,f.h.ea.hasFocus=!0,f.d.html={init:function(){return{controlsDescendantBindings:!0}},update:function(e,t){f.a.Cb(e,t())}},m("if"),m("ifnot",!1,!0),m("with",!0,!1,function(e,t){return e.createChildContext(t)});var P={};f.d.options={init:function(e){if("select"!==f.a.A(e))throw Error("options binding applies only to SELECT elements");for(;0<e.length;)e.remove(0);return{controlsDescendantBindings:!0}},update:function(t,i,r){function n(){return f.a.Ka(t.options,function(e){return e.selected})}function o(e,t,i){var r=typeof t;return"function"==r?t(e):"string"==r?e[t]:i}function a(e,i){if(m&&c)f.j.ha(t,f.a.c(r.get("value")),!0);else if(p.length){var n=0<=f.a.o(p,f.j.u(i[0]));f.a.sc(i[0],n),m&&!n&&f.l.w(f.a.Da,null,[t,"change"])}}var s=t.multiple,l=0!=t.length&&s?t.scrollTop:null,u=f.a.c(i()),c=r.get("valueAllowUnset")&&r.has("value"),h=r.get("optionsIncludeDestroyed");i={};var d,p=[];c||(s?p=f.a.fb(n(),f.j.u):0<=t.selectedIndex&&p.push(f.j.u(t.options[t.selectedIndex]))),u&&("undefined"==typeof u.length&&(u=[u]),d=f.a.Ka(u,function(t){return h||t===e||null===t||!f.a.c(t._destroy)}),r.has("optionsCaption")&&(u=f.a.c(r.get("optionsCaption")),null!==u&&u!==e&&d.unshift(P)));var m=!1;i.beforeRemove=function(e){t.removeChild(e)},u=a,r.has("optionsAfterRender")&&"function"==typeof r.get("optionsAfterRender")&&(u=function(t,i){a(0,i),f.l.w(r.get("optionsAfterRender"),null,[i[0],t!==P?t:e])}),f.a.Bb(t,d,function(i,n,a){return a.length&&(p=!c&&a[0].selected?[f.j.u(a[0])]:[],m=!0),n=t.ownerDocument.createElement("option"),i===P?(f.a.Za(n,r.get("optionsCaption")),f.j.ha(n,e)):(a=o(i,r.get("optionsValue"),i),f.j.ha(n,f.a.c(a)),i=o(i,r.get("optionsText"),a),f.a.Za(n,i)),[n]},i,u),f.l.w(function(){c?f.j.ha(t,f.a.c(r.get("value")),!0):(s?p.length&&n().length<p.length:p.length&&0<=t.selectedIndex?f.j.u(t.options[t.selectedIndex])!==p[0]:p.length||0<=t.selectedIndex)&&f.a.Da(t,"change")}),f.a.Nc(t),l&&20<Math.abs(l-t.scrollTop)&&(t.scrollTop=l)}},f.d.options.xb=f.a.e.I(),f.d.selectedOptions={after:["options","foreach"],init:function(e,t,i){f.a.p(e,"change",function(){var r=t(),n=[];f.a.q(e.getElementsByTagName("option"),function(e){e.selected&&n.push(f.j.u(e))}),f.h.Ea(r,i,"selectedOptions",n)})},update:function(e,t){if("select"!=f.a.A(e))throw Error("values binding applies only to SELECT elements");var i=f.a.c(t()),r=e.scrollTop;i&&"number"==typeof i.length&&f.a.q(e.getElementsByTagName("option"),function(e){var t=0<=f.a.o(i,f.j.u(e));e.selected!=t&&f.a.sc(e,t)}),e.scrollTop=r}},f.h.ea.selectedOptions=!0,f.d.style={update:function(t,i){var r=f.a.c(i()||{});f.a.D(r,function(i,r){r=f.a.c(r),null!==r&&r!==e&&!1!==r||(r=""),t.style[i]=r})}},f.d.submit={init:function(e,t,i,r,n){if("function"!=typeof t())throw Error("The value for a submit binding must be a function");f.a.p(e,"submit",function(i){var r,o=t();try{r=o.call(n.$data,e)}finally{!0!==r&&(i.preventDefault?i.preventDefault():i.returnValue=!1)}})}},f.d.text={init:function(){return{controlsDescendantBindings:!0}},update:function(e,t){f.a.Za(e,t())}},f.f.Z.text=!0,function(){if(t&&t.navigator)var i=function(e){if(e)return parseFloat(e[1])},r=t.opera&&t.opera.version&&parseInt(t.opera.version()),n=t.navigator.userAgent,o=i(n.match(/^(?:(?!chrome).)*version\/([^ ]*) safari/i)),a=i(n.match(/Firefox\/([^ ]*)/));if(10>f.a.C)var s=f.a.e.I(),l=f.a.e.I(),u=function(e){var t=this.activeElement;(t=t&&f.a.e.get(t,l))&&t(e)},c=function(e,t){var i=e.ownerDocument;f.a.e.get(i,s)||(f.a.e.set(i,s,!0),f.a.p(i,"selectionchange",u)),f.a.e.set(e,l,t)};f.d.textInput={init:function(t,i,n){function s(e,i){f.a.p(t,e,i)}function l(){var r=f.a.c(i());null!==r&&r!==e||(r=""),p!==e&&r===p?f.a.setTimeout(l,4):t.value!==r&&(m=r,t.value=r)}function u(){d||(p=t.value,d=f.a.setTimeout(h,4))}function h(){clearTimeout(d),p=d=e;var r=t.value;m!==r&&(m=r,f.h.Ea(i(),n,"textInput",r))}var d,p,m=t.value,_=9==f.a.C?u:h;10>f.a.C?(s("propertychange",function(e){"value"===e.propertyName&&_(e)}),8==f.a.C&&(s("keyup",h),s("keydown",h)),8<=f.a.C&&(c(t,_),s("dragend",u))):(s("input",h),5>o&&"textarea"===f.a.A(t)?(s("keydown",u),s("paste",u),s("cut",u)):11>r?s("keydown",u):4>a&&(s("DOMAutoComplete",h),s("dragdrop",h),s("drop",h))),s("change",h),f.m(l,null,{i:t})}},f.h.ea.textInput=!0,f.d.textinput={preprocess:function(e,t,i){i("textInput",e)}}}(),f.d.uniqueName={init:function(e,t){if(t()){var i="ko_unique_"+ ++f.d.uniqueName.Ic;f.a.rc(e,i)}}},f.d.uniqueName.Ic=0,f.d.value={after:["options","foreach"],init:function(e,t,i){if("input"!=e.tagName.toLowerCase()||"checkbox"!=e.type&&"radio"!=e.type){var r=["change"],n=i.get("valueUpdate"),o=!1,a=null;n&&("string"==typeof n&&(n=[n]),f.a.ra(r,n),r=f.a.Tb(r));var s=function(){a=null,o=!1;var r=t(),n=f.j.u(e);f.h.Ea(r,i,"value",n)};!f.a.C||"input"!=e.tagName.toLowerCase()||"text"!=e.type||"off"==e.autocomplete||e.form&&"off"==e.form.autocomplete||-1!=f.a.o(r,"propertychange")||(f.a.p(e,"propertychange",function(){o=!0}),f.a.p(e,"focus",function(){o=!1}),f.a.p(e,"blur",function(){o&&s()})),f.a.q(r,function(t){var i=s;f.a.nd(t,"after")&&(i=function(){a=f.j.u(e),f.a.setTimeout(s,0)},t=t.substring(5)),f.a.p(e,t,i)});var l=function(){var r=f.a.c(t()),n=f.j.u(e);if(null!==a&&r===a)f.a.setTimeout(l,0);else if(r!==n)if("select"===f.a.A(e)){var o=i.get("valueAllowUnset"),n=function(){f.j.ha(e,r,o)};n(),o||r===f.j.u(e)?f.a.setTimeout(n,0):f.l.w(f.a.Da,null,[e,"change"])}else f.j.ha(e,r)};f.m(l,null,{i:e})}else f.Ja(e,{checkedValue:t})},update:function(){}},f.h.ea.value=!0,f.d.visible={update:function(e,t){var i=f.a.c(t()),r="none"!=e.style.display;i&&!r?e.style.display="":!i&&r&&(e.style.display="none")}},function(e){f.d[e]={init:function(t,i,r,n,o){return f.d.event.init.call(this,t,function(){var t={};return t[e]=i(),t},r,n,o)}}}("click"),f.O=function(){},f.O.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},f.O.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},f.O.prototype.makeTemplateSource=function(e,t){if("string"==typeof e){t=t||r;var i=t.getElementById(e);if(!i)throw Error("Cannot find template with ID "+e);return new f.v.n(i)}if(1==e.nodeType||8==e.nodeType)return new f.v.qa(e);throw Error("Unknown template type: "+e)},f.O.prototype.renderTemplate=function(e,t,i,r){return e=this.makeTemplateSource(e,r),this.renderTemplateSource(e,t,i,r)},f.O.prototype.isTemplateRewritten=function(e,t){return!1===this.allowTemplateRewriting||this.makeTemplateSource(e,t).data("isRewritten")},f.O.prototype.rewriteTemplate=function(e,t,i){e=this.makeTemplateSource(e,i),t=t(e.text()),e.text(t),e.data("isRewritten",!0)},f.b("templateEngine",f.O),f.Gb=function(){function e(e,t,i,r){e=f.h.yb(e);for(var n=f.h.ta,o=0;o<e.length;o++){var a=e[o].key;if(n.hasOwnProperty(a)){var s=n[a];if("function"==typeof s){if(a=s(e[o].value))throw Error(a)}else if(!s)throw Error("This template engine does not support the '"+a+"' binding within its templates")}}return i="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+f.h.Ua(e,{valueAccessors:!0})+" } })()},'"+i.toLowerCase()+"')",r.createJavaScriptEvaluatorBlock(i)+t}var t=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,i=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{Oc:function(e,t,i){t.isTemplateRewritten(e,i)||t.rewriteTemplate(e,function(e){return f.Gb.dd(e,t)},i)},dd:function(r,n){return r.replace(t,function(t,i,r,o,a){return e(a,i,r,n)}).replace(i,function(t,i){return e(i,"<!-- ko -->","#comment",n)})},Ec:function(e,t){return f.M.wb(function(i,r){var n=i.nextSibling;n&&n.nodeName.toLowerCase()===t&&f.Ja(n,e,r)})}}}(),f.b("__tr_ambtns",f.Gb.Ec),function(){f.v={},f.v.n=function(e){if(this.n=e){var t=f.a.A(e);this.ab="script"===t?1:"textarea"===t?2:"template"==t&&e.content&&11===e.content.nodeType?3:4}},f.v.n.prototype.text=function(){var e=1===this.ab?"text":2===this.ab?"value":"innerHTML";if(0==arguments.length)return this.n[e];var t=arguments[0];"innerHTML"===e?f.a.Cb(this.n,t):this.n[e]=t};var t=f.a.e.I()+"_";f.v.n.prototype.data=function(e){return 1===arguments.length?f.a.e.get(this.n,t+e):void f.a.e.set(this.n,t+e,arguments[1])};var i=f.a.e.I();f.v.n.prototype.nodes=function(){var t=this.n;return 0==arguments.length?(f.a.e.get(t,i)||{}).jb||(3===this.ab?t.content:4===this.ab?t:e):void f.a.e.set(t,i,{jb:arguments[0]})},f.v.qa=function(e){this.n=e},f.v.qa.prototype=new f.v.n,f.v.qa.prototype.text=function(){if(0==arguments.length){var t=f.a.e.get(this.n,i)||{};return t.Hb===e&&t.jb&&(t.Hb=t.jb.innerHTML),t.Hb}f.a.e.set(this.n,i,{Hb:arguments[0]})},f.b("templateSources",f.v),f.b("templateSources.domElement",f.v.n),f.b("templateSources.anonymousTemplate",f.v.qa)}(),function(){function t(e,t,i){var r;for(t=f.f.nextSibling(t);e&&(r=e)!==t;)e=f.f.nextSibling(r),i(r,e)}function i(e,i){if(e.length){var r=e[0],n=e[e.length-1],o=r.parentNode,a=f.Q.instance,s=a.preprocessNode;if(s){if(t(r,n,function(e,t){var i=e.previousSibling,o=s.call(a,e);o&&(e===r&&(r=o[0]||t),e===n&&(n=o[o.length-1]||i))}),e.length=0,!r)return;r===n?e.push(r):(e.push(r,n),f.a.za(e,o))}t(r,n,function(e){1!==e.nodeType&&8!==e.nodeType||f.Rb(i,e)}),t(r,n,function(e){1!==e.nodeType&&8!==e.nodeType||f.M.yc(e,[i])}),f.a.za(e,o)}}function r(e){return e.nodeType?e:0<e.length?e[0]:null}function n(e,t,n,o,s){s=s||{};var l=(e&&r(e)||n||{}).ownerDocument,u=s.templateEngine||a;if(f.Gb.Oc(n,u,l),n=u.renderTemplate(n,o,s,l),"number"!=typeof n.length||0<n.length&&"number"!=typeof n[0].nodeType)throw Error("Template engine must return an array of DOM nodes");switch(l=!1,t){case"replaceChildren":f.f.da(e,n),l=!0;break;case"replaceNode":f.a.qc(e,n),l=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+t)}return l&&(i(n,o),s.afterRender&&f.l.w(s.afterRender,null,[n,o.$data])),n}function o(e,t,i){return f.H(e)?e():"function"==typeof e?e(t,i):e}var a;f.Db=function(t){if(t!=e&&!(t instanceof f.O))throw Error("templateEngine must inherit from ko.templateEngine");a=t},f.Ab=function(t,i,s,l,u){if(s=s||{},(s.templateEngine||a)==e)throw Error("Set a template engine before calling renderTemplate");if(u=u||"replaceChildren",l){var c=r(l);return f.B(function(){var e=i&&i instanceof f.U?i:new f.U(f.a.c(i)),a=o(t,e.$data,e),e=n(l,u,a,e,s);"replaceNode"==u&&(l=e,c=r(l))},null,{wa:function(){return!c||!f.a.nb(c)},i:c&&"replaceNode"==u?c.parentNode:c})}return f.M.wb(function(e){f.Ab(t,i,s,e,"replaceNode")})},f.kd=function(t,r,a,s,l){function u(e,t){i(t,h),a.afterRender&&a.afterRender(t,e),h=null}function c(e,i){h=l.createChildContext(e,a.as,function(e){e.$index=i});var r=o(t,e,h);return n(null,"ignoreTargetNode",r,h,a)}var h;return f.B(function(){var t=f.a.c(r)||[];"undefined"==typeof t.length&&(t=[t]),t=f.a.Ka(t,function(t){return a.includeDestroyed||t===e||null===t||!f.a.c(t._destroy)}),f.l.w(f.a.Bb,null,[s,t,c,a,u])},null,{i:s})};var s=f.a.e.I();f.d.template={init:function(e,t){var i=f.a.c(t());if("string"==typeof i||i.name)f.f.xa(e);else{if("nodes"in i){if(i=i.nodes||[],f.H(i))throw Error('The "nodes" option must be a plain, non-observable array.')}else i=f.f.childNodes(e);i=f.a.jc(i),new f.v.qa(e).nodes(i)}return{controlsDescendantBindings:!0}},update:function(t,i,r,n,o){var a,l=i();i=f.a.c(l),r=!0,n=null,"string"==typeof i?i={}:(l=i.name,"if"in i&&(r=f.a.c(i.if)),r&&"ifnot"in i&&(r=!f.a.c(i.ifnot)),a=f.a.c(i.data)),"foreach"in i?n=f.kd(l||t,r&&i.foreach||[],i,t,o):r?(o="data"in i?o.createChildContext(a,i.as):o,n=f.Ab(l||t,o,i,t)):f.f.xa(t),o=n,(a=f.a.e.get(t,s))&&"function"==typeof a.k&&a.k(),f.a.e.set(t,s,o&&o.ba()?o:e)}},f.h.ta.template=function(e){return e=f.h.yb(e),1==e.length&&e[0].unknown||f.h.ad(e,"name")?null:"This template engine does not support anonymous templates nested within its templates"},f.f.Z.template=!0}(),f.b("setTemplateEngine",f.Db),f.b("renderTemplate",f.Ab),f.a.dc=function(e,t,i){if(e.length&&t.length){var r,n,o,a,s;for(r=n=0;(!i||r<i)&&(a=e[n]);++n){for(o=0;s=t[o];++o)if(a.value===s.value){a.moved=s.index,s.moved=a.index,t.splice(o,1),r=o=0;break}r+=o}}},f.a.ib=function(){function e(e,t,i,r,n){var o,a,s,l,u,c=Math.min,h=Math.max,d=[],p=e.length,m=t.length,_=m-p||1,g=p+m+1;for(o=0;o<=p;o++)for(l=s,d.push(s=[]),u=c(m,o+_),a=h(0,o-1);a<=u;a++)s[a]=a?o?e[o-1]===t[a-1]?l[a-1]:c(l[a]||g,s[a-1]||g)+1:a+1:o+1;for(c=[],h=[],_=[],o=p,a=m;o||a;)m=d[o][a]-1,a&&m===d[o][a-1]?h.push(c[c.length]={status:i,value:t[--a],index:a}):o&&m===d[o-1][a]?_.push(c[c.length]={status:r,value:e[--o],index:o}):(--a,--o,n.sparse||c.push({status:"retained",value:t[a]}));return f.a.dc(_,h,!n.dontLimitMoves&&10*p),c.reverse()}return function(t,i,r){return r="boolean"==typeof r?{dontLimitMoves:r}:r||{},t=t||[],i=i||[],t.length<i.length?e(t,i,"added","deleted",r):e(i,t,"deleted","added",r)}}(),f.b("utils.compareArrays",f.a.ib),function(){function t(t,i,r,n,o){var a=[],s=f.B(function(){var e=i(r,o,f.a.za(a,t))||[];0<a.length&&(f.a.qc(a,e),n&&f.l.w(n,null,[r,e,o])),a.length=0,f.a.ra(a,e)},null,{i:t,wa:function(){return!f.a.Qb(a)}});return{ca:a,B:s.ba()?s:e}}var i=f.a.e.I(),r=f.a.e.I();f.a.Bb=function(n,o,a,s,l){function u(e,t){w=d[t],v!==t&&(b[e]=w),w.qb(v++),f.a.za(w.ca,n),_.push(w),C.push(w)}function c(e,t){if(e)for(var i=0,r=t.length;i<r;i++)t[i]&&f.a.q(t[i].ca,function(r){e(r,i,t[i].ja)})}o=o||[],s=s||{};var h=f.a.e.get(n,i)===e,d=f.a.e.get(n,i)||[],p=f.a.fb(d,function(e){return e.ja}),m=f.a.ib(p,o,s.dontLimitMoves),_=[],g=0,v=0,y=[],C=[];o=[];for(var w,S,E,b=[],p=[],T=0;S=m[T];T++)switch(E=S.moved,S.status){case"deleted":E===e&&(w=d[g],w.B&&(w.B.k(),w.B=e),f.a.za(w.ca,n).length&&(s.beforeRemove&&(_.push(w),C.push(w),w.ja===r?w=null:o[T]=w),w&&y.push.apply(y,w.ca))),g++;break;case"retained":u(T,g++);break;case"added":E!==e?u(T,E):(w={ja:S.value,qb:f.N(v++)},_.push(w),C.push(w),h||(p[T]=w))}f.a.e.set(n,i,_),c(s.beforeMove,b),f.a.q(y,s.beforeRemove?f.$:f.removeNode);for(var x,T=0,h=f.f.firstChild(n);w=C[T];T++){for(w.ca||f.a.extend(w,t(n,a,w.ja,l,w.qb)),g=0;m=w.ca[g];h=m.nextSibling,x=m,g++)m!==h&&f.f.gc(n,m,x);!w.Wc&&l&&(l(w.ja,w.ca,w.qb),w.Wc=!0)}for(c(s.beforeRemove,o),T=0;T<o.length;++T)o[T]&&(o[T].ja=r);c(s.afterMove,b),c(s.afterAdd,p)}}(),f.b("utils.setDomNodeChildrenFromArrayMapping",f.a.Bb),f.W=function(){this.allowTemplateRewriting=!1},f.W.prototype=new f.O,f.W.prototype.renderTemplateSource=function(e,t,i,r){return(t=(9>f.a.C?0:e.nodes)?e.nodes():null)?f.a.V(t.cloneNode(!0).childNodes):(e=e.text(),f.a.ma(e,r))},f.W.sb=new f.W,f.Db(f.W.sb),f.b("nativeTemplateEngine",f.W),function(){f.vb=function(){var e=this.$c=function(){if(!o||!o.tmpl)return 0;try{if(0<=o.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch(e){}return 1}();this.renderTemplateSource=function(t,i,n,a){if(a=a||r,n=n||{},2>e)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var s=t.data("precompiled");return s||(s=t.text()||"",s=o.template(null,"{{ko_with $item.koBindingContext}}"+s+"{{/ko_with}}"),t.data("precompiled",s)),t=[i.$data],i=o.extend({koBindingContext:i},n.templateOptions),i=o.tmpl(s,t,i),i.appendTo(a.createElement("div")),o.fragments={},i},this.createJavaScriptEvaluatorBlock=function(e){return"{{ko_code ((function() { return "+e+" })()) }}"},this.addTemplate=function(e,t){r.write("<script type='text/html' id='"+e+"'>"+t+"</script>")},0<e&&(o.tmpl.tag.ko_code={open:"__.push($1 || '');"},o.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},f.vb.prototype=new f.O;var e=new f.vb;0<e.$c&&f.Db(e),f.b("jqueryTmplTemplateEngine",f.vb)}()})}()}(),i("ThirdParty/knockout-es5",[],function(){"use strict";function e(e,i){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,o=t(e,!0);return i=i||Object.getOwnPropertyNames(e),i.forEach(function(t){if(t!==h&&t!==d&&!(t in o)){var i=e[t],a=i instanceof Array,s=n.isObservable(i)?i:a?n.observableArray(i):n.observable(i);Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:s,set:n.isWriteableObservable(s)?s:void 0}),o[t]=s,a&&r(n,s)}}),e}function t(e,t){var i=e[h];return!i&&t&&(i={},Object.defineProperty(e,h,{value:i})),i}function i(t,i,r){var n=this,o={owner:t,deferEvaluation:!0};if("function"==typeof r)o.read=r;else{if("value"in r)throw new Error('For ko.defineProperty, you must not specify a "value" for the property. You must provide a "get" function.');if("function"!=typeof r.get)throw new Error('For ko.defineProperty, the third parameter must be either an evaluator function, or an options object containing a function called "get".');o.read=r.get,o.write=r.set}return t[i]=n.computed(o),e.call(n,t,[i]),t}function r(e,t){var i=null;e.computed(function(){i&&(i.dispose(),i=null);var r=t();r instanceof Array&&(i=n(e,t,r))})}function n(e,t,i){var r=o(e,i);return r.subscribe(t)}function o(e,t){var i=t[d];if(!i){i=new e.subscribable,Object.defineProperty(t,d,{value:i});var r={};a(t,i,r),s(e,t,i,r)}return i}function a(e,t,i){["pop","push","reverse","shift","sort","splice","unshift"].forEach(function(r){var n=e[r];e[r]=function(){var e=n.apply(this,arguments);return i.pause!==!0&&t.notifySubscribers(this),e}})}function s(e,t,i,r){["remove","removeAll","destroy","destroyAll","replace"].forEach(function(n){Object.defineProperty(t,n,{enumerable:!1,value:function(){var o;r.pause=!0;try{o=e.observableArray.fn[n].apply(e.observableArray(t),arguments)}finally{r.pause=!1}return i.notifySubscribers(t),o}})})}function l(e,i){if(!e)return null;var r=t(e,!1);return r&&r[i]||null}function u(e,t){var i=l(e,t);i&&i.valueHasMutated()}function c(t){t.track=e,t.getObservable=l,t.valueHasMutated=u,t.defineProperty=i}var h="__knockoutObservables",d="__knockoutSubscribable";return{attachToKo:c}}),i("Widgets/SvgPathBindingHandler",[],function(){"use strict";var e="http://www.w3.org/2000/svg",t="cesium-svgPath-svg",i={register:function(i){i.bindingHandlers.cesiumSvgPath={init:function(r,n){var o=document.createElementNS(e,"svg:svg");o.setAttribute("class",t);var a=document.createElementNS(e,"path");return o.appendChild(a),i.virtualElements.setDomNodeChildren(r,[o]),i.computed({read:function(){var e=i.unwrap(n());a.setAttribute("d",i.unwrap(e.path));var r=i.unwrap(e.width),s=i.unwrap(e.height);o.setAttribute("width",r),o.setAttribute("height",s),o.setAttribute("viewBox","0 0 "+r+" "+s),e.css&&o.setAttribute("class",t+" "+i.unwrap(e.css))},disposeWhenNodeIsRemoved:r}),{controlsDescendantBindings:!0}}},i.virtualElements.allowedBindings.cesiumSvgPath=!0}};return i}),i("ThirdParty/knockout",["./knockout-3.4.0","./knockout-es5","../Widgets/SvgPathBindingHandler"],function(e,t,i){"use strict";return t.attachToKo(e),i.register(e),e}),i("ThirdParty/NoSleep",[],function(){"use strict";function e(e,t,i){var r=document.createElement("source");r.src=i,r.type="video/"+t,e.appendChild(r)}var t={Android:"undefined"!=typeof navigator&&/Android/gi.test(navigator.userAgent),iOS:"undefined"!=typeof navigator&&/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent)},i={WebM:"data:video/webm;base64,GkXfo0AgQoaBAUL3gQFC8oEEQvOBCEKCQAR3ZWJtQoeBAkKFgQIYU4BnQI0VSalmQCgq17FAAw9CQE2AQAZ3aGFtbXlXQUAGd2hhbW15RIlACECPQAAAAAAAFlSua0AxrkAu14EBY8WBAZyBACK1nEADdW5khkAFVl9WUDglhohAA1ZQOIOBAeBABrCBCLqBCB9DtnVAIueBAKNAHIEAAIAwAQCdASoIAAgAAUAmJaQAA3AA/vz0AAA=",MP4:"data:video/mp4;base64,AAAAHGZ0eXBpc29tAAACAGlzb21pc28ybXA0MQAAAAhmcmVlAAAAG21kYXQAAAGzABAHAAABthADAowdbb9/AAAC6W1vb3YAAABsbXZoZAAAAAB8JbCAfCWwgAAAA+gAAAAAAAEAAAEAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAIVdHJhawAAAFx0a2hkAAAAD3wlsIB8JbCAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAIAAAACAAAAAABsW1kaWEAAAAgbWRoZAAAAAB8JbCAfCWwgAAAA+gAAAAAVcQAAAAAAC1oZGxyAAAAAAAAAAB2aWRlAAAAAAAAAAAAAAAAVmlkZW9IYW5kbGVyAAAAAVxtaW5mAAAAFHZtaGQAAAABAAAAAAAAAAAAAAAkZGluZgAAABxkcmVmAAAAAAAAAAEAAAAMdXJsIAAAAAEAAAEcc3RibAAAALhzdHNkAAAAAAAAAAEAAACobXA0dgAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAIAAgASAAAAEgAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABj//wAAAFJlc2RzAAAAAANEAAEABDwgEQAAAAADDUAAAAAABS0AAAGwAQAAAbWJEwAAAQAAAAEgAMSNiB9FAEQBFGMAAAGyTGF2YzUyLjg3LjQGAQIAAAAYc3R0cwAAAAAAAAABAAAAAQAAAAAAAAAcc3RzYwAAAAAAAAABAAAAAQAAAAEAAAABAAAAFHN0c3oAAAAAAAAAEwAAAAEAAAAUc3RjbwAAAAAAAAABAAAALAAAAGB1ZHRhAAAAWG1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAAK2lsc3QAAAAjqXRvbwAAABtkYXRhAAAAAQAAAABMYXZmNTIuNzguMw=="},r=function(){return t.iOS?this.noSleepTimer=null:t.Android&&(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("loop",""),e(this.noSleepVideo,"webm",i.WebM),e(this.noSleepVideo,"mp4",i.MP4)),this};return r.prototype.enable=function(e){t.iOS?(this.disable(),this.noSleepTimer=window.setInterval(function(){window.location=window.location,window.setTimeout(window.stop,0)},e||15e3)):t.Android&&this.noSleepVideo.play()},r.prototype.disable=function(){t.iOS?this.noSleepTimer&&(window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):t.Android&&this.noSleepVideo.pause()},r}),i("Widgets/subscribeAndEvaluate",["../ThirdParty/knockout"],function(e){"use strict";function t(t,i,r,n,o){return r.call(n,t[i]),e.getObservable(t,i).subscribe(r,n,o)}return t}),i("Widgets/Animation/Animation",["../../Core/Color","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../getElement","../subscribeAndEvaluate"],function(e,t,i,r,n,o,a){ -"use strict";function s(t){return e.fromCssColorString(window.getComputedStyle(t).getPropertyValue("color"))}function l(e){var t=document.createElementNS(v,e.tagName);for(var i in e)if(e.hasOwnProperty(i)&&"tagName"!==i)if("children"===i){var r,n=e.children.length;for(r=0;r<n;++r)t.appendChild(l(e.children[r]))}else 0===i.indexOf("xlink:")?t.setAttributeNS(y,i.substring(6),e[i]):"textContent"===i?t.textContent=e[i]:t.setAttribute(i,e[i]);return t}function u(e,t,i){var r=document.createElementNS(v,"text");r.setAttribute("x",e),r.setAttribute("y",t),r.setAttribute("class","cesium-animation-svgText");var n=document.createElementNS(v,"tspan");return n.textContent=i,r.appendChild(n),r}function c(e,t,i){e.setAttribute("transform","translate(100,100) rotate("+i+")"),t.setAttribute("transform","rotate("+i+")")}function h(e,t){var i=t.alpha,r=1-i;return P.red=e.red*r+t.red*i,P.green=e.green*r+t.green*i,P.blue=e.blue*r+t.blue*i,P.toCssColorString()}function d(e,t,i){var r={tagName:"g",class:"cesium-animation-rectButton",transform:"translate("+e+","+t+")",children:[{tagName:"rect",class:"cesium-animation-buttonGlow",width:32,height:32,rx:2,ry:2},{tagName:"rect",class:"cesium-animation-buttonMain",width:32,height:32,rx:4,ry:4},{tagName:"use",class:"cesium-animation-buttonPath","xlink:href":i},{tagName:"title",textContent:""}]};return l(r)}function p(e,t,i){var r={tagName:"g",class:"cesium-animation-rectButton",transform:"translate("+e+","+t+")",children:[{tagName:"use",class:"cesium-animation-buttonGlow","xlink:href":"#animation_pathWingButton"},{tagName:"use",class:"cesium-animation-buttonMain","xlink:href":"#animation_pathWingButton"},{tagName:"use",class:"cesium-animation-buttonPath","xlink:href":i},{tagName:"title",textContent:""}]};return l(r)}function m(e,t){var i=e._viewModel,r=i.shuttleRingDragging;if(!r||g===e)if("mousedown"===t.type||r&&"mousemove"===t.type||"touchstart"===t.type&&1===t.touches.length||r&&"touchmove"===t.type&&1===t.touches.length){var n,o,a=e._centerX,s=e._centerY,l=e._svgNode,u=l.getBoundingClientRect();if("touchstart"===t.type||"touchmove"===t.type?(n=t.touches[0].clientX,o=t.touches[0].clientY):(n=t.clientX,o=t.clientY),!r&&(n>u.right||n<u.left||o<u.top||o>u.bottom))return;var c=e._shuttleRingPointer.getBoundingClientRect(),h=n-a-u.left,d=o-s-u.top,p=180*Math.atan2(d,h)/Math.PI+90;p>180&&(p-=360);var m=i.shuttleRingAngle;r||n<c.right&&n>c.left&&o>c.top&&o<c.bottom?(g=e,i.shuttleRingDragging=!0,i.shuttleRingAngle=p):p<m?i.slower():p>m&&i.faster(),t.preventDefault()}else e===g&&(g=void 0),i.shuttleRingDragging=!1}function f(e,t){this._viewModel=t,this.svgElement=e,this._enabled=void 0,this._toggled=void 0;var i=this;this._clickFunction=function(){var e=i._viewModel.command;e.canExecute&&e()},e.addEventListener("click",this._clickFunction,!0),this._subscriptions=[a(t,"toggled",this.setToggled,this),a(t,"tooltip",this.setTooltip,this),a(t.command,"canExecute",this.setEnabled,this)]}function _(e,t){function i(e){m(x,e)}e=o(e),this._viewModel=t,this._container=e,this._centerX=0,this._centerY=0,this._defsElement=void 0,this._svgNode=void 0,this._topG=void 0,this._lastHeight=void 0,this._lastWidth=void 0;var r=document.createElement("style");r.textContent=".cesium-animation-rectButton .cesium-animation-buttonGlow { filter: url(#animation_blurred); }.cesium-animation-rectButton .cesium-animation-buttonMain { fill: url(#animation_buttonNormal); }.cesium-animation-buttonToggled .cesium-animation-buttonMain { fill: url(#animation_buttonToggled); }.cesium-animation-rectButton:hover .cesium-animation-buttonMain { fill: url(#animation_buttonHovered); }.cesium-animation-buttonDisabled .cesium-animation-buttonMain { fill: url(#animation_buttonDisabled); }.cesium-animation-shuttleRingG .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshGradient); }.cesium-animation-shuttleRingG:hover .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshHovered); }.cesium-animation-shuttleRingPointer { fill: url(#animation_shuttleRingPointerGradient); }.cesium-animation-shuttleRingPausePointer { fill: url(#animation_shuttleRingPointerPaused); }.cesium-animation-knobOuter { fill: url(#animation_knobOuter); }.cesium-animation-knobInner { fill: url(#animation_knobInner); }",document.head.insertBefore(r,document.head.childNodes[0]);var n=document.createElement("div");n.className="cesium-animation-theme",n.innerHTML='<div class="cesium-animation-themeNormal"></div><div class="cesium-animation-themeHover"></div><div class="cesium-animation-themeSelect"></div><div class="cesium-animation-themeDisabled"></div><div class="cesium-animation-themeKnob"></div><div class="cesium-animation-themePointer"></div><div class="cesium-animation-themeSwoosh"></div><div class="cesium-animation-themeSwooshHover"></div>',this._theme=n,this._themeNormal=n.childNodes[0],this._themeHover=n.childNodes[1],this._themeSelect=n.childNodes[2],this._themeDisabled=n.childNodes[3],this._themeKnob=n.childNodes[4],this._themePointer=n.childNodes[5],this._themeSwoosh=n.childNodes[6],this._themeSwooshHover=n.childNodes[7];var s=document.createElementNS(v,"svg:svg");this._svgNode=s,s.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",y);var h=document.createElementNS(v,"g");this._topG=h,this._realtimeSVG=new f(p(3,4,"#animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new f(d(44,99,"#animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new f(d(124,99,"#animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new f(d(84,99,"#animation_pathPause"),t.pauseViewModel);var _=document.createElementNS(v,"g");_.appendChild(this._realtimeSVG.svgElement),_.appendChild(this._playReverseSVG.svgElement),_.appendChild(this._playForwardSVG.svgElement),_.appendChild(this._pauseSVG.svgElement);var g=l({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=g;var C=l({tagName:"g",class:"cesium-animation-shuttleRingSwoosh",children:[{tagName:"use",transform:"translate(100,97) scale(-1,1)","xlink:href":"#animation_pathSwooshFX"},{tagName:"use",transform:"translate(100,97)","xlink:href":"#animation_pathSwooshFX"},{tagName:"line",x1:100,y1:8,x2:100,y2:22}]});this._shuttleRingSwooshG=C,this._shuttleRingPointer=l({tagName:"use",class:"cesium-animation-shuttleRingPointer","xlink:href":"#animation_pathPointer"});var w=l({tagName:"g",transform:"translate(100,100)"});this._knobOuter=l({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});var S=61,E=l({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:S});this._knobDate=u(0,-24,""),this._knobTime=u(0,-7,""),this._knobStatus=u(0,-41,"");var b=l({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:S}),T=document.createElementNS(v,"g");T.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(n),h.appendChild(T),h.appendChild(w),h.appendChild(_),T.appendChild(g),T.appendChild(C),T.appendChild(this._shuttleRingPointer),w.appendChild(this._knobOuter),w.appendChild(E),w.appendChild(this._knobDate),w.appendChild(this._knobTime),w.appendChild(this._knobStatus),w.appendChild(b),s.appendChild(h),e.appendChild(s);var x=this;this._mouseCallback=i,g.addEventListener("mousedown",i,!0),g.addEventListener("touchstart",i,!0),C.addEventListener("mousedown",i,!0),C.addEventListener("touchstart",i,!0),document.addEventListener("mousemove",i,!0),document.addEventListener("touchmove",i,!0),document.addEventListener("mouseup",i,!0),document.addEventListener("touchend",i,!0),document.addEventListener("touchcancel",i,!0),this._shuttleRingPointer.addEventListener("mousedown",i,!0),this._shuttleRingPointer.addEventListener("touchstart",i,!0),this._knobOuter.addEventListener("mousedown",i,!0),this._knobOuter.addEventListener("touchstart",i,!0);var A,P=this._knobTime.childNodes[0],D=this._knobDate.childNodes[0],M=this._knobStatus.childNodes[0];this._subscriptions=[a(t.pauseViewModel,"toggled",function(e){A!==e&&(A=e,A?x._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):x._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),a(t,"shuttleRingAngle",function(e){c(x._shuttleRingPointer,x._knobOuter,e)}),a(t,"dateLabel",function(e){D.textContent!==e&&(D.textContent=e)}),a(t,"timeLabel",function(e){P.textContent!==e&&(P.textContent=e)}),a(t,"multiplierLabel",function(e){M.textContent!==e&&(M.textContent=e)})],this.applyThemeChanges(),this.resize()}var g,v="http://www.w3.org/2000/svg",y="http://www.w3.org/1999/xlink",C=e.fromCssColorString("rgba(247,250,255,0.384)"),w=e.fromCssColorString("rgba(143,191,255,0.216)"),S=e.fromCssColorString("rgba(153,197,255,0.098)"),E=e.fromCssColorString("rgba(255,255,255,0.086)"),b=e.fromCssColorString("rgba(255,255,255,0.267)"),T=e.fromCssColorString("rgba(255,255,255,0)"),x=e.fromCssColorString("rgba(66,67,68,0.3)"),A=e.fromCssColorString("rgba(0,0,0,0.5)"),P=new e;return f.prototype.destroy=function(){this.svgElement.removeEventListener("click",this._clickFunction,!0);for(var e=this._subscriptions,t=0,i=e.length;t<i;t++)e[t].dispose();r(this)},f.prototype.isDestroyed=function(){return!1},f.prototype.setEnabled=function(e){if(this._enabled!==e){if(this._enabled=e,!e)return void this.svgElement.setAttribute("class","cesium-animation-buttonDisabled");if(this._toggled)return void this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled");this.svgElement.setAttribute("class","cesium-animation-rectButton")}},f.prototype.setToggled=function(e){this._toggled!==e&&(this._toggled=e,this._enabled&&(e?this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled"):this.svgElement.setAttribute("class","cesium-animation-rectButton")))},f.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e},i(_.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),_.prototype.isDestroyed=function(){return!1},_.prototype.destroy=function(){var e=this._mouseCallback;this._shuttleRingBackPanel.removeEventListener("mousedown",e,!0),this._shuttleRingBackPanel.removeEventListener("touchstart",e,!0),this._shuttleRingSwooshG.removeEventListener("mousedown",e,!0),this._shuttleRingSwooshG.removeEventListener("touchstart",e,!0),document.removeEventListener("mousemove",e,!0),document.removeEventListener("touchmove",e,!0),document.removeEventListener("mouseup",e,!0),document.removeEventListener("touchend",e,!0),document.removeEventListener("touchcancel",e,!0),this._shuttleRingPointer.removeEventListener("mousedown",e,!0),this._shuttleRingPointer.removeEventListener("touchstart",e,!0),this._knobOuter.removeEventListener("mousedown",e,!0),this._knobOuter.removeEventListener("touchstart",e,!0),this._container.removeChild(this._svgNode),this._container.removeChild(this._theme),this._realtimeSVG.destroy(),this._playReverseSVG.destroy(),this._playForwardSVG.destroy(),this._pauseSVG.destroy();for(var t=this._subscriptions,i=0,n=t.length;i<n;i++)t[i].dispose();return r(this)},_.prototype.resize=function(){var e=this._container.clientWidth,t=this._container.clientHeight;if(e!==this._lastWidth||t!==this._lastHeight){var i=this._svgNode,r=200,n=132,o=e,a=t;0===e&&0===t?(o=r,a=n):0===e?(a=t,o=r*(t/n)):0===t&&(o=e,a=n*(e/r));var s=o/r,l=a/n;i.style.cssText="width: "+o+"px; height: "+a+"px; position: absolute; bottom: 0; left: 0; overflow: hidden;",i.setAttribute("width",o),i.setAttribute("height",a),i.setAttribute("viewBox","0 0 "+o+" "+a),this._topG.setAttribute("transform","scale("+s+","+l+")"),this._centerX=Math.max(1,100*s),this._centerY=Math.max(1,100*l),this._lastHeight=e,this._lastWidth=t}},_.prototype.applyThemeChanges=function(){var e=s(this._themeNormal),i=s(this._themeHover),r=s(this._themeSelect),n=s(this._themeDisabled),o=s(this._themeKnob),a=s(this._themePointer),u=s(this._themeSwoosh),c=s(this._themeSwooshHover),d=l({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":h(e,C)},{tagName:"stop",offset:"12%","stop-color":h(e,w)},{tagName:"stop",offset:"46%","stop-color":h(e,S)},{tagName:"stop",offset:"81%","stop-color":h(e,E)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":h(i,C)},{tagName:"stop",offset:"12%","stop-color":h(i,w)},{tagName:"stop",offset:"46%","stop-color":h(i,S)},{tagName:"stop",offset:"81%","stop-color":h(i,E)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":h(r,C)},{tagName:"stop",offset:"12%","stop-color":h(r,w)},{tagName:"stop",offset:"46%","stop-color":h(r,S)},{tagName:"stop",offset:"81%","stop-color":h(r,E)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":h(n,b)},{tagName:"stop",offset:"75%","stop-color":h(n,T)}]},{id:"animation_blurred",tagName:"filter",width:"200%",height:"200%",x:"-50%",y:"-50%",children:[{tagName:"feGaussianBlur",stdDeviation:4,in:"SourceGraphic"}]},{id:"animation_shuttleRingSwooshGradient",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":u.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":u.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":u.toCssColorString()}]},{id:"animation_shuttleRingSwooshHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":c.toCssColorString()}]},{id:"animation_shuttleRingPointerGradient",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":a.toCssColorString()},{tagName:"stop",offset:"40%","stop-color":a.toCssColorString()},{tagName:"stop",offset:"60%","stop-color":h(a,A)},{tagName:"stop",offset:"100%","stop-color":h(a,A)}]},{id:"animation_shuttleRingPointerPaused",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":"#CCC"},{tagName:"stop",offset:"40%","stop-color":"#CCC"},{tagName:"stop",offset:"60%","stop-color":"#555"},{tagName:"stop",offset:"100%","stop-color":"#555"}]},{id:"animation_knobOuter",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":h(o,C)},{tagName:"stop",offset:"60%","stop-color":h(o,x)},{tagName:"stop",offset:"85%","stop-color":h(o,w)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":h(o,x)},{tagName:"stop",offset:"60%","stop-color":h(o,C)},{tagName:"stop",offset:"85%","stop-color":h(o,E)}]},{id:"animation_pathReset",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.316,5.318,9.833,13.682,9.833,5.5,5.5,5.5,5.5,25.5,9.833,25.5,9.833,17.318,24.316,25.682z"},{id:"animation_pathPause",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M13,5.5,7.5,5.5,7.5,25.5,13,25.5zM24.5,5.5,19,5.5,19,25.5,24.5,25.5z"},{id:"animation_pathPlay",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},{id:"animation_pathPlayReverse",tagName:"path",transform:"translate(16,16) scale(-0.85,0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},{id:"animation_pathLoop",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.249,15.499c-0.009,4.832-3.918,8.741-8.75,8.75c-2.515,0-4.768-1.064-6.365-2.763l2.068-1.442l-7.901-3.703l0.744,8.694l2.193-1.529c2.244,2.594,5.562,4.242,9.26,4.242c6.767,0,12.249-5.482,12.249-12.249H24.249zM15.499,6.75c2.516,0,4.769,1.065,6.367,2.764l-2.068,1.443l7.901,3.701l-0.746-8.693l-2.192,1.529c-2.245-2.594-5.562-4.245-9.262-4.245C8.734,3.25,3.25,8.734,3.249,15.499H6.75C6.758,10.668,10.668,6.758,15.499,6.75z"},{id:"animation_pathClock",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-15.5)",d:"M15.5,2.374C8.251,2.375,2.376,8.251,2.374,15.5C2.376,22.748,8.251,28.623,15.5,28.627c7.249-0.004,13.124-5.879,13.125-13.127C28.624,8.251,22.749,2.375,15.5,2.374zM15.5,25.623C9.909,25.615,5.385,21.09,5.375,15.5C5.385,9.909,9.909,5.384,15.5,5.374c5.59,0.01,10.115,4.535,10.124,10.125C25.615,21.09,21.091,25.615,15.5,25.623zM8.625,15.5c-0.001-0.552-0.448-0.999-1.001-1c-0.553,0-1,0.448-1,1c0,0.553,0.449,1,1,1C8.176,16.5,8.624,16.053,8.625,15.5zM8.179,18.572c-0.478,0.277-0.642,0.889-0.365,1.367c0.275,0.479,0.889,0.641,1.365,0.365c0.479-0.275,0.643-0.887,0.367-1.367C9.27,18.461,8.658,18.297,8.179,18.572zM9.18,10.696c-0.479-0.276-1.09-0.112-1.366,0.366s-0.111,1.09,0.365,1.366c0.479,0.276,1.09,0.113,1.367-0.366C9.821,11.584,9.657,10.973,9.18,10.696zM22.822,12.428c0.478-0.275,0.643-0.888,0.366-1.366c-0.275-0.478-0.89-0.642-1.366-0.366c-0.479,0.278-0.642,0.89-0.366,1.367C21.732,12.54,22.344,12.705,22.822,12.428zM12.062,21.455c-0.478-0.275-1.089-0.111-1.366,0.367c-0.275,0.479-0.111,1.09,0.366,1.365c0.478,0.277,1.091,0.111,1.365-0.365C12.704,22.344,12.54,21.732,12.062,21.455zM12.062,9.545c0.479-0.276,0.642-0.888,0.366-1.366c-0.276-0.478-0.888-0.642-1.366-0.366s-0.642,0.888-0.366,1.366C10.973,9.658,11.584,9.822,12.062,9.545zM22.823,18.572c-0.48-0.275-1.092-0.111-1.367,0.365c-0.275,0.479-0.112,1.092,0.367,1.367c0.477,0.275,1.089,0.113,1.365-0.365C23.464,19.461,23.3,18.848,22.823,18.572zM19.938,7.813c-0.477-0.276-1.091-0.111-1.365,0.366c-0.275,0.48-0.111,1.091,0.366,1.367s1.089,0.112,1.366-0.366C20.581,8.702,20.418,8.089,19.938,7.813zM23.378,14.5c-0.554,0.002-1.001,0.45-1.001,1c0.001,0.552,0.448,1,1.001,1c0.551,0,1-0.447,1-1C24.378,14.949,23.929,14.5,23.378,14.5zM15.501,6.624c-0.552,0-1,0.448-1,1l-0.466,7.343l-3.004,1.96c-0.478,0.277-0.642,0.889-0.365,1.365c0.275,0.479,0.889,0.643,1.365,0.367l3.305-1.676C15.39,16.99,15.444,17,15.501,17c0.828,0,1.5-0.671,1.5-1.5l-0.5-7.876C16.501,7.072,16.053,6.624,15.501,6.624zM15.501,22.377c-0.552,0-1,0.447-1,1s0.448,1,1,1s1-0.447,1-1S16.053,22.377,15.501,22.377zM18.939,21.455c-0.479,0.277-0.643,0.889-0.366,1.367c0.275,0.477,0.888,0.643,1.366,0.365c0.478-0.275,0.642-0.889,0.366-1.365C20.028,21.344,19.417,21.18,18.939,21.455z"},{id:"animation_pathWingButton",tagName:"path",d:"m 4.5,0.5 c -2.216,0 -4,1.784 -4,4 l 0,24 c 0,2.216 1.784,4 4,4 l 13.71875,0 C 22.478584,27.272785 27.273681,22.511272 32.5,18.25 l 0,-13.75 c 0,-2.216 -1.784,-4 -4,-4 l -24,0 z"},{id:"animation_pathPointer",tagName:"path",d:"M-15,-65,-15,-55,15,-55,15,-65,0,-95z"},{id:"animation_pathSwooshFX",tagName:"path",d:"m 85,0 c 0,16.617 -4.813944,35.356 -13.131081,48.4508 h 6.099803 c 8.317138,-13.0948 13.13322,-28.5955 13.13322,-45.2124 0,-46.94483 -38.402714,-85.00262 -85.7743869,-85.00262 -1.0218522,0 -2.0373001,0.0241 -3.0506131,0.0589 45.958443,1.59437 82.723058,35.77285 82.723058,81.70532 z"}]});t(this._defsElement)?this._svgNode.replaceChild(d,this._defsElement):this._svgNode.appendChild(d),this._defsElement=d},_}),i("Widgets/createCommand",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../ThirdParty/knockout"],function(e,t,i,r,n,o){"use strict";function a(t,r){function a(){var e,i={args:arguments,cancel:!1};return s.raiseEvent(i),i.cancel||(e=t.apply(null,arguments),l.raiseEvent(e)),e}r=e(r,!0);var s=new n,l=new n;return a.canExecute=r,o.track(a,["canExecute"]),i(a,{beforeExecute:{value:s},afterExecute:{value:l}}),a}return a}),i("Widgets/ToggleButtonViewModel",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../ThirdParty/knockout"],function(e,t,i,r,n){"use strict";function o(t,i){this._command=t,i=e(i,e.EMPTY_OBJECT),this.toggled=e(i.toggled,!1),this.tooltip=e(i.tooltip,""),n.track(this,["toggled","tooltip"])}return i(o.prototype,{command:{get:function(){return this._command}}}),o}),i("Widgets/Animation/AnimationViewModel",["../../Core/binarySearch","../../Core/ClockRange","../../Core/ClockStep","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/JulianDate","../../ThirdParty/knockout","../../ThirdParty/sprintf","../createCommand","../ToggleButtonViewModel"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(e,t){return e-t}function d(t,i){var r=e(i,t,h);return r<0?~r:r}function p(e,t){if(Math.abs(e)<=g)return e/g;var i,r,n=g,o=v,a=0;return e>0?(i=Math.log(t[t.length-1]),r=(i-a)/(o-n),Math.exp(a+r*(e-n))):(i=Math.log(-t[0]),r=(i-a)/(o-n),-Math.exp(a+r*(Math.abs(e)-n)))}function m(e,t,r){if(r.clockStep===i.SYSTEM_CLOCK)return g;if(Math.abs(e)<=1)return e*g;var n=t[t.length-1];e>n?e=n:e<-n&&(e=-n);var o,a,s=g,l=v,u=0;return e>0?(o=Math.log(n),a=(o-u)/(l-s),(Math.log(e)-u)/a+s):(o=Math.log(-t[0]),a=(o-u)/(l-s),-((Math.log(Math.abs(e))-u)/a+s))}function f(e){var r=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=f.defaultDateFormatter,this._timeFormatter=f.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,s.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(f.defaultTicks),this.timeLabel=void 0,s.defineProperty(this,"timeLabel",function(){return r._timeFormatter(r._clockViewModel.currentTime,r)}),this.dateLabel=void 0,s.defineProperty(this,"dateLabel",function(){return r._dateFormatter(r._clockViewModel.currentTime,r)}),this.multiplierLabel=void 0,s.defineProperty(this,"multiplierLabel",function(){var e=r._clockViewModel;if(e.clockStep===i.SYSTEM_CLOCK)return"Today";var t=e.multiplier;return t%1===0?t.toFixed(0)+"x":t.toFixed(3).replace(/0{0,3}$/,"")+"x"}),this.shuttleRingAngle=void 0,s.defineProperty(this,"shuttleRingAngle",{get:function(){return m(e.multiplier,r._allShuttleRingTicks,e)},set:function(e){e=Math.max(Math.min(e,v),-v);var t=r._allShuttleRingTicks,n=r._clockViewModel;if(n.clockStep=i.SYSTEM_CLOCK_MULTIPLIER,Math.abs(e)===v)return void(n.multiplier=e>0?t[t.length-1]:t[0]);var o=p(e,t);if(r.snapToTicks)o=t[d(o,t)];else if(0!==o){var a=Math.abs(o);if(a>100){var s=a.toFixed(0).length-2,l=Math.pow(10,s);o=Math.round(o/l)*l|0}else a>g?o=Math.round(o):a>1?o=+o.toFixed(1):a>0&&(o=+o.toFixed(2))}n.multiplier=o}}),this._canAnimate=void 0,s.defineProperty(this,"_canAnimate",function(){var e=r._clockViewModel,i=e.clockRange;if(r.shuttleRingDragging||i===t.UNBOUNDED)return!0;var n=e.multiplier,o=e.currentTime,s=e.startTime,l=!1;if(i===t.LOOP_STOP)l=a.greaterThan(o,s)||o.equals(s)&&n>0;else{var u=e.stopTime;l=a.greaterThan(o,s)&&a.lessThan(o,u)||o.equals(s)&&n>0||o.equals(u)&&n<0}return l||(e.shouldAnimate=!1),l}),this._isSystemTimeAvailable=void 0,s.defineProperty(this,"_isSystemTimeAvailable",function(){var e=r._clockViewModel,i=e.clockRange;if(i===t.UNBOUNDED)return!0;var n=e.systemTime;return a.greaterThanOrEquals(n,e.startTime)&&a.lessThanOrEquals(n,e.stopTime)}),this._isAnimating=void 0,s.defineProperty(this,"_isAnimating",function(){return r._clockViewModel.shouldAnimate&&(r._canAnimate||r.shuttleRingDragging)});var n=u(function(){var e=r._clockViewModel;e.shouldAnimate?e.shouldAnimate=!1:r._canAnimate&&(e.shouldAnimate=!0)});this._pauseViewModel=new c(n,{toggled:s.computed(function(){return!r._isAnimating}),tooltip:"Pause"});var o=u(function(){var e=r._clockViewModel,t=e.multiplier;t>0&&(e.multiplier=-t),e.shouldAnimate=!0});this._playReverseViewModel=new c(o,{toggled:s.computed(function(){return r._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});var l=u(function(){var e=r._clockViewModel,t=e.multiplier;t<0&&(e.multiplier=-t),e.shouldAnimate=!0});this._playForwardViewModel=new c(l,{toggled:s.computed(function(){return r._isAnimating&&e.multiplier>0&&e.clockStep!==i.SYSTEM_CLOCK}),tooltip:"Play Forward"});var h=u(function(){r._clockViewModel.clockStep=i.SYSTEM_CLOCK},s.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new c(h,{toggled:s.computed(function(){return e.clockStep===i.SYSTEM_CLOCK}),tooltip:s.computed(function(){return r._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=u(function(){var e=r._clockViewModel,t=r._allShuttleRingTicks,i=e.multiplier,n=d(i,t)-1;n>=0&&(e.multiplier=t[n])}),this._faster=u(function(){var e=r._clockViewModel,t=r._allShuttleRingTicks,i=e.multiplier,n=d(i,t)+1;n<t.length&&(e.multiplier=t[n])})}var _=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],g=15,v=105;return f.defaultDateFormatter=function(e,t){var i=a.toGregorianDate(e);return _[i.month-1]+" "+i.day+" "+i.year},f.defaultTicks=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800],f.defaultTimeFormatter=function(e,t){var i=a.toGregorianDate(e),r=Math.round(i.millisecond);return Math.abs(t._clockViewModel.multiplier)<1?l("%02d:%02d:%02d.%03d",i.hour,i.minute,i.second,r):l("%02d:%02d:%02d UTC",i.hour,i.minute,i.second)},f.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)},f.prototype.setShuttleRingTicks=function(e){var t,i,r,n={},o=this._sortedFilteredPositiveTicks;for(o.length=0,t=0,i=e.length;t<i;++t)r=e[t],n.hasOwnProperty(r)||(n[r]=!0,o.push(r));o.sort(h);var a=[];for(i=o.length,t=i-1;t>=0;--t)r=o[t],0!==r&&a.push(-r);Array.prototype.push.apply(a,o),this._allShuttleRingTicks=a},n(f.prototype,{slower:{get:function(){return this._slower}},faster:{get:function(){return this._faster}},clockViewModel:{get:function(){return this._clockViewModel}},pauseViewModel:{get:function(){return this._pauseViewModel}},playReverseViewModel:{get:function(){return this._playReverseViewModel}},playForwardViewModel:{get:function(){return this._playForwardViewModel}},playRealtimeViewModel:{get:function(){return this._playRealtimeViewModel}},dateFormatter:{get:function(){return this._dateFormatter},set:function(e){this._dateFormatter=e}},timeFormatter:{get:function(){return this._timeFormatter},set:function(e){this._timeFormatter=e}}}),f._maxShuttleRingAngle=v,f._realtimeShuttleRingAngle=g,f}),i("Widgets/BaseLayerPicker/BaseLayerPickerViewModel",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/EllipsoidTerrainProvider","../../Core/isArray","../../ThirdParty/knockout","../createCommand"],function(e,t,i,r,n,o,a,s){"use strict";function l(i){i=e(i,e.EMPTY_OBJECT);var r=i.globe,l=e(i.imageryProviderViewModels,[]),u=e(i.terrainProviderViewModels,[]);this._globe=r,this.imageryProviderViewModels=l.slice(0),this.terrainProviderViewModels=u.slice(0),this.dropDownVisible=!1,a.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]),this.buttonTooltip=void 0,a.defineProperty(this,"buttonTooltip",function(){var e=this.selectedImagery,i=this.selectedTerrain,r=t(e)?e.name:void 0,n=t(i)?i.name:void 0;return t(r)&&t(n)?r+"\n"+n:t(r)?r:n}),this.buttonImageUrl=void 0,a.defineProperty(this,"buttonImageUrl",function(){var e=this.selectedImagery;return t(e)?e.iconUrl:void 0}),this.selectedImagery=void 0;var c=a.observable();this._currentImageryProviders=[],a.defineProperty(this,"selectedImagery",{get:function(){return c()},set:function(e){if(c()===e)return void(this.dropDownVisible=!1);var i,r=this._currentImageryProviders,n=r.length,a=this._globe.imageryLayers;for(i=0;i<n;i++)for(var s=a.length,l=0;l<s;l++){var u=a.get(l);if(u.imageryProvider===r[i]){a.remove(u);break}}if(t(e)){var h=e.creationCommand();if(o(h)){var d=h.length;for(i=d-1;i>=0;i--)a.addImageryProvider(h[i],0);this._currentImageryProviders=h.slice(0)}else this._currentImageryProviders=[h],a.addImageryProvider(h,0)}c(e),this.dropDownVisible=!1}}),this.selectedTerrain=void 0;var h=a.observable();a.defineProperty(this,"selectedTerrain",{get:function(){return h()},set:function(e){if(h()===e)return void(this.dropDownVisible=!1);var i;t(e)&&(i=e.creationCommand()),this._globe.depthTestAgainstTerrain=!(i instanceof n),this._globe.terrainProvider=i,h(e),this.dropDownVisible=!1}});var d=this;this._toggleDropDown=s(function(){d.dropDownVisible=!d.dropDownVisible}),this.selectedImagery=e(i.selectedImageryProviderViewModel,l[0]),this.selectedTerrain=e(i.selectedTerrainProviderViewModel,u[0])}return i(l.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}}),l}),i("Widgets/BaseLayerPicker/BaseLayerPicker",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/FeatureDetection","../../ThirdParty/knockout","../getElement","./BaseLayerPickerViewModel"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,t){e=a(e);var i=new s(t),r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button",r.setAttribute("data-bind","attr: { title: buttonTooltip },click: toggleDropDown"),e.appendChild(r);var l=document.createElement("img");l.setAttribute("draggable","false"),l.className="cesium-baseLayerPicker-selected",l.setAttribute("data-bind","attr: { src: buttonImageUrl }"),r.appendChild(l);var u=document.createElement("div");u.className="cesium-baseLayerPicker-dropDown",u.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-dropDown-visible" : dropDownVisible }'),e.appendChild(u);var c=document.createElement("div");c.className="cesium-baseLayerPicker-sectionTitle",c.setAttribute("data-bind","visible: imageryProviderViewModels.length > 0"),c.innerHTML="Imagery",u.appendChild(c);var h=document.createElement("div");h.className="cesium-baseLayerPicker-choices",h.setAttribute("data-bind","foreach: imageryProviderViewModels"),u.appendChild(h);var d=document.createElement("div");d.className="cesium-baseLayerPicker-item",d.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parent.selectedImagery },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parent.selectedImagery = $data; }'),h.appendChild(d);var p=document.createElement("img");p.className="cesium-baseLayerPicker-itemIcon",p.setAttribute("data-bind","attr: { src: iconUrl }"),p.setAttribute("draggable","false"),d.appendChild(p);var m=document.createElement("div");m.className="cesium-baseLayerPicker-itemLabel",m.setAttribute("data-bind","text: name"),d.appendChild(m);var f=document.createElement("div");f.className="cesium-baseLayerPicker-sectionTitle",f.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),f.innerHTML="Terrain",u.appendChild(f);var _=document.createElement("div");_.className="cesium-baseLayerPicker-choices",_.setAttribute("data-bind","foreach: terrainProviderViewModels"),u.appendChild(_);var g=document.createElement("div");g.className="cesium-baseLayerPicker-item",g.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parent.selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parent.selectedTerrain = $data; }'),_.appendChild(g);var v=document.createElement("img");v.className="cesium-baseLayerPicker-itemIcon",v.setAttribute("data-bind","attr: { src: iconUrl }"),v.setAttribute("draggable","false"),g.appendChild(v);var y=document.createElement("div");y.className="cesium-baseLayerPicker-itemLabel",y.setAttribute("data-bind","text: name"),g.appendChild(y),o.applyBindings(i,r),o.applyBindings(i,u),this._viewModel=i,this._container=e,this._element=r,this._dropPanel=u,this._closeDropDown=function(e){r.contains(e.target)||u.contains(e.target)||(i.dropDownVisible=!1); -},n.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}return t(l.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return n.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),o.cleanNode(this._element),o.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),i(this)},l}),i("Widgets/BaseLayerPicker/ProviderViewModel",["../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../ThirdParty/knockout","../createCommand"],function(e,t,i,r,n){"use strict";function o(t){var i=t.creationFunction;e(i.canExecute)||(i=n(i)),this._creationCommand=i,this.name=t.name,this.tooltip=t.tooltip,this.iconUrl=t.iconUrl,r.track(this,["name","tooltip","iconUrl"])}return t(o.prototype,{creationCommand:{get:function(){return this._creationCommand}}}),o}),i("Widgets/BaseLayerPicker/createDefaultImageryProviderViewModels",["../../Core/buildModuleUrl","../../Scene/ArcGisMapServerImageryProvider","../../Scene/BingMapsImageryProvider","../../Scene/BingMapsStyle","../../Scene/createOpenStreetMapImageryProvider","../../Scene/createTileMapServiceImageryProvider","../../Scene/MapboxImageryProvider","../BaseLayerPicker/ProviderViewModel"],function(e,t,i,r,n,o,a,s){"use strict";function l(){var l=[];return l.push(new s({name:"Bing Maps Aerial",iconUrl:e("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery \nhttp://www.bing.com/maps",creationFunction:function(){return new i({url:"https://dev.virtualearth.net",mapStyle:r.AERIAL})}})),l.push(new s({name:"Bing Maps Aerial with Labels",iconUrl:e("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with label overlays \nhttp://www.bing.com/maps",creationFunction:function(){return new i({url:"https://dev.virtualearth.net",mapStyle:r.AERIAL_WITH_LABELS})}})),l.push(new s({name:"Bing Maps Roads",iconUrl:e("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps\nhttp://www.bing.com/maps",creationFunction:function(){return new i({url:"https://dev.virtualearth.net",mapStyle:r.ROAD})}})),l.push(new s({name:"Mapbox Satellite",tooltip:"Mapbox satellite imagery https://www.mapbox.com/maps/",iconUrl:e("Widgets/Images/ImageryProviders/mapboxSatellite.png"),creationFunction:function(){return new a({mapId:"mapbox.satellite"})}})),l.push(new s({name:"Mapbox Streets",tooltip:"Mapbox streets imagery https://www.mapbox.com/maps/",iconUrl:e("Widgets/Images/ImageryProviders/mapboxTerrain.png"),creationFunction:function(){return new a({mapId:"mapbox.streets"})}})),l.push(new s({name:"Mapbox Streets Classic",tooltip:"Mapbox streets basic imagery https://www.mapbox.com/maps/",iconUrl:e("Widgets/Images/ImageryProviders/mapboxStreets.png"),creationFunction:function(){return new a({mapId:"mapbox.streets-basic"})}})),l.push(new s({name:"ESRI World Imagery",iconUrl:e("Widgets/Images/ImageryProviders/esriWorldImagery.png"),tooltip:"World Imagery provides one meter or better satellite and aerial imagery in many parts of the world and lower resolution satellite imagery worldwide. The map includes NASA Blue Marble: Next Generation 500m resolution imagery at small scales (above 1:1,000,000), i-cubed 15m eSAT imagery at medium-to-large scales (down to 1:70,000) for the world, and USGS 15m Landsat imagery for Antarctica. The map features 0.3m resolution imagery in the continental United States and 0.6m resolution imagery in parts of Western Europe from DigitalGlobe. In other parts of the world, 1 meter resolution imagery is available from GeoEye IKONOS, i-cubed Nationwide Prime, Getmapping, AeroGRID, IGN Spain, and IGP Portugal. Additionally, imagery at different resolutions has been contributed by the GIS User Community.\nhttp://www.esri.com",creationFunction:function(){return new t({url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",enablePickFeatures:!1})}})),l.push(new s({name:"ESRI World Street Map",iconUrl:e("Widgets/Images/ImageryProviders/esriWorldStreetMap.png"),tooltip:"This worldwide street map presents highway-level data for the world. Street-level data includes the United States; much of Canada; Japan; most countries in Europe; Australia and New Zealand; India; parts of South America including Argentina, Brazil, Chile, Colombia, and Venezuela; Ghana; and parts of southern Africa including Botswana, Lesotho, Namibia, South Africa, and Swaziland.\nhttp://www.esri.com",creationFunction:function(){return new t({url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer",enablePickFeatures:!1})}})),l.push(new s({name:"ESRI National Geographic",iconUrl:e("Widgets/Images/ImageryProviders/esriNationalGeographic.png"),tooltip:"This web map contains the National Geographic World Map service. This map service is designed to be used as a general reference map for informational and educational purposes as well as a basemap by GIS professionals and other users for creating web maps and web mapping applications.\nhttp://www.esri.com",creationFunction:function(){return new t({url:"https://services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/",enablePickFeatures:!1})}})),l.push(new s({name:"Open­Street­Map",iconUrl:e("Widgets/Images/ImageryProviders/openStreetMap.png"),tooltip:"OpenStreetMap (OSM) is a collaborative project to create a free editable map of the world.\nhttp://www.openstreetmap.org",creationFunction:function(){return n({url:"https://a.tile.openstreetmap.org/"})}})),l.push(new s({name:"Stamen Watercolor",iconUrl:e("Widgets/Images/ImageryProviders/stamenWatercolor.png"),tooltip:"Reminiscent of hand drawn maps, Stamen watercolor maps apply raster effect area washes and organic edges over a paper texture to add warm pop to any map.\nhttp://maps.stamen.com",creationFunction:function(){return n({url:"https://stamen-tiles.a.ssl.fastly.net/watercolor/",credit:"Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA."})}})),l.push(new s({name:"Stamen Toner",iconUrl:e("Widgets/Images/ImageryProviders/stamenToner.png"),tooltip:"A high contrast black and white map.\nhttp://maps.stamen.com",creationFunction:function(){return n({url:"https://stamen-tiles.a.ssl.fastly.net/toner/",credit:"Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA."})}})),l.push(new s({name:"The Black Marble",iconUrl:e("Widgets/Images/ImageryProviders/blackMarble.png"),tooltip:"The lights of cities and villages trace the outlines of civilization in this global view of the Earth at night as seen by NASA/NOAA's Suomi NPP satellite.",creationFunction:function(){return o({url:"https://cesiumjs.org/blackmarble",flipXY:!0,credit:"Black Marble imagery courtesy NASA Earth Observatory"})}})),l.push(new s({name:"Natural Earth II",iconUrl:e("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:"Natural Earth II, darkened for contrast.\nhttp://www.naturalearthdata.com/",creationFunction:function(){return o({url:e("Assets/Textures/NaturalEarthII")})}})),l}return l}),i("Widgets/BaseLayerPicker/createDefaultTerrainProviderViewModels",["../../Core/buildModuleUrl","../../Core/CesiumTerrainProvider","../../Core/EllipsoidTerrainProvider","../BaseLayerPicker/ProviderViewModel"],function(e,t,i,r){"use strict";function n(){var n=[];return n.push(new r({name:"WGS84 Ellipsoid",iconUrl:e("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",creationFunction:function(){return new i}})),n.push(new r({name:"STK World Terrain meshes",iconUrl:e("Widgets/Images/TerrainProviders/STK.png"),tooltip:"High-resolution, mesh-based terrain for the entire globe. Free for use on the Internet. Closed-network options are available.\nhttp://www.agi.com",creationFunction:function(){return new t({url:"https://assets.agi.com/stk-terrain/world",requestWaterMask:!0,requestVertexNormals:!0})}})),n}return n}),i("Widgets/CesiumInspector/CesiumInspectorViewModel",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/Rectangle","../../Core/ScreenSpaceEventHandler","../../Core/ScreenSpaceEventType","../../Scene/DebugModelMatrixPrimitive","../../Scene/PerformanceDisplay","../../Scene/TileCoordinatesImageryProvider","../../ThirdParty/knockout","../createCommand"],function(e,t,i,r,n,o,a,s,l,u,c,h){"use strict";function d(t){var i;if(e(t)){i="Command Statistics";var r=t.commandsInFrustums;for(var n in r)if(r.hasOwnProperty(n)){var o,a=parseInt(n,10);if(7===a)o="1, 2 and 3";else{for(var s=[],l=2;l>=0;l--){var u=Math.pow(2,l);a>=u&&(s.push(l+1),a-=u)}o=s.reverse().join(" and ")}i+="<br>    "+r[n]+" in frustum "+o}i+="<br>Total: "+t.totalCommands}return i}function p(e,t,i){var r=Math.min(i,t);return r=Math.max(r,e)}function m(t,i){function r(t){_.removeInputAction(a.LEFT_CLICK),m.pickPrimitiveActive=!1;var i=m._scene.pick({x:t.position.x,y:t.position.y});e(i)&&(m.primitive=e(i.collection)?i.collection:i.primitive)}function d(t){var i,r=g.ellipsoid,o=m._scene.camera.pickEllipsoid({x:t.position.x,y:t.position.y},r);if(e(o))for(var s=r.cartesianToCartographic(o),l=g._surface.tileProvider._tilesToRenderByTextureCount,u=0;!i&&u<l.length;++u){var c=l[u];if(e(c))for(var h=0;!i&&h<c.length;++h){var d=c[h];n.contains(d.rectangle,s)&&(i=d)}}m.tile=i,_.removeInputAction(a.LEFT_CLICK),m.pickTileActive=!1}var m=this,f=t.canvas,_=new o(f);this._eventHandler=_,this._scene=t,this._canvas=f,this._primitive=void 0,this._tile=void 0,this._modelMatrixPrimitive=void 0,this._performanceDisplay=void 0,this._performanceContainer=i;var g=this._scene.globe;g.depthTestAgainstTerrain=!0,this.frustums=!1,this.performance=!1,this.shaderCacheText="",this.primitiveBoundingSphere=!1,this.primitiveReferenceFrame=!1,this.filterPrimitive=!1,this.tileBoundingSphere=!1,this.filterTile=!1,this.wireframe=!1,this.globeDepth=!1,this.pickDepth=!1,this.depthFrustum=1,this._numberOfFrustums=1,this.depthFrustumText="1 of 1",this.suspendUpdates=!1,this.tileCoordinates=!1,this.frustumStatisticText="",this.tileText="",this.hasPickedPrimitive=!1,this.hasPickedTile=!1,this.pickPimitiveActive=!1,this.pickTileActive=!1,this.dropDownVisible=!0,this.generalVisible=!0,this.primitivesVisible=!1,this.terrainVisible=!1,this.generalSwitchText="-",this.primitivesSwitchText="+",this.terrainSwitchText="+",c.track(this,["filterTile","suspendUpdates","dropDownVisible","shaderCacheText","frustums","frustumStatisticText","pickTileActive","pickPrimitiveActive","hasPickedPrimitive","hasPickedTile","tileText","generalVisible","generalSwitchText","primitivesVisible","primitivesSwitchText","terrainVisible","terrainSwitchText","depthFrustumText"]),this._toggleDropDown=h(function(){m.dropDownVisible=!m.dropDownVisible}),this._toggleGeneral=h(function(){m.generalVisible=!m.generalVisible,m.generalSwitchText=m.generalVisible?"-":"+"}),this._togglePrimitives=h(function(){m.primitivesVisible=!m.primitivesVisible,m.primitivesSwitchText=m.primitivesVisible?"-":"+"}),this._toggleTerrain=h(function(){m.terrainVisible=!m.terrainVisible,m.terrainSwitchText=m.terrainVisible?"-":"+"}),this._showFrustums=h(function(){return m.frustums?m._scene.debugShowFrustums=!0:m._scene.debugShowFrustums=!1,!0}),this._showPerformance=h(function(){return m.performance?m._performanceDisplay=new l({container:m._performanceContainer}):m._performanceContainer.innerHTML="",!0}),this._showPrimitiveBoundingSphere=h(function(){return m._primitive.debugShowBoundingVolume=m.primitiveBoundingSphere,!0}),this._showPrimitiveReferenceFrame=h(function(){if(m.primitiveReferenceFrame){var t=m._primitive.modelMatrix;m._modelMatrixPrimitive=new s({modelMatrix:t}),m._scene.primitives.add(m._modelMatrixPrimitive)}else e(m._modelMatrixPrimitive)&&(m._scene.primitives.remove(m._modelMatrixPrimitive),m._modelMatrixPrimitive=void 0);return!0}),this._doFilterPrimitive=h(function(){return m.filterPrimitive?m._scene.debugCommandFilter=function(t){return!(!e(m._modelMatrixPrimitive)||t.owner!==m._modelMatrixPrimitive._primitive)||!!e(m._primitive)&&(t.owner===m._primitive||t.owner===m._primitive._billboardCollection||t.owner.primitive===m._primitive)}:m._scene.debugCommandFilter=void 0,!0}),this._showWireframe=h(function(){return g._surface.tileProvider._debug.wireframe=m.wireframe,!0}),this._showGlobeDepth=h(function(){return m._scene.debugShowGlobeDepth=m.globeDepth,!0}),this._showPickDepth=h(function(){return m._scene.debugShowPickDepth=m.pickDepth,!0}),this._incrementDepthFrustum=h(function(){var e=m.depthFrustum+1;return m.depthFrustum=p(1,m._numberOfFrustums,e),m.scene.debugShowDepthFrustum=m.depthFrustum,!0}),this._decrementDepthFrustum=h(function(){var e=m.depthFrustum-1;return m.depthFrustum=p(1,m._numberOfFrustums,e),m.scene.debugShowDepthFrustum=m.depthFrustum,!0}),this._doSuspendUpdates=h(function(){return g._surface._debug.suspendLodUpdate=m.suspendUpdates,m.suspendUpdates||(m.filterTile=!1),!0});var v;this._showTileCoordinates=h(function(){return m.tileCoordinates&&!e(v)?v=t.imageryLayers.addImageryProvider(new u({tilingScheme:t.terrainProvider.tilingScheme})):!m.tileCoordinates&&e(v)&&(t.imageryLayers.remove(v),v=void 0),!0}),this._showTileBoundingSphere=h(function(){return m.tileBoundingSphere?g._surface.tileProvider._debug.boundingSphereTile=m._tile:g._surface.tileProvider._debug.boundingSphereTile=void 0,!0}),this._doFilterTile=h(function(){return m.filterTile?(m.suspendUpdates=!0,m.doSuspendUpdates(),g._surface._tilesToRender=[],e(m._tile)&&g._surface._tilesToRender.push(m._tile)):(m.suspendUpdates=!1,m.doSuspendUpdates()),!0}),this._pickPrimitive=h(function(){m.pickPrimitiveActive=!m.pickPrimitiveActive,m.pickPrimitiveActive?_.setInputAction(r,a.LEFT_CLICK):_.removeInputAction(a.LEFT_CLICK)}),this._pickTile=h(function(){m.pickTileActive=!m.pickTileActive,m.pickTileActive?_.setInputAction(d,a.LEFT_CLICK):_.removeInputAction(a.LEFT_CLICK)})}return t(m.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},toggleDropDown:{get:function(){return this._toggleDropDown}},showFrustums:{get:function(){return this._showFrustums}},showPerformance:{get:function(){return this._showPerformance}},showPrimitiveBoundingSphere:{get:function(){return this._showPrimitiveBoundingSphere}},showPrimitiveReferenceFrame:{get:function(){return this._showPrimitiveReferenceFrame}},doFilterPrimitive:{get:function(){return this._doFilterPrimitive}},showWireframe:{get:function(){return this._showWireframe}},showGlobeDepth:{get:function(){return this._showGlobeDepth}},showPickDepth:{get:function(){return this._showPickDepth}},incrementDepthFrustum:{get:function(){return this._incrementDepthFrustum}},decrementDepthFrustum:{get:function(){return this._decrementDepthFrustum}},doSuspendUpdates:{get:function(){return this._doSuspendUpdates}},showTileCoordinates:{get:function(){return this._showTileCoordinates}},showTileBoundingSphere:{get:function(){return this._showTileBoundingSphere}},doFilterTile:{get:function(){return this._doFilterTile}},toggleGeneral:{get:function(){return this._toggleGeneral}},togglePrimitives:{get:function(){return this._togglePrimitives}},toggleTerrain:{get:function(){return this._toggleTerrain}},pickPrimitive:{get:function(){return this._pickPrimitive}},pickTile:{get:function(){return this._pickTile}},selectParent:{get:function(){var e=this;return h(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){var e=this;return h(function(){e.tile=e.tile.northwestChild})}},selectNE:{get:function(){var e=this;return h(function(){e.tile=e.tile.northeastChild})}},selectSW:{get:function(){var e=this;return h(function(){e.tile=e.tile.southwestChild})}},selectSE:{get:function(){var e=this;return h(function(){e.tile=e.tile.southeastChild})}},primitive:{set:function(t){var i=this._primitive;t!==i&&(this.hasPickedPrimitive=!0,e(i)&&(i.debugShowBoundingVolume=!1),this._scene.debugCommandFilter=void 0,e(this._modelMatrixPrimitive)&&(this._scene.primitives.remove(this._modelMatrixPrimitive),this._modelMatrixPrimitive=void 0),this._primitive=t,t.show=!1,setTimeout(function(){t.show=!0},50),this.showPrimitiveBoundingSphere(),this.showPrimitiveReferenceFrame(),this.doFilterPrimitive())},get:function(){return this._primitive}},tile:{set:function(t){if(e(t)){this.hasPickedTile=!0;var i=this._tile;t!==i&&(this.tileText="L: "+t.level+" X: "+t.x+" Y: "+t.y,this.tileText+="<br>SW corner: "+t.rectangle.west+", "+t.rectangle.south,this.tileText+="<br>NE corner: "+t.rectangle.east+", "+t.rectangle.north,this.tileText+="<br>Min: "+t.data.minimumHeight+" Max: "+t.data.maximumHeight),this._tile=t,this.showTileBoundingSphere(),this.doFilterTile()}else this.hasPickedTile=!1,this._tile=void 0},get:function(){return this._tile}},update:{get:function(){var e=this;return function(){e.frustums&&(e.frustumStatisticText=d(e._scene.debugFrustumStatistics));var t=e._scene.numberOfFrustums;e._numberOfFrustums=t;var i=p(1,t,e.depthFrustum);e.depthFrustum=i,e.scene.debugShowDepthFrustum=i,e.depthFrustumText=i+" of "+t,e.performance&&e._performanceDisplay.update(),e.primitiveReferenceFrame&&(e._modelMatrixPrimitive.modelMatrix=e._primitive.modelMatrix),e.shaderCacheText="Cached shaders: "+e._scene.context.shaderCache.numberOfShaders}}}}),m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){return this._eventHandler.destroy(),i(this)},m}),i("Widgets/CesiumInspector/CesiumInspector",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./CesiumInspectorViewModel"],function(e,t,i,r,n,o,a){"use strict";function s(e,t){e=o(e);var i=document.createElement("div"),r=new a(t,i);this._viewModel=r,this._container=e;var s=document.createElement("div");this._element=s;var l=document.createElement("div");l.textContent="Cesium Inspector",l.className="cesium-cesiumInspector-button",l.setAttribute("data-bind","click: toggleDropDown"),s.appendChild(l),s.className="cesium-cesiumInspector",s.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : dropDownVisible, "cesium-cesiumInspector-hidden" : !dropDownVisible }'),e.appendChild(this._element);var u=document.createElement("div");this._panel=u,u.className="cesium-cesiumInspector-dropDown",s.appendChild(u);var c=document.createElement("div");c.className="cesium-cesiumInspector-sectionHeader";var h=document.createElement("span");h.className="cesium-cesiumInspector-toggleSwitch",h.setAttribute("data-bind","click: toggleGeneral, text: generalSwitchText"),c.appendChild(h),c.appendChild(document.createTextNode("General")),u.appendChild(c);var d=document.createElement("div");d.className="cesium-cesiumInspector-section",d.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : generalVisible, "cesium-cesiumInspector-hide" : !generalVisible}'),u.appendChild(d);var p=document.createElement("div");d.appendChild(p);var m=document.createElement("div");m.className="cesium-cesiumInspector-frustumStats",m.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : frustums, "cesium-cesiumInspector-hide" : !frustums}, html: frustumStatisticText');var f=document.createElement("input");f.type="checkbox",f.setAttribute("data-bind","checked: frustums, click: showFrustums"),p.appendChild(f),p.appendChild(document.createTextNode("Show Frustums")),p.appendChild(m);var _=document.createElement("div");d.appendChild(_);var g=document.createElement("input");g.type="checkbox",g.setAttribute("data-bind","checked: performance, click: showPerformance"),_.appendChild(g),_.appendChild(document.createTextNode("Performance Display")),i.className="cesium-cesiumInspector-performanceDisplay",d.appendChild(i);var v=document.createElement("div");v.className="cesium-cesiumInspector-shaderCache",v.setAttribute("data-bind","html: shaderCacheText"),d.appendChild(v);var y=document.createElement("div");d.appendChild(y);var C=document.createElement("input");C.type="checkbox",C.setAttribute("data-bind","checked: globeDepth, click: showGlobeDepth"),y.appendChild(C),y.appendChild(document.createTextNode("Show globe depth"));var w=document.createElement("div");y.appendChild(w);var S=document.createElement("div");d.appendChild(S);var E=document.createElement("input");E.type="checkbox",E.setAttribute("data-bind","checked: pickDepth, click: showPickDepth"),S.appendChild(E),S.appendChild(document.createTextNode("Show pick depth"));var b=document.createElement("div");d.appendChild(b);var T=document.createElement("span");T.setAttribute("data-bind",'html: "     Frustum:"'),b.appendChild(T);var x=document.createElement("span");x.setAttribute("data-bind","text: depthFrustumText"),b.appendChild(x);var A=document.createElement("input");A.type="button",A.value="-",A.className="cesium-cesiumInspector-pickButton",A.setAttribute("data-bind","click: decrementDepthFrustum"),b.appendChild(A);var P=document.createElement("input");P.type="button",P.value="+",P.className="cesium-cesiumInspector-pickButton",P.setAttribute("data-bind","click: incrementDepthFrustum"),b.appendChild(P);var D=document.createElement("div");D.className="cesium-cesiumInspector-sectionHeader",h=document.createElement("span"),h.className="cesium-cesiumInspector-toggleSwitch",h.setAttribute("data-bind","click: togglePrimitives, text: primitivesSwitchText"),D.appendChild(h),D.appendChild(document.createTextNode("Primitives")),u.appendChild(D);var M=document.createElement("div");M.className="cesium-cesiumInspector-section",M.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : primitivesVisible, "cesium-cesiumInspector-hide" : !primitivesVisible}'),u.appendChild(M);var I=document.createElement("div");I.className="cesium-cesiumInspector-pickSection",M.appendChild(I);var R=document.createElement("input");R.type="button",R.value="Pick a primitive",R.className="cesium-cesiumInspector-pickButton",R.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');var O=document.createElement("div");O.className="cesium-cesiumInspector-center",O.appendChild(R),I.appendChild(O);var N=document.createElement("div");I.appendChild(N);var L=document.createElement("input");L.type="checkbox",L.setAttribute("data-bind","checked: primitiveBoundingSphere, click: showPrimitiveBoundingSphere, enable: hasPickedPrimitive"),N.appendChild(L),N.appendChild(document.createTextNode("Show bounding sphere"));var B=document.createElement("div");I.appendChild(B);var F=document.createElement("input");F.type="checkbox",F.setAttribute("data-bind","checked: primitiveReferenceFrame, click: showPrimitiveReferenceFrame, enable: hasPickedPrimitive"),B.appendChild(F),B.appendChild(document.createTextNode("Show reference frame"));var V=document.createElement("div");this._primitiveOnly=V,I.appendChild(V);var k=document.createElement("input");k.type="checkbox",k.setAttribute("data-bind","checked: filterPrimitive, click: doFilterPrimitive, enable: hasPickedPrimitive"),V.appendChild(k),V.appendChild(document.createTextNode("Show only selected"));var z=document.createElement("div");z.className="cesium-cesiumInspector-sectionHeader",h=document.createElement("span"),h.className="cesium-cesiumInspector-toggleSwitch",h.setAttribute("data-bind","click: toggleTerrain, text: terrainSwitchText"),z.appendChild(h),z.appendChild(document.createTextNode("Terrain")),u.appendChild(z);var U=document.createElement("div");U.className="cesium-cesiumInspector-section",U.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : terrainVisible, "cesium-cesiumInspector-hide" : !terrainVisible}'),u.appendChild(U);var G=document.createElement("div");G.className="cesium-cesiumInspector-pickSection",U.appendChild(G);var W=document.createElement("input");W.type="button",W.value="Pick a tile",W.className="cesium-cesiumInspector-pickButton",W.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),O=document.createElement("div"),O.appendChild(W),O.className="cesium-cesiumInspector-center",G.appendChild(O);var H=document.createElement("div");G.appendChild(H);var q=document.createElement("input");q.type="button",q.value="Parent",q.className="cesium-cesiumInspector-pickButton",q.setAttribute("data-bind","click: selectParent");var j=document.createElement("input");j.type="button",j.value="NW",j.className="cesium-cesiumInspector-pickButton",j.setAttribute("data-bind","click: selectNW");var Y=document.createElement("input");Y.type="button",Y.value="NE",Y.className="cesium-cesiumInspector-pickButton",Y.setAttribute("data-bind","click: selectNE");var X=document.createElement("input");X.type="button",X.value="SW",X.className="cesium-cesiumInspector-pickButton",X.setAttribute("data-bind","click: selectSW");var Z=document.createElement("input");Z.type="button",Z.value="SE",Z.className="cesium-cesiumInspector-pickButton",Z.setAttribute("data-bind","click: selectSE");var K=document.createElement("div");K.className="cesium-cesiumInspector-tileText",H.className="cesium-cesiumInspector-frustumStats",H.appendChild(K),H.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : hasPickedTile, "cesium-cesiumInspector-hide" : !hasPickedTile}'),K.setAttribute("data-bind","html: tileText");var Q=document.createElement("div");Q.className="cesium-cesiumInspector-relativeText",Q.textContent="Select relative:",H.appendChild(Q);var J=document.createElement("table"),$=document.createElement("tr"),ee=document.createElement("tr"),te=document.createElement("td");te.appendChild(q);var ie=document.createElement("td");ie.appendChild(j);var re=document.createElement("td");re.appendChild(Y),$.appendChild(te),$.appendChild(ie),$.appendChild(re);var ne=document.createElement("td"),oe=document.createElement("td");oe.appendChild(X);var ae=document.createElement("td");ae.appendChild(Z),ee.appendChild(ne),ee.appendChild(oe),ee.appendChild(ae),J.appendChild($),J.appendChild(ee),H.appendChild(J);var se=document.createElement("div");G.appendChild(se);var le=document.createElement("input");le.type="checkbox",le.setAttribute("data-bind","checked: tileBoundingSphere, enable: hasPickedTile, click: showTileBoundingSphere"),se.appendChild(le),se.appendChild(document.createTextNode("Show bounding volume"));var ue=document.createElement("div");G.appendChild(ue);var ce=document.createElement("input");ce.type="checkbox",ce.setAttribute("data-bind","checked: filterTile, enable: hasPickedTile, click: doFilterTile"),ue.appendChild(ce),ue.appendChild(document.createTextNode("Show only selected"));var he=document.createElement("div");U.appendChild(he);var de=document.createElement("input");de.type="checkbox",de.setAttribute("data-bind","checked: wireframe, click: showWireframe"),he.appendChild(de),he.appendChild(document.createTextNode("Wireframe"));var pe=document.createElement("div");U.appendChild(pe);var me=document.createElement("input");me.type="checkbox",me.setAttribute("data-bind","checked: suspendUpdates, click: doSuspendUpdates"),pe.appendChild(me),pe.appendChild(document.createTextNode("Suspend LOD update"));var fe=document.createElement("div");U.appendChild(fe);var _e=document.createElement("input");_e.type="checkbox",_e.setAttribute("data-bind","checked: tileCoordinates, click: showTileCoordinates"),fe.appendChild(_e),fe.appendChild(document.createTextNode("Show tile coordinates")),n.applyBindings(r,this._element)}return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return n.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),i(this)},s}),i("Widgets/CesiumWidget/CesiumWidget",["../../Core/buildModuleUrl","../../Core/Cartesian3","../../Core/Clock","../../Core/Credit","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/Ellipsoid","../../Core/FeatureDetection","../../Core/formatError","../../Core/requestAnimationFrame","../../Core/ScreenSpaceEventHandler","../../Scene/BingMapsImageryProvider","../../Scene/Globe","../../Scene/Moon","../../Scene/Scene","../../Scene/SceneMode","../../Scene/ShadowMode","../../Scene/SkyAtmosphere","../../Scene/SkyBox","../../Scene/Sun","../getElement"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E){"use strict";function b(t){return e("Assets/Textures/SkyBox/tycho2t3_80_"+t+".jpg")}function T(e){function t(r){if(!e.isDestroyed())if(e._useDefaultRenderLoop)try{var n=e._targetFrameRate;if(o(n)){var a=1e3/n,s=r-i;s>a&&(e.resize(),e.render(),i=r-s%a),d(t)}else e.resize(),e.render(),d(t)}catch(t){if(e._useDefaultRenderLoop=!1,e._renderLoopRunning=!1,e._showRenderLoopErrors){var l="An error occurred while rendering. Rendering has stopped.";e.showErrorPanel(l,void 0,t)}}else e._renderLoopRunning=!1}e._renderLoopRunning=!0;var i=0;d(t)}function x(e){var t=e._canvas,i=t.clientWidth,r=t.clientHeight,o=e._resolutionScale;e._supportsImageRenderingPixelated||(o*=n(window.devicePixelRatio,1)),e._canvasWidth=i,e._canvasHeight=r,i*=o,r*=o,t.width=i,t.height=r,e._canRender=0!==i&&0!==r}function A(e){var t=e._canvas,i=t.width,r=t.height;if(0!==i&&0!==r){var n=e._scene.camera.frustum;o(n.aspectRatio)?n.aspectRatio=i/r:(n.top=n.right*(r/i),n.bottom=-n.top)}}function P(e,a){e=E(e),a=n(a,{});var s=document.createElement("div");s.className="cesium-widget",e.appendChild(s);var l=document.createElement("canvas"),h=c.supportsImageRenderingPixelated();this._supportsImageRenderingPixelated=h,h&&(l.style.imageRendering=c.imageRenderingValue()),l.oncontextmenu=function(){return!1},l.onselectstart=function(){return!1},s.appendChild(l);var d=document.createElement("div");d.className="cesium-widget-credits";var T=o(a.creditContainer)?E(a.creditContainer):s;T.appendChild(d);var P=n(a.showRenderLoopErrors,!0);this._element=s,this._container=e,this._canvas=l,this._canvasWidth=0,this._canvasHeight=0,this._creditContainer=d,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=P,this._resolutionScale=1,this._forceResize=!1,this._clock=o(a.clock)?a.clock:new i,x(this);try{var M=new g({canvas:l,contextOptions:a.contextOptions,creditContainer:d,mapProjection:a.mapProjection,orderIndependentTranslucency:a.orderIndependentTranslucency,scene3DOnly:n(a.scene3DOnly,!1),terrainExaggeration:a.terrainExaggeration,shadows:a.shadows,mapMode2D:a.mapMode2D});this._scene=M,M.camera.constrainedAxis=t.UNIT_Z,A(this);var I=n(M.mapProjection.ellipsoid,u.WGS84),R=M.frameState.creditDisplay,O=new r("Cesium",D,"http://cesiumjs.org/");R.addDefaultCredit(O);var N=a.globe;o(N)||(N=new f(I)),N!==!1&&(M.globe=N,M.globe.shadows=n(a.terrainShadows,y.RECEIVE_ONLY));var L=a.skyBox;o(L)||(L=new w({sources:{positiveX:b("px"),negativeX:b("mx"),positiveY:b("py"),negativeY:b("my"),positiveZ:b("pz"),negativeZ:b("mz")}})),L!==!1&&(M.skyBox=L,M.sun=new S,M.moon=new _);var B=a.skyAtmosphere;o(B)||(B=new C(I)),B!==!1&&(M.skyAtmosphere=B);var F=a.globe!==!1&&a.imageryProvider;o(F)||(F=new m({url:"https://dev.virtualearth.net"})),F!==!1&&M.imageryLayers.addImageryProvider(F),o(a.terrainProvider)&&a.globe!==!1&&(M.terrainProvider=a.terrainProvider),this._screenSpaceEventHandler=new p(l,!1),o(a.sceneMode)&&(a.sceneMode===v.SCENE2D&&this._scene.morphTo2D(0),a.sceneMode===v.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)), -this._useDefaultRenderLoop=void 0,this.useDefaultRenderLoop=n(a.useDefaultRenderLoop,!0),this._targetFrameRate=void 0,this.targetFrameRate=a.targetFrameRate;var V=this;M.renderError.addEventListener(function(e,t){if(V._useDefaultRenderLoop=!1,V._renderLoopRunning=!1,V._showRenderLoopErrors){var i="An error occurred while rendering. Rendering has stopped.";V.showErrorPanel(i,void 0,t)}})}catch(e){if(P){var k="Error constructing CesiumWidget.",z='Visit <a href="http://get.webgl.org">http://get.webgl.org</a> to verify that your web browser and hardware support WebGL. Consider trying a different web browser or updating your video drivers. Detailed error information is below:';this.showErrorPanel(k,z,e)}throw e}}var D="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHYAAAAeCAYAAAD5AOomAAAQWUlEQVR42u1beXxOxxpudrEktkbUkriI4lZpq5JbW6pJuFG0qrFeexVRak3TBm3RUgS1hFhrCdKgQWKLrUGQBiVBJMgiq0Qiuyxzn/fzTu74ZPnS9nfrj4zf8/ty5sw7M+c8824zx0svVa3oAfqAAWAIGAHGCoy43oDb6TGqywta9JgsIq4GUAswB+oDDRXU5/ragCm3N6gm+MUkVJ+1kAg1AyyA5oAN8BrQCXiTfzsArwLWgCVQF6jJBOtXk/tikWrMGkiEtgTeAOyBfsAQS0vL8YMHD/aws7ObiuthwAeAA/A20AZozAvCRNHe6vI3k2rCprUp8DoR1qVLF1c/P7+A5OTkhyUlJaKwuETkPSkRBUUlgkpmZmbW2bNnQyZOnLgA7Z2BzkALNtM1qsl9MTSVSLUCugADAwMDTxKZVI7cfCw8DiWK6fselMLtlwSxJyxDPM4vFsXFxSWRkZFRkBsOdAdaAw2qyf37ij77RDMm1a5evXojY2NjH5BW7ruaIab4xotPd8cJV/xO0cKkPXGae97n0kR6TpHIzs7O7d279xdsvoncemwJqn3u/1lbDTnqfYXN6JCUlJS03CfFwt0/4TkiK8IEEBydWiBIy21tbaejr24cWJlpBVT6ShpVFvS10iddZP6MbFkyqpw2Kor6K5P9M33onG1Iv0omsz3Q//79+7HpuUViDsys697KyZy89ynk9Wc/x4u7DwvE48ePs2mRcARtqUTLRjxmDa6rpYWanDqZKHmyzJ+lTFlyUrZGGbIm3GdF49VQcnMjZUwTJW83Ua4NtayQmlEYKW1NlOc11RrLoAxLpqdYUSmnPlOlbk1qa21OZ7ovX758E/lTz1MpOmvp5gvp4qeL6c8sAjLNOQXF4sKFC6Hotw+nSrR46rAfb8hkN+WxVTTlyPplNuNmDArGGgFNgGZloClbHQtua8bj1eW+GnObZspY2nL1WKaOkreraKDk7jXLsEJGXG+u1b4Bz/0VZayyUkO5f2DCc5DvyZL/1inb0ONVU5+1dSBMcHrIvRwNMbqQ6u6fKGSZ4POszFaQDZNc0q9fvzkcjFkzKf/gfJjSo3c40OrBoL+7cvvXeUFYM17l1MuOTbxEV8a/uE8pZ8Ww4bouPJ62bFlyzXmebRg2jLY8jxa8WGopxEiX9jLff1Vp357zfluefyeOPxpp9WHAGl2fn/k1do+Ef/K86lYWs+hzJ7SSbXv06OFGAfAMRLtlBUjkPyfuidMyw3Fi37UM8TMCLFVj6W9qW1BYIg4ePBjEWkukdCTyZsyYMcvX13f7iRMnDv36669B0OxTBKRNx4OCggIPHDiwa+XKld+j7Xv84v/l4+Oz6PLlywHnzp07Su0gdyw4OPgYXQNHzp8/f+TixYuHw8LCDuDeGiaLXqLj6tWrlyLC9ztz5gy1PwEcV3AU89i3detWT2NjYyeWedvLy2va77//7hcREeHfsWPH91HX6/r16/7h4eH+6H+ZVtQvN3ToujXm9wPJYS6+FhYWzggmh4eGhh6hsTHnE/j7eN++fQczWY1Yc6WrIVJb0SLEu9iJ93I0JCTkKMY+PHLkSGe2MLV5TL3ytgxr88pwuHLlyvXY9CcaH6mSR5HwwRuPRWZekTgXnfPcfW0QqfMDk0Qc+nqCnDc+Pj6FNzJoE+PfeDEXhQ6FtD0rKyu9Tp06LpAbBN9/S+hYEJmnck79EazQA5myVTKeyM/Pp7jgI2AAXv4JeW/AgAGzUTdKXj969CiOF04T1jhj/qXrzrgfQ+0KUdq1azdt6tSpntrjxcTEUGroyBrdkLmoy3x0HT9+vIe2zIoVK9y5fT0eU688/2rOJqY/bTRcjsl5hqRPYF5P38nSdJrwMErzezMpX1NfHrELjiQ9fbl56SIjO5leViH6nwwMnjZt2gL5EmWh/Lf4f+U5BtauXbsJshPu3LkTLQl/+PBhVmpqagZ+HxHS0tLSCShpGRkZqXhp12i8RYsWrVP7wr1ctM9E2wy0lch88uRJoWwTFRV1A7JjoVnBss7BwWEJ6ubIa/SRgOt32VybKduvZILtMbd4JraoZcuWC8eMGbNN+7noWTt06DCVXUIL9rtNOdj8uABFW+bbb7/9js34y4o5fo5YI14h7QwNDV1yc3MLAsIfP0PS9kvpmg6Db+wXn6/pKrwOztBcn7mTXWbEPHlPvMguKBFFxYXiq819hZu3k6Y9xpgFjN+xY8cBOcmkpKQ0rh8HDCUieHNjHExgmGwHQomkKbdu3bpP10VFRcU2NjZ7UbcKWATMB74C3IBpSn8jTp48eVb2k5iYSNq4BVjJcl8zFrq5ue3Py8vLB/Kg4USa6+nTp0OkLNwUmfYFckGiTRJZH1YKc3Zp5mye+yQnJydQOyyYImtr65XDhw/3lX2B7BJlgaSxhXiL+6K99z4wwadkG/RRLP/28PBYxpaiES+mcokllW4PczcUz1Twy++ZpSTRrhJtUCSnx4gvNzkL9419xBfevUVIxEHNIEuDUp4j90ZCHjSqUHj+/AnaOmnkmFgyIa6Y8Hk5SScnp6VMwLs82Tc5wOkJv9Tfz89v3f79+73xMPTyJyrEloCI8+PGjTs0adIkX1dXVx+Yuu2ff/75tlmzZm1A+xUDBw6kHHo4/GqQHA8Lt9DT0/OSu7v70SlTpuwdMmTIFhC2tlmzZivQ9geAtOFLgLRoGhbFJSnbrVu3DahbrEXs+4pZrMm/FGj1xaJNlMRaWVmtGTZs2D7ZV3R0dA6sWJG8Riayhd1GNzbNo0nTpWWbP3/+dYXY5fyOLCsjti5Hbh/hwfODbmeVkkS5rCgpFgt2DNaQKjHTy16kZsRpBpp1IKE0uNoSkqapO3llp2YBUFuPLf01Jgf9007UFAQCv8lJmpubf4Y6J478rNgMWfHL6cRBE+1e9SXTKInVpdy7d+8KmbOhQ4d+rasMLRjML5xMLlkSBFShCrEbiXxJLDQymQ8/2rN/lKkJXQ+AdUiSxDZv3nydSuzNmzczQWaEvIZbeESuhhf5mLt375Y+Z0BAQDQW7Dl5PXfu3KW6EGvIfoEisL6Ya+p1aBz5z/N3czQdbQ5w12ieSizhu13DEPHmajYiKDXyPJmiaX8t6pSYs8FB04bM8ObAL2ijIg/9zyCtU4lFBDqJA6p2nE/KPLMVmyRbToGcq0osAq0rrFEu8Eve5IfJhOsiCxN8FXJzjx07FqYQ6426JZJYaGQKu463eO4W/EvXLiqx0Ni1MMV+ig9PR5ut0PosWbd582bKHL50cXHZIOMMGqtJkybrQWZpEDdv3rwfdCHWgCM5yo3s/f39j9G8H2Y/tRKXbgUItw2Oz5EqSfMJWvT0dCefA5PsVPHNTx+VtpkFzb4Ve0ncuHHjLq/I0UhJSv1W27Zt57F/6cpp0Gv8awfz6Lxq1ar5P/7448KxY8eSH/5UNcUffPBBQKdOnTZ37tx5la2t7VI7O7vv33nnnYUwrR6Ojo7TEIm6sFkjckfxwvIAaMyvTE1NPRC4LEFQtAH9+yOVSFYiXvLFC48ePXpF1nXv3n09mWqF2Ie4/oTHeIM19Q2+/iQhISFVIXb1iBEj9irWhCL2pXPmzPlF9aOoW4+gL13W7d69+ywtMASApe1glhez2yqXWJnH1uDVRv5tpMY0PE4Qu4IWlkmoNlb6TRKRcaHiQoS/+Ir9sMTCnYM1q27NmjW+tIqJxMOHDwfISe7bty8YdZ8pZ7r9aZOEruE7F2lFqZ+pwRNI8WG/SGTNZuKm8gIawlrusGDBgi+wsEJ+Q8Fq38W+fg7LkHv4hoKwUaNGlWoFLEwuEatqrL29PQVq86TW5+Tk5LP8aDK9PN4AvnaXPhKBbSEW6bLRo0fvkH3FxsYmcaA3m6JzWR8ZGVlKKmUoHAhORFywSysqfqui4Enbz1JE5nz16tXwrNx0nUh9Gkw5QTPfFbPX93pWo6Hpp6740EqkVOc/lNzTZgM0cKVq9qAdmSlPS5IEHjaN8h7Z5iAKpUt48LsyTYCGPcBc7+L3DvLi2xEREYSbt2/fDkdwci0sLOwwRZfbt29frmhFIdpEgehIkqFfRN9RQAzmkSvbQdvIzLqdOnWqNN+GFaAoeircVYr68rHoohG138KYN+mXji1Rny1NKeKWXDMzM/cJEyZskHIPUMiX0ntp06aNm5riSYsA0+zLpn6Ql5fXRnl/8eLFX7NVsygv3VHNcU3ev+xC23800NlrvqUBUFVBckv3jNZMBNHnSvajr/OEHLDaM3X1lSCjoFGjRmRKhyGoiKziBgWZRWf0kSeqUGbOnOlJmod44Iys+/DDD8kiuMAULlMXXWUFUfkhIhB9LpZ1WBwxHBDSexmIBXFTlcHCeMQuqidh586dK+S91atXu3EkXp83KPQrOt0xZq2loMVh2bJlmmT6+OVt0MT3qkiqk1jsM0LkFWQL0iI2rx2UjXfyo73gPzZCu64iyIhHYJMMJU2RoJ0ikBiOiNBn0KBBY/gB7UNDQ3/B/QTcT1SRmpqaQEA/D3A/HtoXGxcXd07uy3bt2nUQSPKHJkbLthIsnwifGY/5/oZ0gnxwb5ojTPG6jIyMGCySBCz4gTJKnz59+szg4OBAjBEFkuIg+wxQojHXszD983hx9Zw8efI4EBZHgFYHsjnV7JdjfkMw50R+hnikauM4QKJspb23t/dkuAeaR9ySJUuG8Lusw9ZWr7KvEU15N4P2Lt9HZKjZdTkeuk3MRcpSVmT8DKEbe2vaePlPFyX4B8IoHfiYH6AJJ+/m7PRtuL47r9revJfch/92YDK78Hxas0xHDrTeU2R6c8rkWIZcK/5mqx1vondnWUeWUdGL++7EL9SG5Tooc2ihFbH3VPpzVOZgz4ugI6durVjLpNV6lRd5Y/5tx3Puxv3Kzf5G3KaFcpjQvCqfHKmH7Y15An3hqDeRWaZo1+fkIjFjXQ9NKiNNNJFJvpR87JLdI8X95HCNj6CjOtrJ4uituXLUZKwk8pbKCUpr5fSkNZNhxe6hIbeXR3bNFBlttOKX0Izb1mfZhtyXFcu20kFOfmZrwQteHtXJI8AmvKfbUulPLiRrTtvk8WFdPhyw4P4b8DupxZrXgOfXTHnmOvyu5P6x/NxX7nIZVuXA3Yg7asyrxoG+RER4HoMorzj/SY64ijw18OIm4Xd2uTh4fq04f+OASEy7pyGUvrqYPXv2CvYfb/JEzbUOlA342lR5MDNFo+UZam1+MBPlgNuU69X25mXI1lIO6qVsTUXWrAK5GloH49qH3Ophf21l/mZlzL2G1gG9aTkfEJgoHwDU1LpvqIxZ0eG8TuTKM8VWbCKcoYGj1q1btwehegJtPVIuSVEmnd8iQDhtbW3tamxs/CGbs7a8OOooDr68z1QMlQdUH0b7kxX1sxbDSmBQzqcoBpXIGJQjo/1ZSmVzqaivyvozqOB96f+Z78b0lLPFumwabFgDe3K+NpDz0kH8rXEvNrttWUvr6/DRuJ6O+CMyf0a2Ku+pqn390Xt/6QduBopPNFe2zFrJaI2dfmv2XZbsz2op5qL6v3m8oF8vqv9/R/oB+Q1RPf41U3yT0R+x/9Xlryn/BY268qsf3smdAAAAAElFTkSuQmCC";return a(P.prototype,{container:{get:function(){return this._container}},canvas:{get:function(){return this._canvas}},creditContainer:{get:function(){return this._creditContainer}},scene:{get:function(){return this._scene}},imageryLayers:{get:function(){return this._scene.imageryLayers}},terrainProvider:{get:function(){return this._scene.terrainProvider},set:function(e){this._scene.terrainProvider=e}},camera:{get:function(){return this._scene.camera}},clock:{get:function(){return this._clock}},screenSpaceEventHandler:{get:function(){return this._screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._targetFrameRate},set:function(e){this._targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._useDefaultRenderLoop},set:function(e){this._useDefaultRenderLoop!==e&&(this._useDefaultRenderLoop=e,e&&!this._renderLoopRunning&&T(this))}},resolutionScale:{get:function(){return this._resolutionScale},set:function(e){this._resolutionScale=e,this._forceResize=!0}}}),P.prototype.showErrorPanel=function(e,t,i){function r(){u.style.maxHeight=Math.max(Math.round(.9*n.clientHeight-100),30)+"px"}var n=this._element,a=document.createElement("div");a.className="cesium-widget-errorPanel";var s=document.createElement("div");s.className="cesium-widget-errorPanel-content",a.appendChild(s);var l=document.createElement("div");l.className="cesium-widget-errorPanel-header",l.appendChild(document.createTextNode(e)),s.appendChild(l);var u=document.createElement("div");if(u.className="cesium-widget-errorPanel-scroll",s.appendChild(u),r(),o(window.addEventListener)&&window.addEventListener("resize",r,!1),o(t)){var c=document.createElement("div");c.className="cesium-widget-errorPanel-message",c.innerHTML="<p>"+t+"</p>",u.appendChild(c)}var d="(no error details available)";o(i)&&(d=h(i));var p=document.createElement("div");p.className="cesium-widget-errorPanel-message",p.appendChild(document.createTextNode(d)),u.appendChild(p);var m=document.createElement("div");m.className="cesium-widget-errorPanel-buttonPanel",s.appendChild(m);var f=document.createElement("button");f.setAttribute("type","button"),f.className="cesium-button",f.appendChild(document.createTextNode("OK")),f.onclick=function(){o(r)&&o(window.removeEventListener)&&window.removeEventListener("resize",r,!1),n.removeChild(a)},m.appendChild(f),n.appendChild(a),"undefined"!=typeof console&&console.error(e+"\n"+t+"\n"+d)},P.prototype.isDestroyed=function(){return!1},P.prototype.destroy=function(){this._scene=this._scene&&this._scene.destroy(),this._container.removeChild(this._element),s(this)},P.prototype.resize=function(){var e=this._canvas,t=e.clientWidth,i=e.clientHeight;(this._forceResize||this._canvasWidth!==t||this._canvasHeight!==i)&&(this._forceResize=!1,x(this),A(this))},P.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();var e=this._clock.tick();this._scene.render(e)}else this._clock.tick()},P}),i("Widgets/ClockViewModel",["../Core/Clock","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/EventHelper","../Core/JulianDate","../ThirdParty/knockout"],function(e,t,i,r,n,o,a){"use strict";function s(i){t(i)||(i=new e),this._clock=i,this._eventHelper=new n,this._eventHelper.add(i.onTick,this.synchronize,this),this.systemTime=a.observable(o.now()),this.systemTime.equalityComparer=o.equals,this.startTime=a.observable(i.startTime),this.startTime.equalityComparer=o.equals,this.startTime.subscribe(function(e){i.startTime=e,this.synchronize()},this),this.stopTime=a.observable(i.stopTime),this.stopTime.equalityComparer=o.equals,this.stopTime.subscribe(function(e){i.stopTime=e,this.synchronize()},this),this.currentTime=a.observable(i.currentTime),this.currentTime.equalityComparer=o.equals,this.currentTime.subscribe(function(e){i.currentTime=e,this.synchronize()},this),this.multiplier=a.observable(i.multiplier),this.multiplier.subscribe(function(e){i.multiplier=e,this.synchronize()},this),this.clockStep=a.observable(i.clockStep),this.clockStep.subscribe(function(e){i.clockStep=e,this.synchronize()},this),this.clockRange=a.observable(i.clockRange),this.clockRange.subscribe(function(e){i.clockRange=e,this.synchronize()},this),this.canAnimate=a.observable(i.canAnimate),this.canAnimate.subscribe(function(e){i.canAnimate=e,this.synchronize()},this),this.shouldAnimate=a.observable(i.shouldAnimate),this.shouldAnimate.subscribe(function(e){i.shouldAnimate=e,this.synchronize()},this),a.track(this,["systemTime","startTime","stopTime","currentTime","multiplier","clockStep","clockRange","canAnimate","shouldAnimate"])}return i(s.prototype,{clock:{get:function(){return this._clock}}}),s.prototype.synchronize=function(){var e=this._clock;this.systemTime=o.now(),this.startTime=e.startTime,this.stopTime=e.stopTime,this.currentTime=e.currentTime,this.multiplier=e.multiplier,this.clockStep=e.clockStep,this.clockRange=e.clockRange,this.canAnimate=e.canAnimate,this.shouldAnimate=e.shouldAnimate},s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){this._eventHelper.removeAll(),r(this)},s}),i("Widgets/Command",["../Core/DeveloperError"],function(e){"use strict";function t(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,e.throwInstantiationError()}return t}),i("Widgets/FullscreenButton/FullscreenButtonViewModel",["../../Core/defaultValue","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/Fullscreen","../../ThirdParty/knockout","../createCommand","../getElement"],function(e,t,i,r,n,o,a,s){"use strict";function l(t){var i=this,r=o.observable(n.fullscreen),l=o.observable(n.enabled);this.isFullscreen=void 0,o.defineProperty(this,"isFullscreen",{get:function(){return r()}}),this.isFullscreenEnabled=void 0,o.defineProperty(this,"isFullscreenEnabled",{get:function(){return l()},set:function(e){l(e&&n.enabled)}}),this.tooltip=void 0,o.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?r()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=a(function(){n.fullscreen?n.exitFullscreen():n.requestFullscreen(i._fullscreenElement)},o.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=e(s(t),document.body),this._callback=function(){r(n.fullscreen)},document.addEventListener(n.changeEventName,this._callback)}return t(l.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}}),l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){document.removeEventListener(n.changeEventName,this._callback),i(this)},l}),i("Widgets/FullscreenButton/FullscreenButton",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./FullscreenButtonViewModel"],function(e,t,i,r,n,o,a){"use strict";function s(e,t){e=o(e);var i=new a(t);i._exitFullScreenPath=u,i._enterFullScreenPath=l;var r=document.createElement("button");r.type="button",r.className="cesium-button cesium-fullscreenButton",r.setAttribute("data-bind","attr: { title: tooltip },click: command,enable: isFullscreenEnabled,cesiumSvgPath: { path: isFullscreen ? _exitFullScreenPath : _enterFullScreenPath, width: 128, height: 128 }"),e.appendChild(r),n.applyBindings(i,r),this._container=e,this._viewModel=i,this._element=r}var l="M 83.96875 17.5625 L 83.96875 17.59375 L 76.65625 24.875 L 97.09375 24.96875 L 76.09375 45.96875 L 81.9375 51.8125 L 102.78125 30.9375 L 102.875 51.15625 L 110.15625 43.875 L 110.1875 17.59375 L 83.96875 17.5625 z M 44.125 17.59375 L 17.90625 17.625 L 17.9375 43.90625 L 25.21875 51.1875 L 25.3125 30.96875 L 46.15625 51.8125 L 52 45.96875 L 31 25 L 51.4375 24.90625 L 44.125 17.59375 z M 46.0625 76.03125 L 25.1875 96.875 L 25.09375 76.65625 L 17.8125 83.9375 L 17.8125 110.21875 L 44 110.25 L 51.3125 102.9375 L 30.90625 102.84375 L 51.875 81.875 L 46.0625 76.03125 z M 82 76.15625 L 76.15625 82 L 97.15625 103 L 76.71875 103.0625 L 84.03125 110.375 L 110.25 110.34375 L 110.21875 84.0625 L 102.9375 76.8125 L 102.84375 97 L 82 76.15625 z",u="M 104.34375 17.5625 L 83.5 38.4375 L 83.40625 18.21875 L 76.125 25.5 L 76.09375 51.78125 L 102.3125 51.8125 L 102.3125 51.78125 L 109.625 44.5 L 89.1875 44.40625 L 110.1875 23.40625 L 104.34375 17.5625 z M 23.75 17.59375 L 17.90625 23.4375 L 38.90625 44.4375 L 18.5 44.53125 L 25.78125 51.8125 L 52 51.78125 L 51.96875 25.53125 L 44.6875 18.25 L 44.625 38.46875 L 23.75 17.59375 z M 25.6875 76.03125 L 18.375 83.3125 L 38.78125 83.40625 L 17.8125 104.40625 L 23.625 110.25 L 44.5 89.375 L 44.59375 109.59375 L 51.875 102.3125 L 51.875 76.0625 L 25.6875 76.03125 z M 102.375 76.15625 L 76.15625 76.1875 L 76.1875 102.4375 L 83.46875 109.71875 L 83.5625 89.53125 L 104.40625 110.375 L 110.25 104.53125 L 89.25 83.53125 L 109.6875 83.46875 L 102.375 76.15625 z";return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return this._viewModel.destroy(),n.cleanNode(this._element),this._container.removeChild(this._element),i(this)},s}),i("Widgets/Geocoder/GeocoderViewModel",["../../Core/BingMapsApi","../../Core/Cartesian3","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/Event","../../Core/loadJsonp","../../Core/Matrix4","../../Core/Rectangle","../../ThirdParty/knockout","../../ThirdParty/when","../createCommand"],function(e,t,i,r,n,o,a,s,l,u,c,h,d){"use strict";function p(t){this._url=i(t.url,"https://dev.virtualearth.net/"),this._url.length>0&&"/"!==this._url[this._url.length-1]&&(this._url+="/"),this._key=e.getKey(t.key);var n=e.getErrorCredit(t.key);r(n)&&t.scene._frameState.creditDisplay.addDefaultCredit(n),this._scene=t.scene,this._flightDuration=t.flightDuration,this._searchText="",this._isSearchInProgress=!1,this._geocodeInProgress=void 0,this._complete=new a;var o=this;this._searchCommand=d(function(){o.isSearchInProgress?_(o):f(o)}),this.keepExpanded=!1,c.track(this,["_searchText","_isSearchInProgress","keepExpanded"]),this.isSearchInProgress=void 0,c.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,c.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(e){this._searchText=e}}),this.flightDuration=void 0,c.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(e){this._flightDuration=e}})}function m(e,t){e._scene.camera.flyTo({destination:t,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:l.IDENTITY})}function f(e){var i=e.searchText;if(!/^\s*$/.test(i)){var r=i.match(/[^\s,\n]+/g);if(2===r.length||3===r.length){var n=+r[0],o=+r[1],a=3===r.length?+r[2]:300;if(!isNaN(n)&&!isNaN(o)&&!isNaN(a))return void m(e,t.fromDegrees(n,o,a))}e._isSearchInProgress=!0;var l=s(e._url+"REST/v1/Locations",{parameters:{query:i,key:e._key},callbackParameterName:"jsonp"}),c=e._geocodeInProgress=h(l,function(t){if(!c.cancel){if(e._isSearchInProgress=!1,0===t.resourceSets.length)return void(e.searchText=e._searchText+" (not found)");var i=t.resourceSets[0];if(0===i.resources.length)return void(e.searchText=e._searchText+" (not found)");var r=i.resources[0];e._searchText=r.name;var n=r.bbox,o=n[0],a=n[1],s=n[2],l=n[3];m(e,u.fromDegrees(a,o,l,s))}},function(){c.cancel||(e._isSearchInProgress=!1,e.searchText=e._searchText+" (error)")})}}function _(e){e._isSearchInProgress=!1,r(e._geocodeInProgress)&&(e._geocodeInProgress.cancel=!0,e._geocodeInProgress=void 0)}return n(p.prototype,{url:{get:function(){return this._url}},key:{get:function(){return this._key}},complete:{get:function(){return this._complete}},scene:{get:function(){return this._scene}},search:{get:function(){return this._searchCommand}}}),p}),i("Widgets/Geocoder/Geocoder",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/FeatureDetection","../../ThirdParty/knockout","../getElement","./GeocoderViewModel"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){var t=a(e.container),i=new s(e);i._startSearchPath=u,i._stopSearchPath=c;var r=document.createElement("form");r.setAttribute("data-bind","submit: search");var l=document.createElement("input");l.type="search",l.className="cesium-geocoder-input",l.setAttribute("placeholder","Enter an address or landmark..."),l.setAttribute("data-bind",'value: searchText,valueUpdate: "afterkeydown",disable: isSearchInProgress,css: { "cesium-geocoder-input-wide" : keepExpanded || searchText.length > 0 }'),this._onTextBoxFocus=function(){setTimeout(function(){l.select()},0)},l.addEventListener("focus",this._onTextBoxFocus,!1),r.appendChild(l),this._textBox=l;var h=document.createElement("span");h.className="cesium-geocoder-searchButton",h.setAttribute("data-bind","click: search,cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, width: 32, height: 32 }"),r.appendChild(h),t.appendChild(r),o.applyBindings(i,r),this._container=t,this._viewModel=i,this._form=r,this._onInputBegin=function(e){t.contains(e.target)||l.blur()},this._onInputEnd=function(e){t.contains(e.target)&&l.focus()},n.supportsPointerEvents()?(document.addEventListener("pointerdown",this._onInputBegin,!0),document.addEventListener("pointerup",this._onInputEnd,!0),document.addEventListener("pointercancel",this._onInputEnd,!0)):(document.addEventListener("mousedown",this._onInputBegin,!0),document.addEventListener("mouseup",this._onInputEnd,!0),document.addEventListener("touchstart",this._onInputBegin,!0),document.addEventListener("touchend",this._onInputEnd,!0),document.addEventListener("touchcancel",this._onInputEnd,!0))}var u="M29.772,26.433l-7.126-7.126c0.96-1.583,1.523-3.435,1.524-5.421C24.169,8.093,19.478,3.401,13.688,3.399C7.897,3.401,3.204,8.093,3.204,13.885c0,5.789,4.693,10.481,10.484,10.481c1.987,0,3.839-0.563,5.422-1.523l7.128,7.127L29.772,26.433zM7.203,13.885c0.006-3.582,2.903-6.478,6.484-6.486c3.579,0.008,6.478,2.904,6.484,6.486c-0.007,3.58-2.905,6.476-6.484,6.484C10.106,20.361,7.209,17.465,7.203,13.885z",c="M24.778,21.419 19.276,15.917 24.777,10.415 21.949,7.585 16.447,13.087 10.945,7.585 8.117,10.415 13.618,15.917 8.116,21.419 10.946,24.248 16.447,18.746 21.948,24.248z";return t(l.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return n.supportsPointerEvents()?(document.removeEventListener("pointerdown",this._onInputBegin,!0),document.removeEventListener("pointerup",this._onInputEnd,!0)):(document.removeEventListener("mousedown",this._onInputBegin,!0),document.removeEventListener("mouseup",this._onInputEnd,!0),document.removeEventListener("touchstart",this._onInputBegin,!0),document.removeEventListener("touchend",this._onInputEnd,!0)),o.cleanNode(this._form),this._container.removeChild(this._form),this._textBox.removeEventListener("focus",this._onTextBoxFocus,!1),i(this)},l}),i("Widgets/HomeButton/HomeButtonViewModel",["../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../ThirdParty/knockout","../createCommand"],function(e,t,i,r,n){"use strict";function o(e,t){this._scene=e,this._duration=t;var i=this;this._command=n(function(){i._scene.camera.flyHome(i._duration)}),this.tooltip="View Home",r.track(this,["tooltip"])}return t(o.prototype,{scene:{get:function(){return this._scene}},command:{get:function(){return this._command}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}}}),o}),i("Widgets/HomeButton/HomeButton",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./HomeButtonViewModel"],function(e,t,i,r,n,o,a){"use strict";function s(e,t,i){e=o(e);var r=new a(t,i);r._svgPath="M14,4l-10,8.75h20l-4.25-3.7188v-4.6562h-2.812v2.1875l-2.938-2.5625zm-7.0938,9.906v10.094h14.094v-10.094h-14.094zm2.1876,2.313h3.3122v4.25h-3.3122v-4.25zm5.8442,1.281h3.406v6.438h-3.406v-6.438z";var s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-home-button",s.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 28, height: 28 }"),e.appendChild(s),n.applyBindings(r,s),this._container=e,this._viewModel=r,this._element=s}return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return n.cleanNode(this._element),this._container.removeChild(this._element),i(this)},s}),i("Widgets/InfoBox/InfoBoxViewModel",["../../Core/defined","../../Core/defineProperties","../../Core/Event","../../ThirdParty/knockout"],function(e,t,i,r){"use strict";function n(){this._cameraClicked=new i,this._closeClicked=new i,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.description="",r.track(this,["showInfo","titleText","description","maxHeight","enableCamera","isCameraTracking"]),this._loadingIndicatorHtml='<div class="cesium-infoBox-loadingContainer"><span class="cesium-infoBox-loading"></span></div>',this.cameraIconPath=void 0,r.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?a:o}}),r.defineProperty(this,"_bodyless",{get:function(){return!e(this.description)||0===this.description.length}})}var o="M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4853444 22.104033 11.423165 24.0625 13.84375 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 8.975298 28.305952 7.03125 25.875 7.03125 L 13.84375 7.03125 z",a="M 27.34375 1.65625 L 5.28125 27.9375 L 8.09375 30.3125 L 30.15625 4.03125 L 27.34375 1.65625 z M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4724893 20.232036 9.5676108 20.7379 9.75 21.21875 L 21.65625 7.03125 L 13.84375 7.03125 z M 28.21875 7.71875 L 14.53125 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 9.8371439 29.456025 8.4902779 28.21875 7.71875 z";return n.prototype.maxHeightOffset=function(e){return this.maxHeight-e+"px"},t(n.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}}),n}),i("Widgets/InfoBox/InfoBox",["../../Core/buildModuleUrl","../../Core/Color","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","../subscribeAndEvaluate","./InfoBoxViewModel"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(r){r=s(r);var n=document.createElement("div");n.className="cesium-infoBox",n.setAttribute("data-bind",'css: { "cesium-infoBox-visible" : showInfo, "cesium-infoBox-bodyless" : _bodyless }'),r.appendChild(n);var o=document.createElement("div");o.className="cesium-infoBox-title",o.setAttribute("data-bind","text: titleText"),n.appendChild(o);var c=document.createElement("button");c.type="button",c.className="cesium-button cesium-infoBox-camera",c.setAttribute("data-bind",'attr: { title: "Focus camera on object" },click: function () { cameraClicked.raiseEvent(this); },enable: enableCamera,cesiumSvgPath: { path: cameraIconPath, width: 32, height: 32 }'),n.appendChild(c);var h=document.createElement("button");h.type="button",h.className="cesium-infoBox-close",h.setAttribute("data-bind","click: function () { closeClicked.raiseEvent(this); }"),h.innerHTML="×",n.appendChild(h);var d=document.createElement("iframe");d.className="cesium-infoBox-iframe",d.setAttribute("sandbox","allow-same-origin allow-popups allow-forms"),d.setAttribute("data-bind","style : { maxHeight : maxHeightOffset(40) }"),d.setAttribute("allowfullscreen",!0),n.appendChild(d);var p=new u;a.applyBindings(p,n),this._container=r,this._element=n,this._frame=d,this._viewModel=p,this._descriptionSubscription=void 0;var m=this;d.addEventListener("load",function(){var r=d.contentDocument,o=r.createElement("link");o.href=e("Widgets/InfoBox/InfoBoxDescription.css"),o.rel="stylesheet",o.type="text/css";var a=r.createElement("div");a.className="cesium-infoBox-description",r.head.appendChild(o),r.body.appendChild(a),m._descriptionSubscription=l(p,"description",function(e){d.style.height="5px",a.innerHTML=e;var r=null,o=a.firstElementChild;if(null!==o&&1===a.childNodes.length){var s=window.getComputedStyle(o);if(null!==s){var l=s["background-color"],u=t.fromCssColorString(l);i(u)&&0!==u.alpha&&(r=s["background-color"])}}n.style["background-color"]=r;var c=a.getBoundingClientRect().height;d.style.height=c+"px"})}),d.setAttribute("src","about:blank")}return r(c.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}}),c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){var e=this._container;return a.cleanNode(this._element),e.removeChild(this._element),i(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),n(this)},c}),i("Widgets/NavigationHelpButton/NavigationHelpButtonViewModel",["../../Core/defineProperties","../../ThirdParty/knockout","../createCommand"],function(e,t,i){"use strict";function r(){this.showInstructions=!1;var e=this;this._command=i(function(){e.showInstructions=!e.showInstructions}),this._showClick=i(function(){e._touch=!1}),this._showTouch=i(function(){e._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",t.track(this,["tooltip","showInstructions","_touch"])}return e(r.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}}),r}),i("Widgets/NavigationHelpButton/NavigationHelpButton",["../../Core/buildModuleUrl","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/FeatureDetection","../../ThirdParty/knockout","../getElement","./NavigationHelpButtonViewModel"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(i){var r=l(i.container),n=new u,o=t(i.instructionsInitiallyVisible,!1);n.showInstructions=o,n._svgPath="M16,1.466C7.973,1.466,1.466,7.973,1.466,16c0,8.027,6.507,14.534,14.534,14.534c8.027,0,14.534-6.507,14.534-14.534C30.534,7.973,24.027,1.466,16,1.466z M17.328,24.371h-2.707v-2.596h2.707V24.371zM17.328,19.003v0.858h-2.707v-1.057c0-3.19,3.63-3.696,3.63-5.963c0-1.034-0.924-1.826-2.134-1.826c-1.254,0-2.354,0.924-2.354,0.924l-1.541-1.915c0,0,1.519-1.584,4.137-1.584c2.487,0,4.796,1.54,4.796,4.136C21.156,16.208,17.328,16.627,17.328,19.003z";var c=document.createElement("span");c.className="cesium-navigationHelpButton-wrapper",r.appendChild(c);var h=document.createElement("button");h.type="button",h.className="cesium-button cesium-toolbar-button cesium-navigation-help-button",h.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }"),c.appendChild(h);var d=document.createElement("div");d.className="cesium-navigation-help",d.setAttribute("data-bind",'css: { "cesium-navigation-help-visible" : showInstructions}'),c.appendChild(d);var p=document.createElement("button");p.type="button",p.className="cesium-navigation-button cesium-navigation-button-left",p.setAttribute("data-bind",'click: showClick, css: {"cesium-navigation-button-selected": !_touch, "cesium-navigation-button-unselected": _touch}');var m=document.createElement("img");m.src=e("Widgets/Images/NavigationHelp/Mouse.svg"),m.className="cesium-navigation-button-icon",m.style.width="25px",m.style.height="25px",p.appendChild(m),p.appendChild(document.createTextNode("Mouse"));var f=document.createElement("button");f.type="button",f.className="cesium-navigation-button cesium-navigation-button-right",f.setAttribute("data-bind",'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}');var _=document.createElement("img");_.src=e("Widgets/Images/NavigationHelp/Touch.svg"),_.className="cesium-navigation-button-icon",_.style.width="25px",_.style.height="25px",f.appendChild(_),f.appendChild(document.createTextNode("Touch")),d.appendChild(p),d.appendChild(f);var g=document.createElement("div");g.className="cesium-click-navigation-help cesium-navigation-help-instructions",g.setAttribute("data-bind",'css: { "cesium-click-navigation-help-visible" : !_touch}'),g.innerHTML=' <table> <tr> <td><img src="'+e("Widgets/Images/NavigationHelp/MouseLeft.svg")+'" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">Left click + drag</div> </td> </tr> <tr> <td><img src="'+e("Widgets/Images/NavigationHelp/MouseRight.svg")+'" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Right click + drag, or</div> <div class="cesium-navigation-help-details">Mouse wheel scroll</div> </td> </tr> <tr> <td><img src="'+e("Widgets/Images/NavigationHelp/MouseMiddle.svg")+'" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Rotate view</div> <div class="cesium-navigation-help-details">Middle click + drag, or</div> <div class="cesium-navigation-help-details">CTRL + Left/Right click + drag</div> </td> </tr> </table>', -d.appendChild(g);var v=document.createElement("div");v.className="cesium-touch-navigation-help cesium-navigation-help-instructions",v.setAttribute("data-bind",'css: { "cesium-touch-navigation-help-visible" : _touch}'),v.innerHTML=' <table> <tr> <td><img src="'+e("Widgets/Images/NavigationHelp/TouchDrag.svg")+'" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">One finger drag</div> </td> </tr> <tr> <td><img src="'+e("Widgets/Images/NavigationHelp/TouchZoom.svg")+'" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Two finger pinch</div> </td> </tr> <tr> <td><img src="'+e("Widgets/Images/NavigationHelp/TouchTilt.svg")+'" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Tilt view</div> <div class="cesium-navigation-help-details">Two finger drag, same direction</div> </td> </tr> <tr> <td><img src="'+e("Widgets/Images/NavigationHelp/TouchRotate.svg")+'" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-tilt">Rotate view</div> <div class="cesium-navigation-help-details">Two finger drag, opposite direction</div> </td> </tr> </table>',d.appendChild(v),s.applyBindings(n,c),this._container=r,this._viewModel=n,this._wrapper=c,this._closeInstructions=function(e){c.contains(e.target)||(n.showInstructions=!1)},a.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}return r(c.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){return a.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeInstructions,!0):(document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0)),s.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),n(this)},c}),i("Widgets/PerformanceWatchdog/PerformanceWatchdogViewModel",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Scene/FrameRateMonitor","../../ThirdParty/knockout","../createCommand"],function(e,t,i,r,n,o,a,s){"use strict";function l(t){this._scene=t.scene,this.lowFrameRateMessage=e(t.lowFrameRateMessage,"This application appears to be performing poorly on your system. Please try using a different web browser or updating your video drivers."),this.lowFrameRateMessageDismissed=!1,this.showingLowFrameRateMessage=!1,a.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);var i=this;this._dismissMessage=s(function(){i.showingLowFrameRateMessage=!1,i.lowFrameRateMessageDismissed=!0});var r=o.fromScene(t.scene);this._unsubscribeLowFrameRate=r.lowFrameRate.addEventListener(function(){i.lowFrameRateMessageDismissed||(i.showingLowFrameRateMessage=!0)}),this._unsubscribeNominalFrameRate=r.nominalFrameRate.addEventListener(function(){i.showingLowFrameRateMessage=!1})}return i(l.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}}),l.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),r(this)},l}),i("Widgets/PerformanceWatchdog/PerformanceWatchdog",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./PerformanceWatchdogViewModel"],function(e,t,i,r,n,o,a){"use strict";function s(e){var t=o(e.container),i=new a(e),r=document.createElement("div");r.className="cesium-performance-watchdog-message-area",r.setAttribute("data-bind","visible: showingLowFrameRateMessage");var s=document.createElement("button");s.setAttribute("type","button"),s.className="cesium-performance-watchdog-message-dismiss",s.innerHTML="×",s.setAttribute("data-bind","click: dismissMessage"),r.appendChild(s);var l=document.createElement("div");l.className="cesium-performance-watchdog-message",l.setAttribute("data-bind","html: lowFrameRateMessage"),r.appendChild(l),t.appendChild(r),n.applyBindings(i,r),this._container=t,this._viewModel=i,this._element=r}return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return this._viewModel.destroy(),n.cleanNode(this._element),this._container.removeChild(this._element),i(this)},s}),i("Widgets/SceneModePicker/SceneModePickerViewModel",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/EventHelper","../../Scene/SceneMode","../../ThirdParty/knockout","../createCommand"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(t,i){this._scene=t;var r=this,n=function(e,t,i,n){r.sceneMode=i,r.dropDownVisible=!1};this._eventHelper=new o,this._eventHelper.add(t.morphStart,n),this._duration=e(i,2),this.sceneMode=t.mode,this.dropDownVisible=!1,this.tooltip2D="2D",this.tooltip3D="3D",this.tooltipColumbusView="Columbus View",s.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,s.defineProperty(this,"selectedTooltip",function(){var e=r.sceneMode;return e===a.SCENE2D?r.tooltip2D:e===a.SCENE3D?r.tooltip3D:r.tooltipColumbusView}),this._toggleDropDown=l(function(){r.dropDownVisible=!r.dropDownVisible}),this._morphTo2D=l(function(){t.morphTo2D(r._duration)}),this._morphTo3D=l(function(){t.morphTo3D(r._duration)}),this._morphToColumbusView=l(function(){t.morphToColumbusView(r._duration)}),this._sceneMode=a}return i(u.prototype,{scene:{get:function(){return this._scene}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}},toggleDropDown:{get:function(){return this._toggleDropDown}},morphTo2D:{get:function(){return this._morphTo2D}},morphTo3D:{get:function(){return this._morphTo3D}},morphToColumbusView:{get:function(){return this._morphToColumbusView}}}),u.prototype.isDestroyed=function(){return!1},u.prototype.destroy=function(){this._eventHelper.removeAll(),r(this)},u}),i("Widgets/SceneModePicker/SceneModePicker",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/FeatureDetection","../../ThirdParty/knockout","../getElement","./SceneModePickerViewModel"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,t,i){e=a(e);var r=new s(t,i);r._globePath=u,r._flatMapPath=c,r._columbusViewPath=h;var l=document.createElement("span");l.className="cesium-sceneModePicker-wrapper cesium-toolbar-button",e.appendChild(l);var d=document.createElement("button");d.type="button",d.className="cesium-button cesium-toolbar-button",d.setAttribute("data-bind",'css: { "cesium-sceneModePicker-button2D": sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-button3D": sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-buttonColumbusView": sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),d.innerHTML='<!-- ko cesiumSvgPath: { path: _globePath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon3D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon2D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-iconColumbusView" } --><!-- /ko -->',l.appendChild(d);var p=document.createElement("button");p.type="button",p.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",p.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE3D)) || (!dropDownVisible && (sceneMode === _sceneMode.SCENE3D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip3D },click: morphTo3D,cesiumSvgPath: { path: _globePath, width: 64, height: 64 }'),l.appendChild(p);var m=document.createElement("button");m.type="button",m.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",m.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE2D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip2D },click: morphTo2D,cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64 }'),l.appendChild(m);var f=document.createElement("button");f.type="button",f.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",f.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.COLUMBUS_VIEW)) || (!dropDownVisible && (sceneMode === _sceneMode.COLUMBUS_VIEW)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-hidden" : !dropDownVisible},attr: { title: tooltipColumbusView },click: morphToColumbusView,cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64 }'),l.appendChild(f),o.applyBindings(r,l),this._viewModel=r,this._container=e,this._wrapper=l,this._closeDropDown=function(e){l.contains(e.target)||(r.dropDownVisible=!1)},n.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}var u="m 32.401392,4.9330437 c -7.087603,0 -14.096095,2.884602 -19.10793,7.8946843 -5.0118352,5.010083 -7.9296167,11.987468 -7.9296167,19.072999 0,7.085531 2.9177815,14.097848 7.9296167,19.107931 4.837653,4.835961 11.541408,7.631372 18.374354,7.82482 0.05712,0.01231 0.454119,0.139729 0.454119,0.139729 l 0.03493,-0.104797 c 0.08246,7.84e-4 0.162033,0.03493 0.244525,0.03493 0.08304,0 0.161515,-0.03414 0.244526,-0.03493 l 0.03493,0.104797 c 0,0 0.309474,-0.129487 0.349323,-0.139729 6.867765,-0.168094 13.582903,-2.965206 18.444218,-7.82482 2.558195,-2.5573 4.551081,-5.638134 5.903547,-8.977584 1.297191,-3.202966 2.02607,-6.661489 2.02607,-10.130347 0,-6.237309 -2.366261,-12.31219 -6.322734,-17.116794 -0.0034,-0.02316 0.0049,-0.04488 0,-0.06986 -0.01733,-0.08745 -0.104529,-0.278855 -0.104797,-0.279458 -5.31e-4,-0.0012 -0.522988,-0.628147 -0.523984,-0.62878 -3.47e-4,-2.2e-4 -0.133444,-0.03532 -0.244525,-0.06987 C 51.944299,13.447603 51.751076,13.104317 51.474391,12.827728 46.462556,7.8176457 39.488996,4.9330437 32.401392,4.9330437 z m -2.130866,3.5281554 0.104797,9.6762289 c -4.111695,-0.08361 -7.109829,-0.423664 -9.257041,-0.943171 1.198093,-2.269271 2.524531,-4.124404 3.91241,-5.414496 2.167498,-2.0147811 3.950145,-2.8540169 5.239834,-3.3185619 z m 2.794579,0 c 1.280302,0.4754953 3.022186,1.3285948 5.065173,3.2486979 1.424667,1.338973 2.788862,3.303645 3.982275,5.728886 -2.29082,0.403367 -5.381258,0.621049 -8.942651,0.698645 L 33.065105,8.4611991 z m 5.728886,0.2445256 c 4.004072,1.1230822 7.793098,3.1481363 10.724195,6.0782083 0.03468,0.03466 0.07033,0.06991 0.104797,0.104797 -0.45375,0.313891 -0.923054,0.663002 -1.956205,1.082899 -0.647388,0.263114 -1.906242,0.477396 -2.829511,0.733577 -1.382296,-2.988132 -3.027146,-5.368585 -4.785716,-7.0213781 -0.422866,-0.397432 -0.835818,-0.6453247 -1.25756,-0.9781032 z m -15.33525,0.7685092 c -0.106753,0.09503 -0.207753,0.145402 -0.31439,0.244526 -1.684973,1.5662541 -3.298068,3.8232211 -4.680919,6.5672591 -0.343797,-0.14942 -1.035052,-0.273198 -1.292493,-0.419186 -0.956528,-0.542427 -1.362964,-1.022024 -1.537018,-1.292493 -0.0241,-0.03745 -0.01868,-0.0401 -0.03493,-0.06986 2.250095,-2.163342 4.948824,-3.869984 7.859752,-5.0302421 z m -9.641296,7.0912431 c 0.464973,0.571618 0.937729,1.169056 1.956205,1.746612 0.349907,0.198425 1.107143,0.335404 1.537018,0.523983 -1.20166,3.172984 -1.998037,7.051901 -2.165798,11.772162 C 14.256557,30.361384 12.934823,30.161483 12.280427,29.90959 10.644437,29.279855 9.6888882,28.674891 9.1714586,28.267775 8.6540289,27.860658 8.6474751,27.778724 8.6474751,27.778724 l -0.069864,0.03493 C 9.3100294,23.691285 11.163248,19.798527 13.817445,16.565477 z m 37.552149,0.523984 c 2.548924,3.289983 4.265057,7.202594 4.890513,11.318043 -0.650428,0.410896 -1.756876,1.001936 -3.563088,1.606882 -1.171552,0.392383 -3.163859,0.759153 -4.960377,1.117832 -0.04367,-4.752703 -0.784809,-8.591423 -1.88634,-11.807094 0.917574,-0.263678 2.170552,-0.486495 2.864443,-0.76851 1.274693,-0.518066 2.003942,-1.001558 2.654849,-1.467153 z m -31.439008,2.619917 c 2.487341,0.672766 5.775813,1.137775 10.479669,1.222628 l 0.104797,10.689263 0,0.03493 0,0.733577 c -5.435005,-0.09059 -9.512219,-0.519044 -12.610536,-1.117831 0.106127,-4.776683 0.879334,-8.55791 2.02607,-11.562569 z m 23.264866,0.31439 c 1.073459,3.067541 1.833795,6.821314 1.816476,11.702298 -3.054474,0.423245 -7.062018,0.648559 -11.702298,0.698644 l 0,-0.838373 -0.104796,-10.654331 c 4.082416,-0.0864 7.404468,-0.403886 9.990618,-0.908238 z M 8.2632205,30.922625 c 0.7558676,0.510548 1.5529563,1.013339 3.0041715,1.57195 0.937518,0.360875 2.612202,0.647642 3.91241,0.978102 0.112814,3.85566 0.703989,7.107756 1.606883,9.920754 -1.147172,-0.324262 -2.644553,-0.640648 -3.423359,-0.978102 -1.516688,-0.657177 -2.386627,-1.287332 -2.864443,-1.71168 -0.477816,-0.424347 -0.489051,-0.489051 -0.489051,-0.489051 L 9.8002387,40.319395 C 8.791691,37.621767 8.1584238,34.769583 8.1584238,31.900727 c 0,-0.330153 0.090589,-0.648169 0.1047967,-0.978102 z m 48.2763445,0.419186 c 0.0047,0.188973 0.06986,0.36991 0.06986,0.558916 0,2.938869 -0.620228,5.873558 -1.676747,8.628261 -0.07435,0.07583 -0.06552,0.07411 -0.454119,0.349323 -0.606965,0.429857 -1.631665,1.042044 -3.318562,1.676747 -1.208528,0.454713 -3.204964,0.850894 -5.135038,1.25756 0.84593,-2.765726 1.41808,-6.005357 1.606883,-9.815957 2.232369,-0.413371 4.483758,-0.840201 5.938479,-1.327425 1.410632,-0.472457 2.153108,-0.89469 2.96924,-1.327425 z m -38.530252,2.864443 c 3.208141,0.56697 7.372279,0.898588 12.575603,0.978103 l 0.174662,9.885821 c -4.392517,-0.06139 -8.106722,-0.320566 -10.863925,-0.803441 -1.051954,-2.664695 -1.692909,-6.043794 -1.88634,-10.060483 z m 26.793022,0.31439 c -0.246298,3.923551 -0.877762,7.263679 -1.816476,9.885822 -2.561957,0.361954 -5.766249,0.560708 -9.431703,0.62878 l -0.174661,-9.815957 c 4.491734,-0.04969 8.334769,-0.293032 11.42284,-0.698645 z M 12.035901,44.860585 c 0.09977,0.04523 0.105535,0.09465 0.209594,0.139729 1.337656,0.579602 3.441099,1.058072 5.589157,1.537018 1.545042,3.399208 3.548524,5.969402 5.589157,7.789888 -3.034411,-1.215537 -5.871615,-3.007978 -8.174142,-5.309699 -1.245911,-1.245475 -2.271794,-2.662961 -3.213766,-4.156936 z m 40.69605,0 c -0.941972,1.493975 -1.967855,2.911461 -3.213765,4.156936 -2.74253,2.741571 -6.244106,4.696717 -9.955686,5.868615 0.261347,-0.241079 0.507495,-0.394491 0.768509,-0.663713 1.674841,-1.727516 3.320792,-4.181056 4.645987,-7.265904 2.962447,-0.503021 5.408965,-1.122293 7.161107,-1.781544 0.284034,-0.106865 0.337297,-0.207323 0.593848,-0.31439 z m -31.404076,2.305527 c 2.645807,0.376448 5.701178,0.649995 9.466635,0.698645 l 0.139729,7.789888 c -1.38739,-0.480844 -3.316218,-1.29837 -5.659022,-3.388427 -1.388822,-1.238993 -2.743668,-3.0113 -3.947342,-5.100106 z m 20.365491,0.104797 c -1.04872,2.041937 -2.174337,3.779068 -3.353494,4.995309 -1.853177,1.911459 -3.425515,2.82679 -4.611055,3.353494 l -0.139729,-7.789887 c 3.13091,-0.05714 5.728238,-0.278725 8.104278,-0.558916 z",c="m 2.9825053,17.550598 0,1.368113 0,26.267766 0,1.368113 1.36811,0 54.9981397,0 1.36811,0 0,-1.368113 0,-26.267766 0,-1.368113 -1.36811,0 -54.9981397,0 -1.36811,0 z m 2.73623,2.736226 10.3292497,0 0,10.466063 -10.3292497,0 0,-10.466063 z m 13.0654697,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 10.32926,0 0,10.466063 -10.32926,0 0,-10.466063 z m -41.9326497,13.202288 10.3292497,0 0,10.329252 -10.3292497,0 0,-10.329252 z m 13.0654697,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 10.32926,0 0,10.329252 -10.32926,0 0,-10.329252 z",h="m 14.723969,17.675598 -0.340489,0.817175 -11.1680536,26.183638 -0.817175,1.872692 2.076986,0 54.7506996,0 2.07698,0 -0.81717,-1.872692 -11.16805,-26.183638 -0.34049,-0.817175 -0.91933,0 -32.414586,0 -0.919322,0 z m 1.838643,2.723916 6.196908,0 -2.928209,10.418977 -7.729111,0 4.460412,-10.418977 z m 9.02297,0 4.903049,0 0,10.418977 -7.831258,0 2.928209,-10.418977 z m 7.626964,0 5.584031,0 2.62176,10.418977 -8.205791,0 0,-10.418977 z m 8.410081,0 5.51593,0 4.46042,10.418977 -7.38863,0 -2.58772,-10.418977 z m -30.678091,13.142892 8.103649,0 -2.89416,10.282782 -9.6018026,0 4.3923136,-10.282782 z m 10.929711,0 8.614384,0 0,10.282782 -11.508544,0 2.89416,-10.282782 z m 11.338299,0 8.852721,0 2.58772,10.282782 -11.440441,0 0,-10.282782 z m 11.678781,0 7.86531,0 4.39231,10.282782 -9.6699,0 -2.58772,-10.282782 z";return t(l.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return this._viewModel.destroy(),n.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),o.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),i(this)},l}),i("Widgets/SelectionIndicator/SelectionIndicatorViewModel",["../../Core/Cartesian2","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/EasingFunction","../../Scene/SceneTransforms","../../ThirdParty/knockout"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,r,n){this._scene=e,this._screenPositionX=c,this._screenPositionY=c,this._tweens=e.tweens,this._container=t(n,document.body),this._selectionIndicatorElement=r,this._scale=1,this.position=void 0,this.showSelection=!1,s.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void 0,s.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&i(this.position)}}),s.defineProperty(this,"_transform",{get:function(){return"scale("+this._scale+")"}}),this.computeScreenSpacePosition=function(t,i){return a.wgs84ToWindowCoordinates(e,t,i)}}var u=new e,c="-1000px";return l.prototype.update=function(){if(this.showSelection&&i(this.position)){var e=this.computeScreenSpacePosition(this.position,u);if(i(e)){var t=this._container,r=t.parentNode.clientWidth,n=t.parentNode.clientHeight,o=this._selectionIndicatorElement.clientWidth,a=.5*o;e.x=Math.min(Math.max(e.x,-o),r+o)-a,e.y=Math.min(Math.max(e.y,-o),n+o)-a,this._screenPositionX=Math.floor(e.x+.25)+"px",this._screenPositionY=Math.floor(e.y+.25)+"px"}else this._screenPositionX=c,this._screenPositionY=c}},l.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:o.EXPONENTIAL_OUT})},l.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:o.EXPONENTIAL_OUT})},r(l.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}}),l}),i("Widgets/SelectionIndicator/SelectionIndicator",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./SelectionIndicatorViewModel"],function(e,t,i,r,n,o,a){"use strict";function s(e,t){e=o(e),this._container=e;var i=document.createElement("div");i.className="cesium-selection-wrapper",i.setAttribute("data-bind",'style: { "top" : _screenPositionY, "left" : _screenPositionX },css: { "cesium-selection-wrapper-visible" : isVisible }'),e.appendChild(i),this._element=i;var r="http://www.w3.org/2000/svg",s="M -34 -34 L -34 -11.25 L -30 -15.25 L -30 -30 L -15.25 -30 L -11.25 -34 L -34 -34 z M 11.25 -34 L 15.25 -30 L 30 -30 L 30 -15.25 L 34 -11.25 L 34 -34 L 11.25 -34 z M -34 11.25 L -34 34 L -11.25 34 L -15.25 30 L -30 30 L -30 15.25 L -34 11.25 z M 34 11.25 L 30 15.25 L 30 30 L 15.25 30 L 11.25 34 L 34 34 L 34 11.25 z",l=document.createElementNS(r,"svg:svg");l.setAttribute("width",160),l.setAttribute("height",160),l.setAttribute("viewBox","0 0 160 160");var u=document.createElementNS(r,"g");u.setAttribute("transform","translate(80,80)"),l.appendChild(u);var c=document.createElementNS(r,"path");c.setAttribute("data-bind","attr: { transform: _transform }"),c.setAttribute("d",s),u.appendChild(c),i.appendChild(l);var h=new a(t,this._element,this._container);this._viewModel=h,n.applyBindings(this._viewModel,this._element)}return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){var e=this._container;return n.cleanNode(this._element),e.removeChild(this._element),i(this)},s}),i("Widgets/Timeline/TimelineHighlightRange",["../../Core/defaultValue","../../Core/JulianDate"],function(e,t){"use strict";function i(t,i,r){this._color=t,this._height=i,this._base=e(r,0)}return i.prototype.getHeight=function(){return this._height},i.prototype.getBase=function(){return this._base},i.prototype.getStartTime=function(){return this._start},i.prototype.getStopTime=function(){return this._stop},i.prototype.setRange=function(e,t){this._start=e,this._stop=t},i.prototype.render=function(e){var i="";if(this._start&&this._stop&&this._color){var r=t.secondsDifference(this._start,e.epochJulian),n=Math.round(e.timeBarWidth*e.getAlpha(r)),o=t.secondsDifference(this._stop,e.epochJulian),a=Math.round(e.timeBarWidth*e.getAlpha(o))-n;n<0&&(a+=n,n=0),n+a>e.timeBarWidth&&(a=e.timeBarWidth-n),a>0&&(i='<span class="cesium-timeline-highlight" style="left: '+n.toString()+"px; width: "+a.toString()+"px; bottom: "+this._base.toString()+"px; height: "+this._height+"px; background-color: "+this._color+';"></span>')}return i},i}),i("Widgets/Timeline/TimelineTrack",["../../Core/Color","../../Core/defined","../../Core/JulianDate"],function(e,t,i){"use strict";function r(t,i,r,n){this.interval=t,this.height=i,this.color=r||new e(.5,.5,.5,1),this.backgroundColor=n||new e(0,0,0,0)}return r.prototype.render=function(e,r){var n=this.interval.start,o=this.interval.stop,a=r.startJulian,s=i.addSeconds(r.startJulian,r.duration,new i);if(i.lessThan(n,a)&&i.greaterThan(o,s))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,r.y,r.timeBarWidth,this.height);else if(i.lessThanOrEquals(n,s)&&i.greaterThanOrEquals(o,a)){var l,u,c;for(l=0;l<r.timeBarWidth;++l){var h=i.addSeconds(r.startJulian,l/r.timeBarWidth*r.duration,new i);!t(u)&&i.greaterThanOrEquals(h,n)?u=l:!t(c)&&i.greaterThanOrEquals(h,o)&&(c=l)}e.fillStyle=this.backgroundColor.toCssColorString(),e.fillRect(0,r.y,r.timeBarWidth,this.height),t(u)&&(t(c)||(c=r.timeBarWidth),e.fillStyle=this.color.toCssColorString(),e.fillRect(u,r.y,Math.max(c-u,1),this.height))}},r}),i("Widgets/Timeline/Timeline",["../../Core/ClockRange","../../Core/defined","../../Core/destroyObject","../../Core/DeveloperError","../../Core/JulianDate","../getElement","./TimelineHighlightRange","./TimelineTrack"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,t){e=o(e),this.container=e;var i=document.createElement("div");i.className="cesium-timeline-main",e.appendChild(i),this._topDiv=i,this._endJulian=void 0,this._epochJulian=void 0,this._lastXPos=void 0,this._scrubElement=void 0,this._startJulian=void 0,this._timeBarSecondsSpan=void 0,this._clock=t,this._scrubJulian=t.currentTime,this._mainTicSpan=-1,this._mouseMode=v.none,this._touchMode=y.none,this._touchState={centerX:0,spanX:0},this._mouseX=0,this._timelineDrag=0,this._timelineDragLocation=void 0,this._lastHeight=void 0,this._lastWidth=void 0,this._topDiv.innerHTML='<div class="cesium-timeline-bar"></div><div class="cesium-timeline-trackContainer"><canvas class="cesium-timeline-tracks" width="10" height="1"></canvas></div><div class="cesium-timeline-needle"></div><span class="cesium-timeline-ruler"></span>',this._timeBarEle=this._topDiv.childNodes[0],this._trackContainer=this._topDiv.childNodes[1],this._trackListEle=this._topDiv.childNodes[1].childNodes[0],this._needleEle=this._topDiv.childNodes[2],this._rulerEle=this._topDiv.childNodes[3],this._context=this._trackListEle.getContext("2d"),this._trackList=[],this._highlightRanges=[],this.zoomTo(t.startTime,t.stopTime),this._onMouseDown=c(this),this._onMouseUp=h(this),this._onMouseMove=d(this),this._onMouseWheel=p(this),this._onTouchStart=m(this),this._onTouchMove=_(this),this._onTouchEnd=f(this);var r=this._timeBarEle;document.addEventListener("mouseup",this._onMouseUp,!1),document.addEventListener("mousemove",this._onMouseMove,!1),r.addEventListener("mousedown",this._onMouseDown,!1),r.addEventListener("DOMMouseScroll",this._onMouseWheel,!1),r.addEventListener("mousewheel",this._onMouseWheel,!1),r.addEventListener("touchstart",this._onTouchStart,!1),r.addEventListener("touchmove",this._onTouchMove,!1),r.addEventListener("touchend",this._onTouchEnd,!1),r.addEventListener("touchcancel",this._onTouchEnd,!1),this._topDiv.oncontextmenu=function(){return!1},t.onTick.addEventListener(this.updateFromClock,this),this.updateFromClock()}function u(e){return e<10?"0"+e.toString():e.toString()}function c(e){return function(t){e._mouseMode!==v.touchOnly&&(0===t.button?(e._mouseMode=v.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,2===t.button?e._mouseMode=v.zoom:e._mouseMode=v.slide)),t.preventDefault()}}function h(e){return function(t){e._mouseMode=v.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function d(e){return function(t){var i;if(e._mouseMode===v.scrub){t.preventDefault();var r=t.clientX-e._topDiv.getBoundingClientRect().left;r<0?(e._timelineDragLocation=0,e._timelineDrag=-.01*e._timeBarSecondsSpan):r>e._topDiv.clientWidth?(e._timelineDragLocation=e._topDiv.clientWidth,e._timelineDrag=.01*e._timeBarSecondsSpan):(e._timelineDragLocation=void 0,e._setTimeBarTime(r,r*e._timeBarSecondsSpan/e._topDiv.clientWidth))}else if(e._mouseMode===v.slide){if(i=e._mouseX-t.clientX,e._mouseX=t.clientX,0!==i){var o=i*e._timeBarSecondsSpan/e._topDiv.clientWidth;e.zoomTo(n.addSeconds(e._startJulian,o,new n),n.addSeconds(e._endJulian,o,new n))}}else e._mouseMode===v.zoom&&(i=e._mouseX-t.clientX,e._mouseX=t.clientX,0!==i&&e.zoomFrom(Math.pow(1.01,i)))}}function p(e){return function(t){var i=t.wheelDeltaY||t.wheelDelta||-t.detail;g=Math.max(Math.min(Math.abs(i),g),1),i/=g,e.zoomFrom(Math.pow(1.05,-i))}}function m(e){return function(t){var i,r,o=t.touches.length,a=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=v.touchOnly,1===o?(i=n.secondsDifference(e._scrubJulian,e._startJulian),r=Math.round(i*e._topDiv.clientWidth/e._timeBarSecondsSpan+a),Math.abs(t.touches[0].clientX-r)<50?(e._touchMode=y.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=1===o?"-16px 0":"0 0")):(e._touchMode=y.singleTap,e._touchState.centerX=t.touches[0].clientX-a)):2===o?(e._touchMode=y.slideZoom,e._touchState.centerX=.5*(t.touches[0].clientX+t.touches[1].clientX)-a,e._touchState.spanX=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):e._touchMode=y.ignore}}function f(e){return function(t){var i=t.touches.length,r=e._topDiv.getBoundingClientRect().left;e._touchMode===y.singleTap?(e._touchMode=y.scrub,e._onTouchMove(t)):e._touchMode===y.scrub&&e._onTouchMove(t),e._mouseMode=v.touchOnly,1!==i?e._touchMode=i>0?y.ignore:y.none:e._touchMode===y.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-r),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function _(e){return function(i){var r,o,a,s,l,u,c=1,h=e._topDiv.getBoundingClientRect().left;e._touchMode===y.singleTap&&(e._touchMode=y.slideZoom),e._mouseMode=v.touchOnly,e._touchMode===y.scrub?(i.preventDefault(),1===i.changedTouches.length&&(o=i.changedTouches[0].clientX-h,o>=0&&o<=e._topDiv.clientWidth&&e._setTimeBarTime(o,o*e._timeBarSecondsSpan/e._topDiv.clientWidth))):e._touchMode===y.slideZoom&&(a=i.touches.length,2===a?(s=.5*(i.touches[0].clientX+i.touches[1].clientX)-h,l=Math.abs(i.touches[0].clientX-i.touches[1].clientX)):1===a&&(s=i.touches[0].clientX-h,l=0),t(s)&&(l>0&&e._touchState.spanX>0?(c=e._touchState.spanX/l,u=n.addSeconds(e._startJulian,(e._touchState.centerX*e._timeBarSecondsSpan-s*e._timeBarSecondsSpan*c)/e._topDiv.clientWidth,new n)):(r=e._touchState.centerX-s,u=n.addSeconds(e._startJulian,r*e._timeBarSecondsSpan/e._topDiv.clientWidth,new n)),e.zoomTo(u,n.addSeconds(u,e._timeBarSecondsSpan*c,new n)),e._touchState.centerX=s,e._touchState.spanX=l))}}var g=1e12,v={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},y={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},C=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800,1296e3,2592e3,5184e3,7776e3,15552e3,31536e3,63072e3,126144e3,15768e4,31536e4,63072e4,126144e4,15768e5,31536e5,63072e5,126144e5,15768e6,31536e6],w=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];return l.prototype.addEventListener=function(e,t,i){this._topDiv.addEventListener(e,t,i)},l.prototype.removeEventListener=function(e,t,i){this._topDiv.removeEventListener(e,t,i)},l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){this._clock.onTick.removeEventListener(this.updateFromClock,this),document.removeEventListener("mouseup",this._onMouseUp,!1),document.removeEventListener("mousemove",this._onMouseMove,!1);var e=this._timeBarEle;e.removeEventListener("mousedown",this._onMouseDown,!1),e.removeEventListener("DOMMouseScroll",this._onMouseWheel,!1),e.removeEventListener("mousewheel",this._onMouseWheel,!1),e.removeEventListener("touchstart",this._onTouchStart,!1),e.removeEventListener("touchmove",this._onTouchMove,!1),e.removeEventListener("touchend",this._onTouchEnd,!1),e.removeEventListener("touchcancel",this._onTouchEnd,!1),this.container.removeChild(this._topDiv),i(this)},l.prototype.addHighlightRange=function(e,t,i){var r=new a(e,t,i);return this._highlightRanges.push(r),this.resize(),r},l.prototype.addTrack=function(e,t,i,r){var n=new s(e,t,i,r);return this._trackList.push(n),this._lastHeight=void 0,this.resize(),n},l.prototype.zoomTo=function(t,i){if(this._startJulian=t,this._endJulian=i,this._timeBarSecondsSpan=n.secondsDifference(i,t), -this._clock&&this._clock.clockRange!==e.UNBOUNDED){var r=this._clock.startTime,o=this._clock.stopTime,a=n.secondsDifference(o,r),s=n.secondsDifference(r,this._startJulian),l=n.secondsDifference(o,this._endJulian);this._timeBarSecondsSpan>=a?(this._timeBarSecondsSpan=a,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):s>0?(this._endJulian=n.addSeconds(this._endJulian,s,new n),this._startJulian=r,this._timeBarSecondsSpan=n.secondsDifference(this._endJulian,this._startJulian)):l<0&&(this._startJulian=n.addSeconds(this._startJulian,l,new n),this._endJulian=o,this._timeBarSecondsSpan=n.secondsDifference(this._endJulian,this._startJulian))}this._makeTics();var u=document.createEvent("Event");u.initEvent("setzoom",!0,!0),u.startJulian=this._startJulian,u.endJulian=this._endJulian,u.epochJulian=this._epochJulian,u.totalSpan=this._timeBarSecondsSpan,u.mainTicSpan=this._mainTicSpan,this._topDiv.dispatchEvent(u)},l.prototype.zoomFrom=function(e){var t=n.secondsDifference(this._scrubJulian,this._startJulian);e>1||t<0||t>this._timeBarSecondsSpan?t=.5*this._timeBarSecondsSpan:t+=t-.5*this._timeBarSecondsSpan;var i=this._timeBarSecondsSpan-t;this.zoomTo(n.addSeconds(this._startJulian,t-t*e,new n),n.addSeconds(this._endJulian,i*e-i,new n))},l.prototype.makeLabel=function(e){var t=n.toGregorianDate(e),i=t.millisecond,r=" UTC";if(i>0&&this._timeBarSecondsSpan<3600){for(r=Math.floor(i).toString();r.length<3;)r="0"+r;r="."+r}return w[t.month-1]+" "+t.day+" "+t.year+" "+u(t.hour)+":"+u(t.minute)+":"+u(t.second)+r},l.prototype.smallestTicInPixels=7,l.prototype._makeTics=function(){function e(e){return Math.floor(E/e)*e}function t(e,t){return Math.ceil(e/t+.5)*t}function i(e){return(e-E)/_}function r(e,t){return e-t*Math.round(e/t)}var o,a=this._timeBarEle,s=n.secondsDifference(this._scrubJulian,this._startJulian),l=Math.round(s*this._topDiv.clientWidth/this._timeBarSecondsSpan),u=l-8,c=this;this._needleEle.style.left=l.toString()+"px";var h="",d=.01,p=31536e6,m=1e-10,f=0,_=this._timeBarSecondsSpan;_<d?(_=d,this._timeBarSecondsSpan=d,this._endJulian=n.addSeconds(this._startJulian,d,new n)):_>p&&(_=p,this._timeBarSecondsSpan=p,this._endJulian=n.addSeconds(this._startJulian,p,new n));var g=this._timeBarEle.clientWidth;g<10&&(g=10);var v,y=this._startJulian,w=Math.min(_/g*1e-5,.4),S=n.toGregorianDate(y);v=_>31536e4?n.fromDate(new Date(Date.UTC(100*Math.floor(S.year/100),0))):_>31536e3?n.fromDate(new Date(Date.UTC(10*Math.floor(S.year/10),0))):_>86400?n.fromDate(new Date(Date.UTC(S.year,0))):n.fromDate(new Date(Date.UTC(S.year,S.month,S.day)));var E=n.secondsDifference(this._startJulian,n.addSeconds(v,w,new n)),b=E+_;this._epochJulian=v,this._rulerEle.innerHTML=this.makeLabel(n.addSeconds(this._endJulian,-d,new n));var T=this._rulerEle.offsetWidth+20;T<30&&(T=180);var x=f;f-=m;var A={startTime:E,startJulian:y,epochJulian:v,duration:_,timeBarWidth:g,getAlpha:i};this._highlightRanges.forEach(function(e){h+=e.render(A)});var P=0,D=0,M=0,I=T/g;I>1&&(I=1),I*=this._timeBarSecondsSpan;var R,O=-1,N=-1,L=C.length;for(R=0;R<L;++R){var B=C[R];if(++O,P=B,B>I&&B>f)break;N<0&&g*(B/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(N=O)}if(O>0){for(;O>0;)if(--O,Math.abs(r(P,C[O]))<1e-5){C[O]>=f&&(D=C[O]);break}if(N>=0)for(;N<O;){if(Math.abs(r(D,C[N]))<1e-5&&C[N]>=f){M=C[N];break}++N}}f=x,f>m&&M<1e-5&&Math.abs(f-P)>m&&(M=f,f<=P+m&&(D=0));var F,V=-999999;if(g*(M/this._timeBarSecondsSpan)>=3)for(o=e(M);o<=b;o=t(o,M))h+='<span class="cesium-timeline-ticTiny" style="left: '+Math.round(g*i(o)).toString()+'px;"></span>';if(g*(D/this._timeBarSecondsSpan)>=3)for(o=e(D);o<=b;o=t(o,D))h+='<span class="cesium-timeline-ticSub" style="left: '+Math.round(g*i(o)).toString()+'px;"></span>';if(g*(P/this._timeBarSecondsSpan)>=2){this._mainTicSpan=P,b+=P,o=e(P);for(var k=n.computeTaiMinusUtc(v);o<=b;){var z=n.addSeconds(y,o-E,new n);if(P>2.1){var U=n.computeTaiMinusUtc(z);Math.abs(U-k)>.1&&(o+=U-k,z=n.addSeconds(y,o-E,new n))}var G=Math.round(g*i(o)),W=this.makeLabel(z);this._rulerEle.innerHTML=W,F=this._rulerEle.offsetWidth,F<10&&(F=T);var H=G-(F/2-1);H>V?(V=H+F+5,h+='<span class="cesium-timeline-ticMain" style="left: '+G.toString()+'px;"></span><span class="cesium-timeline-ticLabel" style="left: '+H.toString()+'px;">'+W+"</span>"):h+='<span class="cesium-timeline-ticSub" style="left: '+G.toString()+'px;"></span>',o=t(o,P)}}else this._mainTicSpan=-1;h+='<span class="cesium-timeline-icon16" style="left:'+u+'px;bottom:0;background-position: 0 0;"></span>',a.innerHTML=h,this._scrubElement=a.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),A.y=0,this._trackList.forEach(function(e){e.render(c._context,A),A.y+=e.height})},l.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;var e=this._scrubElement;if(t(this._scrubElement)){var i=n.secondsDifference(this._scrubJulian,this._startJulian),r=Math.round(i*this._topDiv.clientWidth/this._timeBarSecondsSpan);this._lastXPos!==r&&(this._lastXPos=r,e.style.left=r-8+"px",this._needleEle.style.left=r+"px")}t(this._timelineDragLocation)&&(this._setTimeBarTime(this._timelineDragLocation,this._timelineDragLocation*this._timeBarSecondsSpan/this._topDiv.clientWidth),this.zoomTo(n.addSeconds(this._startJulian,this._timelineDrag,new n),n.addSeconds(this._endJulian,this._timelineDrag,new n)))},l.prototype._setTimeBarTime=function(e,t){if(e=Math.round(e),this._scrubJulian=n.addSeconds(this._startJulian,t,new n),this._scrubElement){var i=e-8;this._scrubElement.style.left=i.toString()+"px",this._needleEle.style.left=e.toString()+"px"}var r=document.createEvent("Event");r.initEvent("settime",!0,!0),r.clientX=e,r.timeSeconds=t,r.timeJulian=this._scrubJulian,r.clock=this._clock,this._topDiv.dispatchEvent(r)},l.prototype.resize=function(){var e=this.container.clientWidth,t=this.container.clientHeight;if(e!==this._lastWidth||t!==this._lastHeight){this._trackContainer.style.height=t+"px";var i=1;this._trackList.forEach(function(e){i+=e.height}),this._trackListEle.style.height=i.toString()+"px",this._trackListEle.width=this._trackListEle.clientWidth,this._trackListEle.height=i,this._makeTics(),this._lastXPos=void 0,this._lastWidth=e,this._lastHeight=t}},l}),i("Widgets/VRButton/VRButtonViewModel",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/Fullscreen","../../ThirdParty/knockout","../../ThirdParty/NoSleep","../createCommand","../getElement"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e){var i=!1,r=window.screen;return t(r)&&(t(r.lockOrientation)?i=r.lockOrientation(e):t(r.mozLockOrientation)?i=r.mozLockOrientation(e):t(r.msLockOrientation)?i=r.msLockOrientation(e):t(r.orientation&&r.orientation.lock)&&(i=r.orientation.lock(e))),i}function h(){var e=window.screen;t(e)&&(t(e.unlockOrientation)?e.unlockOrientation():t(e.mozUnlockOrientation)?e.mozUnlockOrientation():t(e.msUnlockOrientation)?e.msUnlockOrientation():t(e.orientation&&e.orientation.unlock)&&e.orientation.unlock())}function d(e,t,i){i()?(t.useWebVR=!1,e._locked&&(h(),e._locked=!1),e._noSleep.disable(),o.exitFullscreen(),i(!1)):(o.fullscreen||o.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=c("landscape")),t.useWebVR=!0,i(!0))}function p(t,i){var r=this,n=a.observable(o.enabled),c=a.observable(!1);this.isVRMode=void 0,a.defineProperty(this,"isVRMode",{get:function(){return c()}}),this.isVREnabled=void 0,a.defineProperty(this,"isVREnabled",{get:function(){return n()},set:function(e){n(e&&o.enabled)}}),this.tooltip=void 0,a.defineProperty(this,"tooltip",function(){return n()?c()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"}),this._locked=!1,this._noSleep=new s,this._command=l(function(){d(r,t,c)},a.getObservable(this,"isVREnabled")),this._vrElement=e(u(i),document.body),this._callback=function(){!o.fullscreen&&c()&&(t.useWebVR=!1,r._locked&&(h(),r._locked=!1),r._noSleep.disable(),c(!1))},document.addEventListener(o.changeEventName,this._callback)}return i(p.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}}),p.prototype.isDestroyed=function(){return!1},p.prototype.destroy=function(){r(this)},p}),i("Widgets/VRButton/VRButton",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./VRButtonViewModel"],function(e,t,i,r,n,o,a){"use strict";function s(e,t,i){e=o(e);var r=new a(t,i);r._exitVRPath=u,r._enterVRPath=l;var s=document.createElement("button");s.type="button",s.className="cesium-button cesium-vrButton",s.setAttribute("data-bind","attr: { title: tooltip },click: command,enable: isVREnabled,cesiumSvgPath: { path: isVRMode ? _exitVRPath : _enterVRPath, width: 32, height: 32 }"),e.appendChild(s),n.applyBindings(r,s),this._container=e,this._viewModel=r,this._element=s}var l="M 5.3125 6.375 C 4.008126 6.375 2.96875 7.4141499 2.96875 8.71875 L 2.96875 19.5 C 2.96875 20.8043 4.008126 21.875 5.3125 21.875 L 13.65625 21.875 C 13.71832 20.0547 14.845166 18.59375 16.21875 18.59375 C 17.592088 18.59375 18.71881 20.0552 18.78125 21.875 L 27.09375 21.875 C 28.398125 21.875 29.4375 20.8043 29.4375 19.5 L 29.4375 8.71875 C 29.4375 7.4141499 28.398125 6.375 27.09375 6.375 L 5.3125 6.375 z M 9.625 10.4375 C 11.55989 10.4375 13.125 12.03385 13.125 13.96875 C 13.125 15.90365 11.55989 17.46875 9.625 17.46875 C 7.69011 17.46875 6.125 15.90365 6.125 13.96875 C 6.125 12.03385 7.69011 10.4375 9.625 10.4375 z M 22.46875 10.4375 C 24.40364 10.4375 25.96875 12.03385 25.96875 13.96875 C 25.96875 15.90365 24.40364 17.46875 22.46875 17.46875 C 20.53386 17.46875 18.96875 15.90365 18.96875 13.96875 C 18.96875 12.03385 20.53386 10.4375 22.46875 10.4375 z",u="M 25.770585,2.4552065 C 15.72282,13.962707 10.699956,19.704407 8.1768352,22.580207 c -1.261561,1.4379 -1.902282,2.1427 -2.21875,2.5 -0.141624,0.1599 -0.208984,0.2355 -0.25,0.2813 l 0.6875,0.75 c 10e-5,-10e-5 0.679191,0.727 0.6875,0.7187 0.01662,-0.016 0.02451,-0.024 0.03125,-0.031 0.01348,-0.014 0.04013,-0.038 0.0625,-0.062 0.04474,-0.05 0.120921,-0.1315 0.28125,-0.3126 0.320657,-0.3619 0.956139,-1.0921 2.2187499,-2.5312 2.5252219,-2.8781 7.5454589,-8.6169 17.5937499,-20.1250005 l -1.5,-1.3125 z m -20.5624998,3.9063 c -1.304375,0 -2.34375,1.0391 -2.34375,2.3437 l 0,10.8125005 c 0,1.3043 1.039375,2.375 2.34375,2.375 l 2.25,0 c 1.9518039,-2.2246 7.4710958,-8.5584 13.5624998,-15.5312005 l -15.8124998,0 z m 21.1249998,0 c -1.855467,2.1245 -2.114296,2.4005 -3.59375,4.0936995 1.767282,0.1815 3.15625,1.685301 3.15625,3.500001 0,1.9349 -1.56511,3.5 -3.5,3.5 -1.658043,0 -3.043426,-1.1411 -3.40625,-2.6875 -1.089617,1.2461 -2.647139,2.9988 -3.46875,3.9375 0.191501,-0.062 0.388502,-0.094 0.59375,-0.094 1.373338,0 2.50006,1.4614 2.5625,3.2812 l 8.3125,0 c 1.304375,0 2.34375,-1.0707 2.34375,-2.375 l 0,-10.8125005 c 0,-1.3046 -1.039375,-2.3437 -2.34375,-2.3437 l -0.65625,0 z M 9.5518351,10.423906 c 1.9348899,0 3.4999999,1.596401 3.4999999,3.531301 0,1.9349 -1.56511,3.5 -3.4999999,3.5 -1.9348899,0 -3.4999999,-1.5651 -3.4999999,-3.5 0,-1.9349 1.56511,-3.531301 3.4999999,-3.531301 z m 4.2187499,10.312601 c -0.206517,0.2356 -0.844218,0.9428 -1.03125,1.1562 l 0.8125,0 c 0.01392,-0.4081 0.107026,-0.7968 0.21875,-1.1562 z";return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return this._viewModel.destroy(),n.cleanNode(this._element),this._container.removeChild(this._element),i(this)},s}),i("Widgets/Viewer/Viewer",["../../Core/BoundingSphere","../../Core/Cartesian3","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/EventHelper","../../Core/isArray","../../Core/Matrix4","../../Core/Rectangle","../../Core/ScreenSpaceEventType","../../DataSources/BoundingSphereState","../../DataSources/ConstantPositionProperty","../../DataSources/DataSourceCollection","../../DataSources/DataSourceDisplay","../../DataSources/Entity","../../DataSources/EntityView","../../DataSources/Property","../../Scene/ImageryLayer","../../Scene/SceneMode","../../ThirdParty/knockout","../../ThirdParty/when","../Animation/Animation","../Animation/AnimationViewModel","../BaseLayerPicker/BaseLayerPicker","../BaseLayerPicker/createDefaultImageryProviderViewModels","../BaseLayerPicker/createDefaultTerrainProviderViewModels","../CesiumWidget/CesiumWidget","../ClockViewModel","../FullscreenButton/FullscreenButton","../Geocoder/Geocoder","../getElement","../HomeButton/HomeButton","../InfoBox/InfoBox","../NavigationHelpButton/NavigationHelpButton","../SceneModePicker/SceneModePicker","../SelectionIndicator/SelectionIndicator","../subscribeAndEvaluate","../Timeline/Timeline","../VRButton/VRButton"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I,R,O,N,L,B,F,V,k,z){"use strict";function U(e){var t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function G(e,t){var n=e.scene.pick(t.position);if(r(n)){var o=i(n.id,n.primitive.id);if(o instanceof _)return o}if(r(e.scene.globe))return H(e,t.position)}function W(e,t,i){if(r(i)){var n=i.clock;r(n)&&(n.getValue(t),r(e)&&(e.updateFromClock(),e.zoomTo(n.startTime,n.stopTime)))}}function H(e,t){var i=e.scene,n=i.camera.getPickRay(t),o=i.imageryLayers.pickImageryLayerFeatures(n,i);if(r(o)){var a=new _({id:"Loading...",description:"Loading feature information..."});return S(o,function(t){if(e.selectedEntity===a){if(!r(t)||0===t.length)return void(e.selectedEntity=q());var i=t[0],n=new _({id:i.name,description:i.description});if(r(i.position)){var o=e.scene.globe.ellipsoid.cartographicToCartesian(i.position,ee);n.position=new p(o)}e.selectedEntity=n}},function(){e.selectedEntity===a&&(e.selectedEntity=q())}),a}}function q(){return new _({id:"None",description:"No features found."})}function j(e,t){var i=e._geocoder,n=e._homeButton,o=e._sceneModePicker,a=e._baseLayerPicker,s=e._animation,l=e._timeline,u=e._fullscreenButton,c=e._infoBox,h=e._selectionIndicator,d=t?"hidden":"visible";if(r(i)&&(i.container.style.visibility=d),r(n)&&(n.container.style.visibility=d),r(o)&&(o.container.style.visibility=d),r(a)&&(a.container.style.visibility=d),r(s)&&(s.container.style.visibility=d),r(l)&&(l.container.style.visibility=d),r(u)&&u.viewModel.isFullscreenEnabled&&(u.container.style.visibility=d),r(c)&&(c.container.style.visibility=d),r(h)&&(h.container.style.visibility=d),e._container){var p=t||!r(u)?0:u.container.clientWidth;e._vrButton.container.style.right=p+"px",e.forceResize()}}function Y(e,t){function n(e){var t=G(l,e);r(t)&&(v.getValueOrUndefined(t.position,l.clock.currentTime)?l.trackedEntity=t:l.zoomTo(t))}function o(e){l.selectedEntity=G(l,e)}e=R(e),t=i(t,i.EMPTY_OBJECT);var a=!(r(t.globe)&&t.globe===!1||r(t.baseLayerPicker)&&t.baseLayerPicker===!1),l=this,u=document.createElement("div");u.className="cesium-viewer",e.appendChild(u);var c=document.createElement("div");c.className="cesium-viewer-cesiumWidgetContainer",u.appendChild(c);var d=document.createElement("div");d.className="cesium-viewer-bottom",u.appendChild(d);var p=i(t.scene3DOnly,!1),_=new P(c,{terrainProvider:t.terrainProvider,imageryProvider:!a&&t.imageryProvider,clock:t.clock,skyBox:t.skyBox,skyAtmosphere:t.skyAtmosphere,sceneMode:t.sceneMode,mapProjection:t.mapProjection,globe:t.globe,orderIndependentTranslucency:t.orderIndependentTranslucency,contextOptions:t.contextOptions,useDefaultRenderLoop:t.useDefaultRenderLoop,targetFrameRate:t.targetFrameRate,showRenderLoopErrors:t.showRenderLoopErrors,creditContainer:r(t.creditContainer)?t.creditContainer:d,scene3DOnly:p,terrainExaggeration:t.terrainExaggeration,shadows:t.shadows,terrainShadows:t.terrainShadows,mapMode2D:t.mapMode2D}),g=t.dataSources,y=!1;r(g)||(g=new m,y=!0);var C=new f({scene:_.scene,dataSourceCollection:g}),S=_.clock,W=new D(S),H=new s;H.add(S.onTick,Y.prototype._onTick,this),H.add(_.scene.morphStart,Y.prototype._clearTrackedObject,this);var q;if(!r(t.selectionIndicator)||t.selectionIndicator!==!1){var X=document.createElement("div");X.className="cesium-viewer-selectionIndicatorContainer",u.appendChild(X),q=new F(X,_.scene)}var Z;if(!r(t.infoBox)||t.infoBox!==!1){var K=document.createElement("div");K.className="cesium-viewer-infoBoxContainer",u.appendChild(K),Z=new N(K);var Q=Z.viewModel;H.add(Q.cameraClicked,Y.prototype._onInfoBoxCameraClicked,this),H.add(Q.closeClicked,Y.prototype._onInfoBoxClockClicked,this)}var J=document.createElement("div");J.className="cesium-viewer-toolbar",u.appendChild(J);var $;if(!r(t.geocoder)||t.geocoder!==!1){var ee=document.createElement("div");ee.className="cesium-viewer-geocoderContainer",J.appendChild(ee),$=new I({container:ee,scene:_.scene}),H.add($.viewModel.search.beforeExecute,Y.prototype._clearObjects,this)}var te;r(t.homeButton)&&t.homeButton===!1||(te=new O(J,_.scene),r($)&&H.add(te.viewModel.command.afterExecute,function(){var e=$.viewModel;e.searchText="",e.isSearchInProgress&&e.search()}),H.add(te.viewModel.command.beforeExecute,Y.prototype._clearTrackedObject,this));var ie;p||r(t.sceneModePicker)&&t.sceneModePicker===!1||(ie=new B(J,_.scene));var re,ne;if(a){var oe=i(t.imageryProviderViewModels,x()),ae=i(t.terrainProviderViewModels,A());re=new T(J,{globe:_.scene.globe,imageryProviderViewModels:oe,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:ae,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel});var se=J.getElementsByClassName("cesium-baseLayerPicker-dropDown");ne=se[0]}var le;if(!r(t.navigationHelpButton)||t.navigationHelpButton!==!1){var ue=!0;try{if(r(window.localStorage)){var ce=window.localStorage.getItem("cesium-hasSeenNavHelp");r(ce)&&Boolean(ce)?ue=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch(e){}le=new L({container:J,instructionsInitiallyVisible:i(t.navigationInstructionsInitiallyVisible,ue)})}var he;if(!r(t.animation)||t.animation!==!1){var de=document.createElement("div");de.className="cesium-viewer-animationContainer",u.appendChild(de),he=new E(de,new b(W))}var pe;if(!r(t.timeline)||t.timeline!==!1){var me=document.createElement("div");me.className="cesium-viewer-timelineContainer",u.appendChild(me),pe=new k(me,S),pe.addEventListener("settime",U,!1),pe.zoomTo(S.startTime,S.stopTime)}var fe,_e;if(!r(t.fullscreenButton)||t.fullscreenButton!==!1){var ge=document.createElement("div");ge.className="cesium-viewer-fullscreenContainer",u.appendChild(ge),fe=new M(ge,t.fullscreenElement),_e=V(fe.viewModel,"isFullscreenEnabled",function(e){ge.style.display=e?"block":"none",r(pe)&&(pe.container.style.right=ge.clientWidth+"px",pe.resize())})}var ve,ye,Ce;if(t.vrButton){var we=document.createElement("div");we.className="cesium-viewer-vrContainer",u.appendChild(we),ve=new z(we,_.scene,t.fullScreenElement),ye=V(ve.viewModel,"isVREnabled",function(e){we.style.display=e?"block":"none",r(fe)&&(we.style.right=ge.clientWidth+"px"),r(pe)&&(pe.container.style.right=we.clientWidth+"px",pe.resize())}),Ce=V(ve.viewModel,"isVRMode",function(e){j(l,e)})}this._baseLayerPickerDropDown=ne,this._fullscreenSubscription=_e,this._vrSubscription=ye,this._vrModeSubscription=Ce,this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=i(t.automaticallyTrackDataSourceClocks,!0),this._container=e,this._bottomContainer=d,this._element=u,this._cesiumWidget=_,this._selectionIndicator=q,this._infoBox=Z,this._dataSourceCollection=g,this._destroyDataSourceCollection=y,this._dataSourceDisplay=C,this._clockViewModel=W,this._toolbar=J,this._homeButton=te,this._sceneModePicker=ie,this._baseLayerPicker=re,this._navigationHelpButton=le,this._animation=he,this._timeline=pe,this._fullscreenButton=fe,this._vrButton=ve,this._geocoder=$,this._eventHelper=H,this._lastWidth=0,this._lastHeight=0,this._allowDataSourcesToSuspendAnimation=!0,this._entityView=void 0,this._enableInfoOrSelection=r(Z)||r(q),this._clockTrackedDataSource=void 0,this._trackedEntity=void 0,this._needTrackedEntityUpdate=!1,this._selectedEntity=void 0,this._clockTrackedDataSource=void 0,this._forceResize=!1,this._zoomIsFlight=!1,this._zoomTarget=void 0,this._zoomPromise=void 0,this._zoomOptions=void 0,w.track(this,["_trackedEntity","_selectedEntity","_clockTrackedDataSource"]),H.add(g.dataSourceAdded,Y.prototype._onDataSourceAdded,this),H.add(g.dataSourceRemoved,Y.prototype._onDataSourceRemoved,this),H.add(_.scene.preRender,Y.prototype.resize,this),H.add(_.scene.postRender,Y.prototype._postRender,this);for(var Se=g.length,Ee=0;Ee<Se;Ee++)this._dataSourceAdded(g,g.get(Ee));this._dataSourceAdded(void 0,C.defaultDataSource),H.add(g.dataSourceAdded,Y.prototype._dataSourceAdded,this),H.add(g.dataSourceRemoved,Y.prototype._dataSourceRemoved,this),_.screenSpaceEventHandler.setInputAction(o,h.LEFT_CLICK),_.screenSpaceEventHandler.setInputAction(n,h.LEFT_DOUBLE_CLICK)}function X(e,t,n,o){K(e);var a=S.defer();return e._zoomPromise=a,e._zoomIsFlight=o,e._zoomOptions=n,S(t,function(t){if(e._zoomPromise===a){if(t instanceof y)return void t.getViewableRectangle().then(function(t){e._zoomPromise===a&&(e._zoomTarget=t)});if(t.isLoading&&r(t.loadingEvent))var n=t.loadingEvent.addEventListener(function(){n(),e._zoomPromise===a&&(e._zoomTarget=t.entities.values.slice(0))});else{if(l(t))return void(e._zoomTarget=t.slice(0));t=i(t.values,t),r(t.entities)&&(t=t.entities.values),l(t)?e._zoomTarget=t.slice(0):e._zoomTarget=[t]}}}),a.promise}function Z(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function K(e){var t=e._zoomPromise;r(t)&&(Z(e),t.resolve(!1))}function Q(t){var n=t._zoomTarget;if(r(n)&&t.scene.mode!==C.MORPHING){var o=t.scene,a=o.camera,s=t._zoomPromise,l=i(t._zoomOptions,{});if(n instanceof c){var h={destination:n,duration:l.duration,maximumHeight:l.maximumHeight,complete:function(){s.resolve(!0)},cancel:function(){s.resolve(!1)}};return t._zoomIsFlight?a.flyTo(h):(a.setView(h),s.resolve(!0)),void Z(t)}for(var p=[],m=0,f=n.length;m<f;m++){var _=t._dataSourceDisplay.getBoundingSphere(n[m],!1,$);if(_===d.PENDING)return;_!==d.FAILED&&p.push(e.clone($))}if(0===p.length)return void K(t);t.trackedEntity=void 0;var g=e.fromBoundingSpheres(p),v=o.screenSpaceCameraController;v.minimumZoomDistance=Math.min(v.minimumZoomDistance,.5*g.radius),t._zoomIsFlight?(Z(t),a.flyToBoundingSphere(g,{duration:l.duration,maximumHeight:l.maximumHeight,complete:function(){s.resolve(!0)},cancel:function(){s.resolve(!1)},offset:l.offset})):(a.viewBoundingSphere(g,t._zoomOptions),a.lookAtTransform(u.IDENTITY),Z(t),s.resolve(!0))}}function J(e){if(e._needTrackedEntityUpdate){var t=e._trackedEntity,i=e.clock.currentTime,n=v.getValueOrUndefined(t.position,i);if(r(n)){var o=e.scene,a=e._dataSourceDisplay.getBoundingSphere(t,!1,$);if(a!==d.PENDING){var s=o.mode;s!==C.COLUMBUS_VIEW&&s!==C.SCENE2D||(o.screenSpaceCameraController.enableTranslate=!1),s!==C.COLUMBUS_VIEW&&s!==C.SCENE3D||(o.screenSpaceCameraController.enableTilt=!1);var l=a!==d.FAILED?$:void 0;e._entityView=new g(t,o,o.mapProjection.ellipsoid),e._entityView.update(i,l),e._needTrackedEntityUpdate=!1}}}}var $=new e,ee=new t;return n(Y.prototype,{container:{get:function(){return this._container}},bottomContainer:{get:function(){return this._bottomContainer}},cesiumWidget:{get:function(){return this._cesiumWidget}},selectionIndicator:{get:function(){return this._selectionIndicator}},infoBox:{get:function(){return this._infoBox}},geocoder:{get:function(){return this._geocoder}},homeButton:{get:function(){return this._homeButton}},sceneModePicker:{get:function(){return this._sceneModePicker}},baseLayerPicker:{get:function(){return this._baseLayerPicker}},navigationHelpButton:{get:function(){return this._navigationHelpButton}},animation:{get:function(){return this._animation}},timeline:{get:function(){return this._timeline}},fullscreenButton:{get:function(){return this._fullscreenButton}},vrButton:{get:function(){return this._vrButton}},dataSourceDisplay:{get:function(){return this._dataSourceDisplay}},entities:{get:function(){return this._dataSourceDisplay.defaultDataSource.entities}},dataSources:{get:function(){return this._dataSourceCollection}},canvas:{get:function(){return this._cesiumWidget.canvas}},cesiumLogo:{get:function(){return this._cesiumWidget.cesiumLogo}},scene:{get:function(){return this._cesiumWidget.scene}},shadows:{get:function(){return this.scene.shadowMap.enabled},set:function(e){this.scene.shadowMap.enabled=e}},terrainShadows:{get:function(){return this.scene.globe.shadows},set:function(e){this.scene.globe.shadows=e}},shadowMap:{get:function(){return this.scene.shadowMap}},imageryLayers:{get:function(){return this.scene.imageryLayers}},terrainProvider:{get:function(){return this.scene.terrainProvider},set:function(e){this.scene.terrainProvider=e}},camera:{get:function(){return this.scene.camera}},clock:{get:function(){return this._cesiumWidget.clock}},screenSpaceEventHandler:{get:function(){return this._cesiumWidget.screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._cesiumWidget.targetFrameRate},set:function(e){this._cesiumWidget.targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._cesiumWidget.useDefaultRenderLoop},set:function(e){this._cesiumWidget.useDefaultRenderLoop=e}},resolutionScale:{get:function(){return this._cesiumWidget.resolutionScale},set:function(e){this._cesiumWidget.resolutionScale=e,this._forceResize=!0}},allowDataSourcesToSuspendAnimation:{get:function(){return this._allowDataSourcesToSuspendAnimation},set:function(e){this._allowDataSourcesToSuspendAnimation=e}},trackedEntity:{get:function(){return this._trackedEntity},set:function(e){if(this._trackedEntity!==e){this._trackedEntity=e,K(this);var t=this.scene,i=t.mode;if(!r(e)||!r(e.position))return this._needTrackedEntityUpdate=!1,i!==C.COLUMBUS_VIEW&&i!==C.SCENE2D||(t.screenSpaceCameraController.enableTranslate=!0),i!==C.COLUMBUS_VIEW&&i!==C.SCENE3D||(t.screenSpaceCameraController.enableTilt=!0),this._entityView=void 0,void this.camera.lookAtTransform(u.IDENTITY);this._needTrackedEntityUpdate=!0}}},selectedEntity:{get:function(){return this._selectedEntity},set:function(e){if(this._selectedEntity!==e){this._selectedEntity=e;var t=r(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;r(e)?r(t)&&t.animateAppear():r(t)&&t.animateDepart()}}},clockTrackedDataSource:{get:function(){return this._clockTrackedDataSource},set:function(e){this._clockTrackedDataSource!==e&&(this._clockTrackedDataSource=e,W(this._timeline,this.clock,e))}}}),Y.prototype.extend=function(e,t){e(this,t)},Y.prototype.resize=function(){var e=this._cesiumWidget,t=this._container,i=t.clientWidth,n=t.clientHeight,o=r(this._animation),a=r(this._timeline);if(this._forceResize||i!==this._lastWidth||n!==this._lastHeight){e.resize(),this._forceResize=!1;var s=n-125,l=this._baseLayerPickerDropDown;r(l)&&(l.style.maxHeight=s+"px"),r(this._infoBox)&&(this._infoBox.viewModel.maxHeight=s);var u,c=this._timeline,h=0,d=0,p=0;if(o&&"hidden"!==window.getComputedStyle(this._animation.container).visibility){var m=this._lastWidth;u=this._animation.container,i>900?(h=169,m<=900&&(u.style.width="169px",u.style.height="112px",this._animation.resize())):i>=600?(h=136,(m<600||m>900)&&(u.style.width="136px",u.style.height="90px",this._animation.resize())):(h=106,(m>600||0===m)&&(u.style.width="106px",u.style.height="70px",this._animation.resize())),d=h+5}if(a&&"hidden"!==window.getComputedStyle(this._timeline.container).visibility){var f=this._fullscreenButton,_=this._vrButton,g=c.container,v=g.style;p=g.clientHeight+3,v.left=h+"px";var y=0;r(f)&&(y+=f.container.clientWidth),r(_)&&(y+=_.container.clientWidth),v.right=y+"px",c.resize()}this._bottomContainer.style.left=d+"px",this._bottomContainer.style.bottom=p+"px",this._lastWidth=i,this._lastHeight=n}},Y.prototype.forceResize=function(){this._lastWidth=0,this.resize()},Y.prototype.render=function(){this._cesiumWidget.render()},Y.prototype.isDestroyed=function(){return!1},Y.prototype.destroy=function(){var e;this.screenSpaceEventHandler.removeInputAction(h.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(h.LEFT_DOUBLE_CLICK);var t=this.dataSources,i=t.length;for(e=0;e<i;e++)this._dataSourceRemoved(t,t.get(e));return this._dataSourceRemoved(void 0,this._dataSourceDisplay.defaultDataSource),this._container.removeChild(this._element),this._element.removeChild(this._toolbar),this._eventHelper.removeAll(),r(this._geocoder)&&(this._geocoder=this._geocoder.destroy()),r(this._homeButton)&&(this._homeButton=this._homeButton.destroy()),r(this._sceneModePicker)&&(this._sceneModePicker=this._sceneModePicker.destroy()),r(this._baseLayerPicker)&&(this._baseLayerPicker=this._baseLayerPicker.destroy()),r(this._animation)&&(this._element.removeChild(this._animation.container),this._animation=this._animation.destroy()),r(this._timeline)&&(this._timeline.removeEventListener("settime",U,!1),this._element.removeChild(this._timeline.container),this._timeline=this._timeline.destroy()),r(this._fullscreenButton)&&(this._fullscreenSubscription.dispose(),this._element.removeChild(this._fullscreenButton.container),this._fullscreenButton=this._fullscreenButton.destroy()),r(this._vrButton)&&(this._vrSubscription.dispose(),this._vrModeSubscription.dispose(),this._element.removeChild(this._vrButton.container),this._vrButton=this._vrButton.destroy()),r(this._infoBox)&&(this._element.removeChild(this._infoBox.container),this._infoBox=this._infoBox.destroy()),r(this._selectionIndicator)&&(this._element.removeChild(this._selectionIndicator.container),this._selectionIndicator=this._selectionIndicator.destroy()),this._clockViewModel=this._clockViewModel.destroy(),this._dataSourceDisplay=this._dataSourceDisplay.destroy(),this._cesiumWidget=this._cesiumWidget.destroy(),this._destroyDataSourceCollection&&(this._dataSourceCollection=this._dataSourceCollection.destroy()),o(this)},Y.prototype._dataSourceAdded=function(e,t){var i=t.entities;i.collectionChanged.addEventListener(Y.prototype._onEntityCollectionChanged,this)},Y.prototype._dataSourceRemoved=function(e,t){var i=t.entities;i.collectionChanged.removeEventListener(Y.prototype._onEntityCollectionChanged,this),r(this.trackedEntity)&&i.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0),r(this.selectedEntity)&&i.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)},Y.prototype._onTick=function(e){var n=e.currentTime,o=this._dataSourceDisplay.update(n);this._allowDataSourcesToSuspendAnimation&&(this._clockViewModel.canAnimate=o);var a=this._entityView;if(r(a)){var s=this._trackedEntity,l=this._dataSourceDisplay.getBoundingSphere(s,!1,$);l===d.DONE&&a.update(n,$)}var u,c=!1,h=this.selectedEntity,p=r(h)&&this._enableInfoOrSelection;if(p&&h.isShowing&&h.isAvailable(n)){var m=this._dataSourceDisplay.getBoundingSphere(h,!0,$);m!==d.FAILED?u=$.center:r(h.position)&&(u=h.position.getValue(n,u)),c=r(u)}var f=r(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;r(f)&&(f.position=t.clone(u,f.position),f.showSelection=p&&c,f.update());var _=r(this._infoBox)?this._infoBox.viewModel:void 0;r(_)&&(_.showInfo=p,_.enableCamera=c,_.isCameraTracking=this.trackedEntity===this.selectedEntity,p?(_.titleText=i(h.name,h.id),_.description=v.getValueOrDefault(h.description,n,"")):(_.titleText="",_.description=""))},Y.prototype._onEntityCollectionChanged=function(e,t,i){for(var r=i.length,n=0;n<r;n++){var o=i[n];this.trackedEntity===o&&(this.trackedEntity=void 0),this.selectedEntity===o&&(this.selectedEntity=void 0)}},Y.prototype._onInfoBoxCameraClicked=function(e){if(e.isCameraTracking&&this.trackedEntity===this.selectedEntity)this.trackedEntity=void 0;else{var t=this.selectedEntity,i=t.position;r(i)?this.trackedEntity=this.selectedEntity:this.zoomTo(this.selectedEntity); -}},Y.prototype._clearTrackedObject=function(){this.trackedEntity=void 0},Y.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0},Y.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0},Y.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&W(this.timeline,this.clock,e)},Y.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);var i=t.entities.id,r=this._eventHelper.add(t.changedEvent,Y.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[i]=r},Y.prototype._onDataSourceRemoved=function(e,t){var i=this.clockTrackedDataSource===t,r=t.entities.id;if(this._dataSourceChangedListeners[r](),this._dataSourceChangedListeners[r]=void 0,i){var n=e.length;this._automaticallyTrackDataSourceClocks&&n>0?this.clockTrackedDataSource=e.get(n-1):this.clockTrackedDataSource=void 0}},Y.prototype.zoomTo=function(e,t){return X(this,e,t,!1)},Y.prototype.flyTo=function(e,t){return X(this,e,t,!0)},Y.prototype._postRender=function(){Q(this),J(this)},Y}),i("Widgets/Viewer/viewerCesiumInspectorMixin",["../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../CesiumInspector/CesiumInspector"],function(e,t,i,r){"use strict";function n(e){var i=document.createElement("div");i.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(i);var n=new r(i,e.scene);t(e,{cesiumInspector:{get:function(){return n}}}),e.scene.postRender.addEventListener(function(){e.cesiumInspector.viewModel.update()})}return n}),i("Widgets/Viewer/viewerDragDropMixin",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/Event","../../Core/wrapFunction","../../DataSources/CzmlDataSource","../../DataSources/GeoJsonDataSource","../../DataSources/KmlDataSource","../getElement"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(t,r){function a(e){h(e),_&&(t.entities.removeAll(),t.dataSources.removeAll());for(var i=e.dataTransfer.files,r=i.length,n=0;n<r;n++){var o=i[n],a=new FileReader;a.onload=m(t,o,y,v),a.onerror=f(t,o),a.readAsText(o)}}r=e(r,e.EMPTY_OBJECT);var s=!0,l=e(r.flyToOnDrop,!0),c=new n,_=e(r.clearOnDrop,!0),g=e(r.dropTarget,t.container),v=e(r.clampToGround,!0),y=r.proxy;g=u(g),i(t,{dropTarget:{get:function(){return g},set:function(e){d(g,a),g=e,p(g,a)}},dropEnabled:{get:function(){return s},set:function(e){e!==s&&(e?p(g,a):d(g,a),s=e)}},dropError:{get:function(){return c}},clearOnDrop:{get:function(){return _},set:function(e){_=e}},flyToOnDrop:{get:function(){return l},set:function(e){l=e}},proxy:{get:function(){return y},set:function(e){y=e}},clampToGround:{get:function(){return v},set:function(e){v=e}}}),p(g,a),t.destroy=o(t,t.destroy,function(){t.dropEnabled=!1}),t._handleDrop=a}function h(e){e.stopPropagation(),e.preventDefault()}function d(e,i){var r=e;t(r)&&(r.removeEventListener("drop",i,!1),r.removeEventListener("dragenter",h,!1),r.removeEventListener("dragover",h,!1),r.removeEventListener("dragexit",h,!1))}function p(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",h,!1),e.addEventListener("dragover",h,!1),e.addEventListener("dragexit",h,!1)}function m(e,i,r,n){var o=e.scene;return function(u){var c=i.name;try{var h;if(/\.czml$/i.test(c))h=a.load(JSON.parse(u.target.result),{sourceUri:c});else if(/\.geojson$/i.test(c)||/\.json$/i.test(c)||/\.topojson$/i.test(c))h=s.load(JSON.parse(u.target.result),{sourceUri:c,clampToGround:n});else{if(!/\.(kml|kmz)$/i.test(c))return void e.dropError.raiseEvent(e,c,"Unrecognized file: "+c);h=l.load(i,{sourceUri:c,proxy:r,camera:o.camera,canvas:o.canvas})}t(h)&&e.dataSources.add(h).then(function(t){e.flyToOnDrop&&e.flyTo(t)}).otherwise(function(t){e.dropError.raiseEvent(e,c,t)})}catch(t){e.dropError.raiseEvent(e,c,t)}}}function f(e,t){return function(i){e.dropError.raiseEvent(e,t.name,i.target.error)}}return c}),i("Widgets/Viewer/viewerPerformanceWatchdogMixin",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../PerformanceWatchdog/PerformanceWatchdog"],function(e,t,i,r,n){"use strict";function o(t,r){r=e(r,e.EMPTY_OBJECT);var o=new n({scene:t.scene,container:t.bottomContainer,lowFrameRateMessage:r.lowFrameRateMessage});i(t,{performanceWatchdog:{get:function(){return o}}})}return o}),i("Workers/createTaskProcessorWorker",["../Core/defaultValue","../Core/defined","../Core/formatError"],function(e,t,i){"use strict";function r(r){var n,o=[],a={id:void 0,result:void 0,error:void 0};return function(s){var l=s.data;o.length=0,a.id=l.id,a.error=void 0,a.result=void 0;try{a.result=r(l.parameters,o)}catch(e){e instanceof Error?a.error={name:e.name,message:e.message,stack:e.stack}:a.error=e}t(n)||(n=e(self.webkitPostMessage,self.postMessage)),l.canTransferArrayBuffer||(o.length=0);try{n(a,o)}catch(e){a.result=void 0,a.error="postMessage failed with error: "+i(e)+"\n with responseMessage: "+JSON.stringify(a),n(a)}}}return r}),i("Cesium",["./Core/appendForwardSlash","./Core/ArcGisImageServerTerrainProvider","./Core/arrayRemoveDuplicates","./Core/AssociativeArray","./Core/AttributeCompression","./Core/AxisAlignedBoundingBox","./Core/barycentricCoordinates","./Core/binarySearch","./Core/BingMapsApi","./Core/BoundingRectangle","./Core/BoundingSphere","./Core/BoxGeometry","./Core/BoxOutlineGeometry","./Core/buildModuleUrl","./Core/cancelAnimationFrame","./Core/Cartesian2","./Core/Cartesian3","./Core/Cartesian4","./Core/Cartographic","./Core/CatmullRomSpline","./Core/CesiumTerrainProvider","./Core/Check","./Core/CircleGeometry","./Core/CircleOutlineGeometry","./Core/Clock","./Core/ClockRange","./Core/ClockStep","./Core/clone","./Core/Color","./Core/ColorGeometryInstanceAttribute","./Core/combine","./Core/ComponentDatatype","./Core/CornerType","./Core/CorridorGeometry","./Core/CorridorGeometryLibrary","./Core/CorridorOutlineGeometry","./Core/createGuid","./Core/Credit","./Core/CubicRealPolynomial","./Core/CylinderGeometry","./Core/CylinderGeometryLibrary","./Core/CylinderOutlineGeometry","./Core/DefaultProxy","./Core/defaultValue","./Core/defined","./Core/defineProperties","./Core/deprecationWarning","./Core/destroyObject","./Core/DeveloperError","./Core/DistanceDisplayCondition","./Core/DistanceDisplayConditionGeometryInstanceAttribute","./Core/EarthOrientationParameters","./Core/EarthOrientationParametersSample","./Core/EasingFunction","./Core/EllipseGeometry","./Core/EllipseGeometryLibrary","./Core/EllipseOutlineGeometry","./Core/Ellipsoid","./Core/EllipsoidalOccluder","./Core/EllipsoidGeodesic","./Core/EllipsoidGeometry","./Core/EllipsoidOutlineGeometry","./Core/EllipsoidTangentPlane","./Core/EllipsoidTerrainProvider","./Core/EncodedCartesian3","./Core/Event","./Core/EventHelper","./Core/ExtrapolationType","./Core/FeatureDetection","./Core/formatError","./Core/freezeObject","./Core/Fullscreen","./Core/GeographicProjection","./Core/GeographicTilingScheme","./Core/Geometry","./Core/GeometryAttribute","./Core/GeometryAttributes","./Core/GeometryInstance","./Core/GeometryInstanceAttribute","./Core/GeometryPipeline","./Core/GeometryType","./Core/getAbsoluteUri","./Core/getBaseUri","./Core/getExtensionFromUri","./Core/getFilenameFromUri","./Core/getImagePixels","./Core/getMagic","./Core/getStringFromTypedArray","./Core/getTimestamp","./Core/GregorianDate","./Core/HeadingPitchRange","./Core/HeadingPitchRoll","./Core/HeightmapTerrainData","./Core/HeightmapTessellator","./Core/HermitePolynomialApproximation","./Core/HermiteSpline","./Core/Iau2000Orientation","./Core/Iau2006XysData","./Core/Iau2006XysSample","./Core/IauOrientationAxes","./Core/IauOrientationParameters","./Core/IndexDatatype","./Core/InterpolationAlgorithm","./Core/Intersect","./Core/Intersections2D","./Core/IntersectionTests","./Core/Interval","./Core/isArray","./Core/isCrossOriginUrl","./Core/isLeapYear","./Core/Iso8601","./Core/joinUrls","./Core/JulianDate","./Core/KeyboardEventModifier","./Core/LagrangePolynomialApproximation","./Core/LeapSecond","./Core/LinearApproximation","./Core/LinearSpline","./Core/loadArrayBuffer","./Core/loadBlob","./Core/loadImage","./Core/loadImageFromTypedArray","./Core/loadImageViaBlob","./Core/loadJson","./Core/loadJsonp","./Core/loadText","./Core/loadWithXhr","./Core/loadXML","./Core/MapboxApi","./Core/MapProjection","./Core/Math","./Core/Matrix2","./Core/Matrix3","./Core/Matrix4","./Core/mergeSort","./Core/NearFarScalar","./Core/objectToQuery","./Core/Occluder","./Core/oneTimeWarning","./Core/OrientedBoundingBox","./Core/Packable","./Core/PackableForInterpolation","./Core/parseResponseHeaders","./Core/PinBuilder","./Core/PixelFormat","./Core/Plane","./Core/PointGeometry","./Core/pointInsideTriangle","./Core/PolygonGeometry","./Core/PolygonGeometryLibrary","./Core/PolygonHierarchy","./Core/PolygonOutlineGeometry","./Core/PolygonPipeline","./Core/PolylineGeometry","./Core/PolylinePipeline","./Core/PolylineVolumeGeometry","./Core/PolylineVolumeGeometryLibrary","./Core/PolylineVolumeOutlineGeometry","./Core/PrimitiveType","./Core/QuadraticRealPolynomial","./Core/QuantizedMeshTerrainData","./Core/QuarticRealPolynomial","./Core/Quaternion","./Core/QuaternionSpline","./Core/queryToObject","./Core/Queue","./Core/Ray","./Core/Rectangle","./Core/RectangleGeometry","./Core/RectangleGeometryLibrary","./Core/RectangleOutlineGeometry","./Core/ReferenceFrame","./Core/requestAnimationFrame","./Core/RequestErrorEvent","./Core/RuntimeError","./Core/sampleTerrain","./Core/scaleToGeodeticSurface","./Core/ScreenSpaceEventHandler","./Core/ScreenSpaceEventType","./Core/ShowGeometryInstanceAttribute","./Core/Simon1994PlanetaryPositions","./Core/SimplePolylineGeometry","./Core/SphereGeometry","./Core/SphereOutlineGeometry","./Core/Spherical","./Core/Spline","./Core/subdivideArray","./Core/TaskProcessor","./Core/TerrainData","./Core/TerrainEncoding","./Core/TerrainMesh","./Core/TerrainProvider","./Core/TerrainQuantization","./Core/throttleRequestByServer","./Core/TileProviderError","./Core/TilingScheme","./Core/TimeConstants","./Core/TimeInterval","./Core/TimeIntervalCollection","./Core/TimeStandard","./Core/Tipsify","./Core/Transforms","./Core/TranslationRotationScale","./Core/TridiagonalSystemSolver","./Core/TrustedServers","./Core/VertexFormat","./Core/VideoSynchronizer","./Core/Visibility","./Core/VRTheWorldTerrainProvider","./Core/WallGeometry","./Core/WallGeometryLibrary","./Core/WallOutlineGeometry","./Core/WebGLConstants","./Core/WebMercatorProjection","./Core/WebMercatorTilingScheme","./Core/WindingOrder","./Core/wrapFunction","./Core/writeTextToCanvas","./DataSources/BillboardGraphics","./DataSources/BillboardVisualizer","./DataSources/BoundingSphereState","./DataSources/BoxGeometryUpdater","./DataSources/BoxGraphics","./DataSources/CallbackProperty","./DataSources/CheckerboardMaterialProperty","./DataSources/ColorMaterialProperty","./DataSources/CompositeEntityCollection","./DataSources/CompositeMaterialProperty","./DataSources/CompositePositionProperty","./DataSources/CompositeProperty","./DataSources/ConstantPositionProperty","./DataSources/ConstantProperty","./DataSources/CorridorGeometryUpdater","./DataSources/CorridorGraphics","./DataSources/createMaterialPropertyDescriptor","./DataSources/createPropertyDescriptor","./DataSources/createRawPropertyDescriptor","./DataSources/CustomDataSource","./DataSources/CylinderGeometryUpdater","./DataSources/CylinderGraphics","./DataSources/CzmlDataSource","./DataSources/DataSource","./DataSources/DataSourceClock","./DataSources/DataSourceCollection","./DataSources/DataSourceDisplay","./DataSources/dynamicGeometryGetBoundingSphere","./DataSources/DynamicGeometryUpdater","./DataSources/EllipseGeometryUpdater","./DataSources/EllipseGraphics","./DataSources/EllipsoidGeometryUpdater","./DataSources/EllipsoidGraphics","./DataSources/Entity","./DataSources/EntityCluster","./DataSources/EntityCollection","./DataSources/EntityView","./DataSources/GeoJsonDataSource","./DataSources/GeometryUpdater","./DataSources/GeometryVisualizer","./DataSources/GridMaterialProperty","./DataSources/ImageMaterialProperty","./DataSources/KmlDataSource","./DataSources/LabelGraphics","./DataSources/LabelVisualizer","./DataSources/MaterialProperty","./DataSources/ModelGraphics","./DataSources/ModelVisualizer","./DataSources/NodeTransformationProperty","./DataSources/PathGraphics","./DataSources/PathVisualizer","./DataSources/PointGraphics","./DataSources/PointVisualizer","./DataSources/PolygonGeometryUpdater","./DataSources/PolygonGraphics","./DataSources/PolylineArrowMaterialProperty","./DataSources/PolylineGeometryUpdater","./DataSources/PolylineGlowMaterialProperty","./DataSources/PolylineGraphics","./DataSources/PolylineOutlineMaterialProperty","./DataSources/PolylineVolumeGeometryUpdater","./DataSources/PolylineVolumeGraphics","./DataSources/PositionProperty","./DataSources/PositionPropertyArray","./DataSources/Property","./DataSources/PropertyArray","./DataSources/PropertyBag","./DataSources/RectangleGeometryUpdater","./DataSources/RectangleGraphics","./DataSources/ReferenceProperty","./DataSources/Rotation","./DataSources/SampledPositionProperty","./DataSources/SampledProperty","./DataSources/ScaledPositionProperty","./DataSources/StaticGeometryColorBatch","./DataSources/StaticGeometryPerMaterialBatch","./DataSources/StaticGroundGeometryColorBatch","./DataSources/StaticOutlineGeometryBatch","./DataSources/StripeMaterialProperty","./DataSources/StripeOrientation","./DataSources/TimeIntervalCollectionPositionProperty","./DataSources/TimeIntervalCollectionProperty","./DataSources/VelocityOrientationProperty","./DataSources/VelocityVectorProperty","./DataSources/Visualizer","./DataSources/WallGeometryUpdater","./DataSources/WallGraphics","./Renderer/AutomaticUniforms","./Renderer/Buffer","./Renderer/BufferUsage","./Renderer/ClearCommand","./Renderer/ComputeCommand","./Renderer/ComputeEngine","./Renderer/Context","./Renderer/ContextLimits","./Renderer/createUniform","./Renderer/createUniformArray","./Renderer/CubeMap","./Renderer/CubeMapFace","./Renderer/DrawCommand","./Renderer/Framebuffer","./Renderer/loadCubeMap","./Renderer/MipmapHint","./Renderer/Pass","./Renderer/PassState","./Renderer/PickFramebuffer","./Renderer/PixelDatatype","./Renderer/Renderbuffer","./Renderer/RenderbufferFormat","./Renderer/RenderState","./Renderer/Sampler","./Renderer/ShaderCache","./Renderer/ShaderProgram","./Renderer/ShaderSource","./Renderer/Texture","./Renderer/TextureMagnificationFilter","./Renderer/TextureMinificationFilter","./Renderer/TextureWrap","./Renderer/UniformState","./Renderer/VertexArray","./Renderer/VertexArrayFacade","./Scene/Appearance","./Scene/ArcGisMapServerImageryProvider","./Scene/BatchTable","./Scene/Billboard","./Scene/BillboardCollection","./Scene/BingMapsImageryProvider","./Scene/BingMapsStyle","./Scene/BlendEquation","./Scene/BlendFunction","./Scene/BlendingState","./Scene/Camera","./Scene/CameraEventAggregator","./Scene/CameraEventType","./Scene/CameraFlightPath","./Scene/ColorBlendMode","./Scene/createOpenStreetMapImageryProvider","./Scene/createTangentSpaceDebugPrimitive","./Scene/createTileMapServiceImageryProvider","./Scene/CreditDisplay","./Scene/CullFace","./Scene/CullingVolume","./Scene/DebugAppearance","./Scene/DebugCameraPrimitive","./Scene/DebugModelMatrixPrimitive","./Scene/DepthFunction","./Scene/DepthPlane","./Scene/DeviceOrientationCameraController","./Scene/DiscardMissingTileImagePolicy","./Scene/EllipsoidPrimitive","./Scene/EllipsoidSurfaceAppearance","./Scene/Fog","./Scene/FrameRateMonitor","./Scene/FrameState","./Scene/FrustumCommands","./Scene/FXAA","./Scene/getAttributeOrUniformBySemantic","./Scene/getBinaryAccessor","./Scene/GetFeatureInfoFormat","./Scene/Globe","./Scene/GlobeDepth","./Scene/GlobeSurfaceShaderSet","./Scene/GlobeSurfaceTile","./Scene/GlobeSurfaceTileProvider","./Scene/GoogleEarthImageryProvider","./Scene/GridImageryProvider","./Scene/GroundPrimitive","./Scene/HeightReference","./Scene/HorizontalOrigin","./Scene/Imagery","./Scene/ImageryLayer","./Scene/ImageryLayerCollection","./Scene/ImageryLayerFeatureInfo","./Scene/ImageryProvider","./Scene/ImageryState","./Scene/Label","./Scene/LabelCollection","./Scene/LabelStyle","./Scene/MapboxImageryProvider","./Scene/MapMode2D","./Scene/Material","./Scene/MaterialAppearance","./Scene/Model","./Scene/ModelAnimation","./Scene/ModelAnimationCache","./Scene/ModelAnimationCollection","./Scene/ModelAnimationLoop","./Scene/ModelAnimationState","./Scene/ModelMaterial","./Scene/modelMaterialsCommon","./Scene/ModelMesh","./Scene/ModelNode","./Scene/Moon","./Scene/NeverTileDiscardPolicy","./Scene/OIT","./Scene/OrthographicFrustum","./Scene/PerformanceDisplay","./Scene/PerInstanceColorAppearance","./Scene/PerspectiveFrustum","./Scene/PerspectiveOffCenterFrustum","./Scene/PickDepth","./Scene/PointAppearance","./Scene/PointPrimitive","./Scene/PointPrimitiveCollection","./Scene/Polyline","./Scene/PolylineCollection","./Scene/PolylineColorAppearance","./Scene/PolylineMaterialAppearance","./Scene/Primitive","./Scene/PrimitiveCollection","./Scene/PrimitivePipeline","./Scene/PrimitiveState","./Scene/QuadtreeOccluders","./Scene/QuadtreePrimitive","./Scene/QuadtreeTile","./Scene/QuadtreeTileLoadState","./Scene/QuadtreeTileProvider","./Scene/Scene","./Scene/SceneMode","./Scene/SceneTransforms","./Scene/SceneTransitioner","./Scene/ScreenSpaceCameraController","./Scene/ShadowMap","./Scene/ShadowMapShader","./Scene/ShadowMode","./Scene/SingleTileImageryProvider","./Scene/SkyAtmosphere","./Scene/SkyBox","./Scene/StencilFunction","./Scene/StencilOperation","./Scene/Sun","./Scene/SunPostProcess","./Scene/TerrainState","./Scene/TextureAtlas","./Scene/TileBoundingBox","./Scene/TileCoordinatesImageryProvider","./Scene/TileDiscardPolicy","./Scene/TileImagery","./Scene/TileReplacementQueue","./Scene/TileState","./Scene/TileTerrain","./Scene/TweenCollection","./Scene/UrlTemplateImageryProvider","./Scene/VerticalOrigin","./Scene/ViewportQuad","./Scene/WebMapServiceImageryProvider","./Scene/WebMapTileServiceImageryProvider","./Shaders/AdjustTranslucentFS","./Shaders/Appearances/AllMaterialAppearanceFS","./Shaders/Appearances/AllMaterialAppearanceVS","./Shaders/Appearances/BasicMaterialAppearanceFS","./Shaders/Appearances/BasicMaterialAppearanceVS","./Shaders/Appearances/EllipsoidSurfaceAppearanceFS","./Shaders/Appearances/EllipsoidSurfaceAppearanceVS","./Shaders/Appearances/PerInstanceColorAppearanceFS","./Shaders/Appearances/PerInstanceColorAppearanceVS","./Shaders/Appearances/PerInstanceFlatColorAppearanceFS","./Shaders/Appearances/PerInstanceFlatColorAppearanceVS","./Shaders/Appearances/PointAppearanceFS","./Shaders/Appearances/PointAppearanceVS","./Shaders/Appearances/PolylineColorAppearanceVS","./Shaders/Appearances/PolylineMaterialAppearanceVS","./Shaders/Appearances/TexturedMaterialAppearanceFS","./Shaders/Appearances/TexturedMaterialAppearanceVS","./Shaders/BillboardCollectionFS","./Shaders/BillboardCollectionVS","./Shaders/Builtin/Constants/degreesPerRadian","./Shaders/Builtin/Constants/depthRange","./Shaders/Builtin/Constants/epsilon1","./Shaders/Builtin/Constants/epsilon2","./Shaders/Builtin/Constants/epsilon3","./Shaders/Builtin/Constants/epsilon4","./Shaders/Builtin/Constants/epsilon5","./Shaders/Builtin/Constants/epsilon6","./Shaders/Builtin/Constants/epsilon7","./Shaders/Builtin/Constants/infinity","./Shaders/Builtin/Constants/oneOverPi","./Shaders/Builtin/Constants/oneOverTwoPi","./Shaders/Builtin/Constants/passCompute","./Shaders/Builtin/Constants/passEnvironment","./Shaders/Builtin/Constants/passGlobe","./Shaders/Builtin/Constants/passGround","./Shaders/Builtin/Constants/passOpaque","./Shaders/Builtin/Constants/passOverlay","./Shaders/Builtin/Constants/passTranslucent","./Shaders/Builtin/Constants/pi","./Shaders/Builtin/Constants/piOverFour","./Shaders/Builtin/Constants/piOverSix","./Shaders/Builtin/Constants/piOverThree","./Shaders/Builtin/Constants/piOverTwo","./Shaders/Builtin/Constants/radiansPerDegree","./Shaders/Builtin/Constants/sceneMode2D","./Shaders/Builtin/Constants/sceneMode3D","./Shaders/Builtin/Constants/sceneModeColumbusView","./Shaders/Builtin/Constants/sceneModeMorphing","./Shaders/Builtin/Constants/solarRadius","./Shaders/Builtin/Constants/threePiOver2","./Shaders/Builtin/Constants/twoPi","./Shaders/Builtin/Constants/webMercatorMaxLatitude","./Shaders/Builtin/CzmBuiltins","./Shaders/Builtin/Functions/alphaWeight","./Shaders/Builtin/Functions/antialias","./Shaders/Builtin/Functions/cascadeColor","./Shaders/Builtin/Functions/cascadeDistance","./Shaders/Builtin/Functions/cascadeMatrix","./Shaders/Builtin/Functions/cascadeWeights","./Shaders/Builtin/Functions/columbusViewMorph","./Shaders/Builtin/Functions/computePosition","./Shaders/Builtin/Functions/cosineAndSine","./Shaders/Builtin/Functions/decompressTextureCoordinates","./Shaders/Builtin/Functions/eastNorthUpToEyeCoordinates","./Shaders/Builtin/Functions/ellipsoidContainsPoint","./Shaders/Builtin/Functions/ellipsoidNew","./Shaders/Builtin/Functions/ellipsoidWgs84TextureCoordinates","./Shaders/Builtin/Functions/equalsEpsilon","./Shaders/Builtin/Functions/eyeOffset","./Shaders/Builtin/Functions/eyeToWindowCoordinates","./Shaders/Builtin/Functions/fog","./Shaders/Builtin/Functions/geodeticSurfaceNormal","./Shaders/Builtin/Functions/getDefaultMaterial","./Shaders/Builtin/Functions/getLambertDiffuse","./Shaders/Builtin/Functions/getSpecular","./Shaders/Builtin/Functions/getWaterNoise","./Shaders/Builtin/Functions/getWgs84EllipsoidEC","./Shaders/Builtin/Functions/hue","./Shaders/Builtin/Functions/isEmpty","./Shaders/Builtin/Functions/isFull","./Shaders/Builtin/Functions/latitudeToWebMercatorFraction","./Shaders/Builtin/Functions/luminance","./Shaders/Builtin/Functions/metersPerPixel","./Shaders/Builtin/Functions/modelToWindowCoordinates","./Shaders/Builtin/Functions/multiplyWithColorBalance","./Shaders/Builtin/Functions/nearFarScalar","./Shaders/Builtin/Functions/octDecode","./Shaders/Builtin/Functions/packDepth","./Shaders/Builtin/Functions/phong","./Shaders/Builtin/Functions/pointAlongRay","./Shaders/Builtin/Functions/rayEllipsoidIntersectionInterval","./Shaders/Builtin/Functions/RGBToXYZ","./Shaders/Builtin/Functions/saturation","./Shaders/Builtin/Functions/shadowDepthCompare","./Shaders/Builtin/Functions/shadowVisibility","./Shaders/Builtin/Functions/signNotZero","./Shaders/Builtin/Functions/tangentToEyeSpaceMatrix","./Shaders/Builtin/Functions/translateRelativeToEye","./Shaders/Builtin/Functions/translucentPhong","./Shaders/Builtin/Functions/transpose","./Shaders/Builtin/Functions/unpackDepth","./Shaders/Builtin/Functions/windowToEyeCoordinates","./Shaders/Builtin/Functions/XYZToRGB","./Shaders/Builtin/Structs/depthRangeStruct","./Shaders/Builtin/Structs/ellipsoid","./Shaders/Builtin/Structs/material","./Shaders/Builtin/Structs/materialInput","./Shaders/Builtin/Structs/ray","./Shaders/Builtin/Structs/raySegment","./Shaders/Builtin/Structs/shadowParameters","./Shaders/CompositeOITFS","./Shaders/DepthPlaneFS","./Shaders/DepthPlaneVS","./Shaders/EllipsoidFS","./Shaders/EllipsoidVS","./Shaders/GlobeFS","./Shaders/GlobeVS","./Shaders/GroundAtmosphere","./Shaders/Materials/BumpMapMaterial","./Shaders/Materials/CheckerboardMaterial","./Shaders/Materials/DotMaterial","./Shaders/Materials/FadeMaterial","./Shaders/Materials/GridMaterial","./Shaders/Materials/NormalMapMaterial","./Shaders/Materials/PolylineArrowMaterial","./Shaders/Materials/PolylineGlowMaterial","./Shaders/Materials/PolylineOutlineMaterial","./Shaders/Materials/RimLightingMaterial","./Shaders/Materials/StripeMaterial","./Shaders/Materials/Water","./Shaders/PointPrimitiveCollectionFS","./Shaders/PointPrimitiveCollectionVS","./Shaders/PolylineCommon","./Shaders/PolylineFS","./Shaders/PolylineVS","./Shaders/PostProcessFilters/AdditiveBlend","./Shaders/PostProcessFilters/BrightPass","./Shaders/PostProcessFilters/FXAA","./Shaders/PostProcessFilters/GaussianBlur1D","./Shaders/PostProcessFilters/PassThrough","./Shaders/ReprojectWebMercatorFS","./Shaders/ReprojectWebMercatorVS","./Shaders/ShadowVolumeFS","./Shaders/ShadowVolumeVS","./Shaders/SkyAtmosphereFS","./Shaders/SkyAtmosphereVS","./Shaders/SkyBoxFS","./Shaders/SkyBoxVS","./Shaders/SunFS","./Shaders/SunTextureFS","./Shaders/SunVS","./Shaders/ViewportQuadFS","./Shaders/ViewportQuadVS","./ThirdParty/Autolinker","./ThirdParty/earcut-2.1.1","./ThirdParty/gltfDefaults","./ThirdParty/kdbush","./ThirdParty/knockout-3.4.0","./ThirdParty/knockout-es5","./ThirdParty/knockout","./ThirdParty/measureText","./ThirdParty/mersenne-twister","./ThirdParty/NoSleep","./ThirdParty/sprintf","./ThirdParty/topojson","./ThirdParty/Tween","./ThirdParty/Uri","./ThirdParty/when","./ThirdParty/zip","./Widgets/Animation/Animation","./Widgets/Animation/AnimationViewModel","./Widgets/BaseLayerPicker/BaseLayerPicker","./Widgets/BaseLayerPicker/BaseLayerPickerViewModel","./Widgets/BaseLayerPicker/createDefaultImageryProviderViewModels","./Widgets/BaseLayerPicker/createDefaultTerrainProviderViewModels","./Widgets/BaseLayerPicker/ProviderViewModel","./Widgets/CesiumInspector/CesiumInspector","./Widgets/CesiumInspector/CesiumInspectorViewModel","./Widgets/CesiumWidget/CesiumWidget","./Widgets/ClockViewModel","./Widgets/Command","./Widgets/createCommand","./Widgets/FullscreenButton/FullscreenButton","./Widgets/FullscreenButton/FullscreenButtonViewModel","./Widgets/Geocoder/Geocoder","./Widgets/Geocoder/GeocoderViewModel","./Widgets/getElement","./Widgets/HomeButton/HomeButton","./Widgets/HomeButton/HomeButtonViewModel","./Widgets/InfoBox/InfoBox","./Widgets/InfoBox/InfoBoxViewModel","./Widgets/NavigationHelpButton/NavigationHelpButton","./Widgets/NavigationHelpButton/NavigationHelpButtonViewModel","./Widgets/PerformanceWatchdog/PerformanceWatchdog","./Widgets/PerformanceWatchdog/PerformanceWatchdogViewModel","./Widgets/SceneModePicker/SceneModePicker","./Widgets/SceneModePicker/SceneModePickerViewModel","./Widgets/SelectionIndicator/SelectionIndicator","./Widgets/SelectionIndicator/SelectionIndicatorViewModel","./Widgets/subscribeAndEvaluate","./Widgets/SvgPathBindingHandler","./Widgets/Timeline/Timeline","./Widgets/Timeline/TimelineHighlightRange","./Widgets/Timeline/TimelineTrack","./Widgets/ToggleButtonViewModel","./Widgets/Viewer/Viewer","./Widgets/Viewer/viewerCesiumInspectorMixin","./Widgets/Viewer/viewerDragDropMixin","./Widgets/Viewer/viewerPerformanceWatchdogMixin","./Widgets/VRButton/VRButton","./Widgets/VRButton/VRButtonViewModel","./Workers/createTaskProcessorWorker"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I,R,O,N,L,B,F,V,k,z,U,G,W,H,q,j,Y,X,Z,K,Q,J,$,ee,te,ie,re,ne,oe,ae,se,le,ue,ce,he,de,pe,me,fe,_e,ge,ve,ye,Ce,we,Se,Ee,be,Te,xe,Ae,Pe,De,Me,Ie,Re,Oe,Ne,Le,Be,Fe,Ve,ke,ze,Ue,Ge,We,He,qe,je,Ye,Xe,Ze,Ke,Qe,Je,$e,et,tt,it,rt,nt,ot,at,st,lt,ut,ct,ht,dt,pt,mt,ft,_t,gt,vt,yt,Ct,wt,St,Et,bt,Tt,xt,At,Pt,Dt,Mt,It,Rt,Ot,Nt,Lt,Bt,Ft,Vt,kt,zt,Ut,Gt,Wt,Ht,qt,jt,Yt,Xt,Zt,Kt,Qt,Jt,$t,ei,ti,ii,ri,ni,oi,ai,si,li,ui,ci,hi,di,pi,mi,fi,_i,gi,vi,yi,Ci,wi,Si,Ei,bi,Ti,xi,Ai,Pi,Di,Mi,Ii,Ri,Oi,Ni,Li,Bi,Fi,Vi,ki,zi,Ui,Gi,Wi,Hi,qi,ji,Yi,Xi,Zi,Ki,Qi,Ji,$i,er,tr,ir,rr,nr,or,ar,sr,lr,ur,cr,hr,dr,pr,mr,fr,_r,gr,vr,yr,Cr,wr,Sr,Er,br,Tr,xr,Ar,Pr,Dr,Mr,Ir,Rr,Or,Nr,Lr,Br,Fr,Vr,kr,zr,Ur,Gr,Wr,Hr,qr,jr,Yr,Xr,Zr,Kr,Qr,Jr,$r,en,tn,rn,nn,on,an,sn,ln,un,cn,hn,dn,pn,mn,fn,_n,gn,vn,yn,Cn,wn,Sn,En,bn,Tn,xn,An,Pn,Dn,Mn,In,Rn,On,Nn,Ln,Bn,Fn,Vn,kn,zn,Un,Gn,Wn,Hn,qn,jn,Yn,Xn,Zn,Kn,Qn,Jn,$n,eo,to,io,ro,no,oo,ao,so,lo,uo,co,ho,po,mo,fo,_o,go,vo,yo,Co,wo,So,Eo,bo,To,xo,Ao,Po,Do,Mo,Io,Ro,Oo,No,Lo,Bo,Fo,Vo,ko,zo,Uo,Go,Wo,Ho,qo,jo,Yo,Xo,Zo,Ko,Qo,Jo,$o,ea,ta,ia,ra,na,oa,aa,sa,la,ua,ca,ha,da,pa,ma,fa,_a,ga,va,ya,Ca,wa,Sa,Ea,ba,Ta,xa,Aa,Pa,Da,Ma,Ia,Ra,Oa,Na,La,Ba,Fa,Va,ka,za,Ua,Ga,Wa,Ha,qa,ja,Ya,Xa,Za,Ka,Qa,Ja,$a,es,ts,is,rs,ns,os,as,ss,ls,us,cs,hs,ds,ps,ms,fs,_s,gs,vs,ys,Cs,ws,Ss,Es,bs,Ts,xs,As,Ps,Ds,Ms,Is,Rs,Os,Ns,Ls,Bs,Fs,Vs,ks,zs,Us,Gs,Ws,Hs,qs,js,Ys,Xs,Zs,Ks,Qs,Js,$s,el,tl,il,rl,nl,ol,al,sl,ll,ul,cl,hl,dl,pl,ml,fl,_l,gl,vl,yl,Cl,wl,Sl,El,bl,Tl,xl,Al,Pl,Dl,Ml,Il,Rl,Ol,Nl,Ll,Bl,Fl,Vl,kl,zl,Ul,Gl,Wl,Hl,ql,jl,Yl,Xl,Zl,Kl,Ql,Jl,$l,eu,tu,iu,ru,nu,ou,au,su,lu,uu,cu,hu,du,pu,mu,fu,_u,gu,vu,yu,Cu,wu,Su,Eu,bu,Tu,xu,Au,Pu,Du,Mu,Iu,Ru,Ou,Nu,Lu,Bu,Fu,Vu,ku,zu,Uu,Gu,Wu,Hu,qu,ju,Yu,Xu,Zu,Ku,Qu,Ju,$u,ec,tc,ic,rc,nc,oc,ac,sc,lc,uc,cc,hc,dc,pc,mc,fc,_c,gc,vc,yc,Cc,wc,Sc,Ec,bc,Tc,xc,Ac,Pc,Dc,Mc,Ic,Rc,Oc,Nc,Lc,Bc,Fc,Vc,kc,zc,Uc,Gc,Wc,Hc,qc,jc,Yc,Xc,Zc,Kc,Qc,Jc,$c,eh,th,ih,rh,nh,oh,ah,sh,lh,uh,ch,hh,dh,ph,mh,fh,_h,gh,vh,yh,Ch,wh,Sh,Eh,bh,Th,xh,Ah,Ph,Dh,Mh){"use strict";var Ih={VERSION:"1.29",_shaders:{}};return Ih.appendForwardSlash=e,Ih.ArcGisImageServerTerrainProvider=t,Ih.arrayRemoveDuplicates=i,Ih.AssociativeArray=r,Ih.AttributeCompression=n,Ih.AxisAlignedBoundingBox=o,Ih.barycentricCoordinates=a,Ih.binarySearch=s,Ih.BingMapsApi=l,Ih.BoundingRectangle=u,Ih.BoundingSphere=c,Ih.BoxGeometry=h,Ih.BoxOutlineGeometry=d,Ih.buildModuleUrl=p,Ih.cancelAnimationFrame=m,Ih.Cartesian2=f,Ih.Cartesian3=_,Ih.Cartesian4=g,Ih.Cartographic=v,Ih.CatmullRomSpline=y,Ih.CesiumTerrainProvider=C,Ih.Check=w,Ih.CircleGeometry=S,Ih.CircleOutlineGeometry=E,Ih.Clock=b,Ih.ClockRange=T,Ih.ClockStep=x,Ih.clone=A,Ih.Color=P,Ih.ColorGeometryInstanceAttribute=D,Ih.combine=M,Ih.ComponentDatatype=I,Ih.CornerType=R,Ih.CorridorGeometry=O,Ih.CorridorGeometryLibrary=N,Ih.CorridorOutlineGeometry=L,Ih.createGuid=B,Ih.Credit=F,Ih.CubicRealPolynomial=V,Ih.CylinderGeometry=k,Ih.CylinderGeometryLibrary=z,Ih.CylinderOutlineGeometry=U,Ih.DefaultProxy=G,Ih.defaultValue=W,Ih.defined=H,Ih.defineProperties=q,Ih.deprecationWarning=j,Ih.destroyObject=Y,Ih.DeveloperError=X,Ih.DistanceDisplayCondition=Z,Ih.DistanceDisplayConditionGeometryInstanceAttribute=K,Ih.EarthOrientationParameters=Q,Ih.EarthOrientationParametersSample=J,Ih.EasingFunction=$,Ih.EllipseGeometry=ee,Ih.EllipseGeometryLibrary=te,Ih.EllipseOutlineGeometry=ie,Ih.Ellipsoid=re,Ih.EllipsoidalOccluder=ne,Ih.EllipsoidGeodesic=oe,Ih.EllipsoidGeometry=ae,Ih.EllipsoidOutlineGeometry=se,Ih.EllipsoidTangentPlane=le,Ih.EllipsoidTerrainProvider=ue,Ih.EncodedCartesian3=ce,Ih.Event=he,Ih.EventHelper=de,Ih.ExtrapolationType=pe,Ih.FeatureDetection=me,Ih.formatError=fe,Ih.freezeObject=_e,Ih.Fullscreen=ge,Ih.GeographicProjection=ve,Ih.GeographicTilingScheme=ye,Ih.Geometry=Ce,Ih.GeometryAttribute=we,Ih.GeometryAttributes=Se,Ih.GeometryInstance=Ee,Ih.GeometryInstanceAttribute=be,Ih.GeometryPipeline=Te,Ih.GeometryType=xe,Ih.getAbsoluteUri=Ae,Ih.getBaseUri=Pe,Ih.getExtensionFromUri=De,Ih.getFilenameFromUri=Me,Ih.getImagePixels=Ie,Ih.getMagic=Re,Ih.getStringFromTypedArray=Oe,Ih.getTimestamp=Ne,Ih.GregorianDate=Le,Ih.HeadingPitchRange=Be,Ih.HeadingPitchRoll=Fe,Ih.HeightmapTerrainData=Ve,Ih.HeightmapTessellator=ke,Ih.HermitePolynomialApproximation=ze,Ih.HermiteSpline=Ue,Ih.Iau2000Orientation=Ge,Ih.Iau2006XysData=We,Ih.Iau2006XysSample=He,Ih.IauOrientationAxes=qe,Ih.IauOrientationParameters=je,Ih.IndexDatatype=Ye,Ih.InterpolationAlgorithm=Xe,Ih.Intersect=Ze,Ih.Intersections2D=Ke,Ih.IntersectionTests=Qe,Ih.Interval=Je,Ih.isArray=$e,Ih.isCrossOriginUrl=et,Ih.isLeapYear=tt,Ih.Iso8601=it,Ih.joinUrls=rt,Ih.JulianDate=nt,Ih.KeyboardEventModifier=ot,Ih.LagrangePolynomialApproximation=at,Ih.LeapSecond=st,Ih.LinearApproximation=lt,Ih.LinearSpline=ut,Ih.loadArrayBuffer=ct,Ih.loadBlob=ht,Ih.loadImage=dt,Ih.loadImageFromTypedArray=pt,Ih.loadImageViaBlob=mt,Ih.loadJson=ft,Ih.loadJsonp=_t,Ih.loadText=gt,Ih.loadWithXhr=vt,Ih.loadXML=yt,Ih.MapboxApi=Ct,Ih.MapProjection=wt,Ih.Math=St,Ih.Matrix2=Et,Ih.Matrix3=bt,Ih.Matrix4=Tt,Ih.mergeSort=xt,Ih.NearFarScalar=At,Ih.objectToQuery=Pt,Ih.Occluder=Dt,Ih.oneTimeWarning=Mt,Ih.OrientedBoundingBox=It,Ih.Packable=Rt,Ih.PackableForInterpolation=Ot,Ih.parseResponseHeaders=Nt,Ih.PinBuilder=Lt,Ih.PixelFormat=Bt,Ih.Plane=Ft,Ih.PointGeometry=Vt,Ih.pointInsideTriangle=kt,Ih.PolygonGeometry=zt,Ih.PolygonGeometryLibrary=Ut,Ih.PolygonHierarchy=Gt,Ih.PolygonOutlineGeometry=Wt,Ih.PolygonPipeline=Ht,Ih.PolylineGeometry=qt, -Ih.PolylinePipeline=jt,Ih.PolylineVolumeGeometry=Yt,Ih.PolylineVolumeGeometryLibrary=Xt,Ih.PolylineVolumeOutlineGeometry=Zt,Ih.PrimitiveType=Kt,Ih.QuadraticRealPolynomial=Qt,Ih.QuantizedMeshTerrainData=Jt,Ih.QuarticRealPolynomial=$t,Ih.Quaternion=ei,Ih.QuaternionSpline=ti,Ih.queryToObject=ii,Ih.Queue=ri,Ih.Ray=ni,Ih.Rectangle=oi,Ih.RectangleGeometry=ai,Ih.RectangleGeometryLibrary=si,Ih.RectangleOutlineGeometry=li,Ih.ReferenceFrame=ui,Ih.requestAnimationFrame=ci,Ih.RequestErrorEvent=hi,Ih.RuntimeError=di,Ih.sampleTerrain=pi,Ih.scaleToGeodeticSurface=mi,Ih.ScreenSpaceEventHandler=fi,Ih.ScreenSpaceEventType=_i,Ih.ShowGeometryInstanceAttribute=gi,Ih.Simon1994PlanetaryPositions=vi,Ih.SimplePolylineGeometry=yi,Ih.SphereGeometry=Ci,Ih.SphereOutlineGeometry=wi,Ih.Spherical=Si,Ih.Spline=Ei,Ih.subdivideArray=bi,Ih.TaskProcessor=Ti,Ih.TerrainData=xi,Ih.TerrainEncoding=Ai,Ih.TerrainMesh=Pi,Ih.TerrainProvider=Di,Ih.TerrainQuantization=Mi,Ih.throttleRequestByServer=Ii,Ih.TileProviderError=Ri,Ih.TilingScheme=Oi,Ih.TimeConstants=Ni,Ih.TimeInterval=Li,Ih.TimeIntervalCollection=Bi,Ih.TimeStandard=Fi,Ih.Tipsify=Vi,Ih.Transforms=ki,Ih.TranslationRotationScale=zi,Ih.TridiagonalSystemSolver=Ui,Ih.TrustedServers=Gi,Ih.VertexFormat=Wi,Ih.VideoSynchronizer=Hi,Ih.Visibility=qi,Ih.VRTheWorldTerrainProvider=ji,Ih.WallGeometry=Yi,Ih.WallGeometryLibrary=Xi,Ih.WallOutlineGeometry=Zi,Ih.WebGLConstants=Ki,Ih.WebMercatorProjection=Qi,Ih.WebMercatorTilingScheme=Ji,Ih.WindingOrder=$i,Ih.wrapFunction=er,Ih.writeTextToCanvas=tr,Ih.BillboardGraphics=ir,Ih.BillboardVisualizer=rr,Ih.BoundingSphereState=nr,Ih.BoxGeometryUpdater=or,Ih.BoxGraphics=ar,Ih.CallbackProperty=sr,Ih.CheckerboardMaterialProperty=lr,Ih.ColorMaterialProperty=ur,Ih.CompositeEntityCollection=cr,Ih.CompositeMaterialProperty=hr,Ih.CompositePositionProperty=dr,Ih.CompositeProperty=pr,Ih.ConstantPositionProperty=mr,Ih.ConstantProperty=fr,Ih.CorridorGeometryUpdater=_r,Ih.CorridorGraphics=gr,Ih.createMaterialPropertyDescriptor=vr,Ih.createPropertyDescriptor=yr,Ih.createRawPropertyDescriptor=Cr,Ih.CustomDataSource=wr,Ih.CylinderGeometryUpdater=Sr,Ih.CylinderGraphics=Er,Ih.CzmlDataSource=br,Ih.DataSource=Tr,Ih.DataSourceClock=xr,Ih.DataSourceCollection=Ar,Ih.DataSourceDisplay=Pr,Ih.dynamicGeometryGetBoundingSphere=Dr,Ih.DynamicGeometryUpdater=Mr,Ih.EllipseGeometryUpdater=Ir,Ih.EllipseGraphics=Rr,Ih.EllipsoidGeometryUpdater=Or,Ih.EllipsoidGraphics=Nr,Ih.Entity=Lr,Ih.EntityCluster=Br,Ih.EntityCollection=Fr,Ih.EntityView=Vr,Ih.GeoJsonDataSource=kr,Ih.GeometryUpdater=zr,Ih.GeometryVisualizer=Ur,Ih.GridMaterialProperty=Gr,Ih.ImageMaterialProperty=Wr,Ih.KmlDataSource=Hr,Ih.LabelGraphics=qr,Ih.LabelVisualizer=jr,Ih.MaterialProperty=Yr,Ih.ModelGraphics=Xr,Ih.ModelVisualizer=Zr,Ih.NodeTransformationProperty=Kr,Ih.PathGraphics=Qr,Ih.PathVisualizer=Jr,Ih.PointGraphics=$r,Ih.PointVisualizer=en,Ih.PolygonGeometryUpdater=tn,Ih.PolygonGraphics=rn,Ih.PolylineArrowMaterialProperty=nn,Ih.PolylineGeometryUpdater=on,Ih.PolylineGlowMaterialProperty=an,Ih.PolylineGraphics=sn,Ih.PolylineOutlineMaterialProperty=ln,Ih.PolylineVolumeGeometryUpdater=un,Ih.PolylineVolumeGraphics=cn,Ih.PositionProperty=hn,Ih.PositionPropertyArray=dn,Ih.Property=pn,Ih.PropertyArray=mn,Ih.PropertyBag=fn,Ih.RectangleGeometryUpdater=_n,Ih.RectangleGraphics=gn,Ih.ReferenceProperty=vn,Ih.Rotation=yn,Ih.SampledPositionProperty=Cn,Ih.SampledProperty=wn,Ih.ScaledPositionProperty=Sn,Ih.StaticGeometryColorBatch=En,Ih.StaticGeometryPerMaterialBatch=bn,Ih.StaticGroundGeometryColorBatch=Tn,Ih.StaticOutlineGeometryBatch=xn,Ih.StripeMaterialProperty=An,Ih.StripeOrientation=Pn,Ih.TimeIntervalCollectionPositionProperty=Dn,Ih.TimeIntervalCollectionProperty=Mn,Ih.VelocityOrientationProperty=In,Ih.VelocityVectorProperty=Rn,Ih.Visualizer=On,Ih.WallGeometryUpdater=Nn,Ih.WallGraphics=Ln,Ih.AutomaticUniforms=Bn,Ih.Buffer=Fn,Ih.BufferUsage=Vn,Ih.ClearCommand=kn,Ih.ComputeCommand=zn,Ih.ComputeEngine=Un,Ih.Context=Gn,Ih.ContextLimits=Wn,Ih.createUniform=Hn,Ih.createUniformArray=qn,Ih.CubeMap=jn,Ih.CubeMapFace=Yn,Ih.DrawCommand=Xn,Ih.Framebuffer=Zn,Ih.loadCubeMap=Kn,Ih.MipmapHint=Qn,Ih.Pass=Jn,Ih.PassState=$n,Ih.PickFramebuffer=eo,Ih.PixelDatatype=to,Ih.Renderbuffer=io,Ih.RenderbufferFormat=ro,Ih.RenderState=no,Ih.Sampler=oo,Ih.ShaderCache=ao,Ih.ShaderProgram=so,Ih.ShaderSource=lo,Ih.Texture=uo,Ih.TextureMagnificationFilter=co,Ih.TextureMinificationFilter=ho,Ih.TextureWrap=po,Ih.UniformState=mo,Ih.VertexArray=fo,Ih.VertexArrayFacade=_o,Ih.Appearance=go,Ih.ArcGisMapServerImageryProvider=vo,Ih.BatchTable=yo,Ih.Billboard=Co,Ih.BillboardCollection=wo,Ih.BingMapsImageryProvider=So,Ih.BingMapsStyle=Eo,Ih.BlendEquation=bo,Ih.BlendFunction=To,Ih.BlendingState=xo,Ih.Camera=Ao,Ih.CameraEventAggregator=Po,Ih.CameraEventType=Do,Ih.CameraFlightPath=Mo,Ih.ColorBlendMode=Io,Ih.createOpenStreetMapImageryProvider=Ro,Ih.createTangentSpaceDebugPrimitive=Oo,Ih.createTileMapServiceImageryProvider=No,Ih.CreditDisplay=Lo,Ih.CullFace=Bo,Ih.CullingVolume=Fo,Ih.DebugAppearance=Vo,Ih.DebugCameraPrimitive=ko,Ih.DebugModelMatrixPrimitive=zo,Ih.DepthFunction=Uo,Ih.DepthPlane=Go,Ih.DeviceOrientationCameraController=Wo,Ih.DiscardMissingTileImagePolicy=Ho,Ih.EllipsoidPrimitive=qo,Ih.EllipsoidSurfaceAppearance=jo,Ih.Fog=Yo,Ih.FrameRateMonitor=Xo,Ih.FrameState=Zo,Ih.FrustumCommands=Ko,Ih.FXAA=Qo,Ih.getAttributeOrUniformBySemantic=Jo,Ih.getBinaryAccessor=$o,Ih.GetFeatureInfoFormat=ea,Ih.Globe=ta,Ih.GlobeDepth=ia,Ih.GlobeSurfaceShaderSet=ra,Ih.GlobeSurfaceTile=na,Ih.GlobeSurfaceTileProvider=oa,Ih.GoogleEarthImageryProvider=aa,Ih.GridImageryProvider=sa,Ih.GroundPrimitive=la,Ih.HeightReference=ua,Ih.HorizontalOrigin=ca,Ih.Imagery=ha,Ih.ImageryLayer=da,Ih.ImageryLayerCollection=pa,Ih.ImageryLayerFeatureInfo=ma,Ih.ImageryProvider=fa,Ih.ImageryState=_a,Ih.Label=ga,Ih.LabelCollection=va,Ih.LabelStyle=ya,Ih.MapboxImageryProvider=Ca,Ih.MapMode2D=wa,Ih.Material=Sa,Ih.MaterialAppearance=Ea,Ih.Model=ba,Ih.ModelAnimation=Ta,Ih.ModelAnimationCache=xa,Ih.ModelAnimationCollection=Aa,Ih.ModelAnimationLoop=Pa,Ih.ModelAnimationState=Da,Ih.ModelMaterial=Ma,Ih.modelMaterialsCommon=Ia,Ih.ModelMesh=Ra,Ih.ModelNode=Oa,Ih.Moon=Na,Ih.NeverTileDiscardPolicy=La,Ih.OIT=Ba,Ih.OrthographicFrustum=Fa,Ih.PerformanceDisplay=Va,Ih.PerInstanceColorAppearance=ka,Ih.PerspectiveFrustum=za,Ih.PerspectiveOffCenterFrustum=Ua,Ih.PickDepth=Ga,Ih.PointAppearance=Wa,Ih.PointPrimitive=Ha,Ih.PointPrimitiveCollection=qa,Ih.Polyline=ja,Ih.PolylineCollection=Ya,Ih.PolylineColorAppearance=Xa,Ih.PolylineMaterialAppearance=Za,Ih.Primitive=Ka,Ih.PrimitiveCollection=Qa,Ih.PrimitivePipeline=Ja,Ih.PrimitiveState=$a,Ih.QuadtreeOccluders=es,Ih.QuadtreePrimitive=ts,Ih.QuadtreeTile=is,Ih.QuadtreeTileLoadState=rs,Ih.QuadtreeTileProvider=ns,Ih.Scene=os,Ih.SceneMode=as,Ih.SceneTransforms=ss,Ih.SceneTransitioner=ls,Ih.ScreenSpaceCameraController=us,Ih.ShadowMap=cs,Ih.ShadowMapShader=hs,Ih.ShadowMode=ds,Ih.SingleTileImageryProvider=ps,Ih.SkyAtmosphere=ms,Ih.SkyBox=fs,Ih.StencilFunction=_s,Ih.StencilOperation=gs,Ih.Sun=vs,Ih.SunPostProcess=ys,Ih.TerrainState=Cs,Ih.TextureAtlas=ws,Ih.TileBoundingBox=Ss,Ih.TileCoordinatesImageryProvider=Es,Ih.TileDiscardPolicy=bs,Ih.TileImagery=Ts,Ih.TileReplacementQueue=xs,Ih.TileState=As,Ih.TileTerrain=Ps,Ih.TweenCollection=Ds,Ih.UrlTemplateImageryProvider=Ms,Ih.VerticalOrigin=Is,Ih.ViewportQuad=Rs,Ih.WebMapServiceImageryProvider=Os,Ih.WebMapTileServiceImageryProvider=Ns,Ih._shaders.AdjustTranslucentFS=Ls,Ih._shaders.AllMaterialAppearanceFS=Bs,Ih._shaders.AllMaterialAppearanceVS=Fs,Ih._shaders.BasicMaterialAppearanceFS=Vs,Ih._shaders.BasicMaterialAppearanceVS=ks,Ih._shaders.EllipsoidSurfaceAppearanceFS=zs,Ih._shaders.EllipsoidSurfaceAppearanceVS=Us,Ih._shaders.PerInstanceColorAppearanceFS=Gs,Ih._shaders.PerInstanceColorAppearanceVS=Ws,Ih._shaders.PerInstanceFlatColorAppearanceFS=Hs,Ih._shaders.PerInstanceFlatColorAppearanceVS=qs,Ih._shaders.PointAppearanceFS=js,Ih._shaders.PointAppearanceVS=Ys,Ih._shaders.PolylineColorAppearanceVS=Xs,Ih._shaders.PolylineMaterialAppearanceVS=Zs,Ih._shaders.TexturedMaterialAppearanceFS=Ks,Ih._shaders.TexturedMaterialAppearanceVS=Qs,Ih._shaders.BillboardCollectionFS=Js,Ih._shaders.BillboardCollectionVS=$s,Ih._shaders.degreesPerRadian=el,Ih._shaders.depthRange=tl,Ih._shaders.epsilon1=il,Ih._shaders.epsilon2=rl,Ih._shaders.epsilon3=nl,Ih._shaders.epsilon4=ol,Ih._shaders.epsilon5=al,Ih._shaders.epsilon6=sl,Ih._shaders.epsilon7=ll,Ih._shaders.infinity=ul,Ih._shaders.oneOverPi=cl,Ih._shaders.oneOverTwoPi=hl,Ih._shaders.passCompute=dl,Ih._shaders.passEnvironment=pl,Ih._shaders.passGlobe=ml,Ih._shaders.passGround=fl,Ih._shaders.passOpaque=_l,Ih._shaders.passOverlay=gl,Ih._shaders.passTranslucent=vl,Ih._shaders.pi=yl,Ih._shaders.piOverFour=Cl,Ih._shaders.piOverSix=wl,Ih._shaders.piOverThree=Sl,Ih._shaders.piOverTwo=El,Ih._shaders.radiansPerDegree=bl,Ih._shaders.sceneMode2D=Tl,Ih._shaders.sceneMode3D=xl,Ih._shaders.sceneModeColumbusView=Al,Ih._shaders.sceneModeMorphing=Pl,Ih._shaders.solarRadius=Dl,Ih._shaders.threePiOver2=Ml,Ih._shaders.twoPi=Il,Ih._shaders.webMercatorMaxLatitude=Rl,Ih._shaders.CzmBuiltins=Ol,Ih._shaders.alphaWeight=Nl,Ih._shaders.antialias=Ll,Ih._shaders.cascadeColor=Bl,Ih._shaders.cascadeDistance=Fl,Ih._shaders.cascadeMatrix=Vl,Ih._shaders.cascadeWeights=kl,Ih._shaders.columbusViewMorph=zl,Ih._shaders.computePosition=Ul,Ih._shaders.cosineAndSine=Gl,Ih._shaders.decompressTextureCoordinates=Wl,Ih._shaders.eastNorthUpToEyeCoordinates=Hl,Ih._shaders.ellipsoidContainsPoint=ql,Ih._shaders.ellipsoidNew=jl,Ih._shaders.ellipsoidWgs84TextureCoordinates=Yl,Ih._shaders.equalsEpsilon=Xl,Ih._shaders.eyeOffset=Zl,Ih._shaders.eyeToWindowCoordinates=Kl,Ih._shaders.fog=Ql,Ih._shaders.geodeticSurfaceNormal=Jl,Ih._shaders.getDefaultMaterial=$l,Ih._shaders.getLambertDiffuse=eu,Ih._shaders.getSpecular=tu,Ih._shaders.getWaterNoise=iu,Ih._shaders.getWgs84EllipsoidEC=ru,Ih._shaders.hue=nu,Ih._shaders.isEmpty=ou,Ih._shaders.isFull=au,Ih._shaders.latitudeToWebMercatorFraction=su,Ih._shaders.luminance=lu,Ih._shaders.metersPerPixel=uu,Ih._shaders.modelToWindowCoordinates=cu,Ih._shaders.multiplyWithColorBalance=hu,Ih._shaders.nearFarScalar=du,Ih._shaders.octDecode=pu,Ih._shaders.packDepth=mu,Ih._shaders.phong=fu,Ih._shaders.pointAlongRay=_u,Ih._shaders.rayEllipsoidIntersectionInterval=gu,Ih._shaders.RGBToXYZ=vu,Ih._shaders.saturation=yu,Ih._shaders.shadowDepthCompare=Cu,Ih._shaders.shadowVisibility=wu,Ih._shaders.signNotZero=Su,Ih._shaders.tangentToEyeSpaceMatrix=Eu,Ih._shaders.translateRelativeToEye=bu,Ih._shaders.translucentPhong=Tu,Ih._shaders.transpose=xu,Ih._shaders.unpackDepth=Au,Ih._shaders.windowToEyeCoordinates=Pu,Ih._shaders.XYZToRGB=Du,Ih._shaders.depthRangeStruct=Mu,Ih._shaders.ellipsoid=Iu,Ih._shaders.material=Ru,Ih._shaders.materialInput=Ou,Ih._shaders.ray=Nu,Ih._shaders.raySegment=Lu,Ih._shaders.shadowParameters=Bu,Ih._shaders.CompositeOITFS=Fu,Ih._shaders.DepthPlaneFS=Vu,Ih._shaders.DepthPlaneVS=ku,Ih._shaders.EllipsoidFS=zu,Ih._shaders.EllipsoidVS=Uu,Ih._shaders.GlobeFS=Gu,Ih._shaders.GlobeVS=Wu,Ih._shaders.GroundAtmosphere=Hu,Ih._shaders.BumpMapMaterial=qu,Ih._shaders.CheckerboardMaterial=ju,Ih._shaders.DotMaterial=Yu,Ih._shaders.FadeMaterial=Xu,Ih._shaders.GridMaterial=Zu,Ih._shaders.NormalMapMaterial=Ku,Ih._shaders.PolylineArrowMaterial=Qu,Ih._shaders.PolylineGlowMaterial=Ju,Ih._shaders.PolylineOutlineMaterial=$u,Ih._shaders.RimLightingMaterial=ec,Ih._shaders.StripeMaterial=tc,Ih._shaders.Water=ic,Ih._shaders.PointPrimitiveCollectionFS=rc,Ih._shaders.PointPrimitiveCollectionVS=nc,Ih._shaders.PolylineCommon=oc,Ih._shaders.PolylineFS=ac,Ih._shaders.PolylineVS=sc,Ih._shaders.AdditiveBlend=lc,Ih._shaders.BrightPass=uc,Ih._shaders.FXAA=cc,Ih._shaders.GaussianBlur1D=hc,Ih._shaders.PassThrough=dc,Ih._shaders.ReprojectWebMercatorFS=pc,Ih._shaders.ReprojectWebMercatorVS=mc,Ih._shaders.ShadowVolumeFS=fc,Ih._shaders.ShadowVolumeVS=_c,Ih._shaders.SkyAtmosphereFS=gc,Ih._shaders.SkyAtmosphereVS=vc,Ih._shaders.SkyBoxFS=yc,Ih._shaders.SkyBoxVS=Cc,Ih._shaders.SunFS=wc,Ih._shaders.SunTextureFS=Sc,Ih._shaders.SunVS=Ec,Ih._shaders.ViewportQuadFS=bc,Ih._shaders.ViewportQuadVS=Tc,Ih.Autolinker=xc,Ih["earcut-2.1.1"]=Ac,Ih.gltfDefaults=Pc,Ih.kdbush=Dc,Ih["knockout-3.4.0"]=Mc,Ih["knockout-es5"]=Ic,Ih.knockout=Rc,Ih.measureText=Oc,Ih["mersenne-twister"]=Nc,Ih.NoSleep=Lc,Ih.sprintf=Bc,Ih.topojson=Fc,Ih.Tween=Vc,Ih.Uri=kc,Ih.when=zc,Ih.zip=Uc,Ih.Animation=Gc,Ih.AnimationViewModel=Wc,Ih.BaseLayerPicker=Hc,Ih.BaseLayerPickerViewModel=qc,Ih.createDefaultImageryProviderViewModels=jc,Ih.createDefaultTerrainProviderViewModels=Yc,Ih.ProviderViewModel=Xc,Ih.CesiumInspector=Zc,Ih.CesiumInspectorViewModel=Kc,Ih.CesiumWidget=Qc,Ih.ClockViewModel=Jc,Ih.Command=$c,Ih.createCommand=eh,Ih.FullscreenButton=th,Ih.FullscreenButtonViewModel=ih,Ih.Geocoder=rh,Ih.GeocoderViewModel=nh,Ih.getElement=oh,Ih.HomeButton=ah,Ih.HomeButtonViewModel=sh,Ih.InfoBox=lh,Ih.InfoBoxViewModel=uh,Ih.NavigationHelpButton=ch,Ih.NavigationHelpButtonViewModel=hh,Ih.PerformanceWatchdog=dh,Ih.PerformanceWatchdogViewModel=ph,Ih.SceneModePicker=mh,Ih.SceneModePickerViewModel=fh,Ih.SelectionIndicator=_h,Ih.SelectionIndicatorViewModel=gh,Ih.subscribeAndEvaluate=vh,Ih.SvgPathBindingHandler=yh,Ih.Timeline=Ch,Ih.TimelineHighlightRange=wh,Ih.TimelineTrack=Sh,Ih.ToggleButtonViewModel=Eh,Ih.Viewer=bh,Ih.viewerCesiumInspectorMixin=Th,Ih.viewerDragDropMixin=xh,Ih.viewerPerformanceWatchdogMixin=Ah,Ih.VRButton=Ph,Ih.VRButtonViewModel=Dh,Ih.createTaskProcessorWorker=Mh,Ih}),t(["Cesium"],function(e){"use strict";var t="undefined"!=typeof window?window:"undefined"!=typeof self?self:{};t.Cesium=e},void 0,!0)}(); \ No newline at end of file +!function(){var e,t,i;!function(r){function n(e,t){return w.call(e,t)}function o(e,t){var i,r,n,o,a,s,l,u,c,h,d,p,m=t&&t.split("/"),f=y.map,_=f&&f["*"]||{};if(e){for(e=e.split("/"),a=e.length-1,y.nodeIdCompat&&E.test(e[a])&&(e[a]=e[a].replace(E,"")),"."===e[0].charAt(0)&&m&&(p=m.slice(0,m.length-1),e=p.concat(e)),c=0;c<e.length;c++)if(d=e[c],"."===d)e.splice(c,1),c-=1;else if(".."===d){if(0===c||1===c&&".."===e[2]||".."===e[c-1])continue;c>0&&(e.splice(c-1,2),c-=2)}e=e.join("/")}if((m||_)&&f){for(i=e.split("/"),c=i.length;c>0;c-=1){if(r=i.slice(0,c).join("/"),m)for(h=m.length;h>0;h-=1)if(n=f[m.slice(0,h).join("/")],n&&(n=n[r])){o=n,s=c;break}if(o)break;!l&&_&&_[r]&&(l=_[r],u=c)}!o&&l&&(o=l,s=u),o&&(i.splice(0,s,o),e=i.join("/"))}return e}function a(e,t){return function(){var i=S.call(arguments,0);return"string"!=typeof i[0]&&1===i.length&&i.push(null),m.apply(r,i.concat([e,t]))}}function s(e){return function(t){return o(t,e)}}function l(e){return function(t){g[e]=t}}function u(e){if(n(v,e)){var t=v[e];delete v[e],C[e]=!0,p.apply(r,t)}if(!n(g,e)&&!n(C,e))throw new Error("No "+e);return g[e]}function c(e){var t,i=e?e.indexOf("!"):-1;return i>-1&&(t=e.substring(0,i),e=e.substring(i+1,e.length)),[t,e]}function h(e){return e?c(e):[]}function d(e){return function(){return y&&y.config&&y.config[e]||{}}}var p,m,f,_,g={},v={},y={},C={},w=Object.prototype.hasOwnProperty,S=[].slice,E=/\.js$/;f=function(e,t){var i,r=c(e),n=r[0],a=t[1];return e=r[1],n&&(n=o(n,a),i=u(n)),n?e=i&&i.normalize?i.normalize(e,s(a)):o(e,a):(e=o(e,a),r=c(e),n=r[0],e=r[1],n&&(i=u(n))),{f:n?n+"!"+e:e,n:e,pr:n,p:i}},_={require:function(e){return a(e)},exports:function(e){var t=g[e];return"undefined"!=typeof t?t:g[e]={}},module:function(e){return{id:e,uri:"",exports:g[e],config:d(e)}}},p=function(e,t,i,o){var s,c,d,p,m,y,w,S=[],E=typeof i;if(o=o||e,y=h(o),"undefined"===E||"function"===E){for(t=!t.length&&i.length?["require","exports","module"]:t,m=0;m<t.length;m+=1)if(p=f(t[m],y),c=p.f,"require"===c)S[m]=_.require(e);else if("exports"===c)S[m]=_.exports(e),w=!0;else if("module"===c)s=S[m]=_.module(e);else if(n(g,c)||n(v,c)||n(C,c))S[m]=u(c);else{if(!p.p)throw new Error(e+" missing "+c);p.p.load(p.n,a(o,!0),l(c),{}),S[m]=g[c]}d=i?i.apply(g[e],S):void 0,e&&(s&&s.exports!==r&&s.exports!==g[e]?g[e]=s.exports:d===r&&w||(g[e]=d))}else e&&(g[e]=i)},e=t=m=function(e,t,i,n,o){if("string"==typeof e)return _[e]?_[e](t):u(f(e,h(t)).f);if(!e.splice){if(y=e,y.deps&&m(y.deps,y.callback),!t)return;t.splice?(e=t,t=i,i=null):e=r}return t=t||function(){},"function"==typeof i&&(i=n,n=o),n?p(r,e,t,i):setTimeout(function(){p(r,e,t,i)},4),m},m.config=function(e){return m(e)},e._defined=g,i=function(e,t,i){if("string"!=typeof e)throw new Error("See almond README: incorrect module build, no module name");t.splice||(i=t,t=[]),n(g,e)||n(v,e)||(v[e]=[e,t,i])},i.amd={jQuery:!0}}(),i("Core/appendForwardSlash",[],function(){"use strict";function e(e){return 0!==e.length&&"/"===e[e.length-1]||(e+="/"),e}return e}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,i,r,n){return t(e).then(i,r,n)}function t(e){var t,i;return e instanceof r?t=e:s(e)?(i=a(),e.then(function(e){i.resolve(e)},function(e){i.reject(e)},function(e){i.progress(e)}),t=i.promise):t=n(e),t}function i(t){return e(t,o)}function r(e){this.then=e}function n(e){var i=new r(function(i){try{return t(i?i(e):e)}catch(e){return o(e)}});return i}function o(e){var i=new r(function(i,r){try{return r?t(r(e)):o(e)}catch(e){return o(e)}});return i}function a(){function e(e,t,i){return d(e,t,i)}function i(e){return m(e)}function n(e){return m(o(e))}function s(e){return p(e)}var l,u,c,h,d,p,m;return u=new r(e),l={then:e,resolve:i,reject:n,progress:s,promise:u,resolver:{resolve:i,reject:n,progress:s}},c=[],h=[],d=function(e,t,i){var r,n;return r=a(),n="function"==typeof i?function(e){try{r.progress(i(e))}catch(e){r.progress(e)}}:function(e){r.progress(e)},c.push(function(i){i.then(e,t).then(r.resolve,r.reject,n)}),h.push(n),r.promise},p=function(e){return f(h,e),e},m=function(e){return e=t(e),d=e.then,m=t,p=g,f(c,e),h=c=w,e},l}function s(e){return e&&"function"==typeof e.then}function l(t,i,r,n,o){return _(2,arguments),e(t,function(t){function s(e){f(e)}function l(e){m(e)}var u,c,h,d,p,m,f,_,v,y;if(v=t.length>>>0,u=Math.max(0,Math.min(i,v)),h=[],c=v-u+1,d=[],p=a(),u)for(_=p.progress,f=function(e){d.push(e),--c||(m=f=g,p.reject(d))},m=function(e){h.push(e),--u||(m=f=g,p.resolve(h))},y=0;y<v;++y)y in t&&e(t[y],l,s,_);else p.resolve(h);return p.then(r,n,o)})}function u(e,t,i,r){function n(e){return t?t(e[0]):e[0]}return l(e,1,n,i,r)}function c(e,t,i,r){return _(1,arguments),d(e,v).then(t,i,r)}function h(){return d(arguments,v)}function d(t,i){return e(t,function(t){var r,n,o,s,l,u;if(o=n=t.length>>>0,r=[],u=a(),o)for(s=function(t,n){e(t,i).then(function(e){r[n]=e,--o||u.resolve(r)},u.reject)},l=0;l<n;l++)l in t?s(t[l],l):--o;else u.resolve(r);return u.promise})}function p(t,i){var r=C.call(arguments,1);return e(t,function(t){var n;return n=t.length,r[0]=function(t,r,o){return e(t,function(t){return e(r,function(e){return i(t,e,o,n)})})},y.apply(t,r)})}function m(t,i,r){var n=arguments.length>2;return e(t,function(e){return e=n?r:e,i.resolve(e),e},function(e){return i.reject(e),o(e)},i.progress)}function f(e,t){for(var i,r=0;i=e[r++];)i(t)}function _(e,t){for(var i,r=t.length;r>e;)if(i=t[--r],null!=i&&"function"!=typeof i)throw new Error("arg "+r+" must be a function")}function g(){}function v(e){return e}var y,C,w;return e.defer=a,e.resolve=t,e.reject=i,e.join=h,e.all=c,e.map=d,e.reduce=p,e.any=u,e.some=l,e.chain=m,e.isPromise=s,r.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(w,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return c(t,function(t){return e.apply(w,t)})})}},C=[].slice,y=[].reduce||function(e){var t,i,r,n,o;if(o=0,t=Object(this),n=t.length>>>0,i=arguments,i.length<=1)for(;;){if(o in t){r=t[o++];break}if(++o>=n)throw new TypeError}else r=i[1];for(;o<n;++o)o in t&&(r=e(r,t[o],o,t));return r},e})}("function"==typeof i&&i.amd?i:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),i("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),i("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),i=Object.defineProperties;return t&&e(i)||(i=function(e){return e}),i}),i("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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}),i("Core/Credit",["./defined","./defineProperties","./DeveloperError"],function(e,t,i){"use strict";function r(t,i,r){var a=e(r),s=e(i),l=e(t);l||s||(t=r),this._text=t,this._imageUrl=i,this._link=r,this._hasLink=a,this._hasImage=s;var u,c=JSON.stringify([t,i,r]);e(o[c])?u=o[c]:(u=n++,o[c]=u),this._id=u}var n=0,o={};return t(r.prototype,{text:{get:function(){return this._text}},imageUrl:{get:function(){return this._imageUrl}},link:{get:function(){return this._link}},id:{get:function(){return this._id}}}),r.prototype.hasImage=function(){return this._hasImage},r.prototype.hasLink=function(){return this._hasLink},r.equals=function(t,i){return t===i||e(t)&&e(i)&&t._id===i._id},r.prototype.equals=function(e){return r.equals(this,e)},r}),i("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),i("Core/defaultValue",["./freezeObject"],function(e){"use strict";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),i("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function i(e){return e+" is required, actual value was undefined"}function r(e,t,i){return"Expected "+i+" to be typeof "+t+", actual typeof was "+e}var n={};return n.typeOf={},n.defined=function(r,n){if(!e(n))throw new t(i(r))},n.typeOf.func=function(e,i){if("function"!=typeof i)throw new t(r(typeof i,"function",e))},n.typeOf.string=function(e,i){if("string"!=typeof i)throw new t(r(typeof i,"string",e))},n.typeOf.number=function(e,i){if("number"!=typeof i)throw new t(r(typeof i,"number",e))},n.typeOf.number.lessThan=function(e,i,r){if(n.typeOf.number(e,i),i>=r)throw new t("Expected "+e+" to be less than "+r+", actual value was "+i)},n.typeOf.number.lessThanOrEquals=function(e,i,r){if(n.typeOf.number(e,i),i>r)throw new t("Expected "+e+" to be less than or equal to "+r+", actual value was "+i)},n.typeOf.number.greaterThan=function(e,i,r){if(n.typeOf.number(e,i),i<=r)throw new t("Expected "+e+" to be greater than "+r+", actual value was "+i)},n.typeOf.number.greaterThanOrEquals=function(e,i,r){if(n.typeOf.number(e,i),i<r)throw new t("Expected "+e+" to be greater than or equal to"+r+", actual value was "+i)},n.typeOf.object=function(e,i){if("object"!=typeof i)throw new t(r(typeof i,"object",e))},n.typeOf.bool=function(e,i){if("boolean"!=typeof i)throw new t(r(typeof i,"boolean",e))},n}),i("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 i;for(this.mti==this.N+1&&this.init_genrand(5489),i=0;i<this.N-this.M;i++)e=this.mt[i]&this.UPPER_MASK|this.mt[i+1]&this.LOWER_MASK,this.mt[i]=this.mt[i+this.M]^e>>>1^t[1&e];for(;i<this.N-1;i++)e=this.mt[i]&this.UPPER_MASK|this.mt[i+1]&this.LOWER_MASK,this.mt[i]=this.mt[i+(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^=e<<7&2636928640,e^=e<<15&4022730752,e^=e>>>18,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),i("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,i,r){"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:e<0?-1:0},n.signNotZero=function(e){return e<0?-1:1},n.toSNorm=function(e,i){return i=t(i,255),Math.round((.5*n.clamp(e,-1,1)+.5)*i)},n.fromSNorm=function(e,i){return i=t(i,255),n.clamp(e,0,i)/i*2-1},n.sinh=function(e){var t=Math.pow(Math.E,e),i=Math.pow(Math.E,-1*e);return.5*(t-i)},n.cosh=function(e){var t=Math.pow(Math.E,e),i=Math.pow(Math.E,-1*e);return.5*(t+i)},n.lerp=function(e,t,i){return(1-i)*e+i*t},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=3*Math.PI*.5,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){return e*n.RADIANS_PER_DEGREE},n.toDegrees=function(e){return e*n.DEGREES_PER_RADIAN},n.convertLongitudeRange=function(e){var t=n.TWO_PI,i=e-Math.floor(e/t)*t;return i<-Math.PI?i+t:i>=Math.PI?i-t:i},n.clampToLatitudeRange=function(e){return n.clamp(e,-1*n.PI_OVER_TWO,n.PI_OVER_TWO)},n.negativePiToPi=function(e){return n.zeroToTwoPi(e+n.PI)-n.PI},n.zeroToTwoPi=function(e){var t=n.mod(e,n.TWO_PI);return Math.abs(t)<n.EPSILON14&&Math.abs(e)>n.EPSILON14?n.TWO_PI:t},n.mod=function(e,t){return(e%t+t)%t},n.equalsEpsilon=function(e,i,r,n){n=t(n,r);var o=Math.abs(e-i);return o<=n||o<=r*Math.max(Math.abs(e),Math.abs(i))};var o=[1];n.factorial=function(e){var t=o.length;if(e>=t)for(var i=o[t-1],r=t;r<=e;r++)o.push(i*r);return o[e]},n.incrementWrap=function(e,i,r){return r=t(r,0),++e,e>i&&(e=r),e},n.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},n.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},n.clamp=function(e,t,i){return e<t?t:e>i?i:e};var a=new e;return n.setRandomNumberSeed=function(t){a=new e(t)},n.nextRandomNumber=function(){return a.random()},n.acosClamped=function(e){return Math.acos(n.clamp(e,-1,1))},n.asinClamped=function(e){return Math.asin(n.clamp(e,-1,1))},n.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},n.logBase=function(e,t){return Math.log(e)/Math.log(t)},n.fog=function(e,t){var i=e*t;return 1-Math.exp(-(i*i))},n}),i("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,i,r,n,o){"use strict";function a(e,i,r){this.x=t(e,0),this.y=t(i,0),this.z=t(r,0)}a.fromSpherical=function(e,r){i(r)||(r=new a);var n=e.clock,o=e.cone,s=t(e.magnitude,1),l=s*Math.sin(o);return r.x=l*Math.cos(n),r.y=l*Math.sin(n),r.z=s*Math.cos(o),r},a.fromElements=function(e,t,r,n){return i(n)?(n.x=e,n.y=t,n.z=r,n):new a(e,t,r)},a.clone=function(e,t){if(i(e))return i(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new a(e.x,e.y,e.z)},a.fromCartesian4=a.clone,a.packedLength=3,a.pack=function(e,i,r){return r=t(r,0),i[r++]=e.x,i[r++]=e.y,i[r]=e.z,i},a.unpack=function(e,r,n){return r=t(r,0),i(n)||(n=new a),n.x=e[r++],n.y=e[r++],n.z=e[r],n},a.packArray=function(e,t){var r=e.length;i(t)?t.length=3*r:t=new Array(3*r);for(var n=0;n<r;++n)a.pack(e[n],t,3*n);return t},a.unpackArray=function(e,t){var r=e.length;i(t)?t.length=r/3:t=new Array(r/3);for(var n=0;n<r;n+=3){var o=n/3;t[o]=a.unpack(e,n,t[o])}return t},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,i){return i.x=Math.min(e.x,t.x),i.y=Math.min(e.y,t.y),i.z=Math.min(e.z,t.z),i},a.maximumByComponent=function(e,t,i){return i.x=Math.max(e.x,t.x),i.y=Math.max(e.y,t.y),i.z=Math.max(e.z,t.z),i},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 s=new a;a.distance=function(e,t){return a.subtract(e,t,s),a.magnitude(s)},a.distanceSquared=function(e,t){return a.subtract(e,t,s),a.magnitudeSquared(s)},a.normalize=function(e,t){var i=a.magnitude(e);return t.x=e.x/i,t.y=e.y/i,t.z=e.z/i,t},a.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},a.multiplyComponents=function(e,t,i){return i.x=e.x*t.x,i.y=e.y*t.y,i.z=e.z*t.z,i},a.divideComponents=function(e,t,i){return i.x=e.x/t.x,i.y=e.y/t.y,i.z=e.z/t.z,i},a.add=function(e,t,i){return i.x=e.x+t.x,i.y=e.y+t.y,i.z=e.z+t.z,i},a.subtract=function(e,t,i){return i.x=e.x-t.x,i.y=e.y-t.y,i.z=e.z-t.z,i},a.multiplyByScalar=function(e,t,i){return i.x=e.x*t,i.y=e.y*t,i.z=e.z*t,i},a.divideByScalar=function(e,t,i){return i.x=e.x/t,i.y=e.y/t,i.z=e.z/t,i},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 l=new a;a.lerp=function(e,t,i,r){return a.multiplyByScalar(t,i,l),r=a.multiplyByScalar(e,1-i,r),a.add(l,r,r)};var u=new a,c=new a;a.angleBetween=function(e,t){a.normalize(e,u),a.normalize(t,c);var i=a.dot(u,c),r=a.magnitude(a.cross(u,c,u));return Math.atan2(r,i)};var h=new a;a.mostOrthogonalAxis=function(e,t){var i=a.normalize(e,h);return a.abs(i,i),t=i.x<=i.y?i.x<=i.z?a.clone(a.UNIT_X,t):a.clone(a.UNIT_Z,t):i.y<=i.z?a.clone(a.UNIT_Y,t):a.clone(a.UNIT_Z,t)},a.equals=function(e,t){return e===t||i(e)&&i(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},a.equalsArray=function(e,t,i){return e.x===t[i]&&e.y===t[i+1]&&e.z===t[i+2]},a.equalsEpsilon=function(e,t,r,n){return e===t||i(e)&&i(t)&&o.equalsEpsilon(e.x,t.x,r,n)&&o.equalsEpsilon(e.y,t.y,r,n)&&o.equalsEpsilon(e.z,t.z,r,n)},a.cross=function(e,t,i){var r=e.x,n=e.y,o=e.z,a=t.x,s=t.y,l=t.z,u=n*l-o*s,c=o*a-r*l,h=r*s-n*a;return i.x=u,i.y=c,i.z=h,i},a.fromDegrees=function(e,t,i,r,n){return e=o.toRadians(e),t=o.toRadians(t),a.fromRadians(e,t,i,r,n)};var d=new a,p=new a,m=new a(40680631590769,40680631590769,40408299984661.445);return a.fromRadians=function(e,r,n,o,s){n=t(n,0);var l=i(o)?o.radiiSquared:m,u=Math.cos(r);d.x=u*Math.cos(e),d.y=u*Math.sin(e),d.z=Math.sin(r),d=a.normalize(d,d),a.multiplyComponents(l,d,p);var c=Math.sqrt(a.dot(d,p));return p=a.divideByScalar(p,c,p),d=a.multiplyByScalar(d,n,d),i(s)||(s=new a),a.add(p,d,s)},a.fromDegreesArray=function(e,t,r){var n=e.length;i(r)?r.length=n/2:r=new Array(n/2);for(var o=0;o<n;o+=2){var s=e[o],l=e[o+1],u=o/2;r[u]=a.fromDegrees(s,l,0,t,r[u])}return r},a.fromRadiansArray=function(e,t,r){var n=e.length;i(r)?r.length=n/2:r=new Array(n/2);for(var o=0;o<n;o+=2){var s=e[o],l=e[o+1],u=o/2;r[u]=a.fromRadians(s,l,0,t,r[u])}return r},a.fromDegreesArrayHeights=function(e,t,r){var n=e.length;i(r)?r.length=n/3:r=new Array(n/3);for(var o=0;o<n;o+=3){var s=e[o],l=e[o+1],u=e[o+2],c=o/3;r[c]=a.fromDegrees(s,l,u,t,r[c])}return r},a.fromRadiansArrayHeights=function(e,t,r){var n=e.length;i(r)?r.length=n/3:r=new Array(n/3);for(var o=0;o<n;o+=3){var s=e[o],l=e[o+1],u=e[o+2],c=o/3;r[c]=a.fromRadians(s,l,u,t,r[c])}return r},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,i){return a.equalsEpsilon(this,e,t,i)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},a}),i("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,i,r){"use strict";function n(i,n,s,l,u){var c=i.x,h=i.y,d=i.z,p=n.x,m=n.y,f=n.z,_=c*c*p*p,g=h*h*m*m,v=d*d*f*f,y=_+g+v,C=Math.sqrt(1/y),w=e.multiplyByScalar(i,C,o);if(y<l)return isFinite(C)?e.clone(w,u):void 0;var S=s.x,E=s.y,b=s.z,T=a;T.x=w.x*S*2,T.y=w.y*E*2,T.z=w.z*b*2;var x,A,P,D,M,I,R,O,N,L,B,F=(1-C)*e.magnitude(i)/(.5*e.magnitude(T)),V=0;do{F-=V,P=1/(1+F*S),D=1/(1+F*E),M=1/(1+F*b),I=P*P,R=D*D,O=M*M,N=I*P,L=R*D,B=O*M,x=_*I+g*R+v*O-1,A=_*N*S+g*L*E+v*B*b;var k=-2*A;V=x/k}while(Math.abs(x)>r.EPSILON12);return t(u)?(u.x=c*P,u.y=h*D,u.z=d*M,u):new e(c*P,h*D,d*M)}var o=new e,a=new e;return n}),i("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,i,r,n,o,a){"use strict";function s(e,i,r){this.longitude=t(e,0),this.latitude=t(i,0),this.height=t(r,0)}s.fromRadians=function(e,r,n,o){return n=t(n,0),i(o)?(o.longitude=e,o.latitude=r,o.height=n,o):new s(e,r,n)},s.fromDegrees=function(e,t,i,r){return e=o.toRadians(e),t=o.toRadians(t),s.fromRadians(e,t,i,r)};var l=new e,u=new e,c=new e,h=new e(1/6378137,1/6378137,1/6356752.314245179),d=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),p=o.EPSILON1;return s.fromCartesian=function(t,r,n){var m=i(r)?r.oneOverRadii:h,f=i(r)?r.oneOverRadiiSquared:d,_=i(r)?r._centerToleranceSquared:p,g=a(t,m,f,_,u);if(i(g)){var v=e.multiplyComponents(g,f,l);v=e.normalize(v,v);var y=e.subtract(t,g,c),C=Math.atan2(v.y,v.x),w=Math.asin(v.z),S=o.sign(e.dot(y,t))*e.magnitude(y);return i(n)?(n.longitude=C,n.latitude=w,n.height=S,n):new s(C,w,S)}},s.clone=function(e,t){if(i(e))return i(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new s(e.longitude,e.latitude,e.height)},s.equals=function(e,t){return e===t||i(e)&&i(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},s.equalsEpsilon=function(e,t,r){return e===t||i(e)&&i(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},s.ZERO=n(new s(0,0,0)),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.longitude+", "+this.latitude+", "+this.height+")"},s}),i("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(t,r,n,o){r=i(r,0),n=i(n,0),o=i(o,0),t._radii=new e(r,n,o),t._radiiSquared=new e(r*r,n*n,o*o),t._radiiToTheFourth=new e(r*r*r*r,n*n*n*n,o*o*o*o),t._oneOverRadii=new e(0===r?0:1/r,0===n?0:1/n,0===o?0:1/o),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===n?0:1/(n*n),0===o?0:1/(o*o)),t._minimumRadius=Math.min(r,n,o),t._maximumRadius=Math.max(r,n,o),t._centerToleranceSquared=s.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function c(e,t,i){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,u(this,e,t,i)}n(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,i){if(r(t)){var n=t._radii;return r(i)?(e.clone(n,i._radii),e.clone(t._radiiSquared,i._radiiSquared),e.clone(t._radiiToTheFourth,i._radiiToTheFourth),e.clone(t._oneOverRadii,i._oneOverRadii),e.clone(t._oneOverRadiiSquared,i._oneOverRadiiSquared),i._minimumRadius=t._minimumRadius,i._maximumRadius=t._maximumRadius,i._centerToleranceSquared=t._centerToleranceSquared,i):new c(n.x,n.y,n.z)}},c.fromCartesian3=function(e,t){return r(t)||(t=new c),r(e)?(u(t,e.x,e.y,e.z),t):t},c.WGS84=a(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=a(new c(1,1,1)),c.MOON=a(new c(s.LUNAR_RADIUS,s.LUNAR_RADIUS,s.LUNAR_RADIUS)),c.prototype.clone=function(e){return c.clone(this,e)},c.packedLength=e.packedLength,c.pack=function(t,r,n){return n=i(n,0),e.pack(t._radii,r,n),r},c.unpack=function(t,r,n){r=i(r,0);var o=e.unpack(t,r);return c.fromCartesian3(o,n)},c.prototype.geocentricSurfaceNormal=e.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(t,i){var n=t.longitude,o=t.latitude,a=Math.cos(o),s=a*Math.cos(n),l=a*Math.sin(n),u=Math.sin(o);return r(i)||(i=new e),i.x=s,i.y=l,i.z=u,e.normalize(i,i)},c.prototype.geodeticSurfaceNormal=function(t,i){return r(i)||(i=new e),i=e.multiplyComponents(t,this._oneOverRadiiSquared,i),e.normalize(i,i)};var h=new e,d=new e;c.prototype.cartographicToCartesian=function(t,i){var n=h,o=d;this.geodeticSurfaceNormalCartographic(t,n),e.multiplyComponents(this._radiiSquared,n,o);var a=Math.sqrt(e.dot(n,o));return e.divideByScalar(o,a,o),e.multiplyByScalar(n,t.height,n),r(i)||(i=new e),e.add(o,n,i)},c.prototype.cartographicArrayToCartesianArray=function(e,t){var i=e.length;r(t)?t.length=i:t=new Array(i);for(var n=0;n<i;n++)t[n]=this.cartographicToCartesian(e[n],t[n]);return t};var p=new e,m=new e,f=new e;return c.prototype.cartesianToCartographic=function(i,n){var o=this.scaleToGeodeticSurface(i,m);if(r(o)){var a=this.geodeticSurfaceNormal(o,p),l=e.subtract(i,o,f),u=Math.atan2(a.y,a.x),c=Math.asin(a.z),h=s.sign(e.dot(l,i))*e.magnitude(l);return r(n)?(n.longitude=u,n.latitude=c,n.height=h,n):new t(u,c,h)}},c.prototype.cartesianArrayToCartographicArray=function(e,t){var i=e.length;r(t)?t.length=i:t=new Array(i);for(var n=0;n<i;++n)t[n]=this.cartesianToCartographic(e[n],t[n]);return t},c.prototype.scaleToGeodeticSurface=function(e,t){return l(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},c.prototype.scaleToGeocentricSurface=function(t,i){r(i)||(i=new e);var n=t.x,o=t.y,a=t.z,s=this._oneOverRadiiSquared,l=1/Math.sqrt(n*n*s.x+o*o*s.y+a*a*s.z);return e.multiplyByScalar(t,l,i)},c.prototype.transformPositionToScaledSpace=function(t,i){return r(i)||(i=new e),e.multiplyComponents(t,this._oneOverRadii,i)},c.prototype.transformPositionFromScaledSpace=function(t,i){return r(i)||(i=new e),e.multiplyComponents(t,this._radii,i)},c.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},c.prototype.toString=function(){return this._radii.toString()},c.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,n,o){n=i(n,0);var a=this._sqauredXOverSquaredZ;if(r(o)||(o=new e),o.x=0,o.y=0,o.z=t.z*(1-a),!(Math.abs(o.z)>=this._radii.z-n))return o},c}),i("Core/Event",["./defined","./defineProperties","./DeveloperError"],function(e,t,i){"use strict";function r(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}return t(r.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}}),r.prototype.addEventListener=function(e,t){this._listeners.push(e),this._scopes.push(t);var i=this;return function(){i.removeEventListener(e,t)}},r.prototype.removeEventListener=function(e,t){for(var i=this._listeners,r=this._scopes,n=-1,o=0;o<i.length;o++)if(i[o]===e&&r[o]===t){n=o;break}return n!==-1&&(this._insideRaiseEvent?(this._toRemove.push(n),i[n]=void 0,r[n]=void 0):(i.splice(n,1),r.splice(n,1)),!0)},r.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;var t,i=this._listeners,r=this._scopes,n=i.length;for(t=0;t<n;t++){var o=i[t];e(o)&&i[t].apply(r[t],arguments)}var a=this._toRemove;for(n=a.length,t=0;t<n;t++){var s=a[t];i.splice(s,1),r.splice(s,1)}a.length=0,this._insideRaiseEvent=!1},r}),i("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,i,r,n,o){"use strict";function a(e,i){this.x=t(e,0),this.y=t(i,0)}a.fromElements=function(e,t,r){return i(r)?(r.x=e,r.y=t,r):new a(e,t)},a.clone=function(e,t){if(i(e))return i(t)?(t.x=e.x,t.y=e.y,t):new a(e.x,e.y)},a.fromCartesian3=a.clone,a.fromCartesian4=a.clone,a.packedLength=2,a.pack=function(e,i,r){return r=t(r,0),i[r++]=e.x,i[r]=e.y,i},a.unpack=function(e,r,n){return r=t(r,0),i(n)||(n=new a),n.x=e[r++],n.y=e[r],n},a.packArray=function(e,t){var r=e.length;i(t)?t.length=2*r:t=new Array(2*r);for(var n=0;n<r;++n)a.pack(e[n],t,2*n);return t},a.unpackArray=function(e,t){var r=e.length;i(t)?t.length=r/2:t=new Array(r/2);for(var n=0;n<r;n+=2){var o=n/2;t[o]=a.unpack(e,n,t[o])}return t},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,i){return i.x=Math.min(e.x,t.x),i.y=Math.min(e.y,t.y),i},a.maximumByComponent=function(e,t,i){return i.x=Math.max(e.x,t.x),i.y=Math.max(e.y,t.y),i},a.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},a.magnitude=function(e){return Math.sqrt(a.magnitudeSquared(e))};var s=new a;a.distance=function(e,t){return a.subtract(e,t,s),a.magnitude(s)},a.distanceSquared=function(e,t){return a.subtract(e,t,s),a.magnitudeSquared(s)},a.normalize=function(e,t){var i=a.magnitude(e);return t.x=e.x/i,t.y=e.y/i,t},a.dot=function(e,t){return e.x*t.x+e.y*t.y},a.multiplyComponents=function(e,t,i){return i.x=e.x*t.x,i.y=e.y*t.y,i},a.divideComponents=function(e,t,i){return i.x=e.x/t.x,i.y=e.y/t.y,i},a.add=function(e,t,i){return i.x=e.x+t.x,i.y=e.y+t.y,i},a.subtract=function(e,t,i){return i.x=e.x-t.x,i.y=e.y-t.y,i},a.multiplyByScalar=function(e,t,i){return i.x=e.x*t,i.y=e.y*t,i},a.divideByScalar=function(e,t,i){return i.x=e.x/t,i.y=e.y/t,i},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 l=new a;a.lerp=function(e,t,i,r){return a.multiplyByScalar(t,i,l),r=a.multiplyByScalar(e,1-i,r),a.add(l,r,r)};var u=new a,c=new a;a.angleBetween=function(e,t){return a.normalize(e,u),a.normalize(t,c),o.acosClamped(a.dot(u,c))};var h=new a;return a.mostOrthogonalAxis=function(e,t){var i=a.normalize(e,h);return a.abs(i,i),t=i.x<=i.y?a.clone(a.UNIT_X,t):a.clone(a.UNIT_Y,t)},a.equals=function(e,t){return e===t||i(e)&&i(t)&&e.x===t.x&&e.y===t.y},a.equalsArray=function(e,t,i){return e.x===t[i]&&e.y===t[i+1]},a.equalsEpsilon=function(e,t,r,n){return e===t||i(e)&&i(t)&&o.equalsEpsilon(e.x,t.x,r,n)&&o.equalsEpsilon(e.y,t.y,r,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,i){return a.equalsEpsilon(this,e,t,i)},a.prototype.toString=function(){return"("+this.x+", "+this.y+")"},a}),i("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,i,r,n,o,a){"use strict";function s(e){this._ellipsoid=i(e,a.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return n(s.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),s.prototype.project=function(t,i){var n=this._semimajorAxis,o=t.longitude*n,a=t.latitude*n,s=t.height;return r(i)?(i.x=o,i.y=a,i.z=s,i):new e(o,a,s)},s.prototype.unproject=function(e,i){var n=this._oneOverSemimajorAxis,o=e.x*n,a=e.y*n,s=e.z;return r(i)?(i.longitude=o,i.latitude=a,i.height=s,i):new t(o,a,s)},s}),i("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(e,t,r,n){this.west=i(e,0),this.south=i(t,0),this.east=i(r,0),this.north=i(n,0)}n(u.prototype,{width:{get:function(){return u.computeWidth(this)}},height:{get:function(){return u.computeHeight(this)}}}),u.packedLength=4,u.pack=function(e,t,r){return r=i(r,0),t[r++]=e.west,t[r++]=e.south,t[r++]=e.east,t[r]=e.north,t},u.unpack=function(e,t,n){return t=i(t,0),r(n)||(n=new u),n.west=e[t++],n.south=e[t++],n.east=e[t++],n.north=e[t],n},u.computeWidth=function(e){var t=e.east,i=e.west;return t<i&&(t+=l.TWO_PI),t-i},u.computeHeight=function(e){return e.north-e.south},u.fromDegrees=function(e,t,n,o,a){return e=l.toRadians(i(e,0)),t=l.toRadians(i(t,0)),n=l.toRadians(i(n,0)),o=l.toRadians(i(o,0)),r(a)?(a.west=e,a.south=t,a.east=n,a.north=o,a):new u(e,t,n,o)},u.fromRadians=function(e,t,n,o,a){return r(a)?(a.west=i(e,0),a.south=i(t,0),a.east=i(n,0),a.north=i(o,0),a):new u(e,t,n,o)},u.fromCartographicArray=function(e,t){for(var i=Number.MAX_VALUE,n=-Number.MAX_VALUE,o=Number.MAX_VALUE,a=-Number.MAX_VALUE,s=Number.MAX_VALUE,c=-Number.MAX_VALUE,h=0,d=e.length;h<d;h++){var p=e[h];i=Math.min(i,p.longitude),n=Math.max(n,p.longitude),s=Math.min(s,p.latitude),c=Math.max(c,p.latitude);var m=p.longitude>=0?p.longitude:p.longitude+l.TWO_PI;o=Math.min(o,m),a=Math.max(a,m)}return n-i>a-o&&(i=o,n=a,n>l.PI&&(n-=l.TWO_PI),i>l.PI&&(i-=l.TWO_PI)),r(t)?(t.west=i,t.south=s,t.east=n,t.north=c,t):new u(i,s,n,c)},u.fromCartesianArray=function(e,t,i){for(var n=Number.MAX_VALUE,o=-Number.MAX_VALUE,a=Number.MAX_VALUE,s=-Number.MAX_VALUE,c=Number.MAX_VALUE,h=-Number.MAX_VALUE,d=0,p=e.length;d<p;d++){var m=t.cartesianToCartographic(e[d]);n=Math.min(n,m.longitude),o=Math.max(o,m.longitude), +c=Math.min(c,m.latitude),h=Math.max(h,m.latitude);var f=m.longitude>=0?m.longitude:m.longitude+l.TWO_PI;a=Math.min(a,f),s=Math.max(s,f)}return o-n>s-a&&(n=a,o=s,o>l.PI&&(o-=l.TWO_PI),n>l.PI&&(n-=l.TWO_PI)),r(i)?(i.west=n,i.south=c,i.east=o,i.north=h,i):new u(n,c,o,h)},u.clone=function(e,t){if(r(e))return 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)},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(e){},u.southwest=function(t,i){return r(i)?(i.longitude=t.west,i.latitude=t.south,i.height=0,i):new e(t.west,t.south)},u.northwest=function(t,i){return r(i)?(i.longitude=t.west,i.latitude=t.north,i.height=0,i):new e(t.west,t.north)},u.northeast=function(t,i){return r(i)?(i.longitude=t.east,i.latitude=t.north,i.height=0,i):new e(t.east,t.north)},u.southeast=function(t,i){return r(i)?(i.longitude=t.east,i.latitude=t.south,i.height=0,i):new e(t.east,t.south)},u.center=function(t,i){var n=t.east,o=t.west;n<o&&(n+=l.TWO_PI);var a=l.negativePiToPi(.5*(o+n)),s=.5*(t.south+t.north);return r(i)?(i.longitude=a,i.latitude=s,i.height=0,i):new e(a,s)},u.intersection=function(e,t,i){var n=e.east,o=e.west,a=t.east,s=t.west;n<o&&a>0?n+=l.TWO_PI:a<s&&n>0&&(a+=l.TWO_PI),n<o&&s<0?s+=l.TWO_PI:a<s&&o<0&&(o+=l.TWO_PI);var c=l.negativePiToPi(Math.max(o,s)),h=l.negativePiToPi(Math.min(n,a));if(!((e.west<e.east||t.west<t.east)&&h<=c)){var d=Math.max(e.south,t.south),p=Math.min(e.north,t.north);if(!(d>=p))return r(i)?(i.west=c,i.south=d,i.east=h,i.north=p,i):new u(c,d,h,p)}},u.simpleIntersection=function(e,t,i){var n=Math.max(e.west,t.west),o=Math.max(e.south,t.south),a=Math.min(e.east,t.east),s=Math.min(e.north,t.north);if(!(o>=s||n>=a))return r(i)?(i.west=n,i.south=o,i.east=a,i.north=s,i):new u(n,o,a,s)},u.union=function(e,t,i){r(i)||(i=new u);var n=e.east,o=e.west,a=t.east,s=t.west;n<o&&a>0?n+=l.TWO_PI:a<s&&n>0&&(a+=l.TWO_PI),n<o&&s<0?s+=l.TWO_PI:a<s&&o<0&&(o+=l.TWO_PI);var c=l.convertLongitudeRange(Math.min(o,s)),h=l.convertLongitudeRange(Math.max(n,a));return i.west=c,i.south=Math.min(e.south,t.south),i.east=h,i.north=Math.max(e.north,t.north),i},u.expand=function(e,t,i){return r(i)||(i=new u),i.west=Math.min(e.west,t.longitude),i.south=Math.min(e.south,t.latitude),i.east=Math.max(e.east,t.longitude),i.north=Math.max(e.north,t.latitude),i},u.contains=function(e,t){var i=t.longitude,r=t.latitude,n=e.west,o=e.east;return o<n&&(o+=l.TWO_PI,i<0&&(i+=l.TWO_PI)),(i>n||l.equalsEpsilon(i,n,l.EPSILON14))&&(i<o||l.equalsEpsilon(i,o,l.EPSILON14))&&r>=e.south&&r<=e.north};var c=new e;return u.subsample=function(e,t,n,o){t=i(t,a.WGS84),n=i(n,0),r(o)||(o=[]);var s=0,h=e.north,d=e.south,p=e.east,m=e.west,f=c;f.height=n,f.longitude=m,f.latitude=h,o[s]=t.cartographicToCartesian(f,o[s]),s++,f.longitude=p,o[s]=t.cartographicToCartesian(f,o[s]),s++,f.latitude=d,o[s]=t.cartographicToCartesian(f,o[s]),s++,f.longitude=m,o[s]=t.cartographicToCartesian(f,o[s]),s++,h<0?f.latitude=h:d>0?f.latitude=d:f.latitude=0;for(var _=1;_<8;++_)f.longitude=-Math.PI+_*l.PI_OVER_TWO,u.contains(e,f)&&(o[s]=t.cartographicToCartesian(f,o[s]),s++);return 0===f.latitude&&(f.longitude=m,o[s]=t.cartographicToCartesian(f,o[s]),s++,f.longitude=p,o[s]=t.cartographicToCartesian(f,o[s]),s++),o.length=s,o},u.MAX_VALUE=s(new u(-Math.PI,-l.PI_OVER_TWO,Math.PI,l.PI_OVER_TWO)),u}),i("Core/GeographicTilingScheme",["./Cartesian2","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./GeographicProjection","./Math","./Rectangle"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(e){e=t(e,{}),this._ellipsoid=t(e.ellipsoid,o.WGS84),this._rectangle=t(e.rectangle,l.MAX_VALUE),this._projection=new a(this._ellipsoid),this._numberOfLevelZeroTilesX=t(e.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=t(e.numberOfLevelZeroTilesY,1)}return r(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}}),u.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e},u.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e},u.prototype.rectangleToNativeRectangle=function(e,t){var r=s.toDegrees(e.west),n=s.toDegrees(e.south),o=s.toDegrees(e.east),a=s.toDegrees(e.north);return i(t)?(t.west=r,t.south=n,t.east=o,t.north=a,t):new l(r,n,o,a)},u.prototype.tileXYToNativeRectangle=function(e,t,i,r){var n=this.tileXYToRectangle(e,t,i,r);return n.west=s.toDegrees(n.west),n.south=s.toDegrees(n.south),n.east=s.toDegrees(n.east),n.north=s.toDegrees(n.north),n},u.prototype.tileXYToRectangle=function(e,t,r,n){var o=this._rectangle,a=this.getNumberOfXTilesAtLevel(r),s=this.getNumberOfYTilesAtLevel(r),u=o.width/a,c=e*u+o.west,h=(e+1)*u+o.west,d=o.height/s,p=o.north-t*d,m=o.north-(t+1)*d;return i(n)||(n=new l(c,m,h,p)),n.west=c,n.south=m,n.east=h,n.north=p,n},u.prototype.positionToTileXY=function(t,r,n){var o=this._rectangle;if(l.contains(o,t)){var a=this.getNumberOfXTilesAtLevel(r),u=this.getNumberOfYTilesAtLevel(r),c=o.width/a,h=o.height/u,d=t.longitude;o.east<o.west&&(d+=s.TWO_PI);var p=(d-o.west)/c|0;p>=a&&(p=a-1);var m=(o.north-t.latitude)/h|0;return m>=u&&(m=u-1),i(n)?(n.x=p,n.y=m,n):new e(p,m)}},u}),i("Core/getImagePixels",["./defined"],function(e){"use strict";function t(t,r,n){e(r)||(r=t.width),e(n)||(n=t.height);var o=i[r];e(o)||(o={},i[r]=o);var a=o[n];if(!e(a)){var s=document.createElement("canvas");s.width=r,s.height=n,a=s.getContext("2d"),a.globalCompositeOperation="copy",o[n]=a}return a.drawImage(t,0,0,r,n),a.getImageData(0,0,r,n).data}var i={};return t}),i("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),i("Core/AxisAlignedBoundingBox",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Intersect"],function(e,t,i,r,n){"use strict";function o(r,n,o){this.minimum=e.clone(t(r,e.ZERO)),this.maximum=e.clone(t(n,e.ZERO)),i(o)?o=e.clone(o):(o=e.add(this.minimum,this.maximum,new e),e.multiplyByScalar(o,.5,o)),this.center=o}o.fromPoints=function(t,r){if(i(r)||(r=new o),!i(t)||0===t.length)return r.minimum=e.clone(e.ZERO,r.minimum),r.maximum=e.clone(e.ZERO,r.maximum),r.center=e.clone(e.ZERO,r.center),r;for(var n=t[0].x,a=t[0].y,s=t[0].z,l=t[0].x,u=t[0].y,c=t[0].z,h=t.length,d=1;d<h;d++){var p=t[d],m=p.x,f=p.y,_=p.z;n=Math.min(m,n),l=Math.max(m,l),a=Math.min(f,a),u=Math.max(f,u),s=Math.min(_,s),c=Math.max(_,c)}var g=r.minimum;g.x=n,g.y=a,g.z=s;var v=r.maximum;v.x=l,v.y=u,v.z=c;var y=e.add(g,v,r.center);return e.multiplyByScalar(y,.5,y),r},o.clone=function(t,r){if(i(t))return i(r)?(r.minimum=e.clone(t.minimum,r.minimum),r.maximum=e.clone(t.maximum,r.maximum),r.center=e.clone(t.center,r.center),r):new o(t.minimum,t.maximum)},o.equals=function(t,r){return t===r||i(t)&&i(r)&&e.equals(t.center,r.center)&&e.equals(t.minimum,r.minimum)&&e.equals(t.maximum,r.maximum)};var a=new e;return o.intersectPlane=function(t,i){a=e.subtract(t.maximum,t.minimum,a);var r=e.multiplyByScalar(a,.5,a),o=i.normal,s=r.x*Math.abs(o.x)+r.y*Math.abs(o.y)+r.z*Math.abs(o.z),l=e.dot(t.center,o)+i.distance;return l-s>0?n.INSIDE:l+s<0?n.OUTSIDE:n.INTERSECTING},o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.intersectPlane=function(e){return o.intersectPlane(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o}),i("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,i){this.start=e(t,0),this.stop=e(i,0)}return t}),i("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,t,r,n,o,a,s,l,u){this[0]=i(e,0),this[1]=i(n,0),this[2]=i(s,0),this[3]=i(t,0),this[4]=i(o,0),this[5]=i(l,0),this[6]=i(r,0),this[7]=i(a,0),this[8]=i(u,0)}function u(e){for(var t=0,i=0;i<9;++i){var r=e[i];t+=r*r}return Math.sqrt(t)}function c(e){for(var t=0,i=0;i<3;++i){var r=e[l.getElementIndex(f[i],m[i])];t+=2*r*r}return Math.sqrt(t)}function h(e,t){for(var i=s.EPSILON15,r=0,n=1,o=0;o<3;++o){var a=Math.abs(e[l.getElementIndex(f[o],m[o])]);a>r&&(n=o,r=a)}var u=1,c=0,h=m[n],d=f[n];if(Math.abs(e[l.getElementIndex(d,h)])>i){var p,_=e[l.getElementIndex(d,d)],g=e[l.getElementIndex(h,h)],v=e[l.getElementIndex(d,h)],y=(_-g)/2/v;p=y<0?-1/(-y+Math.sqrt(1+y*y)):1/(y+Math.sqrt(1+y*y)),u=1/Math.sqrt(1+p*p),c=p*u}return t=l.clone(l.IDENTITY,t),t[l.getElementIndex(h,h)]=t[l.getElementIndex(d,d)]=u,t[l.getElementIndex(d,h)]=c,t[l.getElementIndex(h,d)]=-c,t}l.packedLength=9,l.pack=function(e,t,r){return r=i(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t},l.unpack=function(e,t,n){return t=i(t,0),r(n)||(n=new l),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n},l.clone=function(e,t){if(r(e))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):new l(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},l.fromArray=function(e,t,n){return t=i(t,0),r(n)||(n=new l),n[0]=e[t],n[1]=e[t+1],n[2]=e[t+2],n[3]=e[t+3],n[4]=e[t+4],n[5]=e[t+5],n[6]=e[t+6],n[7]=e[t+7],n[8]=e[t+8],n},l.fromColumnMajorArray=function(e,t){return l.clone(e,t)},l.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 l(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},l.fromQuaternion=function(e,t){var i=e.x*e.x,n=e.x*e.y,o=e.x*e.z,a=e.x*e.w,s=e.y*e.y,u=e.y*e.z,c=e.y*e.w,h=e.z*e.z,d=e.z*e.w,p=e.w*e.w,m=i-s-h+p,f=2*(n-d),_=2*(o+c),g=2*(n+d),v=-i+s-h+p,y=2*(u-a),C=2*(o-c),w=2*(u+a),S=-i-s+h+p;return r(t)?(t[0]=m,t[1]=g,t[2]=C,t[3]=f,t[4]=v,t[5]=w,t[6]=_,t[7]=y,t[8]=S,t):new l(m,f,_,g,v,y,C,w,S)},l.fromHeadingPitchRoll=function(e,t){var i=Math.cos(-e.pitch),n=Math.cos(-e.heading),o=Math.cos(e.roll),a=Math.sin(-e.pitch),s=Math.sin(-e.heading),u=Math.sin(e.roll),c=i*n,h=-o*s+u*a*n,d=u*s+o*a*n,p=i*s,m=o*n+u*a*s,f=-a*o+o*a*s,_=-a,g=u*i,v=o*i;return r(t)?(t[0]=c,t[1]=p,t[2]=_,t[3]=h,t[4]=m,t[5]=g,t[6]=d,t[7]=f,t[8]=v,t):new l(c,h,d,p,m,f,_,g,v)},l.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 l(e.x,0,0,0,e.y,0,0,0,e.z)},l.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 l(e,0,0,0,e,0,0,0,e)},l.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 l(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},l.fromRotationX=function(e,t){var i=Math.cos(e),n=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=i,t[5]=n,t[6]=0,t[7]=-n,t[8]=i,t):new l(1,0,0,0,i,-n,0,n,i)},l.fromRotationY=function(e,t){var i=Math.cos(e),n=Math.sin(e);return r(t)?(t[0]=i,t[1]=0,t[2]=-n,t[3]=0,t[4]=1,t[5]=0,t[6]=n,t[7]=0,t[8]=i,t):new l(i,0,n,0,1,0,-n,0,i)},l.fromRotationZ=function(e,t){var i=Math.cos(e),n=Math.sin(e);return r(t)?(t[0]=i,t[1]=n,t[2]=0,t[3]=-n,t[4]=i,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new l(i,-n,0,n,i,0,0,0,1)},l.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]]},l.getElementIndex=function(e,t){return 3*e+t},l.getColumn=function(e,t,i){var r=3*t,n=e[r],o=e[r+1],a=e[r+2];return i.x=n,i.y=o,i.z=a,i},l.setColumn=function(e,t,i,r){r=l.clone(e,r);var n=3*t;return r[n]=i.x,r[n+1]=i.y,r[n+2]=i.z,r},l.getRow=function(e,t,i){var r=e[t],n=e[t+3],o=e[t+6];return i.x=r,i.y=n,i.z=o,i},l.setRow=function(e,t,i,r){return r=l.clone(e,r),r[t]=i.x,r[t+3]=i.y,r[t+6]=i.z,r};var d=new e;l.getScale=function(t,i){return i.x=e.magnitude(e.fromElements(t[0],t[1],t[2],d)),i.y=e.magnitude(e.fromElements(t[3],t[4],t[5],d)),i.z=e.magnitude(e.fromElements(t[6],t[7],t[8],d)),i};var p=new e;l.getMaximumScale=function(t){return l.getScale(t,p),e.maximumComponent(p)},l.multiply=function(e,t,i){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],n=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],o=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],a=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],s=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],l=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],u=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],c=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],h=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return i[0]=r,i[1]=n,i[2]=o,i[3]=a,i[4]=s,i[5]=l,i[6]=u,i[7]=c,i[8]=h,i},l.add=function(e,t,i){return i[0]=e[0]+t[0],i[1]=e[1]+t[1],i[2]=e[2]+t[2],i[3]=e[3]+t[3],i[4]=e[4]+t[4],i[5]=e[5]+t[5],i[6]=e[6]+t[6],i[7]=e[7]+t[7],i[8]=e[8]+t[8],i},l.subtract=function(e,t,i){return i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],i[3]=e[3]-t[3],i[4]=e[4]-t[4],i[5]=e[5]-t[5],i[6]=e[6]-t[6],i[7]=e[7]-t[7],i[8]=e[8]-t[8],i},l.multiplyByVector=function(e,t,i){var r=t.x,n=t.y,o=t.z,a=e[0]*r+e[3]*n+e[6]*o,s=e[1]*r+e[4]*n+e[7]*o,l=e[2]*r+e[5]*n+e[8]*o;return i.x=a,i.y=s,i.z=l,i},l.multiplyByScalar=function(e,t,i){return i[0]=e[0]*t,i[1]=e[1]*t,i[2]=e[2]*t,i[3]=e[3]*t,i[4]=e[4]*t,i[5]=e[5]*t,i[6]=e[6]*t,i[7]=e[7]*t,i[8]=e[8]*t,i},l.multiplyByScale=function(e,t,i){return i[0]=e[0]*t.x,i[1]=e[1]*t.x,i[2]=e[2]*t.x,i[3]=e[3]*t.y,i[4]=e[4]*t.y,i[5]=e[5]*t.y,i[6]=e[6]*t.z,i[7]=e[7]*t.z,i[8]=e[8]*t.z,i},l.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},l.transpose=function(e,t){var i=e[0],r=e[3],n=e[6],o=e[1],a=e[4],s=e[7],l=e[2],u=e[5],c=e[8];return t[0]=i,t[1]=r,t[2]=n,t[3]=o,t[4]=a,t[5]=s,t[6]=l,t[7]=u,t[8]=c,t};var m=[1,0,0],f=[2,2,1],_=new l,g=new l;return l.computeEigenDecomposition=function(e,t){var i=s.EPSILON20,n=10,o=0,a=0;r(t)||(t={});for(var d=t.unitary=l.clone(l.IDENTITY,t.unitary),p=t.diagonal=l.clone(e,t.diagonal),m=i*u(p);a<n&&c(p)>m;)h(p,_),l.transpose(_,g),l.multiply(p,_,p),l.multiply(g,p,p),l.multiply(d,_,d),++o>2&&(++a,o=0);return t},l.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},l.determinant=function(e){var t=e[0],i=e[3],r=e[6],n=e[1],o=e[4],a=e[7],s=e[2],l=e[5],u=e[8];return t*(o*u-l*a)+n*(l*r-i*u)+s*(i*a-o*r)},l.inverse=function(e,t){var i=e[0],r=e[1],n=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],h=e[8],d=l.determinant(e);t[0]=a*h-c*s,t[1]=c*n-r*h,t[2]=r*s-a*n,t[3]=u*s-o*h,t[4]=i*h-u*n,t[5]=o*n-i*s,t[6]=o*c-u*a,t[7]=u*r-i*c,t[8]=i*a-o*r;var p=1/d;return l.multiplyByScalar(t,p,t)},l.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]},l.equalsEpsilon=function(e,t,i){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=i&&Math.abs(e[1]-t[1])<=i&&Math.abs(e[2]-t[2])<=i&&Math.abs(e[3]-t[3])<=i&&Math.abs(e[4]-t[4])<=i&&Math.abs(e[5]-t[5])<=i&&Math.abs(e[6]-t[6])<=i&&Math.abs(e[7]-t[7])<=i&&Math.abs(e[8]-t[8])<=i},l.IDENTITY=a(new l(1,0,0,0,1,0,0,0,1)),l.ZERO=a(new l(0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN1ROW0=3,l.COLUMN1ROW1=4,l.COLUMN1ROW2=5,l.COLUMN2ROW0=6,l.COLUMN2ROW1=7,l.COLUMN2ROW2=8,n(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equalsArray=function(e,t,i){return e[0]===t[i]&&e[1]===t[i+1]&&e[2]===t[i+2]&&e[3]===t[i+3]&&e[4]===t[i+4]&&e[5]===t[i+5]&&e[6]===t[i+6]&&e[7]===t[i+7]&&e[8]===t[i+8]},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},l}),i("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,i,r,n,o){"use strict";function a(e,i,r,n){this.x=t(e,0),this.y=t(i,0),this.z=t(r,0),this.w=t(n,0)}a.fromElements=function(e,t,r,n,o){return i(o)?(o.x=e,o.y=t,o.z=r,o.w=n,o):new a(e,t,r,n)},a.fromColor=function(e,t){return i(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new a(e.red,e.green,e.blue,e.alpha)},a.clone=function(e,t){if(i(e))return i(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new a(e.x,e.y,e.z,e.w)},a.packedLength=4,a.pack=function(e,i,r){return r=t(r,0),i[r++]=e.x,i[r++]=e.y,i[r++]=e.z,i[r]=e.w,i},a.unpack=function(e,r,n){return r=t(r,0),i(n)||(n=new a),n.x=e[r++],n.y=e[r++],n.z=e[r++],n.w=e[r],n},a.packArray=function(e,t){var r=e.length;i(t)?t.length=4*r:t=new Array(4*r);for(var n=0;n<r;++n)a.pack(e[n],t,4*n);return t},a.unpackArray=function(e,t){var r=e.length;i(t)?t.length=r/4:t=new Array(r/4);for(var n=0;n<r;n+=4){var o=n/4;t[o]=a.unpack(e,n,t[o])}return t},a.fromArray=a.unpack,a.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},a.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},a.minimumByComponent=function(e,t,i){return i.x=Math.min(e.x,t.x),i.y=Math.min(e.y,t.y),i.z=Math.min(e.z,t.z),i.w=Math.min(e.w,t.w),i},a.maximumByComponent=function(e,t,i){return i.x=Math.max(e.x,t.x),i.y=Math.max(e.y,t.y),i.z=Math.max(e.z,t.z),i.w=Math.max(e.w,t.w),i},a.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},a.magnitude=function(e){return Math.sqrt(a.magnitudeSquared(e))};var s=new a;a.distance=function(e,t){return a.subtract(e,t,s),a.magnitude(s)},a.distanceSquared=function(e,t){return a.subtract(e,t,s),a.magnitudeSquared(s)},a.normalize=function(e,t){var i=a.magnitude(e);return t.x=e.x/i,t.y=e.y/i,t.z=e.z/i,t.w=e.w/i,t},a.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},a.multiplyComponents=function(e,t,i){return i.x=e.x*t.x,i.y=e.y*t.y,i.z=e.z*t.z,i.w=e.w*t.w,i},a.divideComponents=function(e,t,i){return i.x=e.x/t.x,i.y=e.y/t.y,i.z=e.z/t.z,i.w=e.w/t.w,i},a.add=function(e,t,i){return i.x=e.x+t.x,i.y=e.y+t.y,i.z=e.z+t.z,i.w=e.w+t.w,i},a.subtract=function(e,t,i){return i.x=e.x-t.x,i.y=e.y-t.y,i.z=e.z-t.z,i.w=e.w-t.w,i},a.multiplyByScalar=function(e,t,i){return i.x=e.x*t,i.y=e.y*t,i.z=e.z*t,i.w=e.w*t,i},a.divideByScalar=function(e,t,i){return i.x=e.x/t,i.y=e.y/t,i.z=e.z/t,i.w=e.w/t,i},a.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,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.w=Math.abs(e.w),t};var l=new a;a.lerp=function(e,t,i,r){return a.multiplyByScalar(t,i,l),r=a.multiplyByScalar(e,1-i,r),a.add(l,r,r)};var u=new a;return a.mostOrthogonalAxis=function(e,t){var i=a.normalize(e,u);return a.abs(i,i),t=i.x<=i.y?i.x<=i.z?i.x<=i.w?a.clone(a.UNIT_X,t):a.clone(a.UNIT_W,t):i.z<=i.w?a.clone(a.UNIT_Z,t):a.clone(a.UNIT_W,t):i.y<=i.z?i.y<=i.w?a.clone(a.UNIT_Y,t):a.clone(a.UNIT_W,t):i.z<=i.w?a.clone(a.UNIT_Z,t):a.clone(a.UNIT_W,t)},a.equals=function(e,t){return e===t||i(e)&&i(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},a.equalsArray=function(e,t,i){return e.x===t[i]&&e.y===t[i+1]&&e.z===t[i+2]&&e.w===t[i+3]},a.equalsEpsilon=function(e,t,r,n){return e===t||i(e)&&i(t)&&o.equalsEpsilon(e.x,t.x,r,n)&&o.equalsEpsilon(e.y,t.y,r,n)&&o.equalsEpsilon(e.z,t.z,r,n)&&o.equalsEpsilon(e.w,t.w,r,n)},a.ZERO=n(new a(0,0,0,0)),a.UNIT_X=n(new a(1,0,0,0)),a.UNIT_Y=n(new a(0,1,0,0)),a.UNIT_Z=n(new a(0,0,1,0)),a.UNIT_W=n(new a(0,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,i){return a.equalsEpsilon(this,e,t,i)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},a}),i("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),i("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(e,t,i,n,o,a,s,l,u,c,h,d,p,m,f,_){this[0]=r(e,0),this[1]=r(o,0),this[2]=r(u,0),this[3]=r(p,0),this[4]=r(t,0),this[5]=r(a,0),this[6]=r(c,0),this[7]=r(m,0),this[8]=r(i,0),this[9]=r(s,0),this[10]=r(h,0),this[11]=r(f,0),this[12]=r(n,0),this[13]=r(l,0),this[14]=r(d,0),this[15]=r(_,0)}h.packedLength=16,h.pack=function(e,t,i){return i=r(i,0),t[i++]=e[0],t[i++]=e[1],t[i++]=e[2],t[i++]=e[3],t[i++]=e[4],t[i++]=e[5],t[i++]=e[6],t[i++]=e[7],t[i++]=e[8],t[i++]=e[9],t[i++]=e[10],t[i++]=e[11],t[i++]=e[12],t[i++]=e[13],t[i++]=e[14],t[i]=e[15],t},h.unpack=function(e,t,i){return t=r(t,0),n(i)||(i=new h),i[0]=e[t++],i[1]=e[t++],i[2]=e[t++],i[3]=e[t++],i[4]=e[t++],i[5]=e[t++],i[6]=e[t++],i[7]=e[t++],i[8]=e[t++],i[9]=e[t++],i[10]=e[t++],i[11]=e[t++],i[12]=e[t++],i[13]=e[t++],i[14]=e[t++],i[15]=e[t],i},h.clone=function(e,t){if(n(e))return n(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 h(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])},h.fromArray=h.unpack,h.fromColumnMajorArray=function(e,t){return h.clone(e,t)},h.fromRowMajorArray=function(e,t){return n(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 h(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])},h.fromRotationTranslation=function(t,i,o){return i=r(i,e.ZERO),n(o)?(o[0]=t[0],o[1]=t[1],o[2]=t[2],o[3]=0,o[4]=t[3],o[5]=t[4],o[6]=t[5],o[7]=0,o[8]=t[6],o[9]=t[7],o[10]=t[8],o[11]=0,o[12]=i.x,o[13]=i.y,o[14]=i.z,o[15]=1,o):new h(t[0],t[3],t[6],i.x,t[1],t[4],t[7],i.y,t[2],t[5],t[8],i.z,0,0,0,1)},h.fromTranslationQuaternionRotationScale=function(e,t,i,r){n(r)||(r=new h);var o=i.x,a=i.y,s=i.z,l=t.x*t.x,u=t.x*t.y,c=t.x*t.z,d=t.x*t.w,p=t.y*t.y,m=t.y*t.z,f=t.y*t.w,_=t.z*t.z,g=t.z*t.w,v=t.w*t.w,y=l-p-_+v,C=2*(u-g),w=2*(c+f),S=2*(u+g),E=-l+p-_+v,b=2*(m-d),T=2*(c-f),x=2*(m+d),A=-l-p+_+v;return r[0]=y*o,r[1]=S*o,r[2]=T*o,r[3]=0,r[4]=C*a,r[5]=E*a,r[6]=x*a,r[7]=0,r[8]=w*s,r[9]=b*s,r[10]=A*s,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},h.fromTranslationRotationScale=function(e,t){return h.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},h.fromTranslation=function(e,t){return h.fromRotationTranslation(u.IDENTITY,e,t)},h.fromScale=function(e,t){return n(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 h(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},h.fromUniformScale=function(e,t){return n(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 h(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var d=new e,p=new e,m=new e;h.fromCamera=function(t,i){var r=t.position,o=t.direction,a=t.up;e.normalize(o,d),e.normalize(e.cross(d,a,p),p),e.normalize(e.cross(p,d,m),m);var s=p.x,l=p.y,u=p.z,c=d.x,f=d.y,_=d.z,g=m.x,v=m.y,y=m.z,C=r.x,w=r.y,S=r.z,E=s*-C+l*-w+u*-S,b=g*-C+v*-w+y*-S,T=c*C+f*w+_*S;return n(i)?(i[0]=s,i[1]=g,i[2]=-c,i[3]=0,i[4]=l,i[5]=v,i[6]=-f,i[7]=0,i[8]=u,i[9]=y,i[10]=-_,i[11]=0,i[12]=E,i[13]=b,i[14]=T,i[15]=1,i):new h(s,l,u,E,g,v,y,b,-c,-f,-_,T,0,0,0,1)},h.computePerspectiveFieldOfView=function(e,t,i,r,n){var o=Math.tan(.5*e),a=1/o,s=a/t,l=(r+i)/(i-r),u=2*r*i/(i-r);return n[0]=s,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=a,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=l,n[11]=-1,n[12]=0,n[13]=0,n[14]=u,n[15]=0,n},h.computeOrthographicOffCenter=function(e,t,i,r,n,o,a){var s=1/(t-e),l=1/(r-i),u=1/(o-n),c=-(t+e)*s,h=-(r+i)*l,d=-(o+n)*u;return s*=2,l*=2,u*=-2,a[0]=s,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=l,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=u,a[11]=0,a[12]=c,a[13]=h,a[14]=d,a[15]=1,a},h.computePerspectiveOffCenter=function(e,t,i,r,n,o,a){var s=2*n/(t-e),l=2*n/(r-i),u=(t+e)/(t-e),c=(r+i)/(r-i),h=-(o+n)/(o-n),d=-1,p=-2*o*n/(o-n);return a[0]=s,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=l,a[6]=0,a[7]=0,a[8]=u,a[9]=c,a[10]=h,a[11]=d,a[12]=0,a[13]=0,a[14]=p,a[15]=0,a},h.computeInfinitePerspectiveOffCenter=function(e,t,i,r,n,o){var a=2*n/(t-e),s=2*n/(r-i),l=(t+e)/(t-e),u=(r+i)/(r-i),c=-1,h=-1,d=-2*n;return o[0]=a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=l,o[9]=u,o[10]=c,o[11]=h,o[12]=0,o[13]=0,o[14]=d,o[15]=0,o},h.computeViewportTransformation=function(e,t,i,n){e=r(e,r.EMPTY_OBJECT);var o=r(e.x,0),a=r(e.y,0),s=r(e.width,0),l=r(e.height,0);t=r(t,0),i=r(i,1);var u=.5*s,c=.5*l,h=.5*(i-t),d=u,p=c,m=h,f=o+u,_=a+c,g=t+h,v=1;return n[0]=d,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=p,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=m,n[11]=0,n[12]=f,n[13]=_,n[14]=g,n[15]=v,n},h.computeView=function(t,i,r,n,o){return o[0]=n.x,o[1]=r.x,o[2]=-i.x,o[3]=0,o[4]=n.y,o[5]=r.y,o[6]=-i.y,o[7]=0,o[8]=n.z,o[9]=r.z,o[10]=-i.z,o[11]=0,o[12]=-e.dot(n,t),o[13]=-e.dot(r,t),o[14]=e.dot(i,t),o[15]=1,o},h.toArray=function(e,t){return n(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]]},h.getElementIndex=function(e,t){return 4*e+t},h.getColumn=function(e,t,i){var r=4*t,n=e[r],o=e[r+1],a=e[r+2],s=e[r+3];return i.x=n,i.y=o,i.z=a,i.w=s,i},h.setColumn=function(e,t,i,r){r=h.clone(e,r);var n=4*t;return r[n]=i.x,r[n+1]=i.y,r[n+2]=i.z,r[n+3]=i.w,r},h.setTranslation=function(e,t,i){return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],i[6]=e[6],i[7]=e[7],i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=e[15],i},h.getRow=function(e,t,i){var r=e[t],n=e[t+4],o=e[t+8],a=e[t+12];return i.x=r,i.y=n,i.z=o,i.w=a,i},h.setRow=function(e,t,i,r){return r=h.clone(e,r),r[t]=i.x,r[t+4]=i.y,r[t+8]=i.z,r[t+12]=i.w,r};var f=new e;h.getScale=function(t,i){return i.x=e.magnitude(e.fromElements(t[0],t[1],t[2],f)),i.y=e.magnitude(e.fromElements(t[4],t[5],t[6],f)),i.z=e.magnitude(e.fromElements(t[8],t[9],t[10],f)),i};var _=new e;h.getMaximumScale=function(t){return h.getScale(t,_),e.maximumComponent(_)},h.multiply=function(e,t,i){var r=e[0],n=e[1],o=e[2],a=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],d=e[9],p=e[10],m=e[11],f=e[12],_=e[13],g=e[14],v=e[15],y=t[0],C=t[1],w=t[2],S=t[3],E=t[4],b=t[5],T=t[6],x=t[7],A=t[8],P=t[9],D=t[10],M=t[11],I=t[12],R=t[13],O=t[14],N=t[15],L=r*y+s*C+h*w+f*S,B=n*y+l*C+d*w+_*S,F=o*y+u*C+p*w+g*S,V=a*y+c*C+m*w+v*S,k=r*E+s*b+h*T+f*x,z=n*E+l*b+d*T+_*x,U=o*E+u*b+p*T+g*x,G=a*E+c*b+m*T+v*x,W=r*A+s*P+h*D+f*M,H=n*A+l*P+d*D+_*M,q=o*A+u*P+p*D+g*M,j=a*A+c*P+m*D+v*M,Y=r*I+s*R+h*O+f*N,X=n*I+l*R+d*O+_*N,Z=o*I+u*R+p*O+g*N,K=a*I+c*R+m*O+v*N;return i[0]=L,i[1]=B,i[2]=F,i[3]=V,i[4]=k,i[5]=z,i[6]=U,i[7]=G,i[8]=W,i[9]=H,i[10]=q,i[11]=j,i[12]=Y,i[13]=X,i[14]=Z,i[15]=K,i},h.add=function(e,t,i){return i[0]=e[0]+t[0],i[1]=e[1]+t[1],i[2]=e[2]+t[2],i[3]=e[3]+t[3],i[4]=e[4]+t[4],i[5]=e[5]+t[5],i[6]=e[6]+t[6],i[7]=e[7]+t[7],i[8]=e[8]+t[8],i[9]=e[9]+t[9],i[10]=e[10]+t[10],i[11]=e[11]+t[11],i[12]=e[12]+t[12],i[13]=e[13]+t[13],i[14]=e[14]+t[14],i[15]=e[15]+t[15],i},h.subtract=function(e,t,i){return i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],i[3]=e[3]-t[3],i[4]=e[4]-t[4],i[5]=e[5]-t[5],i[6]=e[6]-t[6],i[7]=e[7]-t[7],i[8]=e[8]-t[8],i[9]=e[9]-t[9],i[10]=e[10]-t[10],i[11]=e[11]-t[11],i[12]=e[12]-t[12],i[13]=e[13]-t[13],i[14]=e[14]-t[14],i[15]=e[15]-t[15],i},h.multiplyTransformation=function(e,t,i){var r=e[0],n=e[1],o=e[2],a=e[4],s=e[5],l=e[6],u=e[8],c=e[9],h=e[10],d=e[12],p=e[13],m=e[14],f=t[0],_=t[1],g=t[2],v=t[4],y=t[5],C=t[6],w=t[8],S=t[9],E=t[10],b=t[12],T=t[13],x=t[14],A=r*f+a*_+u*g,P=n*f+s*_+c*g,D=o*f+l*_+h*g,M=r*v+a*y+u*C,I=n*v+s*y+c*C,R=o*v+l*y+h*C,O=r*w+a*S+u*E,N=n*w+s*S+c*E,L=o*w+l*S+h*E,B=r*b+a*T+u*x+d,F=n*b+s*T+c*x+p,V=o*b+l*T+h*x+m;return i[0]=A,i[1]=P,i[2]=D,i[3]=0,i[4]=M,i[5]=I,i[6]=R,i[7]=0,i[8]=O,i[9]=N,i[10]=L,i[11]=0,i[12]=B,i[13]=F,i[14]=V,i[15]=1,i},h.multiplyByMatrix3=function(e,t,i){var r=e[0],n=e[1],o=e[2],a=e[4],s=e[5],l=e[6],u=e[8],c=e[9],h=e[10],d=t[0],p=t[1],m=t[2],f=t[3],_=t[4],g=t[5],v=t[6],y=t[7],C=t[8],w=r*d+a*p+u*m,S=n*d+s*p+c*m,E=o*d+l*p+h*m,b=r*f+a*_+u*g,T=n*f+s*_+c*g,x=o*f+l*_+h*g,A=r*v+a*y+u*C,P=n*v+s*y+c*C,D=o*v+l*y+h*C;return i[0]=w,i[1]=S,i[2]=E,i[3]=0,i[4]=b,i[5]=T,i[6]=x,i[7]=0,i[8]=A,i[9]=P,i[10]=D,i[11]=0,i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15],i},h.multiplyByTranslation=function(e,t,i){var r=t.x,n=t.y,o=t.z,a=r*e[0]+n*e[4]+o*e[8]+e[12],s=r*e[1]+n*e[5]+o*e[9]+e[13],l=r*e[2]+n*e[6]+o*e[10]+e[14];return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],i[6]=e[6],i[7]=e[7],i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=a,i[13]=s,i[14]=l,i[15]=e[15],i};var g=new e;h.multiplyByUniformScale=function(e,t,i){return g.x=t,g.y=t,g.z=t,h.multiplyByScale(e,g,i)},h.multiplyByScale=function(e,t,i){var r=t.x,n=t.y,o=t.z;return 1===r&&1===n&&1===o?h.clone(e,i):(i[0]=r*e[0],i[1]=r*e[1],i[2]=r*e[2],i[3]=0,i[4]=n*e[4],i[5]=n*e[5],i[6]=n*e[6],i[7]=0,i[8]=o*e[8],i[9]=o*e[9],i[10]=o*e[10],i[11]=0,i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=1,i)},h.multiplyByVector=function(e,t,i){var r=t.x,n=t.y,o=t.z,a=t.w,s=e[0]*r+e[4]*n+e[8]*o+e[12]*a,l=e[1]*r+e[5]*n+e[9]*o+e[13]*a,u=e[2]*r+e[6]*n+e[10]*o+e[14]*a,c=e[3]*r+e[7]*n+e[11]*o+e[15]*a;return i.x=s,i.y=l,i.z=u,i.w=c,i},h.multiplyByPointAsVector=function(e,t,i){var r=t.x,n=t.y,o=t.z,a=e[0]*r+e[4]*n+e[8]*o,s=e[1]*r+e[5]*n+e[9]*o,l=e[2]*r+e[6]*n+e[10]*o;return i.x=a,i.y=s,i.z=l,i},h.multiplyByPoint=function(e,t,i){var r=t.x,n=t.y,o=t.z,a=e[0]*r+e[4]*n+e[8]*o+e[12],s=e[1]*r+e[5]*n+e[9]*o+e[13],l=e[2]*r+e[6]*n+e[10]*o+e[14];return i.x=a,i.y=s,i.z=l,i},h.multiplyByScalar=function(e,t,i){return i[0]=e[0]*t,i[1]=e[1]*t,i[2]=e[2]*t,i[3]=e[3]*t,i[4]=e[4]*t,i[5]=e[5]*t,i[6]=e[6]*t,i[7]=e[7]*t,i[8]=e[8]*t,i[9]=e[9]*t,i[10]=e[10]*t,i[11]=e[11]*t,i[12]=e[12]*t,i[13]=e[13]*t,i[14]=e[14]*t,i[15]=e[15]*t,i},h.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},h.transpose=function(e,t){var i=e[1],r=e[2],n=e[3],o=e[6],a=e[7],s=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=i,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=o,t[10]=e[10],t[11]=e[14],t[12]=n,t[13]=a,t[14]=s,t[15]=e[15],t},h.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},h.equals=function(e,t){return e===t||n(e)&&n(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},h.equalsEpsilon=function(e,t,i){return e===t||n(e)&&n(t)&&Math.abs(e[0]-t[0])<=i&&Math.abs(e[1]-t[1])<=i&&Math.abs(e[2]-t[2])<=i&&Math.abs(e[3]-t[3])<=i&&Math.abs(e[4]-t[4])<=i&&Math.abs(e[5]-t[5])<=i&&Math.abs(e[6]-t[6])<=i&&Math.abs(e[7]-t[7])<=i&&Math.abs(e[8]-t[8])<=i&&Math.abs(e[9]-t[9])<=i&&Math.abs(e[10]-t[10])<=i&&Math.abs(e[11]-t[11])<=i&&Math.abs(e[12]-t[12])<=i&&Math.abs(e[13]-t[13])<=i&&Math.abs(e[14]-t[14])<=i&&Math.abs(e[15]-t[15])<=i},h.getTranslation=function(e,t){return t.x=e[12], +t.y=e[13],t.z=e[14],t},h.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};var v=new u,y=new u,C=new t,w=new t(0,0,0,1);return h.inverse=function(e,i){if(u.equalsEpsilon(h.getRotation(e,v),y,l.EPSILON7)&&t.equals(h.getRow(e,3,C),w))return i[0]=0,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=0,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=0,i[11]=0,i[12]=-e[12],i[13]=-e[13],i[14]=-e[14],i[15]=1,i;var r=e[0],n=e[4],o=e[8],a=e[12],s=e[1],d=e[5],p=e[9],m=e[13],f=e[2],_=e[6],g=e[10],S=e[14],E=e[3],b=e[7],T=e[11],x=e[15],A=g*x,P=S*T,D=_*x,M=S*b,I=_*T,R=g*b,O=f*x,N=S*E,L=f*T,B=g*E,F=f*b,V=_*E,k=A*d+M*p+I*m-(P*d+D*p+R*m),z=P*s+O*p+B*m-(A*s+N*p+L*m),U=D*s+N*d+F*m-(M*s+O*d+V*m),G=R*s+L*d+V*p-(I*s+B*d+F*p),W=P*n+D*o+R*a-(A*n+M*o+I*a),H=A*r+N*o+L*a-(P*r+O*o+B*a),q=M*r+O*n+V*a-(D*r+N*n+F*a),j=I*r+B*n+F*o-(R*r+L*n+V*o);A=o*m,P=a*p,D=n*m,M=a*d,I=n*p,R=o*d,O=r*m,N=a*s,L=r*p,B=o*s,F=r*d,V=n*s;var Y=A*b+M*T+I*x-(P*b+D*T+R*x),X=P*E+O*T+B*x-(A*E+N*T+L*x),Z=D*E+N*b+F*x-(M*E+O*b+V*x),K=R*E+L*b+V*T-(I*E+B*b+F*T),Q=D*g+R*S+P*_-(I*S+A*_+M*g),J=L*S+A*f+N*g-(O*g+B*S+P*f),$=O*_+V*S+M*f-(F*S+D*f+N*_),ee=F*g+I*f+B*_-(L*_+V*g+R*f),te=r*k+n*z+o*U+a*G;if(Math.abs(te)<l.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return te=1/te,i[0]=k*te,i[1]=z*te,i[2]=U*te,i[3]=G*te,i[4]=W*te,i[5]=H*te,i[6]=q*te,i[7]=j*te,i[8]=Y*te,i[9]=X*te,i[10]=Z*te,i[11]=K*te,i[12]=Q*te,i[13]=J*te,i[14]=$*te,i[15]=ee*te,i},h.inverseTransformation=function(e,t){var i=e[0],r=e[1],n=e[2],o=e[4],a=e[5],s=e[6],l=e[8],u=e[9],c=e[10],h=e[12],d=e[13],p=e[14],m=-i*h-r*d-n*p,f=-o*h-a*d-s*p,_=-l*h-u*d-c*p;return t[0]=i,t[1]=o,t[2]=l,t[3]=0,t[4]=r,t[5]=a,t[6]=u,t[7]=0,t[8]=n,t[9]=s,t[10]=c,t[11]=0,t[12]=m,t[13]=f,t[14]=_,t[15]=1,t},h.IDENTITY=s(new h(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),h.ZERO=s(new h(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),h.COLUMN0ROW0=0,h.COLUMN0ROW1=1,h.COLUMN0ROW2=2,h.COLUMN0ROW3=3,h.COLUMN1ROW0=4,h.COLUMN1ROW1=5,h.COLUMN1ROW2=6,h.COLUMN1ROW3=7,h.COLUMN2ROW0=8,h.COLUMN2ROW1=9,h.COLUMN2ROW2=10,h.COLUMN2ROW3=11,h.COLUMN3ROW0=12,h.COLUMN3ROW1=13,h.COLUMN3ROW2=14,h.COLUMN3ROW3=15,o(h.prototype,{length:{get:function(){return h.packedLength}}}),h.prototype.clone=function(e){return h.clone(this,e)},h.prototype.equals=function(e){return h.equals(this,e)},h.equalsArray=function(e,t,i){return e[0]===t[i]&&e[1]===t[i+1]&&e[2]===t[i+2]&&e[3]===t[i+3]&&e[4]===t[i+4]&&e[5]===t[i+5]&&e[6]===t[i+6]&&e[7]===t[i+7]&&e[8]===t[i+8]&&e[9]===t[i+9]&&e[10]===t[i+10]&&e[11]===t[i+11]&&e[12]===t[i+12]&&e[13]===t[i+13]&&e[14]===t[i+14]&&e[15]===t[i+15]},h.prototype.equalsEpsilon=function(e,t){return h.equalsEpsilon(this,e,t)},h.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]+")"},h}),i("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,i,r,n,o,a,s,l,u,c,h){"use strict";function d(t,i){this.center=e.clone(r(t,e.ZERO)),this.radius=r(i,0)}var p=new e,m=new e,f=new e,_=new e,g=new e,v=new e,y=new e,C=new e,w=new e,S=new e,E=new e,b=new e;d.fromPoints=function(t,i){if(n(i)||(i=new d),!n(t)||0===t.length)return i.center=e.clone(e.ZERO,i.center),i.radius=0,i;for(var r=e.clone(t[0],y),o=e.clone(r,p),a=e.clone(r,m),s=e.clone(r,f),l=e.clone(r,_),u=e.clone(r,g),c=e.clone(r,v),h=t.length,T=1;T<h;T++){e.clone(t[T],r);var x=r.x,A=r.y,P=r.z;x<o.x&&e.clone(r,o),x>l.x&&e.clone(r,l),A<a.y&&e.clone(r,a),A>u.y&&e.clone(r,u),P<s.z&&e.clone(r,s),P>c.z&&e.clone(r,c)}var D=e.magnitudeSquared(e.subtract(l,o,C)),M=e.magnitudeSquared(e.subtract(u,a,C)),I=e.magnitudeSquared(e.subtract(c,s,C)),R=o,O=l,N=D;M>N&&(N=M,R=a,O=u),I>N&&(N=I,R=s,O=c);var L=w;L.x=.5*(R.x+O.x),L.y=.5*(R.y+O.y),L.z=.5*(R.z+O.z);var B=e.magnitudeSquared(e.subtract(O,L,C)),F=Math.sqrt(B),V=S;V.x=o.x,V.y=a.y,V.z=s.z;var k=E;k.x=l.x,k.y=u.y,k.z=c.z;var z=e.multiplyByScalar(e.add(V,k,C),.5,b),U=0;for(T=0;T<h;T++){e.clone(t[T],r);var G=e.magnitude(e.subtract(r,z,C));G>U&&(U=G);var W=e.magnitudeSquared(e.subtract(r,L,C));if(W>B){var H=Math.sqrt(W);F=.5*(F+H),B=F*F;var q=H-F;L.x=(F*L.x+q*r.x)/H,L.y=(F*L.y+q*r.y)/H,L.z=(F*L.z+q*r.z)/H}}return F<U?(e.clone(L,i.center),i.radius=F):(e.clone(z,i.center),i.radius=U),i};var T=new a,x=new e,A=new e,P=new t,D=new t;d.fromRectangle2D=function(e,t,i){return d.fromRectangleWithHeights2D(e,t,0,0,i)},d.fromRectangleWithHeights2D=function(t,i,o,a,s){if(n(s)||(s=new d),!n(t))return s.center=e.clone(e.ZERO,s.center),s.radius=0,s;i=r(i,T),h.southwest(t,P),P.height=o,h.northeast(t,D),D.height=a;var l=i.project(P,x),u=i.project(D,A),c=u.x-l.x,p=u.y-l.y,m=u.z-l.z;s.radius=.5*Math.sqrt(c*c+p*p+m*m);var f=s.center;return f.x=l.x+.5*c,f.y=l.y+.5*p,f.z=l.z+.5*m,s};var M=[];d.fromRectangle3D=function(e,t,i,a){t=r(t,o.WGS84),i=r(i,0);var s;return n(e)&&(s=h.subsample(e,t,i,M)),d.fromPoints(s,a)},d.fromVertices=function(t,i,o,a){if(n(a)||(a=new d),!n(t)||0===t.length)return a.center=e.clone(e.ZERO,a.center),a.radius=0,a;i=r(i,e.ZERO),o=r(o,3);var s=y;s.x=t[0]+i.x,s.y=t[1]+i.y,s.z=t[2]+i.z;for(var l=e.clone(s,p),u=e.clone(s,m),c=e.clone(s,f),h=e.clone(s,_),T=e.clone(s,g),x=e.clone(s,v),A=t.length,P=0;P<A;P+=o){var D=t[P]+i.x,M=t[P+1]+i.y,I=t[P+2]+i.z;s.x=D,s.y=M,s.z=I,D<l.x&&e.clone(s,l),D>h.x&&e.clone(s,h),M<u.y&&e.clone(s,u),M>T.y&&e.clone(s,T),I<c.z&&e.clone(s,c),I>x.z&&e.clone(s,x)}var R=e.magnitudeSquared(e.subtract(h,l,C)),O=e.magnitudeSquared(e.subtract(T,u,C)),N=e.magnitudeSquared(e.subtract(x,c,C)),L=l,B=h,F=R;O>F&&(F=O,L=u,B=T),N>F&&(F=N,L=c,B=x);var V=w;V.x=.5*(L.x+B.x),V.y=.5*(L.y+B.y),V.z=.5*(L.z+B.z);var k=e.magnitudeSquared(e.subtract(B,V,C)),z=Math.sqrt(k),U=S;U.x=l.x,U.y=u.y,U.z=c.z;var G=E;G.x=h.x,G.y=T.y,G.z=x.z;var W=e.multiplyByScalar(e.add(U,G,C),.5,b),H=0;for(P=0;P<A;P+=o){s.x=t[P]+i.x,s.y=t[P+1]+i.y,s.z=t[P+2]+i.z;var q=e.magnitude(e.subtract(s,W,C));q>H&&(H=q);var j=e.magnitudeSquared(e.subtract(s,V,C));if(j>k){var Y=Math.sqrt(j);z=.5*(z+Y),k=z*z;var X=Y-z;V.x=(z*V.x+X*s.x)/Y,V.y=(z*V.y+X*s.y)/Y,V.z=(z*V.z+X*s.z)/Y}}return z<H?(e.clone(V,a.center),a.radius=z):(e.clone(W,a.center),a.radius=H),a},d.fromEncodedCartesianVertices=function(t,i,r){if(n(r)||(r=new d),!n(t)||!n(i)||t.length!==i.length||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var o=y;o.x=t[0]+i[0],o.y=t[1]+i[1],o.z=t[2]+i[2];for(var a=e.clone(o,p),s=e.clone(o,m),l=e.clone(o,f),u=e.clone(o,_),c=e.clone(o,g),h=e.clone(o,v),T=t.length,x=0;x<T;x+=3){var A=t[x]+i[x],P=t[x+1]+i[x+1],D=t[x+2]+i[x+2];o.x=A,o.y=P,o.z=D,A<a.x&&e.clone(o,a),A>u.x&&e.clone(o,u),P<s.y&&e.clone(o,s),P>c.y&&e.clone(o,c),D<l.z&&e.clone(o,l),D>h.z&&e.clone(o,h)}var M=e.magnitudeSquared(e.subtract(u,a,C)),I=e.magnitudeSquared(e.subtract(c,s,C)),R=e.magnitudeSquared(e.subtract(h,l,C)),O=a,N=u,L=M;I>L&&(L=I,O=s,N=c),R>L&&(L=R,O=l,N=h);var B=w;B.x=.5*(O.x+N.x),B.y=.5*(O.y+N.y),B.z=.5*(O.z+N.z);var F=e.magnitudeSquared(e.subtract(N,B,C)),V=Math.sqrt(F),k=S;k.x=a.x,k.y=s.y,k.z=l.z;var z=E;z.x=u.x,z.y=c.y,z.z=h.z;var U=e.multiplyByScalar(e.add(k,z,C),.5,b),G=0;for(x=0;x<T;x+=3){o.x=t[x]+i[x],o.y=t[x+1]+i[x+1],o.z=t[x+2]+i[x+2];var W=e.magnitude(e.subtract(o,U,C));W>G&&(G=W);var H=e.magnitudeSquared(e.subtract(o,B,C));if(H>F){var q=Math.sqrt(H);V=.5*(V+q),F=V*V;var j=q-V;B.x=(V*B.x+j*o.x)/q,B.y=(V*B.y+j*o.y)/q,B.z=(V*B.z+j*o.z)/q}}return V<G?(e.clone(B,r.center),r.radius=V):(e.clone(U,r.center),r.radius=G),r},d.fromCornerPoints=function(t,i,r){n(r)||(r=new d);var o=r.center;return e.add(t,i,o),e.multiplyByScalar(o,.5,o),r.radius=e.distance(o,i),r},d.fromEllipsoid=function(t,i){return n(i)||(i=new d),e.clone(e.ZERO,i.center),i.radius=t.maximumRadius,i};var I=new e;d.fromBoundingSpheres=function(t,i){if(n(i)||(i=new d),!n(t)||0===t.length)return i.center=e.clone(e.ZERO,i.center),i.radius=0,i;var r=t.length;if(1===r)return d.clone(t[0],i);if(2===r)return d.union(t[0],t[1],i);for(var o=[],a=0;a<r;a++)o.push(t[a].center);i=d.fromPoints(o,i);var s=i.center,l=i.radius;for(a=0;a<r;a++){var u=t[a];l=Math.max(l,e.distance(s,u.center,I)+u.radius)}return i.radius=l,i};var R=new e,O=new e,N=new e;d.fromOrientedBoundingBox=function(t,i){n(i)||(i=new d);var r=t.halfAxes,o=u.getColumn(r,0,R),a=u.getColumn(r,1,O),s=u.getColumn(r,2,N),l=e.magnitude(o),c=e.magnitude(a),h=e.magnitude(s);return i.center=e.clone(t.center,i.center),i.radius=Math.max(l,c,h),i},d.clone=function(t,i){if(n(t))return n(i)?(i.center=e.clone(t.center,i.center),i.radius=t.radius,i):new d(t.center,t.radius)},d.packedLength=4,d.pack=function(e,t,i){i=r(i,0);var n=e.center;return t[i++]=n.x,t[i++]=n.y,t[i++]=n.z,t[i]=e.radius,t},d.unpack=function(e,t,i){t=r(t,0),n(i)||(i=new d);var o=i.center;return o.x=e[t++],o.y=e[t++],o.z=e[t++],i.radius=e[t],i};var L=new e,B=new e;d.union=function(t,i,r){n(r)||(r=new d);var o=t.center,a=t.radius,s=i.center,l=i.radius,u=e.subtract(s,o,L),c=e.magnitude(u);if(a>=c+l)return t.clone(r),r;if(l>=c+a)return i.clone(r),r;var h=.5*(a+c+l),p=e.multiplyByScalar(u,(-a+h)/c,B);return e.add(p,o,p),e.clone(p,r.center),r.radius=h,r};var F=new e;d.expand=function(t,i,r){r=d.clone(t,r);var n=e.magnitude(e.subtract(i,r.center,F));return n>r.radius&&(r.radius=n),r},d.intersectPlane=function(t,i){var r=t.center,n=t.radius,o=i.normal,a=e.dot(o,r)+i.distance;return a<-n?s.OUTSIDE:a<n?s.INTERSECTING:s.INSIDE},d.transform=function(e,t,i){return n(i)||(i=new d),i.center=c.multiplyByPoint(t,e.center,i.center),i.radius=c.getMaximumScale(t)*e.radius,i};var V=new e;d.distanceSquaredTo=function(t,i){var r=e.subtract(t.center,i,V);return e.magnitudeSquared(r)-t.radius*t.radius},d.transformWithoutScale=function(e,t,i){return n(i)||(i=new d),i.center=c.multiplyByPoint(t,e.center,i.center),i.radius=e.radius,i};var k=new e;d.computePlaneDistances=function(t,i,r,o){n(o)||(o=new l);var a=e.subtract(t.center,i,k),s=e.dot(r,a);return o.start=s-t.radius,o.stop=s+t.radius,o};for(var z=new e,U=new e,G=new e,W=new e,H=new e,q=new t,j=new Array(8),Y=0;Y<8;++Y)j[Y]=new e;var X=new a;return d.projectTo2D=function(t,i,n){i=r(i,X);var o=i.ellipsoid,a=t.center,s=t.radius,l=o.geodeticSurfaceNormal(a,z),u=e.cross(e.UNIT_Z,l,U);e.normalize(u,u);var c=e.cross(l,u,G);e.normalize(c,c),e.multiplyByScalar(l,s,l),e.multiplyByScalar(c,s,c),e.multiplyByScalar(u,s,u);var h=e.negate(c,H),p=e.negate(u,W),m=j,f=m[0];e.add(l,c,f),e.add(f,u,f),f=m[1],e.add(l,c,f),e.add(f,p,f),f=m[2],e.add(l,h,f),e.add(f,p,f),f=m[3],e.add(l,h,f),e.add(f,u,f),e.negate(l,l),f=m[4],e.add(l,c,f),e.add(f,u,f),f=m[5],e.add(l,c,f),e.add(f,p,f),f=m[6],e.add(l,h,f),e.add(f,p,f),f=m[7],e.add(l,h,f),e.add(f,u,f);for(var _=m.length,g=0;g<_;++g){var v=m[g];e.add(a,v,v);var y=o.cartesianToCartographic(v,q);i.project(y,v)}n=d.fromPoints(m,n),a=n.center;var C=a.x,w=a.y,S=a.z;return a.x=S,a.y=C,a.z=w,n},d.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},d.equals=function(t,i){return t===i||n(t)&&n(i)&&e.equals(t.center,i.center)&&t.radius===i.radius},d.prototype.intersectPlane=function(e){return d.intersectPlane(this,e)},d.prototype.distanceSquaredTo=function(e){return d.distanceSquaredTo(this,e)},d.prototype.computePlaneDistances=function(e,t,i){return d.computePlaneDistances(this,e,t,i)},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}),i("Core/EllipsoidalOccluder",["./BoundingSphere","./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./Rectangle"],function(e,t,i,r,n,o,a){"use strict";function s(e,i){this._ellipsoid=e,this._cameraPosition=new t,this._cameraPositionInScaledSpace=new t,this._distanceToLimbInScaledSpaceSquared=0,r(i)&&(this.cameraPosition=i)}function l(e,i,r){var n=e.transformPositionToScaledSpace(i,m),o=t.magnitudeSquared(n),a=Math.sqrt(o),s=t.divideByScalar(n,a,f);o=Math.max(1,o),a=Math.max(1,a);var l=t.dot(s,r),u=t.magnitude(t.cross(s,r,s)),c=1/a,h=Math.sqrt(o-1)*c;return 1/(l*c-u*h)}function u(e,i,r){if(!(i<=0||i===1/0||i!==i))return t.multiplyByScalar(e,i,r)}function c(e,i){return t.equals(i,t.ZERO)?i:(e.transformPositionToScaledSpace(i,_),t.normalize(_,_))}n(s.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(e){var i=this._ellipsoid,r=i.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),n=t.magnitudeSquared(r)-1;t.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=r,this._distanceToLimbInScaledSpaceSquared=n}}});var h=new t;s.prototype.isPointVisible=function(e){var t=this._ellipsoid,i=t.transformPositionToScaledSpace(e,h);return this.isScaledSpacePointVisible(i)},s.prototype.isScaledSpacePointVisible=function(e){var i=this._cameraPositionInScaledSpace,r=this._distanceToLimbInScaledSpaceSquared,n=t.subtract(e,i,h),o=-t.dot(n,i),a=r<0?o>0:o>r&&o*o/t.magnitudeSquared(n)>r;return!a},s.prototype.computeHorizonCullingPoint=function(e,i,n){r(n)||(n=new t);for(var o=this._ellipsoid,a=c(o,e),s=0,h=0,d=i.length;h<d;++h){var p=i[h],m=l(o,p,a);s=Math.max(s,m)}return u(a,s,n)};var d=new t;s.prototype.computeHorizonCullingPointFromVertices=function(e,n,o,a,s){r(s)||(s=new t),a=i(a,t.ZERO);for(var h=this._ellipsoid,p=c(h,e),m=0,f=0,_=n.length;f<_;f+=o){d.x=n[f]+a.x,d.y=n[f+1]+a.y,d.z=n[f+2]+a.z;var g=l(h,d,p);m=Math.max(m,g)}return u(p,m,s)};var p=[];s.prototype.computeHorizonCullingPointFromRectangle=function(i,r,n){var o=a.subsample(i,r,0,p),s=e.fromPoints(o);if(!(t.magnitude(s.center)<.1*r.minimumRadius))return this.computeHorizonCullingPoint(s.center,o,n)};var m=new t,f=new t,_=new t;return s}),i("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function i(e,i,r){var n=e+i;return t.sign(e)!==t.sign(i)&&Math.abs(n/Math.max(Math.abs(e),Math.abs(i)))<r?0:n}var r={};return r.computeDiscriminant=function(e,t,i){var r=t*t-4*e*i;return r},r.computeRealRoots=function(e,r,n){var o;if(0===e)return 0===r?[]:[-n/r];if(0===r){if(0===n)return[0,0];var a=Math.abs(n),s=Math.abs(e);if(a<s&&a/s<t.EPSILON14)return[0,0];if(a>s&&s/a<t.EPSILON14)return[];if(o=-n/e,o<0)return[];var l=Math.sqrt(o);return[-l,l]}if(0===n)return o=-r/e,o<0?[o,0]:[0,o];var u=r*r,c=4*e*n,h=i(u,-c,t.EPSILON14);if(h<0)return[];var d=-.5*i(r,t.sign(r)*Math.sqrt(h),t.EPSILON14);return r>0?[d/e,n/d]:[n/d,d/e]},r}),i("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function i(e,t,i,r){var n,o,a=e,s=t/3,l=i/3,u=r,c=a*l,h=s*u,d=s*s,p=l*l,m=a*l-d,f=a*u-s*l,_=s*u-p,g=4*m*_-f*f;if(g<0){var v,y,C;d*h>=c*p?(v=a,y=m,C=-2*s*m+a*f):(v=u,y=_,C=-u*f+2*l*_);var w=C<0?-1:1,S=-w*Math.abs(v)*Math.sqrt(-g);o=-C+S;var E=o/2,b=E<0?-Math.pow(-E,1/3):Math.pow(E,1/3),T=o===S?-b:-y/b;return n=y<=0?b+T:-C/(b*b+T*T+y),d*h>=c*p?[(n-s)/a]:[-u/(n+l)]}var x=m,A=-2*s*m+a*f,P=_,D=-u*f+2*l*_,M=Math.sqrt(g),I=Math.sqrt(3)/2,R=Math.abs(Math.atan2(a*M,-A)/3);n=2*Math.sqrt(-x);var O=Math.cos(R);o=n*O;var N=n*(-O/2-I*Math.sin(R)),L=o+N>2*s?o-s:N-s,B=a,F=L/B;R=Math.abs(Math.atan2(u*M,-D)/3),n=2*Math.sqrt(-P),O=Math.cos(R),o=n*O,N=n*(-O/2-I*Math.sin(R));var V=-u,k=o+N<2*l?o+l:N+l,z=V/k,U=B*k,G=-L*k-B*V,W=L*V,H=(l*G-s*W)/(-s*G+l*U);return F<=H?F<=z?H<=z?[F,H,z]:[F,z,H]:[z,F,H]:F<=z?[H,F,z]:H<=z?[H,z,F]:[z,H,F]}var r={};return r.computeDiscriminant=function(e,t,i,r){var n=e*e,o=t*t,a=i*i,s=r*r,l=18*e*t*i*r+o*a-27*n*s-4*(e*a*i+o*t*r);return l},r.computeRealRoots=function(e,r,n,o){var a,s;if(0===e)return t.computeRealRoots(r,n,o);if(0===r){if(0===n){if(0===o)return[0,0,0];s=-o/e;var l=s<0?-Math.pow(-s,1/3):Math.pow(s,1/3);return[l,l,l]}return 0===o?(a=t.computeRealRoots(e,0,n),0===a.Length?[0]:[a[0],0,a[1]]):i(e,0,n,o)}return 0===n?0===o?(s=-r/e,s<0?[s,0,0]:[0,0,s]):i(e,r,0,o):0===o?(a=t.computeRealRoots(e,r,n),0===a.length?[0]:a[1]<=0?[a[0],a[1],0]:a[0]>=0?[0,a[0],a[1]]:[a[0],0,a[1]]):i(e,r,n,o)},r}),i("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,i,r){"use strict";function n(t,n,o,a){var s=t*t,l=n-3*s/8,u=o-n*t/2+s*t/8,c=a-o*t/4+n*s/16-3*s*s/256,h=e.computeRealRoots(1,2*l,l*l-4*c,-u*u);if(h.length>0){var d=-t/4,p=h[h.length-1];if(Math.abs(p)<i.EPSILON14){var m=r.computeRealRoots(1,l,c);if(2===m.length){var f,_=m[0],g=m[1];if(_>=0&&g>=0){var v=Math.sqrt(_),y=Math.sqrt(g);return[d-y,d-v,d+v,d+y]}if(_>=0&&g<0)return f=Math.sqrt(_),[d-f,d+f];if(_<0&&g>=0)return f=Math.sqrt(g),[d-f,d+f]}return[]}if(p>0){var C=Math.sqrt(p),w=(l+p-u/C)/2,S=(l+p+u/C)/2,E=r.computeRealRoots(1,C,w),b=r.computeRealRoots(1,-C,S);return 0!==E.length?(E[0]+=d,E[1]+=d,0!==b.length?(b[0]+=d,b[1]+=d,E[1]<=b[0]?[E[0],E[1],b[0],b[1]]:b[1]<=E[0]?[b[0],b[1],E[0],E[1]]:E[0]>=b[0]&&E[1]<=b[1]?[b[0],E[0],E[1],b[1]]:b[0]>=E[0]&&b[1]<=E[1]?[E[0],b[0],b[1],E[1]]:E[0]>b[0]&&E[0]<b[1]?[b[0],E[0],b[1],E[1]]:[E[0],b[0],E[1],b[1]]):E):0!==b.length?(b[0]+=d,b[1]+=d,b):[]}}return[]}function o(t,n,o,a){var s=o*o,l=n*n,u=t*t,c=-2*n,h=o*t+l-4*a,d=u*a-o*n*t+s,p=e.computeRealRoots(1,c,h,d);if(p.length>0){var m,f,_=p[0],g=n-_,v=g*g,y=t/2,C=g/2,w=v-4*a,S=v+4*Math.abs(a),E=u-4*_,b=u+4*Math.abs(_);if(_<0||w*b<E*S){var T=Math.sqrt(E);m=T/2,f=0===T?0:(t*C-o)/T}else{var x=Math.sqrt(w);m=0===x?0:(t*C-o)/x,f=x/2}var A,P;0===y&&0===m?(A=0,P=0):i.sign(y)===i.sign(m)?(A=y+m,P=_/A):(P=y-m,A=_/P);var D,M;0===C&&0===f?(D=0,M=0):i.sign(C)===i.sign(f)?(D=C+f,M=a/D):(M=C-f,D=a/M);var I=r.computeRealRoots(1,A,D),R=r.computeRealRoots(1,P,M);if(0!==I.length)return 0!==R.length?I[1]<=R[0]?[I[0],I[1],R[0],R[1]]:R[1]<=I[0]?[R[0],R[1],I[0],I[1]]:I[0]>=R[0]&&I[1]<=R[1]?[R[0],I[0],I[1],R[1]]:R[0]>=I[0]&&R[1]<=I[1]?[I[0],R[0],R[1],I[1]]:I[0]>R[0]&&I[0]<R[1]?[R[0],I[0],R[1],I[1]]:[I[0],R[0],I[1],R[1]]:I;if(0!==R.length)return R}return[]}var a={};return a.computeDiscriminant=function(e,t,i,r,n){var o=e*e,a=o*e,s=t*t,l=s*t,u=i*i,c=u*i,h=r*r,d=h*r,p=n*n,m=p*n,f=s*u*h-4*l*d-4*e*c*h+18*e*t*i*d-27*o*h*h+256*a*m+n*(18*l*i*r-4*s*c+16*e*u*u-80*e*t*u*r-6*e*s*h+144*o*i*h)+p*(144*e*s*i-27*s*s-128*o*u-192*o*t*r);return f},a.computeRealRoots=function(t,r,a,s,l){if(Math.abs(t)<i.EPSILON15)return e.computeRealRoots(r,a,s,l);var u=r/t,c=a/t,h=s/t,d=l/t,p=u<0?1:0;switch(p+=c<0?p+1:p,p+=h<0?p+1:p,p+=d<0?p+1:p){case 0:return n(u,c,h,d);case 1:return o(u,c,h,d);case 2:return o(u,c,h,d);case 3:return n(u,c,h,d);case 4:return n(u,c,h,d);case 5:return o(u,c,h,d);case 6:return n(u,c,h,d);case 7:return n(u,c,h,d);case 8:return o(u,c,h,d);case 9:return n(u,c,h,d);case 10:return n(u,c,h,d);case 11:return o(u,c,h,d);case 12:return n(u,c,h,d);case 13:return n(u,c,h,d);case 14:return n(u,c,h,d);case 15:return n(u,c,h,d);default:return}},a}),i("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,i,r){"use strict";function n(i,r){r=e.clone(t(r,e.ZERO)),e.equals(r,e.ZERO)||e.normalize(r,r),this.origin=e.clone(t(i,e.ZERO)),this.direction=r}return n.getPoint=function(t,r,n){return i(n)||(n=new e),n=e.multiplyByScalar(t.direction,r,n),e.add(t.origin,n,n)},n}),i("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(e,t,i,r){var n=t*t-4*e*i;if(!(n<0)){if(n>0){var o=1/(2*e),a=Math.sqrt(n),s=(-t+a)*o,l=(-t-a)*o;return s<l?(r.root0=s,r.root1=l):(r.root0=l,r.root1=s),r}var u=-t/(2*e);if(0!==u)return r.root0=r.root1=u,r}}function d(t,i,n){r(n)||(n=new o);var a=t.origin,s=t.direction,l=i.center,u=i.radius*i.radius,c=e.subtract(a,l,v),d=e.dot(s,s),p=2*e.dot(s,c),m=e.magnitudeSquared(c)-u,f=h(d,p,m,S);if(r(f))return n.start=f.root0,n.stop=f.root1,n}function p(e,t,i){var r=e+t;return a.sign(e)!==a.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))<i?0:r}function m(t,i,r,n,o){var c,h=n*n,d=o*o,m=(t[s.COLUMN1ROW1]-t[s.COLUMN2ROW2])*d,f=o*(n*p(t[s.COLUMN1ROW0],t[s.COLUMN0ROW1],a.EPSILON15)+i.y),_=t[s.COLUMN0ROW0]*h+t[s.COLUMN2ROW2]*d+n*i.x+r,g=d*p(t[s.COLUMN2ROW1],t[s.COLUMN1ROW2],a.EPSILON15),v=o*(n*p(t[s.COLUMN2ROW0],t[s.COLUMN0ROW2])+i.z),y=[];if(0===v&&0===g){if(c=l.computeRealRoots(m,f,_),0===c.length)return y;var C=c[0],w=Math.sqrt(Math.max(1-C*C,0));if(y.push(new e(n,o*C,o*-w)),y.push(new e(n,o*C,o*w)),2===c.length){var S=c[1],E=Math.sqrt(Math.max(1-S*S,0));y.push(new e(n,o*S,o*-E)),y.push(new e(n,o*S,o*E))}return y}var b=v*v,T=g*g,x=m*m,A=v*g,P=x+T,D=2*(f*m+A),M=2*_*m+f*f-T+b,I=2*(_*f-A),R=_*_-b;if(0===P&&0===D&&0===M&&0===I)return y;c=u.computeRealRoots(P,D,M,I,R);var O=c.length;if(0===O)return y;for(var N=0;N<O;++N){var L,B=c[N],F=B*B,V=Math.max(1-F,0),k=Math.sqrt(V);L=a.sign(m)===a.sign(_)?p(m*F+_,f*B,a.EPSILON12):a.sign(_)===a.sign(f*B)?p(m*F,f*B+_,a.EPSILON12):p(m*F+f*B,_,a.EPSILON12);var z=p(g*B,v,a.EPSILON15),U=L*z;U<0?y.push(new e(n,o*B,o*k)):U>0?y.push(new e(n,o*B,o*-k)):0!==k?(y.push(new e(n,o*B,o*-k)),y.push(new e(n,o*B,o*k)),++N):y.push(new e(n,o*B,o*k))}return y}var f={};f.rayPlane=function(t,i,n){r(n)||(n=new e);var o=t.origin,s=t.direction,l=i.normal,u=e.dot(l,s);if(!(Math.abs(u)<a.EPSILON15)){var c=(-i.distance-e.dot(l,o))/u;if(!(c<0))return n=e.multiplyByScalar(s,c,n),e.add(o,n,n)}};var _=new e,g=new e,v=new e,y=new e,C=new e;f.rayTriangleParametric=function(t,r,n,o,s){s=i(s,!1);var l,u,c,h,d,p=t.origin,m=t.direction,f=e.subtract(n,r,_),w=e.subtract(o,r,g),S=e.cross(m,w,v),E=e.dot(f,S);if(s){if(E<a.EPSILON6)return;if(l=e.subtract(p,r,y),c=e.dot(l,S),c<0||c>E)return;if(u=e.cross(l,f,C),h=e.dot(m,u),h<0||c+h>E)return;d=e.dot(w,u)/E}else{if(Math.abs(E)<a.EPSILON6)return;var b=1/E;if(l=e.subtract(p,r,y),c=e.dot(l,S)*b,c<0||c>1)return;if(u=e.cross(l,f,C),h=e.dot(m,u)*b,h<0||c+h>1)return;d=e.dot(w,u)*b}return d},f.rayTriangle=function(t,i,n,o,a,s){var l=f.rayTriangleParametric(t,i,n,o,a);if(r(l)&&!(l<0))return r(s)||(s=new e),e.multiplyByScalar(t.direction,l,s),e.add(t.origin,s,s)};var w=new c;f.lineSegmentTriangle=function(t,i,n,o,a,s,l){var u=w;e.clone(t,u.origin),e.subtract(i,t,u.direction),e.normalize(u.direction,u.direction);var c=f.rayTriangleParametric(u,n,o,a,s);if(!(!r(c)||c<0||c>e.distance(t,i)))return r(l)||(l=new e),e.multiplyByScalar(u.direction,c,l),e.add(u.origin,l,l)};var S={root0:0,root1:0};f.raySphere=function(e,t,i){if(i=d(e,t,i),r(i)&&!(i.stop<0))return i.start=Math.max(i.start,0),i};var E=new c;f.lineSegmentSphere=function(t,i,n,o){var a=E;e.clone(t,a.origin);var s=e.subtract(i,t,a.direction),l=e.magnitude(s);if(e.normalize(s,s),o=d(a,n,o),!(!r(o)||o.stop<0||o.start>l))return o.start=Math.max(o.start,0),o.stop=Math.min(o.stop,l),o};var b=new e,T=new e;f.rayEllipsoid=function(t,i){var r,n,a,s,l,u=i.oneOverRadii,c=e.multiplyComponents(u,t.origin,b),h=e.multiplyComponents(u,t.direction,T),d=e.magnitudeSquared(c),p=e.dot(c,h);if(d>1){if(p>=0)return;var m=p*p;if(r=d-1,n=e.magnitudeSquared(h),a=n*r,m<a)return;if(m>a){s=p*p-a,l=-p+Math.sqrt(s);var f=l/n,_=r/l;return f<_?new o(f,_):{start:_,stop:f}}var g=Math.sqrt(r/n);return new o(g,g)}return d<1?(r=d-1,n=e.magnitudeSquared(h),a=n*r,s=p*p-a,l=-p+Math.sqrt(s),new o(0,l/n)):p<0?(n=e.magnitudeSquared(h),new o(0,-p/n)):void 0};var x=new e,A=new e,P=new e,D=new e,M=new e,I=new s,R=new s,O=new s,N=new s,L=new s,B=new s,F=new s,V=new e,k=new e,z=new t;f.grazingAltitudeLocation=function(t,i){var n=t.origin,o=t.direction;if(!e.equals(n,e.ZERO)){var l=i.geodeticSurfaceNormal(n,x);if(e.dot(o,l)>=0)return n}var u=r(this.rayEllipsoid(t,i)),c=i.transformPositionToScaledSpace(o,x),h=e.normalize(c,c),d=e.mostOrthogonalAxis(c,D),p=e.normalize(e.cross(d,h,A),A),f=e.normalize(e.cross(h,p,P),P),_=I;_[0]=h.x,_[1]=h.y,_[2]=h.z,_[3]=p.x,_[4]=p.y,_[5]=p.z,_[6]=f.x,_[7]=f.y,_[8]=f.z;var g=s.transpose(_,R),v=s.fromScale(i.radii,O),y=s.fromScale(i.oneOverRadii,N),C=L;C[0]=0,C[1]=-o.z,C[2]=o.y,C[3]=o.z,C[4]=0,C[5]=-o.x,C[6]=-o.y,C[7]=o.x,C[8]=0;var w,S,E=s.multiply(s.multiply(g,y,B),C,B),b=s.multiply(s.multiply(E,v,F),_,F),T=s.multiplyByVector(E,n,M),U=m(b,e.negate(T,x),0,0,1),G=U.length;if(G>0){for(var W=e.clone(e.ZERO,k),H=Number.NEGATIVE_INFINITY,q=0;q<G;++q){w=s.multiplyByVector(v,s.multiplyByVector(_,U[q],V),V);var j=e.normalize(e.subtract(w,n,D),D),Y=e.dot(j,o);Y>H&&(H=Y,W=e.clone(w,W))}var X=i.cartesianToCartographic(W,z);return H=a.clamp(H,0,1),S=e.magnitude(e.subtract(W,n,D))*Math.sqrt(1-H*H),S=u?-S:S,X.height=S,i.cartographicToCartesian(X,new e)}};var U=new e;return f.lineSegmentPlane=function(t,i,n,o){r(o)||(o=new e);var s=e.subtract(i,t,U),l=n.normal,u=e.dot(l,s);if(!(Math.abs(u)<a.EPSILON6)){var c=e.dot(l,t),h=-(n.distance+c)/u;if(!(h<0||h>1))return e.multiplyByScalar(s,h,o),e.add(t,o,o),o}},f.trianglePlaneIntersection=function(t,i,r,n){var o=n.normal,a=n.distance,s=e.dot(o,t)+a<0,l=e.dot(o,i)+a<0,u=e.dot(o,r)+a<0,c=0;c+=s?1:0,c+=l?1:0,c+=u?1:0;var h,d;if(1!==c&&2!==c||(h=new e,d=new e),1===c){if(s)return f.lineSegmentPlane(t,i,n,h),f.lineSegmentPlane(t,r,n,d),{positions:[t,i,r,h,d],indices:[0,3,4,1,2,4,1,4,3]};if(l)return f.lineSegmentPlane(i,r,n,h),f.lineSegmentPlane(i,t,n,d),{positions:[t,i,r,h,d],indices:[1,3,4,2,0,4,2,4,3]};if(u)return f.lineSegmentPlane(r,t,n,h),f.lineSegmentPlane(r,i,n,d),{positions:[t,i,r,h,d],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===c){if(!s)return f.lineSegmentPlane(i,t,n,h),f.lineSegmentPlane(r,t,n,d),{positions:[t,i,r,h,d],indices:[1,2,4,1,4,3,0,3,4]};if(!l)return f.lineSegmentPlane(r,i,n,h),f.lineSegmentPlane(t,i,n,d),{positions:[t,i,r,h,d],indices:[2,0,4,2,4,3,1,3,4]};if(!u)return f.lineSegmentPlane(t,r,n,h),f.lineSegmentPlane(i,r,n,d),{positions:[t,i,r,h,d],indices:[0,1,4,0,4,3,2,3,4]}}},f}),i("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,i,r){"use strict";function n(t,i){this.normal=e.clone(t),this.distance=i}n.fromPointNormal=function(i,r,o){var a=-e.dot(r,i);return t(o)?(e.clone(r,o.normal),o.distance=a,o):new n(r,a)};var o=new e;return n.fromCartesian4=function(i,r){var a=e.fromCartesian4(i,o),s=i.w;return t(r)?(e.clone(a,r.normal),r.distance=s,r):new n(a,s)},n.getPointDistance=function(t,i){return e.dot(t.normal,i)+t.distance},n.ORIGIN_XY_PLANE=r(new n(e.UNIT_Z,0)),n.ORIGIN_YZ_PLANE=r(new n(e.UNIT_X,0)),n.ORIGIN_ZX_PLANE=r(new n(e.UNIT_Y,0)),n}),i("Core/binarySearch",["./defined","./DeveloperError"],function(e,t){"use strict";function i(e,t,i){for(var r,n,o=0,a=e.length-1;o<=a;)if(r=~~((o+a)/2),n=i(e[r],t),n<0)o=r+1;else{if(!(n>0))return r;a=r-1}return~(a+1)}return i}),i("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,i,r,n){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=i,this.yPoleOffset=r,this.ut1MinusUtc=n}return e}),i("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,i=0,r=t[i++],n=function(e,t,i,r){i||(i=" ");var n=e.length>=t?"":Array(1+t-e.length>>>0).join(i);return r?e+n:n+e},o=function(e,t,i,r,o,a){var s=r-e.length;return s>0&&(e=i||!o?n(e,r,a,i):e.slice(0,t.length)+n("",s,"0",!0)+e.slice(t.length)),e},a=function(e,t,i,r,a,s,l){var u=e>>>0;return i=i&&u&&{2:"0b",8:"0",16:"0x"}[t]||"",e=i+n(u.toString(t),s||0,"0",!1),o(e,i,r,a,l)},s=function(e,t,i,r,n,a){return null!=r&&(e=e.slice(0,r)),o(e,"",t,i,n,a)},l=function(e,r,l,u,c,h,d){var p,m,f,_,g;if("%%"==e)return"%";for(var v=!1,y="",C=!1,w=!1,S=" ",E=l.length,b=0;l&&b<E;b++)switch(l.charAt(b)){case" ":y=" ";break;case"+":y="+";break;case"-":v=!0;break;case"'":S=l.charAt(b+1);break;case"0":C=!0;break;case"#":w=!0}if(u=u?"*"==u?+t[i++]:"*"==u.charAt(0)?+t[u.slice(1,-1)]:+u:0,u<0&&(u=-u,v=!0),!isFinite(u))throw new Error("sprintf: (minimum-)width must be finite");switch(h=h?"*"==h?+t[i++]:"*"==h.charAt(0)?+t[h.slice(1,-1)]:+h:"fFeE".indexOf(d)>-1?6:"d"==d?0:void 0,g=r?t[r.slice(0,-1)]:t[i++],d){case"s":return s(String(g),v,u,h,C,S);case"c":return s(String.fromCharCode(+g),v,u,h,C);case"b":return a(g,2,w,v,u,h,C);case"o":return a(g,8,w,v,u,h,C);case"x":return a(g,16,w,v,u,h,C);case"X":return a(g,16,w,v,u,h,C).toUpperCase();case"u":return a(g,10,w,v,u,h,C);case"i":case"d":return p=+g||0,p=Math.round(p-p%1),m=p<0?"-":y,g=m+n(String(Math.abs(p)),h,"0",!1),o(g,m,v,u,C);case"e":case"E":case"f":case"F":case"g":case"G":return p=+g,m=p<0?"-":y,f=["toExponential","toFixed","toPrecision"]["efg".indexOf(d.toLowerCase())],_=["toString","toUpperCase"]["eEfFgG".indexOf(d)%2],g=m+Math.abs(p)[f](h),o(g,m,v,u,C)[_]();default:return e}};return r.replace(e,l)}return e}),i("Core/GregorianDate",[],function(){"use strict";function e(e,t,i,r,n,o,a,s){this.year=e,this.month=t,this.day=i,this.hour=r,this.minute=n,this.second=o,this.millisecond=a,this.isLeapSecond=s}return e}),i("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),i("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),i("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e(t)}),i("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),i("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e,t){return f.compare(e.julianDate,t.julianDate)}function h(e){y.julianDate=e;var i=f.leapSeconds,r=t(i,y,c);r<0&&(r=~r),r>=i.length&&(r=i.length-1);var n=i[r].offset;if(r>0){var o=f.secondsDifference(i[r].julianDate,e);o>n&&(r--,n=i[r].offset)}f.addSeconds(e,n,e)}function d(e,i){y.julianDate=e;var r=f.leapSeconds,n=t(r,y,c);if(n<0&&(n=~n),0===n)return f.addSeconds(e,-r[0].offset,i);if(n>=r.length)return f.addSeconds(e,-r[n-1].offset,i);var o=f.secondsDifference(r[n].julianDate,e);return 0===o?f.addSeconds(e,-r[n].offset,i):o<=1?void 0:f.addSeconds(e,-r[--n].offset,i)}function p(e,t,i){var r=t/l.SECONDS_PER_DAY|0;return e+=r,t-=l.SECONDS_PER_DAY*r,t<0&&(e--,t+=l.SECONDS_PER_DAY),i.dayNumber=e,i.secondsOfDay=t,i}function m(e,t,i,r,n,o,a){var s=(t-14)/12|0,u=e+4800+s,c=(1461*u/4|0)+(367*(t-2-12*s)/12|0)-(3*((u+100)/100|0)/4|0)+i-32075;r-=12,r<0&&(r+=24);var h=o+(r*l.SECONDS_PER_HOUR+n*l.SECONDS_PER_MINUTE+a*l.SECONDS_PER_MILLISECOND);return h>=43200&&(c-=1),[c,h]}function f(e,t,r){this.dayNumber=void 0,this.secondsOfDay=void 0,e=i(e,0),t=i(t,0),r=i(r,u.UTC);var n=0|e;t+=(e-n)*l.SECONDS_PER_DAY,p(n,t,this),r===u.UTC&&h(this)}var _=new o,g=[31,28,31,30,31,30,31,31,30,31,30,31],v=29,y=new s,C=/^(\d{4})$/,w=/^(\d{4})-(\d{2})$/,S=/^(\d{4})-?(\d{3})$/,E=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,b=/^(\d{4})-?(\d{2})-?(\d{2})$/,T=/([Z+\-])?(\d{2})?:?(\d{2})?$/,x=/^(\d{2})(\.\d+)?/.source+T.source,A=/^(\d{2}):?(\d{2})(\.\d+)?/.source+T.source,P=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+T.source;f.fromDate=function(e,t){var i=m(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r(t)?(p(i[0],i[1],t),h(t),t):new f(i[0],i[1],u.UTC)},f.fromIso8601=function(e,t){e=e.replace(",",".");var i,n,o,s=e.split("T"),l=1,c=1,d=0,_=0,y=0,T=0,D=s[0],M=s[1];if(s=D.match(b),null!==s)i=+s[1],l=+s[2],c=+s[3];else if(s=D.match(w),null!==s)i=+s[1],l=+s[2];else if(s=D.match(C),null!==s)i=+s[1];else{var I;if(s=D.match(S),null!==s)i=+s[1],I=+s[2],o=a(i);else if(s=D.match(E),null!==s){i=+s[1];var R=+s[2],O=+s[3]||0,N=new Date(Date.UTC(i,0,4));I=7*R+O-N.getUTCDay()-3}n=new Date(Date.UTC(i,0,1)),n.setUTCDate(I),l=n.getUTCMonth()+1,c=n.getUTCDate()}o=a(i);var L;if(r(M)){s=M.match(P),null!==s?(d=+s[1],_=+s[2], +y=+s[3],T=1e3*+(s[4]||0),L=5):(s=M.match(A),null!==s?(d=+s[1],_=+s[2],y=60*+(s[3]||0),L=4):(s=M.match(x),null!==s&&(d=+s[1],_=60*+(s[2]||0),L=3)));var B=s[L],F=+s[L+1],V=+(s[L+2]||0);switch(B){case"+":d-=F,_-=V;break;case"-":d+=F,_+=V;break;case"Z":break;default:_+=new Date(Date.UTC(i,l-1,c,d,_)).getTimezoneOffset()}}else _+=new Date(i,l-1,c).getTimezoneOffset();var k=60===y;for(k&&y--;_>=60;)_-=60,d++;for(;d>=24;)d-=24,c++;for(n=o&&2===l?v:g[l-1];c>n;)c-=n,l++,l>12&&(l-=12,i++),n=o&&2===l?v:g[l-1];for(;_<0;)_+=60,d--;for(;d<0;)d+=24,c--;for(;c<1;)l--,l<1&&(l+=12,i--),n=o&&2===l?v:g[l-1],c+=n;var z=m(i,l,c,d,_,y,T);return r(t)?(p(z[0],z[1],t),h(t)):t=new f(z[0],z[1],u.UTC),k&&f.addSeconds(t,1,t),t},f.now=function(e){return f.fromDate(new Date,e)};var D=new f(0,0,u.TAI);return f.toGregorianDate=function(e,t){var i=!1,n=d(e,D);r(n)||(f.addSeconds(e,-1,D),n=d(D,D),i=!0);var a=n.dayNumber,s=n.secondsOfDay;s>=43200&&(a+=1);var u=a+68569|0,c=4*u/146097|0;u=u-((146097*c+3)/4|0)|0;var h=4e3*(u+1)/1461001|0;u=u-(1461*h/4|0)+31|0;var p=80*u/2447|0,m=u-(2447*p/80|0)|0;u=p/11|0;var _=p+2-12*u|0,g=100*(c-49)+h+u|0,v=s/l.SECONDS_PER_HOUR|0,y=s-v*l.SECONDS_PER_HOUR,C=y/l.SECONDS_PER_MINUTE|0;y-=C*l.SECONDS_PER_MINUTE;var w=0|y,S=(y-w)/l.SECONDS_PER_MILLISECOND;return v+=12,v>23&&(v-=24),i&&(w+=1),r(t)?(t.year=g,t.month=_,t.day=m,t.hour=v,t.minute=C,t.second=w,t.millisecond=S,t.isLeapSecond=i,t):new o(g,_,m,v,C,w,S,i)},f.toDate=function(e){var t=f.toGregorianDate(e,_),i=t.second;return t.isLeapSecond&&(i-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,i,t.millisecond))},f.toIso8601=function(t,i){var n,o=f.toGregorianDate(t,o);return r(i)||0===o.millisecond?r(i)&&0!==i?(n=(.01*o.millisecond).toFixed(i).replace(".","").slice(0,i),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",o.year,o.month,o.day,o.hour,o.minute,o.second,n)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",o.year,o.month,o.day,o.hour,o.minute,o.second):(n=(.01*o.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",o.year,o.month,o.day,o.hour,o.minute,o.second,n))},f.clone=function(e,t){if(r(e))return r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new f(e.dayNumber,e.secondsOfDay,u.TAI)},f.compare=function(e,t){var i=e.dayNumber-t.dayNumber;return 0!==i?i:e.secondsOfDay-t.secondsOfDay},f.equals=function(e,t){return e===t||r(e)&&r(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},f.equalsEpsilon=function(e,t,i){return e===t||r(e)&&r(t)&&Math.abs(f.secondsDifference(e,t))<=i},f.totalDays=function(e){return e.dayNumber+e.secondsOfDay/l.SECONDS_PER_DAY},f.secondsDifference=function(e,t){var i=(e.dayNumber-t.dayNumber)*l.SECONDS_PER_DAY;return i+(e.secondsOfDay-t.secondsOfDay)},f.daysDifference=function(e,t){var i=e.dayNumber-t.dayNumber,r=(e.secondsOfDay-t.secondsOfDay)/l.SECONDS_PER_DAY;return i+r},f.computeTaiMinusUtc=function(e){y.julianDate=e;var i=f.leapSeconds,r=t(i,y,c);return r<0&&(r=~r,--r,r<0&&(r=0)),i[r].offset},f.addSeconds=function(e,t,i){return p(e.dayNumber,e.secondsOfDay+t,i)},f.addMinutes=function(e,t,i){var r=e.secondsOfDay+t*l.SECONDS_PER_MINUTE;return p(e.dayNumber,r,i)},f.addHours=function(e,t,i){var r=e.secondsOfDay+t*l.SECONDS_PER_HOUR;return p(e.dayNumber,r,i)},f.addDays=function(e,t,i){var r=e.dayNumber+t;return p(r,e.secondsOfDay,i)},f.lessThan=function(e,t){return f.compare(e,t)<0},f.lessThanOrEquals=function(e,t){return f.compare(e,t)<=0},f.greaterThan=function(e,t){return f.compare(e,t)>0},f.greaterThanOrEquals=function(e,t){return f.compare(e,t)>=0},f.prototype.clone=function(e){return f.clone(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f.prototype.equalsEpsilon=function(e,t){return f.equalsEpsilon(this,e,t)},f.prototype.toString=function(){return f.toIso8601(this)},f.leapSeconds=[new s(new f(2441317,43210,u.TAI),10),new s(new f(2441499,43211,u.TAI),11),new s(new f(2441683,43212,u.TAI),12),new s(new f(2442048,43213,u.TAI),13),new s(new f(2442413,43214,u.TAI),14),new s(new f(2442778,43215,u.TAI),15),new s(new f(2443144,43216,u.TAI),16),new s(new f(2443509,43217,u.TAI),17),new s(new f(2443874,43218,u.TAI),18),new s(new f(2444239,43219,u.TAI),19),new s(new f(2444786,43220,u.TAI),20),new s(new f(2445151,43221,u.TAI),21),new s(new f(2445516,43222,u.TAI),22),new s(new f(2446247,43223,u.TAI),23),new s(new f(2447161,43224,u.TAI),24),new s(new f(2447892,43225,u.TAI),25),new s(new f(2448257,43226,u.TAI),26),new s(new f(2448804,43227,u.TAI),27),new s(new f(2449169,43228,u.TAI),28),new s(new f(2449534,43229,u.TAI),29),new s(new f(2450083,43230,u.TAI),30),new s(new f(2450630,43231,u.TAI),31),new s(new f(2451179,43232,u.TAI),32),new s(new f(2453736,43233,u.TAI),33),new s(new f(2454832,43234,u.TAI),34),new s(new f(2456109,43235,u.TAI),35),new s(new f(2457204,43236,u.TAI),36),new s(new f(2457754,43237,u.TAI),37)],f}),i("Core/clone",["./defaultValue"],function(e){"use strict";function t(i,r){if(null===i||"object"!=typeof i)return i;r=e(r,!1);var n=new i.constructor;for(var o in i)if(i.hasOwnProperty(o)){var a=i[o];r&&(a=t(a,r)),n[o]=a}return n}return t}),i("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var i=e.split("\r\n"),r=0;r<i.length;++r){var n=i[r],o=n.indexOf(": ");if(o>0){var a=n.substring(0,o),s=n.substring(o+2);t[a]=s}}return t}return e}),i("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function i(e,i,r){this.statusCode=e,this.response=i,this.responseHeaders=r,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return i.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},i}),i("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var i=r.exec(t);this.scheme=i[1],this.authority=i[2],this.path=i[3],this.query=i[4],this.fragment=i[5]}}function t(e){var t=unescape(e);return o.test(t)?t:e.toUpperCase()}function i(e,t,i,r){return(t||"")+i.toLowerCase()+(r||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var r=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(a,i).replace(n,t)),this.path&&(this.path=this.path.replace(n,t)),this.query&&(this.query=this.query.replace(n,t)),this.fragment&&(this.fragment=this.fragment.replace(n,t))};var n=/%[0-9a-z]{2}/gi,o=/[a-zA-Z0-9\-\._~]/,a=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var i=new e;return this.scheme?(i.scheme=this.scheme,i.authority=this.authority,i.path=this.path,i.query=this.query):(i.scheme=t.scheme,this.authority?(i.authority=this.authority,i.path=this.path,i.query=this.query):(i.authority=t.authority,""==this.path?(i.path=t.path,i.query=this.query||t.query):("/"==this.path.charAt(0)?(i.path=this.path,i.removeDotSegments()):(t.authority&&""==t.path?i.path="/"+this.path:i.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,i.removeDotSegments()),i.query=this.query))),i.fragment=this.fragment,i},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),i=[],r=""==t[0];r&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?i.pop():"."!=e&&i.push(e);"."!=e&&".."!=e||i.push(""),r&&i.unshift(""),this.path=i.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),i("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(i){var r=new e(i);r.normalize();var n=r.getAuthority();if(t(n)){if(n.indexOf("@")!==-1){var o=n.split("@");n=o[1]}if(n.indexOf(":")===-1){var a=r.getScheme();if(t(a)||(a=window.location.protocol,a=a.substring(0,a.length-1)),"http"===a)n+=":80";else{if("https"!==a)return;n+=":443"}}return n}}var n={},o={};return n.add=function(e,i){var r=e.toLowerCase()+":"+i;t(o[r])||(o[r]=!0)},n.remove=function(e,i){var r=e.toLowerCase()+":"+i;t(o[r])&&delete o[r]},n.contains=function(e){var i=r(e);return!(!t(i)||!t(o[i]))},n.clear=function(){o={}},n}),i("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,i,r,n,o,a){"use strict";function s(i){i=t(i,t.EMPTY_OBJECT);var r=i.responseType,n=t(i.method,"GET"),o=i.data,a=i.headers,l=i.overrideMimeType;return e(i.url,function(t){var i=e.defer();return s.load(t,r,n,o,a,i,l),i.promise})}function l(e,t){var i=decodeURIComponent(t);return e?atob(i):i}function u(e,t){for(var i=l(e,t),r=new ArrayBuffer(i.length),n=new Uint8Array(r),o=0;o<i.length;o++)n[o]=i.charCodeAt(o);return r}function c(e,i){i=t(i,"");var r=e[1],n=!!e[2],o=e[3];switch(i){case"":case"text":return l(n,o);case"arraybuffer":return u(n,o);case"blob":var a=u(n,o);return new Blob([a],{type:r});case"document":var s=new DOMParser;return s.parseFromString(l(n,o),r);case"json":return JSON.parse(l(n,o))}}var h=/^data:(.*?)(;base64)?,(.*)$/;return s.load=function(e,t,r,s,l,u,d){var p=h.exec(e);if(null!==p)return void u.resolve(c(p,t));var m=new XMLHttpRequest;if(a.contains(e)&&(m.withCredentials=!0),i(d)&&i(m.overrideMimeType)&&m.overrideMimeType(d),m.open(r,e,!0),i(l))for(var f in l)l.hasOwnProperty(f)&&m.setRequestHeader(f,l[f]);i(t)&&(m.responseType=t),m.onload=function(){if(m.status<200||m.status>=300)return void u.reject(new n(m.status,m.response,m.getAllResponseHeaders()));var e=m.response,r=m.responseType;if(!i(e)||i(t)&&r!==t)if("json"===t&&"string"==typeof e)try{u.resolve(JSON.parse(e))}catch(e){u.reject(e)}else(""===r||"document"===r)&&i(m.responseXML)&&m.responseXML.hasChildNodes()?u.resolve(m.responseXML):""!==r&&"text"!==r||!i(m.responseText)?u.reject(new o("Invalid XMLHttpRequest response type.")):u.resolve(m.responseText);else u.resolve(e)},m.onerror=function(e){u.reject(new n)},m.send(s)},s.defaultLoad=s.load,s}),i("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,i){return e({url:t,headers:i})}return t}),i("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,i,r){"use strict";function n(i,n){return t(n)?t(n.Accept)||(n=e(n),n.Accept=o.Accept):n=o,r(i,n).then(function(e){return JSON.parse(e)})}var o={Accept:"application/json,*/*;q=0.01"};return n}),i("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,i,r,n,o,a,s,l,u,c,h){"use strict";function d(t){if(t=i(t,i.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=i(t.addNewLeapSeconds,!0),r(t.data))m(this,t.data);else if(r(t.url)){var n=this;this._downloadPromise=e(l(t.url),function(e){m(n,e)},function(){n._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else m(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function p(e,t){return a.compare(e.julianDate,t)}function m(e,i){if(!r(i.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!r(i.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var n=i.columnNames.indexOf("modifiedJulianDateUtc"),o=i.columnNames.indexOf("xPoleWanderRadians"),l=i.columnNames.indexOf("yPoleWanderRadians"),u=i.columnNames.indexOf("ut1MinusUtcSeconds"),d=i.columnNames.indexOf("xCelestialPoleOffsetRadians"),m=i.columnNames.indexOf("yCelestialPoleOffsetRadians"),f=i.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||o<0||l<0||u<0||d<0||m<0||f<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var _=e._samples=i.samples,g=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=o,e._yPoleWanderRadiansColumn=l,e._ut1MinusUtcSecondsColumn=u,e._xCelestialPoleOffsetRadiansColumn=d,e._yCelestialPoleOffsetRadiansColumn=m,e._taiMinusUtcSecondsColumn=f,e._columnCount=i.columnNames.length,e._lastIndex=void 0;for(var v,y=e._addNewLeapSeconds,C=0,w=_.length;C<w;C+=e._columnCount){var S=_[C+n],E=_[C+f],b=S+c.MODIFIED_JULIAN_DATE_DIFFERENCE,T=new a(b,E,h.TAI);if(g.push(T),y){if(E!==v&&r(v)){var x=a.leapSeconds,A=t(x,T,p);if(A<0){var P=new s(T,E);x.splice(~A,0,P)}}v=E}}}function f(e,t,i,r,n){var o=i*r;n.xPoleWander=t[o+e._xPoleWanderRadiansColumn],n.yPoleWander=t[o+e._yPoleWanderRadiansColumn],n.xPoleOffset=t[o+e._xCelestialPoleOffsetRadiansColumn],n.yPoleOffset=t[o+e._yCelestialPoleOffsetRadiansColumn],n.ut1MinusUtc=t[o+e._ut1MinusUtcSecondsColumn]}function _(e,t,i){return t+e*(i-t)}function g(e,t,i,r,n,o,s){var l=e._columnCount;if(o>t.length-1)return s.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;var u=t[n],c=t[o];if(u.equals(c)||r.equals(u))return f(e,i,n,l,s),s;if(r.equals(c))return f(e,i,o,l,s),s;var h=a.secondsDifference(r,u)/a.secondsDifference(c,u),d=n*l,p=o*l,m=i[d+e._ut1MinusUtcSecondsColumn],g=i[p+e._ut1MinusUtcSecondsColumn],v=g-m;if(v>.5||v<-.5){var y=i[d+e._taiMinusUtcSecondsColumn],C=i[p+e._taiMinusUtcSecondsColumn];y!==C&&(c.equals(r)?m=g:g-=C-y)}return s.xPoleWander=_(h,i[d+e._xPoleWanderRadiansColumn],i[p+e._xPoleWanderRadiansColumn]),s.yPoleWander=_(h,i[d+e._yPoleWanderRadiansColumn],i[p+e._yPoleWanderRadiansColumn]),s.xPoleOffset=_(h,i[d+e._xCelestialPoleOffsetRadiansColumn],i[p+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=_(h,i[d+e._yCelestialPoleOffsetRadiansColumn],i[p+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=_(h,m,g),s}return d.NONE=o({getPromiseToLoad:function(){return e()},compute:function(e,t){return r(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new n(0,0,0,0,0),t}}),d.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},d.prototype.compute=function(e,i){if(r(this._samples)){if(r(i)||(i=new n(0,0,0,0,0)),0===this._samples.length)return i.xPoleWander=0,i.yPoleWander=0,i.xPoleOffset=0,i.yPoleOffset=0,i.ut1MinusUtc=0,i;var o=this._dates,s=this._lastIndex,l=0,c=0;if(r(s)){var h=o[s],d=o[s+1],p=a.lessThanOrEquals(h,e),m=!r(d),f=m||a.greaterThanOrEquals(d,e);if(p&&f)return l=s,!m&&d.equals(e)&&++l,c=l+1,g(this,o,this._samples,e,l,c,i),i}var _=t(o,e,a.compare,this._dateColumn);return _>=0?(_<o.length-1&&o[_+1].equals(e)&&++_,l=_,c=_):(c=~_,l=c-1,l<0&&(l=0)),this._lastIndex=l,g(this,o,this._samples,e,l,c,i),i}if(r(this._dataError))throw new u(this._dataError)},d}),i("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,i,r){"use strict";function n(t,i,r){this.heading=e(t,0),this.pitch=e(i,0),this.roll=e(r,0)}return n.fromQuaternion=function(e,i){t(i)||(i=new n);var r=2*(e.w*e.y-e.z*e.x),o=1-2*(e.x*e.x+e.y*e.y),a=2*(e.w*e.x+e.y*e.z),s=1-2*(e.y*e.y+e.z*e.z),l=2*(e.w*e.z+e.x*e.y);return i.heading=-Math.atan2(l,s),i.roll=Math.atan2(a,o),i.pitch=-Math.asin(r),i},n.fromDegrees=function(e,i,o,a){return t(a)||(a=new n),a.heading=e*r.RADIANS_PER_DEGREE,a.pitch=i*r.RADIANS_PER_DEGREE,a.roll=o*r.RADIANS_PER_DEGREE,a},n.clone=function(e,i){if(t(e))return t(i)?(i.heading=e.heading,i.pitch=e.pitch,i.roll=e.roll,i):new n(e.heading,e.pitch,e.roll)},n.equals=function(e,i){return e===i||t(e)&&t(i)&&e.heading===i.heading&&e.pitch===i.pitch&&e.roll===i.roll},n.equalsEpsilon=function(e,i,n,o){return e===i||t(e)&&t(i)&&r.equalsEpsilon(e.heading,i.heading,n,o)&&r.equalsEpsilon(e.pitch,i.pitch,n,o)&&r.equalsEpsilon(e.roll,i.roll,n,o)},n.prototype.clone=function(e){return n.clone(this,e)},n.prototype.equals=function(e){return n.equals(this,e)},n.prototype.equalsEpsilon=function(e,t,i){return n.equalsEpsilon(this,e,t,i)},n.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},n}),i("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,i,r){"use strict";function n(i,r){r=t(r,document.location.href);var n=new e(r),o=new e(i);return o.resolve(n).toString()}return n}),i("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,i,r){"use strict";function n(r,n,o){o=t(o,!0),r instanceof e||(r=new e(r)),n instanceof e||(n=new e(n)),i(n.authority)&&!i(n.scheme)&&("undefined"!=typeof document&&i(document.location)&&i(document.location.href)?n.scheme=new e(document.location.href).scheme:n.scheme=r.scheme);var a=r;n.isAbsolute()&&(a=n);var s="";i(a.scheme)&&(s+=a.scheme+":"),i(a.authority)&&(s+="//"+a.authority,""!==a.path&&"/"!==a.path&&(s=s.replace(/\/?$/,"/"),a.path=a.path.replace(/^\/?/g,""))),s+=a===r?o?r.path.replace(/\/?$/,"/")+n.path.replace(/^\/?/g,""):r.path+n.path:n.path;var l=i(r.query),u=i(n.query);l&&u?s+="?"+r.query+"&"+n.query:l&&!u?s+="?"+r.query:!l&&u&&(s+="?"+n.query);var c=i(n.fragment);return i(r.fragment)&&!c?s+="#"+r.fragment:c&&(s+="#"+n.fragment),s}return n}),i("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","./joinUrls","require"],function(e,t,i,r,n,o){"use strict";function a(){for(var e=document.getElementsByTagName("script"),t=0,i=e.length;t<i;++t){var r=e[t].getAttribute("src"),n=m.exec(r);if(null!==n)return n[1]}}function s(){if(t(h))return h;var i;return i="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:a(),h=new e(r(i))}function l(e){return o.toUrl("../"+e)}function u(e){return n(s(),e)}function c(e){t(d)||(d=t(o.toUrl)?l:u),t(p)||(p=document.createElement("a"));var i=d(e);return p.href=i,p.href=p.href,p.href}var h,d,p,m=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return c._cesiumScriptRegex=m,c.setBaseUrl=function(t){h=new e(t).resolve(new e(document.location.href))},c}),i("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,i){this.x=e,this.y=t,this.s=i}return e}),i("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){e=i(e,i.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=i(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=i(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new o(this._sampleZeroJulianEphemerisDate,0,s.TAI),this._stepSizeDays=i(e.stepSizeDays,1),this._samplesPerXysFile=i(e.samplesPerXysFile,1e3),this._totalSamples=i(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,r=this._denominators=new Array(t+1),n=this._xTable=new Array(t+1),a=Math.pow(this._stepSizeDays,t),l=0;l<=t;++l){r[l]=a,n[l]=l*this._stepSizeDays;for(var u=0;u<=t;++u)u!==l&&(r[l]*=l-u);r[l]=1/r[l]}this._work=new Array(t+1),this._coef=new Array(t+1)}function u(e,t,i){var r=h;return r.dayNumber=t,r.secondsOfDay=i,o.daysDifference(r,e._sampleZeroDateTT)}function c(i,n){if(i._chunkDownloadsInProgress[n])return i._chunkDownloadsInProgress[n];var o=e.defer();i._chunkDownloadsInProgress[n]=o;var s,l=i._xysFileUrlTemplate;return s=r(l)?l.replace("{0}",n):t("Assets/IAU2006_XYS/IAU2006_XYS_"+n+".json"),e(a(s),function(e){i._chunkDownloadsInProgress[n]=!1;for(var t=i._samples,r=e.samples,a=n*i._samplesPerXysFile*3,s=0,l=r.length;s<l;++s)t[a+s]=r[s];o.resolve()}),o.promise}var h=new o(0,0,s.TAI);return l.prototype.preload=function(t,i,r,n){var o=u(this,t,i),a=u(this,r,n),s=o/this._stepSizeDays-this._interpolationOrder/2|0;s<0&&(s=0);var l=a/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;l>=this._totalSamples&&(l=this._totalSamples-1);for(var h=s/this._samplesPerXysFile|0,d=l/this._samplesPerXysFile|0,p=[],m=h;m<=d;++m)p.push(c(this,m));return e.all(p)},l.prototype.computeXysRadians=function(e,t,i){var o=u(this,e,t);if(!(o<0)){var a=o/this._stepSizeDays|0;if(!(a>=this._totalSamples)){var s=this._interpolationOrder,l=a-(s/2|0);l<0&&(l=0);var h=l+s;h>=this._totalSamples&&(h=this._totalSamples-1,l=h-s,l<0&&(l=0));var d=!1,p=this._samples;if(r(p[3*l])||(c(this,l/this._samplesPerXysFile|0),d=!0),r(p[3*h])||(c(this,h/this._samplesPerXysFile|0),d=!0),!d){r(i)?(i.x=0,i.y=0,i.s=0):i=new n(0,0,0);var m,f,_=o-l*this._stepSizeDays,g=this._work,v=this._denominators,y=this._coef,C=this._xTable;for(m=0;m<=s;++m)g[m]=_-C[m];for(m=0;m<=s;++m){for(y[m]=1,f=0;f<=s;++f)f!==m&&(y[m]*=g[f]);y[m]*=v[m];var w=3*(l+m);i.x+=y[m]*p[w++],i.y+=y[m]*p[w++],i.s+=y[m]*p[w]}return i}}}},l}),i("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var i,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},n={};return t(n,{element:{get:function(){if(n.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(n.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(n.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(n.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(n.supportsFullscreen())return null!==n.element}}}),n.supportsFullscreen=function(){if(e(i))return i;i=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",i=!0;for(var n,o=["webkit","moz","o","ms","khtml"],a=0,s=o.length;a<s;++a){var l=o[a];n=l+"RequestFullscreen","function"==typeof t[n]?(r.requestFullscreen=n,i=!0):(n=l+"RequestFullScreen","function"==typeof t[n]&&(r.requestFullscreen=n,i=!0)),n=l+"ExitFullscreen","function"==typeof document[n]?r.exitFullscreen=n:(n=l+"CancelFullScreen","function"==typeof document[n]&&(r.exitFullscreen=n)),n=l+"FullscreenEnabled",void 0!==document[n]?r.fullscreenEnabled=n:(n=l+"FullScreenEnabled",void 0!==document[n]&&(r.fullscreenEnabled=n)),n=l+"FullscreenElement",void 0!==document[n]?r.fullscreenElement=n:(n=l+"FullScreenElement",void 0!==document[n]&&(r.fullscreenElement=n)),n=l+"fullscreenchange",void 0!==document["on"+n]&&("ms"===l&&(n="MSFullscreenChange"),r.fullscreenchange=n),n=l+"fullscreenerror",void 0!==document["on"+n]&&("ms"===l&&(n="MSFullscreenError"),r.fullscreenerror=n)}return i},n.requestFullscreen=function(e,t){n.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},n.exitFullscreen=function(){n.supportsFullscreen()&&document[r.exitFullscreen]()},n}),i("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,i){"use strict";function r(e){for(var t=e.split("."),i=0,r=t.length;i<r;++i)t[i]=parseInt(t[i],10);return t}function n(){if(!t(w)&&(w=!1,!d())){var e=/ Chrome\/([\.0-9]+)/.exec(C.userAgent);null!==e&&(w=!0,S=r(e[1]))}return w}function o(){return n()&&S}function a(){if(!t(E)&&(E=!1,!n()&&!d()&&/ Safari\/[\.0-9]+/.test(C.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(C.userAgent);null!==e&&(E=!0,b=r(e[1]))}return E}function s(){return a()&&b}function l(){if(!t(T)){T=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(C.userAgent);null!==e&&(T=!0,x=r(e[1]),x.isNightly=!!e[2])}return T}function u(){return l()&&x}function c(){if(!t(A)){A=!1;var e;"Microsoft Internet Explorer"===C.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(C.userAgent),null!==e&&(A=!0,P=r(e[1]))):"Netscape"===C.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(C.userAgent),null!==e&&(A=!0,P=r(e[1])))}return A}function h(){return c()&&P}function d(){if(!t(D)){D=!1;var e=/ Edge\/([\.0-9]+)/.exec(C.userAgent);null!==e&&(D=!0,M=r(e[1]))}return D}function p(){return d()&&M}function m(){if(!t(I)){I=!1;var e=/Firefox\/([\.0-9]+)/.exec(C.userAgent);null!==e&&(I=!0,R=r(e[1]))}return I}function f(){return t(O)||(O=/Windows/i.test(C.appVersion)),O}function _(){return m()&&R}function g(){return t(N)||(N="undefined"!=typeof PointerEvent&&(!t(C.pointerEnabled)||C.pointerEnabled)),N}function v(){if(!t(B)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var i=e.style.imageRendering;B=t(i)&&""!==i,B&&(L=i)}return B}function y(){return v()?L:void 0}var C;C="undefined"!=typeof navigator?navigator:{};var w,S,E,b,T,x,A,P,D,M,I,R,O,N,L,B,F={isChrome:n,chromeVersion:o,isSafari:a,safariVersion:s,isWebkit:l,webkitVersion:u,isInternetExplorer:c,internetExplorerVersion:h,isEdge:d,edgeVersion:p,isFirefox:m,firefoxVersion:_,isWindows:f,hardwareConcurrency:e(C.hardwareConcurrency,3),supportsPointerEvents:g,supportsImageRenderingPixelated:v,imageRenderingValue:y};return F.supportsFullscreen=function(){return i.supportsFullscreen()},F.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},F.supportsWebWorkers=function(){return"undefined"!=typeof Worker},F}),i("Core/Quaternion",["./Cartesian3","./Check","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math","./Matrix3"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(e,t,r,n){this.x=i(e,0),this.y=i(t,0),this.z=i(r,0),this.w=i(n,0)}var c=new e;u.fromAxisAngle=function(t,i,n){var o=i/2,a=Math.sin(o);c=e.normalize(t,c);var s=c.x*a,l=c.y*a,h=c.z*a,d=Math.cos(o);return r(n)?(n.x=s,n.y=l,n.z=h,n.w=d,n):new u(s,l,h,d)};var h=[1,2,0],d=new Array(3);u.fromRotationMatrix=function(e,t){var i,n,o,a,s,c=e[l.COLUMN0ROW0],p=e[l.COLUMN1ROW1],m=e[l.COLUMN2ROW2],f=c+p+m;if(f>0)i=Math.sqrt(f+1),s=.5*i,i=.5/i,n=(e[l.COLUMN1ROW2]-e[l.COLUMN2ROW1])*i,o=(e[l.COLUMN2ROW0]-e[l.COLUMN0ROW2])*i,a=(e[l.COLUMN0ROW1]-e[l.COLUMN1ROW0])*i;else{var _=h,g=0;p>c&&(g=1),m>c&&m>p&&(g=2);var v=_[g],y=_[v];i=Math.sqrt(e[l.getElementIndex(g,g)]-e[l.getElementIndex(v,v)]-e[l.getElementIndex(y,y)]+1);var C=d;C[g]=.5*i,i=.5/i,s=(e[l.getElementIndex(y,v)]-e[l.getElementIndex(v,y)])*i,C[v]=(e[l.getElementIndex(v,g)]+e[l.getElementIndex(g,v)])*i,C[y]=(e[l.getElementIndex(y,g)]+e[l.getElementIndex(g,y)])*i,n=-C[0],o=-C[1],a=-C[2]}return r(t)?(t.x=n,t.y=o,t.z=a,t.w=s,t):new u(n,o,a,s)};var p=new u;u.fromHeadingPitchRoll=function(t,i,r,n){var o=u.fromAxisAngle(e.UNIT_X,r,p),a=u.fromAxisAngle(e.UNIT_Y,-i,n);n=u.multiply(a,o,a);var s=u.fromAxisAngle(e.UNIT_Z,-t,p);return u.multiply(s,n,n)};var m=new e,f=new e,_=new u,g=new u,v=new u;u.packedLength=4,u.pack=function(e,t,r){return r=i(r,0),t[r++]=e.x,t[r++]=e.y,t[r++]=e.z,t[r]=e.w,t},u.unpack=function(e,t,n){return t=i(t,0),r(n)||(n=new u),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n},u.packedInterpolationLength=3,u.convertPackedArrayForInterpolation=function(e,t,i,r){u.unpack(e,4*i,v),u.conjugate(v,v);for(var n=0,o=i-t+1;n<o;n++){var a=3*n;u.unpack(e,4*(t+n),_),u.multiply(_,v,_),_.w<0&&u.negate(_,_),u.computeAxis(_,m);var s=u.computeAngle(_);r[a]=m.x*s,r[a+1]=m.y*s,r[a+2]=m.z*s}},u.unpackInterpolationResult=function(t,i,n,o,a){r(a)||(a=new u),e.fromArray(t,0,f);var s=e.magnitude(f);return u.unpack(i,4*o,g),0===s?u.clone(u.IDENTITY,_):u.fromAxisAngle(f,s,_),u.multiply(_,g,a)},u.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new u(e.x,e.y,e.z,e.w)},u.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},u.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},u.magnitude=function(e){return Math.sqrt(u.magnitudeSquared(e))},u.normalize=function(e,t){var i=1/u.magnitude(e),r=e.x*i,n=e.y*i,o=e.z*i,a=e.w*i;return t.x=r,t.y=n,t.z=o,t.w=a,t},u.inverse=function(e,t){var i=u.magnitudeSquared(e);return t=u.conjugate(e,t),u.multiplyByScalar(t,1/i,t)},u.add=function(e,t,i){return i.x=e.x+t.x,i.y=e.y+t.y,i.z=e.z+t.z,i.w=e.w+t.w,i},u.subtract=function(e,t,i){return i.x=e.x-t.x,i.y=e.y-t.y,i.z=e.z-t.z,i.w=e.w-t.w,i},u.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},u.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},u.multiply=function(e,t,i){var r=e.x,n=e.y,o=e.z,a=e.w,s=t.x,l=t.y,u=t.z,c=t.w,h=a*s+r*c+n*u-o*l,d=a*l-r*u+n*c+o*s,p=a*u+r*l-n*s+o*c,m=a*c-r*s-n*l-o*u;return i.x=h,i.y=d,i.z=p,i.w=m,i},u.multiplyByScalar=function(e,t,i){return i.x=e.x*t,i.y=e.y*t,i.z=e.z*t,i.w=e.w*t,i},u.divideByScalar=function(e,t,i){return i.x=e.x/t,i.y=e.y/t,i.z=e.z/t,i.w=e.w/t,i},u.computeAxis=function(e,t){var i=e.w;if(Math.abs(i-1)<s.EPSILON6)return t.x=t.y=t.z=0,t;var r=1/Math.sqrt(1-i*i);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},u.computeAngle=function(e){return Math.abs(e.w-1)<s.EPSILON6?0:2*Math.acos(e.w)};var y=new u;u.lerp=function(e,t,i,r){return y=u.multiplyByScalar(t,i,y),r=u.multiplyByScalar(e,1-i,r),u.add(y,r,r)};var C=new u,w=new u,S=new u;u.slerp=function(e,t,i,r){var n=u.dot(e,t),o=t;if(n<0&&(n=-n,o=C=u.negate(t,C)),1-n<s.EPSILON6)return u.lerp(e,o,i,r);var a=Math.acos(n);return w=u.multiplyByScalar(e,Math.sin((1-i)*a),w),S=u.multiplyByScalar(o,Math.sin(i*a),S),r=u.add(w,S,r),u.multiplyByScalar(r,1/Math.sin(a),r)},u.log=function(t,i){var r=s.acosClamped(t.w),n=0;return 0!==r&&(n=r/Math.sin(r)),e.multiplyByScalar(t,n,i)},u.exp=function(t,i){var r=e.magnitude(t),n=0;return 0!==r&&(n=Math.sin(r)/r),i.x=t.x*n,i.y=t.y*n,i.z=t.z*n,i.w=Math.cos(r),i};var E=new e,b=new e,T=new u,x=new u;u.computeInnerQuadrangle=function(t,i,r,n){var o=u.conjugate(i,T);u.multiply(o,r,x);var a=u.log(x,E);u.multiply(o,t,x);var s=u.log(x,b);return e.add(a,s,a),e.multiplyByScalar(a,.25,a),e.negate(a,a),u.exp(a,T),u.multiply(i,T,n)},u.squad=function(e,t,i,r,n,o){var a=u.slerp(e,t,n,T),s=u.slerp(i,r,n,x);return u.slerp(a,s,2*n*(1-n),o)};for(var A=new u,P=1.9011074535173003,D=o.supportsTypedArrays()?new Float32Array(8):[],M=o.supportsTypedArrays()?new Float32Array(8):[],I=o.supportsTypedArrays()?new Float32Array(8):[],R=o.supportsTypedArrays()?new Float32Array(8):[],O=0;O<7;++O){var N=O+1,L=2*N+1;D[O]=1/(N*L),M[O]=N/L}return D[7]=P/136,M[7]=8*P/17,u.fastSlerp=function(e,t,i,r){var n,o=u.dot(e,t);o>=0?n=1:(n=-1,o=-o);for(var a=o-1,s=1-i,l=i*i,c=s*s,h=7;h>=0;--h)I[h]=(D[h]*l-M[h])*a,R[h]=(D[h]*c-M[h])*a;var d=n*i*(1+I[0]*(1+I[1]*(1+I[2]*(1+I[3]*(1+I[4]*(1+I[5]*(1+I[6]*(1+I[7])))))))),p=s*(1+R[0]*(1+R[1]*(1+R[2]*(1+R[3]*(1+R[4]*(1+R[5]*(1+R[6]*(1+R[7])))))))),m=u.multiplyByScalar(e,p,A);return u.multiplyByScalar(t,d,r),u.add(m,r,r)},u.fastSquad=function(e,t,i,r,n,o){var a=u.fastSlerp(e,t,n,T),s=u.fastSlerp(i,r,n,x);return u.fastSlerp(a,s,2*n*(1-n),o)},u.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},u.equalsEpsilon=function(e,t,i){ +return e===t||r(e)&&r(t)&&Math.abs(e.x-t.x)<=i&&Math.abs(e.y-t.y)<=i&&Math.abs(e.z-t.z)<=i&&Math.abs(e.w-t.w)<=i},u.ZERO=a(new u(0,0,0,0)),u.IDENTITY=a(new u(0,0,0,1)),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,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},u}),i("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./Check","./defaultValue","./defined","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./HeadingPitchRoll","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C){"use strict";var w={},S=new i,E=new i,b=new i;w.eastNorthUpToFixedFrame=function(e,t,r){if(_.equalsEpsilon(e.x,0,_.EPSILON14)&&_.equalsEpsilon(e.y,0,_.EPSILON14)){var n=_.sign(e.z);return s(r)?(r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=-n,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=n,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new v(0,-n,0,e.x,1,0,0,e.y,0,0,n,e.z,0,0,0,1)}var o=S,l=E,u=b;return t=a(t,h.WGS84),t.geodeticSurfaceNormal(e,o),l.x=-e.y,l.y=e.x,l.z=0,i.normalize(l,l),i.cross(o,l,u),s(r)?(r[0]=l.x,r[1]=l.y,r[2]=l.z,r[3]=0,r[4]=u.x,r[5]=u.y,r[6]=u.z,r[7]=0,r[8]=o.x,r[9]=o.y,r[10]=o.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new v(l.x,u.x,o.x,e.x,l.y,u.y,o.y,e.y,l.z,u.z,o.z,e.z,0,0,0,1)};var T=new i,x=new i,A=new i;w.northEastDownToFixedFrame=function(e,t,r){if(_.equalsEpsilon(e.x,0,_.EPSILON14)&&_.equalsEpsilon(e.y,0,_.EPSILON14)){var n=_.sign(e.z);return s(r)?(r[0]=-n,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=-n,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new v(-n,0,0,e.x,0,1,0,e.y,0,0,-n,e.z,0,0,0,1)}var o=T,l=x,u=A;return t=a(t,h.WGS84),t.geodeticSurfaceNormal(e,o),l.x=-e.y,l.y=e.x,l.z=0,i.normalize(l,l),i.cross(o,l,u),s(r)?(r[0]=u.x,r[1]=u.y,r[2]=u.z,r[3]=0,r[4]=l.x,r[5]=l.y,r[6]=l.z,r[7]=0,r[8]=-o.x,r[9]=-o.y,r[10]=-o.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new v(u.x,l.x,-o.x,e.x,u.y,l.y,-o.y,e.y,u.z,l.z,-o.z,e.z,0,0,0,1)},w.northUpEastToFixedFrame=function(e,t,r){if(_.equalsEpsilon(e.x,0,_.EPSILON14)&&_.equalsEpsilon(e.y,0,_.EPSILON14)){var n=_.sign(e.z);return s(r)?(r[0]=-n,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=n,r[7]=0,r[8]=0,r[9]=1,r[10]=0,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new v(-n,0,0,e.x,0,0,1,e.y,0,n,0,e.z,0,0,0,1)}var o=S,l=E,u=b;return t=a(t,h.WGS84),t.geodeticSurfaceNormal(e,o),l.x=-e.y,l.y=e.x,l.z=0,i.normalize(l,l),i.cross(o,l,u),s(r)?(r[0]=u.x,r[1]=u.y,r[2]=u.z,r[3]=0,r[4]=o.x,r[5]=o.y,r[6]=o.z,r[7]=0,r[8]=l.x,r[9]=l.y,r[10]=l.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new v(u.x,o.x,l.x,e.x,u.y,o.y,l.y,e.y,u.z,o.z,l.z,e.z,0,0,0,1)},w.northWestUpToFixedFrame=function(e,t,r){if(_.equalsEpsilon(e.x,0,_.EPSILON14)&&_.equalsEpsilon(e.y,0,_.EPSILON14)){var n=_.sign(e.z);return s(r)?(r[0]=-n,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=n,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new v(-n,0,0,e.x,0,-1,0,e.y,0,0,n,e.z,0,0,0,1)}var o=S,l=E,u=b;return t=a(t,h.WGS84),t.geodeticSurfaceNormal(e,o),l.x=-e.y,l.y=e.x,l.z=0,i.normalize(l,l),i.cross(o,l,u),s(r)?(r[0]=u.x,r[1]=u.y,r[2]=u.z,r[3]=0,r[4]=-l.x,r[5]=-l.y,r[6]=-l.z,r[7]=0,r[8]=o.x,r[9]=o.y,r[10]=o.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new v(u.x,-l.x,o.x,e.x,u.y,-l.y,o.y,e.y,u.z,-l.z,o.z,e.z,0,0,0,1)};var P=new y,D=new i(1,1,1),M=new v;w.headingPitchRollToFixedFrame=function(e,t,r,n){o.typeOf.object("headingPitchRoll",t);var a=t.heading,s=t.pitch,l=t.roll,u=y.fromHeadingPitchRoll(a,s,l,P),c=v.fromTranslationQuaternionRotationScale(i.ZERO,u,D,M);return n=w.eastNorthUpToFixedFrame(e,r,n),v.multiply(n,c,n)};var I=new v,R=new g;w.headingPitchRollQuaternion=function(e,t,i,r){o.typeOf.object("headingPitchRoll",t);var n=w.headingPitchRollToFixedFrame(e,t,i,I),a=v.getRotation(n,R);return y.fromRotationMatrix(a,r)};var O=24110.54841,N=8640184.812866,L=.093104,B=-62e-7,F=1.1772758384668e-19,V=72921158553e-15,k=_.TWO_PI/86400,z=new f;w.computeTemeToPseudoFixedMatrix=function(e,t){z=f.addSeconds(e,-f.computeTaiMinusUtc(e),z);var i,r=z.dayNumber,n=z.secondsOfDay,o=r-2451545;i=n>=43200?(o+.5)/C.DAYS_PER_JULIAN_CENTURY:(o-.5)/C.DAYS_PER_JULIAN_CENTURY;var a=O+i*(N+i*(L+i*B)),l=a*k%_.TWO_PI,u=V+F*(r-2451545.5),c=(n+.5*C.SECONDS_PER_DAY)%C.SECONDS_PER_DAY,h=l+u*c,d=Math.cos(h),p=Math.sin(h);return s(t)?(t[0]=d,t[1]=-p,t[2]=0,t[3]=p,t[4]=d,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new g(d,p,0,-p,d,0,0,0,1)},w.iau2006XysData=new p,w.earthOrientationParameters=u.NONE;var U=32.184,G=2451545;w.preloadIcrfFixed=function(t){var i=t.start.dayNumber,r=t.start.secondsOfDay+U,n=t.stop.dayNumber,o=t.stop.secondsOfDay+U,a=w.iau2006XysData.preload(i,r,n,o),s=w.earthOrientationParameters.getPromiseToLoad();return e.all([a,s])},w.computeIcrfToFixedMatrix=function(e,t){s(t)||(t=new g);var i=w.computeFixedToIcrfMatrix(e,t);if(s(i))return g.transpose(i,t)};var W=new m(0,0,0),H=new c(0,0,0,0,0,0),q=new g,j=new g;w.computeFixedToIcrfMatrix=function(e,t){s(t)||(t=new g);var i=w.earthOrientationParameters.compute(e,H);if(s(i)){var r=e.dayNumber,n=e.secondsOfDay+U,o=w.iau2006XysData.computeXysRadians(r,n,W);if(s(o)){var a=o.x+i.xPoleOffset,l=o.y+i.yPoleOffset,u=1/(1+Math.sqrt(1-a*a-l*l)),c=q;c[0]=1-u*a*a,c[3]=-u*a*l,c[6]=a,c[1]=-u*a*l,c[4]=1-u*l*l,c[7]=l,c[2]=-a,c[5]=-l,c[8]=1-u*(a*a+l*l);var h=g.fromRotationZ(-o.s,j),d=g.multiply(c,h,q),p=e.dayNumber,m=e.secondsOfDay-f.computeTaiMinusUtc(e)+i.ut1MinusUtc,v=p-2451545,y=m/C.SECONDS_PER_DAY,S=.779057273264+y+.00273781191135448*(v+y);S=S%1*_.TWO_PI;var E=g.fromRotationZ(S,j),b=g.multiply(d,E,q),T=Math.cos(i.xPoleWander),x=Math.cos(i.yPoleWander),A=Math.sin(i.xPoleWander),P=Math.sin(i.yPoleWander),D=r-G+n/C.SECONDS_PER_DAY;D/=36525;var M=-47e-6*D*_.RADIANS_PER_DEGREE/3600,I=Math.cos(M),R=Math.sin(M),O=j;return O[0]=T*I,O[1]=T*R,O[2]=A,O[3]=-x*R+P*A*I,O[4]=x*I+P*A*R,O[5]=-P*T,O[6]=-P*R-x*A*I,O[7]=P*I-x*A*R,O[8]=x*T,g.multiply(b,O,t)}}};var Y=new r;w.pointToWindowCoordinates=function(e,t,i,r){return r=w.pointToGLWindowCoordinates(e,t,i,r),r.y=2*t[5]-r.y,r},w.pointToGLWindowCoordinates=function(e,i,n,o){s(o)||(o=new t);var a=Y;return v.multiplyByVector(e,r.fromElements(n.x,n.y,n.z,1,a),a),r.multiplyByScalar(a,1/a.w,a),v.multiplyByVector(i,a,a),t.fromCartesian4(a,o)};var X=new i,Z=new i,K=new i;w.rotationMatrixFromPositionVelocity=function(e,t,r,n){var o=a(r,h.WGS84).geodeticSurfaceNormal(e,X),l=i.cross(t,o,Z);i.equalsEpsilon(l,i.ZERO,_.EPSILON6)&&(l=i.clone(i.UNIT_X,l));var u=i.cross(l,t,K);return i.cross(t,u,l),i.negate(l,l),s(n)||(n=new g),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=l.x,n[4]=l.y,n[5]=l.z,n[6]=u.x,n[7]=u.y,n[8]=u.z,n};var Q=new n,J=new i,$=new i,ee=new r,te=new r,ie=new r,re=new r,ne=new r,oe=new v,ae=new v;w.basisTo2D=function(e,t,n){var o=e.ellipsoid,a=v.getColumn(t,3,ee),s=o.cartesianToCartographic(a,Q),l=w.eastNorthUpToFixedFrame(a,o,oe),u=v.inverseTransformation(l,ae),c=e.project(s,J),h=te;h.x=c.z,h.y=c.x,h.z=c.y,h.w=1;var d=v.getColumn(t,0,$),p=i.magnitude(d),m=v.multiplyByVector(u,d,ie);r.fromElements(m.z,m.x,m.y,0,m);var f=v.getColumn(t,1,$),_=i.magnitude(f),g=v.multiplyByVector(u,f,re);r.fromElements(g.z,g.x,g.y,0,g);var y=v.getColumn(t,2,$),C=i.magnitude(y),S=ne;return i.cross(m,g,S),i.normalize(S,S),i.cross(g,S,m),i.normalize(m,m),i.cross(S,m,g),i.normalize(g,g),i.multiplyByScalar(m,p,m),i.multiplyByScalar(g,_,g),i.multiplyByScalar(S,C,S),v.setColumn(n,0,m,n),v.setColumn(n,1,g,n),v.setColumn(n,2,S,n),v.setColumn(n,3,h,n),n};var se=new v(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);return w.wgs84To2DModelMatrix=function(e,t,i){var r=e.ellipsoid,n=w.eastNorthUpToFixedFrame(t,r,oe),o=v.inverseTransformation(n,ae),a=r.cartesianToCartographic(t,Q),s=e.project(a,J),l=te;l.x=s.z,l.y=s.x,l.z=s.y,l.w=1;var u=v.fromTranslation(l,oe);return v.multiply(se,o,i),v.multiply(u,i,i),i},w}),i("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p){"use strict";function m(e,t){t=n(t,l.WGS84),e=t.scaleToGeodeticSurface(e);var r=p.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=i.fromCartesian4(c.getColumn(r,0,f)),this._yAxis=i.fromCartesian4(c.getColumn(r,1,f));var o=i.fromCartesian4(c.getColumn(r,2,f));this._plane=h.fromPointNormal(e,o)}var f=new r;a(m.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var _=new e;m.fromPoints=function(t,i){var r=e.fromPoints(t,_);return new m(r.center,i)};var g=new d,v=new i;m.prototype.projectPointOntoPlane=function(e,r){var n=g;n.origin=e,i.normalize(e,n.direction);var a=u.rayPlane(n,this._plane,v);if(o(a)||(i.negate(n.direction,n.direction),a=u.rayPlane(n,this._plane,v)),o(a)){var s=i.subtract(a,this._origin,a),l=i.dot(this._xAxis,s),c=i.dot(this._yAxis,s);return o(r)?(r.x=l,r.y=c,r):new t(l,c)}},m.prototype.projectPointsOntoPlane=function(e,t){o(t)||(t=[]);for(var i=0,r=e.length,n=0;n<r;n++){var a=this.projectPointOntoPlane(e[n],t[i]);o(a)&&(t[i]=a,i++)}return t.length=i,t},m.prototype.projectPointToNearestOnPlane=function(e,r){o(r)||(r=new t);var n=g;n.origin=e,i.clone(this._plane.normal,n.direction);var a=u.rayPlane(n,this._plane,v);o(a)||(i.negate(n.direction,n.direction),a=u.rayPlane(n,this._plane,v));var s=i.subtract(a,this._origin,a),l=i.dot(this._xAxis,s),c=i.dot(this._yAxis,s);return r.x=l,r.y=c,r},m.prototype.projectPointsToNearestOnPlane=function(e,t){o(t)||(t=[]);var i=e.length;t.length=i;for(var r=0;r<i;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var y=new i;return m.prototype.projectPointsOntoEllipsoid=function(e,t){var r=e.length;o(t)?t.length=r:t=new Array(r);for(var n=this._ellipsoid,a=this._origin,s=this._xAxis,l=this._yAxis,u=y,c=0;c<r;++c){var h=e[c];i.multiplyByScalar(s,h.x,u),o(t[c])||(t[c]=new i);var d=i.add(a,u,t[c]);i.multiplyByScalar(l,h.y,u),i.add(d,u,d),n.scaleToGeocentricSurface(d,d)}return t},m}),i("Core/OrientedBoundingBox",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Intersect","./Interval","./Math","./Matrix3","./Plane","./Rectangle"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m){"use strict";function f(e,t){this.center=i.clone(n(e,i.ZERO)),this.halfAxes=d.clone(n(t,d.ZERO))}function _(e,t,r,n,a,s,l,u){o(u)||(u=new f);var c=u.halfAxes;d.setColumn(c,0,e.xAxis,c),d.setColumn(c,1,e.yAxis,c),d.setColumn(c,2,e.zAxis,c);var h=T;h.x=(t+r)/2,h.y=(n+a)/2,h.z=(s+l)/2;var p=x;p.x=(r-t)/2,p.y=(a-n)/2,p.z=(l-s)/2;var m=u.center;return h=d.multiplyByVector(c,h,h),i.add(e.origin,h,m),d.multiplyByScale(c,p,c),u}var g=new i,v=new i,y=new i,C=new i,w=new i,S=new i,E=new d,b={unitary:new d,diagonal:new d};f.fromPoints=function(e,t){if(o(t)||(t=new f),!o(e)||0===e.length)return t.halfAxes=d.ZERO,t.center=i.ZERO,t;var r,n=e.length,a=i.clone(e[0],g);for(r=1;r<n;r++)i.add(a,e[r],a);var s=1/n;i.multiplyByScalar(a,s,a);var l,u=0,c=0,h=0,p=0,m=0,_=0;for(r=0;r<n;r++)l=i.subtract(e[r],a,v),u+=l.x*l.x,c+=l.x*l.y,h+=l.x*l.z,p+=l.y*l.y,m+=l.y*l.z,_+=l.z*l.z;u*=s,c*=s,h*=s,p*=s,m*=s,_*=s;var T=E;T[0]=u,T[1]=c,T[2]=h,T[3]=c,T[4]=p,T[5]=m,T[6]=h,T[7]=m,T[8]=_;var x=d.computeEigenDecomposition(T,b),A=d.clone(x.unitary,t.halfAxes),P=d.getColumn(A,0,C),D=d.getColumn(A,1,w),M=d.getColumn(A,2,S),I=-Number.MAX_VALUE,R=-Number.MAX_VALUE,O=-Number.MAX_VALUE,N=Number.MAX_VALUE,L=Number.MAX_VALUE,B=Number.MAX_VALUE;for(r=0;r<n;r++)l=e[r],I=Math.max(i.dot(P,l),I),R=Math.max(i.dot(D,l),R),O=Math.max(i.dot(M,l),O),N=Math.min(i.dot(P,l),N),L=Math.min(i.dot(D,l),L),B=Math.min(i.dot(M,l),B);P=i.multiplyByScalar(P,.5*(N+I),P),D=i.multiplyByScalar(D,.5*(L+R),D),M=i.multiplyByScalar(M,.5*(B+O),M);var F=i.add(P,D,t.center);F=i.add(F,M,F);var V=y;return V.x=I-N,V.y=R-L,V.z=O-B,i.multiplyByScalar(V,.5,V),d.multiplyByScale(t.halfAxes,V,t.halfAxes),t};var T=new i,x=new i,A=new r,P=new i,D=[new r,new r,new r,new r,new r,new r,new r,new r],M=[new i,new i,new i,new i,new i,new i,new i,new i],I=[new t,new t,new t,new t,new t,new t,new t,new t];f.fromRectangle=function(e,t,i,r,o){t=n(t,0),i=n(i,0),r=n(r,s.WGS84);var a=m.center(e,A),u=r.cartographicToCartesian(a,P),c=new l(u,r),h=c.plane,d=D[0],f=D[1],g=D[2],v=D[3],y=D[4],C=D[5],w=D[6],S=D[7],E=a.longitude,b=e.south<0&&e.north>0?0:a.latitude;w.latitude=C.latitude=y.latitude=e.south,S.latitude=v.latitude=b,d.latitude=f.latitude=g.latitude=e.north,w.longitude=S.longitude=d.longitude=e.west,C.longitude=f.longitude=E,y.longitude=v.longitude=g.longitude=e.east,g.height=f.height=d.height=S.height=w.height=C.height=y.height=v.height=i,r.cartographicArrayToCartesianArray(D,M),c.projectPointsToNearestOnPlane(M,I);var T=Math.min(I[6].x,I[7].x,I[0].x),x=Math.max(I[2].x,I[3].x,I[4].x),R=Math.min(I[4].y,I[5].y,I[6].y),O=Math.max(I[0].y,I[1].y,I[2].y);g.height=d.height=y.height=w.height=t,r.cartographicArrayToCartesianArray(D,M);var N=Math.min(p.getPointDistance(h,M[0]),p.getPointDistance(h,M[2]),p.getPointDistance(h,M[4]),p.getPointDistance(h,M[6])),L=i;return _(c,T,x,R,O,N,L,o)},f.clone=function(e,t){if(o(e))return o(t)?(i.clone(e.center,t.center),d.clone(e.halfAxes,t.halfAxes),t):new f(e.center,e.halfAxes)},f.intersectPlane=function(e,t){var r=e.center,n=t.normal,o=e.halfAxes,a=n.x,s=n.y,l=n.z,c=Math.abs(a*o[d.COLUMN0ROW0]+s*o[d.COLUMN0ROW1]+l*o[d.COLUMN0ROW2])+Math.abs(a*o[d.COLUMN1ROW0]+s*o[d.COLUMN1ROW1]+l*o[d.COLUMN1ROW2])+Math.abs(a*o[d.COLUMN2ROW0]+s*o[d.COLUMN2ROW1]+l*o[d.COLUMN2ROW2]),h=i.dot(n,r)+t.distance;return h<=-c?u.OUTSIDE:h>=c?u.INSIDE:u.INTERSECTING};var R=new i,O=new i,N=new i,L=new i;f.distanceSquaredTo=function(e,t){var r=i.subtract(t,e.center,T),n=e.halfAxes,o=d.getColumn(n,0,R),a=d.getColumn(n,1,O),s=d.getColumn(n,2,N),l=i.magnitude(o),u=i.magnitude(a),c=i.magnitude(s);i.normalize(o,o),i.normalize(a,a),i.normalize(s,s);var h=L;h.x=i.dot(r,o),h.y=i.dot(r,a),h.z=i.dot(r,s);var p,m=0;return h.x<-l?(p=h.x+l,m+=p*p):h.x>l&&(p=h.x-l,m+=p*p),h.y<-u?(p=h.y+u,m+=p*p):h.y>u&&(p=h.y-u,m+=p*p),h.z<-c?(p=h.z+c,m+=p*p):h.z>c&&(p=h.z-c,m+=p*p),m};var B=new i,F=new i;f.computePlaneDistances=function(e,t,r,n){o(n)||(n=new c);var a=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,l=e.center,u=e.halfAxes,h=d.getColumn(u,0,R),p=d.getColumn(u,1,O),m=d.getColumn(u,2,N),f=i.add(h,p,B);i.add(f,m,f),i.add(f,l,f);var _=i.subtract(f,t,F),g=i.dot(r,_);return a=Math.min(g,a),s=Math.max(g,s),i.add(l,h,f),i.add(f,p,f),i.subtract(f,m,f),i.subtract(f,t,_),g=i.dot(r,_),a=Math.min(g,a),s=Math.max(g,s),i.add(l,h,f),i.subtract(f,p,f),i.add(f,m,f),i.subtract(f,t,_),g=i.dot(r,_),a=Math.min(g,a),s=Math.max(g,s),i.add(l,h,f),i.subtract(f,p,f),i.subtract(f,m,f),i.subtract(f,t,_),g=i.dot(r,_),a=Math.min(g,a),s=Math.max(g,s),i.subtract(l,h,f),i.add(f,p,f),i.add(f,m,f),i.subtract(f,t,_),g=i.dot(r,_),a=Math.min(g,a),s=Math.max(g,s),i.subtract(l,h,f),i.add(f,p,f),i.subtract(f,m,f),i.subtract(f,t,_),g=i.dot(r,_),a=Math.min(g,a),s=Math.max(g,s),i.subtract(l,h,f),i.subtract(f,p,f),i.add(f,m,f),i.subtract(f,t,_),g=i.dot(r,_),a=Math.min(g,a),s=Math.max(g,s),i.subtract(l,h,f),i.subtract(f,p,f),i.subtract(f,m,f),i.subtract(f,t,_),g=i.dot(r,_),a=Math.min(g,a),s=Math.max(g,s),n.start=a,n.stop=s,n};var V=new e;return f.isOccluded=function(t,i){var r=e.fromOrientedBoundingBox(t,V);return!i.isBoundingSphereVisible(r)},f.prototype.intersectPlane=function(e){return f.intersectPlane(this,e)},f.prototype.distanceSquaredTo=function(e){return f.distanceSquaredTo(this,e)},f.prototype.computePlaneDistances=function(e,t,i){return f.computePlaneDistances(this,e,t,i)},f.prototype.isOccluded=function(e){return f.isOccluded(this,e)},f.equals=function(e,t){return e===t||o(e)&&o(t)&&i.equals(e.center,t.center)&&d.equals(e.halfAxes,t.halfAxes)},f.prototype.clone=function(e){return f.clone(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f}),i("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,i,r,n){"use strict";var o={};o.octEncodeInRange=function(e,t,i){if(i.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),i.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var r=i.x,o=i.y;i.x=(1-Math.abs(o))*n.signNotZero(r),i.y=(1-Math.abs(r))*n.signNotZero(o)}return i.x=n.toSNorm(i.x,t),i.y=n.toSNorm(i.y,t),i},o.octEncode=function(e,t){return o.octEncodeInRange(e,255,t)},o.octDecodeInRange=function(e,i,r,o){if(o.x=n.fromSNorm(e,r),o.y=n.fromSNorm(i,r),o.z=1-(Math.abs(o.x)+Math.abs(o.y)),o.z<0){var a=o.x;o.x=(1-Math.abs(o.y))*n.signNotZero(a),o.y=(1-Math.abs(a))*n.signNotZero(o.y)}return t.normalize(o,o)},o.octDecode=function(e,t,i){return o.octDecodeInRange(e,t,255,i)},o.octPackFloat=function(e){return 256*e.x+e.y};var a=new e;return o.octEncodeFloat=function(e){return o.octEncode(e,a),o.octPackFloat(a)},o.octDecodeFloat=function(e,t){var i=e/256,r=Math.floor(i),n=256*(i-r);return o.octDecode(r,n,t)},o.octPack=function(e,t,i,r){var n=o.octEncodeFloat(e),s=o.octEncodeFloat(t),l=o.octEncode(i,a);return r.x=65536*l.x+n,r.y=65536*l.y+s,r},o.octUnpack=function(e,t,i,r){var n=e.x/65536,a=Math.floor(n),s=65536*(n-a);n=e.y/65536;var l=Math.floor(n),u=65536*(n-l);o.octDecodeFloat(s,t),o.octDecodeFloat(u,i),o.octDecode(a,l,r)},o.compressTextureCoordinates=function(e){var t=4095*e.x|0,i=4095*e.y|0;return 4096*t+i},o.decompressTextureCoordinates=function(e,t){var i=e/4096,r=Math.floor(i);return t.x=r/4095,t.y=(e-4096*r)/4095,t},o}),i("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047};return e(t)}),i("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,i,r,n,o){"use strict";if(!r.supportsTypedArrays())return{};var a={BYTE:o.BYTE,UNSIGNED_BYTE:o.UNSIGNED_BYTE,SHORT:o.SHORT,UNSIGNED_SHORT:o.UNSIGNED_SHORT,INT:o.INT,UNSIGNED_INT:o.UNSIGNED_INT,FLOAT:o.FLOAT,DOUBLE:o.DOUBLE};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.INT:return Int32Array.BYTES_PER_ELEMENT;case a.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case a.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case a.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},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 Int32Array?a.INT:e instanceof Uint32Array?a.UNSIGNED_INT: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.INT||e===a.UNSIGNED_INT||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.INT:return new Int32Array(t);case a.UNSIGNED_INT:return new Uint32Array(t);case a.FLOAT:return new Float32Array(t);case a.DOUBLE:return new Float64Array(t)}},a.createArrayBufferView=function(t,i,r,n){switch(r=e(r,0),n=e(n,(i.byteLength-r)/a.getSizeInBytes(t)),t){case a.BYTE:return new Int8Array(i,r,n);case a.UNSIGNED_BYTE:return new Uint8Array(i,r,n);case a.SHORT:return new Int16Array(i,r,n);case a.UNSIGNED_SHORT:return new Uint16Array(i,r,n);case a.INT:return new Int32Array(i,r,n);case a.UNSIGNED_INT:return new Uint32Array(i,r,n);case a.FLOAT:return new Float32Array(i,r,n);case a.DOUBLE:return new Float64Array(i,r,n)}},a.fromName=function(e){switch(e){case"BYTE":return a.BYTE;case"UNSIGNED_BYTE":return a.UNSIGNED_BYTE;case"SHORT":return a.SHORT;case"UNSIGNED_SHORT":return a.UNSIGNED_SHORT;case"INT":return a.INT;case"UNSIGNED_INT":return a.UNSIGNED_INT;case"FLOAT":return a.FLOAT;case"DOUBLE":return a.DOUBLE}},n(a)}),i("Core/TerrainQuantization",["./freezeObject"],function(e){"use strict";var t={NONE:0,BITS12:1};return e(t)}),i("Core/TerrainEncoding",["./AttributeCompression","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./Math","./Matrix4","./TerrainQuantization"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(e,t,r,a,u,d){var _,g,v,y;if(o(e)&&o(t)&&o(r)&&o(a)){var C=e.minimum,w=e.maximum,S=i.subtract(w,C,h),E=r-t,b=Math.max(i.maximumComponent(S),E);_=b<f-1?l.BITS12:l.NONE,g=e.center,v=s.inverseTransformation(a,new s);var T=i.negate(C,c);s.multiply(s.fromTranslation(T,p),v,v);var x=c;x.x=1/S.x,x.y=1/S.y,x.z=1/S.z,s.multiply(s.fromScale(x,p),v,v),y=s.clone(a),s.setTranslation(y,i.ZERO,y),a=s.clone(a,new s);var A=s.fromTranslation(C,p),P=s.fromScale(S,m),D=s.multiply(A,P,p);s.multiply(a,D,a),s.multiply(y,D,y)}this.quantization=_,this.minimumHeight=t,this.maximumHeight=r,this.center=g,this.toScaledENU=v,this.fromScaledENU=a,this.matrix=y,this.hasVertexNormals=u,this.hasWebMercatorT=n(d,!1)}var c=new i,h=new i,d=new t,p=new s,m=new s,f=Math.pow(2,12);u.prototype.encode=function(r,n,o,u,h,p,m){var f=u.x,_=u.y;if(this.quantization===l.BITS12){o=s.multiplyByPoint(this.toScaledENU,o,c),o.x=a.clamp(o.x,0,1),o.y=a.clamp(o.y,0,1),o.z=a.clamp(o.z,0,1);var g=this.maximumHeight-this.minimumHeight,v=a.clamp((h-this.minimumHeight)/g,0,1);t.fromElements(o.x,o.y,d);var y=e.compressTextureCoordinates(d);t.fromElements(o.z,v,d);var C=e.compressTextureCoordinates(d);t.fromElements(f,_,d);var w=e.compressTextureCoordinates(d);if(r[n++]=y,r[n++]=C,r[n++]=w,this.hasWebMercatorT){t.fromElements(m,0,d);var S=e.compressTextureCoordinates(d);r[n++]=S}}else i.subtract(o,this.center,c),r[n++]=c.x,r[n++]=c.y,r[n++]=c.z,r[n++]=h,r[n++]=f,r[n++]=_,this.hasWebMercatorT&&(r[n++]=m);return this.hasVertexNormals&&(r[n++]=e.octPackFloat(p)),n},u.prototype.decodePosition=function(t,r,n){if(o(n)||(n=new i),r*=this.getStride(),this.quantization===l.BITS12){var a=e.decompressTextureCoordinates(t[r],d);n.x=a.x,n.y=a.y;var u=e.decompressTextureCoordinates(t[r+1],d);return n.z=u.x,s.multiplyByPoint(this.fromScaledENU,n,n)}return n.x=t[r],n.y=t[r+1],n.z=t[r+2],i.add(n,this.center,n)},u.prototype.decodeTextureCoordinates=function(i,r,n){return o(n)||(n=new t),r*=this.getStride(),this.quantization===l.BITS12?e.decompressTextureCoordinates(i[r+2],n):t.fromElements(i[r+4],i[r+5],n)},u.prototype.decodeHeight=function(t,i){if(i*=this.getStride(),this.quantization===l.BITS12){var r=e.decompressTextureCoordinates(t[i+1],d);return r.y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight}return t[i+3]},u.prototype.getOctEncodedNormal=function(e,i,r){var n=this.getStride();i=(i+1)*n-1;var o=e[i]/256,a=Math.floor(o),s=256*(o-a);return t.fromElements(a,s,r)},u.prototype.getStride=function(){var e;switch(this.quantization){case l.BITS12:e=3;break;default:e=6}return this.hasWebMercatorT&&++e,this.hasVertexNormals&&++e,e};var _={position3DAndHeight:0,textureCoordAndEncodedNormals:1},g={compressed0:0,compressed1:1};return u.prototype.getAttributes=function(e){var t,i=r.FLOAT,n=r.getSizeInBytes(i);if(this.quantization===l.NONE){var o=4,a=2;return this.hasWebMercatorT&&++a,this.hasVertexNormals&&++a,t=(o+a)*n,[{index:_.position3DAndHeight,vertexBuffer:e,componentDatatype:i,componentsPerAttribute:o,offsetInBytes:0,strideInBytes:t},{index:_.textureCoordAndEncodedNormals,vertexBuffer:e,componentDatatype:i,componentsPerAttribute:a,offsetInBytes:o*n,strideInBytes:t}]}var s=3,u=0;return(this.hasWebMercatorT||this.hasVertexNormals)&&++s,this.hasWebMercatorT&&this.hasVertexNormals?(++u,t=(s+u)*n,[{index:g.compressed0,vertexBuffer:e,componentDatatype:i,componentsPerAttribute:s,offsetInBytes:0,strideInBytes:t},{index:g.compressed1,vertexBuffer:e,componentDatatype:i,componentsPerAttribute:u,offsetInBytes:s*n,strideInBytes:t}]):[{index:g.compressed0,vertexBuffer:e,componentDatatype:i,componentsPerAttribute:s}]},u.prototype.getAttributeLocations=function(){return this.quantization===l.NONE?_:g},u.clone=function(e,t){return o(t)||(t=new u),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=i.clone(e.center),t.toScaledENU=s.clone(e.toScaledENU),t.fromScaledENU=s.clone(e.fromScaledENU),t.matrix=s.clone(e.matrix),t.hasVertexNormals=e.hasVertexNormals,t.hasWebMercatorT=e.hasWebMercatorT,t},u}),i("Core/WebMercatorProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){this._ellipsoid=i(e,a.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return n(l.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),l.mercatorAngleToGeodeticLatitude=function(e){return s.PI_OVER_TWO-2*Math.atan(Math.exp(-e))},l.geodeticLatitudeToMercatorAngle=function(e){e>l.MaximumLatitude?e=l.MaximumLatitude:e<-l.MaximumLatitude&&(e=-l.MaximumLatitude);var t=Math.sin(e);return.5*Math.log((1+t)/(1-t))},l.MaximumLatitude=l.mercatorAngleToGeodeticLatitude(Math.PI),l.prototype.project=function(t,i){var n=this._semimajorAxis,o=t.longitude*n,a=l.geodeticLatitudeToMercatorAngle(t.latitude)*n,s=t.height;return r(i)?(i.x=o,i.y=a,i.z=s,i):new e(o,a,s)},l.prototype.unproject=function(e,i){var n=this._oneOverSemimajorAxis,o=e.x*n,a=l.mercatorAngleToGeodeticLatitude(e.y*n),s=e.z;return r(i)?(i.longitude=o,i.latitude=a,i.height=s,i):new t(o,a,s)},l}),i("Core/HeightmapTessellator",["./AxisAlignedBoundingBox","./BoundingSphere","./Cartesian2","./Cartesian3","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidalOccluder","./freezeObject","./Math","./Matrix4","./OrientedBoundingBox","./Rectangle","./TerrainEncoding","./Transforms","./WebMercatorProjection"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_){"use strict";var g={};g.DEFAULT_STRUCTURE=u({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var v=new r,y=new h,C=new r,w=new r;return g.computeVertices=function(a){var u,S,E,b,T=Math.cos,x=Math.sin,A=Math.sqrt,P=Math.atan,D=Math.exp,M=c.PI_OVER_TWO,I=c.toRadians,R=a.heightmap,O=a.width,N=a.height,L=a.skirtHeight,B=n(a.isGeographic,!0),F=n(a.ellipsoid,s.WGS84),V=1/F.maximumRadius,k=a.nativeRectangle,z=a.rectangle;o(z)?(u=z.west,S=z.south,E=z.east,b=z.north):B?(u=I(k.west),S=I(k.south),E=I(k.east),b=I(k.north)):(u=k.west*V,S=M-2*P(D(-k.south*V)),E=k.east*V,b=M-2*P(D(-k.north*V)));var U=a.relativeToCenter,G=o(U);U=G?U:r.ZERO;var W,H,q=n(a.exaggeration,1),j=n(a.includeWebMercatorT,!1),Y=n(a.structure,g.DEFAULT_STRUCTURE),X=n(Y.heightScale,g.DEFAULT_STRUCTURE.heightScale),Z=n(Y.heightOffset,g.DEFAULT_STRUCTURE.heightOffset),K=n(Y.elementsPerHeight,g.DEFAULT_STRUCTURE.elementsPerHeight),Q=n(Y.stride,g.DEFAULT_STRUCTURE.stride),J=n(Y.elementMultiplier,g.DEFAULT_STRUCTURE.elementMultiplier),$=n(Y.isBigEndian,g.DEFAULT_STRUCTURE.isBigEndian),ee=p.computeWidth(k)/(O-1),te=p.computeHeight(k)/(N-1),ie=F.radiiSquared,re=ie.x,ne=ie.y,oe=ie.z,ae=65536,se=-65536,le=f.eastNorthUpToFixedFrame(U,F),ue=h.inverseTransformation(le,y);j&&(W=_.geodeticLatitudeToMercatorAngle(S),H=1/(_.geodeticLatitudeToMercatorAngle(b)-W));var ce=C;ce.x=Number.POSITIVE_INFINITY,ce.y=Number.POSITIVE_INFINITY,ce.z=Number.POSITIVE_INFINITY;var he=w;he.x=Number.NEGATIVE_INFINITY,he.y=Number.NEGATIVE_INFINITY,he.z=Number.NEGATIVE_INFINITY;var de=Number.POSITIVE_INFINITY,pe=O+(L>0?2:0),me=N+(L>0?2:0),fe=pe*me,_e=new Array(fe),ge=new Array(fe),ve=new Array(fe),ye=j?new Array(fe):[],Ce=0,we=N,Se=0,Ee=O;L>0&&(--Ce,++we,--Se,++Ee);for(var be=0,Te=Ce;Te<we;++Te){var xe=Te;xe<0&&(xe=0),xe>=N&&(xe=N-1);var Ae=k.north-te*xe;Ae=B?I(Ae):M-2*P(D(-Ae*V));var Pe=T(Ae),De=x(Ae),Me=oe*De,Ie=(Ae-S)/(b-S);Ie=c.clamp(Ie,0,1);var Re;j&&(Re=(_.geodeticLatitudeToMercatorAngle(Ae)-W)*H);for(var Oe=Se;Oe<Ee;++Oe){var Ne=Oe;Ne<0&&(Ne=0),Ne>=O&&(Ne=O-1);var Le=k.west+ee*Ne;B?Le=I(Le):Le*=V;var Be,Fe=xe*(O*Q)+Ne*Q;if(1===K)Be=R[Fe];else{Be=0;var Ve;if($)for(Ve=0;Ve<K;++Ve)Be=Be*J+R[Fe+Ve];else for(Ve=K-1;Ve>=0;--Ve)Be=Be*J+R[Fe+Ve]}Be=(Be*X+Z)*q,se=Math.max(se,Be),ae=Math.min(ae,Be),Oe===Ne&&Te===xe||(Be-=L);var ke=Pe*T(Le),ze=Pe*x(Le),Ue=re*ke,Ge=ne*ze,We=A(Ue*ke+Ge*ze+Me*De),He=1/We,qe=Ue*He,je=Ge*He,Ye=Me*He,Xe=new r;Xe.x=qe+ke*Be,Xe.y=je+ze*Be,Xe.z=Ye+De*Be,_e[be]=Xe,ge[be]=Be;var Ze=(Le-u)/(E-u);Ze=c.clamp(Ze,0,1),ve[be]=new i(Ze,Ie),j&&(ye[be]=Re),be++,h.multiplyByPoint(ue,Xe,v),r.minimumByComponent(v,ce,ce),r.maximumByComponent(v,he,he),de=Math.min(de,Be)}}var Ke,Qe=t.fromPoints(_e);o(z)&&z.width<c.PI_OVER_TWO+c.EPSILON5&&(Ke=d.fromRectangle(z,ae,se,F));var Je;if(G){var $e=new l(F);Je=$e.computeHorizonCullingPoint(U,_e)}for(var et=new e(ce,he,U),tt=new m(et,de,se,le,!1,j),it=new Float32Array(fe*tt.getStride()),rt=0,nt=0;nt<fe;++nt)rt=tt.encode(it,rt,_e[nt],ve[nt],ge[nt],void 0,ye[nt]);return{vertices:it,maximumHeight:se,minimumHeight:ae,encoding:tt,boundingSphere3D:Qe,orientedBoundingBox:Ke,occludeePointInScaledSpace:Je}},g}),i("Core/destroyObject",["./defaultValue","./DeveloperError"],function(e,t){"use strict";function i(){return!0}function r(t,r){function n(){}r=e(r,"This object was destroyed, i.e., destroy() was called.");for(var o in t)"function"==typeof t[o]&&(t[o]=n);t.isDestroyed=i}return r}),i("Core/isCrossOriginUrl",["./defined"],function(e){"use strict";function t(t){e(i)||(i=document.createElement("a")),i.href=window.location.href;var r=i.host,n=i.protocol;return i.href=t,i.href=i.href,n!==i.protocol||r!==i.host}var i;return t}),i("Core/TaskProcessor",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./destroyObject","./DeveloperError","./getAbsoluteUri","./isCrossOriginUrl","./RuntimeError","require"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(){if(!r(f._canTransferArrayBuffer)){var t=new Worker(d("Workers/transferTypedArrayTest.js"));t.postMessage=i(t.webkitPostMessage,t.postMessage);var n=99,o=new Int8Array([n]);try{t.postMessage({array:o},[o.buffer])}catch(e){return f._canTransferArrayBuffer=!1,f._canTransferArrayBuffer}var a=e.defer();t.onmessage=function(e){var i=e.data.array,o=r(i)&&i[0]===n;a.resolve(o),t.terminate(),f._canTransferArrayBuffer=o},f._canTransferArrayBuffer=a.promise}return f._canTransferArrayBuffer}function h(e,t){--e._activeTasks;var i=t.id;if(r(i)){var n=e._deferreds,a=n[i];if(r(t.error)){var s=t.error;"RuntimeError"===s.name?(s=new l(t.error.message),s.stack=t.error.stack):"DeveloperError"===s.name&&(s=new o(t.error.message),s.stack=t.error.stack),a.reject(s)}else a.resolve(t.result);delete n[i]}}function d(e){var i=t(e);if(s(i)){var r,n='importScripts("'+i+'");';try{r=new Blob([n],{type:"application/javascript"})}catch(e){var o=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,a=new o;a.append(n),r=a.getBlob("application/javascript")}var l=window.URL||window.webkitURL;i=l.createObjectURL(r)}return i}function p(){return r(_)||(_=d("Workers/cesiumWorkerBootstrapper.js")),_}function m(e){var n=new Worker(p());n.postMessage=i(n.webkitPostMessage,n.postMessage);var o={loaderConfig:{},workerModule:f._workerModulePrefix+e._workerName};return r(f._loaderConfig)?o.loaderConfig=f._loaderConfig:r(u.toUrl)?o.loaderConfig.baseUrl=a("..",t("Workers/cesiumWorkerBootstrapper.js")):o.loaderConfig.paths={Workers:t("Workers")},n.postMessage(o),n.onmessage=function(t){h(e,t.data)},n}function f(e,t){this._workerName=e,this._maximumActiveTasks=i(t,5),this._activeTasks=0,this._deferreds={},this._nextID=0}var _,g=[];return f.prototype.scheduleTask=function(t,i){if(r(this._worker)||(this._worker=m(this)),!(this._activeTasks>=this._maximumActiveTasks)){++this._activeTasks;var n=this;return e(c(),function(o){r(i)?o||(i.length=0):i=g;var a=n._nextID++,s=e.defer();return n._deferreds[a]=s,n._worker.postMessage({id:a,parameters:t,canTransferArrayBuffer:o},i),s.promise})}},f.prototype.isDestroyed=function(){return!1},f.prototype.destroy=function(){return r(this._worker)&&this._worker.terminate(),n(this)},f._defaultWorkerModulePrefix="Workers/",f._workerModulePrefix=f._defaultWorkerModulePrefix,f._loaderConfig=void 0,f._canTransferArrayBuffer=void 0,f}),i("Core/TerrainMesh",["./defaultValue"],function(e){"use strict";function t(t,i,r,n,o,a,s,l,u,c,h){this.center=t,this.vertices=i,this.stride=e(l,6),this.indices=r,this.minimumHeight=n,this.maximumHeight=o,this.boundingSphere3D=a,this.occludeePointInScaledSpace=s,this.orientedBoundingBox=u,this.encoding=c,this.exaggeration=h}return t}),i("Core/TerrainProvider",["./defined","./defineProperties","./DeveloperError","./Math"],function(e,t,i,r){"use strict";function n(){i.throwInstantiationError()}t(n.prototype,{errorEvent:{get:i.throwInstantiationError},credit:{get:i.throwInstantiationError},tilingScheme:{get:i.throwInstantiationError},ready:{get:i.throwInstantiationError},readyPromise:{get:i.throwInstantiationError},hasWaterMask:{get:i.throwInstantiationError},hasVertexNormals:{get:i.throwInstantiationError},availability:{get:i.throwInstantiationError}});var o=[];return n.getRegularGridIndices=function(t,i){var r=o[t];e(r)||(o[t]=r=[]);var n=r[i];if(!e(n)){n=r[i]=new Uint16Array((t-1)*(i-1)*6);for(var a=0,s=0,l=0;l<i-1;++l){for(var u=0;u<t-1;++u){var c=a,h=c+t,d=h+1,p=c+1;n[s++]=c,n[s++]=h,n[s++]=p,n[s++]=p,n[s++]=h,n[s++]=d,++a}++a}}return n},n.heightmapTerrainQuality=.25,n.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,i){return 2*e.maximumRadius*Math.PI*n.heightmapTerrainQuality/(t*i)},n.prototype.requestTileGeometry=i.throwInstantiationError,n.prototype.getLevelMaximumGeometricError=i.throwInstantiationError,n.prototype.getTileDataAvailable=i.throwInstantiationError,n}),i("Core/HeightmapTerrainData",["../ThirdParty/when","./defaultValue","./defined","./defineProperties","./DeveloperError","./GeographicTilingScheme","./HeightmapTessellator","./Math","./Rectangle","./TaskProcessor","./TerrainEncoding","./TerrainMesh","./TerrainProvider"],function(e,t,i,r,n,o,a,s,l,u,c,h,d){"use strict";function p(e){this._buffer=e.buffer,this._width=e.width,this._height=e.height,this._childTileMask=t(e.childTileMask,15);var r=a.DEFAULT_STRUCTURE,n=e.structure;i(n)?n!==r&&(n.heightScale=t(n.heightScale,r.heightScale),n.heightOffset=t(n.heightOffset,r.heightOffset),n.elementsPerHeight=t(n.elementsPerHeight,r.elementsPerHeight),n.stride=t(n.stride,r.stride),n.elementMultiplier=t(n.elementMultiplier,r.elementMultiplier),n.isBigEndian=t(n.isBigEndian,r.isBigEndian)):n=r,this._structure=n,this._createdByUpsampling=t(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._skirtHeight=void 0,this._bufferType=this._buffer.constructor,this._mesh=void 0}function m(e,t,i,r,n,o,a,s,l,u){var c=(l-o.west)*(a-1)/(o.east-o.west),h=(u-o.south)*(s-1)/(o.north-o.south),d=0|c,p=d+1;p>=a&&(p=a-1,d=a-2);var m=0|h,f=m+1;f>=s&&(f=s-1,m=s-2);var v=c-d,y=h-m;m=s-1-m,f=s-1-f;var C=g(e,t,i,r,n,m*a+d),w=g(e,t,i,r,n,m*a+p),S=g(e,t,i,r,n,f*a+d),E=g(e,t,i,r,n,f*a+p);return _(v,y,C,w,S,E)}function f(e,t,i,r,n,o,a,s,l,u,c){var h=(l-o.west)*(a-1)/(o.east-o.west),d=(u-o.south)*(s-1)/(o.north-o.south);n>0&&(h+=1,d+=1,a+=2,s+=2);var p=n>0?a-1:a,m=0|h,f=m+1;f>=p&&(f=a-1,m=a-2);var g=n>0?s-1:s,v=0|d,y=v+1;y>=g&&(y=s-1,v=s-2);var C=h-m,w=d-v;v=s-1-v,y=s-1-y;var S=(t.decodeHeight(e,v*a+m)/c-i)/r,E=(t.decodeHeight(e,v*a+f)/c-i)/r,b=(t.decodeHeight(e,y*a+m)/c-i)/r,T=(t.decodeHeight(e,y*a+f)/c-i)/r;return _(C,w,S,E,b,T)}function _(e,t,i,r,n,o){return t<e?i+e*(r-i)+t*(o-r):i+e*(o-n)+t*(n-i)}function g(e,t,i,r,n,o){o*=r;var a,s=0;if(n)for(a=0;a<t;++a)s=s*i+e[o+a];else for(a=t-1;a>=0;--a)s=s*i+e[o+a];return s}function v(e,t,i,r,n,o,a,s){a*=n;var l;if(o)for(l=0;l<t-1;++l)e[a+l]=s/r|0,s-=e[a+l]*r,r/=i;else for(l=t-1;l>0;--l)e[a+l]=s/r|0,s-=e[a+l]*r,r/=i;e[a+l]=s}r(p.prototype,{waterMask:{get:function(){return this._waterMask}}});var y=new u("createVerticesFromHeightmap");return p.prototype.createMesh=function(r,n,a,s,u){var p=r.ellipsoid,m=r.tileXYToNativeRectangle(n,a,s),f=r.tileXYToRectangle(n,a,s);u=t(u,1);var _=p.cartographicToCartesian(l.center(f)),g=this._structure,v=d.getEstimatedLevelZeroGeometricErrorForAHeightmap(p,this._width,r.getNumberOfXTilesAtLevel(0)),C=v/(1<<s);this._skirtHeight=Math.min(4*C,1e3);var w=y.scheduleTask({heightmap:this._buffer,structure:g,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:m,rectangle:f,relativeToCenter:_,ellipsoid:p,skirtHeight:this._skirtHeight,isGeographic:r instanceof o,exaggeration:u});if(i(w)){var S=this;return e(w,function(e){return S._mesh=new h(_,new Float32Array(e.vertices),d.getRegularGridIndices(e.gridWidth,e.gridHeight),e.minimumHeight,e.maximumHeight,e.boundingSphere3D,e.occludeePointInScaledSpace,e.numberOfAttributes,e.orientedBoundingBox,c.clone(e.encoding),u),S._buffer=void 0,S._mesh})}},p.prototype.interpolateHeight=function(e,t,r){var n,o=this._width,a=this._height,s=this._structure,l=s.stride,u=s.elementsPerHeight,c=s.elementMultiplier,h=s.isBigEndian,d=s.heightOffset,p=s.heightScale;if(i(this._mesh)){var _=this._mesh.vertices,g=this._mesh.encoding,v=this._skirtHeight,y=this._mesh.exaggeration;n=f(_,g,d,p,v,e,o,a,t,r,y)}else n=m(this._buffer,u,c,l,h,e,o,a,t,r),n=n*p+d;return n},p.prototype.upsample=function(e,t,r,n,o,a,l){var u=this._width,c=this._height,h=this._structure,d=this._skirtHeight,m=h.stride,_=new this._bufferType(u*c*m),g=this._mesh;if(i(g)){for(var y=g.vertices,C=g.encoding,w=e.tileXYToRectangle(t,r,n),S=e.tileXYToRectangle(o,a,l),E=h.heightOffset,b=h.heightScale,T=g.exaggeration,x=h.elementsPerHeight,A=h.elementMultiplier,P=h.isBigEndian,D=Math.pow(A,x-1),M=0;M<c;++M)for(var I=s.lerp(S.north,S.south,M/(c-1)),R=0;R<u;++R){var O=s.lerp(S.west,S.east,R/(u-1)),N=f(y,C,E,b,d,w,u,c,O,I,T);N=N<h.lowestEncodedHeight?h.lowestEncodedHeight:N,N=N>h.highestEncodedHeight?h.highestEncodedHeight:N,v(_,x,A,D,m,P,M*u+R,N)}return new p({buffer:_,width:u,height:c,childTileMask:0,structure:this._structure,createdByUpsampling:!0})}},p.prototype.isChildAvailable=function(e,t,i,r){var n=2;return i!==2*e&&++n,r!==2*t&&(n-=2),0!==(this._childTileMask&1<<n)},p.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling},p}),i("Core/loadImage",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./isCrossOriginUrl","./TrustedServers"],function(e,t,i,r,n,o){"use strict";function a(i,r){return r=t(r,!0),e(i,function(t){var i;i=!(s.test(t)||!r)&&n(t);var o=e.defer();return a.createImage(t,i,o),o.promise})}var s=/^data:/;return a.createImage=function(e,t,i){var r=new Image;r.onload=function(){i.resolve(r)},r.onerror=function(e){i.reject(e)},t&&(o.contains(e)?r.crossOrigin="use-credentials":r.crossOrigin=""),r.src=e},a.defaultCreateImage=a.createImage,a}),i("Core/throttleRequestByServer",["../ThirdParty/Uri","../ThirdParty/when","./defaultValue"],function(e,t,i){"use strict";function r(t){var i=new e(t).resolve(a);i.normalize();var r=i.authority;return/:/.test(r)||(r=r+":"+("https"===i.scheme?"443":"80")),r}function n(e,a){var s=r(e),l=i(o[s],0);if(!(l>=n.maximumRequestsPerServer))return o[s]=l+1,t(a(e),function(e){return o[s]--,e}).otherwise(function(e){return o[s]--,t.reject(e)})}var o={},a="undefined"!=typeof document?new e(document.location.href):new e;return n.maximumRequestsPerServer=6,n}),i("Core/ArcGisImageServerTerrainProvider",["../ThirdParty/when","./Credit","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Event","./GeographicTilingScheme","./getImagePixels","./HeightmapTerrainData","./loadImage","./Math","./TerrainProvider","./throttleRequestByServer"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m){"use strict";function f(n){this._url=n.url,this._token=n.token,this._tilingScheme=n.tilingScheme,r(this._tilingScheme)||(this._tilingScheme=new l({ellipsoid:i(n.ellipsoid,a.WGS84)})),this._heightmapWidth=65,this._levelZeroMaximumGeometricError=p.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,this._heightmapWidth,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._proxy=n.proxy,this._terrainDataStructure={heightScale:.001,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0,lowestEncodedHeight:0,highestEncodedHeight:16777215},this._errorEvent=new s;var o=n.credit;"string"==typeof o&&(o=new t(o)),this._credit=o,this._readyPromise=e.resolve(!0)}return n(f.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return!0}},readyPromise:{get:function(){return this._readyPromise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}}}),f.prototype.requestTileGeometry=function(t,i,n){var o=this._tilingScheme.tileXYToRectangle(t,i,n),a=(o.east-o.west)/(this._heightmapWidth-1),s=(o.north-o.south)/(this._heightmapWidth-1);o.west-=.5*a,o.east+=.5*a,o.south-=.5*s,o.north+=.5*s;var l=d.toDegrees(o.west)+"%2C"+d.toDegrees(o.south)+"%2C"+d.toDegrees(o.east)+"%2C"+d.toDegrees(o.north),p=this._url+"/exportImage?interpolation=RSP_BilinearInterpolation&format=tiff&f=image&size="+this._heightmapWidth+"%2C"+this._heightmapWidth+"&bboxSR=4326&imageSR=4326&bbox="+l;this._token&&(p+="&token="+this._token);var f=this._proxy;r(f)&&(p=f.getURL(p));var _=m(p,h);if(r(_)){var g=this;return e(_,function(e){return new c({buffer:u(e),width:g._heightmapWidth,height:g._heightmapWidth,childTileMask:15,structure:g._terrainDataStructure})})}},f.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)},f.prototype.getTileDataAvailable=function(e,t,i){},f}),i("Core/arrayRemoveDuplicates",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,i,r){"use strict";function n(i,r,n){if(t(i)){n=e(n,!1);var a=i.length;if(a<2)return i;var s,l,u;for(s=1;s<a&&(l=i[s-1],u=i[s],!r(l,u,o));++s);if(s===a)return n&&r(i[0],i[i.length-1],o)?i.slice(1):i;for(var c=i.slice(0,s);s<a;++s)u=i[s],r(l,u,o)||(c.push(u),l=u);return n&&c.length>1&&r(c[0],c[c.length-1],o)&&c.shift(),c}}var o=r.EPSILON10;return n}),i("Core/AssociativeArray",["./defined","./defineProperties","./DeveloperError"],function(e,t,i){"use strict";function r(){this._array=[],this._hash={}}return t(r.prototype,{length:{get:function(){return this._array.length}},values:{get:function(){return this._array}}}),r.prototype.contains=function(t){return e(this._hash[t])},r.prototype.set=function(e,t){var i=this._hash[e];t!==i&&(this.remove(e),this._hash[e]=t,this._array.push(t))},r.prototype.get=function(e){return this._hash[e]},r.prototype.remove=function(t){var i=this._hash[t],r=e(i);if(r){var n=this._array;n.splice(n.indexOf(i),1),delete this._hash[t]}return r},r.prototype.removeAll=function(){var e=this._array;e.length>0&&(this._hash={},e.length=0)},r}),i("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./defined","./DeveloperError"],function(e,t,i,r){"use strict";function n(r,n,l,u,c){i(c)||(c=new t);var h,d,p,m,f,_,g,v;i(n.z)?(h=t.subtract(l,n,o),d=t.subtract(u,n,a),p=t.subtract(r,n,s),m=t.dot(h,h),f=t.dot(h,d),_=t.dot(h,p),g=t.dot(d,d),v=t.dot(d,p)):(h=e.subtract(l,n,o),d=e.subtract(u,n,a),p=e.subtract(r,n,s),m=e.dot(h,h),f=e.dot(h,d),_=e.dot(h,p),g=e.dot(d,d),v=e.dot(d,p));var y=1/(m*g-f*f);return c.y=(g*_-f*v)*y,c.z=(m*v-f*_)*y,c.x=1-c.y-c.z,c}var o=new t,a=new t,s=new t;return n}),i("Core/BingMapsApi",["./Credit","./defined"],function(e,t){"use strict";var i={};i.defaultKey=void 0;var r,n=!1,o="This application is using Cesium's default Bing Maps key. Please create a new key for the application as soon as possible and prior to deployment by visiting https://www.bingmapsportal.com/, and provide your key to Cesium by setting the Cesium.BingMapsApi.defaultKey property before constructing the CesiumWidget or any other object that uses the Bing Maps API.";return i.getKey=function(e){return t(e)?e:t(i.defaultKey)?i.defaultKey:(n||(console.log(o),n=!0),"AudaMP3YocqmIOQrFAValZ9d_tFqS4JWwiSEnvt2jwP5lizGzV_mJxLaKaI0fWRT")},i.getErrorCredit=function(n){if(!t(n)&&!t(i.defaultKey))return t(r)||(r=new e(o)),r},i}),i("Core/combine",["./defaultValue","./defined"],function(e,t){"use strict";function i(r,n,o){o=e(o,!1);var a,s,l,u={},c=t(r),h=t(n);if(c)for(a in r)r.hasOwnProperty(a)&&(s=r[a],h&&o&&"object"==typeof s&&n.hasOwnProperty(a)?(l=n[a],"object"==typeof l?u[a]=i(s,l,o):u[a]=s):u[a]=s);if(h)for(a in n)n.hasOwnProperty(a)&&!u.hasOwnProperty(a)&&(l=n[a],u[a]=l);return u}return i}),i("Core/isArray",["./defined"],function(e){"use strict";var t=Array.isArray;return e(t)||(t=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),t}),i("Core/objectToQuery",["./defined","./DeveloperError","./isArray"],function(e,t,i){"use strict";function r(e){var t="";for(var r in e)if(e.hasOwnProperty(r)){var n=e[r],o=encodeURIComponent(r)+"=";if(i(n))for(var a=0,s=n.length;a<s;++a)t+=o+encodeURIComponent(n[a])+"&";else t+=o+encodeURIComponent(n)+"&"}return t=t.slice(0,-1)}return r}),i("Core/queryToObject",["./defined","./DeveloperError","./isArray"],function(e,t,i){"use strict";function r(t){var r={};if(""===t)return r;for(var n=t.replace(/\+/g,"%20").split("&"),o=0,a=n.length;o<a;++o){var s=n[o].split("="),l=decodeURIComponent(s[0]),u=s[1];u=e(u)?decodeURIComponent(u):"";var c=r[l];"string"==typeof c?r[l]=[c,u]:i(c)?c.push(u):r[l]=u}return r}return r}),i("Core/loadJsonp",["../ThirdParty/Uri","../ThirdParty/when","./combine","./defaultValue","./defined","./DeveloperError","./objectToQuery","./queryToObject"],function(e,t,i,r,n,o,a,s){"use strict";function l(o,u){u=r(u,r.EMPTY_OBJECT);var c;do c="loadJsonp"+Math.random().toString().substring(2,8);while(n(window[c]));var h=t.defer();window[c]=function(e){h.resolve(e);try{delete window[c]}catch(e){window[c]=void 0}};var d=new e(o),p=s(r(d.query,""));n(u.parameters)&&(p=i(u.parameters,p));var m=r(u.callbackParameterName,"callback");p[m]=c,d.query=a(p),o=d.toString();var f=u.proxy;return n(f)&&(o=f.getURL(o)),l.loadAndExecuteScript(o,c,h),h.promise}return l.loadAndExecuteScript=function(e,t,i){var r=document.createElement("script");r.async=!0,r.src=e;var n=document.getElementsByTagName("head")[0];r.onload=function(){r.onload=void 0,n.removeChild(r)},r.onerror=function(e){i.reject(e)},n.appendChild(r)},l.defaultLoadAndExecuteScript=l.loadAndExecuteScript,l}),i("Core/BingMapsGeocoderService",["./BingMapsApi","./defaultValue","./defined","./defineProperties","./DeveloperError","./loadJsonp","./Rectangle"],function(e,t,i,r,n,o,a){"use strict";function s(i){i=t(i,t.EMPTY_OBJECT),this._url="https://dev.virtualearth.net/REST/v1/Locations",this._key=e.getKey(i.key)}var l="https://dev.virtualearth.net/REST/v1/Locations";return r(s.prototype,{url:{get:function(){return this._url}},key:{get:function(){return this._key}}}),s.prototype.geocode=function(e){var t=this.key,i=o(l,{parameters:{query:e,key:t},callbackParameterName:"jsonp"});return i.then(function(e){if(0===e.resourceSets.length)return[];var t=e.resourceSets[0].resources;return t.map(function(e){var t=e.bbox,i=t[0],r=t[1],n=t[2],o=t[3];return{displayName:e.name,destination:a.fromDegrees(r,i,o,n)}})})},s}),i("Core/BoundingRectangle",["./Cartesian2","./Cartographic","./Check","./defaultValue","./defined","./GeographicProjection","./Intersect","./Rectangle"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,t,i,n){this.x=r(e,0),this.y=r(t,0),this.width=r(i,0),this.height=r(n,0)}l.packedLength=4,l.pack=function(e,t,i){return i=r(i,0),t[i++]=e.x,t[i++]=e.y,t[i++]=e.width,t[i]=e.height,t},l.unpack=function(e,t,i){return t=r(t,0),n(i)||(i=new l),i.x=e[t++],i.y=e[t++],i.width=e[t++],i.height=e[t],i},l.fromPoints=function(e,t){if(n(t)||(t=new l),!n(e)||0===e.length)return t.x=0,t.y=0,t.width=0,t.height=0,t;for(var i=e.length,r=e[0].x,o=e[0].y,a=e[0].x,s=e[0].y,u=1;u<i;u++){var c=e[u],h=c.x,d=c.y;r=Math.min(h,r),a=Math.max(h,a),o=Math.min(d,o),s=Math.max(d,s)}return t.x=r,t.y=o,t.width=a-r,t.height=s-o,t};var u=new o,c=new t,h=new t;return l.fromRectangle=function(t,i,o){if(n(o)||(o=new l),!n(t))return o.x=0,o.y=0,o.width=0,o.height=0,o;i=r(i,u);var a=i.project(s.southwest(t,c)),d=i.project(s.northeast(t,h));return e.subtract(d,a,d),o.x=a.x,o.y=a.y,o.width=d.x,o.height=d.y,o},l.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t):new l(e.x,e.y,e.width,e.height)},l.union=function(e,t,i){n(i)||(i=new l);var r=Math.min(e.x,t.x),o=Math.min(e.y,t.y),a=Math.max(e.x+e.width,t.x+t.width),s=Math.max(e.y+e.height,t.y+t.height);return i.x=r,i.y=o,i.width=a-r,i.height=s-o,i},l.expand=function(e,t,i){i=l.clone(e,i);var r=t.x-i.x,n=t.y-i.y;return r>i.width?i.width=r:r<0&&(i.width-=r,i.x=t.x),n>i.height?i.height=n:n<0&&(i.height-=n,i.y=t.y),i},l.intersect=function(e,t){var i=e.x,r=e.y,n=t.x,o=t.y;return i>n+t.width||i+e.width<n||r+e.height<o||r>o+t.height?a.OUTSIDE:a.INTERSECTING},l.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height},l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.intersect=function(e){return l.intersect(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l}),i("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),i("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var i={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===i.POINTS||e===i.LINES||e===i.LINE_LOOP||e===i.LINE_STRIP||e===i.TRIANGLES||e===i.TRIANGLE_STRIP||e===i.TRIANGLE_FAN}};return e(i)}),i("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,i,r,n){"use strict";function o(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,n.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return o.computeNumberOfVertices=function(e){var i=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var n=e.attributes[r],o=n.values.length/n.componentsPerAttribute;i=o}return i},o}),i("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(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 r; +}),i("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),i("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,i,r){"use strict";function n(t){t=e(t,e.EMPTY_OBJECT),this.position=e(t.position,!1),this.normal=e(t.normal,!1),this.st=e(t.st,!1),this.bitangent=e(t.bitangent,!1),this.tangent=e(t.tangent,!1),this.color=e(t.color,!1)}return n.POSITION_ONLY=r(new n({position:!0})),n.POSITION_AND_NORMAL=r(new n({position:!0,normal:!0})),n.POSITION_NORMAL_AND_ST=r(new n({position:!0,normal:!0,st:!0})),n.POSITION_AND_ST=r(new n({position:!0,st:!0})),n.POSITION_AND_COLOR=r(new n({position:!0,color:!0})),n.ALL=r(new n({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0})),n.DEFAULT=n.POSITION_NORMAL_AND_ST,n.packedLength=6,n.pack=function(t,i,r){return r=e(r,0),i[r++]=t.position?1:0,i[r++]=t.normal?1:0,i[r++]=t.st?1:0,i[r++]=t.tangent?1:0,i[r++]=t.bitangent?1:0,i[r++]=t.color?1:0,i},n.unpack=function(i,r,o){return r=e(r,0),t(o)||(o=new n),o.position=1===i[r++],o.normal=1===i[r++],o.st=1===i[r++],o.tangent=1===i[r++],o.bitangent=1===i[r++],o.color=1===i[r++],o},n.clone=function(e,i){if(t(e))return t(i)||(i=new n),i.position=e.position,i.normal=e.normal,i.st=e.st,i.tangent=e.tangent,i.bitangent=e.bitangent,i.color=e.color,i},n}),i("Core/BoxGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./PrimitiveType","./VertexFormat"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(e){e=r(e,r.EMPTY_OBJECT);var i=e.minimum,n=e.maximum,o=r(e.vertexFormat,c.DEFAULT);this._minimum=t.clone(i),this._maximum=t.clone(n),this._vertexFormat=o,this._workerName="createBoxGeometry"}var d=new t;h.fromDimensions=function(e){e=r(e,r.EMPTY_OBJECT);var i=e.dimensions,n=t.multiplyByScalar(i,.5,new t);return new h({minimum:t.negate(n,new t),maximum:n,vertexFormat:e.vertexFormat})},h.fromAxisAlignedBoundingBox=function(e){return new h({minimum:e.minimum,maximum:e.maximum})},h.packedLength=2*t.packedLength+c.packedLength,h.pack=function(e,i,n){return n=r(n,0),t.pack(e._minimum,i,n),t.pack(e._maximum,i,n+t.packedLength),c.pack(e._vertexFormat,i,n+2*t.packedLength),i};var p=new t,m=new t,f=new c,_={minimum:p,maximum:m,vertexFormat:f};return h.unpack=function(e,i,o){i=r(i,0);var a=t.unpack(e,i,p),s=t.unpack(e,i+t.packedLength,m),l=c.unpack(e,i+2*t.packedLength,f);return n(o)?(o._minimum=t.clone(a,o._minimum),o._maximum=t.clone(s,o._maximum),o._vertexFormat=c.clone(l,o._vertexFormat),o):new h(_)},h.createGeometry=function(r){var n=r._minimum,o=r._maximum,c=r._vertexFormat;if(!t.equals(n,o)){var h,p,m=new l;if(c.position&&(c.st||c.normal||c.tangent||c.bitangent)){if(c.position&&(p=new Float64Array(72),p[0]=n.x,p[1]=n.y,p[2]=o.z,p[3]=o.x,p[4]=n.y,p[5]=o.z,p[6]=o.x,p[7]=o.y,p[8]=o.z,p[9]=n.x,p[10]=o.y,p[11]=o.z,p[12]=n.x,p[13]=n.y,p[14]=n.z,p[15]=o.x,p[16]=n.y,p[17]=n.z,p[18]=o.x,p[19]=o.y,p[20]=n.z,p[21]=n.x,p[22]=o.y,p[23]=n.z,p[24]=o.x,p[25]=n.y,p[26]=n.z,p[27]=o.x,p[28]=o.y,p[29]=n.z,p[30]=o.x,p[31]=o.y,p[32]=o.z,p[33]=o.x,p[34]=n.y,p[35]=o.z,p[36]=n.x,p[37]=n.y,p[38]=n.z,p[39]=n.x,p[40]=o.y,p[41]=n.z,p[42]=n.x,p[43]=o.y,p[44]=o.z,p[45]=n.x,p[46]=n.y,p[47]=o.z,p[48]=n.x,p[49]=o.y,p[50]=n.z,p[51]=o.x,p[52]=o.y,p[53]=n.z,p[54]=o.x,p[55]=o.y,p[56]=o.z,p[57]=n.x,p[58]=o.y,p[59]=o.z,p[60]=n.x,p[61]=n.y,p[62]=n.z,p[63]=o.x,p[64]=n.y,p[65]=n.z,p[66]=o.x,p[67]=n.y,p[68]=o.z,p[69]=n.x,p[70]=n.y,p[71]=o.z,m.position=new s({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:p})),c.normal){var f=new Float32Array(72);f[0]=0,f[1]=0,f[2]=1,f[3]=0,f[4]=0,f[5]=1,f[6]=0,f[7]=0,f[8]=1,f[9]=0,f[10]=0,f[11]=1,f[12]=0,f[13]=0,f[14]=-1,f[15]=0,f[16]=0,f[17]=-1,f[18]=0,f[19]=0,f[20]=-1,f[21]=0,f[22]=0,f[23]=-1,f[24]=1,f[25]=0,f[26]=0,f[27]=1,f[28]=0,f[29]=0,f[30]=1,f[31]=0,f[32]=0,f[33]=1,f[34]=0,f[35]=0,f[36]=-1,f[37]=0,f[38]=0,f[39]=-1,f[40]=0,f[41]=0,f[42]=-1,f[43]=0,f[44]=0,f[45]=-1,f[46]=0,f[47]=0,f[48]=0,f[49]=1,f[50]=0,f[51]=0,f[52]=1,f[53]=0,f[54]=0,f[55]=1,f[56]=0,f[57]=0,f[58]=1,f[59]=0,f[60]=0,f[61]=-1,f[62]=0,f[63]=0,f[64]=-1,f[65]=0,f[66]=0,f[67]=-1,f[68]=0,f[69]=0,f[70]=-1,f[71]=0,m.normal=new s({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:f})}if(c.st){var _=new Float32Array(48);_[0]=0,_[1]=0,_[2]=1,_[3]=0,_[4]=1,_[5]=1,_[6]=0,_[7]=1,_[8]=1,_[9]=0,_[10]=0,_[11]=0,_[12]=0,_[13]=1,_[14]=1,_[15]=1,_[16]=0,_[17]=0,_[18]=1,_[19]=0,_[20]=1,_[21]=1,_[22]=0,_[23]=1,_[24]=1,_[25]=0,_[26]=0,_[27]=0,_[28]=0,_[29]=1,_[30]=1,_[31]=1,_[32]=1,_[33]=0,_[34]=0,_[35]=0,_[36]=0,_[37]=1,_[38]=1,_[39]=1,_[40]=0,_[41]=0,_[42]=1,_[43]=0,_[44]=1,_[45]=1,_[46]=0,_[47]=1,m.st=new s({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:_})}if(c.tangent){var g=new Float32Array(72);g[0]=1,g[1]=0,g[2]=0,g[3]=1,g[4]=0,g[5]=0,g[6]=1,g[7]=0,g[8]=0,g[9]=1,g[10]=0,g[11]=0,g[12]=-1,g[13]=0,g[14]=0,g[15]=-1,g[16]=0,g[17]=0,g[18]=-1,g[19]=0,g[20]=0,g[21]=-1,g[22]=0,g[23]=0,g[24]=0,g[25]=1,g[26]=0,g[27]=0,g[28]=1,g[29]=0,g[30]=0,g[31]=1,g[32]=0,g[33]=0,g[34]=1,g[35]=0,g[36]=0,g[37]=-1,g[38]=0,g[39]=0,g[40]=-1,g[41]=0,g[42]=0,g[43]=-1,g[44]=0,g[45]=0,g[46]=-1,g[47]=0,g[48]=-1,g[49]=0,g[50]=0,g[51]=-1,g[52]=0,g[53]=0,g[54]=-1,g[55]=0,g[56]=0,g[57]=-1,g[58]=0,g[59]=0,g[60]=1,g[61]=0,g[62]=0,g[63]=1,g[64]=0,g[65]=0,g[66]=1,g[67]=0,g[68]=0,g[69]=1,g[70]=0,g[71]=0,m.tangent=new s({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:g})}if(c.bitangent){var v=new Float32Array(72);v[0]=0,v[1]=1,v[2]=0,v[3]=0,v[4]=1,v[5]=0,v[6]=0,v[7]=1,v[8]=0,v[9]=0,v[10]=1,v[11]=0,v[12]=0,v[13]=1,v[14]=0,v[15]=0,v[16]=1,v[17]=0,v[18]=0,v[19]=1,v[20]=0,v[21]=0,v[22]=1,v[23]=0,v[24]=0,v[25]=0,v[26]=1,v[27]=0,v[28]=0,v[29]=1,v[30]=0,v[31]=0,v[32]=1,v[33]=0,v[34]=0,v[35]=1,v[36]=0,v[37]=0,v[38]=1,v[39]=0,v[40]=0,v[41]=1,v[42]=0,v[43]=0,v[44]=1,v[45]=0,v[46]=0,v[47]=1,v[48]=0,v[49]=0,v[50]=1,v[51]=0,v[52]=0,v[53]=1,v[54]=0,v[55]=0,v[56]=1,v[57]=0,v[58]=0,v[59]=1,v[60]=0,v[61]=0,v[62]=1,v[63]=0,v[64]=0,v[65]=1,v[66]=0,v[67]=0,v[68]=1,v[69]=0,v[70]=0,v[71]=1,m.bitangent=new s({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:v})}h=new Uint16Array(36),h[0]=0,h[1]=1,h[2]=2,h[3]=0,h[4]=2,h[5]=3,h[6]=6,h[7]=5,h[8]=4,h[9]=7,h[10]=6,h[11]=4,h[12]=8,h[13]=9,h[14]=10,h[15]=8,h[16]=10,h[17]=11,h[18]=14,h[19]=13,h[20]=12,h[21]=15,h[22]=14,h[23]=12,h[24]=18,h[25]=17,h[26]=16,h[27]=19,h[28]=18,h[29]=16,h[30]=20,h[31]=21,h[32]=22,h[33]=20,h[34]=22,h[35]=23}else p=new Float64Array(24),p[0]=n.x,p[1]=n.y,p[2]=n.z,p[3]=o.x,p[4]=n.y,p[5]=n.z,p[6]=o.x,p[7]=o.y,p[8]=n.z,p[9]=n.x,p[10]=o.y,p[11]=n.z,p[12]=n.x,p[13]=n.y,p[14]=o.z,p[15]=o.x,p[16]=n.y,p[17]=o.z,p[18]=o.x,p[19]=o.y,p[20]=o.z,p[21]=n.x,p[22]=o.y,p[23]=o.z,m.position=new s({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:p}),h=new Uint16Array(36),h[0]=4,h[1]=5,h[2]=6,h[3]=4,h[4]=6,h[5]=7,h[6]=1,h[7]=0,h[8]=3,h[9]=1,h[10]=3,h[11]=2,h[12]=1,h[13]=6,h[14]=5,h[15]=1,h[16]=2,h[17]=6,h[18]=2,h[19]=3,h[20]=7,h[21]=2,h[22]=7,h[23]=6,h[24]=3,h[25]=0,h[26]=4,h[27]=3,h[28]=4,h[29]=7,h[30]=0,h[31]=1,h[32]=5,h[33]=0,h[34]=5,h[35]=4;var y=t.subtract(o,n,d),C=.5*t.magnitude(y);return new a({attributes:m,indices:h,primitiveType:u.TRIANGLES,boundingSphere:new e(t.ZERO,C)})}},h}),i("Core/BoxOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./PrimitiveType"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e){e=r(e,r.EMPTY_OBJECT);var i=e.minimum,n=e.maximum;this._min=t.clone(i),this._max=t.clone(n),this._workerName="createBoxOutlineGeometry"}var h=new t;c.fromDimensions=function(e){e=r(e,r.EMPTY_OBJECT);var i=e.dimensions,n=t.multiplyByScalar(i,.5,new t);return new c({minimum:t.negate(n,new t),maximum:n})},c.fromAxisAlignedBoundingBox=function(e){return new c({minimum:e.minimum,maximum:e.maximum})},c.packedLength=2*t.packedLength,c.pack=function(e,i,n){return n=r(n,0),t.pack(e._min,i,n),t.pack(e._max,i,n+t.packedLength),i};var d=new t,p=new t,m={minimum:d,maximum:p};return c.unpack=function(e,i,o){i=r(i,0);var a=t.unpack(e,i,d),s=t.unpack(e,i+t.packedLength,p);return n(o)?(o._min=t.clone(a,o._min),o._max=t.clone(s,o._max),o):new c(m)},c.createGeometry=function(r){var n=r._min,o=r._max;if(!t.equals(n,o)){var c=new l,d=new Uint16Array(24),p=new Float64Array(24);p[0]=n.x,p[1]=n.y,p[2]=n.z,p[3]=o.x,p[4]=n.y,p[5]=n.z,p[6]=o.x,p[7]=o.y,p[8]=n.z,p[9]=n.x,p[10]=o.y,p[11]=n.z,p[12]=n.x,p[13]=n.y,p[14]=o.z,p[15]=o.x,p[16]=n.y,p[17]=o.z,p[18]=o.x,p[19]=o.y,p[20]=o.z,p[21]=n.x,p[22]=o.y,p[23]=o.z,c.position=new s({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:p}),d[0]=4,d[1]=5,d[2]=5,d[3]=6,d[4]=6,d[5]=7,d[6]=7,d[7]=4,d[8]=0,d[9]=1,d[10]=1,d[11]=2,d[12]=2,d[13]=3,d[14]=3,d[15]=0,d[16]=0,d[17]=4,d[18]=1,d[19]=5,d[20]=2,d[21]=6,d[22]=3,d[23]=7;var m=t.subtract(o,n,h),f=.5*t.magnitude(m);return new a({attributes:c,indices:d,primitiveType:u.LINES,boundingSphere:new e(t.ZERO,f)})}},c}),i("Core/cancelAnimationFrame",["./defined"],function(e){"use strict";function t(e){i(e)}if("undefined"!=typeof window){var i=window.cancelAnimationFrame;return function(){if(!e(i))for(var t=["webkit","moz","ms","o"],r=0,n=t.length;r<n&&!e(i);)i=window[t[r]+"CancelAnimationFrame"],e(i)||(i=window[t[r]+"CancelRequestAnimationFrame"]),++r;e(i)||(i=clearTimeout)}(),t}}),i("Core/CartographicGeocoderService",["./Cartesian3","./defaultValue","./defineProperties","./defined","./DeveloperError","../ThirdParty/when"],function(e,t,i,r,n,o){"use strict";function a(){}return a.prototype.geocode=function(t){var i=t.match(/[^\s,\n]+/g);if(2===i.length||3===i.length){var r=+i[0],n=+i[1],a=3===i.length?+i[2]:300;if(!isNaN(r)&&!isNaN(n)&&!isNaN(a)){var s={displayName:t,destination:e.fromDegrees(r,n,a)};return o.resolve([s])}}return o.resolve([])},a}),i("Core/Spline",["./defaultValue","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(){this.times=void 0,this.points=void 0,i.throwInstantiationError()}return r.prototype.evaluate=i.throwInstantiationError,r.prototype.findTimeInterval=function(t,i){var r=this.times,n=r.length;if(i=e(i,0),t>=r[i]){if(i+1<n&&t<r[i+1])return i;if(i+2<n&&t<r[i+2])return i+1}else if(i-1>=0&&t>=r[i-1])return i-1;var o;if(t>r[i])for(o=i;o<n-1&&!(t>=r[o]&&t<r[o+1]);++o);else for(o=i-1;o>=0&&!(t>=r[o]&&t<r[o+1]);--o);return o===n-1&&(o=n-2),o},r}),i("Core/LinearSpline",["./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./Spline"],function(e,t,i,r,n,o){"use strict";function a(e){e=t(e,t.EMPTY_OBJECT);var i=e.points,r=e.times;this._times=r,this._points=i,this._lastTimeIndex=0}return r(a.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}}),a.prototype.findTimeInterval=o.prototype.findTimeInterval,a.prototype.evaluate=function(t,r){var n=this.points,o=this.times,a=this._lastTimeIndex=this.findTimeInterval(t,this._lastTimeIndex),s=(t-o[a])/(o[a+1]-o[a]);return i(r)||(r=new e),e.lerp(n[a],n[a+1],s,r)},a}),i("Core/TridiagonalSystemSolver",["./Cartesian3","./defined","./DeveloperError"],function(e,t,i){"use strict";var r={};return r.solve=function(t,i,r,n){var o,a=new Array(r.length),s=new Array(n.length),l=new Array(n.length);for(o=0;o<s.length;o++)s[o]=new e,l[o]=new e;a[0]=r[0]/i[0],s[0]=e.multiplyByScalar(n[0],1/i[0],s[0]);var u;for(o=1;o<a.length;++o)u=1/(i[o]-a[o-1]*t[o-1]),a[o]=r[o]*u,s[o]=e.subtract(n[o],e.multiplyByScalar(s[o-1],t[o-1],s[o]),s[o]),s[o]=e.multiplyByScalar(s[o],u,s[o]);for(u=1/(i[o]-a[o-1]*t[o-1]),s[o]=e.subtract(n[o],e.multiplyByScalar(s[o-1],t[o-1],s[o]),s[o]),s[o]=e.multiplyByScalar(s[o],u,s[o]),l[l.length-1]=s[s.length-1],o=l.length-2;o>=0;--o)l[o]=e.subtract(s[o],e.multiplyByScalar(l[o+1],a[o],l[o]),l[o]);return l},r}),i("Core/HermiteSpline",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./LinearSpline","./Matrix4","./Spline","./TridiagonalSystemSolver"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(t,i,n){var o=p,a=f,s=m,l=_;o.length=a.length=t.length-1,s.length=l.length=t.length;var c;o[0]=s[0]=1,a[0]=0;var h=l[0];for(r(h)||(h=l[0]=new e),e.clone(i,h),c=1;c<o.length-1;++c)o[c]=a[c]=1,s[c]=4,h=l[c],r(h)||(h=l[c]=new e),e.subtract(t[c+1],t[c-1],h),e.multiplyByScalar(h,3,h);return o[c]=0,a[c]=1,s[c]=4,h=l[c],r(h)||(h=l[c]=new e),e.subtract(t[c+1],t[c-1],h),e.multiplyByScalar(h,3,h),s[c+1]=1,h=l[c+1],r(h)||(h=l[c+1]=new e),e.clone(n,h),u.solve(o,s,a,l)}function h(t){var i=p,n=f,o=m,a=_;i.length=n.length=t.length-1,o.length=a.length=t.length;var s;i[0]=n[0]=1,o[0]=2;var l=a[0];for(r(l)||(l=a[0]=new e),e.subtract(t[1],t[0],l),e.multiplyByScalar(l,3,l),s=1;s<i.length;++s)i[s]=n[s]=1,o[s]=4,l=a[s],r(l)||(l=a[s]=new e),e.subtract(t[s+1],t[s-1],l),e.multiplyByScalar(l,3,l);return o[s]=2,l=a[s],r(l)||(l=a[s]=new e),e.subtract(t[s],t[s-1],l),e.multiplyByScalar(l,3,l),u.solve(i,o,n,a)}function d(e){e=i(e,i.EMPTY_OBJECT);var t=e.points,r=e.times,n=e.inTangents,o=e.outTangents;this._times=r,this._points=t,this._inTangents=n,this._outTangents=o,this._lastTimeIndex=0}var p=[],m=[],f=[],_=[];n(d.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},inTangents:{get:function(){return this._inTangents}},outTangents:{get:function(){return this._outTangents}}}),d.createC1=function(e){e=i(e,i.EMPTY_OBJECT);var t=e.times,r=e.points,n=e.tangents,o=n.slice(0,n.length-1),a=n.slice(1,n.length);return new d({times:t,points:r,inTangents:a,outTangents:o})},d.createNaturalCubic=function(e){e=i(e,i.EMPTY_OBJECT);var t=e.times,r=e.points;if(r.length<3)return new a({points:r,times:t});var n=h(r),o=n.slice(0,n.length-1),s=n.slice(1,n.length);return new d({times:t,points:r,inTangents:s,outTangents:o})},d.createClampedCubic=function(e){e=i(e,i.EMPTY_OBJECT);var t=e.times,r=e.points,n=e.firstTangent,o=e.lastTangent;if(r.length<3)return new a({points:r,times:t});var s=c(r,n,o),l=s.slice(0,s.length-1),u=s.slice(1,s.length);return new d({times:t,points:r,inTangents:u,outTangents:l})},d.hermiteCoefficientMatrix=new s(2,-3,0,1,-2,3,0,0,1,-2,1,0,1,-1,0,0),d.prototype.findTimeInterval=l.prototype.findTimeInterval;var g=new t,v=new e;return d.prototype.evaluate=function(t,i){r(i)||(i=new e);var n=this.points,o=this.times,a=this.inTangents,l=this.outTangents,u=this._lastTimeIndex=this.findTimeInterval(t,this._lastTimeIndex),c=(t-o[u])/(o[u+1]-o[u]),h=g;h.z=c,h.y=c*c,h.x=h.y*c,h.w=1;var p=s.multiplyByVector(d.hermiteCoefficientMatrix,h,h);return i=e.multiplyByScalar(n[u],p.x,i),e.multiplyByScalar(n[u+1],p.y,v),e.add(i,v,i),e.multiplyByScalar(l[u],p.z,v),e.add(i,v,i),e.multiplyByScalar(a[u],p.w,v),e.add(i,v,i)},d}),i("Core/CatmullRomSpline",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./HermiteSpline","./Matrix4","./Spline"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(t){var i=t.points,n=t.times;if(i.length<3){var o=n[0],l=1/(n[1]-o),u=i[0],m=i[1];return function(t,i){r(i)||(i=new e);var n=(t-o)*l;return e.lerp(u,m,n,i)}}return function(o,l){r(l)||(l=new e);var u=t._lastTimeIndex=t.findTimeInterval(o,t._lastTimeIndex),m=(o-n[u])/(n[u+1]-n[u]),f=h;f.z=m,f.y=m*m,f.x=f.y*m,f.w=1;var _,g,v,y,C;return 0===u?(_=i[0],g=i[1],v=t.firstTangent,y=e.subtract(i[2],_,d),e.multiplyByScalar(y,.5,y),C=s.multiplyByVector(a.hermiteCoefficientMatrix,f,f)):u===i.length-2?(_=i[u],g=i[u+1],y=t.lastTangent,v=e.subtract(g,i[u-1],d),e.multiplyByScalar(v,.5,v),C=s.multiplyByVector(a.hermiteCoefficientMatrix,f,f)):(_=i[u-1],g=i[u],v=i[u+1],y=i[u+2],C=s.multiplyByVector(c.catmullRomCoefficientMatrix,f,f)),l=e.multiplyByScalar(_,C.x,l),e.multiplyByScalar(g,C.y,p),e.add(l,p,l),e.multiplyByScalar(v,C.z,p),e.add(l,p,l),e.multiplyByScalar(y,C.w,p),e.add(l,p,l)}}function c(t){t=i(t,i.EMPTY_OBJECT);var n=t.points,o=t.times,a=t.firstTangent,s=t.lastTangent;if(n.length>2&&(r(a)||(a=m,e.multiplyByScalar(n[1],2,a),e.subtract(a,n[2],a),e.subtract(a,n[0],a),e.multiplyByScalar(a,.5,a)),!r(s))){var l=n.length-1;s=f,e.multiplyByScalar(n[l-1],2,s),e.subtract(n[l],s,s),e.add(s,n[l-2],s),e.multiplyByScalar(s,.5,s)}this._times=o,this._points=n,this._firstTangent=e.clone(a),this._lastTangent=e.clone(s),this._evaluateFunction=u(this),this._lastTimeIndex=0}var h=new t,d=new e,p=new e,m=new e,f=new e;return n(c.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},firstTangent:{get:function(){return this._firstTangent}},lastTangent:{get:function(){return this._lastTangent}}}),c.catmullRomCoefficientMatrix=new s(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0),c.prototype.findTimeInterval=l.prototype.findTimeInterval,c.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)},c}),i("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,i,r,n){"use strict";var o={UNSIGNED_BYTE:n.UNSIGNED_BYTE,UNSIGNED_SHORT:n.UNSIGNED_SHORT,UNSIGNED_INT:n.UNSIGNED_INT};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>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},o.createTypedArrayFromArrayBuffer=function(e,t,i,n){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,i,n):new Uint16Array(t,i,n)},i(o)}),i("Core/loadArrayBuffer",["./loadWithXhr"],function(e){"use strict";function t(t,i){return e({url:t,responseType:"arraybuffer",headers:i})}return t}),i("Core/Intersections2D",["./Cartesian3","./defined","./DeveloperError"],function(e,t,i){"use strict";var r={};return r.clipTriangleAtAxisAlignedThreshold=function(e,i,r,n,o,a){t(a)?a.length=0:a=[];var s,l,u;i?(s=r<e,l=n<e,u=o<e):(s=r>e,l=n>e,u=o>e);var c,h,d,p,m,f,_=s+l+u;return 1===_?s?(c=(e-r)/(n-r),h=(e-r)/(o-r),a.push(1),a.push(2),1!==h&&(a.push(-1),a.push(0),a.push(2),a.push(h)),1!==c&&(a.push(-1),a.push(0),a.push(1),a.push(c))):l?(d=(e-n)/(o-n),p=(e-n)/(r-n),a.push(2),a.push(0),1!==p&&(a.push(-1),a.push(1),a.push(0),a.push(p)),1!==d&&(a.push(-1),a.push(1),a.push(2),a.push(d))):u&&(m=(e-o)/(r-o),f=(e-o)/(n-o),a.push(0),a.push(1),1!==f&&(a.push(-1),a.push(2),a.push(1),a.push(f)),1!==m&&(a.push(-1),a.push(2),a.push(0),a.push(m))):2===_?s||r===e?l||n===e?u||o===e||(h=(e-r)/(o-r),d=(e-n)/(o-n),a.push(2),a.push(-1),a.push(0),a.push(2),a.push(h),a.push(-1),a.push(1),a.push(2),a.push(d)):(f=(e-o)/(n-o),c=(e-r)/(n-r),a.push(1),a.push(-1),a.push(2),a.push(1),a.push(f),a.push(-1),a.push(0),a.push(1),a.push(c)):(p=(e-n)/(r-n),m=(e-o)/(r-o),a.push(0),a.push(-1),a.push(1),a.push(0),a.push(p),a.push(-1),a.push(2),a.push(0),a.push(m)):3!==_&&(a.push(0),a.push(1),a.push(2)),a},r.computeBarycentricCoordinates=function(i,r,n,o,a,s,l,u,c){var h=n-l,d=l-a,p=s-u,m=o-u,f=1/(p*h+d*m),_=r-u,g=i-l,v=(p*g+d*_)*f,y=(-m*g+h*_)*f,C=1-v-y;return t(c)?(c.x=v,c.y=y,c.z=C,c):new e(v,y,C)},r}),i("Core/QuantizedMeshTerrainData",["../ThirdParty/when","./BoundingSphere","./Cartesian2","./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./IndexDatatype","./Intersections2D","./Math","./OrientedBoundingBox","./TaskProcessor","./TerrainEncoding","./TerrainMesh"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m){"use strict";function f(e){function t(e,t){return a[e]-a[t]}function i(e,t){return o[e]-o[t]}this._quantizedVertices=e.quantizedVertices,this._encodedNormals=e.encodedNormals,this._indices=e.indices,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._boundingSphere=e.boundingSphere,this._orientedBoundingBox=e.orientedBoundingBox,this._horizonOcclusionPoint=e.horizonOcclusionPoint;var r=this._quantizedVertices.length/3,o=this._uValues=this._quantizedVertices.subarray(0,r),a=this._vValues=this._quantizedVertices.subarray(r,2*r);this._heightValues=this._quantizedVertices.subarray(2*r,3*r),this._westIndices=_(e.westIndices,t,r),this._southIndices=_(e.southIndices,i,r),this._eastIndices=_(e.eastIndices,t,r),this._northIndices=_(e.northIndices,i,r),this._westSkirtHeight=e.westSkirtHeight,this._southSkirtHeight=e.southSkirtHeight,this._eastSkirtHeight=e.eastSkirtHeight,this._northSkirtHeight=e.northSkirtHeight,this._childTileMask=n(e.childTileMask,15),this._createdByUpsampling=n(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._mesh=void 0}function _(e,t,i){y.length=e.length;for(var r=!1,n=0,o=e.length;n<o;++n)y[n]=e[n],r=r||n>0&&t(e[n-1],e[n])>0;return r?(y.sort(t),l.createTypedArray(i,y)):e}function g(e,t,i){for(var r=e._mesh,n=r.vertices,o=r.encoding,a=r.indices,s=0,l=a.length;s<l;s+=3){var c=a[s],h=a[s+1],d=a[s+2],p=o.decodeTextureCoordinates(n,c,b),m=o.decodeTextureCoordinates(n,h,T),f=o.decodeTextureCoordinates(n,d,x),_=u.computeBarycentricCoordinates(t,i,p.x,p.y,m.x,m.y,f.x,f.y,E);if(_.x>=-1e-15&&_.y>=-1e-15&&_.z>=-1e-15){var g=o.decodeHeight(n,c),v=o.decodeHeight(n,h),y=o.decodeHeight(n,d);return _.x*g+_.y*v+_.z*y}}}function v(e,t,i){for(var r=e._uValues,n=e._vValues,o=e._heightValues,a=e._indices,s=0,l=a.length;s<l;s+=3){var h=a[s],d=a[s+1],p=a[s+2],m=r[h],f=r[d],_=r[p],g=n[h],v=n[d],y=n[p],C=u.computeBarycentricCoordinates(t,i,m,g,f,v,_,y,E);if(C.x>=-1e-15&&C.y>=-1e-15&&C.z>=-1e-15){var w=C.x*o[h]+C.y*o[d]+C.z*o[p];return c.lerp(e._minimumHeight,e._maximumHeight,w/S)}}}a(f.prototype,{waterMask:{get:function(){return this._waterMask}}});var y=[],C=new d("createVerticesFromQuantizedTerrainMesh");f.prototype.createMesh=function(t,i,r,a,s){var u=t.ellipsoid,c=t.tileXYToRectangle(i,r,a);s=n(s,1);var h=C.scheduleTask({minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,quantizedVertices:this._quantizedVertices,octEncodedNormals:this._encodedNormals,includeWebMercatorT:!0,indices:this._indices,westIndices:this._westIndices,southIndices:this._southIndices,eastIndices:this._eastIndices,northIndices:this._northIndices,westSkirtHeight:this._westSkirtHeight,southSkirtHeight:this._southSkirtHeight,eastSkirtHeight:this._eastSkirtHeight,northSkirtHeight:this._northSkirtHeight,rectangle:c,relativeToCenter:this._boundingSphere.center,ellipsoid:u,exaggeration:s});if(o(h)){var d=this;return e(h,function(e){var t=d._quantizedVertices.length/3;t+=d._westIndices.length+d._southIndices.length+d._eastIndices.length+d._northIndices.length;var i=l.createTypedArray(t,e.indices),r=new Float32Array(e.vertices),o=e.center,a=e.minimumHeight,u=e.maximumHeight,c=n(e.boundingSphere,d._boundingSphere),h=n(e.orientedBoundingBox,d._orientedBoundingBox),f=d._horizonOcclusionPoint,_=e.vertexStride,g=p.clone(e.encoding);return d._skirtIndex=e.skirtIndex,d._vertexCountWithoutSkirts=d._quantizedVertices.length/3,d._mesh=new m(o,r,i,a,u,c,f,_,h,g,s),d._quantizedVertices=void 0,d._encodedNormals=void 0,d._indices=void 0,d._uValues=void 0,d._vValues=void 0,d._heightValues=void 0,d._westIndices=void 0,d._southIndices=void 0,d._eastIndices=void 0,d._northIndices=void 0,d._mesh})}};var w=new d("upsampleQuantizedTerrainMesh");f.prototype.upsample=function(i,n,a,s,u,c,d){var p=this._mesh;if(o(this._mesh)){var m=2*n!==u,_=2*a===c,g=i.ellipsoid,v=i.tileXYToRectangle(u,c,d),y=w.scheduleTask({vertices:p.vertices,vertexCountWithoutSkirts:this._vertexCountWithoutSkirts,indices:p.indices,skirtIndex:this._skirtIndex,encoding:p.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:m,isNorthChild:_,childRectangle:v,ellipsoid:g,exaggeration:p.exaggeration});if(o(y)){var C=Math.min(this._westSkirtHeight,this._eastSkirtHeight);C=Math.min(C,this._southSkirtHeight),C=Math.min(C,this._northSkirtHeight);var S=m?.5*C:this._westSkirtHeight,E=_?.5*C:this._southSkirtHeight,b=m?this._eastSkirtHeight:.5*C,T=_?this._northSkirtHeight:.5*C;return e(y,function(e){var i,n=new Uint16Array(e.vertices),a=l.createTypedArray(n.length/3,e.indices);return o(e.encodedNormals)&&(i=new Uint8Array(e.encodedNormals)),new f({quantizedVertices:n,indices:a,encodedNormals:i,minimumHeight:e.minimumHeight,maximumHeight:e.maximumHeight,boundingSphere:t.clone(e.boundingSphere),orientedBoundingBox:h.clone(e.orientedBoundingBox),horizonOcclusionPoint:r.clone(e.horizonOcclusionPoint),westIndices:e.westIndices,southIndices:e.southIndices,eastIndices:e.eastIndices,northIndices:e.northIndices,westSkirtHeight:S,southSkirtHeight:E,eastSkirtHeight:b,northSkirtHeight:T,childTileMask:0,createdByUpsampling:!0})})}}};var S=32767,E=new r;f.prototype.interpolateHeight=function(e,t,i){var r=c.clamp((t-e.west)/e.width,0,1);r*=S;var n=c.clamp((i-e.south)/e.height,0,1);return n*=S,o(this._mesh)?void g(this,r,n):v(this,r,n)};var b=new i,T=new i,x=new i;return f.prototype.isChildAvailable=function(e,t,i,r){var n=2;return i!==2*e&&++n,r!==2*t&&(n-=2),0!==(this._childTileMask&1<<n)},f.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling},f}),i("Core/sampleTerrain",["../ThirdParty/when","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(t,i,r){function o(){t.ready?e(n(t,i,r),function(e){a.resolve(e)}):setTimeout(o,10)}var a=e.defer();return o(),a.promise}function n(t,i,r){var n,s=t.tilingScheme,l=[],u={};for(n=0;n<r.length;++n){var c=s.positionToTileXY(r[n],i),h=c.toString();if(!u.hasOwnProperty(h)){var d={x:c.x,y:c.y,level:i,tilingScheme:s,terrainProvider:t,positions:[]};u[h]=d,l.push(d)}u[h].positions.push(r[n])}var p=[];for(n=0;n<l.length;++n){var m=l[n],f=m.terrainProvider.requestTileGeometry(m.x,m.y,m.level,!1),_=e(f,o(m),a(m));p.push(_)}return e.all(p,function(){return r})}function o(e){var t=e.positions,i=e.tilingScheme.tileXYToRectangle(e.x,e.y,e.level);return function(e){for(var r=0;r<t.length;++r){var n=t[r];n.height=e.interpolateHeight(i,n.longitude,n.latitude)}}}function a(e){var t=e.positions;return function(){for(var e=0;e<t.length;++e){var i=t[e];i.height=void 0}}}return r}),i("Core/TileAvailability",["../ThirdParty/when","./binarySearch","./Cartographic","./defined","./sampleTerrain","./DeveloperError","./Rectangle"],function(e,t,i,r,n,o,a){"use strict";function s(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[];for(var i=0;i<e.getNumberOfYTilesAtLevel();++i)for(var r=0;r<e.getNumberOfXTilesAtLevel();++r)this._rootNodes.push(new l(e,void 0,0,r,i))}function l(e,t,i,r,n){this.tilingScheme=e,this.parent=t,this.level=i,this.x=r,this.y=n,this.extent=e.tileXYToRectangle(r,n,i),this.rectangles=[],this._sw=void 0,this._se=void 0,this._nw=void 0,this._ne=void 0}function u(e,t,i,r,n){this.level=e,this.west=t,this.south=i,this.east=r,this.north=n}function c(e,t){var i=Math.max(e.west,t.west),r=Math.max(e.south,t.south),n=Math.min(e.east,t.east),o=Math.min(e.north,t.north);return r<o&&i<n}function h(e,i,r){for(;i.level<e;)if(p(i.nw.extent,r))i=i.nw;else if(p(i.ne.extent,r))i=i.ne;else if(p(i.sw.extent,r))i=i.sw;else{if(!p(i.se.extent,r))break;i=i.se}if(0===i.rectangles.length||i.rectangles[i.rectangles.length-1].level<=r.level)i.rectangles.push(r);else{var n=t(i.rectangles,r.level,d);n<=0&&(n=~n),i.rectangles.splice(n,0,r)}}function d(e,t){return e.level-t}function p(e,t){return t.west>=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function m(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function f(e,t,i){for(var r=0;;){var n=t._nw&&m(t._nw.extent,i),o=t._ne&&m(t._ne.extent,i),a=t._sw&&m(t._sw.extent,i),s=t._se&&m(t._se.extent,i);if(n+o+a+s>1){n&&(r=Math.max(r,f(t,t._nw,i))),o&&(r=Math.max(r,f(t,t._ne,i))),a&&(r=Math.max(r,f(t,t._sw,i))),s&&(r=Math.max(r,f(t,t._se,i)));break}if(n)t=t._nw;else if(o)t=t._ne;else if(a)t=t._sw;else{if(!s)break;t=t._se}}for(;t!==e;){for(var l=t.rectangles,u=l.length-1;u>=0&&l[u].level>r;--u){var c=l[u];m(c,i)&&(r=c.level)}t=t.parent}return r}function _(e,t,i){if(t){var r,n=!1;for(r=0;r<i.length;++r)n=n||c(t.extent,i[r]);if(n){var o=t.rectangles;for(r=0;r<o.length;++r){var a=o[r];e[a.level]||(e[a.level]=i),e[a.level]=g(e[a.level],a)}_(e,t._nw,i),_(e,t._ne,i),_(e,t._sw,i),_(e,t._se,i)}}}function g(e,t){for(var i=[],r=0;r<e.length;++r){var n=e[r];c(n,t)?(n.west<t.west&&i.push(new a(n.west,n.south,t.west,n.north)),n.east>t.east&&i.push(new a(t.east,n.south,n.east,n.north)),n.south<t.south&&i.push(new a(Math.max(t.west,n.west),n.south,Math.min(t.east,n.east),t.south)),n.north>t.north&&i.push(new a(Math.max(t.west,n.west),t.north,Math.min(t.east,n.east),n.north))):i.push(n)}return i}var v=new a;s.prototype.addAvailableTileRange=function(e,t,i,r,n){var o=this._tilingScheme;o.tileXYToRectangle(t,i,e,v);var a=v.west,s=v.north;o.tileXYToRectangle(r,n,e,v);for(var l=v.east,d=v.south,p=new u(e,a,d,l,s),m=0;m<this._rootNodes.length;++m){var f=this._rootNodes[m];c(f.extent,p)&&h(this._maximumLevel,f,p)}},s.prototype.computeMaximumLevelAtPosition=function(e){for(var t,i=0;i<this._rootNodes.length;++i){var r=this._rootNodes[i];if(m(r.extent,e)){t=r;break}}return f(void 0,t,e)};var y=[],C=[],w=new a,S=new a;s.prototype.computeBestAvailableLevelOverRectangle=function(e){var t=y;t.length=0,e.east<e.west?(t.push(a.fromRadians(-Math.PI,e.south,e.east,e.north,w)),t.push(a.fromRadians(e.west,e.south,Math.PI,e.north,S))):t.push(e);var i=C;i.length=0;var n;for(n=0;n<this._rootNodes.length;++n)_(i,this._rootNodes[n],t);for(n=i.length-1;n>=0;--n)if(r(i[n])&&0===i[n].length)return n;return 0};var E=new i;return s.prototype.isTileAvailable=function(e,t,i){var r=this._tilingScheme.tileXYToRectangle(t,i,e,v);return a.center(r,E),this.computeMaximumLevelAtPosition(E)>=e},s.prototype.computeChildMaskForTile=function(e,t,i){var r=e+1;if(r>=this._maximumLevel)return 0;var n=0;return n|=this.isTileAvailable(r,2*t,2*i+1)?1:0,n|=this.isTileAvailable(r,2*t+1,2*i+1)?2:0,n|=this.isTileAvailable(r,2*t,2*i)?4:0,n|=this.isTileAvailable(r,2*t+1,2*i)?8:0},Object.defineProperties(l.prototype,{nw:{get:function(){return this._nw||(this._nw=new l(this.tilingScheme,this,this.level+1,2*this.x,2*this.y)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new l(this.tilingScheme,this,this.level+1,2*this.x+1,2*this.y)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new l(this.tilingScheme,this,this.level+1,2*this.x,2*this.y+1)),this._sw}},se:{get:function(){return this._se||(this._se=new l(this.tilingScheme,this,this.level+1,2*this.x+1,2*this.y+1)),this._se}}}),s}),i("Core/formatError",["./defined"],function(e){"use strict";function t(t){var i,r=t.name,n=t.message;i=e(r)&&e(n)?r+": "+n:t.toString();var o=t.stack;return e(o)&&(i+="\n"+o),i}return t}),i("Core/TileProviderError",["./defaultValue","./defined","./formatError"],function(e,t,i){"use strict";function r(t,i,r,n,o,a,s){this.provider=t,this.message=i,this.x=r,this.y=n,this.level=o,this.timesRetried=e(a,0),this.retry=!1,this.error=s}return r.handleError=function(e,n,o,a,s,l,u,c,h){var d=e;return t(e)?(d.provider=n,d.message=a,d.x=s,d.y=l,d.level=u,d.retry=!1,d.error=h,++d.timesRetried):d=new r(n,a,s,l,u,0,h),o.numberOfListeners>0?o.raiseEvent(d):console.log('An error occurred in "'+n.constructor.name+'": '+i(a)),d.retry&&t(c)&&c(),d},r.handleSuccess=function(e){t(e)&&(e.timesRetried=-1)},r}),i("Core/CesiumTerrainProvider",["../ThirdParty/Uri","../ThirdParty/when","./BoundingSphere","./Cartesian3","./Credit","./defaultValue","./defined","./defineProperties","./DeveloperError","./Event","./GeographicTilingScheme","./HeightmapTerrainData","./IndexDatatype","./joinUrls","./loadArrayBuffer","./loadJson","./Math","./OrientedBoundingBox","./QuantizedMeshTerrainData","./Rectangle","./RuntimeError","./TerrainProvider","./throttleRequestByServer","./TileAvailability","./TileProviderError"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b){"use strict";function T(i){function r(t){ +var i;if(!t.format)return i="The tile format is not specified in the layer.json file.",void(m=b.handleError(m,_,_._errorEvent,i,void 0,void 0,void 0,l));if(!t.tiles||0===t.tiles.length)return i="The layer.json file does not specify any tile URL templates.",void(m=b.handleError(m,_,_._errorEvent,i,void 0,void 0,void 0,l));if("heightmap-1.0"===t.format)_._heightmapStructure={heightScale:.2,heightOffset:-1e3,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1,lowestEncodedHeight:0,highestEncodedHeight:65535},_._hasWaterMask=!0,_._requestWaterMask=!0;else if(0!==t.format.indexOf("quantized-mesh-1."))return i='The tile format "'+t.format+'" is invalid or not supported.',void(m=b.handleError(m,_,_._errorEvent,i,void 0,void 0,void 0,l));_._tileUrlTemplates=t.tiles;for(var r=0;r<_._tileUrlTemplates.length;++r){var o=new e(_._tileUrlTemplates[r]),s=new e(_._url);o.authority&&!s.authority&&(s.authority=o.authority,s.scheme=o.scheme),_._tileUrlTemplates[r]=p(s,o).toString().replace("{version}",t.version)}var u=t.available;if(a(u)){_._availability=new E(_._tilingScheme,u.length);for(var c=0;c<u.length;++c)for(var h=u[c],d=_._tilingScheme.getNumberOfYTilesAtLevel(c),f=0;f<h.length;++f){var g=h[f];_._availability.addAvailableTileRange(c,g.startX,d-g.endY-1,g.endX,d-g.startY-1)}}!a(_._credit)&&a(t.attribution)&&null!==t.attribution&&(_._credit=new n(t.attribution)),a(t.extensions)&&t.extensions.indexOf("octvertexnormals")!==-1?_._hasVertexNormals=!0:a(t.extensions)&&t.extensions.indexOf("vertexnormals")!==-1&&(_._hasVertexNormals=!0,_._littleEndianExtensionSize=!1),a(t.extensions)&&t.extensions.indexOf("watermask")!==-1&&(_._hasWaterMask=!0),_._ready=!0,_._readyPromise.resolve(!0)}function s(e){if(a(e)&&404===e.statusCode)return void r({tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]});var t="An error occurred while accessing "+d+".";m=b.handleError(m,_,_._errorEvent,t,void 0,void 0,void 0,l)}function l(){var e=f(d);t(e,r,s)}this._url=i.url,this._proxy=i.proxy,this._tilingScheme=new c({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:i.ellipsoid}),this._heightmapWidth=65,this._levelZeroMaximumGeometricError=w.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,this._heightmapWidth,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._heightmapStructure=void 0,this._hasWaterMask=!1,this._hasVertexNormals=!1,this._requestVertexNormals=o(i.requestVertexNormals,!1),this._littleEndianExtensionSize=!0,this._requestWaterMask=o(i.requestWaterMask,!1),this._errorEvent=new u,this._availability=void 0;var h=i.credit;"string"==typeof h&&(h=new n(h)),this._credit=h,this._ready=!1,this._readyPromise=t.defer();var d=p(this._url,"layer.json");a(this._proxy)&&(d=this._proxy.getURL(d));var m,_=this;l()}function x(e){if(a(e)&&0!==e.length){var t=e.join("-");return{Accept:"application/vnd.quantized-mesh;extensions="+t+",application/octet-stream;q=0.9,*/*;q=0.01"}}return{Accept:"application/vnd.quantized-mesh,application/octet-stream;q=0.9,*/*;q=0.01"}}function A(e,t,i,r,n,o){var a=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new h({buffer:a,childTileMask:new Uint8Array(t,a.byteLength,1)[0],waterMask:new Uint8Array(t,a.byteLength+1,t.byteLength-a.byteLength-1),width:e._heightmapWidth,height:e._heightmapWidth,structure:e._heightmapStructure})}function P(e,t,n,o,a,s){function l(e){return e>>1^-(1&e)}var u=0,c=3,h=c+1,p=Float64Array.BYTES_PER_ELEMENT*c,m=Float64Array.BYTES_PER_ELEMENT*h,f=3,y=Uint16Array.BYTES_PER_ELEMENT*f,C=3,w=Uint16Array.BYTES_PER_ELEMENT,S=w*C,E=new DataView(t),b=new r(E.getFloat64(u,!0),E.getFloat64(u+8,!0),E.getFloat64(u+16,!0));u+=p;var T=E.getFloat32(u,!0);u+=Float32Array.BYTES_PER_ELEMENT;var x=E.getFloat32(u,!0);u+=Float32Array.BYTES_PER_ELEMENT;var A=new i(new r(E.getFloat64(u,!0),E.getFloat64(u+8,!0),E.getFloat64(u+16,!0)),E.getFloat64(u+p,!0));u+=m;var P=new r(E.getFloat64(u,!0),E.getFloat64(u+8,!0),E.getFloat64(u+16,!0));u+=p;var M=E.getUint32(u,!0);u+=Uint32Array.BYTES_PER_ELEMENT;var I=new Uint16Array(t,u,3*M);u+=M*y,M>65536&&(w=Uint32Array.BYTES_PER_ELEMENT,S=w*C);var R,O=I.subarray(0,M),N=I.subarray(M,2*M),L=I.subarray(2*M,3*M),B=0,F=0,V=0;for(R=0;R<M;++R)B+=l(O[R]),F+=l(N[R]),V+=l(L[R]),O[R]=B,N[R]=F,L[R]=V;u%w!==0&&(u+=w-u%w);var k=E.getUint32(u,!0);u+=Uint32Array.BYTES_PER_ELEMENT;var z=d.createTypedArrayFromArrayBuffer(M,t,u,k*C);u+=k*S;var U=0;for(R=0;R<z.length;++R){var G=z[R];z[R]=U-G,0===G&&++U}var W=E.getUint32(u,!0);u+=Uint32Array.BYTES_PER_ELEMENT;var H=d.createTypedArrayFromArrayBuffer(M,t,u,W);u+=W*w;var q=E.getUint32(u,!0);u+=Uint32Array.BYTES_PER_ELEMENT;var j=d.createTypedArrayFromArrayBuffer(M,t,u,q);u+=q*w;var Y=E.getUint32(u,!0);u+=Uint32Array.BYTES_PER_ELEMENT;var X=d.createTypedArrayFromArrayBuffer(M,t,u,Y);u+=Y*w;var Z=E.getUint32(u,!0);u+=Uint32Array.BYTES_PER_ELEMENT;var K=d.createTypedArrayFromArrayBuffer(M,t,u,Z);u+=Z*w;for(var Q,J;u<E.byteLength;){var $=E.getUint8(u,!0);u+=Uint8Array.BYTES_PER_ELEMENT;var ee=E.getUint32(u,e._littleEndianExtensionSize);u+=Uint32Array.BYTES_PER_ELEMENT,$===D.OCT_VERTEX_NORMALS&&e._requestVertexNormals?Q=new Uint8Array(t,u,2*M):$===D.WATER_MASK&&e._requestWaterMask&&(J=new Uint8Array(t,u,ee)),u+=ee}var te,ie=5*e.getLevelMaximumGeometricError(n),re=e._tilingScheme.tileXYToRectangle(o,a,n);return re.width<_.PI_OVER_TWO+_.EPSILON5&&(te=g.fromRectangle(re,T,x,e._tilingScheme.ellipsoid)),new v({center:b,minimumHeight:T,maximumHeight:x,boundingSphere:A,orientedBoundingBox:te,horizonOcclusionPoint:P,quantizedVertices:I,encodedNormals:Q,indices:z,westIndices:H,southIndices:j,eastIndices:X,northIndices:K,westSkirtHeight:ie,southSkirtHeight:ie,eastSkirtHeight:ie,northSkirtHeight:ie,childTileMask:e.availability.computeChildMaskForTile(n,o,a),waterMask:J})}var D={OCT_VERTEX_NORMALS:1,WATER_MASK:2};return T.prototype.requestTileGeometry=function(e,i,r,n){function s(e){return m(e,x(f))}var l=this._tileUrlTemplates;if(0!==l.length){var u=this._tilingScheme.getNumberOfYTilesAtLevel(r),c=u-i-1,h=l[(e+c+r)%l.length].replace("{z}",r).replace("{x}",e).replace("{y}",c),d=this._proxy;a(d)&&(h=d.getURL(h));var p,f=[];if(this._requestVertexNormals&&this._hasVertexNormals&&f.push(this._littleEndianExtensionSize?"octvertexnormals":"vertexnormals"),this._requestWaterMask&&this._hasWaterMask&&f.push("watermask"),n=o(n,!0)){if(p=S(h,s),!a(p))return}else p=s(h);var _=this;return t(p,function(t){return a(_._heightmapStructure)?A(_,t,r,e,i,c):P(_,t,r,e,i,c)})}},s(T.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},hasWaterMask:{get:function(){return this._hasWaterMask&&this._requestWaterMask}},hasVertexNormals:{get:function(){return this._hasVertexNormals&&this._requestVertexNormals}},requestVertexNormals:{get:function(){return this._requestVertexNormals}},requestWaterMask:{get:function(){return this._requestWaterMask}},availability:{get:function(){return this._availability}}}),T.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)},T.prototype.getTileDataAvailable=function(e,t,i){if(a(this.availability))return this.availability.isTileAvailable(i,e,t)},T}),i("Core/EllipseGeometryLibrary",["./Cartesian3","./Math","./Matrix3","./Quaternion"],function(e,t,i,r){"use strict";function n(t,n,o,c,h,d,p,m,f,_){var g=t+n;e.multiplyByScalar(c,Math.cos(g),a),e.multiplyByScalar(o,Math.sin(g),s),e.add(a,s,a);var v=Math.cos(t);v*=v;var y=Math.sin(t);y*=y;var C=d/Math.sqrt(p*v+h*y),w=C/m;return r.fromAxisAngle(a,w,l),i.fromQuaternion(l,u),i.multiplyByVector(u,f,_),e.normalize(_,_),e.multiplyByScalar(_,m,_),_}var o={},a=new e,s=new e,l=new r,u=new i,c=new e,h=new e,d=new e,p=new e;o.raisePositionsToHeight=function(t,i,r){for(var n=i.ellipsoid,o=i.height,a=i.extrudedHeight,s=r?t.length/3*2:t.length/3,l=new Float64Array(3*s),u=t.length,m=r?u:0,f=0;f<u;f+=3){var _=f+1,g=f+2,v=e.fromArray(t,f,c);n.scaleToGeodeticSurface(v,v);var y=e.clone(v,h),C=n.geodeticSurfaceNormal(v,p),w=e.multiplyByScalar(C,o,d);e.add(v,w,v),r&&(e.multiplyByScalar(C,a,w),e.add(y,w,y),l[f+m]=y.x,l[_+m]=y.y,l[g+m]=y.z),l[f]=v.x,l[_]=v.y,l[g]=v.z}return l};var m=new e,f=new e,_=new e;return o.computeEllipsePositions=function(i,r,o){var a=i.semiMinorAxis,s=i.semiMajorAxis,l=i.rotation,u=i.center,p=8*i.granularity,g=a*a,v=s*s,y=s*a,C=e.magnitude(u),w=e.normalize(u,m),S=e.cross(e.UNIT_Z,u,f);S=e.normalize(S,S);var E=e.cross(w,S,_),b=1+Math.ceil(t.PI_OVER_TWO/p),T=t.PI_OVER_TWO/(b-1),x=t.PI_OVER_TWO-b*T;x<0&&(b-=Math.ceil(Math.abs(x)/T));var A,P,D,M,I,R=2*(b*(b+2)),O=r?new Array(3*R):void 0,N=0,L=c,B=h,F=4*b*3,V=F-1,k=0,z=o?new Array(F):void 0;for(x=t.PI_OVER_TWO,L=n(x,l,E,S,g,y,v,C,w,L),r&&(O[N++]=L.x,O[N++]=L.y,O[N++]=L.z),o&&(z[V--]=L.z,z[V--]=L.y,z[V--]=L.x),x=t.PI_OVER_TWO-T,A=1;A<b+1;++A){if(L=n(x,l,E,S,g,y,v,C,w,L),B=n(Math.PI-x,l,E,S,g,y,v,C,w,B),r){for(O[N++]=L.x,O[N++]=L.y,O[N++]=L.z,D=2*A+2,P=1;P<D-1;++P)M=P/(D-1),I=e.lerp(L,B,M,d),O[N++]=I.x,O[N++]=I.y,O[N++]=I.z;O[N++]=B.x,O[N++]=B.y,O[N++]=B.z}o&&(z[V--]=L.z,z[V--]=L.y,z[V--]=L.x,z[k++]=B.x,z[k++]=B.y,z[k++]=B.z),x=t.PI_OVER_TWO-(A+1)*T}for(A=b;A>1;--A){if(x=t.PI_OVER_TWO-(A-1)*T,L=n(-x,l,E,S,g,y,v,C,w,L),B=n(x+Math.PI,l,E,S,g,y,v,C,w,B),r){for(O[N++]=L.x,O[N++]=L.y,O[N++]=L.z,D=2*(A-1)+2,P=1;P<D-1;++P)M=P/(D-1),I=e.lerp(L,B,M,d),O[N++]=I.x,O[N++]=I.y,O[N++]=I.z;O[N++]=B.x,O[N++]=B.y,O[N++]=B.z}o&&(z[V--]=L.z,z[V--]=L.y,z[V--]=L.x,z[k++]=B.x,z[k++]=B.y,z[k++]=B.z)}x=t.PI_OVER_TWO,L=n(-x,l,E,S,g,y,v,C,w,L);var U={};return r&&(O[N++]=L.x,O[N++]=L.y,O[N++]=L.z,U.positions=O,U.numPts=b),o&&(z[V--]=L.z,z[V--]=L.y,z[V--]=L.x,U.outerPositions=z),U},o}),i("Core/GeometryInstance",["./defaultValue","./defined","./DeveloperError","./Matrix4"],function(e,t,i,r){"use strict";function n(t){t=e(t,e.EMPTY_OBJECT),this.geometry=t.geometry,this.modelMatrix=r.clone(e(t.modelMatrix,r.IDENTITY)),this.id=t.id,this.pickPrimitive=t.pickPrimitive,this.attributes=e(t.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}return n}),i("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(i,r){t(n[i])||(n[i]=!0,console.warn(e(r,i)))}var n={};return r.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.",r}),i("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,i){"use strict";function r(e,t){i(e,t)}return r}),i("Core/EncodedCartesian3",["./Cartesian3","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(){this.high=e.clone(e.ZERO),this.low=e.clone(e.ZERO)}r.encode=function(e,i){t(i)||(i={high:0,low:0});var r;return e>=0?(r=65536*Math.floor(e/65536),i.high=r,i.low=e-r):(r=65536*Math.floor(-e/65536),i.high=-r,i.low=e+r),i};var n={high:0,low:0};r.fromCartesian=function(e,i){t(i)||(i=new r);var o=i.high,a=i.low;return r.encode(e.x,n),o.x=n.high,a.x=n.low,r.encode(e.y,n),o.y=n.high,a.y=n.low,r.encode(e.z,n),o.z=n.high,a.z=n.low,i};var o=new r;return r.writeElements=function(e,t,i){r.fromCartesian(e,o);var n=o.high,a=o.low;t[i]=n.x,t[i+1]=n.y,t[i+2]=n.z,t[i+3]=a.x,t[i+4]=a.y,t[i+5]=a.z},r}),i("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t,i){"use strict";var r={};return r.calculateACMR=function(i){i=e(i,e.EMPTY_OBJECT);var r=i.indices,n=i.maximumIndex,o=e(i.cacheSize,24),a=r.length;if(!t(n)){n=0;for(var s=0,l=r[s];s<a;)l>n&&(n=l),++s,l=r[s]}for(var u=[],c=0;c<n+1;c++)u[c]=0;for(var h=o+1,d=0;d<a;++d)h-u[r[d]]>o&&(u[r[d]]=h,++h);return(h-o+1)/(a/3)},r.tipsify=function(i){function r(e,t,i,r){for(;t.length>=1;){var n=t[t.length-1];if(t.splice(t.length-1,1),e[n].numLiveTriangles>0)return n}for(;o<r;){if(e[o].numLiveTriangles>0)return++o,o-1;++o}return-1}function n(e,t,i,n,o,a,s){for(var l,u=-1,c=-1,h=0;h<i.length;){var d=i[h];n[d].numLiveTriangles&&(l=0,o-n[d].timeStamp+2*n[d].numLiveTriangles<=t&&(l=o-n[d].timeStamp),(l>c||c===-1)&&(c=l,u=d)),++h}return u===-1?r(n,a,e,s):u}i=e(i,e.EMPTY_OBJECT);var o,a=i.indices,s=i.maximumIndex,l=e(i.cacheSize,24),u=a.length,c=0,h=0,d=a[h],p=u;if(t(s))c=s+1;else{for(;h<p;)d>c&&(c=d),++h,d=a[h];if(c===-1)return 0;++c}for(var m=[],f=0;f<c;f++)m[f]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};h=0;for(var _=0;h<p;)m[a[h]].vertexTriangles.push(_),++m[a[h]].numLiveTriangles,m[a[h+1]].vertexTriangles.push(_),++m[a[h+1]].numLiveTriangles,m[a[h+2]].vertexTriangles.push(_),++m[a[h+2]].numLiveTriangles,++_,h+=3;var g=0,v=l+1;o=1;var y,C,w=[],S=[],E=0,b=[],T=u/3,x=[];for(f=0;f<T;f++)x[f]=!1;for(var A,P;g!==-1;){w=[],C=m[g],P=C.vertexTriangles.length;for(var D=0;D<P;++D)if(_=C.vertexTriangles[D],!x[_]){x[_]=!0,h=_+_+_;for(var M=0;M<3;++M)A=a[h],w.push(A),S.push(A),b[E]=A,++E,y=m[A],--y.numLiveTriangles,v-y.timeStamp>l&&(y.timeStamp=v,++v),++h}g=n(a,l,w,m,v,S,c)}return b},r}),i("Core/GeometryPipeline",["./AttributeCompression","./barycentricCoordinates","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./deprecationWarning","./DeveloperError","./EncodedCartesian3","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryType","./IndexDatatype","./Intersect","./IntersectionTests","./Math","./Matrix3","./Matrix4","./Plane","./PrimitiveType","./Tipsify"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T){"use strict";function x(e,t,i,r,n){e[t++]=i,e[t++]=r,e[t++]=r,e[t++]=n,e[t++]=n,e[t]=i}function A(e){for(var t=e.length,i=t/3*6,r=g.createTypedArray(t,i),n=0,o=0;o<t;o+=3,n+=6)x(r,n,e[o],e[o+1],e[o+2]);return r}function P(e){var t=e.length;if(t>=3){var i=6*(t-2),r=g.createTypedArray(t,i);x(r,0,e[0],e[1],e[2]);for(var n=6,o=3;o<t;++o,n+=6)x(r,n,e[o-1],e[o],e[o-2]);return r}return new Uint16Array}function D(e){if(e.length>0){for(var t=e.length-1,i=6*(t-1),r=g.createTypedArray(t,i),n=e[0],o=0,a=1;a<t;++a,o+=6)x(r,o,n,e[a],e[a+1]);return r}return new Uint16Array}function M(e){var t={};for(var i in e)if(e.hasOwnProperty(i)&&u(e[i])&&u(e[i].values)){var r=e[i];t[i]=new f({componentDatatype:r.componentDatatype,componentsPerAttribute:r.componentsPerAttribute,normalize:r.normalize,values:[]})}return t}function I(e,t,i){for(var r in t)if(t.hasOwnProperty(r)&&u(t[r])&&u(t[r].values))for(var n=t[r],o=0;o<n.componentsPerAttribute;++o)e[r].values.push(n.values[i*n.componentsPerAttribute+o])}function R(e,t){if(u(t))for(var i=t.values,r=i.length,o=0;o<r;o+=3)n.unpack(i,o,ae),S.multiplyByPoint(e,ae,ae),n.pack(ae,i,o)}function O(e,t){if(u(t))for(var i=t.values,r=i.length,o=0;o<r;o+=3)n.unpack(i,o,ae),w.multiplyByVector(e,ae,ae),ae=n.normalize(ae,ae),n.pack(ae,i,o)}function N(e,t){var i,r=e.length,n={},o=e[0][t].attributes;for(i in o)if(o.hasOwnProperty(i)&&u(o[i])&&u(o[i].values)){for(var a=o[i],l=a.values.length,c=!0,h=1;h<r;++h){var d=e[h][t].attributes[i];if(!u(d)||a.componentDatatype!==d.componentDatatype||a.componentsPerAttribute!==d.componentsPerAttribute||a.normalize!==d.normalize){c=!1;break}l+=d.values.length}c&&(n[i]=new f({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:s.createTypedArray(a.componentDatatype,l)}))}return n}function L(e,t){var r,o,a,s,l,c,h,d=e.length,p=(e[0].modelMatrix,u(e[0][t].indices)),f=e[0][t].primitiveType,_=N(e,t);for(r in _)if(_.hasOwnProperty(r))for(l=_[r].values,s=0,o=0;o<d;++o)for(c=e[o][t].attributes[r].values,h=c.length,a=0;a<h;++a)l[s++]=c[a];var v;if(p){var y=0;for(o=0;o<d;++o)y+=e[o][t].indices.length;var C=m.computeNumberOfVertices(new m({attributes:_,primitiveType:b.POINTS})),w=g.createTypedArray(C,y),S=0,E=0;for(o=0;o<d;++o){var T=e[o][t].indices,x=T.length;for(s=0;s<x;++s)w[S++]=E+T[s];E+=m.computeNumberOfVertices(e[o][t])}v=w}var A,P=new n,D=0;for(o=0;o<d;++o){if(A=e[o][t].boundingSphere,!u(A)){P=void 0;break}n.add(A.center,P,P)}if(u(P))for(n.divideByScalar(P,d,P),o=0;o<d;++o){A=e[o][t].boundingSphere;var M=n.magnitude(n.subtract(A.center,P,ue))+A.radius;M>D&&(D=M)}return new m({attributes:_,indices:v,primitiveType:f,boundingSphere:u(P)?new i(P,D):void 0})}function B(e){if(u(e.indices))return e;for(var t=m.computeNumberOfVertices(e),i=g.createTypedArray(t,t),r=0;r<t;++r)i[r]=r;return e.indices=i,e}function F(e){var t=m.computeNumberOfVertices(e),i=g.createTypedArray(t,3*(t-2));i[0]=1,i[1]=0,i[2]=2;for(var r=3,n=3;n<t;++n)i[r++]=n-1,i[r++]=0,i[r++]=n;return e.indices=i,e.primitiveType=b.TRIANGLES,e}function V(e){var t=m.computeNumberOfVertices(e),i=g.createTypedArray(t,3*(t-2));i[0]=0,i[1]=1,i[2]=2,t>3&&(i[3]=0,i[4]=2,i[5]=3);for(var r=6,n=3;n<t-1;n+=2)i[r++]=n,i[r++]=n-1,i[r++]=n+1,n+2<t&&(i[r++]=n,i[r++]=n+1,i[r++]=n+2);return e.indices=i,e.primitiveType=b.TRIANGLES,e}function k(e){if(u(e.indices))return e;for(var t=m.computeNumberOfVertices(e),i=g.createTypedArray(t,t),r=0;r<t;++r)i[r]=r;return e.indices=i,e}function z(e){var t=m.computeNumberOfVertices(e),i=g.createTypedArray(t,2*(t-1));i[0]=0,i[1]=1;for(var r=2,n=2;n<t;++n)i[r++]=n-1,i[r++]=n;return e.indices=i,e.primitiveType=b.LINES,e}function U(e){var t=m.computeNumberOfVertices(e),i=g.createTypedArray(t,2*t);i[0]=0,i[1]=1;for(var r=2,n=2;n<t;++n)i[r++]=n-1,i[r++]=n;return i[r++]=t-1,i[r]=0,e.indices=i,e.primitiveType=b.LINES,e}function G(e){switch(e.primitiveType){case b.TRIANGLE_FAN:return F(e);case b.TRIANGLE_STRIP:return V(e);case b.TRIANGLES:return B(e);case b.LINE_STRIP:return z(e);case b.LINE_LOOP:return U(e);case b.LINES:return k(e)}return e}function W(e,t){Math.abs(e.y)<C.EPSILON6&&(t?e.y=-C.EPSILON6:e.y=C.EPSILON6)}function H(e,t,i){if(0!==e.y&&0!==t.y&&0!==i.y)return W(e,e.y<0),W(t,t.y<0),void W(i,i.y<0);var r,n=Math.abs(e.y),o=Math.abs(t.y),a=Math.abs(i.y);r=n>o?n>a?C.sign(e.y):C.sign(i.y):o>a?C.sign(t.y):C.sign(i.y);var s=r<0;W(e,s),W(t,s),W(i,s)}function q(e,t,i,r){n.add(e,n.multiplyByScalar(n.subtract(t,e,Se),e.y/(e.y-t.y),Se),i),n.clone(i,r),W(i,!0),W(r,!1)}function j(e,t,i){if(!(e.x>=0||t.x>=0||i.x>=0)){H(e,t,i);var r=e.y<0,n=t.y<0,o=i.y<0,a=0;a+=r?1:0,a+=n?1:0,a+=o?1:0;var s=Ae.indices;1===a?(s[1]=3,s[2]=4,s[5]=6,s[7]=6,s[8]=5,r?(q(e,t,Ee,Te),q(e,i,be,xe),s[0]=0,s[3]=1,s[4]=2,s[6]=1):n?(q(t,i,Ee,Te),q(t,e,be,xe),s[0]=1,s[3]=2,s[4]=0,s[6]=2):o&&(q(i,e,Ee,Te),q(i,t,be,xe),s[0]=2,s[3]=0,s[4]=1,s[6]=0)):2===a&&(s[2]=4,s[4]=4,s[5]=3,s[7]=5,s[8]=6,r?n?o||(q(i,e,Ee,Te),q(i,t,be,xe),s[0]=0,s[1]=1,s[3]=0,s[6]=2):(q(t,i,Ee,Te),q(t,e,be,xe),s[0]=2,s[1]=0,s[3]=2,s[6]=1):(q(e,t,Ee,Te),q(e,i,be,xe),s[0]=1,s[1]=2,s[3]=1,s[6]=0));var l=Ae.positions;return l[0]=e,l[1]=t,l[2]=i,l.length=3,1!==a&&2!==a||(l[3]=Ee,l[4]=be,l[5]=Te,l[6]=xe,l.length=7),Ae}}function Y(e,t){var r=e.attributes;if(0!==r.position.values.length){for(var n in r)if(r.hasOwnProperty(n)&&u(r[n])&&u(r[n].values)){var o=r[n];o.values=s.createTypedArray(o.componentDatatype,o.values)}var a=m.computeNumberOfVertices(e);return e.indices=g.createTypedArray(a,e.indices),t&&(e.boundingSphere=i.fromVertices(r.position.values)),e}}function X(e){var t=e.attributes,i={};for(var r in t)if(t.hasOwnProperty(r)&&u(t[r])&&u(t[r].values)){var n=t[r];i[r]=new f({componentDatatype:n.componentDatatype,componentsPerAttribute:n.componentsPerAttribute,normalize:n.normalize,values:[]})}return new m({attributes:i,indices:[],primitiveType:e.primitiveType})}function Z(e,t,i){var r=u(e.geometry.boundingSphere);t=Y(t,r),i=Y(i,r),u(i)&&!u(t)?e.geometry=i:!u(i)&&u(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=i,e.geometry=void 0)}function K(e,i,o,a,s,l,c,h,d,p,m,f){if(u(l)||u(c)||u(h)||u(d)||u(p)){var _=n.fromArray(s,3*e,Pe),g=n.fromArray(s,3*i,De),v=n.fromArray(s,3*o,Me),y=t(a,_,g,v,Ie);if(u(l)){var C=n.fromArray(l,3*e,Pe),w=n.fromArray(l,3*i,De),S=n.fromArray(l,3*o,Me);n.multiplyByScalar(C,y.x,C),n.multiplyByScalar(w,y.y,w),n.multiplyByScalar(S,y.z,S);var E=n.add(C,w,C);n.add(E,S,E),n.normalize(E,E),n.pack(E,m.normal.values,3*f)}if(u(p)){var b=n.fromArray(p,3*e,Pe),T=n.fromArray(p,3*i,De),x=n.fromArray(p,3*o,Me);n.multiplyByScalar(b,y.x,b),n.multiplyByScalar(T,y.y,T),n.multiplyByScalar(x,y.z,x);var A;n.equals(b,n.ZERO)&&n.equals(T,n.ZERO)&&n.equals(x,n.ZERO)?(A=Pe,A.x=0,A.y=0,A.z=0):(A=n.add(b,T,b),n.add(A,x,A),n.normalize(A,A)),n.pack(A,m.extrudeDirection.values,3*f)}if(u(c)){var P=n.fromArray(c,3*e,Pe),D=n.fromArray(c,3*i,De),M=n.fromArray(c,3*o,Me);n.multiplyByScalar(P,y.x,P),n.multiplyByScalar(D,y.y,D),n.multiplyByScalar(M,y.z,M);var I=n.add(P,D,P);n.add(I,M,I),n.normalize(I,I),n.pack(I,m.tangent.values,3*f)}if(u(h)){var R=n.fromArray(h,3*e,Pe),O=n.fromArray(h,3*i,De),N=n.fromArray(h,3*o,Me);n.multiplyByScalar(R,y.x,R),n.multiplyByScalar(O,y.y,O),n.multiplyByScalar(N,y.z,N);var L=n.add(R,O,R);n.add(L,N,L),n.normalize(L,L),n.pack(L,m.bitangent.values,3*f)}if(u(d)){var B=r.fromArray(d,2*e,Re),F=r.fromArray(d,2*i,Oe),V=r.fromArray(d,2*o,Ne);r.multiplyByScalar(B,y.x,B),r.multiplyByScalar(F,y.y,F),r.multiplyByScalar(V,y.z,V);var k=r.add(B,F,B);r.add(k,V,k),r.pack(k,m.st.values,2*f)}}}function Q(e,t,i,r,n,o){var a=e.position.values.length/3;if(n!==-1){var s=r[n],l=i[s];return l===-1?(i[s]=a,e.position.values.push(o.x,o.y,o.z),t.push(a),a):(t.push(l),l)}return e.position.values.push(o.x,o.y,o.z),t.push(a),a}function J(e){var t,i,r,o,a,s=e.geometry,l=s.attributes,c=l.position.values,h=u(l.normal)?l.normal.values:void 0,d=u(l.bitangent)?l.bitangent.values:void 0,p=u(l.tangent)?l.tangent.values:void 0,m=u(l.st)?l.st.values:void 0,f=u(l.extrudeDirection)?l.extrudeDirection.values:void 0,_=s.indices,g=X(s),v=X(s),y=[];y.length=c.length/3;var C=[];for(C.length=c.length/3,a=0;a<y.length;++a)y[a]=-1,C[a]=-1;var w=_.length;for(a=0;a<w;a+=3){var S=_[a],E=_[a+1],b=_[a+2],T=n.fromArray(c,3*S),x=n.fromArray(c,3*E),A=n.fromArray(c,3*b),P=j(T,x,A);if(u(P)&&P.positions.length>3)for(var D=P.positions,M=P.indices,I=M.length,R=0;R<I;++R){var O=M[R],N=D[O];N.y<0?(t=v.attributes,i=v.indices,r=y):(t=g.attributes,i=g.indices,r=C),o=Q(t,i,r,_,O<3?a+O:-1,N),K(S,E,b,N,c,h,p,d,m,f,t,o)}else u(P)&&(T=P.positions[0],x=P.positions[1],A=P.positions[2]),T.y<0?(t=v.attributes,i=v.indices,r=y):(t=g.attributes,i=g.indices,r=C),o=Q(t,i,r,_,a,T),K(S,E,b,T,c,h,p,d,m,f,t,o),o=Q(t,i,r,_,a+1,x),K(S,E,b,x,c,h,p,d,m,f,t,o),o=Q(t,i,r,_,a+2,A),K(S,E,b,A,c,h,p,d,m,f,t,o)}Z(e,v,g)}function $(e){var t,i=e.geometry,r=i.attributes,o=r.position.values,a=i.indices,s=X(i),l=X(i),c=a.length,h=[];h.length=o.length/3;var d=[];for(d.length=o.length/3,t=0;t<h.length;++t)h[t]=-1,d[t]=-1;for(t=0;t<c;t+=2){var p=a[t],m=a[t+1],f=n.fromArray(o,3*p,Pe),_=n.fromArray(o,3*m,De);Math.abs(f.y)<C.EPSILON6&&(f.y<0?f.y=-C.EPSILON6:f.y=C.EPSILON6),Math.abs(_.y)<C.EPSILON6&&(_.y<0?_.y=-C.EPSILON6:_.y=C.EPSILON6);var g=s.attributes,v=s.indices,w=d,S=l.attributes,E=l.indices,b=h,T=y.lineSegmentPlane(f,_,Le,Me);if(u(T)){var x=n.multiplyByScalar(n.UNIT_Y,5*C.EPSILON9,Be);f.y<0&&(n.negate(x,x),g=l.attributes,v=l.indices,w=h,S=s.attributes,E=s.indices,b=d);var A=n.add(T,x,Fe);Q(g,v,w,a,t,f),Q(g,v,w,a,-1,A),n.negate(x,x),n.add(T,x,A),Q(S,E,b,a,-1,A),Q(S,E,b,a,t+1,_)}else{var P,D,M;f.y<0?(P=l.attributes,D=l.indices,M=h):(P=s.attributes,D=s.indices,M=d),Q(P,D,M,a,t,f),Q(P,D,M,a,t+1,_)}}Z(e,l,s)}function ee(e){for(var t=e.attributes,i=t.position.values,r=t.prevPosition.values,o=t.nextPosition.values,a=i.length,s=0;s<a;s+=3){var l=n.unpack(i,s,ze);if(!(l.x>0)){var u=n.unpack(r,s,Ue);(l.y<0&&u.y>0||l.y>0&&u.y<0)&&(s-3>0?(r[s]=i[s-3],r[s+1]=i[s-2],r[s+2]=i[s-1]):n.pack(l,r,s));var c=n.unpack(o,s,Ge);(l.y<0&&c.y>0||l.y>0&&c.y<0)&&(s+3<a?(o[s]=i[s+3],o[s+1]=i[s+4],o[s+2]=i[s+5]):n.pack(l,o,s))}}}function te(e){var t,i,a,s=e.geometry,l=s.attributes,c=l.position.values,h=l.prevPosition.values,d=l.nextPosition.values,p=l.expandAndWidth.values,m=u(l.st)?l.st.values:void 0,f=u(l.color)?l.color.values:void 0,_=X(s),g=X(s),v=!1,w=c.length/3;for(t=0;t<w;t+=4){var S=t,E=t+2,b=n.fromArray(c,3*S,ze),T=n.fromArray(c,3*E,Ue);if(Math.abs(b.y)<Xe)for(b.y=Xe*(T.y<0?-1:1),c[3*t+1]=b.y,c[3*(t+1)+1]=b.y,i=3*S;i<3*S+12;i+=3)h[i]=c[3*t],h[i+1]=c[3*t+1],h[i+2]=c[3*t+2];if(Math.abs(T.y)<Xe)for(T.y=Xe*(b.y<0?-1:1),c[3*(t+2)+1]=T.y,c[3*(t+3)+1]=T.y,i=3*S;i<3*S+12;i+=3)d[i]=c[3*(t+2)],d[i+1]=c[3*(t+2)+1],d[i+2]=c[3*(t+2)+2];var x=_.attributes,A=_.indices,P=g.attributes,D=g.indices,M=y.lineSegmentPlane(b,T,Le,We);if(u(M)){v=!0;var I=n.multiplyByScalar(n.UNIT_Y,Ye,He);b.y<0&&(n.negate(I,I),x=g.attributes,A=g.indices,P=_.attributes,D=_.indices);var R=n.add(M,I,qe);x.position.values.push(b.x,b.y,b.z,b.x,b.y,b.z),x.position.values.push(R.x,R.y,R.z),x.position.values.push(R.x,R.y,R.z),x.prevPosition.values.push(h[3*S],h[3*S+1],h[3*S+2]),x.prevPosition.values.push(h[3*S+3],h[3*S+4],h[3*S+5]),x.prevPosition.values.push(b.x,b.y,b.z,b.x,b.y,b.z),x.nextPosition.values.push(R.x,R.y,R.z),x.nextPosition.values.push(R.x,R.y,R.z),x.nextPosition.values.push(R.x,R.y,R.z),x.nextPosition.values.push(R.x,R.y,R.z),n.negate(I,I),n.add(M,I,R),P.position.values.push(R.x,R.y,R.z),P.position.values.push(R.x,R.y,R.z),P.position.values.push(T.x,T.y,T.z,T.x,T.y,T.z),P.prevPosition.values.push(R.x,R.y,R.z),P.prevPosition.values.push(R.x,R.y,R.z),P.prevPosition.values.push(R.x,R.y,R.z),P.prevPosition.values.push(R.x,R.y,R.z),P.nextPosition.values.push(T.x,T.y,T.z,T.x,T.y,T.z),P.nextPosition.values.push(d[3*E],d[3*E+1],d[3*E+2]),P.nextPosition.values.push(d[3*E+3],d[3*E+4],d[3*E+5]);var O=r.fromArray(p,2*S,Ve),N=Math.abs(O.y);x.expandAndWidth.values.push(-1,N,1,N),x.expandAndWidth.values.push(-1,-N,1,-N),P.expandAndWidth.values.push(-1,N,1,N),P.expandAndWidth.values.push(-1,-N,1,-N);var L=n.magnitudeSquared(n.subtract(M,b,Ge));if(L/=n.magnitudeSquared(n.subtract(T,b,Ge)),u(f)){var B=o.fromArray(f,4*S,je),F=o.fromArray(f,4*E,je),V=C.lerp(B.x,F.x,L),k=C.lerp(B.y,F.y,L),z=C.lerp(B.z,F.z,L),U=C.lerp(B.w,F.w,L);for(i=4*S;i<4*S+8;++i)x.color.values.push(f[i]);for(x.color.values.push(V,k,z,U),x.color.values.push(V,k,z,U),P.color.values.push(V,k,z,U),P.color.values.push(V,k,z,U),i=4*E;i<4*E+8;++i)P.color.values.push(f[i])}if(u(m)){var G=r.fromArray(m,2*S,Ve),W=r.fromArray(m,2*(t+3),ke),H=C.lerp(G.x,W.x,L);for(i=2*S;i<2*S+4;++i)x.st.values.push(m[i]);for(x.st.values.push(H,G.y),x.st.values.push(H,W.y),P.st.values.push(H,G.y),P.st.values.push(H,W.y),i=2*E;i<2*E+4;++i)P.st.values.push(m[i])}a=x.position.values.length/3-4,A.push(a,a+2,a+1),A.push(a+1,a+2,a+3),a=P.position.values.length/3-4,D.push(a,a+2,a+1),D.push(a+1,a+2,a+3)}else{var q,j;for(b.y<0?(q=g.attributes,j=g.indices):(q=_.attributes,j=_.indices),q.position.values.push(b.x,b.y,b.z),q.position.values.push(b.x,b.y,b.z),q.position.values.push(T.x,T.y,T.z),q.position.values.push(T.x,T.y,T.z),i=3*t;i<3*t+12;++i)q.prevPosition.values.push(h[i]),q.nextPosition.values.push(d[i]);for(i=2*t;i<2*t+8;++i)q.expandAndWidth.values.push(p[i]),u(m)&&q.st.values.push(m[i]);if(u(f))for(i=4*t;i<4*t+16;++i)q.color.values.push(f[i]);a=q.position.values.length/3-4,j.push(a,a+2,a+1),j.push(a+1,a+2,a+3)}}v&&(ee(g),ee(_)),Z(e,g,_)}var ie={};ie.toWireframe=function(e){var t=e.indices;if(u(t)){switch(e.primitiveType){case b.TRIANGLES:e.indices=A(t);break;case b.TRIANGLE_STRIP:e.indices=P(t);break;case b.TRIANGLE_FAN:e.indices=D(t)}e.primitiveType=b.LINES}return e},ie.createLineSegmentsForVectors=function(e,t,r){t=l(t,"normal"),r=l(r,1e4);for(var n=e.attributes.position.values,o=e.attributes[t].values,a=n.length,c=new Float64Array(2*a),h=0,d=0;d<a;d+=3)c[h++]=n[d],c[h++]=n[d+1],c[h++]=n[d+2],c[h++]=n[d]+o[d]*r,c[h++]=n[d+1]+o[d+1]*r,c[h++]=n[d+2]+o[d+2]*r;var p,_=e.boundingSphere;return u(_)&&(p=new i(_.center,_.radius+r)),new m({attributes:{position:new f({componentDatatype:s.DOUBLE,componentsPerAttribute:3,values:c})},primitiveType:b.LINES,boundingSphere:p})},ie.createAttributeLocations=function(e){var t,i=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],r=e.attributes,n={},o=0,a=i.length;for(t=0;t<a;++t){var s=i[t];u(r[s])&&(n[s]=o++)}for(var l in r)r.hasOwnProperty(l)&&!u(n[l])&&(n[l]=o++);return n},ie.reorderForPreVertexCache=function(e){var t=m.computeNumberOfVertices(e),i=e.indices;if(u(i)){for(var r=new Int32Array(t),n=0;n<t;n++)r[n]=-1;for(var o,a=i,l=a.length,c=g.createTypedArray(t,l),h=0,d=0,p=0;h<l;)o=r[a[h]],o!==-1?c[d]=o:(o=a[h],r[o]=p,c[d]=p,++p),++h,++d;e.indices=c;var f=e.attributes;for(var _ in f)if(f.hasOwnProperty(_)&&u(f[_])&&u(f[_].values)){for(var v=f[_],y=v.values,C=0,w=v.componentsPerAttribute,S=s.createTypedArray(v.componentDatatype,p*w);C<t;){var E=r[C];if(E!==-1)for(n=0;n<w;n++)S[w*E+n]=y[w*C+n];++C}v.values=S}}return e},ie.reorderForPostVertexCache=function(e,t){var i=e.indices;if(e.primitiveType===b.TRIANGLES&&u(i)){for(var r=i.length,n=0,o=0;o<r;o++)i[o]>n&&(n=i[o]);e.indices=T.tipsify({indices:i,maximumIndex:n,cacheSize:t})}return e},ie.fitToUnsignedShortIndices=function(e){var t=[],i=m.computeNumberOfVertices(e);if(u(e.indices)&&i>=C.SIXTY_FOUR_KILOBYTES){var r,n=[],o=[],a=0,s=M(e.attributes),l=e.indices,c=l.length;e.primitiveType===b.TRIANGLES?r=3:e.primitiveType===b.LINES?r=2:e.primitiveType===b.POINTS&&(r=1);for(var h=0;h<c;h+=r){for(var d=0;d<r;++d){var p=l[h+d],f=n[p];u(f)||(f=a++,n[p]=f,I(s,e.attributes,p)),o.push(f)}a+r>=C.SIXTY_FOUR_KILOBYTES&&(t.push(new m({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),n=[],o=[],a=0,s=M(e.attributes))}0!==o.length&&t.push(new m({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var re=new n,ne=new a;ie.projectTo2D=function(e,t,i,r,o){var a=e.attributes[t];o=u(o)?o:new p;for(var l=o.ellipsoid,c=a.values,h=new Float64Array(c.length),d=0,m=0;m<c.length;m+=3){var _=n.fromArray(c,m,re),g=l.cartesianToCartographic(_,ne),v=o.project(g,re);h[d++]=v.x,h[d++]=v.y,h[d++]=v.z}return e.attributes[i]=a,e.attributes[r]=new f({componentDatatype:s.DOUBLE,componentsPerAttribute:3,values:h}),delete e.attributes[t],e};var oe={high:0,low:0};ie.encodeAttribute=function(e,t,i,r){for(var n=e.attributes[t],o=n.values,a=o.length,l=new Float32Array(a),u=new Float32Array(a),c=0;c<a;++c)d.encode(o[c],oe),l[c]=oe.high,u[c]=oe.low;var h=n.componentsPerAttribute;return e.attributes[i]=new f({componentDatatype:s.FLOAT,componentsPerAttribute:h,values:l}),e.attributes[r]=new f({componentDatatype:s.FLOAT,componentsPerAttribute:h,values:u}),delete e.attributes[t],e};var ae=new n,se=new S,le=new w;ie.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(S.equals(t,S.IDENTITY))return e;var r=e.geometry.attributes;R(t,r.position),R(t,r.prevPosition),R(t,r.nextPosition),(u(r.normal)||u(r.tangent)||u(r.bitangent))&&(S.inverse(t,se),S.transpose(se,se),S.getRotation(se,le),O(le,r.normal),O(le,r.tangent),O(le,r.bitangent));var n=e.geometry.boundingSphere;return u(n)&&(e.geometry.boundingSphere=i.transform(n,t,n)),e.modelMatrix=S.clone(S.IDENTITY),e};var ue=new n;ie.combineInstances=function(e){for(var t=[],i=[],r=e.length,n=0;n<r;++n){var o=e[n];u(o.geometry)?t.push(o):u(o.westHemisphereGeometry)&&u(o.eastHemisphereGeometry)&&i.push(o)}var a=[];return t.length>0&&a.push(L(t,"geometry")),i.length>0&&(a.push(L(i,"westHemisphereGeometry")),a.push(L(i,"eastHemisphereGeometry"))),a};var ce=new n,he=new n,de=new n,pe=new n;ie.computeNormal=function(e){for(var t=e.indices,i=e.attributes,r=i.position.values,o=i.position.values.length/3,a=t.length,l=new Array(o),u=new Array(a/3),c=new Array(a),h=0;h<o;h++)l[h]={indexOffset:0,count:0,currentCount:0};var d=0;for(h=0;h<a;h+=3){var p=t[h],m=t[h+1],_=t[h+2],g=3*p,v=3*m,y=3*_;he.x=r[g],he.y=r[g+1],he.z=r[g+2],de.x=r[v],de.y=r[v+1],de.z=r[v+2],pe.x=r[y],pe.y=r[y+1],pe.z=r[y+2], +l[p].count++,l[m].count++,l[_].count++,n.subtract(de,he,de),n.subtract(pe,he,pe),u[d]=n.cross(de,pe,new n),d++}var C=0;for(h=0;h<o;h++)l[h].indexOffset+=C,C+=l[h].count;d=0;var w;for(h=0;h<a;h+=3){w=l[t[h]];var S=w.indexOffset+w.currentCount;c[S]=d,w.currentCount++,w=l[t[h+1]],S=w.indexOffset+w.currentCount,c[S]=d,w.currentCount++,w=l[t[h+2]],S=w.indexOffset+w.currentCount,c[S]=d,w.currentCount++,d++}var E=new Float32Array(3*o);for(h=0;h<o;h++){var b=3*h;if(w=l[h],w.count>0){for(n.clone(n.ZERO,ce),d=0;d<w.count;d++)n.add(ce,u[c[w.indexOffset+d]],ce);n.normalize(ce,ce),E[b]=ce.x,E[b+1]=ce.y,E[b+2]=ce.z}else E[b]=0,E[b+1]=0,E[b+2]=1}return e.attributes.normal=new f({componentDatatype:s.FLOAT,componentsPerAttribute:3,values:E}),e};var me=new n,fe=new n,_e=new n;ie.computeTangentAndBitangent=function(e){for(var t=(e.attributes,e.indices),i=e.attributes.position.values,r=e.attributes.normal.values,o=e.attributes.st.values,a=e.attributes.position.values.length/3,l=t.length,u=new Array(3*a),c=0;c<u.length;c++)u[c]=0;var h,d,p;for(c=0;c<l;c+=3){var m=t[c],_=t[c+1],g=t[c+2];h=3*m,d=3*_,p=3*g;var v=2*m,y=2*_,C=2*g,w=i[h],S=i[h+1],E=i[h+2],b=o[v],T=o[v+1],x=o[y+1]-T,A=o[C+1]-T,P=1/((o[y]-b)*A-(o[C]-b)*x),D=(A*(i[d]-w)-x*(i[p]-w))*P,M=(A*(i[d+1]-S)-x*(i[p+1]-S))*P,I=(A*(i[d+2]-E)-x*(i[p+2]-E))*P;u[h]+=D,u[h+1]+=M,u[h+2]+=I,u[d]+=D,u[d+1]+=M,u[d+2]+=I,u[p]+=D,u[p+1]+=M,u[p+2]+=I}var R=new Float32Array(3*a),O=new Float32Array(3*a);for(c=0;c<a;c++){h=3*c,d=h+1,p=h+2;var N=n.fromArray(r,h,me),L=n.fromArray(u,h,_e),B=n.dot(N,L);n.multiplyByScalar(N,B,fe),n.normalize(n.subtract(L,fe,L),L),R[h]=L.x,R[d]=L.y,R[p]=L.z,n.normalize(n.cross(N,L,L),L),O[h]=L.x,O[d]=L.y,O[p]=L.z}return e.attributes.tangent=new f({componentDatatype:s.FLOAT,componentsPerAttribute:3,values:R}),e.attributes.bitangent=new f({componentDatatype:s.FLOAT,componentsPerAttribute:3,values:O}),e},ie.computeBinormalAndTangent=function(e){return c("computeBinormalAndTangent","computeBinormalAndTangent was deprecated in 1.30. It will be removed in 1.31. Use a computeTangentAndBitangent."),ie.computeTangentAndBitangent(e),e.attributes.binormal=e.attributes.bitangent,e};var ge=new r,ve=new n,ye=new n,Ce=new n,we=new r;ie.compressVertices=function(t){var i,o,a=t.attributes.extrudeDirection;if(u(a)){var l=a.values;o=l.length/3;var c=new Float32Array(2*o),h=0;for(i=0;i<o;++i)n.fromArray(l,3*i,ve),n.equals(ve,n.ZERO)?h+=2:(we=e.octEncodeInRange(ve,65535,we),c[h++]=we.x,c[h++]=we.y);return t.attributes.compressedAttributes=new f({componentDatatype:s.FLOAT,componentsPerAttribute:2,values:c}),delete t.attributes.extrudeDirection,t}var d=t.attributes.normal,p=t.attributes.st,m=u(d),_=u(p);if(!m&&!_)return t;var g,v,y,C,w=t.attributes.tangent,S=t.attributes.bitangent,E=u(w),b=u(S);m&&(g=d.values),_&&(v=p.values),E&&(y=w.values),b&&(C=S.values);var T=m?g.length:v.length,x=m?3:2;o=T/x;var A=o,P=_&&m?2:1;P+=E||b?1:0,A*=P;var D=new Float32Array(A),M=0;for(i=0;i<o;++i){_&&(r.fromArray(v,2*i,ge),D[M++]=e.compressTextureCoordinates(ge));var I=3*i;m&&u(y)&&u(C)?(n.fromArray(g,I,ve),n.fromArray(y,I,ye),n.fromArray(C,I,Ce),e.octPack(ve,ye,Ce,ge),D[M++]=ge.x,D[M++]=ge.y):(m&&(n.fromArray(g,I,ve),D[M++]=e.octEncodeFloat(ve)),E&&(n.fromArray(y,I,ve),D[M++]=e.octEncodeFloat(ve)),b&&(n.fromArray(C,I,ve),D[M++]=e.octEncodeFloat(ve)))}return t.attributes.compressedAttributes=new f({componentDatatype:s.FLOAT,componentsPerAttribute:P,values:D}),m&&delete t.attributes.normal,_&&delete t.attributes.st,b&&delete t.attributes.bitangent,E&&delete t.attributes.tangent,t};var Se=new n,Ee=new n,be=new n,Te=new n,xe=new n,Ae={positions:new Array(7),indices:new Array(9)},Pe=new n,De=new n,Me=new n,Ie=new n,Re=new r,Oe=new r,Ne=new r,Le=E.fromPointNormal(n.ZERO,n.UNIT_Y),Be=new n,Fe=new n,Ve=new r,ke=new r,ze=new n,Ue=new n,Ge=new n,We=new n,He=new n,qe=new n,je=new o,Ye=5*C.EPSILON9,Xe=C.EPSILON6;return ie.splitLongitude=function(e){var t=e.geometry,r=t.boundingSphere;if(u(r)){var n=r.center.x-r.radius;if(n>0||i.intersectPlane(r,E.ORIGIN_ZX_PLANE)!==v.INTERSECTING)return e}if(t.geometryType!==_.NONE)switch(t.geometryType){case _.POLYLINES:te(e);break;case _.TRIANGLES:J(e);break;case _.LINES:$(e)}else G(t),t.primitiveType===b.TRIANGLES?J(e):t.primitiveType===b.LINES&&$(e);return e},ie}),i("Core/EllipseGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError","./EllipseGeometryLibrary","./Ellipsoid","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix3","./Matrix4","./PrimitiveType","./Quaternion","./Rectangle","./Transforms","./VertexFormat"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T){"use strict";function x(e,r,o){var a=r.vertexFormat,s=r.center,l=r.semiMajorAxis,c=r.semiMinorAxis,d=r.ellipsoid,f=r.stRotation,_=o?e.length/3*2:e.length/3,g=r.shadowVolume,v=a.st?new Float32Array(2*_):void 0,C=a.normal?new Float32Array(3*_):void 0,w=a.tangent?new Float32Array(3*_):void 0,E=a.bitangent?new Float32Array(3*_):void 0,b=g?new Float32Array(3*_):void 0,T=0,x=U,A=G,P=W,D=new h(d),M=D.project(d.cartesianToCartographic(s,H),q),I=d.scaleToGeodeticSurface(s,N);d.geodeticSurfaceNormal(I,I);for(var R=S.fromAxisAngle(I,f,z),O=y.fromQuaternion(R,k),F=t.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,j),X=t.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Y),Z=e.length,K=o?Z:0,Q=K/3*2,J=0;J<Z;J+=3){var $=J+1,ee=J+2,te=i.fromArray(e,J,N);if(a.st){var ie=y.multiplyByVector(O,te,L),re=D.project(d.cartesianToCartographic(ie,H),B);i.subtract(re,M,re),V.x=(re.x+l)/(2*l),V.y=(re.y+c)/(2*c),F.x=Math.min(V.x,F.x),F.y=Math.min(V.y,F.y),X.x=Math.max(V.x,X.x),X.y=Math.max(V.y,X.y),o&&(v[T+Q]=V.x,v[T+1+Q]=V.y),v[T++]=V.x,v[T++]=V.y}(a.normal||a.tangent||a.bitangent||g)&&(x=d.geodeticSurfaceNormal(te,x),g&&(b[J+K]=-x.x,b[$+K]=-x.y,b[ee+K]=-x.z),(a.normal||a.tangent||a.bitangent)&&((a.tangent||a.bitangent)&&(A=i.normalize(i.cross(i.UNIT_Z,x,A),A),y.multiplyByVector(O,A,A)),a.normal&&(C[J]=x.x,C[$]=x.y,C[ee]=x.z,o&&(C[J+K]=-x.x,C[$+K]=-x.y,C[ee+K]=-x.z)),a.tangent&&(w[J]=A.x,w[$]=A.y,w[ee]=A.z,o&&(w[J+K]=-A.x,w[$+K]=-A.y,w[ee+K]=-A.z)),a.bitangent&&(P=i.normalize(i.cross(x,A,P),P),E[J]=P.x,E[$]=P.y,E[ee]=P.z,o&&(E[J+K]=P.x,E[$+K]=P.y,E[ee+K]=P.z))))}if(a.st){Z=v.length;for(var ne=0;ne<Z;ne+=2)v[ne]=(v[ne]-F.x)/(X.x-F.x),v[ne+1]=(v[ne+1]-F.y)/(X.y-F.y)}var oe=new m;if(a.position){var ae=u.raisePositionsToHeight(e,r,o);oe.position=new p({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:ae})}return a.st&&(oe.st=new p({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:v})),a.normal&&(oe.normal=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:C})),a.tangent&&(oe.tangent=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:w})),a.bitangent&&(oe.bitangent=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:E})),g&&(oe.extrudeDirection=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:b})),oe}function A(e){var t,i,r,n,o,a=new Array(12*(e*(e+1))-6),s=0;for(t=0,r=1,n=0;n<3;n++)a[s++]=r++,a[s++]=t,a[s++]=r;for(n=2;n<e+1;++n){for(r=n*(n+1)-1,t=(n-1)*n-1,a[s++]=r++,a[s++]=t,a[s++]=r,i=2*n,o=0;o<i-1;++o)a[s++]=r,a[s++]=t++,a[s++]=t,a[s++]=r++,a[s++]=t,a[s++]=r;a[s++]=r++,a[s++]=t,a[s++]=r}for(i=2*e,++r,++t,n=0;n<i-1;++n)a[s++]=r,a[s++]=t++,a[s++]=t,a[s++]=r++,a[s++]=t,a[s++]=r;for(a[s++]=r,a[s++]=t++,a[s++]=t,a[s++]=r++,a[s++]=t++,a[s++]=t,++t,n=e-1;n>1;--n){for(a[s++]=t++,a[s++]=t,a[s++]=r,i=2*n,o=0;o<i-1;++o)a[s++]=r,a[s++]=t++,a[s++]=t,a[s++]=r++,a[s++]=t,a[s++]=r;a[s++]=t++,a[s++]=t++,a[s++]=r++}for(n=0;n<3;n++)a[s++]=t++,a[s++]=t,a[s++]=r;return a}function P(t){var r=t.center;X=i.multiplyByScalar(t.ellipsoid.geodeticSurfaceNormal(r,X),t.height,X),X=i.add(r,X,X);var n=new e(X,t.semiMajorAxis),o=u.computeEllipsePositions(t,!0,!1),a=o.positions,s=o.numPts,l=x(a,t,!1),c=A(s);return c=g.createTypedArray(a.length/3,c),{boundingSphere:n,attributes:l,indices:c}}function D(e,r){var o=r.vertexFormat,a=r.center,s=r.semiMajorAxis,l=r.semiMinorAxis,u=r.ellipsoid,c=r.height,d=r.extrudedHeight,f=r.stRotation,_=e.length/3*2,g=new Float64Array(3*_),v=o.st?new Float32Array(2*_):void 0,C=o.normal?new Float32Array(3*_):void 0,w=o.tangent?new Float32Array(3*_):void 0,E=o.bitangent?new Float32Array(3*_):void 0,b=r.shadowVolume,T=b?new Float32Array(3*_):void 0,x=0,A=U,P=G,D=W,M=new h(u),I=M.project(u.cartesianToCartographic(a,H),q),R=u.scaleToGeodeticSurface(a,N);u.geodeticSurfaceNormal(R,R);for(var O=S.fromAxisAngle(R,f,z),X=y.fromQuaternion(O,k),Z=t.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,j),K=t.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Y),Q=e.length,J=Q/3*2,$=0;$<Q;$+=3){var ee,te=$+1,ie=$+2,re=i.fromArray(e,$,N);if(o.st){var ne=y.multiplyByVector(X,re,L),oe=M.project(u.cartesianToCartographic(ne,H),B);i.subtract(oe,I,oe),V.x=(oe.x+s)/(2*s),V.y=(oe.y+l)/(2*l),Z.x=Math.min(V.x,Z.x),Z.y=Math.min(V.y,Z.y),K.x=Math.max(V.x,K.x),K.y=Math.max(V.y,K.y),v[x+J]=V.x,v[x+1+J]=V.y,v[x++]=V.x,v[x++]=V.y}re=u.scaleToGeodeticSurface(re,re),ee=i.clone(re,L),A=u.geodeticSurfaceNormal(re,A),b&&(T[$+Q]=-A.x,T[te+Q]=-A.y,T[ie+Q]=-A.z);var ae=i.multiplyByScalar(A,c,F);if(re=i.add(re,ae,re),ae=i.multiplyByScalar(A,d,ae),ee=i.add(ee,ae,ee),o.position&&(g[$+Q]=ee.x,g[te+Q]=ee.y,g[ie+Q]=ee.z,g[$]=re.x,g[te]=re.y,g[ie]=re.z),o.normal||o.tangent||o.bitangent){D=i.clone(A,D);var se=i.fromArray(e,($+3)%Q,F);i.subtract(se,re,se);var le=i.subtract(ee,re,B);A=i.normalize(i.cross(le,se,A),A),o.normal&&(C[$]=A.x,C[te]=A.y,C[ie]=A.z,C[$+Q]=A.x,C[te+Q]=A.y,C[ie+Q]=A.z),o.tangent&&(P=i.normalize(i.cross(D,A,P),P),w[$]=P.x,w[te]=P.y,w[ie]=P.z,w[$+Q]=P.x,w[$+1+Q]=P.y,w[$+2+Q]=P.z),o.bitangent&&(E[$]=D.x,E[te]=D.y,E[ie]=D.z,E[$+Q]=D.x,E[te+Q]=D.y,E[ie+Q]=D.z)}}if(o.st){Q=v.length;for(var ue=0;ue<Q;ue+=2)v[ue]=(v[ue]-Z.x)/(K.x-Z.x),v[ue+1]=(v[ue+1]-Z.y)/(K.y-Z.y)}var ce=new m;return o.position&&(ce.position=new p({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:g})),o.st&&(ce.st=new p({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:v})),o.normal&&(ce.normal=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:C})),o.tangent&&(ce.tangent=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:w})),o.bitangent&&(ce.bitangent=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:E})),b&&(ce.extrudeDirection=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:T})),ce}function M(e){for(var t=e.length/3,i=g.createTypedArray(t,6*t),r=0,n=0;n<t;n++){var o=n,a=n+t,s=(o+1)%t,l=s+t;i[r++]=o,i[r++]=a,i[r++]=s,i[r++]=s,i[r++]=a,i[r++]=l}return i}function I(t){var r=t.center,n=t.ellipsoid,o=t.semiMajorAxis,a=i.multiplyByScalar(n.geodeticSurfaceNormal(r,N),t.height,N);Z.center=i.add(r,a,Z.center),Z.radius=o,a=i.multiplyByScalar(n.geodeticSurfaceNormal(r,a),t.extrudedHeight,a),K.center=i.add(r,a,K.center),K.radius=o;var s=u.computeEllipsePositions(t,!0,!0),l=s.positions,c=s.numPts,h=s.outerPositions,p=e.union(Z,K),m=x(l,t,!0),v=A(c),y=v.length;v.length=2*y;for(var C=l.length/3,S=0;S<y;S+=3)v[S+y]=v[S+2]+C,v[S+1+y]=v[S+1]+C,v[S+2+y]=v[S]+C;var E=g.createTypedArray(2*C/3,v),b=new d({attributes:m,indices:E,primitiveType:w.TRIANGLES}),T=D(h,t);v=M(h);var P=g.createTypedArray(2*h.length/3,v),I=new d({attributes:T,indices:P,primitiveType:w.TRIANGLES}),R=_.combineInstances([new f({geometry:b}),new f({geometry:I})]);return{boundingSphere:p,attributes:R[0].attributes,indices:R[0].indices}}function R(e,t,r,n,o){b.eastNorthUpToFixedFrame(e,t,Q),C.inverseTransformation(Q,J);for(var a=0;a<4;++a)i.clone(i.ZERO,ee[a]);for(ee[0].x+=r,ee[1].x-=r,ee[2].y+=n,ee[3].y-=n,y.fromRotationZ(o,$),a=0;a<4;++a)y.multiplyByVector($,ee[a],ee[a]),C.multiplyByPoint(Q,ee[a],ee[a]),t.cartesianToCartographic(ee[a],te[a]);return E.fromCartographicArray(te)}function O(e){e=o(e,o.EMPTY_OBJECT);var t=e.center,r=o(e.ellipsoid,c.WGS84),n=e.semiMajorAxis,s=e.semiMinorAxis,l=o(e.granularity,v.RADIANS_PER_DEGREE),u=o(e.height,0),h=e.extrudedHeight,d=a(h)&&Math.abs(u-h)>1,p=o(e.vertexFormat,T.DEFAULT);this._center=i.clone(t),this._semiMajorAxis=n,this._semiMinorAxis=s,this._ellipsoid=c.clone(r),this._rotation=o(e.rotation,0),this._stRotation=o(e.stRotation,0),this._height=u,this._granularity=l,this._vertexFormat=T.clone(p),this._extrudedHeight=o(h,u),this._extrude=d,this._shadowVolume=o(e.shadowVolume,!1),this._workerName="createEllipseGeometry",this._rectangle=R(this._center,this._ellipsoid,n,s,this._rotation)}var N=new i,L=new i,B=new i,F=new i,V=new t,k=new y,z=new S,U=new i,G=new i,W=new i,H=new r,q=new i,j=new t,Y=new t,X=new i,Z=new e,K=new e,Q=new C,J=new C,$=new y,ee=[new i,new i,new i,new i],te=[new r,new r,new r,new r];O.packedLength=i.packedLength+c.packedLength+T.packedLength+E.packedLength+9,O.pack=function(e,t,r){return r=o(r,0),i.pack(e._center,t,r),r+=i.packedLength,c.pack(e._ellipsoid,t,r),r+=c.packedLength,T.pack(e._vertexFormat,t,r),r+=T.packedLength,E.pack(e._rectangle,t,r),r+=E.packedLength,t[r++]=e._semiMajorAxis,t[r++]=e._semiMinorAxis,t[r++]=e._rotation,t[r++]=e._stRotation,t[r++]=e._height,t[r++]=e._granularity,t[r++]=e._extrudedHeight,t[r++]=e._extrude?1:0,t[r]=e._shadowVolume?1:0,t};var ie=new i,re=new c,ne=new T,oe=new E,ae={center:ie,ellipsoid:re,vertexFormat:ne,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,shadowVolume:void 0};return O.unpack=function(e,t,r){t=o(t,0);var n=i.unpack(e,t,ie);t+=i.packedLength;var s=c.unpack(e,t,re);t+=c.packedLength;var l=T.unpack(e,t,ne);t+=T.packedLength;var u=E.unpack(e,t,oe);t+=E.packedLength;var h=e[t++],d=e[t++],p=e[t++],m=e[t++],f=e[t++],_=e[t++],g=e[t++],v=1===e[t++],y=1===e[t];return a(r)?(r._center=i.clone(n,r._center),r._ellipsoid=c.clone(s,r._ellipsoid),r._vertexFormat=T.clone(l,r._vertexFormat),r._semiMajorAxis=h,r._semiMinorAxis=d,r._rotation=p,r._stRotation=m,r._height=f,r._granularity=_,r._extrudedHeight=g,r._extrude=v,r._shadowVolume=y,r._rectangle=E.clone(u),r):(ae.height=f,ae.extrudedHeight=g,ae.granularity=_,ae.stRotation=m,ae.rotation=p,ae.semiMajorAxis=h,ae.semiMinorAxis=d,ae.shadowVolume=y,new O(ae))},O.createGeometry=function(e){if(!(e._semiMajorAxis<=0||e._semiMinorAxis<=0)){e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);var t,i={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:e._height,extrudedHeight:e._extrudedHeight,granularity:e._granularity,vertexFormat:e._vertexFormat,stRotation:e._stRotation};return e._extrude?(i.extrudedHeight=Math.min(e._extrudedHeight,e._height),i.height=Math.max(e._extrudedHeight,e._height),i.shadowVolume=e._shadowVolume,t=I(i)):t=P(i),new d({attributes:t.attributes,indices:t.indices,primitiveType:w.TRIANGLES,boundingSphere:t.boundingSphere})}},O.createShadowVolume=function(e,t,i){var r=e._granularity,n=e._ellipsoid,o=t(r,n),a=i(r,n);return new O({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:n,rotation:e._rotation,stRotation:e._stRotation,granularity:r,extrudedHeight:o,height:a,vertexFormat:T.POSITION_ONLY,shadowVolume:!0})},s(O.prototype,{rectangle:{get:function(){return this._rectangle}}}),O}),i("Core/CircleGeometry",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./EllipseGeometry","./Ellipsoid","./VertexFormat"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(e){e=i(e,i.EMPTY_OBJECT);var t=e.radius,r={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,vertexFormat:e.vertexFormat,stRotation:e.stRotation,shadowVolume:e.shadowVolume};this._ellipseGeometry=new a(r),this._workerName="createCircleGeometry"}u.packedLength=a.packedLength,u.pack=function(e,t,i){return a.pack(e._ellipseGeometry,t,i)};var c=new a({center:new e,semiMajorAxis:1,semiMinorAxis:1}),h={center:new e,radius:void 0,ellipsoid:s.clone(s.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new l,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};return u.unpack=function(t,i,n){var o=a.unpack(t,i,c);return h.center=e.clone(o._center,h.center),h.ellipsoid=s.clone(o._ellipsoid,h.ellipsoid),h.height=o._height,h.extrudedHeight=o._extrudedHeight,h.granularity=o._granularity,h.vertexFormat=l.clone(o._vertexFormat,h.vertexFormat),h.stRotation=o._stRotation,h.shadowVolume=o._shadowVolume,r(n)?(h.semiMajorAxis=o._semiMajorAxis,h.semiMinorAxis=o._semiMinorAxis,n._ellipseGeometry=new a(h),n):(h.radius=o._semiMajorAxis,new u(h))},u.createGeometry=function(e){return a.createGeometry(e._ellipseGeometry)},u.createShadowVolume=function(e,t,i){var r=e._ellipseGeometry._granularity,n=e._ellipseGeometry._ellipsoid,o=t(r,n),a=i(r,n);return new u({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:n,stRotation:e._ellipseGeometry._stRotation,granularity:r,extrudedHeight:o,height:a,vertexFormat:l.POSITION_ONLY,shadowVolume:!0})},n(u.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}}}),u}),i("Core/EllipseOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EllipseGeometryLibrary","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p){"use strict";function m(r){var n=r.center;v=t.multiplyByScalar(r.ellipsoid.geodeticSurfaceNormal(n,v),r.height,v),v=t.add(n,v,v);for(var o=new e(v,r.semiMajorAxis),s=a.computeEllipsePositions(r,!1,!0).outerPositions,l=new c({position:new u({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:a.raisePositionsToHeight(s,r,!1)})}),d=s.length/3,p=h.createTypedArray(d,2*d),m=0,f=0;f<d;++f)p[m++]=f,p[m++]=(f+1)%d;return{boundingSphere:o,attributes:l,indices:p}}function f(n){var o=n.center,s=n.ellipsoid,l=n.semiMajorAxis,p=t.multiplyByScalar(s.geodeticSurfaceNormal(o,g),n.height,g);y.center=t.add(o,p,y.center),y.radius=l,p=t.multiplyByScalar(s.geodeticSurfaceNormal(o,p),n.extrudedHeight,p),C.center=t.add(o,p,C.center),C.radius=l;var m=a.computeEllipsePositions(n,!1,!0).outerPositions,f=new c({position:new u({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:a.raisePositionsToHeight(m,n,!0)})});m=f.position.values;var _=e.union(y,C),v=m.length/3,w=r(n.numberOfVerticalLines,16);w=d.clamp(w,0,v/2);var S=h.createTypedArray(v,2*v+2*w);v/=2;var E,b=0;for(E=0;E<v;++E)S[b++]=E,S[b++]=(E+1)%v,S[b++]=E+v,S[b++]=(E+1)%v+v;var T;if(w>0){var x=Math.min(w,v);T=Math.round(v/x);var A=Math.min(T*w,v);for(E=0;E<A;E+=T)S[b++]=E,S[b++]=E+v}return{boundingSphere:_,attributes:f,indices:S}}function _(e){e=r(e,r.EMPTY_OBJECT);var i=e.center,o=r(e.ellipsoid,s.WGS84),a=e.semiMajorAxis,l=e.semiMinorAxis,u=r(e.granularity,d.RADIANS_PER_DEGREE),c=r(e.height,0),h=e.extrudedHeight,p=n(h)&&Math.abs(c-h)>1;this._center=t.clone(i),this._semiMajorAxis=a,this._semiMinorAxis=l,this._ellipsoid=s.clone(o),this._rotation=r(e.rotation,0),this._height=c,this._granularity=u,this._extrudedHeight=h,this._extrude=p,this._numberOfVerticalLines=Math.max(r(e.numberOfVerticalLines,16),0),this._workerName="createEllipseOutlineGeometry"}var g=new t,v=new t,y=new e,C=new e;_.packedLength=t.packedLength+s.packedLength+9,_.pack=function(e,i,o){return o=r(o,0),t.pack(e._center,i,o),o+=t.packedLength,s.pack(e._ellipsoid,i,o),o+=s.packedLength,i[o++]=e._semiMajorAxis,i[o++]=e._semiMinorAxis,i[o++]=e._rotation,i[o++]=e._height,i[o++]=e._granularity,i[o++]=n(e._extrudedHeight)?1:0,i[o++]=r(e._extrudedHeight,0),i[o++]=e._extrude?1:0,i[o]=e._numberOfVerticalLines,i};var w=new t,S=new s,E={center:w,ellipsoid:S,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0};return _.unpack=function(e,i,o){i=r(i,0);var a=t.unpack(e,i,w);i+=t.packedLength;var l=s.unpack(e,i,S);i+=s.packedLength;var u=e[i++],c=e[i++],h=e[i++],d=e[i++],p=e[i++],m=e[i++],f=e[i++],g=1===e[i++],v=e[i];return n(o)?(o._center=t.clone(a,o._center),o._ellipsoid=s.clone(l,o._ellipsoid),o._semiMajorAxis=u,o._semiMinorAxis=c,o._rotation=h,o._height=d,o._granularity=p,o._extrudedHeight=m?f:void 0,o._extrude=g,o._numberOfVerticalLines=v,o):(E.height=d,E.extrudedHeight=m?f:void 0,E.granularity=p,E.rotation=h,E.semiMajorAxis=u,E.semiMinorAxis=c,E.numberOfVerticalLines=v,new _(E))},_.createGeometry=function(e){if(!(e._semiMajorAxis<=0||e._semiMinorAxis<=0)){e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);var t,i={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:e._height,extrudedHeight:e._extrudedHeight,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines};return e._extrude?(i.extrudedHeight=Math.min(e._extrudedHeight,e._height),i.height=Math.max(e._extrudedHeight,e._height),t=f(i)):t=m(i),new l({attributes:t.attributes,indices:t.indices,primitiveType:p.LINES,boundingSphere:t.boundingSphere})}},_}),i("Core/CircleOutlineGeometry",["./Cartesian3","./Check","./defaultValue","./defined","./DeveloperError","./EllipseOutlineGeometry","./Ellipsoid"],function(e,t,i,r,n,o,a){"use strict";function s(e){e=i(e,i.EMPTY_OBJECT);var t=e.radius,r={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,numberOfVerticalLines:e.numberOfVerticalLines};this._ellipseGeometry=new o(r),this._workerName="createCircleOutlineGeometry"}s.packedLength=o.packedLength,s.pack=function(e,t,i){return o.pack(e._ellipseGeometry,t,i)};var l=new o({center:new e,semiMajorAxis:1,semiMinorAxis:1}),u={center:new e,radius:void 0,ellipsoid:a.clone(a.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};return s.unpack=function(t,i,n){var c=o.unpack(t,i,l);return u.center=e.clone(c._center,u.center),u.ellipsoid=a.clone(c._ellipsoid,u.ellipsoid),u.height=c._height,u.extrudedHeight=c._extrudedHeight,u.granularity=c._granularity,u.numberOfVerticalLines=c._numberOfVerticalLines,r(n)?(u.semiMajorAxis=c._semiMajorAxis,u.semiMinorAxis=c._semiMinorAxis,n._ellipseGeometry=new o(u),n):(u.radius=c._semiMajorAxis,new s(u))},s.createGeometry=function(e){return o.createGeometry(e._ellipseGeometry)},s}),i("Core/ClockRange",["./freezeObject"],function(e){"use strict";var t={UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2};return e(t)}),i("Core/ClockStep",["./freezeObject"],function(e){"use strict";var t={TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2};return e(t)}),i("Core/getTimestamp",["./defined"],function(e){"use strict";var t;return t="undefined"!=typeof performance&&e(performance.now)?function(){return performance.now()}:function(){return Date.now()}}),i("Core/Clock",["./ClockRange","./ClockStep","./defaultValue","./defined","./defineProperties","./DeveloperError","./Event","./getTimestamp","./JulianDate"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(n){n=i(n,i.EMPTY_OBJECT);var o=n.currentTime,u=n.startTime,c=n.stopTime;o=r(o)?l.clone(o):r(u)?l.clone(u):r(c)?l.addDays(c,-1,new l):l.now(),u=r(u)?l.clone(u):l.clone(o),c=r(c)?l.clone(c):l.addDays(u,1,new l),this.startTime=u,this.stopTime=c,this.clockRange=i(n.clockRange,e.UNBOUNDED),this.canAnimate=i(n.canAnimate,!0),this.onTick=new a,this._currentTime=void 0,this._multiplier=void 0,this._clockStep=void 0,this._shouldAnimate=void 0,this._lastSystemTime=s(),this.currentTime=o,this.multiplier=i(n.multiplier,1),this.clockStep=i(n.clockStep,t.SYSTEM_CLOCK_MULTIPLIER),this.shouldAnimate=i(n.shouldAnimate,!0)}return n(u.prototype,{currentTime:{get:function(){return this._currentTime},set:function(e){l.equals(this._currentTime,e)||(this._clockStep===t.SYSTEM_CLOCK&&(this._clockStep=t.SYSTEM_CLOCK_MULTIPLIER),this._currentTime=e)}},multiplier:{get:function(){return this._multiplier},set:function(e){this._multiplier!==e&&(this._clockStep===t.SYSTEM_CLOCK&&(this._clockStep=t.SYSTEM_CLOCK_MULTIPLIER),this._multiplier=e)}},clockStep:{get:function(){return this._clockStep},set:function(e){e===t.SYSTEM_CLOCK&&(this._multiplier=1,this._shouldAnimate=!0,this._currentTime=l.now()),this._clockStep=e}},shouldAnimate:{get:function(){return this._shouldAnimate},set:function(e){this._shouldAnimate!==e&&(this._clockStep===t.SYSTEM_CLOCK&&(this._clockStep=t.SYSTEM_CLOCK_MULTIPLIER),this._shouldAnimate=e)}}}),u.prototype.tick=function(){var i=s(),r=l.clone(this._currentTime);if(this.canAnimate&&this._shouldAnimate){var n=this._clockStep;if(n===t.SYSTEM_CLOCK)r=l.now(r);else{var o=this._multiplier;if(n===t.TICK_DEPENDENT)r=l.addSeconds(r,o,r);else{var a=i-this._lastSystemTime;r=l.addSeconds(r,o*(a/1e3),r)}var u=this.clockRange,c=this.startTime,h=this.stopTime;if(u===e.CLAMPED)l.lessThan(r,c)?r=l.clone(c,r):l.greaterThan(r,h)&&(r=l.clone(h,r));else if(u===e.LOOP_STOP)for(l.lessThan(r,c)&&(r=l.clone(c,r));l.greaterThan(r,h);)r=l.addSeconds(c,l.secondsDifference(r,h),r)}}return this._currentTime=r,this._lastSystemTime=i,this.onTick.raiseEvent(this),r},u}),i("Core/Color",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math"],function(e,t,i,r,n,o){"use strict";function a(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),6*i<1?e+6*(t-e)*i:2*i<1?t:3*i<2?e+(t-e)*(2/3-i)*6:e}function s(t,i,r,n){this.red=e(t,1),this.green=e(i,1),this.blue=e(r,1),this.alpha=e(n,1)}s.fromCartesian4=function(e,i){return t(i)?(i.red=e.x,i.green=e.y,i.blue=e.z,i.alpha=e.w,i):new s(e.x,e.y,e.z,e.w)},s.fromBytes=function(i,r,n,o,a){return i=s.byteToFloat(e(i,255)),r=s.byteToFloat(e(r,255)),n=s.byteToFloat(e(n,255)),o=s.byteToFloat(e(o,255)),t(a)?(a.red=i,a.green=r,a.blue=n,a.alpha=o,a):new s(i,r,n,o)},s.fromAlpha=function(e,i,r){return t(r)?(r.red=e.red,r.green=e.green,r.blue=e.blue,r.alpha=i,r):new s(e.red,e.green,e.blue,i)};var l,u,c;r.supportsTypedArrays()&&(l=new ArrayBuffer(4),u=new Uint32Array(l),c=new Uint8Array(l)),s.fromRgba=function(e,t){return u[0]=e,s.fromBytes(c[0],c[1],c[2],c[3],t)},s.fromHsl=function(i,r,n,o,l){i=e(i,0)%1,r=e(r,0),n=e(n,0),o=e(o,1);var u=n,c=n,h=n;if(0!==r){var d;d=n<.5?n*(1+r):n+r-n*r;var p=2*n-d;u=a(p,d,i+1/3),c=a(p,d,i),h=a(p,d,i-1/3)}return t(l)?(l.red=u,l.green=c,l.blue=h,l.alpha=o,l):new s(u,c,h,o)},s.fromRandom=function(i,r){i=e(i,e.EMPTY_OBJECT);var n=i.red;if(!t(n)){var a=e(i.minimumRed,0),l=e(i.maximumRed,1);n=a+o.nextRandomNumber()*(l-a)}var u=i.green;if(!t(u)){var c=e(i.minimumGreen,0),h=e(i.maximumGreen,1);u=c+o.nextRandomNumber()*(h-c)}var d=i.blue;if(!t(d)){var p=e(i.minimumBlue,0),m=e(i.maximumBlue,1);d=p+o.nextRandomNumber()*(m-p)}var f=i.alpha;if(!t(f)){var _=e(i.minimumAlpha,0),g=e(i.maximumAlpha,1);f=_+o.nextRandomNumber()*(g-_)}return t(r)?(r.red=n,r.green=u,r.blue=d,r.alpha=f,r):new s(n,u,d,f)};var h=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i,d=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i,p=/^rgba?\(\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)(?:\s*,\s*([0-9.]+))?\s*\)$/i,m=/^hsla?\(\s*([0-9.]+)\s*,\s*([0-9.]+%)\s*,\s*([0-9.]+%)(?:\s*,\s*([0-9.]+))?\s*\)$/i;return s.fromCssColorString=function(i,r){t(r)||(r=new s);var n=s[i.toUpperCase()];if(t(n))return s.clone(n,r),r;var o=h.exec(i);return null!==o?(r.red=parseInt(o[1],16)/15,r.green=parseInt(o[2],16)/15,r.blue=parseInt(o[3],16)/15,r.alpha=1,r):(o=d.exec(i),null!==o?(r.red=parseInt(o[1],16)/255,r.green=parseInt(o[2],16)/255,r.blue=parseInt(o[3],16)/255,r.alpha=1,r):(o=p.exec(i),null!==o?(r.red=parseFloat(o[1])/("%"===o[1].substr(-1)?100:255),r.green=parseFloat(o[2])/("%"===o[2].substr(-1)?100:255),r.blue=parseFloat(o[3])/("%"===o[3].substr(-1)?100:255),r.alpha=parseFloat(e(o[4],"1.0")),r):(o=m.exec(i),null!==o?s.fromHsl(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,parseFloat(e(o[4],"1.0")),r):r=void 0)))},s.packedLength=4,s.pack=function(t,i,r){return r=e(r,0),i[r++]=t.red,i[r++]=t.green,i[r++]=t.blue,i[r]=t.alpha,i},s.unpack=function(i,r,n){return r=e(r,0),t(n)||(n=new s),n.red=i[r++],n.green=i[r++],n.blue=i[r++],n.alpha=i[r],n},s.byteToFloat=function(e){return e/255},s.floatToByte=function(e){return 1===e?255:256*e|0},s.clone=function(e,i){if(t(e))return t(i)?(i.red=e.red,i.green=e.green,i.blue=e.blue,i.alpha=e.alpha,i):new s(e.red,e.green,e.blue,e.alpha)},s.equals=function(e,i){return e===i||t(e)&&t(i)&&e.red===i.red&&e.green===i.green&&e.blue===i.blue&&e.alpha===i.alpha},s.equalsArray=function(e,t,i){return e.red===t[i]&&e.green===t[i+1]&&e.blue===t[i+2]&&e.alpha===t[i+3]},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,i){return this===e||t(e)&&Math.abs(this.red-e.red)<=i&&Math.abs(this.green-e.green)<=i&&Math.abs(this.blue-e.blue)<=i&&Math.abs(this.alpha-e.alpha)<=i},s.prototype.toString=function(){return"("+this.red+", "+this.green+", "+this.blue+", "+this.alpha+")"},s.prototype.toCssColorString=function(){var e=s.floatToByte(this.red),t=s.floatToByte(this.green),i=s.floatToByte(this.blue);return 1===this.alpha?"rgb("+e+","+t+","+i+")":"rgba("+e+","+t+","+i+","+this.alpha+")"},s.prototype.toBytes=function(e){var i=s.floatToByte(this.red),r=s.floatToByte(this.green),n=s.floatToByte(this.blue),o=s.floatToByte(this.alpha);return t(e)?(e[0]=i,e[1]=r,e[2]=n,e[3]=o,e):[i,r,n,o]},s.prototype.toRgba=function(){return c[0]=s.floatToByte(this.red),c[1]=s.floatToByte(this.green),c[2]=s.floatToByte(this.blue),c[3]=s.floatToByte(this.alpha),u[0]},s.prototype.brighten=function(e,t){return e=1-e,t.red=1-(1-this.red)*e,t.green=1-(1-this.green)*e,t.blue=1-(1-this.blue)*e,t.alpha=this.alpha,t},s.prototype.darken=function(e,t){return e=1-e,t.red=this.red*e,t.green=this.green*e,t.blue=this.blue*e,t.alpha=this.alpha,t},s.prototype.withAlpha=function(e,t){return s.fromAlpha(this,e,t)},s.add=function(e,t,i){return i.red=e.red+t.red,i.green=e.green+t.green,i.blue=e.blue+t.blue,i.alpha=e.alpha+t.alpha,i},s.subtract=function(e,t,i){return i.red=e.red-t.red,i.green=e.green-t.green,i.blue=e.blue-t.blue,i.alpha=e.alpha-t.alpha,i},s.multiply=function(e,t,i){return i.red=e.red*t.red,i.green=e.green*t.green,i.blue=e.blue*t.blue,i.alpha=e.alpha*t.alpha,i},s.divide=function(e,t,i){return i.red=e.red/t.red,i.green=e.green/t.green,i.blue=e.blue/t.blue,i.alpha=e.alpha/t.alpha,i},s.mod=function(e,t,i){return i.red=e.red%t.red,i.green=e.green%t.green,i.blue=e.blue%t.blue,i.alpha=e.alpha%t.alpha,i},s.multiplyByScalar=function(e,t,i){return i.red=e.red*t,i.green=e.green*t,i.blue=e.blue*t,i.alpha=e.alpha*t,i},s.divideByScalar=function(e,t,i){return i.red=e.red/t,i.green=e.green/t,i.blue=e.blue/t,i.alpha=e.alpha/t,i},s.ALICEBLUE=n(s.fromCssColorString("#F0F8FF")),s.ANTIQUEWHITE=n(s.fromCssColorString("#FAEBD7")),s.AQUA=n(s.fromCssColorString("#00FFFF")),s.AQUAMARINE=n(s.fromCssColorString("#7FFFD4")),s.AZURE=n(s.fromCssColorString("#F0FFFF")),s.BEIGE=n(s.fromCssColorString("#F5F5DC")),s.BISQUE=n(s.fromCssColorString("#FFE4C4")),s.BLACK=n(s.fromCssColorString("#000000")),s.BLANCHEDALMOND=n(s.fromCssColorString("#FFEBCD")),s.BLUE=n(s.fromCssColorString("#0000FF")),s.BLUEVIOLET=n(s.fromCssColorString("#8A2BE2")),s.BROWN=n(s.fromCssColorString("#A52A2A")),s.BURLYWOOD=n(s.fromCssColorString("#DEB887")),s.CADETBLUE=n(s.fromCssColorString("#5F9EA0")),s.CHARTREUSE=n(s.fromCssColorString("#7FFF00")),s.CHOCOLATE=n(s.fromCssColorString("#D2691E")),s.CORAL=n(s.fromCssColorString("#FF7F50")),s.CORNFLOWERBLUE=n(s.fromCssColorString("#6495ED")),s.CORNSILK=n(s.fromCssColorString("#FFF8DC")),s.CRIMSON=n(s.fromCssColorString("#DC143C")),s.CYAN=n(s.fromCssColorString("#00FFFF")),s.DARKBLUE=n(s.fromCssColorString("#00008B")),s.DARKCYAN=n(s.fromCssColorString("#008B8B")), +s.DARKGOLDENROD=n(s.fromCssColorString("#B8860B")),s.DARKGRAY=n(s.fromCssColorString("#A9A9A9")),s.DARKGREEN=n(s.fromCssColorString("#006400")),s.DARKGREY=s.DARKGRAY,s.DARKKHAKI=n(s.fromCssColorString("#BDB76B")),s.DARKMAGENTA=n(s.fromCssColorString("#8B008B")),s.DARKOLIVEGREEN=n(s.fromCssColorString("#556B2F")),s.DARKORANGE=n(s.fromCssColorString("#FF8C00")),s.DARKORCHID=n(s.fromCssColorString("#9932CC")),s.DARKRED=n(s.fromCssColorString("#8B0000")),s.DARKSALMON=n(s.fromCssColorString("#E9967A")),s.DARKSEAGREEN=n(s.fromCssColorString("#8FBC8F")),s.DARKSLATEBLUE=n(s.fromCssColorString("#483D8B")),s.DARKSLATEGRAY=n(s.fromCssColorString("#2F4F4F")),s.DARKSLATEGREY=s.DARKSLATEGRAY,s.DARKTURQUOISE=n(s.fromCssColorString("#00CED1")),s.DARKVIOLET=n(s.fromCssColorString("#9400D3")),s.DEEPPINK=n(s.fromCssColorString("#FF1493")),s.DEEPSKYBLUE=n(s.fromCssColorString("#00BFFF")),s.DIMGRAY=n(s.fromCssColorString("#696969")),s.DIMGREY=s.DIMGRAY,s.DODGERBLUE=n(s.fromCssColorString("#1E90FF")),s.FIREBRICK=n(s.fromCssColorString("#B22222")),s.FLORALWHITE=n(s.fromCssColorString("#FFFAF0")),s.FORESTGREEN=n(s.fromCssColorString("#228B22")),s.FUSCHIA=n(s.fromCssColorString("#FF00FF")),s.GAINSBORO=n(s.fromCssColorString("#DCDCDC")),s.GHOSTWHITE=n(s.fromCssColorString("#F8F8FF")),s.GOLD=n(s.fromCssColorString("#FFD700")),s.GOLDENROD=n(s.fromCssColorString("#DAA520")),s.GRAY=n(s.fromCssColorString("#808080")),s.GREEN=n(s.fromCssColorString("#008000")),s.GREENYELLOW=n(s.fromCssColorString("#ADFF2F")),s.GREY=s.GRAY,s.HONEYDEW=n(s.fromCssColorString("#F0FFF0")),s.HOTPINK=n(s.fromCssColorString("#FF69B4")),s.INDIANRED=n(s.fromCssColorString("#CD5C5C")),s.INDIGO=n(s.fromCssColorString("#4B0082")),s.IVORY=n(s.fromCssColorString("#FFFFF0")),s.KHAKI=n(s.fromCssColorString("#F0E68C")),s.LAVENDER=n(s.fromCssColorString("#E6E6FA")),s.LAVENDAR_BLUSH=n(s.fromCssColorString("#FFF0F5")),s.LAWNGREEN=n(s.fromCssColorString("#7CFC00")),s.LEMONCHIFFON=n(s.fromCssColorString("#FFFACD")),s.LIGHTBLUE=n(s.fromCssColorString("#ADD8E6")),s.LIGHTCORAL=n(s.fromCssColorString("#F08080")),s.LIGHTCYAN=n(s.fromCssColorString("#E0FFFF")),s.LIGHTGOLDENRODYELLOW=n(s.fromCssColorString("#FAFAD2")),s.LIGHTGRAY=n(s.fromCssColorString("#D3D3D3")),s.LIGHTGREEN=n(s.fromCssColorString("#90EE90")),s.LIGHTGREY=s.LIGHTGRAY,s.LIGHTPINK=n(s.fromCssColorString("#FFB6C1")),s.LIGHTSEAGREEN=n(s.fromCssColorString("#20B2AA")),s.LIGHTSKYBLUE=n(s.fromCssColorString("#87CEFA")),s.LIGHTSLATEGRAY=n(s.fromCssColorString("#778899")),s.LIGHTSLATEGREY=s.LIGHTSLATEGRAY,s.LIGHTSTEELBLUE=n(s.fromCssColorString("#B0C4DE")),s.LIGHTYELLOW=n(s.fromCssColorString("#FFFFE0")),s.LIME=n(s.fromCssColorString("#00FF00")),s.LIMEGREEN=n(s.fromCssColorString("#32CD32")),s.LINEN=n(s.fromCssColorString("#FAF0E6")),s.MAGENTA=n(s.fromCssColorString("#FF00FF")),s.MAROON=n(s.fromCssColorString("#800000")),s.MEDIUMAQUAMARINE=n(s.fromCssColorString("#66CDAA")),s.MEDIUMBLUE=n(s.fromCssColorString("#0000CD")),s.MEDIUMORCHID=n(s.fromCssColorString("#BA55D3")),s.MEDIUMPURPLE=n(s.fromCssColorString("#9370DB")),s.MEDIUMSEAGREEN=n(s.fromCssColorString("#3CB371")),s.MEDIUMSLATEBLUE=n(s.fromCssColorString("#7B68EE")),s.MEDIUMSPRINGGREEN=n(s.fromCssColorString("#00FA9A")),s.MEDIUMTURQUOISE=n(s.fromCssColorString("#48D1CC")),s.MEDIUMVIOLETRED=n(s.fromCssColorString("#C71585")),s.MIDNIGHTBLUE=n(s.fromCssColorString("#191970")),s.MINTCREAM=n(s.fromCssColorString("#F5FFFA")),s.MISTYROSE=n(s.fromCssColorString("#FFE4E1")),s.MOCCASIN=n(s.fromCssColorString("#FFE4B5")),s.NAVAJOWHITE=n(s.fromCssColorString("#FFDEAD")),s.NAVY=n(s.fromCssColorString("#000080")),s.OLDLACE=n(s.fromCssColorString("#FDF5E6")),s.OLIVE=n(s.fromCssColorString("#808000")),s.OLIVEDRAB=n(s.fromCssColorString("#6B8E23")),s.ORANGE=n(s.fromCssColorString("#FFA500")),s.ORANGERED=n(s.fromCssColorString("#FF4500")),s.ORCHID=n(s.fromCssColorString("#DA70D6")),s.PALEGOLDENROD=n(s.fromCssColorString("#EEE8AA")),s.PALEGREEN=n(s.fromCssColorString("#98FB98")),s.PALETURQUOISE=n(s.fromCssColorString("#AFEEEE")),s.PALEVIOLETRED=n(s.fromCssColorString("#DB7093")),s.PAPAYAWHIP=n(s.fromCssColorString("#FFEFD5")),s.PEACHPUFF=n(s.fromCssColorString("#FFDAB9")),s.PERU=n(s.fromCssColorString("#CD853F")),s.PINK=n(s.fromCssColorString("#FFC0CB")),s.PLUM=n(s.fromCssColorString("#DDA0DD")),s.POWDERBLUE=n(s.fromCssColorString("#B0E0E6")),s.PURPLE=n(s.fromCssColorString("#800080")),s.RED=n(s.fromCssColorString("#FF0000")),s.ROSYBROWN=n(s.fromCssColorString("#BC8F8F")),s.ROYALBLUE=n(s.fromCssColorString("#4169E1")),s.SADDLEBROWN=n(s.fromCssColorString("#8B4513")),s.SALMON=n(s.fromCssColorString("#FA8072")),s.SANDYBROWN=n(s.fromCssColorString("#F4A460")),s.SEAGREEN=n(s.fromCssColorString("#2E8B57")),s.SEASHELL=n(s.fromCssColorString("#FFF5EE")),s.SIENNA=n(s.fromCssColorString("#A0522D")),s.SILVER=n(s.fromCssColorString("#C0C0C0")),s.SKYBLUE=n(s.fromCssColorString("#87CEEB")),s.SLATEBLUE=n(s.fromCssColorString("#6A5ACD")),s.SLATEGRAY=n(s.fromCssColorString("#708090")),s.SLATEGREY=s.SLATEGRAY,s.SNOW=n(s.fromCssColorString("#FFFAFA")),s.SPRINGGREEN=n(s.fromCssColorString("#00FF7F")),s.STEELBLUE=n(s.fromCssColorString("#4682B4")),s.TAN=n(s.fromCssColorString("#D2B48C")),s.TEAL=n(s.fromCssColorString("#008080")),s.THISTLE=n(s.fromCssColorString("#D8BFD8")),s.TOMATO=n(s.fromCssColorString("#FF6347")),s.TURQUOISE=n(s.fromCssColorString("#40E0D0")),s.VIOLET=n(s.fromCssColorString("#EE82EE")),s.WHEAT=n(s.fromCssColorString("#F5DEB3")),s.WHITE=n(s.fromCssColorString("#FFFFFF")),s.WHITESMOKE=n(s.fromCssColorString("#F5F5F5")),s.YELLOW=n(s.fromCssColorString("#FFFF00")),s.YELLOWGREEN=n(s.fromCssColorString("#9ACD32")),s.TRANSPARENT=n(new s(0,0,0,0)),s}),i("Core/ColorGeometryInstanceAttribute",["./Color","./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError"],function(e,t,i,r,n,o){"use strict";function a(t,r,n,o){t=i(t,1),r=i(r,1),n=i(n,1),o=i(o,1),this.value=new Uint8Array([e.floatToByte(t),e.floatToByte(r),e.floatToByte(n),e.floatToByte(o)])}return n(a.prototype,{componentDatatype:{get:function(){return t.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}}),a.fromColor=function(e){return new a(e.red,e.green,e.blue,e.alpha)},a.toValue=function(e,t){return r(t)?e.toBytes(t):new Uint8Array(e.toBytes())},a.equals=function(e,t){return e===t||r(e)&&r(t)&&e.value[0]===t.value[0]&&e.value[1]===t.value[1]&&e.value[2]===t.value[2]&&e.value[3]===t.value[3]},a}),i("Core/CornerType",["./freezeObject"],function(e){"use strict";var t={ROUNDED:0,MITERED:1,BEVELED:2};return e(t)}),i("Core/EllipsoidGeodesic",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){var t=e._uSquared,i=e._ellipsoid.maximumRadius,r=e._ellipsoid.minimumRadius,n=(i-r)/i,o=Math.cos(e._startHeading),a=Math.sin(e._startHeading),s=(1-n)*Math.tan(e._start.latitude),l=1/Math.sqrt(1+s*s),u=l*s,c=Math.atan2(s,o),h=l*a,d=h*h,p=1-d,m=Math.sqrt(p),f=t/4,_=f*f,g=_*f,v=_*_,y=1+f-3*_/4+5*g/4-175*v/64,C=1-f+15*_/8-35*g/8,w=1-3*f+35*_/4,S=1-5*f,E=y*c-C*Math.sin(2*c)*f/2-w*Math.sin(4*c)*_/16-S*Math.sin(6*c)*g/48-5*Math.sin(8*c)*v/512,b=e._constants;b.a=i,b.b=r,b.f=n,b.cosineHeading=o,b.sineHeading=a,b.tanU=s,b.cosineU=l,b.sineU=u,b.sigma=c,b.sineAlpha=h,b.sineSquaredAlpha=d,b.cosineSquaredAlpha=p,b.cosineAlpha=m,b.u2Over4=f,b.u4Over16=_,b.u6Over64=g,b.u8Over256=v,b.a0=y,b.a1=C,b.a2=w,b.a3=S,b.distanceRatio=E}function u(e,t){return e*t*(4+e*(4-3*t))/16}function c(e,t,i,r,n,o,a){var s=u(e,i);return(1-s)*e*t*(r+s*n*(a+s*o*(2*a*a-1)))}function h(e,t,i,r,n,o,a){var l,u,h,d,p,m=(t-i)/t,f=o-r,_=Math.atan((1-m)*Math.tan(n)),g=Math.atan((1-m)*Math.tan(a)),v=Math.cos(_),y=Math.sin(_),C=Math.cos(g),w=Math.sin(g),S=v*C,E=v*w,b=y*w,T=y*C,x=f,A=s.TWO_PI,P=Math.cos(x),D=Math.sin(x);do{P=Math.cos(x),D=Math.sin(x);var M=E-T*P;h=Math.sqrt(C*C*D*D+M*M),u=b+S*P,l=Math.atan2(h,u);var I;0===h?(I=0,d=1):(I=S*D/h,d=1-I*I),A=x,p=u-2*b/d,isNaN(p)&&(p=0),x=f+c(m,I,d,l,h,u,p)}while(Math.abs(x-A)>s.EPSILON12);var R=d*(t*t-i*i)/(i*i),O=1+R*(4096+R*(R*(320-175*R)-768))/16384,N=R*(256+R*(R*(74-47*R)-128))/1024,L=p*p,B=N*h*(p+N*(u*(2*L-1)-N*p*(4*h*h-3)*(4*L-3)/6)/4),F=i*O*(l-B),V=Math.atan2(C*D,E-T*P),k=Math.atan2(v*D,E*P-T);e._distance=F,e._startHeading=V,e._endHeading=k,e._uSquared=R}function d(i,r,n,o){e.normalize(o.cartographicToCartesian(r,f),m),e.normalize(o.cartographicToCartesian(n,f),f);h(i,o.maximumRadius,o.minimumRadius,r.longitude,r.latitude,n.longitude,n.latitude),i._start=t.clone(r,i._start),i._end=t.clone(n,i._end),i._start.height=0,i._end.height=0,l(i)}function p(e,n,o){var s=i(o,a.WGS84);this._ellipsoid=s,this._start=new t,this._end=new t,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,r(e)&&r(n)&&d(this,e,n,s)}var m=new e,f=new e;return n(p.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return this._startHeading}},endHeading:{get:function(){return this._endHeading}}}),p.prototype.setEndPoints=function(e,t){d(this,e,t,this._ellipsoid)},p.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},p.prototype.interpolateUsingSurfaceDistance=function(e,i){var n=this._constants,o=n.distanceRatio+e/n.b,a=Math.cos(2*o),s=Math.cos(4*o),l=Math.cos(6*o),u=Math.sin(2*o),h=Math.sin(4*o),d=Math.sin(6*o),p=Math.sin(8*o),m=o*o,f=o*m,_=n.u8Over256,g=n.u2Over4,v=n.u6Over64,y=n.u4Over16,C=2*f*_*a/3+o*(1-g+7*y/4-15*v/4+579*_/64-(y-15*v/4+187*_/16)*a-(5*v/4-115*_/16)*s-29*_*l/16)+(g/2-y+71*v/32-85*_/16)*u+(5*y/16-5*v/4+383*_/96)*h-m*((v-11*_/2)*u+5*_*h/2)+(29*v/96-29*_/16)*d+539*_*p/1536,w=Math.asin(Math.sin(C)*n.cosineAlpha),S=Math.atan(n.a/n.b*Math.tan(w));C-=n.sigma;var E=Math.cos(2*n.sigma+C),b=Math.sin(C),T=Math.cos(C),x=n.cosineU*T,A=n.sineU*b,P=Math.atan2(b*n.sineHeading,x-A*n.cosineHeading),D=P-c(n.f,n.sineAlpha,n.cosineSquaredAlpha,C,b,T,E);return r(i)?(i.longitude=this._start.longitude+D,i.latitude=S,i.height=0,i):new t(this._start.longitude+D,S,0)},p}),i("Core/PolylinePipeline",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidGeodesic","./IntersectionTests","./isArray","./Math","./Matrix4","./Plane"],function(e,t,i,r,n,o,a,s,l,u,c,h){"use strict";function d(e,t,i){var r=b;r.length=e;var n;if(t===i){for(n=0;n<e;n++)r[n]=t;return r}var o=i-t,a=o/e;for(n=0;n<e;n++){var s=t+n*a;r[n]=s}return r}function p(t,i,r,n,o,a,s,l){var u=n.scaleToGeodeticSurface(t,P),c=n.scaleToGeodeticSurface(i,D),h=m.numberOfPoints(t,i,r),p=n.cartesianToCartographic(u,T),f=n.cartesianToCartographic(c,x),_=d(h,o,a);M.setEndPoints(p,f);var g=M.surfaceDistance/h,v=l;p.height=o;var y=n.cartographicToCartesian(p,A);e.pack(y,s,v),v+=3;for(var C=1;C<h;C++){var w=M.interpolateUsingSurfaceDistance(C*g,x);w.height=_[C],y=n.cartographicToCartesian(w,A),e.pack(y,s,v),v+=3}return v}var m={};m.numberOfPoints=function(t,i,r){var n=e.distance(t,i);return Math.ceil(n/r)};var f=new t;m.extractHeights=function(e,t){for(var i=e.length,r=new Array(i),n=0;n<i;n++){var o=e[n];r[n]=t.cartesianToCartographic(o,f).height}return r};var _=new c,g=new e,v=new e,y=new h(e.ZERO,0),C=new e,w=new h(e.ZERO,0),S=new e,E=new e,b=[],T=new t,x=new t,A=new e,P=new e,D=new e,M=new a;return m.wrapLongitude=function(t,n){var o=[],a=[];if(r(t)&&t.length>0){n=i(n,c.IDENTITY);var l=c.inverseTransformation(n,_),u=c.multiplyByPoint(l,e.ZERO,g),d=c.multiplyByPointAsVector(l,e.UNIT_Y,v),p=h.fromPointNormal(u,d,y),m=c.multiplyByPointAsVector(l,e.UNIT_X,C),f=h.fromPointNormal(u,m,w),b=1;o.push(e.clone(t[0]));for(var T=o[0],x=t.length,A=1;A<x;++A){var P=t[A];if(h.getPointDistance(f,T)<0||h.getPointDistance(f,P)<0){var D=s.lineSegmentPlane(T,P,p,S);if(r(D)){var M=e.multiplyByScalar(d,5e-9,E);h.getPointDistance(p,T)<0&&e.negate(M,M),o.push(e.add(D,M,new e)),a.push(b+1),e.negate(M,M),o.push(e.add(D,M,new e)),b=1}}o.push(e.clone(t[A])),b++,T=P}a.push(b)}return{positions:o,lengths:a}},m.generateArc=function(t){r(t)||(t={});var n=t.positions,a=n.length,s=i(t.ellipsoid,o.WGS84),c=i(t.height,0),h=l(c);if(a<1)return[];if(1===a){var d=s.scaleToGeodeticSurface(n[0],P);if(c=h?c[0]:c,0!==c){var f=s.geodeticSurfaceNormal(d,A);e.multiplyByScalar(f,c,f),e.add(d,f,d)}return[d.x,d.y,d.z]}var _=t.minDistance;if(!r(_)){var g=i(t.granularity,u.RADIANS_PER_DEGREE);_=u.chordLength(g,s.maximumRadius)}var v,y=0;for(v=0;v<a-1;v++)y+=m.numberOfPoints(n[v],n[v+1],_);var C=3*(y+1),w=new Array(C),S=0;for(v=0;v<a-1;v++){var E=n[v],x=n[v+1],D=h?c[v]:c,M=h?c[v+1]:c;S=p(E,x,_,s,D,M,w,S)}b.length=0;var I=n[a-1],R=s.cartesianToCartographic(I,T);R.height=h?c[a-1]:c;var O=s.cartographicToCartesian(R,A);return e.pack(O,w,C-3),w},m.generateCartesianArc=function(t){for(var i=m.generateArc(t),r=i.length/3,n=new Array(r),o=0;o<r;o++)n[o]=e.unpack(i,3*o);return n},m}),i("Core/PolylineVolumeGeometryLibrary",["./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./CornerType","./EllipsoidTangentPlane","./Math","./Matrix3","./Matrix4","./PolylinePipeline","./Quaternion","./Transforms"],function(e,t,i,r,n,o,a,s,l,u,c,h){"use strict";function d(e,t){for(var i=new Array(e.length),r=0;r<e.length;r++){var n=e[r];O=t.cartesianToCartographic(n,O),i[r]=O.height,e[r]=t.scaleToGeodeticSurface(n,n)}return i}function p(e,i,r,n){var o,a=e[0],s=e[1],l=t.angleBetween(a,s),u=Math.ceil(l/n),c=new Array(u);if(i===r){for(o=0;o<u;o++)c[o]=i;return c.push(r),c}var h=r-i,d=h/u;for(o=1;o<u;o++){var p=i+o*d;c[o]=p}return c[0]=i,c.push(r),c}function m(i,r,n,a){var s=new o(n,a),l=s.projectPointOntoPlane(t.add(n,i,j),j),u=s.projectPointOntoPlane(t.add(n,r,Y),Y),c=e.angleBetween(l,u);return u.x*l.y-u.y*l.x>=0?-c:c}function f(e,i,r,n,o,a,u,c){var d=k,p=z;L=h.eastNorthUpToFixedFrame(e,o,L),d=l.multiplyByPointAsVector(L,N,d),d=t.normalize(d,d);var f=m(d,i,e,o);F=s.fromRotationZ(f,F),U.z=a,L=l.multiplyTransformation(L,l.fromRotationTranslation(F,U,B),L);var _=V;_[0]=u;for(var g=0;g<c;g++)for(var v=0;v<r.length;v+=3)p=t.fromArray(r,v,p),p=s.multiplyByVector(_,p,p),p=l.multiplyByPoint(L,p,p),n.push(p.x,p.y,p.z);return n}function _(e,i,r,n,o,a,s){for(var l=0;l<e.length;l+=3){var u=t.fromArray(e,l,G);n=f(u,i,r,n,o,a[l/3],s,1)}return n}function g(e,t){var i=e.length,r=new Array(6*i),n=0,o=t.x+t.width/2,a=t.y+t.height/2,s=e[0];r[n++]=s.x-o,r[n++]=0,r[n++]=s.y-a;for(var l=1;l<i;l++){s=e[l];var u=s.x-o,c=s.y-a;r[n++]=u,r[n++]=0,r[n++]=c,r[n++]=u,r[n++]=0,r[n++]=c}return s=e[0],r[n++]=s.x-o,r[n++]=0,r[n++]=s.y-a,r}function v(e,t){for(var i=e.length,r=new Array(3*i),n=0,o=t.x+t.width/2,a=t.y+t.height/2,s=0;s<i;s++)r[n++]=e[s].x-o,r[n++]=0,r[n++]=e[s].y-a;return r}function y(e,i,r,o,l,u,h,d,p,m){var _,g=t.angleBetween(t.subtract(i,e,M),t.subtract(r,e,I)),v=o===n.BEVELED?0:Math.ceil(g/a.toRadians(5));_=l?s.fromQuaternion(c.fromAxisAngle(t.negate(e,M),g/(v+1),W),q):s.fromQuaternion(c.fromAxisAngle(e,g/(v+1),W),q);var y,C;if(i=t.clone(i,H),v>0)for(var w=m?2:1,S=0;S<v;S++)i=s.multiplyByVector(_,i,i),y=t.subtract(i,e,M),y=t.normalize(y,y),l||(y=t.negate(y,y)),C=u.scaleToGeodeticSurface(i,I),h=f(C,y,d,h,u,p,1,w);else y=t.subtract(i,e,M),y=t.normalize(y,y),l||(y=t.negate(y,y)),C=u.scaleToGeodeticSurface(i,I),h=f(C,y,d,h,u,p,1,1),r=t.clone(r,H),y=t.subtract(r,e,M),y=t.normalize(y,y),l||(y=t.negate(y,y)),C=u.scaleToGeodeticSurface(r,I),h=f(C,y,d,h,u,p,1,1);return h}var C=[new t,new t],w=new t,S=new t,E=new t,b=new t,T=new t,x=new t,A=new t,P=new t,D=new t,M=new t,I=new t,R={},O=new r,N=new t(-1,0,0),L=new l,B=new l,F=new s,V=s.IDENTITY.clone(),k=new t,z=new i,U=new t,G=new t,W=new c,H=new t,q=new s;R.removeDuplicatesFromShape=function(t){for(var i=t.length,r=[],n=i-1,o=0;o<i;n=o++){var a=t[n],s=t[o];e.equals(a,s)||r.push(s)}return r};var j=new t,Y=new t;R.angleIsGreaterThanPi=function(e,i,r,n){var a=new o(r,n),s=a.projectPointOntoPlane(t.add(r,e,j),j),l=a.projectPointOntoPlane(t.add(r,i,Y),Y);return l.x*s.y-l.y*s.x>=0};var X=new t,Z=new t;return R.computePositions=function(e,i,r,o,s){var l=o._ellipsoid,c=d(e,l),h=o._granularity,m=o._cornerType,I=s?g(i,r):v(i,r),O=s?v(i,r):void 0,N=r.height/2,L=r.width/2,B=e.length,F=[],V=s?[]:void 0,k=w,z=S,U=E,G=b,W=T,H=x,q=A,j=P,Y=D,K=e[0],Q=e[1];G=l.geodeticSurfaceNormal(K,G),k=t.subtract(Q,K,k),k=t.normalize(k,k),j=t.cross(G,k,j),j=t.normalize(j,j);var J=c[0],$=c[1];s&&(V=f(K,j,O,V,l,J+N,1,1)),Y=t.clone(K,Y),K=Q,z=t.negate(k,z);for(var ee,te,ie=1;ie<B-1;ie++){var re=s?2:1;Q=e[ie+1],k=t.subtract(Q,K,k),k=t.normalize(k,k),U=t.add(k,z,U),U=t.normalize(U,U),G=l.geodeticSurfaceNormal(K,G);var ne=t.multiplyByScalar(G,t.dot(k,G),X);t.subtract(k,ne,ne),t.normalize(ne,ne);var oe=t.multiplyByScalar(G,t.dot(z,G),Z);t.subtract(z,oe,oe),t.normalize(oe,oe);var ae=!a.equalsEpsilon(Math.abs(t.dot(ne,oe)),1,a.EPSILON7);if(ae){U=t.cross(U,G,U),U=t.cross(G,U,U),U=t.normalize(U,U);var se=1/Math.max(.25,t.magnitude(t.cross(U,z,M))),le=R.angleIsGreaterThanPi(k,z,K,l);le?(W=t.add(K,t.multiplyByScalar(U,se*L,U),W),H=t.add(W,t.multiplyByScalar(j,L,H),H),C[0]=t.clone(Y,C[0]),C[1]=t.clone(H,C[1]),ee=p(C,J+N,$+N,h),te=u.generateArc({positions:C,granularity:h,ellipsoid:l}),F=_(te,j,I,F,l,ee,1),j=t.cross(G,k,j),j=t.normalize(j,j),q=t.add(W,t.multiplyByScalar(j,L,q),q),m===n.ROUNDED||m===n.BEVELED?y(W,H,q,m,le,l,F,I,$+N,s):(U=t.negate(U,U),F=f(K,U,I,F,l,$+N,se,re)),Y=t.clone(q,Y)):(W=t.add(K,t.multiplyByScalar(U,se*L,U),W),H=t.add(W,t.multiplyByScalar(j,-L,H),H),C[0]=t.clone(Y,C[0]),C[1]=t.clone(H,C[1]),ee=p(C,J+N,$+N,h),te=u.generateArc({positions:C,granularity:h,ellipsoid:l}),F=_(te,j,I,F,l,ee,1),j=t.cross(G,k,j),j=t.normalize(j,j),q=t.add(W,t.multiplyByScalar(j,-L,q),q),m===n.ROUNDED||m===n.BEVELED?y(W,H,q,m,le,l,F,I,$+N,s):F=f(K,U,I,F,l,$+N,se,re),Y=t.clone(q,Y)),z=t.negate(k,z)}else F=f(Y,j,I,F,l,J+N,1,1),Y=K;J=$,$=c[ie+1],K=Q}C[0]=t.clone(Y,C[0]),C[1]=t.clone(K,C[1]),ee=p(C,J+N,$+N,h),te=u.generateArc({positions:C,granularity:h,ellipsoid:l}),F=_(te,j,I,F,l,ee,1),s&&(V=f(K,j,O,V,l,$+N,1,1)),B=F.length;var ue=s?B+V.length:B,ce=new Float64Array(ue);return ce.set(F),s&&ce.set(V,B),ce},R}),i("Core/CorridorGeometryLibrary",["./Cartesian3","./CornerType","./defined","./Math","./Matrix3","./PolylinePipeline","./PolylineVolumeGeometryLibrary","./Quaternion"],function(e,t,i,r,n,o,a,s){"use strict";function l(i,o,a,l,u){var c=e.angleBetween(e.subtract(o,i,m),e.subtract(a,i,f)),h=l===t.BEVELED?1:Math.ceil(c/r.toRadians(5))+1,d=3*h,p=new Array(d);p[d-3]=a.x,p[d-2]=a.y,p[d-1]=a.z;var _;_=u?n.fromQuaternion(s.fromAxisAngle(e.negate(i,m),c/h,D),M):n.fromQuaternion(s.fromAxisAngle(i,c/h,D),M);var g=0;o=e.clone(o,m);for(var v=0;v<h;v++)o=n.multiplyByVector(_,o,o),p[g++]=o.x,p[g++]=o.y,p[g++]=o.z;return p}function u(i){var r=y,n=C,o=w,a=i[1];n=e.fromArray(i[1],a.length-3,n),o=e.fromArray(i[0],0,o),r=e.multiplyByScalar(e.add(n,o,r),.5,r);var s=l(r,n,o,t.ROUNDED,!1),u=i.length-1,c=i[u-1];a=i[u],n=e.fromArray(c,c.length-3,n),o=e.fromArray(a,0,o),r=e.multiplyByScalar(e.add(n,o,r),.5,r);var h=l(r,n,o,t.ROUNDED,!1);return[s,h]}function c(t,i,r,n){var o=m;return n?o=e.add(t,i,o):(i=e.negate(i,i),o=e.add(t,i,o)),[o.x,o.y,o.z,r.x,r.y,r.z]}function h(t,i,r,n){for(var o=new Array(t.length),a=new Array(t.length),s=e.multiplyByScalar(i,r,m),l=e.negate(s,f),u=0,c=t.length-1,h=0;h<t.length;h+=3){var d=e.fromArray(t,h,_),p=e.add(d,l,g);o[u++]=p.x,o[u++]=p.y,o[u++]=p.z;var v=e.add(d,s,g);a[c--]=v.z,a[c--]=v.y,a[c--]=v.x}return n.push(o,a),n}function d(e,t){for(var i=0;i<e.length;i++)e[i]=t.scaleToGeodeticSurface(e[i],e[i]);return e}var p={},m=new e,f=new e,_=new e,g=new e,v=[new e,new e],y=new e,C=new e,w=new e,S=new e,E=new e,b=new e,T=new e,x=new e,A=new e,P=new e,D=new s,M=new n;p.addAttribute=function(e,t,r,n){var o=t.x,a=t.y,s=t.z;i(r)&&(e[r]=o,e[r+1]=a,e[r+2]=s),i(n)&&(e[n]=s,e[n-1]=a,e[n-2]=o)};var I=new e,R=new e;return p.computePositions=function(i){var n=i.granularity,s=i.positions,p=i.ellipsoid;s=d(s,p);var f=i.width/2,_=i.cornerType,g=i.saveAttributes,D=y,M=C,O=w,N=S,L=E,B=b,F=T,V=x,k=A,z=P,U=[],G=g?[]:void 0,W=g?[]:void 0,H=s[0],q=s[1];M=e.normalize(e.subtract(q,H,M),M),D=p.geodeticSurfaceNormal(H,D),N=e.normalize(e.cross(D,M,N),N),g&&(G.push(N.x,N.y,N.z),W.push(D.x,D.y,D.z)),F=e.clone(H,F),H=q,O=e.negate(M,O);var j,Y,X=[],Z=s.length;for(Y=1;Y<Z-1;Y++){D=p.geodeticSurfaceNormal(H,D),q=s[Y+1],M=e.normalize(e.subtract(q,H,M),M),L=e.normalize(e.add(M,O,L),L);var K=e.multiplyByScalar(D,e.dot(M,D),I);e.subtract(M,K,K),e.normalize(K,K);var Q=e.multiplyByScalar(D,e.dot(O,D),R);e.subtract(O,Q,Q),e.normalize(Q,Q);var J=!r.equalsEpsilon(Math.abs(e.dot(K,Q)),1,r.EPSILON7);if(J){L=e.cross(L,D,L),L=e.cross(D,L,L),L=e.normalize(L,L);var $=f/Math.max(.25,e.magnitude(e.cross(L,O,m))),ee=a.angleIsGreaterThanPi(M,O,H,p);L=e.multiplyByScalar(L,$,L),ee?(V=e.add(H,L,V),z=e.add(V,e.multiplyByScalar(N,f,z),z),k=e.add(V,e.multiplyByScalar(N,2*f,k),k),v[0]=e.clone(F,v[0]),v[1]=e.clone(z,v[1]),j=o.generateArc({positions:v,granularity:n,ellipsoid:p}),U=h(j,N,f,U),g&&(G.push(N.x,N.y,N.z),W.push(D.x,D.y,D.z)),B=e.clone(k,B),N=e.normalize(e.cross(D,M,N),N),k=e.add(V,e.multiplyByScalar(N,2*f,k),k),F=e.add(V,e.multiplyByScalar(N,f,F),F),_===t.ROUNDED||_===t.BEVELED?X.push({leftPositions:l(V,B,k,_,ee)}):X.push({leftPositions:c(H,e.negate(L,L),k,ee)})):(k=e.add(H,L,k),z=e.add(k,e.negate(e.multiplyByScalar(N,f,z),z),z),V=e.add(k,e.negate(e.multiplyByScalar(N,2*f,V),V),V),v[0]=e.clone(F,v[0]),v[1]=e.clone(z,v[1]),j=o.generateArc({positions:v,granularity:n,ellipsoid:p}),U=h(j,N,f,U),g&&(G.push(N.x,N.y,N.z),W.push(D.x,D.y,D.z)),B=e.clone(V,B),N=e.normalize(e.cross(D,M,N),N),V=e.add(k,e.negate(e.multiplyByScalar(N,2*f,V),V),V),F=e.add(k,e.negate(e.multiplyByScalar(N,f,F),F),F),_===t.ROUNDED||_===t.BEVELED?X.push({rightPositions:l(k,B,V,_,ee)}):X.push({rightPositions:c(H,L,V,ee)})),O=e.negate(M,O)}H=q}D=p.geodeticSurfaceNormal(H,D),v[0]=e.clone(F,v[0]),v[1]=e.clone(H,v[1]),j=o.generateArc({positions:v,granularity:n,ellipsoid:p}),U=h(j,N,f,U),g&&(G.push(N.x,N.y,N.z),W.push(D.x,D.y,D.z));var te;return _===t.ROUNDED&&(te=u(U)),{positions:U,corners:X,lefts:G,normals:W,endPositions:te}},p}),i("ThirdParty/earcut-2.1.1",[],function(){"use strict";function e(e,i,n){n=n||2;var o=i&&i.length,a=o?i[0]*n:e.length,s=t(e,0,a,n,!0),u=[];if(!s)return u;var c,h,d,p,m,f,_;if(o&&(s=l(e,i,s,n)),e.length>80*n){c=d=e[0],h=p=e[1];for(var g=n;g<a;g+=n)m=e[g],f=e[g+1],m<c&&(c=m),f<h&&(h=f),m>d&&(d=m),f>p&&(p=f);_=Math.max(d-c,p-h)}return r(s,u,n,c,h,_),u}function t(e,t,i,r,n){var o,a;if(n===P(e,t,i,r)>0)for(o=t;o<i;o+=r)a=T(o,e[o],e[o+1],a);else for(o=i-r;o>=t;o-=r)a=T(o,e[o],e[o+1],a);return a&&y(a,a.next)&&(x(a),a=a.next),a}function i(e,t){if(!e)return e;t||(t=e);var i,r=e;do if(i=!1,r.steiner||!y(r,r.next)&&0!==v(r.prev,r,r.next))r=r.next;else{if(x(r),r=t=r.prev,r===r.next)return null;i=!0}while(i||r!==t);return t}function r(e,t,l,u,c,h,p){if(e){!p&&h&&d(e,u,c,h);for(var m,f,_=e;e.prev!==e.next;)if(m=e.prev,f=e.next,h?o(e,u,c,h):n(e))t.push(m.i/l),t.push(e.i/l),t.push(f.i/l),x(e),e=f.next,_=f.next;else if(e=f,e===_){p?1===p?(e=a(e,t,l),r(e,t,l,u,c,h,2)):2===p&&s(e,t,l,u,c,h):r(i(e),t,l,u,c,h,1);break}}}function n(e){var t=e.prev,i=e,r=e.next;if(v(t,i,r)>=0)return!1;for(var n=e.next.next;n!==e.prev;){if(_(t.x,t.y,i.x,i.y,r.x,r.y,n.x,n.y)&&v(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function o(e,t,i,r){var n=e.prev,o=e,a=e.next;if(v(n,o,a)>=0)return!1;for(var s=n.x<o.x?n.x<a.x?n.x:a.x:o.x<a.x?o.x:a.x,l=n.y<o.y?n.y<a.y?n.y:a.y:o.y<a.y?o.y:a.y,u=n.x>o.x?n.x>a.x?n.x:a.x:o.x>a.x?o.x:a.x,c=n.y>o.y?n.y>a.y?n.y:a.y:o.y>a.y?o.y:a.y,h=m(s,l,t,i,r),d=m(u,c,t,i,r),p=e.nextZ;p&&p.z<=d;){if(p!==e.prev&&p!==e.next&&_(n.x,n.y,o.x,o.y,a.x,a.y,p.x,p.y)&&v(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(p=e.prevZ;p&&p.z>=h;){if(p!==e.prev&&p!==e.next&&_(n.x,n.y,o.x,o.y,a.x,a.y,p.x,p.y)&&v(p.prev,p,p.next)>=0)return!1;p=p.prevZ}return!0}function a(e,t,i){var r=e;do{var n=r.prev,o=r.next.next;!y(n,o)&&C(n,r,r.next,o)&&S(n,o)&&S(o,n)&&(t.push(n.i/i),t.push(r.i/i),t.push(o.i/i),x(r),x(r.next),r=e=o),r=r.next}while(r!==e);return r}function s(e,t,n,o,a,s){var l=e;do{for(var u=l.next.next;u!==l.prev;){if(l.i!==u.i&&g(l,u)){var c=b(l,u);return l=i(l,l.next),c=i(c,c.next),r(l,t,n,o,a,s),void r(c,t,n,o,a,s)}u=u.next}l=l.next}while(l!==e)}function l(e,r,n,o){var a,s,l,h,d,p=[];for(a=0,s=r.length;a<s;a++)l=r[a]*o,h=a<s-1?r[a+1]*o:e.length,d=t(e,l,h,o,!1),d===d.next&&(d.steiner=!0),p.push(f(d));for(p.sort(u),a=0;a<p.length;a++)c(p[a],n),n=i(n,n.next);return n}function u(e,t){return e.x-t.x}function c(e,t){if(t=h(e,t)){var r=b(t,e);i(r,r.next)}}function h(e,t){var i,r=t,n=e.x,o=e.y,a=-(1/0);do{if(o<=r.y&&o>=r.next.y){var s=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=n&&s>a){if(a=s,s===n){if(o===r.y)return r;if(o===r.next.y)return r.next}i=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!i)return null;if(n===a)return i.prev;var l,u=i,c=i.x,h=i.y,d=1/0;for(r=i.next;r!==u;)n>=r.x&&r.x>=c&&_(o<h?n:a,o,c,h,o<h?a:n,o,r.x,r.y)&&(l=Math.abs(o-r.y)/(n-r.x),(l<d||l===d&&r.x>i.x)&&S(r,e)&&(i=r,d=l)),r=r.next;return i}function d(e,t,i,r){var n=e;do null===n.z&&(n.z=m(n.x,n.y,t,i,r)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next;while(n!==e);n.prevZ.nextZ=null,n.prevZ=null,p(n)}function p(e){var t,i,r,n,o,a,s,l,u=1;do{for(i=e,e=null,o=null,a=0;i;){for(a++,r=i,s=0,t=0;t<u&&(s++,r=r.nextZ,r);t++);for(l=u;s>0||l>0&&r;)0===s?(n=r,r=r.nextZ,l--):0!==l&&r?i.z<=r.z?(n=i,i=i.nextZ,s--):(n=r,r=r.nextZ,l--):(n=i,i=i.nextZ,s--),o?o.nextZ=n:e=n,n.prevZ=o,o=n;i=r}o.nextZ=null,u*=2}while(a>1);return e}function m(e,t,i,r,n){return e=32767*(e-i)/n,t=32767*(t-r)/n,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function f(e){var t=e,i=e;do t.x<i.x&&(i=t),t=t.next;while(t!==e);return i}function _(e,t,i,r,n,o,a,s){return(n-a)*(t-s)-(e-a)*(o-s)>=0&&(e-a)*(r-s)-(i-a)*(t-s)>=0&&(i-a)*(o-s)-(n-a)*(r-s)>=0}function g(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!w(e,t)&&S(e,t)&&S(t,e)&&E(e,t)}function v(e,t,i){return(t.y-e.y)*(i.x-t.x)-(t.x-e.x)*(i.y-t.y)}function y(e,t){return e.x===t.x&&e.y===t.y}function C(e,t,i,r){return!!(y(e,t)&&y(i,r)||y(e,r)&&y(i,t))||v(e,t,i)>0!=v(e,t,r)>0&&v(i,r,e)>0!=v(i,r,t)>0}function w(e,t){var i=e;do{if(i.i!==e.i&&i.next.i!==e.i&&i.i!==t.i&&i.next.i!==t.i&&C(i,i.next,e,t))return!0;i=i.next}while(i!==e);return!1}function S(e,t){return v(e.prev,e,e.next)<0?v(e,t,e.next)>=0&&v(e,e.prev,t)>=0:v(e,t,e.prev)<0||v(e,e.next,t)<0}function E(e,t){var i=e,r=!1,n=(e.x+t.x)/2,o=(e.y+t.y)/2;do i.y>o!=i.next.y>o&&n<(i.next.x-i.x)*(o-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next;while(i!==e);return r}function b(e,t){var i=new A(e.i,e.x,e.y),r=new A(t.i,t.x,t.y),n=e.next,o=t.prev;return e.next=t,t.prev=e,i.next=n,n.prev=i,r.next=i,i.prev=r,o.next=r,r.prev=o,r}function T(e,t,i,r){var n=new A(e,t,i);return r?(n.next=r.next,n.prev=r,r.next.prev=n,r.next=n):(n.prev=n,n.next=n),n}function x(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function A(e,t,i){this.i=e,this.x=t,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function P(e,t,i,r){for(var n=0,o=t,a=i-r;o<i;o+=r)n+=(e[a]-e[o])*(e[o+1]+e[a+1]),a=o;return n}return e.deviation=function(e,t,i,r){var n=t&&t.length,o=n?t[0]*i:e.length,a=Math.abs(P(e,0,o,i));if(n)for(var s=0,l=t.length;s<l;s++){var u=t[s]*i,c=s<l-1?t[s+1]*i:e.length;a-=Math.abs(P(e,u,c,i))}var h=0;for(s=0;s<r.length;s+=3){var d=r[s]*i,p=r[s+1]*i,m=r[s+2]*i;h+=Math.abs((e[d]-e[m])*(e[p+1]-e[d+1])-(e[d]-e[p])*(e[m+1]-e[d+1]))}return 0===a&&0===h?0:Math.abs((h-a)/a)},e.flatten=function(e){for(var t=e[0][0].length,i={vertices:[],holes:[],dimensions:t},r=0,n=0;n<e.length;n++){for(var o=0;o<e[n].length;o++)for(var a=0;a<t;a++)i.vertices.push(e[n][o][a]);n>0&&(r+=e[n-1].length,i.holes.push(r))}return i},e}),i("Core/WindingOrder",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var i={CLOCKWISE:t.CW,COUNTER_CLOCKWISE:t.CCW,validate:function(e){return e===i.CLOCKWISE||e===i.COUNTER_CLOCKWISE}};return e(i)}),i("Core/PolygonPipeline",["../ThirdParty/earcut-2.1.1","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./Math","./PrimitiveType","./WindingOrder"],function(e,t,i,r,n,o,a,s,l,u,c,h,d){"use strict";var p=new i,m=new i,f={};f.computeArea2D=function(e){for(var t=e.length,i=0,r=t-1,n=0;n<t;r=n++){var o=e[r],a=e[n];i+=o.x*a.y-a.x*o.y}return.5*i},f.computeWindingOrder2D=function(e){var t=f.computeArea2D(e);return t>0?d.COUNTER_CLOCKWISE:d.CLOCKWISE},f.triangulate=function(i,r){var n=t.packArray(i);return e(n,r,2)};var _=new i,g=new i,v=new i,y=new i,C=new i,w=new i,S=new i;return f.computeSubdivision=function(e,t,a,s){s=n(s,c.RADIANS_PER_DEGREE);var d,p=a.slice(0),m=t.length,f=new Array(3*m),E=0;for(d=0;d<m;d++){var b=t[d];f[E++]=b.x,f[E++]=b.y,f[E++]=b.z}for(var T=[],x={},A=e.maximumRadius,P=c.chordLength(s,A),D=P*P;p.length>0;){var M,I,R=p.pop(),O=p.pop(),N=p.pop(),L=i.fromArray(f,3*N,_),B=i.fromArray(f,3*O,g),F=i.fromArray(f,3*R,v),V=i.multiplyByScalar(i.normalize(L,y),A,y),k=i.multiplyByScalar(i.normalize(B,C),A,C),z=i.multiplyByScalar(i.normalize(F,w),A,w),U=i.magnitudeSquared(i.subtract(V,k,S)),G=i.magnitudeSquared(i.subtract(k,z,S)),W=i.magnitudeSquared(i.subtract(z,V,S)),H=Math.max(U,G,W);H>D?U===H?(M=Math.min(N,O)+" "+Math.max(N,O),d=x[M],o(d)||(I=i.add(L,B,S),i.multiplyByScalar(I,.5,I),f.push(I.x,I.y,I.z),d=f.length/3-1,x[M]=d),p.push(N,d,R),p.push(d,O,R)):G===H?(M=Math.min(O,R)+" "+Math.max(O,R),d=x[M],o(d)||(I=i.add(B,F,S),i.multiplyByScalar(I,.5,I),f.push(I.x,I.y,I.z),d=f.length/3-1,x[M]=d),p.push(O,d,N),p.push(d,R,N)):W===H&&(M=Math.min(R,N)+" "+Math.max(R,N),d=x[M],o(d)||(I=i.add(F,L,S),i.multiplyByScalar(I,.5,I),f.push(I.x,I.y,I.z),d=f.length/3-1,x[M]=d),p.push(R,d,O),p.push(d,N,O)):(T.push(N),T.push(O),T.push(R))}return new l({attributes:{position:new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:f})},indices:T,primitiveType:h.TRIANGLES})},f.scaleToGeodeticHeight=function(e,t,r,a){r=n(r,s.WGS84);var l=p,u=m;if(t=n(t,0),a=n(a,!0),o(e))for(var c=e.length,h=0;h<c;h+=3)i.fromArray(e,h,u),a&&(u=r.scaleToGeodeticSurface(u,u)),0!==t&&(l=r.geodeticSurfaceNormal(u,l),i.multiplyByScalar(l,t,l),i.add(u,l,u)),e[h]=u.x,e[h+1]=u.y,e[h+2]=u.z;return e},f}),i("Core/CorridorGeometry",["./arrayRemoveDuplicates","./BoundingSphere","./Cartesian3","./Cartographic","./ComponentDatatype","./CornerType","./CorridorGeometryLibrary","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolygonPipeline","./PrimitiveType","./Rectangle","./VertexFormat"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C){"use strict";function w(e,t,r,n,o,s){var l=e.normals,u=e.tangents,c=e.bitangents,h=i.normalize(i.cross(r,t,L),L);s.normal&&a.addAttribute(l,t,n,o),s.tangent&&a.addAttribute(u,h,n,o),s.bitangent&&a.addAttribute(c,r,n,o)}function S(e,t,r){var o,s,u,c=e.positions,h=e.corners,d=e.endPositions,g=e.lefts,v=e.normals,y=new m,C=0,S=0,E=0;for(s=0;s<c.length;s+=2)u=c[s].length-3,C+=u,E+=2*u,S+=c[s+1].length-3;for(C+=3,S+=3,s=0;s<h.length;s++){o=h[s];var b=h[s].leftPositions;l(b)?(u=b.length,C+=u,E+=u):(u=h[s].rightPositions.length,S+=u,E+=u)}var T,x=l(d);x&&(T=d[0].length-3,C+=T,S+=T,T/=3,E+=6*T);var A,P,O,F,V,k,z=C+S,U=new Float64Array(z),G=t.normal?new Float32Array(z):void 0,W=t.tangent?new Float32Array(z):void 0,H=t.bitangent?new Float32Array(z):void 0,q={normals:G,tangents:W,bitangents:H},j=0,Y=z-1,X=D,Z=M,K=T/2,Q=f.createTypedArray(z/3,E),J=0;if(x){k=I,V=R;var $=d[0];for(X=i.fromArray(v,0,X),Z=i.fromArray(g,0,Z),s=0;s<K;s++)k=i.fromArray($,3*(K-1-s),k), +V=i.fromArray($,3*(K+s),V),a.addAttribute(U,V,j),a.addAttribute(U,k,void 0,Y),w(q,X,Z,j,Y,t),P=j/3,F=P+1,A=(Y-2)/3,O=A-1,Q[J++]=A,Q[J++]=P,Q[J++]=O,Q[J++]=O,Q[J++]=P,Q[J++]=F,j+=3,Y-=3}var ee=0,te=0,ie=c[ee++],re=c[ee++];U.set(ie,j),U.set(re,Y-re.length+1),Z=i.fromArray(g,te,Z);var ne,oe;for(u=re.length-3,s=0;s<u;s+=3)ne=r.geodeticSurfaceNormal(i.fromArray(ie,s,L),L),oe=r.geodeticSurfaceNormal(i.fromArray(re,u-s,B),B),X=i.normalize(i.add(ne,oe,X),X),w(q,X,Z,j,Y,t),P=j/3,F=P+1,A=(Y-2)/3,O=A-1,Q[J++]=A,Q[J++]=P,Q[J++]=O,Q[J++]=O,Q[J++]=P,Q[J++]=F,j+=3,Y-=3;for(ne=r.geodeticSurfaceNormal(i.fromArray(ie,u,L),L),oe=r.geodeticSurfaceNormal(i.fromArray(re,u,B),B),X=i.normalize(i.add(ne,oe,X),X),te+=3,s=0;s<h.length;s++){var ae;o=h[s];var se,le,ue=o.leftPositions,ce=o.rightPositions,he=N,de=I,pe=R;if(X=i.fromArray(v,te,X),l(ue)){for(w(q,X,Z,void 0,Y,t),Y-=3,se=F,le=O,ae=0;ae<ue.length/3;ae++)he=i.fromArray(ue,3*ae,he),Q[J++]=se,Q[J++]=le-ae-1,Q[J++]=le-ae,a.addAttribute(U,he,void 0,Y),de=i.fromArray(U,3*(le-ae-1),de),pe=i.fromArray(U,3*se,pe),Z=i.normalize(i.subtract(de,pe,Z),Z),w(q,X,Z,void 0,Y,t),Y-=3;he=i.fromArray(U,3*se,he),de=i.subtract(i.fromArray(U,3*le,de),he,de),pe=i.subtract(i.fromArray(U,3*(le-ae),pe),he,pe),Z=i.normalize(i.add(de,pe,Z),Z),w(q,X,Z,j,void 0,t),j+=3}else{for(w(q,X,Z,j,void 0,t),j+=3,se=O,le=F,ae=0;ae<ce.length/3;ae++)he=i.fromArray(ce,3*ae,he),Q[J++]=se,Q[J++]=le+ae,Q[J++]=le+ae+1,a.addAttribute(U,he,j),de=i.fromArray(U,3*se,de),pe=i.fromArray(U,3*(le+ae),pe),Z=i.normalize(i.subtract(de,pe,Z),Z),w(q,X,Z,j,void 0,t),j+=3;he=i.fromArray(U,3*se,he),de=i.subtract(i.fromArray(U,3*(le+ae),de),he,de),pe=i.subtract(i.fromArray(U,3*le,pe),he,pe),Z=i.normalize(i.negate(i.add(pe,de,Z),Z),Z),w(q,X,Z,void 0,Y,t),Y-=3}for(ie=c[ee++],re=c[ee++],ie.splice(0,3),re.splice(re.length-3,3),U.set(ie,j),U.set(re,Y-re.length+1),u=re.length-3,te+=3,Z=i.fromArray(g,te,Z),ae=0;ae<re.length;ae+=3)ne=r.geodeticSurfaceNormal(i.fromArray(ie,ae,L),L),oe=r.geodeticSurfaceNormal(i.fromArray(re,u-ae,B),B),X=i.normalize(i.add(ne,oe,X),X),w(q,X,Z,j,Y,t),F=j/3,P=F-1,O=(Y-2)/3,A=O+1,Q[J++]=A,Q[J++]=P,Q[J++]=O,Q[J++]=O,Q[J++]=P,Q[J++]=F,j+=3,Y-=3;j-=3,Y+=3}if(X=i.fromArray(v,v.length-3,X),w(q,X,Z,j,Y,t),x){j+=3,Y-=3,k=I,V=R;var me=d[1];for(s=0;s<K;s++)k=i.fromArray(me,3*(T-s-1),k),V=i.fromArray(me,3*s,V),a.addAttribute(U,k,void 0,Y),a.addAttribute(U,V,j),w(q,X,Z,j,Y,t),F=j/3,P=F-1,O=(Y-2)/3,A=O+1,Q[J++]=A,Q[J++]=P,Q[J++]=O,Q[J++]=O,Q[J++]=P,Q[J++]=F,j+=3,Y-=3}if(y.position=new p({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:U}),t.st){var fe,_e,ge=new Float32Array(z/3*2),ve=0;if(x){C/=3,S/=3;var ye=Math.PI/(T+1);_e=1/(C-T+1),fe=1/(S-T+1);var Ce,we=T/2;for(s=we+1;s<T+1;s++)Ce=_.PI_OVER_TWO+ye*s,ge[ve++]=fe*(1+Math.cos(Ce)),ge[ve++]=.5*(1+Math.sin(Ce));for(s=1;s<S-T+1;s++)ge[ve++]=s*fe,ge[ve++]=0;for(s=T;s>we;s--)Ce=_.PI_OVER_TWO-s*ye,ge[ve++]=1-fe*(1+Math.cos(Ce)),ge[ve++]=.5*(1+Math.sin(Ce));for(s=we;s>0;s--)Ce=_.PI_OVER_TWO-ye*s,ge[ve++]=1-_e*(1+Math.cos(Ce)),ge[ve++]=.5*(1+Math.sin(Ce));for(s=C-T;s>0;s--)ge[ve++]=s*_e,ge[ve++]=1;for(s=1;s<we+1;s++)Ce=_.PI_OVER_TWO+ye*s,ge[ve++]=_e*(1+Math.cos(Ce)),ge[ve++]=.5*(1+Math.sin(Ce))}else{for(C/=3,S/=3,_e=1/(C-1),fe=1/(S-1),s=0;s<S;s++)ge[ve++]=s*fe,ge[ve++]=0;for(s=C;s>0;s--)ge[ve++]=(s-1)*_e,ge[ve++]=1}y.st=new p({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:ge})}return t.normal&&(y.normal=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:q.normals})),t.tangent&&(y.tangent=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:q.tangents})),t.bitangent&&(y.bitangent=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:q.bitangents})),{attributes:y,indices:Q}}function E(e,t){if(!(t.normal||t.tangent||t.bitangent||t.st))return e;var r,n,o=e.position.values;(t.normal||t.bitangent)&&(r=e.normal.values,n=e.bitangent.values);var s,l=e.position.values.length/18,u=3*l,c=2*l,h=2*u;if(t.normal||t.bitangent||t.tangent){var d=t.normal?new Float32Array(6*u):void 0,p=t.tangent?new Float32Array(6*u):void 0,m=t.bitangent?new Float32Array(6*u):void 0,f=D,_=M,g=I,v=R,y=O,C=N,w=h;for(s=0;s<u;s+=3){var S=w+h;f=i.fromArray(o,s,f),_=i.fromArray(o,s+u,_),g=i.fromArray(o,(s+3)%u,g),_=i.subtract(_,f,_),g=i.subtract(g,f,g),v=i.normalize(i.cross(_,g,v),v),t.normal&&(a.addAttribute(d,v,S),a.addAttribute(d,v,S+3),a.addAttribute(d,v,w),a.addAttribute(d,v,w+3)),(t.tangent||t.bitangent)&&(C=i.fromArray(r,s,C),t.bitangent&&(a.addAttribute(m,C,S),a.addAttribute(m,C,S+3),a.addAttribute(m,C,w),a.addAttribute(m,C,w+3)),t.tangent&&(y=i.normalize(i.cross(C,v,y),y),a.addAttribute(p,y,S),a.addAttribute(p,y,S+3),a.addAttribute(p,y,w),a.addAttribute(p,y,w+3))),w+=6}if(t.normal){for(d.set(r),s=0;s<u;s+=3)d[s+u]=-r[s],d[s+u+1]=-r[s+1],d[s+u+2]=-r[s+2];e.normal.values=d}else e.normal=void 0;if(t.bitangent?(m.set(n),m.set(n,u),e.bitangent.values=m):e.bitangent=void 0,t.tangent){var E=e.tangent.values;p.set(E),p.set(E,u),e.tangent.values=p}}if(t.st){var b=e.st.values,T=new Float32Array(6*c);T.set(b),T.set(b,c);for(var x=2*c,A=0;A<2;A++){for(T[x++]=b[0],T[x++]=b[1],s=2;s<c;s+=2){var P=b[s],L=b[s+1];T[x++]=P,T[x++]=L,T[x++]=P,T[x++]=L}T[x++]=b[0],T[x++]=b[1]}e.st.values=T}return e}function b(e,t,i){i[t++]=e[0],i[t++]=e[1],i[t++]=e[2];for(var r=3;r<e.length;r+=3){var n=e[r],o=e[r+1],a=e[r+2];i[t++]=n,i[t++]=o,i[t++]=a,i[t++]=n,i[t++]=o,i[t++]=a}return i[t++]=e[0],i[t++]=e[1],i[t++]=e[2],i}function T(e,t){var i=new C({position:t.position,normal:t.normal||t.bitangent||e.shadowVolume,tangent:t.tangent,bitangent:t.normal||t.bitangent,st:t.st}),r=e.ellipsoid,o=a.computePositions(e),s=S(o,i,r),l=e.height,u=e.extrudedHeight,c=s.attributes,h=s.indices,d=c.position.values,m=d.length,_=new Float64Array(6*m),v=new Float64Array(m);v.set(d);var y=new Float64Array(4*m);d=g.scaleToGeodeticHeight(d,l,r),y=b(d,0,y),v=g.scaleToGeodeticHeight(v,u,r),y=b(v,2*m,y),_.set(d),_.set(v,m),_.set(y,2*m),c.position.values=_,c=E(c,t);var w=m/3;if(e.shadowVolume){var T=c.normal.values;m=T.length;var x=new Float32Array(6*m);for(A=0;A<m;A++)T[A]=-T[A];x.set(T,m),x=b(T,4*m,x),c.extrudeDirection=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:x}),t.normal||(c.normal=void 0)}var A,P=h.length,D=w+w,M=f.createTypedArray(_.length/3,2*P+3*D);M.set(h);var I=P;for(A=0;A<P;A+=3){var R=h[A],O=h[A+1],N=h[A+2];M[I++]=N+w,M[I++]=O+w,M[I++]=R+w}var L,B,F,V;for(A=0;A<D;A+=2)L=A+D,B=L+D,F=L+1,V=B+1,M[I++]=L,M[I++]=B,M[I++]=F,M[I++]=F,M[I++]=B,M[I++]=V;return{attributes:c,indices:M}}function x(e,t,r,n,o,a){var s=i.subtract(t,e,F);i.normalize(s,s);var l=r.geodeticSurfaceNormal(e,V),u=i.cross(s,l,F);i.multiplyByScalar(u,n,u);var c=o.latitude,h=o.longitude,d=a.latitude,p=a.longitude;i.add(e,u,V),r.cartesianToCartographic(V,k);var m=k.latitude,f=k.longitude;c=Math.min(c,m),h=Math.min(h,f),d=Math.max(d,m),p=Math.max(p,f),i.subtract(e,u,V),r.cartesianToCartographic(V,k),m=k.latitude,f=k.longitude,c=Math.min(c,m),h=Math.min(h,f),d=Math.max(d,m),p=Math.max(p,f),o.latitude=c,o.longitude=h,a.latitude=d,a.longitude=p}function A(t,r,n,a){var s=e(t,i.equalsEpsilon),l=s.length;if(l<2||n<=0)return new y;var u=.5*n;G.latitude=Number.POSITIVE_INFINITY,G.longitude=Number.POSITIVE_INFINITY,W.latitude=Number.NEGATIVE_INFINITY,W.longitude=Number.NEGATIVE_INFINITY;var c,h;if(a===o.ROUNDED){var d=s[0];i.subtract(d,s[1],z),i.normalize(z,z),i.multiplyByScalar(z,u,z),i.add(d,z,U),r.cartesianToCartographic(U,k),c=k.latitude,h=k.longitude,G.latitude=Math.min(G.latitude,c),G.longitude=Math.min(G.longitude,h),W.latitude=Math.max(W.latitude,c),W.longitude=Math.max(W.longitude,h)}for(var p=0;p<l-1;++p)x(s[p],s[p+1],r,u,G,W);var m=s[l-1];i.subtract(m,s[l-2],z),i.normalize(z,z),i.multiplyByScalar(z,u,z),i.add(m,z,U),x(m,U,r,u,G,W),a===o.ROUNDED&&(r.cartesianToCartographic(U,k),c=k.latitude,h=k.longitude,G.latitude=Math.min(G.latitude,c),G.longitude=Math.min(G.longitude,h),W.latitude=Math.max(W.latitude,c),W.longitude=Math.max(W.longitude,h));var f=new y;return f.north=W.latitude,f.south=G.latitude,f.east=W.longitude,f.west=G.longitude,f}function P(e){e=s(e,s.EMPTY_OBJECT);var t=e.positions,r=e.width;this._positions=t,this._ellipsoid=h.clone(s(e.ellipsoid,h.WGS84)),this._vertexFormat=C.clone(s(e.vertexFormat,C.DEFAULT)),this._width=r,this._height=s(e.height,0),this._extrudedHeight=s(e.extrudedHeight,this._height),this._cornerType=s(e.cornerType,o.ROUNDED),this._granularity=s(e.granularity,_.RADIANS_PER_DEGREE),this._shadowVolume=s(e.shadowVolume,!1),this._workerName="createCorridorGeometry",this._rectangle=A(t,this._ellipsoid,r,this._cornerType),this.packedLength=1+t.length*i.packedLength+h.packedLength+C.packedLength+y.packedLength+6}var D=new i,M=new i,I=new i,R=new i,O=new i,N=new i,L=new i,B=new i,F=new i,V=new i,k=new r,z=new i,U=new i,G=new r,W=new r;P.pack=function(e,t,r){r=s(r,0);var n=e._positions,o=n.length;t[r++]=o;for(var a=0;a<o;++a,r+=i.packedLength)i.pack(n[a],t,r);return h.pack(e._ellipsoid,t,r),r+=h.packedLength,C.pack(e._vertexFormat,t,r),r+=C.packedLength,y.pack(e._rectangle,t,r),r+=y.packedLength,t[r++]=e._width,t[r++]=e._height,t[r++]=e._extrudedHeight,t[r++]=e._cornerType,t[r++]=e._granularity,t[r]=e._shadowVolume?1:0,t};var H=h.clone(h.UNIT_SPHERE),q=new C,j=new y,Y={positions:void 0,ellipsoid:H,vertexFormat:q,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0};return P.unpack=function(e,t,r){t=s(t,0);for(var n=e[t++],o=new Array(n),a=0;a<n;++a,t+=i.packedLength)o[a]=i.unpack(e,t);var u=h.unpack(e,t,H);t+=h.packedLength;var c=C.unpack(e,t,q);t+=C.packedLength;var d=y.unpack(e,t,j);t+=y.packedLength;var p=e[t++],m=e[t++],f=e[t++],_=e[t++],g=e[t++],v=1===e[t];return l(r)?(r._positions=o,r._ellipsoid=h.clone(u,r._ellipsoid),r._vertexFormat=C.clone(c,r._vertexFormat),r._width=p,r._height=m,r._extrudedHeight=f,r._cornerType=_,r._granularity=g,r._rectangle=y.clone(d),r._shadowVolume=v,r):(Y.positions=o,Y.width=p,Y.height=m,Y.extrudedHeight=f,Y.cornerType=_,Y.granularity=g,Y.shadowVolume=v,new P(Y))},P.createGeometry=function(r){var n=r._positions,o=r._height,s=r._width,l=r._extrudedHeight,u=o!==l,c=e(n,i.equalsEpsilon);if(!(c.length<2||s<=0)){var h,p=r._ellipsoid,m=r._vertexFormat,f={ellipsoid:p,positions:c,width:s,cornerType:r._cornerType,granularity:r._granularity,saveAttributes:!0};if(u){var _=Math.max(o,l);l=Math.min(o,l),o=_,f.height=o,f.extrudedHeight=l,f.shadowVolume=r._shadowVolume,h=T(f,m)}else{var y=a.computePositions(f);h=S(y,m,p),h.attributes.position.values=g.scaleToGeodeticHeight(h.attributes.position.values,o,p)}var C=h.attributes,w=t.fromVertices(C.position.values,void 0,3);return m.position||(h.attributes.position.values=void 0),new d({attributes:C,indices:h.indices,primitiveType:v.TRIANGLES,boundingSphere:w})}},P.createShadowVolume=function(e,t,i){var r=e._granularity,n=e._ellipsoid,o=t(r,n),a=i(r,n);return new P({positions:e._positions,width:e._width,cornerType:e._cornerType,ellipsoid:n,granularity:r,extrudedHeight:o,height:a,vertexFormat:C.POSITION_ONLY,shadowVolume:!0})},u(P.prototype,{rectangle:{get:function(){return this._rectangle}}}),P}),i("Core/CorridorOutlineGeometry",["./arrayRemoveDuplicates","./BoundingSphere","./Cartesian3","./ComponentDatatype","./CornerType","./CorridorGeometryLibrary","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolygonPipeline","./PrimitiveType"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_){"use strict";function g(e,t){var a,l,u,c=[],m=e.positions,f=e.corners,_=e.endPositions,g=new d,v=0,y=0,E=0;for(l=0;l<m.length;l+=2)u=m[l].length-3,v+=u,E+=u/3*4,y+=m[l+1].length-3;for(v+=3,y+=3,l=0;l<f.length;l++){a=f[l];var b=f[l].leftPositions;s(b)?(u=b.length,v+=u,E+=u/3*2):(u=f[l].rightPositions.length,y+=u,E+=u/3*2)}var T,x=s(_);x&&(T=_[0].length-3,v+=T,y+=T,T/=3,E+=4*T);var A,P,D,M,I,R,O=v+y,N=new Float64Array(O),L=0,B=O-1,F=T/2,V=p.createTypedArray(O/3,E+4),k=0;if(V[k++]=L/3,V[k++]=(B-2)/3,x){c.push(L/3),R=C,I=w;var z=_[0];for(l=0;l<F;l++)R=i.fromArray(z,3*(F-1-l),R),I=i.fromArray(z,3*(F+l),I),o.addAttribute(N,I,L),o.addAttribute(N,R,void 0,B),P=L/3,M=P+1,A=(B-2)/3,D=A-1,V[k++]=A,V[k++]=D,V[k++]=P,V[k++]=M,L+=3,B-=3}var U=0,G=m[U++],W=m[U++];for(N.set(G,L),N.set(W,B-W.length+1),u=W.length-3,c.push(L/3,(B-2)/3),l=0;l<u;l+=3)P=L/3,M=P+1,A=(B-2)/3,D=A-1,V[k++]=A,V[k++]=D,V[k++]=P,V[k++]=M,L+=3,B-=3;for(l=0;l<f.length;l++){var H;a=f[l];var q,j=a.leftPositions,Y=a.rightPositions,X=S;if(s(j)){for(B-=3,q=D,c.push(M),H=0;H<j.length/3;H++)X=i.fromArray(j,3*H,X),V[k++]=q-H-1,V[k++]=q-H,o.addAttribute(N,X,void 0,B),B-=3;c.push(q-Math.floor(j.length/6)),t===n.BEVELED&&c.push((B-2)/3+1),L+=3}else{for(L+=3,q=M,c.push(D),H=0;H<Y.length/3;H++)X=i.fromArray(Y,3*H,X),V[k++]=q+H,V[k++]=q+H+1,o.addAttribute(N,X,L),L+=3;c.push(q+Math.floor(Y.length/6)),t===n.BEVELED&&c.push(L/3-1),B-=3}for(G=m[U++],W=m[U++],G.splice(0,3),W.splice(W.length-3,3),N.set(G,L),N.set(W,B-W.length+1),u=W.length-3,H=0;H<W.length;H+=3)M=L/3,P=M-1,D=(B-2)/3,A=D+1,V[k++]=A,V[k++]=D,V[k++]=P,V[k++]=M,L+=3,B-=3;L-=3,B+=3,c.push(L/3,(B-2)/3)}if(x){L+=3,B-=3,R=C,I=w;var Z=_[1];for(l=0;l<F;l++)R=i.fromArray(Z,3*(T-l-1),R),I=i.fromArray(Z,3*l,I),o.addAttribute(N,R,void 0,B),o.addAttribute(N,I,L),M=L/3,P=M-1,D=(B-2)/3,A=D+1,V[k++]=A,V[k++]=D,V[k++]=P,V[k++]=M,L+=3,B-=3;c.push(L/3)}else c.push(L/3,(B-2)/3);return V[k++]=L/3,V[k++]=(B-2)/3,g.position=new h({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:N}),{attributes:g,indices:V,wallIndices:c}}function v(e){var t=e.ellipsoid,i=o.computePositions(e),r=g(i,e.cornerType),n=r.wallIndices,a=e.height,s=e.extrudedHeight,l=r.attributes,u=r.indices,c=l.position.values,h=c.length,d=new Float64Array(h);d.set(c);var m=new Float64Array(2*h);c=f.scaleToGeodeticHeight(c,a,t),d=f.scaleToGeodeticHeight(d,s,t),m.set(c),m.set(d,h),l.position.values=m,h/=3;var _,v=u.length,y=p.createTypedArray(m.length/3,2*(v+n.length));y.set(u);var C=v;for(_=0;_<v;_+=2){var w=u[_],S=u[_+1];y[C++]=w+h,y[C++]=S+h}var E,b;for(_=0;_<n.length;_++)E=n[_],b=E+h,y[C++]=E,y[C++]=b;return{attributes:l,indices:y}}function y(e){e=a(e,a.EMPTY_OBJECT);var t=e.positions,r=e.width;this._positions=t,this._ellipsoid=u.clone(a(e.ellipsoid,u.WGS84)),this._width=r,this._height=a(e.height,0),this._extrudedHeight=a(e.extrudedHeight,this._height),this._cornerType=a(e.cornerType,n.ROUNDED),this._granularity=a(e.granularity,m.RADIANS_PER_DEGREE),this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*i.packedLength+u.packedLength+5}var C=new i,w=new i,S=new i;y.pack=function(e,t,r){r=a(r,0);var n=e._positions,o=n.length;t[r++]=o;for(var s=0;s<o;++s,r+=i.packedLength)i.pack(n[s],t,r);return u.pack(e._ellipsoid,t,r),r+=u.packedLength,t[r++]=e._width,t[r++]=e._height,t[r++]=e._extrudedHeight,t[r++]=e._cornerType,t[r]=e._granularity,t};var E=u.clone(u.UNIT_SPHERE),b={positions:void 0,ellipsoid:E,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0};return y.unpack=function(e,t,r){t=a(t,0);for(var n=e[t++],o=new Array(n),l=0;l<n;++l,t+=i.packedLength)o[l]=i.unpack(e,t);var c=u.unpack(e,t,E);t+=u.packedLength;var h=e[t++],d=e[t++],p=e[t++],m=e[t++],f=e[t];return s(r)?(r._positions=o,r._ellipsoid=u.clone(c,r._ellipsoid),r._width=h,r._height=d,r._extrudedHeight=p,r._cornerType=m,r._granularity=f,r):(b.positions=o,b.width=h,b.height=d,b.extrudedHeight=p,b.cornerType=m,b.granularity=f,new y(b))},y.createGeometry=function(r){var n=r._positions,a=r._height,s=r._width,l=r._extrudedHeight,u=a!==l,h=e(n,i.equalsEpsilon);if(!(h.length<2||s<=0)){var d,p=r._ellipsoid,m={ellipsoid:p,positions:h,width:s,cornerType:r._cornerType,granularity:r._granularity,saveAttributes:!1};if(u){var y=Math.max(a,l);l=Math.min(a,l),a=y,m.height=a,m.extrudedHeight=l,d=v(m)}else{var C=o.computePositions(m);d=g(C,m.cornerType),d.attributes.position.values=f.scaleToGeodeticHeight(d.attributes.position.values,a,p)}var w=d.attributes,S=t.fromVertices(w.position.values,void 0,3);return new c({attributes:w,indices:d.indices,primitiveType:_.LINES,boundingSphere:S})}},y}),i("Core/createGuid",[],function(){"use strict";function e(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0,i="x"===e?t:3&t|8;return i.toString(16)})}return e}),i("Core/CylinderGeometryLibrary",["./Math"],function(e){"use strict";var t={};return t.computePositions=function(t,i,r,n,o){var a,s=.5*t,l=-s,u=n+n,c=o?2*u:u,h=new Float64Array(3*c),d=0,p=0,m=o?3*u:0,f=o?3*(u+n):3*n;for(a=0;a<n;a++){var _=a/n*e.TWO_PI,g=Math.cos(_),v=Math.sin(_),y=g*r,C=v*r,w=g*i,S=v*i;h[p+m]=y,h[p+m+1]=C,h[p+m+2]=l,h[p+f]=w,h[p+f+1]=S,h[p+f+2]=s,p+=3,o&&(h[d++]=y,h[d++]=C,h[d++]=l,h[d++]=w,h[d++]=S,h[d++]=s)}return h},t}),i("Core/CylinderGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./CylinderGeometryLibrary","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./VertexFormat"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m){"use strict";function f(e){e=o(e,o.EMPTY_OBJECT);var t=e.length,i=e.topRadius,r=e.bottomRadius,n=o(e.vertexFormat,m.DEFAULT),a=o(e.slices,128);this._length=t,this._topRadius=i,this._bottomRadius=r,this._vertexFormat=m.clone(n),this._slices=a,this._workerName="createCylinderGeometry"}var _=new t,g=new i,v=new i,y=new i,C=new i;f.packedLength=m.packedLength+4,f.pack=function(e,t,i){return i=o(i,0),m.pack(e._vertexFormat,t,i),i+=m.packedLength,t[i++]=e._length,t[i++]=e._topRadius,t[i++]=e._bottomRadius,t[i]=e._slices,t};var w=new m,S={vertexFormat:w,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0};return f.unpack=function(e,t,i){t=o(t,0);var r=m.unpack(e,t,w);t+=m.packedLength;var n=e[t++],s=e[t++],l=e[t++],u=e[t];return a(i)?(i._vertexFormat=m.clone(r,i._vertexFormat),i._length=n,i._topRadius=s,i._bottomRadius=l,i._slices=u,i):(S.length=n,S.topRadius=s,S.bottomRadius=l,S.slices=u,new f(S))},f.createGeometry=function(o){var a=o._length,s=o._topRadius,m=o._bottomRadius,f=o._vertexFormat,w=o._slices;if(!(a<=0||s<0||m<0||0===s&&0===m)){var S,E=w+w,b=w+E,T=E+E,x=n.computePositions(a,s,m,w,!0),A=f.st?new Float32Array(2*T):void 0,P=f.normal?new Float32Array(3*T):void 0,D=f.tangent?new Float32Array(3*T):void 0,M=f.bitangent?new Float32Array(3*T):void 0,I=f.normal||f.tangent||f.bitangent;if(I){var R=f.tangent||f.bitangent,O=0,N=0,L=0,B=g;B.z=0;var F=y,V=v;for(S=0;S<w;S++){var k=S/w*d.TWO_PI,z=Math.cos(k),U=Math.sin(k);I&&(B.x=z,B.y=U,R&&(F=i.normalize(i.cross(i.UNIT_Z,B,F),F)),f.normal&&(P[O++]=z,P[O++]=U,P[O++]=0,P[O++]=z,P[O++]=U,P[O++]=0),f.tangent&&(D[N++]=F.x,D[N++]=F.y,D[N++]=F.z,D[N++]=F.x,D[N++]=F.y,D[N++]=F.z),f.bitangent&&(V=i.normalize(i.cross(B,F,V),V),M[L++]=V.x,M[L++]=V.y,M[L++]=V.z,M[L++]=V.x,M[L++]=V.y,M[L++]=V.z))}for(S=0;S<w;S++)f.normal&&(P[O++]=0,P[O++]=0,P[O++]=-1),f.tangent&&(D[N++]=1,D[N++]=0,D[N++]=0),f.bitangent&&(M[L++]=0,M[L++]=-1,M[L++]=0);for(S=0;S<w;S++)f.normal&&(P[O++]=0,P[O++]=0,P[O++]=1),f.tangent&&(D[N++]=1,D[N++]=0,D[N++]=0),f.bitangent&&(M[L++]=0,M[L++]=1,M[L++]=0)}var G=12*w-12,W=h.createTypedArray(T,G),H=0,q=0;for(S=0;S<w-1;S++)W[H++]=q,W[H++]=q+2,W[H++]=q+3,W[H++]=q,W[H++]=q+3,W[H++]=q+1,q+=2;for(W[H++]=E-2,W[H++]=0,W[H++]=1,W[H++]=E-2,W[H++]=1,W[H++]=E-1,S=1;S<w-1;S++)W[H++]=E+S+1,W[H++]=E+S,W[H++]=E;for(S=1;S<w-1;S++)W[H++]=b,W[H++]=b+S,W[H++]=b+S+1;var j=0;if(f.st){var Y=Math.max(s,m);for(S=0;S<T;S++){var X=i.fromArray(x,3*S,C);A[j++]=(X.x+Y)/(2*Y),A[j++]=(X.y+Y)/(2*Y)}}var Z=new c;f.position&&(Z.position=new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:x})),f.normal&&(Z.normal=new u({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:P})),f.tangent&&(Z.tangent=new u({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:D})),f.bitangent&&(Z.bitangent=new u({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:M})),f.st&&(Z.st=new u({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:A})),_.x=.5*a,_.y=Math.max(m,s);var K=new e(i.ZERO,t.magnitude(_));return new l({attributes:Z,indices:W,primitiveType:p.TRIANGLES,boundingSphere:K})}},f}),i("Core/CylinderOutlineGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./CylinderGeometryLibrary","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./PrimitiveType"],function(e,t,i,r,n,o,a,s,l,u,c,h,d){"use strict";function p(e){e=o(e,o.EMPTY_OBJECT);var t=e.length,i=e.topRadius,r=e.bottomRadius,n=o(e.slices,128),a=Math.max(o(e.numberOfVerticalLines,16),0);this._length=t,this._topRadius=i,this._bottomRadius=r,this._slices=n,this._numberOfVerticalLines=a,this._workerName="createCylinderOutlineGeometry"}var m=new t;p.packedLength=5,p.pack=function(e,t,i){return i=o(i,0),t[i++]=e._length,t[i++]=e._topRadius,t[i++]=e._bottomRadius,t[i++]=e._slices,t[i]=e._numberOfVerticalLines,t};var f={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0};return p.unpack=function(e,t,i){t=o(t,0);var r=e[t++],n=e[t++],s=e[t++],l=e[t++],u=e[t];return a(i)?(i._length=r,i._topRadius=n,i._bottomRadius=s,i._slices=l,i._numberOfVerticalLines=u,i):(f.length=r,f.topRadius=n,f.bottomRadius=s,f.slices=l,f.numberOfVerticalLines=u,new p(f))},p.createGeometry=function(o){var a=o._length,s=o._topRadius,p=o._bottomRadius,f=o._slices,_=o._numberOfVerticalLines;if(!(a<=0||s<0||p<0||0===s&&0===p)){var g,v=2*f,y=n.computePositions(a,s,p,f,!1),C=2*f;if(_>0){var w=Math.min(_,f);g=Math.round(f/w),C+=w}for(var S=h.createTypedArray(v,2*C),E=0,b=0;b<f-1;b++)S[E++]=b,S[E++]=b+1,S[E++]=b+f,S[E++]=b+1+f;if(S[E++]=f-1,S[E++]=0,S[E++]=f+f-1,S[E++]=f,_>0)for(b=0;b<f;b+=g)S[E++]=b,S[E++]=b+f;var T=new c;T.position=new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:y}),m.x=.5*a,m.y=Math.max(p,s);var x=new e(i.ZERO,t.magnitude(m));return new l({attributes:T,indices:S,primitiveType:d.LINES,boundingSphere:x})}},p}),i("Core/DefaultProxy",[],function(){"use strict";function e(e){this.proxy=e}return e.prototype.getURL=function(e){var t=this.proxy.indexOf("?")===-1?"?":"";return this.proxy+t+encodeURIComponent(e)},e}),i("Core/DistanceDisplayCondition",["./defaultValue","./defined","./defineProperties"],function(e,t,i){"use strict";function r(t,i){t=e(t,0),this._near=t,i=e(i,Number.MAX_VALUE),this._far=i}return i(r.prototype,{near:{get:function(){return this._near},set:function(e){this._near=e}},far:{get:function(){return this._far},set:function(e){this._far=e}}}),r.equals=function(e,i){return e===i||t(e)&&t(i)&&e.near===i.near&&e.far===i.far},r.clone=function(e,i){if(t(e))return t(i)||(i=new r),i.near=e.near,i.far=e.far,i},r.prototype.clone=function(e){return r.clone(this,e)},r.prototype.equals=function(e){return r.equals(this,e)},r}),i("Core/DistanceDisplayConditionGeometryInstanceAttribute",["./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError"],function(e,t,i,r,n){"use strict";function o(e,i){e=t(e,0),i=t(i,Number.MAX_VALUE),this.value=new Float32Array([e,i])}return r(o.prototype,{componentDatatype:{get:function(){return e.FLOAT}},componentsPerAttribute:{get:function(){return 2}},normalize:{get:function(){return!1}}}),o.fromDistanceDisplayCondition=function(e){return new o(e.near,e.far)},o.toValue=function(e,t){return i(t)?(t[0]=e.near,t[1]=e.far,t):new Float32Array([e.near,e.far])},o}),i("ThirdParty/Tween",[],function(){void 0===Date.now&&(Date.now=function(){return(new Date).valueOf()});var e=e||function(){var e=[];return{REVISION:"13",getAll:function(){return e},removeAll:function(){e=[]},add:function(t){e.push(t)},remove:function(t){var i=e.indexOf(t);i!==-1&&e.splice(i,1)},update:function(t){if(0===e.length)return!1;var i=0;for(t=void 0!==t?t:"undefined"!=typeof window&&void 0!==window.performance&&void 0!==window.performance.now?window.performance.now():Date.now();i<e.length;)e[i].update(t)?i++:e.splice(i,1);return!0}}}();return e.Tween=function(t){var i=t,r={},n={},o={},a=1e3,s=0,l=!1,u=!1,c=!1,h=0,d=null,p=e.Easing.Linear.None,m=e.Interpolation.Linear,f=[],_=null,g=!1,v=null,y=null,C=null;for(var w in t)r[w]=parseFloat(t[w],10);this.to=function(e,t){return void 0!==t&&(a=t),n=e,this},this.start=function(t){e.add(this),u=!0,g=!1,d=void 0!==t?t:"undefined"!=typeof window&&void 0!==window.performance&&void 0!==window.performance.now?window.performance.now():Date.now(),d+=h;for(var a in n){if(n[a]instanceof Array){if(0===n[a].length)continue;n[a]=[i[a]].concat(n[a])}r[a]=i[a],r[a]instanceof Array==!1&&(r[a]*=1),o[a]=r[a]||0}return this},this.stop=function(){return u?(e.remove(this),u=!1,null!==C&&C.call(i),this.stopChainedTweens(),this):this},this.stopChainedTweens=function(){for(var e=0,t=f.length;e<t;e++)f[e].stop()},this.delay=function(e){return h=e,this},this.repeat=function(e){return s=e,this},this.yoyo=function(e){return l=e,this},this.easing=function(e){return p=e,this},this.interpolation=function(e){return m=e,this},this.chain=function(){return f=arguments,this},this.onStart=function(e){return _=e,this},this.onUpdate=function(e){return v=e,this},this.onComplete=function(e){return y=e,this},this.onStop=function(e){return C=e,this},this.update=function(e){var t;if(e<d)return!0;g===!1&&(null!==_&&_.call(i),g=!0);var u=(e-d)/a;u=u>1?1:u;var C=p(u);for(t in n){var w=r[t]||0,S=n[t];S instanceof Array?i[t]=m(S,C):("string"==typeof S&&(S=w+parseFloat(S,10)),"number"==typeof S&&(i[t]=w+(S-w)*C))}if(null!==v&&v.call(i,C),1==u){if(s>0){isFinite(s)&&s--;for(t in o){if("string"==typeof n[t]&&(o[t]=o[t]+parseFloat(n[t],10)),l){var E=o[t];o[t]=n[t],n[t]=E}r[t]=o[t]}return l&&(c=!c),d=e+h,!0}null!==y&&y.call(i);for(var b=0,T=f.length;b<T;b++)f[b].start(e);return!1}return!0}},e.Easing={Linear:{None:function(e){return e}},Quadratic:{In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}},Cubic:{In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}},Quartic:{In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}},Quintic:{In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}},Sinusoidal:{In:function(e){return 1-Math.cos(e*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return.5*(1-Math.cos(Math.PI*e))}},Exponential:{In:function(e){return 0===e?0:Math.pow(1024,e-1)},Out:function(e){return 1===e?1:1-Math.pow(2,-10*e)},InOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)}},Circular:{In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}},Elastic:{In:function(e){var t,i=.1,r=.4;return 0===e?0:1===e?1:(!i||i<1?(i=1,t=r/4):t=r*Math.asin(1/i)/(2*Math.PI),-(i*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/r)))},Out:function(e){var t,i=.1,r=.4;return 0===e?0:1===e?1:(!i||i<1?(i=1,t=r/4):t=r*Math.asin(1/i)/(2*Math.PI),i*Math.pow(2,-10*e)*Math.sin((e-t)*(2*Math.PI)/r)+1)},InOut:function(e){var t,i=.1,r=.4;return 0===e?0:1===e?1:(!i||i<1?(i=1,t=r/4):t=r*Math.asin(1/i)/(2*Math.PI),(e*=2)<1?-.5*(i*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/r)):i*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/r)*.5+1)}},Back:{In:function(e){var t=1.70158;return e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)}},Bounce:{In:function(t){return 1-e.Easing.Bounce.Out(1-t)},Out:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},InOut:function(t){return t<.5?.5*e.Easing.Bounce.In(2*t):.5*e.Easing.Bounce.Out(2*t-1)+.5}}},e.Interpolation={Linear:function(t,i){var r=t.length-1,n=r*i,o=Math.floor(n),a=e.Interpolation.Utils.Linear;return i<0?a(t[0],t[1],n):i>1?a(t[r],t[r-1],r-n):a(t[o],t[o+1>r?r:o+1],n-o)},Bezier:function(t,i){var r,n=0,o=t.length-1,a=Math.pow,s=e.Interpolation.Utils.Bernstein;for(r=0;r<=o;r++)n+=a(1-i,o-r)*a(i,r)*t[r]*s(o,r);return n},CatmullRom:function(t,i){var r=t.length-1,n=r*i,o=Math.floor(n),a=e.Interpolation.Utils.CatmullRom;return t[0]===t[r]?(i<0&&(o=Math.floor(n=r*(1+i))),a(t[(o-1+r)%r],t[o],t[(o+1)%r],t[(o+2)%r],n-o)):i<0?t[0]-(a(t[0],t[0],t[1],t[1],-n)-t[0]):i>1?t[r]-(a(t[r],t[r],t[r-1],t[r-1],n-r)-t[r]):a(t[o?o-1:0],t[o],t[r<o+1?r:o+1],t[r<o+2?r:o+2],n-o)},Utils:{Linear:function(e,t,i){return(t-e)*i+e},Bernstein:function(t,i){var r=e.Interpolation.Utils.Factorial;return r(t)/r(i)/r(t-i)},Factorial:function(){var e=[1];return function(t){var i,r=1;if(e[t])return e[t];for(i=t;i>1;i--)r*=i;return e[t]=r}}(),CatmullRom:function(e,t,i,r,n){var o=.5*(i-e),a=.5*(r-t),s=n*n,l=n*s;return(2*t-2*i+o+a)*l+(-3*t+3*i-2*o-a)*s+o*n+t}}},e}),i("Core/EasingFunction",["../ThirdParty/Tween","./freezeObject"],function(e,t){"use strict";var i={LINEAR_NONE:e.Easing.Linear.None,QUADRACTIC_IN:e.Easing.Quadratic.In,QUADRACTIC_OUT:e.Easing.Quadratic.Out,QUADRACTIC_IN_OUT:e.Easing.Quadratic.InOut,CUBIC_IN:e.Easing.Cubic.In,CUBIC_OUT:e.Easing.Cubic.Out,CUBIC_IN_OUT:e.Easing.Cubic.InOut,QUARTIC_IN:e.Easing.Quartic.In,QUARTIC_OUT:e.Easing.Quartic.Out,QUARTIC_IN_OUT:e.Easing.Quartic.InOut,QUINTIC_IN:e.Easing.Quintic.In,QUINTIC_OUT:e.Easing.Quintic.Out,QUINTIC_IN_OUT:e.Easing.Quintic.InOut,SINUSOIDAL_IN:e.Easing.Sinusoidal.In,SINUSOIDAL_OUT:e.Easing.Sinusoidal.Out,SINUSOIDAL_IN_OUT:e.Easing.Sinusoidal.InOut,EXPONENTIAL_IN:e.Easing.Exponential.In,EXPONENTIAL_OUT:e.Easing.Exponential.Out,EXPONENTIAL_IN_OUT:e.Easing.Exponential.InOut,CIRCULAR_IN:e.Easing.Circular.In,CIRCULAR_OUT:e.Easing.Circular.Out,CIRCULAR_IN_OUT:e.Easing.Circular.InOut,ELASTIC_IN:e.Easing.Elastic.In,ELASTIC_OUT:e.Easing.Elastic.Out,ELASTIC_IN_OUT:e.Easing.Elastic.InOut,BACK_IN:e.Easing.Back.In,BACK_OUT:e.Easing.Back.Out,BACK_IN_OUT:e.Easing.Back.InOut,BOUNCE_IN:e.Easing.Bounce.In,BOUNCE_OUT:e.Easing.Bounce.Out,BOUNCE_IN_OUT:e.Easing.Bounce.InOut};return t(i)}),i("Core/EllipsoidGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./VertexFormat"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m){"use strict";function f(e){e=n(e,n.EMPTY_OBJECT);var t=n(e.radii,w),r=n(e.stackPartitions,64),o=n(e.slicePartitions,64),a=n(e.vertexFormat,m.DEFAULT);this._radii=i.clone(t),this._stackPartitions=r,this._slicePartitions=o,this._vertexFormat=m.clone(a),this._workerName="createEllipsoidGeometry"}var _=new i,g=new i,v=new i,y=new i,C=new i,w=new i(1,1,1),S=Math.cos,E=Math.sin;f.packedLength=i.packedLength+m.packedLength+2,f.pack=function(e,t,r){return r=n(r,0),i.pack(e._radii,t,r),r+=i.packedLength,m.pack(e._vertexFormat,t,r),r+=m.packedLength,t[r++]=e._stackPartitions,t[r]=e._slicePartitions,t};var b=new i,T=new m,x={radii:b,vertexFormat:T,stackPartitions:void 0,slicePartitions:void 0};return f.unpack=function(e,t,r){t=n(t,0);var a=i.unpack(e,t,b);t+=i.packedLength;var s=m.unpack(e,t,T);t+=m.packedLength;var l=e[t++],u=e[t];return o(r)?(r._radii=i.clone(a,r._radii),r._vertexFormat=m.clone(s,r._vertexFormat),r._stackPartitions=l,r._slicePartitions=u,r):(x.stackPartitions=l,x.slicePartitions=u,new f(x))},f.createGeometry=function(n){var o=n._radii;if(!(o.x<=0||o.y<=0||o.z<=0)){var a,m,f=s.fromCartesian3(o),w=n._vertexFormat,b=n._slicePartitions+1,T=n._stackPartitions+1,x=T*b,A=new Float64Array(3*x),P=6*(b-1)*(T-2),D=h.createTypedArray(x,P),M=w.normal?new Float32Array(3*x):void 0,I=w.tangent?new Float32Array(3*x):void 0,R=w.bitangent?new Float32Array(3*x):void 0,O=w.st?new Float32Array(2*x):void 0,N=new Array(b),L=new Array(b),B=0; +for(a=0;a<b;a++){var F=d.TWO_PI*a/(b-1);N[a]=S(F),L[a]=E(F),A[B++]=0,A[B++]=0,A[B++]=o.z}for(a=1;a<T-1;a++){var V=Math.PI*a/(T-1),k=E(V),z=o.x*k,U=o.y*k,G=o.z*S(V);for(m=0;m<b;m++)A[B++]=N[m]*z,A[B++]=L[m]*U,A[B++]=G}for(a=0;a<b;a++)A[B++]=0,A[B++]=0,A[B++]=-o.z;var W=new c;w.position&&(W.position=new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:A}));var H=0,q=0,j=0,Y=0;if(w.st||w.normal||w.tangent||w.bitangent){for(a=0;a<x;a++){var X=i.fromArray(A,3*a,_),Z=f.geodeticSurfaceNormal(X,g);if(w.st){var K=t.negate(Z,C);t.magnitude(K)<d.EPSILON6&&(B=3*(a+b*Math.floor(.5*T)),B>A.length&&(B=3*(a-b*Math.floor(.5*T))),i.fromArray(A,B,K),f.geodeticSurfaceNormal(K,K),t.negate(K,K)),O[H++]=Math.atan2(K.y,K.x)/d.TWO_PI+.5,O[H++]=Math.asin(Z.z)/Math.PI+.5}if(w.normal&&(M[q++]=Z.x,M[q++]=Z.y,M[q++]=Z.z),w.tangent||w.bitangent){var Q=v;if(a<b||a>x-b-1?(i.cross(i.UNIT_X,Z,Q),i.normalize(Q,Q)):(i.cross(i.UNIT_Z,Z,Q),i.normalize(Q,Q)),w.tangent&&(I[j++]=Q.x,I[j++]=Q.y,I[j++]=Q.z),w.bitangent){var J=i.cross(Z,Q,y);i.normalize(J,J),R[Y++]=J.x,R[Y++]=J.y,R[Y++]=J.z}}}w.st&&(W.st=new u({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:O})),w.normal&&(W.normal=new u({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:M})),w.tangent&&(W.tangent=new u({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:I})),w.bitangent&&(W.bitangent=new u({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:R}))}for(B=0,m=0;m<b-1;m++)D[B++]=b+m,D[B++]=b+m+1,D[B++]=m+1;var $,ee;for(a=1;a<T-2;a++)for($=a*b,ee=(a+1)*b,m=0;m<b-1;m++)D[B++]=ee+m,D[B++]=ee+m+1,D[B++]=$+m+1,D[B++]=ee+m,D[B++]=$+m+1,D[B++]=$+m;for(a=T-2,$=a*b,ee=(a+1)*b,m=0;m<b-1;m++)D[B++]=ee+m,D[B++]=$+m+1,D[B++]=$+m;return new l({attributes:W,indices:D,primitiveType:p.TRIANGLES,boundingSphere:e.fromEllipsoid(f)})}},f}),i("Core/EllipsoidOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType"],function(e,t,i,r,n,o,a,s,l,u,c,h,d){"use strict";function p(e){e=r(e,r.EMPTY_OBJECT);var i=r(e.radii,m),n=r(e.stackPartitions,10),o=r(e.slicePartitions,8),a=r(e.subdivisions,128);this._radii=t.clone(i),this._stackPartitions=n,this._slicePartitions=o,this._subdivisions=a,this._workerName="createEllipsoidOutlineGeometry"}var m=new t(1,1,1),f=Math.cos,_=Math.sin;p.packedLength=t.packedLength+3,p.pack=function(e,i,n){return n=r(n,0),t.pack(e._radii,i,n),n+=t.packedLength,i[n++]=e._stackPartitions,i[n++]=e._slicePartitions,i[n]=e._subdivisions,i};var g=new t,v={radii:g,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};return p.unpack=function(e,i,o){i=r(i,0);var a=t.unpack(e,i,g);i+=t.packedLength;var s=e[i++],l=e[i++],u=e[i++];return n(o)?(o._radii=t.clone(a,o._radii),o._stackPartitions=s,o._slicePartitions=l,o._subdivisions=u,o):(v.stackPartitions=s,v.slicePartitions=l,v.subdivisions=u,new p(v))},p.createGeometry=function(t){var r=t._radii;if(!(r.x<=0||r.y<=0||r.z<=0)){var n,o,p,m,g,v,y=a.fromCartesian3(r),C=t._stackPartitions,w=t._slicePartitions,S=t._subdivisions,E=S*(C+w-1),b=E-w+2,T=new Float64Array(3*b),x=c.createTypedArray(b,2*E),A=0,P=new Array(S),D=new Array(S);for(n=0;n<S;n++)p=h.TWO_PI*n/S,P[n]=f(p),D[n]=_(p);for(n=1;n<C;n++)for(m=Math.PI*n/C,g=f(m),v=_(m),o=0;o<S;o++)T[A++]=r.x*P[o]*v,T[A++]=r.y*D[o]*v,T[A++]=r.z*g;for(P.length=w,D.length=w,n=0;n<w;n++)p=h.TWO_PI*n/w,P[n]=f(p),D[n]=_(p);for(T[A++]=0,T[A++]=0,T[A++]=r.z,n=1;n<S;n++)for(m=Math.PI*n/S,g=f(m),v=_(m),o=0;o<w;o++)T[A++]=r.x*P[o]*v,T[A++]=r.y*D[o]*v,T[A++]=r.z*g;for(T[A++]=0,T[A++]=0,T[A++]=-r.z,A=0,n=0;n<C-1;++n){var M=n*S;for(o=0;o<S-1;++o)x[A++]=M+o,x[A++]=M+o+1;x[A++]=M+S-1,x[A++]=M}var I=S*(C-1);for(o=1;o<w+1;++o)x[A++]=I,x[A++]=I+o;for(n=0;n<S-2;++n){var R=n*w+1+I,O=(n+1)*w+1+I;for(o=0;o<w-1;++o)x[A++]=O+o,x[A++]=R+o;x[A++]=O+w-1,x[A++]=R+w-1}var N=T.length/3-1;for(o=N-1;o>N-w-1;--o)x[A++]=N,x[A++]=o;var L=new u({position:new l({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:T})});return new s({attributes:L,indices:x,primitiveType:d.LINES,boundingSphere:e.fromEllipsoid(y)})}},p}),i("Core/EllipsoidTerrainProvider",["../ThirdParty/when","./defaultValue","./defined","./defineProperties","./Ellipsoid","./Event","./GeographicTilingScheme","./HeightmapTerrainData","./TerrainProvider"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(r){r=t(r,{}),this._tilingScheme=r.tilingScheme,i(this._tilingScheme)||(this._tilingScheme=new a({ellipsoid:t(r.ellipsoid,n.WGS84)})),this._levelZeroMaximumGeometricError=l.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new o,this._readyPromise=e.resolve(!0)}return r(u.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return!0}},readyPromise:{get:function(){return this._readyPromise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}}}),u.prototype.requestTileGeometry=function(e,t,i,r){var n=16,o=16;return new s({buffer:new Uint8Array(n*o),width:n,height:o})},u.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)},u.prototype.getTileDataAvailable=function(e,t,i){},u}),i("Core/EventHelper",["./defined","./DeveloperError"],function(e,t){"use strict";function i(){this._removalFunctions=[]}return i.prototype.add=function(e,t,i){var r=e.addEventListener(t,i);this._removalFunctions.push(r);var n=this;return function(){r();var e=n._removalFunctions;e.splice(e.indexOf(r),1)}},i.prototype.removeAll=function(){for(var e=this._removalFunctions,t=0,i=e.length;t<i;++t)e[t]();e.length=0},i}),i("Core/ExtrapolationType",["./freezeObject"],function(e){"use strict";var t={NONE:0,HOLD:1,EXTRAPOLATE:2};return e(t)}),i("Core/GeocoderService",["./defineProperties","./DeveloperError"],function(e,t){"use strict";function i(){}return i.prototype.geocode=t.throwInstantiationError,i}),i("Core/GeometryInstanceAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.value=t.value}return r}),i("Core/getBaseUri",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(i,r){var n="",o=i.lastIndexOf("/");return o!==-1&&(n=i.substring(0,o+1)),r?(i=new e(i),t(i.query)&&(n+="?"+i.query),t(i.fragment)&&(n+="#"+i.fragment),n):n}return r}),i("Core/getExtensionFromUri",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(t){var i=new e(t);i.normalize();var r=i.path,n=r.lastIndexOf("/");return n!==-1&&(r=r.substr(n+1)),n=r.lastIndexOf("."),r=n===-1?"":r.substr(n+1)}return r}),i("Core/getFilenameFromUri",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(t){var i=new e(t);i.normalize();var r=i.path,n=r.lastIndexOf("/");return n!==-1&&(r=r.substr(n+1)),r}return r}),i("Core/getStringFromTypedArray",["./defaultValue","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(t,i,n){return i=e(i,0),n=e(n,t.byteLength-i),t=t.subarray(i,i+n),r.decode(t)}return r.decodeWithTextDecoder=function(e){var t=new TextDecoder("utf-8");return t.decode(e)},r.decodeWithFromCharCode=function(e){for(var t="",i=e.length,r=0;r<i;++r)t+=String.fromCharCode(e[r]);return t},"undefined"!=typeof TextDecoder?r.decode=r.decodeWithTextDecoder:r.decode=r.decodeWithFromCharCode,r}),i("Core/getMagic",["./defaultValue","./getStringFromTypedArray"],function(e,t){"use strict";function i(i,r){return r=e(r,0),t(i,r,Math.min(4,i.length))}return i}),i("Core/HeadingPitchRange",["./defaultValue","./defined"],function(e,t){"use strict";function i(t,i,r){this.heading=e(t,0),this.pitch=e(i,0),this.range=e(r,0)}return i.clone=function(e,r){if(t(e))return t(r)||(r=new i),r.heading=e.heading,r.pitch=e.pitch,r.range=e.range,r},i}),i("Core/HermitePolynomialApproximation",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,i,r){"use strict";function n(e,t,i,r,o,a){var s,l,u,c=0;if(r>0){for(l=0;l<o;l++){for(s=!1,u=0;u<a.length&&!s;u++)l===a[u]&&(s=!0);s||(a.push(l),c+=n(e,t,i,r-1,o,a),a.splice(a.length-1,1))}return c}for(c=1,l=0;l<o;l++){for(s=!1,u=0;u<a.length&&!s;u++)l===a[u]&&(s=!0);s||(c*=e-i[t[l]])}return c}function o(e,t,i,n,o,a){for(var s,l,u=-1,c=t.length,h=c*(c+1)/2,d=0;d<o;d++){var p=Math.floor(d*h);for(s=0;s<c;s++)l=t[s]*o*(a+1)+d,e[p+s]=n[l];for(var m=1;m<c;m++){var f=0,_=Math.floor(m*(1-m)/2)+c*m,g=!1;for(s=0;s<c-m;s++){var v,y,C=i[t[s]],w=i[t[s+m]];if(w-C<=0)l=t[s]*o*(a+1)+o*m+d,v=n[l],y=v/r.factorial(m),e[p+_+f]=y,f++;else{var S=Math.floor((m-1)*(2-m)/2)+c*(m-1);v=e[p+S+s+1]-e[p+S+s],y=v/(w-C),e[p+_+f]=y,f++}g=g||0!==v}g&&(u=Math.max(u,m))}}return u}var a=r.factorial,s={type:"Hermite"};s.getRequiredDataPoints=function(t,i){return i=e(i,0),Math.max(Math.floor((t+1)/(i+1)),2)},s.interpolateOrderZero=function(e,i,r,o,s){t(s)||(s=new Array(o));var l,u,c,h,d,p,m=i.length,f=new Array(o);for(l=0;l<o;l++){s[l]=0;var _=new Array(m);for(f[l]=_,u=0;u<m;u++)_[u]=[]}var g=m,v=new Array(g);for(l=0;l<g;l++)v[l]=l;var y=m-1;for(h=0;h<o;h++){for(u=0;u<g;u++)p=v[u]*o+h,f[h][0].push(r[p]);for(l=1;l<g;l++){var C=!1;for(u=0;u<g-l;u++){var w,S=i[v[u]],E=i[v[u+l]];E-S<=0?(p=v[u]*o+o*l+h,w=r[p],f[h][l].push(w/a(l))):(w=f[h][l-1][u+1]-f[h][l-1][u],f[h][l].push(w/(E-S))),C=C||0!==w}C||(y=l-1)}}for(c=0,d=0;c<=d;c++)for(l=c;l<=y;l++){var b=n(e,v,i,c,l,[]);for(h=0;h<o;h++){var T=f[h][l][0];s[h+c*o]+=T*b}}return s};var l=[];return s.interpolate=function(e,i,r,a,s,u,c){var h=a*(u+1);t(c)||(c=new Array(h));for(var d=0;d<h;d++)c[d]=0;for(var p=i.length,m=new Array(p*(s+1)),f=0;f<p;f++)for(var _=0;_<s+1;_++)m[f*(s+1)+_]=f;for(var g=m.length,v=l,y=o(v,m,i,r,a,s),C=[],w=g*(g+1)/2,S=Math.min(y,u),E=0;E<=S;E++)for(f=E;f<=y;f++){C.length=0;for(var b=n(e,m,i,E,f,C),T=Math.floor(f*(1-f)/2)+g*f,x=0;x<a;x++){var A=Math.floor(x*w),P=v[A+T];c[x+E*a]+=P*b}}return c},s}),i("Core/IauOrientationParameters",[],function(){"use strict";function e(e,t,i,r){this.rightAscension=e,this.declination=t,this.rotation=i,this.rotationRate=r}return e}),i("Core/Iau2000Orientation",["./defined","./IauOrientationParameters","./JulianDate","./Math","./TimeConstants"],function(e,t,i,r,n){"use strict";var o={},a=32.184,s=2451545,l=-.0529921,u=-.1059842,c=13.0120009,h=13.3407154,d=.9856003,p=26.4057084,m=13.064993,f=.3287146,_=1.7484877,g=-.1589763,v=.0036096,y=.1643573,C=12.9590088,w=new i;return o.ComputeMoon=function(o,S){e(o)||(o=i.now()),w=i.addSeconds(o,a,w);var E=i.totalDays(w)-s,b=E/n.DAYS_PER_JULIAN_CENTURY,T=(125.045+l*E)*r.RADIANS_PER_DEGREE,x=(250.089+u*E)*r.RADIANS_PER_DEGREE,A=(260.008+c*E)*r.RADIANS_PER_DEGREE,P=(176.625+h*E)*r.RADIANS_PER_DEGREE,D=(357.529+d*E)*r.RADIANS_PER_DEGREE,M=(311.589+p*E)*r.RADIANS_PER_DEGREE,I=(134.963+m*E)*r.RADIANS_PER_DEGREE,R=(276.617+f*E)*r.RADIANS_PER_DEGREE,O=(34.226+_*E)*r.RADIANS_PER_DEGREE,N=(15.134+g*E)*r.RADIANS_PER_DEGREE,L=(119.743+v*E)*r.RADIANS_PER_DEGREE,B=(239.961+y*E)*r.RADIANS_PER_DEGREE,F=(25.053+C*E)*r.RADIANS_PER_DEGREE,V=Math.sin(T),k=Math.sin(x),z=Math.sin(A),U=Math.sin(P),G=Math.sin(D),W=Math.sin(M),H=Math.sin(I),q=Math.sin(R),j=Math.sin(O),Y=Math.sin(N),X=Math.sin(L),Z=Math.sin(B),K=Math.sin(F),Q=Math.cos(T),J=Math.cos(x),$=Math.cos(A),ee=Math.cos(P),te=Math.cos(D),ie=Math.cos(M),re=Math.cos(I),ne=Math.cos(R),oe=Math.cos(O),ae=Math.cos(N),se=Math.cos(L),le=Math.cos(B),ue=Math.cos(F),ce=(269.9949+.0031*b-3.8787*V-.1204*k+.07*z-.0172*U+.0072*W-.0052*Y+.0043*K)*r.RADIANS_PER_DEGREE,he=(66.5392+.013*b+1.5419*Q+.0239*J-.0278*$+.0068*ee-.0029*ie+9e-4*re+8e-4*ae-9e-4*ue)*r.RADIANS_PER_DEGREE,de=(38.3213+13.17635815*E-1.4e-12*E*E+3.561*V+.1208*k-.0642*z+.0158*U+.0252*G-.0066*W-.0047*H-.0046*q+.0028*j+.0052*Y+.004*X+.0019*Z-.0044*K)*r.RADIANS_PER_DEGREE,pe=(13.17635815-1.4e-12*(2*E)+3.561*Q*l+.1208*J*u-.0642*$*c+.0158*ee*h+.0252*te*d-.0066*ie*p-.0047*re*m-.0046*ne*f+.0028*oe*_+.0052*ae*g+.004*se*v+.0019*le*y-.0044*ue*C)/86400*r.RADIANS_PER_DEGREE;return e(S)||(S=new t),S.rightAscension=ce,S.declination=he,S.rotation=de,S.rotationRate=pe,S},o}),i("Core/IauOrientationAxes",["./Cartesian3","./defined","./Iau2000Orientation","./JulianDate","./Math","./Matrix3","./Quaternion"],function(e,t,i,r,n,o,a){"use strict";function s(e){t(e)&&"function"==typeof e||(e=i.ComputeMoon),this._computeFunction=e}function l(i,r,a){var s=u;s.x=Math.cos(i+n.PI_OVER_TWO),s.y=Math.sin(i+n.PI_OVER_TWO),s.z=0;var l=Math.cos(r),d=h;d.x=l*Math.cos(i),d.y=l*Math.sin(i),d.z=Math.sin(r);var p=e.cross(d,s,c);return t(a)||(a=new o),a[0]=s.x,a[1]=p.x,a[2]=d.x,a[3]=s.y,a[4]=p.y,a[5]=d.y,a[6]=s.z,a[7]=p.z,a[8]=d.z,a}var u=new e,c=new e,h=new e,d=new o,p=new a;return s.prototype.evaluate=function(i,s){t(i)||(i=r.now());var u=this._computeFunction(i),c=l(u.rightAscension,u.declination,s),h=n.zeroToTwoPi(u.rotation),m=a.fromAxisAngle(e.UNIT_Z,h,p),f=o.fromQuaternion(a.conjugate(m,m),d),_=o.multiply(f,c,c);return _},s}),i("Core/InterpolationAlgorithm",["./DeveloperError"],function(e){"use strict";var t={};return t.type=void 0,t.getRequiredDataPoints=e.throwInstantiationError,t.interpolateOrderZero=e.throwInstantiationError,t.interpolate=e.throwInstantiationError,t}),i("Core/TimeInterval",["./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./JulianDate"],function(e,t,i,r,n,o){"use strict";function a(i){i=e(i,e.EMPTY_OBJECT),this.start=t(i.start)?o.clone(i.start):new o,this.stop=t(i.stop)?o.clone(i.stop):new o,this.data=i.data,this.isStartIncluded=e(i.isStartIncluded,!0),this.isStopIncluded=e(i.isStopIncluded,!0)}i(a.prototype,{isEmpty:{get:function(){var e=o.compare(this.stop,this.start);return e<0||0===e&&(!this.isStartIncluded||!this.isStopIncluded)}}});var s={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};return a.fromIso8601=function(i,r){var n=i.iso8601.split("/"),l=o.fromIso8601(n[0]),u=o.fromIso8601(n[1]),c=e(i.isStartIncluded,!0),h=e(i.isStopIncluded,!0),d=i.data;return t(r)?(r.start=l,r.stop=u,r.isStartIncluded=c,r.isStopIncluded=h,r.data=d,r):(s.start=l,s.stop=u,s.isStartIncluded=c,s.isStopIncluded=h,s.data=d,new a(s))},a.toIso8601=function(e,t){return o.toIso8601(e.start,t)+"/"+o.toIso8601(e.stop,t)},a.clone=function(e,i){if(t(e))return t(i)?(i.start=e.start,i.stop=e.stop,i.isStartIncluded=e.isStartIncluded,i.isStopIncluded=e.isStopIncluded,i.data=e.data,i):new a(e)},a.equals=function(e,i,r){return e===i||t(e)&&t(i)&&(e.isEmpty&&i.isEmpty||e.isStartIncluded===i.isStartIncluded&&e.isStopIncluded===i.isStopIncluded&&o.equals(e.start,i.start)&&o.equals(e.stop,i.stop)&&(e.data===i.data||t(r)&&r(e.data,i.data)))},a.equalsEpsilon=function(e,i,r,n){return e===i||t(e)&&t(i)&&(e.isEmpty&&i.isEmpty||e.isStartIncluded===i.isStartIncluded&&e.isStopIncluded===i.isStopIncluded&&o.equalsEpsilon(e.start,i.start,r)&&o.equalsEpsilon(e.stop,i.stop,r)&&(e.data===i.data||t(n)&&n(e.data,i.data)))},a.intersect=function(e,i,r,n){if(!t(i))return a.clone(a.EMPTY,r);var s=e.start,l=e.stop,u=i.start,c=i.stop,h=o.greaterThanOrEquals(u,s)&&o.greaterThanOrEquals(l,u),d=!h&&o.lessThanOrEquals(u,s)&&o.lessThanOrEquals(s,c);if(!h&&!d)return a.clone(a.EMPTY,r);var p=e.isStartIncluded,m=e.isStopIncluded,f=i.isStartIncluded,_=i.isStopIncluded,g=o.lessThan(l,c);return r.start=h?u:s,r.isStartIncluded=p&&f||!o.equals(u,s)&&(h&&f||d&&p),r.stop=g?l:c,r.isStopIncluded=g?m:m&&_||!o.equals(c,l)&&_,r.data=t(n)?n(e.data,i.data):e.data,r},a.contains=function(e,t){if(e.isEmpty)return!1;var i=o.compare(e.start,t);if(0===i)return e.isStartIncluded;var r=o.compare(t,e.stop);return 0===r?e.isStopIncluded:i<0&&r<0},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e,t){return a.equals(this,e,t)},a.prototype.equalsEpsilon=function(e,t,i){return a.equalsEpsilon(this,e,t,i)},a.prototype.toString=function(){return a.toIso8601(this)},a.EMPTY=n(new a({start:new o,stop:new o,isStartIncluded:!1,isStopIncluded:!1})),a}),i("Core/Iso8601",["./freezeObject","./JulianDate","./TimeInterval"],function(e,t,i){"use strict";var r=e(t.fromIso8601("0000-01-01T00:00:00Z")),n=e(t.fromIso8601("9999-12-31T24:00:00Z")),o=e(new i({start:r,stop:n})),a={MINIMUM_VALUE:r,MAXIMUM_VALUE:n,MAXIMUM_INTERVAL:o};return a}),i("Core/KeyboardEventModifier",["./freezeObject"],function(e){"use strict";var t={SHIFT:0,CTRL:1,ALT:2};return e(t)}),i("Core/LagrangePolynomialApproximation",["./defined"],function(e){"use strict";var t={type:"Lagrange"};return t.getRequiredDataPoints=function(e){return Math.max(e+1,2)},t.interpolateOrderZero=function(t,i,r,n,o){e(o)||(o=new Array(n));var a,s,l=i.length;for(a=0;a<n;a++)o[a]=0;for(a=0;a<l;a++){var u=1;for(s=0;s<l;s++)if(s!==a){var c=i[a]-i[s];u*=(t-i[s])/c}for(s=0;s<n;s++)o[s]+=u*r[a*n+s]}return o},t}),i("Core/LinearApproximation",["./defined","./DeveloperError"],function(e,t){"use strict";var i={type:"Linear"};return i.getRequiredDataPoints=function(e){return 2},i.interpolateOrderZero=function(t,i,r,n,o){e(o)||(o=new Array(n));var a,s,l,u=i[0],c=i[1];for(a=0;a<n;a++)s=r[a],l=r[a+n],o[a]=((l-s)*t+c*s-u*l)/(c-u);return o},i}),i("Core/loadBlob",["./loadWithXhr"],function(e){"use strict";function t(t,i){return e({url:t,responseType:"blob",headers:i})}return t}),i("Core/loadImageFromTypedArray",["../ThirdParty/when","./defined","./DeveloperError","./loadImage"],function(e,t,i,r){"use strict";function n(t,i){var n=new Blob([t],{type:i}),o=window.URL.createObjectURL(n);return r(o,!1).then(function(e){return window.URL.revokeObjectURL(o),e},function(t){return window.URL.revokeObjectURL(o),e.reject(t)})}return n}),i("Core/loadImageViaBlob",["../ThirdParty/when","./loadBlob","./loadImage"],function(e,t,i){"use strict";function r(r){return n.test(r)?i(r):t(r).then(function(t){var r=window.URL.createObjectURL(t);return i(r,!1).then(function(e){return e.blob=t,window.URL.revokeObjectURL(r),e},function(t){return window.URL.revokeObjectURL(r),e.reject(t)})})}var n=/^data:/,o=function(){try{var e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob","blob"===e.responseType}catch(e){return!1}}();return o?r:i}),i("Core/loadXML",["./loadWithXhr"],function(e){"use strict";function t(t,i){return e({url:t,responseType:"document",headers:i,overrideMimeType:"text/xml"})}return t}),i("Core/MapboxApi",["./defined","./Credit"],function(e,t){"use strict";var i={};i.defaultAccessToken=void 0;var r,n=!1,o="This application is using Cesium's default Mapbox access token. Please create a new access token for the application as soon as possible and prior to deployment by visiting https://www.mapbox.com/account/apps/, and provide your token to Cesium by setting the Cesium.MapboxApi.defaultAccessToken property before constructing the CesiumWidget or any other object that uses the Mapbox API.";return i.getAccessToken=function(t){return e(t)?t:e(i.defaultAccessToken)?i.defaultAccessToken:(n||(console.log(o),n=!0),"pk.eyJ1IjoiYW5hbHl0aWNhbGdyYXBoaWNzIiwiYSI6ImNpd204Zm4wejAwNzYyeW5uNjYyZmFwdWEifQ.7i-VIZZWX8pd1bTfxIVj9g")},i.getErrorCredit=function(n){if(!e(n)&&!e(i.defaultAccessToken))return e(r)||(r=new t(o)),r},i}),i("Core/MapProjection",["./defineProperties","./DeveloperError"],function(e,t){"use strict";function i(){t.throwInstantiationError()}return e(i.prototype,{ellipsoid:{get:t.throwInstantiationError}}),i.prototype.project=t.throwInstantiationError,i.prototype.unproject=t.throwInstantiationError,i}),i("Core/Matrix2",["./Cartesian2","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject"],function(e,t,i,r,n,o,a){"use strict";function s(e,t,r,n){this[0]=i(e,0),this[1]=i(r,0),this[2]=i(t,0),this[3]=i(n,0)}s.packedLength=4,s.pack=function(e,t,r){return r=i(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t},s.unpack=function(e,t,n){return t=i(t,0),r(n)||(n=new s),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n},s.clone=function(e,t){if(r(e))return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new s(e[0],e[2],e[1],e[3])},s.fromArray=function(e,t,n){return t=i(t,0),r(n)||(n=new s),n[0]=e[t],n[1]=e[t+1],n[2]=e[t+2],n[3]=e[t+3],n},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[2],t[2]=e[1],t[3]=e[3],t):new s(e[0],e[1],e[2],e[3])},s.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new s(e.x,0,0,e.y)},s.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new s(e,0,0,e)},s.fromRotation=function(e,t){var i=Math.cos(e),n=Math.sin(e);return r(t)?(t[0]=i,t[1]=n,t[2]=-n,t[3]=i,t):new s(i,-n,n,i)},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):[e[0],e[1],e[2],e[3]]},s.getElementIndex=function(e,t){return 2*e+t},s.getColumn=function(e,t,i){var r=2*t,n=e[r],o=e[r+1];return i.x=n,i.y=o,i},s.setColumn=function(e,t,i,r){r=s.clone(e,r);var n=2*t;return r[n]=i.x,r[n+1]=i.y,r},s.getRow=function(e,t,i){var r=e[t],n=e[t+2];return i.x=r,i.y=n,i},s.setRow=function(e,t,i,r){return r=s.clone(e,r),r[t]=i.x,r[t+2]=i.y,r};var l=new e;s.getScale=function(t,i){return i.x=e.magnitude(e.fromElements(t[0],t[1],l)),i.y=e.magnitude(e.fromElements(t[2],t[3],l)),i};var u=new e;return s.getMaximumScale=function(t){return s.getScale(t,u),e.maximumComponent(u)},s.multiply=function(e,t,i){var r=e[0]*t[0]+e[2]*t[1],n=e[0]*t[2]+e[2]*t[3],o=e[1]*t[0]+e[3]*t[1],a=e[1]*t[2]+e[3]*t[3];return i[0]=r,i[1]=o,i[2]=n,i[3]=a,i},s.add=function(e,t,i){return i[0]=e[0]+t[0],i[1]=e[1]+t[1],i[2]=e[2]+t[2],i[3]=e[3]+t[3],i},s.subtract=function(e,t,i){return i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],i[3]=e[3]-t[3],i},s.multiplyByVector=function(e,t,i){var r=e[0]*t.x+e[2]*t.y,n=e[1]*t.x+e[3]*t.y;return i.x=r,i.y=n,i},s.multiplyByScalar=function(e,t,i){return i[0]=e[0]*t,i[1]=e[1]*t,i[2]=e[2]*t,i[3]=e[3]*t,i},s.multiplyByScale=function(e,t,i){return i[0]=e[0]*t.x,i[1]=e[1]*t.x,i[2]=e[2]*t.y,i[3]=e[3]*t.y,i},s.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},s.transpose=function(e,t){var i=e[0],r=e[2],n=e[1],o=e[3];return t[0]=i,t[1]=r,t[2]=n,t[3]=o,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},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]},s.equalsArray=function(e,t,i){return e[0]===t[i]&&e[1]===t[i+1]&&e[2]===t[i+2]&&e[3]===t[i+3]},s.equalsEpsilon=function(e,t,i){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=i&&Math.abs(e[1]-t[1])<=i&&Math.abs(e[2]-t[2])<=i&&Math.abs(e[3]-t[3])<=i},s.IDENTITY=a(new s(1,0,0,1)),s.ZERO=a(new s(0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN1ROW0=2,s.COLUMN1ROW1=3,n(s.prototype,{length:{get:function(){return s.packedLength}}}),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[2]+")\n("+this[1]+", "+this[3]+")"},s}),i("Core/mergeSort",["./defined","./DeveloperError"],function(e,t){"use strict";function i(e,t,i,r,n,s){var l,u,c=n-r+1,h=s-n,d=o,p=a;for(l=0;l<c;++l)d[l]=e[r+l];for(u=0;u<h;++u)p[u]=e[n+u+1];l=0,u=0;for(var m=r;m<=s;++m){var f=d[l],_=p[u];l<c&&(u>=h||t(f,_,i)<=0)?(e[m]=f,++l):u<h&&(e[m]=_,++u)}}function r(e,t,n,o,a){if(!(o>=a)){var s=Math.floor(.5*(o+a));r(e,t,n,o,s),r(e,t,n,s+1,a),i(e,t,n,o,s,a)}}function n(e,t,i){var n=e.length,s=Math.ceil(.5*n);o.length=s,a.length=s,r(e,t,i,0,n-1),o.length=0,a.length=0}var o=[],a=[];return n}),i("Core/NearFarScalar",["./defaultValue","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(t,i,r,n){this.near=e(t,0),this.nearValue=e(i,0),this.far=e(r,1),this.farValue=e(n,0)}return r.clone=function(e,i){if(t(e))return t(i)?(i.near=e.near,i.nearValue=e.nearValue,i.far=e.far,i.farValue=e.farValue,i):new r(e.near,e.nearValue,e.far,e.farValue)},r.packedLength=4,r.pack=function(t,i,r){return r=e(r,0),i[r++]=t.near,i[r++]=t.nearValue,i[r++]=t.far,i[r]=t.farValue,i},r.unpack=function(i,n,o){return n=e(n,0),t(o)||(o=new r),o.near=i[n++],o.nearValue=i[n++],o.far=i[n++],o.farValue=i[n],o},r.equals=function(e,i){return e===i||t(e)&&t(i)&&e.near===i.near&&e.nearValue===i.nearValue&&e.far===i.far&&e.farValue===i.farValue},r.prototype.clone=function(e){return r.clone(this,e)},r.prototype.equals=function(e){return r.equals(this,e)},r}),i("Core/Visibility",["./freezeObject"],function(e){"use strict";var t={NONE:-1,PARTIAL:0,FULL:1};return e(t)}),i("Core/Occluder",["./BoundingSphere","./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math","./Rectangle","./Visibility"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e,i){this._occluderPosition=t.clone(e.center),this._occluderRadius=e.radius,this._horizonDistance=0,this._horizonPlaneNormal=void 0,this._horizonPlanePosition=void 0,this._cameraPosition=void 0,this.cameraPosition=i}var h=new t;n(c.prototype,{position:{get:function(){return this._occluderPosition}},radius:{get:function(){return this._occluderRadius}},cameraPosition:{set:function(e){e=t.clone(e,this._cameraPosition);var i,r,n,o=t.subtract(this._occluderPosition,e,h),a=t.magnitudeSquared(o),s=this._occluderRadius*this._occluderRadius;if(a>s){i=Math.sqrt(a-s),a=1/Math.sqrt(a),r=t.multiplyByScalar(o,a,h);var l=i*i*a;n=t.add(e,t.multiplyByScalar(r,l,h),h)}else i=Number.MAX_VALUE;this._horizonDistance=i,this._horizonPlaneNormal=r,this._horizonPlanePosition=n,this._cameraPosition=e}}}),c.fromBoundingSphere=function(e,i,n){return r(n)?(t.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=i,n):new c(e,i)};var d=new t;c.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){var i=t.subtract(e,this._occluderPosition,d),r=this._occluderRadius;if(r=t.magnitudeSquared(i)-r*r,r>0)return r=Math.sqrt(r)+this._horizonDistance,i=t.subtract(e,this._cameraPosition,i),r*r>t.magnitudeSquared(i)}return!1};var p=new t;c.prototype.isBoundingSphereVisible=function(e){var i=t.clone(e.center,p),r=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){var n=t.subtract(i,this._occluderPosition,d),o=this._occluderRadius-r;if(o=t.magnitudeSquared(n)-o*o,r<this._occluderRadius)return o>0&&(o=Math.sqrt(o)+this._horizonDistance,n=t.subtract(i,this._cameraPosition,n),o*o+r*r>t.magnitudeSquared(n));if(o>0){n=t.subtract(i,this._cameraPosition,n);var a=t.magnitudeSquared(n),s=this._occluderRadius*this._occluderRadius,l=r*r;return(this._horizonDistance*this._horizonDistance+s)*l>a*s||(o=Math.sqrt(o)+this._horizonDistance,o*o+l>a)}return!0}return!1};var m=new t;c.prototype.computeVisibility=function(e){var i=t.clone(e.center),r=e.radius;if(r>this._occluderRadius)return u.FULL;if(this._horizonDistance!==Number.MAX_VALUE){var n=t.subtract(i,this._occluderPosition,m),o=this._occluderRadius-r,a=t.magnitudeSquared(n);if(o=a-o*o,o>0){o=Math.sqrt(o)+this._horizonDistance,n=t.subtract(i,this._cameraPosition,n);var s=t.magnitudeSquared(n);return o*o+r*r<s?u.NONE:(o=this._occluderRadius+r,o=a-o*o,o>0?(o=Math.sqrt(o)+this._horizonDistance,s<o*o+r*r?u.FULL:u.PARTIAL):(n=t.subtract(i,this._horizonPlanePosition,n),t.dot(n,this._horizonPlaneNormal)>-r?u.PARTIAL:u.FULL))}}return u.NONE};var f=new t;c.computeOccludeePoint=function(e,i,r){var n=t.clone(i),o=t.clone(e.center),a=e.radius,s=r.length,l=t.normalize(t.subtract(n,o,f),f),u=-t.dot(l,o),h=c._anyRotationVector(o,l,u),d=c._horizonToPlaneNormalDotProduct(e,l,u,h,r[0]);if(d){for(var p,m=1;m<s;++m){if(p=c._horizonToPlaneNormalDotProduct(e,l,u,h,r[m]),!p)return;p<d&&(d=p)}if(!(d<.0017453283658983088)){var _=a/d;return t.add(o,t.multiplyByScalar(l,_,f),f)}}};var _=[];c.computeOccludeePointFromRectangle=function(r,n){n=i(n,a.WGS84);var o=l.subsample(r,n,0,_),s=e.fromPoints(o),u=t.ZERO;if(!t.equals(u,s.center))return c.computeOccludeePoint(new e(u,n.minimumRadius),s.center,o)};var g=new t;c._anyRotationVector=function(e,i,r){var n=t.abs(i,g),o=n.x>n.y?0:1;(0===o&&n.z>n.x||1===o&&n.z>n.y)&&(o=2);var a,s=new t;0===o?(n.x=e.x,n.y=e.y+1,n.z=e.z+1,a=t.UNIT_X):1===o?(n.x=e.x+1,n.y=e.y,n.z=e.z+1,a=t.UNIT_Y):(n.x=e.x+1,n.y=e.y+1,n.z=e.z,a=t.UNIT_Z);var l=(t.dot(i,n)+r)/-t.dot(i,a);return t.normalize(t.subtract(t.add(n,t.multiplyByScalar(a,l,s),n),e,n),n)};var v=new t;c._rotationVector=function(e,i,r,n,o){var a=t.subtract(n,e,v);if(a=t.normalize(a,a),t.dot(i,a)<.9999999847691291){var l=t.cross(i,a,a),u=t.magnitude(l);if(u>s.EPSILON13)return t.normalize(l,new t)}return o};var y=new t,C=new t,w=new t,S=new t;return c._horizonToPlaneNormalDotProduct=function(e,i,r,n,o){var a=t.clone(o,y),s=t.clone(e.center,C),l=e.radius,u=t.subtract(s,a,w),c=t.magnitudeSquared(u),h=l*l;if(c<h)return!1;var d=c-h,p=Math.sqrt(d),m=Math.sqrt(c),f=1/m,_=p*f,g=_*p;u=t.normalize(u,u);var v=t.add(a,t.multiplyByScalar(u,g,S),S),E=Math.sqrt(d-g*g),b=this._rotationVector(s,i,r,a,n),T=t.fromElements(b.x*b.x*u.x+(b.x*b.y-b.z)*u.y+(b.x*b.z+b.y)*u.z,(b.x*b.y+b.z)*u.x+b.y*b.y*u.y+(b.y*b.z-b.x)*u.z,(b.x*b.z-b.y)*u.x+(b.y*b.z+b.x)*u.y+b.z*b.z*u.z,y);T=t.normalize(T,T);var x=t.multiplyByScalar(T,E,y);b=t.normalize(t.subtract(t.add(v,x,w),s,w),w);var A=t.dot(i,b);b=t.normalize(t.subtract(t.subtract(v,x,b),s,b),b);var P=t.dot(i,b);return A<P?A:P},c}),i("Core/Packable",["./DeveloperError"],function(e){"use strict";var t={packedLength:void 0,pack:e.throwInstantiationError,unpack:e.throwInstantiationError};return t}),i("Core/PackableForInterpolation",["./DeveloperError"],function(e){"use strict";var t={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:e.throwInstantiationError,unpackInterpolationResult:e.throwInstantiationError};return t}),i("ThirdParty/measureText",[],function(){var e=function(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)},t=function(t,i,r,n){var o=t.measureText(i),a=e(t.canvas,"font-family"),s=e(t.canvas,"font-size").replace("px",""),l=e(t.canvas,"font-style"),u=e(t.canvas,"font-weight"),c=!/\S/.test(i);o.fontsize=s;var h=document.createElement("div");h.style.position="absolute",h.style.opacity=0,h.style.font=l+" "+u+" "+s+"px "+a,h.innerHTML=i+"<br/>"+i,document.body.appendChild(h),o.leading=1.2*s;var d=e(h,"height");if(d=d.replace("px",""),d>=2*s&&(o.leading=d/2|0),document.body.removeChild(h),c)o.ascent=0,o.descent=0,o.bounds={minx:0,maxx:o.width,miny:0,maxy:0},o.height=0;else{var p=document.createElement("canvas"),m=100;p.width=o.width+m,p.height=3*s,p.style.opacity=1,p.style.fontFamily=a,p.style.fontSize=s,p.style.fontStyle=l,p.style.fontWeight=u;var f=p.getContext("2d");f.font=l+" "+u+" "+s+"px "+a;var _=p.width,g=p.height,v=g/2;f.fillStyle="white",f.fillRect(-1,-1,_+2,g+2),r&&(f.strokeStyle="black",f.lineWidth=t.lineWidth,f.strokeText(i,m/2,v)),n&&(f.fillStyle="black",f.fillText(i,m/2,v));for(var y=f.getImageData(0,0,_,g).data,C=0,w=4*_,S=y.length;++C<S&&255===y[C];);var E=C/w|0;for(C=S-1;--C>0&&255===y[C];);var b=C/w|0;for(C=0;C<S&&255===y[C];)C+=w,C>=S&&(C=C-S+4);var T=C%w/4|0,x=1;for(C=S-3;C>=0&&255===y[C];)C-=w,C<0&&(C=S-3-4*x++);var A=C%w/4+1|0;o.ascent=v-E,o.descent=b-v,o.bounds={minx:T-m/2,maxx:A-m/2,miny:0,maxy:b-E},o.height=1+(b-E)}return o};return t}),i("Core/writeTextToCanvas",["../ThirdParty/measureText","./Color","./defaultValue","./defined","./DeveloperError"],function(e,t,i,r,n){"use strict";function o(n,o){if(""!==n){o=i(o,i.EMPTY_OBJECT);var s=i(o.font,"10px sans-serif"),l=i(o.stroke,!1),u=i(o.fill,!0),c=i(o.strokeWidth,1),h=i(o.backgroundColor,t.TRANSPARENT),d=i(o.padding,0),p=2*d,m=document.createElement("canvas");m.width=1,m.height=1,m.style.font=s;var f=m.getContext("2d");r(a)||(r(f.imageSmoothingEnabled)?a="imageSmoothingEnabled":r(f.mozImageSmoothingEnabled)?a="mozImageSmoothingEnabled":r(f.webkitImageSmoothingEnabled)?a="webkitImageSmoothingEnabled":r(f.msImageSmoothingEnabled)&&(a="msImageSmoothingEnabled")), +f.font=s,f.lineJoin="round",f.lineWidth=c,f[a]=!1,f.textBaseline=i(o.textBaseline,"bottom"),m.style.visibility="hidden",document.body.appendChild(m);var _=e(f,n,l,u);m.dimensions=_,document.body.removeChild(m),m.style.visibility="";var g=-_.bounds.minx,v=Math.ceil(_.width)+g+p,y=_.height+p,C=y-_.ascent+p,w=y-C+p;if(m.width=v,m.height=y,f.font=s,f.lineJoin="round",f.lineWidth=c,f[a]=!1,h!==t.TRANSPARENT&&(f.fillStyle=h.toCssColorString(),f.fillRect(0,0,m.width,m.height)),l){var S=i(o.strokeColor,t.BLACK);f.strokeStyle=S.toCssColorString(),f.strokeText(n,g+d,w)}if(u){var E=i(o.fillColor,t.WHITE);f.fillStyle=E.toCssColorString(),f.fillText(n,g+d,w)}return m}}var a;return o}),i("Core/PinBuilder",["./buildModuleUrl","./Color","./defined","./DeveloperError","./loadImage","./writeTextToCanvas"],function(e,t,i,r,n,o){"use strict";function a(){this._cache={}}function s(e,t,i){e.save(),e.scale(i/24,i/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,c).toCssColorString(),e.lineWidth=.846,e.beginPath(),e.moveTo(6.72,.422),e.lineTo(17.28,.422),e.bezierCurveTo(18.553,.422,19.577,1.758,19.577,3.415),e.lineTo(19.577,10.973),e.bezierCurveTo(19.577,12.63,18.553,13.966,17.282,13.966),e.lineTo(14.386,14.008),e.lineTo(11.826,23.578),e.lineTo(9.614,14.008),e.lineTo(6.719,13.965),e.bezierCurveTo(5.446,13.983,4.422,12.629,4.422,10.972),e.lineTo(4.422,3.416),e.bezierCurveTo(4.423,1.76,5.447,.423,6.718,.423),e.closePath(),e.fill(),e.stroke(),e.restore()}function l(e,i,r){var n=r/2.5,o=n,a=n;i.width>i.height?a=n*(i.height/i.width):i.width<i.height&&(o=n*(i.width/i.height));var s=(r-o)/2,l=7/24*r-a/2;e.globalCompositeOperation="destination-out",e.drawImage(i,s-1,l,o,a),e.drawImage(i,s,l-1,o,a),e.drawImage(i,s+1,l,o,a),e.drawImage(i,s,l+1,o,a),e.globalCompositeOperation="destination-over",e.fillStyle=t.BLACK.toCssColorString(),e.fillRect(s-1,l-1,o+1,a+1),e.globalCompositeOperation="destination-out",e.drawImage(i,s,l,o,a),e.globalCompositeOperation="destination-over",e.fillStyle=t.WHITE.toCssColorString(),e.fillRect(s,l,o,a)}function u(e,t,r,a,u){h[0]=e,h[1]=t,h[2]=r,h[3]=a;var c=JSON.stringify(h),d=u[c];if(i(d))return d;var p=document.createElement("canvas");p.width=a,p.height=a;var m=p.getContext("2d");if(s(m,r,a),i(e)){var f=n(e).then(function(e){return l(m,e,a),u[c]=p,p});return u[c]=f,f}if(i(t)){var _=o(t,{font:"bold "+a+"px sans-serif"});l(m,_,a)}return u[c]=p,p}a.prototype.fromColor=function(e,t){return u(void 0,void 0,e,t,this._cache)},a.prototype.fromUrl=function(e,t,i){return u(e,void 0,t,i,this._cache)},a.prototype.fromMakiIconId=function(t,i,r){return u(e("Assets/Textures/maki/"+encodeURIComponent(t)+".png"),void 0,i,r,this._cache)},a.prototype.fromText=function(e,t,i){return u(void 0,e,t,i,this._cache)};var c=new t,h=new Array(4);return a}),i("Core/PixelFormat",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var i={DEPTH_COMPONENT:t.DEPTH_COMPONENT,DEPTH_STENCIL:t.DEPTH_STENCIL,ALPHA:t.ALPHA,RGB:t.RGB,RGBA:t.RGBA,LUMINANCE:t.LUMINANCE,LUMINANCE_ALPHA:t.LUMINANCE_ALPHA,validate:function(e){return e===i.DEPTH_COMPONENT||e===i.DEPTH_STENCIL||e===i.ALPHA||e===i.RGB||e===i.RGBA||e===i.LUMINANCE||e===i.LUMINANCE_ALPHA},isColorFormat:function(e){return e===i.ALPHA||e===i.RGB||e===i.RGBA||e===i.LUMINANCE||e===i.LUMINANCE_ALPHA},isDepthFormat:function(e){return e===i.DEPTH_COMPONENT||e===i.DEPTH_STENCIL}};return e(i)}),i("Core/PointGeometry",["./BoundingSphere","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./PrimitiveType"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(t){t=i(t,i.EMPTY_OBJECT),this._positionsTypedArray=t.positionsTypedArray,this._colorsTypedArray=t.colorsTypedArray,this._boundingSphere=e.clone(t.boundingSphere),this._workerName="createPointGeometry"}return u.createGeometry=function(i){var n=i._positionsTypedArray,u=n.byteLength/n.length,c=4===u?t.FLOAT:t.DOUBLE,h=new s;h.position=new a({componentDatatype:c,componentsPerAttribute:3,values:n}),h.color=new a({componentDatatype:t.UNSIGNED_BYTE,componentsPerAttribute:3,values:i._colorsTypedArray,normalize:!0});var d=i._boundingSphere;return r(d)||(d=e.fromVertices(n)),new o({attributes:h,primitiveType:l.POINTS,boundingSphere:d})},u}),i("Core/pointInsideTriangle",["./barycentricCoordinates","./Cartesian3"],function(e,t){"use strict";function i(t,i,n,o){return e(t,i,n,o,r),r.x>0&&r.y>0&&r.z>0}var r=new t;return i}),i("Core/Queue",["./defineProperties"],function(e){"use strict";function t(){this._array=[],this._offset=0,this._length=0}return e(t.prototype,{length:{get:function(){return this._length}}}),t.prototype.enqueue=function(e){this._array.push(e),this._length++},t.prototype.dequeue=function(){if(0!==this._length){var e=this._array,t=this._offset,i=e[t];return e[t]=void 0,t++,t>10&&2*t>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,i}},t.prototype.peek=function(){if(0!==this._length)return this._array[this._offset]},t.prototype.contains=function(e){return this._array.indexOf(e)!==-1},t.prototype.clear=function(){this._array.length=this._offset=this._length=0},t.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)},t}),i("Core/PolygonGeometryLibrary",["./arrayRemoveDuplicates","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryPipeline","./IndexDatatype","./Math","./PolygonPipeline","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f){"use strict";function _(e,i,r,n){return t.subtract(i,e,v),t.multiplyByScalar(v,r/n,v),t.add(e,v,v),[v.x,v.y,v.z]}var g={};g.computeHierarchyPackedLength=function(e){for(var i=0,r=[e];r.length>0;){var o=r.pop();if(n(o)){i+=2;var a=o.positions,s=o.holes;if(n(a)&&(i+=a.length*t.packedLength),n(s))for(var l=s.length,u=0;u<l;++u)r.push(s[u])}}return i},g.packPolygonHierarchy=function(e,i,r){for(var o=[e];o.length>0;){var a=o.pop();if(n(a)){var s=a.positions,l=a.holes;if(i[r++]=n(s)?s.length:0,i[r++]=n(l)?l.length:0,n(s))for(var u=s.length,c=0;c<u;++c,r+=3)t.pack(s[c],i,r);if(n(l))for(var h=l.length,d=0;d<h;++d)o.push(l[d])}}return r},g.unpackPolygonHierarchy=function(e,i){for(var r=e[i++],n=e[i++],o=new Array(r),a=n>0?new Array(n):void 0,s=0;s<r;++s,i+=t.packedLength)o[s]=t.unpack(e,i);for(var l=0;l<n;++l)a[l]=g.unpackPolygonHierarchy(e,i),i=a[l].startingIndex,delete a[l].startingIndex;return{positions:o,holes:a,startingIndex:i}};var v=new t;g.subdivideLineCount=function(e,i,r){var n=t.distance(e,i),o=n/r,a=Math.max(0,Math.ceil(Math.log(o)/Math.log(2)));return Math.pow(2,a)},g.subdivideLine=function(e,i,r,o){var a=g.subdivideLineCount(e,i,r),s=t.distance(e,i),l=s/a;n(o)||(o=[]);var u=o;u.length=3*a;for(var c=0,h=0;h<a;h++){var d=_(e,i,h*l,s);u[c++]=d[0],u[c++]=d[1],u[c++]=d[2]}return u};var y=new t,C=new t,w=new t,S=new t;g.scaleToGeodeticHeightExtruded=function(e,i,a,s,l){s=r(s,o.WGS84);var u=y,c=C,h=w,d=S;if(n(e)&&n(e.attributes)&&n(e.attributes.position))for(var p=e.attributes.position.values,m=p.length/2,f=0;f<m;f+=3)t.fromArray(p,f,h),s.geodeticSurfaceNormal(h,u),d=s.scaleToGeodeticSurface(h,d),c=t.multiplyByScalar(u,a,c),c=t.add(d,c,c),p[f+m]=c.x,p[f+1+m]=c.y,p[f+2+m]=c.z,l&&(d=t.clone(h,d)),c=t.multiplyByScalar(u,i,c),c=t.add(d,c,c),p[f]=c.x,p[f+1]=c.y,p[f+2]=c.z;return e},g.polygonsFromHierarchy=function(i,r,o,a){var s=[],l=[],u=new m;for(u.enqueue(i);0!==u.length;){var c=u.dequeue(),h=c.positions,p=c.holes;if(h=e(h,t.equalsEpsilon,!0),!(h.length<3)){var _=o.projectPointsOntoPlane(h),g=[],v=d.computeWindingOrder2D(_);v===f.CLOCKWISE&&(_.reverse(),h=h.slice().reverse());var y,C,w=h.slice(),S=n(p)?p.length:0,E=[];for(y=0;y<S;y++){var b=p[y],T=e(b.positions,t.equalsEpsilon,!0);if(!(T.length<3)){var x=o.projectPointsOntoPlane(T);v=d.computeWindingOrder2D(x),v===f.CLOCKWISE&&(x.reverse(),T=T.slice().reverse()),E.push(T),g.push(w.length),w=w.concat(T),_=_.concat(x);var A=0;for(n(b.holes)&&(A=b.holes.length),C=0;C<A;C++)u.enqueue(b.holes[C])}}if(!r){for(y=0;y<h.length;y++)a.scaleToGeodeticSurface(h[y],h[y]);for(y=0;y<E.length;y++){var P=E[y];for(C=0;C<P.length;++C)a.scaleToGeodeticSurface(P[C],P[C])}}s.push({outerRing:h,holes:E}),l.push({positions:w,positions2D:_,holes:g})}}return{hierarchy:s,polygons:l}},g.createGeometryFromPositions=function(e,t,r,n,o){var l=d.triangulate(t.positions2D,t.holes);l.length<3&&(l=[0,1,2]);var c=t.positions;if(n){for(var h=c.length,m=new Array(3*h),f=0,_=0;_<h;_++){var g=c[_];m[f++]=g.x,m[f++]=g.y,m[f++]=g.z}var v=new a({attributes:{position:new s({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:m})},indices:l,primitiveType:p.TRIANGLES});return o.normal?u.computeNormal(v):v}return d.computeSubdivision(e,c,l,r)};var E=[],b=new t,T=new t;return g.computeWallGeometry=function(e,r,n,o){var u,d,m,f,_,v=e.length,y=0;if(o)for(d=3*v*2,u=new Array(2*d),m=0;m<v;m++)f=e[m],_=e[(m+1)%v],u[y]=u[y+d]=f.x,++y,u[y]=u[y+d]=f.y,++y,u[y]=u[y+d]=f.z,++y,u[y]=u[y+d]=_.x,++y,u[y]=u[y+d]=_.y,++y,u[y]=u[y+d]=_.z,++y;else{var C=h.chordLength(n,r.maximumRadius),w=0;for(m=0;m<v;m++)w+=g.subdivideLineCount(e[m],e[(m+1)%v],C);for(d=3*(w+v),u=new Array(2*d),m=0;m<v;m++){f=e[m],_=e[(m+1)%v];for(var S=g.subdivideLine(f,_,C,E),x=S.length,A=0;A<x;++A,++y)u[y]=S[A],u[y+d]=S[A];u[y]=_.x,u[y+d]=_.x,++y,u[y]=_.y,u[y+d]=_.y,++y,u[y]=_.z,u[y+d]=_.z,++y}}v=u.length;var P=c.createTypedArray(v/3,v-6*e.length),D=0;for(v/=6,m=0;m<v;m++){var M=m,I=M+1,R=M+v,O=R+1;f=t.fromArray(u,3*M,b),_=t.fromArray(u,3*I,T),t.equalsEpsilon(f,_,h.EPSILON14)||(P[D++]=M,P[D++]=R,P[D++]=I,P[D++]=I,P[D++]=R,P[D++]=O)}return new a({attributes:new l({position:new s({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:u})}),indices:P,primitiveType:p.TRIANGLES})},g}),i("Core/PolygonGeometry",["./BoundingRectangle","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./Check","./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix3","./PolygonGeometryLibrary","./PolygonPipeline","./Quaternion","./Rectangle","./VertexFormat","./WindingOrder"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T){"use strict";function x(e,t,i,n){for(var o=S.fromAxisAngle(e._plane.normal,i,O),a=y.fromQuaternion(o,N),s=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,c=Number.POSITIVE_INFINITY,h=Number.NEGATIVE_INFINITY,d=t.length,p=0;p<d;++p){var m=r.clone(t[p],R);y.multiplyByVector(a,m,m);var f=e.projectPointOntoPlane(m,I);l(f)&&(s=Math.min(s,f.x),u=Math.max(u,f.x),c=Math.min(c,f.y),h=Math.max(h,f.y))}return n.x=s,n.y=c,n.width=u-s,n.height=h-c,n}function A(e,t,i,r){var n=r.cartesianToCartographic(e,L),o=n.height,a=r.cartesianToCartographic(t,B);a.height=o,r.cartographicToCartesian(a,t);var s=r.cartesianToCartographic(i,B);s.height=o-100,r.cartographicToCartesian(s,i)}function P(e){var t=e.vertexFormat,n=e.geometry,o=e.shadowVolume;if(t.st||t.normal||t.tangent||t.bitangent||o){var s=e.boundingRectangle,l=e.tangentPlane,u=e.ellipsoid,c=e.stRotation,h=e.wall,d=e.top||h,p=e.bottom||h,f=e.perPositionHeight,_=Y;_.x=s.x,_.y=s.y;var g,C=n.attributes.position.values,w=C.length,E=t.st?new Float32Array(2*(w/3)):void 0;t.normal&&(g=f&&d&&!h?n.attributes.normal.values:new Float32Array(w));var b=t.tangent?new Float32Array(w):void 0,T=t.bitangent?new Float32Array(w):void 0,x=o?new Float32Array(w):void 0,P=0,D=0,M=k,I=z,R=U,O=!0,N=S.fromAxisAngle(l._plane.normal,c,K),L=y.fromQuaternion(N,Q),B=0,F=0;d&&p&&(B=w/2,F=w/3,w/=2);for(var J=0;J<w;J+=3){var $=r.fromArray(C,J,Z);if(t.st){var ee=y.multiplyByVector(L,$,V);ee=u.scaleToGeodeticSurface(ee,ee);var te=l.projectPointOntoPlane(ee,X);i.subtract(te,_,te);var ie=v.clamp(te.x/s.width,0,1),re=v.clamp(te.y/s.height,0,1);p&&(E[P+F]=ie,E[P+1+F]=re),d&&(E[P]=ie,E[P+1]=re),P+=2}if(t.normal||t.tangent||t.bitangent||o){var ne=D+1,oe=D+2;if(h){if(J+3<w){var ae=r.fromArray(C,J+3,G);if(O){var se=r.fromArray(C,J+w,W);f&&A($,ae,se,u),r.subtract(ae,$,ae),r.subtract(se,$,se),M=r.normalize(r.cross(se,ae,M),M),O=!1}r.equalsEpsilon(ae,$,v.EPSILON10)&&(O=!0)}(t.tangent||t.bitangent)&&(R=u.geodeticSurfaceNormal($,R),t.tangent&&(I=r.normalize(r.cross(R,M,I),I)))}else M=u.geodeticSurfaceNormal($,M),(t.tangent||t.bitangent)&&(f&&(H=r.fromArray(g,D,H),q=r.cross(r.UNIT_Z,H,q),q=r.normalize(y.multiplyByVector(L,q,q),q),t.bitangent&&(j=r.normalize(r.cross(H,q,j),j))),I=r.cross(r.UNIT_Z,M,I),I=r.normalize(y.multiplyByVector(L,I,I),I),t.bitangent&&(R=r.normalize(r.cross(M,I,R),R)));t.normal&&(e.wall?(g[D+B]=M.x,g[ne+B]=M.y,g[oe+B]=M.z):p&&(g[D+B]=-M.x,g[ne+B]=-M.y,g[oe+B]=-M.z),(d&&!f||h)&&(g[D]=M.x,g[ne]=M.y,g[oe]=M.z)),o&&(h&&(M=u.geodeticSurfaceNormal($,M)),x[D+B]=-M.x,x[ne+B]=-M.y,x[oe+B]=-M.z),t.tangent&&(e.wall?(b[D+B]=I.x,b[ne+B]=I.y,b[oe+B]=I.z):p&&(b[D+B]=-I.x,b[ne+B]=-I.y,b[oe+B]=-I.z),d&&(f?(b[D]=q.x,b[ne]=q.y,b[oe]=q.z):(b[D]=I.x,b[ne]=I.y,b[oe]=I.z))),t.bitangent&&(p&&(T[D+B]=R.x,T[ne+B]=R.y,T[oe+B]=R.z),d&&(f?(T[D]=j.x,T[ne]=j.y,T[oe]=j.z):(T[D]=R.x,T[ne]=R.y,T[oe]=R.z))),D+=3}}t.st&&(n.attributes.st=new m({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:E})),t.normal&&(n.attributes.normal=new m({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:g})),t.tangent&&(n.attributes.tangent=new m({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:b})),t.bitangent&&(n.attributes.bitangent=new m({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:T})),o&&(n.attributes.extrudeDirection=new m({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:x}))}return n}function D(e,t,i,r,n,o,a,s){var l,u={walls:[]};if(o||a){var c,h,p=C.createGeometryFromPositions(e,t,i,n,s),m=p.attributes.position.values,_=p.indices;if(o&&a){var v=m.concat(m);c=v.length/3,h=g.createTypedArray(c,2*_.length),h.set(_);var y=_.length,S=c/2;for(l=0;l<y;l+=3){var E=h[l]+S,b=h[l+1]+S,x=h[l+2]+S;h[l+y]=x,h[l+1+y]=b,h[l+2+y]=E}if(p.attributes.position.values=v,n){var A=p.attributes.normal.values;p.attributes.normal.values=new Float32Array(v.length),p.attributes.normal.values.set(A)}p.indices=h}else if(a){for(c=m.length/3,h=g.createTypedArray(c,_.length),l=0;l<_.length;l+=3)h[l]=_[l+2],h[l+1]=_[l+1],h[l+2]=_[l];p.indices=h}u.topAndBottom=new f({geometry:p})}var P=r.outerRing,D=d.fromPoints(P,e),M=D.projectPointsOntoPlane(P,J),I=w.computeWindingOrder2D(M);I===T.CLOCKWISE&&(P=P.slice().reverse());var R=C.computeWallGeometry(P,e,i,n);u.walls.push(new f({geometry:R}));var O=r.holes;for(l=0;l<O.length;l++){var N=O[l];D=d.fromPoints(N,e),M=D.projectPointsOntoPlane(N,J),I=w.computeWindingOrder2D(M),I===T.COUNTER_CLOCKWISE&&(N=N.slice().reverse()),R=C.computeWallGeometry(N,e,i),u.walls.push(new f({geometry:R}))}return u}function M(e){var t=e.polygonHierarchy,i=s(e.vertexFormat,b.DEFAULT),r=s(e.ellipsoid,h.WGS84),n=s(e.granularity,v.RADIANS_PER_DEGREE),o=s(e.stRotation,0),a=s(e.height,0),u=s(e.perPositionHeight,!1),c=e.extrudedHeight,d=l(c);if(!u&&d)if(v.equalsEpsilon(a,c,v.EPSILON10))c=void 0,d=!1;else{var p=c;c=Math.min(p,a),a=Math.max(p,a)}this._vertexFormat=b.clone(i),this._ellipsoid=h.clone(r),this._granularity=n,this._stRotation=o,this._height=a,this._extrudedHeight=s(c,0),this._extrude=d,this._closeTop=s(e.closeTop,!0),this._closeBottom=s(e.closeBottom,!0),this._polygonHierarchy=t,this._perPositionHeight=u,this._shadowVolume=s(e.shadowVolume,!1),this._workerName="createPolygonGeometry";var m=t.positions;!l(m)||m.length<3?this._rectangle=new E:this._rectangle=E.fromCartesianArray(m,r),this.packedLength=C.computeHierarchyPackedLength(t)+h.packedLength+b.packedLength+E.packedLength+10}var I=new i,R=new r,O=new S,N=new y,L=new n,B=new n,F=new e,V=new r,k=new r,z=new r,U=new r,G=new r,W=new r,H=new r,q=new r,j=new r,Y=new i,X=new i,Z=new r,K=new S,Q=new y,J=[];M.fromPositions=function(e){e=s(e,s.EMPTY_OBJECT);var t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,closeTop:e.closeTop,closeBottom:e.closeBottom};return new M(t)},M.pack=function(e,t,i){return i=s(i,0),i=C.packPolygonHierarchy(e._polygonHierarchy,t,i),h.pack(e._ellipsoid,t,i),i+=h.packedLength,b.pack(e._vertexFormat,t,i),i+=b.packedLength,E.pack(e._rectangle,t,i),i+=E.packedLength,t[i++]=e._height,t[i++]=e._extrudedHeight,t[i++]=e._granularity,t[i++]=e._stRotation,t[i++]=e._extrude?1:0,t[i++]=e._perPositionHeight?1:0,t[i++]=e._closeTop?1:0,t[i++]=e._closeBottom?1:0,t[i++]=e._shadowVolume?1:0,t[i]=e.packedLength,t};var $=h.clone(h.UNIT_SPHERE),ee=new b,te=new E,ie={polygonHierarchy:{}};return M.unpack=function(e,t,i){t=s(t,0);var r=C.unpackPolygonHierarchy(e,t);t=r.startingIndex,delete r.startingIndex;var n=h.unpack(e,t,$);t+=h.packedLength;var o=b.unpack(e,t,ee);t+=b.packedLength;var a=E.unpack(e,t,te);t+=E.packedLength;var u=e[t++],c=e[t++],d=e[t++],p=e[t++],m=1===e[t++],f=1===e[t++],_=1===e[t++],g=1===e[t++],v=1===e[t++],y=e[t];return l(i)||(i=new M(ie)),i._polygonHierarchy=r,i._ellipsoid=h.clone(n,i._ellipsoid),i._vertexFormat=b.clone(o,i._vertexFormat),i._height=u,i._extrudedHeight=c,i._granularity=d,i._stRotation=p,i._extrude=m,i._perPositionHeight=f,i._closeTop=_,i._closeBottom=g,i._rectangle=E.clone(a),i._shadowVolume=v,i.packedLength=y,i},M.createGeometry=function(e){var i=e._vertexFormat,r=e._ellipsoid,n=e._granularity,o=e._stRotation,a=e._height,s=e._extrudedHeight,l=e._extrude,u=e._polygonHierarchy,c=e._perPositionHeight,h=e._closeTop,m=e._closeBottom,v=u.positions;if(!(v.length<3)){var y=d.fromPoints(v,r),S=C.polygonsFromHierarchy(u,c,y,r),E=S.hierarchy,b=S.polygons;if(0!==E.length){v=E[0].outerRing;var T,A,M=x(y,v,o,F),I=[],R={perPositionHeight:c,vertexFormat:i,geometry:void 0,tangentPlane:y,boundingRectangle:M,ellipsoid:r,stRotation:o,bottom:!1,top:!0,wall:!1};if(l)for(R.top=h,R.bottom=m,R.shadowVolume=e._shadowVolume,A=0;A<b.length;A++){T=D(r,b[A],n,E[A],c,h,m,i);var O;h&&m?(O=T.topAndBottom,R.geometry=C.scaleToGeodeticHeightExtruded(O.geometry,a,s,r,c)):h?(O=T.topAndBottom,O.geometry.attributes.position.values=w.scaleToGeodeticHeight(O.geometry.attributes.position.values,a,r,!c),R.geometry=O.geometry):m&&(O=T.topAndBottom,O.geometry.attributes.position.values=w.scaleToGeodeticHeight(O.geometry.attributes.position.values,s,r,!0),R.geometry=O.geometry),(h||m)&&(R.wall=!1,O.geometry=P(R),I.push(O));var N=T.walls;R.wall=!0;for(var L=0;L<N.length;L++){var B=N[L];R.geometry=C.scaleToGeodeticHeightExtruded(B.geometry,a,s,r,c),B.geometry=P(R),I.push(B)}}else for(A=0;A<b.length;A++)T=new f({geometry:C.createGeometryFromPositions(r,b[A],n,c,i)}),T.geometry.attributes.position.values=w.scaleToGeodeticHeight(T.geometry.attributes.position.values,a,r,!c),R.geometry=T.geometry,T.geometry=P(R),I.push(T);T=_.combineInstances(I)[0],T.attributes.position.values=new Float64Array(T.attributes.position.values),T.indices=g.createTypedArray(T.attributes.position.values.length/3,T.indices);var V=T.attributes,k=t.fromVertices(V.position.values);return i.position||delete V.position,new p({attributes:V,indices:T.indices,primitiveType:T.primitiveType,boundingSphere:k})}}},M.createShadowVolume=function(e,t,i){var r=e._granularity,n=e._ellipsoid,o=t(r,n),a=i(r,n);return new M({polygonHierarchy:e._polygonHierarchy,ellipsoid:n,stRotation:e._stRotation,granularity:r,perPositionHeight:!1,extrudedHeight:o,height:a,vertexFormat:b.POSITION_ONLY,shadowVolume:!0})},u(M.prototype,{rectangle:{get:function(){return this._rectangle}}}),M}),i("Core/PolygonHierarchy",["./defined"],function(e){"use strict";function t(t,i){this.positions=e(t)?t:[],this.holes=e(i)?i:[]}return t});i("Core/PolygonOutlineGeometry",["./arrayRemoveDuplicates","./BoundingSphere","./Cartesian3","./Check","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./PolygonGeometryLibrary","./PolygonPipeline","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w){"use strict";function S(e,t,i,r){var o=u.fromPoints(t,e),a=o.projectPointsOntoPlane(t,T),s=v.computeWindingOrder2D(a);s===w.CLOCKWISE&&(a.reverse(),t=t.slice().reverse());var l,m,_=t.length,C=0;if(r)for(l=new Float64Array(2*_*3),m=0;m<_;m++){var S=t[m],E=t[(m+1)%_];l[C++]=S.x,l[C++]=S.y,l[C++]=S.z,l[C++]=E.x,l[C++]=E.y,l[C++]=E.z}else{var b=0;for(m=0;m<_;m++)b+=g.subdivideLineCount(t[m],t[(m+1)%_],i);for(l=new Float64Array(3*b),m=0;m<_;m++)for(var A=g.subdivideLine(t[m],t[(m+1)%_],i,x),P=A.length,D=0;D<P;++D)l[C++]=A[D]}_=l.length/3;var M=2*_,I=f.createTypedArray(_,M);for(C=0,m=0;m<_-1;m++)I[C++]=m,I[C++]=m+1;return I[C++]=_-1,I[C++]=0,new p({geometry:new c({attributes:new d({position:new h({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:l})}),indices:I,primitiveType:y.LINES})})}function E(e,t,i,r){var o=u.fromPoints(t,e),a=o.projectPointsOntoPlane(t,T),s=v.computeWindingOrder2D(a);s===w.CLOCKWISE&&(a.reverse(),t=t.slice().reverse());var l,m,_=t.length,C=new Array(_),S=0;if(r)for(l=new Float64Array(2*_*3*2),m=0;m<_;++m){C[m]=S/3;var E=t[m],b=t[(m+1)%_];l[S++]=E.x,l[S++]=E.y,l[S++]=E.z,l[S++]=b.x,l[S++]=b.y,l[S++]=b.z}else{var A=0;for(m=0;m<_;m++)A+=g.subdivideLineCount(t[m],t[(m+1)%_],i);for(l=new Float64Array(3*A*2),m=0;m<_;++m){C[m]=S/3;for(var P=g.subdivideLine(t[m],t[(m+1)%_],i,x),D=P.length,M=0;M<D;++M)l[S++]=P[M]}}_=l.length/6;var I=C.length,R=2*(2*_+I),O=f.createTypedArray(_,R);for(S=0,m=0;m<_;++m)O[S++]=m,O[S++]=(m+1)%_,O[S++]=m+_,O[S++]=(m+1)%_+_;for(m=0;m<I;m++){var N=C[m];O[S++]=N,O[S++]=N+_}return new p({geometry:new c({attributes:new d({position:new h({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:l})}),indices:O,primitiveType:y.LINES})})}function b(e){var t=e.polygonHierarchy,i=o(e.ellipsoid,l.WGS84),r=o(e.granularity,_.RADIANS_PER_DEGREE),n=o(e.height,0),s=o(e.perPositionHeight,!1),u=e.extrudedHeight,c=a(u);if(c&&!s){var h=u;u=Math.min(h,n),n=Math.max(h,n)}this._ellipsoid=l.clone(i),this._granularity=r,this._height=n,this._extrudedHeight=o(u,0),this._extrude=c,this._polygonHierarchy=t,this._perPositionHeight=s,this._workerName="createPolygonOutlineGeometry",this.packedLength=g.computeHierarchyPackedLength(t)+l.packedLength+6}var T=[],x=[];b.pack=function(e,t,i){return i=o(i,0),i=g.packPolygonHierarchy(e._polygonHierarchy,t,i),l.pack(e._ellipsoid,t,i),i+=l.packedLength,t[i++]=e._height,t[i++]=e._extrudedHeight,t[i++]=e._granularity,t[i++]=e._extrude?1:0,t[i++]=e._perPositionHeight?1:0,t[i++]=e.packedLength,t};var A=l.clone(l.UNIT_SPHERE),P={polygonHierarchy:{}};return b.unpack=function(e,t,i){t=o(t,0);var r=g.unpackPolygonHierarchy(e,t);t=r.startingIndex,delete r.startingIndex;var n=l.unpack(e,t,A);t+=l.packedLength;var s=e[t++],u=e[t++],c=e[t++],h=1===e[t++],d=1===e[t++],p=e[t++];return a(i)||(i=new b(P)),i._polygonHierarchy=r,i._ellipsoid=l.clone(n,i._ellipsoid),i._height=s,i._extrudedHeight=u,i._granularity=c,i._extrude=h,i._perPositionHeight=d,i.packedLength=p,i},b.fromPositions=function(e){e=o(e,o.EMPTY_OBJECT);var t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight};return new b(t)},b.createGeometry=function(r){var n=r._ellipsoid,o=r._granularity,s=r._height,l=r._extrudedHeight,u=r._extrude,h=r._polygonHierarchy,d=r._perPositionHeight,p=[],f=new C;f.enqueue(h);for(var y;0!==f.length;){var w=f.dequeue(),b=w.positions;if(b=e(b,i.equalsEpsilon,!0),!(b.length<3)){var T=w.holes?w.holes.length:0;for(y=0;y<T;y++){var x=w.holes[y];if(x.positions=e(x.positions,i.equalsEpsilon,!0),!(x.positions.length<3)){p.push(x.positions);var A=0;a(x.holes)&&(A=x.holes.length);for(var P=0;P<A;P++)f.enqueue(x.holes[P])}}p.push(b)}}if(0!==p.length){var D,M=[],I=_.chordLength(o,n.maximumRadius);if(u)for(y=0;y<p.length;y++)D=E(n,p[y],I,d),D.geometry=g.scaleToGeodeticHeightExtruded(D.geometry,s,l,n,d),M.push(D);else for(y=0;y<p.length;y++)D=S(n,p[y],I,d),D.geometry.attributes.position.values=v.scaleToGeodeticHeight(D.geometry.attributes.position.values,s,n,!d),M.push(D);D=m.combineInstances(M)[0];var R=t.fromVertices(D.attributes.position.values);return new c({attributes:D.attributes,indices:D.indices,primitiveType:D.primitiveType,boundingSphere:R})}},b});i("Core/PolylineGeometry",["./arrayRemoveDuplicates","./BoundingSphere","./Cartesian3","./Color","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryType","./IndexDatatype","./Math","./PolylinePipeline","./PrimitiveType","./VertexFormat"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g){"use strict";function v(e,t,i,n,o){var a=C;a.length=o;var s,l=i.red,u=i.green,c=i.blue,h=i.alpha,d=n.red,p=n.green,m=n.blue,f=n.alpha;if(r.equals(i,n)){for(s=0;s<o;s++)a[s]=r.clone(i);return a}var _=(d-l)/o,g=(p-u)/o,v=(m-c)/o,y=(f-h)/o;for(s=0;s<o;s++)a[s]=new r(l+s*_,u+s*g,c+s*v,h+s*y);return a}function y(e){e=o(e,o.EMPTY_OBJECT);var t=e.positions,n=e.colors,s=o(e.width,1),u=o(e.colorsPerVertex,!1);this._positions=t,this._colors=n,this._width=s,this._colorsPerVertex=u,this._vertexFormat=g.clone(o(e.vertexFormat,g.DEFAULT)),this._followSurface=o(e.followSurface,!0),this._granularity=o(e.granularity,m.RADIANS_PER_DEGREE),this._ellipsoid=l.clone(o(e.ellipsoid,l.WGS84)),this._workerName="createPolylineGeometry";var c=1+t.length*i.packedLength;c+=a(n)?1+n.length*r.packedLength:1,this.packedLength=c+l.packedLength+g.packedLength+4}var C=[];y.pack=function(e,t,n){n=o(n,0);var s,u=e._positions,c=u.length;for(t[n++]=c,s=0;s<c;++s,n+=i.packedLength)i.pack(u[s],t,n);var h=e._colors;for(c=a(h)?h.length:0,t[n++]=c,s=0;s<c;++s,n+=r.packedLength)r.pack(h[s],t,n);return l.pack(e._ellipsoid,t,n),n+=l.packedLength,g.pack(e._vertexFormat,t,n),n+=g.packedLength,t[n++]=e._width,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._followSurface?1:0,t[n]=e._granularity,t};var w=l.clone(l.UNIT_SPHERE),S=new g,E={positions:void 0,colors:void 0,ellipsoid:w,vertexFormat:S,width:void 0,colorsPerVertex:void 0,followSurface:void 0,granularity:void 0};y.unpack=function(e,t,n){t=o(t,0);var s,u=e[t++],c=new Array(u);for(s=0;s<u;++s,t+=i.packedLength)c[s]=i.unpack(e,t);u=e[t++];var h=u>0?new Array(u):void 0;for(s=0;s<u;++s,t+=r.packedLength)h[s]=r.unpack(e,t);var d=l.unpack(e,t,w);t+=l.packedLength;var p=g.unpack(e,t,S);t+=g.packedLength;var m=e[t++],f=1===e[t++],_=1===e[t++],v=e[t];return a(n)?(n._positions=c,n._colors=h,n._ellipsoid=l.clone(d,n._ellipsoid),n._vertexFormat=g.clone(p,n._vertexFormat),n._width=m,n._colorsPerVertex=f,n._followSurface=_,n._granularity=v,n):(E.positions=c,E.colors=h,E.width=m,E.colorsPerVertex=f,E.followSurface=_,E.granularity=v,new y(E))};var b=new i,T=new i,x=new i,A=new i;return y.createGeometry=function(o){var s,l,g,y=o._width,w=o._vertexFormat,S=o._colors,E=o._colorsPerVertex,P=o._followSurface,D=o._granularity,M=o._ellipsoid,I=e(o._positions,i.equalsEpsilon),R=I.length;if(!(R<2||y<=0)){if(P){var O=f.extractHeights(I,M),N=m.chordLength(D,M.maximumRadius);if(a(S)){var L=1;for(s=0;s<R-1;++s)L+=f.numberOfPoints(I[s],I[s+1],N);var B=new Array(L),F=0;for(s=0;s<R-1;++s){var V=I[s],k=I[s+1],z=S[s],U=f.numberOfPoints(V,k,N);if(E&&s<L){var G=S[s+1],W=v(V,k,z,G,U),H=W.length;for(l=0;l<H;++l)B[F++]=W[l]}else for(l=0;l<U;++l)B[F++]=r.clone(z)}B[F]=r.clone(S[S.length-1]),S=B,C.length=0}I=f.generateCartesianArc({positions:I,minDistance:N,ellipsoid:M,height:O})}R=I.length;var q,j=4*R-4,Y=new Float64Array(3*j),X=new Float64Array(3*j),Z=new Float64Array(3*j),K=new Float32Array(2*j),Q=w.st?new Float32Array(2*j):void 0,J=a(S)?new Uint8Array(4*j):void 0,$=0,ee=0,te=0,ie=0;for(l=0;l<R;++l){0===l?(q=b,i.subtract(I[0],I[1],q),i.add(I[0],q,q)):q=I[l-1],i.clone(q,x),i.clone(I[l],T),l===R-1?(q=b,i.subtract(I[R-1],I[R-2],q),i.add(I[R-1],q,q)):q=I[l+1],i.clone(q,A);var re,ne;a(J)&&(re=0===l||E?S[l]:S[l-1],l!==R-1&&(ne=S[l]));var oe=0===l?2:0,ae=l===R-1?2:4;for(g=oe;g<ae;++g){i.pack(T,Y,$),i.pack(x,X,$),i.pack(A,Z,$),$+=3;var se=g-2<0?-1:1;if(K[ee++]=2*(g%2)-1,K[ee++]=se*y,w.st&&(Q[te++]=l/(R-1),Q[te++]=Math.max(K[ee-2],0)),a(J)){var le=g<2?re:ne;J[ie++]=r.floatToByte(le.red),J[ie++]=r.floatToByte(le.green),J[ie++]=r.floatToByte(le.blue),J[ie++]=r.floatToByte(le.alpha)}}}var ue=new h;ue.position=new c({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:Y}),ue.prevPosition=new c({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:X}),ue.nextPosition=new c({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:Z}),ue.expandAndWidth=new c({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:K}),w.st&&(ue.st=new c({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:Q})),a(J)&&(ue.color=new c({componentDatatype:n.UNSIGNED_BYTE,componentsPerAttribute:4,values:J,normalize:!0}));var ce=p.createTypedArray(j,6*R-6),he=0,de=0,pe=R-1;for(l=0;l<pe;++l)ce[de++]=he,ce[de++]=he+2,ce[de++]=he+1,ce[de++]=he+1,ce[de++]=he+2,ce[de++]=he+3,he+=4;return new u({attributes:ue,indices:ce,primitiveType:_.TRIANGLES,boundingSphere:t.fromPoints(I),geometryType:d.POLYLINES})}},y}),i("Core/PolylineVolumeGeometry",["./arrayRemoveDuplicates","./BoundingRectangle","./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./CornerType","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryPipeline","./IndexDatatype","./Math","./oneTimeWarning","./PolygonPipeline","./PolylineVolumeGeometryLibrary","./PrimitiveType","./VertexFormat","./WindingOrder"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S){"use strict";function E(e,t,r,n){var a=new p;n.position&&(a.position=new d({componentDatatype:o.DOUBLE,componentsPerAttribute:3,values:e}));var s,l,u,c,_,y,w=t.length,S=e.length/3,E=(S-2*w)/(2*w),b=v.triangulate(t),T=(E-1)*w*6+2*b.length,x=f.createTypedArray(S,T),A=2*w,P=0;for(s=0;s<E-1;s++){for(l=0;l<w-1;l++)u=2*l+s*w*2,y=u+A,c=u+1,_=c+A,x[P++]=c,x[P++]=u,x[P++]=_,x[P++]=_,x[P++]=u,x[P++]=y;u=2*w-2+s*w*2,c=u+1,_=c+A,y=u+A,x[P++]=c,x[P++]=u,x[P++]=_,x[P++]=_,x[P++]=u,x[P++]=y}if(n.st||n.tangent||n.bitangent){var D,M,I=new Float32Array(2*S),R=1/(E-1),O=1/r.height,N=r.height/2,L=0;for(s=0;s<E;s++){for(D=s*R,M=O*(t[0].y+N),I[L++]=D,I[L++]=M,l=1;l<w;l++)M=O*(t[l].y+N),I[L++]=D,I[L++]=M,I[L++]=D,I[L++]=M;M=O*(t[0].y+N),I[L++]=D,I[L++]=M}for(l=0;l<w;l++)D=0,M=O*(t[l].y+N),I[L++]=D,I[L++]=M;for(l=0;l<w;l++)D=(E-1)*R,M=O*(t[l].y+N),I[L++]=D,I[L++]=M;a.st=new d({componentDatatype:o.FLOAT,componentsPerAttribute:2,values:new Float32Array(I)})}var B=S-2*w;for(s=0;s<b.length;s+=3){var F=b[s]+B,V=b[s+1]+B,k=b[s+2]+B;x[P++]=F,x[P++]=V,x[P++]=k,x[P++]=k+w,x[P++]=V+w,x[P++]=F+w}var z=new h({attributes:a,indices:x,boundingSphere:i.fromVertices(e),primitiveType:C.TRIANGLES});if(n.normal&&(z=m.computeNormal(z)),n.tangent||n.bitangent){try{z=m.computeTangentAndBitangent(z)}catch(e){g("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}n.tangent||(z.attributes.tangent=void 0),n.bitangent||(z.attributes.bitangent=void 0),n.st||(z.attributes.st=void 0)}return z}function b(e){e=s(e,s.EMPTY_OBJECT);var t=e.polylinePositions,i=e.shapePositions;this._positions=t,this._shape=i,this._ellipsoid=c.clone(s(e.ellipsoid,c.WGS84)),this._cornerType=s(e.cornerType,a.ROUNDED),this._vertexFormat=w.clone(s(e.vertexFormat,w.DEFAULT)),this._granularity=s(e.granularity,_.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeGeometry";var o=1+t.length*n.packedLength;o+=1+i.length*r.packedLength,this.packedLength=o+c.packedLength+w.packedLength+2}b.pack=function(e,t,i){i=s(i,0);var o,a=e._positions,l=a.length;for(t[i++]=l, +o=0;o<l;++o,i+=n.packedLength)n.pack(a[o],t,i);var u=e._shape;for(l=u.length,t[i++]=l,o=0;o<l;++o,i+=r.packedLength)r.pack(u[o],t,i);return c.pack(e._ellipsoid,t,i),i+=c.packedLength,w.pack(e._vertexFormat,t,i),i+=w.packedLength,t[i++]=e._cornerType,t[i]=e._granularity,t};var T=c.clone(c.UNIT_SPHERE),x=new w,A={polylinePositions:void 0,shapePositions:void 0,ellipsoid:T,vertexFormat:x,cornerType:void 0,granularity:void 0};b.unpack=function(e,t,i){t=s(t,0);var o,a=e[t++],u=new Array(a);for(o=0;o<a;++o,t+=n.packedLength)u[o]=n.unpack(e,t);a=e[t++];var h=new Array(a);for(o=0;o<a;++o,t+=r.packedLength)h[o]=r.unpack(e,t);var d=c.unpack(e,t,T);t+=c.packedLength;var p=w.unpack(e,t,x);t+=w.packedLength;var m=e[t++],f=e[t];return l(i)?(i._positions=u,i._shape=h,i._ellipsoid=c.clone(d,i._ellipsoid),i._vertexFormat=w.clone(p,i._vertexFormat),i._cornerType=m,i._granularity=f,i):(A.polylinePositions=u,A.shapePositions=h,A.cornerType=m,A.granularity=f,new b(A))};var P=new t;return b.createGeometry=function(i){var r=i._positions,o=e(r,n.equalsEpsilon),a=i._shape;if(a=y.removeDuplicatesFromShape(a),!(o.length<2||a.length<3)){v.computeWindingOrder2D(a)===S.CLOCKWISE&&a.reverse();var s=t.fromPoints(a,P),l=y.computePositions(o,a,s,i,!0);return E(l,a,s,i._vertexFormat)}},b}),i("Core/PolylineVolumeOutlineGeometry",["./arrayRemoveDuplicates","./BoundingRectangle","./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./CornerType","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolygonPipeline","./PolylineVolumeGeometryLibrary","./PrimitiveType","./WindingOrder"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y){"use strict";function C(e,t){var r=new p;r.position=new d({componentDatatype:o.DOUBLE,componentsPerAttribute:3,values:e});var n,a,s=t.length,l=r.position.values.length/3,u=e.length/3,c=u/s,f=m.createTypedArray(l,2*s*(c+1)),_=0;n=0;var g=n*s;for(a=0;a<s-1;a++)f[_++]=a+g,f[_++]=a+g+1;for(f[_++]=s-1+g,f[_++]=g,n=c-1,g=n*s,a=0;a<s-1;a++)f[_++]=a+g,f[_++]=a+g+1;for(f[_++]=s-1+g,f[_++]=g,n=0;n<c-1;n++){var y=s*n,C=y+s;for(a=0;a<s;a++)f[_++]=a+y,f[_++]=a+C}var w=new h({attributes:r,indices:m.createTypedArray(l,f),boundingSphere:i.fromVertices(e),primitiveType:v.LINES});return w}function w(e){e=s(e,s.EMPTY_OBJECT);var t=e.polylinePositions,i=e.shapePositions;this._positions=t,this._shape=i,this._ellipsoid=c.clone(s(e.ellipsoid,c.WGS84)),this._cornerType=s(e.cornerType,a.ROUNDED),this._granularity=s(e.granularity,f.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeOutlineGeometry";var o=1+t.length*n.packedLength;o+=1+i.length*r.packedLength,this.packedLength=o+c.packedLength+2}w.pack=function(e,t,i){i=s(i,0);var o,a=e._positions,l=a.length;for(t[i++]=l,o=0;o<l;++o,i+=n.packedLength)n.pack(a[o],t,i);var u=e._shape;for(l=u.length,t[i++]=l,o=0;o<l;++o,i+=r.packedLength)r.pack(u[o],t,i);return c.pack(e._ellipsoid,t,i),i+=c.packedLength,t[i++]=e._cornerType,t[i]=e._granularity,t};var S=c.clone(c.UNIT_SPHERE),E={polylinePositions:void 0,shapePositions:void 0,ellipsoid:S,height:void 0,cornerType:void 0,granularity:void 0};w.unpack=function(e,t,i){t=s(t,0);var o,a=e[t++],u=new Array(a);for(o=0;o<a;++o,t+=n.packedLength)u[o]=n.unpack(e,t);a=e[t++];var h=new Array(a);for(o=0;o<a;++o,t+=r.packedLength)h[o]=r.unpack(e,t);var d=c.unpack(e,t,S);t+=c.packedLength;var p=e[t++],m=e[t];return l(i)?(i._positions=u,i._shape=h,i._ellipsoid=c.clone(d,i._ellipsoid),i._cornerType=p,i._granularity=m,i):(E.polylinePositions=u,E.shapePositions=h,E.cornerType=p,E.granularity=m,new w(E))};var b=new t;return w.createGeometry=function(i){var r=i._positions,o=e(r,n.equalsEpsilon),a=i._shape;if(a=g.removeDuplicatesFromShape(a),!(o.length<2||a.length<3)){_.computeWindingOrder2D(a)===y.CLOCKWISE&&a.reverse();var s=t.fromPoints(a,b),l=g.computePositions(o,a,s,i,!1);return C(l,a)}},w}),i("Core/QuaternionSpline",["./defaultValue","./defined","./defineProperties","./DeveloperError","./Quaternion","./Spline"],function(e,t,i,r,n,o){"use strict";function a(e,i,r){var o=e.length,a=new Array(o);a[0]=t(i)?i:e[0],a[o-1]=t(r)?r:e[o-1];for(var s=1;s<o-1;++s)a[s]=n.computeInnerQuadrangle(e[s-1],e[s],e[s+1],new n);return a}function s(e){var i=e.points,r=e.innerQuadrangles,o=e.times;if(i.length<3){var a=o[0],s=1/(o[1]-a),l=i[0],u=i[1];return function(e,i){t(i)||(i=new n);var r=(e-a)*s;return n.fastSlerp(l,u,r,i)}}return function(a,s){t(s)||(s=new n);var l=e._lastTimeIndex=e.findTimeInterval(a,e._lastTimeIndex),u=(a-o[l])/(o[l+1]-o[l]),c=i[l],h=i[l+1],d=r[l],p=r[l+1];return n.fastSquad(c,h,d,p,u,s)}}function l(t){t=e(t,e.EMPTY_OBJECT);var i=t.points,r=t.times,n=t.firstInnerQuadrangle,o=t.lastInnerQuadrangle,l=a(i,n,o);this._times=r,this._points=i,this._innerQuadrangles=l,this._evaluateFunction=s(this),this._lastTimeIndex=0}return i(l.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},innerQuadrangles:{get:function(){return this._innerQuadrangles}}}),l.prototype.findTimeInterval=o.prototype.findTimeInterval,l.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)},l}),i("Core/RectangleGeometryLibrary",["./Cartesian3","./Cartographic","./defined","./DeveloperError","./GeographicProjection","./Math","./Matrix2","./Rectangle"],function(e,t,i,r,n,o,a,s){"use strict";function l(t,i,r,n,o,s,l){var u=Math.cos(i),c=n*u,h=r*u,d=Math.sin(i),f=n*d,v=r*d;m=g.project(t,m),m=e.subtract(m,_,m);var y=a.fromRotation(i,p);m=a.multiplyByVector(y,m,m),m=e.add(m,_,m),t=g.unproject(m,t),s-=1,l-=1;var C=t.latitude,w=C+s*v,S=C-c*l,E=C-c*l+s*v,b=Math.max(C,w,S,E),T=Math.min(C,w,S,E),x=t.longitude,A=x+s*h,P=x+l*f,D=x+l*f+s*h,M=Math.max(x,A,P,D),I=Math.min(x,A,P,D);return{north:b,south:T,east:M,west:I,granYCos:c,granYSin:f,granXCos:h,granXSin:v,nwCorner:t}}var u=Math.cos,c=Math.sin,h=Math.sqrt,d={};d.computePosition=function(e,t,r,n,o){var a=e.ellipsoid.radiiSquared,s=e.nwCorner,l=e.rectangle,d=s.latitude-e.granYCos*t+r*e.granXSin,p=u(d),m=c(d),f=a.z*m,_=s.longitude+t*e.granYSin+r*e.granXCos,g=p*u(_),v=p*c(_),y=a.x*g,C=a.y*v,w=h(y*g+C*v+f*m);if(n.x=y/w,n.y=C/w,n.z=f/w,i(e.vertexFormat)&&e.vertexFormat.st){var S=e.stNwCorner;i(S)?(d=S.latitude-e.stGranYCos*t+r*e.stGranXSin,_=S.longitude+t*e.stGranYSin+r*e.stGranXCos,o.x=(_-e.stWest)*e.lonScalar,o.y=(d-e.stSouth)*e.latScalar):(o.x=(_-l.west)*e.lonScalar,o.y=(d-l.south)*e.latScalar)}};var p=new a,m=new e,f=new t,_=new e,g=new n;return d.computeOptions=function(e,t,i,r){var n,a,u,c,h,d=e._granularity,p=e._ellipsoid,m=e._surfaceHeight,v=e._rotation,y=e._stRotation,C=e._extrudedHeight,w=t.east,S=t.west,E=t.north,b=t.south,T=E-b;S>w?(h=o.TWO_PI-S+w,n=Math.ceil(h/d)+1,a=Math.ceil(T/d)+1,u=h/(n-1),c=T/(a-1)):(h=w-S,n=Math.ceil(h/d)+1,a=Math.ceil(T/d)+1,u=h/(n-1),c=T/(a-1)),i=s.northwest(t,i);var x=s.center(t,f);0===v&&0===y||(x.longitude<i.longitude&&(x.longitude+=o.TWO_PI),_=g.project(x,_));var A=c,P=u,D=0,M=0,I={granYCos:A,granYSin:D,granXCos:P,granXSin:M,ellipsoid:p,surfaceHeight:m,extrudedHeight:C,nwCorner:i,rectangle:t,width:n,height:a};if(0!==v){var R=l(i,v,u,c,x,n,a);E=R.north,b=R.south,w=R.east,S=R.west,I.granYCos=R.granYCos,I.granYSin=R.granYSin,I.granXCos=R.granXCos,I.granXSin=R.granXSin,t.north=E,t.south=b,t.east=w,t.west=S}if(0!==y){v-=y,r=s.northwest(t,r);var O=l(r,v,u,c,x,n,a);I.stGranYCos=O.granYCos,I.stGranXCos=O.granXCos,I.stGranYSin=O.granYSin,I.stGranXSin=O.granXSin,I.stNwCorner=r,I.stWest=O.west,I.stSouth=O.south}return I},d}),i("Core/RectangleGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./Check","./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix2","./Matrix3","./PolygonPipeline","./PrimitiveType","./Quaternion","./Rectangle","./RectangleGeometryLibrary","./VertexFormat"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T){"use strict";function x(e,t){var i=new h({attributes:new p,primitiveType:w.TRIANGLES});return i.attributes.position=new d({componentDatatype:o.DOUBLE,componentsPerAttribute:3,values:t.positions}),e.normal&&(i.attributes.normal=new d({componentDatatype:o.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(i.attributes.tangent=new d({componentDatatype:o.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.bitangent&&(i.attributes.bitangent=new d({componentDatatype:o.FLOAT,componentsPerAttribute:3,values:t.bitangents})),i}function A(e,t,r,n){for(var o=e.length,a=t.normal?new Float32Array(o):void 0,s=t.tangent?new Float32Array(o):void 0,l=t.bitangent?new Float32Array(o):void 0,u=0,c=V,h=F,d=B,p=0;p<o;p+=3){var m=i.fromArray(e,p,L),f=u+1,_=u+2;(t.normal||t.tangent||t.bitangent)&&(d=r.geodeticSurfaceNormal(m,d),(t.tangent||t.bitangent)&&(i.cross(i.UNIT_Z,d,h),y.multiplyByVector(n,h,h),i.normalize(h,h),t.bitangent&&i.normalize(i.cross(d,h,c),c)),t.normal&&(a[u]=d.x,a[f]=d.y,a[_]=d.z),t.tangent&&(s[u]=h.x,s[f]=h.y,s[_]=h.z),t.bitangent&&(l[u]=c.x,l[f]=c.y,l[_]=c.z)),u+=3}return x(t,{positions:e,normals:a,tangents:s,bitangents:l})}function P(e,t,r){for(var n=e.length,o=t.normal?new Float32Array(n):void 0,a=t.tangent?new Float32Array(n):void 0,s=t.bitangent?new Float32Array(n):void 0,l=0,u=0,c=0,h=!0,d=V,p=F,m=B,f=0;f<n;f+=6){var _=i.fromArray(e,f,L);if(t.normal||t.tangent||t.bitangent){var v=i.fromArray(e,(f+6)%n,W);if(h){var y=i.fromArray(e,(f+3)%n,H);i.subtract(v,_,v),i.subtract(y,_,y),m=i.normalize(i.cross(y,v,m),m),h=!1}i.equalsEpsilon(v,_,g.EPSILON10)&&(h=!0),(t.tangent||t.bitangent)&&(d=r.geodeticSurfaceNormal(_,d),t.tangent&&(p=i.normalize(i.cross(d,m,p),p))),t.normal&&(o[l++]=m.x,o[l++]=m.y,o[l++]=m.z,o[l++]=m.x,o[l++]=m.y,o[l++]=m.z),t.tangent&&(a[u++]=p.x,a[u++]=p.y,a[u++]=p.z,a[u++]=p.x,a[u++]=p.y,a[u++]=p.z),t.bitangent&&(s[c++]=d.x,s[c++]=d.y,s[c++]=d.z,s[c++]=d.x,s[c++]=d.y,s[c++]=d.z)}}return x(t,{positions:e,normals:o,tangents:a,bitangents:s})}function D(e){for(var t=e.vertexFormat,i=e.ellipsoid,r=e.size,n=e.height,a=e.width,s=t.position?new Float64Array(3*r):void 0,l=t.st?new Float32Array(2*r):void 0,u=0,c=0,h=L,p=z,m=Number.MAX_VALUE,f=Number.MAX_VALUE,g=-Number.MAX_VALUE,v=-Number.MAX_VALUE,y=0;y<n;++y)for(var C=0;C<a;++C)b.computePosition(e,y,C,h,p),s[u++]=h.x,s[u++]=h.y,s[u++]=h.z,t.st&&(l[c++]=p.x,l[c++]=p.y,m=Math.min(m,p.x),f=Math.min(f,p.y),g=Math.max(g,p.x),v=Math.max(v,p.y));if(t.st&&(m<0||f<0||g>1||v>1))for(var w=0;w<l.length;w+=2)l[w]=(l[w]-m)/(g-m),l[w+1]=(l[w+1]-f)/(v-f);for(var S=A(s,t,i,e.tangentRotationMatrix),E=6*(a-1)*(n-1),T=_.createTypedArray(r,E),x=0,P=0,D=0;D<n-1;++D){for(var M=0;M<a-1;++M){var I=x,R=I+a,O=R+1,N=I+1;T[P++]=I,T[P++]=R,T[P++]=N,T[P++]=N,T[P++]=R,T[P++]=O,++x}++x}return S.indices=T,t.st&&(S.attributes.st=new d({componentDatatype:o.FLOAT,componentsPerAttribute:2,values:l})),S}function M(e,t,i,r,n){return e[t++]=r[i],e[t++]=r[i+1],e[t++]=r[i+2],e[t++]=n[i],e[t++]=n[i+1],e[t++]=n[i+2],e}function I(e,t,i,r){return e[t++]=r[i],e[t++]=r[i+1],e[t++]=r[i],e[t++]=r[i+1],e}function R(e){var t,r=e.shadowVolume,n=e.vertexFormat,a=e.surfaceHeight,s=e.extrudedHeight,l=Math.min(s,a),u=Math.max(s,a),c=e.height,h=e.width,p=e.ellipsoid;r&&(e.vertexFormat=T.clone(n,q),e.vertexFormat.normal=!0);var v=D(e);if(g.equalsEpsilon(l,u,g.EPSILON10))return v;var y=C.scaleToGeodeticHeight(v.attributes.position.values,u,p,!1);y=new Float64Array(y);var w=y.length,S=2*w,E=new Float64Array(S);E.set(y);var b=C.scaleToGeodeticHeight(v.attributes.position.values,l,p);E.set(b,w),v.attributes.position.values=E;var x,A,R=n.normal?new Float32Array(S):void 0,O=n.tangent?new Float32Array(S):void 0,N=n.bitangent?new Float32Array(S):void 0,L=n.st?new Float32Array(S/3*2):void 0;if(n.normal){for(A=v.attributes.normal.values,R.set(A),t=0;t<w;t++)A[t]=-A[t];R.set(A,w),v.attributes.normal.values=R}if(r){A=v.attributes.normal.values,n.normal||(v.attributes.normal=void 0);var B=new Float32Array(S);for(t=0;t<w;t++)A[t]=-A[t];B.set(A,w),v.attributes.extrudeDirection=new d({componentDatatype:o.FLOAT,componentsPerAttribute:3,values:B})}if(n.tangent){var F=v.attributes.tangent.values;for(O.set(F),t=0;t<w;t++)F[t]=-F[t];O.set(F,w),v.attributes.tangent.values=O}if(n.bitangent){var V=v.attributes.bitangent.values;N.set(V),N.set(V,w),v.attributes.bitangent.values=N}n.st&&(x=v.attributes.st.values,L.set(x),L.set(x,w/3*2),v.attributes.st.values=L);var k=v.indices,z=k.length,U=w/3,G=_.createTypedArray(S/3,2*z);for(G.set(k),t=0;t<z;t+=3)G[t+z]=k[t+2]+U,G[t+1+z]=k[t+1]+U,G[t+2+z]=k[t]+U;v.indices=G;var j,Y=2*h+2*c-4,X=2*(Y+4),Z=new Float64Array(3*X),K=r?new Float32Array(3*X):void 0,Q=n.st?new Float32Array(2*X):void 0,J=0,$=0,ee=0,te=h*c;for(t=0;t<te;t+=h)j=3*t,Z=M(Z,J,j,y,b),J+=6,n.st&&(Q=I(Q,$,2*t,x),$+=4),r&&(ee+=3,K[ee++]=A[j],K[ee++]=A[j+1],K[ee++]=A[j+2]);for(t=te-h;t<te;t++)j=3*t,Z=M(Z,J,j,y,b),J+=6,n.st&&(Q=I(Q,$,2*t,x),$+=4),r&&(ee+=3,K[ee++]=A[j],K[ee++]=A[j+1],K[ee++]=A[j+2]);for(t=te-1;t>0;t-=h)j=3*t,Z=M(Z,J,j,y,b),J+=6,n.st&&(Q=I(Q,$,2*t,x),$+=4),r&&(ee+=3,K[ee++]=A[j],K[ee++]=A[j+1],K[ee++]=A[j+2]);for(t=h-1;t>=0;t--)j=3*t,Z=M(Z,J,j,y,b),J+=6,n.st&&(Q=I(Q,$,2*t,x),$+=4),r&&(ee+=3,K[ee++]=A[j],K[ee++]=A[j+1],K[ee++]=A[j+2]);var ie=P(Z,n,p);n.st&&(ie.attributes.st=new d({componentDatatype:o.FLOAT,componentsPerAttribute:2,values:Q})),r&&(ie.attributes.extrudeDirection=new d({componentDatatype:o.FLOAT,componentsPerAttribute:3,values:K}));var re,ne,oe,ae,se=_.createTypedArray(X,6*Y);w=Z.length/3;var le=0;for(t=0;t<w-1;t+=2){re=t,ae=(re+2)%w;var ue=i.fromArray(Z,3*re,W),ce=i.fromArray(Z,3*ae,H);i.equalsEpsilon(ue,ce,g.EPSILON10)||(ne=(re+1)%w,oe=(ne+2)%w,se[le++]=re,se[le++]=ne,se[le++]=ae,se[le++]=ae,se[le++]=ne,se[le++]=oe)}return ie.indices=se,ie=f.combineInstances([new m({geometry:v}),new m({geometry:ie})]),ie[0]}function O(e,t,i){if(0===i)return E.clone(e);E.northeast(e,K[0]),E.northwest(e,K[1]),E.southeast(e,K[2]),E.southwest(e,K[3]),t.cartographicArrayToCartesianArray(K,Z);var r=t.geodeticSurfaceNormalCartographic(E.center(e,Y));S.fromAxisAngle(r,i,X),y.fromQuaternion(X,j);for(var n=0;n<4;++n)y.multiplyByVector(j,Z[n],Z[n]);return t.cartesianArrayToCartographicArray(Z,K),E.fromCartographicArray(K)}function N(e){e=a(e,a.EMPTY_OBJECT);var t=e.rectangle,i=a(e.rotation,0);this._rectangle=t,this._granularity=a(e.granularity,g.RADIANS_PER_DEGREE),this._ellipsoid=c.clone(a(e.ellipsoid,c.WGS84)),this._surfaceHeight=a(e.height,0),this._rotation=i,this._stRotation=a(e.stRotation,0),this._vertexFormat=T.clone(a(e.vertexFormat,T.DEFAULT)),this._extrudedHeight=a(e.extrudedHeight,0),this._extrude=s(e.extrudedHeight),this._closeTop=a(e.closeTop,!0),this._closeBottom=a(e.closeBottom,!0),this._shadowVolume=a(e.shadowVolume,!1),this._workerName="createRectangleGeometry",this._rotatedRectangle=O(this._rectangle,this._ellipsoid,i)}var L=new i,B=new i,F=new i,V=new i,k=new E,z=new t,U=new e,G=new e,W=new i,H=new i,q=new T,j=new y,Y=new i,X=new S,Z=[new i,new i,new i,new i],K=[new r,new r,new r,new r];N.packedLength=E.packedLength+c.packedLength+T.packedLength+E.packedLength+9,N.pack=function(e,t,i){return i=a(i,0),E.pack(e._rectangle,t,i),i+=E.packedLength,c.pack(e._ellipsoid,t,i),i+=c.packedLength,T.pack(e._vertexFormat,t,i),i+=T.packedLength,E.pack(e._rotatedRectangle,t,i),i+=E.packedLength,t[i++]=e._granularity,t[i++]=e._surfaceHeight,t[i++]=e._rotation,t[i++]=e._stRotation,t[i++]=e._extrudedHeight,t[i++]=e._extrude?1:0,t[i++]=e._closeTop?1:0,t[i++]=e._closeBottom?1:0,t[i]=e._shadowVolume?1:0,t};var Q=new E,J=new E,$=c.clone(c.UNIT_SPHERE),ee={rectangle:Q,ellipsoid:$,vertexFormat:q,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,closeTop:void 0,closeBottom:void 0,shadowVolume:void 0};N.unpack=function(e,t,i){t=a(t,0);var r=E.unpack(e,t,Q);t+=E.packedLength;var n=c.unpack(e,t,$);t+=c.packedLength;var o=T.unpack(e,t,q);t+=T.packedLength;var l=E.unpack(e,t,J);t+=E.packedLength;var u=e[t++],h=e[t++],d=e[t++],p=e[t++],m=e[t++],f=1===e[t++],_=1===e[t++],g=1===e[t++],v=1===e[t];return s(i)?(i._rectangle=E.clone(r,i._rectangle),i._ellipsoid=c.clone(n,i._ellipsoid),i._vertexFormat=T.clone(o,i._vertexFormat),i._granularity=u,i._surfaceHeight=h,i._rotation=d,i._stRotation=p,i._extrudedHeight=f?m:void 0,i._extrude=f,i._closeTop=_,i._closeBottom=g,i._rotatedRectangle=l,i._shadowVolume=v,i):(ee.granularity=u,ee.height=h,ee.rotation=d,ee.stRotation=p,ee.extrudedHeight=f?m:void 0,ee.closeTop=_,ee.closeBottom=g,ee.shadowVolume=v,new N(ee))};var te=new y,ie=new r,re=new r,ne=new S,oe=new r;return N.createGeometry=function(t){if(!g.equalsEpsilon(t._rectangle.north,t._rectangle.south,g.EPSILON10)&&!g.equalsEpsilon(t._rectangle.east,t._rectangle.west,g.EPSILON10)){var i=E.clone(t._rectangle,k),r=t._ellipsoid,n=t._surfaceHeight,o=t._extrude,a=t._extrudedHeight,s=t._rotation,l=t._stRotation,u=t._vertexFormat,c=b.computeOptions(t,i,ie,re),d=te;if(0!==l||0!==s){var p=E.center(i,oe),m=r.geodeticSurfaceNormalCartographic(p,W);S.fromAxisAngle(m,-l,ne),y.fromQuaternion(ne,d)}else y.clone(y.IDENTITY,d);c.lonScalar=1/t._rectangle.width,c.latScalar=1/t._rectangle.height,c.vertexFormat=u,c.rotation=s,c.stRotation=l,c.tangentRotationMatrix=d,c.size=c.width*c.height;var f,_;if(i=t._rectangle,o){c.shadowVolume=t._shadowVolume,f=R(c);var v=e.fromRectangle3D(i,r,n,G),w=e.fromRectangle3D(i,r,a,U);_=e.union(v,w)}else f=D(c),f.attributes.position.values=C.scaleToGeodeticHeight(f.attributes.position.values,n,r,!1),_=e.fromRectangle3D(i,r,n);return u.position||delete f.attributes.position,new h({attributes:f.attributes,indices:f.indices,primitiveType:f.primitiveType,boundingSphere:_})}},N.createShadowVolume=function(e,t,i){var r=e._granularity,n=e._ellipsoid,o=t(r,n),a=i(r,n);return new N({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:n,stRotation:e._stRotation,granularity:r,extrudedHeight:a,height:o,closeTop:!0,closeBottom:!0,vertexFormat:T.POSITION_ONLY,shadowVolume:!0})},l(N.prototype,{rectangle:{get:function(){return this._rotatedRectangle}}}),N}),i("Core/RectangleOutlineGeometry",["./BoundingSphere","./Cartesian3","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolygonPipeline","./PrimitiveType","./Rectangle","./RectangleGeometryLibrary"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_){"use strict";function g(e){var t,i=e.size,n=e.height,o=e.width,a=new Float64Array(3*i),s=0,d=0,p=S;for(t=0;t<o;t++)_.computePosition(e,d,t,p),a[s++]=p.x,a[s++]=p.y,a[s++]=p.z;for(t=o-1,d=1;d<n;d++)_.computePosition(e,d,t,p),a[s++]=p.x,a[s++]=p.y,a[s++]=p.z;for(d=n-1,t=o-2;t>=0;t--)_.computePosition(e,d,t,p),a[s++]=p.x,a[s++]=p.y,a[s++]=p.z;for(t=0,d=n-2;d>0;d--)_.computePosition(e,d,t,p),a[s++]=p.x,a[s++]=p.y,a[s++]=p.z;for(var f=a.length/3*2,g=h.createTypedArray(a.length/3,f),v=0,y=0;y<a.length/3-1;y++)g[v++]=y,g[v++]=y+1;g[v++]=a.length/3-1,g[v++]=0;var C=new l({attributes:new c,primitiveType:m.LINES});return C.attributes.position=new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:a}),C.indices=g,C}function v(e){var t=e.surfaceHeight,i=e.extrudedHeight,r=e.ellipsoid,n=Math.min(i,t),o=Math.max(i,t),a=g(e);if(d.equalsEpsilon(n,o,d.EPSILON10))return a;var s=e.height,l=e.width,u=p.scaleToGeodeticHeight(a.attributes.position.values,o,r,!1),c=u.length,m=new Float64Array(2*c);m.set(u);var f=p.scaleToGeodeticHeight(a.attributes.position.values,n,r);m.set(f,c),a.attributes.position.values=m;var _=m.length/3*2+8,v=h.createTypedArray(m.length/3,_);c=m.length/6;for(var y=0,C=0;C<c-1;C++)v[y++]=C,v[y++]=C+1,v[y++]=C+c,v[y++]=C+c+1;return v[y++]=c-1,v[y++]=0,v[y++]=c+c-1,v[y++]=c,v[y++]=0,v[y++]=c,v[y++]=l-1,v[y++]=c+l-1,v[y++]=l+s-2,v[y++]=l+s-2+c,v[y++]=2*l+s-3,v[y++]=2*l+s-3+c,a.indices=v,a}function y(e){e=n(e,n.EMPTY_OBJECT);var t=e.rectangle,i=n(e.granularity,d.RADIANS_PER_DEGREE),r=n(e.ellipsoid,s.WGS84),o=n(e.height,0),a=n(e.rotation,0),l=e.extrudedHeight;this._rectangle=t,this._granularity=i,this._ellipsoid=r,this._surfaceHeight=o,this._rotation=a,this._extrudedHeight=l,this._workerName="createRectangleOutlineGeometry"}var C=new e,w=new e,S=new t,E=new f;y.packedLength=f.packedLength+s.packedLength+5,y.pack=function(e,t,i){return i=n(i,0),f.pack(e._rectangle,t,i),i+=f.packedLength,s.pack(e._ellipsoid,t,i),i+=s.packedLength,t[i++]=e._granularity,t[i++]=e._surfaceHeight,t[i++]=e._rotation,t[i++]=o(e._extrudedHeight)?1:0,t[i]=n(e._extrudedHeight,0),t};var b=new f,T=s.clone(s.UNIT_SPHERE),x={rectangle:b,ellipsoid:T,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0};y.unpack=function(e,t,i){t=n(t,0);var r=f.unpack(e,t,b);t+=f.packedLength;var a=s.unpack(e,t,T);t+=s.packedLength;var l=e[t++],u=e[t++],c=e[t++],h=e[t++],d=e[t];return o(i)?(i._rectangle=f.clone(r,i._rectangle),i._ellipsoid=s.clone(a,i._ellipsoid),i._surfaceHeight=u,i._rotation=c,i._extrudedHeight=h?d:void 0,i):(x.granularity=l,x.height=u,x.rotation=c,x.extrudedHeight=h?d:void 0,new y(x))};var A=new i;return y.createGeometry=function(t){var i=f.clone(t._rectangle,E),r=t._ellipsoid,n=t._surfaceHeight,a=t._extrudedHeight,s=_.computeOptions(t,i,A);s.size=2*s.width+2*s.height-4;var u,c;if(i=t._rectangle,!d.equalsEpsilon(i.north,i.south,d.EPSILON10)&&!d.equalsEpsilon(i.east,i.west,d.EPSILON10)){if(o(a)){u=v(s);var h=e.fromRectangle3D(i,r,n,w),y=e.fromRectangle3D(i,r,a,C);c=e.union(h,y)}else u=g(s),u.attributes.position.values=p.scaleToGeodeticHeight(u.attributes.position.values,n,r,!1),c=e.fromRectangle3D(i,r,n);return new l({attributes:u.attributes,indices:u.indices,primitiveType:m.LINES,boundingSphere:c})}},y}),i("Core/ReferenceFrame",["./freezeObject"],function(e){"use strict";var t={FIXED:0,INERTIAL:1};return e(t)}),i("Core/requestAnimationFrame",["./defined","./getTimestamp"],function(e,t){"use strict";function i(e){return r(e)}if("undefined"!=typeof window){var r=window.requestAnimationFrame;return function(){if(!e(r))for(var i=["webkit","moz","ms","o"],n=0,o=i.length;n<o&&!e(r);)r=window[i[n]+"RequestAnimationFrame"],++n;if(!e(r)){var a=1e3/60,s=0;r=function(e){var i=t(),r=Math.max(a-(i-s),0);return s=i+r,setTimeout(function(){e(s)},r)}}}(),i}}),i("Core/sampleTerrainMostDetailed",["../ThirdParty/when","./defined","./sampleTerrain","./DeveloperError","./Rectangle"],function(e,t,i,r,n){"use strict";function o(r,n){return r.readyPromise.then(function(){for(var o=[],a=r.availability,s=0;s<n.length;++s){var l=n[s],u=a.computeMaximumLevelAtPosition(l),c=o[u];t(c)||(o[u]=c=[]),c.push(l)}return e.all(o.map(function(e,n){if(t(e))return i(r,n,e)})).then(function(){return n})})}return o}),i("Core/ScreenSpaceEventType",["./freezeObject"],function(e){"use strict";var t={LEFT_DOWN:0,LEFT_UP:1,LEFT_CLICK:2,LEFT_DOUBLE_CLICK:3,RIGHT_DOWN:5,RIGHT_UP:6,RIGHT_CLICK:7,RIGHT_DOUBLE_CLICK:8,MIDDLE_DOWN:10,MIDDLE_UP:11,MIDDLE_CLICK:12,MIDDLE_DOUBLE_CLICK:13,MOUSE_MOVE:15,WHEEL:16,PINCH_START:17,PINCH_END:18,PINCH_MOVE:19};return e(t)}),i("Core/ScreenSpaceEventHandler",["./AssociativeArray","./Cartesian2","./defaultValue","./defined","./deprecationWarning","./destroyObject","./DeveloperError","./FeatureDetection","./getTimestamp","./KeyboardEventModifier","./ScreenSpaceEventType"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(e,t,i){var r=e._element;if(r===document)return i.x=t.clientX,i.y=t.clientY,i;var n=r.getBoundingClientRect();return i.x=t.clientX-n.left,i.y=t.clientY-n.top,i}function d(e,t){var i=e;return r(t)&&(i+="+"+t),i}function p(e){return e.shiftKey?u.SHIFT:e.ctrlKey?u.CTRL:e.altKey?u.ALT:void 0}function m(e,t,i,r){function n(t){r(e,t)}i.addEventListener(t,n,!1),e._removalFunctions.push(function(){i.removeEventListener(t,n,!1)})}function f(e){var t=e._element,i=r(t.disableRootEvents)?t:document;s.supportsPointerEvents()?(m(e,"pointerdown",t,D),m(e,"pointerup",t,M),m(e,"pointermove",t,I),m(e,"pointercancel",t,M)):(m(e,"mousedown",t,y),m(e,"mouseup",i,C),m(e,"mousemove",i,w),m(e,"touchstart",t,b),m(e,"touchend",i,T),m(e,"touchmove",i,A),m(e,"touchcancel",i,T)),m(e,"dblclick",t,S);var n;n="onwheel"in t?"wheel":void 0!==document.onmousewheel?"mousewheel":"DOMMouseScroll",m(e,n,t,E)}function _(e){for(var t=e._removalFunctions,i=0;i<t.length;++i)t[i]()}function g(e){e._lastSeenTouchEvent=l()}function v(e){return l()-e._lastSeenTouchEvent>R.mouseEmulationIgnoreMilliseconds}function y(e,i){if(v(e)){var n=i.button;e._buttonDown=n;var o;if(n===N.LEFT)o=c.LEFT_DOWN;else if(n===N.MIDDLE)o=c.MIDDLE_DOWN;else{if(n!==N.RIGHT)return;o=c.RIGHT_DOWN}var a=h(e,i,e._primaryPosition);t.clone(a,e._primaryStartPosition),t.clone(a,e._primaryPreviousPosition);var s=p(i),l=e.getInputAction(o,s);r(l)&&(t.clone(a,L.position),l(L),i.preventDefault())}}function C(e,i){if(v(e)){var n=i.button;e._buttonDown=void 0;var o,a;if(n===N.LEFT)o=c.LEFT_UP,a=c.LEFT_CLICK;else if(n===N.MIDDLE)o=c.MIDDLE_UP,a=c.MIDDLE_CLICK;else{if(n!==N.RIGHT)return;o=c.RIGHT_UP,a=c.RIGHT_CLICK}var s=p(i),l=e.getInputAction(o,s),u=e.getInputAction(a,s);if(r(l)||r(u)){var d=h(e,i,e._primaryPosition);if(r(l)&&(t.clone(d,B.position),l(B)),r(u)){var m=e._primaryStartPosition,f=m.x-d.x,_=m.y-d.y,g=Math.sqrt(f*f+_*_);g<e._clickPixelTolerance&&(t.clone(d,F.position),u(F))}}}}function w(e,i){if(v(e)){var n=p(i),o=h(e,i,e._primaryPosition),a=e._primaryPreviousPosition,s=e.getInputAction(c.MOUSE_MOVE,n);r(s)&&(t.clone(a,V.startPosition),t.clone(o,V.endPosition),s(V)),t.clone(o,a),r(e._buttonDown)&&i.preventDefault()}}function S(e,t){var i,n=t.button;if(n===N.LEFT)i=c.LEFT_DOUBLE_CLICK;else if(n===N.MIDDLE)i=c.MIDDLE_DOUBLE_CLICK;else{if(n!==N.RIGHT)return;i=c.RIGHT_DOUBLE_CLICK}var o=p(t),a=e.getInputAction(i,o);r(a)&&(h(e,t,k.position),a(k))}function E(e,t){var i;if(r(t.deltaY)){var n=t.deltaMode;i=n===t.DOM_DELTA_PIXEL?-t.deltaY:n===t.DOM_DELTA_LINE?40*-t.deltaY:120*-t.deltaY}else i=t.detail>0?t.detail*-120:t.wheelDelta;if(r(i)){var o=p(t),a=e.getInputAction(c.WHEEL,o);r(a)&&(a(i),t.preventDefault())}}function b(e,i){g(e);var r,n,o,a=i.changedTouches,s=a.length,l=e._positions;for(r=0;r<s;++r)n=a[r],o=n.identifier,l.set(o,h(e,n,new t));x(e,i);var u=e._previousPositions;for(r=0;r<s;++r)n=a[r],o=n.identifier,u.set(o,t.clone(l.get(o)))}function T(e,t){g(e);var i,r,n,o=t.changedTouches,a=o.length,s=e._positions;for(i=0;i<a;++i)r=o[i],n=r.identifier,s.remove(n);x(e,t);var l=e._previousPositions;for(i=0;i<a;++i)r=o[i],n=r.identifier,l.remove(n)}function x(e,i){var n,o,a=p(i),s=e._positions,l=e._previousPositions,u=s.length;if(1!==u&&e._buttonDown===N.LEFT&&(e._buttonDown=void 0,n=e.getInputAction(c.LEFT_UP,a),r(n)&&(t.clone(e._primaryPosition,G.position),n(G)),0===u&&(o=e.getInputAction(c.LEFT_CLICK,a),r(o)))){var h=e._primaryStartPosition,d=l.values[0],m=h.x-d.x,f=h.y-d.y,_=Math.sqrt(m*m+f*f);_<e._clickPixelTolerance&&(t.clone(e._primaryPosition,W.position),o(W))}if(2!==u&&e._isPinching&&(e._isPinching=!1,n=e.getInputAction(c.PINCH_END,a),r(n)&&n()),1===u){var g=s.values[0];t.clone(g,e._primaryPosition),t.clone(g,e._primaryStartPosition),t.clone(g,e._primaryPreviousPosition),e._buttonDown=N.LEFT,n=e.getInputAction(c.LEFT_DOWN,a),r(n)&&(t.clone(g,z.position),n(z)),i.preventDefault()}2===u&&(e._isPinching=!0,n=e.getInputAction(c.PINCH_START,a),r(n)&&(t.clone(s.values[0],U.position1),t.clone(s.values[1],U.position2),n(U),i.preventDefault()))}function A(e,i){g(e);var n,o,a,s=i.changedTouches,l=s.length,u=e._positions;for(n=0;n<l;++n){o=s[n],a=o.identifier;var c=u.get(a);r(c)&&h(e,o,c)}P(e,i);var d=e._previousPositions;for(n=0;n<l;++n)o=s[n],a=o.identifier,t.clone(u.get(a),d.get(a))}function P(e,i){var n,o=p(i),a=e._positions,s=e._previousPositions,l=a.length;if(1===l&&e._buttonDown===N.LEFT){var u=a.values[0];t.clone(u,e._primaryPosition);var h=e._primaryPreviousPosition;n=e.getInputAction(c.MOUSE_MOVE,o),r(n)&&(t.clone(h,H.startPosition),t.clone(u,H.endPosition),n(H)),t.clone(u,h),i.preventDefault()}else if(2===l&&e._isPinching&&(n=e.getInputAction(c.PINCH_MOVE,o),r(n))){var d=a.values[0],m=a.values[1],f=s.values[0],_=s.values[1],g=m.x-d.x,v=m.y-d.y,y=.25*Math.sqrt(g*g+v*v),C=_.x-f.x,w=_.y-f.y,S=.25*Math.sqrt(C*C+w*w),E=.125*(m.y+d.y),b=.125*(_.y+f.y),T=Math.atan2(v,g),x=Math.atan2(w,C);t.fromElements(0,S,q.distance.startPosition),t.fromElements(0,y,q.distance.endPosition),t.fromElements(x,b,q.angleAndHeight.startPosition),t.fromElements(T,E,q.angleAndHeight.endPosition),n(q)}}function D(e,i){if(i.target.setPointerCapture(i.pointerId),"touch"===i.pointerType){var r=e._positions,n=i.pointerId;r.set(n,h(e,i,new t)),x(e,i);var o=e._previousPositions;o.set(n,t.clone(r.get(n)))}else y(e,i)}function M(e,t){if("touch"===t.pointerType){var i=e._positions,r=t.pointerId;i.remove(r),x(e,t);var n=e._previousPositions;n.remove(r)}else C(e,t)}function I(e,i){if("touch"===i.pointerType){var n=e._positions,o=i.pointerId,a=n.get(o);if(!r(a))return;h(e,i,a),P(e,i);var s=e._previousPositions;t.clone(n.get(o),s.get(o))}else w(e,i)}function R(r){this._inputEvents={},this._buttonDown=void 0,this._isPinching=!1,this._lastSeenTouchEvent=-R.mouseEmulationIgnoreMilliseconds,this._primaryStartPosition=new t,this._primaryPosition=new t,this._primaryPreviousPosition=new t,this._positions=new e,this._previousPositions=new e,this._removalFunctions=[],this._clickPixelTolerance=5,this._element=i(r,document),f(this)}function O(e){e===c.MIDDLE_DOUBLE_CLICK?n("MIDDLE_DOUBLE_CLICK","ScreenSpaceEventType.MIDDLE_DOUBLE_CLICK was deprecated in Cesium 1.30. It will be removed in 1.31."):e===c.RIGHT_DOUBLE_CLICK&&n("RIGHT_DOUBLE_CLICK","ScreenSpaceEventType.RIGHT_DOUBLE_CLICK was deprecated in Cesium 1.30. It will be removed in 1.31.")}var N={LEFT:0,MIDDLE:1,RIGHT:2},L={position:new t},B={position:new t},F={position:new t},V={startPosition:new t,endPosition:new t},k={position:new t},z={position:new t},U={position1:new t,position2:new t},G={position:new t},W={position:new t},H={startPosition:new t,endPosition:new t},q={distance:{startPosition:new t,endPosition:new t},angleAndHeight:{startPosition:new t,endPosition:new t}};return R.prototype.setInputAction=function(e,t,i){O(t);var r=d(t,i);this._inputEvents[r]=e},R.prototype.getInputAction=function(e,t){O(e);var i=d(e,t);return this._inputEvents[i]},R.prototype.removeInputAction=function(e,t){O(e);var i=d(e,t);delete this._inputEvents[i]},R.prototype.isDestroyed=function(){return!1},R.prototype.destroy=function(){return _(this),o(this)},R.mouseEmulationIgnoreMilliseconds=800,R}),i("Core/ShowGeometryInstanceAttribute",["./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError"],function(e,t,i,r,n){"use strict";function o(e){e=t(e,!0),this.value=o.toValue(e)}return r(o.prototype,{componentDatatype:{get:function(){return e.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 1}},normalize:{get:function(){return!1}}}),o.toValue=function(e,t){return i(t)?(t[0]=e,t):new Uint8Array([e])},o}),i("Core/Simon1994PlanetaryPositions",["./Cartesian3","./defined","./DeveloperError","./JulianDate","./Math","./Matrix3","./TimeConstants","./TimeStandard"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){var t=6.239996+.0172019696544*e;return.001657*Math.sin(t+.01671*Math.sin(t))}function u(e,t){t=r.addSeconds(e,C,t);var i=r.totalDays(t)-w;return t=r.addSeconds(t,l(i),t)}function c(i,r,a,s,l,u,c){a<0&&(a=-a,l+=n.PI);var p=i*(1-r),m=s-l,_=l,g=d(u-s,r);h(r,0);f(m,a,_,A);var v=p*(1+r),y=Math.cos(g),C=Math.sin(g),w=1+r*y,S=v/w;return t(c)?(c.x=S*y,c.y=S*C,c.z=0):c=new e(S*y,S*C,0),o.multiplyByVector(A,c,c)}function h(e,t){return e<=t?"Circular":e<1-t?"Elliptical":e<=1+t?"Parabolic":"Hyperbolic"}function d(e,t){var i=p(e,t);return m(i,t)}function p(e,t){var i=Math.floor(e/n.TWO_PI);e-=i*n.TWO_PI;var r,o=e+t*Math.sin(e)/(1-Math.sin(e+t)+Math.sin(e)),a=Number.MAX_VALUE;for(r=0;r<P&&Math.abs(a-o)>D;++r){a=o;var s=a-t*Math.sin(a)-e,l=1-t*Math.cos(a);o=a-s/l}return a=o+i*n.TWO_PI}function m(e,t){var i=Math.floor(e/n.TWO_PI);e-=i*n.TWO_PI; +var r=Math.cos(e)-t,o=Math.sin(e)*Math.sqrt(1-t*t),a=Math.atan2(o,r);return a=n.zeroToTwoPi(a),e<0&&(a-=n.TWO_PI),a+=i*n.TWO_PI}function f(e,i,r,n){var a=Math.cos(e),s=Math.sin(e),l=Math.cos(i),u=Math.sin(i),c=Math.cos(r),h=Math.sin(r);return t(n)?(n[0]=c*a-h*s*l,n[1]=h*a+c*s*l,n[2]=s*u,n[3]=-c*s-h*a*l,n[4]=-h*s+c*a*l,n[5]=a*u,n[6]=h*u,n[7]=-c*u,n[8]=l):n=new o(c*a-h*s*l,-c*s-h*a*l,h*u,h*a+c*s*l,-h*s+c*a*l,-c*u,s*u,a*u,l),n}function _(e,t){u(e,Ae);var i=Ae.dayNumber-S.dayNumber+(Ae.secondsOfDay-S.secondsOfDay)/a.SECONDS_PER_DAY,r=i/(10*a.DAYS_PER_JULIAN_CENTURY),n=.3595362*r,o=M+U*Math.cos(O*n)+Z*Math.sin(O*n)+G*Math.cos(N*n)+K*Math.sin(N*n)+W*Math.cos(L*n)+Q*Math.sin(L*n)+H*Math.cos(B*n)+J*Math.sin(B*n)+q*Math.cos(F*n)+$*Math.sin(F*n)+j*Math.cos(V*n)+ee*Math.sin(V*n)+Y*Math.cos(k*n)+te*Math.sin(k*n)+X*Math.cos(z*n)+ie*Math.sin(z*n),s=I+R*r+he*Math.cos(re*n)+ye*Math.sin(re*n)+de*Math.cos(ne*n)+Ce*Math.sin(ne*n)+pe*Math.cos(oe*n)+we*Math.sin(oe*n)+me*Math.cos(ae*n)+Se*Math.sin(ae*n)+fe*Math.cos(se*n)+Ee*Math.sin(se*n)+_e*Math.cos(le*n)+be*Math.sin(le*n)+ge*Math.cos(ue*n)+Te*Math.sin(ue*n)+ve*Math.cos(ce*n)+xe*Math.sin(ce*n),l=.0167086342-.0004203654*r,h=102.93734808*b+11612.3529*T*r,d=469.97289*T*r,p=174.87317577*b-8679.27034*T*r;return c(o,l,d,h,p,s,t)}function g(e,t){u(e,Ae);var i=Ae.dayNumber-S.dayNumber+(Ae.secondsOfDay-S.secondsOfDay)/a.SECONDS_PER_DAY,r=i/a.DAYS_PER_JULIAN_CENTURY,n=r*r,o=n*r,s=o*r,l=383397.7725+.004*r,h=.055545526-1.6e-8*r,d=5.15668983*b,p=-8e-5*r+.02966*n-42e-6*o-1.3e-7*s,m=83.35324312*b,f=14643420.2669*r-38.2702*n-.045047*o+21301e-8*s,_=125.04455501*b,g=-6967919.3631*r+6.3602*n+.007625*o-3586e-8*s,v=218.31664563*b,y=1732559343.4847*r-6.391*n+.006588*o-3169e-8*s,C=297.85019547*b+T*(1602961601.209*r-6.3706*n+.006593*o-3169e-8*s),w=93.27209062*b+T*(1739527262.8478*r-12.7512*n-.001037*o+417e-8*s),x=134.96340251*b+T*(1717915923.2178*r+31.8792*n+.051635*o-2447e-7*s),A=357.52910918*b+T*(129596581.0481*r-.5532*n+136e-6*o-1149e-8*s),P=310.17137918*b-T*(6967051.436*r+6.2068*n+.007618*o-3219e-8*s),D=2*C,M=4*C,I=6*C,R=2*x,O=3*x,N=4*x,L=2*w;l+=3400.4*Math.cos(D)-635.6*Math.cos(D-x)-235.6*Math.cos(x)+218.1*Math.cos(D-A)+181*Math.cos(D+x),h+=.014216*Math.cos(D-x)+.008551*Math.cos(D-R)-.001383*Math.cos(x)+.001356*Math.cos(D+x)-.001147*Math.cos(M-O)-914e-6*Math.cos(M-R)+869e-6*Math.cos(D-A-x)-627e-6*Math.cos(D)-394e-6*Math.cos(M-N)+282e-6*Math.cos(D-A-R)-279e-6*Math.cos(C-x)-236e-6*Math.cos(R)+231e-6*Math.cos(M)+229e-6*Math.cos(I-N)-201e-6*Math.cos(R-L),p+=486.26*Math.cos(D-L)-40.13*Math.cos(D)+37.51*Math.cos(L)+25.73*Math.cos(R-L)+19.97*Math.cos(D-A-L),f+=-55609*Math.sin(D-x)-34711*Math.sin(D-R)-9792*Math.sin(x)+9385*Math.sin(M-O)+7505*Math.sin(M-R)+5318*Math.sin(D+x)+3484*Math.sin(M-N)-3417*Math.sin(D-A-x)-2530*Math.sin(I-N)-2376*Math.sin(D)-2075*Math.sin(D-O)-1883*Math.sin(R)-1736*Math.sin(I-5*x)+1626*Math.sin(A)-1370*Math.sin(I-O),g+=-5392*Math.sin(D-L)-540*Math.sin(A)-441*Math.sin(D)+423*Math.sin(L)-288*Math.sin(R-L),y+=-3332.9*Math.sin(D)+1197.4*Math.sin(D-x)-662.5*Math.sin(A)+396.3*Math.sin(x)-218*Math.sin(D-A);var B=2*P,F=3*P;p+=46.997*Math.cos(P)*r-.614*Math.cos(D-L+P)*r+.614*Math.cos(D-L-P)*r-.0297*Math.cos(B)*n-.0335*Math.cos(P)*n+.0012*Math.cos(D-L+B)*n-16e-5*Math.cos(P)*o+4e-5*Math.cos(F)*o+4e-5*Math.cos(B)*o;var V=2.116*Math.sin(P)*r-.111*Math.sin(D-L-P)*r-.0015*Math.sin(P)*n;f+=V,y+=V,g+=-520.77*Math.sin(P)*r+13.66*Math.sin(D-L+P)*r+1.12*Math.sin(D-P)*r-1.06*Math.sin(L-P)*r+.66*Math.sin(B)*n+.371*Math.sin(P)*n-.035*Math.sin(D-L+B)*n-.015*Math.sin(D-L+P)*n+.0014*Math.sin(P)*o-.0011*Math.sin(F)*o-9e-4*Math.sin(B)*o,l*=E;var k=d+p*T,z=m+f*T,U=v+y*T,G=_+g*T;return c(l,h,k,z,G,U,t)}function v(t,i){return i=g(t,i),e.multiplyByScalar(i,De,i)}var y={},C=32.184,w=2451545,S=new r(2451545,0,s.TAI),E=1e3,b=n.RADIANS_PER_DEGREE,T=n.RADIANS_PER_ARCSECOND,x=14959787e4,A=new o,P=50,D=n.EPSILON8,M=1.0000010178*x,I=100.46645683*b,R=1295977422.83429*T,O=16002,N=21863,L=32004,B=10931,F=14529,V=16368,k=15318,z=32794,U=64e-7*x,G=-152e-7*x,W=62e-7*x,H=-8e-7*x,q=32e-7*x,j=-41e-7*x,Y=19e-7*x,X=-11e-7*x,Z=1e-7*-150*x,K=-46e-7*x,Q=68*1e-7*x,J=54e-7*x,$=14e-7*x,ee=24e-7*x,te=-28e-7*x,ie=22e-7*x,re=10,ne=16002,oe=21863,ae=10931,se=1473,le=32004,ue=4387,ce=73,he=-325e-7,de=-322e-7,pe=1e-7*-79,me=232*1e-7,fe=1e-7*-52,_e=97e-7,ge=55e-7,ve=-41e-7,ye=-105e-7,Ce=-137e-7,we=258e-7,Se=35e-7,Ee=1e-7*-116,be=-88e-7,Te=-112e-7,xe=-8e-6,Ae=new r(0,0,s.TAI),Pe=.012300034,De=Pe/(Pe+1)*-1,Me=new o(1.0000000000000002,5.619723173785822e-16,4.690511510146299e-19,-5.154129427414611e-16,.9174820620691819,-.39777715593191376,-2.23970096136568e-16,.39777715593191376,.9174820620691819),Ie=new e;return y.computeSunPositionInEarthInertialFrame=function(i,n){return t(i)||(i=r.now()),t(n)||(n=new e),Ie=_(i,Ie),n=e.negate(Ie,n),v(i,Ie),e.subtract(n,Ie,n),o.multiplyByVector(Me,n,n),n},y.computeMoonPositionInEarthInertialFrame=function(e,i){return t(e)||(e=r.now()),i=g(e,i),o.multiplyByVector(Me,i,i),i},y}),i("Core/SimplePolylineGeometry",["./BoundingSphere","./Cartesian3","./Color","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolylinePipeline","./PrimitiveType"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m){"use strict";function f(e,t,r,n,o,a,s){var l,u=p.numberOfPoints(e,t,o),c=r.red,h=r.green,d=r.blue,m=r.alpha,f=n.red,_=n.green,g=n.blue,v=n.alpha;if(i.equals(r,n)){for(l=0;l<u;l++)a[s++]=i.floatToByte(c),a[s++]=i.floatToByte(h),a[s++]=i.floatToByte(d),a[s++]=i.floatToByte(m);return s}var y=(f-c)/u,C=(_-h)/u,w=(g-d)/u,S=(v-m)/u,E=s;for(l=0;l<u;l++)a[E++]=i.floatToByte(c+l*y),a[E++]=i.floatToByte(h+l*C),a[E++]=i.floatToByte(d+l*w),a[E++]=i.floatToByte(m+l*S);return E}function _(e){e=n(e,n.EMPTY_OBJECT);var r=e.positions,a=e.colors,l=n(e.colorsPerVertex,!1);this._positions=r,this._colors=a,this._colorsPerVertex=l,this._followSurface=n(e.followSurface,!0),this._granularity=n(e.granularity,d.RADIANS_PER_DEGREE),this._ellipsoid=n(e.ellipsoid,s.WGS84),this._workerName="createSimplePolylineGeometry";var u=1+r.length*t.packedLength;u+=o(a)?1+a.length*i.packedLength:1,this.packedLength=u+s.packedLength+3}_.pack=function(e,r,a){a=n(a,0);var l,u=e._positions,c=u.length;for(r[a++]=c,l=0;l<c;++l,a+=t.packedLength)t.pack(u[l],r,a);var h=e._colors;for(c=o(h)?h.length:0,r[a++]=c,l=0;l<c;++l,a+=i.packedLength)i.pack(h[l],r,a);return s.pack(e._ellipsoid,r,a),a+=s.packedLength,r[a++]=e._colorsPerVertex?1:0,r[a++]=e._followSurface?1:0,r[a]=e._granularity,r},_.unpack=function(e,r,a){r=n(r,0);var l,u=e[r++],c=new Array(u);for(l=0;l<u;++l,r+=t.packedLength)c[l]=t.unpack(e,r);u=e[r++];var h=u>0?new Array(u):void 0;for(l=0;l<u;++l,r+=i.packedLength)h[l]=i.unpack(e,r);var d=s.unpack(e,r);r+=s.packedLength;var p=1===e[r++],m=1===e[r++],f=e[r];return o(a)?(a._positions=c,a._colors=h,a._ellipsoid=d,a._colorsPerVertex=p,a._followSurface=m,a._granularity=f,a):new _({positions:c,colors:h,ellipsoid:d,colorsPerVertex:p,followSurface:m,granularity:f})};var g=new Array(2),v=new Array(2),y={positions:g,height:v,ellipsoid:void 0,minDistance:void 0};return _.createGeometry=function(n){var a,s,_,C,w,S=n._positions,E=n._colors,b=n._colorsPerVertex,T=n._followSurface,x=n._granularity,A=n._ellipsoid,P=d.chordLength(x,A.maximumRadius),D=o(E)&&!b,M=S.length,I=0;if(T){var R=p.extractHeights(S,A),O=y;if(O.minDistance=P,O.ellipsoid=A,D){var N=0;for(a=0;a<M-1;a++)N+=p.numberOfPoints(S[a],S[a+1],P)+1;s=new Float64Array(3*N),C=new Uint8Array(4*N),O.positions=g,O.height=v;var L=0;for(a=0;a<M-1;++a){g[0]=S[a],g[1]=S[a+1],v[0]=R[a],v[1]=R[a+1];var B=p.generateArc(O);if(o(E)){var F=B.length/3;w=E[a];for(var V=0;V<F;++V)C[L++]=i.floatToByte(w.red),C[L++]=i.floatToByte(w.green),C[L++]=i.floatToByte(w.blue),C[L++]=i.floatToByte(w.alpha)}s.set(B,I),I+=B.length}}else if(O.positions=S,O.height=R,s=new Float64Array(p.generateArc(O)),o(E)){for(C=new Uint8Array(s.length/3*4),a=0;a<M-1;++a){var k=S[a],z=S[a+1],U=E[a],G=E[a+1];I=f(k,z,U,G,P,C,I)}var W=E[M-1];C[I++]=i.floatToByte(W.red),C[I++]=i.floatToByte(W.green),C[I++]=i.floatToByte(W.blue),C[I++]=i.floatToByte(W.alpha)}}else{_=D?2*M-2:M,s=new Float64Array(3*_),C=o(E)?new Uint8Array(4*_):void 0;var H=0,q=0;for(a=0;a<M;++a){var j=S[a];if(D&&a>0&&(t.pack(j,s,H),H+=3,w=E[a-1],C[q++]=i.floatToByte(w.red),C[q++]=i.floatToByte(w.green),C[q++]=i.floatToByte(w.blue),C[q++]=i.floatToByte(w.alpha)),D&&a===M-1)break;t.pack(j,s,H),H+=3,o(E)&&(w=E[a],C[q++]=i.floatToByte(w.red),C[q++]=i.floatToByte(w.green),C[q++]=i.floatToByte(w.blue),C[q++]=i.floatToByte(w.alpha))}}var Y=new c;Y.position=new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:s}),o(E)&&(Y.color=new u({componentDatatype:r.UNSIGNED_BYTE,componentsPerAttribute:4,values:C,normalize:!0})),_=s.length/3;var X=2*(_-1),Z=h.createTypedArray(_,X),K=0;for(a=0;a<_-1;++a)Z[K++]=a,Z[K++]=a+1;return new l({attributes:Y,indices:Z,primitiveType:m.LINES,boundingSphere:e.fromPoints(S)})},_}),i("Core/SphereGeometry",["./Cartesian3","./Check","./defaultValue","./defined","./DeveloperError","./EllipsoidGeometry","./VertexFormat"],function(e,t,i,r,n,o,a){"use strict";function s(t){var r=i(t.radius,1),n=new e(r,r,r),a={radii:n,stackPartitions:t.stackPartitions,slicePartitions:t.slicePartitions,vertexFormat:t.vertexFormat};this._ellipsoidGeometry=new o(a),this._workerName="createSphereGeometry"}s.packedLength=o.packedLength,s.pack=function(e,t,i){return o.pack(e._ellipsoidGeometry,t,i)};var l=new o,u={radius:void 0,radii:new e,vertexFormat:new a,stackPartitions:void 0,slicePartitions:void 0};return s.unpack=function(t,i,n){var c=o.unpack(t,i,l);return u.vertexFormat=a.clone(c._vertexFormat,u.vertexFormat),u.stackPartitions=c._stackPartitions,u.slicePartitions=c._slicePartitions,r(n)?(e.clone(c._radii,u.radii),n._ellipsoidGeometry=new o(u),n):(u.radius=c._radii.x,new s(u))},s.createGeometry=function(e){return o.createGeometry(e._ellipsoidGeometry)},s}),i("Core/SphereOutlineGeometry",["./Cartesian3","./Check","./defaultValue","./defined","./DeveloperError","./EllipsoidOutlineGeometry"],function(e,t,i,r,n,o){"use strict";function a(t){var r=i(t.radius,1),n=new e(r,r,r),a={radii:n,stackPartitions:t.stackPartitions,slicePartitions:t.slicePartitions,subdivisions:t.subdivisions};this._ellipsoidGeometry=new o(a),this._workerName="createSphereOutlineGeometry"}a.packedLength=o.packedLength,a.pack=function(e,t,i){return o.pack(e._ellipsoidGeometry,t,i)};var s=new o,l={radius:void 0,radii:new e,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};return a.unpack=function(t,i,n){var u=o.unpack(t,i,s);return l.stackPartitions=u._stackPartitions,l.slicePartitions=u._slicePartitions,l.subdivisions=u._subdivisions,r(n)?(e.clone(u._radii,l.radii),n._ellipsoidGeometry=new o(l),n):(l.radius=u._radii.x,new a(l))},a.createGeometry=function(e){return o.createGeometry(e._ellipsoidGeometry)},a}),i("Core/Spherical",["./Check","./defaultValue","./defined","./DeveloperError"],function(e,t,i,r){"use strict";function n(e,i,r){this.clock=t(e,0),this.cone=t(i,0),this.magnitude=t(r,1)}return n.fromCartesian3=function(e,t){var r=e.x,o=e.y,a=e.z,s=r*r+o*o;return i(t)||(t=new n),t.clock=Math.atan2(o,r),t.cone=Math.atan2(Math.sqrt(s),a),t.magnitude=Math.sqrt(s+a*a),t},n.clone=function(e,t){if(i(e))return i(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=e.magnitude,t):new n(e.clock,e.cone,e.magnitude)},n.normalize=function(e,t){return i(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=1,t):new n(e.clock,e.cone,1)},n.equals=function(e,t){return e===t||i(e)&&i(t)&&e.clock===t.clock&&e.cone===t.cone&&e.magnitude===t.magnitude},n.equalsEpsilon=function(e,r,n){return n=t(n,0),e===r||i(e)&&i(r)&&Math.abs(e.clock-r.clock)<=n&&Math.abs(e.cone-r.cone)<=n&&Math.abs(e.magnitude-r.magnitude)<=n},n.prototype.equals=function(e){return n.equals(this,e)},n.prototype.clone=function(e){return n.clone(this,e)},n.prototype.equalsEpsilon=function(e,t){return n.equalsEpsilon(this,e,t)},n.prototype.toString=function(){return"("+this.clock+", "+this.cone+", "+this.magnitude+")"},n}),i("Core/subdivideArray",["./defined","./DeveloperError"],function(e,t){"use strict";function i(e,t){for(var i=[],r=e.length,n=0;n<r;){var o=Math.ceil((r-n)/t--);i.push(e.slice(n,n+o)),n+=o}return i}return i}),i("Core/TerrainData",["./defineProperties","./DeveloperError"],function(e,t){"use strict";function i(){t.throwInstantiationError()}return e(i.prototype,{waterMask:{get:t.throwInstantiationError}}),i.prototype.interpolateHeight=t.throwInstantiationError,i.prototype.isChildAvailable=t.throwInstantiationError,i.prototype.createMesh=t.throwInstantiationError,i.prototype.upsample=t.throwInstantiationError,i.prototype.wasCreatedByUpsampling=t.throwInstantiationError,i}),i("Core/TilingScheme",["./defineProperties","./DeveloperError"],function(e,t){"use strict";function i(e){}return e(i.prototype,{ellipsoid:{get:t.throwInstantiationError},rectangle:{get:t.throwInstantiationError},projection:{get:t.throwInstantiationError}}),i.prototype.getNumberOfXTilesAtLevel=t.throwInstantiationError,i.prototype.getNumberOfYTilesAtLevel=t.throwInstantiationError,i.prototype.rectangleToNativeRectangle=t.throwInstantiationError,i.prototype.tileXYToNativeRectangle=t.throwInstantiationError,i.prototype.tileXYToRectangle=t.throwInstantiationError,i.prototype.positionToTileXY=t.throwInstantiationError,i}),i("Core/TimeIntervalCollection",["./binarySearch","./defaultValue","./defined","./defineProperties","./DeveloperError","./Event","./JulianDate","./TimeInterval"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,t){return a.compare(e.start,t.start)}function u(e){if(this._intervals=[],this._changedEvent=new o,i(e))for(var t=e.length,r=0;r<t;r++)this.addInterval(e[r])}r(u.prototype,{changedEvent:{get:function(){return this._changedEvent}},start:{get:function(){var e=this._intervals;return 0===e.length?void 0:e[0].start}},isStartIncluded:{get:function(){var e=this._intervals;return 0!==e.length&&e[0].isStartIncluded}},stop:{get:function(){var e=this._intervals,t=e.length;return 0===t?void 0:e[t-1].stop}},isStopIncluded:{get:function(){var e=this._intervals,t=e.length;return 0!==t&&e[t-1].isStopIncluded}},length:{get:function(){return this._intervals.length}},isEmpty:{get:function(){return 0===this._intervals.length}}}),u.prototype.equals=function(e,t){if(this===e)return!0;if(!(e instanceof u))return!1;var i=this._intervals,r=e._intervals,n=i.length;if(n!==r.length)return!1;for(var o=0;o<n;o++)if(!s.equals(i[o],r[o],t))return!1;return!0},u.prototype.get=function(e){return this._intervals[e]},u.prototype.removeAll=function(){this._intervals.length>0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))},u.prototype.findIntervalContainingDate=function(e){var t=this.indexOf(e);return t>=0?this._intervals[t]:void 0},u.prototype.findDataForIntervalContainingDate=function(e){var t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0},u.prototype.contains=function(e){return this.indexOf(e)>=0};var c=new s;return u.prototype.indexOf=function(t){var i=this._intervals;c.start=t,c.stop=t;var r=e(i,c,l);return r>=0?i[r].isStartIncluded?r:r>0&&i[r-1].stop.equals(t)&&i[r-1].isStopIncluded?r-1:~r:(r=~r,r>0&&r-1<i.length&&s.contains(i[r-1],t)?r-1:~r)},u.prototype.findInterval=function(e){e=t(e,t.EMPTY_OBJECT);for(var r=e.start,n=e.stop,o=e.isStartIncluded,a=e.isStopIncluded,s=this._intervals,l=0,u=s.length;l<u;l++){var c=s[l];if((!i(r)||c.start.equals(r))&&(!i(n)||c.stop.equals(n))&&(!i(o)||c.isStartIncluded===o)&&(!i(a)||c.isStopIncluded===a))return s[l]}},u.prototype.addInterval=function(t,r){if(!t.isEmpty){var n,o,u=this._intervals;if(0===u.length||a.greaterThan(t.start,u[u.length-1].stop))return u.push(t),void this._changedEvent.raiseEvent(this);for(o=e(u,t,l),o<0?o=~o:o>0&&t.isStartIncluded&&u[o-1].isStartIncluded&&u[o-1].start.equals(t.start)?--o:o<u.length&&!t.isStartIncluded&&u[o].isStartIncluded&&u[o].start.equals(t.start)&&++o,o>0&&(n=a.compare(u[o-1].stop,t.start),(n>0||0===n&&(u[o-1].isStopIncluded||t.isStartIncluded))&&((i(r)?r(u[o-1].data,t.data):u[o-1].data===t.data)?(t=new s(a.greaterThan(t.stop,u[o-1].stop)?{start:u[o-1].start,stop:t.stop,isStartIncluded:u[o-1].isStartIncluded,isStopIncluded:t.isStopIncluded,data:t.data}:{start:u[o-1].start,stop:u[o-1].stop,isStartIncluded:u[o-1].isStartIncluded,isStopIncluded:u[o-1].isStopIncluded||t.stop.equals(u[o-1].stop)&&t.isStopIncluded,data:t.data}),u.splice(o-1,1),--o):(n=a.compare(u[o-1].stop,t.stop),n>0||0===n&&u[o-1].isStopIncluded&&!t.isStopIncluded?u.splice(o-1,1,new s({start:u[o-1].start,stop:t.start,isStartIncluded:u[o-1].isStartIncluded,isStopIncluded:!t.isStartIncluded,data:u[o-1].data}),new s({start:t.stop,stop:u[o-1].stop,isStartIncluded:!t.isStopIncluded,isStopIncluded:u[o-1].isStopIncluded,data:u[o-1].data})):u[o-1]=new s({start:u[o-1].start,stop:t.start,isStartIncluded:u[o-1].isStartIncluded,isStopIncluded:!t.isStartIncluded,data:u[o-1].data}))));o<u.length&&(n=a.compare(t.stop,u[o].start),n>0||0===n&&(t.isStopIncluded||u[o].isStartIncluded));)if(i(r)?r(u[o].data,t.data):u[o].data===t.data)t=new s({start:t.start,stop:a.greaterThan(u[o].stop,t.stop)?u[o].stop:t.stop,isStartIncluded:t.isStartIncluded,isStopIncluded:a.greaterThan(u[o].stop,t.stop)?u[o].isStopIncluded:t.isStopIncluded,data:t.data}),u.splice(o,1);else{if(u[o]=new s({start:t.stop,stop:u[o].stop,isStartIncluded:!t.isStopIncluded,isStopIncluded:u[o].isStopIncluded,data:u[o].data}),!u[o].isEmpty)break;u.splice(o,1)}u.splice(o,0,t),this._changedEvent.raiseEvent(this)}},u.prototype.removeInterval=function(t){if(t.isEmpty)return!1;var i=!1,r=this._intervals,n=e(r,t,l);n<0&&(n=~n);var o=t.start,u=t.stop,c=t.isStartIncluded,h=t.isStopIncluded;if(n>0){var d=r[n-1],p=d.stop;(a.greaterThan(p,o)||s.equals(p,o)&&d.isStopIncluded&&c)&&(i=!0,(a.greaterThan(p,u)||d.isStopIncluded&&!h&&s.equals(p,u))&&r.splice(n,0,new s({start:u,stop:p,isStartIncluded:!h,isStopIncluded:d.isStopIncluded,data:d.data})),r[n-1]=new s({start:d.start,stop:o,isStartIncluded:d.isStartIncluded,isStopIncluded:!c,data:d.data}))}var m=r[n];for(n<r.length&&!c&&m.isStartIncluded&&o.equals(m.start)&&(i=!0,r.splice(n,0,new s({start:m.start,stop:m.start,isStartIncluded:!0,isStopIncluded:!0,data:m.data})),++n,m=r[n]);n<r.length&&a.greaterThan(u,m.stop);)i=!0,r.splice(n,1),m=r[n];return n<r.length&&u.equals(m.stop)&&(i=!0,!h&&m.isStopIncluded?(n+1<r.length&&r[n+1].start.equals(u)&&m.data===r[n+1].data?(r.splice(n,1),m=new s({start:m.start,stop:m.stop,isStartIncluded:!0,isStopIncluded:m.isStopIncluded,data:m.data})):m=new s({start:u,stop:u,isStartIncluded:!0,isStopIncluded:!0,data:m.data}),r[n]=m):r.splice(n,1)),n<r.length&&(a.greaterThan(u,m.start)||u.equals(m.start)&&h&&m.isStartIncluded)&&(i=!0,r[n]=new s({start:u,stop:m.stop,isStartIncluded:!h,isStopIncluded:m.isStopIncluded,data:m.data})),i&&this._changedEvent.raiseEvent(this),i},u.prototype.intersect=function(e,t,r){for(var n=0,o=0,l=new u,c=this._intervals,h=e._intervals;n<c.length&&o<h.length;){var d=c[n],p=h[o];if(a.lessThan(d.stop,p.start))++n;else if(a.lessThan(p.stop,d.start))++o;else{if(i(r)||i(t)&&t(d.data,p.data)||!i(t)&&p.data===d.data){var m=s.intersect(d,p,new s,r);m.isEmpty||l.addInterval(m,t)}a.lessThan(d.stop,p.stop)||d.stop.equals(p.stop)&&!d.isStopIncluded&&p.isStopIncluded?++n:++o}}return l},u}),i("Core/TranslationRotationScale",["./Cartesian3","./defaultValue","./defined","./Quaternion"],function(e,t,i,r){"use strict";var n=new e(1,1,1),o=e.ZERO,a=r.IDENTITY,s=function(i,s,l){this.translation=e.clone(t(i,o)),this.rotation=r.clone(t(s,a)),this.scale=e.clone(t(l,n))};return s.prototype.equals=function(t){return this===t||i(t)&&e.equals(this.translation,t.translation)&&r.equals(this.rotation,t.rotation)&&e.equals(this.scale,t.scale)},s}),i("Core/VideoSynchronizer",["./defaultValue","./defined","./defineProperties","./destroyObject","./Iso8601","./JulianDate"],function(e,t,i,r,n,o){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this._clock=void 0,this._element=void 0,this._clockSubscription=void 0,this._seekFunction=void 0,this.clock=t.clock,this.element=t.element,this.epoch=e(t.epoch,n.MINIMUM_VALUE),this.tolerance=e(t.tolerance,1),this._seeking=!1,this._seekFunction=void 0,this._firstTickAfterSeek=!1}function s(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}return i(a.prototype,{clock:{get:function(){return this._clock},set:function(e){var i=this._clock;i!==e&&(t(i)&&(this._clockSubscription(),this._clockSubscription=void 0),t(e)&&(this._clockSubscription=e.onTick.addEventListener(a.prototype._onTick,this)),this._clock=e)}},element:{get:function(){return this._element},set:function(e){var i=this._element;i!==e&&(t(i)&&i.removeEventListener("seeked",this._seekFunction,!1),t(e)&&(this._seeking=!1,this._seekFunction=s(this),e.addEventListener("seeked",this._seekFunction,!1)),this._element=e,this._seeking=!1,this._firstTickAfterSeek=!1)}}}),a.prototype.destroy=function(){return this.element=void 0,this.clock=void 0,r(this)},a.prototype.isDestroyed=function(){return!1},a.prototype._onTick=function(i){var r=this._element;if(t(r)&&!(r.readyState<2)){var a=r.paused,s=i.shouldAnimate;if(s===a&&(s?r.play():r.pause()),this._seeking||this._firstTickAfterSeek)return void(this._firstTickAfterSeek=!1);r.playbackRate=i.multiplier;var l,u=i.currentTime,c=e(this.epoch,n.MINIMUM_VALUE),h=o.secondsDifference(u,c),d=r.duration,p=r.currentTime;r.loop?(h%=d,h<0&&(h=d-h),l=h):l=h>d?d:h<0?0:h;var m=s?e(this.tolerance,1):.001;Math.abs(l-p)>m&&(this._seeking=!0,r.currentTime=l)}},a}),i("Core/VRTheWorldTerrainProvider",["../ThirdParty/when","./Credit","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Event","./GeographicTilingScheme","./getImagePixels","./HeightmapTerrainData","./loadImage","./loadXML","./Math","./Rectangle","./TerrainProvider","./throttleRequestByServer","./TileProviderError"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g){"use strict";function v(e,t){this.rectangle=e,this.maxLevel=t}function y(r){function n(e){var t=e.getElementsByTagName("SRS")[0].textContent;if("EPSG:4326"!==t)return void o("SRS "+t+" is not supported.");_._tilingScheme=new l({ellipsoid:y});var i=e.getElementsByTagName("TileFormat")[0];_._heightmapWidth=parseInt(i.getAttribute("width"),10),_._heightmapHeight=parseInt(i.getAttribute("height"),10),_._levelZeroMaximumGeometricError=f.getEstimatedLevelZeroGeometricErrorForAHeightmap(y,Math.min(_._heightmapWidth,_._heightmapHeight),_._tilingScheme.getNumberOfXTilesAtLevel(0));for(var r=e.getElementsByTagName("DataExtent"),n=0;n<r.length;++n){var a=r[n],s=p.toRadians(parseFloat(a.getAttribute("minx"))),u=p.toRadians(parseFloat(a.getAttribute("miny"))),c=p.toRadians(parseFloat(a.getAttribute("maxx"))),h=p.toRadians(parseFloat(a.getAttribute("maxy"))),d=parseInt(a.getAttribute("maxlevel"),10);_._rectangles.push(new v(new m(s,u,c,h),d))}_._ready=!0,_._readyPromise.resolve(!0)}function o(e){var t=i(e,"An error occurred while accessing "+_._url+".");h=g.handleError(h,_,_._errorEvent,t,void 0,void 0,void 0,u)}function u(){e(d(_._url),n,o)}r=i(r,i.EMPTY_OBJECT),this._url=r.url,this._url.length>0&&"/"!==this._url[this._url.length-1]&&(this._url+="/"),this._errorEvent=new s,this._ready=!1,this._readyPromise=e.defer(),this._proxy=r.proxy,this._terrainDataStructure={heightScale:.001,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0,lowestEncodedHeight:0,highestEncodedHeight:16777215};var c=r.credit;"string"==typeof c&&(c=new t(c)),this._credit=c,this._tilingScheme=void 0,this._rectangles=[];var h,_=this,y=i(r.ellipsoid,a.WGS84);u()}function C(e,t,i,n){for(var o=e._tilingScheme,a=e._rectangles,s=o.tileXYToRectangle(t,i,n),l=0,u=0;u<a.length&&15!==l;++u){var c=a[u];if(!(c.maxLevel<=n)){var h=c.rectangle,d=m.intersection(h,s,S);r(d)&&(w(o,h,2*t,2*i,n+1)&&(l|=4),w(o,h,2*t+1,2*i,n+1)&&(l|=8),w(o,h,2*t,2*i+1,n+1)&&(l|=1),w(o,h,2*t+1,2*i+1,n+1)&&(l|=2))}}return l}function w(e,t,i,n,o){var a=e.tileXYToRectangle(i,n,o);return r(m.intersection(a,t,S))}n(y.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}}}),y.prototype.requestTileGeometry=function(t,n,o,a){var s=this._tilingScheme.getNumberOfYTilesAtLevel(o),l=this._url+o+"/"+t+"/"+(s-n-1)+".tif?cesium=true",d=this._proxy;r(d)&&(l=d.getURL(l));var p;if(a=i(a,!0)){if(p=_(l,h),!r(p))return}else p=h(l);var m=this;return e(p,function(e){return new c({buffer:u(e),width:m._heightmapWidth,height:m._heightmapHeight,childTileMask:C(m,t,n,o),structure:m._terrainDataStructure})})},y.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};var S=new m;return y.prototype.getTileDataAvailable=function(e,t,i){},y}),i("Core/WallGeometryLibrary",["./Cartographic","./defined","./EllipsoidTangentPlane","./Math","./PolygonPipeline","./PolylinePipeline","./WindingOrder"],function(e,t,i,r,n,o,a){"use strict";function s(e,t){return r.equalsEpsilon(e.latitude,t.latitude,r.EPSILON14)&&r.equalsEpsilon(e.longitude,t.longitude,r.EPSILON14)}function l(i,r,n,o){var a=r.length;if(!(a<2)){var l=t(o),u=t(n),d=!0,p=new Array(a),m=new Array(a),f=new Array(a),_=r[0];p[0]=_;var g=i.cartesianToCartographic(_,c);u&&(g.height=n[0]),d=d&&g.height<=0,m[0]=g.height,l?f[0]=o[0]:f[0]=0;for(var v=1,y=1;y<a;++y){var C=r[y],w=i.cartesianToCartographic(C,h);u&&(w.height=n[y]),d=d&&w.height<=0,s(g,w)?g.height<w.height&&(m[v-1]=w.height):(p[v]=C,m[v]=w.height,l?f[v]=o[y]:f[v]=0,e.clone(w,g),++v)}if(!(d||v<2))return p.length=v,m.length=v,f.length=v,{positions:p,topHeights:m,bottomHeights:f}}}var u={},c=new e,h=new e,d=new Array(2),p=new Array(2),m={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};return u.computePositions=function(e,s,u,c,h,f){var _=l(e,s,u,c);if(t(_)){if(s=_.positions,u=_.topHeights,c=_.bottomHeights,s.length>=3){var g=i.fromPoints(s,e),v=g.projectPointsOntoPlane(s);n.computeWindingOrder2D(v)===a.CLOCKWISE&&(s.reverse(),u.reverse(),c.reverse())}var y,C,w=s.length,S=w-2,E=r.chordLength(h,e.maximumRadius),b=m;if(b.minDistance=E,b.ellipsoid=e,f){var T,x=0;for(T=0;T<w-1;T++)x+=o.numberOfPoints(s[T],s[T+1],E)+1;y=new Float64Array(3*x),C=new Float64Array(3*x);var A=d,P=p;b.positions=A,b.height=P;var D=0;for(T=0;T<w-1;T++){A[0]=s[T],A[1]=s[T+1],P[0]=u[T],P[1]=u[T+1];var M=o.generateArc(b);y.set(M,D),P[0]=c[T],P[1]=c[T+1],C.set(o.generateArc(b),D),D+=M.length}}else b.positions=s,b.height=u,y=new Float64Array(o.generateArc(b)),b.height=c,C=new Float64Array(o.generateArc(b));return{bottomPositions:C,topPositions:y,numCorners:S}}},u}),i("Core/WallGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./VertexFormat","./WallGeometryLibrary"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m){"use strict";function f(e){e=r(e,r.EMPTY_OBJECT);var i=e.positions,o=e.maximumHeights,s=e.minimumHeights,l=r(e.vertexFormat,p.DEFAULT),u=r(e.granularity,h.RADIANS_PER_DEGREE),c=r(e.ellipsoid,a.WGS84);this._positions=i,this._minimumHeights=s,this._maximumHeights=o,this._vertexFormat=p.clone(l),this._granularity=u,this._ellipsoid=a.clone(c),this._workerName="createWallGeometry";var d=1+i.length*t.packedLength+2;n(s)&&(d+=s.length),n(o)&&(d+=o.length),this.packedLength=d+a.packedLength+p.packedLength+1}var _=new t,g=new t,v=new t,y=new t,C=new t,w=new t,S=new t,E=new t;f.pack=function(e,i,o){o=r(o,0);var s,l=e._positions,u=l.length;for(i[o++]=u,s=0;s<u;++s,o+=t.packedLength)t.pack(l[s],i,o);var c=e._minimumHeights;if(u=n(c)?c.length:0,i[o++]=u,n(c))for(s=0;s<u;++s)i[o++]=c[s];var h=e._maximumHeights;if(u=n(h)?h.length:0,i[o++]=u,n(h))for(s=0;s<u;++s)i[o++]=h[s];return a.pack(e._ellipsoid,i,o),o+=a.packedLength,p.pack(e._vertexFormat,i,o),o+=p.packedLength,i[o]=e._granularity,i};var b=a.clone(a.UNIT_SPHERE),T=new p,x={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:b,vertexFormat:T,granularity:void 0};return f.unpack=function(e,i,o){i=r(i,0);var s,l=e[i++],u=new Array(l);for(s=0;s<l;++s,i+=t.packedLength)u[s]=t.unpack(e,i);l=e[i++];var c;if(l>0)for(c=new Array(l),s=0;s<l;++s)c[s]=e[i++];l=e[i++];var h;if(l>0)for(h=new Array(l),s=0;s<l;++s)h[s]=e[i++];var d=a.unpack(e,i,b);i+=a.packedLength;var m=p.unpack(e,i,T);i+=p.packedLength;var _=e[i];return n(o)?(o._positions=u,o._minimumHeights=c,o._maximumHeights=h,o._ellipsoid=a.clone(d,o._ellipsoid),o._vertexFormat=p.clone(m,o._vertexFormat),o._granularity=_,o):(x.positions=u,x.minimumHeights=c,x.maximumHeights=h,x.granularity=_,new f(x))},f.fromConstantHeights=function(e){e=r(e,r.EMPTY_OBJECT);var t,i,o=e.positions,a=e.minimumHeight,s=e.maximumHeight,l=n(a),u=n(s);if(l||u){var c=o.length;t=l?new Array(c):void 0,i=u?new Array(c):void 0;for(var h=0;h<c;++h)l&&(t[h]=a),u&&(i[h]=s)}var d={positions:o,maximumHeights:i,minimumHeights:t,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat};return new f(d)},f.createGeometry=function(r){var o=r._positions,a=r._minimumHeights,p=r._maximumHeights,f=r._vertexFormat,b=r._granularity,T=r._ellipsoid,x=m.computePositions(T,o,p,a,b,!0);if(n(x)){var A=x.bottomPositions,P=x.topPositions,D=x.numCorners,M=P.length,I=2*M,R=f.position?new Float64Array(I):void 0,O=f.normal?new Float32Array(I):void 0,N=f.tangent?new Float32Array(I):void 0,L=f.bitangent?new Float32Array(I):void 0,B=f.st?new Float32Array(I/3*2):void 0,F=0,V=0,k=0,z=0,U=0,G=E,W=S,H=w,q=!0;M/=3;var j,Y=0,X=1/(M-o.length+1);for(j=0;j<M;++j){var Z=3*j,K=t.fromArray(P,Z,_),Q=t.fromArray(A,Z,g);if(f.position&&(R[F++]=Q.x,R[F++]=Q.y,R[F++]=Q.z,R[F++]=K.x,R[F++]=K.y,R[F++]=K.z),f.st&&(B[U++]=Y,B[U++]=0,B[U++]=Y,B[U++]=1),f.normal||f.tangent||f.bitangent){var J,$=t.clone(t.ZERO,C),ee=T.scaleToGeodeticSurface(t.fromArray(P,Z,g),g);if(j+1<M&&(J=T.scaleToGeodeticSurface(t.fromArray(P,Z+3,v),v),$=t.fromArray(P,Z+3,C)),q){var te=t.subtract($,K,y),ie=t.subtract(ee,K,_);G=t.normalize(t.cross(ie,te,G),G),q=!1}t.equalsEpsilon(J,ee,h.EPSILON10)?q=!0:(Y+=X,f.tangent&&(W=t.normalize(t.subtract(J,ee,W),W)),f.bitangent&&(H=t.normalize(t.cross(G,W,H),H))),f.normal&&(O[V++]=G.x,O[V++]=G.y,O[V++]=G.z,O[V++]=G.x,O[V++]=G.y,O[V++]=G.z),f.tangent&&(N[z++]=W.x,N[z++]=W.y,N[z++]=W.z,N[z++]=W.x,N[z++]=W.y,N[z++]=W.z),f.bitangent&&(L[k++]=H.x,L[k++]=H.y,L[k++]=H.z,L[k++]=H.x,L[k++]=H.y,L[k++]=H.z)}}var re=new u;f.position&&(re.position=new l({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:R})),f.normal&&(re.normal=new l({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:O})),f.tangent&&(re.tangent=new l({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:N})),f.bitangent&&(re.bitangent=new l({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:L})),f.st&&(re.st=new l({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:B}));var ne=I/3;I-=6*(D+1);var oe=c.createTypedArray(ne,I),ae=0;for(j=0;j<ne-2;j+=2){var se=j,le=j+2,ue=t.fromArray(R,3*se,_),ce=t.fromArray(R,3*le,g);if(!t.equalsEpsilon(ue,ce,h.EPSILON10)){var he=j+1,de=j+3;oe[ae++]=he,oe[ae++]=se,oe[ae++]=de,oe[ae++]=de,oe[ae++]=se,oe[ae++]=le}}return new s({attributes:re,indices:oe,primitiveType:d.TRIANGLES,boundingSphere:new e.fromVertices(R)})}},f}),i("Core/WallOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./WallGeometryLibrary"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p){"use strict";function m(e){e=r(e,r.EMPTY_OBJECT);var i=e.positions,o=e.maximumHeights,s=e.minimumHeights,l=r(e.granularity,h.RADIANS_PER_DEGREE),u=r(e.ellipsoid,a.WGS84); +this._positions=i,this._minimumHeights=s,this._maximumHeights=o,this._granularity=l,this._ellipsoid=a.clone(u),this._workerName="createWallOutlineGeometry";var c=1+i.length*t.packedLength+2;n(s)&&(c+=s.length),n(o)&&(c+=o.length),this.packedLength=c+a.packedLength+1}var f=new t,_=new t;m.pack=function(e,i,o){o=r(o,0);var s,l=e._positions,u=l.length;for(i[o++]=u,s=0;s<u;++s,o+=t.packedLength)t.pack(l[s],i,o);var c=e._minimumHeights;if(u=n(c)?c.length:0,i[o++]=u,n(c))for(s=0;s<u;++s)i[o++]=c[s];var h=e._maximumHeights;if(u=n(h)?h.length:0,i[o++]=u,n(h))for(s=0;s<u;++s)i[o++]=h[s];return a.pack(e._ellipsoid,i,o),o+=a.packedLength,i[o]=e._granularity,i};var g=a.clone(a.UNIT_SPHERE),v={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:g,granularity:void 0};return m.unpack=function(e,i,o){i=r(i,0);var s,l=e[i++],u=new Array(l);for(s=0;s<l;++s,i+=t.packedLength)u[s]=t.unpack(e,i);l=e[i++];var c;if(l>0)for(c=new Array(l),s=0;s<l;++s)c[s]=e[i++];l=e[i++];var h;if(l>0)for(h=new Array(l),s=0;s<l;++s)h[s]=e[i++];var d=a.unpack(e,i,g);i+=a.packedLength;var p=e[i];return n(o)?(o._positions=u,o._minimumHeights=c,o._maximumHeights=h,o._ellipsoid=a.clone(d,o._ellipsoid),o._granularity=p,o):(v.positions=u,v.minimumHeights=c,v.maximumHeights=h,v.granularity=p,new m(v))},m.fromConstantHeights=function(e){e=r(e,r.EMPTY_OBJECT);var t,i,o=e.positions,a=e.minimumHeight,s=e.maximumHeight,l=n(a),u=n(s);if(l||u){var c=o.length;t=l?new Array(c):void 0,i=u?new Array(c):void 0;for(var h=0;h<c;++h)l&&(t[h]=a),u&&(i[h]=s)}var d={positions:o,maximumHeights:i,minimumHeights:t,ellipsoid:e.ellipsoid};return new m(d)},m.createGeometry=function(r){var o=r._positions,a=r._minimumHeights,m=r._maximumHeights,g=r._granularity,v=r._ellipsoid,y=p.computePositions(v,o,m,a,g,!1);if(n(y)){var C=y.bottomPositions,w=y.topPositions,S=w.length,E=2*S,b=new Float64Array(E),T=0;S/=3;var x;for(x=0;x<S;++x){var A=3*x,P=t.fromArray(w,A,f),D=t.fromArray(C,A,_);b[T++]=D.x,b[T++]=D.y,b[T++]=D.z,b[T++]=P.x,b[T++]=P.y,b[T++]=P.z}var M=new u({position:new l({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:b})}),I=E/3;E=2*I-4+I;var R=c.createTypedArray(I,E),O=0;for(x=0;x<I-2;x+=2){var N=x,L=x+2,B=t.fromArray(b,3*N,f),F=t.fromArray(b,3*L,_);if(!t.equalsEpsilon(B,F,h.EPSILON10)){var V=x+1,k=x+3;R[O++]=V,R[O++]=N,R[O++]=V,R[O++]=k,R[O++]=N,R[O++]=L}}return R[O++]=I-2,R[O++]=I-1,new s({attributes:M,indices:R,primitiveType:d.LINES,boundingSphere:new e.fromVertices(b)})}},m}),i("Core/WebMercatorTilingScheme",["./Cartesian2","./defaultValue","./defined","./defineProperties","./Ellipsoid","./Rectangle","./WebMercatorProjection"],function(e,t,i,r,n,o,a){"use strict";function s(r){if(r=t(r,{}),this._ellipsoid=t(r.ellipsoid,n.WGS84),this._numberOfLevelZeroTilesX=t(r.numberOfLevelZeroTilesX,1),this._numberOfLevelZeroTilesY=t(r.numberOfLevelZeroTilesY,1),this._projection=new a(this._ellipsoid),i(r.rectangleSouthwestInMeters)&&i(r.rectangleNortheastInMeters))this._rectangleSouthwestInMeters=r.rectangleSouthwestInMeters,this._rectangleNortheastInMeters=r.rectangleNortheastInMeters;else{var s=this._ellipsoid.maximumRadius*Math.PI;this._rectangleSouthwestInMeters=new e(-s,-s),this._rectangleNortheastInMeters=new e(s,s)}var l=this._projection.unproject(this._rectangleSouthwestInMeters),u=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new o(l.longitude,l.latitude,u.longitude,u.latitude)}return r(s.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}}),s.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e},s.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e},s.prototype.rectangleToNativeRectangle=function(e,t){var r=this._projection,n=r.project(o.southwest(e)),a=r.project(o.northeast(e));return i(t)?(t.west=n.x,t.south=n.y,t.east=a.x,t.north=a.y,t):new o(n.x,n.y,a.x,a.y)},s.prototype.tileXYToNativeRectangle=function(e,t,r,n){var a=this.getNumberOfXTilesAtLevel(r),s=this.getNumberOfYTilesAtLevel(r),l=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/a,u=this._rectangleSouthwestInMeters.x+e*l,c=this._rectangleSouthwestInMeters.x+(e+1)*l,h=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/s,d=this._rectangleNortheastInMeters.y-t*h,p=this._rectangleNortheastInMeters.y-(t+1)*h;return i(n)?(n.west=u,n.south=p,n.east=c,n.north=d,n):new o(u,p,c,d)},s.prototype.tileXYToRectangle=function(t,i,r,n){var o=this.tileXYToNativeRectangle(t,i,r,n),a=this._projection,s=a.unproject(new e(o.west,o.south)),l=a.unproject(new e(o.east,o.north));return o.west=s.longitude,o.south=s.latitude,o.east=l.longitude,o.north=l.latitude,o},s.prototype.positionToTileXY=function(t,r,n){var a=this._rectangle;if(o.contains(a,t)){var s=this.getNumberOfXTilesAtLevel(r),l=this.getNumberOfYTilesAtLevel(r),u=this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x,c=u/s,h=this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y,d=h/l,p=this._projection,m=p.project(t),f=m.x-this._rectangleSouthwestInMeters.x,_=this._rectangleNortheastInMeters.y-m.y,g=f/c|0;g>=s&&(g=s-1);var v=_/d|0;return v>=l&&(v=l-1),i(n)?(n.x=g,n.y=v,n):new e(g,v)}},s}),i("Core/wrapFunction",["./DeveloperError"],function(e){"use strict";function t(e,t,i){return function(){i.apply(e,arguments),t.apply(e,arguments)}}return t}),i("DataSources/ConstantProperty",["../Core/defined","../Core/defineProperties","../Core/Event"],function(e,t,i){"use strict";function r(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new i,this.setValue(e)}return t(r.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}}),r.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value},r.prototype.setValue=function(t){var i=this._value;if(i!==t){var r=e(t),n=r&&"function"==typeof t.clone,o=r&&"function"==typeof t.equals;this._hasClone=n,this._hasEquals=o;var a=!o||!t.equals(i);a&&(this._value=n?t.clone():t,this._definitionChanged.raiseEvent(this))}},r.prototype.equals=function(e){return this===e||e instanceof r&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))},r}),i("DataSources/createPropertyDescriptor",["../Core/defaultValue","../Core/defined","./ConstantProperty"],function(e,t,i){"use strict";function r(e,i,r,n,o){return{configurable:n,get:function(){return this[i]},set:function(n){var a=this[i],s=this[r];t(s)&&(s(),this[r]=void 0);var l=t(n);l&&!t(n.getValue)&&t(o)&&(n=o(n)),a!==n&&(this[i]=n,this._definitionChanged.raiseEvent(this,e,n,a)),t(n)&&t(n.definitionChanged)&&(this[r]=n.definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this,e,n,n)},this))}}}function n(e){return new i(e)}function o(t,i,o){return r(t,"_"+t.toString(),"_"+t.toString()+"Subscription",e(i,!1),e(o,n))}return o}),i("DataSources/BillboardGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createPropertyDescriptor"],function(e,t,i,r,n,o){"use strict";function a(t){this._image=void 0,this._imageSubscription=void 0,this._imageSubRegion=void 0,this._imageSubRegionSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._alignedAxis=void 0,this._alignedAxisSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._sizeInMeters=void 0,this._sizeInMetersSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},image:o("image"),imageSubRegion:o("imageSubRegion"),scale:o("scale"),rotation:o("rotation"),alignedAxis:o("alignedAxis"),horizontalOrigin:o("horizontalOrigin"),verticalOrigin:o("verticalOrigin"),color:o("color"),eyeOffset:o("eyeOffset"),heightReference:o("heightReference"),pixelOffset:o("pixelOffset"),show:o("show"),width:o("width"),height:o("height"),scaleByDistance:o("scaleByDistance"),translucencyByDistance:o("translucencyByDistance"),pixelOffsetScaleByDistance:o("pixelOffsetScaleByDistance"),sizeInMeters:o("sizeInMeters"),distanceDisplayCondition:o("distanceDisplayCondition")}),a.prototype.clone=function(e){return t(e)?(e.color=this._color,e.eyeOffset=this._eyeOffset,e.heightReference=this._heightReference,e.horizontalOrigin=this._horizontalOrigin,e.image=this._image,e.imageSubRegion=this._imageSubRegion,e.pixelOffset=this._pixelOffset,e.scale=this._scale,e.rotation=this._rotation,e.alignedAxis=this._alignedAxis,e.show=this._show,e.verticalOrigin=this._verticalOrigin,e.width=this._width,e.height=this._height,e.scaleByDistance=this._scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance,e.sizeInMeters=this._sizeInMeters,e.distanceDisplayCondition=this._distanceDisplayCondition,e):new a(this)},a.prototype.merge=function(t){this.color=e(this._color,t.color),this.eyeOffset=e(this._eyeOffset,t.eyeOffset),this.heightReference=e(this._heightReference,t.heightReference),this.horizontalOrigin=e(this._horizontalOrigin,t.horizontalOrigin),this.image=e(this._image,t.image),this.imageSubRegion=e(this._imageSubRegion,t.imageSubRegion),this.pixelOffset=e(this._pixelOffset,t.pixelOffset),this.scale=e(this._scale,t.scale),this.rotation=e(this._rotation,t.rotation),this.alignedAxis=e(this._alignedAxis,t.alignedAxis),this.show=e(this._show,t.show),this.verticalOrigin=e(this._verticalOrigin,t.verticalOrigin),this.width=e(this._width,t.width),this.height=e(this._height,t.height),this.scaleByDistance=e(this._scaleByDistance,t.scaleByDistance),this.translucencyByDistance=e(this._translucencyByDistance,t.translucencyByDistance),this.pixelOffsetScaleByDistance=e(this._pixelOffsetScaleByDistance,t.pixelOffsetScaleByDistance),this.sizeInMeters=e(this._sizeInMeters,t.sizeInMeters),this.distanceDisplayCondition=e(this._distanceDisplayCondition,t.distanceDisplayCondition)},a}),i("Scene/HeightReference",["../Core/freezeObject"],function(e){"use strict";var t={NONE:0,CLAMP_TO_GROUND:1,RELATIVE_TO_GROUND:2};return e(t)}),i("Scene/HorizontalOrigin",["../Core/freezeObject"],function(e){"use strict";var t={CENTER:0,LEFT:1,RIGHT:-1};return e(t)}),i("Scene/VerticalOrigin",["../Core/freezeObject"],function(e){"use strict";var t={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1};return e(t)}),i("DataSources/BoundingSphereState",["../Core/freezeObject"],function(e){"use strict";var t={DONE:0,PENDING:1,FAILED:2};return e(t)}),i("DataSources/Property",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError"],function(e,t,i,r){"use strict";function n(){r.throwInstantiationError()}return i(n.prototype,{isConstant:{get:r.throwInstantiationError},definitionChanged:{get:r.throwInstantiationError}}),n.prototype.getValue=r.throwInstantiationError,n.prototype.equals=r.throwInstantiationError,n.equals=function(e,i){return e===i||t(e)&&e.equals(i)},n.arrayEquals=function(e,i){if(e===i)return!0;if(!t(e)||!t(i)||e.length!==i.length)return!1;for(var r=e.length,o=0;o<r;o++)if(!n.equals(e[o],i[o]))return!1;return!0},n.isConstant=function(e){return!t(e)||e.isConstant},n.getValueOrUndefined=function(e,i,r){return t(e)?e.getValue(i,r):void 0},n.getValueOrDefault=function(i,r,n,o){return t(i)?e(i.getValue(r,o),n):n},n.getValueOrClonedDefault=function(e,i,r,n){var o;return t(e)&&(o=e.getValue(i,n)),t(o)||(o=r.clone(o)),o},n}),i("DataSources/BillboardVisualizer",["../Core/AssociativeArray","../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/NearFarScalar","../Scene/HeightReference","../Scene/HorizontalOrigin","../Scene/VerticalOrigin","./BoundingSphereState","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m){"use strict";function f(e){this.entity=e,this.billboard=void 0,this.textureValue=void 0}function _(t,i){i.collectionChanged.addEventListener(_.prototype._onCollectionChanged,this),this._cluster=t,this._entityCollection=i,this._items=new e,this._onCollectionChanged(i,i.values,[],[])}function g(e,t,i){o(e)&&(e.billboard=void 0,i.removeBillboard(t))}var v=n.WHITE,y=r.ZERO,C=c.NONE,w=i.ZERO,S=1,E=0,b=r.ZERO,T=h.CENTER,x=d.CENTER,A=!1,P=new r,D=new n,M=new r,I=new i,R=new u,O=new u,N=new u,L=new t,B=new l;return _.prototype.update=function(e){for(var t=this._items.values,i=this._cluster,r=0,n=t.length;r<n;r++){var a,s=t[r],l=s.entity,u=l._billboard,c=s.billboard,h=l.isShowing&&l.isAvailable(e)&&m.getValueOrDefault(u._show,e,!0);if(h&&(P=m.getValueOrUndefined(l._position,e,P),a=m.getValueOrUndefined(u._image,e),h=o(P)&&o(a)),h){m.isConstant(l._position)||(i._clusterDirty=!0),o(c)||(c=i.getBillboard(l),c.id=l,c.image=void 0,s.billboard=c),c.show=h,o(c.image)&&s.textureValue===a||(c.image=a,s.textureValue=a),c.position=P,c.color=m.getValueOrDefault(u._color,e,v,D),c.eyeOffset=m.getValueOrDefault(u._eyeOffset,e,y,M),c.heightReference=m.getValueOrDefault(u._heightReference,e,C),c.pixelOffset=m.getValueOrDefault(u._pixelOffset,e,w,I),c.scale=m.getValueOrDefault(u._scale,e,S),c.rotation=m.getValueOrDefault(u._rotation,e,E),c.alignedAxis=m.getValueOrDefault(u._alignedAxis,e,b),c.horizontalOrigin=m.getValueOrDefault(u._horizontalOrigin,e,T),c.verticalOrigin=m.getValueOrDefault(u._verticalOrigin,e,x),c.width=m.getValueOrUndefined(u._width,e),c.height=m.getValueOrUndefined(u._height,e),c.scaleByDistance=m.getValueOrUndefined(u._scaleByDistance,e,R),c.translucencyByDistance=m.getValueOrUndefined(u._translucencyByDistance,e,O),c.pixelOffsetScaleByDistance=m.getValueOrUndefined(u._pixelOffsetScaleByDistance,e,N),c.sizeInMeters=m.getValueOrDefault(u._sizeInMeters,A),c.distanceDisplayCondition=m.getValueOrUndefined(u._distanceDisplayCondition,e,B);var d=m.getValueOrUndefined(u._imageSubRegion,e,L);o(d)&&c.setImageSubRegion(c._imageId,d)}else g(s,l,i)}return!0},_.prototype.getBoundingSphere=function(e,t){var i=this._items.get(e.id);if(!o(i)||!o(i.billboard))return p.FAILED;var n=i.billboard;if(n.heightReference===c.NONE)t.center=r.clone(n.position,t.center);else{if(!o(n._clampedPosition))return p.PENDING;t.center=r.clone(n._clampedPosition,t.center)}return t.radius=0,p.DONE},_.prototype.isDestroyed=function(){return!1},_.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(_.prototype._onCollectionChanged,this);for(var e=this._entityCollection.values,t=0;t<e.length;t++)this._cluster.removeBillboard(e[t]);return a(this)},_.prototype._onCollectionChanged=function(e,t,i,r){var n,a,s=this._items,l=this._cluster;for(n=t.length-1;n>-1;n--)a=t[n],o(a._billboard)&&o(a._position)&&s.set(a.id,new f(a));for(n=r.length-1;n>-1;n--)a=r[n],o(a._billboard)&&o(a._position)?s.contains(a.id)||s.set(a.id,new f(a)):(g(s.get(a.id),a,l),s.remove(a.id));for(n=i.length-1;n>-1;n--)a=i[n],g(s.get(a.id),a,l),s.remove(a.id)},_}),i("Shaders/Appearances/AllMaterialAppearanceFS",[],function(){"use strict";return"varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec3 v_tangentEC;\nvarying vec3 v_bitangentEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec3 positionToEyeEC = -v_positionEC;\nmat3 tangentToEyeMatrix = czm_tangentToEyeSpaceMatrix(v_normalEC, v_tangentEC, v_bitangentEC);\nvec3 normalEC = normalize(v_normalEC);\n#ifdef FACE_FORWARD\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.tangentToEyeMatrix = tangentToEyeMatrix;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nmaterialInput.st = v_st;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\n#endif\n}\n"}),i("Shaders/Appearances/AllMaterialAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute vec3 tangent;\nattribute vec3 bitangent;\nattribute vec2 st;\nattribute float batchId;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec3 v_tangentEC;\nvarying vec3 v_bitangentEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_normalEC = czm_normal * normal;\nv_tangentEC = czm_normal * tangent;\nv_bitangentEC = czm_normal * bitangent;\nv_st = st;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),i("Shaders/Appearances/BasicMaterialAppearanceFS",[],function(){"use strict";return"varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvoid main()\n{\nvec3 positionToEyeEC = -v_positionEC;\nvec3 normalEC = normalize(v_normalEC);\n#ifdef FACE_FORWARD\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\n#endif\n}\n"}),i("Shaders/Appearances/BasicMaterialAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute float batchId;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_normalEC = czm_normal * normal;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),i("Shaders/Appearances/TexturedMaterialAppearanceFS",[],function(){"use strict";return"varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec3 positionToEyeEC = -v_positionEC;\nvec3 normalEC = normalize(v_normalEC);;\n#ifdef FACE_FORWARD\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nmaterialInput.st = v_st;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\n#endif\n}\n"}),i("Shaders/Appearances/TexturedMaterialAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute vec2 st;\nattribute float batchId;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_normalEC = czm_normal * normal;\nv_st = st;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),i("Scene/BlendEquation",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={ADD:t.FUNC_ADD,SUBTRACT:t.FUNC_SUBTRACT,REVERSE_SUBTRACT:t.FUNC_REVERSE_SUBTRACT};return e(i)}),i("Scene/BlendFunction",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={ZERO:t.ZERO,ONE:t.ONE,SOURCE_COLOR:t.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:t.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:t.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:t.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:t.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:t.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:t.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:t.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:t.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:t.ONE_MINUS_CONSTANT_ALPHA,CONSTANT_ALPHA:t.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:t.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:t.SRC_ALPHA_SATURATE};return e(i)}),i("Scene/BlendingState",["../Core/freezeObject","./BlendEquation","./BlendFunction"],function(e,t,i){"use strict";var r={DISABLED:e({enabled:!1}),ALPHA_BLEND:e({enabled:!0,equationRgb:t.ADD,equationAlpha:t.ADD,functionSourceRgb:i.SOURCE_ALPHA,functionSourceAlpha:i.SOURCE_ALPHA,functionDestinationRgb:i.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:i.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:e({enabled:!0,equationRgb:t.ADD,equationAlpha:t.ADD,functionSourceRgb:i.ONE,functionSourceAlpha:i.ONE,functionDestinationRgb:i.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:i.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:e({enabled:!0,equationRgb:t.ADD,equationAlpha:t.ADD,functionSourceRgb:i.SOURCE_ALPHA,functionSourceAlpha:i.SOURCE_ALPHA,functionDestinationRgb:i.ONE,functionDestinationAlpha:i.ONE})};return e(r)}),i("Scene/CullFace",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={FRONT:t.FRONT,BACK:t.BACK,FRONT_AND_BACK:t.FRONT_AND_BACK};return e(i)}),i("Scene/Appearance",["../Core/clone","../Core/combine","../Core/defaultValue","../Core/defined","../Core/defineProperties","./BlendingState","./CullFace"],function(e,t,i,r,n,o,a){"use strict";function s(e){e=i(e,i.EMPTY_OBJECT),this.material=e.material,this.translucent=i(e.translucent,!0),this._vertexShaderSource=e.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource,this._renderState=e.renderState,this._closed=i(e.closed,!1)}return n(s.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}}}),s.prototype.getFragmentShaderSource=function(){var e=[];return this.flat&&e.push("#define FLAT"),this.faceForward&&e.push("#define FACE_FORWARD"),r(this.material)&&e.push(this.material.shaderSource),e.push(this.fragmentShaderSource),e.join("\n")},s.prototype.isTranslucent=function(){return r(this.material)&&this.material.isTranslucent()||!r(this.material)&&this.translucent},s.prototype.getRenderState=function(){var t=this.isTranslucent(),i=e(this.renderState,!1);return t?(i.depthMask=!1,i.blending=o.ALPHA_BLEND):i.depthMask=!0,i},s.getDefaultRenderState=function(e,i,n){var s={depthTest:{enabled:!0}};return e&&(s.depthMask=!1,s.blending=o.ALPHA_BLEND),i&&(s.cull={enabled:!0,face:a.BACK}),r(n)&&(s=t(n,s,!0)),s},s}),i("Renderer/ContextLimits",["../Core/defineProperties"],function(e){"use strict";var t={_maximumCombinedTextureImageUnits:0,_maximumCubeMapSize:0,_maximumFragmentUniformVectors:0,_maximumTextureImageUnits:0,_maximumRenderbufferSize:0,_maximumTextureSize:0,_maximumVaryingVectors:0,_maximumVertexAttributes:0,_maximumVertexTextureImageUnits:0,_maximumVertexUniformVectors:0,_minimumAliasedLineWidth:0,_maximumAliasedLineWidth:0,_minimumAliasedPointSize:0,_maximumAliasedPointSize:0,_maximumViewportWidth:0,_maximumViewportHeight:0,_maximumTextureFilterAnisotropy:0,_maximumDrawBuffers:0,_maximumColorAttachments:0,_highpFloatSupported:!1,_highpIntSupported:!1};return e(t,{maximumCombinedTextureImageUnits:{get:function(){return t._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return t._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return t._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return t._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return t._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return t._maximumTextureSize}},maximumVaryingVectors:{get:function(){return t._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return t._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return t._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return t._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return t._minimumAliasedLineWidth}},maximumAliasedLineWidth:{get:function(){return t._maximumAliasedLineWidth}},minimumAliasedPointSize:{get:function(){return t._minimumAliasedPointSize}},maximumAliasedPointSize:{get:function(){return t._maximumAliasedPointSize}},maximumViewportWidth:{get:function(){return t._maximumViewportWidth}},maximumViewportHeight:{get:function(){return t._maximumViewportHeight}},maximumTextureFilterAnisotropy:{get:function(){return t._maximumTextureFilterAnisotropy}},maximumDrawBuffers:{get:function(){return t._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return t._maximumColorAttachments}},highpFloatSupported:{get:function(){return t._highpFloatSupported}},highpIntSupported:{get:function(){return t._highpIntSupported}}}),t}),i("Renderer/PixelDatatype",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={UNSIGNED_BYTE:t.UNSIGNED_BYTE,UNSIGNED_SHORT:t.UNSIGNED_SHORT,UNSIGNED_INT:t.UNSIGNED_INT,FLOAT:t.FLOAT,UNSIGNED_INT_24_8:t.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:t.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:t.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:t.UNSIGNED_SHORT_5_6_5,validate:function(e){return e===i.UNSIGNED_BYTE||e===i.UNSIGNED_SHORT||e===i.UNSIGNED_INT||e===i.FLOAT||e===i.UNSIGNED_INT_24_8||e===i.UNSIGNED_SHORT_4_4_4_4||e===i.UNSIGNED_SHORT_5_5_5_1||e===i.UNSIGNED_SHORT_5_6_5}};return e(i)}),i("Renderer/CubeMapFace",["../Core/defaultValue","../Core/defineProperties","../Core/DeveloperError","./PixelDatatype"],function(e,t,i,r){"use strict";function n(e,t,i,r,n,o,a,s,l){this._gl=e,this._texture=t,this._textureTarget=i,this._targetFace=r,this._pixelFormat=n,this._pixelDatatype=o,this._size=a,this._preMultiplyAlpha=s,this._flipY=l}return t(n.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}}),n.prototype.copyFrom=function(t,i,r){i=e(i,0),r=e(r,0);var n=this._gl,o=this._textureTarget;n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this._preMultiplyAlpha),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,this._flipY),n.activeTexture(n.TEXTURE0),n.bindTexture(o,this._texture),t.arrayBufferView?n.texSubImage2D(this._targetFace,0,i,r,t.width,t.height,this._pixelFormat,this._pixelDatatype,t.arrayBufferView):n.texSubImage2D(this._targetFace,0,i,r,this._pixelFormat,this._pixelDatatype,t),n.bindTexture(o,null)},n.prototype.copyFromFramebuffer=function(t,i,r,n,o,a){t=e(t,0),i=e(i,0),r=e(r,0),n=e(n,0),o=e(o,this._size),a=e(a,this._size);var s=this._gl,l=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(l,this._texture),s.copyTexSubImage2D(this._targetFace,0,t,i,r,n,o,a),s.bindTexture(l,null)},n}),i("Renderer/MipmapHint",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={DONT_CARE:t.DONT_CARE,FASTEST:t.FASTEST,NICEST:t.NICEST,validate:function(e){return e===i.DONT_CARE||e===i.FASTEST||e===i.NICEST}};return e(i)}),i("Renderer/TextureMagnificationFilter",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={NEAREST:t.NEAREST,LINEAR:t.LINEAR,validate:function(e){return e===i.NEAREST||e===i.LINEAR}};return e(i)}),i("Renderer/TextureMinificationFilter",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={NEAREST:t.NEAREST,LINEAR:t.LINEAR,NEAREST_MIPMAP_NEAREST:t.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:t.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:t.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:t.LINEAR_MIPMAP_LINEAR,validate:function(e){return e===i.NEAREST||e===i.LINEAR||e===i.NEAREST_MIPMAP_NEAREST||e===i.LINEAR_MIPMAP_NEAREST||e===i.NEAREST_MIPMAP_LINEAR||e===i.LINEAR_MIPMAP_LINEAR}};return e(i)}),i("Renderer/TextureWrap",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={CLAMP_TO_EDGE:t.CLAMP_TO_EDGE,REPEAT:t.REPEAT,MIRRORED_REPEAT:t.MIRRORED_REPEAT,validate:function(e){return e===i.CLAMP_TO_EDGE||e===i.REPEAT||e===i.MIRRORED_REPEAT}};return e(i)}),i("Renderer/Sampler",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","./TextureMagnificationFilter","./TextureMinificationFilter","./TextureWrap"],function(e,t,i,r,n,o,a){"use strict";function s(i){i=e(i,e.EMPTY_OBJECT);var r=e(i.wrapS,a.CLAMP_TO_EDGE),s=e(i.wrapT,a.CLAMP_TO_EDGE),l=e(i.minificationFilter,o.LINEAR),u=e(i.magnificationFilter,n.LINEAR),c=t(i.maximumAnisotropy)?i.maximumAnisotropy:1;this._wrapS=r,this._wrapT=s,this._minificationFilter=l,this._magnificationFilter=u,this._maximumAnisotropy=c}return i(s.prototype,{wrapS:{get:function(){return this._wrapS}},wrapT:{get:function(){return this._wrapT}},minificationFilter:{get:function(){return this._minificationFilter}},magnificationFilter:{get:function(){return this._magnificationFilter}},maximumAnisotropy:{get:function(){return this._maximumAnisotropy}}}),s}),i("Renderer/CubeMap",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Math","../Core/PixelFormat","./ContextLimits","./CubeMapFace","./MipmapHint","./PixelDatatype","./Sampler","./TextureMagnificationFilter","./TextureMinificationFilter"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p){"use strict";function m(i){function r(e,t){t.arrayBufferView?v.texImage2D(e,0,m,p,p,0,m,f,t.arrayBufferView):v.texImage2D(e,0,m,m,f,t)}i=e(i,e.EMPTY_OBJECT);var n,o,s=i.context,u=i.source;if(t(u)){var d=[u.positiveX,u.negativeX,u.positiveY,u.negativeY,u.positiveZ,u.negativeZ];n=d[0].width,o=d[0].height}else n=i.width,o=i.height;var p=n,m=e(i.pixelFormat,a.RGBA),f=e(i.pixelDatatype,c.UNSIGNED_BYTE),_=i.preMultiplyAlpha||m===a.RGB||m===a.LUMINANCE,g=e(i.flipY,!0),v=s._gl,y=v.TEXTURE_CUBE_MAP,C=v.createTexture();v.activeTexture(v.TEXTURE0),v.bindTexture(y,C),t(u)?(v.pixelStorei(v.UNPACK_PREMULTIPLY_ALPHA_WEBGL,_),v.pixelStorei(v.UNPACK_FLIP_Y_WEBGL,g),r(v.TEXTURE_CUBE_MAP_POSITIVE_X,u.positiveX),r(v.TEXTURE_CUBE_MAP_NEGATIVE_X,u.negativeX),r(v.TEXTURE_CUBE_MAP_POSITIVE_Y,u.positiveY),r(v.TEXTURE_CUBE_MAP_NEGATIVE_Y,u.negativeY),r(v.TEXTURE_CUBE_MAP_POSITIVE_Z,u.positiveZ),r(v.TEXTURE_CUBE_MAP_NEGATIVE_Z,u.negativeZ)):(v.texImage2D(v.TEXTURE_CUBE_MAP_POSITIVE_X,0,m,p,p,0,m,f,null),v.texImage2D(v.TEXTURE_CUBE_MAP_NEGATIVE_X,0,m,p,p,0,m,f,null),v.texImage2D(v.TEXTURE_CUBE_MAP_POSITIVE_Y,0,m,p,p,0,m,f,null),v.texImage2D(v.TEXTURE_CUBE_MAP_NEGATIVE_Y,0,m,p,p,0,m,f,null),v.texImage2D(v.TEXTURE_CUBE_MAP_POSITIVE_Z,0,m,p,p,0,m,f,null),v.texImage2D(v.TEXTURE_CUBE_MAP_NEGATIVE_Z,0,m,p,p,0,m,f,null)),v.bindTexture(y,null),this._gl=v,this._textureFilterAnisotropic=s._textureFilterAnisotropic,this._textureTarget=y,this._texture=C,this._pixelFormat=m,this._pixelDatatype=f,this._size=p,this._preMultiplyAlpha=_,this._flipY=g,this._sampler=void 0,this._positiveX=new l(v,C,y,v.TEXTURE_CUBE_MAP_POSITIVE_X,m,f,p,_,g),this._negativeX=new l(v,C,y,v.TEXTURE_CUBE_MAP_NEGATIVE_X,m,f,p,_,g),this._positiveY=new l(v,C,y,v.TEXTURE_CUBE_MAP_POSITIVE_Y,m,f,p,_,g),this._negativeY=new l(v,C,y,v.TEXTURE_CUBE_MAP_NEGATIVE_Y,m,f,p,_,g),this._positiveZ=new l(v,C,y,v.TEXTURE_CUBE_MAP_POSITIVE_Z,m,f,p,_,g),this._negativeZ=new l(v,C,y,v.TEXTURE_CUBE_MAP_NEGATIVE_Z,m,f,p,_,g),this.sampler=t(i.sampler)?i.sampler:new h; +}return i(m.prototype,{positiveX:{get:function(){return this._positiveX}},negativeX:{get:function(){return this._negativeX}},positiveY:{get:function(){return this._positiveY}},negativeY:{get:function(){return this._negativeY}},positiveZ:{get:function(){return this._positiveZ}},negativeZ:{get:function(){return this._negativeZ}},sampler:{get:function(){return this._sampler},set:function(e){var i=e.minificationFilter,r=e.magnificationFilter,n=i===p.NEAREST_MIPMAP_NEAREST||i===p.NEAREST_MIPMAP_LINEAR||i===p.LINEAR_MIPMAP_NEAREST||i===p.LINEAR_MIPMAP_LINEAR;this._pixelDatatype===c.FLOAT&&(i=n?p.NEAREST_MIPMAP_NEAREST:p.NEAREST,r=d.NEAREST);var o=this._gl,a=this._textureTarget;o.activeTexture(o.TEXTURE0),o.bindTexture(a,this._texture),o.texParameteri(a,o.TEXTURE_MIN_FILTER,i),o.texParameteri(a,o.TEXTURE_MAG_FILTER,r),o.texParameteri(a,o.TEXTURE_WRAP_S,e.wrapS),o.texParameteri(a,o.TEXTURE_WRAP_T,e.wrapT),t(this._textureFilterAnisotropic)&&o.texParameteri(a,this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,e.maximumAnisotropy),o.bindTexture(a,null),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},width:{get:function(){return this._size}},height:{get:function(){return this._size}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},_target:{get:function(){return this._textureTarget}}}),m.prototype.generateMipmap=function(t){t=e(t,u.DONT_CARE);var i=this._gl,r=this._textureTarget;i.hint(i.GENERATE_MIPMAP_HINT,t),i.activeTexture(i.TEXTURE0),i.bindTexture(r,this._texture),i.generateMipmap(r),i.bindTexture(r,null)},m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){return this._gl.deleteTexture(this._texture),this._positiveX=r(this._positiveX),this._negativeX=r(this._negativeX),this._positiveY=r(this._positiveY),this._negativeY=r(this._negativeY),this._positiveZ=r(this._positiveZ),this._negativeZ=r(this._negativeZ),r(this)},m}),i("Renderer/Texture",["../Core/Cartesian2","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Math","../Core/PixelFormat","../Core/WebGLConstants","./ContextLimits","./MipmapHint","./PixelDatatype","./Sampler","./TextureMagnificationFilter","./TextureMinificationFilter"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m){"use strict";function f(r){r=t(r,t.EMPTY_OBJECT);var n=r.context,o=r.width,a=r.height,u=r.source;i(u)&&(i(o)||(o=t(u.videoWidth,u.width)),i(a)||(a=t(u.videoHeight,u.height)));var c=t(r.pixelFormat,s.RGBA),p=t(r.pixelDatatype,h.UNSIGNED_BYTE),m=c;n.webgl2&&(c===s.DEPTH_STENCIL?m=l.DEPTH24_STENCIL8:c===s.DEPTH_COMPONENT&&(p===h.UNSIGNED_SHORT?m=l.DEPTH_COMPONENT16:p===h.UNSIGNED_INT&&(m=l.DEPTH_COMPONENT24)));var f=r.preMultiplyAlpha||c===s.RGB||c===s.LUMINANCE,_=t(r.flipY,!0),g=n._gl,v=g.TEXTURE_2D,y=g.createTexture();g.activeTexture(g.TEXTURE0),g.bindTexture(v,y),i(u)?(g.pixelStorei(g.UNPACK_PREMULTIPLY_ALPHA_WEBGL,f),g.pixelStorei(g.UNPACK_FLIP_Y_WEBGL,_),i(u.arrayBufferView)?g.texImage2D(v,0,m,o,a,0,c,p,u.arrayBufferView):i(u.framebuffer)?(u.framebuffer!==n.defaultFramebuffer&&u.framebuffer._bind(),g.copyTexImage2D(v,0,m,u.xOffset,u.yOffset,o,a,0),u.framebuffer!==n.defaultFramebuffer&&u.framebuffer._unBind()):g.texImage2D(v,0,m,c,p,u)):g.texImage2D(v,0,m,o,a,0,c,p,null),g.bindTexture(v,null),this._context=n,this._textureFilterAnisotropic=n._textureFilterAnisotropic,this._textureTarget=v,this._texture=y,this._pixelFormat=c,this._pixelDatatype=p,this._width=o,this._height=a,this._dimensions=new e(o,a),this._preMultiplyAlpha=f,this._flipY=_,this._sampler=void 0,this.sampler=i(r.sampler)?r.sampler:new d}return f.fromFramebuffer=function(e){e=t(e,t.EMPTY_OBJECT);var r=e.context,n=r._gl,o=t(e.pixelFormat,s.RGB),a=t(e.framebufferXOffset,0),l=t(e.framebufferYOffset,0),u=t(e.width,n.drawingBufferWidth),c=t(e.height,n.drawingBufferHeight),h=e.framebuffer,d=new f({context:r,width:u,height:c,pixelFormat:o,source:{framebuffer:i(h)?h:r.defaultFramebuffer,xOffset:a,yOffset:l,width:u,height:c}});return d},r(f.prototype,{sampler:{get:function(){return this._sampler},set:function(e){var t=e.minificationFilter,r=e.magnificationFilter,n=t===m.NEAREST_MIPMAP_NEAREST||t===m.NEAREST_MIPMAP_LINEAR||t===m.LINEAR_MIPMAP_NEAREST||t===m.LINEAR_MIPMAP_LINEAR;this._pixelDatatype===h.FLOAT&&(t=n?m.NEAREST_MIPMAP_NEAREST:m.NEAREST,r=p.NEAREST);var o=this._context._gl,a=this._textureTarget;o.activeTexture(o.TEXTURE0),o.bindTexture(a,this._texture),o.texParameteri(a,o.TEXTURE_MIN_FILTER,t),o.texParameteri(a,o.TEXTURE_MAG_FILTER,r),o.texParameteri(a,o.TEXTURE_WRAP_S,e.wrapS),o.texParameteri(a,o.TEXTURE_WRAP_T,e.wrapT),i(this._textureFilterAnisotropic)&&o.texParameteri(a,this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,e.maximumAnisotropy),o.bindTexture(a,null),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},dimensions:{get:function(){return this._dimensions}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},_target:{get:function(){return this._textureTarget}}}),f.prototype.copyFrom=function(e,i,r){i=t(i,0),r=t(r,0);var n=this._context._gl,o=this._textureTarget;n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this._preMultiplyAlpha),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,this._flipY),n.activeTexture(n.TEXTURE0),n.bindTexture(o,this._texture),e.arrayBufferView?n.texSubImage2D(o,0,i,r,e.width,e.height,this._pixelFormat,this._pixelDatatype,e.arrayBufferView):n.texSubImage2D(o,0,i,r,this._pixelFormat,this._pixelDatatype,e),n.bindTexture(o,null)},f.prototype.copyFromFramebuffer=function(e,i,r,n,o,a){e=t(e,0),i=t(i,0),r=t(r,0),n=t(n,0),o=t(o,this._width),a=t(a,this._height);var s=this._context._gl,l=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(l,this._texture),s.copyTexSubImage2D(l,0,e,i,r,n,o,a),s.bindTexture(l,null)},f.prototype.generateMipmap=function(e){e=t(e,c.DONT_CARE);var i=this._context._gl,r=this._textureTarget;i.hint(i.GENERATE_MIPMAP_HINT,e),i.activeTexture(i.TEXTURE0),i.bindTexture(r,this._texture),i.generateMipmap(r),i.bindTexture(r,null)},f.prototype.isDestroyed=function(){return!1},f.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),n(this)},f}),i("Shaders/Materials/BumpMapMaterial",[],function(){"use strict";return"uniform sampler2D image;\nuniform float strength;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nvec2 centerPixel = fract(repeat * st);\nfloat centerBump = texture2D(image, centerPixel).channel;\nfloat imageWidth = float(imageDimensions.x);\nvec2 rightPixel = fract(repeat * (st + vec2(1.0 / imageWidth, 0.0)));\nfloat rightBump = texture2D(image, rightPixel).channel;\nfloat imageHeight = float(imageDimensions.y);\nvec2 leftPixel = fract(repeat * (st + vec2(0.0, 1.0 / imageHeight)));\nfloat topBump = texture2D(image, leftPixel).channel;\nvec3 normalTangentSpace = normalize(vec3(centerBump - rightBump, centerBump - topBump, clamp(1.0 - strength, 0.1, 1.0)));\nvec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace;\nmaterial.normal = normalEC;\nmaterial.diffuse = vec3(0.01);\nreturn material;\n}\n"}),i("Shaders/Materials/CheckerboardMaterial",[],function(){"use strict";return"uniform vec4 lightColor;\nuniform vec4 darkColor;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat b = mod(floor(repeat.s * st.s) + floor(repeat.t * st.t), 2.0);\nfloat scaledWidth = fract(repeat.s * st.s);\nscaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));\nfloat scaledHeight = fract(repeat.t * st.t);\nscaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));\nfloat value = min(scaledWidth, scaledHeight);\nvec4 currentColor = mix(lightColor, darkColor, b);\nvec4 color = czm_antialias(lightColor, darkColor, currentColor, value, 0.03);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n"}),i("Shaders/Materials/DotMaterial",[],function(){"use strict";return"uniform vec4 lightColor;\nuniform vec4 darkColor;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat b = smoothstep(0.3, 0.32, length(fract(repeat * materialInput.st) - 0.5));\nvec4 color = mix(lightColor, darkColor, b);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n"}),i("Shaders/Materials/FadeMaterial",[],function(){"use strict";return"uniform vec4 fadeInColor;\nuniform vec4 fadeOutColor;\nuniform float maximumDistance;\nuniform bool repeat;\nuniform vec2 fadeDirection;\nuniform vec2 time;\nfloat getTime(float t, float coord)\n{\nfloat scalar = 1.0 / maximumDistance;\nfloat q = distance(t, coord) * scalar;\nif (repeat)\n{\nfloat r = distance(t, coord + 1.0) * scalar;\nfloat s = distance(t, coord - 1.0) * scalar;\nq = min(min(r, s), q);\n}\nreturn clamp(q, 0.0, 1.0);\n}\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat s = getTime(time.x, st.s) * fadeDirection.s;\nfloat t = getTime(time.y, st.t) * fadeDirection.t;\nfloat u = length(vec2(s, t));\nvec4 color = mix(fadeInColor, fadeOutColor, u);\nmaterial.emission = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n"}),i("Shaders/Materials/GridMaterial",[],function(){"use strict";return"#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\nuniform vec4 color;\nuniform float cellAlpha;\nuniform vec2 lineCount;\nuniform vec2 lineThickness;\nuniform vec2 lineOffset;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat scaledWidth = fract(lineCount.s * st.s - lineOffset.s);\nscaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));\nfloat scaledHeight = fract(lineCount.t * st.t - lineOffset.t);\nscaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));\nfloat value;\n#ifdef GL_OES_standard_derivatives\nconst float fuzz = 1.2;\nvec2 thickness = (lineThickness * czm_resolutionScale) - 1.0;\nvec2 dx = abs(dFdx(st));\nvec2 dy = abs(dFdy(st));\nvec2 dF = vec2(max(dx.s, dy.s), max(dx.t, dy.t)) * lineCount;\nvalue = min(\nsmoothstep(dF.s * thickness.s, dF.s * (fuzz + thickness.s), scaledWidth),\nsmoothstep(dF.t * thickness.t, dF.t * (fuzz + thickness.t), scaledHeight));\n#else\nconst float fuzz = 0.05;\nvec2 range = 0.5 - (lineThickness * 0.05);\nvalue = min(\n1.0 - smoothstep(range.s, range.s + fuzz, scaledWidth),\n1.0 - smoothstep(range.t, range.t + fuzz, scaledHeight));\n#endif\nfloat dRim = 1.0 - abs(dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC)));\nfloat sRim = smoothstep(0.8, 1.0, dRim);\nvalue *= (1.0 - sRim);\nvec3 halfColor = color.rgb * 0.5;\nmaterial.diffuse = halfColor;\nmaterial.emission = halfColor;\nmaterial.alpha = color.a * (1.0 - ((1.0 - cellAlpha) * value));\nreturn material;\n}\n"}),i("Shaders/Materials/NormalMapMaterial",[],function(){"use strict";return"uniform sampler2D image;\nuniform float strength;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec4 textureValue = texture2D(image, fract(repeat * materialInput.st));\nvec3 normalTangentSpace = textureValue.channels;\nnormalTangentSpace.xy = normalTangentSpace.xy * 2.0 - 1.0;\nnormalTangentSpace.z = clamp(1.0 - strength, 0.1, 1.0);\nnormalTangentSpace = normalize(normalTangentSpace);\nvec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace;\nmaterial.normal = normalEC;\nreturn material;\n}\n"}),i("Shaders/Materials/PolylineArrowMaterial",[],function(){"use strict";return"#extension GL_OES_standard_derivatives : enable\nuniform vec4 color;\nvarying float v_width;\nfloat getPointOnLine(vec2 p0, vec2 p1, float x)\n{\nfloat slope = (p0.y - p1.y) / (p0.x - p1.x);\nreturn slope * (x - p0.x) + p0.y;\n}\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat base = 1.0 - abs(fwidth(st.s)) * 10.0;\nvec2 center = vec2(1.0, 0.5);\nfloat ptOnUpperLine = getPointOnLine(vec2(base, 1.0), center, st.s);\nfloat ptOnLowerLine = getPointOnLine(vec2(base, 0.0), center, st.s);\nfloat halfWidth = 0.15;\nfloat s = step(0.5 - halfWidth, st.t);\ns *= 1.0 - step(0.5 + halfWidth, st.t);\ns *= 1.0 - step(base, st.s);\nfloat t = step(base, materialInput.st.s);\nt *= 1.0 - step(ptOnUpperLine, st.t);\nt *= step(ptOnLowerLine, st.t);\nfloat dist;\nif (st.s < base)\n{\nfloat d1 = abs(st.t - (0.5 - halfWidth));\nfloat d2 = abs(st.t - (0.5 + halfWidth));\ndist = min(d1, d2);\n}\nelse\n{\nfloat d1 = czm_infinity;\nif (st.t < 0.5 - halfWidth && st.t > 0.5 + halfWidth)\n{\nd1 = abs(st.s - base);\n}\nfloat d2 = abs(st.t - ptOnUpperLine);\nfloat d3 = abs(st.t - ptOnLowerLine);\ndist = min(min(d1, d2), d3);\n}\nvec4 outsideColor = vec4(0.0);\nvec4 currentColor = mix(outsideColor, color, clamp(s + t, 0.0, 1.0));\nvec4 outColor = czm_antialias(outsideColor, color, currentColor, dist);\nmaterial.diffuse = outColor.rgb;\nmaterial.alpha = outColor.a;\nreturn material;\n}\n"}),i("Shaders/Materials/PolylineGlowMaterial",[],function(){"use strict";return"uniform vec4 color;\nuniform float glowPower;\nvarying float v_width;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat glow = glowPower / abs(st.t - 0.5) - (glowPower / 0.5);\nmaterial.emission = max(vec3(glow - 1.0 + color.rgb), color.rgb);\nmaterial.alpha = clamp(0.0, 1.0, glow) * color.a;\nreturn material;\n}\n"}),i("Shaders/Materials/PolylineOutlineMaterial",[],function(){"use strict";return"uniform vec4 color;\nuniform vec4 outlineColor;\nuniform float outlineWidth;\nvarying float v_width;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat halfInteriorWidth = 0.5 * (v_width - outlineWidth) / v_width;\nfloat b = step(0.5 - halfInteriorWidth, st.t);\nb *= 1.0 - step(0.5 + halfInteriorWidth, st.t);\nfloat d1 = abs(st.t - (0.5 - halfInteriorWidth));\nfloat d2 = abs(st.t - (0.5 + halfInteriorWidth));\nfloat dist = min(d1, d2);\nvec4 currentColor = mix(outlineColor, color, b);\nvec4 outColor = czm_antialias(outlineColor, color, currentColor, dist);\nmaterial.diffuse = outColor.rgb;\nmaterial.alpha = outColor.a;\nreturn material;\n}\n"}),i("Shaders/Materials/RimLightingMaterial",[],function(){"use strict";return"uniform vec4 color;\nuniform vec4 rimColor;\nuniform float width;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat d = 1.0 - dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC));\nfloat s = smoothstep(1.0 - width, 1.0, d);\nmaterial.diffuse = color.rgb;\nmaterial.emission = rimColor.rgb * s;\nmaterial.alpha = mix(color.a, rimColor.a, s);\nreturn material;\n}\n"}),i("Shaders/Materials/StripeMaterial",[],function(){"use strict";return"uniform vec4 evenColor;\nuniform vec4 oddColor;\nuniform float offset;\nuniform float repeat;\nuniform bool horizontal;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat coord = mix(materialInput.st.s, materialInput.st.t, float(horizontal));\nfloat value = fract((coord - offset) * (repeat * 0.5));\nfloat dist = min(value, min(abs(value - 0.5), 1.0 - value));\nvec4 currentColor = mix(evenColor, oddColor, step(0.5, value));\nvec4 color = czm_antialias(evenColor, oddColor, currentColor, dist);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n"}),i("Shaders/Materials/Water",[],function(){"use strict";return"uniform sampler2D specularMap;\nuniform sampler2D normalMap;\nuniform vec4 baseWaterColor;\nuniform vec4 blendColor;\nuniform float frequency;\nuniform float animationSpeed;\nuniform float amplitude;\nuniform float specularIntensity;\nuniform float fadeFactor;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat time = czm_frameNumber * animationSpeed;\nfloat fade = max(1.0, (length(materialInput.positionToEyeEC) / 10000000000.0) * frequency * fadeFactor);\nfloat specularMapValue = texture2D(specularMap, materialInput.st).r;\nvec4 noise = czm_getWaterNoise(normalMap, materialInput.st * frequency, time, 0.0);\nvec3 normalTangentSpace = noise.xyz * vec3(1.0, 1.0, (1.0 / amplitude));\nnormalTangentSpace.xy /= fade;\nnormalTangentSpace = mix(vec3(0.0, 0.0, 50.0), normalTangentSpace, specularMapValue);\nnormalTangentSpace = normalize(normalTangentSpace);\nfloat tsPerturbationRatio = clamp(dot(normalTangentSpace, vec3(0.0, 0.0, 1.0)), 0.0, 1.0);\nmaterial.alpha = specularMapValue;\nmaterial.diffuse = mix(blendColor.rgb, baseWaterColor.rgb, specularMapValue);\nmaterial.diffuse += (0.1 * tsPerturbationRatio);\nmaterial.normal = normalize(materialInput.tangentToEyeMatrix * normalTangentSpace);\nmaterial.specular = specularIntensity;\nmaterial.shininess = 10.0;\nreturn material;\n}\n"}),i("Scene/Material",["../Core/Cartesian2","../Core/clone","../Core/Color","../Core/combine","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/isArray","../Core/loadImage","../Core/Matrix2","../Core/Matrix3","../Core/Matrix4","../Renderer/CubeMap","../Renderer/Texture","../Shaders/Materials/BumpMapMaterial","../Shaders/Materials/CheckerboardMaterial","../Shaders/Materials/DotMaterial","../Shaders/Materials/FadeMaterial","../Shaders/Materials/GridMaterial","../Shaders/Materials/NormalMapMaterial","../Shaders/Materials/PolylineArrowMaterial","../Shaders/Materials/PolylineGlowMaterial","../Shaders/Materials/PolylineOutlineMaterial","../Shaders/Materials/RimLightingMaterial","../Shaders/Materials/StripeMaterial","../Shaders/Materials/Water","../ThirdParty/when"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A,P,D){"use strict";function M(e){this.type=void 0,this.shaderSource=void 0,this.materials=void 0,this.uniforms=void 0,this._uniforms=void 0,this.translucent=void 0,this._strict=void 0,this._template=void 0,this._count=void 0,this._texturePaths={},this._loadedImages=[],this._loadedCubeMaps=[],this._textures={},this._updateFunctions=[],this._defaultTexture=void 0,I(e,this),s(this,{type:{value:this.type,writable:!1}}),a(M._uniformList[this.type])||(M._uniformList[this.type]=Object.keys(this._uniforms))}function I(e,i){e=o(e,o.EMPTY_OBJECT),i._strict=o(e.strict,!1),i._count=o(e.count,0),i._template=t(o(e.fabric,o.EMPTY_OBJECT)),i._template.uniforms=t(o(i._template.uniforms,o.EMPTY_OBJECT)),i._template.materials=t(o(i._template.materials,o.EMPTY_OBJECT)),i.type=a(i._template.type)?i._template.type:n(),i.shaderSource="",i.materials={},i.uniforms={},i._uniforms={},i._translucentFunctions=[];var s,l=M._materialCache.getMaterial(i.type);if(a(l)){var u=t(l.fabric,!0);i._template=r(i._template,u,!0),s=l.translucent}L(i),a(l)||M._materialCache.addMaterial(i.type,i),B(i),k(i),G(i);var c=0===i._translucentFunctions.length||void 0;if(s=o(s,c),s=o(e.translucent,s),a(s))if("function"==typeof s){var h=function(){return s(i)};i._translucentFunctions.push(h)}else i._translucentFunctions.push(s)}function R(e,t,i,r){if(a(e))for(var n in e)if(e.hasOwnProperty(n)){var o=t.indexOf(n)!==-1;(r&&!o||!r&&o)&&i(n,t)}}function O(e,t){}function N(e,t){}function L(e){var t=e._template,i=t.uniforms,r=t.materials,n=t.components;R(t,q,O,!0),R(n,j,O,!0);var o=[];for(var a in r)r.hasOwnProperty(a)&&o.push(a);R(i,o,N,!1)}function B(e){var t=e._template.components,i=e._template.source;if(a(i))e.shaderSource+=i+"\n";else{if(e.shaderSource+="czm_material czm_getMaterial(czm_materialInput materialInput)\n{\n",e.shaderSource+="czm_material material = czm_getDefaultMaterial(materialInput);\n",a(t))for(var r in t)t.hasOwnProperty(r)&&(e.shaderSource+="material."+r+" = "+t[r]+";\n");e.shaderSource+="return material;\n}\n"}}function F(e){var t;return function(i,r){var n=i.uniforms,o=n[e],s=t!==o;t=o;var l,u,c=i._textures[e];if(o instanceof HTMLVideoElement)if(o.readyState>=2){if(s&&a(c)&&(c!==r.defaultTexture&&c.destroy(),c=void 0),!a(c)||c===r.defaultTexture)return c=new _({context:r,source:o}),void(i._textures[e]=c);c.copyFrom(o)}else a(c)||(i._textures[e]=r.defaultTexture);else{if(o instanceof _&&o!==c){i._texturePaths[e]=void 0;var d=i._textures[e];return d!==i._defaultTexture&&d.destroy(),i._textures[e]=o,l=e+"Dimensions",void(n.hasOwnProperty(l)&&(u=n[l],u.x=o._width,u.y=o._height))}a(c)||(i._texturePaths[e]=void 0,a(i._defaultTexture)||(i._defaultTexture=r.defaultTexture),c=i._textures[e]=i._defaultTexture,l=e+"Dimensions",n.hasOwnProperty(l)&&(u=n[l],u.x=c._width,u.y=c._height)),o!==M.DefaultImageId&&o!==i._texturePaths[e]&&("string"==typeof o?D(h(o),function(t){i._loadedImages.push({id:e,image:t})}):o instanceof HTMLCanvasElement&&i._loadedImages.push({id:e,image:o}),i._texturePaths[e]=o)}}}function V(e){return function(t,i){var r=t.uniforms[e];if(r instanceof f){var n=t._textures[e];return n!==t._defaultTexture&&n.destroy(),t._texturePaths[e]=void 0,void(t._textures[e]=r)}if(a(t._textures[e])||(t._texturePaths[e]=void 0,t._textures[e]=i.defaultCubeMap),r!==M.DefaultCubeMapId){var o=r.positiveX+r.negativeX+r.positiveY+r.negativeY+r.positiveZ+r.negativeZ;if(o!==t._texturePaths[e]){var s=[h(r.positiveX),h(r.negativeX),h(r.positiveY),h(r.negativeY),h(r.positiveZ),h(r.negativeZ)];D.all(s).then(function(i){t._loadedCubeMaps.push({id:e,images:i})}),t._texturePaths[e]=o}}}}function k(e){var t=e._template.uniforms;for(var i in t)t.hasOwnProperty(i)&&z(e,i)}function z(e,t){var i,r=(e._strict,e._template.uniforms),n=r[t],o=U(n);if("channels"===o)i=W(e,t,n,!1);else{if("sampler2D"===o){var a=t+"Dimensions";H(e,a)>0&&(r[a]={type:"ivec3",x:1,y:1},z(e,a))}var s=new RegExp("uniform\\s+"+o+"\\s+"+t+"\\s*;");if(!s.test(e.shaderSource)){var l="uniform "+o+" "+t+";";e.shaderSource=l+e.shaderSource}var u=t+"_"+e._count++;if(i=W(e,t,u),e.uniforms[t]=n,"sampler2D"===o)e._uniforms[u]=function(){return e._textures[t]},e._updateFunctions.push(F(t));else if("samplerCube"===o)e._uniforms[u]=function(){return e._textures[t]},e._updateFunctions.push(V(t));else if(o.indexOf("mat")!==-1){var c=new Y[o];e._uniforms[u]=function(){return Y[o].fromColumnMajorArray(e.uniforms[t],c)}}else e._uniforms[u]=function(){return e.uniforms[t]}}}function U(e){var t=e.type;if(!a(t)){var i=typeof e;if("number"===i)t="float";else if("boolean"===i)t="bool";else if("string"===i||e instanceof HTMLCanvasElement)t=/^([rgba]){1,4}$/i.test(e)?"channels":e===M.DefaultCubeMapId?"samplerCube":"sampler2D";else if("object"===i)if(c(e))4!==e.length&&9!==e.length&&16!==e.length||(t="mat"+Math.sqrt(e.length));else{var r=0;for(var n in e)e.hasOwnProperty(n)&&(r+=1);r>=2&&r<=4?t="vec"+r:6===r&&(t="samplerCube")}}return t}function G(e){var t=e._strict,i=e._template.materials;for(var n in i)if(i.hasOwnProperty(n)){var o=new M({strict:t,fabric:i[n],count:e._count});e._count=o._count,e._uniforms=r(e._uniforms,o._uniforms,!0),e.materials[n]=o,e._translucentFunctions=e._translucentFunctions.concat(o._translucentFunctions);var a="czm_getMaterial",s=a+"_"+e._count++;W(o,a,s),e.shaderSource=o.shaderSource+e.shaderSource;var l=s+"(materialInput)";W(e,n,l)}}function W(e,t,i,r){r=o(r,!0);var n=0,a="([\\w])?",s="([\\w"+(r?".":"")+"])?",l=new RegExp(s+t+a,"g");return e.shaderSource=e.shaderSource.replace(l,function(e,t,r){return t||r?e:(n+=1,i)}),n}function H(e,t,i){return W(e,t,t,i)}M._uniformList={},M.fromType=function(e,t){var i=new M({fabric:{type:e}});if(a(t))for(var r in t)t.hasOwnProperty(r)&&(i.uniforms[r]=t[r]);return i},M.prototype.isTranslucent=function(){if(a(this.translucent))return"function"==typeof this.translucent?this.translucent():this.translucent;for(var e=!0,t=this._translucentFunctions,i=t.length,r=0;r<i;++r){var n=t[r];if(e="function"==typeof n?e&&n():e&&n,!e)break}return e},M.prototype.update=function(e){var t,i,r=this._loadedImages,n=r.length;for(t=0;t<n;++t){var o=r[t];i=o.id;var a=o.image,s=new _({context:e,source:a});this._textures[i]=s;var l=i+"Dimensions";if(this.uniforms.hasOwnProperty(l)){var u=this.uniforms[l];u.x=s._width,u.y=s._height}}r.length=0;var c=this._loadedCubeMaps;for(n=c.length,t=0;t<n;++t){var h=c[t];i=h.id;var d=h.images,p=new f({context:e,source:{positiveX:d[0],negativeX:d[1],positiveY:d[2],negativeY:d[3],positiveZ:d[4],negativeZ:d[5]}});this._textures[i]=p}c.length=0;var m=this._updateFunctions;for(n=m.length,t=0;t<n;++t)m[t](this,e);var g=this.materials;for(var v in g)g.hasOwnProperty(v)&&g[v].update(e)},M.prototype.isDestroyed=function(){return!1},M.prototype.destroy=function(){var e=this._textures;for(var t in e)if(e.hasOwnProperty(t)){var i=e[t];i!==this._defaultTexture&&i.destroy()}var r=this.materials;for(var n in r)r.hasOwnProperty(n)&&r[n].destroy();return l(this)};var q=["type","materials","uniforms","components","source"],j=["diffuse","specular","shininess","normal","emission","alpha"],Y={mat2:d,mat3:p,mat4:m};return M._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}},M.DefaultImageId="czm_defaultImage",M.DefaultCubeMapId="czm_defaultCubeMap",M.ColorType="Color",M._materialCache.addMaterial(M.ColorType,{fabric:{type:M.ColorType,uniforms:{color:new i(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}}),M.ImageType="Image",M._materialCache.addMaterial(M.ImageType,{fabric:{type:M.ImageType,uniforms:{image:M.DefaultImageId,repeat:new e(1,1),color:new i(1,1,1,1)},components:{diffuse:"texture2D(image, fract(repeat * materialInput.st)).rgb * color.rgb",alpha:"texture2D(image, fract(repeat * materialInput.st)).a * color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}}),M.DiffuseMapType="DiffuseMap",M._materialCache.addMaterial(M.DiffuseMapType,{fabric:{type:M.DiffuseMapType,uniforms:{image:M.DefaultImageId,channels:"rgb",repeat:new e(1,1)},components:{diffuse:"texture2D(image, fract(repeat * materialInput.st)).channels"}},translucent:!1}),M.AlphaMapType="AlphaMap",M._materialCache.addMaterial(M.AlphaMapType,{fabric:{type:M.AlphaMapType,uniforms:{image:M.DefaultImageId,channel:"a",repeat:new e(1,1)},components:{alpha:"texture2D(image, fract(repeat * materialInput.st)).channel"}},translucent:!0}),M.SpecularMapType="SpecularMap",M._materialCache.addMaterial(M.SpecularMapType,{fabric:{type:M.SpecularMapType,uniforms:{image:M.DefaultImageId,channel:"r",repeat:new e(1,1)},components:{specular:"texture2D(image, fract(repeat * materialInput.st)).channel"}},translucent:!1}),M.EmissionMapType="EmissionMap",M._materialCache.addMaterial(M.EmissionMapType,{fabric:{type:M.EmissionMapType,uniforms:{image:M.DefaultImageId,channels:"rgb",repeat:new e(1,1)},components:{emission:"texture2D(image, fract(repeat * materialInput.st)).channels"}},translucent:!1}),M.BumpMapType="BumpMap",M._materialCache.addMaterial(M.BumpMapType,{fabric:{type:M.BumpMapType,uniforms:{image:M.DefaultImageId,channel:"r",strength:.8,repeat:new e(1,1)},source:g},translucent:!1}),M.NormalMapType="NormalMap",M._materialCache.addMaterial(M.NormalMapType,{fabric:{type:M.NormalMapType,uniforms:{image:M.DefaultImageId,channels:"rgb",strength:.8,repeat:new e(1,1)},source:S},translucent:!1}),M.GridType="Grid",M._materialCache.addMaterial(M.GridType,{fabric:{type:M.GridType,uniforms:{color:new i(0,1,0,1),cellAlpha:.1,lineCount:new e(8,8),lineThickness:new e(1,1),lineOffset:new e(0,0)},source:w},translucent:function(e){var t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}}),M.StripeType="Stripe",M._materialCache.addMaterial(M.StripeType,{fabric:{type:M.StripeType,uniforms:{horizontal:!0,evenColor:new i(1,1,1,.5),oddColor:new i(0,0,1,.5),offset:0,repeat:5},source:A},translucent:function(e){var t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<0}}),M.CheckerboardType="Checkerboard",M._materialCache.addMaterial(M.CheckerboardType,{fabric:{type:M.CheckerboardType,uniforms:{lightColor:new i(1,1,1,.5),darkColor:new i(0,0,0,.5),repeat:new e(5,5)},source:v},translucent:function(e){var t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<0}}),M.DotType="Dot",M._materialCache.addMaterial(M.DotType,{fabric:{type:M.DotType,uniforms:{lightColor:new i(1,1,0,.75),darkColor:new i(0,1,1,.75),repeat:new e(5,5)},source:y},translucent:function(e){var t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<0}}),M.WaterType="Water",M._materialCache.addMaterial(M.WaterType,{fabric:{type:M.WaterType,uniforms:{baseWaterColor:new i(.2,.3,.6,1),blendColor:new i(0,1,.699,1),specularMap:M.DefaultImageId,normalMap:M.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:P},translucent:function(e){var t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<0}}),M.RimLightingType="RimLighting",M._materialCache.addMaterial(M.RimLightingType,{fabric:{type:M.RimLightingType,uniforms:{color:new i(1,0,0,.7),rimColor:new i(1,1,1,.4),width:.3},source:x},translucent:function(e){var t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<0}}),M.FadeType="Fade",M._materialCache.addMaterial(M.FadeType,{fabric:{type:M.FadeType,uniforms:{fadeInColor:new i(1,0,0,1),fadeOutColor:new i(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new e(.5,.5)},source:C},translucent:function(e){var t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<1}}),M.PolylineArrowType="PolylineArrow",M._materialCache.addMaterial(M.PolylineArrowType,{fabric:{type:M.PolylineArrowType,uniforms:{color:new i(1,1,1,1)},source:E},translucent:!0}),M.PolylineGlowType="PolylineGlow",M._materialCache.addMaterial(M.PolylineGlowType,{fabric:{type:M.PolylineGlowType,uniforms:{color:new i(0,.5,1,1),glowPower:.25},source:b},translucent:!0}),M.PolylineOutlineType="PolylineOutline",M._materialCache.addMaterial(M.PolylineOutlineType,{fabric:{type:M.PolylineOutlineType,uniforms:{color:new i(1,1,1,1),outlineColor:new i(1,0,0,1),outlineWidth:1},source:T},translucent:function(e){var t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}}),M}),i("Scene/MaterialAppearance",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/freezeObject","../Core/VertexFormat","../Shaders/Appearances/AllMaterialAppearanceFS","../Shaders/Appearances/AllMaterialAppearanceVS","../Shaders/Appearances/BasicMaterialAppearanceFS","../Shaders/Appearances/BasicMaterialAppearanceVS","../Shaders/Appearances/TexturedMaterialAppearanceFS","../Shaders/Appearances/TexturedMaterialAppearanceVS","./Appearance","./Material"],function(e,t,i,r,n,o,a,s,l,u,c,h,d){"use strict";function p(i){i=e(i,e.EMPTY_OBJECT);var r=e(i.translucent,!0),n=e(i.closed,!1),o=e(i.materialSupport,p.MaterialSupport.TEXTURED);this.material=t(i.material)?i.material:d.fromType(d.ColorType),this.translucent=r,this._vertexShaderSource=e(i.vertexShaderSource,o.vertexShaderSource),this._fragmentShaderSource=e(i.fragmentShaderSource,o.fragmentShaderSource),this._renderState=h.getDefaultRenderState(r,n,i.renderState),this._closed=n,this._materialSupport=o,this._vertexFormat=o.vertexFormat, +this._flat=e(i.flat,!1),this._faceForward=e(i.faceForward,!n)}return i(p.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},materialSupport:{get:function(){return this._materialSupport}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}}),p.prototype.getFragmentShaderSource=h.prototype.getFragmentShaderSource,p.prototype.isTranslucent=h.prototype.isTranslucent,p.prototype.getRenderState=h.prototype.getRenderState,p.MaterialSupport={BASIC:r({vertexFormat:n.POSITION_AND_NORMAL,vertexShaderSource:l,fragmentShaderSource:s}),TEXTURED:r({vertexFormat:n.POSITION_NORMAL_AND_ST,vertexShaderSource:c,fragmentShaderSource:u}),ALL:r({vertexFormat:n.ALL,vertexShaderSource:a,fragmentShaderSource:o})},p}),i("Shaders/Appearances/PerInstanceColorAppearanceFS",[],function(){"use strict";return"varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec4 v_color;\nvoid main()\n{\nvec3 positionToEyeEC = -v_positionEC;\nvec3 normalEC = normalize(v_normalEC);\n#ifdef FACE_FORWARD\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nczm_material material = czm_getDefaultMaterial(materialInput);\nmaterial.diffuse = v_color.rgb;\nmaterial.alpha = v_color.a;\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\n}\n"}),i("Shaders/Appearances/PerInstanceColorAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute vec4 color;\nattribute float batchId;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec4 v_color;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_normalEC = czm_normal * normal;\nv_color = color;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),i("Shaders/Appearances/PerInstanceFlatColorAppearanceFS",[],function(){"use strict";return"varying vec4 v_color;\nvoid main()\n{\ngl_FragColor = v_color;\n}\n"}),i("Shaders/Appearances/PerInstanceFlatColorAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec4 color;\nattribute float batchId;\nvarying vec4 v_color;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_color = color;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),i("Scene/PerInstanceColorAppearance",["../Core/defaultValue","../Core/defineProperties","../Core/VertexFormat","../Shaders/Appearances/PerInstanceColorAppearanceFS","../Shaders/Appearances/PerInstanceColorAppearanceVS","../Shaders/Appearances/PerInstanceFlatColorAppearanceFS","../Shaders/Appearances/PerInstanceFlatColorAppearanceVS","./Appearance"],function(e,t,i,r,n,o,a,s){"use strict";function l(t){t=e(t,e.EMPTY_OBJECT);var i=e(t.translucent,!0),u=e(t.closed,!1),c=e(t.flat,!1),h=c?a:n,d=c?o:r,p=c?l.FLAT_VERTEX_FORMAT:l.VERTEX_FORMAT;this.material=void 0,this.translucent=i,this._vertexShaderSource=e(t.vertexShaderSource,h),this._fragmentShaderSource=e(t.fragmentShaderSource,d),this._renderState=s.getDefaultRenderState(i,u,t.renderState),this._closed=u,this._vertexFormat=p,this._flat=c,this._faceForward=e(t.faceForward,!u)}return t(l.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}}),l.VERTEX_FORMAT=i.POSITION_AND_NORMAL,l.FLAT_VERTEX_FORMAT=i.POSITION_ONLY,l.prototype.getFragmentShaderSource=s.prototype.getFragmentShaderSource,l.prototype.isTranslucent=s.prototype.isTranslucent,l.prototype.getRenderState=s.prototype.getRenderState,l}),i("Renderer/BufferUsage",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={STREAM_DRAW:t.STREAM_DRAW,STATIC_DRAW:t.STATIC_DRAW,DYNAMIC_DRAW:t.DYNAMIC_DRAW,validate:function(e){return e===i.STREAM_DRAW||e===i.STATIC_DRAW||e===i.DYNAMIC_DRAW}};return e(i)}),i("Renderer/DrawCommand",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/PrimitiveType"],function(e,t,i,r){"use strict";function n(t){t=e(t,e.EMPTY_OBJECT),this._boundingVolume=t.boundingVolume,this._orientedBoundingBox=t.orientedBoundingBox,this._cull=e(t.cull,!0),this._modelMatrix=t.modelMatrix,this._primitiveType=e(t.primitiveType,r.TRIANGLES),this._vertexArray=t.vertexArray,this._count=t.count,this._offset=e(t.offset,0),this._instanceCount=e(t.instanceCount,0),this._shaderProgram=t.shaderProgram,this._uniformMap=t.uniformMap,this._renderState=t.renderState,this._framebuffer=t.framebuffer,this._pass=t.pass,this._executeInClosestFrustum=e(t.executeInClosestFrustum,!1),this._owner=t.owner,this._debugShowBoundingVolume=e(t.debugShowBoundingVolume,!1),this._debugOverlappingFrustums=0,this._castShadows=e(t.castShadows,!1),this._receiveShadows=e(t.receiveShadows,!1),this.dirty=!0,this.lastDirtyTime=0,this.derivedCommands={}}return i(n.prototype,{boundingVolume:{get:function(){return this._boundingVolume},set:function(e){this._boundingVolume!==e&&(this._boundingVolume=e,this.dirty=!0)}},orientedBoundingBox:{get:function(){return this._orientedBoundingBox},set:function(e){this._orientedBoundingBox!==e&&(this._orientedBoundingBox=e,this.dirty=!0)}},cull:{get:function(){return this._cull},set:function(e){this._cull!==e&&(this._cull=e,this.dirty=!0)}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix!==e&&(this._modelMatrix=e,this.dirty=!0)}},primitiveType:{get:function(){return this._primitiveType},set:function(e){this._primitiveType!==e&&(this._primitiveType=e,this.dirty=!0)}},vertexArray:{get:function(){return this._vertexArray},set:function(e){this._vertexArray!==e&&(this._vertexArray=e,this.dirty=!0)}},count:{get:function(){return this._count},set:function(e){this._count!==e&&(this._count=e,this.dirty=!0)}},offset:{get:function(){return this._offset},set:function(e){this._offset!==e&&(this._offset=e,this.dirty=!0)}},instanceCount:{get:function(){return this._instanceCount},set:function(e){this._instanceCount!==e&&(this._instanceCount=e,this.dirty=!0)}},shaderProgram:{get:function(){return this._shaderProgram},set:function(e){this._shaderProgram!==e&&(this._shaderProgram=e,this.dirty=!0)}},castShadows:{get:function(){return this._castShadows},set:function(e){this._castShadows!==e&&(this._castShadows=e,this.dirty=!0)}},receiveShadows:{get:function(){return this._receiveShadows},set:function(e){this._receiveShadows!==e&&(this._receiveShadows=e,this.dirty=!0)}},uniformMap:{get:function(){return this._uniformMap},set:function(e){this._uniformMap!==e&&(this._uniformMap=e,this.dirty=!0)}},renderState:{get:function(){return this._renderState},set:function(e){this._renderState!==e&&(this._renderState=e,this.dirty=!0)}},framebuffer:{get:function(){return this._framebuffer},set:function(e){this._framebuffer!==e&&(this._framebuffer=e,this.dirty=!0)}},pass:{get:function(){return this._pass},set:function(e){this._pass!==e&&(this._pass=e,this.dirty=!0)}},executeInClosestFrustum:{get:function(){return this._executeInClosestFrustum},set:function(e){this._executeInClosestFrustum!==e&&(this._executeInClosestFrustum=e,this.dirty=!0)}},owner:{get:function(){return this._owner},set:function(e){this._owner!==e&&(this._owner=e,this.dirty=!0)}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolume=e,this.dirty=!0)}},debugOverlappingFrustums:{get:function(){return this._debugOverlappingFrustums},set:function(e){this._debugOverlappingFrustums!==e&&(this._debugOverlappingFrustums=e,this.dirty=!0)}}}),n.shallowClone=function(e,i){if(t(e))return t(i)||(i=new n),i._boundingVolume=e._boundingVolume,i._orientedBoundingBox=e._orientedBoundingBox,i._cull=e._cull,i._modelMatrix=e._modelMatrix,i._primitiveType=e._primitiveType,i._vertexArray=e._vertexArray,i._count=e._count,i._offset=e._offset,i._instanceCount=e._instanceCount,i._shaderProgram=e._shaderProgram,i._uniformMap=e._uniformMap,i._renderState=e._renderState,i._framebuffer=e._framebuffer,i._pass=e._pass,i._executeInClosestFrustum=e._executeInClosestFrustum,i._owner=e._owner,i._debugShowBoundingVolume=e._debugShowBoundingVolume,i._debugOverlappingFrustums=e._debugOverlappingFrustums,i._castShadows=e._castShadows,i._receiveShadows=e._receiveShadows,i.dirty=!0,i.lastDirtyTime=0,i},n.prototype.execute=function(e,t){e.draw(this,t)},n}),i("Renderer/Pass",["../Core/freezeObject"],function(e){"use strict";var t={ENVIRONMENT:0,COMPUTE:1,GLOBE:2,GROUND:3,OPAQUE:4,TRANSLUCENT:5,OVERLAY:6,NUMBER_OF_PASSES:7};return e(t)}),i("Renderer/RenderState",["../Core/BoundingRectangle","../Core/Color","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/WebGLConstants","../Core/WindingOrder","./ContextLimits"],function(e,t,i,r,n,o,a,s){"use strict";function l(n){var s=i(n,{}),l=i(s.cull,{}),u=i(s.polygonOffset,{}),c=i(s.scissorTest,{}),h=i(c.rectangle,{}),d=i(s.depthRange,{}),p=i(s.depthTest,{}),m=i(s.colorMask,{}),f=i(s.blending,{}),_=i(f.color,{}),g=i(s.stencilTest,{}),v=i(g.frontOperation,{}),y=i(g.backOperation,{}),C=i(s.sampleCoverage,{}),w=s.viewport;this.frontFace=i(s.frontFace,a.COUNTER_CLOCKWISE),this.cull={enabled:i(l.enabled,!1),face:i(l.face,o.BACK)},this.lineWidth=i(s.lineWidth,1),this.polygonOffset={enabled:i(u.enabled,!1),factor:i(u.factor,0),units:i(u.units,0)},this.scissorTest={enabled:i(c.enabled,!1),rectangle:e.clone(h)},this.depthRange={near:i(d.near,0),far:i(d.far,1)},this.depthTest={enabled:i(p.enabled,!1),func:i(p.func,o.LESS)},this.colorMask={red:i(m.red,!0),green:i(m.green,!0),blue:i(m.blue,!0),alpha:i(m.alpha,!0)},this.depthMask=i(s.depthMask,!0),this.stencilMask=i(s.stencilMask,-1),this.blending={enabled:i(f.enabled,!1),color:new t(i(_.red,0),i(_.green,0),i(_.blue,0),i(_.alpha,0)),equationRgb:i(f.equationRgb,o.FUNC_ADD),equationAlpha:i(f.equationAlpha,o.FUNC_ADD),functionSourceRgb:i(f.functionSourceRgb,o.ONE),functionSourceAlpha:i(f.functionSourceAlpha,o.ONE),functionDestinationRgb:i(f.functionDestinationRgb,o.ZERO),functionDestinationAlpha:i(f.functionDestinationAlpha,o.ZERO)},this.stencilTest={enabled:i(g.enabled,!1),frontFunction:i(g.frontFunction,o.ALWAYS),backFunction:i(g.backFunction,o.ALWAYS),reference:i(g.reference,0),mask:i(g.mask,-1),frontOperation:{fail:i(v.fail,o.KEEP),zFail:i(v.zFail,o.KEEP),zPass:i(v.zPass,o.KEEP)},backOperation:{fail:i(y.fail,o.KEEP),zFail:i(y.zFail,o.KEEP),zPass:i(y.zPass,o.KEEP)}},this.sampleCoverage={enabled:i(C.enabled,!1),value:i(C.value,1),invert:i(C.invert,!1)},this.viewport=r(w)?new e(w.x,w.y,w.width,w.height):void 0,this.id=0,this._applyFunctions=[]}function u(e,t,i){i?e.enable(t):e.disable(t)}function c(e,t){e.frontFace(t.frontFace)}function h(e,t){var i=t.cull,r=i.enabled;u(e,e.CULL_FACE,r),r&&e.cullFace(i.face)}function d(e,t){e.lineWidth(t.lineWidth)}function p(e,t){var i=t.polygonOffset,r=i.enabled;u(e,e.POLYGON_OFFSET_FILL,r),r&&e.polygonOffset(i.factor,i.units)}function m(e,t,i){var n=t.scissorTest,o=r(i.scissorTest)?i.scissorTest.enabled:n.enabled;if(u(e,e.SCISSOR_TEST,o),o){var a=r(i.scissorTest)?i.scissorTest.rectangle:n.rectangle;e.scissor(a.x,a.y,a.width,a.height)}}function f(e,t){var i=t.depthRange;e.depthRange(i.near,i.far)}function _(e,t){var i=t.depthTest,r=i.enabled;u(e,e.DEPTH_TEST,r),r&&e.depthFunc(i.func)}function g(e,t){var i=t.colorMask;e.colorMask(i.red,i.green,i.blue,i.alpha)}function v(e,t){e.depthMask(t.depthMask)}function y(e,t){e.stencilMask(t.stencilMask)}function C(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}function w(e,t,i){var n=t.blending,o=r(i.blendingEnabled)?i.blendingEnabled:n.enabled;u(e,e.BLEND,o),o&&(C(e,n.color),e.blendEquationSeparate(n.equationRgb,n.equationAlpha),e.blendFuncSeparate(n.functionSourceRgb,n.functionDestinationRgb,n.functionSourceAlpha,n.functionDestinationAlpha))}function S(e,t){var i=t.stencilTest,r=i.enabled;if(u(e,e.STENCIL_TEST,r),r){var n=i.frontFunction,o=i.backFunction,a=i.reference,s=i.mask;e.stencilFunc(n,a,s),e.stencilFuncSeparate(e.BACK,o,a,s),e.stencilFuncSeparate(e.FRONT,n,a,s);var l=i.frontOperation,c=l.fail,h=l.zFail,d=l.zPass;e.stencilOpSeparate(e.FRONT,c,h,d);var p=i.backOperation,m=p.fail,f=p.zFail,_=p.zPass;e.stencilOpSeparate(e.BACK,m,f,_)}}function E(e,t){var i=t.sampleCoverage,r=i.enabled;u(e,e.SAMPLE_COVERAGE,r),r&&e.sampleCoverage(i.value,i.invert)}function b(e,t,n){var o=i(t.viewport,n.viewport);r(o)||(o=P,o.width=n.context.drawingBufferWidth,o.height=n.context.drawingBufferHeight),n.context.uniformState.viewport=o,e.viewport(o.x,o.y,o.width,o.height)}function T(e,t){var i=[];return e.frontFace!==t.frontFace&&i.push(c),e.cull.enabled===t.cull.enabled&&e.cull.face===t.cull.face||i.push(h),e.lineWidth!==t.lineWidth&&i.push(d),e.polygonOffset.enabled===t.polygonOffset.enabled&&e.polygonOffset.factor===t.polygonOffset.factor&&e.polygonOffset.units===t.polygonOffset.units||i.push(p),e.depthRange.near===t.depthRange.near&&e.depthRange.far===t.depthRange.far||i.push(f),e.depthTest.enabled===t.depthTest.enabled&&e.depthTest.func===t.depthTest.func||i.push(_),e.colorMask.red===t.colorMask.red&&e.colorMask.green===t.colorMask.green&&e.colorMask.blue===t.colorMask.blue&&e.colorMask.alpha===t.colorMask.alpha||i.push(g),e.depthMask!==t.depthMask&&i.push(v),e.stencilMask!==t.stencilMask&&i.push(y),e.stencilTest.enabled===t.stencilTest.enabled&&e.stencilTest.frontFunction===t.stencilTest.frontFunction&&e.stencilTest.backFunction===t.stencilTest.backFunction&&e.stencilTest.reference===t.stencilTest.reference&&e.stencilTest.mask===t.stencilTest.mask&&e.stencilTest.frontOperation.fail===t.stencilTest.frontOperation.fail&&e.stencilTest.frontOperation.zFail===t.stencilTest.frontOperation.zFail&&e.stencilTest.backOperation.fail===t.stencilTest.backOperation.fail&&e.stencilTest.backOperation.zFail===t.stencilTest.backOperation.zFail&&e.stencilTest.backOperation.zPass===t.stencilTest.backOperation.zPass||i.push(S),e.sampleCoverage.enabled===t.sampleCoverage.enabled&&e.sampleCoverage.value===t.sampleCoverage.value&&e.sampleCoverage.invert===t.sampleCoverage.invert||i.push(E),i}var x=0,A={};l.fromCache=function(e){var t=JSON.stringify(e),i=A[t];if(r(i))return++i.referenceCount,i.state;var n=new l(e),o=JSON.stringify(n);return i=A[o],r(i)||(n.id=x++,i={referenceCount:0,state:n},A[o]=i),++i.referenceCount,A[t]={referenceCount:1,state:i.state},i.state},l.removeFromCache=function(e){var t=new l(e),i=JSON.stringify(t),n=A[i],o=JSON.stringify(e),a=A[o];r(a)&&(--a.referenceCount,0===a.referenceCount&&(delete A[o],r(n)&&--n.referenceCount)),r(n)&&0===n.referenceCount&&delete A[i]},l.getCache=function(){return A},l.clearCache=function(){A={}};var P=new e;return l.apply=function(e,t,i){c(e,t),h(e,t),d(e,t),p(e,t),f(e,t),_(e,t),g(e,t),v(e,t),y(e,t),S(e,t),E(e,t),m(e,t,i),w(e,t,i),b(e,t,i)},l.partialApply=function(e,t,i,n,o,a){if(t!==i){var s=i._applyFunctions[t.id];r(s)||(s=T(t,i),i._applyFunctions[t.id]=s);for(var l=s.length,u=0;u<l;++u)s[u](e,i)}var c=r(n.scissorTest)?n.scissorTest:t.scissorTest,h=r(o.scissorTest)?o.scissorTest:i.scissorTest;(c!==h||a)&&m(e,i,o);var d=r(n.blendingEnabled)?n.blendingEnabled:t.blending.enabled,p=r(o.blendingEnabled)?o.blendingEnabled:i.blending.enabled;(d!==p||p&&t.blending!==i.blending)&&w(e,i,o),t===i&&n===o&&n.context===o.context||b(e,i,o)},l.getState=function(i){return{frontFace:i.frontFace,cull:{enabled:i.cull.enabled,face:i.cull.face},lineWidth:i.lineWidth,polygonOffset:{enabled:i.polygonOffset.enabled,factor:i.polygonOffset.factor,units:i.polygonOffset.units},scissorTest:{enabled:i.scissorTest.enabled,rectangle:e.clone(i.scissorTest.rectangle)},depthRange:{near:i.depthRange.near,far:i.depthRange.far},depthTest:{enabled:i.depthTest.enabled,func:i.depthTest.func},colorMask:{red:i.colorMask.red,green:i.colorMask.green,blue:i.colorMask.blue,alpha:i.colorMask.alpha},depthMask:i.depthMask,stencilMask:i.stencilMask,blending:{enabled:i.blending.enabled,color:t.clone(i.blending.color),equationRgb:i.blending.equationRgb,equationAlpha:i.blending.equationAlpha,functionSourceRgb:i.blending.functionSourceRgb,functionSourceAlpha:i.blending.functionSourceAlpha,functionDestinationRgb:i.blending.functionDestinationRgb,functionDestinationAlpha:i.blending.functionDestinationAlpha},stencilTest:{enabled:i.stencilTest.enabled,frontFunction:i.stencilTest.frontFunction,backFunction:i.stencilTest.backFunction,reference:i.stencilTest.reference,mask:i.stencilTest.mask,frontOperation:{fail:i.stencilTest.frontOperation.fail,zFail:i.stencilTest.frontOperation.zFail,zPass:i.stencilTest.frontOperation.zPass},backOperation:{fail:i.stencilTest.backOperation.fail,zFail:i.stencilTest.backOperation.zFail,zPass:i.stencilTest.backOperation.zPass}},sampleCoverage:{enabled:i.sampleCoverage.enabled,value:i.sampleCoverage.value,invert:i.sampleCoverage.invert},viewport:r(i.viewport)?e.clone(i.viewport):void 0}},l}),i("Renderer/AutomaticUniforms",["../Core/Cartesian3","../Core/Matrix4","../Core/WebGLConstants"],function(e,t,i){"use strict";function r(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}var n=new e;if("undefined"==typeof WebGLRenderingContext)return{};var o={};o[i.FLOAT]="float",o[i.FLOAT_VEC2]="vec2",o[i.FLOAT_VEC3]="vec3",o[i.FLOAT_VEC4]="vec4",o[i.INT]="int",o[i.INT_VEC2]="ivec2",o[i.INT_VEC3]="ivec3",o[i.INT_VEC4]="ivec4",o[i.BOOL]="bool",o[i.BOOL_VEC2]="bvec2",o[i.BOOL_VEC3]="bvec3",o[i.BOOL_VEC4]="bvec4",o[i.FLOAT_MAT2]="mat2",o[i.FLOAT_MAT3]="mat3",o[i.FLOAT_MAT4]="mat4",o[i.SAMPLER_2D]="sampler2D",o[i.SAMPLER_CUBE]="samplerCube",r.prototype.getDeclaration=function(e){var t="uniform "+o[this._datatype]+" "+e,i=this._size;return t+=1===i?";":"["+i.toString()+"];"};var a={czm_viewport:new r({size:1,datatype:i.FLOAT_VEC4,getValue:function(e){return e.viewportCartesian4}}),czm_viewportOrthographic:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.viewportOrthographic}}),czm_viewportTransformation:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.viewportTransformation}}),czm_globeDepthTexture:new r({size:1,datatype:i.SAMPLER_2D,getValue:function(e){return e.globeDepthTexture}}),czm_model:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.model}}),czm_inverseModel:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.inverseModel}}),czm_view:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.view}}),czm_view3D:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.view3D}}),czm_viewRotation:new r({size:1,datatype:i.FLOAT_MAT3,getValue:function(e){return e.viewRotation}}),czm_viewRotation3D:new r({size:1,datatype:i.FLOAT_MAT3,getValue:function(e){return e.viewRotation3D}}),czm_inverseView:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.inverseView}}),czm_inverseView3D:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.inverseView3D}}),czm_inverseViewRotation:new r({size:1,datatype:i.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation}}),czm_inverseViewRotation3D:new r({size:1,datatype:i.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation3D}}),czm_projection:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.projection}}),czm_inverseProjection:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.inverseProjection}}),czm_inverseProjectionOIT:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.inverseProjectionOIT}}),czm_infiniteProjection:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.infiniteProjection}}),czm_modelView:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.modelView}}),czm_modelView3D:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.modelView3D}}),czm_modelViewRelativeToEye:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.modelViewRelativeToEye}}),czm_inverseModelView:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.inverseModelView}}),czm_inverseModelView3D:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.inverseModelView3D}}),czm_viewProjection:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.viewProjection}}),czm_inverseViewProjection:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.inverseViewProjection}}),czm_modelViewProjection:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.modelViewProjection}}),czm_inverseModelViewProjection:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.modelViewInfiniteProjection}}),czm_normal:new r({size:1,datatype:i.FLOAT_MAT3,getValue:function(e){return e.normal}}),czm_normal3D:new r({size:1,datatype:i.FLOAT_MAT3,getValue:function(e){return e.normal3D}}),czm_inverseNormal:new r({size:1,datatype:i.FLOAT_MAT3,getValue:function(e){return e.inverseNormal}}),czm_inverseNormal3D:new r({size:1,datatype:i.FLOAT_MAT3,getValue:function(e){return e.inverseNormal3D}}),czm_eyeHeight2D:new r({size:1,datatype:i.FLOAT_VEC2,getValue:function(e){return e.eyeHeight2D}}),czm_entireFrustum:new r({size:1,datatype:i.FLOAT_VEC2,getValue:function(e){return e.entireFrustum}}),czm_currentFrustum:new r({size:1,datatype:i.FLOAT_VEC2,getValue:function(e){return e.currentFrustum}}),czm_frustumPlanes:new r({size:1,datatype:i.FLOAT_VEC4,getValue:function(e){return e.frustumPlanes}}),czm_sunPositionWC:new r({size:1,datatype:i.FLOAT_VEC3,getValue:function(e){return e.sunPositionWC}}),czm_sunPositionColumbusView:new r({size:1,datatype:i.FLOAT_VEC3,getValue:function(e){return e.sunPositionColumbusView}}),czm_sunDirectionEC:new r({size:1,datatype:i.FLOAT_VEC3,getValue:function(e){return e.sunDirectionEC}}),czm_sunDirectionWC:new r({size:1,datatype:i.FLOAT_VEC3,getValue:function(e){return e.sunDirectionWC}}),czm_moonDirectionEC:new r({size:1,datatype:i.FLOAT_VEC3,getValue:function(e){return e.moonDirectionEC}}),czm_encodedCameraPositionMCHigh:new r({size:1,datatype:i.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new r({size:1,datatype:i.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCLow}}),czm_viewerPositionWC:new r({size:1,datatype:i.FLOAT_VEC3,getValue:function(e){return t.getTranslation(e.inverseView,n)}}),czm_frameNumber:new r({size:1,datatype:i.FLOAT,getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new r({size:1,datatype:i.FLOAT,getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new r({size:1,datatype:i.FLOAT,getValue:function(e){return e.frameState.mode}}),czm_pass:new r({size:1,datatype:i.FLOAT,getValue:function(e){return e.pass}}),czm_temeToPseudoFixed:new r({size:1,datatype:i.FLOAT_MAT3,getValue:function(e){return e.temeToPseudoFixedMatrix}}),czm_resolutionScale:new r({size:1,datatype:i.FLOAT,getValue:function(e){return e.resolutionScale}}),czm_fogDensity:new r({size:1,datatype:i.FLOAT,getValue:function(e){return e.fogDensity}}),czm_imagerySplitPosition:new r({size:1,datatype:i.FLOAT,getValue:function(e){return e.imagerySplitPosition}}),czm_geometricToleranceOverMeter:new r({size:1,datatype:i.FLOAT,getValue:function(e){return e.geometricToleranceOverMeter}})};return a}),i("Renderer/createUniform",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Color","../Core/defined","../Core/DeveloperError","../Core/Matrix2","../Core/Matrix3","../Core/Matrix4","../Core/RuntimeError"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e,t,i,r){switch(t.type){case e.FLOAT:return new h(e,t,i,r);case e.FLOAT_VEC2:return new d(e,t,i,r);case e.FLOAT_VEC3:return new p(e,t,i,r);case e.FLOAT_VEC4:return new m(e,t,i,r);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new f(e,t,i,r);case e.INT:case e.BOOL:return new _(e,t,i,r);case e.INT_VEC2:case e.BOOL_VEC2:return new g(e,t,i,r);case e.INT_VEC3:case e.BOOL_VEC3:return new v(e,t,i,r);case e.INT_VEC4:case e.BOOL_VEC4:return new y(e,t,i,r);case e.FLOAT_MAT2:return new C(e,t,i,r);case e.FLOAT_MAT3:return new w(e,t,i,r);case e.FLOAT_MAT4:return new S(e,t,i,r);default:throw new u("Unrecognized uniform type: "+t.type+' for uniform "'+i+'".')}}function h(e,t,i,r){this.name=i,this.value=void 0,this._value=0,this._gl=e,this._location=r}function d(t,i,r,n){this.name=r,this.value=void 0,this._value=new e,this._gl=t,this._location=n}function p(e,t,i,r){this.name=i,this.value=void 0,this._value=void 0,this._gl=e,this._location=r}function m(e,t,i,r){this.name=i,this.value=void 0,this._value=void 0,this._gl=e,this._location=r}function f(e,t,i,r){this.name=i,this.value=void 0,this._gl=e,this._location=r,this.textureUnitIndex=void 0}function _(e,t,i,r){this.name=i,this.value=void 0,this._value=0,this._gl=e,this._location=r}function g(t,i,r,n){this.name=r,this.value=void 0,this._value=new e,this._gl=t,this._location=n}function v(e,i,r,n){this.name=r,this.value=void 0,this._value=new t,this._gl=e,this._location=n}function y(e,t,r,n){this.name=r,this.value=void 0,this._value=new i,this._gl=e,this._location=n}function C(e,t,i,r){this.name=i,this.value=void 0,this._value=new Float32Array(4),this._gl=e,this._location=r}function w(e,t,i,r){this.name=i,this.value=void 0,this._value=new Float32Array(9),this._gl=e,this._location=r}function S(e,t,i,r){this.name=i,this.value=void 0,this._value=new Float32Array(16),this._gl=e,this._location=r}return h.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1f(this._location,this.value))},d.prototype.set=function(){var t=this.value;e.equals(t,this._value)||(e.clone(t,this._value),this._gl.uniform2f(this._location,t.x,t.y))},p.prototype.set=function(){var e=this.value;n(e.red)?r.equals(e,this._value)||(this._value=r.clone(e,this._value),this._gl.uniform3f(this._location,e.red,e.green,e.blue)):n(e.x)&&(t.equals(e,this._value)||(this._value=t.clone(e,this._value),this._gl.uniform3f(this._location,e.x,e.y,e.z)))},m.prototype.set=function(){var e=this.value;n(e.red)?r.equals(e,this._value)||(this._value=r.clone(e,this._value),this._gl.uniform4f(this._location,e.red,e.green,e.blue,e.alpha)):n(e.x)&&(i.equals(e,this._value)||(this._value=i.clone(e,this._value),this._gl.uniform4f(this._location,e.x,e.y,e.z,e.w)))},f.prototype.set=function(){var e=this._gl;e.activeTexture(e.TEXTURE0+this.textureUnitIndex);var t=this.value;e.bindTexture(t._target,t._texture)},f.prototype._setSampler=function(e){return this.textureUnitIndex=e,this._gl.uniform1i(this._location,e),e+1},_.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1i(this._location,this.value))},g.prototype.set=function(){var t=this.value;e.equals(t,this._value)||(e.clone(t,this._value),this._gl.uniform2i(this._location,t.x,t.y))},v.prototype.set=function(){var e=this.value;t.equals(e,this._value)||(t.clone(e,this._value),this._gl.uniform3i(this._location,e.x,e.y,e.z))},y.prototype.set=function(){var e=this.value;i.equals(e,this._value)||(i.clone(e,this._value),this._gl.uniform4i(this._location,e.x,e.y,e.z,e.w))},C.prototype.set=function(){a.equalsArray(this.value,this._value,0)||(a.toArray(this.value,this._value),this._gl.uniformMatrix2fv(this._location,!1,this._value))},w.prototype.set=function(){s.equalsArray(this.value,this._value,0)||(s.toArray(this.value,this._value),this._gl.uniformMatrix3fv(this._location,!1,this._value))},S.prototype.set=function(){l.equalsArray(this.value,this._value,0)||(l.toArray(this.value,this._value),this._gl.uniformMatrix4fv(this._location,!1,this._value))},c}),i("Renderer/createUniformArray",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Color","../Core/defined","../Core/DeveloperError","../Core/Matrix2","../Core/Matrix3","../Core/Matrix4","../Core/RuntimeError"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e,t,i,r){switch(t.type){case e.FLOAT:return new h(e,t,i,r);case e.FLOAT_VEC2:return new d(e,t,i,r);case e.FLOAT_VEC3:return new p(e,t,i,r);case e.FLOAT_VEC4:return new m(e,t,i,r);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new f(e,t,i,r);case e.INT:case e.BOOL:return new _(e,t,i,r);case e.INT_VEC2:case e.BOOL_VEC2:return new g(e,t,i,r);case e.INT_VEC3:case e.BOOL_VEC3:return new v(e,t,i,r);case e.INT_VEC4:case e.BOOL_VEC4:return new y(e,t,i,r);case e.FLOAT_MAT2:return new C(e,t,i,r);case e.FLOAT_MAT3:return new w(e,t,i,r);case e.FLOAT_MAT4:return new S(e,t,i,r);default:throw new u("Unrecognized uniform type: "+t.type+' for uniform "'+i+'".')}}function h(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Float32Array(n),this._gl=e,this._location=r[0]}function d(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Float32Array(2*n),this._gl=e,this._location=r[0]}function p(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Float32Array(3*n),this._gl=e,this._location=r[0]}function m(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Float32Array(4*n),this._gl=e,this._location=r[0]}function f(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Float32Array(n),this._gl=e,this._locations=r,this.textureUnitIndex=void 0}function _(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Int32Array(n),this._gl=e,this._location=r[0]}function g(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Int32Array(2*n),this._gl=e,this._location=r[0]}function v(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Int32Array(3*n),this._gl=e,this._location=r[0]}function y(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Int32Array(4*n),this._gl=e,this._location=r[0]}function C(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Float32Array(4*n),this._gl=e,this._location=r[0]}function w(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Float32Array(9*n),this._gl=e,this._location=r[0]}function S(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Float32Array(16*n),this._gl=e,this._location=r[0]}return h.prototype.set=function(){for(var e=this.value,t=e.length,i=this._value,r=!1,n=0;n<t;++n){var o=e[n];o!==i[n]&&(i[n]=o,r=!0)}r&&this._gl.uniform1fv(this._location,i)},d.prototype.set=function(){for(var t=this.value,i=t.length,r=this._value,n=!1,o=0,a=0;a<i;++a){var s=t[a];e.equalsArray(s,r,o)||(e.pack(s,r,o),n=!0),o+=2}n&&this._gl.uniform2fv(this._location,r)},p.prototype.set=function(){for(var e=this.value,i=e.length,r=this._value,o=!1,a=0,s=0;s<i;++s){var l=e[s];n(l.red)?l.red===r[a]&&l.green===r[a+1]&&l.blue===r[a+2]||(r[a]=l.red,r[a+1]=l.green,r[a+2]=l.blue,o=!0):n(l.x)&&(t.equalsArray(l,r,a)||(t.pack(l,r,a),o=!0)),a+=3}o&&this._gl.uniform3fv(this._location,r)},m.prototype.set=function(){for(var e=this.value,t=e.length,o=this._value,a=!1,s=0,l=0;l<t;++l){var u=e[l];n(u.red)?r.equalsArray(u,o,s)||(r.pack(u,o,s),a=!0):n(u.x)&&(i.equalsArray(u,o,s)||(i.pack(u,o,s),a=!0)),s+=4}a&&this._gl.uniform4fv(this._location,o)},f.prototype.set=function(){for(var e=this._gl,t=e.TEXTURE0+this.textureUnitIndex,i=this.value,r=i.length,n=0;n<r;++n){var o=i[n];e.activeTexture(t+n),e.bindTexture(o._target,o._texture); +}},f.prototype._setSampler=function(e){this.textureUnitIndex=e;for(var t=this._locations,i=t.length,r=0;r<i;++r){var n=e+r;this._gl.uniform1i(t[r],n)}return e+i},_.prototype.set=function(){for(var e=this.value,t=e.length,i=this._value,r=!1,n=0;n<t;++n){var o=e[n];o!==i[n]&&(i[n]=o,r=!0)}r&&this._gl.uniform1iv(this._location,i)},g.prototype.set=function(){for(var t=this.value,i=t.length,r=this._value,n=!1,o=0,a=0;a<i;++a){var s=t[a];e.equalsArray(s,r,o)||(e.pack(s,r,o),n=!0),o+=2}n&&this._gl.uniform2iv(this._location,r)},v.prototype.set=function(){for(var e=this.value,i=e.length,r=this._value,n=!1,o=0,a=0;a<i;++a){var s=e[a];t.equalsArray(s,r,o)||(t.pack(s,r,o),n=!0),o+=3}n&&this._gl.uniform3iv(this._location,r)},y.prototype.set=function(){for(var e=this.value,t=e.length,r=this._value,n=!1,o=0,a=0;a<t;++a){var s=e[a];i.equalsArray(s,r,o)||(i.pack(s,r,o),n=!0),o+=4}n&&this._gl.uniform4iv(this._location,r)},C.prototype.set=function(){for(var e=this.value,t=e.length,i=this._value,r=!1,n=0,o=0;o<t;++o){var s=e[o];a.equalsArray(s,i,n)||(a.pack(s,i,n),r=!0),n+=4}r&&this._gl.uniformMatrix2fv(this._location,!1,i)},w.prototype.set=function(){for(var e=this.value,t=e.length,i=this._value,r=!1,n=0,o=0;o<t;++o){var a=e[o];s.equalsArray(a,i,n)||(s.pack(a,i,n),r=!0),n+=9}r&&this._gl.uniformMatrix3fv(this._location,!1,i)},S.prototype.set=function(){for(var e=this.value,t=e.length,i=this._value,r=!1,n=0,o=0;o<t;++o){var a=e[o];l.equalsArray(a,i,n)||(l.pack(a,i,n),r=!0),n+=16}r&&this._gl.uniformMatrix4fv(this._location,!1,i)},c}),i("Renderer/ShaderProgram",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/RuntimeError","./AutomaticUniforms","./ContextLimits","./createUniform","./createUniformArray"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e){var t=d(e.vertexShaderText,e.fragmentShaderText);this._gl=e.gl,this._logShaderCompilation=e.logShaderCompilation,this._debugShaders=e.debugShaders,this._attributeLocations=e.attributeLocations,this._program=void 0,this._numberOfVertexAttributes=void 0,this._vertexAttributes=void 0,this._uniformsByName=void 0,this._uniforms=void 0,this._automaticUniforms=void 0,this._manualUniforms=void 0,this._duplicateUniformNames=t.duplicateUniformNames,this._cachedShader=void 0,this.maximumTextureUnitIndex=void 0,this._vertexShaderSource=e.vertexShaderSource,this._vertexShaderText=e.vertexShaderText,this._fragmentShaderSource=e.fragmentShaderSource,this._fragmentShaderText=t.fragmentShaderText,this.id=y++}function h(e){var i=[],r=e.match(/uniform.*?(?![^{]*})(?=[=\[;])/g);if(t(r))for(var n=r.length,o=0;o<n;o++){var a=r[o].trim(),s=a.slice(a.lastIndexOf(" ")+1);i.push(s)}return i}function d(e,t){var i={};if(!s.highpFloatSupported||!s.highpIntSupported){var r,n,o,a,l=h(e),u=h(t),c=l.length,d=u.length;for(r=0;r<c;r++)for(n=0;n<d;n++)if(l[r]===u[n]){o=l[r],a="czm_mediump_"+o;var p=new RegExp(o+"\\b","g");t=t.replace(p,a),i[a]=o}}return{fragmentShaderText:t,duplicateUniformNames:i}}function p(e,i){var r=i._vertexShaderText,n=i._fragmentShaderText,a=e.createShader(e.VERTEX_SHADER);e.shaderSource(a,r),e.compileShader(a);var s=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(s,n),e.compileShader(s);var l=e.createProgram();e.attachShader(l,a),e.attachShader(l,s),e.deleteShader(a),e.deleteShader(s);var u=i._attributeLocations;if(t(u))for(var c in u)u.hasOwnProperty(c)&&e.bindAttribLocation(l,u[c],c);e.linkProgram(l);var h;if(!e.getProgramParameter(l,e.LINK_STATUS)){var d=i._debugShaders;if(!e.getShaderParameter(s,e.COMPILE_STATUS)){if(h=e.getShaderInfoLog(s),console.error(C+"Fragment shader compile log: "+h),t(d)){var p=d.getTranslatedShaderSource(s);""!==p?console.error(C+"Translated fragment shader source:\n"+p):console.error(C+"Fragment shader translation failed.")}throw e.deleteProgram(l),new o("Fragment shader failed to compile. Compile log: "+h)}if(!e.getShaderParameter(a,e.COMPILE_STATUS)){if(h=e.getShaderInfoLog(a),console.error(C+"Vertex shader compile log: "+h),t(d)){var m=d.getTranslatedShaderSource(a);""!==m?console.error(C+"Translated vertex shader source:\n"+m):console.error(C+"Vertex shader translation failed.")}throw e.deleteProgram(l),new o("Vertex shader failed to compile. Compile log: "+h)}throw h=e.getProgramInfoLog(l),console.error(C+"Shader program link log: "+h),t(d)&&(console.error(C+"Translated vertex shader source:\n"+d.getTranslatedShaderSource(a)),console.error(C+"Translated fragment shader source:\n"+d.getTranslatedShaderSource(s))),e.deleteProgram(l),new o("Program failed to link. Link log: "+h)}var f=i._logShaderCompilation;return f&&(h=e.getShaderInfoLog(a),t(h)&&h.length>0&&console.log(C+"Vertex shader compile log: "+h)),f&&(h=e.getShaderInfoLog(s),t(h)&&h.length>0&&console.log(C+"Fragment shader compile log: "+h)),f&&(h=e.getProgramInfoLog(l),t(h)&&h.length>0&&console.log(C+"Shader program link log: "+h)),l}function m(e,t,i){for(var r={},n=0;n<i;++n){var o=e.getActiveAttrib(t,n),a=e.getAttribLocation(t,o.name);r[o.name]={name:o.name,type:o.type,index:a}}return r}function f(e,i){for(var r={},n=[],o=[],a=e.getProgramParameter(i,e.ACTIVE_UNIFORMS),s=0;s<a;++s){var c=e.getActiveUniform(i,s),h="[0]",d=c.name.indexOf(h,c.name.length-h.length)!==-1?c.name.slice(0,c.name.length-3):c.name;if(0!==d.indexOf("gl_"))if(c.name.indexOf("[")<0){var p=e.getUniformLocation(i,d);if(null!==p){var m=l(e,c,d,p);r[d]=m,n.push(m),m._setSampler&&o.push(m)}}else{var f,_,g,v,y=d.indexOf("[");if(y>=0){if(f=r[d.slice(0,y)],!t(f))continue;_=f._locations,_.length<=1&&(g=f.value,v=e.getUniformLocation(i,d),null!==v&&(_.push(v),g.push(e.getUniform(i,v))))}else{_=[];for(var C=0;C<c.size;++C)v=e.getUniformLocation(i,d+"["+C+"]"),null!==v&&_.push(v);f=u(e,c,d,_),r[d]=f,n.push(f),f._setSampler&&o.push(f)}}}return{uniformsByName:r,uniforms:n,samplerUniforms:o}}function _(e,i){var r=[],n=[];for(var o in i)if(i.hasOwnProperty(o)){var s=i[o],l=o,u=e._duplicateUniformNames[l];t(u)&&(s.name=u,l=u);var c=a[l];t(c)?r.push({uniform:s,automaticUniform:c}):n.push(s)}return{automaticUniforms:r,manualUniforms:n}}function g(e,t,i){e.useProgram(t);for(var r=0,n=i.length,o=0;o<n;++o)r=i[o]._setSampler(r);return e.useProgram(null),r}function v(e){if(!t(e._program)){var i=e._gl,r=p(i,e,e._debugShaders),n=i.getProgramParameter(r,i.ACTIVE_ATTRIBUTES),o=f(i,r),a=_(e,o.uniformsByName);e._program=r,e._numberOfVertexAttributes=n,e._vertexAttributes=m(i,r,n),e._uniformsByName=o.uniformsByName,e._uniforms=o.uniforms,e._automaticUniforms=a.automaticUniforms,e._manualUniforms=a.manualUniforms,e.maximumTextureUnitIndex=g(i,r,o.samplerUniforms)}}var y=0;c.fromCache=function(t){return t=e(t,e.EMPTY_OBJECT),t.context.shaderCache.getShaderProgram(t)},c.replaceCache=function(t){return t=e(t,e.EMPTY_OBJECT),t.context.shaderCache.replaceShaderProgram(t)},i(c.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return v(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return v(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return v(this),this._uniformsByName}}});var C="[Cesium WebGL] ";return c.prototype._bind=function(){v(this),this._gl.useProgram(this._program)},c.prototype._setUniforms=function(e,i,r){var n,o;if(t(e)){var a=this._manualUniforms;for(n=a.length,o=0;o<n;++o){var s=a[o];s.value=e[s.name]()}}var l=this._automaticUniforms;for(n=l.length,o=0;o<n;++o){var u=l[o];u.uniform.value=u.automaticUniform.getValue(i)}var c=this._uniforms;for(n=c.length,o=0;o<n;++o)c[o].set();if(r){var h=this._gl,d=this._program;h.validateProgram(d)}},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)},c.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),r(this)},c}),i("Shaders/Builtin/Constants/degreesPerRadian",[],function(){"use strict";return"const float czm_degreesPerRadian = 57.29577951308232;\n"}),i("Shaders/Builtin/Constants/depthRange",[],function(){"use strict";return"const czm_depthRangeStruct czm_depthRange = czm_depthRangeStruct(0.0, 1.0);\n"}),i("Shaders/Builtin/Constants/epsilon1",[],function(){"use strict";return"const float czm_epsilon1 = 0.1;\n"}),i("Shaders/Builtin/Constants/epsilon2",[],function(){"use strict";return"const float czm_epsilon2 = 0.01;\n"}),i("Shaders/Builtin/Constants/epsilon3",[],function(){"use strict";return"const float czm_epsilon3 = 0.001;\n"}),i("Shaders/Builtin/Constants/epsilon4",[],function(){"use strict";return"const float czm_epsilon4 = 0.0001;\n"}),i("Shaders/Builtin/Constants/epsilon5",[],function(){"use strict";return"const float czm_epsilon5 = 0.00001;\n"}),i("Shaders/Builtin/Constants/epsilon6",[],function(){"use strict";return"const float czm_epsilon6 = 0.000001;\n"}),i("Shaders/Builtin/Constants/epsilon7",[],function(){"use strict";return"const float czm_epsilon7 = 0.0000001;\n"}),i("Shaders/Builtin/Constants/infinity",[],function(){"use strict";return"const float czm_infinity = 5906376272000.0;\n"}),i("Shaders/Builtin/Constants/oneOverPi",[],function(){"use strict";return"const float czm_oneOverPi = 0.3183098861837907;\n"}),i("Shaders/Builtin/Constants/oneOverTwoPi",[],function(){"use strict";return"const float czm_oneOverTwoPi = 0.15915494309189535;\n"}),i("Shaders/Builtin/Constants/passCompute",[],function(){"use strict";return"const float czm_passCompute = 1.0;\n"}),i("Shaders/Builtin/Constants/passEnvironment",[],function(){"use strict";return"const float czm_passEnvironment = 0.0;\n"}),i("Shaders/Builtin/Constants/passGlobe",[],function(){"use strict";return"const float czm_passGlobe = 2.0;\n"}),i("Shaders/Builtin/Constants/passGround",[],function(){"use strict";return"const float czm_passGround = 3.0;\n"}),i("Shaders/Builtin/Constants/passOpaque",[],function(){"use strict";return"const float czm_passOpaque = 4.0;\n"}),i("Shaders/Builtin/Constants/passOverlay",[],function(){"use strict";return"const float czm_passOverlay = 6.0;\n"}),i("Shaders/Builtin/Constants/passTranslucent",[],function(){"use strict";return"const float czm_passTranslucent = 5.0;\n"}),i("Shaders/Builtin/Constants/pi",[],function(){"use strict";return"const float czm_pi = 3.141592653589793;\n"}),i("Shaders/Builtin/Constants/piOverFour",[],function(){"use strict";return"const float czm_piOverFour = 0.7853981633974483;\n"}),i("Shaders/Builtin/Constants/piOverSix",[],function(){"use strict";return"const float czm_piOverSix = 0.5235987755982988;\n"}),i("Shaders/Builtin/Constants/piOverThree",[],function(){"use strict";return"const float czm_piOverThree = 1.0471975511965976;\n"}),i("Shaders/Builtin/Constants/piOverTwo",[],function(){"use strict";return"const float czm_piOverTwo = 1.5707963267948966;\n"}),i("Shaders/Builtin/Constants/radiansPerDegree",[],function(){"use strict";return"const float czm_radiansPerDegree = 0.017453292519943295;\n"}),i("Shaders/Builtin/Constants/sceneMode2D",[],function(){"use strict";return"const float czm_sceneMode2D = 2.0;\n"}),i("Shaders/Builtin/Constants/sceneMode3D",[],function(){"use strict";return"const float czm_sceneMode3D = 3.0;\n"}),i("Shaders/Builtin/Constants/sceneModeColumbusView",[],function(){"use strict";return"const float czm_sceneModeColumbusView = 1.0;\n"}),i("Shaders/Builtin/Constants/sceneModeMorphing",[],function(){"use strict";return"const float czm_sceneModeMorphing = 0.0;\n"}),i("Shaders/Builtin/Constants/solarRadius",[],function(){"use strict";return"const float czm_solarRadius = 695500000.0;\n"}),i("Shaders/Builtin/Constants/threePiOver2",[],function(){"use strict";return"const float czm_threePiOver2 = 4.71238898038469;\n"}),i("Shaders/Builtin/Constants/twoPi",[],function(){"use strict";return"const float czm_twoPi = 6.283185307179586;\n"}),i("Shaders/Builtin/Constants/webMercatorMaxLatitude",[],function(){"use strict";return"const float czm_webMercatorMaxLatitude = 1.4844222297453324;\n"}),i("Shaders/Builtin/Structs/depthRangeStruct",[],function(){"use strict";return"struct czm_depthRangeStruct\n{\nfloat near;\nfloat far;\n};\n"}),i("Shaders/Builtin/Structs/ellipsoid",[],function(){"use strict";return"struct czm_ellipsoid\n{\nvec3 center;\nvec3 radii;\nvec3 inverseRadii;\nvec3 inverseRadiiSquared;\n};\n"}),i("Shaders/Builtin/Structs/material",[],function(){"use strict";return"struct czm_material\n{\nvec3 diffuse;\nfloat specular;\nfloat shininess;\nvec3 normal;\nvec3 emission;\nfloat alpha;\n};\n"}),i("Shaders/Builtin/Structs/materialInput",[],function(){"use strict";return"struct czm_materialInput\n{\nfloat s;\nvec2 st;\nvec3 str;\nvec3 normalEC;\nmat3 tangentToEyeMatrix;\nvec3 positionToEyeEC;\n};\n"}),i("Shaders/Builtin/Structs/ray",[],function(){"use strict";return"struct czm_ray\n{\nvec3 origin;\nvec3 direction;\n};\n"}),i("Shaders/Builtin/Structs/raySegment",[],function(){"use strict";return"struct czm_raySegment\n{\nfloat start;\nfloat stop;\n};\nconst czm_raySegment czm_emptyRaySegment = czm_raySegment(-czm_infinity, -czm_infinity);\nconst czm_raySegment czm_fullRaySegment = czm_raySegment(0.0, czm_infinity);\n"}),i("Shaders/Builtin/Structs/shadowParameters",[],function(){"use strict";return"struct czm_shadowParameters\n{\n#ifdef USE_CUBE_MAP_SHADOW\nvec3 texCoords;\n#else\nvec2 texCoords;\n#endif\nfloat depthBias;\nfloat depth;\nfloat nDotL;\nvec2 texelStepSize;\nfloat normalShadingSmooth;\nfloat darkness;\n};\n"}),i("Shaders/Builtin/Functions/alphaWeight",[],function(){"use strict";return"float czm_alphaWeight(float a)\n{\nfloat z;\nif (czm_sceneMode != czm_sceneMode2D)\n{\nfloat x = 2.0 * (gl_FragCoord.x - czm_viewport.x) / czm_viewport.z - 1.0;\nfloat y = 2.0 * (gl_FragCoord.y - czm_viewport.y) / czm_viewport.w - 1.0;\nz = (gl_FragCoord.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];\nvec4 q = vec4(x, y, z, 0.0);\nq /= gl_FragCoord.w;\nz = (czm_inverseProjectionOIT * q).z;\n}\nelse\n{\nz = gl_FragCoord.z * (czm_currentFrustum.y - czm_currentFrustum.x) + czm_currentFrustum.x;\n}\nreturn pow(a + 0.01, 4.0) + max(1e-2, min(3.0 * 1e3, 100.0 / (1e-5 + pow(abs(z) / 10.0, 3.0) + pow(abs(z) / 200.0, 6.0))));\n}\n"}),i("Shaders/Builtin/Functions/antialias",[],function(){"use strict";return"vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor)\n{\nfloat val1 = clamp(dist / fuzzFactor, 0.0, 1.0);\nfloat val2 = clamp((dist - 0.5) / fuzzFactor, 0.0, 1.0);\nval1 = val1 * (1.0 - val2);\nval1 = val1 * val1 * (3.0 - (2.0 * val1));\nval1 = pow(val1, 0.5);\nvec4 midColor = (color1 + color2) * 0.5;\nreturn mix(midColor, currentColor, val1);\n}\nvec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist)\n{\nreturn czm_antialias(color1, color2, currentColor, dist, 0.1);\n}\n"}),i("Shaders/Builtin/Functions/cascadeColor",[],function(){"use strict";return"vec4 czm_cascadeColor(vec4 weights)\n{\nreturn vec4(1.0, 0.0, 0.0, 1.0) * weights.x +\nvec4(0.0, 1.0, 0.0, 1.0) * weights.y +\nvec4(0.0, 0.0, 1.0, 1.0) * weights.z +\nvec4(1.0, 0.0, 1.0, 1.0) * weights.w;\n}\n"}),i("Shaders/Builtin/Functions/cascadeDistance",[],function(){"use strict";return"uniform vec4 shadowMap_cascadeDistances;\nfloat czm_cascadeDistance(vec4 weights)\n{\nreturn dot(shadowMap_cascadeDistances, weights);\n}\n"}),i("Shaders/Builtin/Functions/cascadeMatrix",[],function(){"use strict";return"uniform mat4 shadowMap_cascadeMatrices[4];\nmat4 czm_cascadeMatrix(vec4 weights)\n{\nreturn shadowMap_cascadeMatrices[0] * weights.x +\nshadowMap_cascadeMatrices[1] * weights.y +\nshadowMap_cascadeMatrices[2] * weights.z +\nshadowMap_cascadeMatrices[3] * weights.w;\n}\n"}),i("Shaders/Builtin/Functions/cascadeWeights",[],function(){"use strict";return"uniform vec4 shadowMap_cascadeSplits[2];\nvec4 czm_cascadeWeights(float depthEye)\n{\nvec4 near = step(shadowMap_cascadeSplits[0], vec4(depthEye));\nvec4 far = step(depthEye, shadowMap_cascadeSplits[1]);\nreturn near * far;\n}\n"}),i("Shaders/Builtin/Functions/columbusViewMorph",[],function(){"use strict";return"vec4 czm_columbusViewMorph(vec4 position2D, vec4 position3D, float time)\n{\nvec3 p = mix(position2D.xyz, position3D.xyz, time);\nreturn vec4(p, 1.0);\n}\n"}),i("Shaders/Builtin/Functions/computePosition",[],function(){"use strict";return"vec4 czm_computePosition();\n"}),i("Shaders/Builtin/Functions/cosineAndSine",[],function(){"use strict";return"vec2 cordic(float angle)\n{\nvec2 vector = vec2(6.0725293500888267e-1, 0.0);\nfloat sense = (angle < 0.0) ? -1.0 : 1.0;\nmat2 rotation = mat2(1.0, sense, -sense, 1.0);\nvector = rotation * vector;\nangle -= sense * 7.8539816339744828e-1;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfloat factor = sense * 5.0e-1;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 4.6364760900080609e-1;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 2.5e-1;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 2.4497866312686414e-1;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 1.25e-1;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 1.2435499454676144e-1;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 6.25e-2;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 6.2418809995957350e-2;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 3.125e-2;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 3.1239833430268277e-2;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 1.5625e-2;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 1.5623728620476831e-2;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 7.8125e-3;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 7.8123410601011111e-3;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 3.90625e-3;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 3.9062301319669718e-3;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 1.953125e-3;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 1.9531225164788188e-3;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 9.765625e-4;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 9.7656218955931946e-4;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 4.8828125e-4;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 4.8828121119489829e-4;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 2.44140625e-4;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 2.4414062014936177e-4;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 1.220703125e-4;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 1.2207031189367021e-4;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 6.103515625e-5;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 6.1035156174208773e-5;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 3.0517578125e-5;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 3.0517578115526096e-5;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 1.52587890625e-5;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 1.5258789061315762e-5;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 7.62939453125e-6;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 7.6293945311019700e-6;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 3.814697265625e-6;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 3.8146972656064961e-6;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 1.9073486328125e-6;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 1.9073486328101870e-6;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 9.5367431640625e-7;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 9.5367431640596084e-7;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 4.76837158203125e-7;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 4.7683715820308884e-7;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 2.384185791015625e-7;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 2.3841857910155797e-7;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 1.1920928955078125e-7;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nreturn vector;\n}\nvec2 czm_cosineAndSine(float angle)\n{\nif (angle < -czm_piOverTwo || angle > czm_piOverTwo)\n{\nif (angle < 0.0)\n{\nreturn -cordic(angle + czm_pi);\n}\nelse\n{\nreturn -cordic(angle - czm_pi);\n}\n}\nelse\n{\nreturn cordic(angle);\n}\n}\n"}),i("Shaders/Builtin/Functions/decompressTextureCoordinates",[],function(){"use strict";return"vec2 czm_decompressTextureCoordinates(float encoded)\n{\nfloat temp = encoded / 4096.0;\nfloat xZeroTo4095 = floor(temp);\nfloat stx = xZeroTo4095 / 4095.0;\nfloat sty = (encoded - xZeroTo4095 * 4096.0) / 4095.0;\nreturn vec2(stx, sty);\n}\n"}),i("Shaders/Builtin/Functions/eastNorthUpToEyeCoordinates",[],function(){"use strict";return"mat3 czm_eastNorthUpToEyeCoordinates(vec3 positionMC, vec3 normalEC)\n{\nvec3 tangentMC = normalize(vec3(-positionMC.y, positionMC.x, 0.0));\nvec3 tangentEC = normalize(czm_normal3D * tangentMC);\nvec3 bitangentEC = normalize(cross(normalEC, tangentEC));\nreturn mat3(\ntangentEC.x, tangentEC.y, tangentEC.z,\nbitangentEC.x, bitangentEC.y, bitangentEC.z,\nnormalEC.x, normalEC.y, normalEC.z);\n}\n"}),i("Shaders/Builtin/Functions/ellipsoidContainsPoint",[],function(){"use strict";return"bool czm_ellipsoidContainsPoint(czm_ellipsoid ellipsoid, vec3 point)\n{\nvec3 scaled = ellipsoid.inverseRadii * (czm_inverseModelView * vec4(point, 1.0)).xyz;\nreturn (dot(scaled, scaled) <= 1.0);\n}\n"}),i("Shaders/Builtin/Functions/ellipsoidNew",[],function(){"use strict";return"czm_ellipsoid czm_ellipsoidNew(vec3 center, vec3 radii)\n{\nvec3 inverseRadii = vec3(1.0 / radii.x, 1.0 / radii.y, 1.0 / radii.z);\nvec3 inverseRadiiSquared = inverseRadii * inverseRadii;\nczm_ellipsoid temp = czm_ellipsoid(center, radii, inverseRadii, inverseRadiiSquared);\nreturn temp;\n}\n"}),i("Shaders/Builtin/Functions/ellipsoidWgs84TextureCoordinates",[],function(){"use strict";return"vec2 czm_ellipsoidWgs84TextureCoordinates(vec3 normal)\n{\nreturn vec2(atan(normal.y, normal.x) * czm_oneOverTwoPi + 0.5, asin(normal.z) * czm_oneOverPi + 0.5);\n}\n"}),i("Shaders/Builtin/Functions/equalsEpsilon",[],function(){"use strict";return"bool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon) {\nreturn all(lessThanEqual(abs(left - right), vec4(epsilon)));\n}\nbool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon) {\nreturn all(lessThanEqual(abs(left - right), vec3(epsilon)));\n}\nbool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon) {\nreturn all(lessThanEqual(abs(left - right), vec2(epsilon)));\n}\nbool czm_equalsEpsilon(float left, float right, float epsilon) {\nreturn (abs(left - right) <= epsilon);\n}\n"}),i("Shaders/Builtin/Functions/eyeOffset",[],function(){"use strict";return"vec4 czm_eyeOffset(vec4 positionEC, vec3 eyeOffset)\n{\nvec4 p = positionEC;\nvec4 zEyeOffset = normalize(p) * eyeOffset.z;\np.xy += eyeOffset.xy + zEyeOffset.xy;\np.z += zEyeOffset.z;\nreturn p;\n}\n"}),i("Shaders/Builtin/Functions/eyeToWindowCoordinates",[],function(){"use strict";return"vec4 czm_eyeToWindowCoordinates(vec4 positionEC)\n{\nvec4 q = czm_projection * positionEC;\nq.xyz /= q.w;\nq.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz;\nreturn q;\n}\n"}),i("Shaders/Builtin/Functions/fog",[],function(){"use strict";return"vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor)\n{\nfloat scalar = distanceToCamera * czm_fogDensity;\nfloat fog = 1.0 - exp(-(scalar * scalar));\nreturn mix(color, fogColor, fog);\n}\n"}),i("Shaders/Builtin/Functions/geodeticSurfaceNormal",[],function(){"use strict";return"vec3 czm_geodeticSurfaceNormal(vec3 positionOnEllipsoid, vec3 ellipsoidCenter, vec3 oneOverEllipsoidRadiiSquared)\n{\nreturn normalize((positionOnEllipsoid - ellipsoidCenter) * oneOverEllipsoidRadiiSquared);\n}\n"}),i("Shaders/Builtin/Functions/getDefaultMaterial",[],function(){"use strict";return"czm_material czm_getDefaultMaterial(czm_materialInput materialInput)\n{\nczm_material material;\nmaterial.diffuse = vec3(0.0);\nmaterial.specular = 0.0;\nmaterial.shininess = 1.0;\nmaterial.normal = materialInput.normalEC;\nmaterial.emission = vec3(0.0);\nmaterial.alpha = 1.0;\nreturn material;\n}\n"}),i("Shaders/Builtin/Functions/getLambertDiffuse",[],function(){"use strict";return"float czm_getLambertDiffuse(vec3 lightDirectionEC, vec3 normalEC)\n{\nreturn max(dot(lightDirectionEC, normalEC), 0.0);\n}\n"}),i("Shaders/Builtin/Functions/getSpecular",[],function(){"use strict";return"float czm_getSpecular(vec3 lightDirectionEC, vec3 toEyeEC, vec3 normalEC, float shininess)\n{\nvec3 toReflectedLight = reflect(-lightDirectionEC, normalEC);\nfloat specular = max(dot(toReflectedLight, toEyeEC), 0.0);\nreturn pow(specular, max(shininess, czm_epsilon2));\n}\n"}),i("Shaders/Builtin/Functions/getWaterNoise",[],function(){"use strict";return"vec4 czm_getWaterNoise(sampler2D normalMap, vec2 uv, float time, float angleInRadians)\n{\nfloat cosAngle = cos(angleInRadians);\nfloat sinAngle = sin(angleInRadians);\nvec2 s0 = vec2(1.0/17.0, 0.0);\nvec2 s1 = vec2(-1.0/29.0, 0.0);\nvec2 s2 = vec2(1.0/101.0, 1.0/59.0);\nvec2 s3 = vec2(-1.0/109.0, -1.0/57.0);\ns0 = vec2((cosAngle * s0.x) - (sinAngle * s0.y), (sinAngle * s0.x) + (cosAngle * s0.y));\ns1 = vec2((cosAngle * s1.x) - (sinAngle * s1.y), (sinAngle * s1.x) + (cosAngle * s1.y));\ns2 = vec2((cosAngle * s2.x) - (sinAngle * s2.y), (sinAngle * s2.x) + (cosAngle * s2.y));\ns3 = vec2((cosAngle * s3.x) - (sinAngle * s3.y), (sinAngle * s3.x) + (cosAngle * s3.y));\nvec2 uv0 = (uv/103.0) + (time * s0);\nvec2 uv1 = uv/107.0 + (time * s1) + vec2(0.23);\nvec2 uv2 = uv/vec2(897.0, 983.0) + (time * s2) + vec2(0.51);\nvec2 uv3 = uv/vec2(991.0, 877.0) + (time * s3) + vec2(0.71);\nuv0 = fract(uv0);\nuv1 = fract(uv1);\nuv2 = fract(uv2);\nuv3 = fract(uv3);\nvec4 noise = (texture2D(normalMap, uv0)) +\n(texture2D(normalMap, uv1)) +\n(texture2D(normalMap, uv2)) +\n(texture2D(normalMap, uv3));\nreturn ((noise / 4.0) - 0.5) * 2.0;\n}\n"}),i("Shaders/Builtin/Functions/getWgs84EllipsoidEC",[],function(){"use strict";return"czm_ellipsoid czm_getWgs84EllipsoidEC()\n{\nvec3 radii = vec3(6378137.0, 6378137.0, 6356752.314245);\nvec3 inverseRadii = vec3(1.0 / radii.x, 1.0 / radii.y, 1.0 / radii.z);\nvec3 inverseRadiiSquared = inverseRadii * inverseRadii;\nczm_ellipsoid temp = czm_ellipsoid(czm_view[3].xyz, radii, inverseRadii, inverseRadiiSquared);\nreturn temp;\n}\n"}),i("Shaders/Builtin/Functions/hue",[],function(){"use strict";return"vec3 czm_hue(vec3 rgb, float adjustment)\n{\nconst mat3 toYIQ = mat3(0.299, 0.587, 0.114,\n0.595716, -0.274453, -0.321263,\n0.211456, -0.522591, 0.311135);\nconst mat3 toRGB = mat3(1.0, 0.9563, 0.6210,\n1.0, -0.2721, -0.6474,\n1.0, -1.107, 1.7046);\nvec3 yiq = toYIQ * rgb;\nfloat hue = atan(yiq.z, yiq.y) + adjustment;\nfloat chroma = sqrt(yiq.z * yiq.z + yiq.y * yiq.y);\nvec3 color = vec3(yiq.x, chroma * cos(hue), chroma * sin(hue));\nreturn toRGB * color;\n}\n"}),i("Shaders/Builtin/Functions/isEmpty",[],function(){"use strict";return"bool czm_isEmpty(czm_raySegment interval)\n{\nreturn (interval.stop < 0.0);\n}\n"}),i("Shaders/Builtin/Functions/isFull",[],function(){"use strict";return"bool czm_isFull(czm_raySegment interval)\n{\nreturn (interval.start == 0.0 && interval.stop == czm_infinity);\n}\n"}),i("Shaders/Builtin/Functions/latitudeToWebMercatorFraction",[],function(){"use strict";return"float czm_latitudeToWebMercatorFraction(float latitude, float southMercatorY, float oneOverMercatorHeight)\n{\nfloat sinLatitude = sin(latitude);\nfloat mercatorY = 0.5 * log((1.0 + sinLatitude) / (1.0 - sinLatitude));\nreturn (mercatorY - southMercatorY) * oneOverMercatorHeight;\n}\n"}),i("Shaders/Builtin/Functions/luminance",[],function(){"use strict";return"float czm_luminance(vec3 rgb)\n{\nconst vec3 W = vec3(0.2125, 0.7154, 0.0721);\nreturn dot(rgb, W);\n}\n"}),i("Shaders/Builtin/Functions/metersPerPixel",[],function(){"use strict";return"float czm_metersPerPixel(vec4 positionEC)\n{\nfloat width = czm_viewport.z;\nfloat height = czm_viewport.w;\nfloat pixelWidth;\nfloat pixelHeight;\nfloat top = czm_frustumPlanes.x;\nfloat bottom = czm_frustumPlanes.y;\nfloat left = czm_frustumPlanes.z;\nfloat right = czm_frustumPlanes.w;\nif (czm_sceneMode == czm_sceneMode2D)\n{\nfloat frustumWidth = right - left;\nfloat frustumHeight = top - bottom;\npixelWidth = frustumWidth / width;\npixelHeight = frustumHeight / height;\n}\nelse\n{\nfloat distanceToPixel = -positionEC.z;\nfloat inverseNear = 1.0 / czm_currentFrustum.x;\nfloat tanTheta = top * inverseNear;\npixelHeight = 2.0 * distanceToPixel * tanTheta / height;\ntanTheta = right * inverseNear;\npixelWidth = 2.0 * distanceToPixel * tanTheta / width;\n}\nreturn max(pixelWidth, pixelHeight);\n}\n"}),i("Shaders/Builtin/Functions/modelToWindowCoordinates",[],function(){"use strict";return"vec4 czm_modelToWindowCoordinates(vec4 position)\n{\nvec4 q = czm_modelViewProjection * position;\nq.xyz /= q.w;\nq.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz;\nreturn q;\n}\n"}),i("Shaders/Builtin/Functions/multiplyWithColorBalance",[],function(){"use strict";return"vec3 czm_multiplyWithColorBalance(vec3 left, vec3 right)\n{\nconst vec3 W = vec3(0.2125, 0.7154, 0.0721);\nvec3 target = left * right;\nfloat leftLuminance = dot(left, W);\nfloat rightLuminance = dot(right, W);\nfloat targetLuminance = dot(target, W);\nreturn ((leftLuminance + rightLuminance) / (2.0 * targetLuminance)) * target;\n}\n"}),i("Shaders/Builtin/Functions/nearFarScalar",[],function(){"use strict";return"float czm_nearFarScalar(vec4 nearFarScalar, float cameraDistSq)\n{\nfloat valueAtMin = nearFarScalar.y;\nfloat valueAtMax = nearFarScalar.w;\nfloat nearDistanceSq = nearFarScalar.x * nearFarScalar.x;\nfloat farDistanceSq = nearFarScalar.z * nearFarScalar.z;\nfloat t = (cameraDistSq - nearDistanceSq) / (farDistanceSq - nearDistanceSq);\nt = pow(clamp(t, 0.0, 1.0), 0.2);\nreturn mix(valueAtMin, valueAtMax, t);\n}\n"}),i("Shaders/Builtin/Functions/octDecode",[],function(){"use strict";return"vec3 czm_octDecode(vec2 encoded, float range)\n{\nif (encoded.x == 0.0 && encoded.y == 0.0) {\nreturn vec3(0.0, 0.0, 0.0);\n}\nencoded = encoded / range * 2.0 - 1.0;\nvec3 v = vec3(encoded.x, encoded.y, 1.0 - abs(encoded.x) - abs(encoded.y));\nif (v.z < 0.0)\n{\nv.xy = (1.0 - abs(v.yx)) * czm_signNotZero(v.xy);\n}\nreturn normalize(v);\n}\nvec3 czm_octDecode(vec2 encoded)\n{\nreturn czm_octDecode(encoded, 255.0);\n}\nvec3 czm_octDecode(float encoded)\n{\nfloat temp = encoded / 256.0;\nfloat x = floor(temp);\nfloat y = (temp - x) * 256.0;\nreturn czm_octDecode(vec2(x, y));\n}\nvoid czm_octDecode(vec2 encoded, out vec3 vector1, out vec3 vector2, out vec3 vector3)\n{\nfloat temp = encoded.x / 65536.0;\nfloat x = floor(temp);\nfloat encodedFloat1 = (temp - x) * 65536.0;\ntemp = encoded.y / 65536.0;\nfloat y = floor(temp);\nfloat encodedFloat2 = (temp - y) * 65536.0;\nvector1 = czm_octDecode(encodedFloat1);\nvector2 = czm_octDecode(encodedFloat2);\nvector3 = czm_octDecode(vec2(x, y));\n}\n"; +}),i("Shaders/Builtin/Functions/packDepth",[],function(){"use strict";return"vec4 czm_packDepth(float depth)\n{\nvec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * depth;\nenc = fract(enc);\nenc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\nreturn enc;\n}\n"}),i("Shaders/Builtin/Functions/phong",[],function(){"use strict";return"float czm_private_getLambertDiffuseOfMaterial(vec3 lightDirectionEC, czm_material material)\n{\nreturn czm_getLambertDiffuse(lightDirectionEC, material.normal);\n}\nfloat czm_private_getSpecularOfMaterial(vec3 lightDirectionEC, vec3 toEyeEC, czm_material material)\n{\nreturn czm_getSpecular(lightDirectionEC, toEyeEC, material.normal, material.shininess);\n}\nvec4 czm_phong(vec3 toEye, czm_material material)\n{\nfloat diffuse = czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 0.0, 1.0), material);\nif (czm_sceneMode == czm_sceneMode3D) {\ndiffuse += czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 1.0, 0.0), material);\n}\nfloat specular = czm_private_getSpecularOfMaterial(czm_sunDirectionEC, toEye, material) + czm_private_getSpecularOfMaterial(czm_moonDirectionEC, toEye, material);\nvec3 materialDiffuse = material.diffuse * 0.5;\nvec3 ambient = materialDiffuse;\nvec3 color = ambient + material.emission;\ncolor += materialDiffuse * diffuse;\ncolor += material.specular * specular;\nreturn vec4(color, material.alpha);\n}\nvec4 czm_private_phong(vec3 toEye, czm_material material)\n{\nfloat diffuse = czm_private_getLambertDiffuseOfMaterial(czm_sunDirectionEC, material);\nfloat specular = czm_private_getSpecularOfMaterial(czm_sunDirectionEC, toEye, material);\nvec3 ambient = vec3(0.0);\nvec3 color = ambient + material.emission;\ncolor += material.diffuse * diffuse;\ncolor += material.specular * specular;\nreturn vec4(color, material.alpha);\n}\n"}),i("Shaders/Builtin/Functions/pointAlongRay",[],function(){"use strict";return"vec3 czm_pointAlongRay(czm_ray ray, float time)\n{\nreturn ray.origin + (time * ray.direction);\n}\n"}),i("Shaders/Builtin/Functions/rayEllipsoidIntersectionInterval",[],function(){"use strict";return"czm_raySegment czm_rayEllipsoidIntersectionInterval(czm_ray ray, czm_ellipsoid ellipsoid)\n{\nvec3 q = ellipsoid.inverseRadii * (czm_inverseModelView * vec4(ray.origin, 1.0)).xyz;\nvec3 w = ellipsoid.inverseRadii * (czm_inverseModelView * vec4(ray.direction, 0.0)).xyz;\nq = q - ellipsoid.inverseRadii * (czm_inverseModelView * vec4(ellipsoid.center, 1.0)).xyz;\nfloat q2 = dot(q, q);\nfloat qw = dot(q, w);\nif (q2 > 1.0)\n{\nif (qw >= 0.0)\n{\nreturn czm_emptyRaySegment;\n}\nelse\n{\nfloat qw2 = qw * qw;\nfloat difference = q2 - 1.0;\nfloat w2 = dot(w, w);\nfloat product = w2 * difference;\nif (qw2 < product)\n{\nreturn czm_emptyRaySegment;\n}\nelse if (qw2 > product)\n{\nfloat discriminant = qw * qw - product;\nfloat temp = -qw + sqrt(discriminant);\nfloat root0 = temp / w2;\nfloat root1 = difference / temp;\nif (root0 < root1)\n{\nczm_raySegment i = czm_raySegment(root0, root1);\nreturn i;\n}\nelse\n{\nczm_raySegment i = czm_raySegment(root1, root0);\nreturn i;\n}\n}\nelse\n{\nfloat root = sqrt(difference / w2);\nczm_raySegment i = czm_raySegment(root, root);\nreturn i;\n}\n}\n}\nelse if (q2 < 1.0)\n{\nfloat difference = q2 - 1.0;\nfloat w2 = dot(w, w);\nfloat product = w2 * difference;\nfloat discriminant = qw * qw - product;\nfloat temp = -qw + sqrt(discriminant);\nczm_raySegment i = czm_raySegment(0.0, temp / w2);\nreturn i;\n}\nelse\n{\nif (qw < 0.0)\n{\nfloat w2 = dot(w, w);\nczm_raySegment i = czm_raySegment(0.0, -qw / w2);\nreturn i;\n}\nelse\n{\nreturn czm_emptyRaySegment;\n}\n}\n}\n"}),i("Shaders/Builtin/Functions/RGBToXYZ",[],function(){"use strict";return"vec3 czm_RGBToXYZ(vec3 rgb)\n{\nconst mat3 RGB2XYZ = mat3(0.4124, 0.2126, 0.0193,\n0.3576, 0.7152, 0.1192,\n0.1805, 0.0722, 0.9505);\nvec3 xyz = RGB2XYZ * rgb;\nvec3 Yxy;\nYxy.r = xyz.g;\nfloat temp = dot(vec3(1.0), xyz);\nYxy.gb = xyz.rg / temp;\nreturn Yxy;\n}\n"}),i("Shaders/Builtin/Functions/saturation",[],function(){"use strict";return"vec3 czm_saturation(vec3 rgb, float adjustment)\n{\nconst vec3 W = vec3(0.2125, 0.7154, 0.0721);\nvec3 intensity = vec3(dot(rgb, W));\nreturn mix(intensity, rgb, adjustment);\n}\n"}),i("Shaders/Builtin/Functions/shadowDepthCompare",[],function(){"use strict";return"float czm_sampleShadowMap(samplerCube shadowMap, vec3 d)\n{\nreturn czm_unpackDepth(textureCube(shadowMap, d));\n}\nfloat czm_sampleShadowMap(sampler2D shadowMap, vec2 uv)\n{\n#ifdef USE_SHADOW_DEPTH_TEXTURE\nreturn texture2D(shadowMap, uv).r;\n#else\nreturn czm_unpackDepth(texture2D(shadowMap, uv));\n#endif\n}\nfloat czm_shadowDepthCompare(samplerCube shadowMap, vec3 uv, float depth)\n{\nreturn step(depth, czm_sampleShadowMap(shadowMap, uv));\n}\nfloat czm_shadowDepthCompare(sampler2D shadowMap, vec2 uv, float depth)\n{\nreturn step(depth, czm_sampleShadowMap(shadowMap, uv));\n}\n"}),i("Shaders/Builtin/Functions/shadowVisibility",[],function(){"use strict";return"float czm_private_shadowVisibility(float visibility, float nDotL, float normalShadingSmooth, float darkness)\n{\n#ifdef USE_NORMAL_SHADING\n#ifdef USE_NORMAL_SHADING_SMOOTH\nfloat strength = clamp(nDotL / normalShadingSmooth, 0.0, 1.0);\n#else\nfloat strength = step(0.0, nDotL);\n#endif\nvisibility *= strength;\n#endif\nvisibility = max(visibility, darkness);\nreturn visibility;\n}\n#ifdef USE_CUBE_MAP_SHADOW\nfloat czm_shadowVisibility(samplerCube shadowMap, czm_shadowParameters shadowParameters)\n{\nfloat depthBias = shadowParameters.depthBias;\nfloat depth = shadowParameters.depth;\nfloat nDotL = shadowParameters.nDotL;\nfloat normalShadingSmooth = shadowParameters.normalShadingSmooth;\nfloat darkness = shadowParameters.darkness;\nvec3 uvw = shadowParameters.texCoords;\ndepth -= depthBias;\nfloat visibility = czm_shadowDepthCompare(shadowMap, uvw, depth);\nreturn czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness);\n}\n#else\nfloat czm_shadowVisibility(sampler2D shadowMap, czm_shadowParameters shadowParameters)\n{\nfloat depthBias = shadowParameters.depthBias;\nfloat depth = shadowParameters.depth;\nfloat nDotL = shadowParameters.nDotL;\nfloat normalShadingSmooth = shadowParameters.normalShadingSmooth;\nfloat darkness = shadowParameters.darkness;\nvec2 uv = shadowParameters.texCoords;\ndepth -= depthBias;\n#ifdef USE_SOFT_SHADOWS\nvec2 texelStepSize = shadowParameters.texelStepSize;\nfloat radius = 1.0;\nfloat dx0 = -texelStepSize.x * radius;\nfloat dy0 = -texelStepSize.y * radius;\nfloat dx1 = texelStepSize.x * radius;\nfloat dy1 = texelStepSize.y * radius;\nfloat visibility = (\nczm_shadowDepthCompare(shadowMap, uv, depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy0), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy0), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy0), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx0, 0.0), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx1, 0.0), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy1), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy1), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy1), depth)\n) * (1.0 / 9.0);\n#else\nfloat visibility = czm_shadowDepthCompare(shadowMap, uv, depth);\n#endif\nreturn czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness);\n}\n#endif\n"}),i("Shaders/Builtin/Functions/signNotZero",[],function(){"use strict";return"float czm_signNotZero(float value)\n{\nreturn value >= 0.0 ? 1.0 : -1.0;\n}\nvec2 czm_signNotZero(vec2 value)\n{\nreturn vec2(czm_signNotZero(value.x), czm_signNotZero(value.y));\n}\nvec3 czm_signNotZero(vec3 value)\n{\nreturn vec3(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z));\n}\nvec4 czm_signNotZero(vec4 value)\n{\nreturn vec4(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z), czm_signNotZero(value.w));\n}\n"}),i("Shaders/Builtin/Functions/tangentToEyeSpaceMatrix",[],function(){"use strict";return"mat3 czm_tangentToEyeSpaceMatrix(vec3 normalEC, vec3 tangentEC, vec3 bitangentEC)\n{\nvec3 normal = normalize(normalEC);\nvec3 tangent = normalize(tangentEC);\nvec3 bitangent = normalize(bitangentEC);\nreturn mat3(tangent.x , tangent.y , tangent.z,\nbitangent.x, bitangent.y, bitangent.z,\nnormal.x , normal.y , normal.z);\n}\n"}),i("Shaders/Builtin/Functions/translateRelativeToEye",[],function(){"use strict";return"vec4 czm_translateRelativeToEye(vec3 high, vec3 low)\n{\nvec3 highDifference = high - czm_encodedCameraPositionMCHigh;\nvec3 lowDifference = low - czm_encodedCameraPositionMCLow;\nreturn vec4(highDifference + lowDifference, 1.0);\n}\n"}),i("Shaders/Builtin/Functions/translucentPhong",[],function(){"use strict";return"vec4 czm_translucentPhong(vec3 toEye, czm_material material)\n{\nfloat diffuse = czm_getLambertDiffuse(vec3(0.0, 0.0, 1.0), material.normal);\nif (czm_sceneMode == czm_sceneMode3D) {\ndiffuse += czm_getLambertDiffuse(vec3(0.0, 1.0, 0.0), material.normal);\n}\ndiffuse = clamp(diffuse, 0.0, 1.0);\nfloat specular = czm_getSpecular(czm_sunDirectionEC, toEye, material.normal, material.shininess);\nspecular += czm_getSpecular(czm_moonDirectionEC, toEye, material.normal, material.shininess);\nvec3 materialDiffuse = material.diffuse * 0.5;\nvec3 ambient = materialDiffuse;\nvec3 color = ambient + material.emission;\ncolor += materialDiffuse * diffuse;\ncolor += material.specular * specular;\nreturn vec4(color, material.alpha);\n}\n"}),i("Shaders/Builtin/Functions/transpose",[],function(){"use strict";return"mat2 czm_transpose(mat2 matrix)\n{\nreturn mat2(\nmatrix[0][0], matrix[1][0],\nmatrix[0][1], matrix[1][1]);\n}\nmat3 czm_transpose(mat3 matrix)\n{\nreturn mat3(\nmatrix[0][0], matrix[1][0], matrix[2][0],\nmatrix[0][1], matrix[1][1], matrix[2][1],\nmatrix[0][2], matrix[1][2], matrix[2][2]);\n}\nmat4 czm_transpose(mat4 matrix)\n{\nreturn mat4(\nmatrix[0][0], matrix[1][0], matrix[2][0], matrix[3][0],\nmatrix[0][1], matrix[1][1], matrix[2][1], matrix[3][1],\nmatrix[0][2], matrix[1][2], matrix[2][2], matrix[3][2],\nmatrix[0][3], matrix[1][3], matrix[2][3], matrix[3][3]);\n}\n"}),i("Shaders/Builtin/Functions/unpackDepth",[],function(){"use strict";return"float czm_unpackDepth(vec4 packedDepth)\n{\nreturn dot(packedDepth, vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0));\n}\n"}),i("Shaders/Builtin/Functions/windowToEyeCoordinates",[],function(){"use strict";return"vec4 czm_windowToEyeCoordinates(vec4 fragmentCoordinate)\n{\nfloat x = 2.0 * (fragmentCoordinate.x - czm_viewport.x) / czm_viewport.z - 1.0;\nfloat y = 2.0 * (fragmentCoordinate.y - czm_viewport.y) / czm_viewport.w - 1.0;\nfloat z = (fragmentCoordinate.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];\nvec4 q = vec4(x, y, z, 1.0);\nq /= fragmentCoordinate.w;\nq = czm_inverseProjection * q;\nreturn q;\n}\n"}),i("Shaders/Builtin/Functions/XYZToRGB",[],function(){"use strict";return"vec3 czm_XYZToRGB(vec3 Yxy)\n{\nconst mat3 XYZ2RGB = mat3( 3.2405, -0.9693, 0.0556,\n-1.5371, 1.8760, -0.2040,\n-0.4985, 0.0416, 1.0572);\nvec3 xyz;\nxyz.r = Yxy.r * Yxy.g / Yxy.b;\nxyz.g = Yxy.r;\nxyz.b = Yxy.r * (1.0 - Yxy.g - Yxy.b) / Yxy.b;\nreturn XYZ2RGB * xyz;\n}\n"}),i("Shaders/Builtin/CzmBuiltins",["./Constants/degreesPerRadian","./Constants/depthRange","./Constants/epsilon1","./Constants/epsilon2","./Constants/epsilon3","./Constants/epsilon4","./Constants/epsilon5","./Constants/epsilon6","./Constants/epsilon7","./Constants/infinity","./Constants/oneOverPi","./Constants/oneOverTwoPi","./Constants/passCompute","./Constants/passEnvironment","./Constants/passGlobe","./Constants/passGround","./Constants/passOpaque","./Constants/passOverlay","./Constants/passTranslucent","./Constants/pi","./Constants/piOverFour","./Constants/piOverSix","./Constants/piOverThree","./Constants/piOverTwo","./Constants/radiansPerDegree","./Constants/sceneMode2D","./Constants/sceneMode3D","./Constants/sceneModeColumbusView","./Constants/sceneModeMorphing","./Constants/solarRadius","./Constants/threePiOver2","./Constants/twoPi","./Constants/webMercatorMaxLatitude","./Structs/depthRangeStruct","./Structs/ellipsoid","./Structs/material","./Structs/materialInput","./Structs/ray","./Structs/raySegment","./Structs/shadowParameters","./Functions/alphaWeight","./Functions/antialias","./Functions/cascadeColor","./Functions/cascadeDistance","./Functions/cascadeMatrix","./Functions/cascadeWeights","./Functions/columbusViewMorph","./Functions/computePosition","./Functions/cosineAndSine","./Functions/decompressTextureCoordinates","./Functions/eastNorthUpToEyeCoordinates","./Functions/ellipsoidContainsPoint","./Functions/ellipsoidNew","./Functions/ellipsoidWgs84TextureCoordinates","./Functions/equalsEpsilon","./Functions/eyeOffset","./Functions/eyeToWindowCoordinates","./Functions/fog","./Functions/geodeticSurfaceNormal","./Functions/getDefaultMaterial","./Functions/getLambertDiffuse","./Functions/getSpecular","./Functions/getWaterNoise","./Functions/getWgs84EllipsoidEC","./Functions/hue","./Functions/isEmpty","./Functions/isFull","./Functions/latitudeToWebMercatorFraction","./Functions/luminance","./Functions/metersPerPixel","./Functions/modelToWindowCoordinates","./Functions/multiplyWithColorBalance","./Functions/nearFarScalar","./Functions/octDecode","./Functions/packDepth","./Functions/phong","./Functions/pointAlongRay","./Functions/rayEllipsoidIntersectionInterval","./Functions/RGBToXYZ","./Functions/saturation","./Functions/shadowDepthCompare","./Functions/shadowVisibility","./Functions/signNotZero","./Functions/tangentToEyeSpaceMatrix","./Functions/translateRelativeToEye","./Functions/translucentPhong","./Functions/transpose","./Functions/unpackDepth","./Functions/windowToEyeCoordinates","./Functions/XYZToRGB"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I,R,O,N,L,B,F,V,k,z,U,G,W,H,q,j,Y,X,Z,K,Q,J,$,ee,te,ie,re,ne,oe,ae,se,le,ue,ce,he,de,pe,me,fe,_e,ge,ve,ye,Ce,we,Se,Ee,be,Te,xe,Ae,Pe,De,Me,Ie,Re,Oe,Ne,Le){"use strict";return{czm_degreesPerRadian:e,czm_depthRange:t,czm_epsilon1:i,czm_epsilon2:r,czm_epsilon3:n,czm_epsilon4:o,czm_epsilon5:a,czm_epsilon6:s,czm_epsilon7:l,czm_infinity:u,czm_oneOverPi:c,czm_oneOverTwoPi:h,czm_passCompute:d,czm_passEnvironment:p,czm_passGlobe:m,czm_passGround:f,czm_passOpaque:_,czm_passOverlay:g,czm_passTranslucent:v,czm_pi:y,czm_piOverFour:C,czm_piOverSix:w,czm_piOverThree:S,czm_piOverTwo:E,czm_radiansPerDegree:b,czm_sceneMode2D:T,czm_sceneMode3D:x,czm_sceneModeColumbusView:A,czm_sceneModeMorphing:P,czm_solarRadius:D,czm_threePiOver2:M,czm_twoPi:I,czm_webMercatorMaxLatitude:R,czm_depthRangeStruct:O,czm_ellipsoid:N,czm_material:L,czm_materialInput:B,czm_ray:F,czm_raySegment:V,czm_shadowParameters:k,czm_alphaWeight:z,czm_antialias:U,czm_cascadeColor:G,czm_cascadeDistance:W,czm_cascadeMatrix:H,czm_cascadeWeights:q,czm_columbusViewMorph:j,czm_computePosition:Y,czm_cosineAndSine:X,czm_decompressTextureCoordinates:Z,czm_eastNorthUpToEyeCoordinates:K,czm_ellipsoidContainsPoint:Q,czm_ellipsoidNew:J,czm_ellipsoidWgs84TextureCoordinates:$,czm_equalsEpsilon:ee,czm_eyeOffset:te,czm_eyeToWindowCoordinates:ie,czm_fog:re,czm_geodeticSurfaceNormal:ne,czm_getDefaultMaterial:oe,czm_getLambertDiffuse:ae,czm_getSpecular:se,czm_getWaterNoise:le,czm_getWgs84EllipsoidEC:ue,czm_hue:ce,czm_isEmpty:he,czm_isFull:de,czm_latitudeToWebMercatorFraction:pe,czm_luminance:me,czm_metersPerPixel:fe,czm_modelToWindowCoordinates:_e,czm_multiplyWithColorBalance:ge,czm_nearFarScalar:ve,czm_octDecode:ye,czm_packDepth:Ce,czm_phong:we,czm_pointAlongRay:Se,czm_rayEllipsoidIntersectionInterval:Ee,czm_RGBToXYZ:be,czm_saturation:Te,czm_shadowDepthCompare:xe,czm_shadowVisibility:Ae,czm_signNotZero:Pe,czm_tangentToEyeSpaceMatrix:De,czm_translateRelativeToEye:Me,czm_translucentPhong:Ie,czm_transpose:Re,czm_unpackDepth:Oe,czm_windowToEyeCoordinates:Ne,czm_XYZToRGB:Le}}),i("Renderer/ShaderSource",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Shaders/Builtin/CzmBuiltins","./AutomaticUniforms"],function(e,t,i,r,n){"use strict";function o(e){return e=e.replace(/\/\/.*/g,""),e.replace(/\/\*\*[\s\S]*?\*\//gm,function(e){for(var t=e.match(/\n/gm).length,i="",r=0;r<t;++r)i+="\n";return i})}function a(e,i,r){for(var n,a=0;a<r.length;++a)r[a].name===e&&(n=r[a]);return t(n)||(i=o(i),n={name:e,glslSource:i,dependsOn:[],requiredBy:[],evaluated:!1},r.push(n)),n}function s(e,i){if(!e.evaluated){e.evaluated=!0;var r=e.glslSource.match(/\bczm_[a-zA-Z0-9_]*/g);t(r)&&null!==r&&(r=r.filter(function(e,t){return r.indexOf(e)===t}),r.forEach(function(t){if(t!==e.name&&h._czmBuiltinsAndUniforms.hasOwnProperty(t)){var r=a(t,h._czmBuiltinsAndUniforms[t],i);e.dependsOn.push(r),r.requiredBy.push(e),s(r,i)}}))}}function l(e){for(var t=[],i=[];e.length>0;){var r=e.pop();i.push(r),0===r.requiredBy.length&&t.push(r)}for(;t.length>0;){var n=t.shift();e.push(n);for(var o=0;o<n.dependsOn.length;++o){var a=n.dependsOn[o],s=a.requiredBy.indexOf(n);a.requiredBy.splice(s,1),0===a.requiredBy.length&&t.push(a)}}for(var l=[],u=0;u<i.length;++u)0!==i[u].requiredBy.length&&l.push(i[u])}function u(e){var t=[],i=a("main",e,t);s(i,t),l(t);for(var r="",n=t.length-1;n>=0;--n)r=r+t[n].glslSource+"\n";return r.replace(i.glslSource,"")}function c(e,i){var r,n,a="",s=e.sources;if(t(s))for(r=0,n=s.length;r<n;++r)a+="\n#line 0\n"+s[r];a=o(a);var l;a=a.replace(/#version\s+(.*?)\n/gm,function(e,t){return l=t,"\n"}),a=a.replace(/precision\s(lowp|mediump|highp)\s(float|int);/,"");var c=e.pickColorQualifier;t(c)&&(a=h.createPickFragmentShaderSource(a,c));var d="";t(l)&&(d="#version "+l),i&&(d+="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n#else\n precision mediump float;\n#endif\n\n");var p=e.defines;if(t(p))for(r=0,n=p.length;r<n;++r){var m=p[r];0!==m.length&&(d+="#define "+m+"\n")}return e.includeBuiltIns&&(d+=u(a)),d+="\n#line 0\n",d+=a}function h(i){i=e(i,e.EMPTY_OBJECT);var r=i.pickColorQualifier;this.defines=t(i.defines)?i.defines.slice(0):[],this.sources=t(i.sources)?i.sources.slice(0):[],this.pickColorQualifier=r,this.includeBuiltIns=e(i.includeBuiltIns,!0)}h.prototype.clone=function(){return new h({sources:this.sources,defines:this.defines,pickColorQuantifier:this.pickColorQualifier,includeBuiltIns:this.includeBuiltIns})},h.replaceMain=function(e,t){return t="void "+t+"()",e.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,t)},h.prototype.createCombinedVertexShader=function(){return c(this,!1)},h.prototype.createCombinedFragmentShader=function(){return c(this,!0)},h._czmBuiltinsAndUniforms={};for(var d in r)r.hasOwnProperty(d)&&(h._czmBuiltinsAndUniforms[d]=r[d]);for(var p in n)if(n.hasOwnProperty(p)){var m=n[p];"function"==typeof m.getDeclaration&&(h._czmBuiltinsAndUniforms[p]=m.getDeclaration(p))}h.createPickVertexShaderSource=function(e){var t=h.replaceMain(e,"czm_old_main"),i="attribute vec4 pickColor; \nvarying vec4 czm_pickColor; \nvoid main() \n{ \n czm_old_main(); \n czm_pickColor = pickColor; \n}";return t+"\n"+i},h.createPickFragmentShaderSource=function(e,t){var i=h.replaceMain(e,"czm_old_main"),r=t+" vec4 czm_pickColor; \nvoid main() \n{ \n czm_old_main(); \n if (gl_FragColor.a == 0.0) { \n discard; \n } \n gl_FragColor = czm_pickColor; \n}";return i+"\n"+r},h.findVarying=function(e,t){for(var i=e.sources,r=t.length,n=0;n<r;++n)for(var o=t[n],a=i.length,s=0;s<a;++s)if(i[s].indexOf(o)!==-1)return o};var f=["v_normalEC","v_normal"];h.findNormalVarying=function(e){return h.findVarying(e,f)};var _=["v_positionEC"];return h.findPositionVarying=function(e){return h.findVarying(e,_)},h}),i("Renderer/Buffer",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/IndexDatatype","../Core/WebGLConstants","./BufferUsage"],function(e,t,i,r,n,o,a,s){"use strict";function l(i){i=e(i,e.EMPTY_OBJECT);var r=i.context._gl,n=i.bufferTarget,o=i.typedArray,a=i.sizeInBytes,s=i.usage,l=t(o);l&&(a=o.byteLength);var u=r.createBuffer();r.bindBuffer(n,u),r.bufferData(n,l?o:a,s),r.bindBuffer(n,null),this._gl=r,this._bufferTarget=n,this._sizeInBytes=a,this._usage=s,this._buffer=u,this.vertexArrayDestroyable=!0}return l.createVertexBuffer=function(e){return new l({context:e.context,bufferTarget:a.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})},l.createIndexBuffer=function(e){var t=e.context,r=e.indexDatatype,n=o.getSizeInBytes(r),s=new l({context:t,bufferTarget:a.ELEMENT_ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage}),u=s.sizeInBytes/n;return i(s,{indexDatatype:{get:function(){return r}},bytesPerIndex:{get:function(){return n}},numberOfIndices:{get:function(){return u}}}),s},i(l.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}}),l.prototype._getBuffer=function(){return this._buffer},l.prototype.copyFromArrayView=function(t,i){i=e(i,0);var r=this._gl,n=this._bufferTarget;r.bindBuffer(n,this._buffer),r.bufferSubData(n,i,t),r.bindBuffer(n,null)},l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),r(this)},l}),i("Renderer/VertexArray",["../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Geometry","../Core/IndexDatatype","../Core/Math","../Core/RuntimeError","./Buffer","./BufferUsage","./ContextLimits"],function(e,t,i,r,n,o,a,s,l,u,c,h,d){"use strict";function p(r,n,o,a){var s=i(n.vertexBuffer),l=i(n.value),u=n.value?n.value.length:n.componentsPerAttribute,c={index:t(n.index,o),enabled:t(n.enabled,!0),vertexBuffer:n.vertexBuffer,value:l?n.value.slice(0):void 0,componentsPerAttribute:u,componentDatatype:t(n.componentDatatype,e.FLOAT),normalize:t(n.normalize,!1),offsetInBytes:t(n.offsetInBytes,0),strideInBytes:t(n.strideInBytes,0),instanceDivisor:t(n.instanceDivisor,0)};if(s)c.vertexAttrib=function(e){var t=this.index;e.bindBuffer(e.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),e.vertexAttribPointer(t,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),e.enableVertexAttribArray(t),this.instanceDivisor>0&&(a.glVertexAttribDivisor(t,this.instanceDivisor),a._vertexAttribDivisors[t]=this.instanceDivisor,a._previousDrawInstanced=!0)},c.disableVertexAttribArray=function(e){e.disableVertexAttribArray(this.index),this.instanceDivisor>0&&a.glVertexAttribDivisor(o,0)};else{switch(c.componentsPerAttribute){case 1:c.vertexAttrib=function(e){e.vertexAttrib1fv(this.index,this.value)};break;case 2:c.vertexAttrib=function(e){e.vertexAttrib2fv(this.index,this.value)};break;case 3:c.vertexAttrib=function(e){e.vertexAttrib3fv(this.index,this.value)};break;case 4:c.vertexAttrib=function(e){e.vertexAttrib4fv(this.index,this.value)}}c.disableVertexAttribArray=function(e){}}r.push(c)}function m(e,t,r){for(var n=0;n<t.length;++n){var o=t[n];o.enabled&&o.vertexAttrib(e)}i(r)&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,r._getBuffer())}function f(r){r=t(r,t.EMPTY_OBJECT);var n,o=r.context,a=o._gl,s=r.attributes,l=r.indexBuffer,u=[],c=1,h=!1,d=s.length;for(n=0;n<d;++n)p(u,s[n],n,o);for(d=u.length,n=0;n<d;++n){var f=u[n];if(i(f.vertexBuffer)&&0===f.instanceDivisor){var _=f.strideInBytes||f.componentsPerAttribute*e.getSizeInBytes(f.componentDatatype);c=f.vertexBuffer.sizeInBytes/_;break}}for(n=0;n<d;++n)if(u[n].instanceDivisor>0){h=!0;break}var g;o.vertexArrayObject&&(g=o.glCreateVertexArray(),o.glBindVertexArray(g),m(a,u,l),o.glBindVertexArray(null)),this._numberOfVertices=c,this._hasInstancedAttributes=h,this._context=o,this._gl=a,this._vao=g,this._attributes=u,this._indexBuffer=l}function _(e){return e.values.length/e.componentsPerAttribute}function g(t){return e.getSizeInBytes(t.componentDatatype)*t.componentsPerAttribute}function v(t){var r,n,o,a=[];for(n in t)t.hasOwnProperty(n)&&i(t[n])&&i(t[n].values)&&(a.push(n),t[n].componentDatatype===e.DOUBLE&&(t[n].componentDatatype=e.FLOAT,t[n].values=e.createTypedArray(e.FLOAT,t[n].values)));var s,l=a.length;if(l>0)for(s=_(t[a[0]]),r=1;r<l;++r){var c=_(t[a[r]]);if(c!==s)throw new u("Each attribute list must have the same number of vertices. Attribute "+a[r]+" has a different number of vertices ("+c.toString()+") than attribute "+a[0]+" ("+s.toString()+").")}a.sort(function(i,r){return e.getSizeInBytes(t[r].componentDatatype)-e.getSizeInBytes(t[i].componentDatatype)});var h=0,d={};for(r=0;r<l;++r)n=a[r],o=t[n],d[n]=h,h+=g(o);if(h>0){var p=e.getSizeInBytes(t[a[0]].componentDatatype),m=h%p;0!==m&&(h+=p-m);var f=s*h,v=new ArrayBuffer(f),y={};for(r=0;r<l;++r){n=a[r];var C=e.getSizeInBytes(t[n].componentDatatype);y[n]={pointer:e.createTypedArray(t[n].componentDatatype,v),index:d[n]/C,strideInComponentType:h/C}}for(r=0;r<s;++r)for(var w=0;w<l;++w){n=a[w],o=t[n];for(var S=o.values,E=y[n],b=E.pointer,T=o.componentsPerAttribute,x=0;x<T;++x)b[E.index+x]=S[r*T+x];E.index+=E.strideInComponentType}return{buffer:v,offsetsInBytes:d,vertexSizeInBytes:h}}}function y(e){var t=e._context,i=e._hasInstancedAttributes;if(i||t._previousDrawInstanced){t._previousDrawInstanced=i;var r,n=t._vertexAttribDivisors,o=e._attributes,a=d.maximumVertexAttributes;if(i){var s=o.length;for(r=0;r<s;++r){var l=o[r];if(l.enabled){var u=l.instanceDivisor,c=l.index;u!==n[c]&&(t.glVertexAttribDivisor(c,u),n[c]=u)}}}else for(r=0;r<a;++r)n[r]>0&&(t.glVertexAttribDivisor(r,0),n[r]=0)}}return f.fromGeometry=function(r){r=t(r,t.EMPTY_OBJECT);var n,o,u,d=r.context,p=t(r.geometry,t.EMPTY_OBJECT),m=t(r.bufferUsage,h.DYNAMIC_DRAW),_=t(r.attributeLocations,t.EMPTY_OBJECT),g=t(r.interleave,!1),y=r.vertexArrayAttributes,C=i(y)?y:[],w=p.attributes;if(g){var S=v(w);if(i(S)){u=c.createVertexBuffer({context:d,typedArray:S.buffer,usage:m});var E=S.offsetsInBytes,b=S.vertexSizeInBytes;for(n in w)w.hasOwnProperty(n)&&i(w[n])&&(o=w[n],i(o.values)?C.push({index:_[n],vertexBuffer:u,componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,offsetInBytes:E[n],strideInBytes:b}):C.push({index:_[n],value:o.value,componentDatatype:o.componentDatatype,normalize:o.normalize}))}}else for(n in w)if(w.hasOwnProperty(n)&&i(w[n])){o=w[n];var T=o.componentDatatype;T===e.DOUBLE&&(T=e.FLOAT),u=void 0,i(o.values)&&(u=c.createVertexBuffer({context:d,typedArray:e.createTypedArray(T,o.values),usage:m})),C.push({index:_[n],vertexBuffer:u,value:o.value,componentDatatype:T,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize})}var x,A=p.indices;return i(A)&&(x=a.computeNumberOfVertices(p)>=l.SIXTY_FOUR_KILOBYTES&&d.elementIndexUint?c.createIndexBuffer({context:d,typedArray:new Uint32Array(A),usage:m,indexDatatype:s.UNSIGNED_INT}):c.createIndexBuffer({context:d,typedArray:new Uint16Array(A),usage:m,indexDatatype:s.UNSIGNED_SHORT})),new f({context:d,attributes:C,indexBuffer:x})},r(f.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}}),f.prototype.getAttribute=function(e){return this._attributes[e]},f.prototype._bind=function(){i(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&y(this)):m(this._gl,this._attributes,this._indexBuffer)},f.prototype._unBind=function(){if(i(this._vao))this._context.glBindVertexArray(null);else{for(var e=this._attributes,t=this._gl,r=0;r<e.length;++r){var n=e[r];n.enabled&&n.disableVertexAttribArray(t)}this._indexBuffer&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null)}},f.prototype.isDestroyed=function(){return!1},f.prototype.destroy=function(){for(var e=this._attributes,t=0;t<e.length;++t){var r=e[t].vertexBuffer;i(r)&&!r.isDestroyed()&&r.vertexArrayDestroyable&&r.destroy()}var o=this._indexBuffer;return i(o)&&!o.isDestroyed()&&o.vertexArrayDestroyable&&o.destroy(),i(this._vao)&&this._context.glDeleteVertexArray(this._vao),n(this)},f}),i("Scene/BatchTable",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/combine","../Core/ComponentDatatype","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/FeatureDetection","../Core/Math","../Core/PixelFormat","../Core/RuntimeError","../Renderer/ContextLimits","../Renderer/PixelDatatype","../Renderer/Sampler","../Renderer/Texture","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v){"use strict";function y(t,r,n){if(this._attributes=r,this._numberOfInstances=n,0!==r.length){var o=C(r),a=t.floatingPointTexture,s=o===m.FLOAT&&!a,l=S(r,s),u=E(l,r,s),c=Math.floor(p.maximumTextureSize/u),h=Math.min(n,c),d=u*h,f=Math.ceil(n/h),_=1/d,g=.5*_,v=1/f,y=.5*v;this._textureDimensions=new e(d,f),this._textureStep=new i(_,g,v,y),this._pixelDatatype=s?m.UNSIGNED_BYTE:o,this._packFloats=s,this._offsets=l,this._stride=u,this._texture=void 0;var w=4*d*f;this._batchValues=o!==m.FLOAT||s?new Uint8Array(w):new Float32Array(w),this._batchValuesDirty=!1}}function C(e){for(var t=!1,i=e.length,r=0;r<i;++r)if(e[r].componentDatatype!==n.UNSIGNED_BYTE){t=!0;break}return t?m.FLOAT:m.UNSIGNED_BYTE}function w(r,n){var o=r[n].componentsPerAttribute;return 2===o?e:3===o?t:4===o?i:Number}function S(e,t){for(var i=new Array(e.length),r=0,o=e.length,a=0;a<o;++a){var s=e[a],l=s.componentDatatype;i[a]=r,l!==n.UNSIGNED_BYTE&&t?r+=4:++r}return i}function E(e,t,i){var r=e.length,o=e[r-1],a=t[r-1],s=a.componentDatatype;return s!==n.UNSIGNED_BYTE&&i?o+4:o+1}function b(e){var t=e.w/2,i=Math.floor(t),r=2*(t-i);if(i-=G,r=2*r-1,r=-r,i>=G)return r<0?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY;var n=r*e.x*k;return n+=r*e.y*z,n+=r*e.z*U,n*Math.pow(10,i)}function T(e,t,r){var n=i.unpack(e,t,L),o=b(n);n=i.unpack(e,t+4,L);var a=b(n);n=i.unpack(e,t+8,L);var s=b(n);n=i.unpack(e,t+12,L);var l=b(n);return i.fromElements(o,a,s,l,r)}function x(e,t){if(W[0]=e,e=W[0],0===e)return i.clone(i.ZERO,t);var r,n=e<0?1:0;isFinite(e)?(e=Math.abs(e),r=Math.floor(c.logBase(e,10))+1,e/=Math.pow(10,r)):(e=.1,r=G);var o=e*B;return t.x=Math.floor(o),o=(o-t.x)*B,t.y=Math.floor(o),o=(o-t.y)*B,t.z=Math.floor(o),t.w=2*(r+G)+n,t}function A(e,t,r){var n=x(e.x,L);i.pack(n,t,r),n=x(e.y,n),i.pack(n,t,r+4),n=x(e.z,n),i.pack(n,t,r+8),n=x(e.w,n),i.pack(n,t,r+12)}function P(e,t){var i=e._textureDimensions;e._texture=new _({context:t,pixelFormat:h.RGBA,pixelDatatype:e._pixelDatatype,width:i.x,height:i.y,sampler:new f({minificationFilter:v.NEAREST,magnificationFilter:g.NEAREST})})}function D(e){var t=e._textureDimensions;e._texture.copyFrom({width:t.x,height:t.y,arrayBufferView:e._batchValues})}function M(e){var t=e._stride;return 1===e._textureDimensions.y?"uniform vec4 batchTextureStep; \nvec2 computeSt(float batchId) \n{ \n float stepX = batchTextureStep.x; \n float centerX = batchTextureStep.y; \n float numberOfAttributes = float("+t+"); \n return vec2(centerX + (batchId * numberOfAttributes * stepX), 0.5); \n} \n":"uniform vec4 batchTextureStep; \nuniform vec2 batchTextureDimensions; \nvec2 computeSt(float batchId) \n{ \n float stepX = batchTextureStep.x; \n float centerX = batchTextureStep.y; \n float stepY = batchTextureStep.z; \n float centerY = batchTextureStep.w; \n float numberOfAttributes = float("+t+"); \n float xId = mod(batchId * numberOfAttributes, batchTextureDimensions.x); \n float yId = floor(batchId * numberOfAttributes / batchTextureDimensions.x); \n return vec2(centerX + (xId * stepX), 1.0 - (centerY + (yId * stepY))); \n} \n"}function I(e){return e._packFloats?"float unpackFloat(vec4 value) \n{ \n value *= 255.0; \n float temp = value.w / 2.0; \n float exponent = floor(temp); \n float sign = (temp - exponent) * 2.0; \n exponent = exponent - float("+G+"); \n sign = sign * 2.0 - 1.0; \n sign = -sign; \n float unpacked = sign * value.x * float("+k+"); \n unpacked += sign * value.y * float("+z+"); \n unpacked += sign * value.z * float("+U+"); \n return unpacked * pow(10.0, exponent); \n} \n":""; +}function R(e){return 1===e?"float":"vec"+e}function O(e){return 1===e?".x":2===e?".xy":3===e?".xyz":""}function N(e,t){var i=e._attributes,r=i[t],o=r.componentsPerAttribute,a=r.functionName,s=R(o),l=O(o),u=e._offsets[t],c=s+" "+a+"(float batchId) \n{ \n vec2 st = computeSt(batchId); \n st.x += batchTextureStep.x * float("+u+"); \n";return c+=e._packFloats&&r.componentDatatype!==m.UNSIGNED_BYTE?"vec4 textureValue; \ntextureValue.x = unpackFloat(texture2D(batchTexture, st)); \ntextureValue.y = unpackFloat(texture2D(batchTexture, st + vec2(batchTextureStep.x, 0.0))); \ntextureValue.z = unpackFloat(texture2D(batchTexture, st + vec2(batchTextureStep.x * 2.0, 0.0))); \ntextureValue.w = unpackFloat(texture2D(batchTexture, st + vec2(batchTextureStep.x * 3.0, 0.0))); \n":" vec4 textureValue = texture2D(batchTexture, st); \n",c+=" "+s+" value = textureValue"+l+"; \n",e._pixelDatatype!==m.UNSIGNED_BYTE||r.componentDatatype!==n.UNSIGNED_BYTE||r.normalize?e._pixelDatatype===m.FLOAT&&r.componentDatatype===n.UNSIGNED_BYTE&&r.normalize&&(c+="value /= 255.0; \n"):c+="value *= 255.0; \n",c+=" return value; \n} \n"}a(y.prototype,{attributes:{get:function(){return this._attributes}},numberOfInstances:{get:function(){return this._numberOfInstances}}});var L=new i,B=256,F=65536,V=16777216,k=1/B,z=1/F,U=1/V,G=38;if(u.supportsTypedArrays()){var W=new Float32Array(1),H=new i;y.prototype.getBatchedAttribute=function(e,t,r){var n,a=this._attributes,s=this._offsets[t],l=this._stride,u=4*l*e+4*s;n=this._packFloats&&a[t].componentDatatype!==m.UNSIGNED_BYTE?T(this._batchValues,u,H):i.unpack(this._batchValues,u,H);var c=w(a,t);return o(c.fromCartesian4)?c.fromCartesian4(n,r):o(c.clone)?c.clone(n,r):n.x};var q=[void 0,void 0,new e,new t,new i],j=new i;return y.prototype.setBatchedAttribute=function(e,t,r){var n=this._attributes,a=q[n[t].componentsPerAttribute],s=this.getBatchedAttribute(e,t,a),l=w(this._attributes,t),u=o(l.equals)?l.equals(s,r):s===r;if(!u){var c=j;c.x=o(r.x)?r.x:r,c.y=o(r.y)?r.y:0,c.z=o(r.z)?r.z:0,c.w=o(r.w)?r.w:0;var h=this._offsets[t],d=this._stride,p=4*d*e+4*h;this._packFloats&&n[t].componentDatatype!==m.UNSIGNED_BYTE?A(c,this._batchValues,p):i.pack(c,this._batchValues,p),this._batchValuesDirty=!0}},y.prototype.update=function(e){o(this._texture)&&!this._batchValuesDirty||0===this._attributes.length||(this._batchValuesDirty=!1,o(this._texture)||P(this,e.context),D(this))},y.prototype.getUniformMapCallback=function(){var e=this;return function(t){if(0===e._attributes.length)return t;var i={batchTexture:function(){return e._texture},batchTextureDimensions:function(){return e._textureDimensions},batchTextureStep:function(){return e._textureStep}};return r(t,i)}},y.prototype.getVertexShaderCallback=function(){var e=this._attributes;if(0===e.length)return function(e){return e};var t="uniform sampler2D batchTexture; \n";t+=M(this)+"\n",t+=I(this)+"\n";for(var i=e.length,r=0;r<i;++r)t+=N(this,r);return function(e){var i=e.indexOf("void main"),r=e.substring(0,i),n=e.substring(i);return r+"\n"+t+"\n"+n}},y.prototype.isDestroyed=function(){return!1},y.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),s(this)},y}}),i("Scene/PrimitivePipeline",["../Core/BoundingSphere","../Core/ComponentDatatype","../Core/defined","../Core/DeveloperError","../Core/Ellipsoid","../Core/FeatureDetection","../Core/GeographicProjection","../Core/Geometry","../Core/GeometryAttribute","../Core/GeometryAttributes","../Core/GeometryPipeline","../Core/IndexDatatype","../Core/Matrix4","../Core/WebMercatorProjection"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p){"use strict";function m(e,t,r){var n,o=!r,a=e.length;if(!o&&a>1){var s=e[0].modelMatrix;for(n=1;n<a;++n)if(!d.equals(s,e[n].modelMatrix)){o=!0;break}}if(o)for(n=0;n<a;++n)i(e[n].geometry)&&c.transformToWorldCoordinates(e[n]);else d.multiplyTransformation(t,e[0].modelMatrix,t)}function f(e,i){var r=e.attributes,n=r.position,o=n.values.length/n.componentsPerAttribute;r.batchId=new l({componentDatatype:t.FLOAT,componentsPerAttribute:1,values:new Float32Array(o)});for(var a=r.batchId.values,s=0;s<o;++s)a[s]=i}function _(e){for(var t=e.length,r=0;r<t;++r){var n=e[r];i(n.geometry)?f(n.geometry,r):i(n.westHemisphereGeometry)&&i(n.eastHemisphereGeometry)&&(f(n.westHemisphereGeometry,r),f(n.eastHemisphereGeometry,r))}}function g(r){var n,o,a,s=r.instances,l=r.projection,u=r.elementIndexUintSupported,h=r.scene3DOnly,d=r.vertexCacheOptimize,p=r.compressVertices,f=r.modelMatrix,g=s.length;for(n=0;n<g;++n)if(i(s[n].geometry)){a=s[n].geometry.primitiveType;break}if(m(s,f,h),!h)for(n=0;n<g;++n)i(s[n].geometry)&&c.splitLongitude(s[n]);if(_(s),d)for(n=0;n<g;++n){var v=s[n];i(v.geometry)?(c.reorderForPostVertexCache(v.geometry),c.reorderForPreVertexCache(v.geometry)):i(v.westHemisphereGeometry)&&i(v.eastHemisphereGeometry)&&(c.reorderForPostVertexCache(v.westHemisphereGeometry),c.reorderForPreVertexCache(v.westHemisphereGeometry),c.reorderForPostVertexCache(v.eastHemisphereGeometry),c.reorderForPreVertexCache(v.eastHemisphereGeometry))}var y=c.combineInstances(s);for(g=y.length,n=0;n<g;++n){o=y[n];var C,w=o.attributes;if(h)for(C in w)w.hasOwnProperty(C)&&w[C].componentDatatype===t.DOUBLE&&c.encodeAttribute(o,C,C+"3DHigh",C+"3DLow");else for(C in w)if(w.hasOwnProperty(C)&&w[C].componentDatatype===t.DOUBLE){var S=C+"3D",E=C+"2D";c.projectTo2D(o,C,S,E,l),i(o.boundingSphere)&&"position"===C&&(o.boundingSphereCV=e.fromVertices(o.attributes.position2D.values)),c.encodeAttribute(o,S,S+"High",S+"Low"),c.encodeAttribute(o,E,E+"High",E+"Low")}p&&c.compressVertices(o)}if(!u){var b=[];for(g=y.length,n=0;n<g;++n)o=y[n],b=b.concat(c.fitToUnsignedShortIndices(o));y=b}return y}function v(e,t,r,n){var o,a,s,l=n.length-1;if(l>=0){var u=n[l];o=u.offset+u.count,s=u.index,a=r[s].indices.length}else o=0,s=0,a=r[s].indices.length;for(var c=e.length,h=0;h<c;++h){var d=e[h],p=d[t];if(i(p)){var m=p.indices.length;o+m>a&&(o=0,a=r[++s].indices.length),n.push({index:s,offset:o,count:m}),o+=m}}}function y(e,t){var i=[];return v(e,"geometry",t,i),v(e,"westHemisphereGeometry",t,i),v(e,"eastHemisphereGeometry",t,i),i}function C(e,t){var r=e.attributes;for(var n in r)if(r.hasOwnProperty(n)){var o=r[n];i(o)&&i(o.values)&&t.push(o.values.buffer)}i(e.indices)&&t.push(e.indices.buffer)}function w(e,t){for(var i=e.length,r=0;r<i;++r)C(e[r],t)}function S(t){for(var r=1,n=t.length,o=0;o<n;o++){var a=t[o];if(++r,i(a)){var s=a.attributes;r+=6+2*e.packedLength+(i(a.indices)?a.indices.length:0);for(var l in s)if(s.hasOwnProperty(l)&&i(s[l])){var u=s[l];r+=5+u.values.length}}}return r}function E(e,t){var i=e.length,r=new Float64Array(1+16*i),n=0;r[n++]=i;for(var o=0;o<i;o++){var a=e[o];d.pack(a.modelMatrix,r,n),n+=d.packedLength}return t.push(r.buffer),r}function b(e){for(var t=e,i=new Array(t[0]),r=0,n=1;n<t.length;){var o=d.unpack(t,n);n+=d.packedLength,i[r++]={modelMatrix:o}}return i}function T(t){var r=t.length,n=1+(e.packedLength+1)*r,o=new Float32Array(n),a=0;o[a++]=r;for(var s=0;s<r;++s){var l=t[s];i(l)?(o[a++]=1,e.pack(t[s],o,a)):o[a++]=0,a+=e.packedLength}return o}function x(t){for(var i=new Array(t[0]),r=0,n=1;n<t.length;)1===t[n++]&&(i[r]=e.unpack(t,n)),++r,n+=e.packedLength;return i}if(!o.supportsTypedArrays())return{};var A={};return A.combineGeometry=function(t){var r,n,o=t.instances,a=o.length;a>0&&(r=g(t),r.length>0&&(n=c.createAttributeLocations(r[0])));var s;t.createPickOffsets&&r.length>0&&(s=y(o,r));for(var l=new Array(a),u=new Array(a),h=0;h<a;++h){var d=o[h],p=d.geometry;i(p)&&(l[h]=p.boundingSphere,u[h]=p.boundingSphereCV);var m=d.eastHemisphereGeometry,f=d.westHemisphereGeometry;i(m)&&i(f)&&(i(m.boundingSphere)&&i(f.boundingSphere)&&(l[h]=e.union(m.boundingSphere,f.boundingSphere)),i(m.boundingSphereCV)&&i(f.boundingSphereCV)&&(u[h]=e.union(m.boundingSphereCV,f.boundingSphereCV)))}return{geometries:r,modelMatrix:t.modelMatrix,attributeLocations:n,pickOffsets:s,boundingSpheres:l,boundingSpheresCV:u}},A.packCreateGeometryResults=function(t,r){var n=new Float64Array(S(t)),o=[],a={},s=t.length,l=0;n[l++]=s;for(var u=0;u<s;u++){var c=t[u],h=i(c);if(n[l++]=h?1:0,h){n[l++]=c.primitiveType,n[l++]=c.geometryType;var d=i(c.boundingSphere)?1:0;n[l++]=d,d&&e.pack(c.boundingSphere,n,l),l+=e.packedLength;var p=i(c.boundingSphereCV)?1:0;n[l++]=p,p&&e.pack(c.boundingSphereCV,n,l),l+=e.packedLength;var m=c.attributes,f=[];for(var _ in m)m.hasOwnProperty(_)&&i(m[_])&&(f.push(_),i(a[_])||(a[_]=o.length,o.push(_)));n[l++]=f.length;for(var g=0;g<f.length;g++){var v=f[g],y=m[v];n[l++]=a[v],n[l++]=y.componentDatatype,n[l++]=y.componentsPerAttribute,n[l++]=y.normalize?1:0,n[l++]=y.values.length,n.set(y.values,l),l+=y.values.length}var C=i(c.indices)?c.indices.length:0;n[l++]=C,C>0&&(n.set(c.indices,l),l+=C)}}return r.push(n.buffer),{stringTable:o,packedData:n}},A.unpackCreateGeometryResults=function(i){for(var r,n=i.stringTable,o=i.packedData,a=new Array(o[0]),c=0,d=1;d<o.length;){var p=1===o[d++];if(p){var m,f,_=o[d++],g=o[d++],v=1===o[d++];v&&(m=e.unpack(o,d)),d+=e.packedLength;var y=1===o[d++];y&&(f=e.unpack(o,d)),d+=e.packedLength;var C,w,S,E=new u,b=o[d++];for(r=0;r<b;r++){var T=n[o[d++]],x=o[d++];S=o[d++];var A=0!==o[d++];C=o[d++],w=t.createTypedArray(x,C);for(var P=0;P<C;P++)w[P]=o[d++];E[T]=new l({componentDatatype:x,componentsPerAttribute:S,normalize:A,values:w})}var D;if(C=o[d++],C>0){var M=w.length/S;for(D=h.createTypedArray(M,C),r=0;r<C;r++)D[r]=o[d++]}a[c++]=new s({primitiveType:_,geometryType:g,boundingSphere:m,boundingSphereCV:f,indices:D,attributes:E})}else a[c++]=void 0}return a},A.packCombineGeometryParameters=function(e,t){for(var i=e.createGeometryResults,r=i.length,n=0;n<r;n++)t.push(i[n].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:E(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof a,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}},A.unpackCombineGeometryParameters=function(e){for(var t=b(e.packedInstances),i=e.createGeometryResults,r=i.length,o=0,s=0;s<r;s++)for(var l=A.unpackCreateGeometryResults(i[s]),u=l.length,c=0;c<u;c++){var h=l[c],m=t[o];m.geometry=h,++o}var f=n.clone(e.ellipsoid),_=e.isGeographic?new a(f):new p(f);return{instances:t,ellipsoid:f,projection:_,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:d.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}},A.packCombineGeometryResults=function(e,t){i(e.geometries)&&w(e.geometries,t);var r=T(e.boundingSpheres),n=T(e.boundingSpheresCV);return t.push(r.buffer,n.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,boundingSpheres:r,boundingSpheresCV:n}},A.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,boundingSpheres:x(e.boundingSpheres),boundingSpheresCV:x(e.boundingSpheresCV)}},A}),i("Scene/PrimitiveState",["../Core/freezeObject"],function(e){"use strict";var t={READY:0,CREATING:1,CREATED:2,COMBINING:3,COMBINED:4,COMPLETE:5,FAILED:6};return e(t)}),i("Scene/SceneMode",["../Core/freezeObject"],function(e){"use strict";var t={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};return t.getMorphTime=function(e){if(e===t.SCENE3D)return 1;if(e!==t.MORPHING)return 0},e(t)}),i("Scene/ShadowMode",["../Core/freezeObject"],function(e){"use strict";var t={DISABLED:0,ENABLED:1,CAST_ONLY:2,RECEIVE_ONLY:3,NUMBER_OF_SHADOW_MODES:4};return t.castShadows=function(e){return e===t.ENABLED||e===t.CAST_ONLY},t.receiveShadows=function(e){return e===t.ENABLED||e===t.RECEIVE_ONLY},t.fromCastReceive=function(e,i){return e&&i?t.ENABLED:e?t.CAST_ONLY:i?t.RECEIVE_ONLY:t.DISABLED},e(t)}),i("Scene/Primitive",["../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/clone","../Core/Color","../Core/combine","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EncodedCartesian3","../Core/FeatureDetection","../Core/Geometry","../Core/GeometryAttribute","../Core/GeometryAttributes","../Core/isArray","../Core/Matrix4","../Core/RuntimeError","../Core/subdivideArray","../Core/TaskProcessor","../Renderer/BufferUsage","../Renderer/ContextLimits","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArray","../ThirdParty/when","./BatchTable","./CullFace","./PrimitivePipeline","./PrimitiveState","./SceneMode","./ShadowMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I,R,O,N,L,B,F,V){"use strict";function k(e){e=u(e,u.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this.appearance=e.appearance,this._appearance=void 0,this._material=void 0,this.modelMatrix=C.clone(u(e.modelMatrix,C.IDENTITY)),this._modelMatrix=new C,this.show=u(e.show,!0),this._vertexCacheOptimize=u(e.vertexCacheOptimize,!1),this._interleave=u(e.interleave,!1),this._releaseGeometryInstances=u(e.releaseGeometryInstances,!0),this._allowPicking=u(e.allowPicking,!0),this._asynchronous=u(e.asynchronous,!0),this._compressVertices=u(e.compressVertices,!0),this.cull=u(e.cull,!0),this.debugShowBoundingVolume=u(e.debugShowBoundingVolume,!1),this.rtcCenter=e.rtcCenter,this.shadows=u(e.shadows,V.DISABLED),this._translucent=void 0,this._state=B.READY,this._geometries=[],this._error=void 0,this._numberOfInstances=0,this._boundingSpheres=[],this._boundingSphereWC=[],this._boundingSphereCV=[],this._boundingSphere2D=[],this._boundingSphereMorph=[],this._perInstanceAttributeCache=[],this._instanceIds=[],this._lastPerInstanceAttributeIndex=0,this._va=[],this._attributeLocations=void 0,this._primitiveType=void 0,this._frontFaceRS=void 0,this._backFaceRS=void 0,this._sp=void 0,this._pickRS=void 0,this._pickSP=void 0,this._pickIds=[],this._colorCommands=[],this._pickCommands=[],this._readOnlyInstanceAttributes=e._readOnlyInstanceAttributes,this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._createRenderStatesFunction=e._createRenderStatesFunction,this._createShaderProgramFunction=e._createShaderProgramFunction,this._createCommandsFunction=e._createCommandsFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._createPickOffsets=e._createPickOffsets,this._pickOffsets=void 0,this._createGeometryResults=void 0,this._ready=!1,this._readyPromise=R.defer(),this._batchTable=void 0,this._batchTableAttributeIndices=void 0,this._instanceBoundingSpheres=void 0,this._instanceBoundingSpheresCV=void 0,this._batchTableBoundingSpheresUpdated=!1,this._batchTableBoundingSphereAttributeIndices=void 0}function z(e){var t,i=e.length,r=[],n=e[0].attributes;for(t in n)if(n.hasOwnProperty(t)){for(var o=n[t],a=!0,s=1;s<i;++s){var l=e[s].attributes[t];if(!c(l)||o.componentDatatype!==l.componentDatatype||o.componentsPerAttribute!==l.componentsPerAttribute||o.normalize!==l.normalize){a=!1;break}}a&&r.push(t)}return r}function U(e){var n=e.length;return 1===n?e[0]:2===n?t.unpack(e,0,le):3===n?i.unpack(e,0,ue):4===n?r.unpack(e,0,ce):void 0}function G(e,t){var i=e.geometryInstances,r=y(i)?i:[i],n=r.length;if(0!==n){var o,s,h,d=z(r),p=d.length,m=e.allowPicking,f=[],_={},g={},v=r[0],C=v.attributes;for(o=0;o<p;++o)s=d[o],h=C[s],_[s]=o,f.push({functionName:"czm_batchTable_"+s,componentDatatype:h.componentDatatype,componentsPerAttribute:h.componentsPerAttribute,normalize:h.normalize});d.indexOf("distanceDisplayCondition")!==-1&&(f.push({functionName:"czm_batchTable_boundingSphereCenter3DHigh",componentDatatype:l.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter3DLow",componentDatatype:l.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DHigh",componentDatatype:l.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DLow",componentDatatype:l.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereRadius",componentDatatype:l.FLOAT,componentsPerAttribute:1}),g.center3DHigh=f.length-5,g.center3DLow=f.length-4,g.center2DHigh=f.length-3,g.center2DLow=f.length-2,g.radius=f.length-1),m&&f.push({functionName:"czm_batchTable_pickColor",componentDatatype:l.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0});var w=f.length,S=new O(t,f,n);for(o=0;o<n;++o){var E=r[o];C=E.attributes;for(var b=0;b<p;++b){s=d[b],h=C[s];var T=U(h.value),x=_[s];S.setBatchedAttribute(o,x,T)}if(m){var A={primitive:u(E.pickPrimitive,e)};c(E.id)&&(A.id=E.id);var P=t.createPickId(A);e._pickIds.push(P);var D=P.color,M=ce;M.x=a.floatToByte(D.red),M.y=a.floatToByte(D.green),M.z=a.floatToByte(D.blue),M.w=a.floatToByte(D.alpha),S.setBatchedAttribute(o,w-1,M)}}e._batchTable=S,e._batchTableAttributeIndices=_,e._batchTableBoundingSphereAttributeIndices=g}}function W(e){var t;return t=y(e.values)?e.values.slice(0):new e.values.constructor(e.values),new g({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:t})}function H(t){var i=t.attributes,r=new v;for(var n in i)i.hasOwnProperty(n)&&c(i[n])&&(r[n]=W(i[n]));var o;if(c(t.indices)){var a=t.indices;o=y(a)?a.slice(0):new a.constructor(a)}return new _({attributes:r,indices:o,primitiveType:t.primitiveType,boundingSphere:e.clone(t.boundingSphere)})}function q(e,t){return{geometry:t,modelMatrix:C.clone(e.modelMatrix),pickPrimitive:e.pickPrimitive,id:e.id}}function j(e,t){if(!e.compressVertices)return t;var i=t.search(/attribute\s+vec3\s+normal;/g)!==-1,r=t.search(/attribute\s+vec2\s+st;/g)!==-1;if(!i&&!r)return t;var n=t.search(/attribute\s+vec3\s+tangent;/g)!==-1,o=t.search(/attribute\s+vec3\s+bitangent;/g)!==-1,a=r&&i?2:1;a+=n||o?1:0;var s=a>1?"vec"+a:"float",l="compressedAttributes",u="attribute "+s+" "+l+";",c="",h="";if(r){c+="vec2 st;\n";var d=a>1?l+".x":l;h+=" st = czm_decompressTextureCoordinates("+d+");\n"}i&&n&&o?(c+="vec3 normal;\nvec3 tangent;\nvec3 bitangent;\n",h+=" czm_octDecode("+l+"."+(r?"yz":"xy")+", normal, tangent, bitangent);\n"):(i&&(c+="vec3 normal;\n",h+=" normal = czm_octDecode("+l+(a>1?"."+(r?"y":"x"):"")+");\n"),n&&(c+="vec3 tangent;\n",h+=" tangent = czm_octDecode("+l+"."+(r&&i?"z":"y")+");\n"),o&&(c+="vec3 bitangent;\n",h+=" bitangent = czm_octDecode("+l+"."+(r&&i?"z":"y")+");\n"));var p=t;p=p.replace(/attribute\s+vec3\s+normal;/g,""),p=p.replace(/attribute\s+vec2\s+st;/g,""),p=p.replace(/attribute\s+vec3\s+tangent;/g,""),p=p.replace(/attribute\s+vec3\s+bitangent;/g,""),p=M.replaceMain(p,"czm_non_compressed_main");var m="void main() \n{ \n"+h+" czm_non_compressed_main(); \n}";return[u,c,p,m].join("\n")}function Y(e,t){e.vertexAttributes}function X(e,t){return function(){return e[t]}}function Z(e,t){var i,r,n,o,a=e._instanceIds;if(e._state===B.READY){i=y(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];var s=e._numberOfInstances=i.length,l=[],h=[];for(n=0;n<s;++n)r=i[n].geometry,a.push(i[n].id),h.push({moduleName:r._workerName,geometry:r});if(!c(de))for(de=new Array(pe),n=0;n<pe;n++)de[n]=new E("createGeometry",Number.POSITIVE_INFINITY);var d;for(h=S(h,pe),n=0;n<h.length;n++){var p=0,m=h[n],f=m.length;for(o=0;o<f;++o)d=m[o],r=d.geometry,c(r.constructor.pack)&&(d.offset=p,p+=u(r.constructor.packedLength,r.packedLength));var _;if(p>0){var g=new Float64Array(p);for(_=[g.buffer],o=0;o<f;++o)d=m[o],r=d.geometry,c(r.constructor.pack)&&(r.constructor.pack(r,g,d.offset),d.geometry=g)}l.push(de[n].scheduleTask({subTasks:h[n]},_))}e._state=B.CREATING,R.all(l,function(t){e._createGeometryResults=t,e._state=B.CREATED}).otherwise(function(i){se(e,t,B.FAILED,i)})}else if(e._state===B.CREATED){var v=[];i=y(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];var w=t.scene3DOnly,b=t.mapProjection,T=me.scheduleTask(L.packCombineGeometryParameters({createGeometryResults:e._createGeometryResults,instances:i,ellipsoid:b.ellipsoid,projection:b,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:w,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets},v),v);e._createGeometryResults=void 0,e._state=B.COMBINING,R(T,function(i){var r=L.unpackCombineGeometryResults(i);e._geometries=r.geometries,e._attributeLocations=r.attributeLocations,e.modelMatrix=C.clone(r.modelMatrix,e.modelMatrix),e._pickOffsets=r.pickOffsets,e._instanceBoundingSpheres=r.boundingSpheres,e._instanceBoundingSpheresCV=r.boundingSpheresCV,c(e._geometries)&&e._geometries.length>0?e._state=B.COMBINED:se(e,t,B.FAILED,void 0)}).otherwise(function(i){se(e,t,B.FAILED,i)})}}function K(e,t){var i,r,n=y(e.geometryInstances)?e.geometryInstances:[e.geometryInstances],o=e._numberOfInstances=n.length,a=new Array(o),s=e._instanceIds,l=0;for(r=0;r<o;r++){i=n[r];var u,h=i.geometry;u=c(h.attributes)&&c(h.primitiveType)?H(h):h.constructor.createGeometry(h),a[l++]=q(i,u),s.push(i.id)}a.length=l;var d=t.scene3DOnly,p=t.mapProjection,m=L.combineGeometry({instances:a,ellipsoid:p.ellipsoid,projection:p,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:d,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets});e._geometries=m.geometries,e._attributeLocations=m.attributeLocations,e.modelMatrix=C.clone(m.modelMatrix,e.modelMatrix),e._pickOffsets=m.pickOffsets,e._instanceBoundingSpheres=m.boundingSpheres,e._instanceBoundingSpheresCV=m.boundingSpheresCV,c(e._geometries)&&e._geometries.length>0?e._state=B.COMBINED:se(e,t,B.FAILED,void 0)}function Q(t,i){var r=c(t._batchTableAttributeIndices.distanceDisplayCondition);if(r||!t._batchTableBoundingSpheresUpdated){for(var n=t._batchTableBoundingSphereAttributeIndices,o=n.center3DHigh,a=n.center3DLow,s=n.center2DHigh,l=n.center2DLow,u=n.radius,h=i.mapProjection,d=h.ellipsoid,p=t._batchTable,f=t._instanceBoundingSpheres,_=f.length,g=0;g<_;++g){var v=f[g];if(c(v)){var y=t.modelMatrix;if(c(y)&&(v=e.transform(v,y,v)),r){var C=v.center,w=v.radius,S=m.fromCartesian(C,fe);p.setBatchedAttribute(g,o,S.high),p.setBatchedAttribute(g,a,S.low);var E=d.cartesianToCartographic(C,_e),b=h.project(E,ge);S=m.fromCartesian(b,fe),p.setBatchedAttribute(g,s,S.high),p.setBatchedAttribute(g,l,S.low),p.setBatchedAttribute(g,u,w)}}}t._batchTableBoundingSpheresUpdated=!0}}function J(t,i){for(var r=t._attributeLocations,n=t._geometries,o=i.scene3DOnly,a=i.context,s=[],l=n.length,u=0;u<l;++u){var h=n[u];if(s.push(I.fromGeometry({context:a,geometry:h,attributeLocations:r,bufferUsage:b.STATIC_DRAW,interleave:t._interleave})),c(t._createBoundingVolumeFunction))t._createBoundingVolumeFunction(i,h);else if(t._boundingSpheres.push(e.clone(h.boundingSphere)),t._boundingSphereWC.push(new e),!o){var d=h.boundingSphereCV.center,p=d.x,m=d.y,f=d.z;d.x=f,d.y=p,d.z=m,t._boundingSphereCV.push(e.clone(h.boundingSphereCV)),t._boundingSphere2D.push(new e),t._boundingSphereMorph.push(new e)}}t._va=s,t._primitiveType=n[0].primitiveType,t.releaseGeometryInstances&&(t.geometryInstances=void 0),t._geometries=void 0,se(t,i,B.COMPLETE,void 0)}function $(e,t,i,r){var n,a=i.getRenderState();r?(n=o(a,!1),n.cull={enabled:!0,face:N.BACK},e._frontFaceRS=P.fromCache(n),n.cull.face=N.FRONT,e._backFaceRS=P.fromCache(n)):(e._frontFaceRS=P.fromCache(a),e._backFaceRS=e._frontFaceRS),e.allowPicking?r?(n=o(a,!1),n.cull={enabled:!1},e._pickRS=P.fromCache(n)):e._pickRS=e._frontFaceRS:(n=o(a,!1),n.colorMask={red:!1,green:!1,blue:!1,alpha:!1},r?(n.cull={enabled:!1},e._pickRS=P.fromCache(n)):e._pickRS=P.fromCache(n))}function ee(e,t,i){var r=t.context,n=e._attributeLocations,o=e._batchTable.getVertexShaderCallback()(i.vertexShaderSource);o=k._appendShowToShader(e,o),o=k._appendDistanceDisplayConditionToShader(e,o,t.scene3DOnly),o=k._updateColorAttribute(e,o),o=j(e,o),o=k._modifyShaderPosition(e,o,t.scene3DOnly);var a=i.getFragmentShaderSource();if(e.allowPicking){var s=M.createPickVertexShaderSource(o);s=k._updatePickColorAttribute(s),e._pickSP=D.replaceCache({context:r,shaderProgram:e._pickSP,vertexShaderSource:s,fragmentShaderSource:M.createPickFragmentShaderSource(a,"varying"),attributeLocations:n})}else e._pickSP=D.fromCache({context:r,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:n});Y(e._pickSP,n),e._sp=D.replaceCache({context:r,shaderProgram:e._sp,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:n}),Y(e._sp,n)}function te(e,t,i,r,n,o,a,l){var u=c(i)?i._uniforms:void 0,h={},d=t.uniforms;if(c(d))for(var p in d)d.hasOwnProperty(p)&&(h[p]=X(d,p));var m=s(h,u);m=e._batchTable.getUniformMapCallback()(m),c(e.rtcCenter)&&(m.u_modifiedModelView=function(){var t=l.context.uniformState.view;return C.multiply(t,e._modelMatrix,ve),C.multiplyByPoint(ve,e.rtcCenter,ye),C.setTranslation(ve,ye,ve),ve});var f=r?A.TRANSLUCENT:A.OPAQUE;o.length=e._va.length*(n?2:1),a.length=e._va.length;for(var _=o.length,g=0,v=0,y=0;y<_;++y){var w;n&&(w=o[y],c(w)||(w=o[y]=new x({owner:e,primitiveType:e._primitiveType})),w.vertexArray=e._va[v],w.renderState=e._backFaceRS,w.shaderProgram=e._sp,w.uniformMap=m,w.pass=f,++y),w=o[y],c(w)||(w=o[y]=new x({owner:e,primitiveType:e._primitiveType})),w.vertexArray=e._va[v],w.renderState=e._frontFaceRS,w.shaderProgram=e._sp,w.uniformMap=m,w.pass=f;var S=a[g];c(S)||(S=a[g]=new x({owner:e,primitiveType:e._primitiveType})),S.vertexArray=e._va[v],S.renderState=e._pickRS,S.shaderProgram=e._pickSP,S.uniformMap=m,S.pass=f,++g,++v}}function ie(e,t){var i=e.appearance.pixelSize;if(c(i))for(var r=e._boundingSpheres.length,n=0;n<r;++n){var o=e._boundingSpheres[n],a=e._boundingSphereWC[n],s=t.camera.getPixelSize(o,t.context.drawingBufferWidth,t.context.drawingBufferHeight),l=s*i;a.radius=o.radius+l}}function re(t,i,r,n,o,a,s,l){if(ie(t,i),!C.equals(o,t._modelMatrix)){C.clone(o,t._modelMatrix);for(var u=t._boundingSpheres.length,h=0;h<u;++h){var d=t._boundingSpheres[h];c(d)&&(t._boundingSphereWC[h]=e.transform(d,o,t._boundingSphereWC[h]),i.scene3DOnly||(t._boundingSphere2D[h]=e.clone(t._boundingSphereCV[h],t._boundingSphere2D[h]),t._boundingSphere2D[h].center.x=0,t._boundingSphereMorph[h]=e.union(t._boundingSphereWC[h],t._boundingSphereCV[h])))}}var p;i.mode===F.SCENE3D?p=t._boundingSphereWC:i.mode===F.COLUMBUS_VIEW?p=t._boundingSphereCV:i.mode===F.SCENE2D&&c(t._boundingSphere2D)?p=t._boundingSphere2D:c(t._boundingSphereMorph)&&(p=t._boundingSphereMorph);var m=i.commandList,f=i.passes;if(f.render)for(var _=V.castShadows(t.shadows),g=V.receiveShadows(t.shadows),v=r.length,y=0;y<v;++y){var w=l?Math.floor(y/2):y,S=r[y];S.modelMatrix=o,S.boundingVolume=p[w],S.cull=a,S.debugShowBoundingVolume=s,S.castShadows=_,S.receiveShadows=g,m.push(S)}if(f.pick)for(var E=n.length,b=0;b<E;++b){var T=n[b];T.modelMatrix=o,T.boundingVolume=p[b],T.cull=a,m.push(T)}}function ne(e,t,i){return function(){var r=e.getBatchedAttribute(t,i),n=e.attributes[i],o=n.componentsPerAttribute,a=l.createTypedArray(n.componentDatatype,o);return c(r.constructor.pack)?r.constructor.pack(r,a,0):a[0]=r,a}}function oe(e,t,i){return function(r){var n=U(r);e.setBatchedAttribute(t,i,n)}}function ae(e,t,i){t.boundingSphere={get:function(){return e._instanceBoundingSpheres[i]}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[i]}}}function se(e,t,i,r){e._error=r,e._state=i,t.afterRender.push(function(){e._ready=e._state===B.COMPLETE||e._state===B.FAILED,c(r)?e._readyPromise.reject(r):e._readyPromise.resolve(e)})}h(k.prototype,{vertexCacheOptimize:{get:function(){return this._vertexCacheOptimize}},interleave:{get:function(){return this._interleave}},releaseGeometryInstances:{get:function(){return this._releaseGeometryInstances}},allowPicking:{get:function(){return this._allowPicking}},asynchronous:{get:function(){return this._asynchronous}},compressVertices:{get:function(){return this._compressVertices}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}}});var le=new t,ue=new i,ce=new r,he=/attribute\s+vec(?:3|4)\s+(.*)3DHigh;/g;k._modifyShaderPosition=function(e,t,i){for(var r,n="",o="",a="";null!==(r=he.exec(t));){var s=r[1],l="vec4 czm_compute"+s[0].toUpperCase()+s.substr(1)+"()";"vec4 czm_computePosition()"!==l&&(n+=l+";\n"),c(e.rtcCenter)?(t=t.replace(/attribute\s+vec(?:3|4)\s+position3DHigh;/g,""),t=t.replace(/attribute\s+vec(?:3|4)\s+position3DLow;/g,""),n+="uniform mat4 u_modifiedModelView;\n",o+="attribute vec4 position;\n",a+=l+"\n{\n return u_modifiedModelView * position;\n}\n\n",t=t.replace(/czm_modelViewRelativeToEye\s+\*\s+/g,""),t=t.replace(/czm_modelViewProjectionRelativeToEye/g,"czm_projection")):i?a+=l+"\n{\n return czm_translateRelativeToEye("+s+"3DHigh, "+s+"3DLow);\n}\n\n":(o+="attribute vec3 "+s+"2DHigh;\nattribute vec3 "+s+"2DLow;\n",a+=l+"\n{\n vec4 p;\n if (czm_morphTime == 1.0)\n {\n p = czm_translateRelativeToEye("+s+"3DHigh, "+s+"3DLow);\n }\n else if (czm_morphTime == 0.0)\n {\n p = czm_translateRelativeToEye("+s+"2DHigh.zxy, "+s+"2DLow.zxy);\n }\n else\n {\n p = czm_columbusViewMorph(\n czm_translateRelativeToEye("+s+"2DHigh.zxy, "+s+"2DLow.zxy),\n czm_translateRelativeToEye("+s+"3DHigh, "+s+"3DLow),\n czm_morphTime);\n }\n return p;\n}\n\n")}return[n,o,t,a].join("\n")},k._appendShowToShader=function(e,t){if(!c(e._batchTableAttributeIndices.show))return t;var i=M.replaceMain(t,"czm_non_show_main"),r="void main() \n{ \n czm_non_show_main(); \n gl_Position *= czm_batchTable_show(batchId); \n}";return i+"\n"+r},k._updateColorAttribute=function(e,t){if(!c(e._batchTableAttributeIndices.color))return t;if(t.search(/attribute\s+vec4\s+color;/g)===-1)return t;var i=t;return i=i.replace(/attribute\s+vec4\s+color;/g,""),i=i.replace(/(\b)color(\b)/g,"$1czm_batchTable_color(batchId)$2")},k._updatePickColorAttribute=function(e){var t=e.replace(/attribute\s+vec4\s+pickColor;/g,"");return t=t.replace(/(\b)pickColor(\b)/g,"$1czm_batchTable_pickColor(batchId)$2")},k._appendDistanceDisplayConditionToShader=function(e,t,i){if(!c(e._batchTableAttributeIndices.distanceDisplayCondition))return t;var r=M.replaceMain(t,"czm_non_distanceDisplayCondition_main"),n="void main() \n{ \n czm_non_distanceDisplayCondition_main(); \n vec2 distanceDisplayCondition = czm_batchTable_distanceDisplayCondition(batchId);\n vec3 boundingSphereCenter3DHigh = czm_batchTable_boundingSphereCenter3DHigh(batchId);\n vec3 boundingSphereCenter3DLow = czm_batchTable_boundingSphereCenter3DLow(batchId);\n vec3 boundingSphereCenter2DHigh = czm_batchTable_boundingSphereCenter2DHigh(batchId);\n vec3 boundingSphereCenter2DLow = czm_batchTable_boundingSphereCenter2DLow(batchId);\n float boundingSphereRadius = czm_batchTable_boundingSphereRadius(batchId);\n";return n+=i?" vec4 centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow);\n":" vec4 centerRTE;\n if (czm_morphTime == 1.0)\n {\n centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow);\n }\n else if (czm_morphTime == 0.0)\n {\n centerRTE = czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy);\n }\n else\n {\n centerRTE = czm_columbusViewMorph(\n czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy),\n czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow),\n czm_morphTime);\n }\n",n+=" float radiusSq = boundingSphereRadius * boundingSphereRadius; \n float distanceSq; \n if (czm_sceneMode == czm_sceneMode2D) \n { \n distanceSq = czm_eyeHeight2D.y - radiusSq; \n } \n else \n { \n distanceSq = dot(centerRTE.xyz, centerRTE.xyz) - radiusSq; \n } \n distanceSq = max(distanceSq, 0.0); \n float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x; \n float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y; \n float show = (distanceSq >= nearSq && distanceSq <= farSq) ? 1.0 : 0.0; \n gl_Position *= show; \n}", +r+"\n"+n};var de,pe=Math.max(f.hardwareConcurrency-1,1),me=new E("combineGeometry",Number.POSITIVE_INFINITY),fe=new m,_e=new n,ge=new i,ve=new C,ye=new i;return k.prototype.update=function(e){if(!(!c(this.geometryInstances)&&0===this._va.length||c(this.geometryInstances)&&y(this.geometryInstances)&&0===this.geometryInstances.length||!c(this.appearance)||e.mode!==F.SCENE3D&&e.scene3DOnly||!e.passes.render&&!e.passes.pick)){if(c(this._error))throw this._error;if(this._state!==B.FAILED){var t=e.context;if(c(this._batchTable)||G(this,t),this._batchTable.attributes.length>0){if(0===T.maximumVertexTextureImageUnits)throw new w("Vertex texture fetch support is required to render primitives with per-instance attributes. The maximum number of vertex texture image units must be greater than zero.");this._batchTable.update(e)}if(this._state!==B.COMPLETE&&this._state!==B.COMBINED&&(this.asynchronous?Z(this,e):K(this,e)),this._state===B.COMBINED&&(Q(this,e),J(this,e)),this.show&&this._state===B.COMPLETE){var i=this.appearance,r=i.material,n=!1,o=!1;this._appearance!==i?(this._appearance=i,this._material=r,n=!0,o=!0):this._material!==r&&(this._material=r,o=!0);var a=this._appearance.isTranslucent();this._translucent!==a&&(this._translucent=a,n=!0),c(this._material)&&this._material.update(t);var s=i.closed&&a;if(n){var l=u(this._createRenderStatesFunction,$);l(this,t,i,s)}if(o){var h=u(this._createShaderProgramFunction,ee);h(this,e,i)}if(n||o){var d=u(this._createCommandsFunction,te);d(this,i,r,a,s,this._colorCommands,this._pickCommands,e)}var p=u(this._updateAndQueueCommandsFunction,re);p(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,s)}}}},k.prototype.getGeometryInstanceAttributes=function(e){for(var t=-1,i=this._lastPerInstanceAttributeIndex,r=this._instanceIds,n=r.length,o=0;o<n;++o){var a=(i+o)%n;if(e===r[a]){t=a;break}}if(t!==-1){var s=this._perInstanceAttributeCache[t];if(c(s))return s;var l=this._batchTable,u=this._batchTableAttributeIndices;s={};var d={};for(var p in u)if(u.hasOwnProperty(p)){var m=u[p];d[p]={get:ne(l,t,m)};var f=!0,_=this._readOnlyInstanceAttributes;if(f&&c(_)){n=_.length;for(var g=0;g<n;++g)if(p===_[g]){f=!1;break}}f&&(d[p].set=oe(l,t,m))}return ae(this,d,t),h(s,d),this._lastPerInstanceAttributeIndex=t,this._perInstanceAttributeCache[t]=s,s}},k.prototype.isDestroyed=function(){return!1},k.prototype.destroy=function(){var e,t;this._sp=this._sp&&this._sp.destroy(),this._pickSP=this._pickSP&&this._pickSP.destroy();var i=this._va;for(e=i.length,t=0;t<e;++t)i[t].destroy();this._va=void 0;var r=this._pickIds;for(e=r.length,t=0;t<e;++t)r[t].destroy();return this._pickIds=void 0,this._batchTable=this._batchTable&&this._batchTable.destroy(),this._instanceIds=void 0,this._perInstanceAttributeCache=void 0,this._attributeLocations=void 0,d(this)},k}),i("DataSources/ColorMaterialProperty",["../Core/Color","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,i,r,n,o){"use strict";function a(e){this._definitionChanged=new r,this._color=void 0,this._colorSubscription=void 0,this.color=e}return i(a.prototype,{isConstant:{get:function(){return o.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:n("color")}),a.prototype.getType=function(e){return"Color"},a.prototype.getValue=function(i,r){return t(r)||(r={}),r.color=o.getValueOrClonedDefault(this._color,i,e.WHITE,r.color),r},a.prototype.equals=function(e){return this===e||e instanceof a&&o.equals(this._color,e._color)},a}),i("DataSources/dynamicGeometryGetBoundingSphere",["../Core/BoundingSphere","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/Matrix4","./BoundingSphereState"],function(e,t,i,r,n,o){"use strict";function a(t,r,n,a){var s;return i(r)&&r.show&&r.ready&&(s=r.getGeometryInstanceAttributes(t),i(s)&&i(s.boundingSphere))?(e.clone(s.boundingSphere,a),o.DONE):i(n)&&n.show&&n.ready&&(s=n.getGeometryInstanceAttributes(t),i(s)&&i(s.boundingSphere))?(e.clone(s.boundingSphere,a),o.DONE):i(r)&&!r.ready||i(n)&&!n.ready?o.PENDING:o.FAILED}return a}),i("DataSources/MaterialProperty",["../Core/Color","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Scene/Material"],function(e,t,i,r,n){"use strict";function o(){r.throwInstantiationError()}return i(o.prototype,{isConstant:{get:r.throwInstantiationError},definitionChanged:{get:r.throwInstantiationError}}),o.prototype.getType=r.throwInstantiationError,o.prototype.getValue=r.throwInstantiationError,o.prototype.equals=r.throwInstantiationError,o.getValue=function(i,r,o){var a;return t(r)&&(a=r.getType(i),t(a))?(t(o)&&o.type===a||(o=n.fromType(a)),r.getValue(i,o.uniforms),o):(t(o)&&o.type===n.ColorType||(o=n.fromType(n.ColorType)),e.clone(e.WHITE,o.uniforms.color),o)},o}),i("DataSources/BoxGeometryUpdater",["../Core/BoxGeometry","../Core/BoxOutlineGeometry","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E){"use strict";function b(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0}function T(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(T.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new h,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._options=new b(e),this._onEntityPropertyChanged(e,"box",e.box,void 0)}function x(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new b(t._entity)}var A=new y(i.WHITE),P=new C(!0),D=new C(!0),M=new C(!1),I=new C(i.BLACK),R=new C(v.DISABLED),O=new C(new u),N=new i;return a(T,{perInstanceColorAppearanceType:{value:_},materialAppearanceType:{value:f}}),a(T.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!o(this._entity.availability)&&E.isConstant(this._showProperty)&&E.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!o(this._entity.availability)&&E.isConstant(this._showProperty)&&E.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!0},geometryChanged:{get:function(){return this._geometryChanged}}}),T.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},T.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},T.prototype.createFillGeometryInstance=function(t){var n,a,s=this._entity,l=s.isAvailable(t),u=new m(l&&s.isShowing&&this._showProperty.getValue(t)&&this._fillProperty.getValue(t)),h=this._distanceDisplayConditionProperty.getValue(t),f=c.fromDistanceDisplayCondition(h);if(this._materialProperty instanceof y){var _=i.WHITE;o(this._materialProperty.color)&&(this._materialProperty.color.isConstant||l)&&(_=this._materialProperty.color.getValue(t)),a=r.fromColor(_),n={show:u,distanceDisplayCondition:f,color:a}}else n={show:u,distanceDisplayCondition:f};return new d({id:s,geometry:e.fromDimensions(this._options),modelMatrix:s._getModelMatrix(p.MINIMUM_VALUE),attributes:n})},T.prototype.createOutlineGeometryInstance=function(e){var n=this._entity,o=n.isAvailable(e),a=E.getValueOrDefault(this._outlineColorProperty,e,i.BLACK),s=this._distanceDisplayConditionProperty.getValue(e);return new d({id:n,geometry:t.fromDimensions(this._options),modelMatrix:n._getModelMatrix(p.MINIMUM_VALUE),attributes:{show:new m(o&&n.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:r.fromColor(a),distanceDisplayCondition:c.fromDistanceDisplayCondition(s)}})},T.prototype.isDestroyed=function(){return!1},T.prototype.destroy=function(){this._entitySubscription(),s(this)},T.prototype._onEntityPropertyChanged=function(e,t,i,r){if("availability"===t||"position"===t||"orientation"===t||"box"===t){var a=this._entity.box;if(!o(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!o(s)||!s.isConstant||s.getValue(p.MINIMUM_VALUE),u=a.outline,c=o(u);if(c&&u.isConstant&&(c=u.getValue(p.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var h=a.dimensions,d=e.position,m=a.show;if(!o(h)||!o(d)||o(m)&&m.isConstant&&!m.getValue(p.MINIMUM_VALUE))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var g=n(a.material,A),v=g instanceof y;this._materialProperty=g,this._fillProperty=n(s,D),this._showProperty=n(m,P),this._showOutlineProperty=n(a.outline,M),this._outlineColorProperty=c?n(a.outlineColor,I):void 0,this._shadowsProperty=n(a.shadows,R),this._distanceDisplayConditionProperty=n(a.distanceDisplayCondition,O);var C=a.outlineWidth;if(this._fillEnabled=l,this._outlineEnabled=c,d.isConstant&&E.isConstant(e.orientation)&&h.isConstant&&E.isConstant(C)){var w=this._options;w.vertexFormat=v?_.VERTEX_FORMAT:f.MaterialSupport.TEXTURED.vertexFormat,w.dimensions=h.getValue(p.MINIMUM_VALUE,w.dimensions),this._outlineWidth=o(C)?C.getValue(p.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},T.prototype.createDynamicUpdater=function(e){return new x(e,this)},x.prototype.update=function(n){var a=this._primitives;a.removeAndDestroy(this._primitive),a.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0;var s=this._geometryUpdater,l=s._entity,u=l.box;if(l.isShowing&&l.isAvailable(n)&&E.getValueOrDefault(u.show,n,!0)){var h=this._options,p=l._getModelMatrix(n),m=E.getValueOrUndefined(u.dimensions,n,h.dimensions);if(o(p)&&o(m)){h.dimensions=m;var v=this._geometryUpdater.shadowsProperty.getValue(n),y=this._geometryUpdater.distanceDisplayConditionProperty,C=y.getValue(n),w=c.fromDistanceDisplayCondition(C);if(E.getValueOrDefault(u.fill,n,!0)){var b=S.getValue(n,s.fillMaterialProperty,this._material);this._material=b;var T=new f({material:b,translucent:b.isTranslucent(),closed:!0});h.vertexFormat=T.vertexFormat,this._primitive=a.add(new g({geometryInstances:new d({id:l,geometry:e.fromDimensions(h),modelMatrix:p,attributes:{distanceDisplayCondition:w}}),appearance:T,asynchronous:!1,shadows:v}))}if(E.getValueOrDefault(u.outline,n,!1)){h.vertexFormat=_.VERTEX_FORMAT;var x=E.getValueOrClonedDefault(u.outlineColor,n,i.BLACK,N),A=E.getValueOrDefault(u.outlineWidth,n,1),P=1!==x.alpha;this._outlinePrimitive=a.add(new g({geometryInstances:new d({id:l,geometry:t.fromDimensions(h),modelMatrix:p,attributes:{color:r.fromColor(x),distanceDisplayCondition:w}}),appearance:new _({flat:!0,translucent:P,renderState:{lineWidth:s._scene.clampLineWidth(A)}}),asynchronous:!1,shadows:v}))}}}},x.prototype.getBoundingSphere=function(e,t){return w(e,this._primitive,this._outlinePrimitive,t)},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),s(this)},T}),i("DataSources/ImageMaterialProperty",["../Core/Cartesian2","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){e=i(e,i.EMPTY_OBJECT),this._definitionChanged=new o,this._image=void 0,this._imageSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._transparent=void 0,this._transparentSubscription=void 0,this.image=e.image,this.repeat=e.repeat,this.color=e.color,this.transparent=e.transparent}var u=new e(1,1),c=!1,h=t.WHITE;return n(l.prototype,{isConstant:{get:function(){return s.isConstant(this._image)&&s.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:a("image"),repeat:a("repeat"),color:a("color"),transparent:a("transparent")}),l.prototype.getType=function(e){return"Image"},l.prototype.getValue=function(e,t){return r(t)||(t={}),t.image=s.getValueOrUndefined(this._image,e),t.repeat=s.getValueOrClonedDefault(this._repeat,e,u,t.repeat),t.color=s.getValueOrClonedDefault(this._color,e,h,t.color),s.getValueOrDefault(this._transparent,e,c)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t},l.prototype.equals=function(e){return this===e||e instanceof l&&s.equals(this._image,e._image)&&s.equals(this._color,e._color)&&s.equals(this._transparent,e._transparent)&&s.equals(this._repeat,e._repeat)},l}),i("DataSources/createMaterialPropertyDescriptor",["../Core/Color","../Core/DeveloperError","./ColorMaterialProperty","./createPropertyDescriptor","./ImageMaterialProperty"],function(e,t,i,r,n){"use strict";function o(t){if(t instanceof e)return new i(t);if("string"==typeof t||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement){var r=new n;return r.image=t,r}}function a(e,t){return r(e,t,o)}return a}),i("DataSources/BoxGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,i,r,n,o,a){"use strict";function s(t){this._dimensions=void 0,this._dimensionsSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),dimensions:a("dimensions"),material:o("material"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),shadows:a("shadows"),distanceDisplayCondition:a("distanceDisplayCondition")}),s.prototype.clone=function(e){return t(e)?(e.dimensions=this.dimensions,e.show=this.show,e.material=this.material,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new s(this)},s.prototype.merge=function(t){this.dimensions=e(this.dimensions,t.dimensions),this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.shadows=e(this.shadows,t.shadows),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},s}),i("DataSources/CallbackProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event"],function(e,t,i,r){"use strict";function n(e,t){this._callback=void 0,this._isConstant=void 0,this._definitionChanged=new r,this.setCallback(e,t)}return t(n.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}}}),n.prototype.getValue=function(e,t){return this._callback(e,t)},n.prototype.setCallback=function(e,t){var i=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,i&&this._definitionChanged.raiseEvent(this)},n.prototype.equals=function(e){return this===e||e instanceof n&&this._callback===e._callback&&this._isConstant===e._isConstant},n}),i("DataSources/CheckerboardMaterialProperty",["../Core/Cartesian2","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){e=i(e,i.EMPTY_OBJECT),this._definitionChanged=new o,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.repeat=e.repeat}var u=t.WHITE,c=t.BLACK,h=new e(2,2);return n(l.prototype,{isConstant:{get:function(){return s.isConstant(this._evenColor)&&s.isConstant(this._oddColor)&&s.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},evenColor:a("evenColor"),oddColor:a("oddColor"),repeat:a("repeat")}),l.prototype.getType=function(e){return"Checkerboard"},l.prototype.getValue=function(e,t){return r(t)||(t={}),t.lightColor=s.getValueOrClonedDefault(this._evenColor,e,u,t.lightColor),t.darkColor=s.getValueOrClonedDefault(this._oddColor,e,c,t.darkColor),t.repeat=s.getValueOrDefault(this._repeat,e,h),t},l.prototype.equals=function(e){return this===e||e instanceof l&&s.equals(this._evenColor,e._evenColor)&&s.equals(this._oddColor,e._oddColor)&&s.equals(this._repeat,e._repeat)},l}),i("DataSources/PositionProperty",["../Core/Cartesian3","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Matrix3","../Core/ReferenceFrame","../Core/Transforms"],function(e,t,i,r,n,o,a){"use strict";function s(){r.throwInstantiationError()}i(s.prototype,{isConstant:{get:r.throwInstantiationError},definitionChanged:{get:r.throwInstantiationError},referenceFrame:{get:r.throwInstantiationError}}),s.prototype.getValue=r.throwInstantiationError,s.prototype.getValueInReferenceFrame=r.throwInstantiationError,s.prototype.equals=r.throwInstantiationError;var l=new n;return s.convertToReferenceFrame=function(i,r,s,u,c){if(!t(r))return r;if(t(c)||(c=new e),s===u)return e.clone(r,c);var h=a.computeIcrfToFixedMatrix(i,l);return t(h)||(h=a.computeTemeToPseudoFixedMatrix(i,l)),s===o.INERTIAL?n.multiplyByVector(h,r,c):s===o.FIXED?n.multiplyByVector(n.transpose(h,l),r,c):void 0},s}),i("DataSources/ConstantPositionProperty",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/ReferenceFrame","./PositionProperty"],function(e,t,i,r,n,o,a,s){"use strict";function l(i,r){this._definitionChanged=new o,this._value=e.clone(i),this._referenceFrame=t(r,a.FIXED)}return r(l.prototype,{isConstant:{get:function(){return!i(this._value)||this._referenceFrame===a.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}}),l.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,a.FIXED,t)},l.prototype.setValue=function(t,r){var n=!1;e.equals(this._value,t)||(n=!0,this._value=e.clone(t)),i(r)&&this._referenceFrame!==r&&(n=!0,this._referenceFrame=r),n&&this._definitionChanged.raiseEvent(this)},l.prototype.getValueInReferenceFrame=function(e,t,i){return s.convertToReferenceFrame(e,this._value,this._referenceFrame,t,i)},l.prototype.equals=function(t){return this===t||t instanceof l&&e.equals(this._value,t._value)&&this._referenceFrame===t._referenceFrame},l}),i("DataSources/CorridorGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,i,r,n,o,a){"use strict";function s(t){this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),material:o("material"),positions:a("positions"),height:a("height"),extrudedHeight:a("extrudedHeight"),granularity:a("granularity"),width:a("width"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),cornerType:a("cornerType"),shadows:a("shadows"),distanceDisplayCondition:a("distanceDisplayCondition")}),s.prototype.clone=function(e){return t(e)?(e.show=this.show,e.material=this.material,e.positions=this.positions,e.height=this.height,e.extrudedHeight=this.extrudedHeight,e.granularity=this.granularity,e.width=this.width,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.cornerType=this.cornerType,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new s(this)},s.prototype.merge=function(t){this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.positions=e(this.positions,t.positions),this.height=e(this.height,t.height),this.extrudedHeight=e(this.extrudedHeight,t.extrudedHeight),this.granularity=e(this.granularity,t.granularity),this.width=e(this.width,t.width),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.cornerType=e(this.cornerType,t.cornerType),this.shadows=e(this.shadows,t.shadows),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},s}),i("DataSources/createRawPropertyDescriptor",["./createPropertyDescriptor"],function(e){"use strict";function t(e){return e}function i(i,r){return e(i,r,t)}return i});i("DataSources/CylinderGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,i,r,n,o,a){"use strict";function s(t){this._length=void 0,this._lengthSubscription=void 0,this._topRadius=void 0,this._topRadiusSubscription=void 0,this._bottomRadius=void 0,this._bottomRadiusSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._slices=void 0,this._slicesSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},length:a("length"),topRadius:a("topRadius"),bottomRadius:a("bottomRadius"),numberOfVerticalLines:a("numberOfVerticalLines"),slices:a("slices"),show:a("show"),material:o("material"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),shadows:a("shadows"),distanceDisplayCondition:a("distanceDisplayCondition")}),s.prototype.clone=function(e){return t(e)?(e.bottomRadius=this.bottomRadius,e.length=this.length,e.topRadius=this.topRadius,e.show=this.show,e.material=this.material,e.numberOfVerticalLines=this.numberOfVerticalLines,e.slices=this.slices,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new s(this)},s.prototype.merge=function(t){this.bottomRadius=e(this.bottomRadius,t.bottomRadius),this.length=e(this.length,t.length),this.topRadius=e(this.topRadius,t.topRadius),this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.numberOfVerticalLines=e(this.numberOfVerticalLines,t.numberOfVerticalLines),this.slices=e(this.slices,t.slices),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.shadows=e(this.shadows,t.shadows),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},s});i("DataSources/EllipseGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,i,r,n,o,a){"use strict";function s(t){this._semiMajorAxis=void 0,this._semiMajorAxisSubscription=void 0,this._semiMinorAxis=void 0,this._semiMinorAxisSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},semiMajorAxis:a("semiMajorAxis"),semiMinorAxis:a("semiMinorAxis"),rotation:a("rotation"),show:a("show"),material:o("material"),height:a("height"),extrudedHeight:a("extrudedHeight"),granularity:a("granularity"),stRotation:a("stRotation"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),numberOfVerticalLines:a("numberOfVerticalLines"),shadows:a("shadows"),distanceDisplayCondition:a("distanceDisplayCondition")}),s.prototype.clone=function(e){return t(e)?(e.rotation=this.rotation,e.semiMajorAxis=this.semiMajorAxis,e.semiMinorAxis=this.semiMinorAxis,e.show=this.show,e.material=this.material,e.height=this.height,e.extrudedHeight=this.extrudedHeight,e.granularity=this.granularity,e.stRotation=this.stRotation,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new s(this)},s.prototype.merge=function(t){this.rotation=e(this.rotation,t.rotation),this.semiMajorAxis=e(this.semiMajorAxis,t.semiMajorAxis),this.semiMinorAxis=e(this.semiMinorAxis,t.semiMinorAxis),this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.height=e(this.height,t.height),this.extrudedHeight=e(this.extrudedHeight,t.extrudedHeight),this.granularity=e(this.granularity,t.granularity),this.stRotation=e(this.stRotation,t.stRotation),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.numberOfVerticalLines=e(this.numberOfVerticalLines,t.numberOfVerticalLines),this.shadows=e(this.shadows,t.shadows),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},s}),i("DataSources/EllipsoidGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,i,r,n,o,a){"use strict";function s(t){this._show=void 0,this._showSubscription=void 0,this._radii=void 0,this._radiiSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._stackPartitions=void 0,this._stackPartitionsSubscription=void 0,this._slicePartitions=void 0,this._slicePartitionsSubscription=void 0,this._subdivisions=void 0,this._subdivisionsSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),radii:a("radii"),material:o("material"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),stackPartitions:a("stackPartitions"),slicePartitions:a("slicePartitions"),subdivisions:a("subdivisions"),shadows:a("shadows"),distanceDisplayCondition:a("distanceDisplayCondition")}),s.prototype.clone=function(e){return t(e)?(e.show=this.show,e.radii=this.radii,e.material=this.material,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.stackPartitions=this.stackPartitions,e.slicePartitions=this.slicePartitions,e.subdivisions=this.subdivisions,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new s(this)},s.prototype.merge=function(t){this.show=e(this.show,t.show),this.radii=e(this.radii,t.radii),this.material=e(this.material,t.material),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.stackPartitions=e(this.stackPartitions,t.stackPartitions),this.slicePartitions=e(this.slicePartitions,t.slicePartitions),this.subdivisions=e(this.subdivisions,t.subdivisions),this.shadows=e(this.shadows,t.shadows),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition); +},s}),i("DataSources/LabelGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createPropertyDescriptor"],function(e,t,i,r,n,o){"use strict";function a(t){this._text=void 0,this._textSubscription=void 0,this._font=void 0,this._fontSubscription=void 0,this._style=void 0,this._styleSubscription=void 0,this._fillColor=void 0,this._fillColorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._showBackground=void 0,this._showBackgroundSubscription=void 0,this._backgroundColor=void 0,this._backgroundColorSubscription=void 0,this._backgroundPadding=void 0,this._backgroundPaddingSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},text:o("text"),font:o("font"),style:o("style"),fillColor:o("fillColor"),outlineColor:o("outlineColor"),outlineWidth:o("outlineWidth"),horizontalOrigin:o("horizontalOrigin"),verticalOrigin:o("verticalOrigin"),eyeOffset:o("eyeOffset"),heightReference:o("heightReference"),pixelOffset:o("pixelOffset"),scale:o("scale"),show:o("show"),showBackground:o("showBackground"),backgroundColor:o("backgroundColor"),backgroundPadding:o("backgroundPadding"),translucencyByDistance:o("translucencyByDistance"),pixelOffsetScaleByDistance:o("pixelOffsetScaleByDistance"),distanceDisplayCondition:o("distanceDisplayCondition")}),a.prototype.clone=function(e){return t(e)?(e.text=this.text,e.font=this.font,e.show=this.show,e.style=this.style,e.fillColor=this.fillColor,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.showBackground=this.showBackground,e.backgroundColor=this.backgroundColor,e.backgroundPadding=this.backgroundPadding,e.scale=this.scale,e.horizontalOrigin=this.horizontalOrigin,e.verticalOrigin=this.verticalOrigin,e.eyeOffset=this.eyeOffset,e.heightReference=this.heightReference,e.pixelOffset=this.pixelOffset,e.translucencyByDistance=this.translucencyByDistance,e.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new a(this)},a.prototype.merge=function(t){this.text=e(this.text,t.text),this.font=e(this.font,t.font),this.show=e(this.show,t.show),this.style=e(this.style,t.style),this.fillColor=e(this.fillColor,t.fillColor),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.showBackground=e(this.showBackground,t.showBackground),this.backgroundColor=e(this.backgroundColor,t.backgroundColor),this.backgroundPadding=e(this.backgroundPadding,t.backgroundPadding),this.scale=e(this.scale,t.scale),this.horizontalOrigin=e(this.horizontalOrigin,t.horizontalOrigin),this.verticalOrigin=e(this.verticalOrigin,t.verticalOrigin),this.eyeOffset=e(this.eyeOffset,t.eyeOffset),this.heightReference=e(this.heightReference,t.heightReference),this.pixelOffset=e(this.pixelOffset,t.pixelOffset),this.translucencyByDistance=e(this._translucencyByDistance,t.translucencyByDistance),this.pixelOffsetScaleByDistance=e(this._pixelOffsetScaleByDistance,t.pixelOffsetScaleByDistance),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},a}),i("DataSources/NodeTransformationProperty",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","../Core/TranslationRotationScale","./createPropertyDescriptor","./Property"],function(e,t,i,r,n,o,a){"use strict";var s=new n,l=function(t){t=e(t,e.EMPTY_OBJECT),this._definitionChanged=new r,this._translation=void 0,this._translationSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this.translation=t.translation,this.rotation=t.rotation,this.scale=t.scale};return i(l.prototype,{isConstant:{get:function(){return a.isConstant(this._translation)&&a.isConstant(this._rotation)&&a.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:o("translation"),rotation:o("rotation"),scale:o("scale")}),l.prototype.getValue=function(e,i){return t(i)||(i=new n),i.translation=a.getValueOrClonedDefault(this._translation,e,s.translation,i.translation),i.rotation=a.getValueOrClonedDefault(this._rotation,e,s.rotation,i.rotation),i.scale=a.getValueOrClonedDefault(this._scale,e,s.scale,i.scale),i},l.prototype.equals=function(e){return this===e||e instanceof l&&a.equals(this._translation,e._translation)&&a.equals(this._rotation,e._rotation)&&a.equals(this._scale,e._scale)},l}),i("DataSources/PropertyBag",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./ConstantProperty","./createPropertyDescriptor","./Property"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){return new o(e)}function u(e,t){var i=e._propertyNames,r=t._propertyNames,n=i.length;if(n!==r.length)return!1;for(var o=0;o<n;++o){var a=i[o],l=r.indexOf(a);if(l===-1)return!1;if(!s.equals(e[a],t[a]))return!1}return!0}var c=function(e,i){this._propertyNames=[],this._definitionChanged=new n,t(e)&&this.merge(e,i)};return i(c.prototype,{propertyNames:{get:function(){return this._propertyNames}},isConstant:{get:function(){for(var e=this._propertyNames,t=0,i=e.length;t<i;t++)if(!s.isConstant(this[e[t]]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}}),c.prototype.hasProperty=function(e){return this._propertyNames.indexOf(e)!==-1},c.prototype.addProperty=function(i,r,n){var o=this._propertyNames;o.push(i),Object.defineProperty(this,i,a(i,!0,e(n,l))),t(r)&&(this[i]=r),this._definitionChanged.raiseEvent(this)},c.prototype.removeProperty=function(e){var t=this._propertyNames,i=t.indexOf(e);this._propertyNames.splice(i,1),delete this[e],this._definitionChanged.raiseEvent(this)},c.prototype.getValue=function(e,i){t(i)||(i={});for(var r=this._propertyNames,n=0,o=r.length;n<o;n++){var a=r[n];i[a]=s.getValueOrUndefined(this[a],e,i[a])}return i},c.prototype.merge=function(e,i){for(var r=this._propertyNames,n=t(e._propertyNames)?e._propertyNames:Object.keys(e),o=0,a=n.length;o<a;o++){var s=n[o],l=this[s],u=e[s];t(l)||r.indexOf(s)!==-1||this.addProperty(s,void 0,i),t(u)&&(t(l)?t(l.merge)&&l.merge(u):t(u.merge)&&t(u.clone)?this[s]=u.clone():this[s]=u)}},c.prototype.equals=function(e){return this===e||e instanceof c&&u(this,e)},c}),i("DataSources/ModelGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createPropertyDescriptor","./NodeTransformationProperty","./PropertyBag"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){return new a(e)}function u(e){return new s(e,l)}function c(t){this._show=void 0,this._showSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._minimumPixelSize=void 0,this._minimumPixelSizeSubscription=void 0,this._maximumScale=void 0,this._maximumScaleSubscription=void 0,this._incrementallyLoadTextures=void 0,this._incrementallyLoadTexturesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._runAnimations=void 0,this._runAnimationsSubscription=void 0,this._nodeTransformations=void 0,this._nodeTransformationsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._silhouetteColor=void 0,this._silhouetteColorSubscription=void 0,this._silhouetteSize=void 0,this._silhouetteSizeSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._colorBlendMode=void 0,this._colorBlendModeSubscription=void 0,this._colorBlendAmount=void 0,this._colorBlendAmountSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(c.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:o("show"),scale:o("scale"),minimumPixelSize:o("minimumPixelSize"),maximumScale:o("maximumScale"),incrementallyLoadTextures:o("incrementallyLoadTextures"),shadows:o("shadows"),uri:o("uri"),runAnimations:o("runAnimations"),nodeTransformations:o("nodeTransformations",void 0,u),heightReference:o("heightReference"),distanceDisplayCondition:o("distanceDisplayCondition"),silhouetteColor:o("silhouetteColor"),silhouetteSize:o("silhouetteSize"),color:o("color"),colorBlendMode:o("colorBlendMode"),colorBlendAmount:o("colorBlendAmount")}),c.prototype.clone=function(e){return t(e)?(e.show=this.show,e.scale=this.scale,e.minimumPixelSize=this.minimumPixelSize,e.maximumScale=this.maximumScale,e.incrementallyLoadTextures=this.incrementallyLoadTextures,e.shadows=this.shadows,e.uri=this.uri,e.runAnimations=this.runAnimations,e.nodeTransformations=this.nodeTransformations,e.heightReference=this._heightReference,e.distanceDisplayCondition=this.distanceDisplayCondition,e.silhouetteColor=this.silhouetteColor,e.silhouetteSize=this.silhouetteSize,e.color=this.color,e.colorBlendMode=this.colorBlendMode,e.colorBlendAmount=this.colorBlendAmount,e):new c(this)},c.prototype.merge=function(i){this.show=e(this.show,i.show),this.scale=e(this.scale,i.scale),this.minimumPixelSize=e(this.minimumPixelSize,i.minimumPixelSize),this.maximumScale=e(this.maximumScale,i.maximumScale),this.incrementallyLoadTextures=e(this.incrementallyLoadTextures,i.incrementallyLoadTextures),this.shadows=e(this.shadows,i.shadows),this.uri=e(this.uri,i.uri),this.runAnimations=e(this.runAnimations,i.runAnimations),this.heightReference=e(this.heightReference,i.heightReference),this.distanceDisplayCondition=e(this.distanceDisplayCondition,i.distanceDisplayCondition),this.silhouetteColor=e(this.silhouetteColor,i.silhouetteColor),this.silhouetteSize=e(this.silhouetteSize,i.silhouetteSize),this.color=e(this.color,i.color),this.colorBlendMode=e(this.colorBlendMode,i.colorBlendMode),this.colorBlendAmount=e(this.colorBlendAmount,i.colorBlendAmount);var r=i.nodeTransformations;if(t(r)){var n=this.nodeTransformations;t(n)?n.merge(r):this.nodeTransformations=new s(r,l)}},c}),i("DataSources/PathGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,i,r,n,o,a){"use strict";function s(t){this._material=void 0,this._materialSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._resolution=void 0,this._resolutionSubscription=void 0,this._leadTime=void 0,this._leadTimeSubscription=void 0,this._trailTime=void 0,this._trailTimeSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),material:o("material"),width:a("width"),resolution:a("resolution"),leadTime:a("leadTime"),trailTime:a("trailTime"),distanceDisplayCondition:a("distanceDisplayCondition")}),s.prototype.clone=function(e){return t(e)?(e.material=this.material,e.width=this.width,e.resolution=this.resolution,e.show=this.show,e.leadTime=this.leadTime,e.trailTime=this.trailTime,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new s(this)},s.prototype.merge=function(t){this.material=e(this.material,t.material),this.width=e(this.width,t.width),this.resolution=e(this.resolution,t.resolution),this.show=e(this.show,t.show),this.leadTime=e(this.leadTime,t.leadTime),this.trailTime=e(this.trailTime,t.trailTime),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},s}),i("DataSources/PointGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createPropertyDescriptor"],function(e,t,i,r,n,o){"use strict";function a(t){this._color=void 0,this._colorSubscription=void 0,this._pixelSize=void 0,this._pixelSizeSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},color:o("color"),pixelSize:o("pixelSize"),outlineColor:o("outlineColor"),outlineWidth:o("outlineWidth"),show:o("show"),scaleByDistance:o("scaleByDistance"),translucencyByDistance:o("translucencyByDistance"),heightReference:o("heightReference"),distanceDisplayCondition:o("distanceDisplayCondition")}),a.prototype.clone=function(e){return t(e)?(e.color=this.color,e.pixelSize=this.pixelSize,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.show=this.show,e.scaleByDistance=this.scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.heightReference=this.heightReference,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new a(this)},a.prototype.merge=function(t){this.color=e(this.color,t.color),this.pixelSize=e(this.pixelSize,t.pixelSize),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.show=e(this.show,t.show),this.scaleByDistance=e(this.scaleByDistance,t.scaleByDistance),this.translucencyByDistance=e(this._translucencyByDistance,t.translucencyByDistance),this.heightReference=e(this.heightReference,t.heightReference),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},a}),i("DataSources/PolygonGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,i,r,n,o,a){"use strict";function s(t){this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._hierarchy=void 0,this._hierarchySubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._perPositionHeight=void 0,this._perPositionHeightSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._definitionChanged=new n,this._closeTop=void 0,this._closeTopSubscription=void 0,this._closeBottom=void 0,this._closeBottomSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),material:o("material"),hierarchy:a("hierarchy"),height:a("height"),extrudedHeight:a("extrudedHeight"),granularity:a("granularity"),stRotation:a("stRotation"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),perPositionHeight:a("perPositionHeight"),closeTop:a("closeTop"),closeBottom:a("closeBottom"),shadows:a("shadows"),distanceDisplayCondition:a("distanceDisplayCondition")}),s.prototype.clone=function(e){return t(e)?(e.show=this.show,e.material=this.material,e.hierarchy=this.hierarchy,e.height=this.height,e.extrudedHeight=this.extrudedHeight,e.granularity=this.granularity,e.stRotation=this.stRotation,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.perPositionHeight=this.perPositionHeight,e.closeTop=this.closeTop,e.closeBottom=this.closeBottom,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new s(this)},s.prototype.merge=function(t){this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.hierarchy=e(this.hierarchy,t.hierarchy),this.height=e(this.height,t.height),this.extrudedHeight=e(this.extrudedHeight,t.extrudedHeight),this.granularity=e(this.granularity,t.granularity),this.stRotation=e(this.stRotation,t.stRotation),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.perPositionHeight=e(this.perPositionHeight,t.perPositionHeight),this.closeTop=e(this.closeTop,t.closeTop),this.closeBottom=e(this.closeBottom,t.closeBottom),this.shadows=e(this.shadows,t.shadows),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},s}),i("DataSources/PolylineGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,i,r,n,o,a){"use strict";function s(t){this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._followSurface=void 0,this._followSurfaceSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._widthSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),material:o("material"),positions:a("positions"),width:a("width"),followSurface:a("followSurface"),granularity:a("granularity"),shadows:a("shadows"),distanceDisplayCondition:a("distanceDisplayCondition")}),s.prototype.clone=function(e){return t(e)?(e.show=this.show,e.material=this.material,e.positions=this.positions,e.width=this.width,e.followSurface=this.followSurface,e.granularity=this.granularity,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new s(this)},s.prototype.merge=function(t){this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.positions=e(this.positions,t.positions),this.width=e(this.width,t.width),this.followSurface=e(this.followSurface,t.followSurface),this.granularity=e(this.granularity,t.granularity),this.shadows=e(this.shadows,t.shadows),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},s}),i("DataSources/PolylineVolumeGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,i,r,n,o,a){"use strict";function s(t){this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._shape=void 0,this._shapeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubsription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),material:o("material"),positions:a("positions"),shape:a("shape"),granularity:a("granularity"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),cornerType:a("cornerType"),shadows:a("shadows"),distanceDisplayCondition:a("distanceDisplayCondition")}),s.prototype.clone=function(e){return t(e)?(e.show=this.show,e.material=this.material,e.positions=this.positions,e.shape=this.shape,e.granularity=this.granularity,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.cornerType=this.cornerType,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new s(this)},s.prototype.merge=function(t){this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.positions=e(this.positions,t.positions),this.shape=e(this.shape,t.shape),this.granularity=e(this.granularity,t.granularity),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.cornerType=e(this.cornerType,t.cornerType),this.shadows=e(this.shadows,t.shadows),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},s}),i("DataSources/RectangleGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,i,r,n,o,a){"use strict";function s(t){this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._coordinates=void 0,this._coordinatesSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._closeTop=void 0,this._closeTopSubscription=void 0,this._closeBottom=void 0,this._closeBottomSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distancedisplayConditionSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),coordinates:a("coordinates"),material:o("material"),height:a("height"),extrudedHeight:a("extrudedHeight"),granularity:a("granularity"),stRotation:a("stRotation"),rotation:a("rotation"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),closeTop:a("closeTop"),closeBottom:a("closeBottom"),shadows:a("shadows"),distanceDisplayCondition:a("distanceDisplayCondition")}),s.prototype.clone=function(e){return t(e)?(e.show=this.show,e.coordinates=this.coordinates,e.material=this.material,e.height=this.height,e.extrudedHeight=this.extrudedHeight,e.granularity=this.granularity,e.stRotation=this.stRotation,e.rotation=this.rotation,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.closeTop=this.closeTop,e.closeBottom=this.closeBottom,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new s(this)},s.prototype.merge=function(t){this.show=e(this.show,t.show),this.coordinates=e(this.coordinates,t.coordinates),this.material=e(this.material,t.material),this.height=e(this.height,t.height),this.extrudedHeight=e(this.extrudedHeight,t.extrudedHeight),this.granularity=e(this.granularity,t.granularity),this.stRotation=e(this.stRotation,t.stRotation),this.rotation=e(this.rotation,t.rotation),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.closeTop=e(this.closeTop,t.closeTop),this.closeBottom=e(this.closeBottom,t.closeBottom),this.shadows=e(this.shadows,t.shadows),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},s}),i("DataSources/WallGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,i,r,n,o,a){"use strict";function s(t){this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._minimumHeights=void 0,this._minimumHeightsSubscription=void 0,this._maximumHeights=void 0,this._maximumHeightsSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),material:o("material"),positions:a("positions"),minimumHeights:a("minimumHeights"),maximumHeights:a("maximumHeights"),granularity:a("granularity"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),shadows:a("shadows"),distanceDisplayCondition:a("distanceDisplayCondition")}),s.prototype.clone=function(e){return t(e)?(e.show=this.show,e.material=this.material,e.positions=this.positions,e.minimumHeights=this.minimumHeights,e.maximumHeights=this.maximumHeights,e.granularity=this.granularity,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new s(this)},s.prototype.merge=function(t){this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.positions=e(this.positions,t.positions),this.minimumHeights=e(this.minimumHeights,t.minimumHeights),this.maximumHeights=e(this.maximumHeights,t.maximumHeights),this.granularity=e(this.granularity,t.granularity),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.shadows=e(this.shadows,t.shadows),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},s}),i("DataSources/Entity",["../Core/Cartesian3","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/Matrix3","../Core/Matrix4","../Core/Quaternion","../Core/Transforms","./BillboardGraphics","./BoxGraphics","./ConstantPositionProperty","./CorridorGraphics","./createPropertyDescriptor","./createRawPropertyDescriptor","./CylinderGraphics","./EllipseGraphics","./EllipsoidGraphics","./LabelGraphics","./ModelGraphics","./PathGraphics","./PointGraphics","./PolygonGraphics","./PolylineGraphics","./PolylineVolumeGraphics","./Property","./RectangleGraphics","./WallGraphics"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A,P,D){"use strict";function M(e){return new p(e)}function I(e){return f(e,void 0,M)}function R(e,t){return f(e,void 0,function(e){return e instanceof t?e:new t(e)})}function O(e){e=i(e,i.EMPTY_OBJECT);var n=e.id;r(n)||(n=t()),this._availability=void 0,this._id=n,this._definitionChanged=new a,this._name=e.name,this._show=i(e.show,!0),this._parent=void 0,this._propertyNames=["billboard","box","corridor","cylinder","description","ellipse","ellipsoid","label","model","orientation","path","point","polygon","polyline","polylineVolume","position","rectangle","viewFrom","wall"],this._billboard=void 0,this._billboardSubscription=void 0,this._box=void 0,this._boxSubscription=void 0,this._corridor=void 0,this._corridorSubscription=void 0,this._cylinder=void 0,this._cylinderSubscription=void 0,this._description=void 0,this._descriptionSubscription=void 0,this._ellipse=void 0,this._ellipseSubscription=void 0,this._ellipsoid=void 0,this._ellipsoidSubscription=void 0,this._label=void 0,this._labelSubscription=void 0,this._model=void 0,this._modelSubscription=void 0,this._orientation=void 0,this._orientationSubscription=void 0,this._path=void 0,this._pathSubscription=void 0,this._point=void 0,this._pointSubscription=void 0,this._polygon=void 0,this._polygonSubscription=void 0,this._polyline=void 0,this._polylineSubscription=void 0,this._polylineVolume=void 0,this._polylineVolumeSubscription=void 0,this._position=void 0,this._positionSubscription=void 0,this._rectangle=void 0,this._rectangleSubscription=void 0,this._viewFrom=void 0,this._viewFromSubscription=void 0,this._wall=void 0,this._wallSubscription=void 0,this._children=[],this.entityCollection=void 0,this.parent=e.parent,this.merge(e)}function N(e,t,i){for(var r=t.length,n=0;n<r;n++){var o=t[n],a=o._show,s=!i&&a,l=i&&a;s!==l&&N(o,o._children,i)}e._definitionChanged.raiseEvent(e,"isShowing",i,!i)}n(O.prototype,{availability:_("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:_("name"),show:{get:function(){return this._show},set:function(e){if(e!==this._show){var t=this.isShowing;this._show=e;var i=this.isShowing;t!==i&&N(this,this._children,i),this._definitionChanged.raiseEvent(this,"show",e,!e)}}},isShowing:{get:function(){return this._show&&(!r(this.entityCollection)||this.entityCollection.show)&&(!r(this._parent)||this._parent.isShowing)}},parent:{get:function(){return this._parent},set:function(e){var t=this._parent;if(t!==e){var i=this.isShowing;if(r(t)){var n=t._children.indexOf(this);t._children.splice(n,1)}this._parent=e,r(e)&&e._children.push(this);var o=this.isShowing;i!==o&&N(this,this._children,o),this._definitionChanged.raiseEvent(this,"parent",e,t)}}},propertyNames:{get:function(){return this._propertyNames}},billboard:R("billboard",h),box:R("box",d),corridor:R("corridor",m),cylinder:R("cylinder",g),description:f("description"),ellipse:R("ellipse",v),ellipsoid:R("ellipsoid",y),label:R("label",C),model:R("model",w),orientation:f("orientation"),path:R("path",S),point:R("point",E),polygon:R("polygon",b),polyline:R("polyline",T),polylineVolume:R("polylineVolume",x),position:I("position"),rectangle:R("rectangle",P),viewFrom:f("viewFrom"),wall:R("wall",D)}),O.prototype.isAvailable=function(e){var t=this._availability;return!r(t)||t.contains(e)},O.prototype.addProperty=function(e){var t=this._propertyNames;t.push(e),Object.defineProperty(this,e,_(e,!0))},O.prototype.removeProperty=function(e){var t=this._propertyNames,i=t.indexOf(e); +this._propertyNames.splice(i,1),delete this[e]},O.prototype.merge=function(e){this.name=i(this.name,e.name),this.availability=i(e.availability,this.availability);for(var t=this._propertyNames,n=r(e._propertyNames)?e._propertyNames:Object.keys(e),o=n.length,a=0;a<o;a++){var s=n[a];if("parent"!==s){var l=this[s],u=e[s];r(l)||t.indexOf(s)!==-1||this.addProperty(s),r(u)&&(r(l)?r(l.merge)&&l.merge(u):r(u.merge)&&r(u.clone)?this[s]=u.clone():this[s]=u)}}};var L=new s,B=new e,F=new u;return O.prototype._getModelMatrix=function(e,t){var i=A.getValueOrUndefined(this._position,e,B);if(r(i)){var n=A.getValueOrUndefined(this._orientation,e,F);return t=r(n)?l.fromRotationTranslation(s.fromQuaternion(n,L),i,t):c.eastNorthUpToFixedFrame(i,void 0,t)}},O}),i("DataSources/EntityCollection",["../Core/AssociativeArray","../Core/createGuid","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/Iso8601","../Core/JulianDate","../Core/RuntimeError","../Core/TimeInterval","./Entity"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(e){if(e._firing)return void(e._refire=!0);if(0===e._suspendCount){var t=e._addedEntities,i=e._removedEntities,r=e._changedEntities;if(0!==r.length||0!==t.length||0!==i.length){e._firing=!0;do{e._refire=!1;var n=t.values.slice(0),o=i.values.slice(0),a=r.values.slice(0);t.removeAll(),i.removeAll(),r.removeAll(),e._collectionChanged.raiseEvent(e,n,o,a)}while(e._refire);e._firing=!1}}}function d(i){this._owner=i,this._entities=new e,this._addedEntities=new e,this._removedEntities=new e,this._changedEntities=new e,this._suspendCount=0,this._collectionChanged=new o,this._id=t(),this._show=!0,this._firing=!1,this._refire=!1}var p={id:void 0};return d.prototype.suspendEvents=function(){this._suspendCount++},d.prototype.resumeEvents=function(){this._suspendCount--,h(this)},d.collectionChangedEventCallback=void 0,r(d.prototype,{collectionChanged:{get:function(){return this._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._entities.values}},show:{get:function(){return this._show},set:function(e){if(e!==this._show){this.suspendEvents();var t,i=[],r=this._entities.values,n=r.length;for(t=0;t<n;t++)i.push(r[t].isShowing);for(this._show=e,t=0;t<n;t++){var o=i[t],a=r[t];o!==a.isShowing&&a.definitionChanged.raiseEvent(a,"isShowing",a.isShowing,o)}this.resumeEvents()}}},owner:{get:function(){return this._owner}}}),d.prototype.computeAvailability=function(){for(var e=a.MAXIMUM_VALUE,t=a.MINIMUM_VALUE,r=this._entities.values,n=0,o=r.length;n<o;n++){var l=r[n],c=l.availability;if(i(c)){var h=c.start,d=c.stop;s.lessThan(h,e)&&!h.equals(a.MINIMUM_VALUE)&&(e=h),s.greaterThan(d,t)&&!d.equals(a.MAXIMUM_VALUE)&&(t=d)}}return a.MAXIMUM_VALUE.equals(e)&&(e=a.MINIMUM_VALUE),a.MINIMUM_VALUE.equals(t)&&(t=a.MAXIMUM_VALUE),new u({start:e,stop:t})},d.prototype.add=function(e){e instanceof c||(e=new c(e));var t=e.id,i=this._entities;if(i.contains(t))throw new l("An entity with id "+t+" already exists in this collection.");return e.entityCollection=this,i.set(t,e),this._removedEntities.remove(t)||this._addedEntities.set(t,e),e.definitionChanged.addEventListener(d.prototype._onEntityDefinitionChanged,this),h(this),e},d.prototype.remove=function(e){return!!i(e)&&this.removeById(e.id)},d.prototype.contains=function(e){return this._entities.get(e.id)===e},d.prototype.removeById=function(e){if(!i(e))return!1;var t=this._entities,r=t.get(e);return!!this._entities.remove(e)&&(this._addedEntities.remove(e)||(this._removedEntities.set(e,r),this._changedEntities.remove(e)),this._entities.remove(e),r.definitionChanged.removeEventListener(d.prototype._onEntityDefinitionChanged,this),h(this),!0)},d.prototype.removeAll=function(){for(var e=this._entities,t=e.length,r=e.values,n=this._addedEntities,o=this._removedEntities,a=0;a<t;a++){var s=r[a],l=s.id,u=n.get(l);i(u)||(s.definitionChanged.removeEventListener(d.prototype._onEntityDefinitionChanged,this),o.set(l,s))}e.removeAll(),n.removeAll(),this._changedEntities.removeAll(),h(this)},d.prototype.getById=function(e){return this._entities.get(e)},d.prototype.getOrCreateEntity=function(e){var t=this._entities.get(e);return i(t)||(p.id=e,t=new c(p),this.add(t)),t},d.prototype._onEntityDefinitionChanged=function(e){var t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),h(this)},d}),i("DataSources/CompositeEntityCollection",["../Core/createGuid","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Math","./Entity","./EntityCollection"],function(e,t,i,r,n,o,a){"use strict";function s(e){for(var t=e.propertyNames,i=t.length,r=0;r<i;r++)e[t[r]]=void 0}function l(e,t,i,r){f[0]=i,f[1]=r.id,t[JSON.stringify(f)]=r.definitionChanged.addEventListener(h.prototype._onDefinitionChanged,e)}function u(e,t,i,r){f[0]=i,f[1]=r.id;var n=JSON.stringify(f);t[n](),t[n]=void 0}function c(e){if(e._shouldRecomposite=!0,0===e._suspendCount){var i,r,n,c,d,p,f=e._collections,_=f.length,g=e._collectionsCopy,v=g.length,y=e._composite,C=new a(e),w=e._eventHash;for(i=0;i<v;i++)for(d=g[i],d.collectionChanged.removeEventListener(h.prototype._onCollectionChanged,e),n=d.values,p=d.id,c=n.length-1;c>-1;c--)r=n[c],u(e,w,p,r);for(i=_-1;i>=0;i--)for(d=f[i],d.collectionChanged.addEventListener(h.prototype._onCollectionChanged,e),n=d.values,p=d.id,c=n.length-1;c>-1;c--){r=n[c],l(e,w,p,r);var S=C.getById(r.id);t(S)||(S=y.getById(r.id),t(S)?s(S):(m.id=r.id,S=new o(m)),C.add(S)),S.merge(r)}e._collectionsCopy=f.slice(0),y.suspendEvents(),y.removeAll();var E=C.values;for(i=0;i<E.length;i++)y.add(E[i]);y.resumeEvents()}}function h(i,r){this._owner=r,this._composite=new a(this),this._suspendCount=0,this._collections=t(i)?i.slice():[],this._collectionsCopy=[],this._id=e(),this._eventHash={},c(this),this._shouldRecomposite=!1}function d(e,t){var i=e.indexOf(t);return i}function p(e,t,i){var r=e._collections;if(t=n.clamp(t,0,r.length-1),i=n.clamp(i,0,r.length-1),t!==i){var o=r[t];r[t]=r[i],r[i]=o,c(e)}}var m={id:void 0},f=new Array(2);return i(h.prototype,{collectionChanged:{get:function(){return this._composite._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._composite.values}},owner:{get:function(){return this._owner}}}),h.prototype.addCollection=function(e,i){var r=t(i);r?this._collections.splice(i,0,e):(i=this._collections.length,this._collections.push(e)),c(this)},h.prototype.removeCollection=function(e){var t=this._collections.indexOf(e);return t!==-1&&(this._collections.splice(t,1),c(this),!0)},h.prototype.removeAllCollections=function(){this._collections.length=0,c(this)},h.prototype.containsCollection=function(e){return this._collections.indexOf(e)!==-1},h.prototype.contains=function(e){return this._composite.contains(e)},h.prototype.indexOfCollection=function(e){return this._collections.indexOf(e)},h.prototype.getCollection=function(e){return this._collections[e]},h.prototype.getCollectionsLength=function(){return this._collections.length},h.prototype.raiseCollection=function(e){var t=d(this._collections,e);p(this,t,t+1)},h.prototype.lowerCollection=function(e){var t=d(this._collections,e);p(this,t,t-1)},h.prototype.raiseCollectionToTop=function(e){var t=d(this._collections,e);t!==this._collections.length-1&&(this._collections.splice(t,1),this._collections.push(e),c(this))},h.prototype.lowerCollectionToBottom=function(e){var t=d(this._collections,e);0!==t&&(this._collections.splice(t,1),this._collections.splice(0,0,e),c(this))},h.prototype.suspendEvents=function(){this._suspendCount++,this._composite.suspendEvents()},h.prototype.resumeEvents=function(){this._suspendCount--,this._shouldRecomposite&&0===this._suspendCount&&(c(this),this._shouldRecomposite=!1),this._composite.resumeEvents()},h.prototype.computeAvailability=function(){return this._composite.computeAvailability()},h.prototype.getById=function(e){return this._composite.getById(e)},h.prototype._onCollectionChanged=function(e,i,r){var n=this._collectionsCopy,a=n.length,c=this._composite;c.suspendEvents();var h,d,p,f,_=r.length,g=this._eventHash,v=e.id;for(h=0;h<_;h++){var y=r[h];u(this,g,v,y);var C=y.id;for(d=a-1;d>=0;d--)p=n[d].getById(C),t(p)&&(t(f)||(f=c.getById(C),s(f)),f.merge(p));t(f)||c.removeById(C),f=void 0}var w=i.length;for(h=0;h<w;h++){var S=i[h];l(this,g,v,S);var E=S.id;for(d=a-1;d>=0;d--)p=n[d].getById(E),t(p)&&(t(f)||(f=c.getById(E),t(f)?s(f):(m.id=E,f=new o(m),c.add(f))),f.merge(p));f=void 0}c.resumeEvents()},h.prototype._onDefinitionChanged=function(e,i,r,n){for(var o=this._collections,a=this._composite,s=o.length,l=e.id,u=a.getById(l),c=u[i],h=!t(c),d=!0,p=s-1;p>=0;p--){var m=o[p].getById(e.id);if(t(m)){var f=m[i];if(t(f)){if(d){if(d=!1,!t(f.merge)||!t(f.clone)){c=f;break}c=f.clone(c)}c.merge(f)}}}h&&u.propertyNames.indexOf(i)===-1&&u.addProperty(i),u[i]=c},h}),i("DataSources/CompositeProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/EventHelper","../Core/TimeIntervalCollection","./Property"],function(e,t,i,r,n,o,a){"use strict";function s(t,i,r,n){function o(){r.raiseEvent(t)}var a=[];i.removeAll();for(var s=n.length,l=0;l<s;l++){var u=n.get(l);e(u.data)&&a.indexOf(u.data)===-1&&i.add(u.data.definitionChanged,o)}}function l(){this._eventHelper=new n,this._definitionChanged=new r,this._intervals=new o,this._intervals.changedEvent.addEventListener(l.prototype._intervalsChanged,this)}return t(l.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}}),l.prototype.getValue=function(t,i){var r=this._intervals.findDataForIntervalContainingDate(t);if(e(r))return r.getValue(t,i)},l.prototype.equals=function(e){return this===e||e instanceof l&&this._intervals.equals(e._intervals,a.equals)},l.prototype._intervalsChanged=function(){s(this,this._eventHelper,this._definitionChanged,this._intervals),this._definitionChanged.raiseEvent(this)},l}),i("DataSources/CompositeMaterialProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./CompositeProperty","./Property"],function(e,t,i,r,n,o){"use strict";function a(){this._definitionChanged=new r,this._composite=new n,this._composite.definitionChanged.addEventListener(a.prototype._raiseDefinitionChanged,this)}return t(a.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite._intervals}}}),a.prototype.getType=function(t){var i=this._composite._intervals.findDataForIntervalContainingDate(t);if(e(i))return i.getType(t)},a.prototype.getValue=function(t,i){var r=this._composite._intervals.findDataForIntervalContainingDate(t);if(e(r))return r.getValue(t,i)},a.prototype.equals=function(e){return this===e||e instanceof a&&this._composite.equals(e._composite,o.equals)},a.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},a}),i("DataSources/CompositePositionProperty",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/ReferenceFrame","./CompositeProperty","./Property"],function(e,t,i,r,n,o,a,s){"use strict";function l(t){this._referenceFrame=e(t,o.FIXED),this._definitionChanged=new n,this._composite=new a,this._composite.definitionChanged.addEventListener(l.prototype._raiseDefinitionChanged,this)}return i(l.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite.intervals}},referenceFrame:{get:function(){return this._referenceFrame},set:function(e){this._referenceFrame=e}}}),l.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,o.FIXED,t)},l.prototype.getValueInReferenceFrame=function(e,i,r){var n=this._composite._intervals.findDataForIntervalContainingDate(e);if(t(n))return n.getValueInReferenceFrame(e,i,r)},l.prototype.equals=function(e){return this===e||e instanceof l&&this._referenceFrame===e._referenceFrame&&this._composite.equals(e._composite,s.equals)},l.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},l}),i("Shaders/ShadowVolumeFS",[],function(){"use strict";return"#extension GL_EXT_frag_depth : enable\nvarying float v_WindowZ;\nvarying vec4 v_color;\nvoid writeDepthClampedToFarPlane()\n{\ngl_FragDepthEXT = min(v_WindowZ * gl_FragCoord.w, 1.0);\n}\nvoid main(void)\n{\ngl_FragColor = v_color;\nwriteDepthClampedToFarPlane();\n}\n"}),i("Shaders/ShadowVolumeVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 extrudeDirection;\nattribute vec4 color;\nattribute float batchId;\nuniform float u_globeMinimumAltitude;\nvarying float v_WindowZ;\nvarying vec4 v_color;\nvec4 depthClampFarPlane(vec4 vertexInClipCoordinates)\n{\nv_WindowZ = (0.5 * (vertexInClipCoordinates.z / vertexInClipCoordinates.w) + 0.5) * vertexInClipCoordinates.w;\nvertexInClipCoordinates.z = min(vertexInClipCoordinates.z, vertexInClipCoordinates.w);\nreturn vertexInClipCoordinates;\n}\nvoid main()\n{\nv_color = color;\nvec4 position = czm_computePosition();\nfloat delta = min(u_globeMinimumAltitude, czm_geometricToleranceOverMeter * length(position.xyz));\nposition = position + vec4(extrudeDirection * delta, 0.0);\ngl_Position = depthClampFarPlane(czm_modelViewProjectionRelativeToEye * position);\n}\n"}),i("Scene/DepthFunction",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={NEVER:t.NEVER,LESS:t.LESS,EQUAL:t.EQUAL,LESS_OR_EQUAL:t.LEQUAL,GREATER:t.GREATER,NOT_EQUAL:t.NOTEQUAL,GREATER_OR_EQUAL:t.GEQUAL,ALWAYS:t.ALWAYS};return e(i)}),i("Scene/StencilFunction",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={NEVER:t.NEVER,LESS:t.LESS,EQUAL:t.EQUAL,LESS_OR_EQUAL:t.LEQUAL,GREATER:t.GREATER,NOT_EQUAL:t.NOTEQUAL,GREATER_OR_EQUAL:t.GEQUAL,ALWAYS:t.ALWAYS};return e(i)}),i("Scene/StencilOperation",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={ZERO:t.ZERO,KEEP:t.KEEP,REPLACE:t.REPLACE,INCREMENT:t.INCR,DECREMENT:t.DECR,INVERT:t.INVERT,INCREMENT_WRAP:t.INCR_WRAP,DECREMENT_WRAP:t.DECR_WRAP};return e(i)}),i("Scene/GroundPrimitive",["../Core/BoundingSphere","../Core/buildModuleUrl","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/clone","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/GeographicTilingScheme","../Core/GeometryInstance","../Core/isArray","../Core/loadJson","../Core/Math","../Core/OrientedBoundingBox","../Core/Rectangle","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Shaders/ShadowVolumeFS","../Shaders/ShadowVolumeVS","../ThirdParty/when","./BlendingState","./DepthFunction","./PerInstanceColorAppearance","./Primitive","./SceneMode","./StencilFunction","./StencilOperation"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I,R,O,N){"use strict";function L(e){e=l(e,l.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this.show=l(e.show,!0),this.debugShowBoundingVolume=l(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=l(e.debugShowShadowVolume,!1),this._debugShowShadowVolume=!1,this._sp=void 0,this._spPick=void 0,this._rsStencilPreloadPass=void 0,this._rsStencilDepthPass=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._uniformMap={u_globeMinimumAltitude:function(){return 55e3}},this._boundingVolumes=[],this._boundingVolumes2D=[],this._ready=!1,this._readyPromise=A.defer(),this._primitive=void 0,this._maxHeight=void 0,this._minHeight=void 0,this._maxTerrainHeight=L._defaultMaxTerrainHeight,this._minTerrainHeight=L._defaultMinTerrainHeight,this._boundingSpheresKeys=[],this._boundingSpheres=[];var t,i=new M({flat:!0});u(this.geometryInstances)&&f(this.geometryInstances)&&this.geometryInstances.length>1&&(t=$),this._primitiveOptions={geometryInstances:void 0,appearance:i,vertexCacheOptimize:l(e.vertexCacheOptimize,!1),interleave:l(e.interleave,!1),releaseGeometryInstances:l(e.releaseGeometryInstances,!0),allowPicking:l(e.allowPicking,!0),asynchronous:l(e.asynchronous,!0),compressVertices:l(e.compressVertices,!0),_readOnlyInstanceAttributes:t,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_createPickOffsets:!0}}function B(e){return function(t,i){var r=i.maximumRadius,n=r/Math.cos(.5*t)-r;return e._maxHeight+n}}function F(e){return function(t,i){return e._minHeight}}function V(e){return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:O.ALWAYS,frontOperation:{fail:N.KEEP,zFail:N.DECREMENT_WRAP,zPass:N.DECREMENT_WRAP},backFunction:O.ALWAYS,backOperation:{fail:N.KEEP,zFail:N.INCREMENT_WRAP,zPass:N.INCREMENT_WRAP},reference:0,mask:-1},depthTest:{enabled:!1},depthMask:!1}}function k(e){return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:O.ALWAYS,frontOperation:{fail:N.KEEP,zFail:N.KEEP,zPass:N.INCREMENT_WRAP},backFunction:O.ALWAYS,backOperation:{fail:N.KEEP,zFail:N.KEEP,zPass:N.DECREMENT_WRAP},reference:0,mask:-1},depthTest:{enabled:!0,func:D.LESS_OR_EQUAL},depthMask:!1}}function z(e){return{stencilTest:{enabled:e,frontFunction:O.NOT_EQUAL,frontOperation:{fail:N.KEEP,zFail:N.KEEP,zPass:N.DECREMENT_WRAP},backFunction:O.NOT_EQUAL,backOperation:{fail:N.KEEP,zFail:N.KEEP,zPass:N.DECREMENT_WRAP},reference:0,mask:-1},depthTest:{enabled:!1},depthMask:!1,blending:P.ALPHA_BLEND}}function U(e,t){var i=e.mapProjection.ellipsoid;{if(u(t.attributes)&&u(t.attributes.position3DHigh)){for(var n=t.attributes.position3DHigh.values,o=t.attributes.position3DLow.values,a=n.length,s=Number.POSITIVE_INFINITY,l=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,h=Number.NEGATIVE_INFINITY,d=0;d<a;d+=3){var p=r.unpack(n,d,te),m=r.unpack(o,d,ie),f=r.add(p,m,re),_=i.cartesianToCartographic(f,ne),g=_.latitude,v=_.longitude;s=Math.min(s,g),l=Math.min(l,v),c=Math.max(c,g),h=Math.max(h,v)}var y=oe;return y.north=c,y.south=s,y.east=h,y.west=l,y}if(u(t.rectangle))return t.rectangle}}function G(e){n.fromRadians(e.east,e.north,0,se[0]),n.fromRadians(e.west,e.north,0,se[1]),n.fromRadians(e.east,e.south,0,se[2]),n.fromRadians(e.west,e.south,0,se[3]);for(var t=0,i=0,r=0,o=0,a=L._terrainHeightsMaxLevel,s=0;s<=a;++s){for(var l=!1,u=0;u<4;++u){var c=se[u];if(ae.positionToTileXY(c,s,le),0===u)r=le.x,o=le.y;else if(r!==le.x||o!==le.y){l=!0;break}}if(l)break;t=r,i=o}if(0!==s)return{x:t,y:i,level:s>a?a:s-1}}function W(e,t,i){var n=G(t),o=L._defaultMinTerrainHeight,a=L._defaultMaxTerrainHeight;if(u(n)){var s=n.level+"-"+n.x+"-"+n.y,l=L._terrainHeights[s];u(l)&&(o=l[0],a=l[1]),i.cartographicToCartesian(y.northeast(t,he),ue),i.cartographicToCartesian(y.southwest(t,he),ce),r.subtract(ce,ue,de),r.add(ue,r.multiplyByScalar(de,.5,de),de);var c=i.scaleToGeodeticSurface(de,pe);if(u(c)){var h=r.distance(de,c);o=Math.min(o,-h)}else o=L._defaultMinTerrainHeight}e._minTerrainHeight=Math.max(L._defaultMinTerrainHeight,o),e._maxTerrainHeight=a}function H(t,i){var r=G(t),n=L._defaultMaxTerrainHeight;if(u(r)){var o=r.level+"-"+r.x+"-"+r.y,a=L._terrainHeights[o];u(a)&&(n=a[1])}var s=e.fromRectangle3D(t,i,0);return e.fromRectangle3D(t,i,n,me),e.union(s,me,s)}function q(t,i,n){var o=i.mapProjection.ellipsoid,a=U(i,n);if(a.width<g.PI){var s=v.fromRectangle(a,t._maxHeight,t._minHeight,o);t._boundingVolumes.push(s)}else{var l=n.attributes.position3DHigh.values,u=n.attributes.position3DLow.values;t._boundingVolumes.push(e.fromEncodedCartesianVertices(l,u))}if(!i.scene3DOnly){var c=i.mapProjection,h=e.fromRectangleWithHeights2D(a,c,t._maxHeight,t._minHeight);r.fromElements(h.center.z,h.center.x,h.center.y,h.center),t._boundingVolumes2D.push(h)}}function j(e,t,i,r){if(!u(e._rsStencilPreloadPass)){var n=!e.debugShowShadowVolume;e._rsStencilPreloadPass=S.fromCache(V(n)),e._rsStencilDepthPass=S.fromCache(k(n)),e._rsColorPass=S.fromCache(z(n)),e._rsPickPass=S.fromCache(ee)}}function Y(e,t){if(!e.compressVertices)return t;if(t.search(/attribute\s+vec3\s+extrudeDirection;/g)!==-1){var i="compressedAttributes",r="attribute vec2 "+i+";",n="vec3 extrudeDirection;\n",o=" extrudeDirection = czm_octDecode("+i+", 65535.0);\n",a=t;a=a.replace(/attribute\s+vec3\s+extrudeDirection;/g,""),a=b.replaceMain(a,"czm_non_compressed_main");var s="void main() \n{ \n"+o+" czm_non_compressed_main(); \n}";return[r,n,a,s].join("\n")}}function X(e,t,i){if(!u(e._sp)){var r=t.context,n=e._primitive,o=x;o=e._primitive._batchTable.getVertexShaderCallback()(o),o=I._appendShowToShader(n,o),o=I._appendDistanceDisplayConditionToShader(n,o),o=I._modifyShaderPosition(e,o,t.scene3DOnly),o=I._updateColorAttribute(n,o),o=Y(n,o);var a=T,s=e._primitive._attributeLocations;if(e._sp=E.replaceCache({context:r,shaderProgram:e._sp,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:s}),e._primitive.allowPicking){var l=b.createPickVertexShaderSource(o);l=I._updatePickColorAttribute(l);var c=new b({sources:[a],pickColorQualifier:"varying"});e._spPick=E.replaceCache({context:r,shaderProgram:e._spPick,vertexShaderSource:l,fragmentShaderSource:c,attributeLocations:s})}else e._spPick=E.fromCache({context:r,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:s})}}function Z(e,t){var i=e._primitive,r=3*i._va.length;t.length=r;for(var n=0,o=i._batchTable.getUniformMapCallback()(e._uniformMap),a=0;a<r;a+=3){var s=i._va[n++],l=t[a];u(l)||(l=t[a]=new C({owner:e,primitiveType:i._primitiveType})),l.vertexArray=s,l.renderState=e._rsStencilPreloadPass,l.shaderProgram=e._sp,l.uniformMap=o,l.pass=w.GROUND,l=t[a+1],u(l)||(l=t[a+1]=new C({owner:e,primitiveType:i._primitiveType})),l.vertexArray=s,l.renderState=e._rsStencilDepthPass,l.shaderProgram=e._sp,l.uniformMap=o,l.pass=w.GROUND,l=t[a+2],u(l)||(l=t[a+2]=new C({owner:e,primitiveType:i._primitiveType})),l.vertexArray=s,l.renderState=e._rsColorPass,l.shaderProgram=e._sp,l.uniformMap=o,l.pass=w.GROUND}}function K(e,t){var i=e._primitive,r=i._pickOffsets,n=3*r.length;t.length=n;for(var o=0,a=i._batchTable.getUniformMapCallback()(e._uniformMap),s=0;s<n;s+=3){var l=r[o++],c=l.offset,h=l.count,d=i._va[l.index],p=t[s];u(p)||(p=t[s]=new C({owner:e,primitiveType:i._primitiveType})),p.vertexArray=d,p.offset=c,p.count=h,p.renderState=e._rsStencilPreloadPass,p.shaderProgram=e._sp,p.uniformMap=a,p.pass=w.GROUND,p=t[s+1],u(p)||(p=t[s+1]=new C({owner:e,primitiveType:i._primitiveType})),p.vertexArray=d,p.offset=c,p.count=h,p.renderState=e._rsStencilDepthPass,p.shaderProgram=e._sp,p.uniformMap=a,p.pass=w.GROUND,p=t[s+2],u(p)||(p=t[s+2]=new C({owner:e,primitiveType:i._primitiveType})),p.vertexArray=d,p.offset=c,p.count=h,p.renderState=e._rsPickPass,p.shaderProgram=e._spPick,p.uniformMap=a,p.pass=w.GROUND}}function Q(e,t,i,r,n,o,a){Z(e,o),K(e,a)}function J(e,t,i,r,n,o,a,s){var l;t.mode===R.SCENE3D?l=e._boundingVolumes:t.mode!==R.SCENE3D&&u(e._boundingVolumes2D)&&(l=e._boundingVolumes2D);var c=t.commandList,h=t.passes;if(h.render)for(var d=i.length,p=0;p<d;++p)i[p].modelMatrix=n,i[p].boundingVolume=l[Math.floor(p/3)],i[p].cull=o,i[p].debugShowBoundingVolume=a,c.push(i[p]);if(h.pick){var m=e._primitive,f=m._pickOffsets,_=3*f.length;r.length=_;for(var g=0,v=0;v<_;v+=3){var y=f[g++],C=l[y.index];r[v].modelMatrix=n,r[v].boundingVolume=C,r[v].cull=o,r[v+1].modelMatrix=n,r[v+1].boundingVolume=C,r[v+1].cull=o,r[v+2].modelMatrix=n,r[v+2].boundingVolume=C,r[v+2].cull=o,c.push(r[v],r[v+1],r[v+2])}}}var $=["color"];c(L.prototype,{vertexCacheOptimize:{get:function(){return this._primitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},compressVertices:{get:function(){return this._primitiveOptions.compressVertices}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}}}),L.isSupported=function(e){return e.context.fragmentDepth&&e.context.stencilBuffer},L._defaultMaxTerrainHeight=9e3,L._defaultMinTerrainHeight=-1e5,L._terrainHeights=void 0,L._terrainHeightsMaxLevel=6;var ee={stencilTest:{enabled:!0,frontFunction:O.NOT_EQUAL,frontOperation:{fail:N.KEEP,zFail:N.KEEP,zPass:N.DECREMENT_WRAP},backFunction:O.NOT_EQUAL,backOperation:{fail:N.KEEP,zFail:N.KEEP,zPass:N.DECREMENT_WRAP},reference:0,mask:-1},depthTest:{enabled:!1},depthMask:!1},te=new r,ie=new r,re=new r,ne=new n,oe=new y,ae=new p,se=[new n,new n,new n,new n],le=new i,ue=new r,ce=new r,he=new n,de=new r,pe=new r,me=new e;return L._initialized=!1,L._initPromise=void 0,L.initializeTerrainHeights=function(){var e=L._initPromise;return u(e)?e:(L._initPromise=_(t("Assets/approximateTerrainHeights.json")).then(function(e){L._initialized=!0,L._terrainHeights=e}),L._initPromise)},L.prototype.update=function(e){var t=e.context;if(t.fragmentDepth&&this.show&&(u(this._primitive)||u(this.geometryInstances))){if(!L._initialized)return void L.initializeTerrainHeights();var i=this,r=this._primitiveOptions;if(!u(this._primitive)){var n,o,a,s,l,c=e.mapProjection.ellipsoid,h=f(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],d=h.length,p=new Array(d);for(s=0;s<d;++s){n=h[s],o=n.geometry;var _=U(e,o);u(l)?u(_)&&y.union(l,_,l):l=_;var g=n.id;if(u(g)&&u(_)){var v=H(_,c);this._boundingSpheresKeys.push(g),this._boundingSpheres.push(v)}if(a=o.constructor,u(a)&&u(a.createShadowVolume)){n.attributes}}W(this,l,e.mapProjection.ellipsoid);var C=e.terrainExaggeration;for(this._minHeight=this._minTerrainHeight*C,this._maxHeight=this._maxTerrainHeight*C,s=0;s<d;++s)n=h[s],o=n.geometry,a=o.constructor,p[s]=new m({geometry:a.createShadowVolume(o,F(this),B(this)),attributes:n.attributes,id:n.id,pickPrimitive:this});r.geometryInstances=p,r._createBoundingVolumeFunction=function(e,t){q(i,e,t)},r._createRenderStatesFunction=function(e,t,r,n){j(i,t)},r._createShaderProgramFunction=function(e,t,r){X(i,t)},r._createCommandsFunction=function(e,t,r,n,o,a,s){Q(i,void 0,void 0,!0,!1,a,s)},r._updateAndQueueCommandsFunction=function(e,t,r,n,o,a,s,l){J(i,t,r,n,o,a,s,l)},this._primitive=new I(r),this._primitive.readyPromise.then(function(e){i._ready=!0,i.releaseGeometryInstances&&(i.geometryInstances=void 0);var t=e._error;u(t)?i._readyPromise.reject(t):i._readyPromise.resolve(i)})}this.debugShowShadowVolume&&!this._debugShowShadowVolume&&this._ready?(this._debugShowShadowVolume=!0,this._rsStencilPreloadPass=S.fromCache(V(!1)),this._rsStencilDepthPass=S.fromCache(k(!1)),this._rsColorPass=S.fromCache(z(!1))):!this.debugShowShadowVolume&&this._debugShowShadowVolume&&(this._debugShowShadowVolume=!1,this._rsStencilPreloadPass=S.fromCache(V(!0)),this._rsStencilDepthPass=S.fromCache(k(!0)),this._rsColorPass=S.fromCache(z(!0))),this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e)}},L.prototype.getBoundingSphere=function(e){var t=this._boundingSpheresKeys.indexOf(e);if(t!==-1)return this._boundingSpheres[t]},L.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)},L.prototype.isDestroyed=function(){return!1},L.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),h(this)},L}),i("DataSources/CorridorGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/CorridorGeometry","../Core/CorridorOutlineGeometry","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/oneTimeWarning","../Core/ShowGeometryInstanceAttribute","../Scene/GroundPrimitive","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T){"use strict";function x(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.cornerType=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0}function A(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(A.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._isClosed=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new h,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._onTerrain=!1,this._options=new x(e),this._onEntityPropertyChanged(e,"corridor",e.corridor,void 0)}function P(e,t,i){this._primitives=e,this._groundPrimitives=t,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=i,this._options=new x(i._entity)}var D=new w(e.WHITE),M=new S(!0),I=new S(!0),R=new S(!1),O=new S(e.BLACK),N=new S(C.DISABLED),L=new S(new u),B=new e;return a(A,{perInstanceColorAppearanceType:{value:v},materialAppearanceType:{value:g}}),a(A.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!o(this._entity.availability)&&T.isConstant(this._showProperty)&&T.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!o(this._entity.availability)&&T.isConstant(this._showProperty)&&T.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayCondition}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},onTerrain:{get:function(){return this._onTerrain}},geometryChanged:{get:function(){return this._geometryChanged}}}),A.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},A.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},A.prototype.createFillGeometryInstance=function(r){var n,a,s=this._entity,l=s.isAvailable(r),u=new f(l&&s.isShowing&&this._showProperty.getValue(r)&&this._fillProperty.getValue(r)),h=c.fromDistanceDisplayCondition(this._distanceDisplayCondition.getValue(r));if(this._materialProperty instanceof w){var p=e.WHITE;o(this._materialProperty.color)&&(this._materialProperty.color.isConstant||l)&&(p=this._materialProperty.color.getValue(r)),a=t.fromColor(p),n={show:u,distanceDisplayCondition:h,color:a}}else n={show:u,distanceDisplayCondition:h};return new d({id:s,geometry:new i(this._options),attributes:n})},A.prototype.createOutlineGeometryInstance=function(i){var n=this._entity,o=n.isAvailable(i),a=T.getValueOrDefault(this._outlineColorProperty,i,e.BLACK);return new d({ +id:n,geometry:new r(this._options),attributes:{show:new f(o&&n.isShowing&&this._showProperty.getValue(i)&&this._showOutlineProperty.getValue(i)),color:t.fromColor(a),distanceDisplayCondition:c.fromDistanceDisplayCondition(this._distanceDisplayCondition.getValue(i))}})},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){this._entitySubscription(),s(this)},A.prototype._onEntityPropertyChanged=function(e,t,i,r){if("availability"===t||"corridor"===t){var a=this._entity.corridor;if(!o(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!o(s)||!s.isConstant||s.getValue(p.MINIMUM_VALUE),u=a.outline,c=o(u);if(c&&u.isConstant&&(c=u.getValue(p.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var h=a.positions,d=a.show;if(o(d)&&d.isConstant&&!d.getValue(p.MINIMUM_VALUE)||!o(h))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var f=n(a.material,D),y=f instanceof w;this._materialProperty=f,this._fillProperty=n(s,I),this._showProperty=n(d,M),this._showOutlineProperty=n(a.outline,R),this._outlineColorProperty=c?n(a.outlineColor,O):void 0,this._shadowsProperty=n(a.shadows,N),this._distanceDisplayCondition=n(a.distanceDisplayCondition,L);var C=a.height,S=a.extrudedHeight,E=a.granularity,b=a.width,x=a.outlineWidth,A=a.cornerType,P=l&&!o(C)&&!o(S)&&y&&_.isSupported(this._scene);if(c&&P&&(m(m.geometryOutlines),c=!1),this._fillEnabled=l,this._onTerrain=P,this._isClosed=o(S)||P,this._outlineEnabled=c,h.isConstant&&T.isConstant(C)&&T.isConstant(S)&&T.isConstant(E)&&T.isConstant(b)&&T.isConstant(x)&&T.isConstant(A)&&(!P||T.isConstant(f))){var B=this._options;B.vertexFormat=y?v.VERTEX_FORMAT:g.MaterialSupport.TEXTURED.vertexFormat,B.positions=h.getValue(p.MINIMUM_VALUE,B.positions),B.height=o(C)?C.getValue(p.MINIMUM_VALUE):void 0,B.extrudedHeight=o(S)?S.getValue(p.MINIMUM_VALUE):void 0,B.granularity=o(E)?E.getValue(p.MINIMUM_VALUE):void 0,B.width=o(b)?b.getValue(p.MINIMUM_VALUE):void 0,B.cornerType=o(A)?A.getValue(p.MINIMUM_VALUE):void 0,this._outlineWidth=o(x)?x.getValue(p.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},A.prototype.createDynamicUpdater=function(e,t){return new P(e,t,this)},P.prototype.update=function(n){var a=this._geometryUpdater,s=a._onTerrain,l=this._primitives,u=this._groundPrimitives;s?u.removeAndDestroy(this._primitive):(l.removeAndDestroy(this._primitive),l.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;var h=a._entity,p=h.corridor;if(h.isShowing&&h.isAvailable(n)&&T.getValueOrDefault(p.show,n,!0)){var m=this._options,f=T.getValueOrUndefined(p.positions,n,m.positions),C=T.getValueOrUndefined(p.width,n);if(o(f)&&o(C)){m.positions=f,m.width=C,m.height=T.getValueOrUndefined(p.height,n),m.extrudedHeight=T.getValueOrUndefined(p.extrudedHeight,n),m.granularity=T.getValueOrUndefined(p.granularity,n),m.cornerType=T.getValueOrUndefined(p.cornerType,n);var w=this._geometryUpdater.shadowsProperty.getValue(n),S=this._geometryUpdater.distanceDisplayConditionProperty.getValue(n),E=c.fromDistanceDisplayCondition(S);if(!o(p.fill)||p.fill.getValue(n)){var x=a.fillMaterialProperty,A=b.getValue(n,x,this._material);if(this._material=A,s){var P=e.WHITE;o(x.color)&&(P=x.color.getValue(n)),this._primitive=u.add(new _({geometryInstances:new d({id:h,geometry:new i(m),attributes:{color:t.fromColor(P),distanceDisplayCondition:E}}),asynchronous:!1,shadows:w}))}else{var D=new g({material:A,translucent:A.isTranslucent(),closed:o(m.extrudedHeight)});m.vertexFormat=D.vertexFormat,this._primitive=l.add(new y({geometryInstances:new d({id:h,geometry:new i(m),attributes:{distanceDisplayCondition:E}}),appearance:D,asynchronous:!1,shadows:w}))}}if(!s&&o(p.outline)&&p.outline.getValue(n)){m.vertexFormat=v.VERTEX_FORMAT;var M=T.getValueOrClonedDefault(p.outlineColor,n,e.BLACK,B),I=T.getValueOrDefault(p.outlineWidth,n,1),R=1!==M.alpha;this._outlinePrimitive=l.add(new y({geometryInstances:new d({id:h,geometry:new r(m),attributes:{color:t.fromColor(M),distanceDisplayCondition:E}}),appearance:new v({flat:!0,translucent:R,renderState:{lineWidth:a._scene.clampLineWidth(I)}}),asynchronous:!1,shadows:w}))}}}},P.prototype.getBoundingSphere=function(e,t){return E(e,this._primitive,this._outlinePrimitive,t)},P.prototype.isDestroyed=function(){return!1},P.prototype.destroy=function(){var e=this._primitives,t=this._groundPrimitives;this._geometryUpdater._onTerrain?t.removeAndDestroy(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),s(this)},A}),i("DataSources/DataSource",["../Core/defineProperties","../Core/DeveloperError"],function(e,t){"use strict";function i(){t.throwInstantiationError()}return e(i.prototype,{name:{get:t.throwInstantiationError},clock:{get:t.throwInstantiationError},entities:{get:t.throwInstantiationError},isLoading:{get:t.throwInstantiationError},changedEvent:{get:t.throwInstantiationError},errorEvent:{get:t.throwInstantiationError},loadingEvent:{get:t.throwInstantiationError},show:{get:t.throwInstantiationError},clustering:{get:t.throwInstantiationError}}),i.prototype.update=t.throwInstantiationError,i.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))},i}),i("Scene/SceneTransforms",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/defined","../Core/DeveloperError","../Core/Math","../Core/Matrix4","../Core/Transforms","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(e,t,n,o){var a=n.viewMatrix,s=l.multiplyByVector(a,r.fromElements(e.x,e.y,e.z,1,v),v),u=i.multiplyComponents(t,i.normalize(s,y),y);return s.x+=t.x+u.x,s.y+=t.y+u.y,s.z+=u.z,l.multiplyByVector(n.frustum.projectionMatrix,s,o)}var d={},p=new r(0,0,0,1),m=new r,f=new e,_=new t,g=new t;d.wgs84ToWindowCoordinates=function(e,t,r){return d.wgs84WithEyeOffsetToWindowCoordinates(e,t,i.ZERO,r)};var v=new r,y=new i,C=new n(Math.PI,s.PI_OVER_TWO),w=new i,S=new i;d.wgs84WithEyeOffsetToWindowCoordinates=function(e,r,n,a){var v=e.frameState,y=d.computeActualWgs84Position(v,r,p);if(o(y)){var E=e.canvas,b=f;b.x=0,b.y=0,b.width=E.clientWidth,b.height=E.clientHeight;var T=e.camera,x=!1;if(v.mode===c.SCENE2D){var A=e.mapProjection,P=C,D=A.project(P,w),M=i.clone(T.position,S),I=T.frustum.clone(),R=l.computeViewportTransformation(b,0,1,new l),O=T.frustum.projectionMatrix,N=T.positionWC.y,L=i.fromElements(s.sign(N)*D.x-N,0,-T.positionWC.x),B=u.pointToGLWindowCoordinates(O,R,L);if(0===N||B.x<=0||B.x>=E.clientWidth)x=!0;else{if(B.x>.5*E.clientWidth){b.width=B.x,T.frustum.right=D.x-N,m=h(y,n,T,m),d.clipToGLWindowCoordinates(b,m,_),b.x+=B.x,T.position.x=-T.position.x;var F=T.frustum.right;T.frustum.right=-T.frustum.left,T.frustum.left=-F,m=h(y,n,T,m),d.clipToGLWindowCoordinates(b,m,g)}else{b.x+=B.x,b.width-=B.x,T.frustum.left=-D.x-N,m=h(y,n,T,m),d.clipToGLWindowCoordinates(b,m,_),b.x=b.x-b.width,T.position.x=-T.position.x;var V=T.frustum.left;T.frustum.left=-T.frustum.right,T.frustum.right=-V,m=h(y,n,T,m),d.clipToGLWindowCoordinates(b,m,g)}i.clone(M,T.position),T.frustum=I.clone(),a=t.clone(_,a),(a.x<0||a.x>E.clientWidth)&&(a.x=g.x)}}if(v.mode!==c.SCENE2D||x){if(m=h(y,n,T,m),m.z<0&&v.mode!==c.SCENE2D)return;a=d.clipToGLWindowCoordinates(b,m,a)}return a.y=E.clientHeight-a.y,a}},d.wgs84ToDrawingBufferCoordinates=function(e,t,i){if(i=d.wgs84ToWindowCoordinates(e,t,i),o(i))return d.transformWindowToDrawingBuffer(e,i,i)};var E=new i,b=new n;d.computeActualWgs84Position=function(e,t,r){var n=e.mode;if(n===c.SCENE3D)return i.clone(t,r);var a=e.mapProjection,l=a.ellipsoid.cartesianToCartographic(t,b);if(o(l)){if(a.project(l,E),n===c.COLUMBUS_VIEW)return i.fromElements(E.z,E.x,E.y,r);if(n===c.SCENE2D)return i.fromElements(0,E.x,E.y,r);var u=e.morphTime;return i.fromElements(s.lerp(E.z,t.x,u),s.lerp(E.x,t.y,u),s.lerp(E.y,t.z,u),r)}};var T=new i,x=new i,A=new l;d.clipToGLWindowCoordinates=function(e,r,n){return i.divideByScalar(r,r.w,T),l.computeViewportTransformation(e,0,1,A),l.multiplyByPoint(A,T,x),t.fromCartesian3(x,n)},d.clipToDrawingBufferCoordinates=function(e,r,n){return i.divideByScalar(r,r.w,T),l.computeViewportTransformation(e,0,1,A),l.multiplyByPoint(A,T,x),t.fromCartesian3(x,n)},d.transformWindowToDrawingBuffer=function(e,i,r){var n=e.canvas,o=e.drawingBufferWidth/n.clientWidth,a=e.drawingBufferHeight/n.clientHeight;return t.fromElements(i.x*o,i.y*a,r)};var P=new r,D=new r;return d.drawingBufferToWgs84Coordinates=function(e,t,n,o){var a=e.context,s=a.uniformState,u=e._passState.viewport,c=r.clone(r.UNIT_W,P);c.x=(t.x-u.x)/u.width*2-1,c.y=(t.y-u.y)/u.height*2-1,c.z=2*n-1,c.w=1;var h=l.multiplyByVector(s.inverseViewProjection,c,D),d=1/h.w;return i.multiplyByScalar(h,d,h),i.fromCartesian4(h,o)},d}),i("Scene/Billboard",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/Color","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/Matrix4","../Core/NearFarScalar","./HeightReference","./HorizontalOrigin","./SceneMode","./SceneTransforms","./VerticalOrigin"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v){"use strict";function y(e,r){e=s(e,s.EMPTY_OBJECT),this._show=s(e.show,!0),this._position=i.clone(s(e.position,i.ZERO)),this._actualPosition=i.clone(this._position),this._pixelOffset=t.clone(s(e.pixelOffset,t.ZERO)),this._translate=new t(0,0),this._eyeOffset=i.clone(s(e.eyeOffset,i.ZERO)),this._heightReference=s(e.heightReference,m.NONE),this._verticalOrigin=s(e.verticalOrigin,v.CENTER),this._horizontalOrigin=s(e.horizontalOrigin,f.CENTER),this._scale=s(e.scale,1),this._color=o.clone(s(e.color,o.WHITE)),this._rotation=s(e.rotation,0),this._alignedAxis=i.clone(s(e.alignedAxis,i.ZERO)),this._width=e.width,this._height=e.height,this._scaleByDistance=e.scaleByDistance,this._translucencyByDistance=e.translucencyByDistance,this._pixelOffsetScaleByDistance=e.pixelOffsetScaleByDistance,this._sizeInMeters=s(e.sizeInMeters,!1),this._distanceDisplayCondition=e.distanceDisplayCondition,this._id=e.id,this._collection=s(e.collection,r),this._pickId=void 0,this._pickPrimitive=s(e._pickPrimitive,this),this._billboardCollection=r,this._dirty=!1,this._index=-1,this._imageIndex=-1,this._imageIndexPromise=void 0,this._imageId=void 0,this._image=void 0,this._imageSubRegion=void 0,this._imageWidth=void 0,this._imageHeight=void 0;var n=e.image,u=e.imageId;l(n)&&(l(u)||(u="string"==typeof n?n:l(n.src)?n.src:a()),this._imageId=u,this._image=n),l(e.imageSubRegion)&&(this._imageId=u,this._imageSubRegion=e.imageSubRegion),l(this._billboardCollection._textureAtlas)&&this._loadImage(),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=_.SCENE3D,this._clusterShow=!0,this._updateClamping()}function C(e,t){var i=e._billboardCollection;l(i)&&(i._updateBillboard(e,t),e._dirty=!0)}var w=y.SHOW_INDEX=0,S=y.POSITION_INDEX=1,E=y.PIXEL_OFFSET_INDEX=2,b=y.EYE_OFFSET_INDEX=3,T=y.HORIZONTAL_ORIGIN_INDEX=4,x=y.VERTICAL_ORIGIN_INDEX=5,A=y.SCALE_INDEX=6,P=y.IMAGE_INDEX_INDEX=7,D=y.COLOR_INDEX=8,M=y.ROTATION_INDEX=9,I=y.ALIGNED_AXIS_INDEX=10,R=y.SCALE_BY_DISTANCE_INDEX=11,O=y.TRANSLUCENCY_BY_DISTANCE_INDEX=12,N=y.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,L=y.DISTANCE_DISPLAY_CONDITION=14;y.NUMBER_OF_PROPERTIES=15,u(y.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,C(this,w))}},position:{get:function(){return this._position},set:function(e){var t=this._position;i.equals(t,e)||(i.clone(e,t),i.clone(e,this._actualPosition),this._updateClamping(),C(this,S))}},heightReference:{get:function(){return this._heightReference},set:function(e){var t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),C(this,S))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){var i=this._pixelOffset;t.equals(i,e)||(t.clone(e,i),C(this,E))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){var t=this._scaleByDistance;p.equals(t,e)||(this._scaleByDistance=p.clone(e,t),C(this,R))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){var t=this._translucencyByDistance;p.equals(t,e)||(this._translucencyByDistance=p.clone(e,t),C(this,O))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){var t=this._pixelOffsetScaleByDistance;p.equals(t,e)||(this._pixelOffsetScaleByDistance=p.clone(e,t),C(this,N))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){var t=this._eyeOffset;i.equals(t,e)||(i.clone(e,t),C(this,b))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,C(this,T))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,C(this,x))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,C(this,A))}},color:{get:function(){return this._color},set:function(e){var t=this._color;o.equals(t,e)||(o.clone(e,t),C(this,D))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,C(this,M))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){var t=this._alignedAxis;i.equals(t,e)||(i.clone(e,t),C(this,I))}},width:{get:function(){return s(this._width,this._imageWidth)},set:function(e){this._width!==e&&(this._width=e,C(this,P))}},height:{get:function(){return s(this._height,this._imageHeight)},set:function(e){this._height!==e&&(this._height=e,C(this,P))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,C(this,D))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){h.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=h.clone(e,this._distanceDisplayCondition),C(this,L))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickPrimitive:{get:function(){return this._pickPrimitive},set:function(e){this._pickPrimitive=e,l(this._pickId)&&(this._pickId.object.primitive=e)}},image:{get:function(){return this._imageId},set:function(e){l(e)?"string"==typeof e?this.setImage(e,e):l(e.src)?this.setImage(e.src,e):this.setImage(a(),e):(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=void 0,this._image=void 0,this._imageIndexPromise=void 0,C(this,P))}},ready:{get:function(){return this._imageIndex!==-1}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=i.clone(e,this._actualClampedPosition),C(this,S)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,C(this,w))}}}),y.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId},y.prototype._updateClamping=function(){y._updateClamping(this._billboardCollection,this)};var B=new n,F=new i;y._updateClamping=function(e,t){function r(e){if(t._heightReference===m.RELATIVE_TO_GROUND)if(t._mode===_.SCENE3D){var r=s.cartesianToCartographic(e,B);r.height+=d.height,s.cartographicToCartesian(r,e)}else e.x+=d.height;t._clampedPosition=i.clone(e,t._clampedPosition)}var o=e._scene;if(l(o)){var a=o.globe,s=a.ellipsoid,u=a._surface,c=o.frameState.mode,h=c!==t._mode;if(t._mode=c,(t._heightReference===m.NONE||h)&&l(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0),t._heightReference!==m.NONE&&l(t._position)){var d=s.cartesianToCartographic(t._position);if(l(d)){l(t._removeCallbackFunc)&&t._removeCallbackFunc(),t._removeCallbackFunc=u.updateHeight(d,r),n.clone(d,B);var p=a.getHeight(d);l(p)&&(B.height=p),s.cartographicToCartesian(B,F),r(F)}}}},y.prototype._loadImage=function(){var t,i=this._billboardCollection._textureAtlas,r=this._imageId,n=this._image,o=this._imageSubRegion;if(l(n)&&(t=i.addImage(r,n)),l(o)&&(t=i.addSubRegion(r,o)),this._imageIndexPromise=t,l(t)){var a=this;t.then(function(t){if(a._imageId===r&&a._image===n&&e.equals(a._imageSubRegion,o)){var s=i.textureCoordinates[t];a._imageWidth=i.texture.width*s.width,a._imageHeight=i.texture.height*s.height,a._imageIndex=t,a._ready=!0,a._image=void 0,a._imageIndexPromise=void 0,C(a,P)}}).otherwise(function(e){console.error("Error loading image for billboard: "+e),a._imageIndexPromise=void 0})}},y.prototype.setImage=function(e,t){this._imageId!==e&&(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=e,this._image=t,l(this._billboardCollection._textureAtlas)&&this._loadImage())},y.prototype.setImageSubRegion=function(t,i){this._imageId===t&&e.equals(this._imageSubRegion,i)||(this._imageIndex=-1,this._imageId=t,this._imageSubRegion=e.clone(i),l(this._billboardCollection._textureAtlas)&&this._loadImage())},y.prototype._setTranslate=function(e){var i=this._translate;t.equals(i,e)||(t.clone(e,i),C(this,E))},y.prototype._getActualPosition=function(){return l(this._clampedPosition)?this._clampedPosition:this._actualPosition},y.prototype._setActualPosition=function(e){l(this._clampedPosition)||i.clone(e,this._actualPosition),C(this,S)};var V=new r;y._computeActualPosition=function(e,t,i,r){return l(e._clampedPosition)?(i.mode!==e._mode&&e._updateClamping(),e._clampedPosition):i.mode===_.SCENE3D?t:(d.multiplyByPoint(r,t,V),g.computeActualWgs84Position(i,V))};var k=new i;y._computeScreenSpacePosition=function(e,i,r,n,o,a){var s=d.multiplyByPoint(e,i,k),u=g.wgs84WithEyeOffsetToWindowCoordinates(o,s,r,a);if(l(u))return t.add(u,n,u),u};var z=new t(0,0);return y.prototype.computeScreenSpacePosition=function(e,i){var r=this._billboardCollection;l(i)||(i=new t),t.clone(this._pixelOffset,z),t.add(z,this._translate,z);var n=r.modelMatrix,o=this._getActualPosition(),a=y._computeScreenSpacePosition(n,o,this._eyeOffset,z,e,i);return a},y.getScreenSpaceBoundingBox=function(t,i,r){var n=t.width,o=t.height,a=t.scale;n*=a,o*=a;var s=i.x;t.horizontalOrigin===f.RIGHT?s-=n:t.horizontalOrigin===f.CENTER&&(s-=.5*n);var u=i.y;return t.verticalOrigin===v.BOTTOM||t.verticalOrigin===v.BASELINE?u-=o:t.verticalOrigin===v.CENTER&&(u-=.5*o),l(r)||(r=new e),r.x=s,r.y=u,r.width=n,r.height=o,r},y.prototype.equals=function(r){return this===r||l(r)&&this._id===r._id&&i.equals(this._position,r._position)&&this._imageId===r._imageId&&this._show===r._show&&this._scale===r._scale&&this._verticalOrigin===r._verticalOrigin&&this._horizontalOrigin===r._horizontalOrigin&&this._heightReference===r._heightReference&&e.equals(this._imageSubRegion,r._imageSubRegion)&&o.equals(this._color,r._color)&&t.equals(this._pixelOffset,r._pixelOffset)&&t.equals(this._translate,r._translate)&&i.equals(this._eyeOffset,r._eyeOffset)&&p.equals(this._scaleByDistance,r._scaleByDistance)&&p.equals(this._translucencyByDistance,r._translucencyByDistance)&&p.equals(this._pixelOffsetScaleByDistance,r._pixelOffsetScaleByDistance)&&h.equals(this._distanceDisplayCondition,r._distanceDisplayCondition)},y.prototype._destroy=function(){l(this._customData)&&(this._billboardCollection._scene.globe._surface.removeTileCustomData(this._customData),this._customData=void 0),l(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this.image=void 0,this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0},y}),i("Renderer/VertexArrayFacade",["../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Math","./Buffer","./BufferUsage","./VertexArray"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(r,n,o,a){function s(t,i){return e.getSizeInBytes(i.componentDatatype)-e.getSizeInBytes(t.componentDatatype)}var l=u._verifyAttributes(n);o=t(o,0);for(var c,h,d=[],p={},m=l.length,f=0;f<m;++f){var _=l[f];_.vertexBuffer?d.push(_):(h=_.usage,c=p[h],i(c)||(c=p[h]=[]),c.push(_))}this._allBuffers=[];for(h in p)if(p.hasOwnProperty(h)){c=p[h],c.sort(s);var g=u._vertexSizeInBytes(c),v=c[0].usage,y={vertexSizeInBytes:g,vertexBuffer:void 0,usage:v,needsCommit:!1,arrayBuffer:void 0,arrayViews:u._createArrayViews(c,g)};this._allBuffers.push(y)}this._size=0,this._instanced=t(a,!1),this._precreated=d,this._context=r,this.writers=void 0,this.va=void 0,this.resize(o)}function c(e,t){if(t.needsCommit&&t.vertexSizeInBytes>0){t.needsCommit=!1;var r=t.vertexBuffer,n=e._size*t.vertexSizeInBytes,o=i(r);if(!o||r.sizeInBytes<n)return o&&r.destroy(),t.vertexBuffer=a.createVertexBuffer({context:e._context,typedArray:t.arrayBuffer,usage:t.usage}),t.vertexBuffer.vertexArrayDestroyable=!1,!0;t.vertexBuffer.copyFromArrayView(t.arrayBuffer)}return!1}function h(e,t,i){if(e.needsCommit&&e.vertexSizeInBytes>0){var r=e.vertexSizeInBytes*t,n=e.vertexSizeInBytes*i;e.vertexBuffer.copyFromArrayView(new Uint8Array(e.arrayBuffer,r,n),r)}}function d(e){var t=e.va;if(i(t)){for(var r=t.length,n=0;n<r;++n)t[n].va.destroy();e.va=void 0}}u._verifyAttributes=function(i){for(var r=[],n=0;n<i.length;++n){var o=i[n],a={index:t(o.index,n),enabled:t(o.enabled,!0),componentsPerAttribute:o.componentsPerAttribute,componentDatatype:t(o.componentDatatype,e.FLOAT),normalize:t(o.normalize,!1),vertexBuffer:o.vertexBuffer,usage:t(o.usage,s.STATIC_DRAW)};r.push(a)}for(var l=new Array(r.length),u=0;u<r.length;++u){var c=r[u],h=c.index;l[h]=!0}return r},u._vertexSizeInBytes=function(t){for(var i=0,r=t.length,n=0;n<r;++n){var o=t[n];i+=o.componentsPerAttribute*e.getSizeInBytes(o.componentDatatype)}var a=r>0?e.getSizeInBytes(t[0].componentDatatype):0,s=a>0?i%a:0,l=0===s?0:a-s;return i+=l},u._createArrayViews=function(t,i){for(var r=[],n=0,o=t.length,a=0;a<o;++a){var s=t[a],l=s.componentDatatype;r.push({index:s.index,enabled:s.enabled,componentsPerAttribute:s.componentsPerAttribute,componentDatatype:l,normalize:s.normalize,offsetInBytes:n,vertexSizeInComponentType:i/e.getSizeInBytes(l),view:void 0}),n+=s.componentsPerAttribute*e.getSizeInBytes(l)}return r},u.prototype.resize=function(e){this._size=e;var t=this._allBuffers;this.writers=[];for(var i=0,r=t.length;i<r;++i){var n=t[i];u._resize(n,this._size),u._appendWriters(this.writers,n)}d(this)},u._resize=function(t,r){if(t.vertexSizeInBytes>0){var n=new ArrayBuffer(r*t.vertexSizeInBytes);if(i(t.arrayBuffer))for(var o=new Uint8Array(n),a=new Uint8Array(t.arrayBuffer),s=a.length,l=0;l<s;++l)o[l]=a[l];for(var u=t.arrayViews,c=u.length,h=0;h<c;++h){var d=u[h];d.view=e.createArrayBufferView(d.componentDatatype,n,d.offsetInBytes)}t.arrayBuffer=n}};var p=[function(e,t,i){return function(r,n){t[r*i]=n,e.needsCommit=!0}},function(e,t,i){return function(r,n,o){var a=r*i;t[a]=n,t[a+1]=o,e.needsCommit=!0}},function(e,t,i){return function(r,n,o,a){var s=r*i;t[s]=n,t[s+1]=o,t[s+2]=a,e.needsCommit=!0}},function(e,t,i){return function(r,n,o,a,s){var l=r*i;t[l]=n,t[l+1]=o,t[l+2]=a,t[l+3]=s,e.needsCommit=!0}}];return u._appendWriters=function(e,t){for(var i=t.arrayViews,r=i.length,n=0;n<r;++n){var o=i[n];e[o.index]=p[o.componentsPerAttribute-1](t,o.view,o.vertexSizeInComponentType)}},u.prototype.commit=function(e){var t,r,n,a=!1,s=this._allBuffers;for(r=0,n=s.length;r<n;++r)t=s[r],a=c(this,t)||a;if(a||!i(this.va)){d(this);for(var h=this.va=[],p=i(e)?Math.ceil(this._size/(o.SIXTY_FOUR_KILOBYTES-1)):1,m=0;m<p;++m){var f=[];for(r=0,n=s.length;r<n;++r){t=s[r];var _=m*(t.vertexSizeInBytes*(o.SIXTY_FOUR_KILOBYTES-1));u._appendAttributes(f,t,_,this._instanced)}f=f.concat(this._precreated),h.push({va:new l({context:this._context,attributes:f,indexBuffer:e}),indicesCount:1.5*(m!==p-1?o.SIXTY_FOUR_KILOBYTES-1:this._size%(o.SIXTY_FOUR_KILOBYTES-1))})}}},u._appendAttributes=function(e,t,i,r){for(var n=t.arrayViews,o=n.length,a=0;a<o;++a){var s=n[a];e.push({index:s.index,enabled:s.enabled,componentsPerAttribute:s.componentsPerAttribute,componentDatatype:s.componentDatatype,normalize:s.normalize,vertexBuffer:t.vertexBuffer,offsetInBytes:i+s.offsetInBytes,strideInBytes:t.vertexSizeInBytes,instanceDivisor:r?1:0})}},u.prototype.subCommit=function(e,t){for(var i=this._allBuffers,r=0,n=i.length;r<n;++r)h(i[r],e,t)},u.prototype.endSubCommits=function(){for(var e=this._allBuffers,t=0,i=e.length;t<i;++t)e[t].needsCommit=!1},u.prototype.isDestroyed=function(){return!1},u.prototype.destroy=function(){for(var e=this._allBuffers,t=0,i=e.length;t<i;++t){var n=e[t];n.vertexBuffer=n.vertexBuffer&&n.vertexBuffer.destroy()}return d(this),r(this)},u}),i("Shaders/BillboardCollectionFS",[],function(){"use strict";return"uniform sampler2D u_atlas;\nvarying vec2 v_textureCoordinates;\n#ifdef RENDER_FOR_PICK\nvarying vec4 v_pickColor;\n#else\nvarying vec4 v_color;\n#endif\nvoid main()\n{\n#ifdef RENDER_FOR_PICK\nvec4 vertexColor = vec4(1.0, 1.0, 1.0, 1.0);\n#else\nvec4 vertexColor = v_color;\n#endif\nvec4 color = texture2D(u_atlas, v_textureCoordinates) * vertexColor;\n#if defined(RENDER_FOR_PICK) || (!defined(OPAQUE) && !defined(TRANSLUCENT))\nif (color.a < 0.005)\n{\ndiscard;\n}\n#else\n#ifdef OPAQUE\nif (color.a < 0.995)\n{\ndiscard;\n}\n#else\nif (color.a >= 0.995)\n{\ndiscard;\n}\n#endif\n#endif\n#ifdef RENDER_FOR_PICK\ngl_FragColor = v_pickColor;\n#else\ngl_FragColor = color;\n#endif\n}\n"}),i("Shaders/BillboardCollectionVS",[],function(){"use strict";return"#ifdef INSTANCED\nattribute vec2 direction;\n#endif\nattribute vec4 positionHighAndScale;\nattribute vec4 positionLowAndRotation;\nattribute vec4 compressedAttribute0;\nattribute vec4 compressedAttribute1;\nattribute vec4 compressedAttribute2;\nattribute vec4 eyeOffset;\nattribute vec4 scaleByDistance;\nattribute vec4 pixelOffsetScaleByDistance;\nattribute vec2 distanceDisplayCondition;\nvarying vec2 v_textureCoordinates;\n#ifdef RENDER_FOR_PICK\nvarying vec4 v_pickColor;\n#else\nvarying vec4 v_color;\n#endif\nconst float UPPER_BOUND = 32768.0;\nconst float SHIFT_LEFT16 = 65536.0;\nconst float SHIFT_LEFT8 = 256.0;\nconst float SHIFT_LEFT7 = 128.0;\nconst float SHIFT_LEFT5 = 32.0;\nconst float SHIFT_LEFT3 = 8.0;\nconst float SHIFT_LEFT2 = 4.0;\nconst float SHIFT_LEFT1 = 2.0;\nconst float SHIFT_RIGHT8 = 1.0 / 256.0;\nconst float SHIFT_RIGHT7 = 1.0 / 128.0;\nconst float SHIFT_RIGHT5 = 1.0 / 32.0;\nconst float SHIFT_RIGHT3 = 1.0 / 8.0;\nconst float SHIFT_RIGHT2 = 1.0 / 4.0;\nconst float SHIFT_RIGHT1 = 1.0 / 2.0;\nvec4 computePositionWindowCoordinates(vec4 positionEC, vec2 imageSize, float scale, vec2 direction, vec2 origin, vec2 translate, vec2 pixelOffset, vec3 alignedAxis, bool validAlignedAxis, float rotation, bool sizeInMeters)\n{\nvec2 halfSize = imageSize * scale * czm_resolutionScale * 0.5;\nhalfSize *= ((direction * 2.0) - 1.0);\nvec2 originTranslate = origin * abs(halfSize);\n#if defined(ROTATION) || defined(ALIGNED_AXIS)\nif (validAlignedAxis || rotation != 0.0)\n{\nfloat angle = rotation;\nif (validAlignedAxis)\n{\nvec3 pos = positionEC.xyz + czm_encodedCameraPositionMCHigh + czm_encodedCameraPositionMCLow;\nvec3 normal = normalize(cross(alignedAxis, pos));\nvec4 tangent = vec4(normalize(cross(pos, normal)), 0.0);\ntangent = czm_modelViewProjection * tangent;\nangle += sign(-tangent.x) * acos(tangent.y / length(tangent.xy));\n}\nfloat cosTheta = cos(angle);\nfloat sinTheta = sin(angle);\nmat2 rotationMatrix = mat2(cosTheta, sinTheta, -sinTheta, cosTheta);\nhalfSize = rotationMatrix * halfSize;\n}\n#endif\nif (sizeInMeters)\n{\npositionEC.xy += halfSize;\n}\nvec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\nif (sizeInMeters)\n{\noriginTranslate += originTranslate / czm_metersPerPixel(positionEC);\n}\npositionWC.xy += originTranslate;\nif (!sizeInMeters)\n{\npositionWC.xy += halfSize;\n}\npositionWC.xy += translate;\npositionWC.xy += (pixelOffset * czm_resolutionScale);\nreturn positionWC;\n}\nvoid main()\n{\nvec3 positionHigh = positionHighAndScale.xyz;\nvec3 positionLow = positionLowAndRotation.xyz;\nfloat scale = positionHighAndScale.w;\n#if defined(ROTATION) || defined(ALIGNED_AXIS)\nfloat rotation = positionLowAndRotation.w;\n#else\nfloat rotation = 0.0;\n#endif\nfloat compressed = compressedAttribute0.x;\nvec2 pixelOffset;\npixelOffset.x = floor(compressed * SHIFT_RIGHT7);\ncompressed -= pixelOffset.x * SHIFT_LEFT7;\npixelOffset.x -= UPPER_BOUND;\nvec2 origin;\norigin.x = floor(compressed * SHIFT_RIGHT5);\ncompressed -= origin.x * SHIFT_LEFT5;\norigin.y = floor(compressed * SHIFT_RIGHT3);\ncompressed -= origin.y * SHIFT_LEFT3;\norigin -= vec2(1.0);\nfloat show = floor(compressed * SHIFT_RIGHT2);\ncompressed -= show * SHIFT_LEFT2;\n#ifdef INSTANCED\nvec2 textureCoordinatesBottomLeft = czm_decompressTextureCoordinates(compressedAttribute0.w);\nvec2 textureCoordinatesRange = czm_decompressTextureCoordinates(eyeOffset.w);\nvec2 textureCoordinates = textureCoordinatesBottomLeft + direction * textureCoordinatesRange;\n#else\nvec2 direction;\ndirection.x = floor(compressed * SHIFT_RIGHT1);\ndirection.y = compressed - direction.x * SHIFT_LEFT1;\nvec2 textureCoordinates = czm_decompressTextureCoordinates(compressedAttribute0.w);\n#endif\nfloat temp = compressedAttribute0.y * SHIFT_RIGHT8;\npixelOffset.y = -(floor(temp) - UPPER_BOUND);\nvec2 translate;\ntranslate.y = (temp - floor(temp)) * SHIFT_LEFT16;\ntemp = compressedAttribute0.z * SHIFT_RIGHT8;\ntranslate.x = floor(temp) - UPPER_BOUND;\ntranslate.y += (temp - floor(temp)) * SHIFT_LEFT8;\ntranslate.y -= UPPER_BOUND;\ntemp = compressedAttribute1.x * SHIFT_RIGHT8;\nvec2 imageSize = vec2(floor(temp), compressedAttribute2.w);\n#ifdef EYE_DISTANCE_TRANSLUCENCY\nvec4 translucencyByDistance;\ntranslucencyByDistance.x = compressedAttribute1.z;\ntranslucencyByDistance.z = compressedAttribute1.w;\ntranslucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;\ntemp = compressedAttribute1.y * SHIFT_RIGHT8;\ntranslucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;\n#endif\n#ifdef ALIGNED_AXIS\nvec3 alignedAxis = czm_octDecode(floor(compressedAttribute1.y * SHIFT_RIGHT8));\ntemp = compressedAttribute2.z * SHIFT_RIGHT5;\nbool validAlignedAxis = (temp - floor(temp)) * SHIFT_LEFT1 > 0.0;\n#else\nvec3 alignedAxis = vec3(0.0);\nbool validAlignedAxis = false;\n#endif\n#ifdef RENDER_FOR_PICK\ntemp = compressedAttribute2.y;\n#else\ntemp = compressedAttribute2.x;\n#endif\nvec4 color;\ntemp = temp * SHIFT_RIGHT8;\ncolor.b = (temp - floor(temp)) * SHIFT_LEFT8;\ntemp = floor(temp) * SHIFT_RIGHT8;\ncolor.g = (temp - floor(temp)) * SHIFT_LEFT8;\ncolor.r = floor(temp);\ntemp = compressedAttribute2.z * SHIFT_RIGHT8;\nbool sizeInMeters = floor((temp - floor(temp)) * SHIFT_LEFT7) > 0.0;\ntemp = floor(temp) * SHIFT_RIGHT8;\n#ifdef RENDER_FOR_PICK\ncolor.a = (temp - floor(temp)) * SHIFT_LEFT8;\nvec4 pickColor = color / 255.0;\n#else\ncolor.a = floor(temp);\ncolor /= 255.0;\n#endif\nvec4 p = czm_translateRelativeToEye(positionHigh, positionLow);\nvec4 positionEC = czm_modelViewRelativeToEye * p;\npositionEC = czm_eyeOffset(positionEC, eyeOffset.xyz);\npositionEC.xyz *= show;\n#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(EYE_DISTANCE_PIXEL_OFFSET) || defined(DISTANCE_DISPLAY_CONDITION)\nfloat lengthSq;\nif (czm_sceneMode == czm_sceneMode2D)\n{\nlengthSq = czm_eyeHeight2D.y;\n}\nelse\n{\nlengthSq = dot(positionEC.xyz, positionEC.xyz);\n}\n#endif\n#ifdef EYE_DISTANCE_SCALING\nscale *= czm_nearFarScalar(scaleByDistance, lengthSq);\nif (scale == 0.0)\n{\npositionEC.xyz = vec3(0.0);\n}\n#endif\nfloat translucency = 1.0;\n#ifdef EYE_DISTANCE_TRANSLUCENCY\ntranslucency = czm_nearFarScalar(translucencyByDistance, lengthSq);\nif (translucency == 0.0)\n{\npositionEC.xyz = vec3(0.0);\n}\n#endif\n#ifdef EYE_DISTANCE_PIXEL_OFFSET\nfloat pixelOffsetScale = czm_nearFarScalar(pixelOffsetScaleByDistance, lengthSq);\npixelOffset *= pixelOffsetScale;\n#endif\n#ifdef DISTANCE_DISPLAY_CONDITION\nfloat nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x;\nfloat farSq = distanceDisplayCondition.y * distanceDisplayCondition.y;\nif (lengthSq < nearSq || lengthSq > farSq)\n{\npositionEC.xyz = vec3(0.0);\n}\n#endif\nvec4 positionWC = computePositionWindowCoordinates(positionEC, imageSize, scale, direction, origin, translate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters);\ngl_Position = czm_viewportOrthographic * vec4(positionWC.xy, -positionWC.z, 1.0);\nv_textureCoordinates = textureCoordinates;\n#ifdef RENDER_FOR_PICK\nv_pickColor = pickColor;\n#else\nv_color = color;\nv_color.a *= translucency;\n#endif\n}\n"; +}),i("Scene/BlendOption",["../Core/freezeObject"],function(e){"use strict";var t={OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};return e(t)}),i("Renderer/Framebuffer",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/PixelFormat","./ContextLimits"],function(e,t,i,r,n,o,a){"use strict";function s(e,t,i){var r=e._gl;r.framebufferTexture2D(r.FRAMEBUFFER,t,i._target,i._texture,0)}function l(e,t,i){var r=e._gl;r.framebufferRenderbuffer(r.FRAMEBUFFER,t,r.RENDERBUFFER,i._getRenderbuffer())}function u(i){i=e(i,e.EMPTY_OBJECT);var r=i.context._gl;a.maximumColorAttachments;this._gl=r,this._framebuffer=r.createFramebuffer(),this._colorTextures=[],this._colorRenderbuffers=[],this._activeColorAttachments=[],this._depthTexture=void 0,this._depthRenderbuffer=void 0,this._stencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this.destroyAttachments=e(i.destroyAttachments,!0);t(i.depthTexture)||t(i.depthRenderbuffer),t(i.depthStencilTexture)||t(i.depthStencilRenderbuffer);this._bind();var n,o,u,c,h;if(t(i.colorTextures)){var d=i.colorTextures;for(c=this._colorTextures.length=this._activeColorAttachments.length=d.length,u=0;u<c;++u)n=d[u],h=this._gl.COLOR_ATTACHMENT0+u,s(this,h,n),this._activeColorAttachments[u]=h,this._colorTextures[u]=n}if(t(i.colorRenderbuffers)){var p=i.colorRenderbuffers;for(c=this._colorRenderbuffers.length=this._activeColorAttachments.length=p.length,u=0;u<c;++u)o=p[u],h=this._gl.COLOR_ATTACHMENT0+u,l(this,h,o),this._activeColorAttachments[u]=h,this._colorRenderbuffers[u]=o}t(i.depthTexture)&&(n=i.depthTexture,s(this,this._gl.DEPTH_ATTACHMENT,n),this._depthTexture=n),t(i.depthRenderbuffer)&&(o=i.depthRenderbuffer,l(this,this._gl.DEPTH_ATTACHMENT,o),this._depthRenderbuffer=o),t(i.stencilRenderbuffer)&&(o=i.stencilRenderbuffer,l(this,this._gl.STENCIL_ATTACHMENT,o),this._stencilRenderbuffer=o),t(i.depthStencilTexture)&&(n=i.depthStencilTexture,s(this,this._gl.DEPTH_STENCIL_ATTACHMENT,n),this._depthStencilTexture=n),t(i.depthStencilRenderbuffer)&&(o=i.depthStencilRenderbuffer,l(this,this._gl.DEPTH_STENCIL_ATTACHMENT,o),this._depthStencilRenderbuffer=o),this._unBind()}return i(u.prototype,{status:{get:function(){this._bind();var e=this._gl.checkFramebufferStatus(this._gl.FRAMEBUFFER);return this._unBind(),e}},numberOfColorAttachments:{get:function(){return this._activeColorAttachments.length}},depthTexture:{get:function(){return this._depthTexture}},depthRenderbuffer:{get:function(){return this._depthRenderbuffer}},stencilRenderbuffer:{get:function(){return this._stencilRenderbuffer}},depthStencilTexture:{get:function(){return this._depthStencilTexture}},depthStencilRenderbuffer:{get:function(){return this._depthStencilRenderbuffer}},hasDepthAttachment:{get:function(){return!!(this.depthTexture||this.depthRenderbuffer||this.depthStencilTexture||this.depthStencilRenderbuffer)}}}),u.prototype._bind=function(){var e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)},u.prototype._unBind=function(){var e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)},u.prototype._getActiveColorAttachments=function(){return this._activeColorAttachments},u.prototype.getColorTexture=function(e){return this._colorTextures[e]},u.prototype.getColorRenderbuffer=function(e){return this._colorRenderbuffers[e]},u.prototype.isDestroyed=function(){return!1},u.prototype.destroy=function(){if(this.destroyAttachments){for(var e=0,i=this._colorTextures,n=i.length;e<n;++e){var o=i[e];t(o)&&o.destroy()}var a=this._colorRenderbuffers;for(n=a.length,e=0;e<n;++e){var s=a[e];t(s)&&s.destroy()}this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy(),this._stencilRenderbuffer=this._stencilRenderbuffer&&this._stencilRenderbuffer.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy()}return this._gl.deleteFramebuffer(this._framebuffer),r(this)},u}),i("Scene/TextureAtlas",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/loadImage","../Core/PixelFormat","../Core/RuntimeError","../Renderer/Framebuffer","../Renderer/Texture","../ThirdParty/when"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p){"use strict";function m(e,i,n,o,a){this.bottomLeft=r(e,t.ZERO),this.topRight=r(i,t.ZERO),this.childNode1=n,this.childNode2=o,this.imageIndex=a}function f(e){e=r(e,r.EMPTY_OBJECT);var t=r(e.borderWidthInPixels,1),n=r(e.initialSize,y);this._context=e.context,this._pixelFormat=r(e.pixelFormat,u.RGBA),this._borderWidthInPixels=t,this._textureCoordinates=[],this._guid=i(),this._idHash={},this._initialSize=n,this._root=void 0}function _(e,i){var r=e._context,o=e.numberOfImages,a=2,s=e._borderWidthInPixels;if(o>0){for(var l=e._texture.width,u=e._texture.height,c=a*(l+i.width+s),p=a*(u+i.height+s),f=l/c,_=u/p,g=new m(new t(l+s,s),new t(c,u)),v=new m(new t,new t(c,u),e._root,g),y=new m(new t(s,u+s),new t(c,p)),C=new m(new t,new t(c,p),v,y),w=0;w<e._textureCoordinates.length;w++){var S=e._textureCoordinates[w];n(S)&&(S.x*=f,S.y*=_,S.width*=f,S.height*=_)}var E=new d({context:e._context,width:c,height:p,pixelFormat:e._pixelFormat}),b=new h({context:r,colorTextures:[e._texture],destroyAttachments:!1});b._bind(),E.copyFromFramebuffer(0,0,0,0,c,p),b._unBind(),b.destroy(),e._texture=e._texture&&e._texture.destroy(),e._texture=E,e._root=C}else{var T=a*(i.width+2*s),x=a*(i.height+2*s);T<e._initialSize.x&&(T=e._initialSize.x),x<e._initialSize.y&&(x=e._initialSize.y),e._texture=e._texture&&e._texture.destroy(),e._texture=new d({context:e._context,width:T,height:x,pixelFormat:e._pixelFormat}),e._root=new m(new t(s,s),new t(T,x))}}function g(e,i,r){if(n(i)){if(!n(i.childNode1)&&!n(i.childNode2)){if(n(i.imageIndex))return;var o=i.topRight.x-i.bottomLeft.x,a=i.topRight.y-i.bottomLeft.y,s=o-r.width,l=a-r.height;if(s<0||l<0)return;if(0===s&&0===l)return i;if(s>l){i.childNode1=new m(new t(i.bottomLeft.x,i.bottomLeft.y),new t(i.bottomLeft.x+r.width,i.topRight.y));var u=i.bottomLeft.x+r.width+e._borderWidthInPixels;u<i.topRight.x&&(i.childNode2=new m(new t(u,i.bottomLeft.y),new t(i.topRight.x,i.topRight.y)))}else{i.childNode1=new m(new t(i.bottomLeft.x,i.bottomLeft.y),new t(i.topRight.x,i.bottomLeft.y+r.height));var c=i.bottomLeft.y+r.height+e._borderWidthInPixels;c<i.topRight.y&&(i.childNode2=new m(new t(i.bottomLeft.x,c),new t(i.topRight.x,i.topRight.y)))}return g(e,i.childNode1,r)}return g(e,i.childNode1,r)||g(e,i.childNode2,r)}}function v(t,r,o){var a=g(t,t._root,r);if(n(a)){a.imageIndex=o;var s=t._texture.width,l=t._texture.height,u=a.topRight.x-a.bottomLeft.x,c=a.topRight.y-a.bottomLeft.y,h=a.bottomLeft.x/s,d=a.bottomLeft.y/l,p=u/s,m=c/l;t._textureCoordinates[o]=new e(h,d,p,m),t._texture.copyFrom(r,a.bottomLeft.x,a.bottomLeft.y)}else _(t,r),v(t,r,o);t._guid=i()}var y=new t(16,16);return o(f.prototype,{borderWidthInPixels:{get:function(){return this._borderWidthInPixels}},textureCoordinates:{get:function(){return this._textureCoordinates}},texture:{get:function(){return n(this._texture)||(this._texture=new d({context:this._context,width:this._initialSize.x,height:this._initialSize.y,pixelFormat:this._pixelFormat})),this._texture}},numberOfImages:{get:function(){return this._textureCoordinates.length}},guid:{get:function(){return this._guid}}}),f.prototype.addImage=function(e,t){var i=this._idHash[e];if(n(i))return i;"function"==typeof t?t=t(e):"string"==typeof t&&(t=l(t));var r=this;return i=p(t,function(e){if(r.isDestroyed())return-1;var t=r.numberOfImages;return v(r,e,t),t}),this._idHash[e]=i,i},f.prototype.addSubRegion=function(t,r){var o=this._idHash[t];if(!n(o))throw new c('image with id "'+t+'" not found in the atlas.');var a=this;return p(o,function(t){if(t===-1)return-1;var n=a._texture.width,o=a._texture.height,s=a.numberOfImages,l=a._textureCoordinates[t],u=l.x+r.x/n,c=l.y+r.y/o,h=r.width/n,d=r.height/o;return a._textureCoordinates.push(new e(u,c,h,d)),a._guid=i(),s})},f.prototype.isDestroyed=function(){return!1},f.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),a(this)},f}),i("Scene/BillboardCollection",["../Core/AttributeCompression","../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EncodedCartesian3","../Core/IndexDatatype","../Core/Math","../Core/Matrix4","../Core/WebGLConstants","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArrayFacade","../Shaders/BillboardCollectionFS","../Shaders/BillboardCollectionVS","./Billboard","./BlendingState","./BlendOption","./HeightReference","./HorizontalOrigin","./SceneMode","./TextureAtlas","./VerticalOrigin"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I,R,O){"use strict";function N(e){e=a(e,a.EMPTY_OBJECT),this._scene=e.scene,this._textureAtlas=void 0,this._textureAtlasGUID=void 0,this._destroyTextureAtlas=!0,this._sp=void 0,this._spTranslucent=void 0,this._spPick=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!1,this._shaderRotation=!1,this._compiledShaderRotation=!1,this._compiledShaderRotationPick=!1,this._shaderAlignedAxis=!1,this._compiledShaderAlignedAxis=!1,this._compiledShaderAlignedAxisPick=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._compiledShaderScaleByDistancePick=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistancePick=!1,this._shaderPixelOffsetScaleByDistance=!1,this._compiledShaderPixelOffsetScaleByDistance=!1,this._compiledShaderPixelOffsetScaleByDistancePick=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayConditionPick=!1,this._propertiesChanged=new Uint32Array(fe),this._maxSize=0,this._maxEyeOffset=0,this._maxScale=1,this._maxPixelOffset=0,this._allHorizontalCenter=!0,this._allVerticalCenter=!0,this._allSizedInMeters=!0,this._baseVolume=new t,this._baseVolumeWC=new t,this._baseVolume2D=new t,this._boundingVolume=new t,this._boundingVolumeDirty=!1,this._colorCommands=[],this._pickCommands=[],this.modelMatrix=m.clone(a(e.modelMatrix,m.IDENTITY)),this._modelMatrix=m.clone(m.IDENTITY),this.debugShowBoundingVolume=a(e.debugShowBoundingVolume,!1),this.blendOption=a(e.blendOption,P.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=I.SCENE3D,this._buffersUsage=[g.STATIC_DRAW,g.STATIC_DRAW,g.STATIC_DRAW,g.STATIC_DRAW,g.STATIC_DRAW,g.STATIC_DRAW,g.STATIC_DRAW,g.STATIC_DRAW,g.STATIC_DRAW,g.STATIC_DRAW,g.STATIC_DRAW,g.STATIC_DRAW,g.STATIC_DRAW,g.STATIC_DRAW,g.STATIC_DRAW];var i=this;this._uniforms={u_atlas:function(){return i._textureAtlas.texture}};var r=this._scene;s(r)&&(this._removeCallbackFunc=r.terrainProviderChanged.addEventListener(function(){for(var e=this._billboards,t=e.length,i=0;i<t;++i)e[i]._updateClamping()},this))}function L(e){for(var t=e.length,i=0;i<t;++i)e[i]&&e[i]._destroy()}function B(e){if(e._billboardsRemoved){e._billboardsRemoved=!1;for(var t=[],i=e._billboards,r=i.length,n=0,o=0;n<r;++n){var a=i[n];a&&(a._index=o++,t.push(a))}e._billboards=t}}function F(e){var t=16384,i=e.cache.billboardCollection_indexBufferBatched;if(s(i))return i;for(var r=6*t-6,n=new Uint16Array(r),o=0,a=0;o<r;o+=6,a+=4)n[o]=a,n[o+1]=a+1,n[o+2]=a+2,n[o+3]=a+0,n[o+4]=a+2,n[o+5]=a+3;return i=_.createIndexBuffer({context:e,typedArray:n,usage:g.STATIC_DRAW,indexDatatype:d.UNSIGNED_SHORT}),i.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferBatched=i,i}function V(e){var t=e.cache.billboardCollection_indexBufferInstanced;return s(t)?t:(t=_.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:g.STATIC_DRAW,indexDatatype:d.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferInstanced=t,t)}function k(e){var t=e.cache.billboardCollection_vertexBufferInstanced;return s(t)?t:(t=_.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:g.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_vertexBufferInstanced=t,t)}function z(e,t,i,r){var n=[{index:$.positionHighAndScale,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:i[te]},{index:$.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:i[te]},{index:$.compressedAttribute0,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:i[ie]},{index:$.compressedAttribute1,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:i[de]},{index:$.compressedAttribute2,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:i[le]},{index:$.eyeOffset,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:i[re]},{index:$.scaleByDistance,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:i[he]},{index:$.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:i[pe]},{index:$.distanceDisplayCondition,componentsPerAttribute:2,componentDatatype:o.FLOAT,usage:i[me]}];r&&n.push({index:$.direction,componentsPerAttribute:2,componentDatatype:o.FLOAT,vertexBuffer:k(e)});var a=r?t:4*t;return new E(e,n,a,r)}function U(e,i,r,n,o){var a,s=n[$.positionHighAndScale],l=n[$.positionLowAndRotation],u=o._getActualPosition();e._mode===I.SCENE3D&&(t.expand(e._baseVolume,u,e._baseVolume),e._boundingVolumeDirty=!0),h.fromCartesian(u,ye);var c=o.scale,d=o.rotation;0!==d&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,c);var p=ye.high,m=ye.low;e._instanced?(a=o._index,s(a,p.x,p.y,p.z,c),l(a,m.x,m.y,m.z,d)):(a=4*o._index,s(a+0,p.x,p.y,p.z,c),s(a+1,p.x,p.y,p.z,c),s(a+2,p.x,p.y,p.z,c),s(a+3,p.x,p.y,p.z,c),l(a+0,m.x,m.y,m.z,d),l(a+1,m.x,m.y,m.z,d),l(a+2,m.x,m.y,m.z,d),l(a+3,m.x,m.y,m.z,d))}function G(t,i,r,n,o){var a,s=n[$.compressedAttribute0],l=o.pixelOffset,u=l.x,c=l.y,h=o._translate,d=h.x,m=h.y;t._maxPixelOffset=Math.max(t._maxPixelOffset,Math.abs(u+d),Math.abs(-c+m));var f=o.horizontalOrigin,_=o._verticalOrigin,g=o.show&&o.clusterShow;0===o.color.alpha&&(g=!1),_===O.BASELINE&&(_=O.BOTTOM),t._allHorizontalCenter=t._allHorizontalCenter&&f===M.CENTER,t._allVerticalCenter=t._allVerticalCenter&&_===O.CENTER;var v=0,y=0,C=0,w=0,S=o._imageIndex;if(S!==-1){var E=r[S];v=E.x,y=E.y,C=E.width,w=E.height}var b=v+C,T=y+w,x=Math.floor(p.clamp(u,-we,we)+we)*be;x+=(f+1)*Te,x+=(_+1)*xe,x+=(g?1:0)*Ae;var A=Math.floor(p.clamp(c,-we,we)+we)*Ee,P=Math.floor(p.clamp(d,-we,we)+we)*Ee,D=(p.clamp(m,-we,we)+we)*Pe,I=Math.floor(D),R=Math.floor((D-I)*Ee);A+=I,P+=R,Ce.x=v,Ce.y=y;var N=e.compressTextureCoordinates(Ce);Ce.x=b;var L=e.compressTextureCoordinates(Ce);Ce.y=T;var B=e.compressTextureCoordinates(Ce);Ce.x=v;var F=e.compressTextureCoordinates(Ce);t._instanced?(a=o._index,s(a,x,A,P,N)):(a=4*o._index,s(a+0,x+De,A,P,N),s(a+1,x+Me,A,P,L),s(a+2,x+Ie,A,P,B),s(a+3,x+Re,A,P,F))}function W(t,i,n,o,l){var u,c=o[$.compressedAttribute1],h=l.alignedAxis;r.equals(h,r.ZERO)||(t._shaderAlignedAxis=!0);var d=0,m=1,f=1,_=1,g=l.translucencyByDistance;s(g)&&(d=g.near,m=g.nearValue,f=g.far,_=g.farValue,1===m&&1===_||(t._shaderTranslucencyByDistance=!0));var v=0,y=l._imageIndex;if(y!==-1){var C=n[y];v=C.width}var w=t._textureAtlas.texture.width,S=Math.round(a(l.width,w*v));t._maxSize=Math.max(t._maxSize,S);var E=p.clamp(S,0,Se),b=0;Math.abs(r.magnitudeSquared(h)-1)<p.EPSILON6&&(b=e.octEncodeFloat(h)),m=p.clamp(m,0,1),m=1===m?255:255*m|0,E=E*Ee+m,_=p.clamp(_,0,1),_=1===_?255:255*_|0,b=b*Ee+_,t._instanced?(u=l._index,c(u,E,b,d,f)):(u=4*l._index,c(u+0,E,b,d,f),c(u+1,E,b,d,f),c(u+2,E,b,d,f),c(u+3,E,b,d,f))}function H(e,t,i,o,s){var l,u=o[$.compressedAttribute2],c=s.color,h=s.getPickId(t).color,d=s.sizeInMeters?1:0,m=Math.abs(r.magnitudeSquared(s.alignedAxis)-1)<p.EPSILON6?1:0;e._allSizedInMeters=e._allSizedInMeters&&1===d;var f=0,_=s._imageIndex;if(_!==-1){var g=i[_];f=g.height}var v=e._textureAtlas.texture.dimensions,y=Math.round(a(s.height,v.y*f));e._maxSize=Math.max(e._maxSize,y);var C=n.floatToByte(c.red),w=n.floatToByte(c.green),S=n.floatToByte(c.blue),E=C*Se+w*Ee+S;C=n.floatToByte(h.red),w=n.floatToByte(h.green),S=n.floatToByte(h.blue);var b=C*Se+w*Ee+S,T=n.floatToByte(c.alpha)*Se+n.floatToByte(h.alpha)*Ee;T+=2*d+m,e._instanced?(l=s._index,u(l,E,b,T,y)):(l=4*s._index,u(l+0,E,b,T,y),u(l+1,E,b,T,y),u(l+2,E,b,T,y),u(l+3,E,b,T,y))}function q(t,i,r,n,o){var a,s=n[$.eyeOffset],l=o.eyeOffset,u=l.z;if(o._heightReference!==D.NONE&&(u*=1.005),t._maxEyeOffset=Math.max(t._maxEyeOffset,Math.abs(l.x),Math.abs(l.y),Math.abs(u)),t._instanced){var c=0,h=0,d=o._imageIndex;if(d!==-1){var p=r[d];c=p.width,h=p.height}Ce.x=c,Ce.y=h;var m=e.compressTextureCoordinates(Ce);a=o._index,s(a,l.x,l.y,u,m)}else a=4*o._index,s(a+0,l.x,l.y,u,0),s(a+1,l.x,l.y,u,0),s(a+2,l.x,l.y,u,0),s(a+3,l.x,l.y,u,0)}function j(e,t,i,r,n){var o,a=r[$.scaleByDistance],l=0,u=1,c=1,h=1,d=n.scaleByDistance;s(d)&&(l=d.near,u=d.nearValue,c=d.far,h=d.farValue,1===u&&1===h||(e._shaderScaleByDistance=!0)),e._instanced?(o=n._index,a(o,l,u,c,h)):(o=4*n._index,a(o+0,l,u,c,h),a(o+1,l,u,c,h),a(o+2,l,u,c,h),a(o+3,l,u,c,h))}function Y(e,t,i,r,n){var o,a=r[$.pixelOffsetScaleByDistance],l=0,u=1,c=1,h=1,d=n.pixelOffsetScaleByDistance;s(d)&&(l=d.near,u=d.nearValue,c=d.far,h=d.farValue,1===u&&1===h||(e._shaderPixelOffsetScaleByDistance=!0)),e._instanced?(o=n._index,a(o,l,u,c,h)):(o=4*n._index,a(o+0,l,u,c,h),a(o+1,l,u,c,h),a(o+2,l,u,c,h),a(o+3,l,u,c,h))}function X(e,t,i,r,n){var o,a=r[$.distanceDisplayCondition],l=0,u=Number.MAX_VALUE,c=n.distanceDisplayCondition;s(c)&&(l=c.near,u=c.far,e._shaderDistanceDisplayCondition=!0),e._instanced?(o=n._index,a(o,l,u)):(o=4*n._index,a(o+0,l,u),a(o+1,l,u),a(o+2,l,u),a(o+3,l,u))}function Z(e,t,i,r,n){U(e,t,i,r,n),G(e,t,i,r,n),W(e,t,i,r,n),H(e,t,i,r,n),q(e,t,i,r,n),j(e,t,i,r,n),Y(e,t,i,r,n),X(e,t,i,r,n)}function K(e,i,r,n,o,a){var l;n.mode===I.SCENE3D?(l=e._baseVolume,e._boundingVolumeDirty=!0):l=e._baseVolume2D;for(var u=[],c=0;c<r;++c){var h=i[c],d=h.position,p=x._computeActualPosition(h,d,n,o);s(p)&&(h._setActualPosition(p),a?u.push(p):t.expand(l,p,l))}a&&t.fromPoints(u,l)}function Q(e,t){var i=t.mode,r=e._billboards,n=e._billboardsToUpdate,o=e._modelMatrix;e._createVertexArray||e._mode!==i||i!==I.SCENE3D&&!m.equals(o,e.modelMatrix)?(e._mode=i,m.clone(e.modelMatrix,o),e._createVertexArray=!0,i!==I.SCENE3D&&i!==I.SCENE2D&&i!==I.COLUMBUS_VIEW||K(e,r,r.length,t,o,!0)):i===I.MORPHING?K(e,r,r.length,t,o,!0):i!==I.SCENE2D&&i!==I.COLUMBUS_VIEW||K(e,n,e._billboardsToUpdateIndex,t,o,!1)}function J(e,t,i){var r=1;e._allSizedInMeters&&0===e._maxPixelOffset||(r=t.camera.getPixelSize(i,t.context.drawingBufferWidth,t.context.drawingBufferHeight));var n=r*e._maxScale*e._maxSize*2;e._allHorizontalCenter&&e._allVerticalCenter&&(n*=.5);var o=r*e._maxPixelOffset+e._maxEyeOffset;i.radius+=n+o}var $,ee=x.SHOW_INDEX,te=x.POSITION_INDEX,ie=x.PIXEL_OFFSET_INDEX,re=x.EYE_OFFSET_INDEX,ne=x.HORIZONTAL_ORIGIN_INDEX,oe=x.VERTICAL_ORIGIN_INDEX,ae=x.SCALE_INDEX,se=x.IMAGE_INDEX_INDEX,le=x.COLOR_INDEX,ue=x.ROTATION_INDEX,ce=x.ALIGNED_AXIS_INDEX,he=x.SCALE_BY_DISTANCE_INDEX,de=x.TRANSLUCENCY_BY_DISTANCE_INDEX,pe=x.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,me=x.DISTANCE_DISPLAY_CONDITION_INDEX,fe=x.NUMBER_OF_PROPERTIES,_e={positionHighAndScale:0,positionLowAndRotation:1,compressedAttribute0:2,compressedAttribute1:3,compressedAttribute2:4,eyeOffset:5,scaleByDistance:6,pixelOffsetScaleByDistance:7,distanceDisplayCondition:8},ge={direction:0,positionHighAndScale:1,positionLowAndRotation:2,compressedAttribute0:3,compressedAttribute1:4,compressedAttribute2:5,eyeOffset:6,scaleByDistance:7,pixelOffsetScaleByDistance:8,distanceDisplayCondition:9};l(N.prototype,{length:{get:function(){return B(this),this._billboards.length}},textureAtlas:{get:function(){return this._textureAtlas},set:function(e){this._textureAtlas!==e&&(this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._textureAtlas=e,this._createVertexArray=!0)}},destroyTextureAtlas:{get:function(){return this._destroyTextureAtlas},set:function(e){this._destroyTextureAtlas=e}}}),N.prototype.add=function(e){var t=new x(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t},N.prototype.remove=function(e){return!!this.contains(e)&&(this._billboards[e._index]=null,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0)},N.prototype.removeAll=function(){L(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0},N.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]},N.prototype.contains=function(e){return s(e)&&e._billboardCollection===this},N.prototype.get=function(e){return B(this),this._billboards[e]};var ve;N.prototype.computeNewBuffersUsage=function(){for(var e=this._buffersUsage,t=!1,i=this._propertiesChanged,r=0;r<fe;++r){var n=0===i[r]?g.STATIC_DRAW:g.STREAM_DRAW;t=t||e[r]!==n,e[r]=n}return t};var ye=new h,Ce=new i,we=32768,Se=65536,Ee=256,be=128,Te=32,xe=8,Ae=4,Pe=1/256,De=0,Me=2,Ie=3,Re=1,Oe=[];return N.prototype.update=function(e){B(this);var i=this._billboards,r=i.length,n=e.context;this._instanced=n.instancedArrays,$=this._instanced?ge:_e,ve=this._instanced?V:F;var o=this._textureAtlas;if(!s(o)){o=this._textureAtlas=new R({context:n});for(var a=0;a<r;++a)i[a]._loadImage()}var l=o.textureCoordinates;if(0!==l.length){Q(this,e),i=this._billboards,r=i.length;var u=this._billboardsToUpdate,c=this._billboardsToUpdateIndex,h=this._propertiesChanged,d=o.guid,p=this._createVertexArray||this._textureAtlasGUID!==d;this._textureAtlasGUID=d;var _,g=e.passes,E=g.pick;if(p||!E&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(var x=0;x<fe;++x)h[x]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),r>0){this._vaf=z(n,r,this._buffersUsage,this._instanced),_=this._vaf.writers;for(var D=0;D<r;++D){var M=this._billboards[D];M._dirty=!1,Z(this,n,l,_,M)}this._vaf.commit(ve(n))}this._billboardsToUpdateIndex=0}else if(c>0){var O=Oe;O.length=0,(h[te]||h[ue]||h[ae])&&O.push(U),(h[se]||h[ie]||h[ne]||h[oe]||h[ee])&&(O.push(G),this._instanced&&O.push(q)),(h[se]||h[ce]||h[de])&&(O.push(W),O.push(H)),(h[se]||h[le])&&O.push(H),h[re]&&O.push(q),h[he]&&O.push(j),h[pe]&&O.push(Y),h[me]&&O.push(X);var N=O.length;if(_=this._vaf.writers,c/r>.1){for(var L=0;L<c;++L){var k=u[L];k._dirty=!1;for(var K=0;K<N;++K)O[K](this,n,l,_,k)}this._vaf.commit(ve(n))}else{for(var ye=0;ye<c;++ye){var Ce=u[ye];Ce._dirty=!1;for(var we=0;we<N;++we)O[we](this,n,l,_,Ce);this._instanced?this._vaf.subCommit(Ce._index,1):this._vaf.subCommit(4*Ce._index,4)}this._vaf.endSubCommits()}this._billboardsToUpdateIndex=0}if(c>1.5*r&&(u.length=r),s(this._vaf)&&s(this._vaf.va)){this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,t.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));var Se,Ee=m.IDENTITY;e.mode===I.SCENE3D?(Ee=this.modelMatrix,Se=t.clone(this._baseVolumeWC,this._boundingVolume)):Se=t.clone(this._baseVolume2D,this._boundingVolume),J(this,e,Se);var be=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,be&&(this._blendOption===P.OPAQUE||this._blendOption===P.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=C.fromCache({depthTest:{enabled:!0,func:f.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===P.TRANSLUCENT||this._blendOption===P.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=C.fromCache({depthTest:{enabled:!0,func:f.LEQUAL},depthMask:this._blendOption===P.TRANSLUCENT,blending:A.ALPHA_BLEND}):this._rsTranslucent=void 0),(be||this._shaderRotation!==this._compiledShaderRotation||this._shaderAlignedAxis!==this._compiledShaderAlignedAxis||this._shaderScaleByDistance!==this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance!==this._compiledShaderTranslucencyByDistance||this._shaderPixelOffsetScaleByDistance!==this._compiledShaderPixelOffsetScaleByDistance||this._shaderDistanceDisplayCondition!==this._compiledShaderDistanceDisplayCondition)&&(Pe=new S({sources:[T]}),this._instanced&&Pe.defines.push("INSTANCED"),this._shaderRotation&&Pe.defines.push("ROTATION"),this._shaderAlignedAxis&&Pe.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&Pe.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&Pe.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&Pe.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&Pe.defines.push("DISTANCE_DISPLAY_CONDITION"),this._blendOption===P.OPAQUE_AND_TRANSLUCENT&&(De=new S({defines:["OPAQUE"],sources:[b]}),this._sp=w.replaceCache({context:n,shaderProgram:this._sp,vertexShaderSource:Pe,fragmentShaderSource:De,attributeLocations:$}),De=new S({defines:["TRANSLUCENT"],sources:[b]}),this._spTranslucent=w.replaceCache({context:n,shaderProgram:this._spTranslucent,vertexShaderSource:Pe,fragmentShaderSource:De,attributeLocations:$})),this._blendOption===P.OPAQUE&&(De=new S({sources:[b]}),this._sp=w.replaceCache({context:n,shaderProgram:this._sp,vertexShaderSource:Pe,fragmentShaderSource:De,attributeLocations:$})),this._blendOption===P.TRANSLUCENT&&(De=new S({sources:[b]}),this._spTranslucent=w.replaceCache({context:n,shaderProgram:this._spTranslucent,vertexShaderSource:Pe,fragmentShaderSource:De,attributeLocations:$})),this._compiledShaderRotation=this._shaderRotation,this._compiledShaderAlignedAxis=this._shaderAlignedAxis,this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistance=this._shaderPixelOffsetScaleByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition),s(this._spPick)&&this._shaderRotation===this._compiledShaderRotationPick&&this._shaderAlignedAxis===this._compiledShaderAlignedAxisPick&&this._shaderScaleByDistance===this._compiledShaderScaleByDistancePick&&this._shaderTranslucencyByDistance===this._compiledShaderTranslucencyByDistancePick&&this._shaderPixelOffsetScaleByDistance===this._compiledShaderPixelOffsetScaleByDistancePick&&this._shaderDistanceDisplayCondition===this._compiledShaderDistanceDisplayConditionPick||(Pe=new S({defines:["RENDER_FOR_PICK"],sources:[T]}),this._instanced&&Pe.defines.push("INSTANCED"),this._shaderRotation&&Pe.defines.push("ROTATION"),this._shaderAlignedAxis&&Pe.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&Pe.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&Pe.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&Pe.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&Pe.defines.push("DISTANCE_DISPLAY_CONDITION"),De=new S({defines:["RENDER_FOR_PICK"],sources:[b]}),this._spPick=w.replaceCache({context:n,shaderProgram:this._spPick,vertexShaderSource:Pe,fragmentShaderSource:De,attributeLocations:$}),this._compiledShaderRotationPick=this._shaderRotation,this._compiledShaderAlignedAxisPick=this._shaderAlignedAxis,this._compiledShaderScaleByDistancePick=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistancePick=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistancePick=this._shaderPixelOffsetScaleByDistance,this._compiledShaderDistanceDisplayConditionPick=this._shaderDistanceDisplayCondition);var Te,xe,Ae,Pe,De,Me,Ie=e.commandList;if(g.render){var Re=this._colorCommands,Ne=this._blendOption===P.OPAQUE,Le=this._blendOption===P.OPAQUE_AND_TRANSLUCENT;Te=this._vaf.va,xe=Te.length,Re.length=xe;var Be=Le?2*xe:xe;for(Me=0;Me<Be;++Me){Ae=Re[Me],s(Ae)||(Ae=Re[Me]=new v);var Fe=Ne||Le&&Me%2===0;Ae.pass=Fe||!Le?y.OPAQUE:y.TRANSLUCENT,Ae.owner=this;var Ve=Le?Math.floor(Me/2):Me;Ae.boundingVolume=Se,Ae.modelMatrix=Ee,Ae.count=Te[Ve].indicesCount,Ae.shaderProgram=Fe?this._sp:this._spTranslucent,Ae.uniformMap=this._uniforms,Ae.vertexArray=Te[Ve].va,Ae.renderState=Fe?this._rsOpaque:this._rsTranslucent,Ae.debugShowBoundingVolume=this.debugShowBoundingVolume,this._instanced&&(Ae.count=6,Ae.instanceCount=r),Ie.push(Ae)}}if(E){var ke=this._pickCommands;for(Te=this._vaf.va,xe=Te.length,ke.length=xe,Me=0;Me<xe;++Me)Ae=ke[Me],s(Ae)||(Ae=ke[Me]=new v({pass:y.OPAQUE,owner:this})),Ae.boundingVolume=Se,Ae.modelMatrix=Ee,Ae.count=Te[Me].indicesCount,Ae.shaderProgram=this._spPick,Ae.uniformMap=this._uniforms,Ae.vertexArray=Te[Me].va,Ae.renderState=this._rsOpaque,this._instanced&&(Ae.count=6,Ae.instanceCount=r),Ie.push(Ae)}}}},N.prototype.isDestroyed=function(){return!1},N.prototype.destroy=function(){return s(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),L(this._billboards),u(this)},N}),i("Scene/LabelStyle",["../Core/freezeObject"],function(e){"use strict";var t={FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2};return e(t)}),i("Scene/Label",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/NearFarScalar","./Billboard","./HeightReference","./HorizontalOrigin","./LabelStyle","./VerticalOrigin"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m){"use strict";function f(e){e._rebindAllGlyphs||e._repositionAllGlyphs||e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function _(e){e._rebindAllGlyphs||e._repositionAllGlyphs||e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function g(e,o){e=n(e,n.EMPTY_OBJECT),this._text=n(e.text,""),this._show=n(e.show,!0),this._font=n(e.font,"30px sans-serif"),this._fillColor=r.clone(n(e.fillColor,r.WHITE)),this._outlineColor=r.clone(n(e.outlineColor,r.BLACK)),this._outlineWidth=n(e.outlineWidth,1),this._showBackground=n(e.showBackground,!1),this._backgroundColor=n(e.backgroundColor,new r(.165,.165,.165,.8)),this._backgroundPadding=n(e.backgroundPadding,new t(7,5)),this._style=n(e.style,p.FILL),this._verticalOrigin=n(e.verticalOrigin,m.BASELINE),this._horizontalOrigin=n(e.horizontalOrigin,d.LEFT),this._pixelOffset=t.clone(n(e.pixelOffset,t.ZERO)),this._eyeOffset=i.clone(n(e.eyeOffset,i.ZERO)),this._position=i.clone(n(e.position,i.ZERO)),this._scale=n(e.scale,1),this._id=e.id,this._translucencyByDistance=e.translucencyByDistance,this._pixelOffsetScaleByDistance=e.pixelOffsetScaleByDistance,this._heightReference=n(e.heightReference,h.NONE),this._distanceDisplayCondition=e.distanceDisplayCondition,this._labelCollection=o,this._glyphs=[],this._backgroundBillboard=void 0,this._rebindAllGlyphs=!0,this._repositionAllGlyphs=!0,this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=void 0,this._clusterShow=!0,this._updateClamping()}return a(g.prototype,{show:{get:function(){return this._show},set:function(e){if(this._show!==e){this._show=e;for(var t=this._glyphs,i=0,r=t.length;i<r;i++){var n=t[i].billboard;o(n)&&(n.show=e)}var a=this._backgroundBillboard;o(a)&&(a.show=e)}}},position:{get:function(){return this._position},set:function(e){var t=this._position;if(!i.equals(t,e)){i.clone(e,t); +for(var r=this._glyphs,n=0,a=r.length;n<a;n++){var s=r[n].billboard;o(s)&&(s.position=e)}var l=this._backgroundBillboard;o(l)&&(l.position=e),this._heightReference!==h.NONE&&this._updateClamping()}}},heightReference:{get:function(){return this._heightReference},set:function(e){if(e!==this._heightReference){this._heightReference=e;for(var t=this._glyphs,i=0,r=t.length;i<r;i++){var n=t[i].billboard;o(n)&&(n.heightReference=e)}var a=this._backgroundBillboard;o(a)&&(a.heightReference=e),_(this),this._updateClamping()}}},text:{get:function(){return this._text},set:function(e){this._text!==e&&(this._text=e,f(this))}},font:{get:function(){return this._font},set:function(e){this._font!==e&&(this._font=e,f(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){var t=this._fillColor;r.equals(t,e)||(r.clone(e,t),f(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){var t=this._outlineColor;r.equals(t,e)||(r.clone(e,t),f(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,f(this))}},showBackground:{get:function(){return this._showBackground},set:function(e){this._showBackground!==e&&(this._showBackground=e,f(this))}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){var t=this._backgroundColor;if(!r.equals(t,e)){r.clone(e,t);var i=this._backgroundBillboard;o(i)&&(i.color=t)}}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){var i=this._backgroundPadding;t.equals(i,e)||(t.clone(e,i),_(this))}},style:{get:function(){return this._style},set:function(e){this._style!==e&&(this._style=e,f(this))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){var i=this._pixelOffset;if(!t.equals(i,e)){t.clone(e,i);for(var r=this._glyphs,n=0,a=r.length;n<a;n++){var s=r[n];o(s.billboard)&&(s.billboard.pixelOffset=e)}var l=this._backgroundBillboard;o(l)&&(l.pixelOffset=e)}}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){var t=this._translucencyByDistance;if(!u.equals(t,e)){this._translucencyByDistance=u.clone(e,t);for(var i=this._glyphs,r=0,n=i.length;r<n;r++){var a=i[r];o(a.billboard)&&(a.billboard.translucencyByDistance=e)}var s=this._backgroundBillboard;o(s)&&(s.translucencyByDistance=e)}}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){var t=this._pixelOffsetScaleByDistance;if(!u.equals(t,e)){this._pixelOffsetScaleByDistance=u.clone(e,t);for(var i=this._glyphs,r=0,n=i.length;r<n;r++){var a=i[r];o(a.billboard)&&(a.billboard.pixelOffsetScaleByDistance=e)}var s=this._backgroundBillboard;o(s)&&(s.pixelOffsetScaleByDistance=e)}}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){var t=this._eyeOffset;if(!i.equals(t,e)){i.clone(e,t);for(var r=this._glyphs,n=0,a=r.length;n<a;n++){var s=r[n];o(s.billboard)&&(s.billboard.eyeOffset=e)}var l=this._backgroundBillboard;o(l)&&(l.eyeOffset=e)}}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,_(this))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){if(this._verticalOrigin!==e){this._verticalOrigin=e;for(var t=this._glyphs,i=0,r=t.length;i<r;i++){var n=t[i];o(n.billboard)&&(n.billboard.verticalOrigin=e)}var a=this._backgroundBillboard;o(a)&&(a.verticalOrigin=e),_(this)}}},scale:{get:function(){return this._scale},set:function(e){if(this._scale!==e){this._scale=e;for(var t=this._glyphs,i=0,r=t.length;i<r;i++){var n=t[i];o(n.billboard)&&(n.billboard.scale=e)}var a=this._backgroundBillboard;o(a)&&(a.scale=e),_(this)}}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(!l.equals(e,this._distanceDisplayCondition)){this._distanceDisplayCondition=l.clone(e,this._distanceDisplayCondition);for(var t=this._glyphs,i=0,r=t.length;i<r;i++){var n=t[i];o(n.billboard)&&(n.billboard.distanceDisplayCondition=e)}var a=this._backgroundBillboard;o(a)&&(a.distanceDisplayCondition=e)}}},id:{get:function(){return this._id},set:function(e){if(this._id!==e){this._id=e;for(var t=this._glyphs,i=0,r=t.length;i<r;i++){var n=t[i];o(n.billboard)&&(n.billboard.id=e)}var a=this._backgroundBillboard;o(a)&&(a.id=e)}}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=i.clone(e,this._actualClampedPosition);var t=this._glyphs;e=n(e,this._position);for(var r=0,a=t.length;r<a;r++){var s=t[r];o(s.billboard)&&(s.billboard._clampedPosition=e,i.clone(e,s.billboard._position),i.clone(e,s.billboard._actualPosition))}var l=this._backgroundBillboard;o(l)&&(l._clampedPosition=e,i.clone(e,l._position),i.clone(e,l._actualPosition))}},clusterShow:{get:function(){return this._clusterShow},set:function(e){if(this._clusterShow!==e){this._clusterShow=e;for(var t=this._glyphs,i=0,r=t.length;i<r;i++){var n=t[i];o(n.billboard)&&(n.billboard.clusterShow=e)}var a=this._backgroundBillboard;o(a)&&(a.clusterShow=e)}}}}),g.prototype._updateClamping=function(){c._updateClamping(this._labelCollection,this)},g.prototype.computeScreenSpacePosition=function(e,i){o(i)||(i=new t);var r=this._labelCollection,n=r.modelMatrix,a=o(this._actualClampedPosition)?this._actualClampedPosition:this._position,s=c._computeScreenSpacePosition(n,a,this._eyeOffset,this._pixelOffset,e,i);return s},g.getScreenSpaceBoundingBox=function(t,i,r){var n=0,a=0,s=0,l=0,u=t.scale,c=t._labelCollection._resolutionScale,h=t._backgroundBillboard;if(o(h))n=i.x+h._translate.x/c,a=i.y-h._translate.y/c,s=h.width*u,l=h.height*u,t.verticalOrigin===m.BOTTOM||t.verticalOrigin===m.BASELINE?a-=l:t.verticalOrigin===m.CENTER&&(a-=.5*l);else{n=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY;for(var d=0,p=0,f=t._glyphs,_=f.length,g=0;g<_;++g){var v=f[g],y=v.billboard;if(o(y)){var C=i.x+y._translate.x/c,w=i.y-y._translate.y/c,S=y.width*u,E=y.height*u;t.verticalOrigin===m.BOTTOM||t.verticalOrigin===m.BASELINE?w-=E:t.verticalOrigin===m.CENTER&&(w-=.5*E),n=Math.min(n,C),a=Math.min(a,w),d=Math.max(d,C+S),p=Math.max(p,w+E)}}s=d-n,l=p-a}return o(r)||(r=new e),r.x=n,r.y=a,r.width=s,r.height=l,r},g.prototype.equals=function(e){return this===e||o(e)&&this._show===e._show&&this._scale===e._scale&&this._outlineWidth===e._outlineWidth&&this._showBackground===e._showBackground&&this._style===e._style&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&this._text===e._text&&this._font===e._font&&i.equals(this._position,e._position)&&r.equals(this._fillColor,e._fillColor)&&r.equals(this._outlineColor,e._outlineColor)&&r.equals(this._backgroundColor,e._backgroundColor)&&t.equals(this._backgroundPadding,e._backgroundPadding)&&t.equals(this._pixelOffset,e._pixelOffset)&&i.equals(this._eyeOffset,e._eyeOffset)&&u.equals(this._translucencyByDistance,e._translucencyByDistance)&&u.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&l.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._id===e._id},g.prototype.isDestroyed=function(){return!1},g}),i("Scene/LabelCollection",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Matrix4","../Core/writeTextToCanvas","./BillboardCollection","./BlendOption","./HorizontalOrigin","./Label","./LabelStyle","./TextureAtlas","./VerticalOrigin"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_){"use strict";function g(){this.textureInfo=void 0,this.dimensions=void 0,this.billboard=void 0}function v(e,t,i){this.labelCollection=e,this.index=t,this.dimensions=i}function y(e,t){var i=document.createElement("canvas");i.width=M.x,i.height=M.y;var r=i.getContext("2d");r.fillStyle="#fff",r.fillRect(0,0,i.width,i.height),e.addImage(D,i).then(function(e){t._whitePixelIndex=e})}function C(e,t,i,r,n,o,a){return R.font=t,R.fillColor=i,R.strokeColor=r,R.strokeWidth=n,a===_.CENTER?R.textBaseline="middle":a===_.TOP?R.textBaseline="top":R.textBaseline="bottom",R.fill=o===m.FILL||o===m.FILL_AND_OUTLINE,R.stroke=o===m.OUTLINE||o===m.FILL_AND_OUTLINE,u(e,R)}function w(e,t){t.textureInfo=void 0,t.dimensions=void 0;var i=t.billboard;n(i)&&(i.show=!1,i.image=void 0,e._spareBillboards.push(i),t.billboard=void 0)}function S(e,t,i,r){e.addImage(t,i).then(function(e,t){r.index=e})}function E(e,t){var i,r,o,a=t._text,s=a.length,l=t._glyphs,u=l.length;if(s<u)for(r=s;r<u;++r)w(e,l[r]);l.length=s;var c=t._showBackground&&a.split("\n").join("").length>0,h=t._backgroundBillboard,p=e._backgroundBillboardCollection;c?(n(h)||(h=p.add({collection:e,image:D,imageSubRegion:I}),t._backgroundBillboard=h),h.color=t._backgroundColor,h.show=t._show,h.position=t._position,h.eyeOffset=t._eyeOffset,h.pixelOffset=t._pixelOffset,h.horizontalOrigin=d.LEFT,h.verticalOrigin=t._verticalOrigin,h.heightReference=t._heightReference,h.scale=t._scale,h.pickPrimitive=t,h.id=t._id,h.translucencyByDistance=t._translucencyByDistance,h.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,h.distanceDisplayCondition=t._distanceDisplayCondition):n(h)&&(p.remove(h),t._backgroundBillboard=h=void 0);var m=e._glyphTextureCache;for(o=0;o<s;++o){var f=a.charAt(o),_=t._font,y=t._fillColor,E=t._outlineColor,b=t._outlineWidth,T=t._style,x=t._verticalOrigin,A=JSON.stringify([f,_,y.toRgba(),E.toRgba(),b,+T,+x]),P=m[A];if(!n(P)){var M=C(f,_,y,E,b,T,x);P=new v(e,-1,M.dimensions),m[A]=P,M.width>0&&M.height>0&&S(e._textureAtlas,A,M,P)}if(i=l[o],n(i)?P.index===-1?w(e,i):n(i.textureInfo)&&(i.textureInfo=void 0):(i=new g,l[o]=i),i.textureInfo=P,i.dimensions=P.dimensions,P.index!==-1){var R=i.billboard,O=e._spareBillboards;n(R)||(R=O.length>0?O.pop():e._billboardCollection.add({collection:e}),i.billboard=R),R.show=t._show,R.position=t._position,R.eyeOffset=t._eyeOffset,R.pixelOffset=t._pixelOffset,R.horizontalOrigin=d.LEFT,R.verticalOrigin=t._verticalOrigin,R.heightReference=t._heightReference,R.scale=t._scale,R.pickPrimitive=t,R.id=t._id,R.image=A,R.translucencyByDistance=t._translucencyByDistance,R.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,R.distanceDisplayCondition=t._distanceDisplayCondition}}t._repositionAllGlyphs=!0}function b(e,t,i){return t===d.CENTER?-e/2:t===d.RIGHT?-(e+i.x):i.x}function T(e,i){var r,o,a=e._glyphs,s=e._text,l=0,u=0,c=[],h=Number.NEGATIVE_INFINITY,p=0,m=1,f=0,g=a.length,v=e._backgroundBillboard,y=N;for(t.clone(n(v)?e._backgroundPadding:t.ZERO,y),f=0;f<g;++f)"\n"===s.charAt(f)?(c.push(l),++m,l=0):(r=a[f],o=r.dimensions,p=Math.max(p,o.height-o.descent),h=Math.max(h,o.descent),l+=o.width-o.bounds.minx,f<g-1&&(l+=a[f+1].dimensions.bounds.minx),u=Math.max(u,l));c.push(l);var C=p+h,w=e._scale,S=e._horizontalOrigin,E=e._verticalOrigin,T=0,x=c[T],A=b(x,S,y),D=P*C,M=D*(m-1);O.x=A*w*i,O.y=0;var I=0;for(f=0;f<g;++f)if("\n"===s.charAt(f))++T,I+=D,x=c[T],A=b(x,S,y),O.x=A*w*i;else if(r=a[f],o=r.dimensions,E===_.TOP?O.y=o.height-p-y.y:E===_.CENTER?O.y=(M+o.height-p)/2:E===_.BASELINE?O.y=M:O.y=M+h+y.y,O.y=(O.y-o.descent-I)*w*i,n(r.billboard)&&r.billboard._setTranslate(O),f<g-1){var R=a[f+1];O.x+=(o.width-o.bounds.minx+R.dimensions.bounds.minx)*w*i}n(v)&&s.split("\n").join("").length>0&&(A=S===d.CENTER?-u/2-y.x:S===d.RIGHT?-(u+2*y.x):0,O.x=A*w*i,E===_.TOP?O.y=C-p-h:E===_.CENTER?O.y=(C-p)/2-h:E===_.BASELINE?O.y=-y.y-h:O.y=0,O.y=O.y*w*i,v.width=u+2*y.x,v.height=C+M+2*y.y,v._setTranslate(O))}function x(e,t){for(var i=t._glyphs,r=0,o=i.length;r<o;++r)w(e,i[r]);n(t._backgroundBillboard)&&(e._backgroundBillboardCollection.remove(t._backgroundBillboard),t._backgroundBillboard=void 0),t._labelCollection=void 0,n(t._removeCallbackFunc)&&t._removeCallbackFunc(),a(t)}function A(e){e=r(e,r.EMPTY_OBJECT),this._scene=e.scene,this._textureAtlas=void 0,this._backgroundTextureAtlas=void 0,this._whitePixelIndex=void 0,this._backgroundBillboardCollection=new c({scene:this._scene}),this._backgroundBillboardCollection.destroyTextureAtlas=!1,this._billboardCollection=new c({scene:this._scene}),this._billboardCollection.destroyTextureAtlas=!1,this._spareBillboards=[],this._glyphTextureCache={},this._labels=[],this._labelsToUpdate=[],this._totalGlyphCount=0,this._resolutionScale=void 0,this.modelMatrix=l.clone(r(e.modelMatrix,l.IDENTITY)),this.debugShowBoundingVolume=r(e.debugShowBoundingVolume,!1),this.blendOption=r(e.blendOption,h.OPAQUE_AND_TRANSLUCENT)}var P=1.2,D="ID_WHITE_PIXEL",M=new t(4,4),I=new e(1,1,1,1),R={},O=new t,N=new t;return o(A.prototype,{length:{get:function(){return this._labels.length}}}),A.prototype.add=function(e){var t=new p(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t},A.prototype.remove=function(e){if(n(e)&&e._labelCollection===this){var t=this._labels.indexOf(e);if(t!==-1)return this._labels.splice(t,1),x(this,e),!0}return!1},A.prototype.removeAll=function(){for(var e=this._labels,t=0,i=e.length;t<i;++t)x(this,e[t]);e.length=0},A.prototype.contains=function(e){return n(e)&&e._labelCollection===this},A.prototype.get=function(e){return this._labels[e]},A.prototype.update=function(e){var t=this._billboardCollection,i=this._backgroundBillboardCollection;t.modelMatrix=this.modelMatrix,t.debugShowBoundingVolume=this.debugShowBoundingVolume,i.modelMatrix=this.modelMatrix,i.debugShowBoundingVolume=this.debugShowBoundingVolume;var r=e.context;n(this._textureAtlas)||(this._textureAtlas=new f({context:r}),t.textureAtlas=this._textureAtlas),n(this._backgroundTextureAtlas)||(this._backgroundTextureAtlas=new f({context:r,initialSize:M}),i.textureAtlas=this._backgroundTextureAtlas,y(this._backgroundTextureAtlas,this));var o=r.uniformState,a=o.resolutionScale,s=this._resolutionScale!==a;this._resolutionScale=a;var l;l=s?this._labels:this._labelsToUpdate;for(var u=l.length,c=0;c<u;++c){var d=l[c];if(!d.isDestroyed()){var p=d._glyphs.length;d._rebindAllGlyphs&&(E(this,d),d._rebindAllGlyphs=!1),(s||d._repositionAllGlyphs)&&(T(d,a),d._repositionAllGlyphs=!1);var m=d._glyphs.length-p;this._totalGlyphCount+=m}}var _=i.length>0?h.TRANSLUCENT:this.blendOption;t.blendOption=_,i.blendOption=_,this._labelsToUpdate.length=0,i.update(e),t.update(e)},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){return this.removeAll(),this._billboardCollection=this._billboardCollection.destroy(),this._textureAtlas=this._textureAtlas&&this._textureAtlas.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),this._backgroundTextureAtlas=this._backgroundTextureAtlas&&this._backgroundTextureAtlas.destroy(),a(this)},A}),i("Scene/PointPrimitive",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/Matrix4","../Core/NearFarScalar","./SceneMode","./SceneTransforms"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p){"use strict";function m(e,t){e=o(e,o.EMPTY_OBJECT),this._show=o(e.show,!0),this._position=i.clone(o(e.position,i.ZERO)),this._actualPosition=i.clone(this._position),this._color=n.clone(o(e.color,n.WHITE)),this._outlineColor=n.clone(o(e.outlineColor,n.TRANSPARENT)),this._outlineWidth=o(e.outlineWidth,0),this._pixelSize=o(e.pixelSize,10),this._scaleByDistance=e.scaleByDistance,this._translucencyByDistance=e.translucencyByDistance,this._distanceDisplayCondition=e.distanceDisplayCondition,this._id=e.id,this._collection=o(e.collection,t),this._clusterShow=!0,this._pickId=void 0,this._pointPrimitiveCollection=t,this._dirty=!1,this._index=-1}function f(e,t){var i=e._pointPrimitiveCollection;a(i)&&(i._updatePointPrimitive(e,t),e._dirty=!0)}var _=m.SHOW_INDEX=0,g=m.POSITION_INDEX=1,v=m.COLOR_INDEX=2,y=m.OUTLINE_COLOR_INDEX=3,C=m.OUTLINE_WIDTH_INDEX=4,w=m.PIXEL_SIZE_INDEX=5,S=m.SCALE_BY_DISTANCE_INDEX=6,E=m.TRANSLUCENCY_BY_DISTANCE_INDEX=7,b=m.DISTANCE_DISPLAY_CONDITION=8;m.NUMBER_OF_PROPERTIES=9,s(m.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,f(this,_))}},position:{get:function(){return this._position},set:function(e){var t=this._position;i.equals(t,e)||(i.clone(e,t),i.clone(e,this._actualPosition),f(this,g))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){var t=this._scaleByDistance;h.equals(t,e)||(this._scaleByDistance=h.clone(e,t),f(this,S))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){var t=this._translucencyByDistance;h.equals(t,e)||(this._translucencyByDistance=h.clone(e,t),f(this,E))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){this._pixelSize!==e&&(this._pixelSize=e,f(this,w))}},color:{get:function(){return this._color},set:function(e){var t=this._color;n.equals(t,e)||(n.clone(e,t),f(this,v))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){var t=this._outlineColor;n.equals(t,e)||(n.clone(e,t),f(this,y))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,f(this,C))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){u.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=u.clone(e,this._distanceDisplayCondition),f(this,b))}},id:{get:function(){return this._id},set:function(e){this._id=e,a(this._pickId)&&(this._pickId.object.id=e)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,f(this,_))}}}),m.prototype.getPickId=function(e){return a(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId},m.prototype._getActualPosition=function(){return this._actualPosition},m.prototype._setActualPosition=function(e){i.clone(e,this._actualPosition),f(this,g)};var T=new r;m._computeActualPosition=function(e,t,i){return t.mode===d.SCENE3D?e:(c.multiplyByPoint(i,e,T),p.computeActualWgs84Position(t,T))};var x=new r;return m._computeScreenSpacePosition=function(e,t,i,n){var o=c.multiplyByVector(e,r.fromElements(t.x,t.y,t.z,1,x),x),a=p.wgs84ToWindowCoordinates(i,o,n);return a},m.prototype.computeScreenSpacePosition=function(e,i){var r=this._pointPrimitiveCollection;a(i)||(i=new t);var n=r.modelMatrix,o=m._computeScreenSpacePosition(n,this._actualPosition,e,i);if(a(o))return o.y=e.canvas.clientHeight-o.y,o},m.getScreenSpaceBoundingBox=function(t,i,r){var n=t.pixelSize,o=.5*n,s=i.x-o,l=i.y-o,u=n,c=n;return a(r)||(r=new e),r.x=s,r.y=l,r.width=u,r.height=c,r},m.prototype.equals=function(e){return this===e||a(e)&&this._id===e._id&&i.equals(this._position,e._position)&&n.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&n.equals(this._outlineColor,e._outlineColor)&&h.equals(this._scaleByDistance,e._scaleByDistance)&&h.equals(this._translucencyByDistance,e._translucencyByDistance)&&u.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)},m.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0},m}),i("Shaders/PointPrimitiveCollectionFS",[],function(){"use strict";return"varying vec4 v_color;\nvarying vec4 v_outlineColor;\nvarying float v_innerPercent;\nvarying float v_pixelDistance;\n#ifdef RENDER_FOR_PICK\nvarying vec4 v_pickColor;\n#endif\nvoid main()\n{\nfloat distanceToCenter = length(gl_PointCoord - vec2(0.5));\nfloat maxDistance = max(0.0, 0.5 - v_pixelDistance);\nfloat wholeAlpha = 1.0 - smoothstep(maxDistance, 0.5, distanceToCenter);\nfloat innerAlpha = 1.0 - smoothstep(maxDistance * v_innerPercent, 0.5 * v_innerPercent, distanceToCenter);\nvec4 color = mix(v_outlineColor, v_color, innerAlpha);\ncolor.a *= wholeAlpha;\n#if defined(RENDER_FOR_PICK) || (!defined(OPAQUE) && !defined(TRANSLUCENT))\nif (color.a < 0.005)\n{\ndiscard;\n}\n#else\n#ifdef OPAQUE\nif (color.a < 0.995)\n{\ndiscard;\n}\n#else\nif (color.a >= 0.995)\n{\ndiscard;\n}\n#endif\n#endif\n#ifdef RENDER_FOR_PICK\ngl_FragColor = v_pickColor;\n#else\ngl_FragColor = color;\n#endif\n}\n"}),i("Shaders/PointPrimitiveCollectionVS",[],function(){"use strict";return"uniform float u_maxTotalPointSize;\nattribute vec4 positionHighAndSize;\nattribute vec4 positionLowAndOutline;\nattribute vec4 compressedAttribute0;\nattribute vec4 compressedAttribute1;\nattribute vec4 scaleByDistance;\nattribute vec2 distanceDisplayCondition;\nvarying vec4 v_color;\nvarying vec4 v_outlineColor;\nvarying float v_innerPercent;\nvarying float v_pixelDistance;\n#ifdef RENDER_FOR_PICK\nvarying vec4 v_pickColor;\n#endif\nconst float SHIFT_LEFT8 = 256.0;\nconst float SHIFT_RIGHT8 = 1.0 / 256.0;\nvoid main()\n{\nvec3 positionHigh = positionHighAndSize.xyz;\nvec3 positionLow = positionLowAndOutline.xyz;\nfloat outlineWidthBothSides = 2.0 * positionLowAndOutline.w;\nfloat totalSize = positionHighAndSize.w + outlineWidthBothSides;\nfloat outlinePercent = outlineWidthBothSides / totalSize;\ntotalSize *= czm_resolutionScale;\ntotalSize += 3.0;\nfloat temp = compressedAttribute1.x * SHIFT_RIGHT8;\nfloat show = floor(temp);\n#ifdef EYE_DISTANCE_TRANSLUCENCY\nvec4 translucencyByDistance;\ntranslucencyByDistance.x = compressedAttribute1.z;\ntranslucencyByDistance.z = compressedAttribute1.w;\ntranslucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;\ntemp = compressedAttribute1.y * SHIFT_RIGHT8;\ntranslucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;\n#endif\nvec4 color;\nvec4 outlineColor;\n#ifdef RENDER_FOR_PICK\ncolor = vec4(0.0);\noutlineColor = vec4(0.0);\nvec4 pickColor;\ntemp = compressedAttribute0.z * SHIFT_RIGHT8;\npickColor.b = (temp - floor(temp)) * SHIFT_LEFT8;\ntemp = floor(temp) * SHIFT_RIGHT8;\npickColor.g = (temp - floor(temp)) * SHIFT_LEFT8;\npickColor.r = floor(temp);\n#else\ntemp = compressedAttribute0.x * SHIFT_RIGHT8;\ncolor.b = (temp - floor(temp)) * SHIFT_LEFT8;\ntemp = floor(temp) * SHIFT_RIGHT8;\ncolor.g = (temp - floor(temp)) * SHIFT_LEFT8;\ncolor.r = floor(temp);\ntemp = compressedAttribute0.y * SHIFT_RIGHT8;\noutlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8;\ntemp = floor(temp) * SHIFT_RIGHT8;\noutlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8;\noutlineColor.r = floor(temp);\n#endif\ntemp = compressedAttribute0.w * SHIFT_RIGHT8;\n#ifdef RENDER_FOR_PICK\npickColor.a = (temp - floor(temp)) * SHIFT_LEFT8;\npickColor = pickColor / 255.0;\n#endif\ntemp = floor(temp) * SHIFT_RIGHT8;\noutlineColor.a = (temp - floor(temp)) * SHIFT_LEFT8;\noutlineColor /= 255.0;\ncolor.a = floor(temp);\ncolor /= 255.0;\nvec4 p = czm_translateRelativeToEye(positionHigh, positionLow);\nvec4 positionEC = czm_modelViewRelativeToEye * p;\npositionEC.xyz *= show;\n#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(DISTANCE_DISPLAY_CONDITION)\nfloat lengthSq;\nif (czm_sceneMode == czm_sceneMode2D)\n{\nlengthSq = czm_eyeHeight2D.y;\n}\nelse\n{\nlengthSq = dot(positionEC.xyz, positionEC.xyz);\n}\n#endif\n#ifdef EYE_DISTANCE_SCALING\ntotalSize *= czm_nearFarScalar(scaleByDistance, lengthSq);\n#endif\ntotalSize = min(totalSize, u_maxTotalPointSize);\nif (totalSize < 1.0)\n{\npositionEC.xyz = vec3(0.0);\ntotalSize = 1.0;\n}\nfloat translucency = 1.0;\n#ifdef EYE_DISTANCE_TRANSLUCENCY\ntranslucency = czm_nearFarScalar(translucencyByDistance, lengthSq);\nif (translucency < 0.004)\n{\npositionEC.xyz = vec3(0.0);\n}\n#endif\n#ifdef DISTANCE_DISPLAY_CONDITION\nfloat nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x;\nfloat farSq = distanceDisplayCondition.y * distanceDisplayCondition.y;\nif (lengthSq < nearSq || lengthSq > farSq) {\npositionEC.xyz = vec3(0.0);\n}\n#endif\nvec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\ngl_Position = czm_viewportOrthographic * vec4(positionWC.xy, -positionWC.z, 1.0);\nv_color = color;\nv_color.a *= translucency;\nv_outlineColor = outlineColor;\nv_outlineColor.a *= translucency;\nv_innerPercent = 1.0 - outlinePercent;\nv_pixelDistance = 2.0 / totalSize;\ngl_PointSize = totalSize;\n#ifdef RENDER_FOR_PICK\nv_pickColor = pickColor;\n#endif\n}\n"}),i("Scene/PointPrimitiveCollection",["../Core/BoundingSphere","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EncodedCartesian3","../Core/Math","../Core/Matrix4","../Core/PrimitiveType","../Core/WebGLConstants","../Renderer/BufferUsage","../Renderer/ContextLimits","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArrayFacade","../Shaders/PointPrimitiveCollectionFS","../Shaders/PointPrimitiveCollectionVS","./BlendingState","./BlendOption","./PointPrimitive","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x){"use strict";function A(t){t=r(t,r.EMPTY_OBJECT),this._sp=void 0,this._spTranslucent=void 0,this._spPick=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._compiledShaderScaleByDistancePick=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistancePick=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayConditionPick=!1,this._propertiesChanged=new Uint32Array(Z),this._maxPixelSize=1,this._baseVolume=new e,this._baseVolumeWC=new e,this._baseVolume2D=new e,this._boundingVolume=new e,this._boundingVolumeDirty=!1,this._colorCommands=[],this._pickCommands=[],this.modelMatrix=c.clone(r(t.modelMatrix,c.IDENTITY)),this._modelMatrix=c.clone(c.IDENTITY),this.debugShowBoundingVolume=r(t.debugShowBoundingVolume,!1),this.blendOption=r(t.blendOption,b.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=x.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW];var i=this;this._uniforms={u_maxTotalPointSize:function(){return i._maxTotalPointSize}}}function P(e){for(var t=e.length,i=0;i<t;++i)e[i]&&e[i]._destroy()}function D(e){if(e._pointPrimitivesRemoved){e._pointPrimitivesRemoved=!1;for(var t=[],i=e._pointPrimitives,r=i.length,n=0,o=0;n<r;++n){var a=i[n];a&&(a._index=o++,t.push(a))}e._pointPrimitives=t}}function M(e,t,r){return new C(e,[{index:K.positionHighAndSize,componentsPerAttribute:4,componentDatatype:i.FLOAT,usage:r[U]},{index:K.positionLowAndShow,componentsPerAttribute:4,componentDatatype:i.FLOAT,usage:r[U]},{index:K.compressedAttribute0,componentsPerAttribute:4,componentDatatype:i.FLOAT,usage:r[G]},{index:K.compressedAttribute1,componentsPerAttribute:4,componentDatatype:i.FLOAT,usage:r[Y]},{index:K.scaleByDistance,componentsPerAttribute:4,componentDatatype:i.FLOAT,usage:r[j]},{index:K.distanceDisplayCondition,componentsPerAttribute:2,componentDatatype:i.FLOAT,usage:r[X]}],t)}function I(t,i,r,n){var o=n._index,a=n._getActualPosition();t._mode===x.SCENE3D&&(e.expand(t._baseVolume,a,t._baseVolume),t._boundingVolumeDirty=!0),l.fromCartesian(a,Q);var s=n.pixelSize,u=n.outlineWidth;t._maxPixelSize=Math.max(t._maxPixelSize,s+u);var c=r[K.positionHighAndSize],h=Q.high;c(o,h.x,h.y,h.z,s);var d=r[K.positionLowAndOutline],p=Q.low;d(o,p.x,p.y,p.z,u)}function R(e,i,r,n){var o=n._index,a=n.color,s=n.getPickId(i).color,l=n.outlineColor,u=t.floatToByte(a.red),c=t.floatToByte(a.green),h=t.floatToByte(a.blue),d=u*J+c*$+h;u=t.floatToByte(l.red),c=t.floatToByte(l.green),h=t.floatToByte(l.blue);var p=u*J+c*$+h;u=t.floatToByte(s.red),c=t.floatToByte(s.green),h=t.floatToByte(s.blue);var m=u*J+c*$+h,f=t.floatToByte(a.alpha)*J+t.floatToByte(l.alpha)*$+t.floatToByte(s.alpha),_=r[K.compressedAttribute0];_(o,d,p,m,f)}function O(e,t,i,r){var o=r._index,a=0,s=1,l=1,c=1,h=r.translucencyByDistance;n(h)&&(a=h.near,s=h.nearValue,l=h.far,c=h.farValue,1===s&&1===c||(e._shaderTranslucencyByDistance=!0));var d=r.show&&r.clusterShow;0===r.color.alpha&&0===r.outlineColor.alpha&&(d=!1),s=u.clamp(s,0,1),s=1===s?255:255*s|0;var p=(d?1:0)*$+s;c=u.clamp(c,0,1),c=1===c?255:255*c|0;var m=c,f=i[K.compressedAttribute1];f(o,p,m,a,l)}function N(e,t,i,r){var o=r._index,a=i[K.scaleByDistance],s=0,l=1,u=1,c=1,h=r.scaleByDistance;n(h)&&(s=h.near,l=h.nearValue,u=h.far,c=h.farValue,1===l&&1===c||(e._shaderScaleByDistance=!0)),a(o,s,l,u,c)}function L(e,t,i,r){var o=r._index,a=i[K.distanceDisplayCondition],s=0,l=Number.MAX_VALUE,u=r.distanceDisplayCondition;n(u)&&(s=u.near,l=u.far,e._shaderDistanceDisplayCondition=!0),a(o,s,l)}function B(e,t,i,r){I(e,t,i,r),R(e,t,i,r),O(e,t,i,r),N(e,t,i,r),L(e,t,i,r)}function F(t,i,r,o,a,s){var l;o.mode===x.SCENE3D?(l=t._baseVolume,t._boundingVolumeDirty=!0):l=t._baseVolume2D;for(var u=[],c=0;c<r;++c){var h=i[c],d=h.position,p=T._computeActualPosition(d,o,a);n(p)&&(h._setActualPosition(p),s?u.push(p):e.expand(l,p,l))}s&&e.fromPoints(u,l)}function V(e,t){var i=t.mode,r=e._pointPrimitives,n=e._pointPrimitivesToUpdate,o=e._modelMatrix;e._createVertexArray||e._mode!==i||i!==x.SCENE3D&&!c.equals(o,e.modelMatrix)?(e._mode=i,c.clone(e.modelMatrix,o),e._createVertexArray=!0,i!==x.SCENE3D&&i!==x.SCENE2D&&i!==x.COLUMBUS_VIEW||F(e,r,r.length,t,o,!0)):i===x.MORPHING?F(e,r,r.length,t,o,!0):i!==x.SCENE2D&&i!==x.COLUMBUS_VIEW||F(e,n,e._pointPrimitivesToUpdateIndex,t,o,!1)}function k(e,t,i){var r=t.camera.getPixelSize(i,t.context.drawingBufferWidth,t.context.drawingBufferHeight),n=r*e._maxPixelSize;i.radius+=n}var z=T.SHOW_INDEX,U=T.POSITION_INDEX,G=T.COLOR_INDEX,W=T.OUTLINE_COLOR_INDEX,H=T.OUTLINE_WIDTH_INDEX,q=T.PIXEL_SIZE_INDEX,j=T.SCALE_BY_DISTANCE_INDEX,Y=T.TRANSLUCENCY_BY_DISTANCE_INDEX,X=T.DISTANCE_DISPLAY_CONDITION_INDEX,Z=T.NUMBER_OF_PROPERTIES,K={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayCondition:5};o(A.prototype,{length:{get:function(){return D(this),this._pointPrimitives.length}}}),A.prototype.add=function(e){var t=new T(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t},A.prototype.remove=function(e){return!!this.contains(e)&&(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0)},A.prototype.removeAll=function(){P(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0},A.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]},A.prototype.contains=function(e){return n(e)&&e._pointPrimitiveCollection===this},A.prototype.get=function(e){return D(this),this._pointPrimitives[e]},A.prototype.computeNewBuffersUsage=function(){for(var e=this._buffersUsage,t=!1,i=this._propertiesChanged,r=0;r<Z;++r){var n=0===i[r]?p.STATIC_DRAW:p.STREAM_DRAW;t=t||e[r]!==n,e[r]=n}return t};var Q=new l,J=65536,$=256,ee=[];return A.prototype.update=function(t){D(this),this._maxTotalPointSize=m.maximumAliasedPointSize,V(this,t);var i,r=this._pointPrimitives,o=r.length,a=this._pointPrimitivesToUpdate,s=this._pointPrimitivesToUpdateIndex,l=this._propertiesChanged,u=this._createVertexArray,p=t.context,C=t.passes,T=C.pick;if(u||!T&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(var A=0;A<Z;++A)l[A]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),o>0){this._vaf=M(p,o,this._buffersUsage),i=this._vaf.writers;for(var P=0;P<o;++P){var F=this._pointPrimitives[P];F._dirty=!1, +B(this,p,i,F)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(s>0){var Q=ee;Q.length=0,(l[U]||l[H]||l[q])&&Q.push(I),(l[G]||l[W])&&Q.push(R),(l[z]||l[Y])&&Q.push(O),l[j]&&Q.push(N),l[X]&&Q.push(L);var J=Q.length;if(i=this._vaf.writers,s/o>.1){for(var $=0;$<s;++$){var te=a[$];te._dirty=!1;for(var ie=0;ie<J;++ie)Q[ie](this,p,i,te)}this._vaf.commit()}else{for(var re=0;re<s;++re){var ne=a[re];ne._dirty=!1;for(var oe=0;oe<J;++oe)Q[oe](this,p,i,ne);this._vaf.subCommit(ne._index,1)}this._vaf.endSubCommits()}this._pointPrimitivesToUpdateIndex=0}if(s>1.5*o&&(a.length=o),n(this._vaf)&&n(this._vaf.va)){this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,e.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));var ae,se=c.IDENTITY;t.mode===x.SCENE3D?(se=this.modelMatrix,ae=e.clone(this._baseVolumeWC,this._boundingVolume)):ae=e.clone(this._baseVolume2D,this._boundingVolume),k(this,t,ae);var le=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,le&&(this._blendOption===b.OPAQUE||this._blendOption===b.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=g.fromCache({depthTest:{enabled:!0,func:d.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===b.TRANSLUCENT||this._blendOption===b.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=g.fromCache({depthTest:{enabled:!0,func:d.LEQUAL},depthMask:!1,blending:E.ALPHA_BLEND}):this._rsTranslucent=void 0),(le||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition)&&(pe=new y({sources:[S]}),this._shaderScaleByDistance&&pe.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&pe.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&pe.defines.push("DISTANCE_DISPLAY_CONDITION"),this._blendOption===b.OPAQUE_AND_TRANSLUCENT&&(me=new y({defines:["OPAQUE"],sources:[w]}),this._sp=v.replaceCache({context:p,shaderProgram:this._sp,vertexShaderSource:pe,fragmentShaderSource:me,attributeLocations:K}),me=new y({defines:["TRANSLUCENT"],sources:[w]}),this._spTranslucent=v.replaceCache({context:p,shaderProgram:this._spTranslucent,vertexShaderSource:pe,fragmentShaderSource:me,attributeLocations:K})),this._blendOption===b.OPAQUE&&(me=new y({sources:[w]}),this._sp=v.replaceCache({context:p,shaderProgram:this._sp,vertexShaderSource:pe,fragmentShaderSource:me,attributeLocations:K})),this._blendOption===b.TRANSLUCENT&&(me=new y({sources:[w]}),this._spTranslucent=v.replaceCache({context:p,shaderProgram:this._spTranslucent,vertexShaderSource:pe,fragmentShaderSource:me,attributeLocations:K})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition),(!n(this._spPick)||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistancePick||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistancePick||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayConditionPick)&&(pe=new y({defines:["RENDER_FOR_PICK"],sources:[S]}),this._shaderScaleByDistance&&pe.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&pe.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&pe.defines.push("DISTANCE_DISPLAY_CONDITION"),me=new y({defines:["RENDER_FOR_PICK"],sources:[w]}),this._spPick=v.replaceCache({context:p,shaderProgram:this._spPick,vertexShaderSource:pe,fragmentShaderSource:me,attributeLocations:K}),this._compiledShaderScaleByDistancePick=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistancePick=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayConditionPick=this._shaderDistanceDisplayCondition);var ue,ce,he,de,pe,me,fe=t.commandList;if(C.render){var _e=this._colorCommands,ge=this._blendOption===b.OPAQUE,ve=this._blendOption===b.OPAQUE_AND_TRANSLUCENT;ue=this._vaf.va,ce=ue.length,_e.length=ce;var ye=ve?2*ce:ce;for(de=0;de<ye;++de){var Ce=ge||ve&&de%2===0;he=_e[de],n(he)||(he=_e[de]=new f),he.primitiveType=h.POINTS,he.pass=Ce||!ve?_.OPAQUE:_.TRANSLUCENT,he.owner=this;var we=ve?Math.floor(de/2):de;he.boundingVolume=ae,he.modelMatrix=se,he.shaderProgram=Ce?this._sp:this._spTranslucent,he.uniformMap=this._uniforms,he.vertexArray=ue[we].va,he.renderState=Ce?this._rsOpaque:this._rsTranslucent,he.debugShowBoundingVolume=this.debugShowBoundingVolume,fe.push(he)}}if(T){var Se=this._pickCommands;for(ue=this._vaf.va,ce=ue.length,Se.length=ce,de=0;de<ce;++de)he=Se[de],n(he)||(he=Se[de]=new f({primitiveType:h.POINTS,pass:_.OPAQUE,owner:this})),he.boundingVolume=ae,he.modelMatrix=se,he.shaderProgram=this._spPick,he.uniformMap=this._uniforms,he.vertexArray=ue[de].va,he.renderState=this._rsOpaque,fe.push(he)}}},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),P(this._pointPrimitives),a(this)},A}),i("ThirdParty/kdbush",[],function(){"use strict";function e(e,i,r,n,o){return new t(e,i,r,n,o)}function t(e,t,n,a,s){t=t||i,n=n||r,s=s||Array,this.nodeSize=a||64,this.points=e,this.ids=new s(e.length),this.coords=new s(2*e.length);for(var l=0;l<e.length;l++)this.ids[l]=l,this.coords[2*l]=t(e[l]),this.coords[2*l+1]=n(e[l]);o(this.ids,this.coords,this.nodeSize,0,this.ids.length-1,0)}function i(e){return e[0]}function r(e){return e[1]}function n(e,t,i,r,n,o,a){for(var s,l,u=[0,e.length-1,0],c=[];u.length;){var h=u.pop(),d=u.pop(),p=u.pop();if(d-p<=a)for(var m=p;m<=d;m++)s=t[2*m],l=t[2*m+1],s>=i&&s<=n&&l>=r&&l<=o&&c.push(e[m]);else{var f=Math.floor((p+d)/2);s=t[2*f],l=t[2*f+1],s>=i&&s<=n&&l>=r&&l<=o&&c.push(e[f]);var _=(h+1)%2;(0===h?i<=s:r<=l)&&(u.push(p),u.push(f-1),u.push(_)),(0===h?n>=s:o>=l)&&(u.push(f+1),u.push(d),u.push(_))}}return c}function o(e,t,i,r,n,s){if(!(n-r<=i)){var l=Math.floor((r+n)/2);a(e,t,l,r,n,s%2),o(e,t,i,r,l-1,s+1),o(e,t,i,l+1,n,s+1)}}function a(e,t,i,r,n,o){for(;n>r;){if(n-r>600){var l=n-r+1,u=i-r+1,c=Math.log(l),h=.5*Math.exp(2*c/3),d=.5*Math.sqrt(c*h*(l-h)/l)*(u-l/2<0?-1:1),p=Math.max(r,Math.floor(i-u*h/l+d)),m=Math.min(n,Math.floor(i+(l-u)*h/l+d));a(e,t,i,p,m,o)}var f=t[2*i+o],_=r,g=n;for(s(e,t,r,i),t[2*n+o]>f&&s(e,t,r,n);_<g;){for(s(e,t,_,g),_++,g--;t[2*_+o]<f;)_++;for(;t[2*g+o]>f;)g--}t[2*r+o]===f?s(e,t,r,g):(g++,s(e,t,g,n)),g<=i&&(r=g+1),i<=g&&(n=g-1)}}function s(e,t,i,r){l(e,i,r),l(t,2*i,2*r),l(t,2*i+1,2*r+1)}function l(e,t,i){var r=e[t];e[t]=e[i],e[i]=r}function u(e,t,i,r,n,o){for(var a=[0,e.length-1,0],s=[],l=n*n;a.length;){var u=a.pop(),h=a.pop(),d=a.pop();if(h-d<=o)for(var p=d;p<=h;p++)c(t[2*p],t[2*p+1],i,r)<=l&&s.push(e[p]);else{var m=Math.floor((d+h)/2),f=t[2*m],_=t[2*m+1];c(f,_,i,r)<=l&&s.push(e[m]);var g=(u+1)%2;(0===u?i-n<=f:r-n<=_)&&(a.push(d),a.push(m-1),a.push(g)),(0===u?i+n>=f:r+n>=_)&&(a.push(m+1),a.push(h),a.push(g))}}return s}function c(e,t,i,r){var n=e-i,o=t-r;return n*n+o*o}return t.prototype={range:function(e,t,i,r){return n(this.ids,this.coords,e,t,i,r,this.nodeSize)},within:function(e,t,i){return u(this.ids,this.coords,e,t,i,this.nodeSize)}},e}),i("DataSources/EntityCluster",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/EllipsoidalOccluder","../Core/Event","../Core/Matrix4","../Scene/Billboard","../Scene/BillboardCollection","../Scene/Label","../Scene/LabelCollection","../Scene/PointPrimitive","../Scene/PointPrimitiveCollection","../ThirdParty/kdbush"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f){"use strict";function _(e){e=r(e,r.EMPTY_OBJECT),this._enabled=r(e.enabled,!1),this._pixelRange=r(e.pixelRange,80),this._minimumClusterSize=r(e.minimumClusterSize,2),this._clusterBillboards=r(e.clusterBillboards,!0),this._clusterLabels=r(e.clusterLabels,!0),this._clusterPoints=r(e.clusterPoints,!0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity={},this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._clusterDirty=!1,this._cluster=void 0,this._removeEventListener=void 0,this._clusterEvent=new s}function g(e){return e.coord.x}function v(e){return e.coord.y}function y(e,t){e.x-=t,e.y-=t,e.width+=2*t,e.height+=2*t}function C(t,i,r,o,a){if(n(t._labelCollection)&&o._clusterLabels?a=h.getScreenSpaceBoundingBox(t,i,a):n(t._billboardCollection)&&o._clusterBillboards?a=u.getScreenSpaceBoundingBox(t,i,a):n(t._pointPrimitiveCollection)&&o._clusterPoints&&(a=p.getScreenSpaceBoundingBox(t,i,a)),y(a,r),o._clusterLabels&&!n(t._labelCollection)&&n(t.id)&&E(o,t.id)&&n(t.id._label)){var s=o._collectionIndicesByEntity[t.id],l=o._labelCollection.get(s),c=h.getScreenSpaceBoundingBox(l,i,M);y(c,r),a=e.union(a,c,a)}return a}function w(e,t){if(e.clusterShow=!0,!n(e._labelCollection)&&n(e.id)&&E(t,e.id)&&n(e.id._label)){var i=t._collectionIndicesByEntity[e.id],r=t._labelCollection.get(i);r.clusterShow=!0}}function S(e,t,i,r){var n={billboard:r._clusterBillboardCollection.add(),label:r._clusterLabelCollection.add(),point:r._clusterPointCollection.add()};n.billboard.show=!1,n.point.show=!1,n.label.show=!0,n.label.text=t.toLocaleString(),n.billboard.position=n.label.position=n.point.position=e,r._clusterEvent.raiseEvent(i,n)}function E(e,t){return n(e)&&n(e._collectionIndicesByEntity[t])&&n(e._collectionIndicesByEntity[t].labelIndex)}function b(e,t,i,r,o){if(n(e))for(var a=e.length,s=0;s<a;++s){var l=e.get(s);if(l.clusterShow=!1,l.show&&r.isPointVisible(l.position)){var u=o._clusterLabels&&n(l._labelCollection),c=o._clusterBillboards&&n(l.id._billboard),h=o._clusterPoints&&n(l.id._point);if(!u||!h&&!c){var d=l.computeScreenSpacePosition(i);n(d)&&t.push({index:s,collection:e,clustered:!1,coord:d})}}}}function T(r){return function(o){if(!(n(o)&&o<.05)&&r.enabled){var s=r._scene,h=r._labelCollection,p=r._billboardCollection,_=r._pointCollection;if((n(h)||n(p)||n(_))&&(r._clusterBillboards||r._clusterLabels||r._clusterPoints)){var y=r._clusterLabelCollection,E=r._clusterBillboardCollection,T=r._clusterPointCollection;n(y)?y.removeAll():y=r._clusterLabelCollection=new d({scene:s}),n(E)?E.removeAll():E=r._clusterBillboardCollection=new c({scene:s}),n(T)?T.removeAll():T=r._clusterPointCollection=new m;var x=r._pixelRange,A=r._minimumClusterSize,P=r._previousClusters,D=[],M=r._previousHeight,N=s.camera.positionCartographic.height,L=s.mapProjection.ellipsoid,B=s.camera.positionWC,F=new a(L,B),V=[];r._clusterLabels&&b(h,V,s,F,r),r._clusterBillboards&&b(p,V,s,F,r),r._clusterPoints&&b(_,V,s,F,r);var k,z,U,G,W,H,q,j,Y,X,Z,K,Q=f(V,g,v,64,Int32Array);if(N<M)for(U=P.length,k=0;k<U;++k){var J=P[k];if(F.isPointVisible(J.position)){var $=u._computeScreenSpacePosition(l.IDENTITY,J.position,i.ZERO,t.ZERO,s);if(n($)){var ee=1-N/M,te=J.width=J.width*ee,ie=J.height=J.height*ee;te=Math.max(te,J.minimumWidth),ie=Math.max(ie,J.minimumHeight);var re=$.x-.5*te,ne=$.y-.5*ie,oe=$.x+te,ae=$.y+ie;for(W=Q.range(re,ne,oe,ae),H=W.length,X=0,Y=[],z=0;z<H;++z)q=W[z],j=V[q],j.clustered||(++X,Z=j.collection,K=j.index,Y.push(Z.get(K).id));if(X>=A)for(S(J.position,X,Y,r),D.push(J),z=0;z<H;++z)V[W[z]].clustered=!0}}}for(U=V.length,k=0;k<U;++k){var se=V[k];if(!se.clustered){se.clustered=!0,Z=se.collection,K=se.index;var le=Z.get(K);G=C(le,se.coord,x,r,I);var ue=e.clone(G,R);W=Q.range(G.x,G.y,G.x+G.width,G.y+G.height),H=W.length;var ce=i.clone(le.position);for(X=1,Y=[le.id],z=0;z<H;++z)if(q=W[z],j=V[q],!j.clustered){var he=j.collection.get(j.index),de=C(he,j.coord,x,r,O);i.add(he.position,ce,ce),e.union(ue,de,ue),++X,Y.push(he.id)}if(X>=A){var pe=i.multiplyByScalar(ce,1/X,ce);for(S(pe,X,Y,r),D.push({position:pe,width:ue.width,height:ue.height,minimumWidth:G.width,minimumHeight:G.height}),z=0;z<H;++z)V[W[z]].clustered=!0}else w(le,r)}}0===y.length&&(y.destroy(),r._clusterLabelCollection=void 0),0===E.length&&(E.destroy(),r._clusterBillboardCollection=void 0),0===T.length&&(T.destroy(),r._clusterPointCollection=void 0),r._previousClusters=D,r._previousHeight=N}}}}function x(e,t,i,r){return function(o){var a=this[e];n(this._collectionIndicesByEntity)||(this._collectionIndicesByEntity={});var s=this._collectionIndicesByEntity[o.id];if(n(s)||(s=this._collectionIndicesByEntity[o.id]={billboardIndex:void 0,labelIndex:void 0,pointIndex:void 0}),n(a)&&n(s[r]))return a.get(s[r]);n(a)||(a=this[e]=new t({scene:this._scene}));var l,u,c=this[i];return c.length>0?(l=c.pop(),u=a.get(l)):(u=a.add(),l=a.length-1),s[r]=l,this._clusterDirty=!0,u}}function A(e,t){var i=e._collectionIndicesByEntity[t];n(i.billboardIndex)||n(i.labelIndex)||n(i.pointIndex)||delete e._collectionIndicesByEntity[t]}function P(e){if(n(e))for(var t=e.length,i=0;i<t;++i)e.get(i).clusterShow=!0}function D(e){e.enabled||(n(e._clusterLabelCollection)&&e._clusterLabelCollection.destroy(),n(e._clusterBillboardCollection)&&e._clusterBillboardCollection.destroy(),n(e._clusterPointCollection)&&e._clusterPointCollection.destroy(),e._clusterLabelCollection=void 0,e._clusterBillboardCollection=void 0,e._clusterPointCollection=void 0,P(e._labelCollection),P(e._billboardCollection),P(e._pointCollection))}var M=new e,I=new e,R=new e,O=new e;return _.prototype._initialize=function(e){this._scene=e;var t=T(this);this._cluster=t,this._removeEventListener=e.camera.changed.addEventListener(t)},o(_.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabledDirty=e!==this._enabled,this._enabled=e}},pixelRange:{get:function(){return this._pixelRange},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._pixelRange,this._pixelRange=e}},minimumClusterSize:{get:function(){return this._minimumClusterSize},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._minimumClusterSize,this._minimumClusterSize=e}},clusterEvent:{get:function(){return this._clusterEvent}},clusterBillboards:{get:function(){return this._clusterBillboards},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterBillboards,this._clusterBillboards=e}},clusterLabels:{get:function(){return this._clusterLabels},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterLabels,this._clusterLabels=e}},clusterPoints:{get:function(){return this._clusterPoints},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterPoints,this._clusterPoints=e}}}),_.prototype.getLabel=x("_labelCollection",d,"_unusedLabelIndices","labelIndex"),_.prototype.removeLabel=function(e){var t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(n(this._labelCollection)&&n(t)&&n(t.labelIndex)){var i=t.labelIndex;t.labelIndex=void 0,A(this,e.id);var r=this._labelCollection.get(i);r.show=!1,r.text="",r.id=void 0,this._unusedLabelIndices.push(i),this._clusterDirty=!0}},_.prototype.getBillboard=x("_billboardCollection",c,"_unusedBillboardIndices","billboardIndex"),_.prototype.removeBillboard=function(e){var t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(n(this._billboardCollection)&&n(t)&&n(t.billboardIndex)){var i=t.billboardIndex;t.billboardIndex=void 0,A(this,e.id);var r=this._billboardCollection.get(i);r.id=void 0,r.show=!1,r.image=void 0,this._unusedBillboardIndices.push(i),this._clusterDirty=!0}},_.prototype.getPoint=x("_pointCollection",m,"_unusedPointIndices","pointIndex"),_.prototype.removePoint=function(e){var t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(n(this._pointCollection)&&n(t)&&n(t.pointIndex)){var i=t.pointIndex;t.pointIndex=void 0,A(this,e.id);var r=this._pointCollection.get(i);r.show=!1,r.id=void 0,this._unusedPointIndices.push(i),this._clusterDirty=!0}},_.prototype.update=function(e){if(n(this._labelCollection)&&this._labelCollection.length>0&&0===this._labelCollection.get(0)._glyphs.length){var t=e.commandList;e.commandList=[],this._labelCollection.update(e),e.commandList=t}this._enabledDirty&&(this._enabledDirty=!1,D(this),this._clusterDirty=!0),this._clusterDirty&&(this._clusterDirty=!1,this._cluster()),n(this._clusterLabelCollection)&&this._clusterLabelCollection.update(e),n(this._clusterBillboardCollection)&&this._clusterBillboardCollection.update(e),n(this._clusterPointCollection)&&this._clusterPointCollection.update(e),n(this._labelCollection)&&this._labelCollection.update(e),n(this._billboardCollection)&&this._billboardCollection.update(e),n(this._pointCollection)&&this._pointCollection.update(e)},_.prototype.destroy=function(){this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._pointCollection=this._pointCollection&&this._pointCollection.destroy(),this._clusterLabelCollection=this._clusterLabelCollection&&this._clusterLabelCollection.destroy(),this._clusterBillboardCollection=this._clusterBillboardCollection&&this._clusterBillboardCollection.destroy(),this._clusterPointCollection=this._clusterPointCollection&&this._clusterPointCollection.destroy(),n(this._removeEventListener)&&(this._removeEventListener(),this._removeEventListener=void 0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity=void 0,this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._pixelRangeDirty=!1,this._minimumClusterSizeDirty=!1},_}),i("DataSources/CustomDataSource",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./DataSource","./EntityCluster","./EntityCollection"],function(e,t,i,r,n,o,a){"use strict";function s(e){this._name=e,this._clock=void 0,this._changed=new r,this._error=new r,this._isLoading=!1,this._loading=new r,this._entityCollection=new a(this),this._entityCluster=new o}return t(s.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._changed.raiseEvent(this))}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading},set:function(e){n.setLoading(this,e)}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}}),s}),i("DataSources/CylinderGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/CylinderGeometry","../Core/CylinderOutlineGeometry","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E){"use strict";function b(e){this.id=e,this.vertexFormat=void 0,this.length=void 0,this.topRadius=void 0,this.bottomRadius=void 0,this.slices=void 0,this.numberOfVerticalLines=void 0}function T(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(T.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new h,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._options=new b(e),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)}function x(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new b(t._entity)}var A=new y(e.WHITE),P=new C(!0),D=new C(!0),M=new C(!1),I=new C(e.BLACK),R=new C(v.DISABLED),O=new C(new u),N=new e;return a(T,{perInstanceColorAppearanceType:{value:_},materialAppearanceType:{value:f}}),a(T.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!o(this._entity.availability)&&E.isConstant(this._showProperty)&&E.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!o(this._entity.availability)&&E.isConstant(this._showProperty)&&E.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!0},geometryChanged:{get:function(){return this._geometryChanged}}}),T.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},T.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},T.prototype.createFillGeometryInstance=function(r){var n,a,s=this._entity,l=s.isAvailable(r),u=new m(l&&s.isShowing&&this._showProperty.getValue(r)&&this._fillProperty.getValue(r)),h=this._distanceDisplayConditionProperty.getValue(r),f=c.fromDistanceDisplayCondition(h);if(this._materialProperty instanceof y){var _=e.WHITE;o(this._materialProperty.color)&&(this._materialProperty.color.isConstant||l)&&(_=this._materialProperty.color.getValue(r)),a=t.fromColor(_),n={show:u,distanceDisplayCondition:f,color:a}}else n={show:u,distanceDisplayCondition:f};return new d({id:s,geometry:new i(this._options),modelMatrix:s._getModelMatrix(p.MINIMUM_VALUE),attributes:n})},T.prototype.createOutlineGeometryInstance=function(i){var n=this._entity,o=n.isAvailable(i),a=E.getValueOrDefault(this._outlineColorProperty,i,e.BLACK),s=this._distanceDisplayConditionProperty.getValue(i);return new d({id:n,geometry:new r(this._options),modelMatrix:n._getModelMatrix(p.MINIMUM_VALUE),attributes:{show:new m(o&&n.isShowing&&this._showProperty.getValue(i)&&this._showOutlineProperty.getValue(i)),color:t.fromColor(a),distanceDisplayCondition:c.fromDistanceDisplayCondition(s)}})},T.prototype.isDestroyed=function(){return!1},T.prototype.destroy=function(){this._entitySubscription(),s(this)},T.prototype._onEntityPropertyChanged=function(e,t,i,r){if("availability"===t||"position"===t||"orientation"===t||"cylinder"===t){var a=e.cylinder;if(!o(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!o(s)||!s.isConstant||s.getValue(p.MINIMUM_VALUE),u=a.outline,c=o(u);if(c&&u.isConstant&&(c=u.getValue(p.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var h=e.position,d=a.length,m=a.topRadius,g=a.bottomRadius,v=a.show;if(o(v)&&v.isConstant&&!v.getValue(p.MINIMUM_VALUE)||!o(h)||!o(d)||!o(m)||!o(g))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var C=n(a.material,A),w=C instanceof y;this._materialProperty=C,this._fillProperty=n(s,D),this._showProperty=n(v,P),this._showOutlineProperty=n(a.outline,M),this._outlineColorProperty=c?n(a.outlineColor,I):void 0,this._shadowsProperty=n(a.shadows,R),this._distanceDisplayConditionProperty=n(a.distanceDisplayCondition,O);var S=a.slices,b=a.outlineWidth,T=a.numberOfVerticalLines;if(this._fillEnabled=l,this._outlineEnabled=c,h.isConstant&&E.isConstant(e.orientation)&&d.isConstant&&m.isConstant&&g.isConstant&&E.isConstant(S)&&E.isConstant(b)&&E.isConstant(T)){var x=this._options;x.vertexFormat=w?_.VERTEX_FORMAT:f.MaterialSupport.TEXTURED.vertexFormat,x.length=d.getValue(p.MINIMUM_VALUE),x.topRadius=m.getValue(p.MINIMUM_VALUE),x.bottomRadius=g.getValue(p.MINIMUM_VALUE),x.slices=o(S)?S.getValue(p.MINIMUM_VALUE):void 0,x.numberOfVerticalLines=o(T)?T.getValue(p.MINIMUM_VALUE):void 0,this._outlineWidth=o(b)?b.getValue(p.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},T.prototype.createDynamicUpdater=function(e){return new x(e,this)},x.prototype.update=function(n){var a=this._primitives;a.removeAndDestroy(this._primitive),a.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0;var s=this._geometryUpdater,l=s._entity,u=l.cylinder;if(l.isShowing&&l.isAvailable(n)&&E.getValueOrDefault(u.show,n,!0)){var h=this._options,p=l._getModelMatrix(n),m=E.getValueOrUndefined(u.length,n),v=E.getValueOrUndefined(u.topRadius,n),y=E.getValueOrUndefined(u.bottomRadius,n);if(o(p)&&o(m)&&o(v)&&o(y)){h.length=m,h.topRadius=v,h.bottomRadius=y,h.slices=E.getValueOrUndefined(u.slices,n),h.numberOfVerticalLines=E.getValueOrUndefined(u.numberOfVerticalLines,n);var C=this._geometryUpdater.shadowsProperty.getValue(n),w=this._geometryUpdater.distanceDisplayConditionProperty,b=w.getValue(n),T=c.fromDistanceDisplayCondition(b);if(E.getValueOrDefault(u.fill,n,!0)){var x=S.getValue(n,s.fillMaterialProperty,this._material);this._material=x;var A=new f({material:x,translucent:x.isTranslucent(),closed:!0});h.vertexFormat=A.vertexFormat,this._primitive=a.add(new g({geometryInstances:new d({id:l,geometry:new i(h),modelMatrix:p,attributes:{distanceDisplayCondition:T}}),appearance:A,asynchronous:!1,shadows:C}))}if(E.getValueOrDefault(u.outline,n,!1)){h.vertexFormat=_.VERTEX_FORMAT;var P=E.getValueOrClonedDefault(u.outlineColor,n,e.BLACK,N),D=E.getValueOrDefault(u.outlineWidth,n,1),M=1!==P.alpha;this._outlinePrimitive=a.add(new g({geometryInstances:new d({id:l,geometry:new r(h),modelMatrix:p,attributes:{color:t.fromColor(P),distanceDisplayCondition:T}}),appearance:new _({flat:!0,translucent:M,renderState:{lineWidth:s._scene.clampLineWidth(D)}}),asynchronous:!1,shadows:C}))}}}},x.prototype.getBoundingSphere=function(e,t){return w(e,this._primitive,this._outlinePrimitive,t)},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),s(this)},T}),i("Scene/ColorBlendMode",["../Core/freezeObject","../Core/Math"],function(e,t){"use strict";var i={HIGHLIGHT:0,REPLACE:1,MIX:2};return i.getColorBlend=function(e,r){return e===i.HIGHLIGHT?0:e===i.REPLACE?1:e===i.MIX?t.clamp(r,t.EPSILON4,1):void 0},e(i)}),i("DataSources/DataSourceClock",["../Core/Clock","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/JulianDate","./createRawPropertyDescriptor"],function(e,t,i,r,n,o,a,s){"use strict";function l(){this._startTime=void 0,this._stopTime=void 0,this._currentTime=void 0,this._clockRange=void 0,this._clockStep=void 0,this._multiplier=void 0,this._definitionChanged=new o}return r(l.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:s("startTime"),stopTime:s("stopTime"),currentTime:s("currentTime"),clockRange:s("clockRange"),clockStep:s("clockStep"),multiplier:s("multiplier")}),l.prototype.clone=function(e){return i(e)||(e=new l),e.startTime=this.startTime,e.stopTime=this.stopTime,e.currentTime=this.currentTime,e.clockRange=this.clockRange,e.clockStep=this.clockStep,e.multiplier=this.multiplier,e},l.prototype.equals=function(e){return this===e||i(e)&&a.equals(this.startTime,e.startTime)&&a.equals(this.stopTime,e.stopTime)&&a.equals(this.currentTime,e.currentTime)&&this.clockRange===e.clockRange&&this.clockStep===e.clockStep&&this.multiplier===e.multiplier},l.prototype.merge=function(e){this.startTime=t(this.startTime,e.startTime),this.stopTime=t(this.stopTime,e.stopTime),this.currentTime=t(this.currentTime,e.currentTime),this.clockRange=t(this.clockRange,e.clockRange),this.clockStep=t(this.clockStep,e.clockStep),this.multiplier=t(this.multiplier,e.multiplier)},l.prototype.getValue=function(r){return i(r)||(r=new e),r.startTime=t(this.startTime,r.startTime),r.stopTime=t(this.stopTime,r.stopTime),r.currentTime=t(this.currentTime,r.currentTime),r.clockRange=t(this.clockRange,r.clockRange),r.multiplier=t(this.multiplier,r.multiplier),r.clockStep=t(this.clockStep,r.clockStep),r},l}),i("DataSources/GridMaterialProperty",["../Core/Cartesian2","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){e=i(e,i.EMPTY_OBJECT),this._definitionChanged=new o,this._color=void 0,this._colorSubscription=void 0,this._cellAlpha=void 0,this._cellAlphaSubscription=void 0,this._lineCount=void 0,this._lineCountSubscription=void 0,this._lineThickness=void 0,this._lineThicknessSubscription=void 0,this._lineOffset=void 0,this._lineOffsetSubscription=void 0,this.color=e.color,this.cellAlpha=e.cellAlpha,this.lineCount=e.lineCount,this.lineThickness=e.lineThickness,this.lineOffset=e.lineOffset}var u=t.WHITE,c=.1,h=new e(8,8),d=new e(0,0),p=new e(1,1);return n(l.prototype,{isConstant:{get:function(){return s.isConstant(this._color)&&s.isConstant(this._cellAlpha)&&s.isConstant(this._lineCount)&&s.isConstant(this._lineThickness)&&s.isConstant(this._lineOffset)}},definitionChanged:{get:function(){return this._definitionChanged}},color:a("color"),cellAlpha:a("cellAlpha"),lineCount:a("lineCount"),lineThickness:a("lineThickness"),lineOffset:a("lineOffset")}),l.prototype.getType=function(e){return"Grid"},l.prototype.getValue=function(e,t){return r(t)||(t={}),t.color=s.getValueOrClonedDefault(this._color,e,u,t.color),t.cellAlpha=s.getValueOrDefault(this._cellAlpha,e,c),t.lineCount=s.getValueOrClonedDefault(this._lineCount,e,h,t.lineCount),t.lineThickness=s.getValueOrClonedDefault(this._lineThickness,e,p,t.lineThickness),t.lineOffset=s.getValueOrClonedDefault(this._lineOffset,e,d,t.lineOffset),t},l.prototype.equals=function(e){return this===e||e instanceof l&&s.equals(this._color,e._color)&&s.equals(this._cellAlpha,e._cellAlpha)&&s.equals(this._lineCount,e._lineCount)&&s.equals(this._lineThickness,e._lineThickness)&&s.equals(this._lineOffset,e._lineOffset)},l}),i("DataSources/PolylineArrowMaterialProperty",["../Core/Color","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,i,r,n,o){"use strict";function a(e){this._definitionChanged=new r,this._color=void 0,this._colorSubscription=void 0,this.color=e}return i(a.prototype,{isConstant:{get:function(){return o.isConstant(this._color); +}},definitionChanged:{get:function(){return this._definitionChanged}},color:n("color")}),a.prototype.getType=function(e){return"PolylineArrow"},a.prototype.getValue=function(i,r){return t(r)||(r={}),r.color=o.getValueOrClonedDefault(this._color,i,e.WHITE,r.color),r},a.prototype.equals=function(e){return this===e||e instanceof a&&o.equals(this._color,e._color)},a}),i("DataSources/PolylineGlowMaterialProperty",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,i,r,n,o,a){"use strict";function s(e){e=t(e,t.EMPTY_OBJECT),this._definitionChanged=new n,this._color=void 0,this._colorSubscription=void 0,this._glowPower=void 0,this._glowPowerSubscription=void 0,this.color=e.color,this.glowPower=e.glowPower}var l=e.WHITE,u=.25;return r(s.prototype,{isConstant:{get:function(){return a.isConstant(this._color)&&a.isConstant(this._glow)}},definitionChanged:{get:function(){return this._definitionChanged}},color:o("color"),glowPower:o("glowPower")}),s.prototype.getType=function(e){return"PolylineGlow"},s.prototype.getValue=function(e,t){return i(t)||(t={}),t.color=a.getValueOrClonedDefault(this._color,e,l,t.color),t.glowPower=a.getValueOrDefault(this._glowPower,e,u,t.glowPower),t},s.prototype.equals=function(e){return this===e||e instanceof s&&a.equals(this._color,e._color)&&a.equals(this._glowPower,e._glowPower)},s}),i("DataSources/PolylineOutlineMaterialProperty",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,i,r,n,o,a){"use strict";function s(e){e=t(e,t.EMPTY_OBJECT),this._definitionChanged=new n,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this.color=e.color,this.outlineColor=e.outlineColor,this.outlineWidth=e.outlineWidth}var l=e.WHITE,u=e.BLACK,c=1;return r(s.prototype,{isConstant:{get:function(){return a.isConstant(this._color)&&a.isConstant(this._outlineColor)&&a.isConstant(this._outlineWidth)}},definitionChanged:{get:function(){return this._definitionChanged}},color:o("color"),outlineColor:o("outlineColor"),outlineWidth:o("outlineWidth")}),s.prototype.getType=function(e){return"PolylineOutline"},s.prototype.getValue=function(e,t){return i(t)||(t={}),t.color=a.getValueOrClonedDefault(this._color,e,l,t.color),t.outlineColor=a.getValueOrClonedDefault(this._outlineColor,e,u,t.outlineColor),t.outlineWidth=a.getValueOrDefault(this._outlineWidth,e,c),t},s.prototype.equals=function(e){return this===e||e instanceof s&&a.equals(this._color,e._color)&&a.equals(this._outlineColor,e._outlineColor)&&a.equals(this._outlineWidth,e._outlineWidth)},s}),i("DataSources/PositionPropertyArray",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/EventHelper","../Core/ReferenceFrame","./Property"],function(e,t,i,r,n,o,a,s){"use strict";function l(t,i){this._value=void 0,this._definitionChanged=new n,this._eventHelper=new o,this._referenceFrame=e(i,a.FIXED),this.setValue(t)}return i(l.prototype,{isConstant:{get:function(){var e=this._value;if(!t(e))return!0;for(var i=e.length,r=0;r<i;r++)if(!s.isConstant(e[r]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}}),l.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,a.FIXED,t)},l.prototype.getValueInReferenceFrame=function(e,i,r){var n=this._value;if(t(n)){var o=n.length;t(r)||(r=new Array(o));for(var a=0,s=0;a<o;){var l=n[a],u=l.getValueInReferenceFrame(e,i,r[a]);t(u)&&(r[s]=u,s++),a++}return r.length=s,r}},l.prototype.setValue=function(e){var i=this._eventHelper;if(i.removeAll(),t(e)){this._value=e.slice();for(var r=e.length,n=0;n<r;n++){var o=e[n];t(o)&&i.add(o.definitionChanged,l.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)},l.prototype.equals=function(e){return this===e||e instanceof l&&this._referenceFrame===e._referenceFrame&&s.arrayEquals(this._value,e._value)},l.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},l}),i("DataSources/PropertyArray",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/EventHelper","./Property"],function(e,t,i,r,n,o){"use strict";function a(e){this._value=void 0,this._definitionChanged=new r,this._eventHelper=new n,this.setValue(e)}return t(a.prototype,{isConstant:{get:function(){var t=this._value;if(!e(t))return!0;for(var i=t.length,r=0;r<i;r++)if(!o.isConstant(t[r]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}}),a.prototype.getValue=function(t,i){var r=this._value;if(e(r)){var n=r.length;e(i)||(i=new Array(n));for(var o=0,a=0;o<n;){var s=this._value[o],l=s.getValue(t,i[o]);e(l)&&(i[a]=l,a++),o++}return i.length=a,i}},a.prototype.setValue=function(t){var i=this._eventHelper;if(i.removeAll(),e(t)){this._value=t.slice();for(var r=t.length,n=0;n<r;n++){var o=t[n];e(o)&&i.add(o.definitionChanged,a.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)},a.prototype.equals=function(e){return this===e||e instanceof a&&o.arrayEquals(this._value,e._value)},a.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},a}),i("DataSources/ReferenceProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/RuntimeError","./Property"],function(e,t,i,r,n,o){"use strict";function a(t){var i=!0;if(t._resolveEntity){var r=t._targetCollection.getById(t._targetId);if(e(r)?(r.definitionChanged.addEventListener(l.prototype._onTargetEntityDefinitionChanged,t),t._targetEntity=r,t._resolveEntity=!1):(r=t._targetEntity,i=!1),!e(r))throw new n('target entity "'+t._targetId+'" could not be resolved.')}return i}function s(t){var i=t._targetProperty;if(t._resolveProperty){var r=a(t),o=t._targetPropertyNames;i=t._targetEntity;for(var s=o.length,l=0;l<s&&e(i);l++)i=i[o[l]];if(e(i))t._targetProperty=i,t._resolveProperty=!r;else if(!e(t._targetProperty))throw new n('targetProperty "'+t._targetId+"."+o.join(".")+'" could not be resolved.')}return i}function l(e,t,i){this._targetCollection=e,this._targetId=t,this._targetPropertyNames=i,this._targetProperty=void 0,this._targetEntity=void 0,this._definitionChanged=new r,this._resolveEntity=!0,this._resolveProperty=!0,e.collectionChanged.addEventListener(l.prototype._onCollectionChanged,this)}return t(l.prototype,{isConstant:{get:function(){return o.isConstant(s(this))}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return s(this).referenceFrame}},targetId:{get:function(){return this._targetId}},targetCollection:{get:function(){return this._targetCollection}},targetPropertyNames:{get:function(){return this._targetPropertyNames}},resolvedProperty:{get:function(){return s(this)}}}),l.fromString=function(e,t){for(var i,r=[],n=!0,o=!1,a="",s=0;s<t.length;++s){var u=t.charAt(s);o?(a+=u,o=!1):"\\"===u?o=!0:n&&"#"===u?(i=a,n=!1,a=""):n||"."!==u?a+=u:(r.push(a),a="")}return r.push(a),new l(e,i,r)},l.prototype.getValue=function(e,t){return s(this).getValue(e,t)},l.prototype.getValueInReferenceFrame=function(e,t,i){return s(this).getValueInReferenceFrame(e,t,i)},l.prototype.getType=function(e){return s(this).getType(e)},l.prototype.equals=function(e){if(this===e)return!0;var t=this._targetPropertyNames,i=e._targetPropertyNames;if(this._targetCollection!==e._targetCollection||this._targetId!==e._targetId||t.length!==i.length)return!1;for(var r=this._targetPropertyNames.length,n=0;n<r;n++)if(t[n]!==i[n])return!1;return!0},l.prototype._onTargetEntityDefinitionChanged=function(e,t,i,r){this._targetPropertyNames[0]===t&&(this._resolveProperty=!0,this._definitionChanged.raiseEvent(this))},l.prototype._onCollectionChanged=function(t,i,r){var n=this._targetEntity;e(n)&&(r.indexOf(n)!==-1?(n.definitionChanged.removeEventListener(l.prototype._onTargetEntityDefinitionChanged,this),this._resolveEntity=!0,this._resolveProperty=!0):this._resolveEntity&&(s(this),this._resolveEntity||this._definitionChanged.raiseEvent(this)))},l}),i("DataSources/Rotation",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/Math"],function(e,t,i,r){"use strict";var n={packedLength:1,pack:function(t,i,r){return r=e(r,0),i[r]=t,i},unpack:function(t,i,r){return i=e(i,0),t[i]},convertPackedArrayForInterpolation:function(t,i,n,o){i=e(i,0),n=e(n,t.length);for(var a,s=0,l=n-i+1;s<l;s++){var u=t[i+s];0===s||Math.abs(a-u)<Math.PI?o[s]=u:o[s]=u-r.TWO_PI,a=u}},unpackInterpolationResult:function(e,t,i,n,o){return o=e[0],o<0?o+r.TWO_PI:o}};return n}),i("DataSources/SampledProperty",["../Core/binarySearch","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/ExtrapolationType","../Core/JulianDate","../Core/LinearApproximation"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(e,t,i){var r,n=e.length,o=i.length,a=n+o;if(e.length=a,n!==t){var s=n-1;for(r=a-1;r>=t;r--)e[r]=e[s--]}for(r=0;r<o;r++)e[t++]=i[r]}function c(e,t){return e instanceof s?e:"string"==typeof e?s.fromIso8601(e):s.addSeconds(t,e,new s)}function h(t,r,n,o,a){for(var l,h,d,p,_,g,v=0;v<o.length;){_=c(o[v],t),d=e(r,_,s.compare);var y=0,C=0;if(d<0){for(d=~d,p=d*a,h=void 0,g=r[d];v<o.length&&(_=c(o[v],t),!(i(h)&&s.compare(h,_)>=0||i(g)&&s.compare(_,g)>=0));){for(m[y++]=_,v+=1,l=0;l<a;l++)f[C++]=o[v],v+=1;h=_}y>0&&(f.length=C,u(n,p,f),m.length=y,u(r,d,m))}else{for(l=0;l<a;l++)v++,n[d*a+l]=o[v];v++}}}function d(e,r){var n=e;n===Number&&(n=p);var s,u=n.packedLength,c=t(n.packedInterpolationLength,u),h=0;if(i(r)){var d=r.length;s=new Array(d);for(var m=0;m<d;m++){var f=r[m];f===Number&&(f=p);var _=f.packedLength;u+=_,c+=t(f.packedInterpolationLength,_),s[m]=f}h=d}this._type=e,this._innerType=n,this._interpolationDegree=1,this._interpolationAlgorithm=l,this._numberOfPoints=0,this._times=[],this._values=[],this._xTable=[],this._yTable=[],this._packedLength=u,this._packedInterpolationLength=c,this._updateTableLength=!0,this._interpolationResult=new Array(c),this._definitionChanged=new o,this._derivativeTypes=r,this._innerDerivativeTypes=s,this._inputOrder=h,this._forwardExtrapolationType=a.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=a.NONE,this._backwardExtrapolationDuration=0}var p={packedLength:1,pack:function(e,i,r){r=t(r,0),i[r]=e},unpack:function(e,i,r){return i=t(i,0),e[i]}},m=[],f=[];return r(d.prototype,{isConstant:{get:function(){return 0===this._values.length}},definitionChanged:{get:function(){return this._definitionChanged}},type:{get:function(){return this._type}},derivativeTypes:{get:function(){return this._derivativeTypes}},interpolationDegree:{get:function(){return this._interpolationDegree}},interpolationAlgorithm:{get:function(){return this._interpolationAlgorithm}},forwardExtrapolationType:{get:function(){return this._forwardExtrapolationType},set:function(e){this._forwardExtrapolationType!==e&&(this._forwardExtrapolationType=e,this._definitionChanged.raiseEvent(this))}},forwardExtrapolationDuration:{get:function(){return this._forwardExtrapolationDuration},set:function(e){this._forwardExtrapolationDuration!==e&&(this._forwardExtrapolationDuration=e,this._definitionChanged.raiseEvent(this))}},backwardExtrapolationType:{get:function(){return this._backwardExtrapolationType},set:function(e){this._backwardExtrapolationType!==e&&(this._backwardExtrapolationType=e,this._definitionChanged.raiseEvent(this))}},backwardExtrapolationDuration:{get:function(){return this._backwardExtrapolationDuration},set:function(e){this._backwardExtrapolationDuration!==e&&(this._backwardExtrapolationDuration=e,this._definitionChanged.raiseEvent(this))}}}),d.prototype.getValue=function(t,r){var n=this._times,o=n.length;if(0!==o){var l,u=this._innerType,c=this._values,h=e(n,t,s.compare);if(h<0){if(h=~h,0===h){var d=n[h];if(l=this._backwardExtrapolationDuration,this._backwardExtrapolationType===a.NONE||0!==l&&s.secondsDifference(d,t)>l)return;if(this._backwardExtrapolationType===a.HOLD)return u.unpack(c,0,r)}if(h>=o){h=o-1;var p=n[h];if(l=this._forwardExtrapolationDuration,this._forwardExtrapolationType===a.NONE||0!==l&&s.secondsDifference(t,p)>l)return;if(this._forwardExtrapolationType===a.HOLD)return h=o-1,u.unpack(c,h*u.packedLength,r)}var m=this._xTable,f=this._yTable,_=this._interpolationAlgorithm,g=this._packedInterpolationLength,v=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;var y=Math.min(_.getRequiredDataPoints(this._interpolationDegree,v),o);y!==this._numberOfPoints&&(this._numberOfPoints=y,m.length=y,f.length=y*g)}var C=this._numberOfPoints-1;if(C<1)return;var w=0,S=o-1,E=S-w+1;if(E>=C+1){var b=h-(C/2|0)-1;b<w&&(b=w);var T=b+C;T>S&&(T=S,b=T-C,b<w&&(b=w)),w=b,S=T}for(var x=S-w+1,A=0;A<x;++A)m[A]=s.secondsDifference(n[w+A],n[S]);if(i(u.convertPackedArrayForInterpolation))u.convertPackedArrayForInterpolation(c,w,S,f);else for(var P=0,D=this._packedLength,M=w*D,I=(S+1)*D;M<I;)f[P]=c[M],M++,P++;var R,O=s.secondsDifference(t,n[S]);if(0!==v&&i(_.interpolate)){var N=Math.floor(g/(v+1));R=_.interpolate(O,m,f,N,v,v,this._interpolationResult)}else R=_.interpolateOrderZero(O,m,f,g,this._interpolationResult);return i(u.unpackInterpolationResult)?u.unpackInterpolationResult(R,c,w,S,r):u.unpack(R,0,r)}return u.unpack(c,h*this._packedLength,r)}},d.prototype.setInterpolationOptions=function(e){var t=!1,i=e.interpolationAlgorithm,r=e.interpolationDegree;this._interpolationAlgorithm!==i&&(this._interpolationAlgorithm=i,t=!0),this._interpolationDegree!==r&&(this._interpolationDegree=r,t=!0),t&&(this._updateTableLength=!0,this._definitionChanged.raiseEvent(this))},d.prototype.addSample=function(e,t,r){var n=this._innerDerivativeTypes,o=i(n),a=this._innerType,s=[];if(s.push(e),a.pack(t,s,s.length),o)for(var l=n.length,u=0;u<l;u++)n[u].pack(r[u],s,s.length);h(void 0,this._times,this._values,s,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)},d.prototype.addSamples=function(e,t,r){for(var n=this._innerDerivativeTypes,o=i(n),a=this._innerType,s=e.length,l=[],u=0;u<s;u++)if(l.push(e[u]),a.pack(t[u],l,l.length),o)for(var c=r[u],d=n.length,p=0;p<d;p++)n[p].pack(c[p],l,l.length);h(void 0,this._times,this._values,l,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)},d.prototype.addSamplesPackedArray=function(e,t){h(t,this._times,this._values,e,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)},d.prototype.equals=function(e){if(this===e)return!0;if(!i(e))return!1;if(this._type!==e._type||this._interpolationDegree!==e._interpolationDegree||this._interpolationAlgorithm!==e._interpolationAlgorithm)return!1;var t=this._derivativeTypes,r=i(t),n=e._derivativeTypes,o=i(n);if(r!==o)return!1;var a,l;if(r){if(l=t.length,l!==n.length)return!1;for(a=0;a<l;a++)if(t[a]!==n[a])return!1}var u=this._times,c=e._times;if(l=u.length,l!==c.length)return!1;for(a=0;a<l;a++)if(!s.equals(u[a],c[a]))return!1;var h=this._values,d=e._values;for(a=0;a<l;a++)if(h[a]!==d[a])return!1;return!0},d._mergeNewSamples=h,d}),i("DataSources/SampledPositionProperty",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/ReferenceFrame","./PositionProperty","./Property","./SampledProperty"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(i,r){r=t(r,0);var n;if(r>0){n=new Array(r);for(var s=0;s<r;s++)n[s]=e}this._numberOfDerivatives=r,this._property=new u(e,n),this._definitionChanged=new o,this._referenceFrame=t(i,a.FIXED),this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)}return r(c.prototype,{isConstant:{get:function(){return this._property.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}},interpolationDegree:{get:function(){return this._property.interpolationDegree}},interpolationAlgorithm:{get:function(){return this._property.interpolationAlgorithm}},numberOfDerivatives:{get:function(){return this._numberOfDerivatives}},forwardExtrapolationType:{get:function(){return this._property.forwardExtrapolationType},set:function(e){this._property.forwardExtrapolationType=e}},forwardExtrapolationDuration:{get:function(){return this._property.forwardExtrapolationDuration},set:function(e){this._property.forwardExtrapolationDuration=e}},backwardExtrapolationType:{get:function(){return this._property.backwardExtrapolationType},set:function(e){this._property.backwardExtrapolationType=e}},backwardExtrapolationDuration:{get:function(){return this._property.backwardExtrapolationDuration},set:function(e){this._property.backwardExtrapolationDuration=e}}}),c.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,a.FIXED,t)},c.prototype.getValueInReferenceFrame=function(e,t,r){if(r=this._property.getValue(e,r),i(r))return s.convertToReferenceFrame(e,r,this._referenceFrame,t,r)},c.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)},c.prototype.addSample=function(e,t,i){this._numberOfDerivatives;this._property.addSample(e,t,i)},c.prototype.addSamples=function(e,t,i){this._property.addSamples(e,t,i)},c.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)},c.prototype.equals=function(e){return this===e||e instanceof c&&l.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame},c}),i("DataSources/StripeOrientation",["../Core/freezeObject"],function(e){"use strict";var t={HORIZONTAL:0,VERTICAL:1};return e(t)}),i("DataSources/StripeMaterialProperty",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property","./StripeOrientation"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){e=t(e,t.EMPTY_OBJECT),this._definitionChanged=new n,this._orientation=void 0,this._orientationSubscription=void 0,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._offset=void 0,this._offsetSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.orientation=e.orientation,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.offset=e.offset,this.repeat=e.repeat}var u=s.HORIZONTAL,c=e.WHITE,h=e.BLACK,d=0,p=1;return r(l.prototype,{isConstant:{get:function(){return a.isConstant(this._orientation)&&a.isConstant(this._evenColor)&&a.isConstant(this._oddColor)&&a.isConstant(this._offset)&&a.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},orientation:o("orientation"),evenColor:o("evenColor"),oddColor:o("oddColor"),offset:o("offset"),repeat:o("repeat")}),l.prototype.getType=function(e){return"Stripe"},l.prototype.getValue=function(e,t){return i(t)||(t={}),t.horizontal=a.getValueOrDefault(this._orientation,e,u)===s.HORIZONTAL,t.evenColor=a.getValueOrClonedDefault(this._evenColor,e,c,t.evenColor),t.oddColor=a.getValueOrClonedDefault(this._oddColor,e,h,t.oddColor),t.offset=a.getValueOrDefault(this._offset,e,d),t.repeat=a.getValueOrDefault(this._repeat,e,p),t},l.prototype.equals=function(e){return this===e||e instanceof l&&a.equals(this._orientation,e._orientation)&&a.equals(this._evenColor,e._evenColor)&&a.equals(this._oddColor,e._oddColor)&&a.equals(this._offset,e._offset)&&a.equals(this._repeat,e._repeat)},l}),i("DataSources/TimeIntervalCollectionPositionProperty",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/ReferenceFrame","../Core/TimeIntervalCollection","./PositionProperty","./Property"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(t){this._definitionChanged=new n,this._intervals=new a,this._intervals.changedEvent.addEventListener(u.prototype._intervalsChanged,this),this._referenceFrame=e(t,o.FIXED)}return i(u.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}},referenceFrame:{get:function(){return this._referenceFrame}}}),u.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,o.FIXED,t)},u.prototype.getValueInReferenceFrame=function(e,i,r){var n=this._intervals.findDataForIntervalContainingDate(e);if(t(n))return s.convertToReferenceFrame(e,n,this._referenceFrame,i,r)},u.prototype.equals=function(e){return this===e||e instanceof u&&this._intervals.equals(e._intervals,l.equals)&&this._referenceFrame===e._referenceFrame},u.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)},u}),i("DataSources/TimeIntervalCollectionProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/TimeIntervalCollection","./Property"],function(e,t,i,r,n,o){"use strict";function a(){this._definitionChanged=new r,this._intervals=new n,this._intervals.changedEvent.addEventListener(a.prototype._intervalsChanged,this)}return t(a.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}}),a.prototype.getValue=function(t,i){var r=this._intervals.findDataForIntervalContainingDate(t);return e(r)&&"function"==typeof r.clone?r.clone(i):r},a.prototype.equals=function(e){return this===e||e instanceof a&&this._intervals.equals(e._intervals,o.equals)},a.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)},a}),i("DataSources/VelocityVectorProperty",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/JulianDate","./Property"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,i){this._position=void 0,this._subscription=void 0,this._definitionChanged=new o,this._normalize=t(i,!0),this.position=e}r(l.prototype,{isConstant:{get:function(){return s.isConstant(this._position)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._position},set:function(e){var t=this._position;t!==e&&(i(t)&&this._subscription(),this._position=e,i(e)&&(this._subscription=e._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)),this._definitionChanged.raiseEvent(this))}},normalize:{get:function(){return this._normalize},set:function(e){this._normalize!==e&&(this._normalize=e,this._definitionChanged.raiseEvent(this))}}});var u=new e,c=new e,h=new a,d=1/60;return l.prototype.getValue=function(e,t){return this._getValue(e,t)},l.prototype._getValue=function(t,r,n){i(r)||(r=new e);var o=this._position;if(s.isConstant(o))return this._normalize?void 0:e.clone(e.ZERO,r);var l=o.getValue(t,u),p=o.getValue(a.addSeconds(t,d,h),c);if(i(l)&&(i(p)||(p=l,l=o.getValue(a.addSeconds(t,-d,h),c),i(l)))){if(e.equals(l,p))return this._normalize?void 0:e.clone(e.ZERO,r);i(n)&&l.clone(n);var m=e.subtract(p,l,r);return this._normalize?e.normalize(m,r):e.divideByScalar(m,d,r)}},l.prototype.equals=function(e){return this===e||e instanceof l&&s.equals(this._position,e._position)},l}),i("DataSources/CzmlDataSource",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/ClockRange","../Core/ClockStep","../Core/Color","../Core/CornerType","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Ellipsoid","../Core/Event","../Core/ExtrapolationType","../Core/getAbsoluteUri","../Core/getFilenameFromUri","../Core/HermitePolynomialApproximation","../Core/isArray","../Core/Iso8601","../Core/JulianDate","../Core/LagrangePolynomialApproximation","../Core/LinearApproximation","../Core/loadJson","../Core/Math","../Core/NearFarScalar","../Core/Quaternion","../Core/Rectangle","../Core/ReferenceFrame","../Core/RuntimeError","../Core/Spherical","../Core/TimeInterval","../Core/TimeIntervalCollection","../Scene/ColorBlendMode","../Scene/HeightReference","../Scene/HorizontalOrigin","../Scene/LabelStyle","../Scene/ShadowMode","../Scene/VerticalOrigin","../ThirdParty/Uri","../ThirdParty/when","./BillboardGraphics","./BoxGraphics","./ColorMaterialProperty","./CompositeMaterialProperty","./CompositePositionProperty","./CompositeProperty","./ConstantPositionProperty","./ConstantProperty","./CorridorGraphics","./CylinderGraphics","./DataSource","./DataSourceClock","./EllipseGraphics","./EllipsoidGraphics","./EntityCluster","./EntityCollection","./GridMaterialProperty","./ImageMaterialProperty","./LabelGraphics","./ModelGraphics","./NodeTransformationProperty","./PathGraphics","./PointGraphics","./PolygonGraphics","./PolylineArrowMaterialProperty","./PolylineGlowMaterialProperty","./PolylineGraphics","./PolylineOutlineMaterialProperty","./PositionPropertyArray","./PropertyArray","./PropertyBag","./RectangleGraphics","./ReferenceProperty","./Rotation","./SampledPositionProperty","./SampledProperty","./StripeMaterialProperty","./StripeOrientation","./TimeIntervalCollectionPositionProperty","./TimeIntervalCollectionProperty","./VelocityVectorProperty","./WallGraphics"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I,R,O,N,L,B,F,V,k,z,U,G,W,H,q,j,Y,X,Z,K,Q,J,$,ee,te,ie,re,ne,oe,ae,se,le,ue,ce,he,de,pe,me,fe,_e,ge,ve,ye,Ce,we,Se,Ee,be,Te,xe,Ae,Pe,De){"use strict";function Me(e,t){return"#"===t[0]&&(t=Pt+t),Ce.fromString(e,t)}function Ie(e){var t=e.rgbaf;if(c(t))return t;var i=e.rgba;if(c(i)){var r=i.length;if(r===a.packedLength)return[a.byteToFloat(i[0]),a.byteToFloat(i[1]),a.byteToFloat(i[2]),a.byteToFloat(i[3])];t=new Array(r);for(var n=0;n<r;n+=5)t[n]=i[n],t[n+1]=a.byteToFloat(i[n+1]),t[n+2]=a.byteToFloat(i[n+2]),t[n+3]=a.byteToFloat(i[n+3]),t[n+4]=a.byteToFloat(i[n+4]);return t}}function Re(e,t){var i=u(e.uri,e);return c(t)&&(i=_(i,_(t))),i}function Oe(e){var t=e.wsen;if(c(t))return t;var i=e.wsenDegrees;if(c(i)){var r=i.length;if(r===P.packedLength)return[T.toRadians(i[0]),T.toRadians(i[1]),T.toRadians(i[2]),T.toRadians(i[3])];t=new Array(r);for(var n=0;n<r;n+=5)t[n]=i[n],t[n+1]=T.toRadians(i[n+1]),t[n+2]=T.toRadians(i[n+2]),t[n+3]=T.toRadians(i[n+3]),t[n+4]=T.toRadians(i[n+4]);return t}}function Ne(e){var t=e.length;if(Mt.magnitude=1,2===t)return Mt.clock=e[0],Mt.cone=e[1],i.fromSpherical(Mt,Dt),[Dt.x,Dt.y,Dt.z];for(var r=new Array(t/3*4),n=0,o=0;n<t;n+=3,o+=4)r[o]=e[n],Mt.clock=e[n+1],Mt.cone=e[n+2],i.fromSpherical(Mt,Dt),r[o+1]=Dt.x,r[o+2]=Dt.y,r[o+3]=Dt.z;return r}function Le(e){var t=e.length;if(3===t)return Mt.clock=e[0],Mt.cone=e[1],Mt.magnitude=e[2],i.fromSpherical(Mt,Dt),[Dt.x,Dt.y,Dt.z];for(var r=new Array(t),n=0;n<t;n+=4)r[n]=e[n],Mt.clock=e[n+1],Mt.cone=e[n+2],Mt.magnitude=e[n+3],i.fromSpherical(Mt,Dt),r[n+1]=Dt.x,r[n+2]=Dt.y,r[n+3]=Dt.z;return r}function Be(e){var t=e.length;if(3===t)return It.longitude=e[0],It.latitude=e[1],It.height=e[2],p.WGS84.cartographicToCartesian(It,Dt),[Dt.x,Dt.y,Dt.z];for(var i=new Array(t),r=0;r<t;r+=4)i[r]=e[r],It.longitude=e[r+1],It.latitude=e[r+2],It.height=e[r+3],p.WGS84.cartographicToCartesian(It,Dt),i[r+1]=Dt.x,i[r+2]=Dt.y,i[r+3]=Dt.z;return i}function Fe(e){var t=e.length;if(3===t)return It.longitude=T.toRadians(e[0]),It.latitude=T.toRadians(e[1]),It.height=e[2],p.WGS84.cartographicToCartesian(It,Dt),[Dt.x,Dt.y,Dt.z];for(var i=new Array(t),r=0;r<t;r+=4)i[r]=e[r],It.longitude=T.toRadians(e[r+1]),It.latitude=T.toRadians(e[r+2]),It.height=e[r+3],p.WGS84.cartographicToCartesian(It,Dt),i[r+1]=Dt.x,i[r+2]=Dt.y,i[r+3]=Dt.z;return i}function Ve(e){var t=e.cartesian;if(c(t))return t;var i=e.cartesianVelocity;if(c(i))return i;var r=e.unitCartesian;if(c(r))return r;var n=e.unitSpherical;if(c(n))return Ne(n);var o=e.spherical;if(c(o))return Le(o);var a=e.cartographicRadians;if(c(a))return Be(a);var s=e.cartographicDegrees;if(c(s))return Fe(s);throw new M(JSON.stringify(e)+" is not a valid CZML interval.")}function ke(e,t){var i=e[t],r=e[t+1],n=e[t+2],o=e[t+3],a=1/Math.sqrt(i*i+r*r+n*n+o*o);e[t]=i*a,e[t+1]=r*a,e[t+2]=n*a,e[t+3]=o*a}function ze(e){var t=e.unitQuaternion;if(c(t)){if(4===t.length)return ke(t,0),t;for(var i=1;i<t.length;i+=5)ke(t,i)}return t}function Ue(r,n,o){switch(r){case Array:return n.array;case Boolean:return u(n.boolean,n);case e:return n.boundingRectangle;case t:return n.cartesian2;case i:return Ve(n);case a:return Ie(n);case N:return N[u(n.colorBlendMode,n)];case s:return s[u(n.cornerType,n)];case L:return L[u(n.heightReference,n)];case B:return B[u(n.horizontalOrigin,n)];case Image:return Re(n,o);case w:return w.fromIso8601(u(n.date,n));case F:return F[u(n.labelStyle,n)];case Number:return u(n.number,n);case x:return n.nearFarScalar;case A:return ze(n);case we:return u(n.number,n);case V:return V[u(n.shadows,n)];case String:return u(n.string,n);case Te:return Te[u(n.stripeOrientation,n)];case P:return Oe(n);case z:return Re(n,o);case k:return k[u(n.verticalOrigin,n)];default:throw new M(r)}}function Ge(e,t){var i=e.interpolationAlgorithm;(c(i)||c(e.interpolationDegree))&&t.setInterpolationOptions({interpolationAlgorithm:Ot[i],interpolationDegree:e.interpolationDegree});var r=e.forwardExtrapolationType;c(r)&&(t.forwardExtrapolationType=f[r]);var n=e.forwardExtrapolationDuration;c(n)&&(t.forwardExtrapolationDuration=n);var o=e.backwardExtrapolationType;c(o)&&(t.backwardExtrapolationType=f[o]);var a=e.backwardExtrapolationDuration;c(a)&&(t.backwardExtrapolationDuration=a)}function We(e,t,i,r,n,o,a){var s,l=r.interval;c(l)?(Nt.iso8601=l,s=R.fromIso8601(Nt),c(n)&&(s=R.intersect(s,n,Rt))):c(n)&&(s=n);var h,d,p,m,f=c(r.reference),_=c(s)&&!s.equals(C.MAXIMUM_INTERVAL);f||(p=Ue(e,r,o),h=u(e.packedLength,1),m=u(p.length,1),d=!c(r.array)&&"string"!=typeof p&&m>h);var g="function"==typeof e.unpack&&e!==we;if(!d&&!_)return void(f?t[i]=Me(a,r.reference):g?t[i]=new Z(e.unpack(p,0)):t[i]=new Z(p));var v,y=t[i],S=r.epoch;if(c(S)&&(v=w.fromIso8601(S)),d&&!_)return y instanceof Ee||(y=new Ee(e),t[i]=y),y.addSamplesPackedArray(p,v),void Ge(r,y);var E;if(!d&&_)return s=s.clone(),f?s.data=Me(a,r.reference):g?s.data=e.unpack(p,0):s.data=p,c(y)||(y=f?new Y:new Ae,t[i]=y),void(!f&&y instanceof Ae?y.intervals.addInterval(s):y instanceof Y?(s.data=f?s.data:new Z(s.data),y.intervals.addInterval(s)):(E=C.MAXIMUM_INTERVAL.clone(),E.data=y,y=new Y,t[i]=y,y.intervals.addInterval(E),s.data=f?s.data:new Z(s.data),y.intervals.addInterval(s)));c(y)||(y=new Y,t[i]=y),y instanceof Y||(E=C.MAXIMUM_INTERVAL.clone(),E.data=y,y=new Y,t[i]=y,y.intervals.addInterval(E));var b=y.intervals;E=b.findInterval(s),c(E)&&E.data instanceof Ee||(E=s.clone(),E.data=new Ee(e),b.addInterval(E)),E.data.addSamplesPackedArray(p,v),Ge(r,E.data)}function He(e,t,i,r,n,o,a){if(c(r))if(y(r))for(var s=0,l=r.length;s<l;s++)We(e,t,i,r[s],n,o,a);else We(e,t,i,r,n,o,a)}function qe(e,t,r,n,o,a){var s,l=r.interval;c(l)?(Nt.iso8601=l,s=R.fromIso8601(Nt),c(n)&&(s=R.intersect(s,n,Rt))):c(n)&&(s=n);var h,d,p,m=!1,f=c(r.cartesianVelocity)?1:0,_=i.packedLength*(f+1),g=c(r.reference),v=c(s)&&!s.equals(C.MAXIMUM_INTERVAL);if(g||(c(r.referenceFrame)&&(h=D[r.referenceFrame]),h=u(h,D.FIXED),d=Ve(r),p=u(d.length,1),m=p>_),!m&&!v)return void(g?e[t]=Me(a,r.reference):e[t]=new X(i.unpack(d),h));var y,S=e[t],E=r.epoch;if(c(E)&&(y=w.fromIso8601(E)),m&&!v)return S instanceof Se&&(!c(h)||S.referenceFrame===h)||(S=new Se(h,f),e[t]=S),S.addSamplesPackedArray(d,y),void Ge(r,S);var b;if(!m&&v)return s=s.clone(),g?s.data=Me(a,r.reference):s.data=i.unpack(d),c(S)||(S=g?new j(h):new xe(h),e[t]=S),void(!g&&S instanceof xe&&c(h)&&S.referenceFrame===h?S.intervals.addInterval(s):S instanceof j?(s.data=g?s.data:new X(s.data,h), +S.intervals.addInterval(s)):(b=C.MAXIMUM_INTERVAL.clone(),b.data=S,S=new j(S.referenceFrame),e[t]=S,S.intervals.addInterval(b),s.data=g?s.data:new X(s.data,h),S.intervals.addInterval(s)));c(S)?S instanceof j||(b=C.MAXIMUM_INTERVAL.clone(),b.data=S,S=new j(S.referenceFrame),e[t]=S,S.intervals.addInterval(b)):(S=new j(h),e[t]=S);var T=S.intervals;b=T.findInterval(s),c(b)&&b.data instanceof Se&&(!c(h)||b.data.referenceFrame===h)||(b=s.clone(),b.data=new Se(h,f),T.addInterval(b)),b.data.addSamplesPackedArray(d,y),Ge(r,b.data)}function je(e,t,i,r,n,o){if(c(i))if(y(i))for(var a=0,s=i.length;a<s;a++)qe(e,t,i[a],r,n,o);else qe(e,t,i,r,n,o)}function Ye(e,i,r,n,o,s){var l,u=r.interval;c(u)?(Nt.iso8601=u,l=R.fromIso8601(Nt),c(n)&&(l=R.intersect(l,n,Rt))):c(n)&&(l=n);var h,d,p=e[i];if(c(l)){p instanceof q||(p=new q,e[i]=p);var m=p.intervals;d=m.findInterval({start:l.start,stop:l.stop}),c(d)?h=d.data:(d=l.clone(),m.addInterval(d))}else h=p;var f;c(r.solidColor)?(h instanceof H||(h=new H),f=r.solidColor,He(a,h,"color",f.color,void 0,void 0,s)):c(r.grid)?(h instanceof ne||(h=new ne),f=r.grid,He(a,h,"color",f.color,void 0,o,s),He(Number,h,"cellAlpha",f.cellAlpha,void 0,o,s),He(t,h,"lineCount",f.lineCount,void 0,o,s),He(t,h,"lineThickness",f.lineThickness,void 0,o,s),He(t,h,"lineOffset",f.lineOffset,void 0,o,s)):c(r.image)?(h instanceof oe||(h=new oe),f=r.image,He(Image,h,"image",f.image,void 0,o,s),He(t,h,"repeat",f.repeat,void 0,o,s),He(a,h,"color",f.color,void 0,o,s),He(Boolean,h,"transparent",f.transparent,void 0,o,s)):c(r.stripe)?(h instanceof be||(h=new be),f=r.stripe,He(Te,h,"orientation",f.orientation,void 0,o,s),He(a,h,"evenColor",f.evenColor,void 0,o,s),He(a,h,"oddColor",f.oddColor,void 0,o,s),He(Number,h,"offset",f.offset,void 0,o,s),He(Number,h,"repeat",f.repeat,void 0,o,s)):c(r.polylineOutline)?(h instanceof fe||(h=new fe),f=r.polylineOutline,He(a,h,"color",f.color,void 0,o,s),He(a,h,"outlineColor",f.outlineColor,void 0,o,s),He(Number,h,"outlineWidth",f.outlineWidth,void 0,o,s)):c(r.polylineGlow)?(h instanceof pe||(h=new pe),f=r.polylineGlow,He(a,h,"color",f.color,void 0,o,s),He(Number,h,"glowPower",f.glowPower,void 0,o,s)):c(r.polylineArrow)&&(h instanceof de||(h=new de),f=r.polylineArrow,He(a,h,"color",f.color,void 0,void 0,s)),c(d)?d.data=h:e[i]=h}function Xe(e,t,i,r,n,o){if(c(i))if(y(i))for(var a=0,s=i.length;a<s;a++)Ye(e,t,i[a],r,n,o);else Ye(e,t,i,r,n,o)}function Ze(e,t,i,r){e.name=u(t.name,e.name)}function Ke(e,t,i,r){var n=t.description;c(n)&&He(String,e,"description",n,void 0,r,i)}function Qe(e,t,i,r){var n=t.position;c(n)&&je(e,"position",n,void 0,r,i)}function Je(e,t,r,n){var o=t.viewFrom;c(o)&&He(i,e,"viewFrom",o,void 0,n,r)}function $e(e,t,i,r){var n=t.orientation;c(n)&&He(A,e,"orientation",n,void 0,r,i)}function et(e,t,i,r){var n=i.references;if(c(n)){var o=n.map(function(e){return Me(r,e)}),a=i.interval;if(c(a)){if(a=R.fromIso8601(a),!(e[t]instanceof j)){a.data=new ge(o);var s=new Y;s.intervals.addInterval(a),e[t]=s}}else e[t]=new ge(o)}else He(Array,e,t,i,void 0,void 0,r)}function tt(e,t,i,r){if(c(i))if(y(i))for(var n=0,o=i.length;n<o;++n)et(e,t,i[n],r);else et(e,t,i,r)}function it(e,t,r,n){if(c(r.references)){var o=r.references.map(function(e){return Me(n,e)}),a=r.interval;if(c(a)){if(a=R.fromIso8601(a),!(e[t]instanceof j)){a.data=new _e(o);var s=new j;s.intervals.addInterval(a),e[t]=s}}else e[t]=new _e(o)}else c(r.cartesian)?r.array=i.unpackArray(r.cartesian):c(r.cartographicRadians)?r.array=i.fromRadiansArrayHeights(r.cartographicRadians):c(r.cartographicDegrees)&&(r.array=i.fromDegreesArrayHeights(r.cartographicDegrees)),c(r.array)&&He(Array,e,t,r,void 0,void 0,n)}function rt(e,t,i,r){if(c(i))if(y(i))for(var n=0,o=i.length;n<o;n++)it(e,t,i[n],r);else it(e,t,i,r)}function nt(e,t,i,r){var n,o=t.availability;if(c(o)){var a;if(y(o))for(var s=o.length,l=0;l<s;l++)c(a)||(a=new O),Nt.iso8601=o[l],n=R.fromIso8601(Nt),a.addInterval(n);else Nt.iso8601=o,n=R.fromIso8601(Nt),a=new O,a.addInterval(n);e.availability=a}}function ot(e,t,r,n,o){c(t)&&(c(t.velocityReference)?e.alignedAxis=new Pe(Me(o,t.velocityReference),!0):He(i,e,"alignedAxis",t,r,n,o))}function at(r,n,o,s){var l=n.billboard;if(c(l)){var u,h=l.interval;c(h)&&(Nt.iso8601=h,u=R.fromIso8601(Nt));var d=r.billboard;c(d)||(r.billboard=d=new G),He(Boolean,d,"show",l.show,u,s,o),He(Image,d,"image",l.image,u,s,o),He(Number,d,"scale",l.scale,u,s,o),He(t,d,"pixelOffset",l.pixelOffset,u,s,o),He(i,d,"eyeOffset",l.eyeOffset,u,s,o),He(B,d,"horizontalOrigin",l.horizontalOrigin,u,s,o),He(k,d,"verticalOrigin",l.verticalOrigin,u,s,o),He(L,d,"heightReference",l.heightReference,u,s,o),He(a,d,"color",l.color,u,s,o),He(we,d,"rotation",l.rotation,u,s,o),ot(d,l.alignedAxis,u,s,o),He(Boolean,d,"sizeInMeters",l.sizeInMeters,u,s,o),He(Number,d,"width",l.width,u,s,o),He(Number,d,"height",l.height,u,s,o),He(x,d,"scaleByDistance",l.scaleByDistance,u,s,o),He(x,d,"translucencyByDistance",l.translucencyByDistance,u,s,o),He(x,d,"pixelOffsetScaleByDistance",l.pixelOffsetScaleByDistance,u,s,o),He(e,d,"imageSubRegion",l.imageSubRegion,u,s,o)}}function st(e,t,r,n){var o=t.box;if(c(o)){var s,l=o.interval;c(l)&&(Nt.iso8601=l,s=R.fromIso8601(Nt));var u=e.box;c(u)||(e.box=u=new W),He(Boolean,u,"show",o.show,s,n,r),He(i,u,"dimensions",o.dimensions,s,n,r),He(Boolean,u,"fill",o.fill,s,n,r),Xe(u,"material",o.material,s,n,r),He(Boolean,u,"outline",o.outline,s,n,r),He(a,u,"outlineColor",o.outlineColor,s,n,r),He(Number,u,"outlineWidth",o.outlineWidth,s,n,r),He(V,u,"shadows",o.shadows,s,n,r)}}function lt(e,t,i,r){var n=t.corridor;if(c(n)){var o,l=n.interval;c(l)&&(Nt.iso8601=l,o=R.fromIso8601(Nt));var u=e.corridor;c(u)||(e.corridor=u=new K),He(Boolean,u,"show",n.show,o,r,i),rt(u,"positions",n.positions,i),He(Number,u,"width",n.width,o,r,i),He(Number,u,"height",n.height,o,r,i),He(Number,u,"extrudedHeight",n.extrudedHeight,o,r,i),He(s,u,"cornerType",n.cornerType,o,r,i),He(Number,u,"granularity",n.granularity,o,r,i),He(Boolean,u,"fill",n.fill,o,r,i),Xe(u,"material",n.material,o,r,i),He(Boolean,u,"outline",n.outline,o,r,i),He(a,u,"outlineColor",n.outlineColor,o,r,i),He(Number,u,"outlineWidth",n.outlineWidth,o,r,i),He(V,u,"shadows",n.shadows,o,r,i)}}function ut(e,t,i,r){var n=t.cylinder;if(c(n)){var o,s=n.interval;c(s)&&(Nt.iso8601=s,o=R.fromIso8601(Nt));var l=e.cylinder;c(l)||(e.cylinder=l=new Q),He(Boolean,l,"show",n.show,o,r,i),He(Number,l,"length",n.length,o,r,i),He(Number,l,"topRadius",n.topRadius,o,r,i),He(Number,l,"bottomRadius",n.bottomRadius,o,r,i),He(Boolean,l,"fill",n.fill,o,r,i),Xe(l,"material",n.material,o,r,i),He(Boolean,l,"outline",n.outline,o,r,i),He(a,l,"outlineColor",n.outlineColor,o,r,i),He(Number,l,"outlineWidth",n.outlineWidth,o,r,i),He(Number,l,"numberOfVerticalLines",n.numberOfVerticalLines,o,r,i),He(Number,l,"slices",n.slices,o,r,i),He(V,l,"shadows",n.shadows,o,r,i)}}function ct(e,t){var i=e.version;if(c(i)&&"string"==typeof i){var r=i.split(".");if(2===r.length){if("1"!==r[0])throw new M("Cesium only supports CZML version 1.");t._version=i}}if(!c(t._version))throw new M("CZML version information invalid. It is expected to be a property on the document object in the <Major>.<Minor> version format.");var n=t._documentPacket;c(e.name)&&(n.name=e.name);var o=e.clock;if(c(o)){var a=n.clock;c(a)?(a.interval=u(o.interval,a.interval),a.currentTime=u(o.currentTime,a.currentTime),a.range=u(o.range,a.range),a.step=u(o.step,a.step),a.multiplier=u(o.multiplier,a.multiplier)):n.clock={interval:o.interval,currentTime:o.currentTime,range:o.range,step:o.step,multiplier:o.multiplier}}}function ht(e,t,i,r){var n=t.ellipse;if(c(n)){var o,s=n.interval;c(s)&&(Nt.iso8601=s,o=R.fromIso8601(Nt));var l=e.ellipse;c(l)||(e.ellipse=l=new ee),He(Boolean,l,"show",n.show,o,r,i),He(Number,l,"semiMajorAxis",n.semiMajorAxis,o,r,i),He(Number,l,"semiMinorAxis",n.semiMinorAxis,o,r,i),He(Number,l,"height",n.height,o,r,i),He(Number,l,"extrudedHeight",n.extrudedHeight,o,r,i),He(we,l,"rotation",n.rotation,o,r,i),He(we,l,"stRotation",n.stRotation,o,r,i),He(Number,l,"granularity",n.granularity,o,r,i),He(Boolean,l,"fill",n.fill,o,r,i),Xe(l,"material",n.material,o,r,i),He(Boolean,l,"outline",n.outline,o,r,i),He(a,l,"outlineColor",n.outlineColor,o,r,i),He(Number,l,"outlineWidth",n.outlineWidth,o,r,i),He(Number,l,"numberOfVerticalLines",n.numberOfVerticalLines,o,r,i),He(V,l,"shadows",n.shadows,o,r,i)}}function dt(e,t,r,n){var o=t.ellipsoid;if(c(o)){var s,l=o.interval;c(l)&&(Nt.iso8601=l,s=R.fromIso8601(Nt));var u=e.ellipsoid;c(u)||(e.ellipsoid=u=new te),He(Boolean,u,"show",o.show,s,n,r),He(i,u,"radii",o.radii,s,n,r),He(Boolean,u,"fill",o.fill,s,n,r),Xe(u,"material",o.material,s,n,r),He(Boolean,u,"outline",o.outline,s,n,r),He(a,u,"outlineColor",o.outlineColor,s,n,r),He(Number,u,"outlineWidth",o.outlineWidth,s,n,r),He(Number,u,"stackPartitions",o.stackPartitions,s,n,r),He(Number,u,"slicePartitions",o.slicePartitions,s,n,r),He(Number,u,"subdivisions",o.subdivisions,s,n,r),He(V,u,"shadows",o.shadows,s,n,r)}}function pt(e,r,n,o){var s=r.label;if(c(s)){var l,u=s.interval;c(u)&&(Nt.iso8601=u,l=R.fromIso8601(Nt));var h=e.label;c(h)||(e.label=h=new ae),He(Boolean,h,"show",s.show,l,o,n),He(String,h,"text",s.text,l,o,n),He(String,h,"font",s.font,l,o,n),He(F,h,"style",s.style,l,o,n),He(Number,h,"scale",s.scale,l,o,n),He(Boolean,h,"showBackground",s.showBackground,l,o,n),He(a,h,"backgroundColor",s.backgroundColor,l,o,n),He(t,h,"backgroundPadding",s.backgroundPadding,l,o,n),He(t,h,"pixelOffset",s.pixelOffset,l,o,n),He(i,h,"eyeOffset",s.eyeOffset,l,o,n),He(B,h,"horizontalOrigin",s.horizontalOrigin,l,o,n),He(k,h,"verticalOrigin",s.verticalOrigin,l,o,n),He(L,h,"heightReference",s.heightReference,l,o,n),He(a,h,"fillColor",s.fillColor,l,o,n),He(a,h,"outlineColor",s.outlineColor,l,o,n),He(Number,h,"outlineWidth",s.outlineWidth,l,o,n),He(x,h,"translucencyByDistance",s.translucencyByDistance,l,o,n),He(x,h,"pixelOffsetScaleByDistance",s.pixelOffsetScaleByDistance,l,o,n)}}function mt(e,t,i,r){var n=t.model;if(c(n)){var o,s=n.interval;c(s)&&(Nt.iso8601=s,o=R.fromIso8601(Nt));var l=e.model;c(l)||(e.model=l=new se),He(Boolean,l,"show",n.show,o,r,i),He(z,l,"uri",n.gltf,o,r,i),He(Number,l,"scale",n.scale,o,r,i),He(Number,l,"minimumPixelSize",n.minimumPixelSize,o,r,i),He(Number,l,"maximumScale",n.maximumScale,o,r,i),He(Boolean,l,"incrementallyLoadTextures",n.incrementallyLoadTextures,o,r,i),He(Boolean,l,"runAnimations",n.runAnimations,o,r,i),He(V,l,"shadows",n.shadows,o,r,i),He(L,l,"heightReference",n.heightReference,o,r,i),He(a,l,"silhouetteColor",n.silhouetteColor,o,r,i),He(Number,l,"silhouetteSize",n.silhouetteSize,o,r,i),He(a,l,"color",n.color,o,r,i),He(N,l,"colorBlendMode",n.colorBlendMode,o,r,i),He(Number,l,"colorBlendAmount",n.colorBlendAmount,o,r,i);var u=n.nodeTransformations;if(c(u))if(y(u))for(var h=0,d=u.length;h<d;h++)ft(l,u[h],o,r,i);else ft(l,u,o,r,i)}}function ft(e,t,r,n,o){var a,s=t.interval;c(s)?(Nt.iso8601=s,a=R.fromIso8601(Nt),c(r)&&(a=R.intersect(a,r,Rt))):c(r)&&(a=r);for(var l=e.nodeTransformations,u=Object.keys(t),h=0,d=u.length;h<d;++h){var p=u[h];if("interval"!==p){var m=t[p];if(c(m)){c(l)||(e.nodeTransformations=l=new ve),l.hasProperty(p)||l.addProperty(p);var f=l[p];c(f)||(l[p]=f=new le),He(i,f,"translation",m.translation,a,n,o),He(A,f,"rotation",m.rotation,a,n,o),He(i,f,"scale",m.scale,a,n,o)}}}}function _t(e,t,i,r){var n=t.path;if(c(n)){var o,a=n.interval;c(a)&&(Nt.iso8601=a,o=R.fromIso8601(Nt));var s=e.path;c(s)||(e.path=s=new ue),He(Boolean,s,"show",n.show,o,r,i),He(Number,s,"width",n.width,o,r,i),He(Number,s,"resolution",n.resolution,o,r,i),He(Number,s,"leadTime",n.leadTime,o,r,i),He(Number,s,"trailTime",n.trailTime,o,r,i),Xe(s,"material",n.material,o,r,i)}}function gt(e,t,i,r){var n=t.point;if(c(n)){var o,s=n.interval;c(s)&&(Nt.iso8601=s,o=R.fromIso8601(Nt));var l=e.point;c(l)||(e.point=l=new ce),He(Boolean,l,"show",n.show,o,r,i),He(Number,l,"pixelSize",n.pixelSize,o,r,i),He(L,l,"heightReference",n.heightReference,o,r,i),He(a,l,"color",n.color,o,r,i),He(a,l,"outlineColor",n.outlineColor,o,r,i),He(Number,l,"outlineWidth",n.outlineWidth,o,r,i),He(x,l,"scaleByDistance",n.scaleByDistance,o,r,i),He(x,l,"translucencyByDistance",n.translucencyByDistance,o,r,i)}}function vt(e,t,i,r){var n=t.polygon;if(c(n)){var o,s=n.interval;c(s)&&(Nt.iso8601=s,o=R.fromIso8601(Nt));var l=e.polygon;c(l)||(e.polygon=l=new he),He(Boolean,l,"show",n.show,o,r,i),rt(l,"hierarchy",n.positions,i),He(Number,l,"height",n.height,o,r,i),He(Number,l,"extrudedHeight",n.extrudedHeight,o,r,i),He(we,l,"stRotation",n.stRotation,o,r,i),He(Number,l,"granularity",n.granularity,o,r,i),He(Boolean,l,"fill",n.fill,o,r,i),Xe(l,"material",n.material,o,r,i),He(Boolean,l,"outline",n.outline,o,r,i),He(a,l,"outlineColor",n.outlineColor,o,r,i),He(Number,l,"outlineWidth",n.outlineWidth,o,r,i),He(Boolean,l,"perPositionHeight",n.perPositionHeight,o,r,i),He(Boolean,l,"closeTop",n.closeTop,o,r,i),He(Boolean,l,"closeBottom",n.closeBottom,o,r,i),He(V,l,"shadows",n.shadows,o,r,i)}}function yt(e,t,i,r){var n=t.polyline;if(c(n)){var o,a=n.interval;c(a)&&(Nt.iso8601=a,o=R.fromIso8601(Nt));var s=e.polyline;c(s)||(e.polyline=s=new me),He(Boolean,s,"show",n.show,o,r,i),rt(s,"positions",n.positions,i),He(Number,s,"width",n.width,o,r,i),He(Number,s,"granularity",n.granularity,o,r,i),Xe(s,"material",n.material,o,r,i),He(Boolean,s,"followSurface",n.followSurface,o,r,i),He(V,s,"shadows",n.shadows,o,r,i)}}function Ct(e,t,i,r){var n=t.rectangle;if(c(n)){var o,s=n.interval;c(s)&&(Nt.iso8601=s,o=R.fromIso8601(Nt));var l=e.rectangle;c(l)||(e.rectangle=l=new ye),He(Boolean,l,"show",n.show,o,r,i),He(P,l,"coordinates",n.coordinates,o,r,i),He(Number,l,"height",n.height,o,r,i),He(Number,l,"extrudedHeight",n.extrudedHeight,o,r,i),He(we,l,"rotation",n.rotation,o,r,i),He(we,l,"stRotation",n.stRotation,o,r,i),He(Number,l,"granularity",n.granularity,o,r,i),He(Boolean,l,"fill",n.fill,o,r,i),Xe(l,"material",n.material,o,r,i),He(Boolean,l,"outline",n.outline,o,r,i),He(a,l,"outlineColor",n.outlineColor,o,r,i),He(Number,l,"outlineWidth",n.outlineWidth,o,r,i),He(Boolean,l,"closeTop",n.closeTop,o,r,i),He(Boolean,l,"closeBottom",n.closeBottom,o,r,i),He(V,l,"shadows",n.shadows,o,r,i)}}function wt(e,t,i,r){var n=t.wall;if(c(n)){var o,s=n.interval;c(s)&&(Nt.iso8601=s,o=R.fromIso8601(Nt));var l=e.wall;c(l)||(e.wall=l=new De),He(Boolean,l,"show",n.show,o,r,i),rt(l,"positions",n.positions,i),tt(l,"minimumHeights",n.minimumHeights,i),tt(l,"maximumHeights",n.maximumHeights,i),He(Number,l,"granularity",n.granularity,o,r,i),He(Boolean,l,"fill",n.fill,o,r,i),Xe(l,"material",n.material,o,r,i),He(Boolean,l,"outline",n.outline,o,r,i),He(a,l,"outlineColor",n.outlineColor,o,r,i),He(Number,l,"outlineWidth",n.outlineWidth,o,r,i),He(V,l,"shadows",n.shadows,o,r,i)}}function St(e,t,i,r,n){var o=e.id;if(c(o)||(o=l()),Pt=o,!c(n._version)&&"document"!==o)throw new M("The first CZML packet is required to be the document object.");if(e.delete===!0)t.removeById(o);else if("document"===o)ct(e,n);else{var a=t.getOrCreateEntity(o),s=e.parent;c(s)&&(a.parent=t.getOrCreateEntity(s));for(var u=i.length-1;u>-1;u--)i[u](a,e,t,r)}Pt=void 0}function Et(e){var t,i=e._documentPacket.clock;if(!c(i)){if(!c(e._clock)){var r=e._entityCollection.computeAvailability();if(!r.start.equals(C.MINIMUM_VALUE)){var a=r.start,s=r.stop,l=w.secondsDifference(s,a),h=Math.round(l/120);return t=new $,t.startTime=w.clone(a),t.stopTime=w.clone(s),t.clockRange=n.LOOP_STOP,t.multiplier=h,t.currentTime=w.clone(a),t.clockStep=o.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}if(c(e._clock)?t=e._clock.clone():(t=new $,t.startTime=C.MINIMUM_VALUE.clone(),t.stopTime=C.MAXIMUM_VALUE.clone(),t.currentTime=C.MINIMUM_VALUE.clone(),t.clockRange=n.LOOP_STOP,t.clockStep=o.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1),c(i.interval)){Nt.iso8601=i.interval;var d=R.fromIso8601(Nt);t.startTime=d.start,t.stopTime=d.stop}return c(i.currentTime)&&(t.currentTime=w.fromIso8601(i.currentTime)),c(i.range)&&(t.clockRange=u(n[i.range],n.LOOP_STOP)),c(i.step)&&(t.clockStep=u(o[i.step],o.SYSTEM_CLOCK_MULTIPLIER)),c(i.multiplier)&&(t.multiplier=i.multiplier),!t.equals(e._clock)&&(e._clock=t.clone(e._clock),!0)}function bt(e,t,i,r){i=u(i,u.EMPTY_OBJECT);var n=t,o=i.sourceUri;return"string"==typeof t&&(n=b(t),o=u(o,t)),J.setLoading(e,!0),U(n,function(t){return Tt(e,t,o,r)}).otherwise(function(t){return J.setLoading(e,!1),e._error.raiseEvent(e,t),console.log(t),U.reject(t)})}function Tt(e,t,i,r){J.setLoading(e,!0);var n=e._entityCollection;r&&(e._version=void 0,e._documentPacket=new xt,n.removeAll()),At._processCzml(t,n,i,void 0,e);var o=Et(e),a=e._documentPacket;return c(a.name)&&e._name!==a.name?(e._name=a.name,o=!0):!c(e._name)&&c(i)&&(e._name=g(i),o=!0),J.setLoading(e,!1),o&&e._changed.raiseEvent(e),e}function xt(){this.name=void 0,this.clock=void 0}function At(e){this._name=e,this._changed=new m,this._error=new m,this._isLoading=!1,this._loading=new m,this._clock=void 0,this._documentPacket=new xt,this._version=void 0,this._entityCollection=new re(this),this._entityCluster=new ie}var Pt,Dt=new i,Mt=new I,It=new r,Rt=new R,Ot={HERMITE:v,LAGRANGE:S,LINEAR:E},Nt={iso8601:void 0};return At.load=function(e,t){return(new At).load(e,t)},h(At.prototype,{name:{get:function(){return this._name}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}}),At.updaters=[at,st,lt,ut,ht,dt,pt,mt,Ze,Ke,_t,gt,vt,yt,Ct,Qe,Je,wt,$e,nt],At.prototype.process=function(e,t){return bt(this,e,t,!1)},At.prototype.load=function(e,t){return bt(this,e,t,!0)},At.processPacketData=He,At.processPositionPacketData=je,At.processMaterialPacketData=Xe,At._processCzml=function(e,t,i,r,n){if(r=c(r)?r:At.updaters,y(e))for(var o=0,a=e.length;o<a;o++)St(e[o],t,r,i,n);else St(e,t,r,i,n)},At}),i("DataSources/DataSourceCollection",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../ThirdParty/when"],function(e,t,i,r,n,o,a){"use strict";function s(){this._dataSources=[],this._dataSourceAdded=new o,this._dataSourceRemoved=new o}return i(s.prototype,{length:{get:function(){return this._dataSources.length}},dataSourceAdded:{get:function(){return this._dataSourceAdded}},dataSourceRemoved:{get:function(){return this._dataSourceRemoved}}}),s.prototype.add=function(e){var t=this,i=this._dataSources;return a(e,function(e){return i===t._dataSources&&(t._dataSources.push(e),t._dataSourceAdded.raiseEvent(t,e)),e})},s.prototype.remove=function(t,i){i=e(i,!1);var r=this._dataSources.indexOf(t);return r!==-1&&(this._dataSources.splice(r,1),this._dataSourceRemoved.raiseEvent(this,t),i&&"function"==typeof t.destroy&&t.destroy(),!0)},s.prototype.removeAll=function(t){t=e(t,!1);for(var i=this._dataSources,r=0,n=i.length;r<n;++r){var o=i[r];this._dataSourceRemoved.raiseEvent(this,o),t&&"function"==typeof o.destroy&&o.destroy()}this._dataSources=[]},s.prototype.contains=function(e){return this.indexOf(e)!==-1},s.prototype.indexOf=function(e){return this._dataSources.indexOf(e)},s.prototype.get=function(e){return this._dataSources[e]},s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return this.removeAll(!0),r(this)},s}),i("DataSources/EllipseGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/EllipseGeometry","../Core/EllipseOutlineGeometry","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/oneTimeWarning","../Core/ShowGeometryInstanceAttribute","../Scene/GroundPrimitive","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T){"use strict";function x(e){this.id=e,this.vertexFormat=void 0,this.center=void 0,this.semiMajorAxis=void 0,this.semiMinorAxis=void 0,this.rotation=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.numberOfVerticalLines=void 0}function A(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(A.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._isClosed=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new h,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._onTerrain=!1,this._options=new x(e),this._onEntityPropertyChanged(e,"ellipse",e.ellipse,void 0)}function P(e,t,i){this._primitives=e,this._groundPrimitives=t,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=i,this._options=new x(i._entity)}var D=new w(e.WHITE),M=new S(!0),I=new S(!0),R=new S(!1),O=new S(e.BLACK),N=new S(C.DISABLED),L=new S(new s),B=new e;return n(A,{perInstanceColorAppearanceType:{value:v},materialAppearanceType:{value:g}}),n(A.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!r(this._entity.availability)&&T.isConstant(this._showProperty)&&T.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!r(this._entity.availability)&&T.isConstant(this._showProperty)&&T.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},onTerrain:{get:function(){return this._onTerrain}},geometryChanged:{get:function(){return this._geometryChanged}}}),A.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},A.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},A.prototype.createFillGeometryInstance=function(i){var n,o,a=this._entity,s=a.isAvailable(i),c=new f(s&&a.isShowing&&this._showProperty.getValue(i)&&this._fillProperty.getValue(i)),h=this._distanceDisplayConditionProperty.getValue(i),p=l.fromDistanceDisplayCondition(h);if(this._materialProperty instanceof w){var m=e.WHITE;r(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(m=this._materialProperty.color.getValue(i)),o=t.fromColor(m),n={show:c,distanceDisplayCondition:p,color:o}}else n={show:c,distanceDisplayCondition:p};return new d({id:a,geometry:new u(this._options),attributes:n})},A.prototype.createOutlineGeometryInstance=function(i){var r=this._entity,n=r.isAvailable(i),o=T.getValueOrDefault(this._outlineColorProperty,i,e.BLACK),a=this._distanceDisplayConditionProperty.getValue(i);return new d({id:r,geometry:new c(this._options),attributes:{show:new f(n&&r.isShowing&&this._showProperty.getValue(i)&&this._showOutlineProperty.getValue(i)),color:t.fromColor(o),distanceDisplayCondition:l.fromDistanceDisplayCondition(a)}})},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){this._entitySubscription(),o(this)},A.prototype._onEntityPropertyChanged=function(e,t,n,o){if("availability"===t||"position"===t||"ellipse"===t){var a=this._entity.ellipse;if(!r(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!r(s)||!s.isConstant||s.getValue(p.MINIMUM_VALUE),u=a.outline,c=r(u);if(c&&u.isConstant&&(c=u.getValue(p.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var h=this._entity.position,d=a.semiMajorAxis,f=a.semiMinorAxis,y=a.show;if(r(y)&&y.isConstant&&!y.getValue(p.MINIMUM_VALUE)||!r(h)||!r(d)||!r(f))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var C=i(a.material,D),S=C instanceof w;this._materialProperty=C,this._fillProperty=i(s,I),this._showProperty=i(y,M),this._showOutlineProperty=i(a.outline,R),this._outlineColorProperty=c?i(a.outlineColor,O):void 0,this._shadowsProperty=i(a.shadows,N),this._distanceDisplayConditionProperty=i(a.distanceDisplayCondition,L);var E=a.rotation,b=a.height,x=a.extrudedHeight,A=a.granularity,P=a.stRotation,B=a.outlineWidth,F=a.numberOfVerticalLines,V=l&&!r(b)&&!r(x)&&S&&_.isSupported(this._scene);if(c&&V&&(m(m.geometryOutlines),c=!1),this._fillEnabled=l,this._onTerrain=V,this._isClosed=r(x)||V,this._outlineEnabled=c,h.isConstant&&d.isConstant&&f.isConstant&&T.isConstant(E)&&T.isConstant(b)&&T.isConstant(x)&&T.isConstant(A)&&T.isConstant(P)&&T.isConstant(B)&&T.isConstant(F)&&(!V||T.isConstant(C))){var k=this._options;k.vertexFormat=S?v.VERTEX_FORMAT:g.MaterialSupport.TEXTURED.vertexFormat,k.center=h.getValue(p.MINIMUM_VALUE,k.center),k.semiMajorAxis=d.getValue(p.MINIMUM_VALUE,k.semiMajorAxis),k.semiMinorAxis=f.getValue(p.MINIMUM_VALUE,k.semiMinorAxis),k.rotation=r(E)?E.getValue(p.MINIMUM_VALUE):void 0,k.height=r(b)?b.getValue(p.MINIMUM_VALUE):void 0,k.extrudedHeight=r(x)?x.getValue(p.MINIMUM_VALUE):void 0,k.granularity=r(A)?A.getValue(p.MINIMUM_VALUE):void 0,k.stRotation=r(P)?P.getValue(p.MINIMUM_VALUE):void 0,k.numberOfVerticalLines=r(F)?F.getValue(p.MINIMUM_VALUE):void 0,this._outlineWidth=r(B)?B.getValue(p.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},A.prototype.createDynamicUpdater=function(e,t){return new P(e,t,this)},P.prototype.update=function(i){var n=this._geometryUpdater,o=n._onTerrain,a=this._primitives,s=this._groundPrimitives;o?s.removeAndDestroy(this._primitive):(a.removeAndDestroy(this._primitive),a.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;var h=n._entity,p=h.ellipse;if(h.isShowing&&h.isAvailable(i)&&T.getValueOrDefault(p.show,i,!0)){var m=this._options,f=T.getValueOrUndefined(h.position,i,m.center),C=T.getValueOrUndefined(p.semiMajorAxis,i),w=T.getValueOrUndefined(p.semiMinorAxis,i);if(r(f)&&r(C)&&r(w)){m.center=f,m.semiMajorAxis=C,m.semiMinorAxis=w,m.rotation=T.getValueOrUndefined(p.rotation,i),m.height=T.getValueOrUndefined(p.height,i),m.extrudedHeight=T.getValueOrUndefined(p.extrudedHeight,i),m.granularity=T.getValueOrUndefined(p.granularity,i),m.stRotation=T.getValueOrUndefined(p.stRotation,i),m.numberOfVerticalLines=T.getValueOrUndefined(p.numberOfVerticalLines,i);var S=this._geometryUpdater.shadowsProperty.getValue(i),E=this._geometryUpdater.distanceDisplayConditionProperty,x=E.getValue(i),A=l.fromDistanceDisplayCondition(x);if(T.getValueOrDefault(p.fill,i,!0)){var P=n.fillMaterialProperty,D=b.getValue(i,P,this._material);if(this._material=D,o){var M=e.WHITE;r(P.color)&&(M=P.color.getValue(i)),this._primitive=s.add(new _({geometryInstances:new d({id:h,geometry:new u(m),attributes:{color:t.fromColor(M),distanceDisplayCondition:A}}),asynchronous:!1,shadows:S}))}else{var I=new g({material:D,translucent:D.isTranslucent(),closed:r(m.extrudedHeight)});m.vertexFormat=I.vertexFormat,this._primitive=a.add(new y({geometryInstances:new d({id:h,geometry:new u(m)}),attributes:{distanceDisplayCondition:A},appearance:I,asynchronous:!1,shadows:S}))}}if(!o&&T.getValueOrDefault(p.outline,i,!1)){m.vertexFormat=v.VERTEX_FORMAT;var R=T.getValueOrClonedDefault(p.outlineColor,i,e.BLACK,B),O=T.getValueOrDefault(p.outlineWidth,i,1),N=1!==R.alpha;this._outlinePrimitive=a.add(new y({geometryInstances:new d({id:h,geometry:new c(m),attributes:{color:t.fromColor(R),distanceDisplayCondition:A}}),appearance:new v({flat:!0,translucent:N,renderState:{lineWidth:n._scene.clampLineWidth(O)}}),asynchronous:!1,shadows:S}))}}}},P.prototype.getBoundingSphere=function(e,t){return E(e,this._primitive,this._outlinePrimitive,t)},P.prototype.isDestroyed=function(){return!1},P.prototype.destroy=function(){var e=this._primitives,t=this._groundPrimitives;this._geometryUpdater._onTerrain?t.removeAndDestroy(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),o(this)},A}),i("DataSources/EllipsoidGeometryUpdater",["../Core/Cartesian3","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/EllipsoidGeometry","../Core/EllipsoidOutlineGeometry","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/Matrix4","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/SceneMode","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x){"use strict";function A(e){this.id=e,this.vertexFormat=void 0,this.radii=void 0,this.stackPartitions=void 0,this.slicePartitions=void 0,this.subdivisions=void 0}function P(e,t){this._scene=t,this._entity=e,this._entitySubscription=e.definitionChanged.addEventListener(P.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new d,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._options=new A(e),this._onEntityPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)}function D(e,t){this._entity=t._entity,this._scene=t._scene,this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new A(t._entity),this._modelMatrix=new f,this._material=void 0,this._attributes=void 0,this._outlineAttributes=void 0,this._lastSceneMode=void 0,this._lastShow=void 0,this._lastOutlineShow=void 0,this._lastOutlineWidth=void 0,this._lastOutlineColor=void 0}var M=new S(t.WHITE),I=new E(!0),R=new E(!0),O=new E(!1),N=new E(t.BLACK),L=new E(w.DISABLED),B=new E(new l),F=new e,V=new t,k=new e(1,1,1);return o(P,{perInstanceColorAppearanceType:{value:v},materialAppearanceType:{value:g}}),o(P.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!n(this._entity.availability)&&x.isConstant(this._showProperty)&&x.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!n(this._entity.availability)&&x.isConstant(this._showProperty)&&x.isConstant(this._showOutlineProperty); +}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!0},geometryChanged:{get:function(){return this._geometryChanged}}}),P.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},P.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},P.prototype.createFillGeometryInstance=function(e){var r,o,a=this._entity,s=a.isAvailable(e),l=new _(s&&a.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),h=this._distanceDisplayConditionProperty.getValue(e),d=u.fromDistanceDisplayCondition(h);if(this._materialProperty instanceof S){var f=t.WHITE;n(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(f=this._materialProperty.color.getValue(e)),o=i.fromColor(f),r={show:l,distanceDisplayCondition:d,color:o}}else r={show:l,distanceDisplayCondition:d};return new p({id:a,geometry:new c(this._options),modelMatrix:a._getModelMatrix(m.MINIMUM_VALUE),attributes:r})},P.prototype.createOutlineGeometryInstance=function(e){var r=this._entity,n=r.isAvailable(e),o=x.getValueOrDefault(this._outlineColorProperty,e,t.BLACK),a=this._distanceDisplayConditionProperty.getValue(e);return new p({id:r,geometry:new h(this._options),modelMatrix:r._getModelMatrix(m.MINIMUM_VALUE),attributes:{show:new _(n&&r.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:i.fromColor(o),distanceDisplayCondition:u.fromDistanceDisplayCondition(a)}})},P.prototype.isDestroyed=function(){return!1},P.prototype.destroy=function(){this._entitySubscription(),a(this)},P.prototype._onEntityPropertyChanged=function(e,t,i,o){if("availability"===t||"position"===t||"orientation"===t||"ellipsoid"===t){var a=e.ellipsoid;if(!n(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!n(s)||!s.isConstant||s.getValue(m.MINIMUM_VALUE),u=a.outline,c=n(u);if(c&&u.isConstant&&(c=u.getValue(m.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var h=e.position,d=a.radii,p=a.show;if(n(p)&&p.isConstant&&!p.getValue(m.MINIMUM_VALUE)||!n(h)||!n(d))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var f=r(a.material,M),_=f instanceof S;this._materialProperty=f,this._fillProperty=r(s,R),this._showProperty=r(p,I),this._showOutlineProperty=r(a.outline,O),this._outlineColorProperty=c?r(a.outlineColor,N):void 0,this._shadowsProperty=r(a.shadows,L),this._distanceDisplayConditionProperty=r(a.distanceDisplayCondition,B),this._fillEnabled=l,this._outlineEnabled=c;var y=a.stackPartitions,C=a.slicePartitions,w=a.outlineWidth,E=a.subdivisions;if(h.isConstant&&x.isConstant(e.orientation)&&d.isConstant&&x.isConstant(y)&&x.isConstant(C)&&x.isConstant(w)&&x.isConstant(E)){var b=this._options;b.vertexFormat=_?v.VERTEX_FORMAT:g.MaterialSupport.TEXTURED.vertexFormat,b.radii=d.getValue(m.MINIMUM_VALUE,b.radii),b.stackPartitions=n(y)?y.getValue(m.MINIMUM_VALUE):void 0,b.slicePartitions=n(C)?C.getValue(m.MINIMUM_VALUE):void 0,b.subdivisions=n(E)?E.getValue(m.MINIMUM_VALUE):void 0,this._outlineWidth=n(w)?w.getValue(m.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},P.prototype.createDynamicUpdater=function(e){return new D(e,this)},D.prototype.update=function(e){var o=this._entity,a=o.ellipsoid;if(!o.isShowing||!o.isAvailable(e)||!x.getValueOrDefault(a.show,e,!0))return n(this._primitive)&&(this._primitive.show=!1),void(n(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1));var s=x.getValueOrUndefined(a.radii,e,F),d=o._getModelMatrix(e,this._modelMatrix);if(!n(d)||!n(s))return n(this._primitive)&&(this._primitive.show=!1),void(n(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1));var m,w=x.getValueOrDefault(a.fill,e,!0),S=x.getValueOrDefault(a.outline,e,!1),E=x.getValueOrClonedDefault(a.outlineColor,e,t.BLACK,V),b=T.getValue(e,r(a.material,M),this._material);this._material=b;var A=x.getValueOrUndefined(a.stackPartitions,e),P=x.getValueOrUndefined(a.slicePartitions,e),D=x.getValueOrUndefined(a.subdivisions,e),I=x.getValueOrDefault(a.outlineWidth,e,1),R=this._scene.mode,O=R===C.SCENE3D,N=this._options,L=this._geometryUpdater.shadowsProperty.getValue(e),B=this._geometryUpdater.distanceDisplayConditionProperty,z=B.getValue(e),U=u.fromDistanceDisplayCondition(z),G=!O||this._lastSceneMode!==R||!n(this._primitive)||N.stackPartitions!==A||N.slicePartitions!==P||N.subdivisions!==D||this._lastOutlineWidth!==I;if(G){var W=this._primitives;W.removeAndDestroy(this._primitive),W.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0,this._lastSceneMode=R,this._lastOutlineWidth=I,N.stackPartitions=A,N.slicePartitions=P,N.subdivisions=D,N.radii=O?k:s,m=new g({material:b,translucent:b.isTranslucent(),closed:!0}),N.vertexFormat=m.vertexFormat,this._primitive=W.add(new y({geometryInstances:new p({id:o,geometry:new c(N),modelMatrix:O?void 0:d,attributes:{show:new _(w),distanceDisplayCondition:U}}),appearance:m,asynchronous:!1,shadows:L})),N.vertexFormat=v.VERTEX_FORMAT,this._outlinePrimitive=W.add(new y({geometryInstances:new p({id:o,geometry:new h(N),modelMatrix:O?void 0:d,attributes:{show:new _(S),color:i.fromColor(E),distanceDisplayCondition:U}}),appearance:new v({flat:!0,translucent:1!==E.alpha,renderState:{lineWidth:this._geometryUpdater._scene.clampLineWidth(I)}}),asynchronous:!1,shadows:L})),this._lastShow=w,this._lastOutlineShow=S,this._lastOutlineColor=t.clone(E,this._lastOutlineColor),this._lastDistanceDisplayCondition=z}else if(this._primitive.ready){var H=this._primitive,q=this._outlinePrimitive;H.show=!0,q.show=!0,m=H.appearance,m.material=b;var j=this._attributes;n(j)||(j=H.getGeometryInstanceAttributes(o),this._attributes=j),w!==this._lastShow&&(j.show=_.toValue(w,j.show),this._lastShow=w);var Y=this._outlineAttributes;n(Y)||(Y=q.getGeometryInstanceAttributes(o),this._outlineAttributes=Y),S!==this._lastOutlineShow&&(Y.show=_.toValue(S,Y.show),this._lastOutlineShow=S),t.equals(E,this._lastOutlineColor)||(Y.color=i.toValue(E,Y.color),t.clone(E,this._lastOutlineColor)),l.equals(z,this._lastDistanceDisplayCondition)||(j.distanceDisplayCondition=u.toValue(z,j.distanceDisplayCondition),Y.distanceDisplayCondition=u.toValue(z,Y.distanceDisplayCondition),l.clone(z,this._lastDistanceDisplayCondition))}O&&(s.x=Math.max(s.x,.001),s.y=Math.max(s.y,.001),s.z=Math.max(s.z,.001),d=f.multiplyByScale(d,s,d),this._primitive.modelMatrix=d,this._outlinePrimitive.modelMatrix=d)},D.prototype.getBoundingSphere=function(e,t){return b(e,this._primitive,this._outlinePrimitive,t)},D.prototype.isDestroyed=function(){return!1},D.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),a(this)},P}),i("DataSources/StaticGeometryColorBatch",["../Core/AssociativeArray","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defined","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/ShowGeometryInstanceAttribute","../Scene/Primitive","./BoundingSphereState","./Property"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(t,i,r,n,o){this.translucent=i,this.appearanceType=r,this.closed=n,this.shadows=o,this.primitives=t,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new e,this.updaters=new e,this.updatersWithAttributes=new e,this.attributes=new e,this.subscriptions=new e,this.showsUpdated=new e,this.itemsToRemove=[]}function h(e,t,i,r){this._solidBatch=new c(e,!1,t,i,r),this._translucentBatch=new c(e,!0,t,i,r)}var d=new t,p=new n;return c.prototype.add=function(e,t){var i=e.entity.id;if(this.createPrimitive=!0,this.geometry.set(i,t),this.updaters.set(i,e),e.hasConstantFill&&e.fillMaterialProperty.isConstant&&u.isConstant(e.distanceDisplayConditionProperty)){var r=this;this.subscriptions.set(i,e.entity.definitionChanged.addEventListener(function(t,i,n,o){"isShowing"===i&&r.showsUpdated.set(t.id,e)}))}else this.updatersWithAttributes.set(i,e)},c.prototype.remove=function(e){var t=e.entity.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);var i=this.subscriptions.get(t);r(i)&&(i(),this.subscriptions.remove(t))}},c.prototype.update=function(e){var l,c,h=!0,m=0,f=this.primitive,_=this.primitives;if(this.createPrimitive){var g=this.geometry.values,v=g.length;if(v>0){for(r(f)&&(r(this.oldPrimitive)?_.remove(f):this.oldPrimitive=f),c=0;c<v;c++){var y=g[c],C=y.attributes;l=this.attributes.get(y.id.id),r(l)&&(r(C.show)&&(C.show.value=l.show),r(C.color)&&(C.color.value=l.color))}f=new s({asynchronous:!0,geometryInstances:g,appearance:new this.appearanceType({translucent:this.translucent,closed:this.closed}),shadows:this.shadows}),_.add(f),h=!1}else{r(f)&&(_.remove(f),f=void 0);var w=this.oldPrimitive;r(w)&&(_.remove(w),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=f,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(r(f)&&f.ready){r(this.oldPrimitive)&&(_.remove(this.oldPrimitive),this.oldPrimitive=void 0);var S=this.updatersWithAttributes.values,E=S.length,b=this.waitingOnCreate;for(c=0;c<E;c++){var T=S[c],x=this.geometry.get(T.entity.id);if(l=this.attributes.get(x.id.id),r(l)||(l=f.getGeometryInstanceAttributes(x.id),this.attributes.set(x.id.id,l)),!T.fillMaterialProperty.isConstant||b){var A=T.fillMaterialProperty.color;A.getValue(e,d),t.equals(l._lastColor,d)||(l._lastColor=t.clone(d,l._lastColor),l.color=i.toValue(d,l.color),(this.translucent&&255===l.color[3]||!this.translucent&&255!==l.color[3])&&(this.itemsToRemove[m++]=T))}var P=T.entity.isShowing&&(T.hasConstantFill||T.isFilled(e)),D=1===l.show[0];P!==D&&(l.show=a.toValue(P,l.show));var M=T.distanceDisplayConditionProperty;if(!u.isConstant(M)){var I=M.getValue(e,p);n.equals(I,l._lastDistanceDisplayCondition)||(l._lastDistanceDisplayCondition=n.clone(I,l._lastDistanceDisplayCondition),l.distanceDisplayCondition=o.toValue(I,l.distanceDisplayCondition))}}this.updateShows(f),this.waitingOnCreate=!1}else r(f)&&!f.ready&&(h=!1);return this.itemsToRemove.length=m,h},c.prototype.updateShows=function(e){for(var t=this.showsUpdated.values,i=t.length,n=0;n<i;n++){var o=t[n],s=this.geometry.get(o.entity.id),l=this.attributes.get(s.id.id);r(l)||(l=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,l));var u=o.entity.isShowing,c=1===l.show[0];u!==c&&(l.show=a.toValue(u,l.show))}this.showsUpdated.removeAll()},c.prototype.contains=function(e){return this.updaters.contains(e.id)},c.prototype.getBoundingSphere=function(e,t){var i=this.primitive;if(!i.ready)return l.PENDING;var n=i.getGeometryInstanceAttributes(e);return!r(n)||!r(n.boundingSphere)||r(n.show)&&0===n.show[0]?l.FAILED:(n.boundingSphere.clone(t),l.DONE)},c.prototype.removeAllPrimitives=function(){var e=this.primitives,t=this.primitive;r(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());var i=this.oldPrimitive;r(i)&&(e.remove(i),this.oldPrimitive=void 0)},h.prototype.add=function(e,t){var i=t.createFillGeometryInstance(e);255===i.attributes.color.value[3]?this._solidBatch.add(t,i):this._translucentBatch.add(t,i)},h.prototype.remove=function(e){this._solidBatch.remove(e)||this._translucentBatch.remove(e)},h.prototype.update=function(e){var t,i,r=this._solidBatch.update(e);r=this._translucentBatch.update(e)&&r;var n=this._solidBatch.itemsToRemove,o=n.length;if(o>0)for(t=0;t<o;t++)i=n[t],this._solidBatch.remove(i),this._translucentBatch.add(i,i.createFillGeometryInstance(e));n=this._translucentBatch.itemsToRemove;var a=n.length;if(a>0)for(t=0;t<a;t++)i=n[t],this._translucentBatch.remove(i),this._solidBatch.add(i,i.createFillGeometryInstance(e));return(o>0||a>0)&&(r=this._solidBatch.update(e)&&r,r=this._translucentBatch.update(e)&&r),r},h.prototype.getBoundingSphere=function(e,t){return this._solidBatch.contains(e)?this._solidBatch.getBoundingSphere(e,t):this._translucentBatch.contains(e)?this._translucentBatch.getBoundingSphere(e,t):l.FAILED},h.prototype.removeAllPrimitives=function(){this._solidBatch.removeAllPrimitives(),this._translucentBatch.removeAllPrimitives()},h}),i("DataSources/StaticGeometryPerMaterialBatch",["../Core/AssociativeArray","../Core/defined","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/ShowGeometryInstanceAttribute","../Scene/Primitive","./BoundingSphereState","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(t,i,r,n,o){this.primitives=t,this.appearanceType=i,this.materialProperty=r,this.closed=n,this.shadows=o,this.updaters=new e,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new e,this.material=void 0,this.updatersWithAttributes=new e,this.attributes=new e,this.invalidated=!1,this.removeMaterialSubscription=r.definitionChanged.addEventListener(u.prototype.onMaterialChanged,this),this.subscriptions=new e,this.showsUpdated=new e}function c(e,t,i,r){this._items=[],this._primitives=e,this._appearanceType=t,this._closed=i,this._shadows=r}var h=new i;return u.prototype.onMaterialChanged=function(){this.invalidated=!0},u.prototype.isMaterial=function(e){var i=this.materialProperty,r=e.fillMaterialProperty;return r===i||!!t(i)&&i.equals(r)},u.prototype.add=function(e,t){var i=t.entity.id;if(this.updaters.set(i,t),this.geometry.set(i,t.createFillGeometryInstance(e)),t.hasConstantFill&&t.fillMaterialProperty.isConstant&&l.isConstant(t.distanceDisplayConditionProperty)){var r=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(e,i,n,o){"isShowing"===i&&r.showsUpdated.set(e.id,t)}))}else this.updatersWithAttributes.set(i,t);this.createPrimitive=!0},u.prototype.remove=function(e){var i=e.entity.id;if(this.createPrimitive=this.geometry.remove(i)||this.createPrimitive,this.updaters.remove(i)){this.updatersWithAttributes.remove(i);var r=this.subscriptions.get(i);t(r)&&(r(),this.subscriptions.remove(i))}return this.createPrimitive},u.prototype.update=function(e){var a,u,c=!0,d=this.primitive,p=this.primitives,m=this.geometry.values;if(this.createPrimitive){var f=m.length;if(f>0){for(t(d)&&(t(this.oldPrimitive)?p.remove(d):this.oldPrimitive=d),u=0;u<f;u++){var _=m[u],g=_.attributes;a=this.attributes.get(_.id.id),t(a)&&(t(g.show)&&(g.show.value=a.show),t(g.color)&&(g.color.value=a.color))}this.material=s.getValue(e,this.materialProperty,this.material),d=new o({asynchronous:!0,geometryInstances:m,appearance:new this.appearanceType({material:this.material,translucent:this.material.isTranslucent(),closed:this.closed}),shadows:this.shadows}),p.add(d),c=!1}else{t(d)&&(p.remove(d),d=void 0);var v=this.oldPrimitive;t(v)&&(p.remove(v),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=d,this.createPrimitive=!1}else if(t(d)&&d.ready){t(this.oldPrimitive)&&(p.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=s.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material;var y=this.updatersWithAttributes.values,C=y.length;for(u=0;u<C;u++){var w=y[u],S=w.entity,E=this.geometry.get(S.id);a=this.attributes.get(E.id.id),t(a)||(a=d.getGeometryInstanceAttributes(E.id),this.attributes.set(E.id.id,a));var b=S.isShowing&&(w.hasConstantFill||w.isFilled(e)),T=1===a.show[0];b!==T&&(a.show=n.toValue(b,a.show));var x=w.distanceDisplayConditionProperty;if(!l.isConstant(x)){var A=x.getValue(e,h);i.equals(A,a._lastDistanceDisplayCondition)||(a._lastDistanceDisplayCondition=i.clone(A,a._lastDistanceDisplayCondition),a.distanceDisplayCondition=r.toValue(A,a.distanceDisplayCondition))}}this.updateShows(d)}else t(d)&&!d.ready&&(c=!1);return c},u.prototype.updateShows=function(e){for(var i=this.showsUpdated.values,r=i.length,o=0;o<r;o++){var a=i[o],s=a.entity,l=this.geometry.get(s.id),u=this.attributes.get(l.id.id);t(u)||(u=e.getGeometryInstanceAttributes(l.id),this.attributes.set(l.id.id,u));var c=s.isShowing,h=1===u.show[0];c!==h&&(u.show=n.toValue(c,u.show))}this.showsUpdated.removeAll()},u.prototype.contains=function(e){return this.updaters.contains(e.id)},u.prototype.getBoundingSphere=function(e,i){var r=this.primitive;if(!r.ready)return a.PENDING;var n=r.getGeometryInstanceAttributes(e);return!t(n)||!t(n.boundingSphere)||t(n.show)&&0===n.show[0]?a.FAILED:(n.boundingSphere.clone(i),a.DONE)},u.prototype.destroy=function(e){var i=this.primitive,r=this.primitives;t(i)&&r.remove(i);var n=this.oldPrimitive;t(n)&&r.remove(n),this.removeMaterialSubscription()},c.prototype.add=function(e,t){for(var i=this._items,r=i.length,n=0;n<r;n++){var o=i[n];if(o.isMaterial(t))return void o.add(e,t)}var a=new u(this._primitives,this._appearanceType,t.fillMaterialProperty,this._closed,this._shadows);a.add(e,t),i.push(a)},c.prototype.remove=function(e){for(var t=this._items,i=t.length,r=i-1;r>=0;r--){var n=t[r];if(n.remove(e)){0===n.updaters.length&&(t.splice(r,1),n.destroy());break}}},c.prototype.update=function(e){var t,i=this._items,r=i.length;for(t=r-1;t>=0;t--){var n=i[t];if(n.invalidated){i.splice(t,1);for(var o=n.updaters.values,a=o.length,s=0;s<a;s++)this.add(e,o[s]);n.destroy()}}var l=!0;for(t=0;t<r;t++)l=i[t].update(e)&&l;return l},c.prototype.getBoundingSphere=function(e,t){for(var i=this._items,r=i.length,n=0;n<r;n++){var o=i[n];if(o.contains(e))return o.getBoundingSphere(e,t)}return a.FAILED},c.prototype.removeAllPrimitives=function(){for(var e=this._items,t=e.length,i=0;i<t;i++)e[i].destroy();this._items.length=0},c}),i("DataSources/StaticGroundGeometryColorBatch",["../Core/AssociativeArray","../Core/Color","../Core/defined","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/ShowGeometryInstanceAttribute","../Scene/GroundPrimitive","./BoundingSphereState","./Property"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(t,i,r){this.primitives=t,this.color=i,this.key=r,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new e,this.updaters=new e,this.updatersWithAttributes=new e,this.attributes=new e,this.subscriptions=new e,this.showsUpdated=new e,this.itemsToRemove=[],this.isDirty=!1}function c(t){this._batches=new e,this._primitives=t}var h=new t,d=new r;u.prototype.add=function(e,t){var i=e.entity.id;if(this.createPrimitive=!0,this.geometry.set(i,t),this.updaters.set(i,e),e.hasConstantFill&&e.fillMaterialProperty.isConstant&&l.isConstant(e.distanceDisplayConditionProperty)){var r=this;this.subscriptions.set(i,e.entity.definitionChanged.addEventListener(function(t,i,n,o){"isShowing"===i&&r.showsUpdated.set(t.id,e)}))}else this.updatersWithAttributes.set(i,e)},u.prototype.remove=function(e){var t=e.entity.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);var r=this.subscriptions.get(t);i(r)&&(r(),this.subscriptions.remove(t))}};var p=new Array(4);return u.prototype.update=function(e){var s,u,c=!0,m=0,f=this.primitive,_=this.primitives;if(this.createPrimitive){var g=this.geometry.values,v=g.length;if(v>0){for(i(f)&&(i(this.oldPrimitive)?_.remove(f):this.oldPrimitive=f),u=0;u<v;u++){var y=g[u],C=y.attributes;s=this.attributes.get(y.id.id),i(s)&&(i(C.show)&&(C.show.value=s.show),i(C.color)&&(C.color.value=s.color))}f=new a({asynchronous:!0,geometryInstances:g}),_.add(f),c=!1}else{i(f)&&(_.remove(f),f=void 0);var w=this.oldPrimitive;i(w)&&(_.remove(w),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=f,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(i(f)&&f.ready){i(this.oldPrimitive)&&(_.remove(this.oldPrimitive),this.oldPrimitive=void 0);var S=this.updatersWithAttributes.values,E=S.length,b=this.waitingOnCreate;for(u=0;u<E;u++){var T=S[u],x=this.geometry.get(T.entity.id);if(s=this.attributes.get(x.id.id),i(s)||(s=f.getGeometryInstanceAttributes(x.id),this.attributes.set(x.id.id,s)),!T.fillMaterialProperty.isConstant||b){var A=T.fillMaterialProperty.color;if(A.getValue(e,h),!t.equals(s._lastColor,h)){s._lastColor=t.clone(h,s._lastColor);var P=this.color,D=h.toBytes(p);P[0]===D[0]&&P[1]===D[1]&&P[2]===D[2]&&P[3]===D[3]||(this.itemsToRemove[m++]=T)}}var M=T.entity.isShowing&&(T.hasConstantFill||T.isFilled(e)),I=1===s.show[0];M!==I&&(s.show=o.toValue(M,s.show));var R=T.distanceDisplayConditionProperty;if(!l.isConstant(R)){var O=R.getValue(e,d);r.equals(O,s._lastDistanceDisplayCondition)||(s._lastDistanceDisplayCondition=r.clone(O,s._lastDistanceDisplayCondition),s.distanceDisplayCondition=n.toValue(O,s.distanceDisplayCondition))}}this.updateShows(f),this.waitingOnCreate=!1}else i(f)&&!f.ready&&(c=!1);return this.itemsToRemove.length=m,c},u.prototype.updateShows=function(e){for(var t=this.showsUpdated.values,r=t.length,n=0;n<r;n++){var a=t[n],s=this.geometry.get(a.entity.id),l=this.attributes.get(s.id.id);i(l)||(l=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,l));var u=a.entity.isShowing,c=1===l.show[0];u!==c&&(l.show=o.toValue(u,l.show))}this.showsUpdated.removeAll()},u.prototype.contains=function(e){return this.updaters.contains(e.id)},u.prototype.getBoundingSphere=function(e,t){var r=this.primitive;if(!r.ready)return s.PENDING;var n=r.getBoundingSphere(e);return i(n)?(n.clone(t),s.DONE):s.FAILED},u.prototype.removeAllPrimitives=function(){var e=this.primitives,t=this.primitive;i(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());var r=this.oldPrimitive;i(r)&&(e.remove(r),this.oldPrimitive=void 0)},c.prototype.add=function(e,t){var i,r=t.createFillGeometryInstance(e),n=this._batches,o=new Uint32Array(r.attributes.color.value.buffer)[0];return n.contains(o)?i=n.get(o):(i=new u(this._primitives,r.attributes.color.value,o),n.set(o,i)),i.add(t,r),i},c.prototype.remove=function(e){for(var t=this._batches.values,i=t.length,r=0;r<i;++r)if(t[r].remove(e))return},c.prototype.update=function(e){var t,i,r=!0,n=this._batches,o=n.values,a=o.length;for(t=0;t<a;++t)r=o[t].update(e)&&r;for(t=0;t<a;++t)for(var s=o[t],l=s.itemsToRemove,u=l.length,c=0;c<u;c++){i=l[c],s.remove(i);var h=this.add(e,i);s.isDirty=!0,h.isDirty=!0}var d=o.slice(),p=d.length;for(t=0;t<p;++t){var m=d[t];m.isDirty&&(r=d[t].update(e)&&r,m.isDirty=!1),0===m.geometry.length&&n.remove(m.key)}return r},c.prototype.getBoundingSphere=function(e,t){for(var i=this._batches.values,r=i.length,n=0;n<r;++n){var o=i[n];if(o.contains(e))return o.getBoundingSphere(e,t)}return s.FAILED},c.prototype.removeAllPrimitives=function(){for(var e=this._batches.values,t=e.length,i=0;i<t;++i)e[i].removeAllPrimitives()},c}),i("DataSources/StaticOutlineGeometryBatch",["../Core/AssociativeArray","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defined","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/ShowGeometryInstanceAttribute","../Scene/PerInstanceColorAppearance","../Scene/Primitive","./BoundingSphereState","./Property"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(t,i,r,n){this.translucent=i,this.width=r,this.shadows=n,this.primitives=t,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new e,this.updaters=new e,this.updatersWithAttributes=new e,this.attributes=new e,this.itemsToRemove=[],this.subscriptions=new e,this.showsUpdated=new e}function d(t,i,r){this._primitives=t,this._scene=i,this._shadows=r,this._solidBatches=new e,this._translucentBatches=new e}h.prototype.add=function(e,t){var i=e.entity.id;if(this.createPrimitive=!0,this.geometry.set(i,t),this.updaters.set(i,e),e.hasConstantOutline&&e.outlineColorProperty.isConstant&&c.isConstant(e.distanceDisplayConditionProperty)){var r=this;this.subscriptions.set(i,e.entity.definitionChanged.addEventListener(function(t,i,n,o){"isShowing"===i&&r.showsUpdated.set(t.id,e)}))}else this.updatersWithAttributes.set(i,e)},h.prototype.remove=function(e){var t=e.entity.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);var i=this.subscriptions.get(t);r(i)&&(i(),this.subscriptions.remove(t))}};var p=new t,m=new n;return h.prototype.update=function(e){var u,h,d=!0,f=0,_=this.primitive,g=this.primitives;if(this.createPrimitive){var v=this.geometry.values,y=v.length;if(y>0){for(r(_)&&(r(this.oldPrimitive)?g.remove(_):this.oldPrimitive=_),h=0;h<y;h++){var C=v[h],w=C.attributes;u=this.attributes.get(C.id.id),r(u)&&(r(w.show)&&(w.show.value=u.show),r(w.color)&&(w.color.value=u.color))}_=new l({asynchronous:!0,geometryInstances:v,appearance:new s({flat:!0,translucent:this.translucent,renderState:{lineWidth:this.width}}),shadows:this.shadows}),g.add(_),d=!1}else{r(_)&&(g.remove(_),_=void 0);var S=this.oldPrimitive;r(S)&&(g.remove(S),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=_,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(r(_)&&_.ready){r(this.oldPrimitive)&&(g.remove(this.oldPrimitive),this.oldPrimitive=void 0);var E=this.updatersWithAttributes.values,b=E.length,T=this.waitingOnCreate;for(h=0;h<b;h++){var x=E[h],A=this.geometry.get(x.entity.id);if(u=this.attributes.get(A.id.id),r(u)||(u=_.getGeometryInstanceAttributes(A.id),this.attributes.set(A.id.id,u)),!x.outlineColorProperty.isConstant||T){var P=x.outlineColorProperty;P.getValue(e,p),t.equals(u._lastColor,p)||(u._lastColor=t.clone(p,u._lastColor),u.color=i.toValue(p,u.color),(this.translucent&&255===u.color[3]||!this.translucent&&255!==u.color[3])&&(this.itemsToRemove[f++]=x))}var D=x.entity.isShowing&&(x.hasConstantOutline||x.isOutlineVisible(e)),M=1===u.show[0];D!==M&&(u.show=a.toValue(D,u.show));var I=x.distanceDisplayConditionProperty;if(!c.isConstant(I)){var R=I.getValue(e,m);n.equals(R,u._lastDistanceDisplayCondition)||(u._lastDistanceDisplayCondition=n.clone(R,u._lastDistanceDisplayCondition),u.distanceDisplayCondition=o.toValue(R,u.distanceDisplayCondition))}}this.updateShows(_),this.waitingOnCreate=!1}else r(_)&&!_.ready&&(d=!1);return this.itemsToRemove.length=f,d},h.prototype.updateShows=function(e){for(var t=this.showsUpdated.values,i=t.length,n=0;n<i;n++){var o=t[n],s=this.geometry.get(o.entity.id),l=this.attributes.get(s.id.id);r(l)||(l=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,l));var u=o.entity.isShowing,c=1===l.show[0];u!==c&&(l.show=a.toValue(u,l.show))}this.showsUpdated.removeAll()},h.prototype.contains=function(e){return this.updaters.contains(e.id)},h.prototype.getBoundingSphere=function(e,t){var i=this.primitive;if(!i.ready)return u.PENDING;var n=i.getGeometryInstanceAttributes(e);return!r(n)||!r(n.boundingSphere)||r(n.show)&&0===n.show[0]?u.FAILED:(n.boundingSphere.clone(t),u.DONE)},h.prototype.removeAllPrimitives=function(){var e=this.primitives,t=this.primitive;r(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());var i=this.oldPrimitive;r(i)&&(e.remove(i),this.oldPrimitive=void 0)},d.prototype.add=function(e,t){var i,n,o=t.createOutlineGeometryInstance(e),a=this._scene.clampLineWidth(t.outlineWidth);255===o.attributes.color.value[3]?(i=this._solidBatches,n=i.get(a),r(n)||(n=new h(this._primitives,!1,a,this._shadows),i.set(a,n)),n.add(t,o)):(i=this._translucentBatches,n=i.get(a),r(n)||(n=new h(this._primitives,!0,a,this._shadows),i.set(a,n)),n.add(t,o))},d.prototype.remove=function(e){var t,i=this._solidBatches.values,r=i.length;for(t=0;t<r;t++)if(i[t].remove(e))return;var n=this._translucentBatches.values,o=n.length;for(t=0;t<o;t++)if(n[t].remove(e))return},d.prototype.update=function(e){var t,i,r,n,o,a=this._solidBatches.values,s=a.length,l=this._translucentBatches.values,u=l.length,c=!0,h=!1;do{for(h=!1,i=0;i<s;i++){n=a[i],c=n.update(e),o=n.itemsToRemove;var d=o.length;if(d>0)for(h=!0,t=0;t<d;t++)r=o[t],n.remove(r),this.add(e,r)}for(i=0;i<u;i++){n=l[i],c=n.update(e),o=n.itemsToRemove;var p=o.length;if(p>0)for(h=!0,t=0;t<p;t++)r=o[t],n.remove(r),this.add(e,r)}}while(h);return c},d.prototype.getBoundingSphere=function(e,t){var i,r=this._solidBatches.values,n=r.length;for(i=0;i<n;i++){var o=r[i];if(o.contains(e))return o.getBoundingSphere(e,t)}var a=this._translucentBatches.values,s=a.length;for(i=0;i<s;i++){var l=a[i];if(l.contains(e))return l.getBoundingSphere(e,t)}return u.FAILED},d.prototype.removeAllPrimitives=function(){var e,t=this._solidBatches.values,i=t.length;for(e=0;e<i;e++)t[e].removeAllPrimitives();var r=this._translucentBatches.values,n=r.length;for(e=0;e<n;e++)r[e].removeAllPrimitives()},d}),i("DataSources/GeometryVisualizer",["../Core/AssociativeArray","../Core/BoundingSphere","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Scene/ShadowMode","./BoundingSphereState","./ColorMaterialProperty","./StaticGeometryColorBatch","./StaticGeometryPerMaterialBatch","./StaticGroundGeometryColorBatch","./StaticOutlineGeometryBatch"],function(e,t,i,r,n,o,a,s,l,u,c,h){"use strict";function d(t,i){this._primitives=t,this._groundPrimitives=i,this._dynamicUpdaters=new e}function p(e,t){for(var i=e._batches,r=i.length,n=0;n<r;n++)i[n].remove(t)}function m(e,t,i){if(i.isDynamic)return void e._dynamicBatch.add(t,i);var r;(i.outlineEnabled||i.fillEnabled)&&(r=i.shadowsProperty.getValue(t)),i.outlineEnabled&&e._outlineBatches[r].add(t,i),i.fillEnabled&&(i.onTerrain?e._groundColorBatch.add(t,i):i.isClosed?i.fillMaterialProperty instanceof s?e._closedColorBatches[r].add(t,i):e._closedMaterialBatches[r].add(t,i):i.fillMaterialProperty instanceof s?e._openColorBatches[r].add(t,i):e._openMaterialBatches[r].add(t,i))}function f(t,i,r){this._type=t;var n=i.primitives,a=i.groundPrimitives;this._scene=i,this._primitives=n,this._groundPrimitives=a,this._entityCollection=void 0,this._addedObjects=new e,this._removedObjects=new e,this._changedObjects=new e;var s=o.NUMBER_OF_SHADOW_MODES;this._outlineBatches=new Array(s),this._closedColorBatches=new Array(s),this._closedMaterialBatches=new Array(s),this._openColorBatches=new Array(s),this._openMaterialBatches=new Array(s);for(var p=0;p<s;++p)this._outlineBatches[p]=new h(n,i,p),this._closedColorBatches[p]=new l(n,t.perInstanceColorAppearanceType,!0,p),this._closedMaterialBatches[p]=new u(n,t.materialAppearanceType,!0,p),this._openColorBatches[p]=new l(n,t.perInstanceColorAppearanceType,!1,p),this._openMaterialBatches[p]=new u(n,t.materialAppearanceType,!1,p);this._groundColorBatch=new c(a),this._dynamicBatch=new d(n,a),this._batches=this._outlineBatches.concat(this._closedColorBatches,this._closedMaterialBatches,this._openColorBatches,this._openMaterialBatches,this._groundColorBatch,this._dynamicBatch),this._subscriptions=new e,this._updaters=new e,this._entityCollection=r,r.collectionChanged.addEventListener(f.prototype._onCollectionChanged,this),this._onCollectionChanged(r,r.values,_)}var _=[];d.prototype.add=function(e,t){this._dynamicUpdaters.set(t.entity.id,t.createDynamicUpdater(this._primitives,this._groundPrimitives))},d.prototype.remove=function(e){var t=e.entity.id,r=this._dynamicUpdaters.get(t);i(r)&&(this._dynamicUpdaters.remove(t),r.destroy())},d.prototype.update=function(e){for(var t=this._dynamicUpdaters.values,i=0,r=t.length;i<r;i++)t[i].update(e); +return!0},d.prototype.removeAllPrimitives=function(){for(var e=this._dynamicUpdaters.values,t=0,i=e.length;t<i;t++)e[t].destroy();this._dynamicUpdaters.removeAll()},d.prototype.getBoundingSphere=function(e,t){var r=this._dynamicUpdaters.get(e.id);return i(r)&&i(r.getBoundingSphere)?r.getBoundingSphere(e,t):a.FAILED},f.prototype.update=function(e){var t,i,r,n,o=this._addedObjects,a=o.values,s=this._removedObjects,l=s.values,u=this._changedObjects,c=u.values;for(t=c.length-1;t>-1;t--)i=c[t],r=i.id,n=this._updaters.get(r),n.entity===i?(p(this,n),m(this,e,n)):(l.push(i),a.push(i));for(t=l.length-1;t>-1;t--)i=l[t],r=i.id,n=this._updaters.get(r),p(this,n),n.destroy(),this._updaters.remove(r),this._subscriptions.get(r)(),this._subscriptions.remove(r);for(t=a.length-1;t>-1;t--)i=a[t],r=i.id,n=new this._type(i,this._scene),this._updaters.set(r,n),m(this,e,n),this._subscriptions.set(r,n.geometryChanged.addEventListener(f._onGeometryChanged,this));o.removeAll(),s.removeAll(),u.removeAll();var h=!0,d=this._batches,_=d.length;for(t=0;t<_;t++)h=d[t].update(e)&&h;return h};var g=[],v=new t;return f.prototype.getBoundingSphere=function(e,i){for(var r=g,n=v,o=0,s=a.DONE,l=this._batches,u=l.length,c=0;c<u;c++){if(s=l[c].getBoundingSphere(e,n),s===a.PENDING)return a.PENDING;s===a.DONE&&(r[o]=t.clone(n,r[o]),o++)}return 0===o?a.FAILED:(r.length=o,t.fromBoundingSpheres(r,i),a.DONE)},f.prototype.isDestroyed=function(){return!1},f.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(f.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();var e,t=this._batches,i=t.length;for(e=0;e<i;e++)t[e].removeAllPrimitives();var n=this._subscriptions.values;for(i=n.length,e=0;e<i;e++)n[e]();return this._subscriptions.removeAll(),r(this)},f._onGeometryChanged=function(e){var t=this._removedObjects,r=this._changedObjects,n=e.entity,o=n.id;i(t.get(o))||i(r.get(o))||r.set(o,n)},f.prototype._onCollectionChanged=function(e,t,i){var r,n,o,a=this._addedObjects,s=this._removedObjects,l=this._changedObjects;for(r=i.length-1;r>-1;r--)o=i[r],n=o.id,a.remove(n)||(s.set(n,o),l.remove(n));for(r=t.length-1;r>-1;r--)o=t[r],n=o.id,s.remove(n)?l.set(n,o):a.set(n,o)},f}),i("DataSources/LabelVisualizer",["../Core/AssociativeArray","../Core/Cartesian2","../Core/Cartesian3","../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/NearFarScalar","../Scene/HeightReference","../Scene/HorizontalOrigin","../Scene/LabelStyle","../Scene/VerticalOrigin","./BoundingSphereState","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f){"use strict";function _(e){this.entity=e,this.label=void 0,this.index=void 0}function g(t,i){i.collectionChanged.addEventListener(g.prototype._onCollectionChanged,this),this._cluster=t,this._entityCollection=i,this._items=new e,this._onCollectionChanged(i,i.values,[],[])}function v(e,t,i){o(e)&&(e.label=void 0,i.removeLabel(t))}var y=1,C="30px sans-serif",w=d.FILL,S=r.WHITE,E=r.BLACK,b=1,T=!1,x=new r(.165,.165,.165,.8),A=new t(7,5),P=t.ZERO,D=i.ZERO,M=c.NONE,I=h.CENTER,R=p.CENTER,O=new i,N=new r,L=new r,B=new r,F=new t,V=new i,k=new t,z=new u,U=new u,G=new l;return g.prototype.update=function(e){for(var t=this._items.values,i=this._cluster,r=0,n=t.length;r<n;r++){var a,s=t[r],l=s.entity,u=l._label,c=s.label,h=l.isShowing&&l.isAvailable(e)&&f.getValueOrDefault(u._show,e,!0);h&&(O=f.getValueOrUndefined(l._position,e,O),a=f.getValueOrUndefined(u._text,e),h=o(O)&&o(a)),h?(f.isConstant(l._position)||(i._clusterDirty=!0),o(c)||(c=i.getLabel(l),c.id=l,s.label=c),c.show=!0,c.position=O,c.text=a,c.scale=f.getValueOrDefault(u._scale,e,y),c.font=f.getValueOrDefault(u._font,e,C),c.style=f.getValueOrDefault(u._style,e,w),c.fillColor=f.getValueOrDefault(u._fillColor,e,S,N),c.outlineColor=f.getValueOrDefault(u._outlineColor,e,E,L),c.outlineWidth=f.getValueOrDefault(u._outlineWidth,e,b),c.showBackground=f.getValueOrDefault(u._showBackground,e,T),c.backgroundColor=f.getValueOrDefault(u._backgroundColor,e,x,B),c.backgroundPadding=f.getValueOrDefault(u._backgroundPadding,e,A,F),c.pixelOffset=f.getValueOrDefault(u._pixelOffset,e,P,k),c.eyeOffset=f.getValueOrDefault(u._eyeOffset,e,D,V),c.heightReference=f.getValueOrDefault(u._heightReference,e,M),c.horizontalOrigin=f.getValueOrDefault(u._horizontalOrigin,e,I),c.verticalOrigin=f.getValueOrDefault(u._verticalOrigin,e,R),c.translucencyByDistance=f.getValueOrUndefined(u._translucencyByDistance,e,z),c.pixelOffsetScaleByDistance=f.getValueOrUndefined(u._pixelOffsetScaleByDistance,e,U),c.distanceDisplayCondition=f.getValueOrUndefined(u._distanceDisplayCondition,e,G)):v(s,l,i)}return!0},g.prototype.getBoundingSphere=function(e,t){var r=this._items.get(e.id);if(!o(r)||!o(r.label))return m.FAILED;var a=r.label;return t.center=i.clone(n(a._clampedPosition,a.position),t.center),t.radius=0,m.DONE},g.prototype.isDestroyed=function(){return!1},g.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(g.prototype._onCollectionChanged,this);for(var e=this._entityCollection.values,t=0;t<e.length;t++)this._cluster.removeLabel(e[t]);return a(this)},g.prototype._onCollectionChanged=function(e,t,i,r){var n,a,s=this._items,l=this._cluster;for(n=t.length-1;n>-1;n--)a=t[n],o(a._label)&&o(a._position)&&s.set(a.id,new _(a));for(n=r.length-1;n>-1;n--)a=r[n],o(a._label)&&o(a._position)?s.contains(a.id)||s.set(a.id,new _(a)):(v(s.get(a.id),a,l),s.remove(a.id));for(n=i.length-1;n>-1;n--)a=i[n],v(s.get(a.id),a,l),s.remove(a.id)},g}),i("ThirdParty/gltfDefaults",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/Quaternion","../Core/WebGLConstants"],function(e,t,i,r,n){"use strict";function o(e){i(e.accessors)||(e.accessors={});var r=e.accessors;for(var n in r)if(r.hasOwnProperty(n)){var o=r[n];o.byteStride=t(o.byteStride,0)}}function a(e){i(e.animations)||(e.animations={});var r=e.animations;for(var n in r)if(r.hasOwnProperty(n)){var o=r[n];i(o.channels)||(o.channels=[]),i(o.parameters)||(o.parameters={}),i(o.samplers)||(o.samplers={});var a=r.samplers;for(var s in a)if(a.hasOwnProperty(s)){var l=a[s];l.interpolation=t(l.interpolation,"LINEAR")}}}function s(e){i(e.asset)||(e.asset={});var r=e.asset;i(r.profile)&&"string"!=typeof r.profile||(r.profile={});var n=r.profile;r.premultipliedAlpha=t(r.premultipliedAlpha,!1),n.api=t(n.api,"WebGL"),n.version=t(n.version,"1.0.2"),i(e.version)&&(r.version=t(r.version,e.version),delete e.version),"number"==typeof r.version&&(r.version=r.version.toFixed(1).toString())}function l(e){i(e.buffers)||(e.buffers={});var r=e.buffers;for(var n in r)if(r.hasOwnProperty(n)){var o=r[n];o.type=t(o.type,"arraybuffer")}}function u(e){i(e.bufferViews)||(e.bufferViews={})}function c(e){i(e.cameras)||(e.cameras={})}function h(e){i(e.images)||(e.images={})}function d(e){i(e.extensions)||(e.extensions={});var r=e.extensions;i(r.KHR_materials_common)||(r.KHR_materials_common={});var n=r.KHR_materials_common;i(e.lights)?(n.lights=e.lights,delete e.lights):i(n.lights)||(n.lights={});var o=n.lights;for(var a in o)if(o.hasOwnProperty(a)){var s=o[a];if("ambient"===s.type){i(s.ambient)||(s.ambient={});var l=s.ambient;i(l.color)||(l.color=[1,1,1])}else if("directional"===s.type){i(s.directional)||(s.directional={});var u=s.directional;i(u.color)||(u.color=[1,1,1])}else if("point"===s.type){i(s.point)||(s.point={});var c=s.point;i(c.color)||(c.color=[1,1,1]),c.constantAttenuation=t(c.constantAttenuation,1),c.linearAttenuation=t(c.linearAttenuation,0),c.quadraticAttenuation=t(c.quadraticAttenuation,0)}else if("spot"===s.type){i(s.spot)||(s.spot={});var h=s.spot;i(h.color)||(h.color=[1,1,1]),h.constantAttenuation=t(h.constantAttenuation,1),h.fallOffAngle=t(h.fallOffAngle,3.14159265),h.fallOffExponent=t(h.fallOffExponent,0),h.linearAttenuation=t(h.linearAttenuation,0),h.quadraticAttenuation=t(h.quadraticAttenuation,0)}}}function p(e){i(e.materials)||(e.materials={});var t=e.materials;for(var r in t)if(t.hasOwnProperty(r)){var o=t[r],a=o.instanceTechnique;if(i(a)&&(o.technique=a.technique,o.values=a.values,delete o.instanceTechnique),!i(o.extensions))if(i(o.technique))i(o.values)||(o.values={});else{delete o.values,o.extensions={KHR_materials_common:{technique:"CONSTANT",transparent:!1,values:{emission:{type:n.FLOAT_VEC4,value:[.5,.5,.5,1]}}}},i(e.extensionsUsed)||(e.extensionsUsed=[]);var s=e.extensionsUsed;s.indexOf("KHR_materials_common")===-1&&s.push("KHR_materials_common")}}}function m(e){i(e.meshes)||(e.meshes={});var r=e.meshes;for(var o in r)if(r.hasOwnProperty(o)){var a=r[o];i(a.primitives)||(a.primitives=[]);for(var s=a.primitives.length,l=s.length,u=0;u<l;++u){var c=s[u];i(c.attributes)||(c.attributes={});var h=t(c.primitive,n.TRIANGLES);c.mode=t(c.mode,h)}}}function f(t){i(t.nodes)||(t.nodes={});var n=t.nodes,o=parseFloat(t.asset.version)<1,a=new e,s=new r;for(var l in n)if(n.hasOwnProperty(l)){var u=n[l];if(i(u.children)||(u.children=[]),o&&i(u.rotation)){var c=u.rotation;e.fromArray(c,0,a),r.fromAxisAngle(a,c[3],s),u.rotation=[s.x,s.y,s.z,s.w]}i(u.matrix)||(i(u.translation)||i(u.rotation)||i(u.scale)?(i(u.translation)||(u.translation=[0,0,0]),i(u.rotation)||(u.rotation=[0,0,0,1]),i(u.scale)||(u.scale=[1,1,1])):u.matrix=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);var h=u.instanceSkin;i(h)&&(u.skeletons=h.skeletons,u.skin=h.skin,u.meshes=h.meshes,delete u.instanceSkin)}}function _(e){i(e.programs)||(e.programs={});var t=e.programs;for(var r in t)if(t.hasOwnProperty(r)){var n=t[r];i(n.attributes)||(n.attributes=[])}}function g(e){i(e.samplers)||(e.samplers={});var r=e.samplers;for(var o in r)if(r.hasOwnProperty(o)){var a=r[o];a.magFilter=t(a.magFilter,n.LINEAR),a.minFilter=t(a.minFilter,n.NEAREST_MIPMAP_LINEAR),a.wrapS=t(a.wrapS,n.REPEAT),a.wrapT=t(a.wrapT,n.REPEAT)}}function v(e){i(e.scenes)||(e.scenes={});var t=e.scenes;for(var r in t)if(t.hasOwnProperty(r)){var n=t[r];i(n.node)||(n.node=[])}}function y(e){i(e.shaders)||(e.shaders={})}function C(e){i(e.skins)||(e.skins={});var t=e.skins;for(var r in t)if(t.hasOwnProperty(r)){var n=t[r];i(n.bindShapeMatrix)||(n.bindShapeMatrix=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}}function w(e){i(e.enable)||(e.enable=[]),i(e.disable)||(e.disable=[])}function S(e){i(e.techniques)||(e.techniques={});var r=e.techniques;for(var n in r)if(r.hasOwnProperty(n)){var o=r[n];i(o.parameters)||(o.parameters={});var a=o.parameters;for(var s in a){var l=a[s];l.node=t(l.node,l.source),l.source=void 0}var u=o.passes;if(i(u)){var c=t(o.pass,"defaultPass");if(u.hasOwnProperty(c)){var h=u[c],d=h.instanceProgram;o.attributes=t(o.attributes,d.attributes),o.program=t(o.program,d.program),o.uniforms=t(o.uniforms,d.uniforms),o.states=t(o.states,h.states)}o.passes=void 0,o.pass=void 0}i(o.attributes)||(o.attributes={}),i(o.uniforms)||(o.uniforms={}),i(o.states)||(o.states={}),w(o.states)}}function E(e){i(e.textures)||(e.textures={});var r=e.textures;for(var o in r)if(r.hasOwnProperty(o)){var a=r[o];a.format=t(a.format,n.RGBA),a.internalFormat=t(a.internalFormat,a.format),a.target=t(a.target,n.TEXTURE_2D),a.type=t(a.type,n.UNSIGNED_BYTE)}}var b=function(e){if(i(e))return i(e.allExtensions)&&(e.extensionsUsed=e.allExtensions,e.allExtensions=void 0),e.extensionsUsed=t(e.extensionsUsed,[]),o(e),a(e),s(e),l(e),u(e),c(e),h(e),d(e),p(e),m(e),f(e),_(e),g(e),v(e),y(e),C(e),S(e),E(e),e};return b}),i("Scene/getAttributeOrUniformBySemantic",[],function(){"use strict";function e(e,t){var i=e.techniques;for(var r in i)if(i.hasOwnProperty(r)){var n=i[r],o=n.parameters,a=n.attributes,s=n.uniforms;for(var l in a)if(a.hasOwnProperty(l)&&o[a[l]].semantic===t)return l;for(var u in s)if(s.hasOwnProperty(u)&&o[s[u]].semantic===t)return u}}return e}),i("Scene/getBinaryAccessor",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/ComponentDatatype","../Core/Matrix2","../Core/Matrix3","../Core/Matrix4"],function(e,t,i,r,n,o,a){"use strict";function s(e){var t,i=e.componentType;t="string"==typeof i?r.fromName(i):i;var n=l[e.type],o=u[e.type];return{componentsPerAttribute:n,classType:o,createArrayBufferView:function(e,i,o){return r.createArrayBufferView(t,e,i,n*o)}}}var l={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},u={SCALAR:void 0,VEC2:e,VEC3:t,VEC4:i,MAT2:n,MAT3:o,MAT4:a};return s}),i("Scene/ModelAnimationCache",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/LinearSpline","../Core/Matrix4","../Core/Quaternion","../Core/QuaternionSpline","../Core/WebGLConstants","./getBinaryAccessor"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(){}function c(e,i){var r=e.gltf,n=r.buffers,o=r.bufferViews,a=o[i.bufferView],s=n[a.buffer],u=a.byteOffset+i.byteOffset,c=i.count*l(i).componentsPerAttribute;return e.cacheKey+"//"+t(s.path,"")+"/"+u+"/"+c}function h(e,t,i){return e.cacheKey+"//"+t+"/"+i}function d(e){this._value=e}var p={},m=new e;u.getAnimationParameterValues=function(t,r){var n=c(t,r),a=p[n];if(!i(a)){var u,h=t._loadResources,d=t.gltf,f=parseFloat(d.asset.version)<1,_=d.bufferViews,g=_[r.bufferView],v=r.componentType,y=r.type,C=r.count,w=h.getBuffer(g),S=l(r).createArrayBufferView(w.buffer,w.byteOffset+r.byteOffset,C);if(v===s.FLOAT&&"SCALAR"===y)a=S;else if(v===s.FLOAT&&"VEC3"===y)for(a=new Array(C),u=0;u<C;++u)a[u]=e.fromArray(S,3*u);else if(v===s.FLOAT&&"VEC4"===y)for(a=new Array(C),u=0;u<C;++u){var E=4*u;f?a[u]=o.fromAxisAngle(e.fromArray(S,E,m),S[E+3]):a[u]=o.unpack(S,E)}i(t.cacheKey)&&(p[n]=a)}return a};var f={};d.prototype.evaluate=function(e,t){return this._value},u.getAnimationSpline=function(e,t,n,o,l,u){var c=h(e,t,o),p=f[c];if(!i(p)){var m=u[l.input],_=e.gltf.accessors[n.parameters[l.output]],g=u[l.output];if(1===m.length&&1===g.length)p=new d(g[0]);else{var v=_.componentType,y=_.type;"LINEAR"===l.interpolation&&(v===s.FLOAT&&"VEC3"===y?p=new r({times:m,points:g}):v===s.FLOAT&&"VEC4"===y&&(p=new a({times:m,points:g})))}i(e.cacheKey)&&(f[c]=p)}return p};var _={};return u.getSkinInverseBindMatrices=function(e,t){var r=c(e,t),o=_[r];if(!i(o)){var a=e._loadResources,u=e.gltf,h=u.bufferViews,d=h[t.bufferView],p=t.componentType,m=t.type,f=t.count,g=a.getBuffer(d),v=l(t).createArrayBufferView(g.buffer,g.byteOffset+t.byteOffset,f);if(o=new Array(f),p===s.FLOAT&&"MAT4"===m)for(var y=0;y<f;++y)o[y]=n.fromArray(v,16*y);_[r]=o}return o},u}),i("Scene/ModelAnimationLoop",["../Core/freezeObject"],function(e){"use strict";var t={NONE:0,REPEAT:1,MIRRORED_REPEAT:2};return e(t)}),i("Scene/ModelAnimationState",["../Core/freezeObject"],function(e){"use strict";return e({STOPPED:0,ANIMATING:1})}),i("Scene/ModelAnimation",["../Core/defaultValue","../Core/defineProperties","../Core/Event","../Core/JulianDate","./ModelAnimationLoop","./ModelAnimationState"],function(e,t,i,r,n,o){"use strict";function a(t,a,s){this._name=t.name,this._startTime=r.clone(t.startTime),this._delay=e(t.delay,0),this._stopTime=t.stopTime,this.removeOnStop=e(t.removeOnStop,!1),this._speedup=e(t.speedup,1),this._reverse=e(t.reverse,!1),this._loop=e(t.loop,n.NONE),this.start=new i,this.update=new i,this.stop=new i,this._state=o.STOPPED,this._runtimeAnimation=s,this._computedStartTime=void 0,this._duration=void 0;var l=this;this._raiseStartEvent=function(){l.start.raiseEvent(a,l)},this._updateEventTime=0,this._raiseUpdateEvent=function(){l.update.raiseEvent(a,l,l._updateEventTime)},this._raiseStopEvent=function(){l.stop.raiseEvent(a,l)}}return t(a.prototype,{name:{get:function(){return this._name}},startTime:{get:function(){return this._startTime}},delay:{get:function(){return this._delay}},stopTime:{get:function(){return this._stopTime}},speedup:{get:function(){return this._speedup}},reverse:{get:function(){return this._reverse}},loop:{get:function(){return this._loop}}}),a}),i("Scene/ModelAnimationCollection",["../Core/clone","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/JulianDate","../Core/Math","./ModelAnimation","./ModelAnimationLoop","./ModelAnimationState"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(e){this.animationAdded=new o,this.animationRemoved=new o,this._model=e,this._scheduledAnimations=[],this._previousTime=void 0}function d(e,t){for(var i=e.channelEvaluators,r=i.length,n=0;n<r;++n)i[n](t)}function p(e,t,i){return function(){e.animationRemoved.raiseEvent(t,i)}}r(h.prototype,{length:{get:function(){return this._scheduledAnimations.length}}}),h.prototype.add=function(e){e=t(e,t.EMPTY_OBJECT);var i=this._model,r=i._runtime.animations,n=r[e.name],o=new l(e,i,n);return this._scheduledAnimations.push(o),this.animationAdded.raiseEvent(i,o),o},h.prototype.addAll=function(i){i=t(i,t.EMPTY_OBJECT),i=e(i);for(var r=[],n=this._model._animationIds,o=n.length,a=0;a<o;++a)i.name=n[a],r.push(this.add(i));return r},h.prototype.remove=function(e){if(i(e)){var t=this._scheduledAnimations,r=t.indexOf(e);if(r!==-1)return t.splice(r,1),this.animationRemoved.raiseEvent(this._model,e),!0}return!1},h.prototype.removeAll=function(){var e=this._model,t=this._scheduledAnimations,i=t.length;this._scheduledAnimations=[];for(var r=0;r<i;++r)this.animationRemoved.raiseEvent(e,t[r])},h.prototype.contains=function(e){return!!i(e)&&this._scheduledAnimations.indexOf(e)!==-1},h.prototype.get=function(e){return this._scheduledAnimations[e]};var m=[];return h.prototype.update=function(e){var r=this._scheduledAnimations,n=r.length;if(0===n)return this._previousTime=void 0,!1;if(a.equals(e.time,this._previousTime))return!1;this._previousTime=a.clone(e.time,this._previousTime);for(var o=!1,l=e.time,h=this._model,f=0;f<n;++f){var _=r[f],g=_._runtimeAnimation;i(_._computedStartTime)||(_._computedStartTime=a.addSeconds(t(_.startTime,l),_.delay,new a)),i(_._duration)||(_._duration=g.stopTime*(1/_.speedup));var v=_._computedStartTime,y=_._duration,C=_.stopTime,w=0!==y?a.secondsDifference(l,v)/y:0,S=w>=0,E=_.loop===u.REPEAT||_.loop===u.MIRRORED_REPEAT,b=(S||E&&!i(_.startTime))&&(w<=1||E)&&(!i(C)||a.lessThanOrEquals(l,C));if(b){if(_._state===c.STOPPED&&(_._state=c.ANIMATING,_.start.numberOfListeners>0&&e.afterRender.push(_._raiseStartEvent)),_.loop===u.REPEAT)w-=Math.floor(w);else if(_.loop===u.MIRRORED_REPEAT){var T=Math.floor(w),x=w-T;w=T%2===1?1-x:x}_.reverse&&(w=1-w);var A=w*y*_.speedup;A=s.clamp(A,g.startTime,g.stopTime),d(g,A),_.update.numberOfListeners>0&&(_._updateEventTime=A,e.afterRender.push(_._raiseUpdateEvent)),o=!0}else S&&_._state===c.ANIMATING&&(_._state=c.STOPPED,_.stop.numberOfListeners>0&&e.afterRender.push(_._raiseStopEvent),_.removeOnStop&&m.push(_))}n=m.length;for(var P=0;P<n;++P){var D=m[P];r.splice(r.indexOf(D),1),e.afterRender.push(p(this,h,D))}return m.length=0,o},h}),i("Scene/ModelMaterial",["../Core/defined","../Core/defineProperties","../Core/DeveloperError"],function(e,t,i){"use strict";function r(e,t,i){this._name=t.name,this._id=i,this._uniformMap=e._uniformMaps[i]}return t(r.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}}}),r.prototype.setValue=function(e,t){var i=this._uniformMap.values[e];i.value=i.clone(t,i.value)},r.prototype.getValue=function(t){var i=this._uniformMap.values[t];if(e(i))return i.value},r}),i("Scene/modelMaterialsCommon",["../Core/defaultValue","../Core/defined","../Core/WebGLConstants"],function(e,t,i){"use strict";function r(e){switch(e){case i.FLOAT:return"float";case i.FLOAT_VEC2:return"vec2";case i.FLOAT_VEC3:return"vec3";case i.FLOAT_VEC4:return"vec4";case i.FLOAT_MAT2:return"mat2";case i.FLOAT_MAT3:return"mat3";case i.FLOAT_MAT4:return"mat4";case i.SAMPLER_2D:return"sampler2D"}}function n(e){var r,n={};if(t(e.extensions)&&t(e.extensions.KHR_materials_common)&&(r=e.extensions.KHR_materials_common.lights),t(r)){var o=e.nodes;for(var a in o)if(o.hasOwnProperty(a)){var s=o[a];if(t(s.extensions)&&t(s.extensions.KHR_materials_common)){var l=s.extensions.KHR_materials_common.light;t(l)&&t(r[l])&&(r[l].node=a),delete s.extensions.KHR_materials_common}}var u=0;for(var c in r)if(r.hasOwnProperty(c)){var h=r[c],d=h.type;if("ambient"!==d&&!t(h.node)){delete r[c];continue}var p="light"+u.toString();switch(h.baseName=p,d){case"ambient":var m=h.ambient;n[p+"Color"]={type:i.FLOAT_VEC3,value:m.color};break;case"directional":var f=h.directional;n[p+"Color"]={type:i.FLOAT_VEC3,value:f.color},t(h.node)&&(n[p+"Transform"]={node:h.node,semantic:"MODELVIEW",type:i.FLOAT_MAT4});break;case"point":var _=h.point;n[p+"Color"]={type:i.FLOAT_VEC3,value:_.color},t(h.node)&&(n[p+"Transform"]={node:h.node,semantic:"MODELVIEW",type:i.FLOAT_MAT4}),n[p+"Attenuation"]={type:i.FLOAT_VEC3,value:[_.constantAttenuation,_.linearAttenuation,_.quadraticAttenuation]};break;case"spot":var g=h.spot;n[p+"Color"]={type:i.FLOAT_VEC3,value:g.color},t(h.node)&&(n[p+"Transform"]={node:h.node,semantic:"MODELVIEW",type:i.FLOAT_MAT4},n[p+"InverseTransform"]={node:h.node,semantic:"MODELVIEWINVERSE",type:i.FLOAT_MAT4,useInFragment:!0}),n[p+"Attenuation"]={type:i.FLOAT_VEC3,value:[g.constantAttenuation,g.linearAttenuation,g.quadraticAttenuation]},n[p+"FallOff"]={type:i.FLOAT_VEC2,value:[g.fallOffAngle,g.fallOffExponent]}}++u}}return n}function o(i,r,n){var o,a=e(n,0);do o=r+(a++).toString();while(t(i[o]));return o}function a(n,a,l){var u,m=n.techniques,f=n.shaders,_=n.programs,g=a.technique.toUpperCase();t(n.extensions)&&t(n.extensions.KHR_materials_common)&&(u=n.extensions.KHR_materials_common.lights);var v=e(a.jointCount,0),y=v>0,C=a.values,w="precision highp float;\n",S="precision highp float;\n",E=o(m,"technique",c),b=o(f,"vertexShader",h),T=o(f,"fragmentShader",d),x=o(_,"program",p),A="CONSTANT"!==g,P={modelViewMatrix:{semantic:"MODELVIEW",type:i.FLOAT_MAT4},projectionMatrix:{semantic:"PROJECTION",type:i.FLOAT_MAT4}};A&&(P.normalMatrix={semantic:"MODELVIEWINVERSETRANSPOSE",type:i.FLOAT_MAT3}),y&&(P.jointMatrix={count:v,semantic:"JOINTMATRIX",type:i.FLOAT_MAT4});var D,M=!1;for(var I in C)if(C.hasOwnProperty(I)&&"transparent"!==I&&"doubleSided"!==I){var R=s(I,C[I]);D=I.toLowerCase(),M||R!==i.SAMPLER_2D||(M=!0),P[D]={type:R}}if(t(l))for(var O in l)l.hasOwnProperty(O)&&(P[O]=l[O]);var N={};for(var L in P)if(P.hasOwnProperty(L)){var B=P[L];N["u_"+L]=L;var F=t(B.count)?"["+B.count+"]":"";B.type!==i.FLOAT_MAT3&&B.type!==i.FLOAT_MAT4||B.useInFragment?(S+="uniform "+r(B.type)+" u_"+L+F+";\n",delete B.useInFragment):w+="uniform "+r(B.type)+" u_"+L+F+";\n"}var V="";y&&(V+=" mat4 skinMat = a_weight.x * u_jointMatrix[int(a_joint.x)];\n",V+=" skinMat += a_weight.y * u_jointMatrix[int(a_joint.y)];\n",V+=" skinMat += a_weight.z * u_jointMatrix[int(a_joint.z)];\n",V+=" skinMat += a_weight.w * u_jointMatrix[int(a_joint.w)];\n");var k={a_position:"position"};P.position={semantic:"POSITION",type:i.FLOAT_VEC3},w+="attribute vec3 a_position;\n",w+="varying vec3 v_positionEC;\n",V+=y?" vec4 pos = u_modelViewMatrix * skinMat * vec4(a_position,1.0);\n":" vec4 pos = u_modelViewMatrix * vec4(a_position,1.0);\n",V+=" v_positionEC = pos.xyz;\n",V+=" gl_Position = u_projectionMatrix * pos;\n",S+="varying vec3 v_positionEC;\n",A&&(k.a_normal="normal",P.normal={semantic:"NORMAL",type:i.FLOAT_VEC3},w+="attribute vec3 a_normal;\n",w+="varying vec3 v_normal;\n",V+=y?" v_normal = u_normalMatrix * mat3(skinMat) * a_normal;\n":" v_normal = u_normalMatrix * a_normal;\n",S+="varying vec3 v_normal;\n");var z;M&&(k.a_texcoord_0="texcoord_0",P.texcoord_0={semantic:"TEXCOORD_0",type:i.FLOAT_VEC2},z="v_texcoord_0",w+="attribute vec2 a_texcoord_0;\n",w+="varying vec2 "+z+";\n",V+=" "+z+" = a_texcoord_0;\n",S+="varying vec2 "+z+";\n"),y&&(k.a_joint="joint",P.joint={semantic:"JOINT",type:i.FLOAT_VEC4},k.a_weight="weight",P.weight={semantic:"WEIGHT",type:i.FLOAT_VEC4},w+="attribute vec4 a_joint;\n",w+="attribute vec4 a_weight;\n");var U=A&&("BLINN"===g||"PHONG"===g)&&t(P.specular)&&t(P.shininess),G=!1,W=!1,H="";for(var q in u)if(u.hasOwnProperty(q)){var j=u[q],Y=j.type.toLowerCase(),X=j.baseName;H+=" {\n";var Z,K,Q="u_"+X+"Color";"ambient"===Y?(W=!0,H+=" ambientLight += "+Q+";\n"):A&&(G=!0,Z="v_"+X+"Direction",K="v_"+X+"Position","point"!==Y&&(w+="varying vec3 "+Z+";\n",S+="varying vec3 "+Z+";\n",V+=" "+Z+" = mat3(u_"+X+"Transform) * vec3(0.,0.,1.);\n","directional"===Y&&(H+=" vec3 l = normalize("+Z+");\n")),"directional"!==Y?(w+="varying vec3 "+K+";\n",S+="varying vec3 "+K+";\n",V+=" "+K+" = u_"+X+"Transform[3].xyz;\n",H+=" vec3 VP = "+K+" - v_positionEC;\n",H+=" vec3 l = normalize(VP);\n",H+=" float range = length(VP);\n",H+=" float attenuation = 1.0 / (u_"+X+"Attenuation.x + ",H+="(u_"+X+"Attenuation.y * range) + ",H+="(u_"+X+"Attenuation.z * range * range));\n"):H+=" float attenuation = 1.0;\n","spot"===Y&&(H+=" float spotDot = dot(l, normalize("+Z+"));\n",H+=" if (spotDot < cos(u_"+X+"FallOff.x * 0.5))\n",H+=" {\n",H+=" attenuation = 0.0;\n",H+=" }\n",H+=" else\n",H+=" {\n",H+=" attenuation *= max(0.0, pow(spotDot, u_"+X+"FallOff.y));\n",H+=" }\n"),H+=" diffuseLight += "+Q+"* max(dot(normal,l), 0.) * attenuation;\n",U&&("BLINN"===g?(H+=" vec3 h = normalize(l + viewDir);\n",H+=" float specularIntensity = max(0., pow(max(dot(normal, h), 0.), u_shininess)) * attenuation;\n"):(H+=" vec3 reflectDir = reflect(-l, normal);\n",H+=" float specularIntensity = max(0., pow(max(dot(reflectDir, viewDir), 0.), u_shininess)) * attenuation;\n"),H+=" specularLight += "+Q+" * specularIntensity;\n")),H+=" }\n"}W||(H+=" ambientLight += vec3(0.2, 0.2, 0.2);\n"),G||"CONSTANT"===g||(H+=" vec3 l = normalize(czm_sunDirectionEC);\n",H+=" diffuseLight += vec3(1.0, 1.0, 1.0) * max(dot(normal,l), 0.);\n",U&&("BLINN"===g?(H+=" vec3 h = normalize(l + viewDir);\n",H+=" float specularIntensity = max(0., pow(max(dot(normal, h), 0.), u_shininess));\n"):(H+=" vec3 reflectDir = reflect(-l, normal);\n",H+=" float specularIntensity = max(0., pow(max(dot(reflectDir, viewDir), 0.), u_shininess));\n"),H+=" specularLight += vec3(1.0, 1.0, 1.0) * specularIntensity;\n")),w+="void main(void) {\n",w+=V,w+="}\n",S+="void main(void) {\n";var J=" vec3 color = vec3(0.0, 0.0, 0.0);\n";A&&(S+=" vec3 normal = normalize(v_normal);\n",a.doubleSided&&(S+=" if (gl_FrontFacing == false)\n",S+=" {\n",S+=" normal = -normal;\n",S+=" }\n"));var $;"CONSTANT"!==g?(t(P.diffuse)&&(S+=P.diffuse.type===i.SAMPLER_2D?" vec4 diffuse = texture2D(u_diffuse, "+z+");\n":" vec4 diffuse = u_diffuse;\n",S+=" vec3 diffuseLight = vec3(0.0, 0.0, 0.0);\n",J+=" color += diffuse.rgb * diffuseLight;\n"),U&&(S+=P.specular.type===i.SAMPLER_2D?" vec3 specular = texture2D(u_specular, "+z+").rgb;\n":" vec3 specular = u_specular.rgb;\n",S+=" vec3 specularLight = vec3(0.0, 0.0, 0.0);\n",J+=" color += specular * specularLight;\n"),$=t(P.transparency)?" gl_FragColor = vec4(color * diffuse.a, diffuse.a * u_transparency);\n":" gl_FragColor = vec4(color * diffuse.a, diffuse.a);\n"):$=t(P.transparency)?" gl_FragColor = vec4(color, u_transparency);\n":" gl_FragColor = vec4(color, 1.0);\n",t(P.emission)&&(S+=P.emission.type===i.SAMPLER_2D?" vec3 emission = texture2D(u_emission, "+z+").rgb;\n":" vec3 emission = u_emission.rgb;\n",J+=" color += emission;\n"),(t(P.ambient)||"CONSTANT"!==g)&&(S+=t(P.ambient)?P.ambient.type===i.SAMPLER_2D?" vec3 ambient = texture2D(u_ambient, "+z+").rgb;\n":" vec3 ambient = u_ambient.rgb;\n":" vec3 ambient = diffuse.rgb;\n",J+=" color += ambient * ambientLight;\n"),S+=" vec3 viewDir = -normalize(v_positionEC);\n",S+=" vec3 ambientLight = vec3(0.0, 0.0, 0.0);\n",S+=H,S+=J,S+=$,S+="}\n";var ee;ee=a.transparent?{enable:[i.DEPTH_TEST,i.BLEND],depthMask:!1,functions:{blendEquationSeparate:[i.FUNC_ADD,i.FUNC_ADD],blendFuncSeparate:[i.ONE,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA]}}:a.doubleSided?{enable:[i.DEPTH_TEST]}:{enable:[i.CULL_FACE,i.DEPTH_TEST]},m[E]={attributes:k,parameters:P,program:x,states:ee,uniforms:N},f[b]={type:i.VERTEX_SHADER,uri:"",extras:{source:w}},f[T]={type:i.FRAGMENT_SHADER,uri:"",extras:{source:S}};var te=Object.keys(k);return _[x]={attributes:te,fragmentShader:T,vertexShader:b},E}function s(e,r){var n;switch(n=t(r.value)?r.value:r,e){case"ambient":return n instanceof String||"string"==typeof n?i.SAMPLER_2D:i.FLOAT_VEC4;case"diffuse":return n instanceof String||"string"==typeof n?i.SAMPLER_2D:i.FLOAT_VEC4;case"emission":return n instanceof String||"string"==typeof n?i.SAMPLER_2D:i.FLOAT_VEC4;case"specular":return n instanceof String||"string"==typeof n?i.SAMPLER_2D:i.FLOAT_VEC4;case"shininess":return i.FLOAT;case"transparency":return i.FLOAT;case"transparent":return i.BOOL;case"doubleSided":return i.BOOL}}function l(t){var i="";i+="technique:"+t.technique+";";for(var r=t.values,n=Object.keys(r).sort(),o=n.length,a=0;a<o;++a){var l=n[a];r.hasOwnProperty(l)&&"transparent"!==l&&"doubleSided"!==l&&(i+=l+":"+s(l,r[l]),i+=";")}var u=e(t.doubleSided,!1);i+=u.toString()+";";var c=e(t.transparent,!1);i+=c.toString()+";";var h=e(t.jointCount,0);return i+=h.toString()+";"}function u(e){if(t(e)){var i=!1,r=e.extensionsUsed;if(t(r))for(var o=r.length,s=0;s<o;++s)if("KHR_materials_common"===r[s]){i=!0,r.splice(s,1);break}if(i){t(e.programs)||(e.programs={}),t(e.shaders)||(e.shaders={}),t(e.techniques)||(e.techniques={});var u=n(e),c={},h=e.materials;for(var d in h)if(h.hasOwnProperty(d)){var p=h[d];if(t(p.extensions)&&t(p.extensions.KHR_materials_common)){var m=p.extensions.KHR_materials_common,f=l(m),_=c[f];t(_)||(_=a(e,m,u),c[f]=_),p.values={};var g=m.values;for(var v in g)if(g.hasOwnProperty(v)){var y=g[v];t(y.value)?p.values[v]=y.value:p.values[v]=y}p.technique=_,delete p.extensions.KHR_materials_common}}t(e.extensions)&&delete e.extensions.KHR_materials_common}return e}}var c=0,h=0,d=0,p=0;return u}),i("Scene/ModelMesh",["../Core/defineProperties"],function(e){"use strict";function t(e,t,i){for(var r=[],n=e.primitives,o=n.length,a=0;a<o;++a){var s=n[a];r[a]=t[s.material]}this._name=e.name,this._materials=r,this._id=i}return e(t.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},materials:{get:function(){return this._materials}}}),t}),i("Scene/ModelNode",["../Core/defineProperties","../Core/Matrix4"],function(e,t){"use strict";function i(e,i,r,n,o){this._model=e,this._runtimeNode=r,this._name=i.name,this._id=n,this.useMatrix=!1,this._show=!0,this._matrix=t.clone(o)}return e(i.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,this._model._perNodeShowDirty=!0)}},matrix:{get:function(){return this._matrix},set:function(e){this._matrix=t.clone(e,this._matrix),this.useMatrix=!0;var i=this._model;i._cesiumAnimationsDirty=!0,this._runtimeNode.dirtyNumber=i._maxDirtyNumber}}}),i.prototype.setMatrix=function(e){t.clone(e,this._matrix)},i}),i("Scene/Model",["../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/clone","../Core/Color","../Core/combine","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/FeatureDetection","../Core/getAbsoluteUri","../Core/getBaseUri","../Core/getMagic","../Core/getStringFromTypedArray","../Core/IndexDatatype","../Core/loadArrayBuffer","../Core/loadImage","../Core/loadImageFromTypedArray","../Core/loadText","../Core/Math","../Core/Matrix2","../Core/Matrix3","../Core/Matrix4","../Core/PrimitiveType","../Core/Quaternion","../Core/Queue","../Core/RuntimeError","../Core/Transforms","../Core/WebGLConstants","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/Sampler","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/Texture","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","../Renderer/VertexArray","../ThirdParty/gltfDefaults","../ThirdParty/Uri","../ThirdParty/when","./BlendingState","./ColorBlendMode","./getAttributeOrUniformBySemantic","./getBinaryAccessor","./HeightReference","./ModelAnimationCache","./ModelAnimationCollection","./ModelMaterial","./modelMaterialsCommon","./ModelMesh","./ModelNode","./SceneMode","./ShadowMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I,R,O,N,L,B,F,V,k,z,U,G,W,H,q,j,Y,X,Z,K,Q,J,$,ee,te,ie,re,ne,oe,ae,se){ +"use strict";function le(){this.buffersToCreate=new M,this.buffers={},this.pendingBufferLoads=0,this.programsToCreate=new M,this.shaders={},this.pendingShaderLoads=0,this.texturesToCreate=new M,this.pendingTextureLoads=0,this.texturesToCreateFromBufferView=new M,this.pendingBufferViewToImage=0,this.createSamplers=!0,this.createSkins=!0,this.createRuntimeAnimations=!0,this.createVertexArrays=!0,this.createRenderStates=!0,this.createUniformMaps=!0,this.createRuntimeNodes=!0,this.skinnedNodesIds=[]}function ue(e,t){e._cachedGltf=t,e._animationIds=he(t)}function ce(e){this._gltf=re(j(e.gltf)),this._bgltf=e.bgltf,this.ready=e.ready,this.modelsToLoad=[],this.count=0}function he(e){var t=[];if(u(e)&&u(e.gltf)){var i=e.gltf.animations;for(var r in i)i.hasOwnProperty(r)&&t.push(r)}return t}function de(t){t=l(t,l.EMPTY_OBJECT);var i=t.cacheKey;this._cacheKey=i,this._cachedGltf=void 0,this._releaseGltfJson=l(t.releaseGltfJson,!1),this._animationIds=void 0;var r;if(u(i)&&u(di[i])&&di[i].ready)r=di[i],++r.count;else{var n=t.gltf;if(u(n)){if(n instanceof ArrayBuffer&&(n=new Uint8Array(n)),n instanceof Uint8Array){var o=_e(n);0!==o.binaryOffset&&(n=n.subarray(o.binaryOffset)),r=new ce({gltf:o.glTF,bgltf:n,ready:!0})}else r=new ce({gltf:t.gltf,ready:!0});r.count=1,u(i)&&(di[i]=r)}}ue(this,r),this._basePath=l(t.basePath,"");var s=new Y(document.location.href),c=new Y(this._basePath);this._baseUri=c.resolve(s),this.show=l(t.show,!0),this.silhouetteColor=l(t.silhouetteColor,a.RED),this._silhouetteColor=new a,this._silhouetteColorPreviousAlpha=1,this._normalAttributeName=void 0,this.silhouetteSize=l(t.silhouetteSize,0),this.modelMatrix=A.clone(l(t.modelMatrix,A.IDENTITY)),this._modelMatrix=A.clone(this.modelMatrix),this._clampedModelMatrix=void 0,this.scale=l(t.scale,1),this._scale=this.scale,this.minimumPixelSize=l(t.minimumPixelSize,0),this._minimumPixelSize=this.minimumPixelSize,this.maximumScale=t.maximumScale,this._maximumScale=this.maximumScale,this.id=t.id,this._id=t.id,this.heightReference=l(t.heightReference,$.NONE),this._heightReference=this.heightReference,this._heightChanged=!1,this._removeUpdateHeightCallback=void 0;var h=t.scene;this._scene=h,u(h)&&h.terrainProviderChanged.addEventListener(function(){this._heightChanged=!0},this),this.pickPrimitive=t.pickPrimitive,this._allowPicking=l(t.allowPicking,!0),this._ready=!1,this._readyPromise=X.defer(),this.activeAnimations=new te(this),this._defaultTexture=void 0,this._incrementallyLoadTextures=l(t.incrementallyLoadTextures,!0),this._asynchronous=l(t.asynchronous,!0),this.shadows=l(t.shadows,se.ENABLED),this._shadows=this.shadows,this.color=l(t.color,a.WHITE),this._color=new a,this._colorPreviousAlpha=1,this.colorBlendMode=l(t.colorBlendMode,K.HIGHLIGHT),this.colorBlendAmount=l(t.colorBlendAmount,.5),this.debugShowBoundingVolume=l(t.debugShowBoundingVolume,!1),this._debugShowBoundingVolume=!1,this.debugWireframe=l(t.debugWireframe,!1),this._debugWireframe=!1,this._distanceDisplayCondition=t.distanceDisplayCondition,this._precreatedAttributes=t.precreatedAttributes,this._vertexShaderLoaded=t.vertexShaderLoaded,this._fragmentShaderLoaded=t.fragmentShaderLoaded,this._uniformMapLoaded=t.uniformMapLoaded,this._pickVertexShaderLoaded=t.pickVertexShaderLoaded,this._pickFragmentShaderLoaded=t.pickFragmentShaderLoaded,this._pickUniformMapLoaded=t.pickUniformMapLoaded,this._ignoreCommands=l(t.ignoreCommands,!1),this.cull=l(t.cull,!0),this._computedModelMatrix=new A,this._initialRadius=void 0,this._boundingSphere=void 0,this._scaledBoundingSphere=new e,this._state=ci.NEEDS_LOAD,this._loadResources=void 0,this._mode=void 0,this._perNodeShowDirty=!1,this._cesiumAnimationsDirty=!1,this._dirty=!1,this._maxDirtyNumber=0,this._runtime={animations:void 0,rootNodes:void 0,nodes:void 0,nodesByName:void 0,skinnedNodes:void 0,meshesByName:void 0,materialsByName:void 0,materialsById:void 0},this._uniformMaps={},this._extensionsUsed=void 0,this._quantizedUniforms={},this._programPrimitives={},this._rendererResources={buffers:{},vertexArrays:{},programs:{},pickPrograms:{},silhouettePrograms:{},textures:{},samplers:{},renderStates:{}},this._cachedRendererResources=void 0,this._loadRendererResourcesFromCache=!1,this._nodeCommands=[],this._pickIds=[],this._rtcCenter=void 0,this._rtcCenterEye=void 0,this._rtcCenter3D=void 0,this._rtcCenter2D=void 0}function pe(e){return e.stencilBuffer}function me(e,t,i){return e.subarray(t,t+i)}function fe(e){var t=g(e);return"glTF"===t}function _e(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i=0;i+=pi,i+=pi,i+=pi;var r=t.getUint32(i,!0);i+=pi+pi;var n=i,o=n+r,a=v(e,n,r);return{glTF:JSON.parse(a),binaryOffset:o}}function ge(e,t,i){return e._runtime[t][i]}function ve(e,t){var i=e.accessors[t],r=i.extensions,n=i.min,o=i.max;if(u(r)){var a=r.WEB3D_quantized_attributes;u(a)&&(n=a.decodedMin,o=a.decodedMax)}return{min:n,max:o}}function ye(t){for(var r=t.nodes,n=t.meshes,o=t.scenes[t.scene].nodes,a=o.length,s=[],l=new i(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),c=new i(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),h=0;h<a;++h){var d=r[o[h]];for(d._transformToRoot=De(d),s.push(d);s.length>0;){d=s.pop();var p=d._transformToRoot,m=d.meshes;if(u(m))for(var f=m.length,_=0;_<f;++_)for(var g=n[m[_]].primitives,v=g.length,y=0;y<v;++y){var C=g[y].attributes.POSITION;if(u(C)){var w=ve(t,C),S=i.fromArray(w.min,0,mi),E=i.fromArray(w.max,0,fi);u(l)&&u(c)&&(A.multiplyByPoint(p,S,S),A.multiplyByPoint(p,E,E),i.minimumByComponent(l,S,l),i.maximumByComponent(c,E,c))}}for(var b=d.children,T=b.length,x=0;x<T;++x){var P=r[b[x]];P._transformToRoot=De(P),A.multiplyTransformation(p,P._transformToRoot,P._transformToRoot),s.push(P)}delete d._transformToRoot}}var D=e.fromCornerPoints(l,c);return e.transformWithoutScale(D,li,D)}function Ce(e,t,i){return function(){e._state=ci.FAILED,e._readyPromise.reject(new I("Failed to load "+t+": "+i))}}function we(e,t){return function(i){var r=e._loadResources;r.buffers[t]=new Uint8Array(i),--r.pendingBufferLoads}}function Se(e){var t=e.gltf.buffers;for(var i in t)if(t.hasOwnProperty(i)){var r=t[i];if("binary_glTF"===i||"KHR_binary_glTF"===i){var n=e._loadResources;n.buffers[i]=e._cachedGltf.bgltf}else if("arraybuffer"===r.type){++e._loadResources.pendingBufferLoads;var o=new Y(r.uri),a=o.resolve(e._baseUri).toString();C(a).then(we(e,i)).otherwise(Ce(e,"buffer",a))}}}function Ee(e){var t=e.gltf.bufferViews;for(var i in t)t.hasOwnProperty(i)&&t[i].target===O.ARRAY_BUFFER&&e._loadResources.buffersToCreate.enqueue(i)}function be(e,t){return function(i){var r=e._loadResources;r.shaders[t]={source:i,bufferView:void 0},--r.pendingShaderLoads}}function Te(e){var t=e.gltf.shaders;for(var i in t)if(t.hasOwnProperty(i)){var r=t[i];if(u(r.extras)&&u(r.extras.source))e._loadResources.shaders[i]={source:r.extras.source,bufferView:void 0};else if(u(r.extensions)&&u(r.extensions.KHR_binary_glTF)){var n=r.extensions.KHR_binary_glTF;e._loadResources.shaders[i]={source:void 0,bufferView:n.bufferView}}else{++e._loadResources.pendingShaderLoads;var o=new Y(r.uri),a=o.resolve(e._baseUri).toString();E(a).then(be(e,i)).otherwise(Ce(e,"shader",a))}}}function xe(e){var t=e.gltf.programs;for(var i in t)t.hasOwnProperty(i)&&e._loadResources.programsToCreate.enqueue(i)}function Ae(e,t){return function(i){var r=e._loadResources;--r.pendingTextureLoads,r.texturesToCreate.enqueue({id:t,image:i,bufferView:void 0})}}function Pe(e){var t=e.gltf.images,i=e.gltf.textures;for(var r in i)if(i.hasOwnProperty(r)){var n=t[i[r].source];if(u(n.extensions)&&u(n.extensions.KHR_binary_glTF)){var o=n.extensions.KHR_binary_glTF;e._loadResources.texturesToCreateFromBufferView.enqueue({id:r,image:void 0,bufferView:o.bufferView,mimeType:o.mimeType})}else{++e._loadResources.pendingTextureLoads;var a=new Y(n.uri),s=a.resolve(e._baseUri).toString();w(s).then(Ae(e,r)).otherwise(Ce(e,"image",s))}}}function De(e){return u(e.matrix)?A.fromArray(e.matrix):A.fromTranslationQuaternionRotationScale(i.fromArray(e.translation,0,_i),D.unpack(e.rotation,0,gi),i.fromArray(e.scale,0,vi))}function Me(e){var t={},i={},r=[],n=e._loadResources.skinnedNodesIds,o=e.gltf.nodes;for(var a in o)if(o.hasOwnProperty(a)){var s=o[a],l={matrix:void 0,translation:void 0,rotation:void 0,scale:void 0,computedShow:!0,transformToRoot:new A,computedMatrix:new A,dirtyNumber:0,commands:[],inverseBindMatrices:void 0,bindShapeMatrix:void 0,joints:[],computedJointMatrices:[],jointName:s.jointName,children:[],parents:[],publicNode:void 0};l.publicNode=new oe(e,s,l,a,De(s)),t[a]=l,i[s.name]=l,u(s.skin)&&(n.push(a),r.push(l))}e._runtime.nodes=t,e._runtime.nodesByName=i,e._runtime.skinnedNodes=r}function Ie(e){var t={},i={},r=e.gltf.materials,n=e._uniformMaps;for(var o in r)if(r.hasOwnProperty(o)){n[o]={uniformMap:void 0,values:void 0,jointMatrixUniformName:void 0};var a=r[o],s=new ie(e,a,o);t[a.name]=s,i[o]=s}e._runtime.materialsByName=t,e._runtime.materialsById=i}function Re(e){var t={},i=e._runtime.materialsById,r=e.gltf.meshes,n=Ne(e,"WEB3D_quantized_attributes");for(var o in r)if(r.hasOwnProperty(o)){var a=r[o];if(t[a.name]=new ne(a,i,o),n)for(var s=a.primitives,l=s.length,c=0;c<l;c++){var h=s[c],d=ke(e,h),p=e._programPrimitives[d];u(p)||(p=[],e._programPrimitives[d]=p),p.push(h)}}e._runtime.meshesByName=t}function Oe(e){e._loadRendererResourcesFromCache||(Se(e),Ee(e),Te(e),xe(e),Pe(e)),Ie(e),Re(e),Me(e)}function Ne(e,t){var i=e._extensionsUsed;if(!u(i)){var r=e.gltf.extensionsUsed;i={};for(var n=r.length,o=0;o<n;o++)i[r[o]]=!0}return u(i[t])}function Le(e,t){var i=e._loadResources;if(0===i.pendingBufferLoads){for(var r,n=e.gltf.bufferViews,o=e._rendererResources.buffers;i.buffersToCreate.length>0;){var a=i.buffersToCreate.dequeue();r=n[a];var s=N.createVertexBuffer({context:t,typedArray:i.getBuffer(r),usage:L.STATIC_DRAW});s.vertexArrayDestroyable=!1,o[a]=s}var l=e.gltf.accessors;for(var c in l)if(l.hasOwnProperty(c)){var h=l[c];if(r=n[h.bufferView],r.target===O.ELEMENT_ARRAY_BUFFER&&!u(o[h.bufferView])){var d=N.createIndexBuffer({context:t,typedArray:i.getBuffer(r),usage:L.STATIC_DRAW,indexDatatype:h.componentType});d.vertexArrayDestroyable=!1,o[h.bufferView]=d}}}}function Be(e,t){var i,r={},n=t.length;for(i=1;i<n;++i){var o=t[i];if(/position/i.test(o)){t[i]=t[0],t[0]=o;break}}for(i=0;i<n;++i)r[t[i]]=i;return r}function Fe(e,t){if(u(t.source))return t.source;var i=e._loadResources,r=e.gltf,n=r.bufferViews[t.bufferView];return v(i.getBuffer(n))}function Ve(e,t,i){var r=e.indexOf(t);return e.replace(new RegExp(t,"g"),function(e,t,n){return r===t?e:i})}function ke(e,t){var i=e.gltf,r=t.material,n=i.materials[r],o=n.technique,a=i.techniques[o];return a.program}function ze(e,t){var i=e.gltf,r=i.accessors[t],n=r.extensions;if(u(n))return n.WEB3D_quantized_attributes}function Ue(e,t,i){var r=e.gltf,n=t.material,o=r.materials[n],a=o.technique,s=r.techniques[a];for(var l in s.parameters)if(s.parameters.hasOwnProperty(l)){var u=s.parameters[l].semantic;if(u===i){var c=s.attributes;for(var h in c)if(c.hasOwnProperty(h)){var d=c[h];if(d===l)return h}}}}function Ge(e,t,i,r){var n={};i._quantizedUniforms[t]=n;for(var o=i._programPrimitives[t],a=0;a<o.length;a++){var s=o[a];if(ke(i,s)===t)for(var l in s.attributes)if(s.attributes.hasOwnProperty(l)){var c="gltf_u_dec_"+l.toLowerCase(),h=c+"_scale",d=c+"_translate";if(!u(n[c])&&!u(n[h])){var p=s.attributes[l],m=ze(i,p);if(u(m)){var f=Ue(i,s,l),_=m.decodeMatrix,g="gltf_decoded_"+l,v=f.replace("a_","gltf_a_dec_"),y=Math.floor(Math.sqrt(_.length));e=Ve(e,f,v);var C;C=y>2?"vec"+(y-1):"float",e=C+" "+v+";\n"+e;var w="";5===y?(e="uniform mat4 "+h+";\n"+e,e="uniform vec4 "+d+";\n"+e,w="\nvoid main() {\n "+v+" = "+h+" * "+f+" + "+d+";\n "+g+"();\n}\n",n[h]={mat:4},n[d]={vec:4}):(e="uniform mat"+y+" "+c+";\n"+e,w="\nvoid main() {\n "+v+" = "+C+"("+c+" * vec"+y+"("+f+",1.0));\n "+g+"();\n}\n",n[c]={mat:y}),e=U.replaceMain(e,g),e+=w}}}}return i._programPrimitives[t]=void 0,e}function We(e){var t=e.gltf;return!!u(t.asset)&&l(t.asset.premultipliedAlpha,!1)}function He(e,t){return e=U.replaceMain(e,"gltf_blend_main"),e+="uniform vec4 gltf_color; \nuniform float gltf_colorBlend; \nvoid main() \n{ \n gltf_blend_main(); \n",t&&(e+=" float alpha = 1.0 - ceil(gl_FragColor.a) + gl_FragColor.a; \n gl_FragColor.rgb /= alpha; \n"),e+=" gl_FragColor.rgb = mix(gl_FragColor.rgb, gltf_color.rgb, gltf_colorBlend); \n float highlight = ceil(gltf_colorBlend); \n gl_FragColor.rgb *= mix(gltf_color.rgb, vec3(1.0), highlight); \n gl_FragColor.a *= gltf_color.a; \n} \n"}function qe(e,t,i){return u(i)&&(e=i(e,t)),e}function je(e,t,i){var r=t.gltf.programs,n=t._loadResources.shaders,o=r[e],a=Be(t,o.attributes),s=Fe(t,n[o.vertexShader]),l=Fe(t,n[o.fragmentShader]),c=o.attributes.length,h=t._precreatedAttributes;if(u(h))for(var d in h)h.hasOwnProperty(d)&&(a[d]=c++);Ne(t,"WEB3D_quantized_attributes")&&(s=Ge(s,e,t,i));var p=We(t),m=He(l,p),f=qe(s,e,t._vertexShaderLoaded),_=qe(m,e,t._fragmentShaderLoaded);if(t._rendererResources.programs[e]=z.fromCache({context:i,vertexShaderSource:f,fragmentShaderSource:_,attributeLocations:a}),t.allowPicking){var g=qe(s,e,t._pickVertexShaderLoaded),v=qe(l,e,t._pickFragmentShaderLoaded);t._pickFragmentShaderLoaded||(v=U.createPickFragmentShaderSource(l,"uniform")),t._rendererResources.pickPrograms[e]=z.fromCache({context:i,vertexShaderSource:g,fragmentShaderSource:v,attributeLocations:a})}}function Ye(e,t){var i,r=e._loadResources;if(0===r.pendingShaderLoads&&0===r.pendingBufferLoads)if(e.asynchronous)r.programsToCreate.length>0&&(i=r.programsToCreate.dequeue(),je(i,e,t));else for(;r.programsToCreate.length>0;)i=r.programsToCreate.dequeue(),je(i,e,t)}function Xe(e,t){return function(i){e.texturesToCreate.enqueue({id:t.id,image:i,bufferView:void 0}),--e.pendingBufferViewToImage}}function Ze(e){var t=e._loadResources;if(0===t.pendingBufferLoads)for(;t.texturesToCreateFromBufferView.length>0;){var i=t.texturesToCreateFromBufferView.dequeue(),r=e.gltf,n=r.bufferViews[i.bufferView],o=Xe(t,i),a=Ce(e,"image","id: "+i.id+", bufferView: "+i.bufferView);S(t.getBuffer(n),i.mimeType).then(o).otherwise(a),++t.pendingBufferViewToImage}}function Ke(e,t){var i=e._loadResources;if(i.createSamplers){i.createSamplers=!1;var r=e._rendererResources.samplers,n=e.gltf.samplers;for(var o in n)if(n.hasOwnProperty(o)){var a=n[o];r[o]=new k({wrapS:a.wrapS,wrapT:a.wrapT,minificationFilter:a.minFilter,magnificationFilter:a.magFilter})}}}function Qe(e,t,i){var r=t.gltf.textures,n=r[e.id],o=t._rendererResources.samplers,a=o[n.sampler],s=a.minificationFilter===W.NEAREST_MIPMAP_NEAREST||a.minificationFilter===W.NEAREST_MIPMAP_LINEAR||a.minificationFilter===W.LINEAR_MIPMAP_NEAREST||a.minificationFilter===W.LINEAR_MIPMAP_LINEAR,l=s||a.wrapS===H.REPEAT||a.wrapS===H.MIRRORED_REPEAT||a.wrapT===H.REPEAT||a.wrapT===H.MIRRORED_REPEAT,u=e.image,c=!b.isPowerOfTwo(u.width)||!b.isPowerOfTwo(u.height);if(l&&c){var h=document.createElement("canvas");h.width=b.nextPowerOfTwo(u.width),h.height=b.nextPowerOfTwo(u.height);var d=h.getContext("2d");d.drawImage(u,0,0,u.width,u.height,0,0,h.width,h.height),u=h}var p;n.target===O.TEXTURE_2D&&(p=new G({context:i,source:u,pixelFormat:n.internalFormat,pixelDatatype:n.type,sampler:a,flipY:!1})),s&&p.generateMipmap(),t._rendererResources.textures[e.id]=p}function Je(e,t){var i,r=e._loadResources;if(e.asynchronous)r.texturesToCreate.length>0&&(i=r.texturesToCreate.dequeue(),Qe(i,e,t));else for(;r.texturesToCreate.length>0;)i=r.texturesToCreate.dequeue(),Qe(i,e,t)}function $e(e,t){var i=e.gltf,r=i.techniques,n=i.materials,o={},a=r[n[t.material].technique],s=a.parameters,l=a.attributes,c=e._rendererResources.programs[a.program].vertexAttributes;for(var h in c)if(c.hasOwnProperty(h)){var d=l[h],p=c[h].index;if(u(d)){var m=s[d];o[m.semantic]=p}else o[h]=p}return o}function et(e,t,i){for(var r=e.length,n=0;n<r;++n)for(var o=[e[n]];o.length>0;){var a=o.pop(),s=i[a];if(s.jointName===t)return a;for(var l=s.children,u=l.length,c=0;c<u;++c)o.push(l[c])}}function tt(e,t){for(var i=e.gltf,r=i.skins,n=i.nodes,o=e._runtime.nodes,a=e._loadResources.skinnedNodesIds,s=a.length,l=0;l<s;++l){var u=a[l],c=o[u],h=n[u],d=t[h.skin];c.inverseBindMatrices=d.inverseBindMatrices,c.bindShapeMatrix=d.bindShapeMatrix;for(var p=[],m=h.skeletons,f=m.length,_=0;_<f;++_)p.push(m[_]);for(var g=r[h.skin].jointNames,v=g.length,y=0;y<v;++y){var C=g[y],w=o[et(p,C,n)];c.joints.push(w)}}}function it(e){var t=e._loadResources;if(0===t.pendingBufferLoads&&t.createSkins){t.createSkins=!1;var i=e.gltf,r=i.accessors,n=i.skins,o={};for(var a in n)if(n.hasOwnProperty(a)){var s,l=n[a],u=r[l.inverseBindMatrices];A.equals(l.bindShapeMatrix,A.IDENTITY)||(s=A.clone(l.bindShapeMatrix)),o[a]={inverseBindMatrices:ee.getSkinInverseBindMatrices(e,u),bindShapeMatrix:s}}tt(e,o)}}function rt(e,t,i,r){return function(n){t[i]=r.evaluate(n,t[i]),t.dirtyNumber=e._maxDirtyNumber}}function nt(e){var t=e._loadResources;if(t.finishedPendingBufferLoads()&&t.createRuntimeAnimations){t.createRuntimeAnimations=!1,e._runtime.animations={};var i=e._runtime.nodes,r=e.gltf.animations,n=e.gltf.accessors;for(var o in r)if(r.hasOwnProperty(o)){var a=r[o],s=a.channels,l=a.parameters,u=a.samplers,c={};for(var h in l)l.hasOwnProperty(h)&&(c[h]=ee.getAnimationParameterValues(e,n[l[h]]));for(var d=Number.MAX_VALUE,p=-Number.MAX_VALUE,m=s.length,f=new Array(m),_=0;_<m;++_){var g=s[_],v=g.target,y=u[g.sampler],C=c[y.input];d=Math.min(d,C[0]),p=Math.max(p,C[C.length-1]);var w=ee.getAnimationSpline(e,o,a,g.sampler,y,c);f[_]=rt(e,i[v.id],v.path,w)}e._runtime.animations[o]={startTime:d,stopTime:p,channelEvaluators:f}}}}function ot(e,t){var i=e._loadResources;if(i.finishedBuffersCreation()&&i.finishedProgramCreation()&&i.createVertexArrays){i.createVertexArrays=!1;var r=e._rendererResources.buffers,n=e._rendererResources.vertexArrays,o=e.gltf,a=o.accessors,s=o.meshes;for(var l in s)if(s.hasOwnProperty(l))for(var c=s[l].primitives,h=c.length,d=0;d<h;++d){var p,m,f,_=c[d],g=$e(e,_),v=[],y=_.attributes;for(p in y)if(y.hasOwnProperty(p)&&(m=g[p],u(m))){var C=a[y[p]];v.push({index:m,vertexBuffer:r[C.bufferView],componentsPerAttribute:J(C).componentsPerAttribute,componentDatatype:C.componentType,normalize:!1,offsetInBytes:C.byteOffset,strideInBytes:C.byteStride})}var w=e._precreatedAttributes;if(u(w))for(p in w)w.hasOwnProperty(p)&&(m=g[p],u(m)&&(f=w[p],f.index=m,v.push(f)));var S;if(u(_.indices)){var E=a[_.indices];S=r[E.bufferView]}n[l+".primitive."+d]=new q({context:t,attributes:v,indexBuffer:S})}}}function at(e){var t={};t[O.BLEND]=!1,t[O.CULL_FACE]=!1,t[O.DEPTH_TEST]=!1,t[O.POLYGON_OFFSET_FILL]=!1,t[O.SCISSOR_TEST]=!1;var i,r=e.enable,n=r.length;for(i=0;i<n;++i)t[r[i]]=!0;return t}function st(e,t){var i=e._loadResources,r=e.gltf.techniques;if(i.createRenderStates){i.createRenderStates=!1;for(var n in r)r.hasOwnProperty(n)&<(e,n,t)}}function lt(e,t,i){var r=e._rendererResources.renderStates,n=e.gltf.techniques,o=n[t],a=o.states,s=at(a),c=l(a.functions,l.EMPTY_OBJECT),h=l(c.blendColor,[0,0,0,0]),d=l(c.blendEquationSeparate,[O.FUNC_ADD,O.FUNC_ADD]),p=l(c.blendFuncSeparate,[O.ONE,O.ZERO,O.ONE,O.ZERO]),m=l(c.colorMask,[!0,!0,!0,!0]),f=l(c.depthRange,[0,1]),_=l(c.polygonOffset,[0,0]),g=l(c.scissor,[0,0,0,0]);s[O.BLEND]&&We(e)&&p[0]===O.ONE&&p[1]===O.ONE_MINUS_SRC_ALPHA&&(p[0]=O.SRC_ALPHA,p[1]=O.ONE_MINUS_SRC_ALPHA,p[2]=O.SRC_ALPHA,p[3]=O.ONE_MINUS_SRC_ALPHA),r[t]=V.fromCache({frontFace:u(c.frontFace)?c.frontFace[0]:O.CCW,cull:{enabled:s[O.CULL_FACE],face:u(c.cullFace)?c.cullFace[0]:O.BACK},lineWidth:u(c.lineWidth)?c.lineWidth[0]:1,polygonOffset:{enabled:s[O.POLYGON_OFFSET_FILL],factor:_[0],units:_[1]},scissorTest:{enabled:s[O.SCISSOR_TEST],rectangle:{x:g[0],y:g[1],width:g[2],height:g[3]}},depthRange:{near:f[0],far:f[1]},depthTest:{enabled:s[O.DEPTH_TEST],func:u(c.depthFunc)?c.depthFunc[0]:O.LESS},colorMask:{red:m[0],green:m[1],blue:m[2],alpha:m[3]},depthMask:!u(c.depthMask)||c.depthMask[0],blending:{enabled:s[O.BLEND],color:{red:h[0],green:h[1],blue:h[2],alpha:h[3]},equationRgb:d[0],equationAlpha:d[1],functionSourceRgb:p[0],functionDestinationRgb:p[1],functionSourceAlpha:p[2],functionDestinationAlpha:p[3]}})}function ut(e,t){var i={value:e,clone:function(e,t){return e},func:function(){return i.value}};return i}function ct(e,i){var r={value:t.fromArray(e),clone:t.clone,func:function(){return r.value}};return r}function ht(e,t){var r={value:i.fromArray(e),clone:i.clone,func:function(){return r.value}};return r}function dt(e,t){var i={value:r.fromArray(e),clone:r.clone,func:function(){return i.value}};return i}function pt(e,t){var i={value:T.fromColumnMajorArray(e),clone:T.clone,func:function(){return i.value}};return i}function mt(e,t){var i={value:x.fromColumnMajorArray(e),clone:x.clone,func:function(){return i.value}};return i}function ft(e,t){var i={value:A.fromColumnMajorArray(e),clone:A.clone,func:function(){return i.value}};return i}function _t(e,t){this._value=void 0,this._textureId=e,this._model=t}function gt(e,t){var i=new _t(e,t);return i.func=function(){return i.value},i}function vt(e,t,i,r){var n=t._runtime.nodes[e];return Si[i](r,t,n)}function yt(e,t){var i=e._loadResources;if(i.finishedProgramCreation()&&i.createUniformMaps){i.createUniformMaps=!1;var r=e.gltf,n=r.materials,o=r.techniques,a=e._uniformMaps;for(var s in n)if(n.hasOwnProperty(s)){var l,c=n[s],h=c.values,d=o[c.technique],p=d.parameters,m=d.uniforms,f={},_={};for(var g in m)if(m.hasOwnProperty(g)){var v=m[g],y=p[v];if(u(h[v])){var C=wi[y.type](h[v],e);f[g]=C.func,_[v]=C}else if(u(y.node))f[g]=vt(y.node,e,y.semantic,t.uniformState);else if(u(y.semantic))"JOINTMATRIX"!==y.semantic?f[g]=Ci[y.semantic](t.uniformState,e):l=g;else if(u(y.value)){var w=wi[y.type](y.value,e);f[g]=w.func,_[v]=w}}var S=a[s];S.uniformMap=f,S.values=_,S.jointMatrixUniformName=l}}}function Ct(e){return[e[0],e[1],e[2],e[3],e[5],e[6],e[7],e[8],e[10],e[11],e[12],e[13],e[15],e[16],e[17],e[18]]}function wt(e){return[e[20],e[21],e[22],e[23]]}function St(e,t,i){var r=e.gltf,n=r.accessors,o=ke(e,t),a=e._quantizedUniforms[o],s={},l={};for(var c in t.attributes)if(t.attributes.hasOwnProperty(c)){var h=t.attributes[c],d=n[h],p=d.extensions;if(u(p)){var m=p.WEB3D_quantized_attributes;if(u(m)){var f=m.decodeMatrix,_="gltf_u_dec_"+c.toLowerCase();switch(d.type){case"SCALAR":l[_]=pt(f,e).func,s[_]=!0;break;case"VEC2":l[_]=mt(f,e).func,s[_]=!0;break;case"VEC3":l[_]=ft(f,e).func,s[_]=!0;break;case"VEC4":var g=_+"_scale",v=_+"_translate";l[g]=ft(Ct(f),e).func,l[v]=dt(wt(f),e).func,s[g]=!0,s[v]=!0}}}}for(var y in a)if(a.hasOwnProperty(y)&&!s[y]){var C=a[y];u(C.mat)&&(2===C.mat?l[y]=pt(T.IDENTITY,e).func:3===C.mat?l[y]=mt(x.IDENTITY,e).func:4===C.mat&&(l[y]=ft(A.IDENTITY,e).func)),u(C.vec)&&4===C.vec&&(l[y]=dt([0,0,0,0],e).func)}return l}function Et(e){return function(){return e}}function bt(e){return function(){return e.computedJointMatrices}}function Tt(e){return function(){return e.silhouetteColor}}function xt(e){return function(){return e.silhouetteSize}}function At(e){return function(){return e.color}}function Pt(e){return function(){return K.getColorBlend(e.colorBlendMode,e.colorBlendAmount)}}function Dt(t,r,n,o,a){for(var c=t._nodeCommands,h=t._pickIds,d=t.allowPicking,p=t._runtime.meshesByName,m=t._rendererResources,f=m.vertexArrays,_=m.programs,g=m.pickPrograms,v=m.renderStates,C=t._uniformMaps,w=t.gltf,S=w.accessors,E=w.meshes,b=w.techniques,T=w.materials,x=r.meshes,P=x.length,D=0;D<P;++D)for(var M=x[D],I=E[M],R=I.primitives,O=R.length,N=0;N<O;++N){var L,V=R[N],k=S[V.indices],z=T[V.material],U=b[z.technique],G=U.program,W=V.attributes.POSITION;if(u(W)){var H=ve(w,W);L=e.fromCornerPoints(i.fromArray(H.min),i.fromArray(H.max))}var q,j,Y=f[M+".primitive."+N];if(u(k))j=k.count,q=k.byteOffset/y.getSizeInBytes(k.componentType);else{var X=S[V.attributes.POSITION];j=X.count,q=0}var Z=C[V.material],K=Z.uniformMap;if(u(Z.jointMatrixUniformName)){var Q={};Q[Z.jointMatrixUniformName]=bt(n),K=s(K,Q)}if(K=s(K,{gltf_color:At(t),gltf_colorBlend:Pt(t)}),u(t._uniformMapLoaded)&&(K=t._uniformMapLoaded(K,G,n)),Ne(t,"WEB3D_quantized_attributes")){var J=St(t,V,o);K=s(K,J)}var $,ee=v[z.technique],te=ee.blending.enabled,ie={primitive:l(t.pickPrimitive,t),id:t.id,node:n.publicNode,mesh:p[I.name]},re=se.castShadows(t._shadows),ne=se.receiveShadows(t._shadows),oe=new B({boundingVolume:new e,cull:t.cull,modelMatrix:new A,primitiveType:V.mode,vertexArray:Y,count:j,offset:q,shaderProgram:_[U.program],castShadows:re,receiveShadows:ne,uniformMap:K,renderState:ee,owner:ie,pass:te?F.TRANSLUCENT:F.OPAQUE});if(d){var ae;if(u(t._pickFragmentShaderLoaded))ae=u(t._pickUniformMapLoaded)?t._pickUniformMapLoaded(K):s(K);else{var le=o.createPickId(ie);h.push(le);var ue={czm_pickColor:Et(le.color)};ae=s(K,ue)}$=new B({boundingVolume:new e,cull:t.cull,modelMatrix:new A,primitiveType:V.mode,vertexArray:Y,count:j,offset:q,shaderProgram:g[U.program],uniformMap:ae,renderState:ee,owner:ie,pass:te?F.TRANSLUCENT:F.OPAQUE})}var ce,he;a||(ce=B.shallowClone(oe),ce.boundingVolume=new e,ce.modelMatrix=new A,d&&(he=B.shallowClone($),he.boundingVolume=new e,he.modelMatrix=new A));var de={show:!0,boundingSphere:L,command:oe,pickCommand:$,command2D:ce,pickCommand2D:he,silhouetteModelCommand:void 0,silhouetteModelCommand2D:void 0,silhouetteColorCommand:void 0,silhouetteColorCommand2D:void 0,translucentCommand:void 0,translucentCommand2D:void 0};n.commands.push(de),c.push(de)}}function Mt(e,t,r){var n=e._loadResources;if(n.finishedEverythingButTextureCreation()&&n.createRuntimeNodes){n.createRuntimeNodes=!1;for(var o=[],a=e._runtime.nodes,s=e.gltf,l=s.nodes,c=s.scenes[s.scene],h=c.nodes,d=h.length,p=[],m=0;m<d;++m)for(p.push({parentRuntimeNode:void 0,gltfNode:l[h[m]],id:h[m]});p.length>0;){var f=p.pop(),_=f.parentRuntimeNode,g=f.gltfNode,v=a[f.id];if(0===v.parents.length)if(u(g.matrix))v.matrix=A.fromColumnMajorArray(g.matrix);else{var y=g.rotation;v.translation=i.fromArray(g.translation),v.rotation=D.unpack(y),v.scale=i.fromArray(g.scale)}u(_)?(_.children.push(v),v.parents.push(_)):o.push(v),u(g.meshes)&&Dt(e,g,v,t,r);for(var C=g.children,w=C.length,S=0;S<w;++S)p.push({parentRuntimeNode:v,gltfNode:l[C[S]],id:C[S]})}e._runtime.rootNodes=o,e._runtime.nodes=a}}function It(e,t){var i=t.context,r=t.scene3DOnly;if(e._loadRendererResourcesFromCache){var n=e._rendererResources,o=e._cachedRendererResources;n.buffers=o.buffers,n.vertexArrays=o.vertexArrays,n.programs=o.programs,n.pickPrograms=o.pickPrograms,n.silhouettePrograms=o.silhouettePrograms,n.textures=o.textures,n.samplers=o.samplers,n.renderStates=o.renderStates,u(e._precreatedAttributes)&&ot(e,i)}else Le(e,i),Ye(e,i),Ke(e,i),Ze(e),Je(e,i);it(e),nt(e),e._loadRendererResourcesFromCache||(ot(e,i),st(e,i)),yt(e,i),Mt(e,i,r)}function Rt(e,t){var i=e.publicNode,r=i.matrix;i.useMatrix&&u(r)?A.clone(r,t):u(e.matrix)?A.clone(e.matrix,t):(A.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t),i.setMatrix(t))}function Ot(t,n,o,a){var s=t._maxDirtyNumber,l=t.allowPicking,c=t._runtime.rootNodes,h=c.length,d=Ei,p=t._computedModelMatrix;if(t._mode!==ae.SCENE3D){var m=A.getColumn(p,3,bi);if(r.equals(m,r.UNIT_W)){var f=t.boundingSphere.center,_=R.wgs84To2DModelMatrix(a,f,Ti);p=A.multiply(_,p,Ti),u(t._rtcCenter)&&(A.setTranslation(p,r.UNIT_W,p),t._rtcCenter=t._rtcCenter2D)}else p=R.basisTo2D(a,p,Ti),t._rtcCenter=t._rtcCenter3D}for(var g=0;g<h;++g){var v=c[g];for(Rt(v,v.transformToRoot),d.push(v);d.length>0;){v=d.pop();var y=v.transformToRoot,C=v.commands;if(v.dirtyNumber===s||n||o){var w=A.multiplyTransformation(p,y,v.computedMatrix),S=C.length;if(S>0)for(var E=0;E<S;++E){var T=C[E],x=T.command;if(A.clone(w,x.modelMatrix),e.transform(T.boundingSphere,x.modelMatrix,x.boundingVolume),u(t._rtcCenter)&&i.add(t._rtcCenter,x.boundingVolume.center,x.boundingVolume.center),l){var P=T.pickCommand;A.clone(x.modelMatrix,P.modelMatrix),e.clone(x.boundingVolume,P.boundingVolume)}if(x=T.command2D,u(x)&&t._mode===ae.SCENE2D&&(A.clone(w,x.modelMatrix),x.modelMatrix[13]-=2*b.sign(x.modelMatrix[13])*b.PI*a.ellipsoid.maximumRadius,e.transform(T.boundingSphere,x.modelMatrix,x.boundingVolume),l)){var D=T.pickCommand2D;A.clone(x.modelMatrix,D.modelMatrix),e.clone(x.boundingVolume,D.boundingVolume)}}}for(var M=v.children,I=M.length,O=0;O<I;++O){var N=M[O];N.dirtyNumber=Math.max(N.dirtyNumber,v.dirtyNumber),(N.dirtyNumber===s||o)&&(Rt(N,N.transformToRoot),A.multiplyTransformation(y,N.transformToRoot,N.transformToRoot)),d.push(N)}}}++t._maxDirtyNumber}function Nt(e){for(var t=e._runtime.skinnedNodes,i=t.length,r=0;r<i;++r){var n=t[r];xi=A.inverseTransformation(n.transformToRoot,xi);for(var o=n.computedJointMatrices,a=n.joints,s=n.bindShapeMatrix,l=n.inverseBindMatrices,c=l.length,h=0;h<c;++h)u(o[h])||(o[h]=new A),o[h]=A.multiplyTransformation(xi,a[h].transformToRoot,o[h]),o[h]=A.multiplyTransformation(o[h],l[h],o[h]),u(s)&&(o[h]=A.multiplyTransformation(o[h],s,o[h]))}}function Lt(e){for(var t=e._runtime.rootNodes,i=t.length,r=Ei,n=0;n<i;++n){var o=t[n];for(o.computedShow=o.publicNode.show,r.push(o);r.length>0;){o=r.pop();for(var a=o.computedShow,s=o.commands,l=s.length,u=0;u<l;++u)s[u].show=a;for(var c=o.children,h=c.length,d=0;d<h;++d){var p=c[d];p.computedShow=a&&p.publicNode.show,r.push(p)}}}}function Bt(e,t){var i=e.id;if(e._id!==i){e._id=i;for(var r=e._pickIds,n=r.length,o=0;o<n;++o)r[o].object.id=i}}function Ft(e){if(e._debugWireframe!==e.debugWireframe){e._debugWireframe=e.debugWireframe;for(var t=e.debugWireframe?P.LINES:P.TRIANGLES,i=e._nodeCommands,r=i.length,n=0;n<r;++n)i[n].command.primitiveType=t}}function Vt(e){if(e.debugShowBoundingVolume!==e._debugShowBoundingVolume){e._debugShowBoundingVolume=e.debugShowBoundingVolume;for(var t=e.debugShowBoundingVolume,i=e._nodeCommands,r=i.length,n=0;n<r;++n)i[n].command.debugShowBoundingVolume=t}}function kt(e){if(e.shadows!==e._shadows){e._shadows=e.shadows;for(var t=se.castShadows(e.shadows),i=se.receiveShadows(e.shadows),r=e._nodeCommands,n=r.length,o=0;o<n;o++){var a=r[o];a.command.castShadows=t,a.command.receiveShadows=i}}}function zt(e){var t=o(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=Z.ALPHA_BLEND,V.fromCache(t)}function Ut(e){var t=B.shallowClone(e);return t.pass=F.TRANSLUCENT,t.renderState=zt(e.renderState),t}function Gt(e,t){var i=t.scene3DOnly,r=e.color.alpha;if(r>0&&r<1){var n=e._nodeCommands,o=n.length;if(!u(n[0].translucentCommand))for(var a=0;a<o;++a){var s=n[a],l=s.command;if(s.translucentCommand=Ut(l),!i){var c=s.command2D;s.translucentCommand2D=Ut(c)}}}}function Wt(e,t){var i=e._rendererResources.programs;for(var r in i)if(i.hasOwnProperty(r)&&i[r]===t)return r}function Ht(e,t,i){var r=t.vertexShaderSource.sources[0],n=t._attributeLocations,o=e._normalAttributeName;r=U.replaceMain(r,"gltf_silhouette_main"),r+="uniform float gltf_silhouetteSize; \nvoid main() \n{ \n gltf_silhouette_main(); \n vec3 n = normalize(czm_normal3D * "+o+"); \n n.x *= czm_projection[0][0]; \n n.y *= czm_projection[1][1]; \n vec4 clip = gl_Position; \n clip.xy += n.xy * clip.w * gltf_silhouetteSize / czm_viewport.z; \n gl_Position = clip; \n}";var a="uniform vec4 gltf_silhouetteColor; \nvoid main() \n{ \n gl_FragColor = gltf_silhouetteColor; \n}";return z.fromCache({context:i.context,vertexShaderSource:r,fragmentShaderSource:a,attributeLocations:n})}function qt(e,t){return pe(t.context)&&e.silhouetteSize>0&&e.silhouetteColor.alpha>0&&u(e._normalAttributeName)}function jt(e){for(var t=e._nodeCommands,i=t.length,r=0;r<i;++r){var n=t[r],o=n.command;if(o.pass===F.TRANSLUCENT)return!0}return!1}function Yt(e){return e.color.alpha>0&&e.color.alpha<1}function Xt(e){return 0===e.color.alpha}function Zt(e,t){return Math.floor(e)!==Math.floor(t)||Math.ceil(e)!==Math.ceil(t)}function Kt(e,t){for(var i=++Ai%255,r=jt(e)||Yt(e)||e.silhouetteColor.alpha<1,n=e._rendererResources.silhouettePrograms,a=t.scene3DOnly,l=e._nodeCommands,c=l.length,h=0;h<c;++h){var d=l[h],p=d.command,m=Yt(e)?d.translucentCommand:p,f=B.shallowClone(m),_=o(m.renderState); +_.stencilTest={enabled:!0,frontFunction:O.ALWAYS,backFunction:O.ALWAYS,reference:i,mask:-1,frontOperation:{fail:O.KEEP,zFail:O.KEEP,zPass:O.REPLACE},backOperation:{fail:O.KEEP,zFail:O.KEEP,zPass:O.REPLACE}},Xt(e)&&(_.colorMask={red:!1,green:!1,blue:!1,alpha:!1},_.depthMask=!1),_=V.fromCache(_),f.renderState=_,d.silhouetteModelCommand=f;var g=B.shallowClone(p);_=o(p.renderState,!0),_.depthTest.enabled=!0,_.cull.enabled=!1,r&&(g.pass=F.TRANSLUCENT,_.depthMask=!1,_.blending=Z.ALPHA_BLEND),_.stencilTest={enabled:!0,frontFunction:O.NOTEQUAL,backFunction:O.NOTEQUAL,reference:i,mask:-1,frontOperation:{fail:O.KEEP,zFail:O.KEEP,zPass:O.KEEP},backOperation:{fail:O.KEEP,zFail:O.KEEP,zPass:O.KEEP}},_=V.fromCache(_);var v=p.shaderProgram,y=Wt(e,v),C=n[y];u(C)||(C=Ht(e,v,t),n[y]=C);var w=s(p.uniformMap,{gltf_silhouetteColor:Tt(e),gltf_silhouetteSize:xt(e)});if(g.renderState=_,g.shaderProgram=C,g.uniformMap=w,g.castShadows=!1,g.receiveShadows=!1,d.silhouetteColorCommand=g,!a){var S=d.command2D,E=B.shallowClone(f);E.boundingVolume=S.boundingVolume,E.modelMatrix=S.modelMatrix,d.silhouetteModelCommand2D=E;var b=B.shallowClone(g);E.boundingVolume=S.boundingVolume,E.modelMatrix=S.modelMatrix,d.silhouetteColorCommand2D=b}}}function Qt(e,t){if(qt(e,t)){var i=e._nodeCommands,r=Zt(e.color.alpha,e._colorPreviousAlpha)||Zt(e.silhouetteColor.alpha,e._silhouetteColorPreviousAlpha)||!u(i[0].silhouetteModelCommand);e._colorPreviousAlpha=e.color.alpha,e._silhouetteColorPreviousAlpha=e.silhouetteColor.alpha,r&&Kt(e,t)}}function Jt(e,t,i){return Pi.center=e,Pi.radius=t,i.camera.getPixelSize(Pi,i.context.drawingBufferWidth,i.context.drawingBufferHeight)}function $t(e,t){var r=e.scale;if(0!==e.minimumPixelSize){var n=t.context,o=Math.max(n.drawingBufferWidth,n.drawingBufferHeight),a=u(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;if(Di.x=a[12],Di.y=a[13],Di.z=a[14],u(e._rtcCenter)&&i.add(e._rtcCenter,Di,Di),e._mode!==ae.SCENE3D){var s=t.mapProjection,l=s.ellipsoid.cartesianToCartographic(Di,Mi);s.project(l,Di),i.fromElements(Di.z,Di.x,Di.y,Di)}var c=e.boundingSphere.radius,h=Jt(Di,c,t),d=1/h,p=Math.min(d*(2*c),o);p<e.minimumPixelSize&&(r=e.minimumPixelSize*h/(2*e._initialRadius))}return u(e.maximumScale)?Math.min(e.maximumScale,r):r}function ei(e){u(e._cacheKey)&&u(e._cachedGltf)&&0===--e._cachedGltf.count&&delete di[e._cacheKey],e._cachedGltf=void 0}function ti(e){var t=e.gltf.extensionsUsed;if(u(t))for(var i=t.length,r=0;r<i;++r){var n=t[r];if("CESIUM_RTC"!==n&&"KHR_binary_glTF"!==n&&"KHR_materials_common"!==n&&"WEB3D_quantized_attributes"!==n)throw new I("Unsupported glTF Extension: "+n)}}function ii(e,t){this.buffers=void 0,this.vertexArrays=void 0,this.programs=void 0,this.pickPrograms=void 0,this.silhouettePrograms=void 0,this.textures=void 0,this.samplers=void 0,this.renderStates=void 0,this.ready=!1,this.context=e,this.cacheKey=t,this.count=0}function ri(e){for(var t in e)e.hasOwnProperty(t)&&e[t].destroy()}function ni(e){ri(e.buffers),ri(e.vertexArrays),ri(e.programs),ri(e.pickPrograms),ri(e.silhouettePrograms),ri(e.textures)}function oi(e,t,i){return function(r){if(e.heightReference===$.RELATIVE_TO_GROUND){var n=t.cartesianToCartographic(r,Mi);n.height+=i.height,t.cartographicToCartesian(n,r)}var o=e._clampedModelMatrix;A.clone(e.modelMatrix,o),o[12]=r.x,o[13]=r.y,o[14]=r.z,e._heightChanged=!0}}function ai(e){u(e._removeUpdateHeightCallback)&&(e._removeUpdateHeightCallback(),e._removeUpdateHeightCallback=void 0);var t=e._scene;if(!u(t)||e.heightReference===$.NONE)return void(e._clampedModelMatrix=void 0);var i=t.globe,r=i.ellipsoid,o=e.modelMatrix;Di.x=o[12],Di.y=o[13],Di.z=o[14];var a=r.cartesianToCartographic(Di);u(e._clampedModelMatrix)||(e._clampedModelMatrix=A.clone(o,new A));var s=i._surface;e._removeUpdateHeightCallback=s.updateHeight(a,oi(e,r,a));var l=i.getHeight(a);if(u(l)){var c=oi(e,r,a);n.clone(a,Mi),Mi.height=l,r.cartographicToCartesian(Mi,Di),c(Di)}}function si(e,t){var r,n=e.distanceDisplayCondition,o=n.near*n.near,a=n.far*n.far;if(t.mode===ae.SCENE2D){var s=t.camera.frustum.right-t.camera.frustum.left;r=.5*s,r*=r}else{var l=A.getTranslation(e.modelMatrix,Ii);if(t.mode===ae.COLUMBUS_VIEW){var u=t.mapProjection,c=u.ellipsoid,h=c.cartesianToCartographic(l,Ri);l=u.project(h,l),i.fromElements(l.z,l.x,l.y,l)}r=i.distanceSquared(l,t.camera.positionWC)}return r>=o&&r<=a}if(!m.supportsTypedArrays())return{};var li=A.fromRotationTranslation(x.fromRotationX(b.PI_OVER_TWO)),ui=new i,ci={NEEDS_LOAD:0,LOADING:1,LOADED:2,FAILED:3},hi="model/vnd.gltf.binary,model/vnd.gltf+json,model/gltf.binary,model/gltf+json;q=0.8,application/json;q=0.2,*/*;q=0.01";le.prototype.getBuffer=function(e){return me(this.buffers[e.buffer],e.byteOffset,e.byteLength)},le.prototype.finishedPendingBufferLoads=function(){return 0===this.pendingBufferLoads},le.prototype.finishedBuffersCreation=function(){return 0===this.pendingBufferLoads&&0===this.buffersToCreate.length},le.prototype.finishedProgramCreation=function(){return 0===this.pendingShaderLoads&&0===this.programsToCreate.length},le.prototype.finishedTextureCreation=function(){var e=0===this.pendingTextureLoads,t=0===this.texturesToCreate.length&&0===this.texturesToCreateFromBufferView.length;return e&&t},le.prototype.finishedEverythingButTextureCreation=function(){var e=0===this.pendingBufferLoads&&0===this.pendingShaderLoads,t=0===this.buffersToCreate.length&&0===this.programsToCreate.length&&0===this.pendingBufferViewToImage;return e&&t},le.prototype.finished=function(){return this.finishedTextureCreation()&&this.finishedEverythingButTextureCreation()},c(ce.prototype,{gltf:{set:function(e){this._gltf=re(j(e))},get:function(){return this._gltf}},bgltf:{get:function(){return this._bgltf}}}),ce.prototype.makeReady=function(e,t){this.gltf=e,this._bgltf=t;for(var i=this.modelsToLoad,r=i.length,n=0;n<r;++n){var o=i[n];o.isDestroyed()||ue(o,this)}this.modelsToLoad=void 0,this.ready=!0};var di={};c(de.prototype,{gltf:{get:function(){return u(this._cachedGltf)?this._cachedGltf.gltf:void 0}},releaseGltfJson:{get:function(){return this._releaseGltfJson}},cacheKey:{get:function(){return this._cacheKey}},basePath:{get:function(){return this._basePath}},boundingSphere:{get:function(){var e=this.modelMatrix;this.heightReference!==$.NONE&&this._clampedModelMatrix&&(e=this._clampedModelMatrix);var t=A.getScale(e,ui),r=u(this.maximumScale)?Math.min(this.maximumScale,this.scale):this.scale;i.multiplyByScalar(t,r,t);var n=this._scaledBoundingSphere;return n.center=i.multiplyComponents(this._boundingSphere.center,t,n.center),n.radius=i.maximumComponent(t)*this._initialRadius,u(this._rtcCenter)&&i.add(this._rtcCenter,n.center,n.center),n}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},asynchronous:{get:function(){return this._asynchronous}},allowPicking:{get:function(){return this._allowPicking}},incrementallyLoadTextures:{get:function(){return this._incrementallyLoadTextures}},pendingTextureLoads:{get:function(){return u(this._loadResources)?this._loadResources.pendingTextureLoads:0}},dirty:{get:function(){return this._dirty}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=p.clone(e,this._distanceDisplayCondition)}}});var pi=Uint32Array.BYTES_PER_ELEMENT;de.silhouetteSupported=function(e){return pe(e.context)},de.fromGltf=function(e){var t=e.url,i=l(e.cacheKey,f(t));e=o(e),e.basePath=_(t),e.cacheKey=i;var r=new de(e);e.headers=u(e.headers)?o(e.headers):{},u(e.headers.Accept)||(e.headers.Accept=hi);var n=di[i];return u(n)?n.ready||(++n.count,n.modelsToLoad.push(r)):(n=new ce({ready:!1}),n.count=1,n.modelsToLoad.push(r),ue(r,n),di[i]=n,C(t,e.headers).then(function(e){var t=new Uint8Array(e);if(fe(t)){var i=_e(t);0!==i.binaryOffset&&(t=t.subarray(i.binaryOffset)),n.makeReady(i.glTF,t)}else{var r=v(t);n.makeReady(JSON.parse(r))}}).otherwise(Ce(r,"model",t))),r},de._gltfCache=di,de.prototype.getNode=function(e){var t=ge(this,"nodesByName",e);return u(t)?t.publicNode:void 0},de.prototype.getMesh=function(e){return ge(this,"meshesByName",e)},de.prototype.getMaterial=function(e){return ge(this,"materialsByName",e)};var mi=new i,fi=new i,_i=new i,gi=new D,vi=new i,yi=new i,Ci={MODEL:function(e,t){return function(){return e.model}},VIEW:function(e,t){return function(){return e.view}},PROJECTION:function(e,t){return function(){return e.projection}},MODELVIEW:function(e,t){return function(){return e.modelView}},CESIUM_RTC_MODELVIEW:function(e,t){var r=new A;return function(){return u(t._rtcCenter)?(A.getTranslation(e.model,yi),i.add(yi,t._rtcCenter,yi),A.multiplyByPoint(e.view,yi,yi),A.setTranslation(e.modelView,yi,r)):e.modelView}},MODELVIEWPROJECTION:function(e,t){return function(){return e.modelViewProjection}},MODELINVERSE:function(e,t){return function(){return e.inverseModel}},VIEWINVERSE:function(e,t){return function(){return e.inverseView}},PROJECTIONINVERSE:function(e,t){return function(){return e.inverseProjection}},MODELVIEWINVERSE:function(e,t){return function(){return e.inverseModelView}},MODELVIEWPROJECTIONINVERSE:function(e,t){return function(){return e.inverseModelViewProjection}},MODELINVERSETRANSPOSE:function(e,t){return function(){return e.inverseTransposeModel}},MODELVIEWINVERSETRANSPOSE:function(e,t){return function(){return e.normal}},VIEWPORT:function(e,t){return function(){return e.viewportCartesian4}}};c(_t.prototype,{value:{get:function(){if(!u(this._value)){var e=this._model._rendererResources.textures[this._textureId];if(!u(e))return this._model._defaultTexture;this._value=e}return this._value},set:function(e){this._value=e}}}),_t.prototype.clone=function(e,t){return e},_t.prototype.func=void 0;var wi={};wi[O.FLOAT]=ut,wi[O.FLOAT_VEC2]=ct,wi[O.FLOAT_VEC3]=ht,wi[O.FLOAT_VEC4]=dt,wi[O.INT]=ut,wi[O.INT_VEC2]=ct,wi[O.INT_VEC3]=ht,wi[O.INT_VEC4]=dt,wi[O.BOOL]=ut,wi[O.BOOL_VEC2]=ct,wi[O.BOOL_VEC3]=ht,wi[O.BOOL_VEC4]=dt,wi[O.FLOAT_MAT2]=pt,wi[O.FLOAT_MAT3]=mt,wi[O.FLOAT_MAT4]=ft,wi[O.SAMPLER_2D]=gt;var Si={MODEL:function(e,t,i){return function(){return i.computedMatrix}},VIEW:function(e,t,i){return function(){return e.view}},PROJECTION:function(e,t,i){return function(){return e.projection}},MODELVIEW:function(e,t,i){var r=new A;return function(){return A.multiplyTransformation(e.view,i.computedMatrix,r)}},CESIUM_RTC_MODELVIEW:function(e,t,i){var r=new A;return function(){return A.multiplyTransformation(e.view,i.computedMatrix,r),A.setTranslation(r,t._rtcCenterEye,r)}},MODELVIEWPROJECTION:function(e,t,i){var r=new A;return function(){return A.multiplyTransformation(e.view,i.computedMatrix,r),A.multiply(e._projection,r,r)}},MODELINVERSE:function(e,t,i){var r=new A;return function(){return A.inverse(i.computedMatrix,r)}},VIEWINVERSE:function(e,t){return function(){return e.inverseView}},PROJECTIONINVERSE:function(e,t,i){return function(){return e.inverseProjection}},MODELVIEWINVERSE:function(e,t,i){var r=new A,n=new A;return function(){return A.multiplyTransformation(e.view,i.computedMatrix,r),A.inverse(r,n)}},MODELVIEWPROJECTIONINVERSE:function(e,t,i){var r=new A,n=new A;return function(){return A.multiplyTransformation(e.view,i.computedMatrix,r),A.multiply(e._projection,r,r),A.inverse(r,n)}},MODELINVERSETRANSPOSE:function(e,t,i){var r=new A,n=new x;return function(){return A.inverse(i.computedMatrix,r),A.getRotation(r,n),x.transpose(n,n)}},MODELVIEWINVERSETRANSPOSE:function(e,t,i){var r=new A,n=new A,o=new x;return function(){return A.multiplyTransformation(e.view,i.computedMatrix,r),A.inverse(r,n),A.getRotation(n,o),x.transpose(o,o)}},VIEWPORT:function(e,t,i){return function(){return e.viewportCartesian4}}},Ei=[],bi=new r,Ti=new A,xi=new A,Ai=0,Pi=new e,Di=new i,Mi=new n;ii.prototype.release=function(){if(0===--this.count)return u(this.cacheKey)&&delete this.context.cache.modelRendererResourceCache[this.cacheKey],ni(this),h(this)};var Ii=new i,Ri=new n;return de.prototype.update=function(e){if(e.mode!==ae.MORPHING){var t=e.context;if(this._defaultTexture=t.defaultTexture,this._state===ci.NEEDS_LOAD&&u(this.gltf)){var r,n=this.cacheKey;if(u(n)){t.cache.modelRendererResourceCache=l(t.cache.modelRendererResourceCache,{});var o=t.cache.modelRendererResourceCache;if(r=o[this.cacheKey],u(r)){if(!r.ready)return;++r.count,this._loadRendererResourcesFromCache=!0}else r=new ii(t,n),r.count=1,o[this.cacheKey]=r;this._cachedRendererResources=r}else r=new ii(t),r.count=1,this._cachedRendererResources=r;if(this._state=ci.LOADING,this._boundingSphere=ye(this.gltf),this._initialRadius=this._boundingSphere.radius,ti(this),this._state!==ci.FAILED){var a=this.gltf.extensions;if(u(a)&&u(a.CESIUM_RTC)){var s=i.fromArray(a.CESIUM_RTC.center);if(!i.equals(s,i.ZERO)){this._rtcCenter3D=s;var c=e.mapProjection,h=c.ellipsoid,d=h.cartesianToCartographic(this._rtcCenter3D),p=c.project(d);i.fromElements(p.z,p.x,p.y,p),this._rtcCenter2D=p,this._rtcCenterEye=new i,this._rtcCenter=this._rtcCenter3D}}this._loadResources=new le,Oe(this)}}var m=this._loadResources,f=this._incrementallyLoadTextures,_=!1;if(this._state===ci.LOADING&&(It(this,e),(m.finished()||f&&m.finishedEverythingButTextureCreation())&&(this._state=ci.LOADED,_=!0)),u(m)&&this._state===ci.LOADED&&(f&&!_&&It(this,e),m.finished())){this._loadResources=void 0;var g=this._rendererResources,v=this._cachedRendererResources;v.buffers=g.buffers,v.vertexArrays=g.vertexArrays,v.programs=g.programs,v.pickPrograms=g.pickPrograms,v.silhouettePrograms=g.silhouettePrograms,v.textures=g.textures,v.samplers=g.samplers,v.renderStates=g.renderStates,v.ready=!0,this._normalAttributeName=Q(this.gltf,"NORMAL"),u(this._precreatedAttributes)&&(v.vertexArrays={}),this.releaseGltfJson&&ei(this)}var y=qt(this,e),C=Yt(this),w=Xt(this),S=!u(this.distanceDisplayCondition)||si(this,e),E=this.show&&S&&0!==this.scale&&(!w||y);if(E&&this._state===ci.LOADED||_){var T=this.activeAnimations.update(e)||this._cesiumAnimationsDirty;this._cesiumAnimationsDirty=!1,this._dirty=!1;var x=this.modelMatrix,P=e.mode!==this._mode;this._mode=e.mode;var D=!A.equals(this._modelMatrix,x)||this._scale!==this.scale||this._minimumPixelSize!==this.minimumPixelSize||0!==this.minimumPixelSize||this._maximumScale!==this.maximumScale||this._heightReference!==this.heightReference||this._heightChanged||P;if(D||_){A.clone(x,this._modelMatrix),ai(this),u(this._clampedModelMatrix)&&(x=this._clampedModelMatrix),this._scale=this.scale,this._minimumPixelSize=this.minimumPixelSize,this._maximumScale=this.maximumScale,this._heightReference=this.heightReference,this._heightChanged=!1;var M=$t(this,e),I=this._computedModelMatrix;A.multiplyByUniformScale(x,M,I),A.multiplyTransformation(I,li,I)}(T||D||_)&&(Ot(this,D,_,e.mapProjection),this._dirty=!0,(T||_)&&Nt(this)),this._perNodeShowDirty&&(this._perNodeShowDirty=!1,Lt(this)),Bt(this,t),Ft(this),Vt(this),kt(this),Gt(this,e),Qt(this,e)}if(_){var R=this;return void e.afterRender.push(function(){R._ready=!0,R._readyPromise.resolve(R)})}if(E&&!this._ignoreCommands){var O,N,L,B=e.commandList,F=e.passes,V=this._nodeCommands,k=V.length,z=e.mapProjection.ellipsoid.maximumRadius*b.PI;if(F.render){for(O=0;O<k;++O)if(N=V[O],N.show){var U=C?N.translucentCommand:N.command;if(U=y?N.silhouetteModelCommand:U,B.push(U),L=N.command.boundingVolume,e.mode===ae.SCENE2D&&(L.center.y+L.radius>z||L.center.y-L.radius<z)){var G=C?N.translucentCommand2D:N.command2D;G=y?N.silhouetteModelCommand2D:G,B.push(G)}}if(y)for(O=0;O<k;++O)N=V[O],N.show&&(B.push(N.silhouetteColorCommand),L=N.command.boundingVolume,e.mode===ae.SCENE2D&&(L.center.y+L.radius>z||L.center.y-L.radius<z)&&B.push(N.silhouetteColorCommand2D))}if(F.pick&&this.allowPicking)for(O=0;O<k;++O)if(N=V[O],N.show){var W=N.pickCommand;B.push(W),L=W.boundingVolume,e.mode===ae.SCENE2D&&(L.center.y+L.radius>z||L.center.y-L.radius<z)&&B.push(N.pickCommand2D)}}}},de.prototype.isDestroyed=function(){return!1},de.prototype.destroy=function(){u(this._precreatedAttributes)&&ri(this._rendererResources.vertexArrays),this._rendererResources=void 0,this._cachedRendererResources=this._cachedRendererResources&&this._cachedRendererResources.release();for(var e=this._pickIds,t=e.length,i=0;i<t;++i)e[i].destroy();return ei(this),h(this)},de}),i("DataSources/ModelVisualizer",["../Core/AssociativeArray","../Core/BoundingSphere","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Matrix4","../Scene/ColorBlendMode","../Scene/HeightReference","../Scene/Model","../Scene/ModelAnimationLoop","../Scene/ShadowMode","./BoundingSphereState","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p){"use strict";function m(t,i){i.collectionChanged.addEventListener(m.prototype._onCollectionChanged,this),this._scene=t,this._primitives=t.primitives,this._entityCollection=i,this._modelHash={},this._entitiesToVisualize=new e,this._onCollectionChanged(i,i.values,[],[])}function f(e,t,i,n){var o=i[t.id];r(o)&&(n.removeAndDestroy(o.modelPrimitive),delete i[t.id])}function _(e,t){var i=t[e.id];r(i)&&(i.nodeTransformationsScratch={})}function g(e){console.error(e)}var v=1,y=0,C=!0,w=h.ENABLED,S=l.NONE,E=i.RED,b=0,T=i.WHITE,x=s.HIGHLIGHT,A=.5,P=new a,D=new a;return m.prototype.update=function(e){for(var t=this._entitiesToVisualize.values,i=this._modelHash,n=this._primitives,o=0,s=t.length;o<s;o++){var l,h,d=t[o],m=d._model,f=i[d.id],_=d.isShowing&&d.isAvailable(e)&&p.getValueOrDefault(m._show,e,!0);if(_&&(h=d._getModelMatrix(e,P),l=p.getValueOrUndefined(m._uri,e),_=r(h)&&r(l)),_){var M=r(f)?f.modelPrimitive:void 0;if(r(M)&&l===f.uri||(r(M)&&(n.removeAndDestroy(M),delete i[d.id]),M=u.fromGltf({url:l,incrementallyLoadTextures:p.getValueOrDefault(m._incrementallyLoadTextures,e,C),scene:this._scene}),M.readyPromise.otherwise(g),M.id=d,n.add(M),f={modelPrimitive:M,uri:l,animationsRunning:!1,nodeTransformationsScratch:{},originalNodeMatrixHash:{}},i[d.id]=f),M.show=!0,M.scale=p.getValueOrDefault(m._scale,e,v),M.minimumPixelSize=p.getValueOrDefault(m._minimumPixelSize,e,y),M.maximumScale=p.getValueOrUndefined(m._maximumScale,e),M.modelMatrix=a.clone(h,M.modelMatrix),M.shadows=p.getValueOrDefault(m._shadows,e,w),M.heightReference=p.getValueOrDefault(m._heightReference,e,S),M.distanceDisplayCondition=p.getValueOrUndefined(m._distanceDisplayCondition,e),M.silhouetteColor=p.getValueOrDefault(m._silhouetteColor,e,E,M._silhouetteColor),M.silhouetteSize=p.getValueOrDefault(m._silhouetteSize,e,b),M.color=p.getValueOrDefault(m._color,e,T,M._color),M.colorBlendMode=p.getValueOrDefault(m._colorBlendMode,e,x),M.colorBlendAmount=p.getValueOrDefault(m._colorBlendAmount,e,A),M.ready){var I=p.getValueOrDefault(m._runAnimations,e,!0);f.animationsRunning!==I&&(I?M.activeAnimations.addAll({loop:c.REPEAT}):M.activeAnimations.removeAll(),f.animationsRunning=I);var R=p.getValueOrUndefined(m._nodeTransformations,e,f.nodeTransformationsScratch);if(r(R))for(var O=f.originalNodeMatrixHash,N=Object.keys(R),L=0,B=N.length;L<B;++L){var F=N[L],V=R[F];if(r(V)){var k=M.getNode(F);if(r(k)){var z=O[F];r(z)||(z=k.matrix.clone(),O[F]=z);var U=a.fromTranslationRotationScale(V,D);k.matrix=a.multiply(z,U,U)}}}}}else r(f)&&(f.modelPrimitive.show=!1)}return!0},m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(m.prototype._onCollectionChanged,this);for(var e=this._entitiesToVisualize.values,t=this._modelHash,i=this._primitives,r=e.length-1;r>-1;r--)f(this,e[r],t,i);return n(this)},m.prototype.getBoundingSphere=function(e,i){var n=this._modelHash[e.id];if(!r(n))return d.FAILED;var o=n.modelPrimitive;if(!r(o)||!o.show)return d.FAILED;if(!o.ready)return d.PENDING;if(o.heightReference===l.NONE)t.transform(o.boundingSphere,o.modelMatrix,i);else{if(!r(o._clampedModelMatrix))return d.PENDING;t.transform(o.boundingSphere,o._clampedModelMatrix,i)}return d.DONE},m.prototype._onCollectionChanged=function(e,t,i,n){var o,a,s=this._entitiesToVisualize,l=this._modelHash,u=this._primitives;for(o=t.length-1;o>-1;o--)a=t[o],r(a._model)&&r(a._position)&&s.set(a.id,a);for(o=n.length-1;o>-1;o--)a=n[o],r(a._model)&&r(a._position)?(_(a,l),s.set(a.id,a)):(f(this,a,l,u),s.remove(a.id));for(o=i.length-1;o>-1;o--)a=i[o],f(this,a,l,u),s.remove(a.id)},m}),i("Shaders/PolylineCommon",[],function(){"use strict";return"void clipLineSegmentToNearPlane(\nvec3 p0,\nvec3 p1,\nout vec4 positionWC,\nout bool clipped,\nout bool culledByNearPlane)\n{\nculledByNearPlane = false;\nclipped = false;\nvec3 p1ToP0 = p1 - p0;\nfloat magnitude = length(p1ToP0);\nvec3 direction = normalize(p1ToP0);\nfloat endPoint0Distance = -(czm_currentFrustum.x + p0.z);\nfloat denominator = -direction.z;\nif (endPoint0Distance < 0.0 && abs(denominator) < czm_epsilon7)\n{\nculledByNearPlane = true;\n}\nelse if (endPoint0Distance < 0.0 && abs(denominator) > czm_epsilon7)\n{\nfloat t = (czm_currentFrustum.x + p0.z) / denominator;\nif (t < 0.0 || t > magnitude)\n{\nculledByNearPlane = true;\n}\nelse\n{\np0 = p0 + t * direction;\nclipped = true;\n}\n}\npositionWC = czm_eyeToWindowCoordinates(vec4(p0, 1.0));\n}\nvec4 getPolylineWindowCoordinates(vec4 position, vec4 previous, vec4 next, float expandDirection, float width, bool usePrevious) {\nvec4 endPointWC, p0, p1;\nbool culledByNearPlane, clipped;\nvec4 positionEC = czm_modelViewRelativeToEye * position;\nvec4 prevEC = czm_modelViewRelativeToEye * previous;\nvec4 nextEC = czm_modelViewRelativeToEye * next;\nclipLineSegmentToNearPlane(prevEC.xyz, positionEC.xyz, p0, clipped, culledByNearPlane);\nclipLineSegmentToNearPlane(nextEC.xyz, positionEC.xyz, p1, clipped, culledByNearPlane);\nclipLineSegmentToNearPlane(positionEC.xyz, usePrevious ? prevEC.xyz : nextEC.xyz, endPointWC, clipped, culledByNearPlane);\nif (culledByNearPlane)\n{\nreturn vec4(0.0, 0.0, 0.0, 1.0);\n}\nvec2 prevWC = normalize(p0.xy - endPointWC.xy);\nvec2 nextWC = normalize(p1.xy - endPointWC.xy);\nfloat expandWidth = width * 0.5;\nvec2 direction;\nif (czm_equalsEpsilon(previous.xyz - position.xyz, vec3(0.0), czm_epsilon1) || czm_equalsEpsilon(prevWC, -nextWC, czm_epsilon1))\n{\ndirection = vec2(-nextWC.y, nextWC.x);\n}\nelse if (czm_equalsEpsilon(next.xyz - position.xyz, vec3(0.0), czm_epsilon1) || clipped)\n{\ndirection = vec2(prevWC.y, -prevWC.x);\n}\nelse\n{\nvec2 normal = vec2(-nextWC.y, nextWC.x);\ndirection = normalize((nextWC + prevWC) * 0.5);\nif (dot(direction, normal) < 0.0)\n{\ndirection = -direction;\n}\nfloat sinAngle = abs(direction.x * nextWC.y - direction.y * nextWC.x);\nexpandWidth = clamp(expandWidth / sinAngle, 0.0, width * 2.0);\n}\nvec2 offset = direction * expandDirection * expandWidth * czm_resolutionScale;\nreturn vec4(endPointWC.xy + offset, -endPointWC.z, 1.0);\n}\n"}),i("Shaders/PolylineFS",[],function(){"use strict";return"varying vec2 v_st;\nvoid main()\n{\nczm_materialInput materialInput;\nmaterialInput.s = v_st.s;\nmaterialInput.st = v_st;\nmaterialInput.str = vec3(v_st, 0.0);\nczm_material material = czm_getMaterial(materialInput);\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n}\n"}),i("Shaders/PolylineVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 position2DHigh;\nattribute vec3 position2DLow;\nattribute vec3 prevPosition3DHigh;\nattribute vec3 prevPosition3DLow;\nattribute vec3 prevPosition2DHigh;\nattribute vec3 prevPosition2DLow;\nattribute vec3 nextPosition3DHigh;\nattribute vec3 nextPosition3DLow;\nattribute vec3 nextPosition2DHigh;\nattribute vec3 nextPosition2DLow;\nattribute vec4 texCoordExpandAndBatchIndex;\nvarying vec2 v_st;\nvarying float v_width;\nvarying vec4 czm_pickColor;\nvoid main()\n{\nfloat texCoord = texCoordExpandAndBatchIndex.x;\nfloat expandDir = texCoordExpandAndBatchIndex.y;\nbool usePrev = texCoordExpandAndBatchIndex.z < 0.0;\nfloat batchTableIndex = texCoordExpandAndBatchIndex.w;\nvec2 widthAndShow = batchTable_getWidthAndShow(batchTableIndex);\nfloat width = widthAndShow.x + 0.5;\nfloat show = widthAndShow.y;\nif (width < 1.0)\n{\nshow = 0.0;\n}\nvec4 pickColor = batchTable_getPickColor(batchTableIndex);\nvec4 p, prev, next;\nif (czm_morphTime == 1.0)\n{\np = czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz);\nprev = czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz);\nnext = czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz);\n}\nelse if (czm_morphTime == 0.0)\n{\np = czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy);\nprev = czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy);\nnext = czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy);\n}\nelse\n{\np = czm_columbusViewMorph(\nczm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy),\nczm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz),\nczm_morphTime);\nprev = czm_columbusViewMorph(\nczm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy),\nczm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz),\nczm_morphTime);\nnext = czm_columbusViewMorph(\nczm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy),\nczm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz),\nczm_morphTime);\n}\n#ifdef DISTANCE_DISPLAY_CONDITION\nvec3 centerHigh = batchTable_getCenterHigh(batchTableIndex);\nvec4 centerLowAndRadius = batchTable_getCenterLowAndRadius(batchTableIndex);\nvec3 centerLow = centerLowAndRadius.xyz;\nfloat radius = centerLowAndRadius.w;\nvec2 distanceDisplayCondition = batchTable_getDistanceDisplayCondition(batchTableIndex);\nfloat lengthSq;\nif (czm_sceneMode == czm_sceneMode2D)\n{\nlengthSq = czm_eyeHeight2D.y;\n}\nelse\n{\nvec4 center = czm_translateRelativeToEye(centerHigh.xyz, centerLow.xyz);\nlengthSq = max(0.0, dot(center.xyz, center.xyz) - radius * radius);\n}\nfloat nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x;\nfloat farSq = distanceDisplayCondition.y * distanceDisplayCondition.y;\nif (lengthSq < nearSq || lengthSq > farSq)\n{\nshow = 0.0;\n}\n#endif\nvec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev);\ngl_Position = czm_viewportOrthographic * positionWC * show;\nv_st = vec2(texCoord, clamp(expandDir, 0.0, 1.0));\nv_width = width;\nczm_pickColor = pickColor;\n}\n"}),i("Scene/Polyline",["../Core/arrayRemoveDuplicates","../Core/BoundingSphere","../Core/Cartesian3","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/Matrix4","../Core/PolylinePipeline","./Material"],function(e,t,i,r,n,o,a,s,l,u,c,h){"use strict";function d(a,s){a=n(a,n.EMPTY_OBJECT),this._show=n(a.show,!0),this._width=n(a.width,1),this._loop=n(a.loop,!1),this._distanceDisplayCondition=a.distanceDisplayCondition,this._material=a.material,o(this._material)||(this._material=h.fromType(h.ColorType,{color:new r(1,1,1,1)}));var l=a.positions;o(l)||(l=[]),this._positions=l,this._actualPositions=e(l,i.equalsEpsilon),this._loop&&this._actualPositions.length>2&&(this._actualPositions===this._positions&&(this._actualPositions=l.slice()),this._actualPositions.push(i.clone(this._actualPositions[0]))),this._length=this._actualPositions.length,this._id=a.id;var d;o(s)&&(d=u.clone(s.modelMatrix)),this._modelMatrix=d,this._segments=c.wrapLongitude(this._actualPositions,d),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(C),this._polylineCollection=s,this._dirty=!1,this._pickId=void 0,this._boundingVolume=t.fromPoints(this._actualPositions),this._boundingVolumeWC=t.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new t}function p(e,t){++e._propertiesChanged[t];var i=e._polylineCollection;o(i)&&(i._updatePolyline(e,t),e._dirty=!0)}var m=d.POSITION_INDEX=0,f=d.SHOW_INDEX=1,_=d.WIDTH_INDEX=2,g=d.MATERIAL_INDEX=3,v=d.POSITION_SIZE_INDEX=4,y=d.DISTANCE_DISPLAY_CONDITION=5,C=d.NUMBER_OF_PROPERTIES=6;return a(d.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e,p(this,f))}},positions:{get:function(){return this._positions},set:function(r){var n=e(r,i.equalsEpsilon);this._loop&&n.length>2&&(n===r&&(n=r.slice()),n.push(i.clone(n[0]))),this._actualPositions.length===n.length&&this._actualPositions.length===this._length||p(this,v),this._positions=r,this._actualPositions=n,this._length=n.length,this._boundingVolume=t.fromPoints(this._actualPositions,this._boundingVolume),this._boundingVolumeWC=t.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),p(this,m),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,p(this,g))}},width:{get:function(){return this._width},set:function(e){var t=this._width;e!==t&&(this._width=e,p(this,_))}},loop:{get:function(){return this._loop},set:function(e){if(e!==this._loop){var t=this._actualPositions;e?t.length>2&&!i.equals(t[0],t[t.length-1])&&(t.length===this._positions.length&&(this._actualPositions=t=this._positions.slice()),t.push(i.clone(t[0]))):t.length>2&&i.equals(t[0],t[t.length-1])&&(t.length-1===this._positions.length?this._actualPositions=this._positions:t.pop()),this._loop=e,p(this,v)}}},id:{get:function(){return this._id},set:function(e){this._id=e,o(this._pickId)&&(this._pickId.object.id=e)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){l.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=l.clone(e,this._distanceDisplayCondition),p(this,y))}}}),d.prototype.update=function(){var e=u.IDENTITY;o(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);var i=this._segments.positions.length,r=this._segments.lengths,n=this._propertiesChanged[m]>0||this._propertiesChanged[v]>0;if(u.equals(e,this._modelMatrix)&&!n||(this._segments=c.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=t.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=e,this._segments.positions.length!==i)p(this,v);else for(var a=r.length,s=0;s<a;++s)if(r[s]!==this._segments.lengths[s]){p(this,v);break}},d.prototype.getPickId=function(e){return o(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._polylineCollection,id:this._id})),this._pickId},d.prototype._clean=function(){this._dirty=!1;for(var e=this._propertiesChanged,t=0;t<C-1;++t)e[t]=0},d.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0},d}),i("Scene/PolylineCollection",["../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EncodedCartesian3","../Core/IndexDatatype","../Core/Intersect","../Core/Math","../Core/Matrix4","../Core/Plane","../Core/RuntimeError","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/ContextLimits","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArray","../Shaders/PolylineCommon","../Shaders/PolylineFS","../Shaders/PolylineVS","./BatchTable","./BlendingState","./Material","./Polyline","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I,R,O,N,L){"use strict";function B(e){e=s(e,s.EMPTY_OBJECT),this.modelMatrix=_.clone(s(e.modelMatrix,_.IDENTITY)),this._modelMatrix=_.clone(_.IDENTITY),this.debugShowBoundingVolume=s(e.debugShowBoundingVolume,!1),this._opaqueRS=void 0,this._translucentRS=void 0,this._colorCommands=[],this._pickCommands=[],this._polylinesUpdated=!1,this._polylinesRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(re),this._polylines=[],this._polylineBuckets={},this._positionBufferUsage={bufferUsage:C.STATIC_DRAW, +frameCount:0},this._mode=void 0,this._polylinesToUpdate=[],this._vertexArrays=[],this._positionBuffer=void 0,this._texCoordExpandAndBatchIndexBuffer=void 0,this._batchTable=void 0,this._createBatchTable=!1}function F(e,t){l(e._batchTable)&&e._batchTable.destroy();var i=[{functionName:"batchTable_getWidthAndShow",componentDatatype:a.UNSIGNED_BYTE,componentsPerAttribute:2},{functionName:"batchTable_getPickColor",componentDatatype:a.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0},{functionName:"batchTable_getCenterHigh",componentDatatype:a.FLOAT,componentsPerAttribute:3},{functionName:"batchTable_getCenterLowAndRadius",componentDatatype:a.FLOAT,componentsPerAttribute:4},{functionName:"batchTable_getDistanceDisplayCondition",componentDatatype:a.FLOAT,componentsPerAttribute:2}];e._batchTable=new I(t,i,e._polylines.length)}function V(t,i,r,n,o){for(var a=i.context,s=i.commandList,u=r.length,c=0,h=!0,d=t._vertexArrays,p=t.debugShowBoundingVolume,m=t._batchTable,f=m.getUniformMapCallback(),_=d.length,g=0;g<_;++g)for(var v=d[g],y=v.buckets,C=y.length,w=0;w<C;++w){for(var b,T,x,A=y[w],P=A.offset,D=o?A.bucket.shaderProgram:A.bucket.pickShaderProgram,M=A.bucket.polylines,I=M.length,R=0,O=0;O<I;++O){var N=M[O],B=U(N._material);if(B!==b){if(l(b)&&R>0){var F=T.isTranslucent();c>=u?(x=new S({owner:t}),r.push(x)):x=r[c],++c,x.boundingVolume=e.clone(le,x.boundingVolume),x.modelMatrix=n,x.shaderProgram=D,x.vertexArray=v.va,x.renderState=F?t._translucentRS:t._opaqueRS,x.pass=F?E.TRANSLUCENT:E.OPAQUE,x.debugShowBoundingVolume=!!o&&p,x.uniformMap=f(T._uniforms),x.count=R,x.offset=P,P+=R,R=0,h=!0,s.push(x)}T=N._material,T.update(a),b=B}for(var V=N._locatorBuckets,k=V.length,z=0;z<k;++z){var G=V[z];G.locator===A&&(R+=G.count)}var W;i.mode===L.SCENE3D?W=N._boundingVolumeWC:i.mode===L.COLUMBUS_VIEW?W=N._boundingVolume2D:i.mode===L.SCENE2D?l(N._boundingVolume2D)&&(W=e.clone(N._boundingVolume2D,ue),W.center.x=0):l(N._boundingVolumeWC)&&l(N._boundingVolume2D)&&(W=e.union(N._boundingVolumeWC,N._boundingVolume2D,ue)),h?(h=!1,e.clone(W,le)):e.union(W,le,le)}l(b)&&R>0&&(c>=u?(x=new S({owner:t}),r.push(x)):x=r[c],++c,x.boundingVolume=e.clone(le,x.boundingVolume),x.modelMatrix=n,x.shaderProgram=D,x.vertexArray=v.va,x.renderState=T.isTranslucent()?t._translucentRS:t._opaqueRS,x.pass=T.isTranslucent()?E.TRANSLUCENT:E.OPAQUE,x.debugShowBoundingVolume=!!o&&p,x.uniformMap=f(T._uniforms),x.count=R,x.offset=P,h=!0,s.push(x)),b=void 0}r.length=c}function k(e){var t=!1,i=e._propertiesChanged,r=e._positionBufferUsage;return i[$]?r.bufferUsage!==C.STREAM_DRAW?(t=!0,r.bufferUsage=C.STREAM_DRAW,r.frameCount=100):r.frameCount=100:r.bufferUsage!==C.STATIC_DRAW&&(0===r.frameCount?(t=!0,r.bufferUsage=C.STATIC_DRAW):r.frameCount--),t}function z(e,t,i){e._createVertexArray=!1,q(e),j(e),G(e);var r,n,o=[[]],s=o[0],u=e._batchTable,c=[0],h=0,d=[[]],m=0,_=e._polylineBuckets;for(r in _)_.hasOwnProperty(r)&&(n=_[r],n.updateShader(t,u),m+=n.lengthOfPositions);if(m>0){var g,v=e._mode,w=new Float32Array(6*m*3),S=new Float32Array(4*m),E=0,b=0,T=0;for(r in _)if(_.hasOwnProperty(r)){n=_[r],n.write(w,S,E,b,T,u,t,i),v===L.MORPHING&&(l(g)||(g=new Float32Array(6*m*3)),n.writeForMorph(g,E));var x=n.lengthOfPositions;E+=6*x*3,b+=4*x,T+=4*x,h=n.updateIndices(o,c,d,h)}var P=e._positionBufferUsage.bufferUsage,D=C.STATIC_DRAW;e._positionBuffer=y.createVertexBuffer({context:t,typedArray:w,usage:P});var M;l(g)&&(M=y.createVertexBuffer({context:t,typedArray:g,usage:P})),e._texCoordExpandAndBatchIndexBuffer=y.createVertexBuffer({context:t,typedArray:S,usage:D});for(var I=3*Float32Array.BYTES_PER_ELEMENT,R=4*Float32Array.BYTES_PER_ELEMENT,O=0,N=o.length,B=0;B<N;++B)if(s=o[B],s.length>0){var F=new Uint16Array(s),V=y.createIndexBuffer({context:t,typedArray:F,usage:C.STATIC_DRAW,indexDatatype:p.UNSIGNED_SHORT});O+=c[B];var k,z,U,W,H=6*(B*(I*f.SIXTY_FOUR_KILOBYTES)-O*I),Y=I+H,X=I+Y,Z=I+X,K=I+Z,Q=I+K,J=B*(R*f.SIXTY_FOUR_KILOBYTES)-O*R,$=[{index:ne.position3DHigh,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:H,strideInBytes:6*I},{index:ne.position3DLow,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:Y,strideInBytes:6*I},{index:ne.position2DHigh,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:H,strideInBytes:6*I},{index:ne.position2DLow,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:Y,strideInBytes:6*I},{index:ne.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:X,strideInBytes:6*I},{index:ne.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:Z,strideInBytes:6*I},{index:ne.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:X,strideInBytes:6*I},{index:ne.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:Z,strideInBytes:6*I},{index:ne.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:K,strideInBytes:6*I},{index:ne.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:Q,strideInBytes:6*I},{index:ne.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:K,strideInBytes:6*I},{index:ne.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:Q,strideInBytes:6*I},{index:ne.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:a.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:J}];v===L.SCENE3D?(k=e._positionBuffer,z="vertexBuffer",U=ce,W="value"):v===L.SCENE2D||v===L.COLUMBUS_VIEW?(k=ce,z="value",U=e._positionBuffer,W="vertexBuffer"):(k=M,z="vertexBuffer",U=e._positionBuffer,W="vertexBuffer"),$[0][z]=k,$[1][z]=k,$[2][W]=U,$[3][W]=U,$[4][z]=k,$[5][z]=k,$[6][W]=U,$[7][W]=U,$[8][z]=k,$[9][z]=k,$[10][W]=U,$[11][W]=U;var ee=new A({context:t,attributes:$,indexBuffer:V});e._vertexArrays.push({va:ee,buckets:d[B]})}}}function U(e){var t=O._uniformList[e.type],i=t.length;he.length=2*i;for(var r=0,n=0;n<i;++n){var o=t[n];he[r]=o,he[r+1]=e._uniforms[o](),r+=2}return e.type+":"+JSON.stringify(he)}function G(e){for(var t=e._mode,i=e._modelMatrix,r=e._polylineBuckets={},n=e._polylines,o=n.length,a=0;a<o;++a){var s=n[a];if(s._actualPositions.length>1){s.update();var u=s.material,c=r[u.type];l(c)||(c=r[u.type]=new Z(u,t,i)),c.addPolyline(s)}}}function W(e,t){var i=t.mode;e._mode===i&&_.equals(e._modelMatrix,e.modelMatrix)||(e._mode=i,e._modelMatrix=_.clone(e.modelMatrix),e._createVertexArray=!0)}function H(e){if(e._polylinesRemoved){e._polylinesRemoved=!1;for(var t=[],i=e._polylines.length,r=0,n=0;r<i;++r){var o=e._polylines[r];l(o)&&(o._index=n++,t.push(o))}e._polylines=t}}function q(e){for(var t=e._polylines,i=t.length,r=0;r<i;++r)if(l(t[r])){var n=t[r]._bucket;l(n)&&(n.shaderProgram=n.shaderProgram&&n.shaderProgram.destroy())}}function j(e){for(var t=e._vertexArrays.length,i=0;i<t;++i)e._vertexArrays[i].va.destroy();e._vertexArrays.length=0}function Y(e){for(var t=e._polylines,i=t.length,r=0;r<i;++r)l(t[r])&&t[r]._destroy()}function X(e,t,i){this.count=e,this.offset=t,this.bucket=i}function Z(e,t,i){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.pickShaderProgram=void 0,this.mode=t,this.modelMatrix=i}function K(e){return i.dot(i.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersectPlane(g.ORIGIN_ZX_PLANE)===m.INTERSECTING}var Q=N.SHOW_INDEX,J=N.WIDTH_INDEX,$=N.POSITION_INDEX,ee=N.MATERIAL_INDEX,te=N.POSITION_SIZE_INDEX,ie=N.DISTANCE_DISPLAY_CONDITION,re=N.NUMBER_OF_PROPERTIES,ne={texCoordExpandAndBatchIndex:0,position3DHigh:1,position3DLow:2,position2DHigh:3,position2DLow:4,prevPosition3DHigh:5,prevPosition3DLow:6,prevPosition2DHigh:7,prevPosition2DLow:8,nextPosition3DHigh:9,nextPosition3DLow:10,nextPosition2DHigh:11,nextPosition2DLow:12};u(B.prototype,{length:{get:function(){return H(this),this._polylines.length}}}),B.prototype.add=function(e){var t=new N(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,this._createBatchTable=!0,t},B.prototype.remove=function(e){if(this.contains(e)){if(this._polylines[e._index]=void 0,this._polylinesRemoved=!0,this._createVertexArray=!0,this._createBatchTable=!0,l(e._bucket)){var t=e._bucket;t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy(),t.pickShaderProgram=t.pickShaderProgram&&t.pickShaderProgram.destroy()}return e._destroy(),!0}return!1},B.prototype.removeAll=function(){q(this),Y(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0},B.prototype.contains=function(e){return l(e)&&e._polylineCollection===this},B.prototype.get=function(e){return H(this),this._polylines[e]};var oe=new d,ae=new r,se=new t;B.prototype.update=function(e){if(H(this),0!==this._polylines.length){W(this,e);var i,n=e.context,o=e.mapProjection,a=this._propertiesChanged;if(this._createBatchTable){if(0===w.maximumVertexTextureImageUnits)throw new v("Vertex texture fetch support is required to render polylines. The maximum number of vertex texture image units must be greater than zero.");F(this,n),this._createBatchTable=!1}if(this._createVertexArray||k(this))z(this,n,o);else if(this._polylinesUpdated){var s=this._polylinesToUpdate;if(this._mode!==L.SCENE3D)for(var u=s.length,c=0;c<u;++c)i=s[c],i.update();if(a[te]||a[ee])z(this,n,o);else for(var h=s.length,p=this._polylineBuckets,m=0;m<h;++m){i=s[m],a=i._propertiesChanged;var f=i._bucket,g=0;for(var y in p)if(p.hasOwnProperty(y)){if(p[y]===f){a[$]&&f.writeUpdate(g,i,this._positionBuffer,o);break}g+=p[y].lengthOfPositions}if((a[Q]||a[J])&&this._batchTable.setBatchedAttribute(i._index,0,new t(i._width,i._show)),this._batchTable.attributes.length>2){if(a[$]||a[te]){var C=e.mode===L.SCENE2D?i._boundingVolume2D:i._boundingVolumeWC,S=d.fromCartesian(C.center,oe),E=r.fromElements(S.low.x,S.low.y,S.low.z,C.radius,ae);this._batchTable.setBatchedAttribute(i._index,2,S.high),this._batchTable.setBatchedAttribute(i._index,3,E)}if(a[ie]){var T=se;T.x=0,T.y=Number.MAX_VALUE;var x=i.distanceDisplayCondition;l(x)&&(T.x=x.near,T.x=x.far),this._batchTable.setBatchedAttribute(i._index,4,T)}}i._clean()}s.length=0,this._polylinesUpdated=!1}a=this._propertiesChanged;for(var A=0;A<re;++A)a[A]=0;var P=_.IDENTITY;e.mode===L.SCENE3D&&(P=this.modelMatrix);var D=e.passes,M=0!==e.morphTime;if(l(this._opaqueRS)&&this._opaqueRS.depthTest.enabled===M||(this._opaqueRS=b.fromCache({depthMask:M,depthTest:{enabled:M}})),l(this._translucentRS)&&this._translucentRS.depthTest.enabled===M||(this._translucentRS=b.fromCache({blending:R.ALPHA_BLEND,depthMask:!M,depthTest:{enabled:M}})),this._batchTable.update(e),D.render){var I=this._colorCommands;V(this,e,I,P,!0)}if(D.pick){var O=this._pickCommands;V(this,e,O,P,!1)}}};var le=new e,ue=new e;B.prototype.isDestroyed=function(){return!1},B.prototype.destroy=function(){return j(this),q(this),Y(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),c(this)};var ce=[0,0,0],he=[];B.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,this._polylinesToUpdate.push(e),++this._propertiesChanged[t]},Z.prototype.addPolyline=function(e){var t=this.polylines;t.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this},Z.prototype.updateShader=function(e,t){if(!l(this.shaderProgram)){var i=["DISTANCE_DISPLAY_CONDITION"],r=t.getVertexShaderCallback()(M),n=new x({defines:i,sources:[P,r]}),o=new x({sources:[this.material.shaderSource,D]}),a=new x({sources:o.sources,pickColorQualifier:"varying"});this.shaderProgram=T.fromCache({context:e,vertexShaderSource:n,fragmentShaderSource:o,attributeLocations:ne}),this.pickShaderProgram=T.fromCache({context:e,vertexShaderSource:n,fragmentShaderSource:a,attributeLocations:ne})}},Z.prototype.getPolylinePositionsLength=function(e){var t;if(this.mode===L.SCENE3D||!K(e))return t=e._actualPositions.length,4*t-4;var i=0,r=e._segments.lengths;t=r.length;for(var n=0;n<t;++n)i+=4*r[n]-4;return i};var de=new i,pe=new i,me=new i,fe=new i,_e=new r,ge=new t;Z.prototype.write=function(e,t,n,a,s,u,c,h){for(var p=this.mode,m=h.ellipsoid.maximumRadius*f.PI,_=this.polylines,g=_.length,v=0;v<g;++v){for(var y,C=_[v],w=C.width,S=C.show&&w>0,E=C._index,b=this.getSegments(C,h),T=b.positions,x=b.lengths,A=T.length,P=C.getPickId(c).color,D=0,M=0,I=0;I<A;++I){0===I?C._loop?y=T[A-2]:(y=fe,i.subtract(T[0],T[1],y),i.add(T[0],y,y)):y=T[I-1],i.clone(y,pe),i.clone(T[I],de),I===A-1?C._loop?y=T[1]:(y=fe,i.subtract(T[A-1],T[A-2],y),i.add(T[A-1],y,y)):y=T[I+1],i.clone(y,me);var R=x[D];I===M+R&&(M+=R,++D);var O=I-M===0,N=I===M+x[D]-1;p===L.SCENE2D&&(pe.z=0,de.z=0,me.z=0),p!==L.SCENE2D&&p!==L.MORPHING||(O||N)&&m-Math.abs(de.x)<1&&((de.x<0&&pe.x>0||de.x>0&&pe.x<0)&&i.clone(de,pe),(de.x<0&&me.x>0||de.x>0&&me.x<0)&&i.clone(de,me));for(var B=O?2:0,F=N?2:4,V=B;V<F;++V){d.writeElements(de,e,n),d.writeElements(pe,e,n+6),d.writeElements(me,e,n+12);var k=V-2<0?-1:1;t[s]=I/(A-1),t[s+1]=2*(V%2)-1,t[s+2]=k,t[s+3]=E,n+=18,s+=4}}var z=_e;z.x=o.floatToByte(P.red),z.y=o.floatToByte(P.green),z.z=o.floatToByte(P.blue),z.w=o.floatToByte(P.alpha);var U=ge;U.x=w,U.y=S?1:0;var G=p===L.SCENE2D?C._boundingVolume2D:C._boundingVolumeWC,W=d.fromCartesian(G.center,oe),H=W.high,q=r.fromElements(W.low.x,W.low.y,W.low.z,G.radius,ae),j=se;j.x=0,j.y=Number.MAX_VALUE;var Y=C.distanceDisplayCondition;l(Y)&&(j.x=Y.near,j.y=Y.far),u.setBatchedAttribute(E,0,U),u.setBatchedAttribute(E,1,z),u.attributes.length>2&&(u.setBatchedAttribute(E,2,H),u.setBatchedAttribute(E,3,q),u.setBatchedAttribute(E,4,j))}};var ve=new i,ye=new i,Ce=new i,we=new i;Z.prototype.writeForMorph=function(e,t){for(var r=this.modelMatrix,n=this.polylines,o=n.length,a=0;a<o;++a)for(var s=n[a],l=s._segments.positions,u=s._segments.lengths,c=l.length,h=0,p=0,m=0;m<c;++m){var f;0===m?s._loop?f=l[c-2]:(f=we,i.subtract(l[0],l[1],f),i.add(l[0],f,f)):f=l[m-1],f=_.multiplyByPoint(r,f,ye);var g,v=_.multiplyByPoint(r,l[m],ve);m===c-1?s._loop?g=l[1]:(g=we,i.subtract(l[c-1],l[c-2],g),i.add(l[c-1],g,g)):g=l[m+1],g=_.multiplyByPoint(r,g,Ce);var y=u[h];m===p+y&&(p+=y,++h);for(var C=m-p===0,w=m===p+u[h]-1,S=C?2:0,E=w?2:4,b=S;b<E;++b)d.writeElements(v,e,t),d.writeElements(f,e,t+6),d.writeElements(g,e,t+12),t+=18}};var Se=new Array(1);Z.prototype.updateIndices=function(e,t,i,r){var n=i.length-1,o=new X(0,r,this);i[n].push(o);var a=0,s=e[e.length-1],l=0;s.length>0&&(l=s[s.length-1]+1);for(var u=this.polylines,c=u.length,h=0;h<c;++h){var d=u[h];d._locatorBuckets=[];var p;if(this.mode===L.SCENE3D){p=Se;var m=d._actualPositions.length;if(!(m>0))continue;p[0]=m}else p=d._segments.lengths;var _=p.length;if(_>0){for(var g=0,v=0;v<_;++v)for(var y=p[v]-1,C=0;C<y;++C)l+4>=f.SIXTY_FOUR_KILOBYTES-2&&(d._locatorBuckets.push({locator:o,count:g}),g=0,t.push(4),s=[],e.push(s),l=0,o.count=a,a=0,r=0,o=new X(0,0,this),i[++n]=[o]),s.push(l,l+2,l+1),s.push(l+1,l+2,l+3),g+=6,a+=6,r+=6,l+=4;d._locatorBuckets.push({locator:o,count:g}),l+4>=f.SIXTY_FOUR_KILOBYTES-2&&(t.push(0),s=[],e.push(s),l=0,o.count=a,r=0,a=0,o=new X(0,0,this),i[++n]=[o])}d._clean()}return o.count=a,r},Z.prototype.getPolylineStartIndex=function(e){for(var t=this.polylines,i=0,r=t.length,n=0;n<r;++n){var o=t[n];if(o===e)break;i+=o._actualLength}return i};var Ee={positions:void 0,lengths:void 0},be=new Array(1),Te=new i,xe=new n;Z.prototype.getSegments=function(t,r){var n=t._actualPositions;if(this.mode===L.SCENE3D)return be[0]=n.length,Ee.positions=n,Ee.lengths=be,Ee;K(t)&&(n=t._segments.positions);for(var o,a=r.ellipsoid,s=[],l=this.modelMatrix,u=n.length,c=Te,h=0;h<u;++h)o=n[h],c=_.multiplyByPoint(l,o,c),s.push(r.project(a.cartesianToCartographic(c,xe)));if(s.length>0){t._boundingVolume2D=e.fromPoints(s,t._boundingVolume2D);var d=t._boundingVolume2D.center;t._boundingVolume2D.center=new i(d.z,d.x,d.y)}return Ee.positions=s,Ee.lengths=t._segments.lengths,Ee};var Ae;return Z.prototype.writeUpdate=function(e,t,r,n){var o=this.mode,a=n.ellipsoid.maximumRadius*f.PI,s=t._actualLength;if(s){e+=this.getPolylineStartIndex(t);var u=Ae,c=6*s*3;!l(u)||u.length<c?u=Ae=new Float32Array(c):u.length>c&&(u=new Float32Array(u.buffer,0,c));var h,p=this.getSegments(t,n),m=p.positions,_=p.lengths,g=0,v=0,y=0;s=m.length;for(var C=0;C<s;++C){0===C?t._loop?h=m[s-2]:(h=fe,i.subtract(m[0],m[1],h),i.add(m[0],h,h)):h=m[C-1],i.clone(h,pe),i.clone(m[C],de),C===s-1?t._loop?h=m[1]:(h=fe,i.subtract(m[s-1],m[s-2],h),i.add(m[s-1],h,h)):h=m[C+1],i.clone(h,me);var w=_[v];C===y+w&&(y+=w,++v);var S=C-y===0,E=C===y+_[v]-1;o===L.SCENE2D&&(pe.z=0,de.z=0,me.z=0),o!==L.SCENE2D&&o!==L.MORPHING||(S||E)&&a-Math.abs(de.x)<1&&((de.x<0&&pe.x>0||de.x>0&&pe.x<0)&&i.clone(de,pe),(de.x<0&&me.x>0||de.x>0&&me.x<0)&&i.clone(de,me));for(var b=S?2:0,T=E?2:4,x=b;x<T;++x)d.writeElements(de,u,g),d.writeElements(pe,u,g+6),d.writeElements(me,u,g+12),g+=18}r.copyFromArrayView(u,18*Float32Array.BYTES_PER_ELEMENT*e)}},B}),i("DataSources/ScaledPositionProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Ellipsoid","../Core/Event","../Core/ReferenceFrame","./Property"],function(e,t,i,r,n,o,a){"use strict";function s(e){this._definitionChanged=new n,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}return t(s.prototype,{isConstant:{get:function(){return a.isConstant(this._value)}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return e(this._value)?this._value.referenceFrame:o.FIXED}}}),s.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,o.FIXED,t)},s.prototype.setValue=function(t){this._value!==t&&(this._value=t,e(this._removeSubscription)&&(this._removeSubscription(),this._removeSubscription=void 0),e(t)&&(this._removeSubscription=t.definitionChanged.addEventListener(this._raiseDefinitionChanged,this)),this._definitionChanged.raiseEvent(this))},s.prototype.getValueInReferenceFrame=function(t,i,n){if(e(this._value))return n=this._value.getValueInReferenceFrame(t,i,n),e(n)?r.WGS84.scaleToGeodeticSurface(n,n):void 0},s.prototype.equals=function(e){return this===e||e instanceof s&&this._value===e._value},s.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},s}),i("DataSources/PathVisualizer",["../Core/AssociativeArray","../Core/Cartesian3","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/JulianDate","../Core/Matrix3","../Core/Matrix4","../Core/ReferenceFrame","../Core/TimeInterval","../Core/Transforms","../Scene/PolylineCollection","../Scene/SceneMode","./CompositePositionProperty","./ConstantPositionProperty","./MaterialProperty","./Property","./ReferenceProperty","./SampledPositionProperty","./ScaledPositionProperty","./TimeIntervalCollectionPositionProperty"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C){"use strict";function w(e){this.entity=e,this.polyline=void 0,this.index=void 0,this.updater=void 0}function S(e,t,r,n,a,s,l,u,c){var h,d=u;h=e.getValueInReferenceFrame(t,s,c[d]),i(h)&&(c[d++]=h);for(var p,m,f,_=!i(a)||o.lessThanOrEquals(a,t)||o.greaterThanOrEquals(a,r),g=0,v=n.length,y=n[g],C=r,w=!1;g<v;){if(!_&&o.greaterThanOrEquals(y,a)&&(h=e.getValueInReferenceFrame(a,s,c[d]),i(h)&&(c[d++]=h),_=!0),o.greaterThan(y,t)&&o.lessThan(y,C)&&!y.equals(a)&&(h=e.getValueInReferenceFrame(y,s,c[d]),i(h)&&(c[d++]=h)),g<v-1){if(l>0&&!w){var S=n[g+1],E=o.secondsDifference(S,y);w=E>l,w&&(p=Math.ceil(E/l),m=0,f=E/Math.max(p,2),p=Math.max(p-1,1))}if(w&&m<p){y=o.addSeconds(y,f,new o),m++;continue}}w=!1,g++,y=n[g]}return h=e.getValueInReferenceFrame(r,s,c[d]),i(h)&&(c[d++]=h),d}function E(e,t,r,n,a,s,l,u){for(var c,h=0,d=l,p=t,m=Math.max(s,60),f=!i(n)||o.lessThanOrEquals(n,t)||o.greaterThanOrEquals(n,r);o.lessThan(p,r);)!f&&o.greaterThanOrEquals(p,n)&&(f=!0,c=e.getValueInReferenceFrame(n,a,u[d]),i(c)&&(u[d]=c,d++)),c=e.getValueInReferenceFrame(p,a,u[d]),i(c)&&(u[d]=c,d++),h++,p=o.addSeconds(t,m*h,new o);return c=e.getValueInReferenceFrame(r,a,u[d]),i(c)&&(u[d]=c,d++),d}function b(e,t,r,n,a,s,l,c){L.start=t,L.stop=r;for(var h=l,d=e.intervals,p=0;p<d.length;p++){var m=d.get(p);if(!u.intersect(m,L,O).isEmpty){var f=m.start;m.isStartIncluded||(f=m.isStopIncluded?m.stop:o.addSeconds(m.start,o.secondsDifference(m.stop,m.start)/2,new o));var _=e.getValueInReferenceFrame(f,a,c[h]);i(_)&&(c[h]=_,h++)}}return h}function T(e,t,r,n,o,a,s,l){var u=e.getValueInReferenceFrame(t,o,l[s]);return i(u)&&(l[s++]=u),s}function x(e,t,i,r,n,a,s,l){N.start=t,N.stop=i;for(var c=s,h=e.intervals,d=0;d<h.length;d++){var p=h.get(d);if(!u.intersect(p,N,O).isEmpty){var m=p.start,f=p.stop,_=t;o.greaterThan(m,_)&&(_=m);var g=i;o.lessThan(f,g)&&(g=f),c=A(p.data,_,g,r,n,a,c,l)}}return c}function A(e,t,i,r,n,o,a,s){for(;e instanceof g;)e=e.resolvedProperty;if(e instanceof v){var l=e._property._times;a=S(e,t,i,l,r,n,o,a,s)}else a=e instanceof p?x(e,t,i,r,n,o,a,s):e instanceof C?b(e,t,i,r,n,o,a,s):e instanceof m||e instanceof y&&_.isConstant(e)?T(e,t,i,r,n,o,a,s):E(e,t,i,r,n,o,a,s);return a}function P(e,t,r,n,o,a,s){i(s)||(s=[]);var l=A(e,t,r,n,o,a,0,s);return s.length=l,s}function D(e,t){this._unusedIndexes=[],this._polylineCollection=new h,this._scene=e,this._referenceFrame=t,e.primitives.add(this._polylineCollection)}function M(t,i){i.collectionChanged.addEventListener(M.prototype._onCollectionChanged,this),this._scene=t,this._updaters={},this._entityCollection=i,this._items=new e,this._onCollectionChanged(i,i.values,[],[])}var I=60,R=1,O=new u,N=new u,L=new u,B=new a;return D.prototype.update=function(e){if(this._referenceFrame===l.INERTIAL){var r=c.computeIcrfToFixedMatrix(e,B);i(r)||(r=c.computeTemeToPseudoFixedMatrix(e,B)),s.fromRotationTranslation(r,t.ZERO,this._polylineCollection.modelMatrix)}},D.prototype.updateObject=function(e,t){var r,n,a=t.entity,s=a._path,l=a._position,u=s._show,c=t.polyline,h=a.isShowing&&(!i(u)||u.getValue(e));if(h){var d=_.getValueOrUndefined(s._leadTime,e),p=_.getValueOrUndefined(s._trailTime,e),m=a._availability,g=i(m),v=i(d),y=i(p);if(h=g||v&&y){if(y&&(r=o.addSeconds(e,-p,new o)),v&&(n=o.addSeconds(e,d,new o)),g){var C=m.start,w=m.stop;y&&!o.greaterThan(C,r)||(r=C),v&&!o.lessThan(w,n)||(n=w)}h=o.lessThan(r,n)}}if(!h)return void(i(c)&&(this._unusedIndexes.push(t.index),t.polyline=void 0,c.show=!1,t.index=void 0));if(!i(c)){var S=this._unusedIndexes,E=S.length;if(E>0){var b=S.pop();c=this._polylineCollection.get(b),t.index=b}else t.index=this._polylineCollection.length,c=this._polylineCollection.add();c.id=a,t.polyline=c}var T=_.getValueOrDefault(s._resolution,e,I);c.show=!0,c.positions=P(l,r,n,e,this._referenceFrame,T,c.positions.slice()),c.material=f.getValue(e,s._material,c.material),c.width=_.getValueOrDefault(s._width,e,R),c.distanceDisplayCondition=_.getValueOrUndefined(s._distanceDisplayCondition,e,c.distanceDisplayCondition)},D.prototype.removeObject=function(e){var t=e.polyline;i(t)&&(this._unusedIndexes.push(e.index),e.polyline=void 0,t.show=!1,t.id=void 0,e.index=void 0)},D.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),r(this)},M.prototype.update=function(e){var t=this._updaters;for(var r in t)t.hasOwnProperty(r)&&t[r].update(e);for(var n=this._items.values,o=0,a=n.length;o<a;o++){var s=n[o],u=s.entity,c=u._position,h=s.updater,p=l.FIXED;this._scene.mode===d.SCENE3D&&(p=c.referenceFrame);var m=this._updaters[p];h===m&&i(m)?m.updateObject(e,s):(i(h)&&h.removeObject(s),i(m)||(m=new D(this._scene,p),m.update(e),this._updaters[p]=m),s.updater=m,i(m)&&m.updateObject(e,s))}return!0},M.prototype.isDestroyed=function(){return!1},M.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(M.prototype._onCollectionChanged,this);var e=this._updaters;for(var t in e)e.hasOwnProperty(t)&&e[t].destroy();return r(this)},M.prototype._onCollectionChanged=function(e,t,r,n){var o,a,s,l=this._items;for(o=t.length-1;o>-1;o--)a=t[o],i(a._path)&&i(a._position)&&l.set(a.id,new w(a));for(o=n.length-1;o>-1;o--)a=n[o],i(a._path)&&i(a._position)?l.contains(a.id)||l.set(a.id,new w(a)):(s=l.get(a.id),i(s)&&(s.updater.removeObject(s),l.remove(a.id)));for(o=r.length-1;o>-1;o--)a=r[o],s=l.get(a.id),i(s)&&(i(s.updater)&&s.updater.removeObject(s),l.remove(a.id))},M._subSample=P,M}),i("DataSources/PointVisualizer",["../Core/AssociativeArray","../Core/Cartesian3","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/NearFarScalar","../Scene/HeightReference","./BoundingSphereState","./Property"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(e){this.entity=e,this.pointPrimitive=void 0,this.billboard=void 0,this.color=void 0,this.outlineColor=void 0,this.pixelSize=void 0,this.outlineWidth=void 0}function d(t,i){i.collectionChanged.addEventListener(d.prototype._onCollectionChanged,this),this._cluster=t,this._entityCollection=i,this._items=new e,this._onCollectionChanged(i,i.values,[],[])}function p(e,t,i){if(r(e)){var n=e.pointPrimitive;if(r(n))return e.pointPrimitive=void 0,void i.removePoint(t);var o=e.billboard;r(o)&&(e.billboard=void 0,i.removeBillboard(t))}}function m(e,t,i,r,n){return function(o){var a=document.createElement("canvas"),s=n+2*r;a.height=a.width=s;var l=a.getContext("2d");return l.clearRect(0,0,s,s),0!==r&&(l.beginPath(),l.arc(s/2,s/2,s/2,0,2*Math.PI,!0),l.closePath(),l.fillStyle=i,l.fill(),e<1&&(l.save(),l.globalCompositeOperation="destination-out",l.beginPath(),l.arc(s/2,s/2,n/2,0,2*Math.PI,!0),l.closePath(),l.fillStyle="black",l.fill(),l.restore())),l.beginPath(),l.arc(s/2,s/2,n/2,0,2*Math.PI,!0),l.closePath(),l.fillStyle=t,l.fill(),a}}var f=i.WHITE,_=i.BLACK,g=0,v=1,y=new i,C=new t,w=new i,S=new s,E=new s,b=new a;return d.prototype.update=function(e){for(var t=this._items.values,n=this._cluster,o=0,a=t.length;o<a;o++){var s=t[o],u=s.entity,h=u._point,d=s.pointPrimitive,T=s.billboard,x=c.getValueOrDefault(h._heightReference,e,l.NONE),A=u.isShowing&&u.isAvailable(e)&&c.getValueOrDefault(h._show,e,!0);if(A&&(C=c.getValueOrUndefined(u._position,e,C),A=r(C)),A){c.isConstant(u._position)||(n._clusterDirty=!0);var P=!1;if(x===l.NONE||r(T)?x!==l.NONE||r(d)||(r(T)&&(p(s,u,n),T=void 0),d=n.getPoint(u),d.id=u,s.pointPrimitive=d):(r(d)&&(p(s,u,n),d=void 0),T=n.getBillboard(u),T.id=u,T.image=void 0,s.billboard=T,P=!0),r(d))d.show=!0,d.position=C,d.scaleByDistance=c.getValueOrUndefined(h._scaleByDistance,e,S),d.translucencyByDistance=c.getValueOrUndefined(h._translucencyByDistance,e,E),d.color=c.getValueOrDefault(h._color,e,f,y),d.outlineColor=c.getValueOrDefault(h._outlineColor,e,_,w),d.outlineWidth=c.getValueOrDefault(h._outlineWidth,e,g),d.pixelSize=c.getValueOrDefault(h._pixelSize,e,v),d.distanceDisplayCondition=c.getValueOrUndefined(h._distanceDisplayCondition,e,b);else{T.show=!0,T.position=C,T.scaleByDistance=c.getValueOrUndefined(h._scaleByDistance,e,S),T.translucencyByDistance=c.getValueOrUndefined(h._translucencyByDistance,e,E),T.distanceDisplayCondition=c.getValueOrUndefined(h._distanceDisplayCondition,e,b),T.heightReference=x;var D=c.getValueOrDefault(h._color,e,f,y),M=c.getValueOrDefault(h._outlineColor,e,_,w),I=Math.round(c.getValueOrDefault(h._outlineWidth,e,g)),R=Math.max(1,Math.round(c.getValueOrDefault(h._pixelSize,e,v)));if(I>0?(T.scale=1,P=P||I!==s.outlineWidth||R!==s.pixelSize||!i.equals(D,s.color)||!i.equals(M,s.outlineColor)):(T.scale=R/50,R=50,P=P||I!==s.outlineWidth||!i.equals(D,s.color)||!i.equals(M,s.outlineColor)),P){s.color=i.clone(D,s.color),s.outlineColor=i.clone(M,s.outlineColor),s.pixelSize=R,s.outlineWidth=I;var O=D.alpha,N=D.toCssColorString(),L=M.toCssColorString(),B=JSON.stringify([N,R,L,I]);T.setImage(B,m(O,N,L,I,R))}}}else p(s,u,n)}return!0},d.prototype.getBoundingSphere=function(e,i){var n=this._items.get(e.id);if(!r(n)||!r(n.pointPrimitive)&&!r(n.billboard))return u.FAILED;if(r(n.pointPrimitive))i.center=t.clone(n.pointPrimitive.position,i.center);else{var o=n.billboard;if(!r(o._clampedPosition))return u.PENDING;i.center=t.clone(o._clampedPosition,i.center)}return i.radius=0,u.DONE},d.prototype.isDestroyed=function(){return!1},d.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(d.prototype._onCollectionChanged,this);for(var e=this._entityCollection.values,t=0;t<e.length;t++)this._cluster.removePoint(e[t]);return n(this)},d.prototype._onCollectionChanged=function(e,t,i,n){var o,a,s=this._items,l=this._cluster;for(o=t.length-1;o>-1;o--)a=t[o],r(a._point)&&r(a._position)&&s.set(a.id,new h(a));for(o=n.length-1;o>-1;o--)a=n[o],r(a._point)&&r(a._position)?s.contains(a.id)||s.set(a.id,new h(a)):(p(s.get(a.id),a,l),s.remove(a.id));for(o=i.length-1;o>-1;o--)a=i[o],p(s.get(a.id),a,l),s.remove(a.id)},d}),i("DataSources/PolygonGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/isArray","../Core/Iso8601","../Core/oneTimeWarning","../Core/PolygonGeometry","../Core/PolygonHierarchy","../Core/PolygonOutlineGeometry","../Core/ShowGeometryInstanceAttribute","../Scene/GroundPrimitive","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A){"use strict";function P(e){this.id=e,this.vertexFormat=void 0,this.polygonHierarchy=void 0,this.perPositionHeight=void 0,this.closeTop=void 0,this.closeBottom=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0}function D(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(D.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._isClosed=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new u,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._onTerrain=!1,this._options=new P(e),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}function M(e,t,i){this._primitives=e,this._groundPrimitives=t,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=i,this._options=new P(i._entity)}var I=new E(e.WHITE),R=new b(!0),O=new b(!0),N=new b(!1),L=new b(e.BLACK),B=new b(S.DISABLED),F=new b(new s),V=new e;return n(D,{perInstanceColorAppearanceType:{value:C},materialAppearanceType:{value:y}}),n(D.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!r(this._entity.availability)&&A.isConstant(this._showProperty)&&A.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!r(this._entity.availability)&&A.isConstant(this._showProperty)&&A.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},onTerrain:{get:function(){return this._onTerrain}},geometryChanged:{get:function(){return this._geometryChanged}}}),D.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e); +},D.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},D.prototype.createFillGeometryInstance=function(i){var n,o,a=this._entity,s=a.isAvailable(i),u=new g(s&&a.isShowing&&this._showProperty.getValue(i)&&this._fillProperty.getValue(i)),h=this._distanceDisplayConditionProperty.getValue(i),d=l.fromDistanceDisplayCondition(h);if(this._materialProperty instanceof E){var p=e.WHITE;r(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(p=this._materialProperty.color.getValue(i)),o=t.fromColor(p),n={show:u,distanceDisplayCondition:d,color:o}}else n={show:u,distanceDisplayCondition:d};return new c({id:a,geometry:new m(this._options),attributes:n})},D.prototype.createOutlineGeometryInstance=function(i){var r=this._entity,n=r.isAvailable(i),o=A.getValueOrDefault(this._outlineColorProperty,i,e.BLACK),a=this._distanceDisplayConditionProperty.getValue(i);return new c({id:r,geometry:new _(this._options),attributes:{show:new g(n&&r.isShowing&&this._showProperty.getValue(i)&&this._showOutlineProperty.getValue(i)),color:t.fromColor(o),distanceDisplayCondition:l.fromDistanceDisplayCondition(a)}})},D.prototype.isDestroyed=function(){return!1},D.prototype.destroy=function(){this._entitySubscription(),o(this)},D.prototype._onEntityPropertyChanged=function(e,t,n,o){if("availability"===t||"polygon"===t){var a=this._entity.polygon;if(!r(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!r(s)||!s.isConstant||s.getValue(d.MINIMUM_VALUE),u=a.perPositionHeight,c=r(u)&&(!u.isConstant||u.getValue(d.MINIMUM_VALUE)),m=a.outline,_=r(m);if(_&&m.isConstant&&(_=m.getValue(d.MINIMUM_VALUE)),!l&&!_)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var g=a.hierarchy,w=a.show;if(r(w)&&w.isConstant&&!w.getValue(d.MINIMUM_VALUE)||!r(g))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var S=i(a.material,I),b=S instanceof E;this._materialProperty=S,this._fillProperty=i(s,O),this._showProperty=i(w,R),this._showOutlineProperty=i(a.outline,N),this._outlineColorProperty=_?i(a.outlineColor,L):void 0,this._shadowsProperty=i(a.shadows,B),this._distanceDisplayConditionProperty=i(a.distanceDisplayCondition,F);var T=a.height,x=a.extrudedHeight,P=a.granularity,D=a.stRotation,M=a.outlineWidth,V=l&&!r(T)&&!r(x)&&b&&!c&&v.isSupported(this._scene);_&&V&&(p(p.geometryOutlines),_=!1);var k=a.perPositionHeight,z=a.closeTop,U=a.closeBottom;if(this._fillEnabled=l,this._onTerrain=V,this._outlineEnabled=_,g.isConstant&&A.isConstant(T)&&A.isConstant(x)&&A.isConstant(P)&&A.isConstant(D)&&A.isConstant(M)&&A.isConstant(u)&&A.isConstant(k)&&A.isConstant(z)&&A.isConstant(U)&&(!V||A.isConstant(S))){var G=this._options;G.vertexFormat=b?C.VERTEX_FORMAT:y.MaterialSupport.TEXTURED.vertexFormat;var W=g.getValue(d.MINIMUM_VALUE);h(W)&&(W=new f(W));var H=A.getValueOrUndefined(T,d.MINIMUM_VALUE),q=A.getValueOrDefault(z,d.MINIMUM_VALUE,!0),j=A.getValueOrDefault(U,d.MINIMUM_VALUE,!0),Y=A.getValueOrUndefined(x,d.MINIMUM_VALUE);G.polygonHierarchy=W,G.height=H,G.extrudedHeight=Y,G.granularity=A.getValueOrUndefined(P,d.MINIMUM_VALUE),G.stRotation=A.getValueOrUndefined(D,d.MINIMUM_VALUE),G.perPositionHeight=A.getValueOrUndefined(k,d.MINIMUM_VALUE),G.closeTop=q,G.closeBottom=j,this._outlineWidth=A.getValueOrDefault(M,d.MINIMUM_VALUE,1),this._isClosed=r(Y)&&Y!==H&&q&&j,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},D.prototype.createDynamicUpdater=function(e,t){return new M(e,t,this)},M.prototype.update=function(i){var n=this._geometryUpdater,o=n._onTerrain,a=this._primitives,s=this._groundPrimitives;o?s.removeAndDestroy(this._primitive):(a.removeAndDestroy(this._primitive),a.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;var l=n._entity,u=l.polygon;if(l.isShowing&&l.isAvailable(i)&&A.getValueOrDefault(u.show,i,!0)){var d=this._options,p=A.getValueOrUndefined(u.hierarchy,i);if(r(p)){h(p)?d.polygonHierarchy=new f(p):d.polygonHierarchy=p;var g=A.getValueOrDefault(u.closeTop,i,!0),S=A.getValueOrDefault(u.closeBottom,i,!0);d.height=A.getValueOrUndefined(u.height,i),d.extrudedHeight=A.getValueOrUndefined(u.extrudedHeight,i),d.granularity=A.getValueOrUndefined(u.granularity,i),d.stRotation=A.getValueOrUndefined(u.stRotation,i),d.perPositionHeight=A.getValueOrUndefined(u.perPositionHeight,i),d.closeTop=g,d.closeBottom=S;var E=this._geometryUpdater.shadowsProperty.getValue(i);if(A.getValueOrDefault(u.fill,i,!0)){var b=n.fillMaterialProperty,T=x.getValue(i,b,this._material);if(this._material=T,o){var P=e.WHITE;r(b.color)&&(P=b.color.getValue(i)),this._primitive=s.add(new v({geometryInstances:new c({id:l,geometry:new m(d),attributes:{color:t.fromColor(P)}}),asynchronous:!1,shadows:E}))}else{var D=new y({material:T,translucent:T.isTranslucent(),closed:r(d.extrudedHeight)&&d.extrudedHeight!==d.height&&g&&S});d.vertexFormat=D.vertexFormat,this._primitive=a.add(new w({geometryInstances:new c({id:l,geometry:new m(d)}),appearance:D,asynchronous:!1,shadows:E}))}}if(!o&&A.getValueOrDefault(u.outline,i,!1)){d.vertexFormat=C.VERTEX_FORMAT;var M=A.getValueOrClonedDefault(u.outlineColor,i,e.BLACK,V),I=A.getValueOrDefault(u.outlineWidth,i,1),R=1!==M.alpha;this._outlinePrimitive=a.add(new w({geometryInstances:new c({id:l,geometry:new _(d),attributes:{color:t.fromColor(M)}}),appearance:new C({flat:!0,translucent:R,renderState:{lineWidth:n._scene.clampLineWidth(I)}}),asynchronous:!1,shadows:E}))}}}},M.prototype.getBoundingSphere=function(e,t){return T(e,this._primitive,this._outlinePrimitive,t)},M.prototype.isDestroyed=function(){return!1},M.prototype.destroy=function(){var e=this._primitives,t=this._groundPrimitives;this._geometryUpdater._onTerrain?t.removeAndDestroy(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),o(this)},D}),i("Shaders/Appearances/PolylineColorAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 prevPosition3DHigh;\nattribute vec3 prevPosition3DLow;\nattribute vec3 nextPosition3DHigh;\nattribute vec3 nextPosition3DLow;\nattribute vec2 expandAndWidth;\nattribute vec4 color;\nattribute float batchId;\nvarying vec4 v_color;\nvoid main()\n{\nfloat expandDir = expandAndWidth.x;\nfloat width = abs(expandAndWidth.y) + 0.5;\nbool usePrev = expandAndWidth.y < 0.0;\nvec4 p = czm_computePosition();\nvec4 prev = czm_computePrevPosition();\nvec4 next = czm_computeNextPosition();\nv_color = color;\nvec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev);\ngl_Position = czm_viewportOrthographic * positionWC;\n}\n"}),i("Scene/PolylineColorAppearance",["../Core/defaultValue","../Core/defineProperties","../Core/VertexFormat","../Shaders/Appearances/PerInstanceFlatColorAppearanceFS","../Shaders/Appearances/PolylineColorAppearanceVS","../Shaders/PolylineCommon","./Appearance"],function(e,t,i,r,n,o,a){"use strict";function s(t){t=e(t,e.EMPTY_OBJECT);var i=e(t.translucent,!0),r=!1,n=s.VERTEX_FORMAT;this.material=void 0,this.translucent=i,this._vertexShaderSource=e(t.vertexShaderSource,l),this._fragmentShaderSource=e(t.fragmentShaderSource,u),this._renderState=a.getDefaultRenderState(i,r,t.renderState),this._closed=r,this._vertexFormat=n}var l=o+"\n"+n,u=r;return t(s.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}}),s.VERTEX_FORMAT=i.POSITION_ONLY,s.prototype.getFragmentShaderSource=a.prototype.getFragmentShaderSource,s.prototype.isTranslucent=a.prototype.isTranslucent,s.prototype.getRenderState=a.prototype.getRenderState,s}),i("Shaders/Appearances/PolylineMaterialAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 prevPosition3DHigh;\nattribute vec3 prevPosition3DLow;\nattribute vec3 nextPosition3DHigh;\nattribute vec3 nextPosition3DLow;\nattribute vec2 expandAndWidth;\nattribute vec2 st;\nattribute float batchId;\nvarying float v_width;\nvarying vec2 v_st;\nvoid main()\n{\nfloat expandDir = expandAndWidth.x;\nfloat width = abs(expandAndWidth.y) + 0.5;\nbool usePrev = expandAndWidth.y < 0.0;\nvec4 p = czm_computePosition();\nvec4 prev = czm_computePrevPosition();\nvec4 next = czm_computeNextPosition();\nv_width = width;\nv_st = st;\nvec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev);\ngl_Position = czm_viewportOrthographic * positionWC;\n}\n"}),i("Scene/PolylineMaterialAppearance",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/VertexFormat","../Shaders/Appearances/PolylineMaterialAppearanceVS","../Shaders/PolylineCommon","../Shaders/PolylineFS","./Appearance","./Material"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(i){i=e(i,e.EMPTY_OBJECT);var r=e(i.translucent,!0),n=!1,o=u.VERTEX_FORMAT;this.material=t(i.material)?i.material:l.fromType(l.ColorType),this.translucent=r,this._vertexShaderSource=e(i.vertexShaderSource,c),this._fragmentShaderSource=e(i.fragmentShaderSource,h),this._renderState=s.getDefaultRenderState(r,n,i.renderState),this._closed=n,this._vertexFormat=o}var c=o+"\n"+n,h=a;return i(u.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}}),u.VERTEX_FORMAT=r.POSITION_AND_ST,u.prototype.getFragmentShaderSource=s.prototype.getFragmentShaderSource,u.prototype.isTranslucent=s.prototype.isTranslucent,u.prototype.getRenderState=s.prototype.getRenderState,u}),i("DataSources/PolylineGeometryUpdater",["../Core/BoundingSphere","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/PolylineGeometry","../Core/PolylinePipeline","../Core/ShowGeometryInstanceAttribute","../Scene/PolylineCollection","../Scene/PolylineColorAppearance","../Scene/PolylineMaterialAppearance","../Scene/ShadowMode","./BoundingSphereState","./ColorMaterialProperty","./ConstantProperty","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b){"use strict";function T(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.followSurface=void 0,this.granularity=void 0}function x(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(x.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._geometryChanged=new c,this._showProperty=void 0,this._materialProperty=void 0,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._options=new T(e),this._onEntityPropertyChanged(e,"polyline",e.polyline,void 0)}function A(e,t){var i=t._scene.id,r=P[i];!n(r)||r.isDestroyed()?(r=new _,P[i]=r,e.add(r)):e.contains(r)||e.add(r);var o=r.add();o.id=t._entity,this._line=o,this._primitives=e,this._geometryUpdater=t,this._positions=[],O.ellipsoid=t._scene.globe.ellipsoid}var P={},D=new w(t.WHITE),M=new S(!0),I=new S(y.DISABLED),R=new S(new l);o(x,{perInstanceColorAppearanceType:{value:g},materialAppearanceType:{value:v}}),o(x.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!n(this._entity.availability)&&b.isConstant(this._showProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{value:!1},hasConstantOutline:{value:!0},outlineColorProperty:{value:void 0},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!1},geometryChanged:{get:function(){return this._geometryChanged}}}),x.prototype.isOutlineVisible=function(e){return!1},x.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)},x.prototype.createFillGeometryInstance=function(e){var r,o,a=this._entity,s=a.isAvailable(e),l=new f(s&&a.isShowing&&this._showProperty.getValue(e)),c=this._distanceDisplayConditionProperty.getValue(e),d=u.fromDistanceDisplayCondition(c);if(this._materialProperty instanceof w){var m=t.WHITE;n(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(m=this._materialProperty.color.getValue(e)),r=i.fromColor(m),o={show:l,distanceDisplayCondition:d,color:r}}else o={show:l,distanceDisplayCondition:d};return new h({id:a,geometry:new p(this._options),attributes:o})},x.prototype.createOutlineGeometryInstance=function(e){},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){this._entitySubscription(),a(this)},x.prototype._onEntityPropertyChanged=function(e,t,i,o){if("availability"===t||"polyline"===t){var a=this._entity.polyline;if(!n(a))return void(this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.positions,l=a.show;if(n(l)&&l.isConstant&&!l.getValue(d.MINIMUM_VALUE)||!n(s))return void(this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)));var u=r(a.material,D),c=u instanceof w;this._materialProperty=u,this._showProperty=r(l,M),this._shadowsProperty=r(a.shadows,I),this._distanceDisplayConditionProperty=r(a.distanceDisplayCondition,R),this._fillEnabled=!0;var h=a.width,p=a.followSurface,m=a.granularity;if(s.isConstant&&b.isConstant(h)&&b.isConstant(p)&&b.isConstant(m)){var f=this._options,_=s.getValue(d.MINIMUM_VALUE,f.positions);if(!n(_)||_.length<2)return void(this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)));f.vertexFormat=c?g.VERTEX_FORMAT:v.VERTEX_FORMAT,f.positions=_,f.width=n(h)?h.getValue(d.MINIMUM_VALUE):void 0,f.followSurface=n(p)?p.getValue(d.MINIMUM_VALUE):void 0,f.granularity=n(m)?m.getValue(d.MINIMUM_VALUE):void 0,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},x.prototype.createDynamicUpdater=function(e){return new A(e,this)};var O={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};return A.prototype.update=function(e){var t=this._geometryUpdater,i=t._entity,r=i.polyline,o=this._line;if(!i.isShowing||!i.isAvailable(e)||!b.getValueOrDefault(r._show,e,!0))return void(o.show=!1);var a=r.positions,s=b.getValueOrUndefined(a,e,this._positions);if(!n(s)||s.length<2)return void(o.show=!1);var l=b.getValueOrDefault(r._followSurface,e,!0);l&&(O.positions=s,O.granularity=b.getValueOrUndefined(r._granularity,e),O.height=m.extractHeights(s,this._geometryUpdater._scene.globe.ellipsoid),s=m.generateCartesianArc(O)),o.show=!0,o.positions=s.slice(),o.material=E.getValue(e,t.fillMaterialProperty,o.material),o.width=b.getValueOrDefault(r._width,e,1),o.distanceDisplayCondition=b.getValueOrUndefined(r._distanceDisplayCondition,e,o.distanceDisplayCondition)},A.prototype.getBoundingSphere=function(t,i){var r=this._line;return r.show&&r.positions.length>0?(e.fromPoints(r.positions,i),C.DONE):C.FAILED},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){var e=this._geometryUpdater,t=e._scene.id,i=P[t];i.remove(this._line),0===i.length&&(this._primitives.removeAndDestroy(i),delete P[t]),a(this)},x}),i("DataSources/PolylineVolumeGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/PolylineVolumeGeometry","../Core/PolylineVolumeOutlineGeometry","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E){"use strict";function b(e){this.id=e,this.vertexFormat=void 0,this.polylinePositions=void 0,this.shapePositions=void 0,this.cornerType=void 0,this.granularity=void 0}function T(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(T.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new u,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._options=new b(e),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)}function x(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new b(t._entity)}var A=new y(e.WHITE),P=new C(!0),D=new C(!0),M=new C(!1),I=new C(e.BLACK),R=new C(v.DISABLED),O=new C(new s),N=new e;return n(T,{perInstanceColorAppearanceType:{value:_},materialAppearanceType:{value:f}}),n(T.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!r(this._entity.availability)&&E.isConstant(this._showProperty)&&E.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!r(this._entity.availability)&&E.isConstant(this._showProperty)&&E.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!0},geometryChanged:{get:function(){return this._geometryChanged}}}),T.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},T.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},T.prototype.createFillGeometryInstance=function(i){var n,o,a=this._entity,s=a.isAvailable(i),u=new m(s&&a.isShowing&&this._showProperty.getValue(i)&&this._fillProperty.getValue(i)),h=this._distanceDisplayConditionProperty.getValue(i),p=l.fromDistanceDisplayCondition(h);if(this._materialProperty instanceof y){var f=e.WHITE;r(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(f=this._materialProperty.color.getValue(i)),o=t.fromColor(f),n={show:u,distanceDisplayCondition:p,color:o}}else n={show:u,distanceDisplayCondition:p};return new c({id:a,geometry:new d(this._options),attributes:n})},T.prototype.createOutlineGeometryInstance=function(i){var r=this._entity,n=r.isAvailable(i),o=E.getValueOrDefault(this._outlineColorProperty,i,e.BLACK),a=this._distanceDisplayConditionProperty.getValue(i);return new c({id:r,geometry:new p(this._options),attributes:{show:new m(n&&r.isShowing&&this._showProperty.getValue(i)&&this._showOutlineProperty.getValue(i)),color:t.fromColor(o),distanceDisplayCondition:l.fromDistanceDisplayCondition(a)}})},T.prototype.isDestroyed=function(){return!1},T.prototype.destroy=function(){this._entitySubscription(),o(this)},T.prototype._onEntityPropertyChanged=function(e,t,n,o){if("availability"===t||"polylineVolume"===t){var a=this._entity.polylineVolume;if(!r(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!r(s)||!s.isConstant||s.getValue(h.MINIMUM_VALUE),u=a.outline,c=r(u);if(c&&u.isConstant&&(c=u.getValue(h.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var d=a.positions,p=a.shape,m=a.show;if(!r(d)||!r(p)||r(m)&&m.isConstant&&!m.getValue(h.MINIMUM_VALUE))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var g=i(a.material,A),v=g instanceof y;this._materialProperty=g,this._fillProperty=i(s,D),this._showProperty=i(m,P),this._showOutlineProperty=i(a.outline,M),this._outlineColorProperty=c?i(a.outlineColor,I):void 0,this._shadowsProperty=i(a.shadows,R),this._distanceDisplayConditionProperty=i(a.distanceDisplayCondition,O);var C=a.granularity,w=a.outlineWidth,S=a.cornerType;if(this._fillEnabled=l,this._outlineEnabled=c,d.isConstant&&p.isConstant&&E.isConstant(C)&&E.isConstant(w)&&E.isConstant(S)){var b=this._options;b.vertexFormat=v?_.VERTEX_FORMAT:f.MaterialSupport.TEXTURED.vertexFormat,b.polylinePositions=d.getValue(h.MINIMUM_VALUE,b.polylinePositions),b.shapePositions=p.getValue(h.MINIMUM_VALUE,b.shape),b.granularity=r(C)?C.getValue(h.MINIMUM_VALUE):void 0,b.cornerType=r(S)?S.getValue(h.MINIMUM_VALUE):void 0,this._outlineWidth=r(w)?w.getValue(h.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},T.prototype.createDynamicUpdater=function(e){return new x(e,this)},x.prototype.update=function(i){var n=this._primitives;n.removeAndDestroy(this._primitive),n.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0;var o=this._geometryUpdater,a=o._entity,s=a.polylineVolume;if(a.isShowing&&a.isAvailable(i)&&E.getValueOrDefault(s.show,i,!0)){var l=this._options,u=E.getValueOrUndefined(s.positions,i,l.polylinePositions),h=E.getValueOrUndefined(s.shape,i);if(r(u)&&r(h)){l.polylinePositions=u,l.shapePositions=h,l.granularity=E.getValueOrUndefined(s.granularity,i),l.cornerType=E.getValueOrUndefined(s.cornerType,i);var m=this._geometryUpdater.shadowsProperty.getValue(i);if(!r(s.fill)||s.fill.getValue(i)){var v=S.getValue(i,o.fillMaterialProperty,this._material);this._material=v;var y=new f({material:v,translucent:v.isTranslucent(),closed:!0});l.vertexFormat=y.vertexFormat,this._primitive=n.add(new g({geometryInstances:new c({id:a,geometry:new d(l)}),appearance:y,asynchronous:!1,shadows:m}))}if(r(s.outline)&&s.outline.getValue(i)){l.vertexFormat=_.VERTEX_FORMAT;var C=E.getValueOrClonedDefault(s.outlineColor,i,e.BLACK,N),w=E.getValueOrDefault(s.outlineWidth,i,1),b=1!==C.alpha;this._outlinePrimitive=n.add(new g({geometryInstances:new c({id:a,geometry:new p(l),attributes:{color:t.fromColor(C)}}),appearance:new _({flat:!0,translucent:b,renderState:{lineWidth:o._scene.clampLineWidth(w)}}),asynchronous:!1,shadows:m}))}}}},x.prototype.getBoundingSphere=function(e,t){return w(e,this._primitive,this._outlinePrimitive,t)},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),o(this)},T}),i("DataSources/RectangleGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/oneTimeWarning","../Core/RectangleGeometry","../Core/RectangleOutlineGeometry","../Core/ShowGeometryInstanceAttribute","../Scene/GroundPrimitive","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T){"use strict";function x(e){this.id=e,this.vertexFormat=void 0,this.rectangle=void 0,this.closeBottom=void 0,this.closeTop=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.rotation=void 0}function A(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(A.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._isClosed=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new u,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._onTerrain=!1,this._options=new x(e),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}function P(e,t,i){this._primitives=e,this._groundPrimitives=t,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=i,this._options=new x(i._entity)}var D=new w(e.WHITE),M=new S(!0),I=new S(!0),R=new S(!1),O=new S(e.BLACK),N=new S(C.DISABLED),L=new S(new s),B=new e;return n(A,{perInstanceColorAppearanceType:{value:v},materialAppearanceType:{value:g}}),n(A.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!r(this._entity.availability)&&T.isConstant(this._showProperty)&&T.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!r(this._entity.availability)&&T.isConstant(this._showProperty)&&T.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},onTerrain:{get:function(){return this._onTerrain}},geometryChanged:{get:function(){return this._geometryChanged}}}),A.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},A.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},A.prototype.createFillGeometryInstance=function(i){var n,o,a=this._entity,s=a.isAvailable(i),u=new f(s&&a.isShowing&&this._showProperty.getValue(i)&&this._fillProperty.getValue(i)),h=this._distanceDisplayConditionProperty.getValue(i),d=l.fromDistanceDisplayCondition(h);if(this._materialProperty instanceof w){var m=e.WHITE;r(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(m=this._materialProperty.color.getValue(i)),o=t.fromColor(m),n={show:u,distanceDisplayCondition:d,color:o}}else n={show:u,distanceDisplayCondition:d};return new c({id:a,geometry:new p(this._options),attributes:n})},A.prototype.createOutlineGeometryInstance=function(i){var r=this._entity,n=r.isAvailable(i),o=T.getValueOrDefault(this._outlineColorProperty,i,e.BLACK),a=this._distanceDisplayConditionProperty.getValue(i);return new c({id:r,geometry:new m(this._options),attributes:{show:new f(n&&r.isShowing&&this._showProperty.getValue(i)&&this._showOutlineProperty.getValue(i)),color:t.fromColor(o),distanceDisplayCondition:l.fromDistanceDisplayCondition(a)}})},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){this._entitySubscription(),o(this)},A.prototype._onEntityPropertyChanged=function(e,t,n,o){if("availability"===t||"rectangle"===t){var a=this._entity.rectangle;if(!r(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!r(s)||!s.isConstant||s.getValue(h.MINIMUM_VALUE),u=a.outline,c=r(u);if(c&&u.isConstant&&(c=u.getValue(h.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var p=a.coordinates,m=a.show;if(r(m)&&m.isConstant&&!m.getValue(h.MINIMUM_VALUE)||!r(p))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var f=i(a.material,D),y=f instanceof w;this._materialProperty=f,this._fillProperty=i(s,I),this._showProperty=i(m,M),this._showOutlineProperty=i(a.outline,R),this._outlineColorProperty=c?i(a.outlineColor,O):void 0,this._shadowsProperty=i(a.shadows,N),this._distanceDisplayConditionProperty=i(a.distanceDisplayCondition,L);var C=a.height,S=a.extrudedHeight,E=a.granularity,b=a.stRotation,x=a.rotation,A=a.outlineWidth,P=a.closeBottom,B=a.closeTop,F=l&&!r(C)&&!r(S)&&y&&_.isSupported(this._scene);if(c&&F&&(d(d.geometryOutlines),c=!1),this._fillEnabled=l,this._onTerrain=F,this._outlineEnabled=c,p.isConstant&&T.isConstant(C)&&T.isConstant(S)&&T.isConstant(E)&&T.isConstant(b)&&T.isConstant(x)&&T.isConstant(A)&&T.isConstant(P)&&T.isConstant(B)&&(!F||T.isConstant(f))){var V=this._options;V.vertexFormat=y?v.VERTEX_FORMAT:g.MaterialSupport.TEXTURED.vertexFormat,V.rectangle=p.getValue(h.MINIMUM_VALUE,V.rectangle),V.height=r(C)?C.getValue(h.MINIMUM_VALUE):void 0,V.extrudedHeight=r(S)?S.getValue(h.MINIMUM_VALUE):void 0,V.granularity=r(E)?E.getValue(h.MINIMUM_VALUE):void 0,V.stRotation=r(b)?b.getValue(h.MINIMUM_VALUE):void 0,V.rotation=r(x)?x.getValue(h.MINIMUM_VALUE):void 0,V.closeBottom=r(P)?P.getValue(h.MINIMUM_VALUE):void 0,V.closeTop=r(B)?B.getValue(h.MINIMUM_VALUE):void 0,this._isClosed=r(S)&&r(V.closeTop)&&r(V.closeBottom)&&V.closeTop&&V.closeBottom,this._outlineWidth=r(A)?A.getValue(h.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},A.prototype.createDynamicUpdater=function(e,t){return new P(e,t,this)},P.prototype.update=function(i){var n=this._geometryUpdater,o=n._onTerrain,a=this._primitives,s=this._groundPrimitives;o?s.removeAndDestroy(this._primitive):(a.removeAndDestroy(this._primitive),a.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;var l=n._entity,u=l.rectangle;if(l.isShowing&&l.isAvailable(i)&&T.getValueOrDefault(u.show,i,!0)){var h=this._options,d=T.getValueOrUndefined(u.coordinates,i,h.rectangle);if(r(d)){h.rectangle=d,h.height=T.getValueOrUndefined(u.height,i),h.extrudedHeight=T.getValueOrUndefined(u.extrudedHeight,i),h.granularity=T.getValueOrUndefined(u.granularity,i),h.stRotation=T.getValueOrUndefined(u.stRotation,i),h.rotation=T.getValueOrUndefined(u.rotation,i), +h.closeBottom=T.getValueOrUndefined(u.closeBottom,i),h.closeTop=T.getValueOrUndefined(u.closeTop,i);var f=this._geometryUpdater.shadowsProperty.getValue(i);if(T.getValueOrDefault(u.fill,i,!0)){var C=n.fillMaterialProperty,w=b.getValue(i,C,this._material);if(this._material=w,o){var S=e.WHITE;r(C.color)&&(S=C.color.getValue(i)),this._primitive=s.add(new _({geometryInstances:new c({id:l,geometry:new p(h),attributes:{color:t.fromColor(S)}}),asynchronous:!1,shadows:f}))}else{var E=new g({material:w,translucent:w.isTranslucent(),closed:r(h.extrudedHeight)});h.vertexFormat=E.vertexFormat,this._primitive=a.add(new y({geometryInstances:new c({id:l,geometry:new p(h)}),appearance:E,asynchronous:!1,shadows:f}))}}if(!o&&T.getValueOrDefault(u.outline,i,!1)){h.vertexFormat=v.VERTEX_FORMAT;var x=T.getValueOrClonedDefault(u.outlineColor,i,e.BLACK,B),A=T.getValueOrDefault(u.outlineWidth,i,1),P=1!==x.alpha;this._outlinePrimitive=a.add(new y({geometryInstances:new c({id:l,geometry:new m(h),attributes:{color:t.fromColor(x)}}),appearance:new v({flat:!0,translucent:P,renderState:{lineWidth:n._scene.clampLineWidth(A)}}),asynchronous:!1,shadows:f}))}}}},P.prototype.getBoundingSphere=function(e,t){return E(e,this._primitive,this._outlinePrimitive,t)},P.prototype.isDestroyed=function(){return!1},P.prototype.destroy=function(){var e=this._primitives,t=this._groundPrimitives;this._geometryUpdater._onTerrain?t.removeAndDestroy(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),o(this)},A}),i("DataSources/WallGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/ShowGeometryInstanceAttribute","../Core/WallGeometry","../Core/WallOutlineGeometry","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E){"use strict";function b(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.minimumHeights=void 0,this.maximumHeights=void 0,this.granularity=void 0}function T(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(T.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new u,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._options=new b(e),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)}function x(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new b(t._entity)}var A=new y(e.WHITE),P=new C(!0),D=new C(!0),M=new C(!1),I=new C(e.BLACK),R=new C(v.DISABLED),O=new C(new s),N=new e;return n(T,{perInstanceColorAppearanceType:{value:_},materialAppearanceType:{value:f}}),n(T.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!r(this._entity.availability)&&E.isConstant(this._showProperty)&&E.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!r(this._entity.availability)&&E.isConstant(this._showProperty)&&E.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return!1}},geometryChanged:{get:function(){return this._geometryChanged}}}),T.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},T.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},T.prototype.createFillGeometryInstance=function(i){var n,o,a=this._entity,s=a.isAvailable(i),u=new d(s&&a.isShowing&&this._showProperty.getValue(i)&&this._fillProperty.getValue(i)),h=this._distanceDisplayConditionProperty.getValue(i),m=l.fromDistanceDisplayCondition(h);if(this._materialProperty instanceof y){var f=e.WHITE;r(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(f=this._materialProperty.color.getValue(i)),o=t.fromColor(f),n={show:u,distanceDisplayCondition:m,color:o}}else n={show:u,distanceDisplayCondition:m};return new c({id:a,geometry:new p(this._options),attributes:n})},T.prototype.createOutlineGeometryInstance=function(i){var r=this._entity,n=r.isAvailable(i),o=E.getValueOrDefault(this._outlineColorProperty,i,e.BLACK),a=this._distanceDisplayConditionProperty.getValue(i);return new c({id:r,geometry:new m(this._options),attributes:{show:new d(n&&r.isShowing&&this._showProperty.getValue(i)&&this._showOutlineProperty.getValue(i)),color:t.fromColor(o),distanceDisplayCondition:l.fromDistanceDisplayCondition(a)}})},T.prototype.isDestroyed=function(){return!1},T.prototype.destroy=function(){this._entitySubscription(),o(this)},T.prototype._onEntityPropertyChanged=function(e,t,n,o){if("availability"===t||"wall"===t){var a=this._entity.wall;if(!r(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!r(s)||!s.isConstant||s.getValue(h.MINIMUM_VALUE),u=a.outline,c=r(u);if(c&&u.isConstant&&(c=u.getValue(h.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var d=a.positions,p=a.show;if(r(p)&&p.isConstant&&!p.getValue(h.MINIMUM_VALUE)||!r(d))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var m=i(a.material,A),g=m instanceof y;this._materialProperty=m,this._fillProperty=i(s,D),this._showProperty=i(p,P),this._showOutlineProperty=i(a.outline,M),this._outlineColorProperty=c?i(a.outlineColor,I):void 0,this._shadowsProperty=i(a.shadows,R),this._distanceDisplayConditionProperty=i(a.distanceDisplayCondition,O);var v=a.minimumHeights,C=a.maximumHeights,w=a.outlineWidth,S=a.granularity;if(this._fillEnabled=l,this._outlineEnabled=c,d.isConstant&&E.isConstant(v)&&E.isConstant(C)&&E.isConstant(w)&&E.isConstant(S)){var b=this._options;b.vertexFormat=g?_.VERTEX_FORMAT:f.MaterialSupport.TEXTURED.vertexFormat,b.positions=d.getValue(h.MINIMUM_VALUE,b.positions),b.minimumHeights=r(v)?v.getValue(h.MINIMUM_VALUE,b.minimumHeights):void 0,b.maximumHeights=r(C)?C.getValue(h.MINIMUM_VALUE,b.maximumHeights):void 0,b.granularity=r(S)?S.getValue(h.MINIMUM_VALUE):void 0,this._outlineWidth=r(w)?w.getValue(h.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},T.prototype.createDynamicUpdater=function(e){return new x(e,this)},x.prototype.update=function(i){var n=this._primitives;n.removeAndDestroy(this._primitive),n.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0;var o=this._geometryUpdater,a=o._entity,s=a.wall;if(a.isShowing&&a.isAvailable(i)&&E.getValueOrDefault(s.show,i,!0)){var l=this._options,u=E.getValueOrUndefined(s.positions,i,l.positions);if(r(u)){l.positions=u,l.minimumHeights=E.getValueOrUndefined(s.minimumHeights,i,l.minimumHeights),l.maximumHeights=E.getValueOrUndefined(s.maximumHeights,i,l.maximumHeights),l.granularity=E.getValueOrUndefined(s.granularity,i);var h=this._geometryUpdater.shadowsProperty.getValue(i);if(E.getValueOrDefault(s.fill,i,!0)){var d=S.getValue(i,o.fillMaterialProperty,this._material);this._material=d;var v=new f({material:d,translucent:d.isTranslucent(),closed:r(l.extrudedHeight)});l.vertexFormat=v.vertexFormat,this._primitive=n.add(new g({geometryInstances:new c({id:a,geometry:new p(l)}),appearance:v,asynchronous:!1,shadows:h}))}if(E.getValueOrDefault(s.outline,i,!1)){l.vertexFormat=_.VERTEX_FORMAT;var y=E.getValueOrClonedDefault(s.outlineColor,i,e.BLACK,N),C=E.getValueOrDefault(s.outlineWidth,i,1),w=1!==y.alpha;this._outlinePrimitive=n.add(new g({geometryInstances:new c({id:a,geometry:new m(l),attributes:{color:t.fromColor(y)}}),appearance:new _({flat:!0,translucent:w,renderState:{lineWidth:o._scene.clampLineWidth(C)}}),asynchronous:!1,shadows:h}))}}}},x.prototype.getBoundingSphere=function(e,t){return w(e,this._primitive,this._outlinePrimitive,t)},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),o(this)},T}),i("DataSources/DataSourceDisplay",["../Core/BoundingSphere","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EventHelper","../Scene/GroundPrimitive","./BillboardVisualizer","./BoundingSphereState","./BoxGeometryUpdater","./CorridorGeometryUpdater","./CustomDataSource","./CylinderGeometryUpdater","./EllipseGeometryUpdater","./EllipsoidGeometryUpdater","./GeometryVisualizer","./LabelVisualizer","./ModelVisualizer","./PathVisualizer","./PointVisualizer","./PolygonGeometryUpdater","./PolylineGeometryUpdater","./PolylineVolumeGeometryUpdater","./RectangleGeometryUpdater","./WallGeometryUpdater"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T){"use strict";function x(e){s.initializeTerrainHeights();var i=e.scene,r=e.dataSourceCollection;this._eventHelper=new a,this._eventHelper.add(r.dataSourceAdded,this._onDataSourceAdded,this),this._eventHelper.add(r.dataSourceRemoved,this._onDataSourceRemoved,this),this._dataSourceCollection=r,this._scene=i,this._visualizersCallback=t(e.visualizersCallback,x.defaultVisualizersCallback);for(var n=0,o=r.length;n<o;n++)this._onDataSourceAdded(r,r.get(n));var l=new d;this._onDataSourceAdded(void 0,l),this._defaultDataSource=l,this._ready=!1}x.defaultVisualizersCallback=function(e,t,i){var r=i.entities;return[new l(t,r),new _(c,e,r),new _(p,e,r),new _(h,e,r),new _(m,e,r),new _(f,e,r),new _(w,e,r),new _(S,e,r),new _(E,e,r),new _(b,e,r),new _(T,e,r),new g(t,r),new v(e,r),new C(t,r),new y(e,r)]},r(x.prototype,{scene:{get:function(){return this._scene}},dataSources:{get:function(){return this._dataSourceCollection}},defaultDataSource:{get:function(){return this._defaultDataSource}},ready:{get:function(){return this._ready}}}),x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){this._eventHelper.removeAll();for(var e=this._dataSourceCollection,t=0,i=e.length;t<i;++t)this._onDataSourceRemoved(this._dataSourceCollection,e.get(t));return this._onDataSourceRemoved(void 0,this._defaultDataSource),n(this)},x.prototype.update=function(e){if(!s._initialized)return this._ready=!1,!1;var t,r,n,o,a=!0,l=this._dataSourceCollection,u=l.length;for(t=0;t<u;t++){var c=l.get(t);for(i(c.update)&&(a=c.update(e)&&a),n=c._visualizers,o=n.length,r=0;r<o;r++)a=n[r].update(e)&&a}for(n=this._defaultDataSource._visualizers,o=n.length,r=0;r<o;r++)a=n[r].update(e)&&a;return this._ready=a,a};var A=[],P=new e;return x.prototype.getBoundingSphere=function(t,r,n){if(!this._ready)return u.PENDING;var o,a,s=this._defaultDataSource;if(!s.entities.contains(t)){s=void 0;var l=this._dataSourceCollection;for(a=l.length,o=0;o<a;o++){var c=l.get(o);if(c.entities.contains(t)){s=c;break}}}if(!i(s))return u.FAILED;var h=A,d=P,p=0,m=u.DONE,f=s._visualizers,_=f.length;for(o=0;o<_;o++){var g=f[o];if(i(g.getBoundingSphere)){if(m=f[o].getBoundingSphere(t,d),!r&&m===u.PENDING)return u.PENDING;m===u.DONE&&(h[p]=e.clone(d,h[p]),p++)}}return 0===p?u.FAILED:(h.length=p,e.fromBoundingSpheres(h,n),u.DONE)},x.prototype._onDataSourceAdded=function(e,t){var i=this._scene,r=t.clustering;r._initialize(i),i.primitives.add(r),t._visualizers=this._visualizersCallback(i,r,t)},x.prototype._onDataSourceRemoved=function(e,t){var i=this._scene,r=t.clustering;i.primitives.remove(r);for(var n=t._visualizers,o=n.length,a=0;a<o;a++)n[a].destroy();t._visualizers=void 0},x}),i("DataSources/DynamicGeometryUpdater",["../Core/DeveloperError"],function(e){"use strict";function t(){e.throwInstantiationError()}return t.prototype.update=e.throwInstantiationError,t.prototype.getBoundingSphere=e.throwInstantiationError,t.prototype.isDestroyed=e.throwInstantiationError,t.prototype.destroy=e.throwInstantiationError,t}),i("DataSources/EntityView",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Ellipsoid","../Core/HeadingPitchRange","../Core/JulianDate","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/Transforms","../Scene/SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d){"use strict";function p(t,r,n,o,a,c,p){var m=t.scene.mode,A=a.getValue(c,t._lastCartesian);if(i(A)){var P,D,M,I=!1;if(m===d.SCENE3D){T=s.addSeconds(c,.001,T);var R=a.getValue(T,y);if(i(R)){var O,N=h.computeFixedToIcrfMatrix(c,f),L=h.computeFixedToIcrfMatrix(T,_);i(N)&&i(L)?O=u.transpose(N,g):(O=h.computeTemeToPseudoFixedMatrix(c,g),N=u.transpose(O,f),L=h.computeTemeToPseudoFixedMatrix(T,_),u.transpose(L,L));var B=u.multiplyByVector(N,A,E),F=u.multiplyByVector(L,R,b);e.subtract(B,F,S);var V=1e3*e.magnitude(S),k=3986004418e5,z=-k/(V*V-2*k/e.magnitude(B));z<0||z>x*p.maximumRadius?(P=C,e.normalize(A,P),e.negate(P,P),M=e.clone(e.UNIT_Z,w),D=e.cross(M,P,y),e.magnitude(D)>l.EPSILON7&&(e.normalize(P,P),e.normalize(D,D),M=e.cross(P,D,w),e.normalize(M,M),I=!0)):e.equalsEpsilon(A,R,l.EPSILON7)||(M=C,e.normalize(B,M),e.normalize(F,F),D=e.cross(M,F,w),e.equalsEpsilon(D,e.ZERO,l.EPSILON7)||(P=e.cross(D,M,y),u.multiplyByVector(O,P,P),u.multiplyByVector(O,D,D),u.multiplyByVector(O,M,M),e.normalize(P,P),e.normalize(D,D),e.normalize(M,M),I=!0))}}i(t.boundingSphere)&&(A=t.boundingSphere.center);var U,G,W;o&&(U=e.clone(r.position,S),G=e.clone(r.direction,E),W=e.clone(r.up,b));var H=v;I?(H[0]=P.x,H[1]=P.y,H[2]=P.z,H[3]=0,H[4]=D.x,H[5]=D.y,H[6]=D.z,H[7]=0,H[8]=M.x,H[9]=M.y,H[10]=M.z,H[11]=0,H[12]=A.x,H[13]=A.y,H[14]=A.z,H[15]=0):h.eastNorthUpToFixedFrame(A,p,H),r._setTransform(H),o&&(e.clone(U,r.position),e.clone(G,r.direction),e.clone(W,r.up),e.cross(G,W,r.right))}if(n){var q=m===d.SCENE2D||e.equals(t._offset3D,e.ZERO)?void 0:t._offset3D;r.lookAtTransform(r.transform,q)}}function m(i,r,n){this.entity=i,this.scene=r,this.ellipsoid=t(n,o.WGS84),this.boundingSphere=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new e,this._defaultOffset3D=void 0,this._offset3D=new e}var f=new u,_=new u,g=new u,v=new c,y=new e,C=new e,w=new e,S=new e,E=new e,b=new e,T=new s,x=1.25;r(m,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(t){this._defaultOffset3D=e.clone(t,new e)}}}),m.defaultOffset3D=new e(-14e3,3500,3500);var A=new a,P=new e;return m.prototype.update=function(t,r){var n=this.scene,o=this.entity,a=this.ellipsoid,s=n.mode;if(s!==d.MORPHING){var u=o.position,c=o!==this._lastEntity,h=s!==this._mode,f=this._offset3D,_=n.camera,g=c||h,v=!0;if(c){var y=o.viewFrom,C=i(y);if(!C&&i(r)){var w=n.screenSpaceCameraController;w.minimumZoomDistance=Math.min(w.minimumZoomDistance,.5*r.radius),A.pitch=-l.PI_OVER_FOUR,A.range=0;var S=u.getValue(t,P);if(i(S)){var E=2-1/Math.max(1,e.magnitude(S)/a.maximumRadius);A.pitch*=E}_.viewBoundingSphere(r,A),this.boundingSphere=r,g=!1,v=!1}else C&&i(y.getValue(t,f))||e.clone(m._defaultOffset3D,f)}else h||n.mode===d.MORPHING||this._mode===d.SCENE2D||e.clone(_.position,f);this._lastEntity=o,this._mode=n.mode!==d.MORPHING?n.mode:this._mode,n.mode!==d.MORPHING&&p(this,_,g,v,u,t,a)}},m}),!function(){function e(e,t){function i(t){var i,r=e.arcs[t<0?~t:t],n=r[0];return e.transform?(i=[0,0],r.forEach(function(e){i[0]+=e[0],i[1]+=e[1]})):i=r[r.length-1],t<0?[i,n]:[n,i]}function r(e,t){for(var i in e){var r=e[i];delete t[r.start],delete r.start,delete r.end,r.forEach(function(e){n[e<0?~e:e]=1}),s.push(r)}}var n={},o={},a={},s=[],l=-1;return t.forEach(function(i,r){var n,o=e.arcs[i<0?~i:i];o.length<3&&!o[1][0]&&!o[1][1]&&(n=t[++l],t[l]=i,t[r]=n)}),t.forEach(function(e){var t,r,n=i(e),s=n[0],l=n[1];if(t=a[s])if(delete a[t.end],t.push(e),t.end=l,r=o[l]){delete o[r.start];var u=r===t?t:t.concat(r);o[u.start=t.start]=a[u.end=r.end]=u}else o[t.start]=a[t.end]=t;else if(t=o[l])if(delete o[t.start],t.unshift(e),t.start=s,r=a[s]){delete a[r.end];var c=r===t?t:r.concat(t);o[c.start=r.start]=a[c.end=t.end]=c}else o[t.start]=a[t.end]=t;else t=[e],o[t.start=s]=a[t.end=l]=t}),r(a,o),r(o,a),t.forEach(function(e){n[e<0?~e:e]||s.push([e])}),s}function t(t,i,r){function n(e){var t=e<0?~e:e;(c[t]||(c[t]=[])).push({i:e,g:u})}function o(e){e.forEach(n)}function a(e){e.forEach(o)}function s(e){"GeometryCollection"===e.type?e.geometries.forEach(s):e.type in h&&(u=e,h[e.type](e.arcs))}var l=[];if(arguments.length>1){var u,c=[],h={LineString:o,MultiLineString:a,Polygon:a,MultiPolygon:function(e){e.forEach(a)}};s(i),c.forEach(arguments.length<3?function(e){l.push(e[0].i)}:function(e){r(e[0].g,e[e.length-1].g)&&l.push(e[0].i)})}else for(var d=0,p=t.arcs.length;d<p;++d)l.push(d);return{type:"MultiLineString",arcs:e(t,l)}}function r(t,i){function r(e){e.forEach(function(t){t.forEach(function(t){(a[t=t<0?~t:t]||(a[t]=[])).push(e)})}),l.push(e)}function o(e){return d(s(t,{type:"Polygon",arcs:[e]}).coordinates[0])>0}var a={},l=[],u=[];return i.forEach(function(e){"Polygon"===e.type?r(e.arcs):"MultiPolygon"===e.type&&e.arcs.forEach(r)}),l.forEach(function(e){if(!e._){var t=[],i=[e];for(e._=1,u.push(t);e=i.pop();)t.push(e),e.forEach(function(e){e.forEach(function(e){a[e<0?~e:e].forEach(function(e){e._||(e._=1,i.push(e))})})})}}),l.forEach(function(e){delete e._}),{type:"MultiPolygon",arcs:u.map(function(i){var r=[];if(i.forEach(function(e){e.forEach(function(e){e.forEach(function(e){a[e<0?~e:e].length<2&&r.push(e)})})}),r=e(t,r),(n=r.length)>1)for(var s,l=o(i[0][0]),u=0;u<n;++u)if(l===o(r[u])){s=r[0],r[0]=r[u],r[u]=s;break}return r})}}function o(e,t){return"GeometryCollection"===t.type?{type:"FeatureCollection",features:t.geometries.map(function(t){return a(e,t)})}:a(e,t)}function a(e,t){var i={type:"Feature",id:t.id,properties:t.properties||{},geometry:s(e,t)};return null==t.id&&delete i.id,i}function s(e,t){function i(e,t){t.length&&t.pop();for(var i,r=c[e<0?~e:e],n=0,o=r.length;n<o;++n)t.push(i=r[n].slice()),u(i,n);e<0&&l(t,o)}function r(e){return e=e.slice(),u(e,0),e}function n(e){for(var t=[],r=0,n=e.length;r<n;++r)i(e[r],t);return t.length<2&&t.push(t[0].slice()),t}function o(e){for(var t=n(e);t.length<4;)t.push(t[0].slice());return t}function a(e){return e.map(o)}function s(e){var t=e.type;return"GeometryCollection"===t?{type:t,geometries:e.geometries.map(s)}:t in h?{type:t,coordinates:h[t](e)}:null}var u=_(e.transform),c=e.arcs,h={Point:function(e){return r(e.coordinates)},MultiPoint:function(e){return e.coordinates.map(r)},LineString:function(e){return n(e.arcs)},MultiLineString:function(e){return e.arcs.map(n)},Polygon:function(e){return a(e.arcs)},MultiPolygon:function(e){return e.arcs.map(a)}};return s(t)}function l(e,t){for(var i,r=e.length,n=r-t;n<--r;)i=e[n],e[n++]=e[r],e[r]=i}function u(e,t){for(var i=0,r=e.length;i<r;){var n=i+r>>>1;e[n]<t?i=n+1:r=n}return i}function c(e){function t(e,t){e.forEach(function(e){e<0&&(e=~e);var i=n[e];i?i.push(t):n[e]=[t]})}function i(e,i){e.forEach(function(e){t(e,i)})}function r(e,t){"GeometryCollection"===e.type?e.geometries.forEach(function(e){r(e,t)}):e.type in a&&a[e.type](e.arcs,t)}var n={},o=e.map(function(){return[]}),a={LineString:t,MultiLineString:i,Polygon:i,MultiPolygon:function(e,t){e.forEach(function(e){i(e,t)})}};e.forEach(r);for(var s in n)for(var l=n[s],c=l.length,h=0;h<c;++h)for(var d=h+1;d<c;++d){var p,m=l[h],f=l[d];(p=o[m])[s=u(p,f)]!==f&&p.splice(s,0,f),(p=o[f])[s=u(p,m)]!==m&&p.splice(s,0,m)}return o}function h(e,t){function i(e){o.remove(e),e[1][2]=t(e),o.push(e)}var r=_(e.transform),n=g(e.transform),o=f();return t||(t=p),e.arcs.forEach(function(e){for(var a,s,l=[],u=0,c=0,h=e.length;c<h;++c)s=e[c],r(e[c]=[s[0],s[1],1/0],c);for(var c=1,h=e.length-1;c<h;++c)a=e.slice(c-1,c+2),a[1][2]=t(a),l.push(a),o.push(a);for(var c=0,h=l.length;c<h;++c)a=l[c],a.previous=l[c-1],a.next=l[c+1];for(;a=o.pop();){var d=a.previous,p=a.next;a[1][2]<u?a[1][2]=u:u=a[1][2],d&&(d.next=p,d[2]=a[2],i(d)),p&&(p.previous=d,p[0]=a[0],i(p))}e.forEach(n)}),e}function d(e){for(var t,i=-1,r=e.length,n=e[r-1],o=0;++i<r;)t=n,n=e[i],o+=t[0]*n[1]-t[1]*n[0];return.5*o}function p(e){var t=e[0],i=e[1],r=e[2];return Math.abs((t[0]-r[0])*(i[1]-t[1])-(t[0]-i[0])*(r[1]-t[1]))}function m(e,t){return e[1][2]-t[1][2]}function f(){function e(e,t){for(;t>0;){var i=(t+1>>1)-1,n=r[i];if(m(e,n)>=0)break;r[n._=t]=n,r[e._=t=i]=e}}function t(e,t){for(;;){var i=t+1<<1,o=i-1,a=t,s=r[a];if(o<n&&m(r[o],s)<0&&(s=r[a=o]),i<n&&m(r[i],s)<0&&(s=r[a=i]),a===t)break;r[s._=t]=s,r[e._=t=a]=e}}var i={},r=[],n=0;return i.push=function(t){return e(r[t._=n]=t,n++),n},i.pop=function(){if(!(n<=0)){var e,i=r[0];return--n>0&&(e=r[n],t(r[e._=0]=e,0)),i}},i.remove=function(i){var o,a=i._;if(r[a]===i)return a!==--n&&(o=r[n],(m(o,i)<0?e:t)(r[o._=a]=o,a)),a},i}function _(e){if(!e)return v;var t,i,r=e.scale[0],n=e.scale[1],o=e.translate[0],a=e.translate[1];return function(e,s){s||(t=i=0),e[0]=(t+=e[0])*r+o,e[1]=(i+=e[1])*n+a}}function g(e){if(!e)return v;var t,i,r=e.scale[0],n=e.scale[1],o=e.translate[0],a=e.translate[1];return function(e,s){s||(t=i=0);var l=(e[0]-o)/r|0,u=(e[1]-a)/n|0;e[0]=l-t,e[1]=u-i,t=l,i=u}}function v(){}var y={version:"1.6.18",mesh:function(e){return s(e,t.apply(this,arguments))},meshArcs:t,merge:function(e){return s(e,r.apply(this,arguments))},mergeArcs:r,feature:o,neighbors:c,presimplify:h};"function"==typeof i&&i.amd?i("ThirdParty/topojson",y):"object"==typeof module&&module.exports?module.exports=y:this.topojson=y}(),i("DataSources/GeoJsonDataSource",["../Core/Cartesian3","../Core/Color","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/getFilenameFromUri","../Core/loadJson","../Core/PinBuilder","../Core/PolygonHierarchy","../Core/RuntimeError","../Scene/HeightReference","../Scene/VerticalOrigin","../ThirdParty/topojson","../ThirdParty/when","./BillboardGraphics","./CallbackProperty","./ColorMaterialProperty","./ConstantPositionProperty","./ConstantProperty","./CorridorGraphics","./DataSource","./EntityCluster","./EntityCollection","./PolygonGraphics","./PolylineGraphics"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A){"use strict";function P(t){return e.fromDegrees(t[0],t[1],t[2])}function D(e,t){var i="";for(var r in e)if(e.hasOwnProperty(r)){if(r===t||ue.indexOf(r)!==-1)continue;var o=e[r];n(o)&&(i+="object"==typeof o?"<tr><th>"+r+"</th><td>"+D(o)+"</td></tr>":"<tr><th>"+r+"</th><td>"+o+"</td></tr>")}return i.length>0&&(i='<table class="cesium-infoBox-defaultTable"><tbody>'+i+"</tbody></table>"),i}function M(e,t,i){var r;return function(o,a){return n(r)||(r=e(t,i)),r}}function I(e,t){return new v(M(D,e,t),!0)}function R(e,t,r){var o=e.id;if(n(o)&&"Feature"===e.type){for(var a=2,s=o;n(t.getById(s));)s=o+"_"+a,a++;o=s}else o=i();var l=t.getOrCreateEntity(o),u=e.properties;if(n(u)){l.addProperty("properties"),l.properties=u;var c,h=u.title;if(n(h))l.name=h,c="title";else{var d=Number.MAX_VALUE;for(var p in u)if(u.hasOwnProperty(p)&&u[p]){var m=p.toLowerCase();if(d>1&&"title"===m){d=1,c=p;break}d>2&&"name"===m?(d=2,c=p):d>3&&/title/i.test(p)?(d=3,c=p):d>4&&/name/i.test(p)&&(d=4,c=p)}n(c)&&(l.name=u[c])}var f=u.description;null!==f&&(l.description=n(f)?new w(f):r(u,c))}return l}function O(e,t){for(var i=new Array(e.length),r=0;r<e.length;r++)i[r]=t(e[r]);return i}function N(e,t,i,r,o){if(null===t.geometry)return void R(t,e._entityCollection,o.describe);if(!n(t.geometry))throw new d("feature.geometry is required.");var a=t.geometry.type,s=he[a];if(!n(s))throw new d("Unknown geometry type: "+a);s(e,t,t.geometry,r,o)}function L(e,t,i,r,n){for(var o=t.features,a=0,s=o.length;a<s;a++)N(e,o[a],void 0,r,n)}function B(e,t,i,r,o){for(var a=i.geometries,s=0,l=a.length;s<l;s++){var u=a[s],c=u.type,h=he[c];if(!n(h))throw new d("Unknown geometry type: "+c);h(e,t,u,r,o)}}function F(e,i,o,a,s){var l=s.markerSymbol,u=s.markerColor,c=s.markerSize,h=i.properties;if(n(h)){var d=h["marker-color"];n(d)&&(u=t.fromCssColorString(d)),c=r(le[h["marker-size"]],c);var f=h["marker-symbol"];n(f)&&(l=f)}var v;v=n(l)?1===l.length?e._pinBuilder.fromText(l.toUpperCase(),u,c):e._pinBuilder.fromMakiIconId(l,u,c):e._pinBuilder.fromColor(u,c);var y=new g;y.verticalOrigin=new w(m.BOTTOM),2===a.length&&s.clampToGround&&(y.heightReference=p.CLAMP_TO_GROUND);var S=R(i,e._entityCollection,s.describe);S.billboard=y,S.position=new C(o(a));var E=_(v).then(function(e){y.image=new w(e)}).otherwise(function(){y.image=new w(e._pinBuilder.fromColor(u,c))});e._promises.push(E)}function V(e,t,i,r,n){F(e,t,r,i.coordinates,n)}function k(e,t,i,r,n){for(var o=i.coordinates,a=0;a<o.length;a++)F(e,t,r,o[a],n)}function z(e,i,r,o,a){var s=a.strokeMaterialProperty,l=a.strokeWidthProperty,u=i.properties;if(n(u)){var c=u["stroke-width"];n(c)&&(l=new w(c));var h,d=u.stroke;n(d)&&(h=t.fromCssColorString(d));var p=u["stroke-opacity"];n(p)&&1!==p&&(n(h)||(h=s.color.clone()),h.alpha=p),n(h)&&(s=new y(h))}var m,f=R(i,e._entityCollection,a.describe);a.clampToGround?(m=new S,f.corridor=m):(m=new A,f.polyline=m),m.material=s,m.width=l,m.positions=new w(O(o,r))}function U(e,t,i,r,n){z(e,t,r,i.coordinates,n)}function G(e,t,i,r,n){for(var o=i.coordinates,a=0;a<o.length;a++)z(e,t,r,o[a],n)}function W(e,i,r,o,a){if(0!==o.length&&0!==o[0].length){var s=a.strokeMaterialProperty.color,l=a.fillMaterialProperty,u=a.strokeWidthProperty,c=i.properties;if(n(c)){var d=c["stroke-width"];n(d)&&(u=new w(d));var p,m=c.stroke;n(m)&&(p=t.fromCssColorString(m));var f=c["stroke-opacity"];n(f)&&1!==f&&(n(p)||(p=a.strokeMaterialProperty.color.clone()),p.alpha=f),n(p)&&(s=new w(p));var _,g=c.fill;n(g)&&(_=t.fromCssColorString(g),_.alpha=l.color.alpha),f=c["fill-opacity"],n(f)&&f!==l.color.alpha&&(n(_)||(_=l.color.clone()),_.alpha=f),n(_)&&(l=new y(_))}var v=new x;v.outline=new w(!0),v.outlineColor=s,v.outlineWidth=u,v.material=l;for(var C=[],S=1,E=o.length;S<E;S++)C.push(new h(O(o[S],r)));var b=o[0];v.hierarchy=new w(new h(O(b,r),C)),b[0].length>2?v.perPositionHeight=new w(!0):a.clampToGround||(v.height=0);var T=R(i,e._entityCollection,a.describe);T.polygon=v}}function H(e,t,i,r,n){W(e,t,r,i.coordinates,n)}function q(e,t,i,r,n){for(var o=i.coordinates,a=0;a<o.length;a++)W(e,t,r,o[a],n)}function j(e,t,i,r,n){for(var o in i.objects)if(i.objects.hasOwnProperty(o)){var a=f.feature(i,i.objects[o]),s=ce[a.type];s(e,a,a,r,n)}}function Y(e){this._name=e,this._changed=new s,this._error=new s,this._isLoading=!1,this._loading=new s,this._entityCollection=new T(this),this._promises=[],this._pinBuilder=new c,this._entityCluster=new b}function X(e,t,i,r){var o;n(r)&&(o=l(r)),n(o)&&e._name!==o&&(e._name=o,e._changed.raiseEvent(e));var a=ce[t.type];if(!n(a))throw new d("Unsupported GeoJSON object type: "+t.type);var s=t.crs,u=null!==s?P:null;if(n(s)){if(!n(s.properties))throw new d("crs.properties is undefined.");var c=s.properties;if("name"===s.type){if(u=K[c.name],!n(u))throw new d("Unknown crs name: "+c.name)}else if("link"===s.type){var h=Q[c.href];if(n(h)||(h=J[c.type]),!n(h))throw new d("Unable to resolve crs link: "+JSON.stringify(c));u=h(c)}else{if("EPSG"!==s.type)throw new d("Unknown crs type: "+s.type);if(u=K["EPSG:"+c.code],!n(u))throw new d("Unknown crs EPSG code: "+c.code)}}return _(u,function(r){return e._entityCollection.removeAll(),null!==r&&a(e,t,t,r,i),_.all(e._promises,function(){return e._promises.length=0,E.setLoading(e,!1),e})})}var Z,K={"urn:ogc:def:crs:OGC:1.3:CRS84":P,"EPSG:4326":P,"urn:ogc:def:crs:EPSG::4326":P},Q={},J={},$=48,ee=t.ROYALBLUE,te=t.YELLOW,ie=2,re=t.fromBytes(255,255,0,100),ne=!1,oe=new w(ie),ae=new y(te),se=new y(re),le={small:24,medium:48,large:64},ue=["title","description","marker-size","marker-symbol","marker-color","stroke","stroke-opacity","stroke-width","fill","fill-opacity"],ce={Feature:N,FeatureCollection:L,GeometryCollection:B,LineString:U,MultiLineString:G,MultiPoint:k,MultiPolygon:q,Point:V,Polygon:H,Topology:j},he={GeometryCollection:B,LineString:U,MultiLineString:G,MultiPoint:k,MultiPolygon:q,Point:V,Polygon:H,Topology:j};return Y.load=function(e,t){return(new Y).load(e,t)},o(Y,{markerSize:{get:function(){return $},set:function(e){$=e}},markerSymbol:{get:function(){return Z},set:function(e){Z=e}},markerColor:{get:function(){return ee},set:function(e){ee=e}},stroke:{get:function(){return te},set:function(e){te=e,ae.color.setValue(e)}},strokeWidth:{get:function(){return ie},set:function(e){ie=e,oe.setValue(e)}},fill:{get:function(){return re},set:function(e){re=e,se=new y(re)}},clampToGround:{get:function(){return ne},set:function(e){ne=e}},crsNames:{get:function(){return K}},crsLinkHrefs:{get:function(){return Q}},crsLinkTypes:{get:function(){return J}}}),o(Y.prototype,{name:{get:function(){return this._name}},clock:{value:void 0,writable:!1},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}}),Y.prototype.load=function(e,t){E.setLoading(this,!0);var i=e;t=r(t,r.EMPTY_OBJECT);var o=t.sourceUri;"string"==typeof e&&(n(o)||(o=e),i=u(e)),t={describe:r(t.describe,I),markerSize:r(t.markerSize,$),markerSymbol:r(t.markerSymbol,Z),markerColor:r(t.markerColor,ee),strokeWidthProperty:new w(r(t.strokeWidth,ie)),strokeMaterialProperty:new y(r(t.stroke,te)),fillMaterialProperty:new y(r(t.fill,re)),clampToGround:r(t.clampToGround,ne)};var a=this;return _(i,function(e){return X(a,e,t,o)}).otherwise(function(e){return E.setLoading(a,!1),a._error.raiseEvent(a,e),console.log(e),_.reject(e)})},Y}),i("DataSources/GeometryUpdater",["../Core/defineProperties","../Core/DeveloperError"],function(e,t){"use strict";function i(e,i){t.throwInstantiationError()}return e(i,{perInstanceColorAppearanceType:{get:t.throwInstantiationError},materialAppearanceType:{get:t.throwInstantiationError}}),e(i.prototype,{entity:{get:t.throwInstantiationError},fillEnabled:{get:t.throwInstantiationError},hasConstantFill:{get:t.throwInstantiationError},fillMaterialProperty:{get:t.throwInstantiationError},outlineEnabled:{get:t.throwInstantiationError},hasConstantOutline:{get:t.throwInstantiationError},outlineColorProperty:{get:t.throwInstantiationError},outlineWidth:{get:t.throwInstantiationError},isDynamic:{get:t.throwInstantiationError},isClosed:{get:t.throwInstantiationError},geometryChanged:{get:t.throwInstantiationError}}),i.prototype.isOutlineVisible=t.throwInstantiationError,i.prototype.isFilled=t.throwInstantiationError,i.prototype.createFillGeometryInstance=t.throwInstantiationError, +i.prototype.createOutlineGeometryInstance=t.throwInstantiationError,i.prototype.isDestroyed=t.throwInstantiationError,i.prototype.destroy=t.throwInstantiationError,i.prototype.createDynamicUpdater=t.throwInstantiationError,i}),function(e,t){"function"==typeof i&&i.amd?i("ThirdParty/Autolinker",[],function(){return e.Autolinker=t()}):"object"==typeof exports?module.exports=t():e.Autolinker=t()}(this,function(){var e=function(t){e.Util.assign(this,t);var i=this.hashtag;if(i!==!1&&"twitter"!==i&&"facebook"!==i)throw new Error("invalid `hashtag` cfg - see docs")};return e.prototype={constructor:e,urls:!0,email:!0,twitter:!0,phone:!0,hashtag:!1,newWindow:!0,stripPrefix:!0,truncate:void 0,className:"",htmlParser:void 0,matchParser:void 0,tagBuilder:void 0,link:function(e){for(var t=this.getHtmlParser(),i=t.parse(e),r=0,n=[],o=0,a=i.length;o<a;o++){var s=i[o],l=s.getType(),u=s.getText();if("element"===l)"a"===s.getTagName()&&(s.isClosing()?r=Math.max(r-1,0):r++),n.push(u);else if("entity"===l||"comment"===l)n.push(u);else if(0===r){var c=this.linkifyStr(u);n.push(c)}else n.push(u)}return n.join("")},linkifyStr:function(e){return this.getMatchParser().replace(e,this.createMatchReturnVal,this)},createMatchReturnVal:function(t){var i;if(this.replaceFn&&(i=this.replaceFn.call(this,this,t)),"string"==typeof i)return i;if(i===!1)return t.getMatchedText();if(i instanceof e.HtmlTag)return i.toAnchorString();var r=this.getTagBuilder(),n=r.build(t);return n.toAnchorString()},getHtmlParser:function(){var t=this.htmlParser;return t||(t=this.htmlParser=new e.htmlParser.HtmlParser),t},getMatchParser:function(){var t=this.matchParser;return t||(t=this.matchParser=new e.matchParser.MatchParser({urls:this.urls,email:this.email,twitter:this.twitter,phone:this.phone,hashtag:this.hashtag,stripPrefix:this.stripPrefix})),t},getTagBuilder:function(){var t=this.tagBuilder;return t||(t=this.tagBuilder=new e.AnchorTagBuilder({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),t}},e.link=function(t,i){var r=new e(i);return r.link(t)},e.match={},e.htmlParser={},e.matchParser={},e.Util={abstractMethod:function(){throw"abstract"},trimRegex:/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,assign:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e},extend:function(t,i){var r=t.prototype,n=function(){};n.prototype=r;var o;o=i.hasOwnProperty("constructor")?i.constructor:function(){r.constructor.apply(this,arguments)};var a=o.prototype=new n;return a.constructor=o,a.superclass=r,delete i.constructor,e.Util.assign(a,i),o},ellipsis:function(e,t,i){return e.length>t&&(i=null==i?"..":i,e=e.substring(0,t-i.length)+i),e},indexOf:function(e,t){if(Array.prototype.indexOf)return e.indexOf(t);for(var i=0,r=e.length;i<r;i++)if(e[i]===t)return i;return-1},splitAndCapture:function(e,t){if(!t.global)throw new Error("`splitRegex` must have the 'g' flag set");for(var i,r=[],n=0;i=t.exec(e);)r.push(e.substring(n,i.index)),r.push(i[0]),n=i.index+i[0].length;return r.push(e.substring(n)),r},trim:function(e){return e.replace(this.trimRegex,"")}},e.HtmlTag=e.Util.extend(Object,{whitespaceRegex:/\s+/,constructor:function(t){e.Util.assign(this,t),this.innerHtml=this.innerHtml||this.innerHTML},setTagName:function(e){return this.tagName=e,this},getTagName:function(){return this.tagName||""},setAttr:function(e,t){var i=this.getAttrs();return i[e]=t,this},getAttr:function(e){return this.getAttrs()[e]},setAttrs:function(t){var i=this.getAttrs();return e.Util.assign(i,t),this},getAttrs:function(){return this.attrs||(this.attrs={})},setClass:function(e){return this.setAttr("class",e)},addClass:function(t){for(var i,r=this.getClass(),n=this.whitespaceRegex,o=e.Util.indexOf,a=r?r.split(n):[],s=t.split(n);i=s.shift();)o(a,i)===-1&&a.push(i);return this.getAttrs().class=a.join(" "),this},removeClass:function(t){for(var i,r=this.getClass(),n=this.whitespaceRegex,o=e.Util.indexOf,a=r?r.split(n):[],s=t.split(n);a.length&&(i=s.shift());){var l=o(a,i);l!==-1&&a.splice(l,1)}return this.getAttrs().class=a.join(" "),this},getClass:function(){return this.getAttrs().class||""},hasClass:function(e){return(" "+this.getClass()+" ").indexOf(" "+e+" ")!==-1},setInnerHtml:function(e){return this.innerHtml=e,this},getInnerHtml:function(){return this.innerHtml||""},toAnchorString:function(){var e=this.getTagName(),t=this.buildAttrsStr();return t=t?" "+t:"",["<",e,t,">",this.getInnerHtml(),"</",e,">"].join("")},buildAttrsStr:function(){if(!this.attrs)return"";var e=this.getAttrs(),t=[];for(var i in e)e.hasOwnProperty(i)&&t.push(i+'="'+e[i]+'"');return t.join(" ")}}),e.AnchorTagBuilder=e.Util.extend(Object,{constructor:function(t){e.Util.assign(this,t)},build:function(t){var i=new e.HtmlTag({tagName:"a",attrs:this.createAttrs(t.getType(),t.getAnchorHref()),innerHtml:this.processAnchorText(t.getAnchorText())});return i},createAttrs:function(e,t){var i={href:t},r=this.createCssClass(e);return r&&(i.class=r),this.newWindow&&(i.target="_blank"),i},createCssClass:function(e){var t=this.className;return t?t+" "+t+"-"+e:""},processAnchorText:function(e){return e=this.doTruncate(e)},doTruncate:function(t){return e.Util.ellipsis(t,this.truncate||Number.POSITIVE_INFINITY)}}),e.htmlParser.HtmlParser=e.Util.extend(Object,{htmlRegex:function(){var e=/!--([\s\S]+?)--/,t=/[0-9a-zA-Z][0-9a-zA-Z:]*/,i=/[^\s\0"'>\/=\x01-\x1F\x7F]+/,r=/(?:"[^"]*?"|'[^']*?'|[^'"=<>`\s]+)/,n=i.source+"(?:\\s*=\\s*"+r.source+")?";return new RegExp(["(?:","<(!DOCTYPE)","(?:","\\s+","(?:",n,"|",r.source+")",")*",">",")","|","(?:","<(/)?","(?:",e.source,"|","(?:","("+t.source+")","(?:","\\s+",n,")*","\\s*/?",")",")",">",")"].join(""),"gi")}(),htmlCharacterEntitiesRegex:/( | |<|<|>|>|"|"|')/gi,parse:function(e){for(var t,i,r=this.htmlRegex,n=0,o=[];null!==(t=r.exec(e));){var a=t[0],s=t[3],l=t[1]||t[4],u=!!t[2],c=e.substring(n,t.index);c&&(i=this.parseTextAndEntityNodes(c),o.push.apply(o,i)),s?o.push(this.createCommentNode(a,s)):o.push(this.createElementNode(a,l,u)),n=t.index+a.length}if(n<e.length){var h=e.substring(n);h&&(i=this.parseTextAndEntityNodes(h),o.push.apply(o,i))}return o},parseTextAndEntityNodes:function(t){for(var i=[],r=e.Util.splitAndCapture(t,this.htmlCharacterEntitiesRegex),n=0,o=r.length;n<o;n+=2){var a=r[n],s=r[n+1];a&&i.push(this.createTextNode(a)),s&&i.push(this.createEntityNode(s))}return i},createCommentNode:function(t,i){return new e.htmlParser.CommentNode({text:t,comment:e.Util.trim(i)})},createElementNode:function(t,i,r){return new e.htmlParser.ElementNode({text:t,tagName:i.toLowerCase(),closing:r})},createEntityNode:function(t){return new e.htmlParser.EntityNode({text:t})},createTextNode:function(t){return new e.htmlParser.TextNode({text:t})}}),e.htmlParser.HtmlNode=e.Util.extend(Object,{text:"",constructor:function(t){e.Util.assign(this,t)},getType:e.Util.abstractMethod,getText:function(){return this.text}}),e.htmlParser.CommentNode=e.Util.extend(e.htmlParser.HtmlNode,{comment:"",getType:function(){return"comment"},getComment:function(){return this.comment}}),e.htmlParser.ElementNode=e.Util.extend(e.htmlParser.HtmlNode,{tagName:"",closing:!1,getType:function(){return"element"},getTagName:function(){return this.tagName},isClosing:function(){return this.closing}}),e.htmlParser.EntityNode=e.Util.extend(e.htmlParser.HtmlNode,{getType:function(){return"entity"}}),e.htmlParser.TextNode=e.Util.extend(e.htmlParser.HtmlNode,{getType:function(){return"text"}}),e.matchParser.MatchParser=e.Util.extend(Object,{urls:!0,email:!0,twitter:!0,phone:!0,hashtag:!1,stripPrefix:!0,matcherRegex:function(){var e=/(^|[^\w])@(\w{1,15})/,t=/(^|[^\w])#(\w{1,15})/,i=/(?:[\-;:&=\+\$,\w\.]+@)/,r=/(?:\+?\d{1,3}[-\s.])?\(?\d{3}\)?[-\s.]?\d{3}[-\s.]\d{4}/,n=/(?:[A-Za-z][-.+A-Za-z0-9]+:(?![A-Za-z][-.+A-Za-z0-9]+:\/\/)(?!\d+\/?)(?:\/\/)?)/,o=/(?:www\.)/,a=/[A-Za-z0-9\.\-]*[A-Za-z0-9\-]/,s=/\.(?:international|construction|contractors|enterprises|photography|productions|foundation|immobilien|industries|management|properties|technology|christmas|community|directory|education|equipment|institute|marketing|solutions|vacations|bargains|boutique|builders|catering|cleaning|clothing|computer|democrat|diamonds|graphics|holdings|lighting|partners|plumbing|supplies|training|ventures|academy|careers|company|cruises|domains|exposed|flights|florist|gallery|guitars|holiday|kitchen|neustar|okinawa|recipes|rentals|reviews|shiksha|singles|support|systems|agency|berlin|camera|center|coffee|condos|dating|estate|events|expert|futbol|kaufen|luxury|maison|monash|museum|nagoya|photos|repair|report|social|supply|tattoo|tienda|travel|viajes|villas|vision|voting|voyage|actor|build|cards|cheap|codes|dance|email|glass|house|mango|ninja|parts|photo|shoes|solar|today|tokyo|tools|watch|works|aero|arpa|asia|best|bike|blue|buzz|camp|club|cool|coop|farm|fish|gift|guru|info|jobs|kiwi|kred|land|limo|link|menu|mobi|moda|name|pics|pink|post|qpon|rich|ruhr|sexy|tips|vote|voto|wang|wien|wiki|zone|bar|bid|biz|cab|cat|ceo|com|edu|gov|int|kim|mil|net|onl|org|pro|pub|red|tel|uno|wed|xxx|xyz|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw)\b/,l=/[\-A-Za-z0-9+&@#\/%=~_()|'$*\[\]?!:,.;]*[\-A-Za-z0-9+&@#\/%=~_()|'$*\[\]]/;return new RegExp(["(",e.source,")","|","(",i.source,a.source,s.source,")","|","(","(?:","(",n.source,a.source,")","|","(?:","(.?//)?",o.source,a.source,")","|","(?:","(.?//)?",a.source,s.source,")",")","(?:"+l.source+")?",")","|","(",r.source,")","|","(",t.source,")"].join(""),"gi")}(),charBeforeProtocolRelMatchRegex:/^(.)?\/\//,constructor:function(t){e.Util.assign(this,t),this.matchValidator=new e.MatchValidator},replace:function(e,t,i){var r=this;return e.replace(this.matcherRegex,function(e,n,o,a,s,l,u,c,h,d,p,m,f){var _=r.processCandidateMatch(e,n,o,a,s,l,u,c,h,d,p,m,f);if(_){var g=t.call(i,_.match);return _.prefixStr+g+_.suffixStr}return e})},processCandidateMatch:function(t,i,r,n,o,a,s,l,u,c,h,d,p){var m,f=l||u,_="",g="";if(a&&!this.urls||o&&!this.email||c&&!this.phone||i&&!this.twitter||h&&!this.hashtag||!this.matchValidator.isValidMatch(a,s,f))return null;if(this.matchHasUnbalancedClosingParen(t)&&(t=t.substr(0,t.length-1),g=")"),o)m=new e.match.Email({matchedText:t,email:o});else if(i)r&&(_=r,t=t.slice(1)),m=new e.match.Twitter({matchedText:t,twitterHandle:n});else if(c){var v=t.replace(/\D/g,"");m=new e.match.Phone({matchedText:t,number:v})}else if(h)d&&(_=d,t=t.slice(1)),m=new e.match.Hashtag({matchedText:t,serviceName:this.hashtag,hashtag:p});else{if(f){var y=f.match(this.charBeforeProtocolRelMatchRegex)[1]||"";y&&(_=y,t=t.slice(1))}m=new e.match.Url({matchedText:t,url:t,protocolUrlMatch:!!s,protocolRelativeMatch:!!f,stripPrefix:this.stripPrefix})}return{prefixStr:_,suffixStr:g,match:m}},matchHasUnbalancedClosingParen:function(e){var t=e.charAt(e.length-1);if(")"===t){var i=e.match(/\(/g),r=e.match(/\)/g),n=i&&i.length||0,o=r&&r.length||0;if(n<o)return!0}return!1}}),e.MatchValidator=e.Util.extend(Object,{invalidProtocolRelMatchRegex:/^[\w]\/\//,hasFullProtocolRegex:/^[A-Za-z][-.+A-Za-z0-9]+:\/\//,uriSchemeRegex:/^[A-Za-z][-.+A-Za-z0-9]+:/,hasWordCharAfterProtocolRegex:/:[^\s]*?[A-Za-z]/,isValidMatch:function(e,t,i){return!(t&&!this.isValidUriScheme(t)||this.urlMatchDoesNotHaveProtocolOrDot(e,t)||this.urlMatchDoesNotHaveAtLeastOneWordChar(e,t)||this.isInvalidProtocolRelativeMatch(i))},isValidUriScheme:function(e){var t=e.match(this.uriSchemeRegex)[0].toLowerCase();return"javascript:"!==t&&"vbscript:"!==t},urlMatchDoesNotHaveProtocolOrDot:function(e,t){return!(!e||t&&this.hasFullProtocolRegex.test(t)||e.indexOf(".")!==-1)},urlMatchDoesNotHaveAtLeastOneWordChar:function(e,t){return!(!e||!t)&&!this.hasWordCharAfterProtocolRegex.test(e)},isInvalidProtocolRelativeMatch:function(e){return!!e&&this.invalidProtocolRelMatchRegex.test(e)}}),e.match.Match=e.Util.extend(Object,{constructor:function(t){e.Util.assign(this,t)},getType:e.Util.abstractMethod,getMatchedText:function(){return this.matchedText},getAnchorHref:e.Util.abstractMethod,getAnchorText:e.Util.abstractMethod}),e.match.Email=e.Util.extend(e.match.Match,{getType:function(){return"email"},getEmail:function(){return this.email},getAnchorHref:function(){return"mailto:"+this.email},getAnchorText:function(){return this.email}}),e.match.Hashtag=e.Util.extend(e.match.Match,{getType:function(){return"hashtag"},getHashtag:function(){return this.hashtag},getAnchorHref:function(){var e=this.serviceName,t=this.hashtag;switch(e){case"twitter":return"https://twitter.com/hashtag/"+t;case"facebook":return"https://www.facebook.com/hashtag/"+t;default:throw new Error("Unknown service name to point hashtag to: ",e)}},getAnchorText:function(){return"#"+this.hashtag}}),e.match.Phone=e.Util.extend(e.match.Match,{getType:function(){return"phone"},getNumber:function(){return this.number},getAnchorHref:function(){return"tel:"+this.number},getAnchorText:function(){return this.matchedText}}),e.match.Twitter=e.Util.extend(e.match.Match,{getType:function(){return"twitter"},getTwitterHandle:function(){return this.twitterHandle},getAnchorHref:function(){return"https://twitter.com/"+this.twitterHandle},getAnchorText:function(){return"@"+this.twitterHandle}}),e.match.Url=e.Util.extend(e.match.Match,{urlPrefixRegex:/^(https?:\/\/)?(www\.)?/i,protocolRelativeRegex:/^\/\//,protocolPrepended:!1,getType:function(){return"url"},getUrl:function(){var e=this.url;return this.protocolRelativeMatch||this.protocolUrlMatch||this.protocolPrepended||(e=this.url="http://"+e,this.protocolPrepended=!0),e},getAnchorHref:function(){var e=this.getUrl();return e.replace(/&/g,"&")},getAnchorText:function(){var e=this.getUrl();return this.protocolRelativeMatch&&(e=this.stripProtocolRelativePrefix(e)),this.stripPrefix&&(e=this.stripUrlPrefix(e)),e=this.removeTrailingSlash(e)},stripUrlPrefix:function(e){return e.replace(this.urlPrefixRegex,"")},stripProtocolRelativePrefix:function(e){return e.replace(this.protocolRelativeRegex,"")},removeTrailingSlash:function(e){return"/"===e.charAt(e.length-1)&&(e=e.slice(0,-1)),e}}),e}),i("ThirdParty/zip",["../Core/buildModuleUrl","../Core/defineProperties"],function(e,t){var i={};return function(i){function r(){var e=-1,t=this;t.append=function(i){var r,n=t.table;for(r=0;r<i.length;r++)e=e>>>8^n[255&(e^i[r])]},t.get=function(){return~e}}function n(e,t,i){return e.slice?e.slice(t,t+i):e.webkitSlice?e.webkitSlice(t,t+i):e.mozSlice?e.mozSlice(t,t+i):e.msSlice?e.msSlice(t,t+i):void 0}function o(e,t){var i,r;return i=new ArrayBuffer(e),r=new Uint8Array(i),t&&r.set(t,0),{buffer:i,array:r,view:new DataView(i)}}function a(){}function s(e){function t(t,i){var o=new Blob([e],{type:z});r=new u(o),r.init(function(){n.size=r.size,t()},i)}function i(e,t,i,n){r.readUint8Array(e,t,i,n)}var r,n=this;n.size=0,n.init=t,n.readUint8Array=i}function l(e){function t(t){for(var i=e.length;"="==e.charAt(i-1);)i--;r=e.indexOf(",")+1,n.size=Math.floor(.75*(i-r)),t()}function i(t,i,n){var a,s=o(i),l=4*Math.floor(t/3),u=4*Math.ceil((t+i)/3),c=window.atob(e.substring(l+r,u+r)),h=t-3*Math.floor(l/4);for(a=h;a<h+i;a++)s.array[a-h]=c.charCodeAt(a);n(s.array)}var r,n=this;n.size=0,n.init=t,n.readUint8Array=i}function u(e){function t(t){this.size=e.size,t()}function i(t,i,r,o){var a=new FileReader;a.onload=function(e){r(new Uint8Array(e.target.result))},a.onerror=o,a.readAsArrayBuffer(n(e,t,i))}var r=this;r.size=0,r.init=t,r.readUint8Array=i}function c(){}function h(e){function t(e){n=new Blob([],{type:z}),e()}function i(e,t){n=new Blob([n,P?e:e.buffer],{type:z}),t()}function r(t,i){var r=new FileReader;r.onload=function(e){t(e.target.result)},r.onerror=i,r.readAsText(n,e)}var n,o=this;o.init=t,o.writeUint8Array=i,o.getData=r}function d(e){function t(t){o+="data:"+(e||"")+";base64,",t()}function i(e,t){var i,r=a.length,n=a;for(a="",i=0;i<3*Math.floor((r+e.length)/3)-r;i++)n+=String.fromCharCode(e[i]);for(;i<e.length;i++)a+=String.fromCharCode(e[i]);n.length>2?o+=window.btoa(n):a=n,t()}function r(e){e(o+window.btoa(a))}var n=this,o="",a="";n.init=t,n.writeUint8Array=i,n.getData=r}function p(e){function t(t){n=new Blob([],{type:e}),t()}function i(t,i){n=new Blob([n,P?t:t.buffer],{type:e}),i()}function r(e){e(n)}var n,o=this;o.init=t,o.writeUint8Array=i,o.getData=r}function m(e,t,i,r,n,o,a,s,l,u){function c(){e.removeEventListener(U,h,!1),s(m)}function h(e){var t=e.data,r=t.data;t.onappend&&(m+=r.length,i.writeUint8Array(r,function(){o(!1,r),d()},u)),t.onflush&&(r?(m+=r.length,i.writeUint8Array(r,function(){o(!1,r),c()},u)):c()),t.progress&&a&&a(p+t.current,n)}function d(){p=f*F,p<n?t.readUint8Array(r+p,Math.min(F,n-p),function(t){e.postMessage({append:!0,data:t}),f++,a&&a(p,n),o(!0,t)},l):e.postMessage({flush:!0})}var p,m,f=0;m=0,e.addEventListener(U,h,!1),d()}function f(e,t,i,r,n,o,a,s,l,u){function c(){var m;h=d*F,h<n?t.readUint8Array(r+h,Math.min(F,n-h),function(t){var s=e.append(t,function(){a&&a(r+h,n)});p+=s.length,o(!0,t),i.writeUint8Array(s,function(){o(!1,s),d++,setTimeout(c,1)},u),a&&a(h,n)},l):(m=e.flush(),m?(p+=m.length,i.writeUint8Array(m,function(){o(!1,m),s(p)},u)):s(p))}var h,d=0,p=0;c()}function _(e,t,n,o,a,s,l,u,c){function h(e,t){a&&!e&&_.append(t)}function d(e){s(e,_.get())}var p,_=new r;return i.zip.useWebWorkers?(p=new Worker(i.zip.workerScriptsPath+V),m(p,e,t,n,o,h,l,d,u,c)):f(new i.zip.Inflater,e,t,n,o,h,l,d,u,c),p}function g(e,t,n,o,a,s,l){function u(e,t){e&&p.append(t)}function c(e){o(e,p.get())}function h(){d.removeEventListener(U,h,!1),m(d,e,t,0,e.size,u,a,c,s,l)}var d,p=new r;return i.zip.useWebWorkers?(d=new Worker(i.zip.workerScriptsPath+k),d.addEventListener(U,h,!1),d.postMessage({init:!0,level:n})):f(new i.zip.Deflater,e,t,0,e.size,u,a,c,s,l),d}function v(e,t,i,n,o,a,s,l,u){function c(){var r=h*F;r<n?e.readUint8Array(i+r,Math.min(F,n-r),function(e){o&&d.append(e),s&&s(r,n,e),t.writeUint8Array(e,function(){h++,c()},u)},l):a(n,d.get())}var h=0,d=new r;c()}function y(e){var t,i,r="",n=["Ç","ü","é","â","ä","à","å","ç","ê","ë","è","ï","î","ì","Ä","Å","É","æ","Æ","ô","ö","ò","û","ù","ÿ","Ö","Ü","ø","£","Ø","×","ƒ","á","í","ó","ú","ñ","Ñ","ª","º","¿","®","¬","½","¼","¡","«","»","_","_","_","¦","¦","Á","Â","À","©","¦","¦","+","+","¢","¥","+","+","-","-","+","-","+","ã","Ã","+","+","-","-","¦","-","+","¤","ð","Ð","Ê","Ë","È","i","Í","Î","Ï","+","+","_","_","¦","Ì","_","Ó","ß","Ô","Ò","õ","Õ","µ","þ","Þ","Ú","Û","Ù","ý","Ý","¯","´","­","±","_","¾","¶","§","÷","¸","°","¨","·","¹","³","²","_"," "];for(t=0;t<e.length;t++)i=255&e.charCodeAt(t),r+=i>127?n[i-128]:String.fromCharCode(i);return r}function C(e){return decodeURIComponent(escape(e))}function w(e){var t,i="";for(t=0;t<e.length;t++)i+=String.fromCharCode(e[t]);return i}function S(e){var t=(4294901760&e)>>16,i=65535&e;try{return new Date(1980+((65024&t)>>9),((480&t)>>5)-1,31&t,(63488&i)>>11,(2016&i)>>5,2*(31&i),0)}catch(e){}}function E(e,t,i,r,n){return e.version=t.view.getUint16(i,!0),e.bitFlag=t.view.getUint16(i+2,!0),e.compressionMethod=t.view.getUint16(i+4,!0),e.lastModDateRaw=t.view.getUint32(i+6,!0),e.lastModDate=S(e.lastModDateRaw),1===(1&e.bitFlag)?void n(M):((r||8!=(8&e.bitFlag))&&(e.crc32=t.view.getUint32(i+10,!0),e.compressedSize=t.view.getUint32(i+14,!0),e.uncompressedSize=t.view.getUint32(i+18,!0)),4294967295===e.compressedSize||4294967295===e.uncompressedSize?void n(I):(e.filenameLength=t.view.getUint16(i+22,!0),void(e.extraFieldLength=t.view.getUint16(i+24,!0))))}function b(e,t){function i(){}function r(i,n){e.readUint8Array(e.size-i,i,function(e){var t=o(e.length,e).view;1347093766!=t.getUint32(0)?r(i+1,n):n(t)},function(){t(R)})}return i.prototype.getData=function(i,r,n,a){function s(e,t){d&&d.terminate(),d=null,e&&e(t)}function l(e){var t=o(4);return t.view.setUint32(0,e),p.crc32==t.view.getUint32(0)}function u(e,t){a&&!l(t)?c():i.getData(function(e){s(r,e)})}function c(){s(t,L)}function h(){s(t,N)}var d,p=this;e.readUint8Array(p.offset,30,function(r){var s,l=o(r.length,r);return 1347093252!=l.view.getUint32(0)?void t(D):(E(p,l,4,!1,t),s=p.offset+30+p.filenameLength+p.extraFieldLength,void i.init(function(){0===p.compressionMethod?v(e,i,s,p.compressedSize,a,u,n,c,h):d=_(e,i,s,p.compressedSize,a,u,n,c,h)},h))},c)},{getEntries:function(n){return e.size<22?void t(D):void r(22,function(r){var a,s;a=r.getUint32(16,!0),s=r.getUint16(8,!0),e.readUint8Array(a,e.size-a,function(e){var r,a,l,u,c=0,h=[],d=o(e.length,e);for(r=0;r<s;r++){if(a=new i,1347092738!=d.view.getUint32(c))return void t(D);E(a,d,c+6,!0,t),a.commentLength=d.view.getUint16(c+32,!0),a.directory=16==(16&d.view.getUint8(c+38)),a.offset=d.view.getUint32(c+42,!0),l=w(d.array.subarray(c+46,c+46+a.filenameLength)),a.filename=2048===(2048&a.bitFlag)?C(l):y(l),a.directory||"/"!=a.filename.charAt(a.filename.length-1)||(a.directory=!0),u=w(d.array.subarray(c+46+a.filenameLength+a.extraFieldLength,c+46+a.filenameLength+a.extraFieldLength+a.commentLength)),a.comment=2048===(2048&a.bitFlag)?C(u):y(u),h.push(a),c+=46+a.filenameLength+a.extraFieldLength+a.commentLength}n(h)},function(){t(R)})})},close:function(e){e&&e()}}}function T(e){return unescape(encodeURIComponent(e))}function x(e){var t,i=[];for(t=0;t<e.length;t++)i.push(e.charCodeAt(t));return i}function A(e,t,i){function r(e,t){s&&s.terminate(),s=null,e&&e(t)}function n(){r(t,O)}function a(){r(t,L)}var s,l={},u=[],c=0;return{add:function(h,d,p,m,f){function _(t){var r;E=f.lastModDate||new Date,w=o(26),l[h]={headerArray:w.array,directory:f.directory,filename:S,offset:c,comment:x(T(f.comment||""))},w.view.setUint32(0,335546376),f.version&&w.view.setUint8(0,f.version),i||0===f.level||f.directory||w.view.setUint16(4,2048),w.view.setUint16(6,(E.getHours()<<6|E.getMinutes())<<5|E.getSeconds()/2,!0),w.view.setUint16(8,(E.getFullYear()-1980<<4|E.getMonth()+1)<<5|E.getDate(),!0),w.view.setUint16(22,S.length,!0),r=o(30+S.length),r.view.setUint32(0,1347093252),r.array.set(w.array,4),r.array.set(S,30),c+=r.array.length,e.writeUint8Array(r.array,t,n)}function y(t,i){var a=o(16);c+=t||0,a.view.setUint32(0,1347094280),"undefined"!=typeof i&&(w.view.setUint32(10,i,!0),a.view.setUint32(4,i,!0)),d&&(a.view.setUint32(8,t,!0),w.view.setUint32(14,t,!0),a.view.setUint32(12,d.size,!0),w.view.setUint32(18,d.size,!0)),e.writeUint8Array(a.array,function(){c+=16,r(p)},n)}function C(){return f=f||{},h=h.trim(),f.directory&&"/"!=h.charAt(h.length-1)&&(h+="/"),l.hasOwnProperty(h)?void t(B):(S=x(T(h)),u.push(h),void _(function(){d?i||0===f.level?v(d,e,0,d.size,!0,y,m,a,n):s=g(d,e,f.level,y,m,a,n):y()},n))}var w,S,E;d?d.init(C,a):C()},close:function(t){var i,a,s,h=0,d=0;for(a=0;a<u.length;a++)s=l[u[a]],h+=46+s.filename.length+s.comment.length;for(i=o(h+22),a=0;a<u.length;a++)s=l[u[a]],i.view.setUint32(d,1347092738),i.view.setUint16(d+4,5120),i.array.set(s.headerArray,d+6),i.view.setUint16(d+32,s.comment.length,!0),s.directory&&i.view.setUint8(d+38,16),i.view.setUint32(d+42,s.offset,!0),i.array.set(s.filename,d+46),i.array.set(s.comment,d+46+s.filename.length),d+=46+s.filename.length+s.comment.length;i.view.setUint32(d,1347093766),i.view.setUint16(d+8,u.length,!0),i.view.setUint16(d+10,u.length,!0),i.view.setUint32(d+12,h,!0),i.view.setUint32(d+16,c,!0),e.writeUint8Array(i.array,function(){r(function(){e.getData(t)})},n)}}}var P,D="File format is not recognized.",M="File contains encrypted entry.",I="File is using Zip64 (4gb+ file size).",R="Error while reading zip file.",O="Error while writing zip file.",N="Error while writing file data.",L="Error while reading file data.",B="File already exists.",F=524288,V="inflate.js",k="deflate.js",z="text/plain",U="message";try{P=0===new Blob([new DataView(new ArrayBuffer(0))]).size}catch(e){}r.prototype.table=function(){var e,t,i,r=[];for(e=0;e<256;e++){for(i=e,t=0;t<8;t++)1&i?i=i>>>1^3988292384:i>>>=1;r[e]=i}return r}(),s.prototype=new a,s.prototype.constructor=s,l.prototype=new a,l.prototype.constructor=l,u.prototype=new a,u.prototype.constructor=u,c.prototype.getData=function(e){e(this.data)},h.prototype=new c,h.prototype.constructor=h,d.prototype=new c,d.prototype.constructor=d,p.prototype=new c,p.prototype.constructor=p,i.zip={Reader:a,Writer:c,BlobReader:u,Data64URIReader:l,TextReader:s,BlobWriter:p,Data64URIWriter:d,TextWriter:h,createReader:function(e,t,i){e.init(function(){t(b(e,i))},i)},createWriter:function(e,t,i,r){e.init(function(){t(A(e,i,r))},i)},useWebWorkers:!0};var G;t(i.zip,{workerScriptsPath:{get:function(){return"undefined"==typeof G&&(G=e("ThirdParty/Workers/")),G}}})}(i),i.zip}),i("DataSources/KmlDataSource",["../Core/AssociativeArray","../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/ClockRange","../Core/ClockStep","../Core/Color","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Ellipsoid","../Core/Event","../Core/getAbsoluteUri","../Core/getExtensionFromUri","../Core/getFilenameFromUri","../Core/Iso8601","../Core/joinUrls","../Core/JulianDate","../Core/loadBlob","../Core/loadXML","../Core/Math","../Core/NearFarScalar","../Core/PinBuilder","../Core/PolygonHierarchy","../Core/Rectangle","../Core/RuntimeError","../Core/TimeInterval","../Core/TimeIntervalCollection","../Scene/HeightReference","../Scene/HorizontalOrigin","../Scene/LabelStyle","../Scene/SceneMode","../ThirdParty/Autolinker","../ThirdParty/Uri","../ThirdParty/when","../ThirdParty/zip","./BillboardGraphics","./CompositePositionProperty","./CorridorGraphics","./DataSource","./DataSourceClock","./Entity","./EntityCluster","./EntityCollection","./LabelGraphics","./PathGraphics","./PolygonGraphics","./PolylineGraphics","./PositionPropertyArray","./RectangleGraphics","./ReferenceProperty","./SampledPositionProperty","./ScaledPositionProperty","./TimeIntervalCollectionProperty","./WallGraphics"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I,R,O,N,L,B,F,V,k,z,U,G,W,H,q,j,Y,X,Z,K,Q,J,$,ee,te,ie,re){"use strict";function ne(e){var t=e.slice(0,Math.min(4,e.size)),i=F.defer(),r=new FileReader;return r.addEventListener("load",function(){i.resolve(1347093252===new DataView(r.result).getUint32(0,!1))}),r.addEventListener("error",function(){i.reject(r.error)}),r.readAsArrayBuffer(t),i.promise}function oe(e){var t=F.defer(),i=new FileReader;return i.addEventListener("load",function(){t.resolve(i.result)}),i.addEventListener("error",function(){t.reject(i.error)}),i.readAsText(e),t.promise}function ae(e,t,i,r){t.getData(new V.TextWriter,function(e){i.kml=gt.parseFromString(e,"application/xml"),r.resolve()})}function se(e,t,i,r){var n=u(_t.detectFromFilename(t.filename),"application/octet-stream");t.getData(new V.Data64URIWriter(n),function(e){i[t.filename]=e,r.resolve()})}function le(e,t,i,r){for(var n=r.keys,o=new B("."),a=e.querySelectorAll(t),s=0;s<a.length;s++){var l=a[s],u=l.getAttribute(i),c=new B(u).resolve(o).toString(),h=n.indexOf(c);if(h!==-1){var d=n[h];l.setAttribute(i,r[d]),"a"===t&&null===l.getAttribute("download")&&l.setAttribute("download",d)}}}function ue(e,t){return c(t)&&new B(e).isAbsolute()&&(e=t.getURL(e)),e}function ce(e,t,i){var r=fe(e,"id");r=c(r)&&0!==r.length?r:l(),c(i)&&(r=i+r);var n=t.getById(r);return c(n)&&(r=l(),c(i)&&(r=i+r)),n=t.add(new H({id:r})),c(n.kml)||(n.addProperty("kml"),n.kml=new ft),n}function he(e,t){return"absolute"===e||"relativeToGround"===e||"relativeToSeaFloor"===t}function de(e){if(!c(e))return r.fromDegrees(0,0,0);var t=e.match(/[^\s,\n]+/g);if(!c(t))return r.fromDegrees(0,0,0);var i=parseFloat(t[0]),n=parseFloat(t[1]),o=parseFloat(t[2]);return i=isNaN(i)?0:i,n=isNaN(n)?0:n,o=isNaN(o)?0:o,r.fromDegrees(i,n,o)}function pe(e){if(c(e)){var t=e.textContent.match(/[^\s\n]+/g);if(c(t)){for(var i=t.length,r=new Array(i),n=0,o=0;o<i;o++)r[n++]=de(t[o]);return r}}}function me(e,t){if(c(e)){var i=e.getAttribute(t);if(null!==i){var r=parseFloat(i);return isNaN(r)?void 0:r}}}function fe(e,t){if(c(e)){var i=e.getAttribute(t);return null!==i?i:void 0}}function _e(e,t,i){if(c(e))for(var r=e.childNodes,n=r.length,o=0;o<n;o++){var a=r[o];if(a.localName===t&&i.indexOf(a.namespaceURI)!==-1)return a}}function ge(e,t,i){if(c(e)){for(var r=[],n=e.getElementsByTagNameNS("*",t),o=n.length,a=0;a<o;a++){var s=n[a];s.localName===t&&i.indexOf(s.namespaceURI)!==-1&&r.push(s)}return r}}function ve(e,t,i){if(!c(e))return[];for(var r=[],n=e.childNodes,o=n.length,a=0;a<o;a++){var s=n[a];s.localName===t&&i.indexOf(s.namespaceURI)!==-1&&r.push(s)}return r}function ye(e,t,i){var r=_e(e,t,i);if(c(r)){var n=parseFloat(r.textContent);return isNaN(n)?void 0:n}}function Ce(e,t,i){var r=_e(e,t,i);if(c(r))return r.textContent.trim()}function we(e,t,i){var r=_e(e,t,i);if(c(r)){var n=r.textContent.trim();return"1"===n||/^true$/i.test(n)}}function Se(e,t,i,r){if(c(e)){var n=!1;if(c(r)){var o=r[e];if(c(o))n=!0,e=o;else{var a=f(e,i);o=r[a],c(o)&&(n=!0,e=o)}}return!n&&c(i)&&(e=f(e,f(i)),e=ue(e,t)),e}}function Ee(e,t){if(c(e)&&!/^\s*$/gm.test(e)){"#"===e[0]&&(e=e.substring(1));var i=parseInt(e.substring(0,2),16)/255,r=parseInt(e.substring(2,4),16)/255,n=parseInt(e.substring(4,6),16)/255,o=parseInt(e.substring(6,8),16)/255;return t?(o>0?Pt.maximumRed=o:Pt.red=0,n>0?Pt.maximumGreen=n:Pt.green=0,r>0?Pt.maximumBlue=r:Pt.blue=0,Pt.alpha=i,s.fromRandom(Pt)):new s(o,n,r,i)}}function be(e,t,i){var r=Ce(e,t,i);if(c(r))return Ee(r,"random"===Ce(e,"colorMode",i))}function Te(e){var t=_e(e,"TimeStamp",At.kmlgx),i=Ce(t,"when",At.kmlgx);if(c(t)&&c(i)&&0!==i.length){var r=C.fromIso8601(i),n=new M;return n.addInterval(new D({start:r,stop:v.MAXIMUM_VALUE})),n}}function xe(e){var t=_e(e,"TimeSpan",At.kmlgx);if(c(t)){var i,r=_e(t,"begin",At.kmlgx),n=c(r)?C.fromIso8601(r.textContent):void 0,o=_e(t,"end",At.kmlgx),a=c(o)?C.fromIso8601(o.textContent):void 0;if(c(n)&&c(a)){if(C.lessThan(a,n)){var s=n;n=a,a=s}i=new M,i.addInterval(new D({start:n,stop:a}))}else c(n)?(i=new M,i.addInterval(new D({start:n,stop:v.MAXIMUM_VALUE}))):c(a)&&(i=new M,i.addInterval(new D({start:v.MINIMUM_VALUE,stop:a})));return i}}function Ae(){var e=new k;return e.width=yt,e.height=yt,e.scaleByDistance=new b(Ct,wt,St,Et),e.pixelOffsetScaleByDistance=new b(Ct,wt,St,Et),e}function Pe(){var e=new Z;return e.outline=!0,e.outlineColor=s.WHITE,e}function De(){var e=new Y;return e.translucencyByDistance=new b(3e6,1,5e6,0),e.pixelOffset=new i(17,0),e.horizontalOrigin=R.LEFT,e.font="16px sans-serif",e.style=O.FILL_AND_OUTLINE,e}function Me(e,t,i,r,n){var o=Ce(e,"href",At.kml);if(c(o)&&0!==o.length){if(0===o.indexOf("root://icons/palette-")){var a=o.charAt(21),s=u(ye(e,"x",At.gx),0),l=u(ye(e,"y",At.gx),0);s=Math.min(s/32,7),l=7-Math.min(l/32,7);var h=8*l+s;o="https://maps.google.com/mapfiles/kml/pal"+a+"/icon"+h+".png"}if(o=Se(o,t._proxy,i,r),n){var d=Ce(e,"refreshMode",At.kml),p=Ce(e,"viewRefreshMode",At.kml);"onInterval"===d||"onExpire"===d?console.log("KML - Unsupported Icon refreshMode: "+d):"onStop"!==p&&"onRegion"!==p||console.log("KML - Unsupported Icon viewRefreshMode: "+p);var m=u(Ce(e,"viewBoundScale",At.kml),1),f="onStop"===p?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",_=u(Ce(e,"viewFormat",At.kml),f),g=Ce(e,"httpQuery",At.kml),v=ot(_,g),C=y(o,v,!1);return at(t._camera,t._canvas,C,m,t._lastCameraView.bbox)}return o}}function Ie(e,n,o,a,s){var l=ye(n,"scale",At.kml),h=ye(n,"heading",At.kml),d=be(n,"color",At.kml),p=_e(n,"Icon",At.kml),m=Me(p,e,a,s,!1),f=ye(p,"x",At.gx),_=ye(p,"y",At.gx),g=ye(p,"w",At.gx),v=ye(p,"h",At.gx),y=_e(n,"hotSpot",At.kml),C=me(y,"x"),w=me(y,"y"),S=fe(y,"xunits"),b=fe(y,"yunits"),T=o.billboard; +c(T)||(T=Ae(),o.billboard=T),T.image=m,T.scale=l,T.color=d,(c(f)||c(_)||c(g)||c(v))&&(T.imageSubRegion=new t(f,_,g,v)),c(h)&&0!==h&&(T.rotation=E.toRadians(-h),T.alignedAxis=r.UNIT_Z),l=u(l,1);var x,A;c(C)&&("pixels"===S?x=-C*l:"insetPixels"===S?x=(C-yt)*l:"fraction"===S&&(x=-C*yt*l),x+=.5*yt*l),c(w)&&("pixels"===b?A=w*l:"insetPixels"===b?A=(-w+yt)*l:"fraction"===b&&(A=w*yt*l),A-=.5*yt*l),(c(x)||c(A))&&(T.pixelOffset=new i(x,A))}function Re(e,t,i,r,n){for(var o=0,a=t.childNodes.length;o<a;o++){var l=t.childNodes.item(o);if("IconStyle"===l.localName)Ie(e,l,i,r,n);else if("LabelStyle"===l.localName){var h=i.label;c(h)||(h=De(),i.label=h),h.scale=u(ye(l,"scale",At.kml),h.scale),h.fillColor=u(be(l,"color",At.kml),h.fillColor),h.text=i.name}else if("LineStyle"===l.localName){var d=i.polyline;c(d)||(d=new K,i.polyline=d),d.width=ye(l,"width",At.kml),d.material=be(l,"color",At.kml),c(be(l,"outerColor",At.gx))&&console.log("KML - gx:outerColor is not supported in a LineStyle"),c(ye(l,"outerWidth",At.gx))&&console.log("KML - gx:outerWidth is not supported in a LineStyle"),c(ye(l,"physicalWidth",At.gx))&&console.log("KML - gx:physicalWidth is not supported in a LineStyle"),c(we(l,"labelVisibility",At.gx))&&console.log("KML - gx:labelVisibility is not supported in a LineStyle")}else if("PolyStyle"===l.localName){var p=i.polygon;c(p)||(p=Pe(),i.polygon=p),p.material=u(be(l,"color",At.kml),p.material),p.fill=u(we(l,"fill",At.kml),p.fill),p.outline=u(we(l,"outline",At.kml),p.outline)}else if("BalloonStyle"===l.localName){var m=u(Ee(Ce(l,"bgColor",At.kml)),s.WHITE),f=u(Ee(Ce(l,"textColor",At.kml)),s.BLACK),_=Ce(l,"text",At.kml);i.addProperty("balloonStyle"),i.balloonStyle={bgColor:m,textColor:f,text:_}}else if("ListStyle"===l.localName){var g=Ce(l,"listItemType",At.kml);"radioFolder"!==g&&"checkOffOnly"!==g||console.log("KML - Unsupported ListStyle with listItemType: "+g)}}}function Oe(e,t,i,r,n,o){for(var a,s=new H,l=-1,u=i.childNodes,h=u.length,d=0;d<h;d++){var p=u[d];"Style"!==p.localName&&"StyleMap"!==p.localName||(l=d)}if(l!==-1){var m=u[l];if("Style"===m.localName)Re(t,m,s,n,o);else for(var _=ve(m,"Pair",At.kml),g=0;g<_.length;g++){var v=_[g],y=Ce(v,"key",At.kml);if("normal"===y){var C=Ce(v,"styleUrl",At.kml);if(c(C))a=r.getById(C),c(a)||(a=r.getById("#"+C)),c(a)&&s.merge(a);else{var w=_e(v,"Style",At.kml);Re(t,w,s,n,o)}}else console.log("KML - Unsupported StyleMap key: "+y)}}var S=Ce(i,"styleUrl",At.kml);if(c(S)){var E=S;if("#"!==S[0]&&S.indexOf("#")!==-1){var b=S.split("#"),T=b[0];c(n)&&(T=f(T,f(n))),E=T+"#"+b[1]}a=r.getById(E),c(a)||(a=r.getById("#"+E)),c(a)&&s.merge(a)}return s}function Ne(e,t,i){return S(ue(t,e._proxy)).then(function(r){return Le(e,r,i,t,!0)})}function Le(e,t,i,r,n,o){var a,s,l,u,h=ge(t,"Style",At.kml);if(c(h)){var d=h.length;for(a=0;a<d;a++)u=h[a],s=fe(u,"id"),c(s)&&(s="#"+s,n&&c(r)&&(s=r+s),c(i.getById(s))||(l=new H({id:s}),i.add(l),Re(e,u,l,r,o)))}var p=ge(t,"StyleMap",At.kml);if(c(p)){var m=p.length;for(a=0;a<m;a++){var _=p[a];if(s=fe(_,"id"),c(s))for(var g=ve(_,"Pair",At.kml),v=0;v<g.length;v++){var y=g[v],C=Ce(y,"key",At.kml);if("normal"===C){if(s="#"+s,n&&c(r)&&(s=r+s),!c(i.getById(s))){l=i.getOrCreateEntity(s);var w=Ce(y,"styleUrl",At.kml);if(c(w)){"#"!==w[0]&&(w="#"+w),n&&c(r)&&(w=r+w);var S=i.getById(w);c(S)&&l.merge(S)}else u=_e(y,"Style",At.kml),Re(e,u,l,r,o)}}else console.log("KML - Unsupported StyleMap key: "+C)}}}var E={},b=[],T=t.getElementsByTagName("styleUrl"),x=T.length;for(a=0;a<x;a++){var A=T[a].textContent;if("#"!==A[0]){var P=A.split("#");if(2===P.length){var D=P[0];c(E[D])||(c(r)&&(D=f(D,f(r))),b.push(Ne(e,D,i,r)))}}}return b}function Be(e,t,i){var r=new $(e,t.id,["position"]),n=new te(t.position);t.polyline=c(i.polyline)?i.polyline.clone():new K,t.polyline.positions=new Q([r,n])}function Fe(e,t){return!c(e)&&!c(t)||"clampToGround"===e?I.CLAMP_TO_GROUND:"relativeToGround"===e?I.RELATIVE_TO_GROUND:"absolute"===e?I.NONE:"clampToSeaFloor"===t?(console.log("KML - <gx:altitudeMode>:clampToSeaFloor is currently not supported, using <kml:altitudeMode>:clampToGround."),I.CLAMP_TO_GROUND):"relativeToSeaFloor"===t?(console.log("KML - <gx:altitudeMode>:relativeToSeaFloor is currently not supported, using <kml:altitudeMode>:relativeToGround."),I.RELATIVE_TO_GROUND):(c(e)?console.log("KML - Unknown <kml:altitudeMode>:"+e+", using <kml:altitudeMode>:CLAMP_TO_GROUND."):console.log("KML - Unknown <gx:altitudeMode>:"+t+", using <kml:altitudeMode>:CLAMP_TO_GROUND."),I.CLAMP_TO_GROUND)}function Ve(e,t,i){return"relativeToSeaFloor"===i||"absolute"===t||"relativeToGround"===t?e:((c(t)&&"clampToGround"!==t||c(i)&&"clampToSeaFloor"!==i)&&console.log("KML - Unknown altitudeMode: "+u(t,i)),new te(e))}function ke(e,t,i){if(c(e)){if("relativeToSeaFloor"===i||"absolute"===t||"relativeToGround"===t)return e;(c(t)&&"clampToGround"!==t||c(i)&&"clampToSeaFloor"!==i)&&console.log("KML - Unknown altitudeMode: "+u(t,i));for(var r=e.length,n=0;n<r;n++){var o=e[n];p.WGS84.scaleToGeodeticSurface(o,o)}return e}}function ze(e,t,r,n){var o=t.label;c(o)||(o=c(r.label)?r.label.clone():De(),t.label=o),o.text=t.name;var a=t.billboard;c(a)||(a=c(r.billboard)?r.billboard.clone():Ae(),t.billboard=a),c(a.image)||(a.image=e._pinBuilder.fromColor(s.YELLOW,64));var l=1;c(a.scale)&&(l=a.scale.getValue(),0!==l?o.pixelOffset=new i(16*l+1,0):(o.pixelOffset=void 0,o.horizontalOrigin=void 0)),c(n)&&e._clampToGround&&(a.heightReference=n,o.heightReference=n)}function Ue(e,t,i){var r=t.path;c(r)||(r=new X,r.leadTime=0,t.path=r);var n=i.polyline;c(n)&&(r.material=n.material,r.width=n.width)}function Ge(e,t,i,r,n){var o=Ce(i,"coordinates",At.kml),a=Ce(i,"altitudeMode",At.kml),s=Ce(i,"altitudeMode",At.gx),l=we(i,"extrude",At.kml),u=de(o);return r.position=u,ze(e,r,n,Fe(a,s)),l&&he(a,s)&&Be(t,r,n),!0}function We(e,t,i,r,n){var o=_e(i,"coordinates",At.kml),a=Ce(i,"altitudeMode",At.kml),l=Ce(i,"altitudeMode",At.gx),h=we(i,"extrude",At.kml),d=we(i,"tessellate",At.kml),p=he(a,l);c(ye(i,"drawOrder",At.gx))&&console.log("KML - gx:drawOrder is not supported in LineStrings");var m=pe(o),f=n.polyline;if(p&&h){var _=new re;r.wall=_,_.positions=m;var g=n.polygon;c(g)&&(_.fill=g.fill,_.outline=g.outline,_.material=g.material),c(f)&&(_.outlineColor=c(f.material)?f.material.color:s.WHITE,_.outlineWidth=f.width)}else if(e._clampToGround&&!p&&d){var y=new U;r.corridor=y,y.positions=m,c(f)?(y.material=c(f.material)?f.material.color.getValue(v.MINIMUM_VALUE):s.WHITE,y.width=u(f.width,1)):(y.material=s.WHITE,y.width=1)}else f=c(f)?f.clone():new K,r.polyline=f,f.positions=ke(m,a,l),d&&!p||(f.followSurface=!1);return!0}function He(e,t,i,r,n){var o=_e(i,"outerBoundaryIs",At.kml),a=_e(o,"LinearRing",At.kml),l=_e(a,"coordinates",At.kml),u=pe(l),h=we(i,"extrude",At.kml),d=Ce(i,"altitudeMode",At.kml),p=Ce(i,"altitudeMode",At.gx),m=he(d,p),f=c(n.polygon)?n.polygon.clone():Pe(),_=n.polyline;if(c(_)&&(f.outlineColor=c(_.material)?_.material.color:s.WHITE,f.outlineWidth=_.width),r.polygon=f,m?(f.perPositionHeight=!0,f.extrudedHeight=h?0:void 0):e._clampToGround||(f.height=0),c(u)){for(var g=new x(u),v=ve(i,"innerBoundaryIs",At.kml),y=0;y<v.length;y++){a=ve(v[y],"LinearRing",At.kml);for(var C=0;C<a.length;C++)l=_e(a[C],"coordinates",At.kml),u=pe(l),c(u)&&g.holes.push(new x(u))}f.hierarchy=g}return!0}function qe(e,t,i,r,n){var o=Ce(i,"altitudeMode",At.kml),a=Ce(i,"altitudeMode",At.gx),s=ve(i,"coord",At.gx),l=ve(i,"angles",At.gx),u=ve(i,"when",At.kml),c=we(i,"extrude",At.kml),h=he(o,a);l.length>0&&console.log("KML - gx:angles are not supported in gx:Tracks");for(var d=Math.min(s.length,u.length),p=[],m=[],f=0;f<d;f++){var _=de(s[f].textContent);p.push(_),m.push(C.fromIso8601(u[f].textContent))}var g=new ee;return g.addSamples(m,p),r.position=g,ze(e,r,n,Fe(o,a)),Ue(e,r,n),r.availability=new M,u.length>0&&r.availability.addInterval(new D({start:m[0],stop:m[m.length-1]})),h&&c&&Be(t,r,n),!0}function je(e,t,i,r,n,o,a,s,l){var u=e[0],c=e[e.length-1],h=new ee;h.addSamples(e,t),i.intervals.addInterval(new D({start:u,stop:c,isStartIncluded:l,isStopIncluded:l,data:Ve(h,a,s)})),r.addInterval(new D({start:u,stop:c,isStartIncluded:l,isStopIncluded:l})),n.intervals.addInterval(new D({start:u,stop:c,isStartIncluded:l,isStopIncluded:l,data:o}))}function Ye(e,t,i,r,n){for(var o,a,s,l=we(i,"interpolate",At.gx),u=ve(i,"Track",At.gx),h=!1,d=new ie,p=new M,m=new z,f=0,_=u.length;f<_;f++){var g=u[f],v=ve(g,"when",At.kml),y=ve(g,"coord",At.gx),w=Ce(g,"altitudeMode",At.kml),S=Ce(g,"altitudeMode",At.gx),E=he(w,S),b=we(g,"extrude",At.kml),T=Math.min(y.length,v.length),x=[];o=[];for(var A=0;A<T;A++){var P=de(y[A].textContent);x.push(P),o.push(C.fromIso8601(v[A].textContent))}l&&(c(a)&&je([a,o[0]],[s,x[0]],m,p,d,!1,"absolute",void 0,!1),a=o[T-1],s=x[x.length-1]),je(o,x,m,p,d,E&&b,w,S,!0),h=h||E&&b}return r.availability=p,r.position=m,ze(e,r,n),Ue(e,r,n),h&&(Be(t,r,n),r.polyline.show=d),!0}function Xe(e,t,i,r,n,o){for(var a=i.childNodes,s=!1,l=0,u=a.length;l<u;l++){var h=a.item(l),d=Mt[h.localName];if(c(d)){var p=ce(h,t,o);p.parent=r,p.name=r.name,p.availability=r.availability,p.description=r.description,p.kml=r.kml,d(e,t,h,p,n)&&(s=!0)}}return s}function Ze(e,t,i,r,n){return console.log("KML - Unsupported geometry: "+i.localName),!1}function Ke(e,t){var i=_e(e,"ExtendedData",At.kml);if(c(i)){c(_e(i,"SchemaData",At.kml))&&console.log("KML - SchemaData is unsupported"),c(fe(i,"xmlns:prefix"))&&console.log("KML - ExtendedData with xmlns:prefix is unsupported");var r={},n=ve(i,"Data",At.kml);if(c(n))for(var o=n.length,a=0;a<o;a++){var s=n[a],l=fe(s,"name");c(l)&&(r[l]={displayName:Ce(s,"displayName",At.kml),value:Ce(s,"value",At.kml)})}t.kml.extendedData=r}}function Qe(e,t,i,r){var n,o,a,l=t.kml,h=l.extendedData,d=Ce(e,"description",At.kml),p=u(t.balloonStyle,i.balloonStyle),m=s.WHITE,f=s.BLACK,_=d;c(p)&&(m=u(p.bgColor,s.WHITE),f=u(p.textColor,s.BLACK),_=u(p.text,d));var g;if(c(_)){if(_=_.replace("$[name]",u(t.name,"")),_=_.replace("$[description]",u(d,"")),_=_.replace("$[address]",u(l.address,"")),_=_.replace("$[Snippet]",u(l.snippet,"")),_=_.replace("$[id]",t.id),_=_.replace("$[geDirections]",""),c(h)){var v=_.match(/\$\[.+?\]/g);if(null!==v)for(n=0;n<v.length;n++){var y=v[n],C=y.substr(2,y.length-3),w=/\/displayName$/.test(C);C=C.replace(/\/displayName$/,""),g=h[C],c(g)&&(g=w?g.displayName:g.value),c(g)&&(_=_.replace(y,u(g,"")))}}}else if(c(h)&&(a=Object.keys(h),a.length>0)){for(_='<table class="cesium-infoBox-defaultTable cesium-infoBox-defaultTable-lighter"><tbody>',n=0;n<a.length;n++)o=a[n],g=h[o],_+="<tr><th>"+u(g.displayName,o)+"</th><td>"+u(g.value,"")+"</td></tr>";_+="</tbody></table>"}if(c(_)){_=vt.link(_),Dt.innerHTML=_;var S=Dt.querySelectorAll("a");for(n=0;n<S.length;n++)S[n].setAttribute("target","_blank");c(r)&&r.keys.length>1&&(le(Dt,"a","href",r),le(Dt,"img","src",r));var E='<div class="cesium-infoBox-description-lighter" style="';E+="overflow:auto;",E+="word-wrap:break-word;",E+="background-color:"+m.toCssColorString()+";",E+="color:"+f.toCssColorString()+";",E+='">',E+=Dt.innerHTML+"</div>",Dt.innerHTML="",t.description=E}}function Je(e,t,i,r,n,o,a,s,l){function h(e){return!e||e.show&&h(e.parent)}var d=ce(i,r,l),p=d.kml,m=Oe(d,e,i,n,o,a),f=Ce(i,"name",At.kml);d.name=f,d.parent=t;var _=xe(i);c(_)||(_=Te(i)),d.availability=_,pt(d);var g=we(i,"visibility",At.kml);d.show=h(t)&&u(g,!0);var v=_e(i,"author",At.atom),y=p.author;y.name=Ce(v,"name",At.atom),y.uri=Ce(v,"uri",At.atom),y.email=Ce(v,"email",At.atom);var C=_e(i,"link",At.atom),w=p.link;return w.href=fe(C,"href"),w.hreflang=fe(C,"hreflang"),w.rel=fe(C,"rel"),w.type=fe(C,"type"),w.title=fe(C,"title"),w.length=fe(C,"length"),p.address=Ce(i,"address",At.kml),p.phoneNumber=Ce(i,"phoneNumber",At.kml),p.snippet=Ce(i,"Snippet",At.kml),Ke(i,d),Qe(i,d,m,a),c(_e(i,"Camera",At.kml))&&console.log("KML - Unsupported view: Camera"),c(_e(i,"LookAt",At.kml))&&console.log("KML - Unsupported view: LookAt"),c(_e(i,"Region",At.kml))&&console.log("KML - Placemark Regions are unsupported"),{entity:d,styleEntity:m}}function $e(e,t,i,r,n,o,a,s,l){for(var u=Object.keys(Bt),c=u.length,h=0;h<c;h++)for(var d=u[h],p=Bt[d],m=i.childNodes,f=m.length,_=0;_<f;_++){var g=m[_];g.localName!==d||At.kml.indexOf(g.namespaceURI)===-1&&At.gx.indexOf(g.namespaceURI)===-1||p(e,t,g,r,n,o,a,s,l)}}function et(e,t,i,r,n,o,a,s,l){var u=Je(e,t,i,r,n,o,a,s,l);$e(e,u.entity,i,r,n,o,a,s,l)}function tt(e,t,i,r,n,o,a,s,l){for(var u=Je(e,t,i,r,n,o,a,s,l),h=u.entity,d=u.styleEntity,p=!1,m=i.childNodes,f=0,_=m.length;f<_&&!p;f++){var g=m.item(f),v=Mt[g.localName];c(v)&&(v(e,r,g,h,d,h.id),p=!0)}p||(h.merge(d),ze(e,h,d))}function it(e,t,i,r,n,o,a,s,l){var u,h=Je(e,t,i,r,n,o,a,s,l),d=h.entity,p=!1,m=pe(_e(i,"LatLonQuad",At.gx));if(c(m))u=Pe(),u.hierarchy=new x(m),d.polygon=u,p=!0;else{u=new J,d.rectangle=u;var f=_e(i,"LatLonBox",At.kml);if(c(f)){var _=ye(f,"west",At.kml),g=ye(f,"south",At.kml),v=ye(f,"east",At.kml),y=ye(f,"north",At.kml);c(_)&&(_=E.negativePiToPi(E.toRadians(_))),c(g)&&(g=E.clampToLatitudeRange(E.toRadians(g))),c(v)&&(v=E.negativePiToPi(E.toRadians(v))),c(y)&&(y=E.clampToLatitudeRange(E.toRadians(y))),u.coordinates=new A(_,g,v,y);var C=ye(f,"rotation",At.kml);c(C)&&(u.rotation=E.toRadians(C))}}var w=_e(i,"Icon",At.kml),S=Me(w,e,o,a,!0);if(c(S)){p&&console.log("KML - gx:LatLonQuad Icon does not support texture projection.");var b=ye(w,"x",At.gx),T=ye(w,"y",At.gx),P=ye(w,"w",At.gx),D=ye(w,"h",At.gx);(c(b)||c(T)||c(P)||c(D))&&console.log("KML - gx:x, gx:y, gx:w, gx:h aren't supported for GroundOverlays"),u.material=S,u.material.color=be(i,"color",At.kml),u.material.transparent=!0}else u.material=be(i,"color",At.kml);var M=Ce(i,"altitudeMode",At.kml);c(M)?"absolute"===M?u.height=ye(i,"altitude",At.kml):"clampToGround"!==M&&console.log("KML - Unknown altitudeMode: "+M):(M=Ce(i,"altitudeMode",At.gx),"relativeToSeaFloor"===M?(console.log("KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute."),u.height=ye(i,"altitude",At.kml)):"clampToSeaFloor"===M?console.log("KML - altitudeMode clampToSeaFloor is currently not supported, treating as clampToGround."):c(M)&&console.log("KML - Unknown altitudeMode: "+M))}function rt(e,t,i,r,n,o,a,s,l){e._unsupportedNode.raiseEvent(e,t,i,r,n,o,a),console.log("KML - Unsupported feature: "+i.localName)}function nt(e){if(!c(e)||0===e.length)return"";var t=e[0];return"&"===t&&e.splice(0,1),"?"!==t&&(e="?"+e),e}function ot(e,t){var i="";return(c(e)&&e.length>0||c(t)&&t.length>0)&&(i+=y(nt(e),nt(t),!1)),i}function at(e,t,i,n,o){function a(e){return e<-E.PI_OVER_TWO?-E.PI_OVER_TWO:e>E.PI_OVER_TWO?E.PI_OVER_TWO:e}function s(e){return e>E.PI?e-E.TWO_PI:e<-E.PI?e+E.TWO_PI:e}if(c(e)&&e._mode!==N.MORPHING){var l,h,d=p.WGS84;if(o=u(o,Rt),c(t)&&(Nt.x=.5*t.clientWidth,Nt.y=.5*t.clientHeight,l=e.pickEllipsoid(Nt,d,Lt)),c(l)?h=d.cartesianToCartographic(l,Ot):(h=A.center(o,Ot),l=d.cartographicToCartesian(h)),c(n)&&!E.equalsEpsilon(n,1,E.EPSILON9)){var m=o.width*n*.5,f=o.height*n*.5;o=new A(s(h.longitude-m),a(h.latitude-f),s(h.longitude+m),a(h.latitude+f))}i=i.replace("[bboxWest]",E.toDegrees(o.west).toString()),i=i.replace("[bboxSouth]",E.toDegrees(o.south).toString()),i=i.replace("[bboxEast]",E.toDegrees(o.east).toString()),i=i.replace("[bboxNorth]",E.toDegrees(o.north).toString());var _=E.toDegrees(h.longitude).toString(),g=E.toDegrees(h.latitude).toString();i=i.replace("[lookatLon]",_),i=i.replace("[lookatLat]",g),i=i.replace("[lookatTilt]",E.toDegrees(e.pitch).toString()),i=i.replace("[lookatHeading]",E.toDegrees(e.heading).toString()),i=i.replace("[lookatRange]",r.distance(e.positionWC,l)),i=i.replace("[lookatTerrainLon]",_),i=i.replace("[lookatTerrainLat]",g),i=i.replace("[lookatTerrainAlt]",h.height.toString()),d.cartesianToCartographic(e.positionWC,Ot),i=i.replace("[cameraLon]",E.toDegrees(Ot.longitude).toString()),i=i.replace("[cameraLat]",E.toDegrees(Ot.latitude).toString()),i=i.replace("[cameraAlt]",E.toDegrees(Ot.height).toString());var v=e.frustum,y=v.aspectRatio,C="",w="";if(c(y)){var S=E.toDegrees(v.fov);y>1?(C=S,w=S/y):(w=S,C=S*y)}i=i.replace("[horizFov]",C.toString()),i=i.replace("[vertFov]",w.toString())}else i=i.replace("[bboxWest]","-180"),i=i.replace("[bboxSouth]","-90"),i=i.replace("[bboxEast]","180"),i=i.replace("[bboxNorth]","90"),i=i.replace("[lookatLon]",""),i=i.replace("[lookatLat]",""),i=i.replace("[lookatRange]",""),i=i.replace("[lookatTilt]",""),i=i.replace("[lookatHeading]",""),i=i.replace("[lookatTerrainLon]",""),i=i.replace("[lookatTerrainLat]",""),i=i.replace("[lookatTerrainAlt]",""),i=i.replace("[cameraLon]",""),i=i.replace("[cameraLat]",""),i=i.replace("[cameraAlt]",""),i=i.replace("[horizFov]",""),i=i.replace("[vertFov]","");return c(t)?(i=i.replace("[horizPixels]",t.clientWidth),i=i.replace("[vertPixels]",t.clientHeight)):(i=i.replace("[horizPixels]",""),i=i.replace("[vertPixels]","")),i=i.replace("[terrainEnabled]","1"),i=i.replace("[clientVersion]","1"),i=i.replace("[kmlVersion]","2.2"),i=i.replace("[clientName]","Cesium"),i=i.replace("[language]","English")}function st(e,t,i,r,n,o,a,s,h){var d=Je(e,t,i,r,n,o,a,s,h),p=d.entity,m=_e(i,"Link",At.kml);if(c(m)||(m=_e(i,"Url",At.kml)),c(m)){var _=Ce(m,"href",At.kml);if(c(_)){var g=_;_=Se(_,void 0,o,a);var v;if(/^data:/.test(_))v=_,/\.kmz/i.test(o)||(g=f(g,o));else{g=_;var w=Ce(m,"viewRefreshMode",At.kml),S=u(Ce(m,"viewBoundScale",At.kml),1),E="onStop"===w?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",b=u(Ce(m,"viewFormat",At.kml),E),T=Ce(m,"httpQuery",At.kml),x=ot(b,T);v=at(e._camera,e._canvas,y(_,x,!1),S,e._lastCameraView.bbox)}var A={sourceUri:g,uriResolver:a,context:p.id},P=new j,D=ht(e,P,v,A).then(function(t){var i=e._entityCollection,r=P.values;i.suspendEvents();for(var n=0;n<r.length;n++){var o=r[n];c(o.parent)||(o.parent=p,pt(o)),i.add(o)}i.resumeEvents();var a=Ce(m,"refreshMode",At.kml),s=u(ye(m,"refreshInterval",At.kml),0);if("onInterval"===a&&s>0||"onExpire"===a||"onStop"===w){var h=_e(t,"NetworkLinkControl",At.kml),d=c(h),f=C.now(),g={id:l(),href:_,cookie:"",queryString:x,lastUpdated:f,updating:!1,entity:p,viewBoundScale:S,needsUpdate:!1,cameraUpdateTime:f},v=0;if(d&&(g.cookie=u(Ce(h,"cookie",At.kml),""),v=u(ye(h,"minRefreshPeriod",At.kml),0)),"onInterval"===a)d&&(s=Math.max(v,s)),g.refreshMode=It.INTERVAL,g.time=s;else if("onExpire"===a){var y;if(d&&(y=Ce(h,"expires",At.kml)),c(y))try{var E=C.fromIso8601(y),b=C.secondsDifference(E,f);b>0&&b<v&&C.addSeconds(f,v,E),g.refreshMode=It.EXPIRE,g.time=E}catch(e){console.log("KML - NetworkLinkControl expires is not a valid date")}else console.log("KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element")}else e._camera?(g.refreshMode=It.STOP,g.time=u(ye(m,"viewRefreshTime",At.kml),0)):console.log("A NetworkLink with viewRefreshMode=onStop requires a camera be passed in when creating the KmlDataSource");c(g.refreshMode)&&e._networkLinks.set(g.id,g)}else"onRegion"===w&&console.log("KML - Unsupported viewRefreshMode: onRegion")});s.push(D)}}}function lt(e,t,i,r,n,o,a,s,l){var u=Bt[t.localName];c(u)?u(e,i,t,r,n,o,a,s,l):rt(e,i,t,r,n,o,a,s,l)}function ut(e,t,i,r,n,o){t.removeAll();var a=[],s=i.documentElement,l="Document"===s.localName?s:_e(s,"Document",At.kml),u=Ce(l,"name",At.kml);!c(u)&&c(r)&&(u=g(r)),c(e._name)||(e._name=u);var h=new j(e);return F.all(Le(e,i,h,r,!1,n,o)).then(function(){var s=i.documentElement;if("kml"===s.localName)for(var l=s.childNodes,u=0;u<l.length;u++){var d=l[u];if(c(Bt[d.localName])){s=d;break}}return t.suspendEvents(),lt(e,s,void 0,t,h,r,n,a,o),t.resumeEvents(),F.all(a).then(function(){return i.documentElement})})}function ct(e,t,i,r){var n=F.defer();return V.createReader(new V.BlobReader(i),function(i){i.getEntries(function(o){for(var a,s,l=[],u={},h=0;h<o.length;h++){var d=o[h];if(!d.directory){var p=F.defer();l.push(p.promise),/\.kml$/i.test(d.filename)?c(a)&&/\//i.test(d.filename)?se(i,d,u,p):(c(a)&&se(i,a,u,s),a=d,s=p):se(i,d,u,p)}}c(a)&&ae(i,a,u,s),F.all(l).then(function(){return i.close(),c(u.kml)?(u.keys=Object.keys(u),ut(e,t,u.kml,r,u)):void n.reject(new P("KMZ file does not contain a KML document."))}).then(n.resolve).otherwise(n.reject)})},function(e){n.reject(e)}),n.promise}function ht(e,t,i,r){r=u(r,u.EMPTY_OBJECT);var n=r.sourceUri,o=r.uriResolver,a=r.context,s=i;return"string"==typeof i&&(s=w(ue(i,e._proxy)),n=u(n,i)),F(s).then(function(i){return i instanceof Blob?ne(i).then(function(r){return r?ct(e,t,i,n):oe(i).then(function(i){var r,s;try{r=gt.parseFromString(i,"application/xml")}catch(e){s=e.toString()}if(c(s)||r.body||"parsererror"===r.documentElement.tagName){var l=c(s)?s:r.documentElement.firstChild.nodeValue;throw l||(l=r.body.innerText),new P(l)}return ut(e,t,r,n,o,a)})}):ut(e,t,i,n,o,a)}).otherwise(function(t){return e._error.raiseEvent(e,t),console.log(t),F.reject(t)})}function dt(t){t=u(t,{});var i=t.camera,n=t.canvas;this._changed=new m,this._error=new m,this._loading=new m,this._refresh=new m,this._unsupportedNode=new m,this._clock=void 0,this._entityCollection=new j(this),this._name=void 0,this._isLoading=!1,this._proxy=t.proxy,this._pinBuilder=new T,this._networkLinks=new e,this._entityCluster=new q,this._canvas=n,this._camera=i,this._lastCameraView={position:c(i)?r.clone(i.positionWC):void 0,direction:c(i)?r.clone(i.directionWC):void 0,up:c(i)?r.clone(i.upWC):void 0,bbox:c(i)?i.computeViewRectangle():A.clone(A.MAX_VALUE)}}function pt(e){var t=e.parent;if(c(t)){var i=t.availability;if(c(i)){var r=e.availability;c(r)?r.intersect(i):e.availability=i}}}function mt(e,t,i,r,n){return function(o){function a(e){w.remove(e);for(var t=e._children,i=t.length,r=0;r<i;++r)a(t[r])}if(r.contains(t.id)){var s=!1,l=_e(o,"NetworkLinkControl",At.kml),h=c(l),d=0;if(h){if(c(_e(l,"Update",At.kml)))return console.log("KML - NetworkLinkControl updates aren't supported."),t.updating=!1,void r.remove(t.id);t.cookie=u(Ce(l,"cookie",At.kml),""),d=u(ye(l,"minRefreshPeriod",At.kml),0)}var p=C.now(),m=t.refreshMode;if(m===It.INTERVAL)c(l)&&(t.time=Math.max(d,t.time));else if(m===It.EXPIRE){var f;if(c(l)&&(f=Ce(l,"expires",At.kml)),c(f))try{var _=C.fromIso8601(f),g=C.secondsDifference(_,p);g>0&&g<d&&C.addSeconds(p,d,_),t.time=_}catch(e){console.log("KML - NetworkLinkControl expires is not a valid date"),s=!0}else console.log("KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element"),s=!0}var y=t.entity,w=e._entityCollection,S=i.values;w.suspendEvents();for(var E=w.values.slice(),b=0;b<E.length;++b){var T=E[b];T.parent===y&&(T.parent=void 0,a(T))}for(w.resumeEvents(),w.suspendEvents(),b=0;b<S.length;b++){var x=S[b];c(x.parent)||(x.parent=y,pt(x)),w.add(x)}w.resumeEvents(),s?r.remove(t.id):t.lastUpdated=p;var A=w.computeAvailability(),P=A.start,D=A.stop,M=C.equals(P,v.MINIMUM_VALUE),I=C.equals(D,v.MAXIMUM_VALUE);if(!M||!I){var R=e._clock;R.startTime===P&&R.stopTime===D||(R.startTime=P,R.stopTime=D,e._changed.raiseEvent(e))}t.updating=!1,t.needsUpdate=!1,e._refresh.raiseEvent(e,n)}}}function ft(){this.author={name:void 0,uri:void 0,email:void 0},this.link={href:void 0,hreflang:void 0,rel:void 0,type:void 0,title:void 0,length:void 0},this.address=void 0,this.phoneNumber=void 0,this.snippet=void 0,this.extendedData=void 0}if("undefined"==typeof DOMParser)return{};var _t={avi:"video/x-msvideo",bmp:"image/bmp",bz2:"application/x-bzip2",chm:"application/vnd.ms-htmlhelp",css:"text/css",csv:"text/csv",doc:"application/msword",dvi:"application/x-dvi",eps:"application/postscript",flv:"video/x-flv",gif:"image/gif",gz:"application/x-gzip",htm:"text/html",html:"text/html",ico:"image/vnd.microsoft.icon",jnlp:"application/x-java-jnlp-file",jpeg:"image/jpeg",jpg:"image/jpeg",m3u:"audio/x-mpegurl",m4v:"video/mp4",mathml:"application/mathml+xml",mid:"audio/midi",midi:"audio/midi",mov:"video/quicktime",mp3:"audio/mpeg",mp4:"video/mp4",mp4v:"video/mp4",mpeg:"video/mpeg",mpg:"video/mpeg",odp:"application/vnd.oasis.opendocument.presentation",ods:"application/vnd.oasis.opendocument.spreadsheet",odt:"application/vnd.oasis.opendocument.text",ogg:"application/ogg",pdf:"application/pdf",png:"image/png",pps:"application/vnd.ms-powerpoint",ppt:"application/vnd.ms-powerpoint",ps:"application/postscript",qt:"video/quicktime",rdf:"application/rdf+xml",rss:"application/rss+xml",rtf:"application/rtf",svg:"image/svg+xml",swf:"application/x-shockwave-flash",text:"text/plain",tif:"image/tiff",tiff:"image/tiff",txt:"text/plain",wav:"audio/x-wav",wma:"audio/x-ms-wma",wmv:"video/x-ms-wmv",xml:"application/xml",zip:"application/zip",detectFromFilename:function(e){var t=e.toLowerCase();return t=_(t),_t[t]}},gt=new DOMParser,vt=new L({stripPrefix:!1,twitter:!1,email:!1,replaceFn:function(e,t){if(!t.protocolUrlMatch)return!1}}),yt=32,Ct=2414016,wt=1,St=16093e3,Et=.1,bt=[null,void 0,"http://www.opengis.net/kml/2.2","http://earth.google.com/kml/2.2","http://earth.google.com/kml/2.1","http://earth.google.com/kml/2.0"],Tt=["http://www.google.com/kml/ext/2.2"],xt=["http://www.w3.org/2005/Atom"],At={kml:bt,gx:Tt,atom:xt,kmlgx:bt.concat(Tt)},Pt={},Dt=document.createElement("div"),Mt={Point:Ge,LineString:We,LinearRing:We,Polygon:He,Track:qe,MultiTrack:Ye,MultiGeometry:Xe,Model:Ze},It={INTERVAL:0,EXPIRE:1,STOP:2},Rt=new A,Ot=new n,Nt=new i,Lt=new r,Bt={Document:$e,Folder:et,Placemark:tt,NetworkLink:st,GroundOverlay:it,PhotoOverlay:rt,ScreenOverlay:rt,Tour:rt};dt.load=function(e,t){t=u(t,u.EMPTY_OBJECT);var i=new dt(t);return i.load(e,t)},h(dt.prototype,{name:{get:function(){return this._name}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},refreshEvent:{get:function(){return this._refresh}},unsupportedNodeEvent:{get:function(){return this._unsupportedNode}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}}),dt.prototype.load=function(e,t){t=u(t,{}),G.setLoading(this,!0);var i=this._name;this._name=void 0,this._clampToGround=u(t.clampToGround,!1);var r=this;return ht(this,this._entityCollection,e,t).then(function(){var e,t=r._entityCollection.computeAvailability(),n=t.start,s=t.stop,l=C.equals(n,v.MINIMUM_VALUE),u=C.equals(s,v.MAXIMUM_VALUE);if(!l||!u){var c;l&&(c=new Date,c.setHours(0,0,0,0),n=C.fromDate(c)),u&&(c=new Date,c.setHours(24,0,0,0),s=C.fromDate(c)),e=new W,e.startTime=n,e.stopTime=s,e.currentTime=C.clone(n),e.clockRange=o.LOOP_STOP,e.clockStep=a.SYSTEM_CLOCK_MULTIPLIER,e.multiplier=Math.round(Math.min(Math.max(C.secondsDifference(s,n)/60,1),31556900))}var h=!1;return e!==r._clock&&(r._clock=e,h=!0),i!==r._name&&(h=!0),h&&r._changed.raiseEvent(r),G.setLoading(r,!1),r}).otherwise(function(e){return G.setLoading(r,!1),r._error.raiseEvent(r,e),console.log(e),F.reject(e)})};var Ft=new e;return dt.prototype.update=function(t){function i(e){for(var t=e._children,r=t.length,n=0;n<r;++n){var o=t[n];Ft.set(o.id,o),i(o)}}var n=this._networkLinks;if(0===n.length)return!0;var o=C.now(),a=this;Ft.removeAll();var s=!1,l=this._lastCameraView,u=this._camera;!c(u)||u.positionWC.equalsEpsilon(l.position,E.EPSILON7)&&u.directionWC.equalsEpsilon(l.direction,E.EPSILON7)&&u.upWC.equalsEpsilon(l.up,E.EPSILON7)||(l.position=r.clone(u.positionWC),l.direction=r.clone(u.directionWC),l.up=r.clone(u.upWC),l.bbox=u.computeViewRectangle(),s=!0);var h=new e,d=!1;return n.values.forEach(function(e){var t=e.entity;if(!Ft.contains(t.id)){if(!e.updating){var r=!1;if(e.refreshMode===It.INTERVAL?C.secondsDifference(o,e.lastUpdated)>e.time&&(r=!0):e.refreshMode===It.EXPIRE?C.greaterThan(o,e.time)&&(r=!0):e.refreshMode===It.STOP&&(s&&(e.needsUpdate=!0,e.cameraUpdateTime=o),e.needsUpdate&&C.secondsDifference(o,e.cameraUpdateTime)>=e.time&&(r=!0)),r){i(t),e.updating=!0;var n=new j,u=y(e.href,ot(e.cookie,e.queryString),!1);u=at(a._camera,a._canvas,u,e.viewBoundScale,l.bbox),ht(a,n,u,{context:t.id}).then(mt(a,e,n,h,u)).otherwise(function(t){var i="NetworkLink "+e.href+" refresh failed: "+t;console.log(i),a._error.raiseEvent(a,i)}),d=!0}}h.set(e.id,e)}}),d&&(this._networkLinks=h,this._changed.raiseEvent(this)),!0},dt}),i("DataSources/VelocityOrientationProperty",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Ellipsoid","../Core/Event","../Core/Matrix3","../Core/Quaternion","../Core/Transforms","./Property","./VelocityVectorProperty"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(e,i){this._velocityVectorProperty=new c(e,!0),this._subscription=void 0,this._ellipsoid=void 0,this._definitionChanged=new o,this.ellipsoid=t(i,n.WGS84);var r=this;this._velocityVectorProperty.definitionChanged.addEventListener(function(){r._definitionChanged.raiseEvent(r)})}r(h.prototype,{isConstant:{get:function(){return u.isConstant(this._velocityVectorProperty)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._velocityVectorProperty.position},set:function(e){this._velocityVectorProperty.position=e}},ellipsoid:{get:function(){return this._ellipsoid},set:function(e){var t=this._ellipsoid;t!==e&&(this._ellipsoid=e,this._definitionChanged.raiseEvent(this))}}});var d=new e,p=new e,m=new a;return h.prototype.getValue=function(e,t){var r=this._velocityVectorProperty._getValue(e,p,d);if(i(r))return l.rotationMatrixFromPositionVelocity(d,r,this._ellipsoid,m),s.fromRotationMatrix(m,t)},h.prototype.equals=function(e){return this===e||e instanceof h&&u.equals(this._velocityVectorProperty,e._velocityVectorProperty)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))},h}),i("DataSources/Visualizer",["../Core/DeveloperError"],function(e){"use strict";function t(){e.throwInstantiationError()}return t.prototype.update=e.throwInstantiationError,t.prototype.getBoundingSphere=e.throwInstantiationError,t.prototype.isDestroyed=e.throwInstantiationError,t.prototype.destroy=e.throwInstantiationError,t}),i("Renderer/ClearCommand",["../Core/Color","../Core/defaultValue","../Core/freezeObject"],function(e,t,i){"use strict";function r(e){e=t(e,t.EMPTY_OBJECT),this.color=e.color,this.depth=e.depth,this.stencil=e.stencil,this.renderState=e.renderState,this.framebuffer=e.framebuffer,this.owner=e.owner}return r.ALL=i(new r({color:new e(0,0,0,0),depth:1,stencil:0})),r.prototype.execute=function(e,t){e.clear(this,t)},r}),i("Renderer/ComputeCommand",["../Core/defaultValue","./Pass"],function(e,t){"use strict";function i(i){i=e(i,e.EMPTY_OBJECT),this.vertexArray=i.vertexArray,this.fragmentShaderSource=i.fragmentShaderSource,this.shaderProgram=i.shaderProgram,this.uniformMap=i.uniformMap,this.outputTexture=i.outputTexture,this.preExecute=i.preExecute,this.postExecute=i.postExecute,this.persists=e(i.persists,!1),this.pass=t.COMPUTE,this.owner=i.owner}return i.prototype.execute=function(e){e.execute(this)},i}),i("Shaders/ViewportQuadVS",[],function(){"use strict";return"attribute vec4 position;\nattribute vec2 textureCoordinates;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_Position = position;\nv_textureCoordinates = textureCoordinates;\n}\n"}),i("Renderer/ComputeEngine",["../Core/BoundingRectangle","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/PrimitiveType","../Shaders/ViewportQuadVS","./ClearCommand","./DrawCommand","./Framebuffer","./RenderState","./ShaderProgram"],function(e,t,i,r,n,o,a,s,l,u,c,h){"use strict";function d(e){this._context=e}function p(e,t){return new u({context:e,colorTextures:[t],destroyAttachments:!1})}function m(e,t){return h.fromCache({context:e,vertexShaderSource:a,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}function f(t,r){return i(_)&&_.viewport.width===t&&_.viewport.height===r||(_=c.fromCache({viewport:new e(0,0,t,r)})),_}var _,g=new l({primitiveType:o.TRIANGLES +}),v=new s({color:new t(0,0,0,0)});return d.prototype.execute=function(e){i(e.preExecute)&&e.preExecute(e);var t=e.outputTexture,r=t.width,n=t.height,o=this._context,a=i(e.vertexArray)?e.vertexArray:o.getViewportQuadVertexArray(),s=i(e.shaderProgram)?e.shaderProgram:m(o,e.fragmentShaderSource),l=p(o,t),u=f(r,n),c=e.uniformMap,h=v;h.framebuffer=l,h.renderState=u,h.execute(o);var d=g;d.vertexArray=a,d.renderState=u,d.shaderProgram=s,d.uniformMap=c,d.framebuffer=l,d.execute(o),l.destroy(),e.persists||(s.destroy(),i(e.vertexArray)&&a.destroy()),i(e.postExecute)&&e.postExecute(t)},d.prototype.isDestroyed=function(){return!1},d.prototype.destroy=function(){return r(this)},d}),i("Renderer/PassState",[],function(){"use strict";function e(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0}return e}),i("Renderer/RenderbufferFormat",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={RGBA4:t.RGBA4,RGB5_A1:t.RGB5_A1,RGB565:t.RGB565,DEPTH_COMPONENT16:t.DEPTH_COMPONENT16,STENCIL_INDEX8:t.STENCIL_INDEX8,DEPTH_STENCIL:t.DEPTH_STENCIL,validate:function(e){return e===i.RGBA4||e===i.RGB5_A1||e===i.RGB565||e===i.DEPTH_COMPONENT16||e===i.STENCIL_INDEX8||e===i.DEPTH_STENCIL}};return e(i)}),i("Renderer/Renderbuffer",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","./ContextLimits","./RenderbufferFormat"],function(e,t,i,r,n,o,a){"use strict";function s(i){i=e(i,e.EMPTY_OBJECT);var r=i.context,n=r._gl,s=(o.maximumRenderbufferSize,e(i.format,a.RGBA4)),l=t(i.width)?i.width:n.drawingBufferWidth,u=t(i.height)?i.height:n.drawingBufferHeight;this._gl=n,this._format=s,this._width=l,this._height=u,this._renderbuffer=this._gl.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,this._renderbuffer),n.renderbufferStorage(n.RENDERBUFFER,s,l,u),n.bindRenderbuffer(n.RENDERBUFFER,null)}return i(s.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}}),s.prototype._getRenderbuffer=function(){return this._renderbuffer},s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),r(this)},s}),i("Renderer/PickFramebuffer",["../Core/BoundingRectangle","../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","./Framebuffer","./PassState","./Renderbuffer","./RenderbufferFormat","./Texture"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(t){var i=new a(t);i.blendingEnabled=!1,i.scissorTest={enabled:!0,rectangle:new e},i.viewport=new e,this._context=t,this._fb=void 0,this._passState=i,this._width=0,this._height=0}c.prototype.begin=function(t){var i=this._context,n=i.drawingBufferWidth,a=i.drawingBufferHeight;return e.clone(t,this._passState.scissorTest.rectangle),r(this._fb)&&this._width===n&&this._height===a||(this._width=n,this._height=a,this._fb=this._fb&&this._fb.destroy(),this._fb=new o({context:i,colorTextures:[new u({context:i,width:n,height:a})],depthStencilRenderbuffer:new s({context:i,format:l.DEPTH_STENCIL})}),this._passState.framebuffer=this._fb),this._passState.viewport.width=n,this._passState.viewport.height=a,this._passState};var h=new t;return c.prototype.end=function(e){for(var n=i(e.width,1),o=i(e.height,1),a=this._context,s=a.readPixels({x:e.x,y:e.y,width:n,height:o,framebuffer:this._fb}),l=Math.max(n,o),u=l*l,c=Math.floor(.5*n),d=Math.floor(.5*o),p=0,m=0,f=0,_=-1,g=0;g<u;++g){if(-c<=p&&p<=c&&-d<=m&&m<=d){var v=4*((d-m)*n+p+c);h.red=t.byteToFloat(s[v]),h.green=t.byteToFloat(s[v+1]),h.blue=t.byteToFloat(s[v+2]),h.alpha=t.byteToFloat(s[v+3]);var y=a.getObjectByPickColor(h);if(r(y))return y}if(p===m||p<0&&-p===m||p>0&&p===1-m){var C=f;f=-_,_=C}p+=f,m+=_}},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){return this._fb=this._fb&&this._fb.destroy(),n(this)},c}),i("Renderer/ShaderCache",["../Core/defined","../Core/defineProperties","../Core/destroyObject","./ShaderProgram","./ShaderSource"],function(e,t,i,r,n){"use strict";function o(e){this._context=e,this._shaders={},this._numberOfShaders=0,this._shadersToRelease={}}return t(o.prototype,{numberOfShaders:{get:function(){return this._numberOfShaders}}}),o.prototype.replaceShaderProgram=function(t){return e(t.shaderProgram)&&t.shaderProgram.destroy(),this.getShaderProgram(t)},o.prototype.getShaderProgram=function(e){var t=e.vertexShaderSource,i=e.fragmentShaderSource,o=e.attributeLocations;"string"==typeof t&&(t=new n({sources:[t]})),"string"==typeof i&&(i=new n({sources:[i]}));var a,s=t.createCombinedVertexShader(),l=i.createCombinedFragmentShader(),u=s+l+JSON.stringify(o);if(this._shaders[u])a=this._shaders[u],delete this._shadersToRelease[u];else{var c=this._context,h=new r({gl:c._gl,logShaderCompilation:c.logShaderCompilation,debugShaders:c.debugShaders,vertexShaderSource:t,vertexShaderText:s,fragmentShaderSource:i,fragmentShaderText:l,attributeLocations:o});a={cache:this,shaderProgram:h,keyword:u,count:0},h._cachedShader=a,this._shaders[u]=a,++this._numberOfShaders}return++a.count,a.shaderProgram},o.prototype.destroyReleasedShaderPrograms=function(){var e=this._shadersToRelease;for(var t in e)if(e.hasOwnProperty(t)){var i=e[t];delete this._shaders[i.keyword],i.shaderProgram.finalDestroy(),--this._numberOfShaders}this._shadersToRelease={}},o.prototype.releaseShaderProgram=function(t){if(e(t)){var i=t._cachedShader;i&&0===--i.count&&(this._shadersToRelease[i.keyword]=i)}},o.prototype.isDestroyed=function(){return!1},o.prototype.destroy=function(){var e=this._shaders;for(var t in e)e.hasOwnProperty(t)&&e[t].shaderProgram.finalDestroy();return i(this)},o}),i("Renderer/UniformState",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/defined","../Core/defineProperties","../Core/EncodedCartesian3","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/Simon1994PlanetaryPositions","../Core/Transforms","../Scene/SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p){"use strict";function m(){this.globeDepthTexture=void 0,this._viewport=new e,this._viewportCartesian4=new r,this._viewportDirty=!1,this._viewportOrthographicMatrix=c.clone(c.IDENTITY),this._viewportTransformation=c.clone(c.IDENTITY),this._model=c.clone(c.IDENTITY),this._view=c.clone(c.IDENTITY),this._inverseView=c.clone(c.IDENTITY),this._projection=c.clone(c.IDENTITY),this._infiniteProjection=c.clone(c.IDENTITY),this._entireFrustum=new t,this._currentFrustum=new t,this._frustumPlanes=new r,this._frameState=void 0,this._temeToPseudoFixed=u.clone(c.IDENTITY),this._view3DDirty=!0,this._view3D=new c,this._inverseView3DDirty=!0,this._inverseView3D=new c,this._inverseModelDirty=!0,this._inverseModel=new c,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new u,this._viewRotation=new u,this._inverseViewRotation=new u,this._viewRotation3D=new u,this._inverseViewRotation3D=new u,this._inverseProjectionDirty=!0,this._inverseProjection=new c,this._inverseProjectionOITDirty=!0,this._inverseProjectionOIT=new c,this._modelViewDirty=!0,this._modelView=new c,this._modelView3DDirty=!0,this._modelView3D=new c,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new c,this._inverseModelViewDirty=!0,this._inverseModelView=new c,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new c,this._viewProjectionDirty=!0,this._viewProjection=new c,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new c,this._modelViewProjectionDirty=!0,this._modelViewProjection=new c,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new c,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new c,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new c,this._normalDirty=!0,this._normal=new u,this._normal3DDirty=!0,this._normal3D=new u,this._inverseNormalDirty=!0,this._inverseNormal=new u,this._inverseNormal3DDirty=!0,this._inverseNormal3D=new u,this._encodedCameraPositionMCDirty=!0,this._encodedCameraPositionMC=new s,this._cameraPosition=new i,this._sunPositionWC=new i,this._sunPositionColumbusView=new i,this._sunDirectionWC=new i,this._sunDirectionEC=new i,this._moonDirectionEC=new i,this._pass=void 0,this._mode=void 0,this._mapProjection=void 0,this._cameraDirection=new i,this._cameraRight=new i,this._cameraUp=new i,this._frustum2DWidth=0,this._eyeHeight2D=new t,this._resolutionScale=1,this._fogDensity=void 0,this._imagerySplitPosition=0,this._pixelSizePerMeter=void 0,this._geometricToleranceOverMeter=void 0}function f(e,t){c.clone(t,e._view),c.getRotation(t,e._viewRotation),e._view3DDirty=!0,e._inverseView3DDirty=!0,e._modelViewDirty=!0,e._modelView3DDirty=!0,e._modelViewRelativeToEyeDirty=!0,e._inverseModelViewDirty=!0,e._inverseModelView3DDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0,e._modelViewInfiniteProjectionDirty=!0,e._normalDirty=!0,e._inverseNormalDirty=!0,e._normal3DDirty=!0,e._inverseNormal3DDirty=!0}function _(e,t){c.clone(t,e._inverseView),c.getRotation(t,e._inverseViewRotation)}function g(e,t){c.clone(t,e._projection),e._inverseProjectionDirty=!0,e._inverseProjectionOITDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function v(e,t){c.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}function y(e,t){i.clone(t.positionWC,e._cameraPosition),i.clone(t.directionWC,e._cameraDirection),i.clone(t.rightWC,e._cameraRight),i.clone(t.upWC,e._cameraUp),e._encodedCameraPositionMCDirty=!0}function C(e,t){o(d.computeIcrfToFixedMatrix(t.time,W))||(W=d.computeTemeToPseudoFixedMatrix(t.time,W));var r=h.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);u.multiplyByVector(W,r,r),i.normalize(r,e._sunDirectionWC),r=u.multiplyByVector(e.viewRotation3D,r,e._sunDirectionEC),i.normalize(r,r),r=h.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),u.multiplyByVector(W,r,r),u.multiplyByVector(e.viewRotation3D,r,r),i.normalize(r,r);var n=t.mapProjection,a=n.ellipsoid,s=a.cartesianToCartographic(e._sunPositionWC,H);n.project(s,e._sunPositionColumbusView)}function w(e){if(e._viewportDirty){var t=e._viewport;c.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),c.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}function S(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,c.inverse(e._projection,e._inverseProjection))}function E(e){e._inverseProjectionOITDirty&&(e._inverseProjectionOITDirty=!1,e._mode!==p.SCENE2D&&e._mode!==p.MORPHING?c.inverse(e._projection,e._inverseProjectionOIT):c.clone(c.IDENTITY,e._inverseProjectionOIT))}function b(e){e._modelViewDirty&&(e._modelViewDirty=!1,c.multiplyTransformation(e._view,e._model,e._modelView))}function T(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,c.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function x(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,c.inverse(e.modelView,e._inverseModelView))}function A(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,c.inverse(e.modelView3D,e._inverseModelView3D))}function P(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,c.multiply(e._projection,e._view,e._viewProjection))}function D(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,c.inverse(e.viewProjection,e._inverseViewProjection))}function M(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,c.multiply(e._projection,e.modelView,e._modelViewProjection))}function I(e){if(e._modelViewRelativeToEyeDirty){e._modelViewRelativeToEyeDirty=!1;var t=e.modelView,i=e._modelViewRelativeToEye;i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5],i[6]=t[6],i[7]=t[7],i[8]=t[8],i[9]=t[9],i[10]=t[10],i[11]=t[11],i[12]=0,i[13]=0,i[14]=0,i[15]=t[15]}}function R(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,c.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function O(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,c.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function N(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,c.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function L(e){if(e._normalDirty){e._normalDirty=!1;var t=e._normal;c.getRotation(e.inverseModelView,t),u.transpose(t,t)}}function B(e){if(e._normal3DDirty){e._normal3DDirty=!1;var t=e._normal3D;c.getRotation(e.inverseModelView3D,t),u.transpose(t,t)}}function F(e){e._inverseNormalDirty&&(e._inverseNormalDirty=!1,c.getRotation(e.inverseModelView,e._inverseNormal))}function V(e){e._inverseNormal3DDirty&&(e._inverseNormal3DDirty=!1,c.getRotation(e.inverseModelView3D,e._inverseNormal3D))}function k(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,c.multiplyByPoint(e.inverseModel,e._cameraPosition,q),s.fromCartesian(q,e._encodedCameraPositionMC))}function z(e,t,r,n,a,s,u,h){var m=j;m.x=e.y,m.y=e.z,m.z=e.x;var f=Y;f.x=r.y,f.y=r.z,f.z=r.x;var _=X;_.x=n.y,_.y=n.z,_.z=n.x;var g=Z;g.x=t.y,g.y=t.z,g.z=t.x,s===p.SCENE2D&&(m.z=.5*a);var v=u.unproject(m,K);v.longitude=l.clamp(v.longitude,-Math.PI,Math.PI),v.latitude=l.clamp(v.latitude,-l.PI_OVER_TWO,l.PI_OVER_TWO);var y=u.ellipsoid,C=y.cartographicToCartesian(v,Q),w=d.eastNorthUpToFixedFrame(C,y,J);return c.multiplyByPointAsVector(w,f,f),c.multiplyByPointAsVector(w,_,_),c.multiplyByPointAsVector(w,g,g),o(h)||(h=new c),h[0]=f.x,h[1]=_.x,h[2]=-g.x,h[3]=0,h[4]=f.y,h[5]=_.y,h[6]=-g.y,h[7]=0,h[8]=f.z,h[9]=_.z,h[10]=-g.z,h[11]=0,h[12]=-i.dot(f,C),h[13]=-i.dot(_,C),h[14]=i.dot(g,C),h[15]=1,h}function U(e){e._view3DDirty&&(e._mode===p.SCENE3D?c.clone(e._view,e._view3D):z(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),c.getRotation(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function G(e){e._inverseView3DDirty&&(c.inverseTransformation(e.view3D,e._inverseView3D),c.getRotation(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}a(m.prototype,{frameState:{get:function(){return this._frameState}},viewport:{get:function(){return this._viewport},set:function(t){if(!e.equals(t,this._viewport)){e.clone(t,this._viewport);var i=this._viewport,r=this._viewportCartesian4;r.x=i.x,r.y=i.y,r.z=i.width,r.w=i.height,this._viewportDirty=!0}}},viewportCartesian4:{get:function(){return this._viewportCartesian4}},viewportOrthographic:{get:function(){return w(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return w(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){c.clone(e,this._model),this._modelView3DDirty=!0,this._inverseModelView3DDirty=!0,this._inverseModelDirty=!0,this._inverseTransposeModelDirty=!0,this._modelViewDirty=!0,this._inverseModelViewDirty=!0,this._modelViewRelativeToEyeDirty=!0,this._inverseModelViewDirty=!0,this._modelViewProjectionDirty=!0,this._inverseModelViewProjectionDirty=!0,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewInfiniteProjectionDirty=!0,this._normalDirty=!0,this._inverseNormalDirty=!0,this._normal3DDirty=!0,this._inverseNormal3DDirty=!0,this._encodedCameraPositionMCDirty=!0}},inverseModel:{get:function(){return this._inverseModelDirty&&(this._inverseModelDirty=!1,c.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTransposeModel:{get:function(){var e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,c.getRotation(this.inverseModel,e),u.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return U(this),this._view3D}},viewRotation:{get:function(){return U(this),this._viewRotation}},viewRotation3D:{get:function(){return U(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return G(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return G(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return S(this),this._inverseProjection}},inverseProjectionOIT:{get:function(){return E(this),this._inverseProjectionOIT}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return b(this),this._modelView}},modelView3D:{get:function(){return T(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return I(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return x(this),this._inverseModelView}},inverseModelView3D:{get:function(){return A(this),this._inverseModelView3D}},viewProjection:{get:function(){return P(this),this._viewProjection}},inverseViewProjection:{get:function(){return D(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return M(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return R(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return O(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return N(this),this._modelViewInfiniteProjection}},normal:{get:function(){return L(this),this._normal}},normal3D:{get:function(){return B(this),this._normal3D}},inverseNormal:{get:function(){return F(this),this._inverseNormal}},inverseNormal3D:{get:function(){return V(this),this._inverseNormal3D}},entireFrustum:{get:function(){return this._entireFrustum}},currentFrustum:{get:function(){return this._currentFrustum}},frustumPlanes:{get:function(){return this._frustumPlanes}},eyeHeight2D:{get:function(){return this._eyeHeight2D}},sunPositionWC:{get:function(){return this._sunPositionWC}},sunPositionColumbusView:{get:function(){return this._sunPositionColumbusView}},sunDirectionWC:{get:function(){return this._sunDirectionWC}},sunDirectionEC:{get:function(){return this._sunDirectionEC}},moonDirectionEC:{get:function(){return this._moonDirectionEC}},encodedCameraPositionMCHigh:{get:function(){return k(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return k(this),this._encodedCameraPositionMC.low}},temeToPseudoFixedMatrix:{get:function(){return this._temeToPseudoFixed}},resolutionScale:{get:function(){return this._resolutionScale}},fogDensity:{get:function(){return this._fogDensity}},geometricToleranceOverMeter:{get:function(){return this._geometricToleranceOverMeter}},pass:{get:function(){return this._pass}},imagerySplitPosition:{get:function(){return this._imagerySplitPosition}}});var W=new u,H=new n;m.prototype.updateCamera=function(e){f(this,e.viewMatrix),_(this,e.inverseViewMatrix),y(this,e),this._entireFrustum.x=e.frustum.near,this._entireFrustum.y=e.frustum.far,this.updateFrustum(e.frustum)},m.prototype.updateFrustum=function(e){g(this,e.projectionMatrix),o(e.infiniteProjectionMatrix)&&v(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far,o(e.top)||(e=e._offCenterFrustum),this._frustumPlanes.x=e.top,this._frustumPlanes.y=e.bottom,this._frustumPlanes.z=e.left,this._frustumPlanes.w=e.right},m.prototype.updatePass=function(e){this._pass=e},m.prototype.update=function(e){this._mode=e.mode,this._mapProjection=e.mapProjection;var t=e.context._canvas;this._resolutionScale=t.width/t.clientWidth;var i=e.camera;this.updateCamera(i),e.mode===p.SCENE2D?(this._frustum2DWidth=i.frustum.right-i.frustum.left,this._eyeHeight2D.x=.5*this._frustum2DWidth,this._eyeHeight2D.y=this._eyeHeight2D.x*this._eyeHeight2D.x):(this._frustum2DWidth=0,this._eyeHeight2D.x=0,this._eyeHeight2D.y=0),C(this,e),this._fogDensity=e.fog.density,this._frameState=e,this._temeToPseudoFixed=d.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed),this._imagerySplitPosition=e.imagerySplitPosition;var r,n=i.frustum.fov,o=this._viewport;r=o.height>o.width?2*Math.tan(.5*n)/o.height:2*Math.tan(.5*n)/o.width,this._geometricToleranceOverMeter=r*e.maximumScreenSpaceError};var q=new i,j=new i,Y=new i,X=new i,Z=new i,K=new n,Q=new i,J=new c;return m}),i("Renderer/Context",["../Core/clone","../Core/Color","../Core/ComponentDatatype","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Geometry","../Core/GeometryAttribute","../Core/Matrix4","../Core/PrimitiveType","../Core/RuntimeError","../Core/WebGLConstants","../Shaders/ViewportQuadVS","./BufferUsage","./ClearCommand","./ContextLimits","./CubeMap","./DrawCommand","./PassState","./PickFramebuffer","./RenderState","./ShaderCache","./ShaderProgram","./Texture","./UniformState","./VertexArray"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A,P){"use strict";function D(e,t){var i="WebGL Error: ";switch(t){case e.INVALID_ENUM:i+="INVALID_ENUM";break;case e.INVALID_VALUE:i+="INVALID_VALUE";break;case e.INVALID_OPERATION:i+="INVALID_OPERATION";break;case e.OUT_OF_MEMORY:i+="OUT_OF_MEMORY";break;case e.CONTEXT_LOST_WEBGL:i+="CONTEXT_LOST_WEBGL lost";break;default:i+="Unknown ("+t+")"}return i}function M(e,t,i,r){for(var n=D(e,r)+": "+t.name+"(",o=0;o<i.length;++o)0!==o&&(n+=", "),n+=i[o];return n+=");"}function I(e,t,i){var r=e.getError();if(r!==e.NO_ERROR)throw new p(M(e,t,i,r))}function R(e,t,i){return{get:function(){var r=e[t];return i(e,"get: "+t,r),e[t]},set:function(r){e[t]=r,i(e,"set: "+t,r)}}}function O(e,t){function i(i){return function(){var r=i.apply(e,arguments);return t(e,i,arguments),r}}if(!o(t))return e;var r={};for(var n in e){var a=e[n];a instanceof Function?r[n]=i(a):Object.defineProperty(r,n,R(e,n,t))}return r}function N(e,t){for(var i=t.length,r=0;r<i;++r){var n=e.getExtension(t[r]);if(n)return n}}function L(i,a){if("undefined"==typeof WebGLRenderingContext)throw new p("The browser does not support WebGL. Visit http://get.webgl.org.");this._canvas=i,a=e(a,!0),a=n(a,{}),a.allowTextureFilterAnisotropic=n(a.allowTextureFilterAnisotropic,!0);var s=n(a.webgl,{});s.alpha=n(s.alpha,!1),s.stencil=n(s.stencil,!0);var l,u=!1,c=u&&"undefined"!=typeof WebGL2RenderingContext,h=!1,d=a.getWebGLStub;if(o(d))l=d(i,s);else if(c&&(l=i.getContext("webgl2",s)||i.getContext("experimental-webgl2",s)||void 0,o(l)&&(h=!0)),o(l)||(l=i.getContext("webgl",s)||i.getContext("experimental-webgl",s)||void 0),!o(l))throw new p("The browser supports WebGL, but initialization failed.");this._originalGLContext=l,this._gl=l,this._webgl2=h,this._id=r(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new b(this);var f=l;this._stencilBits=f.getParameter(f.STENCIL_BITS),v._maximumCombinedTextureImageUnits=f.getParameter(f.MAX_COMBINED_TEXTURE_IMAGE_UNITS),v._maximumCubeMapSize=f.getParameter(f.MAX_CUBE_MAP_TEXTURE_SIZE),v._maximumFragmentUniformVectors=f.getParameter(f.MAX_FRAGMENT_UNIFORM_VECTORS),v._maximumTextureImageUnits=f.getParameter(f.MAX_TEXTURE_IMAGE_UNITS),v._maximumRenderbufferSize=f.getParameter(f.MAX_RENDERBUFFER_SIZE),v._maximumTextureSize=f.getParameter(f.MAX_TEXTURE_SIZE),v._maximumVaryingVectors=f.getParameter(f.MAX_VARYING_VECTORS),v._maximumVertexAttributes=f.getParameter(f.MAX_VERTEX_ATTRIBS),v._maximumVertexTextureImageUnits=f.getParameter(f.MAX_VERTEX_TEXTURE_IMAGE_UNITS),v._maximumVertexUniformVectors=f.getParameter(f.MAX_VERTEX_UNIFORM_VECTORS);var _=f.getParameter(f.ALIASED_LINE_WIDTH_RANGE);v._minimumAliasedLineWidth=_[0],v._maximumAliasedLineWidth=_[1];var g=f.getParameter(f.ALIASED_POINT_SIZE_RANGE);v._minimumAliasedPointSize=g[0],v._maximumAliasedPointSize=g[1];var y=f.getParameter(f.MAX_VIEWPORT_DIMS);v._maximumViewportWidth=y[0],v._maximumViewportHeight=y[1];var C=f.getShaderPrecisionFormat(f.FRAGMENT_SHADER,f.HIGH_FLOAT);v._highpFloatSupported=0!==C.precision;var S=f.getShaderPrecisionFormat(f.FRAGMENT_SHADER,f.HIGH_INT);v._highpIntSupported=0!==S.rangeMax,this._antialias=f.getContextAttributes().antialias,this._standardDerivatives=!!N(f,["OES_standard_derivatives"]),this._elementIndexUint=!!N(f,["OES_element_index_uint"]),this._depthTexture=!!N(f,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._textureFloat=!!N(f,["OES_texture_float"]),this._fragDepth=!!N(f,["EXT_frag_depth"]),this._debugShaders=N(f,["WEBGL_debug_shaders"]);var T=a.allowTextureFilterAnisotropic?N(f,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=T,v._maximumTextureFilterAnisotropy=o(T)?f.getParameter(T.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1;var x,P,D,M,I,R,O,L,B,F;if(h){var V=this;x=function(){return V._gl.createVertexArray()},P=function(e){V._gl.bindVertexArray(e)},D=function(e){V._gl.deleteVertexArray(e)},M=function(e,t,i,r,n){f.drawElementsInstanced(e,t,i,r,n)},I=function(e,t,i,r){f.drawArraysInstanced(e,t,i,r)},R=function(e,t){f.vertexAttribDivisor(e,t)},O=function(e){f.drawBuffers(e)}}else L=N(f,["OES_vertex_array_object"]),o(L)&&(x=function(){return L.createVertexArrayOES()},P=function(e){L.bindVertexArrayOES(e)},D=function(e){L.deleteVertexArrayOES(e)}),B=N(f,["ANGLE_instanced_arrays"]),o(B)&&(M=function(e,t,i,r,n){B.drawElementsInstancedANGLE(e,t,i,r,n)},I=function(e,t,i,r){B.drawArraysInstancedANGLE(e,t,i,r)},R=function(e,t){B.vertexAttribDivisorANGLE(e,t)}),F=N(f,["WEBGL_draw_buffers"]),o(F)&&(O=function(e){F.drawBuffersWEBGL(e)});this.glCreateVertexArray=x,this.glBindVertexArray=P,this.glDeleteVertexArray=D,this.glDrawElementsInstanced=M,this.glDrawArraysInstanced=I,this.glVertexAttribDivisor=R,this.glDrawBuffers=O,this._vertexArrayObject=!!L,this._instancedArrays=!!B,this._drawBuffers=!!F,v._maximumDrawBuffers=this.drawBuffers?f.getParameter(m.MAX_DRAW_BUFFERS):1,v._maximumColorAttachments=this.drawBuffers?f.getParameter(m.MAX_COLOR_ATTACHMENTS):1,this._clearColor=new t(0,0,0,0),this._clearDepth=1,this._clearStencil=0;var k=new A,z=new w(this),U=E.fromCache();this._defaultPassState=z,this._defaultRenderState=U,this._defaultTexture=void 0,this._defaultCubeMap=void 0,this._us=k,this._currentRenderState=U,this._currentPassState=z,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._vertexAttribDivisors=[],this._previousDrawInstanced=!1;for(var G=0;G<v._maximumVertexAttributes;G++)this._vertexAttribDivisors.push(0);this._pickObjects={},this._nextPickColor=new Uint32Array(1),this.options=a,this.cache={},E.apply(f,U,z)}function B(e){}function F(e,t,i,r){var n=e._currentRenderState,o=e._currentPassState;e._currentRenderState=t,e._currentPassState=i,E.partialApply(e._gl,n,t,o,i,r)}function V(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;var i=W;if(o(t))t._bind(),B(e),i=t._getActiveColorAttachments();else{var r=e._gl;r.bindFramebuffer(r.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(i)}}function k(e,t,i,r){var o=n(i._renderState,e._defaultRenderState);V(e,t),F(e,o,r,!1);var a=i._shaderProgram;a._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,a.maximumTextureUnitIndex)}function z(e,t){var i=t._primitiveType,r=t._vertexArray,a=t._offset,s=t._count,l=t.instanceCount;e._us.model=n(t._modelMatrix,h.IDENTITY),t._shaderProgram._setUniforms(t._uniformMap,e._us,e.validateShaderProgram),r._bind();var u=r.indexBuffer;o(u)?(a*=u.bytesPerIndex,s=n(s,u.numberOfIndices),0===l?e._gl.drawElements(i,s,u.indexDatatype,a):e.glDrawElementsInstanced(i,s,u.indexDatatype,a,l)):(s=n(s,r.numberOfVertices),0===l?e._gl.drawArrays(i,a,s):e.glDrawArraysInstanced(i,a,s,l)),r._unBind()}function U(e,t,i){this._pickObjects=e,this.key=t,this.color=i}var G={};a(L.prototype,{id:{get:function(){return this._id}},webgl2:{get:function(){return this._webgl2}},canvas:{get:function(){return this._canvas}},shaderCache:{get:function(){return this._shaderCache}},uniformState:{get:function(){return this._us}},stencilBits:{get:function(){return this._stencilBits}},stencilBuffer:{get:function(){return this._stencilBits>=8}},antialias:{get:function(){return this._antialias}},standardDerivatives:{get:function(){return this._standardDerivatives}},elementIndexUint:{get:function(){return this._elementIndexUint||this._webgl2}},depthTexture:{get:function(){return this._depthTexture}},floatingPointTexture:{get:function(){return this._textureFloat}},textureFilterAnisotropic:{get:function(){return!!this._textureFilterAnisotropic}},vertexArrayObject:{get:function(){return this._vertexArrayObject||this._webgl2}},fragmentDepth:{get:function(){return this._fragDepth}},instancedArrays:{get:function(){return this._instancedArrays||this._webgl2}},drawBuffers:{get:function(){return this._drawBuffers||this._webgl2}},debugShaders:{get:function(){return this._debugShaders}},throwOnWebGLError:{get:function(){return this._throwOnWebGLError},set:function(e){this._throwOnWebGLError=e,this._gl=O(this._originalGLContext,e?I:void 0)}},defaultTexture:{get:function(){return void 0===this._defaultTexture&&(this._defaultTexture=new x({context:this,source:{width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])}})),this._defaultTexture}},defaultCubeMap:{get:function(){if(void 0===this._defaultCubeMap){var e={width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])};this._defaultCubeMap=new y({context:this,source:{positiveX:e,negativeX:e,positiveY:e,negativeY:e,positiveZ:e,negativeZ:e}})}return this._defaultCubeMap}},drawingBufferHeight:{get:function(){return this._gl.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._gl.drawingBufferWidth}},defaultFramebuffer:{get:function(){return G}}});var W;"undefined"!=typeof WebGLRenderingContext&&(W=[m.BACK]);var H=new g;L.prototype.clear=function(e,i){e=n(e,H),i=n(i,this._defaultPassState);var r=this._gl,a=0,s=e.color,l=e.depth,u=e.stencil;o(s)&&(t.equals(this._clearColor,s)||(t.clone(s,this._clearColor),r.clearColor(s.red,s.green,s.blue,s.alpha)),a|=r.COLOR_BUFFER_BIT),o(l)&&(l!==this._clearDepth&&(this._clearDepth=l,r.clearDepth(l)),a|=r.DEPTH_BUFFER_BIT),o(u)&&(u!==this._clearStencil&&(this._clearStencil=u,r.clearStencil(u)),a|=r.STENCIL_BUFFER_BIT);var c=n(e.renderState,this._defaultRenderState);F(this,c,i,!0);var h=n(e.framebuffer,i.framebuffer);V(this,h),r.clear(a)},L.prototype.draw=function(e,t){t=n(t,this._defaultPassState);var i=n(e._framebuffer,t.framebuffer);k(this,i,e,t),z(this,e)},L.prototype.endFrame=function(){var e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);var t=W;this.drawBuffers&&this.glDrawBuffers(t);var i=this._maxFrameTextureUnitIndex;this._maxFrameTextureUnitIndex=0;for(var r=0;r<i;++r)e.activeTexture(e.TEXTURE0+r),e.bindTexture(e.TEXTURE_2D,null),e.bindTexture(e.TEXTURE_CUBE_MAP,null)},L.prototype.readPixels=function(e){var t=this._gl;e=e||{};var i=Math.max(e.x||0,0),r=Math.max(e.y||0,0),n=e.width||t.drawingBufferWidth,o=e.height||t.drawingBufferHeight,a=e.framebuffer,s=new Uint8Array(4*n*o);return V(this,a),t.readPixels(i,r,n,o,t.RGBA,t.UNSIGNED_BYTE,s),s};var q={position:0,textureCoordinates:1};return L.prototype.getViewportQuadVertexArray=function(){var e=this.cache.viewportQuad_vertexArray;if(!o(e)){var t=new u({attributes:{position:new c({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new c({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:d.TRIANGLES});e=P.fromGeometry({context:this,geometry:t,attributeLocations:q,bufferUsage:_.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e},L.prototype.createViewportQuadCommand=function(e,t){return t=n(t,n.EMPTY_OBJECT), +new C({vertexArray:this.getViewportQuadVertexArray(),primitiveType:d.TRIANGLES,renderState:t.renderState,shaderProgram:T.fromCache({context:this,vertexShaderSource:f,fragmentShaderSource:e,attributeLocations:q}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer})},L.prototype.createPickFramebuffer=function(){return new S(this)},L.prototype.getObjectByPickColor=function(e){return this._pickObjects[e.toRgba()]},a(U.prototype,{object:{get:function(){return this._pickObjects[this.key]},set:function(e){this._pickObjects[this.key]=e}}}),U.prototype.destroy=function(){delete this._pickObjects[this.key]},L.prototype.createPickId=function(e){++this._nextPickColor[0];var i=this._nextPickColor[0];if(0===i)throw new p("Out of unique Pick IDs.");return this._pickObjects[i]=e,new U(this._pickObjects,i,t.fromRgba(i))},L.prototype.isDestroyed=function(){return!1},L.prototype.destroy=function(){var e=this.cache;for(var t in e)if(e.hasOwnProperty(t)){var i=e[t];o(i.destroy)&&i.destroy()}return this._shaderCache=this._shaderCache.destroy(),this._defaultTexture=this._defaultTexture&&this._defaultTexture.destroy(),this._defaultCubeMap=this._defaultCubeMap&&this._defaultCubeMap.destroy(),s(this)},L}),i("Renderer/loadCubeMap",["../Core/defined","../Core/DeveloperError","../Core/loadImage","../ThirdParty/when","./CubeMap"],function(e,t,i,r,n){"use strict";function o(e,t,o){var a=[i(t.positiveX,o),i(t.negativeX,o),i(t.positiveY,o),i(t.negativeY,o),i(t.positiveZ,o),i(t.negativeZ,o)];return r.all(a,function(t){return new n({context:e,source:{positiveX:t[0],negativeX:t[1],positiveY:t[2],negativeY:t[3],positiveZ:t[4],negativeZ:t[5]}})})}return o}),i("Scene/DiscardMissingTileImagePolicy",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/getImagePixels","../Core/loadImageViaBlob","../ThirdParty/when"],function(e,t,i,r,n,o){"use strict";function a(i){function a(e){t(e.blob)&&(l._missingImageByteLength=e.blob.size);var n=r(e);if(i.disableCheckIfAllPixelsAreTransparent){for(var o=!0,a=e.width,s=i.pixelsToCheck,u=0,c=s.length;o&&u<c;++u){var h=s[u],d=4*h.x+h.y*a,p=n[d+3];p>0&&(o=!1)}o&&(n=void 0)}l._missingImagePixels=n,l._isReady=!0}function s(){l._missingImagePixels=void 0,l._isReady=!0}i=e(i,e.EMPTY_OBJECT),this._pixelsToCheck=i.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;var l=this;o(n(i.missingImageUrl),a,s)}return a.prototype.isReady=function(){return this._isReady},a.prototype.shouldDiscardImage=function(e){var i=this._pixelsToCheck,n=this._missingImagePixels;if(!t(n))return!1;if(t(e.blob)&&e.blob.size!==this._missingImageByteLength)return!1;for(var o=r(e),a=e.width,s=0,l=i.length;s<l;++s)for(var u=i[s],c=4*u.x+u.y*a,h=0;h<4;++h){var d=c+h;if(o[d]!==n[d])return!1}return!0},a}),i("Scene/ImageryLayerFeatureInfo",["../Core/defined"],function(e){"use strict";function t(){this.name=void 0,this.description=void 0,this.position=void 0,this.data=void 0,this.imageryLayer=void 0}return t.prototype.configureNameFromProperties=function(t){var i,r=10;for(var n in t)if(t.hasOwnProperty(n)&&t[n]){var o=n.toLowerCase();r>1&&"name"===o?(r=1,i=n):r>2&&"title"===o?(r=2,i=n):r>3&&/name/i.test(n)?(r=3,i=n):r>4&&/title/i.test(n)&&(r=4,i=n)}e(i)&&(this.name=t[i])},t.prototype.configureDescriptionFromProperties=function(t){function i(t){var r='<table class="cesium-infoBox-defaultTable">';for(var n in t)if(t.hasOwnProperty(n)){var o=t[n];e(o)&&(r+="object"==typeof o?"<tr><td>"+n+"</td><td>"+i(o)+"</td></tr>":"<tr><td>"+n+"</td><td>"+o+"</td></tr>")}return r+="</table>"}this.description=i(t)},t}),i("Scene/ImageryProvider",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/loadImage","../Core/loadImageViaBlob","../Core/throttleRequestByServer"],function(e,t,i,r,n,o){"use strict";function a(){this.defaultAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=void 0,i.throwInstantiationError()}return t(a.prototype,{ready:{get:i.throwInstantiationError},readyPromise:{get:i.throwInstantiationError},rectangle:{get:i.throwInstantiationError},tileWidth:{get:i.throwInstantiationError},tileHeight:{get:i.throwInstantiationError},maximumLevel:{get:i.throwInstantiationError},minimumLevel:{get:i.throwInstantiationError},tilingScheme:{get:i.throwInstantiationError},tileDiscardPolicy:{get:i.throwInstantiationError},errorEvent:{get:i.throwInstantiationError},credit:{get:i.throwInstantiationError},proxy:{get:i.throwInstantiationError},hasAlphaChannel:{get:i.throwInstantiationError}}),a.prototype.getTileCredits=i.throwInstantiationError,a.prototype.requestImage=i.throwInstantiationError,a.prototype.pickFeatures=i.throwInstantiationError,a.loadImage=function(t,i){return e(t.tileDiscardPolicy)?o(i,n):o(i,r)},a}),i("Scene/ArcGisMapServerImageryProvider",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/GeographicTilingScheme","../Core/loadJson","../Core/loadJsonp","../Core/Math","../Core/Rectangle","../Core/RuntimeError","../Core/TileProviderError","../Core/WebMercatorProjection","../Core/WebMercatorTilingScheme","../ThirdParty/when","./DiscardMissingTileImagePolicy","./ImageryLayerFeatureInfo","./ImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w){"use strict";function S(i){function a(n){var a=n.tileInfo;if(o(a)){if(C._tileWidth=a.rows,C._tileHeight=a.cols,102100===a.spatialReference.wkid||102113===a.spatialReference.wkid)C._tilingScheme=new g({ellipsoid:i.ellipsoid});else{if(4326!==n.tileInfo.spatialReference.wkid){var s="Tile spatial reference WKID "+n.tileInfo.spatialReference.wkid+" is not supported.";return void(d=f.handleError(d,C,C._errorEvent,s,void 0,void 0,void 0,c))}C._tilingScheme=new u({ellipsoid:i.ellipsoid})}if(C._maximumLevel=n.tileInfo.lods.length-1,o(n.fullExtent)){if(o(n.fullExtent.spatialReference)&&o(n.fullExtent.spatialReference.wkid))if(102100===n.fullExtent.spatialReference.wkid||102113===n.fullExtent.spatialReference.wkid){var l=new _,h=n.fullExtent,m=l.unproject(new t(Math.max(h.xmin,-C._tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.max(h.ymin,-C._tilingScheme.ellipsoid.maximumRadius*Math.PI),0)),v=l.unproject(new t(Math.min(h.xmax,C._tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.min(h.ymax,C._tilingScheme.ellipsoid.maximumRadius*Math.PI),0));C._rectangle=new p(m.longitude,m.latitude,v.longitude,v.latitude)}else{if(4326!==n.fullExtent.spatialReference.wkid){var w="fullExtent.spatialReference WKID "+n.fullExtent.spatialReference.wkid+" is not supported.";return void(d=f.handleError(d,C,C._errorEvent,w,void 0,void 0,void 0,c))}C._rectangle=p.fromDegrees(n.fullExtent.xmin,n.fullExtent.ymin,n.fullExtent.xmax,n.fullExtent.ymax)}}else C._rectangle=C._tilingScheme.rectangle;o(C._tileDiscardPolicy)||(C._tileDiscardPolicy=new y({missingImageUrl:E(C,0,0,C._maximumLevel),pixelsToCheck:[new e(0,0),new e(200,20),new e(20,200),new e(80,110),new e(160,130)],disableCheckIfAllPixelsAreTransparent:!0})),C._useTiles=!0}else C._useTiles=!1;o(n.copyrightText)&&n.copyrightText.length>0&&(C._credit=new r(n.copyrightText)),C._ready=!0,C._readyPromise.resolve(!0),f.handleSuccess(d)}function s(e){var t="An error occurred while accessing "+C._url+".";d=f.handleError(d,C,C._errorEvent,t,void 0,void 0,void 0,c),C._readyPromise.reject(new m(t))}function c(){var e={f:"json"};o(C._token)&&(e.token=C._token);var t=h(C._url,{parameters:e,proxy:C._proxy});v(t,a,s)}i=n(i,{}),this._url=i.url,this._token=i.token,this._tileDiscardPolicy=i.tileDiscardPolicy,this._proxy=i.proxy,this._tileWidth=n(i.tileWidth,256),this._tileHeight=n(i.tileHeight,256),this._maximumLevel=i.maximumLevel,this._tilingScheme=n(i.tilingScheme,new u({ellipsoid:i.ellipsoid})),this._credit=void 0,this._useTiles=n(i.usePreCachedTilesIfAvailable,!0),this._rectangle=n(i.rectangle,this._tilingScheme.rectangle),this._layers=i.layers,this.enablePickFeatures=n(i.enablePickFeatures,!0),this._errorEvent=new l,this._ready=!1,this._readyPromise=v.defer();var d,C=this;this._useTiles?c():(this._ready=!0,this._readyPromise.resolve(!0))}function E(e,t,i,r){var n;if(e._useTiles)n=e._url+"/tile/"+r+"/"+i+"/"+t;else{var a=e._tilingScheme.tileXYToNativeRectangle(t,i,r),s=a.west+"%2C"+a.south+"%2C"+a.east+"%2C"+a.north;n=e._url+"/export?",n+="bbox="+s,n+=e._tilingScheme instanceof u?"&bboxSR=4326&imageSR=4326":"&bboxSR=3857&imageSR=3857",n+="&size="+e._tileWidth+"%2C"+e._tileHeight,n+="&format=png&transparent=true&f=image",e.layers&&(n+="&layers=show:"+e.layers)}var l=e._token;o(l)&&(n.indexOf("?")===-1&&(n+="?"),"?"!==n[n.length-1]&&(n+="&"),n+="token="+l);var c=e._proxy;return o(c)&&(n=c.getURL(n)),n}return a(S.prototype,{url:{get:function(){return this._url}},token:{get:function(){return this._token}},proxy:{get:function(){return this._proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},usingPrecachedTiles:{get:function(){return this._useTiles}},hasAlphaChannel:{get:function(){return!0}},layers:{get:function(){return this._layers}}}),S.prototype.getTileCredits=function(e,t,i){},S.prototype.requestImage=function(e,t,i){var r=E(this,e,t,i);return w.loadImage(this,r)},S.prototype.pickFeatures=function(e,r,n,a,s){if(this.enablePickFeatures){var l,h,p,m=this._tilingScheme.tileXYToNativeRectangle(e,r,n);if(this._tilingScheme instanceof u)l=d.toDegrees(a),h=d.toDegrees(s),p="4326";else{var f=this._tilingScheme.projection.project(new i(a,s,0));l=f.x,h=f.y,p="3857"}var g=this._url+"/identify?f=json&tolerance=2&geometryType=esriGeometryPoint";return g+="&geometry="+l+","+h,g+="&mapExtent="+m.west+","+m.south+","+m.east+","+m.north,g+="&imageDisplay="+this._tileWidth+","+this._tileHeight+",96",g+="&sr="+p,g+="&layers=visible",o(this._layers)&&(g+=":"+this._layers),o(this._token)&&(g+="&token="+this._token),o(this._proxy)&&(g=this._proxy.getURL(g)),c(g).then(function(e){var r=[],n=e.results;if(!o(n))return r;for(var a=0;a<n.length;++a){var s=n[a],l=new C;if(l.data=s,l.name=s.value,l.properties=s.attributes,l.configureDescriptionFromProperties(s.attributes),"esriGeometryPoint"===s.geometryType&&s.geometry){var u=s.geometry.spatialReference&&s.geometry.spatialReference.wkid?s.geometry.spatialReference.wkid:4326;if(4326===u||4283===u)l.position=i.fromDegrees(s.geometry.x,s.geometry.y,s.geometry.z);else if(102100===u||900913===u||3857===u){var c=new _;l.position=c.unproject(new t(s.geometry.x,s.geometry.y,s.geometry.z))}}r.push(l)}return r})}},S}),i("Scene/BingMapsStyle",["../Core/freezeObject"],function(e){"use strict";var t={AERIAL:"Aerial",AERIAL_WITH_LABELS:"AerialWithLabels",ROAD:"Road",ORDNANCE_SURVEY:"OrdnanceSurvey",COLLINS_BART:"CollinsBart"};return e(t)}),i("Scene/BingMapsImageryProvider",["../Core/BingMapsApi","../Core/Cartesian2","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/loadJsonp","../Core/Math","../Core/Rectangle","../Core/RuntimeError","../Core/TileProviderError","../Core/WebMercatorTilingScheme","../ThirdParty/when","./BingMapsStyle","./DiscardMissingTileImagePolicy","./ImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g){"use strict";function v(o){function a(e){var r=e.resourceSets[0].resources[0];E._tileWidth=r.imageWidth,E._tileHeight=r.imageHeight,E._maximumLevel=r.zoomMax-1,E._imageUrlSubdomains=r.imageUrlSubdomains,E._imageUrlTemplate=r.imageUrl.replace("{culture}",E._culture);var o=E._tileProtocol;if(!n(o)){var a=document.location.protocol;o=/^http/.test(a)?a:"http:"}E._imageUrlTemplate=E._imageUrlTemplate.replace(/^http:/,o),n(E._tileDiscardPolicy)||(E._tileDiscardPolicy=new _({missingImageUrl:y(E,0,0,E._maximumLevel),pixelsToCheck:[new t(0,0),new t(120,140),new t(130,160),new t(200,50),new t(200,200)],disableCheckIfAllPixelsAreTransparent:!0}));var s=E._attributionList=r.imageryProviders;s||(s=E._attributionList=[]);for(var l=0,h=s.length;l<h;++l){var p=s[l];p.credit=new i(p.attribution);for(var m=p.coverageAreas,f=0,g=p.coverageAreas.length;f<g;++f){var v=m[f],C=v.bbox;v.bbox=new c(u.toRadians(C[1]),u.toRadians(C[0]),u.toRadians(C[3]),u.toRadians(C[2]))}}E._ready=!0,E._readyPromise.resolve(!0),d.handleSuccess(w)}function g(e){var t="An error occurred while accessing "+S+".";w=d.handleError(w,E,E._errorEvent,t,void 0,void 0,void 0,C),E._readyPromise.reject(new h(t))}function C(){var e=l(S,{callbackParameterName:"jsonp",proxy:E._proxy});m(e,a,g)}o=r(o,{}),this._key=e.getKey(o.key),this._keyErrorCredit=e.getErrorCredit(o.key),this._url=o.url,this._tileProtocol=o.tileProtocol,this._mapStyle=r(o.mapStyle,f.AERIAL),this._culture=r(o.culture,""),this._tileDiscardPolicy=o.tileDiscardPolicy,this._proxy=o.proxy,this._credit=new i("Bing Imagery",v._logoData,"http://www.bing.com"),this.defaultGamma=1,this._tilingScheme=new p({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:o.ellipsoid}),this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._imageUrlTemplate=void 0,this._imageUrlSubdomains=void 0,this._errorEvent=new s,this._ready=!1,this._readyPromise=m.defer();var w,S=this._url+"/REST/v1/Imagery/Metadata/"+this._mapStyle+"?incl=ImageryProviders&key="+this._key,E=this;C()}function y(e,t,i,r){var o=e._imageUrlTemplate,a=v.tileXYToQuadKey(t,i,r);o=o.replace("{quadkey}",a);var s=e._imageUrlSubdomains,l=(t+i+r)%s.length;o=o.replace("{subdomain}",s[l]);var u=e._proxy;return n(u)&&(o=u.getURL(o)),o}function C(e,t,i){++t;for(var r=[],o=0,a=e.length;o<a;++o){for(var s=e[o],l=s.coverageAreas,u=!1,h=0,d=s.coverageAreas.length;!u&&h<d;++h){var p=l[h];if(t>=p.zoomMin&&t<=p.zoomMax){var m=c.intersection(i,p.bbox,S);n(m)&&(u=!0)}}u&&r.push(s.credit)}return r}o(v.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._proxy}},key:{get:function(){return this._key}},mapStyle:{get:function(){return this._mapStyle}},culture:{get:function(){return this._culture}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!1}}});var w=new c;v.prototype.getTileCredits=function(e,t,i){var r=this._tilingScheme.tileXYToRectangle(e,t,i,w),o=C(this._attributionList,i,r);return n(this._keyErrorCredit)&&o.push(this._keyErrorCredit),o},v.prototype.requestImage=function(e,t,i){var r=y(this,e,t,i);return g.loadImage(this,r)},v.prototype.pickFeatures=function(e,t,i,r,n){},v._logoData="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD0AAAAaCAYAAAAEy1RnAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAB3RJTUUH3gIDEgcPTMnXOQAAClZJREFUWMPdWGtsFNcV/u689uH1+sXaONhlWQzBENtxiUFBpBSLd60IpXHSNig4URtSYQUkRJNSi0igViVVVBJBaBsiAgKRQJSG8AgEHCCWU4iBCprY2MSgXfOI16y9D3s9Mzsztz9yB12WNU2i9Ecy0tHOzN4793zn3POdcy7BnRfJ8I7iB3SRDPeEExswLz8Y0DZIAYDIRGAgLQAm+7Xle31J3L3Anp1MZPY+BUBjorN332vgYhpgV1FRUd6TTz45ubq6OtDV1SXpuu5g//Oept9wNwlMyAi8IXDjyF245TsDTdivDMATCATGNDU1/WbhwoWPTZs2bWx1dXWhx+Oxrl+/PqTrus5t9W8KWEzjinTAYhro/xuBStwiIgBnJBLxKIoy1u/3V/r9/krDMMz3339/Z3t7e38ikUgCMDLEt8W+Q0cAI3McYTDDmZxh7DESG5Ni43jg9Gsa+X+OsxWxPSJTSj3JZFK5ZRVJErOzs8e6XC4fgGwALhbzDgAKU1hK28KEA6PMmTMn56233qpevnz5PQDcbJ7EzVUAuMrLy3MBeABkcWOEDELSyFe4y7iMoHkriZZlKYZh8ASHZDKpJJPJHAC5APIA5APIAeBlCjo5TwlpXnbOmTPHP3fu3KZVq1atZKBcDJQ9x7V48WJfc3Pzhp6enj+tXLnyR8w4MjdG4gyVDk7KICMClzKlLUrpbQMNw5AkScppbGz8cWdn57WjR4/2caw+DEBlYjO8wX1foZQWuN3uKZIklQD4G+fhlG0Yl8uVm5WVVW6app6dne0D0G8vnxbjJntHubCUOK/badZICyWanrJuAaeUknTQpmlKkUhEWbx48U8LCwtHhUKha+fPn+85fPhwV0tLyzUACSZx9jvMFhIByNFoVDEMw/qKB5HPvJfkUqBr9+7deklJyZ/j8bi5ffv2OAslieMLsG+m2DybT2QuzEQOsF5SUqJfvXo1yc2l6Xn6rgSRSCSEc+fOhVeuXLmwoqJixvTp0wcWLFgQ7unpudHR0dF97ty5z/fu3XseQJh5adjeerquy5ZlCalUivh8Pt8HH3ywzOPxyD09PZ81NjZ+2NnZaQEQx40b54vFYqaqquEVK1b4a2tr/WvWrDn18ssv144fP36SqqoD69ev371nz57rDLwAwHHkyJGfjRs3rtowDOv06dOnu7q6rs6bN2/s7Nmz9zIjDKenWoFZKg/AlMLCwl82Nzf/m3LX22+/fXb06NF/ALC8u7u7m6ZdkUhksL29/UpLS0vzunXrVgAoBzAaQBGAiY2NjUui0ei1RCLRFwwG/9PX19cVi8WCqqoOdHd3HysrK6sDMCccDl8IBoOtiqIsOnbs2D+i0eiV3t7ez8Ph8GeRSKRT07TB/v7+i1OnTp0HYBqABzs7O/+paVo0Fot1RyKRi/F4/Gp/f39XIpHoZnoUMn6wU+ZtRDaymwmxZFk2AWjvvvvuJ/F4PMn/n5+fn1VeXu6fOXNmbU1NzUOM4Bz8QqIoyg6HwxuLxfq3bdu2a+vWrW/09/dfKy0tffDVV199BEC20+n0ud3uQgBup9Pp83g8JYqieE+ePPnxxo0bt33xxRen8/Ly7n3hhRcWASh47bXX5pWVldWFw+GuXbt27XjzzTd3BoPBDq/XG1AUZRRHmAKPVfqaoKkgCCkA+oYNG84Eg0FHTU1N5ezZs8eWlJQ4CSF8/LvZYhJPQoQQpFKpwcrKyo1su9HBwUF99erVv588eXINgOOmacIwDEopdaZSKUIpxYkTJz6sr68/BMBav379RcMwZk2aNOl+AP+qq6t7xDTNVEVFxR+j0WgSAJk4ceKlTz/9tNzpdHpZvIvpjVW6pykhhBJCbkvwgiAQQogEQL558ybdtGlTsLm5OWJZdxZmlmWll5OUEEJN0zSGhob6GcOrALSzZ8/2apqWcLlc2axGACNRkRAimqaph0Kh68xIwwB0y7IMSZKcABz5+fkl8Xj8y2g0apOb5na7rYGBgS/JV54Q0qpAAoBKaS0jBWClg1ZVFeFw2AlgVF1dXeDpp5+eWVFRUVpcXOzgvQwAbrcbDJhdudlGpKZpGtx6JCcnRxIEQbQsS2PjbjM+AMvlchnMSBaXkr7ymCCIhmEYfMoVRVESBEHI0CaTTNubssUsQRBuubCtra33pZdeCk6YMCGwZs2aipqaGn9paWmuJEl3JP0bN258eeTIkRMABrm0YomiaImiKGVlZeWxLecAgBkzZvgdDkfWjRs3ggA0bpfpoiiahBCqKEqKAy2yULMA6MlkMp6Xl3cP1x2SWCwmFhQU+CmlFhfHNFOevpX4LcvSJUkyAeDQoUOh119//fpTTz01Zf78+UWBQCBHUZQ7yE/TNGPfvn0n33vvvSP79+//BECMeZsCMGRZNgRBgNPpHHXx4sVVDQ0Nf1+wYMGYJ554YikAevDgwUMA4oIgQJZlSggZdDqdBiGEZGdn6ww0tQlJURTT4/EMHz9+/MCjjz7622AwuHbZsmVbiouLvWvXrm1wOp3ZqVRqaKQTIInf1gAMl8ulU0q1CxcuBGOxmL5u3bryQCDgycrKEjORXGtra8eOHTsOHz169OyVK1cuA+hlRYrGlNRkWR7UNO2mYRiaz+cb3dLS8gYhhOi6Hj116tSOVatWHQNALcsaME0zLghClBDSZ9+zQsZ2SoJS2udwOKLPPffcvsrKyrJAIPDQ/v37txiGofX19V3r7e29UlBQMHqEVpjwnrYA6PF4PK6q6s2qqqqpZWVlitvtljOB7enpiWzbtu3wgQMHTre1tV0E0MeKkkGuIhMAqHv37u30er3Px+NxlyiKygMPPOAnhFiXLl0Kbd68uYPNsXbu3Lk6mUwaqqr2btmyZUdtbe3hd955pwvAEFNcO3jw4K/b2tqiqqpGIpGI4/HHH/9rQ0PDCa/XOyoSidDLly8PNTU1PcZ4QuNK1ju6NYHFRAGASXPnzv1Fa2vrxzTDpapqateuXR/Nnz+/SVGUhwFMBzCBFSLZLF75DsrJGpXRAH4EIABgPIBxAEoBFAPwARjFif1sNzZ25+VlOhaxufcCqAFQC+BhAPVLliz5XSqVUkOhUAuAKWnFyR3dlsw+fg+A+8eMGfPzTZs2bY9GozEb8JkzZ9qXLl36l+Li4l8B+AmAyQDGsGrOzfXNPGPawG2l85jksmcPm+vihH+2W1iF3bvZPN+sWbPuGx4eDrW3t+85fvz41o6OjmZN04Y0TYvV19cvYIbN5QqUjG2mwj5YAqDK4XDMe+aZZ55vbW09+sorr2yuqqpqYFatAuBn3uB7XzJCY297XeaUd2RoGzOJmHb6IjFj5D777LP3DQwMfDw8PBxSVbUvkUj0hEKhj1588cXH2O7zMSPdplumoxveMx5Zlj3jx4/39vb26gMDA4MsvgYZo+p8Pr7LqQX5Ds/U7d0jFxUVZS1atKg4Nzc317Isp67rZldXV6y5ufkmI78hFtcmrx8ZweMit6XsUs4+6kmlgbW+peLf9gyMZNCR374G0y/FxEzX8b/8+bkXEBxKFwAAAABJRU5ErkJggg==",v.tileXYToQuadKey=function(e,t,i){for(var r="",n=i;n>=0;--n){var o=1<<n,a=0;0!==(e&o)&&(a|=1),0!==(t&o)&&(a|=2),r+=a}return r},v.quadKeyToTileXY=function(e){for(var t=0,i=0,r=e.length-1,n=r;n>=0;--n){var o=1<<n,a=+e[r-n];0!==(1&a)&&(t|=o),0!==(2&a)&&(i|=o)}return{x:t,y:i,level:r}};var S=new c;return v}),i("Scene/CullingVolume",["../Core/Cartesian3","../Core/Cartesian4","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/Intersect","../Core/Plane"],function(e,t,i,r,n,o,a){"use strict";function s(e){this.planes=i(e,[])}var l=[new e,new e,new e];e.clone(e.UNIT_X,l[0]),e.clone(e.UNIT_Y,l[1]),e.clone(e.UNIT_Z,l[2]);var u=new e,c=new e,h=new a(new e,0);return s.fromBoundingSphere=function(i,n){r(n)||(n=new s);var o=l.length,a=n.planes;a.length=2*o;for(var h=i.center,d=i.radius,p=0,m=0;m<o;++m){var f=l[m],_=a[p],g=a[p+1];r(_)||(_=a[p]=new t),r(g)||(g=a[p+1]=new t),e.multiplyByScalar(f,-d,u),e.add(h,u,u),_.x=f.x,_.y=f.y,_.z=f.z,_.w=-e.dot(f,u),e.multiplyByScalar(f,d,u),e.add(h,u,u),g.x=-f.x,g.y=-f.y,g.z=-f.z,g.w=-e.dot(e.negate(f,c),u),p+=2}return n},s.prototype.computeVisibility=function(e){for(var t=this.planes,i=!1,r=0,n=t.length;r<n;++r){var s=e.intersectPlane(a.fromCartesian4(t[r],h));if(s===o.OUTSIDE)return o.OUTSIDE;s===o.INTERSECTING&&(i=!0)}return i?o.INTERSECTING:o.INSIDE},s.prototype.computeVisibilityWithPlaneMask=function(e,t){if(t===s.MASK_OUTSIDE||t===s.MASK_INSIDE)return t;for(var i=s.MASK_INSIDE,r=this.planes,n=0,l=r.length;n<l;++n){var u=n<31?1<<n:0;if(!(n<31&&0===(t&u))){var c=e.intersectPlane(a.fromCartesian4(r[n],h));if(c===o.OUTSIDE)return s.MASK_OUTSIDE;c===o.INTERSECTING&&(i|=u)}}return i},s.MASK_OUTSIDE=4294967295,s.MASK_INSIDE=0,s.MASK_INDETERMINATE=2147483647,s}),i("Scene/PerspectiveOffCenterFrustum",["../Core/Cartesian3","../Core/Cartesian4","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Matrix4","./CullingVolume"],function(e,t,i,r,n,o,a){"use strict";function s(){this.left=void 0,this._left=void 0,this.right=void 0,this._right=void 0,this.top=void 0,this._top=void 0,this.bottom=void 0,this._bottom=void 0,this.near=1,this._near=this.near,this.far=5e8,this._far=this.far,this._cullingVolume=new a,this._perspectiveMatrix=new o,this._infinitePerspective=new o}function l(e){var t=e.top,i=e.bottom,r=e.right,n=e.left,a=e.near,s=e.far;t===e._top&&i===e._bottom&&n===e._left&&r===e._right&&a===e._near&&s===e._far||(e._left=n,e._right=r,e._top=t,e._bottom=i,e._near=a,e._far=s,e._perspectiveMatrix=o.computePerspectiveOffCenter(n,r,i,t,a,s,e._perspectiveMatrix),e._infinitePerspective=o.computeInfinitePerspectiveOffCenter(n,r,i,t,a,e._infinitePerspective))}r(s.prototype,{projectionMatrix:{get:function(){return l(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return l(this),this._infinitePerspective}}});var u=new e,c=new e,h=new e,d=new e;return s.prototype.computeCullingVolume=function(r,n,o){var a=this._cullingVolume.planes,s=this.top,l=this.bottom,p=this.right,m=this.left,f=this.near,_=this.far,g=e.cross(n,o,u),v=c;e.multiplyByScalar(n,f,v),e.add(r,v,v);var y=h;e.multiplyByScalar(n,_,y),e.add(r,y,y);var C=d;e.multiplyByScalar(g,m,C),e.add(v,C,C),e.subtract(C,r,C),e.normalize(C,C),e.cross(C,o,C);var w=a[0];return i(w)||(w=a[0]=new t),w.x=C.x,w.y=C.y,w.z=C.z,w.w=-e.dot(C,r),e.multiplyByScalar(g,p,C),e.add(v,C,C),e.subtract(C,r,C),e.normalize(C,C),e.cross(o,C,C),w=a[1],i(w)||(w=a[1]=new t),w.x=C.x,w.y=C.y,w.z=C.z,w.w=-e.dot(C,r),e.multiplyByScalar(o,l,C),e.add(v,C,C),e.subtract(C,r,C),e.normalize(C,C),e.cross(g,C,C),w=a[2],i(w)||(w=a[2]=new t),w.x=C.x,w.y=C.y,w.z=C.z,w.w=-e.dot(C,r),e.multiplyByScalar(o,s,C),e.add(v,C,C),e.subtract(C,r,C),e.normalize(C,C),e.cross(C,g,C),w=a[3],i(w)||(w=a[3]=new t),w.x=C.x,w.y=C.y,w.z=C.z,w.w=-e.dot(C,r),w=a[4],i(w)||(w=a[4]=new t),w.x=n.x,w.y=n.y,w.z=n.z,w.w=-e.dot(n,v),e.negate(n,C),w=a[5],i(w)||(w=a[5]=new t),w.x=C.x,w.y=C.y,w.z=C.z,w.w=-e.dot(C,y),this._cullingVolume},s.prototype.getPixelDimensions=function(e,t,i,r){l(this);var n=1/this.near,o=this.top*n,a=2*i*o/t;o=this.right*n;var s=2*i*o/e;return r.x=s,r.y=a,r},s.prototype.clone=function(e){return i(e)||(e=new s),e.right=this.right,e.left=this.left,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e},s.prototype.equals=function(e){return i(e)&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far},s}),i("Scene/PerspectiveFrustum",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","./PerspectiveOffCenterFrustum"],function(e,t,i,r){"use strict";function n(){this._offCenterFrustum=new r,this.fov=void 0,this._fov=void 0,this._fovy=void 0,this._sseDenominator=void 0,this.aspectRatio=void 0,this._aspectRatio=void 0,this.near=1,this._near=this.near,this.far=5e8,this._far=this.far,this.xOffset=0,this._xOffset=this.xOffset,this.yOffset=0,this._yOffset=this.yOffset}function o(e){var t=e._offCenterFrustum;e.fov===e._fov&&e.aspectRatio===e._aspectRatio&&e.near===e._near&&e.far===e._far&&e.xOffset===e._xOffset&&e.yOffset===e._yOffset||(e._aspectRatio=e.aspectRatio,e._fov=e.fov,e._fovy=e.aspectRatio<=1?e.fov:2*Math.atan(Math.tan(.5*e.fov)/e.aspectRatio),e._near=e.near,e._far=e.far,e._sseDenominator=2*Math.tan(.5*e._fovy),e._xOffset=e.xOffset,e._yOffset=e.yOffset,t.top=e.near*Math.tan(.5*e._fovy),t.bottom=-t.top,t.right=e.aspectRatio*t.top,t.left=-t.right,t.near=e.near,t.far=e.far,t.right+=e.xOffset,t.left+=e.xOffset,t.top+=e.yOffset,t.bottom+=e.yOffset)}return t(n.prototype,{projectionMatrix:{get:function(){return o(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return o(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return o(this),this._fovy}},sseDenominator:{get:function(){return o(this),this._sseDenominator}}}),n.prototype.computeCullingVolume=function(e,t,i){return o(this),this._offCenterFrustum.computeCullingVolume(e,t,i)},n.prototype.getPixelDimensions=function(e,t,i,r){return o(this),this._offCenterFrustum.getPixelDimensions(e,t,i,r)},n.prototype.clone=function(t){return e(t)||(t=new n),t.aspectRatio=this.aspectRatio,t.fov=this.fov,t.near=this.near,t.far=this.far,t._aspectRatio=void 0,t._fov=void 0,t._near=void 0,t._far=void 0,this._offCenterFrustum.clone(t._offCenterFrustum),t},n.prototype.equals=function(t){return!!e(t)&&(o(this),o(t),this.fov===t.fov&&this.aspectRatio===t.aspectRatio&&this.near===t.near&&this.far===t.far&&this._offCenterFrustum.equals(t._offCenterFrustum))},n}),i("Scene/CameraFlightPath",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/EasingFunction","../Core/Math","./PerspectiveFrustum","./PerspectiveOffCenterFrustum","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(e,t,i){var r,n,o;if(e instanceof l){var a=Math.tan(.5*e.fovy);return r=e.near,n=e.near*a,o=e.aspectRatio*n,Math.max(t*r/o,i*r/n)}return e instanceof u?(r=e.near,n=e.top,o=e.right,Math.max(t*r/o,i*r/n)):Math.max(t,i)}function d(e,i,r,o,a){var l=a,u=Math.max(r,o);if(!n(l)){var c=e.position,d=i,p=e.up,m=e.right,f=e.frustum,_=t.subtract(c,d,C),g=t.magnitude(t.multiplyByScalar(p,t.dot(_,p),w)),v=t.magnitude(t.multiplyByScalar(m,t.dot(_,m),w));l=Math.min(.2*h(f,g,v),1e9)}if(u<l){var y=8,S=1e6,E=-Math.pow((l-r)*S,1/y),b=Math.pow((l-o)*S,1/y);return function(e){var t=e*(b-E)+E;return-Math.pow(t,y)/S+l}}return function(e){return s.lerp(r,o,e)}}function p(e,t){return s.equalsEpsilon(e,s.TWO_PI,s.EPSILON11)&&(e=0),t>e+Math.PI?e+=s.TWO_PI:t<e-Math.PI&&(e-=s.TWO_PI),e}function m(i,r,n,o,a,l,u){function c(t){var i=t.time/r;h.setView({orientation:{heading:s.lerp(_,o,i),pitch:s.lerp(f,a,i),roll:s.lerp(g,l,i)}}),e.lerp(m,n,i,h.position),h.position.z=v(i)}var h=i.camera,m=t.clone(h.position,S),f=h.pitch,_=p(h.heading,o),g=p(h.roll,l),v=d(h,n,m.z,n.z,u);return c}function f(e,r,n,o,a,l,u){function c(e){var i=e.time/r,n=t.fromRadians(s.lerp(_.longitude,C.longitude,i),s.lerp(_.latitude,C.latitude,i),S(i));h.setView({destination:n,orientation:{heading:s.lerp(v,o,i),pitch:s.lerp(g,a,i),roll:s.lerp(y,l,i)}})}var h=e.camera,m=e.mapProjection,f=m.ellipsoid,_=i.clone(h.positionCartographic,E),g=h.pitch,v=p(h.heading,o),y=p(h.roll,l),C=f.cartesianToCartographic(n,b);_.longitude=s.zeroToTwoPi(_.longitude),C.longitude=s.zeroToTwoPi(C.longitude);var w=_.longitude-C.longitude;w<-s.PI?_.longitude+=s.TWO_PI:w>s.PI&&(C.longitude+=s.TWO_PI);var S=d(h,n,_.height,C.height,u);return c}function _(i,r,n,o,a,l,u){function c(t){var i=t.time/r;h.setView({orientation:{heading:s.lerp(f,o,i)}}),e.lerp(m,n,i,h.position);var a=g(i),l=h.frustum,u=l.top/l.right,c=.5*(a-(l.right-l.left));l.right+=c,l.left-=c,l.top=u*l.right,l.bottom=-l.top}var h=i.camera,m=t.clone(h.position,S),f=p(h.heading,o),_=h.frustum.right-h.frustum.left,g=d(h,n,_,n.z,u);return c}function g(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function v(e,t){function i(){"function"==typeof t&&t(),e.enableInputs=!0}return i}var y={},C=new t,w=new t,S=new t,E=new i,b=new i,T=new i,x=new t;return y.createTween=function(i,o){o=r(o,r.EMPTY_OBJECT);var l=o.destination,u=i.mode;if(u===c.MORPHING)return g();var h=r(o.convert,!0),d=i.mapProjection,p=d.ellipsoid,y=o.maximumHeight,C=o.easingFunction;h&&u!==c.SCENE3D&&(p.cartesianToCartographic(l,T),l=d.project(T,x));var w=i.camera,S=o.endTransform;n(S)&&w._setTransform(S);var E=o.duration;n(E)||(E=Math.ceil(t.distance(w.position,l)/1e6)+2,E=Math.min(E,3));var b=r(o.heading,0),A=r(o.pitch,-s.PI_OVER_TWO),P=r(o.roll,0),D=i.screenSpaceCameraController;D.enableInputs=!1;var M=v(D,o.complete),I=v(D,o.cancel),R=w.frustum,O=i.mode===c.SCENE2D;if(O=O&&e.equalsEpsilon(w.position,l,s.EPSILON6),O=O&&s.equalsEpsilon(Math.max(R.right-R.left,R.top-R.bottom),l.z,s.EPSILON6),O=O||i.mode!==c.SCENE2D&&t.equalsEpsilon(l,w.position,s.EPSILON10),O=O&&s.equalsEpsilon(s.negativePiToPi(b),s.negativePiToPi(w.heading),s.EPSILON10)&&s.equalsEpsilon(s.negativePiToPi(A),s.negativePiToPi(w.pitch),s.EPSILON10)&&s.equalsEpsilon(s.negativePiToPi(P),s.negativePiToPi(w.roll),s.EPSILON10))return g(M,I);var N=new Array(4);if(N[c.SCENE2D]=_,N[c.SCENE3D]=f,N[c.COLUMBUS_VIEW]=m,E<=0){var L=function(){var e=N[u](i,1,l,b,A,P,y);e({time:1}),"function"==typeof M&&M()};return g(L,I)}var B=N[u](i,E,l,b,A,P,y);if(!n(C)){var F=w.positionCartographic.height,V=u===c.SCENE3D?p.cartesianToCartographic(l).height:l.z;C=F>V&&F>11500?a.CUBIC_OUT:a.QUINTIC_IN_OUT}return{duration:E,easingFunction:C,startObject:{time:0},stopObject:{time:E},update:B,complete:M,cancel:I}},y}),i("Scene/MapMode2D",["../Core/freezeObject"],function(e){"use strict";var t={ROTATE:0,INFINITE_SCROLL:1};return e(t)}),i("Scene/Camera",["../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/EasingFunction","../Core/Ellipsoid","../Core/EllipsoidGeodesic","../Core/Event","../Core/HeadingPitchRange","../Core/Intersect","../Core/IntersectionTests","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/Quaternion","../Core/Ray","../Core/Rectangle","../Core/Transforms","./CameraFlightPath","./MapMode2D","./PerspectiveFrustum","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x){"use strict";function A(e){this._scene=e,this._transform=v.clone(v.IDENTITY),this._invTransform=v.clone(v.IDENTITY),this._actualTransform=v.clone(v.IDENTITY),this._actualInvTransform=v.clone(v.IDENTITY),this._transformChanged=!1,this.position=new i,this._position=new i,this._positionWC=new i,this._positionCartographic=new n,this.direction=new i,this._direction=new i,this._directionWC=new i,this.up=new i,this._up=new i,this._upWC=new i,this.right=new i,this._right=new i,this._rightWC=new i,this.frustum=new T,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=_.toRadians(60),this.defaultMoveAmount=1e5,this.defaultLookAmount=Math.PI/60,this.defaultRotateAmount=Math.PI/3600,this.defaultZoomAmount=1e5,this.constrainedAxis=void 0,this.maximumZoomFactor=1.5,this._moveStart=new d,this._moveEnd=new d,this._changed=new d,this._changedPosition=void 0,this._changedDirection=void 0,this._changedFrustum=void 0,this.percentageChanged=.5,this._viewMatrix=new v,this._invViewMatrix=new v,P(this),this._mode=x.SCENE3D,this._modeChanged=!0;var t=e.mapProjection;this._projection=t,this._maxCoord=t.project(new n(Math.PI,_.PI_OVER_TWO)),this._max2Dfrustum=void 0,this._suspendTerrainAdjustment=!1,j(this,A.DEFAULT_VIEW_RECTANGLE,this.position,!0); +var r=i.magnitude(this.position);r+=r*A.DEFAULT_VIEW_FACTOR,i.normalize(this.position,this.position),i.multiplyByScalar(this.position,r,this.position)}function P(e){v.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),v.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),v.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function D(e){S.basisTo2D(e._projection,e._transform,e._actualTransform)}function M(e){var t=e._projection,n=t.ellipsoid,o=v.getColumn(e._transform,3,de),a=n.cartesianToCartographic(o,ue),s=t.project(a,ce),l=pe;l.x=s.z,l.y=s.x,l.z=s.y,l.w=1;var u=r.clone(r.UNIT_X,_e),c=r.add(v.getColumn(e._transform,0,he),o,he);n.cartesianToCartographic(c,a),t.project(a,s);var h=me;h.x=s.z,h.y=s.x,h.z=s.y,h.w=0,i.subtract(h,l,h),h.x=0;var d=fe;if(i.magnitudeSquared(h)>_.EPSILON10)i.cross(u,h,d);else{var p=r.add(v.getColumn(e._transform,1,he),o,he);n.cartesianToCartographic(p,a),t.project(a,s),d.x=s.z,d.y=s.x,d.z=s.y,d.w=0,i.subtract(d,l,d),d.x=0,i.magnitudeSquared(d)<_.EPSILON10&&(r.clone(r.UNIT_Y,h),r.clone(r.UNIT_Z,d))}i.cross(d,u,h),i.normalize(h,h),i.cross(u,h,d),i.normalize(d,d),v.setColumn(e._actualTransform,0,h,e._actualTransform),v.setColumn(e._actualTransform,1,d,e._actualTransform),v.setColumn(e._actualTransform,2,u,e._actualTransform),v.setColumn(e._actualTransform,3,l,e._actualTransform)}function I(e){var t=e._mode,r=!1,n=0;t===x.SCENE2D&&(n=e.frustum.right-e.frustum.left,r=n!==e._positionCartographic.height);var o=e._position,a=!i.equals(o,e.position)||r;a&&(o=i.clone(e.position,e._position));var s=e._direction,l=!i.equals(s,e.direction);l&&(i.normalize(e.direction,e.direction),s=i.clone(e.direction,e._direction));var u=e._up,c=!i.equals(u,e.up);c&&(i.normalize(e.up,e.up),u=i.clone(e.up,e._up));var h=e._right,d=!i.equals(h,e.right);d&&(i.normalize(e.right,e.right),h=i.clone(e.right,e._right));var p=e._transformChanged||e._modeChanged;e._transformChanged=!1,p&&(v.inverseTransformation(e._transform,e._invTransform),e._mode===x.COLUMBUS_VIEW||e._mode===x.SCENE2D?v.equals(v.IDENTITY,e._transform)?v.clone(A.TRANSFORM_2D,e._actualTransform):e._mode===x.COLUMBUS_VIEW?D(e):M(e):v.clone(e._transform,e._actualTransform),v.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);var m=e._actualTransform;if(a||p)if(e._positionWC=v.multiplyByPoint(m,o,e._positionWC),t===x.SCENE3D||t===x.MORPHING)e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic);else{var f=ge;f.x=e._positionWC.y,f.y=e._positionWC.z,f.z=e._positionWC.x,t===x.SCENE2D&&(f.z=n),e._projection.unproject(f,e._positionCartographic)}if(l||c||d){var g=i.dot(s,i.cross(u,h,ge));if(Math.abs(1-g)>_.EPSILON2){var y=1/i.magnitudeSquared(u),C=i.dot(u,s)*y,w=i.multiplyByScalar(s,C,ge);u=i.normalize(i.subtract(u,w,e._up),e._up),i.clone(u,e.up),h=i.cross(s,u,e._right),i.clone(h,e.right)}}(l||p)&&(e._directionWC=v.multiplyByPointAsVector(m,s,e._directionWC)),(c||p)&&(e._upWC=v.multiplyByPointAsVector(m,u,e._upWC)),(d||p)&&(e._rightWC=v.multiplyByPointAsVector(m,h,e._rightWC)),(a||l||c||d||p)&&P(e)}function R(e,t){var i;return i=_.equalsEpsilon(Math.abs(e.z),1,_.EPSILON3)?Math.atan2(t.y,t.x)-_.PI_OVER_TWO:Math.atan2(e.y,e.x)-_.PI_OVER_TWO,_.TWO_PI-_.zeroToTwoPi(i)}function O(e){return _.PI_OVER_TWO-_.acosClamped(e.z)}function N(e,t,i){var r=0;return _.equalsEpsilon(Math.abs(e.z),1,_.EPSILON3)||(r=Math.atan2(-i.z,t.z),r=_.zeroToTwoPi(r+_.TWO_PI)),r}function L(e,t,r,n,o){var a=v.clone(e.transform,be),s=S.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,Te);e._setTransform(s),i.clone(i.ZERO,e.position);var l=y.fromHeadingPitchRoll(r-_.PI_OVER_TWO,n,o,xe),u=g.fromQuaternion(l,Ae);g.getColumn(u,0,e.direction),g.getColumn(u,2,e.up),i.cross(e.direction,e.up,e.right),e._setTransform(a)}function B(e,t,r,n,o,a){var s=v.clone(e.transform,be);if(e._setTransform(v.IDENTITY),!i.equals(t,e.positionWC)){if(a){var l=e._projection,u=l.ellipsoid.cartesianToCartographic(t,Pe);t=l.project(u,Ee)}i.clone(t,e.position)}var c=y.fromHeadingPitchRoll(r-_.PI_OVER_TWO,n,o,xe),h=g.fromQuaternion(c,Ae);g.getColumn(h,0,e.direction),g.getColumn(h,2,e.up),i.cross(e.direction,e.up,e.right),e._setTransform(s)}function F(e,r,n,o){var a=-_.PI_OVER_TWO,s=0,l=v.clone(e.transform,be);if(e._setTransform(v.IDENTITY),!i.equals(r,e.positionWC)){if(o){var u=e._projection,c=u.ellipsoid.cartesianToCartographic(r,Pe);r=u.project(c,Ee)}t.clone(r,e.position);var h=.5*-r.z,d=-h,p=e.frustum;if(d>h){var m=p.top/p.right;p.right=d,p.left=h,p.top=p.right*m,p.bottom=-p.top}}if(e._scene.mapMode2D===b.ROTATE){var f=y.fromHeadingPitchRoll(n-_.PI_OVER_TWO,a,s,xe),C=g.fromQuaternion(f,Ae);g.getColumn(C,2,e.up),i.cross(e.direction,e.up,e.right)}e._setTransform(l)}function V(e,t,r,n){var o=i.clone(r.direction,De),a=i.clone(r.up,Me);if(e._scene.mode===x.SCENE3D){var s=e._projection.ellipsoid,l=S.eastNorthUpToFixedFrame(t,s,ve),u=v.inverseTransformation(l,ye);v.multiplyByPointAsVector(u,o,o),v.multiplyByPointAsVector(u,a,a)}var c=i.cross(o,a,Ie);return n.heading=R(o,a),n.pitch=O(o),n.roll=N(o,a,c),n}function k(e,t){var i,r,n=e._scene.mapMode2D===b.ROTATE,o=e._maxCoord.x,a=e._maxCoord.y;n?(r=o,i=-r):(r=t.x-2*o,i=t.x+2*o),t.x>o&&(t.x=r),t.x<-o&&(t.x=i),t.y>a&&(t.y=a),t.y<-a&&(t.y=-a)}function z(e,t){var r=e.position,n=i.normalize(r,ke);if(a(e.constrainedAxis)){var o=i.equalsEpsilon(n,e.constrainedAxis,_.EPSILON2),s=i.equalsEpsilon(n,i.negate(e.constrainedAxis,Ge),_.EPSILON2);if(o||s)(o&&t<0||s&&t>0)&&e.rotate(e.right,t);else{var l=i.normalize(e.constrainedAxis,ze),u=i.dot(n,l),c=_.acosClamped(u);t>0&&t>c&&(t=c-_.EPSILON4),u=i.dot(n,i.negate(l,Ge)),c=_.acosClamped(u),t<0&&-t>c&&(t=-c+_.EPSILON4);var h=i.cross(l,n,Ue);e.rotate(h,t)}}else e.rotate(e.right,t)}function U(e,t){a(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function G(e,t){var i=e.frustum;t=.5*t;var r=i.right-t,n=i.left+t,o=e._maxCoord.x;e._scene.mapMode2D===b.ROTATE&&(o*=e.maximumZoomFactor),r>o&&(r=o,n=-o),r<=n&&(r=1,n=-1);var a=i.top/i.right;i.right=r,i.left=n,i.top=i.right*a,i.bottom=-i.top}function W(e,t){e.move(e.direction,t)}function H(e,t,r){t=_.clamp(t,-_.PI_OVER_TWO,_.PI_OVER_TWO),e=_.zeroToTwoPi(e)-_.PI_OVER_TWO;var n=y.fromAxisAngle(i.UNIT_Y,-t,qe),o=y.fromAxisAngle(i.UNIT_Z,-e,je),a=y.multiply(o,n,o),s=g.fromQuaternion(a,Ye),l=i.clone(i.UNIT_X,He);return g.multiplyByVector(s,l,l),i.negate(l,l),i.multiplyByScalar(l,r,l),l}function q(e,t,r,n){var o=Math.abs(i.dot(t,r));return o/n-i.dot(e,r)}function j(e,t,r,n){var o=e._projection.ellipsoid,s=n?e:ot,l=t.north,u=t.south,c=t.east,d=t.west;d>c&&(c+=_.TWO_PI);var p,m=.5*(d+c);if(u<-_.PI_OVER_TWO+_.RADIANS_PER_DEGREE&&l>_.PI_OVER_TWO-_.RADIANS_PER_DEGREE)p=0;else{var f=Ze;f.longitude=m,f.latitude=l,f.height=0;var g=Ke;g.longitude=m,g.latitude=u,g.height=0;var v=Xe;a(v)&&v.ellipsoid===o||(Xe=v=new h(void 0,void 0,o)),v.setEndPoints(f,g),p=v.interpolateUsingFraction(.5,Ze).latitude}var y=Ze;y.longitude=m,y.latitude=p,y.height=0;var C=o.cartographicToCartesian(y,rt),w=Ze;w.longitude=c,w.latitude=l;var S=o.cartographicToCartesian(w,Qe);w.longitude=d;var E=o.cartographicToCartesian(w,$e);w.longitude=m;var b=o.cartographicToCartesian(w,tt);w.latitude=u;var T=o.cartographicToCartesian(w,it);w.longitude=c;var x=o.cartographicToCartesian(w,et);w.longitude=d;var A=o.cartographicToCartesian(w,Je);i.subtract(E,C,E),i.subtract(x,C,x),i.subtract(S,C,S),i.subtract(A,C,A),i.subtract(b,C,b),i.subtract(T,C,T);var P=o.geodeticSurfaceNormal(C,s.direction);i.negate(P,P);var D=i.cross(P,i.UNIT_Z,s.right);i.normalize(D,D);var M=i.cross(D,P,s.up),I=Math.tan(.5*e.frustum.fovy),R=e.frustum.aspectRatio*I,O=Math.max(q(P,M,E,I),q(P,M,x,I),q(P,M,S,I),q(P,M,A,I),q(P,M,b,I),q(P,M,T,I),q(P,D,E,R),q(P,D,x,R),q(P,D,S,R),q(P,D,A,R),q(P,D,b,R),q(P,D,T,R));if(u<0&&l>0){var N=Ze;N.longitude=d,N.latitude=0,N.height=0;var L=o.cartographicToCartesian(N,nt);i.subtract(L,C,L),O=Math.max(O,q(P,M,L,I),q(P,D,L,R)),N.longitude=c,L=o.cartographicToCartesian(N,nt),i.subtract(L,C,L),O=Math.max(O,q(P,M,L,I),q(P,D,L,R))}return i.add(C,i.multiplyByScalar(P,-O,nt),r)}function Y(e,t,i){var r=e._projection;t.west>t.east&&(t=w.MAX_VALUE);var n=e._actualTransform,o=e._actualInvTransform,a=at;a.longitude=t.east,a.latitude=t.north;var s=r.project(a,st);v.multiplyByPoint(n,s,s),v.multiplyByPoint(o,s,s),a.longitude=t.west,a.latitude=t.south;var l=r.project(a,lt);v.multiplyByPoint(n,l,l),v.multiplyByPoint(o,l,l);var u=Math.tan(.5*e.frustum.fovy),c=e.frustum.aspectRatio*u;return i.x=.5*(s.x-l.x)+l.x,i.y=.5*(s.y-l.y)+l.y,i.z=.5*Math.max((s.x-l.x)/c,(s.y-l.y)/u),i}function X(e,t,i){var r=e._projection;t.west>t.east&&(t=w.MAX_VALUE);var n=ut;n.longitude=t.east,n.latitude=t.north;var o=r.project(n,ct);n.longitude=t.west,n.latitude=t.south;var a,s,l=r.project(n,ht),u=.5*Math.abs(o.x-l.x),c=.5*Math.abs(o.y-l.y),h=e.frustum.right/e.frustum.top,d=c*h;return u>d?(a=u,s=a/h):(s=c,a=d),c=Math.max(2*a,2*s),i.x=.5*(o.x-l.x)+l.x,i.y=.5*(o.y-l.y)+l.y,n=r.unproject(i,n),n.height=c,i=r.project(n,i)}function Z(e,t,i,r){i=o(i,c.WGS84);var n=e.getPickRay(t,dt),a=f.rayEllipsoid(n,i);if(a){var s=a.start>0?a.start:a.stop;return C.getPoint(n,s,r)}}function K(e,t,i,r){var n=e.getPickRay(t,pt),o=n.origin;o.z=0;var a=i.unproject(o);if(!(a.latitude<-_.PI_OVER_TWO||a.latitude>_.PI_OVER_TWO))return i.ellipsoid.cartographicToCartesian(a,r)}function Q(e,t,r,n){var o=e.getPickRay(t,mt),a=-o.origin.x/o.direction.x;C.getPoint(o,a,n);var s=r.unproject(new i(n.y,n.z,0));if(!(s.latitude<-_.PI_OVER_TWO||s.latitude>_.PI_OVER_TWO||s.longitude<-Math.PI||s.longitude>Math.PI))return r.ellipsoid.cartographicToCartesian(s,n)}function J(e,t,r){var n=e._scene.canvas,o=n.clientWidth,a=n.clientHeight,s=Math.tan(.5*e.frustum.fovy),l=e.frustum.aspectRatio*s,u=e.frustum.near,c=2/o*t.x-1,h=2/a*(a-t.y)-1,d=e.positionWC;i.clone(d,r.origin);var p=i.multiplyByScalar(e.directionWC,u,ft);i.add(d,p,p);var m=i.multiplyByScalar(e.rightWC,c*u*l,_t),f=i.multiplyByScalar(e.upWC,h*u*s,gt),_=i.add(p,m,r.direction);return i.add(_,f,_),i.subtract(_,d,_),i.normalize(_,_),r}function $(e,t,r){var n=e._scene.canvas,o=n.clientWidth,a=n.clientHeight,s=2/o*t.x-1;s*=.5*(e.frustum.right-e.frustum.left);var l=2/a*(a-t.y)-1;l*=.5*(e.frustum.top-e.frustum.bottom);var u=r.origin;return i.clone(e.position,u),i.multiplyByScalar(e.right,s,vt),i.add(vt,u,u),i.multiplyByScalar(e.up,l,vt),i.add(vt,u,u),i.clone(e.directionWC,r.direction),r}function ee(e,t,r,n,o,a){function s(r){var n=i.lerp(t,l,r.time,new i);e.worldToCameraCoordinatesPoint(n,e.position)}var l=i.clone(t);return r.y>n?l.y-=r.y-n:r.y<-n&&(l.y+=-n-r.y),r.z>o?l.z-=r.z-o:r.z<-o&&(l.z+=-o-r.z),{easingFunction:u.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:a,update:s}}function te(e,t){var r=e.position,n=e.direction,o=e.worldToCameraCoordinatesVector(i.UNIT_X,St),a=-i.dot(o,r)/i.dot(o,n),s=i.add(r,i.multiplyByScalar(n,a,Et),Et);e.cameraToWorldCoordinatesPoint(s,s),r=e.cameraToWorldCoordinatesPoint(e.position,bt);var l=Math.tan(.5*e.frustum.fovy),u=e.frustum.aspectRatio*l,c=i.magnitude(i.subtract(r,s,Tt)),h=u*c,d=l*c,p=e._maxCoord.x,m=e._maxCoord.y,f=Math.max(h-p,p),_=Math.max(d-m,m);if(r.z<-f||r.z>f||r.y<-_||r.y>_){var g=s.y<-f||s.y>f,v=s.z<-_||s.z>_;if(g||v)return ee(e,r,s,f,_,t)}}function ie(e,t){var i=e.frustum,r=Math.tan(.5*i.fovy),n=i.aspectRatio*r;return Math.max(t/n,t/r)}function re(e,t){var i,r,n=e.frustum,o=n.right/n.top,a=t*o;return t>a?(i=t,r=i/o):(r=t,i=a),1.5*Math.max(i,r)}function ne(e,t,i){a(i)||(i=p.clone(Pt));var r=i.range;if(!a(r)||0===r){var n=t.radius;0===n?i.range=Dt:i.range=e._mode===x.SCENE2D?re(e,n):ie(e,n)}return i}function oe(e,t){var r,n,o=t.radii,a=e.positionWC,s=i.multiplyComponents(t.oneOverRadii,a,Vt),l=i.magnitude(s),u=i.normalize(s,kt);i.equalsEpsilon(u,i.UNIT_Z,_.EPSILON10)?(r=new i(0,1,0),n=new i(0,0,1)):(r=i.normalize(i.cross(i.UNIT_Z,u,zt),zt),n=i.normalize(i.cross(u,r,Ut),Ut));var c=Math.sqrt(i.magnitudeSquared(s)-1),h=i.multiplyByScalar(u,1/l,Vt),d=c/l,p=i.multiplyByScalar(r,d,kt),m=i.multiplyByScalar(n,d,zt),f=i.add(h,m,Gt[0]);i.subtract(f,p,f),i.multiplyComponents(o,f,f);var g=i.subtract(h,m,Gt[1]);i.subtract(g,p,g),i.multiplyComponents(o,g,g);var v=i.subtract(h,m,Gt[2]);i.add(v,p,v),i.multiplyComponents(o,v,v);var y=i.add(h,m,Gt[3]);return i.add(y,p,y),i.multiplyComponents(o,y,y),Gt}function ae(e,t,i,r,n,o){Wt.x=e,Wt.y=t;var s=r.pickEllipsoid(Wt,n,Ht);return a(s)?(qt[i]=n.cartesianToCartographic(s,qt[i]),1):(qt[i]=n.cartesianToCartographic(o[i],qt[i]),0)}A.TRANSFORM_2D=new v(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),A.TRANSFORM_2D_INVERSE=v.inverseTransformation(A.TRANSFORM_2D,new v),A.DEFAULT_VIEW_RECTANGLE=w.fromDegrees(-95,-20,-70,90),A.DEFAULT_VIEW_FACTOR=.5,A.prototype._updateCameraChanged=function(){var e=this;if(0!==e._changed.numberOfListeners){var t=e.percentageChanged;if(e._mode===x.SCENE2D){if(!a(e._changedFrustum))return e._changedPosition=i.clone(e.position,e._changedPosition),void(e._changedFrustum=e.frustum.clone());var r,n=e.position,o=e._changedPosition,s=e.frustum,l=e._changedFrustum,u=n.x+s.left,c=n.x+s.right,h=o.x+l.left,d=o.x+l.right,p=n.y+s.bottom,m=n.y+s.top,f=o.y+l.bottom,g=o.y+l.top,v=Math.max(u,h),y=Math.min(c,d),C=Math.max(p,f),w=Math.min(m,g);if(v>=y||C>=m)r=1;else{var S=l;u<h&&c>d&&p<f&&m>g&&(S=s),r=1-(y-v)*(w-C)/((S.right-S.left)*(S.top-S.bottom))}return void(r>t&&(e._changed.raiseEvent(r),e._changedPosition=i.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone(e._changedFrustum)))}if(!a(e._changedDirection))return e._changedPosition=i.clone(e.positionWC,e._changedPosition),void(e._changedDirection=i.clone(e.directionWC,e._changedDirection));var E=_.acosClamped(i.dot(e.directionWC,e._changedDirection)),b=E/(.5*e.frustum.fovy),T=i.distance(e.positionWC,e._changedPosition),A=T/e.positionCartographic.height;(b>t||A>t)&&(e._changed.raiseEvent(Math.max(b,A)),e._changedPosition=i.clone(e.positionWC,e._changedPosition),e._changedDirection=i.clone(e.directionWC,e._changedDirection))}};var se=new v,le=new n;A.prototype._adjustHeightForTerrain=function(){var e=this._scene,t=e.screenSpaceCameraController,r=t.enableCollisionDetection,n=t.minimumCollisionTerrainHeight,o=t.minimumZoomDistance;if(!this._suspendTerrainAdjustment&&r){var s=this._mode,l=e.globe;if(a(l)&&s!==x.SCENE2D&&s!==x.MORPHING){var u,c,h=l.ellipsoid,d=e.mapProjection;v.equals(this.transform,v.IDENTITY)||(u=v.clone(this.transform,se),c=i.magnitude(this.position),this._setTransform(v.IDENTITY));var p=le;s===x.SCENE3D?h.cartesianToCartographic(this.position,p):d.unproject(this.position,p);var m=!1;if(p.height<n){var f=l.getHeight(p);a(f)&&(f+=o,p.height<f&&(p.height=f,s===x.SCENE3D?h.cartographicToCartesian(p,this.position):d.project(p,this.position),m=!0))}a(u)&&(this._setTransform(u),m&&(i.normalize(this.position,this.position),i.negate(this.position,this.direction),i.multiplyByScalar(this.position,Math.max(c,o),this.position),i.normalize(this.direction,this.direction),i.cross(this.direction,this.up,this.right),i.cross(this.right,this.direction,this.up)))}}};var ue=new n,ce=new i,he=new i,de=new r,pe=new r,me=new r,fe=new r,_e=new r,ge=new i,ve=new v,ye=new v;s(A.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return I(this),this._invTransform}},viewMatrix:{get:function(){return I(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return I(this),this._invViewMatrix}},positionCartographic:{get:function(){return I(this),this._positionCartographic}},positionWC:{get:function(){return I(this),this._positionWC}},directionWC:{get:function(){return I(this),this._directionWC}},upWC:{get:function(){return I(this),this._upWC}},rightWC:{get:function(){return I(this),this._rightWC}},heading:{get:function(){if(this._mode!==x.MORPHING){var e=this._projection.ellipsoid,t=v.clone(this._transform,ve),i=S.eastNorthUpToFixedFrame(this.positionWC,e,ye);this._setTransform(i);var r=R(this.direction,this.up);return this._setTransform(t),r}}},pitch:{get:function(){if(this._mode!==x.MORPHING){var e=this._projection.ellipsoid,t=v.clone(this._transform,ve),i=S.eastNorthUpToFixedFrame(this.positionWC,e,ye);this._setTransform(i);var r=O(this.direction);return this._setTransform(t),r}}},roll:{get:function(){if(this._mode!==x.MORPHING){var e=this._projection.ellipsoid,t=v.clone(this._transform,ve),i=S.eastNorthUpToFixedFrame(this.positionWC,e,ye);this._setTransform(i);var r=N(this.direction,this.up,this.right);return this._setTransform(t),r}}},moveStart:{get:function(){return this._moveStart}},moveEnd:{get:function(){return this._moveEnd}},changed:{get:function(){return this._changed}}}),A.prototype.update=function(e){var t=!1;if(e!==this._mode&&(this._mode=e,this._modeChanged=e!==x.MORPHING,t=this._mode===x.SCENE2D),t){var i=this._max2Dfrustum=this.frustum.clone(),r=2,n=i.top/i.right;i.right=this._maxCoord.x*r,i.left=-i.right,i.top=n*i.right,i.bottom=-i.top}this._mode===x.SCENE2D&&k(this,this.position);var o=this._scene.globe,s=!a(o)||o._surface.tileProvider.ready&&0===o._surface._tileLoadQueueHigh.length&&0===o._surface._tileLoadQueueMedium.length&&0===o._surface._tileLoadQueueLow.length&&0===o._surface._debug.tilesWaitingForChildren;this._suspendTerrainAdjustment&&(this._suspendTerrainAdjustment=!s),this._adjustHeightForTerrain()};var Ce=new i,we=new i,Se=new i;A.prototype._setTransform=function(e){var t=i.clone(this.positionWC,Ce),r=i.clone(this.upWC,we),n=i.clone(this.directionWC,Se);v.clone(e,this._transform),this._transformChanged=!0,I(this);var o=this._actualInvTransform;v.multiplyByPoint(o,t,this.position),v.multiplyByPointAsVector(o,n,this.direction),v.multiplyByPointAsVector(o,r,this.up),i.cross(this.direction,this.up,this.right),I(this)};var Ee=new i,be=new v,Te=new v,xe=new y,Ae=new g,Pe=new n,De=new i,Me=new i,Ie=new i,Re={destination:void 0,orientation:{direction:void 0,up:void 0,heading:void 0,pitch:void 0,roll:void 0},convert:void 0,endTransform:void 0};A.prototype.setView=function(e){e=o(e,o.EMPTY_OBJECT);var t=o(e.orientation,o.EMPTY_OBJECT),r=this._mode;if(r!==x.MORPHING){a(e.endTransform)&&this._setTransform(e.endTransform);var n=o(e.convert,!0),s=o(e.destination,i.clone(this.positionWC,Ee));a(s)&&a(s.west)&&(s=this.getRectangleCameraCoordinates(s,Ee),n=!1),a(t.direction)&&(t=V(this,s,t,Re.orientation));var l=o(t.heading,0),u=o(t.pitch,-_.PI_OVER_TWO),c=o(t.roll,0);this._suspendTerrainAdjustment=!0,r===x.SCENE3D?L(this,s,l,u,c):r===x.SCENE2D?F(this,s,l,n):B(this,s,l,u,c,n)}};var Oe=new i;A.prototype.flyHome=function(e){var t=this._mode;if(t===x.MORPHING&&this._scene.completeMorph(),t===x.SCENE2D)this.flyTo({destination:w.MAX_VALUE,duration:e,endTransform:v.IDENTITY});else if(t===x.SCENE3D){var r=this.getRectangleCameraCoordinates(A.DEFAULT_VIEW_RECTANGLE),n=i.magnitude(r);n+=n*A.DEFAULT_VIEW_FACTOR,i.normalize(r,r),i.multiplyByScalar(r,n,r),this.flyTo({destination:r,duration:e,endTransform:v.IDENTITY})}else if(t===x.COLUMBUS_VIEW){var o=this._projection.ellipsoid.maximumRadius,a=new i(0,-1,1);a=i.multiplyByScalar(i.normalize(a,a),5*o,a),this.flyTo({destination:a,duration:e,orientation:{heading:0,pitch:-Math.acos(i.normalize(a,Oe).z),roll:0},endTransform:v.IDENTITY,convert:!1})}},A.prototype.worldToCameraCoordinates=function(e,t){return a(t)||(t=new r),I(this),v.multiplyByVector(this._actualInvTransform,e,t)},A.prototype.worldToCameraCoordinatesPoint=function(e,t){return a(t)||(t=new i),I(this),v.multiplyByPoint(this._actualInvTransform,e,t)},A.prototype.worldToCameraCoordinatesVector=function(e,t){return a(t)||(t=new i),I(this),v.multiplyByPointAsVector(this._actualInvTransform,e,t)},A.prototype.cameraToWorldCoordinates=function(e,t){return a(t)||(t=new r),I(this),v.multiplyByVector(this._actualTransform,e,t)},A.prototype.cameraToWorldCoordinatesPoint=function(e,t){return a(t)||(t=new i),I(this),v.multiplyByPoint(this._actualTransform,e,t)},A.prototype.cameraToWorldCoordinatesVector=function(e,t){return a(t)||(t=new i),I(this),v.multiplyByPointAsVector(this._actualTransform,e,t)};var Ne=new i;A.prototype.move=function(e,t){var r=this.position;i.multiplyByScalar(e,t,Ne),i.add(r,Ne,r),this._mode===x.SCENE2D&&k(this,r)},A.prototype.moveForward=function(e){e=o(e,this.defaultMoveAmount),this.move(this.direction,e)},A.prototype.moveBackward=function(e){e=o(e,this.defaultMoveAmount),this.move(this.direction,-e)},A.prototype.moveUp=function(e){e=o(e,this.defaultMoveAmount),this.move(this.up,e)},A.prototype.moveDown=function(e){e=o(e,this.defaultMoveAmount),this.move(this.up,-e)},A.prototype.moveRight=function(e){e=o(e,this.defaultMoveAmount),this.move(this.right,e)},A.prototype.moveLeft=function(e){e=o(e,this.defaultMoveAmount),this.move(this.right,-e)},A.prototype.lookLeft=function(e){e=o(e,this.defaultLookAmount),this.look(this.up,-e)},A.prototype.lookRight=function(e){e=o(e,this.defaultLookAmount),this.look(this.up,e)},A.prototype.lookUp=function(e){e=o(e,this.defaultLookAmount),this.look(this.right,-e)},A.prototype.lookDown=function(e){e=o(e,this.defaultLookAmount),this.look(this.right,e)};var Le=new y,Be=new g;A.prototype.look=function(e,t){var i=o(t,this.defaultLookAmount),r=y.fromAxisAngle(e,-i,Le),n=g.fromQuaternion(r,Be),a=this.direction,s=this.up,l=this.right;g.multiplyByVector(n,a,a),g.multiplyByVector(n,s,s),g.multiplyByVector(n,l,l)},A.prototype.twistLeft=function(e){e=o(e,this.defaultLookAmount),this.look(this.direction,e)},A.prototype.twistRight=function(e){e=o(e,this.defaultLookAmount),this.look(this.direction,-e)};var Fe=new y,Ve=new g;A.prototype.rotate=function(e,t){var r=o(t,this.defaultRotateAmount),n=y.fromAxisAngle(e,-r,Fe),a=g.fromQuaternion(n,Ve);g.multiplyByVector(a,this.position,this.position),g.multiplyByVector(a,this.direction,this.direction),g.multiplyByVector(a,this.up,this.up),i.cross(this.direction,this.up,this.right),i.cross(this.right,this.direction,this.up)},A.prototype.rotateDown=function(e){e=o(e,this.defaultRotateAmount),z(this,e)},A.prototype.rotateUp=function(e){e=o(e,this.defaultRotateAmount),z(this,-e)};var ke=new i,ze=new i,Ue=new i,Ge=new i;A.prototype.rotateRight=function(e){e=o(e,this.defaultRotateAmount),U(this,-e)},A.prototype.rotateLeft=function(e){e=o(e,this.defaultRotateAmount),U(this,e)},A.prototype.zoomIn=function(e){e=o(e,this.defaultZoomAmount),this._mode===x.SCENE2D?G(this,e):W(this,e)},A.prototype.zoomOut=function(e){e=o(e,this.defaultZoomAmount),this._mode===x.SCENE2D?G(this,-e):W(this,-e)},A.prototype.getMagnitude=function(){return this._mode===x.SCENE3D?i.magnitude(this.position):this._mode===x.COLUMBUS_VIEW?Math.abs(this.position.z):this._mode===x.SCENE2D?Math.max(this.frustum.right-this.frustum.left,this.frustum.top-this.frustum.bottom):void 0};var We=new v;A.prototype.lookAt=function(e,t){var i=S.eastNorthUpToFixedFrame(e,c.WGS84,We);this.lookAtTransform(i,t)};var He=new i,qe=new y,je=new y,Ye=new g;A.prototype.lookAtTransform=function(e,r){if(this._setTransform(e),a(r)){var n;if(n=a(r.heading)?H(r.heading,r.pitch,r.range):r,this._mode===x.SCENE2D){t.clone(t.ZERO,this.position),i.negate(n,this.up),this.up.z=0,i.magnitudeSquared(this.up)<_.EPSILON10&&i.clone(i.UNIT_Y,this.up),i.normalize(this.up,this.up),this._setTransform(v.IDENTITY),i.negate(i.UNIT_Z,this.direction),i.cross(this.direction,this.up,this.right),i.normalize(this.right,this.right);var o=this.frustum,s=o.top/o.right;return o.right=.5*i.magnitude(n),o.left=-o.right,o.top=s*o.right,o.bottom=-o.top,void this._setTransform(e)}i.clone(n,this.position),i.negate(this.position,this.direction),i.normalize(this.direction,this.direction),i.cross(this.direction,i.UNIT_Z,this.right),i.magnitudeSquared(this.right)<_.EPSILON10&&i.clone(i.UNIT_X,this.right),i.normalize(this.right,this.right),i.cross(this.right,this.direction,this.up),i.normalize(this.up,this.up)}};var Xe,Ze=new n,Ke=new n,Qe=new i,Je=new i,$e=new i,et=new i,tt=new i,it=new i,rt=new i,nt=new i,ot={direction:new i,right:new i,up:new i},at=new n,st=new i,lt=new i,ut=new n,ct=new i,ht=new i;A.prototype.getRectangleCameraCoordinates=function(e,t){var r=this._mode;return a(t)||(t=new i),r===x.SCENE3D?j(this,e,t):r===x.COLUMBUS_VIEW?Y(this,e,t):r===x.SCENE2D?X(this,e,t):void 0};var dt=new C,pt=new C,mt=new C;A.prototype.pickEllipsoid=function(e,t,r){if(a(r)||(r=new i),t=o(t,c.WGS84),this._mode===x.SCENE3D)r=Z(this,e,t,r);else if(this._mode===x.SCENE2D)r=K(this,e,this._projection,r);else{if(this._mode!==x.COLUMBUS_VIEW)return;r=Q(this,e,this._projection,r)}return r};var ft=new i,_t=new i,gt=new i,vt=new i;A.prototype.getPickRay=function(e,t){a(t)||(t=new C);var i=this.frustum;return a(i.aspectRatio)&&a(i.fov)&&a(i.near)?J(this,e,t):$(this,e,t)};var yt=new i,Ct=new i;A.prototype.distanceToBoundingSphere=function(e){var t=i.subtract(this.positionWC,e.center,yt),r=i.multiplyByScalar(this.directionWC,i.dot(t,this.directionWC),Ct);return Math.max(0,i.magnitude(r)-e.radius)};var wt=new t;A.prototype.getPixelSize=function(e,t,i){var r=this.distanceToBoundingSphere(e),n=this.frustum.getPixelDimensions(t,i,r,wt);return Math.max(n.x,n.y)};var St=new i,Et=new i,bt=new i,Tt=new i;A.prototype.createCorrectPositionTween=function(e){if(this._mode===x.COLUMBUS_VIEW)return te(this,e)};var xt=new i,At={destination:void 0,heading:void 0,pitch:void 0,roll:void 0,duration:void 0,complete:void 0,cancel:void 0,endTransform:void 0,maximumHeight:void 0,easingFunction:void 0};A.prototype.cancelFlight=function(){a(this._currentFlight)&&(this._currentFlight.cancelTween(),this._currentFlight=void 0)},A.prototype.flyTo=function(e){e=o(e,o.EMPTY_OBJECT);var t=e.destination,i=this._mode;if(i!==x.MORPHING){this.cancelFlight();var r=o(e.orientation,o.EMPTY_OBJECT);if(a(r.direction)&&(r=V(this,t,r,Re.orientation)),a(e.duration)&&e.duration<=0){var n=Re;return n.destination=e.destination,n.orientation.heading=r.heading,n.orientation.pitch=r.pitch,n.orientation.roll=r.roll,n.convert=e.convert,n.endTransform=e.endTransform,this.setView(n),void("function"==typeof e.complete&&e.complete())}var s=a(t.west);s&&(t=this.getRectangleCameraCoordinates(t,xt));var l,u=this;At.destination=t,At.heading=r.heading,At.pitch=r.pitch,At.roll=r.roll,At.duration=e.duration,At.complete=function(){l===u._currentFlight&&(u._currentFlight=void 0),a(e.complete)&&e.complete()},At.cancel=e.cancel,At.endTransform=e.endTransform,At.convert=!s&&e.convert,At.maximumHeight=e.maximumHeight,At.easingFunction=e.easingFunction;var c=this._scene;l=c.tweens.add(E.createTween(c,At)),this._currentFlight=l}};var Pt=new p(0,-_.PI_OVER_FOUR,0),Dt=100;A.prototype.viewBoundingSphere=function(e,t){t=ne(this,e,t),this.lookAt(e.center,t)};var Mt=new v,It=new i,Rt=new i,Ot=new i,Nt=new i,Lt=new r,Bt=new y,Ft=new g;A.prototype.flyToBoundingSphere=function(e,t){t=o(t,o.EMPTY_OBJECT);var r=this._mode===x.SCENE2D||this._mode===x.COLUMBUS_VIEW;this._setTransform(v.IDENTITY);var n,a=ne(this,e,t.offset);n=r?i.multiplyByScalar(i.UNIT_Z,a.range,It):H(a.heading,a.pitch,a.range);var s=S.eastNorthUpToFixedFrame(e.center,c.WGS84,Mt);v.multiplyByPoint(s,n,n);var l,u;if(!r){if(l=i.subtract(e.center,n,Rt),i.normalize(l,l),u=v.multiplyByPointAsVector(s,i.UNIT_Z,Ot),1-Math.abs(i.dot(l,u))<_.EPSILON6){var h=y.fromAxisAngle(l,a.heading,Bt),d=g.fromQuaternion(h,Ft);i.fromCartesian4(v.getColumn(s,1,Lt),u),g.multiplyByVector(d,u,u)}var p=i.cross(l,u,Nt);i.cross(p,l,u),i.normalize(u,u)}this.flyTo({destination:n,orientation:{direction:l,up:u},duration:t.duration,complete:t.complete,cancel:t.cancel,endTransform:t.endTransform,maximumHeight:t.maximumHeight,easingFunction:t.easingFunction})};var Vt=new i,kt=new i,zt=new i,Ut=new i,Gt=[new i,new i,new i,new i],Wt=new t,Ht=new i,qt=[new n,new n,new n,new n];return A.prototype.computeViewRectangle=function(t,r){t=o(t,c.WGS84);var n=this.frustum.computeCullingVolume(this.positionWC,this.directionWC,this.upWC),a=new e(i.ZERO,t.maximumRadius),s=n.computeVisibility(a);if(s!==m.OUTSIDE){var l=this._scene.canvas,u=l.clientWidth,h=l.clientHeight,d=0,p=oe(this,t);if(d+=ae(0,0,0,this,t,p),d+=ae(0,h,1,this,t,p),d+=ae(u,h,2,this,t,p),d+=ae(u,0,3,this,t,p),d<2)return w.MAX_VALUE;r=w.fromCartographicArray(qt,r);for(var f=0,g=qt[3].longitude,v=0;v<4;++v){var y=qt[v].longitude,C=Math.abs(y-g);f+=C>_.PI?_.TWO_PI-C:C,g=y}return _.equalsEpsilon(Math.abs(f),_.TWO_PI,_.EPSILON9)&&(r.west=-_.PI,r.east=_.PI,qt[0].latitude>=0?r.north=_.PI_OVER_TWO:r.south=-_.PI_OVER_TWO),r}},A.clone=function(e,t){return a(t)||(t=new A(e._scene)),i.clone(e.position,t.position),i.clone(e.direction,t.direction),i.clone(e.up,t.up),i.clone(e.right,t.right),v.clone(e._transform,t.transform),t._transformChanged=!0,t},A}),i("Scene/CameraEventType",["../Core/freezeObject"],function(e){"use strict";var t={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4};return e(t)}),i("Scene/CameraEventAggregator",["../Core/Cartesian2","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/KeyboardEventModifier","../Core/Math","../Core/ScreenSpaceEventHandler","../Core/ScreenSpaceEventType","./CameraEventType"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e,i){var r=e;return t(i)&&(r+="+"+i),r}function h(t,i){e.clone(t.distance.startPosition,i.distance.startPosition),e.clone(t.distance.endPosition,i.distance.endPosition),e.clone(t.angleAndHeight.startPosition,i.angleAndHeight.startPosition),e.clone(t.angleAndHeight.endPosition,i.angleAndHeight.endPosition)}function d(i,r,n){var o=c(u.PINCH,r),a=i._update,s=i._isDown,d=i._eventStartPosition,p=i._pressTime,m=i._releaseTime;a[o]=!0,s[o]=!1,d[o]=new e;var f=i._movement[o];t(f)||(f=i._movement[o]={}),f.distance={startPosition:new e,endPosition:new e},f.angleAndHeight={startPosition:new e,endPosition:new e},f.prevAngle=0,i._eventHandler.setInputAction(function(t){i._buttonsDown++,s[o]=!0,p[o]=new Date,e.lerp(t.position1,t.position2,.5,d[o])},l.PINCH_START,r),i._eventHandler.setInputAction(function(){i._buttonsDown=Math.max(i._buttonsDown-1,0),s[o]=!1,m[o]=new Date},l.PINCH_END,r),i._eventHandler.setInputAction(function(t){if(s[o]){a[o]?(h(t,f),a[o]=!1,f.prevAngle=f.angleAndHeight.startPosition.x):(e.clone(t.distance.endPosition,f.distance.endPosition),e.clone(t.angleAndHeight.endPosition,f.angleAndHeight.endPosition));for(var i=f.angleAndHeight.endPosition.x,r=f.prevAngle,l=2*Math.PI;i>=r+Math.PI;)i-=l;for(;i<r-Math.PI;)i+=l;f.angleAndHeight.endPosition.x=-i*n.clientWidth/12,f.angleAndHeight.startPosition.x=-r*n.clientWidth/12}},l.PINCH_MOVE,r)}function p(i,r){var n=c(u.WHEEL,r),o=i._update;o[n]=!0;var s=i._movement[n];t(s)||(s=i._movement[n]={}),s.startPosition=new e,s.endPosition=new e,i._eventHandler.setInputAction(function(t){var i=15*a.toRadians(t);o[n]?(e.clone(e.ZERO,s.startPosition),s.endPosition.x=0,s.endPosition.y=i,o[n]=!1):s.endPosition.y=s.endPosition.y+i},l.WHEEL,r)}function m(i,r,n){var o=c(n,r),a=i._isDown,s=i._eventStartPosition,h=i._pressTime,d=i._releaseTime;a[o]=!1,s[o]=new e;var p=i._lastMovement[o];t(p)||(p=i._lastMovement[o]={startPosition:new e,endPosition:new e,valid:!1});var m,f;n===u.LEFT_DRAG?(m=l.LEFT_DOWN,f=l.LEFT_UP):n===u.RIGHT_DRAG?(m=l.RIGHT_DOWN,f=l.RIGHT_UP):n===u.MIDDLE_DRAG&&(m=l.MIDDLE_DOWN,f=l.MIDDLE_UP),i._eventHandler.setInputAction(function(t){i._buttonsDown++,p.valid=!1,a[o]=!0,h[o]=new Date,e.clone(t.position,s[o])},m,r),i._eventHandler.setInputAction(function(){i._buttonsDown=Math.max(i._buttonsDown-1,0),a[o]=!1,d[o]=new Date},f,r)}function f(t,i){e.clone(t.startPosition,i.startPosition),e.clone(t.endPosition,i.endPosition)}function _(i,r){var n=i._update,o=i._movement,a=i._lastMovement,s=i._isDown;for(var h in u)if(u.hasOwnProperty(h)){var d=u[h];if(t(d)){var p=c(d,r);n[p]=!0,t(i._lastMovement[p])||(i._lastMovement[p]={startPosition:new e,endPosition:new e,valid:!1}),t(i._movement[p])||(i._movement[p]={startPosition:new e,endPosition:new e})}}i._eventHandler.setInputAction(function(l){for(var h in u)if(u.hasOwnProperty(h)){var d=u[h];if(t(d)){var p=c(d,r);s[p]&&(n[p]?(f(o[p],a[p]),a[p].valid=!0,f(l,o[p]),n[p]=!1):e.clone(l.endPosition,o[p].endPosition))}}e.clone(l.endPosition,i._currentMousePosition); +},l.MOUSE_MOVE,r)}function g(i){this._eventHandler=new s(i,!0),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new e,p(this,void 0),d(this,void 0,i),m(this,void 0,u.LEFT_DRAG),m(this,void 0,u.RIGHT_DRAG),m(this,void 0,u.MIDDLE_DRAG),_(this,void 0);for(var r in o)if(o.hasOwnProperty(r)){var n=o[r];t(n)&&(p(this,n),d(this,n,i),m(this,n,u.LEFT_DRAG),m(this,n,u.RIGHT_DRAG),m(this,n,u.MIDDLE_DRAG),_(this,n))}}return i(g.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){var e=!(this._update[c(u.WHEEL)]&&this._update[c(u.WHEEL,o.SHIFT)]&&this._update[c(u.WHEEL,o.CTRL)]&&this._update[c(u.WHEEL,o.ALT)]);return this._buttonsDown>0||e}}}),g.prototype.isMoving=function(e,t){var i=c(e,t);return!this._update[i]},g.prototype.getMovement=function(e,t){var i=c(e,t),r=this._movement[i];return r},g.prototype.getLastMovement=function(e,t){var i=c(e,t),r=this._lastMovement[i];if(r.valid)return r},g.prototype.isButtonDown=function(e,t){var i=c(e,t);return this._isDown[i]},g.prototype.getStartMousePosition=function(e,t){if(e===u.WHEEL)return this._currentMousePosition;var i=c(e,t);return this._eventStartPosition[i]},g.prototype.getButtonPressTime=function(e,t){var i=c(e,t);return this._pressTime[i]},g.prototype.getButtonReleaseTime=function(e,t){var i=c(e,t);return this._releaseTime[i]},g.prototype.reset=function(){for(var e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)},g.prototype.isDestroyed=function(){return!1},g.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),r(this)},g}),i("Scene/UrlTemplateImageryProvider",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/combine","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/GeographicTilingScheme","../Core/isArray","../Core/loadJson","../Core/loadText","../Core/loadWithXhr","../Core/loadXML","../Core/Math","../Core/Rectangle","../Core/WebMercatorTilingScheme","../ThirdParty/when","./ImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C){"use strict";function w(e){this._errorEvent=new u,this._url=void 0,this._urlSchemeZeroPadding=void 0,this._pickFeaturesUrl=void 0,this._proxy=void 0,this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._minimumLevel=void 0,this._tilingScheme=void 0,this._rectangle=void 0,this._tileDiscardPolicy=void 0,this._credit=void 0,this._hasAlphaChannel=void 0,this._readyPromise=void 0,this.enablePickFeatures=!0,this.reinitialize(e)}function S(e,t,i,r){return re=!1,oe=!1,b(e,e._urlParts,function(n){return n(e,t,i,r)})}function E(e,t,i,r,n,o,a){return re=!1,oe=!1,se=!1,ce=!1,b(e,e._pickFeaturesUrlParts,function(s){return s(e,t,i,r,n,o,a)})}function b(e,t,i){for(var r="",n=0;n<t.length;++n){var o=t[n];r+="string"==typeof o?o:encodeURIComponent(i(o))}var s=e._proxy;return a(s)&&(r=s.getURL(r)),r}function T(e,t){if(a(e)){for(var i,r,n=[],o=0,s=Object.keys(t);o<e.length;){i=Number.MAX_VALUE,r=void 0;for(var l=0;l<s.length;++l){var u=e.indexOf(s[l],o);u>=0&&u<i&&(i=u,r=s[l])}a(r)?(o<i&&n.push(e.substring(o,i)),n.push(t[r]),o=i+r.length):(n.push(e.substring(o)),o=e.length)}return n}}function x(e,t,i){if(e&&e.urlSchemeZeroPadding&&e.urlSchemeZeroPadding.hasOwnProperty(t)){var r=e.urlSchemeZeroPadding[t];if("string"==typeof r){var n=r.length;n>1&&(i=i.length>=n?i:new Array(n-i.toString().length+1).join("0")+i)}}return i}function A(e,t,i,r){return x(e,"{x}",t)}function P(e,t,i,r){var n=e.tilingScheme.getNumberOfXTilesAtLevel(r)-t-1;return x(e,"{reverseX}",n)}function D(e,t,i,r){return x(e,"{y}",i)}function M(e,t,i,r){var n=e.tilingScheme.getNumberOfYTilesAtLevel(r)-i-1;return x(e,"{reverseY}",n)}function I(e,t,i,r){var n=e.maximumLevel,o=a(n)&&r<n?n-r-1:r;return x(e,"{reverseZ}",o)}function R(e,t,i,r){return x(e,"{z}",r)}function O(e,t,i,r){var n=(t+i+r)%e._subdomains.length;return e._subdomains[n]}function N(e,t,i,r){re||(e.tilingScheme.tileXYToRectangle(t,i,r,ne),ne.west=_.toDegrees(ne.west),ne.south=_.toDegrees(ne.south),ne.east=_.toDegrees(ne.east),ne.north=_.toDegrees(ne.north),re=!0)}function L(e,t,i,r){return N(e,t,i,r),ne.west}function B(e,t,i,r){return N(e,t,i,r),ne.south}function F(e,t,i,r){return N(e,t,i,r),ne.east}function V(e,t,i,r){return N(e,t,i,r),ne.north}function k(e,t,i,r){oe||(e.tilingScheme.tileXYToNativeRectangle(t,i,r,ae),oe=!0)}function z(e,t,i,r){return k(e,t,i,r),ae.west}function U(e,t,i,r){return k(e,t,i,r),ae.south}function G(e,t,i,r){return k(e,t,i,r),ae.east}function W(e,t,i,r){return k(e,t,i,r),ae.north}function H(e,t,i,r){return e.tileWidth}function q(e,t,i,r){return e.tileHeight}function j(e,t,i,r,n,o,a){return K(e,t,i,r,n,o),le.x}function Y(e,t,i,r,n,o,a){return K(e,t,i,r,n,o),le.y}function X(e,t,i,r,n,o,a){return K(e,t,i,r,n,o),e.tileWidth-le.x-1}function Z(e,t,i,r,n,o,a){return K(e,t,i,r,n,o),e.tileHeight-le.y-1}function K(e,t,i,r,n,o,a){if(!se){te(e,t,i,r,n,o);var s=he,l=e.tilingScheme.tileXYToNativeRectangle(t,i,r,ue);le.x=e.tileWidth*(s.x-l.west)/l.width|0,le.y=e.tileHeight*(l.north-s.y)/l.height|0,se=!0}}function Q(e,t,i,r,n,o,a){return _.toDegrees(n)}function J(e,t,i,r,n,o,a){return _.toDegrees(o)}function $(e,t,i,r,n,o,a){return te(e,t,i,r,n,o),he.x}function ee(e,t,i,r,n,o,a){return te(e,t,i,r,n,o),he.y}function te(e,t,i,r,n,o,a){if(!ce){var s;if(e.tilingScheme instanceof c)he.x=_.toDegrees(n),he.y=_.toDegrees(o);else{var l=de;l.longitude=n,l.latitude=o,s=e.tilingScheme.projection.project(l,he)}ce=!0}}function ie(e,t,i,r,n,o,a){return a}s(w.prototype,{url:{get:function(){return this._url}},urlSchemeZeroPadding:{get:function(){return this._urlSchemeZeroPadding}},pickFeaturesUrl:{get:function(){return this._pickFeaturesUrl}},proxy:{get:function(){return this._proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return a(this._urlParts)}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return this._hasAlphaChannel}}}),w.prototype.reinitialize=function(e){var t=this;t._readyPromise=y(e).then(function(e){t.enablePickFeatures=o(e.enablePickFeatures,t.enablePickFeatures),t._url=e.url,t._urlSchemeZeroPadding=o(e.urlSchemeZeroPadding,t.urlSchemeZeroPadding),t._pickFeaturesUrl=e.pickFeaturesUrl,t._proxy=e.proxy,t._tileDiscardPolicy=e.tileDiscardPolicy,t._getFeatureInfoFormats=e.getFeatureInfoFormats,t._subdomains=e.subdomains,h(t._subdomains)?t._subdomains=t._subdomains.slice():a(t._subdomains)&&t._subdomains.length>0?t._subdomains=t._subdomains.split(""):t._subdomains=["a","b","c"],t._tileWidth=o(e.tileWidth,256),t._tileHeight=o(e.tileHeight,256),t._minimumLevel=o(e.minimumLevel,0),t._maximumLevel=e.maximumLevel,t._tilingScheme=o(e.tilingScheme,new v({ellipsoid:e.ellipsoid})),t._rectangle=o(e.rectangle,t._tilingScheme.rectangle),t._rectangle=g.intersection(t._rectangle,t._tilingScheme.rectangle),t._hasAlphaChannel=o(e.hasAlphaChannel,!0);var i=e.credit;return"string"==typeof i&&(i=new n(i)),t._credit=i,t._urlParts=T(t._url,pe),t._pickFeaturesUrlParts=T(t._pickFeaturesUrl,me),!0})},w.prototype.getTileCredits=function(e,t,i){},w.prototype.requestImage=function(e,t,i){var r=S(this,e,t,i);return C.loadImage(this,r)},w.prototype.pickFeatures=function(e,t,i,r,n){function o(e,t){return e.callback(t)}function s(){if(l>=u._getFeatureInfoFormats.length)return y([]);var a=u._getFeatureInfoFormats[l],c=E(u,e,t,i,r,n,a.format);return++l,"json"===a.type?d(c).then(a.callback).otherwise(s):"xml"===a.type?f(c).then(a.callback).otherwise(s):"text"===a.type||"html"===a.type?p(c).then(a.callback).otherwise(s):m({url:c,responseType:a.format}).then(o.bind(void 0,a)).otherwise(s)}if(this.enablePickFeatures&&a(this._pickFeaturesUrl)&&0!==this._getFeatureInfoFormats.length){var l=0,u=this;return s()}};var re=!1,ne=new g,oe=!1,ae=new g,se=!1,le=new e,ue=new g,ce=!1,he=new t,de=new i,pe={"{x}":A,"{y}":D,"{z}":R,"{s}":O,"{reverseX}":P,"{reverseY}":M,"{reverseZ}":I,"{westDegrees}":L,"{southDegrees}":B,"{eastDegrees}":F,"{northDegrees}":V,"{westProjected}":z,"{southProjected}":U,"{eastProjected}":G,"{northProjected}":W,"{width}":H,"{height}":q},me=r(pe,{"{i}":j,"{j}":Y,"{reverseI}":X,"{reverseJ}":Z,"{longitudeDegrees}":Q,"{latitudeDegrees}":J,"{longitudeProjected}":$,"{latitudeProjected}":ee,"{format}":ie});return w}),i("Scene/createOpenStreetMapImageryProvider",["../Core/Credit","../Core/defaultValue","../Core/DeveloperError","../Core/Rectangle","../Core/WebMercatorTilingScheme","./UrlTemplateImageryProvider"],function(e,t,i,r,n,o){"use strict";function a(i){i=t(i,{});var a=t(i.url,"https://a.tile.openstreetmap.org/");s.test(a)||(a+="/");var u=t(i.fileExtension,"png"),c=new n({ellipsoid:i.ellipsoid}),h=256,d=256,p=t(i.minimumLevel,0),m=i.maximumLevel,f=t(i.rectangle,c.rectangle),_=c.positionToTileXY(r.southwest(f),p),g=c.positionToTileXY(r.northeast(f),p),v=((Math.abs(g.x-_.x)+1)*(Math.abs(g.y-_.y)+1),t(i.credit,l));"string"==typeof v&&(v=new e(v));var y=a+"{z}/{x}/{y}."+u;return new o({url:y,proxy:i.proxy,credit:v,tilingScheme:c,tileWidth:h,tileHeight:d,minimumLevel:p,maximumLevel:m,rectangle:f})}var s=/\/$/,l=new e("MapQuest, Open Street Map and contributors, CC-BY-SA");return a}),i("Scene/createTangentSpaceDebugPrimitive",["../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/GeometryInstance","../Core/GeometryPipeline","../Core/Matrix4","./PerInstanceColorAppearance","./Primitive"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(r){r=t(r,t.EMPTY_OBJECT);var u=[],c=r.geometry;i(c.attributes)&&i(c.primitiveType)||(c=c.constructor.createGeometry(c));var h=c.attributes,d=a.clone(t(r.modelMatrix,a.IDENTITY)),p=t(r.length,1e4);if(i(h.normal)&&u.push(new n({geometry:o.createLineSegmentsForVectors(c,"normal",p),attributes:{color:new e(1,0,0,1)},modelMatrix:d})),i(h.tangent)&&u.push(new n({geometry:o.createLineSegmentsForVectors(c,"tangent",p),attributes:{color:new e(0,1,0,1)},modelMatrix:d})),i(h.bitangent)&&u.push(new n({geometry:o.createLineSegmentsForVectors(c,"bitangent",p),attributes:{color:new e(0,0,1,1)},modelMatrix:d})),u.length>0)return new l({asynchronous:!1,geometryInstances:u,appearance:new s({flat:!0,translucent:!1})})}return u}),i("Scene/createTileMapServiceImageryProvider",["../Core/Cartesian2","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/GeographicTilingScheme","../Core/joinUrls","../Core/loadXML","../Core/Rectangle","../Core/RuntimeError","../Core/TileProviderError","../Core/WebMercatorTilingScheme","../ThirdParty/when","./UrlTemplateImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p){"use strict";function m(n){function m(s){for(var d,p,m,f,w=/tileformat/i,S=/tileset/i,E=/tilesets/i,b=/boundingbox/i,T=/srs/i,x=[],A=s.childNodes[0].childNodes,P=0;P<A.length;P++)if(w.test(A.item(P).nodeName))d=A.item(P);else if(E.test(A.item(P).nodeName)){m=A.item(P);for(var D=A.item(P).childNodes,M=0;M<D.length;M++)S.test(D.item(M).nodeName)&&x.push(D.item(M))}else b.test(A.item(P).nodeName)?p=A.item(P):T.test(A.item(P).nodeName)&&(f=A.item(P).textContent);var I=i(n.fileExtension,d.getAttribute("extension")),R=i(n.tileWidth,parseInt(d.getAttribute("width"),10)),O=i(n.tileHeight,parseInt(d.getAttribute("height"),10)),N=i(n.minimumLevel,parseInt(x[0].getAttribute("order"),10)),L=i(n.maximumLevel,parseInt(x[x.length-1].getAttribute("order"),10)),B=m.getAttribute("profile"),F=n.tilingScheme;if(!r(F))if("geodetic"===B||"global-geodetic"===B)F=new o({ellipsoid:n.ellipsoid});else{if("mercator"!==B&&"global-mercator"!==B){var V=a(v,"tilemapresource.xml")+"specifies an unsupported profile attribute, "+B+".";return g=c.handleError(g,C,C.errorEvent,V,void 0,void 0,void 0,_),void(g.retry||y.reject(new u(V)))}F=new h({ellipsoid:n.ellipsoid})}var k=l.clone(n.rectangle);if(!r(k)){var z,U,G,W,H=i(n.flipXY,!1);H?(G=new e(parseFloat(p.getAttribute("miny")),parseFloat(p.getAttribute("minx"))),W=new e(parseFloat(p.getAttribute("maxy")),parseFloat(p.getAttribute("maxx")))):(G=new e(parseFloat(p.getAttribute("minx")),parseFloat(p.getAttribute("miny"))),W=new e(parseFloat(p.getAttribute("maxx")),parseFloat(p.getAttribute("maxy"))));var q="geodetic"===B||"mercator"===B;if(F instanceof o||q)z=t.fromDegrees(G.x,G.y),U=t.fromDegrees(W.x,W.y);else{var j=F.projection;z=j.unproject(G),U=j.unproject(W)}k=new l(z.longitude,z.latitude,U.longitude,U.latitude)}k.west<F.rectangle.west&&(k.west=F.rectangle.west),k.east>F.rectangle.east&&(k.east=F.rectangle.east),k.south<F.rectangle.south&&(k.south=F.rectangle.south),k.north>F.rectangle.north&&(k.north=F.rectangle.north);var Y=F.positionToTileXY(l.southwest(k),N),X=F.positionToTileXY(l.northeast(k),N),Z=(Math.abs(X.x-Y.x)+1)*(Math.abs(X.y-Y.y)+1);Z>4&&(N=0);var K=a(v,"{z}/{x}/{reverseY}."+I);y.resolve({url:K,tilingScheme:F,rectangle:k,tileWidth:R,tileHeight:O,minimumLevel:N,maximumLevel:L,proxy:n.proxy,tileDiscardPolicy:n.tileDiscardPolicy,credit:n.credit})}function f(e){var t=i(n.fileExtension,"png"),o=i(n.tileWidth,256),s=i(n.tileHeight,256),l=i(n.minimumLevel,0),u=n.maximumLevel,c=r(n.tilingScheme)?n.tilingScheme:new h({ellipsoid:n.ellipsoid}),d=i(n.rectangle,c.rectangle),p=a(v,"{z}/{x}/{reverseY}."+t);y.resolve({url:p,tilingScheme:c,rectangle:d,tileWidth:o,tileHeight:s,minimumLevel:l,maximumLevel:u,proxy:n.proxy,tileDiscardPolicy:n.tileDiscardPolicy,credit:n.credit})}function _(){var e=a(v,"tilemapresource.xml"),t=n.proxy;r(t)&&(e=t.getURL(e)),s(e).then(m).otherwise(f)}n=i(n,{});var g,v=n.url,y=d.defer(),C=new p(y.promise);return _(),C}return m}),i("Scene/CreditDisplay",["../Core/Credit","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError"],function(e,t,i,r,n){"use strict";function o(e,t,r){if(!i(e.element)){var n=e.text,o=e.link,a=document.createElement("span");if(e.hasLink()){var s=document.createElement("a");s.textContent=n,s.href=o,s.target="_blank",a.appendChild(s)}else a.textContent=n;a.className="cesium-credit-text",e.element=a}if(t.hasChildNodes()){var l=document.createElement("span");l.textContent=r,l.className="cesium-credit-delimiter",t.appendChild(l)}t.appendChild(e.element)}function a(e,t){if(!i(e.element)){var r=e.text,n=e.link,o=document.createElement("span"),a=document.createElement("img");if(a.src=e.imageUrl,a.style["vertical-align"]="bottom",i(r)&&(a.alt=r,a.title=r),e.hasLink()){var s=document.createElement("a");s.appendChild(a),s.href=n,s.target="_blank",o.appendChild(s)}else o.appendChild(a);o.className="cesium-credit-image",e.element=o}t.appendChild(e.element)}function s(t,i){for(var r=t.length,n=0;n<r;n++){var o=t[n];if(e.equals(o,i))return!0}return!1}function l(e){var t=e.element;if(i(t)){var r=t.parentNode;if(!e.hasImage()){var n=t.previousSibling;null===n&&(n=t.nextSibling),null!==n&&r.removeChild(n)}r.removeChild(t)}}function u(e,t){var r,n,a,s=e._displayedCredits.textCredits;for(r=0;r<t.length;r++)a=t[r],i(a)&&(n=s.indexOf(a),n===-1?o(a,e._textContainer,e._delimiter):s.splice(n,1));for(r=0;r<s.length;r++)a=s[r],i(a)&&l(a)}function c(e,t){var r,n,o,s=e._displayedCredits.imageCredits;for(r=0;r<t.length;r++)o=t[r],i(o)&&(n=s.indexOf(o),n===-1?a(o,e._imageContainer):s.splice(n,1));for(r=0;r<s.length;r++)o=s[r],i(o)&&l(o)}function h(e,i){var r=document.createElement("span");r.className="cesium-credit-imageContainer";var n=document.createElement("span");n.className="cesium-credit-textContainer",e.appendChild(r),e.appendChild(n),this._delimiter=t(i," • "),this._textContainer=n,this._imageContainer=r,this._defaultImageCredits=[],this._defaultTextCredits=[],this._displayedCredits={imageCredits:[],textCredits:[]},this._currentFrameCredits={imageCredits:[],textCredits:[]},this.container=e}return h.prototype.addCredit=function(e){if(e.hasImage()){var t=this._currentFrameCredits.imageCredits;s(this._defaultImageCredits,e)||(t[e.id]=e)}else{var i=this._currentFrameCredits.textCredits;s(this._defaultTextCredits,e)||(i[e.id]=e)}},h.prototype.addDefaultCredit=function(e){if(e.hasImage()){var t=this._defaultImageCredits;s(t,e)||t.push(e)}else{var i=this._defaultTextCredits;s(i,e)||i.push(e)}},h.prototype.removeDefaultCredit=function(e){var t;e.hasImage()?(t=this._defaultImageCredits.indexOf(e),t!==-1&&this._defaultImageCredits.splice(t,1)):(t=this._defaultTextCredits.indexOf(e),t!==-1&&this._defaultTextCredits.splice(t,1))},h.prototype.beginFrame=function(){this._currentFrameCredits.imageCredits.length=0,this._currentFrameCredits.textCredits.length=0},h.prototype.endFrame=function(){var e=this._defaultTextCredits.concat(this._currentFrameCredits.textCredits),t=this._defaultImageCredits.concat(this._currentFrameCredits.imageCredits);u(this,e),c(this,t),this._displayedCredits.textCredits=e,this._displayedCredits.imageCredits=t},h.prototype.destroy=function(){return this.container.removeChild(this._textContainer),this.container.removeChild(this._imageContainer),r(this)},h.prototype.isDestroyed=function(){return!1},h}),i("Scene/DebugAppearance",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","./Appearance"],function(e,t,i,r,n){"use strict";function o(i){i=e(i,e.EMPTY_OBJECT);var r=i.attributeName,o=i.perInstanceAttribute;t(o)||(o=!1);var a,s=e(i.glslDatatype,"vec3"),l="v_"+r;if("normal"===r||"tangent"===r||"bitangent"===r)a="vec4 getColor() { return vec4(("+l+" + vec3(1.0)) * 0.5, 1.0); }\n";else switch("st"===r&&(s="vec2"),s){case"float":a="vec4 getColor() { return vec4(vec3("+l+"), 1.0); }\n";break;case"vec2":a="vec4 getColor() { return vec4("+l+", 0.0, 1.0); }\n";break;case"vec3":a="vec4 getColor() { return vec4("+l+", 1.0); }\n";break;case"vec4":a="vec4 getColor() { return "+l+"; }\n"}var u="attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute float batchId;\n"+(o?"":"attribute "+s+" "+r+";\n")+"varying "+s+" "+l+";\nvoid main()\n{\nvec4 p = czm_translateRelativeToEye(position3DHigh, position3DLow);\n"+(o?l+" = czm_batchTable_"+r+"(batchId);\n":l+" = "+r+";\n")+"gl_Position = czm_modelViewProjectionRelativeToEye * p;\n}",c="varying "+s+" "+l+";\n"+a+"\nvoid main()\n{\ngl_FragColor = getColor();\n}";this.material=void 0,this.translucent=e(i.translucent,!1),this._vertexShaderSource=e(i.vertexShaderSource,u),this._fragmentShaderSource=e(i.fragmentShaderSource,c),this._renderState=n.getDefaultRenderState(!1,!1,i.renderState),this._closed=e(i.closed,!1),this._attributeName=r,this._glslDatatype=s}return i(o.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},attributeName:{get:function(){return this._attributeName}},glslDatatype:{get:function(){return this._glslDatatype}}}),o.prototype.getFragmentShaderSource=n.prototype.getFragmentShaderSource,o.prototype.isTranslucent=n.prototype.isTranslucent,o.prototype.getRenderState=n.prototype.getRenderState,o}),i("Scene/DebugCameraPrimitive",["../Core/BoundingSphere","../Core/Cartesian3","../Core/Cartesian4","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/GeometryAttribute","../Core/GeometryAttributes","../Core/GeometryInstance","../Core/Matrix4","../Core/PrimitiveType","./PerInstanceColorAppearance","./Primitive"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_){"use strict";function g(e){e=a(e,a.EMPTY_OBJECT),this._camera=e.camera,this._color=a(e.color,r.CYAN),this._updateOnChange=a(e.updateOnChange,!0),this.show=a(e.show,!0),this.id=e.id,this._id=void 0,this._outlinePrimitive=void 0,this._planesPrimitive=void 0}var v=new Array(8);v[0]=new i(-1,-1,-1,1),v[1]=new i(1,-1,-1,1),v[2]=new i(1,1,-1,1),v[3]=new i(-1,1,-1,1),v[4]=new i(-1,-1,1,1),v[5]=new i(1,-1,1,1),v[6]=new i(1,1,1,1),v[7]=new i(-1,1,1,1);for(var y=new p,C=new Array(8),w=0;w<8;++w)C[w]=new i;var S=new r;return g.prototype.update=function(a){if(this.show){if(this._updateOnChange&&(this._outlinePrimitive=this._outlinePrimitive&&this._outlinePrimitive.destroy(),this._planesPrimitive=this._planesPrimitive&&this._planesPrimitive.destroy()),!s(this._outlinePrimitive)){for(var l=this._camera.viewMatrix,u=this._camera.frustum.projectionMatrix,g=p.multiply(u,l,y),w=p.inverse(g,y),E=new Float64Array(24),b=0;b<8;++b){var T=i.clone(v[b],C[b]);p.multiplyByVector(w,T,T),t.divideByScalar(T,T.w,T),E[3*b]=T.x,E[3*b+1]=T.y,E[3*b+2]=T.z}var x=new e.fromVertices(E),A=new h;A.position=new c({componentDatatype:o.DOUBLE,componentsPerAttribute:3,values:E});var P=new Uint16Array([0,1,1,2,2,3,3,0,0,4,4,7,7,3,7,6,6,2,2,1,1,5,5,4,5,6]);this._outlinePrimitive=new _({geometryInstances:new d({geometry:{attributes:A,indices:P,primitiveType:m.LINES,boundingSphere:x},attributes:{color:n.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new f({translucent:!1,flat:!0}),asynchronous:!1});var D=new Uint16Array([4,5,6,4,6,7,5,1,2,5,2,6,7,6,2,7,2,3,0,1,5,0,5,4,0,4,7,0,7,3,1,0,3,1,3,2]);this._planesPrimitive=new _({geometryInstances:new d({geometry:{attributes:A,indices:D,primitiveType:m.TRIANGLES,boundingSphere:x},attributes:{color:n.fromColor(r.fromAlpha(this._color,.1,S))},id:this.id,pickPrimitive:this}),appearance:new f({translucent:!0,flat:!0}),asynchronous:!1})}this._outlinePrimitive.update(a),this._planesPrimitive.update(a)}},g.prototype.isDestroyed=function(){return!1},g.prototype.destroy=function(){return this._outlinePrimitive=this._outlinePrimitive&&this._outlinePrimitive.destroy(),this._planesPrimitive=this._planesPrimitive&&this._planesPrimitive.destroy(),l(this)},g}),i("Scene/DebugModelMatrixPrimitive",["../Core/Cartesian3","../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/GeometryInstance","../Core/Matrix4","../Core/PolylineGeometry","./PolylineColorAppearance","./Primitive"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e){e=i(e,i.EMPTY_OBJECT),this.length=i(e.length,1e7),this._length=void 0,this.width=i(e.width,2),this._width=void 0,this.show=i(e.show,!0),this.modelMatrix=a.clone(i(e.modelMatrix,a.IDENTITY)),this._modelMatrix=new a,this.id=e.id,this._id=void 0,this._primitive=void 0}return c.prototype.update=function(i){if(this.show){if(!r(this._primitive)||!a.equals(this._modelMatrix,this.modelMatrix)||this._length!==this.length||this._width!==this.width||this._id!==this.id){this._modelMatrix=a.clone(this.modelMatrix,this._modelMatrix),this._length=this.length,this._width=this.width,this._id=this.id,r(this._primitive)&&this._primitive.destroy(),0===this.modelMatrix[12]&&0===this.modelMatrix[13]&&0===this.modelMatrix[14]&&(this.modelMatrix[14]=.01);var n=new o({geometry:new s({positions:[e.ZERO,e.UNIT_X],width:this.width,vertexFormat:l.VERTEX_FORMAT,colors:[t.RED,t.RED],followSurface:!1}),modelMatrix:a.multiplyByUniformScale(this.modelMatrix,this.length,new a),id:this.id,pickPrimitive:this}),c=new o({geometry:new s({positions:[e.ZERO,e.UNIT_Y],width:this.width,vertexFormat:l.VERTEX_FORMAT,colors:[t.GREEN,t.GREEN],followSurface:!1}),modelMatrix:a.multiplyByUniformScale(this.modelMatrix,this.length,new a),id:this.id,pickPrimitive:this}),h=new o({geometry:new s({positions:[e.ZERO,e.UNIT_Z],width:this.width,vertexFormat:l.VERTEX_FORMAT,colors:[t.BLUE,t.BLUE],followSurface:!1}),modelMatrix:a.multiplyByUniformScale(this.modelMatrix,this.length,new a),id:this.id,pickPrimitive:this});this._primitive=new u({geometryInstances:[n,c,h],appearance:new l,asynchronous:!1})}this._primitive.update(i)}},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),n(this)},c}),i("Shaders/DepthPlaneFS",[],function(){"use strict";return"varying vec4 positionEC;\nvoid main()\n{\nczm_ellipsoid ellipsoid = czm_getWgs84EllipsoidEC();\nvec3 direction = normalize(positionEC.xyz);\nczm_ray ray = czm_ray(vec3(0.0), direction);\nczm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid);\nif (!czm_isEmpty(intersection))\n{\ngl_FragColor = vec4(1.0, 1.0, 0.0, 1.0);\n}\nelse\n{\ndiscard;\n}\n}\n"}),i("Shaders/DepthPlaneVS",[],function(){"use strict";return"attribute vec4 position;\nvarying vec4 positionEC;\nvoid main()\n{\npositionEC = czm_modelView * position;\ngl_Position = czm_projection * positionEC;\n}\n"}),i("Scene/DepthPlane",["../Core/BoundingSphere","../Core/Cartesian3","../Core/ComponentDatatype","../Core/defined","../Core/FeatureDetection","../Core/Geometry","../Core/GeometryAttribute","../Core/PrimitiveType","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/VertexArray","../Shaders/DepthPlaneFS","../Shaders/DepthPlaneVS","./DepthFunction","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g){"use strict";function v(){this._rs=void 0,this._sp=void 0,this._va=void 0,this._command=void 0,this._mode=void 0}function y(e,i){var r=e.radii,n=i.camera.positionWC,o=t.multiplyComponents(e.oneOverRadii,n,w),a=t.magnitude(o),s=t.normalize(o,S),l=t.normalize(t.cross(t.UNIT_Z,o,E),E),u=t.normalize(t.cross(s,l,b),b),c=Math.sqrt(t.magnitudeSquared(o)-1),h=t.multiplyByScalar(s,1/a,w),d=c/a,p=t.multiplyByScalar(l,d,S),m=t.multiplyByScalar(u,d,E),f=t.add(h,m,b);t.subtract(f,p,f),t.multiplyComponents(r,f,f),t.pack(f,C,0);var _=t.subtract(h,m,b);t.subtract(_,p,_),t.multiplyComponents(r,_,_),t.pack(_,C,3);var g=t.add(h,m,b);t.add(g,p,g),t.multiplyComponents(r,g,g),t.pack(g,C,6);var v=t.subtract(h,m,b);return t.add(v,p,v),t.multiplyComponents(r,v,v),t.pack(v,C,9),C}var C=n.supportsTypedArrays()?new Float32Array(12):[],w=new t,S=new t,E=new t,b=new t;return v.prototype.update=function(n){if(this._mode=n.mode,n.mode===g.SCENE3D){var v=n.context,C=n.mapProjection.ellipsoid;r(this._command)||(this._rs=h.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:_.ALWAYS},colorMask:{red:!1,green:!1,blue:!1,alpha:!1}}),this._sp=d.fromCache({context:v,vertexShaderSource:f,fragmentShaderSource:m,attributeLocations:{position:0}}),this._command=new u({renderState:this._rs,shaderProgram:this._sp,boundingVolume:new e(t.ZERO,C.maximumRadius),pass:c.OPAQUE,owner:this}));var w=y(C,n);if(r(this._va))this._va.getAttribute(0).vertexBuffer.copyFromArrayView(w);else{var S=new o({attributes:{position:new a({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:w})},indices:[0,1,2,2,1,3],primitiveType:s.TRIANGLES});this._va=p.fromGeometry({context:v,geometry:S,attributeLocations:{position:0},bufferUsage:l.DYNAMIC_DRAW}),this._command.vertexArray=this._va}}},v.prototype.execute=function(e,t){this._mode===g.SCENE3D&&this._command.execute(e,t)},v.prototype.isDestroyed=function(){return!1},v.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()},v}),i("Scene/DeviceOrientationCameraController",["../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Math","../Core/Matrix3","../Core/Quaternion"],function(e,t,i,r,n,o){"use strict";function a(t){function i(t){var i=t.alpha;return e(i)?(n._alpha=r.toRadians(i),n._beta=r.toRadians(t.beta),void(n._gamma=r.toRadians(t.gamma))):(n._alpha=void 0,n._beta=void 0,void(n._gamma=void 0))}this._scene=t,this._lastAlpha=void 0,this._lastBeta=void 0,this._lastGamma=void 0,this._alpha=void 0,this._beta=void 0,this._gamma=void 0;var n=this;window.addEventListener("deviceorientation",i,!1),this._removeListener=function(){window.removeEventListener("deviceorientation",i,!1)}}function s(e,t,i,r){var a=e.direction,s=e.right,h=e.up,d=o.fromAxisAngle(a,i,u),p=o.fromAxisAngle(s,r,l),m=o.multiply(p,d,p),f=o.fromAxisAngle(h,t,u);o.multiply(f,m,m);var _=n.fromQuaternion(m,c);n.multiplyByVector(_,s,s),n.multiplyByVector(_,h,h),n.multiplyByVector(_,a,a)}var l=new o,u=new o,c=new n;return a.prototype.update=function(){if(e(this._alpha)){e(this._lastAlpha)||(this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma);var t=this._lastAlpha-this._alpha,i=this._lastBeta-this._beta,r=this._lastGamma-this._gamma;s(this._scene.camera,-t,i,r),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma}},a.prototype.isDestroyed=function(){return!1},a.prototype.destroy=function(){return this._removeListener(),t(this)},a}),i("Shaders/EllipsoidFS",[],function(){"use strict";return"#ifdef WRITE_DEPTH\n#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\n#endif\nuniform vec3 u_radii;\nuniform vec3 u_oneOverEllipsoidRadiiSquared;\nvarying vec3 v_positionEC;\nvec4 computeEllipsoidColor(czm_ray ray, float intersection, float side)\n{\nvec3 positionEC = czm_pointAlongRay(ray, intersection);\nvec3 positionMC = (czm_inverseModelView * vec4(positionEC, 1.0)).xyz;\nvec3 geodeticNormal = normalize(czm_geodeticSurfaceNormal(positionMC, vec3(0.0), u_oneOverEllipsoidRadiiSquared));\nvec3 sphericalNormal = normalize(positionMC / u_radii);\nvec3 normalMC = geodeticNormal * side;\nvec3 normalEC = normalize(czm_normal * normalMC);\nvec2 st = czm_ellipsoidWgs84TextureCoordinates(sphericalNormal);\nvec3 positionToEyeEC = -positionEC;\nczm_materialInput materialInput;\nmaterialInput.s = st.s;\nmaterialInput.st = st;\nmaterialInput.str = (positionMC + u_radii) / u_radii;\nmaterialInput.normalEC = normalEC;\nmaterialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC);\nmaterialInput.positionToEyeEC = positionToEyeEC;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef ONLY_SUN_LIGHTING\nreturn czm_private_phong(normalize(positionToEyeEC), material);\n#else\nreturn czm_phong(normalize(positionToEyeEC), material);\n#endif\n}\nvoid main()\n{\nfloat maxRadius = max(u_radii.x, max(u_radii.y, u_radii.z)) * 1.5;\nvec3 direction = normalize(v_positionEC);\nvec3 ellipsoidCenter = czm_modelView[3].xyz;\nfloat t1 = -1.0;\nfloat t2 = -1.0;\nfloat b = -2.0 * dot(direction, ellipsoidCenter);\nfloat c = dot(ellipsoidCenter, ellipsoidCenter) - maxRadius * maxRadius;\nfloat discriminant = b * b - 4.0 * c;\nif (discriminant >= 0.0) {\nt1 = (-b - sqrt(discriminant)) * 0.5;\nt2 = (-b + sqrt(discriminant)) * 0.5;\n}\nif (t1 < 0.0 && t2 < 0.0) {\ndiscard;\n}\nfloat t = min(t1, t2);\nif (t < 0.0) {\nt = 0.0;\n}\nczm_ellipsoid ellipsoid = czm_ellipsoidNew(ellipsoidCenter, u_radii);\nczm_ray ray = czm_ray(t * direction, direction);\nczm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid);\nif (czm_isEmpty(intersection))\n{\ndiscard;\n}\nvec4 outsideFaceColor = (intersection.start != 0.0) ? computeEllipsoidColor(ray, intersection.start, 1.0) : vec4(0.0);\nvec4 insideFaceColor = (outsideFaceColor.a < 1.0) ? computeEllipsoidColor(ray, intersection.stop, -1.0) : vec4(0.0);\ngl_FragColor = mix(insideFaceColor, outsideFaceColor, outsideFaceColor.a);\ngl_FragColor.a = 1.0 - (1.0 - insideFaceColor.a) * (1.0 - outsideFaceColor.a);\n#ifdef WRITE_DEPTH\n#ifdef GL_EXT_frag_depth\nt = (intersection.start != 0.0) ? intersection.start : intersection.stop;\nvec3 positionEC = czm_pointAlongRay(ray, t);\nvec4 positionCC = czm_projection * vec4(positionEC, 1.0);\nfloat z = positionCC.z / positionCC.w;\nfloat n = czm_depthRange.near;\nfloat f = czm_depthRange.far;\ngl_FragDepthEXT = (z * (f - n) + f + n) * 0.5;\n#endif\n#endif\n}\n"}),i("Shaders/EllipsoidVS",[],function(){ +"use strict";return"attribute vec3 position;\nuniform vec3 u_radii;\nvarying vec3 v_positionEC;\nvoid main()\n{\nvec4 p = vec4(u_radii * position, 1.0);\nv_positionEC = (czm_modelView * p).xyz;\ngl_Position = czm_modelViewProjection * p;\ngl_Position.z = clamp(gl_Position.z, czm_depthRange.near, czm_depthRange.far);\n}\n"}),i("Scene/EllipsoidPrimitive",["../Core/BoundingSphere","../Core/BoxGeometry","../Core/Cartesian3","../Core/combine","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Matrix4","../Core/VertexFormat","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArray","../Shaders/EllipsoidFS","../Shaders/EllipsoidVS","./BlendingState","./CullFace","./Material","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S){"use strict";function E(t){t=n(t,n.EMPTY_OBJECT),this.center=i.clone(n(t.center,i.ZERO)),this._center=new i,this.radii=i.clone(t.radii),this._radii=new i,this._oneOverEllipsoidRadiiSquared=new i,this._boundingSphere=new e,this.modelMatrix=l.clone(n(t.modelMatrix,l.IDENTITY)),this._modelMatrix=new l,this._computedModelMatrix=new l,this.show=n(t.show,!0),this.material=n(t.material,w.fromType(w.ColorType)),this._material=void 0,this._translucent=void 0,this.id=t.id,this._id=void 0,this.debugShowBoundingVolume=n(t.debugShowBoundingVolume,!1),this.onlySunLighting=n(t.onlySunLighting,!1),this._onlySunLighting=!1,this._depthTestEnabled=n(t.depthTestEnabled,!0),this._sp=void 0,this._rs=void 0,this._va=void 0,this._pickSP=void 0,this._pickId=void 0,this._colorCommand=new h({owner:n(t._owner,this)}),this._pickCommand=new h({owner:n(t._owner,this)});var r=this;this._uniforms={u_radii:function(){return r.radii},u_oneOverEllipsoidRadiiSquared:function(){return r._oneOverEllipsoidRadiiSquared}},this._pickUniforms={czm_pickColor:function(){return r._pickId.color}}}function b(e){var r=e.cache.ellipsoidPrimitive_vertexArray;if(o(r))return r;var n=t.createGeometry(t.fromDimensions({dimensions:new i(2,2,2),vertexFormat:u.POSITION_ONLY}));return r=_.fromGeometry({context:e,geometry:n,attributeLocations:T,bufferUsage:c.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=r,r}var T={position:0};return E.prototype.update=function(t){if(this.show&&t.mode===S.SCENE3D&&o(this.center)&&o(this.radii)){var n=t.context,a=this.material.isTranslucent(),s=this._translucent!==a;o(this._rs)&&!s||(this._translucent=a,this._rs=p.fromCache({cull:{enabled:!0,face:C.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!a&&n.fragmentDepth,blending:a?y.ALPHA_BLEND:void 0})),o(this._va)||(this._va=b(n));var u=!1,c=this.radii;if(!i.equals(this._radii,c)){i.clone(c,this._radii);var h=this._oneOverEllipsoidRadiiSquared;h.x=1/(c.x*c.x),h.y=1/(c.y*c.y),h.z=1/(c.z*c.z),u=!0}l.equals(this.modelMatrix,this._modelMatrix)&&i.equals(this.center,this._center)||(l.clone(this.modelMatrix,this._modelMatrix),i.clone(this.center,this._center),l.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),u=!0),u&&(i.clone(i.ZERO,this._boundingSphere.center),this._boundingSphere.radius=i.maximumComponent(c),e.transform(this._boundingSphere,this._computedModelMatrix,this._boundingSphere));var _=this._material!==this.material;this._material=this.material,this._material.update(n);var w=this.onlySunLighting!==this._onlySunLighting;this._onlySunLighting=this.onlySunLighting;var E,x=this._colorCommand;(_||w||s)&&(E=new f({sources:[this.material.shaderSource,g]}),this.onlySunLighting&&E.defines.push("ONLY_SUN_LIGHTING"),!a&&n.fragmentDepth&&E.defines.push("WRITE_DEPTH"),this._sp=m.replaceCache({context:n,shaderProgram:this._sp,vertexShaderSource:v,fragmentShaderSource:E,attributeLocations:T}),x.vertexArray=this._va,x.renderState=this._rs,x.shaderProgram=this._sp,x.uniformMap=r(this._uniforms,this.material._uniforms),x.executeInClosestFrustum=a);var A=t.commandList,P=t.passes;if(P.render&&(x.boundingVolume=this._boundingSphere,x.debugShowBoundingVolume=this.debugShowBoundingVolume,x.modelMatrix=this._computedModelMatrix,x.pass=a?d.TRANSLUCENT:d.OPAQUE,A.push(x)),P.pick){var D=this._pickCommand;o(this._pickId)&&this._id===this.id||(this._id=this.id,this._pickId=this._pickId&&this._pickId.destroy(),this._pickId=n.createPickId({primitive:this,id:this.id})),(_||w||!o(this._pickSP))&&(E=new f({sources:[this.material.shaderSource,g],pickColorQualifier:"uniform"}),this.onlySunLighting&&E.defines.push("ONLY_SUN_LIGHTING"),!a&&n.fragmentDepth&&E.defines.push("WRITE_DEPTH"),this._pickSP=m.replaceCache({context:n,shaderProgram:this._pickSP,vertexShaderSource:v,fragmentShaderSource:E,attributeLocations:T}),D.vertexArray=this._va,D.renderState=this._rs,D.shaderProgram=this._pickSP,D.uniformMap=r(r(this._uniforms,this._pickUniforms),this.material._uniforms),D.executeInClosestFrustum=a),D.boundingVolume=this._boundingSphere,D.modelMatrix=this._computedModelMatrix,D.pass=a?d.TRANSLUCENT:d.OPAQUE,A.push(D)}}},E.prototype.isDestroyed=function(){return!1},E.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._pickSP=this._pickSP&&this._pickSP.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),a(this)},E}),i("Shaders/Appearances/EllipsoidSurfaceAppearanceFS",[],function(){"use strict";return"varying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec2 v_st;\nvoid main()\n{\nczm_materialInput materialInput;\nvec3 normalEC = normalize(czm_normal3D * czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)));\n#ifdef FACE_FORWARD\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\nmaterialInput.s = v_st.s;\nmaterialInput.st = v_st;\nmaterialInput.str = vec3(v_st, 0.0);\nmaterialInput.normalEC = normalEC;\nmaterialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, materialInput.normalEC);\nvec3 positionToEyeEC = -v_positionEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\n#endif\n}\n"}),i("Shaders/Appearances/EllipsoidSurfaceAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec2 st;\nattribute float batchId;\nvarying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionMC = position3DHigh + position3DLow;\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_st = st;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),i("Scene/EllipsoidSurfaceAppearance",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/VertexFormat","../Shaders/Appearances/EllipsoidSurfaceAppearanceFS","../Shaders/Appearances/EllipsoidSurfaceAppearanceVS","./Appearance","./Material"],function(e,t,i,r,n,o,a,s){"use strict";function l(i){i=e(i,e.EMPTY_OBJECT);var r=e(i.translucent,!0),l=e(i.aboveGround,!1);this.material=t(i.material)?i.material:s.fromType(s.ColorType),this.translucent=e(i.translucent,!0),this._vertexShaderSource=e(i.vertexShaderSource,o),this._fragmentShaderSource=e(i.fragmentShaderSource,n),this._renderState=a.getDefaultRenderState(r,!l,i.renderState),this._closed=!1,this._flat=e(i.flat,!1),this._faceForward=e(i.faceForward,l),this._aboveGround=l}return i(l.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return l.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}}),l.VERTEX_FORMAT=r.POSITION_AND_ST,l.prototype.getFragmentShaderSource=a.prototype.getFragmentShaderSource,l.prototype.isTranslucent=a.prototype.isTranslucent,l.prototype.getRenderState=a.prototype.getRenderState,l}),i("Scene/Fog",["../Core/Cartesian3","../Core/defined","../Core/Math","./SceneMode"],function(e,t,i,r){"use strict";function n(){this.enabled=!0,this.density=2e-4,this.screenSpaceErrorFactor=2}function o(e){var t=a,i=t.length;if(e<t[0])return d=0;if(e>t[i-1])return d=i-2;if(e>=t[d]){if(d+1<i&&e<t[d+1])return d;if(d+2<i&&e<t[d+2])return++d,d}else if(d-1>=0&&e>=t[d-1])return--d,d;var r;for(r=0;r<i-2&&!(e>=t[r]&&e<t[r+1]);++r);return d=r}for(var a=[359.393,800.749,1275.6501,2151.1192,3141.7763,4777.5198,6281.2493,12364.307,15900.765,49889.0549,78026.8259,99260.7344,120036.3873,151011.0158,156091.1953,203849.3112,274866.9803,319916.3149,493552.0528,628733.5874],s=[2e-5,2e-4,1e-4,7e-5,5e-5,4e-5,3e-5,19e-6,1e-5,85e-7,62e-7,58e-7,53e-7,52e-7,51e-7,42e-7,4e-6,34e-7,26e-7,22e-7],l=0;l<s.length;++l)s[l]*=1e6;for(var u=s[1],c=s[s.length-1],h=0;h<s.length;++h)s[h]=(s[h]-c)/(u-c);var d=0,p=new e;return n.prototype.update=function(n){var l=n.fog.enabled=this.enabled;if(l){var h=n.camera,d=h.positionCartographic;if(!t(d)||d.height>8e5||n.mode!==r.SCENE3D)return void(n.fog.enabled=!1);var m=d.height,f=o(m),_=i.clamp((m-a[f])/(a[f+1]-a[f]),0,1),g=i.lerp(s[f],s[f+1],_),v=1e6*this.density,y=v/u*c;g=g*(v-y)*1e-6;var C=e.normalize(h.positionWC,p),w=i.clamp(e.dot(h.directionWC,C),0,1);g*=1-w,n.fog.density=g,n.fog.sse=this.screenSpaceErrorFactor}},n}),i("Scene/FrameRateMonitor",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/getTimestamp","../Core/TimeConstants"],function(e,t,i,r,n,o,a,s){"use strict";function l(i){function r(){c(n)}this._scene=i.scene,this.samplingWindow=e(i.samplingWindow,l.defaultSettings.samplingWindow),this.quietPeriod=e(i.quietPeriod,l.defaultSettings.quietPeriod),this.warmupPeriod=e(i.warmupPeriod,l.defaultSettings.warmupPeriod),this.minimumFrameRateDuringWarmup=e(i.minimumFrameRateDuringWarmup,l.defaultSettings.minimumFrameRateDuringWarmup),this.minimumFrameRateAfterWarmup=e(i.minimumFrameRateAfterWarmup,l.defaultSettings.minimumFrameRateAfterWarmup),this._lowFrameRate=new o,this._nominalFrameRate=new o,this._frameTimes=[],this._needsQuietPeriod=!0,this._quietPeriodEndTime=0,this._warmupPeriodEndTime=0,this._frameRateIsLow=!1,this._lastFramesPerSecond=void 0,this._pauseCount=0;var n=this;this._preRenderRemoveListener=this._scene.preRender.addEventListener(function(e,t){u(n,t)}),this._hiddenPropertyName=void 0!==document.hidden?"hidden":void 0!==document.mozHidden?"mozHidden":void 0!==document.msHidden?"msHidden":void 0!==document.webkitHidden?"webkitHidden":void 0;var a=void 0!==document.hidden?"visibilitychange":void 0!==document.mozHidden?"mozvisibilitychange":void 0!==document.msHidden?"msvisibilitychange":void 0!==document.webkitHidden?"webkitvisibilitychange":void 0;this._visibilityChangeRemoveListener=void 0,t(a)&&(document.addEventListener(a,r,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(a,r,!1)})}function u(e,t){if(!(e._pauseCount>0)){var i=a();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=i+e.quietPeriod/s.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/s.SECONDS_PER_MILLISECOND;else if(i>=e._quietPeriodEndTime){e._frameTimes.push(i);var r=i-e.samplingWindow/s.SECONDS_PER_MILLISECOND;if(e._frameTimes.length>=2&&e._frameTimes[0]<=r){for(;e._frameTimes.length>=2&&e._frameTimes[1]<r;)e._frameTimes.shift();var n=(i-e._frameTimes[0])/(e._frameTimes.length-1);e._lastFramesPerSecond=1e3/n;var o=1e3/(i>e._warmupPeriodEndTime?e.minimumFrameRateAfterWarmup:e.minimumFrameRateDuringWarmup);n>o?e._frameRateIsLow||(e._frameRateIsLow=!0,e._needsQuietPeriod=!0,e.lowFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond)):e._frameRateIsLow&&(e._frameRateIsLow=!1,e._needsQuietPeriod=!0,e.nominalFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond))}}}}function c(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}return l.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8},l.fromScene=function(e){return t(e._frameRateMonitor)&&!e._frameRateMonitor.isDestroyed()||(e._frameRateMonitor=new l({scene:e})),e._frameRateMonitor},i(l.prototype,{scene:{get:function(){return this._scene}},lowFrameRate:{get:function(){return this._lowFrameRate}},nominalFrameRate:{get:function(){return this._nominalFrameRate}},lastFramesPerSecond:{get:function(){return this._lastFramesPerSecond}}}),l.prototype.pause=function(){++this._pauseCount,1===this._pauseCount&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)},l.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)},l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return this._preRenderRemoveListener(),t(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),r(this)},l}),i("Scene/FrameState",["./SceneMode"],function(e){"use strict";function t(t,i){this.context=t,this.commandList=[],this.shadowMaps=[],this.mode=e.SCENE3D,this.morphTime=e.getMorphTime(e.SCENE3D),this.frameNumber=0,this.time=void 0,this.mapProjection=void 0,this.camera=void 0,this.cullingVolume=void 0,this.occluder=void 0,this.maximumScreenSpaceError=void 0,this.passes={render:!1,pick:!1},this.creditDisplay=i,this.afterRender=[],this.scene3DOnly=!1,this.fog={enabled:!1,density:void 0,sse:void 0},this.terrainExaggeration=1,this.shadowHints={shadowsEnabled:!0,shadowMaps:[],lightShadowMaps:[],nearPlane:1,farPlane:5e3,closestObjectSize:1e3,lastDirtyTime:0,outOfView:!0},this.imagerySplitPosition=0}return t}),i("Scene/FrustumCommands",["../Core/defaultValue","../Renderer/Pass"],function(e,t){"use strict";function i(i,r){this.near=e(i,0),this.far=e(r,0);for(var n=t.NUMBER_OF_PASSES,o=new Array(n),a=new Array(n),s=0;s<n;++s)o[s]=[],a[s]=0;this.commands=o,this.indices=a}return i}),i("Shaders/PostProcessFilters/FXAA",[],function(){"use strict";return"#ifndef FXAA_PRESET\n#define FXAA_PRESET 3\n#endif\n#if (FXAA_PRESET == 3)\n#define FXAA_EDGE_THRESHOLD (1.0/8.0)\n#define FXAA_EDGE_THRESHOLD_MIN (1.0/24.0)\n#define FXAA_SEARCH_STEPS 16\n#define FXAA_SEARCH_THRESHOLD (1.0/4.0)\n#define FXAA_SUBPIX_CAP (3.0/4.0)\n#define FXAA_SUBPIX_TRIM (1.0/4.0)\n#endif\n#if (FXAA_PRESET == 4)\n#define FXAA_EDGE_THRESHOLD (1.0/8.0)\n#define FXAA_EDGE_THRESHOLD_MIN (1.0/24.0)\n#define FXAA_SEARCH_STEPS 24\n#define FXAA_SEARCH_THRESHOLD (1.0/4.0)\n#define FXAA_SUBPIX_CAP (3.0/4.0)\n#define FXAA_SUBPIX_TRIM (1.0/4.0)\n#endif\n#if (FXAA_PRESET == 5)\n#define FXAA_EDGE_THRESHOLD (1.0/8.0)\n#define FXAA_EDGE_THRESHOLD_MIN (1.0/24.0)\n#define FXAA_SEARCH_STEPS 32\n#define FXAA_SEARCH_THRESHOLD (1.0/4.0)\n#define FXAA_SUBPIX_CAP (3.0/4.0)\n#define FXAA_SUBPIX_TRIM (1.0/4.0)\n#endif\n#define FXAA_SUBPIX_TRIM_SCALE (1.0/(1.0 - FXAA_SUBPIX_TRIM))\nfloat FxaaLuma(vec3 rgb) {\nreturn rgb.y * (0.587/0.299) + rgb.x;\n}\nvec3 FxaaLerp3(vec3 a, vec3 b, float amountOfA) {\nreturn (vec3(-amountOfA) * b) + ((a * vec3(amountOfA)) + b);\n}\nvec4 FxaaTexOff(sampler2D tex, vec2 pos, ivec2 off, vec2 rcpFrame) {\nfloat x = pos.x + float(off.x) * rcpFrame.x;\nfloat y = pos.y + float(off.y) * rcpFrame.y;\nreturn texture2D(tex, vec2(x, y));\n}\nvec3 FxaaPixelShader(vec2 pos, sampler2D tex, vec2 rcpFrame)\n{\nvec3 rgbN = FxaaTexOff(tex, pos.xy, ivec2( 0,-1), rcpFrame).xyz;\nvec3 rgbW = FxaaTexOff(tex, pos.xy, ivec2(-1, 0), rcpFrame).xyz;\nvec3 rgbM = FxaaTexOff(tex, pos.xy, ivec2( 0, 0), rcpFrame).xyz;\nvec3 rgbE = FxaaTexOff(tex, pos.xy, ivec2( 1, 0), rcpFrame).xyz;\nvec3 rgbS = FxaaTexOff(tex, pos.xy, ivec2( 0, 1), rcpFrame).xyz;\nfloat lumaN = FxaaLuma(rgbN);\nfloat lumaW = FxaaLuma(rgbW);\nfloat lumaM = FxaaLuma(rgbM);\nfloat lumaE = FxaaLuma(rgbE);\nfloat lumaS = FxaaLuma(rgbS);\nfloat rangeMin = min(lumaM, min(min(lumaN, lumaW), min(lumaS, lumaE)));\nfloat rangeMax = max(lumaM, max(max(lumaN, lumaW), max(lumaS, lumaE)));\nfloat range = rangeMax - rangeMin;\nif(range < max(FXAA_EDGE_THRESHOLD_MIN, rangeMax * FXAA_EDGE_THRESHOLD))\n{\nreturn rgbM;\n}\nvec3 rgbL = rgbN + rgbW + rgbM + rgbE + rgbS;\nfloat lumaL = (lumaN + lumaW + lumaE + lumaS) * 0.25;\nfloat rangeL = abs(lumaL - lumaM);\nfloat blendL = max(0.0, (rangeL / range) - FXAA_SUBPIX_TRIM) * FXAA_SUBPIX_TRIM_SCALE;\nblendL = min(FXAA_SUBPIX_CAP, blendL);\nvec3 rgbNW = FxaaTexOff(tex, pos.xy, ivec2(-1,-1), rcpFrame).xyz;\nvec3 rgbNE = FxaaTexOff(tex, pos.xy, ivec2( 1,-1), rcpFrame).xyz;\nvec3 rgbSW = FxaaTexOff(tex, pos.xy, ivec2(-1, 1), rcpFrame).xyz;\nvec3 rgbSE = FxaaTexOff(tex, pos.xy, ivec2( 1, 1), rcpFrame).xyz;\nrgbL += (rgbNW + rgbNE + rgbSW + rgbSE);\nrgbL *= vec3(1.0/9.0);\nfloat lumaNW = FxaaLuma(rgbNW);\nfloat lumaNE = FxaaLuma(rgbNE);\nfloat lumaSW = FxaaLuma(rgbSW);\nfloat lumaSE = FxaaLuma(rgbSE);\nfloat edgeVert =\nabs((0.25 * lumaNW) + (-0.5 * lumaN) + (0.25 * lumaNE)) +\nabs((0.50 * lumaW ) + (-1.0 * lumaM) + (0.50 * lumaE )) +\nabs((0.25 * lumaSW) + (-0.5 * lumaS) + (0.25 * lumaSE));\nfloat edgeHorz =\nabs((0.25 * lumaNW) + (-0.5 * lumaW) + (0.25 * lumaSW)) +\nabs((0.50 * lumaN ) + (-1.0 * lumaM) + (0.50 * lumaS )) +\nabs((0.25 * lumaNE) + (-0.5 * lumaE) + (0.25 * lumaSE));\nbool horzSpan = edgeHorz >= edgeVert;\nfloat lengthSign = horzSpan ? -rcpFrame.y : -rcpFrame.x;\nif(!horzSpan)\n{\nlumaN = lumaW;\nlumaS = lumaE;\n}\nfloat gradientN = abs(lumaN - lumaM);\nfloat gradientS = abs(lumaS - lumaM);\nlumaN = (lumaN + lumaM) * 0.5;\nlumaS = (lumaS + lumaM) * 0.5;\nif (gradientN < gradientS)\n{\nlumaN = lumaS;\nlumaN = lumaS;\ngradientN = gradientS;\nlengthSign *= -1.0;\n}\nvec2 posN;\nposN.x = pos.x + (horzSpan ? 0.0 : lengthSign * 0.5);\nposN.y = pos.y + (horzSpan ? lengthSign * 0.5 : 0.0);\ngradientN *= FXAA_SEARCH_THRESHOLD;\nvec2 posP = posN;\nvec2 offNP = horzSpan ? vec2(rcpFrame.x, 0.0) : vec2(0.0, rcpFrame.y);\nfloat lumaEndN = lumaN;\nfloat lumaEndP = lumaN;\nbool doneN = false;\nbool doneP = false;\nposN += offNP * vec2(-1.0, -1.0);\nposP += offNP * vec2( 1.0, 1.0);\nfor(int i = 0; i < FXAA_SEARCH_STEPS; i++) {\nif(!doneN)\n{\nlumaEndN = FxaaLuma(texture2D(tex, posN.xy).xyz);\n}\nif(!doneP)\n{\nlumaEndP = FxaaLuma(texture2D(tex, posP.xy).xyz);\n}\ndoneN = doneN || (abs(lumaEndN - lumaN) >= gradientN);\ndoneP = doneP || (abs(lumaEndP - lumaN) >= gradientN);\nif(doneN && doneP)\n{\nbreak;\n}\nif(!doneN)\n{\nposN -= offNP;\n}\nif(!doneP)\n{\nposP += offNP;\n}\n}\nfloat dstN = horzSpan ? pos.x - posN.x : pos.y - posN.y;\nfloat dstP = horzSpan ? posP.x - pos.x : posP.y - pos.y;\nbool directionN = dstN < dstP;\nlumaEndN = directionN ? lumaEndN : lumaEndP;\nif(((lumaM - lumaN) < 0.0) == ((lumaEndN - lumaN) < 0.0))\n{\nlengthSign = 0.0;\n}\nfloat spanLength = (dstP + dstN);\ndstN = directionN ? dstN : dstP;\nfloat subPixelOffset = (0.5 + (dstN * (-1.0/spanLength))) * lengthSign;\nvec3 rgbF = texture2D(tex, vec2(\npos.x + (horzSpan ? 0.0 : subPixelOffset),\npos.y + (horzSpan ? subPixelOffset : 0.0))).xyz;\nreturn FxaaLerp3(rgbL, rgbF, blendL);\n}\nuniform sampler2D u_texture;\nuniform vec2 u_step;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = vec4(FxaaPixelShader(v_textureCoordinates, u_texture, u_step), 1.0);\n}\n"}),i("Scene/FXAA",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Color","../Core/defined","../Core/destroyObject","../Core/PixelFormat","../Renderer/ClearCommand","../Renderer/Framebuffer","../Renderer/PixelDatatype","../Renderer/Renderbuffer","../Renderer/RenderbufferFormat","../Renderer/RenderState","../Renderer/Texture","../Shaders/PostProcessFilters/FXAA"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p){"use strict";function m(t){this._texture=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._fbo=void 0,this._command=void 0,this._viewport=new e,this._rs=void 0;var r=new a({color:new i(0,0,0,0),depth:1,owner:this});this._clearCommand=r}function f(e){e._fbo=e._fbo&&e._fbo.destroy(),e._texture=e._texture&&e._texture.destroy(),e._depthStencilTexture=e._depthStencilTexture&&e._depthStencilTexture.destroy(),e._depthStencilRenderbuffer=e._depthStencilRenderbuffer&&e._depthStencilRenderbuffer.destroy(),e._fbo=void 0,e._texture=void 0,e._depthStencilTexture=void 0,e._depthStencilRenderbuffer=void 0,r(e._command)&&(e._command.shaderProgram=e._command.shaderProgram&&e._command.shaderProgram.destroy(),e._command=void 0)}return m.prototype.update=function(i){var n=i.drawingBufferWidth,a=i.drawingBufferHeight,m=this._texture,f=!r(m)||m.width!==n||m.height!==a;if(f&&(this._texture=this._texture&&this._texture.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),this._texture=new d({context:i,width:n,height:a,pixelFormat:o.RGBA,pixelDatatype:l.UNSIGNED_BYTE}),i.depthTexture?this._depthStencilTexture=new d({context:i,width:n,height:a,pixelFormat:o.DEPTH_STENCIL,pixelDatatype:l.UNSIGNED_INT_24_8}):this._depthStencilRenderbuffer=new u({context:i,width:n,height:a,format:c.DEPTH_STENCIL})),r(this._fbo)&&!f||(this._fbo=this._fbo&&this._fbo.destroy(),this._fbo=new s({context:i,colorTextures:[this._texture],depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1})),r(this._command)||(this._command=i.createViewportQuadCommand(p,{owner:this})),this._viewport.width=n,this._viewport.height=a,r(this._rs)&&e.equals(this._rs.viewport,this._viewport)||(this._rs=h.fromCache({viewport:this._viewport})),this._command.renderState=this._rs,f){var _=this,g=new t(1/this._texture.width,1/this._texture.height);this._command.uniformMap={u_texture:function(){return _._texture},u_step:function(){return g}}}},m.prototype.execute=function(e,t){this._command.execute(e,t)},m.prototype.clear=function(e,t,r){var n=t.framebuffer;t.framebuffer=this._fbo,i.clone(r,this._clearCommand.color),this._clearCommand.execute(e,t),t.framebuffer=n},m.prototype.getColorFramebuffer=function(){return this._fbo},m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){return f(this),n(this)},m}),i("Scene/GetFeatureInfoFormat",["../Core/Cartographic","../Core/defined","../Core/DeveloperError","../Core/RuntimeError","./ImageryLayerFeatureInfo"],function(e,t,i,r,n){"use strict";function o(e,i,r){this.type=e,t(i)||("json"===e?i="application/json":"xml"===e?i="text/xml":"html"===e?i="text/html":"text"===e&&(i="text/plain")),this.format=i,t(r)||("json"===e?r=a:"xml"===e?r=s:"html"===e?r=f:"text"===e&&(r=f)),this.callback=r}function a(i){for(var r=[],o=i.features,a=0;a<o.length;++a){var s=o[a],l=new n;if(l.data=s,l.properties=s.properties,l.configureNameFromProperties(s.properties),l.configureDescriptionFromProperties(s.properties),t(s.geometry)&&"Point"===s.geometry.type){var u=s.geometry.coordinates[0],c=s.geometry.coordinates[1];l.position=e.fromDegrees(u,c)}r.push(l)}return r}function s(e){var t=e.documentElement;if("MultiFeatureCollection"===t.localName&&t.namespaceURI===_)return l(e);if("FeatureInfoResponse"===t.localName&&t.namespaceURI===g)return u(e);if("FeatureCollection"===t.localName&&t.namespaceURI===v)return c(e);if("ServiceExceptionReport"===t.localName)throw new r((new XMLSerializer).serializeToString(t));return"msGMLOutput"===t.localName?h(e):m(e)}function l(e){for(var t=[],i=e.documentElement,r=i.getElementsByTagNameNS(_,"Feature"),o=0;o<r.length;++o){for(var a=r[o],s={},l=a.getElementsByTagNameNS(_,"Val"),u=0;u<l.length;++u){var c=l[u];if(c.hasAttribute("ref")){var h=c.getAttribute("ref"),d=c.textContent.trim();s[h]=d}}var p=new n;p.data=a,p.properties=s,p.configureNameFromProperties(s),p.configureDescriptionFromProperties(s),t.push(p)}return t}function u(e){var t,i=e.documentElement,r=[],n=i.getElementsByTagNameNS("*","FIELDS");if(n.length>0)for(var o=0;o<n.length;++o){var a=n[o];t={};for(var s=a.attributes,l=0;l<s.length;++l){var u=s[l];t[u.name]=u.value}r.push(p(a,t))}else for(var c=i.getElementsByTagNameNS("*","FeatureInfo"),h=0;h<c.length;++h){var d=c[h];t={};for(var m=d.childNodes,f=0;f<m.length;++f){var _=m[f];_.nodeType===Node.ELEMENT_NODE&&(t[_.localName]=_.textContent)}r.push(p(d,t))}return r}function c(e){for(var t=[],i=e.documentElement,r=i.getElementsByTagNameNS(y,"featureMember"),n=0;n<r.length;++n){var o=r[n],a={};d(o,a),t.push(p(o,a))}return t}function h(e){for(var t,i=[],r=e.documentElement.childNodes,n=0;n<r.length;n++)if(r[n].nodeType===Node.ELEMENT_NODE){t=r[n];break}for(var o=t.childNodes,a=0;a<o.length;++a){var s=o[a];if(s.nodeType===Node.ELEMENT_NODE){var l={};d(s,l),i.push(p(s,l))}}return i}function d(e,t){for(var i=!0,r=0;r<e.childNodes.length;++r){var n=e.childNodes[r];n.nodeType===Node.ELEMENT_NODE&&(i=!1),"Point"!==n.localName&&"LineString"!==n.localName&&"Polygon"!==n.localName&&"boundedBy"!==n.localName&&n.hasChildNodes()&&d(n,t)&&(t[n.localName]=n.textContent)}return i}function p(e,t){var i=new n;return i.data=e,i.properties=t,i.configureNameFromProperties(t),i.configureDescriptionFromProperties(t),i}function m(e){var t=(new XMLSerializer).serializeToString(e),i=document.createElement("div"),r=document.createElement("pre");r.textContent=t,i.appendChild(r);var o=new n;return o.data=e,o.description=i.innerHTML,[o]}function f(e){if(!C.test(e)&&!w.test(e)){var t,i=S.exec(e);i&&i.length>1&&(t=i[1]);var r=new n;return r.name=t,r.description=e,r.data=e,[r]}}var _="http://www.mapinfo.com/mxp",g="http://www.esri.com/wms",v="http://www.opengis.net/wfs",y="http://www.opengis.net/gml",C=/<body>\s*<\/body>/im,w=/<ServiceExceptionReport([\s\S]*)<\/ServiceExceptionReport>/im,S=/<title>([\s\S]*)<\/title>/im;return o}),i("Shaders/GlobeFS",[],function(){"use strict";return"uniform vec4 u_initialColor;\n#if TEXTURE_UNITS > 0\nuniform sampler2D u_dayTextures[TEXTURE_UNITS];\nuniform vec4 u_dayTextureTranslationAndScale[TEXTURE_UNITS];\nuniform bool u_dayTextureUseWebMercatorT[TEXTURE_UNITS];\n#ifdef APPLY_ALPHA\nuniform float u_dayTextureAlpha[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_SPLIT\nuniform float u_dayTextureSplit[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_BRIGHTNESS\nuniform float u_dayTextureBrightness[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_CONTRAST\nuniform float u_dayTextureContrast[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_HUE\nuniform float u_dayTextureHue[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_SATURATION\nuniform float u_dayTextureSaturation[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_GAMMA\nuniform float u_dayTextureOneOverGamma[TEXTURE_UNITS];\n#endif\nuniform vec4 u_dayTextureTexCoordsRectangle[TEXTURE_UNITS];\n#endif\n#ifdef SHOW_REFLECTIVE_OCEAN\nuniform sampler2D u_waterMask;\nuniform vec4 u_waterMaskTranslationAndScale;\nuniform float u_zoomedOutOceanSpecularIntensity;\n#endif\n#ifdef SHOW_OCEAN_WAVES\nuniform sampler2D u_oceanNormalMap;\n#endif\n#ifdef ENABLE_DAYNIGHT_SHADING\nuniform vec2 u_lightingFadeDistance;\n#endif\nvarying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec3 v_textureCoordinates;\nvarying vec3 v_normalMC;\nvarying vec3 v_normalEC;\n#ifdef FOG\nvarying float v_distance;\nvarying vec3 v_rayleighColor;\nvarying vec3 v_mieColor;\n#endif\nvec4 sampleAndBlend(\nvec4 previousColor,\nsampler2D texture,\nvec2 tileTextureCoordinates,\nvec4 textureCoordinateRectangle,\nvec4 textureCoordinateTranslationAndScale,\nfloat textureAlpha,\nfloat textureBrightness,\nfloat textureContrast,\nfloat textureHue,\nfloat textureSaturation,\nfloat textureOneOverGamma,\nfloat split)\n{\nvec2 alphaMultiplier = step(textureCoordinateRectangle.st, tileTextureCoordinates);\ntextureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;\nalphaMultiplier = step(vec2(0.0), textureCoordinateRectangle.pq - tileTextureCoordinates);\ntextureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;\nvec2 translation = textureCoordinateTranslationAndScale.xy;\nvec2 scale = textureCoordinateTranslationAndScale.zw;\nvec2 textureCoordinates = tileTextureCoordinates * scale + translation;\nvec4 value = texture2D(texture, textureCoordinates);\nvec3 color = value.rgb;\nfloat alpha = value.a;\n#ifdef APPLY_SPLIT\nfloat splitPosition = czm_imagerySplitPosition * czm_viewport.z;\nif (split < 0.0 && gl_FragCoord.x > splitPosition) {\nalpha = 0.0;\n}\nelse if (split > 0.0 && gl_FragCoord.x < splitPosition) {\nalpha = 0.0;\n}\n#endif\n#ifdef APPLY_BRIGHTNESS\ncolor = mix(vec3(0.0), color, textureBrightness);\n#endif\n#ifdef APPLY_CONTRAST\ncolor = mix(vec3(0.5), color, textureContrast);\n#endif\n#ifdef APPLY_HUE\ncolor = czm_hue(color, textureHue);\n#endif\n#ifdef APPLY_SATURATION\ncolor = czm_saturation(color, textureSaturation);\n#endif\n#ifdef APPLY_GAMMA\ncolor = pow(color, vec3(textureOneOverGamma));\n#endif\nfloat sourceAlpha = alpha * textureAlpha;\nfloat outAlpha = mix(previousColor.a, 1.0, sourceAlpha);\nvec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha;\nreturn vec4(outColor, outAlpha);\n}\nvec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates);\nvec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float specularMapValue);\nvoid main()\n{\nvec4 color = computeDayColor(u_initialColor, clamp(v_textureCoordinates, 0.0, 1.0));\n#ifdef SHOW_TILE_BOUNDARIES\nif (v_textureCoordinates.x < (1.0/256.0) || v_textureCoordinates.x > (255.0/256.0) ||\nv_textureCoordinates.y < (1.0/256.0) || v_textureCoordinates.y > (255.0/256.0))\n{\ncolor = vec4(1.0, 0.0, 0.0, 1.0);\n}\n#endif\n#if defined(SHOW_REFLECTIVE_OCEAN) || defined(ENABLE_DAYNIGHT_SHADING)\nvec3 normalMC = czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0));\nvec3 normalEC = czm_normal3D * normalMC;\n#endif\n#ifdef SHOW_REFLECTIVE_OCEAN\nvec2 waterMaskTranslation = u_waterMaskTranslationAndScale.xy;\nvec2 waterMaskScale = u_waterMaskTranslationAndScale.zw;\nvec2 waterMaskTextureCoordinates = v_textureCoordinates.xy * waterMaskScale + waterMaskTranslation;\nfloat mask = texture2D(u_waterMask, waterMaskTextureCoordinates).r;\nif (mask > 0.0)\n{\nmat3 enuToEye = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalEC);\nvec2 ellipsoidTextureCoordinates = czm_ellipsoidWgs84TextureCoordinates(normalMC);\nvec2 ellipsoidFlippedTextureCoordinates = czm_ellipsoidWgs84TextureCoordinates(normalMC.zyx);\nvec2 textureCoordinates = mix(ellipsoidTextureCoordinates, ellipsoidFlippedTextureCoordinates, czm_morphTime * smoothstep(0.9, 0.95, normalMC.z));\ncolor = computeWaterColor(v_positionEC, textureCoordinates, enuToEye, color, mask);\n}\n#endif\n#ifdef ENABLE_VERTEX_LIGHTING\nfloat diffuseIntensity = clamp(czm_getLambertDiffuse(czm_sunDirectionEC, normalize(v_normalEC)) * 0.9 + 0.3, 0.0, 1.0);\nvec4 finalColor = vec4(color.rgb * diffuseIntensity, color.a);\n#elif defined(ENABLE_DAYNIGHT_SHADING)\nfloat diffuseIntensity = clamp(czm_getLambertDiffuse(czm_sunDirectionEC, normalEC) * 5.0 + 0.3, 0.0, 1.0);\nfloat cameraDist = length(czm_view[3]);\nfloat fadeOutDist = u_lightingFadeDistance.x;\nfloat fadeInDist = u_lightingFadeDistance.y;\nfloat t = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.0, 1.0);\ndiffuseIntensity = mix(1.0, diffuseIntensity, t);\nvec4 finalColor = vec4(color.rgb * diffuseIntensity, color.a);\n#else\nvec4 finalColor = color;\n#endif\n#ifdef FOG\nconst float fExposure = 2.0;\nvec3 fogColor = v_mieColor + finalColor.rgb * v_rayleighColor;\nfogColor = vec3(1.0) - exp(-fExposure * fogColor);\ngl_FragColor = vec4(czm_fog(v_distance, finalColor.rgb, fogColor), finalColor.a);\n#else\ngl_FragColor = finalColor;\n#endif\n}\n#ifdef SHOW_REFLECTIVE_OCEAN\nfloat waveFade(float edge0, float edge1, float x)\n{\nfloat y = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);\nreturn pow(1.0 - y, 5.0);\n}\nfloat linearFade(float edge0, float edge1, float x)\n{\nreturn clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);\n}\nconst float oceanFrequencyLowAltitude = 825000.0;\nconst float oceanAnimationSpeedLowAltitude = 0.004;\nconst float oceanOneOverAmplitudeLowAltitude = 1.0 / 2.0;\nconst float oceanSpecularIntensity = 0.5;\nconst float oceanFrequencyHighAltitude = 125000.0;\nconst float oceanAnimationSpeedHighAltitude = 0.008;\nconst float oceanOneOverAmplitudeHighAltitude = 1.0 / 2.0;\nvec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float maskValue)\n{\nvec3 positionToEyeEC = -positionEyeCoordinates;\nfloat positionToEyeECLength = length(positionToEyeEC);\nvec3 normalizedpositionToEyeEC = normalize(normalize(positionToEyeEC));\nfloat waveIntensity = waveFade(70000.0, 1000000.0, positionToEyeECLength);\n#ifdef SHOW_OCEAN_WAVES\nfloat time = czm_frameNumber * oceanAnimationSpeedHighAltitude;\nvec4 noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyHighAltitude, time, 0.0);\nvec3 normalTangentSpaceHighAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeHighAltitude);\ntime = czm_frameNumber * oceanAnimationSpeedLowAltitude;\nnoise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyLowAltitude, time, 0.0);\nvec3 normalTangentSpaceLowAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeLowAltitude);\nfloat highAltitudeFade = linearFade(0.0, 60000.0, positionToEyeECLength);\nfloat lowAltitudeFade = 1.0 - linearFade(20000.0, 60000.0, positionToEyeECLength);\nvec3 normalTangentSpace =\n(highAltitudeFade * normalTangentSpaceHighAltitude) +\n(lowAltitudeFade * normalTangentSpaceLowAltitude);\nnormalTangentSpace = normalize(normalTangentSpace);\nnormalTangentSpace.xy *= waveIntensity;\nnormalTangentSpace = normalize(normalTangentSpace);\n#else\nvec3 normalTangentSpace = vec3(0.0, 0.0, 1.0);\n#endif\nvec3 normalEC = enuToEye * normalTangentSpace;\nconst vec3 waveHighlightColor = vec3(0.3, 0.45, 0.6);\nfloat diffuseIntensity = czm_getLambertDiffuse(czm_sunDirectionEC, normalEC) * maskValue;\nvec3 diffuseHighlight = waveHighlightColor * diffuseIntensity;\n#ifdef SHOW_OCEAN_WAVES\nfloat tsPerturbationRatio = normalTangentSpace.z;\nvec3 nonDiffuseHighlight = mix(waveHighlightColor * 5.0 * (1.0 - tsPerturbationRatio), vec3(0.0), diffuseIntensity);\n#else\nvec3 nonDiffuseHighlight = vec3(0.0);\n#endif\nfloat specularIntensity = czm_getSpecular(czm_sunDirectionEC, normalizedpositionToEyeEC, normalEC, 10.0) + 0.25 * czm_getSpecular(czm_moonDirectionEC, normalizedpositionToEyeEC, normalEC, 10.0);\nfloat surfaceReflectance = mix(0.0, mix(u_zoomedOutOceanSpecularIntensity, oceanSpecularIntensity, waveIntensity), maskValue);\nfloat specular = specularIntensity * surfaceReflectance;\nreturn vec4(imageryColor.rgb + diffuseHighlight + nonDiffuseHighlight + specular, imageryColor.a);\n}\n#endif // #ifdef SHOW_REFLECTIVE_OCEAN\n"; +}),i("Shaders/GlobeVS",[],function(){"use strict";return"#ifdef QUANTIZATION_BITS12\nattribute vec4 compressed0;\nattribute float compressed1;\n#else\nattribute vec4 position3DAndHeight;\nattribute vec4 textureCoordAndEncodedNormals;\n#endif\nuniform vec3 u_center3D;\nuniform mat4 u_modifiedModelView;\nuniform mat4 u_modifiedModelViewProjection;\nuniform vec4 u_tileRectangle;\nuniform vec2 u_southAndNorthLatitude;\nuniform vec2 u_southMercatorYAndOneOverHeight;\nvarying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec3 v_textureCoordinates;\nvarying vec3 v_normalMC;\nvarying vec3 v_normalEC;\n#ifdef FOG\nvarying float v_distance;\nvarying vec3 v_mieColor;\nvarying vec3 v_rayleighColor;\n#endif\nvec4 getPosition(vec3 position, float height, vec2 textureCoordinates);\nfloat get2DYPositionFraction(vec2 textureCoordinates);\nvec4 getPosition3DMode(vec3 position, float height, vec2 textureCoordinates)\n{\nreturn u_modifiedModelViewProjection * vec4(position, 1.0);\n}\nfloat get2DMercatorYPositionFraction(vec2 textureCoordinates)\n{\nconst float maxTileWidth = 0.003068;\nfloat positionFraction = textureCoordinates.y;\nfloat southLatitude = u_southAndNorthLatitude.x;\nfloat northLatitude = u_southAndNorthLatitude.y;\nif (northLatitude - southLatitude > maxTileWidth)\n{\nfloat southMercatorY = u_southMercatorYAndOneOverHeight.x;\nfloat oneOverMercatorHeight = u_southMercatorYAndOneOverHeight.y;\nfloat currentLatitude = mix(southLatitude, northLatitude, textureCoordinates.y);\ncurrentLatitude = clamp(currentLatitude, -czm_webMercatorMaxLatitude, czm_webMercatorMaxLatitude);\npositionFraction = czm_latitudeToWebMercatorFraction(currentLatitude, southMercatorY, oneOverMercatorHeight);\n}\nreturn positionFraction;\n}\nfloat get2DGeographicYPositionFraction(vec2 textureCoordinates)\n{\nreturn textureCoordinates.y;\n}\nvec4 getPositionPlanarEarth(vec3 position, float height, vec2 textureCoordinates)\n{\nfloat yPositionFraction = get2DYPositionFraction(textureCoordinates);\nvec4 rtcPosition2D = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0);\nreturn u_modifiedModelViewProjection * rtcPosition2D;\n}\nvec4 getPosition2DMode(vec3 position, float height, vec2 textureCoordinates)\n{\nreturn getPositionPlanarEarth(position, 0.0, textureCoordinates);\n}\nvec4 getPositionColumbusViewMode(vec3 position, float height, vec2 textureCoordinates)\n{\nreturn getPositionPlanarEarth(position, height, textureCoordinates);\n}\nvec4 getPositionMorphingMode(vec3 position, float height, vec2 textureCoordinates)\n{\nvec3 position3DWC = position + u_center3D;\nfloat yPositionFraction = get2DYPositionFraction(textureCoordinates);\nvec4 position2DWC = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0);\nvec4 morphPosition = czm_columbusViewMorph(position2DWC, vec4(position3DWC, 1.0), czm_morphTime);\nreturn czm_modelViewProjection * morphPosition;\n}\n#ifdef QUANTIZATION_BITS12\nuniform vec2 u_minMaxHeight;\nuniform mat4 u_scaleAndBias;\n#endif\nvoid main()\n{\n#ifdef QUANTIZATION_BITS12\nvec2 xy = czm_decompressTextureCoordinates(compressed0.x);\nvec2 zh = czm_decompressTextureCoordinates(compressed0.y);\nvec3 position = vec3(xy, zh.x);\nfloat height = zh.y;\nvec2 textureCoordinates = czm_decompressTextureCoordinates(compressed0.z);\nheight = height * (u_minMaxHeight.y - u_minMaxHeight.x) + u_minMaxHeight.x;\nposition = (u_scaleAndBias * vec4(position, 1.0)).xyz;\n#if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)) && defined(INCLUDE_WEB_MERCATOR_Y)\nfloat webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x;\nfloat encodedNormal = compressed1;\n#elif defined(INCLUDE_WEB_MERCATOR_Y)\nfloat webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x;\nfloat encodedNormal = 0.0;\n#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)\nfloat webMercatorT = textureCoordinates.y;\nfloat encodedNormal = compressed0.w;\n#else\nfloat webMercatorT = textureCoordinates.y;\nfloat encodedNormal = 0.0;\n#endif\n#else\nvec3 position = position3DAndHeight.xyz;\nfloat height = position3DAndHeight.w;\nvec2 textureCoordinates = textureCoordAndEncodedNormals.xy;\n#if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)) && defined(INCLUDE_WEB_MERCATOR_Y)\nfloat webMercatorT = textureCoordAndEncodedNormals.z;\nfloat encodedNormal = textureCoordAndEncodedNormals.w;\n#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)\nfloat webMercatorT = textureCoordinates.y;\nfloat encodedNormal = textureCoordAndEncodedNormals.z;\n#elif defined(INCLUDE_WEB_MERCATOR_Y)\nfloat webMercatorT = textureCoordAndEncodedNormals.z;\nfloat encodedNormal = 0.0;\n#else\nfloat webMercatorT = textureCoordinates.y;\nfloat encodedNormal = 0.0;\n#endif\n#endif\nvec3 position3DWC = position + u_center3D;\ngl_Position = getPosition(position, height, textureCoordinates);\nv_textureCoordinates = vec3(textureCoordinates, webMercatorT);\n#if defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)\nv_positionEC = (u_modifiedModelView * vec4(position, 1.0)).xyz;\nv_positionMC = position3DWC;\nv_normalMC = czm_octDecode(encodedNormal);\nv_normalEC = czm_normal3D * v_normalMC;\n#elif defined(SHOW_REFLECTIVE_OCEAN) || defined(ENABLE_DAYNIGHT_SHADING) || defined(GENERATE_POSITION)\nv_positionEC = (u_modifiedModelView * vec4(position, 1.0)).xyz;\nv_positionMC = position3DWC;\n#endif\n#ifdef FOG\nAtmosphereColor atmosColor = computeGroundAtmosphereFromSpace(position3DWC);\nv_mieColor = atmosColor.mie;\nv_rayleighColor = atmosColor.rayleigh;\nv_distance = length((czm_modelView3D * vec4(position3DWC, 1.0)).xyz);\n#endif\n}\n"}),i("Shaders/GroundAtmosphere",[],function(){"use strict";return"const float fInnerRadius = 6378137.0;\nconst float fOuterRadius = 6378137.0 * 1.025;\nconst float fOuterRadius2 = fOuterRadius * fOuterRadius;\nconst float Kr = 0.0025;\nconst float Km = 0.0015;\nconst float ESun = 15.0;\nconst float fKrESun = Kr * ESun;\nconst float fKmESun = Km * ESun;\nconst float fKr4PI = Kr * 4.0 * czm_pi;\nconst float fKm4PI = Km * 4.0 * czm_pi;\nconst float fScale = 1.0 / (fOuterRadius - fInnerRadius);\nconst float fScaleDepth = 0.25;\nconst float fScaleOverScaleDepth = fScale / fScaleDepth;\nstruct AtmosphereColor\n{\nvec3 mie;\nvec3 rayleigh;\n};\nconst int nSamples = 2;\nconst float fSamples = 2.0;\nfloat scale(float fCos)\n{\nfloat x = 1.0 - fCos;\nreturn fScaleDepth * exp(-0.00287 + x*(0.459 + x*(3.83 + x*(-6.80 + x*5.25))));\n}\nAtmosphereColor computeGroundAtmosphereFromSpace(vec3 v3Pos)\n{\nvec3 v3InvWavelength = vec3(1.0 / pow(0.650, 4.0), 1.0 / pow(0.570, 4.0), 1.0 / pow(0.475, 4.0));\nvec3 v3Ray = v3Pos - czm_viewerPositionWC;\nfloat fFar = length(v3Ray);\nv3Ray /= fFar;\nfloat fCameraHeight = length(czm_viewerPositionWC);\nfloat fCameraHeight2 = fCameraHeight * fCameraHeight;\nfloat B = 2.0 * length(czm_viewerPositionWC) * dot(normalize(czm_viewerPositionWC), v3Ray);\nfloat C = fCameraHeight2 - fOuterRadius2;\nfloat fDet = max(0.0, B*B - 4.0 * C);\nfloat fNear = 0.5 * (-B - sqrt(fDet));\nvec3 v3Start = czm_viewerPositionWC + v3Ray * fNear;\nfFar -= fNear;\nfloat fDepth = exp((fInnerRadius - fOuterRadius) / fScaleDepth);\nfloat fLightAngle = 1.0;\nfloat fCameraAngle = dot(-v3Ray, v3Pos) / length(v3Pos);\nfloat fCameraScale = scale(fCameraAngle);\nfloat fLightScale = scale(fLightAngle);\nfloat fCameraOffset = fDepth*fCameraScale;\nfloat fTemp = (fLightScale + fCameraScale);\nfloat fSampleLength = fFar / fSamples;\nfloat fScaledLength = fSampleLength * fScale;\nvec3 v3SampleRay = v3Ray * fSampleLength;\nvec3 v3SamplePoint = v3Start + v3SampleRay * 0.5;\nvec3 v3FrontColor = vec3(0.0);\nvec3 v3Attenuate = vec3(0.0);\nfor(int i=0; i<nSamples; i++)\n{\nfloat fHeight = length(v3SamplePoint);\nfloat fDepth = exp(fScaleOverScaleDepth * (fInnerRadius - fHeight));\nfloat fScatter = fDepth*fTemp - fCameraOffset;\nv3Attenuate = exp(-fScatter * (v3InvWavelength * fKr4PI + fKm4PI));\nv3FrontColor += v3Attenuate * (fDepth * fScaledLength);\nv3SamplePoint += v3SampleRay;\n}\nAtmosphereColor color;\ncolor.mie = v3FrontColor * (v3InvWavelength * fKrESun + fKmESun);\ncolor.rayleigh = v3Attenuate;\nreturn color;\n}\n"}),i("Scene/GlobeSurfaceShaderSet",["../Core/defined","../Core/destroyObject","../Core/TerrainQuantization","../Renderer/ShaderProgram","../Scene/SceneMode"],function(e,t,i,r,n){"use strict";function o(e,t,i){this.numberOfDayTextures=e,this.flags=t,this.shaderProgram=i}function a(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this._pickShaderPrograms=[]}function s(e){var t,i="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPosition3DMode(position, height, textureCoordinates); }",r="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionColumbusViewMode(position, height, textureCoordinates); }",o="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionMorphingMode(position, height, textureCoordinates); }";switch(e){case n.SCENE3D:t=i;break;case n.SCENE2D:case n.COLUMBUS_VIEW:t=r;break;case n.MORPHING:t=o}return t}function l(e){var t="float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }",i="float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }";return e?i:t}return a.prototype.getShaderProgram=function(t,n,a,u,c,h,d,p,m,f,_,g,v,y,C,w){var S=0,E="",b=n.pickTerrain.mesh.encoding,T=b.quantization;T===i.BITS12&&(S=1,E="QUANTIZATION_BITS12");var x=t.mode,A=x|u<<2|c<<3|h<<4|d<<5|p<<6|m<<7|_<<8|g<<9|v<<10|y<<11|C<<12|w<<13|S<<14|f<<15,P=n.surfaceShader;if(e(P)&&P.numberOfDayTextures===a&&P.flags===A)return P.shaderProgram;var D=this._shadersByTexturesFlags[a];if(e(D)||(D=this._shadersByTexturesFlags[a]=[]),P=D[A],!e(P)){var M=this.baseVertexShaderSource.clone(),I=this.baseFragmentShaderSource.clone();M.defines.push(E),I.defines.push("TEXTURE_UNITS "+a),u&&I.defines.push("APPLY_BRIGHTNESS"),c&&I.defines.push("APPLY_CONTRAST"),h&&I.defines.push("APPLY_HUE"),d&&I.defines.push("APPLY_SATURATION"),p&&I.defines.push("APPLY_GAMMA"),m&&I.defines.push("APPLY_ALPHA"),_&&(I.defines.push("SHOW_REFLECTIVE_OCEAN"),M.defines.push("SHOW_REFLECTIVE_OCEAN")),g&&I.defines.push("SHOW_OCEAN_WAVES"),v&&(y?(M.defines.push("ENABLE_VERTEX_LIGHTING"),I.defines.push("ENABLE_VERTEX_LIGHTING")):(M.defines.push("ENABLE_DAYNIGHT_SHADING"),I.defines.push("ENABLE_DAYNIGHT_SHADING"))),M.defines.push("INCLUDE_WEB_MERCATOR_Y"),I.defines.push("INCLUDE_WEB_MERCATOR_Y"),w&&(M.defines.push("FOG"),I.defines.push("FOG")),f&&I.defines.push("APPLY_SPLIT");for(var R=" vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates)\n {\n vec4 color = initialColor;\n",O=0;O<a;++O)R+=" color = sampleAndBlend(\n color,\n u_dayTextures["+O+"],\n u_dayTextureUseWebMercatorT["+O+"] ? textureCoordinates.xz : textureCoordinates.xy,\n u_dayTextureTexCoordsRectangle["+O+"],\n u_dayTextureTranslationAndScale["+O+"],\n "+(m?"u_dayTextureAlpha["+O+"]":"1.0")+",\n "+(u?"u_dayTextureBrightness["+O+"]":"0.0")+",\n "+(c?"u_dayTextureContrast["+O+"]":"0.0")+",\n "+(h?"u_dayTextureHue["+O+"]":"0.0")+",\n "+(d?"u_dayTextureSaturation["+O+"]":"0.0")+",\n "+(p?"u_dayTextureOneOverGamma["+O+"]":"0.0")+",\n "+(f?"u_dayTextureSplit["+O+"]":"0.0")+"\n );\n";R+=" return color;\n }",I.sources.push(R),M.sources.push(s(x)),M.sources.push(l(C));var N=r.fromCache({context:t.context,vertexShaderSource:M,fragmentShaderSource:I,attributeLocations:b.getAttributeLocations()});P=D[A]=new o(a,A,N)}return n.surfaceShader=P,P.shaderProgram},a.prototype.getPickShaderProgram=function(t,n,o){var a=0,u="",c=n.pickTerrain.mesh.encoding,h=c.quantization;h===i.BITS12&&(a=1,u="QUANTIZATION_BITS12");var d=t.mode,p=d|o<<2|a<<3,m=this._pickShaderPrograms[p];if(!e(m)){var f=this.baseVertexShaderSource.clone();f.defines.push(u),f.sources.push(s(d)),f.sources.push(l(o));var _="void main()\n{\n gl_FragColor = vec4(1.0, 1.0, 0.0, 1.0);\n}\n";m=this._pickShaderPrograms[p]=r.fromCache({context:t.context,vertexShaderSource:f,fragmentShaderSource:_,attributeLocations:c.getAttributeLocations()})}return m},a.prototype.destroy=function(){var i,r,n=this._shadersByTexturesFlags;for(var o in n)if(n.hasOwnProperty(o)){var a=n[o];if(!e(a))continue;for(i in a)a.hasOwnProperty(i)&&(r=a[i],e(r)&&r.shaderProgram.destroy())}var s=this._pickShaderPrograms;for(i in s)s.hasOwnProperty(i)&&(r=s[i],r.destroy());return t(this)},a}),i("Scene/ImageryState",["../Core/freezeObject"],function(e){"use strict";var t={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7};return e(t)}),i("Scene/QuadtreeTileLoadState",["../Core/freezeObject"],function(e){"use strict";var t={START:0,LOADING:1,DONE:2,FAILED:3};return e(t)}),i("Scene/TerrainState",["../Core/freezeObject"],function(e){"use strict";var t={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6};return e(t)}),i("Scene/TileBoundingBox",["../Core/Cartesian3","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/Ellipsoid","../Core/Rectangle","./SceneMode"],function(e,t,i,r,n,o,a,s){"use strict";function l(t,i,r){r.cartographicToCartesian(a.southwest(i),t.southwestCornerCartesian),r.cartographicToCartesian(a.northeast(i),t.northeastCornerCartesian),m.longitude=i.west,m.latitude=.5*(i.south+i.north),m.height=0;var n=r.cartographicToCartesian(m,d),o=e.cross(n,e.UNIT_Z,c);e.normalize(o,t.westNormal),m.longitude=i.east;var s=r.cartographicToCartesian(m,p),l=e.cross(e.UNIT_Z,s,c);e.normalize(l,t.eastNormal);var u=r.geodeticSurfaceNormalCartographic(a.southeast(i),h),f=e.subtract(n,s,c),_=e.cross(u,f,h);e.normalize(_,t.southNormal);var g=r.geodeticSurfaceNormalCartographic(a.northwest(i),h),v=e.cross(f,g,h);e.normalize(v,t.northNormal)}var u=function(t){t=i(t,i.EMPTY_OBJECT),this.rectangle=a.clone(t.rectangle),this.minimumHeight=i(t.minimumHeight,0),this.maximumHeight=i(t.maximumHeight,0),this.southwestCornerCartesian=new e,this.northeastCornerCartesian=new e,this.westNormal=new e,this.southNormal=new e,this.eastNormal=new e,this.northNormal=new e;var r=i(t.ellipsoid,o.WGS84);l(this,t.rectangle,r)},c=new e,h=new e,d=new e,p=new e,m=new t,f=new e,_=new e,g=new e(0,-1,0),v=new e(0,0,-1),y=new e;return u.prototype.distanceToCamera=function(t){var i=t.camera,r=i.positionWC,n=i.positionCartographic,o=0;if(!a.contains(this.rectangle,n)){var l=this.southwestCornerCartesian,u=this.northeastCornerCartesian,c=this.westNormal,h=this.southNormal,d=this.eastNormal,p=this.northNormal;t.mode!==s.SCENE3D&&(l=t.mapProjection.project(a.southwest(this.rectangle),f),l.z=l.y,l.y=l.x,l.x=0,u=t.mapProjection.project(a.northeast(this.rectangle),_),u.z=u.y,u.y=u.x,u.x=0,c=g,d=e.UNIT_Y,h=v,p=e.UNIT_Z);var m=e.subtract(r,l,y),C=e.dot(m,c),w=e.dot(m,h),S=e.subtract(r,u,y),E=e.dot(S,d),b=e.dot(S,p);C>0?o+=C*C:E>0&&(o+=E*E),w>0?o+=w*w:b>0&&(o+=b*b)}var T;T=t.mode===s.SCENE3D?n.height:r.x;var x=t.mode===s.SCENE3D?this.maximumHeight:0,A=T-x;return A>0&&(o+=A*A),Math.sqrt(o)},u}),i("Scene/TileTerrain",["../Core/BoundingSphere","../Core/Cartesian3","../Core/defined","../Core/DeveloperError","../Core/IndexDatatype","../Core/OrientedBoundingBox","../Core/TileProviderError","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/VertexArray","../ThirdParty/when","./TerrainState","./TileBoundingBox"],function(e,t,i,r,n,o,a,s,l,u,c,h,d){"use strict";function p(e){this.state=h.UNLOADED,this.data=void 0,this.mesh=void 0,this.vertexArray=void 0,this.upsampleDetails=e}function m(e,t,r,n,o){function s(t){e.data=t,e.state=h.RECEIVED}function l(){e.state=h.FAILED;var i="Failed to obtain terrain tile X: "+r+" Y: "+n+" Level: "+o+".";t._requestError=a.handleError(t._requestError,t,t.errorEvent,i,r,n,o,u)}function u(){e.data=t.requestTileGeometry(r,n,o),i(e.data)?(e.state=h.RECEIVING,c(e.data,s,l)):e.state=h.UNLOADED}u()}function f(e,t,r,n,o,a){var s=r.tilingScheme,l=e.data,u=l.createMesh(s,n,o,a,t.terrainExaggeration);i(u)&&(e.state=h.TRANSFORMING,c(u,function(t){e.mesh=t,e.state=h.TRANSFORMED},function(){e.state=h.FAILED}))}function _(e,t,r,o,a,c){var d=e.mesh.vertices,p=s.createVertexBuffer({context:t,typedArray:d,usage:l.STATIC_DRAW}),m=e.mesh.encoding.getAttributes(p),f=e.mesh.indices.indexBuffers||{},_=f[t.id];if(!i(_)||_.isDestroyed()){var g=e.mesh.indices,v=2===g.BYTES_PER_ELEMENT?n.UNSIGNED_SHORT:n.UNSIGNED_INT;_=s.createIndexBuffer({context:t,typedArray:g,usage:l.STATIC_DRAW,indexDatatype:v}),_.vertexArrayDestroyable=!1,_.referenceCount=1,f[t.id]=_,e.mesh.indices.indexBuffers=f}else++_.referenceCount;e.vertexArray=new u({context:t,attributes:m,indexBuffer:_}),e.state=h.READY}return p.prototype.freeResources=function(){if(this.state=h.UNLOADED,this.data=void 0,this.mesh=void 0,i(this.vertexArray)){var e=this.vertexArray.indexBuffer;this.vertexArray.destroy(),this.vertexArray=void 0,!e.isDestroyed()&&i(e.referenceCount)&&(--e.referenceCount,0===e.referenceCount&&e.destroy())}},p.prototype.publishToTile=function(i){var r=i.data,n=this.mesh;t.clone(n.center,r.center),r.minimumHeight=n.minimumHeight,r.maximumHeight=n.maximumHeight,r.boundingSphere3D=e.clone(n.boundingSphere3D,r.boundingSphere3D),r.orientedBoundingBox=o.clone(n.orientedBoundingBox,r.orientedBoundingBox),r.tileBoundingBox=new d({rectangle:i.rectangle,minimumHeight:n.minimumHeight,maximumHeight:n.maximumHeight,ellipsoid:i.tilingScheme.ellipsoid}),i.data.occludeePointInScaledSpace=t.clone(n.occludeePointInScaledSpace,r.occludeePointInScaledSpace)},p.prototype.processLoadStateMachine=function(e,t,i,r,n){this.state===h.UNLOADED&&m(this,t,i,r,n),this.state===h.RECEIVED&&f(this,e,t,i,r,n),this.state===h.TRANSFORMED&&_(this,e.context,t,i,r,n)},p.prototype.processUpsampleStateMachine=function(e,t,r,n,o){if(this.state===h.UNLOADED){var a=this.upsampleDetails,s=a.data,l=a.x,u=a.y,d=a.level;if(this.data=s.upsample(t.tilingScheme,l,u,d,r,n,o),!i(this.data))return;this.state=h.RECEIVING;var p=this;c(this.data,function(e){p.data=e,p.state=h.RECEIVED},function(){p.state=h.FAILED})}this.state===h.RECEIVED&&f(this,e,t,r,n,o),this.state===h.TRANSFORMED&&_(this,e.context,t,r,n,o)},p}),i("Scene/GlobeSurfaceTile",["../Core/BoundingSphere","../Core/Cartesian3","../Core/Cartesian4","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/IntersectionTests","../Core/PixelFormat","../Renderer/PixelDatatype","../Renderer/Sampler","../Renderer/Texture","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","./ImageryState","./QuadtreeTileLoadState","./SceneMode","./TerrainState","./TileTerrain"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v){"use strict";function y(){this.imagery=[],this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new i(0,0,1,1),this.terrainData=void 0,this.center=new t,this.vertexArray=void 0,this.minimumHeight=0,this.maximumHeight=0,this.boundingSphere3D=new e,this.boundingSphere2D=new e,this.orientedBoundingBox=void 0,this.tileBoundingBox=void 0,this.occludeePointInScaledSpace=new t,this.loadedTerrain=void 0,this.upsampledTerrain=void 0,this.pickBoundingSphere=new e,this.pickTerrain=void 0,this.surfaceShader=void 0}function C(e,i,r,o,a,s){if(e.decodePosition(o,a,s),n(i)&&i!==_.SCENE3D){var l=r.ellipsoid,u=l.cartesianToCartographic(s);r.project(u,s),t.fromElements(s.z,s.x,s.y,s)}return s}function w(e,t,i){var r=e.data,o=E(e);n(o)&&(r.upsampledTerrain=new v(o)),P(e,t)&&(r.loadedTerrain=new v);for(var a=0,s=i.length;a<s;++a){var l=i.get(a);l.show&&l._createTileImagerySkeletons(e,t)}}function S(e,t,i,o){var a=e.data,s=a.loadedTerrain,l=a.upsampledTerrain,u=!1;n(s)&&(s.processLoadStateMachine(t,i,e.x,e.y,e.level),s.state>=g.RECEIVED&&(a.terrainData!==s.data&&(a.terrainData=s.data,M(t.context,a),x(e)),u=!0),s.state===g.READY?(s.publishToTile(e),n(e.data.vertexArray)&&o.push(e.data.vertexArray),e.data.vertexArray=s.vertexArray,s.vertexArray=void 0,a.pickTerrain=r(a.loadedTerrain,a.upsampledTerrain),a.loadedTerrain=void 0,a.upsampledTerrain=void 0):s.state===g.FAILED&&(a.loadedTerrain=void 0)),!u&&n(l)&&(l.processUpsampleStateMachine(t,i,e.x,e.y,e.level),l.state>=g.RECEIVED&&a.terrainData!==l.data&&(a.terrainData=l.data,i.hasWaterMask&&I(e),b(e)),l.state===g.READY?(l.publishToTile(e),n(e.data.vertexArray)&&o.push(e.data.vertexArray),e.data.vertexArray=l.vertexArray,l.vertexArray=void 0,a.pickTerrain=a.upsampledTerrain,a.upsampledTerrain=void 0):l.state===g.FAILED&&(a.upsampledTerrain=void 0))}function E(e){for(var t=e.parent;n(t)&&n(t.data)&&!n(t.data.terrainData);)t=t.parent;if(n(t)&&n(t.data))return{data:t.data.terrainData,x:t.x,y:t.y,level:t.level}}function b(e){T(e,e._southwestChild),T(e,e._southeastChild),T(e,e._northwestChild),T(e,e._northeastChild)}function T(e,t){if(n(t)&&t.state!==f.START){var i=t.data;if(n(i.terrainData)&&!i.terrainData.wasCreatedByUpsampling())return;n(i.upsampledTerrain)&&i.upsampledTerrain.freeResources(),i.upsampledTerrain=new v({data:e.data.terrainData,x:e.x,y:e.y,level:e.level}),t.state=f.LOADING}}function x(e){var t=e.data;A(e,t,e.southwestChild),A(e,t,e.southeastChild),A(e,t,e.northwestChild),A(e,t,e.northeastChild)}function A(e,t,i){if(i.state!==f.START){var r=i.data;if(n(r.terrainData)&&!r.terrainData.wasCreatedByUpsampling())return;n(r.upsampledTerrain)&&r.upsampledTerrain.freeResources(),r.upsampledTerrain=new v({data:t.terrainData,x:e.x,y:e.y,level:e.level}),t.terrainData.isChildAvailable(e.x,e.y,i.x,i.y)&&(n(r.loadedTerrain)||(r.loadedTerrain=new v)),i.state=f.LOADING}}function P(e,t){var i=t.getTileDataAvailable(e.x,e.y,e.level);if(n(i))return i;var r=e.parent;return!n(r)||!(!n(r.data)||!n(r.data.terrainData))&&r.data.terrainData.isChildAvailable(r.x,r.y,e.x,e.y)}function D(e){var t=e.cache.tile_waterMaskData;if(!n(t)){var i=new c({context:e,pixelFormat:s.LUMINANCE,pixelDatatype:l.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});i.referenceCount=1;var r=new u({wrapS:p.CLAMP_TO_EDGE,wrapT:p.CLAMP_TO_EDGE,minificationFilter:d.LINEAR,magnificationFilter:h.LINEAR});t={allWaterTexture:i,sampler:r,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function M(e,t){var r=t.waterMaskTexture;n(r)&&(--r.referenceCount,0===r.referenceCount&&r.destroy(),t.waterMaskTexture=void 0);var o=t.terrainData.waterMask;if(n(o)){var a,u=D(e),h=o.length;if(1===h){if(0===o[0])return;a=u.allWaterTexture}else{var d=Math.sqrt(h);a=new c({context:e,pixelFormat:s.LUMINANCE,pixelDatatype:l.UNSIGNED_BYTE,source:{width:d,height:d,arrayBufferView:o},sampler:u.sampler}),a.referenceCount=0}++a.referenceCount,t.waterMaskTexture=a,i.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}}function I(e){for(var t=e.data,i=e.parent;n(i)&&!n(i.data.terrainData)||i.data.terrainData.wasCreatedByUpsampling();)i=i.parent;if(n(i)&&n(i.data.waterMaskTexture)){t.waterMaskTexture=i.data.waterMaskTexture,++t.waterMaskTexture.referenceCount;var r=i.rectangle,o=e.rectangle,a=o.width,s=o.height,l=a/r.width,u=s/r.height;t.waterMaskTranslationAndScale.x=l*(o.west-r.west)/a,t.waterMaskTranslationAndScale.y=u*(o.south-r.south)/s,t.waterMaskTranslationAndScale.z=l,t.waterMaskTranslationAndScale.w=u}}o(y.prototype,{eligibleForUnloading:{get:function(){for(var e=this.loadedTerrain,t=n(e)&&(e.state===g.RECEIVING||e.state===g.TRANSFORMING),i=this.upsampledTerrain,r=n(i)&&(i.state===g.RECEIVING||i.state===g.TRANSFORMING),o=!t&&!r,a=this.imagery,s=0,l=a.length;o&&s<l;++s){var u=a[s];o=!n(u.loadingImagery)||u.loadingImagery.state!==m.TRANSITIONING}return o}}});var R=new t,O=new t,N=new t,L=new t;return y.prototype.pick=function(e,i,r,o,s){var l=this.pickTerrain;if(n(l)){var u=l.mesh;if(n(u))for(var c=u.vertices,h=u.indices,d=u.encoding,p=h.length,m=0;m<p;m+=3){var f=h[m],_=h[m+1],g=h[m+2],v=C(d,i,r,c,f,R),y=C(d,i,r,c,_,O),w=C(d,i,r,c,g,N),S=a.rayTriangle(e,v,y,w,o,L);if(n(S))return t.clone(S,s)}}},y.prototype.freeResources=function(){n(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,0===this.waterMaskTexture.referenceCount&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),this.terrainData=void 0,n(this.loadedTerrain)&&(this.loadedTerrain.freeResources(),this.loadedTerrain=void 0),n(this.upsampledTerrain)&&(this.upsampledTerrain.freeResources(),this.upsampledTerrain=void 0),n(this.pickTerrain)&&(this.pickTerrain.freeResources(),this.pickTerrain=void 0);var e,t,i=this.imagery;for(e=0,t=i.length;e<t;++e)i[e].freeResources();this.imagery.length=0,this.freeVertexArray()},y.prototype.freeVertexArray=function(){var e;n(this.vertexArray)&&(e=this.vertexArray.indexBuffer,this.vertexArray=this.vertexArray.destroy(),!e.isDestroyed()&&n(e.referenceCount)&&(--e.referenceCount,0===e.referenceCount&&e.destroy())),n(this.wireframeVertexArray)&&(e=this.wireframeVertexArray.indexBuffer,this.wireframeVertexArray=this.wireframeVertexArray.destroy(),!e.isDestroyed()&&n(e.referenceCount)&&(--e.referenceCount,0===e.referenceCount&&e.destroy()))},y.processStateMachine=function(e,t,i,r,o){var a=e.data;n(a)||(a=e.data=new y),e.state===f.START&&(w(e,i,r),e.state=f.LOADING),e.state===f.LOADING&&S(e,t,i,o);for(var s=n(a.vertexArray),l=!n(a.loadedTerrain)&&!n(a.upsampledTerrain),u=n(a.terrainData)&&a.terrainData.wasCreatedByUpsampling(),c=a.imagery,h=0,d=c.length;h<d;++h){var p=c[h];if(n(p.loadingImagery)){if(p.loadingImagery.state===m.PLACEHOLDER){var _=p.loadingImagery.imageryLayer;if(_.imageryProvider.ready){p.freeResources(),c.splice(h,1),_._createTileImagerySkeletons(e,i,h),--h,d=c.length;continue}u=!1}var g=p.processStateMachine(e,t);l=l&&g,s=s&&(g||n(p.readyImagery)),u=u&&n(p.loadingImagery)&&(p.loadingImagery.state===m.FAILED||p.loadingImagery.state===m.INVALID)}else u=!1}e.upsampledFromParent=u,h===d&&(s&&(e.renderable=!0),l&&(e.state=f.DONE))},y}),i("Shaders/ReprojectWebMercatorFS",[],function(){"use strict";return"uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = texture2D(u_texture, v_textureCoordinates);\n}\n"}),i("Shaders/ReprojectWebMercatorVS",[],function(){"use strict";return"attribute vec4 position;\nattribute float webMercatorT;\nuniform vec2 u_textureDimensions;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nv_textureCoordinates = vec2(position.x, webMercatorT);\ngl_Position = czm_viewportOrthographic * (position * vec4(u_textureDimensions, 1.0, 1.0));\n}\n"}),i("Scene/Imagery",["../Core/defined","../Core/destroyObject","./ImageryState"],function(e,t,i){"use strict";function r(t,r,n,o,a){if(this.imageryLayer=t,this.x=r,this.y=n,this.level=o,0!==o){var s=r/2|0,l=n/2|0,u=o-1;this.parent=t.getImageryFromCache(s,l,u)}if(this.state=i.UNLOADED,this.imageUrl=void 0,this.image=void 0,this.texture=void 0,this.textureWebMercator=void 0,this.credits=void 0,this.referenceCount=0,!e(a)&&t.imageryProvider.ready){var c=t.imageryProvider.tilingScheme;a=c.tileXYToRectangle(r,n,o)}this.rectangle=a}return r.createPlaceholder=function(e){var t=new r(e,0,0,0);return t.addReference(),t.state=i.PLACEHOLDER,t},r.prototype.addReference=function(){++this.referenceCount},r.prototype.releaseReference=function(){return--this.referenceCount,0===this.referenceCount?(this.imageryLayer.removeImageryFromCache(this),e(this.parent)&&this.parent.releaseReference(),e(this.image)&&e(this.image.destroy)&&this.image.destroy(),e(this.texture)&&this.texture.destroy(),e(this.textureWebMercator)&&this.texture!==this.textureWebMercator&&this.textureWebMercator.destroy(),t(this),0):this.referenceCount},r.prototype.processStateMachine=function(e,t){this.state===i.UNLOADED&&(this.state=i.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===i.RECEIVED&&(this.state=i.TRANSITIONING,this.imageryLayer._createTexture(e.context,this));var r=this.state===i.READY&&t&&!this.texture;(this.state===i.TEXTURE_LOADED||r)&&(this.state=i.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))},r}),i("Scene/ImagerySplitDirection",["../Core/freezeObject"],function(e){"use strict";var t={LEFT:-1,NONE:0,RIGHT:1};return e(t)}),i("Scene/TileImagery",["../Core/defined","./ImageryState"],function(e,t){"use strict";function i(e,t,i){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=i}return i.prototype.freeResources=function(){e(this.readyImagery)&&this.readyImagery.releaseReference(),e(this.loadingImagery)&&this.loadingImagery.releaseReference()},i.prototype.processStateMachine=function(i,r){var n=this.loadingImagery,o=n.imageryLayer;if(n.processStateMachine(r,!this.useWebMercatorT),n.state===t.READY)return e(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=this.loadingImagery,this.loadingImagery=void 0,this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(i,this),!0;for(var a,s=n.parent;e(s)&&(s.state!==t.READY||!this.useWebMercatorT&&!e(s.texture));)s.state!==t.FAILED&&s.state!==t.INVALID&&(a=a||s),s=s.parent;return this.readyImagery!==s&&(e(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=s,e(s)&&(s.addReference(),this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(i,this))),(n.state===t.FAILED||n.state===t.INVALID)&&(!e(a)||(a.processStateMachine(r,!this.useWebMercatorT),!1))},i}),i("Scene/ImageryLayer",["../Core/Cartesian2","../Core/Cartesian4","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/FeatureDetection","../Core/GeographicTilingScheme","../Core/IndexDatatype","../Core/Math","../Core/PixelFormat","../Core/Rectangle","../Core/TerrainProvider","../Core/TileProviderError","../Core/WebMercatorProjection","../Core/WebMercatorTilingScheme","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/ComputeCommand","../Renderer/ContextLimits","../Renderer/MipmapHint","../Renderer/Sampler","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/Texture","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","../Renderer/VertexArray","../Shaders/ReprojectWebMercatorFS","../Shaders/ReprojectWebMercatorVS","../ThirdParty/when","./Imagery","./ImagerySplitDirection","./ImageryState","./TileImagery"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I,R,O,N,L){"use strict";function B(e,t){this._imageryProvider=e,t=i(t,{}),this.alpha=i(t.alpha,i(e.defaultAlpha,1)),this.brightness=i(t.brightness,i(e.defaultBrightness,B.DEFAULT_BRIGHTNESS)),this.contrast=i(t.contrast,i(e.defaultContrast,B.DEFAULT_CONTRAST)),this.hue=i(t.hue,i(e.defaultHue,B.DEFAULT_HUE)),this.saturation=i(t.saturation,i(e.defaultSaturation,B.DEFAULT_SATURATION)),this.gamma=i(t.gamma,i(e.defaultGamma,B.DEFAULT_GAMMA)),this.splitDirection=i(t.splitDirection,i(e.defaultSplit,B.DEFAULT_SPLIT)),this.show=i(t.show,!0),this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=i(t.rectangle,h.MAX_VALUE),this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new L(R.createPlaceholder(this)),this._show=!0,this._layerIndex=-1,this._isBaseLayer=!1,this._requestImageError=void 0,this._reprojectComputeCommands=[]}function F(e,t,n,o){if(u.isPowerOfTwo(o.width)&&u.isPowerOfTwo(o.height)){var a=t.cache.imageryLayer_mipmapSampler;if(!r(a)){var s=y.maximumTextureFilterAnisotropy;a=t.cache.imageryLayer_mipmapSampler=new w({wrapS:A.CLAMP_TO_EDGE,wrapT:A.CLAMP_TO_EDGE,minificationFilter:x.LINEAR_MIPMAP_LINEAR,magnificationFilter:T.LINEAR,maximumAnisotropy:Math.min(s,i(e._maximumAnisotropy,s))})}o.generateMipmap(C.NICEST), +o.sampler=a}else{var l=t.cache.imageryLayer_nonMipmapSampler;r(l)||(l=t.cache.imageryLayer_nonMipmapSampler=new w({wrapS:A.CLAMP_TO_EDGE,wrapT:A.CLAMP_TO_EDGE,minificationFilter:x.LINEAR,magnificationFilter:T.LINEAR})),o.sampler=l}n.state=N.READY}function V(e,t,i){return JSON.stringify([e,t,i])}function k(e,t,i,n){var o=t.cache.imageryLayer_reproject;if(!r(o)){o=t.cache.imageryLayer_reproject={vertexArray:void 0,shaderProgram:void 0,sampler:void 0,destroy:function(){r(this.framebuffer)&&this.framebuffer.destroy(),r(this.vertexArray)&&this.vertexArray.destroy(),r(this.shaderProgram)&&this.shaderProgram.destroy()}};for(var a=new Float32Array(256),s=0,c=0;c<64;++c){var h=c/63;a[s++]=0,a[s++]=h,a[s++]=1,a[s++]=h}var p={position:0,webMercatorT:1},m=d.getRegularGridIndices(2,64),f=_.createIndexBuffer({context:t,typedArray:m,usage:g.STATIC_DRAW,indexDatatype:l.UNSIGNED_SHORT});o.vertexArray=new P({context:t,attributes:[{index:p.position,vertexBuffer:_.createVertexBuffer({context:t,typedArray:a,usage:g.STATIC_DRAW}),componentsPerAttribute:2},{index:p.webMercatorT,vertexBuffer:_.createVertexBuffer({context:t,sizeInBytes:512,usage:g.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:f});var v=new E({sources:[M]});o.shaderProgram=S.fromCache({context:t,vertexShaderSource:v,fragmentShaderSource:D,attributeLocations:p}),o.sampler=new w({wrapS:A.CLAMP_TO_EDGE,wrapT:A.CLAMP_TO_EDGE,minificationFilter:x.LINEAR,magnificationFilter:T.LINEAR})}i.sampler=o.sampler;var y=i.width,I=i.height;q.textureDimensions.x=y,q.textureDimensions.y=I,q.texture=i;var R=Math.sin(n.south),O=.5*Math.log((1+R)/(1-R));R=Math.sin(n.north);var N=.5*Math.log((1+R)/(1-R)),L=1/(N-O),B=new b({context:t,width:y,height:I,pixelFormat:i.pixelFormat,pixelDatatype:i.pixelDatatype,preMultiplyAlpha:i.preMultiplyAlpha});u.isPowerOfTwo(y)&&u.isPowerOfTwo(I)&&B.generateMipmap(C.NICEST);for(var F=n.south,V=n.north,k=j,z=0,U=0;U<64;++U){var G=U/63,W=u.lerp(F,V,G);R=Math.sin(W);var H=.5*Math.log((1+R)/(1-R)),Y=(H-O)*L;k[z++]=Y,k[z++]=Y}o.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(k),e.shaderProgram=o.shaderProgram,e.outputTexture=B,e.uniformMap=q,e.vertexArray=o.vertexArray}function z(e,t,i){var r=e._imageryProvider,n=r.tilingScheme,o=n.ellipsoid,a=e._imageryProvider.tilingScheme instanceof s?1:Math.cos(i),l=n.rectangle,u=o.maximumRadius*l.width*a/(r.tileWidth*n.getNumberOfXTilesAtLevel(0)),c=u/t,h=Math.log(c)/Math.log(2),d=Math.round(h);return 0|d}n(B.prototype,{imageryProvider:{get:function(){return this._imageryProvider}},rectangle:{get:function(){return this._rectangle}}}),B.DEFAULT_BRIGHTNESS=1,B.DEFAULT_CONTRAST=1,B.DEFAULT_HUE=0,B.DEFAULT_SATURATION=1,B.DEFAULT_GAMMA=1,B.DEFAULT_SPLIT=O.NONE,B.prototype.isBaseLayer=function(){return this._isBaseLayer},B.prototype.isDestroyed=function(){return!1},B.prototype.destroy=function(){return o(this)};var U=new h,G=new h,W=new h,H=new h;B.prototype.getViewableRectangle=function(){var e=this._imageryProvider,t=this._rectangle;return e.readyPromise.then(function(){return h.intersection(e.rectangle,t)})},B.prototype._createTileImagerySkeletons=function(e,i,n){var o=e.data;if(r(this._minimumTerrainLevel)&&e.level<this._minimumTerrainLevel)return!1;if(r(this._maximumTerrainLevel)&&e.level>this._maximumTerrainLevel)return!1;var a=this._imageryProvider;if(r(n)||(n=o.imagery.length),!a.ready)return this._skeletonPlaceholder.loadingImagery.addReference(),o.imagery.splice(n,0,this._skeletonPlaceholder),!0;var s=a.tilingScheme instanceof f&&e.rectangle.north<m.MaximumLatitude&&e.rectangle.south>-m.MaximumLatitude,l=h.intersection(a.rectangle,this._rectangle,U),u=h.intersection(e.rectangle,l,G);if(!r(u)){if(!this.isBaseLayer())return!1;var c=l,d=e.rectangle;u=G,d.south>=c.north?u.north=u.south=c.north:d.north<=c.south?u.north=u.south=c.south:(u.south=Math.max(d.south,c.south),u.north=Math.min(d.north,c.north)),d.west>=c.east?u.west=u.east=c.east:d.east<=c.west?u.west=u.east=c.west:(u.west=Math.max(d.west,c.west),u.east=Math.min(d.east,c.east))}var p=0;u.south>0?p=u.south:u.north<0&&(p=u.north);var _=1,g=_*i.getLevelMaximumGeometricError(e.level),v=z(this,g,p);v=Math.max(0,v);var y=a.maximumLevel;if(v>y&&(v=y),r(a.minimumLevel)){var C=a.minimumLevel;v<C&&(v=C)}var w=a.tilingScheme,S=w.positionToTileXY(h.northwest(u),v),E=w.positionToTileXY(h.southeast(u),v),b=e.rectangle.width/512,T=e.rectangle.height/512,x=w.tileXYToRectangle(S.x,S.y,v);Math.abs(x.south-e.rectangle.north)<T&&S.y<E.y&&++S.y,Math.abs(x.east-e.rectangle.west)<b&&S.x<E.x&&++S.x;var A=w.tileXYToRectangle(E.x,E.y,v);Math.abs(A.north-e.rectangle.south)<T&&E.y>S.y&&--E.y,Math.abs(A.west-e.rectangle.east)<b&&E.x>S.x&&--E.x;var P,D=h.clone(e.rectangle,H),M=w.tileXYToRectangle(S.x,S.y,v),I=h.intersection(M,l,W);s?(w.rectangleToNativeRectangle(D,D),w.rectangleToNativeRectangle(M,M),w.rectangleToNativeRectangle(I,I),w.rectangleToNativeRectangle(l,l),P=w.tileXYToNativeRectangle.bind(w),b=D.width/512,T=D.height/512):P=w.tileXYToRectangle.bind(w);var R,O,N=0,B=1;!this.isBaseLayer()&&Math.abs(I.west-D.west)>=b&&(N=Math.min(1,(I.west-D.west)/D.width)),!this.isBaseLayer()&&Math.abs(I.north-D.north)>=T&&(B=Math.max(0,(I.north-D.south)/D.height));for(var F=B,V=S.x;V<=E.x;V++)if(R=N,M=P(V,S.y,v),I=h.simpleIntersection(M,l,W),r(I)){N=Math.min(1,(I.east-D.west)/D.width),V===E.x&&(this.isBaseLayer()||Math.abs(I.east-D.east)<b)&&(N=1),B=F;for(var k=S.y;k<=E.y;k++)if(O=B,M=P(V,k,v),I=h.simpleIntersection(M,l,W),r(I)){B=Math.max(0,(I.south-D.south)/D.height),k===E.y&&(this.isBaseLayer()||Math.abs(I.south-D.south)<T)&&(B=0);var q=new t(R,B,N,O),j=this.getImageryFromCache(V,k,v);o.imagery.splice(n,0,new L(j,q,s)),++n}}return!0},B.prototype._calculateTextureTranslationAndScale=function(e,i){var r=i.readyImagery.rectangle,n=e.rectangle;if(i.useWebMercatorT){var o=i.readyImagery.imageryLayer.imageryProvider.tilingScheme;r=o.rectangleToNativeRectangle(r,U),n=o.rectangleToNativeRectangle(n,H)}var a=n.width,s=n.height,l=a/r.width,u=s/r.height;return new t(l*(n.west-r.west)/a,u*(n.south-r.south)/s,l,u)},B.prototype._requestImagery=function(e){function t(t){return r(t)?(e.image=t,e.state=N.RECEIVED,void p.handleSuccess(a._requestImageError)):i()}function i(t){e.state=N.FAILED;var i="Failed to obtain image tile X: "+e.x+" Y: "+e.y+" Level: "+e.level+".";a._requestImageError=p.handleError(a._requestImageError,o,o.errorEvent,i,e.x,e.y,e.level,n,t)}function n(){e.state=N.TRANSITIONING;var n=o.requestImage(e.x,e.y,e.level);return r(n)?(r(o.getTileCredits)&&(e.credits=o.getTileCredits(e.x,e.y,e.level)),void I(n,t,i)):void(e.state=N.UNLOADED)}var o=this._imageryProvider,a=this;n()},B.prototype._createTexture=function(e,t){var i=this._imageryProvider;if(r(i.tileDiscardPolicy)){var n=i.tileDiscardPolicy;if(r(n)){if(!n.isReady())return void(t.state=N.RECEIVED);if(n.shouldDiscardImage(t.image))return void(t.state=N.INVALID)}}var o=new b({context:e,source:t.image,pixelFormat:i.hasAlphaChannel?c.RGBA:c.RGB});i.tilingScheme instanceof f?t.textureWebMercator=o:t.texture=o,t.image=void 0,t.state=N.TEXTURE_LOADED},B.prototype._reprojectTexture=function(e,t,r){var n=t.textureWebMercator||t.texture,o=t.rectangle,a=e.context;if(r=i(r,!0),r&&!(this._imageryProvider.tilingScheme instanceof s)&&o.width/n.width>1e-5){var l=this;t.addReference();var u=new v({persists:!0,owner:this,preExecute:function(e){k(e,a,n,t.rectangle)},postExecute:function(e){t.texture=e,F(l,a,t,e),t.releaseReference()}});this._reprojectComputeCommands.push(u)}else r&&(t.texture=n),F(this,a,t,n)},B.prototype.queueReprojectionCommands=function(e){for(var t=this._reprojectComputeCommands,i=t.length,r=0;r<i;++r)e.commandList.push(t[r]);t.length=0},B.prototype.cancelReprojections=function(){this._reprojectComputeCommands.length=0},B.prototype.getImageryFromCache=function(e,t,i,n){var o=V(e,t,i),a=this._imageryCache[o];return r(a)||(a=new R(this,e,t,i,n),this._imageryCache[o]=a),a.addReference(),a},B.prototype.removeImageryFromCache=function(e){var t=V(e.x,e.y,e.level);delete this._imageryCache[t]};var q={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new e,texture:void 0},j=a.supportsTypedArrays()?new Float32Array(128):void 0;return B}),i("Scene/GlobeSurfaceTileProvider",["../Core/BoundingSphere","../Core/BoxOutlineGeometry","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/GeometryInstance","../Core/GeometryPipeline","../Core/IndexDatatype","../Core/Intersect","../Core/Math","../Core/Matrix4","../Core/OrientedBoundingBox","../Core/PrimitiveType","../Core/Rectangle","../Core/SphereOutlineGeometry","../Core/TerrainQuantization","../Core/Visibility","../Core/WebMercatorProjection","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/ContextLimits","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/VertexArray","../Scene/BlendingState","../Scene/DepthFunction","../Scene/PerInstanceColorAppearance","../Scene/Primitive","./GlobeSurfaceTile","./ImageryLayer","./QuadtreeTileLoadState","./SceneMode","./ShadowMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I,R,O,N,L,B,F,V,k,z,U){"use strict";function G(e){this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.hasWaterMask=!1,this.oceanNormalMap=void 0,this.zoomedOutOceanSpecularIntensity=.5,this.enableLighting=!1,this.shadows=U.RECEIVE_ONLY,this._quadtree=void 0,this._terrainProvider=e.terrainProvider,this._imageryLayers=e.imageryLayers,this._surfaceShaderSet=e.surfaceShaderSet,this._renderState=void 0,this._blendRenderState=void 0,this._pickRenderState=void 0,this._errorEvent=new d,this._imageryLayers.layerAdded.addEventListener(G.prototype._onLayerAdded,this),this._imageryLayers.layerRemoved.addEventListener(G.prototype._onLayerRemoved,this),this._imageryLayers.layerMoved.addEventListener(G.prototype._onLayerMoved,this),this._imageryLayers.layerShownOrHidden.addEventListener(G.prototype._onLayerShownOrHidden,this),this._layerOrderChanged=!1,this._tilesToRenderByTextureCount=[],this._drawCommands=[],this._uniformMaps=[],this._pickCommands=[],this._usedDrawCommands=0,this._usedPickCommands=0,this._vertexArraysToDestroy=[],this._debug={wireframe:!1,boundingSphereTile:void 0},this._baseColor=void 0,this._firstPassInitialColor=void 0,this.baseColor=new o(0,0,.5,1)}function W(e,t){var i=e.loadingImagery;l(i)||(i=e.readyImagery);var r=t.loadingImagery;return l(r)||(r=t.readyImagery),i.imageryLayer._layerIndex-r.imageryLayer._layerIndex}function H(e){var t=e.indexBuffer;e.destroy(),!t.isDestroyed()&&l(t.referenceCount)&&(--t.referenceCount,0===t.referenceCount&&t.destroy())}function q(e){var t={u_initialColor:function(){return this.properties.initialColor},u_zoomedOutOceanSpecularIntensity:function(){return this.properties.zoomedOutOceanSpecularIntensity},u_oceanNormalMap:function(){return this.properties.oceanNormalMap},u_lightingFadeDistance:function(){return this.properties.lightingFadeDistance},u_center3D:function(){return this.properties.center3D},u_tileRectangle:function(){return this.properties.tileRectangle},u_modifiedModelView:function(){var t=e.context.uniformState.view,i=v.multiplyByPoint(t,this.properties.rtc,te);return v.setTranslation(t,i,Q),Q},u_modifiedModelViewProjection:function(){var t=e.context.uniformState.view,i=e.context.uniformState.projection,r=v.multiplyByPoint(t,this.properties.rtc,te);return v.setTranslation(t,r,J),v.multiply(i,J,J),J},u_dayTextures:function(){return this.properties.dayTextures},u_dayTextureTranslationAndScale:function(){return this.properties.dayTextureTranslationAndScale},u_dayTextureTexCoordsRectangle:function(){return this.properties.dayTextureTexCoordsRectangle},u_dayTextureUseWebMercatorT:function(){return this.properties.dayTextureUseWebMercatorT},u_dayTextureAlpha:function(){return this.properties.dayTextureAlpha},u_dayTextureBrightness:function(){return this.properties.dayTextureBrightness},u_dayTextureContrast:function(){return this.properties.dayTextureContrast},u_dayTextureHue:function(){return this.properties.dayTextureHue},u_dayTextureSaturation:function(){return this.properties.dayTextureSaturation},u_dayTextureOneOverGamma:function(){return this.properties.dayTextureOneOverGamma},u_dayIntensity:function(){return this.properties.dayIntensity},u_southAndNorthLatitude:function(){return this.properties.southAndNorthLatitude},u_southMercatorYAndOneOverHeight:function(){return this.properties.southMercatorYAndOneOverHeight},u_waterMask:function(){return this.properties.waterMask},u_waterMaskTranslationAndScale:function(){return this.properties.waterMaskTranslationAndScale},u_minMaxHeight:function(){return this.properties.minMaxHeight},u_scaleAndBias:function(){return this.properties.scaleAndBias},u_dayTextureSplit:function(){return this.properties.dayTextureSplit},properties:{initialColor:new n(0,0,.5,1),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new i(65e5,9e6),center3D:void 0,rtc:new r,modifiedModelView:new v,tileRectangle:new n,dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayTextureSplit:[],dayIntensity:0,southAndNorthLatitude:new i,southMercatorYAndOneOverHeight:new i,waterMask:void 0,waterMaskTranslationAndScale:new n,minMaxHeight:new i,scaleAndBias:new v}};return t}function j(e,t,i){var r=i.data;l(r.wireframeVertexArray)||l(r.terrainData)&&l(r.terrainData._mesh)&&(r.wireframeVertexArray=Y(e,r.vertexArray,r.terrainData._mesh))}function Y(e,t,i){var r={indices:i.indices,primitiveType:C.TRIANGLES};m.toWireframe(r);var n=r.indices,o=x.createIndexBuffer({context:e,typedArray:n,usage:A.STATIC_DRAW,indexDatatype:f.UNSIGNED_SHORT});return new R({context:e,attributes:t._attributes,indexBuffer:o})}function X(t,i,a){var s=i.data,u=P.maximumTextureImageUnits,c=s.waterMaskTexture,h=t.hasWaterMask&&l(c),d=t.oceanNormalMap,p=h&&l(d),m=t.terrainProvider.ready&&t.terrainProvider.hasVertexNormals,f=a.fog.enabled,_=U.castShadows(t.shadows),S=U.receiveShadows(t.shadows);h&&--u,p&&--u;var b=s.center,x=s.pickTerrain.mesh.encoding,A=$,I=0,R=0,O=0,N=0,L=!1;if(a.mode!==z.SCENE3D){var B=a.mapProjection,F=B.project(w.southwest(i.rectangle),ie),k=B.project(w.northeast(i.rectangle),re);if(A.x=F.x,A.y=F.y,A.z=k.x,A.w=k.y,a.mode!==z.MORPHING&&(b=ee,b.x=0,b.y=.5*(A.z+A.x),b.z=.5*(A.w+A.y),A.x-=b.y,A.y-=b.z,A.z-=b.y,A.w-=b.z),a.mode===z.SCENE2D&&x.quantization===E.BITS12){var G=1/(Math.pow(2,12)-1)*.5,W=(A.z-A.x)*G,H=(A.w-A.y)*G;A.x-=W,A.y-=H,A.z+=W,A.w+=H}B instanceof T&&(I=i.rectangle.south,R=i.rectangle.north,O=T.geodeticLatitudeToMercatorAngle(I),N=1/(T.geodeticLatitudeToMercatorAngle(R)-O),L=!0)}var Y=s.imagery,X=0,Z=Y.length,K=t._renderState,Q=t._blendRenderState,J=K,te=t._firstPassInitialColor,le=a.context;l(t._debug.boundingSphereTile)||ae();do{var ue,ce,he=0;t._drawCommands.length<=t._usedDrawCommands?(ue=new D,ue.owner=i,ue.cull=!1,ue.boundingVolume=new e,ue.orientedBoundingBox=void 0,ce=q(a),t._drawCommands.push(ue),t._uniformMaps.push(ce)):(ue=t._drawCommands[t._usedDrawCommands],ce=t._uniformMaps[t._usedDrawCommands]),ue.owner=i,++t._usedDrawCommands,i===t._debug.boundingSphereTile&&(l(s.orientedBoundingBox)?ne(s.orientedBoundingBox,o.RED).update(a):l(s.boundingSphere3D)&&oe(s.boundingSphere3D,o.RED).update(a));var de=ce.properties;n.clone(te,de.initialColor),de.oceanNormalMap=d,de.lightingFadeDistance.x=t.lightingFadeOutDistance,de.lightingFadeDistance.y=t.lightingFadeInDistance,de.zoomedOutOceanSpecularIntensity=t.zoomedOutOceanSpecularIntensity,de.center3D=s.center,r.clone(b,de.rtc),n.clone(A,de.tileRectangle),de.southAndNorthLatitude.x=I,de.southAndNorthLatitude.y=R,de.southMercatorYAndOneOverHeight.x=O,de.southMercatorYAndOneOverHeight.y=N;for(var pe=f&&g.fog(i._distance,a.fog.density)>g.EPSILON3,me=!1,fe=!1,_e=!1,ge=!1,ve=!1,ye=!1,Ce=!1;he<u&&X<Z;){var we=Y[X],Se=we.readyImagery;if(++X,l(Se)&&0!==Se.imageryLayer.alpha){var Ee=we.useWebMercatorT?Se.textureWebMercator:Se.texture,be=Se.imageryLayer;if(l(we.textureTranslationAndScale)||(we.textureTranslationAndScale=be._calculateTextureTranslationAndScale(i,we)),de.dayTextures[he]=Ee,de.dayTextureTranslationAndScale[he]=we.textureTranslationAndScale,de.dayTextureTexCoordsRectangle[he]=we.textureCoordinateRectangle,de.dayTextureUseWebMercatorT[he]=we.useWebMercatorT,de.dayTextureAlpha[he]=be.alpha,ye=ye||1!==de.dayTextureAlpha[he],de.dayTextureBrightness[he]=be.brightness,me=me||de.dayTextureBrightness[he]!==V.DEFAULT_BRIGHTNESS,de.dayTextureContrast[he]=be.contrast,fe=fe||de.dayTextureContrast[he]!==V.DEFAULT_CONTRAST,de.dayTextureHue[he]=be.hue,_e=_e||de.dayTextureHue[he]!==V.DEFAULT_HUE,de.dayTextureSaturation[he]=be.saturation,ge=ge||de.dayTextureSaturation[he]!==V.DEFAULT_SATURATION,de.dayTextureOneOverGamma[he]=1/be.gamma,ve=ve||de.dayTextureOneOverGamma[he]!==1/V.DEFAULT_GAMMA,de.dayTextureSplit[he]=be.splitDirection,Ce=Ce||0!==de.dayTextureSplit[he],l(Se.credits))for(var Te=a.creditDisplay,xe=Se.credits,Ae=0,Pe=xe.length;Ae<Pe;++Ae)Te.addCredit(xe[Ae]);++he}}de.dayTextures.length=he,de.waterMask=c,n.clone(s.waterMaskTranslationAndScale,de.waterMaskTranslationAndScale),de.minMaxHeight.x=x.minimumHeight,de.minMaxHeight.y=x.maximumHeight,v.clone(x.matrix,de.scaleAndBias),ue.shaderProgram=t._surfaceShaderSet.getShaderProgram(a,s,he,me,fe,_e,ge,ve,ye,Ce,h,p,t.enableLighting,m,L,pe),ue.castShadows=_,ue.receiveShadows=S,ue.renderState=J,ue.primitiveType=C.TRIANGLES,ue.vertexArray=s.vertexArray,ue.uniformMap=ce,ue.pass=M.GLOBE,t._debug.wireframe&&(j(le,t,i),l(s.wireframeVertexArray)&&(ue.vertexArray=s.wireframeVertexArray,ue.primitiveType=C.LINES));var De=ue.boundingVolume,Me=ue.orientedBoundingBox;a.mode!==z.SCENE3D?(e.fromRectangleWithHeights2D(i.rectangle,a.mapProjection,s.minimumHeight,s.maximumHeight,De),r.fromElements(De.center.z,De.center.x,De.center.y,De.center),a.mode===z.MORPHING&&(De=e.union(s.boundingSphere3D,De,De))):(ue.boundingVolume=e.clone(s.boundingSphere3D,De),ue.orientedBoundingBox=y.clone(s.orientedBoundingBox,Me)),a.commandList.push(ue),J=Q,te=se}while(X<Z)}function Z(e,t,i){var r;e._pickCommands.length<=e._usedPickCommands?(r=new D,r.cull=!1,e._pickCommands.push(r)):r=e._pickCommands[e._usedPickCommands],++e._usedPickCommands;var n=t.owner.data,o=i.projection instanceof T;r.shaderProgram=e._surfaceShaderSet.getPickShaderProgram(i,n,o),r.renderState=e._pickRenderState,r.owner=t.owner,r.primitiveType=t.primitiveType,r.vertexArray=t.vertexArray,r.uniformMap=t.uniformMap,r.boundingVolume=t.boundingVolume,r.orientedBoundingBox=t.orientedBoundingBox,r.pass=t.pass,i.commandList.push(r)}u(G.prototype,{baseColor:{get:function(){return this._baseColor},set:function(e){this._baseColor=e,this._firstPassInitialColor=n.fromColor(e,this._firstPassInitialColor)}},quadtree:{get:function(){return this._quadtree},set:function(e){this._quadtree=e}},ready:{get:function(){return this._terrainProvider.ready&&(0===this._imageryLayers.length||this._imageryLayers.get(0).imageryProvider.ready)}},tilingScheme:{get:function(){return this._terrainProvider.tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){this._terrainProvider!==e&&(this._terrainProvider=e,l(this._quadtree)&&this._quadtree.invalidateAllTiles())}}}),G.prototype.initialize=function(e){var t=this._imageryLayers;t._update(),t.queueReprojectionCommands(e),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(e){e.data.imagery.sort(W)}));var i=e.creditDisplay;this._terrainProvider.ready&&l(this._terrainProvider.credit)&&i.addCredit(this._terrainProvider.credit);for(var r=0,n=t.length;r<n;++r){var o=t.get(r).imageryProvider;o.ready&&l(o.credit)&&i.addCredit(o.credit)}for(var a=this._vertexArraysToDestroy,s=a.length,u=0;u<s;++u)H(a[u]);a.length=0},G.prototype.beginUpdate=function(e){for(var t=this._tilesToRenderByTextureCount,i=0,r=t.length;i<r;++i){var n=t[i];l(n)&&(n.length=0)}this._usedDrawCommands=0},G.prototype.endUpdate=function(e){l(this._renderState)||(this._renderState=I.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:N.LESS}}),this._blendRenderState=I.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:N.LESS_OR_EQUAL},blending:O.ALPHA_BLEND}));for(var t=this._tilesToRenderByTextureCount,i=0,r=t.length;i<r;++i){var n=t[i];if(l(n))for(var o=0,a=n.length;o<a;++o)X(this,n[o],e)}},G.prototype.updateForPick=function(e){l(this._pickRenderState)||(this._pickRenderState=I.fromCache({colorMask:{red:!1,green:!1,blue:!1,alpha:!1},depthTest:{enabled:!0}})),this._usedPickCommands=0;for(var t=this._drawCommands,i=0,r=this._usedDrawCommands;i<r;++i)Z(this,t[i],e)},G.prototype.cancelReprojections=function(){this._imageryLayers.cancelReprojections()},G.prototype.getLevelMaximumGeometricError=function(e){return this._terrainProvider.getLevelMaximumGeometricError(e)},G.prototype.loadTile=function(e,t){F.processStateMachine(t,e,this._terrainProvider,this._imageryLayers,this._vertexArraysToDestroy)};var K=new e;G.prototype.computeTileVisibility=function(t,i,n){var o=this.computeDistanceToTile(t,i);if(t._distance=o,i.fog.enabled&&g.fog(o,i.fog.density)>=1)return b.NONE;var a=t.data,u=i.cullingVolume,c=s(a.orientedBoundingBox,a.boundingSphere3D);i.mode!==z.SCENE3D&&(c=K,e.fromRectangleWithHeights2D(t.rectangle,i.mapProjection,a.minimumHeight,a.maximumHeight,c),r.fromElements(c.center.z,c.center.x,c.center.y,c.center),i.mode===z.MORPHING&&(c=e.union(a.boundingSphere3D,c,c)));var h=u.computeVisibility(c);if(h===_.OUTSIDE)return b.NONE;if(i.mode===z.SCENE3D){var d=a.occludeePointInScaledSpace;return l(d)?n.ellipsoid.isScaledSpacePointVisible(d)?h:b.NONE:h}return h};var Q=new v,J=new v,$=new n,ee=new r,te=new r,ie=new r,re=new r;G.prototype.showTileThisFrame=function(e,t){for(var i=0,r=e.data.imagery,n=0,o=r.length;n<o;++n){var a=r[n];l(a.readyImagery)&&0!==a.readyImagery.imageryLayer.alpha&&++i}var s=this._tilesToRenderByTextureCount[i];l(s)||(s=[],this._tilesToRenderByTextureCount[i]=s),s.push(e);var u=this._debug;++u.tilesRendered,u.texturesRendered+=i},G.prototype.computeDistanceToTile=function(e,t){var i=e.data,r=i.tileBoundingBox;return r.distanceToCamera(t)},G.prototype.isDestroyed=function(){return!1},G.prototype.destroy=function(){return this._tileProvider=this._tileProvider&&this._tileProvider.destroy(),c(this)},G.prototype._onLayerAdded=function(e,t){if(e.show){var i=this._terrainProvider;this._quadtree.forEachLoadedTile(function(t){e._createTileImagerySkeletons(t,i)&&(t.state=k.LOADING)}),this._layerOrderChanged=!0}},G.prototype._onLayerRemoved=function(e,t){this._quadtree.forEachLoadedTile(function(t){for(var i=t.data.imagery,r=-1,n=0,o=0,a=i.length;o<a;++o){var s=i[o],u=s.loadingImagery;if(l(u)||(u=s.readyImagery),u.imageryLayer===e)r===-1&&(r=o),s.freeResources(),++n;else if(r!==-1)break}r!==-1&&i.splice(r,n)})},G.prototype._onLayerMoved=function(e,t,i){this._layerOrderChanged=!0},G.prototype._onLayerShownOrHidden=function(e,t,i){i?this._onLayerAdded(e,t):this._onLayerRemoved(e,t)};var ne,oe,ae;!function(){function e(e){return new B({geometryInstances:e,appearance:new L({translucent:!1,flat:!0}),asynchronous:!1})}var i,n,o=new p({geometry:t.fromDimensions({dimensions:new r(2,2,2)})}),s=new p({geometry:new S({radius:1})}),u=new v;ne=function(t,r){return t===i?n:(ae(),i=t,u=v.fromRotationTranslation(t.halfAxes,t.center,u),o.modelMatrix=u,o.attributes.color=a.fromColor(r),n=e(o))},oe=function(t,r){return t===i?n:(ae(),i=t,u=v.fromTranslation(t.center,u),u=v.multiplyByUniformScale(u,t.radius,u),s.modelMatrix=u,s.attributes.color=a.fromColor(r),n=e(s))},ae=function(){l(n)&&(n.destroy(),n=void 0,i=void 0)}}();var se=new n(0,0,0,0);return G}),i("Scene/ImageryLayerCollection",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/Math","../Core/Rectangle","../ThirdParty/when","./ImageryLayer"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(){this._layers=[],this.layerAdded=new o,this.layerRemoved=new o,this.layerMoved=new o,this.layerShownOrHidden=new o}function h(e,t){var i=e.indexOf(t);return i}function d(e,t,i){var r=e._layers;if(t=a.clamp(t,0,r.length-1),i=a.clamp(i,0,r.length-1),t!==i){var n=r[t];r[t]=r[i],r[i]=n,e._update(),e.layerMoved.raiseEvent(n,i,t)}}i(c.prototype,{length:{get:function(){return this._layers.length}}}),c.prototype.add=function(e,i){var r=t(i);r?this._layers.splice(i,0,e):(i=this._layers.length,this._layers.push(e)),this._update(),this.layerAdded.raiseEvent(e,i)},c.prototype.addImageryProvider=function(e,t){var i=new u(e);return this.add(i,t),i},c.prototype.remove=function(t,i){i=e(i,!0);var r=this._layers.indexOf(t);return r!==-1&&(this._layers.splice(r,1),this._update(),this.layerRemoved.raiseEvent(t,r),i&&t.destroy(),!0)},c.prototype.removeAll=function(t){t=e(t,!0);for(var i=this._layers,r=0,n=i.length;r<n;r++){var o=i[r];this.layerRemoved.raiseEvent(o,r),t&&o.destroy()}this._layers=[]},c.prototype.contains=function(e){return this.indexOf(e)!==-1},c.prototype.indexOf=function(e){return this._layers.indexOf(e)},c.prototype.get=function(e){return this._layers[e]},c.prototype.raise=function(e){var t=h(this._layers,e);d(this,t,t+1)},c.prototype.lower=function(e){var t=h(this._layers,e);d(this,t,t-1)},c.prototype.raiseToTop=function(e){var t=h(this._layers,e);t!==this._layers.length-1&&(this._layers.splice(t,1),this._layers.push(e),this._update(),this.layerMoved.raiseEvent(e,this._layers.length-1,t))},c.prototype.lowerToBottom=function(e){var t=h(this._layers,e);0!==t&&(this._layers.splice(t,1),this._layers.splice(0,0,e),this._update(),this.layerMoved.raiseEvent(e,0,t))};var p=new s;return c.prototype.pickImageryLayerFeatures=function(e,i){var r=i.globe.pick(e,i);if(t(r)){for(var n,o=i.globe.ellipsoid.cartesianToCartographic(r),u=i.globe._surface._tilesToRender,c=0;!t(n)&&c<u.length;++c){var h=u[c];s.contains(h.rectangle,o)&&(n=h)}if(t(n)){for(var d=n.data.imagery,m=[],f=[],_=d.length-1;_>=0;--_){var g=d[_],v=g.readyImagery;if(t(v)){var y=v.imageryLayer.imageryProvider;if(t(y.pickFeatures)&&s.contains(v.rectangle,o)){var C=p,w=1/1024;if(C.west=a.lerp(n.rectangle.west,n.rectangle.east,g.textureCoordinateRectangle.x-w),C.east=a.lerp(n.rectangle.west,n.rectangle.east,g.textureCoordinateRectangle.z+w),C.south=a.lerp(n.rectangle.south,n.rectangle.north,g.textureCoordinateRectangle.y-w),C.north=a.lerp(n.rectangle.south,n.rectangle.north,g.textureCoordinateRectangle.w+w),s.contains(C,o)){var S=y.pickFeatures(v.x,v.y,v.level,o.longitude,o.latitude);t(S)&&(m.push(S),f.push(v.imageryLayer))}}}}if(0!==m.length)return l.all(m,function(e){for(var i=[],r=0;r<e.length;++r){var n=e[r],a=f[r];if(t(n)&&n.length>0)for(var s=0;s<n.length;++s){var l=n[s];l.imageryLayer=a,t(l.position)||(l.position=o),i.push(l)}}return i})}}},c.prototype.queueReprojectionCommands=function(e){for(var t=this._layers,i=0,r=t.length;i<r;++i)t[i].queueReprojectionCommands(e)},c.prototype.cancelReprojections=function(){for(var e=this._layers,t=0,i=e.length;t<i;++t)e[t].cancelReprojections()},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){return this.removeAll(!0),r(this)},c.prototype._update=function(){for(var e,i,r=!0,n=this._layers,o=0,a=n.length;o<a;++o)i=n[o],i._layerIndex=o,i.show?(i._isBaseLayer=r,r=!1):i._isBaseLayer=!1,i.show!==i._show&&(t(i._show)&&(t(e)||(e=[]),e.push(i)),i._show=i.show);if(t(e))for(o=0,a=e.length;o<a;++o)i=e[o],this.layerShownOrHidden.raiseEvent(i,i._layerIndex,i.show)},c}),i("Scene/QuadtreeOccluders",["../Core/Cartesian3","../Core/defineProperties","../Core/EllipsoidalOccluder"],function(e,t,i){"use strict";function r(t){this._ellipsoid=new i(t.ellipsoid,e.ZERO)}return t(r.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),r}),i("Scene/QuadtreeTile",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Rectangle","./QuadtreeTileLoadState"],function(e,t,i,r,n){"use strict";function o(e){this._tilingScheme=e.tilingScheme,this._x=e.x,this._y=e.y,this._level=e.level,this._parent=e.parent,this._rectangle=this._tilingScheme.tileXYToRectangle(this._x,this._y,this._level),this._southwestChild=void 0,this._southeastChild=void 0,this._northwestChild=void 0,this._northeastChild=void 0,this._replacementPrevious=void 0,this._replacementNext=void 0,this._distance=0,this._customData=[],this._frameUpdated=void 0,this._frameRendered=void 0,this.state=n.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}function a(t){e(t)&&t.freeResources()}return o.createLevelZeroTiles=function(e){for(var t=e.getNumberOfXTilesAtLevel(0),i=e.getNumberOfYTilesAtLevel(0),r=new Array(t*i),n=0,a=0;a<i;++a)for(var s=0;s<t;++s)r[n++]=new o({tilingScheme:e,x:s,y:a,level:0});return r},o.prototype._updateCustomData=function(t,i,n){var o,a,s,l=this.customData;if(e(i)&&e(n)){for(l=l.filter(function(e){return n.indexOf(e)===-1}),this._customData=l,s=this._rectangle,o=0;o<i.length;++o)a=i[o],r.contains(s,a.positionCartographic)&&l.push(a);this._frameUpdated=t}else{var u=this._parent;if(e(u)&&this._frameUpdated!==u._frameUpdated){l.length=0,s=this._rectangle;var c=u.customData;for(o=0;o<c.length;++o)a=c[o],r.contains(s,a.positionCartographic)&&l.push(a);this._frameUpdated=u._frameUpdated}}},t(o.prototype,{tilingScheme:{get:function(){return this._tilingScheme}},x:{get:function(){return this._x}},y:{get:function(){return this._y}},level:{get:function(){return this._level}},parent:{get:function(){return this._parent}},rectangle:{get:function(){return this._rectangle}},children:{get:function(){return[this.northwestChild,this.northeastChild,this.southwestChild,this.southeastChild]}},southwestChild:{get:function(){return e(this._southwestChild)||(this._southwestChild=new o({tilingScheme:this.tilingScheme,x:2*this.x,y:2*this.y+1,level:this.level+1,parent:this})),this._southwestChild}},southeastChild:{get:function(){return e(this._southeastChild)||(this._southeastChild=new o({tilingScheme:this.tilingScheme,x:2*this.x+1,y:2*this.y+1,level:this.level+1,parent:this})),this._southeastChild}},northwestChild:{get:function(){return e(this._northwestChild)||(this._northwestChild=new o({tilingScheme:this.tilingScheme,x:2*this.x,y:2*this.y,level:this.level+1,parent:this})),this._northwestChild}},northeastChild:{get:function(){return e(this._northeastChild)||(this._northeastChild=new o({tilingScheme:this.tilingScheme,x:2*this.x+1,y:2*this.y,level:this.level+1,parent:this})),this._northeastChild}},customData:{get:function(){return this._customData}},needsLoading:{get:function(){return this.state<n.DONE}},eligibleForUnloading:{get:function(){var t=!0;return e(this.data)&&(t=this.data.eligibleForUnloading,e(t)||(t=!0)),t}}}),o.prototype.freeResources=function(){this.state=n.START,this.renderable=!1,this.upsampledFromParent=!1,e(this.data)&&e(this.data.freeResources)&&this.data.freeResources(),a(this._southwestChild),this._southwestChild=void 0,a(this._southeastChild),this._southeastChild=void 0,a(this._northwestChild),this._northwestChild=void 0,a(this._northeastChild),this._northeastChild=void 0},o}),i("Scene/TileReplacementQueue",["../Core/defined"],function(e){"use strict";function t(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}function i(e,t){var i=t.replacementPrevious,r=t.replacementNext;t===e._lastBeforeStartOfFrame&&(e._lastBeforeStartOfFrame=r),t===e.head?e.head=r:i.replacementNext=r,t===e.tail?e.tail=i:r.replacementPrevious=i,t.replacementPrevious=void 0,t.replacementNext=void 0,--e.count}return t.prototype.markStartOfRenderFrame=function(){ +this._lastBeforeStartOfFrame=this.head},t.prototype.trimTiles=function(t){for(var r=this.tail,n=!0;n&&e(this._lastBeforeStartOfFrame)&&this.count>t&&e(r);){n=r!==this._lastBeforeStartOfFrame;var o=r.replacementPrevious;r.eligibleForUnloading&&(r.freeResources(),i(this,r)),r=o}},t.prototype.markTileRendered=function(t){var r=this.head;return r===t?void(t===this._lastBeforeStartOfFrame&&(this._lastBeforeStartOfFrame=t.replacementNext)):(++this.count,e(r)?((e(t.replacementPrevious)||e(t.replacementNext))&&i(this,t),t.replacementPrevious=void 0,t.replacementNext=r,r.replacementPrevious=t,void(this.head=t)):(t.replacementPrevious=void 0,t.replacementNext=void 0,this.head=t,void(this.tail=t)))},t}),i("Scene/QuadtreePrimitive",["../Core/Cartesian3","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/getTimestamp","../Core/Math","../Core/Queue","../Core/Ray","../Core/Rectangle","../Core/Visibility","./QuadtreeOccluders","./QuadtreeTile","./QuadtreeTileLoadState","./SceneMode","./TileReplacementQueue"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g){"use strict";function v(e){this._tileProvider=e.tileProvider,this._tileProvider.quadtree=this,this._debug={enableDebugOutput:!1,maxDepth:0,tilesVisited:0,tilesCulled:0,tilesRendered:0,tilesWaitingForChildren:0,lastMaxDepth:-1,lastTilesVisited:-1,lastTilesCulled:-1,lastTilesRendered:-1,lastTilesWaitingForChildren:-1,suspendLodUpdate:!1};var t=this._tileProvider.tilingScheme,r=t.ellipsoid;this._tilesToRender=[],this._tileLoadQueueHigh=[],this._tileLoadQueueMedium=[],this._tileLoadQueueLow=[],this._tileReplacementQueue=new g,this._levelZeroTiles=void 0,this._levelZeroTilesReady=!1,this._loadQueueTimeSlice=5,this._addHeightCallbacks=[],this._removeHeightCallbacks=[],this._tileToUpdateHeights=[],this._lastTileIndex=0,this._updateHeightsTimeSlice=2,this.maximumScreenSpaceError=i(e.maximumScreenSpaceError,2),this.tileCacheSize=i(e.tileCacheSize,100),this._occluders=new p({ellipsoid:r}),this._tileLoadProgressEvent=new a,this._lastTileLoadQueueLength=0}function y(e,t){var i=h.center(e.rectangle,L),r=i.longitude-N.longitude,n=i.latitude-N.latitude;i=h.center(t.rectangle,L);var o=i.longitude-N.longitude,a=i.latitude-N.latitude;return r*r+n*n-(o*o+a*a)}function C(e,t){var i=e._debug;if(!i.suspendLodUpdate){var n,o,a=e._tilesToRender;if(a.length=0,!r(e._levelZeroTiles)){if(!e._tileProvider.ready)return;var s=e._tileProvider.tilingScheme;e._levelZeroTiles=m.createLevelZeroTiles(s)}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;var l,u=e._tileProvider,c=e._occluders,h=e._levelZeroTiles;N=t.camera.positionCartographic,h.sort(y);var p=e._addHeightCallbacks,f=e._removeHeightCallbacks,_=t.frameNumber;if(p.length>0||f.length>0){for(n=0,o=h.length;n<o;++n)l=h[n],l._updateCustomData(_,p,f);p.length=0,f.length=0}for(n=0,o=h.length;n<o;++n)l=h[n],e._tileReplacementQueue.markTileRendered(l),l.renderable?u.computeTileVisibility(l,t,c)!==d.NONE?w(e,t,l):(l.needsLoading&&e._tileLoadQueueLow.push(l),++i.tilesCulled):(l.needsLoading&&e._tileLoadQueueHigh.push(l),++i.tilesWaitingForChildren);x(e)}}function w(e,t,i){var r=e._debug;if(++r.tilesVisited,e._tileReplacementQueue.markTileRendered(i),i._updateCustomData(t.frameNumber),i.level>r.maxDepth&&(r.maxDepth=i.level),A(e,t,i)<e.maximumScreenSpaceError)return i.needsLoading&&e._tileLoadQueueMedium.push(i),void D(e,i);var n=i.southwestChild,o=i.southeastChild,a=i.northwestChild,s=i.northeastChild,l=n.renderable&&o.renderable&&a.renderable&&s.renderable,u=n.upsampledFromParent&&o.upsampledFromParent&&a.upsampledFromParent&&s.upsampledFromParent;l?u?(D(e,i),S(e,t.camera.positionCartographic,n,o,a,s),i.needsLoading&&e._tileLoadQueueMedium.push(i)):(b(e,n,o,a,s,t),i.needsLoading&&e._tileLoadQueueLow.push(i)):(S(e,t.camera.positionCartographic,n,o,a,s),D(e,i),i.needsLoading&&e._tileLoadQueueLow.push(i))}function S(e,t,i,r,n,o){t.longitude<i.east?t.latitude<i.north?(E(e,i),E(e,r),E(e,n),E(e,o)):(E(e,n),E(e,i),E(e,o),E(e,r)):t.latitude<i.north?(E(e,r),E(e,i),E(e,o),E(e,n)):(E(e,o),E(e,n),E(e,r),E(e,i))}function E(e,t){e._tileReplacementQueue.markTileRendered(t),t.needsLoading&&(t.renderable?e._tileLoadQueueLow.push(t):e._tileLoadQueueHigh.push(t))}function b(e,t,i,r,n,o){var a=o.camera.positionCartographic,s=e._tileProvider,l=e._occluders;a.longitude<t.rectangle.east?a.latitude<t.rectangle.north?(T(e,t,s,o,l),T(e,i,s,o,l),T(e,r,s,o,l),T(e,n,s,o,l)):(T(e,r,s,o,l),T(e,t,s,o,l),T(e,n,s,o,l),T(e,i,s,o,l)):a.latitude<t.rectangle.north?(T(e,i,s,o,l),T(e,t,s,o,l),T(e,n,s,o,l),T(e,r,s,o,l)):(T(e,n,s,o,l),T(e,r,s,o,l),T(e,i,s,o,l),T(e,t,s,o,l))}function T(e,t,i,r,n){i.computeTileVisibility(t,r,n)!==d.NONE?w(e,r,t):(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t))}function x(e){var t=e._tileLoadQueueHigh.length+e._tileLoadQueueMedium.length+e._tileLoadQueueLow.length;t!==e._lastTileLoadQueueLength&&(e._tileLoadProgressEvent.raiseEvent(t),e._lastTileLoadQueueLength=t)}function A(e,t,i){if(t.mode===_.SCENE2D)return P(e,t,i);var r=e._tileProvider.getLevelMaximumGeometricError(i.level),n=i._distance,o=t.context.drawingBufferHeight,a=t.camera.frustum.sseDenominator,s=r*o/(n*a);return t.fog.enabled&&(s-=l.fog(n,t.fog.density)*t.fog.sse),s}function P(e,t,i){var r=t.camera,n=r.frustum,o=t.context,a=o.drawingBufferWidth,s=o.drawingBufferHeight,l=e._tileProvider.getLevelMaximumGeometricError(i.level),u=Math.max(n.top-n.bottom,n.right-n.left)/Math.max(a,s);return l/u}function D(e,t){e._tilesToRender.push(t),++e._debug.tilesRendered}function M(e,t){var i=e._tileLoadQueueHigh,r=e._tileLoadQueueMedium,n=e._tileLoadQueueLow,o=e._tileProvider;if(0!==i.length||0!==r.length||0!==n.length){e._tileReplacementQueue.trimTiles(e.tileCacheSize);var a=s()+e._loadQueueTimeSlice;I(e,t,o,a,i),I(e,t,o,a,r),I(e,t,o,a,n)}}function I(e,t,i,r,n){for(var o=0,a=n.length;o<a&&s()<r;++o){var l=n[o];e._tileReplacementQueue.markTileRendered(l),i.loadTile(t,l)}}function R(n,o){for(var a=n._tileToUpdateHeights,l=n._tileProvider.terrainProvider,u=s(),c=n._updateHeightsTimeSlice,d=u+c,p=o.mode,m=o.mapProjection,f=m.ellipsoid;a.length>0;){for(var g=a[0],v=g.customData,y=v.length,C=!1,w=n._lastTileIndex;w<y;++w){var S=v[w];if(g.level>S.level){if(r(S.positionOnEllipsoidSurface)||(S.positionOnEllipsoidSurface=e.fromRadians(S.positionCartographic.longitude,S.positionCartographic.latitude,0,f)),p===_.SCENE3D){var E=f.geodeticSurfaceNormal(S.positionOnEllipsoidSurface,B.direction),b=f.getSurfaceNormalIntersectionWithZAxis(S.positionOnEllipsoidSurface,11500,B.origin);if(!r(b)){var T=Math.min(i(g.data.minimumHeight,0),-11500),x=e.multiplyByScalar(E,Math.abs(T)+1,V);e.subtract(S.positionOnEllipsoidSurface,x,B.origin)}}else t.clone(S.positionCartographic,F),F.height=-11500,m.project(F,V),e.fromElements(V.z,V.x,V.y,V),e.clone(V,B.origin),e.clone(e.UNIT_X,B.direction);var A=g.data.pick(B,p,m,!1,V);r(A)&&S.callback(A),S.level=g.level}else if(g.level===S.level){for(var P,D=g.children,M=D.length,I=0;I<M&&(P=D[I],!h.contains(P.rectangle,S.positionCartographic));++I);var R=l.getTileDataAvailable(P.x,P.y,P.level),O=g.parent;(r(R)&&!R||r(O)&&r(O.data)&&r(O.data.terrainData)&&!O.data.terrainData.isChildAvailable(O.x,O.y,P.x,P.y))&&S.removeFunc()}if(s()>=d){C=!0;break}}if(C){n._lastTileIndex=w;break}n._lastTileIndex=0,a.shift()}}function O(e,t){for(var i=e._tileProvider,r=e._tilesToRender,n=e._tileToUpdateHeights,o=0,a=r.length;o<a;++o){var s=r[o];i.showTileThisFrame(s,t),s._frameRendered!==t.frameNumber-1&&n.push(s),s._frameRendered=t.frameNumber}}n(v.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}}}),v.prototype.invalidateAllTiles=function(){var e=this._tileReplacementQueue;e.head=void 0,e.tail=void 0,e.count=0;var t=this._levelZeroTiles;if(r(t))for(var i=0;i<t.length;++i){for(var n=t[i],o=n.customData,a=o.length,s=0;s<a;++s){var l=o[s];l.level=0,this._addHeightCallbacks.push(l)}t[i].freeResources()}this._levelZeroTiles=void 0,this._tileProvider.cancelReprojections()},v.prototype.forEachLoadedTile=function(e){for(var t=this._tileReplacementQueue.head;r(t);)t.state!==f.START&&e(t),t=t.replacementNext},v.prototype.forEachRenderedTile=function(e){for(var t=this._tilesToRender,i=0,r=t.length;i<r;++i)e(t[i])},v.prototype.updateHeight=function(e,t){var i=this,r={positionOnEllipsoidSurface:void 0,positionCartographic:e,level:-1,callback:t};return r.removeFunc=function(){for(var e=i._addHeightCallbacks,t=e.length,n=0;n<t;++n)if(e[n]===r){e.splice(n,1);break}i._removeHeightCallbacks.push(r)},i._addHeightCallbacks.push(r),r.removeFunc},v.prototype.beginFrame=function(e){var t=e.passes;if(t.render){this._tileProvider.initialize(e);var i=this._debug;i.suspendLodUpdate||(i.maxDepth=0,i.tilesVisited=0,i.tilesCulled=0,i.tilesRendered=0,i.tilesWaitingForChildren=0,this._tileLoadQueueHigh.length=0,this._tileLoadQueueMedium.length=0,this._tileLoadQueueLow.length=0,this._tileReplacementQueue.markStartOfRenderFrame())}},v.prototype.update=function(e){var t=e.passes;t.render&&(this._tileProvider.beginUpdate(e),C(this,e),O(this,e),this._tileProvider.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&this._tileProvider.updateForPick(e)},v.prototype.endFrame=function(e){var t=e.passes;if(t.render&&e.mode!==_.MORPHING){M(this,e),R(this,e);var i=this._debug;i.suspendLodUpdate||i.enableDebugOutput&&(i.tilesVisited===i.lastTilesVisited&&i.tilesRendered===i.lastTilesRendered&&i.tilesCulled===i.lastTilesCulled&&i.maxDepth===i.lastMaxDepth&&i.tilesWaitingForChildren===i.lastTilesWaitingForChildren||(console.log("Visited "+i.tilesVisited+", Rendered: "+i.tilesRendered+", Culled: "+i.tilesCulled+", Max Depth: "+i.maxDepth+", Waiting for children: "+i.tilesWaitingForChildren),i.lastTilesVisited=i.tilesVisited,i.lastTilesRendered=i.tilesRendered,i.lastTilesCulled=i.tilesCulled,i.lastMaxDepth=i.maxDepth,i.lastTilesWaitingForChildren=i.tilesWaitingForChildren))}},v.prototype.isDestroyed=function(){return!1},v.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var N,L=new t,B=new c,F=new t,V=new e;return v}),i("Scene/Globe",["../Core/BoundingSphere","../Core/buildModuleUrl","../Core/Cartesian3","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Ellipsoid","../Core/EllipsoidTerrainProvider","../Core/Event","../Core/IntersectionTests","../Core/loadImage","../Core/Math","../Core/Ray","../Core/Rectangle","../Renderer/ShaderSource","../Renderer/Texture","../Shaders/GlobeFS","../Shaders/GlobeVS","../Shaders/GroundAtmosphere","../ThirdParty/when","./GlobeSurfaceShaderSet","./GlobeSurfaceTileProvider","./ImageryLayerCollection","./QuadtreePrimitive","./SceneMode","./ShadowMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A,P){"use strict";function D(e){e=n(e,u.WGS84);var i=new c({ellipsoid:e}),r=new T;this._ellipsoid=e,this._imageryLayerCollection=r,this._surfaceShaderSet=new E,this._surfaceShaderSet.baseVertexShaderSource=new g({sources:[w,C]}),this._surfaceShaderSet.baseFragmentShaderSource=new g({sources:[y]}),this._surface=new x({tileProvider:new b({terrainProvider:i,imageryLayers:r,surfaceShaderSet:this._surfaceShaderSet})}),this._terrainProvider=i,this._terrainProviderChanged=new h,this.show=!0,this.oceanNormalMapUrl=t("Assets/Textures/waterNormalsSmall.jpg"),this._oceanNormalMapUrl=void 0,this.maximumScreenSpaceError=2,this.tileCacheSize=100,this.enableLighting=!1,this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.showWaterEffect=!0,this.depthTestAgainstTerrain=!1,this.shadows=P.RECEIVE_ONLY,this._oceanNormalMap=void 0,this._zoomedOutOceanSpecularIntensity=.5}function M(t){return function(i,r){var n=e.distanceSquaredTo(i.pickBoundingSphere,t),o=e.distanceSquaredTo(r.pickBoundingSphere,t);return n-o}}function I(e,t){return _.contains(e.rectangle,t)?e:void 0}a(D.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},imageryLayers:{get:function(){return this._imageryLayerCollection}},baseColor:{get:function(){return this._surface.tileProvider.baseColor},set:function(e){this._surface.tileProvider.baseColor=e}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){e!==this._terrainProvider&&(this._terrainProvider=e,this._terrainProviderChanged.raiseEvent(e))}},terrainProviderChanged:{get:function(){return this._terrainProviderChanged}},tileLoadProgressEvent:{get:function(){return this._surface.tileLoadProgressEvent}}});var R=[],O={start:0,stop:0};D.prototype.pick=function(t,r,n){var a=r.mode,s=r.mapProjection,l=R;l.length=0;var u,c,h=this._surface._tilesToRender,p=h.length;for(c=0;c<p;++c){u=h[c];var m=u.data;if(o(m)){var f=m.pickBoundingSphere;a!==A.SCENE3D?(e.fromRectangleWithHeights2D(u.rectangle,s,m.minimumHeight,m.maximumHeight,f),i.fromElements(f.center.z,f.center.x,f.center.y,f.center)):e.clone(m.boundingSphere3D,f);var _=d.raySphere(t,f,O);o(_)&&l.push(m)}}l.sort(M(t.origin));var g;for(p=l.length,c=0;c<p&&(g=l[c].pick(t,r.mode,r.mapProjection,!0,n),!o(g));++c);return g};var N=new i,L=new i,B=new r,F=new f;return D.prototype.getHeight=function(e){var t=this._surface._levelZeroTiles;if(o(t)){var r,a,s=t.length;for(a=0;a<s&&(r=t[a],!_.contains(r.rectangle,e));++a);if(o(r)&&_.contains(r.rectangle,e)){for(;r.renderable;)r=I(r.southwestChild,e)||I(r.southeastChild,e)||I(r.northwestChild,e)||r.northeastChild;for(;o(r)&&(!o(r.data)||!o(r.data.pickTerrain));)r=r.parent;if(o(r)){var l=this._surface._tileProvider.tilingScheme.ellipsoid,u=i.fromRadians(e.longitude,e.latitude,0,l,N),c=F,h=l.geodeticSurfaceNormal(u,c.direction),d=l.getSurfaceNormalIntersectionWithZAxis(u,11500,c.origin);if(!o(d)){var p=Math.min(n(r.data.minimumHeight,0),-11500),m=i.multiplyByScalar(h,Math.abs(p)+1,L);i.subtract(u,m,c.origin)}var f=r.data.pick(c,void 0,void 0,!1,L);if(o(f))return l.cartesianToCartographic(f,B).height}}}},D.prototype.beginFrame=function(e){if(this.show){var t=this._surface,i=t.tileProvider,r=this.terrainProvider,n=this.showWaterEffect&&r.ready&&r.hasWaterMask;if(n&&this.oceanNormalMapUrl!==this._oceanNormalMapUrl){var a=this.oceanNormalMapUrl;if(this._oceanNormalMapUrl=a,o(a)){var s=this;S(p(a),function(t){a===s.oceanNormalMapUrl&&(s._oceanNormalMap=s._oceanNormalMap&&s._oceanNormalMap.destroy(),s._oceanNormalMap=new v({context:e.context,source:t}))})}else this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy()}var l=e.mode,u=e.passes;u.render&&(l===A.SCENE3D?this._zoomedOutOceanSpecularIntensity=.5:this._zoomedOutOceanSpecularIntensity=0,t.maximumScreenSpaceError=this.maximumScreenSpaceError,t.tileCacheSize=this.tileCacheSize,i.terrainProvider=this.terrainProvider,i.lightingFadeOutDistance=this.lightingFadeOutDistance,i.lightingFadeInDistance=this.lightingFadeInDistance,i.zoomedOutOceanSpecularIntensity=this._zoomedOutOceanSpecularIntensity,i.hasWaterMask=n,i.oceanNormalMap=this._oceanNormalMap,i.enableLighting=this.enableLighting,i.shadows=this.shadows,t.beginFrame(e))}},D.prototype.update=function(e){if(this.show){var t=this._surface,i=e.passes;i.render&&t.update(e),i.pick&&t.update(e)}},D.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)},D.prototype.isDestroyed=function(){return!1},D.prototype.destroy=function(){return this._surfaceShaderSet=this._surfaceShaderSet&&this._surfaceShaderSet.destroy(),this._surface=this._surface&&this._surface.destroy(),this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy(),s(this)},D}),i("Shaders/PostProcessFilters/PassThrough",[],function(){"use strict";return"uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = texture2D(u_texture, v_textureCoordinates);\n}\n"}),i("Scene/GlobeDepth",["../Core/BoundingRectangle","../Core/Color","../Core/defined","../Core/destroyObject","../Core/PixelFormat","../Renderer/ClearCommand","../Renderer/Framebuffer","../Renderer/PixelDatatype","../Renderer/RenderState","../Renderer/Texture","../Shaders/PostProcessFilters/PassThrough"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(){this._colorTexture=void 0,this._depthStencilTexture=void 0,this._globeDepthTexture=void 0,this.framebuffer=void 0,this._copyDepthFramebuffer=void 0,this._clearColorCommand=void 0,this._copyColorCommand=void 0,this._copyDepthCommand=void 0,this._viewport=new e,this._rs=void 0,this._debugGlobeDepthViewportCommand=void 0}function d(e,t,r){if(!i(e._debugGlobeDepthViewportCommand)){var n="uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n float z_window = czm_unpackDepth(texture2D(u_texture, v_textureCoordinates));\n float n_range = czm_depthRange.near;\n float f_range = czm_depthRange.far;\n float z_ndc = (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n float scale = pow(z_ndc * 0.5 + 0.5, 8.0);\n gl_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0);\n}\n";e._debugGlobeDepthViewportCommand=t.createViewportQuadCommand(n,{uniformMap:{u_texture:function(){return e._globeDepthTexture}},owner:e})}e._debugGlobeDepthViewportCommand.execute(t,r)}function p(e){e._colorTexture=e._colorTexture&&!e._colorTexture.isDestroyed()&&e._colorTexture.destroy(),e._depthStencilTexture=e._depthStencilTexture&&!e._depthStencilTexture.isDestroyed()&&e._depthStencilTexture.destroy(),e._globeDepthTexture=e._globeDepthTexture&&!e._globeDepthTexture.isDestroyed()&&e._globeDepthTexture.destroy()}function m(e){e.framebuffer=e.framebuffer&&!e.framebuffer.isDestroyed()&&e.framebuffer.destroy(),e._copyDepthFramebuffer=e._copyDepthFramebuffer&&!e._copyDepthFramebuffer.isDestroyed()&&e._copyDepthFramebuffer.destroy()}function f(e,t,i,r){e._colorTexture=new u({context:t,width:i,height:r,pixelFormat:n.RGBA,pixelDatatype:s.UNSIGNED_BYTE}),e._depthStencilTexture=new u({context:t,width:i,height:r,pixelFormat:n.DEPTH_STENCIL,pixelDatatype:s.UNSIGNED_INT_24_8}),e._globeDepthTexture=new u({context:t,width:i,height:r,pixelFormat:n.RGBA,pixelDatatype:s.UNSIGNED_BYTE})}function _(e,t,i,r){e.framebuffer=new a({context:t,colorTextures:[e._colorTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._copyDepthFramebuffer=new a({context:t,colorTextures:[e._globeDepthTexture],destroyAttachments:!1})}function g(e,t,r,n){var o=e._colorTexture,a=!i(o)||o.width!==r||o.height!==n;i(e.framebuffer)&&!a||(p(e),m(e),f(e,t,r,n),_(e,t,r,n))}function v(r,n,a,s){if(r._viewport.width=a,r._viewport.height=s,i(r._rs)&&e.equals(r._viewport,r._rs.viewport)||(r._rs=l.fromCache({viewport:r._viewport})),!i(r._copyDepthCommand)){var u="uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n gl_FragColor = czm_packDepth(texture2D(u_texture, v_textureCoordinates).r);\n}\n";r._copyDepthCommand=n.createViewportQuadCommand(u,{uniformMap:{u_texture:function(){return r._depthStencilTexture}},owner:r})}r._copyDepthCommand.framebuffer=r._copyDepthFramebuffer,i(r._copyColorCommand)||(r._copyColorCommand=n.createViewportQuadCommand(c,{uniformMap:{u_texture:function(){return r._colorTexture}},owner:r})),r._copyDepthCommand.renderState=r._rs,r._copyColorCommand.renderState=r._rs,i(r._clearColorCommand)||(r._clearColorCommand=new o({color:new t(0,0,0,0),stencil:0,owner:r})),r._clearColorCommand.framebuffer=r.framebuffer}return h.prototype.executeDebugGlobeDepth=function(e,t){d(this,e,t)},h.prototype.update=function(e){var t=e.drawingBufferWidth,i=e.drawingBufferHeight;g(this,e,t,i),v(this,e,t,i),e.uniformState.globeDepthTexture=void 0},h.prototype.executeCopyDepth=function(e,t){i(this._copyDepthCommand)&&(this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._globeDepthTexture)},h.prototype.executeCopyColor=function(e,t){i(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)},h.prototype.clear=function(e,r,n){var o=this._clearColorCommand;i(o)&&(t.clone(n,o.color),o.execute(e,r))},h.prototype.isDestroyed=function(){return!1},h.prototype.destroy=function(){p(this),m(this),i(this._copyColorCommand)&&(this._copyColorCommand.shaderProgram=this._copyColorCommand.shaderProgram.destroy()),i(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=this._copyDepthCommand.shaderProgram.destroy());var e=this._debugGlobeDepthViewportCommand;return i(e)&&(e.shaderProgram=e.shaderProgram.destroy()),r(this)},h}),i("Scene/GoogleEarthImageryProvider",["../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/GeographicTilingScheme","../Core/loadText","../Core/Rectangle","../Core/RuntimeError","../Core/TileProviderError","../Core/WebMercatorTilingScheme","../ThirdParty/when","./ImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p){"use strict";function m(r){function n(e){var t;try{t=JSON.parse(e)}catch(i){t=JSON.parse(e.replace(/([\[\{,])[\n\r ]*([A-Za-z0-9]+)[\n\r ]*:/g,'$1"$2":'))}for(var n,o=0;o<t.layers.length;o++)if(t.layers[o].id===v._channel){n=t.layers[o];break}var s;if(!i(n))throw s="Could not find layer with channel (id) of "+v._channel+".",_=c.handleError(_,v,v._errorEvent,s,void 0,void 0,void 0,f),new u(s);if(!i(n.version))throw s="Could not find a version in channel (id) "+v._channel+".",_=c.handleError(_,v,v._errorEvent,s,void 0,void 0,void 0,f),new u(s);if(v._version=n.version,i(t.projection)&&"flat"===t.projection)v._tilingScheme=new a({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new l(-Math.PI,-Math.PI,Math.PI,Math.PI),ellipsoid:r.ellipsoid});else{if(i(t.projection)&&"mercator"!==t.projection)throw s="Unsupported projection "+t.projection+".",_=c.handleError(_,v,v._errorEvent,s,void 0,void 0,void 0,f),new u(s);v._tilingScheme=new h({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:r.ellipsoid})}v._imageUrlTemplate=v._imageUrlTemplate.replace("{request}",v._requestType).replace("{channel}",v._channel).replace("{version}",v._version),v._ready=!0,v._readyPromise.resolve(!0),c.handleSuccess(_)}function p(e){var t="An error occurred while accessing "+g+".";_=c.handleError(_,v,v._errorEvent,t,void 0,void 0,void 0,f),v._readyPromise.reject(new u(t))}function f(){var e=i(v._proxy)?v._proxy.getURL(g):g,t=s(e);d(t,n,p)}r=t(r,{}),this._url=r.url,this._path=t(r.path,"/default_map"),this._tileDiscardPolicy=r.tileDiscardPolicy,this._proxy=r.proxy,this._channel=r.channel,this._requestType="ImageryMaps",this._credit=new e("Google Imagery",m._logoData,"http://www.google.com/enterprise/mapsearth/products/earthenterprise.html"),this.defaultGamma=1.9,this._tilingScheme=void 0,this._version=void 0,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=r.maximumLevel,this._imageUrlTemplate=this._url+this._path+"/query?request={request}&channel={channel}&version={version}&x={x}&y={y}&z={zoom}",this._errorEvent=new o,this._ready=!1,this._readyPromise=d.defer();var _,g=this._url+this._path+"/query?request=Json&vars=geeServerDefs&is2d=t",v=this;f()}function f(e,t,r,n){var o=e._imageUrlTemplate;o=o.replace("{x}",t),o=o.replace("{y}",r),o=o.replace("{zoom}",n+1);var a=e._proxy;return i(a)&&(o=a.getURL(o)),o}return r(m.prototype,{url:{get:function(){return this._url}},path:{get:function(){return this._path}},proxy:{get:function(){return this._proxy}},channel:{get:function(){return this._channel}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},version:{get:function(){return this._version}},requestType:{get:function(){return this._requestType}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}}),m.prototype.getTileCredits=function(e,t,i){},m.prototype.requestImage=function(e,t,i){var r=f(this,e,t,i);return p.loadImage(this,r)},m.prototype.pickFeatures=function(e,t,i,r,n){},m._logoData="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALQAAAAnCAYAAACmP2LfAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAAAHdElNRQfcDB4TJDr1mp5kAAAAGnRFWHRTb2Z0d2FyZQBQYWludC5ORVQgdjMuNS4xMDD0cqEAAB1zSURBVHhe7ZwHeFTFFsf/u+l9N70npOxuSAKEFFIhCSH0qhEQUHkgKCgWUFGBB6IoCAoo0ntooaRvEkIIBBBpoYSa3nvvfd+5u4sQUigPfMX8v2/Y3Tkzs3fv/d0z58zcgF69Ql1SY+MM1wQJem44ZeiJk8beEOqPwG6uC7ZqyElb9eo/JZEIkH2nRQkBIlNMauuPCS3uGN/kjkmNDghoskBAgzrZ2NLmf1+JwIKQpYsoxdmIV9+N07onCegzBPM9bOdmYKnazF6g/1N6UySPqSJzvCaaiLHtP8G/Phq+FRfgU5ogKWUXMLT6Mvzqr2BE40mMadqO8c3zMabBC6PqDDC8SlY60t9HByCLVTKu+ERmHr5TWI9wjVxEaOZivWo1pil8D1tZeWnLXv1l8iZ3PF2kjymiWRgvCoJv5U243IyAXcQq8A9Mg9W+4bDe6wv+kVGwCZkL+4Sf4ZR+BZ5VGQR3EkbWn8Hopm3wq54Lz2JD6ah/P21XGopQ9Qoc16jGSqVyTJWbQbUsibFXf42mihTwZpsvAtp3k0dOhFOSEH1+ngaDefrgjFCgFkxY8fCisCBvKgODzxRh9qslBFGfYmDGLbiV5mBwRRo8KtPhVBgPu8teMP7u73chD6kMRYRGBY5xqrFKqQwz5SdTbS/Qf5mmUYw8rf01CjHC4VP7AHZxO6E3qy9ZZCQNnio2rE/4o9/tkxiQUYp+KRXgx8XC5FsXcLz/hkCrDUU4pxLHuDVYpdwL9F+qqSJZKlPwenskfOoI5tN7YPCJGVme7wKYr5EBXzgYfW+mwTI0Gjrznaj2WW+I/y8dVPdDGLcKRzXrsEqlHO8oTKHaXqAZWe9hQXCi63NhHWYI3ilfWIW/YLjqL2JRiOFBJRz+LffhcPs09D+0J8vzn3zXdBnYnp8Mi6NboTWzH9X8fVc+DhDQodxqAroe36lU9AJNWr4cEAjNwI8OAC9cT1rbUfzwGeCfKiL7dGnNc+q1NiO80b4BY1oT4V6WDcsdc6j2xbyq4wMWrA9rQmeWFn36ey/jBaoPQ4hmLYI0G/AtAf22fC/QDols8ITrIYi/Bl6knbS2o3gRbxHQxQQ0k0S/gCa2v4OJovPwacqAQ1ICjL40klr+UrWoQbFBETo18jCpZsOoFODkvuCNJYoHW3QKXFEM7ETRcKfiQe8d6NVIFImXvg4skhY40mxnQYVRIIeA1qrHEc1GrFSpxFtP99AiFbDbNKDZpAzzGkVYVcvBuBJQEo/9/6C+dyjPitwLwak74D8V6Bfw0P5VShjXFoTR7TfhUZkL29M/wfATJan1lauWC3aDOgyaVDCuTgbf1bFkfmtkye1ogsK2asivLYfCglIoD8qCknI2NHuG4QSVGMgQyMbt0fioRYh9VYcRU7QX55uDcaHtFOJEsThMtmWtQgxsDodsWaC0c3ea3MzGBJEqxrfbYmzr6xjfPAeTmt5HQPO7eK1xDibUz8eY+k8xtHYJPCtXwvHOu7AXMrMTsF/TH8HajTis1YwVqpWY0TXQDKy1OpBr5EJA52Fukxx+bmKxtjWx2DuaWawNlZD5qhzyo9KhpHAbKpJO/6t65UCPbPHA2PYrGNacgkElabCJJDev/MpDhUKKnuq44LRoYEK1IiswkS1zYCfk5y+F0qjvoTwqBOof34dGeAnUL1ZCLboEnJ9zoe0QD/Nuj00UBVXRabzVLETM3S0ICfwA8yc7Y6C3ANYbZsA7aQ1W1xzEfZEQ6dT2BkG9pP4ouo7jGE1u42JS20QMrzkCr4xwuN4+AM+cYII3EaNar2J86zmMrP8DHulCON4NhU3YWuhOYy6SZENpH9cfx7WacFC7BSvUqjBDsRPQIiugURvazeqYVaqAw6dYrJ9WQy7gayj4nYDy3HtQOVQGpYRqKEWXQf2HdGha/AFdae9Xr4czz0ubISRA75ECbSut7agegO75OLxpahze8j5GtifBpzEDLiV30Dd2mNT6StWiCbVmLt5rUkBQCEt2zWzIMSA8HgrIBkLD+Sp0jhHISYXQ/KMYukfvQ3fQxq68XCTBHId/tMTg7LV1CFs4BszJ6hBarBgHlcRv8H7tbuSKQpFPYGe0BmND+nZ0npECaPKf0r4UIxsuoF/IMpitsAVnrA4s15uh3x8fwLXkLobUZGJIXTqcUzbDaJE5FAVq0t4S7dEcjqMEc6B2K5arVWN6Z6AbdOmm5mJelQKOHWSxF44Cy4CqxW0s6RwchCovFRohdGNfLgX3WiZ0N4aD++y7jfwYJUrAPCle/ZjKV+BFTSegrGAZIm3QjXhBytTWB3zhByzryMUU986jz16wD+96ijCNUIAgmkc3tS6G7GERjCbgR82B4OTbEESqIiCIcqsIYzoGGyrBEMSmgh8xBoIIAR2fAHZhj8Z9DOhl9FHeKkSDvn809fuc+iyCddRYaiOZBTvIt1YJfs0b4N+WDO+GHPLQN2Ab7S61vjJV60C9SRPvNSqzTpxlyQfS1dGUmjppK7gW16B/LhN6abnQu5cDwzO3YNhhqqK4WJY887sEdGzWFpxfOxmDpKZOOvgWFB8sx9L6nShvP4FyUQjKGg5gScpGKEqbUE7RxiGYv6QQ4zIG/r4D2m88sjEy/EIW/a6+TQ4gHe5VhXCvy4JL7gLYnesI2i6t4Tii04r92u1YKt767gB0ozrkGzmY26zEOh7Hkt+kAKhLTX9qOVVdg9aoNOjcToR+wUVKLYKgN0Zq7l7884wn9CKgr4AfWw/B6SwqKQRKOdXVghe9CpbherASSjtIpGpxRIHFjwygNreoXy0lb+lU7lHJBP9kPcGXQnBNghUB/Lh44fbUp5JA+5Hs71LbPPLCVRDEJZDNGIJgeQI6mG6KegKzldq1U7tGKjQmHR8vwl86kgRoAQN0xBw6ztn0nQ/ocxEdQ7L4d/BjG6g+m8aZTL/xsXPuW82Fb8t+DG1Ox5D6XAwqvQ67OA+p9ZWoUQPsei78mjSwNU9GLmEzVGZJTd3qFPTn3YZhXgYMMjNhlHsDxms/hNWfoUdrNPgEc2h7BG5d/Bo7Blt0BuNxXf4MVmXrkdRyEHWiY6hr2oc7mevRX2wc18gioEeI1+N9a+/CNnImVAZ0mhEoNOPAJT8MHjUF8KTiWhqHgbfMpVaJdhLQh3XasU9bJAZ6ekeg6zQwgEKuLSWysmd3QGmatLqD8qDNug3dCX/AIPk4jGr2wDB/JXTmkan70IvmZTY/rB9BdZlKLkG0lG0d5klAObKsw1+jzyFiWPnRawiaDrMYwTyMwMwh220WP2IWFVfqN4CKO8E3n0C6R/ZUej9Y2kUiMdDRFTRePH3nA3q/m7xpAEtAXl0QrkTwscnmS/3eptdzNEYevZLnZ5booqk8tuYs9tAny+n1LL1mghezlcULH0VtHamOZhvhIvoNOXQsd2EZIbluYnlWaMO75TCFG9kYXJ8H14o76H/10Z3yClSrCm6jGtbWK7LC7kIlYRfUmY2XHnUa+mbXYRSfCuNCptyE6b1jMBD/EPKwchQPLxGdxOWWI8iKXYBPqLozgI8pfA5YBWvxbfMeNLUfRmPTLjRnr8YKsdGvRQ5j2zZTSSRQ78H+7GhxfScFAINypsG9ukDspZ0LKKE+O0pqlGi71ggcIqD3dga6RhFKjSqYT+VEFkvu/E9Q+HNWKaE2VVDgVkPFqwAaay5CN3En9M59BM2vfKDs7AvljjPGE5LlharQdL+LoCmhOHU0rIUyD+NgVTOa+q2iVQiIcAKpHtbhXuJOjPqeVCRYThNE6VTvKNs3hM3cHGIxntxKyCbP7Erj1lHZJbVIJAG6iiCroZCAPGukvOyASJbvCgoaAoKoAQ1kHcGC7nmZDkmhBR2PfSQLtkcl4zCSAE2eO6qExYuYxrE4KqdvelBiM4+ncYQy1IY8d0wbhUSLJAZGbsUceNYdwJCGPAyuy4NbZToG3JoO1Qk9AvHvqF4ejo0KCKlisyl04Jw+AE1ma71HRUJP+QqM1t2HcVEyTEoSYVYQCuN3HenCt4XDhGA+KorAnYZ9KIj5ELOl3XpU/k/wrt+OmraDaG7cjpacbxFvYAAZDG5Vw/DWCxjRdp+ATsWAS6+D69H1+XDNsoVb1T06b0VwzCmBIOYdqUWibTojcFBH1CXQctBtUcA6Oh/RmVC4sBmKA5j6erC1qqE4sRpqG25A43QIOHuXgvOmP5R4ZH6m5UY2L9SSLjZ5sKjjsI/o8olH8ngjCZoSgmw9DMIl3t42Up0g+pq89/sEjLK47knZhSkSuDepJP4JOyNJyEFAR8VQKMOR1nbWM69yxNJYwh+VLE90ffPyxLE3EwL9Jq0huWQqwL1iA7zq8+FVl0+epgBO6T+gb2TH+OglqgastxtZrNNlkLt8E5oJx6HZdab7mFZBk3UZRjMewCT7HkzLfodZxREYr5sBjiIBPYiAPt8ehvSGPSg5vwjzpd16VNkmmDTswp22QDTXbkJrxhJkzHGDFoUQmvBpvo2hrZl0TnLhlLIYfUO7nt7dSg3hURcP1/JiDEgphuXBqVKLRFsfA3oJAf3mI6Cr2OjTwGYdqWGzzmZD6WoYVCfehdqsZKjuuwS1oB1Q+5piHac3oaxBzZ9vLZ4nHEeesoXg6niDPSYWP9yUgD5PHu48eKE64krHcErchHIEuRysTpAXjObQWIYEHiV4EQYEojp5aEoyY+IIpOQugKYYOnIdJXrdJ63PtWwXMQM6m6SVT4gfZkbHV0XHsVtaQ3K8yoJr0YfwoHDDq5ZiQSqDik/B4Q9taYtn18gyNia1qGJsmTrGlUjK2FJ1jCjRwOASDnkxDvN95ZD/og5yl0qgfCMJ2leDoeksHaFHXYOJVyrMkm/DrPwMzGr2wmjnLGipthyHL0W7t9pDkduwF2U3lmGFtvbTdyirt0OreT+iWwPRUrUBbSkLkT/fCUZwKVYikBMwpDlPXNzLwuAQ2rWX8KzUh2dDDJyLSmB7/S5Mf3WRWiR6CPSezkCXQs6qBnLCKsheyoXqnTCoL9oOFd9/Qtl9KJT6UJMX3/zhCz8iuCjhiviSYtMx3ZTJBN8lCE7eIRgF0p6krRRaRBDskTTGySBKws5SuUjJHYUiMQdpzCUE0Q3y5MnSDhJJQg5JUvjSgO5hHZofaioGmvc40IycMgbRtJktjgOZ5Ma9irzSg46xYHcaVEZevkgBHqUWGFK+FENKQ+BdGAq/wiMYWbwHI6h4FwTDOes0BMKFMHxPNg9qn1dANakYanfuQSs5FJoTpaP1qBswsSGgb9+EeUU0Af0LDH4dBhXlmv3wajuOpPYQFDcEojxtNQ6sn9ZzUsiofjfUWg/iYOt+tJatRtvN95DqZgxNuKTKwLV4Jdyqc8Wz1uCGTLjmDIVDQqewQ8anwpJi6GsYkF4Ey2O/QvsfXKlJIgboAwT07s5AZ0G1TylUIsuhdKMI6vcuQ3PVAqg+9UZ8JvGEywiuNoIwD4IzaV2X+HSa1otgE3+NwJImVkycG0kx8snfyUZJW+QFApeSu+hN9BpIn6n+ZBp9bqDv+C8Fum+8IpzzJNOmR3UhTaGFcC07iAHXmamuZw28C/S/aIt+CcthF7+ToN0EQdhqOFzcBu/Sm/ApvAGX3DzYXIiF9jtWTJf74L6ZC83UfGg8SId2xnloSZKxp+gWjC0J6KSrMK8KhmnlSugtInpkCzaBV78Hl5oPoaLpECrLt+Bi4jfgS7t1q+YDUGsPwj5KDFsLlqD97JuIpmpZmP+TftM1ezjlxsOllM4H3eReDWHwKrOBW84jqMeK5OBTv4Bu6HxxgqU1s/N3MkAHSoH+ioCe+gjoJHB0s8ENLID6/UJo3E+GVlwoNEwY278tXhR50RhmeexzgmM8JXjdF36MHwEoiXn70Csv6gxBm8PiRc6gJFD1HDzFpq1cP0omo5QJZAfqQzH0f6uHZjQgeR4cC/IJZCnUtSkYVPAWBiX2/CdU/S7Ql+9TgtFCTaiP0qAEXA2yRsqwuzECziWZcM4tgv2DSljF7ID+l+JNh9+hY38HuvcYmLOhk5EEnVPfQOmpW+33YGaXhj53E2BWuxvGebOh5cPUX/sWSgXrsa9mB2qaDqCK4C7I2IA3jn8u7tat2g6D034MIbWb0fZgHlr2DscXUhNNuYdkYRPrg/7JiXDMLYBrZS6GNEZgVJM/JjWY4I16G4xr/BCDq2nKjjoAvY+Zpwo7eXBskQK9Swr0lEdAn4a2wk3o/DMNWmn54KYUQIuZsebGQuXFQ42H4kfNk4QckSOkNZ1lGkGAUoInOKkAm2jJsVtH+om9Nj9ytZxNcNdhljXByo+JJXj/i4G2u2xM02YInPJLxFB7VudTPH0ZHkWu0hbPpwHpfnAszoFDVgVsb1fDMmoL9L8S7wTFQE/1AvR33oB+QSp0czKgl34B2iO9uwJCKib5SGaZjbqLPlkhMG1YDr1gQyioSs24vQTDitagsnIL6loCUVu9C2EJK9FjYtsWBNP2Q7hb9A155zdwY5mTeGexo0w32hEcy2F7JQaOqZfgk38KY6rDMKFBiGHNt+iGPgCNYd0/s/sbAb2fgN5JQC9Wq8bkR0AzioOOx3Xo30mGbnY+tNMKoJOQCm03qfnFxRf6E1yUFAqZJcyuZRWuQmB+TWHJcgJfkjPxImcSSIUsXviMx/O9DvqfALrPDjb6nhuBAWkZ5JFKKTYuIqhz4FUdAo9CGwzO7Ra2LjUg0w9OxdlwyKxAXzHQm8lDi4HeAT1WMPSHnYXR7aswKE6Gfl4K9PdfgZ6+uG8XSmMbKyXD/LsEmFduglH2NHA7rA3Hvg+Ve1/gYO4KNFRvQUPLQVRU7MG4yn1dJ4eiULAo3JhW9xsa77+Hml8GY8FQ425uAM5wRRivNoPlTjs4XhoH35oLGFZ/S/wglyDkbWmrrsUAvY+A3kHlSwJ6ihKzCvLnuQyElmIs9LdfhmHxA+jn5kI3jcrRFOjxU6DTbTx9DybsOBh0f034EeYEVyaFD0IYhnQ9y1pTIsiPvU5AnKYkUBL78yKmQhDLgDRPSWtPp/HFkFtHqFCfRBr73wX67qsD+qFsEubCnqKBAZllcCkkT12RjSHVMfApH0bJXfcH+aQGZg6FU1EWeeoK2NwgoMM3Q++zP/fq/Smf2g392ZEwzk2Acfl9GBHURmuSYPyn132oHBizH8B8wjX0SadQI2cWtOZZQbHTdEgRn8XN93EiczFayn5GU3Mg7lJMPab5SEeoCWZZ0TF4Ne/A/ZSPUbXdDz9Qdddrrk/KtcwR7jX34VXDzGCFGFT0GzyLu922x069kdiv145tOu34jlOHBWoz4arUAZQt0LYOhmFcHJ2H6zAsYnZDc2FwKhv60+m9UQrLUJ4hSYQAVhpM1O6jj30EDD33Q6frZyoY8cMVaWZZR560kuB5V9H6iVUas+Py5L1/IHsT2ZldR4nEkMdkUd8Y8tYd43mLIMhYhenDWvgjQSQiGFOkiEv0rEAzK2u8yG10M2WwBWFdb6q9NKDNd6rCOuYD9L2VI/57QMfcEniU5cCnJgG+lR9haAnz4MzT5ZjmA4e8HBqnGtYXamF+nK7bpx0uwHxoqGyE3sKD5HHjYVJ1C6Z5qTD5Ph2G1hnQEV/0LBhxU2E+4yYsbgTCJGsuNBfYQrnjA0CPxDo2CRYJ0xGesgD1ZWvQ3LQbKeSJ54uC0UcUDVVRGExFR/FB2y7cSf4C+Zv9sXSUeQ9P2z2pQdnmBHQsPKqKqFCyWJsM75o1GMw8O/iEhFZs/KK9CD9wRfhCTYTP1dqwnBOHrQYz8IuuH5ZxxI/MLQZH5kfoeu6D4cVQGNecgXHFbRgXZsD4Xg5MjqfDeE0KTBbRDLXsLiwOR8HkxCJoOs+Eavdr08ZBBGdYP7rYzAZILsH3LYUYtgSsAXlYRwLqW0r8Ksl2id4/Onaz47IE+kayUfwddYhsgwkqXRrLgOpHEuyhVF9B7ytoTAL//qNjeFagGfGEi5nvYPEifqOx/ek4p1J/8aKBWC8N6Icy2+oL6zOhECTmw46SuoHZpXBn/pK7/DK8K1bCp3Q0vAv7wqfIBD55OuS9teFVYASPfAFccseThw+E4Ho5LOMqYB6ZCeOdK6H1bleJH2sOOPZradqlC3otDqY5F2GafQmmCZdgFnMBZteEML2yCnprh0CZWVp66gbDuD5Q2uSLUacm43jSB0gq+h55JeuRX7wRqUUbkJL8DS4GTcPqCdZgduZ6XiZjgvcp9fIY3aAH/yY+3KvcMDBjLSXQBXDML4VbaQG8a9PgUxcOzyIneKY/Or6FHDO8q7INY+RiMFJaJijE4i2VeEylej/FDs99TAPH8Dvofv8bDK/vhVHxMRhX0W+vOgXTijiY5UXANGkNnYeRUGN2VrsPNx6XVaQNgRNM03sBgUjeOKJJ/Cr+LNzFsg61YB5/elyKtic0qM031CaZAG0gqJnVEuYBIoI49gy9D6DXrQR3GoU2j3YE+WE2FI9TGBG1FLywnhNbPt1Y/OhY+o5iGqsGNmdLaVxfqZUB+g0Iztwi2AOkNZ3FCzOm30bHeHK9tKYHKfPZMFhlAtM9c2EpjALv93zY3qlE/8xyOOUVUTiSBrfy83CvDIdbRZC4uJSGwzHzd0qgkmEVfRnGW/dC79vPobtkFLRmm0HDpVt43MnrzoOm/dfQeeOf0P3wB+guJogXrIDuhHfAsdOFbKdQ5GkaYQbNNYNht2c8/AOnYNKB6Ri//Q14zRwIuohdPC76pCbWKGFCkx9GNC7B0NZD8CiJh8Odi7A59zud7EuwvU4hVUYZBhUXwqsqA56V0RiUM1Dam36UoiyFuprQhc6fRZuKKhV5+rcLKD2hrPQ+NPsvgNb0j6C9eCG0v/kU2l9/BK0ZM8EdRJQ833noG8Qib6lDkA0lYD6i8GIJlffZ/IhhbJtQjW4TP164EiWWztTnH9T+a4L/MxpjAn02hWWYDAQnefSZzm7Io7zDOpiSzGh3grwPwd3zDccPZdH4phBEkXcWBrD4wlE07qObw5pmBUGsK43T/YPfgmAFWEe5U2EeCXhGcV5nQ3u2KrTf6w+jdTNhtud7mB/ZC4vg43QAwbAMDYLF0e3os+8HGP80D7oLx0F9dD+oj9AGZ4Y85K0Yj/Vs3kQiFgeybFPIySiDzdwAz9O3JzHjPNtYk8gjv948FOOatlGodR0Dk07Bau9n0F8wFBp+luBO1CXeuDD51Q3830PRP7UIzgUlcC0vhHPRSdic6eI53ecT3W0sKyjI2EFRxhzyz3sOO8voBkEUTclYhAyshCwr642PR79diwlbBOEs8vLMFjgbbuelhpeoz5rEDxsNNl/+9ON5RWJOLsXCysQdh5IhWWbzhUmoel6v/l/RxGpZTKgbh3EtEZQMp5AX2ASd2f3AVu7695ky/7nOuc2U/BZSCFIGp+I82F/rfprsVa/+Mk0sZ2F0tTvGNZ+gRO8B7C/HQ92beWine+/IDWDBbJUmbBN/hUNOGRyyStH34vfQeP3ZV4R61atXIu9Kefg1rIB/XRJciwso9nymLXmxbP+wxcCsVAxIKwfv1AZoDH96jN6rXr1SuVeowKsuFINrs+BSXATbc59JLU/XwCwdDMw7B/vUEpgHfQYZ7v9HCNar/2E55ynDpSwYrhXF4uKUeQiY0/Oy3kM555nCITcJgmvp0F30Yo8L9KpXL1X9E2XhkPoVBuYWwbmolKDOhmv+WHiXyGNkgbTRE1pOublXkRycCz+AfUoRzPdsgKJN1w/19KpXf7n6xlnCPikE/SkWdswrozDkNoZUfIWhFTYYWaPy4a6NkgSR2XAZXSOLIWUWcCv7FP1T7sH8wFZwp7ycxz971auXIm4AG+b77MFLEKLv7ULJMy0FefCsPAOv0t0YUrIMg0s+gVfxYrgVbIJLUSzsrl2F2ZZl4L7J/Pdp/956ca969UrEna0O41/HwSJ4F3in42Fz5Trsbt5Bv3u30e9uImyvnoV15GGY/LIA6kOZP1966pZ8r3r1n5eqhwZ0F/aB4ToHGK9zh/FPHjD60RE6H1tDaaA2cdy7mvFfI+BffksPNrEksu0AAAAASUVORK5CYII=", +m}),i("Scene/GridImageryProvider",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","../Core/GeographicTilingScheme","../ThirdParty/when"],function(e,t,i,r,n,o,a){"use strict";function s(e){e=t(e,t.EMPTY_OBJECT),this._tilingScheme=i(e.tilingScheme)?e.tilingScheme:new o({ellipsoid:e.ellipsoid}),this._cells=t(e.cells,8),this._color=t(e.color,l),this._glowColor=t(e.glowColor,u),this._glowWidth=t(e.glowWidth,6),this._backgroundColor=t(e.backgroundColor,c),this._errorEvent=new n,this._tileWidth=t(e.tileWidth,256),this._tileHeight=t(e.tileHeight,256),this._canvasSize=t(e.canvasSize,256),this._canvas=this._createGridCanvas(),this._readyPromise=a.resolve(!0)}var l=new e(1,1,1,.4),u=new e(0,1,0,.05),c=new e(0,.5,0,.2);return r(s.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return!0}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}}),s.prototype._drawGrid=function(e){for(var t=0,i=this._canvasSize,r=0;r<=this._cells;++r){var n=r/this._cells,o=1+n*(i-1);e.moveTo(o,t),e.lineTo(o,i),e.moveTo(t,o),e.lineTo(i,o)}e.stroke()},s.prototype._createGridCanvas=function(){var e=document.createElement("canvas");e.width=this._canvasSize,e.height=this._canvasSize;var t=0,i=this._canvasSize,r=e.getContext("2d"),n=this._backgroundColor.toCssColorString();r.fillStyle=n,r.fillRect(t,t,i,i);var o=this._glowColor.toCssColorString();r.strokeStyle=o,r.lineWidth=this._glowWidth,r.strokeRect(t,t,i,i),this._drawGrid(r),r.lineWidth=.5*this._glowWidth,r.strokeRect(t,t,i,i),this._drawGrid(r);var a=this._color.toCssColorString();return r.strokeStyle=a,r.lineWidth=2,r.strokeRect(t,t,i,i),r.lineWidth=1,this._drawGrid(r),e},s.prototype.getTileCredits=function(e,t,i){},s.prototype.requestImage=function(e,t,i){return this._canvas},s.prototype.pickFeatures=function(e,t,i,r,n){},s}),i("Scene/MapboxImageryProvider",["../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/MapboxApi","./UrlTemplateImageryProvider"],function(e,t,i,r,n,o,a){"use strict";function s(r){r=t(r,t.EMPTY_OBJECT);var n=r.mapId,s=t(r.url,"https://api.mapbox.com/v4/");this._url=s,this._mapId=n,this._accessToken=o.getAccessToken(r.accessToken),this._accessTokenErrorCredit=o.getErrorCredit(r.key);var h=t(r.format,"png");/\./.test(h)||(h="."+h),this._format=h;var d=s;if(l.test(s)||(d+="/"),d+=n+"/{z}/{x}/{y}"+this._format,i(this._accessToken)&&(d+="?access_token="+this._accessToken),i(r.credit)){var p=r.credit;"string"==typeof p&&(p=new e(p)),u=p,c.length=0}this._imageryProvider=new a({url:d,proxy:r.proxy,credit:u,ellipsoid:r.ellipsoid,minimumLevel:r.minimumLevel,maximumLevel:r.maximumLevel,rectangle:r.rectangle})}var l=/\/$/,u=new e("© Mapbox © OpenStreetMap",void 0,"https://www.mapbox.com/about/maps/"),c=[new e("Improve this map",void 0,"https://www.mapbox.com/map-feedback/")];return r(s.prototype,{url:{get:function(){return this._url}},ready:{get:function(){return this._imageryProvider.ready}},readyPromise:{get:function(){return this._imageryProvider.readyPromise}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}}),s.prototype.getTileCredits=function(e,t,r){var n=c.slice();return i(this._accessTokenErrorCredit)&&n.push(this._accessTokenErrorCredit),n},s.prototype.requestImage=function(e,t,i){return this._imageryProvider.requestImage(e,t,i)},s.prototype.pickFeatures=function(e,t,i,r,n){return this._imageryProvider.pickFeatures(e,t,i,r,n)},s}),i("Scene/Moon",["../Core/buildModuleUrl","../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/Ellipsoid","../Core/IauOrientationAxes","../Core/Matrix3","../Core/Matrix4","../Core/Simon1994PlanetaryPositions","../Core/Transforms","./EllipsoidPrimitive","./Material"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p){"use strict";function m(t){t=i(t,i.EMPTY_OBJECT);var n=t.textureUrl;r(n)||(n=e("Assets/Textures/moonSmall.jpg")),this.show=i(t.show,!0),this.textureUrl=n,this._ellipsoid=i(t.ellipsoid,a.MOON),this.onlySunLighting=i(t.onlySunLighting,!0),this._ellipsoidPrimitive=new d({radii:this.ellipsoid.radii,material:p.fromType(p.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new s}n(m.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var f=new l,_=new l,g=new t,v=[];return m.prototype.update=function(e){if(this.show){var t=this._ellipsoidPrimitive;t.material.uniforms.image=this.textureUrl,t.onlySunLighting=this.onlySunLighting;var i=e.time;r(h.computeIcrfToFixedMatrix(i,f))||h.computeTemeToPseudoFixedMatrix(i,f);var n=this._axes.evaluate(i,_);l.transpose(n,n),l.multiply(f,n,n);var o=c.computeMoonPositionInEarthInertialFrame(i,g);l.multiplyByVector(f,o,o),u.fromRotationTranslation(n,o,t.modelMatrix);var a=e.commandList;return e.commandList=v,v.length=0,t.update(e),e.commandList=a,1===v.length?v[0]:void 0}},m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),o(this)},m}),i("Scene/NeverTileDiscardPolicy",[],function(){"use strict";function e(e){}return e.prototype.isReady=function(){return!0},e.prototype.shouldDiscardImage=function(e){return!1},e}),i("Shaders/AdjustTranslucentFS",[],function(){"use strict";return"#ifdef MRT\n#extension GL_EXT_draw_buffers : enable\n#endif\nuniform vec4 u_bgColor;\nuniform sampler2D u_depthTexture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nif (texture2D(u_depthTexture, v_textureCoordinates).r < 1.0)\n{\n#ifdef MRT\ngl_FragData[0] = u_bgColor;\ngl_FragData[1] = vec4(u_bgColor.a);\n#else\ngl_FragColor = u_bgColor;\n#endif\nreturn;\n}\ndiscard;\n}\n"}),i("Shaders/CompositeOITFS",[],function(){"use strict";return"uniform sampler2D u_opaque;\nuniform sampler2D u_accumulation;\nuniform sampler2D u_revealage;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec4 opaque = texture2D(u_opaque, v_textureCoordinates);\nvec4 accum = texture2D(u_accumulation, v_textureCoordinates);\nfloat r = texture2D(u_revealage, v_textureCoordinates).r;\n#ifdef MRT\nvec4 transparent = vec4(accum.rgb / clamp(r, 1e-4, 5e4), accum.a);\n#else\nvec4 transparent = vec4(accum.rgb / clamp(accum.a, 1e-4, 5e4), r);\n#endif\ngl_FragColor = (1.0 - transparent.a) * transparent + transparent.a * opaque;\n}\n"}),i("Scene/OIT",["../Core/BoundingRectangle","../Core/Color","../Core/defined","../Core/destroyObject","../Core/PixelFormat","../Core/WebGLConstants","../Renderer/ClearCommand","../Renderer/DrawCommand","../Renderer/Framebuffer","../Renderer/PixelDatatype","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/Texture","../Shaders/AdjustTranslucentFS","../Shaders/CompositeOITFS","./BlendEquation","./BlendFunction"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g){"use strict";function v(i){this._translucentMultipassSupport=!1,this._translucentMRTSupport=!1;var r=i.floatingPointTexture&&i.depthTexture;this._translucentMRTSupport=i.drawBuffers&&r,this._translucentMultipassSupport=!this._translucentMRTSupport&&r,this._opaqueFBO=void 0,this._opaqueTexture=void 0,this._depthStencilTexture=void 0,this._accumulationTexture=void 0,this._translucentFBO=void 0,this._alphaFBO=void 0,this._adjustTranslucentFBO=void 0,this._adjustAlphaFBO=void 0,this._opaqueClearCommand=new a({color:new t(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new a({color:new t(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new a({color:new t(0,0,0,0),owner:this}),this._alphaClearCommand=new a({color:new t(1,1,1,1),owner:this}),this._translucentRenderStateCache={},this._alphaRenderStateCache={},this._translucentShaderCache={},this._alphaShaderCache={},this._compositeCommand=void 0,this._adjustTranslucentCommand=void 0,this._adjustAlphaCommand=void 0,this._viewport=new e,this._rs=void 0}function y(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function C(e){e._translucentFBO=e._translucentFBO&&!e._translucentFBO.isDestroyed()&&e._translucentFBO.destroy(),e._alphaFBO=e._alphaFBO&&!e._alphaFBO.isDestroyed()&&e._alphaFBO.destroy(),e._adjustTranslucentFBO=e._adjustTranslucentFBO&&!e._adjustTranslucentFBO.isDestroyed()&&e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO=e._adjustAlphaFBO&&!e._adjustAlphaFBO.isDestroyed()&&e._adjustAlphaFBO.destroy()}function w(e){y(e),C(e)}function S(e,t,i,r){y(e);var o=new Float32Array(i*r*4);e._accumulationTexture=new p({context:t,pixelFormat:n.RGBA,pixelDatatype:u.FLOAT,source:{arrayBufferView:o,width:i,height:r}}),e._revealageTexture=new p({context:t,pixelFormat:n.RGBA,pixelDatatype:u.FLOAT,source:{arrayBufferView:o,width:i,height:r}})}function E(e,t){C(e);var i=o.FRAMEBUFFER_COMPLETE,r=!0;if(e._translucentMRTSupport&&(e._translucentFBO=new l({context:t,colorTextures:[e._accumulationTexture,e._revealageTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._adjustTranslucentFBO=new l({context:t,colorTextures:[e._accumulationTexture,e._revealageTexture],destroyAttachments:!1}),e._translucentFBO.status===i&&e._adjustTranslucentFBO.status===i||(C(e),e._translucentMRTSupport=!1)),!e._translucentMRTSupport){e._translucentFBO=new l({context:t,colorTextures:[e._accumulationTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._alphaFBO=new l({context:t,colorTextures:[e._revealageTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._adjustTranslucentFBO=new l({context:t,colorTextures:[e._accumulationTexture],destroyAttachments:!1}),e._adjustAlphaFBO=new l({context:t,colorTextures:[e._revealageTexture],destroyAttachments:!1});var n=e._translucentFBO.status===i,a=e._alphaFBO.status===i,s=e._adjustTranslucentFBO.status===i,u=e._adjustAlphaFBO.status===i;n&&a&&s&&u||(w(e),e._translucentMultipassSupport=!1,r=!1)}return r}function b(e,t,r,n){var o=r[n.id];if(!i(o)){var a=c.getState(n);a.depthMask=!1,a.blending=t,o=c.fromCache(a),r[n.id]=o}return o}function T(e,t,i){return b(t,N,e._translucentRenderStateCache,i)}function x(e,t,i){return b(t,L,e._translucentRenderStateCache,i)}function A(e,t,i){return b(t,B,e._alphaRenderStateCache,i)}function P(e,t,r,n){var o=t.id,a=r[o];if(!i(a)){var s=t._attributeLocations,l=t.fragmentShaderSource.clone();l.sources=l.sources.map(function(e){return e=d.replaceMain(e,"czm_translucent_main"),e=e.replace(/gl_FragColor/g,"czm_gl_FragColor"),e=e.replace(/\bdiscard\b/g,"czm_discard = true"),e=e.replace(/czm_phong/g,"czm_translucentPhong")}),l.sources.splice(0,0,(n.indexOf("gl_FragData")!==-1?"#extension GL_EXT_draw_buffers : enable \n":"")+"vec4 czm_gl_FragColor;\nbool czm_discard = false;\n"),l.sources.push("void main()\n{\n czm_translucent_main();\n if (czm_discard)\n {\n discard;\n }\n"+n+"}\n"),a=h.fromCache({context:e,vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:l,attributeLocations:s}),r[o]=a}return a}function D(e,t,i){return P(t,i,e._translucentShaderCache,F)}function M(e,t,i){return P(t,i,e._translucentShaderCache,V)}function I(e,t,i){return P(t,i,e._alphaShaderCache,k)}function R(e,t,i,r,n){var o,a,s,l=t.context,u=r.framebuffer,c=n.length,h=t.frameState.shadowHints.shadowsEnabled;r.framebuffer=e._adjustTranslucentFBO,e._adjustTranslucentCommand.execute(l,r),r.framebuffer=e._adjustAlphaFBO,e._adjustAlphaCommand.execute(l,r);var d=e._opaqueFBO;for(r.framebuffer=e._translucentFBO,s=0;s<c;++s)o=n[s],a=h&&o.receiveShadows?o.derivedCommands.oit.shadows.translucentCommand:o.derivedCommands.oit.translucentCommand,i(a,t,l,r,d);for(r.framebuffer=e._alphaFBO,s=0;s<c;++s)o=n[s],a=h&&o.receiveShadows?o.derivedCommands.oit.shadows.alphaCommand:o.derivedCommands.oit.alphaCommand,i(a,t,l,r,d);r.framebuffer=u}function O(e,t,i,r,n){var o=t.context,a=r.framebuffer,s=n.length,l=t.frameState.shadowHints.shadowsEnabled;r.framebuffer=e._adjustTranslucentFBO,e._adjustTranslucentCommand.execute(o,r);var u=e._opaqueFBO;r.framebuffer=e._translucentFBO;for(var c=0;c<s;++c){var h=n[c],d=l&&h.receiveShadows?h.derivedCommands.oit.shadows.translucentCommand:h.derivedCommands.oit.translucentCommand;i(d,t,o,r,u)}r.framebuffer=a}v.prototype.update=function(t,r){if(this.isSupported()){this._opaqueFBO=r,this._opaqueTexture=r.getColorTexture(0),this._depthStencilTexture=r.depthStencilTexture;var n=this._opaqueTexture.width,o=this._opaqueTexture.height,a=this._accumulationTexture,s=!i(a)||a.width!==n||a.height!==o;if(s&&S(this,t,n,o),i(this._translucentFBO)&&!s||E(this,t)){var l,u,h=this;i(this._compositeCommand)||(l=new d({sources:[f]}),this._translucentMRTSupport&&l.defines.push("MRT"),u={u_opaque:function(){return h._opaqueTexture},u_accumulation:function(){return h._accumulationTexture},u_revealage:function(){return h._revealageTexture}},this._compositeCommand=t.createViewportQuadCommand(l,{uniformMap:u,owner:this})),i(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(l=new d({defines:["MRT"],sources:[m]}),u={u_bgColor:function(){return h._translucentMRTClearCommand.color},u_depthTexture:function(){return h._depthStencilTexture}},this._adjustTranslucentCommand=t.createViewportQuadCommand(l,{uniformMap:u,owner:this})):this._translucentMultipassSupport&&(l=new d({sources:[m]}),u={u_bgColor:function(){return h._translucentMultipassClearCommand.color},u_depthTexture:function(){return h._depthStencilTexture}},this._adjustTranslucentCommand=t.createViewportQuadCommand(l,{uniformMap:u,owner:this}),u={u_bgColor:function(){return h._alphaClearCommand.color},u_depthTexture:function(){return h._depthStencilTexture}},this._adjustAlphaCommand=t.createViewportQuadCommand(l,{uniformMap:u,owner:this}))),this._viewport.width=n,this._viewport.height=o,i(this._rs)&&e.equals(this._viewport,this._rs.viewport)||(this._rs=c.fromCache({viewport:this._viewport})),i(this._compositeCommand)&&(this._compositeCommand.renderState=this._rs),this._adjustTranslucentCommand&&(this._adjustTranslucentCommand.renderState=this._rs),i(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.renderState=this._rs)}}};var N={enabled:!0,color:new t(0,0,0,0),equationRgb:_.ADD,equationAlpha:_.ADD,functionSourceRgb:g.ONE,functionDestinationRgb:g.ONE,functionSourceAlpha:g.ZERO,functionDestinationAlpha:g.ONE_MINUS_SOURCE_ALPHA},L={enabled:!0,color:new t(0,0,0,0),equationRgb:_.ADD,equationAlpha:_.ADD,functionSourceRgb:g.ONE,functionDestinationRgb:g.ONE,functionSourceAlpha:g.ONE,functionDestinationAlpha:g.ONE},B={enabled:!0,color:new t(0,0,0,0),equationRgb:_.ADD,equationAlpha:_.ADD,functionSourceRgb:g.ZERO,functionDestinationRgb:g.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:g.ZERO,functionDestinationAlpha:g.ONE_MINUS_SOURCE_ALPHA},F=" vec3 Ci = czm_gl_FragColor.rgb * czm_gl_FragColor.a;\n float ai = czm_gl_FragColor.a;\n float wzi = czm_alphaWeight(ai);\n gl_FragData[0] = vec4(Ci * wzi, ai);\n gl_FragData[1] = vec4(ai * wzi);\n",V=" vec3 Ci = czm_gl_FragColor.rgb * czm_gl_FragColor.a;\n float ai = czm_gl_FragColor.a;\n float wzi = czm_alphaWeight(ai);\n gl_FragColor = vec4(Ci, ai) * wzi;\n",k=" float ai = czm_gl_FragColor.a;\n gl_FragColor = vec4(ai);\n";return v.prototype.createDerivedCommands=function(e,t,r){if(i(r)||(r={}),this._translucentMRTSupport){var n,o;i(r.translucentCommand)&&(n=r.translucentCommand.shaderProgram,o=r.translucentCommand.renderState),r.translucentCommand=s.shallowClone(e,r.translucentCommand),i(n)&&r.shaderProgramId===e.shaderProgram.id?(r.translucentCommand.shaderProgram=n,r.translucentCommand.renderState=o):(r.translucentCommand.shaderProgram=D(this,t,e.shaderProgram),r.translucentCommand.renderState=T(this,t,e.renderState),r.shaderProgramId=e.shaderProgram.id)}else{var a,l,u,c;i(r.translucentCommand)&&(a=r.translucentCommand.shaderProgram,l=r.translucentCommand.renderState,u=r.alphaCommand.shaderProgram,c=r.alphaCommand.renderState),r.translucentCommand=s.shallowClone(e,r.translucentCommand),r.alphaCommand=s.shallowClone(e,r.alphaCommand),i(a)&&r.shaderProgramId===e.shaderProgram.id?(r.translucentCommand.shaderProgram=a,r.translucentCommand.renderState=l,r.alphaCommand.shaderProgram=u,r.alphaCommand.renderState=c):(r.translucentCommand.shaderProgram=M(this,t,e.shaderProgram),r.translucentCommand.renderState=x(this,t,e.renderState),r.alphaCommand.shaderProgram=I(this,t,e.shaderProgram),r.alphaCommand.renderState=A(this,t,e.renderState),r.shaderProgramId=e.shaderProgram.id)}return r},v.prototype.executeCommands=function(e,t,i,r){return this._translucentMRTSupport?void O(this,e,t,i,r):void R(this,e,t,i,r)},v.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)},v.prototype.clear=function(e,i,r){var n=i.framebuffer;i.framebuffer=this._opaqueFBO,t.clone(r,this._opaqueClearCommand.color),this._opaqueClearCommand.execute(e,i),i.framebuffer=this._translucentFBO;var o=this._translucentMRTSupport?this._translucentMRTClearCommand:this._translucentMultipassClearCommand;o.execute(e,i),this._translucentMultipassSupport&&(i.framebuffer=this._alphaFBO,this._alphaClearCommand.execute(e,i)),i.framebuffer=n},v.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport},v.prototype.isDestroyed=function(){return!1},v.prototype.destroy=function(){w(this),i(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),i(this._adjustTranslucentCommand)&&(this._adjustTranslucentCommand.shaderProgram=this._adjustTranslucentCommand.shaderProgram&&this._adjustTranslucentCommand.shaderProgram.destroy()),i(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.shaderProgram=this._adjustAlphaCommand.shaderProgram&&this._adjustAlphaCommand.shaderProgram.destroy());var e,t=this._translucentShaderCache;for(e in t)t.hasOwnProperty(e)&&i(t[e])&&t[e].destroy();this._translucentShaderCache={},t=this._alphaShaderCache;for(e in t)t.hasOwnProperty(e)&&i(t[e])&&t[e].destroy();return this._alphaShaderCache={},r(this)},v});i("Scene/OrthographicFrustum",["../Core/Cartesian3","../Core/Cartesian4","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Matrix4","./CullingVolume"],function(e,t,i,r,n,o,a){"use strict";function s(){this.left=void 0,this._left=void 0,this.right=void 0,this._right=void 0,this.top=void 0,this._top=void 0,this.bottom=void 0,this._bottom=void 0,this.near=1,this._near=this.near,this.far=5e8,this._far=this.far,this._cullingVolume=new a,this._orthographicMatrix=new o}function l(e){e.top===e._top&&e.bottom===e._bottom&&e.left===e._left&&e.right===e._right&&e.near===e._near&&e.far===e._far||(e._left=e.left,e._right=e.right,e._top=e.top,e._bottom=e.bottom,e._near=e.near,e._far=e.far,e._orthographicMatrix=o.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix))}r(s.prototype,{projectionMatrix:{get:function(){return l(this),this._orthographicMatrix}}});var u=new e,c=new e,h=new e,d=new e;return s.prototype.computeCullingVolume=function(r,n,o){var a=this._cullingVolume.planes,s=this.top,l=this.bottom,p=this.right,m=this.left,f=this.near,_=this.far,g=e.cross(n,o,u),v=c;e.multiplyByScalar(n,f,v),e.add(r,v,v);var y=h;e.multiplyByScalar(g,m,y),e.add(v,y,y);var C=a[0];return i(C)||(C=a[0]=new t),C.x=g.x,C.y=g.y,C.z=g.z,C.w=-e.dot(g,y),e.multiplyByScalar(g,p,y),e.add(v,y,y),C=a[1],i(C)||(C=a[1]=new t),C.x=-g.x,C.y=-g.y,C.z=-g.z,C.w=-e.dot(e.negate(g,d),y),e.multiplyByScalar(o,l,y),e.add(v,y,y),C=a[2],i(C)||(C=a[2]=new t),C.x=o.x,C.y=o.y,C.z=o.z,C.w=-e.dot(o,y),e.multiplyByScalar(o,s,y),e.add(v,y,y),C=a[3],i(C)||(C=a[3]=new t),C.x=-o.x,C.y=-o.y,C.z=-o.z,C.w=-e.dot(e.negate(o,d),y),C=a[4],i(C)||(C=a[4]=new t),C.x=n.x,C.y=n.y,C.z=n.z,C.w=-e.dot(n,v),e.multiplyByScalar(n,_,y),e.add(r,y,y),C=a[5],i(C)||(C=a[5]=new t),C.x=-n.x,C.y=-n.y,C.z=-n.z,C.w=-e.dot(e.negate(n,d),y),this._cullingVolume},s.prototype.getPixelDimensions=function(e,t,i,r){l(this);var n=this.right-this.left,o=this.top-this.bottom,a=n/e,s=o/t;return r.x=a,r.y=s,r},s.prototype.clone=function(e){return i(e)||(e=new s),e.left=this.left,e.right=this.right,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e},s.prototype.equals=function(e){return i(e)&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far},s});i("Widgets/getElement",["../Core/DeveloperError"],function(e){"use strict";function t(e){if("string"==typeof e){var t=document.getElementById(e);e=t}return e}return t}),i("Scene/PerformanceDisplay",["../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/getTimestamp","../Widgets/getElement"],function(e,t,i,r,n,o){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT);var i=o(t.container);this._container=i;var r=document.createElement("div");r.className="cesium-performanceDisplay";var n=document.createElement("div");n.className="cesium-performanceDisplay-fps",this._fpsText=document.createTextNode(""),n.appendChild(this._fpsText);var a=document.createElement("div");a.className="cesium-performanceDisplay-ms",this._msText=document.createTextNode(""),a.appendChild(this._msText),r.appendChild(a),r.appendChild(n),this._container.appendChild(r),this._lastFpsSampleTime=void 0,this._frameCount=0,this._time=void 0,this._fps=0,this._frameTime=0}return a.prototype.update=function(){if(!t(this._time))return this._lastFpsSampleTime=n(),void(this._time=n());var e=this._time,i=n();this._time=i;var r=i-e;this._frameCount++;var o=this._fps,a=i-this._lastFpsSampleTime;a>1e3&&(o=1e3*this._frameCount/a|0,this._lastFpsSampleTime=i,this._frameCount=0),o!==this._fps&&(this._fpsText.nodeValue=o+" FPS",this._fps=o),r!==this._frameTime&&(this._msText.nodeValue=r.toFixed(2)+" MS",this._frameTime=r)},a.prototype.destroy=function(){return i(this)},a}),i("Scene/PickDepth",["../Core/defined","../Core/destroyObject","../Core/PixelFormat","../Renderer/Framebuffer","../Renderer/PixelDatatype","../Renderer/RenderState","../Renderer/Texture"],function(e,t,i,r,n,o,a){"use strict";function s(){this.framebuffer=void 0,this._depthTexture=void 0,this._textureToCopy=void 0,this._copyDepthCommand=void 0,this._debugPickDepthViewportCommand=void 0}function l(t,i,r){if(!e(t._debugPickDepthViewportCommand)){var n="uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n float z_window = czm_unpackDepth(texture2D(u_texture, v_textureCoordinates));\n float n_range = czm_depthRange.near;\n float f_range = czm_depthRange.far;\n float z_ndc = (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n float scale = pow(z_ndc * 0.5 + 0.5, 8.0);\n gl_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0);\n}\n";t._debugPickDepthViewportCommand=i.createViewportQuadCommand(n,{uniformMap:{u_texture:function(){return t._depthTexture}},owner:t})}t._debugPickDepthViewportCommand.execute(i,r)}function u(e){e._depthTexture=e._depthTexture&&!e._depthTexture.isDestroyed()&&e._depthTexture.destroy()}function c(e){e.framebuffer=e.framebuffer&&!e.framebuffer.isDestroyed()&&e.framebuffer.destroy()}function h(e,t,r,o){e._depthTexture=new a({context:t,width:r,height:o,pixelFormat:i.RGBA,pixelDatatype:n.UNSIGNED_BYTE})}function d(e,t,i,n){u(e),c(e),h(e,t,i,n),e.framebuffer=new r({context:t,colorTextures:[e._depthTexture],destroyAttachments:!1})}function p(t,i,r){var n=r.width,o=r.height,a=t._depthTexture,s=!e(a)||a.width!==n||a.height!==o;e(t.framebuffer)&&!s||d(t,i,n,o)}function m(t,i,r){if(!e(t._copyDepthCommand)){var n="uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n gl_FragColor = czm_packDepth(texture2D(u_texture, v_textureCoordinates).r);\n}\n";t._copyDepthCommand=i.createViewportQuadCommand(n,{renderState:o.fromCache(),uniformMap:{u_texture:function(){return t._textureToCopy}},owner:t})}t._textureToCopy=r,t._copyDepthCommand.framebuffer=t.framebuffer}return s.prototype.executeDebugPickDepth=function(e,t){l(this,e,t)},s.prototype.update=function(e,t){p(this,e,t),m(this,e,t)},s.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)},s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return u(this),c(this),this._copyDepthCommand.shaderProgram=e(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy(),t(this)},s}),i("Shaders/Appearances/PointAppearanceFS",[],function(){"use strict";return"uniform vec4 highlightColor;\nvarying vec3 v_color;\nvoid main()\n{\ngl_FragColor = vec4(v_color * highlightColor.rgb, highlightColor.a);\n}\n"}),i("Shaders/Appearances/PointAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 color;\nattribute float batchId;\nuniform float pointSize;\nvarying vec3 v_positionEC;\nvarying vec3 v_color;\nvoid main()\n{\nv_color = color;\ngl_Position = czm_modelViewProjectionRelativeToEye * czm_computePosition();\ngl_PointSize = pointSize;\n}\n"}),i("Scene/PointAppearance",["../Core/Color","../Core/combine","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/VertexFormat","../Shaders/Appearances/PointAppearanceFS","../Shaders/Appearances/PointAppearanceVS","./Appearance"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(n){n=i(n,i.EMPTY_OBJECT),this._vertexShaderSource=i(n.vertexShaderSource,s),this._fragmentShaderSource=i(n.fragmentShaderSource,a),this._renderState=l.getDefaultRenderState(!1,!1,n.renderState),this._pointSize=i(n.pointSize,2),this._highlightColor=r(n.highlightColor)?n.highlightColor:new e,this.material=void 0,this.translucent=i(n.translucent,!1),this.uniforms={highlightColor:this._highlightColor,pointSize:this._pointSize};var o=n.uniforms;this.uniforms=t(this.uniforms,o,!0)}return n(u.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return!1}},vertexFormat:{get:function(){return u.VERTEX_FORMAT}},pixelSize:{get:function(){return this._pointSize}}}),u.VERTEX_FORMAT=o.POSITION_AND_COLOR,u.prototype.getFragmentShaderSource=l.prototype.getFragmentShaderSource,u.prototype.isTranslucent=l.prototype.isTranslucent,u.prototype.getRenderState=l.prototype.getRenderState,u}),i("Scene/PrimitiveCollection",["../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError"],function(e,t,i,r,n,o){"use strict";function a(i){i=t(i,t.EMPTY_OBJECT),this._primitives=[],this._guid=e(),this.show=t(i.show,!0),this.destroyPrimitives=t(i.destroyPrimitives,!0)}function s(e,t){return e._primitives.indexOf(t)}return r(a.prototype,{length:{get:function(){return this._primitives.length}}}),a.prototype.add=function(e){var t=e._external=e._external||{},i=t._composites=t._composites||{};return i[this._guid]={collection:this},this._primitives.push(e),e},a.prototype.remove=function(e){if(this.contains(e)){var t=this._primitives.indexOf(e);if(t!==-1)return this._primitives.splice(t,1),delete e._external._composites[this._guid],this.destroyPrimitives&&e.destroy(),!0}return!1},a.prototype.removeAndDestroy=function(e){var t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t},a.prototype.removeAll=function(){if(this.destroyPrimitives)for(var e=this._primitives,t=e.length,i=0;i<t;++i)e[i].destroy();this._primitives=[]},a.prototype.contains=function(e){return!!(i(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])},a.prototype.raise=function(e){if(i(e)){var t=s(this,e),r=this._primitives;if(t!==r.length-1){var n=r[t];r[t]=r[t+1],r[t+1]=n}}},a.prototype.raiseToTop=function(e){if(i(e)){var t=s(this,e),r=this._primitives;t!==r.length-1&&(r.splice(t,1),r.push(e))}},a.prototype.lower=function(e){if(i(e)){var t=s(this,e),r=this._primitives;if(0!==t){var n=r[t];r[t]=r[t-1],r[t-1]=n}}},a.prototype.lowerToBottom=function(e){if(i(e)){var t=s(this,e),r=this._primitives;0!==t&&(r.splice(t,1),r.unshift(e))}},a.prototype.get=function(e){return this._primitives[e]},a.prototype.update=function(e){if(this.show)for(var t=this._primitives,i=0;i<t.length;++i)t[i].update(e)},a.prototype.isDestroyed=function(){return!1},a.prototype.destroy=function(){return this.removeAll(),n(this)},a}),i("Scene/QuadtreeTileProvider",["../Core/defineProperties","../Core/DeveloperError"],function(e,t){"use strict";function i(){t.throwInstantiationError()}return i.computeDefaultLevelZeroMaximumGeometricError=function(e){return 2*e.ellipsoid.maximumRadius*Math.PI*.25/(65*e.getNumberOfXTilesAtLevel(0))},e(i.prototype,{quadtree:{get:t.throwInstantiationError,set:t.throwInstantiationError},ready:{get:t.throwInstantiationError},tilingScheme:{get:t.throwInstantiationError},errorEvent:{get:t.throwInstantiationError}}),i.prototype.beginUpdate=t.throwInstantiationError,i.prototype.endUpdate=t.throwInstantiationError,i.prototype.getLevelMaximumGeometricError=t.throwInstantiationError,i.prototype.loadTile=t.throwInstantiationError,i.prototype.computeTileVisibility=t.throwInstantiationError,i.prototype.showTileThisFrame=t.throwInstantiationError,i.prototype.computeDistanceToTile=t.throwInstantiationError,i.prototype.isDestroyed=t.throwInstantiationError,i.prototype.destroy=t.throwInstantiationError,i}),i("Scene/SceneTransitioner",["../Core/Cartesian3","../Core/Cartographic","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/EasingFunction","../Core/Math","../Core/Matrix4","../Core/Ray","../Core/ScreenSpaceEventHandler","../Core/ScreenSpaceEventType","../Core/Transforms","./Camera","./OrthographicFrustum","./PerspectiveFrustum","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f){"use strict";function _(e){this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0}function g(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new u(e._scene.canvas,!1);var i=function(){e._morphCancelled=!0,t(e)};e._completeMorph=i,e._morphHandler.setInputAction(i,c.LEFT_DOWN),e._morphHandler.setInputAction(i,c.MIDDLE_DOWN),e._morphHandler.setInputAction(i,c.RIGHT_DOWN),e._morphHandler.setInputAction(i,c.WHEEL)}}function v(e){for(var t=e._currentTweens,i=0;i<t.length;++i)t[i].cancelTween();e._currentTweens.length=0,e._morphHandler=e._morphHandler&&e._morphHandler.destroy()}function y(e,t){var i=e._scene,r=i.camera,n=Y,o=n.position,a=n.direction,l=n.up,u=i.mapProjection.unproject(r.position,H);t.cartographicToCartesian(u,o);var c=t.scaleToGeodeticSurface(o,q),d=h.eastNorthUpToFixedFrame(c,t,j); +return s.multiplyByPointAsVector(d,r.direction,a),s.multiplyByPointAsVector(d,r.up,l),n}function C(t,i,r,n){function a(t){S(c,m,t.time,u.position),S(h,f,t.time,u.direction),S(p,_,t.time,u.up),e.cross(u.direction,u.up,u.right),e.normalize(u.right,u.right)}i*=.5;var l=t._scene,u=l.camera,c=e.clone(u.position,X),h=e.clone(u.direction,Z),p=e.clone(u.up,K),m=s.multiplyByPoint(d.TRANSFORM_2D_INVERSE,r.position,Q),f=s.multiplyByPointAsVector(d.TRANSFORM_2D_INVERSE,r.direction,J),_=s.multiplyByPointAsVector(d.TRANSFORM_2D_INVERSE,r.up,$),g=l.tweens.add({duration:i,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:a,complete:function(){D(t,l,0,1,i,n)}});t._currentTweens.push(g)}function w(t,i,r){function n(t){S(d,_,t.time,l.position),S(p,v,t.time,l.direction),S(m,w,t.time,l.up),e.cross(l.direction,l.up,l.right),e.normalize(l.right,l.right);var i=l.frustum;i.right=a.lerp(E,b,t.time),i.left=-i.right,i.top=i.right*(s.drawingBufferHeight/s.drawingBufferWidth),i.bottom=-i.top,l.position.z=2*s.mapProjection.ellipsoid.maximumRadius}i/=3;var s=t._scene,l=s.camera,u=ee;u.aspectRatio=s.drawingBufferWidth/s.drawingBufferHeight,u.fov=a.toRadians(60);var c;i>0?(c=Y,e.fromDegrees(0,0,5*r.maximumRadius,r,c.position),e.negate(c.position,c.direction),e.normalize(c.direction,c.direction),e.clone(e.UNIT_Z,c.up)):(l.position.z=l.frustum.right-l.frustum.left,c=y(t,r)),c.frustum=u;var h=M(c);g(t,h);var d=e.clone(l.position,ve),p=e.clone(l.direction,ye),m=e.clone(l.up,Ce),_=e.fromElements(0,0,5*r.maximumRadius,we),v=e.negate(e.UNIT_Z,Se),w=e.clone(e.UNIT_Y,Ee),E=l.frustum.right,b=.5*_.z;if(i>0){var T=s.tweens.add({duration:i,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:n,complete:function(){s._mode=f.MORPHING,x(t,i,c,function(){C(t,i,c,h)})}});t._currentTweens.push(T)}else x(t,i,c,function(){C(t,i,c,h)})}function S(t,i,r,n){return e.lerp(t,i,r,n)}function E(e,t,i,r,n){function s(e){u.frustum.fov=a.lerp(c,h,e.time);var t=d/Math.tan(.5*u.frustum.fov);r(u,t)}var l=e._scene,u=l.camera,c=u.frustum.fov,h=.5*a.RADIANS_PER_DEGREE,d=i.position.z*Math.tan(.5*c);u.frustum.far=d/Math.tan(.5*h)+1e7;var p=l.tweens.add({duration:t,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:s,complete:function(){u.frustum=i.frustum.clone(),n(e)}});e._currentTweens.push(p)}function b(t,r){function n(t){S(c,_,t.time,u.position),S(h,m,t.time,u.direction),S(p,f,t.time,u.up),e.cross(u.direction,u.up,u.right),e.normalize(u.right,u.right)}function a(e,t){e.position.z=t}r*=.5;var l=t._scene,u=l.camera,c=e.clone(u.position,te),h=e.clone(u.direction,ie),p=e.clone(u.up,re),m=e.negate(e.UNIT_Z,oe),f=e.clone(e.UNIT_Y,ae),_=ne;if(r>0)e.clone(e.ZERO,ne),_.z=5*l.mapProjection.ellipsoid.maximumRadius;else{e.clone(c,ne);var v=le;s.multiplyByPoint(d.TRANSFORM_2D,c,v.origin),s.multiplyByPointAsVector(d.TRANSFORM_2D,h,v.direction);var y=l.globe;if(i(y)){var C=y.pick(v,l,ue);i(C)&&(s.multiplyByPoint(d.TRANSFORM_2D_INVERSE,C,_),_.z+=e.distance(c,_))}}var w=se;w.right=.5*_.z,w.left=-w.right,w.top=w.right*(l.drawingBufferHeight/l.drawingBufferWidth),w.bottom=-w.top;var b=ce;b.position=_,b.direction=m,b.up=f,b.frustum=w;var T=I(b);g(t,T);var x=l.tweens.add({duration:r,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:n,complete:function(){E(t,r,b,a,T)}});t._currentTweens.push(x)}function T(t,r,n){function o(e,t){e.position.x=t}function a(){E(t,r,c,o,b)}r*=.5;var l=t._scene,u=l.camera,c=de;if(r>0)e.clone(e.ZERO,c.position),c.position.z=5*n.maximumRadius,e.negate(e.UNIT_Z,c.direction),e.clone(e.UNIT_Y,c.up);else{n.cartesianToCartographic(u.positionWC,he),l.mapProjection.project(he,c.position),e.negate(e.UNIT_Z,c.direction),e.clone(e.UNIT_Y,c.up);var p=fe;e.clone(c.position2D,p.origin);var m=e.clone(u.directionWC,p.direction),f=n.scaleToGeodeticSurface(u.positionWC,ge),_=h.eastNorthUpToFixedFrame(f,n,_e);s.inverseTransformation(_,_),s.multiplyByPointAsVector(_,m,m),s.multiplyByPointAsVector(d.TRANSFORM_2D,m,m);var v=l.globe;if(i(v)){var y=v.pick(p,l,me);if(i(y)){var C=e.distance(c.position2D,y);y.x+=C,e.clone(y,c.position2D)}}}s.multiplyByPoint(d.TRANSFORM_2D,c.position,c.position2D),s.multiplyByPointAsVector(d.TRANSFORM_2D,c.direction,c.direction2D),s.multiplyByPointAsVector(d.TRANSFORM_2D,c.up,c.up2D);var w=c.frustum;w.right=.5*c.position.z,w.left=-w.right,w.top=w.right*(l.drawingBufferHeight/l.drawingBufferWidth),w.bottom=-w.top;var S=pe;s.multiplyByPoint(d.TRANSFORM_2D_INVERSE,c.position2D,S.position),e.clone(c.direction,S.direction),e.clone(c.up,S.up),S.frustum=w;var b=I(S);g(t,b),P(t,r,c,a)}function x(e,t,i,r){function n(e){l.frustum.fov=a.lerp(h,c,e.time),l.position.z=d/Math.tan(.5*l.frustum.fov)}var s=e._scene,l=s.camera,u=l.frustum.right-l.frustum.left;l.frustum=i.frustum.clone();var c=l.frustum.fov,h=.5*a.RADIANS_PER_DEGREE,d=u*Math.tan(.5*c);l.frustum.far=d/Math.tan(.5*h)+1e7,l.frustum.fov=h;var p=s.tweens.add({duration:t,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:n,complete:function(){r(e)}});e._currentTweens.push(p)}function A(t,i,r,n){i*=.5;var a=t._scene,s=a.camera,l=e.clone(r.position,we),u=e.clone(r.direction,Se),c=e.clone(r.up,Ee);a._mode=f.MORPHING,x(t,0,r,function(){function h(t){S(d,l,t.time,s.position),S(p,u,t.time,s.direction),S(m,c,t.time,s.up),e.cross(s.direction,s.up,s.right),e.normalize(s.right,s.right)}s.frustum=r.frustum.clone();var d=e.clone(s.position,ve),p=e.clone(s.direction,ye),m=e.clone(s.up,Ce);d.z=l.z;var f=a.tweens.add({duration:i,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:h,complete:function(){n(t)}});t._currentTweens.push(f)})}function P(t,i,r,n){function a(t){S(u,d,t.time,l.position),S(c,p,t.time,l.direction),S(h,m,t.time,l.up),e.cross(l.direction,l.up,l.right),e.normalize(l.right,l.right)}var s=t._scene,l=s.camera,u=e.clone(l.position,ve),c=e.clone(l.direction,ye),h=e.clone(l.up,Ce),d=e.clone(r.position2D,we),p=e.clone(r.direction2D,Se),m=e.clone(r.up2D,Ee),f=s.tweens.add({duration:i,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:a,complete:function(){D(t,s,1,0,i,n)}});t._currentTweens.push(f)}function D(e,t,r,n,a,s){var l={object:t,property:"morphTime",startValue:r,stopValue:n,duration:a,easingFunction:o.QUARTIC_OUT};i(s)&&(l.complete=function(){s(e)});var u=t.tweens.addProperty(l);e._currentTweens.push(u)}function M(t){return function(r){var n=r._scene;if(n._mode=f.SCENE3D,n.morphTime=f.getMorphTime(f.SCENE3D),v(r),r._previousMode!==f.MORPHING||r._morphCancelled){r._morphCancelled=!1;var o=n.camera;e.clone(t.position,o.position),e.clone(t.direction,o.direction),e.clone(t.up,o.up),e.cross(o.direction,o.up,o.right),e.normalize(o.right,o.right),i(t.frustum)&&(o.frustum=t.frustum.clone())}var a=i(r._completeMorph);r._completeMorph=void 0,n.camera.update(n.mode),r._scene.morphComplete.raiseEvent(r,r._previousMode,f.SCENE3D,a)}}function I(t){return function(r){var n=r._scene;n._mode=f.SCENE2D,n.morphTime=f.getMorphTime(f.SCENE2D),v(r);var o=n.camera;e.clone(t.position,o.position),o.position.z=2*n.mapProjection.ellipsoid.maximumRadius,e.clone(t.direction,o.direction),e.clone(t.up,o.up),e.cross(o.direction,o.up,o.right),e.normalize(o.right,o.right),o.frustum=t.frustum.clone();var a=i(r._completeMorph);r._completeMorph=void 0,n.camera.update(n.mode),r._scene.morphComplete.raiseEvent(r,r._previousMode,f.SCENE2D,a)}}function R(t){return function(r){var n=r._scene;if(n._mode=f.COLUMBUS_VIEW,n.morphTime=f.getMorphTime(f.COLUMBUS_VIEW),v(r),n.camera.frustum=t.frustum.clone(),r._previousModeMode!==f.MORPHING||r._morphCancelled){r._morphCancelled=!1;var o=n.camera;e.clone(t.position,o.position),e.clone(t.direction,o.direction),e.clone(t.up,o.up),e.cross(o.direction,o.up,o.right),e.normalize(o.right,o.right)}var a=i(r._completeMorph);r._completeMorph=void 0,n.camera.update(n.mode),r._scene.morphComplete.raiseEvent(r,r._previousMode,f.COLUMBUS_VIEW,a)}}_.prototype.completeMorph=function(){i(this._completeMorph)&&this._completeMorph()},_.prototype.morphTo2D=function(e,t){i(this._completeMorph)&&this._completeMorph();var r=this._scene;this._previousMode=r.mode,this._previousMode!==f.SCENE2D&&this._previousMode!==f.MORPHING&&(this._scene.morphStart.raiseEvent(this,this._previousMode,f.SCENE2D,!0),r._mode=f.MORPHING,r.camera._setTransform(s.IDENTITY),this._previousMode===f.COLUMBUS_VIEW?b(this,e):T(this,e,t),0===e&&i(this._completeMorph)&&this._completeMorph())};var O=new e,N=new e,L=new e,B=new e,F=new e,V=new e,k=new e,z=new t,U=new s,G=new m,W={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};_.prototype.morphToColumbusView=function(t,r){i(this._completeMorph)&&this._completeMorph();var n=this._scene;if(this._previousMode=n.mode,this._previousMode!==f.COLUMBUS_VIEW&&this._previousMode!==f.MORPHING){this._scene.morphStart.raiseEvent(this,this._previousMode,f.COLUMBUS_VIEW,!0),n.camera._setTransform(s.IDENTITY);var o=O,l=N,u=L;if(t>0)o.x=0,o.y=-1,o.z=1,o=e.multiplyByScalar(e.normalize(o,o),5*r.maximumRadius,o),e.negate(e.normalize(o,l),l),e.cross(e.UNIT_X,l,u);else{var c=n.camera;if(this._previousMode===f.SCENE2D)e.clone(c.position,o),o.z=c.frustum.right-c.frustum.left,e.negate(e.UNIT_Z,l),e.clone(e.UNIT_Y,u);else{e.clone(c.positionWC,o),e.clone(c.directionWC,l),e.clone(c.upWC,u);var p=r.scaleToGeodeticSurface(o,k),m=h.eastNorthUpToFixedFrame(p,r,U);s.inverseTransformation(m,m),n.mapProjection.project(r.cartesianToCartographic(o,z),o),s.multiplyByPointAsVector(m,l,l),s.multiplyByPointAsVector(m,u,u)}}var _=G;_.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,_.fov=a.toRadians(60);var v=W;v.position=o,v.direction=l,v.up=u,v.frustum=_;var y=R(v);g(this,y),this._previousMode===f.SCENE2D?A(this,t,v,y):(v.position2D=s.multiplyByPoint(d.TRANSFORM_2D,o,B),v.direction2D=s.multiplyByPointAsVector(d.TRANSFORM_2D,l,F),v.up2D=s.multiplyByPointAsVector(d.TRANSFORM_2D,u,V),n._mode=f.MORPHING,P(this,t,v,y)),0===t&&i(this._completeMorph)&&this._completeMorph()}},_.prototype.morphTo3D=function(t,r){i(this._completeMorph)&&this._completeMorph();var n=this._scene;if(this._previousMode=n.mode,this._previousMode!==f.SCENE3D&&this._previousMode!==f.MORPHING){if(this._scene.morphStart.raiseEvent(this,this._previousMode,f.SCENE3D,!0),n._mode=f.MORPHING,n.camera._setTransform(s.IDENTITY),this._previousMode===f.SCENE2D)w(this,t,r);else{var o;t>0?(o=Y,e.fromDegrees(0,0,5*r.maximumRadius,r,o.position),e.negate(o.position,o.direction),e.normalize(o.direction,o.direction),e.clone(e.UNIT_Z,o.up)):o=y(this,r);var a=M(o);g(this,a),C(this,t,o,a)}0===t&&i(this._completeMorph)&&this._completeMorph()}},_.prototype.isDestroyed=function(){return!1},_.prototype.destroy=function(){return v(this),r(this)};var H=new t,q=new e,j=new s,Y={position:new e,direction:new e,up:new e,frustum:void 0},X=new e,Z=new e,K=new e,Q=new e,J=new e,$=new e,ee=new m,te=new e,ie=new e,re=new e,ne=new e,oe=new e,ae=new e,se=new p,le=new l,ue=new e,ce={position:void 0,direction:void 0,up:void 0,frustum:void 0},he=new t,de={position:new e,direction:new e,up:new e,position2D:new e,direction2D:new e,up2D:new e,frustum:new p},pe={position:new e,direction:new e,up:new e,frustum:void 0},me=new e,fe=new l,_e=new s,ge=new e,ve=new e,ye=new e,Ce=new e,we=new e,Se=new e,Ee=new e;return _}),i("Scene/TweenCollection",["../Core/clone","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/EasingFunction","../Core/getTimestamp","../Core/TimeConstants","../ThirdParty/Tween"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(t,i,r,n,o,a,s,l,u,c){this._tweens=t,this._tweenjs=i,this._startObject=e(r),this._stopObject=e(n),this._duration=o,this._delay=a,this._easingFunction=s,this._update=l,this._complete=u,this.cancel=c,this.needsStart=!0}function c(){this._tweens=[]}return r(u.prototype,{startObject:{get:function(){return this._startObject}},stopObject:{get:function(){return this._stopObject}},duration:{get:function(){return this._duration}},delay:{get:function(){return this._delay}},easingFunction:{get:function(){return this._easingFunction}},update:{get:function(){return this._update}},complete:{get:function(){return this._complete}},tweenjs:{get:function(){return this._tweenjs}}}),u.prototype.cancelTween=function(){this._tweens.remove(this)},r(c.prototype,{length:{get:function(){return this._tweens.length}}}),c.prototype.add=function(r){if(r=t(r,t.EMPTY_OBJECT),0===r.duration)return i(r.complete)&&r.complete(),new u(this);var n=r.duration/s.SECONDS_PER_MILLISECOND,a=t(r.delay,0),c=a/s.SECONDS_PER_MILLISECOND,h=t(r.easingFunction,o.LINEAR_NONE),d=r.startObject,p=new l.Tween(d);p.to(e(r.stopObject),n),p.delay(c),p.easing(h),i(r.update)&&p.onUpdate(function(){r.update(d)}),p.onComplete(t(r.complete,null)),p.repeat(t(r._repeat,0));var m=new u(this,p,r.startObject,r.stopObject,r.duration,a,h,r.update,r.complete,r.cancel);return this._tweens.push(m),m},c.prototype.addProperty=function(e){function i(e){r[n]=e.value}e=t(e,t.EMPTY_OBJECT);var r=e.object,n=e.property,o=e.startValue,a=e.stopValue;return this.add({startObject:{value:o},stopObject:{value:a},duration:t(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:i,complete:e.complete,cancel:e.cancel,_repeat:e._repeat})},c.prototype.addAlpha=function(e){function r(e){for(var t=o.length,i=0;i<t;++i)n.uniforms[o[i]].alpha=e.alpha}e=t(e,t.EMPTY_OBJECT);var n=e.material,o=[];for(var a in n.uniforms)n.uniforms.hasOwnProperty(a)&&i(n.uniforms[a])&&i(n.uniforms[a].alpha)&&o.push(a);return this.add({startObject:{alpha:t(e.startValue,0)},stopObject:{alpha:t(e.stopValue,1)},duration:t(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:r,complete:e.complete,cancel:e.cancel})},c.prototype.addOffsetIncrement=function(e){e=t(e,t.EMPTY_OBJECT);var i=e.material,r=i.uniforms;return this.addProperty({object:r,property:"offset",startValue:r.offset,stopValue:r.offset+1,duration:e.duration,delay:e.delay,easingFunction:e.easingFunction,update:e.update,cancel:e.cancel,_repeat:1/0})},c.prototype.remove=function(e){if(!i(e))return!1;var t=this._tweens.indexOf(e);return t!==-1&&(e.tweenjs.stop(),i(e.cancel)&&e.cancel(),this._tweens.splice(t,1),!0)},c.prototype.removeAll=function(){for(var e=this._tweens,t=0;t<e.length;++t){var r=e[t];r.tweenjs.stop(),i(r.cancel)&&r.cancel()}e.length=0},c.prototype.contains=function(e){return i(e)&&this._tweens.indexOf(e)!==-1},c.prototype.get=function(e){return this._tweens[e]},c.prototype.update=function(e){var t=this._tweens,r=0;for(e=i(e)?e/s.SECONDS_PER_MILLISECOND:a();r<t.length;){var n=t[r],o=n.tweenjs;n.needsStart?(n.needsStart=!1,o.start(e)):o.update(e)?r++:(o.stop(),t.splice(r,1))}},c}),i("Scene/ScreenSpaceCameraController",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Ellipsoid","../Core/IntersectionTests","../Core/isArray","../Core/KeyboardEventModifier","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/Plane","../Core/Quaternion","../Core/Ray","../Core/Transforms","./CameraEventAggregator","./CameraEventType","./MapMode2D","./SceneMode","./SceneTransforms","./TweenCollection"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b){"use strict";function T(i){this.enableInputs=!0,this.enableTranslate=!0,this.enableZoom=!0,this.enableRotate=!0,this.enableTilt=!0,this.enableLook=!0,this.inertiaSpin=.9,this.inertiaTranslate=.9,this.inertiaZoom=.8,this.maximumMovementRatio=.1,this.bounceAnimationTime=3,this.minimumZoomDistance=1,this.maximumZoomDistance=Number.POSITIVE_INFINITY,this.translateEventTypes=C.LEFT_DRAG,this.zoomEventTypes=[C.RIGHT_DRAG,C.WHEEL,C.PINCH],this.rotateEventTypes=C.LEFT_DRAG,this.tiltEventTypes=[C.MIDDLE_DRAG,C.PINCH,{eventType:C.LEFT_DRAG,modifier:h.CTRL},{eventType:C.RIGHT_DRAG,modifier:h.CTRL}],this.lookEventTypes={eventType:C.LEFT_DRAG,modifier:h.SHIFT},this.minimumPickingTerrainHeight=15e4,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight,this.minimumCollisionTerrainHeight=15e3,this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight,this.minimumTrackBallHeight=75e5,this._minimumTrackBallHeight=this.minimumTrackBallHeight,this.enableCollisionDetection=!0,this._scene=i,this._globe=void 0,this._ellipsoid=void 0,this._aggregator=new y(i.canvas),this._lastInertiaSpinMovement=void 0,this._lastInertiaZoomMovement=void 0,this._lastInertiaTranslateMovement=void 0,this._lastInertiaTiltMovement=void 0,this._tweens=new b,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new e(-1,-1),this._tiltCenter=new t,this._rotateMousePosition=new e(-1,-1),this._rotateStartPosition=new t,this._strafeStartPosition=new t,this._zoomMouseStart=new e(-1,-1),this._zoomWorldPosition=new t,this._useZoomWorldPosition=!1,this._tiltCVOffMap=!1,this._looking=!1,this._rotating=!1,this._strafing=!1,this._zoomingOnVector=!1,this._rotatingZoom=!1;var n=i.mapProjection;this._maxCoord=n.project(new r(Math.PI,d.PI_OVER_TWO)),this._zoomFactor=5,this._rotateFactor=void 0,this._rotateRateRangeAdjustment=void 0,this._maximumRotateRate=1.77,this._minimumRotateRate=2e-4,this._minimumZoomRate=20,this._maximumZoomRate=5906376272e3}function x(e,t){if(e<0)return 0;var i=25*(1-t);return Math.exp(-i*e)}function A(t){return e.equalsEpsilon(t.startPosition,t.endPosition,d.EPSILON14)}function P(t,i,r,n,a,s,l){var u=s[l];o(u)||(u=s[l]={startPosition:new e,endPosition:new e,motion:new e,active:!1});var c=t.getButtonPressTime(i,r),h=t.getButtonReleaseTime(i,r),d=c&&h&&(h.getTime()-c.getTime())/1e3,p=new Date,m=h&&(p.getTime()-h.getTime())/1e3;if(c&&h&&d<$){var f=x(m,n);if(u.active)u.startPosition=e.clone(u.endPosition,u.startPosition),u.endPosition=e.multiplyByScalar(u.motion,f,u.endPosition),u.endPosition=e.add(u.startPosition,u.endPosition,u.endPosition),u.motion=e.clone(e.ZERO,u.motion);else{var _=t.getLastMovement(i,r);if(!o(_)||A(_))return;u.motion.x=.5*(_.endPosition.x-_.startPosition.x),u.motion.y=.5*(_.endPosition.y-_.startPosition.y),u.startPosition=e.clone(_.startPosition,u.startPosition),u.endPosition=e.multiplyByScalar(u.motion,f,u.endPosition),u.endPosition=e.add(u.startPosition,u.endPosition,u.endPosition),u.active=!0}if(isNaN(u.endPosition.x)||isNaN(u.endPosition.y)||e.distance(u.startPosition,u.endPosition)<.5)return void(u.active=!1);if(!t.isButtonDown(i,r)){var g=t.getStartMousePosition(i,r);a(s,g,u)}}else u.active=!1}function D(e,t,i,r,n,a){if(o(i)){var s=e._aggregator;c(i)||(ee[0]=i,i=ee);for(var l=i.length,u=0;u<l;++u){var h=i[u],d=o(h.eventType)?h.eventType:h,p=h.modifier,m=s.isMoving(d,p)&&s.getMovement(d,p),f=s.getStartMousePosition(d,p);e.enableInputs&&t&&(m?r(e,f,m):n<1&&P(s,d,p,n,r,e,a))}}}function M(i,r,n,a,s,l){var u=1;o(l)&&(u=d.clamp(Math.abs(l),.25,1));var c=i.minimumZoomDistance*u,h=i.maximumZoomDistance,p=s-c,m=a*p;m=d.clamp(m,i._minimumZoomRate,i._maximumZoomRate);var f=n.endPosition.y-n.startPosition.y,_=f/i._scene.canvas.clientHeight;_=Math.min(_,i.maximumMovementRatio);var g=m*_;if(!(g>0&&Math.abs(s-c)<1||g<0&&Math.abs(s-h)<1)){s-g<c?g=s-c-1:s-g>h&&(g=s-h);var v,y=i._scene,C=y.camera,w=y.mode,b=e.equals(r,i._zoomMouseStart),T=i._zoomingOnVector,x=i._rotatingZoom;if(b||(i._zoomMouseStart=e.clone(r,i._zoomMouseStart),o(i._globe)&&(v=w!==S.SCENE2D?B(i,r,ie):C.getPickRay(r,te).origin),o(v)?(i._useZoomWorldPosition=!0,i._zoomWorldPosition=t.clone(v,i._zoomWorldPosition)):i._useZoomWorldPosition=!1,T=i._zoomingOnVector=!1,x=i._rotatingZoom=!1),!i._useZoomWorldPosition)return void C.zoomIn(g);var A=w===S.COLUMBUS_VIEW;if(C.positionCartographic.height<2e6&&(x=!0),!b||x){if(w===S.SCENE2D){var P=i._zoomWorldPosition,D=C.position;if(!t.equals(P,D)&&C.positionCartographic.height<2*i._maxCoord.x){var M=C.position.x,I=t.subtract(P,D,ne);t.normalize(I,I);var R=t.distance(P,D)*g/(.5*C.getMagnitude());C.move(I,.5*R),(C.position.x<0&&M>0||C.position.x>0&&M<0)&&(v=C.getPickRay(r,te).origin,i._zoomWorldPosition=t.clone(v,i._zoomWorldPosition))}}else if(w===S.SCENE3D){var O=t.normalize(C.position,ce);if(C.positionCartographic.height<3e3&&Math.abs(t.dot(C.direction,O))<.6)A=!0;else{var N=y.canvas,L=oe;L.x=N.clientWidth/2,L.y=N.clientHeight/2;var F=B(i,L,ae);if(o(F)&&C.positionCartographic.height<1e6){var V=de;t.clone(C.position,V);var k=i._zoomWorldPosition,z=he;if(z=t.normalize(k,z),t.dot(z,O)<0)return;var U=Ce,G=fe;t.clone(C.direction,G),t.add(V,t.multiplyByScalar(G,1e3,we),U);var W=_e,H=ge;t.subtract(k,V,W),t.normalize(W,H);var q=Math.acos(-t.dot(O,H)),j=t.magnitude(V),Y=t.magnitude(k),X=j-g,Z=t.magnitude(W),K=Math.asin(d.clamp(Z/Y*Math.sin(q),-1,1)),Q=Math.asin(d.clamp(X/Y*Math.sin(q),-1,1)),J=K-Q+q,$=pe;t.normalize(V,$);var ee=me;ee=t.cross(H,$,ee),ee=t.normalize(ee,ee),t.normalize(t.cross($,ee,we),G),t.multiplyByScalar(t.normalize(U,we),t.magnitude(U)-g,U),t.normalize(V,V),t.multiplyByScalar(V,X,V);var be=ve;t.multiplyByScalar(t.add(t.multiplyByScalar($,Math.cos(J)-1,Se),t.multiplyByScalar(G,Math.sin(J),Ee),we),X,be),t.add(V,be,V),t.normalize(U,$),t.normalize(t.cross($,ee,we),G);var Te=ye;return t.multiplyByScalar(t.add(t.multiplyByScalar($,Math.cos(J)-1,Se),t.multiplyByScalar(G,Math.sin(J),Ee),we),t.magnitude(U),Te),t.add(U,Te,U),t.clone(V,C.position),t.normalize(t.subtract(U,V,we),C.direction),t.clone(C.direction,C.direction),t.cross(C.direction,C.up,C.right),void t.cross(C.right,C.direction,C.up)}if(o(F)){var xe=t.normalize(F,se),Ae=t.normalize(i._zoomWorldPosition,le),Pe=t.dot(Ae,xe);if(Pe>0&&Pe<1){var De=d.acosClamped(Pe),Me=t.cross(Ae,xe,ue),Ie=Math.abs(De)>d.toRadians(20)?.75*C.positionCartographic.height:C.positionCartographic.height-g,Re=g/Ie;C.rotate(Me,De*Re)}}else A=!0}}i._rotatingZoom=!A}if(!b&&A||T){var Oe,Ne=E.wgs84ToWindowCoordinates(y,i._zoomWorldPosition,re);Oe=w!==S.COLUMBUS_VIEW&&e.equals(r,i._zoomMouseStart)&&o(Ne)?C.getPickRay(Ne,te):C.getPickRay(r,te);var Le=Oe.direction;w===S.COLUMBUS_VIEW&&t.fromElements(Le.y,Le.z,Le.x,Le),C.move(Le,g),i._zoomingOnVector=!0}else C.zoomIn(g)}}function I(e,i,r){var n=e._scene,o=n.camera,a=o.getPickRay(r.startPosition,be).origin,s=o.getPickRay(r.endPosition,Te).origin,l=t.subtract(a,s,xe),u=t.magnitude(l);u>0&&(t.normalize(l,l),o.move(l,u))}function R(e,t,i){o(i.distance)&&(i=i.distance);var r=e._scene,n=r.camera;M(e,t,i,e._zoomFactor,n.getMagnitude())}function O(t,i,r){if(o(r.angleAndHeight))return void N(t,i,r.angleAndHeight);var n=t._scene,a=n.camera,s=n.canvas,l=s.clientWidth,u=s.clientHeight,c=Ae;c.x=2/l*r.startPosition.x-1,c.y=2/u*(u-r.startPosition.y)-1,c=e.normalize(c,c);var h=Pe;h.x=2/l*r.endPosition.x-1,h.y=2/u*(u-r.endPosition.y)-1,h=e.normalize(h,h);var p=d.acosClamped(c.x);c.y<0&&(p=d.TWO_PI-p);var m=d.acosClamped(h.x);h.y<0&&(m=d.TWO_PI-m);var f=m-p;a.twistRight(f)}function N(e,t,i){var r=e._rotateFactor*e._rotateRateRangeAdjustment;r>e._maximumRotateRate&&(r=e._maximumRotateRate),r<e._minimumRotateRate&&(r=e._minimumRotateRate);var n=e._scene,o=n.camera,a=n.canvas,s=(i.endPosition.x-i.startPosition.x)/a.clientWidth;s=Math.min(s,e.maximumMovementRatio);var l=r*s*Math.PI*4;o.twistRight(l)}function L(e){var t=e._scene.mapMode2D===w.ROTATE;m.equals(m.IDENTITY,e._scene.camera.transform)?(D(e,e.enableTranslate,e.translateEventTypes,I,e.inertiaTranslate,"_lastInertiaTranslateMovement"),D(e,e.enableZoom,e.zoomEventTypes,R,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&D(e,e.enableRotate,e.tiltEventTypes,O,e.inertiaSpin,"_lastInertiaTiltMovement")):(D(e,e.enableZoom,e.zoomEventTypes,R,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&D(e,e.enableRotate,e.translateEventTypes,O,e.inertiaSpin,"_lastInertiaSpinMovement"))}function B(e,i,r){var n=e._scene,a=e._globe,s=n.camera;if(o(a)){var l;n.pickPositionSupported&&(l=n.pickPosition(i,Me));var u=s.getPickRay(i,De),c=a.pick(u,n,Ie),h=o(l)?t.distance(l,s.positionWC):Number.POSITIVE_INFINITY,d=o(c)?t.distance(c,s.positionWC):Number.POSITIVE_INFINITY;return h<d?t.clone(l,r):t.clone(c,r)}}function F(i,r,n){if(t.equals(r,i._translateMousePosition)||(i._looking=!1),t.equals(r,i._strafeMousePosition)||(i._strafing=!1),i._looking)return void Q(i,r,n);if(i._strafing)return void W(i,r,n);var a,s=i._scene,l=s.camera,c=e.clone(n.startPosition,ke),h=e.clone(n.endPosition,ze),p=l.getPickRay(c,Re),m=t.clone(t.ZERO,Fe),_=t.UNIT_X;if(l.position.z<i._minimumPickingTerrainHeight&&(a=B(i,c,Ne),o(a)&&(m.x=a.x)),m.x>l.position.z&&o(a))return t.clone(a,i._strafeStartPosition),i._strafing=!0,W(i,r,n),void(i._strafeMousePosition=e.clone(r,i._strafeMousePosition));var g=f.fromPointNormal(m,_,Ve);p=l.getPickRay(c,Re);var v=u.rayPlane(p,g,Ne),y=l.getPickRay(h,Oe),C=u.rayPlane(y,g,Le);if(!o(v)||!o(C))return i._looking=!0,Q(i,r,n),void e.clone(r,i._translateMousePosition);var w=t.subtract(v,C,Be),S=w.x;w.x=w.y,w.y=w.z,w.z=S;var E=t.magnitude(w);E>d.EPSILON6&&(t.normalize(w,w),l.move(w,E))}function V(t,i,r){if(o(r.angleAndHeight)&&(r=r.angleAndHeight),e.equals(i,t._tiltCenterMousePosition)||(t._tiltCVOffMap=!1,t._looking=!1),t._looking)return void Q(t,i,r);var n=t._scene,a=n.camera,s=t._maxCoord,l=Math.abs(a.position.x)-s.x<0&&Math.abs(a.position.y)-s.y<0;t._tiltCVOffMap||!l||a.position.z>t._minimumPickingTerrainHeight?(t._tiltCVOffMap=!0,k(t,i,r)):z(t,i,r)}function k(i,r,n){var a=i._scene,s=a.camera,u=a.canvas,c=Ue;c.x=u.clientWidth/2,c.y=u.clientHeight/2;var h,p=s.getPickRay(c,Ge),f=t.UNIT_X,_=p.origin,g=p.direction,y=t.dot(f,g);if(Math.abs(y)>d.EPSILON6&&(h=-t.dot(f,_)/y),!o(h)||h<=0)return i._looking=!0,Q(i,r,n),void e.clone(r,i._tiltCenterMousePosition);var C=t.multiplyByScalar(g,h,We);t.add(_,C,C);var w=a.mapProjection,S=w.ellipsoid;t.fromElements(C.y,C.z,C.x,C);var E=w.unproject(C,Ke);S.cartographicToCartesian(E,C);var b=v.eastNorthUpToFixedFrame(C,S,qe),T=i._globe,x=i._ellipsoid;i._globe=void 0,i._ellipsoid=l.UNIT_SPHERE,i._rotateFactor=1,i._rotateRateRangeAdjustment=1;var A=m.clone(s.transform,Qe);s._setTransform(b),q(i,r,n,t.UNIT_Z),s._setTransform(A),i._globe=T,i._ellipsoid=x;var P=x.maximumRadius;i._rotateFactor=1/P,i._rotateRateRangeAdjustment=P}function z(i,r,n){var a,s,c=i._scene,h=c.camera,g=t.UNIT_X;if(e.equals(r,i._tiltCenterMousePosition))a=t.clone(i._tiltCenter,We);else{if(h.position.z<i._minimumPickingTerrainHeight&&(a=B(i,r,We)),!o(a)){s=h.getPickRay(r,Ge);var y,C=s.origin,w=s.direction,S=t.dot(g,w);if(Math.abs(S)>d.EPSILON6&&(y=-t.dot(g,C)/S),!o(y)||y<=0)return i._looking=!0,Q(i,r,n),void e.clone(r,i._tiltCenterMousePosition);a=t.multiplyByScalar(w,y,We),t.add(C,a,a)}e.clone(r,i._tiltCenterMousePosition),t.clone(a,i._tiltCenter)}var E=c.canvas,b=Ue;b.x=E.clientWidth/2,b.y=i._tiltCenterMousePosition.y,s=h.getPickRay(b,Ge);var T=t.clone(t.ZERO,Ye);T.x=a.x;var x=f.fromPointNormal(T,g,Xe),A=u.rayPlane(s,x,He),P=h._projection,D=P.ellipsoid;t.fromElements(a.y,a.z,a.x,a);var M=P.unproject(a,Ke);D.cartographicToCartesian(M,a);var I,R=v.eastNorthUpToFixedFrame(a,D,qe);o(A)?(t.fromElements(A.y,A.z,A.x,A),M=P.unproject(A,Ke),D.cartographicToCartesian(M,A),I=v.eastNorthUpToFixedFrame(A,D,je)):I=R;var O=i._globe,N=i._ellipsoid;i._globe=void 0,i._ellipsoid=l.UNIT_SPHERE,i._rotateFactor=1,i._rotateRateRangeAdjustment=1;var L=t.UNIT_Z,F=m.clone(h.transform,Qe);h._setTransform(R);var V=t.cross(t.UNIT_Z,t.normalize(h.position,Ze),Ze),k=t.dot(h.right,V);if(q(i,r,n,L,!1,!0),h._setTransform(I),k<0){n.startPosition.y>n.endPosition.y&&(L=void 0);var z=h.constrainedAxis;h.constrainedAxis=void 0,q(i,r,n,L,!0,!1),h.constrainedAxis=z}else q(i,r,n,L,!0,!1);if(o(h.constrainedAxis)){var U=t.cross(h.direction,h.constrainedAxis,Dt);t.equalsEpsilon(U,t.ZERO,d.EPSILON6)||(t.dot(U,h.right)<0&&t.negate(U,U),t.cross(U,h.direction,h.up),t.cross(h.direction,h.up,h.right),t.normalize(h.up,h.up),t.normalize(h.right,h.right))}h._setTransform(F),i._globe=O,i._ellipsoid=N;var G=N.maximumRadius;i._rotateFactor=1/G,i._rotateRateRangeAdjustment=G;var W=t.clone(h.positionWC,Ze);if(h._adjustHeightForTerrain(),!t.equals(h.positionWC,W)){h._setTransform(I),h.worldToCameraCoordinatesPoint(W,W);var H=t.magnitudeSquared(W);t.magnitudeSquared(h.position)>H&&(t.normalize(h.position,h.position),t.multiplyByScalar(h.position,Math.sqrt(H),h.position));var j=t.angleBetween(W,h.position),Y=t.cross(W,h.position,W);t.normalize(Y,Y);var X=_.fromAxisAngle(Y,j,Je),Z=p.fromQuaternion(X,$e);p.multiplyByVector(Z,h.direction,h.direction),p.multiplyByVector(Z,h.up,h.up),t.cross(h.direction,h.up,h.right),t.cross(h.right,h.direction,h.up),h._setTransform(F)}}function U(e,i,r){o(r.distance)&&(r=r.distance);var n=e._scene,a=n.camera,s=n.canvas,l=et;l.x=s.clientWidth/2,l.y=s.clientHeight/2;var u,c=a.getPickRay(l,tt);a.position.z<e._minimumPickingTerrainHeight&&(u=B(e,l,it));var h;if(o(u))h=t.distance(c.origin,u);else{var d=t.UNIT_X,p=c.origin,m=c.direction;h=-t.dot(d,p)/t.dot(d,m)}M(e,i,r,e._zoomFactor,h)}function G(e){var t=e._scene,i=t.camera;if(m.equals(m.IDENTITY,i.transform)){var r=e._tweens;if(e._aggregator.anyButtonDown&&r.removeAll(),D(e,e.enableTilt,e.tiltEventTypes,V,e.inertiaSpin,"_lastInertiaTiltMovement"),D(e,e.enableTranslate,e.translateEventTypes,F,e.inertiaTranslate,"_lastInertiaTranslateMovement"),D(e,e.enableZoom,e.zoomEventTypes,U,e.inertiaZoom,"_lastInertiaZoomMovement"),D(e,e.enableLook,e.lookEventTypes,Q),!(e._aggregator.anyButtonDown||o(e._lastInertiaZoomMovement)&&e._lastInertiaZoomMovement.active||o(e._lastInertiaTranslateMovement)&&e._lastInertiaTranslateMovement.active||r.contains(e._tween))){var n=i.createCorrectPositionTween(e.bounceAnimationTime);o(n)&&(e._tween=r.add(n))}r.update()}else D(e,e.enableRotate,e.rotateEventTypes,q,e.inertiaSpin,"_lastInertiaSpinMovement"),D(e,e.enableZoom,e.zoomEventTypes,Y,e.inertiaZoom,"_lastInertiaZoomMovement")}function W(e,i,r){var n=e._scene,a=n.camera,s=B(e,r.startPosition,ut);if(o(s)){var l=r.endPosition,c=a.getPickRay(l,rt),h=t.clone(a.direction,at);n.mode===S.COLUMBUS_VIEW&&t.fromElements(h.z,h.x,h.y,h);var d=f.fromPointNormal(s,h,nt),p=u.rayPlane(c,d,ot);o(p)&&(h=t.subtract(s,p,h),n.mode===S.COLUMBUS_VIEW&&t.fromElements(h.y,h.z,h.x,h),t.add(a.position,h,a.position))}}function H(i,r,n){var a=i._scene,s=a.camera;if(!m.equals(s.transform,m.IDENTITY))return void q(i,r,n);var u,c,h,d,p=i._ellipsoid.geodeticSurfaceNormal(s.position,dt),f=i._ellipsoid.cartesianToCartographic(s.positionWC,lt).height,_=i._globe,g=!1;if(o(_)&&f<i._minimumPickingTerrainHeight&&(d=B(i,n.startPosition,ut),o(d))){var v=s.getPickRay(n.startPosition,De),y=i._ellipsoid.geodeticSurfaceNormal(d);g=Math.abs(t.dot(v.direction,y))<.05,g&&!i._looking&&(i._rotating=!1,i._strafing=!0)}return e.equals(r,i._rotateMousePosition)?void(i._looking?Q(i,r,n,p):i._rotating?q(i,r,n):i._strafing?(t.clone(d,i._strafeStartPosition),W(i,r,n)):(u=t.magnitude(i._rotateStartPosition),c=ct,c.x=c.y=c.z=u,h=l.fromCartesian3(c,ht),j(i,r,n,h))):(i._looking=!1,i._rotating=!1,i._strafing=!1,o(_)&&f<i._minimumPickingTerrainHeight?o(d)?t.magnitude(s.position)<t.magnitude(d)?(t.clone(d,i._strafeStartPosition),i._strafing=!0,W(i,r,n)):(u=t.magnitude(d),c=ct,c.x=c.y=c.z=u,h=l.fromCartesian3(c,ht),j(i,r,n,h),t.clone(d,i._rotateStartPosition)):(i._looking=!0,Q(i,r,n,p)):o(s.pickEllipsoid(n.startPosition,i._ellipsoid,st))?(j(i,r,n,i._ellipsoid),t.clone(st,i._rotateStartPosition)):f>i._minimumTrackBallHeight?(i._rotating=!0,q(i,r,n)):(i._looking=!0,Q(i,r,n,p)),void e.clone(r,i._rotateMousePosition))}function q(e,i,r,a,s,l){s=n(s,!1),l=n(l,!1);var u=e._scene,c=u.camera,h=u.canvas,d=c.constrainedAxis;o(a)&&(c.constrainedAxis=a);var p=t.magnitude(c.position),m=e._rotateFactor*(p-e._rotateRateRangeAdjustment);m>e._maximumRotateRate&&(m=e._maximumRotateRate),m<e._minimumRotateRate&&(m=e._minimumRotateRate);var f=(r.startPosition.x-r.endPosition.x)/h.clientWidth,_=(r.startPosition.y-r.endPosition.y)/h.clientHeight;f=Math.min(f,e.maximumMovementRatio),_=Math.min(_,e.maximumMovementRatio);var g=m*f*Math.PI*2,v=m*_*Math.PI;s||c.rotateRight(g),l||c.rotateUp(v),c.constrainedAxis=d}function j(i,r,n,a){var s=i._scene,l=s.camera,u=e.clone(n.startPosition,yt),c=e.clone(n.endPosition,Ct),h=l.pickEllipsoid(u,a,pt),p=l.pickEllipsoid(c,a,mt); +if(!o(h)||!o(p))return i._rotating=!0,void q(i,r,n);if(h=l.worldToCameraCoordinates(h,h),p=l.worldToCameraCoordinates(p,p),o(l.constrainedAxis)){var m=l.constrainedAxis,f=t.mostOrthogonalAxis(m,ft);t.cross(f,m,f),t.normalize(f,f);var _=t.cross(m,f,_t),g=t.magnitude(h),v=t.dot(m,h),y=Math.acos(v/g),C=t.multiplyByScalar(m,v,gt);t.subtract(h,C,C),t.normalize(C,C);var w=t.magnitude(p),S=t.dot(m,p),E=Math.acos(S/w),b=t.multiplyByScalar(m,S,vt);t.subtract(p,b,b),t.normalize(b,b);var T=Math.acos(t.dot(C,f));t.dot(C,_)<0&&(T=d.TWO_PI-T);var x=Math.acos(t.dot(b,f));t.dot(b,_)<0&&(x=d.TWO_PI-x);var A,P=T-x;A=t.equalsEpsilon(m,l.position,d.EPSILON2)?l.right:t.cross(m,l.position,ft);var D,M=t.cross(m,A,ft),I=t.dot(M,t.subtract(h,m,_t)),R=t.dot(M,t.subtract(p,m,_t));D=I>0&&R>0?E-y:I>0&&R<=0?t.dot(l.position,m)>0?-y-E:y+E:y-E,l.rotateRight(P),l.rotateUp(D)}else{t.normalize(h,h),t.normalize(p,p);var O=t.dot(h,p),N=t.cross(h,p,ft);if(O<1&&!t.equalsEpsilon(N,t.ZERO,d.EPSILON14)){var L=Math.acos(O);l.rotate(N,L)}}}function Y(e,i,r){o(r.distance)&&(r=r.distance);var n=e._ellipsoid,a=e._scene,s=a.camera,l=a.canvas,u=et;u.x=l.clientWidth/2,u.y=l.clientHeight/2;var c,h=s.getPickRay(u,tt),d=n.cartesianToCartographic(s.position,St).height;d<e._minimumPickingTerrainHeight&&(c=B(e,u,it));var p;p=o(c)?t.distance(h.origin,c):d;var m=t.normalize(s.position,wt);M(e,i,r,e._zoomFactor,p,t.dot(m,s.direction))}function X(t,i,r){var n=t._scene,a=n.camera;if(m.equals(a.transform,m.IDENTITY)){if(o(r.angleAndHeight)&&(r=r.angleAndHeight),e.equals(i,t._tiltCenterMousePosition)||(t._tiltOnEllipsoid=!1,t._looking=!1),t._looking){var s=t._ellipsoid.geodeticSurfaceNormal(a.position,Nt);return void Q(t,i,r,s)}var l=t._ellipsoid,u=l.cartesianToCartographic(a.position,Ot);t._tiltOnEllipsoid||u.height>t._minimumCollisionTerrainHeight?(t._tiltOnEllipsoid=!0,Z(t,i,r)):K(t,i,r)}}function Z(i,r,n){var a=i._ellipsoid,s=i._scene,c=s.camera,h=.25*i.minimumZoomDistance,p=a.cartesianToCartographic(c.positionWC,Lt).height;if(!(p-h-1<d.EPSILON3&&n.endPosition.y-n.startPosition.y<0)){var f=s.canvas,_=Et;_.x=f.clientWidth/2,_.y=f.clientHeight/2;var y,C=c.getPickRay(_,bt),w=u.rayEllipsoid(C,a);if(o(w))y=g.getPoint(C,w.start,Tt);else{if(!(p>i._minimumTrackBallHeight)){i._looking=!0;var S=i._ellipsoid.geodeticSurfaceNormal(c.position,Nt);return Q(i,r,n,S),void e.clone(r,i._tiltCenterMousePosition)}var E=u.grazingAltitudeLocation(C,a);if(!o(E))return;var b=a.cartesianToCartographic(E,Ot);b.height=0,y=a.cartographicToCartesian(b,Tt)}var T=v.eastNorthUpToFixedFrame(y,a,At),x=i._globe,A=i._ellipsoid;i._globe=void 0,i._ellipsoid=l.UNIT_SPHERE,i._rotateFactor=1,i._rotateRateRangeAdjustment=1;var P=m.clone(c.transform,Mt);c._setTransform(T),q(i,r,n,t.UNIT_Z),c._setTransform(P),i._globe=x,i._ellipsoid=A;var D=A.maximumRadius;i._rotateFactor=1/D,i._rotateRateRangeAdjustment=D}}function K(i,r,n){var a,s,c,h=i._ellipsoid,f=i._scene,y=f.camera;if(e.equals(r,i._tiltCenterMousePosition))a=t.clone(i._tiltCenter,Tt);else{if(a=B(i,r,Tt),!o(a)){if(s=y.getPickRay(r,bt),c=u.rayEllipsoid(s,h),!o(c)){var C=h.cartesianToCartographic(y.position,Ot);if(C.height<=i._minimumTrackBallHeight){i._looking=!0;var w=i._ellipsoid.geodeticSurfaceNormal(y.position,Nt);Q(i,r,n,w),e.clone(r,i._tiltCenterMousePosition)}return}a=g.getPoint(s,c.start,Tt)}e.clone(r,i._tiltCenterMousePosition),t.clone(a,i._tiltCenter)}var S=f.canvas,E=Et;E.x=S.clientWidth/2,E.y=i._tiltCenterMousePosition.y,s=y.getPickRay(E,bt);var b=t.magnitude(a),T=t.fromElements(b,b,b,ct),x=l.fromCartesian3(T,ht);if(c=u.rayEllipsoid(s,x),o(c)){var A=t.magnitude(s.origin)>b?c.start:c.stop,P=g.getPoint(s,A,xt),D=v.eastNorthUpToFixedFrame(a,h,At),M=v.eastNorthUpToFixedFrame(P,x,Pt),I=i._globe,R=i._ellipsoid;i._globe=void 0,i._ellipsoid=l.UNIT_SPHERE,i._rotateFactor=1,i._rotateRateRangeAdjustment=1;var O=t.UNIT_Z,N=m.clone(y.transform,Mt);y._setTransform(D);var L=t.cross(P,y.positionWC,Dt),F=t.dot(y.rightWC,L);if(q(i,r,n,O,!1,!0),y._setTransform(M),F<0){n.startPosition.y>n.endPosition.y&&(O=void 0);var V=y.constrainedAxis;y.constrainedAxis=void 0,q(i,r,n,O,!0,!1),y.constrainedAxis=V}else q(i,r,n,O,!0,!1);if(o(y.constrainedAxis)){var k=t.cross(y.direction,y.constrainedAxis,Dt);t.equalsEpsilon(k,t.ZERO,d.EPSILON6)||(t.dot(k,y.right)<0&&t.negate(k,k),t.cross(k,y.direction,y.up),t.cross(y.direction,y.up,y.right),t.normalize(y.up,y.up),t.normalize(y.right,y.right))}y._setTransform(N),i._globe=I,i._ellipsoid=R;var z=R.maximumRadius;i._rotateFactor=1/z,i._rotateRateRangeAdjustment=z;var U=t.clone(y.positionWC,Dt);if(y._adjustHeightForTerrain(),!t.equals(y.positionWC,U)){y._setTransform(M),y.worldToCameraCoordinatesPoint(U,U);var G=t.magnitudeSquared(U);t.magnitudeSquared(y.position)>G&&(t.normalize(y.position,y.position),t.multiplyByScalar(y.position,Math.sqrt(G),y.position));var W=t.angleBetween(U,y.position),H=t.cross(U,y.position,U);t.normalize(H,H);var j=_.fromAxisAngle(H,W,It),Y=p.fromQuaternion(j,Rt);p.multiplyByVector(Y,y.direction,y.direction),p.multiplyByVector(Y,y.up,y.up),t.cross(y.direction,y.up,y.right),t.cross(y.right,y.direction,y.up),y._setTransform(N)}}}function Q(e,i,r,a){var s=e._scene,l=s.camera,u=Bt;u.x=r.startPosition.x,u.y=0;var c=Ft;c.x=r.endPosition.x,c.y=0;var h=l.getPickRay(u,Vt).direction,p=l.getPickRay(c,kt).direction,m=0,f=t.dot(h,p);f<1&&(m=Math.acos(f)),m=r.startPosition.x>r.endPosition.x?-m:m;var _=e._horizontalRotationAxis;if(o(a)?l.look(a,-m):o(_)?l.look(_,-m):l.lookLeft(m),u.x=0,u.y=r.startPosition.y,c.x=0,c.y=r.endPosition.y,h=l.getPickRay(u,Vt).direction,p=l.getPickRay(c,kt).direction,m=0,f=t.dot(h,p),f<1&&(m=Math.acos(f)),m=r.startPosition.y>r.endPosition.y?-m:m,a=n(a,_),o(a)){var g=l.direction,v=t.negate(a,zt),y=t.equalsEpsilon(g,a,d.EPSILON2),C=t.equalsEpsilon(g,v,d.EPSILON2);if(y||C)(y&&m<0||C&&m>0)&&l.look(l.right,-m);else{f=t.dot(g,a);var w=d.acosClamped(f);m>0&&m>w&&(m=w-d.EPSILON4),f=t.dot(g,v),w=d.acosClamped(f),m<0&&-m>w&&(m=-w+d.EPSILON4);var S=t.cross(a,g,Ut);l.look(S,m)}}else l.lookUp(m)}function J(e){D(e,e.enableRotate,e.rotateEventTypes,H,e.inertiaSpin,"_lastInertiaSpinMovement"),D(e,e.enableZoom,e.zoomEventTypes,Y,e.inertiaZoom,"_lastInertiaZoomMovement"),D(e,e.enableTilt,e.tiltEventTypes,X,e.inertiaSpin,"_lastInertiaTiltMovement"),D(e,e.enableLook,e.lookEventTypes,Q)}var $=.4,ee=[],te=new g,ie=new t,re=new e,ne=new t,oe=new e,ae=new t,se=new t,le=new t,ue=new t,ce=new t,he=new t,de=new t,pe=new t,me=new t,fe=new t,_e=new t,ge=new t,ve=new t,ye=new t,Ce=new t,we=new t,Se=new t,Ee=new t,be=new g,Te=new g,xe=new t,Ae=new e,Pe=new e,De=new g,Me=new t,Ie=new t,Re=new g,Oe=new g,Ne=new t,Le=new t,Be=new t,Fe=new t,Ve=new f(t.ZERO,0),ke=new e,ze=new e,Ue=new e,Ge=new g,We=new t,He=new t,qe=new m,je=new m,Ye=new t,Xe=new f(t.ZERO,0),Ze=new t,Ke=new r,Qe=new m,Je=new _,$e=new p,et=new e,tt=new g,it=new t,rt=new g,nt=new f(t.ZERO,0),ot=new t,at=new t,st=new t,lt=new r,ut=new t,ct=new t,ht=new l,dt=new t,pt=i.clone(i.UNIT_W),mt=i.clone(i.UNIT_W),ft=new t,_t=new t,gt=new t,vt=new t,yt=new e,Ct=new e,wt=new t,St=new r,Et=new e,bt=new g,Tt=new t,xt=new t,At=new m,Pt=new m,Dt=new t,Mt=new m,It=new _,Rt=new p,Ot=new r,Nt=new t,Lt=new r,Bt=new e,Ft=new e,Vt=new g,kt=new g,zt=new t,Ut=new t;return T.prototype.update=function(){m.equals(this._scene.camera.transform,m.IDENTITY)?(this._globe=this._scene.globe,this._ellipsoid=o(this._globe)?this._globe.ellipsoid:this._scene.mapProjection.ellipsoid):(this._globe=void 0,this._ellipsoid=l.UNIT_SPHERE),this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight*this._scene.terrainExaggeration,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight*this._scene.terrainExaggeration,this._minimumTrackBallHeight=this.minimumTrackBallHeight*this._scene.terrainExaggeration;var e=this._ellipsoid.maximumRadius;this._rotateFactor=1/e,this._rotateRateRangeAdjustment=e;var i=this._scene,r=i.mode;r===S.SCENE2D?L(this):r===S.COLUMBUS_VIEW?(this._horizontalRotationAxis=t.UNIT_Z,G(this)):r===S.SCENE3D&&(this._horizontalRotationAxis=void 0,J(this)),this._aggregator.reset()},T.prototype.isDestroyed=function(){return!1},T.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),a(this)},T}),i("Scene/ShadowMapShader",["../Core/defined","../Renderer/ShaderSource"],function(e,t){"use strict";function i(){}return i.createShadowCastVertexShader=function(i,r,n){var o=i.defines.slice(0),a=i.sources.slice(0);n&&o.push("GENERATE_POSITION");var s=t.findPositionVarying(i),l=e(s);if(r&&!l){for(var u=a.length,c=0;c<u;++c)a[c]=t.replaceMain(a[c],"czm_shadow_cast_main");var h="varying vec3 v_positionEC; \nvoid main() \n{ \n czm_shadow_cast_main(); \n v_positionEC = (czm_inverseProjection * gl_Position).xyz; \n}";a.push(h)}return new t({defines:o,sources:a})},i.createShadowCastFragmentShader=function(i,r,n,o){var a=i.defines.slice(0),s=i.sources.slice(0),l=t.findPositionVarying(i),u=e(l);u||(l="v_positionEC");for(var c=s.length,h=0;h<c;++h)s[h]=t.replaceMain(s[h],"czm_shadow_cast_main");var d="";return r&&(u||(d+="varying vec3 v_positionEC; \n"),d+="uniform vec4 shadowMap_lightPositionEC; \n"),d+=o?"void main() \n{ \n":"void main() \n{ \n czm_shadow_cast_main(); \n if (gl_FragColor.a == 0.0) \n { \n discard; \n } \n",d+=r?"float distance = length("+l+"); \ndistance /= shadowMap_lightPositionEC.w; // radius \ngl_FragColor = czm_packDepth(distance); \n":n?"gl_FragColor = vec4(1.0); \n":"gl_FragColor = czm_packDepth(gl_FragCoord.z); \n",d+="} \n",s.push(d),new t({defines:a,sources:s})},i.createShadowReceiveVertexShader=function(e,i,r){var n=e.defines.slice(0),o=e.sources.slice(0);return i&&(r?n.push("GENERATE_POSITION_AND_NORMAL"):n.push("GENERATE_POSITION")),new t({defines:n,sources:o})},i.createShadowReceiveFragmentShader=function(i,r,n,o,a){for(var s=t.findNormalVarying(i),l=!o&&e(s)||o&&a,u=t.findPositionVarying(i),c=e(u),h=r._usesDepthTexture,d=r._polygonOffsetSupported,p=r._isPointLight,m=r._isSpotLight,f=r._numberOfCascades>1,_=r.debugCascadeColors,g=r.softShadows,v=p?r._pointBias:o?r._terrainBias:r._primitiveBias,y=i.defines.slice(0),C=i.sources.slice(0),w=C.length,S=0;S<w;++S)C[S]=t.replaceMain(C[S],"czm_shadow_receive_main");p?y.push("USE_CUBE_MAP_SHADOW"):h&&y.push("USE_SHADOW_DEPTH_TEXTURE"),g&&!p&&y.push("USE_SOFT_SHADOWS"),f&&n&&o&&(l?y.push("ENABLE_VERTEX_LIGHTING"):y.push("ENABLE_DAYNIGHT_SHADING")),n&&v.normalShading&&l&&(y.push("USE_NORMAL_SHADING"),v.normalShadingSmooth>0&&y.push("USE_NORMAL_SHADING_SMOOTH"));var E="";return E+=p?"uniform samplerCube shadowMap_textureCube; \n":"uniform sampler2D shadowMap_texture; \n",E+="uniform mat4 shadowMap_matrix; \nuniform vec3 shadowMap_lightDirectionEC; \nuniform vec4 shadowMap_lightPositionEC; \nuniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness; \nuniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth; \nvec4 getPositionEC() \n{ \n"+(c?" return vec4("+u+", 1.0); \n":" return czm_windowToEyeCoordinates(gl_FragCoord); \n")+"} \nvec3 getNormalEC() \n{ \n"+(l?" return normalize("+s+"); \n":" return vec3(1.0); \n")+"} \nvoid applyNormalOffset(inout vec4 positionEC, vec3 normalEC, float nDotL) \n{ \n"+(v.normalOffset&&l?" float normalOffset = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.x; \n float normalOffsetScale = 1.0 - nDotL; \n vec3 offset = normalOffset * normalOffsetScale * normalEC; \n positionEC.xyz += offset; \n":"")+"} \n",E+="void main() \n{ \n czm_shadow_receive_main(); \n vec4 positionEC = getPositionEC(); \n vec3 normalEC = getNormalEC(); \n float depth = -positionEC.z; \n",E+=" czm_shadowParameters shadowParameters; \n shadowParameters.texelStepSize = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy; \n shadowParameters.depthBias = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z; \n shadowParameters.normalShadingSmooth = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w; \n shadowParameters.darkness = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w; \n",o?E+=" shadowParameters.depthBias *= max(depth * 0.01, 1.0); \n":d||(E+=" shadowParameters.depthBias *= mix(1.0, 100.0, depth * 0.0015); \n"),E+=p?" vec3 directionEC = positionEC.xyz - shadowMap_lightPositionEC.xyz; \n float distance = length(directionEC); \n directionEC = normalize(directionEC); \n float radius = shadowMap_lightPositionEC.w; \n // Stop early if the fragment is beyond the point light radius \n if (distance > radius) \n { \n return; \n } \n vec3 directionWC = czm_inverseViewRotation * directionEC; \n shadowParameters.depth = distance / radius; \n shadowParameters.nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); \n shadowParameters.texCoords = directionWC; \n float visibility = czm_shadowVisibility(shadowMap_textureCube, shadowParameters); \n":m?" vec3 directionEC = normalize(positionEC.xyz - shadowMap_lightPositionEC.xyz); \n float nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); \n applyNormalOffset(positionEC, normalEC, nDotL); \n vec4 shadowPosition = shadowMap_matrix * positionEC; \n // Spot light uses a perspective projection, so perform the perspective divide \n shadowPosition /= shadowPosition.w; \n // Stop early if the fragment is not in the shadow bounds \n if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) \n { \n return; \n } \n shadowParameters.texCoords = shadowPosition.xy; \n shadowParameters.depth = shadowPosition.z; \n shadowParameters.nDotL = nDotL; \n float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); \n":f?" float maxDepth = shadowMap_cascadeSplits[1].w; \n // Stop early if the eye depth exceeds the last cascade \n if (depth > maxDepth) \n { \n return; \n } \n // Get the cascade based on the eye-space depth \n vec4 weights = czm_cascadeWeights(depth); \n // Apply normal offset \n float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); \n applyNormalOffset(positionEC, normalEC, nDotL); \n // Transform position into the cascade \n vec4 shadowPosition = czm_cascadeMatrix(weights) * positionEC; \n // Get visibility \n shadowParameters.texCoords = shadowPosition.xy; \n shadowParameters.depth = shadowPosition.z; \n shadowParameters.nDotL = nDotL; \n float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); \n // Fade out shadows that are far away \n float shadowMapMaximumDistance = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.z; \n float fade = max((depth - shadowMapMaximumDistance * 0.8) / (shadowMapMaximumDistance * 0.2), 0.0); \n visibility = mix(visibility, 1.0, fade); \n"+(_?" // Draw cascade colors for debugging \n gl_FragColor *= czm_cascadeColor(weights); \n":""):" float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); \n applyNormalOffset(positionEC, normalEC, nDotL); \n vec4 shadowPosition = shadowMap_matrix * positionEC; \n // Stop early if the fragment is not in the shadow bounds \n if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) \n { \n return; \n } \n shadowParameters.texCoords = shadowPosition.xy; \n shadowParameters.depth = shadowPosition.z; \n shadowParameters.nDotL = nDotL; \n float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); \n",E+=" gl_FragColor.rgb *= visibility; \n} \n",C.push(E),new t({defines:y,sources:C})},i}),i("Scene/ShadowMap",["../Core/BoundingRectangle","../Core/BoundingSphere","../Core/BoxOutlineGeometry","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/clone","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/combine","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/FeatureDetection","../Core/GeometryInstance","../Core/Intersect","../Core/Math","../Core/Matrix4","../Core/PixelFormat","../Core/Quaternion","../Core/SphereOutlineGeometry","../Core/WebGLConstants","../Renderer/ClearCommand","../Renderer/ContextLimits","../Renderer/CubeMap","../Renderer/DrawCommand","../Renderer/Framebuffer","../Renderer/Pass","../Renderer/PassState","../Renderer/PixelDatatype","../Renderer/Renderbuffer","../Renderer/RenderbufferFormat","../Renderer/RenderState","../Renderer/Sampler","../Renderer/ShaderProgram","../Renderer/Texture","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","./Camera","./CullFace","./CullingVolume","./DebugCameraPrimitive","./OrthographicFrustum","./PerInstanceColorAppearance","./PerspectiveFrustum","./Primitive","./ShadowMapShader"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I,R,O,N,L,B,F,V,k,z,U,G,W,H,q,j,Y,X,Z,K){"use strict";function Q(e){e=h(e,h.EMPTY_OBJECT);var i=e.context;this._enabled=h(e.enabled,!0),this._softShadows=h(e.softShadows,!1),this._normalOffset=h(e.normalOffset,!0),this.dirty=!0,this.fromLightSource=h(e.fromLightSource,!0),this.darkness=h(e.darkness,.3),this._darkness=this.darkness,this.maximumDistance=h(e.maximumDistance,5e3),this._outOfView=!1,this._outOfViewPrevious=!1,this._needsUpdate=!0;var a=!0;(_.isInternetExplorer()||_.isEdge()||(_.isChrome()||_.isFirefox())&&_.isWindows()&&!i.depthTexture)&&(a=!1),this._polygonOffsetSupported=a,this._terrainBias={polygonOffset:a,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.5,normalShading:!0,normalShadingSmooth:.3,depthBias:1e-4},this._primitiveBias={polygonOffset:a,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.1,normalShading:!0,normalShadingSmooth:.05,depthBias:2e-5},this._pointBias={polygonOffset:!1,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:0,normalShading:!0,normalShadingSmooth:.1,depthBias:5e-4},this._depthAttachment=void 0,this._colorAttachment=void 0,this._shadowMapMatrix=new C,this._shadowMapTexture=void 0,this._lightDirectionEC=new n,this._lightPositionEC=new o,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new fe,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new t,this._isPointLight=h(e.isPointLight,!1),this._pointLightRadius=h(e.pointLightRadius,100),this._cascadesEnabled=!this._isPointLight&&h(e.cascadesEnabled,!0),this._numberOfCascades=this._cascadesEnabled?h(e.numberOfCascades,4):0,this._fitNearFar=!0,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new r,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new j:d(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new o,new o],this._cascadeMatrices=[new C,new C,new C,new C],this._cascadeDistances=new o;var s;s=this._isPointLight?6:this._cascadesEnabled?this._numberOfCascades:1,this._passes=new Array(s);for(var u=0;u<s;++u)this._passes[u]=new J(i);this.debugShow=!1,this.debugFreezeFrame=!1,this._debugFreezeFrame=!1,this._debugCascadeColors=!1,this._debugLightFrustum=void 0,this._debugCameraFrustum=void 0,this._debugCascadeFrustums=new Array(this._numberOfCascades),this._debugShadowViewCommand=void 0,this._usesDepthTexture=i.depthTexture,this._isPointLight&&(this._usesDepthTexture=!1),this._primitiveRenderState=void 0,this._terrainRenderState=void 0,this._pointRenderState=void 0,ee(this),this._clearCommand=new T({depth:1,color:new l}),this._clearPassState=new I(i),this._size=h(e.size,2048),this.size=this._size}function J(e){this.camera=new fe,this.passState=new I(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function $(e,t){return L.fromCache({cull:{enabled:!0,face:W.BACK},depthTest:{enabled:!0},colorMask:{red:e,green:e,blue:e,alpha:e},depthMask:!0,polygonOffset:{enabled:t.polygonOffset,factor:t.polygonOffsetFactor,units:t.polygonOffsetUnits}})}function ee(e){var t=!e._usesDepthTexture;e._primitiveRenderState=$(t,e._primitiveBias),e._terrainRenderState=$(t,e._terrainBias),e._pointRenderState=$(t,e._pointBias)}function te(e){for(var t=e._passes.length,i=0;i<t;++i){var r=e._passes[i],n=r.framebuffer;d(n)&&!n.isDestroyed()&&n.destroy(),r.framebuffer=void 0}e._depthAttachment=e._depthAttachment&&e._depthAttachment.destroy(),e._colorAttachment=e._colorAttachment&&e._colorAttachment.destroy()}function ie(){return new B({wrapS:U.CLAMP_TO_EDGE,wrapT:U.CLAMP_TO_EDGE,minificationFilter:z.NEAREST,magnificationFilter:k.NEAREST})}function re(e,t){for(var i=new O({context:t,width:e._textureSize.x,height:e._textureSize.y,format:N.DEPTH_COMPONENT16}),r=new V({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:w.RGBA,pixelDatatype:R.UNSIGNED_BYTE,sampler:ie()}),n=new D({context:t,depthRenderbuffer:i,colorTextures:[r],destroyAttachments:!1}),o=e._passes.length,a=0;a<o;++a){var s=e._passes[a];s.framebuffer=n,s.passState.framebuffer=n}e._shadowMapTexture=r,e._depthAttachment=i,e._colorAttachment=r}function ne(e,t){for(var i=new V({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:w.DEPTH_STENCIL,pixelDatatype:R.UNSIGNED_INT_24_8,sampler:ie()}),r=new D({context:t,depthStencilTexture:i,destroyAttachments:!1}),n=e._passes.length,o=0;o<n;++o){var a=e._passes[o];a.framebuffer=r,a.passState.framebuffer=r}e._shadowMapTexture=i,e._depthAttachment=i}function oe(e,t){for(var i=new O({context:t,width:e._textureSize.x,height:e._textureSize.y,format:N.DEPTH_COMPONENT16}),r=new A({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:w.RGBA,pixelDatatype:R.UNSIGNED_BYTE,sampler:ie()}),n=[r.negativeX,r.negativeY,r.negativeZ,r.positiveX,r.positiveY,r.positiveZ],o=0;o<6;++o){var a=new D({context:t,depthRenderbuffer:i,colorTextures:[n[o]],destroyAttachments:!1}),s=e._passes[o];s.framebuffer=a,s.passState.framebuffer=a}e._shadowMapTexture=r,e._depthAttachment=i,e._colorAttachment=r}function ae(e,t){e._isPointLight?oe(e,t):e._usesDepthTexture?ne(e,t):re(e,t)}function se(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==b.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,ee(e),te(e),ae(e,t))}function le(e,t){d(e._passes[0].framebuffer)&&e._shadowMapTexture.width===e._textureSize.x||(te(e),ae(e,t),se(e,t),ue(e,t))}function ue(e,t,i){i=h(i,0),(e._isPointLight||0===i)&&(e._clearCommand.framebuffer=e._passes[i].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function ce(t,i){t._size=i;var r=t._passes,n=r.length,o=t._textureSize;if(t._isPointLight){i=x.maximumCubeMapSize>=i?i:x.maximumCubeMapSize,o.x=i,o.y=i;var a=new e(0,0,i,i);r[0].passState.viewport=a,r[1].passState.viewport=a,r[2].passState.viewport=a,r[3].passState.viewport=a,r[4].passState.viewport=a,r[5].passState.viewport=a}else 1===n?(i=x.maximumTextureSize>=i?i:x.maximumTextureSize,o.x=i,o.y=i,r[0].passState.viewport=new e(0,0,i,i)):4===n&&(i=x.maximumTextureSize>=2*i?i:x.maximumTextureSize/2,o.x=2*i,o.y=2*i,r[0].passState.viewport=new e(0,0,i,i),r[1].passState.viewport=new e(i,0,i,i),r[2].passState.viewport=new e(0,i,i,i),r[3].passState.viewport=new e(i,i,i,i));t._clearPassState.viewport=new e(0,0,o.x,o.y);for(var s=0;s<n;++s){var l=r[s],u=l.passState.viewport,c=u.x/o.x,h=u.y/o.y,d=u.width/o.x,p=u.height/o.y;l.textureOffsets=new C(d,0,0,c,0,p,0,h,0,0,1,0,0,0,0,1)}}function he(e,t){var i;i=e._isPointLight?"uniform samplerCube shadowMap_textureCube; \nvarying vec2 v_textureCoordinates; \nvoid main() \n{ \n vec2 uv = v_textureCoordinates; \n vec3 dir; \n \n if (uv.y < 0.5) \n { \n if (uv.x < 0.333) \n { \n dir.x = -1.0; \n dir.y = uv.x * 6.0 - 1.0; \n dir.z = uv.y * 4.0 - 1.0; \n } \n else if (uv.x < 0.666) \n { \n dir.y = -1.0; \n dir.x = uv.x * 6.0 - 3.0; \n dir.z = uv.y * 4.0 - 1.0; \n } \n else \n { \n dir.z = -1.0; \n dir.x = uv.x * 6.0 - 5.0; \n dir.y = uv.y * 4.0 - 1.0; \n } \n } \n else \n { \n if (uv.x < 0.333) \n { \n dir.x = 1.0; \n dir.y = uv.x * 6.0 - 1.0; \n dir.z = uv.y * 4.0 - 3.0; \n } \n else if (uv.x < 0.666) \n { \n dir.y = 1.0; \n dir.x = uv.x * 6.0 - 3.0; \n dir.z = uv.y * 4.0 - 3.0; \n } \n else \n { \n dir.z = 1.0; \n dir.x = uv.x * 6.0 - 5.0; \n dir.y = uv.y * 4.0 - 3.0; \n } \n } \n \n float shadow = czm_unpackDepth(textureCube(shadowMap_textureCube, dir)); \n gl_FragColor = vec4(vec3(shadow), 1.0); \n} \n":"uniform sampler2D shadowMap_texture; \nvarying vec2 v_textureCoordinates; \nvoid main() \n{ \n"+(e._usesDepthTexture?" float shadow = texture2D(shadowMap_texture, v_textureCoordinates).r; \n":" float shadow = czm_unpackDepth(texture2D(shadowMap_texture, v_textureCoordinates)); \n")+" gl_FragColor = vec4(vec3(shadow), 1.0); \n} \n";var r=t.createViewportQuadCommand(i,{uniformMap:{shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture}}});return r.pass=M.OVERLAY,r}function de(t,i){var r=i.context,n=i.context.drawingBufferWidth,o=i.context.drawingBufferHeight,a=.3*Math.min(n,o),s=Ee;s.x=n-a,s.y=0,s.width=a,s.height=a;var l=t._debugShadowViewCommand;d(l)||(l=he(t,r),t._debugShadowViewCommand=l),d(l.renderState)&&e.equals(l.renderState.viewport,s)||(l.renderState=L.fromCache({viewport:e.clone(s)})),i.commandList.push(t._debugShadowViewCommand)}function pe(e,t){var r=new g({geometry:new i({minimum:new n(-.5,-.5,-.5),maximum:new n(.5,.5,.5)}),attributes:{color:u.fromColor(t)}}),o=new g({geometry:new E({radius:.5}),attributes:{color:u.fromColor(t)}});return new Z({geometryInstances:[r,o],appearance:new Y({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}function me(e,t){de(e,t);var i=e.debugFreezeFrame&&!e._debugFreezeFrame;if(e._debugFreezeFrame=e.debugFreezeFrame,e.debugFreezeFrame&&(i&&(e._debugCameraFrustum=e._debugCameraFrustum&&e._debugCameraFrustum.destroy(),e._debugCameraFrustum=new q({camera:e._sceneCamera,color:l.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){i&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new q({camera:e._shadowMapCamera,color:l.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t);for(var r=0;r<e._numberOfCascades;++r)i&&(e._debugCascadeFrustums[r]=e._debugCascadeFrustums[r]&&e._debugCascadeFrustums[r].destroy(),e._debugCascadeFrustums[r]=new q({camera:e._passes[r].camera,color:Pe[r],updateOnChange:!1})),e._debugCascadeFrustums[r].update(t)}}else if(e._isPointLight){if(!d(e._debugLightFrustum)||e._needsUpdate){var o=e._shadowMapCamera.positionWC,a=S.IDENTITY,s=2*e._pointLightRadius,u=n.fromElements(s,s,s,De),c=C.fromTranslationQuaternionRotationScale(o,a,u,Te);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=pe(c,l.YELLOW)}e._debugLightFrustum.update(t)}else d(e._debugLightFrustum)&&!e._needsUpdate||(e._debugLightFrustum=new q({camera:e._shadowMapCamera,color:l.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function fe(){this.viewMatrix=new C,this.inverseViewMatrix=new C,this.frustum=void 0,this.positionCartographic=new a,this.positionWC=new n,this.directionWC=n.clone(n.UNIT_Z),this.upWC=n.clone(n.UNIT_Y),this.rightWC=n.clone(n.UNIT_X),this.viewProjectionMatrix=new C}function _e(e,t){var i,r=e._shadowMapCamera,a=e._sceneCamera,s=a.frustum.near,l=a.frustum.far,u=e._numberOfCascades,c=l-s,h=l/s,d=.9,p=!1;t.shadowHints.closestObjectSize<200&&(p=!0,d=.9);var m=Oe,f=Ie;for(f[0]=s,f[u]=l,i=0;i<u;++i){var _=(i+1)/u,g=s*Math.pow(h,_),v=s+c*_,w=y.lerp(v,g,d);f[i+1]=w,m[i]=w-f[i]}if(p){for(i=0;i<u;++i)m[i]=Math.min(m[i],e._maximumCascadeDistances[i]);var S=f[0];for(i=0;i<u-1;++i)S+=m[i],f[i+1]=S}o.unpack(f,0,e._cascadeSplits[0]),o.unpack(f,1,e._cascadeSplits[1]),o.unpack(m,0,e._cascadeDistances);var E=r.frustum,b=E.left,T=E.right,x=E.bottom,A=E.top,P=E.near,D=E.far,M=r.positionWC,I=r.directionWC,R=r.upWC,O=a.frustum.clone(Re),N=r.getViewProjection();for(i=0;i<u;++i){O.near=f[i],O.far=f[i+1];for(var L=C.multiply(O.projectionMatrix,a.viewMatrix,Te),B=C.inverse(L,Te),F=C.multiply(N,B,Te),V=n.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Fe),k=n.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Ve),z=0;z<8;++z){var U=o.clone(be[z],xe[z]);C.multiplyByVector(F,U,U),n.divideByScalar(U,U.w,U),n.minimumByComponent(U,V,V),n.maximumByComponent(U,k,k)}V.x=Math.max(V.x,0),V.y=Math.max(V.y,0),V.z=0,k.x=Math.min(k.x,1),k.y=Math.min(k.y,1),k.z=Math.min(k.z,1);var G=e._passes[i],W=G.camera;W.clone(r);var H=W.frustum;H.left=b+V.x*(T-b),H.right=b+k.x*(T-b),H.bottom=x+V.y*(A-x),H.top=x+k.y*(A-x),H.near=P+V.z*(D-P),H.far=P+k.z*(D-P),G.cullingVolume=W.frustum.computeCullingVolume(M,I,R);var q=e._cascadeMatrices[i];C.multiply(W.getViewProjection(),a.inverseViewMatrix,q),C.multiply(G.textureOffsets,q,q)}}function ge(e,t){var i=e._shadowMapCamera,r=e._sceneCamera,a=C.multiply(r.frustum.projectionMatrix,r.viewMatrix,Te),s=C.inverse(a,Te),l=i.directionWC,u=r.directionWC,c=n.cross(l,u,Le);u=n.cross(c,l,Be),n.normalize(u,u),n.normalize(c,c);for(var h=n.fromElements(0,0,0,ke),d=C.computeView(h,l,u,c,Ne),p=C.multiply(d,s,Te),m=n.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Fe),f=n.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Ve),_=0;_<8;++_){var g=o.clone(be[_],xe[_]);C.multiplyByVector(p,g,g),n.divideByScalar(g,g.w,g),n.minimumByComponent(g,m,m),n.maximumByComponent(g,f,f)}f.z+=1e3,m.z-=10;var v=ke;v.x=-(.5*(m.x+f.x)),v.y=-(.5*(m.y+f.y)),v.z=-f.z;var y=C.fromTranslation(v,Te);d=C.multiply(y,d,d);var w=.5*(f.x-m.x),S=.5*(f.y-m.y),E=f.z-m.z,b=i.frustum;b.left=-w,b.right=w,b.bottom=-S,b.top=S,b.near=.01,b.far=E,C.clone(d,i.viewMatrix),C.inverse(d,i.inverseViewMatrix),C.getTranslation(i.inverseViewMatrix,i.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(i.positionWC,i.positionCartographic),n.clone(l,i.directionWC),n.clone(u,i.upWC),n.clone(c,i.rightWC)}function ve(e,t){var i=new X;i.fov=y.PI_OVER_TWO,i.near=1,i.far=e._pointLightRadius,i.aspectRatio=1;for(var r=0;r<6;++r){var n=e._passes[r].camera;n.positionWC=e._shadowMapCamera.positionWC,n.positionCartographic=t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),n.directionWC=ze[r],n.upWC=Ue[r],n.rightWC=Ge[r],C.computeView(n.positionWC,n.directionWC,n.upWC,n.rightWC,n.viewMatrix),C.inverse(n.viewMatrix,n.inverseViewMatrix),n.frustum=i}}function ye(e,i){var r=e._sceneCamera,o=e._shadowMapCamera,a=qe;if(e._cascadesEnabled){if(r.frustum.near>=e.maximumDistance)return e._outOfView=!0,void(e._needsUpdate=!1);var s=i.mapProjection.ellipsoid.geodeticSurfaceNormal(r.positionWC,We),l=n.negate(o.directionWC,He),u=n.dot(s,l),c=y.clamp(u/.1,0,1);if(e._darkness=y.lerp(1,e.darkness,c),u<0)return e._outOfView=!0,void(e._needsUpdate=!1);e._needsUpdate=!0,e._outOfView=!1}else if(e._isPointLight)a.center=o.positionWC,a.radius=e._pointLightRadius,e._outOfView=i.cullingVolume.computeVisibility(a)===v.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(a),t.clone(a,e._boundingSphere);else{var h=o.frustum.far/2,d=n.add(o.positionWC,n.multiplyByScalar(o.directionWC,h,je),je);a.center=d,a.radius=h,e._outOfView=i.cullingVolume.computeVisibility(a)===v.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(a),t.clone(a,e._boundingSphere)}}function Ce(e,t){var i=t.camera,r=e._lightCamera,o=e._sceneCamera,a=e._shadowMapCamera;e._cascadesEnabled?n.clone(r.directionWC,a.directionWC):e._isPointLight?n.clone(r.positionWC,a.positionWC):a.clone(r); +var s=e._lightDirectionEC;C.multiplyByPointAsVector(i.viewMatrix,a.directionWC,s),n.normalize(s,s),n.negate(s,s),C.multiplyByPoint(i.viewMatrix,a.positionWC,e._lightPositionEC),e._lightPositionEC.w=e._pointLightRadius;var l,u;e._fitNearFar?(l=Math.min(t.shadowHints.nearPlane,e.maximumDistance),u=Math.min(t.shadowHints.farPlane,e.maximumDistance+1)):(l=i.frustum.near,u=e.maximumDistance),e._sceneCamera=G.clone(i,o),i.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=l,e._sceneCamera.frustum.far=u,e._distance=u-l,ye(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}function we(e,t,i){var r=e._isPointLight?e._pointBias:i?e._terrainBias:e._primitiveBias,n={shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture},shadowMap_matrix:function(){return e._shadowMapMatrix},shadowMap_cascadeSplits:function(){return e._cascadeSplits},shadowMap_cascadeMatrices:function(){return e._cascadeMatrices},shadowMap_lightDirectionEC:function(){return e._lightDirectionEC},shadowMap_lightPositionEC:function(){return e._lightPositionEC},shadowMap_cascadeDistances:function(){return e._cascadeDistances},shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:function(){var t=Ye;return t.x=1/e._textureSize.x,t.y=1/e._textureSize.y,o.fromElements(t.x,t.y,r.depthBias,r.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return o.fromElements(r.normalOffsetScale,e._distance,e.maximumDistance,e._darkness,this.combinedUniforms2)},combinedUniforms1:new o,combinedUniforms2:new o};return c(t,n,!1)}function Se(e,t,i,r,n,o){var a,l,u;if(d(o)&&(a=o.shaderProgram,l=o.renderState,u=o.uniformMap),o=P.shallowClone(i,o),o.castShadows=!0,o.receiveShadows=!1,!d(a)||n!==i.shaderProgram.id||t){d(a)&&a.destroy();var c=i.shaderProgram,h=c.vertexShaderSource,p=c.fragmentShaderSource,m=i.pass===M.GLOBE,f=i.pass!==M.TRANSLUCENT,_=e._isPointLight,g=e._usesDepthTexture,v=K.createShadowCastVertexShader(h,_,m),y=K.createShadowCastFragmentShader(p,_,g,f);a=F.fromCache({context:r,vertexShaderSource:v,fragmentShaderSource:y,attributeLocations:c._attributeLocations}),l=e._primitiveRenderState,_?l=e._pointRenderState:m&&(l=e._terrainRenderState);var C=i.renderState.cull.enabled;C||(l=s(l,!1),l.cull.enabled=!1,l=L.fromCache(l)),u=we(e,i.uniformMap,m)}return o.shaderProgram=a,o.renderState=l,o.uniformMap=u,o}Q.MAXIMUM_DISTANCE=2e4,Q.prototype.debugCreateRenderStates=function(){ee(this)},p(Q.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this.dirty=this._enabled!==e,this._enabled=e}},normalOffset:{get:function(){return this._normalOffset},set:function(e){this.dirty=this._normalOffset!==e,this._normalOffset=e,this._terrainBias.normalOffset=e,this._primitiveBias.normalOffset=e,this._pointBias.normalOffset=e}},softShadows:{get:function(){return this._softShadows},set:function(e){this.dirty=this._softShadows!==e,this._softShadows=e}},size:{get:function(){return this._size},set:function(e){ce(this,e)}},outOfView:{get:function(){return this._outOfView}},shadowMapCullingVolume:{get:function(){return this._shadowMapCullingVolume}},passes:{get:function(){return this._passes}},isPointLight:{get:function(){return this._isPointLight}},debugCascadeColors:{get:function(){return this._debugCascadeColors},set:function(e){this.dirty=this._debugCascadeColors!==e,this._debugCascadeColors=e}}});var Ee=new e,be=new Array(8);be[0]=new o(-1,-1,-1,1),be[1]=new o(1,-1,-1,1),be[2]=new o(1,1,-1,1),be[3]=new o(-1,1,-1,1),be[4]=new o(-1,-1,1,1),be[5]=new o(1,-1,1,1),be[6]=new o(1,1,1,1),be[7]=new o(-1,1,1,1);for(var Te=new C,xe=new Array(8),Ae=0;Ae<8;++Ae)xe[Ae]=new o;var Pe=[l.RED,l.GREEN,l.BLUE,l.MAGENTA],De=new n;fe.prototype.clone=function(e){C.clone(e.viewMatrix,this.viewMatrix),C.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),a.clone(e.positionCartographic,this.positionCartographic),n.clone(e.positionWC,this.positionWC),n.clone(e.directionWC,this.directionWC),n.clone(e.upWC,this.upWC),n.clone(e.rightWC,this.rightWC)};var Me=new C(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);fe.prototype.getViewProjection=function(){var e=this.viewMatrix,t=this.frustum.projectionMatrix;return C.multiply(t,e,this.viewProjectionMatrix),C.multiply(Me,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var Ie=new Array(5),Re=new X,Oe=new Array(4),Ne=new C,Le=new n,Be=new n,Fe=new n,Ve=new n,ke=new n,ze=[new n(-1,0,0),new n(0,-1,0),new n(0,0,-1),new n(1,0,0),new n(0,1,0),new n(0,0,1)],Ue=[new n(0,-1,0),new n(0,0,-1),new n(0,-1,0),new n(0,-1,0),new n(0,0,1),new n(0,-1,0)],Ge=[new n(0,0,1),new n(1,0,0),new n(-1,0,0),new n(0,0,-1),new n(1,0,0),new n(1,0,0)],We=new n,He=new n,qe=new t,je=qe.center;Q.prototype.update=function(e){if(Ce(this,e),this._needsUpdate)if(le(this,e.context),this._isPointLight&&ve(this,e),this._cascadesEnabled&&(ge(this,e),this._numberOfCascades>1&&_e(this,e)),this._isPointLight)this._shadowMapCullingVolume=H.fromBoundingSphere(this._boundingSphere);else{var t=this._shadowMapCamera,i=t.positionWC,r=t.directionWC,n=t.upWC;this._shadowMapCullingVolume=t.frustum.computeCullingVolume(i,r,n),1===this._passes.length&&this._passes[0].camera.clone(t)}if(1===this._passes.length){var o=this._sceneCamera.inverseViewMatrix;C.multiply(this._shadowMapCamera.getViewProjection(),o,this._shadowMapMatrix)}this.debugShow&&me(this,e)},Q.prototype.updatePass=function(e,t){ue(this,e,t)};var Ye=new r;return Q.createDerivedCommands=function(e,t,i,r,n,o){d(o)||(o={});var a=t.length>0,s=i.shaderProgram,l=s.vertexShaderSource,u=s.fragmentShaderSource,c=i.pass===M.GLOBE,h=!1;if(c&&(h=i.owner.data.pickTerrain.mesh.encoding.hasVertexNormals),i.castShadows){var p=o.castCommands;d(p)||(p=o.castCommands=[]);var m=o.castShaderProgramId,f=e.length;p.length=f;for(var _=0;_<f;++_)p[_]=Se(e[_],r,i,n,m,p[_]);o.castShaderProgramId=i.shaderProgram.id}if(i.receiveShadows&&a){var g,v;d(o.receiveCommand)&&(g=o.receiveCommand.shaderProgram,v=o.receiveCommand.uniformMap),o.receiveCommand=P.shallowClone(i,o.receiveCommand),o.castShadows=!1,o.receiveShadows=!0;var y=o.receiveShaderCastShadows!==i.castShadows,C=o.receiveShaderProgramId!==i.shaderProgram.id;if(!d(g)||C||r||y){d(g)&&g.destroy();var w=K.createShadowReceiveVertexShader(l,c,h),S=K.createShadowReceiveFragmentShader(u,t[0],i.castShadows,c,h);g=F.fromCache({context:n,vertexShaderSource:w,fragmentShaderSource:S,attributeLocations:s._attributeLocations}),v=we(t[0],i.uniformMap,c)}o.receiveCommand.shaderProgram=g,o.receiveCommand.uniformMap=v,o.receiveShaderProgramId=i.shaderProgram.id,o.receiveShaderCastShadows=i.castShadows}return o},Q.prototype.isDestroyed=function(){return!1},Q.prototype.destroy=function(){te(this),this._debugLightFrustum=this._debugLightFrustum&&this._debugLightFrustum.destroy(),this._debugCameraFrustum=this._debugCameraFrustum&&this._debugCameraFrustum.destroy(),this._debugShadowViewCommand=this._debugShadowViewCommand&&this._debugShadowViewCommand.shaderProgram&&this._debugShadowViewCommand.shaderProgram.destroy();for(var e=0;e<this._numberOfCascades;++e)this._debugCascadeFrustums[e]=this._debugCascadeFrustums[e]&&this._debugCascadeFrustums[e].destroy();return m(this)},Q}),i("Shaders/PostProcessFilters/AdditiveBlend",[],function(){"use strict";return"uniform sampler2D u_texture0;\nuniform sampler2D u_texture1;\nuniform vec2 u_center;\nuniform float u_radius;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec4 color0 = texture2D(u_texture0, v_textureCoordinates);\nvec4 color1 = texture2D(u_texture1, v_textureCoordinates);\nfloat x = length(gl_FragCoord.xy - u_center) / u_radius;\nfloat t = smoothstep(0.5, 0.8, x);\ngl_FragColor = mix(color0 + color1, color0, t);\n}\n"}),i("Shaders/PostProcessFilters/BrightPass",[],function(){"use strict";return"uniform sampler2D u_texture;\nuniform float u_avgLuminance;\nuniform float u_threshold;\nuniform float u_offset;\nvarying vec2 v_textureCoordinates;\nfloat key(float avg)\n{\nfloat guess = 1.5 - (1.5 / (avg * 0.1 + 1.0));\nreturn max(0.0, guess) + 0.1;\n}\nvoid main()\n{\nvec4 color = texture2D(u_texture, v_textureCoordinates);\nvec3 xyz = czm_RGBToXYZ(color.rgb);\nfloat luminance = xyz.r;\nfloat scaledLum = key(u_avgLuminance) * luminance / u_avgLuminance;\nfloat brightLum = max(scaledLum - u_threshold, 0.0);\nfloat brightness = brightLum / (u_offset + brightLum);\nxyz.r = brightness;\ngl_FragColor = vec4(czm_XYZToRGB(xyz), 1.0);\n}\n"}),i("Shaders/PostProcessFilters/GaussianBlur1D",[],function(){"use strict";return"#define SAMPLES 8\nuniform float delta;\nuniform float sigma;\nuniform float direction;\nuniform sampler2D u_texture;\nuniform vec2 u_step;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec2 st = v_textureCoordinates;\nvec2 dir = vec2(1.0 - direction, direction);\nvec3 g;\ng.x = 1.0 / (sqrt(czm_twoPi) * sigma);\ng.y = exp((-0.5 * delta * delta) / (sigma * sigma));\ng.z = g.y * g.y;\nvec4 result = texture2D(u_texture, st) * g.x;\nfor (int i = 1; i < SAMPLES; ++i)\n{\ng.xy *= g.yz;\nvec2 offset = float(i) * dir * u_step;\nresult += texture2D(u_texture, st - offset) * g.x;\nresult += texture2D(u_texture, st + offset) * g.x;\n}\ngl_FragColor = result;\n}\n"}),i("Scene/SunPostProcess",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian4","../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/Math","../Core/Matrix4","../Core/PixelFormat","../Core/Transforms","../Renderer/ClearCommand","../Renderer/Framebuffer","../Renderer/PassState","../Renderer/PixelDatatype","../Renderer/Renderbuffer","../Renderer/RenderbufferFormat","../Renderer/RenderState","../Renderer/Texture","../Shaders/PostProcessFilters/AdditiveBlend","../Shaders/PostProcessFilters/BrightPass","../Shaders/PostProcessFilters/GaussianBlur1D","../Shaders/PostProcessFilters/PassThrough"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S){"use strict";function E(){this._fbo=void 0,this._downSampleFBO1=void 0,this._downSampleFBO2=void 0,this._clearFBO1Command=void 0,this._clearFBO2Command=void 0,this._downSampleCommand=void 0,this._brightPassCommand=void 0,this._blurXCommand=void 0,this._blurYCommand=void 0,this._blendCommand=void 0,this._fullScreenCommand=void 0,this._downSamplePassState=new p,this._downSamplePassState.scissorTest={enable:!0,rectangle:new e},this._upSamplePassState=new p,this._upSamplePassState.scissorTest={enabled:!0,rectangle:new e},this._uCenter=new t,this._uRadius=void 0,this._blurStep=new t}E.prototype.clear=function(e,t){var i=this._clearFBO1Command;r.clone(n(t,r.BLACK),i.color),i.execute(e),i=this._clearFBO2Command,r.clone(n(t,r.BLACK),i.color),i.execute(e)},E.prototype.execute=function(e,t){this._downSampleCommand.execute(e,this._downSamplePassState),this._brightPassCommand.execute(e,this._downSamplePassState),this._blurXCommand.execute(e,this._downSamplePassState),this._blurYCommand.execute(e,this._downSamplePassState),this._fullScreenCommand.framebuffer=t,this._blendCommand.framebuffer=t,this._fullScreenCommand.execute(e),this._blendCommand.execute(e,this._upSamplePassState)};var b=new e,T=new e,x=new i,A=new t,P=new t,D=new l;return E.prototype.update=function(e){var i=e.context,n=e.viewport,a=i.drawingBufferWidth,p=i.drawingBufferHeight,E=this;if(!o(this._downSampleCommand)){this._clearFBO1Command=new h({color:new r}),this._clearFBO2Command=new h({color:new r});var M={};this._downSampleCommand=i.createViewportQuadCommand(S,{uniformMap:M,owner:this}),M={u_avgLuminance:function(){return.5},u_threshold:function(){return.25},u_offset:function(){return.1}},this._brightPassCommand=i.createViewportQuadCommand(C,{uniformMap:M,owner:this});var I=1,R=2;M={delta:function(){return I},sigma:function(){return R},direction:function(){return 0}},this._blurXCommand=i.createViewportQuadCommand(w,{uniformMap:M,owner:this}),M={delta:function(){return I},sigma:function(){return R},direction:function(){return 1}},this._blurYCommand=i.createViewportQuadCommand(w,{uniformMap:M,owner:this}),M={u_center:function(){return E._uCenter},u_radius:function(){return E._uRadius}},this._blendCommand=i.createViewportQuadCommand(y,{uniformMap:M,owner:this}),M={},this._fullScreenCommand=i.createViewportQuadCommand(S,{uniformMap:M,owner:this})}var O=Math.pow(2,Math.ceil(Math.log(a)/Math.log(2))-2),N=Math.pow(2,Math.ceil(Math.log(p)/Math.log(2))-2),L=Math.max(1,O,N),B=T;B.width=L,B.height=L;var F=this._fbo,V=o(F)&&F.getColorTexture(0)||void 0;if(!o(V)||V.width!==a||V.height!==p){F=F&&F.destroy(),this._downSampleFBO1=this._downSampleFBO1&&this._downSampleFBO1.destroy(),this._downSampleFBO2=this._downSampleFBO2&&this._downSampleFBO2.destroy(),this._blurStep.x=this._blurStep.y=1/L;var k=[new v({context:i,width:a,height:p})];F=i.depthTexture?this._fbo=new d({context:i,colorTextures:k,depthTexture:new v({context:i,width:a,height:p,pixelFormat:u.DEPTH_COMPONENT,pixelDatatype:m.UNSIGNED_SHORT})}):this._fbo=new d({context:i,colorTextures:k,depthRenderbuffer:new f({context:i,format:_.DEPTH_COMPONENT16})}),this._downSampleFBO1=new d({context:i,colorTextures:[new v({context:i,width:L,height:L})]}),this._downSampleFBO2=new d({context:i,colorTextures:[new v({context:i,width:L,height:L})]}),this._clearFBO1Command.framebuffer=this._downSampleFBO1,this._clearFBO2Command.framebuffer=this._downSampleFBO2,this._downSampleCommand.framebuffer=this._downSampleFBO1,this._brightPassCommand.framebuffer=this._downSampleFBO2,this._blurXCommand.framebuffer=this._downSampleFBO1,this._blurYCommand.framebuffer=this._downSampleFBO2;var z=g.fromCache({viewport:B});this._downSampleCommand.uniformMap.u_texture=function(){return F.getColorTexture(0)},this._downSampleCommand.renderState=z,this._brightPassCommand.uniformMap.u_texture=function(){return E._downSampleFBO1.getColorTexture(0)},this._brightPassCommand.renderState=z,this._blurXCommand.uniformMap.u_texture=function(){return E._downSampleFBO2.getColorTexture(0)},this._blurXCommand.uniformMap.u_step=function(){return E._blurStep},this._blurXCommand.renderState=z,this._blurYCommand.uniformMap.u_texture=function(){return E._downSampleFBO1.getColorTexture(0)},this._blurYCommand.uniformMap.u_step=function(){return E._blurStep},this._blurYCommand.renderState=z;var U=b;U.width=a,U.height=p;var G=g.fromCache({viewport:U});this._blendCommand.uniformMap.u_texture0=function(){return F.getColorTexture(0)},this._blendCommand.uniformMap.u_texture1=function(){return E._downSampleFBO2.getColorTexture(0)},this._blendCommand.renderState=G,this._fullScreenCommand.uniformMap.u_texture=function(){return F.getColorTexture(0)},this._fullScreenCommand.renderState=G}var W=i.uniformState,H=W.sunPositionWC,q=W.view,j=W.viewProjection,Y=W.projection,X=l.computeViewportTransformation(n,0,1,D),Z=l.multiplyByPoint(q,H,x),K=c.pointToGLWindowCoordinates(j,X,H,A);Z.x+=s.SOLAR_RADIUS;var Q=c.pointToGLWindowCoordinates(Y,X,Z,Z),J=30*t.magnitude(t.subtract(Q,K,Q))*2,$=P;$.x=J,$.y=J;var ee=this._upSamplePassState.scissorTest.rectangle;return ee.x=Math.max(K.x-.5*$.x,0),ee.y=Math.max(K.y-.5*$.y,0),ee.width=Math.min($.x,a),ee.height=Math.min($.y,p),this._uCenter=t.clone(K,this._uCenter),this._uRadius=.5*Math.max($.x,$.y),X=l.computeViewportTransformation(B,0,1,D),K=c.pointToGLWindowCoordinates(j,X,H,A),$.x*=O/a,$.y*=N/p,ee=this._downSamplePassState.scissorTest.rectangle,ee.x=Math.max(K.x-.5*$.x,0),ee.y=Math.max(K.y-.5*$.y,0),ee.width=Math.min($.x,a),ee.height=Math.min($.y,p),this._downSamplePassState.context=i,this._upSamplePassState.context=i,this._fbo},E.prototype.isDestroyed=function(){return!1},E.prototype.destroy=function(){return this._fbo=this._fbo&&this._fbo.destroy(),this._downSampleFBO1=this._downSampleFBO1&&this._downSampleFBO1.destroy(),this._downSampleFBO2=this._downSampleFBO2&&this._downSampleFBO2.destroy(),this._downSampleCommand=this._downSampleCommand&&this._downSampleCommand.shaderProgram&&this._downSampleCommand.shaderProgram.destroy(),this._brightPassCommand=this._brightPassCommand&&this._brightPassCommand.shaderProgram&&this._brightPassCommand.shaderProgram.destroy(),this._blurXCommand=this._blurXCommand&&this._blurXCommand.shaderProgram&&this._blurXCommand.shaderProgram.destroy(),this._blurYCommand=this._blurYCommand&&this._blurYCommand.shaderProgram&&this._blurYCommand.shaderProgram.destroy(),this._blendCommand=this._blendCommand&&this._blendCommand.shaderProgram&&this._blendCommand.shaderProgram.destroy(),this._fullScreenCommand=this._fullScreenCommand&&this._fullScreenCommand.shaderProgram&&this._fullScreenCommand.shaderProgram.destroy(),a(this)},E}),i("Scene/Scene",["../Core/BoundingRectangle","../Core/BoundingSphere","../Core/BoxGeometry","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EllipsoidGeometry","../Core/Event","../Core/GeographicProjection","../Core/GeometryInstance","../Core/GeometryPipeline","../Core/getTimestamp","../Core/Intersect","../Core/Interval","../Core/JulianDate","../Core/Math","../Core/Matrix4","../Core/mergeSort","../Core/Occluder","../Core/ShowGeometryInstanceAttribute","../Core/Transforms","../Renderer/ClearCommand","../Renderer/ComputeEngine","../Renderer/Context","../Renderer/ContextLimits","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/PassState","../Renderer/ShaderProgram","../Renderer/ShaderSource","./Camera","./CreditDisplay","./CullingVolume","./DepthPlane","./DeviceOrientationCameraController","./Fog","./FrameState","./FrustumCommands","./FXAA","./GlobeDepth","./MapMode2D","./OIT","./OrthographicFrustum","./PerformanceDisplay","./PerInstanceColorAppearance","./PerspectiveFrustum","./PerspectiveOffCenterFrustum","./PickDepth","./Primitive","./PrimitiveCollection","./SceneMode","./SceneTransforms","./SceneTransitioner","./ScreenSpaceCameraController","./ShadowMap","./SunPostProcess","./TweenCollection"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I,R,O,N,L,B,F,V,k,z,U,G,W,H,q,j,Y,X,Z,K,Q,J,$,ee,te,ie,re,ne,oe,ae,se,le,ue,ce,he){"use strict";function de(t){t=c(t,c.EMPTY_OBJECT);var i=t.canvas,r=t.contextOptions,n=t.creditContainer,o=new R(i,r);h(n)||(n=document.createElement("div"),n.style.position="absolute",n.style.bottom="0",n.style["text-shadow"]="0 0 2px #000000",n.style.color="#ffffff",n.style["font-size"]="10px",n.style["padding-right"]="5px",i.parentNode.appendChild(n)),this._id=u(),this._frameState=new q(o,new z(n)),this._frameState.scene3DOnly=c(t.scene3DOnly,!1);var a=new B(o);a.viewport=new e,a.viewport.x=0,a.viewport.y=0,a.viewport.width=o.drawingBufferWidth,a.viewport.height=o.drawingBufferHeight,this._passState=a,this._canvas=i,this._context=o,this._computeEngine=new I(o),this._globe=void 0,this._primitives=new ne,this._groundPrimitives=new ne,this._tweens=new he,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._frustumCommandsList=[],this._overlayCommandList=[],this._pickFramebuffer=void 0,this._useOIT=c(t.orderIndependentTranslucency,!0),this._executeOITFunction=void 0;var l;o.depthTexture&&(l=new X);var d;this._useOIT&&h(l)&&(d=new K(o)),this._globeDepth=l,this._depthPlane=new G,this._oit=d,this._fxaa=new Y,this._clearColorCommand=new M({color:new s,stencil:0,owner:this}),this._depthClearCommand=new M({depth:1,owner:this}),this._stencilClearCommand=new M({stencil:0}),this._pickDepths=[],this._debugGlobeDepths=[],this._transitioner=new se(this),this._renderError=new _,this._preRender=new _,this._postRender=new _,this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new _,this.morphComplete=new _,this.skyBox=void 0,this.skyAtmosphere=void 0,this.sun=void 0,this.sunBloom=!0,this._sunBloom=void 0,this.moon=void 0,this.backgroundColor=s.clone(s.BLACK),this._mode=oe.SCENE3D,this._mapProjection=h(t.mapProjection)?t.mapProjection:new g,this.morphTime=1,this.farToNearRatio=1e3,this.nearToFarDistance2D=175e4,this.debugCommandFilter=void 0,this.debugShowCommands=!1,this.debugShowFrustums=!1,this._debugFrustumStatistics=void 0,this.debugShowFramesPerSecond=!1,this.debugShowGlobeDepth=!1,this.debugShowDepthFrustum=1,this.fxaa=!0,this.useDepthPicking=!0,this.cameraEventWaitTime=500,this.copyGlobeDepth=!1,this.fog=new H,this._sunCamera=new k(this),this.shadowMap=new ue({context:o,lightCamera:this._sunCamera,enabled:c(t.shadows,!1)}),this._terrainExaggeration=c(t.terrainExaggeration,1),this._performanceDisplay=void 0,this._debugVolume=void 0;var p=new k(this);this._camera=p,this._cameraClone=k.clone(p),this._screenSpaceCameraController=new le(this),this._mapMode2D=c(t.mapMode2D,Z.INFINITE_SCROLL),this._environmentState={skyBoxCommand:void 0,skyAtmosphereCommand:void 0,sunDrawCommand:void 0,sunComputeCommand:void 0,moonCommand:void 0,isSunVisible:!1,isMoonVisible:!1,isReadyForAtmosphere:!1,isSkyAtmosphereVisible:!1,clearGlobeDepth:!1,useDepthPlane:!1,originalFramebuffer:void 0,useGlobeDepthFramebuffer:!1,useOIT:!1,useFXAA:!1},this._useWebVR=!1,this._cameraVR=void 0,this._aspectRatioVR=void 0;var m=p.frustum.near,f=p.frustum.far,v=Math.ceil(Math.log(f/m)/Math.log(this.farToNearRatio));ye(m,f,this.farToNearRatio,v,this._frustumCommandsList,!1,void 0),ve(this,0,E.now()),this.initializeFrame()}function pe(e,t){var i=Math.max(Math.abs(e.x),Math.abs(t.x)),r=Math.max(Math.abs(e.y),Math.abs(t.y)),n=Math.max(Math.abs(e.z),Math.abs(t.z));return Math.max(Math.max(i,r),n)}function me(e,t,i){var r=1/Math.max(1,pe(e.position,t.position));return n.multiplyByScalar(e.position,r,Qe),n.multiplyByScalar(t.position,r,Je),n.equalsEpsilon(Qe,Je,i)&&n.equalsEpsilon(e.direction,t.direction,i)&&n.equalsEpsilon(e.up,t.up,i)&&n.equalsEpsilon(e.right,t.right,i)&&T.equalsEpsilon(e.transform,t.transform,i)}function fe(e,t){var i=e.frameState,r=e._context,n=i.shadowHints.shadowsEnabled,o=i.shadowHints.shadowMaps,a=i.shadowHints.lightShadowMaps,s=n&&a.length>0,l=!1,u=i.shadowHints.lastDirtyTime;if(t.lastDirtyTime!==u&&(t.lastDirtyTime=u,t.dirty=!0,l=!0),t.dirty){t.dirty=!1;var c=t.derivedCommands;n&&(t.receiveShadows||t.castShadows)&&(c.shadows=ue.createDerivedCommands(o,a,t,l,r,c.shadows));var d=e._oit;t.pass===L.TRANSLUCENT&&h(d)&&d.isSupported()&&(s&&t.receiveShadows?(c.oit=h(c.oit)?c.oit:{},c.oit.shadows=d.createDerivedCommands(t.derivedCommands.shadows.receiveCommand,r,c.oit.shadows)):c.oit=d.createDerivedCommands(t,r,c.oit))}}function _e(e){var t=e.globe;if(e._mode===oe.SCENE3D&&h(t)){var i=t.ellipsoid;return $e.radius=i.minimumRadius,Ke=A.fromBoundingSphere($e,e._camera.positionWC,Ke)}}function ge(e){e.render=!1,e.pick=!1}function ve(e,t,i){var r=e._camera,n=e._frameState;n.commandList.length=0,n.shadowMaps.length=0,n.mode=e._mode,n.morphTime=e.morphTime,n.mapProjection=e.mapProjection,n.frameNumber=t,n.time=E.clone(i,n.time),n.camera=r,n.cullingVolume=r.frustum.computeCullingVolume(r.positionWC,r.directionWC,r.upWC),n.occluder=_e(e),n.terrainExaggeration=e._terrainExaggeration,h(e.globe)?n.maximumScreenSpaceError=e.globe.maximumScreenSpaceError:n.maximumScreenSpaceError=2,ge(n.passes)}function ye(e,t,i,r,n,o,a){n.length=r;for(var s=0;s<r;++s){var l,u;o?(l=Math.min(t-a,e+s*a),u=Math.min(t,l+a)):(l=Math.max(e,Math.pow(i,s)*e),u=Math.min(t,i*l));var c=n[s];h(c)?(c.near=l,c.far=u):c=n[s]=new j(l,u)}}function Ce(e,t,i){e.debugShowFrustums&&(t.debugOverlappingFrustums=0),e.frameState.passes.pick||fe(e,t);for(var r=e._frustumCommandsList,n=r.length,o=0;o<n;++o){var a=r[o],s=a.near,l=a.far;if(!(i.start>l)){if(i.stop<s)break;var u=t instanceof M?L.OPAQUE:t.pass,c=a.indices[u]++;if(a.commands[u][c]=t,e.debugShowFrustums&&(t.debugOverlappingFrustums|=1<<o),t.executeInClosestFrustum)break}}if(e.debugShowFrustums){var d=e._debugFrustumStatistics.commandsInFrustums;d[t.debugOverlappingFrustums]=h(d[t.debugOverlappingFrustums])?d[t.debugOverlappingFrustums]+1:1,++e._debugFrustumStatistics.totalCommands}}function we(e,t,i){return h(e)&&(!h(e.boundingVolume)||!e.cull||t.computeVisibility(e.boundingVolume)!==w.OUTSIDE&&(!h(i)||!e.boundingVolume.isOccluded(i)))}function Se(e){var t=e._frameState,i=t.camera,r=i.directionWC,n=i.positionWC,o=e._computeCommandList,a=e._overlayCommandList,s=t.commandList;e.debugShowFrustums&&(e._debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});for(var l=e._frustumCommandsList,u=l.length,c=L.NUMBER_OF_PASSES,d=0;d<u;++d)for(var p=0;p<c;++p)l[d].indices[p]=0;o.length=0,a.length=0;for(var m=Number.MAX_VALUE,f=-Number.MAX_VALUE,_=!1,g=t.shadowHints.shadowsEnabled,v=Number.MAX_VALUE,y=-Number.MAX_VALUE,C=Number.MAX_VALUE,w=t.mode===oe.SCENE3D?t.occluder:void 0,S=t.cullingVolume,E=et.planes,b=0;b<5;++b)E[b]=S.planes[b];S=et;var T=e._environmentState;T.isSkyAtmosphereVisible=h(T.skyAtmosphereCommand)&&T.isReadyForAtmosphere,T.isSunVisible=we(T.sunDrawCommand,S,w),T.isMoonVisible=we(T.moonCommand,S,w);for(var x=s.length,A=0;A<x;++A){var P=s[A],D=P.pass;if(D===L.COMPUTE)o.push(P);else if(D===L.OVERLAY)a.push(P);else{var I=P.boundingVolume;if(h(I)){if(!we(P,S,w))continue;if(tt=I.computePlaneDistances(n,r,tt),m=Math.min(m,tt.start),f=Math.max(f,tt.stop),g&&P.receiveShadows&&tt.start<ue.MAXIMUM_DISTANCE&&!(D===L.GLOBE&&tt.start<-100&&tt.stop>100)){var R=tt.stop-tt.start;D!==L.GLOBE&&tt.start<100&&(C=Math.min(C,R)),v=Math.min(v,tt.start),y=Math.max(y,tt.stop)}}else tt.start=i.frustum.near,tt.stop=i.frustum.far,_=!(P instanceof M);Ce(e,P,tt)}}_?(m=i.frustum.near,f=i.frustum.far):(m=Math.min(Math.max(m,i.frustum.near),i.frustum.far),f=Math.max(Math.min(f,i.frustum.far),m),g&&(v=Math.min(Math.max(v,i.frustum.near),i.frustum.far),y=Math.max(Math.min(y,i.frustum.far),v))),g&&(t.shadowHints.nearPlane=v,t.shadowHints.farPlane=y,t.shadowHints.closestObjectSize=C);var O,N=e.mode===oe.SCENE2D,B=e.farToNearRatio;N?(f=Math.min(f,i.position.z+e.nearToFarDistance2D),m=Math.min(m,f),O=Math.ceil(Math.max(1,f-m)/e.nearToFarDistance2D)):O=Math.ceil(Math.log(f/m)/Math.log(B)),m!==Number.MAX_VALUE&&(O!==u||0!==l.length&&(m<l[0].near||f>l[u-1].far))&&(ye(m,f,B,O,l,N,e.nearToFarDistance2D),Se(e))}function Ee(e){var t={},i=e.vertexAttributes;for(var r in i)i.hasOwnProperty(r)&&(t[r]=i[r].index);return t}function be(e,t,i){var r=t.context,n=c(i,e.shaderProgram),o=n.fragmentShaderSource.clone(),a=[];o.sources=o.sources.map(function(e){e=V.replaceMain(e,"czm_Debug_main");for(var t,i=/gl_FragData\[(\d+)\]/g;null!==(t=i.exec(e));)a.indexOf(t[1])===-1&&a.push(t[1]);return e});var l,u=a.length,d="void main() \n{ \n czm_Debug_main(); \n";if(t.debugShowCommands){h(e._debugColor)||(e._debugColor=s.fromRandom());var p=e._debugColor;if(u>0)for(l=0;l<u;++l)d+=" gl_FragData["+a[l]+"].rgb *= vec3("+p.red+", "+p.green+", "+p.blue+"); \n";else d+=" gl_FragColor.rgb *= vec3("+p.red+", "+p.green+", "+p.blue+"); \n"}if(t.debugShowFrustums){var m=1&e.debugOverlappingFrustums?"1.0":"0.0",f=2&e.debugOverlappingFrustums?"1.0":"0.0",_=4&e.debugOverlappingFrustums?"1.0":"0.0";if(u>0)for(l=0;l<u;++l)d+=" gl_FragData["+a[l]+"].rgb *= vec3("+m+", "+f+", "+_+"); \n";else d+=" gl_FragColor.rgb *= vec3("+m+", "+f+", "+_+"); \n"}d+="}",o.sources.push(d);var g=Ee(n);return F.fromCache({context:r,vertexShaderSource:n.vertexShaderSource,fragmentShaderSource:o,attributeLocations:g})}function Te(e,t,i){var r=N.shallowClone(e);r.shaderProgram=be(e,t),r.execute(t.context,i),r.shaderProgram.destroy()}function xe(e,t,r,o,a){if(!h(t.debugCommandFilter)||t.debugCommandFilter(e)){var s=t.frameState.shadowHints.shadowsEnabled,u=s&&t.frameState.shadowHints.lightShadowMaps.length>0;if(t.debugShowCommands||t.debugShowFrustums?Te(e,t,o):u&&e.receiveShadows&&h(e.derivedCommands.shadows)?e.derivedCommands.shadows.receiveCommand.execute(r,o):e.execute(r,o),e.debugShowBoundingVolume&&h(e.boundingVolume)){var c=t._frameState,d=e.boundingVolume;h(t._debugVolume)&&t._debugVolume.destroy();var p,m=n.clone(d.center);if(c.mode!==oe.SCENE3D){m=T.multiplyByPoint(it,m,m);var _=c.mapProjection,g=_.unproject(m);m=_.ellipsoid.cartographicToCartesian(g)}if(h(d.radius)){var C=d.radius;p=y.toWireframe(f.createGeometry(new f({radii:new n(C,C,C),vertexFormat:$.FLAT_VERTEX_FORMAT}))),t._debugVolume=new re({geometryInstances:new v({geometry:p,modelMatrix:T.multiplyByTranslation(T.IDENTITY,m,new T),attributes:{color:new l(1,0,0,1)}}),appearance:new $({flat:!0,translucent:!1}),asynchronous:!1})}else{var w=d.halfAxes;p=y.toWireframe(i.createGeometry(i.fromDimensions({dimensions:new n(2,2,2),vertexFormat:$.FLAT_VERTEX_FORMAT}))),t._debugVolume=new re({geometryInstances:new v({geometry:p,modelMatrix:T.fromRotationTranslation(w,m,new T),attributes:{color:new l(1,0,0,1)}}),appearance:new $({flat:!0,translucent:!1}),asynchronous:!1})}var S=c.commandList,E=c.commandList=[];t._debugVolume.update(c);var b;h(a)&&(b=o.framebuffer,o.framebuffer=a),E[0].execute(r,o),h(b)&&(o.framebuffer=b),c.commandList=S}}}function Ae(e,t,i){return t.boundingVolume.distanceSquaredTo(i)-e.boundingVolume.distanceSquaredTo(i)}function Pe(e,t,i,r){var n=e.context;x(r,Ae,e._camera.positionWC);for(var o=r.length,a=0;a<o;++a)t(r[a],e,n,i)}function De(e,t){var i=e._debugGlobeDepths[t];return!h(i)&&e.context.depthTexture&&(i=new X,e._debugGlobeDepths[t]=i),i}function Me(e,t){var i=e._pickDepths[t];return h(i)||(i=new ie,e._pickDepths[t]=i),i}function Ie(e,t,i){var r=e._camera,n=e.context,o=n.uniformState;o.updateCamera(r);var a;a=h(r.frustum.fov)?r.frustum.clone(rt):h(r.frustum.infiniteProjectionMatrix)?r.frustum.clone(nt):r.frustum.clone(ot),a.near=r.frustum.near,a.far=r.frustum.far,o.updateFrustum(a),o.updatePass(L.ENVIRONMENT);var s=e._useWebVR&&e.mode!==oe.SCENE2D,l=e._environmentState;if(!i){var u=l.skyBoxCommand;if(h(u)&&xe(u,e,n,t),l.isSkyAtmosphereVisible&&xe(l.skyAtmosphereCommand,e,n,t),l.isSunVisible&&(l.sunDrawCommand.execute(n,t),e.sunBloom&&!s)){var c;c=l.useGlobeDepthFramebuffer?e._globeDepth.framebuffer:l.useFXAA?e._fxaa.getColorFramebuffer():l.originalFramebuffer,e._sunPostProcess.execute(n,c),t.framebuffer=c}l.isMoonVisible&&l.moonCommand.execute(n,t)}var d;l.useOIT?(h(e._executeOITFunction)||(e._executeOITFunction=function(e,t,i,r){e._oit.executeCommands(e,t,i,r)}),d=e._executeOITFunction):d=Pe;for(var p,m=l.clearGlobeDepth,f=l.useDepthPlane,_=e._depthClearCommand,g=e._depthPlane,v=r.position.z,y=e._frustumCommandsList,C=y.length,w=0;w<C;++w){var S=C-w-1,E=y[S];e.mode===oe.SCENE2D?(r.position.z=v-E.near+1,a.far=Math.max(1,E.far-E.near),a.near=1,o.update(e.frameState),o.updateFrustum(a)):(a.near=0!==S?E.near*Ze:E.near,a.far=E.far,o.updateFrustum(a));var b,T=e.debugShowGlobeDepth?De(e,S):e._globeDepth;e.debugShowGlobeDepth&&h(T)&&l.useGlobeDepthFramebuffer&&(b=t.framebuffer,t.framebuffer=T.framebuffer),_.execute(n,t),o.updatePass(L.GLOBE);var x=E.commands[L.GLOBE],A=E.indices[L.GLOBE];for(p=0;p<A;++p)xe(x[p],e,n,t);for(h(T)&&l.useGlobeDepthFramebuffer&&(e.copyGlobeDepth||e.debugShowGlobeDepth)&&(T.update(n),T.executeCopyDepth(n,t)),e.debugShowGlobeDepth&&h(T)&&l.useGlobeDepthFramebuffer&&(t.framebuffer=b),o.updatePass(L.GROUND),x=E.commands[L.GROUND],A=E.indices[L.GROUND],p=0;p<A;++p)xe(x[p],e,n,t);A>0&&n.stencilBuffer&&e._stencilClearCommand.execute(n,t),m&&(_.execute(n,t),f&&g.execute(n,t));for(var P=L.GROUND+1,D=L.TRANSLUCENT,M=P;M<D;++M)for(o.updatePass(M),x=E.commands[M],A=E.indices[M],p=0;p<A;++p)xe(x[p],e,n,t);if(0!==S&&e.mode!==oe.SCENE2D&&(a.near=E.near,o.updateFrustum(a)),o.updatePass(L.TRANSLUCENT),x=E.commands[L.TRANSLUCENT],x.length=E.indices[L.TRANSLUCENT],d(e,xe,t,x),h(T)&&l.useGlobeDepthFramebuffer&&e.useDepthPicking){var I=Me(e,S);I.update(n,T.framebuffer.depthStencilTexture),I.executeCopyDepth(n,t)}}}function Re(e){var t=e.context.uniformState;t.updatePass(L.COMPUTE);var i=e._environmentState.sunComputeCommand;h(i)&&i.execute(e._computeEngine);for(var r=e._computeCommandList,n=r.length,o=0;o<n;++o)r[o].execute(e._computeEngine); +}function Oe(e,t){var i=e.context.uniformState;i.updatePass(L.OVERLAY);for(var r=e.context,n=e._overlayCommandList,o=n.length,a=0;a<o;++a)n[a].execute(r,t)}function Ne(e,t,i){for(var r=i.shadowMapCullingVolume,n=i.isPointLight,o=i.passes,a=o.length,s=t.length,l=0;l<s;++l){var u=t[l];if(fe(e,u),u.castShadows&&(u.pass===L.GLOBE||u.pass===L.OPAQUE||u.pass===L.TRANSLUCENT)&&we(u,r))if(n)for(var c=0;c<a;++c)o[c].commandList.push(u);else if(1===a)o[0].commandList.push(u);else for(var h=!1,d=a-1;d>=0;--d){var p=o[d].cullingVolume;if(we(u,p))o[d].commandList.push(u),h=!0;else if(h)break}}}function Le(e){var t=e.frameState,i=t.shadowHints.shadowMaps,r=i.length;if(t.shadowHints.shadowsEnabled)for(var n=e.context,o=n.uniformState,a=0;a<r;++a){var s=i[a];if(!s.outOfView){var l,u=s.passes,c=u.length;for(l=0;l<c;++l)u[l].commandList.length=0;var h=e.frameState.commandList;for(Ne(e,h,s),l=0;l<c;++l){var d=s.passes[l];o.updateCamera(d.camera),s.updatePass(n,l);for(var p=d.commandList.length,m=0;m<p;++m){var f=d.commandList[m];o.updatePass(f.pass),xe(f.derivedCommands.shadows.castCommands[a],e,n,d.passState)}}}}}function Be(e,t,i,r){var o=e._context,a=t.viewport,s=e._frameState,l=s.camera,u=s.mode;if(e._useWebVR&&u!==oe.SCENE2D){Ue(e),Se(e),Ge(e,t,i,r),Re(e),Le(e),a.x=0,a.y=0,a.width=.5*o.drawingBufferWidth,a.height=o.drawingBufferHeight;var c=k.clone(l,e._cameraVR),h=l.frustum.near,d=5*h,p=d/30,m=n.multiplyByScalar(c.right,.5*p,pt);l.frustum.aspectRatio=a.width/a.height;var f=.5*p*h/d;n.add(c.position,m,l.position),l.frustum.xOffset=f,Ie(e,t,r),a.x=t.viewport.width,n.subtract(c.position,m,l.position),l.frustum.xOffset=-f,Ie(e,t,r),k.clone(c,l)}else a.x=0,a.y=0,a.width=o.drawingBufferWidth,a.height=o.drawingBufferHeight,u!==oe.SCENE2D||e._mapMode2D===Z.ROTATE?Ve(!0,e,t,i,r):Fe(e,t,i,r)}function Fe(e,t,i,r){var o=e.context,a=e.frameState,s=e.camera,l=t.viewport,u=at,c=st,h=e.mapProjection;h.project(u,c);var d=n.clone(s.position,lt),p=T.clone(s.transform,ct),m=s.frustum.clone();s._setTransform(T.IDENTITY);var f=T.computeViewportTransformation(l,0,1,ut),_=s.frustum.projectionMatrix,g=s.positionWC.y,v=n.fromElements(b.sign(g)*c.x-g,0,-s.positionWC.x,ht),y=D.pointToGLWindowCoordinates(_,f,v,dt);y.x=Math.floor(y.x);var C=l.x,w=l.width;if(0===g||y.x<=0||y.x>=o.drawingBufferWidth)Ve(!0,e,t,i,r);else if(Math.abs(.5*o.drawingBufferWidth-y.x)<1)l.width=y.x,s.position.x*=b.sign(s.position.x),s.frustum.right=0,a.cullingVolume=s.frustum.computeCullingVolume(s.positionWC,s.directionWC,s.upWC),o.uniformState.update(a),Ve(!0,e,t,i,r),l.x=l.width,s.position.x=-s.position.x,s.frustum.right=-s.frustum.left,s.frustum.left=0,a.cullingVolume=s.frustum.computeCullingVolume(s.positionWC,s.directionWC,s.upWC),o.uniformState.update(a),Ve(!1,e,t,i,r);else if(y.x>.5*o.drawingBufferWidth){l.width=y.x;var S=s.frustum.right;s.frustum.right=c.x-g,a.cullingVolume=s.frustum.computeCullingVolume(s.positionWC,s.directionWC,s.upWC),o.uniformState.update(a),Ve(!0,e,t,i,r),l.x+=y.x,l.width=o.drawingBufferWidth-y.x,s.position.x=-s.position.x,s.frustum.left=-s.frustum.right,s.frustum.right=S-2*s.frustum.right,a.cullingVolume=s.frustum.computeCullingVolume(s.positionWC,s.directionWC,s.upWC),o.uniformState.update(a),Ve(!1,e,t,i,r)}else{l.x=y.x,l.width=o.drawingBufferWidth-y.x;var E=s.frustum.left;s.frustum.left=-c.x-g,a.cullingVolume=s.frustum.computeCullingVolume(s.positionWC,s.directionWC,s.upWC),o.uniformState.update(a),Ve(!0,e,t,i,r),l.x=0,l.width=y.x,s.position.x=-s.position.x,s.frustum.right=-s.frustum.left,s.frustum.left=E-2*s.frustum.left,a.cullingVolume=s.frustum.computeCullingVolume(s.positionWC,s.directionWC,s.upWC),o.uniformState.update(a),Ve(!1,e,t,i,r)}s._setTransform(p),n.clone(d,s.position),s.frustum=m.clone(),l.x=C,l.width=w}function Ve(e,t,i,r,n){e||(t.frameState.commandList.length=0),Ue(t),Se(t),e&&(Ge(t,i,r,n),Re(t),Le(t)),Ie(t,i,n)}function ke(e){var t=e._frameState,i=e._environmentState,r=t.passes.render;i.skyBoxCommand=r&&h(e.skyBox)?e.skyBox.update(t):void 0;var n=e.skyAtmosphere,o=e.globe;h(n)&&h(o)&&(n.setDynamicAtmosphereColor(o.enableLighting),i.isReadyForAtmosphere=i.isReadyForAtmosphere||o._surface._tilesToRender.length>0),i.skyAtmosphereCommand=r&&h(n)?n.update(t):void 0;var a=r&&h(e.sun)?e.sun.update(e):void 0;i.sunDrawCommand=h(a)?a.drawCommand:void 0,i.sunComputeCommand=h(a)?a.computeCommand:void 0,i.moonCommand=r&&h(e.moon)?e.moon.update(t):void 0;var s=i.clearGlobeDepth=h(o)&&(!o.depthTestAgainstTerrain||e.mode===oe.SCENE2D),l=i.useDepthPlane=s&&e.mode===oe.SCENE3D;l&&e._depthPlane.update(t)}function ze(e){var t=e._frameState,i=t.shadowMaps,r=i.length,n=r>0&&!t.passes.pick&&e.mode===oe.SCENE3D;if(n!==t.shadowHints.shadowsEnabled&&(++t.shadowHints.lastDirtyTime,t.shadowHints.shadowsEnabled=n),n){for(var o=0;o<r;++o)if(i[o]!==t.shadowHints.shadowMaps[o]){++t.shadowHints.lastDirtyTime;break}t.shadowHints.shadowMaps.length=0,t.shadowHints.lightShadowMaps.length=0;for(var a=0;a<r;++a){var s=i[a];s.update(t),t.shadowHints.shadowMaps.push(s),s.fromLightSource&&t.shadowHints.lightShadowMaps.push(s),s.dirty&&(++t.shadowHints.lastDirtyTime,s.dirty=!1)}}}function Ue(e){var t=e._frameState;e._groundPrimitives.update(t),e._primitives.update(t),ze(e),e._globe&&e._globe.update(t)}function Ge(e,t,i,r){var n=e._context,o=e._environmentState,a=e._useWebVR&&e.mode!==oe.SCENE2D;o.originalFramebuffer=t.framebuffer,h(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!a?e._sunPostProcess=new ce:h(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy()),e._sunBloom=e.sunBloom):!h(e.sun)&&h(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy(),e._sunBloom=!1);var l=e._clearColorCommand;s.clone(i,l.color),l.execute(n,t);var u=o.useGlobeDepthFramebuffer=!r&&h(e._globeDepth);u&&(e._globeDepth.update(n),e._globeDepth.clear(n,t,i));for(var c=!1,d=e._frustumCommandsList,p=d.length,m=0;m<p;++m)if(d[m].indices[L.TRANSLUCENT]>0){c=!0;break}var f=o.useOIT=!r&&c&&h(e._oit)&&e._oit.isSupported();f&&(e._oit.update(n,e._globeDepth.framebuffer),e._oit.clear(n,t,i),o.useOIT=e._oit.isSupported());var _=o.useFXAA=!r&&e.fxaa;_&&(e._fxaa.update(n),e._fxaa.clear(n,t,i)),o.isSunVisible&&e.sunBloom&&!a?t.framebuffer=e._sunPostProcess.update(t):u?t.framebuffer=e._globeDepth.framebuffer:_&&(t.framebuffer=e._fxaa.getColorFramebuffer()),h(t.framebuffer)&&l.execute(n,t)}function We(e,t){var i=e._context,r=e._environmentState,n=r.useGlobeDepthFramebuffer;if(e.debugShowGlobeDepth&&n){var o=De(e,e.debugShowDepthFrustum-1);o.executeDebugGlobeDepth(i,t)}if(e.debugShowPickDepth&&n){var a=Me(e,e.debugShowDepthFrustum-1);a.executeDebugPickDepth(i,t)}var s=r.useOIT,l=r.useFXAA;s&&(t.framebuffer=l?e._fxaa.getColorFramebuffer():void 0,e._oit.execute(i,t)),l&&(!s&&n&&(t.framebuffer=e._fxaa.getColorFramebuffer(),e._globeDepth.executeCopyColor(i,t)),t.framebuffer=r.originalFramebuffer,e._fxaa.execute(i,t)),s||l||!n||(t.framebuffer=r.originalFramebuffer,e._globeDepth.executeCopyColor(i,t))}function He(e){for(var t=e.afterRender,i=0,r=t.length;i<r;++i)t[i]();t.length=0}function qe(e,t){h(t)||(t=E.now());var i=e._camera;me(i,e._cameraClone,b.EPSILON6)?e._cameraStartFired&&C()-e._cameraMovedTime>e.cameraEventWaitTime&&(i.moveEnd.raiseEvent(),e._cameraStartFired=!1):(e._cameraStartFired||(i.moveStart.raiseEvent(),e._cameraStartFired=!0),e._cameraMovedTime=C(),k.clone(i,e._cameraClone)),e._preRender.raiseEvent(e,t);var r=e.context,o=r.uniformState,a=e._frameState,l=b.incrementWrap(a.frameNumber,15e6,1);ve(e,l,t),a.passes.render=!0,a.creditDisplay.beginFrame(),e.fog.update(a),o.update(a);var u=e.shadowMap;h(u)&&u.enabled&&(n.negate(o.sunDirectionWC,e._sunCamera.direction),a.shadowMaps.push(u)),e._computeCommandList.length=0,e._overlayCommandList.length=0;var d=e._passState;if(d.framebuffer=void 0,d.blendingEnabled=void 0,d.scissorTest=void 0,h(e.globe)&&e.globe.beginFrame(a),ke(e),Be(e,d,c(e.backgroundColor,s.BLACK)),We(e,d),Oe(e,d),h(e.globe)&&e.globe.endFrame(a),a.creditDisplay.endFrame(),e.debugShowFramesPerSecond){if(!h(e._performanceDisplay)){var p=document.createElement("div");p.className="cesium-performanceDisplay-defaultContainer";var m=e._canvas.parentNode;m.appendChild(p);var f=new J({container:p});e._performanceDisplay=f,e._performanceContainer=p}e._performanceDisplay.update()}else h(e._performanceDisplay)&&(e._performanceDisplay=e._performanceDisplay&&e._performanceDisplay.destroy(),e._performanceContainer.parentNode.removeChild(e._performanceContainer));r.endFrame(),He(a),e._postRender.raiseEvent(e,t)}function je(e,t,i,r){var o=e._camera,a=o.frustum,s=e._passState.viewport,l=2*(t.x-s.x)/s.width-1;l*=.5*(a.right-a.left);var u=2*(s.height-t.y-s.y)/s.height-1;u*=.5*(a.top-a.bottom);var c=T.clone(o.transform,vt);o._setTransform(T.IDENTITY);var h=n.clone(o.position,ft);n.multiplyByScalar(o.right,l,_t),n.add(_t,h,h),n.multiplyByScalar(o.up,u,_t),n.add(_t,h,h),o._setTransform(c),n.fromElements(h.z,h.x,h.y,h);var d=a.getPixelDimensions(s.width,s.height,1,gt),p=mt;return p.right=.5*d.x,p.left=-p.right,p.top=.5*d.y,p.bottom=-p.top,p.near=a.near,p.far=a.far,p.computeCullingVolume(h,o.directionWC,o.upWC)}function Ye(e,t,i,r){var n=e._camera,o=n.frustum,a=o.near,s=Math.tan(.5*o.fovy),l=o.aspectRatio*s,u=e._passState.viewport,c=2*(t.x-u.x)/u.width-1,h=2*(u.height-t.y-u.y)/u.height-1,d=c*a*l,p=h*a*s,m=o.getPixelDimensions(u.width,u.height,1,gt),f=m.x*i*.5,_=m.y*r*.5,g=yt;return g.top=p+_,g.bottom=p-_,g.right=d+f,g.left=d-f,g.near=a,g.far=o.far,g.computeCullingVolume(n.positionWC,n.directionWC,n.upWC)}function Xe(e,t,i,r){return e._mode===oe.SCENE2D?je(e,t,i,r):Ye(e,t,i,r)}var Ze=.99;d(de.prototype,{canvas:{get:function(){return this._canvas}},drawingBufferHeight:{get:function(){return this._context.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._context.drawingBufferWidth}},maximumAliasedLineWidth:{get:function(){return O.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return O.maximumCubeMapSize}},pickPositionSupported:{get:function(){return this._context.depthTexture}},globe:{get:function(){return this._globe},set:function(e){this._globe=this._globe&&this._globe.destroy(),this._globe=e}},primitives:{get:function(){return this._primitives}},groundPrimitives:{get:function(){return this._groundPrimitives}},camera:{get:function(){return this._camera}},screenSpaceCameraController:{get:function(){return this._screenSpaceCameraController}},mapProjection:{get:function(){return this._mapProjection}},frameState:{get:function(){return this._frameState}},tweens:{get:function(){return this._tweens}},imageryLayers:{get:function(){return this.globe.imageryLayers}},terrainProvider:{get:function(){return this.globe.terrainProvider},set:function(e){this.globe.terrainProvider=e}},terrainProviderChanged:{get:function(){return this.globe.terrainProviderChanged}},renderError:{get:function(){return this._renderError}},preRender:{get:function(){return this._preRender}},postRender:{get:function(){return this._postRender}},context:{get:function(){return this._context}},debugFrustumStatistics:{get:function(){return this._debugFrustumStatistics}},scene3DOnly:{get:function(){return this._frameState.scene3DOnly}},orderIndependentTranslucency:{get:function(){return h(this._oit)}},id:{get:function(){return this._id}},mode:{get:function(){return this._mode},set:function(e){e===oe.SCENE2D?this.morphTo2D(0):e===oe.SCENE3D?this.morphTo3D(0):e===oe.COLUMBUS_VIEW&&this.morphToColumbusView(0),this._mode=e}},numberOfFrustums:{get:function(){return this._frustumCommandsList.length}},terrainExaggeration:{get:function(){return this._terrainExaggeration}},useWebVR:{get:function(){return this._useWebVR},set:function(e){this._useWebVR=e,this._useWebVR?(this._frameState.creditDisplay.container.style.visibility="hidden",this._cameraVR=new k(this),h(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new W(this)),this._aspectRatioVR=this._camera.frustum.aspectRatio):(this._frameState.creditDisplay.container.style.visibility="visible",this._cameraVR=void 0,this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this._camera.frustum.aspectRatio=this._aspectRatioVR,this._camera.frustum.xOffset=0)}},mapMode2D:{get:function(){return this._mapMode2D}},imagerySplitPosition:{get:function(){return this._frameState.imagerySplitPosition},set:function(e){this._frameState.imagerySplitPosition=e}}});var Ke,Qe=new n,Je=new n,$e=new t,et=new U,tt=new S,it=new T(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);it=T.inverseTransformation(it,it);var rt=new ee,nt=new te,ot=new Q,at=new a(Math.PI,b.PI_OVER_TWO),st=new n,lt=new n,ut=new T,ct=new T,ht=new n,dt=new n;de.prototype.initializeFrame=function(){120===this._shaderFrameCount++&&(this._shaderFrameCount=0,this._context.shaderCache.destroyReleasedShaderPrograms()),this._tweens.update(),this._screenSpaceCameraController.update(),h(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this._camera.update(this._mode),this._camera._updateCameraChanged()};var pt=new n;de.prototype.render=function(e){try{qe(this,e)}catch(e){if(this._renderError.raiseEvent(this,e),this.rethrowRenderErrors)throw e}},de.prototype.clampLineWidth=function(e){return Math.max(O.minimumAliasedLineWidth,Math.min(e,O.maximumAliasedLineWidth))};var mt=new Q,ft=new n,_t=new n,gt=new r,vt=new T,yt=new te,Ct=3,wt=3,St=new e(0,0,Ct,wt),Et=new s(0,0,0,0),bt=new r;de.prototype.pick=function(e){var t=this._context,i=t.uniformState,r=this._frameState,n=ae.transformWindowToDrawingBuffer(this,e,bt);h(this._pickFramebuffer)||(this._pickFramebuffer=t.createPickFramebuffer()),ve(this,r.frameNumber,r.time),r.cullingVolume=Xe(this,n,Ct,wt),r.passes.pick=!0,i.update(r),St.x=n.x-.5*(Ct-1),St.y=this.drawingBufferHeight-n.y-.5*(wt-1);var o=this._pickFramebuffer.begin(St);Be(this,o,Et,!0),We(this,o);var a=this._pickFramebuffer.end(St);return t.endFrame(),He(r),a};var Tt=new o,xt=new o(1,1/255,1/65025,1/16581375);return de.prototype.pickPosition=function(e,t){if(this.useDepthPicking){var i=this._context,r=i.uniformState,n=ae.transformWindowToDrawingBuffer(this,e,bt);n.y=this.drawingBufferHeight-n.y;var a,s=this._camera;h(s.frustum.fov)?a=s.frustum.clone(rt):h(s.frustum.infiniteProjectionMatrix)&&(a=s.frustum.clone(nt));for(var l=this.numberOfFrustums,u=0;u<l;++u){var c=Me(this,u),d=i.readPixels({x:n.x,y:n.y,width:1,height:1,framebuffer:c.framebuffer}),p=o.unpack(d,0,Tt);o.divideByScalar(p,255,p);var m=o.dot(p,xt);if(m>0&&m<1){var f=this._frustumCommandsList[u];return a.near=f.near*(0!==u?Ze:1),a.far=f.far,r.updateFrustum(a),ae.drawingBufferToWgs84Coordinates(this,n,m,t)}}}},de.prototype.drillPick=function(e,t){var i,r,n=[],o=[],a=[];h(t)||(t=Number.MAX_VALUE);for(var s=this.pick(e);h(s)&&h(s.primitive)&&(n.push(s),!(0>=--t));){var l=s.primitive,u=!1;"function"==typeof l.getGeometryInstanceAttributes&&h(s.id)&&(r=l.getGeometryInstanceAttributes(s.id),h(r)&&h(r.show)&&(u=!0,r.show=P.toValue(!1,r.show),a.push(r))),u||(l.show=!1,o.push(l)),s=this.pick(e)}for(i=0;i<o.length;++i)o[i].show=!0;for(i=0;i<a.length;++i)r=a[i],r.show=P.toValue(!0,r.show);return n},de.prototype.completeMorph=function(){this._transitioner.completeMorph()},de.prototype.morphTo2D=function(e){var t,i=this.globe;t=h(i)?i.ellipsoid:this.mapProjection.ellipsoid,e=c(e,2),this._transitioner.morphTo2D(e,t)},de.prototype.morphToColumbusView=function(e){var t,i=this.globe;t=h(i)?i.ellipsoid:this.mapProjection.ellipsoid,e=c(e,2),this._transitioner.morphToColumbusView(e,t)},de.prototype.morphTo3D=function(e){var t,i=this.globe;t=h(i)?i.ellipsoid:this.mapProjection.ellipsoid,e=c(e,2),this._transitioner.morphTo3D(e,t)},de.prototype.isDestroyed=function(){return!1},de.prototype.destroy=function(){return this._tweens.removeAll(),this._computeEngine=this._computeEngine&&this._computeEngine.destroy(),this._screenSpaceCameraController=this._screenSpaceCameraController&&this._screenSpaceCameraController.destroy(),this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this._pickFramebuffer=this._pickFramebuffer&&this._pickFramebuffer.destroy(),this._primitives=this._primitives&&this._primitives.destroy(),this._groundPrimitives=this._groundPrimitives&&this._groundPrimitives.destroy(),this._globe=this._globe&&this._globe.destroy(),this.skyBox=this.skyBox&&this.skyBox.destroy(),this.skyAtmosphere=this.skyAtmosphere&&this.skyAtmosphere.destroy(),this._debugSphere=this._debugSphere&&this._debugSphere.destroy(),this.sun=this.sun&&this.sun.destroy(),this._sunPostProcess=this._sunPostProcess&&this._sunPostProcess.destroy(),this._depthPlane=this._depthPlane&&this._depthPlane.destroy(),this._transitioner.destroy(),h(this._globeDepth)&&this._globeDepth.destroy(),h(this._oit)&&this._oit.destroy(),this._fxaa.destroy(),this._context=this._context&&this._context.destroy(),this._frameState.creditDisplay.destroy(),h(this._performanceDisplay)&&(this._performanceDisplay=this._performanceDisplay&&this._performanceDisplay.destroy(),this._performanceContainer.parentNode.removeChild(this._performanceContainer)),p(this)},de}),i("Scene/SingleTileImageryProvider",["../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/GeographicTilingScheme","../Core/loadImage","../Core/Rectangle","../Core/RuntimeError","../Core/TileProviderError","../ThirdParty/when"],function(e,t,i,r,n,o,a,s,l,u,c,h){"use strict";function d(r){function n(e){w._image=e,w._tileWidth=e.width,w._tileHeight=e.height,w._ready=!0,w._readyPromise.resolve(!0),c.handleSuccess(w._errorEvent)}function d(e){var t="Failed to load image "+v+".";C=c.handleError(C,w,w._errorEvent,t,0,0,0,p,e),w._readyPromise.reject(new u(t))}function p(){h(s(v),n,d)}r=t(r,{});var m=r.url;this._url=m;var f=r.proxy;this._proxy=f;var _=t(r.rectangle,l.MAX_VALUE),g=new a({rectangle:_,numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:r.ellipsoid});this._tilingScheme=g,this._image=void 0,this._texture=void 0,this._tileWidth=0,this._tileHeight=0,this._errorEvent=new o,this._ready=!1,this._readyPromise=h.defer();var v=m;i(f)&&(v=f.getURL(v));var y=r.credit;"string"==typeof y&&(y=new e(y)),this._credit=y;var C,w=this;p()}return r(d.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return 0}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}}),d.prototype.getTileCredits=function(e,t,i){},d.prototype.requestImage=function(e,t,i){return this._image},d.prototype.pickFeatures=function(e,t,i,r,n){},d}),i("Shaders/SkyAtmosphereFS",[],function(){"use strict";return"#ifdef COLOR_CORRECT\nuniform vec3 u_hsbShift;\n#endif\nconst float g = -0.95;\nconst float g2 = g * g;\nconst vec4 K_RGB2HSB = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);\nconst vec4 K_HSB2RGB = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\nvarying vec3 v_rayleighColor;\nvarying vec3 v_mieColor;\nvarying vec3 v_toCamera;\nvarying vec3 v_positionEC;\n#ifdef COLOR_CORRECT\nvec3 rgb2hsb(vec3 rgbColor)\n{\nvec4 p = mix(vec4(rgbColor.bg, K_RGB2HSB.wz), vec4(rgbColor.gb, K_RGB2HSB.xy), step(rgbColor.b, rgbColor.g));\nvec4 q = mix(vec4(p.xyw, rgbColor.r), vec4(rgbColor.r, p.yzx), step(p.x, rgbColor.r));\nfloat d = q.x - min(q.w, q.y);\nreturn vec3(abs(q.z + (q.w - q.y) / (6.0 * d + czm_epsilon7)), d / (q.x + czm_epsilon7), q.x);\n}\nvec3 hsb2rgb(vec3 hsbColor)\n{\nvec3 p = abs(fract(hsbColor.xxx + K_HSB2RGB.xyz) * 6.0 - K_HSB2RGB.www);\nreturn hsbColor.z * mix(K_HSB2RGB.xxx, clamp(p - K_HSB2RGB.xxx, 0.0, 1.0), hsbColor.y);\n}\n#endif\nvoid main (void)\n{\nfloat cosAngle = dot(czm_sunDirectionWC, normalize(v_toCamera)) / length(v_toCamera);\nfloat rayleighPhase = 0.75 * (1.0 + cosAngle * cosAngle);\nfloat miePhase = 1.5 * ((1.0 - g2) / (2.0 + g2)) * (1.0 + cosAngle * cosAngle) / pow(1.0 + g2 - 2.0 * g * cosAngle, 1.5);\nconst float exposure = 2.0;\nvec3 rgb = rayleighPhase * v_rayleighColor + miePhase * v_mieColor;\nrgb = vec3(1.0) - exp(-exposure * rgb);\nfloat l = czm_luminance(rgb);\n#ifdef COLOR_CORRECT\nvec3 hsb = rgb2hsb(rgb);\nhsb.x += u_hsbShift.x;\nhsb.y = clamp(hsb.y + u_hsbShift.y, 0.0, 1.0);\nhsb.z = hsb.z > czm_epsilon7 ? hsb.z + u_hsbShift.z : 0.0;\nrgb = hsb2rgb(hsb);\nl = min(l, czm_luminance(rgb));\n#endif\ngl_FragColor = vec4(rgb, min(smoothstep(0.0, 0.1, l), 1.0) * smoothstep(0.0, 1.0, czm_morphTime));\n}\n"}),i("Shaders/SkyAtmosphereVS",[],function(){"use strict";return"attribute vec4 position;\nuniform vec4 u_cameraAndRadiiAndDynamicAtmosphereColor;\nconst float Kr = 0.0025;\nconst float Kr4PI = Kr * 4.0 * czm_pi;\nconst float Km = 0.0015;\nconst float Km4PI = Km * 4.0 * czm_pi;\nconst float ESun = 15.0;\nconst float KmESun = Km * ESun;\nconst float KrESun = Kr * ESun;\nconst vec3 InvWavelength = vec3(\n5.60204474633241,\n9.473284437923038,\n19.643802610477206);\nconst float rayleighScaleDepth = 0.25;\nconst int nSamples = 2;\nconst float fSamples = 2.0;\nvarying vec3 v_rayleighColor;\nvarying vec3 v_mieColor;\nvarying vec3 v_toCamera;\nfloat scale(float cosAngle)\n{\nfloat x = 1.0 - cosAngle;\nreturn rayleighScaleDepth * exp(-0.00287 + x*(0.459 + x*(3.83 + x*(-6.80 + x*5.25))));\n}\nvoid main(void)\n{\nfloat cameraHeight = u_cameraAndRadiiAndDynamicAtmosphereColor.x;\nfloat outerRadius = u_cameraAndRadiiAndDynamicAtmosphereColor.y;\nfloat innerRadius = u_cameraAndRadiiAndDynamicAtmosphereColor.z;\nvec3 positionV3 = position.xyz;\nvec3 ray = positionV3 - czm_viewerPositionWC;\nfloat far = length(ray);\nray /= far;\nfloat atmosphereScale = 1.0 / (outerRadius - innerRadius);\n#ifdef SKY_FROM_SPACE\nfloat B = 2.0 * dot(czm_viewerPositionWC, ray);\nfloat C = cameraHeight * cameraHeight - outerRadius * outerRadius;\nfloat det = max(0.0, B*B - 4.0 * C);\nfloat near = 0.5 * (-B - sqrt(det));\nvec3 start = czm_viewerPositionWC + ray * near;\nfar -= near;\nfloat startAngle = dot(ray, start) / outerRadius;\nfloat startDepth = exp(-1.0 / rayleighScaleDepth );\nfloat startOffset = startDepth*scale(startAngle);\n#else // SKY_FROM_ATMOSPHERE\nvec3 start = czm_viewerPositionWC;\nfloat height = length(start);\nfloat depth = exp((atmosphereScale / rayleighScaleDepth ) * (innerRadius - cameraHeight));\nfloat startAngle = dot(ray, start) / height;\nfloat startOffset = depth*scale(startAngle);\n#endif\nfloat sampleLength = far / fSamples;\nfloat scaledLength = sampleLength * atmosphereScale;\nvec3 sampleRay = ray * sampleLength;\nvec3 samplePoint = start + sampleRay * 0.5;\nvec3 frontColor = vec3(0.0, 0.0, 0.0);\nvec3 lightDir = (u_cameraAndRadiiAndDynamicAtmosphereColor.w > 0.0) ? czm_sunPositionWC - czm_viewerPositionWC : czm_viewerPositionWC;\nlightDir = normalize(lightDir);\nfor(int i=0; i<nSamples; i++)\n{\nfloat height = length(samplePoint);\nfloat depth = exp((atmosphereScale / rayleighScaleDepth ) * (innerRadius - height));\nfloat fLightAngle = dot(lightDir, samplePoint) / height;\nfloat fCameraAngle = dot(ray, samplePoint) / height;\nfloat fScatter = (startOffset + depth*(scale(fLightAngle) - scale(fCameraAngle)));\nvec3 attenuate = exp(-fScatter * (InvWavelength * Kr4PI + Km4PI));\nfrontColor += attenuate * (depth * scaledLength);\nsamplePoint += sampleRay;\n}\nv_mieColor = frontColor * KmESun;\nv_rayleighColor = frontColor * (InvWavelength * KrESun);\nv_toCamera = czm_viewerPositionWC - positionV3;\ngl_Position = czm_modelViewProjection * position;\n}\n"}),i("Scene/SkyAtmosphere",["../Core/Cartesian3","../Core/Cartesian4","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/Ellipsoid","../Core/EllipsoidGeometry","../Core/GeometryPipeline","../Core/Math","../Core/VertexFormat","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArray","../Shaders/SkyAtmosphereFS","../Shaders/SkyAtmosphereVS","./BlendingState","./CullFace","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w){"use strict";function S(r){r=i(r,a.WGS84),this.show=!0,this._ellipsoid=r,this._command=new d({owner:this}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._spSkyFromSpaceColorCorrect=void 0,this._spSkyFromAtmosphereColorCorrect=void 0,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this._hueSaturationBrightness=new e;var n=new t;n.w=0,n.y=e.maximumComponent(e.multiplyByScalar(r.radii,1.025,new e)),n.z=r.maximumRadius,this._cameraAndRadiiAndDynamicAtmosphereColor=n;var o=this;this._command.uniformMap={u_cameraAndRadiiAndDynamicAtmosphereColor:function(){return o._cameraAndRadiiAndDynamicAtmosphereColor},u_hsbShift:function(){return o._hueSaturationBrightness.x=o.hueShift,o._hueSaturationBrightness.y=o.saturationShift,o._hueSaturationBrightness.z=o.brightnessShift,o._hueSaturationBrightness}}}function E(e){return!(u.equalsEpsilon(e.hueShift,0,u.EPSILON7)&&u.equalsEpsilon(e.saturationShift,0,u.EPSILON7)&&u.equalsEpsilon(e.brightnessShift,0,u.EPSILON7))}return n(S.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),S.prototype.setDynamicAtmosphereColor=function(e){this._cameraAndRadiiAndDynamicAtmosphereColor.w=e?1:0},S.prototype.update=function(t){if(this.show&&(t.mode===w.SCENE3D||t.mode===w.MORPHING)&&t.passes.render){var i=this._command;if(!r(i.vertexArray)){var n=t.context,o=s.createGeometry(new s({radii:e.multiplyByScalar(this._ellipsoid.radii,1.025,new e),slicePartitions:256,stackPartitions:256,vertexFormat:c.POSITION_ONLY}));i.vertexArray=_.fromGeometry({context:n,geometry:o,attributeLocations:l.createAttributeLocations(o),bufferUsage:h.STATIC_DRAW}),i.renderState=p.fromCache({cull:{enabled:!0,face:C.FRONT},blending:y.ALPHA_BLEND});var a=new f({defines:["SKY_FROM_SPACE"],sources:[v]});this._spSkyFromSpace=m.fromCache({context:n,vertexShaderSource:a,fragmentShaderSource:g}),a=new f({defines:["SKY_FROM_ATMOSPHERE"],sources:[v]}),this._spSkyFromAtmosphere=m.fromCache({context:n,vertexShaderSource:a,fragmentShaderSource:g})}var u=E(this);if(u&&(!r(this._spSkyFromSpaceColorCorrect)||!r(this._spSkyFromAtmosphereColorCorrect))){var d=t.context,S=new f({defines:["SKY_FROM_SPACE"],sources:[v]}),b=new f({defines:["COLOR_CORRECT"],sources:[g]});this._spSkyFromSpaceColorCorrect=m.fromCache({context:d,vertexShaderSource:S,fragmentShaderSource:b}),S=new f({defines:["SKY_FROM_ATMOSPHERE"],sources:[v]}),this._spSkyFromAtmosphereColorCorrect=m.fromCache({context:d,vertexShaderSource:S,fragmentShaderSource:b})}var T=t.camera.positionWC,x=e.magnitude(T);return this._cameraAndRadiiAndDynamicAtmosphereColor.x=x,x>this._cameraAndRadiiAndDynamicAtmosphereColor.y?i.shaderProgram=u?this._spSkyFromSpaceColorCorrect:this._spSkyFromSpace:i.shaderProgram=u?this._spSkyFromAtmosphereColorCorrect:this._spSkyFromAtmosphere,i}},S.prototype.isDestroyed=function(){return!1},S.prototype.destroy=function(){var e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyFromSpace=this._spSkyFromSpace&&this._spSkyFromSpace.destroy(),this._spSkyFromAtmosphere=this._spSkyFromAtmosphere&&this._spSkyFromAtmosphere.destroy(),this._spSkyFromSpaceColorCorrect=this._spSkyFromSpaceColorCorrect&&this._spSkyFromSpaceColorCorrect.destroy(),this._spSkyFromAtmosphereColorCorrect=this._spSkyFromAtmosphereColorCorrect&&this._spSkyFromAtmosphereColorCorrect.destroy(),o(this)},S}),i("Shaders/SkyBoxFS",[],function(){"use strict";return"uniform samplerCube u_cubeMap;\nvarying vec3 v_texCoord;\nvoid main()\n{\nvec3 rgb = textureCube(u_cubeMap, normalize(v_texCoord)).rgb;\ngl_FragColor = vec4(rgb, czm_morphTime);\n}\n"}),i("Shaders/SkyBoxVS",[],function(){"use strict";return"attribute vec3 position;\nvarying vec3 v_texCoord;\nvoid main()\n{\nvec3 p = czm_viewRotation * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position));\ngl_Position = czm_projection * vec4(p, 1.0);\nv_texCoord = position.xyz;\n}\n"}),i("Scene/SkyBox",["../Core/BoxGeometry","../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/GeometryPipeline","../Core/Matrix4","../Core/VertexFormat","../Renderer/BufferUsage","../Renderer/CubeMap","../Renderer/DrawCommand","../Renderer/loadCubeMap","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/VertexArray","../Shaders/SkyBoxFS","../Shaders/SkyBoxVS","./BlendingState","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y){"use strict";function C(e){this.sources=e.sources,this._sources=void 0,this.show=i(e.show,!0),this._command=new h({modelMatrix:s.clone(s.IDENTITY),owner:this}),this._cubeMap=void 0}return C.prototype.update=function(i){if(this.show&&(i.mode===y.SCENE3D||i.mode===y.MORPHING)&&i.passes.render){var n=i.context;if(this._sources!==this.sources){this._sources=this.sources;var o=this.sources;"string"==typeof o.positiveX?d(n,this._sources).then(function(e){h._cubeMap=h._cubeMap&&h._cubeMap.destroy(),h._cubeMap=e}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new c({context:n,source:o}))}var s=this._command;if(!r(s.vertexArray)){var h=this;s.uniformMap={u_cubeMap:function(){return h._cubeMap}};var C=e.createGeometry(e.fromDimensions({dimensions:new t(2,2,2),vertexFormat:l.POSITION_ONLY})),w=a.createAttributeLocations(C);s.vertexArray=f.fromGeometry({context:n,geometry:C,attributeLocations:w,bufferUsage:u.STATIC_DRAW}),s.shaderProgram=m.fromCache({context:n,vertexShaderSource:g,fragmentShaderSource:_,attributeLocations:w}),s.renderState=p.fromCache({blending:v.ALPHA_BLEND})}if(r(this._cubeMap))return s}},C.prototype.isDestroyed=function(){return!1},C.prototype.destroy=function(){var e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),n(this)},C}),i("Shaders/SunFS",[],function(){"use strict";return"uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = texture2D(u_texture, v_textureCoordinates);\n}\n"}),i("Shaders/SunTextureFS",[],function(){"use strict";return"uniform float u_glowLengthTS;\nuniform float u_radiusTS;\nvarying vec2 v_textureCoordinates;\nvec2 rotate(vec2 p, vec2 direction)\n{\nreturn vec2(p.x * direction.x - p.y * direction.y, p.x * direction.y + p.y * direction.x);\n}\nvec4 addBurst(vec2 position, vec2 direction)\n{\nvec2 rotatedPosition = rotate(position, direction) * vec2(25.0, 0.75);\nfloat radius = length(rotatedPosition);\nfloat burst = 1.0 - smoothstep(0.0, 0.55, radius);\nreturn vec4(burst);\n}\nvoid main()\n{\nvec2 position = v_textureCoordinates - vec2(0.5);\nfloat radius = length(position);\nfloat surface = step(radius, u_radiusTS);\nvec4 color = vec4(1.0, 1.0, surface + 0.2, surface);\nfloat glow = 1.0 - smoothstep(0.0, 0.55, radius);\ncolor.ba += mix(vec2(0.0), vec2(1.0), glow) * 0.75;\nvec4 burst = vec4(0.0);\nburst += 0.4 * addBurst(position, vec2(0.38942, 0.92106));\nburst += 0.4 * addBurst(position, vec2(0.99235, 0.12348));\nburst += 0.4 * addBurst(position, vec2(0.60327, -0.79754));\nburst += 0.3 * addBurst(position, vec2(0.31457, 0.94924));\nburst += 0.3 * addBurst(position, vec2(0.97931, 0.20239));\nburst += 0.3 * addBurst(position, vec2(0.66507, -0.74678));\ncolor += clamp(burst, vec4(0.0), vec4(1.0)) * 0.15;\ngl_FragColor = clamp(color, vec4(0.0), vec4(1.0));\n}\n"; +}),i("Shaders/SunVS",[],function(){"use strict";return"attribute vec2 direction;\nuniform float u_size;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec4 position;\nif (czm_morphTime == 1.0)\n{\nposition = vec4(czm_sunPositionWC, 1.0);\n}\nelse\n{\nposition = vec4(czm_sunPositionColumbusView.zxy, 1.0);\n}\nvec4 positionEC = czm_view * position;\nvec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\nvec2 halfSize = vec2(u_size * 0.5);\nhalfSize *= ((direction * 2.0) - 1.0);\ngl_Position = czm_viewportOrthographic * vec4(positionWC.xy + halfSize, -positionWC.z, 1.0);\nv_textureCoordinates = direction;\n}\n"}),i("Scene/Sun",["../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/ComponentDatatype","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/IndexDatatype","../Core/Math","../Core/Matrix4","../Core/PixelFormat","../Core/PrimitiveType","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/ComputeCommand","../Renderer/DrawCommand","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/Texture","../Renderer/VertexArray","../Shaders/SunFS","../Shaders/SunTextureFS","../Shaders/SunVS","./BlendingState","./SceneMode","./SceneTransforms"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x){"use strict";function A(){this.show=!0,this._drawCommand=new _({primitiveType:d.TRIANGLES,boundingVolume:new e,owner:this}),this._commands={drawCommand:this._drawCommand,computeCommand:void 0},this._boundingVolume=new e,this._boundingVolume2D=new e,this._texture=void 0,this._drawingBufferWidth=void 0,this._drawingBufferHeight=void 0,this._radiusTS=void 0,this._size=void 0,this.glowFactor=1,this._glowFactorDirty=!1;var t=this;this._uniformMap={u_texture:function(){return t._texture},u_size:function(){return t._size}}}a(A.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var P=new t,D=new t,M=new r,I=new r;return A.prototype.update=function(r){var a=r._passState,s=r.frameState,d=r.context;if(this.show){var _=s.mode;if(_!==T.SCENE2D&&_!==T.MORPHING&&s.passes.render){var A=a.viewport.width,R=a.viewport.height;if(!o(this._texture)||A!==this._drawingBufferWidth||R!==this._drawingBufferHeight||this._glowFactorDirty){this._texture=this._texture&&this._texture.destroy(),this._drawingBufferWidth=A,this._drawingBufferHeight=R,this._glowFactorDirty=!1;var O=Math.max(A,R);O=Math.pow(2,Math.ceil(Math.log(O)/Math.log(2))-2),O=Math.max(1,O),this._texture=new y({context:d,width:O,height:O,pixelFormat:h.RGBA}),this._glowLengthTS=5*this._glowFactor,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;var N=this,L={u_glowLengthTS:function(){return N._glowLengthTS},u_radiusTS:function(){return N._radiusTS}};this._commands.computeCommand=new f({fragmentShaderSource:S,outputTexture:this._texture,uniformMap:L,persists:!1,owner:this,postExecute:function(){N._commands.computeCommand=void 0}})}var B=this._drawCommand;if(!o(B.vertexArray)){var F={direction:0},V=new Uint8Array(8);V[0]=0,V[1]=0,V[2]=255,V[3]=0,V[4]=255,V[5]=255,V[6]=0,V[7]=255;var k=p.createVertexBuffer({context:d,typedArray:V,usage:m.STATIC_DRAW}),z=[{index:F.direction,vertexBuffer:k,componentsPerAttribute:2,normalize:!0,componentDatatype:n.UNSIGNED_BYTE}],U=p.createIndexBuffer({context:d,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:m.STATIC_DRAW,indexDatatype:l.UNSIGNED_SHORT});B.vertexArray=new C({context:d,attributes:z,indexBuffer:U}),B.shaderProgram=v.fromCache({context:d,vertexShaderSource:E,fragmentShaderSource:w,attributeLocations:F}),B.renderState=g.fromCache({blending:b.ALPHA_BLEND}),B.uniformMap=this._uniformMap}var G=d.uniformState.sunPositionWC,W=d.uniformState.sunPositionColumbusView,H=this._boundingVolume,q=this._boundingVolume2D;i.clone(G,H.center),q.center.x=W.z,q.center.y=W.x,q.center.z=W.y,H.radius=u.SOLAR_RADIUS+u.SOLAR_RADIUS*this._glowLengthTS,q.radius=H.radius,_===T.SCENE3D?e.clone(H,B.boundingVolume):_===T.COLUMBUS_VIEW&&e.clone(q,B.boundingVolume);var j=x.computeActualWgs84Position(s,G,I),Y=i.magnitude(i.subtract(j,r.camera.position,I)),X=d.uniformState.projection,Z=M;Z.x=0,Z.y=0,Z.z=-Y,Z.w=1;var K=c.multiplyByVector(X,Z,I),Q=x.clipToDrawingBufferCoordinates(a.viewport,K,P);Z.x=u.SOLAR_RADIUS;var J=c.multiplyByVector(X,Z,I),$=x.clipToDrawingBufferCoordinates(a.viewport,J,D);return this._size=Math.ceil(t.magnitude(t.subtract($,Q,I))),this._size=2*this._size*(1+2*this._glowLengthTS),this._commands}}},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){var e=this._drawCommand;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._texture=this._texture&&this._texture.destroy(),s(this)},A}),i("Scene/TileCoordinatesImageryProvider",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","../Core/GeographicTilingScheme","../ThirdParty/when"],function(e,t,i,r,n,o,a){"use strict";function s(r){r=t(r,t.EMPTY_OBJECT),this._tilingScheme=i(r.tilingScheme)?r.tilingScheme:new o({ellipsoid:r.ellipsoid}),this._color=t(r.color,e.YELLOW),this._errorEvent=new n,this._tileWidth=t(r.tileWidth,256),this._tileHeight=t(r.tileHeight,256),this._readyPromise=a.resolve(!0)}return r(s.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return!0}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}}),s.prototype.getTileCredits=function(e,t,i){},s.prototype.requestImage=function(e,t,i){var r=document.createElement("canvas");r.width=256,r.height=256;var n=r.getContext("2d"),o=this._color.toCssColorString();n.strokeStyle=o,n.lineWidth=2,n.strokeRect(1,1,255,255);var a="L"+i+"X"+e+"Y"+t;return n.font="bold 25px Arial",n.textAlign="center",n.fillStyle="black",n.fillText(a,127,127),n.fillStyle=o,n.fillText(a,124,124),r},s.prototype.pickFeatures=function(e,t,i,r,n){},s}),i("Scene/TileDiscardPolicy",["../Core/DeveloperError"],function(e){"use strict";function t(t){e.throwInstantiationError()}return t.prototype.isReady=e.throwInstantiationError,t.prototype.shouldDiscardImage=e.throwInstantiationError,t}),i("Scene/TileState",["../Core/freezeObject"],function(e){"use strict";var t={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3};return e(t)}),i("Shaders/ViewportQuadFS",[],function(){"use strict";return"varying vec2 v_textureCoordinates;\nvoid main()\n{\nczm_materialInput materialInput;\nmaterialInput.s = v_textureCoordinates.s;\nmaterialInput.st = v_textureCoordinates;\nmaterialInput.str = vec3(v_textureCoordinates, 0.0);\nmaterialInput.normalEC = vec3(0.0, 0.0, -1.0);\nczm_material material = czm_getMaterial(materialInput);\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n}\n"}),i("Scene/ViewportQuad",["../Core/BoundingRectangle","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderSource","../Shaders/ViewportQuadFS","./BlendingState","./Material"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(r,n){this.show=!0,i(r)||(r=new e),this.rectangle=e.clone(r),i(n)||(n=c.fromType(c.ColorType,{color:new t(1,1,1,1)})),this.material=n,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}return h.prototype.update=function(t){if(this.show){var r=this._rs;i(r)&&e.equals(r.viewport,this.rectangle)||(this._rs=a.fromCache({blending:u.ALPHA_BLEND,viewport:this.rectangle}));var n=t.passes;if(n.render){var c=t.context;if(this._material!==this.material||!i(this._overlayCommand)){this._material=this.material,i(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();var h=new s({sources:[this._material.shaderSource,l]});this._overlayCommand=c.createViewportQuadCommand(h,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=o.OVERLAY}this._material.update(c),this._overlayCommand.uniformMap=this._material._uniforms,t.commandList.push(this._overlayCommand)}}},h.prototype.isDestroyed=function(){return!1},h.prototype.destroy=function(){return i(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),r(this)},h}),i("Scene/WebMapServiceImageryProvider",["../Core/combine","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/freezeObject","../Core/GeographicTilingScheme","../Core/objectToQuery","../Core/queryToObject","../Core/WebMercatorTilingScheme","../ThirdParty/Uri","./GetFeatureInfoFormat","./UrlTemplateImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,h,d){"use strict";function p(r){function n(e,t){i(f[e])||(f[e]=t),i(v)&&!i(v[e])&&(v[e]=t)}r=t(r,t.EMPTY_OBJECT),this._url=r.url,this._layers=r.layers;var o=t(r.getFeatureInfoFormats,p.DefaultGetFeatureInfoFormats),h=new c(r.url),f=l(t(h.query,"")),_=e(m(t(r.parameters,t.EMPTY_OBJECT)),p.DefaultParameters);f=e(_,f);var g,v;g=new c(r.url),v=l(t(g.query,""));var y=e(m(t(r.getFeatureInfoParameters,t.EMPTY_OBJECT)),p.GetFeatureInfoDefaultParameters);v=e(y,v),n("layers",r.layers),parseFloat(_.version)>=1.3?n("crs",r.tilingScheme instanceof u?"EPSG:3857":"CRS:84"):n("srs",r.tilingScheme instanceof u?"EPSG:3857":"EPSG:4326"),n("bbox","{westProjected},{southProjected},{eastProjected},{northProjected}"),n("width","{width}"),n("height","{height}"),h.query=s(f);var C,w=h.toString().replace(/%7B/g,"{").replace(/%7D/g,"}");i(v)&&(i(v.query_layers)||(v.query_layers=r.layers),i(v.x)||(v.x="{i}"),i(v.y)||(v.y="{j}"),i(v.info_format)||(v.info_format="{format}"),g.query=s(v),C=g.toString().replace(/%7B/g,"{").replace(/%7D/g,"}")),this._tileProvider=new d({url:w,pickFeaturesUrl:C,tilingScheme:t(r.tilingScheme,new a({ellipsoid:r.ellipsoid})),rectangle:r.rectangle,tileWidth:r.tileWidth,tileHeight:r.tileHeight,minimumLevel:r.minimumLevel,maximumLevel:r.maximumLevel,proxy:r.proxy,subdomains:r.subdomains,tileDiscardPolicy:r.tileDiscardPolicy,credit:r.credit,getFeatureInfoFormats:o,enablePickFeatures:r.enablePickFeatures})}function m(e){var t={};for(var i in e)e.hasOwnProperty(i)&&(t[i.toLowerCase()]=e[i]);return t}return r(p.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._tileProvider.proxy}},layers:{get:function(){return this._layers}},tileWidth:{get:function(){return this._tileProvider.tileWidth}},tileHeight:{get:function(){return this._tileProvider.tileHeight}},maximumLevel:{get:function(){return this._tileProvider.maximumLevel}},minimumLevel:{get:function(){return this._tileProvider.minimumLevel}},tilingScheme:{get:function(){return this._tileProvider.tilingScheme}},rectangle:{get:function(){return this._tileProvider.rectangle}},tileDiscardPolicy:{get:function(){return this._tileProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._tileProvider.errorEvent}},ready:{get:function(){return this._tileProvider.ready}},readyPromise:{get:function(){return this._tileProvider.readyPromise}},credit:{get:function(){return this._tileProvider.credit}},hasAlphaChannel:{get:function(){return this._tileProvider.hasAlphaChannel}},enablePickFeatures:{get:function(){return this._tileProvider.enablePickFeatures},set:function(e){this._tileProvider.enablePickFeatures=e}}}),p.prototype.getTileCredits=function(e,t,i){return this._tileProvider.getTileCredits(e,t,i)},p.prototype.requestImage=function(e,t,i){return this._tileProvider.requestImage(e,t,i)},p.prototype.pickFeatures=function(e,t,i,r,n){return this._tileProvider.pickFeatures(e,t,i,r,n)},p.DefaultParameters=o({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"}),p.GetFeatureInfoDefaultParameters=o({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"}),p.DefaultGetFeatureInfoFormats=o([o(new h("json","application/json")),o(new h("xml","text/xml")),o(new h("text","text/html"))]),p}),i("Scene/WebMapTileServiceImageryProvider",["../Core/combine","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/freezeObject","../Core/isArray","../Core/objectToQuery","../Core/queryToObject","../Core/Rectangle","../Core/WebMercatorTilingScheme","../ThirdParty/Uri","../ThirdParty/when","./ImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f){"use strict";function _(e){e=i(e,i.EMPTY_OBJECT),this._url=e.url,this._layer=e.layer,this._style=e.style,this._tileMatrixSetID=e.tileMatrixSetID,this._tileMatrixLabels=e.tileMatrixLabels,this._format=i(e.format,"image/jpeg"),this._proxy=e.proxy,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=r(e.tilingScheme)?e.tilingScheme:new d({ellipsoid:e.ellipsoid}),this._tileWidth=i(e.tileWidth,256),this._tileHeight=i(e.tileHeight,256),this._minimumLevel=i(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._rectangle=i(e.rectangle,this._tilingScheme.rectangle),this._readyPromise=m.resolve(!0);var n=this._tilingScheme.positionToTileXY(h.southwest(this._rectangle),this._minimumLevel),o=this._tilingScheme.positionToTileXY(h.northeast(this._rectangle),this._minimumLevel);(Math.abs(o.x-n.x)+1)*(Math.abs(o.y-n.y)+1);this._errorEvent=new a;var s=e.credit;this._credit="string"==typeof s?new t(s):s,this._subdomains=e.subdomains,l(this._subdomains)?this._subdomains=this._subdomains.slice():r(this._subdomains)&&this._subdomains.length>0?this._subdomains=this._subdomains.split(""):this._subdomains=["a","b","c"]}function g(t,n,o,a){var s,l=t._tileMatrixLabels,h=r(l)?l[a]:a.toString(),d=t._subdomains;if(t._url.indexOf("{")>=0)s=t._url.replace("{style}",t._style).replace("{Style}",t._style).replace("{TileMatrixSet}",t._tileMatrixSetID).replace("{TileMatrix}",h).replace("{TileRow}",o.toString()).replace("{TileCol}",n.toString()).replace("{s}",d[(n+o+a)%d.length]);else{var m=new p(t._url),f=c(i(m.query,""));f=e(v,f),f.tilematrix=h,f.layer=t._layer,f.style=t._style,f.tilerow=o,f.tilecol=n,f.tilematrixset=t._tileMatrixSetID,f.format=t._format,m.query=u(f),s=m.toString()}var _=t._proxy;return r(_)&&(s=_.getURL(s)),s}var v=s({service:"WMTS",version:"1.0.0",request:"GetTile"});return n(_.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},format:{get:function(){return this._format}},ready:{value:!0},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}}),_.prototype.getTileCredits=function(e,t,i){},_.prototype.requestImage=function(e,t,i){var r=g(this,e,t,i);return f.loadImage(this,r)},_.prototype.pickFeatures=function(e,t,i,r,n){},_}),function(){!function(e){var t=this||(0,eval)("this"),r=t.document,n=t.navigator,o=t.jQuery,a=t.JSON;!function(e){"function"==typeof i&&i.amd?i("ThirdParty/knockout-3.4.0",["exports","require"],e):e("object"==typeof exports&&"object"==typeof module?module.exports||exports:t.ko={})}(function(i,s){function l(e,t){return(null===e||typeof e in _)&&e===t}function u(t,i){var r;return function(){r||(r=f.a.setTimeout(function(){r=e,t()},i))}}function c(e,t){var i;return function(){clearTimeout(i),i=f.a.setTimeout(e,t)}}function h(e,t){t&&t!==g?"beforeChange"===t?this.Kb(e):this.Ha(e,t):this.Lb(e)}function d(e,t){null!==t&&t.k&&t.k()}function p(e,t){var i=this.Hc,r=i[S];r.R||(this.lb&&this.Ma[t]?(i.Pb(t,e,this.Ma[t]),this.Ma[t]=null,--this.lb):r.r[t]||i.Pb(t,e,r.s?{ia:e}:i.uc(e)))}function m(e,t,i,r){f.d[e]={init:function(e,n,o,a,s){var l,u;return f.m(function(){var o=f.a.c(n()),a=!i!=!o,c=!u;(c||t||a!==l)&&(c&&f.va.Aa()&&(u=f.a.ua(f.f.childNodes(e),!0)),a?(c||f.f.da(e,f.a.ua(u)),f.eb(r?r(s,o):s,e)):f.f.xa(e),l=a)},null,{i:e}),{controlsDescendantBindings:!0}}},f.h.ta[e]=!1,f.f.Z[e]=!0}var f="undefined"!=typeof i?i:{};f.b=function(e,t){for(var i=e.split("."),r=f,n=0;n<i.length-1;n++)r=r[i[n]];r[i[i.length-1]]=t},f.G=function(e,t,i){e[t]=i},f.version="3.4.0",f.b("version",f.version),f.options={deferUpdates:!1,useOnlyNativeEvents:!1},f.a=function(){function i(e,t){for(var i in e)e.hasOwnProperty(i)&&t(i,e[i])}function s(e,t){if(t)for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e}function l(e,t){return e.__proto__=t,e}function u(e,t,i,r){var n=e[t].match(g)||[];f.a.q(i.match(g),function(e){f.a.pa(n,e,r)}),e[t]=n.join(" ")}var c={__proto__:[]}instanceof Array,h="function"==typeof Symbol,d={},p={};d[n&&/Firefox\/2/i.test(n.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],d.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),i(d,function(e,t){if(t.length)for(var i=0,r=t.length;i<r;i++)p[t[i]]=e});var m={propertychange:!0},_=r&&function(){for(var t=3,i=r.createElement("div"),n=i.getElementsByTagName("i");i.innerHTML="<!--[if gt IE "+ ++t+"]><i></i><![endif]-->",n[0];);return 4<t?t:e}(),g=/\S+/g;return{cc:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],q:function(e,t){for(var i=0,r=e.length;i<r;i++)t(e[i],i)},o:function(e,t){if("function"==typeof Array.prototype.indexOf)return Array.prototype.indexOf.call(e,t);for(var i=0,r=e.length;i<r;i++)if(e[i]===t)return i;return-1},Sb:function(e,t,i){for(var r=0,n=e.length;r<n;r++)if(t.call(i,e[r],r))return e[r];return null},La:function(e,t){var i=f.a.o(e,t);0<i?e.splice(i,1):0===i&&e.shift()},Tb:function(e){e=e||[];for(var t=[],i=0,r=e.length;i<r;i++)0>f.a.o(t,e[i])&&t.push(e[i]);return t},fb:function(e,t){e=e||[];for(var i=[],r=0,n=e.length;r<n;r++)i.push(t(e[r],r));return i},Ka:function(e,t){e=e||[];for(var i=[],r=0,n=e.length;r<n;r++)t(e[r],r)&&i.push(e[r]);return i},ra:function(e,t){if(t instanceof Array)e.push.apply(e,t);else for(var i=0,r=t.length;i<r;i++)e.push(t[i]);return e},pa:function(e,t,i){var r=f.a.o(f.a.zb(e),t);0>r?i&&e.push(t):i||e.splice(r,1)},ka:c,extend:s,Xa:l,Ya:c?l:s,D:i,Ca:function(e,t){if(!e)return e;var i,r={};for(i in e)e.hasOwnProperty(i)&&(r[i]=t(e[i],i,e));return r},ob:function(e){for(;e.firstChild;)f.removeNode(e.firstChild)},jc:function(e){e=f.a.V(e);for(var t=(e[0]&&e[0].ownerDocument||r).createElement("div"),i=0,n=e.length;i<n;i++)t.appendChild(f.$(e[i]));return t},ua:function(e,t){for(var i=0,r=e.length,n=[];i<r;i++){var o=e[i].cloneNode(!0);n.push(t?f.$(o):o)}return n},da:function(e,t){if(f.a.ob(e),t)for(var i=0,r=t.length;i<r;i++)e.appendChild(t[i])},qc:function(e,t){var i=e.nodeType?[e]:e;if(0<i.length){for(var r=i[0],n=r.parentNode,o=0,a=t.length;o<a;o++)n.insertBefore(t[o],r);for(o=0,a=i.length;o<a;o++)f.removeNode(i[o])}},za:function(e,t){if(e.length){for(t=8===t.nodeType&&t.parentNode||t;e.length&&e[0].parentNode!==t;)e.splice(0,1);for(;1<e.length&&e[e.length-1].parentNode!==t;)e.length--;if(1<e.length){var i=e[0],r=e[e.length-1];for(e.length=0;i!==r;)e.push(i),i=i.nextSibling;e.push(r)}}return e},sc:function(e,t){7>_?e.setAttribute("selected",t):e.selected=t},$a:function(t){return null===t||t===e?"":t.trim?t.trim():t.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},nd:function(e,t){return e=e||"",!(t.length>e.length)&&e.substring(0,t.length)===t},Mc:function(e,t){if(e===t)return!0;if(11===e.nodeType)return!1;if(t.contains)return t.contains(3===e.nodeType?e.parentNode:e);if(t.compareDocumentPosition)return 16==(16&t.compareDocumentPosition(e));for(;e&&e!=t;)e=e.parentNode;return!!e},nb:function(e){return f.a.Mc(e,e.ownerDocument.documentElement)},Qb:function(e){return!!f.a.Sb(e,f.a.nb)},A:function(e){return e&&e.tagName&&e.tagName.toLowerCase()},Wb:function(e){return f.onError?function(){try{return e.apply(this,arguments)}catch(e){throw f.onError&&f.onError(e),e}}:e},setTimeout:function(e,t){return setTimeout(f.a.Wb(e),t)},$b:function(e){setTimeout(function(){throw f.onError&&f.onError(e),e},0)},p:function(e,t,i){var r=f.a.Wb(i);if(i=_&&m[t],f.options.useOnlyNativeEvents||i||!o)if(i||"function"!=typeof e.addEventListener){if("undefined"==typeof e.attachEvent)throw Error("Browser doesn't support addEventListener or attachEvent");var n=function(t){r.call(e,t)},a="on"+t;e.attachEvent(a,n),f.a.F.oa(e,function(){e.detachEvent(a,n)})}else e.addEventListener(t,r,!1);else o(e).bind(t,r)},Da:function(e,i){if(!e||!e.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var n;if("input"===f.a.A(e)&&e.type&&"click"==i.toLowerCase()?(n=e.type,n="checkbox"==n||"radio"==n):n=!1,f.options.useOnlyNativeEvents||!o||n)if("function"==typeof r.createEvent){if("function"!=typeof e.dispatchEvent)throw Error("The supplied element doesn't support dispatchEvent");n=r.createEvent(p[i]||"HTMLEvents"),n.initEvent(i,!0,!0,t,0,0,0,0,0,!1,!1,!1,!1,0,e),e.dispatchEvent(n)}else if(n&&e.click)e.click();else{if("undefined"==typeof e.fireEvent)throw Error("Browser doesn't support triggering events");e.fireEvent("on"+i)}else o(e).trigger(i)},c:function(e){return f.H(e)?e():e},zb:function(e){return f.H(e)?e.t():e},bb:function(e,t,i){var r;t&&("object"==typeof e.classList?(r=e.classList[i?"add":"remove"],f.a.q(t.match(g),function(t){r.call(e.classList,t)})):"string"==typeof e.className.baseVal?u(e.className,"baseVal",t,i):u(e,"className",t,i))},Za:function(t,i){var r=f.a.c(i);null!==r&&r!==e||(r="");var n=f.f.firstChild(t);!n||3!=n.nodeType||f.f.nextSibling(n)?f.f.da(t,[t.ownerDocument.createTextNode(r)]):n.data=r,f.a.Rc(t)},rc:function(e,t){if(e.name=t,7>=_)try{e.mergeAttributes(r.createElement("<input name='"+e.name+"'/>"),!1)}catch(e){}},Rc:function(e){9<=_&&(e=1==e.nodeType?e:e.parentNode,e.style&&(e.style.zoom=e.style.zoom))},Nc:function(e){if(_){var t=e.style.width;e.style.width=0,e.style.width=t}},hd:function(e,t){e=f.a.c(e),t=f.a.c(t);for(var i=[],r=e;r<=t;r++)i.push(r);return i},V:function(e){for(var t=[],i=0,r=e.length;i<r;i++)t.push(e[i]);return t},Yb:function(e){return h?Symbol(e):e},rd:6===_,sd:7===_,C:_,ec:function(e,t){for(var i=f.a.V(e.getElementsByTagName("input")).concat(f.a.V(e.getElementsByTagName("textarea"))),r="string"==typeof t?function(e){return e.name===t}:function(e){return t.test(e.name)},n=[],o=i.length-1;0<=o;o--)r(i[o])&&n.push(i[o]);return n},ed:function(e){return"string"==typeof e&&(e=f.a.$a(e))?a&&a.parse?a.parse(e):new Function("return "+e)():null},Eb:function(e,t,i){if(!a||!a.stringify)throw Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js");return a.stringify(f.a.c(e),t,i)},fd:function(e,t,n){n=n||{};var o=n.params||{},a=n.includeFields||this.cc,s=e;if("object"==typeof e&&"form"===f.a.A(e))for(var s=e.action,l=a.length-1;0<=l;l--)for(var u=f.a.ec(e,a[l]),c=u.length-1;0<=c;c--)o[u[c].name]=u[c].value;t=f.a.c(t);var h=r.createElement("form");h.style.display="none",h.action=s,h.method="post";for(var d in t)e=r.createElement("input"),e.type="hidden",e.name=d,e.value=f.a.Eb(f.a.c(t[d])),h.appendChild(e);i(o,function(e,t){var i=r.createElement("input");i.type="hidden",i.name=e,i.value=t,h.appendChild(i)}),r.body.appendChild(h),n.submitter?n.submitter(h):h.submit(),setTimeout(function(){h.parentNode.removeChild(h)},0)}}}(),f.b("utils",f.a),f.b("utils.arrayForEach",f.a.q),f.b("utils.arrayFirst",f.a.Sb),f.b("utils.arrayFilter",f.a.Ka),f.b("utils.arrayGetDistinctValues",f.a.Tb),f.b("utils.arrayIndexOf",f.a.o),f.b("utils.arrayMap",f.a.fb),f.b("utils.arrayPushAll",f.a.ra),f.b("utils.arrayRemoveItem",f.a.La),f.b("utils.extend",f.a.extend),f.b("utils.fieldsIncludedWithJsonPost",f.a.cc),f.b("utils.getFormFields",f.a.ec),f.b("utils.peekObservable",f.a.zb),f.b("utils.postJson",f.a.fd),f.b("utils.parseJson",f.a.ed),f.b("utils.registerEventHandler",f.a.p),f.b("utils.stringifyJson",f.a.Eb),f.b("utils.range",f.a.hd),f.b("utils.toggleDomNodeCssClass",f.a.bb),f.b("utils.triggerEvent",f.a.Da),f.b("utils.unwrapObservable",f.a.c),f.b("utils.objectForEach",f.a.D),f.b("utils.addOrRemoveItem",f.a.pa),f.b("utils.setTextContent",f.a.Za),f.b("unwrap",f.a.c),Function.prototype.bind||(Function.prototype.bind=function(e){var t=this;if(1===arguments.length)return function(){return t.apply(e,arguments)};var i=Array.prototype.slice.call(arguments,1);return function(){var r=i.slice(0);return r.push.apply(r,arguments),t.apply(e,r)}}),f.a.e=new function(){function t(t,o){var a=t[r];if(!a||"null"===a||!n[a]){if(!o)return e;a=t[r]="ko"+i++,n[a]={}}return n[a]}var i=0,r="__ko__"+(new Date).getTime(),n={};return{get:function(i,r){var n=t(i,!1);return n===e?e:n[r]},set:function(i,r,n){n===e&&t(i,!1)===e||(t(i,!0)[r]=n)},clear:function(e){var t=e[r];return!!t&&(delete n[t],e[r]=null,!0)},I:function(){return i++ +r}}},f.b("utils.domData",f.a.e),f.b("utils.domData.clear",f.a.e.clear),f.a.F=new function(){function t(t,i){var n=f.a.e.get(t,r);return n===e&&i&&(n=[],f.a.e.set(t,r,n)),n}function i(e){var r=t(e,!1);if(r)for(var r=r.slice(0),n=0;n<r.length;n++)r[n](e);if(f.a.e.clear(e),f.a.F.cleanExternalData(e),a[e.nodeType])for(r=e.firstChild;e=r;)r=e.nextSibling,8===e.nodeType&&i(e)}var r=f.a.e.I(),n={1:!0,8:!0,9:!0},a={1:!0,9:!0};return{oa:function(e,i){if("function"!=typeof i)throw Error("Callback must be a function");t(e,!0).push(i)},pc:function(i,n){var o=t(i,!1);o&&(f.a.La(o,n),0==o.length&&f.a.e.set(i,r,e))},$:function(e){if(n[e.nodeType]&&(i(e),a[e.nodeType])){var t=[];f.a.ra(t,e.getElementsByTagName("*"));for(var r=0,o=t.length;r<o;r++)i(t[r])}return e},removeNode:function(e){f.$(e),e.parentNode&&e.parentNode.removeChild(e)},cleanExternalData:function(e){o&&"function"==typeof o.cleanData&&o.cleanData([e])}}},f.$=f.a.F.$,f.removeNode=f.a.F.removeNode,f.b("cleanNode",f.$),f.b("removeNode",f.removeNode),f.b("utils.domNodeDisposal",f.a.F),f.b("utils.domNodeDisposal.addDisposeCallback",f.a.F.oa),f.b("utils.domNodeDisposal.removeDisposeCallback",f.a.F.pc),function(){var i=[0,"",""],n=[1,"<table>","</table>"],a=[3,"<table><tbody><tr>","</tr></tbody></table>"],s=[1,"<select multiple='multiple'>","</select>"],l={thead:n,tbody:n,tfoot:n,tr:[2,"<table><tbody>","</tbody></table>"],td:a,th:a,option:s,optgroup:s},u=8>=f.a.C;f.a.ma=function(e,n){var a;if(o){if(o.parseHTML)a=o.parseHTML(e,n)||[];else if((a=o.clean([e],n))&&a[0]){for(var s=a[0];s.parentNode&&11!==s.parentNode.nodeType;)s=s.parentNode;s.parentNode&&s.parentNode.removeChild(s)}}else{(a=n)||(a=r);var c,s=a.parentWindow||a.defaultView||t,h=f.a.$a(e).toLowerCase(),d=a.createElement("div");for(c=(h=h.match(/^<([a-z]+)[ >]/))&&l[h[1]]||i,h=c[0],c="ignored<div>"+c[1]+e+c[2]+"</div>","function"==typeof s.innerShiv?d.appendChild(s.innerShiv(c)):(u&&a.appendChild(d),d.innerHTML=c,u&&d.parentNode.removeChild(d));h--;)d=d.lastChild;a=f.a.V(d.lastChild.childNodes)}return a},f.a.Cb=function(t,i){if(f.a.ob(t),i=f.a.c(i),null!==i&&i!==e)if("string"!=typeof i&&(i=i.toString()),o)o(t).html(i);else for(var r=f.a.ma(i,t.ownerDocument),n=0;n<r.length;n++)t.appendChild(r[n])}}(),f.b("utils.parseHtmlFragment",f.a.ma),f.b("utils.setHtml",f.a.Cb),f.M=function(){function t(e,i){if(e)if(8==e.nodeType){var r=f.M.lc(e.nodeValue);null!=r&&i.push({Lc:e,cd:r})}else if(1==e.nodeType)for(var r=0,n=e.childNodes,o=n.length;r<o;r++)t(n[r],i)}var i={};return{wb:function(e){if("function"!=typeof e)throw Error("You can only pass a function to ko.memoization.memoize()");var t=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);return i[t]=e,"<!--[ko_memo:"+t+"]-->"},xc:function(t,r){var n=i[t];if(n===e)throw Error("Couldn't find any memo with ID "+t+". Perhaps it's already been unmemoized.");try{return n.apply(null,r||[]),!0}finally{delete i[t]}},yc:function(e,i){var r=[];t(e,r);for(var n=0,o=r.length;n<o;n++){var a=r[n].Lc,s=[a];i&&f.a.ra(s,i),f.M.xc(r[n].cd,s),a.nodeValue="",a.parentNode&&a.parentNode.removeChild(a)}},lc:function(e){return(e=e.match(/^\[ko_memo\:(.*?)\]$/))?e[1]:null}}}(),f.b("memoization",f.M),f.b("memoization.memoize",f.M.wb),f.b("memoization.unmemoize",f.M.xc),f.b("memoization.parseMemoText",f.M.lc),f.b("memoization.unmemoizeDomNodeAndDescendants",f.M.yc),f.Y=function(){function e(){if(o)for(var e,t=o,i=0;s<o;)if(e=n[s++]){if(s>t){if(5e3<=++i){s=o,f.a.$b(Error("'Too much recursion' after processing "+i+" task groups."));break}t=o}try{e()}catch(e){f.a.$b(e)}}}function i(){e(),s=o=n.length=0}var n=[],o=0,a=1,s=0;return{scheduler:t.MutationObserver?function(e){var t=r.createElement("div");return new MutationObserver(e).observe(t,{attributes:!0}),function(){t.classList.toggle("foo")}}(i):r&&"onreadystatechange"in r.createElement("script")?function(e){var t=r.createElement("script");t.onreadystatechange=function(){t.onreadystatechange=null,r.documentElement.removeChild(t),t=null,e()},r.documentElement.appendChild(t)}:function(e){setTimeout(e,0)},Wa:function(e){return o||f.Y.scheduler(i),n[o++]=e,a++},cancel:function(e){e-=a-o,e>=s&&e<o&&(n[e]=null)},resetForTesting:function(){var e=o-s;return s=o=n.length=0,e},md:e}}(),f.b("tasks",f.Y),f.b("tasks.schedule",f.Y.Wa),f.b("tasks.runEarly",f.Y.md),f.ya={throttle:function(e,t){e.throttleEvaluation=t;var i=null;return f.B({read:e,write:function(r){clearTimeout(i),i=f.a.setTimeout(function(){e(r)},t)}})},rateLimit:function(e,t){var i,r,n;"number"==typeof t?i=t:(i=t.timeout,r=t.method),e.cb=!1,n="notifyWhenChangesStop"==r?c:u,e.Ta(function(e){return n(e,i)})},deferred:function(t,i){if(!0!==i)throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");t.cb||(t.cb=!0,t.Ta(function(i){var r;return function(){f.Y.cancel(r),r=f.Y.Wa(i),t.notifySubscribers(e,"dirty")}}))},notify:function(e,t){e.equalityComparer="always"==t?null:l}};var _={undefined:1,boolean:1,number:1,string:1};f.b("extenders",f.ya),f.vc=function(e,t,i){this.ia=e,this.gb=t,this.Kc=i,this.R=!1,f.G(this,"dispose",this.k)},f.vc.prototype.k=function(){this.R=!0,this.Kc()},f.J=function(){f.a.Ya(this,v),v.rb(this)};var g="change",v={rb:function(e){e.K={},e.Nb=1},X:function(e,t,i){var r=this;i=i||g;var n=new f.vc(r,t?e.bind(t):e,function(){f.a.La(r.K[i],n),r.Ia&&r.Ia(i)});return r.sa&&r.sa(i),r.K[i]||(r.K[i]=[]),r.K[i].push(n),n},notifySubscribers:function(e,t){if(t=t||g,t===g&&this.zc(),this.Pa(t))try{f.l.Ub();for(var i,r=this.K[t].slice(0),n=0;i=r[n];++n)i.R||i.gb(e)}finally{f.l.end()}},Na:function(){return this.Nb},Uc:function(e){return this.Na()!==e},zc:function(){++this.Nb},Ta:function(e){var t,i,r,n=this,o=f.H(n);n.Ha||(n.Ha=n.notifySubscribers,n.notifySubscribers=h);var a=e(function(){n.Mb=!1,o&&r===n&&(r=n()),t=!1,n.tb(i,r)&&n.Ha(i=r)});n.Lb=function(e){n.Mb=t=!0,r=e,a()},n.Kb=function(e){t||(i=e,n.Ha(e,"beforeChange"))}},Pa:function(e){return this.K[e]&&this.K[e].length},Sc:function(e){if(e)return this.K[e]&&this.K[e].length||0;var t=0;return f.a.D(this.K,function(e,i){"dirty"!==e&&(t+=i.length)}),t},tb:function(e,t){return!this.equalityComparer||!this.equalityComparer(e,t)},extend:function(e){var t=this;return e&&f.a.D(e,function(e,i){var r=f.ya[e];"function"==typeof r&&(t=r(t,i)||t)}),t}};f.G(v,"subscribe",v.X),f.G(v,"extend",v.extend),f.G(v,"getSubscriptionsCount",v.Sc),f.a.ka&&f.a.Xa(v,Function.prototype),f.J.fn=v,f.hc=function(e){return null!=e&&"function"==typeof e.X&&"function"==typeof e.notifySubscribers; +},f.b("subscribable",f.J),f.b("isSubscribable",f.hc),f.va=f.l=function(){function e(e){r.push(i),i=e}function t(){i=r.pop()}var i,r=[],n=0;return{Ub:e,end:t,oc:function(e){if(i){if(!f.hc(e))throw Error("Only subscribable things can act as dependencies");i.gb.call(i.Gc,e,e.Cc||(e.Cc=++n))}},w:function(i,r,n){try{return e(),i.apply(r,n||[])}finally{t()}},Aa:function(){if(i)return i.m.Aa()},Sa:function(){if(i)return i.Sa}}}(),f.b("computedContext",f.va),f.b("computedContext.getDependenciesCount",f.va.Aa),f.b("computedContext.isInitial",f.va.Sa),f.b("ignoreDependencies",f.qd=f.l.w);var y=f.a.Yb("_latestValue");f.N=function(e){function t(){return 0<arguments.length?(t.tb(t[y],arguments[0])&&(t.ga(),t[y]=arguments[0],t.fa()),this):(f.l.oc(t),t[y])}return t[y]=e,f.a.ka||f.a.extend(t,f.J.fn),f.J.fn.rb(t),f.a.Ya(t,C),f.options.deferUpdates&&f.ya.deferred(t,!0),t};var C={equalityComparer:l,t:function(){return this[y]},fa:function(){this.notifySubscribers(this[y])},ga:function(){this.notifySubscribers(this[y],"beforeChange")}};f.a.ka&&f.a.Xa(C,f.J.fn);var w=f.N.gd="__ko_proto__";C[w]=f.N,f.Oa=function(t,i){return null!==t&&t!==e&&t[w]!==e&&(t[w]===i||f.Oa(t[w],i))},f.H=function(e){return f.Oa(e,f.N)},f.Ba=function(e){return!!("function"==typeof e&&e[w]===f.N||"function"==typeof e&&e[w]===f.B&&e.Vc)},f.b("observable",f.N),f.b("isObservable",f.H),f.b("isWriteableObservable",f.Ba),f.b("isWritableObservable",f.Ba),f.b("observable.fn",C),f.G(C,"peek",C.t),f.G(C,"valueHasMutated",C.fa),f.G(C,"valueWillMutate",C.ga),f.la=function(e){if(e=e||[],"object"!=typeof e||!("length"in e))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");return e=f.N(e),f.a.Ya(e,f.la.fn),e.extend({trackArrayChanges:!0})},f.la.fn={remove:function(e){for(var t=this.t(),i=[],r="function"!=typeof e||f.H(e)?function(t){return t===e}:e,n=0;n<t.length;n++){var o=t[n];r(o)&&(0===i.length&&this.ga(),i.push(o),t.splice(n,1),n--)}return i.length&&this.fa(),i},removeAll:function(t){if(t===e){var i=this.t(),r=i.slice(0);return this.ga(),i.splice(0,i.length),this.fa(),r}return t?this.remove(function(e){return 0<=f.a.o(t,e)}):[]},destroy:function(e){var t=this.t(),i="function"!=typeof e||f.H(e)?function(t){return t===e}:e;this.ga();for(var r=t.length-1;0<=r;r--)i(t[r])&&(t[r]._destroy=!0);this.fa()},destroyAll:function(t){return t===e?this.destroy(function(){return!0}):t?this.destroy(function(e){return 0<=f.a.o(t,e)}):[]},indexOf:function(e){var t=this();return f.a.o(t,e)},replace:function(e,t){var i=this.indexOf(e);0<=i&&(this.ga(),this.t()[i]=t,this.fa())}},f.a.ka&&f.a.Xa(f.la.fn,f.N.fn),f.a.q("pop push reverse shift sort splice unshift".split(" "),function(e){f.la.fn[e]=function(){var t=this.t();this.ga(),this.Vb(t,e,arguments);var i=t[e].apply(t,arguments);return this.fa(),i===t?this:i}}),f.a.q(["slice"],function(e){f.la.fn[e]=function(){var t=this();return t[e].apply(t,arguments)}}),f.b("observableArray",f.la),f.ya.trackArrayChanges=function(e,t){function i(){if(!n){n=!0;var t=e.notifySubscribers;e.notifySubscribers=function(e,i){return i&&i!==g||++a,t.apply(this,arguments)};var i=[].concat(e.t()||[]);o=null,r=e.X(function(t){if(t=[].concat(t||[]),e.Pa("arrayChange")){var r;(!o||1<a)&&(o=f.a.ib(i,t,e.hb)),r=o}i=t,o=null,a=0,r&&r.length&&e.notifySubscribers(r,"arrayChange")})}}if(e.hb={},t&&"object"==typeof t&&f.a.extend(e.hb,t),e.hb.sparse=!0,!e.Vb){var r,n=!1,o=null,a=0,s=e.sa,l=e.Ia;e.sa=function(t){s&&s.call(e,t),"arrayChange"===t&&i()},e.Ia=function(t){l&&l.call(e,t),"arrayChange"!==t||e.Pa("arrayChange")||(r.k(),n=!1)},e.Vb=function(e,t,i){function r(e,t,i){return s[s.length]={status:e,value:t,index:i}}if(n&&!a){var s=[],l=e.length,u=i.length,c=0;switch(t){case"push":c=l;case"unshift":for(t=0;t<u;t++)r("added",i[t],c+t);break;case"pop":c=l-1;case"shift":l&&r("deleted",e[c],c);break;case"splice":t=Math.min(Math.max(0,0>i[0]?l+i[0]:i[0]),l);for(var l=1===u?l:Math.min(t+(i[1]||0),l),u=t+u-2,c=Math.max(l,u),h=[],d=[],p=2;t<c;++t,++p)t<l&&d.push(r("deleted",e[t],t)),t<u&&h.push(r("added",i[p],t));f.a.dc(d,h);break;default:return}o=s}}}};var S=f.a.Yb("_state");f.m=f.B=function(t,i,r){function n(){if(0<arguments.length){if("function"!=typeof o)throw Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.");return o.apply(a.pb,arguments),this}return f.l.oc(n),(a.S||a.s&&n.Qa())&&n.aa(),a.T}if("object"==typeof t?r=t:(r=r||{},t&&(r.read=t)),"function"!=typeof r.read)throw Error("Pass a function that returns the value of the ko.computed");var o=r.write,a={T:e,S:!0,Ra:!1,Fb:!1,R:!1,Va:!1,s:!1,jd:r.read,pb:i||r.owner,i:r.disposeWhenNodeIsRemoved||r.i||null,wa:r.disposeWhen||r.wa,mb:null,r:{},L:0,bc:null};return n[S]=a,n.Vc="function"==typeof o,f.a.ka||f.a.extend(n,f.J.fn),f.J.fn.rb(n),f.a.Ya(n,E),r.pure?(a.Va=!0,a.s=!0,f.a.extend(n,b)):r.deferEvaluation&&f.a.extend(n,T),f.options.deferUpdates&&f.ya.deferred(n,!0),a.i&&(a.Fb=!0,a.i.nodeType||(a.i=null)),a.s||r.deferEvaluation||n.aa(),a.i&&n.ba()&&f.a.F.oa(a.i,a.mb=function(){n.k()}),n};var E={equalityComparer:l,Aa:function(){return this[S].L},Pb:function(e,t,i){if(this[S].Va&&t===this)throw Error("A 'pure' computed must not be called recursively");this[S].r[e]=i,i.Ga=this[S].L++,i.na=t.Na()},Qa:function(){var e,t,i=this[S].r;for(e in i)if(i.hasOwnProperty(e)&&(t=i[e],t.ia.Uc(t.na)))return!0},bd:function(){this.Fa&&!this[S].Ra&&this.Fa()},ba:function(){return this[S].S||0<this[S].L},ld:function(){this.Mb||this.ac()},uc:function(e){if(e.cb&&!this[S].i){var t=e.X(this.bd,this,"dirty"),i=e.X(this.ld,this);return{ia:e,k:function(){t.k(),i.k()}}}return e.X(this.ac,this)},ac:function(){var e=this,t=e.throttleEvaluation;t&&0<=t?(clearTimeout(this[S].bc),this[S].bc=f.a.setTimeout(function(){e.aa(!0)},t)):e.Fa?e.Fa():e.aa(!0)},aa:function(e){var t=this[S],i=t.wa;if(!t.Ra&&!t.R){if(t.i&&!f.a.nb(t.i)||i&&i()){if(!t.Fb)return void this.k()}else t.Fb=!1;t.Ra=!0;try{this.Qc(e)}finally{t.Ra=!1}t.L||this.k()}},Qc:function(t){var i=this[S],r=i.Va?e:!i.L,n={Hc:this,Ma:i.r,lb:i.L};f.l.Ub({Gc:n,gb:p,m:this,Sa:r}),i.r={},i.L=0,n=this.Pc(i,n),this.tb(i.T,n)&&(i.s||this.notifySubscribers(i.T,"beforeChange"),i.T=n,i.s?this.zc():t&&this.notifySubscribers(i.T)),r&&this.notifySubscribers(i.T,"awake")},Pc:function(e,t){try{var i=e.jd;return e.pb?i.call(e.pb):i()}finally{f.l.end(),t.lb&&!e.s&&f.a.D(t.Ma,d),e.S=!1}},t:function(){var e=this[S];return(e.S&&!e.L||e.s&&this.Qa())&&this.aa(),e.T},Ta:function(e){f.J.fn.Ta.call(this,e),this.Fa=function(){this.Kb(this[S].T),this[S].S=!0,this.Lb(this)}},k:function(){var e=this[S];!e.s&&e.r&&f.a.D(e.r,function(e,t){t.k&&t.k()}),e.i&&e.mb&&f.a.F.pc(e.i,e.mb),e.r=null,e.L=0,e.R=!0,e.S=!1,e.s=!1,e.i=null}},b={sa:function(e){var t=this,i=t[S];if(!i.R&&i.s&&"change"==e){if(i.s=!1,i.S||t.Qa())i.r=null,i.L=0,i.S=!0,t.aa();else{var r=[];f.a.D(i.r,function(e,t){r[t.Ga]=e}),f.a.q(r,function(e,r){var n=i.r[e],o=t.uc(n.ia);o.Ga=r,o.na=n.na,i.r[e]=o})}i.R||t.notifySubscribers(i.T,"awake")}},Ia:function(t){var i=this[S];i.R||"change"!=t||this.Pa("change")||(f.a.D(i.r,function(e,t){t.k&&(i.r[e]={ia:t.ia,Ga:t.Ga,na:t.na},t.k())}),i.s=!0,this.notifySubscribers(e,"asleep"))},Na:function(){var e=this[S];return e.s&&(e.S||this.Qa())&&this.aa(),f.J.fn.Na.call(this)}},T={sa:function(e){"change"!=e&&"beforeChange"!=e||this.t()}};f.a.ka&&f.a.Xa(E,f.J.fn);var x=f.N.gd;f.m[x]=f.N,E[x]=f.m,f.Xc=function(e){return f.Oa(e,f.m)},f.Yc=function(e){return f.Oa(e,f.m)&&e[S]&&e[S].Va},f.b("computed",f.m),f.b("dependentObservable",f.m),f.b("isComputed",f.Xc),f.b("isPureComputed",f.Yc),f.b("computed.fn",E),f.G(E,"peek",E.t),f.G(E,"dispose",E.k),f.G(E,"isActive",E.ba),f.G(E,"getDependenciesCount",E.Aa),f.nc=function(e,t){return"function"==typeof e?f.m(e,t,{pure:!0}):(e=f.a.extend({},e),e.pure=!0,f.m(e,t))},f.b("pureComputed",f.nc),function(){function t(n,o,a){if(a=a||new r,n=o(n),"object"!=typeof n||null===n||n===e||n instanceof RegExp||n instanceof Date||n instanceof String||n instanceof Number||n instanceof Boolean)return n;var s=n instanceof Array?[]:{};return a.save(n,s),i(n,function(i){var r=o(n[i]);switch(typeof r){case"boolean":case"number":case"string":case"function":s[i]=r;break;case"object":case"undefined":var l=a.get(r);s[i]=l!==e?l:t(r,o,a)}}),s}function i(e,t){if(e instanceof Array){for(var i=0;i<e.length;i++)t(i);"function"==typeof e.toJSON&&t("toJSON")}else for(i in e)t(i)}function r(){this.keys=[],this.Ib=[]}f.wc=function(e){if(0==arguments.length)throw Error("When calling ko.toJS, pass the object you want to convert.");return t(e,function(e){for(var t=0;f.H(e)&&10>t;t++)e=e();return e})},f.toJSON=function(e,t,i){return e=f.wc(e),f.a.Eb(e,t,i)},r.prototype={save:function(e,t){var i=f.a.o(this.keys,e);0<=i?this.Ib[i]=t:(this.keys.push(e),this.Ib.push(t))},get:function(t){return t=f.a.o(this.keys,t),0<=t?this.Ib[t]:e}}}(),f.b("toJS",f.wc),f.b("toJSON",f.toJSON),function(){f.j={u:function(t){switch(f.a.A(t)){case"option":return!0===t.__ko__hasDomDataOptionValue__?f.a.e.get(t,f.d.options.xb):7>=f.a.C?t.getAttributeNode("value")&&t.getAttributeNode("value").specified?t.value:t.text:t.value;case"select":return 0<=t.selectedIndex?f.j.u(t.options[t.selectedIndex]):e;default:return t.value}},ha:function(t,i,r){switch(f.a.A(t)){case"option":switch(typeof i){case"string":f.a.e.set(t,f.d.options.xb,e),"__ko__hasDomDataOptionValue__"in t&&delete t.__ko__hasDomDataOptionValue__,t.value=i;break;default:f.a.e.set(t,f.d.options.xb,i),t.__ko__hasDomDataOptionValue__=!0,t.value="number"==typeof i?i:""}break;case"select":""!==i&&null!==i||(i=e);for(var n,o=-1,a=0,s=t.options.length;a<s;++a)if(n=f.j.u(t.options[a]),n==i||""==n&&i===e){o=a;break}(r||0<=o||i===e&&1<t.size)&&(t.selectedIndex=o);break;default:null!==i&&i!==e||(i=""),t.value=i}}}}(),f.b("selectExtensions",f.j),f.b("selectExtensions.readValue",f.j.u),f.b("selectExtensions.writeValue",f.j.ha),f.h=function(){function e(e){e=f.a.$a(e),123===e.charCodeAt(0)&&(e=e.slice(1,-1));var t,i=[],a=e.match(r),s=[],l=0;if(a){a.push(",");for(var u,c=0;u=a[c];++c){var h=u.charCodeAt(0);if(44===h){if(0>=l){i.push(t&&s.length?{key:t,value:s.join("")}:{unknown:t||s.join("")}),t=l=0,s=[];continue}}else if(58===h){if(!l&&!t&&1===s.length){t=s.pop();continue}}else 47===h&&c&&1<u.length?(h=a[c-1].match(n))&&!o[h[0]]&&(e=e.substr(e.indexOf(u)+1),a=e.match(r),a.push(","),c=-1,u="/"):40===h||123===h||91===h?++l:41===h||125===h||93===h?--l:t||s.length||34!==h&&39!==h||(u=u.slice(1,-1));s.push(u)}}return i}var t=["true","false","null","undefined"],i=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,r=RegExp("\"(?:[^\"\\\\]|\\\\.)*\"|'(?:[^'\\\\]|\\\\.)*'|/(?:[^/\\\\]|\\\\.)*/w*|[^\\s:,/][^,\"'{}()/:[\\]]*[^\\s,\"'{}()/:[\\]]|[^\\s]","g"),n=/[\])"'A-Za-z0-9_$]+$/,o={in:1,return:1,typeof:1},a={};return{ta:[],ea:a,yb:e,Ua:function(r,n){function o(e,r){var n;if(!c){var h=f.getBindingHandler(e);if(h&&h.preprocess&&!(r=h.preprocess(r,e,o)))return;(h=a[e])&&(n=r,0<=f.a.o(t,n)?n=!1:(h=n.match(i),n=null!==h&&(h[1]?"Object("+h[1]+")"+h[2]:n)),h=n),h&&l.push("'"+e+"':function(_z){"+n+"=_z}")}u&&(r="function(){return "+r+" }"),s.push("'"+e+"':"+r)}n=n||{};var s=[],l=[],u=n.valueAccessors,c=n.bindingParams,h="string"==typeof r?e(r):r;return f.a.q(h,function(e){o(e.key||e.unknown,e.value)}),l.length&&o("_ko_property_writers","{"+l.join(",")+" }"),s.join(",")},ad:function(e,t){for(var i=0;i<e.length;i++)if(e[i].key==t)return!0;return!1},Ea:function(e,t,i,r,n){e&&f.H(e)?!f.Ba(e)||n&&e.t()===r||e(r):(e=t.get("_ko_property_writers"))&&e[i]&&e[i](r)}}}(),f.b("expressionRewriting",f.h),f.b("expressionRewriting.bindingRewriteValidators",f.h.ta),f.b("expressionRewriting.parseObjectLiteral",f.h.yb),f.b("expressionRewriting.preProcessBindings",f.h.Ua),f.b("expressionRewriting._twoWayBindings",f.h.ea),f.b("jsonExpressionRewriting",f.h),f.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",f.h.Ua),function(){function e(e){return 8==e.nodeType&&a.test(o?e.text:e.nodeValue)}function t(e){return 8==e.nodeType&&s.test(o?e.text:e.nodeValue)}function i(i,r){for(var n=i,o=1,a=[];n=n.nextSibling;){if(t(n)&&(o--,0===o))return a;a.push(n),e(n)&&o++}if(!r)throw Error("Cannot find closing comment tag to match: "+i.nodeValue);return null}function n(e,t){var r=i(e,t);return r?0<r.length?r[r.length-1].nextSibling:e.nextSibling:null}var o=r&&"<!--test-->"===r.createComment("test").text,a=o?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,s=o?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,l={ul:!0,ol:!0};f.f={Z:{},childNodes:function(t){return e(t)?i(t):t.childNodes},xa:function(t){if(e(t)){t=f.f.childNodes(t);for(var i=0,r=t.length;i<r;i++)f.removeNode(t[i])}else f.a.ob(t)},da:function(t,i){if(e(t)){f.f.xa(t);for(var r=t.nextSibling,n=0,o=i.length;n<o;n++)r.parentNode.insertBefore(i[n],r)}else f.a.da(t,i)},mc:function(t,i){e(t)?t.parentNode.insertBefore(i,t.nextSibling):t.firstChild?t.insertBefore(i,t.firstChild):t.appendChild(i)},gc:function(t,i,r){r?e(t)?t.parentNode.insertBefore(i,r.nextSibling):r.nextSibling?t.insertBefore(i,r.nextSibling):t.appendChild(i):f.f.mc(t,i)},firstChild:function(i){return e(i)?!i.nextSibling||t(i.nextSibling)?null:i.nextSibling:i.firstChild},nextSibling:function(i){return e(i)&&(i=n(i)),i.nextSibling&&t(i.nextSibling)?null:i.nextSibling},Tc:e,pd:function(e){return(e=(o?e.text:e.nodeValue).match(a))?e[1]:null},kc:function(i){if(l[f.a.A(i)]){var r=i.firstChild;if(r)do if(1===r.nodeType){var o;o=r.firstChild;var a=null;if(o)do if(a)a.push(o);else if(e(o)){var s=n(o,!0);s?o=s:a=[o]}else t(o)&&(a=[o]);while(o=o.nextSibling);if(o=a)for(a=r.nextSibling,s=0;s<o.length;s++)a?i.insertBefore(o[s],a):i.appendChild(o[s])}while(r=r.nextSibling)}}}}(),f.b("virtualElements",f.f),f.b("virtualElements.allowedBindings",f.f.Z),f.b("virtualElements.emptyNode",f.f.xa),f.b("virtualElements.insertAfter",f.f.gc),f.b("virtualElements.prepend",f.f.mc),f.b("virtualElements.setDomNodeChildren",f.f.da),function(){f.Q=function(){this.Fc={}},f.a.extend(f.Q.prototype,{nodeHasBindings:function(e){switch(e.nodeType){case 1:return null!=e.getAttribute("data-bind")||f.g.getComponentNameForNode(e);case 8:return f.f.Tc(e);default:return!1}},getBindings:function(e,t){var i=this.getBindingsString(e,t),i=i?this.parseBindingsString(i,t,e):null;return f.g.Ob(i,e,t,!1)},getBindingAccessors:function(e,t){var i=this.getBindingsString(e,t),i=i?this.parseBindingsString(i,t,e,{valueAccessors:!0}):null;return f.g.Ob(i,e,t,!0)},getBindingsString:function(e){switch(e.nodeType){case 1:return e.getAttribute("data-bind");case 8:return f.f.pd(e);default:return null}},parseBindingsString:function(e,t,i,r){try{var n,o=this.Fc,a=e+(r&&r.valueAccessors||"");if(!(n=o[a])){var s,l="with($context){with($data||{}){return{"+f.h.Ua(e,r)+"}}}";s=new Function("$context","$element",l),n=o[a]=s}return n(t,i)}catch(t){throw t.message="Unable to parse bindings.\nBindings value: "+e+"\nMessage: "+t.message,t}}}),f.Q.instance=new f.Q}(),f.b("bindingProvider",f.Q),function(){function i(e){return function(){return e}}function r(e){return e()}function n(e){return f.a.Ca(f.l.w(e),function(t,i){return function(){return e()[i]}})}function a(e,t,r){return"function"==typeof e?n(e.bind(null,t,r)):f.a.Ca(e,i)}function s(e,t){return n(this.getBindings.bind(this,e,t))}function l(e,t,i){var r,n=f.f.firstChild(t),o=f.Q.instance,a=o.preprocessNode;if(a){for(;r=n;)n=f.f.nextSibling(r),a.call(o,r);n=f.f.firstChild(t)}for(;r=n;)n=f.f.nextSibling(r),u(e,r,i)}function u(e,t,i){var r=!0,n=1===t.nodeType;n&&f.f.kc(t),(n&&i||f.Q.instance.nodeHasBindings(t))&&(r=h(t,null,e,i).shouldBindDescendants),r&&!p[f.a.A(t)]&&l(e,t,!n)}function c(e){var t=[],i={},r=[];return f.a.D(e,function n(o){if(!i[o]){var a=f.getBindingHandler(o);a&&(a.after&&(r.push(o),f.a.q(a.after,function(t){if(e[t]){if(-1!==f.a.o(r,t))throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+r.join(", "));n(t)}}),r.length--),t.push({key:o,fc:a})),i[o]=!0}}),t}function h(t,i,n,o){var a=f.a.e.get(t,m);if(!i){if(a)throw Error("You cannot apply bindings multiple times to the same element.");f.a.e.set(t,m,!0)}!a&&o&&f.tc(t,n);var l;if(i&&"function"!=typeof i)l=i;else{var u=f.Q.instance,h=u.getBindingAccessors||s,d=f.B(function(){return(l=i?i(n,t):h.call(u,t,n))&&n.P&&n.P(),l},null,{i:t});l&&d.ba()||(d=null)}var p;if(l){var _=d?function(e){return function(){return r(d()[e])}}:function(e){return l[e]},g=function(){return f.a.Ca(d?d():l,r)};g.get=function(e){return l[e]&&r(_(e))},g.has=function(e){return e in l},o=c(l),f.a.q(o,function(i){var r=i.fc.init,o=i.fc.update,a=i.key;if(8===t.nodeType&&!f.f.Z[a])throw Error("The binding '"+a+"' cannot be used with virtual elements");try{"function"==typeof r&&f.l.w(function(){var i=r(t,_(a),g,n.$data,n);if(i&&i.controlsDescendantBindings){if(p!==e)throw Error("Multiple bindings ("+p+" and "+a+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");p=a}}),"function"==typeof o&&f.B(function(){o(t,_(a),g,n.$data,n)},null,{i:t})}catch(e){throw e.message='Unable to process binding "'+a+": "+l[a]+'"\nMessage: '+e.message,e}})}return{shouldBindDescendants:p===e}}function d(e){return e&&e instanceof f.U?e:new f.U(e)}f.d={};var p={script:!0,textarea:!0,template:!0};f.getBindingHandler=function(e){return f.d[e]},f.U=function(t,i,r,n){var o,a=this,s="function"==typeof t&&!f.H(t),l=f.B(function(){var e=s?t():t,o=f.a.c(e);return i?(i.P&&i.P(),f.a.extend(a,i),l&&(a.P=l)):(a.$parents=[],a.$root=o,a.ko=f),a.$rawData=e,a.$data=o,r&&(a[r]=o),n&&n(a,i,o),a.$data},null,{wa:function(){return o&&!f.a.Qb(o)},i:!0});l.ba()&&(a.P=l,l.equalityComparer=null,o=[],l.Ac=function(t){o.push(t),f.a.F.oa(t,function(t){f.a.La(o,t),o.length||(l.k(),a.P=l=e)})})},f.U.prototype.createChildContext=function(e,t,i){return new f.U(e,this,t,function(e,t){e.$parentContext=t,e.$parent=t.$data,e.$parents=(t.$parents||[]).slice(0),e.$parents.unshift(e.$parent),i&&i(e)})},f.U.prototype.extend=function(e){return new f.U(this.P||this.$data,this,null,function(t,i){t.$rawData=i.$rawData,f.a.extend(t,"function"==typeof e?e():e)})};var m=f.a.e.I(),_=f.a.e.I();f.tc=function(e,t){return 2!=arguments.length?f.a.e.get(e,_):(f.a.e.set(e,_,t),void(t.P&&t.P.Ac(e)))},f.Ja=function(e,t,i){return 1===e.nodeType&&f.f.kc(e),h(e,t,d(i),!0)},f.Dc=function(e,t,i){return i=d(i),f.Ja(e,a(t,i,e),i)},f.eb=function(e,t){1!==t.nodeType&&8!==t.nodeType||l(d(e),t,!0)},f.Rb=function(e,i){if(!o&&t.jQuery&&(o=t.jQuery),i&&1!==i.nodeType&&8!==i.nodeType)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");i=i||t.document.body,u(d(e),i,!0)},f.kb=function(t){switch(t.nodeType){case 1:case 8:var i=f.tc(t);if(i)return i;if(t.parentNode)return f.kb(t.parentNode)}return e},f.Jc=function(t){return(t=f.kb(t))?t.$data:e},f.b("bindingHandlers",f.d),f.b("applyBindings",f.Rb),f.b("applyBindingsToDescendants",f.eb),f.b("applyBindingAccessorsToNode",f.Ja),f.b("applyBindingsToNode",f.Dc),f.b("contextFor",f.kb),f.b("dataFor",f.Jc)}(),function(e){function t(t,r){var a,s=n.hasOwnProperty(t)?n[t]:e;s?s.X(r):(s=n[t]=new f.J,s.X(r),i(t,function(e,i){var r=!(!i||!i.synchronous);o[t]={definition:e,Zc:r},delete n[t],a||r?s.notifySubscribers(e):f.Y.Wa(function(){s.notifySubscribers(e)})}),a=!0)}function i(e,t){r("getConfig",[e],function(i){i?r("loadComponent",[e,i],function(e){t(e,i)}):t(null,null)})}function r(t,i,n,o){o||(o=f.g.loaders.slice(0));var a=o.shift();if(a){var s=a[t];if(s){var l=!1;if(s.apply(a,i.concat(function(e){l?n(null):null!==e?n(e):r(t,i,n,o)}))!==e&&(l=!0,!a.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else r(t,i,n,o)}else n(null)}var n={},o={};f.g={get:function(i,r){var n=o.hasOwnProperty(i)?o[i]:e;n?n.Zc?f.l.w(function(){r(n.definition)}):f.Y.Wa(function(){r(n.definition)}):t(i,r)},Xb:function(e){delete o[e]},Jb:r},f.g.loaders=[],f.b("components",f.g),f.b("components.get",f.g.get),f.b("components.clearCachedDefinition",f.g.Xb)}(),function(){function e(e,t,i,r){function n(){0===--s&&r(o)}var o={},s=2,l=i.template;i=i.viewModel,l?a(t,l,function(t){f.g.Jb("loadTemplate",[e,t],function(e){o.template=e,n()})}):n(),i?a(t,i,function(t){f.g.Jb("loadViewModel",[e,t],function(e){o[c]=e,n()})}):n()}function i(e,t,r){if("function"==typeof t)r(function(e){return new t(e)});else if("function"==typeof t[c])r(t[c]);else if("instance"in t){var n=t.instance;r(function(){return n})}else"viewModel"in t?i(e,t.viewModel,r):e("Unknown viewModel value: "+t)}function n(e){switch(f.a.A(e)){case"script":return f.a.ma(e.text);case"textarea":return f.a.ma(e.value);case"template":if(o(e.content))return f.a.ua(e.content.childNodes)}return f.a.ua(e.childNodes)}function o(e){return t.DocumentFragment?e instanceof DocumentFragment:e&&11===e.nodeType}function a(e,i,r){"string"==typeof i.require?s||t.require?(s||t.require)([i.require],r):e("Uses require, but no AMD loader is present"):r(i)}function l(e){return function(t){throw Error("Component '"+e+"': "+t)}}var u={};f.g.register=function(e,t){if(!t)throw Error("Invalid configuration for "+e);if(f.g.ub(e))throw Error("Component "+e+" is already registered");u[e]=t},f.g.ub=function(e){return u.hasOwnProperty(e)},f.g.od=function(e){delete u[e],f.g.Xb(e)},f.g.Zb={getConfig:function(e,t){t(u.hasOwnProperty(e)?u[e]:null)},loadComponent:function(t,i,r){var n=l(t);a(n,i,function(i){e(t,n,i,r)})},loadTemplate:function(e,i,a){if(e=l(e),"string"==typeof i)a(f.a.ma(i));else if(i instanceof Array)a(i);else if(o(i))a(f.a.V(i.childNodes));else if(i.element)if(i=i.element,t.HTMLElement?i instanceof HTMLElement:i&&i.tagName&&1===i.nodeType)a(n(i));else if("string"==typeof i){var s=r.getElementById(i);s?a(n(s)):e("Cannot find element with ID "+i)}else e("Unknown element type: "+i);else e("Unknown template value: "+i)},loadViewModel:function(e,t,r){i(l(e),t,r)}};var c="createViewModel";f.b("components.register",f.g.register),f.b("components.isRegistered",f.g.ub),f.b("components.unregister",f.g.od),f.b("components.defaultLoader",f.g.Zb),f.g.loaders.push(f.g.Zb),f.g.Bc=u}(),function(){function e(e,i){var r=e.getAttribute("params");if(r){var r=t.parseBindingsString(r,i,e,{valueAccessors:!0,bindingParams:!0}),r=f.a.Ca(r,function(t){return f.m(t,null,{i:e})}),n=f.a.Ca(r,function(t){var i=t.t();return t.ba()?f.m({read:function(){return f.a.c(t())},write:f.Ba(i)&&function(e){t()(e)},i:e}):i});return n.hasOwnProperty("$raw")||(n.$raw=r),n}return{$raw:{}}}f.g.getComponentNameForNode=function(e){var t=f.a.A(e);if(f.g.ub(t)&&(-1!=t.indexOf("-")||"[object HTMLUnknownElement]"==""+e||8>=f.a.C&&e.tagName===t))return t},f.g.Ob=function(t,i,r,n){if(1===i.nodeType){var o=f.g.getComponentNameForNode(i);if(o){if(t=t||{},t.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var a={name:o,params:e(i,r)};t.component=n?function(){return a}:a}}return t};var t=new f.Q;9>f.a.C&&(f.g.register=function(e){return function(t){return r.createElement(t),e.apply(this,arguments)}}(f.g.register),r.createDocumentFragment=function(e){return function(){var t,i=e(),r=f.g.Bc;for(t in r)r.hasOwnProperty(t)&&i.createElement(t);return i}}(r.createDocumentFragment))}(),function(e){function t(e,t,i){if(t=t.template,!t)throw Error("Component '"+e+"' has no template");e=f.a.ua(t),f.f.da(i,e)}function i(e,t,i,r){var n=e.createViewModel;return n?n.call(e,r,{element:t,templateNodes:i}):r}var r=0;f.d.component={init:function(n,o,a,s,l){function u(){var e=c&&c.dispose;"function"==typeof e&&e.call(c),h=c=null}var c,h,d=f.a.V(f.f.childNodes(n));return f.a.F.oa(n,u),f.m(function(){var a,s,p=f.a.c(o());if("string"==typeof p?a=p:(a=f.a.c(p.name),s=f.a.c(p.params)),!a)throw Error("No component name specified");var m=h=++r;f.g.get(a,function(r){if(h===m){if(u(),!r)throw Error("Unknown component '"+a+"'");t(a,r,n);var o=i(r,n,d,s);r=l.createChildContext(o,e,function(e){e.$component=o,e.$componentTemplateNodes=d}),c=o,f.eb(r,n)}})},null,{i:n}),{controlsDescendantBindings:!0}}},f.f.Z.component=!0}();var A={class:"className",for:"htmlFor"};f.d.attr={update:function(t,i){var r=f.a.c(i())||{};f.a.D(r,function(i,r){r=f.a.c(r);var n=!1===r||null===r||r===e;n&&t.removeAttribute(i),8>=f.a.C&&i in A?(i=A[i],n?t.removeAttribute(i):t[i]=r):n||t.setAttribute(i,r.toString()),"name"===i&&f.a.rc(t,n?"":r.toString())})}},function(){f.d.checked={after:["value","attr"],init:function(t,i,r){function n(){var e=t.checked,n=p?a():e;if(!f.va.Sa()&&(!l||e)){var o=f.l.w(i);if(c){var s=h?o.t():o;d!==n?(e&&(f.a.pa(s,n,!0),f.a.pa(s,d,!1)),d=n):f.a.pa(s,n,e),h&&f.Ba(o)&&o(s)}else f.h.Ea(o,r,"checked",n,!0)}}function o(){var e=f.a.c(i());t.checked=c?0<=f.a.o(e,a()):s?e:a()===e}var a=f.nc(function(){return r.has("checkedValue")?f.a.c(r.get("checkedValue")):r.has("value")?f.a.c(r.get("value")):t.value}),s="checkbox"==t.type,l="radio"==t.type;if(s||l){var u=i(),c=s&&f.a.c(u)instanceof Array,h=!(c&&u.push&&u.splice),d=c?a():e,p=l||c;l&&!t.name&&f.d.uniqueName.init(t,function(){return!0}),f.m(n,null,{i:t}),f.a.p(t,"click",n),f.m(o,null,{i:t}),u=e}}},f.h.ea.checked=!0,f.d.checkedValue={update:function(e,t){e.value=f.a.c(t())}}}(),f.d.css={update:function(e,t){var i=f.a.c(t());null!==i&&"object"==typeof i?f.a.D(i,function(t,i){i=f.a.c(i),f.a.bb(e,t,i)}):(i=f.a.$a(String(i||"")),f.a.bb(e,e.__ko__cssValue,!1),e.__ko__cssValue=i,f.a.bb(e,i,!0))}},f.d.enable={update:function(e,t){var i=f.a.c(t());i&&e.disabled?e.removeAttribute("disabled"):i||e.disabled||(e.disabled=!0)}},f.d.disable={update:function(e,t){f.d.enable.update(e,function(){return!f.a.c(t())})}},f.d.event={init:function(e,t,i,r,n){var o=t()||{};f.a.D(o,function(o){"string"==typeof o&&f.a.p(e,o,function(e){var a,s=t()[o];if(s){try{var l=f.a.V(arguments);r=n.$data,l.unshift(r),a=s.apply(r,l)}finally{!0!==a&&(e.preventDefault?e.preventDefault():e.returnValue=!1)}!1===i.get(o+"Bubble")&&(e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation())}})})}},f.d.foreach={ic:function(e){return function(){var t=e(),i=f.a.zb(t);return i&&"number"!=typeof i.length?(f.a.c(t),{foreach:i.data,as:i.as,includeDestroyed:i.includeDestroyed,afterAdd:i.afterAdd,beforeRemove:i.beforeRemove,afterRender:i.afterRender,beforeMove:i.beforeMove,afterMove:i.afterMove,templateEngine:f.W.sb}):{foreach:t,templateEngine:f.W.sb}}},init:function(e,t){return f.d.template.init(e,f.d.foreach.ic(t))},update:function(e,t,i,r,n){return f.d.template.update(e,f.d.foreach.ic(t),i,r,n)}},f.h.ta.foreach=!1,f.f.Z.foreach=!0,f.d.hasfocus={init:function(e,t,i){function r(r){e.__ko_hasfocusUpdating=!0;var n=e.ownerDocument;if("activeElement"in n){var o;try{o=n.activeElement}catch(e){o=n.body}r=o===e}n=t(),f.h.Ea(n,i,"hasfocus",r,!0),e.__ko_hasfocusLastValue=r,e.__ko_hasfocusUpdating=!1}var n=r.bind(null,!0),o=r.bind(null,!1);f.a.p(e,"focus",n),f.a.p(e,"focusin",n),f.a.p(e,"blur",o),f.a.p(e,"focusout",o)},update:function(e,t){var i=!!f.a.c(t());e.__ko_hasfocusUpdating||e.__ko_hasfocusLastValue===i||(i?e.focus():e.blur(),!i&&e.__ko_hasfocusLastValue&&e.ownerDocument.body.focus(),f.l.w(f.a.Da,null,[e,i?"focusin":"focusout"]))}},f.h.ea.hasfocus=!0,f.d.hasFocus=f.d.hasfocus,f.h.ea.hasFocus=!0,f.d.html={init:function(){return{controlsDescendantBindings:!0}},update:function(e,t){f.a.Cb(e,t())}},m("if"),m("ifnot",!1,!0),m("with",!0,!1,function(e,t){return e.createChildContext(t)});var P={};f.d.options={init:function(e){if("select"!==f.a.A(e))throw Error("options binding applies only to SELECT elements");for(;0<e.length;)e.remove(0);return{controlsDescendantBindings:!0}},update:function(t,i,r){function n(){return f.a.Ka(t.options,function(e){return e.selected})}function o(e,t,i){var r=typeof t;return"function"==r?t(e):"string"==r?e[t]:i}function a(e,i){if(m&&c)f.j.ha(t,f.a.c(r.get("value")),!0);else if(p.length){var n=0<=f.a.o(p,f.j.u(i[0]));f.a.sc(i[0],n),m&&!n&&f.l.w(f.a.Da,null,[t,"change"])}}var s=t.multiple,l=0!=t.length&&s?t.scrollTop:null,u=f.a.c(i()),c=r.get("valueAllowUnset")&&r.has("value"),h=r.get("optionsIncludeDestroyed");i={};var d,p=[];c||(s?p=f.a.fb(n(),f.j.u):0<=t.selectedIndex&&p.push(f.j.u(t.options[t.selectedIndex]))),u&&("undefined"==typeof u.length&&(u=[u]),d=f.a.Ka(u,function(t){return h||t===e||null===t||!f.a.c(t._destroy)}),r.has("optionsCaption")&&(u=f.a.c(r.get("optionsCaption")),null!==u&&u!==e&&d.unshift(P)));var m=!1;i.beforeRemove=function(e){t.removeChild(e)},u=a,r.has("optionsAfterRender")&&"function"==typeof r.get("optionsAfterRender")&&(u=function(t,i){a(0,i),f.l.w(r.get("optionsAfterRender"),null,[i[0],t!==P?t:e])}),f.a.Bb(t,d,function(i,n,a){return a.length&&(p=!c&&a[0].selected?[f.j.u(a[0])]:[],m=!0),n=t.ownerDocument.createElement("option"),i===P?(f.a.Za(n,r.get("optionsCaption")),f.j.ha(n,e)):(a=o(i,r.get("optionsValue"),i),f.j.ha(n,f.a.c(a)),i=o(i,r.get("optionsText"),a),f.a.Za(n,i)),[n]},i,u),f.l.w(function(){c?f.j.ha(t,f.a.c(r.get("value")),!0):(s?p.length&&n().length<p.length:p.length&&0<=t.selectedIndex?f.j.u(t.options[t.selectedIndex])!==p[0]:p.length||0<=t.selectedIndex)&&f.a.Da(t,"change")}),f.a.Nc(t),l&&20<Math.abs(l-t.scrollTop)&&(t.scrollTop=l)}},f.d.options.xb=f.a.e.I(),f.d.selectedOptions={after:["options","foreach"],init:function(e,t,i){f.a.p(e,"change",function(){var r=t(),n=[];f.a.q(e.getElementsByTagName("option"),function(e){e.selected&&n.push(f.j.u(e))}),f.h.Ea(r,i,"selectedOptions",n)})},update:function(e,t){if("select"!=f.a.A(e))throw Error("values binding applies only to SELECT elements");var i=f.a.c(t()),r=e.scrollTop;i&&"number"==typeof i.length&&f.a.q(e.getElementsByTagName("option"),function(e){var t=0<=f.a.o(i,f.j.u(e));e.selected!=t&&f.a.sc(e,t)}),e.scrollTop=r}},f.h.ea.selectedOptions=!0,f.d.style={update:function(t,i){var r=f.a.c(i()||{});f.a.D(r,function(i,r){r=f.a.c(r),null!==r&&r!==e&&!1!==r||(r=""),t.style[i]=r})}},f.d.submit={init:function(e,t,i,r,n){if("function"!=typeof t())throw Error("The value for a submit binding must be a function");f.a.p(e,"submit",function(i){var r,o=t();try{r=o.call(n.$data,e)}finally{!0!==r&&(i.preventDefault?i.preventDefault():i.returnValue=!1)}})}},f.d.text={init:function(){return{controlsDescendantBindings:!0}},update:function(e,t){f.a.Za(e,t())}},f.f.Z.text=!0,function(){if(t&&t.navigator)var i=function(e){if(e)return parseFloat(e[1])},r=t.opera&&t.opera.version&&parseInt(t.opera.version()),n=t.navigator.userAgent,o=i(n.match(/^(?:(?!chrome).)*version\/([^ ]*) safari/i)),a=i(n.match(/Firefox\/([^ ]*)/));if(10>f.a.C)var s=f.a.e.I(),l=f.a.e.I(),u=function(e){var t=this.activeElement;(t=t&&f.a.e.get(t,l))&&t(e)},c=function(e,t){var i=e.ownerDocument;f.a.e.get(i,s)||(f.a.e.set(i,s,!0),f.a.p(i,"selectionchange",u)),f.a.e.set(e,l,t)};f.d.textInput={init:function(t,i,n){function s(e,i){f.a.p(t,e,i)}function l(){var r=f.a.c(i());null!==r&&r!==e||(r=""),p!==e&&r===p?f.a.setTimeout(l,4):t.value!==r&&(m=r,t.value=r)}function u(){d||(p=t.value,d=f.a.setTimeout(h,4))}function h(){clearTimeout(d),p=d=e;var r=t.value;m!==r&&(m=r,f.h.Ea(i(),n,"textInput",r))}var d,p,m=t.value,_=9==f.a.C?u:h;10>f.a.C?(s("propertychange",function(e){"value"===e.propertyName&&_(e)}),8==f.a.C&&(s("keyup",h),s("keydown",h)),8<=f.a.C&&(c(t,_),s("dragend",u))):(s("input",h),5>o&&"textarea"===f.a.A(t)?(s("keydown",u),s("paste",u),s("cut",u)):11>r?s("keydown",u):4>a&&(s("DOMAutoComplete",h),s("dragdrop",h),s("drop",h))),s("change",h),f.m(l,null,{i:t})}},f.h.ea.textInput=!0,f.d.textinput={preprocess:function(e,t,i){i("textInput",e)}}}(),f.d.uniqueName={init:function(e,t){if(t()){var i="ko_unique_"+ ++f.d.uniqueName.Ic;f.a.rc(e,i)}}},f.d.uniqueName.Ic=0,f.d.value={after:["options","foreach"],init:function(e,t,i){if("input"!=e.tagName.toLowerCase()||"checkbox"!=e.type&&"radio"!=e.type){var r=["change"],n=i.get("valueUpdate"),o=!1,a=null;n&&("string"==typeof n&&(n=[n]),f.a.ra(r,n),r=f.a.Tb(r));var s=function(){a=null,o=!1;var r=t(),n=f.j.u(e); +f.h.Ea(r,i,"value",n)};!f.a.C||"input"!=e.tagName.toLowerCase()||"text"!=e.type||"off"==e.autocomplete||e.form&&"off"==e.form.autocomplete||-1!=f.a.o(r,"propertychange")||(f.a.p(e,"propertychange",function(){o=!0}),f.a.p(e,"focus",function(){o=!1}),f.a.p(e,"blur",function(){o&&s()})),f.a.q(r,function(t){var i=s;f.a.nd(t,"after")&&(i=function(){a=f.j.u(e),f.a.setTimeout(s,0)},t=t.substring(5)),f.a.p(e,t,i)});var l=function(){var r=f.a.c(t()),n=f.j.u(e);if(null!==a&&r===a)f.a.setTimeout(l,0);else if(r!==n)if("select"===f.a.A(e)){var o=i.get("valueAllowUnset"),n=function(){f.j.ha(e,r,o)};n(),o||r===f.j.u(e)?f.a.setTimeout(n,0):f.l.w(f.a.Da,null,[e,"change"])}else f.j.ha(e,r)};f.m(l,null,{i:e})}else f.Ja(e,{checkedValue:t})},update:function(){}},f.h.ea.value=!0,f.d.visible={update:function(e,t){var i=f.a.c(t()),r="none"!=e.style.display;i&&!r?e.style.display="":!i&&r&&(e.style.display="none")}},function(e){f.d[e]={init:function(t,i,r,n,o){return f.d.event.init.call(this,t,function(){var t={};return t[e]=i(),t},r,n,o)}}}("click"),f.O=function(){},f.O.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},f.O.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},f.O.prototype.makeTemplateSource=function(e,t){if("string"==typeof e){t=t||r;var i=t.getElementById(e);if(!i)throw Error("Cannot find template with ID "+e);return new f.v.n(i)}if(1==e.nodeType||8==e.nodeType)return new f.v.qa(e);throw Error("Unknown template type: "+e)},f.O.prototype.renderTemplate=function(e,t,i,r){return e=this.makeTemplateSource(e,r),this.renderTemplateSource(e,t,i,r)},f.O.prototype.isTemplateRewritten=function(e,t){return!1===this.allowTemplateRewriting||this.makeTemplateSource(e,t).data("isRewritten")},f.O.prototype.rewriteTemplate=function(e,t,i){e=this.makeTemplateSource(e,i),t=t(e.text()),e.text(t),e.data("isRewritten",!0)},f.b("templateEngine",f.O),f.Gb=function(){function e(e,t,i,r){e=f.h.yb(e);for(var n=f.h.ta,o=0;o<e.length;o++){var a=e[o].key;if(n.hasOwnProperty(a)){var s=n[a];if("function"==typeof s){if(a=s(e[o].value))throw Error(a)}else if(!s)throw Error("This template engine does not support the '"+a+"' binding within its templates")}}return i="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+f.h.Ua(e,{valueAccessors:!0})+" } })()},'"+i.toLowerCase()+"')",r.createJavaScriptEvaluatorBlock(i)+t}var t=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,i=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{Oc:function(e,t,i){t.isTemplateRewritten(e,i)||t.rewriteTemplate(e,function(e){return f.Gb.dd(e,t)},i)},dd:function(r,n){return r.replace(t,function(t,i,r,o,a){return e(a,i,r,n)}).replace(i,function(t,i){return e(i,"<!-- ko -->","#comment",n)})},Ec:function(e,t){return f.M.wb(function(i,r){var n=i.nextSibling;n&&n.nodeName.toLowerCase()===t&&f.Ja(n,e,r)})}}}(),f.b("__tr_ambtns",f.Gb.Ec),function(){f.v={},f.v.n=function(e){if(this.n=e){var t=f.a.A(e);this.ab="script"===t?1:"textarea"===t?2:"template"==t&&e.content&&11===e.content.nodeType?3:4}},f.v.n.prototype.text=function(){var e=1===this.ab?"text":2===this.ab?"value":"innerHTML";if(0==arguments.length)return this.n[e];var t=arguments[0];"innerHTML"===e?f.a.Cb(this.n,t):this.n[e]=t};var t=f.a.e.I()+"_";f.v.n.prototype.data=function(e){return 1===arguments.length?f.a.e.get(this.n,t+e):void f.a.e.set(this.n,t+e,arguments[1])};var i=f.a.e.I();f.v.n.prototype.nodes=function(){var t=this.n;return 0==arguments.length?(f.a.e.get(t,i)||{}).jb||(3===this.ab?t.content:4===this.ab?t:e):void f.a.e.set(t,i,{jb:arguments[0]})},f.v.qa=function(e){this.n=e},f.v.qa.prototype=new f.v.n,f.v.qa.prototype.text=function(){if(0==arguments.length){var t=f.a.e.get(this.n,i)||{};return t.Hb===e&&t.jb&&(t.Hb=t.jb.innerHTML),t.Hb}f.a.e.set(this.n,i,{Hb:arguments[0]})},f.b("templateSources",f.v),f.b("templateSources.domElement",f.v.n),f.b("templateSources.anonymousTemplate",f.v.qa)}(),function(){function t(e,t,i){var r;for(t=f.f.nextSibling(t);e&&(r=e)!==t;)e=f.f.nextSibling(r),i(r,e)}function i(e,i){if(e.length){var r=e[0],n=e[e.length-1],o=r.parentNode,a=f.Q.instance,s=a.preprocessNode;if(s){if(t(r,n,function(e,t){var i=e.previousSibling,o=s.call(a,e);o&&(e===r&&(r=o[0]||t),e===n&&(n=o[o.length-1]||i))}),e.length=0,!r)return;r===n?e.push(r):(e.push(r,n),f.a.za(e,o))}t(r,n,function(e){1!==e.nodeType&&8!==e.nodeType||f.Rb(i,e)}),t(r,n,function(e){1!==e.nodeType&&8!==e.nodeType||f.M.yc(e,[i])}),f.a.za(e,o)}}function r(e){return e.nodeType?e:0<e.length?e[0]:null}function n(e,t,n,o,s){s=s||{};var l=(e&&r(e)||n||{}).ownerDocument,u=s.templateEngine||a;if(f.Gb.Oc(n,u,l),n=u.renderTemplate(n,o,s,l),"number"!=typeof n.length||0<n.length&&"number"!=typeof n[0].nodeType)throw Error("Template engine must return an array of DOM nodes");switch(l=!1,t){case"replaceChildren":f.f.da(e,n),l=!0;break;case"replaceNode":f.a.qc(e,n),l=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+t)}return l&&(i(n,o),s.afterRender&&f.l.w(s.afterRender,null,[n,o.$data])),n}function o(e,t,i){return f.H(e)?e():"function"==typeof e?e(t,i):e}var a;f.Db=function(t){if(t!=e&&!(t instanceof f.O))throw Error("templateEngine must inherit from ko.templateEngine");a=t},f.Ab=function(t,i,s,l,u){if(s=s||{},(s.templateEngine||a)==e)throw Error("Set a template engine before calling renderTemplate");if(u=u||"replaceChildren",l){var c=r(l);return f.B(function(){var e=i&&i instanceof f.U?i:new f.U(f.a.c(i)),a=o(t,e.$data,e),e=n(l,u,a,e,s);"replaceNode"==u&&(l=e,c=r(l))},null,{wa:function(){return!c||!f.a.nb(c)},i:c&&"replaceNode"==u?c.parentNode:c})}return f.M.wb(function(e){f.Ab(t,i,s,e,"replaceNode")})},f.kd=function(t,r,a,s,l){function u(e,t){i(t,h),a.afterRender&&a.afterRender(t,e),h=null}function c(e,i){h=l.createChildContext(e,a.as,function(e){e.$index=i});var r=o(t,e,h);return n(null,"ignoreTargetNode",r,h,a)}var h;return f.B(function(){var t=f.a.c(r)||[];"undefined"==typeof t.length&&(t=[t]),t=f.a.Ka(t,function(t){return a.includeDestroyed||t===e||null===t||!f.a.c(t._destroy)}),f.l.w(f.a.Bb,null,[s,t,c,a,u])},null,{i:s})};var s=f.a.e.I();f.d.template={init:function(e,t){var i=f.a.c(t());if("string"==typeof i||i.name)f.f.xa(e);else{if("nodes"in i){if(i=i.nodes||[],f.H(i))throw Error('The "nodes" option must be a plain, non-observable array.')}else i=f.f.childNodes(e);i=f.a.jc(i),new f.v.qa(e).nodes(i)}return{controlsDescendantBindings:!0}},update:function(t,i,r,n,o){var a,l=i();i=f.a.c(l),r=!0,n=null,"string"==typeof i?i={}:(l=i.name,"if"in i&&(r=f.a.c(i.if)),r&&"ifnot"in i&&(r=!f.a.c(i.ifnot)),a=f.a.c(i.data)),"foreach"in i?n=f.kd(l||t,r&&i.foreach||[],i,t,o):r?(o="data"in i?o.createChildContext(a,i.as):o,n=f.Ab(l||t,o,i,t)):f.f.xa(t),o=n,(a=f.a.e.get(t,s))&&"function"==typeof a.k&&a.k(),f.a.e.set(t,s,o&&o.ba()?o:e)}},f.h.ta.template=function(e){return e=f.h.yb(e),1==e.length&&e[0].unknown||f.h.ad(e,"name")?null:"This template engine does not support anonymous templates nested within its templates"},f.f.Z.template=!0}(),f.b("setTemplateEngine",f.Db),f.b("renderTemplate",f.Ab),f.a.dc=function(e,t,i){if(e.length&&t.length){var r,n,o,a,s;for(r=n=0;(!i||r<i)&&(a=e[n]);++n){for(o=0;s=t[o];++o)if(a.value===s.value){a.moved=s.index,s.moved=a.index,t.splice(o,1),r=o=0;break}r+=o}}},f.a.ib=function(){function e(e,t,i,r,n){var o,a,s,l,u,c=Math.min,h=Math.max,d=[],p=e.length,m=t.length,_=m-p||1,g=p+m+1;for(o=0;o<=p;o++)for(l=s,d.push(s=[]),u=c(m,o+_),a=h(0,o-1);a<=u;a++)s[a]=a?o?e[o-1]===t[a-1]?l[a-1]:c(l[a]||g,s[a-1]||g)+1:a+1:o+1;for(c=[],h=[],_=[],o=p,a=m;o||a;)m=d[o][a]-1,a&&m===d[o][a-1]?h.push(c[c.length]={status:i,value:t[--a],index:a}):o&&m===d[o-1][a]?_.push(c[c.length]={status:r,value:e[--o],index:o}):(--a,--o,n.sparse||c.push({status:"retained",value:t[a]}));return f.a.dc(_,h,!n.dontLimitMoves&&10*p),c.reverse()}return function(t,i,r){return r="boolean"==typeof r?{dontLimitMoves:r}:r||{},t=t||[],i=i||[],t.length<i.length?e(t,i,"added","deleted",r):e(i,t,"deleted","added",r)}}(),f.b("utils.compareArrays",f.a.ib),function(){function t(t,i,r,n,o){var a=[],s=f.B(function(){var e=i(r,o,f.a.za(a,t))||[];0<a.length&&(f.a.qc(a,e),n&&f.l.w(n,null,[r,e,o])),a.length=0,f.a.ra(a,e)},null,{i:t,wa:function(){return!f.a.Qb(a)}});return{ca:a,B:s.ba()?s:e}}var i=f.a.e.I(),r=f.a.e.I();f.a.Bb=function(n,o,a,s,l){function u(e,t){w=d[t],v!==t&&(b[e]=w),w.qb(v++),f.a.za(w.ca,n),_.push(w),C.push(w)}function c(e,t){if(e)for(var i=0,r=t.length;i<r;i++)t[i]&&f.a.q(t[i].ca,function(r){e(r,i,t[i].ja)})}o=o||[],s=s||{};var h=f.a.e.get(n,i)===e,d=f.a.e.get(n,i)||[],p=f.a.fb(d,function(e){return e.ja}),m=f.a.ib(p,o,s.dontLimitMoves),_=[],g=0,v=0,y=[],C=[];o=[];for(var w,S,E,b=[],p=[],T=0;S=m[T];T++)switch(E=S.moved,S.status){case"deleted":E===e&&(w=d[g],w.B&&(w.B.k(),w.B=e),f.a.za(w.ca,n).length&&(s.beforeRemove&&(_.push(w),C.push(w),w.ja===r?w=null:o[T]=w),w&&y.push.apply(y,w.ca))),g++;break;case"retained":u(T,g++);break;case"added":E!==e?u(T,E):(w={ja:S.value,qb:f.N(v++)},_.push(w),C.push(w),h||(p[T]=w))}f.a.e.set(n,i,_),c(s.beforeMove,b),f.a.q(y,s.beforeRemove?f.$:f.removeNode);for(var x,T=0,h=f.f.firstChild(n);w=C[T];T++){for(w.ca||f.a.extend(w,t(n,a,w.ja,l,w.qb)),g=0;m=w.ca[g];h=m.nextSibling,x=m,g++)m!==h&&f.f.gc(n,m,x);!w.Wc&&l&&(l(w.ja,w.ca,w.qb),w.Wc=!0)}for(c(s.beforeRemove,o),T=0;T<o.length;++T)o[T]&&(o[T].ja=r);c(s.afterMove,b),c(s.afterAdd,p)}}(),f.b("utils.setDomNodeChildrenFromArrayMapping",f.a.Bb),f.W=function(){this.allowTemplateRewriting=!1},f.W.prototype=new f.O,f.W.prototype.renderTemplateSource=function(e,t,i,r){return(t=(9>f.a.C?0:e.nodes)?e.nodes():null)?f.a.V(t.cloneNode(!0).childNodes):(e=e.text(),f.a.ma(e,r))},f.W.sb=new f.W,f.Db(f.W.sb),f.b("nativeTemplateEngine",f.W),function(){f.vb=function(){var e=this.$c=function(){if(!o||!o.tmpl)return 0;try{if(0<=o.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch(e){}return 1}();this.renderTemplateSource=function(t,i,n,a){if(a=a||r,n=n||{},2>e)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var s=t.data("precompiled");return s||(s=t.text()||"",s=o.template(null,"{{ko_with $item.koBindingContext}}"+s+"{{/ko_with}}"),t.data("precompiled",s)),t=[i.$data],i=o.extend({koBindingContext:i},n.templateOptions),i=o.tmpl(s,t,i),i.appendTo(a.createElement("div")),o.fragments={},i},this.createJavaScriptEvaluatorBlock=function(e){return"{{ko_code ((function() { return "+e+" })()) }}"},this.addTemplate=function(e,t){r.write("<script type='text/html' id='"+e+"'>"+t+"</script>")},0<e&&(o.tmpl.tag.ko_code={open:"__.push($1 || '');"},o.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},f.vb.prototype=new f.O;var e=new f.vb;0<e.$c&&f.Db(e),f.b("jqueryTmplTemplateEngine",f.vb)}()})}()}(),i("ThirdParty/knockout-es5",[],function(){"use strict";function e(e,i){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,o=t(e,!0);return i=i||Object.getOwnPropertyNames(e),i.forEach(function(t){if(t!==h&&t!==d&&!(t in o)){var i=e[t],a=i instanceof Array,s=n.isObservable(i)?i:a?n.observableArray(i):n.observable(i);Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:s,set:n.isWriteableObservable(s)?s:void 0}),o[t]=s,a&&r(n,s)}}),e}function t(e,t){var i=e[h];return!i&&t&&(i={},Object.defineProperty(e,h,{value:i})),i}function i(t,i,r){var n=this,o={owner:t,deferEvaluation:!0};if("function"==typeof r)o.read=r;else{if("value"in r)throw new Error('For ko.defineProperty, you must not specify a "value" for the property. You must provide a "get" function.');if("function"!=typeof r.get)throw new Error('For ko.defineProperty, the third parameter must be either an evaluator function, or an options object containing a function called "get".');o.read=r.get,o.write=r.set}return t[i]=n.computed(o),e.call(n,t,[i]),t}function r(e,t){var i=null;e.computed(function(){i&&(i.dispose(),i=null);var r=t();r instanceof Array&&(i=n(e,t,r))})}function n(e,t,i){var r=o(e,i);return r.subscribe(t)}function o(e,t){var i=t[d];if(!i){i=new e.subscribable,Object.defineProperty(t,d,{value:i});var r={};a(t,i,r),s(e,t,i,r)}return i}function a(e,t,i){["pop","push","reverse","shift","sort","splice","unshift"].forEach(function(r){var n=e[r];e[r]=function(){var e=n.apply(this,arguments);return i.pause!==!0&&t.notifySubscribers(this),e}})}function s(e,t,i,r){["remove","removeAll","destroy","destroyAll","replace"].forEach(function(n){Object.defineProperty(t,n,{enumerable:!1,value:function(){var o;r.pause=!0;try{o=e.observableArray.fn[n].apply(e.observableArray(t),arguments)}finally{r.pause=!1}return i.notifySubscribers(t),o}})})}function l(e,i){if(!e)return null;var r=t(e,!1);return r&&r[i]||null}function u(e,t){var i=l(e,t);i&&i.valueHasMutated()}function c(t){t.track=e,t.getObservable=l,t.valueHasMutated=u,t.defineProperty=i}var h="__knockoutObservables",d="__knockoutSubscribable";return{attachToKo:c}}),i("Widgets/SvgPathBindingHandler",[],function(){"use strict";var e="http://www.w3.org/2000/svg",t="cesium-svgPath-svg",i={register:function(i){i.bindingHandlers.cesiumSvgPath={init:function(r,n){var o=document.createElementNS(e,"svg:svg");o.setAttribute("class",t);var a=document.createElementNS(e,"path");return o.appendChild(a),i.virtualElements.setDomNodeChildren(r,[o]),i.computed({read:function(){var e=i.unwrap(n());a.setAttribute("d",i.unwrap(e.path));var r=i.unwrap(e.width),s=i.unwrap(e.height);o.setAttribute("width",r),o.setAttribute("height",s),o.setAttribute("viewBox","0 0 "+r+" "+s),e.css&&o.setAttribute("class",t+" "+i.unwrap(e.css))},disposeWhenNodeIsRemoved:r}),{controlsDescendantBindings:!0}}},i.virtualElements.allowedBindings.cesiumSvgPath=!0}};return i}),i("ThirdParty/knockout",["./knockout-3.4.0","./knockout-es5","../Widgets/SvgPathBindingHandler"],function(e,t,i){"use strict";return t.attachToKo(e),i.register(e),e}),i("ThirdParty/NoSleep",[],function(){"use strict";function e(e,t,i){var r=document.createElement("source");r.src=i,r.type="video/"+t,e.appendChild(r)}var t={Android:"undefined"!=typeof navigator&&/Android/gi.test(navigator.userAgent),iOS:"undefined"!=typeof navigator&&/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent)},i={WebM:"data:video/webm;base64,GkXfo0AgQoaBAUL3gQFC8oEEQvOBCEKCQAR3ZWJtQoeBAkKFgQIYU4BnQI0VSalmQCgq17FAAw9CQE2AQAZ3aGFtbXlXQUAGd2hhbW15RIlACECPQAAAAAAAFlSua0AxrkAu14EBY8WBAZyBACK1nEADdW5khkAFVl9WUDglhohAA1ZQOIOBAeBABrCBCLqBCB9DtnVAIueBAKNAHIEAAIAwAQCdASoIAAgAAUAmJaQAA3AA/vz0AAA=",MP4:"data:video/mp4;base64,AAAAHGZ0eXBpc29tAAACAGlzb21pc28ybXA0MQAAAAhmcmVlAAAAG21kYXQAAAGzABAHAAABthADAowdbb9/AAAC6W1vb3YAAABsbXZoZAAAAAB8JbCAfCWwgAAAA+gAAAAAAAEAAAEAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAIVdHJhawAAAFx0a2hkAAAAD3wlsIB8JbCAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAIAAAACAAAAAABsW1kaWEAAAAgbWRoZAAAAAB8JbCAfCWwgAAAA+gAAAAAVcQAAAAAAC1oZGxyAAAAAAAAAAB2aWRlAAAAAAAAAAAAAAAAVmlkZW9IYW5kbGVyAAAAAVxtaW5mAAAAFHZtaGQAAAABAAAAAAAAAAAAAAAkZGluZgAAABxkcmVmAAAAAAAAAAEAAAAMdXJsIAAAAAEAAAEcc3RibAAAALhzdHNkAAAAAAAAAAEAAACobXA0dgAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAIAAgASAAAAEgAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABj//wAAAFJlc2RzAAAAAANEAAEABDwgEQAAAAADDUAAAAAABS0AAAGwAQAAAbWJEwAAAQAAAAEgAMSNiB9FAEQBFGMAAAGyTGF2YzUyLjg3LjQGAQIAAAAYc3R0cwAAAAAAAAABAAAAAQAAAAAAAAAcc3RzYwAAAAAAAAABAAAAAQAAAAEAAAABAAAAFHN0c3oAAAAAAAAAEwAAAAEAAAAUc3RjbwAAAAAAAAABAAAALAAAAGB1ZHRhAAAAWG1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAAK2lsc3QAAAAjqXRvbwAAABtkYXRhAAAAAQAAAABMYXZmNTIuNzguMw=="},r=function(){return t.iOS?this.noSleepTimer=null:t.Android&&(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("loop",""),e(this.noSleepVideo,"webm",i.WebM),e(this.noSleepVideo,"mp4",i.MP4)),this};return r.prototype.enable=function(e){t.iOS?(this.disable(),this.noSleepTimer=window.setInterval(function(){window.location=window.location,window.setTimeout(window.stop,0)},e||15e3)):t.Android&&this.noSleepVideo.play()},r.prototype.disable=function(){t.iOS?this.noSleepTimer&&(window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):t.Android&&this.noSleepVideo.pause()},r}),i("Widgets/subscribeAndEvaluate",["../ThirdParty/knockout"],function(e){"use strict";function t(t,i,r,n,o){return r.call(n,t[i]),e.getObservable(t,i).subscribe(r,n,o)}return t}),i("Widgets/Animation/Animation",["../../Core/Color","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../getElement","../subscribeAndEvaluate"],function(e,t,i,r,n,o,a){"use strict";function s(t){return e.fromCssColorString(window.getComputedStyle(t).getPropertyValue("color"))}function l(e){var t=document.createElementNS(v,e.tagName);for(var i in e)if(e.hasOwnProperty(i)&&"tagName"!==i)if("children"===i){var r,n=e.children.length;for(r=0;r<n;++r)t.appendChild(l(e.children[r]))}else 0===i.indexOf("xlink:")?t.setAttributeNS(y,i.substring(6),e[i]):"textContent"===i?t.textContent=e[i]:t.setAttribute(i,e[i]);return t}function u(e,t,i){var r=document.createElementNS(v,"text");r.setAttribute("x",e),r.setAttribute("y",t),r.setAttribute("class","cesium-animation-svgText");var n=document.createElementNS(v,"tspan");return n.textContent=i,r.appendChild(n),r}function c(e,t,i){e.setAttribute("transform","translate(100,100) rotate("+i+")"),t.setAttribute("transform","rotate("+i+")")}function h(e,t){var i=t.alpha,r=1-i;return P.red=e.red*r+t.red*i,P.green=e.green*r+t.green*i,P.blue=e.blue*r+t.blue*i,P.toCssColorString()}function d(e,t,i){var r={tagName:"g",class:"cesium-animation-rectButton",transform:"translate("+e+","+t+")",children:[{tagName:"rect",class:"cesium-animation-buttonGlow",width:32,height:32,rx:2,ry:2},{tagName:"rect",class:"cesium-animation-buttonMain",width:32,height:32,rx:4,ry:4},{tagName:"use",class:"cesium-animation-buttonPath","xlink:href":i},{tagName:"title",textContent:""}]};return l(r)}function p(e,t,i){var r={tagName:"g",class:"cesium-animation-rectButton",transform:"translate("+e+","+t+")",children:[{tagName:"use",class:"cesium-animation-buttonGlow","xlink:href":"#animation_pathWingButton"},{tagName:"use",class:"cesium-animation-buttonMain","xlink:href":"#animation_pathWingButton"},{tagName:"use",class:"cesium-animation-buttonPath","xlink:href":i},{tagName:"title",textContent:""}]};return l(r)}function m(e,t){var i=e._viewModel,r=i.shuttleRingDragging;if(!r||g===e)if("mousedown"===t.type||r&&"mousemove"===t.type||"touchstart"===t.type&&1===t.touches.length||r&&"touchmove"===t.type&&1===t.touches.length){var n,o,a=e._centerX,s=e._centerY,l=e._svgNode,u=l.getBoundingClientRect();if("touchstart"===t.type||"touchmove"===t.type?(n=t.touches[0].clientX,o=t.touches[0].clientY):(n=t.clientX,o=t.clientY),!r&&(n>u.right||n<u.left||o<u.top||o>u.bottom))return;var c=e._shuttleRingPointer.getBoundingClientRect(),h=n-a-u.left,d=o-s-u.top,p=180*Math.atan2(d,h)/Math.PI+90;p>180&&(p-=360);var m=i.shuttleRingAngle;r||n<c.right&&n>c.left&&o>c.top&&o<c.bottom?(g=e,i.shuttleRingDragging=!0,i.shuttleRingAngle=p):p<m?i.slower():p>m&&i.faster(),t.preventDefault()}else e===g&&(g=void 0),i.shuttleRingDragging=!1}function f(e,t){this._viewModel=t,this.svgElement=e,this._enabled=void 0,this._toggled=void 0;var i=this;this._clickFunction=function(){var e=i._viewModel.command;e.canExecute&&e()},e.addEventListener("click",this._clickFunction,!0),this._subscriptions=[a(t,"toggled",this.setToggled,this),a(t,"tooltip",this.setTooltip,this),a(t.command,"canExecute",this.setEnabled,this)]}function _(e,t){function i(e){m(x,e)}e=o(e),this._viewModel=t,this._container=e,this._centerX=0,this._centerY=0,this._defsElement=void 0,this._svgNode=void 0,this._topG=void 0,this._lastHeight=void 0,this._lastWidth=void 0;var r=document.createElement("style");r.textContent=".cesium-animation-rectButton .cesium-animation-buttonGlow { filter: url(#animation_blurred); }.cesium-animation-rectButton .cesium-animation-buttonMain { fill: url(#animation_buttonNormal); }.cesium-animation-buttonToggled .cesium-animation-buttonMain { fill: url(#animation_buttonToggled); }.cesium-animation-rectButton:hover .cesium-animation-buttonMain { fill: url(#animation_buttonHovered); }.cesium-animation-buttonDisabled .cesium-animation-buttonMain { fill: url(#animation_buttonDisabled); }.cesium-animation-shuttleRingG .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshGradient); }.cesium-animation-shuttleRingG:hover .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshHovered); }.cesium-animation-shuttleRingPointer { fill: url(#animation_shuttleRingPointerGradient); }.cesium-animation-shuttleRingPausePointer { fill: url(#animation_shuttleRingPointerPaused); }.cesium-animation-knobOuter { fill: url(#animation_knobOuter); }.cesium-animation-knobInner { fill: url(#animation_knobInner); }",document.head.insertBefore(r,document.head.childNodes[0]);var n=document.createElement("div");n.className="cesium-animation-theme",n.innerHTML='<div class="cesium-animation-themeNormal"></div><div class="cesium-animation-themeHover"></div><div class="cesium-animation-themeSelect"></div><div class="cesium-animation-themeDisabled"></div><div class="cesium-animation-themeKnob"></div><div class="cesium-animation-themePointer"></div><div class="cesium-animation-themeSwoosh"></div><div class="cesium-animation-themeSwooshHover"></div>',this._theme=n,this._themeNormal=n.childNodes[0],this._themeHover=n.childNodes[1],this._themeSelect=n.childNodes[2],this._themeDisabled=n.childNodes[3],this._themeKnob=n.childNodes[4],this._themePointer=n.childNodes[5],this._themeSwoosh=n.childNodes[6],this._themeSwooshHover=n.childNodes[7];var s=document.createElementNS(v,"svg:svg");this._svgNode=s,s.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",y);var h=document.createElementNS(v,"g");this._topG=h,this._realtimeSVG=new f(p(3,4,"#animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new f(d(44,99,"#animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new f(d(124,99,"#animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new f(d(84,99,"#animation_pathPause"),t.pauseViewModel);var _=document.createElementNS(v,"g");_.appendChild(this._realtimeSVG.svgElement),_.appendChild(this._playReverseSVG.svgElement),_.appendChild(this._playForwardSVG.svgElement),_.appendChild(this._pauseSVG.svgElement);var g=l({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=g;var C=l({tagName:"g",class:"cesium-animation-shuttleRingSwoosh",children:[{tagName:"use",transform:"translate(100,97) scale(-1,1)","xlink:href":"#animation_pathSwooshFX"},{tagName:"use",transform:"translate(100,97)","xlink:href":"#animation_pathSwooshFX"},{tagName:"line",x1:100,y1:8,x2:100,y2:22}]});this._shuttleRingSwooshG=C,this._shuttleRingPointer=l({tagName:"use",class:"cesium-animation-shuttleRingPointer","xlink:href":"#animation_pathPointer"});var w=l({tagName:"g",transform:"translate(100,100)"});this._knobOuter=l({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});var S=61,E=l({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:S});this._knobDate=u(0,-24,""),this._knobTime=u(0,-7,""),this._knobStatus=u(0,-41,"");var b=l({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:S}),T=document.createElementNS(v,"g");T.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(n),h.appendChild(T),h.appendChild(w),h.appendChild(_),T.appendChild(g),T.appendChild(C),T.appendChild(this._shuttleRingPointer),w.appendChild(this._knobOuter),w.appendChild(E),w.appendChild(this._knobDate),w.appendChild(this._knobTime),w.appendChild(this._knobStatus),w.appendChild(b),s.appendChild(h),e.appendChild(s);var x=this;this._mouseCallback=i,g.addEventListener("mousedown",i,!0),g.addEventListener("touchstart",i,!0),C.addEventListener("mousedown",i,!0),C.addEventListener("touchstart",i,!0),document.addEventListener("mousemove",i,!0),document.addEventListener("touchmove",i,!0),document.addEventListener("mouseup",i,!0),document.addEventListener("touchend",i,!0),document.addEventListener("touchcancel",i,!0),this._shuttleRingPointer.addEventListener("mousedown",i,!0),this._shuttleRingPointer.addEventListener("touchstart",i,!0),this._knobOuter.addEventListener("mousedown",i,!0),this._knobOuter.addEventListener("touchstart",i,!0);var A,P=this._knobTime.childNodes[0],D=this._knobDate.childNodes[0],M=this._knobStatus.childNodes[0];this._subscriptions=[a(t.pauseViewModel,"toggled",function(e){A!==e&&(A=e,A?x._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):x._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),a(t,"shuttleRingAngle",function(e){c(x._shuttleRingPointer,x._knobOuter,e)}),a(t,"dateLabel",function(e){D.textContent!==e&&(D.textContent=e)}),a(t,"timeLabel",function(e){P.textContent!==e&&(P.textContent=e)}),a(t,"multiplierLabel",function(e){M.textContent!==e&&(M.textContent=e)})],this.applyThemeChanges(),this.resize()}var g,v="http://www.w3.org/2000/svg",y="http://www.w3.org/1999/xlink",C=e.fromCssColorString("rgba(247,250,255,0.384)"),w=e.fromCssColorString("rgba(143,191,255,0.216)"),S=e.fromCssColorString("rgba(153,197,255,0.098)"),E=e.fromCssColorString("rgba(255,255,255,0.086)"),b=e.fromCssColorString("rgba(255,255,255,0.267)"),T=e.fromCssColorString("rgba(255,255,255,0)"),x=e.fromCssColorString("rgba(66,67,68,0.3)"),A=e.fromCssColorString("rgba(0,0,0,0.5)"),P=new e;return f.prototype.destroy=function(){this.svgElement.removeEventListener("click",this._clickFunction,!0);for(var e=this._subscriptions,t=0,i=e.length;t<i;t++)e[t].dispose();r(this)},f.prototype.isDestroyed=function(){return!1},f.prototype.setEnabled=function(e){if(this._enabled!==e){if(this._enabled=e,!e)return void this.svgElement.setAttribute("class","cesium-animation-buttonDisabled");if(this._toggled)return void this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled");this.svgElement.setAttribute("class","cesium-animation-rectButton")}},f.prototype.setToggled=function(e){this._toggled!==e&&(this._toggled=e,this._enabled&&(e?this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled"):this.svgElement.setAttribute("class","cesium-animation-rectButton")))},f.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e},i(_.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),_.prototype.isDestroyed=function(){return!1},_.prototype.destroy=function(){var e=this._mouseCallback;this._shuttleRingBackPanel.removeEventListener("mousedown",e,!0),this._shuttleRingBackPanel.removeEventListener("touchstart",e,!0),this._shuttleRingSwooshG.removeEventListener("mousedown",e,!0),this._shuttleRingSwooshG.removeEventListener("touchstart",e,!0),document.removeEventListener("mousemove",e,!0),document.removeEventListener("touchmove",e,!0),document.removeEventListener("mouseup",e,!0),document.removeEventListener("touchend",e,!0),document.removeEventListener("touchcancel",e,!0),this._shuttleRingPointer.removeEventListener("mousedown",e,!0),this._shuttleRingPointer.removeEventListener("touchstart",e,!0),this._knobOuter.removeEventListener("mousedown",e,!0),this._knobOuter.removeEventListener("touchstart",e,!0),this._container.removeChild(this._svgNode),this._container.removeChild(this._theme),this._realtimeSVG.destroy(),this._playReverseSVG.destroy(),this._playForwardSVG.destroy(),this._pauseSVG.destroy();for(var t=this._subscriptions,i=0,n=t.length;i<n;i++)t[i].dispose();return r(this)},_.prototype.resize=function(){var e=this._container.clientWidth,t=this._container.clientHeight;if(e!==this._lastWidth||t!==this._lastHeight){var i=this._svgNode,r=200,n=132,o=e,a=t;0===e&&0===t?(o=r,a=n):0===e?(a=t,o=r*(t/n)):0===t&&(o=e,a=n*(e/r));var s=o/r,l=a/n;i.style.cssText="width: "+o+"px; height: "+a+"px; position: absolute; bottom: 0; left: 0; overflow: hidden;",i.setAttribute("width",o),i.setAttribute("height",a),i.setAttribute("viewBox","0 0 "+o+" "+a),this._topG.setAttribute("transform","scale("+s+","+l+")"),this._centerX=Math.max(1,100*s),this._centerY=Math.max(1,100*l),this._lastHeight=e,this._lastWidth=t}},_.prototype.applyThemeChanges=function(){var e=s(this._themeNormal),i=s(this._themeHover),r=s(this._themeSelect),n=s(this._themeDisabled),o=s(this._themeKnob),a=s(this._themePointer),u=s(this._themeSwoosh),c=s(this._themeSwooshHover),d=l({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":h(e,C)},{tagName:"stop",offset:"12%","stop-color":h(e,w)},{tagName:"stop",offset:"46%","stop-color":h(e,S)},{tagName:"stop",offset:"81%","stop-color":h(e,E)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":h(i,C)},{tagName:"stop",offset:"12%","stop-color":h(i,w)},{tagName:"stop",offset:"46%","stop-color":h(i,S)},{tagName:"stop",offset:"81%","stop-color":h(i,E)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":h(r,C)},{tagName:"stop",offset:"12%","stop-color":h(r,w)},{tagName:"stop",offset:"46%","stop-color":h(r,S)},{tagName:"stop",offset:"81%","stop-color":h(r,E)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":h(n,b)},{tagName:"stop",offset:"75%","stop-color":h(n,T)}]},{id:"animation_blurred",tagName:"filter",width:"200%",height:"200%",x:"-50%",y:"-50%",children:[{tagName:"feGaussianBlur",stdDeviation:4,in:"SourceGraphic"}]},{id:"animation_shuttleRingSwooshGradient",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":u.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":u.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":u.toCssColorString()}]},{id:"animation_shuttleRingSwooshHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":c.toCssColorString()}]},{id:"animation_shuttleRingPointerGradient",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":a.toCssColorString()},{tagName:"stop",offset:"40%","stop-color":a.toCssColorString()},{tagName:"stop",offset:"60%","stop-color":h(a,A)},{tagName:"stop",offset:"100%","stop-color":h(a,A)}]},{id:"animation_shuttleRingPointerPaused",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":"#CCC"},{tagName:"stop",offset:"40%","stop-color":"#CCC"},{tagName:"stop",offset:"60%","stop-color":"#555"},{tagName:"stop",offset:"100%","stop-color":"#555"}]},{id:"animation_knobOuter",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":h(o,C)},{tagName:"stop",offset:"60%","stop-color":h(o,x)},{tagName:"stop",offset:"85%","stop-color":h(o,w)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":h(o,x)},{tagName:"stop",offset:"60%","stop-color":h(o,C)},{tagName:"stop",offset:"85%","stop-color":h(o,E)}]},{id:"animation_pathReset",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.316,5.318,9.833,13.682,9.833,5.5,5.5,5.5,5.5,25.5,9.833,25.5,9.833,17.318,24.316,25.682z" +},{id:"animation_pathPause",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M13,5.5,7.5,5.5,7.5,25.5,13,25.5zM24.5,5.5,19,5.5,19,25.5,24.5,25.5z"},{id:"animation_pathPlay",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},{id:"animation_pathPlayReverse",tagName:"path",transform:"translate(16,16) scale(-0.85,0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},{id:"animation_pathLoop",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.249,15.499c-0.009,4.832-3.918,8.741-8.75,8.75c-2.515,0-4.768-1.064-6.365-2.763l2.068-1.442l-7.901-3.703l0.744,8.694l2.193-1.529c2.244,2.594,5.562,4.242,9.26,4.242c6.767,0,12.249-5.482,12.249-12.249H24.249zM15.499,6.75c2.516,0,4.769,1.065,6.367,2.764l-2.068,1.443l7.901,3.701l-0.746-8.693l-2.192,1.529c-2.245-2.594-5.562-4.245-9.262-4.245C8.734,3.25,3.25,8.734,3.249,15.499H6.75C6.758,10.668,10.668,6.758,15.499,6.75z"},{id:"animation_pathClock",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-15.5)",d:"M15.5,2.374C8.251,2.375,2.376,8.251,2.374,15.5C2.376,22.748,8.251,28.623,15.5,28.627c7.249-0.004,13.124-5.879,13.125-13.127C28.624,8.251,22.749,2.375,15.5,2.374zM15.5,25.623C9.909,25.615,5.385,21.09,5.375,15.5C5.385,9.909,9.909,5.384,15.5,5.374c5.59,0.01,10.115,4.535,10.124,10.125C25.615,21.09,21.091,25.615,15.5,25.623zM8.625,15.5c-0.001-0.552-0.448-0.999-1.001-1c-0.553,0-1,0.448-1,1c0,0.553,0.449,1,1,1C8.176,16.5,8.624,16.053,8.625,15.5zM8.179,18.572c-0.478,0.277-0.642,0.889-0.365,1.367c0.275,0.479,0.889,0.641,1.365,0.365c0.479-0.275,0.643-0.887,0.367-1.367C9.27,18.461,8.658,18.297,8.179,18.572zM9.18,10.696c-0.479-0.276-1.09-0.112-1.366,0.366s-0.111,1.09,0.365,1.366c0.479,0.276,1.09,0.113,1.367-0.366C9.821,11.584,9.657,10.973,9.18,10.696zM22.822,12.428c0.478-0.275,0.643-0.888,0.366-1.366c-0.275-0.478-0.89-0.642-1.366-0.366c-0.479,0.278-0.642,0.89-0.366,1.367C21.732,12.54,22.344,12.705,22.822,12.428zM12.062,21.455c-0.478-0.275-1.089-0.111-1.366,0.367c-0.275,0.479-0.111,1.09,0.366,1.365c0.478,0.277,1.091,0.111,1.365-0.365C12.704,22.344,12.54,21.732,12.062,21.455zM12.062,9.545c0.479-0.276,0.642-0.888,0.366-1.366c-0.276-0.478-0.888-0.642-1.366-0.366s-0.642,0.888-0.366,1.366C10.973,9.658,11.584,9.822,12.062,9.545zM22.823,18.572c-0.48-0.275-1.092-0.111-1.367,0.365c-0.275,0.479-0.112,1.092,0.367,1.367c0.477,0.275,1.089,0.113,1.365-0.365C23.464,19.461,23.3,18.848,22.823,18.572zM19.938,7.813c-0.477-0.276-1.091-0.111-1.365,0.366c-0.275,0.48-0.111,1.091,0.366,1.367s1.089,0.112,1.366-0.366C20.581,8.702,20.418,8.089,19.938,7.813zM23.378,14.5c-0.554,0.002-1.001,0.45-1.001,1c0.001,0.552,0.448,1,1.001,1c0.551,0,1-0.447,1-1C24.378,14.949,23.929,14.5,23.378,14.5zM15.501,6.624c-0.552,0-1,0.448-1,1l-0.466,7.343l-3.004,1.96c-0.478,0.277-0.642,0.889-0.365,1.365c0.275,0.479,0.889,0.643,1.365,0.367l3.305-1.676C15.39,16.99,15.444,17,15.501,17c0.828,0,1.5-0.671,1.5-1.5l-0.5-7.876C16.501,7.072,16.053,6.624,15.501,6.624zM15.501,22.377c-0.552,0-1,0.447-1,1s0.448,1,1,1s1-0.447,1-1S16.053,22.377,15.501,22.377zM18.939,21.455c-0.479,0.277-0.643,0.889-0.366,1.367c0.275,0.477,0.888,0.643,1.366,0.365c0.478-0.275,0.642-0.889,0.366-1.365C20.028,21.344,19.417,21.18,18.939,21.455z"},{id:"animation_pathWingButton",tagName:"path",d:"m 4.5,0.5 c -2.216,0 -4,1.784 -4,4 l 0,24 c 0,2.216 1.784,4 4,4 l 13.71875,0 C 22.478584,27.272785 27.273681,22.511272 32.5,18.25 l 0,-13.75 c 0,-2.216 -1.784,-4 -4,-4 l -24,0 z"},{id:"animation_pathPointer",tagName:"path",d:"M-15,-65,-15,-55,15,-55,15,-65,0,-95z"},{id:"animation_pathSwooshFX",tagName:"path",d:"m 85,0 c 0,16.617 -4.813944,35.356 -13.131081,48.4508 h 6.099803 c 8.317138,-13.0948 13.13322,-28.5955 13.13322,-45.2124 0,-46.94483 -38.402714,-85.00262 -85.7743869,-85.00262 -1.0218522,0 -2.0373001,0.0241 -3.0506131,0.0589 45.958443,1.59437 82.723058,35.77285 82.723058,81.70532 z"}]});t(this._defsElement)?this._svgNode.replaceChild(d,this._defsElement):this._svgNode.appendChild(d),this._defsElement=d},_}),i("Widgets/createCommand",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../ThirdParty/knockout"],function(e,t,i,r,n,o){"use strict";function a(t,r){function a(){var e,i={args:arguments,cancel:!1};return s.raiseEvent(i),i.cancel||(e=t.apply(null,arguments),l.raiseEvent(e)),e}r=e(r,!0);var s=new n,l=new n;return a.canExecute=r,o.track(a,["canExecute"]),i(a,{beforeExecute:{value:s},afterExecute:{value:l}}),a}return a}),i("Widgets/ToggleButtonViewModel",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../ThirdParty/knockout"],function(e,t,i,r,n){"use strict";function o(t,i){this._command=t,i=e(i,e.EMPTY_OBJECT),this.toggled=e(i.toggled,!1),this.tooltip=e(i.tooltip,""),n.track(this,["toggled","tooltip"])}return i(o.prototype,{command:{get:function(){return this._command}}}),o}),i("Widgets/Animation/AnimationViewModel",["../../Core/binarySearch","../../Core/ClockRange","../../Core/ClockStep","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/JulianDate","../../ThirdParty/knockout","../../ThirdParty/sprintf","../createCommand","../ToggleButtonViewModel"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(e,t){return e-t}function d(t,i){var r=e(i,t,h);return r<0?~r:r}function p(e,t){if(Math.abs(e)<=g)return e/g;var i,r,n=g,o=v,a=0;return e>0?(i=Math.log(t[t.length-1]),r=(i-a)/(o-n),Math.exp(a+r*(e-n))):(i=Math.log(-t[0]),r=(i-a)/(o-n),-Math.exp(a+r*(Math.abs(e)-n)))}function m(e,t,r){if(r.clockStep===i.SYSTEM_CLOCK)return g;if(Math.abs(e)<=1)return e*g;var n=t[t.length-1];e>n?e=n:e<-n&&(e=-n);var o,a,s=g,l=v,u=0;return e>0?(o=Math.log(n),a=(o-u)/(l-s),(Math.log(e)-u)/a+s):(o=Math.log(-t[0]),a=(o-u)/(l-s),-((Math.log(Math.abs(e))-u)/a+s))}function f(e){var r=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=f.defaultDateFormatter,this._timeFormatter=f.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,s.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(f.defaultTicks),this.timeLabel=void 0,s.defineProperty(this,"timeLabel",function(){return r._timeFormatter(r._clockViewModel.currentTime,r)}),this.dateLabel=void 0,s.defineProperty(this,"dateLabel",function(){return r._dateFormatter(r._clockViewModel.currentTime,r)}),this.multiplierLabel=void 0,s.defineProperty(this,"multiplierLabel",function(){var e=r._clockViewModel;if(e.clockStep===i.SYSTEM_CLOCK)return"Today";var t=e.multiplier;return t%1===0?t.toFixed(0)+"x":t.toFixed(3).replace(/0{0,3}$/,"")+"x"}),this.shuttleRingAngle=void 0,s.defineProperty(this,"shuttleRingAngle",{get:function(){return m(e.multiplier,r._allShuttleRingTicks,e)},set:function(e){e=Math.max(Math.min(e,v),-v);var t=r._allShuttleRingTicks,n=r._clockViewModel;if(n.clockStep=i.SYSTEM_CLOCK_MULTIPLIER,Math.abs(e)===v)return void(n.multiplier=e>0?t[t.length-1]:t[0]);var o=p(e,t);if(r.snapToTicks)o=t[d(o,t)];else if(0!==o){var a=Math.abs(o);if(a>100){var s=a.toFixed(0).length-2,l=Math.pow(10,s);o=Math.round(o/l)*l|0}else a>g?o=Math.round(o):a>1?o=+o.toFixed(1):a>0&&(o=+o.toFixed(2))}n.multiplier=o}}),this._canAnimate=void 0,s.defineProperty(this,"_canAnimate",function(){var e=r._clockViewModel,i=e.clockRange;if(r.shuttleRingDragging||i===t.UNBOUNDED)return!0;var n=e.multiplier,o=e.currentTime,s=e.startTime,l=!1;if(i===t.LOOP_STOP)l=a.greaterThan(o,s)||o.equals(s)&&n>0;else{var u=e.stopTime;l=a.greaterThan(o,s)&&a.lessThan(o,u)||o.equals(s)&&n>0||o.equals(u)&&n<0}return l||(e.shouldAnimate=!1),l}),this._isSystemTimeAvailable=void 0,s.defineProperty(this,"_isSystemTimeAvailable",function(){var e=r._clockViewModel,i=e.clockRange;if(i===t.UNBOUNDED)return!0;var n=e.systemTime;return a.greaterThanOrEquals(n,e.startTime)&&a.lessThanOrEquals(n,e.stopTime)}),this._isAnimating=void 0,s.defineProperty(this,"_isAnimating",function(){return r._clockViewModel.shouldAnimate&&(r._canAnimate||r.shuttleRingDragging)});var n=u(function(){var e=r._clockViewModel;e.shouldAnimate?e.shouldAnimate=!1:r._canAnimate&&(e.shouldAnimate=!0)});this._pauseViewModel=new c(n,{toggled:s.computed(function(){return!r._isAnimating}),tooltip:"Pause"});var o=u(function(){var e=r._clockViewModel,t=e.multiplier;t>0&&(e.multiplier=-t),e.shouldAnimate=!0});this._playReverseViewModel=new c(o,{toggled:s.computed(function(){return r._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});var l=u(function(){var e=r._clockViewModel,t=e.multiplier;t<0&&(e.multiplier=-t),e.shouldAnimate=!0});this._playForwardViewModel=new c(l,{toggled:s.computed(function(){return r._isAnimating&&e.multiplier>0&&e.clockStep!==i.SYSTEM_CLOCK}),tooltip:"Play Forward"});var h=u(function(){r._clockViewModel.clockStep=i.SYSTEM_CLOCK},s.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new c(h,{toggled:s.computed(function(){return e.clockStep===i.SYSTEM_CLOCK}),tooltip:s.computed(function(){return r._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=u(function(){var e=r._clockViewModel,t=r._allShuttleRingTicks,i=e.multiplier,n=d(i,t)-1;n>=0&&(e.multiplier=t[n])}),this._faster=u(function(){var e=r._clockViewModel,t=r._allShuttleRingTicks,i=e.multiplier,n=d(i,t)+1;n<t.length&&(e.multiplier=t[n])})}var _=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],g=15,v=105;return f.defaultDateFormatter=function(e,t){var i=a.toGregorianDate(e);return _[i.month-1]+" "+i.day+" "+i.year},f.defaultTicks=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800],f.defaultTimeFormatter=function(e,t){var i=a.toGregorianDate(e),r=Math.round(i.millisecond);return Math.abs(t._clockViewModel.multiplier)<1?l("%02d:%02d:%02d.%03d",i.hour,i.minute,i.second,r):l("%02d:%02d:%02d UTC",i.hour,i.minute,i.second)},f.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)},f.prototype.setShuttleRingTicks=function(e){var t,i,r,n={},o=this._sortedFilteredPositiveTicks;for(o.length=0,t=0,i=e.length;t<i;++t)r=e[t],n.hasOwnProperty(r)||(n[r]=!0,o.push(r));o.sort(h);var a=[];for(i=o.length,t=i-1;t>=0;--t)r=o[t],0!==r&&a.push(-r);Array.prototype.push.apply(a,o),this._allShuttleRingTicks=a},n(f.prototype,{slower:{get:function(){return this._slower}},faster:{get:function(){return this._faster}},clockViewModel:{get:function(){return this._clockViewModel}},pauseViewModel:{get:function(){return this._pauseViewModel}},playReverseViewModel:{get:function(){return this._playReverseViewModel}},playForwardViewModel:{get:function(){return this._playForwardViewModel}},playRealtimeViewModel:{get:function(){return this._playRealtimeViewModel}},dateFormatter:{get:function(){return this._dateFormatter},set:function(e){this._dateFormatter=e}},timeFormatter:{get:function(){return this._timeFormatter},set:function(e){this._timeFormatter=e}}}),f._maxShuttleRingAngle=v,f._realtimeShuttleRingAngle=g,f}),i("Widgets/BaseLayerPicker/BaseLayerPickerViewModel",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/EllipsoidTerrainProvider","../../Core/isArray","../../ThirdParty/knockout","../createCommand"],function(e,t,i,r,n,o,a,s){"use strict";function l(i){i=e(i,e.EMPTY_OBJECT);var r=i.globe,l=e(i.imageryProviderViewModels,[]),u=e(i.terrainProviderViewModels,[]);this._globe=r,this.imageryProviderViewModels=l.slice(0),this.terrainProviderViewModels=u.slice(0),this.dropDownVisible=!1,a.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]),this.buttonTooltip=void 0,a.defineProperty(this,"buttonTooltip",function(){var e=this.selectedImagery,i=this.selectedTerrain,r=t(e)?e.name:void 0,n=t(i)?i.name:void 0;return t(r)&&t(n)?r+"\n"+n:t(r)?r:n}),this.buttonImageUrl=void 0,a.defineProperty(this,"buttonImageUrl",function(){var e=this.selectedImagery;return t(e)?e.iconUrl:void 0}),this.selectedImagery=void 0;var c=a.observable();this._currentImageryProviders=[],a.defineProperty(this,"selectedImagery",{get:function(){return c()},set:function(e){if(c()===e)return void(this.dropDownVisible=!1);var i,r=this._currentImageryProviders,n=r.length,a=this._globe.imageryLayers;for(i=0;i<n;i++)for(var s=a.length,l=0;l<s;l++){var u=a.get(l);if(u.imageryProvider===r[i]){a.remove(u);break}}if(t(e)){var h=e.creationCommand();if(o(h)){var d=h.length;for(i=d-1;i>=0;i--)a.addImageryProvider(h[i],0);this._currentImageryProviders=h.slice(0)}else this._currentImageryProviders=[h],a.addImageryProvider(h,0)}c(e),this.dropDownVisible=!1}}),this.selectedTerrain=void 0;var h=a.observable();a.defineProperty(this,"selectedTerrain",{get:function(){return h()},set:function(e){if(h()===e)return void(this.dropDownVisible=!1);var i;t(e)&&(i=e.creationCommand()),this._globe.depthTestAgainstTerrain=!(i instanceof n),this._globe.terrainProvider=i,h(e),this.dropDownVisible=!1}});var d=this;this._toggleDropDown=s(function(){d.dropDownVisible=!d.dropDownVisible}),this.selectedImagery=e(i.selectedImageryProviderViewModel,l[0]),this.selectedTerrain=e(i.selectedTerrainProviderViewModel,u[0])}return i(l.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}}),l}),i("Widgets/BaseLayerPicker/BaseLayerPicker",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/FeatureDetection","../../ThirdParty/knockout","../getElement","./BaseLayerPickerViewModel"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,t){e=a(e);var i=new s(t),r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button",r.setAttribute("data-bind","attr: { title: buttonTooltip },click: toggleDropDown"),e.appendChild(r);var l=document.createElement("img");l.setAttribute("draggable","false"),l.className="cesium-baseLayerPicker-selected",l.setAttribute("data-bind","attr: { src: buttonImageUrl }"),r.appendChild(l);var u=document.createElement("div");u.className="cesium-baseLayerPicker-dropDown",u.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-dropDown-visible" : dropDownVisible }'),e.appendChild(u);var c=document.createElement("div");c.className="cesium-baseLayerPicker-sectionTitle",c.setAttribute("data-bind","visible: imageryProviderViewModels.length > 0"),c.innerHTML="Imagery",u.appendChild(c);var h=document.createElement("div");h.className="cesium-baseLayerPicker-choices",h.setAttribute("data-bind","foreach: imageryProviderViewModels"),u.appendChild(h);var d=document.createElement("div");d.className="cesium-baseLayerPicker-item",d.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parent.selectedImagery },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parent.selectedImagery = $data; }'),h.appendChild(d);var p=document.createElement("img");p.className="cesium-baseLayerPicker-itemIcon",p.setAttribute("data-bind","attr: { src: iconUrl }"),p.setAttribute("draggable","false"),d.appendChild(p);var m=document.createElement("div");m.className="cesium-baseLayerPicker-itemLabel",m.setAttribute("data-bind","text: name"),d.appendChild(m);var f=document.createElement("div");f.className="cesium-baseLayerPicker-sectionTitle",f.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),f.innerHTML="Terrain",u.appendChild(f);var _=document.createElement("div");_.className="cesium-baseLayerPicker-choices",_.setAttribute("data-bind","foreach: terrainProviderViewModels"),u.appendChild(_);var g=document.createElement("div");g.className="cesium-baseLayerPicker-item",g.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parent.selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parent.selectedTerrain = $data; }'),_.appendChild(g);var v=document.createElement("img");v.className="cesium-baseLayerPicker-itemIcon",v.setAttribute("data-bind","attr: { src: iconUrl }"),v.setAttribute("draggable","false"),g.appendChild(v);var y=document.createElement("div");y.className="cesium-baseLayerPicker-itemLabel",y.setAttribute("data-bind","text: name"),g.appendChild(y),o.applyBindings(i,r),o.applyBindings(i,u),this._viewModel=i,this._container=e,this._element=r,this._dropPanel=u,this._closeDropDown=function(e){r.contains(e.target)||u.contains(e.target)||(i.dropDownVisible=!1)},n.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}return t(l.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return n.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),o.cleanNode(this._element),o.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),i(this)},l}),i("Widgets/BaseLayerPicker/ProviderViewModel",["../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../ThirdParty/knockout","../createCommand"],function(e,t,i,r,n){"use strict";function o(t){var i=t.creationFunction;e(i.canExecute)||(i=n(i)),this._creationCommand=i,this.name=t.name,this.tooltip=t.tooltip,this.iconUrl=t.iconUrl,r.track(this,["name","tooltip","iconUrl"])}return t(o.prototype,{creationCommand:{get:function(){return this._creationCommand}}}),o}),i("Widgets/BaseLayerPicker/createDefaultImageryProviderViewModels",["../../Core/buildModuleUrl","../../Scene/ArcGisMapServerImageryProvider","../../Scene/BingMapsImageryProvider","../../Scene/BingMapsStyle","../../Scene/createOpenStreetMapImageryProvider","../../Scene/createTileMapServiceImageryProvider","../../Scene/MapboxImageryProvider","../BaseLayerPicker/ProviderViewModel"],function(e,t,i,r,n,o,a,s){"use strict";function l(){var l=[];return l.push(new s({name:"Bing Maps Aerial",iconUrl:e("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery \nhttp://www.bing.com/maps",creationFunction:function(){return new i({url:"https://dev.virtualearth.net",mapStyle:r.AERIAL})}})),l.push(new s({name:"Bing Maps Aerial with Labels",iconUrl:e("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with label overlays \nhttp://www.bing.com/maps",creationFunction:function(){return new i({url:"https://dev.virtualearth.net",mapStyle:r.AERIAL_WITH_LABELS})}})),l.push(new s({name:"Bing Maps Roads",iconUrl:e("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps\nhttp://www.bing.com/maps",creationFunction:function(){return new i({url:"https://dev.virtualearth.net",mapStyle:r.ROAD})}})),l.push(new s({name:"Mapbox Satellite",tooltip:"Mapbox satellite imagery https://www.mapbox.com/maps/",iconUrl:e("Widgets/Images/ImageryProviders/mapboxSatellite.png"),creationFunction:function(){return new a({mapId:"mapbox.satellite"})}})),l.push(new s({name:"Mapbox Streets",tooltip:"Mapbox streets imagery https://www.mapbox.com/maps/",iconUrl:e("Widgets/Images/ImageryProviders/mapboxTerrain.png"),creationFunction:function(){return new a({mapId:"mapbox.streets"})}})),l.push(new s({name:"Mapbox Streets Classic",tooltip:"Mapbox streets basic imagery https://www.mapbox.com/maps/",iconUrl:e("Widgets/Images/ImageryProviders/mapboxStreets.png"),creationFunction:function(){return new a({mapId:"mapbox.streets-basic"})}})),l.push(new s({name:"ESRI World Imagery",iconUrl:e("Widgets/Images/ImageryProviders/esriWorldImagery.png"),tooltip:"World Imagery provides one meter or better satellite and aerial imagery in many parts of the world and lower resolution satellite imagery worldwide. The map includes NASA Blue Marble: Next Generation 500m resolution imagery at small scales (above 1:1,000,000), i-cubed 15m eSAT imagery at medium-to-large scales (down to 1:70,000) for the world, and USGS 15m Landsat imagery for Antarctica. The map features 0.3m resolution imagery in the continental United States and 0.6m resolution imagery in parts of Western Europe from DigitalGlobe. In other parts of the world, 1 meter resolution imagery is available from GeoEye IKONOS, i-cubed Nationwide Prime, Getmapping, AeroGRID, IGN Spain, and IGP Portugal. Additionally, imagery at different resolutions has been contributed by the GIS User Community.\nhttp://www.esri.com",creationFunction:function(){return new t({url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",enablePickFeatures:!1})}})),l.push(new s({name:"ESRI World Street Map",iconUrl:e("Widgets/Images/ImageryProviders/esriWorldStreetMap.png"),tooltip:"This worldwide street map presents highway-level data for the world. Street-level data includes the United States; much of Canada; Japan; most countries in Europe; Australia and New Zealand; India; parts of South America including Argentina, Brazil, Chile, Colombia, and Venezuela; Ghana; and parts of southern Africa including Botswana, Lesotho, Namibia, South Africa, and Swaziland.\nhttp://www.esri.com",creationFunction:function(){return new t({url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer",enablePickFeatures:!1})}})),l.push(new s({name:"ESRI National Geographic",iconUrl:e("Widgets/Images/ImageryProviders/esriNationalGeographic.png"),tooltip:"This web map contains the National Geographic World Map service. This map service is designed to be used as a general reference map for informational and educational purposes as well as a basemap by GIS professionals and other users for creating web maps and web mapping applications.\nhttp://www.esri.com",creationFunction:function(){return new t({url:"https://services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/",enablePickFeatures:!1})}})),l.push(new s({name:"Open­Street­Map",iconUrl:e("Widgets/Images/ImageryProviders/openStreetMap.png"),tooltip:"OpenStreetMap (OSM) is a collaborative project to create a free editable map of the world.\nhttp://www.openstreetmap.org",creationFunction:function(){return n({url:"https://a.tile.openstreetmap.org/"})}})),l.push(new s({name:"Stamen Watercolor",iconUrl:e("Widgets/Images/ImageryProviders/stamenWatercolor.png"),tooltip:"Reminiscent of hand drawn maps, Stamen watercolor maps apply raster effect area washes and organic edges over a paper texture to add warm pop to any map.\nhttp://maps.stamen.com",creationFunction:function(){return n({url:"https://stamen-tiles.a.ssl.fastly.net/watercolor/",credit:"Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA."})}})),l.push(new s({name:"Stamen Toner",iconUrl:e("Widgets/Images/ImageryProviders/stamenToner.png"),tooltip:"A high contrast black and white map.\nhttp://maps.stamen.com",creationFunction:function(){return n({url:"https://stamen-tiles.a.ssl.fastly.net/toner/",credit:"Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA."})}})),l.push(new s({name:"The Black Marble",iconUrl:e("Widgets/Images/ImageryProviders/blackMarble.png"),tooltip:"The lights of cities and villages trace the outlines of civilization in this global view of the Earth at night as seen by NASA/NOAA's Suomi NPP satellite.",creationFunction:function(){return o({url:"https://cesiumjs.org/blackmarble",flipXY:!0,credit:"Black Marble imagery courtesy NASA Earth Observatory"})}})),l.push(new s({name:"Natural Earth II",iconUrl:e("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:"Natural Earth II, darkened for contrast.\nhttp://www.naturalearthdata.com/",creationFunction:function(){return o({url:e("Assets/Textures/NaturalEarthII")})}})),l}return l}),i("Widgets/BaseLayerPicker/createDefaultTerrainProviderViewModels",["../../Core/buildModuleUrl","../../Core/CesiumTerrainProvider","../../Core/EllipsoidTerrainProvider","../BaseLayerPicker/ProviderViewModel"],function(e,t,i,r){"use strict";function n(){var n=[];return n.push(new r({name:"WGS84 Ellipsoid",iconUrl:e("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",creationFunction:function(){return new i}})),n.push(new r({name:"STK World Terrain meshes",iconUrl:e("Widgets/Images/TerrainProviders/STK.png"),tooltip:"High-resolution, mesh-based terrain for the entire globe. Free for use on the Internet. Closed-network options are available.\nhttp://www.agi.com",creationFunction:function(){return new t({url:"https://assets.agi.com/stk-terrain/world",requestWaterMask:!0,requestVertexNormals:!0})}})),n}return n}),i("Widgets/CesiumInspector/CesiumInspectorViewModel",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/Rectangle","../../Core/ScreenSpaceEventHandler","../../Core/ScreenSpaceEventType","../../Scene/DebugModelMatrixPrimitive","../../Scene/PerformanceDisplay","../../Scene/TileCoordinatesImageryProvider","../../ThirdParty/knockout","../createCommand"],function(e,t,i,r,n,o,a,s,l,u,c,h){"use strict";function d(t){var i;if(e(t)){i="Command Statistics";var r=t.commandsInFrustums;for(var n in r)if(r.hasOwnProperty(n)){var o,a=parseInt(n,10);if(7===a)o="1, 2 and 3";else{for(var s=[],l=2;l>=0;l--){var u=Math.pow(2,l);a>=u&&(s.push(l+1),a-=u)}o=s.reverse().join(" and ")}i+="<br>    "+r[n]+" in frustum "+o}i+="<br>Total: "+t.totalCommands}return i}function p(e,t,i){var r=Math.min(i,t);return r=Math.max(r,e)}function m(t,i){function r(t){var i=m._scene.pick({x:t.position.x,y:t.position.y});e(i)&&(m.primitive=e(i.collection)?i.collection:i.primitive),m.pickPrimitiveActive=!1}function d(t){var i,r=g.ellipsoid,o=m._scene.camera.pickEllipsoid({x:t.position.x,y:t.position.y},r);if(e(o))for(var a=r.cartesianToCartographic(o),s=g._surface.tileProvider._tilesToRenderByTextureCount,l=0;!i&&l<s.length;++l){var u=s[l];if(e(u))for(var c=0;!i&&c<u.length;++c){var h=u[c];n.contains(h.rectangle,a)&&(i=h)}}m.tile=i,m.pickTileActive=!1}var m=this,f=t.canvas,_=new o(f);this._eventHandler=_,this._scene=t,this._canvas=f,this._primitive=void 0,this._tile=void 0,this._modelMatrixPrimitive=void 0,this._performanceDisplay=void 0,this._performanceContainer=i;var g=this._scene.globe;g.depthTestAgainstTerrain=!0,this.frustums=!1,this.performance=!1,this.shaderCacheText="",this.primitiveBoundingSphere=!1,this.primitiveReferenceFrame=!1,this.filterPrimitive=!1,this.tileBoundingSphere=!1,this.filterTile=!1,this.wireframe=!1,this.globeDepth=!1,this.pickDepth=!1,this.depthFrustum=1,this._numberOfFrustums=1,this.suspendUpdates=!1,this.tileCoordinates=!1,this.frustumStatisticText=!1,this.tileText="",this.hasPickedPrimitive=!1,this.hasPickedTile=!1,this.pickPrimitiveActive=!1,this.pickTileActive=!1,this.dropDownVisible=!0,this.generalVisible=!0,this.primitivesVisible=!1,this.terrainVisible=!1,this.depthFrustumText="",this.generalSwitchText=c.pureComputed(function(){return m.generalVisible?"-":"+"}),this.primitivesSwitchText=c.pureComputed(function(){return m.primitivesVisible?"-":"+"}),this.terrainSwitchText=c.pureComputed(function(){return m.terrainVisible?"-":"+"}),c.track(this,["frustums","performance","shaderCacheText","primitiveBoundingSphere","primitiveReferenceFrame","filterPrimitive","tileBoundingSphere","filterTile","wireframe","globeDepth","pickDepth","depthFrustum","suspendUpdates","tileCoordinates","frustumStatisticText","tileText","hasPickedPrimitive","hasPickedTile","pickPrimitiveActive","pickTileActive","dropDownVisible","generalVisible","primitivesVisible","terrainVisible","depthFrustumText"]),this._toggleDropDown=h(function(){m.dropDownVisible=!m.dropDownVisible}),this._toggleGeneral=h(function(){m.generalVisible=!m.generalVisible}),this._togglePrimitives=h(function(){m.primitivesVisible=!m.primitivesVisible}),this._toggleTerrain=h(function(){m.terrainVisible=!m.terrainVisible}),this._frustumsSubscription=c.getObservable(this,"frustums").subscribe(function(e){m._scene.debugShowFrustums=e}),this._performanceSubscription=c.getObservable(this,"performance").subscribe(function(e){e?m._performanceDisplay=new l({container:m._performanceContainer}):m._performanceContainer.innerHTML=""}),this._showPrimitiveBoundingSphere=h(function(){return m._primitive.debugShowBoundingVolume=m.primitiveBoundingSphere,!0}),this._primitiveBoundingSphereSubscription=c.getObservable(this,"primitiveBoundingSphere").subscribe(function(){m._showPrimitiveBoundingSphere()}),this._showPrimitiveReferenceFrame=h(function(){if(m.primitiveReferenceFrame){var t=m._primitive.modelMatrix;m._modelMatrixPrimitive=new s({modelMatrix:t}),m._scene.primitives.add(m._modelMatrixPrimitive)}else e(m._modelMatrixPrimitive)&&(m._scene.primitives.remove(m._modelMatrixPrimitive),m._modelMatrixPrimitive=void 0);return!0}),this._primitiveReferenceFrameSubscription=c.getObservable(this,"primitiveReferenceFrame").subscribe(function(){m._showPrimitiveReferenceFrame()}),this._doFilterPrimitive=h(function(){return m.filterPrimitive?m._scene.debugCommandFilter=function(t){return!(!e(m._modelMatrixPrimitive)||t.owner!==m._modelMatrixPrimitive._primitive)||!!e(m._primitive)&&(t.owner===m._primitive||t.owner===m._primitive._billboardCollection||t.owner.primitive===m._primitive)}:m._scene.debugCommandFilter=void 0,!0}),this._filterPrimitiveSubscription=c.getObservable(this,"filterPrimitive").subscribe(function(){m._doFilterPrimitive()}),this._wireframeSubscription=c.getObservable(this,"wireframe").subscribe(function(e){g._surface.tileProvider._debug.wireframe=e}),this._globeDepthSubscription=c.getObservable(this,"globeDepth").subscribe(function(e){m._scene.debugShowGlobeDepth=e}),this._pickDepthSubscription=c.getObservable(this,"pickDepth").subscribe(function(e){m._scene.debugShowPickDepth=e}),this._depthFrustumSubscription=c.getObservable(this,"depthFrustum").subscribe(function(e){m.scene.debugShowDepthFrustum=e}),this._incrementDepthFrustum=h(function(){var e=m.depthFrustum+1;return m.depthFrustum=p(1,m._numberOfFrustums,e),!0}),this._decrementDepthFrustum=h(function(){var e=m.depthFrustum-1;return m.depthFrustum=p(1,m._numberOfFrustums,e),!0}),this._suspendUpdatesSubscription=c.getObservable(this,"suspendUpdates").subscribe(function(e){g._surface._debug.suspendLodUpdate=e,e||(m.filterTile=!1)});var v;this._showTileCoordinates=h(function(){return m.tileCoordinates&&!e(v)?v=t.imageryLayers.addImageryProvider(new u({tilingScheme:t.terrainProvider.tilingScheme})):!m.tileCoordinates&&e(v)&&(t.imageryLayers.remove(v),v=void 0),!0}),this._tileCoordinatesSubscription=c.getObservable(this,"tileCoordinates").subscribe(function(){m._showTileCoordinates()}),this._tileBoundingSphereSubscription=c.getObservable(this,"tileBoundingSphere").subscribe(function(){m._showTileBoundingSphere()}),this._showTileBoundingSphere=h(function(){return m.tileBoundingSphere?g._surface.tileProvider._debug.boundingSphereTile=m._tile:g._surface.tileProvider._debug.boundingSphereTile=void 0,!0}),this._doFilterTile=h(function(){return m.filterTile?(m.suspendUpdates=!0,g._surface._tilesToRender=[],e(m._tile)&&g._surface._tilesToRender.push(m._tile)):m.suspendUpdates=!1,!0}),this._filterTileSubscription=c.getObservable(this,"filterTile").subscribe(function(){m.doFilterTile()}),this._pickPrimitive=h(function(){m.pickPrimitiveActive=!m.pickPrimitiveActive}),this._pickPrimitiveActiveSubscription=c.getObservable(this,"pickPrimitiveActive").subscribe(function(e){e?_.setInputAction(r,a.LEFT_CLICK):_.removeInputAction(a.LEFT_CLICK); +}),this._pickTile=h(function(){m.pickTileActive=!m.pickTileActive}),this._pickTileActiveSubscription=c.getObservable(this,"pickTileActive").subscribe(function(e){e?_.setInputAction(d,a.LEFT_CLICK):_.removeInputAction(a.LEFT_CLICK)})}return t(m.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},toggleDropDown:{get:function(){return this._toggleDropDown}},showPrimitiveBoundingSphere:{get:function(){return this._showPrimitiveBoundingSphere}},showPrimitiveReferenceFrame:{get:function(){return this._showPrimitiveReferenceFrame}},doFilterPrimitive:{get:function(){return this._doFilterPrimitive}},incrementDepthFrustum:{get:function(){return this._incrementDepthFrustum}},decrementDepthFrustum:{get:function(){return this._decrementDepthFrustum}},showTileCoordinates:{get:function(){return this._showTileCoordinates}},showTileBoundingSphere:{get:function(){return this._showTileBoundingSphere}},doFilterTile:{get:function(){return this._doFilterTile}},toggleGeneral:{get:function(){return this._toggleGeneral}},togglePrimitives:{get:function(){return this._togglePrimitives}},toggleTerrain:{get:function(){return this._toggleTerrain}},pickPrimitive:{get:function(){return this._pickPrimitive}},pickTile:{get:function(){return this._pickTile}},selectParent:{get:function(){var e=this;return h(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){var e=this;return h(function(){e.tile=e.tile.northwestChild})}},selectNE:{get:function(){var e=this;return h(function(){e.tile=e.tile.northeastChild})}},selectSW:{get:function(){var e=this;return h(function(){e.tile=e.tile.southwestChild})}},selectSE:{get:function(){var e=this;return h(function(){e.tile=e.tile.southeastChild})}},primitive:{set:function(t){var i=this._primitive;t!==i&&(this.hasPickedPrimitive=!0,e(i)&&(i.debugShowBoundingVolume=!1),this._scene.debugCommandFilter=void 0,e(this._modelMatrixPrimitive)&&(this._scene.primitives.remove(this._modelMatrixPrimitive),this._modelMatrixPrimitive=void 0),this._primitive=t,t.show=!1,setTimeout(function(){t.show=!0},50),this.showPrimitiveBoundingSphere(),this.showPrimitiveReferenceFrame(),this.doFilterPrimitive())},get:function(){return this._primitive}},tile:{set:function(t){if(e(t)){this.hasPickedTile=!0;var i=this._tile;t!==i&&(this.tileText="L: "+t.level+" X: "+t.x+" Y: "+t.y,this.tileText+="<br>SW corner: "+t.rectangle.west+", "+t.rectangle.south,this.tileText+="<br>NE corner: "+t.rectangle.east+", "+t.rectangle.north,this.tileText+="<br>Min: "+t.data.minimumHeight+" Max: "+t.data.maximumHeight),this._tile=t,this.showTileBoundingSphere(),this.doFilterTile()}else this.hasPickedTile=!1,this._tile=void 0},get:function(){return this._tile}},update:{get:function(){var e=this;return function(){e.frustums&&(e.frustumStatisticText=d(e._scene.debugFrustumStatistics));var t=e._scene.numberOfFrustums;e._numberOfFrustums=t,e.depthFrustum=p(1,t,e.depthFrustum),e.depthFrustumText=e.depthFrustum+" of "+t,e.performance&&e._performanceDisplay.update(),e.primitiveReferenceFrame&&(e._modelMatrixPrimitive.modelMatrix=e._primitive.modelMatrix),e.shaderCacheText="Cached shaders: "+e._scene.context.shaderCache.numberOfShaders}}}}),m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){return this._eventHandler.destroy(),this._frustumsSubscription.dispose(),this._performanceSubscription.dispose(),this._primitiveBoundingSphereSubscription.dispose(),this._primitiveReferenceFrameSubscription.dispose(),this._filterPrimitiveSubscription.dispose(),this._wireframeSubscription.dispose(),this._globeDepthSubscription.dispose(),this._pickDepthSubscription.dispose(),this._depthFrustumSubscription.dispose(),this._suspendUpdatesSubscription.dispose(),this._tileCoordinatesSubscription.dispose(),this._tileBoundingSphereSubscription.dispose(),this._filterTileSubscription.dispose(),this._pickPrimitiveActiveSubscription.dispose(),this._pickTileActiveSubscription.dispose(),i(this)},m}),i("Widgets/CesiumInspector/CesiumInspector",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./CesiumInspectorViewModel"],function(e,t,i,r,n,o,a){"use strict";function s(e,t){e=o(e);var i=document.createElement("div"),r=new a(t,i);this._viewModel=r,this._container=e;var s=document.createElement("div");this._element=s;var l=document.createElement("div");l.textContent="Cesium Inspector",l.className="cesium-cesiumInspector-button",l.setAttribute("data-bind","click: toggleDropDown"),s.appendChild(l),s.className="cesium-cesiumInspector",s.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : dropDownVisible, "cesium-cesiumInspector-hidden" : !dropDownVisible }'),e.appendChild(this._element);var u=document.createElement("div");this._panel=u,u.className="cesium-cesiumInspector-dropDown",s.appendChild(u);var c=document.createElement("div");c.className="cesium-cesiumInspector-sectionHeader";var h=document.createElement("span");h.className="cesium-cesiumInspector-toggleSwitch",h.setAttribute("data-bind","click: toggleGeneral, text: generalSwitchText"),c.appendChild(h),c.appendChild(document.createTextNode("General")),u.appendChild(c);var d=document.createElement("div");d.className="cesium-cesiumInspector-section",d.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : generalVisible, "cesium-cesiumInspector-hide" : !generalVisible}'),u.appendChild(d);var p=document.createElement("div");d.appendChild(p);var m=document.createElement("div");m.className="cesium-cesiumInspector-frustumStats",m.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : frustums, "cesium-cesiumInspector-hide" : !frustums}, html: frustumStatisticText');var f=document.createElement("input");f.type="checkbox",f.setAttribute("data-bind","checked: frustums"),p.appendChild(f),p.appendChild(document.createTextNode("Show Frustums")),p.appendChild(m);var _=document.createElement("div");d.appendChild(_);var g=document.createElement("input");g.type="checkbox",g.setAttribute("data-bind","checked: performance"),_.appendChild(g),_.appendChild(document.createTextNode("Performance Display")),i.className="cesium-cesiumInspector-performanceDisplay",d.appendChild(i);var v=document.createElement("div");v.className="cesium-cesiumInspector-shaderCache",v.setAttribute("data-bind","html: shaderCacheText"),d.appendChild(v);var y=document.createElement("div");d.appendChild(y);var C=document.createElement("input");C.type="checkbox",C.setAttribute("data-bind","checked: globeDepth"),y.appendChild(C),y.appendChild(document.createTextNode("Show globe depth"));var w=document.createElement("div");y.appendChild(w);var S=document.createElement("div");d.appendChild(S);var E=document.createElement("input");E.type="checkbox",E.setAttribute("data-bind","checked: pickDepth"),S.appendChild(E),S.appendChild(document.createTextNode("Show pick depth"));var b=document.createElement("div");d.appendChild(b);var T=document.createElement("span");T.setAttribute("data-bind",'html: "     Frustum:"'),b.appendChild(T);var x=document.createElement("span");x.setAttribute("data-bind","text: depthFrustumText"),b.appendChild(x);var A=document.createElement("input");A.type="button",A.value="-",A.className="cesium-cesiumInspector-pickButton",A.setAttribute("data-bind","click: decrementDepthFrustum"),b.appendChild(A);var P=document.createElement("input");P.type="button",P.value="+",P.className="cesium-cesiumInspector-pickButton",P.setAttribute("data-bind","click: incrementDepthFrustum"),b.appendChild(P);var D=document.createElement("div");D.className="cesium-cesiumInspector-sectionHeader",h=document.createElement("span"),h.className="cesium-cesiumInspector-toggleSwitch",h.setAttribute("data-bind","click: togglePrimitives, text: primitivesSwitchText"),D.appendChild(h),D.appendChild(document.createTextNode("Primitives")),u.appendChild(D);var M=document.createElement("div");M.className="cesium-cesiumInspector-section",M.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : primitivesVisible, "cesium-cesiumInspector-hide" : !primitivesVisible}'),u.appendChild(M);var I=document.createElement("div");I.className="cesium-cesiumInspector-pickSection",M.appendChild(I);var R=document.createElement("input");R.type="button",R.value="Pick a primitive",R.className="cesium-cesiumInspector-pickButton",R.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');var O=document.createElement("div");O.className="cesium-cesiumInspector-center",O.appendChild(R),I.appendChild(O);var N=document.createElement("div");I.appendChild(N);var L=document.createElement("input");L.type="checkbox",L.setAttribute("data-bind","checked: primitiveBoundingSphere, enable: hasPickedPrimitive"),N.appendChild(L),N.appendChild(document.createTextNode("Show bounding sphere"));var B=document.createElement("div");I.appendChild(B);var F=document.createElement("input");F.type="checkbox",F.setAttribute("data-bind","checked: primitiveReferenceFrame, enable: hasPickedPrimitive"),B.appendChild(F),B.appendChild(document.createTextNode("Show reference frame"));var V=document.createElement("div");this._primitiveOnly=V,I.appendChild(V);var k=document.createElement("input");k.type="checkbox",k.setAttribute("data-bind","checked: filterPrimitive, enable: hasPickedPrimitive"),V.appendChild(k),V.appendChild(document.createTextNode("Show only selected"));var z=document.createElement("div");z.className="cesium-cesiumInspector-sectionHeader",h=document.createElement("span"),h.className="cesium-cesiumInspector-toggleSwitch",h.setAttribute("data-bind","click: toggleTerrain, text: terrainSwitchText"),z.appendChild(h),z.appendChild(document.createTextNode("Terrain")),u.appendChild(z);var U=document.createElement("div");U.className="cesium-cesiumInspector-section",U.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : terrainVisible, "cesium-cesiumInspector-hide" : !terrainVisible}'),u.appendChild(U);var G=document.createElement("div");G.className="cesium-cesiumInspector-pickSection",U.appendChild(G);var W=document.createElement("input");W.type="button",W.value="Pick a tile",W.className="cesium-cesiumInspector-pickButton",W.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),O=document.createElement("div"),O.appendChild(W),O.className="cesium-cesiumInspector-center",G.appendChild(O);var H=document.createElement("div");G.appendChild(H);var q=document.createElement("input");q.type="button",q.value="Parent",q.className="cesium-cesiumInspector-pickButton",q.setAttribute("data-bind","click: selectParent");var j=document.createElement("input");j.type="button",j.value="NW",j.className="cesium-cesiumInspector-pickButton",j.setAttribute("data-bind","click: selectNW");var Y=document.createElement("input");Y.type="button",Y.value="NE",Y.className="cesium-cesiumInspector-pickButton",Y.setAttribute("data-bind","click: selectNE");var X=document.createElement("input");X.type="button",X.value="SW",X.className="cesium-cesiumInspector-pickButton",X.setAttribute("data-bind","click: selectSW");var Z=document.createElement("input");Z.type="button",Z.value="SE",Z.className="cesium-cesiumInspector-pickButton",Z.setAttribute("data-bind","click: selectSE");var K=document.createElement("div");K.className="cesium-cesiumInspector-tileText",H.className="cesium-cesiumInspector-frustumStats",H.appendChild(K),H.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : hasPickedTile, "cesium-cesiumInspector-hide" : !hasPickedTile}'),K.setAttribute("data-bind","html: tileText");var Q=document.createElement("div");Q.className="cesium-cesiumInspector-relativeText",Q.textContent="Select relative:",H.appendChild(Q);var J=document.createElement("table"),$=document.createElement("tr"),ee=document.createElement("tr"),te=document.createElement("td");te.appendChild(q);var ie=document.createElement("td");ie.appendChild(j);var re=document.createElement("td");re.appendChild(Y),$.appendChild(te),$.appendChild(ie),$.appendChild(re);var ne=document.createElement("td"),oe=document.createElement("td");oe.appendChild(X);var ae=document.createElement("td");ae.appendChild(Z),ee.appendChild(ne),ee.appendChild(oe),ee.appendChild(ae),J.appendChild($),J.appendChild(ee),H.appendChild(J);var se=document.createElement("div");G.appendChild(se);var le=document.createElement("input");le.type="checkbox",le.setAttribute("data-bind","checked: tileBoundingSphere, enable: hasPickedTile"),se.appendChild(le),se.appendChild(document.createTextNode("Show bounding volume"));var ue=document.createElement("div");G.appendChild(ue);var ce=document.createElement("input");ce.type="checkbox",ce.setAttribute("data-bind","checked: filterTile, enable: hasPickedTile"),ue.appendChild(ce),ue.appendChild(document.createTextNode("Show only selected"));var he=document.createElement("div");U.appendChild(he);var de=document.createElement("input");de.type="checkbox",de.setAttribute("data-bind","checked: wireframe"),he.appendChild(de),he.appendChild(document.createTextNode("Wireframe"));var pe=document.createElement("div");U.appendChild(pe);var me=document.createElement("input");me.type="checkbox",me.setAttribute("data-bind","checked: suspendUpdates"),pe.appendChild(me),pe.appendChild(document.createTextNode("Suspend LOD update"));var fe=document.createElement("div");U.appendChild(fe);var _e=document.createElement("input");_e.type="checkbox",_e.setAttribute("data-bind","checked: tileCoordinates"),fe.appendChild(_e),fe.appendChild(document.createTextNode("Show tile coordinates")),n.applyBindings(r,this._element)}return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return n.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),i(this)},s}),i("Widgets/CesiumWidget/CesiumWidget",["../../Core/buildModuleUrl","../../Core/Cartesian3","../../Core/Clock","../../Core/Credit","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/Ellipsoid","../../Core/FeatureDetection","../../Core/formatError","../../Core/requestAnimationFrame","../../Core/ScreenSpaceEventHandler","../../Scene/BingMapsImageryProvider","../../Scene/Globe","../../Scene/Moon","../../Scene/Scene","../../Scene/SceneMode","../../Scene/ShadowMode","../../Scene/SkyAtmosphere","../../Scene/SkyBox","../../Scene/Sun","../getElement"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E){"use strict";function b(t){return e("Assets/Textures/SkyBox/tycho2t3_80_"+t+".jpg")}function T(e){function t(r){if(!e.isDestroyed())if(e._useDefaultRenderLoop)try{var n=e._targetFrameRate;if(o(n)){var a=1e3/n,s=r-i;s>a&&(e.resize(),e.render(),i=r-s%a),d(t)}else e.resize(),e.render(),d(t)}catch(t){if(e._useDefaultRenderLoop=!1,e._renderLoopRunning=!1,e._showRenderLoopErrors){var l="An error occurred while rendering. Rendering has stopped.";e.showErrorPanel(l,void 0,t)}}else e._renderLoopRunning=!1}e._renderLoopRunning=!0;var i=0;d(t)}function x(e){var t=e._canvas,i=t.clientWidth,r=t.clientHeight,o=e._resolutionScale;e._supportsImageRenderingPixelated||(o*=n(window.devicePixelRatio,1)),e._canvasWidth=i,e._canvasHeight=r,i*=o,r*=o,t.width=i,t.height=r,e._canRender=0!==i&&0!==r}function A(e){var t=e._canvas,i=t.width,r=t.height;if(0!==i&&0!==r){var n=e._scene.camera.frustum;o(n.aspectRatio)?n.aspectRatio=i/r:(n.top=n.right*(r/i),n.bottom=-n.top)}}function P(e,a){e=E(e),a=n(a,{});var s=document.createElement("div");s.className="cesium-widget",e.appendChild(s);var l=document.createElement("canvas"),h=c.supportsImageRenderingPixelated();this._supportsImageRenderingPixelated=h,h&&(l.style.imageRendering=c.imageRenderingValue()),l.oncontextmenu=function(){return!1},l.onselectstart=function(){return!1},s.appendChild(l);var d=document.createElement("div");d.className="cesium-widget-credits";var T=o(a.creditContainer)?E(a.creditContainer):s;T.appendChild(d);var P=n(a.showRenderLoopErrors,!0);this._element=s,this._container=e,this._canvas=l,this._canvasWidth=0,this._canvasHeight=0,this._creditContainer=d,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=P,this._resolutionScale=1,this._forceResize=!1,this._clock=o(a.clock)?a.clock:new i,x(this);try{var M=new g({canvas:l,contextOptions:a.contextOptions,creditContainer:d,mapProjection:a.mapProjection,orderIndependentTranslucency:a.orderIndependentTranslucency,scene3DOnly:n(a.scene3DOnly,!1),terrainExaggeration:a.terrainExaggeration,shadows:a.shadows,mapMode2D:a.mapMode2D});this._scene=M,M.camera.constrainedAxis=t.UNIT_Z,A(this);var I=n(M.mapProjection.ellipsoid,u.WGS84),R=M.frameState.creditDisplay,O=new r("Cesium",D,"http://cesiumjs.org/");R.addDefaultCredit(O);var N=a.globe;o(N)||(N=new f(I)),N!==!1&&(M.globe=N,M.globe.shadows=n(a.terrainShadows,y.RECEIVE_ONLY));var L=a.skyBox;o(L)||(L=new w({sources:{positiveX:b("px"),negativeX:b("mx"),positiveY:b("py"),negativeY:b("my"),positiveZ:b("pz"),negativeZ:b("mz")}})),L!==!1&&(M.skyBox=L,M.sun=new S,M.moon=new _);var B=a.skyAtmosphere;o(B)||(B=new C(I)),B!==!1&&(M.skyAtmosphere=B);var F=a.globe!==!1&&a.imageryProvider;o(F)||(F=new m({url:"https://dev.virtualearth.net"})),F!==!1&&M.imageryLayers.addImageryProvider(F),o(a.terrainProvider)&&a.globe!==!1&&(M.terrainProvider=a.terrainProvider),this._screenSpaceEventHandler=new p(l,!1),o(a.sceneMode)&&(a.sceneMode===v.SCENE2D&&this._scene.morphTo2D(0),a.sceneMode===v.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)),this._useDefaultRenderLoop=void 0,this.useDefaultRenderLoop=n(a.useDefaultRenderLoop,!0),this._targetFrameRate=void 0,this.targetFrameRate=a.targetFrameRate;var V=this;M.renderError.addEventListener(function(e,t){if(V._useDefaultRenderLoop=!1,V._renderLoopRunning=!1,V._showRenderLoopErrors){var i="An error occurred while rendering. Rendering has stopped.";V.showErrorPanel(i,void 0,t)}})}catch(e){if(P){var k="Error constructing CesiumWidget.",z='Visit <a href="http://get.webgl.org">http://get.webgl.org</a> to verify that your web browser and hardware support WebGL. Consider trying a different web browser or updating your video drivers. Detailed error information is below:';this.showErrorPanel(k,z,e)}throw e}}var D="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHYAAAAeCAYAAAD5AOomAAAQWUlEQVR42u1beXxOxxpudrEktkbUkriI4lZpq5JbW6pJuFG0qrFeexVRak3TBm3RUgS1hFhrCdKgQWKLrUGQBiVBJMgiq0Qiuyxzn/fzTu74ZPnS9nfrj4zf8/ty5sw7M+c8824zx0svVa3oAfqAAWAIGAHGCoy43oDb6TGqywta9JgsIq4GUAswB+oDDRXU5/ragCm3N6gm+MUkVJ+1kAg1AyyA5oAN8BrQCXiTfzsArwLWgCVQF6jJBOtXk/tikWrMGkiEtgTeAOyBfsAQS0vL8YMHD/aws7ObiuthwAeAA/A20AZozAvCRNHe6vI3k2rCprUp8DoR1qVLF1c/P7+A5OTkhyUlJaKwuETkPSkRBUUlgkpmZmbW2bNnQyZOnLgA7Z2BzkALNtM1qsl9MTSVSLUCugADAwMDTxKZVI7cfCw8DiWK6fselMLtlwSxJyxDPM4vFsXFxSWRkZFRkBsOdAdaAw2qyf37ij77RDMm1a5evXojY2NjH5BW7ruaIab4xotPd8cJV/xO0cKkPXGae97n0kR6TpHIzs7O7d279xdsvoncemwJqn3u/1lbDTnqfYXN6JCUlJS03CfFwt0/4TkiK8IEEBydWiBIy21tbaejr24cWJlpBVT6ShpVFvS10iddZP6MbFkyqpw2Kor6K5P9M33onG1Iv0omsz3Q//79+7HpuUViDsys697KyZy89ynk9Wc/x4u7DwvE48ePs2mRcARtqUTLRjxmDa6rpYWanDqZKHmyzJ+lTFlyUrZGGbIm3GdF49VQcnMjZUwTJW83Ua4NtayQmlEYKW1NlOc11RrLoAxLpqdYUSmnPlOlbk1qa21OZ7ovX758E/lTz1MpOmvp5gvp4qeL6c8sAjLNOQXF4sKFC6Hotw+nSrR46rAfb8hkN+WxVTTlyPplNuNmDArGGgFNgGZloClbHQtua8bj1eW+GnObZspY2nL1WKaOkreraKDk7jXLsEJGXG+u1b4Bz/0VZayyUkO5f2DCc5DvyZL/1inb0ONVU5+1dSBMcHrIvRwNMbqQ6u6fKGSZ4POszFaQDZNc0q9fvzkcjFkzKf/gfJjSo3c40OrBoL+7cvvXeUFYM17l1MuOTbxEV8a/uE8pZ8Ww4bouPJ62bFlyzXmebRg2jLY8jxa8WGopxEiX9jLff1Vp357zfluefyeOPxpp9WHAGl2fn/k1do+Ef/K86lYWs+hzJ7SSbXv06OFGAfAMRLtlBUjkPyfuidMyw3Fi37UM8TMCLFVj6W9qW1BYIg4ePBjEWkukdCTyZsyYMcvX13f7iRMnDv36669B0OxTBKRNx4OCggIPHDiwa+XKld+j7Xv84v/l4+Oz6PLlywHnzp07Su0gdyw4OPgYXQNHzp8/f+TixYuHw8LCDuDeGiaLXqLj6tWrlyLC9ztz5gy1PwEcV3AU89i3detWT2NjYyeWedvLy2va77//7hcREeHfsWPH91HX6/r16/7h4eH+6H+ZVtQvN3ToujXm9wPJYS6+FhYWzggmh4eGhh6hsTHnE/j7eN++fQczWY1Yc6WrIVJb0SLEu9iJ93I0JCTkKMY+PHLkSGe2MLV5TL3ytgxr88pwuHLlyvXY9CcaH6mSR5HwwRuPRWZekTgXnfPcfW0QqfMDk0Qc+nqCnDc+Pj6FNzJoE+PfeDEXhQ6FtD0rKyu9Tp06LpAbBN9/S+hYEJmnck79EazQA5myVTKeyM/Pp7jgI2AAXv4JeW/AgAGzUTdKXj969CiOF04T1jhj/qXrzrgfQ+0KUdq1azdt6tSpntrjxcTEUGroyBrdkLmoy3x0HT9+vIe2zIoVK9y5fT0eU688/2rOJqY/bTRcjsl5hqRPYF5P38nSdJrwMErzezMpX1NfHrELjiQ9fbl56SIjO5leViH6nwwMnjZt2gL5EmWh/Lf4f+U5BtauXbsJshPu3LkTLQl/+PBhVmpqagZ+HxHS0tLSCShpGRkZqXhp12i8RYsWrVP7wr1ctM9E2wy0lch88uRJoWwTFRV1A7JjoVnBss7BwWEJ6ubIa/SRgOt32VybKduvZILtMbd4JraoZcuWC8eMGbNN+7noWTt06DCVXUIL9rtNOdj8uABFW+bbb7/9js34y4o5fo5YI14h7QwNDV1yc3MLAsIfP0PS9kvpmg6Db+wXn6/pKrwOztBcn7mTXWbEPHlPvMguKBFFxYXiq819hZu3k6Y9xpgFjN+xY8cBOcmkpKQ0rh8HDCUieHNjHExgmGwHQomkKbdu3bpP10VFRcU2NjZ7UbcKWATMB74C3IBpSn8jTp48eVb2k5iYSNq4BVjJcl8zFrq5ue3Py8vLB/Kg4USa6+nTp0OkLNwUmfYFckGiTRJZH1YKc3Zp5mye+yQnJydQOyyYImtr65XDhw/3lX2B7BJlgaSxhXiL+6K99z4wwadkG/RRLP/28PBYxpaiES+mcokllW4PczcUz1Twy++ZpSTRrhJtUCSnx4gvNzkL9419xBfevUVIxEHNIEuDUp4j90ZCHjSqUHj+/AnaOmnkmFgyIa6Y8Hk5SScnp6VMwLs82Tc5wOkJv9Tfz89v3f79+73xMPTyJyrEloCI8+PGjTs0adIkX1dXVx+Yuu2ff/75tlmzZm1A+xUDBw6kHHo4/GqQHA8Lt9DT0/OSu7v70SlTpuwdMmTIFhC2tlmzZivQ9geAtOFLgLRoGhbFJSnbrVu3DahbrEXs+4pZrMm/FGj1xaJNlMRaWVmtGTZs2D7ZV3R0dA6sWJG8Riayhd1GNzbNo0nTpWWbP3/+dYXY5fyOLCsjti5Hbh/hwfODbmeVkkS5rCgpFgt2DNaQKjHTy16kZsRpBpp1IKE0uNoSkqapO3llp2YBUFuPLf01Jgf9007UFAQCv8lJmpubf4Y6J478rNgMWfHL6cRBE+1e9SXTKInVpdy7d+8KmbOhQ4d+rasMLRjML5xMLlkSBFShCrEbiXxJLDQymQ8/2rN/lKkJXQ+AdUiSxDZv3nydSuzNmzczQWaEvIZbeESuhhf5mLt375Y+Z0BAQDQW7Dl5PXfu3KW6EGvIfoEisL6Ya+p1aBz5z/N3czQdbQ5w12ieSizhu13DEPHmajYiKDXyPJmiaX8t6pSYs8FB04bM8ObAL2ijIg/9zyCtU4lFBDqJA6p2nE/KPLMVmyRbToGcq0osAq0rrFEu8Eve5IfJhOsiCxN8FXJzjx07FqYQ6426JZJYaGQKu463eO4W/EvXLiqx0Ni1MMV+ig9PR5ut0PosWbd582bKHL50cXHZIOMMGqtJkybrQWZpEDdv3rwfdCHWgCM5yo3s/f39j9G8H2Y/tRKXbgUItw2Oz5EqSfMJWvT0dCefA5PsVPHNTx+VtpkFzb4Ve0ncuHHjLq/I0UhJSv1W27Zt57F/6cpp0Gv8awfz6Lxq1ar5P/7448KxY8eSH/5UNcUffPBBQKdOnTZ37tx5la2t7VI7O7vv33nnnYUwrR6Ojo7TEIm6sFkjckfxwvIAaMyvTE1NPRC4LEFQtAH9+yOVSFYiXvLFC48ePXpF1nXv3n09mWqF2Ie4/oTHeIM19Q2+/iQhISFVIXb1iBEj9irWhCL2pXPmzPlF9aOoW4+gL13W7d69+ywtMASApe1glhez2yqXWJnH1uDVRv5tpMY0PE4Qu4IWlkmoNlb6TRKRcaHiQoS/+Ir9sMTCnYM1q27NmjW+tIqJxMOHDwfISe7bty8YdZ8pZ7r9aZOEruE7F2lFqZ+pwRNI8WG/SGTNZuKm8gIawlrusGDBgi+wsEJ+Q8Fq38W+fg7LkHv4hoKwUaNGlWoFLEwuEatqrL29PQVq86TW5+Tk5LP8aDK9PN4AvnaXPhKBbSEW6bLRo0fvkH3FxsYmcaA3m6JzWR8ZGVlKKmUoHAhORFywSysqfqui4Enbz1JE5nz16tXwrNx0nUh9Gkw5QTPfFbPX93pWo6Hpp6740EqkVOc/lNzTZgM0cKVq9qAdmSlPS5IEHjaN8h7Z5iAKpUt48LsyTYCGPcBc7+L3DvLi2xEREYSbt2/fDkdwci0sLOwwRZfbt29frmhFIdpEgehIkqFfRN9RQAzmkSvbQdvIzLqdOnWqNN+GFaAoeircVYr68rHoohG138KYN+mXji1Rny1NKeKWXDMzM/cJEyZskHIPUMiX0ntp06aNm5riSYsA0+zLpn6Ql5fXRnl/8eLFX7NVsygv3VHNcU3ev+xC23800NlrvqUBUFVBckv3jNZMBNHnSvajr/OEHLDaM3X1lSCjoFGjRmRKhyGoiKziBgWZRWf0kSeqUGbOnOlJmod44Iys+/DDD8kiuMAULlMXXWUFUfkhIhB9LpZ1WBwxHBDSexmIBXFTlcHCeMQuqidh586dK+S91atXu3EkXp83KPQrOt0xZq2loMVh2bJlmmT6+OVt0MT3qkiqk1jsM0LkFWQL0iI2rx2UjXfyo73gPzZCu64iyIhHYJMMJU2RoJ0ikBiOiNBn0KBBY/gB7UNDQ3/B/QTcT1SRmpqaQEA/D3A/HtoXGxcXd07uy3bt2nUQSPKHJkbLthIsnwifGY/5/oZ0gnxwb5ojTPG6jIyMGCySBCz4gTJKnz59+szg4OBAjBEFkuIg+wxQojHXszD983hx9Zw8efI4EBZHgFYHsjnV7JdjfkMw50R+hnikauM4QKJspb23t/dkuAeaR9ySJUuG8Lusw9ZWr7KvEU15N4P2Lt9HZKjZdTkeuk3MRcpSVmT8DKEbe2vaePlPFyX4B8IoHfiYH6AJJ+/m7PRtuL47r9revJfch/92YDK78Hxas0xHDrTeU2R6c8rkWIZcK/5mqx1vondnWUeWUdGL++7EL9SG5Tooc2ihFbH3VPpzVOZgz4ugI6durVjLpNV6lRd5Y/5tx3Puxv3Kzf5G3KaFcpjQvCqfHKmH7Y15An3hqDeRWaZo1+fkIjFjXQ9NKiNNNJFJvpR87JLdI8X95HCNj6CjOtrJ4uituXLUZKwk8pbKCUpr5fSkNZNhxe6hIbeXR3bNFBlttOKX0Izb1mfZhtyXFcu20kFOfmZrwQteHtXJI8AmvKfbUulPLiRrTtvk8WFdPhyw4P4b8DupxZrXgOfXTHnmOvyu5P6x/NxX7nIZVuXA3Yg7asyrxoG+RER4HoMorzj/SY64ijw18OIm4Xd2uTh4fq04f+OASEy7pyGUvrqYPXv2CvYfb/JEzbUOlA342lR5MDNFo+UZam1+MBPlgNuU69X25mXI1lIO6qVsTUXWrAK5GloH49qH3Ophf21l/mZlzL2G1gG9aTkfEJgoHwDU1LpvqIxZ0eG8TuTKM8VWbCKcoYGj1q1btwehegJtPVIuSVEmnd8iQDhtbW3tamxs/CGbs7a8OOooDr68z1QMlQdUH0b7kxX1sxbDSmBQzqcoBpXIGJQjo/1ZSmVzqaivyvozqOB96f+Z78b0lLPFumwabFgDe3K+NpDz0kH8rXEvNrttWUvr6/DRuJ6O+CMyf0a2Ku+pqn390Xt/6QduBopPNFe2zFrJaI2dfmv2XZbsz2op5qL6v3m8oF8vqv9/R/oB+Q1RPf41U3yT0R+x/9Xlryn/BY268qsf3smdAAAAAElFTkSuQmCC";return a(P.prototype,{container:{get:function(){return this._container}},canvas:{get:function(){return this._canvas}},creditContainer:{get:function(){return this._creditContainer}},scene:{get:function(){return this._scene}},imageryLayers:{get:function(){return this._scene.imageryLayers}},terrainProvider:{get:function(){return this._scene.terrainProvider},set:function(e){this._scene.terrainProvider=e}},camera:{get:function(){return this._scene.camera}},clock:{get:function(){return this._clock}},screenSpaceEventHandler:{get:function(){return this._screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._targetFrameRate},set:function(e){this._targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._useDefaultRenderLoop},set:function(e){this._useDefaultRenderLoop!==e&&(this._useDefaultRenderLoop=e,e&&!this._renderLoopRunning&&T(this))}},resolutionScale:{get:function(){return this._resolutionScale},set:function(e){this._resolutionScale=e,this._forceResize=!0}}}),P.prototype.showErrorPanel=function(e,t,i){function r(){u.style.maxHeight=Math.max(Math.round(.9*n.clientHeight-100),30)+"px"}var n=this._element,a=document.createElement("div");a.className="cesium-widget-errorPanel";var s=document.createElement("div");s.className="cesium-widget-errorPanel-content",a.appendChild(s);var l=document.createElement("div");l.className="cesium-widget-errorPanel-header",l.appendChild(document.createTextNode(e)),s.appendChild(l);var u=document.createElement("div");if(u.className="cesium-widget-errorPanel-scroll",s.appendChild(u),r(),o(window.addEventListener)&&window.addEventListener("resize",r,!1),o(t)){var c=document.createElement("div");c.className="cesium-widget-errorPanel-message",c.innerHTML="<p>"+t+"</p>",u.appendChild(c)}var d="(no error details available)";o(i)&&(d=h(i));var p=document.createElement("div");p.className="cesium-widget-errorPanel-message",p.appendChild(document.createTextNode(d)),u.appendChild(p);var m=document.createElement("div");m.className="cesium-widget-errorPanel-buttonPanel",s.appendChild(m);var f=document.createElement("button");f.setAttribute("type","button"),f.className="cesium-button",f.appendChild(document.createTextNode("OK")),f.onclick=function(){o(r)&&o(window.removeEventListener)&&window.removeEventListener("resize",r,!1),n.removeChild(a)},m.appendChild(f),n.appendChild(a),"undefined"!=typeof console&&console.error(e+"\n"+t+"\n"+d)},P.prototype.isDestroyed=function(){return!1},P.prototype.destroy=function(){this._scene=this._scene&&this._scene.destroy(),this._container.removeChild(this._element),s(this)},P.prototype.resize=function(){var e=this._canvas,t=e.clientWidth,i=e.clientHeight;(this._forceResize||this._canvasWidth!==t||this._canvasHeight!==i)&&(this._forceResize=!1,x(this),A(this))},P.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();var e=this._clock.tick();this._scene.render(e)}else this._clock.tick()},P}),i("Widgets/ClockViewModel",["../Core/Clock","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/EventHelper","../Core/JulianDate","../ThirdParty/knockout"],function(e,t,i,r,n,o,a){"use strict";function s(i){t(i)||(i=new e),this._clock=i,this._eventHelper=new n,this._eventHelper.add(i.onTick,this.synchronize,this),this.systemTime=a.observable(o.now()),this.systemTime.equalityComparer=o.equals,this.startTime=a.observable(i.startTime),this.startTime.equalityComparer=o.equals,this.startTime.subscribe(function(e){i.startTime=e,this.synchronize()},this),this.stopTime=a.observable(i.stopTime),this.stopTime.equalityComparer=o.equals,this.stopTime.subscribe(function(e){i.stopTime=e,this.synchronize()},this),this.currentTime=a.observable(i.currentTime),this.currentTime.equalityComparer=o.equals,this.currentTime.subscribe(function(e){i.currentTime=e,this.synchronize()},this),this.multiplier=a.observable(i.multiplier),this.multiplier.subscribe(function(e){i.multiplier=e,this.synchronize()},this),this.clockStep=a.observable(i.clockStep),this.clockStep.subscribe(function(e){i.clockStep=e,this.synchronize()},this),this.clockRange=a.observable(i.clockRange),this.clockRange.subscribe(function(e){i.clockRange=e,this.synchronize()},this),this.canAnimate=a.observable(i.canAnimate),this.canAnimate.subscribe(function(e){i.canAnimate=e,this.synchronize()},this),this.shouldAnimate=a.observable(i.shouldAnimate),this.shouldAnimate.subscribe(function(e){i.shouldAnimate=e,this.synchronize()},this),a.track(this,["systemTime","startTime","stopTime","currentTime","multiplier","clockStep","clockRange","canAnimate","shouldAnimate"])}return i(s.prototype,{clock:{get:function(){return this._clock}}}),s.prototype.synchronize=function(){var e=this._clock;this.systemTime=o.now(),this.startTime=e.startTime,this.stopTime=e.stopTime,this.currentTime=e.currentTime,this.multiplier=e.multiplier,this.clockStep=e.clockStep,this.clockRange=e.clockRange,this.canAnimate=e.canAnimate,this.shouldAnimate=e.shouldAnimate},s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){this._eventHelper.removeAll(),r(this)},s}),i("Widgets/Command",["../Core/DeveloperError"],function(e){"use strict";function t(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,e.throwInstantiationError()}return t}),i("Widgets/FullscreenButton/FullscreenButtonViewModel",["../../Core/defaultValue","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/Fullscreen","../../ThirdParty/knockout","../createCommand","../getElement"],function(e,t,i,r,n,o,a,s){"use strict";function l(t){var i=this,r=o.observable(n.fullscreen),l=o.observable(n.enabled);this.isFullscreen=void 0,o.defineProperty(this,"isFullscreen",{get:function(){return r()}}),this.isFullscreenEnabled=void 0,o.defineProperty(this,"isFullscreenEnabled",{get:function(){return l()},set:function(e){l(e&&n.enabled)}}),this.tooltip=void 0,o.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?r()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=a(function(){n.fullscreen?n.exitFullscreen():n.requestFullscreen(i._fullscreenElement)},o.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=e(s(t),document.body),this._callback=function(){r(n.fullscreen)},document.addEventListener(n.changeEventName,this._callback)}return t(l.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}}),l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){document.removeEventListener(n.changeEventName,this._callback),i(this)},l}),i("Widgets/FullscreenButton/FullscreenButton",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./FullscreenButtonViewModel"],function(e,t,i,r,n,o,a){"use strict";function s(e,t){e=o(e);var i=new a(t);i._exitFullScreenPath=u,i._enterFullScreenPath=l;var r=document.createElement("button");r.type="button",r.className="cesium-button cesium-fullscreenButton",r.setAttribute("data-bind","attr: { title: tooltip },click: command,enable: isFullscreenEnabled,cesiumSvgPath: { path: isFullscreen ? _exitFullScreenPath : _enterFullScreenPath, width: 128, height: 128 }"),e.appendChild(r),n.applyBindings(i,r),this._container=e,this._viewModel=i,this._element=r}var l="M 83.96875 17.5625 L 83.96875 17.59375 L 76.65625 24.875 L 97.09375 24.96875 L 76.09375 45.96875 L 81.9375 51.8125 L 102.78125 30.9375 L 102.875 51.15625 L 110.15625 43.875 L 110.1875 17.59375 L 83.96875 17.5625 z M 44.125 17.59375 L 17.90625 17.625 L 17.9375 43.90625 L 25.21875 51.1875 L 25.3125 30.96875 L 46.15625 51.8125 L 52 45.96875 L 31 25 L 51.4375 24.90625 L 44.125 17.59375 z M 46.0625 76.03125 L 25.1875 96.875 L 25.09375 76.65625 L 17.8125 83.9375 L 17.8125 110.21875 L 44 110.25 L 51.3125 102.9375 L 30.90625 102.84375 L 51.875 81.875 L 46.0625 76.03125 z M 82 76.15625 L 76.15625 82 L 97.15625 103 L 76.71875 103.0625 L 84.03125 110.375 L 110.25 110.34375 L 110.21875 84.0625 L 102.9375 76.8125 L 102.84375 97 L 82 76.15625 z",u="M 104.34375 17.5625 L 83.5 38.4375 L 83.40625 18.21875 L 76.125 25.5 L 76.09375 51.78125 L 102.3125 51.8125 L 102.3125 51.78125 L 109.625 44.5 L 89.1875 44.40625 L 110.1875 23.40625 L 104.34375 17.5625 z M 23.75 17.59375 L 17.90625 23.4375 L 38.90625 44.4375 L 18.5 44.53125 L 25.78125 51.8125 L 52 51.78125 L 51.96875 25.53125 L 44.6875 18.25 L 44.625 38.46875 L 23.75 17.59375 z M 25.6875 76.03125 L 18.375 83.3125 L 38.78125 83.40625 L 17.8125 104.40625 L 23.625 110.25 L 44.5 89.375 L 44.59375 109.59375 L 51.875 102.3125 L 51.875 76.0625 L 25.6875 76.03125 z M 102.375 76.15625 L 76.15625 76.1875 L 76.1875 102.4375 L 83.46875 109.71875 L 83.5625 89.53125 L 104.40625 110.375 L 110.25 104.53125 L 89.25 83.53125 L 109.6875 83.46875 L 102.375 76.15625 z"; +return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return this._viewModel.destroy(),n.cleanNode(this._element),this._container.removeChild(this._element),i(this)},s}),i("Widgets/Geocoder/GeocoderViewModel",["../../Core/BingMapsApi","../../Core/BingMapsGeocoderService","../../Core/Cartesian3","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/deprecationWarning","../../Core/DeveloperError","../../Core/Event","../../Core/CartographicGeocoderService","../../Core/Matrix4","../../Core/Rectangle","../../ThirdParty/knockout","../../ThirdParty/when","../createCommand","../getElement"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f){"use strict";function _(i){n(i.geocoderServices)?this._geocoderServices=i.geocoderServices:this._geocoderServices=[new u,new t];var o;this._url=r(i.url,"https://dev.virtualearth.net/"),this._url.length>0&&"/"!==this._url[this._url.length-1]&&(this._url+="/"),this._key=e.getKey(i.key),this._defaultGeocoderOptions={url:this._url,key:this._key},n(i.key)&&(o=e.getErrorCredit(i.key)),n(o)&&i.scene._frameState.creditDisplay.addDefaultCredit(o),this._viewContainer=i.container,this._scene=i.scene,this._flightDuration=i.flightDuration,this._searchText="",this._isSearchInProgress=!1,this._geocodePromise=void 0,this._complete=new l,this._suggestions=[],this._selectedSuggestion=void 0,this._showSuggestions=!0,this._updateCamera=y,this._adjustSuggestionsScroll=S,this._updateSearchSuggestions=x,this._handleArrowDown=v,this._handleArrowUp=g;var a=this;this._suggestionsVisible=d.pureComputed(function(){var e=d.getObservable(a,"_suggestions"),t=e().length>0,i=d.getObservable(a,"_showSuggestions")();return t&&i}),this._searchCommand=m(function(){return a.hideSuggestions(),a._focusTextbox=!1,n(a._selectedSuggestion)?(a.activateSuggestion(a._selectedSuggestion),!1):void(a.isSearchInProgress?E(a):w(a,a._geocoderServices))}),this.deselectSuggestion=function(){a._selectedSuggestion=void 0},this.handleKeyDown=function(e,t){var i="ArrowDown"===t.key||"Down"===t.key||40===t.keyCode,r="ArrowUp"===t.key||"Up"===t.key||38===t.keyCode;return(i||r)&&t.preventDefault(),!0},this.handleKeyUp=function(e,t){var i="ArrowDown"===t.key||"Down"===t.key||40===t.keyCode,r="ArrowUp"===t.key||"Up"===t.key||38===t.keyCode,n="Enter"===t.key||13===t.keyCode;return r?g(a):i?v(a):n&&a._searchCommand(),!0},this.activateSuggestion=function(e){a.hideSuggestions(),a._searchText=e.displayName;var t=e.destination;T(a),y(a,t)},this.hideSuggestions=function(){a._showSuggestions=!1,a._selectedSuggestion=void 0},this.showSuggestions=function(){a._showSuggestions=!0},this.handleMouseover=function(e,t){e!==a._selectedSuggestion&&(a._selectedSuggestion=e)},this.keepExpanded=!1,this.autoComplete=r(i.autocomplete,!0),this._focusTextbox=!1,d.track(this,["_searchText","_isSearchInProgress","keepExpanded","_suggestions","_selectedSuggestion","_showSuggestions","_focusTextbox"]);var s=d.getObservable(this,"_searchText");s.extend({rateLimit:{timeout:500}}),this._suggestionSubscription=s.subscribe(function(){x(a)}),this.isSearchInProgress=void 0,d.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,d.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(e){this._searchText=e}}),this.flightDuration=void 0,d.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(e){this._flightDuration=e}})}function g(e){if(0!==e._suggestions.length){var t,i=e._suggestions.indexOf(e._selectedSuggestion);if(i===-1||0===i)return void(e._selectedSuggestion=void 0);t=i-1,e._selectedSuggestion=e._suggestions[t],S(e,t)}}function v(e){if(0!==e._suggestions.length){var t=e._suggestions.length,i=e._suggestions.indexOf(e._selectedSuggestion),r=(i+1)%t;e._selectedSuggestion=e._suggestions[r],S(e,r)}}function y(e,t){e._scene.camera.flyTo({destination:t,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:c.IDENTITY})}function C(e,t,i){return e.then(function(e){if(n(e)&&"fulfilled"===e.state&&e.value.length>0)return e;var r=t.geocode(i).then(function(e){return{state:"fulfilled",value:e}}).otherwise(function(e){return{state:"rejected",reason:e}});return r})}function w(e,t){var i=e._searchText;if(b(i))return void e.showSuggestions();e._isSearchInProgress=!0;for(var r=p.resolve(),o=0;o<t.length;o++)r=C(r,t[o],i);e._geocodePromise=r,r.then(function(t){if(!r.cancel){e._isSearchInProgress=!1;var o=t.value;return"fulfilled"===t.state&&n(o)&&o.length>0?(e._searchText=o[0].displayName,void y(e,o[0].destination)):void(e._searchText=i+" (not found)")}})}function S(e,t){var i=f(e._viewContainer),r=i.getElementsByClassName("search-results")[0],n=i.getElementsByTagName("li"),o=n[t];if(0===t)return void(r.scrollTop=0);var a=o.offsetTop;a+o.clientHeight>r.clientHeight?r.scrollTop=a+o.clientHeight:a<r.scrollTop&&(r.scrollTop=a)}function E(e){e._isSearchInProgress=!1,n(e._geocodePromise)&&(e._geocodePromise.cancel=!0,e._geocodePromise=void 0)}function b(e){return/^\s*$/.test(e)}function T(e){d.getObservable(e,"_suggestions").removeAll()}function x(e){if(e.autoComplete){var t=e._searchText;if(T(e),!b(t)){var i=p.resolve([]);e._geocoderServices.forEach(function(e){i=i.then(function(i){return i.length>=5?i:e.geocode(t).then(function(e){return i=i.concat(e)})})}),i.then(function(t){for(var i=e._suggestions,r=0;r<t.length;r++)i.push(t[r])})}}}return o(_.prototype,{url:{get:function(){return a("url is deprecated","The url property was deprecated in Cesium 1.30 and will be removed in version 1.31."),this._url}},key:{get:function(){return a("key is deprecated","The key property was deprecated in Cesium 1.30 and will be removed in version 1.31."),this._key}},complete:{get:function(){return this._complete}},scene:{get:function(){return this._scene}},search:{get:function(){return this._searchCommand}},selectedSuggestion:{get:function(){return this._selectedSuggestion}},suggestions:{get:function(){return this._suggestions}}}),_.prototype.destroy=function(){this._suggestionSubscription.dispose()},_}),i("Widgets/Geocoder/Geocoder",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/FeatureDetection","../../ThirdParty/knockout","../getElement","./GeocoderViewModel"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){var t=a(e.container),i=new s(e);i._startSearchPath=u,i._stopSearchPath=c;var r=document.createElement("form");r.setAttribute("data-bind","submit: search");var l=document.createElement("input");l.type="search",l.className="cesium-geocoder-input",l.setAttribute("placeholder","Enter an address or landmark..."),l.setAttribute("data-bind",'textInput: searchText,disable: isSearchInProgress,event: { keyup: handleKeyUp, keydown: handleKeyDown, mouseover: deselectSuggestion },css: { "cesium-geocoder-input-wide" : keepExpanded || searchText.length > 0 },hasFocus: _focusTextbox'),this._onTextBoxFocus=function(){setTimeout(function(){l.select()},0)},l.addEventListener("focus",this._onTextBoxFocus,!1),r.appendChild(l),this._textBox=l;var h=document.createElement("span");h.className="cesium-geocoder-searchButton",h.setAttribute("data-bind","click: search,cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, width: 32, height: 32 }"),r.appendChild(h),t.appendChild(r);var d=document.createElement("div");d.className="search-results",d.setAttribute("data-bind","visible: _suggestionsVisible");var p=document.createElement("ul");p.setAttribute("data-bind","foreach: _suggestions");var m=document.createElement("li");p.appendChild(m),m.setAttribute("data-bind","text: $data.displayName, click: $parent.activateSuggestion, event: { mouseover: $parent.handleMouseover}, css: { active: $data === $parent._selectedSuggestion }"),d.appendChild(p),t.appendChild(d),o.applyBindings(i,r),o.applyBindings(i,d),this._container=t,this._searchSuggestionsContainer=d,this._viewModel=i,this._form=r,this._onInputBegin=function(e){t.contains(e.target)||(i._focusTextbox=!1,i.hideSuggestions())},this._onInputEnd=function(e){t.contains(e.target)&&(i._focusTextbox=!0,i.showSuggestions())},n.supportsPointerEvents()?(document.addEventListener("pointerdown",this._onInputBegin,!0),document.addEventListener("pointerup",this._onInputEnd,!0),document.addEventListener("pointercancel",this._onInputEnd,!0)):(document.addEventListener("mousedown",this._onInputBegin,!0),document.addEventListener("mouseup",this._onInputEnd,!0),document.addEventListener("touchstart",this._onInputBegin,!0),document.addEventListener("touchend",this._onInputEnd,!0),document.addEventListener("touchcancel",this._onInputEnd,!0))}var u="M29.772,26.433l-7.126-7.126c0.96-1.583,1.523-3.435,1.524-5.421C24.169,8.093,19.478,3.401,13.688,3.399C7.897,3.401,3.204,8.093,3.204,13.885c0,5.789,4.693,10.481,10.484,10.481c1.987,0,3.839-0.563,5.422-1.523l7.128,7.127L29.772,26.433zM7.203,13.885c0.006-3.582,2.903-6.478,6.484-6.486c3.579,0.008,6.478,2.904,6.484,6.486c-0.007,3.58-2.905,6.476-6.484,6.484C10.106,20.361,7.209,17.465,7.203,13.885z",c="M24.778,21.419 19.276,15.917 24.777,10.415 21.949,7.585 16.447,13.087 10.945,7.585 8.117,10.415 13.618,15.917 8.116,21.419 10.946,24.248 16.447,18.746 21.948,24.248z";return t(l.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}}),l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return n.supportsPointerEvents()?(document.removeEventListener("pointerdown",this._onInputBegin,!0),document.removeEventListener("pointerup",this._onInputEnd,!0)):(document.removeEventListener("mousedown",this._onInputBegin,!0),document.removeEventListener("mouseup",this._onInputEnd,!0),document.removeEventListener("touchstart",this._onInputBegin,!0),document.removeEventListener("touchend",this._onInputEnd,!0)),this._viewModel.destroy(),o.cleanNode(this._form),o.cleanNode(this._searchSuggestionsContainer),this._container.removeChild(this._form),this._container.removeChild(this._searchSuggestionsContainer),this._textBox.removeEventListener("focus",this._onTextBoxFocus,!1),i(this)},l}),i("Widgets/HomeButton/HomeButtonViewModel",["../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../ThirdParty/knockout","../createCommand"],function(e,t,i,r,n){"use strict";function o(e,t){this._scene=e,this._duration=t;var i=this;this._command=n(function(){i._scene.camera.flyHome(i._duration)}),this.tooltip="View Home",r.track(this,["tooltip"])}return t(o.prototype,{scene:{get:function(){return this._scene}},command:{get:function(){return this._command}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}}}),o}),i("Widgets/HomeButton/HomeButton",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./HomeButtonViewModel"],function(e,t,i,r,n,o,a){"use strict";function s(e,t,i){e=o(e);var r=new a(t,i);r._svgPath="M14,4l-10,8.75h20l-4.25-3.7188v-4.6562h-2.812v2.1875l-2.938-2.5625zm-7.0938,9.906v10.094h14.094v-10.094h-14.094zm2.1876,2.313h3.3122v4.25h-3.3122v-4.25zm5.8442,1.281h3.406v6.438h-3.406v-6.438z";var s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-home-button",s.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 28, height: 28 }"),e.appendChild(s),n.applyBindings(r,s),this._container=e,this._viewModel=r,this._element=s}return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return n.cleanNode(this._element),this._container.removeChild(this._element),i(this)},s}),i("Widgets/InfoBox/InfoBoxViewModel",["../../Core/defined","../../Core/defineProperties","../../Core/Event","../../ThirdParty/knockout"],function(e,t,i,r){"use strict";function n(){this._cameraClicked=new i,this._closeClicked=new i,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.description="",r.track(this,["showInfo","titleText","description","maxHeight","enableCamera","isCameraTracking"]),this._loadingIndicatorHtml='<div class="cesium-infoBox-loadingContainer"><span class="cesium-infoBox-loading"></span></div>',this.cameraIconPath=void 0,r.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?a:o}}),r.defineProperty(this,"_bodyless",{get:function(){return!e(this.description)||0===this.description.length}})}var o="M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4853444 22.104033 11.423165 24.0625 13.84375 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 8.975298 28.305952 7.03125 25.875 7.03125 L 13.84375 7.03125 z",a="M 27.34375 1.65625 L 5.28125 27.9375 L 8.09375 30.3125 L 30.15625 4.03125 L 27.34375 1.65625 z M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4724893 20.232036 9.5676108 20.7379 9.75 21.21875 L 21.65625 7.03125 L 13.84375 7.03125 z M 28.21875 7.71875 L 14.53125 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 9.8371439 29.456025 8.4902779 28.21875 7.71875 z";return n.prototype.maxHeightOffset=function(e){return this.maxHeight-e+"px"},t(n.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}}),n}),i("Widgets/InfoBox/InfoBox",["../../Core/buildModuleUrl","../../Core/Color","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","../subscribeAndEvaluate","./InfoBoxViewModel"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(r){r=s(r);var n=document.createElement("div");n.className="cesium-infoBox",n.setAttribute("data-bind",'css: { "cesium-infoBox-visible" : showInfo, "cesium-infoBox-bodyless" : _bodyless }'),r.appendChild(n);var o=document.createElement("div");o.className="cesium-infoBox-title",o.setAttribute("data-bind","text: titleText"),n.appendChild(o);var c=document.createElement("button");c.type="button",c.className="cesium-button cesium-infoBox-camera",c.setAttribute("data-bind",'attr: { title: "Focus camera on object" },click: function () { cameraClicked.raiseEvent(this); },enable: enableCamera,cesiumSvgPath: { path: cameraIconPath, width: 32, height: 32 }'),n.appendChild(c);var h=document.createElement("button");h.type="button",h.className="cesium-infoBox-close",h.setAttribute("data-bind","click: function () { closeClicked.raiseEvent(this); }"),h.innerHTML="×",n.appendChild(h);var d=document.createElement("iframe");d.className="cesium-infoBox-iframe",d.setAttribute("sandbox","allow-same-origin allow-popups allow-forms"),d.setAttribute("data-bind","style : { maxHeight : maxHeightOffset(40) }"),d.setAttribute("allowfullscreen",!0),n.appendChild(d);var p=new u;a.applyBindings(p,n),this._container=r,this._element=n,this._frame=d,this._viewModel=p,this._descriptionSubscription=void 0;var m=this;d.addEventListener("load",function(){var r=d.contentDocument,o=r.createElement("link");o.href=e("Widgets/InfoBox/InfoBoxDescription.css"),o.rel="stylesheet",o.type="text/css";var a=r.createElement("div");a.className="cesium-infoBox-description",r.head.appendChild(o),r.body.appendChild(a),m._descriptionSubscription=l(p,"description",function(e){d.style.height="5px",a.innerHTML=e;var r=null,o=a.firstElementChild;if(null!==o&&1===a.childNodes.length){var s=window.getComputedStyle(o);if(null!==s){var l=s["background-color"],u=t.fromCssColorString(l);i(u)&&0!==u.alpha&&(r=s["background-color"])}}n.style["background-color"]=r;var c=a.getBoundingClientRect().height;d.style.height=c+"px"})}),d.setAttribute("src","about:blank")}return r(c.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}}),c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){var e=this._container;return a.cleanNode(this._element),e.removeChild(this._element),i(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),n(this)},c}),i("Widgets/NavigationHelpButton/NavigationHelpButtonViewModel",["../../Core/defineProperties","../../ThirdParty/knockout","../createCommand"],function(e,t,i){"use strict";function r(){this.showInstructions=!1;var e=this;this._command=i(function(){e.showInstructions=!e.showInstructions}),this._showClick=i(function(){e._touch=!1}),this._showTouch=i(function(){e._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",t.track(this,["tooltip","showInstructions","_touch"])}return e(r.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}}),r}),i("Widgets/NavigationHelpButton/NavigationHelpButton",["../../Core/buildModuleUrl","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/FeatureDetection","../../ThirdParty/knockout","../getElement","./NavigationHelpButtonViewModel"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(i){var r=l(i.container),n=new u,o=t(i.instructionsInitiallyVisible,!1);n.showInstructions=o,n._svgPath="M16,1.466C7.973,1.466,1.466,7.973,1.466,16c0,8.027,6.507,14.534,14.534,14.534c8.027,0,14.534-6.507,14.534-14.534C30.534,7.973,24.027,1.466,16,1.466z M17.328,24.371h-2.707v-2.596h2.707V24.371zM17.328,19.003v0.858h-2.707v-1.057c0-3.19,3.63-3.696,3.63-5.963c0-1.034-0.924-1.826-2.134-1.826c-1.254,0-2.354,0.924-2.354,0.924l-1.541-1.915c0,0,1.519-1.584,4.137-1.584c2.487,0,4.796,1.54,4.796,4.136C21.156,16.208,17.328,16.627,17.328,19.003z";var c=document.createElement("span");c.className="cesium-navigationHelpButton-wrapper",r.appendChild(c);var h=document.createElement("button");h.type="button",h.className="cesium-button cesium-toolbar-button cesium-navigation-help-button",h.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }"),c.appendChild(h);var d=document.createElement("div");d.className="cesium-navigation-help",d.setAttribute("data-bind",'css: { "cesium-navigation-help-visible" : showInstructions}'),c.appendChild(d);var p=document.createElement("button");p.type="button",p.className="cesium-navigation-button cesium-navigation-button-left",p.setAttribute("data-bind",'click: showClick, css: {"cesium-navigation-button-selected": !_touch, "cesium-navigation-button-unselected": _touch}');var m=document.createElement("img");m.src=e("Widgets/Images/NavigationHelp/Mouse.svg"),m.className="cesium-navigation-button-icon",m.style.width="25px",m.style.height="25px",p.appendChild(m),p.appendChild(document.createTextNode("Mouse"));var f=document.createElement("button");f.type="button",f.className="cesium-navigation-button cesium-navigation-button-right",f.setAttribute("data-bind",'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}');var _=document.createElement("img");_.src=e("Widgets/Images/NavigationHelp/Touch.svg"),_.className="cesium-navigation-button-icon",_.style.width="25px",_.style.height="25px",f.appendChild(_),f.appendChild(document.createTextNode("Touch")),d.appendChild(p),d.appendChild(f);var g=document.createElement("div");g.className="cesium-click-navigation-help cesium-navigation-help-instructions",g.setAttribute("data-bind",'css: { "cesium-click-navigation-help-visible" : !_touch}'),g.innerHTML=' <table> <tr> <td><img src="'+e("Widgets/Images/NavigationHelp/MouseLeft.svg")+'" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">Left click + drag</div> </td> </tr> <tr> <td><img src="'+e("Widgets/Images/NavigationHelp/MouseRight.svg")+'" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Right click + drag, or</div> <div class="cesium-navigation-help-details">Mouse wheel scroll</div> </td> </tr> <tr> <td><img src="'+e("Widgets/Images/NavigationHelp/MouseMiddle.svg")+'" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Rotate view</div> <div class="cesium-navigation-help-details">Middle click + drag, or</div> <div class="cesium-navigation-help-details">CTRL + Left/Right click + drag</div> </td> </tr> </table>',d.appendChild(g);var v=document.createElement("div");v.className="cesium-touch-navigation-help cesium-navigation-help-instructions",v.setAttribute("data-bind",'css: { "cesium-touch-navigation-help-visible" : _touch}'),v.innerHTML=' <table> <tr> <td><img src="'+e("Widgets/Images/NavigationHelp/TouchDrag.svg")+'" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">One finger drag</div> </td> </tr> <tr> <td><img src="'+e("Widgets/Images/NavigationHelp/TouchZoom.svg")+'" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Two finger pinch</div> </td> </tr> <tr> <td><img src="'+e("Widgets/Images/NavigationHelp/TouchTilt.svg")+'" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Tilt view</div> <div class="cesium-navigation-help-details">Two finger drag, same direction</div> </td> </tr> <tr> <td><img src="'+e("Widgets/Images/NavigationHelp/TouchRotate.svg")+'" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-tilt">Rotate view</div> <div class="cesium-navigation-help-details">Two finger drag, opposite direction</div> </td> </tr> </table>',d.appendChild(v),s.applyBindings(n,c),this._container=r,this._viewModel=n,this._wrapper=c,this._closeInstructions=function(e){c.contains(e.target)||(n.showInstructions=!1)},a.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}return r(c.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){return a.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeInstructions,!0):(document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0)),s.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),n(this)},c}),i("Widgets/PerformanceWatchdog/PerformanceWatchdogViewModel",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Scene/FrameRateMonitor","../../ThirdParty/knockout","../createCommand"],function(e,t,i,r,n,o,a,s){"use strict";function l(t){this._scene=t.scene,this.lowFrameRateMessage=e(t.lowFrameRateMessage,"This application appears to be performing poorly on your system. Please try using a different web browser or updating your video drivers."),this.lowFrameRateMessageDismissed=!1,this.showingLowFrameRateMessage=!1,a.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);var i=this;this._dismissMessage=s(function(){i.showingLowFrameRateMessage=!1,i.lowFrameRateMessageDismissed=!0});var r=o.fromScene(t.scene);this._unsubscribeLowFrameRate=r.lowFrameRate.addEventListener(function(){i.lowFrameRateMessageDismissed||(i.showingLowFrameRateMessage=!0)}),this._unsubscribeNominalFrameRate=r.nominalFrameRate.addEventListener(function(){i.showingLowFrameRateMessage=!1})}return i(l.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}}),l.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),r(this)},l}),i("Widgets/PerformanceWatchdog/PerformanceWatchdog",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./PerformanceWatchdogViewModel"],function(e,t,i,r,n,o,a){"use strict";function s(e){var t=o(e.container),i=new a(e),r=document.createElement("div");r.className="cesium-performance-watchdog-message-area",r.setAttribute("data-bind","visible: showingLowFrameRateMessage");var s=document.createElement("button");s.setAttribute("type","button"),s.className="cesium-performance-watchdog-message-dismiss",s.innerHTML="×",s.setAttribute("data-bind","click: dismissMessage"),r.appendChild(s);var l=document.createElement("div");l.className="cesium-performance-watchdog-message",l.setAttribute("data-bind","html: lowFrameRateMessage"),r.appendChild(l),t.appendChild(r),n.applyBindings(i,r),this._container=t,this._viewModel=i,this._element=r}return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return this._viewModel.destroy(),n.cleanNode(this._element),this._container.removeChild(this._element),i(this)},s}),i("Widgets/SceneModePicker/SceneModePickerViewModel",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/EventHelper","../../Scene/SceneMode","../../ThirdParty/knockout","../createCommand"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(t,i){this._scene=t;var r=this,n=function(e,t,i,n){r.sceneMode=i,r.dropDownVisible=!1};this._eventHelper=new o,this._eventHelper.add(t.morphStart,n),this._duration=e(i,2),this.sceneMode=t.mode,this.dropDownVisible=!1,this.tooltip2D="2D",this.tooltip3D="3D",this.tooltipColumbusView="Columbus View",s.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,s.defineProperty(this,"selectedTooltip",function(){var e=r.sceneMode;return e===a.SCENE2D?r.tooltip2D:e===a.SCENE3D?r.tooltip3D:r.tooltipColumbusView}),this._toggleDropDown=l(function(){r.dropDownVisible=!r.dropDownVisible}),this._morphTo2D=l(function(){t.morphTo2D(r._duration)}),this._morphTo3D=l(function(){t.morphTo3D(r._duration)}),this._morphToColumbusView=l(function(){t.morphToColumbusView(r._duration)}),this._sceneMode=a}return i(u.prototype,{scene:{get:function(){return this._scene}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}},toggleDropDown:{get:function(){return this._toggleDropDown}},morphTo2D:{get:function(){return this._morphTo2D}},morphTo3D:{get:function(){return this._morphTo3D}},morphToColumbusView:{get:function(){return this._morphToColumbusView}}}),u.prototype.isDestroyed=function(){return!1},u.prototype.destroy=function(){this._eventHelper.removeAll(),r(this)},u}),i("Widgets/SceneModePicker/SceneModePicker",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/FeatureDetection","../../ThirdParty/knockout","../getElement","./SceneModePickerViewModel"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,t,i){e=a(e);var r=new s(t,i);r._globePath=u,r._flatMapPath=c,r._columbusViewPath=h;var l=document.createElement("span");l.className="cesium-sceneModePicker-wrapper cesium-toolbar-button",e.appendChild(l);var d=document.createElement("button");d.type="button",d.className="cesium-button cesium-toolbar-button",d.setAttribute("data-bind",'css: { "cesium-sceneModePicker-button2D": sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-button3D": sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-buttonColumbusView": sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),d.innerHTML='<!-- ko cesiumSvgPath: { path: _globePath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon3D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon2D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-iconColumbusView" } --><!-- /ko -->',l.appendChild(d);var p=document.createElement("button");p.type="button",p.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",p.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE3D)) || (!dropDownVisible && (sceneMode === _sceneMode.SCENE3D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip3D },click: morphTo3D,cesiumSvgPath: { path: _globePath, width: 64, height: 64 }'),l.appendChild(p);var m=document.createElement("button");m.type="button",m.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",m.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE2D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip2D },click: morphTo2D,cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64 }'),l.appendChild(m);var f=document.createElement("button");f.type="button",f.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",f.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.COLUMBUS_VIEW)) || (!dropDownVisible && (sceneMode === _sceneMode.COLUMBUS_VIEW)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-hidden" : !dropDownVisible},attr: { title: tooltipColumbusView },click: morphToColumbusView,cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64 }'),l.appendChild(f),o.applyBindings(r,l),this._viewModel=r, +this._container=e,this._wrapper=l,this._closeDropDown=function(e){l.contains(e.target)||(r.dropDownVisible=!1)},n.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}var u="m 32.401392,4.9330437 c -7.087603,0 -14.096095,2.884602 -19.10793,7.8946843 -5.0118352,5.010083 -7.9296167,11.987468 -7.9296167,19.072999 0,7.085531 2.9177815,14.097848 7.9296167,19.107931 4.837653,4.835961 11.541408,7.631372 18.374354,7.82482 0.05712,0.01231 0.454119,0.139729 0.454119,0.139729 l 0.03493,-0.104797 c 0.08246,7.84e-4 0.162033,0.03493 0.244525,0.03493 0.08304,0 0.161515,-0.03414 0.244526,-0.03493 l 0.03493,0.104797 c 0,0 0.309474,-0.129487 0.349323,-0.139729 6.867765,-0.168094 13.582903,-2.965206 18.444218,-7.82482 2.558195,-2.5573 4.551081,-5.638134 5.903547,-8.977584 1.297191,-3.202966 2.02607,-6.661489 2.02607,-10.130347 0,-6.237309 -2.366261,-12.31219 -6.322734,-17.116794 -0.0034,-0.02316 0.0049,-0.04488 0,-0.06986 -0.01733,-0.08745 -0.104529,-0.278855 -0.104797,-0.279458 -5.31e-4,-0.0012 -0.522988,-0.628147 -0.523984,-0.62878 -3.47e-4,-2.2e-4 -0.133444,-0.03532 -0.244525,-0.06987 C 51.944299,13.447603 51.751076,13.104317 51.474391,12.827728 46.462556,7.8176457 39.488996,4.9330437 32.401392,4.9330437 z m -2.130866,3.5281554 0.104797,9.6762289 c -4.111695,-0.08361 -7.109829,-0.423664 -9.257041,-0.943171 1.198093,-2.269271 2.524531,-4.124404 3.91241,-5.414496 2.167498,-2.0147811 3.950145,-2.8540169 5.239834,-3.3185619 z m 2.794579,0 c 1.280302,0.4754953 3.022186,1.3285948 5.065173,3.2486979 1.424667,1.338973 2.788862,3.303645 3.982275,5.728886 -2.29082,0.403367 -5.381258,0.621049 -8.942651,0.698645 L 33.065105,8.4611991 z m 5.728886,0.2445256 c 4.004072,1.1230822 7.793098,3.1481363 10.724195,6.0782083 0.03468,0.03466 0.07033,0.06991 0.104797,0.104797 -0.45375,0.313891 -0.923054,0.663002 -1.956205,1.082899 -0.647388,0.263114 -1.906242,0.477396 -2.829511,0.733577 -1.382296,-2.988132 -3.027146,-5.368585 -4.785716,-7.0213781 -0.422866,-0.397432 -0.835818,-0.6453247 -1.25756,-0.9781032 z m -15.33525,0.7685092 c -0.106753,0.09503 -0.207753,0.145402 -0.31439,0.244526 -1.684973,1.5662541 -3.298068,3.8232211 -4.680919,6.5672591 -0.343797,-0.14942 -1.035052,-0.273198 -1.292493,-0.419186 -0.956528,-0.542427 -1.362964,-1.022024 -1.537018,-1.292493 -0.0241,-0.03745 -0.01868,-0.0401 -0.03493,-0.06986 2.250095,-2.163342 4.948824,-3.869984 7.859752,-5.0302421 z m -9.641296,7.0912431 c 0.464973,0.571618 0.937729,1.169056 1.956205,1.746612 0.349907,0.198425 1.107143,0.335404 1.537018,0.523983 -1.20166,3.172984 -1.998037,7.051901 -2.165798,11.772162 C 14.256557,30.361384 12.934823,30.161483 12.280427,29.90959 10.644437,29.279855 9.6888882,28.674891 9.1714586,28.267775 8.6540289,27.860658 8.6474751,27.778724 8.6474751,27.778724 l -0.069864,0.03493 C 9.3100294,23.691285 11.163248,19.798527 13.817445,16.565477 z m 37.552149,0.523984 c 2.548924,3.289983 4.265057,7.202594 4.890513,11.318043 -0.650428,0.410896 -1.756876,1.001936 -3.563088,1.606882 -1.171552,0.392383 -3.163859,0.759153 -4.960377,1.117832 -0.04367,-4.752703 -0.784809,-8.591423 -1.88634,-11.807094 0.917574,-0.263678 2.170552,-0.486495 2.864443,-0.76851 1.274693,-0.518066 2.003942,-1.001558 2.654849,-1.467153 z m -31.439008,2.619917 c 2.487341,0.672766 5.775813,1.137775 10.479669,1.222628 l 0.104797,10.689263 0,0.03493 0,0.733577 c -5.435005,-0.09059 -9.512219,-0.519044 -12.610536,-1.117831 0.106127,-4.776683 0.879334,-8.55791 2.02607,-11.562569 z m 23.264866,0.31439 c 1.073459,3.067541 1.833795,6.821314 1.816476,11.702298 -3.054474,0.423245 -7.062018,0.648559 -11.702298,0.698644 l 0,-0.838373 -0.104796,-10.654331 c 4.082416,-0.0864 7.404468,-0.403886 9.990618,-0.908238 z M 8.2632205,30.922625 c 0.7558676,0.510548 1.5529563,1.013339 3.0041715,1.57195 0.937518,0.360875 2.612202,0.647642 3.91241,0.978102 0.112814,3.85566 0.703989,7.107756 1.606883,9.920754 -1.147172,-0.324262 -2.644553,-0.640648 -3.423359,-0.978102 -1.516688,-0.657177 -2.386627,-1.287332 -2.864443,-1.71168 -0.477816,-0.424347 -0.489051,-0.489051 -0.489051,-0.489051 L 9.8002387,40.319395 C 8.791691,37.621767 8.1584238,34.769583 8.1584238,31.900727 c 0,-0.330153 0.090589,-0.648169 0.1047967,-0.978102 z m 48.2763445,0.419186 c 0.0047,0.188973 0.06986,0.36991 0.06986,0.558916 0,2.938869 -0.620228,5.873558 -1.676747,8.628261 -0.07435,0.07583 -0.06552,0.07411 -0.454119,0.349323 -0.606965,0.429857 -1.631665,1.042044 -3.318562,1.676747 -1.208528,0.454713 -3.204964,0.850894 -5.135038,1.25756 0.84593,-2.765726 1.41808,-6.005357 1.606883,-9.815957 2.232369,-0.413371 4.483758,-0.840201 5.938479,-1.327425 1.410632,-0.472457 2.153108,-0.89469 2.96924,-1.327425 z m -38.530252,2.864443 c 3.208141,0.56697 7.372279,0.898588 12.575603,0.978103 l 0.174662,9.885821 c -4.392517,-0.06139 -8.106722,-0.320566 -10.863925,-0.803441 -1.051954,-2.664695 -1.692909,-6.043794 -1.88634,-10.060483 z m 26.793022,0.31439 c -0.246298,3.923551 -0.877762,7.263679 -1.816476,9.885822 -2.561957,0.361954 -5.766249,0.560708 -9.431703,0.62878 l -0.174661,-9.815957 c 4.491734,-0.04969 8.334769,-0.293032 11.42284,-0.698645 z M 12.035901,44.860585 c 0.09977,0.04523 0.105535,0.09465 0.209594,0.139729 1.337656,0.579602 3.441099,1.058072 5.589157,1.537018 1.545042,3.399208 3.548524,5.969402 5.589157,7.789888 -3.034411,-1.215537 -5.871615,-3.007978 -8.174142,-5.309699 -1.245911,-1.245475 -2.271794,-2.662961 -3.213766,-4.156936 z m 40.69605,0 c -0.941972,1.493975 -1.967855,2.911461 -3.213765,4.156936 -2.74253,2.741571 -6.244106,4.696717 -9.955686,5.868615 0.261347,-0.241079 0.507495,-0.394491 0.768509,-0.663713 1.674841,-1.727516 3.320792,-4.181056 4.645987,-7.265904 2.962447,-0.503021 5.408965,-1.122293 7.161107,-1.781544 0.284034,-0.106865 0.337297,-0.207323 0.593848,-0.31439 z m -31.404076,2.305527 c 2.645807,0.376448 5.701178,0.649995 9.466635,0.698645 l 0.139729,7.789888 c -1.38739,-0.480844 -3.316218,-1.29837 -5.659022,-3.388427 -1.388822,-1.238993 -2.743668,-3.0113 -3.947342,-5.100106 z m 20.365491,0.104797 c -1.04872,2.041937 -2.174337,3.779068 -3.353494,4.995309 -1.853177,1.911459 -3.425515,2.82679 -4.611055,3.353494 l -0.139729,-7.789887 c 3.13091,-0.05714 5.728238,-0.278725 8.104278,-0.558916 z",c="m 2.9825053,17.550598 0,1.368113 0,26.267766 0,1.368113 1.36811,0 54.9981397,0 1.36811,0 0,-1.368113 0,-26.267766 0,-1.368113 -1.36811,0 -54.9981397,0 -1.36811,0 z m 2.73623,2.736226 10.3292497,0 0,10.466063 -10.3292497,0 0,-10.466063 z m 13.0654697,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 10.32926,0 0,10.466063 -10.32926,0 0,-10.466063 z m -41.9326497,13.202288 10.3292497,0 0,10.329252 -10.3292497,0 0,-10.329252 z m 13.0654697,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 10.32926,0 0,10.329252 -10.32926,0 0,-10.329252 z",h="m 14.723969,17.675598 -0.340489,0.817175 -11.1680536,26.183638 -0.817175,1.872692 2.076986,0 54.7506996,0 2.07698,0 -0.81717,-1.872692 -11.16805,-26.183638 -0.34049,-0.817175 -0.91933,0 -32.414586,0 -0.919322,0 z m 1.838643,2.723916 6.196908,0 -2.928209,10.418977 -7.729111,0 4.460412,-10.418977 z m 9.02297,0 4.903049,0 0,10.418977 -7.831258,0 2.928209,-10.418977 z m 7.626964,0 5.584031,0 2.62176,10.418977 -8.205791,0 0,-10.418977 z m 8.410081,0 5.51593,0 4.46042,10.418977 -7.38863,0 -2.58772,-10.418977 z m -30.678091,13.142892 8.103649,0 -2.89416,10.282782 -9.6018026,0 4.3923136,-10.282782 z m 10.929711,0 8.614384,0 0,10.282782 -11.508544,0 2.89416,-10.282782 z m 11.338299,0 8.852721,0 2.58772,10.282782 -11.440441,0 0,-10.282782 z m 11.678781,0 7.86531,0 4.39231,10.282782 -9.6699,0 -2.58772,-10.282782 z";return t(l.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return this._viewModel.destroy(),n.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),o.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),i(this)},l}),i("Widgets/SelectionIndicator/SelectionIndicatorViewModel",["../../Core/Cartesian2","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/EasingFunction","../../Scene/SceneTransforms","../../ThirdParty/knockout"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,r,n){this._scene=e,this._screenPositionX=c,this._screenPositionY=c,this._tweens=e.tweens,this._container=t(n,document.body),this._selectionIndicatorElement=r,this._scale=1,this.position=void 0,this.showSelection=!1,s.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void 0,s.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&i(this.position)}}),s.defineProperty(this,"_transform",{get:function(){return"scale("+this._scale+")"}}),this.computeScreenSpacePosition=function(t,i){return a.wgs84ToWindowCoordinates(e,t,i)}}var u=new e,c="-1000px";return l.prototype.update=function(){if(this.showSelection&&i(this.position)){var e=this.computeScreenSpacePosition(this.position,u);if(i(e)){var t=this._container,r=t.parentNode.clientWidth,n=t.parentNode.clientHeight,o=this._selectionIndicatorElement.clientWidth,a=.5*o;e.x=Math.min(Math.max(e.x,-o),r+o)-a,e.y=Math.min(Math.max(e.y,-o),n+o)-a,this._screenPositionX=Math.floor(e.x+.25)+"px",this._screenPositionY=Math.floor(e.y+.25)+"px"}else this._screenPositionX=c,this._screenPositionY=c}},l.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:o.EXPONENTIAL_OUT})},l.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:o.EXPONENTIAL_OUT})},r(l.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}}),l}),i("Widgets/SelectionIndicator/SelectionIndicator",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./SelectionIndicatorViewModel"],function(e,t,i,r,n,o,a){"use strict";function s(e,t){e=o(e),this._container=e;var i=document.createElement("div");i.className="cesium-selection-wrapper",i.setAttribute("data-bind",'style: { "top" : _screenPositionY, "left" : _screenPositionX },css: { "cesium-selection-wrapper-visible" : isVisible }'),e.appendChild(i),this._element=i;var r="http://www.w3.org/2000/svg",s="M -34 -34 L -34 -11.25 L -30 -15.25 L -30 -30 L -15.25 -30 L -11.25 -34 L -34 -34 z M 11.25 -34 L 15.25 -30 L 30 -30 L 30 -15.25 L 34 -11.25 L 34 -34 L 11.25 -34 z M -34 11.25 L -34 34 L -11.25 34 L -15.25 30 L -30 30 L -30 15.25 L -34 11.25 z M 34 11.25 L 30 15.25 L 30 30 L 15.25 30 L 11.25 34 L 34 34 L 34 11.25 z",l=document.createElementNS(r,"svg:svg");l.setAttribute("width",160),l.setAttribute("height",160),l.setAttribute("viewBox","0 0 160 160");var u=document.createElementNS(r,"g");u.setAttribute("transform","translate(80,80)"),l.appendChild(u);var c=document.createElementNS(r,"path");c.setAttribute("data-bind","attr: { transform: _transform }"),c.setAttribute("d",s),u.appendChild(c),i.appendChild(l);var h=new a(t,this._element,this._container);this._viewModel=h,n.applyBindings(this._viewModel,this._element)}return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){var e=this._container;return n.cleanNode(this._element),e.removeChild(this._element),i(this)},s}),i("Widgets/Timeline/TimelineHighlightRange",["../../Core/defaultValue","../../Core/JulianDate"],function(e,t){"use strict";function i(t,i,r){this._color=t,this._height=i,this._base=e(r,0)}return i.prototype.getHeight=function(){return this._height},i.prototype.getBase=function(){return this._base},i.prototype.getStartTime=function(){return this._start},i.prototype.getStopTime=function(){return this._stop},i.prototype.setRange=function(e,t){this._start=e,this._stop=t},i.prototype.render=function(e){var i="";if(this._start&&this._stop&&this._color){var r=t.secondsDifference(this._start,e.epochJulian),n=Math.round(e.timeBarWidth*e.getAlpha(r)),o=t.secondsDifference(this._stop,e.epochJulian),a=Math.round(e.timeBarWidth*e.getAlpha(o))-n;n<0&&(a+=n,n=0),n+a>e.timeBarWidth&&(a=e.timeBarWidth-n),a>0&&(i='<span class="cesium-timeline-highlight" style="left: '+n.toString()+"px; width: "+a.toString()+"px; bottom: "+this._base.toString()+"px; height: "+this._height+"px; background-color: "+this._color+';"></span>')}return i},i}),i("Widgets/Timeline/TimelineTrack",["../../Core/Color","../../Core/defined","../../Core/JulianDate"],function(e,t,i){"use strict";function r(t,i,r,n){this.interval=t,this.height=i,this.color=r||new e(.5,.5,.5,1),this.backgroundColor=n||new e(0,0,0,0)}return r.prototype.render=function(e,r){var n=this.interval.start,o=this.interval.stop,a=r.startJulian,s=i.addSeconds(r.startJulian,r.duration,new i);if(i.lessThan(n,a)&&i.greaterThan(o,s))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,r.y,r.timeBarWidth,this.height);else if(i.lessThanOrEquals(n,s)&&i.greaterThanOrEquals(o,a)){var l,u,c;for(l=0;l<r.timeBarWidth;++l){var h=i.addSeconds(r.startJulian,l/r.timeBarWidth*r.duration,new i);!t(u)&&i.greaterThanOrEquals(h,n)?u=l:!t(c)&&i.greaterThanOrEquals(h,o)&&(c=l)}e.fillStyle=this.backgroundColor.toCssColorString(),e.fillRect(0,r.y,r.timeBarWidth,this.height),t(u)&&(t(c)||(c=r.timeBarWidth),e.fillStyle=this.color.toCssColorString(),e.fillRect(u,r.y,Math.max(c-u,1),this.height))}},r}),i("Widgets/Timeline/Timeline",["../../Core/ClockRange","../../Core/defined","../../Core/destroyObject","../../Core/DeveloperError","../../Core/JulianDate","../getElement","./TimelineHighlightRange","./TimelineTrack"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,t){e=o(e),this.container=e;var i=document.createElement("div");i.className="cesium-timeline-main",e.appendChild(i),this._topDiv=i,this._endJulian=void 0,this._epochJulian=void 0,this._lastXPos=void 0,this._scrubElement=void 0,this._startJulian=void 0,this._timeBarSecondsSpan=void 0,this._clock=t,this._scrubJulian=t.currentTime,this._mainTicSpan=-1,this._mouseMode=v.none,this._touchMode=y.none,this._touchState={centerX:0,spanX:0},this._mouseX=0,this._timelineDrag=0,this._timelineDragLocation=void 0,this._lastHeight=void 0,this._lastWidth=void 0,this._topDiv.innerHTML='<div class="cesium-timeline-bar"></div><div class="cesium-timeline-trackContainer"><canvas class="cesium-timeline-tracks" width="10" height="1"></canvas></div><div class="cesium-timeline-needle"></div><span class="cesium-timeline-ruler"></span>',this._timeBarEle=this._topDiv.childNodes[0],this._trackContainer=this._topDiv.childNodes[1],this._trackListEle=this._topDiv.childNodes[1].childNodes[0],this._needleEle=this._topDiv.childNodes[2],this._rulerEle=this._topDiv.childNodes[3],this._context=this._trackListEle.getContext("2d"),this._trackList=[],this._highlightRanges=[],this.zoomTo(t.startTime,t.stopTime),this._onMouseDown=c(this),this._onMouseUp=h(this),this._onMouseMove=d(this),this._onMouseWheel=p(this),this._onTouchStart=m(this),this._onTouchMove=_(this),this._onTouchEnd=f(this);var r=this._timeBarEle;document.addEventListener("mouseup",this._onMouseUp,!1),document.addEventListener("mousemove",this._onMouseMove,!1),r.addEventListener("mousedown",this._onMouseDown,!1),r.addEventListener("DOMMouseScroll",this._onMouseWheel,!1),r.addEventListener("mousewheel",this._onMouseWheel,!1),r.addEventListener("touchstart",this._onTouchStart,!1),r.addEventListener("touchmove",this._onTouchMove,!1),r.addEventListener("touchend",this._onTouchEnd,!1),r.addEventListener("touchcancel",this._onTouchEnd,!1),this._topDiv.oncontextmenu=function(){return!1},t.onTick.addEventListener(this.updateFromClock,this),this.updateFromClock()}function u(e){return e<10?"0"+e.toString():e.toString()}function c(e){return function(t){e._mouseMode!==v.touchOnly&&(0===t.button?(e._mouseMode=v.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,2===t.button?e._mouseMode=v.zoom:e._mouseMode=v.slide)),t.preventDefault()}}function h(e){return function(t){e._mouseMode=v.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function d(e){return function(t){var i;if(e._mouseMode===v.scrub){t.preventDefault();var r=t.clientX-e._topDiv.getBoundingClientRect().left;r<0?(e._timelineDragLocation=0,e._timelineDrag=-.01*e._timeBarSecondsSpan):r>e._topDiv.clientWidth?(e._timelineDragLocation=e._topDiv.clientWidth,e._timelineDrag=.01*e._timeBarSecondsSpan):(e._timelineDragLocation=void 0,e._setTimeBarTime(r,r*e._timeBarSecondsSpan/e._topDiv.clientWidth))}else if(e._mouseMode===v.slide){if(i=e._mouseX-t.clientX,e._mouseX=t.clientX,0!==i){var o=i*e._timeBarSecondsSpan/e._topDiv.clientWidth;e.zoomTo(n.addSeconds(e._startJulian,o,new n),n.addSeconds(e._endJulian,o,new n))}}else e._mouseMode===v.zoom&&(i=e._mouseX-t.clientX,e._mouseX=t.clientX,0!==i&&e.zoomFrom(Math.pow(1.01,i)))}}function p(e){return function(t){var i=t.wheelDeltaY||t.wheelDelta||-t.detail;g=Math.max(Math.min(Math.abs(i),g),1),i/=g,e.zoomFrom(Math.pow(1.05,-i))}}function m(e){return function(t){var i,r,o=t.touches.length,a=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=v.touchOnly,1===o?(i=n.secondsDifference(e._scrubJulian,e._startJulian),r=Math.round(i*e._topDiv.clientWidth/e._timeBarSecondsSpan+a),Math.abs(t.touches[0].clientX-r)<50?(e._touchMode=y.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=1===o?"-16px 0":"0 0")):(e._touchMode=y.singleTap,e._touchState.centerX=t.touches[0].clientX-a)):2===o?(e._touchMode=y.slideZoom,e._touchState.centerX=.5*(t.touches[0].clientX+t.touches[1].clientX)-a,e._touchState.spanX=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):e._touchMode=y.ignore}}function f(e){return function(t){var i=t.touches.length,r=e._topDiv.getBoundingClientRect().left;e._touchMode===y.singleTap?(e._touchMode=y.scrub,e._onTouchMove(t)):e._touchMode===y.scrub&&e._onTouchMove(t),e._mouseMode=v.touchOnly,1!==i?e._touchMode=i>0?y.ignore:y.none:e._touchMode===y.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-r),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function _(e){return function(i){var r,o,a,s,l,u,c=1,h=e._topDiv.getBoundingClientRect().left;e._touchMode===y.singleTap&&(e._touchMode=y.slideZoom),e._mouseMode=v.touchOnly,e._touchMode===y.scrub?(i.preventDefault(),1===i.changedTouches.length&&(o=i.changedTouches[0].clientX-h,o>=0&&o<=e._topDiv.clientWidth&&e._setTimeBarTime(o,o*e._timeBarSecondsSpan/e._topDiv.clientWidth))):e._touchMode===y.slideZoom&&(a=i.touches.length,2===a?(s=.5*(i.touches[0].clientX+i.touches[1].clientX)-h,l=Math.abs(i.touches[0].clientX-i.touches[1].clientX)):1===a&&(s=i.touches[0].clientX-h,l=0),t(s)&&(l>0&&e._touchState.spanX>0?(c=e._touchState.spanX/l,u=n.addSeconds(e._startJulian,(e._touchState.centerX*e._timeBarSecondsSpan-s*e._timeBarSecondsSpan*c)/e._topDiv.clientWidth,new n)):(r=e._touchState.centerX-s,u=n.addSeconds(e._startJulian,r*e._timeBarSecondsSpan/e._topDiv.clientWidth,new n)),e.zoomTo(u,n.addSeconds(u,e._timeBarSecondsSpan*c,new n)),e._touchState.centerX=s,e._touchState.spanX=l))}}var g=1e12,v={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},y={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},C=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800,1296e3,2592e3,5184e3,7776e3,15552e3,31536e3,63072e3,126144e3,15768e4,31536e4,63072e4,126144e4,15768e5,31536e5,63072e5,126144e5,15768e6,31536e6],w=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];return l.prototype.addEventListener=function(e,t,i){this._topDiv.addEventListener(e,t,i)},l.prototype.removeEventListener=function(e,t,i){this._topDiv.removeEventListener(e,t,i)},l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){this._clock.onTick.removeEventListener(this.updateFromClock,this),document.removeEventListener("mouseup",this._onMouseUp,!1),document.removeEventListener("mousemove",this._onMouseMove,!1);var e=this._timeBarEle;e.removeEventListener("mousedown",this._onMouseDown,!1),e.removeEventListener("DOMMouseScroll",this._onMouseWheel,!1),e.removeEventListener("mousewheel",this._onMouseWheel,!1),e.removeEventListener("touchstart",this._onTouchStart,!1),e.removeEventListener("touchmove",this._onTouchMove,!1),e.removeEventListener("touchend",this._onTouchEnd,!1),e.removeEventListener("touchcancel",this._onTouchEnd,!1),this.container.removeChild(this._topDiv),i(this)},l.prototype.addHighlightRange=function(e,t,i){var r=new a(e,t,i);return this._highlightRanges.push(r),this.resize(),r},l.prototype.addTrack=function(e,t,i,r){var n=new s(e,t,i,r);return this._trackList.push(n),this._lastHeight=void 0,this.resize(),n},l.prototype.zoomTo=function(t,i){if(this._startJulian=t,this._endJulian=i,this._timeBarSecondsSpan=n.secondsDifference(i,t),this._clock&&this._clock.clockRange!==e.UNBOUNDED){var r=this._clock.startTime,o=this._clock.stopTime,a=n.secondsDifference(o,r),s=n.secondsDifference(r,this._startJulian),l=n.secondsDifference(o,this._endJulian);this._timeBarSecondsSpan>=a?(this._timeBarSecondsSpan=a,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):s>0?(this._endJulian=n.addSeconds(this._endJulian,s,new n),this._startJulian=r,this._timeBarSecondsSpan=n.secondsDifference(this._endJulian,this._startJulian)):l<0&&(this._startJulian=n.addSeconds(this._startJulian,l,new n),this._endJulian=o,this._timeBarSecondsSpan=n.secondsDifference(this._endJulian,this._startJulian))}this._makeTics();var u=document.createEvent("Event");u.initEvent("setzoom",!0,!0),u.startJulian=this._startJulian,u.endJulian=this._endJulian,u.epochJulian=this._epochJulian,u.totalSpan=this._timeBarSecondsSpan,u.mainTicSpan=this._mainTicSpan,this._topDiv.dispatchEvent(u)},l.prototype.zoomFrom=function(e){var t=n.secondsDifference(this._scrubJulian,this._startJulian);e>1||t<0||t>this._timeBarSecondsSpan?t=.5*this._timeBarSecondsSpan:t+=t-.5*this._timeBarSecondsSpan;var i=this._timeBarSecondsSpan-t;this.zoomTo(n.addSeconds(this._startJulian,t-t*e,new n),n.addSeconds(this._endJulian,i*e-i,new n))},l.prototype.makeLabel=function(e){var t=n.toGregorianDate(e),i=t.millisecond,r=" UTC";if(i>0&&this._timeBarSecondsSpan<3600){for(r=Math.floor(i).toString();r.length<3;)r="0"+r;r="."+r}return w[t.month-1]+" "+t.day+" "+t.year+" "+u(t.hour)+":"+u(t.minute)+":"+u(t.second)+r},l.prototype.smallestTicInPixels=7,l.prototype._makeTics=function(){function e(e){return Math.floor(E/e)*e}function t(e,t){return Math.ceil(e/t+.5)*t}function i(e){return(e-E)/_}function r(e,t){return e-t*Math.round(e/t)}var o,a=this._timeBarEle,s=n.secondsDifference(this._scrubJulian,this._startJulian),l=Math.round(s*this._topDiv.clientWidth/this._timeBarSecondsSpan),u=l-8,c=this;this._needleEle.style.left=l.toString()+"px";var h="",d=.01,p=31536e6,m=1e-10,f=0,_=this._timeBarSecondsSpan;_<d?(_=d,this._timeBarSecondsSpan=d,this._endJulian=n.addSeconds(this._startJulian,d,new n)):_>p&&(_=p,this._timeBarSecondsSpan=p,this._endJulian=n.addSeconds(this._startJulian,p,new n));var g=this._timeBarEle.clientWidth;g<10&&(g=10);var v,y=this._startJulian,w=Math.min(_/g*1e-5,.4),S=n.toGregorianDate(y);v=_>31536e4?n.fromDate(new Date(Date.UTC(100*Math.floor(S.year/100),0))):_>31536e3?n.fromDate(new Date(Date.UTC(10*Math.floor(S.year/10),0))):_>86400?n.fromDate(new Date(Date.UTC(S.year,0))):n.fromDate(new Date(Date.UTC(S.year,S.month,S.day)));var E=n.secondsDifference(this._startJulian,n.addSeconds(v,w,new n)),b=E+_;this._epochJulian=v,this._rulerEle.innerHTML=this.makeLabel(n.addSeconds(this._endJulian,-d,new n));var T=this._rulerEle.offsetWidth+20;T<30&&(T=180);var x=f;f-=m;var A={startTime:E,startJulian:y,epochJulian:v,duration:_,timeBarWidth:g,getAlpha:i};this._highlightRanges.forEach(function(e){h+=e.render(A)});var P=0,D=0,M=0,I=T/g;I>1&&(I=1),I*=this._timeBarSecondsSpan;var R,O=-1,N=-1,L=C.length;for(R=0;R<L;++R){var B=C[R];if(++O,P=B,B>I&&B>f)break;N<0&&g*(B/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(N=O)}if(O>0){for(;O>0;)if(--O,Math.abs(r(P,C[O]))<1e-5){C[O]>=f&&(D=C[O]);break}if(N>=0)for(;N<O;){if(Math.abs(r(D,C[N]))<1e-5&&C[N]>=f){M=C[N];break}++N}}f=x,f>m&&M<1e-5&&Math.abs(f-P)>m&&(M=f,f<=P+m&&(D=0));var F,V=-999999;if(g*(M/this._timeBarSecondsSpan)>=3)for(o=e(M);o<=b;o=t(o,M))h+='<span class="cesium-timeline-ticTiny" style="left: '+Math.round(g*i(o)).toString()+'px;"></span>';if(g*(D/this._timeBarSecondsSpan)>=3)for(o=e(D);o<=b;o=t(o,D))h+='<span class="cesium-timeline-ticSub" style="left: '+Math.round(g*i(o)).toString()+'px;"></span>';if(g*(P/this._timeBarSecondsSpan)>=2){this._mainTicSpan=P,b+=P,o=e(P);for(var k=n.computeTaiMinusUtc(v);o<=b;){var z=n.addSeconds(y,o-E,new n);if(P>2.1){var U=n.computeTaiMinusUtc(z);Math.abs(U-k)>.1&&(o+=U-k,z=n.addSeconds(y,o-E,new n))}var G=Math.round(g*i(o)),W=this.makeLabel(z);this._rulerEle.innerHTML=W,F=this._rulerEle.offsetWidth,F<10&&(F=T);var H=G-(F/2-1);H>V?(V=H+F+5,h+='<span class="cesium-timeline-ticMain" style="left: '+G.toString()+'px;"></span><span class="cesium-timeline-ticLabel" style="left: '+H.toString()+'px;">'+W+"</span>"):h+='<span class="cesium-timeline-ticSub" style="left: '+G.toString()+'px;"></span>',o=t(o,P)}}else this._mainTicSpan=-1;h+='<span class="cesium-timeline-icon16" style="left:'+u+'px;bottom:0;background-position: 0 0;"></span>',a.innerHTML=h,this._scrubElement=a.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),A.y=0,this._trackList.forEach(function(e){e.render(c._context,A),A.y+=e.height})},l.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;var e=this._scrubElement;if(t(this._scrubElement)){var i=n.secondsDifference(this._scrubJulian,this._startJulian),r=Math.round(i*this._topDiv.clientWidth/this._timeBarSecondsSpan);this._lastXPos!==r&&(this._lastXPos=r,e.style.left=r-8+"px",this._needleEle.style.left=r+"px")}t(this._timelineDragLocation)&&(this._setTimeBarTime(this._timelineDragLocation,this._timelineDragLocation*this._timeBarSecondsSpan/this._topDiv.clientWidth),this.zoomTo(n.addSeconds(this._startJulian,this._timelineDrag,new n),n.addSeconds(this._endJulian,this._timelineDrag,new n)))},l.prototype._setTimeBarTime=function(e,t){if(e=Math.round(e),this._scrubJulian=n.addSeconds(this._startJulian,t,new n),this._scrubElement){var i=e-8;this._scrubElement.style.left=i.toString()+"px",this._needleEle.style.left=e.toString()+"px"}var r=document.createEvent("Event");r.initEvent("settime",!0,!0),r.clientX=e,r.timeSeconds=t,r.timeJulian=this._scrubJulian,r.clock=this._clock,this._topDiv.dispatchEvent(r)},l.prototype.resize=function(){var e=this.container.clientWidth,t=this.container.clientHeight;if(e!==this._lastWidth||t!==this._lastHeight){this._trackContainer.style.height=t+"px";var i=1;this._trackList.forEach(function(e){i+=e.height}),this._trackListEle.style.height=i.toString()+"px",this._trackListEle.width=this._trackListEle.clientWidth,this._trackListEle.height=i,this._makeTics(),this._lastXPos=void 0,this._lastWidth=e,this._lastHeight=t}},l}),i("Widgets/VRButton/VRButtonViewModel",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/Fullscreen","../../ThirdParty/knockout","../../ThirdParty/NoSleep","../createCommand","../getElement"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e){var i=!1,r=window.screen;return t(r)&&(t(r.lockOrientation)?i=r.lockOrientation(e):t(r.mozLockOrientation)?i=r.mozLockOrientation(e):t(r.msLockOrientation)?i=r.msLockOrientation(e):t(r.orientation&&r.orientation.lock)&&(i=r.orientation.lock(e))),i}function h(){var e=window.screen;t(e)&&(t(e.unlockOrientation)?e.unlockOrientation():t(e.mozUnlockOrientation)?e.mozUnlockOrientation():t(e.msUnlockOrientation)?e.msUnlockOrientation():t(e.orientation&&e.orientation.unlock)&&e.orientation.unlock())}function d(e,t,i){i()?(t.useWebVR=!1,e._locked&&(h(),e._locked=!1),e._noSleep.disable(),o.exitFullscreen(),i(!1)):(o.fullscreen||o.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=c("landscape")),t.useWebVR=!0,i(!0))}function p(t,i){var r=this,n=a.observable(o.enabled),c=a.observable(!1);this.isVRMode=void 0,a.defineProperty(this,"isVRMode",{get:function(){return c()}}),this.isVREnabled=void 0,a.defineProperty(this,"isVREnabled",{get:function(){return n()},set:function(e){n(e&&o.enabled)}}),this.tooltip=void 0,a.defineProperty(this,"tooltip",function(){return n()?c()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"}),this._locked=!1,this._noSleep=new s,this._command=l(function(){d(r,t,c)},a.getObservable(this,"isVREnabled")),this._vrElement=e(u(i),document.body),this._callback=function(){!o.fullscreen&&c()&&(t.useWebVR=!1,r._locked&&(h(),r._locked=!1),r._noSleep.disable(),c(!1))},document.addEventListener(o.changeEventName,this._callback)}return i(p.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}}),p.prototype.isDestroyed=function(){return!1},p.prototype.destroy=function(){r(this)},p}),i("Widgets/VRButton/VRButton",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./VRButtonViewModel"],function(e,t,i,r,n,o,a){"use strict";function s(e,t,i){e=o(e);var r=new a(t,i);r._exitVRPath=u,r._enterVRPath=l;var s=document.createElement("button");s.type="button",s.className="cesium-button cesium-vrButton",s.setAttribute("data-bind","attr: { title: tooltip },click: command,enable: isVREnabled,cesiumSvgPath: { path: isVRMode ? _exitVRPath : _enterVRPath, width: 32, height: 32 }"),e.appendChild(s),n.applyBindings(r,s),this._container=e,this._viewModel=r,this._element=s}var l="M 5.3125 6.375 C 4.008126 6.375 2.96875 7.4141499 2.96875 8.71875 L 2.96875 19.5 C 2.96875 20.8043 4.008126 21.875 5.3125 21.875 L 13.65625 21.875 C 13.71832 20.0547 14.845166 18.59375 16.21875 18.59375 C 17.592088 18.59375 18.71881 20.0552 18.78125 21.875 L 27.09375 21.875 C 28.398125 21.875 29.4375 20.8043 29.4375 19.5 L 29.4375 8.71875 C 29.4375 7.4141499 28.398125 6.375 27.09375 6.375 L 5.3125 6.375 z M 9.625 10.4375 C 11.55989 10.4375 13.125 12.03385 13.125 13.96875 C 13.125 15.90365 11.55989 17.46875 9.625 17.46875 C 7.69011 17.46875 6.125 15.90365 6.125 13.96875 C 6.125 12.03385 7.69011 10.4375 9.625 10.4375 z M 22.46875 10.4375 C 24.40364 10.4375 25.96875 12.03385 25.96875 13.96875 C 25.96875 15.90365 24.40364 17.46875 22.46875 17.46875 C 20.53386 17.46875 18.96875 15.90365 18.96875 13.96875 C 18.96875 12.03385 20.53386 10.4375 22.46875 10.4375 z",u="M 25.770585,2.4552065 C 15.72282,13.962707 10.699956,19.704407 8.1768352,22.580207 c -1.261561,1.4379 -1.902282,2.1427 -2.21875,2.5 -0.141624,0.1599 -0.208984,0.2355 -0.25,0.2813 l 0.6875,0.75 c 10e-5,-10e-5 0.679191,0.727 0.6875,0.7187 0.01662,-0.016 0.02451,-0.024 0.03125,-0.031 0.01348,-0.014 0.04013,-0.038 0.0625,-0.062 0.04474,-0.05 0.120921,-0.1315 0.28125,-0.3126 0.320657,-0.3619 0.956139,-1.0921 2.2187499,-2.5312 2.5252219,-2.8781 7.5454589,-8.6169 17.5937499,-20.1250005 l -1.5,-1.3125 z m -20.5624998,3.9063 c -1.304375,0 -2.34375,1.0391 -2.34375,2.3437 l 0,10.8125005 c 0,1.3043 1.039375,2.375 2.34375,2.375 l 2.25,0 c 1.9518039,-2.2246 7.4710958,-8.5584 13.5624998,-15.5312005 l -15.8124998,0 z m 21.1249998,0 c -1.855467,2.1245 -2.114296,2.4005 -3.59375,4.0936995 1.767282,0.1815 3.15625,1.685301 3.15625,3.500001 0,1.9349 -1.56511,3.5 -3.5,3.5 -1.658043,0 -3.043426,-1.1411 -3.40625,-2.6875 -1.089617,1.2461 -2.647139,2.9988 -3.46875,3.9375 0.191501,-0.062 0.388502,-0.094 0.59375,-0.094 1.373338,0 2.50006,1.4614 2.5625,3.2812 l 8.3125,0 c 1.304375,0 2.34375,-1.0707 2.34375,-2.375 l 0,-10.8125005 c 0,-1.3046 -1.039375,-2.3437 -2.34375,-2.3437 l -0.65625,0 z M 9.5518351,10.423906 c 1.9348899,0 3.4999999,1.596401 3.4999999,3.531301 0,1.9349 -1.56511,3.5 -3.4999999,3.5 -1.9348899,0 -3.4999999,-1.5651 -3.4999999,-3.5 0,-1.9349 1.56511,-3.531301 3.4999999,-3.531301 z m 4.2187499,10.312601 c -0.206517,0.2356 -0.844218,0.9428 -1.03125,1.1562 l 0.8125,0 c 0.01392,-0.4081 0.107026,-0.7968 0.21875,-1.1562 z"; +return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return this._viewModel.destroy(),n.cleanNode(this._element),this._container.removeChild(this._element),i(this)},s}),i("Widgets/Viewer/Viewer",["../../Core/BoundingSphere","../../Core/Cartesian3","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/EventHelper","../../Core/isArray","../../Core/Matrix4","../../Core/Rectangle","../../Core/ScreenSpaceEventType","../../DataSources/BoundingSphereState","../../DataSources/ConstantPositionProperty","../../DataSources/DataSourceCollection","../../DataSources/DataSourceDisplay","../../DataSources/Entity","../../DataSources/EntityView","../../DataSources/Property","../../Scene/ImageryLayer","../../Scene/SceneMode","../../ThirdParty/knockout","../../ThirdParty/when","../Animation/Animation","../Animation/AnimationViewModel","../BaseLayerPicker/BaseLayerPicker","../BaseLayerPicker/createDefaultImageryProviderViewModels","../BaseLayerPicker/createDefaultTerrainProviderViewModels","../CesiumWidget/CesiumWidget","../ClockViewModel","../FullscreenButton/FullscreenButton","../Geocoder/Geocoder","../getElement","../HomeButton/HomeButton","../InfoBox/InfoBox","../NavigationHelpButton/NavigationHelpButton","../SceneModePicker/SceneModePicker","../SelectionIndicator/SelectionIndicator","../subscribeAndEvaluate","../Timeline/Timeline","../VRButton/VRButton"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I,R,O,N,L,B,F,V,k,z){"use strict";function U(e){var t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function G(e,t){var n=e.scene.pick(t.position);if(r(n)){var o=i(n.id,n.primitive.id);if(o instanceof _)return o}if(r(e.scene.globe))return H(e,t.position)}function W(e,t,i){if(r(i)){var n=i.clock;r(n)&&(n.getValue(t),r(e)&&(e.updateFromClock(),e.zoomTo(n.startTime,n.stopTime)))}}function H(e,t){var i=e.scene,n=i.camera.getPickRay(t),o=i.imageryLayers.pickImageryLayerFeatures(n,i);if(r(o)){var a=new _({id:"Loading...",description:"Loading feature information..."});return S(o,function(t){if(e.selectedEntity===a){if(!r(t)||0===t.length)return void(e.selectedEntity=q());var i=t[0],n=new _({id:i.name,description:i.description});if(r(i.position)){var o=e.scene.globe.ellipsoid.cartographicToCartesian(i.position,ee);n.position=new p(o)}e.selectedEntity=n}},function(){e.selectedEntity===a&&(e.selectedEntity=q())}),a}}function q(){return new _({id:"None",description:"No features found."})}function j(e,t){var i=e._geocoder,n=e._homeButton,o=e._sceneModePicker,a=e._baseLayerPicker,s=e._animation,l=e._timeline,u=e._fullscreenButton,c=e._infoBox,h=e._selectionIndicator,d=t?"hidden":"visible";if(r(i)&&(i.container.style.visibility=d),r(n)&&(n.container.style.visibility=d),r(o)&&(o.container.style.visibility=d),r(a)&&(a.container.style.visibility=d),r(s)&&(s.container.style.visibility=d),r(l)&&(l.container.style.visibility=d),r(u)&&u.viewModel.isFullscreenEnabled&&(u.container.style.visibility=d),r(c)&&(c.container.style.visibility=d),r(h)&&(h.container.style.visibility=d),e._container){var p=t||!r(u)?0:u.container.clientWidth;e._vrButton.container.style.right=p+"px",e.forceResize()}}function Y(e,t){function n(e){var t=G(u,e);r(t)&&(v.getValueOrUndefined(t.position,u.clock.currentTime)?u.trackedEntity=t:u.zoomTo(t))}function o(e){u.selectedEntity=G(u,e)}e=R(e),t=i(t,i.EMPTY_OBJECT);var a=!(r(t.globe)&&t.globe===!1||r(t.baseLayerPicker)&&t.baseLayerPicker===!1),u=this,c=document.createElement("div");c.className="cesium-viewer",e.appendChild(c);var d=document.createElement("div");d.className="cesium-viewer-cesiumWidgetContainer",c.appendChild(d);var p=document.createElement("div");p.className="cesium-viewer-bottom",c.appendChild(p);var _=i(t.scene3DOnly,!1),g=new P(d,{terrainProvider:t.terrainProvider,imageryProvider:!a&&t.imageryProvider,clock:t.clock,skyBox:t.skyBox,skyAtmosphere:t.skyAtmosphere,sceneMode:t.sceneMode,mapProjection:t.mapProjection,globe:t.globe,orderIndependentTranslucency:t.orderIndependentTranslucency,contextOptions:t.contextOptions,useDefaultRenderLoop:t.useDefaultRenderLoop,targetFrameRate:t.targetFrameRate,showRenderLoopErrors:t.showRenderLoopErrors,creditContainer:r(t.creditContainer)?t.creditContainer:p,scene3DOnly:_,terrainExaggeration:t.terrainExaggeration,shadows:t.shadows,terrainShadows:t.terrainShadows,mapMode2D:t.mapMode2D}),y=t.dataSources,C=!1;r(y)||(y=new m,C=!0);var S=new f({scene:g.scene,dataSourceCollection:y}),W=g.clock,H=new D(W),q=new s;q.add(W.onTick,Y.prototype._onTick,this),q.add(g.scene.morphStart,Y.prototype._clearTrackedObject,this);var X;if(!r(t.selectionIndicator)||t.selectionIndicator!==!1){var Z=document.createElement("div");Z.className="cesium-viewer-selectionIndicatorContainer",c.appendChild(Z),X=new F(Z,g.scene)}var K;if(!r(t.infoBox)||t.infoBox!==!1){var Q=document.createElement("div");Q.className="cesium-viewer-infoBoxContainer",c.appendChild(Q),K=new N(Q);var J=K.viewModel;q.add(J.cameraClicked,Y.prototype._onInfoBoxCameraClicked,this),q.add(J.closeClicked,Y.prototype._onInfoBoxClockClicked,this)}var $=document.createElement("div");$.className="cesium-viewer-toolbar",c.appendChild($);var ee;if(!r(t.geocoder)||t.geocoder!==!1){var te=document.createElement("div");te.className="cesium-viewer-geocoderContainer",$.appendChild(te),ee=new I({container:te,geocoderServices:r(t.geocoder)?l(t.geocoder)?t.geocoder:[t.geocoder]:void 0,scene:g.scene}),q.add(ee.viewModel.search.beforeExecute,Y.prototype._clearObjects,this)}var ie;r(t.homeButton)&&t.homeButton===!1||(ie=new O($,g.scene),r(ee)&&q.add(ie.viewModel.command.afterExecute,function(){var e=ee.viewModel;e.searchText="",e.isSearchInProgress&&e.search()}),q.add(ie.viewModel.command.beforeExecute,Y.prototype._clearTrackedObject,this));var re;_||r(t.sceneModePicker)&&t.sceneModePicker===!1||(re=new B($,g.scene));var ne,oe;if(a){var ae=i(t.imageryProviderViewModels,x()),se=i(t.terrainProviderViewModels,A());ne=new T($,{globe:g.scene.globe,imageryProviderViewModels:ae,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:se,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel});var le=$.getElementsByClassName("cesium-baseLayerPicker-dropDown");oe=le[0]}var ue;if(!r(t.navigationHelpButton)||t.navigationHelpButton!==!1){var ce=!0;try{if(r(window.localStorage)){var he=window.localStorage.getItem("cesium-hasSeenNavHelp");r(he)&&Boolean(he)?ce=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch(e){}ue=new L({container:$,instructionsInitiallyVisible:i(t.navigationInstructionsInitiallyVisible,ce)})}var de;if(!r(t.animation)||t.animation!==!1){var pe=document.createElement("div");pe.className="cesium-viewer-animationContainer",c.appendChild(pe),de=new E(pe,new b(H))}var me;if(!r(t.timeline)||t.timeline!==!1){var fe=document.createElement("div");fe.className="cesium-viewer-timelineContainer",c.appendChild(fe),me=new k(fe,W),me.addEventListener("settime",U,!1),me.zoomTo(W.startTime,W.stopTime)}var _e,ge;if(!r(t.fullscreenButton)||t.fullscreenButton!==!1){var ve=document.createElement("div");ve.className="cesium-viewer-fullscreenContainer",c.appendChild(ve),_e=new M(ve,t.fullscreenElement),ge=V(_e.viewModel,"isFullscreenEnabled",function(e){ve.style.display=e?"block":"none",r(me)&&(me.container.style.right=ve.clientWidth+"px",me.resize())})}var ye,Ce,we;if(t.vrButton){var Se=document.createElement("div");Se.className="cesium-viewer-vrContainer",c.appendChild(Se),ye=new z(Se,g.scene,t.fullScreenElement),Ce=V(ye.viewModel,"isVREnabled",function(e){Se.style.display=e?"block":"none",r(_e)&&(Se.style.right=ve.clientWidth+"px"),r(me)&&(me.container.style.right=Se.clientWidth+"px",me.resize())}),we=V(ye.viewModel,"isVRMode",function(e){j(u,e)})}this._baseLayerPickerDropDown=oe,this._fullscreenSubscription=ge,this._vrSubscription=Ce,this._vrModeSubscription=we,this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=i(t.automaticallyTrackDataSourceClocks,!0),this._container=e,this._bottomContainer=p,this._element=c,this._cesiumWidget=g,this._selectionIndicator=X,this._infoBox=K,this._dataSourceCollection=y,this._destroyDataSourceCollection=C,this._dataSourceDisplay=S,this._clockViewModel=H,this._toolbar=$,this._homeButton=ie,this._sceneModePicker=re,this._baseLayerPicker=ne,this._navigationHelpButton=ue,this._animation=de,this._timeline=me,this._fullscreenButton=_e,this._vrButton=ye,this._geocoder=ee,this._eventHelper=q,this._lastWidth=0,this._lastHeight=0,this._allowDataSourcesToSuspendAnimation=!0,this._entityView=void 0,this._enableInfoOrSelection=r(K)||r(X),this._clockTrackedDataSource=void 0,this._trackedEntity=void 0,this._needTrackedEntityUpdate=!1,this._selectedEntity=void 0,this._clockTrackedDataSource=void 0,this._forceResize=!1,this._zoomIsFlight=!1,this._zoomTarget=void 0,this._zoomPromise=void 0,this._zoomOptions=void 0,w.track(this,["_trackedEntity","_selectedEntity","_clockTrackedDataSource"]),q.add(y.dataSourceAdded,Y.prototype._onDataSourceAdded,this),q.add(y.dataSourceRemoved,Y.prototype._onDataSourceRemoved,this),q.add(g.scene.preRender,Y.prototype.resize,this),q.add(g.scene.postRender,Y.prototype._postRender,this);for(var Ee=y.length,be=0;be<Ee;be++)this._dataSourceAdded(y,y.get(be));this._dataSourceAdded(void 0,S.defaultDataSource),q.add(y.dataSourceAdded,Y.prototype._dataSourceAdded,this),q.add(y.dataSourceRemoved,Y.prototype._dataSourceRemoved,this),g.screenSpaceEventHandler.setInputAction(o,h.LEFT_CLICK),g.screenSpaceEventHandler.setInputAction(n,h.LEFT_DOUBLE_CLICK)}function X(e,t,n,o){K(e);var a=S.defer();return e._zoomPromise=a,e._zoomIsFlight=o,e._zoomOptions=n,S(t,function(t){if(e._zoomPromise===a){if(t instanceof y)return void t.getViewableRectangle().then(function(t){e._zoomPromise===a&&(e._zoomTarget=t)});if(t.isLoading&&r(t.loadingEvent))var n=t.loadingEvent.addEventListener(function(){n(),e._zoomPromise===a&&(e._zoomTarget=t.entities.values.slice(0))});else{if(l(t))return void(e._zoomTarget=t.slice(0));t=i(t.values,t),r(t.entities)&&(t=t.entities.values),l(t)?e._zoomTarget=t.slice(0):e._zoomTarget=[t]}}}),a.promise}function Z(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function K(e){var t=e._zoomPromise;r(t)&&(Z(e),t.resolve(!1))}function Q(t){var n=t._zoomTarget;if(r(n)&&t.scene.mode!==C.MORPHING){var o=t.scene,a=o.camera,s=t._zoomPromise,l=i(t._zoomOptions,{});if(n instanceof c){var h={destination:n,duration:l.duration,maximumHeight:l.maximumHeight,complete:function(){s.resolve(!0)},cancel:function(){s.resolve(!1)}};return t._zoomIsFlight?a.flyTo(h):(a.setView(h),s.resolve(!0)),void Z(t)}for(var p=[],m=0,f=n.length;m<f;m++){var _=t._dataSourceDisplay.getBoundingSphere(n[m],!1,$);if(_===d.PENDING)return;_!==d.FAILED&&p.push(e.clone($))}if(0===p.length)return void K(t);t.trackedEntity=void 0;var g=e.fromBoundingSpheres(p),v=o.screenSpaceCameraController;v.minimumZoomDistance=Math.min(v.minimumZoomDistance,.5*g.radius),t._zoomIsFlight?(Z(t),a.flyToBoundingSphere(g,{duration:l.duration,maximumHeight:l.maximumHeight,complete:function(){s.resolve(!0)},cancel:function(){s.resolve(!1)},offset:l.offset})):(a.viewBoundingSphere(g,t._zoomOptions),a.lookAtTransform(u.IDENTITY),Z(t),s.resolve(!0))}}function J(e){if(e._needTrackedEntityUpdate){var t=e._trackedEntity,i=e.clock.currentTime,n=v.getValueOrUndefined(t.position,i);if(r(n)){var o=e.scene,a=e._dataSourceDisplay.getBoundingSphere(t,!1,$);if(a!==d.PENDING){var s=o.mode;s!==C.COLUMBUS_VIEW&&s!==C.SCENE2D||(o.screenSpaceCameraController.enableTranslate=!1),s!==C.COLUMBUS_VIEW&&s!==C.SCENE3D||(o.screenSpaceCameraController.enableTilt=!1);var l=a!==d.FAILED?$:void 0;e._entityView=new g(t,o,o.mapProjection.ellipsoid),e._entityView.update(i,l),e._needTrackedEntityUpdate=!1}}}}var $=new e,ee=new t;return n(Y.prototype,{container:{get:function(){return this._container}},bottomContainer:{get:function(){return this._bottomContainer}},cesiumWidget:{get:function(){return this._cesiumWidget}},selectionIndicator:{get:function(){return this._selectionIndicator}},infoBox:{get:function(){return this._infoBox}},geocoder:{get:function(){return this._geocoder}},homeButton:{get:function(){return this._homeButton}},sceneModePicker:{get:function(){return this._sceneModePicker}},baseLayerPicker:{get:function(){return this._baseLayerPicker}},navigationHelpButton:{get:function(){return this._navigationHelpButton}},animation:{get:function(){return this._animation}},timeline:{get:function(){return this._timeline}},fullscreenButton:{get:function(){return this._fullscreenButton}},vrButton:{get:function(){return this._vrButton}},dataSourceDisplay:{get:function(){return this._dataSourceDisplay}},entities:{get:function(){return this._dataSourceDisplay.defaultDataSource.entities}},dataSources:{get:function(){return this._dataSourceCollection}},canvas:{get:function(){return this._cesiumWidget.canvas}},cesiumLogo:{get:function(){return this._cesiumWidget.cesiumLogo}},scene:{get:function(){return this._cesiumWidget.scene}},shadows:{get:function(){return this.scene.shadowMap.enabled},set:function(e){this.scene.shadowMap.enabled=e}},terrainShadows:{get:function(){return this.scene.globe.shadows},set:function(e){this.scene.globe.shadows=e}},shadowMap:{get:function(){return this.scene.shadowMap}},imageryLayers:{get:function(){return this.scene.imageryLayers}},terrainProvider:{get:function(){return this.scene.terrainProvider},set:function(e){this.scene.terrainProvider=e}},camera:{get:function(){return this.scene.camera}},clock:{get:function(){return this._cesiumWidget.clock}},screenSpaceEventHandler:{get:function(){return this._cesiumWidget.screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._cesiumWidget.targetFrameRate},set:function(e){this._cesiumWidget.targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._cesiumWidget.useDefaultRenderLoop},set:function(e){this._cesiumWidget.useDefaultRenderLoop=e}},resolutionScale:{get:function(){return this._cesiumWidget.resolutionScale},set:function(e){this._cesiumWidget.resolutionScale=e,this._forceResize=!0}},allowDataSourcesToSuspendAnimation:{get:function(){return this._allowDataSourcesToSuspendAnimation},set:function(e){this._allowDataSourcesToSuspendAnimation=e}},trackedEntity:{get:function(){return this._trackedEntity},set:function(e){if(this._trackedEntity!==e){this._trackedEntity=e,K(this);var t=this.scene,i=t.mode;if(!r(e)||!r(e.position))return this._needTrackedEntityUpdate=!1,i!==C.COLUMBUS_VIEW&&i!==C.SCENE2D||(t.screenSpaceCameraController.enableTranslate=!0),i!==C.COLUMBUS_VIEW&&i!==C.SCENE3D||(t.screenSpaceCameraController.enableTilt=!0),this._entityView=void 0,void this.camera.lookAtTransform(u.IDENTITY);this._needTrackedEntityUpdate=!0}}},selectedEntity:{get:function(){return this._selectedEntity},set:function(e){if(this._selectedEntity!==e){this._selectedEntity=e;var t=r(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;r(e)?r(t)&&t.animateAppear():r(t)&&t.animateDepart()}}},clockTrackedDataSource:{get:function(){return this._clockTrackedDataSource},set:function(e){this._clockTrackedDataSource!==e&&(this._clockTrackedDataSource=e,W(this._timeline,this.clock,e))}}}),Y.prototype.extend=function(e,t){e(this,t)},Y.prototype.resize=function(){var e=this._cesiumWidget,t=this._container,i=t.clientWidth,n=t.clientHeight,o=r(this._animation),a=r(this._timeline);if(this._forceResize||i!==this._lastWidth||n!==this._lastHeight){e.resize(),this._forceResize=!1;var s=n-125,l=this._baseLayerPickerDropDown;if(r(l)&&(l.style.maxHeight=s+"px"),r(this._geocoder)){var u=this._geocoder.searchSuggestionsContainer;u.style.maxHeight=s+"px"}r(this._infoBox)&&(this._infoBox.viewModel.maxHeight=s);var c,h=this._timeline,d=0,p=0,m=0;if(o&&"hidden"!==window.getComputedStyle(this._animation.container).visibility){var f=this._lastWidth;c=this._animation.container,i>900?(d=169,f<=900&&(c.style.width="169px",c.style.height="112px",this._animation.resize())):i>=600?(d=136,(f<600||f>900)&&(c.style.width="136px",c.style.height="90px",this._animation.resize())):(d=106,(f>600||0===f)&&(c.style.width="106px",c.style.height="70px",this._animation.resize())),p=d+5}if(a&&"hidden"!==window.getComputedStyle(this._timeline.container).visibility){var _=this._fullscreenButton,g=this._vrButton,v=h.container,y=v.style;m=v.clientHeight+3,y.left=d+"px";var C=0;r(_)&&(C+=_.container.clientWidth),r(g)&&(C+=g.container.clientWidth),y.right=C+"px",h.resize()}this._bottomContainer.style.left=p+"px",this._bottomContainer.style.bottom=m+"px",this._lastWidth=i,this._lastHeight=n}},Y.prototype.forceResize=function(){this._lastWidth=0,this.resize()},Y.prototype.render=function(){this._cesiumWidget.render()},Y.prototype.isDestroyed=function(){return!1},Y.prototype.destroy=function(){var e;this.screenSpaceEventHandler.removeInputAction(h.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(h.LEFT_DOUBLE_CLICK);var t=this.dataSources,i=t.length;for(e=0;e<i;e++)this._dataSourceRemoved(t,t.get(e));return this._dataSourceRemoved(void 0,this._dataSourceDisplay.defaultDataSource),this._container.removeChild(this._element),this._element.removeChild(this._toolbar),this._eventHelper.removeAll(),r(this._geocoder)&&(this._geocoder=this._geocoder.destroy()),r(this._homeButton)&&(this._homeButton=this._homeButton.destroy()),r(this._sceneModePicker)&&(this._sceneModePicker=this._sceneModePicker.destroy()),r(this._baseLayerPicker)&&(this._baseLayerPicker=this._baseLayerPicker.destroy()),r(this._animation)&&(this._element.removeChild(this._animation.container),this._animation=this._animation.destroy()),r(this._timeline)&&(this._timeline.removeEventListener("settime",U,!1),this._element.removeChild(this._timeline.container),this._timeline=this._timeline.destroy()),r(this._fullscreenButton)&&(this._fullscreenSubscription.dispose(),this._element.removeChild(this._fullscreenButton.container),this._fullscreenButton=this._fullscreenButton.destroy()),r(this._vrButton)&&(this._vrSubscription.dispose(),this._vrModeSubscription.dispose(),this._element.removeChild(this._vrButton.container),this._vrButton=this._vrButton.destroy()),r(this._infoBox)&&(this._element.removeChild(this._infoBox.container),this._infoBox=this._infoBox.destroy()),r(this._selectionIndicator)&&(this._element.removeChild(this._selectionIndicator.container),this._selectionIndicator=this._selectionIndicator.destroy()),this._clockViewModel=this._clockViewModel.destroy(),this._dataSourceDisplay=this._dataSourceDisplay.destroy(),this._cesiumWidget=this._cesiumWidget.destroy(),this._destroyDataSourceCollection&&(this._dataSourceCollection=this._dataSourceCollection.destroy()),o(this)},Y.prototype._dataSourceAdded=function(e,t){var i=t.entities;i.collectionChanged.addEventListener(Y.prototype._onEntityCollectionChanged,this)},Y.prototype._dataSourceRemoved=function(e,t){var i=t.entities;i.collectionChanged.removeEventListener(Y.prototype._onEntityCollectionChanged,this),r(this.trackedEntity)&&i.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0),r(this.selectedEntity)&&i.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)},Y.prototype._onTick=function(e){var n=e.currentTime,o=this._dataSourceDisplay.update(n);this._allowDataSourcesToSuspendAnimation&&(this._clockViewModel.canAnimate=o);var a=this._entityView;if(r(a)){var s=this._trackedEntity,l=this._dataSourceDisplay.getBoundingSphere(s,!1,$);l===d.DONE&&a.update(n,$)}var u,c=!1,h=this.selectedEntity,p=r(h)&&this._enableInfoOrSelection;if(p&&h.isShowing&&h.isAvailable(n)){var m=this._dataSourceDisplay.getBoundingSphere(h,!0,$);m!==d.FAILED?u=$.center:r(h.position)&&(u=h.position.getValue(n,u)),c=r(u)}var f=r(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;r(f)&&(f.position=t.clone(u,f.position),f.showSelection=p&&c,f.update());var _=r(this._infoBox)?this._infoBox.viewModel:void 0;r(_)&&(_.showInfo=p,_.enableCamera=c,_.isCameraTracking=this.trackedEntity===this.selectedEntity,p?(_.titleText=i(h.name,h.id),_.description=v.getValueOrDefault(h.description,n,"")):(_.titleText="",_.description=""))},Y.prototype._onEntityCollectionChanged=function(e,t,i){for(var r=i.length,n=0;n<r;n++){var o=i[n];this.trackedEntity===o&&(this.trackedEntity=void 0),this.selectedEntity===o&&(this.selectedEntity=void 0)}},Y.prototype._onInfoBoxCameraClicked=function(e){if(e.isCameraTracking&&this.trackedEntity===this.selectedEntity)this.trackedEntity=void 0;else{var t=this.selectedEntity,i=t.position;r(i)?this.trackedEntity=this.selectedEntity:this.zoomTo(this.selectedEntity)}},Y.prototype._clearTrackedObject=function(){this.trackedEntity=void 0},Y.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0},Y.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0},Y.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&W(this.timeline,this.clock,e)},Y.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);var i=t.entities.id,r=this._eventHelper.add(t.changedEvent,Y.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[i]=r},Y.prototype._onDataSourceRemoved=function(e,t){var i=this.clockTrackedDataSource===t,r=t.entities.id;if(this._dataSourceChangedListeners[r](),this._dataSourceChangedListeners[r]=void 0,i){var n=e.length;this._automaticallyTrackDataSourceClocks&&n>0?this.clockTrackedDataSource=e.get(n-1):this.clockTrackedDataSource=void 0}},Y.prototype.zoomTo=function(e,t){return X(this,e,t,!1)},Y.prototype.flyTo=function(e,t){return X(this,e,t,!0)},Y.prototype._postRender=function(){Q(this),J(this)},Y}),i("Widgets/Viewer/viewerCesiumInspectorMixin",["../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../CesiumInspector/CesiumInspector"],function(e,t,i,r){"use strict";function n(e){var i=document.createElement("div");i.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(i);var n=new r(i,e.scene);t(e,{cesiumInspector:{get:function(){return n}}}),e.scene.postRender.addEventListener(function(){e.cesiumInspector.viewModel.update()})}return n}),i("Widgets/Viewer/viewerDragDropMixin",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/Event","../../Core/wrapFunction","../../DataSources/CzmlDataSource","../../DataSources/GeoJsonDataSource","../../DataSources/KmlDataSource","../getElement"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(t,r){function a(e){h(e),_&&(t.entities.removeAll(),t.dataSources.removeAll());for(var i=e.dataTransfer.files,r=i.length,n=0;n<r;n++){var o=i[n],a=new FileReader;a.onload=m(t,o,y,v),a.onerror=f(t,o),a.readAsText(o)}}r=e(r,e.EMPTY_OBJECT);var s=!0,l=e(r.flyToOnDrop,!0),c=new n,_=e(r.clearOnDrop,!0),g=e(r.dropTarget,t.container),v=e(r.clampToGround,!0),y=r.proxy;g=u(g),i(t,{dropTarget:{get:function(){return g},set:function(e){d(g,a),g=e,p(g,a)}},dropEnabled:{get:function(){return s},set:function(e){e!==s&&(e?p(g,a):d(g,a),s=e)}},dropError:{get:function(){return c}},clearOnDrop:{get:function(){return _},set:function(e){_=e}},flyToOnDrop:{get:function(){return l},set:function(e){l=e}},proxy:{get:function(){return y},set:function(e){y=e}},clampToGround:{get:function(){return v},set:function(e){v=e}}}),p(g,a),t.destroy=o(t,t.destroy,function(){t.dropEnabled=!1}),t._handleDrop=a}function h(e){e.stopPropagation(),e.preventDefault()}function d(e,i){var r=e;t(r)&&(r.removeEventListener("drop",i,!1),r.removeEventListener("dragenter",h,!1),r.removeEventListener("dragover",h,!1),r.removeEventListener("dragexit",h,!1))}function p(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",h,!1),e.addEventListener("dragover",h,!1),e.addEventListener("dragexit",h,!1)}function m(e,i,r,n){var o=e.scene;return function(u){var c=i.name;try{var h;if(/\.czml$/i.test(c))h=a.load(JSON.parse(u.target.result),{sourceUri:c});else if(/\.geojson$/i.test(c)||/\.json$/i.test(c)||/\.topojson$/i.test(c))h=s.load(JSON.parse(u.target.result),{sourceUri:c,clampToGround:n});else{if(!/\.(kml|kmz)$/i.test(c))return void e.dropError.raiseEvent(e,c,"Unrecognized file: "+c);h=l.load(i,{sourceUri:c,proxy:r,camera:o.camera,canvas:o.canvas})}t(h)&&e.dataSources.add(h).then(function(t){e.flyToOnDrop&&e.flyTo(t)}).otherwise(function(t){e.dropError.raiseEvent(e,c,t)})}catch(t){e.dropError.raiseEvent(e,c,t)}}}function f(e,t){return function(i){e.dropError.raiseEvent(e,t.name,i.target.error)}}return c}),i("Widgets/Viewer/viewerPerformanceWatchdogMixin",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../PerformanceWatchdog/PerformanceWatchdog"],function(e,t,i,r,n){"use strict";function o(t,r){r=e(r,e.EMPTY_OBJECT);var o=new n({scene:t.scene,container:t.bottomContainer,lowFrameRateMessage:r.lowFrameRateMessage});i(t,{performanceWatchdog:{get:function(){return o}}})}return o}),i("Workers/createTaskProcessorWorker",["../Core/defaultValue","../Core/defined","../Core/formatError"],function(e,t,i){"use strict";function r(r){var n,o=[],a={id:void 0,result:void 0,error:void 0};return function(s){var l=s.data;o.length=0,a.id=l.id,a.error=void 0,a.result=void 0;try{a.result=r(l.parameters,o)}catch(e){e instanceof Error?a.error={name:e.name,message:e.message,stack:e.stack}:a.error=e}t(n)||(n=e(self.webkitPostMessage,self.postMessage)),l.canTransferArrayBuffer||(o.length=0);try{n(a,o)}catch(e){a.result=void 0,a.error="postMessage failed with error: "+i(e)+"\n with responseMessage: "+JSON.stringify(a),n(a)}}}return r}),i("Cesium",["./Core/appendForwardSlash","./Core/ArcGisImageServerTerrainProvider","./Core/arrayRemoveDuplicates","./Core/AssociativeArray","./Core/AttributeCompression","./Core/AxisAlignedBoundingBox","./Core/barycentricCoordinates","./Core/binarySearch","./Core/BingMapsApi","./Core/BingMapsGeocoderService","./Core/BoundingRectangle","./Core/BoundingSphere","./Core/BoxGeometry","./Core/BoxOutlineGeometry","./Core/buildModuleUrl","./Core/cancelAnimationFrame","./Core/Cartesian2","./Core/Cartesian3","./Core/Cartesian4","./Core/Cartographic","./Core/CartographicGeocoderService","./Core/CatmullRomSpline","./Core/CesiumTerrainProvider","./Core/Check","./Core/CircleGeometry","./Core/CircleOutlineGeometry","./Core/Clock","./Core/ClockRange","./Core/ClockStep","./Core/clone","./Core/Color","./Core/ColorGeometryInstanceAttribute","./Core/combine","./Core/ComponentDatatype","./Core/CornerType","./Core/CorridorGeometry","./Core/CorridorGeometryLibrary","./Core/CorridorOutlineGeometry","./Core/createGuid","./Core/Credit","./Core/CubicRealPolynomial","./Core/CylinderGeometry","./Core/CylinderGeometryLibrary","./Core/CylinderOutlineGeometry","./Core/DefaultProxy","./Core/defaultValue","./Core/defined","./Core/defineProperties","./Core/deprecationWarning","./Core/destroyObject","./Core/DeveloperError","./Core/DistanceDisplayCondition","./Core/DistanceDisplayConditionGeometryInstanceAttribute","./Core/EarthOrientationParameters","./Core/EarthOrientationParametersSample","./Core/EasingFunction","./Core/EllipseGeometry","./Core/EllipseGeometryLibrary","./Core/EllipseOutlineGeometry","./Core/Ellipsoid","./Core/EllipsoidalOccluder","./Core/EllipsoidGeodesic","./Core/EllipsoidGeometry","./Core/EllipsoidOutlineGeometry","./Core/EllipsoidTangentPlane","./Core/EllipsoidTerrainProvider","./Core/EncodedCartesian3","./Core/Event","./Core/EventHelper","./Core/ExtrapolationType","./Core/FeatureDetection","./Core/formatError","./Core/freezeObject","./Core/Fullscreen","./Core/GeocoderService","./Core/GeographicProjection","./Core/GeographicTilingScheme","./Core/Geometry","./Core/GeometryAttribute","./Core/GeometryAttributes","./Core/GeometryInstance","./Core/GeometryInstanceAttribute","./Core/GeometryPipeline","./Core/GeometryType","./Core/getAbsoluteUri","./Core/getBaseUri","./Core/getExtensionFromUri","./Core/getFilenameFromUri","./Core/getImagePixels","./Core/getMagic","./Core/getStringFromTypedArray","./Core/getTimestamp","./Core/GregorianDate","./Core/HeadingPitchRange","./Core/HeadingPitchRoll","./Core/HeightmapTerrainData","./Core/HeightmapTessellator","./Core/HermitePolynomialApproximation","./Core/HermiteSpline","./Core/Iau2000Orientation","./Core/Iau2006XysData","./Core/Iau2006XysSample","./Core/IauOrientationAxes","./Core/IauOrientationParameters","./Core/IndexDatatype","./Core/InterpolationAlgorithm","./Core/Intersect","./Core/Intersections2D","./Core/IntersectionTests","./Core/Interval","./Core/isArray","./Core/isCrossOriginUrl","./Core/isLeapYear","./Core/Iso8601","./Core/joinUrls","./Core/JulianDate","./Core/KeyboardEventModifier","./Core/LagrangePolynomialApproximation","./Core/LeapSecond","./Core/LinearApproximation","./Core/LinearSpline","./Core/loadArrayBuffer","./Core/loadBlob","./Core/loadImage","./Core/loadImageFromTypedArray","./Core/loadImageViaBlob","./Core/loadJson","./Core/loadJsonp","./Core/loadText","./Core/loadWithXhr","./Core/loadXML","./Core/MapboxApi","./Core/MapProjection","./Core/Math","./Core/Matrix2","./Core/Matrix3","./Core/Matrix4","./Core/mergeSort","./Core/NearFarScalar","./Core/objectToQuery","./Core/Occluder","./Core/oneTimeWarning","./Core/OrientedBoundingBox","./Core/Packable","./Core/PackableForInterpolation","./Core/parseResponseHeaders","./Core/PinBuilder","./Core/PixelFormat","./Core/Plane","./Core/PointGeometry","./Core/pointInsideTriangle","./Core/PolygonGeometry","./Core/PolygonGeometryLibrary","./Core/PolygonHierarchy","./Core/PolygonOutlineGeometry","./Core/PolygonPipeline","./Core/PolylineGeometry","./Core/PolylinePipeline","./Core/PolylineVolumeGeometry","./Core/PolylineVolumeGeometryLibrary","./Core/PolylineVolumeOutlineGeometry","./Core/PrimitiveType","./Core/QuadraticRealPolynomial","./Core/QuantizedMeshTerrainData","./Core/QuarticRealPolynomial","./Core/Quaternion","./Core/QuaternionSpline","./Core/queryToObject","./Core/Queue","./Core/Ray","./Core/Rectangle","./Core/RectangleGeometry","./Core/RectangleGeometryLibrary","./Core/RectangleOutlineGeometry","./Core/ReferenceFrame","./Core/requestAnimationFrame","./Core/RequestErrorEvent","./Core/RuntimeError","./Core/sampleTerrain","./Core/sampleTerrainMostDetailed","./Core/scaleToGeodeticSurface","./Core/ScreenSpaceEventHandler","./Core/ScreenSpaceEventType","./Core/ShowGeometryInstanceAttribute","./Core/Simon1994PlanetaryPositions","./Core/SimplePolylineGeometry","./Core/SphereGeometry","./Core/SphereOutlineGeometry","./Core/Spherical","./Core/Spline","./Core/subdivideArray","./Core/TaskProcessor","./Core/TerrainData","./Core/TerrainEncoding","./Core/TerrainMesh","./Core/TerrainProvider","./Core/TerrainQuantization","./Core/throttleRequestByServer","./Core/TileAvailability","./Core/TileProviderError","./Core/TilingScheme","./Core/TimeConstants","./Core/TimeInterval","./Core/TimeIntervalCollection","./Core/TimeStandard","./Core/Tipsify","./Core/Transforms","./Core/TranslationRotationScale","./Core/TridiagonalSystemSolver","./Core/TrustedServers","./Core/VertexFormat","./Core/VideoSynchronizer","./Core/Visibility","./Core/VRTheWorldTerrainProvider","./Core/WallGeometry","./Core/WallGeometryLibrary","./Core/WallOutlineGeometry","./Core/WebGLConstants","./Core/WebMercatorProjection","./Core/WebMercatorTilingScheme","./Core/WindingOrder","./Core/wrapFunction","./Core/writeTextToCanvas","./DataSources/BillboardGraphics","./DataSources/BillboardVisualizer","./DataSources/BoundingSphereState","./DataSources/BoxGeometryUpdater","./DataSources/BoxGraphics","./DataSources/CallbackProperty","./DataSources/CheckerboardMaterialProperty","./DataSources/ColorMaterialProperty","./DataSources/CompositeEntityCollection","./DataSources/CompositeMaterialProperty","./DataSources/CompositePositionProperty","./DataSources/CompositeProperty","./DataSources/ConstantPositionProperty","./DataSources/ConstantProperty","./DataSources/CorridorGeometryUpdater","./DataSources/CorridorGraphics","./DataSources/createMaterialPropertyDescriptor","./DataSources/createPropertyDescriptor","./DataSources/createRawPropertyDescriptor","./DataSources/CustomDataSource","./DataSources/CylinderGeometryUpdater","./DataSources/CylinderGraphics","./DataSources/CzmlDataSource","./DataSources/DataSource","./DataSources/DataSourceClock","./DataSources/DataSourceCollection","./DataSources/DataSourceDisplay","./DataSources/dynamicGeometryGetBoundingSphere","./DataSources/DynamicGeometryUpdater","./DataSources/EllipseGeometryUpdater","./DataSources/EllipseGraphics","./DataSources/EllipsoidGeometryUpdater","./DataSources/EllipsoidGraphics","./DataSources/Entity","./DataSources/EntityCluster","./DataSources/EntityCollection","./DataSources/EntityView","./DataSources/GeoJsonDataSource","./DataSources/GeometryUpdater","./DataSources/GeometryVisualizer","./DataSources/GridMaterialProperty","./DataSources/ImageMaterialProperty","./DataSources/KmlDataSource","./DataSources/LabelGraphics","./DataSources/LabelVisualizer","./DataSources/MaterialProperty","./DataSources/ModelGraphics","./DataSources/ModelVisualizer","./DataSources/NodeTransformationProperty","./DataSources/PathGraphics","./DataSources/PathVisualizer","./DataSources/PointGraphics","./DataSources/PointVisualizer","./DataSources/PolygonGeometryUpdater","./DataSources/PolygonGraphics","./DataSources/PolylineArrowMaterialProperty","./DataSources/PolylineGeometryUpdater","./DataSources/PolylineGlowMaterialProperty","./DataSources/PolylineGraphics","./DataSources/PolylineOutlineMaterialProperty","./DataSources/PolylineVolumeGeometryUpdater","./DataSources/PolylineVolumeGraphics","./DataSources/PositionProperty","./DataSources/PositionPropertyArray","./DataSources/Property","./DataSources/PropertyArray","./DataSources/PropertyBag","./DataSources/RectangleGeometryUpdater","./DataSources/RectangleGraphics","./DataSources/ReferenceProperty","./DataSources/Rotation","./DataSources/SampledPositionProperty","./DataSources/SampledProperty","./DataSources/ScaledPositionProperty","./DataSources/StaticGeometryColorBatch","./DataSources/StaticGeometryPerMaterialBatch","./DataSources/StaticGroundGeometryColorBatch","./DataSources/StaticOutlineGeometryBatch","./DataSources/StripeMaterialProperty","./DataSources/StripeOrientation","./DataSources/TimeIntervalCollectionPositionProperty","./DataSources/TimeIntervalCollectionProperty","./DataSources/VelocityOrientationProperty","./DataSources/VelocityVectorProperty","./DataSources/Visualizer","./DataSources/WallGeometryUpdater","./DataSources/WallGraphics","./Renderer/AutomaticUniforms","./Renderer/Buffer","./Renderer/BufferUsage","./Renderer/ClearCommand","./Renderer/ComputeCommand","./Renderer/ComputeEngine","./Renderer/Context","./Renderer/ContextLimits","./Renderer/createUniform","./Renderer/createUniformArray","./Renderer/CubeMap","./Renderer/CubeMapFace","./Renderer/DrawCommand","./Renderer/Framebuffer","./Renderer/loadCubeMap","./Renderer/MipmapHint","./Renderer/Pass","./Renderer/PassState","./Renderer/PickFramebuffer","./Renderer/PixelDatatype","./Renderer/Renderbuffer","./Renderer/RenderbufferFormat","./Renderer/RenderState","./Renderer/Sampler","./Renderer/ShaderCache","./Renderer/ShaderProgram","./Renderer/ShaderSource","./Renderer/Texture","./Renderer/TextureMagnificationFilter","./Renderer/TextureMinificationFilter","./Renderer/TextureWrap","./Renderer/UniformState","./Renderer/VertexArray","./Renderer/VertexArrayFacade","./Scene/Appearance","./Scene/ArcGisMapServerImageryProvider","./Scene/BatchTable","./Scene/Billboard","./Scene/BillboardCollection","./Scene/BingMapsImageryProvider","./Scene/BingMapsStyle","./Scene/BlendEquation","./Scene/BlendFunction","./Scene/BlendingState","./Scene/BlendOption","./Scene/Camera","./Scene/CameraEventAggregator","./Scene/CameraEventType","./Scene/CameraFlightPath","./Scene/ColorBlendMode","./Scene/createOpenStreetMapImageryProvider","./Scene/createTangentSpaceDebugPrimitive","./Scene/createTileMapServiceImageryProvider","./Scene/CreditDisplay","./Scene/CullFace","./Scene/CullingVolume","./Scene/DebugAppearance","./Scene/DebugCameraPrimitive","./Scene/DebugModelMatrixPrimitive","./Scene/DepthFunction","./Scene/DepthPlane","./Scene/DeviceOrientationCameraController","./Scene/DiscardMissingTileImagePolicy","./Scene/EllipsoidPrimitive","./Scene/EllipsoidSurfaceAppearance","./Scene/Fog","./Scene/FrameRateMonitor","./Scene/FrameState","./Scene/FrustumCommands","./Scene/FXAA","./Scene/getAttributeOrUniformBySemantic","./Scene/getBinaryAccessor","./Scene/GetFeatureInfoFormat","./Scene/Globe","./Scene/GlobeDepth","./Scene/GlobeSurfaceShaderSet","./Scene/GlobeSurfaceTile","./Scene/GlobeSurfaceTileProvider","./Scene/GoogleEarthImageryProvider","./Scene/GridImageryProvider","./Scene/GroundPrimitive","./Scene/HeightReference","./Scene/HorizontalOrigin","./Scene/Imagery","./Scene/ImageryLayer","./Scene/ImageryLayerCollection","./Scene/ImageryLayerFeatureInfo","./Scene/ImageryProvider","./Scene/ImagerySplitDirection","./Scene/ImageryState","./Scene/Label","./Scene/LabelCollection","./Scene/LabelStyle","./Scene/MapboxImageryProvider","./Scene/MapMode2D","./Scene/Material","./Scene/MaterialAppearance","./Scene/Model","./Scene/ModelAnimation","./Scene/ModelAnimationCache","./Scene/ModelAnimationCollection","./Scene/ModelAnimationLoop","./Scene/ModelAnimationState","./Scene/ModelMaterial","./Scene/modelMaterialsCommon","./Scene/ModelMesh","./Scene/ModelNode","./Scene/Moon","./Scene/NeverTileDiscardPolicy","./Scene/OIT","./Scene/OrthographicFrustum","./Scene/PerformanceDisplay","./Scene/PerInstanceColorAppearance","./Scene/PerspectiveFrustum","./Scene/PerspectiveOffCenterFrustum","./Scene/PickDepth","./Scene/PointAppearance","./Scene/PointPrimitive","./Scene/PointPrimitiveCollection","./Scene/Polyline","./Scene/PolylineCollection","./Scene/PolylineColorAppearance","./Scene/PolylineMaterialAppearance","./Scene/Primitive","./Scene/PrimitiveCollection","./Scene/PrimitivePipeline","./Scene/PrimitiveState","./Scene/QuadtreeOccluders","./Scene/QuadtreePrimitive","./Scene/QuadtreeTile","./Scene/QuadtreeTileLoadState","./Scene/QuadtreeTileProvider","./Scene/Scene","./Scene/SceneMode","./Scene/SceneTransforms","./Scene/SceneTransitioner","./Scene/ScreenSpaceCameraController","./Scene/ShadowMap","./Scene/ShadowMapShader","./Scene/ShadowMode","./Scene/SingleTileImageryProvider","./Scene/SkyAtmosphere","./Scene/SkyBox","./Scene/StencilFunction","./Scene/StencilOperation","./Scene/Sun","./Scene/SunPostProcess","./Scene/TerrainState","./Scene/TextureAtlas","./Scene/TileBoundingBox","./Scene/TileCoordinatesImageryProvider","./Scene/TileDiscardPolicy","./Scene/TileImagery","./Scene/TileReplacementQueue","./Scene/TileState","./Scene/TileTerrain","./Scene/TweenCollection","./Scene/UrlTemplateImageryProvider","./Scene/VerticalOrigin","./Scene/ViewportQuad","./Scene/WebMapServiceImageryProvider","./Scene/WebMapTileServiceImageryProvider","./Shaders/AdjustTranslucentFS","./Shaders/Appearances/AllMaterialAppearanceFS","./Shaders/Appearances/AllMaterialAppearanceVS","./Shaders/Appearances/BasicMaterialAppearanceFS","./Shaders/Appearances/BasicMaterialAppearanceVS","./Shaders/Appearances/EllipsoidSurfaceAppearanceFS","./Shaders/Appearances/EllipsoidSurfaceAppearanceVS","./Shaders/Appearances/PerInstanceColorAppearanceFS","./Shaders/Appearances/PerInstanceColorAppearanceVS","./Shaders/Appearances/PerInstanceFlatColorAppearanceFS","./Shaders/Appearances/PerInstanceFlatColorAppearanceVS","./Shaders/Appearances/PointAppearanceFS","./Shaders/Appearances/PointAppearanceVS","./Shaders/Appearances/PolylineColorAppearanceVS","./Shaders/Appearances/PolylineMaterialAppearanceVS","./Shaders/Appearances/TexturedMaterialAppearanceFS","./Shaders/Appearances/TexturedMaterialAppearanceVS","./Shaders/BillboardCollectionFS","./Shaders/BillboardCollectionVS","./Shaders/Builtin/Constants/degreesPerRadian","./Shaders/Builtin/Constants/depthRange","./Shaders/Builtin/Constants/epsilon1","./Shaders/Builtin/Constants/epsilon2","./Shaders/Builtin/Constants/epsilon3","./Shaders/Builtin/Constants/epsilon4","./Shaders/Builtin/Constants/epsilon5","./Shaders/Builtin/Constants/epsilon6","./Shaders/Builtin/Constants/epsilon7","./Shaders/Builtin/Constants/infinity","./Shaders/Builtin/Constants/oneOverPi","./Shaders/Builtin/Constants/oneOverTwoPi","./Shaders/Builtin/Constants/passCompute","./Shaders/Builtin/Constants/passEnvironment","./Shaders/Builtin/Constants/passGlobe","./Shaders/Builtin/Constants/passGround","./Shaders/Builtin/Constants/passOpaque","./Shaders/Builtin/Constants/passOverlay","./Shaders/Builtin/Constants/passTranslucent","./Shaders/Builtin/Constants/pi","./Shaders/Builtin/Constants/piOverFour","./Shaders/Builtin/Constants/piOverSix","./Shaders/Builtin/Constants/piOverThree","./Shaders/Builtin/Constants/piOverTwo","./Shaders/Builtin/Constants/radiansPerDegree","./Shaders/Builtin/Constants/sceneMode2D","./Shaders/Builtin/Constants/sceneMode3D","./Shaders/Builtin/Constants/sceneModeColumbusView","./Shaders/Builtin/Constants/sceneModeMorphing","./Shaders/Builtin/Constants/solarRadius","./Shaders/Builtin/Constants/threePiOver2","./Shaders/Builtin/Constants/twoPi","./Shaders/Builtin/Constants/webMercatorMaxLatitude","./Shaders/Builtin/CzmBuiltins","./Shaders/Builtin/Functions/alphaWeight","./Shaders/Builtin/Functions/antialias","./Shaders/Builtin/Functions/cascadeColor","./Shaders/Builtin/Functions/cascadeDistance","./Shaders/Builtin/Functions/cascadeMatrix","./Shaders/Builtin/Functions/cascadeWeights","./Shaders/Builtin/Functions/columbusViewMorph","./Shaders/Builtin/Functions/computePosition","./Shaders/Builtin/Functions/cosineAndSine","./Shaders/Builtin/Functions/decompressTextureCoordinates","./Shaders/Builtin/Functions/eastNorthUpToEyeCoordinates","./Shaders/Builtin/Functions/ellipsoidContainsPoint","./Shaders/Builtin/Functions/ellipsoidNew","./Shaders/Builtin/Functions/ellipsoidWgs84TextureCoordinates","./Shaders/Builtin/Functions/equalsEpsilon","./Shaders/Builtin/Functions/eyeOffset","./Shaders/Builtin/Functions/eyeToWindowCoordinates","./Shaders/Builtin/Functions/fog","./Shaders/Builtin/Functions/geodeticSurfaceNormal","./Shaders/Builtin/Functions/getDefaultMaterial","./Shaders/Builtin/Functions/getLambertDiffuse","./Shaders/Builtin/Functions/getSpecular","./Shaders/Builtin/Functions/getWaterNoise","./Shaders/Builtin/Functions/getWgs84EllipsoidEC","./Shaders/Builtin/Functions/hue","./Shaders/Builtin/Functions/isEmpty","./Shaders/Builtin/Functions/isFull","./Shaders/Builtin/Functions/latitudeToWebMercatorFraction","./Shaders/Builtin/Functions/luminance","./Shaders/Builtin/Functions/metersPerPixel","./Shaders/Builtin/Functions/modelToWindowCoordinates","./Shaders/Builtin/Functions/multiplyWithColorBalance","./Shaders/Builtin/Functions/nearFarScalar","./Shaders/Builtin/Functions/octDecode","./Shaders/Builtin/Functions/packDepth","./Shaders/Builtin/Functions/phong","./Shaders/Builtin/Functions/pointAlongRay","./Shaders/Builtin/Functions/rayEllipsoidIntersectionInterval","./Shaders/Builtin/Functions/RGBToXYZ","./Shaders/Builtin/Functions/saturation","./Shaders/Builtin/Functions/shadowDepthCompare","./Shaders/Builtin/Functions/shadowVisibility","./Shaders/Builtin/Functions/signNotZero","./Shaders/Builtin/Functions/tangentToEyeSpaceMatrix","./Shaders/Builtin/Functions/translateRelativeToEye","./Shaders/Builtin/Functions/translucentPhong","./Shaders/Builtin/Functions/transpose","./Shaders/Builtin/Functions/unpackDepth","./Shaders/Builtin/Functions/windowToEyeCoordinates","./Shaders/Builtin/Functions/XYZToRGB","./Shaders/Builtin/Structs/depthRangeStruct","./Shaders/Builtin/Structs/ellipsoid","./Shaders/Builtin/Structs/material","./Shaders/Builtin/Structs/materialInput","./Shaders/Builtin/Structs/ray","./Shaders/Builtin/Structs/raySegment","./Shaders/Builtin/Structs/shadowParameters","./Shaders/CompositeOITFS","./Shaders/DepthPlaneFS","./Shaders/DepthPlaneVS","./Shaders/EllipsoidFS","./Shaders/EllipsoidVS","./Shaders/GlobeFS","./Shaders/GlobeVS","./Shaders/GroundAtmosphere","./Shaders/Materials/BumpMapMaterial","./Shaders/Materials/CheckerboardMaterial","./Shaders/Materials/DotMaterial","./Shaders/Materials/FadeMaterial","./Shaders/Materials/GridMaterial","./Shaders/Materials/NormalMapMaterial","./Shaders/Materials/PolylineArrowMaterial","./Shaders/Materials/PolylineGlowMaterial","./Shaders/Materials/PolylineOutlineMaterial","./Shaders/Materials/RimLightingMaterial","./Shaders/Materials/StripeMaterial","./Shaders/Materials/Water","./Shaders/PointPrimitiveCollectionFS","./Shaders/PointPrimitiveCollectionVS","./Shaders/PolylineCommon","./Shaders/PolylineFS","./Shaders/PolylineVS","./Shaders/PostProcessFilters/AdditiveBlend","./Shaders/PostProcessFilters/BrightPass","./Shaders/PostProcessFilters/FXAA","./Shaders/PostProcessFilters/GaussianBlur1D","./Shaders/PostProcessFilters/PassThrough","./Shaders/ReprojectWebMercatorFS","./Shaders/ReprojectWebMercatorVS","./Shaders/ShadowVolumeFS","./Shaders/ShadowVolumeVS","./Shaders/SkyAtmosphereFS","./Shaders/SkyAtmosphereVS","./Shaders/SkyBoxFS","./Shaders/SkyBoxVS","./Shaders/SunFS","./Shaders/SunTextureFS","./Shaders/SunVS","./Shaders/ViewportQuadFS","./Shaders/ViewportQuadVS","./ThirdParty/Autolinker","./ThirdParty/earcut-2.1.1","./ThirdParty/gltfDefaults","./ThirdParty/kdbush","./ThirdParty/knockout-3.4.0","./ThirdParty/knockout-es5","./ThirdParty/knockout","./ThirdParty/measureText","./ThirdParty/mersenne-twister","./ThirdParty/NoSleep","./ThirdParty/sprintf","./ThirdParty/topojson","./ThirdParty/Tween","./ThirdParty/Uri","./ThirdParty/when","./ThirdParty/zip","./Widgets/Animation/Animation","./Widgets/Animation/AnimationViewModel","./Widgets/BaseLayerPicker/BaseLayerPicker","./Widgets/BaseLayerPicker/BaseLayerPickerViewModel","./Widgets/BaseLayerPicker/createDefaultImageryProviderViewModels","./Widgets/BaseLayerPicker/createDefaultTerrainProviderViewModels","./Widgets/BaseLayerPicker/ProviderViewModel","./Widgets/CesiumInspector/CesiumInspector","./Widgets/CesiumInspector/CesiumInspectorViewModel","./Widgets/CesiumWidget/CesiumWidget","./Widgets/ClockViewModel","./Widgets/Command","./Widgets/createCommand","./Widgets/FullscreenButton/FullscreenButton","./Widgets/FullscreenButton/FullscreenButtonViewModel","./Widgets/Geocoder/Geocoder","./Widgets/Geocoder/GeocoderViewModel","./Widgets/getElement","./Widgets/HomeButton/HomeButton","./Widgets/HomeButton/HomeButtonViewModel","./Widgets/InfoBox/InfoBox","./Widgets/InfoBox/InfoBoxViewModel","./Widgets/NavigationHelpButton/NavigationHelpButton","./Widgets/NavigationHelpButton/NavigationHelpButtonViewModel","./Widgets/PerformanceWatchdog/PerformanceWatchdog","./Widgets/PerformanceWatchdog/PerformanceWatchdogViewModel","./Widgets/SceneModePicker/SceneModePicker","./Widgets/SceneModePicker/SceneModePickerViewModel","./Widgets/SelectionIndicator/SelectionIndicator","./Widgets/SelectionIndicator/SelectionIndicatorViewModel","./Widgets/subscribeAndEvaluate","./Widgets/SvgPathBindingHandler","./Widgets/Timeline/Timeline","./Widgets/Timeline/TimelineHighlightRange","./Widgets/Timeline/TimelineTrack","./Widgets/ToggleButtonViewModel","./Widgets/Viewer/Viewer","./Widgets/Viewer/viewerCesiumInspectorMixin","./Widgets/Viewer/viewerDragDropMixin","./Widgets/Viewer/viewerPerformanceWatchdogMixin","./Widgets/VRButton/VRButton","./Widgets/VRButton/VRButtonViewModel","./Workers/createTaskProcessorWorker"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I,R,O,N,L,B,F,V,k,z,U,G,W,H,q,j,Y,X,Z,K,Q,J,$,ee,te,ie,re,ne,oe,ae,se,le,ue,ce,he,de,pe,me,fe,_e,ge,ve,ye,Ce,we,Se,Ee,be,Te,xe,Ae,Pe,De,Me,Ie,Re,Oe,Ne,Le,Be,Fe,Ve,ke,ze,Ue,Ge,We,He,qe,je,Ye,Xe,Ze,Ke,Qe,Je,$e,et,tt,it,rt,nt,ot,at,st,lt,ut,ct,ht,dt,pt,mt,ft,_t,gt,vt,yt,Ct,wt,St,Et,bt,Tt,xt,At,Pt,Dt,Mt,It,Rt,Ot,Nt,Lt,Bt,Ft,Vt,kt,zt,Ut,Gt,Wt,Ht,qt,jt,Yt,Xt,Zt,Kt,Qt,Jt,$t,ei,ti,ii,ri,ni,oi,ai,si,li,ui,ci,hi,di,pi,mi,fi,_i,gi,vi,yi,Ci,wi,Si,Ei,bi,Ti,xi,Ai,Pi,Di,Mi,Ii,Ri,Oi,Ni,Li,Bi,Fi,Vi,ki,zi,Ui,Gi,Wi,Hi,qi,ji,Yi,Xi,Zi,Ki,Qi,Ji,$i,er,tr,ir,rr,nr,or,ar,sr,lr,ur,cr,hr,dr,pr,mr,fr,_r,gr,vr,yr,Cr,wr,Sr,Er,br,Tr,xr,Ar,Pr,Dr,Mr,Ir,Rr,Or,Nr,Lr,Br,Fr,Vr,kr,zr,Ur,Gr,Wr,Hr,qr,jr,Yr,Xr,Zr,Kr,Qr,Jr,$r,en,tn,rn,nn,on,an,sn,ln,un,cn,hn,dn,pn,mn,fn,_n,gn,vn,yn,Cn,wn,Sn,En,bn,Tn,xn,An,Pn,Dn,Mn,In,Rn,On,Nn,Ln,Bn,Fn,Vn,kn,zn,Un,Gn,Wn,Hn,qn,jn,Yn,Xn,Zn,Kn,Qn,Jn,$n,eo,to,io,ro,no,oo,ao,so,lo,uo,co,ho,po,mo,fo,_o,go,vo,yo,Co,wo,So,Eo,bo,To,xo,Ao,Po,Do,Mo,Io,Ro,Oo,No,Lo,Bo,Fo,Vo,ko,zo,Uo,Go,Wo,Ho,qo,jo,Yo,Xo,Zo,Ko,Qo,Jo,$o,ea,ta,ia,ra,na,oa,aa,sa,la,ua,ca,ha,da,pa,ma,fa,_a,ga,va,ya,Ca,wa,Sa,Ea,ba,Ta,xa,Aa,Pa,Da,Ma,Ia,Ra,Oa,Na,La,Ba,Fa,Va,ka,za,Ua,Ga,Wa,Ha,qa,ja,Ya,Xa,Za,Ka,Qa,Ja,$a,es,ts,is,rs,ns,os,as,ss,ls,us,cs,hs,ds,ps,ms,fs,_s,gs,vs,ys,Cs,ws,Ss,Es,bs,Ts,xs,As,Ps,Ds,Ms,Is,Rs,Os,Ns,Ls,Bs,Fs,Vs,ks,zs,Us,Gs,Ws,Hs,qs,js,Ys,Xs,Zs,Ks,Qs,Js,$s,el,tl,il,rl,nl,ol,al,sl,ll,ul,cl,hl,dl,pl,ml,fl,_l,gl,vl,yl,Cl,wl,Sl,El,bl,Tl,xl,Al,Pl,Dl,Ml,Il,Rl,Ol,Nl,Ll,Bl,Fl,Vl,kl,zl,Ul,Gl,Wl,Hl,ql,jl,Yl,Xl,Zl,Kl,Ql,Jl,$l,eu,tu,iu,ru,nu,ou,au,su,lu,uu,cu,hu,du,pu,mu,fu,_u,gu,vu,yu,Cu,wu,Su,Eu,bu,Tu,xu,Au,Pu,Du,Mu,Iu,Ru,Ou,Nu,Lu,Bu,Fu,Vu,ku,zu,Uu,Gu,Wu,Hu,qu,ju,Yu,Xu,Zu,Ku,Qu,Ju,$u,ec,tc,ic,rc,nc,oc,ac,sc,lc,uc,cc,hc,dc,pc,mc,fc,_c,gc,vc,yc,Cc,wc,Sc,Ec,bc,Tc,xc,Ac,Pc,Dc,Mc,Ic,Rc,Oc,Nc,Lc,Bc,Fc,Vc,kc,zc,Uc,Gc,Wc,Hc,qc,jc,Yc,Xc,Zc,Kc,Qc,Jc,$c,eh,th,ih,rh,nh,oh,ah,sh,lh,uh,ch,hh,dh,ph,mh,fh,_h,gh,vh,yh,Ch,wh,Sh,Eh,bh,Th,xh,Ah,Ph,Dh,Mh,Ih,Rh,Oh,Nh,Lh,Bh,Fh){ +"use strict";var Vh={VERSION:"1.30",_shaders:{}};return Vh.appendForwardSlash=e,Vh.ArcGisImageServerTerrainProvider=t,Vh.arrayRemoveDuplicates=i,Vh.AssociativeArray=r,Vh.AttributeCompression=n,Vh.AxisAlignedBoundingBox=o,Vh.barycentricCoordinates=a,Vh.binarySearch=s,Vh.BingMapsApi=l,Vh.BingMapsGeocoderService=u,Vh.BoundingRectangle=c,Vh.BoundingSphere=h,Vh.BoxGeometry=d,Vh.BoxOutlineGeometry=p,Vh.buildModuleUrl=m,Vh.cancelAnimationFrame=f,Vh.Cartesian2=_,Vh.Cartesian3=g,Vh.Cartesian4=v,Vh.Cartographic=y,Vh.CartographicGeocoderService=C,Vh.CatmullRomSpline=w,Vh.CesiumTerrainProvider=S,Vh.Check=E,Vh.CircleGeometry=b,Vh.CircleOutlineGeometry=T,Vh.Clock=x,Vh.ClockRange=A,Vh.ClockStep=P,Vh.clone=D,Vh.Color=M,Vh.ColorGeometryInstanceAttribute=I,Vh.combine=R,Vh.ComponentDatatype=O,Vh.CornerType=N,Vh.CorridorGeometry=L,Vh.CorridorGeometryLibrary=B,Vh.CorridorOutlineGeometry=F,Vh.createGuid=V,Vh.Credit=k,Vh.CubicRealPolynomial=z,Vh.CylinderGeometry=U,Vh.CylinderGeometryLibrary=G,Vh.CylinderOutlineGeometry=W,Vh.DefaultProxy=H,Vh.defaultValue=q,Vh.defined=j,Vh.defineProperties=Y,Vh.deprecationWarning=X,Vh.destroyObject=Z,Vh.DeveloperError=K,Vh.DistanceDisplayCondition=Q,Vh.DistanceDisplayConditionGeometryInstanceAttribute=J,Vh.EarthOrientationParameters=$,Vh.EarthOrientationParametersSample=ee,Vh.EasingFunction=te,Vh.EllipseGeometry=ie,Vh.EllipseGeometryLibrary=re,Vh.EllipseOutlineGeometry=ne,Vh.Ellipsoid=oe,Vh.EllipsoidalOccluder=ae,Vh.EllipsoidGeodesic=se,Vh.EllipsoidGeometry=le,Vh.EllipsoidOutlineGeometry=ue,Vh.EllipsoidTangentPlane=ce,Vh.EllipsoidTerrainProvider=he,Vh.EncodedCartesian3=de,Vh.Event=pe,Vh.EventHelper=me,Vh.ExtrapolationType=fe,Vh.FeatureDetection=_e,Vh.formatError=ge,Vh.freezeObject=ve,Vh.Fullscreen=ye,Vh.GeocoderService=Ce,Vh.GeographicProjection=we,Vh.GeographicTilingScheme=Se,Vh.Geometry=Ee,Vh.GeometryAttribute=be,Vh.GeometryAttributes=Te,Vh.GeometryInstance=xe,Vh.GeometryInstanceAttribute=Ae,Vh.GeometryPipeline=Pe,Vh.GeometryType=De,Vh.getAbsoluteUri=Me,Vh.getBaseUri=Ie,Vh.getExtensionFromUri=Re,Vh.getFilenameFromUri=Oe,Vh.getImagePixels=Ne,Vh.getMagic=Le,Vh.getStringFromTypedArray=Be,Vh.getTimestamp=Fe,Vh.GregorianDate=Ve,Vh.HeadingPitchRange=ke,Vh.HeadingPitchRoll=ze,Vh.HeightmapTerrainData=Ue,Vh.HeightmapTessellator=Ge,Vh.HermitePolynomialApproximation=We,Vh.HermiteSpline=He,Vh.Iau2000Orientation=qe,Vh.Iau2006XysData=je,Vh.Iau2006XysSample=Ye,Vh.IauOrientationAxes=Xe,Vh.IauOrientationParameters=Ze,Vh.IndexDatatype=Ke,Vh.InterpolationAlgorithm=Qe,Vh.Intersect=Je,Vh.Intersections2D=$e,Vh.IntersectionTests=et,Vh.Interval=tt,Vh.isArray=it,Vh.isCrossOriginUrl=rt,Vh.isLeapYear=nt,Vh.Iso8601=ot,Vh.joinUrls=at,Vh.JulianDate=st,Vh.KeyboardEventModifier=lt,Vh.LagrangePolynomialApproximation=ut,Vh.LeapSecond=ct,Vh.LinearApproximation=ht,Vh.LinearSpline=dt,Vh.loadArrayBuffer=pt,Vh.loadBlob=mt,Vh.loadImage=ft,Vh.loadImageFromTypedArray=_t,Vh.loadImageViaBlob=gt,Vh.loadJson=vt,Vh.loadJsonp=yt,Vh.loadText=Ct,Vh.loadWithXhr=wt,Vh.loadXML=St,Vh.MapboxApi=Et,Vh.MapProjection=bt,Vh.Math=Tt,Vh.Matrix2=xt,Vh.Matrix3=At,Vh.Matrix4=Pt,Vh.mergeSort=Dt,Vh.NearFarScalar=Mt,Vh.objectToQuery=It,Vh.Occluder=Rt,Vh.oneTimeWarning=Ot,Vh.OrientedBoundingBox=Nt,Vh.Packable=Lt,Vh.PackableForInterpolation=Bt,Vh.parseResponseHeaders=Ft,Vh.PinBuilder=Vt,Vh.PixelFormat=kt,Vh.Plane=zt,Vh.PointGeometry=Ut,Vh.pointInsideTriangle=Gt,Vh.PolygonGeometry=Wt,Vh.PolygonGeometryLibrary=Ht,Vh.PolygonHierarchy=qt,Vh.PolygonOutlineGeometry=jt,Vh.PolygonPipeline=Yt,Vh.PolylineGeometry=Xt,Vh.PolylinePipeline=Zt,Vh.PolylineVolumeGeometry=Kt,Vh.PolylineVolumeGeometryLibrary=Qt,Vh.PolylineVolumeOutlineGeometry=Jt,Vh.PrimitiveType=$t,Vh.QuadraticRealPolynomial=ei,Vh.QuantizedMeshTerrainData=ti,Vh.QuarticRealPolynomial=ii,Vh.Quaternion=ri,Vh.QuaternionSpline=ni,Vh.queryToObject=oi,Vh.Queue=ai,Vh.Ray=si,Vh.Rectangle=li,Vh.RectangleGeometry=ui,Vh.RectangleGeometryLibrary=ci,Vh.RectangleOutlineGeometry=hi,Vh.ReferenceFrame=di,Vh.requestAnimationFrame=pi,Vh.RequestErrorEvent=mi,Vh.RuntimeError=fi,Vh.sampleTerrain=_i,Vh.sampleTerrainMostDetailed=gi,Vh.scaleToGeodeticSurface=vi,Vh.ScreenSpaceEventHandler=yi,Vh.ScreenSpaceEventType=Ci,Vh.ShowGeometryInstanceAttribute=wi,Vh.Simon1994PlanetaryPositions=Si,Vh.SimplePolylineGeometry=Ei,Vh.SphereGeometry=bi,Vh.SphereOutlineGeometry=Ti,Vh.Spherical=xi,Vh.Spline=Ai,Vh.subdivideArray=Pi,Vh.TaskProcessor=Di,Vh.TerrainData=Mi,Vh.TerrainEncoding=Ii,Vh.TerrainMesh=Ri,Vh.TerrainProvider=Oi,Vh.TerrainQuantization=Ni,Vh.throttleRequestByServer=Li,Vh.TileAvailability=Bi,Vh.TileProviderError=Fi,Vh.TilingScheme=Vi,Vh.TimeConstants=ki,Vh.TimeInterval=zi,Vh.TimeIntervalCollection=Ui,Vh.TimeStandard=Gi,Vh.Tipsify=Wi,Vh.Transforms=Hi,Vh.TranslationRotationScale=qi,Vh.TridiagonalSystemSolver=ji,Vh.TrustedServers=Yi,Vh.VertexFormat=Xi,Vh.VideoSynchronizer=Zi,Vh.Visibility=Ki,Vh.VRTheWorldTerrainProvider=Qi,Vh.WallGeometry=Ji,Vh.WallGeometryLibrary=$i,Vh.WallOutlineGeometry=er,Vh.WebGLConstants=tr,Vh.WebMercatorProjection=ir,Vh.WebMercatorTilingScheme=rr,Vh.WindingOrder=nr,Vh.wrapFunction=or,Vh.writeTextToCanvas=ar,Vh.BillboardGraphics=sr,Vh.BillboardVisualizer=lr,Vh.BoundingSphereState=ur,Vh.BoxGeometryUpdater=cr,Vh.BoxGraphics=hr,Vh.CallbackProperty=dr,Vh.CheckerboardMaterialProperty=pr,Vh.ColorMaterialProperty=mr,Vh.CompositeEntityCollection=fr,Vh.CompositeMaterialProperty=_r,Vh.CompositePositionProperty=gr,Vh.CompositeProperty=vr,Vh.ConstantPositionProperty=yr,Vh.ConstantProperty=Cr,Vh.CorridorGeometryUpdater=wr,Vh.CorridorGraphics=Sr,Vh.createMaterialPropertyDescriptor=Er,Vh.createPropertyDescriptor=br,Vh.createRawPropertyDescriptor=Tr,Vh.CustomDataSource=xr,Vh.CylinderGeometryUpdater=Ar,Vh.CylinderGraphics=Pr,Vh.CzmlDataSource=Dr,Vh.DataSource=Mr,Vh.DataSourceClock=Ir,Vh.DataSourceCollection=Rr,Vh.DataSourceDisplay=Or,Vh.dynamicGeometryGetBoundingSphere=Nr,Vh.DynamicGeometryUpdater=Lr,Vh.EllipseGeometryUpdater=Br,Vh.EllipseGraphics=Fr,Vh.EllipsoidGeometryUpdater=Vr,Vh.EllipsoidGraphics=kr,Vh.Entity=zr,Vh.EntityCluster=Ur,Vh.EntityCollection=Gr,Vh.EntityView=Wr,Vh.GeoJsonDataSource=Hr,Vh.GeometryUpdater=qr,Vh.GeometryVisualizer=jr,Vh.GridMaterialProperty=Yr,Vh.ImageMaterialProperty=Xr,Vh.KmlDataSource=Zr,Vh.LabelGraphics=Kr,Vh.LabelVisualizer=Qr,Vh.MaterialProperty=Jr,Vh.ModelGraphics=$r,Vh.ModelVisualizer=en,Vh.NodeTransformationProperty=tn,Vh.PathGraphics=rn,Vh.PathVisualizer=nn,Vh.PointGraphics=on,Vh.PointVisualizer=an,Vh.PolygonGeometryUpdater=sn,Vh.PolygonGraphics=ln,Vh.PolylineArrowMaterialProperty=un,Vh.PolylineGeometryUpdater=cn,Vh.PolylineGlowMaterialProperty=hn,Vh.PolylineGraphics=dn,Vh.PolylineOutlineMaterialProperty=pn,Vh.PolylineVolumeGeometryUpdater=mn,Vh.PolylineVolumeGraphics=fn,Vh.PositionProperty=_n,Vh.PositionPropertyArray=gn,Vh.Property=vn,Vh.PropertyArray=yn,Vh.PropertyBag=Cn,Vh.RectangleGeometryUpdater=wn,Vh.RectangleGraphics=Sn,Vh.ReferenceProperty=En,Vh.Rotation=bn,Vh.SampledPositionProperty=Tn,Vh.SampledProperty=xn,Vh.ScaledPositionProperty=An,Vh.StaticGeometryColorBatch=Pn,Vh.StaticGeometryPerMaterialBatch=Dn,Vh.StaticGroundGeometryColorBatch=Mn,Vh.StaticOutlineGeometryBatch=In,Vh.StripeMaterialProperty=Rn,Vh.StripeOrientation=On,Vh.TimeIntervalCollectionPositionProperty=Nn,Vh.TimeIntervalCollectionProperty=Ln,Vh.VelocityOrientationProperty=Bn,Vh.VelocityVectorProperty=Fn,Vh.Visualizer=Vn,Vh.WallGeometryUpdater=kn,Vh.WallGraphics=zn,Vh.AutomaticUniforms=Un,Vh.Buffer=Gn,Vh.BufferUsage=Wn,Vh.ClearCommand=Hn,Vh.ComputeCommand=qn,Vh.ComputeEngine=jn,Vh.Context=Yn,Vh.ContextLimits=Xn,Vh.createUniform=Zn,Vh.createUniformArray=Kn,Vh.CubeMap=Qn,Vh.CubeMapFace=Jn,Vh.DrawCommand=$n,Vh.Framebuffer=eo,Vh.loadCubeMap=to,Vh.MipmapHint=io,Vh.Pass=ro,Vh.PassState=no,Vh.PickFramebuffer=oo,Vh.PixelDatatype=ao,Vh.Renderbuffer=so,Vh.RenderbufferFormat=lo,Vh.RenderState=uo,Vh.Sampler=co,Vh.ShaderCache=ho,Vh.ShaderProgram=po,Vh.ShaderSource=mo,Vh.Texture=fo,Vh.TextureMagnificationFilter=_o,Vh.TextureMinificationFilter=go,Vh.TextureWrap=vo,Vh.UniformState=yo,Vh.VertexArray=Co,Vh.VertexArrayFacade=wo,Vh.Appearance=So,Vh.ArcGisMapServerImageryProvider=Eo,Vh.BatchTable=bo,Vh.Billboard=To,Vh.BillboardCollection=xo,Vh.BingMapsImageryProvider=Ao,Vh.BingMapsStyle=Po,Vh.BlendEquation=Do,Vh.BlendFunction=Mo,Vh.BlendingState=Io,Vh.BlendOption=Ro,Vh.Camera=Oo,Vh.CameraEventAggregator=No,Vh.CameraEventType=Lo,Vh.CameraFlightPath=Bo,Vh.ColorBlendMode=Fo,Vh.createOpenStreetMapImageryProvider=Vo,Vh.createTangentSpaceDebugPrimitive=ko,Vh.createTileMapServiceImageryProvider=zo,Vh.CreditDisplay=Uo,Vh.CullFace=Go,Vh.CullingVolume=Wo,Vh.DebugAppearance=Ho,Vh.DebugCameraPrimitive=qo,Vh.DebugModelMatrixPrimitive=jo,Vh.DepthFunction=Yo,Vh.DepthPlane=Xo,Vh.DeviceOrientationCameraController=Zo,Vh.DiscardMissingTileImagePolicy=Ko,Vh.EllipsoidPrimitive=Qo,Vh.EllipsoidSurfaceAppearance=Jo,Vh.Fog=$o,Vh.FrameRateMonitor=ea,Vh.FrameState=ta,Vh.FrustumCommands=ia,Vh.FXAA=ra,Vh.getAttributeOrUniformBySemantic=na,Vh.getBinaryAccessor=oa,Vh.GetFeatureInfoFormat=aa,Vh.Globe=sa,Vh.GlobeDepth=la,Vh.GlobeSurfaceShaderSet=ua,Vh.GlobeSurfaceTile=ca,Vh.GlobeSurfaceTileProvider=ha,Vh.GoogleEarthImageryProvider=da,Vh.GridImageryProvider=pa,Vh.GroundPrimitive=ma,Vh.HeightReference=fa,Vh.HorizontalOrigin=_a,Vh.Imagery=ga,Vh.ImageryLayer=va,Vh.ImageryLayerCollection=ya,Vh.ImageryLayerFeatureInfo=Ca,Vh.ImageryProvider=wa,Vh.ImagerySplitDirection=Sa,Vh.ImageryState=Ea,Vh.Label=ba,Vh.LabelCollection=Ta,Vh.LabelStyle=xa,Vh.MapboxImageryProvider=Aa,Vh.MapMode2D=Pa,Vh.Material=Da,Vh.MaterialAppearance=Ma,Vh.Model=Ia,Vh.ModelAnimation=Ra,Vh.ModelAnimationCache=Oa,Vh.ModelAnimationCollection=Na,Vh.ModelAnimationLoop=La,Vh.ModelAnimationState=Ba,Vh.ModelMaterial=Fa,Vh.modelMaterialsCommon=Va,Vh.ModelMesh=ka,Vh.ModelNode=za,Vh.Moon=Ua,Vh.NeverTileDiscardPolicy=Ga,Vh.OIT=Wa,Vh.OrthographicFrustum=Ha,Vh.PerformanceDisplay=qa,Vh.PerInstanceColorAppearance=ja,Vh.PerspectiveFrustum=Ya,Vh.PerspectiveOffCenterFrustum=Xa,Vh.PickDepth=Za,Vh.PointAppearance=Ka,Vh.PointPrimitive=Qa,Vh.PointPrimitiveCollection=Ja,Vh.Polyline=$a,Vh.PolylineCollection=es,Vh.PolylineColorAppearance=ts,Vh.PolylineMaterialAppearance=is,Vh.Primitive=rs,Vh.PrimitiveCollection=ns,Vh.PrimitivePipeline=os,Vh.PrimitiveState=as,Vh.QuadtreeOccluders=ss,Vh.QuadtreePrimitive=ls,Vh.QuadtreeTile=us,Vh.QuadtreeTileLoadState=cs,Vh.QuadtreeTileProvider=hs,Vh.Scene=ds,Vh.SceneMode=ps,Vh.SceneTransforms=ms,Vh.SceneTransitioner=fs,Vh.ScreenSpaceCameraController=_s,Vh.ShadowMap=gs,Vh.ShadowMapShader=vs,Vh.ShadowMode=ys,Vh.SingleTileImageryProvider=Cs,Vh.SkyAtmosphere=ws,Vh.SkyBox=Ss,Vh.StencilFunction=Es,Vh.StencilOperation=bs,Vh.Sun=Ts,Vh.SunPostProcess=xs,Vh.TerrainState=As,Vh.TextureAtlas=Ps,Vh.TileBoundingBox=Ds,Vh.TileCoordinatesImageryProvider=Ms,Vh.TileDiscardPolicy=Is,Vh.TileImagery=Rs,Vh.TileReplacementQueue=Os,Vh.TileState=Ns,Vh.TileTerrain=Ls,Vh.TweenCollection=Bs,Vh.UrlTemplateImageryProvider=Fs,Vh.VerticalOrigin=Vs,Vh.ViewportQuad=ks,Vh.WebMapServiceImageryProvider=zs,Vh.WebMapTileServiceImageryProvider=Us,Vh._shaders.AdjustTranslucentFS=Gs,Vh._shaders.AllMaterialAppearanceFS=Ws,Vh._shaders.AllMaterialAppearanceVS=Hs,Vh._shaders.BasicMaterialAppearanceFS=qs,Vh._shaders.BasicMaterialAppearanceVS=js,Vh._shaders.EllipsoidSurfaceAppearanceFS=Ys,Vh._shaders.EllipsoidSurfaceAppearanceVS=Xs,Vh._shaders.PerInstanceColorAppearanceFS=Zs,Vh._shaders.PerInstanceColorAppearanceVS=Ks,Vh._shaders.PerInstanceFlatColorAppearanceFS=Qs,Vh._shaders.PerInstanceFlatColorAppearanceVS=Js,Vh._shaders.PointAppearanceFS=$s,Vh._shaders.PointAppearanceVS=el,Vh._shaders.PolylineColorAppearanceVS=tl,Vh._shaders.PolylineMaterialAppearanceVS=il,Vh._shaders.TexturedMaterialAppearanceFS=rl,Vh._shaders.TexturedMaterialAppearanceVS=nl,Vh._shaders.BillboardCollectionFS=ol,Vh._shaders.BillboardCollectionVS=al,Vh._shaders.degreesPerRadian=sl,Vh._shaders.depthRange=ll,Vh._shaders.epsilon1=ul,Vh._shaders.epsilon2=cl,Vh._shaders.epsilon3=hl,Vh._shaders.epsilon4=dl,Vh._shaders.epsilon5=pl,Vh._shaders.epsilon6=ml,Vh._shaders.epsilon7=fl,Vh._shaders.infinity=_l,Vh._shaders.oneOverPi=gl,Vh._shaders.oneOverTwoPi=vl,Vh._shaders.passCompute=yl,Vh._shaders.passEnvironment=Cl,Vh._shaders.passGlobe=wl,Vh._shaders.passGround=Sl,Vh._shaders.passOpaque=El,Vh._shaders.passOverlay=bl,Vh._shaders.passTranslucent=Tl,Vh._shaders.pi=xl,Vh._shaders.piOverFour=Al,Vh._shaders.piOverSix=Pl,Vh._shaders.piOverThree=Dl,Vh._shaders.piOverTwo=Ml,Vh._shaders.radiansPerDegree=Il,Vh._shaders.sceneMode2D=Rl,Vh._shaders.sceneMode3D=Ol,Vh._shaders.sceneModeColumbusView=Nl,Vh._shaders.sceneModeMorphing=Ll,Vh._shaders.solarRadius=Bl,Vh._shaders.threePiOver2=Fl,Vh._shaders.twoPi=Vl,Vh._shaders.webMercatorMaxLatitude=kl,Vh._shaders.CzmBuiltins=zl,Vh._shaders.alphaWeight=Ul,Vh._shaders.antialias=Gl,Vh._shaders.cascadeColor=Wl,Vh._shaders.cascadeDistance=Hl,Vh._shaders.cascadeMatrix=ql,Vh._shaders.cascadeWeights=jl,Vh._shaders.columbusViewMorph=Yl,Vh._shaders.computePosition=Xl,Vh._shaders.cosineAndSine=Zl,Vh._shaders.decompressTextureCoordinates=Kl,Vh._shaders.eastNorthUpToEyeCoordinates=Ql,Vh._shaders.ellipsoidContainsPoint=Jl,Vh._shaders.ellipsoidNew=$l,Vh._shaders.ellipsoidWgs84TextureCoordinates=eu,Vh._shaders.equalsEpsilon=tu,Vh._shaders.eyeOffset=iu,Vh._shaders.eyeToWindowCoordinates=ru,Vh._shaders.fog=nu,Vh._shaders.geodeticSurfaceNormal=ou,Vh._shaders.getDefaultMaterial=au,Vh._shaders.getLambertDiffuse=su,Vh._shaders.getSpecular=lu,Vh._shaders.getWaterNoise=uu,Vh._shaders.getWgs84EllipsoidEC=cu,Vh._shaders.hue=hu,Vh._shaders.isEmpty=du,Vh._shaders.isFull=pu,Vh._shaders.latitudeToWebMercatorFraction=mu,Vh._shaders.luminance=fu,Vh._shaders.metersPerPixel=_u,Vh._shaders.modelToWindowCoordinates=gu,Vh._shaders.multiplyWithColorBalance=vu,Vh._shaders.nearFarScalar=yu,Vh._shaders.octDecode=Cu,Vh._shaders.packDepth=wu,Vh._shaders.phong=Su,Vh._shaders.pointAlongRay=Eu,Vh._shaders.rayEllipsoidIntersectionInterval=bu,Vh._shaders.RGBToXYZ=Tu,Vh._shaders.saturation=xu,Vh._shaders.shadowDepthCompare=Au,Vh._shaders.shadowVisibility=Pu,Vh._shaders.signNotZero=Du,Vh._shaders.tangentToEyeSpaceMatrix=Mu,Vh._shaders.translateRelativeToEye=Iu,Vh._shaders.translucentPhong=Ru,Vh._shaders.transpose=Ou,Vh._shaders.unpackDepth=Nu,Vh._shaders.windowToEyeCoordinates=Lu,Vh._shaders.XYZToRGB=Bu,Vh._shaders.depthRangeStruct=Fu,Vh._shaders.ellipsoid=Vu,Vh._shaders.material=ku,Vh._shaders.materialInput=zu,Vh._shaders.ray=Uu,Vh._shaders.raySegment=Gu,Vh._shaders.shadowParameters=Wu,Vh._shaders.CompositeOITFS=Hu,Vh._shaders.DepthPlaneFS=qu,Vh._shaders.DepthPlaneVS=ju,Vh._shaders.EllipsoidFS=Yu,Vh._shaders.EllipsoidVS=Xu,Vh._shaders.GlobeFS=Zu,Vh._shaders.GlobeVS=Ku,Vh._shaders.GroundAtmosphere=Qu,Vh._shaders.BumpMapMaterial=Ju,Vh._shaders.CheckerboardMaterial=$u,Vh._shaders.DotMaterial=ec,Vh._shaders.FadeMaterial=tc,Vh._shaders.GridMaterial=ic,Vh._shaders.NormalMapMaterial=rc,Vh._shaders.PolylineArrowMaterial=nc,Vh._shaders.PolylineGlowMaterial=oc,Vh._shaders.PolylineOutlineMaterial=ac,Vh._shaders.RimLightingMaterial=sc,Vh._shaders.StripeMaterial=lc,Vh._shaders.Water=uc,Vh._shaders.PointPrimitiveCollectionFS=cc,Vh._shaders.PointPrimitiveCollectionVS=hc,Vh._shaders.PolylineCommon=dc,Vh._shaders.PolylineFS=pc,Vh._shaders.PolylineVS=mc,Vh._shaders.AdditiveBlend=fc,Vh._shaders.BrightPass=_c,Vh._shaders.FXAA=gc,Vh._shaders.GaussianBlur1D=vc,Vh._shaders.PassThrough=yc,Vh._shaders.ReprojectWebMercatorFS=Cc,Vh._shaders.ReprojectWebMercatorVS=wc,Vh._shaders.ShadowVolumeFS=Sc,Vh._shaders.ShadowVolumeVS=Ec,Vh._shaders.SkyAtmosphereFS=bc,Vh._shaders.SkyAtmosphereVS=Tc,Vh._shaders.SkyBoxFS=xc,Vh._shaders.SkyBoxVS=Ac,Vh._shaders.SunFS=Pc,Vh._shaders.SunTextureFS=Dc,Vh._shaders.SunVS=Mc,Vh._shaders.ViewportQuadFS=Ic,Vh._shaders.ViewportQuadVS=Rc,Vh.Autolinker=Oc,Vh["earcut-2.1.1"]=Nc,Vh.gltfDefaults=Lc,Vh.kdbush=Bc,Vh["knockout-3.4.0"]=Fc,Vh["knockout-es5"]=Vc,Vh.knockout=kc,Vh.measureText=zc,Vh["mersenne-twister"]=Uc,Vh.NoSleep=Gc,Vh.sprintf=Wc,Vh.topojson=Hc,Vh.Tween=qc,Vh.Uri=jc,Vh.when=Yc,Vh.zip=Xc,Vh.Animation=Zc,Vh.AnimationViewModel=Kc,Vh.BaseLayerPicker=Qc,Vh.BaseLayerPickerViewModel=Jc,Vh.createDefaultImageryProviderViewModels=$c,Vh.createDefaultTerrainProviderViewModels=eh,Vh.ProviderViewModel=th,Vh.CesiumInspector=ih,Vh.CesiumInspectorViewModel=rh,Vh.CesiumWidget=nh,Vh.ClockViewModel=oh,Vh.Command=ah,Vh.createCommand=sh,Vh.FullscreenButton=lh,Vh.FullscreenButtonViewModel=uh,Vh.Geocoder=ch,Vh.GeocoderViewModel=hh,Vh.getElement=dh,Vh.HomeButton=ph,Vh.HomeButtonViewModel=mh,Vh.InfoBox=fh,Vh.InfoBoxViewModel=_h,Vh.NavigationHelpButton=gh,Vh.NavigationHelpButtonViewModel=vh,Vh.PerformanceWatchdog=yh,Vh.PerformanceWatchdogViewModel=Ch,Vh.SceneModePicker=wh,Vh.SceneModePickerViewModel=Sh,Vh.SelectionIndicator=Eh,Vh.SelectionIndicatorViewModel=bh,Vh.subscribeAndEvaluate=Th,Vh.SvgPathBindingHandler=xh,Vh.Timeline=Ah,Vh.TimelineHighlightRange=Ph,Vh.TimelineTrack=Dh,Vh.ToggleButtonViewModel=Mh,Vh.Viewer=Ih,Vh.viewerCesiumInspectorMixin=Rh,Vh.viewerDragDropMixin=Oh,Vh.viewerPerformanceWatchdogMixin=Nh,Vh.VRButton=Lh,Vh.VRButtonViewModel=Bh,Vh.createTaskProcessorWorker=Fh,Vh}),t(["Cesium"],function(e){"use strict";var t="undefined"!=typeof window?window:"undefined"!=typeof self?self:{};t.Cesium=e},void 0,!0)}(); \ No newline at end of file diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/ThirdParty/Workers/deflate.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/ThirdParty/Workers/deflate.js index c102cde1..7ea091a6 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/ThirdParty/Workers/deflate.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/ThirdParty/Workers/deflate.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/ThirdParty/Workers/inflate.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/ThirdParty/Workers/inflate.js index a0029d4c..c056f810 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/ThirdParty/Workers/inflate.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/ThirdParty/Workers/inflate.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Widgets/Geocoder/Geocoder.css b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Widgets/Geocoder/Geocoder.css index 541862c0..0871a5b6 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Widgets/Geocoder/Geocoder.css +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Widgets/Geocoder/Geocoder.css @@ -1 +1 @@ -.cesium-viewer-geocoderContainer .cesium-geocoder-input{border:solid 1px #444;background-color:rgba(40,40,40,0.7);color:white;display:inline-block;vertical-align:middle;width:0;height:32px;margin:0;padding:0 32px 0 0;border-radius:0;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-transition:width ease-in-out 0.25s,background-color 0.2s ease-in-out;-moz-transition:width ease-in-out 0.25s,background-color 0.2s ease-in-out;transition:width ease-in-out 0.25s,background-color 0.2s ease-in-out;-webkit-appearance:none;}.cesium-viewer-geocoderContainer:hover .cesium-geocoder-input{border-color:#aef;box-shadow:0 0 8px #fff;}.cesium-viewer-geocoderContainer .cesium-geocoder-input:focus{border-color:#ea4;background-color:rgba(15,15,15,0.9);box-shadow:none;outline:none;}.cesium-viewer-geocoderContainer:hover .cesium-geocoder-input,.cesium-viewer-geocoderContainer .cesium-geocoder-input:focus,.cesium-viewer-geocoderContainer .cesium-geocoder-input-wide{padding-left:4px;width:250px;}.cesium-geocoder-searchButton{background-color:#303336;display:inline-block;position:absolute;cursor:pointer;width:32px;top:1px;right:1px;height:30px;vertical-align:middle;fill:#edffff;}.cesium-geocoder-searchButton:hover{background-color:#48b;} \ No newline at end of file +.cesium-viewer-geocoderContainer .cesium-geocoder-input{border:solid 1px #444;background-color:rgba(40,40,40,0.7);color:white;display:inline-block;vertical-align:middle;width:0;height:32px;margin:0;padding:0 32px 0 0;border-radius:0;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-transition:width ease-in-out 0.25s,background-color 0.2s ease-in-out;-moz-transition:width ease-in-out 0.25s,background-color 0.2s ease-in-out;transition:width ease-in-out 0.25s,background-color 0.2s ease-in-out;-webkit-appearance:none;}.cesium-viewer-geocoderContainer:hover .cesium-geocoder-input{border-color:#aef;box-shadow:0 0 8px #fff;}.cesium-viewer-geocoderContainer .cesium-geocoder-input:focus{border-color:#ea4;background-color:rgba(15,15,15,0.9);box-shadow:none;outline:none;}.cesium-viewer-geocoderContainer:hover .cesium-geocoder-input,.cesium-viewer-geocoderContainer .cesium-geocoder-input:focus,.cesium-viewer-geocoderContainer .cesium-geocoder-input-wide{padding-left:4px;width:250px;}.cesium-viewer-geocoderContainer .search-results{position:absolute;background-color:#000;color:#eee;overflow-y:auto;opacity:0.8;width:100%;}.cesium-viewer-geocoderContainer .search-results ul{list-style-type:none;margin:0;padding:0;}.cesium-viewer-geocoderContainer .search-results ul li{font-size:14px;padding:3px 10px;}.cesium-viewer-geocoderContainer .search-results ul li:hover{cursor:pointer;}.cesium-viewer-geocoderContainer .search-results ul li.active{background:#48b;}.cesium-geocoder-searchButton{background-color:#303336;display:inline-block;position:absolute;cursor:pointer;width:32px;top:1px;right:1px;height:30px;vertical-align:middle;fill:#edffff;}.cesium-geocoder-searchButton:hover{background-color:#48b;} \ No newline at end of file diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Widgets/widgets.css b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Widgets/widgets.css index 3cd034ba..af76a1a1 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Widgets/widgets.css +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Widgets/widgets.css @@ -1 +1 @@ -.cesium-svgPath-svg{position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;}.cesium-button{display:inline-block;position:relative;background:#303336;border:1px solid #444;color:#edffff;fill:#edffff;border-radius:4px;padding:5px 12px;margin:2px 3px;cursor:pointer;overflow:hidden;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;}.cesium-button:focus{color:#fff;fill:#fff;border-color:#ea4;outline:none;}.cesium-button:hover{color:#fff;fill:#fff;background:#48b;border-color:#aef;box-shadow:0 0 8px #fff;}.cesium-button:active{color:#000;fill:#000;background:#adf;border-color:#fff;box-shadow:0 0 8px #fff;}.cesium-button:disabled,.cesium-button-disabled,.cesium-button-disabled:focus,.cesium-button-disabled:hover,.cesium-button-disabled:active{background:#303336;border-color:#444;color:#646464;fill:#646464;box-shadow:none;cursor:default;}.cesium-button option{background-color:#000;color:#eee;}.cesium-button option:disabled{color:#777;}.cesium-button input,.cesium-button label{cursor:pointer;}.cesium-button input{vertical-align:sub;}.cesium-toolbar-button{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;width:32px;height:32px;border-radius:14%;padding:0;vertical-align:middle;z-index:0;}.cesium-performanceDisplay-defaultContainer{position:absolute;top:50px;right:10px;text-align:right;}.cesium-performanceDisplay{background-color:rgba(40,40,40,0.7);padding:7px;border-radius:5px;border:1px solid #444;font:bold 12px sans-serif;}.cesium-performanceDisplay-fps{color:#e52;}.cesium-performanceDisplay-ms{color:#de3;}.cesium-animation-theme{visibility:hidden;display:block;position:absolute;z-index:-100;}.cesium-animation-themeNormal{color:#222;}.cesium-animation-themeHover{color:#4488B0;}.cesium-animation-themeSelect{color:#242;}.cesium-animation-themeDisabled{color:#333;}.cesium-animation-themeKnob{color:#222;}.cesium-animation-themePointer{color:#2E2;}.cesium-animation-themeSwoosh{color:#8AC;}.cesium-animation-themeSwooshHover{color:#AEF;}.cesium-animation-svgText{fill:#edffff;font-family:Sans-Serif;font-size:15px;text-anchor:middle;}.cesium-animation-blank{fill:#000;fill-opacity:0.01;stroke:none;}.cesium-animation-rectButton{cursor:pointer;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;}.cesium-animation-rectButton .cesium-animation-buttonGlow{fill:#fff;stroke:none;display:none;}.cesium-animation-rectButton:hover .cesium-animation-buttonGlow{display:block;}.cesium-animation-rectButton .cesium-animation-buttonPath{fill:#edffff;}.cesium-animation-rectButton .cesium-animation-buttonMain{stroke:#444;stroke-width:1.2;}.cesium-animation-rectButton:hover .cesium-animation-buttonMain{stroke:#AEF;}.cesium-animation-rectButton:active .cesium-animation-buttonMain{fill:#ABD6FF;}.cesium-animation-buttonDisabled{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;}.cesium-animation-buttonDisabled .cesium-animation-buttonMain{stroke:#555;}.cesium-animation-buttonDisabled .cesium-animation-buttonPath{fill:#818181;}.cesium-animation-buttonDisabled .cesium-animation-buttonGlow{display:none;}.cesium-animation-buttonToggled .cesium-animation-buttonGlow{display:block;fill:#2E2;}.cesium-animation-buttonToggled .cesium-animation-buttonMain{stroke:#2E2;}.cesium-animation-buttonToggled:hover .cesium-animation-buttonGlow{fill:#fff;}.cesium-animation-buttonToggled:hover .cesium-animation-buttonMain{stroke:#2E2;}.cesium-animation-shuttleRingG{cursor:pointer;}.cesium-animation-shuttleRingPointer{cursor:pointer;}.cesium-animation-shuttleRingPausePointer{cursor:pointer;}.cesium-animation-shuttleRingBack{fill:#181818;fill-opacity:0.8;stroke:#333;stroke-width:1.2;}.cesium-animation-shuttleRingSwoosh line{stroke:#8AC;stroke-width:3;stroke-opacity:0.2;stroke-linecap:round;}.cesium-animation-knobOuter{cursor:pointer;stroke:#444;stroke-width:1.2;}.cesium-animation-knobInner{cursor:pointer;}.cesium-baseLayerPicker-selected{position:absolute;top:0;left:0;width:100%;height:100%;border:none;}.cesium-baseLayerPicker-dropDown{display:block;position:absolute;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;top:auto;right:0;width:320px;max-height:500px;margin-top:5px;background-color:rgba(38,38,38,0.75);border:1px solid #444;padding:6px;overflow:auto;border-radius:10px;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;-webkit-transform:translate(0,-20%);-moz-transform:translate(0,-20%);transform:translate(0,-20%);visibility:hidden;opacity:0;-webkit-transition:visibility 0s 0.2s,opacity 0.2s ease-in,-webkit-transform 0.2s ease-in;-moz-transition:visibility 0s 0.2s,opacity 0.2s ease-in,-moz-transform 0.2s ease-in;transition:visibility 0s 0.2s,opacity 0.2s ease-in,transform 0.2s ease-in;}.cesium-baseLayerPicker-dropDown-visible{-webkit-transform:translate(0,0);-moz-transform:translate(0,0);transform:translate(0,0);visibility:visible;opacity:1;-webkit-transition:opacity 0.2s ease-out,-webkit-transform 0.2s ease-out;-moz-transition:opacity 0.2s ease-out,-moz-transform 0.2s ease-out;transition:opacity 0.2s ease-out,transform 0.2s ease-out;}.cesium-baseLayerPicker-sectionTitle{display:block;font-family:sans-serif;font-size:16pt;text-align:left;color:#edffff;border-bottom:1px solid #888;margin-bottom:4px;}.cesium-baseLayerPicker-choices{display:block;position:relative;top:auto;right:0;}.cesium-baseLayerPicker-item{display:inline-block;vertical-align:top;margin:2px 5px;width:64px;text-align:center;cursor:pointer;}.cesium-baseLayerPicker-itemLabel{display:block;font-family:sans-serif;font-size:8pt;text-align:center;vertical-align:middle;color:#edffff;cursor:pointer;word-wrap:break-word;}.cesium-baseLayerPicker-item:hover .cesium-baseLayerPicker-itemLabel,.cesium-baseLayerPicker-item:focus .cesium-baseLayerPicker-itemLabel{text-decoration:underline;}.cesium-baseLayerPicker-itemIcon{display:inline-block;position:relative;width:inherit;height:auto;background-size:100% 100%;border:solid 1px #444;border-radius:9px;color:#edffff;margin:0;padding:0;cursor:pointer;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;}.cesium-baseLayerPicker-item:hover .cesium-baseLayerPicker-itemIcon{border-color:#fff;box-shadow:0 0 8px #fff,0 0 8px #fff;}.cesium-baseLayerPicker-selectedItem .cesium-baseLayerPicker-itemLabel{color:rgb(189,236,248);}.cesium-baseLayerPicker-selectedItem .cesium-baseLayerPicker-itemIcon{border:double 4px rgb(189,236,248);}.cesium-widget{position:relative;}.cesium-widget,.cesium-widget canvas{width:100%;height:100%;touch-action:none;}.cesium-widget-credits{display:block;position:absolute;bottom:0;left:0;color:#fff;font-size:10px;text-shadow:0px 0px 2px #000000;padding-right:5px;}.cesium-widget-credits a,.cesium-widget-credits a:visited{color:#fff;}.cesium-widget-errorPanel{position:absolute;top:0;right:0;bottom:0;left:0;text-align:center;background:rgba(0,0,0,0.7);z-index:99999;}.cesium-widget-errorPanel:before{display:inline-block;vertical-align:middle;height:100%;content:"";}.cesium-widget-errorPanel-content{width:75%;display:inline-block;text-align:left;vertical-align:middle;border:1px solid #526F82;border-radius:7px;background-color:black;color:white;font-size:10pt;padding:1em;}.cesium-widget-errorPanel-header{font-size:120%;color:#fe4;}.cesium-widget-errorPanel-scroll{overflow:auto;font-family:monospace;white-space:pre-wrap;padding:0;margin:10px 0;}.cesium-widget-errorPanel-buttonPanel{text-align:center;}.cesium-cesiumInspector{border-radius:5px;-webkit-transition:width ease-in-out 0.25s;-moz-transition:width ease-in-out 0.25s;transition:width ease-in-out 0.25s;background:rgba(48,51,54,0.8);border:1px solid #444;color:#edffff;display:inline-block;position:relative;padding:4px 12px;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;}.cesium-cesiumInspector-button{text-align:center;font-size:11pt;}.cesium-cesiumInspector-visible .cesium-cesiumInspector-button{border-bottom:1px solid #aaa;padding-bottom:3px;}.cesium-cesiumInspector input:enabled,.cesium-cesiumInspector-button{cursor:pointer;}.cesium-cesiumInspector-visible{width:185px;height:auto;}.cesium-cesiumInspector-hidden{width:122px;height:17px;}.cesium-cesiumInspector-show{max-height:500px;}.cesium-cesiumInspector-hide{max-height:0;padding:0 !important;overflow:hidden;}.cesium-cesiumInspector-dropDown{margin:5px 0;font-family:sans-serif;font-size:10pt;width:185px;}.cesium-cesiumInspector-frustumStats{padding-left:10px;padding:5px;background-color:rgba(80,80,80,0.75);}.cesium-cesiumInspector-pickButton{background-color:rgba(0,0,0,0.3);border:1px solid #444;color:#edffff;border-radius:5px;padding:3px 7px;cursor:pointer;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;margin:0 auto;}.cesium-cesiumInspector-pickButton:focus{outline:none;}.cesium-cesiumInspector-pickButton:active,.cesium-cesiumInspector-pickButtonHighlight{color:#000;background:#adf;border-color:#fff;box-shadow:0 0 8px #fff;}.cesium-cesiumInspector-center{text-align:center;}.cesium-cesiumInspector-sectionHeader{font-weight:bold;}.cesium-cesiumInspector-pickSection{border:1px solid #aaa;border-radius:5px;padding:3px;margin-bottom:5px;}.cesium-cesiumInspector-section{margin-bottom:10px;-webkit-transition:max-height 0.25s;-moz-transition:max-height 0.25s;transition:max-height 0.25s;}.cesium-cesiumInspector-toggleSwitch{padding:3px;cursor:pointer;}.cesium-cesiumInspector-tileText{padding-bottom:10px;border-bottom:1px solid #aaa;}.cesium-cesiumInspector-relativeText{padding-top:10px;}.cesium-button.cesium-fullscreenButton{display:block;width:100%;height:100%;margin:0;border-radius:0;}.cesium-button.cesium-vrButton{display:block;width:100%;height:100%;margin:0;border-radius:0;}.cesium-viewer-geocoderContainer .cesium-geocoder-input{border:solid 1px #444;background-color:rgba(40,40,40,0.7);color:white;display:inline-block;vertical-align:middle;width:0;height:32px;margin:0;padding:0 32px 0 0;border-radius:0;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-transition:width ease-in-out 0.25s,background-color 0.2s ease-in-out;-moz-transition:width ease-in-out 0.25s,background-color 0.2s ease-in-out;transition:width ease-in-out 0.25s,background-color 0.2s ease-in-out;-webkit-appearance:none;}.cesium-viewer-geocoderContainer:hover .cesium-geocoder-input{border-color:#aef;box-shadow:0 0 8px #fff;}.cesium-viewer-geocoderContainer .cesium-geocoder-input:focus{border-color:#ea4;background-color:rgba(15,15,15,0.9);box-shadow:none;outline:none;}.cesium-viewer-geocoderContainer:hover .cesium-geocoder-input,.cesium-viewer-geocoderContainer .cesium-geocoder-input:focus,.cesium-viewer-geocoderContainer .cesium-geocoder-input-wide{padding-left:4px;width:250px;}.cesium-geocoder-searchButton{background-color:#303336;display:inline-block;position:absolute;cursor:pointer;width:32px;top:1px;right:1px;height:30px;vertical-align:middle;fill:#edffff;}.cesium-geocoder-searchButton:hover{background-color:#48b;}.cesium-infoBox{display:block;position:absolute;top:50px;right:0;width:40%;max-width:480px;background:rgba(38,38,38,0.95);color:#edffff;border:1px solid #444;border-right:none;border-top-left-radius:7px;border-bottom-left-radius:7px;box-shadow:0 0 10px 1px #000;-webkit-transform:translate(100%,0);-moz-transform:translate(100%,0);transform:translate(100%,0);visibility:hidden;opacity:0;-webkit-transition:visibility 0s 0.2s,opacity 0.2s ease-in,-webkit-transform 0.2s ease-in;-moz-transition:visibility 0s 0.2s,opacity 0.2s ease-in,-moz-transform 0.2s ease-in;transition:visibility 0s 0.2s,opacity 0.2s ease-in,transform 0.2s ease-in;}.cesium-infoBox-visible{-webkit-transform:translate(0,0);-moz-transform:translate(0,0);transform:translate(0,0);visibility:visible;opacity:1;-webkit-transition:opacity 0.2s ease-out,-webkit-transform 0.2s ease-out;-moz-transition:opacity 0.2s ease-out,-moz-transform 0.2s ease-out;transition:opacity 0.2s ease-out,transform 0.2s ease-out;}.cesium-infoBox-title{display:block;height:20px;padding:5px 30px 5px 25px;background:rgba(84,84,84,1.0);border-top-left-radius:7px;text-align:center;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;}.cesium-infoBox-bodyless .cesium-infoBox-title{border-bottom-left-radius:7px;}button.cesium-infoBox-camera{display:block;position:absolute;top:4px;left:4px;width:22px;height:22px;background:transparent;border-color:transparent;border-radius:3px;padding:0 5px;margin:0;}button.cesium-infoBox-close{display:block;position:absolute;top:5px;right:5px;height:20px;background:transparent;border:none;border-radius:2px;font-weight:bold;font-size:16px;padding:0 5px;margin:0;color:#edffff;}button.cesium-infoBox-close:focus{background:rgba(238,136,0,0.44);outline:none;}button.cesium-infoBox-close:hover{background:#888;color:#000;}button.cesium-infoBox-close:active{background:#a00;color:#000;}.cesium-infoBox-bodyless .cesium-infoBox-iframe{display:none;}.cesium-infoBox-iframe{border:none;width:100%;width:calc(100% - 2px);}span.cesium-sceneModePicker-wrapper{display:inline-block;position:relative;margin:0 3px;}.cesium-sceneModePicker-visible{visibility:visible;opacity:1;transition:opacity 0.25s linear;-webkit-transition:opacity 0.25s linear;-moz-transition:opacity 0.25s linear;}.cesium-sceneModePicker-hidden{visibility:hidden;opacity:0;transition:visibility 0s 0.25s,opacity 0.25s linear;-webkit-transition:visibility 0s 0.25s,opacity 0.25s linear;-moz-transition:visibility 0s 0.25s,opacity 0.25s linear;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-none{display:none;}.cesium-sceneModePicker-slide-svg{-webkit-transition:left 2s;-moz-transition:left 2s;transition:left 2s;top:0;left:0;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-dropDown-icon{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;padding:0;margin:3px 0;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button3D,.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-buttonColumbusView,.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button2D{margin:0 0 3px 0;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button3D .cesium-sceneModePicker-icon2D{left:100%;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button3D .cesium-sceneModePicker-iconColumbusView{left:200%;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-buttonColumbusView .cesium-sceneModePicker-icon3D{left:-200%;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-buttonColumbusView .cesium-sceneModePicker-icon2D{left:-100%;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button2D .cesium-sceneModePicker-icon3D{left:-100%;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button2D .cesium-sceneModePicker-iconColumbusView{left:100%;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-selected{border-color:#2e2;box-shadow:0 0 8px #fff,0 0 8px #fff;}.cesium-performance-watchdog-message-area{position:relative;background-color:yellow;color:black;padding:10px;}.cesium-performance-watchdog-message{margin-right:30px;}.cesium-performance-watchdog-message-dismiss{position:absolute;right:0;margin:0 10px 0 0;}.cesium-navigationHelpButton-wrapper{position:relative;display:inline-block;}.cesium-navigation-help{visibility:hidden;position:absolute;top:38px;right:2px;width:250px;border-radius:10px;-webkit-transform:scale(0.01);-moz-transform:scale(0.01);transform:scale(0.01);-webkit-transform-origin:234px -10px;-moz-transform-origin:234px -10px;transform-origin:234px -10px;-webkit-transition:visibility 0s 0.25s,-webkit-transform 0.25s ease-in;-moz-transition:visibility 0s 0.25s,-moz-transform 0.25s ease-in;transition:visibility 0s 0.25s,transform 0.25s ease-in;}.cesium-navigation-help-visible{visibility:visible;-webkit-transform:scale(1);-moz-transform:scale(1);transform:scale(1);-webkit-transition:-webkit-transform 0.25s ease-out;-moz-transition:-moz-transform 0.25s ease-out;transition:transform 0.25s ease-out;}.cesium-navigation-help-instructions{border:1px solid #444;background-color:rgba(38,38,38,0.75);padding-bottom:5px;border-radius:0 0 10px 10px;}.cesium-click-navigation-help{display:none;}.cesium-touch-navigation-help{display:none;padding-top:5px;}.cesium-click-navigation-help-visible{display:block;}.cesium-touch-navigation-help-visible{display:block;}.cesium-navigation-help-pan{color:#66ccff;font-weight:bold;}.cesium-navigation-help-zoom{color:#65fd00;font-weight:bold;}.cesium-navigation-help-rotate{color:#ffd800;font-weight:bold;}.cesium-navigation-help-tilt{color:#d800d8;font-weight:bold;}.cesium-navigation-help-details{color:#ffffff;}.cesium-navigation-button{color:#fff;background-color:transparent;border-bottom:none;border-top:1px solid #444;border-right:1px solid #444;margin:0;width:50%;cursor:pointer;}.cesium-navigation-button-icon{vertical-align:middle;padding:5px 1px;}.cesium-navigation-button:focus{outline:none;}.cesium-navigation-button-left{border-radius:10px 0 0 0;border-left:1px solid #444;}.cesium-navigation-button-right{border-radius:0 10px 0 0;border-left:none;}.cesium-navigation-button-selected{background-color:rgba(38,38,38,0.75);}.cesium-navigation-button-unselected{background-color:rgba(0,0,0,0.75);}.cesium-navigation-button-unselected:hover{background-color:rgba(76,76,76,0.75);}.cesium-selection-wrapper{position:absolute;width:160px;height:160px;pointer-events:none;visibility:hidden;opacity:0;-webkit-transition:visibility 0s 0.2s,opacity 0.2s ease-in;-moz-transition:visibility 0s 0.2s,opacity 0.2s ease-in;transition:visibility 0s 0.2s,opacity 0.2s ease-in;}.cesium-selection-wrapper-visible{visibility:visible;opacity:1;-webkit-transition:opacity 0.2s ease-out;-moz-transition:opacity 0.2s ease-out;transition:opacity 0.2s ease-out;}.cesium-selection-wrapper svg{fill:#2e2;stroke:#000;stroke-width:1.1px;}.cesium-timeline-main{position:relative;left:0;bottom:0;overflow:hidden;border:solid 1px #888;}.cesium-timeline-trackContainer{width:100%;overflow:auto;border-top:solid 1px #888;position:relative;top:0;left:0;}.cesium-timeline-tracks{position:absolute;top:0;left:0;width:100%;}.cesium-timeline-needle{position:absolute;left:0;top:1.7em;bottom:0;width:1px;background:#F00;}.cesium-timeline-bar{position:relative;left:0;top:0;overflow:hidden;cursor:pointer;width:100%;height:1.7em;background-color:#fafafa;background:rgba(32,32,32,0.8);background:-moz-linear-gradient(top,rgba(116,117,119,0.8) 0%,rgba(58,68,82,0.8) 11%,rgba(46,50,56,0.8) 46%,rgba(53,53,53,0.8) 81%,rgba(53,53,53,0.8) 100%);background:-webkit-linear-gradient(top,rgba(116,117,119,0.8) 0%,rgba(58,68,82,0.8) 11%,rgba(46,50,56,0.8) 46%,rgba(53,53,53,0.8) 81%,rgba(53,53,53,0.8) 100%);background:linear-gradient(to bottom,rgba(116,117,119,0.8) 0%,rgba(58,68,82,0.8) 11%,rgba(46,50,56,0.8) 46%,rgba(53,53,53,0.8) 81%,rgba(53,53,53,0.8) 100%);}.cesium-timeline-ruler{visibility:hidden;white-space:nowrap;font-size:80%;z-index:-200;}.cesium-timeline-highlight{position:absolute;bottom:0;left:0;background:#08F;}.cesium-timeline-ticLabel{position:absolute;top:0;left:0;white-space:nowrap;font-size:80%;color:#eee;}.cesium-timeline-ticMain{position:absolute;bottom:0;left:0;width:1px;height:50%;background:#eee;}.cesium-timeline-ticSub{position:absolute;bottom:0;left:0;width:1px;height:33%;background:#aaa;}.cesium-timeline-ticTiny{position:absolute;bottom:0;left:0;width:1px;height:25%;background:#888;}.cesium-timeline-icon16{display:block;position:absolute;width:16px;height:16px;background-image:url(Images/TimelineIcons.png);background-repeat:no-repeat;}.cesium-viewer{font-family:sans-serif;font-size:16px;overflow:hidden;display:block;position:relative;top:0;left:0;width:100%;height:100%;}.cesium-viewer-cesiumWidgetContainer{width:100%;height:100%;}.cesium-viewer-bottom{display:block;position:absolute;bottom:0;left:0;right:0;padding-right:5px;}.cesium-viewer .cesium-widget-credits{display:inline;position:static;bottom:auto;left:auto;padding-right:0;color:#ffffff;font-size:10px;text-shadow:0 0 2px #000000;}.cesium-viewer-timelineContainer{position:absolute;bottom:0;left:169px;right:29px;height:27px;padding:0;margin:0;overflow:hidden;font-size:14px;}.cesium-viewer-animationContainer{position:absolute;bottom:0;left:0;padding:0;width:169px;height:112px;}.cesium-viewer-fullscreenContainer{position:absolute;bottom:0;right:0;padding:0;width:29px;height:29px;overflow:hidden;}.cesium-viewer-vrContainer{position:absolute;bottom:0;right:0;padding:0;width:29px;height:29px;overflow:hidden;}.cesium-viewer-toolbar{display:block;position:absolute;top:5px;right:5px;}.cesium-viewer-cesiumInspectorContainer{display:block;position:absolute;top:50px;right:10px;}.cesium-viewer-geocoderContainer{position:relative;display:inline-block;margin:0 3px;} \ No newline at end of file +.cesium-svgPath-svg{position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;}.cesium-button{display:inline-block;position:relative;background:#303336;border:1px solid #444;color:#edffff;fill:#edffff;border-radius:4px;padding:5px 12px;margin:2px 3px;cursor:pointer;overflow:hidden;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;}.cesium-button:focus{color:#fff;fill:#fff;border-color:#ea4;outline:none;}.cesium-button:hover{color:#fff;fill:#fff;background:#48b;border-color:#aef;box-shadow:0 0 8px #fff;}.cesium-button:active{color:#000;fill:#000;background:#adf;border-color:#fff;box-shadow:0 0 8px #fff;}.cesium-button:disabled,.cesium-button-disabled,.cesium-button-disabled:focus,.cesium-button-disabled:hover,.cesium-button-disabled:active{background:#303336;border-color:#444;color:#646464;fill:#646464;box-shadow:none;cursor:default;}.cesium-button option{background-color:#000;color:#eee;}.cesium-button option:disabled{color:#777;}.cesium-button input,.cesium-button label{cursor:pointer;}.cesium-button input{vertical-align:sub;}.cesium-toolbar-button{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;width:32px;height:32px;border-radius:14%;padding:0;vertical-align:middle;z-index:0;}.cesium-performanceDisplay-defaultContainer{position:absolute;top:50px;right:10px;text-align:right;}.cesium-performanceDisplay{background-color:rgba(40,40,40,0.7);padding:7px;border-radius:5px;border:1px solid #444;font:bold 12px sans-serif;}.cesium-performanceDisplay-fps{color:#e52;}.cesium-performanceDisplay-ms{color:#de3;}.cesium-animation-theme{visibility:hidden;display:block;position:absolute;z-index:-100;}.cesium-animation-themeNormal{color:#222;}.cesium-animation-themeHover{color:#4488B0;}.cesium-animation-themeSelect{color:#242;}.cesium-animation-themeDisabled{color:#333;}.cesium-animation-themeKnob{color:#222;}.cesium-animation-themePointer{color:#2E2;}.cesium-animation-themeSwoosh{color:#8AC;}.cesium-animation-themeSwooshHover{color:#AEF;}.cesium-animation-svgText{fill:#edffff;font-family:Sans-Serif;font-size:15px;text-anchor:middle;}.cesium-animation-blank{fill:#000;fill-opacity:0.01;stroke:none;}.cesium-animation-rectButton{cursor:pointer;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;}.cesium-animation-rectButton .cesium-animation-buttonGlow{fill:#fff;stroke:none;display:none;}.cesium-animation-rectButton:hover .cesium-animation-buttonGlow{display:block;}.cesium-animation-rectButton .cesium-animation-buttonPath{fill:#edffff;}.cesium-animation-rectButton .cesium-animation-buttonMain{stroke:#444;stroke-width:1.2;}.cesium-animation-rectButton:hover .cesium-animation-buttonMain{stroke:#AEF;}.cesium-animation-rectButton:active .cesium-animation-buttonMain{fill:#ABD6FF;}.cesium-animation-buttonDisabled{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;}.cesium-animation-buttonDisabled .cesium-animation-buttonMain{stroke:#555;}.cesium-animation-buttonDisabled .cesium-animation-buttonPath{fill:#818181;}.cesium-animation-buttonDisabled .cesium-animation-buttonGlow{display:none;}.cesium-animation-buttonToggled .cesium-animation-buttonGlow{display:block;fill:#2E2;}.cesium-animation-buttonToggled .cesium-animation-buttonMain{stroke:#2E2;}.cesium-animation-buttonToggled:hover .cesium-animation-buttonGlow{fill:#fff;}.cesium-animation-buttonToggled:hover .cesium-animation-buttonMain{stroke:#2E2;}.cesium-animation-shuttleRingG{cursor:pointer;}.cesium-animation-shuttleRingPointer{cursor:pointer;}.cesium-animation-shuttleRingPausePointer{cursor:pointer;}.cesium-animation-shuttleRingBack{fill:#181818;fill-opacity:0.8;stroke:#333;stroke-width:1.2;}.cesium-animation-shuttleRingSwoosh line{stroke:#8AC;stroke-width:3;stroke-opacity:0.2;stroke-linecap:round;}.cesium-animation-knobOuter{cursor:pointer;stroke:#444;stroke-width:1.2;}.cesium-animation-knobInner{cursor:pointer;}.cesium-baseLayerPicker-selected{position:absolute;top:0;left:0;width:100%;height:100%;border:none;}.cesium-baseLayerPicker-dropDown{display:block;position:absolute;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;top:auto;right:0;width:320px;max-height:500px;margin-top:5px;background-color:rgba(38,38,38,0.75);border:1px solid #444;padding:6px;overflow:auto;border-radius:10px;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;-webkit-transform:translate(0,-20%);-moz-transform:translate(0,-20%);transform:translate(0,-20%);visibility:hidden;opacity:0;-webkit-transition:visibility 0s 0.2s,opacity 0.2s ease-in,-webkit-transform 0.2s ease-in;-moz-transition:visibility 0s 0.2s,opacity 0.2s ease-in,-moz-transform 0.2s ease-in;transition:visibility 0s 0.2s,opacity 0.2s ease-in,transform 0.2s ease-in;}.cesium-baseLayerPicker-dropDown-visible{-webkit-transform:translate(0,0);-moz-transform:translate(0,0);transform:translate(0,0);visibility:visible;opacity:1;-webkit-transition:opacity 0.2s ease-out,-webkit-transform 0.2s ease-out;-moz-transition:opacity 0.2s ease-out,-moz-transform 0.2s ease-out;transition:opacity 0.2s ease-out,transform 0.2s ease-out;}.cesium-baseLayerPicker-sectionTitle{display:block;font-family:sans-serif;font-size:16pt;text-align:left;color:#edffff;border-bottom:1px solid #888;margin-bottom:4px;}.cesium-baseLayerPicker-choices{display:block;position:relative;top:auto;right:0;}.cesium-baseLayerPicker-item{display:inline-block;vertical-align:top;margin:2px 5px;width:64px;text-align:center;cursor:pointer;}.cesium-baseLayerPicker-itemLabel{display:block;font-family:sans-serif;font-size:8pt;text-align:center;vertical-align:middle;color:#edffff;cursor:pointer;word-wrap:break-word;}.cesium-baseLayerPicker-item:hover .cesium-baseLayerPicker-itemLabel,.cesium-baseLayerPicker-item:focus .cesium-baseLayerPicker-itemLabel{text-decoration:underline;}.cesium-baseLayerPicker-itemIcon{display:inline-block;position:relative;width:inherit;height:auto;background-size:100% 100%;border:solid 1px #444;border-radius:9px;color:#edffff;margin:0;padding:0;cursor:pointer;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;}.cesium-baseLayerPicker-item:hover .cesium-baseLayerPicker-itemIcon{border-color:#fff;box-shadow:0 0 8px #fff,0 0 8px #fff;}.cesium-baseLayerPicker-selectedItem .cesium-baseLayerPicker-itemLabel{color:rgb(189,236,248);}.cesium-baseLayerPicker-selectedItem .cesium-baseLayerPicker-itemIcon{border:double 4px rgb(189,236,248);}.cesium-widget{position:relative;}.cesium-widget,.cesium-widget canvas{width:100%;height:100%;touch-action:none;}.cesium-widget-credits{display:block;position:absolute;bottom:0;left:0;color:#fff;font-size:10px;text-shadow:0px 0px 2px #000000;padding-right:5px;}.cesium-widget-credits a,.cesium-widget-credits a:visited{color:#fff;}.cesium-widget-errorPanel{position:absolute;top:0;right:0;bottom:0;left:0;text-align:center;background:rgba(0,0,0,0.7);z-index:99999;}.cesium-widget-errorPanel:before{display:inline-block;vertical-align:middle;height:100%;content:"";}.cesium-widget-errorPanel-content{width:75%;display:inline-block;text-align:left;vertical-align:middle;border:1px solid #526F82;border-radius:7px;background-color:black;color:white;font-size:10pt;padding:1em;}.cesium-widget-errorPanel-header{font-size:120%;color:#fe4;}.cesium-widget-errorPanel-scroll{overflow:auto;font-family:monospace;white-space:pre-wrap;padding:0;margin:10px 0;}.cesium-widget-errorPanel-buttonPanel{text-align:center;}.cesium-cesiumInspector{border-radius:5px;-webkit-transition:width ease-in-out 0.25s;-moz-transition:width ease-in-out 0.25s;transition:width ease-in-out 0.25s;background:rgba(48,51,54,0.8);border:1px solid #444;color:#edffff;display:inline-block;position:relative;padding:4px 12px;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;}.cesium-cesiumInspector-button{text-align:center;font-size:11pt;}.cesium-cesiumInspector-visible .cesium-cesiumInspector-button{border-bottom:1px solid #aaa;padding-bottom:3px;}.cesium-cesiumInspector input:enabled,.cesium-cesiumInspector-button{cursor:pointer;}.cesium-cesiumInspector-visible{width:185px;height:auto;}.cesium-cesiumInspector-hidden{width:122px;height:17px;}.cesium-cesiumInspector-show{max-height:500px;}.cesium-cesiumInspector-hide{max-height:0;padding:0 !important;overflow:hidden;}.cesium-cesiumInspector-dropDown{margin:5px 0;font-family:sans-serif;font-size:10pt;width:185px;}.cesium-cesiumInspector-frustumStats{padding-left:10px;padding:5px;background-color:rgba(80,80,80,0.75);}.cesium-cesiumInspector-pickButton{background-color:rgba(0,0,0,0.3);border:1px solid #444;color:#edffff;border-radius:5px;padding:3px 7px;cursor:pointer;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;margin:0 auto;}.cesium-cesiumInspector-pickButton:focus{outline:none;}.cesium-cesiumInspector-pickButton:active,.cesium-cesiumInspector-pickButtonHighlight{color:#000;background:#adf;border-color:#fff;box-shadow:0 0 8px #fff;}.cesium-cesiumInspector-center{text-align:center;}.cesium-cesiumInspector-sectionHeader{font-weight:bold;}.cesium-cesiumInspector-pickSection{border:1px solid #aaa;border-radius:5px;padding:3px;margin-bottom:5px;}.cesium-cesiumInspector-section{margin-bottom:10px;-webkit-transition:max-height 0.25s;-moz-transition:max-height 0.25s;transition:max-height 0.25s;}.cesium-cesiumInspector-toggleSwitch{padding:3px;cursor:pointer;}.cesium-cesiumInspector-tileText{padding-bottom:10px;border-bottom:1px solid #aaa;}.cesium-cesiumInspector-relativeText{padding-top:10px;}.cesium-button.cesium-fullscreenButton{display:block;width:100%;height:100%;margin:0;border-radius:0;}.cesium-button.cesium-vrButton{display:block;width:100%;height:100%;margin:0;border-radius:0;}.cesium-viewer-geocoderContainer .cesium-geocoder-input{border:solid 1px #444;background-color:rgba(40,40,40,0.7);color:white;display:inline-block;vertical-align:middle;width:0;height:32px;margin:0;padding:0 32px 0 0;border-radius:0;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-transition:width ease-in-out 0.25s,background-color 0.2s ease-in-out;-moz-transition:width ease-in-out 0.25s,background-color 0.2s ease-in-out;transition:width ease-in-out 0.25s,background-color 0.2s ease-in-out;-webkit-appearance:none;}.cesium-viewer-geocoderContainer:hover .cesium-geocoder-input{border-color:#aef;box-shadow:0 0 8px #fff;}.cesium-viewer-geocoderContainer .cesium-geocoder-input:focus{border-color:#ea4;background-color:rgba(15,15,15,0.9);box-shadow:none;outline:none;}.cesium-viewer-geocoderContainer:hover .cesium-geocoder-input,.cesium-viewer-geocoderContainer .cesium-geocoder-input:focus,.cesium-viewer-geocoderContainer .cesium-geocoder-input-wide{padding-left:4px;width:250px;}.cesium-viewer-geocoderContainer .search-results{position:absolute;background-color:#000;color:#eee;overflow-y:auto;opacity:0.8;width:100%;}.cesium-viewer-geocoderContainer .search-results ul{list-style-type:none;margin:0;padding:0;}.cesium-viewer-geocoderContainer .search-results ul li{font-size:14px;padding:3px 10px;}.cesium-viewer-geocoderContainer .search-results ul li:hover{cursor:pointer;}.cesium-viewer-geocoderContainer .search-results ul li.active{background:#48b;}.cesium-geocoder-searchButton{background-color:#303336;display:inline-block;position:absolute;cursor:pointer;width:32px;top:1px;right:1px;height:30px;vertical-align:middle;fill:#edffff;}.cesium-geocoder-searchButton:hover{background-color:#48b;}.cesium-infoBox{display:block;position:absolute;top:50px;right:0;width:40%;max-width:480px;background:rgba(38,38,38,0.95);color:#edffff;border:1px solid #444;border-right:none;border-top-left-radius:7px;border-bottom-left-radius:7px;box-shadow:0 0 10px 1px #000;-webkit-transform:translate(100%,0);-moz-transform:translate(100%,0);transform:translate(100%,0);visibility:hidden;opacity:0;-webkit-transition:visibility 0s 0.2s,opacity 0.2s ease-in,-webkit-transform 0.2s ease-in;-moz-transition:visibility 0s 0.2s,opacity 0.2s ease-in,-moz-transform 0.2s ease-in;transition:visibility 0s 0.2s,opacity 0.2s ease-in,transform 0.2s ease-in;}.cesium-infoBox-visible{-webkit-transform:translate(0,0);-moz-transform:translate(0,0);transform:translate(0,0);visibility:visible;opacity:1;-webkit-transition:opacity 0.2s ease-out,-webkit-transform 0.2s ease-out;-moz-transition:opacity 0.2s ease-out,-moz-transform 0.2s ease-out;transition:opacity 0.2s ease-out,transform 0.2s ease-out;}.cesium-infoBox-title{display:block;height:20px;padding:5px 30px 5px 25px;background:rgba(84,84,84,1.0);border-top-left-radius:7px;text-align:center;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;}.cesium-infoBox-bodyless .cesium-infoBox-title{border-bottom-left-radius:7px;}button.cesium-infoBox-camera{display:block;position:absolute;top:4px;left:4px;width:22px;height:22px;background:transparent;border-color:transparent;border-radius:3px;padding:0 5px;margin:0;}button.cesium-infoBox-close{display:block;position:absolute;top:5px;right:5px;height:20px;background:transparent;border:none;border-radius:2px;font-weight:bold;font-size:16px;padding:0 5px;margin:0;color:#edffff;}button.cesium-infoBox-close:focus{background:rgba(238,136,0,0.44);outline:none;}button.cesium-infoBox-close:hover{background:#888;color:#000;}button.cesium-infoBox-close:active{background:#a00;color:#000;}.cesium-infoBox-bodyless .cesium-infoBox-iframe{display:none;}.cesium-infoBox-iframe{border:none;width:100%;width:calc(100% - 2px);}span.cesium-sceneModePicker-wrapper{display:inline-block;position:relative;margin:0 3px;}.cesium-sceneModePicker-visible{visibility:visible;opacity:1;transition:opacity 0.25s linear;-webkit-transition:opacity 0.25s linear;-moz-transition:opacity 0.25s linear;}.cesium-sceneModePicker-hidden{visibility:hidden;opacity:0;transition:visibility 0s 0.25s,opacity 0.25s linear;-webkit-transition:visibility 0s 0.25s,opacity 0.25s linear;-moz-transition:visibility 0s 0.25s,opacity 0.25s linear;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-none{display:none;}.cesium-sceneModePicker-slide-svg{-webkit-transition:left 2s;-moz-transition:left 2s;transition:left 2s;top:0;left:0;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-dropDown-icon{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;padding:0;margin:3px 0;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button3D,.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-buttonColumbusView,.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button2D{margin:0 0 3px 0;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button3D .cesium-sceneModePicker-icon2D{left:100%;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button3D .cesium-sceneModePicker-iconColumbusView{left:200%;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-buttonColumbusView .cesium-sceneModePicker-icon3D{left:-200%;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-buttonColumbusView .cesium-sceneModePicker-icon2D{left:-100%;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button2D .cesium-sceneModePicker-icon3D{left:-100%;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button2D .cesium-sceneModePicker-iconColumbusView{left:100%;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-selected{border-color:#2e2;box-shadow:0 0 8px #fff,0 0 8px #fff;}.cesium-performance-watchdog-message-area{position:relative;background-color:yellow;color:black;padding:10px;}.cesium-performance-watchdog-message{margin-right:30px;}.cesium-performance-watchdog-message-dismiss{position:absolute;right:0;margin:0 10px 0 0;}.cesium-navigationHelpButton-wrapper{position:relative;display:inline-block;}.cesium-navigation-help{visibility:hidden;position:absolute;top:38px;right:2px;width:250px;border-radius:10px;-webkit-transform:scale(0.01);-moz-transform:scale(0.01);transform:scale(0.01);-webkit-transform-origin:234px -10px;-moz-transform-origin:234px -10px;transform-origin:234px -10px;-webkit-transition:visibility 0s 0.25s,-webkit-transform 0.25s ease-in;-moz-transition:visibility 0s 0.25s,-moz-transform 0.25s ease-in;transition:visibility 0s 0.25s,transform 0.25s ease-in;}.cesium-navigation-help-visible{visibility:visible;-webkit-transform:scale(1);-moz-transform:scale(1);transform:scale(1);-webkit-transition:-webkit-transform 0.25s ease-out;-moz-transition:-moz-transform 0.25s ease-out;transition:transform 0.25s ease-out;}.cesium-navigation-help-instructions{border:1px solid #444;background-color:rgba(38,38,38,0.75);padding-bottom:5px;border-radius:0 0 10px 10px;}.cesium-click-navigation-help{display:none;}.cesium-touch-navigation-help{display:none;padding-top:5px;}.cesium-click-navigation-help-visible{display:block;}.cesium-touch-navigation-help-visible{display:block;}.cesium-navigation-help-pan{color:#66ccff;font-weight:bold;}.cesium-navigation-help-zoom{color:#65fd00;font-weight:bold;}.cesium-navigation-help-rotate{color:#ffd800;font-weight:bold;}.cesium-navigation-help-tilt{color:#d800d8;font-weight:bold;}.cesium-navigation-help-details{color:#ffffff;}.cesium-navigation-button{color:#fff;background-color:transparent;border-bottom:none;border-top:1px solid #444;border-right:1px solid #444;margin:0;width:50%;cursor:pointer;}.cesium-navigation-button-icon{vertical-align:middle;padding:5px 1px;}.cesium-navigation-button:focus{outline:none;}.cesium-navigation-button-left{border-radius:10px 0 0 0;border-left:1px solid #444;}.cesium-navigation-button-right{border-radius:0 10px 0 0;border-left:none;}.cesium-navigation-button-selected{background-color:rgba(38,38,38,0.75);}.cesium-navigation-button-unselected{background-color:rgba(0,0,0,0.75);}.cesium-navigation-button-unselected:hover{background-color:rgba(76,76,76,0.75);}.cesium-selection-wrapper{position:absolute;width:160px;height:160px;pointer-events:none;visibility:hidden;opacity:0;-webkit-transition:visibility 0s 0.2s,opacity 0.2s ease-in;-moz-transition:visibility 0s 0.2s,opacity 0.2s ease-in;transition:visibility 0s 0.2s,opacity 0.2s ease-in;}.cesium-selection-wrapper-visible{visibility:visible;opacity:1;-webkit-transition:opacity 0.2s ease-out;-moz-transition:opacity 0.2s ease-out;transition:opacity 0.2s ease-out;}.cesium-selection-wrapper svg{fill:#2e2;stroke:#000;stroke-width:1.1px;}.cesium-timeline-main{position:relative;left:0;bottom:0;overflow:hidden;border:solid 1px #888;}.cesium-timeline-trackContainer{width:100%;overflow:auto;border-top:solid 1px #888;position:relative;top:0;left:0;}.cesium-timeline-tracks{position:absolute;top:0;left:0;width:100%;}.cesium-timeline-needle{position:absolute;left:0;top:1.7em;bottom:0;width:1px;background:#F00;}.cesium-timeline-bar{position:relative;left:0;top:0;overflow:hidden;cursor:pointer;width:100%;height:1.7em;background-color:#fafafa;background:rgba(32,32,32,0.8);background:-moz-linear-gradient(top,rgba(116,117,119,0.8) 0%,rgba(58,68,82,0.8) 11%,rgba(46,50,56,0.8) 46%,rgba(53,53,53,0.8) 81%,rgba(53,53,53,0.8) 100%);background:-webkit-linear-gradient(top,rgba(116,117,119,0.8) 0%,rgba(58,68,82,0.8) 11%,rgba(46,50,56,0.8) 46%,rgba(53,53,53,0.8) 81%,rgba(53,53,53,0.8) 100%);background:linear-gradient(to bottom,rgba(116,117,119,0.8) 0%,rgba(58,68,82,0.8) 11%,rgba(46,50,56,0.8) 46%,rgba(53,53,53,0.8) 81%,rgba(53,53,53,0.8) 100%);}.cesium-timeline-ruler{visibility:hidden;white-space:nowrap;font-size:80%;z-index:-200;}.cesium-timeline-highlight{position:absolute;bottom:0;left:0;background:#08F;}.cesium-timeline-ticLabel{position:absolute;top:0;left:0;white-space:nowrap;font-size:80%;color:#eee;}.cesium-timeline-ticMain{position:absolute;bottom:0;left:0;width:1px;height:50%;background:#eee;}.cesium-timeline-ticSub{position:absolute;bottom:0;left:0;width:1px;height:33%;background:#aaa;}.cesium-timeline-ticTiny{position:absolute;bottom:0;left:0;width:1px;height:25%;background:#888;}.cesium-timeline-icon16{display:block;position:absolute;width:16px;height:16px;background-image:url(Images/TimelineIcons.png);background-repeat:no-repeat;}.cesium-viewer{font-family:sans-serif;font-size:16px;overflow:hidden;display:block;position:relative;top:0;left:0;width:100%;height:100%;}.cesium-viewer-cesiumWidgetContainer{width:100%;height:100%;}.cesium-viewer-bottom{display:block;position:absolute;bottom:0;left:0;right:0;padding-right:5px;}.cesium-viewer .cesium-widget-credits{display:inline;position:static;bottom:auto;left:auto;padding-right:0;color:#ffffff;font-size:10px;text-shadow:0 0 2px #000000;}.cesium-viewer-timelineContainer{position:absolute;bottom:0;left:169px;right:29px;height:27px;padding:0;margin:0;overflow:hidden;font-size:14px;}.cesium-viewer-animationContainer{position:absolute;bottom:0;left:0;padding:0;width:169px;height:112px;}.cesium-viewer-fullscreenContainer{position:absolute;bottom:0;right:0;padding:0;width:29px;height:29px;overflow:hidden;}.cesium-viewer-vrContainer{position:absolute;bottom:0;right:0;padding:0;width:29px;height:29px;overflow:hidden;}.cesium-viewer-toolbar{display:block;position:absolute;top:5px;right:5px;}.cesium-viewer-cesiumInspectorContainer{display:block;position:absolute;top:50px;right:10px;}.cesium-viewer-geocoderContainer{position:relative;display:inline-block;margin:0 3px;} \ No newline at end of file diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/cesiumWorkerBootstrapper.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/cesiumWorkerBootstrapper.js index 558d4a97..76e554bc 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/cesiumWorkerBootstrapper.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/cesiumWorkerBootstrapper.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/combineGeometry.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/combineGeometry.js index 71526ba1..c14f3dd4 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/combineGeometry.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/combineGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,8 +55,8 @@ mersenne-twister.js - https://gist.github.com/banksean/300494 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==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";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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("Core/isArray",["./defined"],function(e){"use strict";var t=Array.isArray;return e(t)||(t=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),t}),define("Core/Check",["./defaultValue","./defined","./DeveloperError","./isArray"],function(e,t,r,n){"use strict";function a(e){return e+" was required but undefined."}function i(e,t,r){return"Expected "+r+" to be typeof "+t+", got "+e}var o={};return o.typeOf={},o.numeric={},o.defined=function(e,n){if(!t(e))throw new r(a(n))},o.numeric.maximum=function(e,t){if(o.typeOf.number(e),o.typeOf.number(t),e>t)throw new r("Expected "+e+" to be at most "+t)},o.numeric.minimum=function(e,t){if(o.typeOf.number(e),o.typeOf.number(t),e<t)throw new r("Expected "+e+" to be at least "+t)},o.typeOf.function=function(e,t){if("function"!=typeof e)throw new r(i(typeof e,"function",t))},o.typeOf.string=function(e,t){if("string"!=typeof e)throw new r(i(typeof e,"string",t))},o.typeOf.number=function(e,t){if("number"!=typeof e)throw new r(i(typeof e,"number",t))},o.typeOf.object=function(e,t){if("object"!=typeof e)throw new r(i(typeof e,"object",t))},o.typeOf.boolean=function(e,t){if("boolean"!=typeof e)throw new r(i(typeof e,"boolean",t))},o}),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^=e<<7&2636928640,e^=e<<15&4022730752,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,r,n){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:e<0?-1:0},a.signNotZero=function(e){return e<0?-1:1},a.toSNorm=function(e,r){return r=t(r,255),Math.round((.5*a.clamp(e,-1,1)+.5)*r)},a.fromSNorm=function(e,r){return r=t(r,255),a.clamp(e,0,r)/r*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t-r)},a.cosh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t+r)},a.lerp=function(e,t,r){return(1-r)*e+r*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){var t=a.TWO_PI,r=e-Math.floor(e/t)*t;return r<-Math.PI?r+t:r>=Math.PI?r-t:r},a.clampToLatitudeRange=function(e){return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){return(e%t+t)%t},a.equalsEpsilon=function(e,r,n,a){a=t(a,n);var i=Math.abs(e-r);return i<=a||i<=n*Math.max(Math.abs(e),Math.abs(r))};var i=[1];a.factorial=function(e){var t=i.length;if(e>=t)for(var r=i[t-1],n=t;n<=e;n++)i.push(r*n);return i[e]},a.incrementWrap=function(e,r,n){return n=t(n,0),++e,e>r&&(e=n),e},a.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,r){return e<t?t:e>r?r:e};var o=new e;return a.setRandomNumberSeed=function(t){o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(e){return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){return Math.log(e)/Math.log(t)},a.fog=function(e,t){var r=e*t;return 1-Math.exp(-(r*r))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i){"use strict";function o(e,r,n){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0)}o.fromSpherical=function(e,n){r(n)||(n=new o);var a=e.clock,i=e.cone,u=t(e.magnitude,1),s=u*Math.sin(i);return n.x=s*Math.cos(a),n.y=s*Math.sin(a),n.z=u*Math.cos(i),n},o.fromElements=function(e,t,n,a){return r(a)?(a.x=e,a.y=t,a.z=n,a):new o(e,t,n)},o.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n]=e.z,r},o.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new o),a.x=e[n++],a.y=e[n++],a.z=e[n],a},o.packArray=function(e,t){var n=e.length;r(t)?t.length=3*n:t=new Array(3*n);for(var a=0;a<n;++a)o.pack(e[a],t,3*a);return t},o.unpackArray=function(e,t){var n=e.length;r(t)?t.length=n/3:t=new Array(n/3);for(var a=0;a<n;a+=3){var i=a/3;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},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},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},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},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},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},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},o.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r.z=e.z/t.z,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},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},o.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*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},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,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};var s=new o;o.lerp=function(e,t,r,n){return o.multiplyByScalar(t,r,s),n=o.multiplyByScalar(e,1-r,n),o.add(s,n,n)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var r=o.dot(c,l),n=o.magnitude(o.cross(c,l,c));return Math.atan2(n,r)};var E=new o;o.mostOrthogonalAxis=function(e,t){var r=o.normalize(e,E);return o.abs(r,r),t=r.x<=r.y?r.x<=r.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):r.y<=r.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},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,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]},o.equalsEpsilon=function(e,t,n,a){return e===t||r(e)&&r(t)&&i.equalsEpsilon(e.x,t.x,n,a)&&i.equalsEpsilon(e.y,t.y,n,a)&&i.equalsEpsilon(e.z,t.z,n,a)},o.cross=function(e,t,r){var n=e.x,a=e.y,i=e.z,o=t.x,u=t.y,s=t.z,c=a*s-i*u,l=i*o-n*s,E=n*u-a*o;return r.x=c,r.y=l,r.z=E,r},o.fromDegrees=function(e,t,r,n,a){return e=i.toRadians(e),t=i.toRadians(t),o.fromRadians(e,t,r,n,a)};var f=new o,h=new o,d=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,n,a,i,u){a=t(a,0);var s=r(i)?i.radiiSquared:d,c=Math.cos(n);f.x=c*Math.cos(e),f.y=c*Math.sin(e),f.z=Math.sin(n),f=o.normalize(f,f),o.multiplyComponents(s,f,h);var l=Math.sqrt(o.dot(f,h));return h=o.divideByScalar(h,l,h),f=o.multiplyByScalar(f,a,f),r(u)||(u=new o),o.add(h,f,u)},o.fromDegreesArray=function(e,t,n){var a=e.length;r(n)?n.length=a/2:n=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;n[c]=o.fromDegrees(u,s,0,t,n[c])}return n},o.fromRadiansArray=function(e,t,n){var a=e.length;r(n)?n.length=a/2:n=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;n[c]=o.fromRadians(u,s,0,t,n[c])}return n},o.fromDegreesArrayHeights=function(e,t,n){var a=e.length;r(n)?n.length=a/3:n=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;n[l]=o.fromDegrees(u,s,c,t,n[l])}return n},o.fromRadiansArrayHeights=function(e,t,n){var a=e.length;r(n)?n.length=a/3:n=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;n[l]=o.fromRadians(u,s,c,t,n[l])}return n},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(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,t,r){return o.equalsEpsilon(this,e,t,r)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,r,n){"use strict";function a(r,a,u,s,c){var l=r.x,E=r.y,f=r.z,h=a.x,d=a.y,p=a.z,m=l*l*h*h,_=E*E*d*d,T=f*f*p*p,y=m+_+T,R=Math.sqrt(1/y),A=e.multiplyByScalar(r,R,i);if(y<s)return isFinite(R)?e.clone(A,c):void 0;var v=u.x,N=u.y,S=u.z,I=o;I.x=A.x*v*2,I.y=A.y*N*2,I.z=A.z*S*2;var M,O,g,C,w,P,x,L,U,b,F,D=(1-R)*e.magnitude(r)/(.5*e.magnitude(I)),B=0;do{D-=B,g=1/(1+D*v),C=1/(1+D*N),w=1/(1+D*S),P=g*g,x=C*C,L=w*w,U=P*g,b=x*C,F=L*w,M=m*P+_*x+T*L-1,O=m*U*v+_*b*N+T*F*S;var z=-2*O;B=M/z}while(Math.abs(M)>n.EPSILON12);return t(c)?(c.x=l*g,c.y=E*C,c.z=f*w,c):new e(l*g,E*C,f*w)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,r,n,a,i,o){"use strict";function u(e,r,n){this.longitude=t(e,0),this.latitude=t(r,0),this.height=t(n,0)}u.fromRadians=function(e,n,a,i){return a=t(a,0),r(i)?(i.longitude=e,i.latitude=n,i.height=a,i):new u(e,n,a)},u.fromDegrees=function(e,t,r,n){return e=i.toRadians(e),t=i.toRadians(t),u.fromRadians(e,t,r,n)};var s=new e,c=new e,l=new e,E=new e(1/6378137,1/6378137,1/6356752.314245179),f=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),h=i.EPSILON1;return u.fromCartesian=function(t,n,a){var d=r(n)?n.oneOverRadii:E,p=r(n)?n.oneOverRadiiSquared:f,m=r(n)?n._centerToleranceSquared:h,_=o(t,d,p,m,c);if(r(_)){var T=e.multiplyComponents(_,p,s);T=e.normalize(T,T);var y=e.subtract(t,_,l),R=Math.atan2(T.y,T.x),A=Math.asin(T.z),v=i.sign(e.dot(y,t))*e.magnitude(y);return r(a)?(a.longitude=R,a.latitude=A,a.height=v,a):new u(R,A,v)}},u.clone=function(e,t){if(r(e))return r(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||r(e)&&r(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n},u.ZERO=a(new u(0,0,0)),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,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),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","./scaleToGeodeticSurface"],function(e,t,r,n,a,i,o,u,s){"use strict";function c(t,n,a,i){n=r(n,0),a=r(a,0),i=r(i,0),t._radii=new e(n,a,i),t._radiiSquared=new e(n*n,a*a,i*i),t._radiiToTheFourth=new e(n*n*n*n,a*a*a*a,i*i*i*i),t._oneOverRadii=new e(0===n?0:1/n,0===a?0:1/a,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===n?0:1/(n*n),0===a?0:1/(a*a),0===i?0:1/(i*i)),t._minimumRadius=Math.min(n,a,i),t._maximumRadius=Math.max(n,a,i),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(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,this._sqauredXOverSquaredZ=void 0,c(this,e,t,r)}a(l.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}}}),l.clone=function(t,r){if(n(t)){var a=t._radii;return n(r)?(e.clone(a,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 l(a.x,a.y,a.z)}},l.fromCartesian3=function(e,t){return n(t)||(t=new l),n(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,n,a){return a=r(a,0),e.pack(t._radii,n,a),n},l.unpack=function(t,n,a){n=r(n,0);var i=e.unpack(t,n);return l.fromCartesian3(i,a)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,r){var a=t.longitude,i=t.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return n(r)||(r=new e),r.x=u,r.y=s,r.z=c,e.normalize(r,r)},l.prototype.geodeticSurfaceNormal=function(t,r){return n(r)||(r=new e),r=e.multiplyComponents(t,this._oneOverRadiiSquared,r),e.normalize(r,r)};var E=new e,f=new e;l.prototype.cartographicToCartesian=function(t,r){var a=E,i=f;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(e.dot(a,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(a,t.height,a),n(r)||(r=new e),e.add(i,a,r)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var a=0;a<r;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var h=new e,d=new e,p=new e;return l.prototype.cartesianToCartographic=function(r,a){var i=this.scaleToGeodeticSurface(r,d);if(n(i)){var o=this.geodeticSurfaceNormal(i,h),s=e.subtract(r,i,p),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),E=u.sign(e.dot(s,r))*e.magnitude(s);return n(a)?(a.longitude=c,a.latitude=l,a.height=E,a):new t(c,l,E)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var a=0;a<r;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,r){n(r)||(r=new e);var a=t.x,i=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return e.multiplyByScalar(t,s,r)},l.prototype.transformPositionToScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._oneOverRadii,r)},l.prototype.transformPositionFromScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._radii,r)},l.prototype.equals=function(t){return this===t||n(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,a,i){a=r(a,0);var o=this._sqauredXOverSquaredZ;if(n(i)||(i=new e),i.x=0,i.y=0,i.z=t.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},l}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,r,n,a,i,o){"use strict";function u(e){this._ellipsoid=r(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,r){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return n(r)?(r.x=i,r.y=o,r.z=u,r):new e(i,o,u)},u.prototype.unproject=function(e,r){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,u=e.z;return n(r)?(r.longitude=i,r.latitude=o,r.height=u,r):new t(i,o,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";function t(t,r){this.start=e(t,0),this.stop=e(r,0)}return t}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i,o){"use strict";function u(e,r,n,a,i,o,u,s,c){this[0]=t(e,0),this[1]=t(a,0),this[2]=t(u,0),this[3]=t(r,0),this[4]=t(i,0),this[5]=t(s,0),this[6]=t(n,0),this[7]=t(o,0),this[8]=t(c,0)}function s(e){for(var t=0,r=0;r<9;++r){var n=e[r];t+=n*n}return Math.sqrt(t)}function c(e){for(var t=0,r=0;r<3;++r){var n=e[u.getElementIndex(d[r],h[r])];t+=2*n*n}return Math.sqrt(t)}function l(e,t){for(var r=o.EPSILON15,n=0,a=1,i=0;i<3;++i){var s=Math.abs(e[u.getElementIndex(d[i],h[i])]);s>n&&(a=i,n=s)}var c=1,l=0,E=h[a],f=d[a];if(Math.abs(e[u.getElementIndex(f,E)])>r){var p,m=e[u.getElementIndex(f,f)],_=e[u.getElementIndex(E,E)],T=e[u.getElementIndex(f,E)],y=(m-_)/2/T;p=y<0?-1/(-y+Math.sqrt(1+y*y)):1/(y+Math.sqrt(1+y*y)),c=1/Math.sqrt(1+p*p),l=p*c}return t=u.clone(u.IDENTITY,t),t[u.getElementIndex(E,E)]=t[u.getElementIndex(f,f)]=c,t[u.getElementIndex(f,E)]=l,t[u.getElementIndex(E,f)]=-l,t}u.packedLength=9,u.pack=function(e,r,n){return 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},u.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new u),a[0]=e[n++],a[1]=e[n++],a[2]=e[n++],a[3]=e[n++],a[4]=e[n++],a[5]=e[n++],a[6]=e[n++],a[7]=e[n++],a[8]=e[n++],a},u.clone=function(e,t){if(r(e))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):new u(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},u.fromArray=function(e,n,a){return n=t(n,0),r(a)||(a=new u),a[0]=e[n],a[1]=e[n+1],a[2]=e[n+2],a[3]=e[n+3],a[4]=e[n+4],a[5]=e[n+5],a[6]=e[n+6],a[7]=e[n+7],a[8]=e[n+8],a},u.fromColumnMajorArray=function(e,t){return u.clone(e,t)},u.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 u(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},u.fromQuaternion=function(e,t){var n=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,s=e.y*e.y,c=e.y*e.z,l=e.y*e.w,E=e.z*e.z,f=e.z*e.w,h=e.w*e.w,d=n-s-E+h,p=2*(a-f),m=2*(i+l),_=2*(a+f),T=-n+s-E+h,y=2*(c-o),R=2*(i-l),A=2*(c+o),v=-n-s+E+h;return r(t)?(t[0]=d,t[1]=_,t[2]=R,t[3]=p,t[4]=T,t[5]=A,t[6]=m,t[7]=y,t[8]=v,t):new u(d,p,m,_,T,y,R,A,v)},u.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),a=Math.cos(-e.heading),i=Math.cos(e.roll),o=Math.sin(-e.pitch),s=Math.sin(-e.heading),c=Math.sin(e.roll),l=n*a,E=-i*s+c*o*a,f=c*s+i*o*a,h=n*s,d=i*a+c*o*s,p=-o*i+i*o*s,m=-o,_=c*n,T=i*n;return r(t)?(t[0]=l,t[1]=h,t[2]=m,t[3]=E,t[4]=d,t[5]=_,t[6]=f,t[7]=p,t[8]=T,t):new u(l,E,f,h,d,p,m,_,T)},u.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 u(e.x,0,0,0,e.y,0,0,0,e.z)},u.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 u(e,0,0,0,e,0,0,0,e)},u.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 u(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},u.fromRotationX=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=a,t[6]=0,t[7]=-a,t[8]=n,t):new u(1,0,0,0,n,-a,0,a,n)},u.fromRotationY=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=n,t):new u(n,0,a,0,1,0,-a,0,n)},u.fromRotationZ=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=a,t[2]=0,t[3]=-a,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new u(n,-a,0,a,n,0,0,0,1)},u.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]]},u.getElementIndex=function(e,t){return 3*e+t},u.getColumn=function(e,t,r){var n=3*t,a=e[n],i=e[n+1],o=e[n+2];return r.x=a,r.y=i,r.z=o,r},u.setColumn=function(e,t,r,n){n=u.clone(e,n);var a=3*t;return n[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n},u.getRow=function(e,t,r){var n=e[t],a=e[t+3],i=e[t+6];return r.x=n,r.y=a,r.z=i,r},u.setRow=function(e,t,r,n){return n=u.clone(e,n),n[t]=r.x,n[t+3]=r.y,n[t+6]=r.z,n};var E=new e;u.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],E)),r.y=e.magnitude(e.fromElements(t[3],t[4],t[5],E)),r.z=e.magnitude(e.fromElements(t[6],t[7],t[8],E)),r};var f=new e;u.getMaximumScale=function(t){return u.getScale(t,f),e.maximumComponent(f)},u.multiply=function(e,t,r){var n=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=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],E=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return r[0]=n,r[1]=a,r[2]=i,r[3]=o,r[4]=u,r[5]=s,r[6]=c,r[7]=l,r[8]=E,r},u.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},u.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},u.multiplyByVector=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=e[0]*n+e[3]*a+e[6]*i,u=e[1]*n+e[4]*a+e[7]*i,s=e[2]*n+e[5]*a+e[8]*i;return r.x=o,r.y=u,r.z=s,r},u.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},u.multiplyByScale=function(e,t,r){return r[0]=e[0]*t.x,r[1]=e[1]*t.x,r[2]=e[2]*t.x,r[3]=e[3]*t.y,r[4]=e[4]*t.y,r[5]=e[5]*t.y,r[6]=e[6]*t.z,r[7]=e[7]*t.z,r[8]=e[8]*t.z,r},u.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},u.transpose=function(e,t){var r=e[0],n=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=r,t[1]=n,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var h=[1,0,0],d=[2,2,1],p=new u,m=new u;return u.computeEigenDecomposition=function(e,t){var n=o.EPSILON20,a=10,i=0,E=0;r(t)||(t={});for(var f=t.unitary=u.clone(u.IDENTITY,t.unitary),h=t.diagonal=u.clone(e,t.diagonal),d=n*s(h);E<a&&c(h)>d;)l(h,p),u.transpose(p,m),u.multiply(h,p,h),u.multiply(m,h,h),u.multiply(f,p,f),++i>2&&(++E,i=0);return t},u.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},u.determinant=function(e){var t=e[0],r=e[3],n=e[6],a=e[1],i=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*o)+a*(s*n-r*c)+u*(r*o-i*n)},u.inverse=function(e,t){var r=e[0],n=e[1],a=e[2],i=e[3],o=e[4],s=e[5],c=e[6],l=e[7],E=e[8],f=u.determinant(e);t[0]=o*E-l*s,t[1]=l*a-n*E,t[2]=n*s-o*a,t[3]=c*s-i*E,t[4]=r*E-c*a,t[5]=i*a-r*s,t[6]=i*l-c*o,t[7]=c*n-r*l,t[8]=r*o-i*n;var h=1/f;return u.multiplyByScalar(t,h,t)},u.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]},u.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},u.IDENTITY=i(new u(1,0,0,0,1,0,0,0,1)),u.ZERO=i(new u(0,0,0,0,0,0,0,0,0)),u.COLUMN0ROW0=0,u.COLUMN0ROW1=1,u.COLUMN0ROW2=2,u.COLUMN1ROW0=3,u.COLUMN1ROW1=4,u.COLUMN1ROW2=5,u.COLUMN2ROW0=6,u.COLUMN2ROW1=7,u.COLUMN2ROW2=8,n(u.prototype,{length:{get:function(){return u.packedLength}}}),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},u}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a){"use strict";function i(t,r,n,a){this.x=e(t,0),this.y=e(r,0),this.z=e(n,0),this.w=e(a,0)}i.fromElements=function(e,r,n,a,o){return t(o)?(o.x=e,o.y=r,o.z=n,o.w=a,o):new i(e,r,n,a)},i.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 i(e.red,e.green,e.blue,e.alpha)},i.clone=function(e,r){if(t(e))return t(r)?(r.x=e.x,r.y=e.y,r.z=e.z,r.w=e.w,r):new i(e.x,e.y,e.z,e.w)},i.packedLength=4,i.pack=function(t,r,n){return n=e(n,0),r[n++]=t.x,r[n++]=t.y,r[n++]=t.z,r[n]=t.w,r},i.unpack=function(r,n,a){return n=e(n,0),t(a)||(a=new i),a.x=r[n++],a.y=r[n++],a.z=r[n++],a.w=r[n],a},i.packArray=function(e,r){var n=e.length;t(r)?r.length=4*n:r=new Array(4*n);for(var a=0;a<n;++a)i.pack(e[a],r,4*a);return r},i.unpackArray=function(e,r){var n=e.length;t(r)?r.length=n/4:r=new Array(n/4);for(var a=0;a<n;a+=4){var o=a/4;r[o]=i.unpack(e,a,r[o])}return r},i.fromArray=i.unpack,i.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},i.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},i.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},i.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},i.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},i.magnitude=function(e){return Math.sqrt(i.magnitudeSquared(e))};var o=new i;i.distance=function(e,t){return i.subtract(e,t,o),i.magnitude(o)},i.distanceSquared=function(e,t){return i.subtract(e,t,o),i.magnitudeSquared(o)},i.normalize=function(e,t){var r=i.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t.z=e.z/r,t.w=e.w/r,t},i.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},i.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},i.divideComponents=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},i.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},i.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},i.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},i.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},i.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},i.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 u=new i;i.lerp=function(e,t,r,n){return i.multiplyByScalar(t,r,u),n=i.multiplyByScalar(e,1-r,n),i.add(u,n,n)};var s=new i;return i.mostOrthogonalAxis=function(e,t){var r=i.normalize(e,s);return i.abs(r,r),t=r.x<=r.y?r.x<=r.z?r.x<=r.w?i.clone(i.UNIT_X,t):i.clone(i.UNIT_W,t):r.z<=r.w?i.clone(i.UNIT_Z,t):i.clone(i.UNIT_W,t):r.y<=r.z?r.y<=r.w?i.clone(i.UNIT_Y,t):i.clone(i.UNIT_W,t):r.z<=r.w?i.clone(i.UNIT_Z,t):i.clone(i.UNIT_W,t)},i.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},i.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]&&e.w===t[r+3]},i.equalsEpsilon=function(e,r,n,i){return e===r||t(e)&&t(r)&&a.equalsEpsilon(e.x,r.x,n,i)&&a.equalsEpsilon(e.y,r.y,n,i)&&a.equalsEpsilon(e.z,r.z,n,i)&&a.equalsEpsilon(e.w,r.w,n,i)},i.ZERO=n(new i(0,0,0,0)),i.UNIT_X=n(new i(1,0,0,0)),i.UNIT_Y=n(new i(0,1,0,0)),i.UNIT_Z=n(new i(0,0,1,0)),i.UNIT_W=n(new i(0,0,0,1)),i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i.prototype.equalsEpsilon=function(e,t,r){return i.equalsEpsilon(this,e,t,r)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},i}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,r,n,a,i,o,u,s,c){"use strict";function l(e,t,n,a,i,o,u,s,c,l,E,f,h,d,p,m){this[0]=r(e,0),this[1]=r(i,0),this[2]=r(c,0),this[3]=r(h,0),this[4]=r(t,0), -this[5]=r(o,0),this[6]=r(l,0),this[7]=r(d,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(E,0),this[11]=r(p,0),this[12]=r(a,0),this[13]=r(s,0),this[14]=r(f,0),this[15]=r(m,0)}l.packedLength=16,l.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},l.unpack=function(e,t,a){return t=r(t,0),n(a)||(a=new l),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a[9]=e[t++],a[10]=e[t++],a[11]=e[t++],a[12]=e[t++],a[13]=e[t++],a[14]=e[t++],a[15]=e[t],a},l.clone=function(e,t){if(n(e))return n(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 l(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])},l.fromArray=l.unpack,l.fromColumnMajorArray=function(e,t){return l.clone(e,t)},l.fromRowMajorArray=function(e,t){return n(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 l(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])},l.fromRotationTranslation=function(t,a,i){return a=r(a,e.ZERO),n(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=a.x,i[13]=a.y,i[14]=a.z,i[15]=1,i):new l(t[0],t[3],t[6],a.x,t[1],t[4],t[7],a.y,t[2],t[5],t[8],a.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(e,t,r,a){n(a)||(a=new l);var i=r.x,o=r.y,u=r.z,s=t.x*t.x,c=t.x*t.y,E=t.x*t.z,f=t.x*t.w,h=t.y*t.y,d=t.y*t.z,p=t.y*t.w,m=t.z*t.z,_=t.z*t.w,T=t.w*t.w,y=s-h-m+T,R=2*(c-_),A=2*(E+p),v=2*(c+_),N=-s+h-m+T,S=2*(d-f),I=2*(E-p),M=2*(d+f),O=-s-h+m+T;return a[0]=y*i,a[1]=v*i,a[2]=I*i,a[3]=0,a[4]=R*o,a[5]=N*o,a[6]=M*o,a[7]=0,a[8]=A*u,a[9]=S*u,a[10]=O*u,a[11]=0,a[12]=e.x,a[13]=e.y,a[14]=e.z,a[15]=1,a},l.fromTranslationRotationScale=function(e,t){return l.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},l.fromTranslation=function(e,t){return l.fromRotationTranslation(s.IDENTITY,e,t)},l.fromScale=function(e,t){return n(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 l(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},l.fromUniformScale=function(e,t){return n(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 l(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var E=new e,f=new e,h=new e;l.fromCamera=function(t,r){var a=t.position,i=t.direction,o=t.up;e.normalize(i,E),e.normalize(e.cross(E,o,f),f),e.normalize(e.cross(f,E,h),h);var u=f.x,s=f.y,c=f.z,d=E.x,p=E.y,m=E.z,_=h.x,T=h.y,y=h.z,R=a.x,A=a.y,v=a.z,N=u*-R+s*-A+c*-v,S=_*-R+T*-A+y*-v,I=d*R+p*A+m*v;return n(r)?(r[0]=u,r[1]=_,r[2]=-d,r[3]=0,r[4]=s,r[5]=T,r[6]=-p,r[7]=0,r[8]=c,r[9]=y,r[10]=-m,r[11]=0,r[12]=N,r[13]=S,r[14]=I,r[15]=1,r):new l(u,s,c,N,_,T,y,S,-d,-p,-m,I,0,0,0,1)},l.computePerspectiveFieldOfView=function(e,t,r,n,a){var i=Math.tan(.5*e),o=1/i,u=o/t,s=(n+r)/(r-n),c=2*n*r/(r-n);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=c,a[15]=0,a},l.computeOrthographicOffCenter=function(e,t,r,n,a,i,o){var u=1/(t-e),s=1/(n-r),c=1/(i-a),l=-(t+e)*u,E=-(n+r)*s,f=-(i+a)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=E,o[14]=f,o[15]=1,o},l.computePerspectiveOffCenter=function(e,t,r,n,a,i,o){var u=2*a/(t-e),s=2*a/(n-r),c=(t+e)/(t-e),l=(n+r)/(n-r),E=-(i+a)/(i-a),f=-1,h=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=E,o[11]=f,o[12]=0,o[13]=0,o[14]=h,o[15]=0,o},l.computeInfinitePerspectiveOffCenter=function(e,t,r,n,a,i){var o=2*a/(t-e),u=2*a/(n-r),s=(t+e)/(t-e),c=(n+r)/(n-r),l=-1,E=-1,f=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=s,i[9]=c,i[10]=l,i[11]=E,i[12]=0,i[13]=0,i[14]=f,i[15]=0,i},l.computeViewportTransformation=function(e,t,n,a){e=r(e,r.EMPTY_OBJECT);var i=r(e.x,0),o=r(e.y,0),u=r(e.width,0),s=r(e.height,0);t=r(t,0),n=r(n,1);var c=.5*u,l=.5*s,E=.5*(n-t),f=c,h=l,d=E,p=i+c,m=o+l,_=t+E,T=1;return a[0]=f,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=h,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=d,a[11]=0,a[12]=p,a[13]=m,a[14]=_,a[15]=T,a},l.computeView=function(t,r,n,a,i){return i[0]=a.x,i[1]=n.x,i[2]=-r.x,i[3]=0,i[4]=a.y,i[5]=n.y,i[6]=-r.y,i[7]=0,i[8]=a.z,i[9]=n.z,i[10]=-r.z,i[11]=0,i[12]=-e.dot(a,t),i[13]=-e.dot(n,t),i[14]=e.dot(r,t),i[15]=1,i},l.toArray=function(e,t){return n(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]]},l.getElementIndex=function(e,t){return 4*e+t},l.getColumn=function(e,t,r){var n=4*t,a=e[n],i=e[n+1],o=e[n+2],u=e[n+3];return r.x=a,r.y=i,r.z=o,r.w=u,r},l.setColumn=function(e,t,r,n){n=l.clone(e,n);var a=4*t;return n[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n[a+3]=r.w,n},l.setTranslation=function(e,t,r){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]=t.x,r[13]=t.y,r[14]=t.z,r[15]=e[15],r},l.getRow=function(e,t,r){var n=e[t],a=e[t+4],i=e[t+8],o=e[t+12];return r.x=n,r.y=a,r.z=i,r.w=o,r},l.setRow=function(e,t,r,n){return n=l.clone(e,n),n[t]=r.x,n[t+4]=r.y,n[t+8]=r.z,n[t+12]=r.w,n};var d=new e;l.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],d)),r.y=e.magnitude(e.fromElements(t[4],t[5],t[6],d)),r.z=e.magnitude(e.fromElements(t[8],t[9],t[10],d)),r};var p=new e;l.getMaximumScale=function(t){return l.getScale(t,p),e.maximumComponent(p)},l.multiply=function(e,t,r){var n=e[0],a=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],E=e[8],f=e[9],h=e[10],d=e[11],p=e[12],m=e[13],_=e[14],T=e[15],y=t[0],R=t[1],A=t[2],v=t[3],N=t[4],S=t[5],I=t[6],M=t[7],O=t[8],g=t[9],C=t[10],w=t[11],P=t[12],x=t[13],L=t[14],U=t[15],b=n*y+u*R+E*A+p*v,F=a*y+s*R+f*A+m*v,D=i*y+c*R+h*A+_*v,B=o*y+l*R+d*A+T*v,z=n*N+u*S+E*I+p*M,G=a*N+s*S+f*I+m*M,V=i*N+c*S+h*I+_*M,q=o*N+l*S+d*I+T*M,X=n*O+u*g+E*C+p*w,H=a*O+s*g+f*C+m*w,W=i*O+c*g+h*C+_*w,Y=o*O+l*g+d*C+T*w,k=n*P+u*x+E*L+p*U,K=a*P+s*x+f*L+m*U,Z=i*P+c*x+h*L+_*U,j=o*P+l*x+d*L+T*U;return r[0]=b,r[1]=F,r[2]=D,r[3]=B,r[4]=z,r[5]=G,r[6]=V,r[7]=q,r[8]=X,r[9]=H,r[10]=W,r[11]=Y,r[12]=k,r[13]=K,r[14]=Z,r[15]=j,r},l.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},l.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},l.multiplyTransformation=function(e,t,r){var n=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],E=e[10],f=e[12],h=e[13],d=e[14],p=t[0],m=t[1],_=t[2],T=t[4],y=t[5],R=t[6],A=t[8],v=t[9],N=t[10],S=t[12],I=t[13],M=t[14],O=n*p+o*m+c*_,g=a*p+u*m+l*_,C=i*p+s*m+E*_,w=n*T+o*y+c*R,P=a*T+u*y+l*R,x=i*T+s*y+E*R,L=n*A+o*v+c*N,U=a*A+u*v+l*N,b=i*A+s*v+E*N,F=n*S+o*I+c*M+f,D=a*S+u*I+l*M+h,B=i*S+s*I+E*M+d;return r[0]=O,r[1]=g,r[2]=C,r[3]=0,r[4]=w,r[5]=P,r[6]=x,r[7]=0,r[8]=L,r[9]=U,r[10]=b,r[11]=0,r[12]=F,r[13]=D,r[14]=B,r[15]=1,r},l.multiplyByMatrix3=function(e,t,r){var n=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],E=e[10],f=t[0],h=t[1],d=t[2],p=t[3],m=t[4],_=t[5],T=t[6],y=t[7],R=t[8],A=n*f+o*h+c*d,v=a*f+u*h+l*d,N=i*f+s*h+E*d,S=n*p+o*m+c*_,I=a*p+u*m+l*_,M=i*p+s*m+E*_,O=n*T+o*y+c*R,g=a*T+u*y+l*R,C=i*T+s*y+E*R;return r[0]=A,r[1]=v,r[2]=N,r[3]=0,r[4]=S,r[5]=I,r[6]=M,r[7]=0,r[8]=O,r[9]=g,r[10]=C,r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r},l.multiplyByTranslation=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=n*e[0]+a*e[4]+i*e[8]+e[12],u=n*e[1]+a*e[5]+i*e[9]+e[13],s=n*e[2]+a*e[6]+i*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]=o,r[13]=u,r[14]=s,r[15]=e[15],r};var m=new e;l.multiplyByUniformScale=function(e,t,r){return m.x=t,m.y=t,m.z=t,l.multiplyByScale(e,m,r)},l.multiplyByScale=function(e,t,r){var n=t.x,a=t.y,i=t.z;return 1===n&&1===a&&1===i?l.clone(e,r):(r[0]=n*e[0],r[1]=n*e[1],r[2]=n*e[2],r[3]=0,r[4]=a*e[4],r[5]=a*e[5],r[6]=a*e[6],r[7]=0,r[8]=i*e[8],r[9]=i*e[9],r[10]=i*e[10],r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=1,r)},l.multiplyByVector=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=t.w,u=e[0]*n+e[4]*a+e[8]*i+e[12]*o,s=e[1]*n+e[5]*a+e[9]*i+e[13]*o,c=e[2]*n+e[6]*a+e[10]*i+e[14]*o,l=e[3]*n+e[7]*a+e[11]*i+e[15]*o;return r.x=u,r.y=s,r.z=c,r.w=l,r},l.multiplyByPointAsVector=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=e[0]*n+e[4]*a+e[8]*i,u=e[1]*n+e[5]*a+e[9]*i,s=e[2]*n+e[6]*a+e[10]*i;return r.x=o,r.y=u,r.z=s,r},l.multiplyByPoint=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=e[0]*n+e[4]*a+e[8]*i+e[12],u=e[1]*n+e[5]*a+e[9]*i+e[13],s=e[2]*n+e[6]*a+e[10]*i+e[14];return r.x=o,r.y=u,r.z=s,r},l.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},l.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},l.transpose=function(e,t){var r=e[1],n=e[2],a=e[3],i=e[6],o=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]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=o,t[14]=u,t[15]=e[15],t},l.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},l.equals=function(e,t){return e===t||n(e)&&n(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},l.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r&&Math.abs(e[9]-t[9])<=r&&Math.abs(e[10]-t[10])<=r&&Math.abs(e[11]-t[11])<=r&&Math.abs(e[12]-t[12])<=r&&Math.abs(e[13]-t[13])<=r&&Math.abs(e[14]-t[14])<=r&&Math.abs(e[15]-t[15])<=r},l.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},l.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};var _=new s,T=new s,y=new t,R=new t(0,0,0,1);return l.inverse=function(e,r){if(s.equalsEpsilon(l.getRotation(e,_),T,u.EPSILON7)&&t.equals(l.getRow(e,3,y),R))return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=0,r[11]=0,r[12]=-e[12],r[13]=-e[13],r[14]=-e[14],r[15]=1,r;var n=e[0],a=e[4],i=e[8],o=e[12],E=e[1],f=e[5],h=e[9],d=e[13],p=e[2],m=e[6],A=e[10],v=e[14],N=e[3],S=e[7],I=e[11],M=e[15],O=A*M,g=v*I,C=m*M,w=v*S,P=m*I,x=A*S,L=p*M,U=v*N,b=p*I,F=A*N,D=p*S,B=m*N,z=O*f+w*h+P*d-(g*f+C*h+x*d),G=g*E+L*h+F*d-(O*E+U*h+b*d),V=C*E+U*f+D*d-(w*E+L*f+B*d),q=x*E+b*f+B*h-(P*E+F*f+D*h),X=g*a+C*i+x*o-(O*a+w*i+P*o),H=O*n+U*i+b*o-(g*n+L*i+F*o),W=w*n+L*a+B*o-(C*n+U*a+D*o),Y=P*n+F*a+D*i-(x*n+b*a+B*i);O=i*d,g=o*h,C=a*d,w=o*f,P=a*h,x=i*f,L=n*d,U=o*E,b=n*h,F=i*E,D=n*f,B=a*E;var k=O*S+w*I+P*M-(g*S+C*I+x*M),K=g*N+L*I+F*M-(O*N+U*I+b*M),Z=C*N+U*S+D*M-(w*N+L*S+B*M),j=x*N+b*S+B*I-(P*N+F*S+D*I),Q=C*A+x*v+g*m-(P*v+O*m+w*A),J=b*v+O*p+U*A-(L*A+F*v+g*p),$=L*m+B*v+w*p-(D*v+C*p+U*m),ee=D*A+P*p+F*m-(b*m+B*A+x*p),te=n*z+a*G+i*V+o*q;if(Math.abs(te)<u.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return te=1/te,r[0]=z*te,r[1]=G*te,r[2]=V*te,r[3]=q*te,r[4]=X*te,r[5]=H*te,r[6]=W*te,r[7]=Y*te,r[8]=k*te,r[9]=K*te,r[10]=Z*te,r[11]=j*te,r[12]=Q*te,r[13]=J*te,r[14]=$*te,r[15]=ee*te,r},l.inverseTransformation=function(e,t){var r=e[0],n=e[1],a=e[2],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],E=e[12],f=e[13],h=e[14],d=-r*E-n*f-a*h,p=-i*E-o*f-u*h,m=-s*E-c*f-l*h;return t[0]=r,t[1]=i,t[2]=s,t[3]=0,t[4]=n,t[5]=o,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=l,t[11]=0,t[12]=d,t[13]=p,t[14]=m,t[15]=1,t},l.IDENTITY=o(new l(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),l.ZERO=o(new l(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN0ROW3=3,l.COLUMN1ROW0=4,l.COLUMN1ROW1=5,l.COLUMN1ROW2=6,l.COLUMN1ROW3=7,l.COLUMN2ROW0=8,l.COLUMN2ROW1=9,l.COLUMN2ROW2=10,l.COLUMN2ROW3=11,l.COLUMN3ROW0=12,l.COLUMN3ROW1=13,l.COLUMN3ROW2=14,l.COLUMN3ROW3=15,a(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]&&e[9]===t[r+9]&&e[10]===t[r+10]&&e[11]===t[r+11]&&e[12]===t[r+12]&&e[13]===t[r+13]&&e[14]===t[r+14]&&e[15]===t[r+15]},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.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]+")"},l}),define("Core/Rectangle",["./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,r,n,a,i,o,u){"use strict";function s(e,r,n,a){this.west=t(e,0),this.south=t(r,0),this.east=t(n,0),this.north=t(a,0)}n(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,r,n){return n=t(n,0),r[n++]=e.west,r[n++]=e.south,r[n++]=e.east,r[n]=e.north,r},s.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new s),a.west=e[n++],a.south=e[n++],a.east=e[n++],a.north=e[n],a},s.computeWidth=function(e){var t=e.east,r=e.west;return t<r&&(t+=u.TWO_PI),t-r},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,n,a,i,o){return e=u.toRadians(t(e,0)),n=u.toRadians(t(n,0)),a=u.toRadians(t(a,0)),i=u.toRadians(t(i,0)),r(o)?(o.west=e,o.south=n,o.east=a,o.north=i,o):new s(e,n,a,i)},s.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE,E=0,f=e.length;E<f;E++){var h=e[E];n=Math.min(n,h.longitude),a=Math.max(a,h.longitude),c=Math.min(c,h.latitude),l=Math.max(l,h.latitude);var d=h.longitude>=0?h.longitude:h.longitude+u.TWO_PI;i=Math.min(i,d),o=Math.max(o,d)}return a-n>o-i&&(n=i,a=o,a>u.PI&&(a-=u.TWO_PI),n>u.PI&&(n-=u.TWO_PI)),r(t)?(t.west=n,t.south=c,t.east=a,t.north=l,t):new s(n,c,a,l)},s.fromCartesianArray=function(e,t,n){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=Number.MAX_VALUE,E=-Number.MAX_VALUE,f=0,h=e.length;f<h;f++){var d=t.cartesianToCartographic(e[f]);a=Math.min(a,d.longitude),i=Math.max(i,d.longitude),l=Math.min(l,d.latitude),E=Math.max(E,d.latitude);var p=d.longitude>=0?d.longitude:d.longitude+u.TWO_PI;o=Math.min(o,p),c=Math.max(c,p)}return i-a>c-o&&(a=o,i=c,i>u.PI&&(i-=u.TWO_PI),a>u.PI&&(a-=u.TWO_PI)),r(n)?(n.west=a,n.south=l,n.east=i,n.north=E,n):new s(a,l,i,E)},s.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.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},s.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},s.validate=function(e){},s.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)},s.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)},s.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)},s.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)},s.center=function(t,n){var a=t.east,i=t.west;a<i&&(a+=u.TWO_PI);var o=u.negativePiToPi(.5*(i+a)),s=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=s,n.height=0,n):new e(o,s)},s.intersection=function(e,t,n){var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.negativePiToPi(Math.max(i,c)),E=u.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&E<=l)){var f=Math.max(e.south,t.south),h=Math.min(e.north,t.north);if(!(f>=h))return r(n)?(n.west=l,n.south=f,n.east=E,n.north=h,n):new s(l,f,E,h)}},s.simpleIntersection=function(e,t,n){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(i>=u||a>=o))return r(n)?(n.west=a,n.south=i,n.east=o,n.north=u,n):new s(a,i,o,u)},s.union=function(e,t,n){r(n)||(n=new s);var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.convertLongitudeRange(Math.min(i,c)),E=u.convertLongitudeRange(Math.max(a,o));return n.west=l,n.south=Math.min(e.south,t.south),n.east=E,n.north=Math.max(e.north,t.north),n},s.expand=function(e,t,n){return r(n)||(n=new s),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},s.contains=function(e,t){var r=t.longitude,n=t.latitude,a=e.west,i=e.east;return i<a&&(i+=u.TWO_PI,r<0&&(r+=u.TWO_PI)),(r>a||u.equalsEpsilon(r,a,u.EPSILON14))&&(r<i||u.equalsEpsilon(r,i,u.EPSILON14))&&n>=e.south&&n<=e.north};var c=new e;return s.subsample=function(e,n,a,o){n=t(n,i.WGS84),a=t(a,0),r(o)||(o=[]);var l=0,E=e.north,f=e.south,h=e.east,d=e.west,p=c;p.height=a,p.longitude=d,p.latitude=E,o[l]=n.cartographicToCartesian(p,o[l]),l++,p.longitude=h,o[l]=n.cartographicToCartesian(p,o[l]),l++,p.latitude=f,o[l]=n.cartographicToCartesian(p,o[l]),l++,p.longitude=d,o[l]=n.cartographicToCartesian(p,o[l]),l++,E<0?p.latitude=E:f>0?p.latitude=f:p.latitude=0;for(var m=1;m<8;++m)p.longitude=-Math.PI+m*u.PI_OVER_TWO,s.contains(e,p)&&(o[l]=n.cartographicToCartesian(p,o[l]),l++);return 0===p.latitude&&(p.longitude=d,o[l]=n.cartographicToCartesian(p,o[l]),l++,p.longitude=h,o[l]=n.cartographicToCartesian(p,o[l]),l++),o.length=l,o},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,r,n,a,i,o,u,s,c,l,E){"use strict";function f(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var h=new e,d=new e,p=new e,m=new e,_=new e,T=new e,y=new e,R=new e,A=new e,v=new e,N=new e,S=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 a=e.clone(t[0],y),i=e.clone(a,h),o=e.clone(a,d),u=e.clone(a,p),s=e.clone(a,m),c=e.clone(a,_),l=e.clone(a,T),E=t.length,I=1;I<E;I++){e.clone(t[I],a);var M=a.x,O=a.y,g=a.z;M<i.x&&e.clone(a,i),M>s.x&&e.clone(a,s),O<o.y&&e.clone(a,o),O>c.y&&e.clone(a,c),g<u.z&&e.clone(a,u),g>l.z&&e.clone(a,l)}var C=e.magnitudeSquared(e.subtract(s,i,R)),w=e.magnitudeSquared(e.subtract(c,o,R)),P=e.magnitudeSquared(e.subtract(l,u,R)),x=i,L=s,U=C;w>U&&(U=w,x=o,L=c),P>U&&(U=P,x=u,L=l);var b=A;b.x=.5*(x.x+L.x),b.y=.5*(x.y+L.y),b.z=.5*(x.z+L.z);var F=e.magnitudeSquared(e.subtract(L,b,R)),D=Math.sqrt(F),B=v;B.x=i.x,B.y=o.y,B.z=u.z;var z=N;z.x=s.x,z.y=c.y,z.z=l.z;var G=e.multiplyByScalar(e.add(B,z,R),.5,S),V=0;for(I=0;I<E;I++){e.clone(t[I],a);var q=e.magnitude(e.subtract(a,G,R));q>V&&(V=q);var X=e.magnitudeSquared(e.subtract(a,b,R));if(X>F){var H=Math.sqrt(X);D=.5*(D+H),F=D*D;var W=H-D;b.x=(D*b.x+W*a.x)/H,b.y=(D*b.y+W*a.y)/H,b.z=(D*b.z+W*a.z)/H}}return D<V?(e.clone(b,r.center),r.radius=D):(e.clone(G,r.center),r.radius=V),r};var I=new o,M=new e,O=new e,g=new t,C=new t;f.fromRectangle2D=function(e,t,r){return f.fromRectangleWithHeights2D(e,t,0,0,r)},f.fromRectangleWithHeights2D=function(t,a,i,o,u){if(n(u)||(u=new f),!n(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;a=r(a,I),E.southwest(t,g),g.height=i,E.northeast(t,C),C.height=o;var s=a.project(g,M),c=a.project(C,O),l=c.x-s.x,h=c.y-s.y,d=c.z-s.z;u.radius=.5*Math.sqrt(l*l+h*h+d*d);var p=u.center;return p.x=s.x+.5*l,p.y=s.y+.5*h,p.z=s.z+.5*d,u};var w=[];f.fromRectangle3D=function(e,t,a,o){t=r(t,i.WGS84),a=r(a,0);var u;return n(e)&&(u=E.subsample(e,t,a,w)),f.fromPoints(u,o)},f.fromVertices=function(t,a,i,o){if(n(o)||(o=new f),!n(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;a=r(a,e.ZERO),i=r(i,3);var u=y;u.x=t[0]+a.x,u.y=t[1]+a.y,u.z=t[2]+a.z;for(var s=e.clone(u,h),c=e.clone(u,d),l=e.clone(u,p),E=e.clone(u,m),I=e.clone(u,_),M=e.clone(u,T),O=t.length,g=0;g<O;g+=i){var C=t[g]+a.x,w=t[g+1]+a.y,P=t[g+2]+a.z;u.x=C,u.y=w,u.z=P,C<s.x&&e.clone(u,s),C>E.x&&e.clone(u,E),w<c.y&&e.clone(u,c),w>I.y&&e.clone(u,I),P<l.z&&e.clone(u,l),P>M.z&&e.clone(u,M)}var x=e.magnitudeSquared(e.subtract(E,s,R)),L=e.magnitudeSquared(e.subtract(I,c,R)),U=e.magnitudeSquared(e.subtract(M,l,R)),b=s,F=E,D=x;L>D&&(D=L,b=c,F=I),U>D&&(D=U,b=l,F=M);var B=A;B.x=.5*(b.x+F.x),B.y=.5*(b.y+F.y),B.z=.5*(b.z+F.z);var z=e.magnitudeSquared(e.subtract(F,B,R)),G=Math.sqrt(z),V=v;V.x=s.x,V.y=c.y,V.z=l.z;var q=N;q.x=E.x,q.y=I.y,q.z=M.z;var X=e.multiplyByScalar(e.add(V,q,R),.5,S),H=0;for(g=0;g<O;g+=i){u.x=t[g]+a.x,u.y=t[g+1]+a.y,u.z=t[g+2]+a.z;var W=e.magnitude(e.subtract(u,X,R));W>H&&(H=W);var Y=e.magnitudeSquared(e.subtract(u,B,R));if(Y>z){var k=Math.sqrt(Y);G=.5*(G+k),z=G*G;var K=k-G;B.x=(G*B.x+K*u.x)/k,B.y=(G*B.y+K*u.y)/k,B.z=(G*B.z+K*u.z)/k}}return G<H?(e.clone(B,o.center),o.radius=G):(e.clone(X,o.center),o.radius=H),o},f.fromEncodedCartesianVertices=function(t,r,a){if(n(a)||(a=new f),!n(t)||!n(r)||t.length!==r.length||0===t.length)return a.center=e.clone(e.ZERO,a.center),a.radius=0,a;var i=y;i.x=t[0]+r[0],i.y=t[1]+r[1],i.z=t[2]+r[2];for(var o=e.clone(i,h),u=e.clone(i,d),s=e.clone(i,p),c=e.clone(i,m),l=e.clone(i,_),E=e.clone(i,T),I=t.length,M=0;M<I;M+=3){var O=t[M]+r[M],g=t[M+1]+r[M+1],C=t[M+2]+r[M+2];i.x=O,i.y=g,i.z=C,O<o.x&&e.clone(i,o),O>c.x&&e.clone(i,c),g<u.y&&e.clone(i,u),g>l.y&&e.clone(i,l),C<s.z&&e.clone(i,s),C>E.z&&e.clone(i,E)}var w=e.magnitudeSquared(e.subtract(c,o,R)),P=e.magnitudeSquared(e.subtract(l,u,R)),x=e.magnitudeSquared(e.subtract(E,s,R)),L=o,U=c,b=w;P>b&&(b=P,L=u,U=l),x>b&&(b=x,L=s,U=E);var F=A;F.x=.5*(L.x+U.x),F.y=.5*(L.y+U.y),F.z=.5*(L.z+U.z);var D=e.magnitudeSquared(e.subtract(U,F,R)),B=Math.sqrt(D),z=v;z.x=o.x,z.y=u.y,z.z=s.z;var G=N;G.x=c.x,G.y=l.y,G.z=E.z;var V=e.multiplyByScalar(e.add(z,G,R),.5,S),q=0;for(M=0;M<I;M+=3){i.x=t[M]+r[M],i.y=t[M+1]+r[M+1],i.z=t[M+2]+r[M+2];var X=e.magnitude(e.subtract(i,V,R));X>q&&(q=X);var H=e.magnitudeSquared(e.subtract(i,F,R));if(H>D){var W=Math.sqrt(H);B=.5*(B+W),D=B*B;var Y=W-B;F.x=(B*F.x+Y*i.x)/W,F.y=(B*F.y+Y*i.y)/W,F.z=(B*F.z+Y*i.z)/W}}return B<q?(e.clone(F,a.center),a.radius=B):(e.clone(V,a.center),a.radius=q),a},f.fromCornerPoints=function(t,r,a){n(a)||(a=new f);var i=a.center;return e.add(t,r,i),e.multiplyByScalar(i,.5,i),a.radius=e.distance(i,r),a},f.fromEllipsoid=function(t,r){return n(r)||(r=new f),e.clone(e.ZERO,r.center),r.radius=t.maximumRadius,r};var P=new e;f.fromBoundingSpheres=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;var a=t.length;if(1===a)return f.clone(t[0],r);if(2===a)return f.union(t[0],t[1],r);for(var i=[],o=0;o<a;o++)i.push(t[o].center);r=f.fromPoints(i,r);var u=r.center,s=r.radius;for(o=0;o<a;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,P)+c.radius)}return r.radius=s,r};var x=new e,L=new e,U=new e;f.fromOrientedBoundingBox=function(t,r){n(r)||(r=new f);var a=t.halfAxes,i=c.getColumn(a,0,x),o=c.getColumn(a,1,L),u=c.getColumn(a,2,U),s=e.magnitude(i),l=e.magnitude(o),E=e.magnitude(u);return r.center=e.clone(t.center,r.center),r.radius=Math.max(s,l,E),r},f.clone=function(t,r){if(n(t))return n(r)?(r.center=e.clone(t.center,r.center),r.radius=t.radius,r):new f(t.center,t.radius)},f.packedLength=4,f.pack=function(e,t,n){n=r(n,0);var a=e.center;return t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n]=e.radius,t},f.unpack=function(e,t,a){t=r(t,0),n(a)||(a=new f);var i=a.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],a.radius=e[t],a};var b=new e,F=new e;f.union=function(t,r,a){n(a)||(a=new f);var i=t.center,o=t.radius,u=r.center,s=r.radius,c=e.subtract(u,i,b),l=e.magnitude(c);if(o>=l+s)return t.clone(a),a;if(s>=l+o)return r.clone(a),a;var E=.5*(o+l+s),h=e.multiplyByScalar(c,(-o+E)/l,F);return e.add(h,i,h),e.clone(h,a.center),a.radius=E,a};var D=new e;f.expand=function(t,r,n){n=f.clone(t,n);var a=e.magnitude(e.subtract(r,n.center,D));return a>n.radius&&(n.radius=a),n},f.intersectPlane=function(t,r){var n=t.center,a=t.radius,i=r.normal,o=e.dot(i,n)+r.distance;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=l.multiplyByPoint(t,e.center,r.center),r.radius=l.getMaximumScale(t)*e.radius,r};var B=new e;f.distanceSquaredTo=function(t,r){var n=e.subtract(t.center,r,B);return e.magnitudeSquared(n)-t.radius*t.radius},f.transformWithoutScale=function(e,t,r){return n(r)||(r=new f),r.center=l.multiplyByPoint(t,e.center,r.center),r.radius=e.radius,r};var z=new e;f.computePlaneDistances=function(t,r,a,i){n(i)||(i=new s);var o=e.subtract(t.center,r,z),u=e.dot(a,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var G=new e,V=new e,q=new e,X=new e,H=new e,W=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var K=new o;return f.projectTo2D=function(t,n,a){n=r(n,K);var i=n.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,G),c=e.cross(e.UNIT_Z,s,V);e.normalize(c,c);var l=e.cross(s,c,q);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var E=e.negate(l,H),h=e.negate(c,X),d=Y,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,E,p),e.add(p,h,p),p=d[3],e.add(s,E,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,E,p),e.add(p,h,p),p=d[7],e.add(s,E,p),e.add(p,c,p);for(var m=d.length,_=0;_<m;++_){var T=d[_];e.add(o,T,T);var y=i.cartesianToCartographic(T,W);n.project(y,T)}a=f.fromPoints(d,a),o=a.center;var R=o.x,A=o.y,v=o.z;return o.x=v,o.y=R,o.z=A,a},f.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},f.equals=function(t,r){return t===r||n(t)&&n(r)&&e.equals(t.center,r.center)&&t.radius===r.radius},f.prototype.intersectPlane=function(e){return f.intersectPlane(this,e)},f.prototype.distanceSquaredTo=function(e){return f.distanceSquaredTo(this,e)},f.prototype.computePlaneDistances=function(e,t,r){return f.computePlaneDistances(this,e,t,r)},f.prototype.isOccluded=function(e){return f.isOccluded(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},a={};return t(a,{element:{get:function(){if(a.supportsFullscreen())return document[n.fullscreenElement]}},changeEventName:{get:function(){if(a.supportsFullscreen())return n.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return n.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[n.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.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 a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(n.requestFullscreen=a,r=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(n.requestFullscreen=a,r=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?n.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(n.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?n.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(n.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?n.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(n.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),n.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),n.fullscreenerror=a)}return r},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[n.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[n.exitFullscreen]()},a}),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;r<n;++r)t[r]=parseInt(t[r],10);return t}function a(){if(!t(A)&&(A=!1,!f())){var e=/ Chrome\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(A=!0,v=n(e[1]))}return A}function i(){return a()&&v}function o(){if(!t(N)&&(N=!1,!a()&&!f()&&/ Safari\/[\.0-9]+/.test(R.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(N=!0,S=n(e[1]))}return N}function u(){return o()&&S}function s(){if(!t(I)){I=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(R.userAgent);null!==e&&(I=!0,M=n(e[1]),M.isNightly=!!e[2])}return I}function c(){return s()&&M}function l(){if(!t(O)){O=!1;var e;"Microsoft Internet Explorer"===R.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(O=!0,g=n(e[1]))):"Netscape"===R.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(O=!0,g=n(e[1])))}return O}function E(){return l()&&g}function f(){if(!t(C)){C=!1;var e=/ Edge\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(C=!0,w=n(e[1]))}return C}function h(){return f()&&w}function d(){if(!t(P)){P=!1;var e=/Firefox\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(P=!0,x=n(e[1]))}return P}function p(){return t(L)||(L=/Windows/i.test(R.appVersion)),L}function m(){return d()&&x}function _(){return t(U)||(U="undefined"!=typeof PointerEvent&&(!t(R.pointerEnabled)||R.pointerEnabled)),U}function T(){ -if(!t(F)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var r=e.style.imageRendering;F=t(r)&&""!==r,F&&(b=r)}return F}function y(){return T()?b:void 0}var R;R="undefined"!=typeof navigator?navigator:{};var A,v,N,S,I,M,O,g,C,w,P,x,L,U,b,F,D={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:E,isEdge:f,edgeVersion:h,isFirefox:d,firefoxVersion:m,isWindows:p,hardwareConcurrency:e(R.hardwareConcurrency,3),supportsPointerEvents:_,supportsImageRenderingPixelated:T,imageRenderingValue:y};return D.supportsFullscreen=function(){return r.supportsFullscreen()},D.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},D.supportsWebWorkers=function(){return"undefined"!=typeof Worker},D}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,r,n,a,i){"use strict";if(!n.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){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.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},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 Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,r,n,a){switch(n=e(n,0),a=e(a,(r.byteLength-n)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(r,n,a);case o.UNSIGNED_BYTE:return new Uint8Array(r,n,a);case o.SHORT:return new Int16Array(r,n,a);case o.UNSIGNED_SHORT:return new Uint16Array(r,n,a);case o.INT:return new Int32Array(r,n,a);case o.UNSIGNED_INT:return new Uint32Array(r,n,a);case o.FLOAT:return new Float32Array(r,n,a);case o.DOUBLE:return new Float64Array(r,n,a)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var r={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,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,t,r,n,a){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,a.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,n.NONE),this.boundingSphereCV=t.boundingSphereCV}return i.computeNumberOfVertices=function(e){var r=-1;for(var n in e.attributes)if(e.attributes.hasOwnProperty(n)&&t(e.attributes[n])&&t(e.attributes[n].values)){var a=e.attributes[n],i=a.values.length/a.componentsPerAttribute;r=i}return r},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(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 n}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.binormal=t.binormal,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/Cartesian2",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a){"use strict";function i(t,r){this.x=e(t,0),this.y=e(r,0)}i.fromElements=function(e,r,n){return t(n)?(n.x=e,n.y=r,n):new i(e,r)},i.clone=function(e,r){if(t(e))return t(r)?(r.x=e.x,r.y=e.y,r):new i(e.x,e.y)},i.fromCartesian3=i.clone,i.fromCartesian4=i.clone,i.packedLength=2,i.pack=function(t,r,n){return n=e(n,0),r[n++]=t.x,r[n]=t.y,r},i.unpack=function(r,n,a){return n=e(n,0),t(a)||(a=new i),a.x=r[n++],a.y=r[n],a},i.packArray=function(e,r){var n=e.length;t(r)?r.length=2*n:r=new Array(2*n);for(var a=0;a<n;++a)i.pack(e[a],r,2*a);return r},i.unpackArray=function(e,r){var n=e.length;t(r)?r.length=n/2:r=new Array(n/2);for(var a=0;a<n;a+=2){var o=a/2;r[o]=i.unpack(e,a,r[o])}return r},i.fromArray=i.unpack,i.maximumComponent=function(e){return Math.max(e.x,e.y)},i.minimumComponent=function(e){return Math.min(e.x,e.y)},i.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r},i.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r},i.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},i.magnitude=function(e){return Math.sqrt(i.magnitudeSquared(e))};var o=new i;i.distance=function(e,t){return i.subtract(e,t,o),i.magnitude(o)},i.distanceSquared=function(e,t){return i.subtract(e,t,o),i.magnitudeSquared(o)},i.normalize=function(e,t){var r=i.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t},i.dot=function(e,t){return e.x*t.x+e.y*t.y},i.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r},i.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r},i.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r},i.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r},i.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r},i.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r},i.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},i.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var u=new i;i.lerp=function(e,t,r,n){return i.multiplyByScalar(t,r,u),n=i.multiplyByScalar(e,1-r,n),i.add(u,n,n)};var s=new i,c=new i;i.angleBetween=function(e,t){return i.normalize(e,s),i.normalize(t,c),a.acosClamped(i.dot(s,c))};var l=new i;return i.mostOrthogonalAxis=function(e,t){var r=i.normalize(e,l);return i.abs(r,r),t=r.x<=r.y?i.clone(i.UNIT_X,t):i.clone(i.UNIT_Y,t)},i.equals=function(e,r){return e===r||t(e)&&t(r)&&e.x===r.x&&e.y===r.y},i.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]},i.equalsEpsilon=function(e,r,n,i){return e===r||t(e)&&t(r)&&a.equalsEpsilon(e.x,r.x,n,i)&&a.equalsEpsilon(e.y,r.y,n,i)},i.ZERO=n(new i(0,0)),i.UNIT_X=n(new i(1,0)),i.UNIT_Y=n(new i(0,1)),i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i.prototype.equalsEpsilon=function(e,t,r){return i.equalsEpsilon(this,e,t,r)},i.prototype.toString=function(){return"("+this.x+", "+this.y+")"},i}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,r,n,a){"use strict";var i={};i.octEncodeInRange=function(e,t,r){if(r.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),r.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var n=r.x,i=r.y;r.x=(1-Math.abs(i))*a.signNotZero(n),r.y=(1-Math.abs(n))*a.signNotZero(i)}return r.x=a.toSNorm(r.x,t),r.y=a.toSNorm(r.y,t),r},i.octEncode=function(e,t){return i.octEncodeInRange(e,255,t)},i.octDecodeInRange=function(e,r,n,i){if(i.x=a.fromSNorm(e,n),i.y=a.fromSNorm(r,n),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){var o=i.x;i.x=(1-Math.abs(i.y))*a.signNotZero(o),i.y=(1-Math.abs(o))*a.signNotZero(i.y)}return t.normalize(i,i)},i.octDecode=function(e,t,r){return i.octDecodeInRange(e,t,255,r)},i.octPackFloat=function(e){return 256*e.x+e.y};var o=new e;return i.octEncodeFloat=function(e){return i.octEncode(e,o),i.octPackFloat(o)},i.octDecodeFloat=function(e,t){var r=e/256,n=Math.floor(r),a=256*(r-n);return i.octDecode(n,a,t)},i.octPack=function(e,t,r,n){var a=i.octEncodeFloat(e),u=i.octEncodeFloat(t),s=i.octEncode(r,o);return n.x=65536*s.x+a,n.y=65536*s.y+u,n},i.octUnpack=function(e,t,r,n){var a=e.x/65536,o=Math.floor(a),u=65536*(a-o);a=e.y/65536;var s=Math.floor(a),c=65536*(a-s);i.octDecodeFloat(u,t),i.octDecodeFloat(c,r),i.octDecode(o,s,n)},i.compressTextureCoordinates=function(e){var t=4095*e.x|0,r=4095*e.y|0;return 4096*t+r},i.decompressTextureCoordinates=function(e,t){var r=e/4096,n=Math.floor(r);return t.x=n/4095,t.y=(e-4096*n)/4095,t},i}),define("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function a(n,a,s,c,l){r(l)||(l=new t);var E,f,h,d,p,m,_,T;r(a.z)?(E=t.subtract(s,a,i),f=t.subtract(c,a,o),h=t.subtract(n,a,u),d=t.dot(E,E),p=t.dot(E,f),m=t.dot(E,h),_=t.dot(f,f),T=t.dot(f,h)):(E=e.subtract(s,a,i),f=e.subtract(c,a,o),h=e.subtract(n,a,u),d=e.dot(E,E),p=e.dot(E,f),m=e.dot(E,h),_=e.dot(f,f),T=e.dot(f,h));var y=1/(d*_-p*p);return l.y=(_*m-p*T)*y,l.z=(d*T-p*m)*y,l.x=1-l.y-l.z,l}var i=new t,o=new t,u=new t;return a}),define("Core/EncodedCartesian3",["./Cartesian3","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(){this.high=e.clone(e.ZERO),this.low=e.clone(e.ZERO)}n.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 a={high:0,low:0};n.fromCartesian=function(e,r){t(r)||(r=new n);var i=r.high,o=r.low;return n.encode(e.x,a),i.x=a.high,o.x=a.low,n.encode(e.y,a),i.y=a.high,o.y=a.low,n.encode(e.z,a),i.z=a.high,o.z=a.low,r};var i=new n;return n.writeElements=function(e,t,r){n.fromCartesian(e,i);var a=i.high,o=i.low;t[r]=a.x,t[r+1]=a.y,t[r+2]=a.z,t[r+3]=o.x,t[r+4]=o.y,t[r+5]=o.z},n}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,r,n,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(e){switch(e){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(t){return e(t)&&(t===i.UNSIGNED_BYTE||t===i.UNSIGNED_SHORT||t===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,r,a){return e>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,r,a):new Uint16Array(t,r,a)},r(i)}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function r(e,r,n){var a=e+r;return t.sign(e)!==t.sign(r)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(r)))<n?0:a}var n={};return n.computeDiscriminant=function(e,t,r){var n=t*t-4*e*r;return n},n.computeRealRoots=function(e,n,a){var i;if(0===e)return 0===n?[]:[-a/n];if(0===n){if(0===a)return[0,0];var o=Math.abs(a),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,i<0)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-n/e,i<0?[i,0]:[0,i];var c=n*n,l=4*e*a,E=r(c,-l,t.EPSILON14);if(E<0)return[];var f=-.5*r(n,t.sign(n)*Math.sqrt(E),t.EPSILON14);return n>0?[f/e,a/f]:[a/f,f/e]},n}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function r(e,t,r,n){var a,i,o=e,u=t/3,s=r/3,c=n,l=o*s,E=u*c,f=u*u,h=s*s,d=o*s-f,p=o*c-u*s,m=u*c-h,_=4*d*m-p*p;if(_<0){var T,y,R;f*E>=l*h?(T=o,y=d,R=-2*u*d+o*p):(T=c,y=m,R=-c*p+2*s*m);var A=R<0?-1:1,v=-A*Math.abs(T)*Math.sqrt(-_);i=-R+v;var N=i/2,S=N<0?-Math.pow(-N,1/3):Math.pow(N,1/3),I=i===v?-S:-y/S;return a=y<=0?S+I:-R/(S*S+I*I+y),f*E>=l*h?[(a-u)/o]:[-c/(a+s)]}var M=d,O=-2*u*d+o*p,g=m,C=-c*p+2*s*m,w=Math.sqrt(_),P=Math.sqrt(3)/2,x=Math.abs(Math.atan2(o*w,-O)/3);a=2*Math.sqrt(-M);var L=Math.cos(x);i=a*L;var U=a*(-L/2-P*Math.sin(x)),b=i+U>2*u?i-u:U-u,F=o,D=b/F;x=Math.abs(Math.atan2(c*w,-C)/3),a=2*Math.sqrt(-g),L=Math.cos(x),i=a*L,U=a*(-L/2-P*Math.sin(x));var B=-c,z=i+U<2*s?i+s:U+s,G=B/z,V=F*z,q=-b*z-F*B,X=b*B,H=(s*q-u*X)/(-u*q+s*V);return D<=H?D<=G?H<=G?[D,H,G]:[D,G,H]:[G,D,H]:D<=G?[H,D,G]:H<=G?[H,G,D]:[G,H,D]}var n={};return n.computeDiscriminant=function(e,t,r,n){var a=e*e,i=t*t,o=r*r,u=n*n,s=18*e*t*r*n+i*o-27*a*u-4*(e*o*r+i*t*n);return s},n.computeRealRoots=function(e,n,a,i){var o,u;if(0===e)return t.computeRealRoots(n,a,i);if(0===n){if(0===a){if(0===i)return[0,0,0];u=-i/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===i?(o=t.computeRealRoots(e,0,a),0===o.Length?[0]:[o[0],0,o[1]]):r(e,0,a,i)}return 0===a?0===i?(u=-n/e,u<0?[u,0,0]:[0,0,u]):r(e,n,0,i):0===i?(o=t.computeRealRoots(e,n,a),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):r(e,n,a,i)},n}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,r,n){"use strict";function a(t,a,i,o){var u=t*t,s=a-3*u/8,c=i-a*t/2+u*t/8,l=o-i*t/4+a*u/16-3*u*u/256,E=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(E.length>0){var f=-t/4,h=E[E.length-1];if(Math.abs(h)<r.EPSILON14){var d=n.computeRealRoots(1,s,l);if(2===d.length){var p,m=d[0],_=d[1];if(m>=0&&_>=0){var T=Math.sqrt(m),y=Math.sqrt(_);return[f-y,f-T,f+T,f+y]}if(m>=0&&_<0)return p=Math.sqrt(m),[f-p,f+p];if(m<0&&_>=0)return p=Math.sqrt(_),[f-p,f+p]}return[]}if(h>0){var R=Math.sqrt(h),A=(s+h-c/R)/2,v=(s+h+c/R)/2,N=n.computeRealRoots(1,R,A),S=n.computeRealRoots(1,-R,v);return 0!==N.length?(N[0]+=f,N[1]+=f,0!==S.length?(S[0]+=f,S[1]+=f,N[1]<=S[0]?[N[0],N[1],S[0],S[1]]:S[1]<=N[0]?[S[0],S[1],N[0],N[1]]:N[0]>=S[0]&&N[1]<=S[1]?[S[0],N[0],N[1],S[1]]:S[0]>=N[0]&&S[1]<=N[1]?[N[0],S[0],S[1],N[1]]:N[0]>S[0]&&N[0]<S[1]?[S[0],N[0],S[1],N[1]]:[N[0],S[0],N[1],S[1]]):N):0!==S.length?(S[0]+=f,S[1]+=f,S):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,E=i*t+s-4*o,f=c*o-i*a*t+u,h=e.computeRealRoots(1,l,E,f);if(h.length>0){var d,p,m=h[0],_=a-m,T=_*_,y=t/2,R=_/2,A=T-4*o,v=T+4*Math.abs(o),N=c-4*m,S=c+4*Math.abs(m);if(m<0||A*S<N*v){var I=Math.sqrt(N);d=I/2,p=0===I?0:(t*R-i)/I}else{var M=Math.sqrt(A);d=0===M?0:(t*R-i)/M,p=M/2}var O,g;0===y&&0===d?(O=0,g=0):r.sign(y)===r.sign(d)?(O=y+d,g=m/O):(g=y-d,O=m/g);var C,w;0===R&&0===p?(C=0,w=0):r.sign(R)===r.sign(p)?(C=R+p,w=o/C):(w=R-p,C=o/w);var P=n.computeRealRoots(1,O,C),x=n.computeRealRoots(1,g,w);if(0!==P.length)return 0!==x.length?P[1]<=x[0]?[P[0],P[1],x[0],x[1]]:x[1]<=P[0]?[x[0],x[1],P[0],P[1]]:P[0]>=x[0]&&P[1]<=x[1]?[x[0],P[0],P[1],x[1]]:x[0]>=P[0]&&x[1]<=P[1]?[P[0],x[0],x[1],P[1]]:P[0]>x[0]&&P[0]<x[1]?[x[0],P[0],x[1],P[1]]:[P[0],x[0],P[1],x[1]]:P;if(0!==x.length)return x}return[]}var o={};return o.computeDiscriminant=function(e,t,r,n,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=r*r,l=c*r,E=n*n,f=E*n,h=a*a,d=h*a,p=u*c*E-4*s*f-4*e*l*E+18*e*t*r*f-27*i*E*E+256*o*d+a*(18*s*r*n-4*u*l+16*e*c*c-80*e*t*c*n-6*e*u*E+144*i*r*E)+h*(144*e*u*r-27*u*u-128*i*c-192*i*t*n);return p},o.computeRealRoots=function(t,n,o,u,s){if(Math.abs(t)<r.EPSILON15)return e.computeRealRoots(n,o,u,s);var c=n/t,l=o/t,E=u/t,f=s/t,h=c<0?1:0;switch(h+=l<0?h+1:h,h+=E<0?h+1:h,h+=f<0?h+1:h){case 0:return a(c,l,E,f);case 1:return i(c,l,E,f);case 2:return i(c,l,E,f);case 3:return a(c,l,E,f);case 4:return a(c,l,E,f);case 5:return i(c,l,E,f);case 6:return a(c,l,E,f);case 7:return a(c,l,E,f);case 8:return i(c,l,E,f);case 9:return a(c,l,E,f);case 10:return a(c,l,E,f);case 11:return i(c,l,E,f);case 12:return a(c,l,E,f);case 13:return a(c,l,E,f);case 14:return a(c,l,E,f);case 15:return a(c,l,E,f);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function a(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 a.getPoint=function(t,n,a){return r(a)||(a=new e),a=e.multiplyByScalar(t.direction,n,a),e.add(t.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,r,n,a,i,o,u,s,c){"use strict";function l(e,t,r,n){var a=t*t-4*e*r;if(!(a<0)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return u<s?(n.root0=u,n.root1=s):(n.root0=s,n.root1=u),n}var c=-t/(2*e);if(0!==c)return n.root0=n.root1=c,n}}function E(t,r,a){n(a)||(a={});var i=t.origin,o=t.direction,u=r.center,s=r.radius*r.radius,c=e.subtract(i,u,_),E=e.dot(o,o),f=2*e.dot(o,c),h=e.magnitudeSquared(c)-s,d=l(E,f,h,A);if(n(d))return a.start=d.root0,a.stop=d.root1,a}function f(e,t,r){var n=e+t;return i.sign(e)!==i.sign(t)&&Math.abs(n/Math.max(Math.abs(e),Math.abs(t)))<r?0:n}function h(t,r,n,a,c){var l,E=a*a,h=c*c,d=(t[o.COLUMN1ROW1]-t[o.COLUMN2ROW2])*h,p=c*(a*f(t[o.COLUMN1ROW0],t[o.COLUMN0ROW1],i.EPSILON15)+r.y),m=t[o.COLUMN0ROW0]*E+t[o.COLUMN2ROW2]*h+a*r.x+n,_=h*f(t[o.COLUMN2ROW1],t[o.COLUMN1ROW2],i.EPSILON15),T=c*(a*f(t[o.COLUMN2ROW0],t[o.COLUMN0ROW2])+r.z),y=[];if(0===T&&0===_){if(l=u.computeRealRoots(d,p,m),0===l.length)return y;var R=l[0],A=Math.sqrt(Math.max(1-R*R,0));if(y.push(new e(a,c*R,c*-A)),y.push(new e(a,c*R,c*A)),2===l.length){var v=l[1],N=Math.sqrt(Math.max(1-v*v,0));y.push(new e(a,c*v,c*-N)),y.push(new e(a,c*v,c*N))}return y}var S=T*T,I=_*_,M=d*d,O=T*_,g=M+I,C=2*(p*d+O),w=2*m*d+p*p-I+S,P=2*(m*p-O),x=m*m-S;if(0===g&&0===C&&0===w&&0===P)return y;l=s.computeRealRoots(g,C,w,P,x);var L=l.length;if(0===L)return y;for(var U=0;U<L;++U){var b,F=l[U],D=F*F,B=Math.max(1-D,0),z=Math.sqrt(B);b=i.sign(d)===i.sign(m)?f(d*D+m,p*F,i.EPSILON12):i.sign(m)===i.sign(p*F)?f(d*D,p*F+m,i.EPSILON12):f(d*D+p*F,m,i.EPSILON12);var G=f(_*F,T,i.EPSILON15),V=b*G;V<0?y.push(new e(a,c*F,c*z)):V>0?y.push(new e(a,c*F,c*-z)):0!==z?(y.push(new e(a,c*F,c*-z)),y.push(new e(a,c*F,c*z)), -++U):y.push(new e(a,c*F,c*z))}return y}var d={};d.rayPlane=function(t,r,a){n(a)||(a=new e);var o=t.origin,u=t.direction,s=r.normal,c=e.dot(s,u);if(!(Math.abs(c)<i.EPSILON15)){var l=(-r.distance-e.dot(s,o))/c;if(!(l<0))return a=e.multiplyByScalar(u,l,a),e.add(o,a,a)}};var p=new e,m=new e,_=new e,T=new e,y=new e;d.rayTriangleParametric=function(t,n,a,o,u){u=r(u,!1);var s,c,l,E,f,h=t.origin,d=t.direction,R=e.subtract(a,n,p),A=e.subtract(o,n,m),v=e.cross(d,A,_),N=e.dot(R,v);if(u){if(N<i.EPSILON6)return;if(s=e.subtract(h,n,T),l=e.dot(s,v),l<0||l>N)return;if(c=e.cross(s,R,y),E=e.dot(d,c),E<0||l+E>N)return;f=e.dot(A,c)/N}else{if(Math.abs(N)<i.EPSILON6)return;var S=1/N;if(s=e.subtract(h,n,T),l=e.dot(s,v)*S,l<0||l>1)return;if(c=e.cross(s,R,y),E=e.dot(d,c)*S,E<0||l+E>1)return;f=e.dot(A,c)*S}return f},d.rayTriangle=function(t,r,a,i,o,u){var s=d.rayTriangleParametric(t,r,a,i,o);if(n(s)&&!(s<0))return n(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var R=new c;d.lineSegmentTriangle=function(t,r,a,i,o,u,s){var c=R;e.clone(t,c.origin),e.subtract(r,t,c.direction),e.normalize(c.direction,c.direction);var l=d.rayTriangleParametric(c,a,i,o,u);if(!(!n(l)||l<0||l>e.distance(t,r)))return n(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var A={root0:0,root1:0};d.raySphere=function(e,t,r){if(r=E(e,t,r),n(r)&&!(r.stop<0))return r.start=Math.max(r.start,0),r};var v=new c;d.lineSegmentSphere=function(t,r,a,i){var o=v;e.clone(t,o.origin);var u=e.subtract(r,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),i=E(o,a,i),!(!n(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var N=new e,S=new e;d.rayEllipsoid=function(t,r){var n,a,i,o,u,s=r.oneOverRadii,c=e.multiplyComponents(s,t.origin,N),l=e.multiplyComponents(s,t.direction,S),E=e.magnitudeSquared(c),f=e.dot(c,l);if(E>1){if(f>=0)return;var h=f*f;if(n=E-1,a=e.magnitudeSquared(l),i=a*n,h<i)return;if(h>i){o=f*f-i,u=-f+Math.sqrt(o);var d=u/a,p=n/u;return d<p?{start:d,stop:p}:{start:p,stop:d}}var m=Math.sqrt(n/a);return{start:m,stop:m}}return E<1?(n=E-1,a=e.magnitudeSquared(l),i=a*n,o=f*f-i,u=-f+Math.sqrt(o),{start:0,stop:u/a}):f<0?(a=e.magnitudeSquared(l),{start:0,stop:-f/a}):void 0};var I=new e,M=new e,O=new e,g=new e,C=new e,w=new o,P=new o,x=new o,L=new o,U=new o,b=new o,F=new o,D=new e,B=new e,z=new t;d.grazingAltitudeLocation=function(t,r){var a=t.origin,u=t.direction;if(!e.equals(a,e.ZERO)){var s=r.geodeticSurfaceNormal(a,I);if(e.dot(u,s)>=0)return a}var c=n(this.rayEllipsoid(t,r)),l=r.transformPositionToScaledSpace(u,I),E=e.normalize(l,l),f=e.mostOrthogonalAxis(l,g),d=e.normalize(e.cross(f,E,M),M),p=e.normalize(e.cross(E,d,O),O),m=w;m[0]=E.x,m[1]=E.y,m[2]=E.z,m[3]=d.x,m[4]=d.y,m[5]=d.z,m[6]=p.x,m[7]=p.y,m[8]=p.z;var _=o.transpose(m,P),T=o.fromScale(r.radii,x),y=o.fromScale(r.oneOverRadii,L),R=U;R[0]=0,R[1]=-u.z,R[2]=u.y,R[3]=u.z,R[4]=0,R[5]=-u.x,R[6]=-u.y,R[7]=u.x,R[8]=0;var A,v,N=o.multiply(o.multiply(_,y,b),R,b),S=o.multiply(o.multiply(N,T,F),m,F),G=o.multiplyByVector(N,a,C),V=h(S,e.negate(G,I),0,0,1),q=V.length;if(q>0){for(var X=e.clone(e.ZERO,B),H=Number.NEGATIVE_INFINITY,W=0;W<q;++W){A=o.multiplyByVector(T,o.multiplyByVector(m,V[W],D),D);var Y=e.normalize(e.subtract(A,a,g),g),k=e.dot(Y,u);k>H&&(H=k,X=e.clone(A,X))}var K=r.cartesianToCartographic(X,z);return H=i.clamp(H,0,1),v=e.magnitude(e.subtract(X,a,g))*Math.sqrt(1-H*H),v=c?-v:v,K.height=v,r.cartographicToCartesian(K,new e)}};var G=new e;return d.lineSegmentPlane=function(t,r,a,o){n(o)||(o=new e);var u=e.subtract(r,t,G),s=a.normal,c=e.dot(s,u);if(!(Math.abs(c)<i.EPSILON6)){var l=e.dot(s,t),E=-(a.distance+l)/c;if(!(E<0||E>1))return e.multiplyByScalar(u,E,o),e.add(t,o,o),o}},d.trianglePlaneIntersection=function(t,r,n,a){var i=a.normal,o=a.distance,u=e.dot(i,t)+o<0,s=e.dot(i,r)+o<0,c=e.dot(i,n)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var E,f;if(1!==l&&2!==l||(E=new e,f=new e),1===l){if(u)return d.lineSegmentPlane(t,r,a,E),d.lineSegmentPlane(t,n,a,f),{positions:[t,r,n,E,f],indices:[0,3,4,1,2,4,1,4,3]};if(s)return d.lineSegmentPlane(r,n,a,E),d.lineSegmentPlane(r,t,a,f),{positions:[t,r,n,E,f],indices:[1,3,4,2,0,4,2,4,3]};if(c)return d.lineSegmentPlane(n,t,a,E),d.lineSegmentPlane(n,r,a,f),{positions:[t,r,n,E,f],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return d.lineSegmentPlane(r,t,a,E),d.lineSegmentPlane(n,t,a,f),{positions:[t,r,n,E,f],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return d.lineSegmentPlane(n,r,a,E),d.lineSegmentPlane(t,r,a,f),{positions:[t,r,n,E,f],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return d.lineSegmentPlane(t,n,a,E),d.lineSegmentPlane(r,n,a,f),{positions:[t,r,n,E,f],indices:[0,1,4,0,4,3,2,3,4]}}},d}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,r,n){"use strict";function a(t,r){this.normal=e.clone(t),this.distance=r}a.fromPointNormal=function(r,n,i){var o=-e.dot(n,r);return t(i)?(e.clone(n,i.normal),i.distance=o,i):new a(n,o)};var i=new e;return a.fromCartesian4=function(r,n){var o=e.fromCartesian4(r,i),u=r.w;return t(n)?(e.clone(o,n.normal),n.distance=u,n):new a(o,u)},a.getPointDistance=function(t,r){return e.dot(t.normal,r)+t.distance},a.ORIGIN_XY_PLANE=n(new a(e.UNIT_Z,0)),a.ORIGIN_YZ_PLANE=n(new a(e.UNIT_X,0)),a.ORIGIN_ZX_PLANE=n(new a(e.UNIT_Y,0)),a}),define("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";var n={};return n.calculateACMR=function(r){r=e(r,e.EMPTY_OBJECT);var n=r.indices,a=r.maximumIndex,i=e(r.cacheSize,24),o=n.length;if(!t(a)){a=0;for(var u=0,s=n[u];u<o;)s>a&&(a=s),++u,s=n[u]}for(var c=[],l=0;l<a+1;l++)c[l]=0;for(var E=i+1,f=0;f<o;++f)E-c[n[f]]>i&&(c[n[f]]=E,++E);return(E-i+1)/(o/3)},n.tipsify=function(r){function n(e,t,r,n){for(;t.length>=1;){var a=t[t.length-1];if(t.splice(t.length-1,1),e[a].numLiveTriangles>0)return a}for(;i<n;){if(e[i].numLiveTriangles>0)return++i,i-1;++i}return-1}function a(e,t,r,a,i,o,u){for(var s,c=-1,l=-1,E=0;E<r.length;){var f=r[E];a[f].numLiveTriangles&&(s=0,i-a[f].timeStamp+2*a[f].numLiveTriangles<=t&&(s=i-a[f].timeStamp),(s>l||l===-1)&&(l=s,c=f)),++E}return c===-1?n(a,o,e,u):c}r=e(r,e.EMPTY_OBJECT);var i,o=r.indices,u=r.maximumIndex,s=e(r.cacheSize,24),c=o.length,l=0,E=0,f=o[E],h=c;if(t(u))l=u+1;else{for(;E<h;)f>l&&(l=f),++E,f=o[E];if(l===-1)return 0;++l}for(var d=[],p=0;p<l;p++)d[p]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};E=0;for(var m=0;E<h;)d[o[E]].vertexTriangles.push(m),++d[o[E]].numLiveTriangles,d[o[E+1]].vertexTriangles.push(m),++d[o[E+1]].numLiveTriangles,d[o[E+2]].vertexTriangles.push(m),++d[o[E+2]].numLiveTriangles,++m,E+=3;var _=0,T=s+1;i=1;var y,R,A=[],v=[],N=0,S=[],I=c/3,M=[];for(p=0;p<I;p++)M[p]=!1;for(var O,g;_!==-1;){A=[],R=d[_],g=R.vertexTriangles.length;for(var C=0;C<g;++C)if(m=R.vertexTriangles[C],!M[m]){M[m]=!0,E=m+m+m;for(var w=0;w<3;++w)O=o[E],A.push(O),v.push(O),S[N]=O,++N,y=d[O],--y.numLiveTriangles,T-y.timeStamp>s&&(y.timeStamp=T,++T),++E}_=a(o,s,A,d,T,v,l)}return S},n}),define("Core/GeometryPipeline",["./AttributeCompression","./barycentricCoordinates","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EncodedCartesian3","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryType","./IndexDatatype","./Intersect","./IntersectionTests","./Math","./Matrix3","./Matrix4","./Plane","./PrimitiveType","./Tipsify"],function(e,t,r,n,a,i,o,u,s,c,l,E,f,h,d,p,m,_,T,y,R,A,v,N,S){"use strict";function I(e,t,r,n,a){e[t++]=r,e[t++]=n,e[t++]=n,e[t++]=a,e[t++]=a,e[t]=r}function M(e){for(var t=e.length,r=t/3*6,n=m.createTypedArray(t,r),a=0,i=0;i<t;i+=3,a+=6)I(n,a,e[i],e[i+1],e[i+2]);return n}function O(e){var t=e.length;if(t>=3){var r=6*(t-2),n=m.createTypedArray(t,r);I(n,0,e[0],e[1],e[2]);for(var a=6,i=3;i<t;++i,a+=6)I(n,a,e[i-1],e[i],e[i-2]);return n}return new Uint16Array}function g(e){if(e.length>0){for(var t=e.length-1,r=6*(t-1),n=m.createTypedArray(t,r),a=e[0],i=0,o=1;o<t;++o,i+=6)I(n,i,a,e[o],e[o+1]);return n}return new Uint16Array}function C(e){var t={};for(var r in e)if(e.hasOwnProperty(r)&&c(e[r])&&c(e[r].values)){var n=e[r];t[r]=new d({componentDatatype:n.componentDatatype,componentsPerAttribute:n.componentsPerAttribute,normalize:n.normalize,values:[]})}return t}function w(e,t,r){for(var n in t)if(t.hasOwnProperty(n)&&c(t[n])&&c(t[n].values))for(var a=t[n],i=0;i<a.componentsPerAttribute;++i)e[n].values.push(a.values[r*a.componentsPerAttribute+i])}function P(e,t){if(c(t))for(var r=t.values,n=r.length,i=0;i<n;i+=3)a.unpack(r,i,ie),A.multiplyByPoint(e,ie,ie),a.pack(ie,r,i)}function x(e,t){if(c(t))for(var r=t.values,n=r.length,i=0;i<n;i+=3)a.unpack(r,i,ie),R.multiplyByVector(e,ie,ie),ie=a.normalize(ie,ie),a.pack(ie,r,i)}function L(e,t){var r,n=e.length,a={},i=e[0][t].attributes;for(r in i)if(i.hasOwnProperty(r)&&c(i[r])&&c(i[r].values)){for(var o=i[r],s=o.values.length,l=!0,E=1;E<n;++E){var f=e[E][t].attributes[r];if(!c(f)||o.componentDatatype!==f.componentDatatype||o.componentsPerAttribute!==f.componentsPerAttribute||o.normalize!==f.normalize){l=!1;break}s+=f.values.length}l&&(a[r]=new d({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:u.createTypedArray(o.componentDatatype,s)}))}return a}function U(e,t){var n,i,o,u,s,l,E,f=e.length,d=(e[0].modelMatrix,c(e[0][t].indices)),p=e[0][t].primitiveType,_=L(e,t);for(n in _)if(_.hasOwnProperty(n))for(s=_[n].values,u=0,i=0;i<f;++i)for(l=e[i][t].attributes[n].values,E=l.length,o=0;o<E;++o)s[u++]=l[o];var T;if(d){var y=0;for(i=0;i<f;++i)y+=e[i][t].indices.length;var R=h.computeNumberOfVertices(new h({attributes:_,primitiveType:N.POINTS})),A=m.createTypedArray(R,y),v=0,S=0;for(i=0;i<f;++i){var I=e[i][t].indices,M=I.length;for(u=0;u<M;++u)A[v++]=S+I[u];S+=h.computeNumberOfVertices(e[i][t])}T=A}var O,g=new a,C=0;for(i=0;i<f;++i){if(O=e[i][t].boundingSphere,!c(O)){g=void 0;break}a.add(O.center,g,g)}if(c(g))for(a.divideByScalar(g,f,g),i=0;i<f;++i){O=e[i][t].boundingSphere;var w=a.magnitude(a.subtract(O.center,g,se))+O.radius;w>C&&(C=w)}return new h({attributes:_,indices:T,primitiveType:p,boundingSphere:c(g)?new r(g,C):void 0})}function b(e){if(c(e.indices))return e;for(var t=h.computeNumberOfVertices(e),r=m.createTypedArray(t,t),n=0;n<t;++n)r[n]=n;return e.indices=r,e}function F(e){var t=h.computeNumberOfVertices(e),r=m.createTypedArray(t,3*(t-2));r[0]=1,r[1]=0,r[2]=2;for(var n=3,a=3;a<t;++a)r[n++]=a-1,r[n++]=0,r[n++]=a;return e.indices=r,e.primitiveType=N.TRIANGLES,e}function D(e){var t=h.computeNumberOfVertices(e),r=m.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,a=3;a<t-1;a+=2)r[n++]=a,r[n++]=a-1,r[n++]=a+1,a+2<t&&(r[n++]=a,r[n++]=a+1,r[n++]=a+2);return e.indices=r,e.primitiveType=N.TRIANGLES,e}function B(e){if(c(e.indices))return e;for(var t=h.computeNumberOfVertices(e),r=m.createTypedArray(t,t),n=0;n<t;++n)r[n]=n;return e.indices=r,e}function z(e){var t=h.computeNumberOfVertices(e),r=m.createTypedArray(t,2*(t-1));r[0]=0,r[1]=1;for(var n=2,a=2;a<t;++a)r[n++]=a-1,r[n++]=a;return e.indices=r,e.primitiveType=N.LINES,e}function G(e){var t=h.computeNumberOfVertices(e),r=m.createTypedArray(t,2*t);r[0]=0,r[1]=1;for(var n=2,a=2;a<t;++a)r[n++]=a-1,r[n++]=a;return r[n++]=t-1,r[n]=0,e.indices=r,e.primitiveType=N.LINES,e}function V(e){switch(e.primitiveType){case N.TRIANGLE_FAN:return F(e);case N.TRIANGLE_STRIP:return D(e);case N.TRIANGLES:return b(e);case N.LINE_STRIP:return z(e);case N.LINE_LOOP:return G(e);case N.LINES:return B(e)}return e}function q(e,t){Math.abs(e.y)<y.EPSILON6&&(t?e.y=-y.EPSILON6:e.y=y.EPSILON6)}function X(e,t,r){if(0!==e.y&&0!==t.y&&0!==r.y)return q(e,e.y<0),q(t,t.y<0),void q(r,r.y<0);var n,a=Math.abs(e.y),i=Math.abs(t.y),o=Math.abs(r.y);n=a>i?a>o?y.sign(e.y):y.sign(r.y):i>o?y.sign(t.y):y.sign(r.y);var u=n<0;q(e,u),q(t,u),q(r,u)}function H(e,t,r,n){a.add(e,a.multiplyByScalar(a.subtract(t,e,Re),e.y/(e.y-t.y),Re),r),a.clone(r,n),q(r,!0),q(n,!1)}function W(e,t,r){if(!(e.x>=0||t.x>=0||r.x>=0)){X(e,t,r);var n=e.y<0,a=t.y<0,i=r.y<0,o=0;o+=n?1:0,o+=a?1:0,o+=i?1:0;var u=Ie.indices;1===o?(u[1]=3,u[2]=4,u[5]=6,u[7]=6,u[8]=5,n?(H(e,t,Ae,Ne),H(e,r,ve,Se),u[0]=0,u[3]=1,u[4]=2,u[6]=1):a?(H(t,r,Ae,Ne),H(t,e,ve,Se),u[0]=1,u[3]=2,u[4]=0,u[6]=2):i&&(H(r,e,Ae,Ne),H(r,t,ve,Se),u[0]=2,u[3]=0,u[4]=1,u[6]=0)):2===o&&(u[2]=4,u[4]=4,u[5]=3,u[7]=5,u[8]=6,n?a?i||(H(r,e,Ae,Ne),H(r,t,ve,Se),u[0]=0,u[1]=1,u[3]=0,u[6]=2):(H(t,r,Ae,Ne),H(t,e,ve,Se),u[0]=2,u[1]=0,u[3]=2,u[6]=1):(H(e,t,Ae,Ne),H(e,r,ve,Se),u[0]=1,u[1]=2,u[3]=1,u[6]=0));var s=Ie.positions;return s[0]=e,s[1]=t,s[2]=r,s.length=3,1!==o&&2!==o||(s[3]=Ae,s[4]=ve,s[5]=Ne,s[6]=Se,s.length=7),Ie}}function Y(e,t){var n=e.attributes;if(0!==n.position.values.length){for(var a in n)if(n.hasOwnProperty(a)&&c(n[a])&&c(n[a].values)){var i=n[a];i.values=u.createTypedArray(i.componentDatatype,i.values)}var o=h.computeNumberOfVertices(e);return e.indices=m.createTypedArray(o,e.indices),t&&(e.boundingSphere=r.fromVertices(n.position.values)),e}}function k(e){var t=e.attributes,r={};for(var n in t)if(t.hasOwnProperty(n)&&c(t[n])&&c(t[n].values)){var a=t[n];r[n]=new d({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:[]})}return new h({attributes:r,indices:[],primitiveType:e.primitiveType})}function K(e,t,r){var n=c(e.geometry.boundingSphere);t=Y(t,n),r=Y(r,n),c(r)&&!c(t)?e.geometry=r:!c(r)&&c(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=r,e.geometry=void 0)}function Z(e,r,i,o,u,s,l,E,f,h,d){if(c(s)||c(l)||c(E)||c(f)){var p=a.fromArray(u,3*e,Me),m=a.fromArray(u,3*r,Oe),_=a.fromArray(u,3*i,ge),T=t(o,p,m,_,Ce);if(c(s)){var y=a.fromArray(s,3*e,Me),R=a.fromArray(s,3*r,Oe),A=a.fromArray(s,3*i,ge);a.multiplyByScalar(y,T.x,y),a.multiplyByScalar(R,T.y,R),a.multiplyByScalar(A,T.z,A);var v=a.add(y,R,y);a.add(v,A,v),a.normalize(v,v),a.pack(v,h.normal.values,3*d)}if(c(l)){var N=a.fromArray(l,3*e,Me),S=a.fromArray(l,3*r,Oe),I=a.fromArray(l,3*i,ge);a.multiplyByScalar(N,T.x,N),a.multiplyByScalar(S,T.y,S),a.multiplyByScalar(I,T.z,I);var M=a.add(N,S,N);a.add(M,I,M),a.normalize(M,M),a.pack(M,h.binormal.values,3*d)}if(c(E)){var O=a.fromArray(E,3*e,Me),g=a.fromArray(E,3*r,Oe),C=a.fromArray(E,3*i,ge);a.multiplyByScalar(O,T.x,O),a.multiplyByScalar(g,T.y,g),a.multiplyByScalar(C,T.z,C);var w=a.add(O,g,O);a.add(w,C,w),a.normalize(w,w),a.pack(w,h.tangent.values,3*d)}if(c(f)){var P=n.fromArray(f,2*e,we),x=n.fromArray(f,2*r,Pe),L=n.fromArray(f,2*i,xe);n.multiplyByScalar(P,T.x,P),n.multiplyByScalar(x,T.y,x),n.multiplyByScalar(L,T.z,L);var U=n.add(P,x,P);n.add(U,L,U),n.pack(U,h.st.values,2*d)}}}function j(e,t,r,n,a,i){var o=e.position.values.length/3;if(a!==-1){var u=n[a],s=r[u];return s===-1?(r[u]=o,e.position.values.push(i.x,i.y,i.z),t.push(o),o):(t.push(s),s)}return e.position.values.push(i.x,i.y,i.z),t.push(o),o}function Q(e){var t,r,n,i,o,u=e.geometry,s=u.attributes,l=s.position.values,E=c(s.normal)?s.normal.values:void 0,f=c(s.binormal)?s.binormal.values:void 0,h=c(s.tangent)?s.tangent.values:void 0,d=c(s.st)?s.st.values:void 0,p=u.indices,m=k(u),_=k(u),T=[];T.length=l.length/3;var y=[];for(y.length=l.length/3,o=0;o<T.length;++o)T[o]=-1,y[o]=-1;var R=p.length;for(o=0;o<R;o+=3){var A=p[o],v=p[o+1],N=p[o+2],S=a.fromArray(l,3*A),I=a.fromArray(l,3*v),M=a.fromArray(l,3*N),O=W(S,I,M);if(c(O)&&O.positions.length>3)for(var g=O.positions,C=O.indices,w=C.length,P=0;P<w;++P){var x=C[P],L=g[x];L.y<0?(t=_.attributes,r=_.indices,n=T):(t=m.attributes,r=m.indices,n=y),i=j(t,r,n,p,x<3?o+x:-1,L),Z(A,v,N,L,l,E,f,h,d,t,i)}else c(O)&&(S=O.positions[0],I=O.positions[1],M=O.positions[2]),S.y<0?(t=_.attributes,r=_.indices,n=T):(t=m.attributes,r=m.indices,n=y),i=j(t,r,n,p,o,S),Z(A,v,N,S,l,E,f,h,d,t,i),i=j(t,r,n,p,o+1,I),Z(A,v,N,I,l,E,f,h,d,t,i),i=j(t,r,n,p,o+2,M),Z(A,v,N,M,l,E,f,h,d,t,i)}K(e,_,m)}function J(e){var t,r=e.geometry,n=r.attributes,i=n.position.values,o=r.indices,u=k(r),s=k(r),l=o.length,E=[];E.length=i.length/3;var f=[];for(f.length=i.length/3,t=0;t<E.length;++t)E[t]=-1,f[t]=-1;for(t=0;t<l;t+=2){var h=o[t],d=o[t+1],p=a.fromArray(i,3*h,Me),m=a.fromArray(i,3*d,Oe);Math.abs(p.y)<y.EPSILON6&&(p.y<0?p.y=-y.EPSILON6:p.y=y.EPSILON6),Math.abs(m.y)<y.EPSILON6&&(m.y<0?m.y=-y.EPSILON6:m.y=y.EPSILON6);var _=u.attributes,R=u.indices,A=f,v=s.attributes,N=s.indices,S=E,I=T.lineSegmentPlane(p,m,Le,ge);if(c(I)){var M=a.multiplyByScalar(a.UNIT_Y,5*y.EPSILON9,Ue);p.y<0&&(a.negate(M,M),_=s.attributes,R=s.indices,A=E,v=u.attributes,N=u.indices,S=f);var O=a.add(I,M,be);j(_,R,A,o,t,p),j(_,R,A,o,-1,O),a.negate(M,M),a.add(I,M,O),j(v,N,S,o,-1,O),j(v,N,S,o,t+1,m)}else{var g,C,w;p.y<0?(g=s.attributes,C=s.indices,w=E):(g=u.attributes,C=u.indices,w=f),j(g,C,w,o,t,p),j(g,C,w,o,t+1,m)}}K(e,s,u)}function $(e){for(var t=e.attributes,r=t.position.values,n=t.prevPosition.values,i=t.nextPosition.values,o=r.length,u=0;u<o;u+=3){var s=a.unpack(r,u,Be);if(!(s.x>0)){var c=a.unpack(n,u,ze);(s.y<0&&c.y>0||s.y>0&&c.y<0)&&(u-3>0?(n[u]=r[u-3],n[u+1]=r[u-2],n[u+2]=r[u-1]):a.pack(s,n,u));var l=a.unpack(i,u,Ge);(s.y<0&&l.y>0||s.y>0&&l.y<0)&&(u+3<o?(i[u]=r[u+3],i[u+1]=r[u+4],i[u+2]=r[u+5]):a.pack(s,i,u))}}}function ee(e){var t,r,o,u=e.geometry,s=u.attributes,l=s.position.values,E=s.prevPosition.values,f=s.nextPosition.values,h=s.expandAndWidth.values,d=c(s.st)?s.st.values:void 0,p=c(s.color)?s.color.values:void 0,m=k(u),_=k(u),R=!1,A=l.length/3;for(t=0;t<A;t+=4){var v=t,N=t+2,S=a.fromArray(l,3*v,Be),I=a.fromArray(l,3*N,ze);if(Math.abs(S.y)<Ye)for(S.y=Ye*(I.y<0?-1:1),l[3*t+1]=S.y,l[3*(t+1)+1]=S.y,r=3*v;r<3*v+12;r+=3)E[r]=l[3*t],E[r+1]=l[3*t+1],E[r+2]=l[3*t+2];if(Math.abs(I.y)<Ye)for(I.y=Ye*(S.y<0?-1:1),l[3*(t+2)+1]=I.y,l[3*(t+3)+1]=I.y,r=3*v;r<3*v+12;r+=3)f[r]=l[3*(t+2)],f[r+1]=l[3*(t+2)+1],f[r+2]=l[3*(t+2)+2];var M=m.attributes,O=m.indices,g=_.attributes,C=_.indices,w=T.lineSegmentPlane(S,I,Le,Ve);if(c(w)){R=!0;var P=a.multiplyByScalar(a.UNIT_Y,We,qe);S.y<0&&(a.negate(P,P),M=_.attributes,O=_.indices,g=m.attributes,C=m.indices);var x=a.add(w,P,Xe);M.position.values.push(S.x,S.y,S.z,S.x,S.y,S.z),M.position.values.push(x.x,x.y,x.z),M.position.values.push(x.x,x.y,x.z),M.prevPosition.values.push(E[3*v],E[3*v+1],E[3*v+2]),M.prevPosition.values.push(E[3*v+3],E[3*v+4],E[3*v+5]),M.prevPosition.values.push(S.x,S.y,S.z,S.x,S.y,S.z),M.nextPosition.values.push(x.x,x.y,x.z),M.nextPosition.values.push(x.x,x.y,x.z),M.nextPosition.values.push(x.x,x.y,x.z),M.nextPosition.values.push(x.x,x.y,x.z),a.negate(P,P),a.add(w,P,x),g.position.values.push(x.x,x.y,x.z),g.position.values.push(x.x,x.y,x.z),g.position.values.push(I.x,I.y,I.z,I.x,I.y,I.z),g.prevPosition.values.push(x.x,x.y,x.z),g.prevPosition.values.push(x.x,x.y,x.z),g.prevPosition.values.push(x.x,x.y,x.z),g.prevPosition.values.push(x.x,x.y,x.z),g.nextPosition.values.push(I.x,I.y,I.z,I.x,I.y,I.z),g.nextPosition.values.push(f[3*N],f[3*N+1],f[3*N+2]),g.nextPosition.values.push(f[3*N+3],f[3*N+4],f[3*N+5]);var L=n.fromArray(h,2*v,Fe),U=Math.abs(L.y);M.expandAndWidth.values.push(-1,U,1,U),M.expandAndWidth.values.push(-1,-U,1,-U),g.expandAndWidth.values.push(-1,U,1,U),g.expandAndWidth.values.push(-1,-U,1,-U);var b=a.magnitudeSquared(a.subtract(w,S,Ge));if(b/=a.magnitudeSquared(a.subtract(I,S,Ge)),c(p)){var F=i.fromArray(p,4*v,He),D=i.fromArray(p,4*N,He),B=y.lerp(F.x,D.x,b),z=y.lerp(F.y,D.y,b),G=y.lerp(F.z,D.z,b),V=y.lerp(F.w,D.w,b);for(r=4*v;r<4*v+8;++r)M.color.values.push(p[r]);for(M.color.values.push(B,z,G,V),M.color.values.push(B,z,G,V),g.color.values.push(B,z,G,V),g.color.values.push(B,z,G,V),r=4*N;r<4*N+8;++r)g.color.values.push(p[r])}if(c(d)){var q=n.fromArray(d,2*v,Fe),X=n.fromArray(d,2*(t+3),De),H=y.lerp(q.x,X.x,b);for(r=2*v;r<2*v+4;++r)M.st.values.push(d[r]);for(M.st.values.push(H,q.y),M.st.values.push(H,X.y),g.st.values.push(H,q.y),g.st.values.push(H,X.y),r=2*N;r<2*N+4;++r)g.st.values.push(d[r])}o=M.position.values.length/3-4,O.push(o,o+2,o+1),O.push(o+1,o+2,o+3),o=g.position.values.length/3-4,C.push(o,o+2,o+1),C.push(o+1,o+2,o+3)}else{var W,Y;for(S.y<0?(W=_.attributes,Y=_.indices):(W=m.attributes,Y=m.indices),W.position.values.push(S.x,S.y,S.z),W.position.values.push(S.x,S.y,S.z),W.position.values.push(I.x,I.y,I.z),W.position.values.push(I.x,I.y,I.z),r=3*t;r<3*t+12;++r)W.prevPosition.values.push(E[r]),W.nextPosition.values.push(f[r]);for(r=2*t;r<2*t+8;++r)W.expandAndWidth.values.push(h[r]),c(d)&&W.st.values.push(d[r]);if(c(p))for(r=4*t;r<4*t+16;++r)W.color.values.push(p[r]);o=W.position.values.length/3-4,Y.push(o,o+2,o+1),Y.push(o+1,o+2,o+3)}}R&&($(_),$(m)),K(e,_,m)}var te={};te.toWireframe=function(e){var t=e.indices;if(c(t)){switch(e.primitiveType){case N.TRIANGLES:e.indices=M(t);break;case N.TRIANGLE_STRIP:e.indices=O(t);break;case N.TRIANGLE_FAN:e.indices=g(t)}e.primitiveType=N.LINES}return e},te.createLineSegmentsForVectors=function(e,t,n){t=s(t,"normal"),n=s(n,1e4);for(var a=e.attributes.position.values,i=e.attributes[t].values,o=a.length,l=new Float64Array(2*o),E=0,f=0;f<o;f+=3)l[E++]=a[f],l[E++]=a[f+1],l[E++]=a[f+2],l[E++]=a[f]+i[f]*n,l[E++]=a[f+1]+i[f+1]*n,l[E++]=a[f+2]+i[f+2]*n;var p,m=e.boundingSphere;return c(m)&&(p=new r(m.center,m.radius+n)),new h({attributes:{position:new d({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:N.LINES,boundingSphere:p})},te.createAttributeLocations=function(e){var t,r=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","binormal","tangent","compressedAttributes"],n=e.attributes,a={},i=0,o=r.length;for(t=0;t<o;++t){var u=r[t];c(n[u])&&(a[u]=i++)}for(var s in n)n.hasOwnProperty(s)&&!c(a[s])&&(a[s]=i++);return a},te.reorderForPreVertexCache=function(e){var t=h.computeNumberOfVertices(e),r=e.indices;if(c(r)){for(var n=new Int32Array(t),a=0;a<t;a++)n[a]=-1;for(var i,o=r,s=o.length,l=m.createTypedArray(t,s),E=0,f=0,d=0;E<s;)i=n[o[E]],i!==-1?l[f]=i:(i=o[E],n[i]=d,l[f]=d,++d),++E,++f;e.indices=l;var p=e.attributes;for(var _ in p)if(p.hasOwnProperty(_)&&c(p[_])&&c(p[_].values)){for(var T=p[_],y=T.values,R=0,A=T.componentsPerAttribute,v=u.createTypedArray(T.componentDatatype,d*A);R<t;){var N=n[R];if(N!==-1)for(a=0;a<A;a++)v[A*N+a]=y[A*R+a];++R}T.values=v}}return e},te.reorderForPostVertexCache=function(e,t){var r=e.indices;if(e.primitiveType===N.TRIANGLES&&c(r)){for(var n=r.length,a=0,i=0;i<n;i++)r[i]>a&&(a=r[i]);e.indices=S.tipsify({indices:r,maximumIndex:a,cacheSize:t})}return e},te.fitToUnsignedShortIndices=function(e){var t=[],r=h.computeNumberOfVertices(e);if(c(e.indices)&&r>=y.SIXTY_FOUR_KILOBYTES){var n,a=[],i=[],o=0,u=C(e.attributes),s=e.indices,l=s.length;e.primitiveType===N.TRIANGLES?n=3:e.primitiveType===N.LINES?n=2:e.primitiveType===N.POINTS&&(n=1);for(var E=0;E<l;E+=n){for(var f=0;f<n;++f){var d=s[E+f],p=a[d];c(p)||(p=o++,a[d]=p,w(u,e.attributes,d)),i.push(p)}o+n>=y.SIXTY_FOUR_KILOBYTES&&(t.push(new h({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),a=[],i=[],o=0,u=C(e.attributes))}0!==i.length&&t.push(new h({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var re=new a,ne=new o;te.projectTo2D=function(e,t,r,n,i){var o=e.attributes[t];i=c(i)?i:new f;for(var s=i.ellipsoid,l=o.values,E=new Float64Array(l.length),h=0,p=0;p<l.length;p+=3){var m=a.fromArray(l,p,re),_=s.cartesianToCartographic(m,ne),T=i.project(_,re);E[h++]=T.x,E[h++]=T.y,E[h++]=T.z}return e.attributes[r]=o,e.attributes[n]=new d({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:E}),delete e.attributes[t],e};var ae={high:0,low:0};te.encodeAttribute=function(e,t,r,n){for(var a=e.attributes[t],i=a.values,o=i.length,s=new Float32Array(o),c=new Float32Array(o),l=0;l<o;++l)E.encode(i[l],ae),s[l]=ae.high,c[l]=ae.low;var f=a.componentsPerAttribute;return e.attributes[r]=new d({componentDatatype:u.FLOAT,componentsPerAttribute:f,values:s}),e.attributes[n]=new d({componentDatatype:u.FLOAT,componentsPerAttribute:f,values:c}),delete e.attributes[t],e};var ie=new a,oe=new A,ue=new R;te.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(A.equals(t,A.IDENTITY))return e;var n=e.geometry.attributes;P(t,n.position),P(t,n.prevPosition),P(t,n.nextPosition),(c(n.normal)||c(n.binormal)||c(n.tangent))&&(A.inverse(t,oe),A.transpose(oe,oe),A.getRotation(oe,ue),x(ue,n.normal),x(ue,n.binormal),x(ue,n.tangent));var a=e.geometry.boundingSphere;return c(a)&&(e.geometry.boundingSphere=r.transform(a,t,a)),e.modelMatrix=A.clone(A.IDENTITY),e};var se=new a;te.combineInstances=function(e){for(var t=[],r=[],n=e.length,a=0;a<n;++a){var i=e[a];c(i.geometry)?t.push(i):c(i.westHemisphereGeometry)&&c(i.eastHemisphereGeometry)&&r.push(i)}var o=[];return t.length>0&&o.push(U(t,"geometry")),r.length>0&&(o.push(U(r,"westHemisphereGeometry")),o.push(U(r,"eastHemisphereGeometry"))),o};var ce=new a,le=new a,Ee=new a,fe=new a;te.computeNormal=function(e){for(var t=e.indices,r=e.attributes,n=r.position.values,i=r.position.values.length/3,o=t.length,s=new Array(i),c=new Array(o/3),l=new Array(o),E=0;E<i;E++)s[E]={indexOffset:0,count:0,currentCount:0};var f=0;for(E=0;E<o;E+=3){var h=t[E],p=t[E+1],m=t[E+2],_=3*h,T=3*p,y=3*m;le.x=n[_],le.y=n[_+1],le.z=n[_+2],Ee.x=n[T],Ee.y=n[T+1],Ee.z=n[T+2],fe.x=n[y],fe.y=n[y+1],fe.z=n[y+2],s[h].count++,s[p].count++,s[m].count++,a.subtract(Ee,le,Ee),a.subtract(fe,le,fe),c[f]=a.cross(Ee,fe,new a),f++}var R=0;for(E=0;E<i;E++)s[E].indexOffset+=R,R+=s[E].count;f=0;var A;for(E=0;E<o;E+=3){A=s[t[E]];var v=A.indexOffset+A.currentCount;l[v]=f,A.currentCount++,A=s[t[E+1]],v=A.indexOffset+A.currentCount,l[v]=f,A.currentCount++,A=s[t[E+2]],v=A.indexOffset+A.currentCount,l[v]=f,A.currentCount++,f++}var N=new Float32Array(3*i);for(E=0;E<i;E++){var S=3*E;if(A=s[E],A.count>0){for(a.clone(a.ZERO,ce),f=0;f<A.count;f++)a.add(ce,c[l[A.indexOffset+f]],ce);a.normalize(ce,ce),N[S]=ce.x,N[S+1]=ce.y,N[S+2]=ce.z}else N[S]=0,N[S+1]=0,N[S+2]=1}return e.attributes.normal=new d({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:N}),e};var he=new a,de=new a,pe=new a;te.computeBinormalAndTangent=function(e){for(var t=(e.attributes,e.indices),r=e.attributes.position.values,n=e.attributes.normal.values,i=e.attributes.st.values,o=e.attributes.position.values.length/3,s=t.length,c=new Array(3*o),l=0;l<c.length;l++)c[l]=0;var E,f,h;for(l=0;l<s;l+=3){var p=t[l],m=t[l+1],_=t[l+2];E=3*p,f=3*m,h=3*_;var T=2*p,y=2*m,R=2*_,A=r[E],v=r[E+1],N=r[E+2],S=i[T],I=i[T+1],M=i[y+1]-I,O=i[R+1]-I,g=1/((i[y]-S)*O-(i[R]-S)*M),C=(O*(r[f]-A)-M*(r[h]-A))*g,w=(O*(r[f+1]-v)-M*(r[h+1]-v))*g,P=(O*(r[f+2]-N)-M*(r[h+2]-N))*g;c[E]+=C,c[E+1]+=w,c[E+2]+=P,c[f]+=C,c[f+1]+=w,c[f+2]+=P,c[h]+=C,c[h+1]+=w,c[h+2]+=P}var x=new Float32Array(3*o),L=new Float32Array(3*o);for(l=0;l<o;l++){E=3*l,f=E+1,h=E+2;var U=a.fromArray(n,E,he),b=a.fromArray(c,E,pe),F=a.dot(U,b);a.multiplyByScalar(U,F,de),a.normalize(a.subtract(b,de,b),b),L[E]=b.x,L[f]=b.y,L[h]=b.z,a.normalize(a.cross(U,b,b),b),x[E]=b.x,x[f]=b.y,x[h]=b.z}return e.attributes.tangent=new d({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:L}),e.attributes.binormal=new d({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:x}),e};var me=new n,_e=new a,Te=new a,ye=new a;te.compressVertices=function(t){var r=t.attributes.normal,i=t.attributes.st;if(!c(r)&&!c(i))return t;var o,s,l,E,f=t.attributes.tangent,h=t.attributes.binormal;c(r)&&(o=r.values),c(i)&&(s=i.values),c(f)&&(l=f.values),h&&(E=h.values);var p=c(o)?o.length:s.length,m=c(o)?3:2,_=p/m,T=_,y=c(s)&&c(o)?2:1;y+=c(l)||c(E)?1:0,T*=y;for(var R=new Float32Array(T),A=0,v=0;v<_;++v){c(s)&&(n.fromArray(s,2*v,me),R[A++]=e.compressTextureCoordinates(me));var N=3*v;c(o)&&c(l)&&c(E)?(a.fromArray(o,N,_e),a.fromArray(l,N,Te),a.fromArray(E,N,ye),e.octPack(_e,Te,ye,me),R[A++]=me.x,R[A++]=me.y):(c(o)&&(a.fromArray(o,N,_e),R[A++]=e.octEncodeFloat(_e)),c(l)&&(a.fromArray(l,N,_e),R[A++]=e.octEncodeFloat(_e)),c(E)&&(a.fromArray(E,N,_e),R[A++]=e.octEncodeFloat(_e)))}return t.attributes.compressedAttributes=new d({componentDatatype:u.FLOAT,componentsPerAttribute:y,values:R}),c(o)&&delete t.attributes.normal,c(s)&&delete t.attributes.st,c(l)&&delete t.attributes.tangent,c(E)&&delete t.attributes.binormal,t};var Re=new a,Ae=new a,ve=new a,Ne=new a,Se=new a,Ie={positions:new Array(7),indices:new Array(9)},Me=new a,Oe=new a,ge=new a,Ce=new a,we=new n,Pe=new n,xe=new n,Le=v.fromPointNormal(a.ZERO,a.UNIT_Y),Ue=new a,be=new a,Fe=new n,De=new n,Be=new a,ze=new a,Ge=new a,Ve=new a,qe=new a,Xe=new a,He=new i,We=5*y.EPSILON9,Ye=y.EPSILON6;return te.splitLongitude=function(e){var t=e.geometry,n=t.boundingSphere;if(c(n)){var a=n.center.x-n.radius;if(a>0||r.intersectPlane(n,v.ORIGIN_ZX_PLANE)!==_.INTERSECTING)return e}if(t.geometryType!==p.NONE)switch(t.geometryType){case p.POLYLINES:ee(e);break;case p.TRIANGLES:Q(e);break;case p.LINES:J(e)}else V(t),t.primitiveType===N.TRIANGLES?Q(e):t.primitiveType===N.LINES&&J(e);return e},te}),define("Core/WebMercatorProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,r,n,a,i,o,u){"use strict";function s(e){this._ellipsoid=r(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(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 a=this._semimajorAxis,i=t.longitude*a,o=s.geodeticLatitudeToMercatorAngle(t.latitude)*a,u=t.height;return n(r)?(r.x=i,r.y=o,r.z=u,r):new e(i,o,u)},s.prototype.unproject=function(e,r){var a=this._oneOverSemimajorAxis,i=e.x*a,o=s.mercatorAngleToGeodeticLatitude(e.y*a),u=e.z;return n(r)?(r.longitude=i,r.latitude=o,r.height=u,r):new t(i,o,u)},s}),define("Scene/PrimitivePipeline",["../Core/BoundingSphere","../Core/ComponentDatatype","../Core/defined","../Core/DeveloperError","../Core/Ellipsoid","../Core/FeatureDetection","../Core/GeographicProjection","../Core/Geometry","../Core/GeometryAttribute","../Core/GeometryAttributes","../Core/GeometryPipeline","../Core/IndexDatatype","../Core/Matrix4","../Core/WebMercatorProjection"],function(e,t,r,n,a,i,o,u,s,c,l,E,f,h){"use strict";function d(e,t,n){var a,i=!n,o=e.length;if(!i&&o>1){var u=e[0].modelMatrix;for(a=1;a<o;++a)if(!f.equals(u,e[a].modelMatrix)){i=!0;break}}if(i)for(a=0;a<o;++a)r(e[a].geometry)&&l.transformToWorldCoordinates(e[a]);else f.multiplyTransformation(t,e[0].modelMatrix,t)}function p(e,r){var n=e.attributes,a=n.position,i=a.values.length/a.componentsPerAttribute;n.batchId=new s({componentDatatype:t.FLOAT,componentsPerAttribute:1,values:new Float32Array(i)});for(var o=n.batchId.values,u=0;u<i;++u)o[u]=r}function m(e){for(var t=e.length,n=0;n<t;++n){var a=e[n];r(a.geometry)?p(a.geometry,n):r(a.westHemisphereGeometry)&&r(a.eastHemisphereGeometry)&&(p(a.westHemisphereGeometry,n),p(a.eastHemisphereGeometry,n))}}function _(n){var a,i,o,u=n.instances,s=n.projection,c=n.elementIndexUintSupported,E=n.scene3DOnly,f=n.vertexCacheOptimize,h=n.compressVertices,p=n.modelMatrix,_=u.length;for(a=0;a<_;++a)if(r(u[a].geometry)){o=u[a].geometry.primitiveType;break}if(d(u,p,E),!E)for(a=0;a<_;++a)r(u[a].geometry)&&l.splitLongitude(u[a]);if(m(u),f)for(a=0;a<_;++a){var T=u[a];r(T.geometry)?(l.reorderForPostVertexCache(T.geometry),l.reorderForPreVertexCache(T.geometry)):r(T.westHemisphereGeometry)&&r(T.eastHemisphereGeometry)&&(l.reorderForPostVertexCache(T.westHemisphereGeometry),l.reorderForPreVertexCache(T.westHemisphereGeometry),l.reorderForPostVertexCache(T.eastHemisphereGeometry),l.reorderForPreVertexCache(T.eastHemisphereGeometry))}var y=l.combineInstances(u); -for(_=y.length,a=0;a<_;++a){i=y[a];var R,A=i.attributes;if(E)for(R in A)A.hasOwnProperty(R)&&A[R].componentDatatype===t.DOUBLE&&l.encodeAttribute(i,R,R+"3DHigh",R+"3DLow");else for(R in A)if(A.hasOwnProperty(R)&&A[R].componentDatatype===t.DOUBLE){var v=R+"3D",N=R+"2D";l.projectTo2D(i,R,v,N,s),r(i.boundingSphere)&&"position"===R&&(i.boundingSphereCV=e.fromVertices(i.attributes.position2D.values)),l.encodeAttribute(i,v,v+"High",v+"Low"),l.encodeAttribute(i,N,N+"High",N+"Low")}h&&l.compressVertices(i)}if(!c){var S=[];for(_=y.length,a=0;a<_;++a)i=y[a],S=S.concat(l.fitToUnsignedShortIndices(i));y=S}return y}function T(e,t,n,a){var i,o,u,s=a.length-1;if(s>=0){var c=a[s];i=c.offset+c.count,u=c.index,o=n[u].indices.length}else i=0,u=0,o=n[u].indices.length;for(var l=e.length,E=0;E<l;++E){var f=e[E],h=f[t];if(r(h)){var d=h.indices.length;i+d>o&&(i=0,o=n[++u].indices.length),a.push({index:u,offset:i,count:d}),i+=d}}}function y(e,t){var r=[];return T(e,"geometry",t,r),T(e,"westHemisphereGeometry",t,r),T(e,"eastHemisphereGeometry",t,r),r}function R(e,t){var n=e.attributes;for(var a in n)if(n.hasOwnProperty(a)){var i=n[a];r(i)&&r(i.values)&&t.push(i.values.buffer)}r(e.indices)&&t.push(e.indices.buffer)}function A(e,t){for(var r=e.length,n=0;n<r;++n)R(e[n],t)}function v(t){for(var n=1,a=t.length,i=0;i<a;i++){var o=t[i];if(++n,r(o)){var u=o.attributes;n+=6+2*e.packedLength+(r(o.indices)?o.indices.length:0);for(var s in u)if(u.hasOwnProperty(s)&&r(u[s])){var c=u[s];n+=5+c.values.length}}}return n}function N(e,t){var r=e.length,n=new Float64Array(1+16*r),a=0;n[a++]=r;for(var i=0;i<r;i++){var o=e[i];f.pack(o.modelMatrix,n,a),a+=f.packedLength}return t.push(n.buffer),n}function S(e){for(var t=e,r=new Array(t[0]),n=0,a=1;a<t.length;){var i=f.unpack(t,a);a+=f.packedLength,r[n++]={modelMatrix:i}}return r}function I(t){var n=t.length,a=1+(e.packedLength+1)*n,i=new Float32Array(a),o=0;i[o++]=n;for(var u=0;u<n;++u){var s=t[u];r(s)?(i[o++]=1,e.pack(t[u],i,o)):i[o++]=0,o+=e.packedLength}return i}function M(t){for(var r=new Array(t[0]),n=0,a=1;a<t.length;)1===t[a++]&&(r[n]=e.unpack(t,a)),++n,a+=e.packedLength;return r}if(!i.supportsTypedArrays())return{};var O={};return O.combineGeometry=function(t){var n,a,i=t.instances,o=i.length;o>0&&(n=_(t),n.length>0&&(a=l.createAttributeLocations(n[0])));var u;t.createPickOffsets&&n.length>0&&(u=y(i,n));for(var s=new Array(o),c=new Array(o),E=0;E<o;++E){var f=i[E],h=f.geometry;r(h)&&(s[E]=h.boundingSphere,c[E]=h.boundingSphereCV);var d=f.eastHemisphereGeometry,p=f.westHemisphereGeometry;r(d)&&r(p)&&(r(d.boundingSphere)&&r(p.boundingSphere)&&(s[E]=e.union(d.boundingSphere,p.boundingSphere)),r(d.boundingSphereCV)&&r(p.boundingSphereCV)&&(c[E]=e.union(d.boundingSphereCV,p.boundingSphereCV)))}return{geometries:n,modelMatrix:t.modelMatrix,attributeLocations:a,pickOffsets:u,boundingSpheres:s,boundingSpheresCV:c}},O.packCreateGeometryResults=function(t,n){var a=new Float64Array(v(t)),i=[],o={},u=t.length,s=0;a[s++]=u;for(var c=0;c<u;c++){var l=t[c],E=r(l);if(a[s++]=E?1:0,E){a[s++]=l.primitiveType,a[s++]=l.geometryType;var f=r(l.boundingSphere)?1:0;a[s++]=f,f&&e.pack(l.boundingSphere,a,s),s+=e.packedLength;var h=r(l.boundingSphereCV)?1:0;a[s++]=h,h&&e.pack(l.boundingSphereCV,a,s),s+=e.packedLength;var d=l.attributes,p=[];for(var m in d)d.hasOwnProperty(m)&&r(d[m])&&(p.push(m),r(o[m])||(o[m]=i.length,i.push(m)));a[s++]=p.length;for(var _=0;_<p.length;_++){var T=p[_],y=d[T];a[s++]=o[T],a[s++]=y.componentDatatype,a[s++]=y.componentsPerAttribute,a[s++]=y.normalize?1:0,a[s++]=y.values.length,a.set(y.values,s),s+=y.values.length}var R=r(l.indices)?l.indices.length:0;a[s++]=R,R>0&&(a.set(l.indices,s),s+=R)}}return n.push(a.buffer),{stringTable:i,packedData:a}},O.unpackCreateGeometryResults=function(r){for(var n,a=r.stringTable,i=r.packedData,o=new Array(i[0]),l=0,f=1;f<i.length;){var h=1===i[f++];if(h){var d,p,m=i[f++],_=i[f++],T=1===i[f++];T&&(d=e.unpack(i,f)),f+=e.packedLength;var y=1===i[f++];y&&(p=e.unpack(i,f)),f+=e.packedLength;var R,A,v,N=new c,S=i[f++];for(n=0;n<S;n++){var I=a[i[f++]],M=i[f++];v=i[f++];var O=0!==i[f++];R=i[f++],A=t.createTypedArray(M,R);for(var g=0;g<R;g++)A[g]=i[f++];N[I]=new s({componentDatatype:M,componentsPerAttribute:v,normalize:O,values:A})}var C;if(R=i[f++],R>0){var w=A.length/v;for(C=E.createTypedArray(w,R),n=0;n<R;n++)C[n]=i[f++]}o[l++]=new u({primitiveType:m,geometryType:_,boundingSphere:d,boundingSphereCV:p,indices:C,attributes:N})}else o[l++]=void 0}return o},O.packCombineGeometryParameters=function(e,t){for(var r=e.createGeometryResults,n=r.length,a=0;a<n;a++)t.push(r[a].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:N(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof o,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}},O.unpackCombineGeometryParameters=function(e){for(var t=S(e.packedInstances),r=e.createGeometryResults,n=r.length,i=0,u=0;u<n;u++)for(var s=O.unpackCreateGeometryResults(r[u]),c=s.length,l=0;l<c;l++){var E=s[l],d=t[i];d.geometry=E,++i}var p=a.clone(e.ellipsoid),m=e.isGeographic?new o(p):new h(p);return{instances:t,ellipsoid:p,projection:m,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:f.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}},O.packCombineGeometryResults=function(e,t){r(e.geometries)&&A(e.geometries,t);var n=I(e.boundingSpheres),a=I(e.boundingSpheresCV);return t.push(n.buffer,a.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,boundingSpheres:n,boundingSpheresCV:a}},O.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,boundingSpheres:M(e.boundingSpheres),boundingSpheresCV:M(e.boundingSpheresCV)}},O}),define("Core/formatError",["./defined"],function(e){"use strict";function t(t){var r,n=t.name,a=t.message;r=e(n)&&e(a)?n+": "+a:t.toString();var i=t.stack;return e(i)&&(r+="\n"+i),r}return t}),define("Workers/createTaskProcessorWorker",["../Core/defaultValue","../Core/defined","../Core/formatError"],function(e,t,r){"use strict";function n(n){var a,i=[],o={id:void 0,result:void 0,error:void 0};return function(u){var s=u.data;i.length=0,o.id=s.id,o.error=void 0,o.result=void 0;try{o.result=n(s.parameters,i)}catch(e){e instanceof Error?o.error={name:e.name,message:e.message,stack:e.stack}:o.error=e}t(a)||(a=e(self.webkitPostMessage,self.postMessage)),s.canTransferArrayBuffer||(i.length=0);try{a(o,i)}catch(e){o.result=void 0,o.error="postMessage failed with error: "+r(e)+"\n with responseMessage: "+JSON.stringify(o),a(o)}}}return n}),define("Workers/combineGeometry",["../Scene/PrimitivePipeline","./createTaskProcessorWorker"],function(e,t){"use strict";function r(t,r){var n=e.unpackCombineGeometryParameters(t),a=e.combineGeometry(n);return e.packCombineGeometryResults(a,r)}return t(r)})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function r(e){return e+" is required, actual value was undefined"}function n(e,t,r){return"Expected "+r+" to be typeof "+t+", actual typeof was "+e}var a={};return a.typeOf={},a.defined=function(n,a){if(!e(a))throw new t(r(n))},a.typeOf.func=function(e,r){if("function"!=typeof r)throw new t(n(typeof r,"function",e))},a.typeOf.string=function(e,r){if("string"!=typeof r)throw new t(n(typeof r,"string",e))},a.typeOf.number=function(e,r){if("number"!=typeof r)throw new t(n(typeof r,"number",e))},a.typeOf.number.lessThan=function(e,r,n){if(a.typeOf.number(e,r),r>=n)throw new t("Expected "+e+" to be less than "+n+", actual value was "+r)},a.typeOf.number.lessThanOrEquals=function(e,r,n){if(a.typeOf.number(e,r),r>n)throw new t("Expected "+e+" to be less than or equal to "+n+", actual value was "+r)},a.typeOf.number.greaterThan=function(e,r,n){if(a.typeOf.number(e,r),r<=n)throw new t("Expected "+e+" to be greater than "+n+", actual value was "+r)},a.typeOf.number.greaterThanOrEquals=function(e,r,n){if(a.typeOf.number(e,r),r<n)throw new t("Expected "+e+" to be greater than or equal to"+n+", actual value was "+r)},a.typeOf.object=function(e,r){if("object"!=typeof r)throw new t(n(typeof r,"object",e))},a.typeOf.bool=function(e,r){if("boolean"!=typeof r)throw new t(n(typeof r,"boolean",e))},a}),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";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),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^=e<<7&2636928640,e^=e<<15&4022730752,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,r,n){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:e<0?-1:0},a.signNotZero=function(e){return e<0?-1:1},a.toSNorm=function(e,r){return r=t(r,255),Math.round((.5*a.clamp(e,-1,1)+.5)*r)},a.fromSNorm=function(e,r){return r=t(r,255),a.clamp(e,0,r)/r*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t-r)},a.cosh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t+r)},a.lerp=function(e,t,r){return(1-r)*e+r*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){var t=a.TWO_PI,r=e-Math.floor(e/t)*t;return r<-Math.PI?r+t:r>=Math.PI?r-t:r},a.clampToLatitudeRange=function(e){return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){return(e%t+t)%t},a.equalsEpsilon=function(e,r,n,a){a=t(a,n);var i=Math.abs(e-r);return i<=a||i<=n*Math.max(Math.abs(e),Math.abs(r))};var i=[1];a.factorial=function(e){var t=i.length;if(e>=t)for(var r=i[t-1],n=t;n<=e;n++)i.push(r*n);return i[e]},a.incrementWrap=function(e,r,n){return n=t(n,0),++e,e>r&&(e=n),e},a.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,r){return e<t?t:e>r?r:e};var o=new e;return a.setRandomNumberSeed=function(t){o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(e){return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){return Math.log(e)/Math.log(t)},a.fog=function(e,t){var r=e*t;return 1-Math.exp(-(r*r))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i){"use strict";function o(e,r,n){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0)}o.fromSpherical=function(e,n){r(n)||(n=new o);var a=e.clock,i=e.cone,u=t(e.magnitude,1),s=u*Math.sin(i);return n.x=s*Math.cos(a),n.y=s*Math.sin(a),n.z=u*Math.cos(i),n},o.fromElements=function(e,t,n,a){return r(a)?(a.x=e,a.y=t,a.z=n,a):new o(e,t,n)},o.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n]=e.z,r},o.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new o),a.x=e[n++],a.y=e[n++],a.z=e[n],a},o.packArray=function(e,t){var n=e.length;r(t)?t.length=3*n:t=new Array(3*n);for(var a=0;a<n;++a)o.pack(e[a],t,3*a);return t},o.unpackArray=function(e,t){var n=e.length;r(t)?t.length=n/3:t=new Array(n/3);for(var a=0;a<n;a+=3){var i=a/3;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},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},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},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},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},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},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},o.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r.z=e.z/t.z,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},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},o.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*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},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,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};var s=new o;o.lerp=function(e,t,r,n){return o.multiplyByScalar(t,r,s),n=o.multiplyByScalar(e,1-r,n),o.add(s,n,n)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var r=o.dot(c,l),n=o.magnitude(o.cross(c,l,c));return Math.atan2(n,r)};var E=new o;o.mostOrthogonalAxis=function(e,t){var r=o.normalize(e,E);return o.abs(r,r),t=r.x<=r.y?r.x<=r.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):r.y<=r.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},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,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]},o.equalsEpsilon=function(e,t,n,a){return e===t||r(e)&&r(t)&&i.equalsEpsilon(e.x,t.x,n,a)&&i.equalsEpsilon(e.y,t.y,n,a)&&i.equalsEpsilon(e.z,t.z,n,a)},o.cross=function(e,t,r){var n=e.x,a=e.y,i=e.z,o=t.x,u=t.y,s=t.z,c=a*s-i*u,l=i*o-n*s,E=n*u-a*o;return r.x=c,r.y=l,r.z=E,r},o.fromDegrees=function(e,t,r,n,a){return e=i.toRadians(e),t=i.toRadians(t),o.fromRadians(e,t,r,n,a)};var f=new o,h=new o,d=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,n,a,i,u){a=t(a,0);var s=r(i)?i.radiiSquared:d,c=Math.cos(n);f.x=c*Math.cos(e),f.y=c*Math.sin(e),f.z=Math.sin(n),f=o.normalize(f,f),o.multiplyComponents(s,f,h);var l=Math.sqrt(o.dot(f,h));return h=o.divideByScalar(h,l,h),f=o.multiplyByScalar(f,a,f),r(u)||(u=new o),o.add(h,f,u)},o.fromDegreesArray=function(e,t,n){var a=e.length;r(n)?n.length=a/2:n=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;n[c]=o.fromDegrees(u,s,0,t,n[c])}return n},o.fromRadiansArray=function(e,t,n){var a=e.length;r(n)?n.length=a/2:n=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;n[c]=o.fromRadians(u,s,0,t,n[c])}return n},o.fromDegreesArrayHeights=function(e,t,n){var a=e.length;r(n)?n.length=a/3:n=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;n[l]=o.fromDegrees(u,s,c,t,n[l])}return n},o.fromRadiansArrayHeights=function(e,t,n){var a=e.length;r(n)?n.length=a/3:n=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;n[l]=o.fromRadians(u,s,c,t,n[l])}return n},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(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,t,r){return o.equalsEpsilon(this,e,t,r)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,r,n){"use strict";function a(r,a,u,s,c){var l=r.x,E=r.y,f=r.z,h=a.x,d=a.y,p=a.z,m=l*l*h*h,_=E*E*d*d,T=f*f*p*p,y=m+_+T,R=Math.sqrt(1/y),A=e.multiplyByScalar(r,R,i);if(y<s)return isFinite(R)?e.clone(A,c):void 0;var v=u.x,N=u.y,S=u.z,I=o;I.x=A.x*v*2,I.y=A.y*N*2,I.z=A.z*S*2;var M,g,O,C,w,x,P,L,b,U,F,D=(1-R)*e.magnitude(r)/(.5*e.magnitude(I)),B=0;do{D-=B,O=1/(1+D*v),C=1/(1+D*N),w=1/(1+D*S),x=O*O,P=C*C,L=w*w,b=x*O,U=P*C,F=L*w,M=m*x+_*P+T*L-1,g=m*b*v+_*U*N+T*F*S;var z=-2*g;B=M/z}while(Math.abs(M)>n.EPSILON12);return t(c)?(c.x=l*O,c.y=E*C,c.z=f*w,c):new e(l*O,E*C,f*w)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,r,n,a,i,o){"use strict";function u(e,r,n){this.longitude=t(e,0),this.latitude=t(r,0),this.height=t(n,0)}u.fromRadians=function(e,n,a,i){return a=t(a,0),r(i)?(i.longitude=e,i.latitude=n,i.height=a,i):new u(e,n,a)},u.fromDegrees=function(e,t,r,n){return e=i.toRadians(e),t=i.toRadians(t),u.fromRadians(e,t,r,n)};var s=new e,c=new e,l=new e,E=new e(1/6378137,1/6378137,1/6356752.314245179),f=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),h=i.EPSILON1;return u.fromCartesian=function(t,n,a){var d=r(n)?n.oneOverRadii:E,p=r(n)?n.oneOverRadiiSquared:f,m=r(n)?n._centerToleranceSquared:h,_=o(t,d,p,m,c);if(r(_)){var T=e.multiplyComponents(_,p,s);T=e.normalize(T,T);var y=e.subtract(t,_,l),R=Math.atan2(T.y,T.x),A=Math.asin(T.z),v=i.sign(e.dot(y,t))*e.magnitude(y);return r(a)?(a.longitude=R,a.latitude=A,a.height=v,a):new u(R,A,v)}},u.clone=function(e,t){if(r(e))return r(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||r(e)&&r(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n},u.ZERO=a(new u(0,0,0)),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,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),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","./scaleToGeodeticSurface"],function(e,t,r,n,a,i,o,u,s){"use strict";function c(t,n,a,i){n=r(n,0),a=r(a,0),i=r(i,0),t._radii=new e(n,a,i),t._radiiSquared=new e(n*n,a*a,i*i),t._radiiToTheFourth=new e(n*n*n*n,a*a*a*a,i*i*i*i),t._oneOverRadii=new e(0===n?0:1/n,0===a?0:1/a,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===n?0:1/(n*n),0===a?0:1/(a*a),0===i?0:1/(i*i)),t._minimumRadius=Math.min(n,a,i),t._maximumRadius=Math.max(n,a,i),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(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,this._sqauredXOverSquaredZ=void 0,c(this,e,t,r)}a(l.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}}}),l.clone=function(t,r){if(n(t)){var a=t._radii;return n(r)?(e.clone(a,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 l(a.x,a.y,a.z)}},l.fromCartesian3=function(e,t){return n(t)||(t=new l),n(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,n,a){return a=r(a,0),e.pack(t._radii,n,a),n},l.unpack=function(t,n,a){n=r(n,0);var i=e.unpack(t,n);return l.fromCartesian3(i,a)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,r){var a=t.longitude,i=t.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return n(r)||(r=new e),r.x=u,r.y=s,r.z=c,e.normalize(r,r)},l.prototype.geodeticSurfaceNormal=function(t,r){return n(r)||(r=new e),r=e.multiplyComponents(t,this._oneOverRadiiSquared,r),e.normalize(r,r)};var E=new e,f=new e;l.prototype.cartographicToCartesian=function(t,r){var a=E,i=f;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(e.dot(a,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(a,t.height,a),n(r)||(r=new e),e.add(i,a,r)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var a=0;a<r;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var h=new e,d=new e,p=new e;return l.prototype.cartesianToCartographic=function(r,a){var i=this.scaleToGeodeticSurface(r,d);if(n(i)){var o=this.geodeticSurfaceNormal(i,h),s=e.subtract(r,i,p),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),E=u.sign(e.dot(s,r))*e.magnitude(s);return n(a)?(a.longitude=c,a.latitude=l,a.height=E,a):new t(c,l,E)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var a=0;a<r;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,r){n(r)||(r=new e);var a=t.x,i=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return e.multiplyByScalar(t,s,r)},l.prototype.transformPositionToScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._oneOverRadii,r)},l.prototype.transformPositionFromScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._radii,r)},l.prototype.equals=function(t){return this===t||n(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,a,i){a=r(a,0);var o=this._sqauredXOverSquaredZ;if(n(i)||(i=new e),i.x=0,i.y=0,i.z=t.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},l}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,r,n,a,i,o){"use strict";function u(e){this._ellipsoid=r(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,r){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return n(r)?(r.x=i,r.y=o,r.z=u,r):new e(i,o,u)},u.prototype.unproject=function(e,r){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,u=e.z;return n(r)?(r.longitude=i,r.latitude=o,r.height=u,r):new t(i,o,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";function t(t,r){this.start=e(t,0),this.stop=e(r,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i,o,u){"use strict";function s(e,t,n,a,i,o,u,s,c){this[0]=r(e,0),this[1]=r(a,0),this[2]=r(u,0),this[3]=r(t,0),this[4]=r(i,0),this[5]=r(s,0),this[6]=r(n,0),this[7]=r(o,0),this[8]=r(c,0)}function c(e){for(var t=0,r=0;r<9;++r){var n=e[r];t+=n*n}return Math.sqrt(t)}function l(e){for(var t=0,r=0;r<3;++r){var n=e[s.getElementIndex(p[r],d[r])];t+=2*n*n}return Math.sqrt(t)}function E(e,t){for(var r=u.EPSILON15,n=0,a=1,i=0;i<3;++i){var o=Math.abs(e[s.getElementIndex(p[i],d[i])]);o>n&&(a=i,n=o)}var c=1,l=0,E=d[a],f=p[a];if(Math.abs(e[s.getElementIndex(f,E)])>r){var h,m=e[s.getElementIndex(f,f)],_=e[s.getElementIndex(E,E)],T=e[s.getElementIndex(f,E)],y=(m-_)/2/T;h=y<0?-1/(-y+Math.sqrt(1+y*y)):1/(y+Math.sqrt(1+y*y)),c=1/Math.sqrt(1+h*h),l=h*c}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(E,E)]=t[s.getElementIndex(f,f)]=c,t[s.getElementIndex(f,E)]=l,t[s.getElementIndex(E,f)]=-l,t}s.packedLength=9,s.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t},s.unpack=function(e,t,a){return t=r(t,0),n(a)||(a=new s),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a},s.clone=function(e,t){if(n(e))return n(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 s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,a){return t=r(t,0),n(a)||(a=new s),a[0]=e[t],a[1]=e[t+1],a[2]=e[t+2],a[3]=e[t+3],a[4]=e[t+4],a[5]=e[t+5],a[6]=e[t+6],a[7]=e[t+7],a[8]=e[t+8],a},s.fromColumnMajorArray=function(e,t){return s.clone(e,t)},s.fromRowMajorArray=function(e,t){return n(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 s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var r=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,u=e.y*e.y,c=e.y*e.z,l=e.y*e.w,E=e.z*e.z,f=e.z*e.w,h=e.w*e.w,d=r-u-E+h,p=2*(a-f),m=2*(i+l),_=2*(a+f),T=-r+u-E+h,y=2*(c-o),R=2*(i-l),A=2*(c+o),v=-r-u+E+h;return n(t)?(t[0]=d,t[1]=_,t[2]=R,t[3]=p,t[4]=T,t[5]=A,t[6]=m,t[7]=y,t[8]=v,t):new s(d,p,m,_,T,y,R,A,v)},s.fromHeadingPitchRoll=function(e,t){var r=Math.cos(-e.pitch),a=Math.cos(-e.heading),i=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),c=Math.sin(e.roll),l=r*a,E=-i*u+c*o*a,f=c*u+i*o*a,h=r*u,d=i*a+c*o*u,p=-o*i+i*o*u,m=-o,_=c*r,T=i*r;return n(t)?(t[0]=l,t[1]=h,t[2]=m,t[3]=E,t[4]=d,t[5]=_,t[6]=f,t[7]=p,t[8]=T,t):new s(l,E,f,h,d,p,m,_,T)},s.fromScale=function(e,t){return n(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 s(e.x,0,0,0,e.y,0,0,0,e.z)},s.fromUniformScale=function(e,t){return n(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 s(e,0,0,0,e,0,0,0,e)},s.fromCrossProduct=function(e,t){return n(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 s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=r,t[5]=a,t[6]=0,t[7]=-a,t[8]=r,t):new s(1,0,0,0,r,-a,0,a,r)},s.fromRotationY=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=r,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=r,t):new s(r,0,a,0,1,0,-a,0,r)},s.fromRotationZ=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=r,t[1]=a,t[2]=0,t[3]=-a,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(r,-a,0,a,r,0,0,0,1)},s.toArray=function(e,t){return n(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]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,r){var n=3*t,a=e[n],i=e[n+1],o=e[n+2];return r.x=a,r.y=i,r.z=o,r},s.setColumn=function(e,t,r,n){n=s.clone(e,n);var a=3*t;return n[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n},s.getRow=function(e,t,r){var n=e[t],a=e[t+3],i=e[t+6];return r.x=n,r.y=a,r.z=i,r},s.setRow=function(e,t,r,n){return n=s.clone(e,n),n[t]=r.x,n[t+3]=r.y,n[t+6]=r.z,n};var f=new e;s.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],f)),r.y=e.magnitude(e.fromElements(t[3],t[4],t[5],f)),r.z=e.magnitude(e.fromElements(t[6],t[7],t[8],f)),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]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=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],E=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return r[0]=n,r[1]=a,r[2]=i,r[3]=o,r[4]=u,r[5]=s,r[6]=c,r[7]=l,r[8]=E,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},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},s.multiplyByVector=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=e[0]*n+e[3]*a+e[6]*i,u=e[1]*n+e[4]*a+e[7]*i,s=e[2]*n+e[5]*a+e[8]*i;return r.x=o,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},s.multiplyByScale=function(e,t,r){return r[0]=e[0]*t.x,r[1]=e[1]*t.x,r[2]=e[2]*t.x,r[3]=e[3]*t.y,r[4]=e[4]*t.y,r[5]=e[5]*t.y,r[6]=e[6]*t.z,r[7]=e[7]*t.z,r[8]=e[8]*t.z,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},s.transpose=function(e,t){var r=e[0],n=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=r,t[1]=n,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var d=[1,0,0],p=[2,2,1],m=new s,_=new s;return s.computeEigenDecomposition=function(e,t){var r=u.EPSILON20,a=10,i=0,o=0;n(t)||(t={});for(var f=t.unitary=s.clone(s.IDENTITY,t.unitary),h=t.diagonal=s.clone(e,t.diagonal),d=r*c(h);o<a&&l(h)>d;)E(h,m),s.transpose(m,_),s.multiply(h,m,h),s.multiply(_,h,h),s.multiply(f,m,f),++i>2&&(++o,i=0);return 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},s.determinant=function(e){var t=e[0],r=e[3],n=e[6],a=e[1],i=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*o)+a*(s*n-r*c)+u*(r*o-i*n)},s.inverse=function(e,t){var r=e[0],n=e[1],a=e[2],i=e[3],o=e[4],u=e[5],c=e[6],l=e[7],E=e[8],f=s.determinant(e);t[0]=o*E-l*u,t[1]=l*a-n*E,t[2]=n*u-o*a,t[3]=c*u-i*E,t[4]=r*E-c*a,t[5]=i*a-r*u,t[6]=i*l-c*o,t[7]=c*n-r*l,t[8]=r*o-i*n;var h=1/f;return s.multiplyByScalar(t,h,t)},s.equals=function(e,t){return e===t||n(e)&&n(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]},s.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,a(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i){"use strict";function o(e,r,n,a){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0),this.w=t(a,0)}o.fromElements=function(e,t,n,a,i){return r(i)?(i.x=e,i.y=t,i.z=n,i.w=a,i):new o(e,t,n,a)},o.fromColor=function(e,t){return r(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(r(e))return 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)},o.packedLength=4,o.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n++]=e.z,r[n]=e.w,r},o.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new o),a.x=e[n++],a.y=e[n++],a.z=e[n++],a.w=e[n],a},o.packArray=function(e,t){var n=e.length;r(t)?t.length=4*n:t=new Array(4*n);for(var a=0;a<n;++a)o.pack(e[a],t,4*a);return t},o.unpackArray=function(e,t){var n=e.length;r(t)?t.length=n/4:t=new Array(n/4);for(var a=0;a<n;a+=4){var i=a/4;t[i]=o.unpack(e,a,t[i])}return t},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 u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},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.divideComponents=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 s=new o;o.lerp=function(e,t,r,n){return o.multiplyByScalar(t,r,s),n=o.multiplyByScalar(e,1-r,n),o.add(s,n,n)};var c=new o;return o.mostOrthogonalAxis=function(e,t){var r=o.normalize(e,c);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,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,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]&&e.w===t[r+3]},o.equalsEpsilon=function(e,t,n,a){return e===t||r(e)&&r(t)&&i.equalsEpsilon(e.x,t.x,n,a)&&i.equalsEpsilon(e.y,t.y,n,a)&&i.equalsEpsilon(e.z,t.z,n,a)&&i.equalsEpsilon(e.w,t.w,n,a)},o.ZERO=a(new o(0,0,0,0)),o.UNIT_X=a(new o(1,0,0,0)),o.UNIT_Y=a(new o(0,1,0,0)),o.UNIT_Z=a(new o(0,0,1,0)),o.UNIT_W=a(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,r){return o.equalsEpsilon(this,e,t,r)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,r,n,a,i,o,u,s,c,l){ +"use strict";function E(e,t,r,a,i,o,u,s,c,l,E,f,h,d,p,m){this[0]=n(e,0),this[1]=n(i,0),this[2]=n(c,0),this[3]=n(h,0),this[4]=n(t,0),this[5]=n(o,0),this[6]=n(l,0),this[7]=n(d,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(E,0),this[11]=n(p,0),this[12]=n(a,0),this[13]=n(s,0),this[14]=n(f,0),this[15]=n(m,0)}E.packedLength=16,E.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t[r++]=e[9],t[r++]=e[10],t[r++]=e[11],t[r++]=e[12],t[r++]=e[13],t[r++]=e[14],t[r]=e[15],t},E.unpack=function(e,t,r){return t=n(t,0),a(r)||(r=new E),r[0]=e[t++],r[1]=e[t++],r[2]=e[t++],r[3]=e[t++],r[4]=e[t++],r[5]=e[t++],r[6]=e[t++],r[7]=e[t++],r[8]=e[t++],r[9]=e[t++],r[10]=e[t++],r[11]=e[t++],r[12]=e[t++],r[13]=e[t++],r[14]=e[t++],r[15]=e[t],r},E.clone=function(e,t){if(a(e))return a(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 E(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])},E.fromArray=E.unpack,E.fromColumnMajorArray=function(e,t){return E.clone(e,t)},E.fromRowMajorArray=function(e,t){return a(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 E(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])},E.fromRotationTranslation=function(t,r,i){return r=n(r,e.ZERO),a(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=r.x,i[13]=r.y,i[14]=r.z,i[15]=1,i):new E(t[0],t[3],t[6],r.x,t[1],t[4],t[7],r.y,t[2],t[5],t[8],r.z,0,0,0,1)},E.fromTranslationQuaternionRotationScale=function(e,t,r,n){a(n)||(n=new E);var i=r.x,o=r.y,u=r.z,s=t.x*t.x,c=t.x*t.y,l=t.x*t.z,f=t.x*t.w,h=t.y*t.y,d=t.y*t.z,p=t.y*t.w,m=t.z*t.z,_=t.z*t.w,T=t.w*t.w,y=s-h-m+T,R=2*(c-_),A=2*(l+p),v=2*(c+_),N=-s+h-m+T,S=2*(d-f),I=2*(l-p),M=2*(d+f),g=-s-h+m+T;return n[0]=y*i,n[1]=v*i,n[2]=I*i,n[3]=0,n[4]=R*o,n[5]=N*o,n[6]=M*o,n[7]=0,n[8]=A*u,n[9]=S*u,n[10]=g*u,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n},E.fromTranslationRotationScale=function(e,t){return E.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},E.fromTranslation=function(e,t){return E.fromRotationTranslation(c.IDENTITY,e,t)},E.fromScale=function(e,t){return a(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 E(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},E.fromUniformScale=function(e,t){return a(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 E(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var f=new e,h=new e,d=new e;E.fromCamera=function(t,r){var n=t.position,i=t.direction,o=t.up;e.normalize(i,f),e.normalize(e.cross(f,o,h),h),e.normalize(e.cross(h,f,d),d);var u=h.x,s=h.y,c=h.z,l=f.x,p=f.y,m=f.z,_=d.x,T=d.y,y=d.z,R=n.x,A=n.y,v=n.z,N=u*-R+s*-A+c*-v,S=_*-R+T*-A+y*-v,I=l*R+p*A+m*v;return a(r)?(r[0]=u,r[1]=_,r[2]=-l,r[3]=0,r[4]=s,r[5]=T,r[6]=-p,r[7]=0,r[8]=c,r[9]=y,r[10]=-m,r[11]=0,r[12]=N,r[13]=S,r[14]=I,r[15]=1,r):new E(u,s,c,N,_,T,y,S,-l,-p,-m,I,0,0,0,1)},E.computePerspectiveFieldOfView=function(e,t,r,n,a){var i=Math.tan(.5*e),o=1/i,u=o/t,s=(n+r)/(r-n),c=2*n*r/(r-n);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=c,a[15]=0,a},E.computeOrthographicOffCenter=function(e,t,r,n,a,i,o){var u=1/(t-e),s=1/(n-r),c=1/(i-a),l=-(t+e)*u,E=-(n+r)*s,f=-(i+a)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=E,o[14]=f,o[15]=1,o},E.computePerspectiveOffCenter=function(e,t,r,n,a,i,o){var u=2*a/(t-e),s=2*a/(n-r),c=(t+e)/(t-e),l=(n+r)/(n-r),E=-(i+a)/(i-a),f=-1,h=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=E,o[11]=f,o[12]=0,o[13]=0,o[14]=h,o[15]=0,o},E.computeInfinitePerspectiveOffCenter=function(e,t,r,n,a,i){var o=2*a/(t-e),u=2*a/(n-r),s=(t+e)/(t-e),c=(n+r)/(n-r),l=-1,E=-1,f=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=s,i[9]=c,i[10]=l,i[11]=E,i[12]=0,i[13]=0,i[14]=f,i[15]=0,i},E.computeViewportTransformation=function(e,t,r,a){e=n(e,n.EMPTY_OBJECT);var i=n(e.x,0),o=n(e.y,0),u=n(e.width,0),s=n(e.height,0);t=n(t,0),r=n(r,1);var c=.5*u,l=.5*s,E=.5*(r-t),f=c,h=l,d=E,p=i+c,m=o+l,_=t+E,T=1;return a[0]=f,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=h,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=d,a[11]=0,a[12]=p,a[13]=m,a[14]=_,a[15]=T,a},E.computeView=function(t,r,n,a,i){return i[0]=a.x,i[1]=n.x,i[2]=-r.x,i[3]=0,i[4]=a.y,i[5]=n.y,i[6]=-r.y,i[7]=0,i[8]=a.z,i[9]=n.z,i[10]=-r.z,i[11]=0,i[12]=-e.dot(a,t),i[13]=-e.dot(n,t),i[14]=e.dot(r,t),i[15]=1,i},E.toArray=function(e,t){return a(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]]},E.getElementIndex=function(e,t){return 4*e+t},E.getColumn=function(e,t,r){var n=4*t,a=e[n],i=e[n+1],o=e[n+2],u=e[n+3];return r.x=a,r.y=i,r.z=o,r.w=u,r},E.setColumn=function(e,t,r,n){n=E.clone(e,n);var a=4*t;return n[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n[a+3]=r.w,n},E.setTranslation=function(e,t,r){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]=t.x,r[13]=t.y,r[14]=t.z,r[15]=e[15],r},E.getRow=function(e,t,r){var n=e[t],a=e[t+4],i=e[t+8],o=e[t+12];return r.x=n,r.y=a,r.z=i,r.w=o,r},E.setRow=function(e,t,r,n){return n=E.clone(e,n),n[t]=r.x,n[t+4]=r.y,n[t+8]=r.z,n[t+12]=r.w,n};var p=new e;E.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],p)),r.y=e.magnitude(e.fromElements(t[4],t[5],t[6],p)),r.z=e.magnitude(e.fromElements(t[8],t[9],t[10],p)),r};var m=new e;E.getMaximumScale=function(t){return E.getScale(t,m),e.maximumComponent(m)},E.multiply=function(e,t,r){var n=e[0],a=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],E=e[8],f=e[9],h=e[10],d=e[11],p=e[12],m=e[13],_=e[14],T=e[15],y=t[0],R=t[1],A=t[2],v=t[3],N=t[4],S=t[5],I=t[6],M=t[7],g=t[8],O=t[9],C=t[10],w=t[11],x=t[12],P=t[13],L=t[14],b=t[15],U=n*y+u*R+E*A+p*v,F=a*y+s*R+f*A+m*v,D=i*y+c*R+h*A+_*v,B=o*y+l*R+d*A+T*v,z=n*N+u*S+E*I+p*M,G=a*N+s*S+f*I+m*M,V=i*N+c*S+h*I+_*M,q=o*N+l*S+d*I+T*M,X=n*g+u*O+E*C+p*w,H=a*g+s*O+f*C+m*w,W=i*g+c*O+h*C+_*w,k=o*g+l*O+d*C+T*w,Y=n*x+u*P+E*L+p*b,Z=a*x+s*P+f*L+m*b,K=i*x+c*P+h*L+_*b,j=o*x+l*P+d*L+T*b;return r[0]=U,r[1]=F,r[2]=D,r[3]=B,r[4]=z,r[5]=G,r[6]=V,r[7]=q,r[8]=X,r[9]=H,r[10]=W,r[11]=k,r[12]=Y,r[13]=Z,r[14]=K,r[15]=j,r},E.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},E.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},E.multiplyTransformation=function(e,t,r){var n=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],E=e[10],f=e[12],h=e[13],d=e[14],p=t[0],m=t[1],_=t[2],T=t[4],y=t[5],R=t[6],A=t[8],v=t[9],N=t[10],S=t[12],I=t[13],M=t[14],g=n*p+o*m+c*_,O=a*p+u*m+l*_,C=i*p+s*m+E*_,w=n*T+o*y+c*R,x=a*T+u*y+l*R,P=i*T+s*y+E*R,L=n*A+o*v+c*N,b=a*A+u*v+l*N,U=i*A+s*v+E*N,F=n*S+o*I+c*M+f,D=a*S+u*I+l*M+h,B=i*S+s*I+E*M+d;return r[0]=g,r[1]=O,r[2]=C,r[3]=0,r[4]=w,r[5]=x,r[6]=P,r[7]=0,r[8]=L,r[9]=b,r[10]=U,r[11]=0,r[12]=F,r[13]=D,r[14]=B,r[15]=1,r},E.multiplyByMatrix3=function(e,t,r){var n=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],E=e[10],f=t[0],h=t[1],d=t[2],p=t[3],m=t[4],_=t[5],T=t[6],y=t[7],R=t[8],A=n*f+o*h+c*d,v=a*f+u*h+l*d,N=i*f+s*h+E*d,S=n*p+o*m+c*_,I=a*p+u*m+l*_,M=i*p+s*m+E*_,g=n*T+o*y+c*R,O=a*T+u*y+l*R,C=i*T+s*y+E*R;return r[0]=A,r[1]=v,r[2]=N,r[3]=0,r[4]=S,r[5]=I,r[6]=M,r[7]=0,r[8]=g,r[9]=O,r[10]=C,r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r},E.multiplyByTranslation=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=n*e[0]+a*e[4]+i*e[8]+e[12],u=n*e[1]+a*e[5]+i*e[9]+e[13],s=n*e[2]+a*e[6]+i*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]=o,r[13]=u,r[14]=s,r[15]=e[15],r};var _=new e;E.multiplyByUniformScale=function(e,t,r){return _.x=t,_.y=t,_.z=t,E.multiplyByScale(e,_,r)},E.multiplyByScale=function(e,t,r){var n=t.x,a=t.y,i=t.z;return 1===n&&1===a&&1===i?E.clone(e,r):(r[0]=n*e[0],r[1]=n*e[1],r[2]=n*e[2],r[3]=0,r[4]=a*e[4],r[5]=a*e[5],r[6]=a*e[6],r[7]=0,r[8]=i*e[8],r[9]=i*e[9],r[10]=i*e[10],r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=1,r)},E.multiplyByVector=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=t.w,u=e[0]*n+e[4]*a+e[8]*i+e[12]*o,s=e[1]*n+e[5]*a+e[9]*i+e[13]*o,c=e[2]*n+e[6]*a+e[10]*i+e[14]*o,l=e[3]*n+e[7]*a+e[11]*i+e[15]*o;return r.x=u,r.y=s,r.z=c,r.w=l,r},E.multiplyByPointAsVector=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=e[0]*n+e[4]*a+e[8]*i,u=e[1]*n+e[5]*a+e[9]*i,s=e[2]*n+e[6]*a+e[10]*i;return r.x=o,r.y=u,r.z=s,r},E.multiplyByPoint=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=e[0]*n+e[4]*a+e[8]*i+e[12],u=e[1]*n+e[5]*a+e[9]*i+e[13],s=e[2]*n+e[6]*a+e[10]*i+e[14];return r.x=o,r.y=u,r.z=s,r},E.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},E.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},E.transpose=function(e,t){var r=e[1],n=e[2],a=e[3],i=e[6],o=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]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=o,t[14]=u,t[15]=e[15],t},E.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},E.equals=function(e,t){return e===t||a(e)&&a(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},E.equalsEpsilon=function(e,t,r){return e===t||a(e)&&a(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r&&Math.abs(e[9]-t[9])<=r&&Math.abs(e[10]-t[10])<=r&&Math.abs(e[11]-t[11])<=r&&Math.abs(e[12]-t[12])<=r&&Math.abs(e[13]-t[13])<=r&&Math.abs(e[14]-t[14])<=r&&Math.abs(e[15]-t[15])<=r},E.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},E.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};var T=new c,y=new c,R=new t,A=new t(0,0,0,1);return E.inverse=function(e,r){if(c.equalsEpsilon(E.getRotation(e,T),y,s.EPSILON7)&&t.equals(E.getRow(e,3,R),A))return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=0,r[11]=0,r[12]=-e[12],r[13]=-e[13],r[14]=-e[14],r[15]=1,r;var n=e[0],a=e[4],i=e[8],o=e[12],u=e[1],f=e[5],h=e[9],d=e[13],p=e[2],m=e[6],_=e[10],v=e[14],N=e[3],S=e[7],I=e[11],M=e[15],g=_*M,O=v*I,C=m*M,w=v*S,x=m*I,P=_*S,L=p*M,b=v*N,U=p*I,F=_*N,D=p*S,B=m*N,z=g*f+w*h+x*d-(O*f+C*h+P*d),G=O*u+L*h+F*d-(g*u+b*h+U*d),V=C*u+b*f+D*d-(w*u+L*f+B*d),q=P*u+U*f+B*h-(x*u+F*f+D*h),X=O*a+C*i+P*o-(g*a+w*i+x*o),H=g*n+b*i+U*o-(O*n+L*i+F*o),W=w*n+L*a+B*o-(C*n+b*a+D*o),k=x*n+F*a+D*i-(P*n+U*a+B*i);g=i*d,O=o*h,C=a*d,w=o*f,x=a*h,P=i*f,L=n*d,b=o*u,U=n*h,F=i*u,D=n*f,B=a*u;var Y=g*S+w*I+x*M-(O*S+C*I+P*M),Z=O*N+L*I+F*M-(g*N+b*I+U*M),K=C*N+b*S+D*M-(w*N+L*S+B*M),j=P*N+U*S+B*I-(x*N+F*S+D*I),Q=C*_+P*v+O*m-(x*v+g*m+w*_),J=U*v+g*p+b*_-(L*_+F*v+O*p),$=L*m+B*v+w*p-(D*v+C*p+b*m),ee=D*_+x*p+F*m-(U*m+B*_+P*p),te=n*z+a*G+i*V+o*q;if(Math.abs(te)<s.EPSILON20)throw new l("matrix is not invertible because its determinate is zero.");return te=1/te,r[0]=z*te,r[1]=G*te,r[2]=V*te,r[3]=q*te,r[4]=X*te,r[5]=H*te,r[6]=W*te,r[7]=k*te,r[8]=Y*te,r[9]=Z*te,r[10]=K*te,r[11]=j*te,r[12]=Q*te,r[13]=J*te,r[14]=$*te,r[15]=ee*te,r},E.inverseTransformation=function(e,t){var r=e[0],n=e[1],a=e[2],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],E=e[12],f=e[13],h=e[14],d=-r*E-n*f-a*h,p=-i*E-o*f-u*h,m=-s*E-c*f-l*h;return t[0]=r,t[1]=i,t[2]=s,t[3]=0,t[4]=n,t[5]=o,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=l,t[11]=0,t[12]=d,t[13]=p,t[14]=m,t[15]=1,t},E.IDENTITY=u(new E(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),E.ZERO=u(new E(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),E.COLUMN0ROW0=0,E.COLUMN0ROW1=1,E.COLUMN0ROW2=2,E.COLUMN0ROW3=3,E.COLUMN1ROW0=4,E.COLUMN1ROW1=5,E.COLUMN1ROW2=6,E.COLUMN1ROW3=7,E.COLUMN2ROW0=8,E.COLUMN2ROW1=9,E.COLUMN2ROW2=10,E.COLUMN2ROW3=11,E.COLUMN3ROW0=12,E.COLUMN3ROW1=13,E.COLUMN3ROW2=14,E.COLUMN3ROW3=15,i(E.prototype,{length:{get:function(){return E.packedLength}}}),E.prototype.clone=function(e){return E.clone(this,e)},E.prototype.equals=function(e){return E.equals(this,e)},E.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]&&e[9]===t[r+9]&&e[10]===t[r+10]&&e[11]===t[r+11]&&e[12]===t[r+12]&&e[13]===t[r+13]&&e[14]===t[r+14]&&e[15]===t[r+15]},E.prototype.equalsEpsilon=function(e,t){return E.equalsEpsilon(this,e,t)},E.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]+")"},E}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,r,n,a,i,o,u,s){"use strict";function c(e,t,n,a){this.west=r(e,0),this.south=r(t,0),this.east=r(n,0),this.north=r(a,0)}a(c.prototype,{width:{get:function(){return c.computeWidth(this)}},height:{get:function(){return c.computeHeight(this)}}}),c.packedLength=4,c.pack=function(e,t,n){return n=r(n,0),t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t},c.unpack=function(e,t,a){return t=r(t,0),n(a)||(a=new c),a.west=e[t++],a.south=e[t++],a.east=e[t++],a.north=e[t],a},c.computeWidth=function(e){var t=e.east,r=e.west;return t<r&&(t+=s.TWO_PI),t-r},c.computeHeight=function(e){return e.north-e.south},c.fromDegrees=function(e,t,a,i,o){return e=s.toRadians(r(e,0)),t=s.toRadians(r(t,0)),a=s.toRadians(r(a,0)),i=s.toRadians(r(i,0)),n(o)?(o.west=e,o.south=t,o.east=a,o.north=i,o):new c(e,t,a,i)},c.fromRadians=function(e,t,a,i,o){return n(o)?(o.west=r(e,0),o.south=r(t,0),o.east=r(a,0),o.north=r(i,0),o):new c(e,t,a,i)},c.fromCartographicArray=function(e,t){for(var r=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,u=Number.MAX_VALUE,l=-Number.MAX_VALUE,E=0,f=e.length;E<f;E++){var h=e[E];r=Math.min(r,h.longitude),a=Math.max(a,h.longitude),u=Math.min(u,h.latitude),l=Math.max(l,h.latitude);var d=h.longitude>=0?h.longitude:h.longitude+s.TWO_PI;i=Math.min(i,d),o=Math.max(o,d)}return a-r>o-i&&(r=i,a=o,a>s.PI&&(a-=s.TWO_PI),r>s.PI&&(r-=s.TWO_PI)),n(t)?(t.west=r,t.south=u,t.east=a,t.north=l,t):new c(r,u,a,l)},c.fromCartesianArray=function(e,t,r){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,u=-Number.MAX_VALUE,l=Number.MAX_VALUE,E=-Number.MAX_VALUE,f=0,h=e.length;f<h;f++){var d=t.cartesianToCartographic(e[f]);a=Math.min(a,d.longitude),i=Math.max(i,d.longitude),l=Math.min(l,d.latitude),E=Math.max(E,d.latitude);var p=d.longitude>=0?d.longitude:d.longitude+s.TWO_PI;o=Math.min(o,p),u=Math.max(u,p)}return i-a>u-o&&(a=o,i=u,i>s.PI&&(i-=s.TWO_PI),a>s.PI&&(a-=s.TWO_PI)),n(r)?(r.west=a,r.south=l,r.east=i,r.north=E,r):new c(a,l,i,E)},c.clone=function(e,t){if(n(e))return n(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new c(e.west,e.south,e.east,e.north)},c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.equals=function(e,t){return e===t||n(e)&&n(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},c.prototype.equalsEpsilon=function(e,t){return n(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},c.validate=function(e){},c.southwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.south,r.height=0,r):new e(t.west,t.south)},c.northwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.north,r.height=0,r):new e(t.west,t.north)},c.northeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.north,r.height=0,r):new e(t.east,t.north)},c.southeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.south,r.height=0,r):new e(t.east,t.south)},c.center=function(t,r){var a=t.east,i=t.west;a<i&&(a+=s.TWO_PI);var o=s.negativePiToPi(.5*(i+a)),u=.5*(t.south+t.north);return n(r)?(r.longitude=o,r.latitude=u,r.height=0,r):new e(o,u)},c.intersection=function(e,t,r){var a=e.east,i=e.west,o=t.east,u=t.west;a<i&&o>0?a+=s.TWO_PI:o<u&&a>0&&(o+=s.TWO_PI),a<i&&u<0?u+=s.TWO_PI:o<u&&i<0&&(i+=s.TWO_PI);var l=s.negativePiToPi(Math.max(i,u)),E=s.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&E<=l)){var f=Math.max(e.south,t.south),h=Math.min(e.north,t.north);if(!(f>=h))return n(r)?(r.west=l,r.south=f,r.east=E,r.north=h,r):new c(l,f,E,h)}},c.simpleIntersection=function(e,t,r){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(i>=u||a>=o))return n(r)?(r.west=a,r.south=i,r.east=o,r.north=u,r):new c(a,i,o,u)},c.union=function(e,t,r){n(r)||(r=new c);var a=e.east,i=e.west,o=t.east,u=t.west;a<i&&o>0?a+=s.TWO_PI:o<u&&a>0&&(o+=s.TWO_PI),a<i&&u<0?u+=s.TWO_PI:o<u&&i<0&&(i+=s.TWO_PI);var l=s.convertLongitudeRange(Math.min(i,u)),E=s.convertLongitudeRange(Math.max(a,o));return r.west=l,r.south=Math.min(e.south,t.south),r.east=E,r.north=Math.max(e.north,t.north),r},c.expand=function(e,t,r){return n(r)||(r=new c),r.west=Math.min(e.west,t.longitude),r.south=Math.min(e.south,t.latitude),r.east=Math.max(e.east,t.longitude),r.north=Math.max(e.north,t.latitude),r},c.contains=function(e,t){var r=t.longitude,n=t.latitude,a=e.west,i=e.east;return i<a&&(i+=s.TWO_PI,r<0&&(r+=s.TWO_PI)),(r>a||s.equalsEpsilon(r,a,s.EPSILON14))&&(r<i||s.equalsEpsilon(r,i,s.EPSILON14))&&n>=e.south&&n<=e.north};var l=new e;return c.subsample=function(e,t,a,i){t=r(t,o.WGS84),a=r(a,0),n(i)||(i=[]);var u=0,E=e.north,f=e.south,h=e.east,d=e.west,p=l;p.height=a,p.longitude=d,p.latitude=E,i[u]=t.cartographicToCartesian(p,i[u]),u++,p.longitude=h,i[u]=t.cartographicToCartesian(p,i[u]),u++,p.latitude=f,i[u]=t.cartographicToCartesian(p,i[u]),u++,p.longitude=d,i[u]=t.cartographicToCartesian(p,i[u]),u++,E<0?p.latitude=E:f>0?p.latitude=f:p.latitude=0;for(var m=1;m<8;++m)p.longitude=-Math.PI+m*s.PI_OVER_TWO,c.contains(e,p)&&(i[u]=t.cartographicToCartesian(p,i[u]),u++);return 0===p.latitude&&(p.longitude=d,i[u]=t.cartographicToCartesian(p,i[u]),u++,p.longitude=h,i[u]=t.cartographicToCartesian(p,i[u]),u++),i.length=u,i},c.MAX_VALUE=u(new c(-Math.PI,-s.PI_OVER_TWO,Math.PI,s.PI_OVER_TWO)),c}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,r,n,a,i,o,u,s,c,l,E){"use strict";function f(t,r){this.center=e.clone(n(t,e.ZERO)),this.radius=n(r,0)}var h=new e,d=new e,p=new e,m=new e,_=new e,T=new e,y=new e,R=new e,A=new e,v=new e,N=new e,S=new e;f.fromPoints=function(t,r){if(a(r)||(r=new f),!a(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;for(var n=e.clone(t[0],y),i=e.clone(n,h),o=e.clone(n,d),u=e.clone(n,p),s=e.clone(n,m),c=e.clone(n,_),l=e.clone(n,T),E=t.length,I=1;I<E;I++){e.clone(t[I],n);var M=n.x,g=n.y,O=n.z;M<i.x&&e.clone(n,i),M>s.x&&e.clone(n,s),g<o.y&&e.clone(n,o),g>c.y&&e.clone(n,c),O<u.z&&e.clone(n,u),O>l.z&&e.clone(n,l)}var C=e.magnitudeSquared(e.subtract(s,i,R)),w=e.magnitudeSquared(e.subtract(c,o,R)),x=e.magnitudeSquared(e.subtract(l,u,R)),P=i,L=s,b=C;w>b&&(b=w,P=o,L=c),x>b&&(b=x,P=u,L=l);var U=A;U.x=.5*(P.x+L.x),U.y=.5*(P.y+L.y),U.z=.5*(P.z+L.z);var F=e.magnitudeSquared(e.subtract(L,U,R)),D=Math.sqrt(F),B=v;B.x=i.x,B.y=o.y,B.z=u.z;var z=N;z.x=s.x,z.y=c.y,z.z=l.z;var G=e.multiplyByScalar(e.add(B,z,R),.5,S),V=0;for(I=0;I<E;I++){e.clone(t[I],n);var q=e.magnitude(e.subtract(n,G,R));q>V&&(V=q);var X=e.magnitudeSquared(e.subtract(n,U,R));if(X>F){var H=Math.sqrt(X);D=.5*(D+H),F=D*D;var W=H-D;U.x=(D*U.x+W*n.x)/H,U.y=(D*U.y+W*n.y)/H,U.z=(D*U.z+W*n.z)/H}}return D<V?(e.clone(U,r.center),r.radius=D):(e.clone(G,r.center),r.radius=V),r};var I=new o,M=new e,g=new e,O=new t,C=new t;f.fromRectangle2D=function(e,t,r){return f.fromRectangleWithHeights2D(e,t,0,0,r)},f.fromRectangleWithHeights2D=function(t,r,i,o,u){if(a(u)||(u=new f),!a(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;r=n(r,I),E.southwest(t,O),O.height=i,E.northeast(t,C),C.height=o;var s=r.project(O,M),c=r.project(C,g),l=c.x-s.x,h=c.y-s.y,d=c.z-s.z;u.radius=.5*Math.sqrt(l*l+h*h+d*d);var p=u.center;return p.x=s.x+.5*l,p.y=s.y+.5*h,p.z=s.z+.5*d,u};var w=[];f.fromRectangle3D=function(e,t,r,o){t=n(t,i.WGS84),r=n(r,0);var u;return a(e)&&(u=E.subsample(e,t,r,w)),f.fromPoints(u,o)},f.fromVertices=function(t,r,i,o){if(a(o)||(o=new f),!a(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;r=n(r,e.ZERO),i=n(i,3);var u=y;u.x=t[0]+r.x,u.y=t[1]+r.y,u.z=t[2]+r.z;for(var s=e.clone(u,h),c=e.clone(u,d),l=e.clone(u,p),E=e.clone(u,m),I=e.clone(u,_),M=e.clone(u,T),g=t.length,O=0;O<g;O+=i){var C=t[O]+r.x,w=t[O+1]+r.y,x=t[O+2]+r.z;u.x=C,u.y=w,u.z=x,C<s.x&&e.clone(u,s),C>E.x&&e.clone(u,E),w<c.y&&e.clone(u,c),w>I.y&&e.clone(u,I),x<l.z&&e.clone(u,l),x>M.z&&e.clone(u,M)}var P=e.magnitudeSquared(e.subtract(E,s,R)),L=e.magnitudeSquared(e.subtract(I,c,R)),b=e.magnitudeSquared(e.subtract(M,l,R)),U=s,F=E,D=P;L>D&&(D=L,U=c,F=I),b>D&&(D=b,U=l,F=M);var B=A;B.x=.5*(U.x+F.x),B.y=.5*(U.y+F.y),B.z=.5*(U.z+F.z);var z=e.magnitudeSquared(e.subtract(F,B,R)),G=Math.sqrt(z),V=v;V.x=s.x,V.y=c.y,V.z=l.z;var q=N;q.x=E.x,q.y=I.y,q.z=M.z;var X=e.multiplyByScalar(e.add(V,q,R),.5,S),H=0;for(O=0;O<g;O+=i){u.x=t[O]+r.x,u.y=t[O+1]+r.y,u.z=t[O+2]+r.z;var W=e.magnitude(e.subtract(u,X,R));W>H&&(H=W);var k=e.magnitudeSquared(e.subtract(u,B,R));if(k>z){var Y=Math.sqrt(k);G=.5*(G+Y),z=G*G;var Z=Y-G;B.x=(G*B.x+Z*u.x)/Y,B.y=(G*B.y+Z*u.y)/Y,B.z=(G*B.z+Z*u.z)/Y}}return G<H?(e.clone(B,o.center),o.radius=G):(e.clone(X,o.center),o.radius=H),o},f.fromEncodedCartesianVertices=function(t,r,n){if(a(n)||(n=new f),!a(t)||!a(r)||t.length!==r.length||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var i=y;i.x=t[0]+r[0],i.y=t[1]+r[1],i.z=t[2]+r[2];for(var o=e.clone(i,h),u=e.clone(i,d),s=e.clone(i,p),c=e.clone(i,m),l=e.clone(i,_),E=e.clone(i,T),I=t.length,M=0;M<I;M+=3){var g=t[M]+r[M],O=t[M+1]+r[M+1],C=t[M+2]+r[M+2];i.x=g,i.y=O,i.z=C,g<o.x&&e.clone(i,o),g>c.x&&e.clone(i,c),O<u.y&&e.clone(i,u),O>l.y&&e.clone(i,l),C<s.z&&e.clone(i,s),C>E.z&&e.clone(i,E)}var w=e.magnitudeSquared(e.subtract(c,o,R)),x=e.magnitudeSquared(e.subtract(l,u,R)),P=e.magnitudeSquared(e.subtract(E,s,R)),L=o,b=c,U=w;x>U&&(U=x,L=u,b=l),P>U&&(U=P,L=s,b=E);var F=A;F.x=.5*(L.x+b.x),F.y=.5*(L.y+b.y),F.z=.5*(L.z+b.z);var D=e.magnitudeSquared(e.subtract(b,F,R)),B=Math.sqrt(D),z=v;z.x=o.x,z.y=u.y,z.z=s.z;var G=N;G.x=c.x,G.y=l.y,G.z=E.z;var V=e.multiplyByScalar(e.add(z,G,R),.5,S),q=0;for(M=0;M<I;M+=3){i.x=t[M]+r[M],i.y=t[M+1]+r[M+1],i.z=t[M+2]+r[M+2];var X=e.magnitude(e.subtract(i,V,R));X>q&&(q=X);var H=e.magnitudeSquared(e.subtract(i,F,R));if(H>D){var W=Math.sqrt(H);B=.5*(B+W),D=B*B;var k=W-B;F.x=(B*F.x+k*i.x)/W,F.y=(B*F.y+k*i.y)/W,F.z=(B*F.z+k*i.z)/W}}return B<q?(e.clone(F,n.center),n.radius=B):(e.clone(V,n.center),n.radius=q),n},f.fromCornerPoints=function(t,r,n){a(n)||(n=new f);var i=n.center;return e.add(t,r,i),e.multiplyByScalar(i,.5,i),n.radius=e.distance(i,r),n},f.fromEllipsoid=function(t,r){return a(r)||(r=new f),e.clone(e.ZERO,r.center),r.radius=t.maximumRadius,r};var x=new e;f.fromBoundingSpheres=function(t,r){if(a(r)||(r=new f),!a(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var n=t.length;if(1===n)return f.clone(t[0],r);if(2===n)return f.union(t[0],t[1],r);for(var i=[],o=0;o<n;o++)i.push(t[o].center);r=f.fromPoints(i,r);var u=r.center,s=r.radius;for(o=0;o<n;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,x)+c.radius)}return r.radius=s,r};var P=new e,L=new e,b=new e;f.fromOrientedBoundingBox=function(t,r){a(r)||(r=new f);var n=t.halfAxes,i=c.getColumn(n,0,P),o=c.getColumn(n,1,L),u=c.getColumn(n,2,b),s=e.magnitude(i),l=e.magnitude(o),E=e.magnitude(u);return r.center=e.clone(t.center,r.center),r.radius=Math.max(s,l,E),r},f.clone=function(t,r){if(a(t))return a(r)?(r.center=e.clone(t.center,r.center),r.radius=t.radius,r):new f(t.center,t.radius)},f.packedLength=4,f.pack=function(e,t,r){r=n(r,0);var a=e.center;return t[r++]=a.x,t[r++]=a.y,t[r++]=a.z,t[r]=e.radius,t},f.unpack=function(e,t,r){t=n(t,0),a(r)||(r=new f);var i=r.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],r.radius=e[t],r};var U=new e,F=new e;f.union=function(t,r,n){a(n)||(n=new f);var i=t.center,o=t.radius,u=r.center,s=r.radius,c=e.subtract(u,i,U),l=e.magnitude(c);if(o>=l+s)return t.clone(n),n;if(s>=l+o)return r.clone(n),n;var E=.5*(o+l+s),h=e.multiplyByScalar(c,(-o+E)/l,F);return e.add(h,i,h),e.clone(h,n.center),n.radius=E,n};var D=new e;f.expand=function(t,r,n){n=f.clone(t,n);var a=e.magnitude(e.subtract(r,n.center,D));return a>n.radius&&(n.radius=a),n},f.intersectPlane=function(t,r){var n=t.center,a=t.radius,i=r.normal,o=e.dot(i,n)+r.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},f.transform=function(e,t,r){return a(r)||(r=new f),r.center=l.multiplyByPoint(t,e.center,r.center),r.radius=l.getMaximumScale(t)*e.radius,r};var B=new e;f.distanceSquaredTo=function(t,r){var n=e.subtract(t.center,r,B);return e.magnitudeSquared(n)-t.radius*t.radius},f.transformWithoutScale=function(e,t,r){return a(r)||(r=new f),r.center=l.multiplyByPoint(t,e.center,r.center),r.radius=e.radius,r};var z=new e;f.computePlaneDistances=function(t,r,n,i){a(i)||(i=new s);var o=e.subtract(t.center,r,z),u=e.dot(n,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var G=new e,V=new e,q=new e,X=new e,H=new e,W=new t,k=new Array(8),Y=0;Y<8;++Y)k[Y]=new e;var Z=new o;return f.projectTo2D=function(t,r,a){r=n(r,Z);var i=r.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,G),c=e.cross(e.UNIT_Z,s,V);e.normalize(c,c);var l=e.cross(s,c,q);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var E=e.negate(l,H),h=e.negate(c,X),d=k,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,E,p),e.add(p,h,p),p=d[3],e.add(s,E,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,E,p),e.add(p,h,p),p=d[7],e.add(s,E,p),e.add(p,c,p);for(var m=d.length,_=0;_<m;++_){var T=d[_];e.add(o,T,T);var y=i.cartesianToCartographic(T,W);r.project(y,T)}a=f.fromPoints(d,a),o=a.center;var R=o.x,A=o.y,v=o.z;return o.x=v,o.y=R,o.z=A,a},f.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},f.equals=function(t,r){return t===r||a(t)&&a(r)&&e.equals(t.center,r.center)&&t.radius===r.radius},f.prototype.intersectPlane=function(e){return f.intersectPlane(this,e)},f.prototype.distanceSquaredTo=function(e){return f.distanceSquaredTo(this,e)},f.prototype.computePlaneDistances=function(e,t,r){return f.computePlaneDistances(this,e,t,r)},f.prototype.isOccluded=function(e){return f.isOccluded(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},a={};return t(a,{element:{get:function(){if(a.supportsFullscreen())return document[n.fullscreenElement]}},changeEventName:{get:function(){if(a.supportsFullscreen())return n.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return n.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[n.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.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 a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(n.requestFullscreen=a,r=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(n.requestFullscreen=a,r=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?n.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(n.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?n.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(n.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?n.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(n.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),n.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),n.fullscreenerror=a)}return r},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[n.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[n.exitFullscreen]()},a}),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;r<n;++r)t[r]=parseInt(t[r],10);return t}function a(){if(!t(A)&&(A=!1,!f())){var e=/ Chrome\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(A=!0,v=n(e[1]))}return A}function i(){return a()&&v}function o(){if(!t(N)&&(N=!1,!a()&&!f()&&/ Safari\/[\.0-9]+/.test(R.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(N=!0,S=n(e[1]))}return N}function u(){return o()&&S}function s(){if(!t(I)){I=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(R.userAgent);null!==e&&(I=!0,M=n(e[1]),M.isNightly=!!e[2])}return I}function c(){return s()&&M}function l(){if(!t(g)){g=!1;var e;"Microsoft Internet Explorer"===R.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(g=!0,O=n(e[1]))):"Netscape"===R.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(g=!0,O=n(e[1])))}return g}function E(){return l()&&O}function f(){if(!t(C)){C=!1;var e=/ Edge\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(C=!0,w=n(e[1]))}return C}function h(){return f()&&w}function d(){if(!t(x)){x=!1;var e=/Firefox\/([\.0-9]+)/.exec(R.userAgent); +null!==e&&(x=!0,P=n(e[1]))}return x}function p(){return t(L)||(L=/Windows/i.test(R.appVersion)),L}function m(){return d()&&P}function _(){return t(b)||(b="undefined"!=typeof PointerEvent&&(!t(R.pointerEnabled)||R.pointerEnabled)),b}function T(){if(!t(F)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var r=e.style.imageRendering;F=t(r)&&""!==r,F&&(U=r)}return F}function y(){return T()?U:void 0}var R;R="undefined"!=typeof navigator?navigator:{};var A,v,N,S,I,M,g,O,C,w,x,P,L,b,U,F,D={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:E,isEdge:f,edgeVersion:h,isFirefox:d,firefoxVersion:m,isWindows:p,hardwareConcurrency:e(R.hardwareConcurrency,3),supportsPointerEvents:_,supportsImageRenderingPixelated:T,imageRenderingValue:y};return D.supportsFullscreen=function(){return r.supportsFullscreen()},D.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},D.supportsWebWorkers=function(){return"undefined"!=typeof Worker},D}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,r,n,a,i){"use strict";if(!n.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){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.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},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 Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,r,n,a){switch(n=e(n,0),a=e(a,(r.byteLength-n)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(r,n,a);case o.UNSIGNED_BYTE:return new Uint8Array(r,n,a);case o.SHORT:return new Int16Array(r,n,a);case o.UNSIGNED_SHORT:return new Uint16Array(r,n,a);case o.INT:return new Int32Array(r,n,a);case o.UNSIGNED_INT:return new Uint32Array(r,n,a);case o.FLOAT:return new Float32Array(r,n,a);case o.DOUBLE:return new Float64Array(r,n,a)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var r={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,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,t,r,n,a){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,a.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,n.NONE),this.boundingSphereCV=t.boundingSphereCV}return i.computeNumberOfVertices=function(e){var r=-1;for(var n in e.attributes)if(e.attributes.hasOwnProperty(n)&&t(e.attributes[n])&&t(e.attributes[n].values)){var a=e.attributes[n],i=a.values.length/a.componentsPerAttribute;r=i}return r},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(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 n}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i){"use strict";function o(e,r){this.x=t(e,0),this.y=t(r,0)}o.fromElements=function(e,t,n){return r(n)?(n.x=e,n.y=t,n):new o(e,t)},o.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t):new o(e.x,e.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n]=e.y,r},o.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new o),a.x=e[n++],a.y=e[n],a},o.packArray=function(e,t){var n=e.length;r(t)?t.length=2*n:t=new Array(2*n);for(var a=0;a<n;++a)o.pack(e[a],t,2*a);return t},o.unpackArray=function(e,t){var n=e.length;r(t)?t.length=n/2:t=new Array(n/2);for(var a=0;a<n;a+=2){var i=a/2;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y)},o.minimumComponent=function(e){return Math.min(e.x,e.y)},o.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),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},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var r=o.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y},o.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r},o.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r},o.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r},o.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r},o.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r},o.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var s=new o;o.lerp=function(e,t,r,n){return o.multiplyByScalar(t,r,s),n=o.multiplyByScalar(e,1-r,n),o.add(s,n,n)};var c=new o,l=new o;o.angleBetween=function(e,t){return o.normalize(e,c),o.normalize(t,l),i.acosClamped(o.dot(c,l))};var E=new o;return o.mostOrthogonalAxis=function(e,t){var r=o.normalize(e,E);return o.abs(r,r),t=r.x<=r.y?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y},o.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]},o.equalsEpsilon=function(e,t,n,a){return e===t||r(e)&&r(t)&&i.equalsEpsilon(e.x,t.x,n,a)&&i.equalsEpsilon(e.y,t.y,n,a)},o.ZERO=a(new o(0,0)),o.UNIT_X=a(new o(1,0)),o.UNIT_Y=a(new o(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,r){return o.equalsEpsilon(this,e,t,r)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,r,n,a){"use strict";var i={};i.octEncodeInRange=function(e,t,r){if(r.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),r.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var n=r.x,i=r.y;r.x=(1-Math.abs(i))*a.signNotZero(n),r.y=(1-Math.abs(n))*a.signNotZero(i)}return r.x=a.toSNorm(r.x,t),r.y=a.toSNorm(r.y,t),r},i.octEncode=function(e,t){return i.octEncodeInRange(e,255,t)},i.octDecodeInRange=function(e,r,n,i){if(i.x=a.fromSNorm(e,n),i.y=a.fromSNorm(r,n),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){var o=i.x;i.x=(1-Math.abs(i.y))*a.signNotZero(o),i.y=(1-Math.abs(o))*a.signNotZero(i.y)}return t.normalize(i,i)},i.octDecode=function(e,t,r){return i.octDecodeInRange(e,t,255,r)},i.octPackFloat=function(e){return 256*e.x+e.y};var o=new e;return i.octEncodeFloat=function(e){return i.octEncode(e,o),i.octPackFloat(o)},i.octDecodeFloat=function(e,t){var r=e/256,n=Math.floor(r),a=256*(r-n);return i.octDecode(n,a,t)},i.octPack=function(e,t,r,n){var a=i.octEncodeFloat(e),u=i.octEncodeFloat(t),s=i.octEncode(r,o);return n.x=65536*s.x+a,n.y=65536*s.y+u,n},i.octUnpack=function(e,t,r,n){var a=e.x/65536,o=Math.floor(a),u=65536*(a-o);a=e.y/65536;var s=Math.floor(a),c=65536*(a-s);i.octDecodeFloat(u,t),i.octDecodeFloat(c,r),i.octDecode(o,s,n)},i.compressTextureCoordinates=function(e){var t=4095*e.x|0,r=4095*e.y|0;return 4096*t+r},i.decompressTextureCoordinates=function(e,t){var r=e/4096,n=Math.floor(r);return t.x=n/4095,t.y=(e-4096*n)/4095,t},i}),define("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function a(n,a,s,c,l){r(l)||(l=new t);var E,f,h,d,p,m,_,T;r(a.z)?(E=t.subtract(s,a,i),f=t.subtract(c,a,o),h=t.subtract(n,a,u),d=t.dot(E,E),p=t.dot(E,f),m=t.dot(E,h),_=t.dot(f,f),T=t.dot(f,h)):(E=e.subtract(s,a,i),f=e.subtract(c,a,o),h=e.subtract(n,a,u),d=e.dot(E,E),p=e.dot(E,f),m=e.dot(E,h),_=e.dot(f,f),T=e.dot(f,h));var y=1/(d*_-p*p);return l.y=(_*m-p*T)*y,l.z=(d*T-p*m)*y,l.x=1-l.y-l.z,l}var i=new t,o=new t,u=new t;return a}),define("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(r,n){t(a[r])||(a[r]=!0,console.warn(e(n,r)))}var a={};return n.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.",n}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,r){"use strict";function n(e,t){r(e,t)}return n}),define("Core/EncodedCartesian3",["./Cartesian3","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(){this.high=e.clone(e.ZERO),this.low=e.clone(e.ZERO)}n.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 a={high:0,low:0};n.fromCartesian=function(e,r){t(r)||(r=new n);var i=r.high,o=r.low;return n.encode(e.x,a),i.x=a.high,o.x=a.low,n.encode(e.y,a),i.y=a.high,o.y=a.low,n.encode(e.z,a),i.z=a.high,o.z=a.low,r};var i=new n;return n.writeElements=function(e,t,r){n.fromCartesian(e,i);var a=i.high,o=i.low;t[r]=a.x,t[r+1]=a.y,t[r+2]=a.z,t[r+3]=o.x,t[r+4]=o.y,t[r+5]=o.z},n}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,r,n,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(e){switch(e){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(t){return e(t)&&(t===i.UNSIGNED_BYTE||t===i.UNSIGNED_SHORT||t===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,r,a){return e>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,r,a):new Uint16Array(t,r,a)},r(i)}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function r(e,r,n){var a=e+r;return t.sign(e)!==t.sign(r)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(r)))<n?0:a}var n={};return n.computeDiscriminant=function(e,t,r){var n=t*t-4*e*r;return n},n.computeRealRoots=function(e,n,a){var i;if(0===e)return 0===n?[]:[-a/n];if(0===n){if(0===a)return[0,0];var o=Math.abs(a),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,i<0)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-n/e,i<0?[i,0]:[0,i];var c=n*n,l=4*e*a,E=r(c,-l,t.EPSILON14);if(E<0)return[];var f=-.5*r(n,t.sign(n)*Math.sqrt(E),t.EPSILON14);return n>0?[f/e,a/f]:[a/f,f/e]},n}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function r(e,t,r,n){var a,i,o=e,u=t/3,s=r/3,c=n,l=o*s,E=u*c,f=u*u,h=s*s,d=o*s-f,p=o*c-u*s,m=u*c-h,_=4*d*m-p*p;if(_<0){var T,y,R;f*E>=l*h?(T=o,y=d,R=-2*u*d+o*p):(T=c,y=m,R=-c*p+2*s*m);var A=R<0?-1:1,v=-A*Math.abs(T)*Math.sqrt(-_);i=-R+v;var N=i/2,S=N<0?-Math.pow(-N,1/3):Math.pow(N,1/3),I=i===v?-S:-y/S;return a=y<=0?S+I:-R/(S*S+I*I+y),f*E>=l*h?[(a-u)/o]:[-c/(a+s)]}var M=d,g=-2*u*d+o*p,O=m,C=-c*p+2*s*m,w=Math.sqrt(_),x=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*w,-g)/3);a=2*Math.sqrt(-M);var L=Math.cos(P);i=a*L;var b=a*(-L/2-x*Math.sin(P)),U=i+b>2*u?i-u:b-u,F=o,D=U/F;P=Math.abs(Math.atan2(c*w,-C)/3),a=2*Math.sqrt(-O),L=Math.cos(P),i=a*L,b=a*(-L/2-x*Math.sin(P));var B=-c,z=i+b<2*s?i+s:b+s,G=B/z,V=F*z,q=-U*z-F*B,X=U*B,H=(s*q-u*X)/(-u*q+s*V);return D<=H?D<=G?H<=G?[D,H,G]:[D,G,H]:[G,D,H]:D<=G?[H,D,G]:H<=G?[H,G,D]:[G,H,D]}var n={};return n.computeDiscriminant=function(e,t,r,n){var a=e*e,i=t*t,o=r*r,u=n*n,s=18*e*t*r*n+i*o-27*a*u-4*(e*o*r+i*t*n);return s},n.computeRealRoots=function(e,n,a,i){var o,u;if(0===e)return t.computeRealRoots(n,a,i);if(0===n){if(0===a){if(0===i)return[0,0,0];u=-i/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===i?(o=t.computeRealRoots(e,0,a),0===o.Length?[0]:[o[0],0,o[1]]):r(e,0,a,i)}return 0===a?0===i?(u=-n/e,u<0?[u,0,0]:[0,0,u]):r(e,n,0,i):0===i?(o=t.computeRealRoots(e,n,a),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):r(e,n,a,i)},n}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,r,n){"use strict";function a(t,a,i,o){var u=t*t,s=a-3*u/8,c=i-a*t/2+u*t/8,l=o-i*t/4+a*u/16-3*u*u/256,E=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(E.length>0){var f=-t/4,h=E[E.length-1];if(Math.abs(h)<r.EPSILON14){var d=n.computeRealRoots(1,s,l);if(2===d.length){var p,m=d[0],_=d[1];if(m>=0&&_>=0){var T=Math.sqrt(m),y=Math.sqrt(_);return[f-y,f-T,f+T,f+y]}if(m>=0&&_<0)return p=Math.sqrt(m),[f-p,f+p];if(m<0&&_>=0)return p=Math.sqrt(_),[f-p,f+p]}return[]}if(h>0){var R=Math.sqrt(h),A=(s+h-c/R)/2,v=(s+h+c/R)/2,N=n.computeRealRoots(1,R,A),S=n.computeRealRoots(1,-R,v);return 0!==N.length?(N[0]+=f,N[1]+=f,0!==S.length?(S[0]+=f,S[1]+=f,N[1]<=S[0]?[N[0],N[1],S[0],S[1]]:S[1]<=N[0]?[S[0],S[1],N[0],N[1]]:N[0]>=S[0]&&N[1]<=S[1]?[S[0],N[0],N[1],S[1]]:S[0]>=N[0]&&S[1]<=N[1]?[N[0],S[0],S[1],N[1]]:N[0]>S[0]&&N[0]<S[1]?[S[0],N[0],S[1],N[1]]:[N[0],S[0],N[1],S[1]]):N):0!==S.length?(S[0]+=f,S[1]+=f,S):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,E=i*t+s-4*o,f=c*o-i*a*t+u,h=e.computeRealRoots(1,l,E,f);if(h.length>0){var d,p,m=h[0],_=a-m,T=_*_,y=t/2,R=_/2,A=T-4*o,v=T+4*Math.abs(o),N=c-4*m,S=c+4*Math.abs(m);if(m<0||A*S<N*v){var I=Math.sqrt(N);d=I/2,p=0===I?0:(t*R-i)/I}else{var M=Math.sqrt(A);d=0===M?0:(t*R-i)/M,p=M/2}var g,O;0===y&&0===d?(g=0,O=0):r.sign(y)===r.sign(d)?(g=y+d,O=m/g):(O=y-d,g=m/O);var C,w;0===R&&0===p?(C=0,w=0):r.sign(R)===r.sign(p)?(C=R+p,w=o/C):(w=R-p,C=o/w);var x=n.computeRealRoots(1,g,C),P=n.computeRealRoots(1,O,w);if(0!==x.length)return 0!==P.length?x[1]<=P[0]?[x[0],x[1],P[0],P[1]]:P[1]<=x[0]?[P[0],P[1],x[0],x[1]]:x[0]>=P[0]&&x[1]<=P[1]?[P[0],x[0],x[1],P[1]]:P[0]>=x[0]&&P[1]<=x[1]?[x[0],P[0],P[1],x[1]]:x[0]>P[0]&&x[0]<P[1]?[P[0],x[0],P[1],x[1]]:[x[0],P[0],x[1],P[1]]:x;if(0!==P.length)return P}return[]}var o={};return o.computeDiscriminant=function(e,t,r,n,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=r*r,l=c*r,E=n*n,f=E*n,h=a*a,d=h*a,p=u*c*E-4*s*f-4*e*l*E+18*e*t*r*f-27*i*E*E+256*o*d+a*(18*s*r*n-4*u*l+16*e*c*c-80*e*t*c*n-6*e*u*E+144*i*r*E)+h*(144*e*u*r-27*u*u-128*i*c-192*i*t*n);return p},o.computeRealRoots=function(t,n,o,u,s){if(Math.abs(t)<r.EPSILON15)return e.computeRealRoots(n,o,u,s);var c=n/t,l=o/t,E=u/t,f=s/t,h=c<0?1:0;switch(h+=l<0?h+1:h,h+=E<0?h+1:h,h+=f<0?h+1:h){case 0:return a(c,l,E,f);case 1:return i(c,l,E,f);case 2:return i(c,l,E,f);case 3:return a(c,l,E,f);case 4:return a(c,l,E,f);case 5:return i(c,l,E,f);case 6:return a(c,l,E,f);case 7:return a(c,l,E,f);case 8:return i(c,l,E,f);case 9:return a(c,l,E,f);case 10:return a(c,l,E,f);case 11:return i(c,l,E,f);case 12:return a(c,l,E,f);case 13:return a(c,l,E,f);case 14:return a(c,l,E,f);case 15:return a(c,l,E,f);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function a(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 a.getPoint=function(t,n,a){return r(a)||(a=new e),a=e.multiplyByScalar(t.direction,n,a),e.add(t.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,r,n,a,i,o,u,s,c,l){"use strict";function E(e,t,r,n){var a=t*t-4*e*r;if(!(a<0)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return u<s?(n.root0=u,n.root1=s):(n.root0=s,n.root1=u),n}var c=-t/(2*e);if(0!==c)return n.root0=n.root1=c,n}}function f(t,r,a){n(a)||(a=new i);var o=t.origin,u=t.direction,s=r.center,c=r.radius*r.radius,l=e.subtract(o,s,T),f=e.dot(u,u),h=2*e.dot(u,l),d=e.magnitudeSquared(l)-c,p=E(f,h,d,v);if(n(p))return a.start=p.root0,a.stop=p.root1,a}function h(e,t,r){var n=e+t;return o.sign(e)!==o.sign(t)&&Math.abs(n/Math.max(Math.abs(e),Math.abs(t)))<r?0:n}function d(t,r,n,a,i){var l,E=a*a,f=i*i,d=(t[u.COLUMN1ROW1]-t[u.COLUMN2ROW2])*f,p=i*(a*h(t[u.COLUMN1ROW0],t[u.COLUMN0ROW1],o.EPSILON15)+r.y),m=t[u.COLUMN0ROW0]*E+t[u.COLUMN2ROW2]*f+a*r.x+n,_=f*h(t[u.COLUMN2ROW1],t[u.COLUMN1ROW2],o.EPSILON15),T=i*(a*h(t[u.COLUMN2ROW0],t[u.COLUMN0ROW2])+r.z),y=[]; +if(0===T&&0===_){if(l=s.computeRealRoots(d,p,m),0===l.length)return y;var R=l[0],A=Math.sqrt(Math.max(1-R*R,0));if(y.push(new e(a,i*R,i*-A)),y.push(new e(a,i*R,i*A)),2===l.length){var v=l[1],N=Math.sqrt(Math.max(1-v*v,0));y.push(new e(a,i*v,i*-N)),y.push(new e(a,i*v,i*N))}return y}var S=T*T,I=_*_,M=d*d,g=T*_,O=M+I,C=2*(p*d+g),w=2*m*d+p*p-I+S,x=2*(m*p-g),P=m*m-S;if(0===O&&0===C&&0===w&&0===x)return y;l=c.computeRealRoots(O,C,w,x,P);var L=l.length;if(0===L)return y;for(var b=0;b<L;++b){var U,F=l[b],D=F*F,B=Math.max(1-D,0),z=Math.sqrt(B);U=o.sign(d)===o.sign(m)?h(d*D+m,p*F,o.EPSILON12):o.sign(m)===o.sign(p*F)?h(d*D,p*F+m,o.EPSILON12):h(d*D+p*F,m,o.EPSILON12);var G=h(_*F,T,o.EPSILON15),V=U*G;V<0?y.push(new e(a,i*F,i*z)):V>0?y.push(new e(a,i*F,i*-z)):0!==z?(y.push(new e(a,i*F,i*-z)),y.push(new e(a,i*F,i*z)),++b):y.push(new e(a,i*F,i*z))}return y}var p={};p.rayPlane=function(t,r,a){n(a)||(a=new e);var i=t.origin,u=t.direction,s=r.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON15)){var l=(-r.distance-e.dot(s,i))/c;if(!(l<0))return a=e.multiplyByScalar(u,l,a),e.add(i,a,a)}};var m=new e,_=new e,T=new e,y=new e,R=new e;p.rayTriangleParametric=function(t,n,a,i,u){u=r(u,!1);var s,c,l,E,f,h=t.origin,d=t.direction,p=e.subtract(a,n,m),A=e.subtract(i,n,_),v=e.cross(d,A,T),N=e.dot(p,v);if(u){if(N<o.EPSILON6)return;if(s=e.subtract(h,n,y),l=e.dot(s,v),l<0||l>N)return;if(c=e.cross(s,p,R),E=e.dot(d,c),E<0||l+E>N)return;f=e.dot(A,c)/N}else{if(Math.abs(N)<o.EPSILON6)return;var S=1/N;if(s=e.subtract(h,n,y),l=e.dot(s,v)*S,l<0||l>1)return;if(c=e.cross(s,p,R),E=e.dot(d,c)*S,E<0||l+E>1)return;f=e.dot(A,c)*S}return f},p.rayTriangle=function(t,r,a,i,o,u){var s=p.rayTriangleParametric(t,r,a,i,o);if(n(s)&&!(s<0))return n(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var A=new l;p.lineSegmentTriangle=function(t,r,a,i,o,u,s){var c=A;e.clone(t,c.origin),e.subtract(r,t,c.direction),e.normalize(c.direction,c.direction);var l=p.rayTriangleParametric(c,a,i,o,u);if(!(!n(l)||l<0||l>e.distance(t,r)))return n(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var v={root0:0,root1:0};p.raySphere=function(e,t,r){if(r=f(e,t,r),n(r)&&!(r.stop<0))return r.start=Math.max(r.start,0),r};var N=new l;p.lineSegmentSphere=function(t,r,a,i){var o=N;e.clone(t,o.origin);var u=e.subtract(r,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),i=f(o,a,i),!(!n(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var S=new e,I=new e;p.rayEllipsoid=function(t,r){var n,a,o,u,s,c=r.oneOverRadii,l=e.multiplyComponents(c,t.origin,S),E=e.multiplyComponents(c,t.direction,I),f=e.magnitudeSquared(l),h=e.dot(l,E);if(f>1){if(h>=0)return;var d=h*h;if(n=f-1,a=e.magnitudeSquared(E),o=a*n,d<o)return;if(d>o){u=h*h-o,s=-h+Math.sqrt(u);var p=s/a,m=n/s;return p<m?new i(p,m):{start:m,stop:p}}var _=Math.sqrt(n/a);return new i(_,_)}return f<1?(n=f-1,a=e.magnitudeSquared(E),o=a*n,u=h*h-o,s=-h+Math.sqrt(u),new i(0,s/a)):h<0?(a=e.magnitudeSquared(E),new i(0,-h/a)):void 0};var M=new e,g=new e,O=new e,C=new e,w=new e,x=new u,P=new u,L=new u,b=new u,U=new u,F=new u,D=new u,B=new e,z=new e,G=new t;p.grazingAltitudeLocation=function(t,r){var a=t.origin,i=t.direction;if(!e.equals(a,e.ZERO)){var s=r.geodeticSurfaceNormal(a,M);if(e.dot(i,s)>=0)return a}var c=n(this.rayEllipsoid(t,r)),l=r.transformPositionToScaledSpace(i,M),E=e.normalize(l,l),f=e.mostOrthogonalAxis(l,C),h=e.normalize(e.cross(f,E,g),g),p=e.normalize(e.cross(E,h,O),O),m=x;m[0]=E.x,m[1]=E.y,m[2]=E.z,m[3]=h.x,m[4]=h.y,m[5]=h.z,m[6]=p.x,m[7]=p.y,m[8]=p.z;var _=u.transpose(m,P),T=u.fromScale(r.radii,L),y=u.fromScale(r.oneOverRadii,b),R=U;R[0]=0,R[1]=-i.z,R[2]=i.y,R[3]=i.z,R[4]=0,R[5]=-i.x,R[6]=-i.y,R[7]=i.x,R[8]=0;var A,v,N=u.multiply(u.multiply(_,y,F),R,F),S=u.multiply(u.multiply(N,T,D),m,D),I=u.multiplyByVector(N,a,w),V=d(S,e.negate(I,M),0,0,1),q=V.length;if(q>0){for(var X=e.clone(e.ZERO,z),H=Number.NEGATIVE_INFINITY,W=0;W<q;++W){A=u.multiplyByVector(T,u.multiplyByVector(m,V[W],B),B);var k=e.normalize(e.subtract(A,a,C),C),Y=e.dot(k,i);Y>H&&(H=Y,X=e.clone(A,X))}var Z=r.cartesianToCartographic(X,G);return H=o.clamp(H,0,1),v=e.magnitude(e.subtract(X,a,C))*Math.sqrt(1-H*H),v=c?-v:v,Z.height=v,r.cartographicToCartesian(Z,new e)}};var V=new e;return p.lineSegmentPlane=function(t,r,a,i){n(i)||(i=new e);var u=e.subtract(r,t,V),s=a.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON6)){var l=e.dot(s,t),E=-(a.distance+l)/c;if(!(E<0||E>1))return e.multiplyByScalar(u,E,i),e.add(t,i,i),i}},p.trianglePlaneIntersection=function(t,r,n,a){var i=a.normal,o=a.distance,u=e.dot(i,t)+o<0,s=e.dot(i,r)+o<0,c=e.dot(i,n)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var E,f;if(1!==l&&2!==l||(E=new e,f=new e),1===l){if(u)return p.lineSegmentPlane(t,r,a,E),p.lineSegmentPlane(t,n,a,f),{positions:[t,r,n,E,f],indices:[0,3,4,1,2,4,1,4,3]};if(s)return p.lineSegmentPlane(r,n,a,E),p.lineSegmentPlane(r,t,a,f),{positions:[t,r,n,E,f],indices:[1,3,4,2,0,4,2,4,3]};if(c)return p.lineSegmentPlane(n,t,a,E),p.lineSegmentPlane(n,r,a,f),{positions:[t,r,n,E,f],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return p.lineSegmentPlane(r,t,a,E),p.lineSegmentPlane(n,t,a,f),{positions:[t,r,n,E,f],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return p.lineSegmentPlane(n,r,a,E),p.lineSegmentPlane(t,r,a,f),{positions:[t,r,n,E,f],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return p.lineSegmentPlane(t,n,a,E),p.lineSegmentPlane(r,n,a,f),{positions:[t,r,n,E,f],indices:[0,1,4,0,4,3,2,3,4]}}},p}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,r,n){"use strict";function a(t,r){this.normal=e.clone(t),this.distance=r}a.fromPointNormal=function(r,n,i){var o=-e.dot(n,r);return t(i)?(e.clone(n,i.normal),i.distance=o,i):new a(n,o)};var i=new e;return a.fromCartesian4=function(r,n){var o=e.fromCartesian4(r,i),u=r.w;return t(n)?(e.clone(o,n.normal),n.distance=u,n):new a(o,u)},a.getPointDistance=function(t,r){return e.dot(t.normal,r)+t.distance},a.ORIGIN_XY_PLANE=n(new a(e.UNIT_Z,0)),a.ORIGIN_YZ_PLANE=n(new a(e.UNIT_X,0)),a.ORIGIN_ZX_PLANE=n(new a(e.UNIT_Y,0)),a}),define("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";var n={};return n.calculateACMR=function(r){r=e(r,e.EMPTY_OBJECT);var n=r.indices,a=r.maximumIndex,i=e(r.cacheSize,24),o=n.length;if(!t(a)){a=0;for(var u=0,s=n[u];u<o;)s>a&&(a=s),++u,s=n[u]}for(var c=[],l=0;l<a+1;l++)c[l]=0;for(var E=i+1,f=0;f<o;++f)E-c[n[f]]>i&&(c[n[f]]=E,++E);return(E-i+1)/(o/3)},n.tipsify=function(r){function n(e,t,r,n){for(;t.length>=1;){var a=t[t.length-1];if(t.splice(t.length-1,1),e[a].numLiveTriangles>0)return a}for(;i<n;){if(e[i].numLiveTriangles>0)return++i,i-1;++i}return-1}function a(e,t,r,a,i,o,u){for(var s,c=-1,l=-1,E=0;E<r.length;){var f=r[E];a[f].numLiveTriangles&&(s=0,i-a[f].timeStamp+2*a[f].numLiveTriangles<=t&&(s=i-a[f].timeStamp),(s>l||l===-1)&&(l=s,c=f)),++E}return c===-1?n(a,o,e,u):c}r=e(r,e.EMPTY_OBJECT);var i,o=r.indices,u=r.maximumIndex,s=e(r.cacheSize,24),c=o.length,l=0,E=0,f=o[E],h=c;if(t(u))l=u+1;else{for(;E<h;)f>l&&(l=f),++E,f=o[E];if(l===-1)return 0;++l}for(var d=[],p=0;p<l;p++)d[p]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};E=0;for(var m=0;E<h;)d[o[E]].vertexTriangles.push(m),++d[o[E]].numLiveTriangles,d[o[E+1]].vertexTriangles.push(m),++d[o[E+1]].numLiveTriangles,d[o[E+2]].vertexTriangles.push(m),++d[o[E+2]].numLiveTriangles,++m,E+=3;var _=0,T=s+1;i=1;var y,R,A=[],v=[],N=0,S=[],I=c/3,M=[];for(p=0;p<I;p++)M[p]=!1;for(var g,O;_!==-1;){A=[],R=d[_],O=R.vertexTriangles.length;for(var C=0;C<O;++C)if(m=R.vertexTriangles[C],!M[m]){M[m]=!0,E=m+m+m;for(var w=0;w<3;++w)g=o[E],A.push(g),v.push(g),S[N]=g,++N,y=d[g],--y.numLiveTriangles,T-y.timeStamp>s&&(y.timeStamp=T,++T),++E}_=a(o,s,A,d,T,v,l)}return S},n}),define("Core/GeometryPipeline",["./AttributeCompression","./barycentricCoordinates","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./deprecationWarning","./DeveloperError","./EncodedCartesian3","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryType","./IndexDatatype","./Intersect","./IntersectionTests","./Math","./Matrix3","./Matrix4","./Plane","./PrimitiveType","./Tipsify"],function(e,t,r,n,a,i,o,u,s,c,l,E,f,h,d,p,m,_,T,y,R,A,v,N,S,I){"use strict";function M(e,t,r,n,a){e[t++]=r,e[t++]=n,e[t++]=n,e[t++]=a,e[t++]=a,e[t]=r}function g(e){for(var t=e.length,r=t/3*6,n=_.createTypedArray(t,r),a=0,i=0;i<t;i+=3,a+=6)M(n,a,e[i],e[i+1],e[i+2]);return n}function O(e){var t=e.length;if(t>=3){var r=6*(t-2),n=_.createTypedArray(t,r);M(n,0,e[0],e[1],e[2]);for(var a=6,i=3;i<t;++i,a+=6)M(n,a,e[i-1],e[i],e[i-2]);return n}return new Uint16Array}function C(e){if(e.length>0){for(var t=e.length-1,r=6*(t-1),n=_.createTypedArray(t,r),a=e[0],i=0,o=1;o<t;++o,i+=6)M(n,i,a,e[o],e[o+1]);return n}return new Uint16Array}function w(e){var t={};for(var r in e)if(e.hasOwnProperty(r)&&c(e[r])&&c(e[r].values)){var n=e[r];t[r]=new p({componentDatatype:n.componentDatatype,componentsPerAttribute:n.componentsPerAttribute,normalize:n.normalize,values:[]})}return t}function x(e,t,r){for(var n in t)if(t.hasOwnProperty(n)&&c(t[n])&&c(t[n].values))for(var a=t[n],i=0;i<a.componentsPerAttribute;++i)e[n].values.push(a.values[r*a.componentsPerAttribute+i])}function P(e,t){if(c(t))for(var r=t.values,n=r.length,i=0;i<n;i+=3)a.unpack(r,i,oe),v.multiplyByPoint(e,oe,oe),a.pack(oe,r,i)}function L(e,t){if(c(t))for(var r=t.values,n=r.length,i=0;i<n;i+=3)a.unpack(r,i,oe),A.multiplyByVector(e,oe,oe),oe=a.normalize(oe,oe),a.pack(oe,r,i)}function b(e,t){var r,n=e.length,a={},i=e[0][t].attributes;for(r in i)if(i.hasOwnProperty(r)&&c(i[r])&&c(i[r].values)){for(var o=i[r],s=o.values.length,l=!0,E=1;E<n;++E){var f=e[E][t].attributes[r];if(!c(f)||o.componentDatatype!==f.componentDatatype||o.componentsPerAttribute!==f.componentsPerAttribute||o.normalize!==f.normalize){l=!1;break}s+=f.values.length}l&&(a[r]=new p({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:u.createTypedArray(o.componentDatatype,s)}))}return a}function U(e,t){var n,i,o,u,s,l,E,f=e.length,h=(e[0].modelMatrix,c(e[0][t].indices)),p=e[0][t].primitiveType,m=b(e,t);for(n in m)if(m.hasOwnProperty(n))for(s=m[n].values,u=0,i=0;i<f;++i)for(l=e[i][t].attributes[n].values,E=l.length,o=0;o<E;++o)s[u++]=l[o];var T;if(h){var y=0;for(i=0;i<f;++i)y+=e[i][t].indices.length;var R=d.computeNumberOfVertices(new d({attributes:m,primitiveType:S.POINTS})),A=_.createTypedArray(R,y),v=0,N=0;for(i=0;i<f;++i){var I=e[i][t].indices,M=I.length;for(u=0;u<M;++u)A[v++]=N+I[u];N+=d.computeNumberOfVertices(e[i][t])}T=A}var g,O=new a,C=0;for(i=0;i<f;++i){if(g=e[i][t].boundingSphere,!c(g)){O=void 0;break}a.add(g.center,O,O)}if(c(O))for(a.divideByScalar(O,f,O),i=0;i<f;++i){g=e[i][t].boundingSphere;var w=a.magnitude(a.subtract(g.center,O,ce))+g.radius;w>C&&(C=w)}return new d({attributes:m,indices:T,primitiveType:p,boundingSphere:c(O)?new r(O,C):void 0})}function F(e){if(c(e.indices))return e;for(var t=d.computeNumberOfVertices(e),r=_.createTypedArray(t,t),n=0;n<t;++n)r[n]=n;return e.indices=r,e}function D(e){var t=d.computeNumberOfVertices(e),r=_.createTypedArray(t,3*(t-2));r[0]=1,r[1]=0,r[2]=2;for(var n=3,a=3;a<t;++a)r[n++]=a-1,r[n++]=0,r[n++]=a;return e.indices=r,e.primitiveType=S.TRIANGLES,e}function B(e){var t=d.computeNumberOfVertices(e),r=_.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,a=3;a<t-1;a+=2)r[n++]=a,r[n++]=a-1,r[n++]=a+1,a+2<t&&(r[n++]=a,r[n++]=a+1,r[n++]=a+2);return e.indices=r,e.primitiveType=S.TRIANGLES,e}function z(e){if(c(e.indices))return e;for(var t=d.computeNumberOfVertices(e),r=_.createTypedArray(t,t),n=0;n<t;++n)r[n]=n;return e.indices=r,e}function G(e){var t=d.computeNumberOfVertices(e),r=_.createTypedArray(t,2*(t-1));r[0]=0,r[1]=1;for(var n=2,a=2;a<t;++a)r[n++]=a-1,r[n++]=a;return e.indices=r,e.primitiveType=S.LINES,e}function V(e){var t=d.computeNumberOfVertices(e),r=_.createTypedArray(t,2*t);r[0]=0,r[1]=1;for(var n=2,a=2;a<t;++a)r[n++]=a-1,r[n++]=a;return r[n++]=t-1,r[n]=0,e.indices=r,e.primitiveType=S.LINES,e}function q(e){switch(e.primitiveType){case S.TRIANGLE_FAN:return D(e);case S.TRIANGLE_STRIP:return B(e);case S.TRIANGLES:return F(e);case S.LINE_STRIP:return G(e);case S.LINE_LOOP:return V(e);case S.LINES:return z(e)}return e}function X(e,t){Math.abs(e.y)<R.EPSILON6&&(t?e.y=-R.EPSILON6:e.y=R.EPSILON6)}function H(e,t,r){if(0!==e.y&&0!==t.y&&0!==r.y)return X(e,e.y<0),X(t,t.y<0),void X(r,r.y<0);var n,a=Math.abs(e.y),i=Math.abs(t.y),o=Math.abs(r.y);n=a>i?a>o?R.sign(e.y):R.sign(r.y):i>o?R.sign(t.y):R.sign(r.y);var u=n<0;X(e,u),X(t,u),X(r,u)}function W(e,t,r,n){a.add(e,a.multiplyByScalar(a.subtract(t,e,ve),e.y/(e.y-t.y),ve),r),a.clone(r,n),X(r,!0),X(n,!1)}function k(e,t,r){if(!(e.x>=0||t.x>=0||r.x>=0)){H(e,t,r);var n=e.y<0,a=t.y<0,i=r.y<0,o=0;o+=n?1:0,o+=a?1:0,o+=i?1:0;var u=ge.indices;1===o?(u[1]=3,u[2]=4,u[5]=6,u[7]=6,u[8]=5,n?(W(e,t,Ne,Ie),W(e,r,Se,Me),u[0]=0,u[3]=1,u[4]=2,u[6]=1):a?(W(t,r,Ne,Ie),W(t,e,Se,Me),u[0]=1,u[3]=2,u[4]=0,u[6]=2):i&&(W(r,e,Ne,Ie),W(r,t,Se,Me),u[0]=2,u[3]=0,u[4]=1,u[6]=0)):2===o&&(u[2]=4,u[4]=4,u[5]=3,u[7]=5,u[8]=6,n?a?i||(W(r,e,Ne,Ie),W(r,t,Se,Me),u[0]=0,u[1]=1,u[3]=0,u[6]=2):(W(t,r,Ne,Ie),W(t,e,Se,Me),u[0]=2,u[1]=0,u[3]=2,u[6]=1):(W(e,t,Ne,Ie),W(e,r,Se,Me),u[0]=1,u[1]=2,u[3]=1,u[6]=0));var s=ge.positions;return s[0]=e,s[1]=t,s[2]=r,s.length=3,1!==o&&2!==o||(s[3]=Ne,s[4]=Se,s[5]=Ie,s[6]=Me,s.length=7),ge}}function Y(e,t){var n=e.attributes;if(0!==n.position.values.length){for(var a in n)if(n.hasOwnProperty(a)&&c(n[a])&&c(n[a].values)){var i=n[a];i.values=u.createTypedArray(i.componentDatatype,i.values)}var o=d.computeNumberOfVertices(e);return e.indices=_.createTypedArray(o,e.indices),t&&(e.boundingSphere=r.fromVertices(n.position.values)),e}}function Z(e){var t=e.attributes,r={};for(var n in t)if(t.hasOwnProperty(n)&&c(t[n])&&c(t[n].values)){var a=t[n];r[n]=new p({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:[]})}return new d({attributes:r,indices:[],primitiveType:e.primitiveType})}function K(e,t,r){var n=c(e.geometry.boundingSphere);t=Y(t,n),r=Y(r,n),c(r)&&!c(t)?e.geometry=r:!c(r)&&c(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=r,e.geometry=void 0)}function j(e,r,i,o,u,s,l,E,f,h,d,p){if(c(s)||c(l)||c(E)||c(f)||c(h)){var m=a.fromArray(u,3*e,Oe),_=a.fromArray(u,3*r,Ce),T=a.fromArray(u,3*i,we),y=t(o,m,_,T,xe);if(c(s)){var R=a.fromArray(s,3*e,Oe),A=a.fromArray(s,3*r,Ce),v=a.fromArray(s,3*i,we);a.multiplyByScalar(R,y.x,R),a.multiplyByScalar(A,y.y,A),a.multiplyByScalar(v,y.z,v);var N=a.add(R,A,R);a.add(N,v,N),a.normalize(N,N),a.pack(N,d.normal.values,3*p)}if(c(h)){var S=a.fromArray(h,3*e,Oe),I=a.fromArray(h,3*r,Ce),M=a.fromArray(h,3*i,we);a.multiplyByScalar(S,y.x,S),a.multiplyByScalar(I,y.y,I),a.multiplyByScalar(M,y.z,M);var g;a.equals(S,a.ZERO)&&a.equals(I,a.ZERO)&&a.equals(M,a.ZERO)?(g=Oe,g.x=0,g.y=0,g.z=0):(g=a.add(S,I,S),a.add(g,M,g),a.normalize(g,g)),a.pack(g,d.extrudeDirection.values,3*p)}if(c(l)){var O=a.fromArray(l,3*e,Oe),C=a.fromArray(l,3*r,Ce),w=a.fromArray(l,3*i,we);a.multiplyByScalar(O,y.x,O),a.multiplyByScalar(C,y.y,C),a.multiplyByScalar(w,y.z,w);var x=a.add(O,C,O);a.add(x,w,x),a.normalize(x,x),a.pack(x,d.tangent.values,3*p)}if(c(E)){var P=a.fromArray(E,3*e,Oe),L=a.fromArray(E,3*r,Ce),b=a.fromArray(E,3*i,we);a.multiplyByScalar(P,y.x,P),a.multiplyByScalar(L,y.y,L),a.multiplyByScalar(b,y.z,b);var U=a.add(P,L,P);a.add(U,b,U),a.normalize(U,U),a.pack(U,d.bitangent.values,3*p)}if(c(f)){var F=n.fromArray(f,2*e,Pe),D=n.fromArray(f,2*r,Le),B=n.fromArray(f,2*i,be);n.multiplyByScalar(F,y.x,F),n.multiplyByScalar(D,y.y,D),n.multiplyByScalar(B,y.z,B);var z=n.add(F,D,F);n.add(z,B,z),n.pack(z,d.st.values,2*p)}}}function Q(e,t,r,n,a,i){var o=e.position.values.length/3;if(a!==-1){var u=n[a],s=r[u];return s===-1?(r[u]=o,e.position.values.push(i.x,i.y,i.z),t.push(o),o):(t.push(s),s)}return e.position.values.push(i.x,i.y,i.z),t.push(o),o}function J(e){var t,r,n,i,o,u=e.geometry,s=u.attributes,l=s.position.values,E=c(s.normal)?s.normal.values:void 0,f=c(s.bitangent)?s.bitangent.values:void 0,h=c(s.tangent)?s.tangent.values:void 0,d=c(s.st)?s.st.values:void 0,p=c(s.extrudeDirection)?s.extrudeDirection.values:void 0,m=u.indices,_=Z(u),T=Z(u),y=[];y.length=l.length/3;var R=[];for(R.length=l.length/3,o=0;o<y.length;++o)y[o]=-1,R[o]=-1;var A=m.length;for(o=0;o<A;o+=3){var v=m[o],N=m[o+1],S=m[o+2],I=a.fromArray(l,3*v),M=a.fromArray(l,3*N),g=a.fromArray(l,3*S),O=k(I,M,g);if(c(O)&&O.positions.length>3)for(var C=O.positions,w=O.indices,x=w.length,P=0;P<x;++P){var L=w[P],b=C[L];b.y<0?(t=T.attributes,r=T.indices,n=y):(t=_.attributes,r=_.indices,n=R),i=Q(t,r,n,m,L<3?o+L:-1,b),j(v,N,S,b,l,E,h,f,d,p,t,i)}else c(O)&&(I=O.positions[0],M=O.positions[1],g=O.positions[2]),I.y<0?(t=T.attributes,r=T.indices,n=y):(t=_.attributes,r=_.indices,n=R),i=Q(t,r,n,m,o,I),j(v,N,S,I,l,E,h,f,d,p,t,i),i=Q(t,r,n,m,o+1,M),j(v,N,S,M,l,E,h,f,d,p,t,i),i=Q(t,r,n,m,o+2,g),j(v,N,S,g,l,E,h,f,d,p,t,i)}K(e,T,_)}function $(e){var t,r=e.geometry,n=r.attributes,i=n.position.values,o=r.indices,u=Z(r),s=Z(r),l=o.length,E=[];E.length=i.length/3;var f=[];for(f.length=i.length/3,t=0;t<E.length;++t)E[t]=-1,f[t]=-1;for(t=0;t<l;t+=2){var h=o[t],d=o[t+1],p=a.fromArray(i,3*h,Oe),m=a.fromArray(i,3*d,Ce);Math.abs(p.y)<R.EPSILON6&&(p.y<0?p.y=-R.EPSILON6:p.y=R.EPSILON6),Math.abs(m.y)<R.EPSILON6&&(m.y<0?m.y=-R.EPSILON6:m.y=R.EPSILON6);var _=u.attributes,T=u.indices,A=f,v=s.attributes,N=s.indices,S=E,I=y.lineSegmentPlane(p,m,Ue,we);if(c(I)){var M=a.multiplyByScalar(a.UNIT_Y,5*R.EPSILON9,Fe);p.y<0&&(a.negate(M,M),_=s.attributes,T=s.indices,A=E,v=u.attributes,N=u.indices,S=f);var g=a.add(I,M,De);Q(_,T,A,o,t,p),Q(_,T,A,o,-1,g),a.negate(M,M),a.add(I,M,g),Q(v,N,S,o,-1,g),Q(v,N,S,o,t+1,m)}else{var O,C,w;p.y<0?(O=s.attributes,C=s.indices,w=E):(O=u.attributes,C=u.indices,w=f),Q(O,C,w,o,t,p),Q(O,C,w,o,t+1,m)}}K(e,s,u)}function ee(e){for(var t=e.attributes,r=t.position.values,n=t.prevPosition.values,i=t.nextPosition.values,o=r.length,u=0;u<o;u+=3){var s=a.unpack(r,u,Ge);if(!(s.x>0)){var c=a.unpack(n,u,Ve);(s.y<0&&c.y>0||s.y>0&&c.y<0)&&(u-3>0?(n[u]=r[u-3],n[u+1]=r[u-2],n[u+2]=r[u-1]):a.pack(s,n,u));var l=a.unpack(i,u,qe);(s.y<0&&l.y>0||s.y>0&&l.y<0)&&(u+3<o?(i[u]=r[u+3],i[u+1]=r[u+4],i[u+2]=r[u+5]):a.pack(s,i,u))}}}function te(e){var t,r,o,u=e.geometry,s=u.attributes,l=s.position.values,E=s.prevPosition.values,f=s.nextPosition.values,h=s.expandAndWidth.values,d=c(s.st)?s.st.values:void 0,p=c(s.color)?s.color.values:void 0,m=Z(u),_=Z(u),T=!1,A=l.length/3;for(t=0;t<A;t+=4){var v=t,N=t+2,S=a.fromArray(l,3*v,Ge),I=a.fromArray(l,3*N,Ve);if(Math.abs(S.y)<Ze)for(S.y=Ze*(I.y<0?-1:1),l[3*t+1]=S.y,l[3*(t+1)+1]=S.y,r=3*v;r<3*v+12;r+=3)E[r]=l[3*t],E[r+1]=l[3*t+1],E[r+2]=l[3*t+2];if(Math.abs(I.y)<Ze)for(I.y=Ze*(S.y<0?-1:1),l[3*(t+2)+1]=I.y,l[3*(t+3)+1]=I.y,r=3*v;r<3*v+12;r+=3)f[r]=l[3*(t+2)],f[r+1]=l[3*(t+2)+1],f[r+2]=l[3*(t+2)+2];var M=m.attributes,g=m.indices,O=_.attributes,C=_.indices,w=y.lineSegmentPlane(S,I,Ue,Xe);if(c(w)){T=!0;var x=a.multiplyByScalar(a.UNIT_Y,Ye,He);S.y<0&&(a.negate(x,x),M=_.attributes,g=_.indices,O=m.attributes,C=m.indices);var P=a.add(w,x,We);M.position.values.push(S.x,S.y,S.z,S.x,S.y,S.z),M.position.values.push(P.x,P.y,P.z),M.position.values.push(P.x,P.y,P.z),M.prevPosition.values.push(E[3*v],E[3*v+1],E[3*v+2]),M.prevPosition.values.push(E[3*v+3],E[3*v+4],E[3*v+5]),M.prevPosition.values.push(S.x,S.y,S.z,S.x,S.y,S.z),M.nextPosition.values.push(P.x,P.y,P.z),M.nextPosition.values.push(P.x,P.y,P.z),M.nextPosition.values.push(P.x,P.y,P.z),M.nextPosition.values.push(P.x,P.y,P.z),a.negate(x,x),a.add(w,x,P),O.position.values.push(P.x,P.y,P.z),O.position.values.push(P.x,P.y,P.z),O.position.values.push(I.x,I.y,I.z,I.x,I.y,I.z),O.prevPosition.values.push(P.x,P.y,P.z),O.prevPosition.values.push(P.x,P.y,P.z),O.prevPosition.values.push(P.x,P.y,P.z),O.prevPosition.values.push(P.x,P.y,P.z),O.nextPosition.values.push(I.x,I.y,I.z,I.x,I.y,I.z),O.nextPosition.values.push(f[3*N],f[3*N+1],f[3*N+2]),O.nextPosition.values.push(f[3*N+3],f[3*N+4],f[3*N+5]);var L=n.fromArray(h,2*v,Be),b=Math.abs(L.y);M.expandAndWidth.values.push(-1,b,1,b),M.expandAndWidth.values.push(-1,-b,1,-b),O.expandAndWidth.values.push(-1,b,1,b),O.expandAndWidth.values.push(-1,-b,1,-b);var U=a.magnitudeSquared(a.subtract(w,S,qe));if(U/=a.magnitudeSquared(a.subtract(I,S,qe)),c(p)){var F=i.fromArray(p,4*v,ke),D=i.fromArray(p,4*N,ke),B=R.lerp(F.x,D.x,U),z=R.lerp(F.y,D.y,U),G=R.lerp(F.z,D.z,U),V=R.lerp(F.w,D.w,U);for(r=4*v;r<4*v+8;++r)M.color.values.push(p[r]);for(M.color.values.push(B,z,G,V),M.color.values.push(B,z,G,V),O.color.values.push(B,z,G,V),O.color.values.push(B,z,G,V),r=4*N;r<4*N+8;++r)O.color.values.push(p[r])}if(c(d)){var q=n.fromArray(d,2*v,Be),X=n.fromArray(d,2*(t+3),ze),H=R.lerp(q.x,X.x,U);for(r=2*v;r<2*v+4;++r)M.st.values.push(d[r]);for(M.st.values.push(H,q.y),M.st.values.push(H,X.y),O.st.values.push(H,q.y),O.st.values.push(H,X.y),r=2*N;r<2*N+4;++r)O.st.values.push(d[r])}o=M.position.values.length/3-4,g.push(o,o+2,o+1),g.push(o+1,o+2,o+3),o=O.position.values.length/3-4,C.push(o,o+2,o+1),C.push(o+1,o+2,o+3)}else{var W,k;for(S.y<0?(W=_.attributes,k=_.indices):(W=m.attributes,k=m.indices),W.position.values.push(S.x,S.y,S.z),W.position.values.push(S.x,S.y,S.z),W.position.values.push(I.x,I.y,I.z),W.position.values.push(I.x,I.y,I.z),r=3*t;r<3*t+12;++r)W.prevPosition.values.push(E[r]),W.nextPosition.values.push(f[r]);for(r=2*t;r<2*t+8;++r)W.expandAndWidth.values.push(h[r]),c(d)&&W.st.values.push(d[r]);if(c(p))for(r=4*t;r<4*t+16;++r)W.color.values.push(p[r]);o=W.position.values.length/3-4,k.push(o,o+2,o+1),k.push(o+1,o+2,o+3)}}T&&(ee(_),ee(m)),K(e,_,m)}var re={};re.toWireframe=function(e){var t=e.indices;if(c(t)){switch(e.primitiveType){case S.TRIANGLES:e.indices=g(t);break;case S.TRIANGLE_STRIP:e.indices=O(t);break;case S.TRIANGLE_FAN:e.indices=C(t)}e.primitiveType=S.LINES}return e},re.createLineSegmentsForVectors=function(e,t,n){t=s(t,"normal"),n=s(n,1e4);for(var a=e.attributes.position.values,i=e.attributes[t].values,o=a.length,l=new Float64Array(2*o),E=0,f=0;f<o;f+=3)l[E++]=a[f],l[E++]=a[f+1],l[E++]=a[f+2],l[E++]=a[f]+i[f]*n,l[E++]=a[f+1]+i[f+1]*n,l[E++]=a[f+2]+i[f+2]*n;var h,m=e.boundingSphere;return c(m)&&(h=new r(m.center,m.radius+n)),new d({attributes:{position:new p({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:S.LINES,boundingSphere:h})},re.createAttributeLocations=function(e){var t,r=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=e.attributes,a={},i=0,o=r.length;for(t=0;t<o;++t){var u=r[t];c(n[u])&&(a[u]=i++)}for(var s in n)n.hasOwnProperty(s)&&!c(a[s])&&(a[s]=i++);return a},re.reorderForPreVertexCache=function(e){var t=d.computeNumberOfVertices(e),r=e.indices;if(c(r)){for(var n=new Int32Array(t),a=0;a<t;a++)n[a]=-1;for(var i,o=r,s=o.length,l=_.createTypedArray(t,s),E=0,f=0,h=0;E<s;)i=n[o[E]],i!==-1?l[f]=i:(i=o[E],n[i]=h,l[f]=h,++h),++E,++f;e.indices=l;var p=e.attributes;for(var m in p)if(p.hasOwnProperty(m)&&c(p[m])&&c(p[m].values)){for(var T=p[m],y=T.values,R=0,A=T.componentsPerAttribute,v=u.createTypedArray(T.componentDatatype,h*A);R<t;){var N=n[R];if(N!==-1)for(a=0;a<A;a++)v[A*N+a]=y[A*R+a];++R}T.values=v}}return e},re.reorderForPostVertexCache=function(e,t){var r=e.indices;if(e.primitiveType===S.TRIANGLES&&c(r)){for(var n=r.length,a=0,i=0;i<n;i++)r[i]>a&&(a=r[i]);e.indices=I.tipsify({indices:r,maximumIndex:a,cacheSize:t})}return e},re.fitToUnsignedShortIndices=function(e){var t=[],r=d.computeNumberOfVertices(e);if(c(e.indices)&&r>=R.SIXTY_FOUR_KILOBYTES){var n,a=[],i=[],o=0,u=w(e.attributes),s=e.indices,l=s.length;e.primitiveType===S.TRIANGLES?n=3:e.primitiveType===S.LINES?n=2:e.primitiveType===S.POINTS&&(n=1);for(var E=0;E<l;E+=n){for(var f=0;f<n;++f){var h=s[E+f],p=a[h];c(p)||(p=o++,a[h]=p,x(u,e.attributes,h)),i.push(p)}o+n>=R.SIXTY_FOUR_KILOBYTES&&(t.push(new d({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),a=[],i=[],o=0,u=w(e.attributes))}0!==i.length&&t.push(new d({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var ne=new a,ae=new o;re.projectTo2D=function(e,t,r,n,i){var o=e.attributes[t];i=c(i)?i:new h;for(var s=i.ellipsoid,l=o.values,E=new Float64Array(l.length),f=0,d=0;d<l.length;d+=3){var m=a.fromArray(l,d,ne),_=s.cartesianToCartographic(m,ae),T=i.project(_,ne);E[f++]=T.x,E[f++]=T.y,E[f++]=T.z}return e.attributes[r]=o,e.attributes[n]=new p({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:E}),delete e.attributes[t],e};var ie={high:0,low:0};re.encodeAttribute=function(e,t,r,n){for(var a=e.attributes[t],i=a.values,o=i.length,s=new Float32Array(o),c=new Float32Array(o),l=0;l<o;++l)f.encode(i[l],ie),s[l]=ie.high,c[l]=ie.low;var E=a.componentsPerAttribute;return e.attributes[r]=new p({componentDatatype:u.FLOAT,componentsPerAttribute:E,values:s}),e.attributes[n]=new p({componentDatatype:u.FLOAT,componentsPerAttribute:E,values:c}),delete e.attributes[t],e};var oe=new a,ue=new v,se=new A;re.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(v.equals(t,v.IDENTITY))return e;var n=e.geometry.attributes;P(t,n.position),P(t,n.prevPosition),P(t,n.nextPosition),(c(n.normal)||c(n.tangent)||c(n.bitangent))&&(v.inverse(t,ue),v.transpose(ue,ue),v.getRotation(ue,se),L(se,n.normal),L(se,n.tangent),L(se,n.bitangent));var a=e.geometry.boundingSphere;return c(a)&&(e.geometry.boundingSphere=r.transform(a,t,a)),e.modelMatrix=v.clone(v.IDENTITY),e};var ce=new a;re.combineInstances=function(e){for(var t=[],r=[],n=e.length,a=0;a<n;++a){var i=e[a];c(i.geometry)?t.push(i):c(i.westHemisphereGeometry)&&c(i.eastHemisphereGeometry)&&r.push(i)}var o=[];return t.length>0&&o.push(U(t,"geometry")),r.length>0&&(o.push(U(r,"westHemisphereGeometry")),o.push(U(r,"eastHemisphereGeometry"))),o};var le=new a,Ee=new a,fe=new a,he=new a;re.computeNormal=function(e){for(var t=e.indices,r=e.attributes,n=r.position.values,i=r.position.values.length/3,o=t.length,s=new Array(i),c=new Array(o/3),l=new Array(o),E=0;E<i;E++)s[E]={indexOffset:0,count:0,currentCount:0};var f=0;for(E=0;E<o;E+=3){var h=t[E],d=t[E+1],m=t[E+2],_=3*h,T=3*d,y=3*m;Ee.x=n[_],Ee.y=n[_+1],Ee.z=n[_+2],fe.x=n[T],fe.y=n[T+1],fe.z=n[T+2],he.x=n[y],he.y=n[y+1],he.z=n[y+2],s[h].count++,s[d].count++,s[m].count++,a.subtract(fe,Ee,fe),a.subtract(he,Ee,he),c[f]=a.cross(fe,he,new a),f++}var R=0;for(E=0;E<i;E++)s[E].indexOffset+=R,R+=s[E].count;f=0;var A;for(E=0;E<o;E+=3){A=s[t[E]];var v=A.indexOffset+A.currentCount;l[v]=f,A.currentCount++,A=s[t[E+1]],v=A.indexOffset+A.currentCount,l[v]=f,A.currentCount++,A=s[t[E+2]],v=A.indexOffset+A.currentCount,l[v]=f,A.currentCount++,f++}var N=new Float32Array(3*i);for(E=0;E<i;E++){var S=3*E;if(A=s[E],A.count>0){for(a.clone(a.ZERO,le),f=0;f<A.count;f++)a.add(le,c[l[A.indexOffset+f]],le);a.normalize(le,le),N[S]=le.x,N[S+1]=le.y,N[S+2]=le.z}else N[S]=0,N[S+1]=0,N[S+2]=1}return e.attributes.normal=new p({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:N}),e};var de=new a,pe=new a,me=new a;re.computeTangentAndBitangent=function(e){for(var t=(e.attributes,e.indices),r=e.attributes.position.values,n=e.attributes.normal.values,i=e.attributes.st.values,o=e.attributes.position.values.length/3,s=t.length,c=new Array(3*o),l=0;l<c.length;l++)c[l]=0;var E,f,h;for(l=0;l<s;l+=3){var d=t[l],m=t[l+1],_=t[l+2];E=3*d,f=3*m,h=3*_;var T=2*d,y=2*m,R=2*_,A=r[E],v=r[E+1],N=r[E+2],S=i[T],I=i[T+1],M=i[y+1]-I,g=i[R+1]-I,O=1/((i[y]-S)*g-(i[R]-S)*M),C=(g*(r[f]-A)-M*(r[h]-A))*O,w=(g*(r[f+1]-v)-M*(r[h+1]-v))*O,x=(g*(r[f+2]-N)-M*(r[h+2]-N))*O;c[E]+=C,c[E+1]+=w,c[E+2]+=x,c[f]+=C,c[f+1]+=w,c[f+2]+=x,c[h]+=C,c[h+1]+=w,c[h+2]+=x}var P=new Float32Array(3*o),L=new Float32Array(3*o);for(l=0;l<o;l++){E=3*l,f=E+1,h=E+2;var b=a.fromArray(n,E,de),U=a.fromArray(c,E,me),F=a.dot(b,U);a.multiplyByScalar(b,F,pe),a.normalize(a.subtract(U,pe,U),U),P[E]=U.x,P[f]=U.y,P[h]=U.z,a.normalize(a.cross(b,U,U),U),L[E]=U.x,L[f]=U.y,L[h]=U.z}return e.attributes.tangent=new p({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:P}),e.attributes.bitangent=new p({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:L}),e},re.computeBinormalAndTangent=function(e){return l("computeBinormalAndTangent","computeBinormalAndTangent was deprecated in 1.30. It will be removed in 1.31. Use a computeTangentAndBitangent."),re.computeTangentAndBitangent(e),e.attributes.binormal=e.attributes.bitangent,e};var _e=new n,Te=new a,ye=new a,Re=new a,Ae=new n;re.compressVertices=function(t){var r,i,o=t.attributes.extrudeDirection;if(c(o)){var s=o.values;i=s.length/3;var l=new Float32Array(2*i),E=0;for(r=0;r<i;++r)a.fromArray(s,3*r,Te),a.equals(Te,a.ZERO)?E+=2:(Ae=e.octEncodeInRange(Te,65535,Ae),l[E++]=Ae.x,l[E++]=Ae.y);return t.attributes.compressedAttributes=new p({componentDatatype:u.FLOAT,componentsPerAttribute:2,values:l}),delete t.attributes.extrudeDirection,t}var f=t.attributes.normal,h=t.attributes.st,d=c(f),m=c(h);if(!d&&!m)return t;var _,T,y,R,A=t.attributes.tangent,v=t.attributes.bitangent,N=c(A),S=c(v);d&&(_=f.values),m&&(T=h.values),N&&(y=A.values),S&&(R=v.values);var I=d?_.length:T.length,M=d?3:2;i=I/M;var g=i,O=m&&d?2:1;O+=N||S?1:0,g*=O;var C=new Float32Array(g),w=0;for(r=0;r<i;++r){m&&(n.fromArray(T,2*r,_e),C[w++]=e.compressTextureCoordinates(_e));var x=3*r;d&&c(y)&&c(R)?(a.fromArray(_,x,Te),a.fromArray(y,x,ye),a.fromArray(R,x,Re),e.octPack(Te,ye,Re,_e),C[w++]=_e.x,C[w++]=_e.y):(d&&(a.fromArray(_,x,Te),C[w++]=e.octEncodeFloat(Te)),N&&(a.fromArray(y,x,Te),C[w++]=e.octEncodeFloat(Te)),S&&(a.fromArray(R,x,Te),C[w++]=e.octEncodeFloat(Te)))}return t.attributes.compressedAttributes=new p({componentDatatype:u.FLOAT,componentsPerAttribute:O,values:C}),d&&delete t.attributes.normal,m&&delete t.attributes.st,S&&delete t.attributes.bitangent,N&&delete t.attributes.tangent,t};var ve=new a,Ne=new a,Se=new a,Ie=new a,Me=new a,ge={positions:new Array(7),indices:new Array(9)},Oe=new a,Ce=new a,we=new a,xe=new a,Pe=new n,Le=new n,be=new n,Ue=N.fromPointNormal(a.ZERO,a.UNIT_Y),Fe=new a,De=new a,Be=new n,ze=new n,Ge=new a,Ve=new a,qe=new a,Xe=new a,He=new a,We=new a,ke=new i,Ye=5*R.EPSILON9,Ze=R.EPSILON6;return re.splitLongitude=function(e){var t=e.geometry,n=t.boundingSphere;if(c(n)){var a=n.center.x-n.radius;if(a>0||r.intersectPlane(n,N.ORIGIN_ZX_PLANE)!==T.INTERSECTING)return e}if(t.geometryType!==m.NONE)switch(t.geometryType){case m.POLYLINES:te(e);break;case m.TRIANGLES:J(e);break;case m.LINES:$(e)}else q(t),t.primitiveType===S.TRIANGLES?J(e):t.primitiveType===S.LINES&&$(e);return e},re}),define("Core/WebMercatorProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,r,n,a,i,o,u){"use strict";function s(e){this._ellipsoid=r(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(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 a=this._semimajorAxis,i=t.longitude*a,o=s.geodeticLatitudeToMercatorAngle(t.latitude)*a,u=t.height;return n(r)?(r.x=i,r.y=o,r.z=u,r):new e(i,o,u)},s.prototype.unproject=function(e,r){var a=this._oneOverSemimajorAxis,i=e.x*a,o=s.mercatorAngleToGeodeticLatitude(e.y*a),u=e.z;return n(r)?(r.longitude=i,r.latitude=o,r.height=u,r):new t(i,o,u); +},s}),define("Scene/PrimitivePipeline",["../Core/BoundingSphere","../Core/ComponentDatatype","../Core/defined","../Core/DeveloperError","../Core/Ellipsoid","../Core/FeatureDetection","../Core/GeographicProjection","../Core/Geometry","../Core/GeometryAttribute","../Core/GeometryAttributes","../Core/GeometryPipeline","../Core/IndexDatatype","../Core/Matrix4","../Core/WebMercatorProjection"],function(e,t,r,n,a,i,o,u,s,c,l,E,f,h){"use strict";function d(e,t,n){var a,i=!n,o=e.length;if(!i&&o>1){var u=e[0].modelMatrix;for(a=1;a<o;++a)if(!f.equals(u,e[a].modelMatrix)){i=!0;break}}if(i)for(a=0;a<o;++a)r(e[a].geometry)&&l.transformToWorldCoordinates(e[a]);else f.multiplyTransformation(t,e[0].modelMatrix,t)}function p(e,r){var n=e.attributes,a=n.position,i=a.values.length/a.componentsPerAttribute;n.batchId=new s({componentDatatype:t.FLOAT,componentsPerAttribute:1,values:new Float32Array(i)});for(var o=n.batchId.values,u=0;u<i;++u)o[u]=r}function m(e){for(var t=e.length,n=0;n<t;++n){var a=e[n];r(a.geometry)?p(a.geometry,n):r(a.westHemisphereGeometry)&&r(a.eastHemisphereGeometry)&&(p(a.westHemisphereGeometry,n),p(a.eastHemisphereGeometry,n))}}function _(n){var a,i,o,u=n.instances,s=n.projection,c=n.elementIndexUintSupported,E=n.scene3DOnly,f=n.vertexCacheOptimize,h=n.compressVertices,p=n.modelMatrix,_=u.length;for(a=0;a<_;++a)if(r(u[a].geometry)){o=u[a].geometry.primitiveType;break}if(d(u,p,E),!E)for(a=0;a<_;++a)r(u[a].geometry)&&l.splitLongitude(u[a]);if(m(u),f)for(a=0;a<_;++a){var T=u[a];r(T.geometry)?(l.reorderForPostVertexCache(T.geometry),l.reorderForPreVertexCache(T.geometry)):r(T.westHemisphereGeometry)&&r(T.eastHemisphereGeometry)&&(l.reorderForPostVertexCache(T.westHemisphereGeometry),l.reorderForPreVertexCache(T.westHemisphereGeometry),l.reorderForPostVertexCache(T.eastHemisphereGeometry),l.reorderForPreVertexCache(T.eastHemisphereGeometry))}var y=l.combineInstances(u);for(_=y.length,a=0;a<_;++a){i=y[a];var R,A=i.attributes;if(E)for(R in A)A.hasOwnProperty(R)&&A[R].componentDatatype===t.DOUBLE&&l.encodeAttribute(i,R,R+"3DHigh",R+"3DLow");else for(R in A)if(A.hasOwnProperty(R)&&A[R].componentDatatype===t.DOUBLE){var v=R+"3D",N=R+"2D";l.projectTo2D(i,R,v,N,s),r(i.boundingSphere)&&"position"===R&&(i.boundingSphereCV=e.fromVertices(i.attributes.position2D.values)),l.encodeAttribute(i,v,v+"High",v+"Low"),l.encodeAttribute(i,N,N+"High",N+"Low")}h&&l.compressVertices(i)}if(!c){var S=[];for(_=y.length,a=0;a<_;++a)i=y[a],S=S.concat(l.fitToUnsignedShortIndices(i));y=S}return y}function T(e,t,n,a){var i,o,u,s=a.length-1;if(s>=0){var c=a[s];i=c.offset+c.count,u=c.index,o=n[u].indices.length}else i=0,u=0,o=n[u].indices.length;for(var l=e.length,E=0;E<l;++E){var f=e[E],h=f[t];if(r(h)){var d=h.indices.length;i+d>o&&(i=0,o=n[++u].indices.length),a.push({index:u,offset:i,count:d}),i+=d}}}function y(e,t){var r=[];return T(e,"geometry",t,r),T(e,"westHemisphereGeometry",t,r),T(e,"eastHemisphereGeometry",t,r),r}function R(e,t){var n=e.attributes;for(var a in n)if(n.hasOwnProperty(a)){var i=n[a];r(i)&&r(i.values)&&t.push(i.values.buffer)}r(e.indices)&&t.push(e.indices.buffer)}function A(e,t){for(var r=e.length,n=0;n<r;++n)R(e[n],t)}function v(t){for(var n=1,a=t.length,i=0;i<a;i++){var o=t[i];if(++n,r(o)){var u=o.attributes;n+=6+2*e.packedLength+(r(o.indices)?o.indices.length:0);for(var s in u)if(u.hasOwnProperty(s)&&r(u[s])){var c=u[s];n+=5+c.values.length}}}return n}function N(e,t){var r=e.length,n=new Float64Array(1+16*r),a=0;n[a++]=r;for(var i=0;i<r;i++){var o=e[i];f.pack(o.modelMatrix,n,a),a+=f.packedLength}return t.push(n.buffer),n}function S(e){for(var t=e,r=new Array(t[0]),n=0,a=1;a<t.length;){var i=f.unpack(t,a);a+=f.packedLength,r[n++]={modelMatrix:i}}return r}function I(t){var n=t.length,a=1+(e.packedLength+1)*n,i=new Float32Array(a),o=0;i[o++]=n;for(var u=0;u<n;++u){var s=t[u];r(s)?(i[o++]=1,e.pack(t[u],i,o)):i[o++]=0,o+=e.packedLength}return i}function M(t){for(var r=new Array(t[0]),n=0,a=1;a<t.length;)1===t[a++]&&(r[n]=e.unpack(t,a)),++n,a+=e.packedLength;return r}if(!i.supportsTypedArrays())return{};var g={};return g.combineGeometry=function(t){var n,a,i=t.instances,o=i.length;o>0&&(n=_(t),n.length>0&&(a=l.createAttributeLocations(n[0])));var u;t.createPickOffsets&&n.length>0&&(u=y(i,n));for(var s=new Array(o),c=new Array(o),E=0;E<o;++E){var f=i[E],h=f.geometry;r(h)&&(s[E]=h.boundingSphere,c[E]=h.boundingSphereCV);var d=f.eastHemisphereGeometry,p=f.westHemisphereGeometry;r(d)&&r(p)&&(r(d.boundingSphere)&&r(p.boundingSphere)&&(s[E]=e.union(d.boundingSphere,p.boundingSphere)),r(d.boundingSphereCV)&&r(p.boundingSphereCV)&&(c[E]=e.union(d.boundingSphereCV,p.boundingSphereCV)))}return{geometries:n,modelMatrix:t.modelMatrix,attributeLocations:a,pickOffsets:u,boundingSpheres:s,boundingSpheresCV:c}},g.packCreateGeometryResults=function(t,n){var a=new Float64Array(v(t)),i=[],o={},u=t.length,s=0;a[s++]=u;for(var c=0;c<u;c++){var l=t[c],E=r(l);if(a[s++]=E?1:0,E){a[s++]=l.primitiveType,a[s++]=l.geometryType;var f=r(l.boundingSphere)?1:0;a[s++]=f,f&&e.pack(l.boundingSphere,a,s),s+=e.packedLength;var h=r(l.boundingSphereCV)?1:0;a[s++]=h,h&&e.pack(l.boundingSphereCV,a,s),s+=e.packedLength;var d=l.attributes,p=[];for(var m in d)d.hasOwnProperty(m)&&r(d[m])&&(p.push(m),r(o[m])||(o[m]=i.length,i.push(m)));a[s++]=p.length;for(var _=0;_<p.length;_++){var T=p[_],y=d[T];a[s++]=o[T],a[s++]=y.componentDatatype,a[s++]=y.componentsPerAttribute,a[s++]=y.normalize?1:0,a[s++]=y.values.length,a.set(y.values,s),s+=y.values.length}var R=r(l.indices)?l.indices.length:0;a[s++]=R,R>0&&(a.set(l.indices,s),s+=R)}}return n.push(a.buffer),{stringTable:i,packedData:a}},g.unpackCreateGeometryResults=function(r){for(var n,a=r.stringTable,i=r.packedData,o=new Array(i[0]),l=0,f=1;f<i.length;){var h=1===i[f++];if(h){var d,p,m=i[f++],_=i[f++],T=1===i[f++];T&&(d=e.unpack(i,f)),f+=e.packedLength;var y=1===i[f++];y&&(p=e.unpack(i,f)),f+=e.packedLength;var R,A,v,N=new c,S=i[f++];for(n=0;n<S;n++){var I=a[i[f++]],M=i[f++];v=i[f++];var g=0!==i[f++];R=i[f++],A=t.createTypedArray(M,R);for(var O=0;O<R;O++)A[O]=i[f++];N[I]=new s({componentDatatype:M,componentsPerAttribute:v,normalize:g,values:A})}var C;if(R=i[f++],R>0){var w=A.length/v;for(C=E.createTypedArray(w,R),n=0;n<R;n++)C[n]=i[f++]}o[l++]=new u({primitiveType:m,geometryType:_,boundingSphere:d,boundingSphereCV:p,indices:C,attributes:N})}else o[l++]=void 0}return o},g.packCombineGeometryParameters=function(e,t){for(var r=e.createGeometryResults,n=r.length,a=0;a<n;a++)t.push(r[a].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:N(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof o,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}},g.unpackCombineGeometryParameters=function(e){for(var t=S(e.packedInstances),r=e.createGeometryResults,n=r.length,i=0,u=0;u<n;u++)for(var s=g.unpackCreateGeometryResults(r[u]),c=s.length,l=0;l<c;l++){var E=s[l],d=t[i];d.geometry=E,++i}var p=a.clone(e.ellipsoid),m=e.isGeographic?new o(p):new h(p);return{instances:t,ellipsoid:p,projection:m,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:f.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}},g.packCombineGeometryResults=function(e,t){r(e.geometries)&&A(e.geometries,t);var n=I(e.boundingSpheres),a=I(e.boundingSpheresCV);return t.push(n.buffer,a.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,boundingSpheres:n,boundingSpheresCV:a}},g.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,boundingSpheres:M(e.boundingSpheres),boundingSpheresCV:M(e.boundingSpheresCV)}},g}),define("Core/formatError",["./defined"],function(e){"use strict";function t(t){var r,n=t.name,a=t.message;r=e(n)&&e(a)?n+": "+a:t.toString();var i=t.stack;return e(i)&&(r+="\n"+i),r}return t}),define("Workers/createTaskProcessorWorker",["../Core/defaultValue","../Core/defined","../Core/formatError"],function(e,t,r){"use strict";function n(n){var a,i=[],o={id:void 0,result:void 0,error:void 0};return function(u){var s=u.data;i.length=0,o.id=s.id,o.error=void 0,o.result=void 0;try{o.result=n(s.parameters,i)}catch(e){e instanceof Error?o.error={name:e.name,message:e.message,stack:e.stack}:o.error=e}t(a)||(a=e(self.webkitPostMessage,self.postMessage)),s.canTransferArrayBuffer||(i.length=0);try{a(o,i)}catch(e){o.result=void 0,o.error="postMessage failed with error: "+r(e)+"\n with responseMessage: "+JSON.stringify(o),a(o)}}}return n}),define("Workers/combineGeometry",["../Scene/PrimitivePipeline","./createTaskProcessorWorker"],function(e,t){"use strict";function r(t,r){var n=e.unpackCombineGeometryParameters(t),a=e.combineGeometry(n);return e.packCombineGeometryResults(a,r)}return t(r)})}(); \ No newline at end of file diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createBoxGeometry.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createBoxGeometry.js index 779a0853..abb28eec 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createBoxGeometry.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createBoxGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,6 +55,6 @@ mersenne-twister.js - https://gist.github.com/banksean/300494 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -!function(){define("Core/defined",[],function(){"use strict";function t(t){return void 0!==t&&null!==t}return t}),define("Core/freezeObject",["./defined"],function(t){"use strict";var e=Object.freeze;return t(e)||(e=function(t){return t}),e}),define("Core/defaultValue",["./freezeObject"],function(t){"use strict";function e(t,e){return void 0!==t?t:e}return e.EMPTY_OBJECT=t({}),e}),define("Core/DeveloperError",["./defined"],function(t){"use strict";function e(t){this.name="DeveloperError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e.throwInstantiationError=function(){throw new e("This function defines an interface and should not be called directly.")},e}),define("Core/isArray",["./defined"],function(t){"use strict";var e=Array.isArray;return t(e)||(e=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),e}),define("Core/Check",["./defaultValue","./defined","./DeveloperError","./isArray"],function(t,e,n,r){"use strict";function i(t){return t+" was required but undefined."}function a(t,e,n){return"Expected "+n+" to be typeof "+e+", got "+t}var o={};return o.typeOf={},o.numeric={},o.defined=function(t,r){if(!e(t))throw new n(i(r))},o.numeric.maximum=function(t,e){if(o.typeOf.number(t),o.typeOf.number(e),t>e)throw new n("Expected "+t+" to be at most "+e)},o.numeric.minimum=function(t,e){if(o.typeOf.number(t),o.typeOf.number(e),t<e)throw new n("Expected "+t+" to be at least "+e)},o.typeOf.function=function(t,e){if("function"!=typeof t)throw new n(a(typeof t,"function",e))},o.typeOf.string=function(t,e){if("string"!=typeof t)throw new n(a(typeof t,"string",e))},o.typeOf.number=function(t,e){if("number"!=typeof t)throw new n(a(typeof t,"number",e))},o.typeOf.object=function(t,e){if("object"!=typeof t)throw new n(a(typeof t,"object",e))},o.typeOf.boolean=function(t,e){if("boolean"!=typeof t)throw new n(a(typeof t,"boolean",e))},o}),define("ThirdParty/mersenne-twister",[],function(){var t=function(t){void 0==t&&(t=(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(t)};return t.prototype.init_genrand=function(t){for(this.mt[0]=t>>>0,this.mti=1;this.mti<this.N;this.mti++){var t=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&t)>>>16)<<16)+1812433253*(65535&t)+this.mti,this.mt[this.mti]>>>=0}},t.prototype.genrand_int32=function(){var t,e=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)t=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^t>>>1^e[1&t];for(;n<this.N-1;n++)t=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^t>>>1^e[1&t];t=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^t>>>1^e[1&t],this.mti=0}return t=this.mt[this.mti++],t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,t^=t>>>18,t>>>0},t.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},t}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(t,e,n,r){"use strict";var i={};i.EPSILON1=.1,i.EPSILON2=.01,i.EPSILON3=.001,i.EPSILON4=1e-4,i.EPSILON5=1e-5,i.EPSILON6=1e-6,i.EPSILON7=1e-7,i.EPSILON8=1e-8,i.EPSILON9=1e-9,i.EPSILON10=1e-10,i.EPSILON11=1e-11,i.EPSILON12=1e-12,i.EPSILON13=1e-13,i.EPSILON14=1e-14,i.EPSILON15=1e-15,i.EPSILON16=1e-16,i.EPSILON17=1e-17,i.EPSILON18=1e-18,i.EPSILON19=1e-19,i.EPSILON20=1e-20,i.GRAVITATIONALPARAMETER=3986004418e5,i.SOLAR_RADIUS=6955e5,i.LUNAR_RADIUS=1737400,i.SIXTY_FOUR_KILOBYTES=65536,i.sign=function(t){return t>0?1:t<0?-1:0},i.signNotZero=function(t){return t<0?-1:1},i.toSNorm=function(t,n){return n=e(n,255),Math.round((.5*i.clamp(t,-1,1)+.5)*n)},i.fromSNorm=function(t,n){return n=e(n,255),i.clamp(t,0,n)/n*2-1},i.sinh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e-n)},i.cosh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e+n)},i.lerp=function(t,e,n){return(1-n)*t+n*e},i.PI=Math.PI,i.ONE_OVER_PI=1/Math.PI,i.PI_OVER_TWO=.5*Math.PI,i.PI_OVER_THREE=Math.PI/3,i.PI_OVER_FOUR=Math.PI/4,i.PI_OVER_SIX=Math.PI/6,i.THREE_PI_OVER_TWO=3*Math.PI*.5,i.TWO_PI=2*Math.PI,i.ONE_OVER_TWO_PI=1/(2*Math.PI),i.RADIANS_PER_DEGREE=Math.PI/180,i.DEGREES_PER_RADIAN=180/Math.PI,i.RADIANS_PER_ARCSECOND=i.RADIANS_PER_DEGREE/3600,i.toRadians=function(t){return t*i.RADIANS_PER_DEGREE},i.toDegrees=function(t){return t*i.DEGREES_PER_RADIAN},i.convertLongitudeRange=function(t){var e=i.TWO_PI,n=t-Math.floor(t/e)*e;return n<-Math.PI?n+e:n>=Math.PI?n-e:n},i.clampToLatitudeRange=function(t){return i.clamp(t,-1*i.PI_OVER_TWO,i.PI_OVER_TWO)},i.negativePiToPi=function(t){return i.zeroToTwoPi(t+i.PI)-i.PI},i.zeroToTwoPi=function(t){var e=i.mod(t,i.TWO_PI);return Math.abs(e)<i.EPSILON14&&Math.abs(t)>i.EPSILON14?i.TWO_PI:e},i.mod=function(t,e){return(t%e+e)%e},i.equalsEpsilon=function(t,n,r,i){i=e(i,r);var a=Math.abs(t-n);return a<=i||a<=r*Math.max(Math.abs(t),Math.abs(n))};var a=[1];i.factorial=function(t){var e=a.length;if(t>=e)for(var n=a[e-1],r=e;r<=t;r++)a.push(n*r);return a[t]},i.incrementWrap=function(t,n,r){return r=e(r,0),++t,t>n&&(t=r),t},i.isPowerOfTwo=function(t){return 0!==t&&0===(t&t-1)},i.nextPowerOfTwo=function(t){return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t,t},i.clamp=function(t,e,n){return t<e?e:t>n?n:t};var o=new t;return i.setRandomNumberSeed=function(e){o=new t(e)},i.nextRandomNumber=function(){return o.random()},i.acosClamped=function(t){return Math.acos(i.clamp(t,-1,1))},i.asinClamped=function(t){return Math.asin(i.clamp(t,-1,1))},i.chordLength=function(t,e){return 2*e*Math.sin(.5*t)},i.logBase=function(t,e){return Math.log(t)/Math.log(e)},i.fog=function(t,e){var n=t*e;return 1-Math.exp(-(n*n))},i}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a){"use strict";function o(t,n,r){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0)}o.fromSpherical=function(t,r){n(r)||(r=new o);var i=t.clock,a=t.cone,u=e(t.magnitude,1),E=u*Math.sin(a);return r.x=E*Math.cos(i),r.y=E*Math.sin(i),r.z=u*Math.cos(a),r},o.fromElements=function(t,e,r,i){return n(i)?(i.x=t,i.y=e,i.z=r,i):new o(t,e,r)},o.clone=function(t,e){if(n(t))return n(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e):new o(t.x,t.y,t.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r]=t.z,n},o.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new o),i.x=t[r++],i.y=t[r++],i.z=t[r],i},o.packArray=function(t,e){var r=t.length;n(e)?e.length=3*r:e=new Array(3*r);for(var i=0;i<r;++i)o.pack(t[i],e,3*i);return e},o.unpackArray=function(t,e){var r=t.length;n(e)?e.length=r/3:e=new Array(r/3);for(var i=0;i<r;i+=3){var a=i/3;e[a]=o.unpack(t,i,e[a])}return e},o.fromArray=o.unpack,o.maximumComponent=function(t){return Math.max(t.x,t.y,t.z)},o.minimumComponent=function(t){return Math.min(t.x,t.y,t.z)},o.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n.z=Math.min(t.z,e.z),n},o.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n.z=Math.max(t.z,e.z),n},o.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z},o.magnitude=function(t){return Math.sqrt(o.magnitudeSquared(t))};var u=new o;o.distance=function(t,e){return o.subtract(t,e,u),o.magnitude(u)},o.distanceSquared=function(t,e){return o.subtract(t,e,u),o.magnitudeSquared(u)},o.normalize=function(t,e){var n=o.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e},o.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},o.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n.z=t.z*e.z,n},o.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n.z=t.z/e.z,n},o.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n},o.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n},o.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*e,n},o.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n},o.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e},o.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e};var E=new o;o.lerp=function(t,e,n,r){return o.multiplyByScalar(e,n,E),r=o.multiplyByScalar(t,1-n,r),o.add(E,r,r)};var s=new o,c=new o;o.angleBetween=function(t,e){o.normalize(t,s),o.normalize(e,c);var n=o.dot(s,c),r=o.magnitude(o.cross(s,c,s));return Math.atan2(r,n)};var _=new o;o.mostOrthogonalAxis=function(t,e){var n=o.normalize(t,_);return o.abs(n,n),e=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,e):o.clone(o.UNIT_Z,e):n.y<=n.z?o.clone(o.UNIT_Y,e):o.clone(o.UNIT_Z,e)},o.equals=function(t,e){return t===e||n(t)&&n(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z},o.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]},o.equalsEpsilon=function(t,e,r,i){return t===e||n(t)&&n(e)&&a.equalsEpsilon(t.x,e.x,r,i)&&a.equalsEpsilon(t.y,e.y,r,i)&&a.equalsEpsilon(t.z,e.z,r,i)},o.cross=function(t,e,n){var r=t.x,i=t.y,a=t.z,o=e.x,u=e.y,E=e.z,s=i*E-a*u,c=a*o-r*E,_=r*u-i*o;return n.x=s,n.y=c,n.z=_,n},o.fromDegrees=function(t,e,n,r,i){return t=a.toRadians(t),e=a.toRadians(e),o.fromRadians(t,e,n,r,i)};var T=new o,R=new o,l=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(t,r,i,a,u){i=e(i,0);var E=n(a)?a.radiiSquared:l,s=Math.cos(r);T.x=s*Math.cos(t),T.y=s*Math.sin(t),T.z=Math.sin(r),T=o.normalize(T,T),o.multiplyComponents(E,T,R);var c=Math.sqrt(o.dot(T,R));return R=o.divideByScalar(R,c,R),T=o.multiplyByScalar(T,i,T),n(u)||(u=new o),o.add(R,T,u)},o.fromDegreesArray=function(t,e,r){var i=t.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=t[a],E=t[a+1],s=a/2;r[s]=o.fromDegrees(u,E,0,e,r[s])}return r},o.fromRadiansArray=function(t,e,r){var i=t.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=t[a],E=t[a+1],s=a/2;r[s]=o.fromRadians(u,E,0,e,r[s])}return r},o.fromDegreesArrayHeights=function(t,e,r){var i=t.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=t[a],E=t[a+1],s=t[a+2],c=a/3;r[c]=o.fromDegrees(u,E,s,e,r[c])}return r},o.fromRadiansArrayHeights=function(t,e,r){var i=t.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=t[a],E=t[a+1],s=t[a+2],c=a/3;r[c]=o.fromRadians(u,E,s,e,r[c])}return r},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(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.prototype.equalsEpsilon=function(t,e,n){return o.equalsEpsilon(this,t,e,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(t,e,n,r){"use strict";function i(n,i,u,E,s){var c=n.x,_=n.y,T=n.z,R=i.x,l=i.y,A=i.z,f=c*c*R*R,N=_*_*l*l,h=T*T*A*A,d=f+N+h,I=Math.sqrt(1/d),m=t.multiplyByScalar(n,I,a);if(d<E)return isFinite(I)?t.clone(m,s):void 0;var S=u.x,O=u.y,M=u.z,y=o;y.x=m.x*S*2,y.y=m.y*O*2,y.z=m.z*M*2;var p,C,U,L,F,P,w,x,g,v,D,B=(1-I)*t.magnitude(n)/(.5*t.magnitude(y)),z=0;do{B-=z,U=1/(1+B*S),L=1/(1+B*O),F=1/(1+B*M),P=U*U,w=L*L,x=F*F,g=P*U,v=w*L,D=x*F,p=f*P+N*w+h*x-1,C=f*g*S+N*v*O+h*D*M;var G=-2*C;z=p/G}while(Math.abs(p)>r.EPSILON12);return e(s)?(s.x=c*U,s.y=_*L,s.z=T*F,s):new t(c*U,_*L,T*F)}var a=new t,o=new t;return i}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,n,r,i,a,o){"use strict";function u(t,n,r){this.longitude=e(t,0),this.latitude=e(n,0),this.height=e(r,0)}u.fromRadians=function(t,r,i,a){return i=e(i,0),n(a)?(a.longitude=t,a.latitude=r,a.height=i,a):new u(t,r,i)},u.fromDegrees=function(t,e,n,r){return t=a.toRadians(t),e=a.toRadians(e),u.fromRadians(t,e,n,r)};var E=new t,s=new t,c=new t,_=new t(1/6378137,1/6378137,1/6356752.314245179),T=new t(1/40680631590769,1/40680631590769,1/40408299984661.445),R=a.EPSILON1;return u.fromCartesian=function(e,r,i){var l=n(r)?r.oneOverRadii:_,A=n(r)?r.oneOverRadiiSquared:T,f=n(r)?r._centerToleranceSquared:R,N=o(e,l,A,f,s);if(n(N)){var h=t.multiplyComponents(N,A,E);h=t.normalize(h,h);var d=t.subtract(e,N,c),I=Math.atan2(h.y,h.x),m=Math.asin(h.z),S=a.sign(t.dot(d,e))*t.magnitude(d);return n(i)?(i.longitude=I,i.latitude=m,i.height=S,i):new u(I,m,S)}},u.clone=function(t,e){if(n(t))return n(e)?(e.longitude=t.longitude,e.latitude=t.latitude,e.height=t.height,e):new u(t.longitude,t.latitude,t.height)},u.equals=function(t,e){return t===e||n(t)&&n(e)&&t.longitude===e.longitude&&t.latitude===e.latitude&&t.height===e.height},u.equalsEpsilon=function(t,e,r){return t===e||n(t)&&n(e)&&Math.abs(t.longitude-e.longitude)<=r&&Math.abs(t.latitude-e.latitude)<=r&&Math.abs(t.height-e.height)<=r},u.ZERO=i(new u(0,0,0)),u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.prototype.equalsEpsilon=function(t,e){return u.equalsEpsilon(this,t,e)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(t){"use strict";var e=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(t){return!1}}(),n=Object.defineProperties;return e&&t(n)||(n=function(t){return t}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,n,r,i,a,o,u,E){"use strict";function s(e,r,i,a){r=n(r,0),i=n(i,0),a=n(a,0),e._radii=new t(r,i,a),e._radiiSquared=new t(r*r,i*i,a*a),e._radiiToTheFourth=new t(r*r*r*r,i*i*i*i,a*a*a*a),e._oneOverRadii=new t(0===r?0:1/r,0===i?0:1/i,0===a?0:1/a),e._oneOverRadiiSquared=new t(0===r?0:1/(r*r),0===i?0:1/(i*i),0===a?0:1/(a*a)),e._minimumRadius=Math.min(r,i,a),e._maximumRadius=Math.max(r,i,a),e._centerToleranceSquared=u.EPSILON1,0!==e._radiiSquared.z&&(e._sqauredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function c(t,e,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,s(this,t,e,n)}i(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(e,n){if(r(e)){var i=e._radii;return r(n)?(t.clone(i,n._radii),t.clone(e._radiiSquared,n._radiiSquared),t.clone(e._radiiToTheFourth,n._radiiToTheFourth),t.clone(e._oneOverRadii,n._oneOverRadii),t.clone(e._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=e._minimumRadius,n._maximumRadius=e._maximumRadius,n._centerToleranceSquared=e._centerToleranceSquared,n):new c(i.x,i.y,i.z)}},c.fromCartesian3=function(t,e){return r(e)||(e=new c),r(t)?(s(e,t.x,t.y,t.z),e):e},c.WGS84=o(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=o(new c(1,1,1)),c.MOON=o(new c(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),c.prototype.clone=function(t){return c.clone(this,t)},c.packedLength=t.packedLength,c.pack=function(e,r,i){return i=n(i,0),t.pack(e._radii,r,i),r},c.unpack=function(e,r,i){r=n(r,0);var a=t.unpack(e,r);return c.fromCartesian3(a,i)},c.prototype.geocentricSurfaceNormal=t.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(e,n){var i=e.longitude,a=e.latitude,o=Math.cos(a),u=o*Math.cos(i),E=o*Math.sin(i),s=Math.sin(a);return r(n)||(n=new t),n.x=u,n.y=E,n.z=s,t.normalize(n,n)},c.prototype.geodeticSurfaceNormal=function(e,n){return r(n)||(n=new t),n=t.multiplyComponents(e,this._oneOverRadiiSquared,n),t.normalize(n,n)};var _=new t,T=new t;c.prototype.cartographicToCartesian=function(e,n){var i=_,a=T;this.geodeticSurfaceNormalCartographic(e,i),t.multiplyComponents(this._radiiSquared,i,a);var o=Math.sqrt(t.dot(i,a));return t.divideByScalar(a,o,a),t.multiplyByScalar(i,e.height,i),r(n)||(n=new t),t.add(a,i,n)},c.prototype.cartographicArrayToCartesianArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var i=0;i<n;i++)e[i]=this.cartographicToCartesian(t[i],e[i]);return e};var R=new t,l=new t,A=new t;return c.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,l);if(r(a)){var o=this.geodeticSurfaceNormal(a,R),E=t.subtract(n,a,A),s=Math.atan2(o.y,o.x),c=Math.asin(o.z),_=u.sign(t.dot(E,n))*t.magnitude(E);return r(i)?(i.longitude=s,i.latitude=c,i.height=_,i):new e(s,c,_)}},c.prototype.cartesianArrayToCartographicArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var i=0;i<n;++i)e[i]=this.cartesianToCartographic(t[i],e[i]);return e},c.prototype.scaleToGeodeticSurface=function(t,e){return E(t,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,e)},c.prototype.scaleToGeocentricSurface=function(e,n){r(n)||(n=new t);var i=e.x,a=e.y,o=e.z,u=this._oneOverRadiiSquared,E=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*u.z);return t.multiplyByScalar(e,E,n)},c.prototype.transformPositionToScaledSpace=function(e,n){return r(n)||(n=new t),t.multiplyComponents(e,this._oneOverRadii,n)},c.prototype.transformPositionFromScaledSpace=function(e,n){return r(n)||(n=new t),t.multiplyComponents(e,this._radii,n)},c.prototype.equals=function(e){return this===e||r(e)&&t.equals(this._radii,e._radii)},c.prototype.toString=function(){return this._radii.toString()},c.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,i,a){i=n(i,0);var o=this._sqauredXOverSquaredZ;if(r(a)||(a=new t),a.x=0,a.y=0,a.z=e.z*(1-o),!(Math.abs(a.z)>=this._radii.z-i))return a},c}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(t,e,n,r,i,a,o){"use strict";function u(t){this._ellipsoid=n(t,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return i(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(e,n){var i=this._semimajorAxis,a=e.longitude*i,o=e.latitude*i,u=e.height;return r(n)?(n.x=a,n.y=o,n.z=u,n):new t(a,o,u)},u.prototype.unproject=function(t,n){var i=this._oneOverSemimajorAxis,a=t.x*i,o=t.y*i,u=t.z;return r(n)?(n.longitude=a,n.latitude=o,n.height=u,n):new e(a,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(t){"use strict";var e={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return t(e)}),define("Core/Interval",["./defaultValue"],function(t){"use strict";function e(e,n){this.start=t(e,0),this.stop=t(n,0)}return e}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a,o){"use strict";function u(t,n,r,i,a,o,u,E,s){this[0]=e(t,0),this[1]=e(i,0),this[2]=e(u,0),this[3]=e(n,0),this[4]=e(a,0),this[5]=e(E,0),this[6]=e(r,0),this[7]=e(o,0),this[8]=e(s,0)}function E(t){for(var e=0,n=0;n<9;++n){var r=t[n];e+=r*r}return Math.sqrt(e)}function s(t){for(var e=0,n=0;n<3;++n){var r=t[u.getElementIndex(l[n],R[n])];e+=2*r*r}return Math.sqrt(e)}function c(t,e){for(var n=o.EPSILON15,r=0,i=1,a=0;a<3;++a){var E=Math.abs(t[u.getElementIndex(l[a],R[a])]);E>r&&(i=a,r=E)}var s=1,c=0,_=R[i],T=l[i];if(Math.abs(t[u.getElementIndex(T,_)])>n){var A,f=t[u.getElementIndex(T,T)],N=t[u.getElementIndex(_,_)],h=t[u.getElementIndex(T,_)],d=(f-N)/2/h;A=d<0?-1/(-d+Math.sqrt(1+d*d)):1/(d+Math.sqrt(1+d*d)),s=1/Math.sqrt(1+A*A),c=A*s}return e=u.clone(u.IDENTITY,e),e[u.getElementIndex(_,_)]=e[u.getElementIndex(T,T)]=s,e[u.getElementIndex(T,_)]=c,e[u.getElementIndex(_,T)]=-c,e}u.packedLength=9,u.pack=function(t,n,r){return r=e(r,0),n[r++]=t[0],n[r++]=t[1],n[r++]=t[2],n[r++]=t[3],n[r++]=t[4],n[r++]=t[5],n[r++]=t[6],n[r++]=t[7],n[r++]=t[8],n},u.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new u),i[0]=t[r++],i[1]=t[r++],i[2]=t[r++],i[3]=t[r++],i[4]=t[r++],i[5]=t[r++],i[6]=t[r++],i[7]=t[r++],i[8]=t[r++],i},u.clone=function(t,e){if(n(t))return n(e)?(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):new u(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8])},u.fromArray=function(t,r,i){return r=e(r,0),n(i)||(i=new u),i[0]=t[r],i[1]=t[r+1],i[2]=t[r+2],i[3]=t[r+3],i[4]=t[r+4],i[5]=t[r+5],i[6]=t[r+6],i[7]=t[r+7],i[8]=t[r+8],i},u.fromColumnMajorArray=function(t,e){return u.clone(t,e)},u.fromRowMajorArray=function(t,e){return n(e)?(e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],e):new u(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},u.fromQuaternion=function(t,e){var r=t.x*t.x,i=t.x*t.y,a=t.x*t.z,o=t.x*t.w,E=t.y*t.y,s=t.y*t.z,c=t.y*t.w,_=t.z*t.z,T=t.z*t.w,R=t.w*t.w,l=r-E-_+R,A=2*(i-T),f=2*(a+c),N=2*(i+T),h=-r+E-_+R,d=2*(s-o),I=2*(a-c),m=2*(s+o),S=-r-E+_+R;return n(e)?(e[0]=l,e[1]=N,e[2]=I,e[3]=A,e[4]=h,e[5]=m,e[6]=f,e[7]=d,e[8]=S,e):new u(l,A,f,N,h,d,I,m,S)},u.fromHeadingPitchRoll=function(t,e){var r=Math.cos(-t.pitch),i=Math.cos(-t.heading),a=Math.cos(t.roll),o=Math.sin(-t.pitch),E=Math.sin(-t.heading),s=Math.sin(t.roll),c=r*i,_=-a*E+s*o*i,T=s*E+a*o*i,R=r*E,l=a*i+s*o*E,A=-o*a+a*o*E,f=-o,N=s*r,h=a*r;return n(e)?(e[0]=c,e[1]=R,e[2]=f,e[3]=_,e[4]=l,e[5]=N,e[6]=T,e[7]=A,e[8]=h,e):new u(c,_,T,R,l,A,f,N,h)},u.fromScale=function(t,e){return n(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=t.y,e[5]=0,e[6]=0,e[7]=0,e[8]=t.z,e):new u(t.x,0,0,0,t.y,0,0,0,t.z)},u.fromUniformScale=function(t,e){return n(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=t,e[5]=0,e[6]=0,e[7]=0,e[8]=t,e):new u(t,0,0,0,t,0,0,0,t)},u.fromCrossProduct=function(t,e){return n(e)?(e[0]=0,e[1]=t.z,e[2]=-t.y,e[3]=-t.z,e[4]=0,e[5]=t.x,e[6]=t.y,e[7]=-t.x,e[8]=0,e):new u(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},u.fromRotationX=function(t,e){var r=Math.cos(t),i=Math.sin(t);return n(e)?(e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=r,e[5]=i,e[6]=0,e[7]=-i,e[8]=r,e):new u(1,0,0,0,r,-i,0,i,r)},u.fromRotationY=function(t,e){var r=Math.cos(t),i=Math.sin(t);return n(e)?(e[0]=r,e[1]=0,e[2]=-i,e[3]=0,e[4]=1,e[5]=0,e[6]=i,e[7]=0,e[8]=r,e):new u(r,0,i,0,1,0,-i,0,r)},u.fromRotationZ=function(t,e){var r=Math.cos(t),i=Math.sin(t);return n(e)?(e[0]=r,e[1]=i,e[2]=0,e[3]=-i,e[4]=r,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e):new u(r,-i,0,i,r,0,0,0,1)},u.toArray=function(t,e){return n(e)?(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):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},u.getElementIndex=function(t,e){return 3*t+e},u.getColumn=function(t,e,n){var r=3*e,i=t[r],a=t[r+1],o=t[r+2];return n.x=i,n.y=a,n.z=o,n},u.setColumn=function(t,e,n,r){r=u.clone(t,r);var i=3*e;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},u.getRow=function(t,e,n){var r=t[e],i=t[e+3],a=t[e+6];return n.x=r,n.y=i,n.z=a,n},u.setRow=function(t,e,n,r){return r=u.clone(t,r),r[e]=n.x,r[e+3]=n.y,r[e+6]=n.z,r};var _=new t;u.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],_)),n.y=t.magnitude(t.fromElements(e[3],e[4],e[5],_)),n.z=t.magnitude(t.fromElements(e[6],e[7],e[8],_)),n};var T=new t;u.getMaximumScale=function(e){return u.getScale(e,T),t.maximumComponent(T)},u.multiply=function(t,e,n){var r=t[0]*e[0]+t[3]*e[1]+t[6]*e[2],i=t[1]*e[0]+t[4]*e[1]+t[7]*e[2],a=t[2]*e[0]+t[5]*e[1]+t[8]*e[2],o=t[0]*e[3]+t[3]*e[4]+t[6]*e[5],u=t[1]*e[3]+t[4]*e[4]+t[7]*e[5],E=t[2]*e[3]+t[5]*e[4]+t[8]*e[5],s=t[0]*e[6]+t[3]*e[7]+t[6]*e[8],c=t[1]*e[6]+t[4]*e[7]+t[7]*e[8],_=t[2]*e[6]+t[5]*e[7]+t[8]*e[8];return n[0]=r,n[1]=i,n[2]=a,n[3]=o,n[4]=u,n[5]=E,n[6]=s,n[7]=c,n[8]=_,n},u.add=function(t,e,n){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n[4]=t[4]+e[4],n[5]=t[5]+e[5],n[6]=t[6]+e[6],n[7]=t[7]+e[7],n[8]=t[8]+e[8],n},u.subtract=function(t,e,n){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n[4]=t[4]-e[4],n[5]=t[5]-e[5],n[6]=t[6]-e[6],n[7]=t[7]-e[7],n[8]=t[8]-e[8],n},u.multiplyByVector=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=t[0]*r+t[3]*i+t[6]*a,u=t[1]*r+t[4]*i+t[7]*a,E=t[2]*r+t[5]*i+t[8]*a;return n.x=o,n.y=u,n.z=E,n},u.multiplyByScalar=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n[4]=t[4]*e,n[5]=t[5]*e,n[6]=t[6]*e,n[7]=t[7]*e,n[8]=t[8]*e,n},u.multiplyByScale=function(t,e,n){return n[0]=t[0]*e.x,n[1]=t[1]*e.x,n[2]=t[2]*e.x,n[3]=t[3]*e.y,n[4]=t[4]*e.y,n[5]=t[5]*e.y,n[6]=t[6]*e.z,n[7]=t[7]*e.z,n[8]=t[8]*e.z,n},u.negate=function(t,e){return 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},u.transpose=function(t,e){var n=t[0],r=t[3],i=t[6],a=t[1],o=t[4],u=t[7],E=t[2],s=t[5],c=t[8];return e[0]=n,e[1]=r,e[2]=i,e[3]=a,e[4]=o,e[5]=u,e[6]=E,e[7]=s,e[8]=c,e};var R=[1,0,0],l=[2,2,1],A=new u,f=new u;return u.computeEigenDecomposition=function(t,e){var r=o.EPSILON20,i=10,a=0,_=0;n(e)||(e={});for(var T=e.unitary=u.clone(u.IDENTITY,e.unitary),R=e.diagonal=u.clone(t,e.diagonal),l=r*E(R);_<i&&s(R)>l;)c(R,A),u.transpose(A,f),u.multiply(R,A,R),u.multiply(f,R,R),u.multiply(T,A,T),++a>2&&(++_,a=0);return e},u.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e},u.determinant=function(t){var e=t[0],n=t[3],r=t[6],i=t[1],a=t[4],o=t[7],u=t[2],E=t[5],s=t[8];return e*(a*s-E*o)+i*(E*r-n*s)+u*(n*o-a*r)},u.inverse=function(t,e){var n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],E=t[5],s=t[6],c=t[7],_=t[8],T=u.determinant(t);e[0]=o*_-c*E,e[1]=c*i-r*_,e[2]=r*E-o*i,e[3]=s*E-a*_,e[4]=n*_-s*i,e[5]=a*i-n*E,e[6]=a*c-s*o,e[7]=s*r-n*c,e[8]=n*o-a*r;var R=1/T;return u.multiplyByScalar(e,R,e)},u.equals=function(t,e){return t===e||n(t)&&n(e)&&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]},u.equalsEpsilon=function(t,e,r){return t===e||n(t)&&n(e)&&Math.abs(t[0]-e[0])<=r&&Math.abs(t[1]-e[1])<=r&&Math.abs(t[2]-e[2])<=r&&Math.abs(t[3]-e[3])<=r&&Math.abs(t[4]-e[4])<=r&&Math.abs(t[5]-e[5])<=r&&Math.abs(t[6]-e[6])<=r&&Math.abs(t[7]-e[7])<=r&&Math.abs(t[8]-e[8])<=r},u.IDENTITY=a(new u(1,0,0,0,1,0,0,0,1)),u.ZERO=a(new u(0,0,0,0,0,0,0,0,0)),u.COLUMN0ROW0=0,u.COLUMN0ROW1=1,u.COLUMN0ROW2=2,u.COLUMN1ROW0=3,u.COLUMN1ROW1=4,u.COLUMN1ROW2=5,u.COLUMN2ROW0=6,u.COLUMN2ROW1=7,u.COLUMN2ROW2=8,r(u.prototype,{length:{get:function(){return u.packedLength}}}),u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]&&t[4]===e[n+4]&&t[5]===e[n+5]&&t[6]===e[n+6]&&t[7]===e[n+7]&&t[8]===e[n+8]},u.prototype.equalsEpsilon=function(t,e){return u.equalsEpsilon(this,t,e)},u.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},u}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i){"use strict";function a(e,n,r,i){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(i,0)}a.fromElements=function(t,n,r,i,o){return e(o)?(o.x=t,o.y=n,o.z=r,o.w=i,o):new a(t,n,r,i)},a.fromColor=function(t,n){return e(n)?(n.x=t.red,n.y=t.green,n.z=t.blue,n.w=t.alpha,n):new a(t.red,t.green,t.blue,t.alpha)},a.clone=function(t,n){if(e(t))return e(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n.w=t.w,n):new a(t.x,t.y,t.z,t.w)},a.packedLength=4,a.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},a.unpack=function(n,r,i){return r=t(r,0),e(i)||(i=new a),i.x=n[r++],i.y=n[r++],i.z=n[r++],i.w=n[r],i},a.packArray=function(t,n){var r=t.length;e(n)?n.length=4*r:n=new Array(4*r);for(var i=0;i<r;++i)a.pack(t[i],n,4*i);return n},a.unpackArray=function(t,n){var r=t.length;e(n)?n.length=r/4:n=new Array(r/4);for(var i=0;i<r;i+=4){var o=i/4;n[o]=a.unpack(t,i,n[o])}return n},a.fromArray=a.unpack,a.maximumComponent=function(t){return Math.max(t.x,t.y,t.z,t.w)},a.minimumComponent=function(t){return Math.min(t.x,t.y,t.z,t.w)},a.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n.z=Math.min(t.z,e.z),n.w=Math.min(t.w,e.w),n},a.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n.z=Math.max(t.z,e.z),n.w=Math.max(t.w,e.w),n},a.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w},a.magnitude=function(t){return Math.sqrt(a.magnitudeSquared(t))};var o=new a;a.distance=function(t,e){return a.subtract(t,e,o),a.magnitude(o)},a.distanceSquared=function(t,e){return a.subtract(t,e,o),a.magnitudeSquared(o)},a.normalize=function(t,e){var n=a.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e.w=t.w/n,e},a.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z+t.w*e.w},a.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n.z=t.z*e.z,n.w=t.w*e.w,n},a.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n.z=t.z/e.z,n.w=t.w/e.w,n},a.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n.w=t.w+e.w,n},a.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n.w=t.w-e.w,n},a.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*e,n.w=t.w*e,n},a.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n.w=t.w/e,n},a.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e.w=-t.w,e},a.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e.w=Math.abs(t.w),e};var u=new a;a.lerp=function(t,e,n,r){return a.multiplyByScalar(e,n,u),r=a.multiplyByScalar(t,1-n,r),a.add(u,r,r)};var E=new a;return a.mostOrthogonalAxis=function(t,e){var n=a.normalize(t,E);return a.abs(n,n),e=n.x<=n.y?n.x<=n.z?n.x<=n.w?a.clone(a.UNIT_X,e):a.clone(a.UNIT_W,e):n.z<=n.w?a.clone(a.UNIT_Z,e):a.clone(a.UNIT_W,e):n.y<=n.z?n.y<=n.w?a.clone(a.UNIT_Y,e):a.clone(a.UNIT_W,e):n.z<=n.w?a.clone(a.UNIT_Z,e):a.clone(a.UNIT_W,e)},a.equals=function(t,n){return t===n||e(t)&&e(n)&&t.x===n.x&&t.y===n.y&&t.z===n.z&&t.w===n.w},a.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]&&t.w===e[n+3]},a.equalsEpsilon=function(t,n,r,a){return t===n||e(t)&&e(n)&&i.equalsEpsilon(t.x,n.x,r,a)&&i.equalsEpsilon(t.y,n.y,r,a)&&i.equalsEpsilon(t.z,n.z,r,a)&&i.equalsEpsilon(t.w,n.w,r,a)},a.ZERO=r(new a(0,0,0,0)),a.UNIT_X=r(new a(1,0,0,0)),a.UNIT_Y=r(new a(0,1,0,0)),a.UNIT_Z=r(new a(0,0,1,0)),a.UNIT_W=r(new a(0,0,0,1)),a.prototype.clone=function(t){return a.clone(this,t)},a.prototype.equals=function(t){return a.equals(this,t)},a.prototype.equalsEpsilon=function(t,e,n){return a.equalsEpsilon(this,t,e,n)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},a}),define("Core/RuntimeError",["./defined"],function(t){"use strict";function e(t){this.name="RuntimeError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(t,e,n,r,i,a,o,u,E,s){"use strict";function c(t,e,r,i,a,o,u,E,s,c,_,T,R,l,A,f){this[0]=n(t,0),this[1]=n(a,0),this[2]=n(s,0),this[3]=n(R,0),this[4]=n(e,0), -this[5]=n(o,0),this[6]=n(c,0),this[7]=n(l,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(_,0),this[11]=n(A,0),this[12]=n(i,0),this[13]=n(E,0),this[14]=n(T,0),this[15]=n(f,0)}c.packedLength=16,c.pack=function(t,e,r){return r=n(r,0),e[r++]=t[0],e[r++]=t[1],e[r++]=t[2],e[r++]=t[3],e[r++]=t[4],e[r++]=t[5],e[r++]=t[6],e[r++]=t[7],e[r++]=t[8],e[r++]=t[9],e[r++]=t[10],e[r++]=t[11],e[r++]=t[12],e[r++]=t[13],e[r++]=t[14],e[r]=t[15],e},c.unpack=function(t,e,i){return e=n(e,0),r(i)||(i=new c),i[0]=t[e++],i[1]=t[e++],i[2]=t[e++],i[3]=t[e++],i[4]=t[e++],i[5]=t[e++],i[6]=t[e++],i[7]=t[e++],i[8]=t[e++],i[9]=t[e++],i[10]=t[e++],i[11]=t[e++],i[12]=t[e++],i[13]=t[e++],i[14]=t[e++],i[15]=t[e],i},c.clone=function(t,e){if(r(t))return r(e)?(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],e):new c(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15])},c.fromArray=c.unpack,c.fromColumnMajorArray=function(t,e){return c.clone(t,e)},c.fromRowMajorArray=function(t,e){return r(e)?(e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15],e):new c(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},c.fromRotationTranslation=function(e,i,a){return i=n(i,t.ZERO),r(a)?(a[0]=e[0],a[1]=e[1],a[2]=e[2],a[3]=0,a[4]=e[3],a[5]=e[4],a[6]=e[5],a[7]=0,a[8]=e[6],a[9]=e[7],a[10]=e[8],a[11]=0,a[12]=i.x,a[13]=i.y,a[14]=i.z,a[15]=1,a):new c(e[0],e[3],e[6],i.x,e[1],e[4],e[7],i.y,e[2],e[5],e[8],i.z,0,0,0,1)},c.fromTranslationQuaternionRotationScale=function(t,e,n,i){r(i)||(i=new c);var a=n.x,o=n.y,u=n.z,E=e.x*e.x,s=e.x*e.y,_=e.x*e.z,T=e.x*e.w,R=e.y*e.y,l=e.y*e.z,A=e.y*e.w,f=e.z*e.z,N=e.z*e.w,h=e.w*e.w,d=E-R-f+h,I=2*(s-N),m=2*(_+A),S=2*(s+N),O=-E+R-f+h,M=2*(l-T),y=2*(_-A),p=2*(l+T),C=-E-R+f+h;return i[0]=d*a,i[1]=S*a,i[2]=y*a,i[3]=0,i[4]=I*o,i[5]=O*o,i[6]=p*o,i[7]=0,i[8]=m*u,i[9]=M*u,i[10]=C*u,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,i},c.fromTranslationRotationScale=function(t,e){return c.fromTranslationQuaternionRotationScale(t.translation,t.rotation,t.scale,e)},c.fromTranslation=function(t,e){return c.fromRotationTranslation(E.IDENTITY,t,e)},c.fromScale=function(t,e){return r(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t.y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t.z,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new c(t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1)},c.fromUniformScale=function(t,e){return r(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new c(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1)};var _=new t,T=new t,R=new t;c.fromCamera=function(e,n){var i=e.position,a=e.direction,o=e.up;t.normalize(a,_),t.normalize(t.cross(_,o,T),T),t.normalize(t.cross(T,_,R),R);var u=T.x,E=T.y,s=T.z,l=_.x,A=_.y,f=_.z,N=R.x,h=R.y,d=R.z,I=i.x,m=i.y,S=i.z,O=u*-I+E*-m+s*-S,M=N*-I+h*-m+d*-S,y=l*I+A*m+f*S;return r(n)?(n[0]=u,n[1]=N,n[2]=-l,n[3]=0,n[4]=E,n[5]=h,n[6]=-A,n[7]=0,n[8]=s,n[9]=d,n[10]=-f,n[11]=0,n[12]=O,n[13]=M,n[14]=y,n[15]=1,n):new c(u,E,s,O,N,h,d,M,-l,-A,-f,y,0,0,0,1)},c.computePerspectiveFieldOfView=function(t,e,n,r,i){var a=Math.tan(.5*t),o=1/a,u=o/e,E=(r+n)/(n-r),s=2*r*n/(n-r);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=o,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=E,i[11]=-1,i[12]=0,i[13]=0,i[14]=s,i[15]=0,i},c.computeOrthographicOffCenter=function(t,e,n,r,i,a,o){var u=1/(e-t),E=1/(r-n),s=1/(a-i),c=-(e+t)*u,_=-(r+n)*E,T=-(a+i)*s;return u*=2,E*=2,s*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=s,o[11]=0,o[12]=c,o[13]=_,o[14]=T,o[15]=1,o},c.computePerspectiveOffCenter=function(t,e,n,r,i,a,o){var u=2*i/(e-t),E=2*i/(r-n),s=(e+t)/(e-t),c=(r+n)/(r-n),_=-(a+i)/(a-i),T=-1,R=-2*a*i/(a-i);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=s,o[9]=c,o[10]=_,o[11]=T,o[12]=0,o[13]=0,o[14]=R,o[15]=0,o},c.computeInfinitePerspectiveOffCenter=function(t,e,n,r,i,a){var o=2*i/(e-t),u=2*i/(r-n),E=(e+t)/(e-t),s=(r+n)/(r-n),c=-1,_=-1,T=-2*i;return a[0]=o,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=E,a[9]=s,a[10]=c,a[11]=_,a[12]=0,a[13]=0,a[14]=T,a[15]=0,a},c.computeViewportTransformation=function(t,e,r,i){t=n(t,n.EMPTY_OBJECT);var a=n(t.x,0),o=n(t.y,0),u=n(t.width,0),E=n(t.height,0);e=n(e,0),r=n(r,1);var s=.5*u,c=.5*E,_=.5*(r-e),T=s,R=c,l=_,A=a+s,f=o+c,N=e+_,h=1;return i[0]=T,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=R,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=l,i[11]=0,i[12]=A,i[13]=f,i[14]=N,i[15]=h,i},c.computeView=function(e,n,r,i,a){return a[0]=i.x,a[1]=r.x,a[2]=-n.x,a[3]=0,a[4]=i.y,a[5]=r.y,a[6]=-n.y,a[7]=0,a[8]=i.z,a[9]=r.z,a[10]=-n.z,a[11]=0,a[12]=-t.dot(i,e),a[13]=-t.dot(r,e),a[14]=t.dot(n,e),a[15]=1,a},c.toArray=function(t,e){return r(e)?(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],e):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]},c.getElementIndex=function(t,e){return 4*t+e},c.getColumn=function(t,e,n){var r=4*e,i=t[r],a=t[r+1],o=t[r+2],u=t[r+3];return n.x=i,n.y=a,n.z=o,n.w=u,n},c.setColumn=function(t,e,n,r){r=c.clone(t,r);var i=4*e;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r[i+3]=n.w,r},c.setTranslation=function(t,e,n){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=t[15],n},c.getRow=function(t,e,n){var r=t[e],i=t[e+4],a=t[e+8],o=t[e+12];return n.x=r,n.y=i,n.z=a,n.w=o,n},c.setRow=function(t,e,n,r){return r=c.clone(t,r),r[e]=n.x,r[e+4]=n.y,r[e+8]=n.z,r[e+12]=n.w,r};var l=new t;c.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],l)),n.y=t.magnitude(t.fromElements(e[4],e[5],e[6],l)),n.z=t.magnitude(t.fromElements(e[8],e[9],e[10],l)),n};var A=new t;c.getMaximumScale=function(e){return c.getScale(e,A),t.maximumComponent(A)},c.multiply=function(t,e,n){var r=t[0],i=t[1],a=t[2],o=t[3],u=t[4],E=t[5],s=t[6],c=t[7],_=t[8],T=t[9],R=t[10],l=t[11],A=t[12],f=t[13],N=t[14],h=t[15],d=e[0],I=e[1],m=e[2],S=e[3],O=e[4],M=e[5],y=e[6],p=e[7],C=e[8],U=e[9],L=e[10],F=e[11],P=e[12],w=e[13],x=e[14],g=e[15],v=r*d+u*I+_*m+A*S,D=i*d+E*I+T*m+f*S,B=a*d+s*I+R*m+N*S,z=o*d+c*I+l*m+h*S,G=r*O+u*M+_*y+A*p,b=i*O+E*M+T*y+f*p,X=a*O+s*M+R*y+N*p,V=o*O+c*M+l*y+h*p,H=r*C+u*U+_*L+A*F,q=i*C+E*U+T*L+f*F,W=a*C+s*U+R*L+N*F,Y=o*C+c*U+l*L+h*F,k=r*P+u*w+_*x+A*g,K=i*P+E*w+T*x+f*g,Z=a*P+s*w+R*x+N*g,j=o*P+c*w+l*x+h*g;return n[0]=v,n[1]=D,n[2]=B,n[3]=z,n[4]=G,n[5]=b,n[6]=X,n[7]=V,n[8]=H,n[9]=q,n[10]=W,n[11]=Y,n[12]=k,n[13]=K,n[14]=Z,n[15]=j,n},c.add=function(t,e,n){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n[4]=t[4]+e[4],n[5]=t[5]+e[5],n[6]=t[6]+e[6],n[7]=t[7]+e[7],n[8]=t[8]+e[8],n[9]=t[9]+e[9],n[10]=t[10]+e[10],n[11]=t[11]+e[11],n[12]=t[12]+e[12],n[13]=t[13]+e[13],n[14]=t[14]+e[14],n[15]=t[15]+e[15],n},c.subtract=function(t,e,n){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n[4]=t[4]-e[4],n[5]=t[5]-e[5],n[6]=t[6]-e[6],n[7]=t[7]-e[7],n[8]=t[8]-e[8],n[9]=t[9]-e[9],n[10]=t[10]-e[10],n[11]=t[11]-e[11],n[12]=t[12]-e[12],n[13]=t[13]-e[13],n[14]=t[14]-e[14],n[15]=t[15]-e[15],n},c.multiplyTransformation=function(t,e,n){var r=t[0],i=t[1],a=t[2],o=t[4],u=t[5],E=t[6],s=t[8],c=t[9],_=t[10],T=t[12],R=t[13],l=t[14],A=e[0],f=e[1],N=e[2],h=e[4],d=e[5],I=e[6],m=e[8],S=e[9],O=e[10],M=e[12],y=e[13],p=e[14],C=r*A+o*f+s*N,U=i*A+u*f+c*N,L=a*A+E*f+_*N,F=r*h+o*d+s*I,P=i*h+u*d+c*I,w=a*h+E*d+_*I,x=r*m+o*S+s*O,g=i*m+u*S+c*O,v=a*m+E*S+_*O,D=r*M+o*y+s*p+T,B=i*M+u*y+c*p+R,z=a*M+E*y+_*p+l;return n[0]=C,n[1]=U,n[2]=L,n[3]=0,n[4]=F,n[5]=P,n[6]=w,n[7]=0,n[8]=x,n[9]=g,n[10]=v,n[11]=0,n[12]=D,n[13]=B,n[14]=z,n[15]=1,n},c.multiplyByMatrix3=function(t,e,n){var r=t[0],i=t[1],a=t[2],o=t[4],u=t[5],E=t[6],s=t[8],c=t[9],_=t[10],T=e[0],R=e[1],l=e[2],A=e[3],f=e[4],N=e[5],h=e[6],d=e[7],I=e[8],m=r*T+o*R+s*l,S=i*T+u*R+c*l,O=a*T+E*R+_*l,M=r*A+o*f+s*N,y=i*A+u*f+c*N,p=a*A+E*f+_*N,C=r*h+o*d+s*I,U=i*h+u*d+c*I,L=a*h+E*d+_*I;return n[0]=m,n[1]=S,n[2]=O,n[3]=0,n[4]=M,n[5]=y,n[6]=p,n[7]=0,n[8]=C,n[9]=U,n[10]=L,n[11]=0,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n},c.multiplyByTranslation=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=r*t[0]+i*t[4]+a*t[8]+t[12],u=r*t[1]+i*t[5]+a*t[9]+t[13],E=r*t[2]+i*t[6]+a*t[10]+t[14];return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=o,n[13]=u,n[14]=E,n[15]=t[15],n};var f=new t;c.multiplyByUniformScale=function(t,e,n){return f.x=e,f.y=e,f.z=e,c.multiplyByScale(t,f,n)},c.multiplyByScale=function(t,e,n){var r=e.x,i=e.y,a=e.z;return 1===r&&1===i&&1===a?c.clone(t,n):(n[0]=r*t[0],n[1]=r*t[1],n[2]=r*t[2],n[3]=0,n[4]=i*t[4],n[5]=i*t[5],n[6]=i*t[6],n[7]=0,n[8]=a*t[8],n[9]=a*t[9],n[10]=a*t[10],n[11]=0,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=1,n)},c.multiplyByVector=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=e.w,u=t[0]*r+t[4]*i+t[8]*a+t[12]*o,E=t[1]*r+t[5]*i+t[9]*a+t[13]*o,s=t[2]*r+t[6]*i+t[10]*a+t[14]*o,c=t[3]*r+t[7]*i+t[11]*a+t[15]*o;return n.x=u,n.y=E,n.z=s,n.w=c,n},c.multiplyByPointAsVector=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=t[0]*r+t[4]*i+t[8]*a,u=t[1]*r+t[5]*i+t[9]*a,E=t[2]*r+t[6]*i+t[10]*a;return n.x=o,n.y=u,n.z=E,n},c.multiplyByPoint=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=t[0]*r+t[4]*i+t[8]*a+t[12],u=t[1]*r+t[5]*i+t[9]*a+t[13],E=t[2]*r+t[6]*i+t[10]*a+t[14];return n.x=o,n.y=u,n.z=E,n},c.multiplyByScalar=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n[4]=t[4]*e,n[5]=t[5]*e,n[6]=t[6]*e,n[7]=t[7]*e,n[8]=t[8]*e,n[9]=t[9]*e,n[10]=t[10]*e,n[11]=t[11]*e,n[12]=t[12]*e,n[13]=t[13]*e,n[14]=t[14]*e,n[15]=t[15]*e,n},c.negate=function(t,e){return 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],e},c.transpose=function(t,e){var n=t[1],r=t[2],i=t[3],a=t[6],o=t[7],u=t[11];return e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=r,e[9]=a,e[10]=t[10],e[11]=t[14],e[12]=i,e[13]=o,e[14]=u,e[15]=t[15],e},c.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e[9]=Math.abs(t[9]),e[10]=Math.abs(t[10]),e[11]=Math.abs(t[11]),e[12]=Math.abs(t[12]),e[13]=Math.abs(t[13]),e[14]=Math.abs(t[14]),e[15]=Math.abs(t[15]),e},c.equals=function(t,e){return t===e||r(t)&&r(e)&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[3]===e[3]&&t[7]===e[7]&&t[11]===e[11]&&t[15]===e[15]},c.equalsEpsilon=function(t,e,n){return t===e||r(t)&&r(e)&&Math.abs(t[0]-e[0])<=n&&Math.abs(t[1]-e[1])<=n&&Math.abs(t[2]-e[2])<=n&&Math.abs(t[3]-e[3])<=n&&Math.abs(t[4]-e[4])<=n&&Math.abs(t[5]-e[5])<=n&&Math.abs(t[6]-e[6])<=n&&Math.abs(t[7]-e[7])<=n&&Math.abs(t[8]-e[8])<=n&&Math.abs(t[9]-e[9])<=n&&Math.abs(t[10]-e[10])<=n&&Math.abs(t[11]-e[11])<=n&&Math.abs(t[12]-e[12])<=n&&Math.abs(t[13]-e[13])<=n&&Math.abs(t[14]-e[14])<=n&&Math.abs(t[15]-e[15])<=n},c.getTranslation=function(t,e){return e.x=t[12],e.y=t[13],e.z=t[14],e},c.getRotation=function(t,e){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e};var N=new E,h=new E,d=new e,I=new e(0,0,0,1);return c.inverse=function(t,n){if(E.equalsEpsilon(c.getRotation(t,N),h,u.EPSILON7)&&e.equals(c.getRow(t,3,d),I))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-t[12],n[13]=-t[13],n[14]=-t[14],n[15]=1,n;var r=t[0],i=t[4],a=t[8],o=t[12],_=t[1],T=t[5],R=t[9],l=t[13],A=t[2],f=t[6],m=t[10],S=t[14],O=t[3],M=t[7],y=t[11],p=t[15],C=m*p,U=S*y,L=f*p,F=S*M,P=f*y,w=m*M,x=A*p,g=S*O,v=A*y,D=m*O,B=A*M,z=f*O,G=C*T+F*R+P*l-(U*T+L*R+w*l),b=U*_+x*R+D*l-(C*_+g*R+v*l),X=L*_+g*T+B*l-(F*_+x*T+z*l),V=w*_+v*T+z*R-(P*_+D*T+B*R),H=U*i+L*a+w*o-(C*i+F*a+P*o),q=C*r+g*a+v*o-(U*r+x*a+D*o),W=F*r+x*i+z*o-(L*r+g*i+B*o),Y=P*r+D*i+B*a-(w*r+v*i+z*a);C=a*l,U=o*R,L=i*l,F=o*T,P=i*R,w=a*T,x=r*l,g=o*_,v=r*R,D=a*_,B=r*T,z=i*_;var k=C*M+F*y+P*p-(U*M+L*y+w*p),K=U*O+x*y+D*p-(C*O+g*y+v*p),Z=L*O+g*M+B*p-(F*O+x*M+z*p),j=w*O+v*M+z*y-(P*O+D*M+B*y),Q=L*m+w*S+U*f-(P*S+C*f+F*m),J=v*S+C*A+g*m-(x*m+D*S+U*A),$=x*f+z*S+F*A-(B*S+L*A+g*f),tt=B*m+P*A+D*f-(v*f+z*m+w*A),et=r*G+i*b+a*X+o*V;if(Math.abs(et)<u.EPSILON20)throw new s("matrix is not invertible because its determinate is zero.");return et=1/et,n[0]=G*et,n[1]=b*et,n[2]=X*et,n[3]=V*et,n[4]=H*et,n[5]=q*et,n[6]=W*et,n[7]=Y*et,n[8]=k*et,n[9]=K*et,n[10]=Z*et,n[11]=j*et,n[12]=Q*et,n[13]=J*et,n[14]=$*et,n[15]=tt*et,n},c.inverseTransformation=function(t,e){var n=t[0],r=t[1],i=t[2],a=t[4],o=t[5],u=t[6],E=t[8],s=t[9],c=t[10],_=t[12],T=t[13],R=t[14],l=-n*_-r*T-i*R,A=-a*_-o*T-u*R,f=-E*_-s*T-c*R;return e[0]=n,e[1]=a,e[2]=E,e[3]=0,e[4]=r,e[5]=o,e[6]=s,e[7]=0,e[8]=i,e[9]=u,e[10]=c,e[11]=0,e[12]=l,e[13]=A,e[14]=f,e[15]=1,e},c.IDENTITY=o(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),c.ZERO=o(new c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN0ROW3=3,c.COLUMN1ROW0=4,c.COLUMN1ROW1=5,c.COLUMN1ROW2=6,c.COLUMN1ROW3=7,c.COLUMN2ROW0=8,c.COLUMN2ROW1=9,c.COLUMN2ROW2=10,c.COLUMN2ROW3=11,c.COLUMN3ROW0=12,c.COLUMN3ROW1=13,c.COLUMN3ROW2=14,c.COLUMN3ROW3=15,i(c.prototype,{length:{get:function(){return c.packedLength}}}),c.prototype.clone=function(t){return c.clone(this,t)},c.prototype.equals=function(t){return c.equals(this,t)},c.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]&&t[4]===e[n+4]&&t[5]===e[n+5]&&t[6]===e[n+6]&&t[7]===e[n+7]&&t[8]===e[n+8]&&t[9]===e[n+9]&&t[10]===e[n+10]&&t[11]===e[n+11]&&t[12]===e[n+12]&&t[13]===e[n+13]&&t[14]===e[n+14]&&t[15]===e[n+15]},c.prototype.equalsEpsilon=function(t,e){return c.equalsEpsilon(this,t,e)},c.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]+")"},c}),define("Core/Rectangle",["./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(t,e,n,r,i,a,o,u){"use strict";function E(t,n,r,i){this.west=e(t,0),this.south=e(n,0),this.east=e(r,0),this.north=e(i,0)}r(E.prototype,{width:{get:function(){return E.computeWidth(this)}},height:{get:function(){return E.computeHeight(this)}}}),E.packedLength=4,E.pack=function(t,n,r){return r=e(r,0),n[r++]=t.west,n[r++]=t.south,n[r++]=t.east,n[r]=t.north,n},E.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new E),i.west=t[r++],i.south=t[r++],i.east=t[r++],i.north=t[r],i},E.computeWidth=function(t){var e=t.east,n=t.west;return e<n&&(e+=u.TWO_PI),e-n},E.computeHeight=function(t){return t.north-t.south},E.fromDegrees=function(t,r,i,a,o){return t=u.toRadians(e(t,0)),r=u.toRadians(e(r,0)),i=u.toRadians(e(i,0)),a=u.toRadians(e(a,0)),n(o)?(o.west=t,o.south=r,o.east=i,o.north=a,o):new E(t,r,i,a)},E.fromCartographicArray=function(t,e){for(var r=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=Number.MAX_VALUE,c=-Number.MAX_VALUE,_=0,T=t.length;_<T;_++){var R=t[_];r=Math.min(r,R.longitude),i=Math.max(i,R.longitude),s=Math.min(s,R.latitude),c=Math.max(c,R.latitude);var l=R.longitude>=0?R.longitude:R.longitude+u.TWO_PI;a=Math.min(a,l),o=Math.max(o,l)}return i-r>o-a&&(r=a,i=o,i>u.PI&&(i-=u.TWO_PI),r>u.PI&&(r-=u.TWO_PI)),n(e)?(e.west=r,e.south=s,e.east=i,e.north=c,e):new E(r,s,i,c)},E.fromCartesianArray=function(t,e,r){for(var i=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,s=-Number.MAX_VALUE,c=Number.MAX_VALUE,_=-Number.MAX_VALUE,T=0,R=t.length;T<R;T++){var l=e.cartesianToCartographic(t[T]);i=Math.min(i,l.longitude),a=Math.max(a,l.longitude),c=Math.min(c,l.latitude),_=Math.max(_,l.latitude);var A=l.longitude>=0?l.longitude:l.longitude+u.TWO_PI;o=Math.min(o,A),s=Math.max(s,A)}return a-i>s-o&&(i=o,a=s,a>u.PI&&(a-=u.TWO_PI),i>u.PI&&(i-=u.TWO_PI)),n(r)?(r.west=i,r.south=c,r.east=a,r.north=_,r):new E(i,c,a,_)},E.clone=function(t,e){if(n(t))return n(e)?(e.west=t.west,e.south=t.south,e.east=t.east,e.north=t.north,e):new E(t.west,t.south,t.east,t.north)},E.prototype.clone=function(t){return E.clone(this,t)},E.prototype.equals=function(t){return E.equals(this,t)},E.equals=function(t,e){return t===e||n(t)&&n(e)&&t.west===e.west&&t.south===e.south&&t.east===e.east&&t.north===e.north},E.prototype.equalsEpsilon=function(t,e){return n(t)&&Math.abs(this.west-t.west)<=e&&Math.abs(this.south-t.south)<=e&&Math.abs(this.east-t.east)<=e&&Math.abs(this.north-t.north)<=e},E.validate=function(t){},E.southwest=function(e,r){return n(r)?(r.longitude=e.west,r.latitude=e.south,r.height=0,r):new t(e.west,e.south)},E.northwest=function(e,r){return n(r)?(r.longitude=e.west,r.latitude=e.north,r.height=0,r):new t(e.west,e.north)},E.northeast=function(e,r){return n(r)?(r.longitude=e.east,r.latitude=e.north,r.height=0,r):new t(e.east,e.north)},E.southeast=function(e,r){return n(r)?(r.longitude=e.east,r.latitude=e.south,r.height=0,r):new t(e.east,e.south)},E.center=function(e,r){var i=e.east,a=e.west;i<a&&(i+=u.TWO_PI);var o=u.negativePiToPi(.5*(a+i)),E=.5*(e.south+e.north);return n(r)?(r.longitude=o,r.latitude=E,r.height=0,r):new t(o,E)},E.intersection=function(t,e,r){var i=t.east,a=t.west,o=e.east,s=e.west;i<a&&o>0?i+=u.TWO_PI:o<s&&i>0&&(o+=u.TWO_PI),i<a&&s<0?s+=u.TWO_PI:o<s&&a<0&&(a+=u.TWO_PI);var c=u.negativePiToPi(Math.max(a,s)),_=u.negativePiToPi(Math.min(i,o));if(!((t.west<t.east||e.west<e.east)&&_<=c)){var T=Math.max(t.south,e.south),R=Math.min(t.north,e.north);if(!(T>=R))return n(r)?(r.west=c,r.south=T,r.east=_,r.north=R,r):new E(c,T,_,R)}},E.simpleIntersection=function(t,e,r){var i=Math.max(t.west,e.west),a=Math.max(t.south,e.south),o=Math.min(t.east,e.east),u=Math.min(t.north,e.north);if(!(a>=u||i>=o))return n(r)?(r.west=i,r.south=a,r.east=o,r.north=u,r):new E(i,a,o,u)},E.union=function(t,e,r){n(r)||(r=new E);var i=t.east,a=t.west,o=e.east,s=e.west;i<a&&o>0?i+=u.TWO_PI:o<s&&i>0&&(o+=u.TWO_PI),i<a&&s<0?s+=u.TWO_PI:o<s&&a<0&&(a+=u.TWO_PI);var c=u.convertLongitudeRange(Math.min(a,s)),_=u.convertLongitudeRange(Math.max(i,o));return r.west=c,r.south=Math.min(t.south,e.south),r.east=_,r.north=Math.max(t.north,e.north),r},E.expand=function(t,e,r){return n(r)||(r=new E),r.west=Math.min(t.west,e.longitude),r.south=Math.min(t.south,e.latitude),r.east=Math.max(t.east,e.longitude),r.north=Math.max(t.north,e.latitude),r},E.contains=function(t,e){var n=e.longitude,r=e.latitude,i=t.west,a=t.east;return a<i&&(a+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>i||u.equalsEpsilon(n,i,u.EPSILON14))&&(n<a||u.equalsEpsilon(n,a,u.EPSILON14))&&r>=t.south&&r<=t.north};var s=new t;return E.subsample=function(t,r,i,o){r=e(r,a.WGS84),i=e(i,0),n(o)||(o=[]);var c=0,_=t.north,T=t.south,R=t.east,l=t.west,A=s;A.height=i,A.longitude=l,A.latitude=_,o[c]=r.cartographicToCartesian(A,o[c]),c++,A.longitude=R,o[c]=r.cartographicToCartesian(A,o[c]),c++,A.latitude=T,o[c]=r.cartographicToCartesian(A,o[c]),c++,A.longitude=l,o[c]=r.cartographicToCartesian(A,o[c]),c++,_<0?A.latitude=_:T>0?A.latitude=T:A.latitude=0;for(var f=1;f<8;++f)A.longitude=-Math.PI+f*u.PI_OVER_TWO,E.contains(t,A)&&(o[c]=r.cartographicToCartesian(A,o[c]),c++);return 0===A.latitude&&(A.longitude=l,o[c]=r.cartographicToCartesian(A,o[c]),c++,A.longitude=R,o[c]=r.cartographicToCartesian(A,o[c]),c++),o.length=c,o},E.MAX_VALUE=o(new E(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),E}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(t,e,n,r,i,a,o,u,E,s,c,_){"use strict";function T(e,r){this.center=t.clone(n(e,t.ZERO)),this.radius=n(r,0)}var R=new t,l=new t,A=new t,f=new t,N=new t,h=new t,d=new t,I=new t,m=new t,S=new t,O=new t,M=new t;T.fromPoints=function(e,n){if(r(n)||(n=new T),!r(e)||0===e.length)return n.center=t.clone(t.ZERO,n.center),n.radius=0,n;for(var i=t.clone(e[0],d),a=t.clone(i,R),o=t.clone(i,l),u=t.clone(i,A),E=t.clone(i,f),s=t.clone(i,N),c=t.clone(i,h),_=e.length,y=1;y<_;y++){t.clone(e[y],i);var p=i.x,C=i.y,U=i.z;p<a.x&&t.clone(i,a),p>E.x&&t.clone(i,E),C<o.y&&t.clone(i,o),C>s.y&&t.clone(i,s),U<u.z&&t.clone(i,u),U>c.z&&t.clone(i,c)}var L=t.magnitudeSquared(t.subtract(E,a,I)),F=t.magnitudeSquared(t.subtract(s,o,I)),P=t.magnitudeSquared(t.subtract(c,u,I)),w=a,x=E,g=L;F>g&&(g=F,w=o,x=s),P>g&&(g=P,w=u,x=c);var v=m;v.x=.5*(w.x+x.x),v.y=.5*(w.y+x.y),v.z=.5*(w.z+x.z);var D=t.magnitudeSquared(t.subtract(x,v,I)),B=Math.sqrt(D),z=S;z.x=a.x,z.y=o.y,z.z=u.z;var G=O;G.x=E.x,G.y=s.y,G.z=c.z;var b=t.multiplyByScalar(t.add(z,G,I),.5,M),X=0;for(y=0;y<_;y++){t.clone(e[y],i);var V=t.magnitude(t.subtract(i,b,I));V>X&&(X=V);var H=t.magnitudeSquared(t.subtract(i,v,I));if(H>D){var q=Math.sqrt(H);B=.5*(B+q),D=B*B;var W=q-B;v.x=(B*v.x+W*i.x)/q,v.y=(B*v.y+W*i.y)/q,v.z=(B*v.z+W*i.z)/q}}return B<X?(t.clone(v,n.center),n.radius=B):(t.clone(b,n.center),n.radius=X),n};var y=new o,p=new t,C=new t,U=new e,L=new e;T.fromRectangle2D=function(t,e,n){return T.fromRectangleWithHeights2D(t,e,0,0,n)},T.fromRectangleWithHeights2D=function(e,i,a,o,u){if(r(u)||(u=new T),!r(e))return u.center=t.clone(t.ZERO,u.center),u.radius=0,u;i=n(i,y),_.southwest(e,U),U.height=a,_.northeast(e,L),L.height=o;var E=i.project(U,p),s=i.project(L,C),c=s.x-E.x,R=s.y-E.y,l=s.z-E.z;u.radius=.5*Math.sqrt(c*c+R*R+l*l);var A=u.center;return A.x=E.x+.5*c,A.y=E.y+.5*R,A.z=E.z+.5*l,u};var F=[];T.fromRectangle3D=function(t,e,i,o){e=n(e,a.WGS84),i=n(i,0);var u;return r(t)&&(u=_.subsample(t,e,i,F)),T.fromPoints(u,o)},T.fromVertices=function(e,i,a,o){if(r(o)||(o=new T),!r(e)||0===e.length)return o.center=t.clone(t.ZERO,o.center),o.radius=0,o;i=n(i,t.ZERO),a=n(a,3);var u=d;u.x=e[0]+i.x,u.y=e[1]+i.y,u.z=e[2]+i.z;for(var E=t.clone(u,R),s=t.clone(u,l),c=t.clone(u,A),_=t.clone(u,f),y=t.clone(u,N),p=t.clone(u,h),C=e.length,U=0;U<C;U+=a){var L=e[U]+i.x,F=e[U+1]+i.y,P=e[U+2]+i.z;u.x=L,u.y=F,u.z=P,L<E.x&&t.clone(u,E),L>_.x&&t.clone(u,_),F<s.y&&t.clone(u,s),F>y.y&&t.clone(u,y),P<c.z&&t.clone(u,c),P>p.z&&t.clone(u,p)}var w=t.magnitudeSquared(t.subtract(_,E,I)),x=t.magnitudeSquared(t.subtract(y,s,I)),g=t.magnitudeSquared(t.subtract(p,c,I)),v=E,D=_,B=w;x>B&&(B=x,v=s,D=y),g>B&&(B=g,v=c,D=p);var z=m;z.x=.5*(v.x+D.x),z.y=.5*(v.y+D.y),z.z=.5*(v.z+D.z);var G=t.magnitudeSquared(t.subtract(D,z,I)),b=Math.sqrt(G),X=S;X.x=E.x,X.y=s.y,X.z=c.z;var V=O;V.x=_.x,V.y=y.y,V.z=p.z;var H=t.multiplyByScalar(t.add(X,V,I),.5,M),q=0;for(U=0;U<C;U+=a){u.x=e[U]+i.x,u.y=e[U+1]+i.y,u.z=e[U+2]+i.z;var W=t.magnitude(t.subtract(u,H,I));W>q&&(q=W);var Y=t.magnitudeSquared(t.subtract(u,z,I));if(Y>G){var k=Math.sqrt(Y);b=.5*(b+k),G=b*b;var K=k-b;z.x=(b*z.x+K*u.x)/k,z.y=(b*z.y+K*u.y)/k,z.z=(b*z.z+K*u.z)/k}}return b<q?(t.clone(z,o.center),o.radius=b):(t.clone(H,o.center),o.radius=q),o},T.fromEncodedCartesianVertices=function(e,n,i){if(r(i)||(i=new T),!r(e)||!r(n)||e.length!==n.length||0===e.length)return i.center=t.clone(t.ZERO,i.center),i.radius=0,i;var a=d;a.x=e[0]+n[0],a.y=e[1]+n[1],a.z=e[2]+n[2];for(var o=t.clone(a,R),u=t.clone(a,l),E=t.clone(a,A),s=t.clone(a,f),c=t.clone(a,N),_=t.clone(a,h),y=e.length,p=0;p<y;p+=3){var C=e[p]+n[p],U=e[p+1]+n[p+1],L=e[p+2]+n[p+2];a.x=C,a.y=U,a.z=L,C<o.x&&t.clone(a,o),C>s.x&&t.clone(a,s),U<u.y&&t.clone(a,u),U>c.y&&t.clone(a,c),L<E.z&&t.clone(a,E),L>_.z&&t.clone(a,_)}var F=t.magnitudeSquared(t.subtract(s,o,I)),P=t.magnitudeSquared(t.subtract(c,u,I)),w=t.magnitudeSquared(t.subtract(_,E,I)),x=o,g=s,v=F;P>v&&(v=P,x=u,g=c),w>v&&(v=w,x=E,g=_);var D=m;D.x=.5*(x.x+g.x),D.y=.5*(x.y+g.y),D.z=.5*(x.z+g.z);var B=t.magnitudeSquared(t.subtract(g,D,I)),z=Math.sqrt(B),G=S;G.x=o.x,G.y=u.y,G.z=E.z;var b=O;b.x=s.x,b.y=c.y,b.z=_.z;var X=t.multiplyByScalar(t.add(G,b,I),.5,M),V=0;for(p=0;p<y;p+=3){a.x=e[p]+n[p],a.y=e[p+1]+n[p+1],a.z=e[p+2]+n[p+2];var H=t.magnitude(t.subtract(a,X,I));H>V&&(V=H);var q=t.magnitudeSquared(t.subtract(a,D,I));if(q>B){var W=Math.sqrt(q);z=.5*(z+W),B=z*z;var Y=W-z;D.x=(z*D.x+Y*a.x)/W,D.y=(z*D.y+Y*a.y)/W,D.z=(z*D.z+Y*a.z)/W}}return z<V?(t.clone(D,i.center),i.radius=z):(t.clone(X,i.center),i.radius=V),i},T.fromCornerPoints=function(e,n,i){r(i)||(i=new T);var a=i.center;return t.add(e,n,a),t.multiplyByScalar(a,.5,a),i.radius=t.distance(a,n),i},T.fromEllipsoid=function(e,n){return r(n)||(n=new T),t.clone(t.ZERO,n.center),n.radius=e.maximumRadius,n};var P=new t;T.fromBoundingSpheres=function(e,n){if(r(n)||(n=new T),!r(e)||0===e.length)return n.center=t.clone(t.ZERO,n.center),n.radius=0,n;var i=e.length;if(1===i)return T.clone(e[0],n);if(2===i)return T.union(e[0],e[1],n);for(var a=[],o=0;o<i;o++)a.push(e[o].center);n=T.fromPoints(a,n);var u=n.center,E=n.radius;for(o=0;o<i;o++){var s=e[o];E=Math.max(E,t.distance(u,s.center,P)+s.radius)}return n.radius=E,n};var w=new t,x=new t,g=new t;T.fromOrientedBoundingBox=function(e,n){r(n)||(n=new T);var i=e.halfAxes,a=s.getColumn(i,0,w),o=s.getColumn(i,1,x),u=s.getColumn(i,2,g),E=t.magnitude(a),c=t.magnitude(o),_=t.magnitude(u);return n.center=t.clone(e.center,n.center),n.radius=Math.max(E,c,_),n},T.clone=function(e,n){if(r(e))return r(n)?(n.center=t.clone(e.center,n.center),n.radius=e.radius,n):new T(e.center,e.radius)},T.packedLength=4,T.pack=function(t,e,r){r=n(r,0);var i=t.center;return e[r++]=i.x,e[r++]=i.y,e[r++]=i.z,e[r]=t.radius,e},T.unpack=function(t,e,i){e=n(e,0),r(i)||(i=new T);var a=i.center;return a.x=t[e++],a.y=t[e++],a.z=t[e++],i.radius=t[e],i};var v=new t,D=new t;T.union=function(e,n,i){r(i)||(i=new T);var a=e.center,o=e.radius,u=n.center,E=n.radius,s=t.subtract(u,a,v),c=t.magnitude(s);if(o>=c+E)return e.clone(i),i;if(E>=c+o)return n.clone(i),i;var _=.5*(o+c+E),R=t.multiplyByScalar(s,(-o+_)/c,D);return t.add(R,a,R),t.clone(R,i.center),i.radius=_,i};var B=new t;T.expand=function(e,n,r){r=T.clone(e,r);var i=t.magnitude(t.subtract(n,r.center,B));return i>r.radius&&(r.radius=i),r},T.intersectPlane=function(e,n){var r=e.center,i=e.radius,a=n.normal,o=t.dot(a,r)+n.distance;return o<-i?u.OUTSIDE:o<i?u.INTERSECTING:u.INSIDE},T.transform=function(t,e,n){return r(n)||(n=new T),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=c.getMaximumScale(e)*t.radius,n};var z=new t;T.distanceSquaredTo=function(e,n){var r=t.subtract(e.center,n,z);return t.magnitudeSquared(r)-e.radius*e.radius},T.transformWithoutScale=function(t,e,n){return r(n)||(n=new T),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=t.radius,n};var G=new t;T.computePlaneDistances=function(e,n,i,a){r(a)||(a=new E);var o=t.subtract(e.center,n,G),u=t.dot(i,o);return a.start=u-e.radius,a.stop=u+e.radius,a};for(var b=new t,X=new t,V=new t,H=new t,q=new t,W=new e,Y=new Array(8),k=0;k<8;++k)Y[k]=new t;var K=new o;return T.projectTo2D=function(e,r,i){r=n(r,K);var a=r.ellipsoid,o=e.center,u=e.radius,E=a.geodeticSurfaceNormal(o,b),s=t.cross(t.UNIT_Z,E,X);t.normalize(s,s);var c=t.cross(E,s,V);t.normalize(c,c),t.multiplyByScalar(E,u,E),t.multiplyByScalar(c,u,c),t.multiplyByScalar(s,u,s);var _=t.negate(c,q),R=t.negate(s,H),l=Y,A=l[0];t.add(E,c,A),t.add(A,s,A),A=l[1],t.add(E,c,A),t.add(A,R,A),A=l[2],t.add(E,_,A),t.add(A,R,A),A=l[3],t.add(E,_,A),t.add(A,s,A),t.negate(E,E),A=l[4],t.add(E,c,A),t.add(A,s,A),A=l[5],t.add(E,c,A),t.add(A,R,A),A=l[6],t.add(E,_,A),t.add(A,R,A),A=l[7],t.add(E,_,A),t.add(A,s,A);for(var f=l.length,N=0;N<f;++N){var h=l[N];t.add(o,h,h);var d=a.cartesianToCartographic(h,W);r.project(d,h)}i=T.fromPoints(l,i),o=i.center;var I=o.x,m=o.y,S=o.z;return o.x=S,o.y=I,o.z=m,i},T.isOccluded=function(t,e){return!e.isBoundingSphereVisible(t)},T.equals=function(e,n){return e===n||r(e)&&r(n)&&t.equals(e.center,n.center)&&e.radius===n.radius},T.prototype.intersectPlane=function(t){return T.intersectPlane(this,t)},T.prototype.distanceSquaredTo=function(t){return T.distanceSquaredTo(this,t)},T.prototype.computePlaneDistances=function(t,e,n){return T.computePlaneDistances(this,t,e,n)},T.prototype.isOccluded=function(t){return T.isOccluded(this,t)},T.prototype.equals=function(t){return T.equals(this,t)},T.prototype.clone=function(t){return T.clone(this,t)},T}),define("Core/Fullscreen",["./defined","./defineProperties"],function(t,e){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},i={};return e(i,{element:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(i.supportsFullscreen())return null!==i.element}}}),i.supportsFullscreen=function(){if(t(n))return n;n=!1;var e=document.body;if("function"==typeof e.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var i,a=["webkit","moz","o","ms","khtml"],o=0,u=a.length;o<u;++o){var E=a[o];i=E+"RequestFullscreen","function"==typeof e[i]?(r.requestFullscreen=i,n=!0):(i=E+"RequestFullScreen","function"==typeof e[i]&&(r.requestFullscreen=i,n=!0)),i=E+"ExitFullscreen","function"==typeof document[i]?r.exitFullscreen=i:(i=E+"CancelFullScreen","function"==typeof document[i]&&(r.exitFullscreen=i)),i=E+"FullscreenEnabled",void 0!==document[i]?r.fullscreenEnabled=i:(i=E+"FullScreenEnabled",void 0!==document[i]&&(r.fullscreenEnabled=i)),i=E+"FullscreenElement",void 0!==document[i]?r.fullscreenElement=i:(i=E+"FullScreenElement",void 0!==document[i]&&(r.fullscreenElement=i)),i=E+"fullscreenchange",void 0!==document["on"+i]&&("ms"===E&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=E+"fullscreenerror",void 0!==document["on"+i]&&("ms"===E&&(i="MSFullscreenError"),r.fullscreenerror=i)}return n},i.requestFullscreen=function(t,e){i.supportsFullscreen()&&t[r.requestFullscreen]({vrDisplay:e})},i.exitFullscreen=function(){i.supportsFullscreen()&&document[r.exitFullscreen]()},i}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(t,e,n){"use strict";function r(t){for(var e=t.split("."),n=0,r=e.length;n<r;++n)e[n]=parseInt(e[n],10);return e}function i(){if(!e(m)&&(m=!1,!T())){var t=/ Chrome\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(m=!0,S=r(t[1]))}return m}function a(){return i()&&S}function o(){if(!e(O)&&(O=!1,!i()&&!T()&&/ Safari\/[\.0-9]+/.test(I.userAgent))){var t=/ Version\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(O=!0,M=r(t[1]))}return O}function u(){return o()&&M}function E(){if(!e(y)){y=!1;var t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(I.userAgent);null!==t&&(y=!0,p=r(t[1]),p.isNightly=!!t[2])}return y}function s(){return E()&&p}function c(){if(!e(C)){C=!1;var t;"Microsoft Internet Explorer"===I.appName?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==t&&(C=!0,U=r(t[1]))):"Netscape"===I.appName&&(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==t&&(C=!0,U=r(t[1])))}return C}function _(){return c()&&U}function T(){if(!e(L)){L=!1;var t=/ Edge\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(L=!0,F=r(t[1]))}return L}function R(){return T()&&F}function l(){if(!e(P)){P=!1;var t=/Firefox\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(P=!0,w=r(t[1]))}return P}function A(){return e(x)||(x=/Windows/i.test(I.appVersion)),x}function f(){return l()&&w}function N(){return e(g)||(g="undefined"!=typeof PointerEvent&&(!e(I.pointerEnabled)||I.pointerEnabled)),g}function h(){ -if(!e(D)){var t=document.createElement("canvas");t.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=t.style.imageRendering;D=e(n)&&""!==n,D&&(v=n)}return D}function d(){return h()?v:void 0}var I;I="undefined"!=typeof navigator?navigator:{};var m,S,O,M,y,p,C,U,L,F,P,w,x,g,v,D,B={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:E,webkitVersion:s,isInternetExplorer:c,internetExplorerVersion:_,isEdge:T,edgeVersion:R,isFirefox:l,firefoxVersion:f,isWindows:A,hardwareConcurrency:t(I.hardwareConcurrency,3),supportsPointerEvents:N,supportsImageRenderingPixelated:h,imageRenderingValue:d};return B.supportsFullscreen=function(){return n.supportsFullscreen()},B.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},B.supportsWebWorkers=function(){return"undefined"!=typeof Worker},B}),define("Core/WebGLConstants",["./freezeObject"],function(t){"use strict";var e={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503};return t(e)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(t,e,n,r,i,a){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:a.BYTE,UNSIGNED_BYTE:a.UNSIGNED_BYTE,SHORT:a.SHORT,UNSIGNED_SHORT:a.UNSIGNED_SHORT,INT:a.INT,UNSIGNED_INT:a.UNSIGNED_INT,FLOAT:a.FLOAT,DOUBLE:a.DOUBLE};return o.getSizeInBytes=function(t){switch(t){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.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(t){return t instanceof Int8Array?o.BYTE:t instanceof Uint8Array?o.UNSIGNED_BYTE:t instanceof Int16Array?o.SHORT:t instanceof Uint16Array?o.UNSIGNED_SHORT:t instanceof Int32Array?o.INT:t instanceof Uint32Array?o.UNSIGNED_INT:t instanceof Float32Array?o.FLOAT:t instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(t){return e(t)&&(t===o.BYTE||t===o.UNSIGNED_BYTE||t===o.SHORT||t===o.UNSIGNED_SHORT||t===o.INT||t===o.UNSIGNED_INT||t===o.FLOAT||t===o.DOUBLE)},o.createTypedArray=function(t,e){switch(t){case o.BYTE:return new Int8Array(e);case o.UNSIGNED_BYTE:return new Uint8Array(e);case o.SHORT:return new Int16Array(e);case o.UNSIGNED_SHORT:return new Uint16Array(e);case o.INT:return new Int32Array(e);case o.UNSIGNED_INT:return new Uint32Array(e);case o.FLOAT:return new Float32Array(e);case o.DOUBLE:return new Float64Array(e)}},o.createArrayBufferView=function(e,n,r,i){switch(r=t(r,0),i=t(i,(n.byteLength-r)/o.getSizeInBytes(e)),e){case o.BYTE:return new Int8Array(n,r,i);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,i);case o.SHORT:return new Int16Array(n,r,i);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,i);case o.INT:return new Int32Array(n,r,i);case o.UNSIGNED_INT:return new Uint32Array(n,r,i);case o.FLOAT:return new Float32Array(n,r,i);case o.DOUBLE:return new Float64Array(n,r,i)}},o.fromName=function(t){switch(t){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},i(o)}),define("Core/GeometryType",["./freezeObject"],function(t){"use strict";var e={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return t(e)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(t,e){"use strict";var n={POINTS:e.POINTS,LINES:e.LINES,LINE_LOOP:e.LINE_LOOP,LINE_STRIP:e.LINE_STRIP,TRIANGLES:e.TRIANGLES,TRIANGLE_STRIP:e.TRIANGLE_STRIP,TRIANGLE_FAN:e.TRIANGLE_FAN,validate:function(t){return t===n.POINTS||t===n.LINES||t===n.LINE_LOOP||t===n.LINE_STRIP||t===n.TRIANGLES||t===n.TRIANGLE_STRIP||t===n.TRIANGLE_FAN}};return t(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(t,e,n,r,i){"use strict";function a(e){e=t(e,t.EMPTY_OBJECT),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=t(e.primitiveType,i.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=t(e.geometryType,r.NONE),this.boundingSphereCV=e.boundingSphereCV}return a.computeNumberOfVertices=function(t){var n=-1;for(var r in t.attributes)if(t.attributes.hasOwnProperty(r)&&e(t.attributes[r])&&e(t.attributes[r].values)){var i=t.attributes[r],a=i.values.length/i.componentsPerAttribute;n=a}return n},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(t,e,n){"use strict";function r(e){e=t(e,t.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=t(e.normalize,!1),this.values=e.values}return r}),define("Core/GeometryAttributes",["./defaultValue"],function(t){"use strict";function e(e){e=t(e,t.EMPTY_OBJECT),this.position=e.position,this.normal=e.normal,this.st=e.st,this.binormal=e.binormal,this.tangent=e.tangent,this.color=e.color}return e}),define("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(t,e,n,r){"use strict";function i(e){e=t(e,t.EMPTY_OBJECT),this.position=t(e.position,!1),this.normal=t(e.normal,!1),this.st=t(e.st,!1),this.binormal=t(e.binormal,!1),this.tangent=t(e.tangent,!1),this.color=t(e.color,!1)}return i.POSITION_ONLY=r(new i({position:!0})),i.POSITION_AND_NORMAL=r(new i({position:!0,normal:!0})),i.POSITION_NORMAL_AND_ST=r(new i({position:!0,normal:!0,st:!0})),i.POSITION_AND_ST=r(new i({position:!0,st:!0})),i.POSITION_AND_COLOR=r(new i({position:!0,color:!0})),i.ALL=r(new i({position:!0,normal:!0,st:!0,binormal:!0,tangent:!0})),i.DEFAULT=i.POSITION_NORMAL_AND_ST,i.packedLength=6,i.pack=function(e,n,r){return r=t(r,0),n[r++]=e.position?1:0,n[r++]=e.normal?1:0,n[r++]=e.st?1:0,n[r++]=e.binormal?1:0,n[r++]=e.tangent?1:0,n[r++]=e.color?1:0,n},i.unpack=function(n,r,a){return r=t(r,0),e(a)||(a=new i),a.position=1===n[r++],a.normal=1===n[r++],a.st=1===n[r++],a.binormal=1===n[r++],a.tangent=1===n[r++],a.color=1===n[r++],a},i.clone=function(t,n){if(e(t))return e(n)||(n=new i),n.position=t.position,n.normal=t.normal,n.st=t.st,n.binormal=t.binormal,n.tangent=t.tangent,n.color=t.color,n},i}),define("Core/BoxGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./PrimitiveType","./VertexFormat"],function(t,e,n,r,i,a,o,u,E,s,c){"use strict";function _(t){t=r(t,r.EMPTY_OBJECT);var n=t.minimum,i=t.maximum,a=r(t.vertexFormat,c.DEFAULT);this._minimum=e.clone(n),this._maximum=e.clone(i),this._vertexFormat=a,this._workerName="createBoxGeometry"}var T=new e;_.fromDimensions=function(t){t=r(t,r.EMPTY_OBJECT);var n=t.dimensions,i=e.multiplyByScalar(n,.5,new e);return new _({minimum:e.negate(i,new e),maximum:i,vertexFormat:t.vertexFormat})},_.fromAxisAlignedBoundingBox=function(t){return new _({minimum:t.minimum,maximum:t.maximum})},_.packedLength=2*e.packedLength+c.packedLength,_.pack=function(t,n,i){return i=r(i,0),e.pack(t._minimum,n,i),e.pack(t._maximum,n,i+e.packedLength),c.pack(t._vertexFormat,n,i+2*e.packedLength),n};var R=new e,l=new e,A=new c,f={minimum:R,maximum:l,vertexFormat:A};return _.unpack=function(t,n,a){n=r(n,0);var o=e.unpack(t,n,R),u=e.unpack(t,n+e.packedLength,l),E=c.unpack(t,n+2*e.packedLength,A);return i(a)?(a._minimum=e.clone(o,a._minimum),a._maximum=e.clone(u,a._maximum),a._vertexFormat=c.clone(E,a._vertexFormat),a):new _(f)},_.createGeometry=function(r){var i=r._minimum,a=r._maximum,c=r._vertexFormat;if(!e.equals(i,a)){var _,R,l=new E;if(c.position&&(c.st||c.normal||c.binormal||c.tangent)){if(c.position&&(R=new Float64Array(72),R[0]=i.x,R[1]=i.y,R[2]=a.z,R[3]=a.x,R[4]=i.y,R[5]=a.z,R[6]=a.x,R[7]=a.y,R[8]=a.z,R[9]=i.x,R[10]=a.y,R[11]=a.z,R[12]=i.x,R[13]=i.y,R[14]=i.z,R[15]=a.x,R[16]=i.y,R[17]=i.z,R[18]=a.x,R[19]=a.y,R[20]=i.z,R[21]=i.x,R[22]=a.y,R[23]=i.z,R[24]=a.x,R[25]=i.y,R[26]=i.z,R[27]=a.x,R[28]=a.y,R[29]=i.z,R[30]=a.x,R[31]=a.y,R[32]=a.z,R[33]=a.x,R[34]=i.y,R[35]=a.z,R[36]=i.x,R[37]=i.y,R[38]=i.z,R[39]=i.x,R[40]=a.y,R[41]=i.z,R[42]=i.x,R[43]=a.y,R[44]=a.z,R[45]=i.x,R[46]=i.y,R[47]=a.z,R[48]=i.x,R[49]=a.y,R[50]=i.z,R[51]=a.x,R[52]=a.y,R[53]=i.z,R[54]=a.x,R[55]=a.y,R[56]=a.z,R[57]=i.x,R[58]=a.y,R[59]=a.z,R[60]=i.x,R[61]=i.y,R[62]=i.z,R[63]=a.x,R[64]=i.y,R[65]=i.z,R[66]=a.x,R[67]=i.y,R[68]=a.z,R[69]=i.x,R[70]=i.y,R[71]=a.z,l.position=new u({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:R})),c.normal){var A=new Float32Array(72);A[0]=0,A[1]=0,A[2]=1,A[3]=0,A[4]=0,A[5]=1,A[6]=0,A[7]=0,A[8]=1,A[9]=0,A[10]=0,A[11]=1,A[12]=0,A[13]=0,A[14]=-1,A[15]=0,A[16]=0,A[17]=-1,A[18]=0,A[19]=0,A[20]=-1,A[21]=0,A[22]=0,A[23]=-1,A[24]=1,A[25]=0,A[26]=0,A[27]=1,A[28]=0,A[29]=0,A[30]=1,A[31]=0,A[32]=0,A[33]=1,A[34]=0,A[35]=0,A[36]=-1,A[37]=0,A[38]=0,A[39]=-1,A[40]=0,A[41]=0,A[42]=-1,A[43]=0,A[44]=0,A[45]=-1,A[46]=0,A[47]=0,A[48]=0,A[49]=1,A[50]=0,A[51]=0,A[52]=1,A[53]=0,A[54]=0,A[55]=1,A[56]=0,A[57]=0,A[58]=1,A[59]=0,A[60]=0,A[61]=-1,A[62]=0,A[63]=0,A[64]=-1,A[65]=0,A[66]=0,A[67]=-1,A[68]=0,A[69]=0,A[70]=-1,A[71]=0,l.normal=new u({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:A})}if(c.st){var f=new Float32Array(48);f[0]=0,f[1]=0,f[2]=1,f[3]=0,f[4]=1,f[5]=1,f[6]=0,f[7]=1,f[8]=1,f[9]=0,f[10]=0,f[11]=0,f[12]=0,f[13]=1,f[14]=1,f[15]=1,f[16]=0,f[17]=0,f[18]=1,f[19]=0,f[20]=1,f[21]=1,f[22]=0,f[23]=1,f[24]=1,f[25]=0,f[26]=0,f[27]=0,f[28]=0,f[29]=1,f[30]=1,f[31]=1,f[32]=1,f[33]=0,f[34]=0,f[35]=0,f[36]=0,f[37]=1,f[38]=1,f[39]=1,f[40]=0,f[41]=0,f[42]=1,f[43]=0,f[44]=1,f[45]=1,f[46]=0,f[47]=1,l.st=new u({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:f})}if(c.tangent){var N=new Float32Array(72);N[0]=1,N[1]=0,N[2]=0,N[3]=1,N[4]=0,N[5]=0,N[6]=1,N[7]=0,N[8]=0,N[9]=1,N[10]=0,N[11]=0,N[12]=-1,N[13]=0,N[14]=0,N[15]=-1,N[16]=0,N[17]=0,N[18]=-1,N[19]=0,N[20]=0,N[21]=-1,N[22]=0,N[23]=0,N[24]=0,N[25]=1,N[26]=0,N[27]=0,N[28]=1,N[29]=0,N[30]=0,N[31]=1,N[32]=0,N[33]=0,N[34]=1,N[35]=0,N[36]=0,N[37]=-1,N[38]=0,N[39]=0,N[40]=-1,N[41]=0,N[42]=0,N[43]=-1,N[44]=0,N[45]=0,N[46]=-1,N[47]=0,N[48]=-1,N[49]=0,N[50]=0,N[51]=-1,N[52]=0,N[53]=0,N[54]=-1,N[55]=0,N[56]=0,N[57]=-1,N[58]=0,N[59]=0,N[60]=1,N[61]=0,N[62]=0,N[63]=1,N[64]=0,N[65]=0,N[66]=1,N[67]=0,N[68]=0,N[69]=1,N[70]=0,N[71]=0,l.tangent=new u({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:N})}if(c.binormal){var h=new Float32Array(72);h[0]=0,h[1]=1,h[2]=0,h[3]=0,h[4]=1,h[5]=0,h[6]=0,h[7]=1,h[8]=0,h[9]=0,h[10]=1,h[11]=0,h[12]=0,h[13]=1,h[14]=0,h[15]=0,h[16]=1,h[17]=0,h[18]=0,h[19]=1,h[20]=0,h[21]=0,h[22]=1,h[23]=0,h[24]=0,h[25]=0,h[26]=1,h[27]=0,h[28]=0,h[29]=1,h[30]=0,h[31]=0,h[32]=1,h[33]=0,h[34]=0,h[35]=1,h[36]=0,h[37]=0,h[38]=1,h[39]=0,h[40]=0,h[41]=1,h[42]=0,h[43]=0,h[44]=1,h[45]=0,h[46]=0,h[47]=1,h[48]=0,h[49]=0,h[50]=1,h[51]=0,h[52]=0,h[53]=1,h[54]=0,h[55]=0,h[56]=1,h[57]=0,h[58]=0,h[59]=1,h[60]=0,h[61]=0,h[62]=1,h[63]=0,h[64]=0,h[65]=1,h[66]=0,h[67]=0,h[68]=1,h[69]=0,h[70]=0,h[71]=1,l.binormal=new u({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:h})}_=new Uint16Array(36),_[0]=0,_[1]=1,_[2]=2,_[3]=0,_[4]=2,_[5]=3,_[6]=6,_[7]=5,_[8]=4,_[9]=7,_[10]=6,_[11]=4,_[12]=8,_[13]=9,_[14]=10,_[15]=8,_[16]=10,_[17]=11,_[18]=14,_[19]=13,_[20]=12,_[21]=15,_[22]=14,_[23]=12,_[24]=18,_[25]=17,_[26]=16,_[27]=19,_[28]=18,_[29]=16,_[30]=20,_[31]=21,_[32]=22,_[33]=20,_[34]=22,_[35]=23}else R=new Float64Array(24),R[0]=i.x,R[1]=i.y,R[2]=i.z,R[3]=a.x,R[4]=i.y,R[5]=i.z,R[6]=a.x,R[7]=a.y,R[8]=i.z,R[9]=i.x,R[10]=a.y,R[11]=i.z,R[12]=i.x,R[13]=i.y,R[14]=a.z,R[15]=a.x,R[16]=i.y,R[17]=a.z,R[18]=a.x,R[19]=a.y,R[20]=a.z,R[21]=i.x,R[22]=a.y,R[23]=a.z,l.position=new u({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:R}),_=new Uint16Array(36),_[0]=4,_[1]=5,_[2]=6,_[3]=4,_[4]=6,_[5]=7,_[6]=1,_[7]=0,_[8]=3,_[9]=1,_[10]=3,_[11]=2,_[12]=1,_[13]=6,_[14]=5,_[15]=1,_[16]=2,_[17]=6,_[18]=2,_[19]=3,_[20]=7,_[21]=2,_[22]=7,_[23]=6,_[24]=3,_[25]=0,_[26]=4,_[27]=3,_[28]=4,_[29]=7,_[30]=0,_[31]=1,_[32]=5,_[33]=0,_[34]=5,_[35]=4;var d=e.subtract(a,i,T),I=.5*e.magnitude(d);return new o({attributes:l,indices:_,primitiveType:s.TRIANGLES,boundingSphere:new t(e.ZERO,I)})}},_}),define("Workers/createBoxGeometry",["../Core/BoxGeometry","../Core/defined"],function(t,e){"use strict";return function(n,r){return e(r)&&(n=t.unpack(n,r)),t.createGeometry(n)}})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function t(t){return void 0!==t&&null!==t}return t}),define("Core/DeveloperError",["./defined"],function(t){"use strict";function e(t){this.name="DeveloperError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e.throwInstantiationError=function(){throw new e("This function defines an interface and should not be called directly.")},e}),define("Core/Check",["./defined","./DeveloperError"],function(t,e){"use strict";function n(t){return t+" is required, actual value was undefined"}function r(t,e,n){return"Expected "+n+" to be typeof "+e+", actual typeof was "+t}var i={};return i.typeOf={},i.defined=function(r,i){if(!t(i))throw new e(n(r))},i.typeOf.func=function(t,n){if("function"!=typeof n)throw new e(r(typeof n,"function",t))},i.typeOf.string=function(t,n){if("string"!=typeof n)throw new e(r(typeof n,"string",t))},i.typeOf.number=function(t,n){if("number"!=typeof n)throw new e(r(typeof n,"number",t))},i.typeOf.number.lessThan=function(t,n,r){if(i.typeOf.number(t,n),n>=r)throw new e("Expected "+t+" to be less than "+r+", actual value was "+n)},i.typeOf.number.lessThanOrEquals=function(t,n,r){if(i.typeOf.number(t,n),n>r)throw new e("Expected "+t+" to be less than or equal to "+r+", actual value was "+n)},i.typeOf.number.greaterThan=function(t,n,r){if(i.typeOf.number(t,n),n<=r)throw new e("Expected "+t+" to be greater than "+r+", actual value was "+n)},i.typeOf.number.greaterThanOrEquals=function(t,n,r){if(i.typeOf.number(t,n),n<r)throw new e("Expected "+t+" to be greater than or equal to"+r+", actual value was "+n)},i.typeOf.object=function(t,n){if("object"!=typeof n)throw new e(r(typeof n,"object",t))},i.typeOf.bool=function(t,n){if("boolean"!=typeof n)throw new e(r(typeof n,"boolean",t))},i}),define("Core/freezeObject",["./defined"],function(t){"use strict";var e=Object.freeze;return t(e)||(e=function(t){return t}),e}),define("Core/defaultValue",["./freezeObject"],function(t){"use strict";function e(t,e){return void 0!==t?t:e}return e.EMPTY_OBJECT=t({}),e}),define("ThirdParty/mersenne-twister",[],function(){var t=function(t){void 0==t&&(t=(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(t)};return t.prototype.init_genrand=function(t){for(this.mt[0]=t>>>0,this.mti=1;this.mti<this.N;this.mti++){var t=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&t)>>>16)<<16)+1812433253*(65535&t)+this.mti,this.mt[this.mti]>>>=0}},t.prototype.genrand_int32=function(){var t,e=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)t=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^t>>>1^e[1&t];for(;n<this.N-1;n++)t=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^t>>>1^e[1&t];t=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^t>>>1^e[1&t],this.mti=0}return t=this.mt[this.mti++],t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,t^=t>>>18,t>>>0},t.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},t}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(t,e,n,r){"use strict";var i={};i.EPSILON1=.1,i.EPSILON2=.01,i.EPSILON3=.001,i.EPSILON4=1e-4,i.EPSILON5=1e-5,i.EPSILON6=1e-6,i.EPSILON7=1e-7,i.EPSILON8=1e-8,i.EPSILON9=1e-9,i.EPSILON10=1e-10,i.EPSILON11=1e-11,i.EPSILON12=1e-12,i.EPSILON13=1e-13,i.EPSILON14=1e-14,i.EPSILON15=1e-15,i.EPSILON16=1e-16,i.EPSILON17=1e-17,i.EPSILON18=1e-18,i.EPSILON19=1e-19,i.EPSILON20=1e-20,i.GRAVITATIONALPARAMETER=3986004418e5,i.SOLAR_RADIUS=6955e5,i.LUNAR_RADIUS=1737400,i.SIXTY_FOUR_KILOBYTES=65536,i.sign=function(t){return t>0?1:t<0?-1:0},i.signNotZero=function(t){return t<0?-1:1},i.toSNorm=function(t,n){return n=e(n,255),Math.round((.5*i.clamp(t,-1,1)+.5)*n)},i.fromSNorm=function(t,n){return n=e(n,255),i.clamp(t,0,n)/n*2-1},i.sinh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e-n)},i.cosh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e+n)},i.lerp=function(t,e,n){return(1-n)*t+n*e},i.PI=Math.PI,i.ONE_OVER_PI=1/Math.PI,i.PI_OVER_TWO=.5*Math.PI,i.PI_OVER_THREE=Math.PI/3,i.PI_OVER_FOUR=Math.PI/4,i.PI_OVER_SIX=Math.PI/6,i.THREE_PI_OVER_TWO=3*Math.PI*.5,i.TWO_PI=2*Math.PI,i.ONE_OVER_TWO_PI=1/(2*Math.PI),i.RADIANS_PER_DEGREE=Math.PI/180,i.DEGREES_PER_RADIAN=180/Math.PI,i.RADIANS_PER_ARCSECOND=i.RADIANS_PER_DEGREE/3600,i.toRadians=function(t){return t*i.RADIANS_PER_DEGREE},i.toDegrees=function(t){return t*i.DEGREES_PER_RADIAN},i.convertLongitudeRange=function(t){var e=i.TWO_PI,n=t-Math.floor(t/e)*e;return n<-Math.PI?n+e:n>=Math.PI?n-e:n},i.clampToLatitudeRange=function(t){return i.clamp(t,-1*i.PI_OVER_TWO,i.PI_OVER_TWO)},i.negativePiToPi=function(t){return i.zeroToTwoPi(t+i.PI)-i.PI},i.zeroToTwoPi=function(t){var e=i.mod(t,i.TWO_PI);return Math.abs(e)<i.EPSILON14&&Math.abs(t)>i.EPSILON14?i.TWO_PI:e},i.mod=function(t,e){return(t%e+e)%e},i.equalsEpsilon=function(t,n,r,i){i=e(i,r);var a=Math.abs(t-n);return a<=i||a<=r*Math.max(Math.abs(t),Math.abs(n))};var a=[1];i.factorial=function(t){var e=a.length;if(t>=e)for(var n=a[e-1],r=e;r<=t;r++)a.push(n*r);return a[t]},i.incrementWrap=function(t,n,r){return r=e(r,0),++t,t>n&&(t=r),t},i.isPowerOfTwo=function(t){return 0!==t&&0===(t&t-1)},i.nextPowerOfTwo=function(t){return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t,t},i.clamp=function(t,e,n){return t<e?e:t>n?n:t};var o=new t;return i.setRandomNumberSeed=function(e){o=new t(e)},i.nextRandomNumber=function(){return o.random()},i.acosClamped=function(t){return Math.acos(i.clamp(t,-1,1))},i.asinClamped=function(t){return Math.asin(i.clamp(t,-1,1))},i.chordLength=function(t,e){return 2*e*Math.sin(.5*t)},i.logBase=function(t,e){return Math.log(t)/Math.log(e)},i.fog=function(t,e){var n=t*e;return 1-Math.exp(-(n*n))},i}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a){"use strict";function o(t,n,r){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0)}o.fromSpherical=function(t,r){n(r)||(r=new o);var i=t.clock,a=t.cone,u=e(t.magnitude,1),E=u*Math.sin(a);return r.x=E*Math.cos(i),r.y=E*Math.sin(i),r.z=u*Math.cos(a),r},o.fromElements=function(t,e,r,i){return n(i)?(i.x=t,i.y=e,i.z=r,i):new o(t,e,r)},o.clone=function(t,e){if(n(t))return n(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e):new o(t.x,t.y,t.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r]=t.z,n},o.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new o),i.x=t[r++],i.y=t[r++],i.z=t[r],i},o.packArray=function(t,e){var r=t.length;n(e)?e.length=3*r:e=new Array(3*r);for(var i=0;i<r;++i)o.pack(t[i],e,3*i);return e},o.unpackArray=function(t,e){var r=t.length;n(e)?e.length=r/3:e=new Array(r/3);for(var i=0;i<r;i+=3){var a=i/3;e[a]=o.unpack(t,i,e[a])}return e},o.fromArray=o.unpack,o.maximumComponent=function(t){return Math.max(t.x,t.y,t.z)},o.minimumComponent=function(t){return Math.min(t.x,t.y,t.z)},o.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n.z=Math.min(t.z,e.z),n},o.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n.z=Math.max(t.z,e.z),n},o.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z},o.magnitude=function(t){return Math.sqrt(o.magnitudeSquared(t))};var u=new o;o.distance=function(t,e){return o.subtract(t,e,u),o.magnitude(u)},o.distanceSquared=function(t,e){return o.subtract(t,e,u),o.magnitudeSquared(u)},o.normalize=function(t,e){var n=o.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e},o.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},o.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n.z=t.z*e.z,n},o.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n.z=t.z/e.z,n},o.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n},o.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n},o.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*e,n},o.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n},o.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e},o.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e};var E=new o;o.lerp=function(t,e,n,r){return o.multiplyByScalar(e,n,E),r=o.multiplyByScalar(t,1-n,r),o.add(E,r,r)};var s=new o,c=new o;o.angleBetween=function(t,e){o.normalize(t,s),o.normalize(e,c);var n=o.dot(s,c),r=o.magnitude(o.cross(s,c,s));return Math.atan2(r,n)};var _=new o;o.mostOrthogonalAxis=function(t,e){var n=o.normalize(t,_);return o.abs(n,n),e=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,e):o.clone(o.UNIT_Z,e):n.y<=n.z?o.clone(o.UNIT_Y,e):o.clone(o.UNIT_Z,e)},o.equals=function(t,e){return t===e||n(t)&&n(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z},o.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]},o.equalsEpsilon=function(t,e,r,i){return t===e||n(t)&&n(e)&&a.equalsEpsilon(t.x,e.x,r,i)&&a.equalsEpsilon(t.y,e.y,r,i)&&a.equalsEpsilon(t.z,e.z,r,i)},o.cross=function(t,e,n){var r=t.x,i=t.y,a=t.z,o=e.x,u=e.y,E=e.z,s=i*E-a*u,c=a*o-r*E,_=r*u-i*o;return n.x=s,n.y=c,n.z=_,n},o.fromDegrees=function(t,e,n,r,i){return t=a.toRadians(t),e=a.toRadians(e),o.fromRadians(t,e,n,r,i)};var T=new o,R=new o,l=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(t,r,i,a,u){i=e(i,0);var E=n(a)?a.radiiSquared:l,s=Math.cos(r);T.x=s*Math.cos(t),T.y=s*Math.sin(t),T.z=Math.sin(r),T=o.normalize(T,T),o.multiplyComponents(E,T,R);var c=Math.sqrt(o.dot(T,R));return R=o.divideByScalar(R,c,R),T=o.multiplyByScalar(T,i,T),n(u)||(u=new o),o.add(R,T,u)},o.fromDegreesArray=function(t,e,r){var i=t.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=t[a],E=t[a+1],s=a/2;r[s]=o.fromDegrees(u,E,0,e,r[s])}return r},o.fromRadiansArray=function(t,e,r){var i=t.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=t[a],E=t[a+1],s=a/2;r[s]=o.fromRadians(u,E,0,e,r[s])}return r},o.fromDegreesArrayHeights=function(t,e,r){var i=t.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=t[a],E=t[a+1],s=t[a+2],c=a/3;r[c]=o.fromDegrees(u,E,s,e,r[c])}return r},o.fromRadiansArrayHeights=function(t,e,r){var i=t.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=t[a],E=t[a+1],s=t[a+2],c=a/3;r[c]=o.fromRadians(u,E,s,e,r[c])}return r},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(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.prototype.equalsEpsilon=function(t,e,n){return o.equalsEpsilon(this,t,e,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(t,e,n,r){"use strict";function i(n,i,u,E,s){var c=n.x,_=n.y,T=n.z,R=i.x,l=i.y,A=i.z,f=c*c*R*R,h=_*_*l*l,N=T*T*A*A,d=f+h+N,I=Math.sqrt(1/d),m=t.multiplyByScalar(n,I,a);if(d<E)return isFinite(I)?t.clone(m,s):void 0;var S=u.x,O=u.y,M=u.z,y=o;y.x=m.x*S*2,y.y=m.y*O*2,y.z=m.z*M*2;var p,C,U,L,F,P,w,g,x,v,D,B=(1-I)*t.magnitude(n)/(.5*t.magnitude(y)),z=0;do{B-=z,U=1/(1+B*S),L=1/(1+B*O),F=1/(1+B*M),P=U*U,w=L*L,g=F*F,x=P*U,v=w*L,D=g*F,p=f*P+h*w+N*g-1,C=f*x*S+h*v*O+N*D*M;var G=-2*C;z=p/G}while(Math.abs(p)>r.EPSILON12);return e(s)?(s.x=c*U,s.y=_*L,s.z=T*F,s):new t(c*U,_*L,T*F)}var a=new t,o=new t;return i}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,n,r,i,a,o){"use strict";function u(t,n,r){this.longitude=e(t,0),this.latitude=e(n,0),this.height=e(r,0)}u.fromRadians=function(t,r,i,a){return i=e(i,0),n(a)?(a.longitude=t,a.latitude=r,a.height=i,a):new u(t,r,i)},u.fromDegrees=function(t,e,n,r){return t=a.toRadians(t),e=a.toRadians(e),u.fromRadians(t,e,n,r)};var E=new t,s=new t,c=new t,_=new t(1/6378137,1/6378137,1/6356752.314245179),T=new t(1/40680631590769,1/40680631590769,1/40408299984661.445),R=a.EPSILON1;return u.fromCartesian=function(e,r,i){var l=n(r)?r.oneOverRadii:_,A=n(r)?r.oneOverRadiiSquared:T,f=n(r)?r._centerToleranceSquared:R,h=o(e,l,A,f,s);if(n(h)){var N=t.multiplyComponents(h,A,E);N=t.normalize(N,N);var d=t.subtract(e,h,c),I=Math.atan2(N.y,N.x),m=Math.asin(N.z),S=a.sign(t.dot(d,e))*t.magnitude(d);return n(i)?(i.longitude=I,i.latitude=m,i.height=S,i):new u(I,m,S)}},u.clone=function(t,e){if(n(t))return n(e)?(e.longitude=t.longitude,e.latitude=t.latitude,e.height=t.height,e):new u(t.longitude,t.latitude,t.height)},u.equals=function(t,e){return t===e||n(t)&&n(e)&&t.longitude===e.longitude&&t.latitude===e.latitude&&t.height===e.height},u.equalsEpsilon=function(t,e,r){return t===e||n(t)&&n(e)&&Math.abs(t.longitude-e.longitude)<=r&&Math.abs(t.latitude-e.latitude)<=r&&Math.abs(t.height-e.height)<=r},u.ZERO=i(new u(0,0,0)),u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.prototype.equalsEpsilon=function(t,e){return u.equalsEpsilon(this,t,e)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(t){"use strict";var e=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(t){return!1}}(),n=Object.defineProperties;return e&&t(n)||(n=function(t){return t}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,n,r,i,a,o,u,E){"use strict";function s(e,r,i,a){r=n(r,0),i=n(i,0),a=n(a,0),e._radii=new t(r,i,a),e._radiiSquared=new t(r*r,i*i,a*a),e._radiiToTheFourth=new t(r*r*r*r,i*i*i*i,a*a*a*a),e._oneOverRadii=new t(0===r?0:1/r,0===i?0:1/i,0===a?0:1/a),e._oneOverRadiiSquared=new t(0===r?0:1/(r*r),0===i?0:1/(i*i),0===a?0:1/(a*a)),e._minimumRadius=Math.min(r,i,a),e._maximumRadius=Math.max(r,i,a),e._centerToleranceSquared=u.EPSILON1,0!==e._radiiSquared.z&&(e._sqauredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function c(t,e,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,s(this,t,e,n)}i(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(e,n){if(r(e)){var i=e._radii;return r(n)?(t.clone(i,n._radii),t.clone(e._radiiSquared,n._radiiSquared),t.clone(e._radiiToTheFourth,n._radiiToTheFourth),t.clone(e._oneOverRadii,n._oneOverRadii),t.clone(e._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=e._minimumRadius,n._maximumRadius=e._maximumRadius,n._centerToleranceSquared=e._centerToleranceSquared,n):new c(i.x,i.y,i.z)}},c.fromCartesian3=function(t,e){return r(e)||(e=new c),r(t)?(s(e,t.x,t.y,t.z),e):e},c.WGS84=o(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=o(new c(1,1,1)),c.MOON=o(new c(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),c.prototype.clone=function(t){return c.clone(this,t)},c.packedLength=t.packedLength,c.pack=function(e,r,i){return i=n(i,0),t.pack(e._radii,r,i),r},c.unpack=function(e,r,i){r=n(r,0);var a=t.unpack(e,r);return c.fromCartesian3(a,i)},c.prototype.geocentricSurfaceNormal=t.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(e,n){var i=e.longitude,a=e.latitude,o=Math.cos(a),u=o*Math.cos(i),E=o*Math.sin(i),s=Math.sin(a);return r(n)||(n=new t),n.x=u,n.y=E,n.z=s,t.normalize(n,n)},c.prototype.geodeticSurfaceNormal=function(e,n){return r(n)||(n=new t),n=t.multiplyComponents(e,this._oneOverRadiiSquared,n),t.normalize(n,n)};var _=new t,T=new t;c.prototype.cartographicToCartesian=function(e,n){var i=_,a=T;this.geodeticSurfaceNormalCartographic(e,i),t.multiplyComponents(this._radiiSquared,i,a);var o=Math.sqrt(t.dot(i,a));return t.divideByScalar(a,o,a),t.multiplyByScalar(i,e.height,i),r(n)||(n=new t),t.add(a,i,n)},c.prototype.cartographicArrayToCartesianArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var i=0;i<n;i++)e[i]=this.cartographicToCartesian(t[i],e[i]);return e};var R=new t,l=new t,A=new t;return c.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,l);if(r(a)){var o=this.geodeticSurfaceNormal(a,R),E=t.subtract(n,a,A),s=Math.atan2(o.y,o.x),c=Math.asin(o.z),_=u.sign(t.dot(E,n))*t.magnitude(E);return r(i)?(i.longitude=s,i.latitude=c,i.height=_,i):new e(s,c,_)}},c.prototype.cartesianArrayToCartographicArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var i=0;i<n;++i)e[i]=this.cartesianToCartographic(t[i],e[i]);return e},c.prototype.scaleToGeodeticSurface=function(t,e){return E(t,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,e)},c.prototype.scaleToGeocentricSurface=function(e,n){r(n)||(n=new t);var i=e.x,a=e.y,o=e.z,u=this._oneOverRadiiSquared,E=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*u.z);return t.multiplyByScalar(e,E,n)},c.prototype.transformPositionToScaledSpace=function(e,n){return r(n)||(n=new t),t.multiplyComponents(e,this._oneOverRadii,n)},c.prototype.transformPositionFromScaledSpace=function(e,n){return r(n)||(n=new t),t.multiplyComponents(e,this._radii,n)},c.prototype.equals=function(e){return this===e||r(e)&&t.equals(this._radii,e._radii)},c.prototype.toString=function(){return this._radii.toString()},c.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,i,a){i=n(i,0);var o=this._sqauredXOverSquaredZ;if(r(a)||(a=new t),a.x=0,a.y=0,a.z=e.z*(1-o),!(Math.abs(a.z)>=this._radii.z-i))return a},c}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(t,e,n,r,i,a,o){"use strict";function u(t){this._ellipsoid=n(t,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return i(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(e,n){var i=this._semimajorAxis,a=e.longitude*i,o=e.latitude*i,u=e.height;return r(n)?(n.x=a,n.y=o,n.z=u,n):new t(a,o,u)},u.prototype.unproject=function(t,n){var i=this._oneOverSemimajorAxis,a=t.x*i,o=t.y*i,u=t.z;return r(n)?(n.longitude=a,n.latitude=o,n.height=u,n):new e(a,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(t){"use strict";var e={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return t(e)}),define("Core/Interval",["./defaultValue"],function(t){"use strict";function e(e,n){this.start=t(e,0),this.stop=t(n,0)}return e}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a,o,u){"use strict";function E(t,e,r,i,a,o,u,E,s){this[0]=n(t,0),this[1]=n(i,0),this[2]=n(u,0),this[3]=n(e,0),this[4]=n(a,0),this[5]=n(E,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(s,0)}function s(t){for(var e=0,n=0;n<9;++n){var r=t[n];e+=r*r}return Math.sqrt(e)}function c(t){for(var e=0,n=0;n<3;++n){var r=t[E.getElementIndex(A[n],l[n])];e+=2*r*r}return Math.sqrt(e)}function _(t,e){for(var n=u.EPSILON15,r=0,i=1,a=0;a<3;++a){var o=Math.abs(t[E.getElementIndex(A[a],l[a])]);o>r&&(i=a,r=o)}var s=1,c=0,_=l[i],T=A[i];if(Math.abs(t[E.getElementIndex(T,_)])>n){var R,f=t[E.getElementIndex(T,T)],h=t[E.getElementIndex(_,_)],N=t[E.getElementIndex(T,_)],d=(f-h)/2/N;R=d<0?-1/(-d+Math.sqrt(1+d*d)):1/(d+Math.sqrt(1+d*d)),s=1/Math.sqrt(1+R*R),c=R*s}return e=E.clone(E.IDENTITY,e),e[E.getElementIndex(_,_)]=e[E.getElementIndex(T,T)]=s,e[E.getElementIndex(T,_)]=c,e[E.getElementIndex(_,T)]=-c,e}E.packedLength=9,E.pack=function(t,e,r){return r=n(r,0),e[r++]=t[0],e[r++]=t[1],e[r++]=t[2],e[r++]=t[3],e[r++]=t[4],e[r++]=t[5],e[r++]=t[6],e[r++]=t[7],e[r++]=t[8],e},E.unpack=function(t,e,i){return e=n(e,0),r(i)||(i=new E),i[0]=t[e++],i[1]=t[e++],i[2]=t[e++],i[3]=t[e++],i[4]=t[e++],i[5]=t[e++],i[6]=t[e++],i[7]=t[e++],i[8]=t[e++],i},E.clone=function(t,e){if(r(t))return r(e)?(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):new E(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8])},E.fromArray=function(t,e,i){return e=n(e,0),r(i)||(i=new E),i[0]=t[e],i[1]=t[e+1],i[2]=t[e+2],i[3]=t[e+3],i[4]=t[e+4],i[5]=t[e+5],i[6]=t[e+6],i[7]=t[e+7],i[8]=t[e+8],i},E.fromColumnMajorArray=function(t,e){return E.clone(t,e)},E.fromRowMajorArray=function(t,e){return r(e)?(e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],e):new E(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},E.fromQuaternion=function(t,e){var n=t.x*t.x,i=t.x*t.y,a=t.x*t.z,o=t.x*t.w,u=t.y*t.y,s=t.y*t.z,c=t.y*t.w,_=t.z*t.z,T=t.z*t.w,R=t.w*t.w,l=n-u-_+R,A=2*(i-T),f=2*(a+c),h=2*(i+T),N=-n+u-_+R,d=2*(s-o),I=2*(a-c),m=2*(s+o),S=-n-u+_+R;return r(e)?(e[0]=l,e[1]=h,e[2]=I,e[3]=A,e[4]=N,e[5]=m,e[6]=f,e[7]=d,e[8]=S,e):new E(l,A,f,h,N,d,I,m,S)},E.fromHeadingPitchRoll=function(t,e){var n=Math.cos(-t.pitch),i=Math.cos(-t.heading),a=Math.cos(t.roll),o=Math.sin(-t.pitch),u=Math.sin(-t.heading),s=Math.sin(t.roll),c=n*i,_=-a*u+s*o*i,T=s*u+a*o*i,R=n*u,l=a*i+s*o*u,A=-o*a+a*o*u,f=-o,h=s*n,N=a*n;return r(e)?(e[0]=c,e[1]=R,e[2]=f,e[3]=_,e[4]=l,e[5]=h,e[6]=T,e[7]=A,e[8]=N,e):new E(c,_,T,R,l,A,f,h,N)},E.fromScale=function(t,e){return r(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=t.y,e[5]=0,e[6]=0,e[7]=0,e[8]=t.z,e):new E(t.x,0,0,0,t.y,0,0,0,t.z)},E.fromUniformScale=function(t,e){return r(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=t,e[5]=0,e[6]=0,e[7]=0,e[8]=t,e):new E(t,0,0,0,t,0,0,0,t)},E.fromCrossProduct=function(t,e){return r(e)?(e[0]=0,e[1]=t.z,e[2]=-t.y,e[3]=-t.z,e[4]=0,e[5]=t.x,e[6]=t.y,e[7]=-t.x,e[8]=0,e):new E(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},E.fromRotationX=function(t,e){var n=Math.cos(t),i=Math.sin(t);return r(e)?(e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=n,e[5]=i,e[6]=0,e[7]=-i,e[8]=n,e):new E(1,0,0,0,n,-i,0,i,n)},E.fromRotationY=function(t,e){var n=Math.cos(t),i=Math.sin(t);return r(e)?(e[0]=n,e[1]=0,e[2]=-i,e[3]=0,e[4]=1,e[5]=0,e[6]=i,e[7]=0,e[8]=n,e):new E(n,0,i,0,1,0,-i,0,n)},E.fromRotationZ=function(t,e){var n=Math.cos(t),i=Math.sin(t);return r(e)?(e[0]=n,e[1]=i,e[2]=0,e[3]=-i,e[4]=n,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e):new E(n,-i,0,i,n,0,0,0,1)},E.toArray=function(t,e){return r(e)?(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):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},E.getElementIndex=function(t,e){return 3*t+e},E.getColumn=function(t,e,n){var r=3*e,i=t[r],a=t[r+1],o=t[r+2];return n.x=i,n.y=a,n.z=o,n},E.setColumn=function(t,e,n,r){r=E.clone(t,r);var i=3*e;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},E.getRow=function(t,e,n){var r=t[e],i=t[e+3],a=t[e+6];return n.x=r,n.y=i,n.z=a,n},E.setRow=function(t,e,n,r){return r=E.clone(t,r),r[e]=n.x,r[e+3]=n.y,r[e+6]=n.z,r};var T=new t;E.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],T)),n.y=t.magnitude(t.fromElements(e[3],e[4],e[5],T)),n.z=t.magnitude(t.fromElements(e[6],e[7],e[8],T)),n};var R=new t;E.getMaximumScale=function(e){return E.getScale(e,R),t.maximumComponent(R)},E.multiply=function(t,e,n){var r=t[0]*e[0]+t[3]*e[1]+t[6]*e[2],i=t[1]*e[0]+t[4]*e[1]+t[7]*e[2],a=t[2]*e[0]+t[5]*e[1]+t[8]*e[2],o=t[0]*e[3]+t[3]*e[4]+t[6]*e[5],u=t[1]*e[3]+t[4]*e[4]+t[7]*e[5],E=t[2]*e[3]+t[5]*e[4]+t[8]*e[5],s=t[0]*e[6]+t[3]*e[7]+t[6]*e[8],c=t[1]*e[6]+t[4]*e[7]+t[7]*e[8],_=t[2]*e[6]+t[5]*e[7]+t[8]*e[8];return n[0]=r,n[1]=i,n[2]=a,n[3]=o,n[4]=u,n[5]=E,n[6]=s,n[7]=c,n[8]=_,n},E.add=function(t,e,n){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n[4]=t[4]+e[4],n[5]=t[5]+e[5],n[6]=t[6]+e[6],n[7]=t[7]+e[7],n[8]=t[8]+e[8],n},E.subtract=function(t,e,n){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n[4]=t[4]-e[4],n[5]=t[5]-e[5],n[6]=t[6]-e[6],n[7]=t[7]-e[7],n[8]=t[8]-e[8],n},E.multiplyByVector=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=t[0]*r+t[3]*i+t[6]*a,u=t[1]*r+t[4]*i+t[7]*a,E=t[2]*r+t[5]*i+t[8]*a;return n.x=o,n.y=u,n.z=E,n},E.multiplyByScalar=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n[4]=t[4]*e,n[5]=t[5]*e,n[6]=t[6]*e,n[7]=t[7]*e,n[8]=t[8]*e,n},E.multiplyByScale=function(t,e,n){return n[0]=t[0]*e.x,n[1]=t[1]*e.x,n[2]=t[2]*e.x,n[3]=t[3]*e.y,n[4]=t[4]*e.y,n[5]=t[5]*e.y,n[6]=t[6]*e.z,n[7]=t[7]*e.z,n[8]=t[8]*e.z,n},E.negate=function(t,e){return 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},E.transpose=function(t,e){var n=t[0],r=t[3],i=t[6],a=t[1],o=t[4],u=t[7],E=t[2],s=t[5],c=t[8];return e[0]=n,e[1]=r,e[2]=i,e[3]=a,e[4]=o,e[5]=u,e[6]=E,e[7]=s,e[8]=c,e};var l=[1,0,0],A=[2,2,1],f=new E,h=new E;return E.computeEigenDecomposition=function(t,e){var n=u.EPSILON20,i=10,a=0,o=0;r(e)||(e={});for(var T=e.unitary=E.clone(E.IDENTITY,e.unitary),R=e.diagonal=E.clone(t,e.diagonal),l=n*s(R);o<i&&c(R)>l;)_(R,f),E.transpose(f,h),E.multiply(R,f,R),E.multiply(h,R,R),E.multiply(T,f,T),++a>2&&(++o,a=0);return e},E.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e},E.determinant=function(t){var e=t[0],n=t[3],r=t[6],i=t[1],a=t[4],o=t[7],u=t[2],E=t[5],s=t[8];return e*(a*s-E*o)+i*(E*r-n*s)+u*(n*o-a*r)},E.inverse=function(t,e){var n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],u=t[5],s=t[6],c=t[7],_=t[8],T=E.determinant(t);e[0]=o*_-c*u,e[1]=c*i-r*_,e[2]=r*u-o*i,e[3]=s*u-a*_,e[4]=n*_-s*i,e[5]=a*i-n*u,e[6]=a*c-s*o,e[7]=s*r-n*c,e[8]=n*o-a*r;var R=1/T;return E.multiplyByScalar(e,R,e)},E.equals=function(t,e){return t===e||r(t)&&r(e)&&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]},E.equalsEpsilon=function(t,e,n){return t===e||r(t)&&r(e)&&Math.abs(t[0]-e[0])<=n&&Math.abs(t[1]-e[1])<=n&&Math.abs(t[2]-e[2])<=n&&Math.abs(t[3]-e[3])<=n&&Math.abs(t[4]-e[4])<=n&&Math.abs(t[5]-e[5])<=n&&Math.abs(t[6]-e[6])<=n&&Math.abs(t[7]-e[7])<=n&&Math.abs(t[8]-e[8])<=n},E.IDENTITY=o(new E(1,0,0,0,1,0,0,0,1)),E.ZERO=o(new E(0,0,0,0,0,0,0,0,0)),E.COLUMN0ROW0=0,E.COLUMN0ROW1=1,E.COLUMN0ROW2=2,E.COLUMN1ROW0=3,E.COLUMN1ROW1=4,E.COLUMN1ROW2=5,E.COLUMN2ROW0=6,E.COLUMN2ROW1=7,E.COLUMN2ROW2=8,i(E.prototype,{length:{get:function(){return E.packedLength}}}),E.prototype.clone=function(t){return E.clone(this,t)},E.prototype.equals=function(t){return E.equals(this,t)},E.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]&&t[4]===e[n+4]&&t[5]===e[n+5]&&t[6]===e[n+6]&&t[7]===e[n+7]&&t[8]===e[n+8]},E.prototype.equalsEpsilon=function(t,e){return E.equalsEpsilon(this,t,e)},E.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},E}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a){"use strict";function o(t,n,r,i){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0),this.w=e(i,0)}o.fromElements=function(t,e,r,i,a){return n(a)?(a.x=t,a.y=e,a.z=r,a.w=i,a):new o(t,e,r,i)},o.fromColor=function(t,e){return n(e)?(e.x=t.red,e.y=t.green,e.z=t.blue,e.w=t.alpha,e):new o(t.red,t.green,t.blue,t.alpha)},o.clone=function(t,e){if(n(t))return n(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e):new o(t.x,t.y,t.z,t.w)},o.packedLength=4,o.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w,n},o.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new o),i.x=t[r++],i.y=t[r++],i.z=t[r++],i.w=t[r],i},o.packArray=function(t,e){var r=t.length;n(e)?e.length=4*r:e=new Array(4*r);for(var i=0;i<r;++i)o.pack(t[i],e,4*i);return e},o.unpackArray=function(t,e){var r=t.length;n(e)?e.length=r/4:e=new Array(r/4);for(var i=0;i<r;i+=4){var a=i/4;e[a]=o.unpack(t,i,e[a])}return e},o.fromArray=o.unpack,o.maximumComponent=function(t){return Math.max(t.x,t.y,t.z,t.w)},o.minimumComponent=function(t){return Math.min(t.x,t.y,t.z,t.w)},o.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n.z=Math.min(t.z,e.z),n.w=Math.min(t.w,e.w),n},o.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n.z=Math.max(t.z,e.z),n.w=Math.max(t.w,e.w),n},o.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w},o.magnitude=function(t){return Math.sqrt(o.magnitudeSquared(t))};var u=new o;o.distance=function(t,e){return o.subtract(t,e,u),o.magnitude(u)},o.distanceSquared=function(t,e){return o.subtract(t,e,u),o.magnitudeSquared(u)},o.normalize=function(t,e){var n=o.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e.w=t.w/n,e},o.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z+t.w*e.w},o.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n.z=t.z*e.z,n.w=t.w*e.w,n},o.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n.z=t.z/e.z,n.w=t.w/e.w,n},o.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n.w=t.w+e.w,n},o.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n.w=t.w-e.w,n},o.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*e,n.w=t.w*e,n},o.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n.w=t.w/e,n},o.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e.w=-t.w,e},o.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e.w=Math.abs(t.w),e};var E=new o;o.lerp=function(t,e,n,r){return o.multiplyByScalar(e,n,E),r=o.multiplyByScalar(t,1-n,r),o.add(E,r,r)};var s=new o;return o.mostOrthogonalAxis=function(t,e){var n=o.normalize(t,s);return o.abs(n,n),e=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,e):o.clone(o.UNIT_W,e):n.z<=n.w?o.clone(o.UNIT_Z,e):o.clone(o.UNIT_W,e):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,e):o.clone(o.UNIT_W,e):n.z<=n.w?o.clone(o.UNIT_Z,e):o.clone(o.UNIT_W,e)},o.equals=function(t,e){return t===e||n(t)&&n(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z&&t.w===e.w},o.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]&&t.w===e[n+3]},o.equalsEpsilon=function(t,e,r,i){return t===e||n(t)&&n(e)&&a.equalsEpsilon(t.x,e.x,r,i)&&a.equalsEpsilon(t.y,e.y,r,i)&&a.equalsEpsilon(t.z,e.z,r,i)&&a.equalsEpsilon(t.w,e.w,r,i)},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(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.prototype.equalsEpsilon=function(t,e,n){return o.equalsEpsilon(this,t,e,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(t){"use strict";function e(t){this.name="RuntimeError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(t,e,n,r,i,a,o,u,E,s,c){ +"use strict";function _(t,e,n,i,a,o,u,E,s,c,_,T,R,l,A,f){this[0]=r(t,0),this[1]=r(a,0),this[2]=r(s,0),this[3]=r(R,0),this[4]=r(e,0),this[5]=r(o,0),this[6]=r(c,0),this[7]=r(l,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(_,0),this[11]=r(A,0),this[12]=r(i,0),this[13]=r(E,0),this[14]=r(T,0),this[15]=r(f,0)}_.packedLength=16,_.pack=function(t,e,n){return n=r(n,0),e[n++]=t[0],e[n++]=t[1],e[n++]=t[2],e[n++]=t[3],e[n++]=t[4],e[n++]=t[5],e[n++]=t[6],e[n++]=t[7],e[n++]=t[8],e[n++]=t[9],e[n++]=t[10],e[n++]=t[11],e[n++]=t[12],e[n++]=t[13],e[n++]=t[14],e[n]=t[15],e},_.unpack=function(t,e,n){return e=r(e,0),i(n)||(n=new _),n[0]=t[e++],n[1]=t[e++],n[2]=t[e++],n[3]=t[e++],n[4]=t[e++],n[5]=t[e++],n[6]=t[e++],n[7]=t[e++],n[8]=t[e++],n[9]=t[e++],n[10]=t[e++],n[11]=t[e++],n[12]=t[e++],n[13]=t[e++],n[14]=t[e++],n[15]=t[e],n},_.clone=function(t,e){if(i(t))return i(e)?(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],e):new _(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15])},_.fromArray=_.unpack,_.fromColumnMajorArray=function(t,e){return _.clone(t,e)},_.fromRowMajorArray=function(t,e){return i(e)?(e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15],e):new _(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},_.fromRotationTranslation=function(e,n,a){return n=r(n,t.ZERO),i(a)?(a[0]=e[0],a[1]=e[1],a[2]=e[2],a[3]=0,a[4]=e[3],a[5]=e[4],a[6]=e[5],a[7]=0,a[8]=e[6],a[9]=e[7],a[10]=e[8],a[11]=0,a[12]=n.x,a[13]=n.y,a[14]=n.z,a[15]=1,a):new _(e[0],e[3],e[6],n.x,e[1],e[4],e[7],n.y,e[2],e[5],e[8],n.z,0,0,0,1)},_.fromTranslationQuaternionRotationScale=function(t,e,n,r){i(r)||(r=new _);var a=n.x,o=n.y,u=n.z,E=e.x*e.x,s=e.x*e.y,c=e.x*e.z,T=e.x*e.w,R=e.y*e.y,l=e.y*e.z,A=e.y*e.w,f=e.z*e.z,h=e.z*e.w,N=e.w*e.w,d=E-R-f+N,I=2*(s-h),m=2*(c+A),S=2*(s+h),O=-E+R-f+N,M=2*(l-T),y=2*(c-A),p=2*(l+T),C=-E-R+f+N;return r[0]=d*a,r[1]=S*a,r[2]=y*a,r[3]=0,r[4]=I*o,r[5]=O*o,r[6]=p*o,r[7]=0,r[8]=m*u,r[9]=M*u,r[10]=C*u,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,r},_.fromTranslationRotationScale=function(t,e){return _.fromTranslationQuaternionRotationScale(t.translation,t.rotation,t.scale,e)},_.fromTranslation=function(t,e){return _.fromRotationTranslation(s.IDENTITY,t,e)},_.fromScale=function(t,e){return i(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t.y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t.z,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new _(t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1)},_.fromUniformScale=function(t,e){return i(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new _(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1)};var T=new t,R=new t,l=new t;_.fromCamera=function(e,n){var r=e.position,a=e.direction,o=e.up;t.normalize(a,T),t.normalize(t.cross(T,o,R),R),t.normalize(t.cross(R,T,l),l);var u=R.x,E=R.y,s=R.z,c=T.x,A=T.y,f=T.z,h=l.x,N=l.y,d=l.z,I=r.x,m=r.y,S=r.z,O=u*-I+E*-m+s*-S,M=h*-I+N*-m+d*-S,y=c*I+A*m+f*S;return i(n)?(n[0]=u,n[1]=h,n[2]=-c,n[3]=0,n[4]=E,n[5]=N,n[6]=-A,n[7]=0,n[8]=s,n[9]=d,n[10]=-f,n[11]=0,n[12]=O,n[13]=M,n[14]=y,n[15]=1,n):new _(u,E,s,O,h,N,d,M,-c,-A,-f,y,0,0,0,1)},_.computePerspectiveFieldOfView=function(t,e,n,r,i){var a=Math.tan(.5*t),o=1/a,u=o/e,E=(r+n)/(n-r),s=2*r*n/(n-r);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=o,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=E,i[11]=-1,i[12]=0,i[13]=0,i[14]=s,i[15]=0,i},_.computeOrthographicOffCenter=function(t,e,n,r,i,a,o){var u=1/(e-t),E=1/(r-n),s=1/(a-i),c=-(e+t)*u,_=-(r+n)*E,T=-(a+i)*s;return u*=2,E*=2,s*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=s,o[11]=0,o[12]=c,o[13]=_,o[14]=T,o[15]=1,o},_.computePerspectiveOffCenter=function(t,e,n,r,i,a,o){var u=2*i/(e-t),E=2*i/(r-n),s=(e+t)/(e-t),c=(r+n)/(r-n),_=-(a+i)/(a-i),T=-1,R=-2*a*i/(a-i);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=s,o[9]=c,o[10]=_,o[11]=T,o[12]=0,o[13]=0,o[14]=R,o[15]=0,o},_.computeInfinitePerspectiveOffCenter=function(t,e,n,r,i,a){var o=2*i/(e-t),u=2*i/(r-n),E=(e+t)/(e-t),s=(r+n)/(r-n),c=-1,_=-1,T=-2*i;return a[0]=o,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=E,a[9]=s,a[10]=c,a[11]=_,a[12]=0,a[13]=0,a[14]=T,a[15]=0,a},_.computeViewportTransformation=function(t,e,n,i){t=r(t,r.EMPTY_OBJECT);var a=r(t.x,0),o=r(t.y,0),u=r(t.width,0),E=r(t.height,0);e=r(e,0),n=r(n,1);var s=.5*u,c=.5*E,_=.5*(n-e),T=s,R=c,l=_,A=a+s,f=o+c,h=e+_,N=1;return i[0]=T,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=R,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=l,i[11]=0,i[12]=A,i[13]=f,i[14]=h,i[15]=N,i},_.computeView=function(e,n,r,i,a){return a[0]=i.x,a[1]=r.x,a[2]=-n.x,a[3]=0,a[4]=i.y,a[5]=r.y,a[6]=-n.y,a[7]=0,a[8]=i.z,a[9]=r.z,a[10]=-n.z,a[11]=0,a[12]=-t.dot(i,e),a[13]=-t.dot(r,e),a[14]=t.dot(n,e),a[15]=1,a},_.toArray=function(t,e){return i(e)?(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],e):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]},_.getElementIndex=function(t,e){return 4*t+e},_.getColumn=function(t,e,n){var r=4*e,i=t[r],a=t[r+1],o=t[r+2],u=t[r+3];return n.x=i,n.y=a,n.z=o,n.w=u,n},_.setColumn=function(t,e,n,r){r=_.clone(t,r);var i=4*e;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r[i+3]=n.w,r},_.setTranslation=function(t,e,n){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=t[15],n},_.getRow=function(t,e,n){var r=t[e],i=t[e+4],a=t[e+8],o=t[e+12];return n.x=r,n.y=i,n.z=a,n.w=o,n},_.setRow=function(t,e,n,r){return r=_.clone(t,r),r[e]=n.x,r[e+4]=n.y,r[e+8]=n.z,r[e+12]=n.w,r};var A=new t;_.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],A)),n.y=t.magnitude(t.fromElements(e[4],e[5],e[6],A)),n.z=t.magnitude(t.fromElements(e[8],e[9],e[10],A)),n};var f=new t;_.getMaximumScale=function(e){return _.getScale(e,f),t.maximumComponent(f)},_.multiply=function(t,e,n){var r=t[0],i=t[1],a=t[2],o=t[3],u=t[4],E=t[5],s=t[6],c=t[7],_=t[8],T=t[9],R=t[10],l=t[11],A=t[12],f=t[13],h=t[14],N=t[15],d=e[0],I=e[1],m=e[2],S=e[3],O=e[4],M=e[5],y=e[6],p=e[7],C=e[8],U=e[9],L=e[10],F=e[11],P=e[12],w=e[13],g=e[14],x=e[15],v=r*d+u*I+_*m+A*S,D=i*d+E*I+T*m+f*S,B=a*d+s*I+R*m+h*S,z=o*d+c*I+l*m+N*S,G=r*O+u*M+_*y+A*p,b=i*O+E*M+T*y+f*p,X=a*O+s*M+R*y+h*p,V=o*O+c*M+l*y+N*p,q=r*C+u*U+_*L+A*F,H=i*C+E*U+T*L+f*F,W=a*C+s*U+R*L+h*F,Y=o*C+c*U+l*L+N*F,k=r*P+u*w+_*g+A*x,K=i*P+E*w+T*g+f*x,Z=a*P+s*w+R*g+h*x,j=o*P+c*w+l*g+N*x;return n[0]=v,n[1]=D,n[2]=B,n[3]=z,n[4]=G,n[5]=b,n[6]=X,n[7]=V,n[8]=q,n[9]=H,n[10]=W,n[11]=Y,n[12]=k,n[13]=K,n[14]=Z,n[15]=j,n},_.add=function(t,e,n){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n[4]=t[4]+e[4],n[5]=t[5]+e[5],n[6]=t[6]+e[6],n[7]=t[7]+e[7],n[8]=t[8]+e[8],n[9]=t[9]+e[9],n[10]=t[10]+e[10],n[11]=t[11]+e[11],n[12]=t[12]+e[12],n[13]=t[13]+e[13],n[14]=t[14]+e[14],n[15]=t[15]+e[15],n},_.subtract=function(t,e,n){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n[4]=t[4]-e[4],n[5]=t[5]-e[5],n[6]=t[6]-e[6],n[7]=t[7]-e[7],n[8]=t[8]-e[8],n[9]=t[9]-e[9],n[10]=t[10]-e[10],n[11]=t[11]-e[11],n[12]=t[12]-e[12],n[13]=t[13]-e[13],n[14]=t[14]-e[14],n[15]=t[15]-e[15],n},_.multiplyTransformation=function(t,e,n){var r=t[0],i=t[1],a=t[2],o=t[4],u=t[5],E=t[6],s=t[8],c=t[9],_=t[10],T=t[12],R=t[13],l=t[14],A=e[0],f=e[1],h=e[2],N=e[4],d=e[5],I=e[6],m=e[8],S=e[9],O=e[10],M=e[12],y=e[13],p=e[14],C=r*A+o*f+s*h,U=i*A+u*f+c*h,L=a*A+E*f+_*h,F=r*N+o*d+s*I,P=i*N+u*d+c*I,w=a*N+E*d+_*I,g=r*m+o*S+s*O,x=i*m+u*S+c*O,v=a*m+E*S+_*O,D=r*M+o*y+s*p+T,B=i*M+u*y+c*p+R,z=a*M+E*y+_*p+l;return n[0]=C,n[1]=U,n[2]=L,n[3]=0,n[4]=F,n[5]=P,n[6]=w,n[7]=0,n[8]=g,n[9]=x,n[10]=v,n[11]=0,n[12]=D,n[13]=B,n[14]=z,n[15]=1,n},_.multiplyByMatrix3=function(t,e,n){var r=t[0],i=t[1],a=t[2],o=t[4],u=t[5],E=t[6],s=t[8],c=t[9],_=t[10],T=e[0],R=e[1],l=e[2],A=e[3],f=e[4],h=e[5],N=e[6],d=e[7],I=e[8],m=r*T+o*R+s*l,S=i*T+u*R+c*l,O=a*T+E*R+_*l,M=r*A+o*f+s*h,y=i*A+u*f+c*h,p=a*A+E*f+_*h,C=r*N+o*d+s*I,U=i*N+u*d+c*I,L=a*N+E*d+_*I;return n[0]=m,n[1]=S,n[2]=O,n[3]=0,n[4]=M,n[5]=y,n[6]=p,n[7]=0,n[8]=C,n[9]=U,n[10]=L,n[11]=0,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n},_.multiplyByTranslation=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=r*t[0]+i*t[4]+a*t[8]+t[12],u=r*t[1]+i*t[5]+a*t[9]+t[13],E=r*t[2]+i*t[6]+a*t[10]+t[14];return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=o,n[13]=u,n[14]=E,n[15]=t[15],n};var h=new t;_.multiplyByUniformScale=function(t,e,n){return h.x=e,h.y=e,h.z=e,_.multiplyByScale(t,h,n)},_.multiplyByScale=function(t,e,n){var r=e.x,i=e.y,a=e.z;return 1===r&&1===i&&1===a?_.clone(t,n):(n[0]=r*t[0],n[1]=r*t[1],n[2]=r*t[2],n[3]=0,n[4]=i*t[4],n[5]=i*t[5],n[6]=i*t[6],n[7]=0,n[8]=a*t[8],n[9]=a*t[9],n[10]=a*t[10],n[11]=0,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=1,n)},_.multiplyByVector=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=e.w,u=t[0]*r+t[4]*i+t[8]*a+t[12]*o,E=t[1]*r+t[5]*i+t[9]*a+t[13]*o,s=t[2]*r+t[6]*i+t[10]*a+t[14]*o,c=t[3]*r+t[7]*i+t[11]*a+t[15]*o;return n.x=u,n.y=E,n.z=s,n.w=c,n},_.multiplyByPointAsVector=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=t[0]*r+t[4]*i+t[8]*a,u=t[1]*r+t[5]*i+t[9]*a,E=t[2]*r+t[6]*i+t[10]*a;return n.x=o,n.y=u,n.z=E,n},_.multiplyByPoint=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=t[0]*r+t[4]*i+t[8]*a+t[12],u=t[1]*r+t[5]*i+t[9]*a+t[13],E=t[2]*r+t[6]*i+t[10]*a+t[14];return n.x=o,n.y=u,n.z=E,n},_.multiplyByScalar=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n[4]=t[4]*e,n[5]=t[5]*e,n[6]=t[6]*e,n[7]=t[7]*e,n[8]=t[8]*e,n[9]=t[9]*e,n[10]=t[10]*e,n[11]=t[11]*e,n[12]=t[12]*e,n[13]=t[13]*e,n[14]=t[14]*e,n[15]=t[15]*e,n},_.negate=function(t,e){return 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],e},_.transpose=function(t,e){var n=t[1],r=t[2],i=t[3],a=t[6],o=t[7],u=t[11];return e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=r,e[9]=a,e[10]=t[10],e[11]=t[14],e[12]=i,e[13]=o,e[14]=u,e[15]=t[15],e},_.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e[9]=Math.abs(t[9]),e[10]=Math.abs(t[10]),e[11]=Math.abs(t[11]),e[12]=Math.abs(t[12]),e[13]=Math.abs(t[13]),e[14]=Math.abs(t[14]),e[15]=Math.abs(t[15]),e},_.equals=function(t,e){return t===e||i(t)&&i(e)&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[3]===e[3]&&t[7]===e[7]&&t[11]===e[11]&&t[15]===e[15]},_.equalsEpsilon=function(t,e,n){return t===e||i(t)&&i(e)&&Math.abs(t[0]-e[0])<=n&&Math.abs(t[1]-e[1])<=n&&Math.abs(t[2]-e[2])<=n&&Math.abs(t[3]-e[3])<=n&&Math.abs(t[4]-e[4])<=n&&Math.abs(t[5]-e[5])<=n&&Math.abs(t[6]-e[6])<=n&&Math.abs(t[7]-e[7])<=n&&Math.abs(t[8]-e[8])<=n&&Math.abs(t[9]-e[9])<=n&&Math.abs(t[10]-e[10])<=n&&Math.abs(t[11]-e[11])<=n&&Math.abs(t[12]-e[12])<=n&&Math.abs(t[13]-e[13])<=n&&Math.abs(t[14]-e[14])<=n&&Math.abs(t[15]-e[15])<=n},_.getTranslation=function(t,e){return e.x=t[12],e.y=t[13],e.z=t[14],e},_.getRotation=function(t,e){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e};var N=new s,d=new s,I=new e,m=new e(0,0,0,1);return _.inverse=function(t,n){if(s.equalsEpsilon(_.getRotation(t,N),d,E.EPSILON7)&&e.equals(_.getRow(t,3,I),m))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-t[12],n[13]=-t[13],n[14]=-t[14],n[15]=1,n;var r=t[0],i=t[4],a=t[8],o=t[12],u=t[1],T=t[5],R=t[9],l=t[13],A=t[2],f=t[6],h=t[10],S=t[14],O=t[3],M=t[7],y=t[11],p=t[15],C=h*p,U=S*y,L=f*p,F=S*M,P=f*y,w=h*M,g=A*p,x=S*O,v=A*y,D=h*O,B=A*M,z=f*O,G=C*T+F*R+P*l-(U*T+L*R+w*l),b=U*u+g*R+D*l-(C*u+x*R+v*l),X=L*u+x*T+B*l-(F*u+g*T+z*l),V=w*u+v*T+z*R-(P*u+D*T+B*R),q=U*i+L*a+w*o-(C*i+F*a+P*o),H=C*r+x*a+v*o-(U*r+g*a+D*o),W=F*r+g*i+z*o-(L*r+x*i+B*o),Y=P*r+D*i+B*a-(w*r+v*i+z*a);C=a*l,U=o*R,L=i*l,F=o*T,P=i*R,w=a*T,g=r*l,x=o*u,v=r*R,D=a*u,B=r*T,z=i*u;var k=C*M+F*y+P*p-(U*M+L*y+w*p),K=U*O+g*y+D*p-(C*O+x*y+v*p),Z=L*O+x*M+B*p-(F*O+g*M+z*p),j=w*O+v*M+z*y-(P*O+D*M+B*y),Q=L*h+w*S+U*f-(P*S+C*f+F*h),J=v*S+C*A+x*h-(g*h+D*S+U*A),$=g*f+z*S+F*A-(B*S+L*A+x*f),tt=B*h+P*A+D*f-(v*f+z*h+w*A),et=r*G+i*b+a*X+o*V;if(Math.abs(et)<E.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return et=1/et,n[0]=G*et,n[1]=b*et,n[2]=X*et,n[3]=V*et,n[4]=q*et,n[5]=H*et,n[6]=W*et,n[7]=Y*et,n[8]=k*et,n[9]=K*et,n[10]=Z*et,n[11]=j*et,n[12]=Q*et,n[13]=J*et,n[14]=$*et,n[15]=tt*et,n},_.inverseTransformation=function(t,e){var n=t[0],r=t[1],i=t[2],a=t[4],o=t[5],u=t[6],E=t[8],s=t[9],c=t[10],_=t[12],T=t[13],R=t[14],l=-n*_-r*T-i*R,A=-a*_-o*T-u*R,f=-E*_-s*T-c*R;return e[0]=n,e[1]=a,e[2]=E,e[3]=0,e[4]=r,e[5]=o,e[6]=s,e[7]=0,e[8]=i,e[9]=u,e[10]=c,e[11]=0,e[12]=l,e[13]=A,e[14]=f,e[15]=1,e},_.IDENTITY=u(new _(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),_.ZERO=u(new _(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),_.COLUMN0ROW0=0,_.COLUMN0ROW1=1,_.COLUMN0ROW2=2,_.COLUMN0ROW3=3,_.COLUMN1ROW0=4,_.COLUMN1ROW1=5,_.COLUMN1ROW2=6,_.COLUMN1ROW3=7,_.COLUMN2ROW0=8,_.COLUMN2ROW1=9,_.COLUMN2ROW2=10,_.COLUMN2ROW3=11,_.COLUMN3ROW0=12,_.COLUMN3ROW1=13,_.COLUMN3ROW2=14,_.COLUMN3ROW3=15,a(_.prototype,{length:{get:function(){return _.packedLength}}}),_.prototype.clone=function(t){return _.clone(this,t)},_.prototype.equals=function(t){return _.equals(this,t)},_.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]&&t[4]===e[n+4]&&t[5]===e[n+5]&&t[6]===e[n+6]&&t[7]===e[n+7]&&t[8]===e[n+8]&&t[9]===e[n+9]&&t[10]===e[n+10]&&t[11]===e[n+11]&&t[12]===e[n+12]&&t[13]===e[n+13]&&t[14]===e[n+14]&&t[15]===e[n+15]},_.prototype.equalsEpsilon=function(t,e){return _.equalsEpsilon(this,t,e)},_.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]+")"},_}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(t,e,n,r,i,a,o,u,E){"use strict";function s(t,e,r,i){this.west=n(t,0),this.south=n(e,0),this.east=n(r,0),this.north=n(i,0)}i(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(t,e,r){return r=n(r,0),e[r++]=t.west,e[r++]=t.south,e[r++]=t.east,e[r]=t.north,e},s.unpack=function(t,e,i){return e=n(e,0),r(i)||(i=new s),i.west=t[e++],i.south=t[e++],i.east=t[e++],i.north=t[e],i},s.computeWidth=function(t){var e=t.east,n=t.west;return e<n&&(e+=E.TWO_PI),e-n},s.computeHeight=function(t){return t.north-t.south},s.fromDegrees=function(t,e,i,a,o){return t=E.toRadians(n(t,0)),e=E.toRadians(n(e,0)),i=E.toRadians(n(i,0)),a=E.toRadians(n(a,0)),r(o)?(o.west=t,o.south=e,o.east=i,o.north=a,o):new s(t,e,i,a)},s.fromRadians=function(t,e,i,a,o){return r(o)?(o.west=n(t,0),o.south=n(e,0),o.east=n(i,0),o.north=n(a,0),o):new s(t,e,i,a)},s.fromCartographicArray=function(t,e){for(var n=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,u=Number.MAX_VALUE,c=-Number.MAX_VALUE,_=0,T=t.length;_<T;_++){var R=t[_];n=Math.min(n,R.longitude),i=Math.max(i,R.longitude),u=Math.min(u,R.latitude),c=Math.max(c,R.latitude);var l=R.longitude>=0?R.longitude:R.longitude+E.TWO_PI;a=Math.min(a,l),o=Math.max(o,l)}return i-n>o-a&&(n=a,i=o,i>E.PI&&(i-=E.TWO_PI),n>E.PI&&(n-=E.TWO_PI)),r(e)?(e.west=n,e.south=u,e.east=i,e.north=c,e):new s(n,u,i,c)},s.fromCartesianArray=function(t,e,n){for(var i=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,u=-Number.MAX_VALUE,c=Number.MAX_VALUE,_=-Number.MAX_VALUE,T=0,R=t.length;T<R;T++){var l=e.cartesianToCartographic(t[T]);i=Math.min(i,l.longitude),a=Math.max(a,l.longitude),c=Math.min(c,l.latitude),_=Math.max(_,l.latitude);var A=l.longitude>=0?l.longitude:l.longitude+E.TWO_PI;o=Math.min(o,A),u=Math.max(u,A)}return a-i>u-o&&(i=o,a=u,a>E.PI&&(a-=E.TWO_PI),i>E.PI&&(i-=E.TWO_PI)),r(n)?(n.west=i,n.south=c,n.east=a,n.north=_,n):new s(i,c,a,_)},s.clone=function(t,e){if(r(t))return r(e)?(e.west=t.west,e.south=t.south,e.east=t.east,e.north=t.north,e):new s(t.west,t.south,t.east,t.north)},s.prototype.clone=function(t){return s.clone(this,t)},s.prototype.equals=function(t){return s.equals(this,t)},s.equals=function(t,e){return t===e||r(t)&&r(e)&&t.west===e.west&&t.south===e.south&&t.east===e.east&&t.north===e.north},s.prototype.equalsEpsilon=function(t,e){return r(t)&&Math.abs(this.west-t.west)<=e&&Math.abs(this.south-t.south)<=e&&Math.abs(this.east-t.east)<=e&&Math.abs(this.north-t.north)<=e},s.validate=function(t){},s.southwest=function(e,n){return r(n)?(n.longitude=e.west,n.latitude=e.south,n.height=0,n):new t(e.west,e.south)},s.northwest=function(e,n){return r(n)?(n.longitude=e.west,n.latitude=e.north,n.height=0,n):new t(e.west,e.north)},s.northeast=function(e,n){return r(n)?(n.longitude=e.east,n.latitude=e.north,n.height=0,n):new t(e.east,e.north)},s.southeast=function(e,n){return r(n)?(n.longitude=e.east,n.latitude=e.south,n.height=0,n):new t(e.east,e.south)},s.center=function(e,n){var i=e.east,a=e.west;i<a&&(i+=E.TWO_PI);var o=E.negativePiToPi(.5*(a+i)),u=.5*(e.south+e.north);return r(n)?(n.longitude=o,n.latitude=u,n.height=0,n):new t(o,u)},s.intersection=function(t,e,n){var i=t.east,a=t.west,o=e.east,u=e.west;i<a&&o>0?i+=E.TWO_PI:o<u&&i>0&&(o+=E.TWO_PI),i<a&&u<0?u+=E.TWO_PI:o<u&&a<0&&(a+=E.TWO_PI);var c=E.negativePiToPi(Math.max(a,u)),_=E.negativePiToPi(Math.min(i,o));if(!((t.west<t.east||e.west<e.east)&&_<=c)){var T=Math.max(t.south,e.south),R=Math.min(t.north,e.north);if(!(T>=R))return r(n)?(n.west=c,n.south=T,n.east=_,n.north=R,n):new s(c,T,_,R)}},s.simpleIntersection=function(t,e,n){var i=Math.max(t.west,e.west),a=Math.max(t.south,e.south),o=Math.min(t.east,e.east),u=Math.min(t.north,e.north);if(!(a>=u||i>=o))return r(n)?(n.west=i,n.south=a,n.east=o,n.north=u,n):new s(i,a,o,u)},s.union=function(t,e,n){r(n)||(n=new s);var i=t.east,a=t.west,o=e.east,u=e.west;i<a&&o>0?i+=E.TWO_PI:o<u&&i>0&&(o+=E.TWO_PI),i<a&&u<0?u+=E.TWO_PI:o<u&&a<0&&(a+=E.TWO_PI);var c=E.convertLongitudeRange(Math.min(a,u)),_=E.convertLongitudeRange(Math.max(i,o));return n.west=c,n.south=Math.min(t.south,e.south),n.east=_,n.north=Math.max(t.north,e.north),n},s.expand=function(t,e,n){return r(n)||(n=new s),n.west=Math.min(t.west,e.longitude),n.south=Math.min(t.south,e.latitude),n.east=Math.max(t.east,e.longitude),n.north=Math.max(t.north,e.latitude),n},s.contains=function(t,e){var n=e.longitude,r=e.latitude,i=t.west,a=t.east;return a<i&&(a+=E.TWO_PI,n<0&&(n+=E.TWO_PI)),(n>i||E.equalsEpsilon(n,i,E.EPSILON14))&&(n<a||E.equalsEpsilon(n,a,E.EPSILON14))&&r>=t.south&&r<=t.north};var c=new t;return s.subsample=function(t,e,i,a){e=n(e,o.WGS84),i=n(i,0),r(a)||(a=[]);var u=0,_=t.north,T=t.south,R=t.east,l=t.west,A=c;A.height=i,A.longitude=l,A.latitude=_,a[u]=e.cartographicToCartesian(A,a[u]),u++,A.longitude=R,a[u]=e.cartographicToCartesian(A,a[u]),u++,A.latitude=T,a[u]=e.cartographicToCartesian(A,a[u]),u++,A.longitude=l,a[u]=e.cartographicToCartesian(A,a[u]),u++,_<0?A.latitude=_:T>0?A.latitude=T:A.latitude=0;for(var f=1;f<8;++f)A.longitude=-Math.PI+f*E.PI_OVER_TWO,s.contains(t,A)&&(a[u]=e.cartographicToCartesian(A,a[u]),u++);return 0===A.latitude&&(A.longitude=l,a[u]=e.cartographicToCartesian(A,a[u]),u++,A.longitude=R,a[u]=e.cartographicToCartesian(A,a[u]),u++),a.length=u,a},s.MAX_VALUE=u(new s(-Math.PI,-E.PI_OVER_TWO,Math.PI,E.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(t,e,n,r,i,a,o,u,E,s,c,_){"use strict";function T(e,n){this.center=t.clone(r(e,t.ZERO)),this.radius=r(n,0)}var R=new t,l=new t,A=new t,f=new t,h=new t,N=new t,d=new t,I=new t,m=new t,S=new t,O=new t,M=new t;T.fromPoints=function(e,n){if(i(n)||(n=new T),!i(e)||0===e.length)return n.center=t.clone(t.ZERO,n.center),n.radius=0,n;for(var r=t.clone(e[0],d),a=t.clone(r,R),o=t.clone(r,l),u=t.clone(r,A),E=t.clone(r,f),s=t.clone(r,h),c=t.clone(r,N),_=e.length,y=1;y<_;y++){t.clone(e[y],r);var p=r.x,C=r.y,U=r.z;p<a.x&&t.clone(r,a),p>E.x&&t.clone(r,E),C<o.y&&t.clone(r,o),C>s.y&&t.clone(r,s),U<u.z&&t.clone(r,u),U>c.z&&t.clone(r,c)}var L=t.magnitudeSquared(t.subtract(E,a,I)),F=t.magnitudeSquared(t.subtract(s,o,I)),P=t.magnitudeSquared(t.subtract(c,u,I)),w=a,g=E,x=L;F>x&&(x=F,w=o,g=s),P>x&&(x=P,w=u,g=c);var v=m;v.x=.5*(w.x+g.x),v.y=.5*(w.y+g.y),v.z=.5*(w.z+g.z);var D=t.magnitudeSquared(t.subtract(g,v,I)),B=Math.sqrt(D),z=S;z.x=a.x,z.y=o.y,z.z=u.z;var G=O;G.x=E.x,G.y=s.y,G.z=c.z;var b=t.multiplyByScalar(t.add(z,G,I),.5,M),X=0;for(y=0;y<_;y++){t.clone(e[y],r);var V=t.magnitude(t.subtract(r,b,I));V>X&&(X=V);var q=t.magnitudeSquared(t.subtract(r,v,I));if(q>D){var H=Math.sqrt(q);B=.5*(B+H),D=B*B;var W=H-B;v.x=(B*v.x+W*r.x)/H,v.y=(B*v.y+W*r.y)/H,v.z=(B*v.z+W*r.z)/H}}return B<X?(t.clone(v,n.center),n.radius=B):(t.clone(b,n.center),n.radius=X),n};var y=new o,p=new t,C=new t,U=new e,L=new e;T.fromRectangle2D=function(t,e,n){return T.fromRectangleWithHeights2D(t,e,0,0,n)},T.fromRectangleWithHeights2D=function(e,n,a,o,u){if(i(u)||(u=new T),!i(e))return u.center=t.clone(t.ZERO,u.center),u.radius=0,u;n=r(n,y),_.southwest(e,U),U.height=a,_.northeast(e,L),L.height=o;var E=n.project(U,p),s=n.project(L,C),c=s.x-E.x,R=s.y-E.y,l=s.z-E.z;u.radius=.5*Math.sqrt(c*c+R*R+l*l);var A=u.center;return A.x=E.x+.5*c,A.y=E.y+.5*R,A.z=E.z+.5*l,u};var F=[];T.fromRectangle3D=function(t,e,n,o){e=r(e,a.WGS84),n=r(n,0);var u;return i(t)&&(u=_.subsample(t,e,n,F)),T.fromPoints(u,o)},T.fromVertices=function(e,n,a,o){if(i(o)||(o=new T),!i(e)||0===e.length)return o.center=t.clone(t.ZERO,o.center),o.radius=0,o;n=r(n,t.ZERO),a=r(a,3);var u=d;u.x=e[0]+n.x,u.y=e[1]+n.y,u.z=e[2]+n.z;for(var E=t.clone(u,R),s=t.clone(u,l),c=t.clone(u,A),_=t.clone(u,f),y=t.clone(u,h),p=t.clone(u,N),C=e.length,U=0;U<C;U+=a){var L=e[U]+n.x,F=e[U+1]+n.y,P=e[U+2]+n.z;u.x=L,u.y=F,u.z=P,L<E.x&&t.clone(u,E),L>_.x&&t.clone(u,_),F<s.y&&t.clone(u,s),F>y.y&&t.clone(u,y),P<c.z&&t.clone(u,c),P>p.z&&t.clone(u,p)}var w=t.magnitudeSquared(t.subtract(_,E,I)),g=t.magnitudeSquared(t.subtract(y,s,I)),x=t.magnitudeSquared(t.subtract(p,c,I)),v=E,D=_,B=w;g>B&&(B=g,v=s,D=y),x>B&&(B=x,v=c,D=p);var z=m;z.x=.5*(v.x+D.x),z.y=.5*(v.y+D.y),z.z=.5*(v.z+D.z);var G=t.magnitudeSquared(t.subtract(D,z,I)),b=Math.sqrt(G),X=S;X.x=E.x,X.y=s.y,X.z=c.z;var V=O;V.x=_.x,V.y=y.y,V.z=p.z;var q=t.multiplyByScalar(t.add(X,V,I),.5,M),H=0;for(U=0;U<C;U+=a){u.x=e[U]+n.x,u.y=e[U+1]+n.y,u.z=e[U+2]+n.z;var W=t.magnitude(t.subtract(u,q,I));W>H&&(H=W);var Y=t.magnitudeSquared(t.subtract(u,z,I));if(Y>G){var k=Math.sqrt(Y);b=.5*(b+k),G=b*b;var K=k-b;z.x=(b*z.x+K*u.x)/k,z.y=(b*z.y+K*u.y)/k,z.z=(b*z.z+K*u.z)/k}}return b<H?(t.clone(z,o.center),o.radius=b):(t.clone(q,o.center),o.radius=H),o},T.fromEncodedCartesianVertices=function(e,n,r){if(i(r)||(r=new T),!i(e)||!i(n)||e.length!==n.length||0===e.length)return r.center=t.clone(t.ZERO,r.center),r.radius=0,r;var a=d;a.x=e[0]+n[0],a.y=e[1]+n[1],a.z=e[2]+n[2];for(var o=t.clone(a,R),u=t.clone(a,l),E=t.clone(a,A),s=t.clone(a,f),c=t.clone(a,h),_=t.clone(a,N),y=e.length,p=0;p<y;p+=3){var C=e[p]+n[p],U=e[p+1]+n[p+1],L=e[p+2]+n[p+2];a.x=C,a.y=U,a.z=L,C<o.x&&t.clone(a,o),C>s.x&&t.clone(a,s),U<u.y&&t.clone(a,u),U>c.y&&t.clone(a,c),L<E.z&&t.clone(a,E),L>_.z&&t.clone(a,_)}var F=t.magnitudeSquared(t.subtract(s,o,I)),P=t.magnitudeSquared(t.subtract(c,u,I)),w=t.magnitudeSquared(t.subtract(_,E,I)),g=o,x=s,v=F;P>v&&(v=P,g=u,x=c),w>v&&(v=w,g=E,x=_);var D=m;D.x=.5*(g.x+x.x),D.y=.5*(g.y+x.y),D.z=.5*(g.z+x.z);var B=t.magnitudeSquared(t.subtract(x,D,I)),z=Math.sqrt(B),G=S;G.x=o.x,G.y=u.y,G.z=E.z;var b=O;b.x=s.x,b.y=c.y,b.z=_.z;var X=t.multiplyByScalar(t.add(G,b,I),.5,M),V=0;for(p=0;p<y;p+=3){a.x=e[p]+n[p],a.y=e[p+1]+n[p+1],a.z=e[p+2]+n[p+2];var q=t.magnitude(t.subtract(a,X,I));q>V&&(V=q);var H=t.magnitudeSquared(t.subtract(a,D,I));if(H>B){var W=Math.sqrt(H);z=.5*(z+W),B=z*z;var Y=W-z;D.x=(z*D.x+Y*a.x)/W,D.y=(z*D.y+Y*a.y)/W,D.z=(z*D.z+Y*a.z)/W}}return z<V?(t.clone(D,r.center),r.radius=z):(t.clone(X,r.center),r.radius=V),r},T.fromCornerPoints=function(e,n,r){i(r)||(r=new T);var a=r.center;return t.add(e,n,a),t.multiplyByScalar(a,.5,a),r.radius=t.distance(a,n),r},T.fromEllipsoid=function(e,n){return i(n)||(n=new T),t.clone(t.ZERO,n.center),n.radius=e.maximumRadius,n};var P=new t;T.fromBoundingSpheres=function(e,n){if(i(n)||(n=new T),!i(e)||0===e.length)return n.center=t.clone(t.ZERO,n.center),n.radius=0,n;var r=e.length;if(1===r)return T.clone(e[0],n);if(2===r)return T.union(e[0],e[1],n);for(var a=[],o=0;o<r;o++)a.push(e[o].center);n=T.fromPoints(a,n);var u=n.center,E=n.radius;for(o=0;o<r;o++){var s=e[o];E=Math.max(E,t.distance(u,s.center,P)+s.radius)}return n.radius=E,n};var w=new t,g=new t,x=new t;T.fromOrientedBoundingBox=function(e,n){i(n)||(n=new T);var r=e.halfAxes,a=s.getColumn(r,0,w),o=s.getColumn(r,1,g),u=s.getColumn(r,2,x),E=t.magnitude(a),c=t.magnitude(o),_=t.magnitude(u);return n.center=t.clone(e.center,n.center),n.radius=Math.max(E,c,_),n},T.clone=function(e,n){if(i(e))return i(n)?(n.center=t.clone(e.center,n.center),n.radius=e.radius,n):new T(e.center,e.radius)},T.packedLength=4,T.pack=function(t,e,n){n=r(n,0);var i=t.center;return e[n++]=i.x,e[n++]=i.y,e[n++]=i.z,e[n]=t.radius,e},T.unpack=function(t,e,n){e=r(e,0),i(n)||(n=new T);var a=n.center;return a.x=t[e++],a.y=t[e++],a.z=t[e++],n.radius=t[e],n};var v=new t,D=new t;T.union=function(e,n,r){i(r)||(r=new T);var a=e.center,o=e.radius,u=n.center,E=n.radius,s=t.subtract(u,a,v),c=t.magnitude(s);if(o>=c+E)return e.clone(r),r;if(E>=c+o)return n.clone(r),r;var _=.5*(o+c+E),R=t.multiplyByScalar(s,(-o+_)/c,D);return t.add(R,a,R),t.clone(R,r.center),r.radius=_,r};var B=new t;T.expand=function(e,n,r){r=T.clone(e,r);var i=t.magnitude(t.subtract(n,r.center,B));return i>r.radius&&(r.radius=i),r},T.intersectPlane=function(e,n){var r=e.center,i=e.radius,a=n.normal,o=t.dot(a,r)+n.distance;return o<-i?u.OUTSIDE:o<i?u.INTERSECTING:u.INSIDE},T.transform=function(t,e,n){return i(n)||(n=new T),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=c.getMaximumScale(e)*t.radius,n};var z=new t;T.distanceSquaredTo=function(e,n){var r=t.subtract(e.center,n,z);return t.magnitudeSquared(r)-e.radius*e.radius},T.transformWithoutScale=function(t,e,n){return i(n)||(n=new T),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=t.radius,n};var G=new t;T.computePlaneDistances=function(e,n,r,a){i(a)||(a=new E);var o=t.subtract(e.center,n,G),u=t.dot(r,o);return a.start=u-e.radius,a.stop=u+e.radius,a};for(var b=new t,X=new t,V=new t,q=new t,H=new t,W=new e,Y=new Array(8),k=0;k<8;++k)Y[k]=new t;var K=new o;return T.projectTo2D=function(e,n,i){n=r(n,K);var a=n.ellipsoid,o=e.center,u=e.radius,E=a.geodeticSurfaceNormal(o,b),s=t.cross(t.UNIT_Z,E,X);t.normalize(s,s);var c=t.cross(E,s,V);t.normalize(c,c),t.multiplyByScalar(E,u,E),t.multiplyByScalar(c,u,c),t.multiplyByScalar(s,u,s);var _=t.negate(c,H),R=t.negate(s,q),l=Y,A=l[0];t.add(E,c,A),t.add(A,s,A),A=l[1],t.add(E,c,A),t.add(A,R,A),A=l[2],t.add(E,_,A),t.add(A,R,A),A=l[3],t.add(E,_,A),t.add(A,s,A),t.negate(E,E),A=l[4],t.add(E,c,A),t.add(A,s,A),A=l[5],t.add(E,c,A),t.add(A,R,A),A=l[6],t.add(E,_,A),t.add(A,R,A),A=l[7],t.add(E,_,A),t.add(A,s,A);for(var f=l.length,h=0;h<f;++h){var N=l[h];t.add(o,N,N);var d=a.cartesianToCartographic(N,W);n.project(d,N)}i=T.fromPoints(l,i),o=i.center;var I=o.x,m=o.y,S=o.z;return o.x=S,o.y=I,o.z=m,i},T.isOccluded=function(t,e){return!e.isBoundingSphereVisible(t)},T.equals=function(e,n){return e===n||i(e)&&i(n)&&t.equals(e.center,n.center)&&e.radius===n.radius},T.prototype.intersectPlane=function(t){return T.intersectPlane(this,t)},T.prototype.distanceSquaredTo=function(t){return T.distanceSquaredTo(this,t)},T.prototype.computePlaneDistances=function(t,e,n){return T.computePlaneDistances(this,t,e,n)},T.prototype.isOccluded=function(t){return T.isOccluded(this,t)},T.prototype.equals=function(t){return T.equals(this,t)},T.prototype.clone=function(t){return T.clone(this,t)},T}),define("Core/Fullscreen",["./defined","./defineProperties"],function(t,e){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},i={};return e(i,{element:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(i.supportsFullscreen())return null!==i.element}}}),i.supportsFullscreen=function(){if(t(n))return n;n=!1;var e=document.body;if("function"==typeof e.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var i,a=["webkit","moz","o","ms","khtml"],o=0,u=a.length;o<u;++o){var E=a[o];i=E+"RequestFullscreen","function"==typeof e[i]?(r.requestFullscreen=i,n=!0):(i=E+"RequestFullScreen","function"==typeof e[i]&&(r.requestFullscreen=i,n=!0)),i=E+"ExitFullscreen","function"==typeof document[i]?r.exitFullscreen=i:(i=E+"CancelFullScreen","function"==typeof document[i]&&(r.exitFullscreen=i)),i=E+"FullscreenEnabled",void 0!==document[i]?r.fullscreenEnabled=i:(i=E+"FullScreenEnabled",void 0!==document[i]&&(r.fullscreenEnabled=i)),i=E+"FullscreenElement",void 0!==document[i]?r.fullscreenElement=i:(i=E+"FullScreenElement",void 0!==document[i]&&(r.fullscreenElement=i)),i=E+"fullscreenchange",void 0!==document["on"+i]&&("ms"===E&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=E+"fullscreenerror",void 0!==document["on"+i]&&("ms"===E&&(i="MSFullscreenError"),r.fullscreenerror=i)}return n},i.requestFullscreen=function(t,e){i.supportsFullscreen()&&t[r.requestFullscreen]({vrDisplay:e})},i.exitFullscreen=function(){i.supportsFullscreen()&&document[r.exitFullscreen]()},i}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(t,e,n){"use strict";function r(t){for(var e=t.split("."),n=0,r=e.length;n<r;++n)e[n]=parseInt(e[n],10);return e}function i(){if(!e(m)&&(m=!1,!T())){var t=/ Chrome\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(m=!0,S=r(t[1]))}return m}function a(){return i()&&S}function o(){if(!e(O)&&(O=!1,!i()&&!T()&&/ Safari\/[\.0-9]+/.test(I.userAgent))){var t=/ Version\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(O=!0,M=r(t[1]))}return O}function u(){return o()&&M}function E(){if(!e(y)){y=!1;var t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(I.userAgent);null!==t&&(y=!0,p=r(t[1]),p.isNightly=!!t[2])}return y}function s(){return E()&&p}function c(){if(!e(C)){C=!1;var t;"Microsoft Internet Explorer"===I.appName?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==t&&(C=!0,U=r(t[1]))):"Netscape"===I.appName&&(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==t&&(C=!0,U=r(t[1])))}return C}function _(){return c()&&U}function T(){if(!e(L)){L=!1;var t=/ Edge\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(L=!0,F=r(t[1]))}return L}function R(){return T()&&F}function l(){if(!e(P)){P=!1;var t=/Firefox\/([\.0-9]+)/.exec(I.userAgent); +null!==t&&(P=!0,w=r(t[1]))}return P}function A(){return e(g)||(g=/Windows/i.test(I.appVersion)),g}function f(){return l()&&w}function h(){return e(x)||(x="undefined"!=typeof PointerEvent&&(!e(I.pointerEnabled)||I.pointerEnabled)),x}function N(){if(!e(D)){var t=document.createElement("canvas");t.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=t.style.imageRendering;D=e(n)&&""!==n,D&&(v=n)}return D}function d(){return N()?v:void 0}var I;I="undefined"!=typeof navigator?navigator:{};var m,S,O,M,y,p,C,U,L,F,P,w,g,x,v,D,B={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:E,webkitVersion:s,isInternetExplorer:c,internetExplorerVersion:_,isEdge:T,edgeVersion:R,isFirefox:l,firefoxVersion:f,isWindows:A,hardwareConcurrency:t(I.hardwareConcurrency,3),supportsPointerEvents:h,supportsImageRenderingPixelated:N,imageRenderingValue:d};return B.supportsFullscreen=function(){return n.supportsFullscreen()},B.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},B.supportsWebWorkers=function(){return"undefined"!=typeof Worker},B}),define("Core/WebGLConstants",["./freezeObject"],function(t){"use strict";var e={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047};return t(e)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(t,e,n,r,i,a){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:a.BYTE,UNSIGNED_BYTE:a.UNSIGNED_BYTE,SHORT:a.SHORT,UNSIGNED_SHORT:a.UNSIGNED_SHORT,INT:a.INT,UNSIGNED_INT:a.UNSIGNED_INT,FLOAT:a.FLOAT,DOUBLE:a.DOUBLE};return o.getSizeInBytes=function(t){switch(t){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.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(t){return t instanceof Int8Array?o.BYTE:t instanceof Uint8Array?o.UNSIGNED_BYTE:t instanceof Int16Array?o.SHORT:t instanceof Uint16Array?o.UNSIGNED_SHORT:t instanceof Int32Array?o.INT:t instanceof Uint32Array?o.UNSIGNED_INT:t instanceof Float32Array?o.FLOAT:t instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(t){return e(t)&&(t===o.BYTE||t===o.UNSIGNED_BYTE||t===o.SHORT||t===o.UNSIGNED_SHORT||t===o.INT||t===o.UNSIGNED_INT||t===o.FLOAT||t===o.DOUBLE)},o.createTypedArray=function(t,e){switch(t){case o.BYTE:return new Int8Array(e);case o.UNSIGNED_BYTE:return new Uint8Array(e);case o.SHORT:return new Int16Array(e);case o.UNSIGNED_SHORT:return new Uint16Array(e);case o.INT:return new Int32Array(e);case o.UNSIGNED_INT:return new Uint32Array(e);case o.FLOAT:return new Float32Array(e);case o.DOUBLE:return new Float64Array(e)}},o.createArrayBufferView=function(e,n,r,i){switch(r=t(r,0),i=t(i,(n.byteLength-r)/o.getSizeInBytes(e)),e){case o.BYTE:return new Int8Array(n,r,i);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,i);case o.SHORT:return new Int16Array(n,r,i);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,i);case o.INT:return new Int32Array(n,r,i);case o.UNSIGNED_INT:return new Uint32Array(n,r,i);case o.FLOAT:return new Float32Array(n,r,i);case o.DOUBLE:return new Float64Array(n,r,i)}},o.fromName=function(t){switch(t){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},i(o)}),define("Core/GeometryType",["./freezeObject"],function(t){"use strict";var e={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return t(e)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(t,e){"use strict";var n={POINTS:e.POINTS,LINES:e.LINES,LINE_LOOP:e.LINE_LOOP,LINE_STRIP:e.LINE_STRIP,TRIANGLES:e.TRIANGLES,TRIANGLE_STRIP:e.TRIANGLE_STRIP,TRIANGLE_FAN:e.TRIANGLE_FAN,validate:function(t){return t===n.POINTS||t===n.LINES||t===n.LINE_LOOP||t===n.LINE_STRIP||t===n.TRIANGLES||t===n.TRIANGLE_STRIP||t===n.TRIANGLE_FAN}};return t(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(t,e,n,r,i){"use strict";function a(e){e=t(e,t.EMPTY_OBJECT),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=t(e.primitiveType,i.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=t(e.geometryType,r.NONE),this.boundingSphereCV=e.boundingSphereCV}return a.computeNumberOfVertices=function(t){var n=-1;for(var r in t.attributes)if(t.attributes.hasOwnProperty(r)&&e(t.attributes[r])&&e(t.attributes[r].values)){var i=t.attributes[r],a=i.values.length/i.componentsPerAttribute;n=a}return n},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(t,e,n){"use strict";function r(e){e=t(e,t.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=t(e.normalize,!1),this.values=e.values}return r}),define("Core/GeometryAttributes",["./defaultValue"],function(t){"use strict";function e(e){e=t(e,t.EMPTY_OBJECT),this.position=e.position,this.normal=e.normal,this.st=e.st,this.bitangent=e.bitangent,this.tangent=e.tangent,this.color=e.color}return e}),define("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(t,e,n,r){"use strict";function i(e){e=t(e,t.EMPTY_OBJECT),this.position=t(e.position,!1),this.normal=t(e.normal,!1),this.st=t(e.st,!1),this.bitangent=t(e.bitangent,!1),this.tangent=t(e.tangent,!1),this.color=t(e.color,!1)}return i.POSITION_ONLY=r(new i({position:!0})),i.POSITION_AND_NORMAL=r(new i({position:!0,normal:!0})),i.POSITION_NORMAL_AND_ST=r(new i({position:!0,normal:!0,st:!0})),i.POSITION_AND_ST=r(new i({position:!0,st:!0})),i.POSITION_AND_COLOR=r(new i({position:!0,color:!0})),i.ALL=r(new i({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0})),i.DEFAULT=i.POSITION_NORMAL_AND_ST,i.packedLength=6,i.pack=function(e,n,r){return r=t(r,0),n[r++]=e.position?1:0,n[r++]=e.normal?1:0,n[r++]=e.st?1:0,n[r++]=e.tangent?1:0,n[r++]=e.bitangent?1:0,n[r++]=e.color?1:0,n},i.unpack=function(n,r,a){return r=t(r,0),e(a)||(a=new i),a.position=1===n[r++],a.normal=1===n[r++],a.st=1===n[r++],a.tangent=1===n[r++],a.bitangent=1===n[r++],a.color=1===n[r++],a},i.clone=function(t,n){if(e(t))return e(n)||(n=new i),n.position=t.position,n.normal=t.normal,n.st=t.st,n.tangent=t.tangent,n.bitangent=t.bitangent,n.color=t.color,n},i}),define("Core/BoxGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./PrimitiveType","./VertexFormat"],function(t,e,n,r,i,a,o,u,E,s,c){"use strict";function _(t){t=r(t,r.EMPTY_OBJECT);var n=t.minimum,i=t.maximum,a=r(t.vertexFormat,c.DEFAULT);this._minimum=e.clone(n),this._maximum=e.clone(i),this._vertexFormat=a,this._workerName="createBoxGeometry"}var T=new e;_.fromDimensions=function(t){t=r(t,r.EMPTY_OBJECT);var n=t.dimensions,i=e.multiplyByScalar(n,.5,new e);return new _({minimum:e.negate(i,new e),maximum:i,vertexFormat:t.vertexFormat})},_.fromAxisAlignedBoundingBox=function(t){return new _({minimum:t.minimum,maximum:t.maximum})},_.packedLength=2*e.packedLength+c.packedLength,_.pack=function(t,n,i){return i=r(i,0),e.pack(t._minimum,n,i),e.pack(t._maximum,n,i+e.packedLength),c.pack(t._vertexFormat,n,i+2*e.packedLength),n};var R=new e,l=new e,A=new c,f={minimum:R,maximum:l,vertexFormat:A};return _.unpack=function(t,n,a){n=r(n,0);var o=e.unpack(t,n,R),u=e.unpack(t,n+e.packedLength,l),E=c.unpack(t,n+2*e.packedLength,A);return i(a)?(a._minimum=e.clone(o,a._minimum),a._maximum=e.clone(u,a._maximum),a._vertexFormat=c.clone(E,a._vertexFormat),a):new _(f)},_.createGeometry=function(r){var i=r._minimum,a=r._maximum,c=r._vertexFormat;if(!e.equals(i,a)){var _,R,l=new E;if(c.position&&(c.st||c.normal||c.tangent||c.bitangent)){if(c.position&&(R=new Float64Array(72),R[0]=i.x,R[1]=i.y,R[2]=a.z,R[3]=a.x,R[4]=i.y,R[5]=a.z,R[6]=a.x,R[7]=a.y,R[8]=a.z,R[9]=i.x,R[10]=a.y,R[11]=a.z,R[12]=i.x,R[13]=i.y,R[14]=i.z,R[15]=a.x,R[16]=i.y,R[17]=i.z,R[18]=a.x,R[19]=a.y,R[20]=i.z,R[21]=i.x,R[22]=a.y,R[23]=i.z,R[24]=a.x,R[25]=i.y,R[26]=i.z,R[27]=a.x,R[28]=a.y,R[29]=i.z,R[30]=a.x,R[31]=a.y,R[32]=a.z,R[33]=a.x,R[34]=i.y,R[35]=a.z,R[36]=i.x,R[37]=i.y,R[38]=i.z,R[39]=i.x,R[40]=a.y,R[41]=i.z,R[42]=i.x,R[43]=a.y,R[44]=a.z,R[45]=i.x,R[46]=i.y,R[47]=a.z,R[48]=i.x,R[49]=a.y,R[50]=i.z,R[51]=a.x,R[52]=a.y,R[53]=i.z,R[54]=a.x,R[55]=a.y,R[56]=a.z,R[57]=i.x,R[58]=a.y,R[59]=a.z,R[60]=i.x,R[61]=i.y,R[62]=i.z,R[63]=a.x,R[64]=i.y,R[65]=i.z,R[66]=a.x,R[67]=i.y,R[68]=a.z,R[69]=i.x,R[70]=i.y,R[71]=a.z,l.position=new u({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:R})),c.normal){var A=new Float32Array(72);A[0]=0,A[1]=0,A[2]=1,A[3]=0,A[4]=0,A[5]=1,A[6]=0,A[7]=0,A[8]=1,A[9]=0,A[10]=0,A[11]=1,A[12]=0,A[13]=0,A[14]=-1,A[15]=0,A[16]=0,A[17]=-1,A[18]=0,A[19]=0,A[20]=-1,A[21]=0,A[22]=0,A[23]=-1,A[24]=1,A[25]=0,A[26]=0,A[27]=1,A[28]=0,A[29]=0,A[30]=1,A[31]=0,A[32]=0,A[33]=1,A[34]=0,A[35]=0,A[36]=-1,A[37]=0,A[38]=0,A[39]=-1,A[40]=0,A[41]=0,A[42]=-1,A[43]=0,A[44]=0,A[45]=-1,A[46]=0,A[47]=0,A[48]=0,A[49]=1,A[50]=0,A[51]=0,A[52]=1,A[53]=0,A[54]=0,A[55]=1,A[56]=0,A[57]=0,A[58]=1,A[59]=0,A[60]=0,A[61]=-1,A[62]=0,A[63]=0,A[64]=-1,A[65]=0,A[66]=0,A[67]=-1,A[68]=0,A[69]=0,A[70]=-1,A[71]=0,l.normal=new u({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:A})}if(c.st){var f=new Float32Array(48);f[0]=0,f[1]=0,f[2]=1,f[3]=0,f[4]=1,f[5]=1,f[6]=0,f[7]=1,f[8]=1,f[9]=0,f[10]=0,f[11]=0,f[12]=0,f[13]=1,f[14]=1,f[15]=1,f[16]=0,f[17]=0,f[18]=1,f[19]=0,f[20]=1,f[21]=1,f[22]=0,f[23]=1,f[24]=1,f[25]=0,f[26]=0,f[27]=0,f[28]=0,f[29]=1,f[30]=1,f[31]=1,f[32]=1,f[33]=0,f[34]=0,f[35]=0,f[36]=0,f[37]=1,f[38]=1,f[39]=1,f[40]=0,f[41]=0,f[42]=1,f[43]=0,f[44]=1,f[45]=1,f[46]=0,f[47]=1,l.st=new u({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:f})}if(c.tangent){var h=new Float32Array(72);h[0]=1,h[1]=0,h[2]=0,h[3]=1,h[4]=0,h[5]=0,h[6]=1,h[7]=0,h[8]=0,h[9]=1,h[10]=0,h[11]=0,h[12]=-1,h[13]=0,h[14]=0,h[15]=-1,h[16]=0,h[17]=0,h[18]=-1,h[19]=0,h[20]=0,h[21]=-1,h[22]=0,h[23]=0,h[24]=0,h[25]=1,h[26]=0,h[27]=0,h[28]=1,h[29]=0,h[30]=0,h[31]=1,h[32]=0,h[33]=0,h[34]=1,h[35]=0,h[36]=0,h[37]=-1,h[38]=0,h[39]=0,h[40]=-1,h[41]=0,h[42]=0,h[43]=-1,h[44]=0,h[45]=0,h[46]=-1,h[47]=0,h[48]=-1,h[49]=0,h[50]=0,h[51]=-1,h[52]=0,h[53]=0,h[54]=-1,h[55]=0,h[56]=0,h[57]=-1,h[58]=0,h[59]=0,h[60]=1,h[61]=0,h[62]=0,h[63]=1,h[64]=0,h[65]=0,h[66]=1,h[67]=0,h[68]=0,h[69]=1,h[70]=0,h[71]=0,l.tangent=new u({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:h})}if(c.bitangent){var N=new Float32Array(72);N[0]=0,N[1]=1,N[2]=0,N[3]=0,N[4]=1,N[5]=0,N[6]=0,N[7]=1,N[8]=0,N[9]=0,N[10]=1,N[11]=0,N[12]=0,N[13]=1,N[14]=0,N[15]=0,N[16]=1,N[17]=0,N[18]=0,N[19]=1,N[20]=0,N[21]=0,N[22]=1,N[23]=0,N[24]=0,N[25]=0,N[26]=1,N[27]=0,N[28]=0,N[29]=1,N[30]=0,N[31]=0,N[32]=1,N[33]=0,N[34]=0,N[35]=1,N[36]=0,N[37]=0,N[38]=1,N[39]=0,N[40]=0,N[41]=1,N[42]=0,N[43]=0,N[44]=1,N[45]=0,N[46]=0,N[47]=1,N[48]=0,N[49]=0,N[50]=1,N[51]=0,N[52]=0,N[53]=1,N[54]=0,N[55]=0,N[56]=1,N[57]=0,N[58]=0,N[59]=1,N[60]=0,N[61]=0,N[62]=1,N[63]=0,N[64]=0,N[65]=1,N[66]=0,N[67]=0,N[68]=1,N[69]=0,N[70]=0,N[71]=1,l.bitangent=new u({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:N})}_=new Uint16Array(36),_[0]=0,_[1]=1,_[2]=2,_[3]=0,_[4]=2,_[5]=3,_[6]=6,_[7]=5,_[8]=4,_[9]=7,_[10]=6,_[11]=4,_[12]=8,_[13]=9,_[14]=10,_[15]=8,_[16]=10,_[17]=11,_[18]=14,_[19]=13,_[20]=12,_[21]=15,_[22]=14,_[23]=12,_[24]=18,_[25]=17,_[26]=16,_[27]=19,_[28]=18,_[29]=16,_[30]=20,_[31]=21,_[32]=22,_[33]=20,_[34]=22,_[35]=23}else R=new Float64Array(24),R[0]=i.x,R[1]=i.y,R[2]=i.z,R[3]=a.x,R[4]=i.y,R[5]=i.z,R[6]=a.x,R[7]=a.y,R[8]=i.z,R[9]=i.x,R[10]=a.y,R[11]=i.z,R[12]=i.x,R[13]=i.y,R[14]=a.z,R[15]=a.x,R[16]=i.y,R[17]=a.z,R[18]=a.x,R[19]=a.y,R[20]=a.z,R[21]=i.x,R[22]=a.y,R[23]=a.z,l.position=new u({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:R}),_=new Uint16Array(36),_[0]=4,_[1]=5,_[2]=6,_[3]=4,_[4]=6,_[5]=7,_[6]=1,_[7]=0,_[8]=3,_[9]=1,_[10]=3,_[11]=2,_[12]=1,_[13]=6,_[14]=5,_[15]=1,_[16]=2,_[17]=6,_[18]=2,_[19]=3,_[20]=7,_[21]=2,_[22]=7,_[23]=6,_[24]=3,_[25]=0,_[26]=4,_[27]=3,_[28]=4,_[29]=7,_[30]=0,_[31]=1,_[32]=5,_[33]=0,_[34]=5,_[35]=4;var d=e.subtract(a,i,T),I=.5*e.magnitude(d);return new o({attributes:l,indices:_,primitiveType:s.TRIANGLES,boundingSphere:new t(e.ZERO,I)})}},_}),define("Workers/createBoxGeometry",["../Core/BoxGeometry","../Core/defined"],function(t,e){"use strict";return function(n,r){return e(r)&&(n=t.unpack(n,r)),t.createGeometry(n)}})}(); \ No newline at end of file diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createBoxOutlineGeometry.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createBoxOutlineGeometry.js index 027e740d..7505ff8b 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createBoxOutlineGeometry.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createBoxOutlineGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,6 +55,6 @@ mersenne-twister.js - https://gist.github.com/banksean/300494 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==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";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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("Core/isArray",["./defined"],function(e){"use strict";var t=Array.isArray;return e(t)||(t=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),t}),define("Core/Check",["./defaultValue","./defined","./DeveloperError","./isArray"],function(e,t,n,r){"use strict";function i(e){return e+" was required but undefined."}function a(e,t,n){return"Expected "+n+" to be typeof "+t+", got "+e}var o={};return o.typeOf={},o.numeric={},o.defined=function(e,r){if(!t(e))throw new n(i(r))},o.numeric.maximum=function(e,t){if(o.typeOf.number(e),o.typeOf.number(t),e>t)throw new n("Expected "+e+" to be at most "+t)},o.numeric.minimum=function(e,t){if(o.typeOf.number(e),o.typeOf.number(t),e<t)throw new n("Expected "+e+" to be at least "+t)},o.typeOf.function=function(e,t){if("function"!=typeof e)throw new n(a(typeof e,"function",t))},o.typeOf.string=function(e,t){if("string"!=typeof e)throw new n(a(typeof e,"string",t))},o.typeOf.number=function(e,t){if("number"!=typeof e)throw new n(a(typeof e,"number",t))},o.typeOf.object=function(e,t){if("object"!=typeof e)throw new n(a(typeof e,"object",t))},o.typeOf.boolean=function(e,t){if("boolean"!=typeof e)throw new n(a(typeof e,"boolean",t))},o}),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 n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(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^=e<<7&2636928640,e^=e<<15&4022730752,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,n,r){"use strict";var i={};i.EPSILON1=.1,i.EPSILON2=.01,i.EPSILON3=.001,i.EPSILON4=1e-4,i.EPSILON5=1e-5,i.EPSILON6=1e-6,i.EPSILON7=1e-7,i.EPSILON8=1e-8,i.EPSILON9=1e-9,i.EPSILON10=1e-10,i.EPSILON11=1e-11,i.EPSILON12=1e-12,i.EPSILON13=1e-13,i.EPSILON14=1e-14,i.EPSILON15=1e-15,i.EPSILON16=1e-16,i.EPSILON17=1e-17,i.EPSILON18=1e-18,i.EPSILON19=1e-19,i.EPSILON20=1e-20,i.GRAVITATIONALPARAMETER=3986004418e5,i.SOLAR_RADIUS=6955e5,i.LUNAR_RADIUS=1737400,i.SIXTY_FOUR_KILOBYTES=65536,i.sign=function(e){return e>0?1:e<0?-1:0},i.signNotZero=function(e){return e<0?-1:1},i.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*i.clamp(e,-1,1)+.5)*n)},i.fromSNorm=function(e,n){return n=t(n,255),i.clamp(e,0,n)/n*2-1},i.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},i.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},i.lerp=function(e,t,n){return(1-n)*e+n*t},i.PI=Math.PI,i.ONE_OVER_PI=1/Math.PI,i.PI_OVER_TWO=.5*Math.PI,i.PI_OVER_THREE=Math.PI/3,i.PI_OVER_FOUR=Math.PI/4,i.PI_OVER_SIX=Math.PI/6,i.THREE_PI_OVER_TWO=3*Math.PI*.5,i.TWO_PI=2*Math.PI,i.ONE_OVER_TWO_PI=1/(2*Math.PI),i.RADIANS_PER_DEGREE=Math.PI/180,i.DEGREES_PER_RADIAN=180/Math.PI,i.RADIANS_PER_ARCSECOND=i.RADIANS_PER_DEGREE/3600,i.toRadians=function(e){return e*i.RADIANS_PER_DEGREE},i.toDegrees=function(e){return e*i.DEGREES_PER_RADIAN},i.convertLongitudeRange=function(e){var t=i.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},i.clampToLatitudeRange=function(e){return i.clamp(e,-1*i.PI_OVER_TWO,i.PI_OVER_TWO)},i.negativePiToPi=function(e){return i.zeroToTwoPi(e+i.PI)-i.PI},i.zeroToTwoPi=function(e){var t=i.mod(e,i.TWO_PI);return Math.abs(t)<i.EPSILON14&&Math.abs(e)>i.EPSILON14?i.TWO_PI:t},i.mod=function(e,t){return(e%t+t)%t},i.equalsEpsilon=function(e,n,r,i){i=t(i,r);var a=Math.abs(e-n);return a<=i||a<=r*Math.max(Math.abs(e),Math.abs(n))};var a=[1];i.factorial=function(e){var t=a.length;if(e>=t)for(var n=a[t-1],r=t;r<=e;r++)a.push(n*r);return a[e]},i.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},i.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},i.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},i.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return i.setRandomNumberSeed=function(t){o=new e(t)},i.nextRandomNumber=function(){return o.random()},i.acosClamped=function(e){return Math.acos(i.clamp(e,-1,1))},i.asinClamped=function(e){return Math.asin(i.clamp(e,-1,1))},i.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},i.logBase=function(e,t){return Math.log(e)/Math.log(t)},i.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},i}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var i=e.clock,a=e.cone,u=t(e.magnitude,1),E=u*Math.sin(a);return r.x=E*Math.cos(i),r.y=E*Math.sin(i),r.z=u*Math.cos(a),r},o.fromElements=function(e,t,r,i){return n(i)?(i.x=e,i.y=t,i.z=r,i):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new o),i.x=e[r++],i.y=e[r++],i.z=e[r],i},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var i=0;i<r;++i)o.pack(e[i],t,3*i);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var i=0;i<r;i+=3){var a=i/3;t[a]=o.unpack(e,i,t[a])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,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};var E=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,E),r=o.multiplyByScalar(e,1-n,r),o.add(E,r,r)};var s=new o,c=new o;o.angleBetween=function(e,t){o.normalize(e,s),o.normalize(t,c);var n=o.dot(s,c),r=o.magnitude(o.cross(s,c,s));return Math.atan2(r,n)};var _=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,_);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,i){return e===t||n(e)&&n(t)&&a.equalsEpsilon(e.x,t.x,r,i)&&a.equalsEpsilon(e.y,t.y,r,i)&&a.equalsEpsilon(e.z,t.z,r,i)},o.cross=function(e,t,n){var r=e.x,i=e.y,a=e.z,o=t.x,u=t.y,E=t.z,s=i*E-a*u,c=a*o-r*E,_=r*u-i*o;return n.x=s,n.y=c,n.z=_,n},o.fromDegrees=function(e,t,n,r,i){return e=a.toRadians(e),t=a.toRadians(t),o.fromRadians(e,t,n,r,i)};var T=new o,R=new o,l=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,i,a,u){i=t(i,0);var E=n(a)?a.radiiSquared:l,s=Math.cos(r);T.x=s*Math.cos(e),T.y=s*Math.sin(e),T.z=Math.sin(r),T=o.normalize(T,T),o.multiplyComponents(E,T,R);var c=Math.sqrt(o.dot(T,R));return R=o.divideByScalar(R,c,R),T=o.multiplyByScalar(T,i,T),n(u)||(u=new o),o.add(R,T,u)},o.fromDegreesArray=function(e,t,r){var i=e.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],E=e[a+1],s=a/2;r[s]=o.fromDegrees(u,E,0,t,r[s])}return r},o.fromRadiansArray=function(e,t,r){var i=e.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],E=e[a+1],s=a/2;r[s]=o.fromRadians(u,E,0,t,r[s])}return r},o.fromDegreesArrayHeights=function(e,t,r){var i=e.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],E=e[a+1],s=e[a+2],c=a/3;r[c]=o.fromDegrees(u,E,s,t,r[c])}return r},o.fromRadiansArrayHeights=function(e,t,r){var i=e.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],E=e[a+1],s=e[a+2],c=a/3;r[c]=o.fromRadians(u,E,s,t,r[c])}return r},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,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function i(n,i,u,E,s){var c=n.x,_=n.y,T=n.z,R=i.x,l=i.y,A=i.z,f=c*c*R*R,h=_*_*l*l,N=T*T*A*A,d=f+h+N,I=Math.sqrt(1/d),S=e.multiplyByScalar(n,I,a);if(d<E)return isFinite(I)?e.clone(S,s):void 0;var m=u.x,M=u.y,O=u.z,y=o;y.x=S.x*m*2,y.y=S.y*M*2,y.z=S.z*O*2;var p,C,U,L,F,P,g,w,v,D,B,x=(1-I)*e.magnitude(n)/(.5*e.magnitude(y)),z=0;do{x-=z,U=1/(1+x*m),L=1/(1+x*M),F=1/(1+x*O),P=U*U,g=L*L,w=F*F,v=P*U,D=g*L,B=w*F,p=f*P+h*g+N*w-1,C=f*v*m+h*D*M+N*B*O;var G=-2*C;z=p/G}while(Math.abs(p)>r.EPSILON12);return t(s)?(s.x=c*U,s.y=_*L,s.z=T*F,s):new e(c*U,_*L,T*F)}var a=new e,o=new e;return i}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,i,a,o){"use strict";function u(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)}u.fromRadians=function(e,r,i,a){return i=t(i,0),n(a)?(a.longitude=e,a.latitude=r,a.height=i,a):new u(e,r,i)},u.fromDegrees=function(e,t,n,r){return e=a.toRadians(e),t=a.toRadians(t),u.fromRadians(e,t,n,r)};var E=new e,s=new e,c=new e,_=new e(1/6378137,1/6378137,1/6356752.314245179),T=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),R=a.EPSILON1;return u.fromCartesian=function(t,r,i){var l=n(r)?r.oneOverRadii:_,A=n(r)?r.oneOverRadiiSquared:T,f=n(r)?r._centerToleranceSquared:R,h=o(t,l,A,f,s);if(n(h)){var N=e.multiplyComponents(h,A,E);N=e.normalize(N,N);var d=e.subtract(t,h,c),I=Math.atan2(N.y,N.x),S=Math.asin(N.z),m=a.sign(e.dot(d,t))*e.magnitude(d);return n(i)?(i.longitude=I,i.latitude=S,i.height=m,i):new u(I,S,m)}},u.clone=function(e,t){if(n(e))return n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},u.ZERO=i(new u(0,0,0)),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,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,i,a,o,u,E){"use strict";function s(t,r,i,a){r=n(r,0),i=n(i,0),a=n(a,0),t._radii=new e(r,i,a),t._radiiSquared=new e(r*r,i*i,a*a),t._radiiToTheFourth=new e(r*r*r*r,i*i*i*i,a*a*a*a),t._oneOverRadii=new e(0===r?0:1/r,0===i?0:1/i,0===a?0:1/a),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===i?0:1/(i*i),0===a?0:1/(a*a)),t._minimumRadius=Math.min(r,i,a),t._maximumRadius=Math.max(r,i,a),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function c(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,s(this,e,t,n)}i(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,n){if(r(t)){var i=t._radii;return r(n)?(e.clone(i,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new c(i.x,i.y,i.z)}},c.fromCartesian3=function(e,t){return r(t)||(t=new c),r(e)?(s(t,e.x,e.y,e.z),t):t},c.WGS84=o(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=o(new c(1,1,1)),c.MOON=o(new c(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),c.prototype.clone=function(e){return c.clone(this,e)},c.packedLength=e.packedLength,c.pack=function(t,r,i){return i=n(i,0),e.pack(t._radii,r,i),r},c.unpack=function(t,r,i){r=n(r,0);var a=e.unpack(t,r);return c.fromCartesian3(a,i)},c.prototype.geocentricSurfaceNormal=e.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(t,n){var i=t.longitude,a=t.latitude,o=Math.cos(a),u=o*Math.cos(i),E=o*Math.sin(i),s=Math.sin(a);return r(n)||(n=new e),n.x=u,n.y=E,n.z=s,e.normalize(n,n)},c.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var _=new e,T=new e;c.prototype.cartographicToCartesian=function(t,n){var i=_,a=T;this.geodeticSurfaceNormalCartographic(t,i),e.multiplyComponents(this._radiiSquared,i,a);var o=Math.sqrt(e.dot(i,a));return e.divideByScalar(a,o,a),e.multiplyByScalar(i,t.height,i),r(n)||(n=new e),e.add(a,i,n)},c.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;i<n;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var R=new e,l=new e,A=new e;return c.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,l);if(r(a)){var o=this.geodeticSurfaceNormal(a,R),E=e.subtract(n,a,A),s=Math.atan2(o.y,o.x),c=Math.asin(o.z),_=u.sign(e.dot(E,n))*e.magnitude(E);return r(i)?(i.longitude=s,i.latitude=c,i.height=_,i):new t(s,c,_)}},c.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;i<n;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t},c.prototype.scaleToGeodeticSurface=function(e,t){return E(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},c.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var i=t.x,a=t.y,o=t.z,u=this._oneOverRadiiSquared,E=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*u.z);return e.multiplyByScalar(t,E,n)},c.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},c.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},c.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},c.prototype.toString=function(){return this._radii.toString()},c.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,i,a){i=n(i,0);var o=this._sqauredXOverSquaredZ;if(r(a)||(a=new e),a.x=0,a.y=0,a.z=t.z*(1-o),!(Math.abs(a.z)>=this._radii.z-i))return a},c}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,i,a,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return i(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var i=this._semimajorAxis,a=t.longitude*i,o=t.latitude*i,u=t.height;return r(n)?(n.x=a,n.y=o,n.z=u,n):new e(a,o,u)},u.prototype.unproject=function(e,n){var i=this._oneOverSemimajorAxis,a=e.x*i,o=e.y*i,u=e.z;return r(n)?(n.longitude=a,n.latitude=o,n.height=u,n):new t(a,o,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";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a,o){"use strict";function u(e,n,r,i,a,o,u,E,s){this[0]=t(e,0),this[1]=t(i,0),this[2]=t(u,0),this[3]=t(n,0),this[4]=t(a,0),this[5]=t(E,0),this[6]=t(r,0),this[7]=t(o,0),this[8]=t(s,0)}function E(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function s(e){for(var t=0,n=0;n<3;++n){var r=e[u.getElementIndex(l[n],R[n])];t+=2*r*r}return Math.sqrt(t)}function c(e,t){for(var n=o.EPSILON15,r=0,i=1,a=0;a<3;++a){var E=Math.abs(e[u.getElementIndex(l[a],R[a])]);E>r&&(i=a,r=E)}var s=1,c=0,_=R[i],T=l[i];if(Math.abs(e[u.getElementIndex(T,_)])>n){var A,f=e[u.getElementIndex(T,T)],h=e[u.getElementIndex(_,_)],N=e[u.getElementIndex(T,_)],d=(f-h)/2/N;A=d<0?-1/(-d+Math.sqrt(1+d*d)):1/(d+Math.sqrt(1+d*d)),s=1/Math.sqrt(1+A*A),c=A*s}return t=u.clone(u.IDENTITY,t),t[u.getElementIndex(_,_)]=t[u.getElementIndex(T,T)]=s,t[u.getElementIndex(T,_)]=c,t[u.getElementIndex(_,T)]=-c,t}u.packedLength=9,u.pack=function(e,n,r){return r=t(r,0),n[r++]=e[0],n[r++]=e[1],n[r++]=e[2],n[r++]=e[3],n[r++]=e[4],n[r++]=e[5],n[r++]=e[6],n[r++]=e[7],n[r++]=e[8],n},u.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new u),i[0]=e[r++],i[1]=e[r++],i[2]=e[r++],i[3]=e[r++],i[4]=e[r++],i[5]=e[r++],i[6]=e[r++],i[7]=e[r++],i[8]=e[r++],i},u.clone=function(e,t){if(n(e))return n(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 u(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},u.fromArray=function(e,r,i){return r=t(r,0),n(i)||(i=new u),i[0]=e[r],i[1]=e[r+1],i[2]=e[r+2],i[3]=e[r+3],i[4]=e[r+4],i[5]=e[r+5],i[6]=e[r+6],i[7]=e[r+7],i[8]=e[r+8],i},u.fromColumnMajorArray=function(e,t){return u.clone(e,t)},u.fromRowMajorArray=function(e,t){return n(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 u(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},u.fromQuaternion=function(e,t){var r=e.x*e.x,i=e.x*e.y,a=e.x*e.z,o=e.x*e.w,E=e.y*e.y,s=e.y*e.z,c=e.y*e.w,_=e.z*e.z,T=e.z*e.w,R=e.w*e.w,l=r-E-_+R,A=2*(i-T),f=2*(a+c),h=2*(i+T),N=-r+E-_+R,d=2*(s-o),I=2*(a-c),S=2*(s+o),m=-r-E+_+R;return n(t)?(t[0]=l,t[1]=h,t[2]=I,t[3]=A,t[4]=N,t[5]=S,t[6]=f,t[7]=d,t[8]=m,t):new u(l,A,f,h,N,d,I,S,m)},u.fromHeadingPitchRoll=function(e,t){var r=Math.cos(-e.pitch),i=Math.cos(-e.heading),a=Math.cos(e.roll),o=Math.sin(-e.pitch),E=Math.sin(-e.heading),s=Math.sin(e.roll),c=r*i,_=-a*E+s*o*i,T=s*E+a*o*i,R=r*E,l=a*i+s*o*E,A=-o*a+a*o*E,f=-o,h=s*r,N=a*r;return n(t)?(t[0]=c,t[1]=R,t[2]=f,t[3]=_,t[4]=l,t[5]=h,t[6]=T,t[7]=A,t[8]=N,t):new u(c,_,T,R,l,A,f,h,N)},u.fromScale=function(e,t){return n(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 u(e.x,0,0,0,e.y,0,0,0,e.z)},u.fromUniformScale=function(e,t){return n(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 u(e,0,0,0,e,0,0,0,e)},u.fromCrossProduct=function(e,t){return n(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 u(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},u.fromRotationX=function(e,t){var r=Math.cos(e),i=Math.sin(e);return n(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=r,t[5]=i,t[6]=0,t[7]=-i,t[8]=r,t):new u(1,0,0,0,r,-i,0,i,r)},u.fromRotationY=function(e,t){var r=Math.cos(e),i=Math.sin(e);return n(t)?(t[0]=r,t[1]=0,t[2]=-i,t[3]=0,t[4]=1,t[5]=0,t[6]=i,t[7]=0,t[8]=r,t):new u(r,0,i,0,1,0,-i,0,r)},u.fromRotationZ=function(e,t){var r=Math.cos(e),i=Math.sin(e);return n(t)?(t[0]=r,t[1]=i,t[2]=0,t[3]=-i,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new u(r,-i,0,i,r,0,0,0,1)},u.toArray=function(e,t){return n(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]]},u.getElementIndex=function(e,t){return 3*e+t},u.getColumn=function(e,t,n){var r=3*t,i=e[r],a=e[r+1],o=e[r+2];return n.x=i,n.y=a,n.z=o,n},u.setColumn=function(e,t,n,r){r=u.clone(e,r);var i=3*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},u.getRow=function(e,t,n){var r=e[t],i=e[t+3],a=e[t+6];return n.x=r,n.y=i,n.z=a,n},u.setRow=function(e,t,n,r){return r=u.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var _=new e;u.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],_)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],_)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],_)),n};var T=new e;u.getMaximumScale=function(t){return u.getScale(t,T),e.maximumComponent(T)},u.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],i=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],o=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],E=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],s=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],c=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],_=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=r,n[1]=i,n[2]=a,n[3]=o,n[4]=u,n[5]=E,n[6]=s,n[7]=c,n[8]=_,n},u.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},u.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},u.multiplyByVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[3]*i+e[6]*a,u=e[1]*r+e[4]*i+e[7]*a,E=e[2]*r+e[5]*i+e[8]*a;return n.x=o,n.y=u,n.z=E,n},u.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},u.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},u.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},u.transpose=function(e,t){var n=e[0],r=e[3],i=e[6],a=e[1],o=e[4],u=e[7],E=e[2],s=e[5],c=e[8];return t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=u,t[6]=E,t[7]=s,t[8]=c,t};var R=[1,0,0],l=[2,2,1],A=new u,f=new u;return u.computeEigenDecomposition=function(e,t){var r=o.EPSILON20,i=10,a=0,_=0;n(t)||(t={});for(var T=t.unitary=u.clone(u.IDENTITY,t.unitary),R=t.diagonal=u.clone(e,t.diagonal),l=r*E(R);_<i&&s(R)>l;)c(R,A),u.transpose(A,f),u.multiply(R,A,R),u.multiply(f,R,R),u.multiply(T,A,T),++a>2&&(++_,a=0);return t},u.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},u.determinant=function(e){var t=e[0],n=e[3],r=e[6],i=e[1],a=e[4],o=e[7],u=e[2],E=e[5],s=e[8];return t*(a*s-E*o)+i*(E*r-n*s)+u*(n*o-a*r)},u.inverse=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],E=e[5],s=e[6],c=e[7],_=e[8],T=u.determinant(e);t[0]=o*_-c*E,t[1]=c*i-r*_,t[2]=r*E-o*i,t[3]=s*E-a*_,t[4]=n*_-s*i,t[5]=a*i-n*E,t[6]=a*c-s*o,t[7]=s*r-n*c,t[8]=n*o-a*r;var R=1/T;return u.multiplyByScalar(t,R,t)},u.equals=function(e,t){return e===t||n(e)&&n(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]},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r},u.IDENTITY=a(new u(1,0,0,0,1,0,0,0,1)),u.ZERO=a(new u(0,0,0,0,0,0,0,0,0)),u.COLUMN0ROW0=0,u.COLUMN0ROW1=1,u.COLUMN0ROW2=2,u.COLUMN1ROW0=3,u.COLUMN1ROW1=4,u.COLUMN1ROW2=5,u.COLUMN2ROW0=6,u.COLUMN2ROW1=7,u.COLUMN2ROW2=8,r(u.prototype,{length:{get:function(){return u.packedLength}}}),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},u}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i){"use strict";function a(t,n,r,i){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0),this.w=e(i,0)}a.fromElements=function(e,n,r,i,o){return t(o)?(o.x=e,o.y=n,o.z=r,o.w=i,o):new a(e,n,r,i)},a.fromColor=function(e,n){return t(n)?(n.x=e.red,n.y=e.green,n.z=e.blue,n.w=e.alpha,n):new a(e.red,e.green,e.blue,e.alpha)},a.clone=function(e,n){if(t(e))return t(n)?(n.x=e.x,n.y=e.y,n.z=e.z,n.w=e.w,n):new a(e.x,e.y,e.z,e.w)},a.packedLength=4,a.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w,n},a.unpack=function(n,r,i){return r=e(r,0),t(i)||(i=new a),i.x=n[r++],i.y=n[r++],i.z=n[r++],i.w=n[r],i},a.packArray=function(e,n){var r=e.length;t(n)?n.length=4*r:n=new Array(4*r);for(var i=0;i<r;++i)a.pack(e[i],n,4*i);return n},a.unpackArray=function(e,n){var r=e.length;t(n)?n.length=r/4:n=new Array(r/4);for(var i=0;i<r;i+=4){var o=i/4;n[o]=a.unpack(e,i,n[o])}return n},a.fromArray=a.unpack,a.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},a.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},a.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},a.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},a.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},a.magnitude=function(e){return Math.sqrt(a.magnitudeSquared(e))};var o=new a;a.distance=function(e,t){return a.subtract(e,t,o),a.magnitude(o)},a.distanceSquared=function(e,t){return a.subtract(e,t,o),a.magnitudeSquared(o)},a.normalize=function(e,t){var n=a.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t},a.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},a.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},a.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},a.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},a.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},a.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},a.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},a.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,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.w=Math.abs(e.w),t};var u=new a;a.lerp=function(e,t,n,r){return a.multiplyByScalar(t,n,u),r=a.multiplyByScalar(e,1-n,r),a.add(u,r,r)};var E=new a;return a.mostOrthogonalAxis=function(e,t){var n=a.normalize(e,E);return a.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?a.clone(a.UNIT_X,t):a.clone(a.UNIT_W,t):n.z<=n.w?a.clone(a.UNIT_Z,t):a.clone(a.UNIT_W,t):n.y<=n.z?n.y<=n.w?a.clone(a.UNIT_Y,t):a.clone(a.UNIT_W,t):n.z<=n.w?a.clone(a.UNIT_Z,t):a.clone(a.UNIT_W,t)},a.equals=function(e,n){return e===n||t(e)&&t(n)&&e.x===n.x&&e.y===n.y&&e.z===n.z&&e.w===n.w},a.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},a.equalsEpsilon=function(e,n,r,a){return e===n||t(e)&&t(n)&&i.equalsEpsilon(e.x,n.x,r,a)&&i.equalsEpsilon(e.y,n.y,r,a)&&i.equalsEpsilon(e.z,n.z,r,a)&&i.equalsEpsilon(e.w,n.w,r,a)},a.ZERO=r(new a(0,0,0,0)),a.UNIT_X=r(new a(1,0,0,0)),a.UNIT_Y=r(new a(0,1,0,0)),a.UNIT_Z=r(new a(0,0,1,0)),a.UNIT_W=r(new a(0,0,0,1)),a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,n){return a.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},a}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,i,a,o,u,E,s){"use strict";function c(e,t,r,i,a,o,u,E,s,c,_,T,R,l,A,f){this[0]=n(e,0),this[1]=n(a,0),this[2]=n(s,0),this[3]=n(R,0),this[4]=n(t,0), -this[5]=n(o,0),this[6]=n(c,0),this[7]=n(l,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(_,0),this[11]=n(A,0),this[12]=n(i,0),this[13]=n(E,0),this[14]=n(T,0),this[15]=n(f,0)}c.packedLength=16,c.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t[r++]=e[9],t[r++]=e[10],t[r++]=e[11],t[r++]=e[12],t[r++]=e[13],t[r++]=e[14],t[r]=e[15],t},c.unpack=function(e,t,i){return t=n(t,0),r(i)||(i=new c),i[0]=e[t++],i[1]=e[t++],i[2]=e[t++],i[3]=e[t++],i[4]=e[t++],i[5]=e[t++],i[6]=e[t++],i[7]=e[t++],i[8]=e[t++],i[9]=e[t++],i[10]=e[t++],i[11]=e[t++],i[12]=e[t++],i[13]=e[t++],i[14]=e[t++],i[15]=e[t],i},c.clone=function(e,t){if(r(e))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):new c(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])},c.fromArray=c.unpack,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[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 c(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])},c.fromRotationTranslation=function(t,i,a){return i=n(i,e.ZERO),r(a)?(a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=0,a[4]=t[3],a[5]=t[4],a[6]=t[5],a[7]=0,a[8]=t[6],a[9]=t[7],a[10]=t[8],a[11]=0,a[12]=i.x,a[13]=i.y,a[14]=i.z,a[15]=1,a):new c(t[0],t[3],t[6],i.x,t[1],t[4],t[7],i.y,t[2],t[5],t[8],i.z,0,0,0,1)},c.fromTranslationQuaternionRotationScale=function(e,t,n,i){r(i)||(i=new c);var a=n.x,o=n.y,u=n.z,E=t.x*t.x,s=t.x*t.y,_=t.x*t.z,T=t.x*t.w,R=t.y*t.y,l=t.y*t.z,A=t.y*t.w,f=t.z*t.z,h=t.z*t.w,N=t.w*t.w,d=E-R-f+N,I=2*(s-h),S=2*(_+A),m=2*(s+h),M=-E+R-f+N,O=2*(l-T),y=2*(_-A),p=2*(l+T),C=-E-R+f+N;return i[0]=d*a,i[1]=m*a,i[2]=y*a,i[3]=0,i[4]=I*o,i[5]=M*o,i[6]=p*o,i[7]=0,i[8]=S*u,i[9]=O*u,i[10]=C*u,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i},c.fromTranslationRotationScale=function(e,t){return c.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},c.fromTranslation=function(e,t){return c.fromRotationTranslation(E.IDENTITY,e,t)},c.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 c(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},c.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 c(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var _=new e,T=new e,R=new e;c.fromCamera=function(t,n){var i=t.position,a=t.direction,o=t.up;e.normalize(a,_),e.normalize(e.cross(_,o,T),T),e.normalize(e.cross(T,_,R),R);var u=T.x,E=T.y,s=T.z,l=_.x,A=_.y,f=_.z,h=R.x,N=R.y,d=R.z,I=i.x,S=i.y,m=i.z,M=u*-I+E*-S+s*-m,O=h*-I+N*-S+d*-m,y=l*I+A*S+f*m;return r(n)?(n[0]=u,n[1]=h,n[2]=-l,n[3]=0,n[4]=E,n[5]=N,n[6]=-A,n[7]=0,n[8]=s,n[9]=d,n[10]=-f,n[11]=0,n[12]=M,n[13]=O,n[14]=y,n[15]=1,n):new c(u,E,s,M,h,N,d,O,-l,-A,-f,y,0,0,0,1)},c.computePerspectiveFieldOfView=function(e,t,n,r,i){var a=Math.tan(.5*e),o=1/a,u=o/t,E=(r+n)/(n-r),s=2*r*n/(n-r);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=o,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=E,i[11]=-1,i[12]=0,i[13]=0,i[14]=s,i[15]=0,i},c.computeOrthographicOffCenter=function(e,t,n,r,i,a,o){var u=1/(t-e),E=1/(r-n),s=1/(a-i),c=-(t+e)*u,_=-(r+n)*E,T=-(a+i)*s;return u*=2,E*=2,s*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=s,o[11]=0,o[12]=c,o[13]=_,o[14]=T,o[15]=1,o},c.computePerspectiveOffCenter=function(e,t,n,r,i,a,o){var u=2*i/(t-e),E=2*i/(r-n),s=(t+e)/(t-e),c=(r+n)/(r-n),_=-(a+i)/(a-i),T=-1,R=-2*a*i/(a-i);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=s,o[9]=c,o[10]=_,o[11]=T,o[12]=0,o[13]=0,o[14]=R,o[15]=0,o},c.computeInfinitePerspectiveOffCenter=function(e,t,n,r,i,a){var o=2*i/(t-e),u=2*i/(r-n),E=(t+e)/(t-e),s=(r+n)/(r-n),c=-1,_=-1,T=-2*i;return a[0]=o,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=E,a[9]=s,a[10]=c,a[11]=_,a[12]=0,a[13]=0,a[14]=T,a[15]=0,a},c.computeViewportTransformation=function(e,t,r,i){e=n(e,n.EMPTY_OBJECT);var a=n(e.x,0),o=n(e.y,0),u=n(e.width,0),E=n(e.height,0);t=n(t,0),r=n(r,1);var s=.5*u,c=.5*E,_=.5*(r-t),T=s,R=c,l=_,A=a+s,f=o+c,h=t+_,N=1;return i[0]=T,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=R,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=l,i[11]=0,i[12]=A,i[13]=f,i[14]=h,i[15]=N,i},c.computeView=function(t,n,r,i,a){return a[0]=i.x,a[1]=r.x,a[2]=-n.x,a[3]=0,a[4]=i.y,a[5]=r.y,a[6]=-n.y,a[7]=0,a[8]=i.z,a[9]=r.z,a[10]=-n.z,a[11]=0,a[12]=-e.dot(i,t),a[13]=-e.dot(r,t),a[14]=e.dot(n,t),a[15]=1,a},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[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]]},c.getElementIndex=function(e,t){return 4*e+t},c.getColumn=function(e,t,n){var r=4*t,i=e[r],a=e[r+1],o=e[r+2],u=e[r+3];return n.x=i,n.y=a,n.z=o,n.w=u,n},c.setColumn=function(e,t,n,r){r=c.clone(e,r);var i=4*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r[i+3]=n.w,r},c.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},c.getRow=function(e,t,n){var r=e[t],i=e[t+4],a=e[t+8],o=e[t+12];return n.x=r,n.y=i,n.z=a,n.w=o,n},c.setRow=function(e,t,n,r){return r=c.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var l=new e;c.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],l)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],l)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],l)),n};var A=new e;c.getMaximumScale=function(t){return c.getScale(t,A),e.maximumComponent(A)},c.multiply=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[3],u=e[4],E=e[5],s=e[6],c=e[7],_=e[8],T=e[9],R=e[10],l=e[11],A=e[12],f=e[13],h=e[14],N=e[15],d=t[0],I=t[1],S=t[2],m=t[3],M=t[4],O=t[5],y=t[6],p=t[7],C=t[8],U=t[9],L=t[10],F=t[11],P=t[12],g=t[13],w=t[14],v=t[15],D=r*d+u*I+_*S+A*m,B=i*d+E*I+T*S+f*m,x=a*d+s*I+R*S+h*m,z=o*d+c*I+l*S+N*m,G=r*M+u*O+_*y+A*p,b=i*M+E*O+T*y+f*p,X=a*M+s*O+R*y+h*p,V=o*M+c*O+l*y+N*p,H=r*C+u*U+_*L+A*F,q=i*C+E*U+T*L+f*F,W=a*C+s*U+R*L+h*F,Y=o*C+c*U+l*L+N*F,K=r*P+u*g+_*w+A*v,k=i*P+E*g+T*w+f*v,Z=a*P+s*g+R*w+h*v,j=o*P+c*g+l*w+N*v;return n[0]=D,n[1]=B,n[2]=x,n[3]=z,n[4]=G,n[5]=b,n[6]=X,n[7]=V,n[8]=H,n[9]=q,n[10]=W,n[11]=Y,n[12]=K,n[13]=k,n[14]=Z,n[15]=j,n},c.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},c.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},c.multiplyTransformation=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[4],u=e[5],E=e[6],s=e[8],c=e[9],_=e[10],T=e[12],R=e[13],l=e[14],A=t[0],f=t[1],h=t[2],N=t[4],d=t[5],I=t[6],S=t[8],m=t[9],M=t[10],O=t[12],y=t[13],p=t[14],C=r*A+o*f+s*h,U=i*A+u*f+c*h,L=a*A+E*f+_*h,F=r*N+o*d+s*I,P=i*N+u*d+c*I,g=a*N+E*d+_*I,w=r*S+o*m+s*M,v=i*S+u*m+c*M,D=a*S+E*m+_*M,B=r*O+o*y+s*p+T,x=i*O+u*y+c*p+R,z=a*O+E*y+_*p+l;return n[0]=C,n[1]=U,n[2]=L,n[3]=0,n[4]=F,n[5]=P,n[6]=g,n[7]=0,n[8]=w,n[9]=v,n[10]=D,n[11]=0,n[12]=B,n[13]=x,n[14]=z,n[15]=1,n},c.multiplyByMatrix3=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[4],u=e[5],E=e[6],s=e[8],c=e[9],_=e[10],T=t[0],R=t[1],l=t[2],A=t[3],f=t[4],h=t[5],N=t[6],d=t[7],I=t[8],S=r*T+o*R+s*l,m=i*T+u*R+c*l,M=a*T+E*R+_*l,O=r*A+o*f+s*h,y=i*A+u*f+c*h,p=a*A+E*f+_*h,C=r*N+o*d+s*I,U=i*N+u*d+c*I,L=a*N+E*d+_*I;return n[0]=S,n[1]=m,n[2]=M,n[3]=0,n[4]=O,n[5]=y,n[6]=p,n[7]=0,n[8]=C,n[9]=U,n[10]=L,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},c.multiplyByTranslation=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=r*e[0]+i*e[4]+a*e[8]+e[12],u=r*e[1]+i*e[5]+a*e[9]+e[13],E=r*e[2]+i*e[6]+a*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=E,n[15]=e[15],n};var f=new e;c.multiplyByUniformScale=function(e,t,n){return f.x=t,f.y=t,f.z=t,c.multiplyByScale(e,f,n)},c.multiplyByScale=function(e,t,n){var r=t.x,i=t.y,a=t.z;return 1===r&&1===i&&1===a?c.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=i*e[4],n[5]=i*e[5],n[6]=i*e[6],n[7]=0,n[8]=a*e[8],n[9]=a*e[9],n[10]=a*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},c.multiplyByVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=t.w,u=e[0]*r+e[4]*i+e[8]*a+e[12]*o,E=e[1]*r+e[5]*i+e[9]*a+e[13]*o,s=e[2]*r+e[6]*i+e[10]*a+e[14]*o,c=e[3]*r+e[7]*i+e[11]*a+e[15]*o;return n.x=u,n.y=E,n.z=s,n.w=c,n},c.multiplyByPointAsVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[4]*i+e[8]*a,u=e[1]*r+e[5]*i+e[9]*a,E=e[2]*r+e[6]*i+e[10]*a;return n.x=o,n.y=u,n.z=E,n},c.multiplyByPoint=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[4]*i+e[8]*a+e[12],u=e[1]*r+e[5]*i+e[9]*a+e[13],E=e[2]*r+e[6]*i+e[10]*a+e[14];return n.x=o,n.y=u,n.z=E,n},c.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},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[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},c.transpose=function(e,t){var n=e[1],r=e[2],i=e[3],a=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=a,t[10]=e[10],t[11]=e[14],t[12]=i,t[13]=o,t[14]=u,t[15]=e[15],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[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},c.equals=function(e,t){return e===t||r(e)&&r(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},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&&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},c.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},c.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};var h=new E,N=new E,d=new t,I=new t(0,0,0,1);return c.inverse=function(e,n){if(E.equalsEpsilon(c.getRotation(e,h),N,u.EPSILON7)&&t.equals(c.getRow(e,3,d),I))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],i=e[4],a=e[8],o=e[12],_=e[1],T=e[5],R=e[9],l=e[13],A=e[2],f=e[6],S=e[10],m=e[14],M=e[3],O=e[7],y=e[11],p=e[15],C=S*p,U=m*y,L=f*p,F=m*O,P=f*y,g=S*O,w=A*p,v=m*M,D=A*y,B=S*M,x=A*O,z=f*M,G=C*T+F*R+P*l-(U*T+L*R+g*l),b=U*_+w*R+B*l-(C*_+v*R+D*l),X=L*_+v*T+x*l-(F*_+w*T+z*l),V=g*_+D*T+z*R-(P*_+B*T+x*R),H=U*i+L*a+g*o-(C*i+F*a+P*o),q=C*r+v*a+D*o-(U*r+w*a+B*o),W=F*r+w*i+z*o-(L*r+v*i+x*o),Y=P*r+B*i+x*a-(g*r+D*i+z*a);C=a*l,U=o*R,L=i*l,F=o*T,P=i*R,g=a*T,w=r*l,v=o*_,D=r*R,B=a*_,x=r*T,z=i*_;var K=C*O+F*y+P*p-(U*O+L*y+g*p),k=U*M+w*y+B*p-(C*M+v*y+D*p),Z=L*M+v*O+x*p-(F*M+w*O+z*p),j=g*M+D*O+z*y-(P*M+B*O+x*y),Q=L*S+g*m+U*f-(P*m+C*f+F*S),J=D*m+C*A+v*S-(w*S+B*m+U*A),$=w*f+z*m+F*A-(x*m+L*A+v*f),ee=x*S+P*A+B*f-(D*f+z*S+g*A),te=r*G+i*b+a*X+o*V;if(Math.abs(te)<u.EPSILON20)throw new s("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=G*te,n[1]=b*te,n[2]=X*te,n[3]=V*te,n[4]=H*te,n[5]=q*te,n[6]=W*te,n[7]=Y*te,n[8]=K*te,n[9]=k*te,n[10]=Z*te,n[11]=j*te,n[12]=Q*te,n[13]=J*te,n[14]=$*te,n[15]=ee*te,n},c.inverseTransformation=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[4],o=e[5],u=e[6],E=e[8],s=e[9],c=e[10],_=e[12],T=e[13],R=e[14],l=-n*_-r*T-i*R,A=-a*_-o*T-u*R,f=-E*_-s*T-c*R;return t[0]=n,t[1]=a,t[2]=E,t[3]=0,t[4]=r,t[5]=o,t[6]=s,t[7]=0,t[8]=i,t[9]=u,t[10]=c,t[11]=0,t[12]=l,t[13]=A,t[14]=f,t[15]=1,t},c.IDENTITY=o(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),c.ZERO=o(new c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN0ROW3=3,c.COLUMN1ROW0=4,c.COLUMN1ROW1=5,c.COLUMN1ROW2=6,c.COLUMN1ROW3=7,c.COLUMN2ROW0=8,c.COLUMN2ROW1=9,c.COLUMN2ROW2=10,c.COLUMN2ROW3=11,c.COLUMN3ROW0=12,c.COLUMN3ROW1=13,c.COLUMN3ROW2=14,c.COLUMN3ROW3=15,i(c.prototype,{length:{get:function(){return c.packedLength}}}),c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.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]+")"},c}),define("Core/Rectangle",["./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,i,a,o,u){"use strict";function E(e,n,r,i){this.west=t(e,0),this.south=t(n,0),this.east=t(r,0),this.north=t(i,0)}r(E.prototype,{width:{get:function(){return E.computeWidth(this)}},height:{get:function(){return E.computeHeight(this)}}}),E.packedLength=4,E.pack=function(e,n,r){return r=t(r,0),n[r++]=e.west,n[r++]=e.south,n[r++]=e.east,n[r]=e.north,n},E.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new E),i.west=e[r++],i.south=e[r++],i.east=e[r++],i.north=e[r],i},E.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=u.TWO_PI),t-n},E.computeHeight=function(e){return e.north-e.south},E.fromDegrees=function(e,r,i,a,o){return e=u.toRadians(t(e,0)),r=u.toRadians(t(r,0)),i=u.toRadians(t(i,0)),a=u.toRadians(t(a,0)),n(o)?(o.west=e,o.south=r,o.east=i,o.north=a,o):new E(e,r,i,a)},E.fromCartographicArray=function(e,t){for(var r=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=Number.MAX_VALUE,c=-Number.MAX_VALUE,_=0,T=e.length;_<T;_++){var R=e[_];r=Math.min(r,R.longitude),i=Math.max(i,R.longitude),s=Math.min(s,R.latitude),c=Math.max(c,R.latitude);var l=R.longitude>=0?R.longitude:R.longitude+u.TWO_PI;a=Math.min(a,l),o=Math.max(o,l)}return i-r>o-a&&(r=a,i=o,i>u.PI&&(i-=u.TWO_PI),r>u.PI&&(r-=u.TWO_PI)),n(t)?(t.west=r,t.south=s,t.east=i,t.north=c,t):new E(r,s,i,c)},E.fromCartesianArray=function(e,t,r){for(var i=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,s=-Number.MAX_VALUE,c=Number.MAX_VALUE,_=-Number.MAX_VALUE,T=0,R=e.length;T<R;T++){var l=t.cartesianToCartographic(e[T]);i=Math.min(i,l.longitude),a=Math.max(a,l.longitude),c=Math.min(c,l.latitude),_=Math.max(_,l.latitude);var A=l.longitude>=0?l.longitude:l.longitude+u.TWO_PI;o=Math.min(o,A),s=Math.max(s,A)}return a-i>s-o&&(i=o,a=s,a>u.PI&&(a-=u.TWO_PI),i>u.PI&&(i-=u.TWO_PI)),n(r)?(r.west=i,r.south=c,r.east=a,r.north=_,r):new E(i,c,a,_)},E.clone=function(e,t){if(n(e))return n(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new E(e.west,e.south,e.east,e.north)},E.prototype.clone=function(e){return E.clone(this,e)},E.prototype.equals=function(e){return E.equals(this,e)},E.equals=function(e,t){return e===t||n(e)&&n(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},E.prototype.equalsEpsilon=function(e,t){return n(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},E.validate=function(e){},E.southwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.south,r.height=0,r):new e(t.west,t.south)},E.northwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.north,r.height=0,r):new e(t.west,t.north)},E.northeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.north,r.height=0,r):new e(t.east,t.north)},E.southeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.south,r.height=0,r):new e(t.east,t.south)},E.center=function(t,r){var i=t.east,a=t.west;i<a&&(i+=u.TWO_PI);var o=u.negativePiToPi(.5*(a+i)),E=.5*(t.south+t.north);return n(r)?(r.longitude=o,r.latitude=E,r.height=0,r):new e(o,E)},E.intersection=function(e,t,r){var i=e.east,a=e.west,o=t.east,s=t.west;i<a&&o>0?i+=u.TWO_PI:o<s&&i>0&&(o+=u.TWO_PI),i<a&&s<0?s+=u.TWO_PI:o<s&&a<0&&(a+=u.TWO_PI);var c=u.negativePiToPi(Math.max(a,s)),_=u.negativePiToPi(Math.min(i,o));if(!((e.west<e.east||t.west<t.east)&&_<=c)){var T=Math.max(e.south,t.south),R=Math.min(e.north,t.north);if(!(T>=R))return n(r)?(r.west=c,r.south=T,r.east=_,r.north=R,r):new E(c,T,_,R)}},E.simpleIntersection=function(e,t,r){var i=Math.max(e.west,t.west),a=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(a>=u||i>=o))return n(r)?(r.west=i,r.south=a,r.east=o,r.north=u,r):new E(i,a,o,u)},E.union=function(e,t,r){n(r)||(r=new E);var i=e.east,a=e.west,o=t.east,s=t.west;i<a&&o>0?i+=u.TWO_PI:o<s&&i>0&&(o+=u.TWO_PI),i<a&&s<0?s+=u.TWO_PI:o<s&&a<0&&(a+=u.TWO_PI);var c=u.convertLongitudeRange(Math.min(a,s)),_=u.convertLongitudeRange(Math.max(i,o));return r.west=c,r.south=Math.min(e.south,t.south),r.east=_,r.north=Math.max(e.north,t.north),r},E.expand=function(e,t,r){return n(r)||(r=new E),r.west=Math.min(e.west,t.longitude),r.south=Math.min(e.south,t.latitude),r.east=Math.max(e.east,t.longitude),r.north=Math.max(e.north,t.latitude),r},E.contains=function(e,t){var n=t.longitude,r=t.latitude,i=e.west,a=e.east;return a<i&&(a+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>i||u.equalsEpsilon(n,i,u.EPSILON14))&&(n<a||u.equalsEpsilon(n,a,u.EPSILON14))&&r>=e.south&&r<=e.north};var s=new e;return E.subsample=function(e,r,i,o){r=t(r,a.WGS84),i=t(i,0),n(o)||(o=[]);var c=0,_=e.north,T=e.south,R=e.east,l=e.west,A=s;A.height=i,A.longitude=l,A.latitude=_,o[c]=r.cartographicToCartesian(A,o[c]),c++,A.longitude=R,o[c]=r.cartographicToCartesian(A,o[c]),c++,A.latitude=T,o[c]=r.cartographicToCartesian(A,o[c]),c++,A.longitude=l,o[c]=r.cartographicToCartesian(A,o[c]),c++,_<0?A.latitude=_:T>0?A.latitude=T:A.latitude=0;for(var f=1;f<8;++f)A.longitude=-Math.PI+f*u.PI_OVER_TWO,E.contains(e,A)&&(o[c]=r.cartographicToCartesian(A,o[c]),c++);return 0===A.latitude&&(A.longitude=l,o[c]=r.cartographicToCartesian(A,o[c]),c++,A.longitude=R,o[c]=r.cartographicToCartesian(A,o[c]),c++),o.length=c,o},E.MAX_VALUE=o(new E(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),E}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,i,a,o,u,E,s,c,_){"use strict";function T(t,r){this.center=e.clone(n(t,e.ZERO)),this.radius=n(r,0)}var R=new e,l=new e,A=new e,f=new e,h=new e,N=new e,d=new e,I=new e,S=new e,m=new e,M=new e,O=new e;T.fromPoints=function(t,n){if(r(n)||(n=new T),!r(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var i=e.clone(t[0],d),a=e.clone(i,R),o=e.clone(i,l),u=e.clone(i,A),E=e.clone(i,f),s=e.clone(i,h),c=e.clone(i,N),_=t.length,y=1;y<_;y++){e.clone(t[y],i);var p=i.x,C=i.y,U=i.z;p<a.x&&e.clone(i,a),p>E.x&&e.clone(i,E),C<o.y&&e.clone(i,o),C>s.y&&e.clone(i,s),U<u.z&&e.clone(i,u),U>c.z&&e.clone(i,c)}var L=e.magnitudeSquared(e.subtract(E,a,I)),F=e.magnitudeSquared(e.subtract(s,o,I)),P=e.magnitudeSquared(e.subtract(c,u,I)),g=a,w=E,v=L;F>v&&(v=F,g=o,w=s),P>v&&(v=P,g=u,w=c);var D=S;D.x=.5*(g.x+w.x),D.y=.5*(g.y+w.y),D.z=.5*(g.z+w.z);var B=e.magnitudeSquared(e.subtract(w,D,I)),x=Math.sqrt(B),z=m;z.x=a.x,z.y=o.y,z.z=u.z;var G=M;G.x=E.x,G.y=s.y,G.z=c.z;var b=e.multiplyByScalar(e.add(z,G,I),.5,O),X=0;for(y=0;y<_;y++){e.clone(t[y],i);var V=e.magnitude(e.subtract(i,b,I));V>X&&(X=V);var H=e.magnitudeSquared(e.subtract(i,D,I));if(H>B){var q=Math.sqrt(H);x=.5*(x+q),B=x*x;var W=q-x;D.x=(x*D.x+W*i.x)/q,D.y=(x*D.y+W*i.y)/q,D.z=(x*D.z+W*i.z)/q}}return x<X?(e.clone(D,n.center),n.radius=x):(e.clone(b,n.center),n.radius=X),n};var y=new o,p=new e,C=new e,U=new t,L=new t;T.fromRectangle2D=function(e,t,n){return T.fromRectangleWithHeights2D(e,t,0,0,n)},T.fromRectangleWithHeights2D=function(t,i,a,o,u){if(r(u)||(u=new T),!r(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;i=n(i,y),_.southwest(t,U),U.height=a,_.northeast(t,L),L.height=o;var E=i.project(U,p),s=i.project(L,C),c=s.x-E.x,R=s.y-E.y,l=s.z-E.z;u.radius=.5*Math.sqrt(c*c+R*R+l*l);var A=u.center;return A.x=E.x+.5*c,A.y=E.y+.5*R,A.z=E.z+.5*l,u};var F=[];T.fromRectangle3D=function(e,t,i,o){t=n(t,a.WGS84),i=n(i,0);var u;return r(e)&&(u=_.subsample(e,t,i,F)),T.fromPoints(u,o)},T.fromVertices=function(t,i,a,o){if(r(o)||(o=new T),!r(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;i=n(i,e.ZERO),a=n(a,3);var u=d;u.x=t[0]+i.x,u.y=t[1]+i.y,u.z=t[2]+i.z;for(var E=e.clone(u,R),s=e.clone(u,l),c=e.clone(u,A),_=e.clone(u,f),y=e.clone(u,h),p=e.clone(u,N),C=t.length,U=0;U<C;U+=a){var L=t[U]+i.x,F=t[U+1]+i.y,P=t[U+2]+i.z;u.x=L,u.y=F,u.z=P,L<E.x&&e.clone(u,E),L>_.x&&e.clone(u,_),F<s.y&&e.clone(u,s),F>y.y&&e.clone(u,y),P<c.z&&e.clone(u,c),P>p.z&&e.clone(u,p)}var g=e.magnitudeSquared(e.subtract(_,E,I)),w=e.magnitudeSquared(e.subtract(y,s,I)),v=e.magnitudeSquared(e.subtract(p,c,I)),D=E,B=_,x=g;w>x&&(x=w,D=s,B=y),v>x&&(x=v,D=c,B=p);var z=S;z.x=.5*(D.x+B.x),z.y=.5*(D.y+B.y),z.z=.5*(D.z+B.z);var G=e.magnitudeSquared(e.subtract(B,z,I)),b=Math.sqrt(G),X=m;X.x=E.x,X.y=s.y,X.z=c.z;var V=M;V.x=_.x,V.y=y.y,V.z=p.z;var H=e.multiplyByScalar(e.add(X,V,I),.5,O),q=0;for(U=0;U<C;U+=a){u.x=t[U]+i.x,u.y=t[U+1]+i.y,u.z=t[U+2]+i.z;var W=e.magnitude(e.subtract(u,H,I));W>q&&(q=W);var Y=e.magnitudeSquared(e.subtract(u,z,I));if(Y>G){var K=Math.sqrt(Y);b=.5*(b+K),G=b*b;var k=K-b;z.x=(b*z.x+k*u.x)/K,z.y=(b*z.y+k*u.y)/K,z.z=(b*z.z+k*u.z)/K}}return b<q?(e.clone(z,o.center),o.radius=b):(e.clone(H,o.center),o.radius=q),o},T.fromEncodedCartesianVertices=function(t,n,i){if(r(i)||(i=new T),!r(t)||!r(n)||t.length!==n.length||0===t.length)return i.center=e.clone(e.ZERO,i.center),i.radius=0,i;var a=d;a.x=t[0]+n[0],a.y=t[1]+n[1],a.z=t[2]+n[2];for(var o=e.clone(a,R),u=e.clone(a,l),E=e.clone(a,A),s=e.clone(a,f),c=e.clone(a,h),_=e.clone(a,N),y=t.length,p=0;p<y;p+=3){var C=t[p]+n[p],U=t[p+1]+n[p+1],L=t[p+2]+n[p+2];a.x=C,a.y=U,a.z=L,C<o.x&&e.clone(a,o),C>s.x&&e.clone(a,s),U<u.y&&e.clone(a,u),U>c.y&&e.clone(a,c),L<E.z&&e.clone(a,E),L>_.z&&e.clone(a,_)}var F=e.magnitudeSquared(e.subtract(s,o,I)),P=e.magnitudeSquared(e.subtract(c,u,I)),g=e.magnitudeSquared(e.subtract(_,E,I)),w=o,v=s,D=F;P>D&&(D=P,w=u,v=c),g>D&&(D=g,w=E,v=_);var B=S;B.x=.5*(w.x+v.x),B.y=.5*(w.y+v.y),B.z=.5*(w.z+v.z);var x=e.magnitudeSquared(e.subtract(v,B,I)),z=Math.sqrt(x),G=m;G.x=o.x,G.y=u.y,G.z=E.z;var b=M;b.x=s.x,b.y=c.y,b.z=_.z;var X=e.multiplyByScalar(e.add(G,b,I),.5,O),V=0;for(p=0;p<y;p+=3){a.x=t[p]+n[p],a.y=t[p+1]+n[p+1],a.z=t[p+2]+n[p+2];var H=e.magnitude(e.subtract(a,X,I));H>V&&(V=H);var q=e.magnitudeSquared(e.subtract(a,B,I));if(q>x){var W=Math.sqrt(q);z=.5*(z+W),x=z*z;var Y=W-z;B.x=(z*B.x+Y*a.x)/W,B.y=(z*B.y+Y*a.y)/W,B.z=(z*B.z+Y*a.z)/W}}return z<V?(e.clone(B,i.center),i.radius=z):(e.clone(X,i.center),i.radius=V),i},T.fromCornerPoints=function(t,n,i){r(i)||(i=new T);var a=i.center;return e.add(t,n,a),e.multiplyByScalar(a,.5,a),i.radius=e.distance(a,n),i},T.fromEllipsoid=function(t,n){return r(n)||(n=new T),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var P=new e;T.fromBoundingSpheres=function(t,n){if(r(n)||(n=new T),!r(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var i=t.length;if(1===i)return T.clone(t[0],n);if(2===i)return T.union(t[0],t[1],n);for(var a=[],o=0;o<i;o++)a.push(t[o].center);n=T.fromPoints(a,n);var u=n.center,E=n.radius;for(o=0;o<i;o++){var s=t[o];E=Math.max(E,e.distance(u,s.center,P)+s.radius)}return n.radius=E,n};var g=new e,w=new e,v=new e;T.fromOrientedBoundingBox=function(t,n){r(n)||(n=new T);var i=t.halfAxes,a=s.getColumn(i,0,g),o=s.getColumn(i,1,w),u=s.getColumn(i,2,v),E=e.magnitude(a),c=e.magnitude(o),_=e.magnitude(u);return n.center=e.clone(t.center,n.center),n.radius=Math.max(E,c,_),n},T.clone=function(t,n){if(r(t))return r(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new T(t.center,t.radius)},T.packedLength=4,T.pack=function(e,t,r){r=n(r,0);var i=e.center;return t[r++]=i.x,t[r++]=i.y,t[r++]=i.z,t[r]=e.radius,t},T.unpack=function(e,t,i){t=n(t,0),r(i)||(i=new T);var a=i.center;return a.x=e[t++],a.y=e[t++],a.z=e[t++],i.radius=e[t],i};var D=new e,B=new e;T.union=function(t,n,i){r(i)||(i=new T);var a=t.center,o=t.radius,u=n.center,E=n.radius,s=e.subtract(u,a,D),c=e.magnitude(s);if(o>=c+E)return t.clone(i),i;if(E>=c+o)return n.clone(i),i;var _=.5*(o+c+E),R=e.multiplyByScalar(s,(-o+_)/c,B);return e.add(R,a,R),e.clone(R,i.center),i.radius=_,i};var x=new e;T.expand=function(t,n,r){r=T.clone(t,r);var i=e.magnitude(e.subtract(n,r.center,x));return i>r.radius&&(r.radius=i),r},T.intersectPlane=function(t,n){var r=t.center,i=t.radius,a=n.normal,o=e.dot(a,r)+n.distance;return o<-i?u.OUTSIDE:o<i?u.INTERSECTING:u.INSIDE},T.transform=function(e,t,n){return r(n)||(n=new T),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=c.getMaximumScale(t)*e.radius,n};var z=new e;T.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,z);return e.magnitudeSquared(r)-t.radius*t.radius},T.transformWithoutScale=function(e,t,n){return r(n)||(n=new T),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var G=new e;T.computePlaneDistances=function(t,n,i,a){r(a)||(a=new E);var o=e.subtract(t.center,n,G),u=e.dot(i,o);return a.start=u-t.radius,a.stop=u+t.radius,a};for(var b=new e,X=new e,V=new e,H=new e,q=new e,W=new t,Y=new Array(8),K=0;K<8;++K)Y[K]=new e;var k=new o;return T.projectTo2D=function(t,r,i){r=n(r,k);var a=r.ellipsoid,o=t.center,u=t.radius,E=a.geodeticSurfaceNormal(o,b),s=e.cross(e.UNIT_Z,E,X);e.normalize(s,s);var c=e.cross(E,s,V);e.normalize(c,c),e.multiplyByScalar(E,u,E),e.multiplyByScalar(c,u,c),e.multiplyByScalar(s,u,s);var _=e.negate(c,q),R=e.negate(s,H),l=Y,A=l[0];e.add(E,c,A),e.add(A,s,A),A=l[1],e.add(E,c,A),e.add(A,R,A),A=l[2],e.add(E,_,A),e.add(A,R,A),A=l[3],e.add(E,_,A),e.add(A,s,A),e.negate(E,E),A=l[4],e.add(E,c,A),e.add(A,s,A),A=l[5],e.add(E,c,A),e.add(A,R,A),A=l[6],e.add(E,_,A),e.add(A,R,A),A=l[7],e.add(E,_,A),e.add(A,s,A);for(var f=l.length,h=0;h<f;++h){var N=l[h];e.add(o,N,N);var d=a.cartesianToCartographic(N,W);r.project(d,N)}i=T.fromPoints(l,i),o=i.center;var I=o.x,S=o.y,m=o.z;return o.x=m,o.y=I,o.z=S,i},T.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},T.equals=function(t,n){return t===n||r(t)&&r(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},T.prototype.intersectPlane=function(e){return T.intersectPlane(this,e)},T.prototype.distanceSquaredTo=function(e){return T.distanceSquaredTo(this,e)},T.prototype.computePlaneDistances=function(e,t,n){return T.computePlaneDistances(this,e,t,n)},T.prototype.isOccluded=function(e){return T.isOccluded(this,e)},T.prototype.equals=function(e){return T.equals(this,e)},T.prototype.clone=function(e){return T.clone(this,e)},T}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},i={};return t(i,{element:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(i.supportsFullscreen())return null!==i.element}}}),i.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var i,a=["webkit","moz","o","ms","khtml"],o=0,u=a.length;o<u;++o){var E=a[o];i=E+"RequestFullscreen","function"==typeof t[i]?(r.requestFullscreen=i,n=!0):(i=E+"RequestFullScreen","function"==typeof t[i]&&(r.requestFullscreen=i,n=!0)),i=E+"ExitFullscreen","function"==typeof document[i]?r.exitFullscreen=i:(i=E+"CancelFullScreen","function"==typeof document[i]&&(r.exitFullscreen=i)),i=E+"FullscreenEnabled",void 0!==document[i]?r.fullscreenEnabled=i:(i=E+"FullScreenEnabled",void 0!==document[i]&&(r.fullscreenEnabled=i)),i=E+"FullscreenElement",void 0!==document[i]?r.fullscreenElement=i:(i=E+"FullScreenElement",void 0!==document[i]&&(r.fullscreenElement=i)),i=E+"fullscreenchange",void 0!==document["on"+i]&&("ms"===E&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=E+"fullscreenerror",void 0!==document["on"+i]&&("ms"===E&&(i="MSFullscreenError"),r.fullscreenerror=i)}return n},i.requestFullscreen=function(e,t){i.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},i.exitFullscreen=function(){i.supportsFullscreen()&&document[r.exitFullscreen]()},i}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function i(){if(!t(S)&&(S=!1,!T())){var e=/ Chrome\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(S=!0,m=r(e[1]))}return S}function a(){return i()&&m}function o(){if(!t(M)&&(M=!1,!i()&&!T()&&/ Safari\/[\.0-9]+/.test(I.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(M=!0,O=r(e[1]))}return M}function u(){return o()&&O}function E(){if(!t(y)){y=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(I.userAgent);null!==e&&(y=!0,p=r(e[1]),p.isNightly=!!e[2])}return y}function s(){return E()&&p}function c(){if(!t(C)){C=!1;var e;"Microsoft Internet Explorer"===I.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==e&&(C=!0,U=r(e[1]))):"Netscape"===I.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==e&&(C=!0,U=r(e[1])))}return C}function _(){return c()&&U}function T(){if(!t(L)){L=!1;var e=/ Edge\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(L=!0,F=r(e[1]))}return L}function R(){return T()&&F}function l(){if(!t(P)){P=!1;var e=/Firefox\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(P=!0,g=r(e[1]))}return P}function A(){return t(w)||(w=/Windows/i.test(I.appVersion)),w}function f(){return l()&&g}function h(){return t(v)||(v="undefined"!=typeof PointerEvent&&(!t(I.pointerEnabled)||I.pointerEnabled)),v}function N(){ -if(!t(B)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;B=t(n)&&""!==n,B&&(D=n)}return B}function d(){return N()?D:void 0}var I;I="undefined"!=typeof navigator?navigator:{};var S,m,M,O,y,p,C,U,L,F,P,g,w,v,D,B,x={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:E,webkitVersion:s,isInternetExplorer:c,internetExplorerVersion:_,isEdge:T,edgeVersion:R,isFirefox:l,firefoxVersion:f,isWindows:A,hardwareConcurrency:e(I.hardwareConcurrency,3),supportsPointerEvents:h,supportsImageRenderingPixelated:N,imageRenderingValue:d};return x.supportsFullscreen=function(){return n.supportsFullscreen()},x.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},x.supportsWebWorkers=function(){return"undefined"!=typeof Worker},x}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,i,a){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:a.BYTE,UNSIGNED_BYTE:a.UNSIGNED_BYTE,SHORT:a.SHORT,UNSIGNED_SHORT:a.UNSIGNED_SHORT,INT:a.INT,UNSIGNED_INT:a.UNSIGNED_INT,FLOAT:a.FLOAT,DOUBLE:a.DOUBLE};return o.getSizeInBytes=function(e){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.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},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 Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,i){switch(r=e(r,0),i=e(i,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,i);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,i);case o.SHORT:return new Int16Array(n,r,i);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,i);case o.INT:return new Int32Array(n,r,i);case o.UNSIGNED_INT:return new Uint32Array(n,r,i);case o.FLOAT:return new Float32Array(n,r,i);case o.DOUBLE:return new Float64Array(n,r,i)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},i(o)}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===n.POINTS||e===n.LINES||e===n.LINE_LOOP||e===n.LINE_STRIP||e===n.TRIANGLES||e===n.TRIANGLE_STRIP||e===n.TRIANGLE_FAN}};return e(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,i){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,i.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return a.computeNumberOfVertices=function(e){var n=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var i=e.attributes[r],a=i.values.length/i.componentsPerAttribute;n=a}return n},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(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 r}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.binormal=t.binormal,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/BoxOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./PrimitiveType"],function(e,t,n,r,i,a,o,u,E,s){"use strict";function c(e){e=r(e,r.EMPTY_OBJECT);var n=e.minimum,i=e.maximum;this._min=t.clone(n),this._max=t.clone(i),this._workerName="createBoxOutlineGeometry"}var _=new t;c.fromDimensions=function(e){e=r(e,r.EMPTY_OBJECT);var n=e.dimensions,i=t.multiplyByScalar(n,.5,new t);return new c({minimum:t.negate(i,new t),maximum:i})},c.fromAxisAlignedBoundingBox=function(e){return new c({minimum:e.minimum,maximum:e.maximum})},c.packedLength=2*t.packedLength,c.pack=function(e,n,i){return i=r(i,0),t.pack(e._min,n,i),t.pack(e._max,n,i+t.packedLength),n};var T=new t,R=new t,l={minimum:T,maximum:R};return c.unpack=function(e,n,a){n=r(n,0);var o=t.unpack(e,n,T),u=t.unpack(e,n+t.packedLength,R);return i(a)?(a._min=t.clone(o,a._min),a._max=t.clone(u,a._max),a):new c(l)},c.createGeometry=function(r){var i=r._min,a=r._max;if(!t.equals(i,a)){var c=new E,T=new Uint16Array(24),R=new Float64Array(24);R[0]=i.x,R[1]=i.y,R[2]=i.z,R[3]=a.x,R[4]=i.y,R[5]=i.z,R[6]=a.x,R[7]=a.y,R[8]=i.z,R[9]=i.x,R[10]=a.y,R[11]=i.z,R[12]=i.x,R[13]=i.y,R[14]=a.z,R[15]=a.x,R[16]=i.y,R[17]=a.z,R[18]=a.x,R[19]=a.y,R[20]=a.z,R[21]=i.x,R[22]=a.y,R[23]=a.z,c.position=new u({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:R}),T[0]=4,T[1]=5,T[2]=5,T[3]=6,T[4]=6,T[5]=7,T[6]=7,T[7]=4,T[8]=0,T[9]=1,T[10]=1,T[11]=2,T[12]=2,T[13]=3,T[14]=3,T[15]=0,T[16]=0,T[17]=4,T[18]=1,T[19]=5,T[20]=2,T[21]=6,T[22]=3,T[23]=7;var l=t.subtract(a,i,_),A=.5*t.magnitude(l);return new o({attributes:c,indices:T,primitiveType:s.LINES,boundingSphere:new e(t.ZERO,A)})}},c}),define("Workers/createBoxOutlineGeometry",["../Core/BoxOutlineGeometry","../Core/defined"],function(e,t){"use strict";return function(n,r){return t(r)&&(n=e.unpack(n,r)),e.createGeometry(n)}})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e){return e+" is required, actual value was undefined"}function r(e,t,n){return"Expected "+n+" to be typeof "+t+", actual typeof was "+e}var i={};return i.typeOf={},i.defined=function(r,i){if(!e(i))throw new t(n(r))},i.typeOf.func=function(e,n){if("function"!=typeof n)throw new t(r(typeof n,"function",e))},i.typeOf.string=function(e,n){if("string"!=typeof n)throw new t(r(typeof n,"string",e))},i.typeOf.number=function(e,n){if("number"!=typeof n)throw new t(r(typeof n,"number",e))},i.typeOf.number.lessThan=function(e,n,r){if(i.typeOf.number(e,n),n>=r)throw new t("Expected "+e+" to be less than "+r+", actual value was "+n)},i.typeOf.number.lessThanOrEquals=function(e,n,r){if(i.typeOf.number(e,n),n>r)throw new t("Expected "+e+" to be less than or equal to "+r+", actual value was "+n)},i.typeOf.number.greaterThan=function(e,n,r){if(i.typeOf.number(e,n),n<=r)throw new t("Expected "+e+" to be greater than "+r+", actual value was "+n)},i.typeOf.number.greaterThanOrEquals=function(e,n,r){if(i.typeOf.number(e,n),n<r)throw new t("Expected "+e+" to be greater than or equal to"+r+", actual value was "+n)},i.typeOf.object=function(e,n){if("object"!=typeof n)throw new t(r(typeof n,"object",e))},i.typeOf.bool=function(e,n){if("boolean"!=typeof n)throw new t(r(typeof n,"boolean",e))},i}),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";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),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 n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(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^=e<<7&2636928640,e^=e<<15&4022730752,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,n,r){"use strict";var i={};i.EPSILON1=.1,i.EPSILON2=.01,i.EPSILON3=.001,i.EPSILON4=1e-4,i.EPSILON5=1e-5,i.EPSILON6=1e-6,i.EPSILON7=1e-7,i.EPSILON8=1e-8,i.EPSILON9=1e-9,i.EPSILON10=1e-10,i.EPSILON11=1e-11,i.EPSILON12=1e-12,i.EPSILON13=1e-13,i.EPSILON14=1e-14,i.EPSILON15=1e-15,i.EPSILON16=1e-16,i.EPSILON17=1e-17,i.EPSILON18=1e-18,i.EPSILON19=1e-19,i.EPSILON20=1e-20,i.GRAVITATIONALPARAMETER=3986004418e5,i.SOLAR_RADIUS=6955e5,i.LUNAR_RADIUS=1737400,i.SIXTY_FOUR_KILOBYTES=65536,i.sign=function(e){return e>0?1:e<0?-1:0},i.signNotZero=function(e){return e<0?-1:1},i.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*i.clamp(e,-1,1)+.5)*n)},i.fromSNorm=function(e,n){return n=t(n,255),i.clamp(e,0,n)/n*2-1},i.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},i.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},i.lerp=function(e,t,n){return(1-n)*e+n*t},i.PI=Math.PI,i.ONE_OVER_PI=1/Math.PI,i.PI_OVER_TWO=.5*Math.PI,i.PI_OVER_THREE=Math.PI/3,i.PI_OVER_FOUR=Math.PI/4,i.PI_OVER_SIX=Math.PI/6,i.THREE_PI_OVER_TWO=3*Math.PI*.5,i.TWO_PI=2*Math.PI,i.ONE_OVER_TWO_PI=1/(2*Math.PI),i.RADIANS_PER_DEGREE=Math.PI/180,i.DEGREES_PER_RADIAN=180/Math.PI,i.RADIANS_PER_ARCSECOND=i.RADIANS_PER_DEGREE/3600,i.toRadians=function(e){return e*i.RADIANS_PER_DEGREE},i.toDegrees=function(e){return e*i.DEGREES_PER_RADIAN},i.convertLongitudeRange=function(e){var t=i.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},i.clampToLatitudeRange=function(e){return i.clamp(e,-1*i.PI_OVER_TWO,i.PI_OVER_TWO)},i.negativePiToPi=function(e){return i.zeroToTwoPi(e+i.PI)-i.PI},i.zeroToTwoPi=function(e){var t=i.mod(e,i.TWO_PI);return Math.abs(t)<i.EPSILON14&&Math.abs(e)>i.EPSILON14?i.TWO_PI:t},i.mod=function(e,t){return(e%t+t)%t},i.equalsEpsilon=function(e,n,r,i){i=t(i,r);var a=Math.abs(e-n);return a<=i||a<=r*Math.max(Math.abs(e),Math.abs(n))};var a=[1];i.factorial=function(e){var t=a.length;if(e>=t)for(var n=a[t-1],r=t;r<=e;r++)a.push(n*r);return a[e]},i.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},i.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},i.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},i.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return i.setRandomNumberSeed=function(t){o=new e(t)},i.nextRandomNumber=function(){return o.random()},i.acosClamped=function(e){return Math.acos(i.clamp(e,-1,1))},i.asinClamped=function(e){return Math.asin(i.clamp(e,-1,1))},i.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},i.logBase=function(e,t){return Math.log(e)/Math.log(t)},i.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},i}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var i=e.clock,a=e.cone,u=t(e.magnitude,1),E=u*Math.sin(a);return r.x=E*Math.cos(i),r.y=E*Math.sin(i),r.z=u*Math.cos(a),r},o.fromElements=function(e,t,r,i){return n(i)?(i.x=e,i.y=t,i.z=r,i):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new o),i.x=e[r++],i.y=e[r++],i.z=e[r],i},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var i=0;i<r;++i)o.pack(e[i],t,3*i);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var i=0;i<r;i+=3){var a=i/3;t[a]=o.unpack(e,i,t[a])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,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};var E=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,E),r=o.multiplyByScalar(e,1-n,r),o.add(E,r,r)};var s=new o,c=new o;o.angleBetween=function(e,t){o.normalize(e,s),o.normalize(t,c);var n=o.dot(s,c),r=o.magnitude(o.cross(s,c,s));return Math.atan2(r,n)};var _=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,_);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,i){return e===t||n(e)&&n(t)&&a.equalsEpsilon(e.x,t.x,r,i)&&a.equalsEpsilon(e.y,t.y,r,i)&&a.equalsEpsilon(e.z,t.z,r,i)},o.cross=function(e,t,n){var r=e.x,i=e.y,a=e.z,o=t.x,u=t.y,E=t.z,s=i*E-a*u,c=a*o-r*E,_=r*u-i*o;return n.x=s,n.y=c,n.z=_,n},o.fromDegrees=function(e,t,n,r,i){return e=a.toRadians(e),t=a.toRadians(t),o.fromRadians(e,t,n,r,i)};var T=new o,R=new o,l=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,i,a,u){i=t(i,0);var E=n(a)?a.radiiSquared:l,s=Math.cos(r);T.x=s*Math.cos(e),T.y=s*Math.sin(e),T.z=Math.sin(r),T=o.normalize(T,T),o.multiplyComponents(E,T,R);var c=Math.sqrt(o.dot(T,R));return R=o.divideByScalar(R,c,R),T=o.multiplyByScalar(T,i,T),n(u)||(u=new o),o.add(R,T,u)},o.fromDegreesArray=function(e,t,r){var i=e.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],E=e[a+1],s=a/2;r[s]=o.fromDegrees(u,E,0,t,r[s])}return r},o.fromRadiansArray=function(e,t,r){var i=e.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],E=e[a+1],s=a/2;r[s]=o.fromRadians(u,E,0,t,r[s])}return r},o.fromDegreesArrayHeights=function(e,t,r){var i=e.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],E=e[a+1],s=e[a+2],c=a/3;r[c]=o.fromDegrees(u,E,s,t,r[c])}return r},o.fromRadiansArrayHeights=function(e,t,r){var i=e.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],E=e[a+1],s=e[a+2],c=a/3;r[c]=o.fromRadians(u,E,s,t,r[c])}return r},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,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function i(n,i,u,E,s){var c=n.x,_=n.y,T=n.z,R=i.x,l=i.y,A=i.z,f=c*c*R*R,h=_*_*l*l,N=T*T*A*A,d=f+h+N,I=Math.sqrt(1/d),S=e.multiplyByScalar(n,I,a);if(d<E)return isFinite(I)?e.clone(S,s):void 0;var M=u.x,O=u.y,m=u.z,y=o;y.x=S.x*M*2,y.y=S.y*O*2,y.z=S.z*m*2;var p,C,U,L,F,P,w,g,v,B,D,x=(1-I)*e.magnitude(n)/(.5*e.magnitude(y)),z=0;do{x-=z,U=1/(1+x*M),L=1/(1+x*O),F=1/(1+x*m),P=U*U,w=L*L,g=F*F,v=P*U,B=w*L,D=g*F,p=f*P+h*w+N*g-1,C=f*v*M+h*B*O+N*D*m;var G=-2*C;z=p/G}while(Math.abs(p)>r.EPSILON12);return t(s)?(s.x=c*U,s.y=_*L,s.z=T*F,s):new e(c*U,_*L,T*F)}var a=new e,o=new e;return i}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,i,a,o){"use strict";function u(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)}u.fromRadians=function(e,r,i,a){return i=t(i,0),n(a)?(a.longitude=e,a.latitude=r,a.height=i,a):new u(e,r,i)},u.fromDegrees=function(e,t,n,r){return e=a.toRadians(e),t=a.toRadians(t),u.fromRadians(e,t,n,r)};var E=new e,s=new e,c=new e,_=new e(1/6378137,1/6378137,1/6356752.314245179),T=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),R=a.EPSILON1;return u.fromCartesian=function(t,r,i){var l=n(r)?r.oneOverRadii:_,A=n(r)?r.oneOverRadiiSquared:T,f=n(r)?r._centerToleranceSquared:R,h=o(t,l,A,f,s);if(n(h)){var N=e.multiplyComponents(h,A,E);N=e.normalize(N,N);var d=e.subtract(t,h,c),I=Math.atan2(N.y,N.x),S=Math.asin(N.z),M=a.sign(e.dot(d,t))*e.magnitude(d);return n(i)?(i.longitude=I,i.latitude=S,i.height=M,i):new u(I,S,M)}},u.clone=function(e,t){if(n(e))return n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},u.ZERO=i(new u(0,0,0)),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,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,i,a,o,u,E){"use strict";function s(t,r,i,a){r=n(r,0),i=n(i,0),a=n(a,0),t._radii=new e(r,i,a),t._radiiSquared=new e(r*r,i*i,a*a),t._radiiToTheFourth=new e(r*r*r*r,i*i*i*i,a*a*a*a),t._oneOverRadii=new e(0===r?0:1/r,0===i?0:1/i,0===a?0:1/a),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===i?0:1/(i*i),0===a?0:1/(a*a)),t._minimumRadius=Math.min(r,i,a),t._maximumRadius=Math.max(r,i,a),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function c(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,s(this,e,t,n)}i(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,n){if(r(t)){var i=t._radii;return r(n)?(e.clone(i,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new c(i.x,i.y,i.z)}},c.fromCartesian3=function(e,t){return r(t)||(t=new c),r(e)?(s(t,e.x,e.y,e.z),t):t},c.WGS84=o(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=o(new c(1,1,1)),c.MOON=o(new c(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),c.prototype.clone=function(e){return c.clone(this,e)},c.packedLength=e.packedLength,c.pack=function(t,r,i){return i=n(i,0),e.pack(t._radii,r,i),r},c.unpack=function(t,r,i){r=n(r,0);var a=e.unpack(t,r);return c.fromCartesian3(a,i)},c.prototype.geocentricSurfaceNormal=e.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(t,n){var i=t.longitude,a=t.latitude,o=Math.cos(a),u=o*Math.cos(i),E=o*Math.sin(i),s=Math.sin(a);return r(n)||(n=new e),n.x=u,n.y=E,n.z=s,e.normalize(n,n)},c.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var _=new e,T=new e;c.prototype.cartographicToCartesian=function(t,n){var i=_,a=T;this.geodeticSurfaceNormalCartographic(t,i),e.multiplyComponents(this._radiiSquared,i,a);var o=Math.sqrt(e.dot(i,a));return e.divideByScalar(a,o,a),e.multiplyByScalar(i,t.height,i),r(n)||(n=new e),e.add(a,i,n)},c.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;i<n;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var R=new e,l=new e,A=new e;return c.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,l);if(r(a)){var o=this.geodeticSurfaceNormal(a,R),E=e.subtract(n,a,A),s=Math.atan2(o.y,o.x),c=Math.asin(o.z),_=u.sign(e.dot(E,n))*e.magnitude(E);return r(i)?(i.longitude=s,i.latitude=c,i.height=_,i):new t(s,c,_)}},c.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;i<n;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t},c.prototype.scaleToGeodeticSurface=function(e,t){return E(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},c.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var i=t.x,a=t.y,o=t.z,u=this._oneOverRadiiSquared,E=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*u.z);return e.multiplyByScalar(t,E,n)},c.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},c.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},c.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},c.prototype.toString=function(){return this._radii.toString()},c.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,i,a){i=n(i,0);var o=this._sqauredXOverSquaredZ;if(r(a)||(a=new e),a.x=0,a.y=0,a.z=t.z*(1-o),!(Math.abs(a.z)>=this._radii.z-i))return a},c}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,i,a,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return i(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var i=this._semimajorAxis,a=t.longitude*i,o=t.latitude*i,u=t.height;return r(n)?(n.x=a,n.y=o,n.z=u,n):new e(a,o,u)},u.prototype.unproject=function(e,n){var i=this._oneOverSemimajorAxis,a=e.x*i,o=e.y*i,u=e.z;return r(n)?(n.longitude=a,n.latitude=o,n.height=u,n):new t(a,o,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";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a,o,u){"use strict";function E(e,t,r,i,a,o,u,E,s){this[0]=n(e,0),this[1]=n(i,0),this[2]=n(u,0),this[3]=n(t,0),this[4]=n(a,0),this[5]=n(E,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(s,0)}function s(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function c(e){for(var t=0,n=0;n<3;++n){var r=e[E.getElementIndex(A[n],l[n])];t+=2*r*r}return Math.sqrt(t)}function _(e,t){for(var n=u.EPSILON15,r=0,i=1,a=0;a<3;++a){var o=Math.abs(e[E.getElementIndex(A[a],l[a])]);o>r&&(i=a,r=o)}var s=1,c=0,_=l[i],T=A[i];if(Math.abs(e[E.getElementIndex(T,_)])>n){var R,f=e[E.getElementIndex(T,T)],h=e[E.getElementIndex(_,_)],N=e[E.getElementIndex(T,_)],d=(f-h)/2/N;R=d<0?-1/(-d+Math.sqrt(1+d*d)):1/(d+Math.sqrt(1+d*d)),s=1/Math.sqrt(1+R*R),c=R*s}return t=E.clone(E.IDENTITY,t),t[E.getElementIndex(_,_)]=t[E.getElementIndex(T,T)]=s,t[E.getElementIndex(T,_)]=c,t[E.getElementIndex(_,T)]=-c,t}E.packedLength=9,E.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t},E.unpack=function(e,t,i){return t=n(t,0),r(i)||(i=new E),i[0]=e[t++],i[1]=e[t++],i[2]=e[t++],i[3]=e[t++],i[4]=e[t++],i[5]=e[t++],i[6]=e[t++],i[7]=e[t++],i[8]=e[t++],i},E.clone=function(e,t){if(r(e))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):new E(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},E.fromArray=function(e,t,i){return t=n(t,0),r(i)||(i=new E),i[0]=e[t],i[1]=e[t+1],i[2]=e[t+2],i[3]=e[t+3],i[4]=e[t+4],i[5]=e[t+5],i[6]=e[t+6],i[7]=e[t+7],i[8]=e[t+8],i},E.fromColumnMajorArray=function(e,t){return E.clone(e,t)},E.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 E(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},E.fromQuaternion=function(e,t){var n=e.x*e.x,i=e.x*e.y,a=e.x*e.z,o=e.x*e.w,u=e.y*e.y,s=e.y*e.z,c=e.y*e.w,_=e.z*e.z,T=e.z*e.w,R=e.w*e.w,l=n-u-_+R,A=2*(i-T),f=2*(a+c),h=2*(i+T),N=-n+u-_+R,d=2*(s-o),I=2*(a-c),S=2*(s+o),M=-n-u+_+R;return r(t)?(t[0]=l,t[1]=h,t[2]=I,t[3]=A,t[4]=N,t[5]=S,t[6]=f,t[7]=d,t[8]=M,t):new E(l,A,f,h,N,d,I,S,M)},E.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),i=Math.cos(-e.heading),a=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),s=Math.sin(e.roll),c=n*i,_=-a*u+s*o*i,T=s*u+a*o*i,R=n*u,l=a*i+s*o*u,A=-o*a+a*o*u,f=-o,h=s*n,N=a*n;return r(t)?(t[0]=c,t[1]=R,t[2]=f,t[3]=_,t[4]=l,t[5]=h,t[6]=T,t[7]=A,t[8]=N,t):new E(c,_,T,R,l,A,f,h,N)},E.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 E(e.x,0,0,0,e.y,0,0,0,e.z)},E.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 E(e,0,0,0,e,0,0,0,e)},E.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 E(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},E.fromRotationX=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=i,t[6]=0,t[7]=-i,t[8]=n,t):new E(1,0,0,0,n,-i,0,i,n)},E.fromRotationY=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-i,t[3]=0,t[4]=1,t[5]=0,t[6]=i,t[7]=0,t[8]=n,t):new E(n,0,i,0,1,0,-i,0,n)},E.fromRotationZ=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=n,t[1]=i,t[2]=0,t[3]=-i,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new E(n,-i,0,i,n,0,0,0,1)},E.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]]},E.getElementIndex=function(e,t){return 3*e+t},E.getColumn=function(e,t,n){var r=3*t,i=e[r],a=e[r+1],o=e[r+2];return n.x=i,n.y=a,n.z=o,n},E.setColumn=function(e,t,n,r){r=E.clone(e,r);var i=3*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},E.getRow=function(e,t,n){var r=e[t],i=e[t+3],a=e[t+6];return n.x=r,n.y=i,n.z=a,n},E.setRow=function(e,t,n,r){return r=E.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var T=new e;E.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],T)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],T)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],T)),n};var R=new e;E.getMaximumScale=function(t){return E.getScale(t,R),e.maximumComponent(R)},E.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],i=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],o=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],E=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],s=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],c=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],_=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=r,n[1]=i,n[2]=a,n[3]=o,n[4]=u,n[5]=E,n[6]=s,n[7]=c,n[8]=_,n},E.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},E.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},E.multiplyByVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[3]*i+e[6]*a,u=e[1]*r+e[4]*i+e[7]*a,E=e[2]*r+e[5]*i+e[8]*a;return n.x=o,n.y=u,n.z=E,n},E.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},E.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},E.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},E.transpose=function(e,t){var n=e[0],r=e[3],i=e[6],a=e[1],o=e[4],u=e[7],E=e[2],s=e[5],c=e[8];return t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=u,t[6]=E,t[7]=s,t[8]=c,t};var l=[1,0,0],A=[2,2,1],f=new E,h=new E;return E.computeEigenDecomposition=function(e,t){var n=u.EPSILON20,i=10,a=0,o=0;r(t)||(t={});for(var T=t.unitary=E.clone(E.IDENTITY,t.unitary),R=t.diagonal=E.clone(e,t.diagonal),l=n*s(R);o<i&&c(R)>l;)_(R,f),E.transpose(f,h),E.multiply(R,f,R),E.multiply(h,R,R),E.multiply(T,f,T),++a>2&&(++o,a=0);return t},E.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},E.determinant=function(e){var t=e[0],n=e[3],r=e[6],i=e[1],a=e[4],o=e[7],u=e[2],E=e[5],s=e[8];return t*(a*s-E*o)+i*(E*r-n*s)+u*(n*o-a*r)},E.inverse=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],u=e[5],s=e[6],c=e[7],_=e[8],T=E.determinant(e);t[0]=o*_-c*u,t[1]=c*i-r*_,t[2]=r*u-o*i,t[3]=s*u-a*_,t[4]=n*_-s*i,t[5]=a*i-n*u,t[6]=a*c-s*o,t[7]=s*r-n*c,t[8]=n*o-a*r;var R=1/T;return E.multiplyByScalar(t,R,t)},E.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.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},E.IDENTITY=o(new E(1,0,0,0,1,0,0,0,1)),E.ZERO=o(new E(0,0,0,0,0,0,0,0,0)),E.COLUMN0ROW0=0,E.COLUMN0ROW1=1,E.COLUMN0ROW2=2,E.COLUMN1ROW0=3,E.COLUMN1ROW1=4,E.COLUMN1ROW2=5,E.COLUMN2ROW0=6,E.COLUMN2ROW1=7,E.COLUMN2ROW2=8,i(E.prototype,{length:{get:function(){return E.packedLength}}}),E.prototype.clone=function(e){return E.clone(this,e)},E.prototype.equals=function(e){return E.equals(this,e)},E.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},E.prototype.equalsEpsilon=function(e,t){return E.equalsEpsilon(this,e,t)},E.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},E}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(e,n,r,i){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(i,0)}o.fromElements=function(e,t,r,i,a){return n(a)?(a.x=e,a.y=t,a.z=r,a.w=i,a):new o(e,t,r,i)},o.fromColor=function(e,t){return n(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(n(e))return n(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)},o.packedLength=4,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},o.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new o),i.x=e[r++],i.y=e[r++],i.z=e[r++],i.w=e[r],i},o.packArray=function(e,t){var r=e.length;n(t)?t.length=4*r:t=new Array(4*r);for(var i=0;i<r;++i)o.pack(e[i],t,4*i);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/4:t=new Array(r/4);for(var i=0;i<r;i+=4){var a=i/4;t[a]=o.unpack(e,i,t[a])}return t},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,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},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 u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,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,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},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 E=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,E),r=o.multiplyByScalar(e,1-n,r),o.add(E,r,r)};var s=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,s);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},o.equalsEpsilon=function(e,t,r,i){return e===t||n(e)&&n(t)&&a.equalsEpsilon(e.x,t.x,r,i)&&a.equalsEpsilon(e.y,t.y,r,i)&&a.equalsEpsilon(e.z,t.z,r,i)&&a.equalsEpsilon(e.w,t.w,r,i)},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,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,i,a,o,u,E,s,c){ +"use strict";function _(e,t,n,i,a,o,u,E,s,c,_,T,R,l,A,f){this[0]=r(e,0),this[1]=r(a,0),this[2]=r(s,0),this[3]=r(R,0),this[4]=r(t,0),this[5]=r(o,0),this[6]=r(c,0),this[7]=r(l,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(_,0),this[11]=r(A,0),this[12]=r(i,0),this[13]=r(E,0),this[14]=r(T,0),this[15]=r(f,0)}_.packedLength=16,_.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},_.unpack=function(e,t,n){return t=r(t,0),i(n)||(n=new _),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},_.clone=function(e,t){if(i(e))return i(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 _(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])},_.fromArray=_.unpack,_.fromColumnMajorArray=function(e,t){return _.clone(e,t)},_.fromRowMajorArray=function(e,t){return i(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 _(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])},_.fromRotationTranslation=function(t,n,a){return n=r(n,e.ZERO),i(a)?(a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=0,a[4]=t[3],a[5]=t[4],a[6]=t[5],a[7]=0,a[8]=t[6],a[9]=t[7],a[10]=t[8],a[11]=0,a[12]=n.x,a[13]=n.y,a[14]=n.z,a[15]=1,a):new _(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},_.fromTranslationQuaternionRotationScale=function(e,t,n,r){i(r)||(r=new _);var a=n.x,o=n.y,u=n.z,E=t.x*t.x,s=t.x*t.y,c=t.x*t.z,T=t.x*t.w,R=t.y*t.y,l=t.y*t.z,A=t.y*t.w,f=t.z*t.z,h=t.z*t.w,N=t.w*t.w,d=E-R-f+N,I=2*(s-h),S=2*(c+A),M=2*(s+h),O=-E+R-f+N,m=2*(l-T),y=2*(c-A),p=2*(l+T),C=-E-R+f+N;return r[0]=d*a,r[1]=M*a,r[2]=y*a,r[3]=0,r[4]=I*o,r[5]=O*o,r[6]=p*o,r[7]=0,r[8]=S*u,r[9]=m*u,r[10]=C*u,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},_.fromTranslationRotationScale=function(e,t){return _.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},_.fromTranslation=function(e,t){return _.fromRotationTranslation(s.IDENTITY,e,t)},_.fromScale=function(e,t){return i(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 _(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},_.fromUniformScale=function(e,t){return i(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 _(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var T=new e,R=new e,l=new e;_.fromCamera=function(t,n){var r=t.position,a=t.direction,o=t.up;e.normalize(a,T),e.normalize(e.cross(T,o,R),R),e.normalize(e.cross(R,T,l),l);var u=R.x,E=R.y,s=R.z,c=T.x,A=T.y,f=T.z,h=l.x,N=l.y,d=l.z,I=r.x,S=r.y,M=r.z,O=u*-I+E*-S+s*-M,m=h*-I+N*-S+d*-M,y=c*I+A*S+f*M;return i(n)?(n[0]=u,n[1]=h,n[2]=-c,n[3]=0,n[4]=E,n[5]=N,n[6]=-A,n[7]=0,n[8]=s,n[9]=d,n[10]=-f,n[11]=0,n[12]=O,n[13]=m,n[14]=y,n[15]=1,n):new _(u,E,s,O,h,N,d,m,-c,-A,-f,y,0,0,0,1)},_.computePerspectiveFieldOfView=function(e,t,n,r,i){var a=Math.tan(.5*e),o=1/a,u=o/t,E=(r+n)/(n-r),s=2*r*n/(n-r);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=o,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=E,i[11]=-1,i[12]=0,i[13]=0,i[14]=s,i[15]=0,i},_.computeOrthographicOffCenter=function(e,t,n,r,i,a,o){var u=1/(t-e),E=1/(r-n),s=1/(a-i),c=-(t+e)*u,_=-(r+n)*E,T=-(a+i)*s;return u*=2,E*=2,s*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=s,o[11]=0,o[12]=c,o[13]=_,o[14]=T,o[15]=1,o},_.computePerspectiveOffCenter=function(e,t,n,r,i,a,o){var u=2*i/(t-e),E=2*i/(r-n),s=(t+e)/(t-e),c=(r+n)/(r-n),_=-(a+i)/(a-i),T=-1,R=-2*a*i/(a-i);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=s,o[9]=c,o[10]=_,o[11]=T,o[12]=0,o[13]=0,o[14]=R,o[15]=0,o},_.computeInfinitePerspectiveOffCenter=function(e,t,n,r,i,a){var o=2*i/(t-e),u=2*i/(r-n),E=(t+e)/(t-e),s=(r+n)/(r-n),c=-1,_=-1,T=-2*i;return a[0]=o,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=E,a[9]=s,a[10]=c,a[11]=_,a[12]=0,a[13]=0,a[14]=T,a[15]=0,a},_.computeViewportTransformation=function(e,t,n,i){e=r(e,r.EMPTY_OBJECT);var a=r(e.x,0),o=r(e.y,0),u=r(e.width,0),E=r(e.height,0);t=r(t,0),n=r(n,1);var s=.5*u,c=.5*E,_=.5*(n-t),T=s,R=c,l=_,A=a+s,f=o+c,h=t+_,N=1;return i[0]=T,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=R,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=l,i[11]=0,i[12]=A,i[13]=f,i[14]=h,i[15]=N,i},_.computeView=function(t,n,r,i,a){return a[0]=i.x,a[1]=r.x,a[2]=-n.x,a[3]=0,a[4]=i.y,a[5]=r.y,a[6]=-n.y,a[7]=0,a[8]=i.z,a[9]=r.z,a[10]=-n.z,a[11]=0,a[12]=-e.dot(i,t),a[13]=-e.dot(r,t),a[14]=e.dot(n,t),a[15]=1,a},_.toArray=function(e,t){return i(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]]},_.getElementIndex=function(e,t){return 4*e+t},_.getColumn=function(e,t,n){var r=4*t,i=e[r],a=e[r+1],o=e[r+2],u=e[r+3];return n.x=i,n.y=a,n.z=o,n.w=u,n},_.setColumn=function(e,t,n,r){r=_.clone(e,r);var i=4*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r[i+3]=n.w,r},_.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},_.getRow=function(e,t,n){var r=e[t],i=e[t+4],a=e[t+8],o=e[t+12];return n.x=r,n.y=i,n.z=a,n.w=o,n},_.setRow=function(e,t,n,r){return r=_.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var A=new e;_.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],A)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],A)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],A)),n};var f=new e;_.getMaximumScale=function(t){return _.getScale(t,f),e.maximumComponent(f)},_.multiply=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[3],u=e[4],E=e[5],s=e[6],c=e[7],_=e[8],T=e[9],R=e[10],l=e[11],A=e[12],f=e[13],h=e[14],N=e[15],d=t[0],I=t[1],S=t[2],M=t[3],O=t[4],m=t[5],y=t[6],p=t[7],C=t[8],U=t[9],L=t[10],F=t[11],P=t[12],w=t[13],g=t[14],v=t[15],B=r*d+u*I+_*S+A*M,D=i*d+E*I+T*S+f*M,x=a*d+s*I+R*S+h*M,z=o*d+c*I+l*S+N*M,G=r*O+u*m+_*y+A*p,b=i*O+E*m+T*y+f*p,X=a*O+s*m+R*y+h*p,V=o*O+c*m+l*y+N*p,q=r*C+u*U+_*L+A*F,H=i*C+E*U+T*L+f*F,W=a*C+s*U+R*L+h*F,Y=o*C+c*U+l*L+N*F,K=r*P+u*w+_*g+A*v,k=i*P+E*w+T*g+f*v,Z=a*P+s*w+R*g+h*v,j=o*P+c*w+l*g+N*v;return n[0]=B,n[1]=D,n[2]=x,n[3]=z,n[4]=G,n[5]=b,n[6]=X,n[7]=V,n[8]=q,n[9]=H,n[10]=W,n[11]=Y,n[12]=K,n[13]=k,n[14]=Z,n[15]=j,n},_.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},_.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},_.multiplyTransformation=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[4],u=e[5],E=e[6],s=e[8],c=e[9],_=e[10],T=e[12],R=e[13],l=e[14],A=t[0],f=t[1],h=t[2],N=t[4],d=t[5],I=t[6],S=t[8],M=t[9],O=t[10],m=t[12],y=t[13],p=t[14],C=r*A+o*f+s*h,U=i*A+u*f+c*h,L=a*A+E*f+_*h,F=r*N+o*d+s*I,P=i*N+u*d+c*I,w=a*N+E*d+_*I,g=r*S+o*M+s*O,v=i*S+u*M+c*O,B=a*S+E*M+_*O,D=r*m+o*y+s*p+T,x=i*m+u*y+c*p+R,z=a*m+E*y+_*p+l;return n[0]=C,n[1]=U,n[2]=L,n[3]=0,n[4]=F,n[5]=P,n[6]=w,n[7]=0,n[8]=g,n[9]=v,n[10]=B,n[11]=0,n[12]=D,n[13]=x,n[14]=z,n[15]=1,n},_.multiplyByMatrix3=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[4],u=e[5],E=e[6],s=e[8],c=e[9],_=e[10],T=t[0],R=t[1],l=t[2],A=t[3],f=t[4],h=t[5],N=t[6],d=t[7],I=t[8],S=r*T+o*R+s*l,M=i*T+u*R+c*l,O=a*T+E*R+_*l,m=r*A+o*f+s*h,y=i*A+u*f+c*h,p=a*A+E*f+_*h,C=r*N+o*d+s*I,U=i*N+u*d+c*I,L=a*N+E*d+_*I;return n[0]=S,n[1]=M,n[2]=O,n[3]=0,n[4]=m,n[5]=y,n[6]=p,n[7]=0,n[8]=C,n[9]=U,n[10]=L,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},_.multiplyByTranslation=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=r*e[0]+i*e[4]+a*e[8]+e[12],u=r*e[1]+i*e[5]+a*e[9]+e[13],E=r*e[2]+i*e[6]+a*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=E,n[15]=e[15],n};var h=new e;_.multiplyByUniformScale=function(e,t,n){return h.x=t,h.y=t,h.z=t,_.multiplyByScale(e,h,n)},_.multiplyByScale=function(e,t,n){var r=t.x,i=t.y,a=t.z;return 1===r&&1===i&&1===a?_.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=i*e[4],n[5]=i*e[5],n[6]=i*e[6],n[7]=0,n[8]=a*e[8],n[9]=a*e[9],n[10]=a*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},_.multiplyByVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=t.w,u=e[0]*r+e[4]*i+e[8]*a+e[12]*o,E=e[1]*r+e[5]*i+e[9]*a+e[13]*o,s=e[2]*r+e[6]*i+e[10]*a+e[14]*o,c=e[3]*r+e[7]*i+e[11]*a+e[15]*o;return n.x=u,n.y=E,n.z=s,n.w=c,n},_.multiplyByPointAsVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[4]*i+e[8]*a,u=e[1]*r+e[5]*i+e[9]*a,E=e[2]*r+e[6]*i+e[10]*a;return n.x=o,n.y=u,n.z=E,n},_.multiplyByPoint=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[4]*i+e[8]*a+e[12],u=e[1]*r+e[5]*i+e[9]*a+e[13],E=e[2]*r+e[6]*i+e[10]*a+e[14];return n.x=o,n.y=u,n.z=E,n},_.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},_.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},_.transpose=function(e,t){var n=e[1],r=e[2],i=e[3],a=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=a,t[10]=e[10],t[11]=e[14],t[12]=i,t[13]=o,t[14]=u,t[15]=e[15],t},_.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},_.equals=function(e,t){return e===t||i(e)&&i(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},_.equalsEpsilon=function(e,t,n){return e===t||i(e)&&i(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},_.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},_.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};var N=new s,d=new s,I=new t,S=new t(0,0,0,1);return _.inverse=function(e,n){if(s.equalsEpsilon(_.getRotation(e,N),d,E.EPSILON7)&&t.equals(_.getRow(e,3,I),S))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],i=e[4],a=e[8],o=e[12],u=e[1],T=e[5],R=e[9],l=e[13],A=e[2],f=e[6],h=e[10],M=e[14],O=e[3],m=e[7],y=e[11],p=e[15],C=h*p,U=M*y,L=f*p,F=M*m,P=f*y,w=h*m,g=A*p,v=M*O,B=A*y,D=h*O,x=A*m,z=f*O,G=C*T+F*R+P*l-(U*T+L*R+w*l),b=U*u+g*R+D*l-(C*u+v*R+B*l),X=L*u+v*T+x*l-(F*u+g*T+z*l),V=w*u+B*T+z*R-(P*u+D*T+x*R),q=U*i+L*a+w*o-(C*i+F*a+P*o),H=C*r+v*a+B*o-(U*r+g*a+D*o),W=F*r+g*i+z*o-(L*r+v*i+x*o),Y=P*r+D*i+x*a-(w*r+B*i+z*a);C=a*l,U=o*R,L=i*l,F=o*T,P=i*R,w=a*T,g=r*l,v=o*u,B=r*R,D=a*u,x=r*T,z=i*u;var K=C*m+F*y+P*p-(U*m+L*y+w*p),k=U*O+g*y+D*p-(C*O+v*y+B*p),Z=L*O+v*m+x*p-(F*O+g*m+z*p),j=w*O+B*m+z*y-(P*O+D*m+x*y),Q=L*h+w*M+U*f-(P*M+C*f+F*h),J=B*M+C*A+v*h-(g*h+D*M+U*A),$=g*f+z*M+F*A-(x*M+L*A+v*f),ee=x*h+P*A+D*f-(B*f+z*h+w*A),te=r*G+i*b+a*X+o*V;if(Math.abs(te)<E.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=G*te,n[1]=b*te,n[2]=X*te,n[3]=V*te,n[4]=q*te,n[5]=H*te,n[6]=W*te,n[7]=Y*te,n[8]=K*te,n[9]=k*te,n[10]=Z*te,n[11]=j*te,n[12]=Q*te,n[13]=J*te,n[14]=$*te,n[15]=ee*te,n},_.inverseTransformation=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[4],o=e[5],u=e[6],E=e[8],s=e[9],c=e[10],_=e[12],T=e[13],R=e[14],l=-n*_-r*T-i*R,A=-a*_-o*T-u*R,f=-E*_-s*T-c*R;return t[0]=n,t[1]=a,t[2]=E,t[3]=0,t[4]=r,t[5]=o,t[6]=s,t[7]=0,t[8]=i,t[9]=u,t[10]=c,t[11]=0,t[12]=l,t[13]=A,t[14]=f,t[15]=1,t},_.IDENTITY=u(new _(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),_.ZERO=u(new _(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),_.COLUMN0ROW0=0,_.COLUMN0ROW1=1,_.COLUMN0ROW2=2,_.COLUMN0ROW3=3,_.COLUMN1ROW0=4,_.COLUMN1ROW1=5,_.COLUMN1ROW2=6,_.COLUMN1ROW3=7,_.COLUMN2ROW0=8,_.COLUMN2ROW1=9,_.COLUMN2ROW2=10,_.COLUMN2ROW3=11,_.COLUMN3ROW0=12,_.COLUMN3ROW1=13,_.COLUMN3ROW2=14,_.COLUMN3ROW3=15,a(_.prototype,{length:{get:function(){return _.packedLength}}}),_.prototype.clone=function(e){return _.clone(this,e)},_.prototype.equals=function(e){return _.equals(this,e)},_.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},_.prototype.equalsEpsilon=function(e,t){return _.equalsEpsilon(this,e,t)},_.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]+")"},_}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,i,a,o,u,E){"use strict";function s(e,t,r,i){this.west=n(e,0),this.south=n(t,0),this.east=n(r,0),this.north=n(i,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,t,r){return r=n(r,0),t[r++]=e.west,t[r++]=e.south,t[r++]=e.east,t[r]=e.north,t},s.unpack=function(e,t,i){return t=n(t,0),r(i)||(i=new s),i.west=e[t++],i.south=e[t++],i.east=e[t++],i.north=e[t],i},s.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=E.TWO_PI),t-n},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,t,i,a,o){return e=E.toRadians(n(e,0)),t=E.toRadians(n(t,0)),i=E.toRadians(n(i,0)),a=E.toRadians(n(a,0)),r(o)?(o.west=e,o.south=t,o.east=i,o.north=a,o):new s(e,t,i,a)},s.fromRadians=function(e,t,i,a,o){return r(o)?(o.west=n(e,0),o.south=n(t,0),o.east=n(i,0),o.north=n(a,0),o):new s(e,t,i,a)},s.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,u=Number.MAX_VALUE,c=-Number.MAX_VALUE,_=0,T=e.length;_<T;_++){var R=e[_];n=Math.min(n,R.longitude),i=Math.max(i,R.longitude),u=Math.min(u,R.latitude),c=Math.max(c,R.latitude);var l=R.longitude>=0?R.longitude:R.longitude+E.TWO_PI;a=Math.min(a,l),o=Math.max(o,l)}return i-n>o-a&&(n=a,i=o,i>E.PI&&(i-=E.TWO_PI),n>E.PI&&(n-=E.TWO_PI)),r(t)?(t.west=n,t.south=u,t.east=i,t.north=c,t):new s(n,u,i,c)},s.fromCartesianArray=function(e,t,n){for(var i=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,u=-Number.MAX_VALUE,c=Number.MAX_VALUE,_=-Number.MAX_VALUE,T=0,R=e.length;T<R;T++){var l=t.cartesianToCartographic(e[T]);i=Math.min(i,l.longitude),a=Math.max(a,l.longitude),c=Math.min(c,l.latitude),_=Math.max(_,l.latitude);var A=l.longitude>=0?l.longitude:l.longitude+E.TWO_PI;o=Math.min(o,A),u=Math.max(u,A)}return a-i>u-o&&(i=o,a=u,a>E.PI&&(a-=E.TWO_PI),i>E.PI&&(i-=E.TWO_PI)),r(n)?(n.west=i,n.south=c,n.east=a,n.north=_,n):new s(i,c,a,_)},s.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.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},s.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},s.validate=function(e){},s.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)},s.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)},s.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)},s.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)},s.center=function(t,n){var i=t.east,a=t.west;i<a&&(i+=E.TWO_PI);var o=E.negativePiToPi(.5*(a+i)),u=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=u,n.height=0,n):new e(o,u)},s.intersection=function(e,t,n){var i=e.east,a=e.west,o=t.east,u=t.west;i<a&&o>0?i+=E.TWO_PI:o<u&&i>0&&(o+=E.TWO_PI),i<a&&u<0?u+=E.TWO_PI:o<u&&a<0&&(a+=E.TWO_PI);var c=E.negativePiToPi(Math.max(a,u)),_=E.negativePiToPi(Math.min(i,o));if(!((e.west<e.east||t.west<t.east)&&_<=c)){var T=Math.max(e.south,t.south),R=Math.min(e.north,t.north);if(!(T>=R))return r(n)?(n.west=c,n.south=T,n.east=_,n.north=R,n):new s(c,T,_,R)}},s.simpleIntersection=function(e,t,n){var i=Math.max(e.west,t.west),a=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(a>=u||i>=o))return r(n)?(n.west=i,n.south=a,n.east=o,n.north=u,n):new s(i,a,o,u)},s.union=function(e,t,n){r(n)||(n=new s);var i=e.east,a=e.west,o=t.east,u=t.west;i<a&&o>0?i+=E.TWO_PI:o<u&&i>0&&(o+=E.TWO_PI),i<a&&u<0?u+=E.TWO_PI:o<u&&a<0&&(a+=E.TWO_PI);var c=E.convertLongitudeRange(Math.min(a,u)),_=E.convertLongitudeRange(Math.max(i,o));return n.west=c,n.south=Math.min(e.south,t.south),n.east=_,n.north=Math.max(e.north,t.north),n},s.expand=function(e,t,n){return r(n)||(n=new s),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},s.contains=function(e,t){var n=t.longitude,r=t.latitude,i=e.west,a=e.east;return a<i&&(a+=E.TWO_PI,n<0&&(n+=E.TWO_PI)),(n>i||E.equalsEpsilon(n,i,E.EPSILON14))&&(n<a||E.equalsEpsilon(n,a,E.EPSILON14))&&r>=e.south&&r<=e.north};var c=new e;return s.subsample=function(e,t,i,a){t=n(t,o.WGS84),i=n(i,0),r(a)||(a=[]);var u=0,_=e.north,T=e.south,R=e.east,l=e.west,A=c;A.height=i,A.longitude=l,A.latitude=_,a[u]=t.cartographicToCartesian(A,a[u]),u++,A.longitude=R,a[u]=t.cartographicToCartesian(A,a[u]),u++,A.latitude=T,a[u]=t.cartographicToCartesian(A,a[u]),u++,A.longitude=l,a[u]=t.cartographicToCartesian(A,a[u]),u++,_<0?A.latitude=_:T>0?A.latitude=T:A.latitude=0;for(var f=1;f<8;++f)A.longitude=-Math.PI+f*E.PI_OVER_TWO,s.contains(e,A)&&(a[u]=t.cartographicToCartesian(A,a[u]),u++);return 0===A.latitude&&(A.longitude=l,a[u]=t.cartographicToCartesian(A,a[u]),u++,A.longitude=R,a[u]=t.cartographicToCartesian(A,a[u]),u++),a.length=u,a},s.MAX_VALUE=u(new s(-Math.PI,-E.PI_OVER_TWO,Math.PI,E.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,i,a,o,u,E,s,c,_){"use strict";function T(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var R=new e,l=new e,A=new e,f=new e,h=new e,N=new e,d=new e,I=new e,S=new e,M=new e,O=new e,m=new e;T.fromPoints=function(t,n){if(i(n)||(n=new T),!i(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var r=e.clone(t[0],d),a=e.clone(r,R),o=e.clone(r,l),u=e.clone(r,A),E=e.clone(r,f),s=e.clone(r,h),c=e.clone(r,N),_=t.length,y=1;y<_;y++){e.clone(t[y],r);var p=r.x,C=r.y,U=r.z;p<a.x&&e.clone(r,a),p>E.x&&e.clone(r,E),C<o.y&&e.clone(r,o),C>s.y&&e.clone(r,s),U<u.z&&e.clone(r,u),U>c.z&&e.clone(r,c)}var L=e.magnitudeSquared(e.subtract(E,a,I)),F=e.magnitudeSquared(e.subtract(s,o,I)),P=e.magnitudeSquared(e.subtract(c,u,I)),w=a,g=E,v=L;F>v&&(v=F,w=o,g=s),P>v&&(v=P,w=u,g=c);var B=S;B.x=.5*(w.x+g.x),B.y=.5*(w.y+g.y),B.z=.5*(w.z+g.z);var D=e.magnitudeSquared(e.subtract(g,B,I)),x=Math.sqrt(D),z=M;z.x=a.x,z.y=o.y,z.z=u.z;var G=O;G.x=E.x,G.y=s.y,G.z=c.z;var b=e.multiplyByScalar(e.add(z,G,I),.5,m),X=0;for(y=0;y<_;y++){e.clone(t[y],r);var V=e.magnitude(e.subtract(r,b,I));V>X&&(X=V);var q=e.magnitudeSquared(e.subtract(r,B,I));if(q>D){var H=Math.sqrt(q);x=.5*(x+H),D=x*x;var W=H-x;B.x=(x*B.x+W*r.x)/H,B.y=(x*B.y+W*r.y)/H,B.z=(x*B.z+W*r.z)/H}}return x<X?(e.clone(B,n.center),n.radius=x):(e.clone(b,n.center),n.radius=X),n};var y=new o,p=new e,C=new e,U=new t,L=new t;T.fromRectangle2D=function(e,t,n){return T.fromRectangleWithHeights2D(e,t,0,0,n)},T.fromRectangleWithHeights2D=function(t,n,a,o,u){if(i(u)||(u=new T),!i(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;n=r(n,y),_.southwest(t,U),U.height=a,_.northeast(t,L),L.height=o;var E=n.project(U,p),s=n.project(L,C),c=s.x-E.x,R=s.y-E.y,l=s.z-E.z;u.radius=.5*Math.sqrt(c*c+R*R+l*l);var A=u.center;return A.x=E.x+.5*c,A.y=E.y+.5*R,A.z=E.z+.5*l,u};var F=[];T.fromRectangle3D=function(e,t,n,o){t=r(t,a.WGS84),n=r(n,0);var u;return i(e)&&(u=_.subsample(e,t,n,F)),T.fromPoints(u,o)},T.fromVertices=function(t,n,a,o){if(i(o)||(o=new T),!i(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;n=r(n,e.ZERO),a=r(a,3);var u=d;u.x=t[0]+n.x,u.y=t[1]+n.y,u.z=t[2]+n.z;for(var E=e.clone(u,R),s=e.clone(u,l),c=e.clone(u,A),_=e.clone(u,f),y=e.clone(u,h),p=e.clone(u,N),C=t.length,U=0;U<C;U+=a){var L=t[U]+n.x,F=t[U+1]+n.y,P=t[U+2]+n.z;u.x=L,u.y=F,u.z=P,L<E.x&&e.clone(u,E),L>_.x&&e.clone(u,_),F<s.y&&e.clone(u,s),F>y.y&&e.clone(u,y),P<c.z&&e.clone(u,c),P>p.z&&e.clone(u,p)}var w=e.magnitudeSquared(e.subtract(_,E,I)),g=e.magnitudeSquared(e.subtract(y,s,I)),v=e.magnitudeSquared(e.subtract(p,c,I)),B=E,D=_,x=w;g>x&&(x=g,B=s,D=y),v>x&&(x=v,B=c,D=p);var z=S;z.x=.5*(B.x+D.x),z.y=.5*(B.y+D.y),z.z=.5*(B.z+D.z);var G=e.magnitudeSquared(e.subtract(D,z,I)),b=Math.sqrt(G),X=M;X.x=E.x,X.y=s.y,X.z=c.z;var V=O;V.x=_.x,V.y=y.y,V.z=p.z;var q=e.multiplyByScalar(e.add(X,V,I),.5,m),H=0;for(U=0;U<C;U+=a){u.x=t[U]+n.x,u.y=t[U+1]+n.y,u.z=t[U+2]+n.z;var W=e.magnitude(e.subtract(u,q,I));W>H&&(H=W);var Y=e.magnitudeSquared(e.subtract(u,z,I));if(Y>G){var K=Math.sqrt(Y);b=.5*(b+K),G=b*b;var k=K-b;z.x=(b*z.x+k*u.x)/K,z.y=(b*z.y+k*u.y)/K,z.z=(b*z.z+k*u.z)/K}}return b<H?(e.clone(z,o.center),o.radius=b):(e.clone(q,o.center),o.radius=H),o},T.fromEncodedCartesianVertices=function(t,n,r){if(i(r)||(r=new T),!i(t)||!i(n)||t.length!==n.length||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var a=d;a.x=t[0]+n[0],a.y=t[1]+n[1],a.z=t[2]+n[2];for(var o=e.clone(a,R),u=e.clone(a,l),E=e.clone(a,A),s=e.clone(a,f),c=e.clone(a,h),_=e.clone(a,N),y=t.length,p=0;p<y;p+=3){var C=t[p]+n[p],U=t[p+1]+n[p+1],L=t[p+2]+n[p+2];a.x=C,a.y=U,a.z=L,C<o.x&&e.clone(a,o),C>s.x&&e.clone(a,s),U<u.y&&e.clone(a,u),U>c.y&&e.clone(a,c),L<E.z&&e.clone(a,E),L>_.z&&e.clone(a,_)}var F=e.magnitudeSquared(e.subtract(s,o,I)),P=e.magnitudeSquared(e.subtract(c,u,I)),w=e.magnitudeSquared(e.subtract(_,E,I)),g=o,v=s,B=F;P>B&&(B=P,g=u,v=c),w>B&&(B=w,g=E,v=_);var D=S;D.x=.5*(g.x+v.x),D.y=.5*(g.y+v.y),D.z=.5*(g.z+v.z);var x=e.magnitudeSquared(e.subtract(v,D,I)),z=Math.sqrt(x),G=M;G.x=o.x,G.y=u.y,G.z=E.z;var b=O;b.x=s.x,b.y=c.y,b.z=_.z;var X=e.multiplyByScalar(e.add(G,b,I),.5,m),V=0;for(p=0;p<y;p+=3){a.x=t[p]+n[p],a.y=t[p+1]+n[p+1],a.z=t[p+2]+n[p+2];var q=e.magnitude(e.subtract(a,X,I));q>V&&(V=q);var H=e.magnitudeSquared(e.subtract(a,D,I));if(H>x){var W=Math.sqrt(H);z=.5*(z+W),x=z*z;var Y=W-z;D.x=(z*D.x+Y*a.x)/W,D.y=(z*D.y+Y*a.y)/W,D.z=(z*D.z+Y*a.z)/W}}return z<V?(e.clone(D,r.center),r.radius=z):(e.clone(X,r.center),r.radius=V),r},T.fromCornerPoints=function(t,n,r){i(r)||(r=new T);var a=r.center;return e.add(t,n,a),e.multiplyByScalar(a,.5,a),r.radius=e.distance(a,n),r},T.fromEllipsoid=function(t,n){return i(n)||(n=new T),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var P=new e;T.fromBoundingSpheres=function(t,n){if(i(n)||(n=new T),!i(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var r=t.length;if(1===r)return T.clone(t[0],n);if(2===r)return T.union(t[0],t[1],n);for(var a=[],o=0;o<r;o++)a.push(t[o].center);n=T.fromPoints(a,n);var u=n.center,E=n.radius;for(o=0;o<r;o++){var s=t[o];E=Math.max(E,e.distance(u,s.center,P)+s.radius)}return n.radius=E,n};var w=new e,g=new e,v=new e;T.fromOrientedBoundingBox=function(t,n){i(n)||(n=new T);var r=t.halfAxes,a=s.getColumn(r,0,w),o=s.getColumn(r,1,g),u=s.getColumn(r,2,v),E=e.magnitude(a),c=e.magnitude(o),_=e.magnitude(u);return n.center=e.clone(t.center,n.center),n.radius=Math.max(E,c,_),n},T.clone=function(t,n){if(i(t))return i(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new T(t.center,t.radius)},T.packedLength=4,T.pack=function(e,t,n){n=r(n,0);var i=e.center;return t[n++]=i.x,t[n++]=i.y,t[n++]=i.z,t[n]=e.radius,t},T.unpack=function(e,t,n){t=r(t,0),i(n)||(n=new T);var a=n.center;return a.x=e[t++],a.y=e[t++],a.z=e[t++],n.radius=e[t],n};var B=new e,D=new e;T.union=function(t,n,r){i(r)||(r=new T);var a=t.center,o=t.radius,u=n.center,E=n.radius,s=e.subtract(u,a,B),c=e.magnitude(s);if(o>=c+E)return t.clone(r),r;if(E>=c+o)return n.clone(r),r;var _=.5*(o+c+E),R=e.multiplyByScalar(s,(-o+_)/c,D);return e.add(R,a,R),e.clone(R,r.center),r.radius=_,r};var x=new e;T.expand=function(t,n,r){r=T.clone(t,r);var i=e.magnitude(e.subtract(n,r.center,x));return i>r.radius&&(r.radius=i),r},T.intersectPlane=function(t,n){var r=t.center,i=t.radius,a=n.normal,o=e.dot(a,r)+n.distance;return o<-i?u.OUTSIDE:o<i?u.INTERSECTING:u.INSIDE},T.transform=function(e,t,n){return i(n)||(n=new T),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=c.getMaximumScale(t)*e.radius,n};var z=new e;T.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,z);return e.magnitudeSquared(r)-t.radius*t.radius},T.transformWithoutScale=function(e,t,n){return i(n)||(n=new T),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var G=new e;T.computePlaneDistances=function(t,n,r,a){i(a)||(a=new E);var o=e.subtract(t.center,n,G),u=e.dot(r,o);return a.start=u-t.radius,a.stop=u+t.radius,a};for(var b=new e,X=new e,V=new e,q=new e,H=new e,W=new t,Y=new Array(8),K=0;K<8;++K)Y[K]=new e;var k=new o;return T.projectTo2D=function(t,n,i){n=r(n,k);var a=n.ellipsoid,o=t.center,u=t.radius,E=a.geodeticSurfaceNormal(o,b),s=e.cross(e.UNIT_Z,E,X);e.normalize(s,s);var c=e.cross(E,s,V);e.normalize(c,c),e.multiplyByScalar(E,u,E),e.multiplyByScalar(c,u,c),e.multiplyByScalar(s,u,s);var _=e.negate(c,H),R=e.negate(s,q),l=Y,A=l[0];e.add(E,c,A),e.add(A,s,A),A=l[1],e.add(E,c,A),e.add(A,R,A),A=l[2],e.add(E,_,A),e.add(A,R,A),A=l[3],e.add(E,_,A),e.add(A,s,A),e.negate(E,E),A=l[4],e.add(E,c,A),e.add(A,s,A),A=l[5],e.add(E,c,A),e.add(A,R,A),A=l[6],e.add(E,_,A),e.add(A,R,A),A=l[7],e.add(E,_,A),e.add(A,s,A);for(var f=l.length,h=0;h<f;++h){var N=l[h];e.add(o,N,N);var d=a.cartesianToCartographic(N,W);n.project(d,N)}i=T.fromPoints(l,i),o=i.center;var I=o.x,S=o.y,M=o.z;return o.x=M,o.y=I,o.z=S,i},T.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},T.equals=function(t,n){return t===n||i(t)&&i(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},T.prototype.intersectPlane=function(e){return T.intersectPlane(this,e)},T.prototype.distanceSquaredTo=function(e){return T.distanceSquaredTo(this,e)},T.prototype.computePlaneDistances=function(e,t,n){return T.computePlaneDistances(this,e,t,n)},T.prototype.isOccluded=function(e){return T.isOccluded(this,e)},T.prototype.equals=function(e){return T.equals(this,e)},T.prototype.clone=function(e){return T.clone(this,e)},T}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},i={};return t(i,{element:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(i.supportsFullscreen())return null!==i.element}}}),i.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var i,a=["webkit","moz","o","ms","khtml"],o=0,u=a.length;o<u;++o){var E=a[o];i=E+"RequestFullscreen","function"==typeof t[i]?(r.requestFullscreen=i,n=!0):(i=E+"RequestFullScreen","function"==typeof t[i]&&(r.requestFullscreen=i,n=!0)),i=E+"ExitFullscreen","function"==typeof document[i]?r.exitFullscreen=i:(i=E+"CancelFullScreen","function"==typeof document[i]&&(r.exitFullscreen=i)),i=E+"FullscreenEnabled",void 0!==document[i]?r.fullscreenEnabled=i:(i=E+"FullScreenEnabled",void 0!==document[i]&&(r.fullscreenEnabled=i)),i=E+"FullscreenElement",void 0!==document[i]?r.fullscreenElement=i:(i=E+"FullScreenElement",void 0!==document[i]&&(r.fullscreenElement=i)),i=E+"fullscreenchange",void 0!==document["on"+i]&&("ms"===E&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=E+"fullscreenerror",void 0!==document["on"+i]&&("ms"===E&&(i="MSFullscreenError"),r.fullscreenerror=i)}return n},i.requestFullscreen=function(e,t){i.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},i.exitFullscreen=function(){i.supportsFullscreen()&&document[r.exitFullscreen]()},i}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function i(){if(!t(S)&&(S=!1,!T())){var e=/ Chrome\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(S=!0,M=r(e[1]))}return S}function a(){return i()&&M}function o(){if(!t(O)&&(O=!1,!i()&&!T()&&/ Safari\/[\.0-9]+/.test(I.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(O=!0,m=r(e[1]))}return O}function u(){return o()&&m}function E(){if(!t(y)){y=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(I.userAgent);null!==e&&(y=!0,p=r(e[1]),p.isNightly=!!e[2])}return y}function s(){return E()&&p}function c(){if(!t(C)){C=!1;var e;"Microsoft Internet Explorer"===I.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==e&&(C=!0,U=r(e[1]))):"Netscape"===I.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==e&&(C=!0,U=r(e[1])))}return C}function _(){return c()&&U}function T(){if(!t(L)){L=!1;var e=/ Edge\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(L=!0,F=r(e[1]))}return L}function R(){return T()&&F}function l(){if(!t(P)){P=!1;var e=/Firefox\/([\.0-9]+)/.exec(I.userAgent); +null!==e&&(P=!0,w=r(e[1]))}return P}function A(){return t(g)||(g=/Windows/i.test(I.appVersion)),g}function f(){return l()&&w}function h(){return t(v)||(v="undefined"!=typeof PointerEvent&&(!t(I.pointerEnabled)||I.pointerEnabled)),v}function N(){if(!t(D)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;D=t(n)&&""!==n,D&&(B=n)}return D}function d(){return N()?B:void 0}var I;I="undefined"!=typeof navigator?navigator:{};var S,M,O,m,y,p,C,U,L,F,P,w,g,v,B,D,x={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:E,webkitVersion:s,isInternetExplorer:c,internetExplorerVersion:_,isEdge:T,edgeVersion:R,isFirefox:l,firefoxVersion:f,isWindows:A,hardwareConcurrency:e(I.hardwareConcurrency,3),supportsPointerEvents:h,supportsImageRenderingPixelated:N,imageRenderingValue:d};return x.supportsFullscreen=function(){return n.supportsFullscreen()},x.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},x.supportsWebWorkers=function(){return"undefined"!=typeof Worker},x}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,i,a){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:a.BYTE,UNSIGNED_BYTE:a.UNSIGNED_BYTE,SHORT:a.SHORT,UNSIGNED_SHORT:a.UNSIGNED_SHORT,INT:a.INT,UNSIGNED_INT:a.UNSIGNED_INT,FLOAT:a.FLOAT,DOUBLE:a.DOUBLE};return o.getSizeInBytes=function(e){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.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},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 Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,i){switch(r=e(r,0),i=e(i,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,i);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,i);case o.SHORT:return new Int16Array(n,r,i);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,i);case o.INT:return new Int32Array(n,r,i);case o.UNSIGNED_INT:return new Uint32Array(n,r,i);case o.FLOAT:return new Float32Array(n,r,i);case o.DOUBLE:return new Float64Array(n,r,i)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},i(o)}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===n.POINTS||e===n.LINES||e===n.LINE_LOOP||e===n.LINE_STRIP||e===n.TRIANGLES||e===n.TRIANGLE_STRIP||e===n.TRIANGLE_FAN}};return e(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,i){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,i.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return a.computeNumberOfVertices=function(e){var n=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var i=e.attributes[r],a=i.values.length/i.componentsPerAttribute;n=a}return n},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(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 r}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/BoxOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./PrimitiveType"],function(e,t,n,r,i,a,o,u,E,s){"use strict";function c(e){e=r(e,r.EMPTY_OBJECT);var n=e.minimum,i=e.maximum;this._min=t.clone(n),this._max=t.clone(i),this._workerName="createBoxOutlineGeometry"}var _=new t;c.fromDimensions=function(e){e=r(e,r.EMPTY_OBJECT);var n=e.dimensions,i=t.multiplyByScalar(n,.5,new t);return new c({minimum:t.negate(i,new t),maximum:i})},c.fromAxisAlignedBoundingBox=function(e){return new c({minimum:e.minimum,maximum:e.maximum})},c.packedLength=2*t.packedLength,c.pack=function(e,n,i){return i=r(i,0),t.pack(e._min,n,i),t.pack(e._max,n,i+t.packedLength),n};var T=new t,R=new t,l={minimum:T,maximum:R};return c.unpack=function(e,n,a){n=r(n,0);var o=t.unpack(e,n,T),u=t.unpack(e,n+t.packedLength,R);return i(a)?(a._min=t.clone(o,a._min),a._max=t.clone(u,a._max),a):new c(l)},c.createGeometry=function(r){var i=r._min,a=r._max;if(!t.equals(i,a)){var c=new E,T=new Uint16Array(24),R=new Float64Array(24);R[0]=i.x,R[1]=i.y,R[2]=i.z,R[3]=a.x,R[4]=i.y,R[5]=i.z,R[6]=a.x,R[7]=a.y,R[8]=i.z,R[9]=i.x,R[10]=a.y,R[11]=i.z,R[12]=i.x,R[13]=i.y,R[14]=a.z,R[15]=a.x,R[16]=i.y,R[17]=a.z,R[18]=a.x,R[19]=a.y,R[20]=a.z,R[21]=i.x,R[22]=a.y,R[23]=a.z,c.position=new u({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:R}),T[0]=4,T[1]=5,T[2]=5,T[3]=6,T[4]=6,T[5]=7,T[6]=7,T[7]=4,T[8]=0,T[9]=1,T[10]=1,T[11]=2,T[12]=2,T[13]=3,T[14]=3,T[15]=0,T[16]=0,T[17]=4,T[18]=1,T[19]=5,T[20]=2,T[21]=6,T[22]=3,T[23]=7;var l=t.subtract(a,i,_),A=.5*t.magnitude(l);return new o({attributes:c,indices:T,primitiveType:s.LINES,boundingSphere:new e(t.ZERO,A)})}},c}),define("Workers/createBoxOutlineGeometry",["../Core/BoxOutlineGeometry","../Core/defined"],function(e,t){"use strict";return function(n,r){return t(r)&&(n=e.unpack(n,r)),e.createGeometry(n)}})}(); \ No newline at end of file diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createCircleGeometry.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createCircleGeometry.js index 37c2cf3c..af233930 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createCircleGeometry.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createCircleGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -222,9 +222,9 @@ OTHER DEALINGS IN THE SOFTWARE. * */ -!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==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";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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("Core/isArray",["./defined"],function(e){"use strict";var t=Array.isArray;return e(t)||(t=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),t}),define("Core/Check",["./defaultValue","./defined","./DeveloperError","./isArray"],function(e,t,r,n){"use strict";function a(e){return e+" was required but undefined."}function i(e,t,r){return"Expected "+r+" to be typeof "+t+", got "+e}var o={};return o.typeOf={},o.numeric={},o.defined=function(e,n){if(!t(e))throw new r(a(n))},o.numeric.maximum=function(e,t){if(o.typeOf.number(e),o.typeOf.number(t),e>t)throw new r("Expected "+e+" to be at most "+t)},o.numeric.minimum=function(e,t){if(o.typeOf.number(e),o.typeOf.number(t),e<t)throw new r("Expected "+e+" to be at least "+t)},o.typeOf.function=function(e,t){if("function"!=typeof e)throw new r(i(typeof e,"function",t))},o.typeOf.string=function(e,t){if("string"!=typeof e)throw new r(i(typeof e,"string",t))},o.typeOf.number=function(e,t){if("number"!=typeof e)throw new r(i(typeof e,"number",t))},o.typeOf.object=function(e,t){if("object"!=typeof e)throw new r(i(typeof e,"object",t))},o.typeOf.boolean=function(e,t){if("boolean"!=typeof e)throw new r(i(typeof e,"boolean",t))},o}),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^=e<<7&2636928640,e^=e<<15&4022730752,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,r,n){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:e<0?-1:0},a.signNotZero=function(e){return e<0?-1:1},a.toSNorm=function(e,r){return r=t(r,255),Math.round((.5*a.clamp(e,-1,1)+.5)*r)},a.fromSNorm=function(e,r){return r=t(r,255),a.clamp(e,0,r)/r*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t-r)},a.cosh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t+r)},a.lerp=function(e,t,r){return(1-r)*e+r*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){var t=a.TWO_PI,r=e-Math.floor(e/t)*t;return r<-Math.PI?r+t:r>=Math.PI?r-t:r},a.clampToLatitudeRange=function(e){return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){return(e%t+t)%t},a.equalsEpsilon=function(e,r,n,a){a=t(a,n);var i=Math.abs(e-r);return i<=a||i<=n*Math.max(Math.abs(e),Math.abs(r))};var i=[1];a.factorial=function(e){var t=i.length;if(e>=t)for(var r=i[t-1],n=t;n<=e;n++)i.push(r*n);return i[e]},a.incrementWrap=function(e,r,n){return n=t(n,0),++e,e>r&&(e=n),e},a.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,r){return e<t?t:e>r?r:e};var o=new e;return a.setRandomNumberSeed=function(t){o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(e){return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){return Math.log(e)/Math.log(t)},a.fog=function(e,t){var r=e*t;return 1-Math.exp(-(r*r))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i){"use strict";function o(e,r,n){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0)}o.fromSpherical=function(e,n){r(n)||(n=new o);var a=e.clock,i=e.cone,u=t(e.magnitude,1),s=u*Math.sin(i);return n.x=s*Math.cos(a),n.y=s*Math.sin(a),n.z=u*Math.cos(i),n},o.fromElements=function(e,t,n,a){return r(a)?(a.x=e,a.y=t,a.z=n,a):new o(e,t,n)},o.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n]=e.z,r},o.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new o),a.x=e[n++],a.y=e[n++],a.z=e[n],a},o.packArray=function(e,t){var n=e.length;r(t)?t.length=3*n:t=new Array(3*n);for(var a=0;a<n;++a)o.pack(e[a],t,3*a);return t},o.unpackArray=function(e,t){var n=e.length;r(t)?t.length=n/3:t=new Array(n/3);for(var a=0;a<n;a+=3){var i=a/3;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},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},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},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},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},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},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},o.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r.z=e.z/t.z,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},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},o.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*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},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,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};var s=new o;o.lerp=function(e,t,r,n){return o.multiplyByScalar(t,r,s),n=o.multiplyByScalar(e,1-r,n),o.add(s,n,n)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var r=o.dot(c,l),n=o.magnitude(o.cross(c,l,c));return Math.atan2(n,r)};var f=new o;o.mostOrthogonalAxis=function(e,t){var r=o.normalize(e,f);return o.abs(r,r),t=r.x<=r.y?r.x<=r.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):r.y<=r.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},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,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]},o.equalsEpsilon=function(e,t,n,a){return e===t||r(e)&&r(t)&&i.equalsEpsilon(e.x,t.x,n,a)&&i.equalsEpsilon(e.y,t.y,n,a)&&i.equalsEpsilon(e.z,t.z,n,a)},o.cross=function(e,t,r){var n=e.x,a=e.y,i=e.z,o=t.x,u=t.y,s=t.z,c=a*s-i*u,l=i*o-n*s,f=n*u-a*o;return r.x=c,r.y=l,r.z=f,r},o.fromDegrees=function(e,t,r,n,a){return e=i.toRadians(e),t=i.toRadians(t),o.fromRadians(e,t,r,n,a)};var d=new o,h=new o,E=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,n,a,i,u){a=t(a,0);var s=r(i)?i.radiiSquared:E,c=Math.cos(n);d.x=c*Math.cos(e),d.y=c*Math.sin(e),d.z=Math.sin(n),d=o.normalize(d,d),o.multiplyComponents(s,d,h);var l=Math.sqrt(o.dot(d,h));return h=o.divideByScalar(h,l,h),d=o.multiplyByScalar(d,a,d),r(u)||(u=new o),o.add(h,d,u)},o.fromDegreesArray=function(e,t,n){var a=e.length;r(n)?n.length=a/2:n=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;n[c]=o.fromDegrees(u,s,0,t,n[c])}return n},o.fromRadiansArray=function(e,t,n){var a=e.length;r(n)?n.length=a/2:n=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;n[c]=o.fromRadians(u,s,0,t,n[c])}return n},o.fromDegreesArrayHeights=function(e,t,n){var a=e.length;r(n)?n.length=a/3:n=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;n[l]=o.fromDegrees(u,s,c,t,n[l])}return n},o.fromRadiansArrayHeights=function(e,t,n){var a=e.length;r(n)?n.length=a/3:n=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;n[l]=o.fromRadians(u,s,c,t,n[l])}return n},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(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,t,r){return o.equalsEpsilon(this,e,t,r)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),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/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,r,n){"use strict";function a(r,a,u,s,c){var l=r.x,f=r.y,d=r.z,h=a.x,E=a.y,m=a.z,p=l*l*h*h,y=f*f*E*E,_=d*d*m*m,T=p+y+_,R=Math.sqrt(1/T),v=e.multiplyByScalar(r,R,i);if(T<s)return isFinite(R)?e.clone(v,c):void 0;var A=u.x,S=u.y,N=u.z,I=o;I.x=v.x*A*2,I.y=v.y*S*2,I.z=v.z*N*2;var g,O,M,w,x,C,P,D,L,U,b,F=(1-R)*e.magnitude(r)/(.5*e.magnitude(I)),z=0;do{F-=z,M=1/(1+F*A),w=1/(1+F*S),x=1/(1+F*N),C=M*M,P=w*w,D=x*x,L=C*M,U=P*w,b=D*x,g=p*C+y*P+_*D-1,O=p*L*A+y*U*S+_*b*N;var B=-2*O;z=g/B}while(Math.abs(g)>n.EPSILON12);return t(c)?(c.x=l*M,c.y=f*w,c.z=d*x,c):new e(l*M,f*w,d*x)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,r,n,a,i,o){"use strict";function u(e,r,n){this.longitude=t(e,0),this.latitude=t(r,0),this.height=t(n,0)}u.fromRadians=function(e,n,a,i){return a=t(a,0),r(i)?(i.longitude=e,i.latitude=n,i.height=a,i):new u(e,n,a)},u.fromDegrees=function(e,t,r,n){return e=i.toRadians(e),t=i.toRadians(t),u.fromRadians(e,t,r,n)};var s=new e,c=new e,l=new e,f=new e(1/6378137,1/6378137,1/6356752.314245179),d=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),h=i.EPSILON1;return u.fromCartesian=function(t,n,a){var E=r(n)?n.oneOverRadii:f,m=r(n)?n.oneOverRadiiSquared:d,p=r(n)?n._centerToleranceSquared:h,y=o(t,E,m,p,c);if(r(y)){var _=e.multiplyComponents(y,m,s);_=e.normalize(_,_);var T=e.subtract(t,y,l),R=Math.atan2(_.y,_.x),v=Math.asin(_.z),A=i.sign(e.dot(T,t))*e.magnitude(T);return r(a)?(a.longitude=R,a.latitude=v,a.height=A,a):new u(R,v,A)}},u.clone=function(e,t){if(r(e))return r(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||r(e)&&r(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n},u.ZERO=a(new u(0,0,0)),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,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,r,n,a,i,o,u,s){"use strict";function c(t,n,a,i){n=r(n,0),a=r(a,0),i=r(i,0),t._radii=new e(n,a,i),t._radiiSquared=new e(n*n,a*a,i*i),t._radiiToTheFourth=new e(n*n*n*n,a*a*a*a,i*i*i*i),t._oneOverRadii=new e(0===n?0:1/n,0===a?0:1/a,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===n?0:1/(n*n),0===a?0:1/(a*a),0===i?0:1/(i*i)),t._minimumRadius=Math.min(n,a,i),t._maximumRadius=Math.max(n,a,i),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(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,this._sqauredXOverSquaredZ=void 0,c(this,e,t,r)}a(l.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}}}),l.clone=function(t,r){if(n(t)){var a=t._radii;return n(r)?(e.clone(a,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 l(a.x,a.y,a.z)}},l.fromCartesian3=function(e,t){return n(t)||(t=new l),n(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,n,a){return a=r(a,0),e.pack(t._radii,n,a),n},l.unpack=function(t,n,a){n=r(n,0);var i=e.unpack(t,n);return l.fromCartesian3(i,a)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,r){var a=t.longitude,i=t.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return n(r)||(r=new e),r.x=u,r.y=s,r.z=c,e.normalize(r,r)},l.prototype.geodeticSurfaceNormal=function(t,r){return n(r)||(r=new e),r=e.multiplyComponents(t,this._oneOverRadiiSquared,r),e.normalize(r,r)};var f=new e,d=new e;l.prototype.cartographicToCartesian=function(t,r){var a=f,i=d;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(e.dot(a,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(a,t.height,a),n(r)||(r=new e),e.add(i,a,r)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var a=0;a<r;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var h=new e,E=new e,m=new e;return l.prototype.cartesianToCartographic=function(r,a){var i=this.scaleToGeodeticSurface(r,E);if(n(i)){var o=this.geodeticSurfaceNormal(i,h),s=e.subtract(r,i,m),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),f=u.sign(e.dot(s,r))*e.magnitude(s);return n(a)?(a.longitude=c,a.latitude=l,a.height=f,a):new t(c,l,f)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var a=0;a<r;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,r){n(r)||(r=new e);var a=t.x,i=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return e.multiplyByScalar(t,s,r)},l.prototype.transformPositionToScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._oneOverRadii,r)},l.prototype.transformPositionFromScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._radii,r)},l.prototype.equals=function(t){return this===t||n(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,a,i){a=r(a,0);var o=this._sqauredXOverSquaredZ;if(n(i)||(i=new e),i.x=0,i.y=0,i.z=t.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},l}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,r,n,a,i,o){"use strict";function u(e){this._ellipsoid=r(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,r){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return n(r)?(r.x=i,r.y=o,r.z=u,r):new e(i,o,u)},u.prototype.unproject=function(e,r){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,u=e.z;return n(r)?(r.longitude=i,r.latitude=o,r.height=u,r):new t(i,o,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";function t(t,r){this.start=e(t,0),this.stop=e(r,0)}return t}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i,o){"use strict";function u(e,r,n,a,i,o,u,s,c){this[0]=t(e,0),this[1]=t(a,0),this[2]=t(u,0),this[3]=t(r,0),this[4]=t(i,0),this[5]=t(s,0),this[6]=t(n,0),this[7]=t(o,0),this[8]=t(c,0)}function s(e){for(var t=0,r=0;r<9;++r){var n=e[r];t+=n*n}return Math.sqrt(t)}function c(e){for(var t=0,r=0;r<3;++r){var n=e[u.getElementIndex(E[r],h[r])];t+=2*n*n}return Math.sqrt(t)}function l(e,t){for(var r=o.EPSILON15,n=0,a=1,i=0;i<3;++i){var s=Math.abs(e[u.getElementIndex(E[i],h[i])]);s>n&&(a=i,n=s)}var c=1,l=0,f=h[a],d=E[a];if(Math.abs(e[u.getElementIndex(d,f)])>r){var m,p=e[u.getElementIndex(d,d)],y=e[u.getElementIndex(f,f)],_=e[u.getElementIndex(d,f)],T=(p-y)/2/_;m=T<0?-1/(-T+Math.sqrt(1+T*T)):1/(T+Math.sqrt(1+T*T)),c=1/Math.sqrt(1+m*m),l=m*c}return t=u.clone(u.IDENTITY,t),t[u.getElementIndex(f,f)]=t[u.getElementIndex(d,d)]=c,t[u.getElementIndex(d,f)]=l,t[u.getElementIndex(f,d)]=-l,t}u.packedLength=9,u.pack=function(e,r,n){return 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},u.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new u),a[0]=e[n++],a[1]=e[n++],a[2]=e[n++],a[3]=e[n++],a[4]=e[n++],a[5]=e[n++],a[6]=e[n++],a[7]=e[n++],a[8]=e[n++],a},u.clone=function(e,t){if(r(e))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):new u(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},u.fromArray=function(e,n,a){return n=t(n,0),r(a)||(a=new u),a[0]=e[n],a[1]=e[n+1],a[2]=e[n+2],a[3]=e[n+3],a[4]=e[n+4],a[5]=e[n+5],a[6]=e[n+6],a[7]=e[n+7],a[8]=e[n+8],a},u.fromColumnMajorArray=function(e,t){return u.clone(e,t)},u.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 u(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},u.fromQuaternion=function(e,t){var n=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,s=e.y*e.y,c=e.y*e.z,l=e.y*e.w,f=e.z*e.z,d=e.z*e.w,h=e.w*e.w,E=n-s-f+h,m=2*(a-d),p=2*(i+l),y=2*(a+d),_=-n+s-f+h,T=2*(c-o),R=2*(i-l),v=2*(c+o),A=-n-s+f+h;return r(t)?(t[0]=E,t[1]=y,t[2]=R,t[3]=m,t[4]=_,t[5]=v,t[6]=p,t[7]=T,t[8]=A,t):new u(E,m,p,y,_,T,R,v,A)},u.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),a=Math.cos(-e.heading),i=Math.cos(e.roll),o=Math.sin(-e.pitch),s=Math.sin(-e.heading),c=Math.sin(e.roll),l=n*a,f=-i*s+c*o*a,d=c*s+i*o*a,h=n*s,E=i*a+c*o*s,m=-o*i+i*o*s,p=-o,y=c*n,_=i*n;return r(t)?(t[0]=l,t[1]=h,t[2]=p,t[3]=f,t[4]=E,t[5]=y,t[6]=d,t[7]=m,t[8]=_,t):new u(l,f,d,h,E,m,p,y,_)},u.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 u(e.x,0,0,0,e.y,0,0,0,e.z)},u.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 u(e,0,0,0,e,0,0,0,e)},u.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 u(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},u.fromRotationX=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=a,t[6]=0,t[7]=-a,t[8]=n,t):new u(1,0,0,0,n,-a,0,a,n)},u.fromRotationY=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=n,t):new u(n,0,a,0,1,0,-a,0,n)},u.fromRotationZ=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=a,t[2]=0,t[3]=-a,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new u(n,-a,0,a,n,0,0,0,1)},u.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]]},u.getElementIndex=function(e,t){return 3*e+t},u.getColumn=function(e,t,r){var n=3*t,a=e[n],i=e[n+1],o=e[n+2];return r.x=a,r.y=i,r.z=o,r},u.setColumn=function(e,t,r,n){n=u.clone(e,n);var a=3*t;return n[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n},u.getRow=function(e,t,r){var n=e[t],a=e[t+3],i=e[t+6];return r.x=n,r.y=a,r.z=i,r},u.setRow=function(e,t,r,n){return n=u.clone(e,n),n[t]=r.x,n[t+3]=r.y,n[t+6]=r.z,n};var f=new e;u.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],f)),r.y=e.magnitude(e.fromElements(t[3],t[4],t[5],f)),r.z=e.magnitude(e.fromElements(t[6],t[7],t[8],f)),r};var d=new e;u.getMaximumScale=function(t){return u.getScale(t,d),e.maximumComponent(d)},u.multiply=function(e,t,r){var n=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=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]=a,r[2]=i,r[3]=o,r[4]=u,r[5]=s,r[6]=c,r[7]=l,r[8]=f,r},u.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},u.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},u.multiplyByVector=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=e[0]*n+e[3]*a+e[6]*i,u=e[1]*n+e[4]*a+e[7]*i,s=e[2]*n+e[5]*a+e[8]*i;return r.x=o,r.y=u,r.z=s,r},u.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},u.multiplyByScale=function(e,t,r){return r[0]=e[0]*t.x,r[1]=e[1]*t.x,r[2]=e[2]*t.x,r[3]=e[3]*t.y,r[4]=e[4]*t.y,r[5]=e[5]*t.y,r[6]=e[6]*t.z,r[7]=e[7]*t.z,r[8]=e[8]*t.z,r},u.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},u.transpose=function(e,t){var r=e[0],n=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=r,t[1]=n,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var h=[1,0,0],E=[2,2,1],m=new u,p=new u;return u.computeEigenDecomposition=function(e,t){var n=o.EPSILON20,a=10,i=0,f=0;r(t)||(t={});for(var d=t.unitary=u.clone(u.IDENTITY,t.unitary),h=t.diagonal=u.clone(e,t.diagonal),E=n*s(h);f<a&&c(h)>E;)l(h,m),u.transpose(m,p),u.multiply(h,m,h),u.multiply(p,h,h),u.multiply(d,m,d),++i>2&&(++f,i=0);return t},u.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},u.determinant=function(e){var t=e[0],r=e[3],n=e[6],a=e[1],i=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*o)+a*(s*n-r*c)+u*(r*o-i*n)},u.inverse=function(e,t){var r=e[0],n=e[1],a=e[2],i=e[3],o=e[4],s=e[5],c=e[6],l=e[7],f=e[8],d=u.determinant(e);t[0]=o*f-l*s,t[1]=l*a-n*f,t[2]=n*s-o*a,t[3]=c*s-i*f,t[4]=r*f-c*a,t[5]=i*a-r*s,t[6]=i*l-c*o,t[7]=c*n-r*l,t[8]=r*o-i*n;var h=1/d;return u.multiplyByScalar(t,h,t)},u.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]},u.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},u.IDENTITY=i(new u(1,0,0,0,1,0,0,0,1)),u.ZERO=i(new u(0,0,0,0,0,0,0,0,0)),u.COLUMN0ROW0=0,u.COLUMN0ROW1=1,u.COLUMN0ROW2=2,u.COLUMN1ROW0=3,u.COLUMN1ROW1=4,u.COLUMN1ROW2=5,u.COLUMN2ROW0=6,u.COLUMN2ROW1=7,u.COLUMN2ROW2=8,n(u.prototype,{length:{get:function(){return u.packedLength}}}),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},u}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a){"use strict";function i(t,r,n,a){this.x=e(t,0),this.y=e(r,0),this.z=e(n,0),this.w=e(a,0)}i.fromElements=function(e,r,n,a,o){return t(o)?(o.x=e,o.y=r,o.z=n,o.w=a,o):new i(e,r,n,a)},i.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 i(e.red,e.green,e.blue,e.alpha)},i.clone=function(e,r){if(t(e))return t(r)?(r.x=e.x,r.y=e.y,r.z=e.z,r.w=e.w,r):new i(e.x,e.y,e.z,e.w)},i.packedLength=4,i.pack=function(t,r,n){return n=e(n,0),r[n++]=t.x,r[n++]=t.y,r[n++]=t.z,r[n]=t.w,r},i.unpack=function(r,n,a){return n=e(n,0),t(a)||(a=new i),a.x=r[n++],a.y=r[n++],a.z=r[n++],a.w=r[n],a},i.packArray=function(e,r){var n=e.length;t(r)?r.length=4*n:r=new Array(4*n);for(var a=0;a<n;++a)i.pack(e[a],r,4*a);return r},i.unpackArray=function(e,r){var n=e.length;t(r)?r.length=n/4:r=new Array(n/4);for(var a=0;a<n;a+=4){var o=a/4;r[o]=i.unpack(e,a,r[o])}return r},i.fromArray=i.unpack,i.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},i.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},i.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},i.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},i.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},i.magnitude=function(e){return Math.sqrt(i.magnitudeSquared(e))};var o=new i;i.distance=function(e,t){return i.subtract(e,t,o),i.magnitude(o)},i.distanceSquared=function(e,t){return i.subtract(e,t,o),i.magnitudeSquared(o)},i.normalize=function(e,t){var r=i.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t.z=e.z/r,t.w=e.w/r,t},i.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},i.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},i.divideComponents=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},i.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},i.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},i.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},i.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},i.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},i.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 u=new i;i.lerp=function(e,t,r,n){return i.multiplyByScalar(t,r,u),n=i.multiplyByScalar(e,1-r,n),i.add(u,n,n)};var s=new i;return i.mostOrthogonalAxis=function(e,t){var r=i.normalize(e,s);return i.abs(r,r),t=r.x<=r.y?r.x<=r.z?r.x<=r.w?i.clone(i.UNIT_X,t):i.clone(i.UNIT_W,t):r.z<=r.w?i.clone(i.UNIT_Z,t):i.clone(i.UNIT_W,t):r.y<=r.z?r.y<=r.w?i.clone(i.UNIT_Y,t):i.clone(i.UNIT_W,t):r.z<=r.w?i.clone(i.UNIT_Z,t):i.clone(i.UNIT_W,t)},i.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},i.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]&&e.w===t[r+3]},i.equalsEpsilon=function(e,r,n,i){return e===r||t(e)&&t(r)&&a.equalsEpsilon(e.x,r.x,n,i)&&a.equalsEpsilon(e.y,r.y,n,i)&&a.equalsEpsilon(e.z,r.z,n,i)&&a.equalsEpsilon(e.w,r.w,n,i)},i.ZERO=n(new i(0,0,0,0)),i.UNIT_X=n(new i(1,0,0,0)),i.UNIT_Y=n(new i(0,1,0,0)),i.UNIT_Z=n(new i(0,0,1,0)),i.UNIT_W=n(new i(0,0,0,1)),i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i.prototype.equalsEpsilon=function(e,t,r){return i.equalsEpsilon(this,e,t,r)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},i}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,r,n,a,i,o,u,s,c){"use strict";function l(e,t,n,a,i,o,u,s,c,l,f,d,h,E,m,p){this[0]=r(e,0),this[1]=r(i,0),this[2]=r(c,0),this[3]=r(h,0),this[4]=r(t,0), -this[5]=r(o,0),this[6]=r(l,0),this[7]=r(E,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(f,0),this[11]=r(m,0),this[12]=r(a,0),this[13]=r(s,0),this[14]=r(d,0),this[15]=r(p,0)}l.packedLength=16,l.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},l.unpack=function(e,t,a){return t=r(t,0),n(a)||(a=new l),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a[9]=e[t++],a[10]=e[t++],a[11]=e[t++],a[12]=e[t++],a[13]=e[t++],a[14]=e[t++],a[15]=e[t],a},l.clone=function(e,t){if(n(e))return n(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 l(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])},l.fromArray=l.unpack,l.fromColumnMajorArray=function(e,t){return l.clone(e,t)},l.fromRowMajorArray=function(e,t){return n(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 l(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])},l.fromRotationTranslation=function(t,a,i){return a=r(a,e.ZERO),n(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=a.x,i[13]=a.y,i[14]=a.z,i[15]=1,i):new l(t[0],t[3],t[6],a.x,t[1],t[4],t[7],a.y,t[2],t[5],t[8],a.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(e,t,r,a){n(a)||(a=new l);var i=r.x,o=r.y,u=r.z,s=t.x*t.x,c=t.x*t.y,f=t.x*t.z,d=t.x*t.w,h=t.y*t.y,E=t.y*t.z,m=t.y*t.w,p=t.z*t.z,y=t.z*t.w,_=t.w*t.w,T=s-h-p+_,R=2*(c-y),v=2*(f+m),A=2*(c+y),S=-s+h-p+_,N=2*(E-d),I=2*(f-m),g=2*(E+d),O=-s-h+p+_;return a[0]=T*i,a[1]=A*i,a[2]=I*i,a[3]=0,a[4]=R*o,a[5]=S*o,a[6]=g*o,a[7]=0,a[8]=v*u,a[9]=N*u,a[10]=O*u,a[11]=0,a[12]=e.x,a[13]=e.y,a[14]=e.z,a[15]=1,a},l.fromTranslationRotationScale=function(e,t){return l.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},l.fromTranslation=function(e,t){return l.fromRotationTranslation(s.IDENTITY,e,t)},l.fromScale=function(e,t){return n(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 l(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},l.fromUniformScale=function(e,t){return n(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 l(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var f=new e,d=new e,h=new e;l.fromCamera=function(t,r){var a=t.position,i=t.direction,o=t.up;e.normalize(i,f),e.normalize(e.cross(f,o,d),d),e.normalize(e.cross(d,f,h),h);var u=d.x,s=d.y,c=d.z,E=f.x,m=f.y,p=f.z,y=h.x,_=h.y,T=h.z,R=a.x,v=a.y,A=a.z,S=u*-R+s*-v+c*-A,N=y*-R+_*-v+T*-A,I=E*R+m*v+p*A;return n(r)?(r[0]=u,r[1]=y,r[2]=-E,r[3]=0,r[4]=s,r[5]=_,r[6]=-m,r[7]=0,r[8]=c,r[9]=T,r[10]=-p,r[11]=0,r[12]=S,r[13]=N,r[14]=I,r[15]=1,r):new l(u,s,c,S,y,_,T,N,-E,-m,-p,I,0,0,0,1)},l.computePerspectiveFieldOfView=function(e,t,r,n,a){var i=Math.tan(.5*e),o=1/i,u=o/t,s=(n+r)/(r-n),c=2*n*r/(r-n);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=c,a[15]=0,a},l.computeOrthographicOffCenter=function(e,t,r,n,a,i,o){var u=1/(t-e),s=1/(n-r),c=1/(i-a),l=-(t+e)*u,f=-(n+r)*s,d=-(i+a)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=f,o[14]=d,o[15]=1,o},l.computePerspectiveOffCenter=function(e,t,r,n,a,i,o){var u=2*a/(t-e),s=2*a/(n-r),c=(t+e)/(t-e),l=(n+r)/(n-r),f=-(i+a)/(i-a),d=-1,h=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=f,o[11]=d,o[12]=0,o[13]=0,o[14]=h,o[15]=0,o},l.computeInfinitePerspectiveOffCenter=function(e,t,r,n,a,i){var o=2*a/(t-e),u=2*a/(n-r),s=(t+e)/(t-e),c=(n+r)/(n-r),l=-1,f=-1,d=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=s,i[9]=c,i[10]=l,i[11]=f,i[12]=0,i[13]=0,i[14]=d,i[15]=0,i},l.computeViewportTransformation=function(e,t,n,a){e=r(e,r.EMPTY_OBJECT);var i=r(e.x,0),o=r(e.y,0),u=r(e.width,0),s=r(e.height,0);t=r(t,0),n=r(n,1);var c=.5*u,l=.5*s,f=.5*(n-t),d=c,h=l,E=f,m=i+c,p=o+l,y=t+f,_=1;return a[0]=d,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=h,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=E,a[11]=0,a[12]=m,a[13]=p,a[14]=y,a[15]=_,a},l.computeView=function(t,r,n,a,i){return i[0]=a.x,i[1]=n.x,i[2]=-r.x,i[3]=0,i[4]=a.y,i[5]=n.y,i[6]=-r.y,i[7]=0,i[8]=a.z,i[9]=n.z,i[10]=-r.z,i[11]=0,i[12]=-e.dot(a,t),i[13]=-e.dot(n,t),i[14]=e.dot(r,t),i[15]=1,i},l.toArray=function(e,t){return n(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]]},l.getElementIndex=function(e,t){return 4*e+t},l.getColumn=function(e,t,r){var n=4*t,a=e[n],i=e[n+1],o=e[n+2],u=e[n+3];return r.x=a,r.y=i,r.z=o,r.w=u,r},l.setColumn=function(e,t,r,n){n=l.clone(e,n);var a=4*t;return n[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n[a+3]=r.w,n},l.setTranslation=function(e,t,r){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]=t.x,r[13]=t.y,r[14]=t.z,r[15]=e[15],r},l.getRow=function(e,t,r){var n=e[t],a=e[t+4],i=e[t+8],o=e[t+12];return r.x=n,r.y=a,r.z=i,r.w=o,r},l.setRow=function(e,t,r,n){return n=l.clone(e,n),n[t]=r.x,n[t+4]=r.y,n[t+8]=r.z,n[t+12]=r.w,n};var E=new e;l.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],E)),r.y=e.magnitude(e.fromElements(t[4],t[5],t[6],E)),r.z=e.magnitude(e.fromElements(t[8],t[9],t[10],E)),r};var m=new e;l.getMaximumScale=function(t){return l.getScale(t,m),e.maximumComponent(m)},l.multiply=function(e,t,r){var n=e[0],a=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],f=e[8],d=e[9],h=e[10],E=e[11],m=e[12],p=e[13],y=e[14],_=e[15],T=t[0],R=t[1],v=t[2],A=t[3],S=t[4],N=t[5],I=t[6],g=t[7],O=t[8],M=t[9],w=t[10],x=t[11],C=t[12],P=t[13],D=t[14],L=t[15],U=n*T+u*R+f*v+m*A,b=a*T+s*R+d*v+p*A,F=i*T+c*R+h*v+y*A,z=o*T+l*R+E*v+_*A,B=n*S+u*N+f*I+m*g,G=a*S+s*N+d*I+p*g,q=i*S+c*N+h*I+y*g,V=o*S+l*N+E*I+_*g,W=n*O+u*M+f*w+m*x,X=a*O+s*M+d*w+p*x,H=i*O+c*M+h*w+y*x,Y=o*O+l*M+E*w+_*x,k=n*C+u*P+f*D+m*L,j=a*C+s*P+d*D+p*L,Z=i*C+c*P+h*D+y*L,K=o*C+l*P+E*D+_*L;return r[0]=U,r[1]=b,r[2]=F,r[3]=z,r[4]=B,r[5]=G,r[6]=q,r[7]=V,r[8]=W,r[9]=X,r[10]=H,r[11]=Y,r[12]=k,r[13]=j,r[14]=Z,r[15]=K,r},l.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},l.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},l.multiplyTransformation=function(e,t,r){var n=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],d=e[12],h=e[13],E=e[14],m=t[0],p=t[1],y=t[2],_=t[4],T=t[5],R=t[6],v=t[8],A=t[9],S=t[10],N=t[12],I=t[13],g=t[14],O=n*m+o*p+c*y,M=a*m+u*p+l*y,w=i*m+s*p+f*y,x=n*_+o*T+c*R,C=a*_+u*T+l*R,P=i*_+s*T+f*R,D=n*v+o*A+c*S,L=a*v+u*A+l*S,U=i*v+s*A+f*S,b=n*N+o*I+c*g+d,F=a*N+u*I+l*g+h,z=i*N+s*I+f*g+E;return r[0]=O,r[1]=M,r[2]=w,r[3]=0,r[4]=x,r[5]=C,r[6]=P,r[7]=0,r[8]=D,r[9]=L,r[10]=U,r[11]=0,r[12]=b,r[13]=F,r[14]=z,r[15]=1,r},l.multiplyByMatrix3=function(e,t,r){var n=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],d=t[0],h=t[1],E=t[2],m=t[3],p=t[4],y=t[5],_=t[6],T=t[7],R=t[8],v=n*d+o*h+c*E,A=a*d+u*h+l*E,S=i*d+s*h+f*E,N=n*m+o*p+c*y,I=a*m+u*p+l*y,g=i*m+s*p+f*y,O=n*_+o*T+c*R,M=a*_+u*T+l*R,w=i*_+s*T+f*R;return r[0]=v,r[1]=A,r[2]=S,r[3]=0,r[4]=N,r[5]=I,r[6]=g,r[7]=0,r[8]=O,r[9]=M,r[10]=w,r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r},l.multiplyByTranslation=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=n*e[0]+a*e[4]+i*e[8]+e[12],u=n*e[1]+a*e[5]+i*e[9]+e[13],s=n*e[2]+a*e[6]+i*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]=o,r[13]=u,r[14]=s,r[15]=e[15],r};var p=new e;l.multiplyByUniformScale=function(e,t,r){return p.x=t,p.y=t,p.z=t,l.multiplyByScale(e,p,r)},l.multiplyByScale=function(e,t,r){var n=t.x,a=t.y,i=t.z;return 1===n&&1===a&&1===i?l.clone(e,r):(r[0]=n*e[0],r[1]=n*e[1],r[2]=n*e[2],r[3]=0,r[4]=a*e[4],r[5]=a*e[5],r[6]=a*e[6],r[7]=0,r[8]=i*e[8],r[9]=i*e[9],r[10]=i*e[10],r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=1,r)},l.multiplyByVector=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=t.w,u=e[0]*n+e[4]*a+e[8]*i+e[12]*o,s=e[1]*n+e[5]*a+e[9]*i+e[13]*o,c=e[2]*n+e[6]*a+e[10]*i+e[14]*o,l=e[3]*n+e[7]*a+e[11]*i+e[15]*o;return r.x=u,r.y=s,r.z=c,r.w=l,r},l.multiplyByPointAsVector=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=e[0]*n+e[4]*a+e[8]*i,u=e[1]*n+e[5]*a+e[9]*i,s=e[2]*n+e[6]*a+e[10]*i;return r.x=o,r.y=u,r.z=s,r},l.multiplyByPoint=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=e[0]*n+e[4]*a+e[8]*i+e[12],u=e[1]*n+e[5]*a+e[9]*i+e[13],s=e[2]*n+e[6]*a+e[10]*i+e[14];return r.x=o,r.y=u,r.z=s,r},l.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},l.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},l.transpose=function(e,t){var r=e[1],n=e[2],a=e[3],i=e[6],o=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]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=o,t[14]=u,t[15]=e[15],t},l.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},l.equals=function(e,t){return e===t||n(e)&&n(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},l.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r&&Math.abs(e[9]-t[9])<=r&&Math.abs(e[10]-t[10])<=r&&Math.abs(e[11]-t[11])<=r&&Math.abs(e[12]-t[12])<=r&&Math.abs(e[13]-t[13])<=r&&Math.abs(e[14]-t[14])<=r&&Math.abs(e[15]-t[15])<=r},l.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},l.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};var y=new s,_=new s,T=new t,R=new t(0,0,0,1);return l.inverse=function(e,r){if(s.equalsEpsilon(l.getRotation(e,y),_,u.EPSILON7)&&t.equals(l.getRow(e,3,T),R))return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=0,r[11]=0,r[12]=-e[12],r[13]=-e[13],r[14]=-e[14],r[15]=1,r;var n=e[0],a=e[4],i=e[8],o=e[12],f=e[1],d=e[5],h=e[9],E=e[13],m=e[2],p=e[6],v=e[10],A=e[14],S=e[3],N=e[7],I=e[11],g=e[15],O=v*g,M=A*I,w=p*g,x=A*N,C=p*I,P=v*N,D=m*g,L=A*S,U=m*I,b=v*S,F=m*N,z=p*S,B=O*d+x*h+C*E-(M*d+w*h+P*E),G=M*f+D*h+b*E-(O*f+L*h+U*E),q=w*f+L*d+F*E-(x*f+D*d+z*E),V=P*f+U*d+z*h-(C*f+b*d+F*h),W=M*a+w*i+P*o-(O*a+x*i+C*o),X=O*n+L*i+U*o-(M*n+D*i+b*o),H=x*n+D*a+z*o-(w*n+L*a+F*o),Y=C*n+b*a+F*i-(P*n+U*a+z*i);O=i*E,M=o*h,w=a*E,x=o*d,C=a*h,P=i*d,D=n*E,L=o*f,U=n*h,b=i*f,F=n*d,z=a*f;var k=O*N+x*I+C*g-(M*N+w*I+P*g),j=M*S+D*I+b*g-(O*S+L*I+U*g),Z=w*S+L*N+F*g-(x*S+D*N+z*g),K=P*S+U*N+z*I-(C*S+b*N+F*I),J=w*v+P*A+M*p-(C*A+O*p+x*v),Q=U*A+O*m+L*v-(D*v+b*A+M*m),$=D*p+z*A+x*m-(F*A+w*m+L*p),ee=F*v+C*m+b*p-(U*p+z*v+P*m),te=n*B+a*G+i*q+o*V;if(Math.abs(te)<u.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return te=1/te,r[0]=B*te,r[1]=G*te,r[2]=q*te,r[3]=V*te,r[4]=W*te,r[5]=X*te,r[6]=H*te,r[7]=Y*te,r[8]=k*te,r[9]=j*te,r[10]=Z*te,r[11]=K*te,r[12]=J*te,r[13]=Q*te,r[14]=$*te,r[15]=ee*te,r},l.inverseTransformation=function(e,t){var r=e[0],n=e[1],a=e[2],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],f=e[12],d=e[13],h=e[14],E=-r*f-n*d-a*h,m=-i*f-o*d-u*h,p=-s*f-c*d-l*h;return t[0]=r,t[1]=i,t[2]=s,t[3]=0,t[4]=n,t[5]=o,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=l,t[11]=0,t[12]=E,t[13]=m,t[14]=p,t[15]=1,t},l.IDENTITY=o(new l(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),l.ZERO=o(new l(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN0ROW3=3,l.COLUMN1ROW0=4,l.COLUMN1ROW1=5,l.COLUMN1ROW2=6,l.COLUMN1ROW3=7,l.COLUMN2ROW0=8,l.COLUMN2ROW1=9,l.COLUMN2ROW2=10,l.COLUMN2ROW3=11,l.COLUMN3ROW0=12,l.COLUMN3ROW1=13,l.COLUMN3ROW2=14,l.COLUMN3ROW3=15,a(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]&&e[9]===t[r+9]&&e[10]===t[r+10]&&e[11]===t[r+11]&&e[12]===t[r+12]&&e[13]===t[r+13]&&e[14]===t[r+14]&&e[15]===t[r+15]},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.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]+")"},l}),define("Core/Rectangle",["./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,r,n,a,i,o,u){"use strict";function s(e,r,n,a){this.west=t(e,0),this.south=t(r,0),this.east=t(n,0),this.north=t(a,0)}n(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,r,n){return n=t(n,0),r[n++]=e.west,r[n++]=e.south,r[n++]=e.east,r[n]=e.north,r},s.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new s),a.west=e[n++],a.south=e[n++],a.east=e[n++],a.north=e[n],a},s.computeWidth=function(e){var t=e.east,r=e.west;return t<r&&(t+=u.TWO_PI),t-r},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,n,a,i,o){return e=u.toRadians(t(e,0)),n=u.toRadians(t(n,0)),a=u.toRadians(t(a,0)),i=u.toRadians(t(i,0)),r(o)?(o.west=e,o.south=n,o.east=a,o.north=i,o):new s(e,n,a,i)},s.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE,f=0,d=e.length;f<d;f++){var h=e[f];n=Math.min(n,h.longitude),a=Math.max(a,h.longitude),c=Math.min(c,h.latitude),l=Math.max(l,h.latitude);var E=h.longitude>=0?h.longitude:h.longitude+u.TWO_PI;i=Math.min(i,E),o=Math.max(o,E)}return a-n>o-i&&(n=i,a=o,a>u.PI&&(a-=u.TWO_PI),n>u.PI&&(n-=u.TWO_PI)),r(t)?(t.west=n,t.south=c,t.east=a,t.north=l,t):new s(n,c,a,l)},s.fromCartesianArray=function(e,t,n){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=Number.MAX_VALUE,f=-Number.MAX_VALUE,d=0,h=e.length;d<h;d++){var E=t.cartesianToCartographic(e[d]);a=Math.min(a,E.longitude),i=Math.max(i,E.longitude),l=Math.min(l,E.latitude),f=Math.max(f,E.latitude);var m=E.longitude>=0?E.longitude:E.longitude+u.TWO_PI;o=Math.min(o,m),c=Math.max(c,m)}return i-a>c-o&&(a=o,i=c,i>u.PI&&(i-=u.TWO_PI),a>u.PI&&(a-=u.TWO_PI)),r(n)?(n.west=a,n.south=l,n.east=i,n.north=f,n):new s(a,l,i,f)},s.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.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},s.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},s.validate=function(e){},s.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)},s.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)},s.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)},s.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)},s.center=function(t,n){var a=t.east,i=t.west;a<i&&(a+=u.TWO_PI);var o=u.negativePiToPi(.5*(i+a)),s=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=s,n.height=0,n):new e(o,s)},s.intersection=function(e,t,n){var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.negativePiToPi(Math.max(i,c)),f=u.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&f<=l)){var d=Math.max(e.south,t.south),h=Math.min(e.north,t.north);if(!(d>=h))return r(n)?(n.west=l,n.south=d,n.east=f,n.north=h,n):new s(l,d,f,h)}},s.simpleIntersection=function(e,t,n){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(i>=u||a>=o))return r(n)?(n.west=a,n.south=i,n.east=o,n.north=u,n):new s(a,i,o,u)},s.union=function(e,t,n){r(n)||(n=new s);var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.convertLongitudeRange(Math.min(i,c)),f=u.convertLongitudeRange(Math.max(a,o));return n.west=l,n.south=Math.min(e.south,t.south),n.east=f,n.north=Math.max(e.north,t.north),n},s.expand=function(e,t,n){return r(n)||(n=new s),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},s.contains=function(e,t){var r=t.longitude,n=t.latitude,a=e.west,i=e.east;return i<a&&(i+=u.TWO_PI,r<0&&(r+=u.TWO_PI)),(r>a||u.equalsEpsilon(r,a,u.EPSILON14))&&(r<i||u.equalsEpsilon(r,i,u.EPSILON14))&&n>=e.south&&n<=e.north};var c=new e;return s.subsample=function(e,n,a,o){n=t(n,i.WGS84),a=t(a,0),r(o)||(o=[]);var l=0,f=e.north,d=e.south,h=e.east,E=e.west,m=c;m.height=a,m.longitude=E,m.latitude=f,o[l]=n.cartographicToCartesian(m,o[l]),l++,m.longitude=h,o[l]=n.cartographicToCartesian(m,o[l]),l++,m.latitude=d,o[l]=n.cartographicToCartesian(m,o[l]),l++,m.longitude=E,o[l]=n.cartographicToCartesian(m,o[l]),l++,f<0?m.latitude=f:d>0?m.latitude=d:m.latitude=0;for(var p=1;p<8;++p)m.longitude=-Math.PI+p*u.PI_OVER_TWO,s.contains(e,m)&&(o[l]=n.cartographicToCartesian(m,o[l]),l++);return 0===m.latitude&&(m.longitude=E,o[l]=n.cartographicToCartesian(m,o[l]),l++,m.longitude=h,o[l]=n.cartographicToCartesian(m,o[l]),l++),o.length=l,o},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,r,n,a,i,o,u,s,c,l,f){"use strict";function d(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var h=new e,E=new e,m=new e,p=new e,y=new e,_=new e,T=new e,R=new e,v=new e,A=new e,S=new e,N=new e;d.fromPoints=function(t,r){if(n(r)||(r=new d),!n(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;for(var a=e.clone(t[0],T),i=e.clone(a,h),o=e.clone(a,E),u=e.clone(a,m),s=e.clone(a,p),c=e.clone(a,y),l=e.clone(a,_),f=t.length,I=1;I<f;I++){e.clone(t[I],a);var g=a.x,O=a.y,M=a.z;g<i.x&&e.clone(a,i),g>s.x&&e.clone(a,s),O<o.y&&e.clone(a,o),O>c.y&&e.clone(a,c),M<u.z&&e.clone(a,u),M>l.z&&e.clone(a,l)}var w=e.magnitudeSquared(e.subtract(s,i,R)),x=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=i,D=s,L=w;x>L&&(L=x,P=o,D=c),C>L&&(L=C,P=u,D=l);var U=v;U.x=.5*(P.x+D.x),U.y=.5*(P.y+D.y),U.z=.5*(P.z+D.z);var b=e.magnitudeSquared(e.subtract(D,U,R)),F=Math.sqrt(b),z=A;z.x=i.x,z.y=o.y,z.z=u.z;var B=S;B.x=s.x,B.y=c.y,B.z=l.z;var G=e.multiplyByScalar(e.add(z,B,R),.5,N),q=0;for(I=0;I<f;I++){e.clone(t[I],a);var V=e.magnitude(e.subtract(a,G,R));V>q&&(q=V);var W=e.magnitudeSquared(e.subtract(a,U,R));if(W>b){var X=Math.sqrt(W);F=.5*(F+X),b=F*F;var H=X-F;U.x=(F*U.x+H*a.x)/X,U.y=(F*U.y+H*a.y)/X,U.z=(F*U.z+H*a.z)/X}}return F<q?(e.clone(U,r.center),r.radius=F):(e.clone(G,r.center),r.radius=q),r};var I=new o,g=new e,O=new e,M=new t,w=new t;d.fromRectangle2D=function(e,t,r){return d.fromRectangleWithHeights2D(e,t,0,0,r)},d.fromRectangleWithHeights2D=function(t,a,i,o,u){if(n(u)||(u=new d),!n(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;a=r(a,I),f.southwest(t,M),M.height=i,f.northeast(t,w),w.height=o;var s=a.project(M,g),c=a.project(w,O),l=c.x-s.x,h=c.y-s.y,E=c.z-s.z;u.radius=.5*Math.sqrt(l*l+h*h+E*E);var m=u.center;return m.x=s.x+.5*l,m.y=s.y+.5*h,m.z=s.z+.5*E,u};var x=[];d.fromRectangle3D=function(e,t,a,o){t=r(t,i.WGS84),a=r(a,0);var u;return n(e)&&(u=f.subsample(e,t,a,x)),d.fromPoints(u,o)},d.fromVertices=function(t,a,i,o){if(n(o)||(o=new d),!n(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;a=r(a,e.ZERO),i=r(i,3);var u=T;u.x=t[0]+a.x,u.y=t[1]+a.y,u.z=t[2]+a.z;for(var s=e.clone(u,h),c=e.clone(u,E),l=e.clone(u,m),f=e.clone(u,p),I=e.clone(u,y),g=e.clone(u,_),O=t.length,M=0;M<O;M+=i){var w=t[M]+a.x,x=t[M+1]+a.y,C=t[M+2]+a.z;u.x=w,u.y=x,u.z=C,w<s.x&&e.clone(u,s),w>f.x&&e.clone(u,f),x<c.y&&e.clone(u,c),x>I.y&&e.clone(u,I),C<l.z&&e.clone(u,l),C>g.z&&e.clone(u,g)}var P=e.magnitudeSquared(e.subtract(f,s,R)),D=e.magnitudeSquared(e.subtract(I,c,R)),L=e.magnitudeSquared(e.subtract(g,l,R)),U=s,b=f,F=P;D>F&&(F=D,U=c,b=I),L>F&&(F=L,U=l,b=g);var z=v;z.x=.5*(U.x+b.x),z.y=.5*(U.y+b.y),z.z=.5*(U.z+b.z);var B=e.magnitudeSquared(e.subtract(b,z,R)),G=Math.sqrt(B),q=A;q.x=s.x,q.y=c.y,q.z=l.z;var V=S;V.x=f.x,V.y=I.y,V.z=g.z;var W=e.multiplyByScalar(e.add(q,V,R),.5,N),X=0;for(M=0;M<O;M+=i){u.x=t[M]+a.x,u.y=t[M+1]+a.y,u.z=t[M+2]+a.z;var H=e.magnitude(e.subtract(u,W,R));H>X&&(X=H);var Y=e.magnitudeSquared(e.subtract(u,z,R));if(Y>B){var k=Math.sqrt(Y);G=.5*(G+k),B=G*G;var j=k-G;z.x=(G*z.x+j*u.x)/k,z.y=(G*z.y+j*u.y)/k,z.z=(G*z.z+j*u.z)/k}}return G<X?(e.clone(z,o.center),o.radius=G):(e.clone(W,o.center),o.radius=X),o},d.fromEncodedCartesianVertices=function(t,r,a){if(n(a)||(a=new d),!n(t)||!n(r)||t.length!==r.length||0===t.length)return a.center=e.clone(e.ZERO,a.center),a.radius=0,a;var i=T;i.x=t[0]+r[0],i.y=t[1]+r[1],i.z=t[2]+r[2];for(var o=e.clone(i,h),u=e.clone(i,E),s=e.clone(i,m),c=e.clone(i,p),l=e.clone(i,y),f=e.clone(i,_),I=t.length,g=0;g<I;g+=3){var O=t[g]+r[g],M=t[g+1]+r[g+1],w=t[g+2]+r[g+2];i.x=O,i.y=M,i.z=w,O<o.x&&e.clone(i,o),O>c.x&&e.clone(i,c),M<u.y&&e.clone(i,u),M>l.y&&e.clone(i,l),w<s.z&&e.clone(i,s),w>f.z&&e.clone(i,f)}var x=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=e.magnitudeSquared(e.subtract(f,s,R)),D=o,L=c,U=x;C>U&&(U=C,D=u,L=l),P>U&&(U=P,D=s,L=f);var b=v;b.x=.5*(D.x+L.x),b.y=.5*(D.y+L.y),b.z=.5*(D.z+L.z);var F=e.magnitudeSquared(e.subtract(L,b,R)),z=Math.sqrt(F),B=A;B.x=o.x,B.y=u.y,B.z=s.z;var G=S;G.x=c.x,G.y=l.y,G.z=f.z;var q=e.multiplyByScalar(e.add(B,G,R),.5,N),V=0;for(g=0;g<I;g+=3){i.x=t[g]+r[g],i.y=t[g+1]+r[g+1],i.z=t[g+2]+r[g+2];var W=e.magnitude(e.subtract(i,q,R));W>V&&(V=W);var X=e.magnitudeSquared(e.subtract(i,b,R));if(X>F){var H=Math.sqrt(X);z=.5*(z+H),F=z*z;var Y=H-z;b.x=(z*b.x+Y*i.x)/H,b.y=(z*b.y+Y*i.y)/H,b.z=(z*b.z+Y*i.z)/H}}return z<V?(e.clone(b,a.center),a.radius=z):(e.clone(q,a.center),a.radius=V),a},d.fromCornerPoints=function(t,r,a){n(a)||(a=new d);var i=a.center;return e.add(t,r,i),e.multiplyByScalar(i,.5,i),a.radius=e.distance(i,r),a},d.fromEllipsoid=function(t,r){return n(r)||(r=new d),e.clone(e.ZERO,r.center),r.radius=t.maximumRadius,r};var C=new e;d.fromBoundingSpheres=function(t,r){if(n(r)||(r=new d),!n(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var a=t.length;if(1===a)return d.clone(t[0],r);if(2===a)return d.union(t[0],t[1],r);for(var i=[],o=0;o<a;o++)i.push(t[o].center);r=d.fromPoints(i,r);var u=r.center,s=r.radius;for(o=0;o<a;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,C)+c.radius)}return r.radius=s,r};var P=new e,D=new e,L=new e;d.fromOrientedBoundingBox=function(t,r){n(r)||(r=new d);var a=t.halfAxes,i=c.getColumn(a,0,P),o=c.getColumn(a,1,D),u=c.getColumn(a,2,L),s=e.magnitude(i),l=e.magnitude(o),f=e.magnitude(u);return r.center=e.clone(t.center,r.center),r.radius=Math.max(s,l,f),r},d.clone=function(t,r){if(n(t))return n(r)?(r.center=e.clone(t.center,r.center),r.radius=t.radius,r):new d(t.center,t.radius)},d.packedLength=4,d.pack=function(e,t,n){n=r(n,0);var a=e.center;return t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n]=e.radius,t},d.unpack=function(e,t,a){t=r(t,0),n(a)||(a=new d);var i=a.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],a.radius=e[t],a};var U=new e,b=new e;d.union=function(t,r,a){n(a)||(a=new d);var i=t.center,o=t.radius,u=r.center,s=r.radius,c=e.subtract(u,i,U),l=e.magnitude(c);if(o>=l+s)return t.clone(a),a;if(s>=l+o)return r.clone(a),a;var f=.5*(o+l+s),h=e.multiplyByScalar(c,(-o+f)/l,b);return e.add(h,i,h),e.clone(h,a.center),a.radius=f,a};var F=new e;d.expand=function(t,r,n){n=d.clone(t,n);var a=e.magnitude(e.subtract(r,n.center,F));return a>n.radius&&(n.radius=a),n},d.intersectPlane=function(t,r){var n=t.center,a=t.radius,i=r.normal,o=e.dot(i,n)+r.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},d.transform=function(e,t,r){return n(r)||(r=new d),r.center=l.multiplyByPoint(t,e.center,r.center),r.radius=l.getMaximumScale(t)*e.radius,r};var z=new e;d.distanceSquaredTo=function(t,r){var n=e.subtract(t.center,r,z);return e.magnitudeSquared(n)-t.radius*t.radius},d.transformWithoutScale=function(e,t,r){return n(r)||(r=new d),r.center=l.multiplyByPoint(t,e.center,r.center),r.radius=e.radius,r};var B=new e;d.computePlaneDistances=function(t,r,a,i){n(i)||(i=new s);var o=e.subtract(t.center,r,B),u=e.dot(a,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var G=new e,q=new e,V=new e,W=new e,X=new e,H=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var j=new o;return d.projectTo2D=function(t,n,a){n=r(n,j);var i=n.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,G),c=e.cross(e.UNIT_Z,s,q);e.normalize(c,c);var l=e.cross(s,c,V);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var f=e.negate(l,X),h=e.negate(c,W),E=Y,m=E[0];e.add(s,l,m),e.add(m,c,m),m=E[1],e.add(s,l,m),e.add(m,h,m),m=E[2],e.add(s,f,m),e.add(m,h,m),m=E[3],e.add(s,f,m),e.add(m,c,m),e.negate(s,s),m=E[4],e.add(s,l,m),e.add(m,c,m),m=E[5],e.add(s,l,m),e.add(m,h,m),m=E[6],e.add(s,f,m),e.add(m,h,m),m=E[7],e.add(s,f,m),e.add(m,c,m);for(var p=E.length,y=0;y<p;++y){var _=E[y];e.add(o,_,_);var T=i.cartesianToCartographic(_,H);n.project(T,_)}a=d.fromPoints(E,a),o=a.center;var R=o.x,v=o.y,A=o.z;return o.x=A,o.y=R,o.z=v,a},d.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},d.equals=function(t,r){return t===r||n(t)&&n(r)&&e.equals(t.center,r.center)&&t.radius===r.radius},d.prototype.intersectPlane=function(e){return d.intersectPlane(this,e)},d.prototype.distanceSquaredTo=function(e){return d.distanceSquaredTo(this,e)},d.prototype.computePlaneDistances=function(e,t,r){return d.computePlaneDistances(this,e,t,r)},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/Cartesian2",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a){"use strict";function i(t,r){this.x=e(t,0),this.y=e(r,0)}i.fromElements=function(e,r,n){return t(n)?(n.x=e,n.y=r,n):new i(e,r)},i.clone=function(e,r){if(t(e))return t(r)?(r.x=e.x,r.y=e.y,r):new i(e.x,e.y)},i.fromCartesian3=i.clone,i.fromCartesian4=i.clone,i.packedLength=2,i.pack=function(t,r,n){return n=e(n,0),r[n++]=t.x,r[n]=t.y,r},i.unpack=function(r,n,a){return n=e(n,0),t(a)||(a=new i),a.x=r[n++],a.y=r[n],a},i.packArray=function(e,r){var n=e.length;t(r)?r.length=2*n:r=new Array(2*n);for(var a=0;a<n;++a)i.pack(e[a],r,2*a);return r},i.unpackArray=function(e,r){var n=e.length;t(r)?r.length=n/2:r=new Array(n/2);for(var a=0;a<n;a+=2){var o=a/2;r[o]=i.unpack(e,a,r[o])}return r},i.fromArray=i.unpack,i.maximumComponent=function(e){return Math.max(e.x,e.y)},i.minimumComponent=function(e){return Math.min(e.x,e.y)},i.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r},i.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r},i.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},i.magnitude=function(e){return Math.sqrt(i.magnitudeSquared(e))};var o=new i;i.distance=function(e,t){return i.subtract(e,t,o),i.magnitude(o)},i.distanceSquared=function(e,t){return i.subtract(e,t,o),i.magnitudeSquared(o)},i.normalize=function(e,t){var r=i.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t},i.dot=function(e,t){return e.x*t.x+e.y*t.y},i.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r},i.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r},i.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r},i.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r},i.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r},i.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r},i.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},i.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var u=new i;i.lerp=function(e,t,r,n){return i.multiplyByScalar(t,r,u),n=i.multiplyByScalar(e,1-r,n),i.add(u,n,n)};var s=new i,c=new i;i.angleBetween=function(e,t){return i.normalize(e,s),i.normalize(t,c),a.acosClamped(i.dot(s,c))};var l=new i;return i.mostOrthogonalAxis=function(e,t){var r=i.normalize(e,l);return i.abs(r,r),t=r.x<=r.y?i.clone(i.UNIT_X,t):i.clone(i.UNIT_Y,t)},i.equals=function(e,r){return e===r||t(e)&&t(r)&&e.x===r.x&&e.y===r.y},i.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]},i.equalsEpsilon=function(e,r,n,i){return e===r||t(e)&&t(r)&&a.equalsEpsilon(e.x,r.x,n,i)&&a.equalsEpsilon(e.y,r.y,n,i)},i.ZERO=n(new i(0,0)),i.UNIT_X=n(new i(1,0)),i.UNIT_Y=n(new i(0,1)),i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i.prototype.equalsEpsilon=function(e,t,r){return i.equalsEpsilon(this,e,t,r)},i.prototype.toString=function(){return"("+this.x+", "+this.y+")"},i}),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},a={};return t(a,{element:{get:function(){if(a.supportsFullscreen())return document[n.fullscreenElement]}},changeEventName:{get:function(){if(a.supportsFullscreen())return n.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return n.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[n.fullscreenEnabled]; -}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.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 a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(n.requestFullscreen=a,r=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(n.requestFullscreen=a,r=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?n.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(n.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?n.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(n.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?n.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(n.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),n.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),n.fullscreenerror=a)}return r},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[n.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[n.exitFullscreen]()},a}),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;r<n;++r)t[r]=parseInt(t[r],10);return t}function a(){if(!t(v)&&(v=!1,!d())){var e=/ Chrome\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(v=!0,A=n(e[1]))}return v}function i(){return a()&&A}function o(){if(!t(S)&&(S=!1,!a()&&!d()&&/ Safari\/[\.0-9]+/.test(R.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(S=!0,N=n(e[1]))}return S}function u(){return o()&&N}function s(){if(!t(I)){I=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(R.userAgent);null!==e&&(I=!0,g=n(e[1]),g.isNightly=!!e[2])}return I}function c(){return s()&&g}function l(){if(!t(O)){O=!1;var e;"Microsoft Internet Explorer"===R.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(O=!0,M=n(e[1]))):"Netscape"===R.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(O=!0,M=n(e[1])))}return O}function f(){return l()&&M}function d(){if(!t(w)){w=!1;var e=/ Edge\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(w=!0,x=n(e[1]))}return w}function h(){return d()&&x}function E(){if(!t(C)){C=!1;var e=/Firefox\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(C=!0,P=n(e[1]))}return C}function m(){return t(D)||(D=/Windows/i.test(R.appVersion)),D}function p(){return E()&&P}function y(){return t(L)||(L="undefined"!=typeof PointerEvent&&(!t(R.pointerEnabled)||R.pointerEnabled)),L}function _(){if(!t(b)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var r=e.style.imageRendering;b=t(r)&&""!==r,b&&(U=r)}return b}function T(){return _()?U:void 0}var R;R="undefined"!=typeof navigator?navigator:{};var v,A,S,N,I,g,O,M,w,x,C,P,D,L,U,b,F={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isEdge:d,edgeVersion:h,isFirefox:E,firefoxVersion:p,isWindows:m,hardwareConcurrency:e(R.hardwareConcurrency,3),supportsPointerEvents:y,supportsImageRenderingPixelated:_,imageRenderingValue:T};return F.supportsFullscreen=function(){return r.supportsFullscreen()},F.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},F.supportsWebWorkers=function(){return"undefined"!=typeof Worker},F}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,r,n,a,i){"use strict";if(!n.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){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.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},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 Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,r,n,a){switch(n=e(n,0),a=e(a,(r.byteLength-n)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(r,n,a);case o.UNSIGNED_BYTE:return new Uint8Array(r,n,a);case o.SHORT:return new Int16Array(r,n,a);case o.UNSIGNED_SHORT:return new Uint16Array(r,n,a);case o.INT:return new Int32Array(r,n,a);case o.UNSIGNED_INT:return new Uint32Array(r,n,a);case o.FLOAT:return new Float32Array(r,n,a);case o.DOUBLE:return new Float64Array(r,n,a)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/Quaternion",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math","./Matrix3"],function(e,t,r,n,a,i,o,u){"use strict";function s(e,r,n,a){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0),this.w=t(a,0)}var c=new e;s.fromAxisAngle=function(t,n,a){var i=n/2,o=Math.sin(i);c=e.normalize(t,c);var u=c.x*o,l=c.y*o,f=c.z*o,d=Math.cos(i);return r(a)?(a.x=u,a.y=l,a.z=f,a.w=d,a):new s(u,l,f,d)};var l=[1,2,0],f=new Array(3);s.fromRotationMatrix=function(e,t){var n,a,i,o,c,d=e[u.COLUMN0ROW0],h=e[u.COLUMN1ROW1],E=e[u.COLUMN2ROW2],m=d+h+E;if(m>0)n=Math.sqrt(m+1),c=.5*n,n=.5/n,a=(e[u.COLUMN1ROW2]-e[u.COLUMN2ROW1])*n,i=(e[u.COLUMN2ROW0]-e[u.COLUMN0ROW2])*n,o=(e[u.COLUMN0ROW1]-e[u.COLUMN1ROW0])*n;else{var p=l,y=0;h>d&&(y=1),E>d&&E>h&&(y=2);var _=p[y],T=p[_];n=Math.sqrt(e[u.getElementIndex(y,y)]-e[u.getElementIndex(_,_)]-e[u.getElementIndex(T,T)]+1);var R=f;R[y]=.5*n,n=.5/n,c=(e[u.getElementIndex(T,_)]-e[u.getElementIndex(_,T)])*n,R[_]=(e[u.getElementIndex(_,y)]+e[u.getElementIndex(y,_)])*n,R[T]=(e[u.getElementIndex(T,y)]+e[u.getElementIndex(y,T)])*n,a=-R[0],i=-R[1],o=-R[2]}return r(t)?(t.x=a,t.y=i,t.z=o,t.w=c,t):new s(a,i,o,c)};var d=new s;s.fromHeadingPitchRoll=function(t,r,n,a){var i=s.fromAxisAngle(e.UNIT_X,n,d),o=s.fromAxisAngle(e.UNIT_Y,-r,a);a=s.multiply(o,i,o);var u=s.fromAxisAngle(e.UNIT_Z,-t,d);return s.multiply(u,a,a)};var h=new e,E=new e,m=new s,p=new s,y=new s;s.packedLength=4,s.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n++]=e.z,r[n]=e.w,r},s.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new s),a.x=e[n],a.y=e[n+1],a.z=e[n+2],a.w=e[n+3],a},s.packedInterpolationLength=3,s.convertPackedArrayForInterpolation=function(e,t,r,n){s.unpack(e,4*r,y),s.conjugate(y,y);for(var a=0,i=r-t+1;a<i;a++){var o=3*a;s.unpack(e,4*(t+a),m),s.multiply(m,y,m),m.w<0&&s.negate(m,m),s.computeAxis(m,h);var u=s.computeAngle(m);n[o]=h.x*u,n[o+1]=h.y*u,n[o+2]=h.z*u}},s.unpackInterpolationResult=function(t,n,a,i,o){r(o)||(o=new s),e.fromArray(t,0,E);var u=e.magnitude(E);return s.unpack(n,4*i,p),0===u?s.clone(s.IDENTITY,m):s.fromAxisAngle(E,u,m),s.multiply(m,p,o)},s.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new s(e.x,e.y,e.z,e.w)},s.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},s.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},s.magnitude=function(e){return Math.sqrt(s.magnitudeSquared(e))},s.normalize=function(e,t){var r=1/s.magnitude(e),n=e.x*r,a=e.y*r,i=e.z*r,o=e.w*r;return t.x=n,t.y=a,t.z=i,t.w=o,t},s.inverse=function(e,t){var r=s.magnitudeSquared(e);return t=s.conjugate(e,t),s.multiplyByScalar(t,1/r,t)},s.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},s.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},s.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},s.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},s.multiply=function(e,t,r){var n=e.x,a=e.y,i=e.z,o=e.w,u=t.x,s=t.y,c=t.z,l=t.w,f=o*u+n*l+a*c-i*s,d=o*s-n*c+a*l+i*u,h=o*c+n*s-a*u+i*l,E=o*l-n*u-a*s-i*c;return r.x=f,r.y=d,r.z=h,r.w=E,r},s.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},s.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},s.computeAxis=function(e,t){var r=e.w;if(Math.abs(r-1)<o.EPSILON6)return t.x=t.y=t.z=0,t;var n=1/Math.sqrt(1-r*r);return t.x=e.x*n,t.y=e.y*n,t.z=e.z*n,t},s.computeAngle=function(e){return Math.abs(e.w-1)<o.EPSILON6?0:2*Math.acos(e.w)};var _=new s;s.lerp=function(e,t,r,n){return _=s.multiplyByScalar(t,r,_),n=s.multiplyByScalar(e,1-r,n),s.add(_,n,n)};var T=new s,R=new s,v=new s;s.slerp=function(e,t,r,n){var a=s.dot(e,t),i=t;if(a<0&&(a=-a,i=T=s.negate(t,T)),1-a<o.EPSILON6)return s.lerp(e,i,r,n);var u=Math.acos(a);return R=s.multiplyByScalar(e,Math.sin((1-r)*u),R),v=s.multiplyByScalar(i,Math.sin(r*u),v),n=s.add(R,v,n),s.multiplyByScalar(n,1/Math.sin(u),n)},s.log=function(t,r){var n=o.acosClamped(t.w),a=0;return 0!==n&&(a=n/Math.sin(n)),e.multiplyByScalar(t,a,r)},s.exp=function(t,r){var n=e.magnitude(t),a=0;return 0!==n&&(a=Math.sin(n)/n),r.x=t.x*a,r.y=t.y*a,r.z=t.z*a,r.w=Math.cos(n),r};var A=new e,S=new e,N=new s,I=new s;s.computeInnerQuadrangle=function(t,r,n,a){var i=s.conjugate(r,N);s.multiply(i,n,I);var o=s.log(I,A);s.multiply(i,t,I);var u=s.log(I,S);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),s.exp(o,N),s.multiply(r,N,a)},s.squad=function(e,t,r,n,a,i){var o=s.slerp(e,t,a,N),u=s.slerp(r,n,a,I);return s.slerp(o,u,2*a*(1-a),i)};for(var g=new s,O=1.9011074535173003,M=a.supportsTypedArrays()?new Float32Array(8):[],w=a.supportsTypedArrays()?new Float32Array(8):[],x=a.supportsTypedArrays()?new Float32Array(8):[],C=a.supportsTypedArrays()?new Float32Array(8):[],P=0;P<7;++P){var D=P+1,L=2*D+1;M[P]=1/(D*L),w[P]=D/L}return M[7]=O/136,w[7]=8*O/17,s.fastSlerp=function(e,t,r,n){var a,i=s.dot(e,t);i>=0?a=1:(a=-1,i=-i);for(var o=i-1,u=1-r,c=r*r,l=u*u,f=7;f>=0;--f)x[f]=(M[f]*c-w[f])*o,C[f]=(M[f]*l-w[f])*o;var d=a*r*(1+x[0]*(1+x[1]*(1+x[2]*(1+x[3]*(1+x[4]*(1+x[5]*(1+x[6]*(1+x[7])))))))),h=u*(1+C[0]*(1+C[1]*(1+C[2]*(1+C[3]*(1+C[4]*(1+C[5]*(1+C[6]*(1+C[7])))))))),E=s.multiplyByScalar(e,h,g);return s.multiplyByScalar(t,d,n),s.add(E,n,n)},s.fastSquad=function(e,t,r,n,a,i){var o=s.fastSlerp(e,t,a,N),u=s.fastSlerp(r,n,a,I);return s.fastSlerp(o,u,2*a*(1-a),i)},s.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},s.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n},s.ZERO=i(new s(0,0,0,0)),s.IDENTITY=i(new s(0,0,0,1)),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.x+", "+this.y+", "+this.z+", "+this.w+")"},s}),define("Core/EllipseGeometryLibrary",["./Cartesian3","./Math","./Matrix3","./Quaternion"],function(e,t,r,n){"use strict";function a(t,a,i,l,f,d,h,E,m,p){var y=t+a;e.multiplyByScalar(l,Math.cos(y),o),e.multiplyByScalar(i,Math.sin(y),u),e.add(o,u,o);var _=Math.cos(t);_*=_;var T=Math.sin(t);T*=T;var R=d/Math.sqrt(h*_+f*T),v=R/E;return n.fromAxisAngle(o,v,s),r.fromQuaternion(s,c),r.multiplyByVector(c,m,p),e.normalize(p,p),e.multiplyByScalar(p,E,p),p}var i={},o=new e,u=new e,s=new n,c=new r,l=new e,f=new e,d=new e,h=new e;i.raisePositionsToHeight=function(t,r,n){for(var a=r.ellipsoid,i=r.height,o=r.extrudedHeight,u=n?t.length/3*2:t.length/3,s=new Float64Array(3*u),c=t.length,E=n?c:0,m=0;m<c;m+=3){var p=m+1,y=m+2,_=e.fromArray(t,m,l);a.scaleToGeodeticSurface(_,_);var T=e.clone(_,f),R=a.geodeticSurfaceNormal(_,h),v=e.multiplyByScalar(R,i,d);e.add(_,v,_),n&&(e.multiplyByScalar(R,o,v),e.add(T,v,T),s[m+E]=T.x,s[p+E]=T.y,s[y+E]=T.z),s[m]=_.x,s[p]=_.y,s[y]=_.z}return s};var E=new e,m=new e,p=new e;return i.computeEllipsePositions=function(r,n,i){var o=r.semiMinorAxis,u=r.semiMajorAxis,s=r.rotation,c=r.center,h=8*r.granularity,y=o*o,_=u*u,T=u*o,R=e.magnitude(c),v=e.normalize(c,E),A=e.cross(e.UNIT_Z,c,m);A=e.normalize(A,A);var S=e.cross(v,A,p),N=1+Math.ceil(t.PI_OVER_TWO/h),I=t.PI_OVER_TWO/(N-1),g=t.PI_OVER_TWO-N*I;g<0&&(N-=Math.ceil(Math.abs(g)/I));var O,M,w,x,C,P=2*(N*(N+2)),D=n?new Array(3*P):void 0,L=0,U=l,b=f,F=4*N*3,z=F-1,B=0,G=i?new Array(F):void 0;for(g=t.PI_OVER_TWO,U=a(g,s,S,A,y,T,_,R,v,U),n&&(D[L++]=U.x,D[L++]=U.y,D[L++]=U.z),i&&(G[z--]=U.z,G[z--]=U.y,G[z--]=U.x),g=t.PI_OVER_TWO-I,O=1;O<N+1;++O){if(U=a(g,s,S,A,y,T,_,R,v,U),b=a(Math.PI-g,s,S,A,y,T,_,R,v,b),n){for(D[L++]=U.x,D[L++]=U.y,D[L++]=U.z,w=2*O+2,M=1;M<w-1;++M)x=M/(w-1),C=e.lerp(U,b,x,d),D[L++]=C.x,D[L++]=C.y,D[L++]=C.z;D[L++]=b.x,D[L++]=b.y,D[L++]=b.z}i&&(G[z--]=U.z,G[z--]=U.y,G[z--]=U.x,G[B++]=b.x,G[B++]=b.y,G[B++]=b.z),g=t.PI_OVER_TWO-(O+1)*I}for(O=N;O>1;--O){if(g=t.PI_OVER_TWO-(O-1)*I,U=a(-g,s,S,A,y,T,_,R,v,U),b=a(g+Math.PI,s,S,A,y,T,_,R,v,b),n){for(D[L++]=U.x,D[L++]=U.y,D[L++]=U.z,w=2*(O-1)+2,M=1;M<w-1;++M)x=M/(w-1),C=e.lerp(U,b,x,d),D[L++]=C.x,D[L++]=C.y,D[L++]=C.z;D[L++]=b.x,D[L++]=b.y,D[L++]=b.z}i&&(G[z--]=U.z,G[z--]=U.y,G[z--]=U.x,G[B++]=b.x,G[B++]=b.y,G[B++]=b.z)}g=t.PI_OVER_TWO,U=a(-g,s,S,A,y,T,_,R,v,U);var q={};return n&&(D[L++]=U.x,D[L++]=U.y,D[L++]=U.z,q.positions=D,q.numPts=N),i&&(G[z--]=U.z,G[z--]=U.y,G[z--]=U.x,q.outerPositions=G),q},i}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var r={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,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,t,r,n,a){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,a.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,n.NONE),this.boundingSphereCV=t.boundingSphereCV}return i.computeNumberOfVertices=function(e){var r=-1;for(var n in e.attributes)if(e.attributes.hasOwnProperty(n)&&t(e.attributes[n])&&t(e.attributes[n].values)){var a=e.attributes[n],i=a.values.length/a.componentsPerAttribute;r=i}return r},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(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 n}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.binormal=t.binormal,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/GeometryInstance",["./defaultValue","./defined","./DeveloperError","./Matrix4"],function(e,t,r,n){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.geometry=t.geometry,this.modelMatrix=n.clone(e(t.modelMatrix,n.IDENTITY)),this.id=t.id,this.pickPrimitive=t.pickPrimitive,this.attributes=e(t.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}return a}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,r,n,a){"use strict";var i={};i.octEncodeInRange=function(e,t,r){if(r.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),r.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var n=r.x,i=r.y;r.x=(1-Math.abs(i))*a.signNotZero(n),r.y=(1-Math.abs(n))*a.signNotZero(i)}return r.x=a.toSNorm(r.x,t),r.y=a.toSNorm(r.y,t),r},i.octEncode=function(e,t){return i.octEncodeInRange(e,255,t)},i.octDecodeInRange=function(e,r,n,i){if(i.x=a.fromSNorm(e,n),i.y=a.fromSNorm(r,n),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){var o=i.x;i.x=(1-Math.abs(i.y))*a.signNotZero(o),i.y=(1-Math.abs(o))*a.signNotZero(i.y)}return t.normalize(i,i)},i.octDecode=function(e,t,r){return i.octDecodeInRange(e,t,255,r)},i.octPackFloat=function(e){return 256*e.x+e.y};var o=new e;return i.octEncodeFloat=function(e){return i.octEncode(e,o),i.octPackFloat(o)},i.octDecodeFloat=function(e,t){var r=e/256,n=Math.floor(r),a=256*(r-n);return i.octDecode(n,a,t)},i.octPack=function(e,t,r,n){var a=i.octEncodeFloat(e),u=i.octEncodeFloat(t),s=i.octEncode(r,o);return n.x=65536*s.x+a,n.y=65536*s.y+u,n},i.octUnpack=function(e,t,r,n){var a=e.x/65536,o=Math.floor(a),u=65536*(a-o);a=e.y/65536;var s=Math.floor(a),c=65536*(a-s);i.octDecodeFloat(u,t),i.octDecodeFloat(c,r),i.octDecode(o,s,n)},i.compressTextureCoordinates=function(e){var t=4095*e.x|0,r=4095*e.y|0;return 4096*t+r},i.decompressTextureCoordinates=function(e,t){var r=e/4096,n=Math.floor(r);return t.x=n/4095,t.y=(e-4096*n)/4095,t},i}),define("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function a(n,a,s,c,l){r(l)||(l=new t);var f,d,h,E,m,p,y,_;r(a.z)?(f=t.subtract(s,a,i),d=t.subtract(c,a,o),h=t.subtract(n,a,u),E=t.dot(f,f),m=t.dot(f,d),p=t.dot(f,h),y=t.dot(d,d),_=t.dot(d,h)):(f=e.subtract(s,a,i),d=e.subtract(c,a,o),h=e.subtract(n,a,u),E=e.dot(f,f),m=e.dot(f,d),p=e.dot(f,h),y=e.dot(d,d),_=e.dot(d,h));var T=1/(E*y-m*m);return l.y=(y*p-m*_)*T,l.z=(E*_-m*p)*T,l.x=1-l.y-l.z,l}var i=new t,o=new t,u=new t; -return a}),define("Core/EncodedCartesian3",["./Cartesian3","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(){this.high=e.clone(e.ZERO),this.low=e.clone(e.ZERO)}n.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 a={high:0,low:0};n.fromCartesian=function(e,r){t(r)||(r=new n);var i=r.high,o=r.low;return n.encode(e.x,a),i.x=a.high,o.x=a.low,n.encode(e.y,a),i.y=a.high,o.y=a.low,n.encode(e.z,a),i.z=a.high,o.z=a.low,r};var i=new n;return n.writeElements=function(e,t,r){n.fromCartesian(e,i);var a=i.high,o=i.low;t[r]=a.x,t[r+1]=a.y,t[r+2]=a.z,t[r+3]=o.x,t[r+4]=o.y,t[r+5]=o.z},n}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,r,n,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(e){switch(e){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(t){return e(t)&&(t===i.UNSIGNED_BYTE||t===i.UNSIGNED_SHORT||t===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,r,a){return e>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,r,a):new Uint16Array(t,r,a)},r(i)}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function r(e,r,n){var a=e+r;return t.sign(e)!==t.sign(r)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(r)))<n?0:a}var n={};return n.computeDiscriminant=function(e,t,r){var n=t*t-4*e*r;return n},n.computeRealRoots=function(e,n,a){var i;if(0===e)return 0===n?[]:[-a/n];if(0===n){if(0===a)return[0,0];var o=Math.abs(a),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,i<0)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-n/e,i<0?[i,0]:[0,i];var c=n*n,l=4*e*a,f=r(c,-l,t.EPSILON14);if(f<0)return[];var d=-.5*r(n,t.sign(n)*Math.sqrt(f),t.EPSILON14);return n>0?[d/e,a/d]:[a/d,d/e]},n}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function r(e,t,r,n){var a,i,o=e,u=t/3,s=r/3,c=n,l=o*s,f=u*c,d=u*u,h=s*s,E=o*s-d,m=o*c-u*s,p=u*c-h,y=4*E*p-m*m;if(y<0){var _,T,R;d*f>=l*h?(_=o,T=E,R=-2*u*E+o*m):(_=c,T=p,R=-c*m+2*s*p);var v=R<0?-1:1,A=-v*Math.abs(_)*Math.sqrt(-y);i=-R+A;var S=i/2,N=S<0?-Math.pow(-S,1/3):Math.pow(S,1/3),I=i===A?-N:-T/N;return a=T<=0?N+I:-R/(N*N+I*I+T),d*f>=l*h?[(a-u)/o]:[-c/(a+s)]}var g=E,O=-2*u*E+o*m,M=p,w=-c*m+2*s*p,x=Math.sqrt(y),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*x,-O)/3);a=2*Math.sqrt(-g);var D=Math.cos(P);i=a*D;var L=a*(-D/2-C*Math.sin(P)),U=i+L>2*u?i-u:L-u,b=o,F=U/b;P=Math.abs(Math.atan2(c*x,-w)/3),a=2*Math.sqrt(-M),D=Math.cos(P),i=a*D,L=a*(-D/2-C*Math.sin(P));var z=-c,B=i+L<2*s?i+s:L+s,G=z/B,q=b*B,V=-U*B-b*z,W=U*z,X=(s*V-u*W)/(-u*V+s*q);return F<=X?F<=G?X<=G?[F,X,G]:[F,G,X]:[G,F,X]:F<=G?[X,F,G]:X<=G?[X,G,F]:[G,X,F]}var n={};return n.computeDiscriminant=function(e,t,r,n){var a=e*e,i=t*t,o=r*r,u=n*n,s=18*e*t*r*n+i*o-27*a*u-4*(e*o*r+i*t*n);return s},n.computeRealRoots=function(e,n,a,i){var o,u;if(0===e)return t.computeRealRoots(n,a,i);if(0===n){if(0===a){if(0===i)return[0,0,0];u=-i/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===i?(o=t.computeRealRoots(e,0,a),0===o.Length?[0]:[o[0],0,o[1]]):r(e,0,a,i)}return 0===a?0===i?(u=-n/e,u<0?[u,0,0]:[0,0,u]):r(e,n,0,i):0===i?(o=t.computeRealRoots(e,n,a),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):r(e,n,a,i)},n}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,r,n){"use strict";function a(t,a,i,o){var u=t*t,s=a-3*u/8,c=i-a*t/2+u*t/8,l=o-i*t/4+a*u/16-3*u*u/256,f=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(f.length>0){var d=-t/4,h=f[f.length-1];if(Math.abs(h)<r.EPSILON14){var E=n.computeRealRoots(1,s,l);if(2===E.length){var m,p=E[0],y=E[1];if(p>=0&&y>=0){var _=Math.sqrt(p),T=Math.sqrt(y);return[d-T,d-_,d+_,d+T]}if(p>=0&&y<0)return m=Math.sqrt(p),[d-m,d+m];if(p<0&&y>=0)return m=Math.sqrt(y),[d-m,d+m]}return[]}if(h>0){var R=Math.sqrt(h),v=(s+h-c/R)/2,A=(s+h+c/R)/2,S=n.computeRealRoots(1,R,v),N=n.computeRealRoots(1,-R,A);return 0!==S.length?(S[0]+=d,S[1]+=d,0!==N.length?(N[0]+=d,N[1]+=d,S[1]<=N[0]?[S[0],S[1],N[0],N[1]]:N[1]<=S[0]?[N[0],N[1],S[0],S[1]]:S[0]>=N[0]&&S[1]<=N[1]?[N[0],S[0],S[1],N[1]]:N[0]>=S[0]&&N[1]<=S[1]?[S[0],N[0],N[1],S[1]]:S[0]>N[0]&&S[0]<N[1]?[N[0],S[0],N[1],S[1]]:[S[0],N[0],S[1],N[1]]):S):0!==N.length?(N[0]+=d,N[1]+=d,N):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,f=i*t+s-4*o,d=c*o-i*a*t+u,h=e.computeRealRoots(1,l,f,d);if(h.length>0){var E,m,p=h[0],y=a-p,_=y*y,T=t/2,R=y/2,v=_-4*o,A=_+4*Math.abs(o),S=c-4*p,N=c+4*Math.abs(p);if(p<0||v*N<S*A){var I=Math.sqrt(S);E=I/2,m=0===I?0:(t*R-i)/I}else{var g=Math.sqrt(v);E=0===g?0:(t*R-i)/g,m=g/2}var O,M;0===T&&0===E?(O=0,M=0):r.sign(T)===r.sign(E)?(O=T+E,M=p/O):(M=T-E,O=p/M);var w,x;0===R&&0===m?(w=0,x=0):r.sign(R)===r.sign(m)?(w=R+m,x=o/w):(x=R-m,w=o/x);var C=n.computeRealRoots(1,O,w),P=n.computeRealRoots(1,M,x);if(0!==C.length)return 0!==P.length?C[1]<=P[0]?[C[0],C[1],P[0],P[1]]:P[1]<=C[0]?[P[0],P[1],C[0],C[1]]:C[0]>=P[0]&&C[1]<=P[1]?[P[0],C[0],C[1],P[1]]:P[0]>=C[0]&&P[1]<=C[1]?[C[0],P[0],P[1],C[1]]:C[0]>P[0]&&C[0]<P[1]?[P[0],C[0],P[1],C[1]]:[C[0],P[0],C[1],P[1]]:C;if(0!==P.length)return P}return[]}var o={};return o.computeDiscriminant=function(e,t,r,n,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=r*r,l=c*r,f=n*n,d=f*n,h=a*a,E=h*a,m=u*c*f-4*s*d-4*e*l*f+18*e*t*r*d-27*i*f*f+256*o*E+a*(18*s*r*n-4*u*l+16*e*c*c-80*e*t*c*n-6*e*u*f+144*i*r*f)+h*(144*e*u*r-27*u*u-128*i*c-192*i*t*n);return m},o.computeRealRoots=function(t,n,o,u,s){if(Math.abs(t)<r.EPSILON15)return e.computeRealRoots(n,o,u,s);var c=n/t,l=o/t,f=u/t,d=s/t,h=c<0?1:0;switch(h+=l<0?h+1:h,h+=f<0?h+1:h,h+=d<0?h+1:h){case 0:return a(c,l,f,d);case 1:return i(c,l,f,d);case 2:return i(c,l,f,d);case 3:return a(c,l,f,d);case 4:return a(c,l,f,d);case 5:return i(c,l,f,d);case 6:return a(c,l,f,d);case 7:return a(c,l,f,d);case 8:return i(c,l,f,d);case 9:return a(c,l,f,d);case 10:return a(c,l,f,d);case 11:return i(c,l,f,d);case 12:return a(c,l,f,d);case 13:return a(c,l,f,d);case 14:return a(c,l,f,d);case 15:return a(c,l,f,d);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function a(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 a.getPoint=function(t,n,a){return r(a)||(a=new e),a=e.multiplyByScalar(t.direction,n,a),e.add(t.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,r,n,a,i,o,u,s,c){"use strict";function l(e,t,r,n){var a=t*t-4*e*r;if(!(a<0)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return u<s?(n.root0=u,n.root1=s):(n.root0=s,n.root1=u),n}var c=-t/(2*e);if(0!==c)return n.root0=n.root1=c,n}}function f(t,r,a){n(a)||(a={});var i=t.origin,o=t.direction,u=r.center,s=r.radius*r.radius,c=e.subtract(i,u,y),f=e.dot(o,o),d=2*e.dot(o,c),h=e.magnitudeSquared(c)-s,E=l(f,d,h,v);if(n(E))return a.start=E.root0,a.stop=E.root1,a}function d(e,t,r){var n=e+t;return i.sign(e)!==i.sign(t)&&Math.abs(n/Math.max(Math.abs(e),Math.abs(t)))<r?0:n}function h(t,r,n,a,c){var l,f=a*a,h=c*c,E=(t[o.COLUMN1ROW1]-t[o.COLUMN2ROW2])*h,m=c*(a*d(t[o.COLUMN1ROW0],t[o.COLUMN0ROW1],i.EPSILON15)+r.y),p=t[o.COLUMN0ROW0]*f+t[o.COLUMN2ROW2]*h+a*r.x+n,y=h*d(t[o.COLUMN2ROW1],t[o.COLUMN1ROW2],i.EPSILON15),_=c*(a*d(t[o.COLUMN2ROW0],t[o.COLUMN0ROW2])+r.z),T=[];if(0===_&&0===y){if(l=u.computeRealRoots(E,m,p),0===l.length)return T;var R=l[0],v=Math.sqrt(Math.max(1-R*R,0));if(T.push(new e(a,c*R,c*-v)),T.push(new e(a,c*R,c*v)),2===l.length){var A=l[1],S=Math.sqrt(Math.max(1-A*A,0));T.push(new e(a,c*A,c*-S)),T.push(new e(a,c*A,c*S))}return T}var N=_*_,I=y*y,g=E*E,O=_*y,M=g+I,w=2*(m*E+O),x=2*p*E+m*m-I+N,C=2*(p*m-O),P=p*p-N;if(0===M&&0===w&&0===x&&0===C)return T;l=s.computeRealRoots(M,w,x,C,P);var D=l.length;if(0===D)return T;for(var L=0;L<D;++L){var U,b=l[L],F=b*b,z=Math.max(1-F,0),B=Math.sqrt(z);U=i.sign(E)===i.sign(p)?d(E*F+p,m*b,i.EPSILON12):i.sign(p)===i.sign(m*b)?d(E*F,m*b+p,i.EPSILON12):d(E*F+m*b,p,i.EPSILON12);var G=d(y*b,_,i.EPSILON15),q=U*G;q<0?T.push(new e(a,c*b,c*B)):q>0?T.push(new e(a,c*b,c*-B)):0!==B?(T.push(new e(a,c*b,c*-B)),T.push(new e(a,c*b,c*B)),++L):T.push(new e(a,c*b,c*B))}return T}var E={};E.rayPlane=function(t,r,a){n(a)||(a=new e);var o=t.origin,u=t.direction,s=r.normal,c=e.dot(s,u);if(!(Math.abs(c)<i.EPSILON15)){var l=(-r.distance-e.dot(s,o))/c;if(!(l<0))return a=e.multiplyByScalar(u,l,a),e.add(o,a,a)}};var m=new e,p=new e,y=new e,_=new e,T=new e;E.rayTriangleParametric=function(t,n,a,o,u){u=r(u,!1);var s,c,l,f,d,h=t.origin,E=t.direction,R=e.subtract(a,n,m),v=e.subtract(o,n,p),A=e.cross(E,v,y),S=e.dot(R,A);if(u){if(S<i.EPSILON6)return;if(s=e.subtract(h,n,_),l=e.dot(s,A),l<0||l>S)return;if(c=e.cross(s,R,T),f=e.dot(E,c),f<0||l+f>S)return;d=e.dot(v,c)/S}else{if(Math.abs(S)<i.EPSILON6)return;var N=1/S;if(s=e.subtract(h,n,_),l=e.dot(s,A)*N,l<0||l>1)return;if(c=e.cross(s,R,T),f=e.dot(E,c)*N,f<0||l+f>1)return;d=e.dot(v,c)*N}return d},E.rayTriangle=function(t,r,a,i,o,u){var s=E.rayTriangleParametric(t,r,a,i,o);if(n(s)&&!(s<0))return n(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var R=new c;E.lineSegmentTriangle=function(t,r,a,i,o,u,s){var c=R;e.clone(t,c.origin),e.subtract(r,t,c.direction),e.normalize(c.direction,c.direction);var l=E.rayTriangleParametric(c,a,i,o,u);if(!(!n(l)||l<0||l>e.distance(t,r)))return n(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var v={root0:0,root1:0};E.raySphere=function(e,t,r){if(r=f(e,t,r),n(r)&&!(r.stop<0))return r.start=Math.max(r.start,0),r};var A=new c;E.lineSegmentSphere=function(t,r,a,i){var o=A;e.clone(t,o.origin);var u=e.subtract(r,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),i=f(o,a,i),!(!n(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var S=new e,N=new e;E.rayEllipsoid=function(t,r){var n,a,i,o,u,s=r.oneOverRadii,c=e.multiplyComponents(s,t.origin,S),l=e.multiplyComponents(s,t.direction,N),f=e.magnitudeSquared(c),d=e.dot(c,l);if(f>1){if(d>=0)return;var h=d*d;if(n=f-1,a=e.magnitudeSquared(l),i=a*n,h<i)return;if(h>i){o=d*d-i,u=-d+Math.sqrt(o);var E=u/a,m=n/u;return E<m?{start:E,stop:m}:{start:m,stop:E}}var p=Math.sqrt(n/a);return{start:p,stop:p}}return f<1?(n=f-1,a=e.magnitudeSquared(l),i=a*n,o=d*d-i,u=-d+Math.sqrt(o),{start:0,stop:u/a}):d<0?(a=e.magnitudeSquared(l),{start:0,stop:-d/a}):void 0};var I=new e,g=new e,O=new e,M=new e,w=new e,x=new o,C=new o,P=new o,D=new o,L=new o,U=new o,b=new o,F=new e,z=new e,B=new t;E.grazingAltitudeLocation=function(t,r){var a=t.origin,u=t.direction;if(!e.equals(a,e.ZERO)){var s=r.geodeticSurfaceNormal(a,I);if(e.dot(u,s)>=0)return a}var c=n(this.rayEllipsoid(t,r)),l=r.transformPositionToScaledSpace(u,I),f=e.normalize(l,l),d=e.mostOrthogonalAxis(l,M),E=e.normalize(e.cross(d,f,g),g),m=e.normalize(e.cross(f,E,O),O),p=x;p[0]=f.x,p[1]=f.y,p[2]=f.z,p[3]=E.x,p[4]=E.y,p[5]=E.z,p[6]=m.x,p[7]=m.y,p[8]=m.z;var y=o.transpose(p,C),_=o.fromScale(r.radii,P),T=o.fromScale(r.oneOverRadii,D),R=L;R[0]=0,R[1]=-u.z,R[2]=u.y,R[3]=u.z,R[4]=0,R[5]=-u.x,R[6]=-u.y,R[7]=u.x,R[8]=0;var v,A,S=o.multiply(o.multiply(y,T,U),R,U),N=o.multiply(o.multiply(S,_,b),p,b),G=o.multiplyByVector(S,a,w),q=h(N,e.negate(G,I),0,0,1),V=q.length;if(V>0){for(var W=e.clone(e.ZERO,z),X=Number.NEGATIVE_INFINITY,H=0;H<V;++H){v=o.multiplyByVector(_,o.multiplyByVector(p,q[H],F),F);var Y=e.normalize(e.subtract(v,a,M),M),k=e.dot(Y,u);k>X&&(X=k,W=e.clone(v,W))}var j=r.cartesianToCartographic(W,B);return X=i.clamp(X,0,1),A=e.magnitude(e.subtract(W,a,M))*Math.sqrt(1-X*X),A=c?-A:A,j.height=A,r.cartographicToCartesian(j,new e)}};var G=new e;return E.lineSegmentPlane=function(t,r,a,o){n(o)||(o=new e);var u=e.subtract(r,t,G),s=a.normal,c=e.dot(s,u);if(!(Math.abs(c)<i.EPSILON6)){var l=e.dot(s,t),f=-(a.distance+l)/c;if(!(f<0||f>1))return e.multiplyByScalar(u,f,o),e.add(t,o,o),o}},E.trianglePlaneIntersection=function(t,r,n,a){var i=a.normal,o=a.distance,u=e.dot(i,t)+o<0,s=e.dot(i,r)+o<0,c=e.dot(i,n)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var f,d;if(1!==l&&2!==l||(f=new e,d=new e),1===l){if(u)return E.lineSegmentPlane(t,r,a,f),E.lineSegmentPlane(t,n,a,d),{positions:[t,r,n,f,d],indices:[0,3,4,1,2,4,1,4,3]};if(s)return E.lineSegmentPlane(r,n,a,f),E.lineSegmentPlane(r,t,a,d),{positions:[t,r,n,f,d],indices:[1,3,4,2,0,4,2,4,3]};if(c)return E.lineSegmentPlane(n,t,a,f),E.lineSegmentPlane(n,r,a,d),{positions:[t,r,n,f,d],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return E.lineSegmentPlane(r,t,a,f),E.lineSegmentPlane(n,t,a,d),{positions:[t,r,n,f,d],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return E.lineSegmentPlane(n,r,a,f),E.lineSegmentPlane(t,r,a,d),{positions:[t,r,n,f,d],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return E.lineSegmentPlane(t,n,a,f),E.lineSegmentPlane(r,n,a,d),{positions:[t,r,n,f,d],indices:[0,1,4,0,4,3,2,3,4]}}},E}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,r,n){"use strict";function a(t,r){this.normal=e.clone(t),this.distance=r}a.fromPointNormal=function(r,n,i){var o=-e.dot(n,r);return t(i)?(e.clone(n,i.normal),i.distance=o,i):new a(n,o)};var i=new e;return a.fromCartesian4=function(r,n){var o=e.fromCartesian4(r,i),u=r.w;return t(n)?(e.clone(o,n.normal),n.distance=u,n):new a(o,u)},a.getPointDistance=function(t,r){return e.dot(t.normal,r)+t.distance},a.ORIGIN_XY_PLANE=n(new a(e.UNIT_Z,0)),a.ORIGIN_YZ_PLANE=n(new a(e.UNIT_X,0)),a.ORIGIN_ZX_PLANE=n(new a(e.UNIT_Y,0)),a}),define("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";var n={};return n.calculateACMR=function(r){r=e(r,e.EMPTY_OBJECT);var n=r.indices,a=r.maximumIndex,i=e(r.cacheSize,24),o=n.length;if(!t(a)){a=0;for(var u=0,s=n[u];u<o;)s>a&&(a=s),++u,s=n[u]}for(var c=[],l=0;l<a+1;l++)c[l]=0;for(var f=i+1,d=0;d<o;++d)f-c[n[d]]>i&&(c[n[d]]=f,++f);return(f-i+1)/(o/3)},n.tipsify=function(r){function n(e,t,r,n){for(;t.length>=1;){var a=t[t.length-1];if(t.splice(t.length-1,1),e[a].numLiveTriangles>0)return a}for(;i<n;){if(e[i].numLiveTriangles>0)return++i,i-1;++i}return-1}function a(e,t,r,a,i,o,u){for(var s,c=-1,l=-1,f=0;f<r.length;){var d=r[f];a[d].numLiveTriangles&&(s=0,i-a[d].timeStamp+2*a[d].numLiveTriangles<=t&&(s=i-a[d].timeStamp),(s>l||l===-1)&&(l=s,c=d)),++f}return c===-1?n(a,o,e,u):c}r=e(r,e.EMPTY_OBJECT);var i,o=r.indices,u=r.maximumIndex,s=e(r.cacheSize,24),c=o.length,l=0,f=0,d=o[f],h=c;if(t(u))l=u+1;else{for(;f<h;)d>l&&(l=d),++f,d=o[f];if(l===-1)return 0;++l}for(var E=[],m=0;m<l;m++)E[m]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};f=0;for(var p=0;f<h;)E[o[f]].vertexTriangles.push(p),++E[o[f]].numLiveTriangles,E[o[f+1]].vertexTriangles.push(p),++E[o[f+1]].numLiveTriangles,E[o[f+2]].vertexTriangles.push(p),++E[o[f+2]].numLiveTriangles,++p,f+=3;var y=0,_=s+1;i=1;var T,R,v=[],A=[],S=0,N=[],I=c/3,g=[];for(m=0;m<I;m++)g[m]=!1;for(var O,M;y!==-1;){v=[],R=E[y],M=R.vertexTriangles.length;for(var w=0;w<M;++w)if(p=R.vertexTriangles[w],!g[p]){g[p]=!0,f=p+p+p;for(var x=0;x<3;++x)O=o[f],v.push(O),A.push(O),N[S]=O,++S,T=E[O],--T.numLiveTriangles,_-T.timeStamp>s&&(T.timeStamp=_,++_),++f}y=a(o,s,v,E,_,A,l)}return N},n}),define("Core/GeometryPipeline",["./AttributeCompression","./barycentricCoordinates","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EncodedCartesian3","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryType","./IndexDatatype","./Intersect","./IntersectionTests","./Math","./Matrix3","./Matrix4","./Plane","./PrimitiveType","./Tipsify"],function(e,t,r,n,a,i,o,u,s,c,l,f,d,h,E,m,p,y,_,T,R,v,A,S,N){"use strict";function I(e,t,r,n,a){e[t++]=r,e[t++]=n,e[t++]=n,e[t++]=a,e[t++]=a,e[t]=r}function g(e){for(var t=e.length,r=t/3*6,n=p.createTypedArray(t,r),a=0,i=0;i<t;i+=3,a+=6)I(n,a,e[i],e[i+1],e[i+2]);return n}function O(e){var t=e.length;if(t>=3){var r=6*(t-2),n=p.createTypedArray(t,r);I(n,0,e[0],e[1],e[2]);for(var a=6,i=3;i<t;++i,a+=6)I(n,a,e[i-1],e[i],e[i-2]);return n}return new Uint16Array}function M(e){if(e.length>0){for(var t=e.length-1,r=6*(t-1),n=p.createTypedArray(t,r),a=e[0],i=0,o=1;o<t;++o,i+=6)I(n,i,a,e[o],e[o+1]);return n}return new Uint16Array}function w(e){var t={};for(var r in e)if(e.hasOwnProperty(r)&&c(e[r])&&c(e[r].values)){var n=e[r];t[r]=new E({componentDatatype:n.componentDatatype,componentsPerAttribute:n.componentsPerAttribute,normalize:n.normalize,values:[]})}return t}function x(e,t,r){for(var n in t)if(t.hasOwnProperty(n)&&c(t[n])&&c(t[n].values))for(var a=t[n],i=0;i<a.componentsPerAttribute;++i)e[n].values.push(a.values[r*a.componentsPerAttribute+i])}function C(e,t){if(c(t))for(var r=t.values,n=r.length,i=0;i<n;i+=3)a.unpack(r,i,ie),v.multiplyByPoint(e,ie,ie),a.pack(ie,r,i)}function P(e,t){if(c(t))for(var r=t.values,n=r.length,i=0;i<n;i+=3)a.unpack(r,i,ie),R.multiplyByVector(e,ie,ie),ie=a.normalize(ie,ie),a.pack(ie,r,i)}function D(e,t){var r,n=e.length,a={},i=e[0][t].attributes;for(r in i)if(i.hasOwnProperty(r)&&c(i[r])&&c(i[r].values)){for(var o=i[r],s=o.values.length,l=!0,f=1;f<n;++f){var d=e[f][t].attributes[r];if(!c(d)||o.componentDatatype!==d.componentDatatype||o.componentsPerAttribute!==d.componentsPerAttribute||o.normalize!==d.normalize){l=!1;break}s+=d.values.length}l&&(a[r]=new E({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:u.createTypedArray(o.componentDatatype,s)}))}return a}function L(e,t){var n,i,o,u,s,l,f,d=e.length,E=(e[0].modelMatrix,c(e[0][t].indices)),m=e[0][t].primitiveType,y=D(e,t);for(n in y)if(y.hasOwnProperty(n))for(s=y[n].values,u=0,i=0;i<d;++i)for(l=e[i][t].attributes[n].values,f=l.length,o=0;o<f;++o)s[u++]=l[o];var _;if(E){var T=0;for(i=0;i<d;++i)T+=e[i][t].indices.length;var R=h.computeNumberOfVertices(new h({attributes:y,primitiveType:S.POINTS})),v=p.createTypedArray(R,T),A=0,N=0;for(i=0;i<d;++i){var I=e[i][t].indices,g=I.length;for(u=0;u<g;++u)v[A++]=N+I[u];N+=h.computeNumberOfVertices(e[i][t])}_=v}var O,M=new a,w=0;for(i=0;i<d;++i){if(O=e[i][t].boundingSphere,!c(O)){M=void 0;break}a.add(O.center,M,M)}if(c(M))for(a.divideByScalar(M,d,M),i=0;i<d;++i){O=e[i][t].boundingSphere;var x=a.magnitude(a.subtract(O.center,M,se))+O.radius;x>w&&(w=x)}return new h({attributes:y,indices:_,primitiveType:m,boundingSphere:c(M)?new r(M,w):void 0})}function U(e){if(c(e.indices))return e;for(var t=h.computeNumberOfVertices(e),r=p.createTypedArray(t,t),n=0;n<t;++n)r[n]=n;return e.indices=r,e}function b(e){var t=h.computeNumberOfVertices(e),r=p.createTypedArray(t,3*(t-2));r[0]=1,r[1]=0,r[2]=2;for(var n=3,a=3;a<t;++a)r[n++]=a-1,r[n++]=0,r[n++]=a;return e.indices=r,e.primitiveType=S.TRIANGLES,e}function F(e){var t=h.computeNumberOfVertices(e),r=p.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,a=3;a<t-1;a+=2)r[n++]=a,r[n++]=a-1,r[n++]=a+1,a+2<t&&(r[n++]=a,r[n++]=a+1,r[n++]=a+2);return e.indices=r,e.primitiveType=S.TRIANGLES,e}function z(e){if(c(e.indices))return e;for(var t=h.computeNumberOfVertices(e),r=p.createTypedArray(t,t),n=0;n<t;++n)r[n]=n;return e.indices=r,e}function B(e){var t=h.computeNumberOfVertices(e),r=p.createTypedArray(t,2*(t-1));r[0]=0,r[1]=1;for(var n=2,a=2;a<t;++a)r[n++]=a-1,r[n++]=a;return e.indices=r,e.primitiveType=S.LINES,e}function G(e){var t=h.computeNumberOfVertices(e),r=p.createTypedArray(t,2*t);r[0]=0,r[1]=1;for(var n=2,a=2;a<t;++a)r[n++]=a-1,r[n++]=a;return r[n++]=t-1,r[n]=0,e.indices=r,e.primitiveType=S.LINES,e}function q(e){switch(e.primitiveType){case S.TRIANGLE_FAN:return b(e);case S.TRIANGLE_STRIP:return F(e);case S.TRIANGLES:return U(e);case S.LINE_STRIP:return B(e);case S.LINE_LOOP:return G(e);case S.LINES:return z(e)}return e}function V(e,t){Math.abs(e.y)<T.EPSILON6&&(t?e.y=-T.EPSILON6:e.y=T.EPSILON6)}function W(e,t,r){if(0!==e.y&&0!==t.y&&0!==r.y)return V(e,e.y<0),V(t,t.y<0),void V(r,r.y<0);var n,a=Math.abs(e.y),i=Math.abs(t.y),o=Math.abs(r.y);n=a>i?a>o?T.sign(e.y):T.sign(r.y):i>o?T.sign(t.y):T.sign(r.y);var u=n<0;V(e,u),V(t,u),V(r,u)}function X(e,t,r,n){a.add(e,a.multiplyByScalar(a.subtract(t,e,Re),e.y/(e.y-t.y),Re),r),a.clone(r,n),V(r,!0),V(n,!1)}function H(e,t,r){if(!(e.x>=0||t.x>=0||r.x>=0)){W(e,t,r);var n=e.y<0,a=t.y<0,i=r.y<0,o=0;o+=n?1:0,o+=a?1:0,o+=i?1:0;var u=Ie.indices;1===o?(u[1]=3,u[2]=4,u[5]=6,u[7]=6,u[8]=5,n?(X(e,t,ve,Se),X(e,r,Ae,Ne),u[0]=0,u[3]=1,u[4]=2,u[6]=1):a?(X(t,r,ve,Se),X(t,e,Ae,Ne),u[0]=1,u[3]=2,u[4]=0,u[6]=2):i&&(X(r,e,ve,Se),X(r,t,Ae,Ne),u[0]=2,u[3]=0,u[4]=1,u[6]=0)):2===o&&(u[2]=4,u[4]=4,u[5]=3,u[7]=5,u[8]=6,n?a?i||(X(r,e,ve,Se),X(r,t,Ae,Ne),u[0]=0,u[1]=1,u[3]=0,u[6]=2):(X(t,r,ve,Se),X(t,e,Ae,Ne),u[0]=2,u[1]=0,u[3]=2,u[6]=1):(X(e,t,ve,Se),X(e,r,Ae,Ne),u[0]=1,u[1]=2,u[3]=1,u[6]=0));var s=Ie.positions;return s[0]=e,s[1]=t,s[2]=r,s.length=3,1!==o&&2!==o||(s[3]=ve,s[4]=Ae,s[5]=Se,s[6]=Ne,s.length=7),Ie}}function Y(e,t){var n=e.attributes;if(0!==n.position.values.length){for(var a in n)if(n.hasOwnProperty(a)&&c(n[a])&&c(n[a].values)){var i=n[a];i.values=u.createTypedArray(i.componentDatatype,i.values)}var o=h.computeNumberOfVertices(e);return e.indices=p.createTypedArray(o,e.indices),t&&(e.boundingSphere=r.fromVertices(n.position.values)),e}}function k(e){var t=e.attributes,r={};for(var n in t)if(t.hasOwnProperty(n)&&c(t[n])&&c(t[n].values)){var a=t[n];r[n]=new E({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:[]})}return new h({attributes:r,indices:[],primitiveType:e.primitiveType})}function j(e,t,r){var n=c(e.geometry.boundingSphere);t=Y(t,n),r=Y(r,n),c(r)&&!c(t)?e.geometry=r:!c(r)&&c(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=r,e.geometry=void 0)}function Z(e,r,i,o,u,s,l,f,d,h,E){if(c(s)||c(l)||c(f)||c(d)){var m=a.fromArray(u,3*e,ge),p=a.fromArray(u,3*r,Oe),y=a.fromArray(u,3*i,Me),_=t(o,m,p,y,we);if(c(s)){var T=a.fromArray(s,3*e,ge),R=a.fromArray(s,3*r,Oe),v=a.fromArray(s,3*i,Me);a.multiplyByScalar(T,_.x,T),a.multiplyByScalar(R,_.y,R),a.multiplyByScalar(v,_.z,v);var A=a.add(T,R,T);a.add(A,v,A),a.normalize(A,A),a.pack(A,h.normal.values,3*E)}if(c(l)){var S=a.fromArray(l,3*e,ge),N=a.fromArray(l,3*r,Oe),I=a.fromArray(l,3*i,Me);a.multiplyByScalar(S,_.x,S),a.multiplyByScalar(N,_.y,N),a.multiplyByScalar(I,_.z,I);var g=a.add(S,N,S);a.add(g,I,g),a.normalize(g,g),a.pack(g,h.binormal.values,3*E)}if(c(f)){var O=a.fromArray(f,3*e,ge),M=a.fromArray(f,3*r,Oe),w=a.fromArray(f,3*i,Me);a.multiplyByScalar(O,_.x,O),a.multiplyByScalar(M,_.y,M),a.multiplyByScalar(w,_.z,w);var x=a.add(O,M,O);a.add(x,w,x),a.normalize(x,x),a.pack(x,h.tangent.values,3*E)}if(c(d)){var C=n.fromArray(d,2*e,xe),P=n.fromArray(d,2*r,Ce),D=n.fromArray(d,2*i,Pe);n.multiplyByScalar(C,_.x,C),n.multiplyByScalar(P,_.y,P),n.multiplyByScalar(D,_.z,D);var L=n.add(C,P,C);n.add(L,D,L),n.pack(L,h.st.values,2*E)}}}function K(e,t,r,n,a,i){var o=e.position.values.length/3;if(a!==-1){var u=n[a],s=r[u];return s===-1?(r[u]=o,e.position.values.push(i.x,i.y,i.z),t.push(o),o):(t.push(s),s)}return e.position.values.push(i.x,i.y,i.z),t.push(o),o}function J(e){var t,r,n,i,o,u=e.geometry,s=u.attributes,l=s.position.values,f=c(s.normal)?s.normal.values:void 0,d=c(s.binormal)?s.binormal.values:void 0,h=c(s.tangent)?s.tangent.values:void 0,E=c(s.st)?s.st.values:void 0,m=u.indices,p=k(u),y=k(u),_=[];_.length=l.length/3;var T=[];for(T.length=l.length/3,o=0;o<_.length;++o)_[o]=-1,T[o]=-1;var R=m.length;for(o=0;o<R;o+=3){var v=m[o],A=m[o+1],S=m[o+2],N=a.fromArray(l,3*v),I=a.fromArray(l,3*A),g=a.fromArray(l,3*S),O=H(N,I,g);if(c(O)&&O.positions.length>3)for(var M=O.positions,w=O.indices,x=w.length,C=0;C<x;++C){var P=w[C],D=M[P];D.y<0?(t=y.attributes,r=y.indices,n=_):(t=p.attributes,r=p.indices,n=T),i=K(t,r,n,m,P<3?o+P:-1,D),Z(v,A,S,D,l,f,d,h,E,t,i)}else c(O)&&(N=O.positions[0],I=O.positions[1],g=O.positions[2]),N.y<0?(t=y.attributes,r=y.indices,n=_):(t=p.attributes,r=p.indices,n=T),i=K(t,r,n,m,o,N),Z(v,A,S,N,l,f,d,h,E,t,i),i=K(t,r,n,m,o+1,I),Z(v,A,S,I,l,f,d,h,E,t,i),i=K(t,r,n,m,o+2,g),Z(v,A,S,g,l,f,d,h,E,t,i)}j(e,y,p)}function Q(e){var t,r=e.geometry,n=r.attributes,i=n.position.values,o=r.indices,u=k(r),s=k(r),l=o.length,f=[];f.length=i.length/3;var d=[];for(d.length=i.length/3,t=0;t<f.length;++t)f[t]=-1,d[t]=-1;for(t=0;t<l;t+=2){var h=o[t],E=o[t+1],m=a.fromArray(i,3*h,ge),p=a.fromArray(i,3*E,Oe);Math.abs(m.y)<T.EPSILON6&&(m.y<0?m.y=-T.EPSILON6:m.y=T.EPSILON6),Math.abs(p.y)<T.EPSILON6&&(p.y<0?p.y=-T.EPSILON6:p.y=T.EPSILON6);var y=u.attributes,R=u.indices,v=d,A=s.attributes,S=s.indices,N=f,I=_.lineSegmentPlane(m,p,De,Me);if(c(I)){var g=a.multiplyByScalar(a.UNIT_Y,5*T.EPSILON9,Le);m.y<0&&(a.negate(g,g),y=s.attributes,R=s.indices,v=f,A=u.attributes,S=u.indices,N=d);var O=a.add(I,g,Ue);K(y,R,v,o,t,m),K(y,R,v,o,-1,O),a.negate(g,g),a.add(I,g,O),K(A,S,N,o,-1,O),K(A,S,N,o,t+1,p)}else{var M,w,x;m.y<0?(M=s.attributes,w=s.indices,x=f):(M=u.attributes,w=u.indices,x=d),K(M,w,x,o,t,m),K(M,w,x,o,t+1,p)}}j(e,s,u)}function $(e){for(var t=e.attributes,r=t.position.values,n=t.prevPosition.values,i=t.nextPosition.values,o=r.length,u=0;u<o;u+=3){var s=a.unpack(r,u,ze);if(!(s.x>0)){var c=a.unpack(n,u,Be);(s.y<0&&c.y>0||s.y>0&&c.y<0)&&(u-3>0?(n[u]=r[u-3],n[u+1]=r[u-2],n[u+2]=r[u-1]):a.pack(s,n,u));var l=a.unpack(i,u,Ge);(s.y<0&&l.y>0||s.y>0&&l.y<0)&&(u+3<o?(i[u]=r[u+3],i[u+1]=r[u+4],i[u+2]=r[u+5]):a.pack(s,i,u))}}}function ee(e){var t,r,o,u=e.geometry,s=u.attributes,l=s.position.values,f=s.prevPosition.values,d=s.nextPosition.values,h=s.expandAndWidth.values,E=c(s.st)?s.st.values:void 0,m=c(s.color)?s.color.values:void 0,p=k(u),y=k(u),R=!1,v=l.length/3;for(t=0;t<v;t+=4){var A=t,S=t+2,N=a.fromArray(l,3*A,ze),I=a.fromArray(l,3*S,Be);if(Math.abs(N.y)<Ye)for(N.y=Ye*(I.y<0?-1:1),l[3*t+1]=N.y,l[3*(t+1)+1]=N.y,r=3*A;r<3*A+12;r+=3)f[r]=l[3*t],f[r+1]=l[3*t+1],f[r+2]=l[3*t+2];if(Math.abs(I.y)<Ye)for(I.y=Ye*(N.y<0?-1:1),l[3*(t+2)+1]=I.y,l[3*(t+3)+1]=I.y,r=3*A;r<3*A+12;r+=3)d[r]=l[3*(t+2)],d[r+1]=l[3*(t+2)+1],d[r+2]=l[3*(t+2)+2];var g=p.attributes,O=p.indices,M=y.attributes,w=y.indices,x=_.lineSegmentPlane(N,I,De,qe);if(c(x)){R=!0;var C=a.multiplyByScalar(a.UNIT_Y,He,Ve);N.y<0&&(a.negate(C,C),g=y.attributes,O=y.indices,M=p.attributes,w=p.indices);var P=a.add(x,C,We);g.position.values.push(N.x,N.y,N.z,N.x,N.y,N.z),g.position.values.push(P.x,P.y,P.z),g.position.values.push(P.x,P.y,P.z),g.prevPosition.values.push(f[3*A],f[3*A+1],f[3*A+2]),g.prevPosition.values.push(f[3*A+3],f[3*A+4],f[3*A+5]),g.prevPosition.values.push(N.x,N.y,N.z,N.x,N.y,N.z),g.nextPosition.values.push(P.x,P.y,P.z),g.nextPosition.values.push(P.x,P.y,P.z),g.nextPosition.values.push(P.x,P.y,P.z),g.nextPosition.values.push(P.x,P.y,P.z),a.negate(C,C),a.add(x,C,P),M.position.values.push(P.x,P.y,P.z),M.position.values.push(P.x,P.y,P.z),M.position.values.push(I.x,I.y,I.z,I.x,I.y,I.z),M.prevPosition.values.push(P.x,P.y,P.z),M.prevPosition.values.push(P.x,P.y,P.z),M.prevPosition.values.push(P.x,P.y,P.z),M.prevPosition.values.push(P.x,P.y,P.z),M.nextPosition.values.push(I.x,I.y,I.z,I.x,I.y,I.z),M.nextPosition.values.push(d[3*S],d[3*S+1],d[3*S+2]),M.nextPosition.values.push(d[3*S+3],d[3*S+4],d[3*S+5]);var D=n.fromArray(h,2*A,be),L=Math.abs(D.y);g.expandAndWidth.values.push(-1,L,1,L),g.expandAndWidth.values.push(-1,-L,1,-L),M.expandAndWidth.values.push(-1,L,1,L),M.expandAndWidth.values.push(-1,-L,1,-L);var U=a.magnitudeSquared(a.subtract(x,N,Ge));if(U/=a.magnitudeSquared(a.subtract(I,N,Ge)),c(m)){var b=i.fromArray(m,4*A,Xe),F=i.fromArray(m,4*S,Xe),z=T.lerp(b.x,F.x,U),B=T.lerp(b.y,F.y,U),G=T.lerp(b.z,F.z,U),q=T.lerp(b.w,F.w,U);for(r=4*A;r<4*A+8;++r)g.color.values.push(m[r]);for(g.color.values.push(z,B,G,q),g.color.values.push(z,B,G,q),M.color.values.push(z,B,G,q),M.color.values.push(z,B,G,q),r=4*S;r<4*S+8;++r)M.color.values.push(m[r])}if(c(E)){var V=n.fromArray(E,2*A,be),W=n.fromArray(E,2*(t+3),Fe),X=T.lerp(V.x,W.x,U);for(r=2*A;r<2*A+4;++r)g.st.values.push(E[r]);for(g.st.values.push(X,V.y),g.st.values.push(X,W.y),M.st.values.push(X,V.y),M.st.values.push(X,W.y),r=2*S;r<2*S+4;++r)M.st.values.push(E[r])}o=g.position.values.length/3-4,O.push(o,o+2,o+1),O.push(o+1,o+2,o+3),o=M.position.values.length/3-4,w.push(o,o+2,o+1),w.push(o+1,o+2,o+3)}else{var H,Y;for(N.y<0?(H=y.attributes,Y=y.indices):(H=p.attributes,Y=p.indices),H.position.values.push(N.x,N.y,N.z),H.position.values.push(N.x,N.y,N.z),H.position.values.push(I.x,I.y,I.z),H.position.values.push(I.x,I.y,I.z),r=3*t;r<3*t+12;++r)H.prevPosition.values.push(f[r]),H.nextPosition.values.push(d[r]);for(r=2*t;r<2*t+8;++r)H.expandAndWidth.values.push(h[r]),c(E)&&H.st.values.push(E[r]);if(c(m))for(r=4*t;r<4*t+16;++r)H.color.values.push(m[r]);o=H.position.values.length/3-4,Y.push(o,o+2,o+1),Y.push(o+1,o+2,o+3)}}R&&($(y),$(p)),j(e,y,p)}var te={};te.toWireframe=function(e){var t=e.indices;if(c(t)){switch(e.primitiveType){case S.TRIANGLES:e.indices=g(t);break;case S.TRIANGLE_STRIP:e.indices=O(t);break;case S.TRIANGLE_FAN:e.indices=M(t)}e.primitiveType=S.LINES}return e},te.createLineSegmentsForVectors=function(e,t,n){t=s(t,"normal"),n=s(n,1e4);for(var a=e.attributes.position.values,i=e.attributes[t].values,o=a.length,l=new Float64Array(2*o),f=0,d=0;d<o;d+=3)l[f++]=a[d],l[f++]=a[d+1],l[f++]=a[d+2],l[f++]=a[d]+i[d]*n,l[f++]=a[d+1]+i[d+1]*n,l[f++]=a[d+2]+i[d+2]*n;var m,p=e.boundingSphere;return c(p)&&(m=new r(p.center,p.radius+n)),new h({attributes:{position:new E({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:S.LINES,boundingSphere:m})},te.createAttributeLocations=function(e){var t,r=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","binormal","tangent","compressedAttributes"],n=e.attributes,a={},i=0,o=r.length;for(t=0;t<o;++t){var u=r[t];c(n[u])&&(a[u]=i++)}for(var s in n)n.hasOwnProperty(s)&&!c(a[s])&&(a[s]=i++);return a},te.reorderForPreVertexCache=function(e){var t=h.computeNumberOfVertices(e),r=e.indices;if(c(r)){for(var n=new Int32Array(t),a=0;a<t;a++)n[a]=-1;for(var i,o=r,s=o.length,l=p.createTypedArray(t,s),f=0,d=0,E=0;f<s;)i=n[o[f]],i!==-1?l[d]=i:(i=o[f],n[i]=E,l[d]=E,++E),++f,++d;e.indices=l;var m=e.attributes;for(var y in m)if(m.hasOwnProperty(y)&&c(m[y])&&c(m[y].values)){for(var _=m[y],T=_.values,R=0,v=_.componentsPerAttribute,A=u.createTypedArray(_.componentDatatype,E*v);R<t;){var S=n[R];if(S!==-1)for(a=0;a<v;a++)A[v*S+a]=T[v*R+a];++R}_.values=A}}return e},te.reorderForPostVertexCache=function(e,t){var r=e.indices;if(e.primitiveType===S.TRIANGLES&&c(r)){for(var n=r.length,a=0,i=0;i<n;i++)r[i]>a&&(a=r[i]);e.indices=N.tipsify({indices:r,maximumIndex:a,cacheSize:t})}return e},te.fitToUnsignedShortIndices=function(e){var t=[],r=h.computeNumberOfVertices(e);if(c(e.indices)&&r>=T.SIXTY_FOUR_KILOBYTES){var n,a=[],i=[],o=0,u=w(e.attributes),s=e.indices,l=s.length;e.primitiveType===S.TRIANGLES?n=3:e.primitiveType===S.LINES?n=2:e.primitiveType===S.POINTS&&(n=1);for(var f=0;f<l;f+=n){for(var d=0;d<n;++d){var E=s[f+d],m=a[E];c(m)||(m=o++,a[E]=m,x(u,e.attributes,E)),i.push(m)}o+n>=T.SIXTY_FOUR_KILOBYTES&&(t.push(new h({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),a=[],i=[],o=0,u=w(e.attributes))}0!==i.length&&t.push(new h({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e); -return t};var re=new a,ne=new o;te.projectTo2D=function(e,t,r,n,i){var o=e.attributes[t];i=c(i)?i:new d;for(var s=i.ellipsoid,l=o.values,f=new Float64Array(l.length),h=0,m=0;m<l.length;m+=3){var p=a.fromArray(l,m,re),y=s.cartesianToCartographic(p,ne),_=i.project(y,re);f[h++]=_.x,f[h++]=_.y,f[h++]=_.z}return e.attributes[r]=o,e.attributes[n]=new E({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:f}),delete e.attributes[t],e};var ae={high:0,low:0};te.encodeAttribute=function(e,t,r,n){for(var a=e.attributes[t],i=a.values,o=i.length,s=new Float32Array(o),c=new Float32Array(o),l=0;l<o;++l)f.encode(i[l],ae),s[l]=ae.high,c[l]=ae.low;var d=a.componentsPerAttribute;return e.attributes[r]=new E({componentDatatype:u.FLOAT,componentsPerAttribute:d,values:s}),e.attributes[n]=new E({componentDatatype:u.FLOAT,componentsPerAttribute:d,values:c}),delete e.attributes[t],e};var ie=new a,oe=new v,ue=new R;te.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(v.equals(t,v.IDENTITY))return e;var n=e.geometry.attributes;C(t,n.position),C(t,n.prevPosition),C(t,n.nextPosition),(c(n.normal)||c(n.binormal)||c(n.tangent))&&(v.inverse(t,oe),v.transpose(oe,oe),v.getRotation(oe,ue),P(ue,n.normal),P(ue,n.binormal),P(ue,n.tangent));var a=e.geometry.boundingSphere;return c(a)&&(e.geometry.boundingSphere=r.transform(a,t,a)),e.modelMatrix=v.clone(v.IDENTITY),e};var se=new a;te.combineInstances=function(e){for(var t=[],r=[],n=e.length,a=0;a<n;++a){var i=e[a];c(i.geometry)?t.push(i):c(i.westHemisphereGeometry)&&c(i.eastHemisphereGeometry)&&r.push(i)}var o=[];return t.length>0&&o.push(L(t,"geometry")),r.length>0&&(o.push(L(r,"westHemisphereGeometry")),o.push(L(r,"eastHemisphereGeometry"))),o};var ce=new a,le=new a,fe=new a,de=new a;te.computeNormal=function(e){for(var t=e.indices,r=e.attributes,n=r.position.values,i=r.position.values.length/3,o=t.length,s=new Array(i),c=new Array(o/3),l=new Array(o),f=0;f<i;f++)s[f]={indexOffset:0,count:0,currentCount:0};var d=0;for(f=0;f<o;f+=3){var h=t[f],m=t[f+1],p=t[f+2],y=3*h,_=3*m,T=3*p;le.x=n[y],le.y=n[y+1],le.z=n[y+2],fe.x=n[_],fe.y=n[_+1],fe.z=n[_+2],de.x=n[T],de.y=n[T+1],de.z=n[T+2],s[h].count++,s[m].count++,s[p].count++,a.subtract(fe,le,fe),a.subtract(de,le,de),c[d]=a.cross(fe,de,new a),d++}var R=0;for(f=0;f<i;f++)s[f].indexOffset+=R,R+=s[f].count;d=0;var v;for(f=0;f<o;f+=3){v=s[t[f]];var A=v.indexOffset+v.currentCount;l[A]=d,v.currentCount++,v=s[t[f+1]],A=v.indexOffset+v.currentCount,l[A]=d,v.currentCount++,v=s[t[f+2]],A=v.indexOffset+v.currentCount,l[A]=d,v.currentCount++,d++}var S=new Float32Array(3*i);for(f=0;f<i;f++){var N=3*f;if(v=s[f],v.count>0){for(a.clone(a.ZERO,ce),d=0;d<v.count;d++)a.add(ce,c[l[v.indexOffset+d]],ce);a.normalize(ce,ce),S[N]=ce.x,S[N+1]=ce.y,S[N+2]=ce.z}else S[N]=0,S[N+1]=0,S[N+2]=1}return e.attributes.normal=new E({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:S}),e};var he=new a,Ee=new a,me=new a;te.computeBinormalAndTangent=function(e){for(var t=(e.attributes,e.indices),r=e.attributes.position.values,n=e.attributes.normal.values,i=e.attributes.st.values,o=e.attributes.position.values.length/3,s=t.length,c=new Array(3*o),l=0;l<c.length;l++)c[l]=0;var f,d,h;for(l=0;l<s;l+=3){var m=t[l],p=t[l+1],y=t[l+2];f=3*m,d=3*p,h=3*y;var _=2*m,T=2*p,R=2*y,v=r[f],A=r[f+1],S=r[f+2],N=i[_],I=i[_+1],g=i[T+1]-I,O=i[R+1]-I,M=1/((i[T]-N)*O-(i[R]-N)*g),w=(O*(r[d]-v)-g*(r[h]-v))*M,x=(O*(r[d+1]-A)-g*(r[h+1]-A))*M,C=(O*(r[d+2]-S)-g*(r[h+2]-S))*M;c[f]+=w,c[f+1]+=x,c[f+2]+=C,c[d]+=w,c[d+1]+=x,c[d+2]+=C,c[h]+=w,c[h+1]+=x,c[h+2]+=C}var P=new Float32Array(3*o),D=new Float32Array(3*o);for(l=0;l<o;l++){f=3*l,d=f+1,h=f+2;var L=a.fromArray(n,f,he),U=a.fromArray(c,f,me),b=a.dot(L,U);a.multiplyByScalar(L,b,Ee),a.normalize(a.subtract(U,Ee,U),U),D[f]=U.x,D[d]=U.y,D[h]=U.z,a.normalize(a.cross(L,U,U),U),P[f]=U.x,P[d]=U.y,P[h]=U.z}return e.attributes.tangent=new E({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:D}),e.attributes.binormal=new E({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:P}),e};var pe=new n,ye=new a,_e=new a,Te=new a;te.compressVertices=function(t){var r=t.attributes.normal,i=t.attributes.st;if(!c(r)&&!c(i))return t;var o,s,l,f,d=t.attributes.tangent,h=t.attributes.binormal;c(r)&&(o=r.values),c(i)&&(s=i.values),c(d)&&(l=d.values),h&&(f=h.values);var m=c(o)?o.length:s.length,p=c(o)?3:2,y=m/p,_=y,T=c(s)&&c(o)?2:1;T+=c(l)||c(f)?1:0,_*=T;for(var R=new Float32Array(_),v=0,A=0;A<y;++A){c(s)&&(n.fromArray(s,2*A,pe),R[v++]=e.compressTextureCoordinates(pe));var S=3*A;c(o)&&c(l)&&c(f)?(a.fromArray(o,S,ye),a.fromArray(l,S,_e),a.fromArray(f,S,Te),e.octPack(ye,_e,Te,pe),R[v++]=pe.x,R[v++]=pe.y):(c(o)&&(a.fromArray(o,S,ye),R[v++]=e.octEncodeFloat(ye)),c(l)&&(a.fromArray(l,S,ye),R[v++]=e.octEncodeFloat(ye)),c(f)&&(a.fromArray(f,S,ye),R[v++]=e.octEncodeFloat(ye)))}return t.attributes.compressedAttributes=new E({componentDatatype:u.FLOAT,componentsPerAttribute:T,values:R}),c(o)&&delete t.attributes.normal,c(s)&&delete t.attributes.st,c(l)&&delete t.attributes.tangent,c(f)&&delete t.attributes.binormal,t};var Re=new a,ve=new a,Ae=new a,Se=new a,Ne=new a,Ie={positions:new Array(7),indices:new Array(9)},ge=new a,Oe=new a,Me=new a,we=new a,xe=new n,Ce=new n,Pe=new n,De=A.fromPointNormal(a.ZERO,a.UNIT_Y),Le=new a,Ue=new a,be=new n,Fe=new n,ze=new a,Be=new a,Ge=new a,qe=new a,Ve=new a,We=new a,Xe=new i,He=5*T.EPSILON9,Ye=T.EPSILON6;return te.splitLongitude=function(e){var t=e.geometry,n=t.boundingSphere;if(c(n)){var a=n.center.x-n.radius;if(a>0||r.intersectPlane(n,A.ORIGIN_ZX_PLANE)!==y.INTERSECTING)return e}if(t.geometryType!==m.NONE)switch(t.geometryType){case m.POLYLINES:ee(e);break;case m.TRIANGLES:J(e);break;case m.LINES:Q(e)}else q(t),t.primitiveType===S.TRIANGLES?J(e):t.primitiveType===S.LINES&&Q(e);return e},te}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,r,n,a){return t(e).then(r,n,a)}function t(e){var t,r;return e instanceof n?t=e:u(e)?(r=o(),e.then(function(e){r.resolve(e)},function(e){r.reject(e)},function(e){r.progress(e)}),t=r.promise):t=a(e),t}function r(t){return e(t,i)}function n(e){this.then=e}function a(e){var r=new n(function(r){try{return t(r?r(e):e)}catch(e){return i(e)}});return r}function i(e){var r=new n(function(r,n){try{return n?t(n(e)):i(e)}catch(e){return i(e)}});return r}function o(){function e(e,t,r){return d(e,t,r)}function r(e){return E(e)}function a(e){return E(i(e))}function u(e){return h(e)}var s,c,l,f,d,h,E;return c=new n(e),s={then:e,resolve:r,reject:a,progress:u,promise:c,resolver:{resolve:r,reject:a,progress:u}},l=[],f=[],d=function(e,t,r){var n,a;return n=o(),a="function"==typeof r?function(e){try{n.progress(r(e))}catch(e){n.progress(e)}}:function(e){n.progress(e)},l.push(function(r){r.then(e,t).then(n.resolve,n.reject,a)}),f.push(a),n.promise},h=function(e){return m(f,e),e},E=function(e){return e=t(e),d=e.then,E=t,h=y,m(l,e),f=l=v,e},s}function u(e){return e&&"function"==typeof e.then}function s(t,r,n,a,i){return p(2,arguments),e(t,function(t){function u(e){m(e)}function s(e){E(e)}var c,l,f,d,h,E,m,p,_,T;if(_=t.length>>>0,c=Math.max(0,Math.min(r,_)),f=[],l=_-c+1,d=[],h=o(),c)for(p=h.progress,m=function(e){d.push(e),--l||(E=m=y,h.reject(d))},E=function(e){f.push(e),--c||(E=m=y,h.resolve(f))},T=0;T<_;++T)T in t&&e(t[T],s,u,p);else h.resolve(f);return h.then(n,a,i)})}function c(e,t,r,n){function a(e){return t?t(e[0]):e[0]}return s(e,1,a,r,n)}function l(e,t,r,n){return p(1,arguments),d(e,_).then(t,r,n)}function f(){return d(arguments,_)}function d(t,r){return e(t,function(t){var n,a,i,u,s,c;if(i=a=t.length>>>0,n=[],c=o(),i)for(u=function(t,a){e(t,r).then(function(e){n[a]=e,--i||c.resolve(n)},c.reject)},s=0;s<a;s++)s in t?u(t[s],s):--i;else c.resolve(n);return c.promise})}function h(t,r){var n=R.call(arguments,1);return e(t,function(t){var a;return a=t.length,n[0]=function(t,n,i){return e(t,function(t){return e(n,function(e){return r(t,e,i,a)})})},T.apply(t,n)})}function E(t,r,n){var a=arguments.length>2;return e(t,function(e){return e=a?n:e,r.resolve(e),e},function(e){return r.reject(e),i(e)},r.progress)}function m(e,t){for(var r,n=0;r=e[n++];)r(t)}function p(e,t){for(var r,n=t.length;n>e;)if(r=t[--n],null!=r&&"function"!=typeof r)throw new Error("arg "+n+" must be a function")}function y(){}function _(e){return e}var T,R,v;return e.defer=o,e.resolve=t,e.reject=r,e.join=f,e.all=l,e.map=d,e.reduce=h,e.any=c,e.some=s,e.chain=E,e.isPromise=u,n.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(v,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return l(t,function(t){return e.apply(v,t)})})}},R=[].slice,T=[].reduce||function(e){var t,r,n,a,i;if(i=0,t=Object(this),a=t.length>>>0,r=arguments,r.length<=1)for(;;){if(i in t){n=t[i++];break}if(++i>=a)throw new TypeError}else n=r[1];for(;i<a;++i)i in t&&(n=e(n,t[i],i,t));return n},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(r,n){t(a[r])||(a[r]=!0,console.log(e(n,r)))}var a={};return n.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.",n}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,r){"use strict";function n(e,t){r(e,t)}return n}),define("Core/binarySearch",["./defined","./DeveloperError"],function(e,t){"use strict";function r(e,t,r){for(var n,a,i=0,o=e.length-1;i<=o;)if(n=~~((i+o)/2),a=r(e[n],t),a<0)i=n+1;else{if(!(a>0))return n;o=n-1}return~(o+1)}return r}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,r,n,a){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=r,this.yPoleOffset=n,this.ut1MinusUtc=a}return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,r=0,n=t[r++],a=function(e,t,r,n){r||(r=" ");var a=e.length>=t?"":Array(1+t-e.length>>>0).join(r);return n?e+a:a+e},i=function(e,t,r,n,i,o){var u=n-e.length;return u>0&&(e=r||!i?a(e,n,o,r):e.slice(0,t.length)+a("",u,"0",!0)+e.slice(t.length)),e},o=function(e,t,r,n,o,u,s){var c=e>>>0;return r=r&&c&&{2:"0b",8:"0",16:"0x"}[t]||"",e=r+a(c.toString(t),u||0,"0",!1),i(e,r,n,o,s)},u=function(e,t,r,n,a,o){return null!=n&&(e=e.slice(0,n)),i(e,"",t,r,a,o)},s=function(e,n,s,c,l,f,d){var h,E,m,p,y;if("%%"==e)return"%";for(var _=!1,T="",R=!1,v=!1,A=" ",S=s.length,N=0;s&&N<S;N++)switch(s.charAt(N)){case" ":T=" ";break;case"+":T="+";break;case"-":_=!0;break;case"'":A=s.charAt(N+1);break;case"0":R=!0;break;case"#":v=!0}if(c=c?"*"==c?+t[r++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,c<0&&(c=-c,_=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(f=f?"*"==f?+t[r++]:"*"==f.charAt(0)?+t[f.slice(1,-1)]:+f:"fFeE".indexOf(d)>-1?6:"d"==d?0:void 0,y=n?t[n.slice(0,-1)]:t[r++],d){case"s":return u(String(y),_,c,f,R,A);case"c":return u(String.fromCharCode(+y),_,c,f,R);case"b":return o(y,2,v,_,c,f,R);case"o":return o(y,8,v,_,c,f,R);case"x":return o(y,16,v,_,c,f,R);case"X":return o(y,16,v,_,c,f,R).toUpperCase();case"u":return o(y,10,v,_,c,f,R);case"i":case"d":return h=+y||0,h=Math.round(h-h%1),E=h<0?"-":T,y=E+a(String(Math.abs(h)),f,"0",!1),i(y,E,_,c,R);case"e":case"E":case"f":case"F":case"g":case"G":return h=+y,E=h<0?"-":T,m=["toExponential","toFixed","toPrecision"]["efg".indexOf(d.toLowerCase())],p=["toString","toUpperCase"]["eEfFgG".indexOf(d)%2],y=E+Math.abs(h)[m](f),i(y,E,_,c,R)[p]();default:return e}};return n.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,r,n,a,i,o,u){this.year=e,this.month=t,this.day=r,this.hour=n,this.minute=a,this.second=i,this.millisecond=o,this.isLeapSecond=u}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e(t)}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,r,n,a,i,o,u,s,c){"use strict";function l(e,t){return m.compare(e.julianDate,t.julianDate)}function f(e){T.julianDate=e;var r=m.leapSeconds,n=t(r,T,l);n<0&&(n=~n),n>=r.length&&(n=r.length-1);var a=r[n].offset;if(n>0){var i=m.secondsDifference(r[n].julianDate,e);i>a&&(n--,a=r[n].offset)}m.addSeconds(e,a,e)}function d(e,r){T.julianDate=e;var n=m.leapSeconds,a=t(n,T,l);if(a<0&&(a=~a),0===a)return m.addSeconds(e,-n[0].offset,r);if(a>=n.length)return m.addSeconds(e,-n[a-1].offset,r);var i=m.secondsDifference(n[a].julianDate,e);return 0===i?m.addSeconds(e,-n[a].offset,r):i<=1?void 0:m.addSeconds(e,-n[--a].offset,r)}function h(e,t,r){var n=t/s.SECONDS_PER_DAY|0;return e+=n,t-=s.SECONDS_PER_DAY*n,t<0&&(e--,t+=s.SECONDS_PER_DAY),r.dayNumber=e,r.secondsOfDay=t,r}function E(e,t,r,n,a,i,o){var u=(t-14)/12|0,c=e+4800+u,l=(1461*c/4|0)+(367*(t-2-12*u)/12|0)-(3*((c+100)/100|0)/4|0)+r-32075;n-=12,n<0&&(n+=24);var f=i+(n*s.SECONDS_PER_HOUR+a*s.SECONDS_PER_MINUTE+o*s.SECONDS_PER_MILLISECOND);return f>=43200&&(l-=1),[l,f]}function m(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=r(e,0),t=r(t,0),n=r(n,c.UTC);var a=0|e;t+=(e-a)*s.SECONDS_PER_DAY,h(a,t,this),n===c.UTC&&f(this)}var p=new i,y=[31,28,31,30,31,30,31,31,30,31,30,31],_=29,T=new u,R=/^(\d{4})$/,v=/^(\d{4})-(\d{2})$/,A=/^(\d{4})-?(\d{3})$/,S=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,N=/^(\d{4})-?(\d{2})-?(\d{2})$/,I=/([Z+\-])?(\d{2})?:?(\d{2})?$/,g=/^(\d{2})(\.\d+)?/.source+I.source,O=/^(\d{2}):?(\d{2})(\.\d+)?/.source+I.source,M=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+I.source;m.fromDate=function(e,t){var r=E(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return n(t)?(h(r[0],r[1],t),f(t),t):new m(r[0],r[1],c.UTC)},m.fromIso8601=function(e,t){e=e.replace(",",".");var r,a,i,u=e.split("T"),s=1,l=1,d=0,p=0,T=0,I=0,w=u[0],x=u[1];if(u=w.match(N),null!==u)r=+u[1],s=+u[2],l=+u[3];else if(u=w.match(v),null!==u)r=+u[1],s=+u[2];else if(u=w.match(R),null!==u)r=+u[1];else{var C;if(u=w.match(A),null!==u)r=+u[1],C=+u[2],i=o(r);else if(u=w.match(S),null!==u){r=+u[1];var P=+u[2],D=+u[3]||0,L=new Date(Date.UTC(r,0,4));C=7*P+D-L.getUTCDay()-3}a=new Date(Date.UTC(r,0,1)),a.setUTCDate(C),s=a.getUTCMonth()+1,l=a.getUTCDate()}i=o(r);var U;if(n(x)){u=x.match(M),null!==u?(d=+u[1],p=+u[2],T=+u[3],I=1e3*+(u[4]||0),U=5):(u=x.match(O),null!==u?(d=+u[1],p=+u[2],T=60*+(u[3]||0),U=4):(u=x.match(g),null!==u&&(d=+u[1],p=60*+(u[2]||0),U=3)));var b=u[U],F=+u[U+1],z=+(u[U+2]||0);switch(b){case"+":d-=F,p-=z;break;case"-":d+=F,p+=z;break;case"Z":break;default:p+=new Date(Date.UTC(r,s-1,l,d,p)).getTimezoneOffset()}}else p+=new Date(r,s-1,l).getTimezoneOffset();var B=60===T;for(B&&T--;p>=60;)p-=60,d++;for(;d>=24;)d-=24,l++;for(a=i&&2===s?_:y[s-1];l>a;)l-=a,s++,s>12&&(s-=12,r++),a=i&&2===s?_:y[s-1];for(;p<0;)p+=60,d--;for(;d<0;)d+=24,l--;for(;l<1;)s--,s<1&&(s+=12,r--),a=i&&2===s?_:y[s-1],l+=a;var G=E(r,s,l,d,p,T,I);return n(t)?(h(G[0],G[1],t),f(t)):t=new m(G[0],G[1],c.UTC),B&&m.addSeconds(t,1,t),t},m.now=function(e){return m.fromDate(new Date,e)};var w=new m(0,0,c.TAI);return m.toGregorianDate=function(e,t){var r=!1,a=d(e,w);n(a)||(m.addSeconds(e,-1,w),a=d(w,w),r=!0);var o=a.dayNumber,u=a.secondsOfDay;u>=43200&&(o+=1);var c=o+68569|0,l=4*c/146097|0;c=c-((146097*l+3)/4|0)|0;var f=4e3*(c+1)/1461001|0;c=c-(1461*f/4|0)+31|0;var h=80*c/2447|0,E=c-(2447*h/80|0)|0;c=h/11|0;var p=h+2-12*c|0,y=100*(l-49)+f+c|0,_=u/s.SECONDS_PER_HOUR|0,T=u-_*s.SECONDS_PER_HOUR,R=T/s.SECONDS_PER_MINUTE|0;T-=R*s.SECONDS_PER_MINUTE;var v=0|T,A=(T-v)/s.SECONDS_PER_MILLISECOND;return _+=12,_>23&&(_-=24),r&&(v+=1),n(t)?(t.year=y,t.month=p,t.day=E,t.hour=_,t.minute=R,t.second=v,t.millisecond=A,t.isLeapSecond=r,t):new i(y,p,E,_,R,v,A,r)},m.toDate=function(e){var t=m.toGregorianDate(e,p),r=t.second;return t.isLeapSecond&&(r-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,r,t.millisecond))},m.toIso8601=function(t,r){var a,i=m.toGregorianDate(t,i);return n(r)||0===i.millisecond?n(r)&&0!==r?(a=(.01*i.millisecond).toFixed(r).replace(".","").slice(0,r),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",i.year,i.month,i.day,i.hour,i.minute,i.second):(a=(.01*i.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a))},m.clone=function(e,t){if(n(e))return n(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new m(e.dayNumber,e.secondsOfDay,c.TAI)},m.compare=function(e,t){var r=e.dayNumber-t.dayNumber;return 0!==r?r:e.secondsOfDay-t.secondsOfDay},m.equals=function(e,t){return e===t||n(e)&&n(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},m.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(m.secondsDifference(e,t))<=r},m.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},m.secondsDifference=function(e,t){var r=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return r+(e.secondsOfDay-t.secondsOfDay)},m.daysDifference=function(e,t){var r=e.dayNumber-t.dayNumber,n=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return r+n},m.computeTaiMinusUtc=function(e){T.julianDate=e;var r=m.leapSeconds,n=t(r,T,l);return n<0&&(n=~n,--n,n<0&&(n=0)),r[n].offset},m.addSeconds=function(e,t,r){return h(e.dayNumber,e.secondsOfDay+t,r)},m.addMinutes=function(e,t,r){var n=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return h(e.dayNumber,n,r)},m.addHours=function(e,t,r){var n=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return h(e.dayNumber,n,r)},m.addDays=function(e,t,r){var n=e.dayNumber+t;return h(n,e.secondsOfDay,r)},m.lessThan=function(e,t){return m.compare(e,t)<0},m.lessThanOrEquals=function(e,t){return m.compare(e,t)<=0},m.greaterThan=function(e,t){return m.compare(e,t)>0},m.greaterThanOrEquals=function(e,t){return m.compare(e,t)>=0},m.prototype.clone=function(e){return m.clone(this,e)},m.prototype.equals=function(e){return m.equals(this,e)},m.prototype.equalsEpsilon=function(e,t){return m.equalsEpsilon(this,e,t)},m.prototype.toString=function(){return m.toIso8601(this)},m.leapSeconds=[new u(new m(2441317,43210,c.TAI),10),new u(new m(2441499,43211,c.TAI),11),new u(new m(2441683,43212,c.TAI),12),new u(new m(2442048,43213,c.TAI),13),new u(new m(2442413,43214,c.TAI),14),new u(new m(2442778,43215,c.TAI),15),new u(new m(2443144,43216,c.TAI),16),new u(new m(2443509,43217,c.TAI),17),new u(new m(2443874,43218,c.TAI),18),new u(new m(2444239,43219,c.TAI),19),new u(new m(2444786,43220,c.TAI),20),new u(new m(2445151,43221,c.TAI),21),new u(new m(2445516,43222,c.TAI),22),new u(new m(2446247,43223,c.TAI),23),new u(new m(2447161,43224,c.TAI),24),new u(new m(2447892,43225,c.TAI),25),new u(new m(2448257,43226,c.TAI),26),new u(new m(2448804,43227,c.TAI),27),new u(new m(2449169,43228,c.TAI),28),new u(new m(2449534,43229,c.TAI),29),new u(new m(2450083,43230,c.TAI),30),new u(new m(2450630,43231,c.TAI),31),new u(new m(2451179,43232,c.TAI),32),new u(new m(2453736,43233,c.TAI),33),new u(new m(2454832,43234,c.TAI),34),new u(new m(2456109,43235,c.TAI),35),new u(new m(2457204,43236,c.TAI),36),new u(new m(2457754,43237,c.TAI),37)],m}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(r,n){if(null===r||"object"!=typeof r)return r;n=e(n,!1);var a=new r.constructor;for(var i in r)if(r.hasOwnProperty(i)){var o=r[i];n&&(o=t(o,n)),a[i]=o}return a}return t}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var r=e.split("\r\n"),n=0;n<r.length;++n){var a=r[n],i=a.indexOf(": ");if(i>0){var o=a.substring(0,i),u=a.substring(i+2);t[o]=u}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function r(e,r,n){this.statusCode=e,this.response=r,this.responseHeaders=n,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return r.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},r}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var r=n.exec(t);this.scheme=r[1],this.authority=r[2],this.path=r[3],this.query=r[4],this.fragment=r[5]}}function t(e){var t=unescape(e);return i.test(t)?t:e.toUpperCase()}function r(e,t,r,n){return(t||"")+r.toLowerCase()+(n||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var n=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(o,r).replace(a,t)),this.path&&(this.path=this.path.replace(a,t)),this.query&&(this.query=this.query.replace(a,t)),this.fragment&&(this.fragment=this.fragment.replace(a,t))};var a=/%[0-9a-z]{2}/gi,i=/[a-zA-Z0-9\-\._~]/,o=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var r=new e;return this.scheme?(r.scheme=this.scheme,r.authority=this.authority,r.path=this.path,r.query=this.query):(r.scheme=t.scheme,this.authority?(r.authority=this.authority,r.path=this.path,r.query=this.query):(r.authority=t.authority,""==this.path?(r.path=t.path,r.query=this.query||t.query):("/"==this.path.charAt(0)?(r.path=this.path,r.removeDotSegments()):(t.authority&&""==t.path?r.path="/"+this.path:r.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,r.removeDotSegments()),r.query=this.query))),r.fragment=this.fragment,r},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),r=[],n=""==t[0];n&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?r.pop():"."!=e&&r.push(e);"."!=e&&".."!=e||r.push(""),n&&r.unshift(""),this.path=r.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(r){var n=new e(r);n.normalize();var a=n.getAuthority();if(t(a)){if(a.indexOf("@")!==-1){var i=a.split("@");a=i[1]}if(a.indexOf(":")===-1){var o=n.getScheme();if(t(o)||(o=window.location.protocol,o=o.substring(0,o.length-1)),"http"===o)a+=":80";else{if("https"!==o)return;a+=":443"}}return a}}var a={},i={};return a.add=function(e,r){var n=e.toLowerCase()+":"+r;t(i[n])||(i[n]=!0)},a.remove=function(e,r){var n=e.toLowerCase()+":"+r;t(i[n])&&delete i[n]},a.contains=function(e){var r=n(e);return!(!t(r)||!t(i[r]))},a.clear=function(){i={}},a}),define("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,r,n,a,i,o){"use strict";function u(r){r=t(r,t.EMPTY_OBJECT);var n=r.responseType,a=t(r.method,"GET"),i=r.data,o=r.headers,s=r.overrideMimeType;return e(r.url,function(t){var r=e.defer();return u.load(t,n,a,i,o,r,s),r.promise})}function s(e,t){var r=decodeURIComponent(t);return e?atob(r):r}function c(e,t){for(var r=s(e,t),n=new ArrayBuffer(r.length),a=new Uint8Array(n),i=0;i<r.length;i++)a[i]=r.charCodeAt(i);return n}function l(e,r){r=t(r,"");var n=e[1],a=!!e[2],i=e[3];switch(r){case"":case"text":return s(a,i);case"arraybuffer":return c(a,i);case"blob":var o=c(a,i);return new Blob([o],{type:n});case"document":var u=new DOMParser;return u.parseFromString(s(a,i),n);case"json":return JSON.parse(s(a,i))}}var f=/^data:(.*?)(;base64)?,(.*)$/;return u.load=function(e,t,n,u,s,c,d){var h=f.exec(e);if(null!==h)return void c.resolve(l(h,t));var E=new XMLHttpRequest;if(o.contains(e)&&(E.withCredentials=!0),r(d)&&r(E.overrideMimeType)&&E.overrideMimeType(d),E.open(n,e,!0),r(s))for(var m in s)s.hasOwnProperty(m)&&E.setRequestHeader(m,s[m]);r(t)&&(E.responseType=t),E.onload=function(){if(E.status<200||E.status>=300)return void c.reject(new a(E.status,E.response,E.getAllResponseHeaders()));var e=E.response,n=E.responseType;if(!r(e)||r(t)&&n!==t)if("json"===t&&"string"==typeof e)try{c.resolve(JSON.parse(e))}catch(e){c.reject(e)}else(""===n||"document"===n)&&r(E.responseXML)&&E.responseXML.hasChildNodes()?c.resolve(E.responseXML):""!==n&&"text"!==n||!r(E.responseText)?c.reject(new i("Invalid XMLHttpRequest response type.")):c.resolve(E.responseText);else c.resolve(e)},E.onerror=function(e){c.reject(new a)},E.send(u)},u.defaultLoad=u.load,u}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,r){return e({url:t,headers:r})}return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,r,n){"use strict";function a(r,a){return t(a)?t(a.Accept)||(a=e(a),a.Accept=i.Accept):a=i,n(r,a).then(function(e){return JSON.parse(e)})}var i={Accept:"application/json,*/*;q=0.01"};return a}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,r,n,a,i,o,u,s,c,l,f){"use strict";function d(t){if(t=r(t,r.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=r(t.addNewLeapSeconds,!0),n(t.data))E(this,t.data);else if(n(t.url)){var a=this;this._downloadPromise=e(s(t.url),function(e){E(a,e)},function(){a._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else E(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function h(e,t){return o.compare(e.julianDate,t)}function E(e,r){if(!n(r.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!n(r.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var a=r.columnNames.indexOf("modifiedJulianDateUtc"),i=r.columnNames.indexOf("xPoleWanderRadians"),s=r.columnNames.indexOf("yPoleWanderRadians"),c=r.columnNames.indexOf("ut1MinusUtcSeconds"),d=r.columnNames.indexOf("xCelestialPoleOffsetRadians"),E=r.columnNames.indexOf("yCelestialPoleOffsetRadians"),m=r.columnNames.indexOf("taiMinusUtcSeconds");if(a<0||i<0||s<0||c<0||d<0||E<0||m<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var p=e._samples=r.samples,y=e._dates=[];e._dateColumn=a,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=d,e._yCelestialPoleOffsetRadiansColumn=E,e._taiMinusUtcSecondsColumn=m,e._columnCount=r.columnNames.length,e._lastIndex=void 0;for(var _,T=e._addNewLeapSeconds,R=0,v=p.length;R<v;R+=e._columnCount){var A=p[R+a],S=p[R+m],N=A+l.MODIFIED_JULIAN_DATE_DIFFERENCE,I=new o(N,S,f.TAI);if(y.push(I),T){if(S!==_&&n(_)){var g=o.leapSeconds,O=t(g,I,h);if(O<0){var M=new u(I,S);g.splice(~O,0,M)}}_=S}}}function m(e,t,r,n,a){var i=r*n;a.xPoleWander=t[i+e._xPoleWanderRadiansColumn],a.yPoleWander=t[i+e._yPoleWanderRadiansColumn],a.xPoleOffset=t[i+e._xCelestialPoleOffsetRadiansColumn],a.yPoleOffset=t[i+e._yCelestialPoleOffsetRadiansColumn],a.ut1MinusUtc=t[i+e._ut1MinusUtcSecondsColumn]}function p(e,t,r){return t+e*(r-t)}function y(e,t,r,n,a,i,u){var s=e._columnCount;if(i>t.length-1)return u.xPoleWander=0,u.yPoleWander=0,u.xPoleOffset=0,u.yPoleOffset=0,u.ut1MinusUtc=0,u;var c=t[a],l=t[i];if(c.equals(l)||n.equals(c))return m(e,r,a,s,u),u;if(n.equals(l))return m(e,r,i,s,u),u;var f=o.secondsDifference(n,c)/o.secondsDifference(l,c),d=a*s,h=i*s,E=r[d+e._ut1MinusUtcSecondsColumn],y=r[h+e._ut1MinusUtcSecondsColumn],_=y-E;if(_>.5||_<-.5){var T=r[d+e._taiMinusUtcSecondsColumn],R=r[h+e._taiMinusUtcSecondsColumn];T!==R&&(l.equals(n)?E=y:y-=R-T)}return u.xPoleWander=p(f,r[d+e._xPoleWanderRadiansColumn],r[h+e._xPoleWanderRadiansColumn]),u.yPoleWander=p(f,r[d+e._yPoleWanderRadiansColumn],r[h+e._yPoleWanderRadiansColumn]),u.xPoleOffset=p(f,r[d+e._xCelestialPoleOffsetRadiansColumn],r[h+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=p(f,r[d+e._yCelestialPoleOffsetRadiansColumn],r[h+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=p(f,E,y),u}return d.NONE=i({getPromiseToLoad:function(){return e()},compute:function(e,t){return n(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new a(0,0,0,0,0),t}}),d.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},d.prototype.compute=function(e,r){if(n(this._samples)){if(n(r)||(r=new a(0,0,0,0,0)),0===this._samples.length)return r.xPoleWander=0,r.yPoleWander=0,r.xPoleOffset=0,r.yPoleOffset=0,r.ut1MinusUtc=0,r;var i=this._dates,u=this._lastIndex,s=0,l=0;if(n(u)){var f=i[u],d=i[u+1],h=o.lessThanOrEquals(f,e),E=!n(d),m=E||o.greaterThanOrEquals(d,e);if(h&&m)return s=u,!E&&d.equals(e)&&++s,l=s+1,y(this,i,this._samples,e,s,l,r),r}var p=t(i,e,o.compare,this._dateColumn);return p>=0?(p<i.length-1&&i[p+1].equals(e)&&++p,s=p,l=p):(l=~p,s=l-1,s<0&&(s=0)),this._lastIndex=s,y(this,i,this._samples,e,s,l,r),r}if(n(this._dataError))throw new c(this._dataError)},d}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,r,n){"use strict";function a(t,r,n){this.heading=e(t,0),this.pitch=e(r,0),this.roll=e(n,0)}return a.fromQuaternion=function(e,r){t(r)||(r=new a);var n=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return r.heading=-Math.atan2(s,u),r.roll=Math.atan2(o,i),r.pitch=-Math.asin(n),r},a.fromDegrees=function(e,r,i,o){return t(o)||(o=new a),o.heading=e*n.RADIANS_PER_DEGREE,o.pitch=r*n.RADIANS_PER_DEGREE,o.roll=i*n.RADIANS_PER_DEGREE, -o},a.clone=function(e,r){if(t(e))return t(r)?(r.heading=e.heading,r.pitch=e.pitch,r.roll=e.roll,r):new a(e.heading,e.pitch,e.roll)},a.equals=function(e,r){return e===r||t(e)&&t(r)&&e.heading===r.heading&&e.pitch===r.pitch&&e.roll===r.roll},a.equalsEpsilon=function(e,r,a,i){return e===r||t(e)&&t(r)&&n.equalsEpsilon(e.heading,r.heading,a,i)&&n.equalsEpsilon(e.pitch,r.pitch,a,i)&&n.equalsEpsilon(e.roll,r.roll,a,i)},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,r){return a.equalsEpsilon(this,e,t,r)},a.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},a}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function a(r,n){n=t(n,document.location.href);var a=new e(n),i=new e(r);return i.resolve(a).toString()}return a}),define("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function a(n,a,i){i=t(i,!0),n instanceof e||(n=new e(n)),a instanceof e||(a=new e(a)),r(a.authority)&&!r(a.scheme)&&("undefined"!=typeof document&&r(document.location)&&r(document.location.href)?a.scheme=new e(document.location.href).scheme:a.scheme=n.scheme);var o=n;a.isAbsolute()&&(o=a);var u="";r(o.scheme)&&(u+=o.scheme+":"),r(o.authority)&&(u+="//"+o.authority,""!==o.path&&"/"!==o.path&&(u=u.replace(/\/?$/,"/"),o.path=o.path.replace(/^\/?/g,""))),u+=o===n?i?n.path.replace(/\/?$/,"/")+a.path.replace(/^\/?/g,""):n.path+a.path:a.path;var s=r(n.query),c=r(a.query);s&&c?u+="?"+n.query+"&"+a.query:s&&!c?u+="?"+n.query:!s&&c&&(u+="?"+a.query);var l=r(a.fragment);return r(n.fragment)&&!l?u+="#"+n.fragment:l&&(u+="#"+a.fragment),u}return a}),define("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","./joinUrls","require"],function(e,t,r,n,a,i){"use strict";function o(){for(var e=document.getElementsByTagName("script"),t=0,r=e.length;t<r;++t){var n=e[t].getAttribute("src"),a=E.exec(n);if(null!==a)return a[1]}}function u(){if(t(f))return f;var r;return r="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:o(),f=new e(n(r))}function s(e){return i.toUrl("../"+e)}function c(e){return a(u(),e)}function l(e){t(d)||(d=t(i.toUrl)?s:c),t(h)||(h=document.createElement("a"));var r=d(e);return h.href=r,h.href=h.href,h.href}var f,d,h,E=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return l._cesiumScriptRegex=E,l.setBaseUrl=function(t){f=new e(t).resolve(new e(document.location.href))},l}),define("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,r){this.x=e,this.y=t,this.s=r}return e}),define("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,r,n,a,i,o,u){"use strict";function s(e){e=r(e,r.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=r(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=r(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new i(this._sampleZeroJulianEphemerisDate,0,u.TAI),this._stepSizeDays=r(e.stepSizeDays,1),this._samplesPerXysFile=r(e.samplesPerXysFile,1e3),this._totalSamples=r(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,n=this._denominators=new Array(t+1),a=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t),s=0;s<=t;++s){n[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;c<=t;++c)c!==s&&(n[s]*=s-c);n[s]=1/n[s]}this._work=new Array(t+1),this._coef=new Array(t+1)}function c(e,t,r){var n=f;return n.dayNumber=t,n.secondsOfDay=r,i.daysDifference(n,e._sampleZeroDateTT)}function l(r,a){if(r._chunkDownloadsInProgress[a])return r._chunkDownloadsInProgress[a];var i=e.defer();r._chunkDownloadsInProgress[a]=i;var u,s=r._xysFileUrlTemplate;return u=n(s)?s.replace("{0}",a):t("Assets/IAU2006_XYS/IAU2006_XYS_"+a+".json"),e(o(u),function(e){r._chunkDownloadsInProgress[a]=!1;for(var t=r._samples,n=e.samples,o=a*r._samplesPerXysFile*3,u=0,s=n.length;u<s;++u)t[o+u]=n[u];i.resolve()}),i.promise}var f=new i(0,0,u.TAI);return s.prototype.preload=function(t,r,n,a){var i=c(this,t,r),o=c(this,n,a),u=i/this._stepSizeDays-this._interpolationOrder/2|0;u<0&&(u=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var f=u/this._samplesPerXysFile|0,d=s/this._samplesPerXysFile|0,h=[],E=f;E<=d;++E)h.push(l(this,E));return e.all(h)},s.prototype.computeXysRadians=function(e,t,r){var i=c(this,e,t);if(!(i<0)){var o=i/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);s<0&&(s=0);var f=s+u;f>=this._totalSamples&&(f=this._totalSamples-1,s=f-u,s<0&&(s=0));var d=!1,h=this._samples;if(n(h[3*s])||(l(this,s/this._samplesPerXysFile|0),d=!0),n(h[3*f])||(l(this,f/this._samplesPerXysFile|0),d=!0),!d){n(r)?(r.x=0,r.y=0,r.s=0):r=new a(0,0,0);var E,m,p=i-s*this._stepSizeDays,y=this._work,_=this._denominators,T=this._coef,R=this._xTable;for(E=0;E<=u;++E)y[E]=p-R[E];for(E=0;E<=u;++E){for(T[E]=1,m=0;m<=u;++m)m!==E&&(T[E]*=y[m]);T[E]*=_[E];var v=3*(s+E);r.x+=T[E]*h[v++],r.y+=T[E]*h[v++],r.s+=T[E]*h[v]}return r}}}},s}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./defaultValue","./defined","./deprecationWarning","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./HeadingPitchRoll","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,r,n,a,i,o,u,s,c,l,f,d,h,E,m,p,y,_,T,R){"use strict";var v={},A=new r,S=new r,N=new r;v.eastNorthUpToFixedFrame=function(e,t,n){if(p.equalsEpsilon(e.x,0,p.EPSILON14)&&p.equalsEpsilon(e.y,0,p.EPSILON14)){var a=p.sign(e.z);return o(n)?(n[0]=0,n[1]=1,n[2]=0,n[3]=0,n[4]=-a,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=a,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new _(0,-a,0,e.x,1,0,0,e.y,0,0,a,e.z,0,0,0,1)}var u=A,s=S,c=N;return t=i(t,f.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,r.normalize(s,s),r.cross(u,s,c),o(n)?(n[0]=s.x,n[1]=s.y,n[2]=s.z,n[3]=0,n[4]=c.x,n[5]=c.y,n[6]=c.z,n[7]=0,n[8]=u.x,n[9]=u.y,n[10]=u.z,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new _(s.x,c.x,u.x,e.x,s.y,c.y,u.y,e.y,s.z,c.z,u.z,e.z,0,0,0,1)};var I=new r,g=new r,O=new r;v.northEastDownToFixedFrame=function(e,t,n){if(p.equalsEpsilon(e.x,0,p.EPSILON14)&&p.equalsEpsilon(e.y,0,p.EPSILON14)){var a=p.sign(e.z);return o(n)?(n[0]=-a,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=1,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=-a,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new _(-a,0,0,e.x,0,1,0,e.y,0,0,-a,e.z,0,0,0,1)}var u=I,s=g,c=O;return t=i(t,f.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,r.normalize(s,s),r.cross(u,s,c),o(n)?(n[0]=c.x,n[1]=c.y,n[2]=c.z,n[3]=0,n[4]=s.x,n[5]=s.y,n[6]=s.z,n[7]=0,n[8]=-u.x,n[9]=-u.y,n[10]=-u.z,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new _(c.x,s.x,-u.x,e.x,c.y,s.y,-u.y,e.y,c.z,s.z,-u.z,e.z,0,0,0,1)},v.northUpEastToFixedFrame=function(e,t,n){if(p.equalsEpsilon(e.x,0,p.EPSILON14)&&p.equalsEpsilon(e.y,0,p.EPSILON14)){var a=p.sign(e.z);return o(n)?(n[0]=-a,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=a,n[7]=0,n[8]=0,n[9]=1,n[10]=0,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new _(-a,0,0,e.x,0,0,1,e.y,0,a,0,e.z,0,0,0,1)}var u=A,s=S,c=N;return t=i(t,f.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,r.normalize(s,s),r.cross(u,s,c),o(n)?(n[0]=c.x,n[1]=c.y,n[2]=c.z,n[3]=0,n[4]=u.x,n[5]=u.y,n[6]=u.z,n[7]=0,n[8]=s.x,n[9]=s.y,n[10]=s.z,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new _(c.x,u.x,s.x,e.x,c.y,u.y,s.y,e.y,c.z,u.z,s.z,e.z,0,0,0,1)},v.northWestUpToFixedFrame=function(e,t,n){if(p.equalsEpsilon(e.x,0,p.EPSILON14)&&p.equalsEpsilon(e.y,0,p.EPSILON14)){var a=p.sign(e.z);return o(n)?(n[0]=-a,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=-1,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=a,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new _(-a,0,0,e.x,0,-1,0,e.y,0,0,a,e.z,0,0,0,1)}var u=A,s=S,c=N;return t=i(t,f.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,r.normalize(s,s),r.cross(u,s,c),o(n)?(n[0]=c.x,n[1]=c.y,n[2]=c.z,n[3]=0,n[4]=-s.x,n[5]=-s.y,n[6]=-s.z,n[7]=0,n[8]=u.x,n[9]=u.y,n[10]=u.z,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new _(c.x,-s.x,u.x,e.x,c.y,-s.y,u.y,e.y,c.z,-s.z,u.z,e.z,0,0,0,1)};var M=new T,w=new r(1,1,1),x=new _;v.headingPitchRollToFixedFrame=function(e,t,n,a,i,o){var s;"object"==typeof t?(i=n,o=a,s=t.heading,n=t.pitch,a=t.roll):(u("headingPitchRollToFixedFrame","headingPitchRollToFixedFrame with separate heading, pitch, and roll arguments was deprecated in 1.27. It will be removed in 1.30. Use a HeadingPitchRoll object."),s=t);var c=T.fromHeadingPitchRoll(s,n,a,M),l=_.fromTranslationQuaternionRotationScale(r.ZERO,c,w,x);return o=v.eastNorthUpToFixedFrame(e,i,o),_.multiply(o,l,o)};var C=new d,P=new _,D=new y;v.headingPitchRollQuaternion=function(e,t,r,n,a,i){var o;"object"==typeof t?(o=t,a=r,i=n):(u("headingPitchRollQuaternion","headingPitchRollQuaternion with separate heading, pitch, and roll arguments was deprecated in 1.27. It will be removed in 1.30. Use a HeadingPitchRoll object."),C.heading=t,C.pitch=r,C.roll=n,o=C);var s=v.headingPitchRollToFixedFrame(e,o,a,P),c=_.getRotation(s,D);return T.fromRotationMatrix(c,i)};var L=24110.54841,U=8640184.812866,b=.093104,F=-62e-7,z=1.1772758384668e-19,B=72921158553e-15,G=p.TWO_PI/86400,q=new m;v.computeTemeToPseudoFixedMatrix=function(e,t){q=m.addSeconds(e,-m.computeTaiMinusUtc(e),q);var r,n=q.dayNumber,a=q.secondsOfDay,i=n-2451545;r=a>=43200?(i+.5)/R.DAYS_PER_JULIAN_CENTURY:(i-.5)/R.DAYS_PER_JULIAN_CENTURY;var u=L+r*(U+r*(b+r*F)),s=u*G%p.TWO_PI,c=B+z*(n-2451545.5),l=(a+.5*R.SECONDS_PER_DAY)%R.SECONDS_PER_DAY,f=s+c*l,d=Math.cos(f),h=Math.sin(f);return o(t)?(t[0]=d,t[1]=-h,t[2]=0,t[3]=h,t[4]=d,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new y(d,h,0,-h,d,0,0,0,1)},v.iau2006XysData=new h,v.earthOrientationParameters=c.NONE;var V=32.184,W=2451545;v.preloadIcrfFixed=function(t){var r=t.start.dayNumber,n=t.start.secondsOfDay+V,a=t.stop.dayNumber,i=t.stop.secondsOfDay+V,o=v.iau2006XysData.preload(r,n,a,i),u=v.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},v.computeIcrfToFixedMatrix=function(e,t){o(t)||(t=new y);var r=v.computeFixedToIcrfMatrix(e,t);if(o(r))return y.transpose(r,t)};var X=new E(0,0,0),H=new l(0,0,0,0,0,0),Y=new y,k=new y;v.computeFixedToIcrfMatrix=function(e,t){o(t)||(t=new y);var r=v.earthOrientationParameters.compute(e,H);if(o(r)){var n=e.dayNumber,a=e.secondsOfDay+V,i=v.iau2006XysData.computeXysRadians(n,a,X);if(o(i)){var u=i.x+r.xPoleOffset,s=i.y+r.yPoleOffset,c=1/(1+Math.sqrt(1-u*u-s*s)),l=Y;l[0]=1-c*u*u,l[3]=-c*u*s,l[6]=u,l[1]=-c*u*s,l[4]=1-c*s*s,l[7]=s,l[2]=-u,l[5]=-s,l[8]=1-c*(u*u+s*s);var f=y.fromRotationZ(-i.s,k),d=y.multiply(l,f,Y),h=e.dayNumber,E=e.secondsOfDay-m.computeTaiMinusUtc(e)+r.ut1MinusUtc,_=h-2451545,T=E/R.SECONDS_PER_DAY,A=.779057273264+T+.00273781191135448*(_+T);A=A%1*p.TWO_PI;var S=y.fromRotationZ(A,k),N=y.multiply(d,S,Y),I=Math.cos(r.xPoleWander),g=Math.cos(r.yPoleWander),O=Math.sin(r.xPoleWander),M=Math.sin(r.yPoleWander),w=n-W+a/R.SECONDS_PER_DAY;w/=36525;var x=-47e-6*w*p.RADIANS_PER_DEGREE/3600,C=Math.cos(x),P=Math.sin(x),D=k;return D[0]=I*C,D[1]=I*P,D[2]=O,D[3]=-g*P+M*O*C,D[4]=g*C+M*O*P,D[5]=-M*I,D[6]=-M*P-g*O*C,D[7]=M*C-g*O*P,D[8]=g*I,y.multiply(N,D,t)}}};var j=new n;v.pointToWindowCoordinates=function(e,t,r,n){return n=v.pointToGLWindowCoordinates(e,t,r,n),n.y=2*t[5]-n.y,n},v.pointToGLWindowCoordinates=function(e,r,a,i){o(i)||(i=new t);var u=j;return _.multiplyByVector(e,n.fromElements(a.x,a.y,a.z,1,u),u),n.multiplyByScalar(u,1/u.w,u),_.multiplyByVector(r,u,u),t.fromCartesian4(u,i)};var Z=new r,K=new r,J=new r;v.rotationMatrixFromPositionVelocity=function(e,t,n,a){var u=i(n,f.WGS84).geodeticSurfaceNormal(e,Z),s=r.cross(t,u,K);r.equalsEpsilon(s,r.ZERO,p.EPSILON6)&&(s=r.clone(r.UNIT_X,s));var c=r.cross(s,t,J);return r.cross(t,c,s),r.negate(s,s),o(a)||(a=new y),a[0]=t.x,a[1]=t.y,a[2]=t.z,a[3]=s.x,a[4]=s.y,a[5]=s.z,a[6]=c.x,a[7]=c.y,a[8]=c.z,a};var Q=new a,$=new r,ee=new r,te=new n,re=new n,ne=new n,ae=new n,ie=new n,oe=new _,ue=new _;return v.basisTo2D=function(e,t,a){var i=e.ellipsoid,o=_.getColumn(t,3,te),u=i.cartesianToCartographic(o,Q),s=v.eastNorthUpToFixedFrame(o,i,oe),c=_.inverseTransformation(s,ue),l=e.project(u,$),f=re;f.x=l.z,f.y=l.x,f.z=l.y,f.w=1;var d=_.getColumn(t,0,ee),h=r.magnitude(d),E=_.multiplyByVector(c,d,ne);n.fromElements(E.z,E.x,E.y,0,E);var m=_.getColumn(t,1,ee),p=r.magnitude(m),y=_.multiplyByVector(c,m,ae);n.fromElements(y.z,y.x,y.y,0,y);var T=_.getColumn(t,2,ee),R=r.magnitude(T),A=ie;return r.cross(E,y,A),r.normalize(A,A),r.cross(y,A,E),r.normalize(E,E),r.cross(A,E,y),r.normalize(y,y),r.multiplyByScalar(E,h,E),r.multiplyByScalar(y,p,y),r.multiplyByScalar(A,R,A),_.setColumn(a,0,E,a),_.setColumn(a,1,y,a),_.setColumn(a,2,A,a),_.setColumn(a,3,f,a),a},v}),define("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,r,n){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.position=e(t.position,!1),this.normal=e(t.normal,!1),this.st=e(t.st,!1),this.binormal=e(t.binormal,!1),this.tangent=e(t.tangent,!1),this.color=e(t.color,!1)}return a.POSITION_ONLY=n(new a({position:!0})),a.POSITION_AND_NORMAL=n(new a({position:!0,normal:!0})),a.POSITION_NORMAL_AND_ST=n(new a({position:!0,normal:!0,st:!0})),a.POSITION_AND_ST=n(new a({position:!0,st:!0})),a.POSITION_AND_COLOR=n(new a({position:!0,color:!0})),a.ALL=n(new a({position:!0,normal:!0,st:!0,binormal:!0,tangent:!0})),a.DEFAULT=a.POSITION_NORMAL_AND_ST,a.packedLength=6,a.pack=function(t,r,n){return n=e(n,0),r[n++]=t.position?1:0,r[n++]=t.normal?1:0,r[n++]=t.st?1:0,r[n++]=t.binormal?1:0,r[n++]=t.tangent?1:0,r[n++]=t.color?1:0,r},a.unpack=function(r,n,i){return n=e(n,0),t(i)||(i=new a),i.position=1===r[n++],i.normal=1===r[n++],i.st=1===r[n++],i.binormal=1===r[n++],i.tangent=1===r[n++],i.color=1===r[n++],i},a.clone=function(e,r){if(t(e))return t(r)||(r=new a),r.position=e.position,r.normal=e.normal,r.st=e.st,r.binormal=e.binormal,r.tangent=e.tangent,r.color=e.color,r},a}),define("Core/EllipseGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError","./EllipseGeometryLibrary","./Ellipsoid","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix3","./Matrix4","./PrimitiveType","./Quaternion","./Rectangle","./Transforms","./VertexFormat"],function(e,t,r,n,a,i,o,u,s,c,l,f,d,h,E,m,p,y,_,T,R,v,A,S,N,I){"use strict";function g(e,n,i){var o=n.vertexFormat,u=n.center,s=n.semiMajorAxis,l=n.semiMinorAxis,d=n.ellipsoid,m=n.stRotation,p=i?e.length/3*2:e.length/3,y=o.st?new Float32Array(2*p):void 0,_=o.normal?new Float32Array(3*p):void 0,R=o.tangent?new Float32Array(3*p):void 0,v=o.binormal?new Float32Array(3*p):void 0,S=0,N=q,I=V,g=W,O=new f(d),M=O.project(d.cartesianToCartographic(u,X),H),w=d.scaleToGeodeticSurface(u,L);d.geodeticSurfaceNormal(w,w);for(var x=A.fromAxisAngle(w,m,G),C=T.fromQuaternion(x,B),P=t.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Y),D=t.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,k),F=e.length,j=i?F:0,Z=j/3*2,K=0;K<F;K+=3){var J=K+1,Q=K+2,$=r.fromArray(e,K,L);if(o.st){var ee=T.multiplyByVector(C,$,U),te=O.project(d.cartesianToCartographic(ee,X),b);r.subtract(te,M,te),z.x=(te.x+s)/(2*s),z.y=(te.y+l)/(2*l),P.x=Math.min(z.x,P.x),P.y=Math.min(z.y,P.y),D.x=Math.max(z.x,D.x),D.y=Math.max(z.y,D.y),i&&(y[S+Z]=z.x,y[S+1+Z]=z.y),y[S++]=z.x,y[S++]=z.y}N=d.geodeticSurfaceNormal($,N),(o.normal||o.tangent||o.binormal)&&((o.tangent||o.binormal)&&(I=r.normalize(r.cross(r.UNIT_Z,N,I),I),T.multiplyByVector(C,I,I)),o.normal&&(_[K]=N.x,_[J]=N.y,_[Q]=N.z,i&&(_[K+j]=-N.x,_[J+j]=-N.y,_[Q+j]=-N.z)),o.tangent&&(R[K]=I.x,R[J]=I.y,R[Q]=I.z,i&&(R[K+j]=-I.x,R[J+j]=-I.y,R[Q+j]=-I.z)),o.binormal&&(g=r.normalize(r.cross(N,I,g),g),v[K]=g.x,v[J]=g.y,v[Q]=g.z,i&&(v[K+j]=g.x,v[J+j]=g.y,v[Q+j]=g.z)))}if(o.st){F=y.length;for(var re=0;re<F;re+=2)y[re]=(y[re]-P.x)/(D.x-P.x),y[re+1]=(y[re+1]-P.y)/(D.y-P.y)}var ne=new E;if(o.position){var ae=c.raisePositionsToHeight(e,n,i);ne.position=new h({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:ae})}return o.st&&(ne.st=new h({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:y})),o.normal&&(ne.normal=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:_})),o.tangent&&(ne.tangent=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:R})),o.binormal&&(ne.binormal=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:v})),ne}function O(e){var t,r,n,a,i,o=new Array(12*(e*(e+1))-6),u=0;for(t=0,n=1,a=0;a<3;a++)o[u++]=n++,o[u++]=t,o[u++]=n;for(a=2;a<e+1;++a){for(n=a*(a+1)-1,t=(a-1)*a-1,o[u++]=n++,o[u++]=t,o[u++]=n,r=2*a,i=0;i<r-1;++i)o[u++]=n,o[u++]=t++,o[u++]=t,o[u++]=n++,o[u++]=t,o[u++]=n;o[u++]=n++,o[u++]=t,o[u++]=n}for(r=2*e,++n,++t,a=0;a<r-1;++a)o[u++]=n,o[u++]=t++,o[u++]=t,o[u++]=n++,o[u++]=t,o[u++]=n;for(o[u++]=n,o[u++]=t++,o[u++]=t,o[u++]=n++,o[u++]=t++,o[u++]=t,++t,a=e-1;a>1;--a){for(o[u++]=t++,o[u++]=t,o[u++]=n,r=2*a,i=0;i<r-1;++i)o[u++]=n,o[u++]=t++,o[u++]=t,o[u++]=n++,o[u++]=t,o[u++]=n;o[u++]=t++,o[u++]=t++,o[u++]=n++}for(a=0;a<3;a++)o[u++]=t++,o[u++]=t,o[u++]=n;return o}function M(t){var n=t.center;j=r.multiplyByScalar(t.ellipsoid.geodeticSurfaceNormal(n,j),t.height,j),j=r.add(n,j,j);var a=new e(j,t.semiMajorAxis),i=c.computeEllipsePositions(t,!0,!1),o=i.positions,u=i.numPts,s=g(o,t,!1),l=O(u);return l=y.createTypedArray(o.length/3,l),{boundingSphere:a,attributes:s,indices:l}}function w(e,n){var i=n.vertexFormat,o=n.center,u=n.semiMajorAxis,s=n.semiMinorAxis,c=n.ellipsoid,l=n.height,d=n.extrudedHeight,m=n.stRotation,p=e.length/3*2,y=new Float64Array(3*p),_=i.st?new Float32Array(2*p):void 0,R=i.normal?new Float32Array(3*p):void 0,v=i.tangent?new Float32Array(3*p):void 0,S=i.binormal?new Float32Array(3*p):void 0,N=0,I=q,g=V,O=W,M=new f(c),w=M.project(c.cartesianToCartographic(o,X),H),x=c.scaleToGeodeticSurface(o,L);c.geodeticSurfaceNormal(x,x);for(var C=A.fromAxisAngle(x,m,G),P=T.fromQuaternion(C,B),D=t.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Y),j=t.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,k),Z=e.length,K=Z/3*2,J=0;J<Z;J+=3){var Q,$=J+1,ee=J+2,te=r.fromArray(e,J,L);if(i.st){var re=T.multiplyByVector(P,te,U),ne=M.project(c.cartesianToCartographic(re,X),b);r.subtract(ne,w,ne),z.x=(ne.x+u)/(2*u),z.y=(ne.y+s)/(2*s),D.x=Math.min(z.x,D.x),D.y=Math.min(z.y,D.y),j.x=Math.max(z.x,j.x),j.y=Math.max(z.y,j.y),_[N+K]=z.x,_[N+1+K]=z.y,_[N++]=z.x,_[N++]=z.y}te=c.scaleToGeodeticSurface(te,te),Q=r.clone(te,U),I=c.geodeticSurfaceNormal(te,I);var ae=r.multiplyByScalar(I,l,F);if(te=r.add(te,ae,te),ae=r.multiplyByScalar(I,d,ae),Q=r.add(Q,ae,Q),i.position&&(y[J+Z]=Q.x,y[$+Z]=Q.y,y[ee+Z]=Q.z,y[J]=te.x,y[$]=te.y,y[ee]=te.z),i.normal||i.tangent||i.binormal){O=r.clone(I,O);var ie=r.fromArray(e,(J+3)%Z,F);r.subtract(ie,te,ie);var oe=r.subtract(Q,te,b);I=r.normalize(r.cross(oe,ie,I),I),i.normal&&(R[J]=I.x,R[$]=I.y,R[ee]=I.z,R[J+Z]=I.x,R[$+Z]=I.y,R[ee+Z]=I.z),i.tangent&&(g=r.normalize(r.cross(O,I,g),g),v[J]=g.x,v[$]=g.y,v[ee]=g.z,v[J+Z]=g.x,v[J+1+Z]=g.y,v[J+2+Z]=g.z),i.binormal&&(S[J]=O.x,S[$]=O.y,S[ee]=O.z,S[J+Z]=O.x,S[$+Z]=O.y,S[ee+Z]=O.z)}}if(i.st){Z=_.length;for(var ue=0;ue<Z;ue+=2)_[ue]=(_[ue]-D.x)/(j.x-D.x),_[ue+1]=(_[ue+1]-D.y)/(j.y-D.y)}var se=new E;return i.position&&(se.position=new h({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:y})),i.st&&(se.st=new h({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:_})),i.normal&&(se.normal=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:R})),i.tangent&&(se.tangent=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:v})),i.binormal&&(se.binormal=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:S})),se}function x(e){for(var t=e.length/3,r=y.createTypedArray(t,6*t),n=0,a=0;a<t;a++){var i=a,o=a+t,u=(i+1)%t,s=u+t;r[n++]=i,r[n++]=o,r[n++]=u,r[n++]=u,r[n++]=o,r[n++]=s}return r}function C(t){var n=t.center,a=t.ellipsoid,i=t.semiMajorAxis,o=r.multiplyByScalar(a.geodeticSurfaceNormal(n,L),t.height,L);Z.center=r.add(n,o,Z.center),Z.radius=i,o=r.multiplyByScalar(a.geodeticSurfaceNormal(n,o),t.extrudedHeight,o),K.center=r.add(n,o,K.center),K.radius=i;var u=c.computeEllipsePositions(t,!0,!0),s=u.positions,l=u.numPts,f=u.outerPositions,h=e.union(Z,K),E=g(s,t,!0),_=O(l),T=_.length;_.length=2*T;for(var R=s.length/3,A=0;A<T;A+=3)_[A+T]=_[A+2]+R,_[A+1+T]=_[A+1]+R,_[A+2+T]=_[A]+R;var S=y.createTypedArray(2*R/3,_),N=new d({attributes:E,indices:S,primitiveType:v.TRIANGLES}),I=w(f,t);_=x(f);var M=y.createTypedArray(2*f.length/3,_),C=new d({attributes:I,indices:M,primitiveType:v.TRIANGLES}),P=p.combineInstances([new m({geometry:N}),new m({geometry:C})]);return{boundingSphere:h,attributes:P[0].attributes,indices:P[0].indices}}function P(e,t,n,a,i){N.eastNorthUpToFixedFrame(e,t,J),R.inverseTransformation(J,Q);for(var o=0;o<4;++o)r.clone(r.ZERO,ee[o]);for(ee[0].x+=n,ee[1].x-=n,ee[2].y+=a,ee[3].y-=a,T.fromRotationZ(i,$),o=0;o<4;++o)T.multiplyByVector($,ee[o],ee[o]),R.multiplyByPoint(J,ee[o],ee[o]),t.cartesianToCartographic(ee[o],te[o]);return S.fromCartographicArray(te)}function D(e){e=i(e,i.EMPTY_OBJECT);var t=e.center,n=i(e.ellipsoid,l.WGS84),a=e.semiMajorAxis,u=e.semiMinorAxis,s=i(e.granularity,_.RADIANS_PER_DEGREE),c=i(e.height,0),f=e.extrudedHeight,d=o(f)&&Math.abs(c-f)>1,h=i(e.vertexFormat,I.DEFAULT);this._center=r.clone(t),this._semiMajorAxis=a,this._semiMinorAxis=u,this._ellipsoid=l.clone(n),this._rotation=i(e.rotation,0),this._stRotation=i(e.stRotation,0),this._height=c,this._granularity=s,this._vertexFormat=I.clone(h),this._extrudedHeight=i(f,c),this._extrude=d,this._workerName="createEllipseGeometry",this._rectangle=P(this._center,this._ellipsoid,a,u,this._rotation)}var L=new r,U=new r,b=new r,F=new r,z=new t,B=new T,G=new A,q=new r,V=new r,W=new r,X=new n,H=new r,Y=new t,k=new t,j=new r,Z=new e,K=new e,J=new R,Q=new R,$=new T,ee=[new r,new r,new r,new r],te=[new n,new n,new n,new n];D.packedLength=r.packedLength+l.packedLength+I.packedLength+S.packedLength+8,D.pack=function(e,t,n){return n=i(n,0),r.pack(e._center,t,n),n+=r.packedLength,l.pack(e._ellipsoid,t,n),n+=l.packedLength,I.pack(e._vertexFormat,t,n),n+=I.packedLength,S.pack(e._rectangle,t,n),n+=S.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n]=e._extrude?1:0,t};var re=new r,ne=new l,ae=new I,ie=new S,oe={center:re,ellipsoid:ne,vertexFormat:ae,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0};return D.unpack=function(e,t,n){t=i(t,0);var a=r.unpack(e,t,re);t+=r.packedLength;var u=l.unpack(e,t,ne);t+=l.packedLength;var s=I.unpack(e,t,ae);t+=I.packedLength;var c=S.unpack(e,t,ie);t+=S.packedLength;var f=e[t++],d=e[t++],h=e[t++],E=e[t++],m=e[t++],p=e[t++],y=e[t++],_=1===e[t];return o(n)?(n._center=r.clone(a,n._center),n._ellipsoid=l.clone(u,n._ellipsoid),n._vertexFormat=I.clone(s,n._vertexFormat),n._semiMajorAxis=f,n._semiMinorAxis=d,n._rotation=h,n._stRotation=E,n._height=m,n._granularity=p,n._extrudedHeight=y,n._extrude=_,n._rectangle=S.clone(c),n):(oe.height=m,oe.extrudedHeight=y,oe.granularity=p,oe.stRotation=E,oe.rotation=h,oe.semiMajorAxis=f,oe.semiMinorAxis=d,new D(oe))},D.createGeometry=function(e){if(!(e._semiMajorAxis<=0||e._semiMinorAxis<=0)){e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);var t,r={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:e._height,extrudedHeight:e._extrudedHeight,granularity:e._granularity,vertexFormat:e._vertexFormat,stRotation:e._stRotation};return e._extrude?(r.extrudedHeight=Math.min(e._extrudedHeight,e._height),r.height=Math.max(e._extrudedHeight,e._height),t=C(r)):t=M(r),new d({attributes:t.attributes,indices:t.indices,primitiveType:v.TRIANGLES,boundingSphere:t.boundingSphere})}},D.createShadowVolume=function(e,t,r){var n=e._granularity,a=e._ellipsoid,i=t(n,a),o=r(n,a);return new D({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:a,rotation:e._rotation,stRotation:e._stRotation,granularity:n,extrudedHeight:i,height:o,vertexFormat:I.POSITION_ONLY})},u(D.prototype,{rectangle:{get:function(){return this._rectangle}}}),D}),define("Core/CircleGeometry",["./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./EllipseGeometry","./Ellipsoid","./VertexFormat"],function(e,t,r,n,a,i,o,u){"use strict";function s(e){e=t(e,t.EMPTY_OBJECT);var r=e.radius,n={center:e.center,semiMajorAxis:r,semiMinorAxis:r,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,vertexFormat:e.vertexFormat,stRotation:e.stRotation};this._ellipseGeometry=new i(n),this._workerName="createCircleGeometry"}s.packedLength=i.packedLength,s.pack=function(e,t,r){return i.pack(e._ellipseGeometry,t,r)};var c=new i({center:new e,semiMajorAxis:1,semiMinorAxis:1}),l={center:new e,radius:void 0,ellipsoid:o.clone(o.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new u,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};return s.unpack=function(t,n,a){var f=i.unpack(t,n,c);return l.center=e.clone(f._center,l.center),l.ellipsoid=o.clone(f._ellipsoid,l.ellipsoid),l.height=f._height,l.extrudedHeight=f._extrudedHeight,l.granularity=f._granularity,l.vertexFormat=u.clone(f._vertexFormat,l.vertexFormat),l.stRotation=f._stRotation,r(a)?(l.semiMajorAxis=f._semiMajorAxis,l.semiMinorAxis=f._semiMinorAxis,a._ellipseGeometry=new i(l),a):(l.radius=f._semiMajorAxis,new s(l))},s.createGeometry=function(e){return i.createGeometry(e._ellipseGeometry)},s.createShadowVolume=function(e,t,r){var n=e._ellipseGeometry._granularity,a=e._ellipseGeometry._ellipsoid,i=t(n,a),o=r(n,a);return new s({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:a,stRotation:e._ellipseGeometry._stRotation,granularity:n,extrudedHeight:i,height:o,vertexFormat:u.POSITION_ONLY})},n(s.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}}}),s}),define("Workers/createCircleGeometry",["../Core/Cartesian3","../Core/CircleGeometry","../Core/defined","../Core/Ellipsoid"],function(e,t,r,n){"use strict";function a(a,i){return r(i)&&(a=t.unpack(a,i)),a._ellipseGeometry._center=e.clone(a._ellipseGeometry._center),a._ellipseGeometry._ellipsoid=n.clone(a._ellipseGeometry._ellipsoid),t.createGeometry(a)}return a})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function r(e){return e+" is required, actual value was undefined"}function n(e,t,r){return"Expected "+r+" to be typeof "+t+", actual typeof was "+e}var a={};return a.typeOf={},a.defined=function(n,a){if(!e(a))throw new t(r(n))},a.typeOf.func=function(e,r){if("function"!=typeof r)throw new t(n(typeof r,"function",e))},a.typeOf.string=function(e,r){if("string"!=typeof r)throw new t(n(typeof r,"string",e))},a.typeOf.number=function(e,r){if("number"!=typeof r)throw new t(n(typeof r,"number",e))},a.typeOf.number.lessThan=function(e,r,n){if(a.typeOf.number(e,r),r>=n)throw new t("Expected "+e+" to be less than "+n+", actual value was "+r)},a.typeOf.number.lessThanOrEquals=function(e,r,n){if(a.typeOf.number(e,r),r>n)throw new t("Expected "+e+" to be less than or equal to "+n+", actual value was "+r)},a.typeOf.number.greaterThan=function(e,r,n){if(a.typeOf.number(e,r),r<=n)throw new t("Expected "+e+" to be greater than "+n+", actual value was "+r)},a.typeOf.number.greaterThanOrEquals=function(e,r,n){if(a.typeOf.number(e,r),r<n)throw new t("Expected "+e+" to be greater than or equal to"+n+", actual value was "+r)},a.typeOf.object=function(e,r){if("object"!=typeof r)throw new t(n(typeof r,"object",e))},a.typeOf.bool=function(e,r){if("boolean"!=typeof r)throw new t(n(typeof r,"boolean",e))},a}),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";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),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^=e<<7&2636928640,e^=e<<15&4022730752,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,r,n){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:e<0?-1:0},a.signNotZero=function(e){return e<0?-1:1},a.toSNorm=function(e,r){return r=t(r,255),Math.round((.5*a.clamp(e,-1,1)+.5)*r)},a.fromSNorm=function(e,r){return r=t(r,255),a.clamp(e,0,r)/r*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t-r)},a.cosh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t+r)},a.lerp=function(e,t,r){return(1-r)*e+r*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){var t=a.TWO_PI,r=e-Math.floor(e/t)*t;return r<-Math.PI?r+t:r>=Math.PI?r-t:r},a.clampToLatitudeRange=function(e){return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){return(e%t+t)%t},a.equalsEpsilon=function(e,r,n,a){a=t(a,n);var i=Math.abs(e-r);return i<=a||i<=n*Math.max(Math.abs(e),Math.abs(r))};var i=[1];a.factorial=function(e){var t=i.length;if(e>=t)for(var r=i[t-1],n=t;n<=e;n++)i.push(r*n);return i[e]},a.incrementWrap=function(e,r,n){return n=t(n,0),++e,e>r&&(e=n),e},a.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,r){return e<t?t:e>r?r:e};var o=new e;return a.setRandomNumberSeed=function(t){o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(e){return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){return Math.log(e)/Math.log(t)},a.fog=function(e,t){var r=e*t;return 1-Math.exp(-(r*r))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i){"use strict";function o(e,r,n){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0)}o.fromSpherical=function(e,n){r(n)||(n=new o);var a=e.clock,i=e.cone,u=t(e.magnitude,1),s=u*Math.sin(i);return n.x=s*Math.cos(a),n.y=s*Math.sin(a),n.z=u*Math.cos(i),n},o.fromElements=function(e,t,n,a){return r(a)?(a.x=e,a.y=t,a.z=n,a):new o(e,t,n)},o.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n]=e.z,r},o.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new o),a.x=e[n++],a.y=e[n++],a.z=e[n],a},o.packArray=function(e,t){var n=e.length;r(t)?t.length=3*n:t=new Array(3*n);for(var a=0;a<n;++a)o.pack(e[a],t,3*a);return t},o.unpackArray=function(e,t){var n=e.length;r(t)?t.length=n/3:t=new Array(n/3);for(var a=0;a<n;a+=3){var i=a/3;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},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},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},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},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},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},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},o.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r.z=e.z/t.z,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},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},o.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*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},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,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};var s=new o;o.lerp=function(e,t,r,n){return o.multiplyByScalar(t,r,s),n=o.multiplyByScalar(e,1-r,n),o.add(s,n,n)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var r=o.dot(c,l),n=o.magnitude(o.cross(c,l,c));return Math.atan2(n,r)};var f=new o;o.mostOrthogonalAxis=function(e,t){var r=o.normalize(e,f);return o.abs(r,r),t=r.x<=r.y?r.x<=r.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):r.y<=r.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},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,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]},o.equalsEpsilon=function(e,t,n,a){return e===t||r(e)&&r(t)&&i.equalsEpsilon(e.x,t.x,n,a)&&i.equalsEpsilon(e.y,t.y,n,a)&&i.equalsEpsilon(e.z,t.z,n,a)},o.cross=function(e,t,r){var n=e.x,a=e.y,i=e.z,o=t.x,u=t.y,s=t.z,c=a*s-i*u,l=i*o-n*s,f=n*u-a*o;return r.x=c,r.y=l,r.z=f,r},o.fromDegrees=function(e,t,r,n,a){return e=i.toRadians(e),t=i.toRadians(t),o.fromRadians(e,t,r,n,a)};var d=new o,h=new o,E=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,n,a,i,u){a=t(a,0);var s=r(i)?i.radiiSquared:E,c=Math.cos(n);d.x=c*Math.cos(e),d.y=c*Math.sin(e),d.z=Math.sin(n),d=o.normalize(d,d),o.multiplyComponents(s,d,h);var l=Math.sqrt(o.dot(d,h));return h=o.divideByScalar(h,l,h),d=o.multiplyByScalar(d,a,d),r(u)||(u=new o),o.add(h,d,u)},o.fromDegreesArray=function(e,t,n){var a=e.length;r(n)?n.length=a/2:n=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;n[c]=o.fromDegrees(u,s,0,t,n[c])}return n},o.fromRadiansArray=function(e,t,n){var a=e.length;r(n)?n.length=a/2:n=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;n[c]=o.fromRadians(u,s,0,t,n[c])}return n},o.fromDegreesArrayHeights=function(e,t,n){var a=e.length;r(n)?n.length=a/3:n=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;n[l]=o.fromDegrees(u,s,c,t,n[l])}return n},o.fromRadiansArrayHeights=function(e,t,n){var a=e.length;r(n)?n.length=a/3:n=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;n[l]=o.fromRadians(u,s,c,t,n[l])}return n},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(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,t,r){return o.equalsEpsilon(this,e,t,r)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),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/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,r,n){"use strict";function a(r,a,u,s,c){var l=r.x,f=r.y,d=r.z,h=a.x,E=a.y,m=a.z,p=l*l*h*h,y=f*f*E*E,_=d*d*m*m,T=p+y+_,v=Math.sqrt(1/T),R=e.multiplyByScalar(r,v,i);if(T<s)return isFinite(v)?e.clone(R,c):void 0;var A=u.x,S=u.y,N=u.z,g=o;g.x=R.x*A*2,g.y=R.y*S*2,g.z=R.z*N*2;var I,O,w,M,x,C,P,D,L,U,b,F=(1-v)*e.magnitude(r)/(.5*e.magnitude(g)),z=0;do{F-=z,w=1/(1+F*A),M=1/(1+F*S),x=1/(1+F*N),C=w*w,P=M*M,D=x*x,L=C*w,U=P*M,b=D*x,I=p*C+y*P+_*D-1,O=p*L*A+y*U*S+_*b*N;var B=-2*O;z=I/B}while(Math.abs(I)>n.EPSILON12);return t(c)?(c.x=l*w,c.y=f*M,c.z=d*x,c):new e(l*w,f*M,d*x)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,r,n,a,i,o){"use strict";function u(e,r,n){this.longitude=t(e,0),this.latitude=t(r,0),this.height=t(n,0)}u.fromRadians=function(e,n,a,i){return a=t(a,0),r(i)?(i.longitude=e,i.latitude=n,i.height=a,i):new u(e,n,a)},u.fromDegrees=function(e,t,r,n){return e=i.toRadians(e),t=i.toRadians(t),u.fromRadians(e,t,r,n)};var s=new e,c=new e,l=new e,f=new e(1/6378137,1/6378137,1/6356752.314245179),d=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),h=i.EPSILON1;return u.fromCartesian=function(t,n,a){var E=r(n)?n.oneOverRadii:f,m=r(n)?n.oneOverRadiiSquared:d,p=r(n)?n._centerToleranceSquared:h,y=o(t,E,m,p,c);if(r(y)){var _=e.multiplyComponents(y,m,s);_=e.normalize(_,_);var T=e.subtract(t,y,l),v=Math.atan2(_.y,_.x),R=Math.asin(_.z),A=i.sign(e.dot(T,t))*e.magnitude(T);return r(a)?(a.longitude=v,a.latitude=R,a.height=A,a):new u(v,R,A)}},u.clone=function(e,t){if(r(e))return r(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||r(e)&&r(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n},u.ZERO=a(new u(0,0,0)),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,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,r,n,a,i,o,u,s){"use strict";function c(t,n,a,i){n=r(n,0),a=r(a,0),i=r(i,0),t._radii=new e(n,a,i),t._radiiSquared=new e(n*n,a*a,i*i),t._radiiToTheFourth=new e(n*n*n*n,a*a*a*a,i*i*i*i),t._oneOverRadii=new e(0===n?0:1/n,0===a?0:1/a,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===n?0:1/(n*n),0===a?0:1/(a*a),0===i?0:1/(i*i)),t._minimumRadius=Math.min(n,a,i),t._maximumRadius=Math.max(n,a,i),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(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,this._sqauredXOverSquaredZ=void 0,c(this,e,t,r)}a(l.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}}}),l.clone=function(t,r){if(n(t)){var a=t._radii;return n(r)?(e.clone(a,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 l(a.x,a.y,a.z)}},l.fromCartesian3=function(e,t){return n(t)||(t=new l),n(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,n,a){return a=r(a,0),e.pack(t._radii,n,a),n},l.unpack=function(t,n,a){n=r(n,0);var i=e.unpack(t,n);return l.fromCartesian3(i,a)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,r){var a=t.longitude,i=t.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return n(r)||(r=new e),r.x=u,r.y=s,r.z=c,e.normalize(r,r)},l.prototype.geodeticSurfaceNormal=function(t,r){return n(r)||(r=new e),r=e.multiplyComponents(t,this._oneOverRadiiSquared,r),e.normalize(r,r)};var f=new e,d=new e;l.prototype.cartographicToCartesian=function(t,r){var a=f,i=d;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(e.dot(a,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(a,t.height,a),n(r)||(r=new e),e.add(i,a,r)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var a=0;a<r;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var h=new e,E=new e,m=new e;return l.prototype.cartesianToCartographic=function(r,a){var i=this.scaleToGeodeticSurface(r,E);if(n(i)){var o=this.geodeticSurfaceNormal(i,h),s=e.subtract(r,i,m),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),f=u.sign(e.dot(s,r))*e.magnitude(s);return n(a)?(a.longitude=c,a.latitude=l,a.height=f,a):new t(c,l,f)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var a=0;a<r;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,r){n(r)||(r=new e);var a=t.x,i=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return e.multiplyByScalar(t,s,r)},l.prototype.transformPositionToScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._oneOverRadii,r)},l.prototype.transformPositionFromScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._radii,r)},l.prototype.equals=function(t){return this===t||n(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,a,i){a=r(a,0);var o=this._sqauredXOverSquaredZ;if(n(i)||(i=new e),i.x=0,i.y=0,i.z=t.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},l}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,r,n,a,i,o){"use strict";function u(e){this._ellipsoid=r(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,r){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return n(r)?(r.x=i,r.y=o,r.z=u,r):new e(i,o,u)},u.prototype.unproject=function(e,r){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,u=e.z;return n(r)?(r.longitude=i,r.latitude=o,r.height=u,r):new t(i,o,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";function t(t,r){this.start=e(t,0),this.stop=e(r,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i,o,u){"use strict";function s(e,t,n,a,i,o,u,s,c){this[0]=r(e,0),this[1]=r(a,0),this[2]=r(u,0),this[3]=r(t,0),this[4]=r(i,0),this[5]=r(s,0),this[6]=r(n,0),this[7]=r(o,0),this[8]=r(c,0)}function c(e){for(var t=0,r=0;r<9;++r){var n=e[r];t+=n*n}return Math.sqrt(t)}function l(e){for(var t=0,r=0;r<3;++r){var n=e[s.getElementIndex(m[r],E[r])];t+=2*n*n}return Math.sqrt(t)}function f(e,t){for(var r=u.EPSILON15,n=0,a=1,i=0;i<3;++i){var o=Math.abs(e[s.getElementIndex(m[i],E[i])]);o>n&&(a=i,n=o)}var c=1,l=0,f=E[a],d=m[a];if(Math.abs(e[s.getElementIndex(d,f)])>r){var h,p=e[s.getElementIndex(d,d)],y=e[s.getElementIndex(f,f)],_=e[s.getElementIndex(d,f)],T=(p-y)/2/_;h=T<0?-1/(-T+Math.sqrt(1+T*T)):1/(T+Math.sqrt(1+T*T)),c=1/Math.sqrt(1+h*h),l=h*c}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(f,f)]=t[s.getElementIndex(d,d)]=c,t[s.getElementIndex(d,f)]=l,t[s.getElementIndex(f,d)]=-l,t}s.packedLength=9,s.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t},s.unpack=function(e,t,a){return t=r(t,0),n(a)||(a=new s),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a},s.clone=function(e,t){if(n(e))return n(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 s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,a){return t=r(t,0),n(a)||(a=new s),a[0]=e[t],a[1]=e[t+1],a[2]=e[t+2],a[3]=e[t+3],a[4]=e[t+4],a[5]=e[t+5],a[6]=e[t+6],a[7]=e[t+7],a[8]=e[t+8],a},s.fromColumnMajorArray=function(e,t){return s.clone(e,t)},s.fromRowMajorArray=function(e,t){return n(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 s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var r=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,u=e.y*e.y,c=e.y*e.z,l=e.y*e.w,f=e.z*e.z,d=e.z*e.w,h=e.w*e.w,E=r-u-f+h,m=2*(a-d),p=2*(i+l),y=2*(a+d),_=-r+u-f+h,T=2*(c-o),v=2*(i-l),R=2*(c+o),A=-r-u+f+h;return n(t)?(t[0]=E,t[1]=y,t[2]=v,t[3]=m,t[4]=_,t[5]=R,t[6]=p,t[7]=T,t[8]=A,t):new s(E,m,p,y,_,T,v,R,A)},s.fromHeadingPitchRoll=function(e,t){var r=Math.cos(-e.pitch),a=Math.cos(-e.heading),i=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),c=Math.sin(e.roll),l=r*a,f=-i*u+c*o*a,d=c*u+i*o*a,h=r*u,E=i*a+c*o*u,m=-o*i+i*o*u,p=-o,y=c*r,_=i*r;return n(t)?(t[0]=l,t[1]=h,t[2]=p,t[3]=f,t[4]=E,t[5]=y,t[6]=d,t[7]=m,t[8]=_,t):new s(l,f,d,h,E,m,p,y,_)},s.fromScale=function(e,t){return n(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 s(e.x,0,0,0,e.y,0,0,0,e.z)},s.fromUniformScale=function(e,t){return n(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 s(e,0,0,0,e,0,0,0,e)},s.fromCrossProduct=function(e,t){return n(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 s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=r,t[5]=a,t[6]=0,t[7]=-a,t[8]=r,t):new s(1,0,0,0,r,-a,0,a,r)},s.fromRotationY=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=r,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=r,t):new s(r,0,a,0,1,0,-a,0,r)},s.fromRotationZ=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=r,t[1]=a,t[2]=0,t[3]=-a,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(r,-a,0,a,r,0,0,0,1)},s.toArray=function(e,t){return n(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]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,r){var n=3*t,a=e[n],i=e[n+1],o=e[n+2];return r.x=a,r.y=i,r.z=o,r},s.setColumn=function(e,t,r,n){n=s.clone(e,n);var a=3*t;return n[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n},s.getRow=function(e,t,r){var n=e[t],a=e[t+3],i=e[t+6];return r.x=n,r.y=a,r.z=i,r},s.setRow=function(e,t,r,n){return n=s.clone(e,n),n[t]=r.x,n[t+3]=r.y,n[t+6]=r.z,n};var d=new e;s.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],d)),r.y=e.magnitude(e.fromElements(t[3],t[4],t[5],d)),r.z=e.magnitude(e.fromElements(t[6],t[7],t[8],d)),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]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=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]=a,r[2]=i,r[3]=o,r[4]=u,r[5]=s,r[6]=c,r[7]=l,r[8]=f,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},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},s.multiplyByVector=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=e[0]*n+e[3]*a+e[6]*i,u=e[1]*n+e[4]*a+e[7]*i,s=e[2]*n+e[5]*a+e[8]*i;return r.x=o,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},s.multiplyByScale=function(e,t,r){return r[0]=e[0]*t.x,r[1]=e[1]*t.x,r[2]=e[2]*t.x,r[3]=e[3]*t.y,r[4]=e[4]*t.y,r[5]=e[5]*t.y,r[6]=e[6]*t.z,r[7]=e[7]*t.z,r[8]=e[8]*t.z,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},s.transpose=function(e,t){var r=e[0],n=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=r,t[1]=n,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var E=[1,0,0],m=[2,2,1],p=new s,y=new s;return s.computeEigenDecomposition=function(e,t){var r=u.EPSILON20,a=10,i=0,o=0;n(t)||(t={});for(var d=t.unitary=s.clone(s.IDENTITY,t.unitary),h=t.diagonal=s.clone(e,t.diagonal),E=r*c(h);o<a&&l(h)>E;)f(h,p),s.transpose(p,y),s.multiply(h,p,h),s.multiply(y,h,h),s.multiply(d,p,d),++i>2&&(++o,i=0);return 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},s.determinant=function(e){var t=e[0],r=e[3],n=e[6],a=e[1],i=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*o)+a*(s*n-r*c)+u*(r*o-i*n)},s.inverse=function(e,t){var r=e[0],n=e[1],a=e[2],i=e[3],o=e[4],u=e[5],c=e[6],l=e[7],f=e[8],d=s.determinant(e);t[0]=o*f-l*u,t[1]=l*a-n*f,t[2]=n*u-o*a,t[3]=c*u-i*f,t[4]=r*f-c*a,t[5]=i*a-r*u,t[6]=i*l-c*o,t[7]=c*n-r*l,t[8]=r*o-i*n;var h=1/d;return s.multiplyByScalar(t,h,t)},s.equals=function(e,t){return e===t||n(e)&&n(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]},s.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,a(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i){"use strict";function o(e,r,n,a){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0),this.w=t(a,0)}o.fromElements=function(e,t,n,a,i){return r(i)?(i.x=e,i.y=t,i.z=n,i.w=a,i):new o(e,t,n,a)},o.fromColor=function(e,t){return r(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(r(e))return 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)},o.packedLength=4,o.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n++]=e.z,r[n]=e.w,r},o.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new o),a.x=e[n++],a.y=e[n++],a.z=e[n++],a.w=e[n],a},o.packArray=function(e,t){var n=e.length;r(t)?t.length=4*n:t=new Array(4*n);for(var a=0;a<n;++a)o.pack(e[a],t,4*a);return t},o.unpackArray=function(e,t){var n=e.length;r(t)?t.length=n/4:t=new Array(n/4);for(var a=0;a<n;a+=4){var i=a/4;t[i]=o.unpack(e,a,t[i])}return t},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 u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},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.divideComponents=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 s=new o;o.lerp=function(e,t,r,n){return o.multiplyByScalar(t,r,s),n=o.multiplyByScalar(e,1-r,n),o.add(s,n,n)};var c=new o;return o.mostOrthogonalAxis=function(e,t){var r=o.normalize(e,c);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,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,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]&&e.w===t[r+3]},o.equalsEpsilon=function(e,t,n,a){return e===t||r(e)&&r(t)&&i.equalsEpsilon(e.x,t.x,n,a)&&i.equalsEpsilon(e.y,t.y,n,a)&&i.equalsEpsilon(e.z,t.z,n,a)&&i.equalsEpsilon(e.w,t.w,n,a)},o.ZERO=a(new o(0,0,0,0)),o.UNIT_X=a(new o(1,0,0,0)),o.UNIT_Y=a(new o(0,1,0,0)),o.UNIT_Z=a(new o(0,0,1,0)),o.UNIT_W=a(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,r){return o.equalsEpsilon(this,e,t,r)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,r,n,a,i,o,u,s,c,l){ +"use strict";function f(e,t,r,a,i,o,u,s,c,l,f,d,h,E,m,p){this[0]=n(e,0),this[1]=n(i,0),this[2]=n(c,0),this[3]=n(h,0),this[4]=n(t,0),this[5]=n(o,0),this[6]=n(l,0),this[7]=n(E,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(f,0),this[11]=n(m,0),this[12]=n(a,0),this[13]=n(s,0),this[14]=n(d,0),this[15]=n(p,0)}f.packedLength=16,f.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t[r++]=e[9],t[r++]=e[10],t[r++]=e[11],t[r++]=e[12],t[r++]=e[13],t[r++]=e[14],t[r]=e[15],t},f.unpack=function(e,t,r){return t=n(t,0),a(r)||(r=new f),r[0]=e[t++],r[1]=e[t++],r[2]=e[t++],r[3]=e[t++],r[4]=e[t++],r[5]=e[t++],r[6]=e[t++],r[7]=e[t++],r[8]=e[t++],r[9]=e[t++],r[10]=e[t++],r[11]=e[t++],r[12]=e[t++],r[13]=e[t++],r[14]=e[t++],r[15]=e[t],r},f.clone=function(e,t){if(a(e))return a(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 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])},f.fromArray=f.unpack,f.fromColumnMajorArray=function(e,t){return f.clone(e,t)},f.fromRowMajorArray=function(e,t){return a(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 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(t,r,i){return r=n(r,e.ZERO),a(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=r.x,i[13]=r.y,i[14]=r.z,i[15]=1,i):new f(t[0],t[3],t[6],r.x,t[1],t[4],t[7],r.y,t[2],t[5],t[8],r.z,0,0,0,1)},f.fromTranslationQuaternionRotationScale=function(e,t,r,n){a(n)||(n=new f);var i=r.x,o=r.y,u=r.z,s=t.x*t.x,c=t.x*t.y,l=t.x*t.z,d=t.x*t.w,h=t.y*t.y,E=t.y*t.z,m=t.y*t.w,p=t.z*t.z,y=t.z*t.w,_=t.w*t.w,T=s-h-p+_,v=2*(c-y),R=2*(l+m),A=2*(c+y),S=-s+h-p+_,N=2*(E-d),g=2*(l-m),I=2*(E+d),O=-s-h+p+_;return n[0]=T*i,n[1]=A*i,n[2]=g*i,n[3]=0,n[4]=v*o,n[5]=S*o,n[6]=I*o,n[7]=0,n[8]=R*u,n[9]=N*u,n[10]=O*u,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n},f.fromTranslationRotationScale=function(e,t){return f.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},f.fromTranslation=function(e,t){return f.fromRotationTranslation(c.IDENTITY,e,t)},f.fromScale=function(e,t){return a(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 f(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},f.fromUniformScale=function(e,t){return a(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 f(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var d=new e,h=new e,E=new e;f.fromCamera=function(t,r){var n=t.position,i=t.direction,o=t.up;e.normalize(i,d),e.normalize(e.cross(d,o,h),h),e.normalize(e.cross(h,d,E),E);var u=h.x,s=h.y,c=h.z,l=d.x,m=d.y,p=d.z,y=E.x,_=E.y,T=E.z,v=n.x,R=n.y,A=n.z,S=u*-v+s*-R+c*-A,N=y*-v+_*-R+T*-A,g=l*v+m*R+p*A;return a(r)?(r[0]=u,r[1]=y,r[2]=-l,r[3]=0,r[4]=s,r[5]=_,r[6]=-m,r[7]=0,r[8]=c,r[9]=T,r[10]=-p,r[11]=0,r[12]=S,r[13]=N,r[14]=g,r[15]=1,r):new f(u,s,c,S,y,_,T,N,-l,-m,-p,g,0,0,0,1)},f.computePerspectiveFieldOfView=function(e,t,r,n,a){var i=Math.tan(.5*e),o=1/i,u=o/t,s=(n+r)/(r-n),c=2*n*r/(r-n);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=c,a[15]=0,a},f.computeOrthographicOffCenter=function(e,t,r,n,a,i,o){var u=1/(t-e),s=1/(n-r),c=1/(i-a),l=-(t+e)*u,f=-(n+r)*s,d=-(i+a)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=f,o[14]=d,o[15]=1,o},f.computePerspectiveOffCenter=function(e,t,r,n,a,i,o){var u=2*a/(t-e),s=2*a/(n-r),c=(t+e)/(t-e),l=(n+r)/(n-r),f=-(i+a)/(i-a),d=-1,h=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=f,o[11]=d,o[12]=0,o[13]=0,o[14]=h,o[15]=0,o},f.computeInfinitePerspectiveOffCenter=function(e,t,r,n,a,i){var o=2*a/(t-e),u=2*a/(n-r),s=(t+e)/(t-e),c=(n+r)/(n-r),l=-1,f=-1,d=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=s,i[9]=c,i[10]=l,i[11]=f,i[12]=0,i[13]=0,i[14]=d,i[15]=0,i},f.computeViewportTransformation=function(e,t,r,a){e=n(e,n.EMPTY_OBJECT);var i=n(e.x,0),o=n(e.y,0),u=n(e.width,0),s=n(e.height,0);t=n(t,0),r=n(r,1);var c=.5*u,l=.5*s,f=.5*(r-t),d=c,h=l,E=f,m=i+c,p=o+l,y=t+f,_=1;return a[0]=d,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=h,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=E,a[11]=0,a[12]=m,a[13]=p,a[14]=y,a[15]=_,a},f.computeView=function(t,r,n,a,i){return i[0]=a.x,i[1]=n.x,i[2]=-r.x,i[3]=0,i[4]=a.y,i[5]=n.y,i[6]=-r.y,i[7]=0,i[8]=a.z,i[9]=n.z,i[10]=-r.z,i[11]=0,i[12]=-e.dot(a,t),i[13]=-e.dot(n,t),i[14]=e.dot(r,t),i[15]=1,i},f.toArray=function(e,t){return a(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]]},f.getElementIndex=function(e,t){return 4*e+t},f.getColumn=function(e,t,r){var n=4*t,a=e[n],i=e[n+1],o=e[n+2],u=e[n+3];return r.x=a,r.y=i,r.z=o,r.w=u,r},f.setColumn=function(e,t,r,n){n=f.clone(e,n);var a=4*t;return n[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n[a+3]=r.w,n},f.setTranslation=function(e,t,r){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]=t.x,r[13]=t.y,r[14]=t.z,r[15]=e[15],r},f.getRow=function(e,t,r){var n=e[t],a=e[t+4],i=e[t+8],o=e[t+12];return r.x=n,r.y=a,r.z=i,r.w=o,r},f.setRow=function(e,t,r,n){return n=f.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;f.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 p=new e;f.getMaximumScale=function(t){return f.getScale(t,p),e.maximumComponent(p)},f.multiply=function(e,t,r){var n=e[0],a=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],f=e[8],d=e[9],h=e[10],E=e[11],m=e[12],p=e[13],y=e[14],_=e[15],T=t[0],v=t[1],R=t[2],A=t[3],S=t[4],N=t[5],g=t[6],I=t[7],O=t[8],w=t[9],M=t[10],x=t[11],C=t[12],P=t[13],D=t[14],L=t[15],U=n*T+u*v+f*R+m*A,b=a*T+s*v+d*R+p*A,F=i*T+c*v+h*R+y*A,z=o*T+l*v+E*R+_*A,B=n*S+u*N+f*g+m*I,G=a*S+s*N+d*g+p*I,q=i*S+c*N+h*g+y*I,V=o*S+l*N+E*g+_*I,W=n*O+u*w+f*M+m*x,X=a*O+s*w+d*M+p*x,H=i*O+c*w+h*M+y*x,Y=o*O+l*w+E*M+_*x,k=n*C+u*P+f*D+m*L,j=a*C+s*P+d*D+p*L,Z=i*C+c*P+h*D+y*L,K=o*C+l*P+E*D+_*L;return r[0]=U,r[1]=b,r[2]=F,r[3]=z,r[4]=B,r[5]=G,r[6]=q,r[7]=V,r[8]=W,r[9]=X,r[10]=H,r[11]=Y,r[12]=k,r[13]=j,r[14]=Z,r[15]=K,r},f.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},f.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},f.multiplyTransformation=function(e,t,r){var n=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],d=e[12],h=e[13],E=e[14],m=t[0],p=t[1],y=t[2],_=t[4],T=t[5],v=t[6],R=t[8],A=t[9],S=t[10],N=t[12],g=t[13],I=t[14],O=n*m+o*p+c*y,w=a*m+u*p+l*y,M=i*m+s*p+f*y,x=n*_+o*T+c*v,C=a*_+u*T+l*v,P=i*_+s*T+f*v,D=n*R+o*A+c*S,L=a*R+u*A+l*S,U=i*R+s*A+f*S,b=n*N+o*g+c*I+d,F=a*N+u*g+l*I+h,z=i*N+s*g+f*I+E;return r[0]=O,r[1]=w,r[2]=M,r[3]=0,r[4]=x,r[5]=C,r[6]=P,r[7]=0,r[8]=D,r[9]=L,r[10]=U,r[11]=0,r[12]=b,r[13]=F,r[14]=z,r[15]=1,r},f.multiplyByMatrix3=function(e,t,r){var n=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],d=t[0],h=t[1],E=t[2],m=t[3],p=t[4],y=t[5],_=t[6],T=t[7],v=t[8],R=n*d+o*h+c*E,A=a*d+u*h+l*E,S=i*d+s*h+f*E,N=n*m+o*p+c*y,g=a*m+u*p+l*y,I=i*m+s*p+f*y,O=n*_+o*T+c*v,w=a*_+u*T+l*v,M=i*_+s*T+f*v;return r[0]=R,r[1]=A,r[2]=S,r[3]=0,r[4]=N,r[5]=g,r[6]=I,r[7]=0,r[8]=O,r[9]=w,r[10]=M,r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r},f.multiplyByTranslation=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=n*e[0]+a*e[4]+i*e[8]+e[12],u=n*e[1]+a*e[5]+i*e[9]+e[13],s=n*e[2]+a*e[6]+i*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]=o,r[13]=u,r[14]=s,r[15]=e[15],r};var y=new e;f.multiplyByUniformScale=function(e,t,r){return y.x=t,y.y=t,y.z=t,f.multiplyByScale(e,y,r)},f.multiplyByScale=function(e,t,r){var n=t.x,a=t.y,i=t.z;return 1===n&&1===a&&1===i?f.clone(e,r):(r[0]=n*e[0],r[1]=n*e[1],r[2]=n*e[2],r[3]=0,r[4]=a*e[4],r[5]=a*e[5],r[6]=a*e[6],r[7]=0,r[8]=i*e[8],r[9]=i*e[9],r[10]=i*e[10],r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=1,r)},f.multiplyByVector=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=t.w,u=e[0]*n+e[4]*a+e[8]*i+e[12]*o,s=e[1]*n+e[5]*a+e[9]*i+e[13]*o,c=e[2]*n+e[6]*a+e[10]*i+e[14]*o,l=e[3]*n+e[7]*a+e[11]*i+e[15]*o;return r.x=u,r.y=s,r.z=c,r.w=l,r},f.multiplyByPointAsVector=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=e[0]*n+e[4]*a+e[8]*i,u=e[1]*n+e[5]*a+e[9]*i,s=e[2]*n+e[6]*a+e[10]*i;return r.x=o,r.y=u,r.z=s,r},f.multiplyByPoint=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=e[0]*n+e[4]*a+e[8]*i+e[12],u=e[1]*n+e[5]*a+e[9]*i+e[13],s=e[2]*n+e[6]*a+e[10]*i+e[14];return r.x=o,r.y=u,r.z=s,r},f.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},f.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},f.transpose=function(e,t){var r=e[1],n=e[2],a=e[3],i=e[6],o=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]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=o,t[14]=u,t[15]=e[15],t},f.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},f.equals=function(e,t){return e===t||a(e)&&a(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},f.equalsEpsilon=function(e,t,r){return e===t||a(e)&&a(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r&&Math.abs(e[9]-t[9])<=r&&Math.abs(e[10]-t[10])<=r&&Math.abs(e[11]-t[11])<=r&&Math.abs(e[12]-t[12])<=r&&Math.abs(e[13]-t[13])<=r&&Math.abs(e[14]-t[14])<=r&&Math.abs(e[15]-t[15])<=r},f.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},f.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};var _=new c,T=new c,v=new t,R=new t(0,0,0,1);return f.inverse=function(e,r){if(c.equalsEpsilon(f.getRotation(e,_),T,s.EPSILON7)&&t.equals(f.getRow(e,3,v),R))return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=0,r[11]=0,r[12]=-e[12],r[13]=-e[13],r[14]=-e[14],r[15]=1,r;var n=e[0],a=e[4],i=e[8],o=e[12],u=e[1],d=e[5],h=e[9],E=e[13],m=e[2],p=e[6],y=e[10],A=e[14],S=e[3],N=e[7],g=e[11],I=e[15],O=y*I,w=A*g,M=p*I,x=A*N,C=p*g,P=y*N,D=m*I,L=A*S,U=m*g,b=y*S,F=m*N,z=p*S,B=O*d+x*h+C*E-(w*d+M*h+P*E),G=w*u+D*h+b*E-(O*u+L*h+U*E),q=M*u+L*d+F*E-(x*u+D*d+z*E),V=P*u+U*d+z*h-(C*u+b*d+F*h),W=w*a+M*i+P*o-(O*a+x*i+C*o),X=O*n+L*i+U*o-(w*n+D*i+b*o),H=x*n+D*a+z*o-(M*n+L*a+F*o),Y=C*n+b*a+F*i-(P*n+U*a+z*i);O=i*E,w=o*h,M=a*E,x=o*d,C=a*h,P=i*d,D=n*E,L=o*u,U=n*h,b=i*u,F=n*d,z=a*u;var k=O*N+x*g+C*I-(w*N+M*g+P*I),j=w*S+D*g+b*I-(O*S+L*g+U*I),Z=M*S+L*N+F*I-(x*S+D*N+z*I),K=P*S+U*N+z*g-(C*S+b*N+F*g),J=M*y+P*A+w*p-(C*A+O*p+x*y),Q=U*A+O*m+L*y-(D*y+b*A+w*m),$=D*p+z*A+x*m-(F*A+M*m+L*p),ee=F*y+C*m+b*p-(U*p+z*y+P*m),te=n*B+a*G+i*q+o*V;if(Math.abs(te)<s.EPSILON20)throw new l("matrix is not invertible because its determinate is zero.");return te=1/te,r[0]=B*te,r[1]=G*te,r[2]=q*te,r[3]=V*te,r[4]=W*te,r[5]=X*te,r[6]=H*te,r[7]=Y*te,r[8]=k*te,r[9]=j*te,r[10]=Z*te,r[11]=K*te,r[12]=J*te,r[13]=Q*te,r[14]=$*te,r[15]=ee*te,r},f.inverseTransformation=function(e,t){var r=e[0],n=e[1],a=e[2],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],f=e[12],d=e[13],h=e[14],E=-r*f-n*d-a*h,m=-i*f-o*d-u*h,p=-s*f-c*d-l*h;return t[0]=r,t[1]=i,t[2]=s,t[3]=0,t[4]=n,t[5]=o,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=l,t[11]=0,t[12]=E,t[13]=m,t[14]=p,t[15]=1,t},f.IDENTITY=u(new f(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),f.ZERO=u(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,i(f.prototype,{length:{get:function(){return f.packedLength}}}),f.prototype.clone=function(e){return f.clone(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]&&e[9]===t[r+9]&&e[10]===t[r+10]&&e[11]===t[r+11]&&e[12]===t[r+12]&&e[13]===t[r+13]&&e[14]===t[r+14]&&e[15]===t[r+15]},f.prototype.equalsEpsilon=function(e,t){return f.equalsEpsilon(this,e,t)},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/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,r,n,a,i,o,u,s){"use strict";function c(e,t,n,a){this.west=r(e,0),this.south=r(t,0),this.east=r(n,0),this.north=r(a,0)}a(c.prototype,{width:{get:function(){return c.computeWidth(this)}},height:{get:function(){return c.computeHeight(this)}}}),c.packedLength=4,c.pack=function(e,t,n){return n=r(n,0),t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t},c.unpack=function(e,t,a){return t=r(t,0),n(a)||(a=new c),a.west=e[t++],a.south=e[t++],a.east=e[t++],a.north=e[t],a},c.computeWidth=function(e){var t=e.east,r=e.west;return t<r&&(t+=s.TWO_PI),t-r},c.computeHeight=function(e){return e.north-e.south},c.fromDegrees=function(e,t,a,i,o){return e=s.toRadians(r(e,0)),t=s.toRadians(r(t,0)),a=s.toRadians(r(a,0)),i=s.toRadians(r(i,0)),n(o)?(o.west=e,o.south=t,o.east=a,o.north=i,o):new c(e,t,a,i)},c.fromRadians=function(e,t,a,i,o){return n(o)?(o.west=r(e,0),o.south=r(t,0),o.east=r(a,0),o.north=r(i,0),o):new c(e,t,a,i)},c.fromCartographicArray=function(e,t){for(var r=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,u=Number.MAX_VALUE,l=-Number.MAX_VALUE,f=0,d=e.length;f<d;f++){var h=e[f];r=Math.min(r,h.longitude),a=Math.max(a,h.longitude),u=Math.min(u,h.latitude),l=Math.max(l,h.latitude);var E=h.longitude>=0?h.longitude:h.longitude+s.TWO_PI;i=Math.min(i,E),o=Math.max(o,E)}return a-r>o-i&&(r=i,a=o,a>s.PI&&(a-=s.TWO_PI),r>s.PI&&(r-=s.TWO_PI)),n(t)?(t.west=r,t.south=u,t.east=a,t.north=l,t):new c(r,u,a,l)},c.fromCartesianArray=function(e,t,r){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,u=-Number.MAX_VALUE,l=Number.MAX_VALUE,f=-Number.MAX_VALUE,d=0,h=e.length;d<h;d++){var E=t.cartesianToCartographic(e[d]);a=Math.min(a,E.longitude),i=Math.max(i,E.longitude),l=Math.min(l,E.latitude),f=Math.max(f,E.latitude);var m=E.longitude>=0?E.longitude:E.longitude+s.TWO_PI;o=Math.min(o,m),u=Math.max(u,m)}return i-a>u-o&&(a=o,i=u,i>s.PI&&(i-=s.TWO_PI),a>s.PI&&(a-=s.TWO_PI)),n(r)?(r.west=a,r.south=l,r.east=i,r.north=f,r):new c(a,l,i,f)},c.clone=function(e,t){if(n(e))return n(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new c(e.west,e.south,e.east,e.north)},c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.equals=function(e,t){return e===t||n(e)&&n(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},c.prototype.equalsEpsilon=function(e,t){return n(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},c.validate=function(e){},c.southwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.south,r.height=0,r):new e(t.west,t.south)},c.northwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.north,r.height=0,r):new e(t.west,t.north)},c.northeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.north,r.height=0,r):new e(t.east,t.north)},c.southeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.south,r.height=0,r):new e(t.east,t.south)},c.center=function(t,r){var a=t.east,i=t.west;a<i&&(a+=s.TWO_PI);var o=s.negativePiToPi(.5*(i+a)),u=.5*(t.south+t.north);return n(r)?(r.longitude=o,r.latitude=u,r.height=0,r):new e(o,u)},c.intersection=function(e,t,r){var a=e.east,i=e.west,o=t.east,u=t.west;a<i&&o>0?a+=s.TWO_PI:o<u&&a>0&&(o+=s.TWO_PI),a<i&&u<0?u+=s.TWO_PI:o<u&&i<0&&(i+=s.TWO_PI);var l=s.negativePiToPi(Math.max(i,u)),f=s.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&f<=l)){var d=Math.max(e.south,t.south),h=Math.min(e.north,t.north);if(!(d>=h))return n(r)?(r.west=l,r.south=d,r.east=f,r.north=h,r):new c(l,d,f,h)}},c.simpleIntersection=function(e,t,r){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(i>=u||a>=o))return n(r)?(r.west=a,r.south=i,r.east=o,r.north=u,r):new c(a,i,o,u)},c.union=function(e,t,r){n(r)||(r=new c);var a=e.east,i=e.west,o=t.east,u=t.west;a<i&&o>0?a+=s.TWO_PI:o<u&&a>0&&(o+=s.TWO_PI),a<i&&u<0?u+=s.TWO_PI:o<u&&i<0&&(i+=s.TWO_PI);var l=s.convertLongitudeRange(Math.min(i,u)),f=s.convertLongitudeRange(Math.max(a,o));return r.west=l,r.south=Math.min(e.south,t.south),r.east=f,r.north=Math.max(e.north,t.north),r},c.expand=function(e,t,r){return n(r)||(r=new c),r.west=Math.min(e.west,t.longitude),r.south=Math.min(e.south,t.latitude),r.east=Math.max(e.east,t.longitude),r.north=Math.max(e.north,t.latitude),r},c.contains=function(e,t){var r=t.longitude,n=t.latitude,a=e.west,i=e.east;return i<a&&(i+=s.TWO_PI,r<0&&(r+=s.TWO_PI)),(r>a||s.equalsEpsilon(r,a,s.EPSILON14))&&(r<i||s.equalsEpsilon(r,i,s.EPSILON14))&&n>=e.south&&n<=e.north};var l=new e;return c.subsample=function(e,t,a,i){t=r(t,o.WGS84),a=r(a,0),n(i)||(i=[]);var u=0,f=e.north,d=e.south,h=e.east,E=e.west,m=l;m.height=a,m.longitude=E,m.latitude=f,i[u]=t.cartographicToCartesian(m,i[u]),u++,m.longitude=h,i[u]=t.cartographicToCartesian(m,i[u]),u++,m.latitude=d,i[u]=t.cartographicToCartesian(m,i[u]),u++,m.longitude=E,i[u]=t.cartographicToCartesian(m,i[u]),u++,f<0?m.latitude=f:d>0?m.latitude=d:m.latitude=0;for(var p=1;p<8;++p)m.longitude=-Math.PI+p*s.PI_OVER_TWO,c.contains(e,m)&&(i[u]=t.cartographicToCartesian(m,i[u]),u++);return 0===m.latitude&&(m.longitude=E,i[u]=t.cartographicToCartesian(m,i[u]),u++,m.longitude=h,i[u]=t.cartographicToCartesian(m,i[u]),u++),i.length=u,i},c.MAX_VALUE=u(new c(-Math.PI,-s.PI_OVER_TWO,Math.PI,s.PI_OVER_TWO)),c}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,r,n,a,i,o,u,s,c,l,f){"use strict";function d(t,r){this.center=e.clone(n(t,e.ZERO)),this.radius=n(r,0)}var h=new e,E=new e,m=new e,p=new e,y=new e,_=new e,T=new e,v=new e,R=new e,A=new e,S=new e,N=new e;d.fromPoints=function(t,r){if(a(r)||(r=new d),!a(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;for(var n=e.clone(t[0],T),i=e.clone(n,h),o=e.clone(n,E),u=e.clone(n,m),s=e.clone(n,p),c=e.clone(n,y),l=e.clone(n,_),f=t.length,g=1;g<f;g++){e.clone(t[g],n);var I=n.x,O=n.y,w=n.z;I<i.x&&e.clone(n,i),I>s.x&&e.clone(n,s),O<o.y&&e.clone(n,o),O>c.y&&e.clone(n,c),w<u.z&&e.clone(n,u),w>l.z&&e.clone(n,l)}var M=e.magnitudeSquared(e.subtract(s,i,v)),x=e.magnitudeSquared(e.subtract(c,o,v)),C=e.magnitudeSquared(e.subtract(l,u,v)),P=i,D=s,L=M;x>L&&(L=x,P=o,D=c),C>L&&(L=C,P=u,D=l);var U=R;U.x=.5*(P.x+D.x),U.y=.5*(P.y+D.y),U.z=.5*(P.z+D.z);var b=e.magnitudeSquared(e.subtract(D,U,v)),F=Math.sqrt(b),z=A;z.x=i.x,z.y=o.y,z.z=u.z;var B=S;B.x=s.x,B.y=c.y,B.z=l.z;var G=e.multiplyByScalar(e.add(z,B,v),.5,N),q=0;for(g=0;g<f;g++){e.clone(t[g],n);var V=e.magnitude(e.subtract(n,G,v));V>q&&(q=V);var W=e.magnitudeSquared(e.subtract(n,U,v));if(W>b){var X=Math.sqrt(W);F=.5*(F+X),b=F*F;var H=X-F;U.x=(F*U.x+H*n.x)/X,U.y=(F*U.y+H*n.y)/X,U.z=(F*U.z+H*n.z)/X}}return F<q?(e.clone(U,r.center),r.radius=F):(e.clone(G,r.center),r.radius=q),r};var g=new o,I=new e,O=new e,w=new t,M=new t;d.fromRectangle2D=function(e,t,r){return d.fromRectangleWithHeights2D(e,t,0,0,r)},d.fromRectangleWithHeights2D=function(t,r,i,o,u){if(a(u)||(u=new d),!a(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;r=n(r,g),f.southwest(t,w),w.height=i,f.northeast(t,M),M.height=o;var s=r.project(w,I),c=r.project(M,O),l=c.x-s.x,h=c.y-s.y,E=c.z-s.z;u.radius=.5*Math.sqrt(l*l+h*h+E*E);var m=u.center;return m.x=s.x+.5*l,m.y=s.y+.5*h,m.z=s.z+.5*E,u};var x=[];d.fromRectangle3D=function(e,t,r,o){t=n(t,i.WGS84),r=n(r,0);var u;return a(e)&&(u=f.subsample(e,t,r,x)),d.fromPoints(u,o)},d.fromVertices=function(t,r,i,o){if(a(o)||(o=new d),!a(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;r=n(r,e.ZERO),i=n(i,3);var u=T;u.x=t[0]+r.x,u.y=t[1]+r.y,u.z=t[2]+r.z;for(var s=e.clone(u,h),c=e.clone(u,E),l=e.clone(u,m),f=e.clone(u,p),g=e.clone(u,y),I=e.clone(u,_),O=t.length,w=0;w<O;w+=i){var M=t[w]+r.x,x=t[w+1]+r.y,C=t[w+2]+r.z;u.x=M,u.y=x,u.z=C,M<s.x&&e.clone(u,s),M>f.x&&e.clone(u,f),x<c.y&&e.clone(u,c),x>g.y&&e.clone(u,g),C<l.z&&e.clone(u,l),C>I.z&&e.clone(u,I)}var P=e.magnitudeSquared(e.subtract(f,s,v)),D=e.magnitudeSquared(e.subtract(g,c,v)),L=e.magnitudeSquared(e.subtract(I,l,v)),U=s,b=f,F=P;D>F&&(F=D,U=c,b=g),L>F&&(F=L,U=l,b=I);var z=R;z.x=.5*(U.x+b.x),z.y=.5*(U.y+b.y),z.z=.5*(U.z+b.z);var B=e.magnitudeSquared(e.subtract(b,z,v)),G=Math.sqrt(B),q=A;q.x=s.x,q.y=c.y,q.z=l.z;var V=S;V.x=f.x,V.y=g.y,V.z=I.z;var W=e.multiplyByScalar(e.add(q,V,v),.5,N),X=0;for(w=0;w<O;w+=i){u.x=t[w]+r.x,u.y=t[w+1]+r.y,u.z=t[w+2]+r.z;var H=e.magnitude(e.subtract(u,W,v));H>X&&(X=H);var Y=e.magnitudeSquared(e.subtract(u,z,v));if(Y>B){var k=Math.sqrt(Y);G=.5*(G+k),B=G*G;var j=k-G;z.x=(G*z.x+j*u.x)/k,z.y=(G*z.y+j*u.y)/k,z.z=(G*z.z+j*u.z)/k}}return G<X?(e.clone(z,o.center),o.radius=G):(e.clone(W,o.center),o.radius=X),o},d.fromEncodedCartesianVertices=function(t,r,n){if(a(n)||(n=new d),!a(t)||!a(r)||t.length!==r.length||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var i=T;i.x=t[0]+r[0],i.y=t[1]+r[1],i.z=t[2]+r[2];for(var o=e.clone(i,h),u=e.clone(i,E),s=e.clone(i,m),c=e.clone(i,p),l=e.clone(i,y),f=e.clone(i,_),g=t.length,I=0;I<g;I+=3){var O=t[I]+r[I],w=t[I+1]+r[I+1],M=t[I+2]+r[I+2];i.x=O,i.y=w,i.z=M,O<o.x&&e.clone(i,o),O>c.x&&e.clone(i,c),w<u.y&&e.clone(i,u),w>l.y&&e.clone(i,l),M<s.z&&e.clone(i,s),M>f.z&&e.clone(i,f)}var x=e.magnitudeSquared(e.subtract(c,o,v)),C=e.magnitudeSquared(e.subtract(l,u,v)),P=e.magnitudeSquared(e.subtract(f,s,v)),D=o,L=c,U=x;C>U&&(U=C,D=u,L=l),P>U&&(U=P,D=s,L=f);var b=R;b.x=.5*(D.x+L.x),b.y=.5*(D.y+L.y),b.z=.5*(D.z+L.z);var F=e.magnitudeSquared(e.subtract(L,b,v)),z=Math.sqrt(F),B=A;B.x=o.x,B.y=u.y,B.z=s.z;var G=S;G.x=c.x,G.y=l.y,G.z=f.z;var q=e.multiplyByScalar(e.add(B,G,v),.5,N),V=0;for(I=0;I<g;I+=3){i.x=t[I]+r[I],i.y=t[I+1]+r[I+1],i.z=t[I+2]+r[I+2];var W=e.magnitude(e.subtract(i,q,v));W>V&&(V=W);var X=e.magnitudeSquared(e.subtract(i,b,v));if(X>F){var H=Math.sqrt(X);z=.5*(z+H),F=z*z;var Y=H-z;b.x=(z*b.x+Y*i.x)/H,b.y=(z*b.y+Y*i.y)/H,b.z=(z*b.z+Y*i.z)/H}}return z<V?(e.clone(b,n.center),n.radius=z):(e.clone(q,n.center),n.radius=V),n},d.fromCornerPoints=function(t,r,n){a(n)||(n=new d);var i=n.center;return e.add(t,r,i),e.multiplyByScalar(i,.5,i),n.radius=e.distance(i,r),n},d.fromEllipsoid=function(t,r){return a(r)||(r=new d),e.clone(e.ZERO,r.center),r.radius=t.maximumRadius,r};var C=new e;d.fromBoundingSpheres=function(t,r){if(a(r)||(r=new d),!a(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var n=t.length;if(1===n)return d.clone(t[0],r);if(2===n)return d.union(t[0],t[1],r);for(var i=[],o=0;o<n;o++)i.push(t[o].center);r=d.fromPoints(i,r);var u=r.center,s=r.radius;for(o=0;o<n;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,C)+c.radius)}return r.radius=s,r};var P=new e,D=new e,L=new e;d.fromOrientedBoundingBox=function(t,r){a(r)||(r=new d);var n=t.halfAxes,i=c.getColumn(n,0,P),o=c.getColumn(n,1,D),u=c.getColumn(n,2,L),s=e.magnitude(i),l=e.magnitude(o),f=e.magnitude(u);return r.center=e.clone(t.center,r.center),r.radius=Math.max(s,l,f),r},d.clone=function(t,r){if(a(t))return a(r)?(r.center=e.clone(t.center,r.center),r.radius=t.radius,r):new d(t.center,t.radius)},d.packedLength=4,d.pack=function(e,t,r){r=n(r,0);var a=e.center;return t[r++]=a.x,t[r++]=a.y,t[r++]=a.z,t[r]=e.radius,t},d.unpack=function(e,t,r){t=n(t,0),a(r)||(r=new d);var i=r.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],r.radius=e[t],r};var U=new e,b=new e;d.union=function(t,r,n){a(n)||(n=new d);var i=t.center,o=t.radius,u=r.center,s=r.radius,c=e.subtract(u,i,U),l=e.magnitude(c);if(o>=l+s)return t.clone(n),n;if(s>=l+o)return r.clone(n),n;var f=.5*(o+l+s),h=e.multiplyByScalar(c,(-o+f)/l,b);return e.add(h,i,h),e.clone(h,n.center),n.radius=f,n};var F=new e;d.expand=function(t,r,n){n=d.clone(t,n);var a=e.magnitude(e.subtract(r,n.center,F));return a>n.radius&&(n.radius=a),n},d.intersectPlane=function(t,r){var n=t.center,a=t.radius,i=r.normal,o=e.dot(i,n)+r.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},d.transform=function(e,t,r){return a(r)||(r=new d),r.center=l.multiplyByPoint(t,e.center,r.center),r.radius=l.getMaximumScale(t)*e.radius,r};var z=new e;d.distanceSquaredTo=function(t,r){var n=e.subtract(t.center,r,z);return e.magnitudeSquared(n)-t.radius*t.radius},d.transformWithoutScale=function(e,t,r){return a(r)||(r=new d),r.center=l.multiplyByPoint(t,e.center,r.center),r.radius=e.radius,r};var B=new e;d.computePlaneDistances=function(t,r,n,i){a(i)||(i=new s);var o=e.subtract(t.center,r,B),u=e.dot(n,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var G=new e,q=new e,V=new e,W=new e,X=new e,H=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var j=new o;return d.projectTo2D=function(t,r,a){r=n(r,j);var i=r.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,G),c=e.cross(e.UNIT_Z,s,q);e.normalize(c,c);var l=e.cross(s,c,V);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var f=e.negate(l,X),h=e.negate(c,W),E=Y,m=E[0];e.add(s,l,m),e.add(m,c,m),m=E[1],e.add(s,l,m),e.add(m,h,m),m=E[2],e.add(s,f,m),e.add(m,h,m),m=E[3],e.add(s,f,m),e.add(m,c,m),e.negate(s,s),m=E[4],e.add(s,l,m),e.add(m,c,m),m=E[5],e.add(s,l,m),e.add(m,h,m),m=E[6],e.add(s,f,m),e.add(m,h,m),m=E[7],e.add(s,f,m),e.add(m,c,m);for(var p=E.length,y=0;y<p;++y){var _=E[y];e.add(o,_,_);var T=i.cartesianToCartographic(_,H);r.project(T,_)}a=d.fromPoints(E,a),o=a.center;var v=o.x,R=o.y,A=o.z;return o.x=A,o.y=v,o.z=R,a},d.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},d.equals=function(t,r){return t===r||a(t)&&a(r)&&e.equals(t.center,r.center)&&t.radius===r.radius},d.prototype.intersectPlane=function(e){return d.intersectPlane(this,e)},d.prototype.distanceSquaredTo=function(e){return d.distanceSquaredTo(this,e)},d.prototype.computePlaneDistances=function(e,t,r){return d.computePlaneDistances(this,e,t,r)},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/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i){"use strict";function o(e,r){this.x=t(e,0),this.y=t(r,0)}o.fromElements=function(e,t,n){return r(n)?(n.x=e,n.y=t,n):new o(e,t)},o.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t):new o(e.x,e.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n]=e.y,r},o.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new o),a.x=e[n++],a.y=e[n],a},o.packArray=function(e,t){var n=e.length;r(t)?t.length=2*n:t=new Array(2*n);for(var a=0;a<n;++a)o.pack(e[a],t,2*a);return t},o.unpackArray=function(e,t){var n=e.length;r(t)?t.length=n/2:t=new Array(n/2);for(var a=0;a<n;a+=2){var i=a/2;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y)},o.minimumComponent=function(e){return Math.min(e.x,e.y)},o.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),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},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var r=o.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y},o.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r},o.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r},o.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r},o.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r},o.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r},o.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var s=new o;o.lerp=function(e,t,r,n){return o.multiplyByScalar(t,r,s),n=o.multiplyByScalar(e,1-r,n),o.add(s,n,n)};var c=new o,l=new o;o.angleBetween=function(e,t){return o.normalize(e,c),o.normalize(t,l),i.acosClamped(o.dot(c,l))};var f=new o;return o.mostOrthogonalAxis=function(e,t){var r=o.normalize(e,f);return o.abs(r,r),t=r.x<=r.y?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y},o.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]},o.equalsEpsilon=function(e,t,n,a){return e===t||r(e)&&r(t)&&i.equalsEpsilon(e.x,t.x,n,a)&&i.equalsEpsilon(e.y,t.y,n,a)},o.ZERO=a(new o(0,0)),o.UNIT_X=a(new o(1,0)),o.UNIT_Y=a(new o(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,r){return o.equalsEpsilon(this,e,t,r)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),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},a={};return t(a,{element:{get:function(){if(a.supportsFullscreen())return document[n.fullscreenElement]; +}},changeEventName:{get:function(){if(a.supportsFullscreen())return n.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return n.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[n.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.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 a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(n.requestFullscreen=a,r=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(n.requestFullscreen=a,r=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?n.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(n.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?n.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(n.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?n.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(n.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),n.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),n.fullscreenerror=a)}return r},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[n.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[n.exitFullscreen]()},a}),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;r<n;++r)t[r]=parseInt(t[r],10);return t}function a(){if(!t(R)&&(R=!1,!d())){var e=/ Chrome\/([\.0-9]+)/.exec(v.userAgent);null!==e&&(R=!0,A=n(e[1]))}return R}function i(){return a()&&A}function o(){if(!t(S)&&(S=!1,!a()&&!d()&&/ Safari\/[\.0-9]+/.test(v.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(v.userAgent);null!==e&&(S=!0,N=n(e[1]))}return S}function u(){return o()&&N}function s(){if(!t(g)){g=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(v.userAgent);null!==e&&(g=!0,I=n(e[1]),I.isNightly=!!e[2])}return g}function c(){return s()&&I}function l(){if(!t(O)){O=!1;var e;"Microsoft Internet Explorer"===v.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(v.userAgent),null!==e&&(O=!0,w=n(e[1]))):"Netscape"===v.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(v.userAgent),null!==e&&(O=!0,w=n(e[1])))}return O}function f(){return l()&&w}function d(){if(!t(M)){M=!1;var e=/ Edge\/([\.0-9]+)/.exec(v.userAgent);null!==e&&(M=!0,x=n(e[1]))}return M}function h(){return d()&&x}function E(){if(!t(C)){C=!1;var e=/Firefox\/([\.0-9]+)/.exec(v.userAgent);null!==e&&(C=!0,P=n(e[1]))}return C}function m(){return t(D)||(D=/Windows/i.test(v.appVersion)),D}function p(){return E()&&P}function y(){return t(L)||(L="undefined"!=typeof PointerEvent&&(!t(v.pointerEnabled)||v.pointerEnabled)),L}function _(){if(!t(b)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var r=e.style.imageRendering;b=t(r)&&""!==r,b&&(U=r)}return b}function T(){return _()?U:void 0}var v;v="undefined"!=typeof navigator?navigator:{};var R,A,S,N,g,I,O,w,M,x,C,P,D,L,U,b,F={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isEdge:d,edgeVersion:h,isFirefox:E,firefoxVersion:p,isWindows:m,hardwareConcurrency:e(v.hardwareConcurrency,3),supportsPointerEvents:y,supportsImageRenderingPixelated:_,imageRenderingValue:T};return F.supportsFullscreen=function(){return r.supportsFullscreen()},F.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},F.supportsWebWorkers=function(){return"undefined"!=typeof Worker},F}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,r,n,a,i){"use strict";if(!n.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){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.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},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 Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,r,n,a){switch(n=e(n,0),a=e(a,(r.byteLength-n)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(r,n,a);case o.UNSIGNED_BYTE:return new Uint8Array(r,n,a);case o.SHORT:return new Int16Array(r,n,a);case o.UNSIGNED_SHORT:return new Uint16Array(r,n,a);case o.INT:return new Int32Array(r,n,a);case o.UNSIGNED_INT:return new Uint32Array(r,n,a);case o.FLOAT:return new Float32Array(r,n,a);case o.DOUBLE:return new Float64Array(r,n,a)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/Quaternion",["./Cartesian3","./Check","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math","./Matrix3"],function(e,t,r,n,a,i,o,u,s){"use strict";function c(e,t,n,a){this.x=r(e,0),this.y=r(t,0),this.z=r(n,0),this.w=r(a,0)}var l=new e;c.fromAxisAngle=function(t,r,a){var i=r/2,o=Math.sin(i);l=e.normalize(t,l);var u=l.x*o,s=l.y*o,f=l.z*o,d=Math.cos(i);return n(a)?(a.x=u,a.y=s,a.z=f,a.w=d,a):new c(u,s,f,d)};var f=[1,2,0],d=new Array(3);c.fromRotationMatrix=function(e,t){var r,a,i,o,u,l=e[s.COLUMN0ROW0],h=e[s.COLUMN1ROW1],E=e[s.COLUMN2ROW2],m=l+h+E;if(m>0)r=Math.sqrt(m+1),u=.5*r,r=.5/r,a=(e[s.COLUMN1ROW2]-e[s.COLUMN2ROW1])*r,i=(e[s.COLUMN2ROW0]-e[s.COLUMN0ROW2])*r,o=(e[s.COLUMN0ROW1]-e[s.COLUMN1ROW0])*r;else{var p=f,y=0;h>l&&(y=1),E>l&&E>h&&(y=2);var _=p[y],T=p[_];r=Math.sqrt(e[s.getElementIndex(y,y)]-e[s.getElementIndex(_,_)]-e[s.getElementIndex(T,T)]+1);var v=d;v[y]=.5*r,r=.5/r,u=(e[s.getElementIndex(T,_)]-e[s.getElementIndex(_,T)])*r,v[_]=(e[s.getElementIndex(_,y)]+e[s.getElementIndex(y,_)])*r,v[T]=(e[s.getElementIndex(T,y)]+e[s.getElementIndex(y,T)])*r,a=-v[0],i=-v[1],o=-v[2]}return n(t)?(t.x=a,t.y=i,t.z=o,t.w=u,t):new c(a,i,o,u)};var h=new c;c.fromHeadingPitchRoll=function(t,r,n,a){var i=c.fromAxisAngle(e.UNIT_X,n,h),o=c.fromAxisAngle(e.UNIT_Y,-r,a);a=c.multiply(o,i,o);var u=c.fromAxisAngle(e.UNIT_Z,-t,h);return c.multiply(u,a,a)};var E=new e,m=new e,p=new c,y=new c,_=new c;c.packedLength=4,c.pack=function(e,t,n){return n=r(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t},c.unpack=function(e,t,a){return t=r(t,0),n(a)||(a=new c),a.x=e[t],a.y=e[t+1],a.z=e[t+2],a.w=e[t+3],a},c.packedInterpolationLength=3,c.convertPackedArrayForInterpolation=function(e,t,r,n){c.unpack(e,4*r,_),c.conjugate(_,_);for(var a=0,i=r-t+1;a<i;a++){var o=3*a;c.unpack(e,4*(t+a),p),c.multiply(p,_,p),p.w<0&&c.negate(p,p),c.computeAxis(p,E);var u=c.computeAngle(p);n[o]=E.x*u,n[o+1]=E.y*u,n[o+2]=E.z*u}},c.unpackInterpolationResult=function(t,r,a,i,o){n(o)||(o=new c),e.fromArray(t,0,m);var u=e.magnitude(m);return c.unpack(r,4*i,y),0===u?c.clone(c.IDENTITY,p):c.fromAxisAngle(m,u,p),c.multiply(p,y,o)},c.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new c(e.x,e.y,e.z,e.w)},c.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},c.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},c.magnitude=function(e){return Math.sqrt(c.magnitudeSquared(e))},c.normalize=function(e,t){var r=1/c.magnitude(e),n=e.x*r,a=e.y*r,i=e.z*r,o=e.w*r;return t.x=n,t.y=a,t.z=i,t.w=o,t},c.inverse=function(e,t){var r=c.magnitudeSquared(e);return t=c.conjugate(e,t),c.multiplyByScalar(t,1/r,t)},c.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},c.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},c.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},c.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},c.multiply=function(e,t,r){var n=e.x,a=e.y,i=e.z,o=e.w,u=t.x,s=t.y,c=t.z,l=t.w,f=o*u+n*l+a*c-i*s,d=o*s-n*c+a*l+i*u,h=o*c+n*s-a*u+i*l,E=o*l-n*u-a*s-i*c;return r.x=f,r.y=d,r.z=h,r.w=E,r},c.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},c.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},c.computeAxis=function(e,t){var r=e.w;if(Math.abs(r-1)<u.EPSILON6)return t.x=t.y=t.z=0,t;var n=1/Math.sqrt(1-r*r);return t.x=e.x*n,t.y=e.y*n,t.z=e.z*n,t},c.computeAngle=function(e){return Math.abs(e.w-1)<u.EPSILON6?0:2*Math.acos(e.w)};var T=new c;c.lerp=function(e,t,r,n){return T=c.multiplyByScalar(t,r,T),n=c.multiplyByScalar(e,1-r,n),c.add(T,n,n)};var v=new c,R=new c,A=new c;c.slerp=function(e,t,r,n){var a=c.dot(e,t),i=t;if(a<0&&(a=-a,i=v=c.negate(t,v)),1-a<u.EPSILON6)return c.lerp(e,i,r,n);var o=Math.acos(a);return R=c.multiplyByScalar(e,Math.sin((1-r)*o),R),A=c.multiplyByScalar(i,Math.sin(r*o),A),n=c.add(R,A,n),c.multiplyByScalar(n,1/Math.sin(o),n)},c.log=function(t,r){var n=u.acosClamped(t.w),a=0;return 0!==n&&(a=n/Math.sin(n)),e.multiplyByScalar(t,a,r)},c.exp=function(t,r){var n=e.magnitude(t),a=0;return 0!==n&&(a=Math.sin(n)/n),r.x=t.x*a,r.y=t.y*a,r.z=t.z*a,r.w=Math.cos(n),r};var S=new e,N=new e,g=new c,I=new c;c.computeInnerQuadrangle=function(t,r,n,a){var i=c.conjugate(r,g);c.multiply(i,n,I);var o=c.log(I,S);c.multiply(i,t,I);var u=c.log(I,N);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),c.exp(o,g),c.multiply(r,g,a)},c.squad=function(e,t,r,n,a,i){var o=c.slerp(e,t,a,g),u=c.slerp(r,n,a,I);return c.slerp(o,u,2*a*(1-a),i)};for(var O=new c,w=1.9011074535173003,M=i.supportsTypedArrays()?new Float32Array(8):[],x=i.supportsTypedArrays()?new Float32Array(8):[],C=i.supportsTypedArrays()?new Float32Array(8):[],P=i.supportsTypedArrays()?new Float32Array(8):[],D=0;D<7;++D){var L=D+1,U=2*L+1;M[D]=1/(L*U),x[D]=L/U}return M[7]=w/136,x[7]=8*w/17,c.fastSlerp=function(e,t,r,n){var a,i=c.dot(e,t);i>=0?a=1:(a=-1,i=-i);for(var o=i-1,u=1-r,s=r*r,l=u*u,f=7;f>=0;--f)C[f]=(M[f]*s-x[f])*o,P[f]=(M[f]*l-x[f])*o;var d=a*r*(1+C[0]*(1+C[1]*(1+C[2]*(1+C[3]*(1+C[4]*(1+C[5]*(1+C[6]*(1+C[7])))))))),h=u*(1+P[0]*(1+P[1]*(1+P[2]*(1+P[3]*(1+P[4]*(1+P[5]*(1+P[6]*(1+P[7])))))))),E=c.multiplyByScalar(e,h,O);return c.multiplyByScalar(t,d,n),c.add(E,n,n)},c.fastSquad=function(e,t,r,n,a,i){var o=c.fastSlerp(e,t,a,g),u=c.fastSlerp(r,n,a,I);return c.fastSlerp(o,u,2*a*(1-a),i)},c.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},c.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.x-t.x)<=r&&Math.abs(e.y-t.y)<=r&&Math.abs(e.z-t.z)<=r&&Math.abs(e.w-t.w)<=r},c.ZERO=o(new c(0,0,0,0)),c.IDENTITY=o(new c(0,0,0,1)),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.x+", "+this.y+", "+this.z+", "+this.w+")"},c}),define("Core/EllipseGeometryLibrary",["./Cartesian3","./Math","./Matrix3","./Quaternion"],function(e,t,r,n){"use strict";function a(t,a,i,l,f,d,h,E,m,p){var y=t+a;e.multiplyByScalar(l,Math.cos(y),o),e.multiplyByScalar(i,Math.sin(y),u),e.add(o,u,o);var _=Math.cos(t);_*=_;var T=Math.sin(t);T*=T;var v=d/Math.sqrt(h*_+f*T),R=v/E;return n.fromAxisAngle(o,R,s),r.fromQuaternion(s,c),r.multiplyByVector(c,m,p),e.normalize(p,p),e.multiplyByScalar(p,E,p),p}var i={},o=new e,u=new e,s=new n,c=new r,l=new e,f=new e,d=new e,h=new e;i.raisePositionsToHeight=function(t,r,n){for(var a=r.ellipsoid,i=r.height,o=r.extrudedHeight,u=n?t.length/3*2:t.length/3,s=new Float64Array(3*u),c=t.length,E=n?c:0,m=0;m<c;m+=3){var p=m+1,y=m+2,_=e.fromArray(t,m,l);a.scaleToGeodeticSurface(_,_);var T=e.clone(_,f),v=a.geodeticSurfaceNormal(_,h),R=e.multiplyByScalar(v,i,d);e.add(_,R,_),n&&(e.multiplyByScalar(v,o,R),e.add(T,R,T),s[m+E]=T.x,s[p+E]=T.y,s[y+E]=T.z),s[m]=_.x,s[p]=_.y,s[y]=_.z}return s};var E=new e,m=new e,p=new e;return i.computeEllipsePositions=function(r,n,i){var o=r.semiMinorAxis,u=r.semiMajorAxis,s=r.rotation,c=r.center,h=8*r.granularity,y=o*o,_=u*u,T=u*o,v=e.magnitude(c),R=e.normalize(c,E),A=e.cross(e.UNIT_Z,c,m);A=e.normalize(A,A);var S=e.cross(R,A,p),N=1+Math.ceil(t.PI_OVER_TWO/h),g=t.PI_OVER_TWO/(N-1),I=t.PI_OVER_TWO-N*g;I<0&&(N-=Math.ceil(Math.abs(I)/g));var O,w,M,x,C,P=2*(N*(N+2)),D=n?new Array(3*P):void 0,L=0,U=l,b=f,F=4*N*3,z=F-1,B=0,G=i?new Array(F):void 0;for(I=t.PI_OVER_TWO,U=a(I,s,S,A,y,T,_,v,R,U),n&&(D[L++]=U.x,D[L++]=U.y,D[L++]=U.z),i&&(G[z--]=U.z,G[z--]=U.y,G[z--]=U.x),I=t.PI_OVER_TWO-g,O=1;O<N+1;++O){if(U=a(I,s,S,A,y,T,_,v,R,U),b=a(Math.PI-I,s,S,A,y,T,_,v,R,b),n){for(D[L++]=U.x,D[L++]=U.y,D[L++]=U.z,M=2*O+2,w=1;w<M-1;++w)x=w/(M-1),C=e.lerp(U,b,x,d),D[L++]=C.x,D[L++]=C.y,D[L++]=C.z;D[L++]=b.x,D[L++]=b.y,D[L++]=b.z}i&&(G[z--]=U.z,G[z--]=U.y,G[z--]=U.x,G[B++]=b.x,G[B++]=b.y,G[B++]=b.z),I=t.PI_OVER_TWO-(O+1)*g}for(O=N;O>1;--O){if(I=t.PI_OVER_TWO-(O-1)*g,U=a(-I,s,S,A,y,T,_,v,R,U),b=a(I+Math.PI,s,S,A,y,T,_,v,R,b),n){for(D[L++]=U.x,D[L++]=U.y,D[L++]=U.z,M=2*(O-1)+2,w=1;w<M-1;++w)x=w/(M-1),C=e.lerp(U,b,x,d),D[L++]=C.x,D[L++]=C.y,D[L++]=C.z;D[L++]=b.x,D[L++]=b.y,D[L++]=b.z}i&&(G[z--]=U.z,G[z--]=U.y,G[z--]=U.x,G[B++]=b.x,G[B++]=b.y,G[B++]=b.z)}I=t.PI_OVER_TWO,U=a(-I,s,S,A,y,T,_,v,R,U);var q={};return n&&(D[L++]=U.x,D[L++]=U.y,D[L++]=U.z,q.positions=D,q.numPts=N),i&&(G[z--]=U.z,G[z--]=U.y,G[z--]=U.x,q.outerPositions=G),q},i}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var r={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,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,t,r,n,a){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,a.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,n.NONE),this.boundingSphereCV=t.boundingSphereCV}return i.computeNumberOfVertices=function(e){var r=-1;for(var n in e.attributes)if(e.attributes.hasOwnProperty(n)&&t(e.attributes[n])&&t(e.attributes[n].values)){var a=e.attributes[n],i=a.values.length/a.componentsPerAttribute;r=i}return r},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(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 n}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/GeometryInstance",["./defaultValue","./defined","./DeveloperError","./Matrix4"],function(e,t,r,n){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.geometry=t.geometry,this.modelMatrix=n.clone(e(t.modelMatrix,n.IDENTITY)),this.id=t.id,this.pickPrimitive=t.pickPrimitive,this.attributes=e(t.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}return a}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,r,n,a){"use strict";var i={};i.octEncodeInRange=function(e,t,r){if(r.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),r.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var n=r.x,i=r.y;r.x=(1-Math.abs(i))*a.signNotZero(n),r.y=(1-Math.abs(n))*a.signNotZero(i)}return r.x=a.toSNorm(r.x,t),r.y=a.toSNorm(r.y,t),r},i.octEncode=function(e,t){return i.octEncodeInRange(e,255,t)},i.octDecodeInRange=function(e,r,n,i){if(i.x=a.fromSNorm(e,n),i.y=a.fromSNorm(r,n),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){var o=i.x;i.x=(1-Math.abs(i.y))*a.signNotZero(o),i.y=(1-Math.abs(o))*a.signNotZero(i.y)}return t.normalize(i,i)},i.octDecode=function(e,t,r){return i.octDecodeInRange(e,t,255,r)},i.octPackFloat=function(e){return 256*e.x+e.y};var o=new e;return i.octEncodeFloat=function(e){return i.octEncode(e,o),i.octPackFloat(o)},i.octDecodeFloat=function(e,t){var r=e/256,n=Math.floor(r),a=256*(r-n);return i.octDecode(n,a,t)},i.octPack=function(e,t,r,n){var a=i.octEncodeFloat(e),u=i.octEncodeFloat(t),s=i.octEncode(r,o);return n.x=65536*s.x+a,n.y=65536*s.y+u,n},i.octUnpack=function(e,t,r,n){var a=e.x/65536,o=Math.floor(a),u=65536*(a-o);a=e.y/65536;var s=Math.floor(a),c=65536*(a-s);i.octDecodeFloat(u,t),i.octDecodeFloat(c,r),i.octDecode(o,s,n)},i.compressTextureCoordinates=function(e){var t=4095*e.x|0,r=4095*e.y|0;return 4096*t+r},i.decompressTextureCoordinates=function(e,t){var r=e/4096,n=Math.floor(r);return t.x=n/4095,t.y=(e-4096*n)/4095,t},i}),define("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function a(n,a,s,c,l){r(l)||(l=new t);var f,d,h,E,m,p,y,_;r(a.z)?(f=t.subtract(s,a,i),d=t.subtract(c,a,o), +h=t.subtract(n,a,u),E=t.dot(f,f),m=t.dot(f,d),p=t.dot(f,h),y=t.dot(d,d),_=t.dot(d,h)):(f=e.subtract(s,a,i),d=e.subtract(c,a,o),h=e.subtract(n,a,u),E=e.dot(f,f),m=e.dot(f,d),p=e.dot(f,h),y=e.dot(d,d),_=e.dot(d,h));var T=1/(E*y-m*m);return l.y=(y*p-m*_)*T,l.z=(E*_-m*p)*T,l.x=1-l.y-l.z,l}var i=new t,o=new t,u=new t;return a}),define("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(r,n){t(a[r])||(a[r]=!0,console.warn(e(n,r)))}var a={};return n.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.",n}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,r){"use strict";function n(e,t){r(e,t)}return n}),define("Core/EncodedCartesian3",["./Cartesian3","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(){this.high=e.clone(e.ZERO),this.low=e.clone(e.ZERO)}n.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 a={high:0,low:0};n.fromCartesian=function(e,r){t(r)||(r=new n);var i=r.high,o=r.low;return n.encode(e.x,a),i.x=a.high,o.x=a.low,n.encode(e.y,a),i.y=a.high,o.y=a.low,n.encode(e.z,a),i.z=a.high,o.z=a.low,r};var i=new n;return n.writeElements=function(e,t,r){n.fromCartesian(e,i);var a=i.high,o=i.low;t[r]=a.x,t[r+1]=a.y,t[r+2]=a.z,t[r+3]=o.x,t[r+4]=o.y,t[r+5]=o.z},n}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,r,n,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(e){switch(e){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(t){return e(t)&&(t===i.UNSIGNED_BYTE||t===i.UNSIGNED_SHORT||t===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,r,a){return e>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,r,a):new Uint16Array(t,r,a)},r(i)}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function r(e,r,n){var a=e+r;return t.sign(e)!==t.sign(r)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(r)))<n?0:a}var n={};return n.computeDiscriminant=function(e,t,r){var n=t*t-4*e*r;return n},n.computeRealRoots=function(e,n,a){var i;if(0===e)return 0===n?[]:[-a/n];if(0===n){if(0===a)return[0,0];var o=Math.abs(a),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,i<0)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-n/e,i<0?[i,0]:[0,i];var c=n*n,l=4*e*a,f=r(c,-l,t.EPSILON14);if(f<0)return[];var d=-.5*r(n,t.sign(n)*Math.sqrt(f),t.EPSILON14);return n>0?[d/e,a/d]:[a/d,d/e]},n}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function r(e,t,r,n){var a,i,o=e,u=t/3,s=r/3,c=n,l=o*s,f=u*c,d=u*u,h=s*s,E=o*s-d,m=o*c-u*s,p=u*c-h,y=4*E*p-m*m;if(y<0){var _,T,v;d*f>=l*h?(_=o,T=E,v=-2*u*E+o*m):(_=c,T=p,v=-c*m+2*s*p);var R=v<0?-1:1,A=-R*Math.abs(_)*Math.sqrt(-y);i=-v+A;var S=i/2,N=S<0?-Math.pow(-S,1/3):Math.pow(S,1/3),g=i===A?-N:-T/N;return a=T<=0?N+g:-v/(N*N+g*g+T),d*f>=l*h?[(a-u)/o]:[-c/(a+s)]}var I=E,O=-2*u*E+o*m,w=p,M=-c*m+2*s*p,x=Math.sqrt(y),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*x,-O)/3);a=2*Math.sqrt(-I);var D=Math.cos(P);i=a*D;var L=a*(-D/2-C*Math.sin(P)),U=i+L>2*u?i-u:L-u,b=o,F=U/b;P=Math.abs(Math.atan2(c*x,-M)/3),a=2*Math.sqrt(-w),D=Math.cos(P),i=a*D,L=a*(-D/2-C*Math.sin(P));var z=-c,B=i+L<2*s?i+s:L+s,G=z/B,q=b*B,V=-U*B-b*z,W=U*z,X=(s*V-u*W)/(-u*V+s*q);return F<=X?F<=G?X<=G?[F,X,G]:[F,G,X]:[G,F,X]:F<=G?[X,F,G]:X<=G?[X,G,F]:[G,X,F]}var n={};return n.computeDiscriminant=function(e,t,r,n){var a=e*e,i=t*t,o=r*r,u=n*n,s=18*e*t*r*n+i*o-27*a*u-4*(e*o*r+i*t*n);return s},n.computeRealRoots=function(e,n,a,i){var o,u;if(0===e)return t.computeRealRoots(n,a,i);if(0===n){if(0===a){if(0===i)return[0,0,0];u=-i/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===i?(o=t.computeRealRoots(e,0,a),0===o.Length?[0]:[o[0],0,o[1]]):r(e,0,a,i)}return 0===a?0===i?(u=-n/e,u<0?[u,0,0]:[0,0,u]):r(e,n,0,i):0===i?(o=t.computeRealRoots(e,n,a),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):r(e,n,a,i)},n}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,r,n){"use strict";function a(t,a,i,o){var u=t*t,s=a-3*u/8,c=i-a*t/2+u*t/8,l=o-i*t/4+a*u/16-3*u*u/256,f=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(f.length>0){var d=-t/4,h=f[f.length-1];if(Math.abs(h)<r.EPSILON14){var E=n.computeRealRoots(1,s,l);if(2===E.length){var m,p=E[0],y=E[1];if(p>=0&&y>=0){var _=Math.sqrt(p),T=Math.sqrt(y);return[d-T,d-_,d+_,d+T]}if(p>=0&&y<0)return m=Math.sqrt(p),[d-m,d+m];if(p<0&&y>=0)return m=Math.sqrt(y),[d-m,d+m]}return[]}if(h>0){var v=Math.sqrt(h),R=(s+h-c/v)/2,A=(s+h+c/v)/2,S=n.computeRealRoots(1,v,R),N=n.computeRealRoots(1,-v,A);return 0!==S.length?(S[0]+=d,S[1]+=d,0!==N.length?(N[0]+=d,N[1]+=d,S[1]<=N[0]?[S[0],S[1],N[0],N[1]]:N[1]<=S[0]?[N[0],N[1],S[0],S[1]]:S[0]>=N[0]&&S[1]<=N[1]?[N[0],S[0],S[1],N[1]]:N[0]>=S[0]&&N[1]<=S[1]?[S[0],N[0],N[1],S[1]]:S[0]>N[0]&&S[0]<N[1]?[N[0],S[0],N[1],S[1]]:[S[0],N[0],S[1],N[1]]):S):0!==N.length?(N[0]+=d,N[1]+=d,N):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,f=i*t+s-4*o,d=c*o-i*a*t+u,h=e.computeRealRoots(1,l,f,d);if(h.length>0){var E,m,p=h[0],y=a-p,_=y*y,T=t/2,v=y/2,R=_-4*o,A=_+4*Math.abs(o),S=c-4*p,N=c+4*Math.abs(p);if(p<0||R*N<S*A){var g=Math.sqrt(S);E=g/2,m=0===g?0:(t*v-i)/g}else{var I=Math.sqrt(R);E=0===I?0:(t*v-i)/I,m=I/2}var O,w;0===T&&0===E?(O=0,w=0):r.sign(T)===r.sign(E)?(O=T+E,w=p/O):(w=T-E,O=p/w);var M,x;0===v&&0===m?(M=0,x=0):r.sign(v)===r.sign(m)?(M=v+m,x=o/M):(x=v-m,M=o/x);var C=n.computeRealRoots(1,O,M),P=n.computeRealRoots(1,w,x);if(0!==C.length)return 0!==P.length?C[1]<=P[0]?[C[0],C[1],P[0],P[1]]:P[1]<=C[0]?[P[0],P[1],C[0],C[1]]:C[0]>=P[0]&&C[1]<=P[1]?[P[0],C[0],C[1],P[1]]:P[0]>=C[0]&&P[1]<=C[1]?[C[0],P[0],P[1],C[1]]:C[0]>P[0]&&C[0]<P[1]?[P[0],C[0],P[1],C[1]]:[C[0],P[0],C[1],P[1]]:C;if(0!==P.length)return P}return[]}var o={};return o.computeDiscriminant=function(e,t,r,n,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=r*r,l=c*r,f=n*n,d=f*n,h=a*a,E=h*a,m=u*c*f-4*s*d-4*e*l*f+18*e*t*r*d-27*i*f*f+256*o*E+a*(18*s*r*n-4*u*l+16*e*c*c-80*e*t*c*n-6*e*u*f+144*i*r*f)+h*(144*e*u*r-27*u*u-128*i*c-192*i*t*n);return m},o.computeRealRoots=function(t,n,o,u,s){if(Math.abs(t)<r.EPSILON15)return e.computeRealRoots(n,o,u,s);var c=n/t,l=o/t,f=u/t,d=s/t,h=c<0?1:0;switch(h+=l<0?h+1:h,h+=f<0?h+1:h,h+=d<0?h+1:h){case 0:return a(c,l,f,d);case 1:return i(c,l,f,d);case 2:return i(c,l,f,d);case 3:return a(c,l,f,d);case 4:return a(c,l,f,d);case 5:return i(c,l,f,d);case 6:return a(c,l,f,d);case 7:return a(c,l,f,d);case 8:return i(c,l,f,d);case 9:return a(c,l,f,d);case 10:return a(c,l,f,d);case 11:return i(c,l,f,d);case 12:return a(c,l,f,d);case 13:return a(c,l,f,d);case 14:return a(c,l,f,d);case 15:return a(c,l,f,d);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function a(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 a.getPoint=function(t,n,a){return r(a)||(a=new e),a=e.multiplyByScalar(t.direction,n,a),e.add(t.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,r,n,a,i,o,u,s,c,l){"use strict";function f(e,t,r,n){var a=t*t-4*e*r;if(!(a<0)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return u<s?(n.root0=u,n.root1=s):(n.root0=s,n.root1=u),n}var c=-t/(2*e);if(0!==c)return n.root0=n.root1=c,n}}function d(t,r,a){n(a)||(a=new i);var o=t.origin,u=t.direction,s=r.center,c=r.radius*r.radius,l=e.subtract(o,s,_),d=e.dot(u,u),h=2*e.dot(u,l),E=e.magnitudeSquared(l)-c,m=f(d,h,E,A);if(n(m))return a.start=m.root0,a.stop=m.root1,a}function h(e,t,r){var n=e+t;return o.sign(e)!==o.sign(t)&&Math.abs(n/Math.max(Math.abs(e),Math.abs(t)))<r?0:n}function E(t,r,n,a,i){var l,f=a*a,d=i*i,E=(t[u.COLUMN1ROW1]-t[u.COLUMN2ROW2])*d,m=i*(a*h(t[u.COLUMN1ROW0],t[u.COLUMN0ROW1],o.EPSILON15)+r.y),p=t[u.COLUMN0ROW0]*f+t[u.COLUMN2ROW2]*d+a*r.x+n,y=d*h(t[u.COLUMN2ROW1],t[u.COLUMN1ROW2],o.EPSILON15),_=i*(a*h(t[u.COLUMN2ROW0],t[u.COLUMN0ROW2])+r.z),T=[];if(0===_&&0===y){if(l=s.computeRealRoots(E,m,p),0===l.length)return T;var v=l[0],R=Math.sqrt(Math.max(1-v*v,0));if(T.push(new e(a,i*v,i*-R)),T.push(new e(a,i*v,i*R)),2===l.length){var A=l[1],S=Math.sqrt(Math.max(1-A*A,0));T.push(new e(a,i*A,i*-S)),T.push(new e(a,i*A,i*S))}return T}var N=_*_,g=y*y,I=E*E,O=_*y,w=I+g,M=2*(m*E+O),x=2*p*E+m*m-g+N,C=2*(p*m-O),P=p*p-N;if(0===w&&0===M&&0===x&&0===C)return T;l=c.computeRealRoots(w,M,x,C,P);var D=l.length;if(0===D)return T;for(var L=0;L<D;++L){var U,b=l[L],F=b*b,z=Math.max(1-F,0),B=Math.sqrt(z);U=o.sign(E)===o.sign(p)?h(E*F+p,m*b,o.EPSILON12):o.sign(p)===o.sign(m*b)?h(E*F,m*b+p,o.EPSILON12):h(E*F+m*b,p,o.EPSILON12);var G=h(y*b,_,o.EPSILON15),q=U*G;q<0?T.push(new e(a,i*b,i*B)):q>0?T.push(new e(a,i*b,i*-B)):0!==B?(T.push(new e(a,i*b,i*-B)),T.push(new e(a,i*b,i*B)),++L):T.push(new e(a,i*b,i*B))}return T}var m={};m.rayPlane=function(t,r,a){n(a)||(a=new e);var i=t.origin,u=t.direction,s=r.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON15)){var l=(-r.distance-e.dot(s,i))/c;if(!(l<0))return a=e.multiplyByScalar(u,l,a),e.add(i,a,a)}};var p=new e,y=new e,_=new e,T=new e,v=new e;m.rayTriangleParametric=function(t,n,a,i,u){u=r(u,!1);var s,c,l,f,d,h=t.origin,E=t.direction,m=e.subtract(a,n,p),R=e.subtract(i,n,y),A=e.cross(E,R,_),S=e.dot(m,A);if(u){if(S<o.EPSILON6)return;if(s=e.subtract(h,n,T),l=e.dot(s,A),l<0||l>S)return;if(c=e.cross(s,m,v),f=e.dot(E,c),f<0||l+f>S)return;d=e.dot(R,c)/S}else{if(Math.abs(S)<o.EPSILON6)return;var N=1/S;if(s=e.subtract(h,n,T),l=e.dot(s,A)*N,l<0||l>1)return;if(c=e.cross(s,m,v),f=e.dot(E,c)*N,f<0||l+f>1)return;d=e.dot(R,c)*N}return d},m.rayTriangle=function(t,r,a,i,o,u){var s=m.rayTriangleParametric(t,r,a,i,o);if(n(s)&&!(s<0))return n(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var R=new l;m.lineSegmentTriangle=function(t,r,a,i,o,u,s){var c=R;e.clone(t,c.origin),e.subtract(r,t,c.direction),e.normalize(c.direction,c.direction);var l=m.rayTriangleParametric(c,a,i,o,u);if(!(!n(l)||l<0||l>e.distance(t,r)))return n(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var A={root0:0,root1:0};m.raySphere=function(e,t,r){if(r=d(e,t,r),n(r)&&!(r.stop<0))return r.start=Math.max(r.start,0),r};var S=new l;m.lineSegmentSphere=function(t,r,a,i){var o=S;e.clone(t,o.origin);var u=e.subtract(r,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),i=d(o,a,i),!(!n(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var N=new e,g=new e;m.rayEllipsoid=function(t,r){var n,a,o,u,s,c=r.oneOverRadii,l=e.multiplyComponents(c,t.origin,N),f=e.multiplyComponents(c,t.direction,g),d=e.magnitudeSquared(l),h=e.dot(l,f);if(d>1){if(h>=0)return;var E=h*h;if(n=d-1,a=e.magnitudeSquared(f),o=a*n,E<o)return;if(E>o){u=h*h-o,s=-h+Math.sqrt(u);var m=s/a,p=n/s;return m<p?new i(m,p):{start:p,stop:m}}var y=Math.sqrt(n/a);return new i(y,y)}return d<1?(n=d-1,a=e.magnitudeSquared(f),o=a*n,u=h*h-o,s=-h+Math.sqrt(u),new i(0,s/a)):h<0?(a=e.magnitudeSquared(f),new i(0,-h/a)):void 0};var I=new e,O=new e,w=new e,M=new e,x=new e,C=new u,P=new u,D=new u,L=new u,U=new u,b=new u,F=new u,z=new e,B=new e,G=new t;m.grazingAltitudeLocation=function(t,r){var a=t.origin,i=t.direction;if(!e.equals(a,e.ZERO)){var s=r.geodeticSurfaceNormal(a,I);if(e.dot(i,s)>=0)return a}var c=n(this.rayEllipsoid(t,r)),l=r.transformPositionToScaledSpace(i,I),f=e.normalize(l,l),d=e.mostOrthogonalAxis(l,M),h=e.normalize(e.cross(d,f,O),O),m=e.normalize(e.cross(f,h,w),w),p=C;p[0]=f.x,p[1]=f.y,p[2]=f.z,p[3]=h.x,p[4]=h.y,p[5]=h.z,p[6]=m.x,p[7]=m.y,p[8]=m.z;var y=u.transpose(p,P),_=u.fromScale(r.radii,D),T=u.fromScale(r.oneOverRadii,L),v=U;v[0]=0,v[1]=-i.z,v[2]=i.y,v[3]=i.z,v[4]=0,v[5]=-i.x,v[6]=-i.y,v[7]=i.x,v[8]=0;var R,A,S=u.multiply(u.multiply(y,T,b),v,b),N=u.multiply(u.multiply(S,_,F),p,F),g=u.multiplyByVector(S,a,x),q=E(N,e.negate(g,I),0,0,1),V=q.length;if(V>0){for(var W=e.clone(e.ZERO,B),X=Number.NEGATIVE_INFINITY,H=0;H<V;++H){R=u.multiplyByVector(_,u.multiplyByVector(p,q[H],z),z);var Y=e.normalize(e.subtract(R,a,M),M),k=e.dot(Y,i);k>X&&(X=k,W=e.clone(R,W))}var j=r.cartesianToCartographic(W,G);return X=o.clamp(X,0,1),A=e.magnitude(e.subtract(W,a,M))*Math.sqrt(1-X*X),A=c?-A:A,j.height=A,r.cartographicToCartesian(j,new e)}};var q=new e;return m.lineSegmentPlane=function(t,r,a,i){n(i)||(i=new e);var u=e.subtract(r,t,q),s=a.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON6)){var l=e.dot(s,t),f=-(a.distance+l)/c;if(!(f<0||f>1))return e.multiplyByScalar(u,f,i),e.add(t,i,i),i}},m.trianglePlaneIntersection=function(t,r,n,a){var i=a.normal,o=a.distance,u=e.dot(i,t)+o<0,s=e.dot(i,r)+o<0,c=e.dot(i,n)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var f,d;if(1!==l&&2!==l||(f=new e,d=new e),1===l){if(u)return m.lineSegmentPlane(t,r,a,f),m.lineSegmentPlane(t,n,a,d),{positions:[t,r,n,f,d],indices:[0,3,4,1,2,4,1,4,3]};if(s)return m.lineSegmentPlane(r,n,a,f),m.lineSegmentPlane(r,t,a,d),{positions:[t,r,n,f,d],indices:[1,3,4,2,0,4,2,4,3]};if(c)return m.lineSegmentPlane(n,t,a,f),m.lineSegmentPlane(n,r,a,d),{positions:[t,r,n,f,d],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return m.lineSegmentPlane(r,t,a,f),m.lineSegmentPlane(n,t,a,d),{positions:[t,r,n,f,d],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return m.lineSegmentPlane(n,r,a,f),m.lineSegmentPlane(t,r,a,d),{positions:[t,r,n,f,d],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return m.lineSegmentPlane(t,n,a,f),m.lineSegmentPlane(r,n,a,d),{positions:[t,r,n,f,d],indices:[0,1,4,0,4,3,2,3,4]}}},m}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,r,n){"use strict";function a(t,r){this.normal=e.clone(t),this.distance=r}a.fromPointNormal=function(r,n,i){var o=-e.dot(n,r);return t(i)?(e.clone(n,i.normal),i.distance=o,i):new a(n,o)};var i=new e;return a.fromCartesian4=function(r,n){var o=e.fromCartesian4(r,i),u=r.w;return t(n)?(e.clone(o,n.normal),n.distance=u,n):new a(o,u)},a.getPointDistance=function(t,r){return e.dot(t.normal,r)+t.distance},a.ORIGIN_XY_PLANE=n(new a(e.UNIT_Z,0)),a.ORIGIN_YZ_PLANE=n(new a(e.UNIT_X,0)),a.ORIGIN_ZX_PLANE=n(new a(e.UNIT_Y,0)),a}),define("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";var n={};return n.calculateACMR=function(r){r=e(r,e.EMPTY_OBJECT);var n=r.indices,a=r.maximumIndex,i=e(r.cacheSize,24),o=n.length;if(!t(a)){a=0;for(var u=0,s=n[u];u<o;)s>a&&(a=s),++u,s=n[u]}for(var c=[],l=0;l<a+1;l++)c[l]=0;for(var f=i+1,d=0;d<o;++d)f-c[n[d]]>i&&(c[n[d]]=f,++f);return(f-i+1)/(o/3)},n.tipsify=function(r){function n(e,t,r,n){for(;t.length>=1;){var a=t[t.length-1];if(t.splice(t.length-1,1),e[a].numLiveTriangles>0)return a}for(;i<n;){if(e[i].numLiveTriangles>0)return++i,i-1;++i}return-1}function a(e,t,r,a,i,o,u){for(var s,c=-1,l=-1,f=0;f<r.length;){var d=r[f];a[d].numLiveTriangles&&(s=0,i-a[d].timeStamp+2*a[d].numLiveTriangles<=t&&(s=i-a[d].timeStamp),(s>l||l===-1)&&(l=s,c=d)),++f}return c===-1?n(a,o,e,u):c}r=e(r,e.EMPTY_OBJECT);var i,o=r.indices,u=r.maximumIndex,s=e(r.cacheSize,24),c=o.length,l=0,f=0,d=o[f],h=c;if(t(u))l=u+1;else{for(;f<h;)d>l&&(l=d),++f,d=o[f];if(l===-1)return 0;++l}for(var E=[],m=0;m<l;m++)E[m]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};f=0;for(var p=0;f<h;)E[o[f]].vertexTriangles.push(p),++E[o[f]].numLiveTriangles,E[o[f+1]].vertexTriangles.push(p),++E[o[f+1]].numLiveTriangles,E[o[f+2]].vertexTriangles.push(p),++E[o[f+2]].numLiveTriangles,++p,f+=3;var y=0,_=s+1;i=1;var T,v,R=[],A=[],S=0,N=[],g=c/3,I=[];for(m=0;m<g;m++)I[m]=!1;for(var O,w;y!==-1;){R=[],v=E[y],w=v.vertexTriangles.length;for(var M=0;M<w;++M)if(p=v.vertexTriangles[M],!I[p]){I[p]=!0,f=p+p+p;for(var x=0;x<3;++x)O=o[f],R.push(O),A.push(O),N[S]=O,++S,T=E[O],--T.numLiveTriangles,_-T.timeStamp>s&&(T.timeStamp=_,++_),++f}y=a(o,s,R,E,_,A,l)}return N},n}),define("Core/GeometryPipeline",["./AttributeCompression","./barycentricCoordinates","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./deprecationWarning","./DeveloperError","./EncodedCartesian3","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryType","./IndexDatatype","./Intersect","./IntersectionTests","./Math","./Matrix3","./Matrix4","./Plane","./PrimitiveType","./Tipsify"],function(e,t,r,n,a,i,o,u,s,c,l,f,d,h,E,m,p,y,_,T,v,R,A,S,N,g){"use strict";function I(e,t,r,n,a){e[t++]=r,e[t++]=n,e[t++]=n,e[t++]=a,e[t++]=a,e[t]=r}function O(e){for(var t=e.length,r=t/3*6,n=y.createTypedArray(t,r),a=0,i=0;i<t;i+=3,a+=6)I(n,a,e[i],e[i+1],e[i+2]);return n}function w(e){var t=e.length;if(t>=3){var r=6*(t-2),n=y.createTypedArray(t,r);I(n,0,e[0],e[1],e[2]);for(var a=6,i=3;i<t;++i,a+=6)I(n,a,e[i-1],e[i],e[i-2]);return n}return new Uint16Array}function M(e){if(e.length>0){for(var t=e.length-1,r=6*(t-1),n=y.createTypedArray(t,r),a=e[0],i=0,o=1;o<t;++o,i+=6)I(n,i,a,e[o],e[o+1]);return n}return new Uint16Array}function x(e){var t={};for(var r in e)if(e.hasOwnProperty(r)&&c(e[r])&&c(e[r].values)){var n=e[r];t[r]=new m({componentDatatype:n.componentDatatype,componentsPerAttribute:n.componentsPerAttribute,normalize:n.normalize,values:[]})}return t}function C(e,t,r){for(var n in t)if(t.hasOwnProperty(n)&&c(t[n])&&c(t[n].values))for(var a=t[n],i=0;i<a.componentsPerAttribute;++i)e[n].values.push(a.values[r*a.componentsPerAttribute+i])}function P(e,t){if(c(t))for(var r=t.values,n=r.length,i=0;i<n;i+=3)a.unpack(r,i,oe),A.multiplyByPoint(e,oe,oe),a.pack(oe,r,i)}function D(e,t){if(c(t))for(var r=t.values,n=r.length,i=0;i<n;i+=3)a.unpack(r,i,oe),R.multiplyByVector(e,oe,oe),oe=a.normalize(oe,oe),a.pack(oe,r,i)}function L(e,t){var r,n=e.length,a={},i=e[0][t].attributes;for(r in i)if(i.hasOwnProperty(r)&&c(i[r])&&c(i[r].values)){for(var o=i[r],s=o.values.length,l=!0,f=1;f<n;++f){var d=e[f][t].attributes[r];if(!c(d)||o.componentDatatype!==d.componentDatatype||o.componentsPerAttribute!==d.componentsPerAttribute||o.normalize!==d.normalize){l=!1;break}s+=d.values.length}l&&(a[r]=new m({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:u.createTypedArray(o.componentDatatype,s)}))}return a}function U(e,t){var n,i,o,u,s,l,f,d=e.length,h=(e[0].modelMatrix,c(e[0][t].indices)),m=e[0][t].primitiveType,p=L(e,t);for(n in p)if(p.hasOwnProperty(n))for(s=p[n].values,u=0,i=0;i<d;++i)for(l=e[i][t].attributes[n].values,f=l.length,o=0;o<f;++o)s[u++]=l[o];var _;if(h){var T=0;for(i=0;i<d;++i)T+=e[i][t].indices.length;var v=E.computeNumberOfVertices(new E({attributes:p,primitiveType:N.POINTS})),R=y.createTypedArray(v,T),A=0,S=0;for(i=0;i<d;++i){var g=e[i][t].indices,I=g.length;for(u=0;u<I;++u)R[A++]=S+g[u];S+=E.computeNumberOfVertices(e[i][t])}_=R}var O,w=new a,M=0;for(i=0;i<d;++i){if(O=e[i][t].boundingSphere,!c(O)){w=void 0;break}a.add(O.center,w,w)}if(c(w))for(a.divideByScalar(w,d,w),i=0;i<d;++i){O=e[i][t].boundingSphere;var x=a.magnitude(a.subtract(O.center,w,ce))+O.radius;x>M&&(M=x)}return new E({attributes:p,indices:_,primitiveType:m,boundingSphere:c(w)?new r(w,M):void 0})}function b(e){if(c(e.indices))return e;for(var t=E.computeNumberOfVertices(e),r=y.createTypedArray(t,t),n=0;n<t;++n)r[n]=n;return e.indices=r,e}function F(e){var t=E.computeNumberOfVertices(e),r=y.createTypedArray(t,3*(t-2));r[0]=1,r[1]=0,r[2]=2;for(var n=3,a=3;a<t;++a)r[n++]=a-1,r[n++]=0,r[n++]=a;return e.indices=r,e.primitiveType=N.TRIANGLES,e}function z(e){var t=E.computeNumberOfVertices(e),r=y.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,a=3;a<t-1;a+=2)r[n++]=a,r[n++]=a-1,r[n++]=a+1,a+2<t&&(r[n++]=a,r[n++]=a+1,r[n++]=a+2);return e.indices=r,e.primitiveType=N.TRIANGLES,e}function B(e){if(c(e.indices))return e;for(var t=E.computeNumberOfVertices(e),r=y.createTypedArray(t,t),n=0;n<t;++n)r[n]=n;return e.indices=r,e}function G(e){var t=E.computeNumberOfVertices(e),r=y.createTypedArray(t,2*(t-1));r[0]=0,r[1]=1;for(var n=2,a=2;a<t;++a)r[n++]=a-1,r[n++]=a;return e.indices=r,e.primitiveType=N.LINES,e}function q(e){var t=E.computeNumberOfVertices(e),r=y.createTypedArray(t,2*t);r[0]=0,r[1]=1;for(var n=2,a=2;a<t;++a)r[n++]=a-1,r[n++]=a;return r[n++]=t-1,r[n]=0,e.indices=r,e.primitiveType=N.LINES,e}function V(e){switch(e.primitiveType){case N.TRIANGLE_FAN:return F(e);case N.TRIANGLE_STRIP:return z(e);case N.TRIANGLES:return b(e);case N.LINE_STRIP:return G(e);case N.LINE_LOOP:return q(e);case N.LINES:return B(e)}return e}function W(e,t){Math.abs(e.y)<v.EPSILON6&&(t?e.y=-v.EPSILON6:e.y=v.EPSILON6)}function X(e,t,r){if(0!==e.y&&0!==t.y&&0!==r.y)return W(e,e.y<0),W(t,t.y<0),void W(r,r.y<0);var n,a=Math.abs(e.y),i=Math.abs(t.y),o=Math.abs(r.y);n=a>i?a>o?v.sign(e.y):v.sign(r.y):i>o?v.sign(t.y):v.sign(r.y);var u=n<0;W(e,u),W(t,u),W(r,u)}function H(e,t,r,n){a.add(e,a.multiplyByScalar(a.subtract(t,e,Ae),e.y/(e.y-t.y),Ae),r),a.clone(r,n),W(r,!0),W(n,!1)}function Y(e,t,r){if(!(e.x>=0||t.x>=0||r.x>=0)){X(e,t,r);var n=e.y<0,a=t.y<0,i=r.y<0,o=0;o+=n?1:0,o+=a?1:0,o+=i?1:0;var u=Oe.indices;1===o?(u[1]=3,u[2]=4,u[5]=6,u[7]=6,u[8]=5,n?(H(e,t,Se,ge),H(e,r,Ne,Ie),u[0]=0,u[3]=1,u[4]=2,u[6]=1):a?(H(t,r,Se,ge),H(t,e,Ne,Ie),u[0]=1,u[3]=2,u[4]=0,u[6]=2):i&&(H(r,e,Se,ge),H(r,t,Ne,Ie),u[0]=2,u[3]=0,u[4]=1,u[6]=0)):2===o&&(u[2]=4,u[4]=4,u[5]=3,u[7]=5,u[8]=6,n?a?i||(H(r,e,Se,ge),H(r,t,Ne,Ie),u[0]=0,u[1]=1,u[3]=0,u[6]=2):(H(t,r,Se,ge),H(t,e,Ne,Ie),u[0]=2,u[1]=0,u[3]=2,u[6]=1):(H(e,t,Se,ge),H(e,r,Ne,Ie),u[0]=1,u[1]=2,u[3]=1,u[6]=0));var s=Oe.positions;return s[0]=e,s[1]=t,s[2]=r,s.length=3,1!==o&&2!==o||(s[3]=Se,s[4]=Ne,s[5]=ge,s[6]=Ie,s.length=7),Oe}}function k(e,t){var n=e.attributes;if(0!==n.position.values.length){for(var a in n)if(n.hasOwnProperty(a)&&c(n[a])&&c(n[a].values)){var i=n[a];i.values=u.createTypedArray(i.componentDatatype,i.values)}var o=E.computeNumberOfVertices(e);return e.indices=y.createTypedArray(o,e.indices),t&&(e.boundingSphere=r.fromVertices(n.position.values)),e}}function j(e){var t=e.attributes,r={};for(var n in t)if(t.hasOwnProperty(n)&&c(t[n])&&c(t[n].values)){var a=t[n];r[n]=new m({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:[]})}return new E({attributes:r,indices:[],primitiveType:e.primitiveType})}function Z(e,t,r){var n=c(e.geometry.boundingSphere);t=k(t,n),r=k(r,n),c(r)&&!c(t)?e.geometry=r:!c(r)&&c(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=r,e.geometry=void 0)}function K(e,r,i,o,u,s,l,f,d,h,E,m){if(c(s)||c(l)||c(f)||c(d)||c(h)){var p=a.fromArray(u,3*e,we),y=a.fromArray(u,3*r,Me),_=a.fromArray(u,3*i,xe),T=t(o,p,y,_,Ce);if(c(s)){var v=a.fromArray(s,3*e,we),R=a.fromArray(s,3*r,Me),A=a.fromArray(s,3*i,xe);a.multiplyByScalar(v,T.x,v),a.multiplyByScalar(R,T.y,R),a.multiplyByScalar(A,T.z,A);var S=a.add(v,R,v);a.add(S,A,S),a.normalize(S,S),a.pack(S,E.normal.values,3*m)}if(c(h)){var N=a.fromArray(h,3*e,we),g=a.fromArray(h,3*r,Me),I=a.fromArray(h,3*i,xe);a.multiplyByScalar(N,T.x,N),a.multiplyByScalar(g,T.y,g),a.multiplyByScalar(I,T.z,I);var O;a.equals(N,a.ZERO)&&a.equals(g,a.ZERO)&&a.equals(I,a.ZERO)?(O=we,O.x=0,O.y=0,O.z=0):(O=a.add(N,g,N),a.add(O,I,O),a.normalize(O,O)),a.pack(O,E.extrudeDirection.values,3*m)}if(c(l)){var w=a.fromArray(l,3*e,we),M=a.fromArray(l,3*r,Me),x=a.fromArray(l,3*i,xe);a.multiplyByScalar(w,T.x,w),a.multiplyByScalar(M,T.y,M),a.multiplyByScalar(x,T.z,x);var C=a.add(w,M,w);a.add(C,x,C),a.normalize(C,C),a.pack(C,E.tangent.values,3*m)}if(c(f)){var P=a.fromArray(f,3*e,we),D=a.fromArray(f,3*r,Me),L=a.fromArray(f,3*i,xe);a.multiplyByScalar(P,T.x,P),a.multiplyByScalar(D,T.y,D),a.multiplyByScalar(L,T.z,L);var U=a.add(P,D,P);a.add(U,L,U),a.normalize(U,U),a.pack(U,E.bitangent.values,3*m)}if(c(d)){var b=n.fromArray(d,2*e,Pe),F=n.fromArray(d,2*r,De),z=n.fromArray(d,2*i,Le);n.multiplyByScalar(b,T.x,b),n.multiplyByScalar(F,T.y,F),n.multiplyByScalar(z,T.z,z);var B=n.add(b,F,b);n.add(B,z,B),n.pack(B,E.st.values,2*m)}}}function J(e,t,r,n,a,i){var o=e.position.values.length/3;if(a!==-1){var u=n[a],s=r[u];return s===-1?(r[u]=o,e.position.values.push(i.x,i.y,i.z),t.push(o),o):(t.push(s),s)}return e.position.values.push(i.x,i.y,i.z),t.push(o),o}function Q(e){var t,r,n,i,o,u=e.geometry,s=u.attributes,l=s.position.values,f=c(s.normal)?s.normal.values:void 0,d=c(s.bitangent)?s.bitangent.values:void 0,h=c(s.tangent)?s.tangent.values:void 0,E=c(s.st)?s.st.values:void 0,m=c(s.extrudeDirection)?s.extrudeDirection.values:void 0,p=u.indices,y=j(u),_=j(u),T=[];T.length=l.length/3;var v=[];for(v.length=l.length/3,o=0;o<T.length;++o)T[o]=-1,v[o]=-1;var R=p.length;for(o=0;o<R;o+=3){var A=p[o],S=p[o+1],N=p[o+2],g=a.fromArray(l,3*A),I=a.fromArray(l,3*S),O=a.fromArray(l,3*N),w=Y(g,I,O);if(c(w)&&w.positions.length>3)for(var M=w.positions,x=w.indices,C=x.length,P=0;P<C;++P){var D=x[P],L=M[D];L.y<0?(t=_.attributes,r=_.indices,n=T):(t=y.attributes,r=y.indices,n=v),i=J(t,r,n,p,D<3?o+D:-1,L),K(A,S,N,L,l,f,h,d,E,m,t,i)}else c(w)&&(g=w.positions[0],I=w.positions[1],O=w.positions[2]),g.y<0?(t=_.attributes,r=_.indices,n=T):(t=y.attributes,r=y.indices,n=v),i=J(t,r,n,p,o,g),K(A,S,N,g,l,f,h,d,E,m,t,i),i=J(t,r,n,p,o+1,I),K(A,S,N,I,l,f,h,d,E,m,t,i),i=J(t,r,n,p,o+2,O),K(A,S,N,O,l,f,h,d,E,m,t,i)}Z(e,_,y)}function $(e){var t,r=e.geometry,n=r.attributes,i=n.position.values,o=r.indices,u=j(r),s=j(r),l=o.length,f=[];f.length=i.length/3;var d=[];for(d.length=i.length/3,t=0;t<f.length;++t)f[t]=-1,d[t]=-1;for(t=0;t<l;t+=2){var h=o[t],E=o[t+1],m=a.fromArray(i,3*h,we),p=a.fromArray(i,3*E,Me);Math.abs(m.y)<v.EPSILON6&&(m.y<0?m.y=-v.EPSILON6:m.y=v.EPSILON6),Math.abs(p.y)<v.EPSILON6&&(p.y<0?p.y=-v.EPSILON6:p.y=v.EPSILON6);var y=u.attributes,_=u.indices,R=d,A=s.attributes,S=s.indices,N=f,g=T.lineSegmentPlane(m,p,Ue,xe);if(c(g)){var I=a.multiplyByScalar(a.UNIT_Y,5*v.EPSILON9,be);m.y<0&&(a.negate(I,I),y=s.attributes,_=s.indices,R=f,A=u.attributes,S=u.indices,N=d);var O=a.add(g,I,Fe);J(y,_,R,o,t,m),J(y,_,R,o,-1,O),a.negate(I,I),a.add(g,I,O),J(A,S,N,o,-1,O),J(A,S,N,o,t+1,p)}else{var w,M,x;m.y<0?(w=s.attributes,M=s.indices,x=f):(w=u.attributes,M=u.indices,x=d),J(w,M,x,o,t,m),J(w,M,x,o,t+1,p)}}Z(e,s,u)}function ee(e){for(var t=e.attributes,r=t.position.values,n=t.prevPosition.values,i=t.nextPosition.values,o=r.length,u=0;u<o;u+=3){var s=a.unpack(r,u,Ge);if(!(s.x>0)){var c=a.unpack(n,u,qe);(s.y<0&&c.y>0||s.y>0&&c.y<0)&&(u-3>0?(n[u]=r[u-3],n[u+1]=r[u-2],n[u+2]=r[u-1]):a.pack(s,n,u));var l=a.unpack(i,u,Ve);(s.y<0&&l.y>0||s.y>0&&l.y<0)&&(u+3<o?(i[u]=r[u+3],i[u+1]=r[u+4],i[u+2]=r[u+5]):a.pack(s,i,u))}}}function te(e){var t,r,o,u=e.geometry,s=u.attributes,l=s.position.values,f=s.prevPosition.values,d=s.nextPosition.values,h=s.expandAndWidth.values,E=c(s.st)?s.st.values:void 0,m=c(s.color)?s.color.values:void 0,p=j(u),y=j(u),_=!1,R=l.length/3;for(t=0;t<R;t+=4){var A=t,S=t+2,N=a.fromArray(l,3*A,Ge),g=a.fromArray(l,3*S,qe);if(Math.abs(N.y)<je)for(N.y=je*(g.y<0?-1:1),l[3*t+1]=N.y,l[3*(t+1)+1]=N.y,r=3*A;r<3*A+12;r+=3)f[r]=l[3*t],f[r+1]=l[3*t+1],f[r+2]=l[3*t+2];if(Math.abs(g.y)<je)for(g.y=je*(N.y<0?-1:1),l[3*(t+2)+1]=g.y,l[3*(t+3)+1]=g.y,r=3*A;r<3*A+12;r+=3)d[r]=l[3*(t+2)],d[r+1]=l[3*(t+2)+1],d[r+2]=l[3*(t+2)+2];var I=p.attributes,O=p.indices,w=y.attributes,M=y.indices,x=T.lineSegmentPlane(N,g,Ue,We);if(c(x)){_=!0;var C=a.multiplyByScalar(a.UNIT_Y,ke,Xe);N.y<0&&(a.negate(C,C),I=y.attributes,O=y.indices,w=p.attributes,M=p.indices);var P=a.add(x,C,He);I.position.values.push(N.x,N.y,N.z,N.x,N.y,N.z),I.position.values.push(P.x,P.y,P.z),I.position.values.push(P.x,P.y,P.z),I.prevPosition.values.push(f[3*A],f[3*A+1],f[3*A+2]),I.prevPosition.values.push(f[3*A+3],f[3*A+4],f[3*A+5]),I.prevPosition.values.push(N.x,N.y,N.z,N.x,N.y,N.z),I.nextPosition.values.push(P.x,P.y,P.z),I.nextPosition.values.push(P.x,P.y,P.z),I.nextPosition.values.push(P.x,P.y,P.z),I.nextPosition.values.push(P.x,P.y,P.z),a.negate(C,C),a.add(x,C,P),w.position.values.push(P.x,P.y,P.z),w.position.values.push(P.x,P.y,P.z),w.position.values.push(g.x,g.y,g.z,g.x,g.y,g.z),w.prevPosition.values.push(P.x,P.y,P.z),w.prevPosition.values.push(P.x,P.y,P.z),w.prevPosition.values.push(P.x,P.y,P.z),w.prevPosition.values.push(P.x,P.y,P.z),w.nextPosition.values.push(g.x,g.y,g.z,g.x,g.y,g.z),w.nextPosition.values.push(d[3*S],d[3*S+1],d[3*S+2]),w.nextPosition.values.push(d[3*S+3],d[3*S+4],d[3*S+5]);var D=n.fromArray(h,2*A,ze),L=Math.abs(D.y);I.expandAndWidth.values.push(-1,L,1,L),I.expandAndWidth.values.push(-1,-L,1,-L),w.expandAndWidth.values.push(-1,L,1,L),w.expandAndWidth.values.push(-1,-L,1,-L);var U=a.magnitudeSquared(a.subtract(x,N,Ve));if(U/=a.magnitudeSquared(a.subtract(g,N,Ve)),c(m)){var b=i.fromArray(m,4*A,Ye),F=i.fromArray(m,4*S,Ye),z=v.lerp(b.x,F.x,U),B=v.lerp(b.y,F.y,U),G=v.lerp(b.z,F.z,U),q=v.lerp(b.w,F.w,U);for(r=4*A;r<4*A+8;++r)I.color.values.push(m[r]);for(I.color.values.push(z,B,G,q),I.color.values.push(z,B,G,q),w.color.values.push(z,B,G,q),w.color.values.push(z,B,G,q),r=4*S;r<4*S+8;++r)w.color.values.push(m[r])}if(c(E)){var V=n.fromArray(E,2*A,ze),W=n.fromArray(E,2*(t+3),Be),X=v.lerp(V.x,W.x,U);for(r=2*A;r<2*A+4;++r)I.st.values.push(E[r]);for(I.st.values.push(X,V.y),I.st.values.push(X,W.y),w.st.values.push(X,V.y),w.st.values.push(X,W.y),r=2*S;r<2*S+4;++r)w.st.values.push(E[r])}o=I.position.values.length/3-4,O.push(o,o+2,o+1),O.push(o+1,o+2,o+3),o=w.position.values.length/3-4,M.push(o,o+2,o+1),M.push(o+1,o+2,o+3)}else{var H,Y;for(N.y<0?(H=y.attributes,Y=y.indices):(H=p.attributes,Y=p.indices),H.position.values.push(N.x,N.y,N.z),H.position.values.push(N.x,N.y,N.z),H.position.values.push(g.x,g.y,g.z),H.position.values.push(g.x,g.y,g.z),r=3*t;r<3*t+12;++r)H.prevPosition.values.push(f[r]),H.nextPosition.values.push(d[r]);for(r=2*t;r<2*t+8;++r)H.expandAndWidth.values.push(h[r]),c(E)&&H.st.values.push(E[r]);if(c(m))for(r=4*t;r<4*t+16;++r)H.color.values.push(m[r]);o=H.position.values.length/3-4,Y.push(o,o+2,o+1),Y.push(o+1,o+2,o+3)}}_&&(ee(y),ee(p)),Z(e,y,p)}var re={};re.toWireframe=function(e){var t=e.indices;if(c(t)){switch(e.primitiveType){case N.TRIANGLES:e.indices=O(t);break;case N.TRIANGLE_STRIP:e.indices=w(t);break;case N.TRIANGLE_FAN:e.indices=M(t)}e.primitiveType=N.LINES}return e},re.createLineSegmentsForVectors=function(e,t,n){t=s(t,"normal"),n=s(n,1e4);for(var a=e.attributes.position.values,i=e.attributes[t].values,o=a.length,l=new Float64Array(2*o),f=0,d=0;d<o;d+=3)l[f++]=a[d],l[f++]=a[d+1],l[f++]=a[d+2],l[f++]=a[d]+i[d]*n,l[f++]=a[d+1]+i[d+1]*n,l[f++]=a[d+2]+i[d+2]*n;var h,p=e.boundingSphere;return c(p)&&(h=new r(p.center,p.radius+n)),new E({attributes:{position:new m({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:N.LINES,boundingSphere:h})},re.createAttributeLocations=function(e){var t,r=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=e.attributes,a={},i=0,o=r.length;for(t=0;t<o;++t){var u=r[t];c(n[u])&&(a[u]=i++)}for(var s in n)n.hasOwnProperty(s)&&!c(a[s])&&(a[s]=i++);return a},re.reorderForPreVertexCache=function(e){var t=E.computeNumberOfVertices(e),r=e.indices;if(c(r)){for(var n=new Int32Array(t),a=0;a<t;a++)n[a]=-1;for(var i,o=r,s=o.length,l=y.createTypedArray(t,s),f=0,d=0,h=0;f<s;)i=n[o[f]],i!==-1?l[d]=i:(i=o[f], +n[i]=h,l[d]=h,++h),++f,++d;e.indices=l;var m=e.attributes;for(var p in m)if(m.hasOwnProperty(p)&&c(m[p])&&c(m[p].values)){for(var _=m[p],T=_.values,v=0,R=_.componentsPerAttribute,A=u.createTypedArray(_.componentDatatype,h*R);v<t;){var S=n[v];if(S!==-1)for(a=0;a<R;a++)A[R*S+a]=T[R*v+a];++v}_.values=A}}return e},re.reorderForPostVertexCache=function(e,t){var r=e.indices;if(e.primitiveType===N.TRIANGLES&&c(r)){for(var n=r.length,a=0,i=0;i<n;i++)r[i]>a&&(a=r[i]);e.indices=g.tipsify({indices:r,maximumIndex:a,cacheSize:t})}return e},re.fitToUnsignedShortIndices=function(e){var t=[],r=E.computeNumberOfVertices(e);if(c(e.indices)&&r>=v.SIXTY_FOUR_KILOBYTES){var n,a=[],i=[],o=0,u=x(e.attributes),s=e.indices,l=s.length;e.primitiveType===N.TRIANGLES?n=3:e.primitiveType===N.LINES?n=2:e.primitiveType===N.POINTS&&(n=1);for(var f=0;f<l;f+=n){for(var d=0;d<n;++d){var h=s[f+d],m=a[h];c(m)||(m=o++,a[h]=m,C(u,e.attributes,h)),i.push(m)}o+n>=v.SIXTY_FOUR_KILOBYTES&&(t.push(new E({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),a=[],i=[],o=0,u=x(e.attributes))}0!==i.length&&t.push(new E({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var ne=new a,ae=new o;re.projectTo2D=function(e,t,r,n,i){var o=e.attributes[t];i=c(i)?i:new h;for(var s=i.ellipsoid,l=o.values,f=new Float64Array(l.length),d=0,E=0;E<l.length;E+=3){var p=a.fromArray(l,E,ne),y=s.cartesianToCartographic(p,ae),_=i.project(y,ne);f[d++]=_.x,f[d++]=_.y,f[d++]=_.z}return e.attributes[r]=o,e.attributes[n]=new m({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:f}),delete e.attributes[t],e};var ie={high:0,low:0};re.encodeAttribute=function(e,t,r,n){for(var a=e.attributes[t],i=a.values,o=i.length,s=new Float32Array(o),c=new Float32Array(o),l=0;l<o;++l)d.encode(i[l],ie),s[l]=ie.high,c[l]=ie.low;var f=a.componentsPerAttribute;return e.attributes[r]=new m({componentDatatype:u.FLOAT,componentsPerAttribute:f,values:s}),e.attributes[n]=new m({componentDatatype:u.FLOAT,componentsPerAttribute:f,values:c}),delete e.attributes[t],e};var oe=new a,ue=new A,se=new R;re.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(A.equals(t,A.IDENTITY))return e;var n=e.geometry.attributes;P(t,n.position),P(t,n.prevPosition),P(t,n.nextPosition),(c(n.normal)||c(n.tangent)||c(n.bitangent))&&(A.inverse(t,ue),A.transpose(ue,ue),A.getRotation(ue,se),D(se,n.normal),D(se,n.tangent),D(se,n.bitangent));var a=e.geometry.boundingSphere;return c(a)&&(e.geometry.boundingSphere=r.transform(a,t,a)),e.modelMatrix=A.clone(A.IDENTITY),e};var ce=new a;re.combineInstances=function(e){for(var t=[],r=[],n=e.length,a=0;a<n;++a){var i=e[a];c(i.geometry)?t.push(i):c(i.westHemisphereGeometry)&&c(i.eastHemisphereGeometry)&&r.push(i)}var o=[];return t.length>0&&o.push(U(t,"geometry")),r.length>0&&(o.push(U(r,"westHemisphereGeometry")),o.push(U(r,"eastHemisphereGeometry"))),o};var le=new a,fe=new a,de=new a,he=new a;re.computeNormal=function(e){for(var t=e.indices,r=e.attributes,n=r.position.values,i=r.position.values.length/3,o=t.length,s=new Array(i),c=new Array(o/3),l=new Array(o),f=0;f<i;f++)s[f]={indexOffset:0,count:0,currentCount:0};var d=0;for(f=0;f<o;f+=3){var h=t[f],E=t[f+1],p=t[f+2],y=3*h,_=3*E,T=3*p;fe.x=n[y],fe.y=n[y+1],fe.z=n[y+2],de.x=n[_],de.y=n[_+1],de.z=n[_+2],he.x=n[T],he.y=n[T+1],he.z=n[T+2],s[h].count++,s[E].count++,s[p].count++,a.subtract(de,fe,de),a.subtract(he,fe,he),c[d]=a.cross(de,he,new a),d++}var v=0;for(f=0;f<i;f++)s[f].indexOffset+=v,v+=s[f].count;d=0;var R;for(f=0;f<o;f+=3){R=s[t[f]];var A=R.indexOffset+R.currentCount;l[A]=d,R.currentCount++,R=s[t[f+1]],A=R.indexOffset+R.currentCount,l[A]=d,R.currentCount++,R=s[t[f+2]],A=R.indexOffset+R.currentCount,l[A]=d,R.currentCount++,d++}var S=new Float32Array(3*i);for(f=0;f<i;f++){var N=3*f;if(R=s[f],R.count>0){for(a.clone(a.ZERO,le),d=0;d<R.count;d++)a.add(le,c[l[R.indexOffset+d]],le);a.normalize(le,le),S[N]=le.x,S[N+1]=le.y,S[N+2]=le.z}else S[N]=0,S[N+1]=0,S[N+2]=1}return e.attributes.normal=new m({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:S}),e};var Ee=new a,me=new a,pe=new a;re.computeTangentAndBitangent=function(e){for(var t=(e.attributes,e.indices),r=e.attributes.position.values,n=e.attributes.normal.values,i=e.attributes.st.values,o=e.attributes.position.values.length/3,s=t.length,c=new Array(3*o),l=0;l<c.length;l++)c[l]=0;var f,d,h;for(l=0;l<s;l+=3){var E=t[l],p=t[l+1],y=t[l+2];f=3*E,d=3*p,h=3*y;var _=2*E,T=2*p,v=2*y,R=r[f],A=r[f+1],S=r[f+2],N=i[_],g=i[_+1],I=i[T+1]-g,O=i[v+1]-g,w=1/((i[T]-N)*O-(i[v]-N)*I),M=(O*(r[d]-R)-I*(r[h]-R))*w,x=(O*(r[d+1]-A)-I*(r[h+1]-A))*w,C=(O*(r[d+2]-S)-I*(r[h+2]-S))*w;c[f]+=M,c[f+1]+=x,c[f+2]+=C,c[d]+=M,c[d+1]+=x,c[d+2]+=C,c[h]+=M,c[h+1]+=x,c[h+2]+=C}var P=new Float32Array(3*o),D=new Float32Array(3*o);for(l=0;l<o;l++){f=3*l,d=f+1,h=f+2;var L=a.fromArray(n,f,Ee),U=a.fromArray(c,f,pe),b=a.dot(L,U);a.multiplyByScalar(L,b,me),a.normalize(a.subtract(U,me,U),U),P[f]=U.x,P[d]=U.y,P[h]=U.z,a.normalize(a.cross(L,U,U),U),D[f]=U.x,D[d]=U.y,D[h]=U.z}return e.attributes.tangent=new m({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:P}),e.attributes.bitangent=new m({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:D}),e},re.computeBinormalAndTangent=function(e){return l("computeBinormalAndTangent","computeBinormalAndTangent was deprecated in 1.30. It will be removed in 1.31. Use a computeTangentAndBitangent."),re.computeTangentAndBitangent(e),e.attributes.binormal=e.attributes.bitangent,e};var ye=new n,_e=new a,Te=new a,ve=new a,Re=new n;re.compressVertices=function(t){var r,i,o=t.attributes.extrudeDirection;if(c(o)){var s=o.values;i=s.length/3;var l=new Float32Array(2*i),f=0;for(r=0;r<i;++r)a.fromArray(s,3*r,_e),a.equals(_e,a.ZERO)?f+=2:(Re=e.octEncodeInRange(_e,65535,Re),l[f++]=Re.x,l[f++]=Re.y);return t.attributes.compressedAttributes=new m({componentDatatype:u.FLOAT,componentsPerAttribute:2,values:l}),delete t.attributes.extrudeDirection,t}var d=t.attributes.normal,h=t.attributes.st,E=c(d),p=c(h);if(!E&&!p)return t;var y,_,T,v,R=t.attributes.tangent,A=t.attributes.bitangent,S=c(R),N=c(A);E&&(y=d.values),p&&(_=h.values),S&&(T=R.values),N&&(v=A.values);var g=E?y.length:_.length,I=E?3:2;i=g/I;var O=i,w=p&&E?2:1;w+=S||N?1:0,O*=w;var M=new Float32Array(O),x=0;for(r=0;r<i;++r){p&&(n.fromArray(_,2*r,ye),M[x++]=e.compressTextureCoordinates(ye));var C=3*r;E&&c(T)&&c(v)?(a.fromArray(y,C,_e),a.fromArray(T,C,Te),a.fromArray(v,C,ve),e.octPack(_e,Te,ve,ye),M[x++]=ye.x,M[x++]=ye.y):(E&&(a.fromArray(y,C,_e),M[x++]=e.octEncodeFloat(_e)),S&&(a.fromArray(T,C,_e),M[x++]=e.octEncodeFloat(_e)),N&&(a.fromArray(v,C,_e),M[x++]=e.octEncodeFloat(_e)))}return t.attributes.compressedAttributes=new m({componentDatatype:u.FLOAT,componentsPerAttribute:w,values:M}),E&&delete t.attributes.normal,p&&delete t.attributes.st,N&&delete t.attributes.bitangent,S&&delete t.attributes.tangent,t};var Ae=new a,Se=new a,Ne=new a,ge=new a,Ie=new a,Oe={positions:new Array(7),indices:new Array(9)},we=new a,Me=new a,xe=new a,Ce=new a,Pe=new n,De=new n,Le=new n,Ue=S.fromPointNormal(a.ZERO,a.UNIT_Y),be=new a,Fe=new a,ze=new n,Be=new n,Ge=new a,qe=new a,Ve=new a,We=new a,Xe=new a,He=new a,Ye=new i,ke=5*v.EPSILON9,je=v.EPSILON6;return re.splitLongitude=function(e){var t=e.geometry,n=t.boundingSphere;if(c(n)){var a=n.center.x-n.radius;if(a>0||r.intersectPlane(n,S.ORIGIN_ZX_PLANE)!==_.INTERSECTING)return e}if(t.geometryType!==p.NONE)switch(t.geometryType){case p.POLYLINES:te(e);break;case p.TRIANGLES:Q(e);break;case p.LINES:$(e)}else V(t),t.primitiveType===N.TRIANGLES?Q(e):t.primitiveType===N.LINES&&$(e);return e},re}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,r,n,a){return t(e).then(r,n,a)}function t(e){var t,r;return e instanceof n?t=e:u(e)?(r=o(),e.then(function(e){r.resolve(e)},function(e){r.reject(e)},function(e){r.progress(e)}),t=r.promise):t=a(e),t}function r(t){return e(t,i)}function n(e){this.then=e}function a(e){var r=new n(function(r){try{return t(r?r(e):e)}catch(e){return i(e)}});return r}function i(e){var r=new n(function(r,n){try{return n?t(n(e)):i(e)}catch(e){return i(e)}});return r}function o(){function e(e,t,r){return d(e,t,r)}function r(e){return E(e)}function a(e){return E(i(e))}function u(e){return h(e)}var s,c,l,f,d,h,E;return c=new n(e),s={then:e,resolve:r,reject:a,progress:u,promise:c,resolver:{resolve:r,reject:a,progress:u}},l=[],f=[],d=function(e,t,r){var n,a;return n=o(),a="function"==typeof r?function(e){try{n.progress(r(e))}catch(e){n.progress(e)}}:function(e){n.progress(e)},l.push(function(r){r.then(e,t).then(n.resolve,n.reject,a)}),f.push(a),n.promise},h=function(e){return m(f,e),e},E=function(e){return e=t(e),d=e.then,E=t,h=y,m(l,e),f=l=R,e},s}function u(e){return e&&"function"==typeof e.then}function s(t,r,n,a,i){return p(2,arguments),e(t,function(t){function u(e){m(e)}function s(e){E(e)}var c,l,f,d,h,E,m,p,_,T;if(_=t.length>>>0,c=Math.max(0,Math.min(r,_)),f=[],l=_-c+1,d=[],h=o(),c)for(p=h.progress,m=function(e){d.push(e),--l||(E=m=y,h.reject(d))},E=function(e){f.push(e),--c||(E=m=y,h.resolve(f))},T=0;T<_;++T)T in t&&e(t[T],s,u,p);else h.resolve(f);return h.then(n,a,i)})}function c(e,t,r,n){function a(e){return t?t(e[0]):e[0]}return s(e,1,a,r,n)}function l(e,t,r,n){return p(1,arguments),d(e,_).then(t,r,n)}function f(){return d(arguments,_)}function d(t,r){return e(t,function(t){var n,a,i,u,s,c;if(i=a=t.length>>>0,n=[],c=o(),i)for(u=function(t,a){e(t,r).then(function(e){n[a]=e,--i||c.resolve(n)},c.reject)},s=0;s<a;s++)s in t?u(t[s],s):--i;else c.resolve(n);return c.promise})}function h(t,r){var n=v.call(arguments,1);return e(t,function(t){var a;return a=t.length,n[0]=function(t,n,i){return e(t,function(t){return e(n,function(e){return r(t,e,i,a)})})},T.apply(t,n)})}function E(t,r,n){var a=arguments.length>2;return e(t,function(e){return e=a?n:e,r.resolve(e),e},function(e){return r.reject(e),i(e)},r.progress)}function m(e,t){for(var r,n=0;r=e[n++];)r(t)}function p(e,t){for(var r,n=t.length;n>e;)if(r=t[--n],null!=r&&"function"!=typeof r)throw new Error("arg "+n+" must be a function")}function y(){}function _(e){return e}var T,v,R;return e.defer=o,e.resolve=t,e.reject=r,e.join=f,e.all=l,e.map=d,e.reduce=h,e.any=c,e.some=s,e.chain=E,e.isPromise=u,n.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(R,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return l(t,function(t){return e.apply(R,t)})})}},v=[].slice,T=[].reduce||function(e){var t,r,n,a,i;if(i=0,t=Object(this),a=t.length>>>0,r=arguments,r.length<=1)for(;;){if(i in t){n=t[i++];break}if(++i>=a)throw new TypeError}else n=r[1];for(;i<a;++i)i in t&&(n=e(n,t[i],i,t));return n},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/binarySearch",["./defined","./DeveloperError"],function(e,t){"use strict";function r(e,t,r){for(var n,a,i=0,o=e.length-1;i<=o;)if(n=~~((i+o)/2),a=r(e[n],t),a<0)i=n+1;else{if(!(a>0))return n;o=n-1}return~(o+1)}return r}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,r,n,a){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=r,this.yPoleOffset=n,this.ut1MinusUtc=a}return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,r=0,n=t[r++],a=function(e,t,r,n){r||(r=" ");var a=e.length>=t?"":Array(1+t-e.length>>>0).join(r);return n?e+a:a+e},i=function(e,t,r,n,i,o){var u=n-e.length;return u>0&&(e=r||!i?a(e,n,o,r):e.slice(0,t.length)+a("",u,"0",!0)+e.slice(t.length)),e},o=function(e,t,r,n,o,u,s){var c=e>>>0;return r=r&&c&&{2:"0b",8:"0",16:"0x"}[t]||"",e=r+a(c.toString(t),u||0,"0",!1),i(e,r,n,o,s)},u=function(e,t,r,n,a,o){return null!=n&&(e=e.slice(0,n)),i(e,"",t,r,a,o)},s=function(e,n,s,c,l,f,d){var h,E,m,p,y;if("%%"==e)return"%";for(var _=!1,T="",v=!1,R=!1,A=" ",S=s.length,N=0;s&&N<S;N++)switch(s.charAt(N)){case" ":T=" ";break;case"+":T="+";break;case"-":_=!0;break;case"'":A=s.charAt(N+1);break;case"0":v=!0;break;case"#":R=!0}if(c=c?"*"==c?+t[r++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,c<0&&(c=-c,_=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(f=f?"*"==f?+t[r++]:"*"==f.charAt(0)?+t[f.slice(1,-1)]:+f:"fFeE".indexOf(d)>-1?6:"d"==d?0:void 0,y=n?t[n.slice(0,-1)]:t[r++],d){case"s":return u(String(y),_,c,f,v,A);case"c":return u(String.fromCharCode(+y),_,c,f,v);case"b":return o(y,2,R,_,c,f,v);case"o":return o(y,8,R,_,c,f,v);case"x":return o(y,16,R,_,c,f,v);case"X":return o(y,16,R,_,c,f,v).toUpperCase();case"u":return o(y,10,R,_,c,f,v);case"i":case"d":return h=+y||0,h=Math.round(h-h%1),E=h<0?"-":T,y=E+a(String(Math.abs(h)),f,"0",!1),i(y,E,_,c,v);case"e":case"E":case"f":case"F":case"g":case"G":return h=+y,E=h<0?"-":T,m=["toExponential","toFixed","toPrecision"]["efg".indexOf(d.toLowerCase())],p=["toString","toUpperCase"]["eEfFgG".indexOf(d)%2],y=E+Math.abs(h)[m](f),i(y,E,_,c,v)[p]();default:return e}};return n.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,r,n,a,i,o,u){this.year=e,this.month=t,this.day=r,this.hour=n,this.minute=a,this.second=i,this.millisecond=o,this.isLeapSecond=u}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e(t)}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,r,n,a,i,o,u,s,c){"use strict";function l(e,t){return m.compare(e.julianDate,t.julianDate)}function f(e){T.julianDate=e;var r=m.leapSeconds,n=t(r,T,l);n<0&&(n=~n),n>=r.length&&(n=r.length-1);var a=r[n].offset;if(n>0){var i=m.secondsDifference(r[n].julianDate,e);i>a&&(n--,a=r[n].offset)}m.addSeconds(e,a,e)}function d(e,r){T.julianDate=e;var n=m.leapSeconds,a=t(n,T,l);if(a<0&&(a=~a),0===a)return m.addSeconds(e,-n[0].offset,r);if(a>=n.length)return m.addSeconds(e,-n[a-1].offset,r);var i=m.secondsDifference(n[a].julianDate,e);return 0===i?m.addSeconds(e,-n[a].offset,r):i<=1?void 0:m.addSeconds(e,-n[--a].offset,r)}function h(e,t,r){var n=t/s.SECONDS_PER_DAY|0;return e+=n,t-=s.SECONDS_PER_DAY*n,t<0&&(e--,t+=s.SECONDS_PER_DAY),r.dayNumber=e,r.secondsOfDay=t,r}function E(e,t,r,n,a,i,o){var u=(t-14)/12|0,c=e+4800+u,l=(1461*c/4|0)+(367*(t-2-12*u)/12|0)-(3*((c+100)/100|0)/4|0)+r-32075;n-=12,n<0&&(n+=24);var f=i+(n*s.SECONDS_PER_HOUR+a*s.SECONDS_PER_MINUTE+o*s.SECONDS_PER_MILLISECOND);return f>=43200&&(l-=1),[l,f]}function m(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=r(e,0),t=r(t,0),n=r(n,c.UTC);var a=0|e;t+=(e-a)*s.SECONDS_PER_DAY,h(a,t,this),n===c.UTC&&f(this)}var p=new i,y=[31,28,31,30,31,30,31,31,30,31,30,31],_=29,T=new u,v=/^(\d{4})$/,R=/^(\d{4})-(\d{2})$/,A=/^(\d{4})-?(\d{3})$/,S=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,N=/^(\d{4})-?(\d{2})-?(\d{2})$/,g=/([Z+\-])?(\d{2})?:?(\d{2})?$/,I=/^(\d{2})(\.\d+)?/.source+g.source,O=/^(\d{2}):?(\d{2})(\.\d+)?/.source+g.source,w=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+g.source;m.fromDate=function(e,t){var r=E(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return n(t)?(h(r[0],r[1],t),f(t),t):new m(r[0],r[1],c.UTC)},m.fromIso8601=function(e,t){e=e.replace(",",".");var r,a,i,u=e.split("T"),s=1,l=1,d=0,p=0,T=0,g=0,M=u[0],x=u[1];if(u=M.match(N),null!==u)r=+u[1],s=+u[2],l=+u[3];else if(u=M.match(R),null!==u)r=+u[1],s=+u[2];else if(u=M.match(v),null!==u)r=+u[1];else{var C;if(u=M.match(A),null!==u)r=+u[1],C=+u[2],i=o(r);else if(u=M.match(S),null!==u){r=+u[1];var P=+u[2],D=+u[3]||0,L=new Date(Date.UTC(r,0,4));C=7*P+D-L.getUTCDay()-3}a=new Date(Date.UTC(r,0,1)),a.setUTCDate(C),s=a.getUTCMonth()+1,l=a.getUTCDate()}i=o(r);var U;if(n(x)){u=x.match(w),null!==u?(d=+u[1],p=+u[2],T=+u[3],g=1e3*+(u[4]||0),U=5):(u=x.match(O),null!==u?(d=+u[1],p=+u[2],T=60*+(u[3]||0),U=4):(u=x.match(I),null!==u&&(d=+u[1],p=60*+(u[2]||0),U=3)));var b=u[U],F=+u[U+1],z=+(u[U+2]||0);switch(b){case"+":d-=F,p-=z;break;case"-":d+=F,p+=z;break;case"Z":break;default:p+=new Date(Date.UTC(r,s-1,l,d,p)).getTimezoneOffset()}}else p+=new Date(r,s-1,l).getTimezoneOffset();var B=60===T;for(B&&T--;p>=60;)p-=60,d++;for(;d>=24;)d-=24,l++;for(a=i&&2===s?_:y[s-1];l>a;)l-=a,s++,s>12&&(s-=12,r++),a=i&&2===s?_:y[s-1];for(;p<0;)p+=60,d--;for(;d<0;)d+=24,l--;for(;l<1;)s--,s<1&&(s+=12,r--),a=i&&2===s?_:y[s-1],l+=a;var G=E(r,s,l,d,p,T,g);return n(t)?(h(G[0],G[1],t),f(t)):t=new m(G[0],G[1],c.UTC),B&&m.addSeconds(t,1,t),t},m.now=function(e){return m.fromDate(new Date,e)};var M=new m(0,0,c.TAI);return m.toGregorianDate=function(e,t){var r=!1,a=d(e,M);n(a)||(m.addSeconds(e,-1,M),a=d(M,M),r=!0);var o=a.dayNumber,u=a.secondsOfDay;u>=43200&&(o+=1);var c=o+68569|0,l=4*c/146097|0;c=c-((146097*l+3)/4|0)|0;var f=4e3*(c+1)/1461001|0;c=c-(1461*f/4|0)+31|0;var h=80*c/2447|0,E=c-(2447*h/80|0)|0;c=h/11|0;var p=h+2-12*c|0,y=100*(l-49)+f+c|0,_=u/s.SECONDS_PER_HOUR|0,T=u-_*s.SECONDS_PER_HOUR,v=T/s.SECONDS_PER_MINUTE|0;T-=v*s.SECONDS_PER_MINUTE;var R=0|T,A=(T-R)/s.SECONDS_PER_MILLISECOND;return _+=12,_>23&&(_-=24),r&&(R+=1),n(t)?(t.year=y,t.month=p,t.day=E,t.hour=_,t.minute=v,t.second=R,t.millisecond=A,t.isLeapSecond=r,t):new i(y,p,E,_,v,R,A,r)},m.toDate=function(e){var t=m.toGregorianDate(e,p),r=t.second;return t.isLeapSecond&&(r-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,r,t.millisecond))},m.toIso8601=function(t,r){var a,i=m.toGregorianDate(t,i);return n(r)||0===i.millisecond?n(r)&&0!==r?(a=(.01*i.millisecond).toFixed(r).replace(".","").slice(0,r),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",i.year,i.month,i.day,i.hour,i.minute,i.second):(a=(.01*i.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a))},m.clone=function(e,t){if(n(e))return n(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new m(e.dayNumber,e.secondsOfDay,c.TAI)},m.compare=function(e,t){var r=e.dayNumber-t.dayNumber;return 0!==r?r:e.secondsOfDay-t.secondsOfDay},m.equals=function(e,t){return e===t||n(e)&&n(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},m.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(m.secondsDifference(e,t))<=r},m.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},m.secondsDifference=function(e,t){var r=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return r+(e.secondsOfDay-t.secondsOfDay)},m.daysDifference=function(e,t){var r=e.dayNumber-t.dayNumber,n=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return r+n},m.computeTaiMinusUtc=function(e){T.julianDate=e;var r=m.leapSeconds,n=t(r,T,l);return n<0&&(n=~n,--n,n<0&&(n=0)),r[n].offset},m.addSeconds=function(e,t,r){return h(e.dayNumber,e.secondsOfDay+t,r)},m.addMinutes=function(e,t,r){var n=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return h(e.dayNumber,n,r)},m.addHours=function(e,t,r){var n=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return h(e.dayNumber,n,r)},m.addDays=function(e,t,r){var n=e.dayNumber+t;return h(n,e.secondsOfDay,r)},m.lessThan=function(e,t){return m.compare(e,t)<0},m.lessThanOrEquals=function(e,t){return m.compare(e,t)<=0},m.greaterThan=function(e,t){return m.compare(e,t)>0},m.greaterThanOrEquals=function(e,t){return m.compare(e,t)>=0},m.prototype.clone=function(e){return m.clone(this,e)},m.prototype.equals=function(e){return m.equals(this,e)},m.prototype.equalsEpsilon=function(e,t){return m.equalsEpsilon(this,e,t)},m.prototype.toString=function(){return m.toIso8601(this)},m.leapSeconds=[new u(new m(2441317,43210,c.TAI),10),new u(new m(2441499,43211,c.TAI),11),new u(new m(2441683,43212,c.TAI),12),new u(new m(2442048,43213,c.TAI),13),new u(new m(2442413,43214,c.TAI),14),new u(new m(2442778,43215,c.TAI),15),new u(new m(2443144,43216,c.TAI),16),new u(new m(2443509,43217,c.TAI),17),new u(new m(2443874,43218,c.TAI),18),new u(new m(2444239,43219,c.TAI),19),new u(new m(2444786,43220,c.TAI),20),new u(new m(2445151,43221,c.TAI),21),new u(new m(2445516,43222,c.TAI),22),new u(new m(2446247,43223,c.TAI),23),new u(new m(2447161,43224,c.TAI),24),new u(new m(2447892,43225,c.TAI),25),new u(new m(2448257,43226,c.TAI),26),new u(new m(2448804,43227,c.TAI),27),new u(new m(2449169,43228,c.TAI),28),new u(new m(2449534,43229,c.TAI),29),new u(new m(2450083,43230,c.TAI),30),new u(new m(2450630,43231,c.TAI),31),new u(new m(2451179,43232,c.TAI),32),new u(new m(2453736,43233,c.TAI),33),new u(new m(2454832,43234,c.TAI),34),new u(new m(2456109,43235,c.TAI),35),new u(new m(2457204,43236,c.TAI),36),new u(new m(2457754,43237,c.TAI),37)],m}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(r,n){if(null===r||"object"!=typeof r)return r;n=e(n,!1);var a=new r.constructor;for(var i in r)if(r.hasOwnProperty(i)){var o=r[i];n&&(o=t(o,n)),a[i]=o}return a}return t}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var r=e.split("\r\n"),n=0;n<r.length;++n){var a=r[n],i=a.indexOf(": ");if(i>0){var o=a.substring(0,i),u=a.substring(i+2);t[o]=u}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function r(e,r,n){this.statusCode=e,this.response=r,this.responseHeaders=n,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return r.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},r}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var r=n.exec(t);this.scheme=r[1],this.authority=r[2],this.path=r[3],this.query=r[4],this.fragment=r[5]}}function t(e){var t=unescape(e);return i.test(t)?t:e.toUpperCase()}function r(e,t,r,n){return(t||"")+r.toLowerCase()+(n||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var n=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(o,r).replace(a,t)),this.path&&(this.path=this.path.replace(a,t)),this.query&&(this.query=this.query.replace(a,t)),this.fragment&&(this.fragment=this.fragment.replace(a,t))};var a=/%[0-9a-z]{2}/gi,i=/[a-zA-Z0-9\-\._~]/,o=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var r=new e;return this.scheme?(r.scheme=this.scheme,r.authority=this.authority,r.path=this.path,r.query=this.query):(r.scheme=t.scheme,this.authority?(r.authority=this.authority,r.path=this.path,r.query=this.query):(r.authority=t.authority,""==this.path?(r.path=t.path,r.query=this.query||t.query):("/"==this.path.charAt(0)?(r.path=this.path,r.removeDotSegments()):(t.authority&&""==t.path?r.path="/"+this.path:r.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,r.removeDotSegments()),r.query=this.query))),r.fragment=this.fragment,r},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),r=[],n=""==t[0];n&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?r.pop():"."!=e&&r.push(e);"."!=e&&".."!=e||r.push(""),n&&r.unshift(""),this.path=r.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(r){var n=new e(r);n.normalize();var a=n.getAuthority();if(t(a)){if(a.indexOf("@")!==-1){var i=a.split("@");a=i[1]}if(a.indexOf(":")===-1){var o=n.getScheme();if(t(o)||(o=window.location.protocol,o=o.substring(0,o.length-1)),"http"===o)a+=":80";else{if("https"!==o)return;a+=":443"}}return a}}var a={},i={};return a.add=function(e,r){var n=e.toLowerCase()+":"+r;t(i[n])||(i[n]=!0)},a.remove=function(e,r){var n=e.toLowerCase()+":"+r;t(i[n])&&delete i[n]},a.contains=function(e){var r=n(e);return!(!t(r)||!t(i[r]))},a.clear=function(){i={}},a}),define("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,r,n,a,i,o){"use strict";function u(r){r=t(r,t.EMPTY_OBJECT);var n=r.responseType,a=t(r.method,"GET"),i=r.data,o=r.headers,s=r.overrideMimeType;return e(r.url,function(t){var r=e.defer();return u.load(t,n,a,i,o,r,s),r.promise})}function s(e,t){var r=decodeURIComponent(t);return e?atob(r):r}function c(e,t){for(var r=s(e,t),n=new ArrayBuffer(r.length),a=new Uint8Array(n),i=0;i<r.length;i++)a[i]=r.charCodeAt(i);return n}function l(e,r){r=t(r,"");var n=e[1],a=!!e[2],i=e[3];switch(r){case"":case"text":return s(a,i);case"arraybuffer":return c(a,i);case"blob":var o=c(a,i);return new Blob([o],{type:n});case"document":var u=new DOMParser;return u.parseFromString(s(a,i),n);case"json":return JSON.parse(s(a,i))}}var f=/^data:(.*?)(;base64)?,(.*)$/;return u.load=function(e,t,n,u,s,c,d){var h=f.exec(e);if(null!==h)return void c.resolve(l(h,t));var E=new XMLHttpRequest;if(o.contains(e)&&(E.withCredentials=!0),r(d)&&r(E.overrideMimeType)&&E.overrideMimeType(d),E.open(n,e,!0),r(s))for(var m in s)s.hasOwnProperty(m)&&E.setRequestHeader(m,s[m]);r(t)&&(E.responseType=t),E.onload=function(){if(E.status<200||E.status>=300)return void c.reject(new a(E.status,E.response,E.getAllResponseHeaders()));var e=E.response,n=E.responseType;if(!r(e)||r(t)&&n!==t)if("json"===t&&"string"==typeof e)try{c.resolve(JSON.parse(e))}catch(e){c.reject(e)}else(""===n||"document"===n)&&r(E.responseXML)&&E.responseXML.hasChildNodes()?c.resolve(E.responseXML):""!==n&&"text"!==n||!r(E.responseText)?c.reject(new i("Invalid XMLHttpRequest response type.")):c.resolve(E.responseText);else c.resolve(e)},E.onerror=function(e){c.reject(new a)},E.send(u)},u.defaultLoad=u.load,u}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,r){return e({url:t,headers:r})}return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,r,n){"use strict";function a(r,a){return t(a)?t(a.Accept)||(a=e(a),a.Accept=i.Accept):a=i,n(r,a).then(function(e){return JSON.parse(e)})}var i={Accept:"application/json,*/*;q=0.01"};return a}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,r,n,a,i,o,u,s,c,l,f){"use strict";function d(t){if(t=r(t,r.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=r(t.addNewLeapSeconds,!0),n(t.data))E(this,t.data);else if(n(t.url)){var a=this;this._downloadPromise=e(s(t.url),function(e){E(a,e)},function(){a._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else E(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function h(e,t){return o.compare(e.julianDate,t)}function E(e,r){if(!n(r.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!n(r.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var a=r.columnNames.indexOf("modifiedJulianDateUtc"),i=r.columnNames.indexOf("xPoleWanderRadians"),s=r.columnNames.indexOf("yPoleWanderRadians"),c=r.columnNames.indexOf("ut1MinusUtcSeconds"),d=r.columnNames.indexOf("xCelestialPoleOffsetRadians"),E=r.columnNames.indexOf("yCelestialPoleOffsetRadians"),m=r.columnNames.indexOf("taiMinusUtcSeconds");if(a<0||i<0||s<0||c<0||d<0||E<0||m<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var p=e._samples=r.samples,y=e._dates=[];e._dateColumn=a,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=d,e._yCelestialPoleOffsetRadiansColumn=E,e._taiMinusUtcSecondsColumn=m,e._columnCount=r.columnNames.length,e._lastIndex=void 0;for(var _,T=e._addNewLeapSeconds,v=0,R=p.length;v<R;v+=e._columnCount){var A=p[v+a],S=p[v+m],N=A+l.MODIFIED_JULIAN_DATE_DIFFERENCE,g=new o(N,S,f.TAI);if(y.push(g),T){if(S!==_&&n(_)){var I=o.leapSeconds,O=t(I,g,h);if(O<0){var w=new u(g,S);I.splice(~O,0,w)}}_=S}}}function m(e,t,r,n,a){var i=r*n;a.xPoleWander=t[i+e._xPoleWanderRadiansColumn],a.yPoleWander=t[i+e._yPoleWanderRadiansColumn],a.xPoleOffset=t[i+e._xCelestialPoleOffsetRadiansColumn],a.yPoleOffset=t[i+e._yCelestialPoleOffsetRadiansColumn],a.ut1MinusUtc=t[i+e._ut1MinusUtcSecondsColumn]}function p(e,t,r){return t+e*(r-t)}function y(e,t,r,n,a,i,u){var s=e._columnCount;if(i>t.length-1)return u.xPoleWander=0,u.yPoleWander=0,u.xPoleOffset=0,u.yPoleOffset=0,u.ut1MinusUtc=0,u;var c=t[a],l=t[i];if(c.equals(l)||n.equals(c))return m(e,r,a,s,u),u;if(n.equals(l))return m(e,r,i,s,u),u;var f=o.secondsDifference(n,c)/o.secondsDifference(l,c),d=a*s,h=i*s,E=r[d+e._ut1MinusUtcSecondsColumn],y=r[h+e._ut1MinusUtcSecondsColumn],_=y-E;if(_>.5||_<-.5){var T=r[d+e._taiMinusUtcSecondsColumn],v=r[h+e._taiMinusUtcSecondsColumn];T!==v&&(l.equals(n)?E=y:y-=v-T)}return u.xPoleWander=p(f,r[d+e._xPoleWanderRadiansColumn],r[h+e._xPoleWanderRadiansColumn]),u.yPoleWander=p(f,r[d+e._yPoleWanderRadiansColumn],r[h+e._yPoleWanderRadiansColumn]),u.xPoleOffset=p(f,r[d+e._xCelestialPoleOffsetRadiansColumn],r[h+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=p(f,r[d+e._yCelestialPoleOffsetRadiansColumn],r[h+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=p(f,E,y),u}return d.NONE=i({getPromiseToLoad:function(){return e()},compute:function(e,t){return n(t)?(t.xPoleWander=0, +t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new a(0,0,0,0,0),t}}),d.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},d.prototype.compute=function(e,r){if(n(this._samples)){if(n(r)||(r=new a(0,0,0,0,0)),0===this._samples.length)return r.xPoleWander=0,r.yPoleWander=0,r.xPoleOffset=0,r.yPoleOffset=0,r.ut1MinusUtc=0,r;var i=this._dates,u=this._lastIndex,s=0,l=0;if(n(u)){var f=i[u],d=i[u+1],h=o.lessThanOrEquals(f,e),E=!n(d),m=E||o.greaterThanOrEquals(d,e);if(h&&m)return s=u,!E&&d.equals(e)&&++s,l=s+1,y(this,i,this._samples,e,s,l,r),r}var p=t(i,e,o.compare,this._dateColumn);return p>=0?(p<i.length-1&&i[p+1].equals(e)&&++p,s=p,l=p):(l=~p,s=l-1,s<0&&(s=0)),this._lastIndex=s,y(this,i,this._samples,e,s,l,r),r}if(n(this._dataError))throw new c(this._dataError)},d}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,r,n){"use strict";function a(t,r,n){this.heading=e(t,0),this.pitch=e(r,0),this.roll=e(n,0)}return a.fromQuaternion=function(e,r){t(r)||(r=new a);var n=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return r.heading=-Math.atan2(s,u),r.roll=Math.atan2(o,i),r.pitch=-Math.asin(n),r},a.fromDegrees=function(e,r,i,o){return t(o)||(o=new a),o.heading=e*n.RADIANS_PER_DEGREE,o.pitch=r*n.RADIANS_PER_DEGREE,o.roll=i*n.RADIANS_PER_DEGREE,o},a.clone=function(e,r){if(t(e))return t(r)?(r.heading=e.heading,r.pitch=e.pitch,r.roll=e.roll,r):new a(e.heading,e.pitch,e.roll)},a.equals=function(e,r){return e===r||t(e)&&t(r)&&e.heading===r.heading&&e.pitch===r.pitch&&e.roll===r.roll},a.equalsEpsilon=function(e,r,a,i){return e===r||t(e)&&t(r)&&n.equalsEpsilon(e.heading,r.heading,a,i)&&n.equalsEpsilon(e.pitch,r.pitch,a,i)&&n.equalsEpsilon(e.roll,r.roll,a,i)},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,r){return a.equalsEpsilon(this,e,t,r)},a.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},a}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function a(r,n){n=t(n,document.location.href);var a=new e(n),i=new e(r);return i.resolve(a).toString()}return a}),define("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function a(n,a,i){i=t(i,!0),n instanceof e||(n=new e(n)),a instanceof e||(a=new e(a)),r(a.authority)&&!r(a.scheme)&&("undefined"!=typeof document&&r(document.location)&&r(document.location.href)?a.scheme=new e(document.location.href).scheme:a.scheme=n.scheme);var o=n;a.isAbsolute()&&(o=a);var u="";r(o.scheme)&&(u+=o.scheme+":"),r(o.authority)&&(u+="//"+o.authority,""!==o.path&&"/"!==o.path&&(u=u.replace(/\/?$/,"/"),o.path=o.path.replace(/^\/?/g,""))),u+=o===n?i?n.path.replace(/\/?$/,"/")+a.path.replace(/^\/?/g,""):n.path+a.path:a.path;var s=r(n.query),c=r(a.query);s&&c?u+="?"+n.query+"&"+a.query:s&&!c?u+="?"+n.query:!s&&c&&(u+="?"+a.query);var l=r(a.fragment);return r(n.fragment)&&!l?u+="#"+n.fragment:l&&(u+="#"+a.fragment),u}return a}),define("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","./joinUrls","require"],function(e,t,r,n,a,i){"use strict";function o(){for(var e=document.getElementsByTagName("script"),t=0,r=e.length;t<r;++t){var n=e[t].getAttribute("src"),a=E.exec(n);if(null!==a)return a[1]}}function u(){if(t(f))return f;var r;return r="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:o(),f=new e(n(r))}function s(e){return i.toUrl("../"+e)}function c(e){return a(u(),e)}function l(e){t(d)||(d=t(i.toUrl)?s:c),t(h)||(h=document.createElement("a"));var r=d(e);return h.href=r,h.href=h.href,h.href}var f,d,h,E=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return l._cesiumScriptRegex=E,l.setBaseUrl=function(t){f=new e(t).resolve(new e(document.location.href))},l}),define("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,r){this.x=e,this.y=t,this.s=r}return e}),define("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,r,n,a,i,o,u){"use strict";function s(e){e=r(e,r.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=r(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=r(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new i(this._sampleZeroJulianEphemerisDate,0,u.TAI),this._stepSizeDays=r(e.stepSizeDays,1),this._samplesPerXysFile=r(e.samplesPerXysFile,1e3),this._totalSamples=r(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,n=this._denominators=new Array(t+1),a=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t),s=0;s<=t;++s){n[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;c<=t;++c)c!==s&&(n[s]*=s-c);n[s]=1/n[s]}this._work=new Array(t+1),this._coef=new Array(t+1)}function c(e,t,r){var n=f;return n.dayNumber=t,n.secondsOfDay=r,i.daysDifference(n,e._sampleZeroDateTT)}function l(r,a){if(r._chunkDownloadsInProgress[a])return r._chunkDownloadsInProgress[a];var i=e.defer();r._chunkDownloadsInProgress[a]=i;var u,s=r._xysFileUrlTemplate;return u=n(s)?s.replace("{0}",a):t("Assets/IAU2006_XYS/IAU2006_XYS_"+a+".json"),e(o(u),function(e){r._chunkDownloadsInProgress[a]=!1;for(var t=r._samples,n=e.samples,o=a*r._samplesPerXysFile*3,u=0,s=n.length;u<s;++u)t[o+u]=n[u];i.resolve()}),i.promise}var f=new i(0,0,u.TAI);return s.prototype.preload=function(t,r,n,a){var i=c(this,t,r),o=c(this,n,a),u=i/this._stepSizeDays-this._interpolationOrder/2|0;u<0&&(u=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var f=u/this._samplesPerXysFile|0,d=s/this._samplesPerXysFile|0,h=[],E=f;E<=d;++E)h.push(l(this,E));return e.all(h)},s.prototype.computeXysRadians=function(e,t,r){var i=c(this,e,t);if(!(i<0)){var o=i/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);s<0&&(s=0);var f=s+u;f>=this._totalSamples&&(f=this._totalSamples-1,s=f-u,s<0&&(s=0));var d=!1,h=this._samples;if(n(h[3*s])||(l(this,s/this._samplesPerXysFile|0),d=!0),n(h[3*f])||(l(this,f/this._samplesPerXysFile|0),d=!0),!d){n(r)?(r.x=0,r.y=0,r.s=0):r=new a(0,0,0);var E,m,p=i-s*this._stepSizeDays,y=this._work,_=this._denominators,T=this._coef,v=this._xTable;for(E=0;E<=u;++E)y[E]=p-v[E];for(E=0;E<=u;++E){for(T[E]=1,m=0;m<=u;++m)m!==E&&(T[E]*=y[m]);T[E]*=_[E];var R=3*(s+E);r.x+=T[E]*h[R++],r.y+=T[E]*h[R++],r.s+=T[E]*h[R]}return r}}}},s}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./Check","./defaultValue","./defined","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./HeadingPitchRoll","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,r,n,a,i,o,u,s,c,l,f,d,h,E,m,p,y,_,T,v){"use strict";var R={},A=new r,S=new r,N=new r;R.eastNorthUpToFixedFrame=function(e,t,n){if(p.equalsEpsilon(e.x,0,p.EPSILON14)&&p.equalsEpsilon(e.y,0,p.EPSILON14)){var a=p.sign(e.z);return u(n)?(n[0]=0,n[1]=1,n[2]=0,n[3]=0,n[4]=-a,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=a,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new _(0,-a,0,e.x,1,0,0,e.y,0,0,a,e.z,0,0,0,1)}var i=A,s=S,c=N;return t=o(t,f.WGS84),t.geodeticSurfaceNormal(e,i),s.x=-e.y,s.y=e.x,s.z=0,r.normalize(s,s),r.cross(i,s,c),u(n)?(n[0]=s.x,n[1]=s.y,n[2]=s.z,n[3]=0,n[4]=c.x,n[5]=c.y,n[6]=c.z,n[7]=0,n[8]=i.x,n[9]=i.y,n[10]=i.z,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new _(s.x,c.x,i.x,e.x,s.y,c.y,i.y,e.y,s.z,c.z,i.z,e.z,0,0,0,1)};var g=new r,I=new r,O=new r;R.northEastDownToFixedFrame=function(e,t,n){if(p.equalsEpsilon(e.x,0,p.EPSILON14)&&p.equalsEpsilon(e.y,0,p.EPSILON14)){var a=p.sign(e.z);return u(n)?(n[0]=-a,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=1,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=-a,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new _(-a,0,0,e.x,0,1,0,e.y,0,0,-a,e.z,0,0,0,1)}var i=g,s=I,c=O;return t=o(t,f.WGS84),t.geodeticSurfaceNormal(e,i),s.x=-e.y,s.y=e.x,s.z=0,r.normalize(s,s),r.cross(i,s,c),u(n)?(n[0]=c.x,n[1]=c.y,n[2]=c.z,n[3]=0,n[4]=s.x,n[5]=s.y,n[6]=s.z,n[7]=0,n[8]=-i.x,n[9]=-i.y,n[10]=-i.z,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new _(c.x,s.x,-i.x,e.x,c.y,s.y,-i.y,e.y,c.z,s.z,-i.z,e.z,0,0,0,1)},R.northUpEastToFixedFrame=function(e,t,n){if(p.equalsEpsilon(e.x,0,p.EPSILON14)&&p.equalsEpsilon(e.y,0,p.EPSILON14)){var a=p.sign(e.z);return u(n)?(n[0]=-a,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=a,n[7]=0,n[8]=0,n[9]=1,n[10]=0,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new _(-a,0,0,e.x,0,0,1,e.y,0,a,0,e.z,0,0,0,1)}var i=A,s=S,c=N;return t=o(t,f.WGS84),t.geodeticSurfaceNormal(e,i),s.x=-e.y,s.y=e.x,s.z=0,r.normalize(s,s),r.cross(i,s,c),u(n)?(n[0]=c.x,n[1]=c.y,n[2]=c.z,n[3]=0,n[4]=i.x,n[5]=i.y,n[6]=i.z,n[7]=0,n[8]=s.x,n[9]=s.y,n[10]=s.z,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new _(c.x,i.x,s.x,e.x,c.y,i.y,s.y,e.y,c.z,i.z,s.z,e.z,0,0,0,1)},R.northWestUpToFixedFrame=function(e,t,n){if(p.equalsEpsilon(e.x,0,p.EPSILON14)&&p.equalsEpsilon(e.y,0,p.EPSILON14)){var a=p.sign(e.z);return u(n)?(n[0]=-a,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=-1,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=a,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new _(-a,0,0,e.x,0,-1,0,e.y,0,0,a,e.z,0,0,0,1)}var i=A,s=S,c=N;return t=o(t,f.WGS84),t.geodeticSurfaceNormal(e,i),s.x=-e.y,s.y=e.x,s.z=0,r.normalize(s,s),r.cross(i,s,c),u(n)?(n[0]=c.x,n[1]=c.y,n[2]=c.z,n[3]=0,n[4]=-s.x,n[5]=-s.y,n[6]=-s.z,n[7]=0,n[8]=i.x,n[9]=i.y,n[10]=i.z,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new _(c.x,-s.x,i.x,e.x,c.y,-s.y,i.y,e.y,c.z,-s.z,i.z,e.z,0,0,0,1)};var w=new T,M=new r(1,1,1),x=new _;R.headingPitchRollToFixedFrame=function(e,t,n,a){i.typeOf.object("headingPitchRoll",t);var o=t.heading,u=t.pitch,s=t.roll,c=T.fromHeadingPitchRoll(o,u,s,w),l=_.fromTranslationQuaternionRotationScale(r.ZERO,c,M,x);return a=R.eastNorthUpToFixedFrame(e,n,a),_.multiply(a,l,a)};var C=new _,P=new y;R.headingPitchRollQuaternion=function(e,t,r,n){i.typeOf.object("headingPitchRoll",t);var a=R.headingPitchRollToFixedFrame(e,t,r,C),o=_.getRotation(a,P);return T.fromRotationMatrix(o,n)};var D=24110.54841,L=8640184.812866,U=.093104,b=-62e-7,F=1.1772758384668e-19,z=72921158553e-15,B=p.TWO_PI/86400,G=new m;R.computeTemeToPseudoFixedMatrix=function(e,t){G=m.addSeconds(e,-m.computeTaiMinusUtc(e),G);var r,n=G.dayNumber,a=G.secondsOfDay,i=n-2451545;r=a>=43200?(i+.5)/v.DAYS_PER_JULIAN_CENTURY:(i-.5)/v.DAYS_PER_JULIAN_CENTURY;var o=D+r*(L+r*(U+r*b)),s=o*B%p.TWO_PI,c=z+F*(n-2451545.5),l=(a+.5*v.SECONDS_PER_DAY)%v.SECONDS_PER_DAY,f=s+c*l,d=Math.cos(f),h=Math.sin(f);return u(t)?(t[0]=d,t[1]=-h,t[2]=0,t[3]=h,t[4]=d,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new y(d,h,0,-h,d,0,0,0,1)},R.iau2006XysData=new h,R.earthOrientationParameters=c.NONE;var q=32.184,V=2451545;R.preloadIcrfFixed=function(t){var r=t.start.dayNumber,n=t.start.secondsOfDay+q,a=t.stop.dayNumber,i=t.stop.secondsOfDay+q,o=R.iau2006XysData.preload(r,n,a,i),u=R.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},R.computeIcrfToFixedMatrix=function(e,t){u(t)||(t=new y);var r=R.computeFixedToIcrfMatrix(e,t);if(u(r))return y.transpose(r,t)};var W=new E(0,0,0),X=new l(0,0,0,0,0,0),H=new y,Y=new y;R.computeFixedToIcrfMatrix=function(e,t){u(t)||(t=new y);var r=R.earthOrientationParameters.compute(e,X);if(u(r)){var n=e.dayNumber,a=e.secondsOfDay+q,i=R.iau2006XysData.computeXysRadians(n,a,W);if(u(i)){var o=i.x+r.xPoleOffset,s=i.y+r.yPoleOffset,c=1/(1+Math.sqrt(1-o*o-s*s)),l=H;l[0]=1-c*o*o,l[3]=-c*o*s,l[6]=o,l[1]=-c*o*s,l[4]=1-c*s*s,l[7]=s,l[2]=-o,l[5]=-s,l[8]=1-c*(o*o+s*s);var f=y.fromRotationZ(-i.s,Y),d=y.multiply(l,f,H),h=e.dayNumber,E=e.secondsOfDay-m.computeTaiMinusUtc(e)+r.ut1MinusUtc,_=h-2451545,T=E/v.SECONDS_PER_DAY,A=.779057273264+T+.00273781191135448*(_+T);A=A%1*p.TWO_PI;var S=y.fromRotationZ(A,Y),N=y.multiply(d,S,H),g=Math.cos(r.xPoleWander),I=Math.cos(r.yPoleWander),O=Math.sin(r.xPoleWander),w=Math.sin(r.yPoleWander),M=n-V+a/v.SECONDS_PER_DAY;M/=36525;var x=-47e-6*M*p.RADIANS_PER_DEGREE/3600,C=Math.cos(x),P=Math.sin(x),D=Y;return D[0]=g*C,D[1]=g*P,D[2]=O,D[3]=-I*P+w*O*C,D[4]=I*C+w*O*P,D[5]=-w*g,D[6]=-w*P-I*O*C,D[7]=w*C-I*O*P,D[8]=I*g,y.multiply(N,D,t)}}};var k=new n;R.pointToWindowCoordinates=function(e,t,r,n){return n=R.pointToGLWindowCoordinates(e,t,r,n),n.y=2*t[5]-n.y,n},R.pointToGLWindowCoordinates=function(e,r,a,i){u(i)||(i=new t);var o=k;return _.multiplyByVector(e,n.fromElements(a.x,a.y,a.z,1,o),o),n.multiplyByScalar(o,1/o.w,o),_.multiplyByVector(r,o,o),t.fromCartesian4(o,i)};var j=new r,Z=new r,K=new r;R.rotationMatrixFromPositionVelocity=function(e,t,n,a){var i=o(n,f.WGS84).geodeticSurfaceNormal(e,j),s=r.cross(t,i,Z);r.equalsEpsilon(s,r.ZERO,p.EPSILON6)&&(s=r.clone(r.UNIT_X,s));var c=r.cross(s,t,K);return r.cross(t,c,s),r.negate(s,s),u(a)||(a=new y),a[0]=t.x,a[1]=t.y,a[2]=t.z,a[3]=s.x,a[4]=s.y,a[5]=s.z,a[6]=c.x,a[7]=c.y,a[8]=c.z,a};var J=new a,Q=new r,$=new r,ee=new n,te=new n,re=new n,ne=new n,ae=new n,ie=new _,oe=new _;R.basisTo2D=function(e,t,a){var i=e.ellipsoid,o=_.getColumn(t,3,ee),u=i.cartesianToCartographic(o,J),s=R.eastNorthUpToFixedFrame(o,i,ie),c=_.inverseTransformation(s,oe),l=e.project(u,Q),f=te;f.x=l.z,f.y=l.x,f.z=l.y,f.w=1;var d=_.getColumn(t,0,$),h=r.magnitude(d),E=_.multiplyByVector(c,d,re);n.fromElements(E.z,E.x,E.y,0,E);var m=_.getColumn(t,1,$),p=r.magnitude(m),y=_.multiplyByVector(c,m,ne);n.fromElements(y.z,y.x,y.y,0,y);var T=_.getColumn(t,2,$),v=r.magnitude(T),A=ae;return r.cross(E,y,A),r.normalize(A,A),r.cross(y,A,E),r.normalize(E,E),r.cross(A,E,y),r.normalize(y,y),r.multiplyByScalar(E,h,E),r.multiplyByScalar(y,p,y),r.multiplyByScalar(A,v,A),_.setColumn(a,0,E,a),_.setColumn(a,1,y,a),_.setColumn(a,2,A,a),_.setColumn(a,3,f,a),a};var ue=new _(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);return R.wgs84To2DModelMatrix=function(e,t,r){var n=e.ellipsoid,a=R.eastNorthUpToFixedFrame(t,n,ie),i=_.inverseTransformation(a,oe),o=n.cartesianToCartographic(t,J),u=e.project(o,Q),s=te;s.x=u.z,s.y=u.x,s.z=u.y,s.w=1;var c=_.fromTranslation(s,ie);return _.multiply(ue,i,r),_.multiply(c,r,r),r},R}),define("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,r,n){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.position=e(t.position,!1),this.normal=e(t.normal,!1),this.st=e(t.st,!1),this.bitangent=e(t.bitangent,!1),this.tangent=e(t.tangent,!1),this.color=e(t.color,!1)}return a.POSITION_ONLY=n(new a({position:!0})),a.POSITION_AND_NORMAL=n(new a({position:!0,normal:!0})),a.POSITION_NORMAL_AND_ST=n(new a({position:!0,normal:!0,st:!0})),a.POSITION_AND_ST=n(new a({position:!0,st:!0})),a.POSITION_AND_COLOR=n(new a({position:!0,color:!0})),a.ALL=n(new a({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0})),a.DEFAULT=a.POSITION_NORMAL_AND_ST,a.packedLength=6,a.pack=function(t,r,n){return n=e(n,0),r[n++]=t.position?1:0,r[n++]=t.normal?1:0,r[n++]=t.st?1:0,r[n++]=t.tangent?1:0,r[n++]=t.bitangent?1:0,r[n++]=t.color?1:0,r},a.unpack=function(r,n,i){return n=e(n,0),t(i)||(i=new a),i.position=1===r[n++],i.normal=1===r[n++],i.st=1===r[n++],i.tangent=1===r[n++],i.bitangent=1===r[n++],i.color=1===r[n++],i},a.clone=function(e,r){if(t(e))return t(r)||(r=new a),r.position=e.position,r.normal=e.normal,r.st=e.st,r.tangent=e.tangent,r.bitangent=e.bitangent,r.color=e.color,r},a}),define("Core/EllipseGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError","./EllipseGeometryLibrary","./Ellipsoid","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix3","./Matrix4","./PrimitiveType","./Quaternion","./Rectangle","./Transforms","./VertexFormat"],function(e,t,r,n,a,i,o,u,s,c,l,f,d,h,E,m,p,y,_,T,v,R,A,S,N,g){"use strict";function I(e,n,i){var o=n.vertexFormat,u=n.center,s=n.semiMajorAxis,l=n.semiMinorAxis,d=n.ellipsoid,m=n.stRotation,p=i?e.length/3*2:e.length/3,y=n.shadowVolume,_=o.st?new Float32Array(2*p):void 0,v=o.normal?new Float32Array(3*p):void 0,R=o.tangent?new Float32Array(3*p):void 0,S=o.bitangent?new Float32Array(3*p):void 0,N=y?new Float32Array(3*p):void 0,g=0,I=q,O=V,w=W,M=new f(d),x=M.project(d.cartesianToCartographic(u,X),H),C=d.scaleToGeodeticSurface(u,L);d.geodeticSurfaceNormal(C,C);for(var P=A.fromAxisAngle(C,m,G),D=T.fromQuaternion(P,B),F=t.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Y),j=t.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,k),Z=e.length,K=i?Z:0,J=K/3*2,Q=0;Q<Z;Q+=3){var $=Q+1,ee=Q+2,te=r.fromArray(e,Q,L);if(o.st){var re=T.multiplyByVector(D,te,U),ne=M.project(d.cartesianToCartographic(re,X),b);r.subtract(ne,x,ne),z.x=(ne.x+s)/(2*s),z.y=(ne.y+l)/(2*l),F.x=Math.min(z.x,F.x),F.y=Math.min(z.y,F.y),j.x=Math.max(z.x,j.x),j.y=Math.max(z.y,j.y),i&&(_[g+J]=z.x,_[g+1+J]=z.y),_[g++]=z.x,_[g++]=z.y}(o.normal||o.tangent||o.bitangent||y)&&(I=d.geodeticSurfaceNormal(te,I),y&&(N[Q+K]=-I.x,N[$+K]=-I.y,N[ee+K]=-I.z),(o.normal||o.tangent||o.bitangent)&&((o.tangent||o.bitangent)&&(O=r.normalize(r.cross(r.UNIT_Z,I,O),O),T.multiplyByVector(D,O,O)),o.normal&&(v[Q]=I.x,v[$]=I.y,v[ee]=I.z,i&&(v[Q+K]=-I.x,v[$+K]=-I.y,v[ee+K]=-I.z)),o.tangent&&(R[Q]=O.x,R[$]=O.y,R[ee]=O.z,i&&(R[Q+K]=-O.x,R[$+K]=-O.y,R[ee+K]=-O.z)),o.bitangent&&(w=r.normalize(r.cross(I,O,w),w),S[Q]=w.x,S[$]=w.y,S[ee]=w.z,i&&(S[Q+K]=w.x,S[$+K]=w.y,S[ee+K]=w.z))))}if(o.st){Z=_.length;for(var ae=0;ae<Z;ae+=2)_[ae]=(_[ae]-F.x)/(j.x-F.x),_[ae+1]=(_[ae+1]-F.y)/(j.y-F.y)}var ie=new E;if(o.position){var oe=c.raisePositionsToHeight(e,n,i);ie.position=new h({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:oe})}return o.st&&(ie.st=new h({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:_})),o.normal&&(ie.normal=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:v})),o.tangent&&(ie.tangent=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:R})),o.bitangent&&(ie.bitangent=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:S})),y&&(ie.extrudeDirection=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:N})),ie}function O(e){var t,r,n,a,i,o=new Array(12*(e*(e+1))-6),u=0;for(t=0,n=1,a=0;a<3;a++)o[u++]=n++,o[u++]=t,o[u++]=n;for(a=2;a<e+1;++a){for(n=a*(a+1)-1,t=(a-1)*a-1,o[u++]=n++,o[u++]=t,o[u++]=n,r=2*a,i=0;i<r-1;++i)o[u++]=n,o[u++]=t++,o[u++]=t,o[u++]=n++,o[u++]=t,o[u++]=n;o[u++]=n++,o[u++]=t,o[u++]=n}for(r=2*e,++n,++t,a=0;a<r-1;++a)o[u++]=n,o[u++]=t++,o[u++]=t,o[u++]=n++,o[u++]=t,o[u++]=n;for(o[u++]=n,o[u++]=t++,o[u++]=t,o[u++]=n++,o[u++]=t++,o[u++]=t,++t,a=e-1;a>1;--a){for(o[u++]=t++,o[u++]=t,o[u++]=n,r=2*a,i=0;i<r-1;++i)o[u++]=n,o[u++]=t++,o[u++]=t,o[u++]=n++,o[u++]=t,o[u++]=n;o[u++]=t++,o[u++]=t++,o[u++]=n++}for(a=0;a<3;a++)o[u++]=t++,o[u++]=t,o[u++]=n;return o}function w(t){var n=t.center;j=r.multiplyByScalar(t.ellipsoid.geodeticSurfaceNormal(n,j),t.height,j),j=r.add(n,j,j);var a=new e(j,t.semiMajorAxis),i=c.computeEllipsePositions(t,!0,!1),o=i.positions,u=i.numPts,s=I(o,t,!1),l=O(u);return l=y.createTypedArray(o.length/3,l),{boundingSphere:a,attributes:s,indices:l}}function M(e,n){var i=n.vertexFormat,o=n.center,u=n.semiMajorAxis,s=n.semiMinorAxis,c=n.ellipsoid,l=n.height,d=n.extrudedHeight,m=n.stRotation,p=e.length/3*2,y=new Float64Array(3*p),_=i.st?new Float32Array(2*p):void 0,v=i.normal?new Float32Array(3*p):void 0,R=i.tangent?new Float32Array(3*p):void 0,S=i.bitangent?new Float32Array(3*p):void 0,N=n.shadowVolume,g=N?new Float32Array(3*p):void 0,I=0,O=q,w=V,M=W,x=new f(c),C=x.project(c.cartesianToCartographic(o,X),H),P=c.scaleToGeodeticSurface(o,L);c.geodeticSurfaceNormal(P,P);for(var D=A.fromAxisAngle(P,m,G),j=T.fromQuaternion(D,B),Z=t.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Y),K=t.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,k),J=e.length,Q=J/3*2,$=0;$<J;$+=3){var ee,te=$+1,re=$+2,ne=r.fromArray(e,$,L);if(i.st){var ae=T.multiplyByVector(j,ne,U),ie=x.project(c.cartesianToCartographic(ae,X),b);r.subtract(ie,C,ie),z.x=(ie.x+u)/(2*u),z.y=(ie.y+s)/(2*s),Z.x=Math.min(z.x,Z.x),Z.y=Math.min(z.y,Z.y),K.x=Math.max(z.x,K.x),K.y=Math.max(z.y,K.y),_[I+Q]=z.x,_[I+1+Q]=z.y,_[I++]=z.x,_[I++]=z.y}ne=c.scaleToGeodeticSurface(ne,ne),ee=r.clone(ne,U),O=c.geodeticSurfaceNormal(ne,O),N&&(g[$+J]=-O.x,g[te+J]=-O.y,g[re+J]=-O.z);var oe=r.multiplyByScalar(O,l,F);if(ne=r.add(ne,oe,ne),oe=r.multiplyByScalar(O,d,oe),ee=r.add(ee,oe,ee),i.position&&(y[$+J]=ee.x,y[te+J]=ee.y,y[re+J]=ee.z,y[$]=ne.x,y[te]=ne.y,y[re]=ne.z),i.normal||i.tangent||i.bitangent){M=r.clone(O,M);var ue=r.fromArray(e,($+3)%J,F);r.subtract(ue,ne,ue);var se=r.subtract(ee,ne,b);O=r.normalize(r.cross(se,ue,O),O),i.normal&&(v[$]=O.x,v[te]=O.y,v[re]=O.z,v[$+J]=O.x,v[te+J]=O.y,v[re+J]=O.z),i.tangent&&(w=r.normalize(r.cross(M,O,w),w),R[$]=w.x,R[te]=w.y,R[re]=w.z,R[$+J]=w.x,R[$+1+J]=w.y,R[$+2+J]=w.z),i.bitangent&&(S[$]=M.x,S[te]=M.y,S[re]=M.z,S[$+J]=M.x,S[te+J]=M.y,S[re+J]=M.z)}}if(i.st){J=_.length;for(var ce=0;ce<J;ce+=2)_[ce]=(_[ce]-Z.x)/(K.x-Z.x),_[ce+1]=(_[ce+1]-Z.y)/(K.y-Z.y)}var le=new E;return i.position&&(le.position=new h({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:y})),i.st&&(le.st=new h({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:_})),i.normal&&(le.normal=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:v})),i.tangent&&(le.tangent=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:R})),i.bitangent&&(le.bitangent=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:S})),N&&(le.extrudeDirection=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:g})),le}function x(e){for(var t=e.length/3,r=y.createTypedArray(t,6*t),n=0,a=0;a<t;a++){var i=a,o=a+t,u=(i+1)%t,s=u+t;r[n++]=i,r[n++]=o,r[n++]=u,r[n++]=u,r[n++]=o,r[n++]=s}return r}function C(t){var n=t.center,a=t.ellipsoid,i=t.semiMajorAxis,o=r.multiplyByScalar(a.geodeticSurfaceNormal(n,L),t.height,L);Z.center=r.add(n,o,Z.center),Z.radius=i,o=r.multiplyByScalar(a.geodeticSurfaceNormal(n,o),t.extrudedHeight,o),K.center=r.add(n,o,K.center),K.radius=i;var u=c.computeEllipsePositions(t,!0,!0),s=u.positions,l=u.numPts,f=u.outerPositions,h=e.union(Z,K),E=I(s,t,!0),_=O(l),T=_.length;_.length=2*T;for(var v=s.length/3,A=0;A<T;A+=3)_[A+T]=_[A+2]+v,_[A+1+T]=_[A+1]+v,_[A+2+T]=_[A]+v;var S=y.createTypedArray(2*v/3,_),N=new d({attributes:E,indices:S,primitiveType:R.TRIANGLES}),g=M(f,t);_=x(f);var w=y.createTypedArray(2*f.length/3,_),C=new d({attributes:g,indices:w,primitiveType:R.TRIANGLES}),P=p.combineInstances([new m({geometry:N}),new m({geometry:C})]);return{boundingSphere:h,attributes:P[0].attributes,indices:P[0].indices}}function P(e,t,n,a,i){N.eastNorthUpToFixedFrame(e,t,J),v.inverseTransformation(J,Q);for(var o=0;o<4;++o)r.clone(r.ZERO,ee[o]);for(ee[0].x+=n,ee[1].x-=n,ee[2].y+=a,ee[3].y-=a,T.fromRotationZ(i,$),o=0;o<4;++o)T.multiplyByVector($,ee[o],ee[o]),v.multiplyByPoint(J,ee[o],ee[o]),t.cartesianToCartographic(ee[o],te[o]);return S.fromCartographicArray(te)}function D(e){e=i(e,i.EMPTY_OBJECT);var t=e.center,n=i(e.ellipsoid,l.WGS84),a=e.semiMajorAxis,u=e.semiMinorAxis,s=i(e.granularity,_.RADIANS_PER_DEGREE),c=i(e.height,0),f=e.extrudedHeight,d=o(f)&&Math.abs(c-f)>1,h=i(e.vertexFormat,g.DEFAULT);this._center=r.clone(t),this._semiMajorAxis=a,this._semiMinorAxis=u,this._ellipsoid=l.clone(n),this._rotation=i(e.rotation,0),this._stRotation=i(e.stRotation,0),this._height=c,this._granularity=s,this._vertexFormat=g.clone(h),this._extrudedHeight=i(f,c),this._extrude=d,this._shadowVolume=i(e.shadowVolume,!1),this._workerName="createEllipseGeometry",this._rectangle=P(this._center,this._ellipsoid,a,u,this._rotation)}var L=new r,U=new r,b=new r,F=new r,z=new t,B=new T,G=new A,q=new r,V=new r,W=new r,X=new n,H=new r,Y=new t,k=new t,j=new r,Z=new e,K=new e,J=new v,Q=new v,$=new T,ee=[new r,new r,new r,new r],te=[new n,new n,new n,new n];D.packedLength=r.packedLength+l.packedLength+g.packedLength+S.packedLength+9,D.pack=function(e,t,n){return n=i(n,0),r.pack(e._center,t,n),n+=r.packedLength,l.pack(e._ellipsoid,t,n),n+=l.packedLength,g.pack(e._vertexFormat,t,n),n+=g.packedLength,S.pack(e._rectangle,t,n),n+=S.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._extrude?1:0,t[n]=e._shadowVolume?1:0,t};var re=new r,ne=new l,ae=new g,ie=new S,oe={center:re,ellipsoid:ne,vertexFormat:ae,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,shadowVolume:void 0};return D.unpack=function(e,t,n){t=i(t,0);var a=r.unpack(e,t,re);t+=r.packedLength;var u=l.unpack(e,t,ne);t+=l.packedLength;var s=g.unpack(e,t,ae);t+=g.packedLength;var c=S.unpack(e,t,ie);t+=S.packedLength;var f=e[t++],d=e[t++],h=e[t++],E=e[t++],m=e[t++],p=e[t++],y=e[t++],_=1===e[t++],T=1===e[t];return o(n)?(n._center=r.clone(a,n._center),n._ellipsoid=l.clone(u,n._ellipsoid),n._vertexFormat=g.clone(s,n._vertexFormat),n._semiMajorAxis=f,n._semiMinorAxis=d,n._rotation=h,n._stRotation=E,n._height=m,n._granularity=p,n._extrudedHeight=y,n._extrude=_,n._shadowVolume=T,n._rectangle=S.clone(c),n):(oe.height=m,oe.extrudedHeight=y,oe.granularity=p,oe.stRotation=E,oe.rotation=h,oe.semiMajorAxis=f,oe.semiMinorAxis=d,oe.shadowVolume=T,new D(oe))},D.createGeometry=function(e){if(!(e._semiMajorAxis<=0||e._semiMinorAxis<=0)){e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);var t,r={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:e._height,extrudedHeight:e._extrudedHeight,granularity:e._granularity,vertexFormat:e._vertexFormat,stRotation:e._stRotation};return e._extrude?(r.extrudedHeight=Math.min(e._extrudedHeight,e._height),r.height=Math.max(e._extrudedHeight,e._height),r.shadowVolume=e._shadowVolume,t=C(r)):t=w(r),new d({attributes:t.attributes,indices:t.indices,primitiveType:R.TRIANGLES,boundingSphere:t.boundingSphere})}},D.createShadowVolume=function(e,t,r){var n=e._granularity,a=e._ellipsoid,i=t(n,a),o=r(n,a);return new D({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:a,rotation:e._rotation,stRotation:e._stRotation,granularity:n,extrudedHeight:i,height:o,vertexFormat:g.POSITION_ONLY,shadowVolume:!0})},u(D.prototype,{rectangle:{get:function(){return this._rectangle}}}),D}),define("Core/CircleGeometry",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./EllipseGeometry","./Ellipsoid","./VertexFormat"],function(e,t,r,n,a,i,o,u,s){"use strict";function c(e){e=r(e,r.EMPTY_OBJECT);var t=e.radius,n={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,vertexFormat:e.vertexFormat,stRotation:e.stRotation,shadowVolume:e.shadowVolume};this._ellipseGeometry=new o(n),this._workerName="createCircleGeometry"}c.packedLength=o.packedLength,c.pack=function(e,t,r){return o.pack(e._ellipseGeometry,t,r)};var l=new o({center:new e,semiMajorAxis:1,semiMinorAxis:1}),f={center:new e,radius:void 0,ellipsoid:u.clone(u.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new s,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};return c.unpack=function(t,r,a){var i=o.unpack(t,r,l);return f.center=e.clone(i._center,f.center),f.ellipsoid=u.clone(i._ellipsoid,f.ellipsoid),f.height=i._height,f.extrudedHeight=i._extrudedHeight,f.granularity=i._granularity,f.vertexFormat=s.clone(i._vertexFormat,f.vertexFormat),f.stRotation=i._stRotation,f.shadowVolume=i._shadowVolume,n(a)?(f.semiMajorAxis=i._semiMajorAxis,f.semiMinorAxis=i._semiMinorAxis,a._ellipseGeometry=new o(f),a):(f.radius=i._semiMajorAxis,new c(f))},c.createGeometry=function(e){return o.createGeometry(e._ellipseGeometry)},c.createShadowVolume=function(e,t,r){var n=e._ellipseGeometry._granularity,a=e._ellipseGeometry._ellipsoid,i=t(n,a),o=r(n,a);return new c({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:a,stRotation:e._ellipseGeometry._stRotation,granularity:n,extrudedHeight:i,height:o,vertexFormat:s.POSITION_ONLY,shadowVolume:!0})},a(c.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}}}),c}),define("Workers/createCircleGeometry",["../Core/Cartesian3","../Core/CircleGeometry","../Core/defined","../Core/Ellipsoid"],function(e,t,r,n){"use strict";function a(a,i){return r(i)&&(a=t.unpack(a,i)),a._ellipseGeometry._center=e.clone(a._ellipseGeometry._center),a._ellipseGeometry._ellipsoid=n.clone(a._ellipseGeometry._ellipsoid),t.createGeometry(a)}return a})}(); \ No newline at end of file diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createCircleOutlineGeometry.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createCircleOutlineGeometry.js index dd286162..327a436d 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createCircleOutlineGeometry.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createCircleOutlineGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,7 +55,7 @@ mersenne-twister.js - https://gist.github.com/banksean/300494 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==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";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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("Core/isArray",["./defined"],function(e){"use strict";var t=Array.isArray;return e(t)||(t=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),t}),define("Core/Check",["./defaultValue","./defined","./DeveloperError","./isArray"],function(e,t,n,r){"use strict";function i(e){return e+" was required but undefined."}function a(e,t,n){return"Expected "+n+" to be typeof "+t+", got "+e}var o={};return o.typeOf={},o.numeric={},o.defined=function(e,r){if(!t(e))throw new n(i(r))},o.numeric.maximum=function(e,t){if(o.typeOf.number(e),o.typeOf.number(t),e>t)throw new n("Expected "+e+" to be at most "+t)},o.numeric.minimum=function(e,t){if(o.typeOf.number(e),o.typeOf.number(t),e<t)throw new n("Expected "+e+" to be at least "+t)},o.typeOf.function=function(e,t){if("function"!=typeof e)throw new n(a(typeof e,"function",t))},o.typeOf.string=function(e,t){if("string"!=typeof e)throw new n(a(typeof e,"string",t))},o.typeOf.number=function(e,t){if("number"!=typeof e)throw new n(a(typeof e,"number",t))},o.typeOf.object=function(e,t){if("object"!=typeof e)throw new n(a(typeof e,"object",t))},o.typeOf.boolean=function(e,t){if("boolean"!=typeof e)throw new n(a(typeof e,"boolean",t))},o}),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 n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(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^=e<<7&2636928640,e^=e<<15&4022730752,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,n,r){"use strict";var i={};i.EPSILON1=.1,i.EPSILON2=.01,i.EPSILON3=.001,i.EPSILON4=1e-4,i.EPSILON5=1e-5,i.EPSILON6=1e-6,i.EPSILON7=1e-7,i.EPSILON8=1e-8,i.EPSILON9=1e-9,i.EPSILON10=1e-10,i.EPSILON11=1e-11,i.EPSILON12=1e-12,i.EPSILON13=1e-13,i.EPSILON14=1e-14,i.EPSILON15=1e-15,i.EPSILON16=1e-16,i.EPSILON17=1e-17,i.EPSILON18=1e-18,i.EPSILON19=1e-19,i.EPSILON20=1e-20,i.GRAVITATIONALPARAMETER=3986004418e5,i.SOLAR_RADIUS=6955e5,i.LUNAR_RADIUS=1737400,i.SIXTY_FOUR_KILOBYTES=65536,i.sign=function(e){return e>0?1:e<0?-1:0},i.signNotZero=function(e){return e<0?-1:1},i.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*i.clamp(e,-1,1)+.5)*n)},i.fromSNorm=function(e,n){return n=t(n,255),i.clamp(e,0,n)/n*2-1},i.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},i.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},i.lerp=function(e,t,n){return(1-n)*e+n*t},i.PI=Math.PI,i.ONE_OVER_PI=1/Math.PI,i.PI_OVER_TWO=.5*Math.PI,i.PI_OVER_THREE=Math.PI/3,i.PI_OVER_FOUR=Math.PI/4,i.PI_OVER_SIX=Math.PI/6,i.THREE_PI_OVER_TWO=3*Math.PI*.5,i.TWO_PI=2*Math.PI,i.ONE_OVER_TWO_PI=1/(2*Math.PI),i.RADIANS_PER_DEGREE=Math.PI/180,i.DEGREES_PER_RADIAN=180/Math.PI,i.RADIANS_PER_ARCSECOND=i.RADIANS_PER_DEGREE/3600,i.toRadians=function(e){return e*i.RADIANS_PER_DEGREE},i.toDegrees=function(e){return e*i.DEGREES_PER_RADIAN},i.convertLongitudeRange=function(e){var t=i.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},i.clampToLatitudeRange=function(e){return i.clamp(e,-1*i.PI_OVER_TWO,i.PI_OVER_TWO)},i.negativePiToPi=function(e){return i.zeroToTwoPi(e+i.PI)-i.PI},i.zeroToTwoPi=function(e){var t=i.mod(e,i.TWO_PI);return Math.abs(t)<i.EPSILON14&&Math.abs(e)>i.EPSILON14?i.TWO_PI:t},i.mod=function(e,t){return(e%t+t)%t},i.equalsEpsilon=function(e,n,r,i){i=t(i,r);var a=Math.abs(e-n);return a<=i||a<=r*Math.max(Math.abs(e),Math.abs(n))};var a=[1];i.factorial=function(e){var t=a.length;if(e>=t)for(var n=a[t-1],r=t;r<=e;r++)a.push(n*r);return a[e]},i.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},i.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},i.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},i.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return i.setRandomNumberSeed=function(t){o=new e(t)},i.nextRandomNumber=function(){return o.random()},i.acosClamped=function(e){return Math.acos(i.clamp(e,-1,1))},i.asinClamped=function(e){return Math.asin(i.clamp(e,-1,1))},i.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},i.logBase=function(e,t){return Math.log(e)/Math.log(t)},i.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},i}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var i=e.clock,a=e.cone,u=t(e.magnitude,1),s=u*Math.sin(a);return r.x=s*Math.cos(i),r.y=s*Math.sin(i),r.z=u*Math.cos(a),r},o.fromElements=function(e,t,r,i){return n(i)?(i.x=e,i.y=t,i.z=r,i):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new o),i.x=e[r++],i.y=e[r++],i.z=e[r],i},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var i=0;i<r;++i)o.pack(e[i],t,3*i);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var i=0;i<r;i+=3){var a=i/3;t[a]=o.unpack(e,i,t[a])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,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};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var E=new o,c=new o;o.angleBetween=function(e,t){o.normalize(e,E),o.normalize(t,c);var n=o.dot(E,c),r=o.magnitude(o.cross(E,c,E));return Math.atan2(r,n)};var _=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,_);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,i){return e===t||n(e)&&n(t)&&a.equalsEpsilon(e.x,t.x,r,i)&&a.equalsEpsilon(e.y,t.y,r,i)&&a.equalsEpsilon(e.z,t.z,r,i)},o.cross=function(e,t,n){var r=e.x,i=e.y,a=e.z,o=t.x,u=t.y,s=t.z,E=i*s-a*u,c=a*o-r*s,_=r*u-i*o;return n.x=E,n.y=c,n.z=_,n},o.fromDegrees=function(e,t,n,r,i){return e=a.toRadians(e),t=a.toRadians(t),o.fromRadians(e,t,n,r,i)};var l=new o,T=new o,R=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,i,a,u){i=t(i,0);var s=n(a)?a.radiiSquared:R,E=Math.cos(r);l.x=E*Math.cos(e),l.y=E*Math.sin(e),l.z=Math.sin(r),l=o.normalize(l,l),o.multiplyComponents(s,l,T);var c=Math.sqrt(o.dot(l,T));return T=o.divideByScalar(T,c,T),l=o.multiplyByScalar(l,i,l),n(u)||(u=new o),o.add(T,l,u)},o.fromDegreesArray=function(e,t,r){var i=e.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],s=e[a+1],E=a/2;r[E]=o.fromDegrees(u,s,0,t,r[E])}return r},o.fromRadiansArray=function(e,t,r){var i=e.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],s=e[a+1],E=a/2;r[E]=o.fromRadians(u,s,0,t,r[E])}return r},o.fromDegreesArrayHeights=function(e,t,r){var i=e.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],s=e[a+1],E=e[a+2],c=a/3;r[c]=o.fromDegrees(u,s,E,t,r[c])}return r},o.fromRadiansArrayHeights=function(e,t,r){var i=e.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],s=e[a+1],E=e[a+2],c=a/3;r[c]=o.fromRadians(u,s,E,t,r[c])}return r},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,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function i(n,i,u,s,E){var c=n.x,_=n.y,l=n.z,T=i.x,R=i.y,f=i.z,A=c*c*T*T,d=_*_*R*R,h=l*l*f*f,N=A+d+h,I=Math.sqrt(1/N),m=e.multiplyByScalar(n,I,a);if(N<s)return isFinite(I)?e.clone(m,E):void 0;var S=u.x,y=u.y,M=u.z,O=o;O.x=m.x*S*2,O.y=m.y*y*2,O.z=m.z*M*2;var p,C,U,g,L,x,w,v,P,F,B,D=(1-I)*e.magnitude(n)/(.5*e.magnitude(O)),z=0;do{D-=z,U=1/(1+D*S),g=1/(1+D*y),L=1/(1+D*M),x=U*U,w=g*g,v=L*L,P=x*U,F=w*g,B=v*L,p=A*x+d*w+h*v-1,C=A*P*S+d*F*y+h*B*M;var G=-2*C;z=p/G}while(Math.abs(p)>r.EPSILON12);return t(E)?(E.x=c*U,E.y=_*g,E.z=l*L,E):new e(c*U,_*g,l*L)}var a=new e,o=new e;return i}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,i,a,o){"use strict";function u(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)}u.fromRadians=function(e,r,i,a){return i=t(i,0),n(a)?(a.longitude=e,a.latitude=r,a.height=i,a):new u(e,r,i)},u.fromDegrees=function(e,t,n,r){return e=a.toRadians(e),t=a.toRadians(t),u.fromRadians(e,t,n,r)};var s=new e,E=new e,c=new e,_=new e(1/6378137,1/6378137,1/6356752.314245179),l=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),T=a.EPSILON1;return u.fromCartesian=function(t,r,i){var R=n(r)?r.oneOverRadii:_,f=n(r)?r.oneOverRadiiSquared:l,A=n(r)?r._centerToleranceSquared:T,d=o(t,R,f,A,E);if(n(d)){var h=e.multiplyComponents(d,f,s);h=e.normalize(h,h);var N=e.subtract(t,d,c),I=Math.atan2(h.y,h.x),m=Math.asin(h.z),S=a.sign(e.dot(N,t))*e.magnitude(N);return n(i)?(i.longitude=I,i.latitude=m,i.height=S,i):new u(I,m,S)}},u.clone=function(e,t){if(n(e))return n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},u.ZERO=i(new u(0,0,0)),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,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,i,a,o,u,s){"use strict";function E(t,r,i,a){r=n(r,0),i=n(i,0),a=n(a,0),t._radii=new e(r,i,a),t._radiiSquared=new e(r*r,i*i,a*a),t._radiiToTheFourth=new e(r*r*r*r,i*i*i*i,a*a*a*a),t._oneOverRadii=new e(0===r?0:1/r,0===i?0:1/i,0===a?0:1/a),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===i?0:1/(i*i),0===a?0:1/(a*a)),t._minimumRadius=Math.min(r,i,a),t._maximumRadius=Math.max(r,i,a),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function c(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,E(this,e,t,n)}i(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,n){if(r(t)){var i=t._radii;return r(n)?(e.clone(i,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new c(i.x,i.y,i.z)}},c.fromCartesian3=function(e,t){return r(t)||(t=new c),r(e)?(E(t,e.x,e.y,e.z),t):t},c.WGS84=o(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=o(new c(1,1,1)),c.MOON=o(new c(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),c.prototype.clone=function(e){return c.clone(this,e)},c.packedLength=e.packedLength,c.pack=function(t,r,i){return i=n(i,0),e.pack(t._radii,r,i),r},c.unpack=function(t,r,i){r=n(r,0);var a=e.unpack(t,r);return c.fromCartesian3(a,i)},c.prototype.geocentricSurfaceNormal=e.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(t,n){var i=t.longitude,a=t.latitude,o=Math.cos(a),u=o*Math.cos(i),s=o*Math.sin(i),E=Math.sin(a);return r(n)||(n=new e),n.x=u,n.y=s,n.z=E,e.normalize(n,n)},c.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var _=new e,l=new e;c.prototype.cartographicToCartesian=function(t,n){var i=_,a=l;this.geodeticSurfaceNormalCartographic(t,i),e.multiplyComponents(this._radiiSquared,i,a);var o=Math.sqrt(e.dot(i,a));return e.divideByScalar(a,o,a),e.multiplyByScalar(i,t.height,i),r(n)||(n=new e),e.add(a,i,n)},c.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;i<n;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var T=new e,R=new e,f=new e;return c.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,R);if(r(a)){var o=this.geodeticSurfaceNormal(a,T),s=e.subtract(n,a,f),E=Math.atan2(o.y,o.x),c=Math.asin(o.z),_=u.sign(e.dot(s,n))*e.magnitude(s);return r(i)?(i.longitude=E,i.latitude=c,i.height=_,i):new t(E,c,_)}},c.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;i<n;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t},c.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},c.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var i=t.x,a=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*u.z);return e.multiplyByScalar(t,s,n)},c.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},c.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},c.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},c.prototype.toString=function(){return this._radii.toString()},c.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,i,a){i=n(i,0);var o=this._sqauredXOverSquaredZ;if(r(a)||(a=new e),a.x=0,a.y=0,a.z=t.z*(1-o),!(Math.abs(a.z)>=this._radii.z-i))return a},c}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,i,a,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return i(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var i=this._semimajorAxis,a=t.longitude*i,o=t.latitude*i,u=t.height;return r(n)?(n.x=a,n.y=o,n.z=u,n):new e(a,o,u)},u.prototype.unproject=function(e,n){var i=this._oneOverSemimajorAxis,a=e.x*i,o=e.y*i,u=e.z;return r(n)?(n.longitude=a,n.latitude=o,n.height=u,n):new t(a,o,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";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a,o){"use strict";function u(e,n,r,i,a,o,u,s,E){this[0]=t(e,0),this[1]=t(i,0),this[2]=t(u,0),this[3]=t(n,0),this[4]=t(a,0),this[5]=t(s,0),this[6]=t(r,0),this[7]=t(o,0),this[8]=t(E,0)}function s(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function E(e){for(var t=0,n=0;n<3;++n){var r=e[u.getElementIndex(R[n],T[n])];t+=2*r*r}return Math.sqrt(t)}function c(e,t){for(var n=o.EPSILON15,r=0,i=1,a=0;a<3;++a){var s=Math.abs(e[u.getElementIndex(R[a],T[a])]);s>r&&(i=a,r=s)}var E=1,c=0,_=T[i],l=R[i];if(Math.abs(e[u.getElementIndex(l,_)])>n){var f,A=e[u.getElementIndex(l,l)],d=e[u.getElementIndex(_,_)],h=e[u.getElementIndex(l,_)],N=(A-d)/2/h;f=N<0?-1/(-N+Math.sqrt(1+N*N)):1/(N+Math.sqrt(1+N*N)),E=1/Math.sqrt(1+f*f),c=f*E}return t=u.clone(u.IDENTITY,t),t[u.getElementIndex(_,_)]=t[u.getElementIndex(l,l)]=E,t[u.getElementIndex(l,_)]=c,t[u.getElementIndex(_,l)]=-c,t}u.packedLength=9,u.pack=function(e,n,r){return r=t(r,0),n[r++]=e[0],n[r++]=e[1],n[r++]=e[2],n[r++]=e[3],n[r++]=e[4],n[r++]=e[5],n[r++]=e[6],n[r++]=e[7],n[r++]=e[8],n},u.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new u),i[0]=e[r++],i[1]=e[r++],i[2]=e[r++],i[3]=e[r++],i[4]=e[r++],i[5]=e[r++],i[6]=e[r++],i[7]=e[r++],i[8]=e[r++],i},u.clone=function(e,t){if(n(e))return n(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 u(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},u.fromArray=function(e,r,i){return r=t(r,0),n(i)||(i=new u),i[0]=e[r],i[1]=e[r+1],i[2]=e[r+2],i[3]=e[r+3],i[4]=e[r+4],i[5]=e[r+5],i[6]=e[r+6],i[7]=e[r+7],i[8]=e[r+8],i},u.fromColumnMajorArray=function(e,t){return u.clone(e,t)},u.fromRowMajorArray=function(e,t){return n(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 u(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},u.fromQuaternion=function(e,t){var r=e.x*e.x,i=e.x*e.y,a=e.x*e.z,o=e.x*e.w,s=e.y*e.y,E=e.y*e.z,c=e.y*e.w,_=e.z*e.z,l=e.z*e.w,T=e.w*e.w,R=r-s-_+T,f=2*(i-l),A=2*(a+c),d=2*(i+l),h=-r+s-_+T,N=2*(E-o),I=2*(a-c),m=2*(E+o),S=-r-s+_+T;return n(t)?(t[0]=R,t[1]=d,t[2]=I,t[3]=f,t[4]=h,t[5]=m,t[6]=A,t[7]=N,t[8]=S,t):new u(R,f,A,d,h,N,I,m,S)},u.fromHeadingPitchRoll=function(e,t){var r=Math.cos(-e.pitch),i=Math.cos(-e.heading),a=Math.cos(e.roll),o=Math.sin(-e.pitch),s=Math.sin(-e.heading),E=Math.sin(e.roll),c=r*i,_=-a*s+E*o*i,l=E*s+a*o*i,T=r*s,R=a*i+E*o*s,f=-o*a+a*o*s,A=-o,d=E*r,h=a*r;return n(t)?(t[0]=c,t[1]=T,t[2]=A,t[3]=_,t[4]=R,t[5]=d,t[6]=l,t[7]=f,t[8]=h,t):new u(c,_,l,T,R,f,A,d,h)},u.fromScale=function(e,t){return n(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 u(e.x,0,0,0,e.y,0,0,0,e.z)},u.fromUniformScale=function(e,t){return n(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 u(e,0,0,0,e,0,0,0,e)},u.fromCrossProduct=function(e,t){return n(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 u(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},u.fromRotationX=function(e,t){var r=Math.cos(e),i=Math.sin(e);return n(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=r,t[5]=i,t[6]=0,t[7]=-i,t[8]=r,t):new u(1,0,0,0,r,-i,0,i,r)},u.fromRotationY=function(e,t){var r=Math.cos(e),i=Math.sin(e);return n(t)?(t[0]=r,t[1]=0,t[2]=-i,t[3]=0,t[4]=1,t[5]=0,t[6]=i,t[7]=0,t[8]=r,t):new u(r,0,i,0,1,0,-i,0,r)},u.fromRotationZ=function(e,t){var r=Math.cos(e),i=Math.sin(e);return n(t)?(t[0]=r,t[1]=i,t[2]=0,t[3]=-i,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new u(r,-i,0,i,r,0,0,0,1)},u.toArray=function(e,t){return n(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]]},u.getElementIndex=function(e,t){return 3*e+t},u.getColumn=function(e,t,n){var r=3*t,i=e[r],a=e[r+1],o=e[r+2];return n.x=i,n.y=a,n.z=o,n},u.setColumn=function(e,t,n,r){r=u.clone(e,r);var i=3*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},u.getRow=function(e,t,n){var r=e[t],i=e[t+3],a=e[t+6];return n.x=r,n.y=i,n.z=a,n},u.setRow=function(e,t,n,r){return r=u.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var _=new e;u.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],_)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],_)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],_)),n};var l=new e;u.getMaximumScale=function(t){return u.getScale(t,l),e.maximumComponent(l)},u.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],i=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],o=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],E=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],c=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],_=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=r,n[1]=i,n[2]=a,n[3]=o,n[4]=u,n[5]=s,n[6]=E,n[7]=c,n[8]=_,n},u.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},u.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},u.multiplyByVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[3]*i+e[6]*a,u=e[1]*r+e[4]*i+e[7]*a,s=e[2]*r+e[5]*i+e[8]*a;return n.x=o,n.y=u,n.z=s,n},u.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},u.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},u.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},u.transpose=function(e,t){var n=e[0],r=e[3],i=e[6],a=e[1],o=e[4],u=e[7],s=e[2],E=e[5],c=e[8];return t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=u,t[6]=s,t[7]=E,t[8]=c,t};var T=[1,0,0],R=[2,2,1],f=new u,A=new u;return u.computeEigenDecomposition=function(e,t){var r=o.EPSILON20,i=10,a=0,_=0;n(t)||(t={});for(var l=t.unitary=u.clone(u.IDENTITY,t.unitary),T=t.diagonal=u.clone(e,t.diagonal),R=r*s(T);_<i&&E(T)>R;)c(T,f),u.transpose(f,A),u.multiply(T,f,T),u.multiply(A,T,T),u.multiply(l,f,l),++a>2&&(++_,a=0);return t},u.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},u.determinant=function(e){var t=e[0],n=e[3],r=e[6],i=e[1],a=e[4],o=e[7],u=e[2],s=e[5],E=e[8];return t*(a*E-s*o)+i*(s*r-n*E)+u*(n*o-a*r)},u.inverse=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],E=e[6],c=e[7],_=e[8],l=u.determinant(e);t[0]=o*_-c*s,t[1]=c*i-r*_,t[2]=r*s-o*i,t[3]=E*s-a*_,t[4]=n*_-E*i,t[5]=a*i-n*s,t[6]=a*c-E*o,t[7]=E*r-n*c,t[8]=n*o-a*r;var T=1/l;return u.multiplyByScalar(t,T,t)},u.equals=function(e,t){return e===t||n(e)&&n(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]},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r},u.IDENTITY=a(new u(1,0,0,0,1,0,0,0,1)),u.ZERO=a(new u(0,0,0,0,0,0,0,0,0)),u.COLUMN0ROW0=0,u.COLUMN0ROW1=1,u.COLUMN0ROW2=2,u.COLUMN1ROW0=3,u.COLUMN1ROW1=4,u.COLUMN1ROW2=5,u.COLUMN2ROW0=6,u.COLUMN2ROW1=7,u.COLUMN2ROW2=8,r(u.prototype,{length:{get:function(){return u.packedLength}}}),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},u}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i){"use strict";function a(t,n,r,i){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0),this.w=e(i,0)}a.fromElements=function(e,n,r,i,o){return t(o)?(o.x=e,o.y=n,o.z=r,o.w=i,o):new a(e,n,r,i)},a.fromColor=function(e,n){return t(n)?(n.x=e.red,n.y=e.green,n.z=e.blue,n.w=e.alpha,n):new a(e.red,e.green,e.blue,e.alpha)},a.clone=function(e,n){if(t(e))return t(n)?(n.x=e.x,n.y=e.y,n.z=e.z,n.w=e.w,n):new a(e.x,e.y,e.z,e.w)},a.packedLength=4,a.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w,n},a.unpack=function(n,r,i){return r=e(r,0),t(i)||(i=new a),i.x=n[r++],i.y=n[r++],i.z=n[r++],i.w=n[r],i},a.packArray=function(e,n){var r=e.length;t(n)?n.length=4*r:n=new Array(4*r);for(var i=0;i<r;++i)a.pack(e[i],n,4*i);return n},a.unpackArray=function(e,n){var r=e.length;t(n)?n.length=r/4:n=new Array(r/4);for(var i=0;i<r;i+=4){var o=i/4;n[o]=a.unpack(e,i,n[o])}return n},a.fromArray=a.unpack,a.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},a.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},a.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},a.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},a.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},a.magnitude=function(e){return Math.sqrt(a.magnitudeSquared(e))};var o=new a;a.distance=function(e,t){return a.subtract(e,t,o),a.magnitude(o)},a.distanceSquared=function(e,t){return a.subtract(e,t,o),a.magnitudeSquared(o)},a.normalize=function(e,t){var n=a.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t},a.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},a.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},a.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},a.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},a.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},a.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},a.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},a.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,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.w=Math.abs(e.w),t};var u=new a;a.lerp=function(e,t,n,r){return a.multiplyByScalar(t,n,u),r=a.multiplyByScalar(e,1-n,r),a.add(u,r,r)};var s=new a;return a.mostOrthogonalAxis=function(e,t){var n=a.normalize(e,s);return a.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?a.clone(a.UNIT_X,t):a.clone(a.UNIT_W,t):n.z<=n.w?a.clone(a.UNIT_Z,t):a.clone(a.UNIT_W,t):n.y<=n.z?n.y<=n.w?a.clone(a.UNIT_Y,t):a.clone(a.UNIT_W,t):n.z<=n.w?a.clone(a.UNIT_Z,t):a.clone(a.UNIT_W,t)},a.equals=function(e,n){return e===n||t(e)&&t(n)&&e.x===n.x&&e.y===n.y&&e.z===n.z&&e.w===n.w},a.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},a.equalsEpsilon=function(e,n,r,a){return e===n||t(e)&&t(n)&&i.equalsEpsilon(e.x,n.x,r,a)&&i.equalsEpsilon(e.y,n.y,r,a)&&i.equalsEpsilon(e.z,n.z,r,a)&&i.equalsEpsilon(e.w,n.w,r,a)},a.ZERO=r(new a(0,0,0,0)),a.UNIT_X=r(new a(1,0,0,0)),a.UNIT_Y=r(new a(0,1,0,0)),a.UNIT_Z=r(new a(0,0,1,0)),a.UNIT_W=r(new a(0,0,0,1)),a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,n){return a.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},a}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,i,a,o,u,s,E){"use strict";function c(e,t,r,i,a,o,u,s,E,c,_,l,T,R,f,A){this[0]=n(e,0),this[1]=n(a,0),this[2]=n(E,0),this[3]=n(T,0),this[4]=n(t,0), -this[5]=n(o,0),this[6]=n(c,0),this[7]=n(R,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(_,0),this[11]=n(f,0),this[12]=n(i,0),this[13]=n(s,0),this[14]=n(l,0),this[15]=n(A,0)}c.packedLength=16,c.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t[r++]=e[9],t[r++]=e[10],t[r++]=e[11],t[r++]=e[12],t[r++]=e[13],t[r++]=e[14],t[r]=e[15],t},c.unpack=function(e,t,i){return t=n(t,0),r(i)||(i=new c),i[0]=e[t++],i[1]=e[t++],i[2]=e[t++],i[3]=e[t++],i[4]=e[t++],i[5]=e[t++],i[6]=e[t++],i[7]=e[t++],i[8]=e[t++],i[9]=e[t++],i[10]=e[t++],i[11]=e[t++],i[12]=e[t++],i[13]=e[t++],i[14]=e[t++],i[15]=e[t],i},c.clone=function(e,t){if(r(e))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):new c(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])},c.fromArray=c.unpack,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[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 c(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])},c.fromRotationTranslation=function(t,i,a){return i=n(i,e.ZERO),r(a)?(a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=0,a[4]=t[3],a[5]=t[4],a[6]=t[5],a[7]=0,a[8]=t[6],a[9]=t[7],a[10]=t[8],a[11]=0,a[12]=i.x,a[13]=i.y,a[14]=i.z,a[15]=1,a):new c(t[0],t[3],t[6],i.x,t[1],t[4],t[7],i.y,t[2],t[5],t[8],i.z,0,0,0,1)},c.fromTranslationQuaternionRotationScale=function(e,t,n,i){r(i)||(i=new c);var a=n.x,o=n.y,u=n.z,s=t.x*t.x,E=t.x*t.y,_=t.x*t.z,l=t.x*t.w,T=t.y*t.y,R=t.y*t.z,f=t.y*t.w,A=t.z*t.z,d=t.z*t.w,h=t.w*t.w,N=s-T-A+h,I=2*(E-d),m=2*(_+f),S=2*(E+d),y=-s+T-A+h,M=2*(R-l),O=2*(_-f),p=2*(R+l),C=-s-T+A+h;return i[0]=N*a,i[1]=S*a,i[2]=O*a,i[3]=0,i[4]=I*o,i[5]=y*o,i[6]=p*o,i[7]=0,i[8]=m*u,i[9]=M*u,i[10]=C*u,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i},c.fromTranslationRotationScale=function(e,t){return c.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},c.fromTranslation=function(e,t){return c.fromRotationTranslation(s.IDENTITY,e,t)},c.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 c(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},c.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 c(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var _=new e,l=new e,T=new e;c.fromCamera=function(t,n){var i=t.position,a=t.direction,o=t.up;e.normalize(a,_),e.normalize(e.cross(_,o,l),l),e.normalize(e.cross(l,_,T),T);var u=l.x,s=l.y,E=l.z,R=_.x,f=_.y,A=_.z,d=T.x,h=T.y,N=T.z,I=i.x,m=i.y,S=i.z,y=u*-I+s*-m+E*-S,M=d*-I+h*-m+N*-S,O=R*I+f*m+A*S;return r(n)?(n[0]=u,n[1]=d,n[2]=-R,n[3]=0,n[4]=s,n[5]=h,n[6]=-f,n[7]=0,n[8]=E,n[9]=N,n[10]=-A,n[11]=0,n[12]=y,n[13]=M,n[14]=O,n[15]=1,n):new c(u,s,E,y,d,h,N,M,-R,-f,-A,O,0,0,0,1)},c.computePerspectiveFieldOfView=function(e,t,n,r,i){var a=Math.tan(.5*e),o=1/a,u=o/t,s=(r+n)/(n-r),E=2*r*n/(n-r);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=o,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=s,i[11]=-1,i[12]=0,i[13]=0,i[14]=E,i[15]=0,i},c.computeOrthographicOffCenter=function(e,t,n,r,i,a,o){var u=1/(t-e),s=1/(r-n),E=1/(a-i),c=-(t+e)*u,_=-(r+n)*s,l=-(a+i)*E;return u*=2,s*=2,E*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=E,o[11]=0,o[12]=c,o[13]=_,o[14]=l,o[15]=1,o},c.computePerspectiveOffCenter=function(e,t,n,r,i,a,o){var u=2*i/(t-e),s=2*i/(r-n),E=(t+e)/(t-e),c=(r+n)/(r-n),_=-(a+i)/(a-i),l=-1,T=-2*a*i/(a-i);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=E,o[9]=c,o[10]=_,o[11]=l,o[12]=0,o[13]=0,o[14]=T,o[15]=0,o},c.computeInfinitePerspectiveOffCenter=function(e,t,n,r,i,a){var o=2*i/(t-e),u=2*i/(r-n),s=(t+e)/(t-e),E=(r+n)/(r-n),c=-1,_=-1,l=-2*i;return a[0]=o,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]=E,a[10]=c,a[11]=_,a[12]=0,a[13]=0,a[14]=l,a[15]=0,a},c.computeViewportTransformation=function(e,t,r,i){e=n(e,n.EMPTY_OBJECT);var a=n(e.x,0),o=n(e.y,0),u=n(e.width,0),s=n(e.height,0);t=n(t,0),r=n(r,1);var E=.5*u,c=.5*s,_=.5*(r-t),l=E,T=c,R=_,f=a+E,A=o+c,d=t+_,h=1;return i[0]=l,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=T,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=R,i[11]=0,i[12]=f,i[13]=A,i[14]=d,i[15]=h,i},c.computeView=function(t,n,r,i,a){return a[0]=i.x,a[1]=r.x,a[2]=-n.x,a[3]=0,a[4]=i.y,a[5]=r.y,a[6]=-n.y,a[7]=0,a[8]=i.z,a[9]=r.z,a[10]=-n.z,a[11]=0,a[12]=-e.dot(i,t),a[13]=-e.dot(r,t),a[14]=e.dot(n,t),a[15]=1,a},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[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]]},c.getElementIndex=function(e,t){return 4*e+t},c.getColumn=function(e,t,n){var r=4*t,i=e[r],a=e[r+1],o=e[r+2],u=e[r+3];return n.x=i,n.y=a,n.z=o,n.w=u,n},c.setColumn=function(e,t,n,r){r=c.clone(e,r);var i=4*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r[i+3]=n.w,r},c.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},c.getRow=function(e,t,n){var r=e[t],i=e[t+4],a=e[t+8],o=e[t+12];return n.x=r,n.y=i,n.z=a,n.w=o,n},c.setRow=function(e,t,n,r){return r=c.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var R=new e;c.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],R)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],R)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],R)),n};var f=new e;c.getMaximumScale=function(t){return c.getScale(t,f),e.maximumComponent(f)},c.multiply=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[3],u=e[4],s=e[5],E=e[6],c=e[7],_=e[8],l=e[9],T=e[10],R=e[11],f=e[12],A=e[13],d=e[14],h=e[15],N=t[0],I=t[1],m=t[2],S=t[3],y=t[4],M=t[5],O=t[6],p=t[7],C=t[8],U=t[9],g=t[10],L=t[11],x=t[12],w=t[13],v=t[14],P=t[15],F=r*N+u*I+_*m+f*S,B=i*N+s*I+l*m+A*S,D=a*N+E*I+T*m+d*S,z=o*N+c*I+R*m+h*S,G=r*y+u*M+_*O+f*p,b=i*y+s*M+l*O+A*p,V=a*y+E*M+T*O+d*p,X=o*y+c*M+R*O+h*p,H=r*C+u*U+_*g+f*L,W=i*C+s*U+l*g+A*L,q=a*C+E*U+T*g+d*L,Y=o*C+c*U+R*g+h*L,k=r*x+u*w+_*v+f*P,K=i*x+s*w+l*v+A*P,j=a*x+E*w+T*v+d*P,Z=o*x+c*w+R*v+h*P;return n[0]=F,n[1]=B,n[2]=D,n[3]=z,n[4]=G,n[5]=b,n[6]=V,n[7]=X,n[8]=H,n[9]=W,n[10]=q,n[11]=Y,n[12]=k,n[13]=K,n[14]=j,n[15]=Z,n},c.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},c.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},c.multiplyTransformation=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[4],u=e[5],s=e[6],E=e[8],c=e[9],_=e[10],l=e[12],T=e[13],R=e[14],f=t[0],A=t[1],d=t[2],h=t[4],N=t[5],I=t[6],m=t[8],S=t[9],y=t[10],M=t[12],O=t[13],p=t[14],C=r*f+o*A+E*d,U=i*f+u*A+c*d,g=a*f+s*A+_*d,L=r*h+o*N+E*I,x=i*h+u*N+c*I,w=a*h+s*N+_*I,v=r*m+o*S+E*y,P=i*m+u*S+c*y,F=a*m+s*S+_*y,B=r*M+o*O+E*p+l,D=i*M+u*O+c*p+T,z=a*M+s*O+_*p+R;return n[0]=C,n[1]=U,n[2]=g,n[3]=0,n[4]=L,n[5]=x,n[6]=w,n[7]=0,n[8]=v,n[9]=P,n[10]=F,n[11]=0,n[12]=B,n[13]=D,n[14]=z,n[15]=1,n},c.multiplyByMatrix3=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[4],u=e[5],s=e[6],E=e[8],c=e[9],_=e[10],l=t[0],T=t[1],R=t[2],f=t[3],A=t[4],d=t[5],h=t[6],N=t[7],I=t[8],m=r*l+o*T+E*R,S=i*l+u*T+c*R,y=a*l+s*T+_*R,M=r*f+o*A+E*d,O=i*f+u*A+c*d,p=a*f+s*A+_*d,C=r*h+o*N+E*I,U=i*h+u*N+c*I,g=a*h+s*N+_*I;return n[0]=m,n[1]=S,n[2]=y,n[3]=0,n[4]=M,n[5]=O,n[6]=p,n[7]=0,n[8]=C,n[9]=U,n[10]=g,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},c.multiplyByTranslation=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=r*e[0]+i*e[4]+a*e[8]+e[12],u=r*e[1]+i*e[5]+a*e[9]+e[13],s=r*e[2]+i*e[6]+a*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=s,n[15]=e[15],n};var A=new e;c.multiplyByUniformScale=function(e,t,n){return A.x=t,A.y=t,A.z=t,c.multiplyByScale(e,A,n)},c.multiplyByScale=function(e,t,n){var r=t.x,i=t.y,a=t.z;return 1===r&&1===i&&1===a?c.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=i*e[4],n[5]=i*e[5],n[6]=i*e[6],n[7]=0,n[8]=a*e[8],n[9]=a*e[9],n[10]=a*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},c.multiplyByVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=t.w,u=e[0]*r+e[4]*i+e[8]*a+e[12]*o,s=e[1]*r+e[5]*i+e[9]*a+e[13]*o,E=e[2]*r+e[6]*i+e[10]*a+e[14]*o,c=e[3]*r+e[7]*i+e[11]*a+e[15]*o;return n.x=u,n.y=s,n.z=E,n.w=c,n},c.multiplyByPointAsVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[4]*i+e[8]*a,u=e[1]*r+e[5]*i+e[9]*a,s=e[2]*r+e[6]*i+e[10]*a;return n.x=o,n.y=u,n.z=s,n},c.multiplyByPoint=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[4]*i+e[8]*a+e[12],u=e[1]*r+e[5]*i+e[9]*a+e[13],s=e[2]*r+e[6]*i+e[10]*a+e[14];return n.x=o,n.y=u,n.z=s,n},c.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},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[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},c.transpose=function(e,t){var n=e[1],r=e[2],i=e[3],a=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=a,t[10]=e[10],t[11]=e[14],t[12]=i,t[13]=o,t[14]=u,t[15]=e[15],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[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},c.equals=function(e,t){return e===t||r(e)&&r(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},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&&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},c.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},c.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};var d=new s,h=new s,N=new t,I=new t(0,0,0,1);return c.inverse=function(e,n){if(s.equalsEpsilon(c.getRotation(e,d),h,u.EPSILON7)&&t.equals(c.getRow(e,3,N),I))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],i=e[4],a=e[8],o=e[12],_=e[1],l=e[5],T=e[9],R=e[13],f=e[2],A=e[6],m=e[10],S=e[14],y=e[3],M=e[7],O=e[11],p=e[15],C=m*p,U=S*O,g=A*p,L=S*M,x=A*O,w=m*M,v=f*p,P=S*y,F=f*O,B=m*y,D=f*M,z=A*y,G=C*l+L*T+x*R-(U*l+g*T+w*R),b=U*_+v*T+B*R-(C*_+P*T+F*R),V=g*_+P*l+D*R-(L*_+v*l+z*R),X=w*_+F*l+z*T-(x*_+B*l+D*T),H=U*i+g*a+w*o-(C*i+L*a+x*o),W=C*r+P*a+F*o-(U*r+v*a+B*o),q=L*r+v*i+z*o-(g*r+P*i+D*o),Y=x*r+B*i+D*a-(w*r+F*i+z*a);C=a*R,U=o*T,g=i*R,L=o*l,x=i*T,w=a*l,v=r*R,P=o*_,F=r*T,B=a*_,D=r*l,z=i*_;var k=C*M+L*O+x*p-(U*M+g*O+w*p),K=U*y+v*O+B*p-(C*y+P*O+F*p),j=g*y+P*M+D*p-(L*y+v*M+z*p),Z=w*y+F*M+z*O-(x*y+B*M+D*O),Q=g*m+w*S+U*A-(x*S+C*A+L*m),J=F*S+C*f+P*m-(v*m+B*S+U*f),$=v*A+z*S+L*f-(D*S+g*f+P*A),ee=D*m+x*f+B*A-(F*A+z*m+w*f),te=r*G+i*b+a*V+o*X;if(Math.abs(te)<u.EPSILON20)throw new E("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=G*te,n[1]=b*te,n[2]=V*te,n[3]=X*te,n[4]=H*te,n[5]=W*te,n[6]=q*te,n[7]=Y*te,n[8]=k*te,n[9]=K*te,n[10]=j*te,n[11]=Z*te,n[12]=Q*te,n[13]=J*te,n[14]=$*te,n[15]=ee*te,n},c.inverseTransformation=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[4],o=e[5],u=e[6],s=e[8],E=e[9],c=e[10],_=e[12],l=e[13],T=e[14],R=-n*_-r*l-i*T,f=-a*_-o*l-u*T,A=-s*_-E*l-c*T;return t[0]=n,t[1]=a,t[2]=s,t[3]=0,t[4]=r,t[5]=o,t[6]=E,t[7]=0,t[8]=i,t[9]=u,t[10]=c,t[11]=0,t[12]=R,t[13]=f,t[14]=A,t[15]=1,t},c.IDENTITY=o(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),c.ZERO=o(new c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN0ROW3=3,c.COLUMN1ROW0=4,c.COLUMN1ROW1=5,c.COLUMN1ROW2=6,c.COLUMN1ROW3=7,c.COLUMN2ROW0=8,c.COLUMN2ROW1=9,c.COLUMN2ROW2=10,c.COLUMN2ROW3=11,c.COLUMN3ROW0=12,c.COLUMN3ROW1=13,c.COLUMN3ROW2=14,c.COLUMN3ROW3=15,i(c.prototype,{length:{get:function(){return c.packedLength}}}),c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.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]+")"},c}),define("Core/Rectangle",["./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,i,a,o,u){"use strict";function s(e,n,r,i){this.west=t(e,0),this.south=t(n,0),this.east=t(r,0),this.north=t(i,0)}r(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,n,r){return r=t(r,0),n[r++]=e.west,n[r++]=e.south,n[r++]=e.east,n[r]=e.north,n},s.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new s),i.west=e[r++],i.south=e[r++],i.east=e[r++],i.north=e[r],i},s.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=u.TWO_PI),t-n},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,r,i,a,o){return e=u.toRadians(t(e,0)),r=u.toRadians(t(r,0)),i=u.toRadians(t(i,0)),a=u.toRadians(t(a,0)),n(o)?(o.west=e,o.south=r,o.east=i,o.north=a,o):new s(e,r,i,a)},s.fromCartographicArray=function(e,t){for(var r=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,E=Number.MAX_VALUE,c=-Number.MAX_VALUE,_=0,l=e.length;_<l;_++){var T=e[_];r=Math.min(r,T.longitude),i=Math.max(i,T.longitude),E=Math.min(E,T.latitude),c=Math.max(c,T.latitude);var R=T.longitude>=0?T.longitude:T.longitude+u.TWO_PI;a=Math.min(a,R),o=Math.max(o,R)}return i-r>o-a&&(r=a,i=o,i>u.PI&&(i-=u.TWO_PI),r>u.PI&&(r-=u.TWO_PI)),n(t)?(t.west=r,t.south=E,t.east=i,t.north=c,t):new s(r,E,i,c)},s.fromCartesianArray=function(e,t,r){for(var i=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,E=-Number.MAX_VALUE,c=Number.MAX_VALUE,_=-Number.MAX_VALUE,l=0,T=e.length;l<T;l++){var R=t.cartesianToCartographic(e[l]);i=Math.min(i,R.longitude),a=Math.max(a,R.longitude),c=Math.min(c,R.latitude),_=Math.max(_,R.latitude);var f=R.longitude>=0?R.longitude:R.longitude+u.TWO_PI;o=Math.min(o,f),E=Math.max(E,f)}return a-i>E-o&&(i=o,a=E,a>u.PI&&(a-=u.TWO_PI),i>u.PI&&(i-=u.TWO_PI)),n(r)?(r.west=i,r.south=c,r.east=a,r.north=_,r):new s(i,c,a,_)},s.clone=function(e,t){if(n(e))return n(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,t){return e===t||n(e)&&n(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},s.prototype.equalsEpsilon=function(e,t){return n(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},s.validate=function(e){},s.southwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.south,r.height=0,r):new e(t.west,t.south)},s.northwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.north,r.height=0,r):new e(t.west,t.north)},s.northeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.north,r.height=0,r):new e(t.east,t.north)},s.southeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.south,r.height=0,r):new e(t.east,t.south)},s.center=function(t,r){var i=t.east,a=t.west;i<a&&(i+=u.TWO_PI);var o=u.negativePiToPi(.5*(a+i)),s=.5*(t.south+t.north);return n(r)?(r.longitude=o,r.latitude=s,r.height=0,r):new e(o,s)},s.intersection=function(e,t,r){var i=e.east,a=e.west,o=t.east,E=t.west;i<a&&o>0?i+=u.TWO_PI:o<E&&i>0&&(o+=u.TWO_PI),i<a&&E<0?E+=u.TWO_PI:o<E&&a<0&&(a+=u.TWO_PI);var c=u.negativePiToPi(Math.max(a,E)),_=u.negativePiToPi(Math.min(i,o));if(!((e.west<e.east||t.west<t.east)&&_<=c)){var l=Math.max(e.south,t.south),T=Math.min(e.north,t.north);if(!(l>=T))return n(r)?(r.west=c,r.south=l,r.east=_,r.north=T,r):new s(c,l,_,T)}},s.simpleIntersection=function(e,t,r){var i=Math.max(e.west,t.west),a=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(a>=u||i>=o))return n(r)?(r.west=i,r.south=a,r.east=o,r.north=u,r):new s(i,a,o,u)},s.union=function(e,t,r){n(r)||(r=new s);var i=e.east,a=e.west,o=t.east,E=t.west;i<a&&o>0?i+=u.TWO_PI:o<E&&i>0&&(o+=u.TWO_PI),i<a&&E<0?E+=u.TWO_PI:o<E&&a<0&&(a+=u.TWO_PI);var c=u.convertLongitudeRange(Math.min(a,E)),_=u.convertLongitudeRange(Math.max(i,o));return r.west=c,r.south=Math.min(e.south,t.south),r.east=_,r.north=Math.max(e.north,t.north),r},s.expand=function(e,t,r){return n(r)||(r=new s),r.west=Math.min(e.west,t.longitude),r.south=Math.min(e.south,t.latitude),r.east=Math.max(e.east,t.longitude),r.north=Math.max(e.north,t.latitude),r},s.contains=function(e,t){var n=t.longitude,r=t.latitude,i=e.west,a=e.east;return a<i&&(a+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>i||u.equalsEpsilon(n,i,u.EPSILON14))&&(n<a||u.equalsEpsilon(n,a,u.EPSILON14))&&r>=e.south&&r<=e.north};var E=new e;return s.subsample=function(e,r,i,o){r=t(r,a.WGS84),i=t(i,0),n(o)||(o=[]);var c=0,_=e.north,l=e.south,T=e.east,R=e.west,f=E;f.height=i,f.longitude=R,f.latitude=_,o[c]=r.cartographicToCartesian(f,o[c]),c++,f.longitude=T,o[c]=r.cartographicToCartesian(f,o[c]),c++,f.latitude=l,o[c]=r.cartographicToCartesian(f,o[c]),c++,f.longitude=R,o[c]=r.cartographicToCartesian(f,o[c]),c++,_<0?f.latitude=_:l>0?f.latitude=l:f.latitude=0;for(var A=1;A<8;++A)f.longitude=-Math.PI+A*u.PI_OVER_TWO,s.contains(e,f)&&(o[c]=r.cartographicToCartesian(f,o[c]),c++);return 0===f.latitude&&(f.longitude=R,o[c]=r.cartographicToCartesian(f,o[c]),c++,f.longitude=T,o[c]=r.cartographicToCartesian(f,o[c]),c++),o.length=c,o},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,i,a,o,u,s,E,c,_){"use strict";function l(t,r){this.center=e.clone(n(t,e.ZERO)),this.radius=n(r,0)}var T=new e,R=new e,f=new e,A=new e,d=new e,h=new e,N=new e,I=new e,m=new e,S=new e,y=new e,M=new e;l.fromPoints=function(t,n){if(r(n)||(n=new l),!r(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var i=e.clone(t[0],N),a=e.clone(i,T),o=e.clone(i,R),u=e.clone(i,f),s=e.clone(i,A),E=e.clone(i,d),c=e.clone(i,h),_=t.length,O=1;O<_;O++){e.clone(t[O],i);var p=i.x,C=i.y,U=i.z;p<a.x&&e.clone(i,a),p>s.x&&e.clone(i,s),C<o.y&&e.clone(i,o),C>E.y&&e.clone(i,E),U<u.z&&e.clone(i,u),U>c.z&&e.clone(i,c)}var g=e.magnitudeSquared(e.subtract(s,a,I)),L=e.magnitudeSquared(e.subtract(E,o,I)),x=e.magnitudeSquared(e.subtract(c,u,I)),w=a,v=s,P=g;L>P&&(P=L,w=o,v=E),x>P&&(P=x,w=u,v=c);var F=m;F.x=.5*(w.x+v.x),F.y=.5*(w.y+v.y),F.z=.5*(w.z+v.z);var B=e.magnitudeSquared(e.subtract(v,F,I)),D=Math.sqrt(B),z=S;z.x=a.x,z.y=o.y,z.z=u.z;var G=y;G.x=s.x,G.y=E.y,G.z=c.z;var b=e.multiplyByScalar(e.add(z,G,I),.5,M),V=0;for(O=0;O<_;O++){e.clone(t[O],i);var X=e.magnitude(e.subtract(i,b,I));X>V&&(V=X);var H=e.magnitudeSquared(e.subtract(i,F,I));if(H>B){var W=Math.sqrt(H);D=.5*(D+W),B=D*D;var q=W-D;F.x=(D*F.x+q*i.x)/W,F.y=(D*F.y+q*i.y)/W,F.z=(D*F.z+q*i.z)/W}}return D<V?(e.clone(F,n.center),n.radius=D):(e.clone(b,n.center),n.radius=V),n};var O=new o,p=new e,C=new e,U=new t,g=new t;l.fromRectangle2D=function(e,t,n){return l.fromRectangleWithHeights2D(e,t,0,0,n)},l.fromRectangleWithHeights2D=function(t,i,a,o,u){if(r(u)||(u=new l),!r(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;i=n(i,O),_.southwest(t,U),U.height=a,_.northeast(t,g),g.height=o;var s=i.project(U,p),E=i.project(g,C),c=E.x-s.x,T=E.y-s.y,R=E.z-s.z;u.radius=.5*Math.sqrt(c*c+T*T+R*R);var f=u.center;return f.x=s.x+.5*c,f.y=s.y+.5*T,f.z=s.z+.5*R,u};var L=[];l.fromRectangle3D=function(e,t,i,o){t=n(t,a.WGS84),i=n(i,0);var u;return r(e)&&(u=_.subsample(e,t,i,L)),l.fromPoints(u,o)},l.fromVertices=function(t,i,a,o){if(r(o)||(o=new l),!r(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;i=n(i,e.ZERO),a=n(a,3);var u=N;u.x=t[0]+i.x,u.y=t[1]+i.y,u.z=t[2]+i.z;for(var s=e.clone(u,T),E=e.clone(u,R),c=e.clone(u,f),_=e.clone(u,A),O=e.clone(u,d),p=e.clone(u,h),C=t.length,U=0;U<C;U+=a){var g=t[U]+i.x,L=t[U+1]+i.y,x=t[U+2]+i.z;u.x=g,u.y=L,u.z=x,g<s.x&&e.clone(u,s),g>_.x&&e.clone(u,_),L<E.y&&e.clone(u,E),L>O.y&&e.clone(u,O),x<c.z&&e.clone(u,c),x>p.z&&e.clone(u,p)}var w=e.magnitudeSquared(e.subtract(_,s,I)),v=e.magnitudeSquared(e.subtract(O,E,I)),P=e.magnitudeSquared(e.subtract(p,c,I)),F=s,B=_,D=w;v>D&&(D=v,F=E,B=O),P>D&&(D=P,F=c,B=p);var z=m;z.x=.5*(F.x+B.x),z.y=.5*(F.y+B.y),z.z=.5*(F.z+B.z);var G=e.magnitudeSquared(e.subtract(B,z,I)),b=Math.sqrt(G),V=S;V.x=s.x,V.y=E.y,V.z=c.z;var X=y;X.x=_.x,X.y=O.y,X.z=p.z;var H=e.multiplyByScalar(e.add(V,X,I),.5,M),W=0;for(U=0;U<C;U+=a){u.x=t[U]+i.x,u.y=t[U+1]+i.y,u.z=t[U+2]+i.z;var q=e.magnitude(e.subtract(u,H,I));q>W&&(W=q);var Y=e.magnitudeSquared(e.subtract(u,z,I));if(Y>G){var k=Math.sqrt(Y);b=.5*(b+k),G=b*b;var K=k-b;z.x=(b*z.x+K*u.x)/k,z.y=(b*z.y+K*u.y)/k,z.z=(b*z.z+K*u.z)/k}}return b<W?(e.clone(z,o.center),o.radius=b):(e.clone(H,o.center),o.radius=W),o},l.fromEncodedCartesianVertices=function(t,n,i){if(r(i)||(i=new l),!r(t)||!r(n)||t.length!==n.length||0===t.length)return i.center=e.clone(e.ZERO,i.center),i.radius=0,i;var a=N;a.x=t[0]+n[0],a.y=t[1]+n[1],a.z=t[2]+n[2];for(var o=e.clone(a,T),u=e.clone(a,R),s=e.clone(a,f),E=e.clone(a,A),c=e.clone(a,d),_=e.clone(a,h),O=t.length,p=0;p<O;p+=3){var C=t[p]+n[p],U=t[p+1]+n[p+1],g=t[p+2]+n[p+2];a.x=C,a.y=U,a.z=g,C<o.x&&e.clone(a,o),C>E.x&&e.clone(a,E),U<u.y&&e.clone(a,u),U>c.y&&e.clone(a,c),g<s.z&&e.clone(a,s),g>_.z&&e.clone(a,_)}var L=e.magnitudeSquared(e.subtract(E,o,I)),x=e.magnitudeSquared(e.subtract(c,u,I)),w=e.magnitudeSquared(e.subtract(_,s,I)),v=o,P=E,F=L;x>F&&(F=x,v=u,P=c),w>F&&(F=w,v=s,P=_);var B=m;B.x=.5*(v.x+P.x),B.y=.5*(v.y+P.y),B.z=.5*(v.z+P.z);var D=e.magnitudeSquared(e.subtract(P,B,I)),z=Math.sqrt(D),G=S;G.x=o.x,G.y=u.y,G.z=s.z;var b=y;b.x=E.x,b.y=c.y,b.z=_.z;var V=e.multiplyByScalar(e.add(G,b,I),.5,M),X=0;for(p=0;p<O;p+=3){a.x=t[p]+n[p],a.y=t[p+1]+n[p+1],a.z=t[p+2]+n[p+2];var H=e.magnitude(e.subtract(a,V,I));H>X&&(X=H);var W=e.magnitudeSquared(e.subtract(a,B,I));if(W>D){var q=Math.sqrt(W);z=.5*(z+q),D=z*z;var Y=q-z;B.x=(z*B.x+Y*a.x)/q,B.y=(z*B.y+Y*a.y)/q,B.z=(z*B.z+Y*a.z)/q}}return z<X?(e.clone(B,i.center),i.radius=z):(e.clone(V,i.center),i.radius=X),i},l.fromCornerPoints=function(t,n,i){r(i)||(i=new l);var a=i.center;return e.add(t,n,a),e.multiplyByScalar(a,.5,a),i.radius=e.distance(a,n),i},l.fromEllipsoid=function(t,n){return r(n)||(n=new l),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var x=new e;l.fromBoundingSpheres=function(t,n){if(r(n)||(n=new l),!r(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var i=t.length;if(1===i)return l.clone(t[0],n);if(2===i)return l.union(t[0],t[1],n);for(var a=[],o=0;o<i;o++)a.push(t[o].center);n=l.fromPoints(a,n);var u=n.center,s=n.radius;for(o=0;o<i;o++){var E=t[o];s=Math.max(s,e.distance(u,E.center,x)+E.radius)}return n.radius=s,n};var w=new e,v=new e,P=new e;l.fromOrientedBoundingBox=function(t,n){r(n)||(n=new l);var i=t.halfAxes,a=E.getColumn(i,0,w),o=E.getColumn(i,1,v),u=E.getColumn(i,2,P),s=e.magnitude(a),c=e.magnitude(o),_=e.magnitude(u);return n.center=e.clone(t.center,n.center),n.radius=Math.max(s,c,_),n},l.clone=function(t,n){if(r(t))return r(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new l(t.center,t.radius)},l.packedLength=4,l.pack=function(e,t,r){r=n(r,0);var i=e.center;return t[r++]=i.x,t[r++]=i.y,t[r++]=i.z,t[r]=e.radius,t},l.unpack=function(e,t,i){t=n(t,0),r(i)||(i=new l);var a=i.center;return a.x=e[t++],a.y=e[t++],a.z=e[t++],i.radius=e[t],i};var F=new e,B=new e;l.union=function(t,n,i){r(i)||(i=new l);var a=t.center,o=t.radius,u=n.center,s=n.radius,E=e.subtract(u,a,F),c=e.magnitude(E);if(o>=c+s)return t.clone(i),i;if(s>=c+o)return n.clone(i),i;var _=.5*(o+c+s),T=e.multiplyByScalar(E,(-o+_)/c,B);return e.add(T,a,T),e.clone(T,i.center),i.radius=_,i};var D=new e;l.expand=function(t,n,r){r=l.clone(t,r);var i=e.magnitude(e.subtract(n,r.center,D));return i>r.radius&&(r.radius=i),r},l.intersectPlane=function(t,n){var r=t.center,i=t.radius,a=n.normal,o=e.dot(a,r)+n.distance;return o<-i?u.OUTSIDE:o<i?u.INTERSECTING:u.INSIDE},l.transform=function(e,t,n){return r(n)||(n=new l),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=c.getMaximumScale(t)*e.radius,n};var z=new e;l.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,z);return e.magnitudeSquared(r)-t.radius*t.radius},l.transformWithoutScale=function(e,t,n){return r(n)||(n=new l),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var G=new e;l.computePlaneDistances=function(t,n,i,a){r(a)||(a=new s);var o=e.subtract(t.center,n,G),u=e.dot(i,o);return a.start=u-t.radius,a.stop=u+t.radius,a};for(var b=new e,V=new e,X=new e,H=new e,W=new e,q=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var K=new o;return l.projectTo2D=function(t,r,i){r=n(r,K);var a=r.ellipsoid,o=t.center,u=t.radius,s=a.geodeticSurfaceNormal(o,b),E=e.cross(e.UNIT_Z,s,V);e.normalize(E,E);var c=e.cross(s,E,X);e.normalize(c,c),e.multiplyByScalar(s,u,s),e.multiplyByScalar(c,u,c),e.multiplyByScalar(E,u,E);var _=e.negate(c,W),T=e.negate(E,H),R=Y,f=R[0];e.add(s,c,f),e.add(f,E,f),f=R[1],e.add(s,c,f),e.add(f,T,f),f=R[2],e.add(s,_,f),e.add(f,T,f),f=R[3],e.add(s,_,f),e.add(f,E,f),e.negate(s,s),f=R[4],e.add(s,c,f),e.add(f,E,f),f=R[5],e.add(s,c,f),e.add(f,T,f),f=R[6],e.add(s,_,f),e.add(f,T,f),f=R[7],e.add(s,_,f),e.add(f,E,f);for(var A=R.length,d=0;d<A;++d){var h=R[d];e.add(o,h,h);var N=a.cartesianToCartographic(h,q);r.project(N,h)}i=l.fromPoints(R,i),o=i.center;var I=o.x,m=o.y,S=o.z;return o.x=S,o.y=I,o.z=m,i},l.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},l.equals=function(t,n){return t===n||r(t)&&r(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},l.prototype.intersectPlane=function(e){return l.intersectPlane(this,e)},l.prototype.distanceSquaredTo=function(e){return l.distanceSquaredTo(this,e)},l.prototype.computePlaneDistances=function(e,t,n){return l.computePlaneDistances(this,e,t,n)},l.prototype.isOccluded=function(e){return l.isOccluded(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.prototype.clone=function(e){return l.clone(this,e)},l}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},i={};return t(i,{element:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(i.supportsFullscreen())return null!==i.element}}}),i.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var i,a=["webkit","moz","o","ms","khtml"],o=0,u=a.length;o<u;++o){var s=a[o];i=s+"RequestFullscreen","function"==typeof t[i]?(r.requestFullscreen=i,n=!0):(i=s+"RequestFullScreen","function"==typeof t[i]&&(r.requestFullscreen=i,n=!0)),i=s+"ExitFullscreen","function"==typeof document[i]?r.exitFullscreen=i:(i=s+"CancelFullScreen","function"==typeof document[i]&&(r.exitFullscreen=i)),i=s+"FullscreenEnabled",void 0!==document[i]?r.fullscreenEnabled=i:(i=s+"FullScreenEnabled",void 0!==document[i]&&(r.fullscreenEnabled=i)),i=s+"FullscreenElement",void 0!==document[i]?r.fullscreenElement=i:(i=s+"FullScreenElement",void 0!==document[i]&&(r.fullscreenElement=i)),i=s+"fullscreenchange",void 0!==document["on"+i]&&("ms"===s&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=s+"fullscreenerror",void 0!==document["on"+i]&&("ms"===s&&(i="MSFullscreenError"),r.fullscreenerror=i)}return n},i.requestFullscreen=function(e,t){i.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},i.exitFullscreen=function(){i.supportsFullscreen()&&document[r.exitFullscreen]()},i}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function i(){if(!t(m)&&(m=!1,!l())){var e=/ Chrome\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(m=!0,S=r(e[1]))}return m}function a(){return i()&&S}function o(){if(!t(y)&&(y=!1,!i()&&!l()&&/ Safari\/[\.0-9]+/.test(I.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(y=!0,M=r(e[1]))}return y}function u(){return o()&&M}function s(){if(!t(O)){O=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(I.userAgent);null!==e&&(O=!0,p=r(e[1]),p.isNightly=!!e[2])}return O}function E(){return s()&&p}function c(){if(!t(C)){C=!1;var e;"Microsoft Internet Explorer"===I.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==e&&(C=!0,U=r(e[1]))):"Netscape"===I.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==e&&(C=!0,U=r(e[1])))}return C}function _(){return c()&&U}function l(){if(!t(g)){g=!1;var e=/ Edge\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(g=!0,L=r(e[1]))}return g}function T(){return l()&&L}function R(){if(!t(x)){x=!1;var e=/Firefox\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(x=!0,w=r(e[1]))}return x}function f(){return t(v)||(v=/Windows/i.test(I.appVersion)),v}function A(){return R()&&w}function d(){return t(P)||(P="undefined"!=typeof PointerEvent&&(!t(I.pointerEnabled)||I.pointerEnabled)),P}function h(){ -if(!t(B)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;B=t(n)&&""!==n,B&&(F=n)}return B}function N(){return h()?F:void 0}var I;I="undefined"!=typeof navigator?navigator:{};var m,S,y,M,O,p,C,U,g,L,x,w,v,P,F,B,D={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:E,isInternetExplorer:c,internetExplorerVersion:_,isEdge:l,edgeVersion:T,isFirefox:R,firefoxVersion:A,isWindows:f,hardwareConcurrency:e(I.hardwareConcurrency,3),supportsPointerEvents:d,supportsImageRenderingPixelated:h,imageRenderingValue:N};return D.supportsFullscreen=function(){return n.supportsFullscreen()},D.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},D.supportsWebWorkers=function(){return"undefined"!=typeof Worker},D}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,i,a){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:a.BYTE,UNSIGNED_BYTE:a.UNSIGNED_BYTE,SHORT:a.SHORT,UNSIGNED_SHORT:a.UNSIGNED_SHORT,INT:a.INT,UNSIGNED_INT:a.UNSIGNED_INT,FLOAT:a.FLOAT,DOUBLE:a.DOUBLE};return o.getSizeInBytes=function(e){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.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},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 Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,i){switch(r=e(r,0),i=e(i,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,i);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,i);case o.SHORT:return new Int16Array(n,r,i);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,i);case o.INT:return new Int32Array(n,r,i);case o.UNSIGNED_INT:return new Uint32Array(n,r,i);case o.FLOAT:return new Float32Array(n,r,i);case o.DOUBLE:return new Float64Array(n,r,i)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},i(o)}),define("Core/Quaternion",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math","./Matrix3"],function(e,t,n,r,i,a,o,u){"use strict";function s(e,n,r,i){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(i,0)}var E=new e;s.fromAxisAngle=function(t,r,i){var a=r/2,o=Math.sin(a);E=e.normalize(t,E);var u=E.x*o,c=E.y*o,_=E.z*o,l=Math.cos(a);return n(i)?(i.x=u,i.y=c,i.z=_,i.w=l,i):new s(u,c,_,l)};var c=[1,2,0],_=new Array(3);s.fromRotationMatrix=function(e,t){var r,i,a,o,E,l=e[u.COLUMN0ROW0],T=e[u.COLUMN1ROW1],R=e[u.COLUMN2ROW2],f=l+T+R;if(f>0)r=Math.sqrt(f+1),E=.5*r,r=.5/r,i=(e[u.COLUMN1ROW2]-e[u.COLUMN2ROW1])*r,a=(e[u.COLUMN2ROW0]-e[u.COLUMN0ROW2])*r,o=(e[u.COLUMN0ROW1]-e[u.COLUMN1ROW0])*r;else{var A=c,d=0;T>l&&(d=1),R>l&&R>T&&(d=2);var h=A[d],N=A[h];r=Math.sqrt(e[u.getElementIndex(d,d)]-e[u.getElementIndex(h,h)]-e[u.getElementIndex(N,N)]+1);var I=_;I[d]=.5*r,r=.5/r,E=(e[u.getElementIndex(N,h)]-e[u.getElementIndex(h,N)])*r,I[h]=(e[u.getElementIndex(h,d)]+e[u.getElementIndex(d,h)])*r,I[N]=(e[u.getElementIndex(N,d)]+e[u.getElementIndex(d,N)])*r,i=-I[0],a=-I[1],o=-I[2]}return n(t)?(t.x=i,t.y=a,t.z=o,t.w=E,t):new s(i,a,o,E)};var l=new s;s.fromHeadingPitchRoll=function(t,n,r,i){var a=s.fromAxisAngle(e.UNIT_X,r,l),o=s.fromAxisAngle(e.UNIT_Y,-n,i);i=s.multiply(o,a,o);var u=s.fromAxisAngle(e.UNIT_Z,-t,l);return s.multiply(u,i,i)};var T=new e,R=new e,f=new s,A=new s,d=new s;s.packedLength=4,s.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},s.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new s),i.x=e[r],i.y=e[r+1],i.z=e[r+2],i.w=e[r+3],i},s.packedInterpolationLength=3,s.convertPackedArrayForInterpolation=function(e,t,n,r){s.unpack(e,4*n,d),s.conjugate(d,d);for(var i=0,a=n-t+1;i<a;i++){var o=3*i;s.unpack(e,4*(t+i),f),s.multiply(f,d,f),f.w<0&&s.negate(f,f),s.computeAxis(f,T);var u=s.computeAngle(f);r[o]=T.x*u,r[o+1]=T.y*u,r[o+2]=T.z*u}},s.unpackInterpolationResult=function(t,r,i,a,o){n(o)||(o=new s),e.fromArray(t,0,R);var u=e.magnitude(R);return s.unpack(r,4*a,A),0===u?s.clone(s.IDENTITY,f):s.fromAxisAngle(R,u,f),s.multiply(f,A,o)},s.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new s(e.x,e.y,e.z,e.w)},s.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},s.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},s.magnitude=function(e){return Math.sqrt(s.magnitudeSquared(e))},s.normalize=function(e,t){var n=1/s.magnitude(e),r=e.x*n,i=e.y*n,a=e.z*n,o=e.w*n;return t.x=r,t.y=i,t.z=a,t.w=o,t},s.inverse=function(e,t){var n=s.magnitudeSquared(e);return t=s.conjugate(e,t),s.multiplyByScalar(t,1/n,t)},s.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},s.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},s.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},s.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},s.multiply=function(e,t,n){var r=e.x,i=e.y,a=e.z,o=e.w,u=t.x,s=t.y,E=t.z,c=t.w,_=o*u+r*c+i*E-a*s,l=o*s-r*E+i*c+a*u,T=o*E+r*s-i*u+a*c,R=o*c-r*u-i*s-a*E;return n.x=_,n.y=l,n.z=T,n.w=R,n},s.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},s.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},s.computeAxis=function(e,t){var n=e.w;if(Math.abs(n-1)<o.EPSILON6)return t.x=t.y=t.z=0,t;var r=1/Math.sqrt(1-n*n);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},s.computeAngle=function(e){return Math.abs(e.w-1)<o.EPSILON6?0:2*Math.acos(e.w)};var h=new s;s.lerp=function(e,t,n,r){return h=s.multiplyByScalar(t,n,h),r=s.multiplyByScalar(e,1-n,r),s.add(h,r,r)};var N=new s,I=new s,m=new s;s.slerp=function(e,t,n,r){var i=s.dot(e,t),a=t;if(i<0&&(i=-i,a=N=s.negate(t,N)),1-i<o.EPSILON6)return s.lerp(e,a,n,r);var u=Math.acos(i);return I=s.multiplyByScalar(e,Math.sin((1-n)*u),I),m=s.multiplyByScalar(a,Math.sin(n*u),m),r=s.add(I,m,r),s.multiplyByScalar(r,1/Math.sin(u),r)},s.log=function(t,n){var r=o.acosClamped(t.w),i=0;return 0!==r&&(i=r/Math.sin(r)),e.multiplyByScalar(t,i,n)},s.exp=function(t,n){var r=e.magnitude(t),i=0;return 0!==r&&(i=Math.sin(r)/r),n.x=t.x*i,n.y=t.y*i,n.z=t.z*i,n.w=Math.cos(r),n};var S=new e,y=new e,M=new s,O=new s;s.computeInnerQuadrangle=function(t,n,r,i){var a=s.conjugate(n,M);s.multiply(a,r,O);var o=s.log(O,S);s.multiply(a,t,O);var u=s.log(O,y);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),s.exp(o,M),s.multiply(n,M,i)},s.squad=function(e,t,n,r,i,a){var o=s.slerp(e,t,i,M),u=s.slerp(n,r,i,O);return s.slerp(o,u,2*i*(1-i),a)};for(var p=new s,C=1.9011074535173003,U=i.supportsTypedArrays()?new Float32Array(8):[],g=i.supportsTypedArrays()?new Float32Array(8):[],L=i.supportsTypedArrays()?new Float32Array(8):[],x=i.supportsTypedArrays()?new Float32Array(8):[],w=0;w<7;++w){var v=w+1,P=2*v+1;U[w]=1/(v*P),g[w]=v/P}return U[7]=C/136,g[7]=8*C/17,s.fastSlerp=function(e,t,n,r){var i,a=s.dot(e,t);a>=0?i=1:(i=-1,a=-a);for(var o=a-1,u=1-n,E=n*n,c=u*u,_=7;_>=0;--_)L[_]=(U[_]*E-g[_])*o,x[_]=(U[_]*c-g[_])*o;var l=i*n*(1+L[0]*(1+L[1]*(1+L[2]*(1+L[3]*(1+L[4]*(1+L[5]*(1+L[6]*(1+L[7])))))))),T=u*(1+x[0]*(1+x[1]*(1+x[2]*(1+x[3]*(1+x[4]*(1+x[5]*(1+x[6]*(1+x[7])))))))),R=s.multiplyByScalar(e,T,p);return s.multiplyByScalar(t,l,r),s.add(R,r,r)},s.fastSquad=function(e,t,n,r,i,a){var o=s.fastSlerp(e,t,i,M),u=s.fastSlerp(n,r,i,O);return s.fastSlerp(o,u,2*i*(1-i),a)},s.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},s.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.x-t.x)<=r&&Math.abs(e.y-t.y)<=r&&Math.abs(e.z-t.z)<=r&&Math.abs(e.w-t.w)<=r},s.ZERO=a(new s(0,0,0,0)),s.IDENTITY=a(new s(0,0,0,1)),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.x+", "+this.y+", "+this.z+", "+this.w+")"},s}),define("Core/EllipseGeometryLibrary",["./Cartesian3","./Math","./Matrix3","./Quaternion"],function(e,t,n,r){"use strict";function i(t,i,a,c,_,l,T,R,f,A){var d=t+i;e.multiplyByScalar(c,Math.cos(d),o),e.multiplyByScalar(a,Math.sin(d),u),e.add(o,u,o);var h=Math.cos(t);h*=h;var N=Math.sin(t);N*=N;var I=l/Math.sqrt(T*h+_*N),m=I/R;return r.fromAxisAngle(o,m,s),n.fromQuaternion(s,E),n.multiplyByVector(E,f,A),e.normalize(A,A),e.multiplyByScalar(A,R,A),A}var a={},o=new e,u=new e,s=new r,E=new n,c=new e,_=new e,l=new e,T=new e;a.raisePositionsToHeight=function(t,n,r){for(var i=n.ellipsoid,a=n.height,o=n.extrudedHeight,u=r?t.length/3*2:t.length/3,s=new Float64Array(3*u),E=t.length,R=r?E:0,f=0;f<E;f+=3){var A=f+1,d=f+2,h=e.fromArray(t,f,c);i.scaleToGeodeticSurface(h,h);var N=e.clone(h,_),I=i.geodeticSurfaceNormal(h,T),m=e.multiplyByScalar(I,a,l);e.add(h,m,h),r&&(e.multiplyByScalar(I,o,m),e.add(N,m,N),s[f+R]=N.x,s[A+R]=N.y,s[d+R]=N.z),s[f]=h.x,s[A]=h.y,s[d]=h.z}return s};var R=new e,f=new e,A=new e;return a.computeEllipsePositions=function(n,r,a){var o=n.semiMinorAxis,u=n.semiMajorAxis,s=n.rotation,E=n.center,T=8*n.granularity,d=o*o,h=u*u,N=u*o,I=e.magnitude(E),m=e.normalize(E,R),S=e.cross(e.UNIT_Z,E,f);S=e.normalize(S,S);var y=e.cross(m,S,A),M=1+Math.ceil(t.PI_OVER_TWO/T),O=t.PI_OVER_TWO/(M-1),p=t.PI_OVER_TWO-M*O;p<0&&(M-=Math.ceil(Math.abs(p)/O));var C,U,g,L,x,w=2*(M*(M+2)),v=r?new Array(3*w):void 0,P=0,F=c,B=_,D=4*M*3,z=D-1,G=0,b=a?new Array(D):void 0;for(p=t.PI_OVER_TWO,F=i(p,s,y,S,d,N,h,I,m,F),r&&(v[P++]=F.x,v[P++]=F.y,v[P++]=F.z),a&&(b[z--]=F.z,b[z--]=F.y,b[z--]=F.x),p=t.PI_OVER_TWO-O,C=1;C<M+1;++C){if(F=i(p,s,y,S,d,N,h,I,m,F),B=i(Math.PI-p,s,y,S,d,N,h,I,m,B),r){for(v[P++]=F.x,v[P++]=F.y,v[P++]=F.z,g=2*C+2,U=1;U<g-1;++U)L=U/(g-1),x=e.lerp(F,B,L,l),v[P++]=x.x,v[P++]=x.y,v[P++]=x.z;v[P++]=B.x,v[P++]=B.y,v[P++]=B.z}a&&(b[z--]=F.z,b[z--]=F.y,b[z--]=F.x,b[G++]=B.x,b[G++]=B.y,b[G++]=B.z),p=t.PI_OVER_TWO-(C+1)*O}for(C=M;C>1;--C){if(p=t.PI_OVER_TWO-(C-1)*O,F=i(-p,s,y,S,d,N,h,I,m,F),B=i(p+Math.PI,s,y,S,d,N,h,I,m,B),r){for(v[P++]=F.x,v[P++]=F.y,v[P++]=F.z,g=2*(C-1)+2,U=1;U<g-1;++U)L=U/(g-1),x=e.lerp(F,B,L,l),v[P++]=x.x,v[P++]=x.y,v[P++]=x.z;v[P++]=B.x,v[P++]=B.y,v[P++]=B.z}a&&(b[z--]=F.z,b[z--]=F.y,b[z--]=F.x,b[G++]=B.x,b[G++]=B.y,b[G++]=B.z)}p=t.PI_OVER_TWO,F=i(-p,s,y,S,d,N,h,I,m,F);var V={};return r&&(v[P++]=F.x,v[P++]=F.y,v[P++]=F.z,V.positions=v,V.numPts=M),a&&(b[z--]=F.z,b[z--]=F.y,b[z--]=F.x,V.outerPositions=b),V},a}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===n.POINTS||e===n.LINES||e===n.LINE_LOOP||e===n.LINE_STRIP||e===n.TRIANGLES||e===n.TRIANGLE_STRIP||e===n.TRIANGLE_FAN}};return e(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,i){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,i.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return a.computeNumberOfVertices=function(e){var n=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var i=e.attributes[r],a=i.values.length/i.componentsPerAttribute;n=a}return n},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(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 r}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.binormal=t.binormal,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,n,r,i){"use strict";var a={UNSIGNED_BYTE:i.UNSIGNED_BYTE,UNSIGNED_SHORT:i.UNSIGNED_SHORT,UNSIGNED_INT:i.UNSIGNED_INT};return a.getSizeInBytes=function(e){switch(e){case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},a.validate=function(t){return e(t)&&(t===a.UNSIGNED_BYTE||t===a.UNSIGNED_SHORT||t===a.UNSIGNED_INT)},a.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},a.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)},n(a)}),define("Core/EllipseOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EllipseGeometryLibrary","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType"],function(e,t,n,r,i,a,o,u,s,E,c,_,l,T){"use strict";function R(r){var i=r.center;h=t.multiplyByScalar(r.ellipsoid.geodeticSurfaceNormal(i,h),r.height,h),h=t.add(i,h,h);for(var a=new e(h,r.semiMajorAxis),u=o.computeEllipsePositions(r,!1,!0).outerPositions,s=new c({position:new E({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:o.raisePositionsToHeight(u,r,!1)})}),l=u.length/3,T=_.createTypedArray(l,2*l),R=0,f=0;f<l;++f)T[R++]=f,T[R++]=(f+1)%l;return{boundingSphere:a,attributes:s,indices:T}}function f(i){var a=i.center,u=i.ellipsoid,s=i.semiMajorAxis,T=t.multiplyByScalar(u.geodeticSurfaceNormal(a,d),i.height,d);N.center=t.add(a,T,N.center),N.radius=s,T=t.multiplyByScalar(u.geodeticSurfaceNormal(a,T),i.extrudedHeight,T),I.center=t.add(a,T,I.center),I.radius=s;var R=o.computeEllipsePositions(i,!1,!0).outerPositions,f=new c({position:new E({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:o.raisePositionsToHeight(R,i,!0)})});R=f.position.values;var A=e.union(N,I),h=R.length/3,m=r(i.numberOfVerticalLines,16);m=l.clamp(m,0,h/2);var S=_.createTypedArray(h,2*h+2*m);h/=2;var y,M=0;for(y=0;y<h;++y)S[M++]=y,S[M++]=(y+1)%h,S[M++]=y+h,S[M++]=(y+1)%h+h;var O;if(m>0){var p=Math.min(m,h);O=Math.round(h/p);var C=Math.min(O*m,h);for(y=0;y<C;y+=O)S[M++]=y,S[M++]=y+h}return{boundingSphere:A,attributes:f,indices:S}}function A(e){e=r(e,r.EMPTY_OBJECT);var n=e.center,a=r(e.ellipsoid,u.WGS84),o=e.semiMajorAxis,s=e.semiMinorAxis,E=r(e.granularity,l.RADIANS_PER_DEGREE),c=r(e.height,0),_=e.extrudedHeight,T=i(_)&&Math.abs(c-_)>1;this._center=t.clone(n),this._semiMajorAxis=o,this._semiMinorAxis=s,this._ellipsoid=u.clone(a),this._rotation=r(e.rotation,0),this._height=c,this._granularity=E,this._extrudedHeight=_,this._extrude=T,this._numberOfVerticalLines=Math.max(r(e.numberOfVerticalLines,16),0),this._workerName="createEllipseOutlineGeometry"}var d=new t,h=new t,N=new e,I=new e;A.packedLength=t.packedLength+u.packedLength+9,A.pack=function(e,n,a){return a=r(a,0),t.pack(e._center,n,a),a+=t.packedLength,u.pack(e._ellipsoid,n,a),a+=u.packedLength,n[a++]=e._semiMajorAxis,n[a++]=e._semiMinorAxis,n[a++]=e._rotation,n[a++]=e._height,n[a++]=e._granularity,n[a++]=i(e._extrudedHeight)?1:0,n[a++]=r(e._extrudedHeight,0),n[a++]=e._extrude?1:0,n[a]=e._numberOfVerticalLines,n};var m=new t,S=new u,y={center:m,ellipsoid:S,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0};return A.unpack=function(e,n,a){n=r(n,0);var o=t.unpack(e,n,m);n+=t.packedLength;var s=u.unpack(e,n,S);n+=u.packedLength;var E=e[n++],c=e[n++],_=e[n++],l=e[n++],T=e[n++],R=e[n++],f=e[n++],d=1===e[n++],h=e[n];return i(a)?(a._center=t.clone(o,a._center),a._ellipsoid=u.clone(s,a._ellipsoid),a._semiMajorAxis=E,a._semiMinorAxis=c,a._rotation=_,a._height=l,a._granularity=T,a._extrudedHeight=R?f:void 0,a._extrude=d,a._numberOfVerticalLines=h,a):(y.height=l,y.extrudedHeight=R?f:void 0,y.granularity=T,y.rotation=_,y.semiMajorAxis=E,y.semiMinorAxis=c,y.numberOfVerticalLines=h,new A(y))},A.createGeometry=function(e){if(!(e._semiMajorAxis<=0||e._semiMinorAxis<=0)){e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);var t,n={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:e._height,extrudedHeight:e._extrudedHeight,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines};return e._extrude?(n.extrudedHeight=Math.min(e._extrudedHeight,e._height),n.height=Math.max(e._extrudedHeight,e._height),t=f(n)):t=R(n),new s({attributes:t.attributes,indices:t.indices,primitiveType:T.LINES,boundingSphere:t.boundingSphere})}},A}),define("Core/CircleOutlineGeometry",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./EllipseOutlineGeometry","./Ellipsoid"],function(e,t,n,r,i,a){"use strict";function o(e){e=t(e,t.EMPTY_OBJECT);var n=e.radius,r={center:e.center,semiMajorAxis:n,semiMinorAxis:n,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,numberOfVerticalLines:e.numberOfVerticalLines};this._ellipseGeometry=new i(r),this._workerName="createCircleOutlineGeometry"}o.packedLength=i.packedLength,o.pack=function(e,t,n){return i.pack(e._ellipseGeometry,t,n)};var u=new i({center:new e,semiMajorAxis:1,semiMinorAxis:1}),s={center:new e,radius:void 0, -ellipsoid:a.clone(a.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};return o.unpack=function(t,r,E){var c=i.unpack(t,r,u);return s.center=e.clone(c._center,s.center),s.ellipsoid=a.clone(c._ellipsoid,s.ellipsoid),s.height=c._height,s.extrudedHeight=c._extrudedHeight,s.granularity=c._granularity,s.numberOfVerticalLines=c._numberOfVerticalLines,n(E)?(s.semiMajorAxis=c._semiMajorAxis,s.semiMinorAxis=c._semiMinorAxis,E._ellipseGeometry=new i(s),E):(s.radius=c._semiMajorAxis,new o(s))},o.createGeometry=function(e){return i.createGeometry(e._ellipseGeometry)},o}),define("Workers/createCircleOutlineGeometry",["../Core/Cartesian3","../Core/CircleOutlineGeometry","../Core/defined","../Core/Ellipsoid"],function(e,t,n,r){"use strict";function i(i,a){return n(a)&&(i=t.unpack(i,a)),i._ellipseGeometry._center=e.clone(i._ellipseGeometry._center),i._ellipseGeometry._ellipsoid=r.clone(i._ellipseGeometry._ellipsoid),t.createGeometry(i)}return i})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e){return e+" is required, actual value was undefined"}function r(e,t,n){return"Expected "+n+" to be typeof "+t+", actual typeof was "+e}var i={};return i.typeOf={},i.defined=function(r,i){if(!e(i))throw new t(n(r))},i.typeOf.func=function(e,n){if("function"!=typeof n)throw new t(r(typeof n,"function",e))},i.typeOf.string=function(e,n){if("string"!=typeof n)throw new t(r(typeof n,"string",e))},i.typeOf.number=function(e,n){if("number"!=typeof n)throw new t(r(typeof n,"number",e))},i.typeOf.number.lessThan=function(e,n,r){if(i.typeOf.number(e,n),n>=r)throw new t("Expected "+e+" to be less than "+r+", actual value was "+n)},i.typeOf.number.lessThanOrEquals=function(e,n,r){if(i.typeOf.number(e,n),n>r)throw new t("Expected "+e+" to be less than or equal to "+r+", actual value was "+n)},i.typeOf.number.greaterThan=function(e,n,r){if(i.typeOf.number(e,n),n<=r)throw new t("Expected "+e+" to be greater than "+r+", actual value was "+n)},i.typeOf.number.greaterThanOrEquals=function(e,n,r){if(i.typeOf.number(e,n),n<r)throw new t("Expected "+e+" to be greater than or equal to"+r+", actual value was "+n)},i.typeOf.object=function(e,n){if("object"!=typeof n)throw new t(r(typeof n,"object",e))},i.typeOf.bool=function(e,n){if("boolean"!=typeof n)throw new t(r(typeof n,"boolean",e))},i}),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";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),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 n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(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^=e<<7&2636928640,e^=e<<15&4022730752,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,n,r){"use strict";var i={};i.EPSILON1=.1,i.EPSILON2=.01,i.EPSILON3=.001,i.EPSILON4=1e-4,i.EPSILON5=1e-5,i.EPSILON6=1e-6,i.EPSILON7=1e-7,i.EPSILON8=1e-8,i.EPSILON9=1e-9,i.EPSILON10=1e-10,i.EPSILON11=1e-11,i.EPSILON12=1e-12,i.EPSILON13=1e-13,i.EPSILON14=1e-14,i.EPSILON15=1e-15,i.EPSILON16=1e-16,i.EPSILON17=1e-17,i.EPSILON18=1e-18,i.EPSILON19=1e-19,i.EPSILON20=1e-20,i.GRAVITATIONALPARAMETER=3986004418e5,i.SOLAR_RADIUS=6955e5,i.LUNAR_RADIUS=1737400,i.SIXTY_FOUR_KILOBYTES=65536,i.sign=function(e){return e>0?1:e<0?-1:0},i.signNotZero=function(e){return e<0?-1:1},i.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*i.clamp(e,-1,1)+.5)*n)},i.fromSNorm=function(e,n){return n=t(n,255),i.clamp(e,0,n)/n*2-1},i.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},i.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},i.lerp=function(e,t,n){return(1-n)*e+n*t},i.PI=Math.PI,i.ONE_OVER_PI=1/Math.PI,i.PI_OVER_TWO=.5*Math.PI,i.PI_OVER_THREE=Math.PI/3,i.PI_OVER_FOUR=Math.PI/4,i.PI_OVER_SIX=Math.PI/6,i.THREE_PI_OVER_TWO=3*Math.PI*.5,i.TWO_PI=2*Math.PI,i.ONE_OVER_TWO_PI=1/(2*Math.PI),i.RADIANS_PER_DEGREE=Math.PI/180,i.DEGREES_PER_RADIAN=180/Math.PI,i.RADIANS_PER_ARCSECOND=i.RADIANS_PER_DEGREE/3600,i.toRadians=function(e){return e*i.RADIANS_PER_DEGREE},i.toDegrees=function(e){return e*i.DEGREES_PER_RADIAN},i.convertLongitudeRange=function(e){var t=i.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},i.clampToLatitudeRange=function(e){return i.clamp(e,-1*i.PI_OVER_TWO,i.PI_OVER_TWO)},i.negativePiToPi=function(e){return i.zeroToTwoPi(e+i.PI)-i.PI},i.zeroToTwoPi=function(e){var t=i.mod(e,i.TWO_PI);return Math.abs(t)<i.EPSILON14&&Math.abs(e)>i.EPSILON14?i.TWO_PI:t},i.mod=function(e,t){return(e%t+t)%t},i.equalsEpsilon=function(e,n,r,i){i=t(i,r);var a=Math.abs(e-n);return a<=i||a<=r*Math.max(Math.abs(e),Math.abs(n))};var a=[1];i.factorial=function(e){var t=a.length;if(e>=t)for(var n=a[t-1],r=t;r<=e;r++)a.push(n*r);return a[e]},i.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},i.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},i.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},i.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return i.setRandomNumberSeed=function(t){o=new e(t)},i.nextRandomNumber=function(){return o.random()},i.acosClamped=function(e){return Math.acos(i.clamp(e,-1,1))},i.asinClamped=function(e){return Math.asin(i.clamp(e,-1,1))},i.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},i.logBase=function(e,t){return Math.log(e)/Math.log(t)},i.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},i}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var i=e.clock,a=e.cone,u=t(e.magnitude,1),s=u*Math.sin(a);return r.x=s*Math.cos(i),r.y=s*Math.sin(i),r.z=u*Math.cos(a),r},o.fromElements=function(e,t,r,i){return n(i)?(i.x=e,i.y=t,i.z=r,i):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new o),i.x=e[r++],i.y=e[r++],i.z=e[r],i},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var i=0;i<r;++i)o.pack(e[i],t,3*i);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var i=0;i<r;i+=3){var a=i/3;t[a]=o.unpack(e,i,t[a])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,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};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var E=new o,c=new o;o.angleBetween=function(e,t){o.normalize(e,E),o.normalize(t,c);var n=o.dot(E,c),r=o.magnitude(o.cross(E,c,E));return Math.atan2(r,n)};var _=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,_);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,i){return e===t||n(e)&&n(t)&&a.equalsEpsilon(e.x,t.x,r,i)&&a.equalsEpsilon(e.y,t.y,r,i)&&a.equalsEpsilon(e.z,t.z,r,i)},o.cross=function(e,t,n){var r=e.x,i=e.y,a=e.z,o=t.x,u=t.y,s=t.z,E=i*s-a*u,c=a*o-r*s,_=r*u-i*o;return n.x=E,n.y=c,n.z=_,n},o.fromDegrees=function(e,t,n,r,i){return e=a.toRadians(e),t=a.toRadians(t),o.fromRadians(e,t,n,r,i)};var l=new o,T=new o,R=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,i,a,u){i=t(i,0);var s=n(a)?a.radiiSquared:R,E=Math.cos(r);l.x=E*Math.cos(e),l.y=E*Math.sin(e),l.z=Math.sin(r),l=o.normalize(l,l),o.multiplyComponents(s,l,T);var c=Math.sqrt(o.dot(l,T));return T=o.divideByScalar(T,c,T),l=o.multiplyByScalar(l,i,l),n(u)||(u=new o),o.add(T,l,u)},o.fromDegreesArray=function(e,t,r){var i=e.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],s=e[a+1],E=a/2;r[E]=o.fromDegrees(u,s,0,t,r[E])}return r},o.fromRadiansArray=function(e,t,r){var i=e.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],s=e[a+1],E=a/2;r[E]=o.fromRadians(u,s,0,t,r[E])}return r},o.fromDegreesArrayHeights=function(e,t,r){var i=e.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],s=e[a+1],E=e[a+2],c=a/3;r[c]=o.fromDegrees(u,s,E,t,r[c])}return r},o.fromRadiansArrayHeights=function(e,t,r){var i=e.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],s=e[a+1],E=e[a+2],c=a/3;r[c]=o.fromRadians(u,s,E,t,r[c])}return r},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,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function i(n,i,u,s,E){var c=n.x,_=n.y,l=n.z,T=i.x,R=i.y,f=i.z,A=c*c*T*T,h=_*_*R*R,d=l*l*f*f,N=A+h+d,I=Math.sqrt(1/N),S=e.multiplyByScalar(n,I,a);if(N<s)return isFinite(I)?e.clone(S,E):void 0;var m=u.x,y=u.y,M=u.z,O=o;O.x=S.x*m*2,O.y=S.y*y*2,O.z=S.z*M*2;var p,C,U,g,L,w,x,v,P,F,B,D=(1-I)*e.magnitude(n)/(.5*e.magnitude(O)),z=0;do{D-=z,U=1/(1+D*m),g=1/(1+D*y),L=1/(1+D*M),w=U*U,x=g*g,v=L*L,P=w*U,F=x*g,B=v*L,p=A*w+h*x+d*v-1,C=A*P*m+h*F*y+d*B*M;var G=-2*C;z=p/G}while(Math.abs(p)>r.EPSILON12);return t(E)?(E.x=c*U,E.y=_*g,E.z=l*L,E):new e(c*U,_*g,l*L)}var a=new e,o=new e;return i}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,i,a,o){"use strict";function u(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)}u.fromRadians=function(e,r,i,a){return i=t(i,0),n(a)?(a.longitude=e,a.latitude=r,a.height=i,a):new u(e,r,i)},u.fromDegrees=function(e,t,n,r){return e=a.toRadians(e),t=a.toRadians(t),u.fromRadians(e,t,n,r)};var s=new e,E=new e,c=new e,_=new e(1/6378137,1/6378137,1/6356752.314245179),l=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),T=a.EPSILON1;return u.fromCartesian=function(t,r,i){var R=n(r)?r.oneOverRadii:_,f=n(r)?r.oneOverRadiiSquared:l,A=n(r)?r._centerToleranceSquared:T,h=o(t,R,f,A,E);if(n(h)){var d=e.multiplyComponents(h,f,s);d=e.normalize(d,d);var N=e.subtract(t,h,c),I=Math.atan2(d.y,d.x),S=Math.asin(d.z),m=a.sign(e.dot(N,t))*e.magnitude(N);return n(i)?(i.longitude=I,i.latitude=S,i.height=m,i):new u(I,S,m)}},u.clone=function(e,t){if(n(e))return n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},u.ZERO=i(new u(0,0,0)),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,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,i,a,o,u,s){"use strict";function E(t,r,i,a){r=n(r,0),i=n(i,0),a=n(a,0),t._radii=new e(r,i,a),t._radiiSquared=new e(r*r,i*i,a*a),t._radiiToTheFourth=new e(r*r*r*r,i*i*i*i,a*a*a*a),t._oneOverRadii=new e(0===r?0:1/r,0===i?0:1/i,0===a?0:1/a),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===i?0:1/(i*i),0===a?0:1/(a*a)),t._minimumRadius=Math.min(r,i,a),t._maximumRadius=Math.max(r,i,a),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function c(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,E(this,e,t,n)}i(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,n){if(r(t)){var i=t._radii;return r(n)?(e.clone(i,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new c(i.x,i.y,i.z)}},c.fromCartesian3=function(e,t){return r(t)||(t=new c),r(e)?(E(t,e.x,e.y,e.z),t):t},c.WGS84=o(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=o(new c(1,1,1)),c.MOON=o(new c(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),c.prototype.clone=function(e){return c.clone(this,e)},c.packedLength=e.packedLength,c.pack=function(t,r,i){return i=n(i,0),e.pack(t._radii,r,i),r},c.unpack=function(t,r,i){r=n(r,0);var a=e.unpack(t,r);return c.fromCartesian3(a,i)},c.prototype.geocentricSurfaceNormal=e.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(t,n){var i=t.longitude,a=t.latitude,o=Math.cos(a),u=o*Math.cos(i),s=o*Math.sin(i),E=Math.sin(a);return r(n)||(n=new e),n.x=u,n.y=s,n.z=E,e.normalize(n,n)},c.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var _=new e,l=new e;c.prototype.cartographicToCartesian=function(t,n){var i=_,a=l;this.geodeticSurfaceNormalCartographic(t,i),e.multiplyComponents(this._radiiSquared,i,a);var o=Math.sqrt(e.dot(i,a));return e.divideByScalar(a,o,a),e.multiplyByScalar(i,t.height,i),r(n)||(n=new e),e.add(a,i,n)},c.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;i<n;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var T=new e,R=new e,f=new e;return c.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,R);if(r(a)){var o=this.geodeticSurfaceNormal(a,T),s=e.subtract(n,a,f),E=Math.atan2(o.y,o.x),c=Math.asin(o.z),_=u.sign(e.dot(s,n))*e.magnitude(s);return r(i)?(i.longitude=E,i.latitude=c,i.height=_,i):new t(E,c,_)}},c.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;i<n;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t},c.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},c.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var i=t.x,a=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*u.z);return e.multiplyByScalar(t,s,n)},c.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},c.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},c.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},c.prototype.toString=function(){return this._radii.toString()},c.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,i,a){i=n(i,0);var o=this._sqauredXOverSquaredZ;if(r(a)||(a=new e),a.x=0,a.y=0,a.z=t.z*(1-o),!(Math.abs(a.z)>=this._radii.z-i))return a},c}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,i,a,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return i(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var i=this._semimajorAxis,a=t.longitude*i,o=t.latitude*i,u=t.height;return r(n)?(n.x=a,n.y=o,n.z=u,n):new e(a,o,u)},u.prototype.unproject=function(e,n){var i=this._oneOverSemimajorAxis,a=e.x*i,o=e.y*i,u=e.z;return r(n)?(n.longitude=a,n.latitude=o,n.height=u,n):new t(a,o,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";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a,o,u){"use strict";function s(e,t,r,i,a,o,u,s,E){this[0]=n(e,0),this[1]=n(i,0),this[2]=n(u,0),this[3]=n(t,0),this[4]=n(a,0),this[5]=n(s,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(E,0)}function E(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function c(e){for(var t=0,n=0;n<3;++n){var r=e[s.getElementIndex(f[n],R[n])];t+=2*r*r}return Math.sqrt(t)}function _(e,t){for(var n=u.EPSILON15,r=0,i=1,a=0;a<3;++a){var o=Math.abs(e[s.getElementIndex(f[a],R[a])]);o>r&&(i=a,r=o)}var E=1,c=0,_=R[i],l=f[i];if(Math.abs(e[s.getElementIndex(l,_)])>n){var T,A=e[s.getElementIndex(l,l)],h=e[s.getElementIndex(_,_)],d=e[s.getElementIndex(l,_)],N=(A-h)/2/d;T=N<0?-1/(-N+Math.sqrt(1+N*N)):1/(N+Math.sqrt(1+N*N)),E=1/Math.sqrt(1+T*T),c=T*E}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(_,_)]=t[s.getElementIndex(l,l)]=E,t[s.getElementIndex(l,_)]=c,t[s.getElementIndex(_,l)]=-c,t}s.packedLength=9,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t},s.unpack=function(e,t,i){return t=n(t,0),r(i)||(i=new s),i[0]=e[t++],i[1]=e[t++],i[2]=e[t++],i[3]=e[t++],i[4]=e[t++],i[5]=e[t++],i[6]=e[t++],i[7]=e[t++],i[8]=e[t++],i},s.clone=function(e,t){if(r(e))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):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,i){return t=n(t,0),r(i)||(i=new s),i[0]=e[t],i[1]=e[t+1],i[2]=e[t+2],i[3]=e[t+3],i[4]=e[t+4],i[5]=e[t+5],i[6]=e[t+6],i[7]=e[t+7],i[8]=e[t+8],i},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[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 s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var n=e.x*e.x,i=e.x*e.y,a=e.x*e.z,o=e.x*e.w,u=e.y*e.y,E=e.y*e.z,c=e.y*e.w,_=e.z*e.z,l=e.z*e.w,T=e.w*e.w,R=n-u-_+T,f=2*(i-l),A=2*(a+c),h=2*(i+l),d=-n+u-_+T,N=2*(E-o),I=2*(a-c),S=2*(E+o),m=-n-u+_+T;return r(t)?(t[0]=R,t[1]=h,t[2]=I,t[3]=f,t[4]=d,t[5]=S,t[6]=A,t[7]=N,t[8]=m,t):new s(R,f,A,h,d,N,I,S,m)},s.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),i=Math.cos(-e.heading),a=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),E=Math.sin(e.roll),c=n*i,_=-a*u+E*o*i,l=E*u+a*o*i,T=n*u,R=a*i+E*o*u,f=-o*a+a*o*u,A=-o,h=E*n,d=a*n;return r(t)?(t[0]=c,t[1]=T,t[2]=A,t[3]=_,t[4]=R,t[5]=h,t[6]=l,t[7]=f,t[8]=d,t):new s(c,_,l,T,R,f,A,h,d)},s.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 s(e.x,0,0,0,e.y,0,0,0,e.z)},s.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 s(e,0,0,0,e,0,0,0,e)},s.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 s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=i,t[6]=0,t[7]=-i,t[8]=n,t):new s(1,0,0,0,n,-i,0,i,n)},s.fromRotationY=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-i,t[3]=0,t[4]=1,t[5]=0,t[6]=i,t[7]=0,t[8]=n,t):new s(n,0,i,0,1,0,-i,0,n)},s.fromRotationZ=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=n,t[1]=i,t[2]=0,t[3]=-i,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(n,-i,0,i,n,0,0,0,1)},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):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,n){var r=3*t,i=e[r],a=e[r+1],o=e[r+2];return n.x=i,n.y=a,n.z=o,n},s.setColumn=function(e,t,n,r){r=s.clone(e,r);var i=3*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},s.getRow=function(e,t,n){var r=e[t],i=e[t+3],a=e[t+6];return n.x=r,n.y=i,n.z=a,n},s.setRow=function(e,t,n,r){return r=s.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var l=new e;s.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],l)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],l)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],l)),n};var T=new e;s.getMaximumScale=function(t){return s.getScale(t,T),e.maximumComponent(T)},s.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],i=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],o=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],E=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],c=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],_=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=r,n[1]=i,n[2]=a,n[3]=o,n[4]=u,n[5]=s,n[6]=E,n[7]=c,n[8]=_,n},s.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},s.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},s.multiplyByVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[3]*i+e[6]*a,u=e[1]*r+e[4]*i+e[7]*a,s=e[2]*r+e[5]*i+e[8]*a;return n.x=o,n.y=u,n.z=s,n},s.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},s.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},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},s.transpose=function(e,t){var n=e[0],r=e[3],i=e[6],a=e[1],o=e[4],u=e[7],s=e[2],E=e[5],c=e[8];return t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=u,t[6]=s,t[7]=E,t[8]=c,t};var R=[1,0,0],f=[2,2,1],A=new s,h=new s;return s.computeEigenDecomposition=function(e,t){var n=u.EPSILON20,i=10,a=0,o=0;r(t)||(t={});for(var l=t.unitary=s.clone(s.IDENTITY,t.unitary),T=t.diagonal=s.clone(e,t.diagonal),R=n*E(T);o<i&&c(T)>R;)_(T,A),s.transpose(A,h),s.multiply(T,A,T),s.multiply(h,T,T),s.multiply(l,A,l),++a>2&&(++o,a=0);return 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},s.determinant=function(e){var t=e[0],n=e[3],r=e[6],i=e[1],a=e[4],o=e[7],u=e[2],s=e[5],E=e[8];return t*(a*E-s*o)+i*(s*r-n*E)+u*(n*o-a*r)},s.inverse=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],u=e[5],E=e[6],c=e[7],_=e[8],l=s.determinant(e);t[0]=o*_-c*u,t[1]=c*i-r*_,t[2]=r*u-o*i,t[3]=E*u-a*_,t[4]=n*_-E*i,t[5]=a*i-n*u,t[6]=a*c-E*o,t[7]=E*r-n*c,t[8]=n*o-a*r;var T=1/l;return s.multiplyByScalar(t,T,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]},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},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,i(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(e,n,r,i){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(i,0)}o.fromElements=function(e,t,r,i,a){return n(a)?(a.x=e,a.y=t,a.z=r,a.w=i,a):new o(e,t,r,i)},o.fromColor=function(e,t){return n(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(n(e))return n(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)},o.packedLength=4,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},o.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new o),i.x=e[r++],i.y=e[r++],i.z=e[r++],i.w=e[r],i},o.packArray=function(e,t){var r=e.length;n(t)?t.length=4*r:t=new Array(4*r);for(var i=0;i<r;++i)o.pack(e[i],t,4*i);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/4:t=new Array(r/4);for(var i=0;i<r;i+=4){var a=i/4;t[a]=o.unpack(e,i,t[a])}return t},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,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},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 u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,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,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},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 s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var E=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,E);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},o.equalsEpsilon=function(e,t,r,i){return e===t||n(e)&&n(t)&&a.equalsEpsilon(e.x,t.x,r,i)&&a.equalsEpsilon(e.y,t.y,r,i)&&a.equalsEpsilon(e.z,t.z,r,i)&&a.equalsEpsilon(e.w,t.w,r,i)},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,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,i,a,o,u,s,E,c){ +"use strict";function _(e,t,n,i,a,o,u,s,E,c,_,l,T,R,f,A){this[0]=r(e,0),this[1]=r(a,0),this[2]=r(E,0),this[3]=r(T,0),this[4]=r(t,0),this[5]=r(o,0),this[6]=r(c,0),this[7]=r(R,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(_,0),this[11]=r(f,0),this[12]=r(i,0),this[13]=r(s,0),this[14]=r(l,0),this[15]=r(A,0)}_.packedLength=16,_.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},_.unpack=function(e,t,n){return t=r(t,0),i(n)||(n=new _),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},_.clone=function(e,t){if(i(e))return i(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 _(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])},_.fromArray=_.unpack,_.fromColumnMajorArray=function(e,t){return _.clone(e,t)},_.fromRowMajorArray=function(e,t){return i(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 _(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])},_.fromRotationTranslation=function(t,n,a){return n=r(n,e.ZERO),i(a)?(a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=0,a[4]=t[3],a[5]=t[4],a[6]=t[5],a[7]=0,a[8]=t[6],a[9]=t[7],a[10]=t[8],a[11]=0,a[12]=n.x,a[13]=n.y,a[14]=n.z,a[15]=1,a):new _(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},_.fromTranslationQuaternionRotationScale=function(e,t,n,r){i(r)||(r=new _);var a=n.x,o=n.y,u=n.z,s=t.x*t.x,E=t.x*t.y,c=t.x*t.z,l=t.x*t.w,T=t.y*t.y,R=t.y*t.z,f=t.y*t.w,A=t.z*t.z,h=t.z*t.w,d=t.w*t.w,N=s-T-A+d,I=2*(E-h),S=2*(c+f),m=2*(E+h),y=-s+T-A+d,M=2*(R-l),O=2*(c-f),p=2*(R+l),C=-s-T+A+d;return r[0]=N*a,r[1]=m*a,r[2]=O*a,r[3]=0,r[4]=I*o,r[5]=y*o,r[6]=p*o,r[7]=0,r[8]=S*u,r[9]=M*u,r[10]=C*u,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},_.fromTranslationRotationScale=function(e,t){return _.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},_.fromTranslation=function(e,t){return _.fromRotationTranslation(E.IDENTITY,e,t)},_.fromScale=function(e,t){return i(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 _(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},_.fromUniformScale=function(e,t){return i(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 _(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var l=new e,T=new e,R=new e;_.fromCamera=function(t,n){var r=t.position,a=t.direction,o=t.up;e.normalize(a,l),e.normalize(e.cross(l,o,T),T),e.normalize(e.cross(T,l,R),R);var u=T.x,s=T.y,E=T.z,c=l.x,f=l.y,A=l.z,h=R.x,d=R.y,N=R.z,I=r.x,S=r.y,m=r.z,y=u*-I+s*-S+E*-m,M=h*-I+d*-S+N*-m,O=c*I+f*S+A*m;return i(n)?(n[0]=u,n[1]=h,n[2]=-c,n[3]=0,n[4]=s,n[5]=d,n[6]=-f,n[7]=0,n[8]=E,n[9]=N,n[10]=-A,n[11]=0,n[12]=y,n[13]=M,n[14]=O,n[15]=1,n):new _(u,s,E,y,h,d,N,M,-c,-f,-A,O,0,0,0,1)},_.computePerspectiveFieldOfView=function(e,t,n,r,i){var a=Math.tan(.5*e),o=1/a,u=o/t,s=(r+n)/(n-r),E=2*r*n/(n-r);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=o,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=s,i[11]=-1,i[12]=0,i[13]=0,i[14]=E,i[15]=0,i},_.computeOrthographicOffCenter=function(e,t,n,r,i,a,o){var u=1/(t-e),s=1/(r-n),E=1/(a-i),c=-(t+e)*u,_=-(r+n)*s,l=-(a+i)*E;return u*=2,s*=2,E*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=E,o[11]=0,o[12]=c,o[13]=_,o[14]=l,o[15]=1,o},_.computePerspectiveOffCenter=function(e,t,n,r,i,a,o){var u=2*i/(t-e),s=2*i/(r-n),E=(t+e)/(t-e),c=(r+n)/(r-n),_=-(a+i)/(a-i),l=-1,T=-2*a*i/(a-i);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=E,o[9]=c,o[10]=_,o[11]=l,o[12]=0,o[13]=0,o[14]=T,o[15]=0,o},_.computeInfinitePerspectiveOffCenter=function(e,t,n,r,i,a){var o=2*i/(t-e),u=2*i/(r-n),s=(t+e)/(t-e),E=(r+n)/(r-n),c=-1,_=-1,l=-2*i;return a[0]=o,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]=E,a[10]=c,a[11]=_,a[12]=0,a[13]=0,a[14]=l,a[15]=0,a},_.computeViewportTransformation=function(e,t,n,i){e=r(e,r.EMPTY_OBJECT);var a=r(e.x,0),o=r(e.y,0),u=r(e.width,0),s=r(e.height,0);t=r(t,0),n=r(n,1);var E=.5*u,c=.5*s,_=.5*(n-t),l=E,T=c,R=_,f=a+E,A=o+c,h=t+_,d=1;return i[0]=l,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=T,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=R,i[11]=0,i[12]=f,i[13]=A,i[14]=h,i[15]=d,i},_.computeView=function(t,n,r,i,a){return a[0]=i.x,a[1]=r.x,a[2]=-n.x,a[3]=0,a[4]=i.y,a[5]=r.y,a[6]=-n.y,a[7]=0,a[8]=i.z,a[9]=r.z,a[10]=-n.z,a[11]=0,a[12]=-e.dot(i,t),a[13]=-e.dot(r,t),a[14]=e.dot(n,t),a[15]=1,a},_.toArray=function(e,t){return i(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]]},_.getElementIndex=function(e,t){return 4*e+t},_.getColumn=function(e,t,n){var r=4*t,i=e[r],a=e[r+1],o=e[r+2],u=e[r+3];return n.x=i,n.y=a,n.z=o,n.w=u,n},_.setColumn=function(e,t,n,r){r=_.clone(e,r);var i=4*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r[i+3]=n.w,r},_.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},_.getRow=function(e,t,n){var r=e[t],i=e[t+4],a=e[t+8],o=e[t+12];return n.x=r,n.y=i,n.z=a,n.w=o,n},_.setRow=function(e,t,n,r){return r=_.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var f=new e;_.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],f)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],f)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],f)),n};var A=new e;_.getMaximumScale=function(t){return _.getScale(t,A),e.maximumComponent(A)},_.multiply=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[3],u=e[4],s=e[5],E=e[6],c=e[7],_=e[8],l=e[9],T=e[10],R=e[11],f=e[12],A=e[13],h=e[14],d=e[15],N=t[0],I=t[1],S=t[2],m=t[3],y=t[4],M=t[5],O=t[6],p=t[7],C=t[8],U=t[9],g=t[10],L=t[11],w=t[12],x=t[13],v=t[14],P=t[15],F=r*N+u*I+_*S+f*m,B=i*N+s*I+l*S+A*m,D=a*N+E*I+T*S+h*m,z=o*N+c*I+R*S+d*m,G=r*y+u*M+_*O+f*p,b=i*y+s*M+l*O+A*p,V=a*y+E*M+T*O+h*p,X=o*y+c*M+R*O+d*p,H=r*C+u*U+_*g+f*L,q=i*C+s*U+l*g+A*L,W=a*C+E*U+T*g+h*L,Y=o*C+c*U+R*g+d*L,k=r*w+u*x+_*v+f*P,K=i*w+s*x+l*v+A*P,j=a*w+E*x+T*v+h*P,Z=o*w+c*x+R*v+d*P;return n[0]=F,n[1]=B,n[2]=D,n[3]=z,n[4]=G,n[5]=b,n[6]=V,n[7]=X,n[8]=H,n[9]=q,n[10]=W,n[11]=Y,n[12]=k,n[13]=K,n[14]=j,n[15]=Z,n},_.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},_.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},_.multiplyTransformation=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[4],u=e[5],s=e[6],E=e[8],c=e[9],_=e[10],l=e[12],T=e[13],R=e[14],f=t[0],A=t[1],h=t[2],d=t[4],N=t[5],I=t[6],S=t[8],m=t[9],y=t[10],M=t[12],O=t[13],p=t[14],C=r*f+o*A+E*h,U=i*f+u*A+c*h,g=a*f+s*A+_*h,L=r*d+o*N+E*I,w=i*d+u*N+c*I,x=a*d+s*N+_*I,v=r*S+o*m+E*y,P=i*S+u*m+c*y,F=a*S+s*m+_*y,B=r*M+o*O+E*p+l,D=i*M+u*O+c*p+T,z=a*M+s*O+_*p+R;return n[0]=C,n[1]=U,n[2]=g,n[3]=0,n[4]=L,n[5]=w,n[6]=x,n[7]=0,n[8]=v,n[9]=P,n[10]=F,n[11]=0,n[12]=B,n[13]=D,n[14]=z,n[15]=1,n},_.multiplyByMatrix3=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[4],u=e[5],s=e[6],E=e[8],c=e[9],_=e[10],l=t[0],T=t[1],R=t[2],f=t[3],A=t[4],h=t[5],d=t[6],N=t[7],I=t[8],S=r*l+o*T+E*R,m=i*l+u*T+c*R,y=a*l+s*T+_*R,M=r*f+o*A+E*h,O=i*f+u*A+c*h,p=a*f+s*A+_*h,C=r*d+o*N+E*I,U=i*d+u*N+c*I,g=a*d+s*N+_*I;return n[0]=S,n[1]=m,n[2]=y,n[3]=0,n[4]=M,n[5]=O,n[6]=p,n[7]=0,n[8]=C,n[9]=U,n[10]=g,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},_.multiplyByTranslation=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=r*e[0]+i*e[4]+a*e[8]+e[12],u=r*e[1]+i*e[5]+a*e[9]+e[13],s=r*e[2]+i*e[6]+a*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=s,n[15]=e[15],n};var h=new e;_.multiplyByUniformScale=function(e,t,n){return h.x=t,h.y=t,h.z=t,_.multiplyByScale(e,h,n)},_.multiplyByScale=function(e,t,n){var r=t.x,i=t.y,a=t.z;return 1===r&&1===i&&1===a?_.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=i*e[4],n[5]=i*e[5],n[6]=i*e[6],n[7]=0,n[8]=a*e[8],n[9]=a*e[9],n[10]=a*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},_.multiplyByVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=t.w,u=e[0]*r+e[4]*i+e[8]*a+e[12]*o,s=e[1]*r+e[5]*i+e[9]*a+e[13]*o,E=e[2]*r+e[6]*i+e[10]*a+e[14]*o,c=e[3]*r+e[7]*i+e[11]*a+e[15]*o;return n.x=u,n.y=s,n.z=E,n.w=c,n},_.multiplyByPointAsVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[4]*i+e[8]*a,u=e[1]*r+e[5]*i+e[9]*a,s=e[2]*r+e[6]*i+e[10]*a;return n.x=o,n.y=u,n.z=s,n},_.multiplyByPoint=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[4]*i+e[8]*a+e[12],u=e[1]*r+e[5]*i+e[9]*a+e[13],s=e[2]*r+e[6]*i+e[10]*a+e[14];return n.x=o,n.y=u,n.z=s,n},_.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},_.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},_.transpose=function(e,t){var n=e[1],r=e[2],i=e[3],a=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=a,t[10]=e[10],t[11]=e[14],t[12]=i,t[13]=o,t[14]=u,t[15]=e[15],t},_.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},_.equals=function(e,t){return e===t||i(e)&&i(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},_.equalsEpsilon=function(e,t,n){return e===t||i(e)&&i(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},_.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},_.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};var d=new E,N=new E,I=new t,S=new t(0,0,0,1);return _.inverse=function(e,n){if(E.equalsEpsilon(_.getRotation(e,d),N,s.EPSILON7)&&t.equals(_.getRow(e,3,I),S))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],i=e[4],a=e[8],o=e[12],u=e[1],l=e[5],T=e[9],R=e[13],f=e[2],A=e[6],h=e[10],m=e[14],y=e[3],M=e[7],O=e[11],p=e[15],C=h*p,U=m*O,g=A*p,L=m*M,w=A*O,x=h*M,v=f*p,P=m*y,F=f*O,B=h*y,D=f*M,z=A*y,G=C*l+L*T+w*R-(U*l+g*T+x*R),b=U*u+v*T+B*R-(C*u+P*T+F*R),V=g*u+P*l+D*R-(L*u+v*l+z*R),X=x*u+F*l+z*T-(w*u+B*l+D*T),H=U*i+g*a+x*o-(C*i+L*a+w*o),q=C*r+P*a+F*o-(U*r+v*a+B*o),W=L*r+v*i+z*o-(g*r+P*i+D*o),Y=w*r+B*i+D*a-(x*r+F*i+z*a);C=a*R,U=o*T,g=i*R,L=o*l,w=i*T,x=a*l,v=r*R,P=o*u,F=r*T,B=a*u,D=r*l,z=i*u;var k=C*M+L*O+w*p-(U*M+g*O+x*p),K=U*y+v*O+B*p-(C*y+P*O+F*p),j=g*y+P*M+D*p-(L*y+v*M+z*p),Z=x*y+F*M+z*O-(w*y+B*M+D*O),Q=g*h+x*m+U*A-(w*m+C*A+L*h),J=F*m+C*f+P*h-(v*h+B*m+U*f),$=v*A+z*m+L*f-(D*m+g*f+P*A),ee=D*h+w*f+B*A-(F*A+z*h+x*f),te=r*G+i*b+a*V+o*X;if(Math.abs(te)<s.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=G*te,n[1]=b*te,n[2]=V*te,n[3]=X*te,n[4]=H*te,n[5]=q*te,n[6]=W*te,n[7]=Y*te,n[8]=k*te,n[9]=K*te,n[10]=j*te,n[11]=Z*te,n[12]=Q*te,n[13]=J*te,n[14]=$*te,n[15]=ee*te,n},_.inverseTransformation=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[4],o=e[5],u=e[6],s=e[8],E=e[9],c=e[10],_=e[12],l=e[13],T=e[14],R=-n*_-r*l-i*T,f=-a*_-o*l-u*T,A=-s*_-E*l-c*T;return t[0]=n,t[1]=a,t[2]=s,t[3]=0,t[4]=r,t[5]=o,t[6]=E,t[7]=0,t[8]=i,t[9]=u,t[10]=c,t[11]=0,t[12]=R,t[13]=f,t[14]=A,t[15]=1,t},_.IDENTITY=u(new _(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),_.ZERO=u(new _(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),_.COLUMN0ROW0=0,_.COLUMN0ROW1=1,_.COLUMN0ROW2=2,_.COLUMN0ROW3=3,_.COLUMN1ROW0=4,_.COLUMN1ROW1=5,_.COLUMN1ROW2=6,_.COLUMN1ROW3=7,_.COLUMN2ROW0=8,_.COLUMN2ROW1=9,_.COLUMN2ROW2=10,_.COLUMN2ROW3=11,_.COLUMN3ROW0=12,_.COLUMN3ROW1=13,_.COLUMN3ROW2=14,_.COLUMN3ROW3=15,a(_.prototype,{length:{get:function(){return _.packedLength}}}),_.prototype.clone=function(e){return _.clone(this,e)},_.prototype.equals=function(e){return _.equals(this,e)},_.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},_.prototype.equalsEpsilon=function(e,t){return _.equalsEpsilon(this,e,t)},_.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]+")"},_}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,i,a,o,u,s){"use strict";function E(e,t,r,i){this.west=n(e,0),this.south=n(t,0),this.east=n(r,0),this.north=n(i,0)}i(E.prototype,{width:{get:function(){return E.computeWidth(this)}},height:{get:function(){return E.computeHeight(this)}}}),E.packedLength=4,E.pack=function(e,t,r){return r=n(r,0),t[r++]=e.west,t[r++]=e.south,t[r++]=e.east,t[r]=e.north,t},E.unpack=function(e,t,i){return t=n(t,0),r(i)||(i=new E),i.west=e[t++],i.south=e[t++],i.east=e[t++],i.north=e[t],i},E.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=s.TWO_PI),t-n},E.computeHeight=function(e){return e.north-e.south},E.fromDegrees=function(e,t,i,a,o){return e=s.toRadians(n(e,0)),t=s.toRadians(n(t,0)),i=s.toRadians(n(i,0)),a=s.toRadians(n(a,0)),r(o)?(o.west=e,o.south=t,o.east=i,o.north=a,o):new E(e,t,i,a)},E.fromRadians=function(e,t,i,a,o){return r(o)?(o.west=n(e,0),o.south=n(t,0),o.east=n(i,0),o.north=n(a,0),o):new E(e,t,i,a)},E.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,u=Number.MAX_VALUE,c=-Number.MAX_VALUE,_=0,l=e.length;_<l;_++){var T=e[_];n=Math.min(n,T.longitude),i=Math.max(i,T.longitude),u=Math.min(u,T.latitude),c=Math.max(c,T.latitude);var R=T.longitude>=0?T.longitude:T.longitude+s.TWO_PI;a=Math.min(a,R),o=Math.max(o,R)}return i-n>o-a&&(n=a,i=o,i>s.PI&&(i-=s.TWO_PI),n>s.PI&&(n-=s.TWO_PI)),r(t)?(t.west=n,t.south=u,t.east=i,t.north=c,t):new E(n,u,i,c)},E.fromCartesianArray=function(e,t,n){for(var i=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,u=-Number.MAX_VALUE,c=Number.MAX_VALUE,_=-Number.MAX_VALUE,l=0,T=e.length;l<T;l++){var R=t.cartesianToCartographic(e[l]);i=Math.min(i,R.longitude),a=Math.max(a,R.longitude),c=Math.min(c,R.latitude),_=Math.max(_,R.latitude);var f=R.longitude>=0?R.longitude:R.longitude+s.TWO_PI;o=Math.min(o,f),u=Math.max(u,f)}return a-i>u-o&&(i=o,a=u,a>s.PI&&(a-=s.TWO_PI),i>s.PI&&(i-=s.TWO_PI)),r(n)?(n.west=i,n.south=c,n.east=a,n.north=_,n):new E(i,c,a,_)},E.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new E(e.west,e.south,e.east,e.north)},E.prototype.clone=function(e){return E.clone(this,e)},E.prototype.equals=function(e){return E.equals(this,e)},E.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},E.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},E.validate=function(e){},E.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)},E.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)},E.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)},E.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)},E.center=function(t,n){var i=t.east,a=t.west;i<a&&(i+=s.TWO_PI);var o=s.negativePiToPi(.5*(a+i)),u=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=u,n.height=0,n):new e(o,u)},E.intersection=function(e,t,n){var i=e.east,a=e.west,o=t.east,u=t.west;i<a&&o>0?i+=s.TWO_PI:o<u&&i>0&&(o+=s.TWO_PI),i<a&&u<0?u+=s.TWO_PI:o<u&&a<0&&(a+=s.TWO_PI);var c=s.negativePiToPi(Math.max(a,u)),_=s.negativePiToPi(Math.min(i,o));if(!((e.west<e.east||t.west<t.east)&&_<=c)){var l=Math.max(e.south,t.south),T=Math.min(e.north,t.north);if(!(l>=T))return r(n)?(n.west=c,n.south=l,n.east=_,n.north=T,n):new E(c,l,_,T)}},E.simpleIntersection=function(e,t,n){var i=Math.max(e.west,t.west),a=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(a>=u||i>=o))return r(n)?(n.west=i,n.south=a,n.east=o,n.north=u,n):new E(i,a,o,u)},E.union=function(e,t,n){r(n)||(n=new E);var i=e.east,a=e.west,o=t.east,u=t.west;i<a&&o>0?i+=s.TWO_PI:o<u&&i>0&&(o+=s.TWO_PI),i<a&&u<0?u+=s.TWO_PI:o<u&&a<0&&(a+=s.TWO_PI);var c=s.convertLongitudeRange(Math.min(a,u)),_=s.convertLongitudeRange(Math.max(i,o));return n.west=c,n.south=Math.min(e.south,t.south),n.east=_,n.north=Math.max(e.north,t.north),n},E.expand=function(e,t,n){return r(n)||(n=new E),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},E.contains=function(e,t){var n=t.longitude,r=t.latitude,i=e.west,a=e.east;return a<i&&(a+=s.TWO_PI,n<0&&(n+=s.TWO_PI)),(n>i||s.equalsEpsilon(n,i,s.EPSILON14))&&(n<a||s.equalsEpsilon(n,a,s.EPSILON14))&&r>=e.south&&r<=e.north};var c=new e;return E.subsample=function(e,t,i,a){t=n(t,o.WGS84),i=n(i,0),r(a)||(a=[]);var u=0,_=e.north,l=e.south,T=e.east,R=e.west,f=c;f.height=i,f.longitude=R,f.latitude=_,a[u]=t.cartographicToCartesian(f,a[u]),u++,f.longitude=T,a[u]=t.cartographicToCartesian(f,a[u]),u++,f.latitude=l,a[u]=t.cartographicToCartesian(f,a[u]),u++,f.longitude=R,a[u]=t.cartographicToCartesian(f,a[u]),u++,_<0?f.latitude=_:l>0?f.latitude=l:f.latitude=0;for(var A=1;A<8;++A)f.longitude=-Math.PI+A*s.PI_OVER_TWO,E.contains(e,f)&&(a[u]=t.cartographicToCartesian(f,a[u]),u++);return 0===f.latitude&&(f.longitude=R,a[u]=t.cartographicToCartesian(f,a[u]),u++,f.longitude=T,a[u]=t.cartographicToCartesian(f,a[u]),u++),a.length=u,a},E.MAX_VALUE=u(new E(-Math.PI,-s.PI_OVER_TWO,Math.PI,s.PI_OVER_TWO)),E}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,i,a,o,u,s,E,c,_){"use strict";function l(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var T=new e,R=new e,f=new e,A=new e,h=new e,d=new e,N=new e,I=new e,S=new e,m=new e,y=new e,M=new e;l.fromPoints=function(t,n){if(i(n)||(n=new l),!i(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var r=e.clone(t[0],N),a=e.clone(r,T),o=e.clone(r,R),u=e.clone(r,f),s=e.clone(r,A),E=e.clone(r,h),c=e.clone(r,d),_=t.length,O=1;O<_;O++){e.clone(t[O],r);var p=r.x,C=r.y,U=r.z;p<a.x&&e.clone(r,a),p>s.x&&e.clone(r,s),C<o.y&&e.clone(r,o),C>E.y&&e.clone(r,E),U<u.z&&e.clone(r,u),U>c.z&&e.clone(r,c)}var g=e.magnitudeSquared(e.subtract(s,a,I)),L=e.magnitudeSquared(e.subtract(E,o,I)),w=e.magnitudeSquared(e.subtract(c,u,I)),x=a,v=s,P=g;L>P&&(P=L,x=o,v=E),w>P&&(P=w,x=u,v=c);var F=S;F.x=.5*(x.x+v.x),F.y=.5*(x.y+v.y),F.z=.5*(x.z+v.z);var B=e.magnitudeSquared(e.subtract(v,F,I)),D=Math.sqrt(B),z=m;z.x=a.x,z.y=o.y,z.z=u.z;var G=y;G.x=s.x,G.y=E.y,G.z=c.z;var b=e.multiplyByScalar(e.add(z,G,I),.5,M),V=0;for(O=0;O<_;O++){e.clone(t[O],r);var X=e.magnitude(e.subtract(r,b,I));X>V&&(V=X);var H=e.magnitudeSquared(e.subtract(r,F,I));if(H>B){var q=Math.sqrt(H);D=.5*(D+q),B=D*D;var W=q-D;F.x=(D*F.x+W*r.x)/q,F.y=(D*F.y+W*r.y)/q,F.z=(D*F.z+W*r.z)/q}}return D<V?(e.clone(F,n.center),n.radius=D):(e.clone(b,n.center),n.radius=V),n};var O=new o,p=new e,C=new e,U=new t,g=new t;l.fromRectangle2D=function(e,t,n){return l.fromRectangleWithHeights2D(e,t,0,0,n)},l.fromRectangleWithHeights2D=function(t,n,a,o,u){if(i(u)||(u=new l),!i(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;n=r(n,O),_.southwest(t,U),U.height=a,_.northeast(t,g),g.height=o;var s=n.project(U,p),E=n.project(g,C),c=E.x-s.x,T=E.y-s.y,R=E.z-s.z;u.radius=.5*Math.sqrt(c*c+T*T+R*R);var f=u.center;return f.x=s.x+.5*c,f.y=s.y+.5*T,f.z=s.z+.5*R,u};var L=[];l.fromRectangle3D=function(e,t,n,o){t=r(t,a.WGS84),n=r(n,0);var u;return i(e)&&(u=_.subsample(e,t,n,L)),l.fromPoints(u,o)},l.fromVertices=function(t,n,a,o){if(i(o)||(o=new l),!i(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;n=r(n,e.ZERO),a=r(a,3);var u=N;u.x=t[0]+n.x,u.y=t[1]+n.y,u.z=t[2]+n.z;for(var s=e.clone(u,T),E=e.clone(u,R),c=e.clone(u,f),_=e.clone(u,A),O=e.clone(u,h),p=e.clone(u,d),C=t.length,U=0;U<C;U+=a){var g=t[U]+n.x,L=t[U+1]+n.y,w=t[U+2]+n.z;u.x=g,u.y=L,u.z=w,g<s.x&&e.clone(u,s),g>_.x&&e.clone(u,_),L<E.y&&e.clone(u,E),L>O.y&&e.clone(u,O),w<c.z&&e.clone(u,c),w>p.z&&e.clone(u,p)}var x=e.magnitudeSquared(e.subtract(_,s,I)),v=e.magnitudeSquared(e.subtract(O,E,I)),P=e.magnitudeSquared(e.subtract(p,c,I)),F=s,B=_,D=x;v>D&&(D=v,F=E,B=O),P>D&&(D=P,F=c,B=p);var z=S;z.x=.5*(F.x+B.x),z.y=.5*(F.y+B.y),z.z=.5*(F.z+B.z);var G=e.magnitudeSquared(e.subtract(B,z,I)),b=Math.sqrt(G),V=m;V.x=s.x,V.y=E.y,V.z=c.z;var X=y;X.x=_.x,X.y=O.y,X.z=p.z;var H=e.multiplyByScalar(e.add(V,X,I),.5,M),q=0;for(U=0;U<C;U+=a){u.x=t[U]+n.x,u.y=t[U+1]+n.y,u.z=t[U+2]+n.z;var W=e.magnitude(e.subtract(u,H,I));W>q&&(q=W);var Y=e.magnitudeSquared(e.subtract(u,z,I));if(Y>G){var k=Math.sqrt(Y);b=.5*(b+k),G=b*b;var K=k-b;z.x=(b*z.x+K*u.x)/k,z.y=(b*z.y+K*u.y)/k,z.z=(b*z.z+K*u.z)/k}}return b<q?(e.clone(z,o.center),o.radius=b):(e.clone(H,o.center),o.radius=q),o},l.fromEncodedCartesianVertices=function(t,n,r){if(i(r)||(r=new l),!i(t)||!i(n)||t.length!==n.length||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var a=N;a.x=t[0]+n[0],a.y=t[1]+n[1],a.z=t[2]+n[2];for(var o=e.clone(a,T),u=e.clone(a,R),s=e.clone(a,f),E=e.clone(a,A),c=e.clone(a,h),_=e.clone(a,d),O=t.length,p=0;p<O;p+=3){var C=t[p]+n[p],U=t[p+1]+n[p+1],g=t[p+2]+n[p+2];a.x=C,a.y=U,a.z=g,C<o.x&&e.clone(a,o),C>E.x&&e.clone(a,E),U<u.y&&e.clone(a,u),U>c.y&&e.clone(a,c),g<s.z&&e.clone(a,s),g>_.z&&e.clone(a,_)}var L=e.magnitudeSquared(e.subtract(E,o,I)),w=e.magnitudeSquared(e.subtract(c,u,I)),x=e.magnitudeSquared(e.subtract(_,s,I)),v=o,P=E,F=L;w>F&&(F=w,v=u,P=c),x>F&&(F=x,v=s,P=_);var B=S;B.x=.5*(v.x+P.x),B.y=.5*(v.y+P.y),B.z=.5*(v.z+P.z);var D=e.magnitudeSquared(e.subtract(P,B,I)),z=Math.sqrt(D),G=m;G.x=o.x,G.y=u.y,G.z=s.z;var b=y;b.x=E.x,b.y=c.y,b.z=_.z;var V=e.multiplyByScalar(e.add(G,b,I),.5,M),X=0;for(p=0;p<O;p+=3){a.x=t[p]+n[p],a.y=t[p+1]+n[p+1],a.z=t[p+2]+n[p+2];var H=e.magnitude(e.subtract(a,V,I));H>X&&(X=H);var q=e.magnitudeSquared(e.subtract(a,B,I));if(q>D){var W=Math.sqrt(q);z=.5*(z+W),D=z*z;var Y=W-z;B.x=(z*B.x+Y*a.x)/W,B.y=(z*B.y+Y*a.y)/W,B.z=(z*B.z+Y*a.z)/W}}return z<X?(e.clone(B,r.center),r.radius=z):(e.clone(V,r.center),r.radius=X),r},l.fromCornerPoints=function(t,n,r){i(r)||(r=new l);var a=r.center;return e.add(t,n,a),e.multiplyByScalar(a,.5,a),r.radius=e.distance(a,n),r},l.fromEllipsoid=function(t,n){return i(n)||(n=new l),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var w=new e;l.fromBoundingSpheres=function(t,n){if(i(n)||(n=new l),!i(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var r=t.length;if(1===r)return l.clone(t[0],n);if(2===r)return l.union(t[0],t[1],n);for(var a=[],o=0;o<r;o++)a.push(t[o].center);n=l.fromPoints(a,n);var u=n.center,s=n.radius;for(o=0;o<r;o++){var E=t[o];s=Math.max(s,e.distance(u,E.center,w)+E.radius)}return n.radius=s,n};var x=new e,v=new e,P=new e;l.fromOrientedBoundingBox=function(t,n){i(n)||(n=new l);var r=t.halfAxes,a=E.getColumn(r,0,x),o=E.getColumn(r,1,v),u=E.getColumn(r,2,P),s=e.magnitude(a),c=e.magnitude(o),_=e.magnitude(u);return n.center=e.clone(t.center,n.center),n.radius=Math.max(s,c,_),n},l.clone=function(t,n){if(i(t))return i(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new l(t.center,t.radius)},l.packedLength=4,l.pack=function(e,t,n){n=r(n,0);var i=e.center;return t[n++]=i.x,t[n++]=i.y,t[n++]=i.z,t[n]=e.radius,t},l.unpack=function(e,t,n){t=r(t,0),i(n)||(n=new l);var a=n.center;return a.x=e[t++],a.y=e[t++],a.z=e[t++],n.radius=e[t],n};var F=new e,B=new e;l.union=function(t,n,r){i(r)||(r=new l);var a=t.center,o=t.radius,u=n.center,s=n.radius,E=e.subtract(u,a,F),c=e.magnitude(E);if(o>=c+s)return t.clone(r),r;if(s>=c+o)return n.clone(r),r;var _=.5*(o+c+s),T=e.multiplyByScalar(E,(-o+_)/c,B);return e.add(T,a,T),e.clone(T,r.center),r.radius=_,r};var D=new e;l.expand=function(t,n,r){r=l.clone(t,r);var i=e.magnitude(e.subtract(n,r.center,D));return i>r.radius&&(r.radius=i),r},l.intersectPlane=function(t,n){var r=t.center,i=t.radius,a=n.normal,o=e.dot(a,r)+n.distance;return o<-i?u.OUTSIDE:o<i?u.INTERSECTING:u.INSIDE},l.transform=function(e,t,n){return i(n)||(n=new l),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=c.getMaximumScale(t)*e.radius,n};var z=new e;l.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,z);return e.magnitudeSquared(r)-t.radius*t.radius},l.transformWithoutScale=function(e,t,n){return i(n)||(n=new l),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var G=new e;l.computePlaneDistances=function(t,n,r,a){i(a)||(a=new s);var o=e.subtract(t.center,n,G),u=e.dot(r,o);return a.start=u-t.radius,a.stop=u+t.radius,a};for(var b=new e,V=new e,X=new e,H=new e,q=new e,W=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var K=new o;return l.projectTo2D=function(t,n,i){n=r(n,K);var a=n.ellipsoid,o=t.center,u=t.radius,s=a.geodeticSurfaceNormal(o,b),E=e.cross(e.UNIT_Z,s,V);e.normalize(E,E);var c=e.cross(s,E,X);e.normalize(c,c),e.multiplyByScalar(s,u,s),e.multiplyByScalar(c,u,c),e.multiplyByScalar(E,u,E);var _=e.negate(c,q),T=e.negate(E,H),R=Y,f=R[0];e.add(s,c,f),e.add(f,E,f),f=R[1],e.add(s,c,f),e.add(f,T,f),f=R[2],e.add(s,_,f),e.add(f,T,f),f=R[3],e.add(s,_,f),e.add(f,E,f),e.negate(s,s),f=R[4],e.add(s,c,f),e.add(f,E,f),f=R[5],e.add(s,c,f),e.add(f,T,f),f=R[6],e.add(s,_,f),e.add(f,T,f),f=R[7],e.add(s,_,f),e.add(f,E,f);for(var A=R.length,h=0;h<A;++h){var d=R[h];e.add(o,d,d);var N=a.cartesianToCartographic(d,W);n.project(N,d)}i=l.fromPoints(R,i),o=i.center;var I=o.x,S=o.y,m=o.z;return o.x=m,o.y=I,o.z=S,i},l.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},l.equals=function(t,n){return t===n||i(t)&&i(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},l.prototype.intersectPlane=function(e){return l.intersectPlane(this,e)},l.prototype.distanceSquaredTo=function(e){return l.distanceSquaredTo(this,e)},l.prototype.computePlaneDistances=function(e,t,n){return l.computePlaneDistances(this,e,t,n)},l.prototype.isOccluded=function(e){return l.isOccluded(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.prototype.clone=function(e){return l.clone(this,e)},l}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},i={};return t(i,{element:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(i.supportsFullscreen())return null!==i.element}}}),i.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var i,a=["webkit","moz","o","ms","khtml"],o=0,u=a.length;o<u;++o){var s=a[o];i=s+"RequestFullscreen","function"==typeof t[i]?(r.requestFullscreen=i,n=!0):(i=s+"RequestFullScreen","function"==typeof t[i]&&(r.requestFullscreen=i,n=!0)),i=s+"ExitFullscreen","function"==typeof document[i]?r.exitFullscreen=i:(i=s+"CancelFullScreen","function"==typeof document[i]&&(r.exitFullscreen=i)),i=s+"FullscreenEnabled",void 0!==document[i]?r.fullscreenEnabled=i:(i=s+"FullScreenEnabled",void 0!==document[i]&&(r.fullscreenEnabled=i)),i=s+"FullscreenElement",void 0!==document[i]?r.fullscreenElement=i:(i=s+"FullScreenElement",void 0!==document[i]&&(r.fullscreenElement=i)),i=s+"fullscreenchange",void 0!==document["on"+i]&&("ms"===s&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=s+"fullscreenerror",void 0!==document["on"+i]&&("ms"===s&&(i="MSFullscreenError"),r.fullscreenerror=i)}return n},i.requestFullscreen=function(e,t){i.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},i.exitFullscreen=function(){i.supportsFullscreen()&&document[r.exitFullscreen]()},i}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function i(){if(!t(S)&&(S=!1,!l())){var e=/ Chrome\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(S=!0,m=r(e[1]))}return S}function a(){return i()&&m}function o(){if(!t(y)&&(y=!1,!i()&&!l()&&/ Safari\/[\.0-9]+/.test(I.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(y=!0,M=r(e[1]))}return y}function u(){return o()&&M}function s(){if(!t(O)){O=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(I.userAgent);null!==e&&(O=!0,p=r(e[1]),p.isNightly=!!e[2])}return O}function E(){return s()&&p}function c(){if(!t(C)){C=!1;var e;"Microsoft Internet Explorer"===I.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==e&&(C=!0,U=r(e[1]))):"Netscape"===I.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==e&&(C=!0,U=r(e[1])))}return C}function _(){return c()&&U}function l(){if(!t(g)){g=!1;var e=/ Edge\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(g=!0,L=r(e[1]))}return g}function T(){return l()&&L}function R(){if(!t(w)){w=!1;var e=/Firefox\/([\.0-9]+)/.exec(I.userAgent); +null!==e&&(w=!0,x=r(e[1]))}return w}function f(){return t(v)||(v=/Windows/i.test(I.appVersion)),v}function A(){return R()&&x}function h(){return t(P)||(P="undefined"!=typeof PointerEvent&&(!t(I.pointerEnabled)||I.pointerEnabled)),P}function d(){if(!t(B)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;B=t(n)&&""!==n,B&&(F=n)}return B}function N(){return d()?F:void 0}var I;I="undefined"!=typeof navigator?navigator:{};var S,m,y,M,O,p,C,U,g,L,w,x,v,P,F,B,D={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:E,isInternetExplorer:c,internetExplorerVersion:_,isEdge:l,edgeVersion:T,isFirefox:R,firefoxVersion:A,isWindows:f,hardwareConcurrency:e(I.hardwareConcurrency,3),supportsPointerEvents:h,supportsImageRenderingPixelated:d,imageRenderingValue:N};return D.supportsFullscreen=function(){return n.supportsFullscreen()},D.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},D.supportsWebWorkers=function(){return"undefined"!=typeof Worker},D}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,i,a){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:a.BYTE,UNSIGNED_BYTE:a.UNSIGNED_BYTE,SHORT:a.SHORT,UNSIGNED_SHORT:a.UNSIGNED_SHORT,INT:a.INT,UNSIGNED_INT:a.UNSIGNED_INT,FLOAT:a.FLOAT,DOUBLE:a.DOUBLE};return o.getSizeInBytes=function(e){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.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},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 Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,i){switch(r=e(r,0),i=e(i,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,i);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,i);case o.SHORT:return new Int16Array(n,r,i);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,i);case o.INT:return new Int32Array(n,r,i);case o.UNSIGNED_INT:return new Uint32Array(n,r,i);case o.FLOAT:return new Float32Array(n,r,i);case o.DOUBLE:return new Float64Array(n,r,i)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},i(o)}),define("Core/Quaternion",["./Cartesian3","./Check","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math","./Matrix3"],function(e,t,n,r,i,a,o,u,s){"use strict";function E(e,t,r,i){this.x=n(e,0),this.y=n(t,0),this.z=n(r,0),this.w=n(i,0)}var c=new e;E.fromAxisAngle=function(t,n,i){var a=n/2,o=Math.sin(a);c=e.normalize(t,c);var u=c.x*o,s=c.y*o,_=c.z*o,l=Math.cos(a);return r(i)?(i.x=u,i.y=s,i.z=_,i.w=l,i):new E(u,s,_,l)};var _=[1,2,0],l=new Array(3);E.fromRotationMatrix=function(e,t){var n,i,a,o,u,c=e[s.COLUMN0ROW0],T=e[s.COLUMN1ROW1],R=e[s.COLUMN2ROW2],f=c+T+R;if(f>0)n=Math.sqrt(f+1),u=.5*n,n=.5/n,i=(e[s.COLUMN1ROW2]-e[s.COLUMN2ROW1])*n,a=(e[s.COLUMN2ROW0]-e[s.COLUMN0ROW2])*n,o=(e[s.COLUMN0ROW1]-e[s.COLUMN1ROW0])*n;else{var A=_,h=0;T>c&&(h=1),R>c&&R>T&&(h=2);var d=A[h],N=A[d];n=Math.sqrt(e[s.getElementIndex(h,h)]-e[s.getElementIndex(d,d)]-e[s.getElementIndex(N,N)]+1);var I=l;I[h]=.5*n,n=.5/n,u=(e[s.getElementIndex(N,d)]-e[s.getElementIndex(d,N)])*n,I[d]=(e[s.getElementIndex(d,h)]+e[s.getElementIndex(h,d)])*n,I[N]=(e[s.getElementIndex(N,h)]+e[s.getElementIndex(h,N)])*n,i=-I[0],a=-I[1],o=-I[2]}return r(t)?(t.x=i,t.y=a,t.z=o,t.w=u,t):new E(i,a,o,u)};var T=new E;E.fromHeadingPitchRoll=function(t,n,r,i){var a=E.fromAxisAngle(e.UNIT_X,r,T),o=E.fromAxisAngle(e.UNIT_Y,-n,i);i=E.multiply(o,a,o);var u=E.fromAxisAngle(e.UNIT_Z,-t,T);return E.multiply(u,i,i)};var R=new e,f=new e,A=new E,h=new E,d=new E;E.packedLength=4,E.pack=function(e,t,r){return r=n(r,0),t[r++]=e.x,t[r++]=e.y,t[r++]=e.z,t[r]=e.w,t},E.unpack=function(e,t,i){return t=n(t,0),r(i)||(i=new E),i.x=e[t],i.y=e[t+1],i.z=e[t+2],i.w=e[t+3],i},E.packedInterpolationLength=3,E.convertPackedArrayForInterpolation=function(e,t,n,r){E.unpack(e,4*n,d),E.conjugate(d,d);for(var i=0,a=n-t+1;i<a;i++){var o=3*i;E.unpack(e,4*(t+i),A),E.multiply(A,d,A),A.w<0&&E.negate(A,A),E.computeAxis(A,R);var u=E.computeAngle(A);r[o]=R.x*u,r[o+1]=R.y*u,r[o+2]=R.z*u}},E.unpackInterpolationResult=function(t,n,i,a,o){r(o)||(o=new E),e.fromArray(t,0,f);var u=e.magnitude(f);return E.unpack(n,4*a,h),0===u?E.clone(E.IDENTITY,A):E.fromAxisAngle(f,u,A),E.multiply(A,h,o)},E.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new E(e.x,e.y,e.z,e.w)},E.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},E.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},E.magnitude=function(e){return Math.sqrt(E.magnitudeSquared(e))},E.normalize=function(e,t){var n=1/E.magnitude(e),r=e.x*n,i=e.y*n,a=e.z*n,o=e.w*n;return t.x=r,t.y=i,t.z=a,t.w=o,t},E.inverse=function(e,t){var n=E.magnitudeSquared(e);return t=E.conjugate(e,t),E.multiplyByScalar(t,1/n,t)},E.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},E.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},E.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},E.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},E.multiply=function(e,t,n){var r=e.x,i=e.y,a=e.z,o=e.w,u=t.x,s=t.y,E=t.z,c=t.w,_=o*u+r*c+i*E-a*s,l=o*s-r*E+i*c+a*u,T=o*E+r*s-i*u+a*c,R=o*c-r*u-i*s-a*E;return n.x=_,n.y=l,n.z=T,n.w=R,n},E.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},E.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},E.computeAxis=function(e,t){var n=e.w;if(Math.abs(n-1)<u.EPSILON6)return t.x=t.y=t.z=0,t;var r=1/Math.sqrt(1-n*n);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},E.computeAngle=function(e){return Math.abs(e.w-1)<u.EPSILON6?0:2*Math.acos(e.w)};var N=new E;E.lerp=function(e,t,n,r){return N=E.multiplyByScalar(t,n,N),r=E.multiplyByScalar(e,1-n,r),E.add(N,r,r)};var I=new E,S=new E,m=new E;E.slerp=function(e,t,n,r){var i=E.dot(e,t),a=t;if(i<0&&(i=-i,a=I=E.negate(t,I)),1-i<u.EPSILON6)return E.lerp(e,a,n,r);var o=Math.acos(i);return S=E.multiplyByScalar(e,Math.sin((1-n)*o),S),m=E.multiplyByScalar(a,Math.sin(n*o),m),r=E.add(S,m,r),E.multiplyByScalar(r,1/Math.sin(o),r)},E.log=function(t,n){var r=u.acosClamped(t.w),i=0;return 0!==r&&(i=r/Math.sin(r)),e.multiplyByScalar(t,i,n)},E.exp=function(t,n){var r=e.magnitude(t),i=0;return 0!==r&&(i=Math.sin(r)/r),n.x=t.x*i,n.y=t.y*i,n.z=t.z*i,n.w=Math.cos(r),n};var y=new e,M=new e,O=new E,p=new E;E.computeInnerQuadrangle=function(t,n,r,i){var a=E.conjugate(n,O);E.multiply(a,r,p);var o=E.log(p,y);E.multiply(a,t,p);var u=E.log(p,M);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),E.exp(o,O),E.multiply(n,O,i)},E.squad=function(e,t,n,r,i,a){var o=E.slerp(e,t,i,O),u=E.slerp(n,r,i,p);return E.slerp(o,u,2*i*(1-i),a)};for(var C=new E,U=1.9011074535173003,g=a.supportsTypedArrays()?new Float32Array(8):[],L=a.supportsTypedArrays()?new Float32Array(8):[],w=a.supportsTypedArrays()?new Float32Array(8):[],x=a.supportsTypedArrays()?new Float32Array(8):[],v=0;v<7;++v){var P=v+1,F=2*P+1;g[v]=1/(P*F),L[v]=P/F}return g[7]=U/136,L[7]=8*U/17,E.fastSlerp=function(e,t,n,r){var i,a=E.dot(e,t);a>=0?i=1:(i=-1,a=-a);for(var o=a-1,u=1-n,s=n*n,c=u*u,_=7;_>=0;--_)w[_]=(g[_]*s-L[_])*o,x[_]=(g[_]*c-L[_])*o;var l=i*n*(1+w[0]*(1+w[1]*(1+w[2]*(1+w[3]*(1+w[4]*(1+w[5]*(1+w[6]*(1+w[7])))))))),T=u*(1+x[0]*(1+x[1]*(1+x[2]*(1+x[3]*(1+x[4]*(1+x[5]*(1+x[6]*(1+x[7])))))))),R=E.multiplyByScalar(e,T,C);return E.multiplyByScalar(t,l,r),E.add(R,r,r)},E.fastSquad=function(e,t,n,r,i,a){var o=E.fastSlerp(e,t,i,O),u=E.fastSlerp(n,r,i,p);return E.fastSlerp(o,u,2*i*(1-i),a)},E.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},E.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n},E.ZERO=o(new E(0,0,0,0)),E.IDENTITY=o(new E(0,0,0,1)),E.prototype.clone=function(e){return E.clone(this,e)},E.prototype.equals=function(e){return E.equals(this,e)},E.prototype.equalsEpsilon=function(e,t){return E.equalsEpsilon(this,e,t)},E.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},E}),define("Core/EllipseGeometryLibrary",["./Cartesian3","./Math","./Matrix3","./Quaternion"],function(e,t,n,r){"use strict";function i(t,i,a,c,_,l,T,R,f,A){var h=t+i;e.multiplyByScalar(c,Math.cos(h),o),e.multiplyByScalar(a,Math.sin(h),u),e.add(o,u,o);var d=Math.cos(t);d*=d;var N=Math.sin(t);N*=N;var I=l/Math.sqrt(T*d+_*N),S=I/R;return r.fromAxisAngle(o,S,s),n.fromQuaternion(s,E),n.multiplyByVector(E,f,A),e.normalize(A,A),e.multiplyByScalar(A,R,A),A}var a={},o=new e,u=new e,s=new r,E=new n,c=new e,_=new e,l=new e,T=new e;a.raisePositionsToHeight=function(t,n,r){for(var i=n.ellipsoid,a=n.height,o=n.extrudedHeight,u=r?t.length/3*2:t.length/3,s=new Float64Array(3*u),E=t.length,R=r?E:0,f=0;f<E;f+=3){var A=f+1,h=f+2,d=e.fromArray(t,f,c);i.scaleToGeodeticSurface(d,d);var N=e.clone(d,_),I=i.geodeticSurfaceNormal(d,T),S=e.multiplyByScalar(I,a,l);e.add(d,S,d),r&&(e.multiplyByScalar(I,o,S),e.add(N,S,N),s[f+R]=N.x,s[A+R]=N.y,s[h+R]=N.z),s[f]=d.x,s[A]=d.y,s[h]=d.z}return s};var R=new e,f=new e,A=new e;return a.computeEllipsePositions=function(n,r,a){var o=n.semiMinorAxis,u=n.semiMajorAxis,s=n.rotation,E=n.center,T=8*n.granularity,h=o*o,d=u*u,N=u*o,I=e.magnitude(E),S=e.normalize(E,R),m=e.cross(e.UNIT_Z,E,f);m=e.normalize(m,m);var y=e.cross(S,m,A),M=1+Math.ceil(t.PI_OVER_TWO/T),O=t.PI_OVER_TWO/(M-1),p=t.PI_OVER_TWO-M*O;p<0&&(M-=Math.ceil(Math.abs(p)/O));var C,U,g,L,w,x=2*(M*(M+2)),v=r?new Array(3*x):void 0,P=0,F=c,B=_,D=4*M*3,z=D-1,G=0,b=a?new Array(D):void 0;for(p=t.PI_OVER_TWO,F=i(p,s,y,m,h,N,d,I,S,F),r&&(v[P++]=F.x,v[P++]=F.y,v[P++]=F.z),a&&(b[z--]=F.z,b[z--]=F.y,b[z--]=F.x),p=t.PI_OVER_TWO-O,C=1;C<M+1;++C){if(F=i(p,s,y,m,h,N,d,I,S,F),B=i(Math.PI-p,s,y,m,h,N,d,I,S,B),r){for(v[P++]=F.x,v[P++]=F.y,v[P++]=F.z,g=2*C+2,U=1;U<g-1;++U)L=U/(g-1),w=e.lerp(F,B,L,l),v[P++]=w.x,v[P++]=w.y,v[P++]=w.z;v[P++]=B.x,v[P++]=B.y,v[P++]=B.z}a&&(b[z--]=F.z,b[z--]=F.y,b[z--]=F.x,b[G++]=B.x,b[G++]=B.y,b[G++]=B.z),p=t.PI_OVER_TWO-(C+1)*O}for(C=M;C>1;--C){if(p=t.PI_OVER_TWO-(C-1)*O,F=i(-p,s,y,m,h,N,d,I,S,F),B=i(p+Math.PI,s,y,m,h,N,d,I,S,B),r){for(v[P++]=F.x,v[P++]=F.y,v[P++]=F.z,g=2*(C-1)+2,U=1;U<g-1;++U)L=U/(g-1),w=e.lerp(F,B,L,l),v[P++]=w.x,v[P++]=w.y,v[P++]=w.z;v[P++]=B.x,v[P++]=B.y,v[P++]=B.z}a&&(b[z--]=F.z,b[z--]=F.y,b[z--]=F.x,b[G++]=B.x,b[G++]=B.y,b[G++]=B.z)}p=t.PI_OVER_TWO,F=i(-p,s,y,m,h,N,d,I,S,F);var V={};return r&&(v[P++]=F.x,v[P++]=F.y,v[P++]=F.z,V.positions=v,V.numPts=M),a&&(b[z--]=F.z,b[z--]=F.y,b[z--]=F.x,V.outerPositions=b),V},a}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===n.POINTS||e===n.LINES||e===n.LINE_LOOP||e===n.LINE_STRIP||e===n.TRIANGLES||e===n.TRIANGLE_STRIP||e===n.TRIANGLE_FAN}};return e(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,i){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,i.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return a.computeNumberOfVertices=function(e){var n=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var i=e.attributes[r],a=i.values.length/i.componentsPerAttribute;n=a}return n},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(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 r}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,n,r,i){"use strict";var a={UNSIGNED_BYTE:i.UNSIGNED_BYTE,UNSIGNED_SHORT:i.UNSIGNED_SHORT,UNSIGNED_INT:i.UNSIGNED_INT};return a.getSizeInBytes=function(e){switch(e){case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},a.validate=function(t){return e(t)&&(t===a.UNSIGNED_BYTE||t===a.UNSIGNED_SHORT||t===a.UNSIGNED_INT)},a.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},a.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)},n(a)}),define("Core/EllipseOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EllipseGeometryLibrary","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType"],function(e,t,n,r,i,a,o,u,s,E,c,_,l,T){"use strict";function R(r){var i=r.center;d=t.multiplyByScalar(r.ellipsoid.geodeticSurfaceNormal(i,d),r.height,d),d=t.add(i,d,d);for(var a=new e(d,r.semiMajorAxis),u=o.computeEllipsePositions(r,!1,!0).outerPositions,s=new c({position:new E({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:o.raisePositionsToHeight(u,r,!1)})}),l=u.length/3,T=_.createTypedArray(l,2*l),R=0,f=0;f<l;++f)T[R++]=f,T[R++]=(f+1)%l;return{boundingSphere:a,attributes:s,indices:T}}function f(i){var a=i.center,u=i.ellipsoid,s=i.semiMajorAxis,T=t.multiplyByScalar(u.geodeticSurfaceNormal(a,h),i.height,h);N.center=t.add(a,T,N.center),N.radius=s,T=t.multiplyByScalar(u.geodeticSurfaceNormal(a,T),i.extrudedHeight,T),I.center=t.add(a,T,I.center),I.radius=s;var R=o.computeEllipsePositions(i,!1,!0).outerPositions,f=new c({position:new E({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:o.raisePositionsToHeight(R,i,!0)})});R=f.position.values;var A=e.union(N,I),d=R.length/3,S=r(i.numberOfVerticalLines,16);S=l.clamp(S,0,d/2);var m=_.createTypedArray(d,2*d+2*S);d/=2;var y,M=0;for(y=0;y<d;++y)m[M++]=y,m[M++]=(y+1)%d,m[M++]=y+d,m[M++]=(y+1)%d+d;var O;if(S>0){var p=Math.min(S,d);O=Math.round(d/p);var C=Math.min(O*S,d);for(y=0;y<C;y+=O)m[M++]=y,m[M++]=y+d}return{boundingSphere:A,attributes:f,indices:m}}function A(e){e=r(e,r.EMPTY_OBJECT);var n=e.center,a=r(e.ellipsoid,u.WGS84),o=e.semiMajorAxis,s=e.semiMinorAxis,E=r(e.granularity,l.RADIANS_PER_DEGREE),c=r(e.height,0),_=e.extrudedHeight,T=i(_)&&Math.abs(c-_)>1;this._center=t.clone(n),this._semiMajorAxis=o,this._semiMinorAxis=s,this._ellipsoid=u.clone(a),this._rotation=r(e.rotation,0),this._height=c,this._granularity=E,this._extrudedHeight=_,this._extrude=T,this._numberOfVerticalLines=Math.max(r(e.numberOfVerticalLines,16),0),this._workerName="createEllipseOutlineGeometry"}var h=new t,d=new t,N=new e,I=new e;A.packedLength=t.packedLength+u.packedLength+9,A.pack=function(e,n,a){return a=r(a,0),t.pack(e._center,n,a),a+=t.packedLength,u.pack(e._ellipsoid,n,a),a+=u.packedLength,n[a++]=e._semiMajorAxis,n[a++]=e._semiMinorAxis,n[a++]=e._rotation,n[a++]=e._height,n[a++]=e._granularity,n[a++]=i(e._extrudedHeight)?1:0,n[a++]=r(e._extrudedHeight,0),n[a++]=e._extrude?1:0,n[a]=e._numberOfVerticalLines,n};var S=new t,m=new u,y={center:S,ellipsoid:m,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0};return A.unpack=function(e,n,a){n=r(n,0);var o=t.unpack(e,n,S);n+=t.packedLength;var s=u.unpack(e,n,m);n+=u.packedLength;var E=e[n++],c=e[n++],_=e[n++],l=e[n++],T=e[n++],R=e[n++],f=e[n++],h=1===e[n++],d=e[n];return i(a)?(a._center=t.clone(o,a._center),a._ellipsoid=u.clone(s,a._ellipsoid),a._semiMajorAxis=E,a._semiMinorAxis=c,a._rotation=_,a._height=l,a._granularity=T,a._extrudedHeight=R?f:void 0,a._extrude=h,a._numberOfVerticalLines=d,a):(y.height=l,y.extrudedHeight=R?f:void 0,y.granularity=T,y.rotation=_,y.semiMajorAxis=E,y.semiMinorAxis=c,y.numberOfVerticalLines=d,new A(y))},A.createGeometry=function(e){if(!(e._semiMajorAxis<=0||e._semiMinorAxis<=0)){e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);var t,n={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:e._height,extrudedHeight:e._extrudedHeight,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines};return e._extrude?(n.extrudedHeight=Math.min(e._extrudedHeight,e._height),n.height=Math.max(e._extrudedHeight,e._height),t=f(n)):t=R(n),new s({attributes:t.attributes,indices:t.indices,primitiveType:T.LINES,boundingSphere:t.boundingSphere})}},A}),define("Core/CircleOutlineGeometry",["./Cartesian3","./Check","./defaultValue","./defined","./DeveloperError","./EllipseOutlineGeometry","./Ellipsoid"],function(e,t,n,r,i,a,o){"use strict";function u(e){e=n(e,n.EMPTY_OBJECT);var t=e.radius,r={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity, +numberOfVerticalLines:e.numberOfVerticalLines};this._ellipseGeometry=new a(r),this._workerName="createCircleOutlineGeometry"}u.packedLength=a.packedLength,u.pack=function(e,t,n){return a.pack(e._ellipseGeometry,t,n)};var s=new a({center:new e,semiMajorAxis:1,semiMinorAxis:1}),E={center:new e,radius:void 0,ellipsoid:o.clone(o.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};return u.unpack=function(t,n,i){var c=a.unpack(t,n,s);return E.center=e.clone(c._center,E.center),E.ellipsoid=o.clone(c._ellipsoid,E.ellipsoid),E.height=c._height,E.extrudedHeight=c._extrudedHeight,E.granularity=c._granularity,E.numberOfVerticalLines=c._numberOfVerticalLines,r(i)?(E.semiMajorAxis=c._semiMajorAxis,E.semiMinorAxis=c._semiMinorAxis,i._ellipseGeometry=new a(E),i):(E.radius=c._semiMajorAxis,new u(E))},u.createGeometry=function(e){return a.createGeometry(e._ellipseGeometry)},u}),define("Workers/createCircleOutlineGeometry",["../Core/Cartesian3","../Core/CircleOutlineGeometry","../Core/defined","../Core/Ellipsoid"],function(e,t,n,r){"use strict";function i(i,a){return n(a)&&(i=t.unpack(i,a)),i._ellipseGeometry._center=e.clone(i._ellipseGeometry._center),i._ellipseGeometry._ellipsoid=r.clone(i._ellipseGeometry._ellipsoid),t.createGeometry(i)}return i})}(); \ No newline at end of file diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createCorridorGeometry.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createCorridorGeometry.js index 2266a5b9..f20979b0 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createCorridorGeometry.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createCorridorGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -222,9 +222,9 @@ OTHER DEALINGS IN THE SOFTWARE. * */ -!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==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";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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 n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(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^=e<<7&2636928640,e^=e<<15&4022730752,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,n,r){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:e<0?-1:0},a.signNotZero=function(e){return e<0?-1:1},a.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*a.clamp(e,-1,1)+.5)*n)},a.fromSNorm=function(e,n){return n=t(n,255),a.clamp(e,0,n)/n*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},a.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},a.lerp=function(e,t,n){return(1-n)*e+n*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){var t=a.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},a.clampToLatitudeRange=function(e){return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){return(e%t+t)%t},a.equalsEpsilon=function(e,n,r,a){a=t(a,r);var i=Math.abs(e-n);return i<=a||i<=r*Math.max(Math.abs(e),Math.abs(n))};var i=[1];a.factorial=function(e){var t=i.length;if(e>=t)for(var n=i[t-1],r=t;r<=e;r++)i.push(n*r);return i[e]},a.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},a.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return a.setRandomNumberSeed=function(t){o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(e){return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){return Math.log(e)/Math.log(t)},a.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},a}),define("Core/arrayRemoveDuplicates",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(n,r,a){if(t(n)){a=e(a,!1);var o=n.length;if(o<2)return n;var u,s,c;for(u=1;u<o&&(s=n[u-1],c=n[u],!r(s,c,i));++u);if(u===o)return a&&r(n[0],n[n.length-1],i)?n.slice(1):n;for(var l=n.slice(0,u);u<o;++u)c=n[u],r(s,c,i)||(l.push(c),s=c);return a&&l.length>1&&r(l[0],l[l.length-1],i)&&l.shift(),l}}var i=r.EPSILON10;return a}),define("Core/isArray",["./defined"],function(e){"use strict";var t=Array.isArray;return e(t)||(t=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),t}),define("Core/Check",["./defaultValue","./defined","./DeveloperError","./isArray"],function(e,t,n,r){"use strict";function a(e){return e+" was required but undefined."}function i(e,t,n){return"Expected "+n+" to be typeof "+t+", got "+e}var o={};return o.typeOf={},o.numeric={},o.defined=function(e,r){if(!t(e))throw new n(a(r))},o.numeric.maximum=function(e,t){if(o.typeOf.number(e),o.typeOf.number(t),e>t)throw new n("Expected "+e+" to be at most "+t)},o.numeric.minimum=function(e,t){if(o.typeOf.number(e),o.typeOf.number(t),e<t)throw new n("Expected "+e+" to be at least "+t)},o.typeOf.function=function(e,t){if("function"!=typeof e)throw new n(i(typeof e,"function",t))},o.typeOf.string=function(e,t){if("string"!=typeof e)throw new n(i(typeof e,"string",t))},o.typeOf.number=function(e,t){if("number"!=typeof e)throw new n(i(typeof e,"number",t))},o.typeOf.object=function(e,t){if("object"!=typeof e)throw new n(i(typeof e,"object",t))},o.typeOf.boolean=function(e,t){if("boolean"!=typeof e)throw new n(i(typeof e,"boolean",t))},o}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var a=e.clock,i=e.cone,u=t(e.magnitude,1),s=u*Math.sin(i);return r.x=s*Math.cos(a),r.y=s*Math.sin(a),r.z=u*Math.cos(i),r},o.fromElements=function(e,t,r,a){return n(a)?(a.x=e,a.y=t,a.z=r,a):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var a=0;a<r;++a)o.pack(e[a],t,3*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var a=0;a<r;a+=3){var i=a/3;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,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};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var n=o.dot(c,l),r=o.magnitude(o.cross(c,l,c));return Math.atan2(r,n)};var f=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)},o.cross=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=t.x,u=t.y,s=t.z,c=a*s-i*u,l=i*o-r*s,f=r*u-a*o;return n.x=c,n.y=l,n.z=f,n},o.fromDegrees=function(e,t,n,r,a){return e=i.toRadians(e),t=i.toRadians(t),o.fromRadians(e,t,n,r,a)};var d=new o,h=new o,E=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,a,i,u){a=t(a,0);var s=n(i)?i.radiiSquared:E,c=Math.cos(r);d.x=c*Math.cos(e),d.y=c*Math.sin(e),d.z=Math.sin(r),d=o.normalize(d,d),o.multiplyComponents(s,d,h);var l=Math.sqrt(o.dot(d,h));return h=o.divideByScalar(h,l,h),d=o.multiplyByScalar(d,a,d),n(u)||(u=new o),o.add(h,d,u)},o.fromDegreesArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromDegrees(u,s,0,t,r[c])}return r},o.fromRadiansArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromRadians(u,s,0,t,r[c])}return r},o.fromDegreesArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromDegrees(u,s,c,t,r[l])}return r},o.fromRadiansArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromRadians(u,s,c,t,r[l])}return r},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(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,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(n,a,u,s,c){var l=n.x,f=n.y,d=n.z,h=a.x,E=a.y,m=a.z,p=l*l*h*h,y=f*f*E*E,_=d*d*m*m,T=p+y+_,R=Math.sqrt(1/T),A=e.multiplyByScalar(n,R,i);if(T<s)return isFinite(R)?e.clone(A,c):void 0;var v=u.x,S=u.y,g=u.z,N=o;N.x=A.x*v*2,N.y=A.y*S*2,N.z=A.z*g*2;var I,O,M,x,w,C,P,D,U,L,F,z=(1-R)*e.magnitude(n)/(.5*e.magnitude(N)),B=0;do{z-=B,M=1/(1+z*v),x=1/(1+z*S),w=1/(1+z*g),C=M*M,P=x*x,D=w*w,U=C*M,L=P*x,F=D*w,I=p*C+y*P+_*D-1,O=p*U*v+y*L*S+_*F*g;var b=-2*O;B=I/b}while(Math.abs(I)>r.EPSILON12);return t(c)?(c.x=l*M,c.y=f*x,c.z=d*w,c):new e(l*M,f*x,d*w)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o){"use strict";function u(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)}u.fromRadians=function(e,r,a,i){return a=t(a,0),n(i)?(i.longitude=e,i.latitude=r,i.height=a,i):new u(e,r,a)},u.fromDegrees=function(e,t,n,r){return e=i.toRadians(e),t=i.toRadians(t),u.fromRadians(e,t,n,r)};var s=new e,c=new e,l=new e,f=new e(1/6378137,1/6378137,1/6356752.314245179),d=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),h=i.EPSILON1;return u.fromCartesian=function(t,r,a){var E=n(r)?r.oneOverRadii:f,m=n(r)?r.oneOverRadiiSquared:d,p=n(r)?r._centerToleranceSquared:h,y=o(t,E,m,p,c);if(n(y)){var _=e.multiplyComponents(y,m,s);_=e.normalize(_,_);var T=e.subtract(t,y,l),R=Math.atan2(_.y,_.x),A=Math.asin(_.z),v=i.sign(e.dot(T,t))*e.magnitude(T);return n(a)?(a.longitude=R,a.latitude=A,a.height=v,a):new u(R,A,v)}},u.clone=function(e,t){if(n(e))return n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},u.ZERO=a(new u(0,0,0)),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,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(t,r,a,i){r=n(r,0),a=n(a,0),i=n(i,0),t._radii=new e(r,a,i),t._radiiSquared=new e(r*r,a*a,i*i),t._radiiToTheFourth=new e(r*r*r*r,a*a*a*a,i*i*i*i),t._oneOverRadii=new e(0===r?0:1/r,0===a?0:1/a,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===a?0:1/(a*a),0===i?0:1/(i*i)),t._minimumRadius=Math.min(r,a,i),t._maximumRadius=Math.max(r,a,i),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,c(this,e,t,n)}a(l.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}}}),l.clone=function(t,n){if(r(t)){var a=t._radii;return r(n)?(e.clone(a,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new l(a.x,a.y,a.z)}},l.fromCartesian3=function(e,t){return r(t)||(t=new l),r(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,r,a){return a=n(a,0),e.pack(t._radii,r,a),r},l.unpack=function(t,r,a){r=n(r,0);var i=e.unpack(t,r);return l.fromCartesian3(i,a)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,n){var a=t.longitude,i=t.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return r(n)||(n=new e),n.x=u,n.y=s,n.z=c,e.normalize(n,n)},l.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var f=new e,d=new e;l.prototype.cartographicToCartesian=function(t,n){var a=f,i=d;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(e.dot(a,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(a,t.height,a),r(n)||(n=new e),e.add(i,a,n)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var h=new e,E=new e,m=new e;return l.prototype.cartesianToCartographic=function(n,a){var i=this.scaleToGeodeticSurface(n,E);if(r(i)){var o=this.geodeticSurfaceNormal(i,h),s=e.subtract(n,i,m),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),f=u.sign(e.dot(s,n))*e.magnitude(s);return r(a)?(a.longitude=c,a.latitude=l,a.height=f,a):new t(c,l,f)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var a=t.x,i=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return e.multiplyByScalar(t,s,n)},l.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},l.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},l.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,a,i){a=n(a,0);var o=this._sqauredXOverSquaredZ;if(r(i)||(i=new e),i.x=0,i.y=0,i.z=t.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},l}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,a,i,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return r(n)?(n.x=i,n.y=o,n.z=u,n):new e(i,o,u)},u.prototype.unproject=function(e,n){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,u=e.z;return r(n)?(n.longitude=i,n.latitude=o,n.height=u,n):new t(i,o,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";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i,o){"use strict";function u(e,n,r,a,i,o,u,s,c){this[0]=t(e,0),this[1]=t(a,0),this[2]=t(u,0),this[3]=t(n,0),this[4]=t(i,0),this[5]=t(s,0),this[6]=t(r,0),this[7]=t(o,0),this[8]=t(c,0)}function s(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function c(e){for(var t=0,n=0;n<3;++n){var r=e[u.getElementIndex(E[n],h[n])];t+=2*r*r}return Math.sqrt(t)}function l(e,t){for(var n=o.EPSILON15,r=0,a=1,i=0;i<3;++i){var s=Math.abs(e[u.getElementIndex(E[i],h[i])]);s>r&&(a=i,r=s)}var c=1,l=0,f=h[a],d=E[a];if(Math.abs(e[u.getElementIndex(d,f)])>n){var m,p=e[u.getElementIndex(d,d)],y=e[u.getElementIndex(f,f)],_=e[u.getElementIndex(d,f)],T=(p-y)/2/_;m=T<0?-1/(-T+Math.sqrt(1+T*T)):1/(T+Math.sqrt(1+T*T)),c=1/Math.sqrt(1+m*m),l=m*c}return t=u.clone(u.IDENTITY,t),t[u.getElementIndex(f,f)]=t[u.getElementIndex(d,d)]=c,t[u.getElementIndex(d,f)]=l,t[u.getElementIndex(f,d)]=-l,t}u.packedLength=9,u.pack=function(e,n,r){return r=t(r,0),n[r++]=e[0],n[r++]=e[1],n[r++]=e[2],n[r++]=e[3],n[r++]=e[4],n[r++]=e[5],n[r++]=e[6],n[r++]=e[7],n[r++]=e[8],n},u.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new u),a[0]=e[r++],a[1]=e[r++],a[2]=e[r++],a[3]=e[r++],a[4]=e[r++],a[5]=e[r++],a[6]=e[r++],a[7]=e[r++],a[8]=e[r++],a},u.clone=function(e,t){if(n(e))return n(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 u(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},u.fromArray=function(e,r,a){return r=t(r,0),n(a)||(a=new u),a[0]=e[r],a[1]=e[r+1],a[2]=e[r+2],a[3]=e[r+3],a[4]=e[r+4],a[5]=e[r+5],a[6]=e[r+6],a[7]=e[r+7],a[8]=e[r+8],a},u.fromColumnMajorArray=function(e,t){return u.clone(e,t)},u.fromRowMajorArray=function(e,t){return n(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 u(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},u.fromQuaternion=function(e,t){var r=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,s=e.y*e.y,c=e.y*e.z,l=e.y*e.w,f=e.z*e.z,d=e.z*e.w,h=e.w*e.w,E=r-s-f+h,m=2*(a-d),p=2*(i+l),y=2*(a+d),_=-r+s-f+h,T=2*(c-o),R=2*(i-l),A=2*(c+o),v=-r-s+f+h;return n(t)?(t[0]=E,t[1]=y,t[2]=R,t[3]=m,t[4]=_,t[5]=A,t[6]=p,t[7]=T,t[8]=v,t):new u(E,m,p,y,_,T,R,A,v)},u.fromHeadingPitchRoll=function(e,t){var r=Math.cos(-e.pitch),a=Math.cos(-e.heading),i=Math.cos(e.roll),o=Math.sin(-e.pitch),s=Math.sin(-e.heading),c=Math.sin(e.roll),l=r*a,f=-i*s+c*o*a,d=c*s+i*o*a,h=r*s,E=i*a+c*o*s,m=-o*i+i*o*s,p=-o,y=c*r,_=i*r;return n(t)?(t[0]=l,t[1]=h,t[2]=p,t[3]=f,t[4]=E,t[5]=y,t[6]=d,t[7]=m,t[8]=_,t):new u(l,f,d,h,E,m,p,y,_)},u.fromScale=function(e,t){return n(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 u(e.x,0,0,0,e.y,0,0,0,e.z)},u.fromUniformScale=function(e,t){return n(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 u(e,0,0,0,e,0,0,0,e)},u.fromCrossProduct=function(e,t){return n(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 u(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},u.fromRotationX=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=r,t[5]=a,t[6]=0,t[7]=-a,t[8]=r,t):new u(1,0,0,0,r,-a,0,a,r)},u.fromRotationY=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=r,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=r,t):new u(r,0,a,0,1,0,-a,0,r)},u.fromRotationZ=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=r,t[1]=a,t[2]=0,t[3]=-a,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new u(r,-a,0,a,r,0,0,0,1)},u.toArray=function(e,t){return n(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]]},u.getElementIndex=function(e,t){return 3*e+t},u.getColumn=function(e,t,n){var r=3*t,a=e[r],i=e[r+1],o=e[r+2];return n.x=a,n.y=i,n.z=o,n},u.setColumn=function(e,t,n,r){r=u.clone(e,r);var a=3*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},u.getRow=function(e,t,n){var r=e[t],a=e[t+3],i=e[t+6];return n.x=r,n.y=a,n.z=i,n},u.setRow=function(e,t,n,r){return r=u.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var f=new e;u.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],f)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],f)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],f)),n};var d=new e;u.getMaximumScale=function(t){return u.getScale(t,d),e.maximumComponent(d)},u.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=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 n[0]=r,n[1]=a,n[2]=i,n[3]=o,n[4]=u,n[5]=s,n[6]=c,n[7]=l,n[8]=f,n},u.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},u.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},u.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[3]*a+e[6]*i,u=e[1]*r+e[4]*a+e[7]*i,s=e[2]*r+e[5]*a+e[8]*i;return n.x=o,n.y=u,n.z=s,n},u.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},u.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},u.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},u.transpose=function(e,t){var n=e[0],r=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=n,t[1]=r,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var h=[1,0,0],E=[2,2,1],m=new u,p=new u;return u.computeEigenDecomposition=function(e,t){var r=o.EPSILON20,a=10,i=0,f=0;n(t)||(t={});for(var d=t.unitary=u.clone(u.IDENTITY,t.unitary),h=t.diagonal=u.clone(e,t.diagonal),E=r*s(h);f<a&&c(h)>E;)l(h,m),u.transpose(m,p),u.multiply(h,m,h),u.multiply(p,h,h),u.multiply(d,m,d),++i>2&&(++f,i=0);return t},u.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},u.determinant=function(e){var t=e[0],n=e[3],r=e[6],a=e[1],i=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*o)+a*(s*r-n*c)+u*(n*o-i*r)},u.inverse=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[3],o=e[4],s=e[5],c=e[6],l=e[7],f=e[8],d=u.determinant(e);t[0]=o*f-l*s,t[1]=l*a-r*f,t[2]=r*s-o*a,t[3]=c*s-i*f,t[4]=n*f-c*a,t[5]=i*a-n*s,t[6]=i*l-c*o,t[7]=c*r-n*l,t[8]=n*o-i*r;var h=1/d;return u.multiplyByScalar(t,h,t)},u.equals=function(e,t){return e===t||n(e)&&n(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]},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r},u.IDENTITY=i(new u(1,0,0,0,1,0,0,0,1)),u.ZERO=i(new u(0,0,0,0,0,0,0,0,0)),u.COLUMN0ROW0=0,u.COLUMN0ROW1=1,u.COLUMN0ROW2=2,u.COLUMN1ROW0=3,u.COLUMN1ROW1=4,u.COLUMN1ROW2=5,u.COLUMN2ROW0=6,u.COLUMN2ROW1=7,u.COLUMN2ROW2=8,r(u.prototype,{length:{get:function(){return u.packedLength}}}),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},u}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a){"use strict";function i(t,n,r,a){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0),this.w=e(a,0)}i.fromElements=function(e,n,r,a,o){return t(o)?(o.x=e,o.y=n,o.z=r,o.w=a,o):new i(e,n,r,a)},i.fromColor=function(e,n){return t(n)?(n.x=e.red,n.y=e.green,n.z=e.blue,n.w=e.alpha,n):new i(e.red,e.green,e.blue,e.alpha)},i.clone=function(e,n){if(t(e))return t(n)?(n.x=e.x,n.y=e.y,n.z=e.z,n.w=e.w,n):new i(e.x,e.y,e.z,e.w)},i.packedLength=4,i.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w,n},i.unpack=function(n,r,a){return r=e(r,0),t(a)||(a=new i),a.x=n[r++],a.y=n[r++],a.z=n[r++],a.w=n[r],a},i.packArray=function(e,n){var r=e.length;t(n)?n.length=4*r:n=new Array(4*r);for(var a=0;a<r;++a)i.pack(e[a],n,4*a);return n},i.unpackArray=function(e,n){var r=e.length;t(n)?n.length=r/4:n=new Array(r/4);for(var a=0;a<r;a+=4){var o=a/4;n[o]=i.unpack(e,a,n[o])}return n},i.fromArray=i.unpack,i.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},i.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},i.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},i.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},i.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},i.magnitude=function(e){return Math.sqrt(i.magnitudeSquared(e))};var o=new i;i.distance=function(e,t){return i.subtract(e,t,o),i.magnitude(o)},i.distanceSquared=function(e,t){return i.subtract(e,t,o),i.magnitudeSquared(o)},i.normalize=function(e,t){var n=i.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t},i.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},i.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},i.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},i.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},i.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},i.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},i.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},i.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},i.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 u=new i;i.lerp=function(e,t,n,r){return i.multiplyByScalar(t,n,u),r=i.multiplyByScalar(e,1-n,r),i.add(u,r,r)};var s=new i;return i.mostOrthogonalAxis=function(e,t){var n=i.normalize(e,s);return i.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?i.clone(i.UNIT_X,t):i.clone(i.UNIT_W,t):n.z<=n.w?i.clone(i.UNIT_Z,t):i.clone(i.UNIT_W,t):n.y<=n.z?n.y<=n.w?i.clone(i.UNIT_Y,t):i.clone(i.UNIT_W,t):n.z<=n.w?i.clone(i.UNIT_Z,t):i.clone(i.UNIT_W,t)},i.equals=function(e,n){return e===n||t(e)&&t(n)&&e.x===n.x&&e.y===n.y&&e.z===n.z&&e.w===n.w},i.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},i.equalsEpsilon=function(e,n,r,i){return e===n||t(e)&&t(n)&&a.equalsEpsilon(e.x,n.x,r,i)&&a.equalsEpsilon(e.y,n.y,r,i)&&a.equalsEpsilon(e.z,n.z,r,i)&&a.equalsEpsilon(e.w,n.w,r,i)},i.ZERO=r(new i(0,0,0,0)),i.UNIT_X=r(new i(1,0,0,0)),i.UNIT_Y=r(new i(0,1,0,0)),i.UNIT_Z=r(new i(0,0,1,0)),i.UNIT_W=r(new i(0,0,0,1)),i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i.prototype.equalsEpsilon=function(e,t,n){return i.equalsEpsilon(this,e,t,n)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},i}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t), -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","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t,r,a,i,o,u,s,c,l,f,d,h,E,m,p){this[0]=n(e,0),this[1]=n(i,0),this[2]=n(c,0),this[3]=n(h,0),this[4]=n(t,0),this[5]=n(o,0),this[6]=n(l,0),this[7]=n(E,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(f,0),this[11]=n(m,0),this[12]=n(a,0),this[13]=n(s,0),this[14]=n(d,0),this[15]=n(p,0)}l.packedLength=16,l.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t[r++]=e[9],t[r++]=e[10],t[r++]=e[11],t[r++]=e[12],t[r++]=e[13],t[r++]=e[14],t[r]=e[15],t},l.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new l),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a[9]=e[t++],a[10]=e[t++],a[11]=e[t++],a[12]=e[t++],a[13]=e[t++],a[14]=e[t++],a[15]=e[t],a},l.clone=function(e,t){if(r(e))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):new l(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])},l.fromArray=l.unpack,l.fromColumnMajorArray=function(e,t){return l.clone(e,t)},l.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 l(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])},l.fromRotationTranslation=function(t,a,i){return a=n(a,e.ZERO),r(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=a.x,i[13]=a.y,i[14]=a.z,i[15]=1,i):new l(t[0],t[3],t[6],a.x,t[1],t[4],t[7],a.y,t[2],t[5],t[8],a.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(e,t,n,a){r(a)||(a=new l);var i=n.x,o=n.y,u=n.z,s=t.x*t.x,c=t.x*t.y,f=t.x*t.z,d=t.x*t.w,h=t.y*t.y,E=t.y*t.z,m=t.y*t.w,p=t.z*t.z,y=t.z*t.w,_=t.w*t.w,T=s-h-p+_,R=2*(c-y),A=2*(f+m),v=2*(c+y),S=-s+h-p+_,g=2*(E-d),N=2*(f-m),I=2*(E+d),O=-s-h+p+_;return a[0]=T*i,a[1]=v*i,a[2]=N*i,a[3]=0,a[4]=R*o,a[5]=S*o,a[6]=I*o,a[7]=0,a[8]=A*u,a[9]=g*u,a[10]=O*u,a[11]=0,a[12]=e.x,a[13]=e.y,a[14]=e.z,a[15]=1,a},l.fromTranslationRotationScale=function(e,t){return l.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},l.fromTranslation=function(e,t){return l.fromRotationTranslation(s.IDENTITY,e,t)},l.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 l(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},l.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 l(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var f=new e,d=new e,h=new e;l.fromCamera=function(t,n){var a=t.position,i=t.direction,o=t.up;e.normalize(i,f),e.normalize(e.cross(f,o,d),d),e.normalize(e.cross(d,f,h),h);var u=d.x,s=d.y,c=d.z,E=f.x,m=f.y,p=f.z,y=h.x,_=h.y,T=h.z,R=a.x,A=a.y,v=a.z,S=u*-R+s*-A+c*-v,g=y*-R+_*-A+T*-v,N=E*R+m*A+p*v;return r(n)?(n[0]=u,n[1]=y,n[2]=-E,n[3]=0,n[4]=s,n[5]=_,n[6]=-m,n[7]=0,n[8]=c,n[9]=T,n[10]=-p,n[11]=0,n[12]=S,n[13]=g,n[14]=N,n[15]=1,n):new l(u,s,c,S,y,_,T,g,-E,-m,-p,N,0,0,0,1)},l.computePerspectiveFieldOfView=function(e,t,n,r,a){var i=Math.tan(.5*e),o=1/i,u=o/t,s=(r+n)/(n-r),c=2*r*n/(n-r);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=c,a[15]=0,a},l.computeOrthographicOffCenter=function(e,t,n,r,a,i,o){var u=1/(t-e),s=1/(r-n),c=1/(i-a),l=-(t+e)*u,f=-(r+n)*s,d=-(i+a)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=f,o[14]=d,o[15]=1,o},l.computePerspectiveOffCenter=function(e,t,n,r,a,i,o){var u=2*a/(t-e),s=2*a/(r-n),c=(t+e)/(t-e),l=(r+n)/(r-n),f=-(i+a)/(i-a),d=-1,h=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=f,o[11]=d,o[12]=0,o[13]=0,o[14]=h,o[15]=0,o},l.computeInfinitePerspectiveOffCenter=function(e,t,n,r,a,i){var o=2*a/(t-e),u=2*a/(r-n),s=(t+e)/(t-e),c=(r+n)/(r-n),l=-1,f=-1,d=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=s,i[9]=c,i[10]=l,i[11]=f,i[12]=0,i[13]=0,i[14]=d,i[15]=0,i},l.computeViewportTransformation=function(e,t,r,a){e=n(e,n.EMPTY_OBJECT);var i=n(e.x,0),o=n(e.y,0),u=n(e.width,0),s=n(e.height,0);t=n(t,0),r=n(r,1);var c=.5*u,l=.5*s,f=.5*(r-t),d=c,h=l,E=f,m=i+c,p=o+l,y=t+f,_=1;return a[0]=d,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=h,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=E,a[11]=0,a[12]=m,a[13]=p,a[14]=y,a[15]=_,a},l.computeView=function(t,n,r,a,i){return i[0]=a.x,i[1]=r.x,i[2]=-n.x,i[3]=0,i[4]=a.y,i[5]=r.y,i[6]=-n.y,i[7]=0,i[8]=a.z,i[9]=r.z,i[10]=-n.z,i[11]=0,i[12]=-e.dot(a,t),i[13]=-e.dot(r,t),i[14]=e.dot(n,t),i[15]=1,i},l.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]]},l.getElementIndex=function(e,t){return 4*e+t},l.getColumn=function(e,t,n){var r=4*t,a=e[r],i=e[r+1],o=e[r+2],u=e[r+3];return n.x=a,n.y=i,n.z=o,n.w=u,n},l.setColumn=function(e,t,n,r){r=l.clone(e,r);var a=4*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r[a+3]=n.w,r},l.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},l.getRow=function(e,t,n){var r=e[t],a=e[t+4],i=e[t+8],o=e[t+12];return n.x=r,n.y=a,n.z=i,n.w=o,n},l.setRow=function(e,t,n,r){return r=l.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var E=new e;l.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],E)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],E)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],E)),n};var m=new e;l.getMaximumScale=function(t){return l.getScale(t,m),e.maximumComponent(m)},l.multiply=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],f=e[8],d=e[9],h=e[10],E=e[11],m=e[12],p=e[13],y=e[14],_=e[15],T=t[0],R=t[1],A=t[2],v=t[3],S=t[4],g=t[5],N=t[6],I=t[7],O=t[8],M=t[9],x=t[10],w=t[11],C=t[12],P=t[13],D=t[14],U=t[15],L=r*T+u*R+f*A+m*v,F=a*T+s*R+d*A+p*v,z=i*T+c*R+h*A+y*v,B=o*T+l*R+E*A+_*v,b=r*S+u*g+f*N+m*I,G=a*S+s*g+d*N+p*I,q=i*S+c*g+h*N+y*I,W=o*S+l*g+E*N+_*I,V=r*O+u*M+f*x+m*w,X=a*O+s*M+d*x+p*w,H=i*O+c*M+h*x+y*w,Y=o*O+l*M+E*x+_*w,k=r*C+u*P+f*D+m*U,Z=a*C+s*P+d*D+p*U,j=i*C+c*P+h*D+y*U,K=o*C+l*P+E*D+_*U;return n[0]=L,n[1]=F,n[2]=z,n[3]=B,n[4]=b,n[5]=G,n[6]=q,n[7]=W,n[8]=V,n[9]=X,n[10]=H,n[11]=Y,n[12]=k,n[13]=Z,n[14]=j,n[15]=K,n},l.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},l.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},l.multiplyTransformation=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],d=e[12],h=e[13],E=e[14],m=t[0],p=t[1],y=t[2],_=t[4],T=t[5],R=t[6],A=t[8],v=t[9],S=t[10],g=t[12],N=t[13],I=t[14],O=r*m+o*p+c*y,M=a*m+u*p+l*y,x=i*m+s*p+f*y,w=r*_+o*T+c*R,C=a*_+u*T+l*R,P=i*_+s*T+f*R,D=r*A+o*v+c*S,U=a*A+u*v+l*S,L=i*A+s*v+f*S,F=r*g+o*N+c*I+d,z=a*g+u*N+l*I+h,B=i*g+s*N+f*I+E;return n[0]=O,n[1]=M,n[2]=x,n[3]=0,n[4]=w,n[5]=C,n[6]=P,n[7]=0,n[8]=D,n[9]=U,n[10]=L,n[11]=0,n[12]=F,n[13]=z,n[14]=B,n[15]=1,n},l.multiplyByMatrix3=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],d=t[0],h=t[1],E=t[2],m=t[3],p=t[4],y=t[5],_=t[6],T=t[7],R=t[8],A=r*d+o*h+c*E,v=a*d+u*h+l*E,S=i*d+s*h+f*E,g=r*m+o*p+c*y,N=a*m+u*p+l*y,I=i*m+s*p+f*y,O=r*_+o*T+c*R,M=a*_+u*T+l*R,x=i*_+s*T+f*R;return n[0]=A,n[1]=v,n[2]=S,n[3]=0,n[4]=g,n[5]=N,n[6]=I,n[7]=0,n[8]=O,n[9]=M,n[10]=x,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},l.multiplyByTranslation=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=r*e[0]+a*e[4]+i*e[8]+e[12],u=r*e[1]+a*e[5]+i*e[9]+e[13],s=r*e[2]+a*e[6]+i*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=s,n[15]=e[15],n};var p=new e;l.multiplyByUniformScale=function(e,t,n){return p.x=t,p.y=t,p.z=t,l.multiplyByScale(e,p,n)},l.multiplyByScale=function(e,t,n){var r=t.x,a=t.y,i=t.z;return 1===r&&1===a&&1===i?l.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=a*e[4],n[5]=a*e[5],n[6]=a*e[6],n[7]=0,n[8]=i*e[8],n[9]=i*e[9],n[10]=i*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},l.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=t.w,u=e[0]*r+e[4]*a+e[8]*i+e[12]*o,s=e[1]*r+e[5]*a+e[9]*i+e[13]*o,c=e[2]*r+e[6]*a+e[10]*i+e[14]*o,l=e[3]*r+e[7]*a+e[11]*i+e[15]*o;return n.x=u,n.y=s,n.z=c,n.w=l,n},l.multiplyByPointAsVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i,u=e[1]*r+e[5]*a+e[9]*i,s=e[2]*r+e[6]*a+e[10]*i;return n.x=o,n.y=u,n.z=s,n},l.multiplyByPoint=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i+e[12],u=e[1]*r+e[5]*a+e[9]*i+e[13],s=e[2]*r+e[6]*a+e[10]*i+e[14];return n.x=o,n.y=u,n.z=s,n},l.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},l.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},l.transpose=function(e,t){var n=e[1],r=e[2],a=e[3],i=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=o,t[14]=u,t[15]=e[15],t},l.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},l.equals=function(e,t){return e===t||r(e)&&r(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},l.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},l.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},l.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};var y=new s,_=new s,T=new t,R=new t(0,0,0,1);return l.inverse=function(e,n){if(s.equalsEpsilon(l.getRotation(e,y),_,u.EPSILON7)&&t.equals(l.getRow(e,3,T),R))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],a=e[4],i=e[8],o=e[12],f=e[1],d=e[5],h=e[9],E=e[13],m=e[2],p=e[6],A=e[10],v=e[14],S=e[3],g=e[7],N=e[11],I=e[15],O=A*I,M=v*N,x=p*I,w=v*g,C=p*N,P=A*g,D=m*I,U=v*S,L=m*N,F=A*S,z=m*g,B=p*S,b=O*d+w*h+C*E-(M*d+x*h+P*E),G=M*f+D*h+F*E-(O*f+U*h+L*E),q=x*f+U*d+z*E-(w*f+D*d+B*E),W=P*f+L*d+B*h-(C*f+F*d+z*h),V=M*a+x*i+P*o-(O*a+w*i+C*o),X=O*r+U*i+L*o-(M*r+D*i+F*o),H=w*r+D*a+B*o-(x*r+U*a+z*o),Y=C*r+F*a+z*i-(P*r+L*a+B*i);O=i*E,M=o*h,x=a*E,w=o*d,C=a*h,P=i*d,D=r*E,U=o*f,L=r*h,F=i*f,z=r*d,B=a*f;var k=O*g+w*N+C*I-(M*g+x*N+P*I),Z=M*S+D*N+F*I-(O*S+U*N+L*I),j=x*S+U*g+z*I-(w*S+D*g+B*I),K=P*S+L*g+B*N-(C*S+F*g+z*N),J=x*A+P*v+M*p-(C*v+O*p+w*A),Q=L*v+O*m+U*A-(D*A+F*v+M*m),$=D*p+B*v+w*m-(z*v+x*m+U*p),ee=z*A+C*m+F*p-(L*p+B*A+P*m),te=r*b+a*G+i*q+o*W;if(Math.abs(te)<u.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=b*te,n[1]=G*te,n[2]=q*te,n[3]=W*te,n[4]=V*te,n[5]=X*te,n[6]=H*te,n[7]=Y*te,n[8]=k*te,n[9]=Z*te,n[10]=j*te,n[11]=K*te,n[12]=J*te,n[13]=Q*te,n[14]=$*te,n[15]=ee*te,n},l.inverseTransformation=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],f=e[12],d=e[13],h=e[14],E=-n*f-r*d-a*h,m=-i*f-o*d-u*h,p=-s*f-c*d-l*h;return t[0]=n,t[1]=i,t[2]=s,t[3]=0,t[4]=r,t[5]=o,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=l,t[11]=0,t[12]=E,t[13]=m,t[14]=p,t[15]=1,t},l.IDENTITY=o(new l(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),l.ZERO=o(new l(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN0ROW3=3,l.COLUMN1ROW0=4,l.COLUMN1ROW1=5,l.COLUMN1ROW2=6,l.COLUMN1ROW3=7,l.COLUMN2ROW0=8,l.COLUMN2ROW1=9,l.COLUMN2ROW2=10,l.COLUMN2ROW3=11,l.COLUMN3ROW0=12,l.COLUMN3ROW1=13,l.COLUMN3ROW2=14,l.COLUMN3ROW3=15,a(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.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]+")"},l}),define("Core/Rectangle",["./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,n,r,a){this.west=t(e,0),this.south=t(n,0),this.east=t(r,0),this.north=t(a,0)}r(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,n,r){return r=t(r,0),n[r++]=e.west,n[r++]=e.south,n[r++]=e.east,n[r]=e.north,n},s.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new s),a.west=e[r++],a.south=e[r++],a.east=e[r++],a.north=e[r],a},s.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=u.TWO_PI),t-n},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,r,a,i,o){return e=u.toRadians(t(e,0)),r=u.toRadians(t(r,0)),a=u.toRadians(t(a,0)),i=u.toRadians(t(i,0)),n(o)?(o.west=e,o.south=r,o.east=a,o.north=i,o):new s(e,r,a,i)},s.fromCartographicArray=function(e,t){for(var r=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE,f=0,d=e.length;f<d;f++){var h=e[f];r=Math.min(r,h.longitude),a=Math.max(a,h.longitude),c=Math.min(c,h.latitude),l=Math.max(l,h.latitude);var E=h.longitude>=0?h.longitude:h.longitude+u.TWO_PI;i=Math.min(i,E),o=Math.max(o,E)}return a-r>o-i&&(r=i,a=o,a>u.PI&&(a-=u.TWO_PI),r>u.PI&&(r-=u.TWO_PI)),n(t)?(t.west=r,t.south=c,t.east=a,t.north=l,t):new s(r,c,a,l)},s.fromCartesianArray=function(e,t,r){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=Number.MAX_VALUE,f=-Number.MAX_VALUE,d=0,h=e.length;d<h;d++){var E=t.cartesianToCartographic(e[d]);a=Math.min(a,E.longitude),i=Math.max(i,E.longitude),l=Math.min(l,E.latitude),f=Math.max(f,E.latitude);var m=E.longitude>=0?E.longitude:E.longitude+u.TWO_PI;o=Math.min(o,m),c=Math.max(c,m)}return i-a>c-o&&(a=o,i=c,i>u.PI&&(i-=u.TWO_PI),a>u.PI&&(a-=u.TWO_PI)),n(r)?(r.west=a,r.south=l,r.east=i,r.north=f,r):new s(a,l,i,f)},s.clone=function(e,t){if(n(e))return n(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,t){return e===t||n(e)&&n(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},s.prototype.equalsEpsilon=function(e,t){return n(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},s.validate=function(e){},s.southwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.south,r.height=0,r):new e(t.west,t.south)},s.northwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.north,r.height=0,r):new e(t.west,t.north)},s.northeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.north,r.height=0,r):new e(t.east,t.north)},s.southeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.south,r.height=0,r):new e(t.east,t.south)},s.center=function(t,r){var a=t.east,i=t.west;a<i&&(a+=u.TWO_PI);var o=u.negativePiToPi(.5*(i+a)),s=.5*(t.south+t.north);return n(r)?(r.longitude=o,r.latitude=s,r.height=0,r):new e(o,s)},s.intersection=function(e,t,r){var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.negativePiToPi(Math.max(i,c)),f=u.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&f<=l)){var d=Math.max(e.south,t.south),h=Math.min(e.north,t.north);if(!(d>=h))return n(r)?(r.west=l,r.south=d,r.east=f,r.north=h,r):new s(l,d,f,h)}},s.simpleIntersection=function(e,t,r){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(i>=u||a>=o))return n(r)?(r.west=a,r.south=i,r.east=o,r.north=u,r):new s(a,i,o,u)},s.union=function(e,t,r){n(r)||(r=new s);var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.convertLongitudeRange(Math.min(i,c)),f=u.convertLongitudeRange(Math.max(a,o));return r.west=l,r.south=Math.min(e.south,t.south),r.east=f,r.north=Math.max(e.north,t.north),r},s.expand=function(e,t,r){return n(r)||(r=new s),r.west=Math.min(e.west,t.longitude),r.south=Math.min(e.south,t.latitude),r.east=Math.max(e.east,t.longitude),r.north=Math.max(e.north,t.latitude),r},s.contains=function(e,t){var n=t.longitude,r=t.latitude,a=e.west,i=e.east;return i<a&&(i+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>a||u.equalsEpsilon(n,a,u.EPSILON14))&&(n<i||u.equalsEpsilon(n,i,u.EPSILON14))&&r>=e.south&&r<=e.north};var c=new e;return s.subsample=function(e,r,a,o){r=t(r,i.WGS84),a=t(a,0),n(o)||(o=[]);var l=0,f=e.north,d=e.south,h=e.east,E=e.west,m=c;m.height=a,m.longitude=E,m.latitude=f,o[l]=r.cartographicToCartesian(m,o[l]),l++,m.longitude=h,o[l]=r.cartographicToCartesian(m,o[l]),l++,m.latitude=d,o[l]=r.cartographicToCartesian(m,o[l]),l++,m.longitude=E,o[l]=r.cartographicToCartesian(m,o[l]),l++,f<0?m.latitude=f:d>0?m.latitude=d:m.latitude=0;for(var p=1;p<8;++p)m.longitude=-Math.PI+p*u.PI_OVER_TWO,s.contains(e,m)&&(o[l]=r.cartographicToCartesian(m,o[l]),l++);return 0===m.latitude&&(m.longitude=E,o[l]=r.cartographicToCartesian(m,o[l]),l++,m.longitude=h,o[l]=r.cartographicToCartesian(m,o[l]),l++),o.length=l,o},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function d(t,r){this.center=e.clone(n(t,e.ZERO)),this.radius=n(r,0)}var h=new e,E=new e,m=new e,p=new e,y=new e,_=new e,T=new e,R=new e,A=new e,v=new e,S=new e,g=new e;d.fromPoints=function(t,n){if(r(n)||(n=new d),!r(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var a=e.clone(t[0],T),i=e.clone(a,h),o=e.clone(a,E),u=e.clone(a,m),s=e.clone(a,p),c=e.clone(a,y),l=e.clone(a,_),f=t.length,N=1;N<f;N++){e.clone(t[N],a);var I=a.x,O=a.y,M=a.z;I<i.x&&e.clone(a,i),I>s.x&&e.clone(a,s),O<o.y&&e.clone(a,o),O>c.y&&e.clone(a,c),M<u.z&&e.clone(a,u),M>l.z&&e.clone(a,l)}var x=e.magnitudeSquared(e.subtract(s,i,R)),w=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=i,D=s,U=x;w>U&&(U=w,P=o,D=c),C>U&&(U=C,P=u,D=l);var L=A;L.x=.5*(P.x+D.x),L.y=.5*(P.y+D.y),L.z=.5*(P.z+D.z);var F=e.magnitudeSquared(e.subtract(D,L,R)),z=Math.sqrt(F),B=v;B.x=i.x,B.y=o.y,B.z=u.z;var b=S;b.x=s.x,b.y=c.y,b.z=l.z;var G=e.multiplyByScalar(e.add(B,b,R),.5,g),q=0;for(N=0;N<f;N++){e.clone(t[N],a);var W=e.magnitude(e.subtract(a,G,R));W>q&&(q=W);var V=e.magnitudeSquared(e.subtract(a,L,R));if(V>F){var X=Math.sqrt(V);z=.5*(z+X),F=z*z;var H=X-z;L.x=(z*L.x+H*a.x)/X,L.y=(z*L.y+H*a.y)/X,L.z=(z*L.z+H*a.z)/X}}return z<q?(e.clone(L,n.center),n.radius=z):(e.clone(G,n.center),n.radius=q),n};var N=new o,I=new e,O=new e,M=new t,x=new t;d.fromRectangle2D=function(e,t,n){return d.fromRectangleWithHeights2D(e,t,0,0,n)},d.fromRectangleWithHeights2D=function(t,a,i,o,u){if(r(u)||(u=new d),!r(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;a=n(a,N),f.southwest(t,M),M.height=i,f.northeast(t,x),x.height=o;var s=a.project(M,I),c=a.project(x,O),l=c.x-s.x,h=c.y-s.y,E=c.z-s.z;u.radius=.5*Math.sqrt(l*l+h*h+E*E);var m=u.center;return m.x=s.x+.5*l,m.y=s.y+.5*h,m.z=s.z+.5*E,u};var w=[];d.fromRectangle3D=function(e,t,a,o){t=n(t,i.WGS84),a=n(a,0);var u;return r(e)&&(u=f.subsample(e,t,a,w)),d.fromPoints(u,o)},d.fromVertices=function(t,a,i,o){if(r(o)||(o=new d),!r(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;a=n(a,e.ZERO),i=n(i,3);var u=T;u.x=t[0]+a.x,u.y=t[1]+a.y,u.z=t[2]+a.z;for(var s=e.clone(u,h),c=e.clone(u,E),l=e.clone(u,m),f=e.clone(u,p),N=e.clone(u,y),I=e.clone(u,_),O=t.length,M=0;M<O;M+=i){var x=t[M]+a.x,w=t[M+1]+a.y,C=t[M+2]+a.z;u.x=x,u.y=w,u.z=C,x<s.x&&e.clone(u,s),x>f.x&&e.clone(u,f),w<c.y&&e.clone(u,c),w>N.y&&e.clone(u,N),C<l.z&&e.clone(u,l),C>I.z&&e.clone(u,I)}var P=e.magnitudeSquared(e.subtract(f,s,R)),D=e.magnitudeSquared(e.subtract(N,c,R)),U=e.magnitudeSquared(e.subtract(I,l,R)),L=s,F=f,z=P;D>z&&(z=D,L=c,F=N),U>z&&(z=U,L=l,F=I);var B=A;B.x=.5*(L.x+F.x),B.y=.5*(L.y+F.y),B.z=.5*(L.z+F.z);var b=e.magnitudeSquared(e.subtract(F,B,R)),G=Math.sqrt(b),q=v;q.x=s.x,q.y=c.y,q.z=l.z;var W=S;W.x=f.x,W.y=N.y,W.z=I.z;var V=e.multiplyByScalar(e.add(q,W,R),.5,g),X=0;for(M=0;M<O;M+=i){u.x=t[M]+a.x,u.y=t[M+1]+a.y,u.z=t[M+2]+a.z;var H=e.magnitude(e.subtract(u,V,R));H>X&&(X=H);var Y=e.magnitudeSquared(e.subtract(u,B,R));if(Y>b){var k=Math.sqrt(Y);G=.5*(G+k),b=G*G;var Z=k-G;B.x=(G*B.x+Z*u.x)/k,B.y=(G*B.y+Z*u.y)/k,B.z=(G*B.z+Z*u.z)/k}}return G<X?(e.clone(B,o.center),o.radius=G):(e.clone(V,o.center),o.radius=X),o},d.fromEncodedCartesianVertices=function(t,n,a){if(r(a)||(a=new d),!r(t)||!r(n)||t.length!==n.length||0===t.length)return a.center=e.clone(e.ZERO,a.center),a.radius=0,a;var i=T;i.x=t[0]+n[0],i.y=t[1]+n[1],i.z=t[2]+n[2];for(var o=e.clone(i,h),u=e.clone(i,E),s=e.clone(i,m),c=e.clone(i,p),l=e.clone(i,y),f=e.clone(i,_),N=t.length,I=0;I<N;I+=3){var O=t[I]+n[I],M=t[I+1]+n[I+1],x=t[I+2]+n[I+2];i.x=O,i.y=M,i.z=x,O<o.x&&e.clone(i,o),O>c.x&&e.clone(i,c),M<u.y&&e.clone(i,u),M>l.y&&e.clone(i,l),x<s.z&&e.clone(i,s),x>f.z&&e.clone(i,f)}var w=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=e.magnitudeSquared(e.subtract(f,s,R)),D=o,U=c,L=w;C>L&&(L=C,D=u,U=l),P>L&&(L=P,D=s,U=f);var F=A;F.x=.5*(D.x+U.x),F.y=.5*(D.y+U.y),F.z=.5*(D.z+U.z);var z=e.magnitudeSquared(e.subtract(U,F,R)),B=Math.sqrt(z),b=v;b.x=o.x,b.y=u.y,b.z=s.z;var G=S;G.x=c.x,G.y=l.y,G.z=f.z;var q=e.multiplyByScalar(e.add(b,G,R),.5,g),W=0;for(I=0;I<N;I+=3){i.x=t[I]+n[I],i.y=t[I+1]+n[I+1],i.z=t[I+2]+n[I+2];var V=e.magnitude(e.subtract(i,q,R));V>W&&(W=V);var X=e.magnitudeSquared(e.subtract(i,F,R));if(X>z){var H=Math.sqrt(X);B=.5*(B+H),z=B*B;var Y=H-B;F.x=(B*F.x+Y*i.x)/H,F.y=(B*F.y+Y*i.y)/H,F.z=(B*F.z+Y*i.z)/H}}return B<W?(e.clone(F,a.center),a.radius=B):(e.clone(q,a.center),a.radius=W),a},d.fromCornerPoints=function(t,n,a){r(a)||(a=new d);var i=a.center;return e.add(t,n,i),e.multiplyByScalar(i,.5,i),a.radius=e.distance(i,n),a},d.fromEllipsoid=function(t,n){return r(n)||(n=new d),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var C=new e;d.fromBoundingSpheres=function(t,n){if(r(n)||(n=new d),!r(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var a=t.length;if(1===a)return d.clone(t[0],n);if(2===a)return d.union(t[0],t[1],n);for(var i=[],o=0;o<a;o++)i.push(t[o].center);n=d.fromPoints(i,n);var u=n.center,s=n.radius;for(o=0;o<a;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,C)+c.radius)}return n.radius=s,n};var P=new e,D=new e,U=new e;d.fromOrientedBoundingBox=function(t,n){r(n)||(n=new d);var a=t.halfAxes,i=c.getColumn(a,0,P),o=c.getColumn(a,1,D),u=c.getColumn(a,2,U),s=e.magnitude(i),l=e.magnitude(o),f=e.magnitude(u);return n.center=e.clone(t.center,n.center),n.radius=Math.max(s,l,f),n},d.clone=function(t,n){if(r(t))return r(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new d(t.center,t.radius)},d.packedLength=4,d.pack=function(e,t,r){r=n(r,0);var a=e.center;return t[r++]=a.x,t[r++]=a.y,t[r++]=a.z,t[r]=e.radius,t},d.unpack=function(e,t,a){t=n(t,0),r(a)||(a=new d);var i=a.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],a.radius=e[t],a};var L=new e,F=new e;d.union=function(t,n,a){r(a)||(a=new d);var i=t.center,o=t.radius,u=n.center,s=n.radius,c=e.subtract(u,i,L),l=e.magnitude(c);if(o>=l+s)return t.clone(a),a;if(s>=l+o)return n.clone(a),a;var f=.5*(o+l+s),h=e.multiplyByScalar(c,(-o+f)/l,F);return e.add(h,i,h),e.clone(h,a.center),a.radius=f,a};var z=new e;d.expand=function(t,n,r){r=d.clone(t,r);var a=e.magnitude(e.subtract(n,r.center,z));return a>r.radius&&(r.radius=a),r},d.intersectPlane=function(t,n){var r=t.center,a=t.radius,i=n.normal,o=e.dot(i,r)+n.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},d.transform=function(e,t,n){return r(n)||(n=new d),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=l.getMaximumScale(t)*e.radius,n};var B=new e;d.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,B);return e.magnitudeSquared(r)-t.radius*t.radius},d.transformWithoutScale=function(e,t,n){return r(n)||(n=new d),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var b=new e;d.computePlaneDistances=function(t,n,a,i){r(i)||(i=new s);var o=e.subtract(t.center,n,b),u=e.dot(a,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var G=new e,q=new e,W=new e,V=new e,X=new e,H=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var Z=new o;return d.projectTo2D=function(t,r,a){r=n(r,Z);var i=r.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,G),c=e.cross(e.UNIT_Z,s,q);e.normalize(c,c);var l=e.cross(s,c,W);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var f=e.negate(l,X),h=e.negate(c,V),E=Y,m=E[0];e.add(s,l,m),e.add(m,c,m),m=E[1],e.add(s,l,m),e.add(m,h,m),m=E[2],e.add(s,f,m),e.add(m,h,m),m=E[3],e.add(s,f,m),e.add(m,c,m),e.negate(s,s),m=E[4],e.add(s,l,m),e.add(m,c,m),m=E[5],e.add(s,l,m),e.add(m,h,m),m=E[6],e.add(s,f,m),e.add(m,h,m),m=E[7],e.add(s,f,m),e.add(m,c,m);for(var p=E.length,y=0;y<p;++y){var _=E[y];e.add(o,_,_);var T=i.cartesianToCartographic(_,H);r.project(T,_)}a=d.fromPoints(E,a),o=a.center;var R=o.x,A=o.y,v=o.z;return o.x=v,o.y=R,o.z=A,a},d.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},d.equals=function(t,n){return t===n||r(t)&&r(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},d.prototype.intersectPlane=function(e){return d.intersectPlane(this,e)},d.prototype.distanceSquaredTo=function(e){return d.distanceSquaredTo(this,e)},d.prototype.computePlaneDistances=function(e,t,n){return d.computePlaneDistances(this,e,t,n)},d.prototype.isOccluded=function(e){return d.isOccluded(this,e)},d.prototype.equals=function(e){return d.equals(this,e)},d.prototype.clone=function(e){return d.clone(this,e)},d}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return t(a,{element:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(r.requestFullscreen=a,n=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(r.requestFullscreen=a,n=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?r.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(r.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?r.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(r.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?r.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(r.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),r.fullscreenerror=a)}return n},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[r.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function a(){if(!t(A)&&(A=!1,!d())){var e=/ Chrome\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(A=!0,v=r(e[1]))}return A}function i(){return a()&&v}function o(){if(!t(S)&&(S=!1,!a()&&!d()&&/ Safari\/[\.0-9]+/.test(R.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(S=!0,g=r(e[1]))}return S}function u(){return o()&&g}function s(){if(!t(N)){N=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(R.userAgent);null!==e&&(N=!0,I=r(e[1]),I.isNightly=!!e[2])}return N}function c(){return s()&&I}function l(){if(!t(O)){O=!1;var e;"Microsoft Internet Explorer"===R.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(O=!0,M=r(e[1]))):"Netscape"===R.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(O=!0,M=r(e[1])))}return O}function f(){ -return l()&&M}function d(){if(!t(x)){x=!1;var e=/ Edge\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(x=!0,w=r(e[1]))}return x}function h(){return d()&&w}function E(){if(!t(C)){C=!1;var e=/Firefox\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(C=!0,P=r(e[1]))}return C}function m(){return t(D)||(D=/Windows/i.test(R.appVersion)),D}function p(){return E()&&P}function y(){return t(U)||(U="undefined"!=typeof PointerEvent&&(!t(R.pointerEnabled)||R.pointerEnabled)),U}function _(){if(!t(F)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;F=t(n)&&""!==n,F&&(L=n)}return F}function T(){return _()?L:void 0}var R;R="undefined"!=typeof navigator?navigator:{};var A,v,S,g,N,I,O,M,x,w,C,P,D,U,L,F,z={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isEdge:d,edgeVersion:h,isFirefox:E,firefoxVersion:p,isWindows:m,hardwareConcurrency:e(R.hardwareConcurrency,3),supportsPointerEvents:y,supportsImageRenderingPixelated:_,imageRenderingValue:T};return z.supportsFullscreen=function(){return n.supportsFullscreen()},z.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},z.supportsWebWorkers=function(){return"undefined"!=typeof Worker},z}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,a,i){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){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.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},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 Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,a){switch(r=e(r,0),a=e(a,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,a);case o.SHORT:return new Int16Array(n,r,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,a);case o.INT:return new Int32Array(n,r,a);case o.UNSIGNED_INT:return new Uint32Array(n,r,a);case o.FLOAT:return new Float32Array(n,r,a);case o.DOUBLE:return new Float64Array(n,r,a)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/CornerType",["./freezeObject"],function(e){"use strict";var t={ROUNDED:0,MITERED:1,BEVELED:2};return e(t)}),define("Core/EllipsoidGeodesic",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){var t=e._uSquared,n=e._ellipsoid.maximumRadius,r=e._ellipsoid.minimumRadius,a=(n-r)/n,i=Math.cos(e._startHeading),o=Math.sin(e._startHeading),u=(1-a)*Math.tan(e._start.latitude),s=1/Math.sqrt(1+u*u),c=s*u,l=Math.atan2(u,i),f=s*o,d=f*f,h=1-d,E=Math.sqrt(h),m=t/4,p=m*m,y=p*m,_=p*p,T=1+m-3*p/4+5*y/4-175*_/64,R=1-m+15*p/8-35*y/8,A=1-3*m+35*p/4,v=1-5*m,S=T*l-R*Math.sin(2*l)*m/2-A*Math.sin(4*l)*p/16-v*Math.sin(6*l)*y/48-5*Math.sin(8*l)*_/512,g=e._constants;g.a=n,g.b=r,g.f=a,g.cosineHeading=i,g.sineHeading=o,g.tanU=u,g.cosineU=s,g.sineU=c,g.sigma=l,g.sineAlpha=f,g.sineSquaredAlpha=d,g.cosineSquaredAlpha=h,g.cosineAlpha=E,g.u2Over4=m,g.u4Over16=p,g.u6Over64=y,g.u8Over256=_,g.a0=T,g.a1=R,g.a2=A,g.a3=v,g.distanceRatio=S}function c(e,t){return e*t*(4+e*(4-3*t))/16}function l(e,t,n,r,a,i,o){var u=c(e,n);return(1-u)*e*t*(r+u*a*(o+u*i*(2*o*o-1)))}function f(e,t,n,r,a,i,o){var s,c,f,d,h,E=(t-n)/t,m=i-r,p=Math.atan((1-E)*Math.tan(a)),y=Math.atan((1-E)*Math.tan(o)),_=Math.cos(p),T=Math.sin(p),R=Math.cos(y),A=Math.sin(y),v=_*R,S=_*A,g=T*A,N=T*R,I=m,O=u.TWO_PI,M=Math.cos(I),x=Math.sin(I);do{M=Math.cos(I),x=Math.sin(I);var w=S-N*M;f=Math.sqrt(R*R*x*x+w*w),c=g+v*M,s=Math.atan2(f,c);var C;0===f?(C=0,d=1):(C=v*x/f,d=1-C*C),O=I,h=c-2*g/d,isNaN(h)&&(h=0),I=m+l(E,C,d,s,f,c,h)}while(Math.abs(I-O)>u.EPSILON12);var P=d*(t*t-n*n)/(n*n),D=1+P*(4096+P*(P*(320-175*P)-768))/16384,U=P*(256+P*(P*(74-47*P)-128))/1024,L=h*h,F=U*f*(h+U*(c*(2*L-1)-U*h*(4*f*f-3)*(4*L-3)/6)/4),z=n*D*(s-F),B=Math.atan2(R*x,S-N*M),b=Math.atan2(_*x,S*M-N);e._distance=z,e._startHeading=B,e._endHeading=b,e._uSquared=P}function d(n,r,a,i){e.normalize(i.cartographicToCartesian(r,m),E),e.normalize(i.cartographicToCartesian(a,m),m);f(n,i.maximumRadius,i.minimumRadius,r.longitude,r.latitude,a.longitude,a.latitude),n._start=t.clone(r,n._start),n._end=t.clone(a,n._end),n._start.height=0,n._end.height=0,s(n)}function h(e,a,i){var u=n(i,o.WGS84);this._ellipsoid=u,this._start=new t,this._end=new t,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,r(e)&&r(a)&&d(this,e,a,u)}var E=new e,m=new e;return a(h.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return this._startHeading}},endHeading:{get:function(){return this._endHeading}}}),h.prototype.setEndPoints=function(e,t){d(this,e,t,this._ellipsoid)},h.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},h.prototype.interpolateUsingSurfaceDistance=function(e,n){var a=this._constants,i=a.distanceRatio+e/a.b,o=Math.cos(2*i),u=Math.cos(4*i),s=Math.cos(6*i),c=Math.sin(2*i),f=Math.sin(4*i),d=Math.sin(6*i),h=Math.sin(8*i),E=i*i,m=i*E,p=a.u8Over256,y=a.u2Over4,_=a.u6Over64,T=a.u4Over16,R=2*m*p*o/3+i*(1-y+7*T/4-15*_/4+579*p/64-(T-15*_/4+187*p/16)*o-(5*_/4-115*p/16)*u-29*p*s/16)+(y/2-T+71*_/32-85*p/16)*c+(5*T/16-5*_/4+383*p/96)*f-E*((_-11*p/2)*c+5*p*f/2)+(29*_/96-29*p/16)*d+539*p*h/1536,A=Math.asin(Math.sin(R)*a.cosineAlpha),v=Math.atan(a.a/a.b*Math.tan(A));R-=a.sigma;var S=Math.cos(2*a.sigma+R),g=Math.sin(R),N=Math.cos(R),I=a.cosineU*N,O=a.sineU*g,M=Math.atan2(g*a.sineHeading,I-O*a.cosineHeading),x=M-l(a.f,a.sineAlpha,a.cosineSquaredAlpha,R,g,N,S);return r(n)?(n.longitude=this._start.longitude+x,n.latitude=v,n.height=0,n):new t(this._start.longitude+x,v,0)},h}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function n(e,n,r){var a=e+n;return t.sign(e)!==t.sign(n)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(n)))<r?0:a}var r={};return r.computeDiscriminant=function(e,t,n){var r=t*t-4*e*n;return r},r.computeRealRoots=function(e,r,a){var i;if(0===e)return 0===r?[]:[-a/r];if(0===r){if(0===a)return[0,0];var o=Math.abs(a),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,i<0)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-r/e,i<0?[i,0]:[0,i];var c=r*r,l=4*e*a,f=n(c,-l,t.EPSILON14);if(f<0)return[];var d=-.5*n(r,t.sign(r)*Math.sqrt(f),t.EPSILON14);return r>0?[d/e,a/d]:[a/d,d/e]},r}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function n(e,t,n,r){var a,i,o=e,u=t/3,s=n/3,c=r,l=o*s,f=u*c,d=u*u,h=s*s,E=o*s-d,m=o*c-u*s,p=u*c-h,y=4*E*p-m*m;if(y<0){var _,T,R;d*f>=l*h?(_=o,T=E,R=-2*u*E+o*m):(_=c,T=p,R=-c*m+2*s*p);var A=R<0?-1:1,v=-A*Math.abs(_)*Math.sqrt(-y);i=-R+v;var S=i/2,g=S<0?-Math.pow(-S,1/3):Math.pow(S,1/3),N=i===v?-g:-T/g;return a=T<=0?g+N:-R/(g*g+N*N+T),d*f>=l*h?[(a-u)/o]:[-c/(a+s)]}var I=E,O=-2*u*E+o*m,M=p,x=-c*m+2*s*p,w=Math.sqrt(y),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*w,-O)/3);a=2*Math.sqrt(-I);var D=Math.cos(P);i=a*D;var U=a*(-D/2-C*Math.sin(P)),L=i+U>2*u?i-u:U-u,F=o,z=L/F;P=Math.abs(Math.atan2(c*w,-x)/3),a=2*Math.sqrt(-M),D=Math.cos(P),i=a*D,U=a*(-D/2-C*Math.sin(P));var B=-c,b=i+U<2*s?i+s:U+s,G=B/b,q=F*b,W=-L*b-F*B,V=L*B,X=(s*W-u*V)/(-u*W+s*q);return z<=X?z<=G?X<=G?[z,X,G]:[z,G,X]:[G,z,X]:z<=G?[X,z,G]:X<=G?[X,G,z]:[G,X,z]}var r={};return r.computeDiscriminant=function(e,t,n,r){var a=e*e,i=t*t,o=n*n,u=r*r,s=18*e*t*n*r+i*o-27*a*u-4*(e*o*n+i*t*r);return s},r.computeRealRoots=function(e,r,a,i){var o,u;if(0===e)return t.computeRealRoots(r,a,i);if(0===r){if(0===a){if(0===i)return[0,0,0];u=-i/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===i?(o=t.computeRealRoots(e,0,a),0===o.Length?[0]:[o[0],0,o[1]]):n(e,0,a,i)}return 0===a?0===i?(u=-r/e,u<0?[u,0,0]:[0,0,u]):n(e,r,0,i):0===i?(o=t.computeRealRoots(e,r,a),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):n(e,r,a,i)},r}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,n,r){"use strict";function a(t,a,i,o){var u=t*t,s=a-3*u/8,c=i-a*t/2+u*t/8,l=o-i*t/4+a*u/16-3*u*u/256,f=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(f.length>0){var d=-t/4,h=f[f.length-1];if(Math.abs(h)<n.EPSILON14){var E=r.computeRealRoots(1,s,l);if(2===E.length){var m,p=E[0],y=E[1];if(p>=0&&y>=0){var _=Math.sqrt(p),T=Math.sqrt(y);return[d-T,d-_,d+_,d+T]}if(p>=0&&y<0)return m=Math.sqrt(p),[d-m,d+m];if(p<0&&y>=0)return m=Math.sqrt(y),[d-m,d+m]}return[]}if(h>0){var R=Math.sqrt(h),A=(s+h-c/R)/2,v=(s+h+c/R)/2,S=r.computeRealRoots(1,R,A),g=r.computeRealRoots(1,-R,v);return 0!==S.length?(S[0]+=d,S[1]+=d,0!==g.length?(g[0]+=d,g[1]+=d,S[1]<=g[0]?[S[0],S[1],g[0],g[1]]:g[1]<=S[0]?[g[0],g[1],S[0],S[1]]:S[0]>=g[0]&&S[1]<=g[1]?[g[0],S[0],S[1],g[1]]:g[0]>=S[0]&&g[1]<=S[1]?[S[0],g[0],g[1],S[1]]:S[0]>g[0]&&S[0]<g[1]?[g[0],S[0],g[1],S[1]]:[S[0],g[0],S[1],g[1]]):S):0!==g.length?(g[0]+=d,g[1]+=d,g):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,f=i*t+s-4*o,d=c*o-i*a*t+u,h=e.computeRealRoots(1,l,f,d);if(h.length>0){var E,m,p=h[0],y=a-p,_=y*y,T=t/2,R=y/2,A=_-4*o,v=_+4*Math.abs(o),S=c-4*p,g=c+4*Math.abs(p);if(p<0||A*g<S*v){var N=Math.sqrt(S);E=N/2,m=0===N?0:(t*R-i)/N}else{var I=Math.sqrt(A);E=0===I?0:(t*R-i)/I,m=I/2}var O,M;0===T&&0===E?(O=0,M=0):n.sign(T)===n.sign(E)?(O=T+E,M=p/O):(M=T-E,O=p/M);var x,w;0===R&&0===m?(x=0,w=0):n.sign(R)===n.sign(m)?(x=R+m,w=o/x):(w=R-m,x=o/w);var C=r.computeRealRoots(1,O,x),P=r.computeRealRoots(1,M,w);if(0!==C.length)return 0!==P.length?C[1]<=P[0]?[C[0],C[1],P[0],P[1]]:P[1]<=C[0]?[P[0],P[1],C[0],C[1]]:C[0]>=P[0]&&C[1]<=P[1]?[P[0],C[0],C[1],P[1]]:P[0]>=C[0]&&P[1]<=C[1]?[C[0],P[0],P[1],C[1]]:C[0]>P[0]&&C[0]<P[1]?[P[0],C[0],P[1],C[1]]:[C[0],P[0],C[1],P[1]]:C;if(0!==P.length)return P}return[]}var o={};return o.computeDiscriminant=function(e,t,n,r,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=n*n,l=c*n,f=r*r,d=f*r,h=a*a,E=h*a,m=u*c*f-4*s*d-4*e*l*f+18*e*t*n*d-27*i*f*f+256*o*E+a*(18*s*n*r-4*u*l+16*e*c*c-80*e*t*c*r-6*e*u*f+144*i*n*f)+h*(144*e*u*n-27*u*u-128*i*c-192*i*t*r);return m},o.computeRealRoots=function(t,r,o,u,s){if(Math.abs(t)<n.EPSILON15)return e.computeRealRoots(r,o,u,s);var c=r/t,l=o/t,f=u/t,d=s/t,h=c<0?1:0;switch(h+=l<0?h+1:h,h+=f<0?h+1:h,h+=d<0?h+1:h){case 0:return a(c,l,f,d);case 1:return i(c,l,f,d);case 2:return i(c,l,f,d);case 3:return a(c,l,f,d);case 4:return a(c,l,f,d);case 5:return i(c,l,f,d);case 6:return a(c,l,f,d);case 7:return a(c,l,f,d);case 8:return i(c,l,f,d);case 9:return a(c,l,f,d);case 10:return a(c,l,f,d);case 11:return i(c,l,f,d);case 12:return a(c,l,f,d);case 13:return a(c,l,f,d);case 14:return a(c,l,f,d);case 15:return a(c,l,f,d);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=e.clone(t(r,e.ZERO)),e.equals(r,e.ZERO)||e.normalize(r,r),this.origin=e.clone(t(n,e.ZERO)),this.direction=r}return a.getPoint=function(t,r,a){return n(a)||(a=new e),a=e.multiplyByScalar(t.direction,r,a),e.add(t.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t,n,r){var a=t*t-4*e*n;if(!(a<0)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return u<s?(r.root0=u,r.root1=s):(r.root0=s,r.root1=u),r}var c=-t/(2*e);if(0!==c)return r.root0=r.root1=c,r}}function f(t,n,a){r(a)||(a={});var i=t.origin,o=t.direction,u=n.center,s=n.radius*n.radius,c=e.subtract(i,u,y),f=e.dot(o,o),d=2*e.dot(o,c),h=e.magnitudeSquared(c)-s,E=l(f,d,h,A);if(r(E))return a.start=E.root0,a.stop=E.root1,a}function d(e,t,n){var r=e+t;return i.sign(e)!==i.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))<n?0:r}function h(t,n,r,a,c){var l,f=a*a,h=c*c,E=(t[o.COLUMN1ROW1]-t[o.COLUMN2ROW2])*h,m=c*(a*d(t[o.COLUMN1ROW0],t[o.COLUMN0ROW1],i.EPSILON15)+n.y),p=t[o.COLUMN0ROW0]*f+t[o.COLUMN2ROW2]*h+a*n.x+r,y=h*d(t[o.COLUMN2ROW1],t[o.COLUMN1ROW2],i.EPSILON15),_=c*(a*d(t[o.COLUMN2ROW0],t[o.COLUMN0ROW2])+n.z),T=[];if(0===_&&0===y){if(l=u.computeRealRoots(E,m,p),0===l.length)return T;var R=l[0],A=Math.sqrt(Math.max(1-R*R,0));if(T.push(new e(a,c*R,c*-A)),T.push(new e(a,c*R,c*A)),2===l.length){var v=l[1],S=Math.sqrt(Math.max(1-v*v,0));T.push(new e(a,c*v,c*-S)),T.push(new e(a,c*v,c*S))}return T}var g=_*_,N=y*y,I=E*E,O=_*y,M=I+N,x=2*(m*E+O),w=2*p*E+m*m-N+g,C=2*(p*m-O),P=p*p-g;if(0===M&&0===x&&0===w&&0===C)return T;l=s.computeRealRoots(M,x,w,C,P);var D=l.length;if(0===D)return T;for(var U=0;U<D;++U){var L,F=l[U],z=F*F,B=Math.max(1-z,0),b=Math.sqrt(B);L=i.sign(E)===i.sign(p)?d(E*z+p,m*F,i.EPSILON12):i.sign(p)===i.sign(m*F)?d(E*z,m*F+p,i.EPSILON12):d(E*z+m*F,p,i.EPSILON12);var G=d(y*F,_,i.EPSILON15),q=L*G;q<0?T.push(new e(a,c*F,c*b)):q>0?T.push(new e(a,c*F,c*-b)):0!==b?(T.push(new e(a,c*F,c*-b)),T.push(new e(a,c*F,c*b)),++U):T.push(new e(a,c*F,c*b))}return T}var E={};E.rayPlane=function(t,n,a){r(a)||(a=new e);var o=t.origin,u=t.direction,s=n.normal,c=e.dot(s,u);if(!(Math.abs(c)<i.EPSILON15)){var l=(-n.distance-e.dot(s,o))/c;if(!(l<0))return a=e.multiplyByScalar(u,l,a),e.add(o,a,a)}};var m=new e,p=new e,y=new e,_=new e,T=new e;E.rayTriangleParametric=function(t,r,a,o,u){u=n(u,!1);var s,c,l,f,d,h=t.origin,E=t.direction,R=e.subtract(a,r,m),A=e.subtract(o,r,p),v=e.cross(E,A,y),S=e.dot(R,v);if(u){if(S<i.EPSILON6)return;if(s=e.subtract(h,r,_),l=e.dot(s,v),l<0||l>S)return;if(c=e.cross(s,R,T),f=e.dot(E,c),f<0||l+f>S)return;d=e.dot(A,c)/S}else{if(Math.abs(S)<i.EPSILON6)return;var g=1/S;if(s=e.subtract(h,r,_),l=e.dot(s,v)*g,l<0||l>1)return;if(c=e.cross(s,R,T),f=e.dot(E,c)*g,f<0||l+f>1)return;d=e.dot(A,c)*g}return d},E.rayTriangle=function(t,n,a,i,o,u){var s=E.rayTriangleParametric(t,n,a,i,o);if(r(s)&&!(s<0))return r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var R=new c;E.lineSegmentTriangle=function(t,n,a,i,o,u,s){var c=R;e.clone(t,c.origin),e.subtract(n,t,c.direction),e.normalize(c.direction,c.direction);var l=E.rayTriangleParametric(c,a,i,o,u);if(!(!r(l)||l<0||l>e.distance(t,n)))return r(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var A={root0:0,root1:0};E.raySphere=function(e,t,n){if(n=f(e,t,n),r(n)&&!(n.stop<0))return n.start=Math.max(n.start,0),n};var v=new c;E.lineSegmentSphere=function(t,n,a,i){var o=v;e.clone(t,o.origin);var u=e.subtract(n,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),i=f(o,a,i),!(!r(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var S=new e,g=new e;E.rayEllipsoid=function(t,n){var r,a,i,o,u,s=n.oneOverRadii,c=e.multiplyComponents(s,t.origin,S),l=e.multiplyComponents(s,t.direction,g),f=e.magnitudeSquared(c),d=e.dot(c,l);if(f>1){if(d>=0)return;var h=d*d;if(r=f-1,a=e.magnitudeSquared(l),i=a*r,h<i)return;if(h>i){o=d*d-i,u=-d+Math.sqrt(o);var E=u/a,m=r/u;return E<m?{start:E,stop:m}:{start:m,stop:E}}var p=Math.sqrt(r/a);return{start:p,stop:p}}return f<1?(r=f-1,a=e.magnitudeSquared(l),i=a*r,o=d*d-i,u=-d+Math.sqrt(o),{start:0,stop:u/a}):d<0?(a=e.magnitudeSquared(l),{start:0,stop:-d/a}):void 0};var N=new e,I=new e,O=new e,M=new e,x=new e,w=new o,C=new o,P=new o,D=new o,U=new o,L=new o,F=new o,z=new e,B=new e,b=new t;E.grazingAltitudeLocation=function(t,n){var a=t.origin,u=t.direction;if(!e.equals(a,e.ZERO)){var s=n.geodeticSurfaceNormal(a,N);if(e.dot(u,s)>=0)return a}var c=r(this.rayEllipsoid(t,n)),l=n.transformPositionToScaledSpace(u,N),f=e.normalize(l,l),d=e.mostOrthogonalAxis(l,M),E=e.normalize(e.cross(d,f,I),I),m=e.normalize(e.cross(f,E,O),O),p=w;p[0]=f.x,p[1]=f.y,p[2]=f.z,p[3]=E.x,p[4]=E.y,p[5]=E.z,p[6]=m.x,p[7]=m.y,p[8]=m.z;var y=o.transpose(p,C),_=o.fromScale(n.radii,P),T=o.fromScale(n.oneOverRadii,D),R=U;R[0]=0,R[1]=-u.z,R[2]=u.y,R[3]=u.z,R[4]=0,R[5]=-u.x,R[6]=-u.y,R[7]=u.x,R[8]=0;var A,v,S=o.multiply(o.multiply(y,T,L),R,L),g=o.multiply(o.multiply(S,_,F),p,F),G=o.multiplyByVector(S,a,x),q=h(g,e.negate(G,N),0,0,1),W=q.length;if(W>0){for(var V=e.clone(e.ZERO,B),X=Number.NEGATIVE_INFINITY,H=0;H<W;++H){A=o.multiplyByVector(_,o.multiplyByVector(p,q[H],z),z);var Y=e.normalize(e.subtract(A,a,M),M),k=e.dot(Y,u);k>X&&(X=k,V=e.clone(A,V))}var Z=n.cartesianToCartographic(V,b);return X=i.clamp(X,0,1),v=e.magnitude(e.subtract(V,a,M))*Math.sqrt(1-X*X),v=c?-v:v,Z.height=v,n.cartographicToCartesian(Z,new e)}};var G=new e;return E.lineSegmentPlane=function(t,n,a,o){r(o)||(o=new e);var u=e.subtract(n,t,G),s=a.normal,c=e.dot(s,u);if(!(Math.abs(c)<i.EPSILON6)){var l=e.dot(s,t),f=-(a.distance+l)/c;if(!(f<0||f>1))return e.multiplyByScalar(u,f,o),e.add(t,o,o),o}},E.trianglePlaneIntersection=function(t,n,r,a){var i=a.normal,o=a.distance,u=e.dot(i,t)+o<0,s=e.dot(i,n)+o<0,c=e.dot(i,r)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var f,d;if(1!==l&&2!==l||(f=new e,d=new e),1===l){if(u)return E.lineSegmentPlane(t,n,a,f),E.lineSegmentPlane(t,r,a,d),{positions:[t,n,r,f,d],indices:[0,3,4,1,2,4,1,4,3]};if(s)return E.lineSegmentPlane(n,r,a,f),E.lineSegmentPlane(n,t,a,d), -{positions:[t,n,r,f,d],indices:[1,3,4,2,0,4,2,4,3]};if(c)return E.lineSegmentPlane(r,t,a,f),E.lineSegmentPlane(r,n,a,d),{positions:[t,n,r,f,d],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return E.lineSegmentPlane(n,t,a,f),E.lineSegmentPlane(r,t,a,d),{positions:[t,n,r,f,d],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return E.lineSegmentPlane(r,n,a,f),E.lineSegmentPlane(t,n,a,d),{positions:[t,n,r,f,d],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return E.lineSegmentPlane(t,r,a,f),E.lineSegmentPlane(n,r,a,d),{positions:[t,n,r,f,d],indices:[0,1,4,0,4,3,2,3,4]}}},E}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";function a(t,n){this.normal=e.clone(t),this.distance=n}a.fromPointNormal=function(n,r,i){var o=-e.dot(r,n);return t(i)?(e.clone(r,i.normal),i.distance=o,i):new a(r,o)};var i=new e;return a.fromCartesian4=function(n,r){var o=e.fromCartesian4(n,i),u=n.w;return t(r)?(e.clone(o,r.normal),r.distance=u,r):new a(o,u)},a.getPointDistance=function(t,n){return e.dot(t.normal,n)+t.distance},a.ORIGIN_XY_PLANE=r(new a(e.UNIT_Z,0)),a.ORIGIN_YZ_PLANE=r(new a(e.UNIT_X,0)),a.ORIGIN_ZX_PLANE=r(new a(e.UNIT_Y,0)),a}),define("Core/PolylinePipeline",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidGeodesic","./IntersectionTests","./isArray","./Math","./Matrix4","./Plane"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function d(e,t,n){var r=g;r.length=e;var a;if(t===n){for(a=0;a<e;a++)r[a]=t;return r}var i=n-t,o=i/e;for(a=0;a<e;a++){var u=t+a*o;r[a]=u}return r}function h(t,n,r,a,i,o,u,s){var c=a.scaleToGeodeticSurface(t,M),l=a.scaleToGeodeticSurface(n,x),f=E.numberOfPoints(t,n,r),h=a.cartesianToCartographic(c,N),m=a.cartesianToCartographic(l,I),p=d(f,i,o);w.setEndPoints(h,m);var y=w.surfaceDistance/f,_=s;h.height=i;var T=a.cartographicToCartesian(h,O);e.pack(T,u,_),_+=3;for(var R=1;R<f;R++){var A=w.interpolateUsingSurfaceDistance(R*y,I);A.height=p[R],T=a.cartographicToCartesian(A,O),e.pack(T,u,_),_+=3}return _}var E={};E.numberOfPoints=function(t,n,r){var a=e.distance(t,n);return Math.ceil(a/r)};var m=new t;E.extractHeights=function(e,t){for(var n=e.length,r=new Array(n),a=0;a<n;a++){var i=e[a];r[a]=t.cartesianToCartographic(i,m).height}return r};var p=new l,y=new e,_=new e,T=new f(e.ZERO,0),R=new e,A=new f(e.ZERO,0),v=new e,S=new e,g=[],N=new t,I=new t,O=new e,M=new e,x=new e,w=new o;return E.wrapLongitude=function(t,a){var i=[],o=[];if(r(t)&&t.length>0){a=n(a,l.IDENTITY);var s=l.inverseTransformation(a,p),c=l.multiplyByPoint(s,e.ZERO,y),d=l.multiplyByPointAsVector(s,e.UNIT_Y,_),h=f.fromPointNormal(c,d,T),E=l.multiplyByPointAsVector(s,e.UNIT_X,R),m=f.fromPointNormal(c,E,A),g=1;i.push(e.clone(t[0]));for(var N=i[0],I=t.length,O=1;O<I;++O){var M=t[O];if(f.getPointDistance(m,N)<0||f.getPointDistance(m,M)<0){var x=u.lineSegmentPlane(N,M,h,v);if(r(x)){var w=e.multiplyByScalar(d,5e-9,S);f.getPointDistance(h,N)<0&&e.negate(w,w),i.push(e.add(x,w,new e)),o.push(g+1),e.negate(w,w),i.push(e.add(x,w,new e)),g=1}}i.push(e.clone(t[O])),g++,N=M}o.push(g)}return{positions:i,lengths:o}},E.generateArc=function(t){r(t)||(t={});var a=t.positions,o=a.length,u=n(t.ellipsoid,i.WGS84),l=n(t.height,0),f=s(l);if(o<1)return[];if(1===o){var d=u.scaleToGeodeticSurface(a[0],M);if(l=f?l[0]:l,0!==l){var m=u.geodeticSurfaceNormal(d,O);e.multiplyByScalar(m,l,m),e.add(d,m,d)}return[d.x,d.y,d.z]}var p=t.minDistance;if(!r(p)){var y=n(t.granularity,c.RADIANS_PER_DEGREE);p=c.chordLength(y,u.maximumRadius)}var _,T=0;for(_=0;_<o-1;_++)T+=E.numberOfPoints(a[_],a[_+1],p);var R=3*(T+1),A=new Array(R),v=0;for(_=0;_<o-1;_++){var S=a[_],I=a[_+1],x=f?l[_]:l,w=f?l[_+1]:l;v=h(S,I,p,u,x,w,A,v)}g.length=0;var C=a[o-1],P=u.cartesianToCartographic(C,N);P.height=f?l[o-1]:l;var D=u.cartographicToCartesian(P,O);return e.pack(D,A,R-3),A},E.generateCartesianArc=function(t){for(var n=E.generateArc(t),r=n.length/3,a=new Array(r),i=0;i<r;i++)a[i]=e.unpack(n,3*i);return a},E}),define("Core/Cartesian2",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a){"use strict";function i(t,n){this.x=e(t,0),this.y=e(n,0)}i.fromElements=function(e,n,r){return t(r)?(r.x=e,r.y=n,r):new i(e,n)},i.clone=function(e,n){if(t(e))return t(n)?(n.x=e.x,n.y=e.y,n):new i(e.x,e.y)},i.fromCartesian3=i.clone,i.fromCartesian4=i.clone,i.packedLength=2,i.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r]=t.y,n},i.unpack=function(n,r,a){return r=e(r,0),t(a)||(a=new i),a.x=n[r++],a.y=n[r],a},i.packArray=function(e,n){var r=e.length;t(n)?n.length=2*r:n=new Array(2*r);for(var a=0;a<r;++a)i.pack(e[a],n,2*a);return n},i.unpackArray=function(e,n){var r=e.length;t(n)?n.length=r/2:n=new Array(r/2);for(var a=0;a<r;a+=2){var o=a/2;n[o]=i.unpack(e,a,n[o])}return n},i.fromArray=i.unpack,i.maximumComponent=function(e){return Math.max(e.x,e.y)},i.minimumComponent=function(e){return Math.min(e.x,e.y)},i.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},i.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},i.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},i.magnitude=function(e){return Math.sqrt(i.magnitudeSquared(e))};var o=new i;i.distance=function(e,t){return i.subtract(e,t,o),i.magnitude(o)},i.distanceSquared=function(e,t){return i.subtract(e,t,o),i.magnitudeSquared(o)},i.normalize=function(e,t){var n=i.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t},i.dot=function(e,t){return e.x*t.x+e.y*t.y},i.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n},i.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n},i.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n},i.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n},i.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n},i.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n},i.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},i.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var u=new i;i.lerp=function(e,t,n,r){return i.multiplyByScalar(t,n,u),r=i.multiplyByScalar(e,1-n,r),i.add(u,r,r)};var s=new i,c=new i;i.angleBetween=function(e,t){return i.normalize(e,s),i.normalize(t,c),a.acosClamped(i.dot(s,c))};var l=new i;return i.mostOrthogonalAxis=function(e,t){var n=i.normalize(e,l);return i.abs(n,n),t=n.x<=n.y?i.clone(i.UNIT_X,t):i.clone(i.UNIT_Y,t)},i.equals=function(e,n){return e===n||t(e)&&t(n)&&e.x===n.x&&e.y===n.y},i.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},i.equalsEpsilon=function(e,n,r,i){return e===n||t(e)&&t(n)&&a.equalsEpsilon(e.x,n.x,r,i)&&a.equalsEpsilon(e.y,n.y,r,i)},i.ZERO=r(new i(0,0)),i.UNIT_X=r(new i(1,0)),i.UNIT_Y=r(new i(0,1)),i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i.prototype.equalsEpsilon=function(e,t,n){return i.equalsEpsilon(this,e,t,n)},i.prototype.toString=function(){return"("+this.x+", "+this.y+")"},i}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Intersect"],function(e,t,n,r,a){"use strict";function i(r,a,i){this.minimum=e.clone(t(r,e.ZERO)),this.maximum=e.clone(t(a,e.ZERO)),n(i)?i=e.clone(i):(i=e.add(this.minimum,this.maximum,new e),e.multiplyByScalar(i,.5,i)),this.center=i}i.fromPoints=function(t,r){if(n(r)||(r=new i),!n(t)||0===t.length)return r.minimum=e.clone(e.ZERO,r.minimum),r.maximum=e.clone(e.ZERO,r.maximum),r.center=e.clone(e.ZERO,r.center),r;for(var a=t[0].x,o=t[0].y,u=t[0].z,s=t[0].x,c=t[0].y,l=t[0].z,f=t.length,d=1;d<f;d++){var h=t[d],E=h.x,m=h.y,p=h.z;a=Math.min(E,a),s=Math.max(E,s),o=Math.min(m,o),c=Math.max(m,c),u=Math.min(p,u),l=Math.max(p,l)}var y=r.minimum;y.x=a,y.y=o,y.z=u;var _=r.maximum;_.x=s,_.y=c,_.z=l;var T=e.add(y,_,r.center);return e.multiplyByScalar(T,.5,T),r},i.clone=function(t,r){if(n(t))return n(r)?(r.minimum=e.clone(t.minimum,r.minimum),r.maximum=e.clone(t.maximum,r.maximum),r.center=e.clone(t.center,r.center),r):new i(t.minimum,t.maximum)},i.equals=function(t,r){return t===r||n(t)&&n(r)&&e.equals(t.center,r.center)&&e.equals(t.minimum,r.minimum)&&e.equals(t.maximum,r.maximum)};var o=new e;return i.intersectPlane=function(t,n){o=e.subtract(t.maximum,t.minimum,o);var r=e.multiplyByScalar(o,.5,o),i=n.normal,u=r.x*Math.abs(i.x)+r.y*Math.abs(i.y)+r.z*Math.abs(i.z),s=e.dot(t.center,i)+n.distance;return s-u>0?a.INSIDE:s+u<0?a.OUTSIDE:a.INTERSECTING},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.intersectPlane=function(e){return i.intersectPlane(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,n,r,a){return t(e).then(n,r,a)}function t(e){var t,n;return e instanceof r?t=e:u(e)?(n=o(),e.then(function(e){n.resolve(e)},function(e){n.reject(e)},function(e){n.progress(e)}),t=n.promise):t=a(e),t}function n(t){return e(t,i)}function r(e){this.then=e}function a(e){var n=new r(function(n){try{return t(n?n(e):e)}catch(e){return i(e)}});return n}function i(e){var n=new r(function(n,r){try{return r?t(r(e)):i(e)}catch(e){return i(e)}});return n}function o(){function e(e,t,n){return d(e,t,n)}function n(e){return E(e)}function a(e){return E(i(e))}function u(e){return h(e)}var s,c,l,f,d,h,E;return c=new r(e),s={then:e,resolve:n,reject:a,progress:u,promise:c,resolver:{resolve:n,reject:a,progress:u}},l=[],f=[],d=function(e,t,n){var r,a;return r=o(),a="function"==typeof n?function(e){try{r.progress(n(e))}catch(e){r.progress(e)}}:function(e){r.progress(e)},l.push(function(n){n.then(e,t).then(r.resolve,r.reject,a)}),f.push(a),r.promise},h=function(e){return m(f,e),e},E=function(e){return e=t(e),d=e.then,E=t,h=y,m(l,e),f=l=A,e},s}function u(e){return e&&"function"==typeof e.then}function s(t,n,r,a,i){return p(2,arguments),e(t,function(t){function u(e){m(e)}function s(e){E(e)}var c,l,f,d,h,E,m,p,_,T;if(_=t.length>>>0,c=Math.max(0,Math.min(n,_)),f=[],l=_-c+1,d=[],h=o(),c)for(p=h.progress,m=function(e){d.push(e),--l||(E=m=y,h.reject(d))},E=function(e){f.push(e),--c||(E=m=y,h.resolve(f))},T=0;T<_;++T)T in t&&e(t[T],s,u,p);else h.resolve(f);return h.then(r,a,i)})}function c(e,t,n,r){function a(e){return t?t(e[0]):e[0]}return s(e,1,a,n,r)}function l(e,t,n,r){return p(1,arguments),d(e,_).then(t,n,r)}function f(){return d(arguments,_)}function d(t,n){return e(t,function(t){var r,a,i,u,s,c;if(i=a=t.length>>>0,r=[],c=o(),i)for(u=function(t,a){e(t,n).then(function(e){r[a]=e,--i||c.resolve(r)},c.reject)},s=0;s<a;s++)s in t?u(t[s],s):--i;else c.resolve(r);return c.promise})}function h(t,n){var r=R.call(arguments,1);return e(t,function(t){var a;return a=t.length,r[0]=function(t,r,i){return e(t,function(t){return e(r,function(e){return n(t,e,i,a)})})},T.apply(t,r)})}function E(t,n,r){var a=arguments.length>2;return e(t,function(e){return e=a?r:e,n.resolve(e),e},function(e){return n.reject(e),i(e)},n.progress)}function m(e,t){for(var n,r=0;n=e[r++];)n(t)}function p(e,t){for(var n,r=t.length;r>e;)if(n=t[--r],null!=n&&"function"!=typeof n)throw new Error("arg "+r+" must be a function")}function y(){}function _(e){return e}var T,R,A;return e.defer=o,e.resolve=t,e.reject=n,e.join=f,e.all=l,e.map=d,e.reduce=h,e.any=c,e.some=s,e.chain=E,e.isPromise=u,r.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(A,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return l(t,function(t){return e.apply(A,t)})})}},R=[].slice,T=[].reduce||function(e){var t,n,r,a,i;if(i=0,t=Object(this),a=t.length>>>0,n=arguments,n.length<=1)for(;;){if(i in t){r=t[i++];break}if(++i>=a)throw new TypeError}else r=n[1];for(;i<a;++i)i in t&&(r=e(r,t[i],i,t));return r},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n,r){t(a[n])||(a[n]=!0,console.log(e(r,n)))}var a={};return r.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.",r}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,n){"use strict";function r(e,t){n(e,t)}return r}),define("Core/binarySearch",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e,t,n){for(var r,a,i=0,o=e.length-1;i<=o;)if(r=~~((i+o)/2),a=n(e[r],t),a<0)i=r+1;else{if(!(a>0))return r;o=r-1}return~(o+1)}return n}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,n,r,a){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=r,this.ut1MinusUtc=a}return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,n=0,r=t[n++],a=function(e,t,n,r){n||(n=" ");var a=e.length>=t?"":Array(1+t-e.length>>>0).join(n);return r?e+a:a+e},i=function(e,t,n,r,i,o){var u=r-e.length;return u>0&&(e=n||!i?a(e,r,o,n):e.slice(0,t.length)+a("",u,"0",!0)+e.slice(t.length)),e},o=function(e,t,n,r,o,u,s){var c=e>>>0;return n=n&&c&&{2:"0b",8:"0",16:"0x"}[t]||"",e=n+a(c.toString(t),u||0,"0",!1),i(e,n,r,o,s)},u=function(e,t,n,r,a,o){return null!=r&&(e=e.slice(0,r)),i(e,"",t,n,a,o)},s=function(e,r,s,c,l,f,d){var h,E,m,p,y;if("%%"==e)return"%";for(var _=!1,T="",R=!1,A=!1,v=" ",S=s.length,g=0;s&&g<S;g++)switch(s.charAt(g)){case" ":T=" ";break;case"+":T="+";break;case"-":_=!0;break;case"'":v=s.charAt(g+1);break;case"0":R=!0;break;case"#":A=!0}if(c=c?"*"==c?+t[n++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,c<0&&(c=-c,_=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(f=f?"*"==f?+t[n++]:"*"==f.charAt(0)?+t[f.slice(1,-1)]:+f:"fFeE".indexOf(d)>-1?6:"d"==d?0:void 0,y=r?t[r.slice(0,-1)]:t[n++],d){case"s":return u(String(y),_,c,f,R,v);case"c":return u(String.fromCharCode(+y),_,c,f,R);case"b":return o(y,2,A,_,c,f,R);case"o":return o(y,8,A,_,c,f,R);case"x":return o(y,16,A,_,c,f,R);case"X":return o(y,16,A,_,c,f,R).toUpperCase();case"u":return o(y,10,A,_,c,f,R);case"i":case"d":return h=+y||0,h=Math.round(h-h%1),E=h<0?"-":T,y=E+a(String(Math.abs(h)),f,"0",!1),i(y,E,_,c,R);case"e":case"E":case"f":case"F":case"g":case"G":return h=+y,E=h<0?"-":T,m=["toExponential","toFixed","toPrecision"]["efg".indexOf(d.toLowerCase())],p=["toString","toUpperCase"]["eEfFgG".indexOf(d)%2],y=E+Math.abs(h)[m](f),i(y,E,_,c,R)[p]();default:return e}};return r.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,n,r,a,i,o,u){this.year=e,this.month=t,this.day=n,this.hour=r,this.minute=a,this.second=i,this.millisecond=o,this.isLeapSecond=u}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e(t)}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t){return m.compare(e.julianDate,t.julianDate)}function f(e){T.julianDate=e;var n=m.leapSeconds,r=t(n,T,l);r<0&&(r=~r),r>=n.length&&(r=n.length-1);var a=n[r].offset;if(r>0){var i=m.secondsDifference(n[r].julianDate,e);i>a&&(r--,a=n[r].offset)}m.addSeconds(e,a,e)}function d(e,n){T.julianDate=e;var r=m.leapSeconds,a=t(r,T,l);if(a<0&&(a=~a),0===a)return m.addSeconds(e,-r[0].offset,n);if(a>=r.length)return m.addSeconds(e,-r[a-1].offset,n);var i=m.secondsDifference(r[a].julianDate,e);return 0===i?m.addSeconds(e,-r[a].offset,n):i<=1?void 0:m.addSeconds(e,-r[--a].offset,n)}function h(e,t,n){var r=t/s.SECONDS_PER_DAY|0;return e+=r,t-=s.SECONDS_PER_DAY*r,t<0&&(e--,t+=s.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function E(e,t,n,r,a,i,o){var u=(t-14)/12|0,c=e+4800+u,l=(1461*c/4|0)+(367*(t-2-12*u)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;r-=12,r<0&&(r+=24);var f=i+(r*s.SECONDS_PER_HOUR+a*s.SECONDS_PER_MINUTE+o*s.SECONDS_PER_MILLISECOND);return f>=43200&&(l-=1),[l,f]}function m(e,t,r){this.dayNumber=void 0,this.secondsOfDay=void 0,e=n(e,0),t=n(t,0),r=n(r,c.UTC);var a=0|e;t+=(e-a)*s.SECONDS_PER_DAY,h(a,t,this),r===c.UTC&&f(this)}var p=new i,y=[31,28,31,30,31,30,31,31,30,31,30,31],_=29,T=new u,R=/^(\d{4})$/,A=/^(\d{4})-(\d{2})$/,v=/^(\d{4})-?(\d{3})$/,S=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,g=/^(\d{4})-?(\d{2})-?(\d{2})$/,N=/([Z+\-])?(\d{2})?:?(\d{2})?$/,I=/^(\d{2})(\.\d+)?/.source+N.source,O=/^(\d{2}):?(\d{2})(\.\d+)?/.source+N.source,M=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+N.source;m.fromDate=function(e,t){var n=E(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r(t)?(h(n[0],n[1],t),f(t),t):new m(n[0],n[1],c.UTC)},m.fromIso8601=function(e,t){e=e.replace(",",".");var n,a,i,u=e.split("T"),s=1,l=1,d=0,p=0,T=0,N=0,x=u[0],w=u[1];if(u=x.match(g),null!==u)n=+u[1],s=+u[2],l=+u[3];else if(u=x.match(A),null!==u)n=+u[1],s=+u[2];else if(u=x.match(R),null!==u)n=+u[1];else{var C;if(u=x.match(v),null!==u)n=+u[1],C=+u[2],i=o(n);else if(u=x.match(S),null!==u){n=+u[1];var P=+u[2],D=+u[3]||0,U=new Date(Date.UTC(n,0,4));C=7*P+D-U.getUTCDay()-3}a=new Date(Date.UTC(n,0,1)),a.setUTCDate(C),s=a.getUTCMonth()+1,l=a.getUTCDate()}i=o(n);var L;if(r(w)){u=w.match(M),null!==u?(d=+u[1],p=+u[2],T=+u[3],N=1e3*+(u[4]||0),L=5):(u=w.match(O),null!==u?(d=+u[1],p=+u[2],T=60*+(u[3]||0),L=4):(u=w.match(I),null!==u&&(d=+u[1],p=60*+(u[2]||0),L=3)));var F=u[L],z=+u[L+1],B=+(u[L+2]||0);switch(F){case"+":d-=z,p-=B;break;case"-":d+=z,p+=B;break;case"Z":break;default:p+=new Date(Date.UTC(n,s-1,l,d,p)).getTimezoneOffset()}}else p+=new Date(n,s-1,l).getTimezoneOffset();var b=60===T;for(b&&T--;p>=60;)p-=60,d++;for(;d>=24;)d-=24,l++;for(a=i&&2===s?_:y[s-1];l>a;)l-=a,s++,s>12&&(s-=12,n++),a=i&&2===s?_:y[s-1];for(;p<0;)p+=60,d--;for(;d<0;)d+=24,l--;for(;l<1;)s--,s<1&&(s+=12,n--),a=i&&2===s?_:y[s-1],l+=a;var G=E(n,s,l,d,p,T,N);return r(t)?(h(G[0],G[1],t),f(t)):t=new m(G[0],G[1],c.UTC),b&&m.addSeconds(t,1,t),t},m.now=function(e){return m.fromDate(new Date,e)};var x=new m(0,0,c.TAI);return m.toGregorianDate=function(e,t){var n=!1,a=d(e,x);r(a)||(m.addSeconds(e,-1,x),a=d(x,x),n=!0);var o=a.dayNumber,u=a.secondsOfDay;u>=43200&&(o+=1);var c=o+68569|0,l=4*c/146097|0;c=c-((146097*l+3)/4|0)|0;var f=4e3*(c+1)/1461001|0;c=c-(1461*f/4|0)+31|0;var h=80*c/2447|0,E=c-(2447*h/80|0)|0;c=h/11|0;var p=h+2-12*c|0,y=100*(l-49)+f+c|0,_=u/s.SECONDS_PER_HOUR|0,T=u-_*s.SECONDS_PER_HOUR,R=T/s.SECONDS_PER_MINUTE|0;T-=R*s.SECONDS_PER_MINUTE;var A=0|T,v=(T-A)/s.SECONDS_PER_MILLISECOND;return _+=12,_>23&&(_-=24),n&&(A+=1),r(t)?(t.year=y,t.month=p,t.day=E,t.hour=_,t.minute=R,t.second=A,t.millisecond=v,t.isLeapSecond=n,t):new i(y,p,E,_,R,A,v,n)},m.toDate=function(e){var t=m.toGregorianDate(e,p),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))},m.toIso8601=function(t,n){var a,i=m.toGregorianDate(t,i);return r(n)||0===i.millisecond?r(n)&&0!==n?(a=(.01*i.millisecond).toFixed(n).replace(".","").slice(0,n),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",i.year,i.month,i.day,i.hour,i.minute,i.second):(a=(.01*i.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a))},m.clone=function(e,t){if(r(e))return r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new m(e.dayNumber,e.secondsOfDay,c.TAI)},m.compare=function(e,t){var n=e.dayNumber-t.dayNumber;return 0!==n?n:e.secondsOfDay-t.secondsOfDay},m.equals=function(e,t){return e===t||r(e)&&r(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},m.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(m.secondsDifference(e,t))<=n},m.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},m.secondsDifference=function(e,t){var n=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return n+(e.secondsOfDay-t.secondsOfDay)},m.daysDifference=function(e,t){var n=e.dayNumber-t.dayNumber,r=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return n+r},m.computeTaiMinusUtc=function(e){T.julianDate=e;var n=m.leapSeconds,r=t(n,T,l);return r<0&&(r=~r,--r,r<0&&(r=0)),n[r].offset},m.addSeconds=function(e,t,n){return h(e.dayNumber,e.secondsOfDay+t,n)},m.addMinutes=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return h(e.dayNumber,r,n)},m.addHours=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return h(e.dayNumber,r,n)},m.addDays=function(e,t,n){var r=e.dayNumber+t;return h(r,e.secondsOfDay,n)},m.lessThan=function(e,t){return m.compare(e,t)<0},m.lessThanOrEquals=function(e,t){return m.compare(e,t)<=0},m.greaterThan=function(e,t){return m.compare(e,t)>0},m.greaterThanOrEquals=function(e,t){return m.compare(e,t)>=0},m.prototype.clone=function(e){return m.clone(this,e)},m.prototype.equals=function(e){return m.equals(this,e)},m.prototype.equalsEpsilon=function(e,t){return m.equalsEpsilon(this,e,t)},m.prototype.toString=function(){return m.toIso8601(this)},m.leapSeconds=[new u(new m(2441317,43210,c.TAI),10),new u(new m(2441499,43211,c.TAI),11),new u(new m(2441683,43212,c.TAI),12),new u(new m(2442048,43213,c.TAI),13),new u(new m(2442413,43214,c.TAI),14),new u(new m(2442778,43215,c.TAI),15),new u(new m(2443144,43216,c.TAI),16),new u(new m(2443509,43217,c.TAI),17),new u(new m(2443874,43218,c.TAI),18),new u(new m(2444239,43219,c.TAI),19),new u(new m(2444786,43220,c.TAI),20),new u(new m(2445151,43221,c.TAI),21),new u(new m(2445516,43222,c.TAI),22),new u(new m(2446247,43223,c.TAI),23),new u(new m(2447161,43224,c.TAI),24),new u(new m(2447892,43225,c.TAI),25),new u(new m(2448257,43226,c.TAI),26),new u(new m(2448804,43227,c.TAI),27),new u(new m(2449169,43228,c.TAI),28),new u(new m(2449534,43229,c.TAI),29),new u(new m(2450083,43230,c.TAI),30),new u(new m(2450630,43231,c.TAI),31),new u(new m(2451179,43232,c.TAI),32),new u(new m(2453736,43233,c.TAI),33),new u(new m(2454832,43234,c.TAI),34),new u(new m(2456109,43235,c.TAI),35),new u(new m(2457204,43236,c.TAI),36),new u(new m(2457754,43237,c.TAI),37)],m}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(n,r){if(null===n||"object"!=typeof n)return n;r=e(r,!1);var a=new n.constructor;for(var i in n)if(n.hasOwnProperty(i)){var o=n[i];r&&(o=t(o,r)),a[i]=o}return a}return t}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var n=e.split("\r\n"),r=0;r<n.length;++r){var a=n[r],i=a.indexOf(": ");if(i>0){var o=a.substring(0,i),u=a.substring(i+2);t[o]=u}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function n(e,n,r){this.statusCode=e,this.response=n,this.responseHeaders=r,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return n.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},n}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var n=r.exec(t);this.scheme=n[1],this.authority=n[2],this.path=n[3],this.query=n[4],this.fragment=n[5]}}function t(e){var t=unescape(e);return i.test(t)?t:e.toUpperCase()}function n(e,t,n,r){return(t||"")+n.toLowerCase()+(r||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var r=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(o,n).replace(a,t)),this.path&&(this.path=this.path.replace(a,t)),this.query&&(this.query=this.query.replace(a,t)),this.fragment&&(this.fragment=this.fragment.replace(a,t))};var a=/%[0-9a-z]{2}/gi,i=/[a-zA-Z0-9\-\._~]/,o=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var n=new e;return this.scheme?(n.scheme=this.scheme,n.authority=this.authority,n.path=this.path,n.query=this.query):(n.scheme=t.scheme,this.authority?(n.authority=this.authority,n.path=this.path,n.query=this.query):(n.authority=t.authority,""==this.path?(n.path=t.path,n.query=this.query||t.query):("/"==this.path.charAt(0)?(n.path=this.path,n.removeDotSegments()):(t.authority&&""==t.path?n.path="/"+this.path:n.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,n.removeDotSegments()),n.query=this.query))),n.fragment=this.fragment,n},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),n=[],r=""==t[0];r&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?n.pop():"."!=e&&n.push(e);"."!=e&&".."!=e||n.push(""),r&&n.unshift(""),this.path=n.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n){var r=new e(n);r.normalize();var a=r.getAuthority();if(t(a)){if(a.indexOf("@")!==-1){var i=a.split("@");a=i[1]}if(a.indexOf(":")===-1){var o=r.getScheme();if(t(o)||(o=window.location.protocol,o=o.substring(0,o.length-1)),"http"===o)a+=":80";else{if("https"!==o)return;a+=":443"}}return a}}var a={},i={};return a.add=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])||(i[r]=!0)},a.remove=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])&&delete i[r]},a.contains=function(e){var n=r(e);return!(!t(n)||!t(i[n]))},a.clear=function(){i={}},a}),define("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,n,r,a,i,o){"use strict";function u(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,a=t(n.method,"GET"),i=n.data,o=n.headers,s=n.overrideMimeType;return e(n.url,function(t){var n=e.defer();return u.load(t,r,a,i,o,n,s),n.promise})}function s(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function c(e,t){for(var n=s(e,t),r=new ArrayBuffer(n.length),a=new Uint8Array(r),i=0;i<n.length;i++)a[i]=n.charCodeAt(i);return r}function l(e,n){n=t(n,"");var r=e[1],a=!!e[2],i=e[3];switch(n){case"":case"text":return s(a,i);case"arraybuffer":return c(a,i);case"blob":var o=c(a,i);return new Blob([o],{type:r});case"document":var u=new DOMParser;return u.parseFromString(s(a,i),r);case"json":return JSON.parse(s(a,i))}}var f=/^data:(.*?)(;base64)?,(.*)$/;return u.load=function(e,t,r,u,s,c,d){var h=f.exec(e);if(null!==h)return void c.resolve(l(h,t));var E=new XMLHttpRequest;if(o.contains(e)&&(E.withCredentials=!0),n(d)&&n(E.overrideMimeType)&&E.overrideMimeType(d),E.open(r,e,!0),n(s))for(var m in s)s.hasOwnProperty(m)&&E.setRequestHeader(m,s[m]);n(t)&&(E.responseType=t),E.onload=function(){if(E.status<200||E.status>=300)return void c.reject(new a(E.status,E.response,E.getAllResponseHeaders()));var e=E.response,r=E.responseType;if(!n(e)||n(t)&&r!==t)if("json"===t&&"string"==typeof e)try{c.resolve(JSON.parse(e))}catch(e){c.reject(e)}else(""===r||"document"===r)&&n(E.responseXML)&&E.responseXML.hasChildNodes()?c.resolve(E.responseXML):""!==r&&"text"!==r||!n(E.responseText)?c.reject(new i("Invalid XMLHttpRequest response type.")):c.resolve(E.responseText);else c.resolve(e)},E.onerror=function(e){c.reject(new a)},E.send(u)},u.defaultLoad=u.load,u}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,n){return e({url:t,headers:n})}return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";function a(n,a){return t(a)?t(a.Accept)||(a=e(a),a.Accept=i.Accept):a=i,r(n,a).then(function(e){return JSON.parse(e)})}var i={Accept:"application/json,*/*;q=0.01"};return a}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function d(t){if(t=n(t,n.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=n(t.addNewLeapSeconds,!0),r(t.data))E(this,t.data);else if(r(t.url)){var a=this;this._downloadPromise=e(s(t.url),function(e){E(a,e)},function(){a._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else E(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function h(e,t){return o.compare(e.julianDate,t)}function E(e,n){if(!r(n.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!r(n.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var a=n.columnNames.indexOf("modifiedJulianDateUtc"),i=n.columnNames.indexOf("xPoleWanderRadians"),s=n.columnNames.indexOf("yPoleWanderRadians"),c=n.columnNames.indexOf("ut1MinusUtcSeconds"),d=n.columnNames.indexOf("xCelestialPoleOffsetRadians"),E=n.columnNames.indexOf("yCelestialPoleOffsetRadians"),m=n.columnNames.indexOf("taiMinusUtcSeconds");if(a<0||i<0||s<0||c<0||d<0||E<0||m<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var p=e._samples=n.samples,y=e._dates=[];e._dateColumn=a,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=d,e._yCelestialPoleOffsetRadiansColumn=E,e._taiMinusUtcSecondsColumn=m,e._columnCount=n.columnNames.length,e._lastIndex=void 0;for(var _,T=e._addNewLeapSeconds,R=0,A=p.length;R<A;R+=e._columnCount){var v=p[R+a],S=p[R+m],g=v+l.MODIFIED_JULIAN_DATE_DIFFERENCE,N=new o(g,S,f.TAI);if(y.push(N),T){if(S!==_&&r(_)){var I=o.leapSeconds,O=t(I,N,h); -if(O<0){var M=new u(N,S);I.splice(~O,0,M)}}_=S}}}function m(e,t,n,r,a){var i=n*r;a.xPoleWander=t[i+e._xPoleWanderRadiansColumn],a.yPoleWander=t[i+e._yPoleWanderRadiansColumn],a.xPoleOffset=t[i+e._xCelestialPoleOffsetRadiansColumn],a.yPoleOffset=t[i+e._yCelestialPoleOffsetRadiansColumn],a.ut1MinusUtc=t[i+e._ut1MinusUtcSecondsColumn]}function p(e,t,n){return t+e*(n-t)}function y(e,t,n,r,a,i,u){var s=e._columnCount;if(i>t.length-1)return u.xPoleWander=0,u.yPoleWander=0,u.xPoleOffset=0,u.yPoleOffset=0,u.ut1MinusUtc=0,u;var c=t[a],l=t[i];if(c.equals(l)||r.equals(c))return m(e,n,a,s,u),u;if(r.equals(l))return m(e,n,i,s,u),u;var f=o.secondsDifference(r,c)/o.secondsDifference(l,c),d=a*s,h=i*s,E=n[d+e._ut1MinusUtcSecondsColumn],y=n[h+e._ut1MinusUtcSecondsColumn],_=y-E;if(_>.5||_<-.5){var T=n[d+e._taiMinusUtcSecondsColumn],R=n[h+e._taiMinusUtcSecondsColumn];T!==R&&(l.equals(r)?E=y:y-=R-T)}return u.xPoleWander=p(f,n[d+e._xPoleWanderRadiansColumn],n[h+e._xPoleWanderRadiansColumn]),u.yPoleWander=p(f,n[d+e._yPoleWanderRadiansColumn],n[h+e._yPoleWanderRadiansColumn]),u.xPoleOffset=p(f,n[d+e._xCelestialPoleOffsetRadiansColumn],n[h+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=p(f,n[d+e._yCelestialPoleOffsetRadiansColumn],n[h+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=p(f,E,y),u}return d.NONE=i({getPromiseToLoad:function(){return e()},compute:function(e,t){return r(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new a(0,0,0,0,0),t}}),d.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},d.prototype.compute=function(e,n){if(r(this._samples)){if(r(n)||(n=new a(0,0,0,0,0)),0===this._samples.length)return n.xPoleWander=0,n.yPoleWander=0,n.xPoleOffset=0,n.yPoleOffset=0,n.ut1MinusUtc=0,n;var i=this._dates,u=this._lastIndex,s=0,l=0;if(r(u)){var f=i[u],d=i[u+1],h=o.lessThanOrEquals(f,e),E=!r(d),m=E||o.greaterThanOrEquals(d,e);if(h&&m)return s=u,!E&&d.equals(e)&&++s,l=s+1,y(this,i,this._samples,e,s,l,n),n}var p=t(i,e,o.compare,this._dateColumn);return p>=0?(p<i.length-1&&i[p+1].equals(e)&&++p,s=p,l=p):(l=~p,s=l-1,s<0&&(s=0)),this._lastIndex=s,y(this,i,this._samples,e,s,l,n),n}if(r(this._dataError))throw new c(this._dataError)},d}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(t,n,r){this.heading=e(t,0),this.pitch=e(n,0),this.roll=e(r,0)}return a.fromQuaternion=function(e,n){t(n)||(n=new a);var r=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return n.heading=-Math.atan2(s,u),n.roll=Math.atan2(o,i),n.pitch=-Math.asin(r),n},a.fromDegrees=function(e,n,i,o){return t(o)||(o=new a),o.heading=e*r.RADIANS_PER_DEGREE,o.pitch=n*r.RADIANS_PER_DEGREE,o.roll=i*r.RADIANS_PER_DEGREE,o},a.clone=function(e,n){if(t(e))return t(n)?(n.heading=e.heading,n.pitch=e.pitch,n.roll=e.roll,n):new a(e.heading,e.pitch,e.roll)},a.equals=function(e,n){return e===n||t(e)&&t(n)&&e.heading===n.heading&&e.pitch===n.pitch&&e.roll===n.roll},a.equalsEpsilon=function(e,n,a,i){return e===n||t(e)&&t(n)&&r.equalsEpsilon(e.heading,n.heading,a,i)&&r.equalsEpsilon(e.pitch,n.pitch,a,i)&&r.equalsEpsilon(e.roll,n.roll,a,i)},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,n){return a.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},a}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=t(r,document.location.href);var a=new e(r),i=new e(n);return i.resolve(a).toString()}return a}),define("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(r,a,i){i=t(i,!0),r instanceof e||(r=new e(r)),a instanceof e||(a=new e(a)),n(a.authority)&&!n(a.scheme)&&("undefined"!=typeof document&&n(document.location)&&n(document.location.href)?a.scheme=new e(document.location.href).scheme:a.scheme=r.scheme);var o=r;a.isAbsolute()&&(o=a);var u="";n(o.scheme)&&(u+=o.scheme+":"),n(o.authority)&&(u+="//"+o.authority,""!==o.path&&"/"!==o.path&&(u=u.replace(/\/?$/,"/"),o.path=o.path.replace(/^\/?/g,""))),u+=o===r?i?r.path.replace(/\/?$/,"/")+a.path.replace(/^\/?/g,""):r.path+a.path:a.path;var s=n(r.query),c=n(a.query);s&&c?u+="?"+r.query+"&"+a.query:s&&!c?u+="?"+r.query:!s&&c&&(u+="?"+a.query);var l=n(a.fragment);return n(r.fragment)&&!l?u+="#"+r.fragment:l&&(u+="#"+a.fragment),u}return a}),define("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","./joinUrls","require"],function(e,t,n,r,a,i){"use strict";function o(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;t<n;++t){var r=e[t].getAttribute("src"),a=E.exec(r);if(null!==a)return a[1]}}function u(){if(t(f))return f;var n;return n="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:o(),f=new e(r(n))}function s(e){return i.toUrl("../"+e)}function c(e){return a(u(),e)}function l(e){t(d)||(d=t(i.toUrl)?s:c),t(h)||(h=document.createElement("a"));var n=d(e);return h.href=n,h.href=h.href,h.href}var f,d,h,E=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return l._cesiumScriptRegex=E,l.setBaseUrl=function(t){f=new e(t).resolve(new e(document.location.href))},l}),define("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,n){this.x=e,this.y=t,this.s=n}return e}),define("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){e=n(e,n.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=n(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=n(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new i(this._sampleZeroJulianEphemerisDate,0,u.TAI),this._stepSizeDays=n(e.stepSizeDays,1),this._samplesPerXysFile=n(e.samplesPerXysFile,1e3),this._totalSamples=n(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,r=this._denominators=new Array(t+1),a=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t),s=0;s<=t;++s){r[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;c<=t;++c)c!==s&&(r[s]*=s-c);r[s]=1/r[s]}this._work=new Array(t+1),this._coef=new Array(t+1)}function c(e,t,n){var r=f;return r.dayNumber=t,r.secondsOfDay=n,i.daysDifference(r,e._sampleZeroDateTT)}function l(n,a){if(n._chunkDownloadsInProgress[a])return n._chunkDownloadsInProgress[a];var i=e.defer();n._chunkDownloadsInProgress[a]=i;var u,s=n._xysFileUrlTemplate;return u=r(s)?s.replace("{0}",a):t("Assets/IAU2006_XYS/IAU2006_XYS_"+a+".json"),e(o(u),function(e){n._chunkDownloadsInProgress[a]=!1;for(var t=n._samples,r=e.samples,o=a*n._samplesPerXysFile*3,u=0,s=r.length;u<s;++u)t[o+u]=r[u];i.resolve()}),i.promise}var f=new i(0,0,u.TAI);return s.prototype.preload=function(t,n,r,a){var i=c(this,t,n),o=c(this,r,a),u=i/this._stepSizeDays-this._interpolationOrder/2|0;u<0&&(u=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var f=u/this._samplesPerXysFile|0,d=s/this._samplesPerXysFile|0,h=[],E=f;E<=d;++E)h.push(l(this,E));return e.all(h)},s.prototype.computeXysRadians=function(e,t,n){var i=c(this,e,t);if(!(i<0)){var o=i/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);s<0&&(s=0);var f=s+u;f>=this._totalSamples&&(f=this._totalSamples-1,s=f-u,s<0&&(s=0));var d=!1,h=this._samples;if(r(h[3*s])||(l(this,s/this._samplesPerXysFile|0),d=!0),r(h[3*f])||(l(this,f/this._samplesPerXysFile|0),d=!0),!d){r(n)?(n.x=0,n.y=0,n.s=0):n=new a(0,0,0);var E,m,p=i-s*this._stepSizeDays,y=this._work,_=this._denominators,T=this._coef,R=this._xTable;for(E=0;E<=u;++E)y[E]=p-R[E];for(E=0;E<=u;++E){for(T[E]=1,m=0;m<=u;++m)m!==E&&(T[E]*=y[m]);T[E]*=_[E];var A=3*(s+E);n.x+=T[E]*h[A++],n.y+=T[E]*h[A++],n.s+=T[E]*h[A]}return n}}}},s}),define("Core/Quaternion",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math","./Matrix3"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,n,r,a){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(a,0)}var c=new e;s.fromAxisAngle=function(t,r,a){var i=r/2,o=Math.sin(i);c=e.normalize(t,c);var u=c.x*o,l=c.y*o,f=c.z*o,d=Math.cos(i);return n(a)?(a.x=u,a.y=l,a.z=f,a.w=d,a):new s(u,l,f,d)};var l=[1,2,0],f=new Array(3);s.fromRotationMatrix=function(e,t){var r,a,i,o,c,d=e[u.COLUMN0ROW0],h=e[u.COLUMN1ROW1],E=e[u.COLUMN2ROW2],m=d+h+E;if(m>0)r=Math.sqrt(m+1),c=.5*r,r=.5/r,a=(e[u.COLUMN1ROW2]-e[u.COLUMN2ROW1])*r,i=(e[u.COLUMN2ROW0]-e[u.COLUMN0ROW2])*r,o=(e[u.COLUMN0ROW1]-e[u.COLUMN1ROW0])*r;else{var p=l,y=0;h>d&&(y=1),E>d&&E>h&&(y=2);var _=p[y],T=p[_];r=Math.sqrt(e[u.getElementIndex(y,y)]-e[u.getElementIndex(_,_)]-e[u.getElementIndex(T,T)]+1);var R=f;R[y]=.5*r,r=.5/r,c=(e[u.getElementIndex(T,_)]-e[u.getElementIndex(_,T)])*r,R[_]=(e[u.getElementIndex(_,y)]+e[u.getElementIndex(y,_)])*r,R[T]=(e[u.getElementIndex(T,y)]+e[u.getElementIndex(y,T)])*r,a=-R[0],i=-R[1],o=-R[2]}return n(t)?(t.x=a,t.y=i,t.z=o,t.w=c,t):new s(a,i,o,c)};var d=new s;s.fromHeadingPitchRoll=function(t,n,r,a){var i=s.fromAxisAngle(e.UNIT_X,r,d),o=s.fromAxisAngle(e.UNIT_Y,-n,a);a=s.multiply(o,i,o);var u=s.fromAxisAngle(e.UNIT_Z,-t,d);return s.multiply(u,a,a)};var h=new e,E=new e,m=new s,p=new s,y=new s;s.packedLength=4,s.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},s.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new s),a.x=e[r],a.y=e[r+1],a.z=e[r+2],a.w=e[r+3],a},s.packedInterpolationLength=3,s.convertPackedArrayForInterpolation=function(e,t,n,r){s.unpack(e,4*n,y),s.conjugate(y,y);for(var a=0,i=n-t+1;a<i;a++){var o=3*a;s.unpack(e,4*(t+a),m),s.multiply(m,y,m),m.w<0&&s.negate(m,m),s.computeAxis(m,h);var u=s.computeAngle(m);r[o]=h.x*u,r[o+1]=h.y*u,r[o+2]=h.z*u}},s.unpackInterpolationResult=function(t,r,a,i,o){n(o)||(o=new s),e.fromArray(t,0,E);var u=e.magnitude(E);return s.unpack(r,4*i,p),0===u?s.clone(s.IDENTITY,m):s.fromAxisAngle(E,u,m),s.multiply(m,p,o)},s.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new s(e.x,e.y,e.z,e.w)},s.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},s.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},s.magnitude=function(e){return Math.sqrt(s.magnitudeSquared(e))},s.normalize=function(e,t){var n=1/s.magnitude(e),r=e.x*n,a=e.y*n,i=e.z*n,o=e.w*n;return t.x=r,t.y=a,t.z=i,t.w=o,t},s.inverse=function(e,t){var n=s.magnitudeSquared(e);return t=s.conjugate(e,t),s.multiplyByScalar(t,1/n,t)},s.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},s.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},s.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},s.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},s.multiply=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=e.w,u=t.x,s=t.y,c=t.z,l=t.w,f=o*u+r*l+a*c-i*s,d=o*s-r*c+a*l+i*u,h=o*c+r*s-a*u+i*l,E=o*l-r*u-a*s-i*c;return n.x=f,n.y=d,n.z=h,n.w=E,n},s.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},s.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},s.computeAxis=function(e,t){var n=e.w;if(Math.abs(n-1)<o.EPSILON6)return t.x=t.y=t.z=0,t;var r=1/Math.sqrt(1-n*n);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},s.computeAngle=function(e){return Math.abs(e.w-1)<o.EPSILON6?0:2*Math.acos(e.w)};var _=new s;s.lerp=function(e,t,n,r){return _=s.multiplyByScalar(t,n,_),r=s.multiplyByScalar(e,1-n,r),s.add(_,r,r)};var T=new s,R=new s,A=new s;s.slerp=function(e,t,n,r){var a=s.dot(e,t),i=t;if(a<0&&(a=-a,i=T=s.negate(t,T)),1-a<o.EPSILON6)return s.lerp(e,i,n,r);var u=Math.acos(a);return R=s.multiplyByScalar(e,Math.sin((1-n)*u),R),A=s.multiplyByScalar(i,Math.sin(n*u),A),r=s.add(R,A,r),s.multiplyByScalar(r,1/Math.sin(u),r)},s.log=function(t,n){var r=o.acosClamped(t.w),a=0;return 0!==r&&(a=r/Math.sin(r)),e.multiplyByScalar(t,a,n)},s.exp=function(t,n){var r=e.magnitude(t),a=0;return 0!==r&&(a=Math.sin(r)/r),n.x=t.x*a,n.y=t.y*a,n.z=t.z*a,n.w=Math.cos(r),n};var v=new e,S=new e,g=new s,N=new s;s.computeInnerQuadrangle=function(t,n,r,a){var i=s.conjugate(n,g);s.multiply(i,r,N);var o=s.log(N,v);s.multiply(i,t,N);var u=s.log(N,S);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),s.exp(o,g),s.multiply(n,g,a)},s.squad=function(e,t,n,r,a,i){var o=s.slerp(e,t,a,g),u=s.slerp(n,r,a,N);return s.slerp(o,u,2*a*(1-a),i)};for(var I=new s,O=1.9011074535173003,M=a.supportsTypedArrays()?new Float32Array(8):[],x=a.supportsTypedArrays()?new Float32Array(8):[],w=a.supportsTypedArrays()?new Float32Array(8):[],C=a.supportsTypedArrays()?new Float32Array(8):[],P=0;P<7;++P){var D=P+1,U=2*D+1;M[P]=1/(D*U),x[P]=D/U}return M[7]=O/136,x[7]=8*O/17,s.fastSlerp=function(e,t,n,r){var a,i=s.dot(e,t);i>=0?a=1:(a=-1,i=-i);for(var o=i-1,u=1-n,c=n*n,l=u*u,f=7;f>=0;--f)w[f]=(M[f]*c-x[f])*o,C[f]=(M[f]*l-x[f])*o;var d=a*n*(1+w[0]*(1+w[1]*(1+w[2]*(1+w[3]*(1+w[4]*(1+w[5]*(1+w[6]*(1+w[7])))))))),h=u*(1+C[0]*(1+C[1]*(1+C[2]*(1+C[3]*(1+C[4]*(1+C[5]*(1+C[6]*(1+C[7])))))))),E=s.multiplyByScalar(e,h,I);return s.multiplyByScalar(t,d,r),s.add(E,r,r)},s.fastSquad=function(e,t,n,r,a,i){var o=s.fastSlerp(e,t,a,g),u=s.fastSlerp(n,r,a,N);return s.fastSlerp(o,u,2*a*(1-a),i)},s.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},s.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.x-t.x)<=r&&Math.abs(e.y-t.y)<=r&&Math.abs(e.z-t.z)<=r&&Math.abs(e.w-t.w)<=r},s.ZERO=i(new s(0,0,0,0)),s.IDENTITY=i(new s(0,0,0,1)),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.x+", "+this.y+", "+this.z+", "+this.w+")"},s}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./defaultValue","./defined","./deprecationWarning","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./HeadingPitchRoll","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,n,r,a,i,o,u,s,c,l,f,d,h,E,m,p,y,_,T,R){"use strict";var A={},v=new n,S=new n,g=new n;A.eastNorthUpToFixedFrame=function(e,t,r){if(p.equalsEpsilon(e.x,0,p.EPSILON14)&&p.equalsEpsilon(e.y,0,p.EPSILON14)){var a=p.sign(e.z);return o(r)?(r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=-a,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=a,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(0,-a,0,e.x,1,0,0,e.y,0,0,a,e.z,0,0,0,1)}var u=v,s=S,c=g;return t=i(t,f.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,c),o(r)?(r[0]=s.x,r[1]=s.y,r[2]=s.z,r[3]=0,r[4]=c.x,r[5]=c.y,r[6]=c.z,r[7]=0,r[8]=u.x,r[9]=u.y,r[10]=u.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(s.x,c.x,u.x,e.x,s.y,c.y,u.y,e.y,s.z,c.z,u.z,e.z,0,0,0,1)};var N=new n,I=new n,O=new n;A.northEastDownToFixedFrame=function(e,t,r){if(p.equalsEpsilon(e.x,0,p.EPSILON14)&&p.equalsEpsilon(e.y,0,p.EPSILON14)){var a=p.sign(e.z);return o(r)?(r[0]=-a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=-a,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(-a,0,0,e.x,0,1,0,e.y,0,0,-a,e.z,0,0,0,1)}var u=N,s=I,c=O;return t=i(t,f.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,c),o(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=s.x,r[5]=s.y,r[6]=s.z,r[7]=0,r[8]=-u.x,r[9]=-u.y,r[10]=-u.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(c.x,s.x,-u.x,e.x,c.y,s.y,-u.y,e.y,c.z,s.z,-u.z,e.z,0,0,0,1)},A.northUpEastToFixedFrame=function(e,t,r){if(p.equalsEpsilon(e.x,0,p.EPSILON14)&&p.equalsEpsilon(e.y,0,p.EPSILON14)){var a=p.sign(e.z);return o(r)?(r[0]=-a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=a,r[7]=0,r[8]=0,r[9]=1,r[10]=0,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(-a,0,0,e.x,0,0,1,e.y,0,a,0,e.z,0,0,0,1)}var u=v,s=S,c=g;return t=i(t,f.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,c),o(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=u.x,r[5]=u.y,r[6]=u.z,r[7]=0,r[8]=s.x,r[9]=s.y,r[10]=s.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(c.x,u.x,s.x,e.x,c.y,u.y,s.y,e.y,c.z,u.z,s.z,e.z,0,0,0,1)},A.northWestUpToFixedFrame=function(e,t,r){if(p.equalsEpsilon(e.x,0,p.EPSILON14)&&p.equalsEpsilon(e.y,0,p.EPSILON14)){var a=p.sign(e.z);return o(r)?(r[0]=-a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=a,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(-a,0,0,e.x,0,-1,0,e.y,0,0,a,e.z,0,0,0,1)}var u=v,s=S,c=g;return t=i(t,f.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,c),o(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=-s.x,r[5]=-s.y,r[6]=-s.z,r[7]=0,r[8]=u.x,r[9]=u.y,r[10]=u.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(c.x,-s.x,u.x,e.x,c.y,-s.y,u.y,e.y,c.z,-s.z,u.z,e.z,0,0,0,1)};var M=new T,x=new n(1,1,1),w=new _;A.headingPitchRollToFixedFrame=function(e,t,r,a,i,o){var s;"object"==typeof t?(i=r,o=a,s=t.heading,r=t.pitch,a=t.roll):(u("headingPitchRollToFixedFrame","headingPitchRollToFixedFrame with separate heading, pitch, and roll arguments was deprecated in 1.27. It will be removed in 1.30. Use a HeadingPitchRoll object."),s=t);var c=T.fromHeadingPitchRoll(s,r,a,M),l=_.fromTranslationQuaternionRotationScale(n.ZERO,c,x,w);return o=A.eastNorthUpToFixedFrame(e,i,o),_.multiply(o,l,o)};var C=new d,P=new _,D=new y;A.headingPitchRollQuaternion=function(e,t,n,r,a,i){var o;"object"==typeof t?(o=t,a=n,i=r):(u("headingPitchRollQuaternion","headingPitchRollQuaternion with separate heading, pitch, and roll arguments was deprecated in 1.27. It will be removed in 1.30. Use a HeadingPitchRoll object."),C.heading=t,C.pitch=n,C.roll=r,o=C);var s=A.headingPitchRollToFixedFrame(e,o,a,P),c=_.getRotation(s,D);return T.fromRotationMatrix(c,i)};var U=24110.54841,L=8640184.812866,F=.093104,z=-62e-7,B=1.1772758384668e-19,b=72921158553e-15,G=p.TWO_PI/86400,q=new m;A.computeTemeToPseudoFixedMatrix=function(e,t){q=m.addSeconds(e,-m.computeTaiMinusUtc(e),q);var n,r=q.dayNumber,a=q.secondsOfDay,i=r-2451545;n=a>=43200?(i+.5)/R.DAYS_PER_JULIAN_CENTURY:(i-.5)/R.DAYS_PER_JULIAN_CENTURY;var u=U+n*(L+n*(F+n*z)),s=u*G%p.TWO_PI,c=b+B*(r-2451545.5),l=(a+.5*R.SECONDS_PER_DAY)%R.SECONDS_PER_DAY,f=s+c*l,d=Math.cos(f),h=Math.sin(f);return o(t)?(t[0]=d,t[1]=-h,t[2]=0,t[3]=h,t[4]=d,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new y(d,h,0,-h,d,0,0,0,1)},A.iau2006XysData=new h,A.earthOrientationParameters=c.NONE;var W=32.184,V=2451545;A.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+W,a=t.stop.dayNumber,i=t.stop.secondsOfDay+W,o=A.iau2006XysData.preload(n,r,a,i),u=A.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},A.computeIcrfToFixedMatrix=function(e,t){o(t)||(t=new y);var n=A.computeFixedToIcrfMatrix(e,t);if(o(n))return y.transpose(n,t)};var X=new E(0,0,0),H=new l(0,0,0,0,0,0),Y=new y,k=new y;A.computeFixedToIcrfMatrix=function(e,t){o(t)||(t=new y);var n=A.earthOrientationParameters.compute(e,H);if(o(n)){var r=e.dayNumber,a=e.secondsOfDay+W,i=A.iau2006XysData.computeXysRadians(r,a,X);if(o(i)){var u=i.x+n.xPoleOffset,s=i.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-u*u-s*s)),l=Y;l[0]=1-c*u*u,l[3]=-c*u*s,l[6]=u,l[1]=-c*u*s,l[4]=1-c*s*s,l[7]=s,l[2]=-u,l[5]=-s,l[8]=1-c*(u*u+s*s);var f=y.fromRotationZ(-i.s,k),d=y.multiply(l,f,Y),h=e.dayNumber,E=e.secondsOfDay-m.computeTaiMinusUtc(e)+n.ut1MinusUtc,_=h-2451545,T=E/R.SECONDS_PER_DAY,v=.779057273264+T+.00273781191135448*(_+T);v=v%1*p.TWO_PI;var S=y.fromRotationZ(v,k),g=y.multiply(d,S,Y),N=Math.cos(n.xPoleWander),I=Math.cos(n.yPoleWander),O=Math.sin(n.xPoleWander),M=Math.sin(n.yPoleWander),x=r-V+a/R.SECONDS_PER_DAY;x/=36525;var w=-47e-6*x*p.RADIANS_PER_DEGREE/3600,C=Math.cos(w),P=Math.sin(w),D=k;return D[0]=N*C,D[1]=N*P,D[2]=O,D[3]=-I*P+M*O*C,D[4]=I*C+M*O*P,D[5]=-M*N,D[6]=-M*P-I*O*C,D[7]=M*C-I*O*P,D[8]=I*N,y.multiply(g,D,t)}}};var Z=new r;A.pointToWindowCoordinates=function(e,t,n,r){return r=A.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},A.pointToGLWindowCoordinates=function(e,n,a,i){o(i)||(i=new t);var u=Z;return _.multiplyByVector(e,r.fromElements(a.x,a.y,a.z,1,u),u),r.multiplyByScalar(u,1/u.w,u),_.multiplyByVector(n,u,u),t.fromCartesian4(u,i)};var j=new n,K=new n,J=new n;A.rotationMatrixFromPositionVelocity=function(e,t,r,a){var u=i(r,f.WGS84).geodeticSurfaceNormal(e,j),s=n.cross(t,u,K);n.equalsEpsilon(s,n.ZERO,p.EPSILON6)&&(s=n.clone(n.UNIT_X,s));var c=n.cross(s,t,J);return n.cross(t,c,s),n.negate(s,s),o(a)||(a=new y),a[0]=t.x,a[1]=t.y,a[2]=t.z,a[3]=s.x,a[4]=s.y,a[5]=s.z,a[6]=c.x,a[7]=c.y,a[8]=c.z,a};var Q=new a,$=new n,ee=new n,te=new r,ne=new r,re=new r,ae=new r,ie=new r,oe=new _,ue=new _;return A.basisTo2D=function(e,t,a){var i=e.ellipsoid,o=_.getColumn(t,3,te),u=i.cartesianToCartographic(o,Q),s=A.eastNorthUpToFixedFrame(o,i,oe),c=_.inverseTransformation(s,ue),l=e.project(u,$),f=ne;f.x=l.z,f.y=l.x,f.z=l.y,f.w=1;var d=_.getColumn(t,0,ee),h=n.magnitude(d),E=_.multiplyByVector(c,d,re);r.fromElements(E.z,E.x,E.y,0,E);var m=_.getColumn(t,1,ee),p=n.magnitude(m),y=_.multiplyByVector(c,m,ae);r.fromElements(y.z,y.x,y.y,0,y);var T=_.getColumn(t,2,ee),R=n.magnitude(T),v=ie;return n.cross(E,y,v),n.normalize(v,v),n.cross(y,v,E),n.normalize(E,E),n.cross(v,E,y),n.normalize(y,y),n.multiplyByScalar(E,h,E),n.multiplyByScalar(y,p,y),n.multiplyByScalar(v,R,v),_.setColumn(a,0,E,a),_.setColumn(a,1,y,a),_.setColumn(a,2,v,a),_.setColumn(a,3,f,a),a},A}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,f,d,h){"use strict";function E(e,t){t=a(t,s.WGS84),e=t.scaleToGeodeticSurface(e);var r=h.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=n.fromCartesian4(l.getColumn(r,0,m)),this._yAxis=n.fromCartesian4(l.getColumn(r,1,m));var i=n.fromCartesian4(l.getColumn(r,2,m));this._plane=f.fromPointNormal(e,i)}var m=new r;o(E.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var p=new e;E.fromPoints=function(t,n){var r=e.fromPoints(t,p);return new E(r.center,n)};var y=new d,_=new n;E.prototype.projectPointOntoPlane=function(e,r){var a=y;a.origin=e,n.normalize(e,a.direction);var o=c.rayPlane(a,this._plane,_);if(i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,_)),i(o)){var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return i(r)?(r.x=s,r.y=l,r):new t(s,l)}},E.prototype.projectPointsOntoPlane=function(e,t){i(t)||(t=[]);for(var n=0,r=e.length,a=0;a<r;a++){var o=this.projectPointOntoPlane(e[a],t[n]);i(o)&&(t[n]=o,n++)}return t.length=n,t},E.prototype.projectPointToNearestOnPlane=function(e,r){i(r)||(r=new t);var a=y;a.origin=e,n.clone(this._plane.normal,a.direction);var o=c.rayPlane(a,this._plane,_);i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,_));var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return r.x=s,r.y=l,r},E.prototype.projectPointsToNearestOnPlane=function(e,t){i(t)||(t=[]);var n=e.length;t.length=n;for(var r=0;r<n;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var T=new n;return E.prototype.projectPointsOntoEllipsoid=function(e,t){var r=e.length;i(t)?t.length=r:t=new Array(r);for(var a=this._ellipsoid,o=this._origin,u=this._xAxis,s=this._yAxis,c=T,l=0;l<r;++l){var f=e[l];n.multiplyByScalar(u,f.x,c),i(t[l])||(t[l]=new n);var d=n.add(o,c,t[l]);n.multiplyByScalar(s,f.y,c),n.add(d,c,d),a.scaleToGeocentricSurface(d,d)}return t},E}),define("Core/PolylineVolumeGeometryLibrary",["./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./CornerType","./EllipsoidTangentPlane","./Math","./Matrix3","./Matrix4","./PolylinePipeline","./Quaternion","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function d(e,t){for(var n=new Array(e.length),r=0;r<e.length;r++){var a=e[r];D=t.cartesianToCartographic(a,D),n[r]=D.height,e[r]=t.scaleToGeodeticSurface(a,a)}return n}function h(e,n,r,a){var i,o=e[0],u=e[1],s=t.angleBetween(o,u),c=Math.ceil(s/a),l=new Array(c);if(n===r){for(i=0;i<c;i++)l[i]=n;return l.push(r),l}var f=r-n,d=f/c;for(i=1;i<c;i++){var h=n+i*d;l[i]=h}return l[0]=n,l.push(r),l}function E(n,r,a,o){var u=new i(a,o),s=u.projectPointOntoPlane(t.add(a,n,Y),Y),c=u.projectPointOntoPlane(t.add(a,r,k),k),l=e.angleBetween(s,c);return c.x*s.y-c.y*s.x>=0?-l:l}function m(e,n,r,a,i,o,c,l){var d=b,h=G;L=f.eastNorthUpToFixedFrame(e,i,L),d=s.multiplyByPointAsVector(L,U,d),d=t.normalize(d,d);var m=E(d,n,e,i);z=u.fromRotationZ(m,z),q.z=o,L=s.multiplyTransformation(L,s.fromRotationTranslation(z,q,F),L);var p=B;p[0]=c;for(var y=0;y<l;y++)for(var _=0;_<r.length;_+=3)h=t.fromArray(r,_,h),h=u.multiplyByVector(p,h,h),h=s.multiplyByPoint(L,h,h),a.push(h.x,h.y,h.z);return a}function p(e,n,r,a,i,o,u){for(var s=0;s<e.length;s+=3){var c=t.fromArray(e,s,W);a=m(c,n,r,a,i,o[s/3],u,1)}return a}function y(e,t){var n=e.length,r=new Array(6*n),a=0,i=t.x+t.width/2,o=t.y+t.height/2,u=e[0];r[a++]=u.x-i,r[a++]=0,r[a++]=u.y-o;for(var s=1;s<n;s++){u=e[s];var c=u.x-i,l=u.y-o;r[a++]=c,r[a++]=0,r[a++]=l,r[a++]=c,r[a++]=0,r[a++]=l}return u=e[0],r[a++]=u.x-i,r[a++]=0,r[a++]=u.y-o,r}function _(e,t){for(var n=e.length,r=new Array(3*n),a=0,i=t.x+t.width/2,o=t.y+t.height/2,u=0;u<n;u++)r[a++]=e[u].x-i,r[a++]=0,r[a++]=e[u].y-o;return r}function T(e,n,r,i,s,c,f,d,h,E){var p,y=t.angleBetween(t.subtract(n,e,w),t.subtract(r,e,C)),_=i===a.BEVELED?0:Math.ceil(y/o.toRadians(5));p=s?u.fromQuaternion(l.fromAxisAngle(t.negate(e,w),y/(_+1),V),H):u.fromQuaternion(l.fromAxisAngle(e,y/(_+1),V),H);var T,R;if(n=t.clone(n,X),_>0)for(var A=E?2:1,v=0;v<_;v++)n=u.multiplyByVector(p,n,n),T=t.subtract(n,e,w),T=t.normalize(T,T),s||(T=t.negate(T,T)),R=c.scaleToGeodeticSurface(n,C),f=m(R,T,d,f,c,h,1,A);else T=t.subtract(n,e,w),T=t.normalize(T,T),s||(T=t.negate(T,T)),R=c.scaleToGeodeticSurface(n,C),f=m(R,T,d,f,c,h,1,1),r=t.clone(r,X),T=t.subtract(r,e,w),T=t.normalize(T,T),s||(T=t.negate(T,T)),R=c.scaleToGeodeticSurface(r,C),f=m(R,T,d,f,c,h,1,1);return f}var R=[new t,new t],A=new t,v=new t,S=new t,g=new t,N=new t,I=new t,O=new t,M=new t,x=new t,w=new t,C=new t,P={},D=new r,U=new t(-1,0,0),L=new s,F=new s,z=new u,B=u.IDENTITY.clone(),b=new t,G=new n,q=new t,W=new t,V=new l,X=new t,H=new u;P.removeDuplicatesFromShape=function(t){for(var n=t.length,r=[],a=n-1,i=0;i<n;a=i++){var o=t[a],u=t[i];e.equals(o,u)||r.push(u)}return r};var Y=new t,k=new t;P.angleIsGreaterThanPi=function(e,n,r,a){var o=new i(r,a),u=o.projectPointOntoPlane(t.add(r,e,Y),Y),s=o.projectPointOntoPlane(t.add(r,n,k),k);return s.x*u.y-s.y*u.x>=0};var Z=new t,j=new t;return P.computePositions=function(e,n,r,i,u){var s=i._ellipsoid,l=d(e,s),f=i._granularity,E=i._cornerType,C=u?y(n,r):_(n,r),D=u?_(n,r):void 0,U=r.height/2,L=r.width/2,F=e.length,z=[],B=u?[]:void 0,b=A,G=v,q=S,W=g,V=N,X=I,H=O,Y=M,k=x,K=e[0],J=e[1];W=s.geodeticSurfaceNormal(K,W),b=t.subtract(J,K,b),b=t.normalize(b,b),Y=t.cross(W,b,Y),Y=t.normalize(Y,Y);var Q=l[0],$=l[1];u&&(B=m(K,Y,D,B,s,Q+U,1,1)),k=t.clone(K,k),K=J,G=t.negate(b,G);for(var ee,te,ne=1;ne<F-1;ne++){var re=u?2:1;J=e[ne+1],b=t.subtract(J,K,b),b=t.normalize(b,b),q=t.add(b,G,q),q=t.normalize(q,q),W=s.geodeticSurfaceNormal(K,W);var ae=t.multiplyByScalar(W,t.dot(b,W),Z);t.subtract(b,ae,ae),t.normalize(ae,ae);var ie=t.multiplyByScalar(W,t.dot(G,W),j);t.subtract(G,ie,ie),t.normalize(ie,ie);var oe=!o.equalsEpsilon(Math.abs(t.dot(ae,ie)),1,o.EPSILON7);if(oe){q=t.cross(q,W,q),q=t.cross(W,q,q),q=t.normalize(q,q);var ue=1/Math.max(.25,t.magnitude(t.cross(q,G,w))),se=P.angleIsGreaterThanPi(b,G,K,s);se?(V=t.add(K,t.multiplyByScalar(q,ue*L,q),V),X=t.add(V,t.multiplyByScalar(Y,L,X),X),R[0]=t.clone(k,R[0]),R[1]=t.clone(X,R[1]),ee=h(R,Q+U,$+U,f),te=c.generateArc({positions:R,granularity:f,ellipsoid:s}),z=p(te,Y,C,z,s,ee,1),Y=t.cross(W,b,Y),Y=t.normalize(Y,Y),H=t.add(V,t.multiplyByScalar(Y,L,H),H),E===a.ROUNDED||E===a.BEVELED?T(V,X,H,E,se,s,z,C,$+U,u):(q=t.negate(q,q),z=m(K,q,C,z,s,$+U,ue,re)),k=t.clone(H,k)):(V=t.add(K,t.multiplyByScalar(q,ue*L,q),V),X=t.add(V,t.multiplyByScalar(Y,-L,X),X),R[0]=t.clone(k,R[0]),R[1]=t.clone(X,R[1]),ee=h(R,Q+U,$+U,f),te=c.generateArc({positions:R,granularity:f,ellipsoid:s}),z=p(te,Y,C,z,s,ee,1),Y=t.cross(W,b,Y),Y=t.normalize(Y,Y),H=t.add(V,t.multiplyByScalar(Y,-L,H),H),E===a.ROUNDED||E===a.BEVELED?T(V,X,H,E,se,s,z,C,$+U,u):z=m(K,q,C,z,s,$+U,ue,re),k=t.clone(H,k)),G=t.negate(b,G)}else z=m(k,Y,C,z,s,Q+U,1,1),k=K;Q=$,$=l[ne+1],K=J}R[0]=t.clone(k,R[0]),R[1]=t.clone(K,R[1]),ee=h(R,Q+U,$+U,f),te=c.generateArc({positions:R,granularity:f,ellipsoid:s}),z=p(te,Y,C,z,s,ee,1),u&&(B=m(K,Y,D,B,s,$+U,1,1)),F=z.length;var ce=u?F+B.length:F,le=new Float64Array(ce);return le.set(z),u&&le.set(B,F),le},P}),define("Core/CorridorGeometryLibrary",["./Cartesian3","./CornerType","./defined","./Math","./Matrix3","./PolylinePipeline","./PolylineVolumeGeometryLibrary","./Quaternion"],function(e,t,n,r,a,i,o,u){"use strict";function s(n,i,o,s,c){var l=e.angleBetween(e.subtract(i,n,E),e.subtract(o,n,m)),f=s===t.BEVELED?1:Math.ceil(l/r.toRadians(5))+1,d=3*f,h=new Array(d);h[d-3]=o.x,h[d-2]=o.y,h[d-1]=o.z;var p;p=c?a.fromQuaternion(u.fromAxisAngle(e.negate(n,E),l/f,x),w):a.fromQuaternion(u.fromAxisAngle(n,l/f,x),w);var y=0;i=e.clone(i,E);for(var _=0;_<f;_++)i=a.multiplyByVector(p,i,i),h[y++]=i.x,h[y++]=i.y,h[y++]=i.z;return h}function c(n){var r=T,a=R,i=A,o=n[1];a=e.fromArray(n[1],o.length-3,a),i=e.fromArray(n[0],0,i),r=e.multiplyByScalar(e.add(a,i,r),.5,r);var u=s(r,a,i,t.ROUNDED,!1),c=n.length-1,l=n[c-1];o=n[c],a=e.fromArray(l,l.length-3,a),i=e.fromArray(o,0,i),r=e.multiplyByScalar(e.add(a,i,r),.5,r);var f=s(r,a,i,t.ROUNDED,!1);return[u,f]}function l(t,n,r,a){var i=E;return a?i=e.add(t,n,i):(n=e.negate(n,n),i=e.add(t,n,i)),[i.x,i.y,i.z,r.x,r.y,r.z]}function f(t,n,r,a){for(var i=new Array(t.length),o=new Array(t.length),u=e.multiplyByScalar(n,r,E),s=e.negate(u,m),c=0,l=t.length-1,f=0;f<t.length;f+=3){var d=e.fromArray(t,f,p),h=e.add(d,s,y);i[c++]=h.x,i[c++]=h.y,i[c++]=h.z;var _=e.add(d,u,y);o[l--]=_.z,o[l--]=_.y,o[l--]=_.x}return a.push(i,o),a}function d(e,t){for(var n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}var h={},E=new e,m=new e,p=new e,y=new e,_=[new e,new e],T=new e,R=new e,A=new e,v=new e,S=new e,g=new e,N=new e,I=new e,O=new e,M=new e,x=new u,w=new a;h.addAttribute=function(e,t,r,a){var i=t.x,o=t.y,u=t.z;n(r)&&(e[r]=i,e[r+1]=o,e[r+2]=u),n(a)&&(e[a]=u,e[a-1]=o,e[a-2]=i)};var C=new e,P=new e;return h.computePositions=function(n){var a=n.granularity,u=n.positions,h=n.ellipsoid;u=d(u,h);var m=n.width/2,p=n.cornerType,y=n.saveAttributes,x=T,w=R,D=A,U=v,L=S,F=g,z=N,B=I,b=O,G=M,q=[],W=y?[]:void 0,V=y?[]:void 0,X=u[0],H=u[1];w=e.normalize(e.subtract(H,X,w),w),x=h.geodeticSurfaceNormal(X,x),U=e.normalize(e.cross(x,w,U),U),y&&(W.push(U.x,U.y,U.z),V.push(x.x,x.y,x.z)),z=e.clone(X,z),X=H,D=e.negate(w,D);var Y,k,Z=[],j=u.length;for(k=1;k<j-1;k++){x=h.geodeticSurfaceNormal(X,x),H=u[k+1],w=e.normalize(e.subtract(H,X,w),w),L=e.normalize(e.add(w,D,L),L);var K=e.multiplyByScalar(x,e.dot(w,x),C);e.subtract(w,K,K),e.normalize(K,K);var J=e.multiplyByScalar(x,e.dot(D,x),P);e.subtract(D,J,J),e.normalize(J,J);var Q=!r.equalsEpsilon(Math.abs(e.dot(K,J)),1,r.EPSILON7); -if(Q){L=e.cross(L,x,L),L=e.cross(x,L,L),L=e.normalize(L,L);var $=m/Math.max(.25,e.magnitude(e.cross(L,D,E))),ee=o.angleIsGreaterThanPi(w,D,X,h);L=e.multiplyByScalar(L,$,L),ee?(B=e.add(X,L,B),G=e.add(B,e.multiplyByScalar(U,m,G),G),b=e.add(B,e.multiplyByScalar(U,2*m,b),b),_[0]=e.clone(z,_[0]),_[1]=e.clone(G,_[1]),Y=i.generateArc({positions:_,granularity:a,ellipsoid:h}),q=f(Y,U,m,q),y&&(W.push(U.x,U.y,U.z),V.push(x.x,x.y,x.z)),F=e.clone(b,F),U=e.normalize(e.cross(x,w,U),U),b=e.add(B,e.multiplyByScalar(U,2*m,b),b),z=e.add(B,e.multiplyByScalar(U,m,z),z),p===t.ROUNDED||p===t.BEVELED?Z.push({leftPositions:s(B,F,b,p,ee)}):Z.push({leftPositions:l(X,e.negate(L,L),b,ee)})):(b=e.add(X,L,b),G=e.add(b,e.negate(e.multiplyByScalar(U,m,G),G),G),B=e.add(b,e.negate(e.multiplyByScalar(U,2*m,B),B),B),_[0]=e.clone(z,_[0]),_[1]=e.clone(G,_[1]),Y=i.generateArc({positions:_,granularity:a,ellipsoid:h}),q=f(Y,U,m,q),y&&(W.push(U.x,U.y,U.z),V.push(x.x,x.y,x.z)),F=e.clone(B,F),U=e.normalize(e.cross(x,w,U),U),B=e.add(b,e.negate(e.multiplyByScalar(U,2*m,B),B),B),z=e.add(b,e.negate(e.multiplyByScalar(U,m,z),z),z),p===t.ROUNDED||p===t.BEVELED?Z.push({rightPositions:s(b,F,B,p,ee)}):Z.push({rightPositions:l(X,L,B,ee)})),D=e.negate(w,D)}X=H}x=h.geodeticSurfaceNormal(X,x),_[0]=e.clone(z,_[0]),_[1]=e.clone(X,_[1]),Y=i.generateArc({positions:_,granularity:a,ellipsoid:h}),q=f(Y,U,m,q),y&&(W.push(U.x,U.y,U.z),V.push(x.x,x.y,x.z));var te;return p===t.ROUNDED&&(te=c(q)),{positions:q,corners:Z,lefts:W,normals:V,endPositions:te}},h}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===n.POINTS||e===n.LINES||e===n.LINE_LOOP||e===n.LINE_STRIP||e===n.TRIANGLES||e===n.TRIANGLE_STRIP||e===n.TRIANGLE_FAN}};return e(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,a){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,a.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return i.computeNumberOfVertices=function(e){var n=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var a=e.attributes[r],i=a.values.length/a.componentsPerAttribute;n=i}return n},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(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 r}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.binormal=t.binormal,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,n,r,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(e){switch(e){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(t){return e(t)&&(t===i.UNSIGNED_BYTE||t===i.UNSIGNED_SHORT||t===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,n,a){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,a):new Uint16Array(t,n,a)},n(i)}),define("ThirdParty/earcut-2.1.1",[],function(){"use strict";function e(e,n,a){a=a||2;var i=n&&n.length,o=i?n[0]*a:e.length,u=t(e,0,o,a,!0),c=[];if(!u)return c;var l,f,d,h,E,m,p;if(i&&(u=s(e,n,u,a)),e.length>80*a){l=d=e[0],f=h=e[1];for(var y=a;y<o;y+=a)E=e[y],m=e[y+1],E<l&&(l=E),m<f&&(f=m),E>d&&(d=E),m>h&&(h=m);p=Math.max(d-l,h-f)}return r(u,c,a,l,f,p),c}function t(e,t,n,r,a){var i,o;if(a===M(e,t,n,r)>0)for(i=t;i<n;i+=r)o=N(i,e[i],e[i+1],o);else for(i=n-r;i>=t;i-=r)o=N(i,e[i],e[i+1],o);return o&&T(o,o.next)&&(I(o),o=o.next),o}function n(e,t){if(!e)return e;t||(t=e);var n,r=e;do if(n=!1,r.steiner||!T(r,r.next)&&0!==_(r.prev,r,r.next))r=r.next;else{if(I(r),r=t=r.prev,r===r.next)return null;n=!0}while(n||r!==t);return t}function r(e,t,s,c,l,f,h){if(e){!h&&f&&d(e,c,l,f);for(var E,m,p=e;e.prev!==e.next;)if(E=e.prev,m=e.next,f?i(e,c,l,f):a(e))t.push(E.i/s),t.push(e.i/s),t.push(m.i/s),I(e),e=m.next,p=m.next;else if(e=m,e===p){h?1===h?(e=o(e,t,s),r(e,t,s,c,l,f,2)):2===h&&u(e,t,s,c,l,f):r(n(e),t,s,c,l,f,1);break}}}function a(e){var t=e.prev,n=e,r=e.next;if(_(t,n,r)>=0)return!1;for(var a=e.next.next;a!==e.prev;){if(p(t.x,t.y,n.x,n.y,r.x,r.y,a.x,a.y)&&_(a.prev,a,a.next)>=0)return!1;a=a.next}return!0}function i(e,t,n,r){var a=e.prev,i=e,o=e.next;if(_(a,i,o)>=0)return!1;for(var u=a.x<i.x?a.x<o.x?a.x:o.x:i.x<o.x?i.x:o.x,s=a.y<i.y?a.y<o.y?a.y:o.y:i.y<o.y?i.y:o.y,c=a.x>i.x?a.x>o.x?a.x:o.x:i.x>o.x?i.x:o.x,l=a.y>i.y?a.y>o.y?a.y:o.y:i.y>o.y?i.y:o.y,f=E(u,s,t,n,r),d=E(c,l,t,n,r),h=e.nextZ;h&&h.z<=d;){if(h!==e.prev&&h!==e.next&&p(a.x,a.y,i.x,i.y,o.x,o.y,h.x,h.y)&&_(h.prev,h,h.next)>=0)return!1;h=h.nextZ}for(h=e.prevZ;h&&h.z>=f;){if(h!==e.prev&&h!==e.next&&p(a.x,a.y,i.x,i.y,o.x,o.y,h.x,h.y)&&_(h.prev,h,h.next)>=0)return!1;h=h.prevZ}return!0}function o(e,t,n){var r=e;do{var a=r.prev,i=r.next.next;!T(a,i)&&R(a,r,r.next,i)&&v(a,i)&&v(i,a)&&(t.push(a.i/n),t.push(r.i/n),t.push(i.i/n),I(r),I(r.next),r=e=i),r=r.next}while(r!==e);return r}function u(e,t,a,i,o,u){var s=e;do{for(var c=s.next.next;c!==s.prev;){if(s.i!==c.i&&y(s,c)){var l=g(s,c);return s=n(s,s.next),l=n(l,l.next),r(s,t,a,i,o,u),void r(l,t,a,i,o,u)}c=c.next}s=s.next}while(s!==e)}function s(e,r,a,i){var o,u,s,f,d,h=[];for(o=0,u=r.length;o<u;o++)s=r[o]*i,f=o<u-1?r[o+1]*i:e.length,d=t(e,s,f,i,!1),d===d.next&&(d.steiner=!0),h.push(m(d));for(h.sort(c),o=0;o<h.length;o++)l(h[o],a),a=n(a,a.next);return a}function c(e,t){return e.x-t.x}function l(e,t){if(t=f(e,t)){var r=g(t,e);n(r,r.next)}}function f(e,t){var n,r=t,a=e.x,i=e.y,o=-(1/0);do{if(i<=r.y&&i>=r.next.y){var u=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(u<=a&&u>o){if(o=u,u===a){if(i===r.y)return r;if(i===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(a===o)return n.prev;var s,c=n,l=n.x,f=n.y,d=1/0;for(r=n.next;r!==c;)a>=r.x&&r.x>=l&&p(i<f?a:o,i,l,f,i<f?o:a,i,r.x,r.y)&&(s=Math.abs(i-r.y)/(a-r.x),(s<d||s===d&&r.x>n.x)&&v(r,e)&&(n=r,d=s)),r=r.next;return n}function d(e,t,n,r){var a=e;do null===a.z&&(a.z=E(a.x,a.y,t,n,r)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next;while(a!==e);a.prevZ.nextZ=null,a.prevZ=null,h(a)}function h(e){var t,n,r,a,i,o,u,s,c=1;do{for(n=e,e=null,i=null,o=0;n;){for(o++,r=n,u=0,t=0;t<c&&(u++,r=r.nextZ,r);t++);for(s=c;u>0||s>0&&r;)0===u?(a=r,r=r.nextZ,s--):0!==s&&r?n.z<=r.z?(a=n,n=n.nextZ,u--):(a=r,r=r.nextZ,s--):(a=n,n=n.nextZ,u--),i?i.nextZ=a:e=a,a.prevZ=i,i=a;n=r}i.nextZ=null,c*=2}while(o>1);return e}function E(e,t,n,r,a){return e=32767*(e-n)/a,t=32767*(t-r)/a,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function m(e){var t=e,n=e;do t.x<n.x&&(n=t),t=t.next;while(t!==e);return n}function p(e,t,n,r,a,i,o,u){return(a-o)*(t-u)-(e-o)*(i-u)>=0&&(e-o)*(r-u)-(n-o)*(t-u)>=0&&(n-o)*(i-u)-(a-o)*(r-u)>=0}function y(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!A(e,t)&&v(e,t)&&v(t,e)&&S(e,t)}function _(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function T(e,t){return e.x===t.x&&e.y===t.y}function R(e,t,n,r){return!!(T(e,t)&&T(n,r)||T(e,r)&&T(n,t))||_(e,t,n)>0!=_(e,t,r)>0&&_(n,r,e)>0!=_(n,r,t)>0}function A(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&R(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function v(e,t){return _(e.prev,e,e.next)<0?_(e,t,e.next)>=0&&_(e,e.prev,t)>=0:_(e,t,e.prev)<0||_(e,e.next,t)<0}function S(e,t){var n=e,r=!1,a=(e.x+t.x)/2,i=(e.y+t.y)/2;do n.y>i!=n.next.y>i&&a<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function g(e,t){var n=new O(e.i,e.x,e.y),r=new O(t.i,t.x,t.y),a=e.next,i=t.prev;return e.next=t,t.prev=e,n.next=a,a.prev=n,r.next=n,n.prev=r,i.next=r,r.prev=i,r}function N(e,t,n,r){var a=new O(e,t,n);return r?(a.next=r.next,a.prev=r,r.next.prev=a,r.next=a):(a.prev=a,a.next=a),a}function I(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function O(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function M(e,t,n,r){for(var a=0,i=t,o=n-r;i<n;i+=r)a+=(e[o]-e[i])*(e[i+1]+e[o+1]),o=i;return a}return e.deviation=function(e,t,n,r){var a=t&&t.length,i=a?t[0]*n:e.length,o=Math.abs(M(e,0,i,n));if(a)for(var u=0,s=t.length;u<s;u++){var c=t[u]*n,l=u<s-1?t[u+1]*n:e.length;o-=Math.abs(M(e,c,l,n))}var f=0;for(u=0;u<r.length;u+=3){var d=r[u]*n,h=r[u+1]*n,E=r[u+2]*n;f+=Math.abs((e[d]-e[E])*(e[h+1]-e[d+1])-(e[d]-e[h])*(e[E+1]-e[d+1]))}return 0===o&&0===f?0:Math.abs((f-o)/o)},e.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,a=0;a<e.length;a++){for(var i=0;i<e[a].length;i++)for(var o=0;o<t;o++)n.vertices.push(e[a][i][o]);a>0&&(r+=e[a-1].length,n.holes.push(r))}return n},e}),define("Core/WindingOrder",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={CLOCKWISE:t.CW,COUNTER_CLOCKWISE:t.CCW,validate:function(e){return e===n.CLOCKWISE||e===n.COUNTER_CLOCKWISE}};return e(n)}),define("Core/PolygonPipeline",["../ThirdParty/earcut-2.1.1","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./Math","./PrimitiveType","./WindingOrder"],function(e,t,n,r,a,i,o,u,s,c,l,f,d){"use strict";var h=new n,E=new n,m={};m.computeArea2D=function(e){for(var t=e.length,n=0,r=t-1,a=0;a<t;r=a++){var i=e[r],o=e[a];n+=i.x*o.y-o.x*i.y}return.5*n},m.computeWindingOrder2D=function(e){var t=m.computeArea2D(e);return t>0?d.COUNTER_CLOCKWISE:d.CLOCKWISE},m.triangulate=function(n,r){var a=t.packArray(n);return e(a,r,2)};var p=new n,y=new n,_=new n,T=new n,R=new n,A=new n,v=new n;return m.computeSubdivision=function(e,t,o,u){u=a(u,l.RADIANS_PER_DEGREE);var d,h=o.slice(0),E=t.length,m=new Array(3*E),S=0;for(d=0;d<E;d++){var g=t[d];m[S++]=g.x,m[S++]=g.y,m[S++]=g.z}for(var N=[],I={},O=e.maximumRadius,M=l.chordLength(u,O),x=M*M;h.length>0;){var w,C,P=h.pop(),D=h.pop(),U=h.pop(),L=n.fromArray(m,3*U,p),F=n.fromArray(m,3*D,y),z=n.fromArray(m,3*P,_),B=n.multiplyByScalar(n.normalize(L,T),O,T),b=n.multiplyByScalar(n.normalize(F,R),O,R),G=n.multiplyByScalar(n.normalize(z,A),O,A),q=n.magnitudeSquared(n.subtract(B,b,v)),W=n.magnitudeSquared(n.subtract(b,G,v)),V=n.magnitudeSquared(n.subtract(G,B,v)),X=Math.max(q,W,V);X>x?q===X?(w=Math.min(U,D)+" "+Math.max(U,D),d=I[w],i(d)||(C=n.add(L,F,v),n.multiplyByScalar(C,.5,C),m.push(C.x,C.y,C.z),d=m.length/3-1,I[w]=d),h.push(U,d,P),h.push(d,D,P)):W===X?(w=Math.min(D,P)+" "+Math.max(D,P),d=I[w],i(d)||(C=n.add(F,z,v),n.multiplyByScalar(C,.5,C),m.push(C.x,C.y,C.z),d=m.length/3-1,I[w]=d),h.push(D,d,U),h.push(d,P,U)):V===X&&(w=Math.min(P,U)+" "+Math.max(P,U),d=I[w],i(d)||(C=n.add(z,L,v),n.multiplyByScalar(C,.5,C),m.push(C.x,C.y,C.z),d=m.length/3-1,I[w]=d),h.push(P,d,D),h.push(d,U,D)):(N.push(U),N.push(D),N.push(P))}return new s({attributes:{position:new c({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:m})},indices:N,primitiveType:f.TRIANGLES})},m.scaleToGeodeticHeight=function(e,t,r,o){r=a(r,u.WGS84);var s=h,c=E;if(t=a(t,0),o=a(o,!0),i(e))for(var l=e.length,f=0;f<l;f+=3)n.fromArray(e,f,c),o&&(c=r.scaleToGeodeticSurface(c,c)),0!==t&&(s=r.geodeticSurfaceNormal(c,s),n.multiplyByScalar(s,t,s),n.add(c,s,c)),e[f]=c.x,e[f+1]=c.y,e[f+2]=c.z;return e},m}),define("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.position=e(t.position,!1),this.normal=e(t.normal,!1),this.st=e(t.st,!1),this.binormal=e(t.binormal,!1),this.tangent=e(t.tangent,!1),this.color=e(t.color,!1)}return a.POSITION_ONLY=r(new a({position:!0})),a.POSITION_AND_NORMAL=r(new a({position:!0,normal:!0})),a.POSITION_NORMAL_AND_ST=r(new a({position:!0,normal:!0,st:!0})),a.POSITION_AND_ST=r(new a({position:!0,st:!0})),a.POSITION_AND_COLOR=r(new a({position:!0,color:!0})),a.ALL=r(new a({position:!0,normal:!0,st:!0,binormal:!0,tangent:!0})),a.DEFAULT=a.POSITION_NORMAL_AND_ST,a.packedLength=6,a.pack=function(t,n,r){return r=e(r,0),n[r++]=t.position?1:0,n[r++]=t.normal?1:0,n[r++]=t.st?1:0,n[r++]=t.binormal?1:0,n[r++]=t.tangent?1:0,n[r++]=t.color?1:0,n},a.unpack=function(n,r,i){return r=e(r,0),t(i)||(i=new a),i.position=1===n[r++],i.normal=1===n[r++],i.st=1===n[r++],i.binormal=1===n[r++],i.tangent=1===n[r++],i.color=1===n[r++],i},a.clone=function(e,n){if(t(e))return t(n)||(n=new a),n.position=e.position,n.normal=e.normal,n.st=e.st,n.binormal=e.binormal,n.tangent=e.tangent,n.color=e.color,n},a}),define("Core/CorridorGeometry",["./arrayRemoveDuplicates","./BoundingSphere","./Cartesian3","./Cartographic","./ComponentDatatype","./CornerType","./CorridorGeometryLibrary","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolygonPipeline","./PrimitiveType","./Rectangle","./VertexFormat"],function(e,t,n,r,a,i,o,u,s,c,l,f,d,h,E,m,p,y,_,T,R){"use strict";function A(e,t,r,a,i,u){var s=e.normals,c=e.tangents,l=e.binormals,f=n.normalize(n.cross(r,t,L),L);u.normal&&o.addAttribute(s,t,a,i),u.binormal&&o.addAttribute(l,r,a,i),u.tangent&&o.addAttribute(c,f,a,i)}function v(e,t,r){var i,u,c,l=e.positions,f=e.corners,d=e.endPositions,y=e.lefts,_=e.normals,T=new E,R=0,v=0,S=0;for(u=0;u<l.length;u+=2)c=l[u].length-3,R+=c,S+=2*c,v+=l[u+1].length-3;for(R+=3,v+=3,u=0;u<f.length;u++){i=f[u];var g=f[u].leftPositions;s(g)?(c=g.length,R+=c,S+=c):(c=f[u].rightPositions.length,v+=c,S+=c)}var N,I=s(d);I&&(N=d[0].length-3,R+=N,v+=N,N/=3,S+=6*N);var O,M,D,z,B,b,G=R+v,q=new Float64Array(G),W=t.normal?new Float32Array(G):void 0,V=t.tangent?new Float32Array(G):void 0,X=t.binormal?new Float32Array(G):void 0,H={normals:W,tangents:V,binormals:X},Y=0,k=G-1,Z=x,j=w,K=N/2,J=m.createTypedArray(G/3,S),Q=0;if(I){b=C,B=P;var $=d[0];for(Z=n.fromArray(_,0,Z),j=n.fromArray(y,0,j),u=0;u<K;u++)b=n.fromArray($,3*(K-1-u),b),B=n.fromArray($,3*(K+u),B),o.addAttribute(q,B,Y),o.addAttribute(q,b,void 0,k),A(H,Z,j,Y,k,t),M=Y/3,z=M+1,O=(k-2)/3,D=O-1,J[Q++]=O,J[Q++]=M,J[Q++]=D,J[Q++]=D,J[Q++]=M,J[Q++]=z,Y+=3,k-=3}var ee=0,te=0,ne=l[ee++],re=l[ee++];q.set(ne,Y),q.set(re,k-re.length+1),j=n.fromArray(y,te,j);var ae,ie;for(c=re.length-3,u=0;u<c;u+=3)ae=r.geodeticSurfaceNormal(n.fromArray(ne,u,L),L),ie=r.geodeticSurfaceNormal(n.fromArray(re,c-u,F),F),Z=n.normalize(n.add(ae,ie,Z),Z),A(H,Z,j,Y,k,t),M=Y/3,z=M+1,O=(k-2)/3,D=O-1,J[Q++]=O,J[Q++]=M,J[Q++]=D,J[Q++]=D,J[Q++]=M,J[Q++]=z,Y+=3,k-=3;for(ae=r.geodeticSurfaceNormal(n.fromArray(ne,c,L),L),ie=r.geodeticSurfaceNormal(n.fromArray(re,c,F),F),Z=n.normalize(n.add(ae,ie,Z),Z),te+=3,u=0;u<f.length;u++){var oe;i=f[u];var ue,se,ce=i.leftPositions,le=i.rightPositions,fe=U,de=C,he=P;if(Z=n.fromArray(_,te,Z),s(ce)){for(A(H,Z,j,void 0,k,t),k-=3,ue=z,se=D,oe=0;oe<ce.length/3;oe++)fe=n.fromArray(ce,3*oe,fe),J[Q++]=ue,J[Q++]=se-oe-1,J[Q++]=se-oe,o.addAttribute(q,fe,void 0,k),de=n.fromArray(q,3*(se-oe-1),de),he=n.fromArray(q,3*ue,he),j=n.normalize(n.subtract(de,he,j),j),A(H,Z,j,void 0,k,t),k-=3;fe=n.fromArray(q,3*ue,fe),de=n.subtract(n.fromArray(q,3*se,de),fe,de),he=n.subtract(n.fromArray(q,3*(se-oe),he),fe,he),j=n.normalize(n.add(de,he,j),j),A(H,Z,j,Y,void 0,t),Y+=3}else{for(A(H,Z,j,Y,void 0,t),Y+=3,ue=D,se=z,oe=0;oe<le.length/3;oe++)fe=n.fromArray(le,3*oe,fe),J[Q++]=ue,J[Q++]=se+oe,J[Q++]=se+oe+1,o.addAttribute(q,fe,Y),de=n.fromArray(q,3*ue,de),he=n.fromArray(q,3*(se+oe),he),j=n.normalize(n.subtract(de,he,j),j),A(H,Z,j,Y,void 0,t),Y+=3;fe=n.fromArray(q,3*ue,fe),de=n.subtract(n.fromArray(q,3*(se+oe),de),fe,de),he=n.subtract(n.fromArray(q,3*se,he),fe,he),j=n.normalize(n.negate(n.add(he,de,j),j),j),A(H,Z,j,void 0,k,t),k-=3}for(ne=l[ee++],re=l[ee++],ne.splice(0,3),re.splice(re.length-3,3),q.set(ne,Y),q.set(re,k-re.length+1),c=re.length-3,te+=3,j=n.fromArray(y,te,j),oe=0;oe<re.length;oe+=3)ae=r.geodeticSurfaceNormal(n.fromArray(ne,oe,L),L),ie=r.geodeticSurfaceNormal(n.fromArray(re,c-oe,F),F),Z=n.normalize(n.add(ae,ie,Z),Z),A(H,Z,j,Y,k,t),z=Y/3,M=z-1,D=(k-2)/3,O=D+1,J[Q++]=O,J[Q++]=M,J[Q++]=D,J[Q++]=D,J[Q++]=M,J[Q++]=z,Y+=3,k-=3;Y-=3,k+=3}if(Z=n.fromArray(_,_.length-3,Z),A(H,Z,j,Y,k,t),I){Y+=3,k-=3,b=C,B=P;var Ee=d[1];for(u=0;u<K;u++)b=n.fromArray(Ee,3*(N-u-1),b),B=n.fromArray(Ee,3*u,B),o.addAttribute(q,b,void 0,k),o.addAttribute(q,B,Y),A(H,Z,j,Y,k,t),z=Y/3,M=z-1,D=(k-2)/3,O=D+1,J[Q++]=O,J[Q++]=M,J[Q++]=D,J[Q++]=D,J[Q++]=M,J[Q++]=z,Y+=3,k-=3}if(T.position=new h({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:q}),t.st){var me,pe,ye=new Float32Array(G/3*2),_e=0;if(I){R/=3,v/=3;var Te=Math.PI/(N+1);pe=1/(R-N+1),me=1/(v-N+1);var Re,Ae=N/2;for(u=Ae+1;u<N+1;u++)Re=p.PI_OVER_TWO+Te*u,ye[_e++]=me*(1+Math.cos(Re)),ye[_e++]=.5*(1+Math.sin(Re));for(u=1;u<v-N+1;u++)ye[_e++]=u*me,ye[_e++]=0;for(u=N;u>Ae;u--)Re=p.PI_OVER_TWO-u*Te,ye[_e++]=1-me*(1+Math.cos(Re)),ye[_e++]=.5*(1+Math.sin(Re));for(u=Ae;u>0;u--)Re=p.PI_OVER_TWO-Te*u,ye[_e++]=1-pe*(1+Math.cos(Re)),ye[_e++]=.5*(1+Math.sin(Re));for(u=R-N;u>0;u--)ye[_e++]=u*pe,ye[_e++]=1;for(u=1;u<Ae+1;u++)Re=p.PI_OVER_TWO+Te*u,ye[_e++]=pe*(1+Math.cos(Re)),ye[_e++]=.5*(1+Math.sin(Re))}else{for(R/=3,v/=3,pe=1/(R-1),me=1/(v-1),u=0;u<v;u++)ye[_e++]=u*me,ye[_e++]=0;for(u=R;u>0;u--)ye[_e++]=(u-1)*pe,ye[_e++]=1}T.st=new h({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:ye})}return t.normal&&(T.normal=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:H.normals})),t.tangent&&(T.tangent=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:H.tangents})),t.binormal&&(T.binormal=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:H.binormals})),{attributes:T,indices:J}}function S(e,t){if(!(t.normal||t.binormal||t.tangent||t.st))return e;var r,a,i=e.position.values;(t.normal||t.binormal)&&(r=e.normal.values,a=e.binormal.values);var u,s=e.position.values.length/18,c=3*s,l=2*s,f=2*c;if(t.normal||t.binormal||t.tangent){var d=t.normal?new Float32Array(6*c):void 0,h=t.binormal?new Float32Array(6*c):void 0,E=t.tangent?new Float32Array(6*c):void 0,m=x,p=w,y=C,_=P,T=D,R=U,A=f;for(u=0;u<c;u+=3){var v=A+f;m=n.fromArray(i,u,m),p=n.fromArray(i,u+c,p),y=n.fromArray(i,(u+3)%c,y),p=n.subtract(p,m,p),y=n.subtract(y,m,y),_=n.normalize(n.cross(p,y,_),_),t.normal&&(o.addAttribute(d,_,v),o.addAttribute(d,_,v+3),o.addAttribute(d,_,A),o.addAttribute(d,_,A+3)),(t.tangent||t.binormal)&&(R=n.fromArray(r,u,R),t.binormal&&(o.addAttribute(h,R,v),o.addAttribute(h,R,v+3),o.addAttribute(h,R,A),o.addAttribute(h,R,A+3)),t.tangent&&(T=n.normalize(n.cross(R,_,T),T),o.addAttribute(E,T,v),o.addAttribute(E,T,v+3),o.addAttribute(E,T,A),o.addAttribute(E,T,A+3))),A+=6}if(t.normal){for(d.set(r),u=0;u<c;u+=3)d[u+c]=-r[u],d[u+c+1]=-r[u+1],d[u+c+2]=-r[u+2];e.normal.values=d}else e.normal=void 0;if(t.binormal?(h.set(a),h.set(a,c),e.binormal.values=h):e.binormal=void 0,t.tangent){var S=e.tangent.values;E.set(S),E.set(S,c),e.tangent.values=E}}if(t.st){var g=e.st.values,N=new Float32Array(6*l);N.set(g),N.set(g,l);for(var I=2*l,O=0;O<2;O++){for(N[I++]=g[0],N[I++]=g[1],u=2;u<l;u+=2){var M=g[u],L=g[u+1];N[I++]=M,N[I++]=L,N[I++]=M,N[I++]=L}N[I++]=g[0],N[I++]=g[1]}e.st.values=N}return e}function g(e,t,n){n[t++]=e[0],n[t++]=e[1],n[t++]=e[2];for(var r=3;r<e.length;r+=3){var a=e[r],i=e[r+1],o=e[r+2];n[t++]=a,n[t++]=i,n[t++]=o,n[t++]=a,n[t++]=i,n[t++]=o}return n[t++]=e[0],n[t++]=e[1],n[t++]=e[2],n}function N(e,t){var n=new R({position:t.positon,normal:t.normal||t.binormal,tangent:t.tangent,binormal:t.normal||t.binormal,st:t.st}),r=e.ellipsoid,a=o.computePositions(e),i=v(a,n,r),u=e.height,s=e.extrudedHeight,c=i.attributes,l=i.indices,f=c.position.values,d=f.length,h=new Float64Array(6*d),E=new Float64Array(d);E.set(f);var p=new Float64Array(4*d);f=y.scaleToGeodeticHeight(f,u,r),p=g(f,0,p),E=y.scaleToGeodeticHeight(E,s,r),p=g(E,2*d,p),h.set(f),h.set(E,d),h.set(p,2*d),c.position.values=h,d/=3;var _,T=l.length,A=d+d,N=m.createTypedArray(h.length/3,2*T+3*A);N.set(l);var I=T;for(_=0;_<T;_+=3){var O=l[_],M=l[_+1],x=l[_+2];N[I++]=x+d,N[I++]=M+d,N[I++]=O+d}c=S(c,t);var w,C,P,D;for(_=0;_<A;_+=2)w=_+A,C=w+A,P=w+1,D=C+1,N[I++]=w,N[I++]=C,N[I++]=P,N[I++]=P,N[I++]=C,N[I++]=D;return{attributes:c,indices:N}}function I(e,t,r,a,i,o){var u=n.subtract(t,e,z);n.normalize(u,u);var s=r.geodeticSurfaceNormal(e,B),c=n.cross(u,s,z);n.multiplyByScalar(c,a,c);var l=i.latitude,f=i.longitude,d=o.latitude,h=o.longitude;n.add(e,c,B),r.cartesianToCartographic(B,b);var E=b.latitude,m=b.longitude;l=Math.min(l,E),f=Math.min(f,m),d=Math.max(d,E),h=Math.max(h,m),n.subtract(e,c,B),r.cartesianToCartographic(B,b),E=b.latitude,m=b.longitude,l=Math.min(l,E),f=Math.min(f,m),d=Math.max(d,E),h=Math.max(h,m),i.latitude=l,i.longitude=f,o.latitude=d,o.longitude=h}function O(t,r,a,o){var u=e(t,n.equalsEpsilon),s=u.length;if(s<2||a<=0)return new T;var c=.5*a;W.latitude=Number.POSITIVE_INFINITY,W.longitude=Number.POSITIVE_INFINITY,V.latitude=Number.NEGATIVE_INFINITY,V.longitude=Number.NEGATIVE_INFINITY;var l,f;if(o===i.ROUNDED){var d=u[0];n.subtract(d,u[1],G),n.normalize(G,G),n.multiplyByScalar(G,c,G),n.add(d,G,q),r.cartesianToCartographic(q,b),l=b.latitude,f=b.longitude,W.latitude=Math.min(W.latitude,l),W.longitude=Math.min(W.longitude,f),V.latitude=Math.max(V.latitude,l),V.longitude=Math.max(V.longitude,f)}for(var h=0;h<s-1;++h)I(u[h],u[h+1],r,c,W,V);var E=u[s-1];n.subtract(E,u[s-2],G),n.normalize(G,G),n.multiplyByScalar(G,c,G),n.add(E,G,q),I(E,q,r,c,W,V),o===i.ROUNDED&&(r.cartesianToCartographic(q,b),l=b.latitude,f=b.longitude,W.latitude=Math.min(W.latitude,l),W.longitude=Math.min(W.longitude,f),V.latitude=Math.max(V.latitude,l),V.longitude=Math.max(V.longitude,f));var m=new T;return m.north=V.latitude,m.south=W.latitude,m.east=V.longitude,m.west=W.longitude,m}function M(e){e=u(e,u.EMPTY_OBJECT);var t=e.positions,r=e.width;this._positions=t,this._ellipsoid=f.clone(u(e.ellipsoid,f.WGS84)),this._vertexFormat=R.clone(u(e.vertexFormat,R.DEFAULT)),this._width=r,this._height=u(e.height,0),this._extrudedHeight=u(e.extrudedHeight,this._height),this._cornerType=u(e.cornerType,i.ROUNDED),this._granularity=u(e.granularity,p.RADIANS_PER_DEGREE),this._workerName="createCorridorGeometry",this._rectangle=O(t,this._ellipsoid,r,this._cornerType),this.packedLength=1+t.length*n.packedLength+f.packedLength+R.packedLength+T.packedLength+5}var x=new n,w=new n,C=new n,P=new n,D=new n,U=new n,L=new n,F=new n,z=new n,B=new n,b=new r,G=new n,q=new n,W=new r,V=new r;M.pack=function(e,t,r){r=u(r,0);var a=e._positions,i=a.length;t[r++]=i;for(var o=0;o<i;++o,r+=n.packedLength)n.pack(a[o],t,r);return f.pack(e._ellipsoid,t,r),r+=f.packedLength,R.pack(e._vertexFormat,t,r),r+=R.packedLength,T.pack(e._rectangle,t,r),r+=T.packedLength,t[r++]=e._width,t[r++]=e._height,t[r++]=e._extrudedHeight,t[r++]=e._cornerType,t[r]=e._granularity,t};var X=f.clone(f.UNIT_SPHERE),H=new R,Y=new T,k={positions:void 0,ellipsoid:X,vertexFormat:H,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0};return M.unpack=function(e,t,r){t=u(t,0);for(var a=e[t++],i=new Array(a),o=0;o<a;++o,t+=n.packedLength)i[o]=n.unpack(e,t);var c=f.unpack(e,t,X);t+=f.packedLength;var l=R.unpack(e,t,H);t+=R.packedLength;var d=T.unpack(e,t,Y);t+=T.packedLength;var h=e[t++],E=e[t++],m=e[t++],p=e[t++],y=e[t];return s(r)?(r._positions=i,r._ellipsoid=f.clone(c,r._ellipsoid),r._vertexFormat=R.clone(l,r._vertexFormat),r._width=h,r._height=E,r._extrudedHeight=m,r._cornerType=p,r._granularity=y,r._rectangle=T.clone(d),r):(k.positions=i,k.width=h,k.height=E,k.extrudedHeight=m,k.cornerType=p,k.granularity=y,new M(k))},M.createGeometry=function(r){var a=r._positions,i=r._height,u=r._width,s=r._extrudedHeight,c=i!==s,l=e(a,n.equalsEpsilon);if(!(l.length<2||u<=0)){var f,h=r._ellipsoid,E=r._vertexFormat,m={ellipsoid:h,positions:l,width:u,cornerType:r._cornerType,granularity:r._granularity,saveAttributes:!0};if(c){var p=Math.max(i,s);s=Math.min(i,s),i=p,m.height=i,m.extrudedHeight=s,f=N(m,E)}else{var T=o.computePositions(m);f=v(T,E,h),f.attributes.position.values=y.scaleToGeodeticHeight(f.attributes.position.values,i,h)}var R=f.attributes,A=t.fromVertices(R.position.values,void 0,3);return E.position||(f.attributes.position.values=void 0),new d({attributes:R,indices:f.indices,primitiveType:_.TRIANGLES,boundingSphere:A})}},M.createShadowVolume=function(e,t,n){var r=e._granularity,a=e._ellipsoid,i=t(r,a),o=n(r,a);return new M({positions:e._positions,width:e._width,cornerType:e._cornerType,ellipsoid:a,granularity:r,extrudedHeight:i,height:o,vertexFormat:R.POSITION_ONLY})},c(M.prototype,{rectangle:{get:function(){return this._rectangle}}}),M}),define("Workers/createCorridorGeometry",["../Core/CorridorGeometry","../Core/defined","../Core/Ellipsoid"],function(e,t,n){"use strict";function r(r,a){return t(a)&&(r=e.unpack(r,a)),r._ellipsoid=n.clone(r._ellipsoid),e.createGeometry(r)}return r})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==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";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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 n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(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^=e<<7&2636928640,e^=e<<15&4022730752,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,n,r){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:e<0?-1:0},a.signNotZero=function(e){return e<0?-1:1},a.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*a.clamp(e,-1,1)+.5)*n)},a.fromSNorm=function(e,n){return n=t(n,255),a.clamp(e,0,n)/n*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},a.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},a.lerp=function(e,t,n){return(1-n)*e+n*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){var t=a.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},a.clampToLatitudeRange=function(e){return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){return(e%t+t)%t},a.equalsEpsilon=function(e,n,r,a){a=t(a,r);var i=Math.abs(e-n);return i<=a||i<=r*Math.max(Math.abs(e),Math.abs(n))};var i=[1];a.factorial=function(e){var t=i.length;if(e>=t)for(var n=i[t-1],r=t;r<=e;r++)i.push(n*r);return i[e]},a.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},a.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return a.setRandomNumberSeed=function(t){o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(e){return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){return Math.log(e)/Math.log(t)},a.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},a}),define("Core/arrayRemoveDuplicates",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(n,r,a){if(t(n)){a=e(a,!1);var o=n.length;if(o<2)return n;var u,s,c;for(u=1;u<o&&(s=n[u-1],c=n[u],!r(s,c,i));++u);if(u===o)return a&&r(n[0],n[n.length-1],i)?n.slice(1):n;for(var l=n.slice(0,u);u<o;++u)c=n[u],r(s,c,i)||(l.push(c),s=c);return a&&l.length>1&&r(l[0],l[l.length-1],i)&&l.shift(),l}}var i=r.EPSILON10;return a}),define("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e){return e+" is required, actual value was undefined"}function r(e,t,n){return"Expected "+n+" to be typeof "+t+", actual typeof was "+e}var a={};return a.typeOf={},a.defined=function(r,a){if(!e(a))throw new t(n(r))},a.typeOf.func=function(e,n){if("function"!=typeof n)throw new t(r(typeof n,"function",e))},a.typeOf.string=function(e,n){if("string"!=typeof n)throw new t(r(typeof n,"string",e))},a.typeOf.number=function(e,n){if("number"!=typeof n)throw new t(r(typeof n,"number",e))},a.typeOf.number.lessThan=function(e,n,r){if(a.typeOf.number(e,n),n>=r)throw new t("Expected "+e+" to be less than "+r+", actual value was "+n)},a.typeOf.number.lessThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n>r)throw new t("Expected "+e+" to be less than or equal to "+r+", actual value was "+n)},a.typeOf.number.greaterThan=function(e,n,r){if(a.typeOf.number(e,n),n<=r)throw new t("Expected "+e+" to be greater than "+r+", actual value was "+n)},a.typeOf.number.greaterThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n<r)throw new t("Expected "+e+" to be greater than or equal to"+r+", actual value was "+n)},a.typeOf.object=function(e,n){if("object"!=typeof n)throw new t(r(typeof n,"object",e))},a.typeOf.bool=function(e,n){if("boolean"!=typeof n)throw new t(r(typeof n,"boolean",e))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var a=e.clock,i=e.cone,u=t(e.magnitude,1),s=u*Math.sin(i);return r.x=s*Math.cos(a),r.y=s*Math.sin(a),r.z=u*Math.cos(i),r},o.fromElements=function(e,t,r,a){return n(a)?(a.x=e,a.y=t,a.z=r,a):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var a=0;a<r;++a)o.pack(e[a],t,3*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var a=0;a<r;a+=3){var i=a/3;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,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};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var n=o.dot(c,l),r=o.magnitude(o.cross(c,l,c));return Math.atan2(r,n)};var f=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)},o.cross=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=t.x,u=t.y,s=t.z,c=a*s-i*u,l=i*o-r*s,f=r*u-a*o;return n.x=c,n.y=l,n.z=f,n},o.fromDegrees=function(e,t,n,r,a){return e=i.toRadians(e),t=i.toRadians(t),o.fromRadians(e,t,n,r,a)};var d=new o,h=new o,E=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,a,i,u){a=t(a,0);var s=n(i)?i.radiiSquared:E,c=Math.cos(r);d.x=c*Math.cos(e),d.y=c*Math.sin(e),d.z=Math.sin(r),d=o.normalize(d,d),o.multiplyComponents(s,d,h);var l=Math.sqrt(o.dot(d,h));return h=o.divideByScalar(h,l,h),d=o.multiplyByScalar(d,a,d),n(u)||(u=new o),o.add(h,d,u)},o.fromDegreesArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromDegrees(u,s,0,t,r[c])}return r},o.fromRadiansArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromRadians(u,s,0,t,r[c])}return r},o.fromDegreesArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromDegrees(u,s,c,t,r[l])}return r},o.fromRadiansArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromRadians(u,s,c,t,r[l])}return r},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(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,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(n,a,u,s,c){var l=n.x,f=n.y,d=n.z,h=a.x,E=a.y,m=a.z,p=l*l*h*h,y=f*f*E*E,_=d*d*m*m,T=p+y+_,R=Math.sqrt(1/T),A=e.multiplyByScalar(n,R,i);if(T<s)return isFinite(R)?e.clone(A,c):void 0;var v=u.x,S=u.y,g=u.z,N=o;N.x=A.x*v*2,N.y=A.y*S*2,N.z=A.z*g*2;var O,I,M,w,x,C,P,D,U,L,F,z=(1-R)*e.magnitude(n)/(.5*e.magnitude(N)),B=0;do{z-=B,M=1/(1+z*v),w=1/(1+z*S),x=1/(1+z*g),C=M*M,P=w*w,D=x*x,U=C*M,L=P*w,F=D*x,O=p*C+y*P+_*D-1,I=p*U*v+y*L*S+_*F*g;var b=-2*I;B=O/b}while(Math.abs(O)>r.EPSILON12);return t(c)?(c.x=l*M,c.y=f*w,c.z=d*x,c):new e(l*M,f*w,d*x)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o){"use strict";function u(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)}u.fromRadians=function(e,r,a,i){return a=t(a,0),n(i)?(i.longitude=e,i.latitude=r,i.height=a,i):new u(e,r,a)},u.fromDegrees=function(e,t,n,r){return e=i.toRadians(e),t=i.toRadians(t),u.fromRadians(e,t,n,r)};var s=new e,c=new e,l=new e,f=new e(1/6378137,1/6378137,1/6356752.314245179),d=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),h=i.EPSILON1;return u.fromCartesian=function(t,r,a){var E=n(r)?r.oneOverRadii:f,m=n(r)?r.oneOverRadiiSquared:d,p=n(r)?r._centerToleranceSquared:h,y=o(t,E,m,p,c);if(n(y)){var _=e.multiplyComponents(y,m,s);_=e.normalize(_,_);var T=e.subtract(t,y,l),R=Math.atan2(_.y,_.x),A=Math.asin(_.z),v=i.sign(e.dot(T,t))*e.magnitude(T);return n(a)?(a.longitude=R,a.latitude=A,a.height=v,a):new u(R,A,v)}},u.clone=function(e,t){if(n(e))return n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},u.ZERO=a(new u(0,0,0)),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,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(t,r,a,i){r=n(r,0),a=n(a,0),i=n(i,0),t._radii=new e(r,a,i),t._radiiSquared=new e(r*r,a*a,i*i),t._radiiToTheFourth=new e(r*r*r*r,a*a*a*a,i*i*i*i),t._oneOverRadii=new e(0===r?0:1/r,0===a?0:1/a,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===a?0:1/(a*a),0===i?0:1/(i*i)),t._minimumRadius=Math.min(r,a,i),t._maximumRadius=Math.max(r,a,i),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,c(this,e,t,n)}a(l.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}}}),l.clone=function(t,n){if(r(t)){var a=t._radii;return r(n)?(e.clone(a,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new l(a.x,a.y,a.z)}},l.fromCartesian3=function(e,t){return r(t)||(t=new l),r(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,r,a){return a=n(a,0),e.pack(t._radii,r,a),r},l.unpack=function(t,r,a){r=n(r,0);var i=e.unpack(t,r);return l.fromCartesian3(i,a)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,n){var a=t.longitude,i=t.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return r(n)||(n=new e),n.x=u,n.y=s,n.z=c,e.normalize(n,n)},l.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var f=new e,d=new e;l.prototype.cartographicToCartesian=function(t,n){var a=f,i=d;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(e.dot(a,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(a,t.height,a),r(n)||(n=new e),e.add(i,a,n)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var h=new e,E=new e,m=new e;return l.prototype.cartesianToCartographic=function(n,a){var i=this.scaleToGeodeticSurface(n,E);if(r(i)){var o=this.geodeticSurfaceNormal(i,h),s=e.subtract(n,i,m),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),f=u.sign(e.dot(s,n))*e.magnitude(s);return r(a)?(a.longitude=c,a.latitude=l,a.height=f,a):new t(c,l,f)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var a=t.x,i=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return e.multiplyByScalar(t,s,n)},l.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},l.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},l.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,a,i){a=n(a,0);var o=this._sqauredXOverSquaredZ;if(r(i)||(i=new e),i.x=0,i.y=0,i.z=t.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},l}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,a,i,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return r(n)?(n.x=i,n.y=o,n.z=u,n):new e(i,o,u)},u.prototype.unproject=function(e,n){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,u=e.z;return r(n)?(n.longitude=i,n.latitude=o,n.height=u,n):new t(i,o,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";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a,i,o,u,s,c){this[0]=n(e,0),this[1]=n(a,0),this[2]=n(u,0),this[3]=n(t,0),this[4]=n(i,0),this[5]=n(s,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(c,0)}function c(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function l(e){for(var t=0,n=0;n<3;++n){var r=e[s.getElementIndex(m[n],E[n])];t+=2*r*r}return Math.sqrt(t)}function f(e,t){for(var n=u.EPSILON15,r=0,a=1,i=0;i<3;++i){var o=Math.abs(e[s.getElementIndex(m[i],E[i])]);o>r&&(a=i,r=o)}var c=1,l=0,f=E[a],d=m[a];if(Math.abs(e[s.getElementIndex(d,f)])>n){var h,p=e[s.getElementIndex(d,d)],y=e[s.getElementIndex(f,f)],_=e[s.getElementIndex(d,f)],T=(p-y)/2/_;h=T<0?-1/(-T+Math.sqrt(1+T*T)):1/(T+Math.sqrt(1+T*T)),c=1/Math.sqrt(1+h*h),l=h*c}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(f,f)]=t[s.getElementIndex(d,d)]=c,t[s.getElementIndex(d,f)]=l,t[s.getElementIndex(f,d)]=-l,t}s.packedLength=9,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t},s.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a},s.clone=function(e,t){if(r(e))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):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t],a[1]=e[t+1],a[2]=e[t+2],a[3]=e[t+3],a[4]=e[t+4],a[5]=e[t+5],a[6]=e[t+6],a[7]=e[t+7],a[8]=e[t+8],a},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[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 s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var n=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,u=e.y*e.y,c=e.y*e.z,l=e.y*e.w,f=e.z*e.z,d=e.z*e.w,h=e.w*e.w,E=n-u-f+h,m=2*(a-d),p=2*(i+l),y=2*(a+d),_=-n+u-f+h,T=2*(c-o),R=2*(i-l),A=2*(c+o),v=-n-u+f+h;return r(t)?(t[0]=E,t[1]=y,t[2]=R,t[3]=m,t[4]=_,t[5]=A,t[6]=p,t[7]=T,t[8]=v,t):new s(E,m,p,y,_,T,R,A,v)},s.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),a=Math.cos(-e.heading),i=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),c=Math.sin(e.roll),l=n*a,f=-i*u+c*o*a,d=c*u+i*o*a,h=n*u,E=i*a+c*o*u,m=-o*i+i*o*u,p=-o,y=c*n,_=i*n;return r(t)?(t[0]=l,t[1]=h,t[2]=p,t[3]=f,t[4]=E,t[5]=y,t[6]=d,t[7]=m,t[8]=_,t):new s(l,f,d,h,E,m,p,y,_)},s.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 s(e.x,0,0,0,e.y,0,0,0,e.z)},s.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 s(e,0,0,0,e,0,0,0,e)},s.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 s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=a,t[6]=0,t[7]=-a,t[8]=n,t):new s(1,0,0,0,n,-a,0,a,n)},s.fromRotationY=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=n,t):new s(n,0,a,0,1,0,-a,0,n)},s.fromRotationZ=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=a,t[2]=0,t[3]=-a,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(n,-a,0,a,n,0,0,0,1)},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):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,n){var r=3*t,a=e[r],i=e[r+1],o=e[r+2];return n.x=a,n.y=i,n.z=o,n},s.setColumn=function(e,t,n,r){r=s.clone(e,r);var a=3*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},s.getRow=function(e,t,n){var r=e[t],a=e[t+3],i=e[t+6];return n.x=r,n.y=a,n.z=i,n},s.setRow=function(e,t,n,r){return r=s.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var d=new e;s.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],d)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],d)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],d)),n};var h=new e;s.getMaximumScale=function(t){return s.getScale(t,h),e.maximumComponent(h)},s.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=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 n[0]=r,n[1]=a,n[2]=i,n[3]=o,n[4]=u,n[5]=s,n[6]=c,n[7]=l,n[8]=f,n},s.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},s.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},s.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[3]*a+e[6]*i,u=e[1]*r+e[4]*a+e[7]*i,s=e[2]*r+e[5]*a+e[8]*i;return n.x=o,n.y=u,n.z=s,n},s.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},s.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},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},s.transpose=function(e,t){var n=e[0],r=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=n,t[1]=r,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var E=[1,0,0],m=[2,2,1],p=new s,y=new s;return s.computeEigenDecomposition=function(e,t){var n=u.EPSILON20,a=10,i=0,o=0;r(t)||(t={});for(var d=t.unitary=s.clone(s.IDENTITY,t.unitary),h=t.diagonal=s.clone(e,t.diagonal),E=n*c(h);o<a&&l(h)>E;)f(h,p),s.transpose(p,y),s.multiply(h,p,h),s.multiply(y,h,h),s.multiply(d,p,d),++i>2&&(++o,i=0);return 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},s.determinant=function(e){var t=e[0],n=e[3],r=e[6],a=e[1],i=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*o)+a*(s*r-n*c)+u*(n*o-i*r)},s.inverse=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[3],o=e[4],u=e[5],c=e[6],l=e[7],f=e[8],d=s.determinant(e);t[0]=o*f-l*u,t[1]=l*a-r*f,t[2]=r*u-o*a,t[3]=c*u-i*f,t[4]=n*f-c*a,t[5]=i*a-n*u,t[6]=i*l-c*o,t[7]=c*r-n*l,t[8]=n*o-i*r;var h=1/d;return s.multiplyByScalar(t,h,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]},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},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,a(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r,a){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(a,0)}o.fromElements=function(e,t,r,a,i){return n(i)?(i.x=e,i.y=t,i.z=r,i.w=a,i):new o(e,t,r,a)},o.fromColor=function(e,t){return n(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(n(e))return n(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)},o.packedLength=4,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r++],a.w=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=4*r:t=new Array(4*r);for(var a=0;a<r;++a)o.pack(e[a],t,4*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/4:t=new Array(r/4);for(var a=0;a<r;a+=4){var i=a/4;t[i]=o.unpack(e,a,t[i])}return t},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,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},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 u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,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,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},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 s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,c);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)&&i.equalsEpsilon(e.w,t.w,r,a)},o.ZERO=a(new o(0,0,0,0)),o.UNIT_X=a(new o(1,0,0,0)),o.UNIT_Y=a(new o(0,1,0,0)),o.UNIT_Z=a(new o(0,0,1,0)),o.UNIT_W=a(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,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){ +this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,a,i,o,u,s,c,l){"use strict";function f(e,t,n,a,i,o,u,s,c,l,f,d,h,E,m,p){this[0]=r(e,0),this[1]=r(i,0),this[2]=r(c,0),this[3]=r(h,0),this[4]=r(t,0),this[5]=r(o,0),this[6]=r(l,0),this[7]=r(E,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(f,0),this[11]=r(m,0),this[12]=r(a,0),this[13]=r(s,0),this[14]=r(d,0),this[15]=r(p,0)}f.packedLength=16,f.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},f.unpack=function(e,t,n){return t=r(t,0),a(n)||(n=new f),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},f.clone=function(e,t){if(a(e))return a(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 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])},f.fromArray=f.unpack,f.fromColumnMajorArray=function(e,t){return f.clone(e,t)},f.fromRowMajorArray=function(e,t){return a(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 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(t,n,i){return n=r(n,e.ZERO),a(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=1,i):new f(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},f.fromTranslationQuaternionRotationScale=function(e,t,n,r){a(r)||(r=new f);var i=n.x,o=n.y,u=n.z,s=t.x*t.x,c=t.x*t.y,l=t.x*t.z,d=t.x*t.w,h=t.y*t.y,E=t.y*t.z,m=t.y*t.w,p=t.z*t.z,y=t.z*t.w,_=t.w*t.w,T=s-h-p+_,R=2*(c-y),A=2*(l+m),v=2*(c+y),S=-s+h-p+_,g=2*(E-d),N=2*(l-m),O=2*(E+d),I=-s-h+p+_;return r[0]=T*i,r[1]=v*i,r[2]=N*i,r[3]=0,r[4]=R*o,r[5]=S*o,r[6]=O*o,r[7]=0,r[8]=A*u,r[9]=g*u,r[10]=I*u,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},f.fromTranslationRotationScale=function(e,t){return f.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},f.fromTranslation=function(e,t){return f.fromRotationTranslation(c.IDENTITY,e,t)},f.fromScale=function(e,t){return a(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 f(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},f.fromUniformScale=function(e,t){return a(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 f(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var d=new e,h=new e,E=new e;f.fromCamera=function(t,n){var r=t.position,i=t.direction,o=t.up;e.normalize(i,d),e.normalize(e.cross(d,o,h),h),e.normalize(e.cross(h,d,E),E);var u=h.x,s=h.y,c=h.z,l=d.x,m=d.y,p=d.z,y=E.x,_=E.y,T=E.z,R=r.x,A=r.y,v=r.z,S=u*-R+s*-A+c*-v,g=y*-R+_*-A+T*-v,N=l*R+m*A+p*v;return a(n)?(n[0]=u,n[1]=y,n[2]=-l,n[3]=0,n[4]=s,n[5]=_,n[6]=-m,n[7]=0,n[8]=c,n[9]=T,n[10]=-p,n[11]=0,n[12]=S,n[13]=g,n[14]=N,n[15]=1,n):new f(u,s,c,S,y,_,T,g,-l,-m,-p,N,0,0,0,1)},f.computePerspectiveFieldOfView=function(e,t,n,r,a){var i=Math.tan(.5*e),o=1/i,u=o/t,s=(r+n)/(n-r),c=2*r*n/(n-r);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=c,a[15]=0,a},f.computeOrthographicOffCenter=function(e,t,n,r,a,i,o){var u=1/(t-e),s=1/(r-n),c=1/(i-a),l=-(t+e)*u,f=-(r+n)*s,d=-(i+a)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=f,o[14]=d,o[15]=1,o},f.computePerspectiveOffCenter=function(e,t,n,r,a,i,o){var u=2*a/(t-e),s=2*a/(r-n),c=(t+e)/(t-e),l=(r+n)/(r-n),f=-(i+a)/(i-a),d=-1,h=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=f,o[11]=d,o[12]=0,o[13]=0,o[14]=h,o[15]=0,o},f.computeInfinitePerspectiveOffCenter=function(e,t,n,r,a,i){var o=2*a/(t-e),u=2*a/(r-n),s=(t+e)/(t-e),c=(r+n)/(r-n),l=-1,f=-1,d=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=s,i[9]=c,i[10]=l,i[11]=f,i[12]=0,i[13]=0,i[14]=d,i[15]=0,i},f.computeViewportTransformation=function(e,t,n,a){e=r(e,r.EMPTY_OBJECT);var i=r(e.x,0),o=r(e.y,0),u=r(e.width,0),s=r(e.height,0);t=r(t,0),n=r(n,1);var c=.5*u,l=.5*s,f=.5*(n-t),d=c,h=l,E=f,m=i+c,p=o+l,y=t+f,_=1;return a[0]=d,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=h,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=E,a[11]=0,a[12]=m,a[13]=p,a[14]=y,a[15]=_,a},f.computeView=function(t,n,r,a,i){return i[0]=a.x,i[1]=r.x,i[2]=-n.x,i[3]=0,i[4]=a.y,i[5]=r.y,i[6]=-n.y,i[7]=0,i[8]=a.z,i[9]=r.z,i[10]=-n.z,i[11]=0,i[12]=-e.dot(a,t),i[13]=-e.dot(r,t),i[14]=e.dot(n,t),i[15]=1,i},f.toArray=function(e,t){return a(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]]},f.getElementIndex=function(e,t){return 4*e+t},f.getColumn=function(e,t,n){var r=4*t,a=e[r],i=e[r+1],o=e[r+2],u=e[r+3];return n.x=a,n.y=i,n.z=o,n.w=u,n},f.setColumn=function(e,t,n,r){r=f.clone(e,r);var a=4*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r[a+3]=n.w,r},f.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},f.getRow=function(e,t,n){var r=e[t],a=e[t+4],i=e[t+8],o=e[t+12];return n.x=r,n.y=a,n.z=i,n.w=o,n},f.setRow=function(e,t,n,r){return r=f.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var m=new e;f.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],m)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],m)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],m)),n};var p=new e;f.getMaximumScale=function(t){return f.getScale(t,p),e.maximumComponent(p)},f.multiply=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],f=e[8],d=e[9],h=e[10],E=e[11],m=e[12],p=e[13],y=e[14],_=e[15],T=t[0],R=t[1],A=t[2],v=t[3],S=t[4],g=t[5],N=t[6],O=t[7],I=t[8],M=t[9],w=t[10],x=t[11],C=t[12],P=t[13],D=t[14],U=t[15],L=r*T+u*R+f*A+m*v,F=a*T+s*R+d*A+p*v,z=i*T+c*R+h*A+y*v,B=o*T+l*R+E*A+_*v,b=r*S+u*g+f*N+m*O,G=a*S+s*g+d*N+p*O,q=i*S+c*g+h*N+y*O,W=o*S+l*g+E*N+_*O,V=r*I+u*M+f*w+m*x,X=a*I+s*M+d*w+p*x,H=i*I+c*M+h*w+y*x,Y=o*I+l*M+E*w+_*x,k=r*C+u*P+f*D+m*U,Z=a*C+s*P+d*D+p*U,j=i*C+c*P+h*D+y*U,K=o*C+l*P+E*D+_*U;return n[0]=L,n[1]=F,n[2]=z,n[3]=B,n[4]=b,n[5]=G,n[6]=q,n[7]=W,n[8]=V,n[9]=X,n[10]=H,n[11]=Y,n[12]=k,n[13]=Z,n[14]=j,n[15]=K,n},f.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},f.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},f.multiplyTransformation=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],d=e[12],h=e[13],E=e[14],m=t[0],p=t[1],y=t[2],_=t[4],T=t[5],R=t[6],A=t[8],v=t[9],S=t[10],g=t[12],N=t[13],O=t[14],I=r*m+o*p+c*y,M=a*m+u*p+l*y,w=i*m+s*p+f*y,x=r*_+o*T+c*R,C=a*_+u*T+l*R,P=i*_+s*T+f*R,D=r*A+o*v+c*S,U=a*A+u*v+l*S,L=i*A+s*v+f*S,F=r*g+o*N+c*O+d,z=a*g+u*N+l*O+h,B=i*g+s*N+f*O+E;return n[0]=I,n[1]=M,n[2]=w,n[3]=0,n[4]=x,n[5]=C,n[6]=P,n[7]=0,n[8]=D,n[9]=U,n[10]=L,n[11]=0,n[12]=F,n[13]=z,n[14]=B,n[15]=1,n},f.multiplyByMatrix3=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],d=t[0],h=t[1],E=t[2],m=t[3],p=t[4],y=t[5],_=t[6],T=t[7],R=t[8],A=r*d+o*h+c*E,v=a*d+u*h+l*E,S=i*d+s*h+f*E,g=r*m+o*p+c*y,N=a*m+u*p+l*y,O=i*m+s*p+f*y,I=r*_+o*T+c*R,M=a*_+u*T+l*R,w=i*_+s*T+f*R;return n[0]=A,n[1]=v,n[2]=S,n[3]=0,n[4]=g,n[5]=N,n[6]=O,n[7]=0,n[8]=I,n[9]=M,n[10]=w,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},f.multiplyByTranslation=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=r*e[0]+a*e[4]+i*e[8]+e[12],u=r*e[1]+a*e[5]+i*e[9]+e[13],s=r*e[2]+a*e[6]+i*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=s,n[15]=e[15],n};var y=new e;f.multiplyByUniformScale=function(e,t,n){return y.x=t,y.y=t,y.z=t,f.multiplyByScale(e,y,n)},f.multiplyByScale=function(e,t,n){var r=t.x,a=t.y,i=t.z;return 1===r&&1===a&&1===i?f.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=a*e[4],n[5]=a*e[5],n[6]=a*e[6],n[7]=0,n[8]=i*e[8],n[9]=i*e[9],n[10]=i*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},f.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=t.w,u=e[0]*r+e[4]*a+e[8]*i+e[12]*o,s=e[1]*r+e[5]*a+e[9]*i+e[13]*o,c=e[2]*r+e[6]*a+e[10]*i+e[14]*o,l=e[3]*r+e[7]*a+e[11]*i+e[15]*o;return n.x=u,n.y=s,n.z=c,n.w=l,n},f.multiplyByPointAsVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i,u=e[1]*r+e[5]*a+e[9]*i,s=e[2]*r+e[6]*a+e[10]*i;return n.x=o,n.y=u,n.z=s,n},f.multiplyByPoint=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i+e[12],u=e[1]*r+e[5]*a+e[9]*i+e[13],s=e[2]*r+e[6]*a+e[10]*i+e[14];return n.x=o,n.y=u,n.z=s,n},f.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},f.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},f.transpose=function(e,t){var n=e[1],r=e[2],a=e[3],i=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=o,t[14]=u,t[15]=e[15],t},f.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},f.equals=function(e,t){return e===t||a(e)&&a(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},f.equalsEpsilon=function(e,t,n){return e===t||a(e)&&a(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},f.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},f.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};var _=new c,T=new c,R=new t,A=new t(0,0,0,1);return f.inverse=function(e,n){if(c.equalsEpsilon(f.getRotation(e,_),T,s.EPSILON7)&&t.equals(f.getRow(e,3,R),A))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],a=e[4],i=e[8],o=e[12],u=e[1],d=e[5],h=e[9],E=e[13],m=e[2],p=e[6],y=e[10],v=e[14],S=e[3],g=e[7],N=e[11],O=e[15],I=y*O,M=v*N,w=p*O,x=v*g,C=p*N,P=y*g,D=m*O,U=v*S,L=m*N,F=y*S,z=m*g,B=p*S,b=I*d+x*h+C*E-(M*d+w*h+P*E),G=M*u+D*h+F*E-(I*u+U*h+L*E),q=w*u+U*d+z*E-(x*u+D*d+B*E),W=P*u+L*d+B*h-(C*u+F*d+z*h),V=M*a+w*i+P*o-(I*a+x*i+C*o),X=I*r+U*i+L*o-(M*r+D*i+F*o),H=x*r+D*a+B*o-(w*r+U*a+z*o),Y=C*r+F*a+z*i-(P*r+L*a+B*i);I=i*E,M=o*h,w=a*E,x=o*d,C=a*h,P=i*d,D=r*E,U=o*u,L=r*h,F=i*u,z=r*d,B=a*u;var k=I*g+x*N+C*O-(M*g+w*N+P*O),Z=M*S+D*N+F*O-(I*S+U*N+L*O),j=w*S+U*g+z*O-(x*S+D*g+B*O),K=P*S+L*g+B*N-(C*S+F*g+z*N),J=w*y+P*v+M*p-(C*v+I*p+x*y),Q=L*v+I*m+U*y-(D*y+F*v+M*m),$=D*p+B*v+x*m-(z*v+w*m+U*p),ee=z*y+C*m+F*p-(L*p+B*y+P*m),te=r*b+a*G+i*q+o*W;if(Math.abs(te)<s.EPSILON20)throw new l("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=b*te,n[1]=G*te,n[2]=q*te,n[3]=W*te,n[4]=V*te,n[5]=X*te,n[6]=H*te,n[7]=Y*te,n[8]=k*te,n[9]=Z*te,n[10]=j*te,n[11]=K*te,n[12]=J*te,n[13]=Q*te,n[14]=$*te,n[15]=ee*te,n},f.inverseTransformation=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],f=e[12],d=e[13],h=e[14],E=-n*f-r*d-a*h,m=-i*f-o*d-u*h,p=-s*f-c*d-l*h;return t[0]=n,t[1]=i,t[2]=s,t[3]=0,t[4]=r,t[5]=o,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=l,t[11]=0,t[12]=E,t[13]=m,t[14]=p,t[15]=1,t},f.IDENTITY=u(new f(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),f.ZERO=u(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,i(f.prototype,{length:{get:function(){return f.packedLength}}}),f.prototype.clone=function(e){return f.clone(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},f.prototype.equalsEpsilon=function(e,t){return f.equalsEpsilon(this,e,t)},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/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(e,t,r,a){this.west=n(e,0),this.south=n(t,0),this.east=n(r,0),this.north=n(a,0)}a(c.prototype,{width:{get:function(){return c.computeWidth(this)}},height:{get:function(){return c.computeHeight(this)}}}),c.packedLength=4,c.pack=function(e,t,r){return r=n(r,0),t[r++]=e.west,t[r++]=e.south,t[r++]=e.east,t[r]=e.north,t},c.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new c),a.west=e[t++],a.south=e[t++],a.east=e[t++],a.north=e[t],a},c.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=s.TWO_PI),t-n},c.computeHeight=function(e){return e.north-e.south},c.fromDegrees=function(e,t,a,i,o){return e=s.toRadians(n(e,0)),t=s.toRadians(n(t,0)),a=s.toRadians(n(a,0)),i=s.toRadians(n(i,0)),r(o)?(o.west=e,o.south=t,o.east=a,o.north=i,o):new c(e,t,a,i)},c.fromRadians=function(e,t,a,i,o){return r(o)?(o.west=n(e,0),o.south=n(t,0),o.east=n(a,0),o.north=n(i,0),o):new c(e,t,a,i)},c.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,u=Number.MAX_VALUE,l=-Number.MAX_VALUE,f=0,d=e.length;f<d;f++){var h=e[f];n=Math.min(n,h.longitude),a=Math.max(a,h.longitude),u=Math.min(u,h.latitude),l=Math.max(l,h.latitude);var E=h.longitude>=0?h.longitude:h.longitude+s.TWO_PI;i=Math.min(i,E),o=Math.max(o,E)}return a-n>o-i&&(n=i,a=o,a>s.PI&&(a-=s.TWO_PI),n>s.PI&&(n-=s.TWO_PI)),r(t)?(t.west=n,t.south=u,t.east=a,t.north=l,t):new c(n,u,a,l)},c.fromCartesianArray=function(e,t,n){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,u=-Number.MAX_VALUE,l=Number.MAX_VALUE,f=-Number.MAX_VALUE,d=0,h=e.length;d<h;d++){var E=t.cartesianToCartographic(e[d]);a=Math.min(a,E.longitude),i=Math.max(i,E.longitude),l=Math.min(l,E.latitude),f=Math.max(f,E.latitude);var m=E.longitude>=0?E.longitude:E.longitude+s.TWO_PI;o=Math.min(o,m),u=Math.max(u,m)}return i-a>u-o&&(a=o,i=u,i>s.PI&&(i-=s.TWO_PI),a>s.PI&&(a-=s.TWO_PI)),r(n)?(n.west=a,n.south=l,n.east=i,n.north=f,n):new c(a,l,i,f)},c.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new c(e.west,e.south,e.east,e.north)},c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.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},c.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},c.validate=function(e){},c.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)},c.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)},c.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)},c.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)},c.center=function(t,n){var a=t.east,i=t.west;a<i&&(a+=s.TWO_PI);var o=s.negativePiToPi(.5*(i+a)),u=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=u,n.height=0,n):new e(o,u)},c.intersection=function(e,t,n){var a=e.east,i=e.west,o=t.east,u=t.west;a<i&&o>0?a+=s.TWO_PI:o<u&&a>0&&(o+=s.TWO_PI),a<i&&u<0?u+=s.TWO_PI:o<u&&i<0&&(i+=s.TWO_PI);var l=s.negativePiToPi(Math.max(i,u)),f=s.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&f<=l)){var d=Math.max(e.south,t.south),h=Math.min(e.north,t.north);if(!(d>=h))return r(n)?(n.west=l,n.south=d,n.east=f,n.north=h,n):new c(l,d,f,h)}},c.simpleIntersection=function(e,t,n){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(i>=u||a>=o))return r(n)?(n.west=a,n.south=i,n.east=o,n.north=u,n):new c(a,i,o,u)},c.union=function(e,t,n){r(n)||(n=new c);var a=e.east,i=e.west,o=t.east,u=t.west;a<i&&o>0?a+=s.TWO_PI:o<u&&a>0&&(o+=s.TWO_PI),a<i&&u<0?u+=s.TWO_PI:o<u&&i<0&&(i+=s.TWO_PI);var l=s.convertLongitudeRange(Math.min(i,u)),f=s.convertLongitudeRange(Math.max(a,o));return n.west=l,n.south=Math.min(e.south,t.south),n.east=f,n.north=Math.max(e.north,t.north),n},c.expand=function(e,t,n){return r(n)||(n=new c),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},c.contains=function(e,t){var n=t.longitude,r=t.latitude,a=e.west,i=e.east;return i<a&&(i+=s.TWO_PI,n<0&&(n+=s.TWO_PI)),(n>a||s.equalsEpsilon(n,a,s.EPSILON14))&&(n<i||s.equalsEpsilon(n,i,s.EPSILON14))&&r>=e.south&&r<=e.north};var l=new e;return c.subsample=function(e,t,a,i){t=n(t,o.WGS84),a=n(a,0),r(i)||(i=[]);var u=0,f=e.north,d=e.south,h=e.east,E=e.west,m=l;m.height=a,m.longitude=E,m.latitude=f,i[u]=t.cartographicToCartesian(m,i[u]),u++,m.longitude=h,i[u]=t.cartographicToCartesian(m,i[u]),u++,m.latitude=d,i[u]=t.cartographicToCartesian(m,i[u]),u++,m.longitude=E,i[u]=t.cartographicToCartesian(m,i[u]),u++,f<0?m.latitude=f:d>0?m.latitude=d:m.latitude=0;for(var p=1;p<8;++p)m.longitude=-Math.PI+p*s.PI_OVER_TWO,c.contains(e,m)&&(i[u]=t.cartographicToCartesian(m,i[u]),u++);return 0===m.latitude&&(m.longitude=E,i[u]=t.cartographicToCartesian(m,i[u]),u++,m.longitude=h,i[u]=t.cartographicToCartesian(m,i[u]),u++),i.length=u,i},c.MAX_VALUE=u(new c(-Math.PI,-s.PI_OVER_TWO,Math.PI,s.PI_OVER_TWO)),c}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function d(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var h=new e,E=new e,m=new e,p=new e,y=new e,_=new e,T=new e,R=new e,A=new e,v=new e,S=new e,g=new e;d.fromPoints=function(t,n){if(a(n)||(n=new d),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var r=e.clone(t[0],T),i=e.clone(r,h),o=e.clone(r,E),u=e.clone(r,m),s=e.clone(r,p),c=e.clone(r,y),l=e.clone(r,_),f=t.length,N=1;N<f;N++){e.clone(t[N],r);var O=r.x,I=r.y,M=r.z;O<i.x&&e.clone(r,i),O>s.x&&e.clone(r,s),I<o.y&&e.clone(r,o),I>c.y&&e.clone(r,c),M<u.z&&e.clone(r,u),M>l.z&&e.clone(r,l)}var w=e.magnitudeSquared(e.subtract(s,i,R)),x=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=i,D=s,U=w;x>U&&(U=x,P=o,D=c),C>U&&(U=C,P=u,D=l);var L=A;L.x=.5*(P.x+D.x),L.y=.5*(P.y+D.y),L.z=.5*(P.z+D.z);var F=e.magnitudeSquared(e.subtract(D,L,R)),z=Math.sqrt(F),B=v;B.x=i.x,B.y=o.y,B.z=u.z;var b=S;b.x=s.x,b.y=c.y,b.z=l.z;var G=e.multiplyByScalar(e.add(B,b,R),.5,g),q=0;for(N=0;N<f;N++){e.clone(t[N],r);var W=e.magnitude(e.subtract(r,G,R));W>q&&(q=W);var V=e.magnitudeSquared(e.subtract(r,L,R));if(V>F){var X=Math.sqrt(V);z=.5*(z+X),F=z*z;var H=X-z;L.x=(z*L.x+H*r.x)/X,L.y=(z*L.y+H*r.y)/X,L.z=(z*L.z+H*r.z)/X}}return z<q?(e.clone(L,n.center),n.radius=z):(e.clone(G,n.center),n.radius=q),n};var N=new o,O=new e,I=new e,M=new t,w=new t;d.fromRectangle2D=function(e,t,n){return d.fromRectangleWithHeights2D(e,t,0,0,n)},d.fromRectangleWithHeights2D=function(t,n,i,o,u){if(a(u)||(u=new d),!a(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;n=r(n,N),f.southwest(t,M),M.height=i,f.northeast(t,w),w.height=o;var s=n.project(M,O),c=n.project(w,I),l=c.x-s.x,h=c.y-s.y,E=c.z-s.z;u.radius=.5*Math.sqrt(l*l+h*h+E*E);var m=u.center;return m.x=s.x+.5*l,m.y=s.y+.5*h,m.z=s.z+.5*E,u};var x=[];d.fromRectangle3D=function(e,t,n,o){t=r(t,i.WGS84),n=r(n,0);var u;return a(e)&&(u=f.subsample(e,t,n,x)),d.fromPoints(u,o)},d.fromVertices=function(t,n,i,o){if(a(o)||(o=new d),!a(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;n=r(n,e.ZERO),i=r(i,3);var u=T;u.x=t[0]+n.x,u.y=t[1]+n.y,u.z=t[2]+n.z;for(var s=e.clone(u,h),c=e.clone(u,E),l=e.clone(u,m),f=e.clone(u,p),N=e.clone(u,y),O=e.clone(u,_),I=t.length,M=0;M<I;M+=i){var w=t[M]+n.x,x=t[M+1]+n.y,C=t[M+2]+n.z;u.x=w,u.y=x,u.z=C,w<s.x&&e.clone(u,s),w>f.x&&e.clone(u,f),x<c.y&&e.clone(u,c),x>N.y&&e.clone(u,N),C<l.z&&e.clone(u,l),C>O.z&&e.clone(u,O)}var P=e.magnitudeSquared(e.subtract(f,s,R)),D=e.magnitudeSquared(e.subtract(N,c,R)),U=e.magnitudeSquared(e.subtract(O,l,R)),L=s,F=f,z=P;D>z&&(z=D,L=c,F=N),U>z&&(z=U,L=l,F=O);var B=A;B.x=.5*(L.x+F.x),B.y=.5*(L.y+F.y),B.z=.5*(L.z+F.z);var b=e.magnitudeSquared(e.subtract(F,B,R)),G=Math.sqrt(b),q=v;q.x=s.x,q.y=c.y,q.z=l.z;var W=S;W.x=f.x,W.y=N.y,W.z=O.z;var V=e.multiplyByScalar(e.add(q,W,R),.5,g),X=0;for(M=0;M<I;M+=i){u.x=t[M]+n.x,u.y=t[M+1]+n.y,u.z=t[M+2]+n.z;var H=e.magnitude(e.subtract(u,V,R));H>X&&(X=H);var Y=e.magnitudeSquared(e.subtract(u,B,R));if(Y>b){var k=Math.sqrt(Y);G=.5*(G+k),b=G*G;var Z=k-G;B.x=(G*B.x+Z*u.x)/k,B.y=(G*B.y+Z*u.y)/k,B.z=(G*B.z+Z*u.z)/k}}return G<X?(e.clone(B,o.center),o.radius=G):(e.clone(V,o.center),o.radius=X),o},d.fromEncodedCartesianVertices=function(t,n,r){if(a(r)||(r=new d),!a(t)||!a(n)||t.length!==n.length||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var i=T;i.x=t[0]+n[0],i.y=t[1]+n[1],i.z=t[2]+n[2];for(var o=e.clone(i,h),u=e.clone(i,E),s=e.clone(i,m),c=e.clone(i,p),l=e.clone(i,y),f=e.clone(i,_),N=t.length,O=0;O<N;O+=3){var I=t[O]+n[O],M=t[O+1]+n[O+1],w=t[O+2]+n[O+2];i.x=I,i.y=M,i.z=w,I<o.x&&e.clone(i,o),I>c.x&&e.clone(i,c),M<u.y&&e.clone(i,u),M>l.y&&e.clone(i,l),w<s.z&&e.clone(i,s),w>f.z&&e.clone(i,f)}var x=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=e.magnitudeSquared(e.subtract(f,s,R)),D=o,U=c,L=x;C>L&&(L=C,D=u,U=l),P>L&&(L=P,D=s,U=f);var F=A;F.x=.5*(D.x+U.x),F.y=.5*(D.y+U.y),F.z=.5*(D.z+U.z);var z=e.magnitudeSquared(e.subtract(U,F,R)),B=Math.sqrt(z),b=v;b.x=o.x,b.y=u.y,b.z=s.z;var G=S;G.x=c.x,G.y=l.y,G.z=f.z;var q=e.multiplyByScalar(e.add(b,G,R),.5,g),W=0;for(O=0;O<N;O+=3){i.x=t[O]+n[O],i.y=t[O+1]+n[O+1],i.z=t[O+2]+n[O+2];var V=e.magnitude(e.subtract(i,q,R));V>W&&(W=V);var X=e.magnitudeSquared(e.subtract(i,F,R));if(X>z){var H=Math.sqrt(X);B=.5*(B+H),z=B*B;var Y=H-B;F.x=(B*F.x+Y*i.x)/H,F.y=(B*F.y+Y*i.y)/H,F.z=(B*F.z+Y*i.z)/H}}return B<W?(e.clone(F,r.center),r.radius=B):(e.clone(q,r.center),r.radius=W),r},d.fromCornerPoints=function(t,n,r){a(r)||(r=new d);var i=r.center;return e.add(t,n,i),e.multiplyByScalar(i,.5,i),r.radius=e.distance(i,n),r},d.fromEllipsoid=function(t,n){return a(n)||(n=new d),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var C=new e;d.fromBoundingSpheres=function(t,n){if(a(n)||(n=new d),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var r=t.length;if(1===r)return d.clone(t[0],n);if(2===r)return d.union(t[0],t[1],n);for(var i=[],o=0;o<r;o++)i.push(t[o].center);n=d.fromPoints(i,n);var u=n.center,s=n.radius;for(o=0;o<r;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,C)+c.radius)}return n.radius=s,n};var P=new e,D=new e,U=new e;d.fromOrientedBoundingBox=function(t,n){a(n)||(n=new d);var r=t.halfAxes,i=c.getColumn(r,0,P),o=c.getColumn(r,1,D),u=c.getColumn(r,2,U),s=e.magnitude(i),l=e.magnitude(o),f=e.magnitude(u);return n.center=e.clone(t.center,n.center),n.radius=Math.max(s,l,f),n},d.clone=function(t,n){if(a(t))return a(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new d(t.center,t.radius)},d.packedLength=4,d.pack=function(e,t,n){n=r(n,0);var a=e.center;return t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n]=e.radius,t},d.unpack=function(e,t,n){t=r(t,0),a(n)||(n=new d);var i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};var L=new e,F=new e;d.union=function(t,n,r){a(r)||(r=new d);var i=t.center,o=t.radius,u=n.center,s=n.radius,c=e.subtract(u,i,L),l=e.magnitude(c);if(o>=l+s)return t.clone(r),r;if(s>=l+o)return n.clone(r),r;var f=.5*(o+l+s),h=e.multiplyByScalar(c,(-o+f)/l,F);return e.add(h,i,h),e.clone(h,r.center),r.radius=f,r};var z=new e;d.expand=function(t,n,r){r=d.clone(t,r);var a=e.magnitude(e.subtract(n,r.center,z));return a>r.radius&&(r.radius=a),r},d.intersectPlane=function(t,n){var r=t.center,a=t.radius,i=n.normal,o=e.dot(i,r)+n.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},d.transform=function(e,t,n){return a(n)||(n=new d),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=l.getMaximumScale(t)*e.radius,n};var B=new e;d.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,B);return e.magnitudeSquared(r)-t.radius*t.radius},d.transformWithoutScale=function(e,t,n){return a(n)||(n=new d),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var b=new e;d.computePlaneDistances=function(t,n,r,i){a(i)||(i=new s);var o=e.subtract(t.center,n,b),u=e.dot(r,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var G=new e,q=new e,W=new e,V=new e,X=new e,H=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var Z=new o;return d.projectTo2D=function(t,n,a){n=r(n,Z);var i=n.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,G),c=e.cross(e.UNIT_Z,s,q);e.normalize(c,c);var l=e.cross(s,c,W);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var f=e.negate(l,X),h=e.negate(c,V),E=Y,m=E[0];e.add(s,l,m),e.add(m,c,m),m=E[1],e.add(s,l,m),e.add(m,h,m),m=E[2],e.add(s,f,m),e.add(m,h,m),m=E[3],e.add(s,f,m),e.add(m,c,m),e.negate(s,s),m=E[4],e.add(s,l,m),e.add(m,c,m),m=E[5],e.add(s,l,m),e.add(m,h,m),m=E[6],e.add(s,f,m),e.add(m,h,m),m=E[7],e.add(s,f,m),e.add(m,c,m);for(var p=E.length,y=0;y<p;++y){var _=E[y];e.add(o,_,_);var T=i.cartesianToCartographic(_,H);n.project(T,_)}a=d.fromPoints(E,a),o=a.center;var R=o.x,A=o.y,v=o.z;return o.x=v,o.y=R,o.z=A,a},d.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},d.equals=function(t,n){return t===n||a(t)&&a(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},d.prototype.intersectPlane=function(e){return d.intersectPlane(this,e)},d.prototype.distanceSquaredTo=function(e){return d.distanceSquaredTo(this,e)},d.prototype.computePlaneDistances=function(e,t,n){return d.computePlaneDistances(this,e,t,n)},d.prototype.isOccluded=function(e){return d.isOccluded(this,e)},d.prototype.equals=function(e){return d.equals(this,e)},d.prototype.clone=function(e){return d.clone(this,e)},d}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return t(a,{element:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(r.requestFullscreen=a,n=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(r.requestFullscreen=a,n=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?r.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(r.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?r.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(r.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?r.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(r.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),r.fullscreenerror=a)}return n},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[r.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function a(){if(!t(A)&&(A=!1,!d())){var e=/ Chrome\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(A=!0,v=r(e[1]))}return A}function i(){return a()&&v}function o(){if(!t(S)&&(S=!1,!a()&&!d()&&/ Safari\/[\.0-9]+/.test(R.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(S=!0,g=r(e[1]))}return S}function u(){return o()&&g}function s(){if(!t(N)){N=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(R.userAgent);null!==e&&(N=!0,O=r(e[1]),O.isNightly=!!e[2]); +}return N}function c(){return s()&&O}function l(){if(!t(I)){I=!1;var e;"Microsoft Internet Explorer"===R.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(I=!0,M=r(e[1]))):"Netscape"===R.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(I=!0,M=r(e[1])))}return I}function f(){return l()&&M}function d(){if(!t(w)){w=!1;var e=/ Edge\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(w=!0,x=r(e[1]))}return w}function h(){return d()&&x}function E(){if(!t(C)){C=!1;var e=/Firefox\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(C=!0,P=r(e[1]))}return C}function m(){return t(D)||(D=/Windows/i.test(R.appVersion)),D}function p(){return E()&&P}function y(){return t(U)||(U="undefined"!=typeof PointerEvent&&(!t(R.pointerEnabled)||R.pointerEnabled)),U}function _(){if(!t(F)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;F=t(n)&&""!==n,F&&(L=n)}return F}function T(){return _()?L:void 0}var R;R="undefined"!=typeof navigator?navigator:{};var A,v,S,g,N,O,I,M,w,x,C,P,D,U,L,F,z={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isEdge:d,edgeVersion:h,isFirefox:E,firefoxVersion:p,isWindows:m,hardwareConcurrency:e(R.hardwareConcurrency,3),supportsPointerEvents:y,supportsImageRenderingPixelated:_,imageRenderingValue:T};return z.supportsFullscreen=function(){return n.supportsFullscreen()},z.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},z.supportsWebWorkers=function(){return"undefined"!=typeof Worker},z}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,a,i){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){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.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},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 Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,a){switch(r=e(r,0),a=e(a,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,a);case o.SHORT:return new Int16Array(n,r,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,a);case o.INT:return new Int32Array(n,r,a);case o.UNSIGNED_INT:return new Uint32Array(n,r,a);case o.FLOAT:return new Float32Array(n,r,a);case o.DOUBLE:return new Float64Array(n,r,a)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/CornerType",["./freezeObject"],function(e){"use strict";var t={ROUNDED:0,MITERED:1,BEVELED:2};return e(t)}),define("Core/EllipsoidGeodesic",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){var t=e._uSquared,n=e._ellipsoid.maximumRadius,r=e._ellipsoid.minimumRadius,a=(n-r)/n,i=Math.cos(e._startHeading),o=Math.sin(e._startHeading),u=(1-a)*Math.tan(e._start.latitude),s=1/Math.sqrt(1+u*u),c=s*u,l=Math.atan2(u,i),f=s*o,d=f*f,h=1-d,E=Math.sqrt(h),m=t/4,p=m*m,y=p*m,_=p*p,T=1+m-3*p/4+5*y/4-175*_/64,R=1-m+15*p/8-35*y/8,A=1-3*m+35*p/4,v=1-5*m,S=T*l-R*Math.sin(2*l)*m/2-A*Math.sin(4*l)*p/16-v*Math.sin(6*l)*y/48-5*Math.sin(8*l)*_/512,g=e._constants;g.a=n,g.b=r,g.f=a,g.cosineHeading=i,g.sineHeading=o,g.tanU=u,g.cosineU=s,g.sineU=c,g.sigma=l,g.sineAlpha=f,g.sineSquaredAlpha=d,g.cosineSquaredAlpha=h,g.cosineAlpha=E,g.u2Over4=m,g.u4Over16=p,g.u6Over64=y,g.u8Over256=_,g.a0=T,g.a1=R,g.a2=A,g.a3=v,g.distanceRatio=S}function c(e,t){return e*t*(4+e*(4-3*t))/16}function l(e,t,n,r,a,i,o){var u=c(e,n);return(1-u)*e*t*(r+u*a*(o+u*i*(2*o*o-1)))}function f(e,t,n,r,a,i,o){var s,c,f,d,h,E=(t-n)/t,m=i-r,p=Math.atan((1-E)*Math.tan(a)),y=Math.atan((1-E)*Math.tan(o)),_=Math.cos(p),T=Math.sin(p),R=Math.cos(y),A=Math.sin(y),v=_*R,S=_*A,g=T*A,N=T*R,O=m,I=u.TWO_PI,M=Math.cos(O),w=Math.sin(O);do{M=Math.cos(O),w=Math.sin(O);var x=S-N*M;f=Math.sqrt(R*R*w*w+x*x),c=g+v*M,s=Math.atan2(f,c);var C;0===f?(C=0,d=1):(C=v*w/f,d=1-C*C),I=O,h=c-2*g/d,isNaN(h)&&(h=0),O=m+l(E,C,d,s,f,c,h)}while(Math.abs(O-I)>u.EPSILON12);var P=d*(t*t-n*n)/(n*n),D=1+P*(4096+P*(P*(320-175*P)-768))/16384,U=P*(256+P*(P*(74-47*P)-128))/1024,L=h*h,F=U*f*(h+U*(c*(2*L-1)-U*h*(4*f*f-3)*(4*L-3)/6)/4),z=n*D*(s-F),B=Math.atan2(R*w,S-N*M),b=Math.atan2(_*w,S*M-N);e._distance=z,e._startHeading=B,e._endHeading=b,e._uSquared=P}function d(n,r,a,i){e.normalize(i.cartographicToCartesian(r,m),E),e.normalize(i.cartographicToCartesian(a,m),m);f(n,i.maximumRadius,i.minimumRadius,r.longitude,r.latitude,a.longitude,a.latitude),n._start=t.clone(r,n._start),n._end=t.clone(a,n._end),n._start.height=0,n._end.height=0,s(n)}function h(e,a,i){var u=n(i,o.WGS84);this._ellipsoid=u,this._start=new t,this._end=new t,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,r(e)&&r(a)&&d(this,e,a,u)}var E=new e,m=new e;return a(h.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return this._startHeading}},endHeading:{get:function(){return this._endHeading}}}),h.prototype.setEndPoints=function(e,t){d(this,e,t,this._ellipsoid)},h.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},h.prototype.interpolateUsingSurfaceDistance=function(e,n){var a=this._constants,i=a.distanceRatio+e/a.b,o=Math.cos(2*i),u=Math.cos(4*i),s=Math.cos(6*i),c=Math.sin(2*i),f=Math.sin(4*i),d=Math.sin(6*i),h=Math.sin(8*i),E=i*i,m=i*E,p=a.u8Over256,y=a.u2Over4,_=a.u6Over64,T=a.u4Over16,R=2*m*p*o/3+i*(1-y+7*T/4-15*_/4+579*p/64-(T-15*_/4+187*p/16)*o-(5*_/4-115*p/16)*u-29*p*s/16)+(y/2-T+71*_/32-85*p/16)*c+(5*T/16-5*_/4+383*p/96)*f-E*((_-11*p/2)*c+5*p*f/2)+(29*_/96-29*p/16)*d+539*p*h/1536,A=Math.asin(Math.sin(R)*a.cosineAlpha),v=Math.atan(a.a/a.b*Math.tan(A));R-=a.sigma;var S=Math.cos(2*a.sigma+R),g=Math.sin(R),N=Math.cos(R),O=a.cosineU*N,I=a.sineU*g,M=Math.atan2(g*a.sineHeading,O-I*a.cosineHeading),w=M-l(a.f,a.sineAlpha,a.cosineSquaredAlpha,R,g,N,S);return r(n)?(n.longitude=this._start.longitude+w,n.latitude=v,n.height=0,n):new t(this._start.longitude+w,v,0)},h}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function n(e,n,r){var a=e+n;return t.sign(e)!==t.sign(n)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(n)))<r?0:a}var r={};return r.computeDiscriminant=function(e,t,n){var r=t*t-4*e*n;return r},r.computeRealRoots=function(e,r,a){var i;if(0===e)return 0===r?[]:[-a/r];if(0===r){if(0===a)return[0,0];var o=Math.abs(a),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,i<0)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-r/e,i<0?[i,0]:[0,i];var c=r*r,l=4*e*a,f=n(c,-l,t.EPSILON14);if(f<0)return[];var d=-.5*n(r,t.sign(r)*Math.sqrt(f),t.EPSILON14);return r>0?[d/e,a/d]:[a/d,d/e]},r}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function n(e,t,n,r){var a,i,o=e,u=t/3,s=n/3,c=r,l=o*s,f=u*c,d=u*u,h=s*s,E=o*s-d,m=o*c-u*s,p=u*c-h,y=4*E*p-m*m;if(y<0){var _,T,R;d*f>=l*h?(_=o,T=E,R=-2*u*E+o*m):(_=c,T=p,R=-c*m+2*s*p);var A=R<0?-1:1,v=-A*Math.abs(_)*Math.sqrt(-y);i=-R+v;var S=i/2,g=S<0?-Math.pow(-S,1/3):Math.pow(S,1/3),N=i===v?-g:-T/g;return a=T<=0?g+N:-R/(g*g+N*N+T),d*f>=l*h?[(a-u)/o]:[-c/(a+s)]}var O=E,I=-2*u*E+o*m,M=p,w=-c*m+2*s*p,x=Math.sqrt(y),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*x,-I)/3);a=2*Math.sqrt(-O);var D=Math.cos(P);i=a*D;var U=a*(-D/2-C*Math.sin(P)),L=i+U>2*u?i-u:U-u,F=o,z=L/F;P=Math.abs(Math.atan2(c*x,-w)/3),a=2*Math.sqrt(-M),D=Math.cos(P),i=a*D,U=a*(-D/2-C*Math.sin(P));var B=-c,b=i+U<2*s?i+s:U+s,G=B/b,q=F*b,W=-L*b-F*B,V=L*B,X=(s*W-u*V)/(-u*W+s*q);return z<=X?z<=G?X<=G?[z,X,G]:[z,G,X]:[G,z,X]:z<=G?[X,z,G]:X<=G?[X,G,z]:[G,X,z]}var r={};return r.computeDiscriminant=function(e,t,n,r){var a=e*e,i=t*t,o=n*n,u=r*r,s=18*e*t*n*r+i*o-27*a*u-4*(e*o*n+i*t*r);return s},r.computeRealRoots=function(e,r,a,i){var o,u;if(0===e)return t.computeRealRoots(r,a,i);if(0===r){if(0===a){if(0===i)return[0,0,0];u=-i/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===i?(o=t.computeRealRoots(e,0,a),0===o.Length?[0]:[o[0],0,o[1]]):n(e,0,a,i)}return 0===a?0===i?(u=-r/e,u<0?[u,0,0]:[0,0,u]):n(e,r,0,i):0===i?(o=t.computeRealRoots(e,r,a),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):n(e,r,a,i)},r}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,n,r){"use strict";function a(t,a,i,o){var u=t*t,s=a-3*u/8,c=i-a*t/2+u*t/8,l=o-i*t/4+a*u/16-3*u*u/256,f=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(f.length>0){var d=-t/4,h=f[f.length-1];if(Math.abs(h)<n.EPSILON14){var E=r.computeRealRoots(1,s,l);if(2===E.length){var m,p=E[0],y=E[1];if(p>=0&&y>=0){var _=Math.sqrt(p),T=Math.sqrt(y);return[d-T,d-_,d+_,d+T]}if(p>=0&&y<0)return m=Math.sqrt(p),[d-m,d+m];if(p<0&&y>=0)return m=Math.sqrt(y),[d-m,d+m]}return[]}if(h>0){var R=Math.sqrt(h),A=(s+h-c/R)/2,v=(s+h+c/R)/2,S=r.computeRealRoots(1,R,A),g=r.computeRealRoots(1,-R,v);return 0!==S.length?(S[0]+=d,S[1]+=d,0!==g.length?(g[0]+=d,g[1]+=d,S[1]<=g[0]?[S[0],S[1],g[0],g[1]]:g[1]<=S[0]?[g[0],g[1],S[0],S[1]]:S[0]>=g[0]&&S[1]<=g[1]?[g[0],S[0],S[1],g[1]]:g[0]>=S[0]&&g[1]<=S[1]?[S[0],g[0],g[1],S[1]]:S[0]>g[0]&&S[0]<g[1]?[g[0],S[0],g[1],S[1]]:[S[0],g[0],S[1],g[1]]):S):0!==g.length?(g[0]+=d,g[1]+=d,g):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,f=i*t+s-4*o,d=c*o-i*a*t+u,h=e.computeRealRoots(1,l,f,d);if(h.length>0){var E,m,p=h[0],y=a-p,_=y*y,T=t/2,R=y/2,A=_-4*o,v=_+4*Math.abs(o),S=c-4*p,g=c+4*Math.abs(p);if(p<0||A*g<S*v){var N=Math.sqrt(S);E=N/2,m=0===N?0:(t*R-i)/N}else{var O=Math.sqrt(A);E=0===O?0:(t*R-i)/O,m=O/2}var I,M;0===T&&0===E?(I=0,M=0):n.sign(T)===n.sign(E)?(I=T+E,M=p/I):(M=T-E,I=p/M);var w,x;0===R&&0===m?(w=0,x=0):n.sign(R)===n.sign(m)?(w=R+m,x=o/w):(x=R-m,w=o/x);var C=r.computeRealRoots(1,I,w),P=r.computeRealRoots(1,M,x);if(0!==C.length)return 0!==P.length?C[1]<=P[0]?[C[0],C[1],P[0],P[1]]:P[1]<=C[0]?[P[0],P[1],C[0],C[1]]:C[0]>=P[0]&&C[1]<=P[1]?[P[0],C[0],C[1],P[1]]:P[0]>=C[0]&&P[1]<=C[1]?[C[0],P[0],P[1],C[1]]:C[0]>P[0]&&C[0]<P[1]?[P[0],C[0],P[1],C[1]]:[C[0],P[0],C[1],P[1]]:C;if(0!==P.length)return P}return[]}var o={};return o.computeDiscriminant=function(e,t,n,r,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=n*n,l=c*n,f=r*r,d=f*r,h=a*a,E=h*a,m=u*c*f-4*s*d-4*e*l*f+18*e*t*n*d-27*i*f*f+256*o*E+a*(18*s*n*r-4*u*l+16*e*c*c-80*e*t*c*r-6*e*u*f+144*i*n*f)+h*(144*e*u*n-27*u*u-128*i*c-192*i*t*r);return m},o.computeRealRoots=function(t,r,o,u,s){if(Math.abs(t)<n.EPSILON15)return e.computeRealRoots(r,o,u,s);var c=r/t,l=o/t,f=u/t,d=s/t,h=c<0?1:0;switch(h+=l<0?h+1:h,h+=f<0?h+1:h,h+=d<0?h+1:h){case 0:return a(c,l,f,d);case 1:return i(c,l,f,d);case 2:return i(c,l,f,d);case 3:return a(c,l,f,d);case 4:return a(c,l,f,d);case 5:return i(c,l,f,d);case 6:return a(c,l,f,d);case 7:return a(c,l,f,d);case 8:return i(c,l,f,d);case 9:return a(c,l,f,d);case 10:return a(c,l,f,d);case 11:return i(c,l,f,d);case 12:return a(c,l,f,d);case 13:return a(c,l,f,d);case 14:return a(c,l,f,d);case 15:return a(c,l,f,d);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=e.clone(t(r,e.ZERO)),e.equals(r,e.ZERO)||e.normalize(r,r),this.origin=e.clone(t(n,e.ZERO)),this.direction=r}return a.getPoint=function(t,r,a){return n(a)||(a=new e),a=e.multiplyByScalar(t.direction,r,a),e.add(t.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,n,r,a,i,o,u,s,c,l){"use strict";function f(e,t,n,r){var a=t*t-4*e*n;if(!(a<0)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return u<s?(r.root0=u,r.root1=s):(r.root0=s,r.root1=u),r}var c=-t/(2*e);if(0!==c)return r.root0=r.root1=c,r}}function d(t,n,a){r(a)||(a=new i);var o=t.origin,u=t.direction,s=n.center,c=n.radius*n.radius,l=e.subtract(o,s,_),d=e.dot(u,u),h=2*e.dot(u,l),E=e.magnitudeSquared(l)-c,m=f(d,h,E,v);if(r(m))return a.start=m.root0,a.stop=m.root1,a}function h(e,t,n){var r=e+t;return o.sign(e)!==o.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))<n?0:r}function E(t,n,r,a,i){var l,f=a*a,d=i*i,E=(t[u.COLUMN1ROW1]-t[u.COLUMN2ROW2])*d,m=i*(a*h(t[u.COLUMN1ROW0],t[u.COLUMN0ROW1],o.EPSILON15)+n.y),p=t[u.COLUMN0ROW0]*f+t[u.COLUMN2ROW2]*d+a*n.x+r,y=d*h(t[u.COLUMN2ROW1],t[u.COLUMN1ROW2],o.EPSILON15),_=i*(a*h(t[u.COLUMN2ROW0],t[u.COLUMN0ROW2])+n.z),T=[];if(0===_&&0===y){if(l=s.computeRealRoots(E,m,p),0===l.length)return T;var R=l[0],A=Math.sqrt(Math.max(1-R*R,0));if(T.push(new e(a,i*R,i*-A)),T.push(new e(a,i*R,i*A)),2===l.length){var v=l[1],S=Math.sqrt(Math.max(1-v*v,0));T.push(new e(a,i*v,i*-S)),T.push(new e(a,i*v,i*S))}return T}var g=_*_,N=y*y,O=E*E,I=_*y,M=O+N,w=2*(m*E+I),x=2*p*E+m*m-N+g,C=2*(p*m-I),P=p*p-g;if(0===M&&0===w&&0===x&&0===C)return T;l=c.computeRealRoots(M,w,x,C,P);var D=l.length;if(0===D)return T;for(var U=0;U<D;++U){var L,F=l[U],z=F*F,B=Math.max(1-z,0),b=Math.sqrt(B);L=o.sign(E)===o.sign(p)?h(E*z+p,m*F,o.EPSILON12):o.sign(p)===o.sign(m*F)?h(E*z,m*F+p,o.EPSILON12):h(E*z+m*F,p,o.EPSILON12);var G=h(y*F,_,o.EPSILON15),q=L*G;q<0?T.push(new e(a,i*F,i*b)):q>0?T.push(new e(a,i*F,i*-b)):0!==b?(T.push(new e(a,i*F,i*-b)),T.push(new e(a,i*F,i*b)),++U):T.push(new e(a,i*F,i*b))}return T}var m={};m.rayPlane=function(t,n,a){r(a)||(a=new e);var i=t.origin,u=t.direction,s=n.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON15)){var l=(-n.distance-e.dot(s,i))/c;if(!(l<0))return a=e.multiplyByScalar(u,l,a),e.add(i,a,a)}};var p=new e,y=new e,_=new e,T=new e,R=new e;m.rayTriangleParametric=function(t,r,a,i,u){u=n(u,!1);var s,c,l,f,d,h=t.origin,E=t.direction,m=e.subtract(a,r,p),A=e.subtract(i,r,y),v=e.cross(E,A,_),S=e.dot(m,v);if(u){if(S<o.EPSILON6)return;if(s=e.subtract(h,r,T),l=e.dot(s,v),l<0||l>S)return;if(c=e.cross(s,m,R),f=e.dot(E,c),f<0||l+f>S)return;d=e.dot(A,c)/S}else{if(Math.abs(S)<o.EPSILON6)return;var g=1/S;if(s=e.subtract(h,r,T),l=e.dot(s,v)*g,l<0||l>1)return;if(c=e.cross(s,m,R),f=e.dot(E,c)*g,f<0||l+f>1)return;d=e.dot(A,c)*g}return d},m.rayTriangle=function(t,n,a,i,o,u){var s=m.rayTriangleParametric(t,n,a,i,o);if(r(s)&&!(s<0))return r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var A=new l;m.lineSegmentTriangle=function(t,n,a,i,o,u,s){var c=A;e.clone(t,c.origin),e.subtract(n,t,c.direction),e.normalize(c.direction,c.direction);var l=m.rayTriangleParametric(c,a,i,o,u);if(!(!r(l)||l<0||l>e.distance(t,n)))return r(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var v={root0:0,root1:0};m.raySphere=function(e,t,n){if(n=d(e,t,n),r(n)&&!(n.stop<0))return n.start=Math.max(n.start,0),n};var S=new l;m.lineSegmentSphere=function(t,n,a,i){var o=S;e.clone(t,o.origin);var u=e.subtract(n,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),i=d(o,a,i),!(!r(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var g=new e,N=new e;m.rayEllipsoid=function(t,n){var r,a,o,u,s,c=n.oneOverRadii,l=e.multiplyComponents(c,t.origin,g),f=e.multiplyComponents(c,t.direction,N),d=e.magnitudeSquared(l),h=e.dot(l,f);if(d>1){if(h>=0)return;var E=h*h;if(r=d-1,a=e.magnitudeSquared(f),o=a*r,E<o)return;if(E>o){u=h*h-o,s=-h+Math.sqrt(u);var m=s/a,p=r/s;return m<p?new i(m,p):{start:p,stop:m}}var y=Math.sqrt(r/a);return new i(y,y)}return d<1?(r=d-1,a=e.magnitudeSquared(f),o=a*r,u=h*h-o,s=-h+Math.sqrt(u),new i(0,s/a)):h<0?(a=e.magnitudeSquared(f),new i(0,-h/a)):void 0};var O=new e,I=new e,M=new e,w=new e,x=new e,C=new u,P=new u,D=new u,U=new u,L=new u,F=new u,z=new u,B=new e,b=new e,G=new t;m.grazingAltitudeLocation=function(t,n){var a=t.origin,i=t.direction;if(!e.equals(a,e.ZERO)){var s=n.geodeticSurfaceNormal(a,O);if(e.dot(i,s)>=0)return a}var c=r(this.rayEllipsoid(t,n)),l=n.transformPositionToScaledSpace(i,O),f=e.normalize(l,l),d=e.mostOrthogonalAxis(l,w),h=e.normalize(e.cross(d,f,I),I),m=e.normalize(e.cross(f,h,M),M),p=C;p[0]=f.x,p[1]=f.y,p[2]=f.z,p[3]=h.x,p[4]=h.y,p[5]=h.z,p[6]=m.x,p[7]=m.y,p[8]=m.z;var y=u.transpose(p,P),_=u.fromScale(n.radii,D),T=u.fromScale(n.oneOverRadii,U),R=L;R[0]=0,R[1]=-i.z,R[2]=i.y,R[3]=i.z,R[4]=0,R[5]=-i.x,R[6]=-i.y,R[7]=i.x,R[8]=0;var A,v,S=u.multiply(u.multiply(y,T,F),R,F),g=u.multiply(u.multiply(S,_,z),p,z),N=u.multiplyByVector(S,a,x),q=E(g,e.negate(N,O),0,0,1),W=q.length;if(W>0){for(var V=e.clone(e.ZERO,b),X=Number.NEGATIVE_INFINITY,H=0;H<W;++H){A=u.multiplyByVector(_,u.multiplyByVector(p,q[H],B),B);var Y=e.normalize(e.subtract(A,a,w),w),k=e.dot(Y,i);k>X&&(X=k,V=e.clone(A,V))}var Z=n.cartesianToCartographic(V,G);return X=o.clamp(X,0,1),v=e.magnitude(e.subtract(V,a,w))*Math.sqrt(1-X*X),v=c?-v:v,Z.height=v,n.cartographicToCartesian(Z,new e)}};var q=new e;return m.lineSegmentPlane=function(t,n,a,i){r(i)||(i=new e);var u=e.subtract(n,t,q),s=a.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON6)){var l=e.dot(s,t),f=-(a.distance+l)/c;if(!(f<0||f>1))return e.multiplyByScalar(u,f,i),e.add(t,i,i),i}},m.trianglePlaneIntersection=function(t,n,r,a){ +var i=a.normal,o=a.distance,u=e.dot(i,t)+o<0,s=e.dot(i,n)+o<0,c=e.dot(i,r)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var f,d;if(1!==l&&2!==l||(f=new e,d=new e),1===l){if(u)return m.lineSegmentPlane(t,n,a,f),m.lineSegmentPlane(t,r,a,d),{positions:[t,n,r,f,d],indices:[0,3,4,1,2,4,1,4,3]};if(s)return m.lineSegmentPlane(n,r,a,f),m.lineSegmentPlane(n,t,a,d),{positions:[t,n,r,f,d],indices:[1,3,4,2,0,4,2,4,3]};if(c)return m.lineSegmentPlane(r,t,a,f),m.lineSegmentPlane(r,n,a,d),{positions:[t,n,r,f,d],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return m.lineSegmentPlane(n,t,a,f),m.lineSegmentPlane(r,t,a,d),{positions:[t,n,r,f,d],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return m.lineSegmentPlane(r,n,a,f),m.lineSegmentPlane(t,n,a,d),{positions:[t,n,r,f,d],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return m.lineSegmentPlane(t,r,a,f),m.lineSegmentPlane(n,r,a,d),{positions:[t,n,r,f,d],indices:[0,1,4,0,4,3,2,3,4]}}},m}),define("Core/isArray",["./defined"],function(e){"use strict";var t=Array.isArray;return e(t)||(t=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),t}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";function a(t,n){this.normal=e.clone(t),this.distance=n}a.fromPointNormal=function(n,r,i){var o=-e.dot(r,n);return t(i)?(e.clone(r,i.normal),i.distance=o,i):new a(r,o)};var i=new e;return a.fromCartesian4=function(n,r){var o=e.fromCartesian4(n,i),u=n.w;return t(r)?(e.clone(o,r.normal),r.distance=u,r):new a(o,u)},a.getPointDistance=function(t,n){return e.dot(t.normal,n)+t.distance},a.ORIGIN_XY_PLANE=r(new a(e.UNIT_Z,0)),a.ORIGIN_YZ_PLANE=r(new a(e.UNIT_X,0)),a.ORIGIN_ZX_PLANE=r(new a(e.UNIT_Y,0)),a}),define("Core/PolylinePipeline",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidGeodesic","./IntersectionTests","./isArray","./Math","./Matrix4","./Plane"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function d(e,t,n){var r=g;r.length=e;var a;if(t===n){for(a=0;a<e;a++)r[a]=t;return r}var i=n-t,o=i/e;for(a=0;a<e;a++){var u=t+a*o;r[a]=u}return r}function h(t,n,r,a,i,o,u,s){var c=a.scaleToGeodeticSurface(t,M),l=a.scaleToGeodeticSurface(n,w),f=E.numberOfPoints(t,n,r),h=a.cartesianToCartographic(c,N),m=a.cartesianToCartographic(l,O),p=d(f,i,o);x.setEndPoints(h,m);var y=x.surfaceDistance/f,_=s;h.height=i;var T=a.cartographicToCartesian(h,I);e.pack(T,u,_),_+=3;for(var R=1;R<f;R++){var A=x.interpolateUsingSurfaceDistance(R*y,O);A.height=p[R],T=a.cartographicToCartesian(A,I),e.pack(T,u,_),_+=3}return _}var E={};E.numberOfPoints=function(t,n,r){var a=e.distance(t,n);return Math.ceil(a/r)};var m=new t;E.extractHeights=function(e,t){for(var n=e.length,r=new Array(n),a=0;a<n;a++){var i=e[a];r[a]=t.cartesianToCartographic(i,m).height}return r};var p=new l,y=new e,_=new e,T=new f(e.ZERO,0),R=new e,A=new f(e.ZERO,0),v=new e,S=new e,g=[],N=new t,O=new t,I=new e,M=new e,w=new e,x=new o;return E.wrapLongitude=function(t,a){var i=[],o=[];if(r(t)&&t.length>0){a=n(a,l.IDENTITY);var s=l.inverseTransformation(a,p),c=l.multiplyByPoint(s,e.ZERO,y),d=l.multiplyByPointAsVector(s,e.UNIT_Y,_),h=f.fromPointNormal(c,d,T),E=l.multiplyByPointAsVector(s,e.UNIT_X,R),m=f.fromPointNormal(c,E,A),g=1;i.push(e.clone(t[0]));for(var N=i[0],O=t.length,I=1;I<O;++I){var M=t[I];if(f.getPointDistance(m,N)<0||f.getPointDistance(m,M)<0){var w=u.lineSegmentPlane(N,M,h,v);if(r(w)){var x=e.multiplyByScalar(d,5e-9,S);f.getPointDistance(h,N)<0&&e.negate(x,x),i.push(e.add(w,x,new e)),o.push(g+1),e.negate(x,x),i.push(e.add(w,x,new e)),g=1}}i.push(e.clone(t[I])),g++,N=M}o.push(g)}return{positions:i,lengths:o}},E.generateArc=function(t){r(t)||(t={});var a=t.positions,o=a.length,u=n(t.ellipsoid,i.WGS84),l=n(t.height,0),f=s(l);if(o<1)return[];if(1===o){var d=u.scaleToGeodeticSurface(a[0],M);if(l=f?l[0]:l,0!==l){var m=u.geodeticSurfaceNormal(d,I);e.multiplyByScalar(m,l,m),e.add(d,m,d)}return[d.x,d.y,d.z]}var p=t.minDistance;if(!r(p)){var y=n(t.granularity,c.RADIANS_PER_DEGREE);p=c.chordLength(y,u.maximumRadius)}var _,T=0;for(_=0;_<o-1;_++)T+=E.numberOfPoints(a[_],a[_+1],p);var R=3*(T+1),A=new Array(R),v=0;for(_=0;_<o-1;_++){var S=a[_],O=a[_+1],w=f?l[_]:l,x=f?l[_+1]:l;v=h(S,O,p,u,w,x,A,v)}g.length=0;var C=a[o-1],P=u.cartesianToCartographic(C,N);P.height=f?l[o-1]:l;var D=u.cartographicToCartesian(P,I);return e.pack(D,A,R-3),A},E.generateCartesianArc=function(t){for(var n=E.generateArc(t),r=n.length/3,a=new Array(r),i=0;i<r;i++)a[i]=e.unpack(n,3*i);return a},E}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n){this.x=t(e,0),this.y=t(n,0)}o.fromElements=function(e,t,r){return n(r)?(r.x=e,r.y=t,r):new o(e,t)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t):new o(e.x,e.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r]=e.y,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=2*r:t=new Array(2*r);for(var a=0;a<r;++a)o.pack(e[a],t,2*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/2:t=new Array(r/2);for(var a=0;a<r;a+=2){var i=a/2;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y)},o.minimumComponent=function(e){return Math.min(e.x,e.y)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){return o.normalize(e,c),o.normalize(t,l),i.acosClamped(o.dot(c,l))};var f=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)},o.ZERO=a(new o(0,0)),o.UNIT_X=a(new o(1,0)),o.UNIT_Y=a(new o(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,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Intersect"],function(e,t,n,r,a){"use strict";function i(r,a,i){this.minimum=e.clone(t(r,e.ZERO)),this.maximum=e.clone(t(a,e.ZERO)),n(i)?i=e.clone(i):(i=e.add(this.minimum,this.maximum,new e),e.multiplyByScalar(i,.5,i)),this.center=i}i.fromPoints=function(t,r){if(n(r)||(r=new i),!n(t)||0===t.length)return r.minimum=e.clone(e.ZERO,r.minimum),r.maximum=e.clone(e.ZERO,r.maximum),r.center=e.clone(e.ZERO,r.center),r;for(var a=t[0].x,o=t[0].y,u=t[0].z,s=t[0].x,c=t[0].y,l=t[0].z,f=t.length,d=1;d<f;d++){var h=t[d],E=h.x,m=h.y,p=h.z;a=Math.min(E,a),s=Math.max(E,s),o=Math.min(m,o),c=Math.max(m,c),u=Math.min(p,u),l=Math.max(p,l)}var y=r.minimum;y.x=a,y.y=o,y.z=u;var _=r.maximum;_.x=s,_.y=c,_.z=l;var T=e.add(y,_,r.center);return e.multiplyByScalar(T,.5,T),r},i.clone=function(t,r){if(n(t))return n(r)?(r.minimum=e.clone(t.minimum,r.minimum),r.maximum=e.clone(t.maximum,r.maximum),r.center=e.clone(t.center,r.center),r):new i(t.minimum,t.maximum)},i.equals=function(t,r){return t===r||n(t)&&n(r)&&e.equals(t.center,r.center)&&e.equals(t.minimum,r.minimum)&&e.equals(t.maximum,r.maximum)};var o=new e;return i.intersectPlane=function(t,n){o=e.subtract(t.maximum,t.minimum,o);var r=e.multiplyByScalar(o,.5,o),i=n.normal,u=r.x*Math.abs(i.x)+r.y*Math.abs(i.y)+r.z*Math.abs(i.z),s=e.dot(t.center,i)+n.distance;return s-u>0?a.INSIDE:s+u<0?a.OUTSIDE:a.INTERSECTING},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.intersectPlane=function(e){return i.intersectPlane(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,n,r,a){return t(e).then(n,r,a)}function t(e){var t,n;return e instanceof r?t=e:u(e)?(n=o(),e.then(function(e){n.resolve(e)},function(e){n.reject(e)},function(e){n.progress(e)}),t=n.promise):t=a(e),t}function n(t){return e(t,i)}function r(e){this.then=e}function a(e){var n=new r(function(n){try{return t(n?n(e):e)}catch(e){return i(e)}});return n}function i(e){var n=new r(function(n,r){try{return r?t(r(e)):i(e)}catch(e){return i(e)}});return n}function o(){function e(e,t,n){return d(e,t,n)}function n(e){return E(e)}function a(e){return E(i(e))}function u(e){return h(e)}var s,c,l,f,d,h,E;return c=new r(e),s={then:e,resolve:n,reject:a,progress:u,promise:c,resolver:{resolve:n,reject:a,progress:u}},l=[],f=[],d=function(e,t,n){var r,a;return r=o(),a="function"==typeof n?function(e){try{r.progress(n(e))}catch(e){r.progress(e)}}:function(e){r.progress(e)},l.push(function(n){n.then(e,t).then(r.resolve,r.reject,a)}),f.push(a),r.promise},h=function(e){return m(f,e),e},E=function(e){return e=t(e),d=e.then,E=t,h=y,m(l,e),f=l=A,e},s}function u(e){return e&&"function"==typeof e.then}function s(t,n,r,a,i){return p(2,arguments),e(t,function(t){function u(e){m(e)}function s(e){E(e)}var c,l,f,d,h,E,m,p,_,T;if(_=t.length>>>0,c=Math.max(0,Math.min(n,_)),f=[],l=_-c+1,d=[],h=o(),c)for(p=h.progress,m=function(e){d.push(e),--l||(E=m=y,h.reject(d))},E=function(e){f.push(e),--c||(E=m=y,h.resolve(f))},T=0;T<_;++T)T in t&&e(t[T],s,u,p);else h.resolve(f);return h.then(r,a,i)})}function c(e,t,n,r){function a(e){return t?t(e[0]):e[0]}return s(e,1,a,n,r)}function l(e,t,n,r){return p(1,arguments),d(e,_).then(t,n,r)}function f(){return d(arguments,_)}function d(t,n){return e(t,function(t){var r,a,i,u,s,c;if(i=a=t.length>>>0,r=[],c=o(),i)for(u=function(t,a){e(t,n).then(function(e){r[a]=e,--i||c.resolve(r)},c.reject)},s=0;s<a;s++)s in t?u(t[s],s):--i;else c.resolve(r);return c.promise})}function h(t,n){var r=R.call(arguments,1);return e(t,function(t){var a;return a=t.length,r[0]=function(t,r,i){return e(t,function(t){return e(r,function(e){return n(t,e,i,a)})})},T.apply(t,r)})}function E(t,n,r){var a=arguments.length>2;return e(t,function(e){return e=a?r:e,n.resolve(e),e},function(e){return n.reject(e),i(e)},n.progress)}function m(e,t){for(var n,r=0;n=e[r++];)n(t)}function p(e,t){for(var n,r=t.length;r>e;)if(n=t[--r],null!=n&&"function"!=typeof n)throw new Error("arg "+r+" must be a function")}function y(){}function _(e){return e}var T,R,A;return e.defer=o,e.resolve=t,e.reject=n,e.join=f,e.all=l,e.map=d,e.reduce=h,e.any=c,e.some=s,e.chain=E,e.isPromise=u,r.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(A,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return l(t,function(t){return e.apply(A,t)})})}},R=[].slice,T=[].reduce||function(e){var t,n,r,a,i;if(i=0,t=Object(this),a=t.length>>>0,n=arguments,n.length<=1)for(;;){if(i in t){r=t[i++];break}if(++i>=a)throw new TypeError}else r=n[1];for(;i<a;++i)i in t&&(r=e(r,t[i],i,t));return r},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/binarySearch",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e,t,n){for(var r,a,i=0,o=e.length-1;i<=o;)if(r=~~((i+o)/2),a=n(e[r],t),a<0)i=r+1;else{if(!(a>0))return r;o=r-1}return~(o+1)}return n}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,n,r,a){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=r,this.ut1MinusUtc=a}return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,n=0,r=t[n++],a=function(e,t,n,r){n||(n=" ");var a=e.length>=t?"":Array(1+t-e.length>>>0).join(n);return r?e+a:a+e},i=function(e,t,n,r,i,o){var u=r-e.length;return u>0&&(e=n||!i?a(e,r,o,n):e.slice(0,t.length)+a("",u,"0",!0)+e.slice(t.length)),e},o=function(e,t,n,r,o,u,s){var c=e>>>0;return n=n&&c&&{2:"0b",8:"0",16:"0x"}[t]||"",e=n+a(c.toString(t),u||0,"0",!1),i(e,n,r,o,s)},u=function(e,t,n,r,a,o){return null!=r&&(e=e.slice(0,r)),i(e,"",t,n,a,o)},s=function(e,r,s,c,l,f,d){var h,E,m,p,y;if("%%"==e)return"%";for(var _=!1,T="",R=!1,A=!1,v=" ",S=s.length,g=0;s&&g<S;g++)switch(s.charAt(g)){case" ":T=" ";break;case"+":T="+";break;case"-":_=!0;break;case"'":v=s.charAt(g+1);break;case"0":R=!0;break;case"#":A=!0}if(c=c?"*"==c?+t[n++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,c<0&&(c=-c,_=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(f=f?"*"==f?+t[n++]:"*"==f.charAt(0)?+t[f.slice(1,-1)]:+f:"fFeE".indexOf(d)>-1?6:"d"==d?0:void 0,y=r?t[r.slice(0,-1)]:t[n++],d){case"s":return u(String(y),_,c,f,R,v);case"c":return u(String.fromCharCode(+y),_,c,f,R);case"b":return o(y,2,A,_,c,f,R);case"o":return o(y,8,A,_,c,f,R);case"x":return o(y,16,A,_,c,f,R);case"X":return o(y,16,A,_,c,f,R).toUpperCase();case"u":return o(y,10,A,_,c,f,R);case"i":case"d":return h=+y||0,h=Math.round(h-h%1),E=h<0?"-":T,y=E+a(String(Math.abs(h)),f,"0",!1),i(y,E,_,c,R);case"e":case"E":case"f":case"F":case"g":case"G":return h=+y,E=h<0?"-":T,m=["toExponential","toFixed","toPrecision"]["efg".indexOf(d.toLowerCase())],p=["toString","toUpperCase"]["eEfFgG".indexOf(d)%2],y=E+Math.abs(h)[m](f),i(y,E,_,c,R)[p]();default:return e}};return r.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,n,r,a,i,o,u){this.year=e,this.month=t,this.day=n,this.hour=r,this.minute=a,this.second=i,this.millisecond=o,this.isLeapSecond=u}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e(t)}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t){return m.compare(e.julianDate,t.julianDate)}function f(e){T.julianDate=e;var n=m.leapSeconds,r=t(n,T,l);r<0&&(r=~r),r>=n.length&&(r=n.length-1);var a=n[r].offset;if(r>0){var i=m.secondsDifference(n[r].julianDate,e);i>a&&(r--,a=n[r].offset)}m.addSeconds(e,a,e)}function d(e,n){T.julianDate=e;var r=m.leapSeconds,a=t(r,T,l);if(a<0&&(a=~a),0===a)return m.addSeconds(e,-r[0].offset,n);if(a>=r.length)return m.addSeconds(e,-r[a-1].offset,n);var i=m.secondsDifference(r[a].julianDate,e);return 0===i?m.addSeconds(e,-r[a].offset,n):i<=1?void 0:m.addSeconds(e,-r[--a].offset,n)}function h(e,t,n){var r=t/s.SECONDS_PER_DAY|0;return e+=r,t-=s.SECONDS_PER_DAY*r,t<0&&(e--,t+=s.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function E(e,t,n,r,a,i,o){var u=(t-14)/12|0,c=e+4800+u,l=(1461*c/4|0)+(367*(t-2-12*u)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;r-=12,r<0&&(r+=24);var f=i+(r*s.SECONDS_PER_HOUR+a*s.SECONDS_PER_MINUTE+o*s.SECONDS_PER_MILLISECOND);return f>=43200&&(l-=1),[l,f]}function m(e,t,r){this.dayNumber=void 0,this.secondsOfDay=void 0,e=n(e,0),t=n(t,0),r=n(r,c.UTC);var a=0|e;t+=(e-a)*s.SECONDS_PER_DAY,h(a,t,this),r===c.UTC&&f(this)}var p=new i,y=[31,28,31,30,31,30,31,31,30,31,30,31],_=29,T=new u,R=/^(\d{4})$/,A=/^(\d{4})-(\d{2})$/,v=/^(\d{4})-?(\d{3})$/,S=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,g=/^(\d{4})-?(\d{2})-?(\d{2})$/,N=/([Z+\-])?(\d{2})?:?(\d{2})?$/,O=/^(\d{2})(\.\d+)?/.source+N.source,I=/^(\d{2}):?(\d{2})(\.\d+)?/.source+N.source,M=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+N.source;m.fromDate=function(e,t){var n=E(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r(t)?(h(n[0],n[1],t),f(t),t):new m(n[0],n[1],c.UTC)},m.fromIso8601=function(e,t){e=e.replace(",",".");var n,a,i,u=e.split("T"),s=1,l=1,d=0,p=0,T=0,N=0,w=u[0],x=u[1];if(u=w.match(g),null!==u)n=+u[1],s=+u[2],l=+u[3];else if(u=w.match(A),null!==u)n=+u[1],s=+u[2];else if(u=w.match(R),null!==u)n=+u[1];else{var C;if(u=w.match(v),null!==u)n=+u[1],C=+u[2],i=o(n);else if(u=w.match(S),null!==u){n=+u[1];var P=+u[2],D=+u[3]||0,U=new Date(Date.UTC(n,0,4));C=7*P+D-U.getUTCDay()-3}a=new Date(Date.UTC(n,0,1)),a.setUTCDate(C),s=a.getUTCMonth()+1,l=a.getUTCDate()}i=o(n);var L;if(r(x)){u=x.match(M),null!==u?(d=+u[1],p=+u[2],T=+u[3],N=1e3*+(u[4]||0),L=5):(u=x.match(I),null!==u?(d=+u[1],p=+u[2],T=60*+(u[3]||0),L=4):(u=x.match(O),null!==u&&(d=+u[1],p=60*+(u[2]||0),L=3)));var F=u[L],z=+u[L+1],B=+(u[L+2]||0);switch(F){case"+":d-=z,p-=B;break;case"-":d+=z,p+=B;break;case"Z":break;default:p+=new Date(Date.UTC(n,s-1,l,d,p)).getTimezoneOffset()}}else p+=new Date(n,s-1,l).getTimezoneOffset();var b=60===T;for(b&&T--;p>=60;)p-=60,d++;for(;d>=24;)d-=24,l++;for(a=i&&2===s?_:y[s-1];l>a;)l-=a,s++,s>12&&(s-=12,n++),a=i&&2===s?_:y[s-1];for(;p<0;)p+=60,d--;for(;d<0;)d+=24,l--;for(;l<1;)s--,s<1&&(s+=12,n--),a=i&&2===s?_:y[s-1],l+=a;var G=E(n,s,l,d,p,T,N);return r(t)?(h(G[0],G[1],t),f(t)):t=new m(G[0],G[1],c.UTC),b&&m.addSeconds(t,1,t),t},m.now=function(e){return m.fromDate(new Date,e)};var w=new m(0,0,c.TAI);return m.toGregorianDate=function(e,t){var n=!1,a=d(e,w);r(a)||(m.addSeconds(e,-1,w),a=d(w,w),n=!0);var o=a.dayNumber,u=a.secondsOfDay;u>=43200&&(o+=1);var c=o+68569|0,l=4*c/146097|0;c=c-((146097*l+3)/4|0)|0;var f=4e3*(c+1)/1461001|0;c=c-(1461*f/4|0)+31|0;var h=80*c/2447|0,E=c-(2447*h/80|0)|0;c=h/11|0;var p=h+2-12*c|0,y=100*(l-49)+f+c|0,_=u/s.SECONDS_PER_HOUR|0,T=u-_*s.SECONDS_PER_HOUR,R=T/s.SECONDS_PER_MINUTE|0;T-=R*s.SECONDS_PER_MINUTE;var A=0|T,v=(T-A)/s.SECONDS_PER_MILLISECOND;return _+=12,_>23&&(_-=24),n&&(A+=1),r(t)?(t.year=y,t.month=p,t.day=E,t.hour=_,t.minute=R,t.second=A,t.millisecond=v,t.isLeapSecond=n,t):new i(y,p,E,_,R,A,v,n)},m.toDate=function(e){var t=m.toGregorianDate(e,p),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))},m.toIso8601=function(t,n){var a,i=m.toGregorianDate(t,i);return r(n)||0===i.millisecond?r(n)&&0!==n?(a=(.01*i.millisecond).toFixed(n).replace(".","").slice(0,n),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",i.year,i.month,i.day,i.hour,i.minute,i.second):(a=(.01*i.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a))},m.clone=function(e,t){if(r(e))return r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new m(e.dayNumber,e.secondsOfDay,c.TAI)},m.compare=function(e,t){var n=e.dayNumber-t.dayNumber;return 0!==n?n:e.secondsOfDay-t.secondsOfDay},m.equals=function(e,t){return e===t||r(e)&&r(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},m.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(m.secondsDifference(e,t))<=n},m.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},m.secondsDifference=function(e,t){var n=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return n+(e.secondsOfDay-t.secondsOfDay)},m.daysDifference=function(e,t){var n=e.dayNumber-t.dayNumber,r=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return n+r},m.computeTaiMinusUtc=function(e){T.julianDate=e;var n=m.leapSeconds,r=t(n,T,l);return r<0&&(r=~r,--r,r<0&&(r=0)),n[r].offset},m.addSeconds=function(e,t,n){return h(e.dayNumber,e.secondsOfDay+t,n)},m.addMinutes=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return h(e.dayNumber,r,n)},m.addHours=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return h(e.dayNumber,r,n)},m.addDays=function(e,t,n){var r=e.dayNumber+t;return h(r,e.secondsOfDay,n)},m.lessThan=function(e,t){return m.compare(e,t)<0},m.lessThanOrEquals=function(e,t){return m.compare(e,t)<=0},m.greaterThan=function(e,t){return m.compare(e,t)>0},m.greaterThanOrEquals=function(e,t){return m.compare(e,t)>=0},m.prototype.clone=function(e){return m.clone(this,e)},m.prototype.equals=function(e){return m.equals(this,e)},m.prototype.equalsEpsilon=function(e,t){return m.equalsEpsilon(this,e,t)},m.prototype.toString=function(){return m.toIso8601(this)},m.leapSeconds=[new u(new m(2441317,43210,c.TAI),10),new u(new m(2441499,43211,c.TAI),11),new u(new m(2441683,43212,c.TAI),12),new u(new m(2442048,43213,c.TAI),13),new u(new m(2442413,43214,c.TAI),14),new u(new m(2442778,43215,c.TAI),15),new u(new m(2443144,43216,c.TAI),16),new u(new m(2443509,43217,c.TAI),17),new u(new m(2443874,43218,c.TAI),18),new u(new m(2444239,43219,c.TAI),19),new u(new m(2444786,43220,c.TAI),20),new u(new m(2445151,43221,c.TAI),21),new u(new m(2445516,43222,c.TAI),22),new u(new m(2446247,43223,c.TAI),23),new u(new m(2447161,43224,c.TAI),24),new u(new m(2447892,43225,c.TAI),25),new u(new m(2448257,43226,c.TAI),26),new u(new m(2448804,43227,c.TAI),27),new u(new m(2449169,43228,c.TAI),28),new u(new m(2449534,43229,c.TAI),29),new u(new m(2450083,43230,c.TAI),30),new u(new m(2450630,43231,c.TAI),31),new u(new m(2451179,43232,c.TAI),32),new u(new m(2453736,43233,c.TAI),33),new u(new m(2454832,43234,c.TAI),34),new u(new m(2456109,43235,c.TAI),35),new u(new m(2457204,43236,c.TAI),36),new u(new m(2457754,43237,c.TAI),37)],m}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(n,r){if(null===n||"object"!=typeof n)return n;r=e(r,!1);var a=new n.constructor;for(var i in n)if(n.hasOwnProperty(i)){var o=n[i];r&&(o=t(o,r)),a[i]=o}return a}return t}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var n=e.split("\r\n"),r=0;r<n.length;++r){var a=n[r],i=a.indexOf(": ");if(i>0){var o=a.substring(0,i),u=a.substring(i+2);t[o]=u}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function n(e,n,r){this.statusCode=e,this.response=n,this.responseHeaders=r,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return n.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},n}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var n=r.exec(t);this.scheme=n[1],this.authority=n[2],this.path=n[3],this.query=n[4],this.fragment=n[5]}}function t(e){var t=unescape(e);return i.test(t)?t:e.toUpperCase()}function n(e,t,n,r){return(t||"")+n.toLowerCase()+(r||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var r=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(o,n).replace(a,t)),this.path&&(this.path=this.path.replace(a,t)),this.query&&(this.query=this.query.replace(a,t)),this.fragment&&(this.fragment=this.fragment.replace(a,t))};var a=/%[0-9a-z]{2}/gi,i=/[a-zA-Z0-9\-\._~]/,o=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var n=new e;return this.scheme?(n.scheme=this.scheme,n.authority=this.authority,n.path=this.path,n.query=this.query):(n.scheme=t.scheme,this.authority?(n.authority=this.authority,n.path=this.path,n.query=this.query):(n.authority=t.authority,""==this.path?(n.path=t.path,n.query=this.query||t.query):("/"==this.path.charAt(0)?(n.path=this.path,n.removeDotSegments()):(t.authority&&""==t.path?n.path="/"+this.path:n.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,n.removeDotSegments()),n.query=this.query))),n.fragment=this.fragment,n},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),n=[],r=""==t[0];r&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?n.pop():"."!=e&&n.push(e);"."!=e&&".."!=e||n.push(""),r&&n.unshift(""),this.path=n.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n){var r=new e(n);r.normalize();var a=r.getAuthority();if(t(a)){if(a.indexOf("@")!==-1){var i=a.split("@");a=i[1]}if(a.indexOf(":")===-1){var o=r.getScheme();if(t(o)||(o=window.location.protocol,o=o.substring(0,o.length-1)),"http"===o)a+=":80";else{if("https"!==o)return;a+=":443"}}return a}}var a={},i={};return a.add=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])||(i[r]=!0)},a.remove=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])&&delete i[r]},a.contains=function(e){var n=r(e);return!(!t(n)||!t(i[n]))},a.clear=function(){i={}},a}),define("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,n,r,a,i,o){"use strict";function u(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,a=t(n.method,"GET"),i=n.data,o=n.headers,s=n.overrideMimeType;return e(n.url,function(t){var n=e.defer();return u.load(t,r,a,i,o,n,s),n.promise})}function s(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function c(e,t){for(var n=s(e,t),r=new ArrayBuffer(n.length),a=new Uint8Array(r),i=0;i<n.length;i++)a[i]=n.charCodeAt(i);return r}function l(e,n){n=t(n,"");var r=e[1],a=!!e[2],i=e[3];switch(n){case"":case"text":return s(a,i);case"arraybuffer":return c(a,i);case"blob":var o=c(a,i);return new Blob([o],{type:r});case"document":var u=new DOMParser;return u.parseFromString(s(a,i),r);case"json":return JSON.parse(s(a,i))}}var f=/^data:(.*?)(;base64)?,(.*)$/;return u.load=function(e,t,r,u,s,c,d){var h=f.exec(e);if(null!==h)return void c.resolve(l(h,t));var E=new XMLHttpRequest;if(o.contains(e)&&(E.withCredentials=!0),n(d)&&n(E.overrideMimeType)&&E.overrideMimeType(d),E.open(r,e,!0),n(s))for(var m in s)s.hasOwnProperty(m)&&E.setRequestHeader(m,s[m]);n(t)&&(E.responseType=t),E.onload=function(){if(E.status<200||E.status>=300)return void c.reject(new a(E.status,E.response,E.getAllResponseHeaders()));var e=E.response,r=E.responseType;if(!n(e)||n(t)&&r!==t)if("json"===t&&"string"==typeof e)try{c.resolve(JSON.parse(e))}catch(e){c.reject(e)}else(""===r||"document"===r)&&n(E.responseXML)&&E.responseXML.hasChildNodes()?c.resolve(E.responseXML):""!==r&&"text"!==r||!n(E.responseText)?c.reject(new i("Invalid XMLHttpRequest response type.")):c.resolve(E.responseText);else c.resolve(e)},E.onerror=function(e){c.reject(new a)},E.send(u)},u.defaultLoad=u.load,u}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,n){return e({url:t,headers:n})}return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";function a(n,a){return t(a)?t(a.Accept)||(a=e(a),a.Accept=i.Accept):a=i,r(n,a).then(function(e){return JSON.parse(e)})}var i={Accept:"application/json,*/*;q=0.01"};return a}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function d(t){if(t=n(t,n.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=n(t.addNewLeapSeconds,!0),r(t.data))E(this,t.data);else if(r(t.url)){var a=this;this._downloadPromise=e(s(t.url),function(e){E(a,e)},function(){a._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else E(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function h(e,t){return o.compare(e.julianDate,t)}function E(e,n){if(!r(n.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!r(n.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var a=n.columnNames.indexOf("modifiedJulianDateUtc"),i=n.columnNames.indexOf("xPoleWanderRadians"),s=n.columnNames.indexOf("yPoleWanderRadians"),c=n.columnNames.indexOf("ut1MinusUtcSeconds"),d=n.columnNames.indexOf("xCelestialPoleOffsetRadians"),E=n.columnNames.indexOf("yCelestialPoleOffsetRadians"),m=n.columnNames.indexOf("taiMinusUtcSeconds");if(a<0||i<0||s<0||c<0||d<0||E<0||m<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var p=e._samples=n.samples,y=e._dates=[];e._dateColumn=a,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=d,e._yCelestialPoleOffsetRadiansColumn=E,e._taiMinusUtcSecondsColumn=m,e._columnCount=n.columnNames.length,e._lastIndex=void 0;for(var _,T=e._addNewLeapSeconds,R=0,A=p.length;R<A;R+=e._columnCount){var v=p[R+a],S=p[R+m],g=v+l.MODIFIED_JULIAN_DATE_DIFFERENCE,N=new o(g,S,f.TAI);if(y.push(N),T){if(S!==_&&r(_)){ +var O=o.leapSeconds,I=t(O,N,h);if(I<0){var M=new u(N,S);O.splice(~I,0,M)}}_=S}}}function m(e,t,n,r,a){var i=n*r;a.xPoleWander=t[i+e._xPoleWanderRadiansColumn],a.yPoleWander=t[i+e._yPoleWanderRadiansColumn],a.xPoleOffset=t[i+e._xCelestialPoleOffsetRadiansColumn],a.yPoleOffset=t[i+e._yCelestialPoleOffsetRadiansColumn],a.ut1MinusUtc=t[i+e._ut1MinusUtcSecondsColumn]}function p(e,t,n){return t+e*(n-t)}function y(e,t,n,r,a,i,u){var s=e._columnCount;if(i>t.length-1)return u.xPoleWander=0,u.yPoleWander=0,u.xPoleOffset=0,u.yPoleOffset=0,u.ut1MinusUtc=0,u;var c=t[a],l=t[i];if(c.equals(l)||r.equals(c))return m(e,n,a,s,u),u;if(r.equals(l))return m(e,n,i,s,u),u;var f=o.secondsDifference(r,c)/o.secondsDifference(l,c),d=a*s,h=i*s,E=n[d+e._ut1MinusUtcSecondsColumn],y=n[h+e._ut1MinusUtcSecondsColumn],_=y-E;if(_>.5||_<-.5){var T=n[d+e._taiMinusUtcSecondsColumn],R=n[h+e._taiMinusUtcSecondsColumn];T!==R&&(l.equals(r)?E=y:y-=R-T)}return u.xPoleWander=p(f,n[d+e._xPoleWanderRadiansColumn],n[h+e._xPoleWanderRadiansColumn]),u.yPoleWander=p(f,n[d+e._yPoleWanderRadiansColumn],n[h+e._yPoleWanderRadiansColumn]),u.xPoleOffset=p(f,n[d+e._xCelestialPoleOffsetRadiansColumn],n[h+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=p(f,n[d+e._yCelestialPoleOffsetRadiansColumn],n[h+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=p(f,E,y),u}return d.NONE=i({getPromiseToLoad:function(){return e()},compute:function(e,t){return r(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new a(0,0,0,0,0),t}}),d.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},d.prototype.compute=function(e,n){if(r(this._samples)){if(r(n)||(n=new a(0,0,0,0,0)),0===this._samples.length)return n.xPoleWander=0,n.yPoleWander=0,n.xPoleOffset=0,n.yPoleOffset=0,n.ut1MinusUtc=0,n;var i=this._dates,u=this._lastIndex,s=0,l=0;if(r(u)){var f=i[u],d=i[u+1],h=o.lessThanOrEquals(f,e),E=!r(d),m=E||o.greaterThanOrEquals(d,e);if(h&&m)return s=u,!E&&d.equals(e)&&++s,l=s+1,y(this,i,this._samples,e,s,l,n),n}var p=t(i,e,o.compare,this._dateColumn);return p>=0?(p<i.length-1&&i[p+1].equals(e)&&++p,s=p,l=p):(l=~p,s=l-1,s<0&&(s=0)),this._lastIndex=s,y(this,i,this._samples,e,s,l,n),n}if(r(this._dataError))throw new c(this._dataError)},d}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(t,n,r){this.heading=e(t,0),this.pitch=e(n,0),this.roll=e(r,0)}return a.fromQuaternion=function(e,n){t(n)||(n=new a);var r=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return n.heading=-Math.atan2(s,u),n.roll=Math.atan2(o,i),n.pitch=-Math.asin(r),n},a.fromDegrees=function(e,n,i,o){return t(o)||(o=new a),o.heading=e*r.RADIANS_PER_DEGREE,o.pitch=n*r.RADIANS_PER_DEGREE,o.roll=i*r.RADIANS_PER_DEGREE,o},a.clone=function(e,n){if(t(e))return t(n)?(n.heading=e.heading,n.pitch=e.pitch,n.roll=e.roll,n):new a(e.heading,e.pitch,e.roll)},a.equals=function(e,n){return e===n||t(e)&&t(n)&&e.heading===n.heading&&e.pitch===n.pitch&&e.roll===n.roll},a.equalsEpsilon=function(e,n,a,i){return e===n||t(e)&&t(n)&&r.equalsEpsilon(e.heading,n.heading,a,i)&&r.equalsEpsilon(e.pitch,n.pitch,a,i)&&r.equalsEpsilon(e.roll,n.roll,a,i)},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,n){return a.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},a}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=t(r,document.location.href);var a=new e(r),i=new e(n);return i.resolve(a).toString()}return a}),define("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(r,a,i){i=t(i,!0),r instanceof e||(r=new e(r)),a instanceof e||(a=new e(a)),n(a.authority)&&!n(a.scheme)&&("undefined"!=typeof document&&n(document.location)&&n(document.location.href)?a.scheme=new e(document.location.href).scheme:a.scheme=r.scheme);var o=r;a.isAbsolute()&&(o=a);var u="";n(o.scheme)&&(u+=o.scheme+":"),n(o.authority)&&(u+="//"+o.authority,""!==o.path&&"/"!==o.path&&(u=u.replace(/\/?$/,"/"),o.path=o.path.replace(/^\/?/g,""))),u+=o===r?i?r.path.replace(/\/?$/,"/")+a.path.replace(/^\/?/g,""):r.path+a.path:a.path;var s=n(r.query),c=n(a.query);s&&c?u+="?"+r.query+"&"+a.query:s&&!c?u+="?"+r.query:!s&&c&&(u+="?"+a.query);var l=n(a.fragment);return n(r.fragment)&&!l?u+="#"+r.fragment:l&&(u+="#"+a.fragment),u}return a}),define("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","./joinUrls","require"],function(e,t,n,r,a,i){"use strict";function o(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;t<n;++t){var r=e[t].getAttribute("src"),a=E.exec(r);if(null!==a)return a[1]}}function u(){if(t(f))return f;var n;return n="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:o(),f=new e(r(n))}function s(e){return i.toUrl("../"+e)}function c(e){return a(u(),e)}function l(e){t(d)||(d=t(i.toUrl)?s:c),t(h)||(h=document.createElement("a"));var n=d(e);return h.href=n,h.href=h.href,h.href}var f,d,h,E=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return l._cesiumScriptRegex=E,l.setBaseUrl=function(t){f=new e(t).resolve(new e(document.location.href))},l}),define("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,n){this.x=e,this.y=t,this.s=n}return e}),define("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){e=n(e,n.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=n(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=n(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new i(this._sampleZeroJulianEphemerisDate,0,u.TAI),this._stepSizeDays=n(e.stepSizeDays,1),this._samplesPerXysFile=n(e.samplesPerXysFile,1e3),this._totalSamples=n(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,r=this._denominators=new Array(t+1),a=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t),s=0;s<=t;++s){r[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;c<=t;++c)c!==s&&(r[s]*=s-c);r[s]=1/r[s]}this._work=new Array(t+1),this._coef=new Array(t+1)}function c(e,t,n){var r=f;return r.dayNumber=t,r.secondsOfDay=n,i.daysDifference(r,e._sampleZeroDateTT)}function l(n,a){if(n._chunkDownloadsInProgress[a])return n._chunkDownloadsInProgress[a];var i=e.defer();n._chunkDownloadsInProgress[a]=i;var u,s=n._xysFileUrlTemplate;return u=r(s)?s.replace("{0}",a):t("Assets/IAU2006_XYS/IAU2006_XYS_"+a+".json"),e(o(u),function(e){n._chunkDownloadsInProgress[a]=!1;for(var t=n._samples,r=e.samples,o=a*n._samplesPerXysFile*3,u=0,s=r.length;u<s;++u)t[o+u]=r[u];i.resolve()}),i.promise}var f=new i(0,0,u.TAI);return s.prototype.preload=function(t,n,r,a){var i=c(this,t,n),o=c(this,r,a),u=i/this._stepSizeDays-this._interpolationOrder/2|0;u<0&&(u=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var f=u/this._samplesPerXysFile|0,d=s/this._samplesPerXysFile|0,h=[],E=f;E<=d;++E)h.push(l(this,E));return e.all(h)},s.prototype.computeXysRadians=function(e,t,n){var i=c(this,e,t);if(!(i<0)){var o=i/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);s<0&&(s=0);var f=s+u;f>=this._totalSamples&&(f=this._totalSamples-1,s=f-u,s<0&&(s=0));var d=!1,h=this._samples;if(r(h[3*s])||(l(this,s/this._samplesPerXysFile|0),d=!0),r(h[3*f])||(l(this,f/this._samplesPerXysFile|0),d=!0),!d){r(n)?(n.x=0,n.y=0,n.s=0):n=new a(0,0,0);var E,m,p=i-s*this._stepSizeDays,y=this._work,_=this._denominators,T=this._coef,R=this._xTable;for(E=0;E<=u;++E)y[E]=p-R[E];for(E=0;E<=u;++E){for(T[E]=1,m=0;m<=u;++m)m!==E&&(T[E]*=y[m]);T[E]*=_[E];var A=3*(s+E);n.x+=T[E]*h[A++],n.y+=T[E]*h[A++],n.s+=T[E]*h[A]}return n}}}},s}),define("Core/Quaternion",["./Cartesian3","./Check","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math","./Matrix3"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(e,t,r,a){this.x=n(e,0),this.y=n(t,0),this.z=n(r,0),this.w=n(a,0)}var l=new e;c.fromAxisAngle=function(t,n,a){var i=n/2,o=Math.sin(i);l=e.normalize(t,l);var u=l.x*o,s=l.y*o,f=l.z*o,d=Math.cos(i);return r(a)?(a.x=u,a.y=s,a.z=f,a.w=d,a):new c(u,s,f,d)};var f=[1,2,0],d=new Array(3);c.fromRotationMatrix=function(e,t){var n,a,i,o,u,l=e[s.COLUMN0ROW0],h=e[s.COLUMN1ROW1],E=e[s.COLUMN2ROW2],m=l+h+E;if(m>0)n=Math.sqrt(m+1),u=.5*n,n=.5/n,a=(e[s.COLUMN1ROW2]-e[s.COLUMN2ROW1])*n,i=(e[s.COLUMN2ROW0]-e[s.COLUMN0ROW2])*n,o=(e[s.COLUMN0ROW1]-e[s.COLUMN1ROW0])*n;else{var p=f,y=0;h>l&&(y=1),E>l&&E>h&&(y=2);var _=p[y],T=p[_];n=Math.sqrt(e[s.getElementIndex(y,y)]-e[s.getElementIndex(_,_)]-e[s.getElementIndex(T,T)]+1);var R=d;R[y]=.5*n,n=.5/n,u=(e[s.getElementIndex(T,_)]-e[s.getElementIndex(_,T)])*n,R[_]=(e[s.getElementIndex(_,y)]+e[s.getElementIndex(y,_)])*n,R[T]=(e[s.getElementIndex(T,y)]+e[s.getElementIndex(y,T)])*n,a=-R[0],i=-R[1],o=-R[2]}return r(t)?(t.x=a,t.y=i,t.z=o,t.w=u,t):new c(a,i,o,u)};var h=new c;c.fromHeadingPitchRoll=function(t,n,r,a){var i=c.fromAxisAngle(e.UNIT_X,r,h),o=c.fromAxisAngle(e.UNIT_Y,-n,a);a=c.multiply(o,i,o);var u=c.fromAxisAngle(e.UNIT_Z,-t,h);return c.multiply(u,a,a)};var E=new e,m=new e,p=new c,y=new c,_=new c;c.packedLength=4,c.pack=function(e,t,r){return r=n(r,0),t[r++]=e.x,t[r++]=e.y,t[r++]=e.z,t[r]=e.w,t},c.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new c),a.x=e[t],a.y=e[t+1],a.z=e[t+2],a.w=e[t+3],a},c.packedInterpolationLength=3,c.convertPackedArrayForInterpolation=function(e,t,n,r){c.unpack(e,4*n,_),c.conjugate(_,_);for(var a=0,i=n-t+1;a<i;a++){var o=3*a;c.unpack(e,4*(t+a),p),c.multiply(p,_,p),p.w<0&&c.negate(p,p),c.computeAxis(p,E);var u=c.computeAngle(p);r[o]=E.x*u,r[o+1]=E.y*u,r[o+2]=E.z*u}},c.unpackInterpolationResult=function(t,n,a,i,o){r(o)||(o=new c),e.fromArray(t,0,m);var u=e.magnitude(m);return c.unpack(n,4*i,y),0===u?c.clone(c.IDENTITY,p):c.fromAxisAngle(m,u,p),c.multiply(p,y,o)},c.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new c(e.x,e.y,e.z,e.w)},c.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},c.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},c.magnitude=function(e){return Math.sqrt(c.magnitudeSquared(e))},c.normalize=function(e,t){var n=1/c.magnitude(e),r=e.x*n,a=e.y*n,i=e.z*n,o=e.w*n;return t.x=r,t.y=a,t.z=i,t.w=o,t},c.inverse=function(e,t){var n=c.magnitudeSquared(e);return t=c.conjugate(e,t),c.multiplyByScalar(t,1/n,t)},c.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},c.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},c.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},c.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},c.multiply=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=e.w,u=t.x,s=t.y,c=t.z,l=t.w,f=o*u+r*l+a*c-i*s,d=o*s-r*c+a*l+i*u,h=o*c+r*s-a*u+i*l,E=o*l-r*u-a*s-i*c;return n.x=f,n.y=d,n.z=h,n.w=E,n},c.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},c.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},c.computeAxis=function(e,t){var n=e.w;if(Math.abs(n-1)<u.EPSILON6)return t.x=t.y=t.z=0,t;var r=1/Math.sqrt(1-n*n);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},c.computeAngle=function(e){return Math.abs(e.w-1)<u.EPSILON6?0:2*Math.acos(e.w)};var T=new c;c.lerp=function(e,t,n,r){return T=c.multiplyByScalar(t,n,T),r=c.multiplyByScalar(e,1-n,r),c.add(T,r,r)};var R=new c,A=new c,v=new c;c.slerp=function(e,t,n,r){var a=c.dot(e,t),i=t;if(a<0&&(a=-a,i=R=c.negate(t,R)),1-a<u.EPSILON6)return c.lerp(e,i,n,r);var o=Math.acos(a);return A=c.multiplyByScalar(e,Math.sin((1-n)*o),A),v=c.multiplyByScalar(i,Math.sin(n*o),v),r=c.add(A,v,r),c.multiplyByScalar(r,1/Math.sin(o),r)},c.log=function(t,n){var r=u.acosClamped(t.w),a=0;return 0!==r&&(a=r/Math.sin(r)),e.multiplyByScalar(t,a,n)},c.exp=function(t,n){var r=e.magnitude(t),a=0;return 0!==r&&(a=Math.sin(r)/r),n.x=t.x*a,n.y=t.y*a,n.z=t.z*a,n.w=Math.cos(r),n};var S=new e,g=new e,N=new c,O=new c;c.computeInnerQuadrangle=function(t,n,r,a){var i=c.conjugate(n,N);c.multiply(i,r,O);var o=c.log(O,S);c.multiply(i,t,O);var u=c.log(O,g);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),c.exp(o,N),c.multiply(n,N,a)},c.squad=function(e,t,n,r,a,i){var o=c.slerp(e,t,a,N),u=c.slerp(n,r,a,O);return c.slerp(o,u,2*a*(1-a),i)};for(var I=new c,M=1.9011074535173003,w=i.supportsTypedArrays()?new Float32Array(8):[],x=i.supportsTypedArrays()?new Float32Array(8):[],C=i.supportsTypedArrays()?new Float32Array(8):[],P=i.supportsTypedArrays()?new Float32Array(8):[],D=0;D<7;++D){var U=D+1,L=2*U+1;w[D]=1/(U*L),x[D]=U/L}return w[7]=M/136,x[7]=8*M/17,c.fastSlerp=function(e,t,n,r){var a,i=c.dot(e,t);i>=0?a=1:(a=-1,i=-i);for(var o=i-1,u=1-n,s=n*n,l=u*u,f=7;f>=0;--f)C[f]=(w[f]*s-x[f])*o,P[f]=(w[f]*l-x[f])*o;var d=a*n*(1+C[0]*(1+C[1]*(1+C[2]*(1+C[3]*(1+C[4]*(1+C[5]*(1+C[6]*(1+C[7])))))))),h=u*(1+P[0]*(1+P[1]*(1+P[2]*(1+P[3]*(1+P[4]*(1+P[5]*(1+P[6]*(1+P[7])))))))),E=c.multiplyByScalar(e,h,I);return c.multiplyByScalar(t,d,r),c.add(E,r,r)},c.fastSquad=function(e,t,n,r,a,i){var o=c.fastSlerp(e,t,a,N),u=c.fastSlerp(n,r,a,O);return c.fastSlerp(o,u,2*a*(1-a),i)},c.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},c.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n},c.ZERO=o(new c(0,0,0,0)),c.IDENTITY=o(new c(0,0,0,1)),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.x+", "+this.y+", "+this.z+", "+this.w+")"},c}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./Check","./defaultValue","./defined","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./HeadingPitchRoll","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,n,r,a,i,o,u,s,c,l,f,d,h,E,m,p,y,_,T,R){"use strict";var A={},v=new n,S=new n,g=new n;A.eastNorthUpToFixedFrame=function(e,t,r){if(p.equalsEpsilon(e.x,0,p.EPSILON14)&&p.equalsEpsilon(e.y,0,p.EPSILON14)){var a=p.sign(e.z);return u(r)?(r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=-a,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=a,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(0,-a,0,e.x,1,0,0,e.y,0,0,a,e.z,0,0,0,1)}var i=v,s=S,c=g;return t=o(t,f.WGS84),t.geodeticSurfaceNormal(e,i),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(i,s,c),u(r)?(r[0]=s.x,r[1]=s.y,r[2]=s.z,r[3]=0,r[4]=c.x,r[5]=c.y,r[6]=c.z,r[7]=0,r[8]=i.x,r[9]=i.y,r[10]=i.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(s.x,c.x,i.x,e.x,s.y,c.y,i.y,e.y,s.z,c.z,i.z,e.z,0,0,0,1)};var N=new n,O=new n,I=new n;A.northEastDownToFixedFrame=function(e,t,r){if(p.equalsEpsilon(e.x,0,p.EPSILON14)&&p.equalsEpsilon(e.y,0,p.EPSILON14)){var a=p.sign(e.z);return u(r)?(r[0]=-a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=-a,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(-a,0,0,e.x,0,1,0,e.y,0,0,-a,e.z,0,0,0,1)}var i=N,s=O,c=I;return t=o(t,f.WGS84),t.geodeticSurfaceNormal(e,i),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(i,s,c),u(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=s.x,r[5]=s.y,r[6]=s.z,r[7]=0,r[8]=-i.x,r[9]=-i.y,r[10]=-i.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(c.x,s.x,-i.x,e.x,c.y,s.y,-i.y,e.y,c.z,s.z,-i.z,e.z,0,0,0,1)},A.northUpEastToFixedFrame=function(e,t,r){if(p.equalsEpsilon(e.x,0,p.EPSILON14)&&p.equalsEpsilon(e.y,0,p.EPSILON14)){var a=p.sign(e.z);return u(r)?(r[0]=-a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=a,r[7]=0,r[8]=0,r[9]=1,r[10]=0,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(-a,0,0,e.x,0,0,1,e.y,0,a,0,e.z,0,0,0,1)}var i=v,s=S,c=g;return t=o(t,f.WGS84),t.geodeticSurfaceNormal(e,i),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(i,s,c),u(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=i.x,r[5]=i.y,r[6]=i.z,r[7]=0,r[8]=s.x,r[9]=s.y,r[10]=s.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(c.x,i.x,s.x,e.x,c.y,i.y,s.y,e.y,c.z,i.z,s.z,e.z,0,0,0,1)},A.northWestUpToFixedFrame=function(e,t,r){if(p.equalsEpsilon(e.x,0,p.EPSILON14)&&p.equalsEpsilon(e.y,0,p.EPSILON14)){var a=p.sign(e.z);return u(r)?(r[0]=-a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=a,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(-a,0,0,e.x,0,-1,0,e.y,0,0,a,e.z,0,0,0,1)}var i=v,s=S,c=g;return t=o(t,f.WGS84),t.geodeticSurfaceNormal(e,i),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(i,s,c),u(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=-s.x,r[5]=-s.y,r[6]=-s.z,r[7]=0,r[8]=i.x,r[9]=i.y,r[10]=i.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(c.x,-s.x,i.x,e.x,c.y,-s.y,i.y,e.y,c.z,-s.z,i.z,e.z,0,0,0,1)};var M=new T,w=new n(1,1,1),x=new _;A.headingPitchRollToFixedFrame=function(e,t,r,a){i.typeOf.object("headingPitchRoll",t);var o=t.heading,u=t.pitch,s=t.roll,c=T.fromHeadingPitchRoll(o,u,s,M),l=_.fromTranslationQuaternionRotationScale(n.ZERO,c,w,x);return a=A.eastNorthUpToFixedFrame(e,r,a),_.multiply(a,l,a)};var C=new _,P=new y;A.headingPitchRollQuaternion=function(e,t,n,r){i.typeOf.object("headingPitchRoll",t);var a=A.headingPitchRollToFixedFrame(e,t,n,C),o=_.getRotation(a,P);return T.fromRotationMatrix(o,r)};var D=24110.54841,U=8640184.812866,L=.093104,F=-62e-7,z=1.1772758384668e-19,B=72921158553e-15,b=p.TWO_PI/86400,G=new m;A.computeTemeToPseudoFixedMatrix=function(e,t){G=m.addSeconds(e,-m.computeTaiMinusUtc(e),G);var n,r=G.dayNumber,a=G.secondsOfDay,i=r-2451545;n=a>=43200?(i+.5)/R.DAYS_PER_JULIAN_CENTURY:(i-.5)/R.DAYS_PER_JULIAN_CENTURY;var o=D+n*(U+n*(L+n*F)),s=o*b%p.TWO_PI,c=B+z*(r-2451545.5),l=(a+.5*R.SECONDS_PER_DAY)%R.SECONDS_PER_DAY,f=s+c*l,d=Math.cos(f),h=Math.sin(f);return u(t)?(t[0]=d,t[1]=-h,t[2]=0,t[3]=h,t[4]=d,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new y(d,h,0,-h,d,0,0,0,1)},A.iau2006XysData=new h,A.earthOrientationParameters=c.NONE;var q=32.184,W=2451545;A.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+q,a=t.stop.dayNumber,i=t.stop.secondsOfDay+q,o=A.iau2006XysData.preload(n,r,a,i),u=A.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},A.computeIcrfToFixedMatrix=function(e,t){u(t)||(t=new y);var n=A.computeFixedToIcrfMatrix(e,t);if(u(n))return y.transpose(n,t)};var V=new E(0,0,0),X=new l(0,0,0,0,0,0),H=new y,Y=new y;A.computeFixedToIcrfMatrix=function(e,t){u(t)||(t=new y);var n=A.earthOrientationParameters.compute(e,X);if(u(n)){var r=e.dayNumber,a=e.secondsOfDay+q,i=A.iau2006XysData.computeXysRadians(r,a,V);if(u(i)){var o=i.x+n.xPoleOffset,s=i.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-o*o-s*s)),l=H;l[0]=1-c*o*o,l[3]=-c*o*s,l[6]=o,l[1]=-c*o*s,l[4]=1-c*s*s,l[7]=s,l[2]=-o,l[5]=-s,l[8]=1-c*(o*o+s*s);var f=y.fromRotationZ(-i.s,Y),d=y.multiply(l,f,H),h=e.dayNumber,E=e.secondsOfDay-m.computeTaiMinusUtc(e)+n.ut1MinusUtc,_=h-2451545,T=E/R.SECONDS_PER_DAY,v=.779057273264+T+.00273781191135448*(_+T);v=v%1*p.TWO_PI;var S=y.fromRotationZ(v,Y),g=y.multiply(d,S,H),N=Math.cos(n.xPoleWander),O=Math.cos(n.yPoleWander),I=Math.sin(n.xPoleWander),M=Math.sin(n.yPoleWander),w=r-W+a/R.SECONDS_PER_DAY;w/=36525;var x=-47e-6*w*p.RADIANS_PER_DEGREE/3600,C=Math.cos(x),P=Math.sin(x),D=Y;return D[0]=N*C,D[1]=N*P,D[2]=I,D[3]=-O*P+M*I*C,D[4]=O*C+M*I*P,D[5]=-M*N,D[6]=-M*P-O*I*C,D[7]=M*C-O*I*P,D[8]=O*N,y.multiply(g,D,t)}}};var k=new r;A.pointToWindowCoordinates=function(e,t,n,r){return r=A.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},A.pointToGLWindowCoordinates=function(e,n,a,i){u(i)||(i=new t);var o=k;return _.multiplyByVector(e,r.fromElements(a.x,a.y,a.z,1,o),o),r.multiplyByScalar(o,1/o.w,o),_.multiplyByVector(n,o,o),t.fromCartesian4(o,i)};var Z=new n,j=new n,K=new n;A.rotationMatrixFromPositionVelocity=function(e,t,r,a){var i=o(r,f.WGS84).geodeticSurfaceNormal(e,Z),s=n.cross(t,i,j);n.equalsEpsilon(s,n.ZERO,p.EPSILON6)&&(s=n.clone(n.UNIT_X,s));var c=n.cross(s,t,K);return n.cross(t,c,s),n.negate(s,s),u(a)||(a=new y),a[0]=t.x,a[1]=t.y,a[2]=t.z,a[3]=s.x,a[4]=s.y,a[5]=s.z,a[6]=c.x,a[7]=c.y,a[8]=c.z,a};var J=new a,Q=new n,$=new n,ee=new r,te=new r,ne=new r,re=new r,ae=new r,ie=new _,oe=new _;A.basisTo2D=function(e,t,a){var i=e.ellipsoid,o=_.getColumn(t,3,ee),u=i.cartesianToCartographic(o,J),s=A.eastNorthUpToFixedFrame(o,i,ie),c=_.inverseTransformation(s,oe),l=e.project(u,Q),f=te;f.x=l.z,f.y=l.x,f.z=l.y,f.w=1;var d=_.getColumn(t,0,$),h=n.magnitude(d),E=_.multiplyByVector(c,d,ne);r.fromElements(E.z,E.x,E.y,0,E);var m=_.getColumn(t,1,$),p=n.magnitude(m),y=_.multiplyByVector(c,m,re);r.fromElements(y.z,y.x,y.y,0,y);var T=_.getColumn(t,2,$),R=n.magnitude(T),v=ae;return n.cross(E,y,v),n.normalize(v,v),n.cross(y,v,E),n.normalize(E,E),n.cross(v,E,y),n.normalize(y,y),n.multiplyByScalar(E,h,E),n.multiplyByScalar(y,p,y),n.multiplyByScalar(v,R,v),_.setColumn(a,0,E,a),_.setColumn(a,1,y,a),_.setColumn(a,2,v,a),_.setColumn(a,3,f,a),a};var ue=new _(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);return A.wgs84To2DModelMatrix=function(e,t,n){var r=e.ellipsoid,a=A.eastNorthUpToFixedFrame(t,r,ie),i=_.inverseTransformation(a,oe),o=r.cartesianToCartographic(t,J),u=e.project(o,Q),s=te;s.x=u.z,s.y=u.x,s.z=u.y,s.w=1;var c=_.fromTranslation(s,ie);return _.multiply(ue,i,n),_.multiply(c,n,n),n},A}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,f,d,h){"use strict";function E(e,t){t=a(t,s.WGS84),e=t.scaleToGeodeticSurface(e);var r=h.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=n.fromCartesian4(l.getColumn(r,0,m)),this._yAxis=n.fromCartesian4(l.getColumn(r,1,m));var i=n.fromCartesian4(l.getColumn(r,2,m));this._plane=f.fromPointNormal(e,i)}var m=new r;o(E.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var p=new e;E.fromPoints=function(t,n){var r=e.fromPoints(t,p);return new E(r.center,n)};var y=new d,_=new n;E.prototype.projectPointOntoPlane=function(e,r){var a=y;a.origin=e,n.normalize(e,a.direction);var o=c.rayPlane(a,this._plane,_);if(i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,_)),i(o)){var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return i(r)?(r.x=s,r.y=l,r):new t(s,l)}},E.prototype.projectPointsOntoPlane=function(e,t){i(t)||(t=[]);for(var n=0,r=e.length,a=0;a<r;a++){var o=this.projectPointOntoPlane(e[a],t[n]);i(o)&&(t[n]=o,n++)}return t.length=n,t},E.prototype.projectPointToNearestOnPlane=function(e,r){i(r)||(r=new t);var a=y;a.origin=e,n.clone(this._plane.normal,a.direction);var o=c.rayPlane(a,this._plane,_);i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,_));var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return r.x=s,r.y=l,r},E.prototype.projectPointsToNearestOnPlane=function(e,t){i(t)||(t=[]);var n=e.length;t.length=n;for(var r=0;r<n;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var T=new n;return E.prototype.projectPointsOntoEllipsoid=function(e,t){var r=e.length;i(t)?t.length=r:t=new Array(r);for(var a=this._ellipsoid,o=this._origin,u=this._xAxis,s=this._yAxis,c=T,l=0;l<r;++l){var f=e[l];n.multiplyByScalar(u,f.x,c),i(t[l])||(t[l]=new n);var d=n.add(o,c,t[l]);n.multiplyByScalar(s,f.y,c),n.add(d,c,d),a.scaleToGeocentricSurface(d,d)}return t},E}),define("Core/PolylineVolumeGeometryLibrary",["./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./CornerType","./EllipsoidTangentPlane","./Math","./Matrix3","./Matrix4","./PolylinePipeline","./Quaternion","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function d(e,t){for(var n=new Array(e.length),r=0;r<e.length;r++){var a=e[r];D=t.cartesianToCartographic(a,D),n[r]=D.height,e[r]=t.scaleToGeodeticSurface(a,a)}return n}function h(e,n,r,a){var i,o=e[0],u=e[1],s=t.angleBetween(o,u),c=Math.ceil(s/a),l=new Array(c);if(n===r){for(i=0;i<c;i++)l[i]=n;return l.push(r),l}var f=r-n,d=f/c;for(i=1;i<c;i++){var h=n+i*d;l[i]=h}return l[0]=n,l.push(r),l}function E(n,r,a,o){var u=new i(a,o),s=u.projectPointOntoPlane(t.add(a,n,Y),Y),c=u.projectPointOntoPlane(t.add(a,r,k),k),l=e.angleBetween(s,c);return c.x*s.y-c.y*s.x>=0?-l:l}function m(e,n,r,a,i,o,c,l){var d=b,h=G;L=f.eastNorthUpToFixedFrame(e,i,L),d=s.multiplyByPointAsVector(L,U,d),d=t.normalize(d,d);var m=E(d,n,e,i);z=u.fromRotationZ(m,z),q.z=o,L=s.multiplyTransformation(L,s.fromRotationTranslation(z,q,F),L);var p=B;p[0]=c;for(var y=0;y<l;y++)for(var _=0;_<r.length;_+=3)h=t.fromArray(r,_,h),h=u.multiplyByVector(p,h,h),h=s.multiplyByPoint(L,h,h),a.push(h.x,h.y,h.z);return a}function p(e,n,r,a,i,o,u){for(var s=0;s<e.length;s+=3){var c=t.fromArray(e,s,W);a=m(c,n,r,a,i,o[s/3],u,1)}return a}function y(e,t){var n=e.length,r=new Array(6*n),a=0,i=t.x+t.width/2,o=t.y+t.height/2,u=e[0];r[a++]=u.x-i,r[a++]=0,r[a++]=u.y-o;for(var s=1;s<n;s++){u=e[s];var c=u.x-i,l=u.y-o;r[a++]=c,r[a++]=0,r[a++]=l,r[a++]=c,r[a++]=0,r[a++]=l}return u=e[0],r[a++]=u.x-i,r[a++]=0,r[a++]=u.y-o,r}function _(e,t){for(var n=e.length,r=new Array(3*n),a=0,i=t.x+t.width/2,o=t.y+t.height/2,u=0;u<n;u++)r[a++]=e[u].x-i,r[a++]=0,r[a++]=e[u].y-o;return r}function T(e,n,r,i,s,c,f,d,h,E){var p,y=t.angleBetween(t.subtract(n,e,x),t.subtract(r,e,C)),_=i===a.BEVELED?0:Math.ceil(y/o.toRadians(5));p=s?u.fromQuaternion(l.fromAxisAngle(t.negate(e,x),y/(_+1),V),H):u.fromQuaternion(l.fromAxisAngle(e,y/(_+1),V),H);var T,R;if(n=t.clone(n,X),_>0)for(var A=E?2:1,v=0;v<_;v++)n=u.multiplyByVector(p,n,n),T=t.subtract(n,e,x),T=t.normalize(T,T),s||(T=t.negate(T,T)),R=c.scaleToGeodeticSurface(n,C),f=m(R,T,d,f,c,h,1,A);else T=t.subtract(n,e,x),T=t.normalize(T,T),s||(T=t.negate(T,T)),R=c.scaleToGeodeticSurface(n,C),f=m(R,T,d,f,c,h,1,1),r=t.clone(r,X),T=t.subtract(r,e,x),T=t.normalize(T,T),s||(T=t.negate(T,T)),R=c.scaleToGeodeticSurface(r,C),f=m(R,T,d,f,c,h,1,1);return f}var R=[new t,new t],A=new t,v=new t,S=new t,g=new t,N=new t,O=new t,I=new t,M=new t,w=new t,x=new t,C=new t,P={},D=new r,U=new t(-1,0,0),L=new s,F=new s,z=new u,B=u.IDENTITY.clone(),b=new t,G=new n,q=new t,W=new t,V=new l,X=new t,H=new u;P.removeDuplicatesFromShape=function(t){for(var n=t.length,r=[],a=n-1,i=0;i<n;a=i++){var o=t[a],u=t[i];e.equals(o,u)||r.push(u)}return r};var Y=new t,k=new t;P.angleIsGreaterThanPi=function(e,n,r,a){var o=new i(r,a),u=o.projectPointOntoPlane(t.add(r,e,Y),Y),s=o.projectPointOntoPlane(t.add(r,n,k),k);return s.x*u.y-s.y*u.x>=0};var Z=new t,j=new t;return P.computePositions=function(e,n,r,i,u){var s=i._ellipsoid,l=d(e,s),f=i._granularity,E=i._cornerType,C=u?y(n,r):_(n,r),D=u?_(n,r):void 0,U=r.height/2,L=r.width/2,F=e.length,z=[],B=u?[]:void 0,b=A,G=v,q=S,W=g,V=N,X=O,H=I,Y=M,k=w,K=e[0],J=e[1];W=s.geodeticSurfaceNormal(K,W),b=t.subtract(J,K,b),b=t.normalize(b,b),Y=t.cross(W,b,Y),Y=t.normalize(Y,Y);var Q=l[0],$=l[1];u&&(B=m(K,Y,D,B,s,Q+U,1,1)),k=t.clone(K,k),K=J,G=t.negate(b,G);for(var ee,te,ne=1;ne<F-1;ne++){var re=u?2:1;J=e[ne+1],b=t.subtract(J,K,b),b=t.normalize(b,b),q=t.add(b,G,q),q=t.normalize(q,q),W=s.geodeticSurfaceNormal(K,W);var ae=t.multiplyByScalar(W,t.dot(b,W),Z);t.subtract(b,ae,ae),t.normalize(ae,ae);var ie=t.multiplyByScalar(W,t.dot(G,W),j);t.subtract(G,ie,ie),t.normalize(ie,ie);var oe=!o.equalsEpsilon(Math.abs(t.dot(ae,ie)),1,o.EPSILON7);if(oe){q=t.cross(q,W,q),q=t.cross(W,q,q),q=t.normalize(q,q);var ue=1/Math.max(.25,t.magnitude(t.cross(q,G,x))),se=P.angleIsGreaterThanPi(b,G,K,s);se?(V=t.add(K,t.multiplyByScalar(q,ue*L,q),V),X=t.add(V,t.multiplyByScalar(Y,L,X),X),R[0]=t.clone(k,R[0]),R[1]=t.clone(X,R[1]),ee=h(R,Q+U,$+U,f),te=c.generateArc({positions:R,granularity:f,ellipsoid:s}),z=p(te,Y,C,z,s,ee,1),Y=t.cross(W,b,Y),Y=t.normalize(Y,Y),H=t.add(V,t.multiplyByScalar(Y,L,H),H),E===a.ROUNDED||E===a.BEVELED?T(V,X,H,E,se,s,z,C,$+U,u):(q=t.negate(q,q),z=m(K,q,C,z,s,$+U,ue,re)),k=t.clone(H,k)):(V=t.add(K,t.multiplyByScalar(q,ue*L,q),V),X=t.add(V,t.multiplyByScalar(Y,-L,X),X),R[0]=t.clone(k,R[0]),R[1]=t.clone(X,R[1]),ee=h(R,Q+U,$+U,f),te=c.generateArc({positions:R,granularity:f,ellipsoid:s}),z=p(te,Y,C,z,s,ee,1),Y=t.cross(W,b,Y),Y=t.normalize(Y,Y),H=t.add(V,t.multiplyByScalar(Y,-L,H),H),E===a.ROUNDED||E===a.BEVELED?T(V,X,H,E,se,s,z,C,$+U,u):z=m(K,q,C,z,s,$+U,ue,re),k=t.clone(H,k)),G=t.negate(b,G)}else z=m(k,Y,C,z,s,Q+U,1,1),k=K;Q=$,$=l[ne+1],K=J}R[0]=t.clone(k,R[0]),R[1]=t.clone(K,R[1]),ee=h(R,Q+U,$+U,f),te=c.generateArc({positions:R,granularity:f,ellipsoid:s}),z=p(te,Y,C,z,s,ee,1),u&&(B=m(K,Y,D,B,s,$+U,1,1)),F=z.length;var ce=u?F+B.length:F,le=new Float64Array(ce);return le.set(z),u&&le.set(B,F),le},P}),define("Core/CorridorGeometryLibrary",["./Cartesian3","./CornerType","./defined","./Math","./Matrix3","./PolylinePipeline","./PolylineVolumeGeometryLibrary","./Quaternion"],function(e,t,n,r,a,i,o,u){"use strict";function s(n,i,o,s,c){var l=e.angleBetween(e.subtract(i,n,E),e.subtract(o,n,m)),f=s===t.BEVELED?1:Math.ceil(l/r.toRadians(5))+1,d=3*f,h=new Array(d);h[d-3]=o.x,h[d-2]=o.y,h[d-1]=o.z;var p;p=c?a.fromQuaternion(u.fromAxisAngle(e.negate(n,E),l/f,w),x):a.fromQuaternion(u.fromAxisAngle(n,l/f,w),x);var y=0;i=e.clone(i,E);for(var _=0;_<f;_++)i=a.multiplyByVector(p,i,i),h[y++]=i.x,h[y++]=i.y,h[y++]=i.z;return h}function c(n){var r=T,a=R,i=A,o=n[1];a=e.fromArray(n[1],o.length-3,a),i=e.fromArray(n[0],0,i),r=e.multiplyByScalar(e.add(a,i,r),.5,r);var u=s(r,a,i,t.ROUNDED,!1),c=n.length-1,l=n[c-1];o=n[c],a=e.fromArray(l,l.length-3,a),i=e.fromArray(o,0,i),r=e.multiplyByScalar(e.add(a,i,r),.5,r);var f=s(r,a,i,t.ROUNDED,!1);return[u,f]}function l(t,n,r,a){var i=E;return a?i=e.add(t,n,i):(n=e.negate(n,n),i=e.add(t,n,i)),[i.x,i.y,i.z,r.x,r.y,r.z]}function f(t,n,r,a){for(var i=new Array(t.length),o=new Array(t.length),u=e.multiplyByScalar(n,r,E),s=e.negate(u,m),c=0,l=t.length-1,f=0;f<t.length;f+=3){var d=e.fromArray(t,f,p),h=e.add(d,s,y);i[c++]=h.x,i[c++]=h.y,i[c++]=h.z;var _=e.add(d,u,y);o[l--]=_.z,o[l--]=_.y,o[l--]=_.x}return a.push(i,o),a}function d(e,t){for(var n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}var h={},E=new e,m=new e,p=new e,y=new e,_=[new e,new e],T=new e,R=new e,A=new e,v=new e,S=new e,g=new e,N=new e,O=new e,I=new e,M=new e,w=new u,x=new a;h.addAttribute=function(e,t,r,a){var i=t.x,o=t.y,u=t.z;n(r)&&(e[r]=i,e[r+1]=o,e[r+2]=u),n(a)&&(e[a]=u,e[a-1]=o,e[a-2]=i)};var C=new e,P=new e;return h.computePositions=function(n){var a=n.granularity,u=n.positions,h=n.ellipsoid;u=d(u,h);var m=n.width/2,p=n.cornerType,y=n.saveAttributes,w=T,x=R,D=A,U=v,L=S,F=g,z=N,B=O,b=I,G=M,q=[],W=y?[]:void 0,V=y?[]:void 0,X=u[0],H=u[1];x=e.normalize(e.subtract(H,X,x),x),w=h.geodeticSurfaceNormal(X,w),U=e.normalize(e.cross(w,x,U),U),y&&(W.push(U.x,U.y,U.z),V.push(w.x,w.y,w.z)),z=e.clone(X,z),X=H,D=e.negate(x,D);var Y,k,Z=[],j=u.length;for(k=1;k<j-1;k++){w=h.geodeticSurfaceNormal(X,w),H=u[k+1],x=e.normalize(e.subtract(H,X,x),x),L=e.normalize(e.add(x,D,L),L);var K=e.multiplyByScalar(w,e.dot(x,w),C);e.subtract(x,K,K),e.normalize(K,K);var J=e.multiplyByScalar(w,e.dot(D,w),P);e.subtract(D,J,J),e.normalize(J,J);var Q=!r.equalsEpsilon(Math.abs(e.dot(K,J)),1,r.EPSILON7);if(Q){L=e.cross(L,w,L),L=e.cross(w,L,L),L=e.normalize(L,L); +var $=m/Math.max(.25,e.magnitude(e.cross(L,D,E))),ee=o.angleIsGreaterThanPi(x,D,X,h);L=e.multiplyByScalar(L,$,L),ee?(B=e.add(X,L,B),G=e.add(B,e.multiplyByScalar(U,m,G),G),b=e.add(B,e.multiplyByScalar(U,2*m,b),b),_[0]=e.clone(z,_[0]),_[1]=e.clone(G,_[1]),Y=i.generateArc({positions:_,granularity:a,ellipsoid:h}),q=f(Y,U,m,q),y&&(W.push(U.x,U.y,U.z),V.push(w.x,w.y,w.z)),F=e.clone(b,F),U=e.normalize(e.cross(w,x,U),U),b=e.add(B,e.multiplyByScalar(U,2*m,b),b),z=e.add(B,e.multiplyByScalar(U,m,z),z),p===t.ROUNDED||p===t.BEVELED?Z.push({leftPositions:s(B,F,b,p,ee)}):Z.push({leftPositions:l(X,e.negate(L,L),b,ee)})):(b=e.add(X,L,b),G=e.add(b,e.negate(e.multiplyByScalar(U,m,G),G),G),B=e.add(b,e.negate(e.multiplyByScalar(U,2*m,B),B),B),_[0]=e.clone(z,_[0]),_[1]=e.clone(G,_[1]),Y=i.generateArc({positions:_,granularity:a,ellipsoid:h}),q=f(Y,U,m,q),y&&(W.push(U.x,U.y,U.z),V.push(w.x,w.y,w.z)),F=e.clone(B,F),U=e.normalize(e.cross(w,x,U),U),B=e.add(b,e.negate(e.multiplyByScalar(U,2*m,B),B),B),z=e.add(b,e.negate(e.multiplyByScalar(U,m,z),z),z),p===t.ROUNDED||p===t.BEVELED?Z.push({rightPositions:s(b,F,B,p,ee)}):Z.push({rightPositions:l(X,L,B,ee)})),D=e.negate(x,D)}X=H}w=h.geodeticSurfaceNormal(X,w),_[0]=e.clone(z,_[0]),_[1]=e.clone(X,_[1]),Y=i.generateArc({positions:_,granularity:a,ellipsoid:h}),q=f(Y,U,m,q),y&&(W.push(U.x,U.y,U.z),V.push(w.x,w.y,w.z));var te;return p===t.ROUNDED&&(te=c(q)),{positions:q,corners:Z,lefts:W,normals:V,endPositions:te}},h}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===n.POINTS||e===n.LINES||e===n.LINE_LOOP||e===n.LINE_STRIP||e===n.TRIANGLES||e===n.TRIANGLE_STRIP||e===n.TRIANGLE_FAN}};return e(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,a){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,a.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return i.computeNumberOfVertices=function(e){var n=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var a=e.attributes[r],i=a.values.length/a.componentsPerAttribute;n=i}return n},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(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 r}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,n,r,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(e){switch(e){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(t){return e(t)&&(t===i.UNSIGNED_BYTE||t===i.UNSIGNED_SHORT||t===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,n,a){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,a):new Uint16Array(t,n,a)},n(i)}),define("ThirdParty/earcut-2.1.1",[],function(){"use strict";function e(e,n,a){a=a||2;var i=n&&n.length,o=i?n[0]*a:e.length,u=t(e,0,o,a,!0),c=[];if(!u)return c;var l,f,d,h,E,m,p;if(i&&(u=s(e,n,u,a)),e.length>80*a){l=d=e[0],f=h=e[1];for(var y=a;y<o;y+=a)E=e[y],m=e[y+1],E<l&&(l=E),m<f&&(f=m),E>d&&(d=E),m>h&&(h=m);p=Math.max(d-l,h-f)}return r(u,c,a,l,f,p),c}function t(e,t,n,r,a){var i,o;if(a===M(e,t,n,r)>0)for(i=t;i<n;i+=r)o=N(i,e[i],e[i+1],o);else for(i=n-r;i>=t;i-=r)o=N(i,e[i],e[i+1],o);return o&&T(o,o.next)&&(O(o),o=o.next),o}function n(e,t){if(!e)return e;t||(t=e);var n,r=e;do if(n=!1,r.steiner||!T(r,r.next)&&0!==_(r.prev,r,r.next))r=r.next;else{if(O(r),r=t=r.prev,r===r.next)return null;n=!0}while(n||r!==t);return t}function r(e,t,s,c,l,f,h){if(e){!h&&f&&d(e,c,l,f);for(var E,m,p=e;e.prev!==e.next;)if(E=e.prev,m=e.next,f?i(e,c,l,f):a(e))t.push(E.i/s),t.push(e.i/s),t.push(m.i/s),O(e),e=m.next,p=m.next;else if(e=m,e===p){h?1===h?(e=o(e,t,s),r(e,t,s,c,l,f,2)):2===h&&u(e,t,s,c,l,f):r(n(e),t,s,c,l,f,1);break}}}function a(e){var t=e.prev,n=e,r=e.next;if(_(t,n,r)>=0)return!1;for(var a=e.next.next;a!==e.prev;){if(p(t.x,t.y,n.x,n.y,r.x,r.y,a.x,a.y)&&_(a.prev,a,a.next)>=0)return!1;a=a.next}return!0}function i(e,t,n,r){var a=e.prev,i=e,o=e.next;if(_(a,i,o)>=0)return!1;for(var u=a.x<i.x?a.x<o.x?a.x:o.x:i.x<o.x?i.x:o.x,s=a.y<i.y?a.y<o.y?a.y:o.y:i.y<o.y?i.y:o.y,c=a.x>i.x?a.x>o.x?a.x:o.x:i.x>o.x?i.x:o.x,l=a.y>i.y?a.y>o.y?a.y:o.y:i.y>o.y?i.y:o.y,f=E(u,s,t,n,r),d=E(c,l,t,n,r),h=e.nextZ;h&&h.z<=d;){if(h!==e.prev&&h!==e.next&&p(a.x,a.y,i.x,i.y,o.x,o.y,h.x,h.y)&&_(h.prev,h,h.next)>=0)return!1;h=h.nextZ}for(h=e.prevZ;h&&h.z>=f;){if(h!==e.prev&&h!==e.next&&p(a.x,a.y,i.x,i.y,o.x,o.y,h.x,h.y)&&_(h.prev,h,h.next)>=0)return!1;h=h.prevZ}return!0}function o(e,t,n){var r=e;do{var a=r.prev,i=r.next.next;!T(a,i)&&R(a,r,r.next,i)&&v(a,i)&&v(i,a)&&(t.push(a.i/n),t.push(r.i/n),t.push(i.i/n),O(r),O(r.next),r=e=i),r=r.next}while(r!==e);return r}function u(e,t,a,i,o,u){var s=e;do{for(var c=s.next.next;c!==s.prev;){if(s.i!==c.i&&y(s,c)){var l=g(s,c);return s=n(s,s.next),l=n(l,l.next),r(s,t,a,i,o,u),void r(l,t,a,i,o,u)}c=c.next}s=s.next}while(s!==e)}function s(e,r,a,i){var o,u,s,f,d,h=[];for(o=0,u=r.length;o<u;o++)s=r[o]*i,f=o<u-1?r[o+1]*i:e.length,d=t(e,s,f,i,!1),d===d.next&&(d.steiner=!0),h.push(m(d));for(h.sort(c),o=0;o<h.length;o++)l(h[o],a),a=n(a,a.next);return a}function c(e,t){return e.x-t.x}function l(e,t){if(t=f(e,t)){var r=g(t,e);n(r,r.next)}}function f(e,t){var n,r=t,a=e.x,i=e.y,o=-(1/0);do{if(i<=r.y&&i>=r.next.y){var u=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(u<=a&&u>o){if(o=u,u===a){if(i===r.y)return r;if(i===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(a===o)return n.prev;var s,c=n,l=n.x,f=n.y,d=1/0;for(r=n.next;r!==c;)a>=r.x&&r.x>=l&&p(i<f?a:o,i,l,f,i<f?o:a,i,r.x,r.y)&&(s=Math.abs(i-r.y)/(a-r.x),(s<d||s===d&&r.x>n.x)&&v(r,e)&&(n=r,d=s)),r=r.next;return n}function d(e,t,n,r){var a=e;do null===a.z&&(a.z=E(a.x,a.y,t,n,r)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next;while(a!==e);a.prevZ.nextZ=null,a.prevZ=null,h(a)}function h(e){var t,n,r,a,i,o,u,s,c=1;do{for(n=e,e=null,i=null,o=0;n;){for(o++,r=n,u=0,t=0;t<c&&(u++,r=r.nextZ,r);t++);for(s=c;u>0||s>0&&r;)0===u?(a=r,r=r.nextZ,s--):0!==s&&r?n.z<=r.z?(a=n,n=n.nextZ,u--):(a=r,r=r.nextZ,s--):(a=n,n=n.nextZ,u--),i?i.nextZ=a:e=a,a.prevZ=i,i=a;n=r}i.nextZ=null,c*=2}while(o>1);return e}function E(e,t,n,r,a){return e=32767*(e-n)/a,t=32767*(t-r)/a,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function m(e){var t=e,n=e;do t.x<n.x&&(n=t),t=t.next;while(t!==e);return n}function p(e,t,n,r,a,i,o,u){return(a-o)*(t-u)-(e-o)*(i-u)>=0&&(e-o)*(r-u)-(n-o)*(t-u)>=0&&(n-o)*(i-u)-(a-o)*(r-u)>=0}function y(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!A(e,t)&&v(e,t)&&v(t,e)&&S(e,t)}function _(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function T(e,t){return e.x===t.x&&e.y===t.y}function R(e,t,n,r){return!!(T(e,t)&&T(n,r)||T(e,r)&&T(n,t))||_(e,t,n)>0!=_(e,t,r)>0&&_(n,r,e)>0!=_(n,r,t)>0}function A(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&R(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function v(e,t){return _(e.prev,e,e.next)<0?_(e,t,e.next)>=0&&_(e,e.prev,t)>=0:_(e,t,e.prev)<0||_(e,e.next,t)<0}function S(e,t){var n=e,r=!1,a=(e.x+t.x)/2,i=(e.y+t.y)/2;do n.y>i!=n.next.y>i&&a<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function g(e,t){var n=new I(e.i,e.x,e.y),r=new I(t.i,t.x,t.y),a=e.next,i=t.prev;return e.next=t,t.prev=e,n.next=a,a.prev=n,r.next=n,n.prev=r,i.next=r,r.prev=i,r}function N(e,t,n,r){var a=new I(e,t,n);return r?(a.next=r.next,a.prev=r,r.next.prev=a,r.next=a):(a.prev=a,a.next=a),a}function O(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function I(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function M(e,t,n,r){for(var a=0,i=t,o=n-r;i<n;i+=r)a+=(e[o]-e[i])*(e[i+1]+e[o+1]),o=i;return a}return e.deviation=function(e,t,n,r){var a=t&&t.length,i=a?t[0]*n:e.length,o=Math.abs(M(e,0,i,n));if(a)for(var u=0,s=t.length;u<s;u++){var c=t[u]*n,l=u<s-1?t[u+1]*n:e.length;o-=Math.abs(M(e,c,l,n))}var f=0;for(u=0;u<r.length;u+=3){var d=r[u]*n,h=r[u+1]*n,E=r[u+2]*n;f+=Math.abs((e[d]-e[E])*(e[h+1]-e[d+1])-(e[d]-e[h])*(e[E+1]-e[d+1]))}return 0===o&&0===f?0:Math.abs((f-o)/o)},e.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,a=0;a<e.length;a++){for(var i=0;i<e[a].length;i++)for(var o=0;o<t;o++)n.vertices.push(e[a][i][o]);a>0&&(r+=e[a-1].length,n.holes.push(r))}return n},e}),define("Core/WindingOrder",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={CLOCKWISE:t.CW,COUNTER_CLOCKWISE:t.CCW,validate:function(e){return e===n.CLOCKWISE||e===n.COUNTER_CLOCKWISE}};return e(n)}),define("Core/PolygonPipeline",["../ThirdParty/earcut-2.1.1","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./Math","./PrimitiveType","./WindingOrder"],function(e,t,n,r,a,i,o,u,s,c,l,f,d){"use strict";var h=new n,E=new n,m={};m.computeArea2D=function(e){for(var t=e.length,n=0,r=t-1,a=0;a<t;r=a++){var i=e[r],o=e[a];n+=i.x*o.y-o.x*i.y}return.5*n},m.computeWindingOrder2D=function(e){var t=m.computeArea2D(e);return t>0?d.COUNTER_CLOCKWISE:d.CLOCKWISE},m.triangulate=function(n,r){var a=t.packArray(n);return e(a,r,2)};var p=new n,y=new n,_=new n,T=new n,R=new n,A=new n,v=new n;return m.computeSubdivision=function(e,t,o,u){u=a(u,l.RADIANS_PER_DEGREE);var d,h=o.slice(0),E=t.length,m=new Array(3*E),S=0;for(d=0;d<E;d++){var g=t[d];m[S++]=g.x,m[S++]=g.y,m[S++]=g.z}for(var N=[],O={},I=e.maximumRadius,M=l.chordLength(u,I),w=M*M;h.length>0;){var x,C,P=h.pop(),D=h.pop(),U=h.pop(),L=n.fromArray(m,3*U,p),F=n.fromArray(m,3*D,y),z=n.fromArray(m,3*P,_),B=n.multiplyByScalar(n.normalize(L,T),I,T),b=n.multiplyByScalar(n.normalize(F,R),I,R),G=n.multiplyByScalar(n.normalize(z,A),I,A),q=n.magnitudeSquared(n.subtract(B,b,v)),W=n.magnitudeSquared(n.subtract(b,G,v)),V=n.magnitudeSquared(n.subtract(G,B,v)),X=Math.max(q,W,V);X>w?q===X?(x=Math.min(U,D)+" "+Math.max(U,D),d=O[x],i(d)||(C=n.add(L,F,v),n.multiplyByScalar(C,.5,C),m.push(C.x,C.y,C.z),d=m.length/3-1,O[x]=d),h.push(U,d,P),h.push(d,D,P)):W===X?(x=Math.min(D,P)+" "+Math.max(D,P),d=O[x],i(d)||(C=n.add(F,z,v),n.multiplyByScalar(C,.5,C),m.push(C.x,C.y,C.z),d=m.length/3-1,O[x]=d),h.push(D,d,U),h.push(d,P,U)):V===X&&(x=Math.min(P,U)+" "+Math.max(P,U),d=O[x],i(d)||(C=n.add(z,L,v),n.multiplyByScalar(C,.5,C),m.push(C.x,C.y,C.z),d=m.length/3-1,O[x]=d),h.push(P,d,D),h.push(d,U,D)):(N.push(U),N.push(D),N.push(P))}return new s({attributes:{position:new c({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:m})},indices:N,primitiveType:f.TRIANGLES})},m.scaleToGeodeticHeight=function(e,t,r,o){r=a(r,u.WGS84);var s=h,c=E;if(t=a(t,0),o=a(o,!0),i(e))for(var l=e.length,f=0;f<l;f+=3)n.fromArray(e,f,c),o&&(c=r.scaleToGeodeticSurface(c,c)),0!==t&&(s=r.geodeticSurfaceNormal(c,s),n.multiplyByScalar(s,t,s),n.add(c,s,c)),e[f]=c.x,e[f+1]=c.y,e[f+2]=c.z;return e},m}),define("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.position=e(t.position,!1),this.normal=e(t.normal,!1),this.st=e(t.st,!1),this.bitangent=e(t.bitangent,!1),this.tangent=e(t.tangent,!1),this.color=e(t.color,!1)}return a.POSITION_ONLY=r(new a({position:!0})),a.POSITION_AND_NORMAL=r(new a({position:!0,normal:!0})),a.POSITION_NORMAL_AND_ST=r(new a({position:!0,normal:!0,st:!0})),a.POSITION_AND_ST=r(new a({position:!0,st:!0})),a.POSITION_AND_COLOR=r(new a({position:!0,color:!0})),a.ALL=r(new a({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0})),a.DEFAULT=a.POSITION_NORMAL_AND_ST,a.packedLength=6,a.pack=function(t,n,r){return r=e(r,0),n[r++]=t.position?1:0,n[r++]=t.normal?1:0,n[r++]=t.st?1:0,n[r++]=t.tangent?1:0,n[r++]=t.bitangent?1:0,n[r++]=t.color?1:0,n},a.unpack=function(n,r,i){return r=e(r,0),t(i)||(i=new a),i.position=1===n[r++],i.normal=1===n[r++],i.st=1===n[r++],i.tangent=1===n[r++],i.bitangent=1===n[r++],i.color=1===n[r++],i},a.clone=function(e,n){if(t(e))return t(n)||(n=new a),n.position=e.position,n.normal=e.normal,n.st=e.st,n.tangent=e.tangent,n.bitangent=e.bitangent,n.color=e.color,n},a}),define("Core/CorridorGeometry",["./arrayRemoveDuplicates","./BoundingSphere","./Cartesian3","./Cartographic","./ComponentDatatype","./CornerType","./CorridorGeometryLibrary","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolygonPipeline","./PrimitiveType","./Rectangle","./VertexFormat"],function(e,t,n,r,a,i,o,u,s,c,l,f,d,h,E,m,p,y,_,T,R){"use strict";function A(e,t,r,a,i,u){var s=e.normals,c=e.tangents,l=e.bitangents,f=n.normalize(n.cross(r,t,L),L);u.normal&&o.addAttribute(s,t,a,i),u.tangent&&o.addAttribute(c,f,a,i),u.bitangent&&o.addAttribute(l,r,a,i)}function v(e,t,r){var i,u,c,l=e.positions,f=e.corners,d=e.endPositions,y=e.lefts,_=e.normals,T=new E,R=0,v=0,S=0;for(u=0;u<l.length;u+=2)c=l[u].length-3,R+=c,S+=2*c,v+=l[u+1].length-3;for(R+=3,v+=3,u=0;u<f.length;u++){i=f[u];var g=f[u].leftPositions;s(g)?(c=g.length,R+=c,S+=c):(c=f[u].rightPositions.length,v+=c,S+=c)}var N,O=s(d);O&&(N=d[0].length-3,R+=N,v+=N,N/=3,S+=6*N);var I,M,D,z,B,b,G=R+v,q=new Float64Array(G),W=t.normal?new Float32Array(G):void 0,V=t.tangent?new Float32Array(G):void 0,X=t.bitangent?new Float32Array(G):void 0,H={normals:W,tangents:V,bitangents:X},Y=0,k=G-1,Z=w,j=x,K=N/2,J=m.createTypedArray(G/3,S),Q=0;if(O){b=C,B=P;var $=d[0];for(Z=n.fromArray(_,0,Z),j=n.fromArray(y,0,j),u=0;u<K;u++)b=n.fromArray($,3*(K-1-u),b),B=n.fromArray($,3*(K+u),B),o.addAttribute(q,B,Y),o.addAttribute(q,b,void 0,k),A(H,Z,j,Y,k,t),M=Y/3,z=M+1,I=(k-2)/3,D=I-1,J[Q++]=I,J[Q++]=M,J[Q++]=D,J[Q++]=D,J[Q++]=M,J[Q++]=z,Y+=3,k-=3}var ee=0,te=0,ne=l[ee++],re=l[ee++];q.set(ne,Y),q.set(re,k-re.length+1),j=n.fromArray(y,te,j);var ae,ie;for(c=re.length-3,u=0;u<c;u+=3)ae=r.geodeticSurfaceNormal(n.fromArray(ne,u,L),L),ie=r.geodeticSurfaceNormal(n.fromArray(re,c-u,F),F),Z=n.normalize(n.add(ae,ie,Z),Z),A(H,Z,j,Y,k,t),M=Y/3,z=M+1,I=(k-2)/3,D=I-1,J[Q++]=I,J[Q++]=M,J[Q++]=D,J[Q++]=D,J[Q++]=M,J[Q++]=z,Y+=3,k-=3;for(ae=r.geodeticSurfaceNormal(n.fromArray(ne,c,L),L),ie=r.geodeticSurfaceNormal(n.fromArray(re,c,F),F),Z=n.normalize(n.add(ae,ie,Z),Z),te+=3,u=0;u<f.length;u++){var oe;i=f[u];var ue,se,ce=i.leftPositions,le=i.rightPositions,fe=U,de=C,he=P;if(Z=n.fromArray(_,te,Z),s(ce)){for(A(H,Z,j,void 0,k,t),k-=3,ue=z,se=D,oe=0;oe<ce.length/3;oe++)fe=n.fromArray(ce,3*oe,fe),J[Q++]=ue,J[Q++]=se-oe-1,J[Q++]=se-oe,o.addAttribute(q,fe,void 0,k),de=n.fromArray(q,3*(se-oe-1),de),he=n.fromArray(q,3*ue,he),j=n.normalize(n.subtract(de,he,j),j),A(H,Z,j,void 0,k,t),k-=3;fe=n.fromArray(q,3*ue,fe),de=n.subtract(n.fromArray(q,3*se,de),fe,de),he=n.subtract(n.fromArray(q,3*(se-oe),he),fe,he),j=n.normalize(n.add(de,he,j),j),A(H,Z,j,Y,void 0,t),Y+=3}else{for(A(H,Z,j,Y,void 0,t),Y+=3,ue=D,se=z,oe=0;oe<le.length/3;oe++)fe=n.fromArray(le,3*oe,fe),J[Q++]=ue,J[Q++]=se+oe,J[Q++]=se+oe+1,o.addAttribute(q,fe,Y),de=n.fromArray(q,3*ue,de),he=n.fromArray(q,3*(se+oe),he),j=n.normalize(n.subtract(de,he,j),j),A(H,Z,j,Y,void 0,t),Y+=3;fe=n.fromArray(q,3*ue,fe),de=n.subtract(n.fromArray(q,3*(se+oe),de),fe,de),he=n.subtract(n.fromArray(q,3*se,he),fe,he),j=n.normalize(n.negate(n.add(he,de,j),j),j),A(H,Z,j,void 0,k,t),k-=3}for(ne=l[ee++],re=l[ee++],ne.splice(0,3),re.splice(re.length-3,3),q.set(ne,Y),q.set(re,k-re.length+1),c=re.length-3,te+=3,j=n.fromArray(y,te,j),oe=0;oe<re.length;oe+=3)ae=r.geodeticSurfaceNormal(n.fromArray(ne,oe,L),L),ie=r.geodeticSurfaceNormal(n.fromArray(re,c-oe,F),F),Z=n.normalize(n.add(ae,ie,Z),Z),A(H,Z,j,Y,k,t),z=Y/3,M=z-1,D=(k-2)/3,I=D+1,J[Q++]=I,J[Q++]=M,J[Q++]=D,J[Q++]=D,J[Q++]=M,J[Q++]=z,Y+=3,k-=3;Y-=3,k+=3}if(Z=n.fromArray(_,_.length-3,Z),A(H,Z,j,Y,k,t),O){Y+=3,k-=3,b=C,B=P;var Ee=d[1];for(u=0;u<K;u++)b=n.fromArray(Ee,3*(N-u-1),b),B=n.fromArray(Ee,3*u,B),o.addAttribute(q,b,void 0,k),o.addAttribute(q,B,Y),A(H,Z,j,Y,k,t),z=Y/3,M=z-1,D=(k-2)/3,I=D+1,J[Q++]=I,J[Q++]=M,J[Q++]=D,J[Q++]=D,J[Q++]=M,J[Q++]=z,Y+=3,k-=3}if(T.position=new h({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:q}),t.st){var me,pe,ye=new Float32Array(G/3*2),_e=0;if(O){R/=3,v/=3;var Te=Math.PI/(N+1);pe=1/(R-N+1),me=1/(v-N+1);var Re,Ae=N/2;for(u=Ae+1;u<N+1;u++)Re=p.PI_OVER_TWO+Te*u,ye[_e++]=me*(1+Math.cos(Re)),ye[_e++]=.5*(1+Math.sin(Re));for(u=1;u<v-N+1;u++)ye[_e++]=u*me,ye[_e++]=0;for(u=N;u>Ae;u--)Re=p.PI_OVER_TWO-u*Te,ye[_e++]=1-me*(1+Math.cos(Re)),ye[_e++]=.5*(1+Math.sin(Re));for(u=Ae;u>0;u--)Re=p.PI_OVER_TWO-Te*u,ye[_e++]=1-pe*(1+Math.cos(Re)),ye[_e++]=.5*(1+Math.sin(Re));for(u=R-N;u>0;u--)ye[_e++]=u*pe,ye[_e++]=1;for(u=1;u<Ae+1;u++)Re=p.PI_OVER_TWO+Te*u,ye[_e++]=pe*(1+Math.cos(Re)),ye[_e++]=.5*(1+Math.sin(Re))}else{for(R/=3,v/=3,pe=1/(R-1),me=1/(v-1),u=0;u<v;u++)ye[_e++]=u*me,ye[_e++]=0;for(u=R;u>0;u--)ye[_e++]=(u-1)*pe,ye[_e++]=1}T.st=new h({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:ye})}return t.normal&&(T.normal=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:H.normals})),t.tangent&&(T.tangent=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:H.tangents})),t.bitangent&&(T.bitangent=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:H.bitangents})),{attributes:T,indices:J}}function S(e,t){if(!(t.normal||t.tangent||t.bitangent||t.st))return e;var r,a,i=e.position.values;(t.normal||t.bitangent)&&(r=e.normal.values,a=e.bitangent.values);var u,s=e.position.values.length/18,c=3*s,l=2*s,f=2*c;if(t.normal||t.bitangent||t.tangent){var d=t.normal?new Float32Array(6*c):void 0,h=t.tangent?new Float32Array(6*c):void 0,E=t.bitangent?new Float32Array(6*c):void 0,m=w,p=x,y=C,_=P,T=D,R=U,A=f;for(u=0;u<c;u+=3){var v=A+f;m=n.fromArray(i,u,m),p=n.fromArray(i,u+c,p),y=n.fromArray(i,(u+3)%c,y),p=n.subtract(p,m,p),y=n.subtract(y,m,y),_=n.normalize(n.cross(p,y,_),_),t.normal&&(o.addAttribute(d,_,v),o.addAttribute(d,_,v+3),o.addAttribute(d,_,A),o.addAttribute(d,_,A+3)),(t.tangent||t.bitangent)&&(R=n.fromArray(r,u,R),t.bitangent&&(o.addAttribute(E,R,v),o.addAttribute(E,R,v+3),o.addAttribute(E,R,A),o.addAttribute(E,R,A+3)),t.tangent&&(T=n.normalize(n.cross(R,_,T),T),o.addAttribute(h,T,v),o.addAttribute(h,T,v+3),o.addAttribute(h,T,A),o.addAttribute(h,T,A+3))),A+=6}if(t.normal){for(d.set(r),u=0;u<c;u+=3)d[u+c]=-r[u],d[u+c+1]=-r[u+1],d[u+c+2]=-r[u+2];e.normal.values=d}else e.normal=void 0;if(t.bitangent?(E.set(a),E.set(a,c),e.bitangent.values=E):e.bitangent=void 0,t.tangent){var S=e.tangent.values;h.set(S),h.set(S,c),e.tangent.values=h}}if(t.st){var g=e.st.values,N=new Float32Array(6*l);N.set(g),N.set(g,l);for(var O=2*l,I=0;I<2;I++){for(N[O++]=g[0],N[O++]=g[1],u=2;u<l;u+=2){var M=g[u],L=g[u+1];N[O++]=M,N[O++]=L,N[O++]=M,N[O++]=L}N[O++]=g[0],N[O++]=g[1]}e.st.values=N}return e}function g(e,t,n){n[t++]=e[0],n[t++]=e[1],n[t++]=e[2];for(var r=3;r<e.length;r+=3){var a=e[r],i=e[r+1],o=e[r+2];n[t++]=a,n[t++]=i,n[t++]=o,n[t++]=a,n[t++]=i,n[t++]=o}return n[t++]=e[0],n[t++]=e[1],n[t++]=e[2],n}function N(e,t){var n=new R({position:t.position,normal:t.normal||t.bitangent||e.shadowVolume,tangent:t.tangent,bitangent:t.normal||t.bitangent,st:t.st}),r=e.ellipsoid,i=o.computePositions(e),u=v(i,n,r),s=e.height,c=e.extrudedHeight,l=u.attributes,f=u.indices,d=l.position.values,E=d.length,p=new Float64Array(6*E),_=new Float64Array(E);_.set(d);var T=new Float64Array(4*E);d=y.scaleToGeodeticHeight(d,s,r),T=g(d,0,T),_=y.scaleToGeodeticHeight(_,c,r),T=g(_,2*E,T),p.set(d),p.set(_,E),p.set(T,2*E),l.position.values=p,l=S(l,t);var A=E/3;if(e.shadowVolume){var N=l.normal.values;E=N.length;var O=new Float32Array(6*E);for(I=0;I<E;I++)N[I]=-N[I];O.set(N,E),O=g(N,4*E,O),l.extrudeDirection=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:O}),t.normal||(l.normal=void 0)}var I,M=f.length,w=A+A,x=m.createTypedArray(p.length/3,2*M+3*w);x.set(f);var C=M;for(I=0;I<M;I+=3){var P=f[I],D=f[I+1],U=f[I+2];x[C++]=U+A,x[C++]=D+A,x[C++]=P+A}var L,F,z,B;for(I=0;I<w;I+=2)L=I+w,F=L+w,z=L+1,B=F+1,x[C++]=L,x[C++]=F,x[C++]=z,x[C++]=z,x[C++]=F,x[C++]=B;return{attributes:l,indices:x}}function O(e,t,r,a,i,o){var u=n.subtract(t,e,z);n.normalize(u,u);var s=r.geodeticSurfaceNormal(e,B),c=n.cross(u,s,z);n.multiplyByScalar(c,a,c);var l=i.latitude,f=i.longitude,d=o.latitude,h=o.longitude;n.add(e,c,B),r.cartesianToCartographic(B,b);var E=b.latitude,m=b.longitude;l=Math.min(l,E),f=Math.min(f,m),d=Math.max(d,E),h=Math.max(h,m),n.subtract(e,c,B),r.cartesianToCartographic(B,b),E=b.latitude,m=b.longitude,l=Math.min(l,E),f=Math.min(f,m),d=Math.max(d,E),h=Math.max(h,m),i.latitude=l,i.longitude=f,o.latitude=d,o.longitude=h}function I(t,r,a,o){var u=e(t,n.equalsEpsilon),s=u.length;if(s<2||a<=0)return new T;var c=.5*a;W.latitude=Number.POSITIVE_INFINITY,W.longitude=Number.POSITIVE_INFINITY,V.latitude=Number.NEGATIVE_INFINITY,V.longitude=Number.NEGATIVE_INFINITY;var l,f;if(o===i.ROUNDED){var d=u[0];n.subtract(d,u[1],G),n.normalize(G,G),n.multiplyByScalar(G,c,G),n.add(d,G,q),r.cartesianToCartographic(q,b),l=b.latitude,f=b.longitude,W.latitude=Math.min(W.latitude,l),W.longitude=Math.min(W.longitude,f),V.latitude=Math.max(V.latitude,l),V.longitude=Math.max(V.longitude,f)}for(var h=0;h<s-1;++h)O(u[h],u[h+1],r,c,W,V);var E=u[s-1];n.subtract(E,u[s-2],G),n.normalize(G,G),n.multiplyByScalar(G,c,G),n.add(E,G,q),O(E,q,r,c,W,V),o===i.ROUNDED&&(r.cartesianToCartographic(q,b),l=b.latitude,f=b.longitude,W.latitude=Math.min(W.latitude,l),W.longitude=Math.min(W.longitude,f),V.latitude=Math.max(V.latitude,l),V.longitude=Math.max(V.longitude,f));var m=new T;return m.north=V.latitude,m.south=W.latitude,m.east=V.longitude,m.west=W.longitude,m}function M(e){e=u(e,u.EMPTY_OBJECT);var t=e.positions,r=e.width;this._positions=t,this._ellipsoid=f.clone(u(e.ellipsoid,f.WGS84)),this._vertexFormat=R.clone(u(e.vertexFormat,R.DEFAULT)),this._width=r,this._height=u(e.height,0),this._extrudedHeight=u(e.extrudedHeight,this._height),this._cornerType=u(e.cornerType,i.ROUNDED),this._granularity=u(e.granularity,p.RADIANS_PER_DEGREE),this._shadowVolume=u(e.shadowVolume,!1),this._workerName="createCorridorGeometry",this._rectangle=I(t,this._ellipsoid,r,this._cornerType),this.packedLength=1+t.length*n.packedLength+f.packedLength+R.packedLength+T.packedLength+6}var w=new n,x=new n,C=new n,P=new n,D=new n,U=new n,L=new n,F=new n,z=new n,B=new n,b=new r,G=new n,q=new n,W=new r,V=new r;M.pack=function(e,t,r){r=u(r,0);var a=e._positions,i=a.length;t[r++]=i;for(var o=0;o<i;++o,r+=n.packedLength)n.pack(a[o],t,r);return f.pack(e._ellipsoid,t,r),r+=f.packedLength,R.pack(e._vertexFormat,t,r),r+=R.packedLength,T.pack(e._rectangle,t,r),r+=T.packedLength,t[r++]=e._width,t[r++]=e._height,t[r++]=e._extrudedHeight,t[r++]=e._cornerType,t[r++]=e._granularity,t[r]=e._shadowVolume?1:0,t};var X=f.clone(f.UNIT_SPHERE),H=new R,Y=new T,k={positions:void 0,ellipsoid:X,vertexFormat:H,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0};return M.unpack=function(e,t,r){t=u(t,0);for(var a=e[t++],i=new Array(a),o=0;o<a;++o,t+=n.packedLength)i[o]=n.unpack(e,t);var c=f.unpack(e,t,X);t+=f.packedLength;var l=R.unpack(e,t,H);t+=R.packedLength;var d=T.unpack(e,t,Y);t+=T.packedLength;var h=e[t++],E=e[t++],m=e[t++],p=e[t++],y=e[t++],_=1===e[t];return s(r)?(r._positions=i,r._ellipsoid=f.clone(c,r._ellipsoid),r._vertexFormat=R.clone(l,r._vertexFormat),r._width=h,r._height=E,r._extrudedHeight=m,r._cornerType=p,r._granularity=y,r._rectangle=T.clone(d),r._shadowVolume=_,r):(k.positions=i,k.width=h,k.height=E,k.extrudedHeight=m,k.cornerType=p,k.granularity=y,k.shadowVolume=_,new M(k))},M.createGeometry=function(r){var a=r._positions,i=r._height,u=r._width,s=r._extrudedHeight,c=i!==s,l=e(a,n.equalsEpsilon);if(!(l.length<2||u<=0)){var f,h=r._ellipsoid,E=r._vertexFormat,m={ellipsoid:h,positions:l,width:u,cornerType:r._cornerType,granularity:r._granularity,saveAttributes:!0};if(c){var p=Math.max(i,s);s=Math.min(i,s),i=p,m.height=i,m.extrudedHeight=s,m.shadowVolume=r._shadowVolume,f=N(m,E)}else{var T=o.computePositions(m);f=v(T,E,h),f.attributes.position.values=y.scaleToGeodeticHeight(f.attributes.position.values,i,h)}var R=f.attributes,A=t.fromVertices(R.position.values,void 0,3);return E.position||(f.attributes.position.values=void 0),new d({attributes:R,indices:f.indices,primitiveType:_.TRIANGLES,boundingSphere:A})}},M.createShadowVolume=function(e,t,n){var r=e._granularity,a=e._ellipsoid,i=t(r,a),o=n(r,a);return new M({positions:e._positions,width:e._width,cornerType:e._cornerType,ellipsoid:a,granularity:r,extrudedHeight:i,height:o,vertexFormat:R.POSITION_ONLY,shadowVolume:!0})},c(M.prototype,{rectangle:{get:function(){return this._rectangle}}}),M}),define("Workers/createCorridorGeometry",["../Core/CorridorGeometry","../Core/defined","../Core/Ellipsoid"],function(e,t,n){"use strict";function r(r,a){return t(a)&&(r=e.unpack(r,a)),r._ellipsoid=n.clone(r._ellipsoid),e.createGeometry(r)}return r})}(); \ No newline at end of file diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createCorridorOutlineGeometry.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createCorridorOutlineGeometry.js index deba8542..a0a11138 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createCorridorOutlineGeometry.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createCorridorOutlineGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -222,9 +222,9 @@ OTHER DEALINGS IN THE SOFTWARE. * */ -!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==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";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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 n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(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^=e<<7&2636928640,e^=e<<15&4022730752,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,n,r){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:e<0?-1:0},a.signNotZero=function(e){return e<0?-1:1},a.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*a.clamp(e,-1,1)+.5)*n)},a.fromSNorm=function(e,n){return n=t(n,255),a.clamp(e,0,n)/n*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},a.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},a.lerp=function(e,t,n){return(1-n)*e+n*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){var t=a.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},a.clampToLatitudeRange=function(e){return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){return(e%t+t)%t},a.equalsEpsilon=function(e,n,r,a){a=t(a,r);var i=Math.abs(e-n);return i<=a||i<=r*Math.max(Math.abs(e),Math.abs(n))};var i=[1];a.factorial=function(e){var t=i.length;if(e>=t)for(var n=i[t-1],r=t;r<=e;r++)i.push(n*r);return i[e]},a.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},a.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return a.setRandomNumberSeed=function(t){o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(e){return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){return Math.log(e)/Math.log(t)},a.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},a}),define("Core/arrayRemoveDuplicates",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(n,r,a){if(t(n)){a=e(a,!1);var o=n.length;if(o<2)return n;var u,s,c;for(u=1;u<o&&(s=n[u-1],c=n[u],!r(s,c,i));++u);if(u===o)return a&&r(n[0],n[n.length-1],i)?n.slice(1):n;for(var l=n.slice(0,u);u<o;++u)c=n[u],r(s,c,i)||(l.push(c),s=c);return a&&l.length>1&&r(l[0],l[l.length-1],i)&&l.shift(),l}}var i=r.EPSILON10;return a}),define("Core/isArray",["./defined"],function(e){"use strict";var t=Array.isArray;return e(t)||(t=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),t}),define("Core/Check",["./defaultValue","./defined","./DeveloperError","./isArray"],function(e,t,n,r){"use strict";function a(e){return e+" was required but undefined."}function i(e,t,n){return"Expected "+n+" to be typeof "+t+", got "+e}var o={};return o.typeOf={},o.numeric={},o.defined=function(e,r){if(!t(e))throw new n(a(r))},o.numeric.maximum=function(e,t){if(o.typeOf.number(e),o.typeOf.number(t),e>t)throw new n("Expected "+e+" to be at most "+t)},o.numeric.minimum=function(e,t){if(o.typeOf.number(e),o.typeOf.number(t),e<t)throw new n("Expected "+e+" to be at least "+t)},o.typeOf.function=function(e,t){if("function"!=typeof e)throw new n(i(typeof e,"function",t))},o.typeOf.string=function(e,t){if("string"!=typeof e)throw new n(i(typeof e,"string",t))},o.typeOf.number=function(e,t){if("number"!=typeof e)throw new n(i(typeof e,"number",t))},o.typeOf.object=function(e,t){if("object"!=typeof e)throw new n(i(typeof e,"object",t))},o.typeOf.boolean=function(e,t){if("boolean"!=typeof e)throw new n(i(typeof e,"boolean",t))},o}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var a=e.clock,i=e.cone,u=t(e.magnitude,1),s=u*Math.sin(i);return r.x=s*Math.cos(a),r.y=s*Math.sin(a),r.z=u*Math.cos(i),r},o.fromElements=function(e,t,r,a){return n(a)?(a.x=e,a.y=t,a.z=r,a):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var a=0;a<r;++a)o.pack(e[a],t,3*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var a=0;a<r;a+=3){var i=a/3;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,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};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var n=o.dot(c,l),r=o.magnitude(o.cross(c,l,c));return Math.atan2(r,n)};var f=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)},o.cross=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=t.x,u=t.y,s=t.z,c=a*s-i*u,l=i*o-r*s,f=r*u-a*o;return n.x=c,n.y=l,n.z=f,n},o.fromDegrees=function(e,t,n,r,a){return e=i.toRadians(e),t=i.toRadians(t),o.fromRadians(e,t,n,r,a)};var h=new o,d=new o,E=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,a,i,u){a=t(a,0);var s=n(i)?i.radiiSquared:E,c=Math.cos(r);h.x=c*Math.cos(e),h.y=c*Math.sin(e),h.z=Math.sin(r),h=o.normalize(h,h),o.multiplyComponents(s,h,d);var l=Math.sqrt(o.dot(h,d));return d=o.divideByScalar(d,l,d),h=o.multiplyByScalar(h,a,h),n(u)||(u=new o),o.add(d,h,u)},o.fromDegreesArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromDegrees(u,s,0,t,r[c])}return r},o.fromRadiansArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromRadians(u,s,0,t,r[c])}return r},o.fromDegreesArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromDegrees(u,s,c,t,r[l])}return r},o.fromRadiansArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromRadians(u,s,c,t,r[l])}return r},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(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,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(n,a,u,s,c){var l=n.x,f=n.y,h=n.z,d=a.x,E=a.y,p=a.z,m=l*l*d*d,y=f*f*E*E,_=h*h*p*p,T=m+y+_,R=Math.sqrt(1/T),A=e.multiplyByScalar(n,R,i);if(T<s)return isFinite(R)?e.clone(A,c):void 0;var v=u.x,S=u.y,N=u.z,g=o;g.x=A.x*v*2,g.y=A.y*S*2,g.z=A.z*N*2;var I,O,M,x,w,C,P,D,U,L,F,z=(1-R)*e.magnitude(n)/(.5*e.magnitude(g)),B=0;do{z-=B,M=1/(1+z*v),x=1/(1+z*S),w=1/(1+z*N),C=M*M,P=x*x,D=w*w,U=C*M,L=P*x,F=D*w,I=m*C+y*P+_*D-1,O=m*U*v+y*L*S+_*F*N;var b=-2*O;B=I/b}while(Math.abs(I)>r.EPSILON12);return t(c)?(c.x=l*M,c.y=f*x,c.z=h*w,c):new e(l*M,f*x,h*w)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o){"use strict";function u(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)}u.fromRadians=function(e,r,a,i){return a=t(a,0),n(i)?(i.longitude=e,i.latitude=r,i.height=a,i):new u(e,r,a)},u.fromDegrees=function(e,t,n,r){return e=i.toRadians(e),t=i.toRadians(t),u.fromRadians(e,t,n,r)};var s=new e,c=new e,l=new e,f=new e(1/6378137,1/6378137,1/6356752.314245179),h=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),d=i.EPSILON1;return u.fromCartesian=function(t,r,a){var E=n(r)?r.oneOverRadii:f,p=n(r)?r.oneOverRadiiSquared:h,m=n(r)?r._centerToleranceSquared:d,y=o(t,E,p,m,c);if(n(y)){var _=e.multiplyComponents(y,p,s);_=e.normalize(_,_);var T=e.subtract(t,y,l),R=Math.atan2(_.y,_.x),A=Math.asin(_.z),v=i.sign(e.dot(T,t))*e.magnitude(T);return n(a)?(a.longitude=R,a.latitude=A,a.height=v,a):new u(R,A,v)}},u.clone=function(e,t){if(n(e))return n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},u.ZERO=a(new u(0,0,0)),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,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(t,r,a,i){r=n(r,0),a=n(a,0),i=n(i,0),t._radii=new e(r,a,i),t._radiiSquared=new e(r*r,a*a,i*i),t._radiiToTheFourth=new e(r*r*r*r,a*a*a*a,i*i*i*i),t._oneOverRadii=new e(0===r?0:1/r,0===a?0:1/a,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===a?0:1/(a*a),0===i?0:1/(i*i)),t._minimumRadius=Math.min(r,a,i),t._maximumRadius=Math.max(r,a,i),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,c(this,e,t,n)}a(l.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}}}),l.clone=function(t,n){if(r(t)){var a=t._radii;return r(n)?(e.clone(a,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new l(a.x,a.y,a.z)}},l.fromCartesian3=function(e,t){return r(t)||(t=new l),r(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,r,a){return a=n(a,0),e.pack(t._radii,r,a),r},l.unpack=function(t,r,a){r=n(r,0);var i=e.unpack(t,r);return l.fromCartesian3(i,a)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,n){var a=t.longitude,i=t.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return r(n)||(n=new e),n.x=u,n.y=s,n.z=c,e.normalize(n,n)},l.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var f=new e,h=new e;l.prototype.cartographicToCartesian=function(t,n){var a=f,i=h;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(e.dot(a,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(a,t.height,a),r(n)||(n=new e),e.add(i,a,n)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var d=new e,E=new e,p=new e;return l.prototype.cartesianToCartographic=function(n,a){var i=this.scaleToGeodeticSurface(n,E);if(r(i)){var o=this.geodeticSurfaceNormal(i,d),s=e.subtract(n,i,p),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),f=u.sign(e.dot(s,n))*e.magnitude(s);return r(a)?(a.longitude=c,a.latitude=l,a.height=f,a):new t(c,l,f)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var a=t.x,i=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return e.multiplyByScalar(t,s,n)},l.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},l.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},l.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,a,i){a=n(a,0);var o=this._sqauredXOverSquaredZ;if(r(i)||(i=new e),i.x=0,i.y=0,i.z=t.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},l}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,a,i,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return r(n)?(n.x=i,n.y=o,n.z=u,n):new e(i,o,u)},u.prototype.unproject=function(e,n){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,u=e.z;return r(n)?(n.longitude=i,n.latitude=o,n.height=u,n):new t(i,o,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";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i,o){"use strict";function u(e,n,r,a,i,o,u,s,c){this[0]=t(e,0),this[1]=t(a,0),this[2]=t(u,0),this[3]=t(n,0),this[4]=t(i,0),this[5]=t(s,0),this[6]=t(r,0),this[7]=t(o,0),this[8]=t(c,0)}function s(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function c(e){for(var t=0,n=0;n<3;++n){var r=e[u.getElementIndex(E[n],d[n])];t+=2*r*r}return Math.sqrt(t)}function l(e,t){for(var n=o.EPSILON15,r=0,a=1,i=0;i<3;++i){var s=Math.abs(e[u.getElementIndex(E[i],d[i])]);s>r&&(a=i,r=s)}var c=1,l=0,f=d[a],h=E[a];if(Math.abs(e[u.getElementIndex(h,f)])>n){var p,m=e[u.getElementIndex(h,h)],y=e[u.getElementIndex(f,f)],_=e[u.getElementIndex(h,f)],T=(m-y)/2/_;p=T<0?-1/(-T+Math.sqrt(1+T*T)):1/(T+Math.sqrt(1+T*T)),c=1/Math.sqrt(1+p*p),l=p*c}return t=u.clone(u.IDENTITY,t),t[u.getElementIndex(f,f)]=t[u.getElementIndex(h,h)]=c,t[u.getElementIndex(h,f)]=l,t[u.getElementIndex(f,h)]=-l,t}u.packedLength=9,u.pack=function(e,n,r){return r=t(r,0),n[r++]=e[0],n[r++]=e[1],n[r++]=e[2],n[r++]=e[3],n[r++]=e[4],n[r++]=e[5],n[r++]=e[6],n[r++]=e[7],n[r++]=e[8],n},u.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new u),a[0]=e[r++],a[1]=e[r++],a[2]=e[r++],a[3]=e[r++],a[4]=e[r++],a[5]=e[r++],a[6]=e[r++],a[7]=e[r++],a[8]=e[r++],a},u.clone=function(e,t){if(n(e))return n(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 u(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},u.fromArray=function(e,r,a){return r=t(r,0),n(a)||(a=new u),a[0]=e[r],a[1]=e[r+1],a[2]=e[r+2],a[3]=e[r+3],a[4]=e[r+4],a[5]=e[r+5],a[6]=e[r+6],a[7]=e[r+7],a[8]=e[r+8],a},u.fromColumnMajorArray=function(e,t){return u.clone(e,t)},u.fromRowMajorArray=function(e,t){return n(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 u(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},u.fromQuaternion=function(e,t){var r=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,s=e.y*e.y,c=e.y*e.z,l=e.y*e.w,f=e.z*e.z,h=e.z*e.w,d=e.w*e.w,E=r-s-f+d,p=2*(a-h),m=2*(i+l),y=2*(a+h),_=-r+s-f+d,T=2*(c-o),R=2*(i-l),A=2*(c+o),v=-r-s+f+d;return n(t)?(t[0]=E,t[1]=y,t[2]=R,t[3]=p,t[4]=_,t[5]=A,t[6]=m,t[7]=T,t[8]=v,t):new u(E,p,m,y,_,T,R,A,v)},u.fromHeadingPitchRoll=function(e,t){var r=Math.cos(-e.pitch),a=Math.cos(-e.heading),i=Math.cos(e.roll),o=Math.sin(-e.pitch),s=Math.sin(-e.heading),c=Math.sin(e.roll),l=r*a,f=-i*s+c*o*a,h=c*s+i*o*a,d=r*s,E=i*a+c*o*s,p=-o*i+i*o*s,m=-o,y=c*r,_=i*r;return n(t)?(t[0]=l,t[1]=d,t[2]=m,t[3]=f,t[4]=E,t[5]=y,t[6]=h,t[7]=p,t[8]=_,t):new u(l,f,h,d,E,p,m,y,_)},u.fromScale=function(e,t){return n(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 u(e.x,0,0,0,e.y,0,0,0,e.z)},u.fromUniformScale=function(e,t){return n(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 u(e,0,0,0,e,0,0,0,e)},u.fromCrossProduct=function(e,t){return n(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 u(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},u.fromRotationX=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=r,t[5]=a,t[6]=0,t[7]=-a,t[8]=r,t):new u(1,0,0,0,r,-a,0,a,r)},u.fromRotationY=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=r,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=r,t):new u(r,0,a,0,1,0,-a,0,r)},u.fromRotationZ=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=r,t[1]=a,t[2]=0,t[3]=-a,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new u(r,-a,0,a,r,0,0,0,1)},u.toArray=function(e,t){return n(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]]},u.getElementIndex=function(e,t){return 3*e+t},u.getColumn=function(e,t,n){var r=3*t,a=e[r],i=e[r+1],o=e[r+2];return n.x=a,n.y=i,n.z=o,n},u.setColumn=function(e,t,n,r){r=u.clone(e,r);var a=3*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},u.getRow=function(e,t,n){var r=e[t],a=e[t+3],i=e[t+6];return n.x=r,n.y=a,n.z=i,n},u.setRow=function(e,t,n,r){return r=u.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var f=new e;u.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],f)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],f)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],f)),n};var h=new e;u.getMaximumScale=function(t){return u.getScale(t,h),e.maximumComponent(h)},u.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=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 n[0]=r,n[1]=a,n[2]=i,n[3]=o,n[4]=u,n[5]=s,n[6]=c,n[7]=l,n[8]=f,n},u.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},u.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},u.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[3]*a+e[6]*i,u=e[1]*r+e[4]*a+e[7]*i,s=e[2]*r+e[5]*a+e[8]*i;return n.x=o,n.y=u,n.z=s,n},u.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},u.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},u.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},u.transpose=function(e,t){var n=e[0],r=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=n,t[1]=r,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var d=[1,0,0],E=[2,2,1],p=new u,m=new u;return u.computeEigenDecomposition=function(e,t){var r=o.EPSILON20,a=10,i=0,f=0;n(t)||(t={});for(var h=t.unitary=u.clone(u.IDENTITY,t.unitary),d=t.diagonal=u.clone(e,t.diagonal),E=r*s(d);f<a&&c(d)>E;)l(d,p),u.transpose(p,m),u.multiply(d,p,d),u.multiply(m,d,d),u.multiply(h,p,h),++i>2&&(++f,i=0);return t},u.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},u.determinant=function(e){var t=e[0],n=e[3],r=e[6],a=e[1],i=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*o)+a*(s*r-n*c)+u*(n*o-i*r)},u.inverse=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[3],o=e[4],s=e[5],c=e[6],l=e[7],f=e[8],h=u.determinant(e);t[0]=o*f-l*s,t[1]=l*a-r*f,t[2]=r*s-o*a,t[3]=c*s-i*f,t[4]=n*f-c*a,t[5]=i*a-n*s,t[6]=i*l-c*o,t[7]=c*r-n*l,t[8]=n*o-i*r;var d=1/h;return u.multiplyByScalar(t,d,t)},u.equals=function(e,t){return e===t||n(e)&&n(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]},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r},u.IDENTITY=i(new u(1,0,0,0,1,0,0,0,1)),u.ZERO=i(new u(0,0,0,0,0,0,0,0,0)),u.COLUMN0ROW0=0,u.COLUMN0ROW1=1,u.COLUMN0ROW2=2,u.COLUMN1ROW0=3,u.COLUMN1ROW1=4,u.COLUMN1ROW2=5,u.COLUMN2ROW0=6,u.COLUMN2ROW1=7,u.COLUMN2ROW2=8,r(u.prototype,{length:{get:function(){return u.packedLength}}}),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},u}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a){"use strict";function i(t,n,r,a){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0),this.w=e(a,0)}i.fromElements=function(e,n,r,a,o){return t(o)?(o.x=e,o.y=n,o.z=r,o.w=a,o):new i(e,n,r,a)},i.fromColor=function(e,n){return t(n)?(n.x=e.red,n.y=e.green,n.z=e.blue,n.w=e.alpha,n):new i(e.red,e.green,e.blue,e.alpha)},i.clone=function(e,n){if(t(e))return t(n)?(n.x=e.x,n.y=e.y,n.z=e.z,n.w=e.w,n):new i(e.x,e.y,e.z,e.w)},i.packedLength=4,i.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w,n},i.unpack=function(n,r,a){return r=e(r,0),t(a)||(a=new i),a.x=n[r++],a.y=n[r++],a.z=n[r++],a.w=n[r],a},i.packArray=function(e,n){var r=e.length;t(n)?n.length=4*r:n=new Array(4*r);for(var a=0;a<r;++a)i.pack(e[a],n,4*a);return n},i.unpackArray=function(e,n){var r=e.length;t(n)?n.length=r/4:n=new Array(r/4);for(var a=0;a<r;a+=4){var o=a/4;n[o]=i.unpack(e,a,n[o])}return n},i.fromArray=i.unpack,i.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},i.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},i.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},i.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},i.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},i.magnitude=function(e){return Math.sqrt(i.magnitudeSquared(e))};var o=new i;i.distance=function(e,t){return i.subtract(e,t,o),i.magnitude(o)},i.distanceSquared=function(e,t){return i.subtract(e,t,o),i.magnitudeSquared(o)},i.normalize=function(e,t){var n=i.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t},i.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},i.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},i.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},i.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},i.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},i.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},i.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},i.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},i.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 u=new i;i.lerp=function(e,t,n,r){return i.multiplyByScalar(t,n,u),r=i.multiplyByScalar(e,1-n,r),i.add(u,r,r)};var s=new i;return i.mostOrthogonalAxis=function(e,t){var n=i.normalize(e,s);return i.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?i.clone(i.UNIT_X,t):i.clone(i.UNIT_W,t):n.z<=n.w?i.clone(i.UNIT_Z,t):i.clone(i.UNIT_W,t):n.y<=n.z?n.y<=n.w?i.clone(i.UNIT_Y,t):i.clone(i.UNIT_W,t):n.z<=n.w?i.clone(i.UNIT_Z,t):i.clone(i.UNIT_W,t)},i.equals=function(e,n){return e===n||t(e)&&t(n)&&e.x===n.x&&e.y===n.y&&e.z===n.z&&e.w===n.w},i.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},i.equalsEpsilon=function(e,n,r,i){return e===n||t(e)&&t(n)&&a.equalsEpsilon(e.x,n.x,r,i)&&a.equalsEpsilon(e.y,n.y,r,i)&&a.equalsEpsilon(e.z,n.z,r,i)&&a.equalsEpsilon(e.w,n.w,r,i)},i.ZERO=r(new i(0,0,0,0)),i.UNIT_X=r(new i(1,0,0,0)),i.UNIT_Y=r(new i(0,1,0,0)),i.UNIT_Z=r(new i(0,0,1,0)),i.UNIT_W=r(new i(0,0,0,1)),i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i.prototype.equalsEpsilon=function(e,t,n){return i.equalsEpsilon(this,e,t,n)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},i}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t), -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","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t,r,a,i,o,u,s,c,l,f,h,d,E,p,m){this[0]=n(e,0),this[1]=n(i,0),this[2]=n(c,0),this[3]=n(d,0),this[4]=n(t,0),this[5]=n(o,0),this[6]=n(l,0),this[7]=n(E,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(f,0),this[11]=n(p,0),this[12]=n(a,0),this[13]=n(s,0),this[14]=n(h,0),this[15]=n(m,0)}l.packedLength=16,l.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t[r++]=e[9],t[r++]=e[10],t[r++]=e[11],t[r++]=e[12],t[r++]=e[13],t[r++]=e[14],t[r]=e[15],t},l.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new l),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a[9]=e[t++],a[10]=e[t++],a[11]=e[t++],a[12]=e[t++],a[13]=e[t++],a[14]=e[t++],a[15]=e[t],a},l.clone=function(e,t){if(r(e))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):new l(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])},l.fromArray=l.unpack,l.fromColumnMajorArray=function(e,t){return l.clone(e,t)},l.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 l(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])},l.fromRotationTranslation=function(t,a,i){return a=n(a,e.ZERO),r(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=a.x,i[13]=a.y,i[14]=a.z,i[15]=1,i):new l(t[0],t[3],t[6],a.x,t[1],t[4],t[7],a.y,t[2],t[5],t[8],a.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(e,t,n,a){r(a)||(a=new l);var i=n.x,o=n.y,u=n.z,s=t.x*t.x,c=t.x*t.y,f=t.x*t.z,h=t.x*t.w,d=t.y*t.y,E=t.y*t.z,p=t.y*t.w,m=t.z*t.z,y=t.z*t.w,_=t.w*t.w,T=s-d-m+_,R=2*(c-y),A=2*(f+p),v=2*(c+y),S=-s+d-m+_,N=2*(E-h),g=2*(f-p),I=2*(E+h),O=-s-d+m+_;return a[0]=T*i,a[1]=v*i,a[2]=g*i,a[3]=0,a[4]=R*o,a[5]=S*o,a[6]=I*o,a[7]=0,a[8]=A*u,a[9]=N*u,a[10]=O*u,a[11]=0,a[12]=e.x,a[13]=e.y,a[14]=e.z,a[15]=1,a},l.fromTranslationRotationScale=function(e,t){return l.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},l.fromTranslation=function(e,t){return l.fromRotationTranslation(s.IDENTITY,e,t)},l.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 l(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},l.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 l(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var f=new e,h=new e,d=new e;l.fromCamera=function(t,n){var a=t.position,i=t.direction,o=t.up;e.normalize(i,f),e.normalize(e.cross(f,o,h),h),e.normalize(e.cross(h,f,d),d);var u=h.x,s=h.y,c=h.z,E=f.x,p=f.y,m=f.z,y=d.x,_=d.y,T=d.z,R=a.x,A=a.y,v=a.z,S=u*-R+s*-A+c*-v,N=y*-R+_*-A+T*-v,g=E*R+p*A+m*v;return r(n)?(n[0]=u,n[1]=y,n[2]=-E,n[3]=0,n[4]=s,n[5]=_,n[6]=-p,n[7]=0,n[8]=c,n[9]=T,n[10]=-m,n[11]=0,n[12]=S,n[13]=N,n[14]=g,n[15]=1,n):new l(u,s,c,S,y,_,T,N,-E,-p,-m,g,0,0,0,1)},l.computePerspectiveFieldOfView=function(e,t,n,r,a){var i=Math.tan(.5*e),o=1/i,u=o/t,s=(r+n)/(n-r),c=2*r*n/(n-r);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=c,a[15]=0,a},l.computeOrthographicOffCenter=function(e,t,n,r,a,i,o){var u=1/(t-e),s=1/(r-n),c=1/(i-a),l=-(t+e)*u,f=-(r+n)*s,h=-(i+a)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=f,o[14]=h,o[15]=1,o},l.computePerspectiveOffCenter=function(e,t,n,r,a,i,o){var u=2*a/(t-e),s=2*a/(r-n),c=(t+e)/(t-e),l=(r+n)/(r-n),f=-(i+a)/(i-a),h=-1,d=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=f,o[11]=h,o[12]=0,o[13]=0,o[14]=d,o[15]=0,o},l.computeInfinitePerspectiveOffCenter=function(e,t,n,r,a,i){var o=2*a/(t-e),u=2*a/(r-n),s=(t+e)/(t-e),c=(r+n)/(r-n),l=-1,f=-1,h=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=s,i[9]=c,i[10]=l,i[11]=f,i[12]=0,i[13]=0,i[14]=h,i[15]=0,i},l.computeViewportTransformation=function(e,t,r,a){e=n(e,n.EMPTY_OBJECT);var i=n(e.x,0),o=n(e.y,0),u=n(e.width,0),s=n(e.height,0);t=n(t,0),r=n(r,1);var c=.5*u,l=.5*s,f=.5*(r-t),h=c,d=l,E=f,p=i+c,m=o+l,y=t+f,_=1;return a[0]=h,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=d,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=E,a[11]=0,a[12]=p,a[13]=m,a[14]=y,a[15]=_,a},l.computeView=function(t,n,r,a,i){return i[0]=a.x,i[1]=r.x,i[2]=-n.x,i[3]=0,i[4]=a.y,i[5]=r.y,i[6]=-n.y,i[7]=0,i[8]=a.z,i[9]=r.z,i[10]=-n.z,i[11]=0,i[12]=-e.dot(a,t),i[13]=-e.dot(r,t),i[14]=e.dot(n,t),i[15]=1,i},l.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]]},l.getElementIndex=function(e,t){return 4*e+t},l.getColumn=function(e,t,n){var r=4*t,a=e[r],i=e[r+1],o=e[r+2],u=e[r+3];return n.x=a,n.y=i,n.z=o,n.w=u,n},l.setColumn=function(e,t,n,r){r=l.clone(e,r);var a=4*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r[a+3]=n.w,r},l.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},l.getRow=function(e,t,n){var r=e[t],a=e[t+4],i=e[t+8],o=e[t+12];return n.x=r,n.y=a,n.z=i,n.w=o,n},l.setRow=function(e,t,n,r){return r=l.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var E=new e;l.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],E)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],E)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],E)),n};var p=new e;l.getMaximumScale=function(t){return l.getScale(t,p),e.maximumComponent(p)},l.multiply=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],f=e[8],h=e[9],d=e[10],E=e[11],p=e[12],m=e[13],y=e[14],_=e[15],T=t[0],R=t[1],A=t[2],v=t[3],S=t[4],N=t[5],g=t[6],I=t[7],O=t[8],M=t[9],x=t[10],w=t[11],C=t[12],P=t[13],D=t[14],U=t[15],L=r*T+u*R+f*A+p*v,F=a*T+s*R+h*A+m*v,z=i*T+c*R+d*A+y*v,B=o*T+l*R+E*A+_*v,b=r*S+u*N+f*g+p*I,G=a*S+s*N+h*g+m*I,q=i*S+c*N+d*g+y*I,W=o*S+l*N+E*g+_*I,X=r*O+u*M+f*x+p*w,V=a*O+s*M+h*x+m*w,H=i*O+c*M+d*x+y*w,Y=o*O+l*M+E*x+_*w,Z=r*C+u*P+f*D+p*U,k=a*C+s*P+h*D+m*U,j=i*C+c*P+d*D+y*U,K=o*C+l*P+E*D+_*U;return n[0]=L,n[1]=F,n[2]=z,n[3]=B,n[4]=b,n[5]=G,n[6]=q,n[7]=W,n[8]=X,n[9]=V,n[10]=H,n[11]=Y,n[12]=Z,n[13]=k,n[14]=j,n[15]=K,n},l.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},l.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},l.multiplyTransformation=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=e[12],d=e[13],E=e[14],p=t[0],m=t[1],y=t[2],_=t[4],T=t[5],R=t[6],A=t[8],v=t[9],S=t[10],N=t[12],g=t[13],I=t[14],O=r*p+o*m+c*y,M=a*p+u*m+l*y,x=i*p+s*m+f*y,w=r*_+o*T+c*R,C=a*_+u*T+l*R,P=i*_+s*T+f*R,D=r*A+o*v+c*S,U=a*A+u*v+l*S,L=i*A+s*v+f*S,F=r*N+o*g+c*I+h,z=a*N+u*g+l*I+d,B=i*N+s*g+f*I+E;return n[0]=O,n[1]=M,n[2]=x,n[3]=0,n[4]=w,n[5]=C,n[6]=P,n[7]=0,n[8]=D,n[9]=U,n[10]=L,n[11]=0,n[12]=F,n[13]=z,n[14]=B,n[15]=1,n},l.multiplyByMatrix3=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=t[0],d=t[1],E=t[2],p=t[3],m=t[4],y=t[5],_=t[6],T=t[7],R=t[8],A=r*h+o*d+c*E,v=a*h+u*d+l*E,S=i*h+s*d+f*E,N=r*p+o*m+c*y,g=a*p+u*m+l*y,I=i*p+s*m+f*y,O=r*_+o*T+c*R,M=a*_+u*T+l*R,x=i*_+s*T+f*R;return n[0]=A,n[1]=v,n[2]=S,n[3]=0,n[4]=N,n[5]=g,n[6]=I,n[7]=0,n[8]=O,n[9]=M,n[10]=x,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},l.multiplyByTranslation=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=r*e[0]+a*e[4]+i*e[8]+e[12],u=r*e[1]+a*e[5]+i*e[9]+e[13],s=r*e[2]+a*e[6]+i*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=s,n[15]=e[15],n};var m=new e;l.multiplyByUniformScale=function(e,t,n){return m.x=t,m.y=t,m.z=t,l.multiplyByScale(e,m,n)},l.multiplyByScale=function(e,t,n){var r=t.x,a=t.y,i=t.z;return 1===r&&1===a&&1===i?l.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=a*e[4],n[5]=a*e[5],n[6]=a*e[6],n[7]=0,n[8]=i*e[8],n[9]=i*e[9],n[10]=i*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},l.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=t.w,u=e[0]*r+e[4]*a+e[8]*i+e[12]*o,s=e[1]*r+e[5]*a+e[9]*i+e[13]*o,c=e[2]*r+e[6]*a+e[10]*i+e[14]*o,l=e[3]*r+e[7]*a+e[11]*i+e[15]*o;return n.x=u,n.y=s,n.z=c,n.w=l,n},l.multiplyByPointAsVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i,u=e[1]*r+e[5]*a+e[9]*i,s=e[2]*r+e[6]*a+e[10]*i;return n.x=o,n.y=u,n.z=s,n},l.multiplyByPoint=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i+e[12],u=e[1]*r+e[5]*a+e[9]*i+e[13],s=e[2]*r+e[6]*a+e[10]*i+e[14];return n.x=o,n.y=u,n.z=s,n},l.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},l.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},l.transpose=function(e,t){var n=e[1],r=e[2],a=e[3],i=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=o,t[14]=u,t[15]=e[15],t},l.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},l.equals=function(e,t){return e===t||r(e)&&r(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},l.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},l.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},l.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};var y=new s,_=new s,T=new t,R=new t(0,0,0,1);return l.inverse=function(e,n){if(s.equalsEpsilon(l.getRotation(e,y),_,u.EPSILON7)&&t.equals(l.getRow(e,3,T),R))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],a=e[4],i=e[8],o=e[12],f=e[1],h=e[5],d=e[9],E=e[13],p=e[2],m=e[6],A=e[10],v=e[14],S=e[3],N=e[7],g=e[11],I=e[15],O=A*I,M=v*g,x=m*I,w=v*N,C=m*g,P=A*N,D=p*I,U=v*S,L=p*g,F=A*S,z=p*N,B=m*S,b=O*h+w*d+C*E-(M*h+x*d+P*E),G=M*f+D*d+F*E-(O*f+U*d+L*E),q=x*f+U*h+z*E-(w*f+D*h+B*E),W=P*f+L*h+B*d-(C*f+F*h+z*d),X=M*a+x*i+P*o-(O*a+w*i+C*o),V=O*r+U*i+L*o-(M*r+D*i+F*o),H=w*r+D*a+B*o-(x*r+U*a+z*o),Y=C*r+F*a+z*i-(P*r+L*a+B*i);O=i*E,M=o*d,x=a*E,w=o*h,C=a*d,P=i*h,D=r*E,U=o*f,L=r*d,F=i*f,z=r*h,B=a*f;var Z=O*N+w*g+C*I-(M*N+x*g+P*I),k=M*S+D*g+F*I-(O*S+U*g+L*I),j=x*S+U*N+z*I-(w*S+D*N+B*I),K=P*S+L*N+B*g-(C*S+F*N+z*g),J=x*A+P*v+M*m-(C*v+O*m+w*A),Q=L*v+O*p+U*A-(D*A+F*v+M*p),$=D*m+B*v+w*p-(z*v+x*p+U*m),ee=z*A+C*p+F*m-(L*m+B*A+P*p),te=r*b+a*G+i*q+o*W;if(Math.abs(te)<u.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=b*te,n[1]=G*te,n[2]=q*te,n[3]=W*te,n[4]=X*te,n[5]=V*te,n[6]=H*te,n[7]=Y*te,n[8]=Z*te,n[9]=k*te,n[10]=j*te,n[11]=K*te,n[12]=J*te,n[13]=Q*te,n[14]=$*te,n[15]=ee*te,n},l.inverseTransformation=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],f=e[12],h=e[13],d=e[14],E=-n*f-r*h-a*d,p=-i*f-o*h-u*d,m=-s*f-c*h-l*d;return t[0]=n,t[1]=i,t[2]=s,t[3]=0,t[4]=r,t[5]=o,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=l,t[11]=0,t[12]=E,t[13]=p,t[14]=m,t[15]=1,t},l.IDENTITY=o(new l(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),l.ZERO=o(new l(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN0ROW3=3,l.COLUMN1ROW0=4,l.COLUMN1ROW1=5,l.COLUMN1ROW2=6,l.COLUMN1ROW3=7,l.COLUMN2ROW0=8,l.COLUMN2ROW1=9,l.COLUMN2ROW2=10,l.COLUMN2ROW3=11,l.COLUMN3ROW0=12,l.COLUMN3ROW1=13,l.COLUMN3ROW2=14,l.COLUMN3ROW3=15,a(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.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]+")"},l}),define("Core/Rectangle",["./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,n,r,a){this.west=t(e,0),this.south=t(n,0),this.east=t(r,0),this.north=t(a,0)}r(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,n,r){return r=t(r,0),n[r++]=e.west,n[r++]=e.south,n[r++]=e.east,n[r]=e.north,n},s.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new s),a.west=e[r++],a.south=e[r++],a.east=e[r++],a.north=e[r],a},s.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=u.TWO_PI),t-n},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,r,a,i,o){return e=u.toRadians(t(e,0)),r=u.toRadians(t(r,0)),a=u.toRadians(t(a,0)),i=u.toRadians(t(i,0)),n(o)?(o.west=e,o.south=r,o.east=a,o.north=i,o):new s(e,r,a,i)},s.fromCartographicArray=function(e,t){for(var r=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE,f=0,h=e.length;f<h;f++){var d=e[f];r=Math.min(r,d.longitude),a=Math.max(a,d.longitude),c=Math.min(c,d.latitude),l=Math.max(l,d.latitude);var E=d.longitude>=0?d.longitude:d.longitude+u.TWO_PI;i=Math.min(i,E),o=Math.max(o,E)}return a-r>o-i&&(r=i,a=o,a>u.PI&&(a-=u.TWO_PI),r>u.PI&&(r-=u.TWO_PI)),n(t)?(t.west=r,t.south=c,t.east=a,t.north=l,t):new s(r,c,a,l)},s.fromCartesianArray=function(e,t,r){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=Number.MAX_VALUE,f=-Number.MAX_VALUE,h=0,d=e.length;h<d;h++){var E=t.cartesianToCartographic(e[h]);a=Math.min(a,E.longitude),i=Math.max(i,E.longitude),l=Math.min(l,E.latitude),f=Math.max(f,E.latitude);var p=E.longitude>=0?E.longitude:E.longitude+u.TWO_PI;o=Math.min(o,p),c=Math.max(c,p)}return i-a>c-o&&(a=o,i=c,i>u.PI&&(i-=u.TWO_PI),a>u.PI&&(a-=u.TWO_PI)),n(r)?(r.west=a,r.south=l,r.east=i,r.north=f,r):new s(a,l,i,f)},s.clone=function(e,t){if(n(e))return n(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,t){return e===t||n(e)&&n(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},s.prototype.equalsEpsilon=function(e,t){return n(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},s.validate=function(e){},s.southwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.south,r.height=0,r):new e(t.west,t.south)},s.northwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.north,r.height=0,r):new e(t.west,t.north)},s.northeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.north,r.height=0,r):new e(t.east,t.north)},s.southeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.south,r.height=0,r):new e(t.east,t.south)},s.center=function(t,r){var a=t.east,i=t.west;a<i&&(a+=u.TWO_PI);var o=u.negativePiToPi(.5*(i+a)),s=.5*(t.south+t.north);return n(r)?(r.longitude=o,r.latitude=s,r.height=0,r):new e(o,s)},s.intersection=function(e,t,r){var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.negativePiToPi(Math.max(i,c)),f=u.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&f<=l)){var h=Math.max(e.south,t.south),d=Math.min(e.north,t.north);if(!(h>=d))return n(r)?(r.west=l,r.south=h,r.east=f,r.north=d,r):new s(l,h,f,d)}},s.simpleIntersection=function(e,t,r){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(i>=u||a>=o))return n(r)?(r.west=a,r.south=i,r.east=o,r.north=u,r):new s(a,i,o,u)},s.union=function(e,t,r){n(r)||(r=new s);var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.convertLongitudeRange(Math.min(i,c)),f=u.convertLongitudeRange(Math.max(a,o));return r.west=l,r.south=Math.min(e.south,t.south),r.east=f,r.north=Math.max(e.north,t.north),r},s.expand=function(e,t,r){return n(r)||(r=new s),r.west=Math.min(e.west,t.longitude),r.south=Math.min(e.south,t.latitude),r.east=Math.max(e.east,t.longitude),r.north=Math.max(e.north,t.latitude),r},s.contains=function(e,t){var n=t.longitude,r=t.latitude,a=e.west,i=e.east;return i<a&&(i+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>a||u.equalsEpsilon(n,a,u.EPSILON14))&&(n<i||u.equalsEpsilon(n,i,u.EPSILON14))&&r>=e.south&&r<=e.north};var c=new e;return s.subsample=function(e,r,a,o){r=t(r,i.WGS84),a=t(a,0),n(o)||(o=[]);var l=0,f=e.north,h=e.south,d=e.east,E=e.west,p=c;p.height=a,p.longitude=E,p.latitude=f,o[l]=r.cartographicToCartesian(p,o[l]),l++,p.longitude=d,o[l]=r.cartographicToCartesian(p,o[l]),l++,p.latitude=h,o[l]=r.cartographicToCartesian(p,o[l]),l++,p.longitude=E,o[l]=r.cartographicToCartesian(p,o[l]),l++,f<0?p.latitude=f:h>0?p.latitude=h:p.latitude=0;for(var m=1;m<8;++m)p.longitude=-Math.PI+m*u.PI_OVER_TWO,s.contains(e,p)&&(o[l]=r.cartographicToCartesian(p,o[l]),l++);return 0===p.latitude&&(p.longitude=E,o[l]=r.cartographicToCartesian(p,o[l]),l++,p.longitude=d,o[l]=r.cartographicToCartesian(p,o[l]),l++),o.length=l,o},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(t,r){this.center=e.clone(n(t,e.ZERO)),this.radius=n(r,0)}var d=new e,E=new e,p=new e,m=new e,y=new e,_=new e,T=new e,R=new e,A=new e,v=new e,S=new e,N=new e;h.fromPoints=function(t,n){if(r(n)||(n=new h),!r(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var a=e.clone(t[0],T),i=e.clone(a,d),o=e.clone(a,E),u=e.clone(a,p),s=e.clone(a,m),c=e.clone(a,y),l=e.clone(a,_),f=t.length,g=1;g<f;g++){e.clone(t[g],a);var I=a.x,O=a.y,M=a.z;I<i.x&&e.clone(a,i),I>s.x&&e.clone(a,s),O<o.y&&e.clone(a,o),O>c.y&&e.clone(a,c),M<u.z&&e.clone(a,u),M>l.z&&e.clone(a,l)}var x=e.magnitudeSquared(e.subtract(s,i,R)),w=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=i,D=s,U=x;w>U&&(U=w,P=o,D=c),C>U&&(U=C,P=u,D=l);var L=A;L.x=.5*(P.x+D.x),L.y=.5*(P.y+D.y),L.z=.5*(P.z+D.z);var F=e.magnitudeSquared(e.subtract(D,L,R)),z=Math.sqrt(F),B=v;B.x=i.x,B.y=o.y,B.z=u.z;var b=S;b.x=s.x,b.y=c.y,b.z=l.z;var G=e.multiplyByScalar(e.add(B,b,R),.5,N),q=0;for(g=0;g<f;g++){e.clone(t[g],a);var W=e.magnitude(e.subtract(a,G,R));W>q&&(q=W);var X=e.magnitudeSquared(e.subtract(a,L,R));if(X>F){var V=Math.sqrt(X);z=.5*(z+V),F=z*z;var H=V-z;L.x=(z*L.x+H*a.x)/V,L.y=(z*L.y+H*a.y)/V,L.z=(z*L.z+H*a.z)/V}}return z<q?(e.clone(L,n.center),n.radius=z):(e.clone(G,n.center),n.radius=q),n};var g=new o,I=new e,O=new e,M=new t,x=new t;h.fromRectangle2D=function(e,t,n){return h.fromRectangleWithHeights2D(e,t,0,0,n)},h.fromRectangleWithHeights2D=function(t,a,i,o,u){if(r(u)||(u=new h),!r(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;a=n(a,g),f.southwest(t,M),M.height=i,f.northeast(t,x),x.height=o;var s=a.project(M,I),c=a.project(x,O),l=c.x-s.x,d=c.y-s.y,E=c.z-s.z;u.radius=.5*Math.sqrt(l*l+d*d+E*E);var p=u.center;return p.x=s.x+.5*l,p.y=s.y+.5*d,p.z=s.z+.5*E,u};var w=[];h.fromRectangle3D=function(e,t,a,o){t=n(t,i.WGS84),a=n(a,0);var u;return r(e)&&(u=f.subsample(e,t,a,w)),h.fromPoints(u,o)},h.fromVertices=function(t,a,i,o){if(r(o)||(o=new h),!r(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;a=n(a,e.ZERO),i=n(i,3);var u=T;u.x=t[0]+a.x,u.y=t[1]+a.y,u.z=t[2]+a.z;for(var s=e.clone(u,d),c=e.clone(u,E),l=e.clone(u,p),f=e.clone(u,m),g=e.clone(u,y),I=e.clone(u,_),O=t.length,M=0;M<O;M+=i){var x=t[M]+a.x,w=t[M+1]+a.y,C=t[M+2]+a.z;u.x=x,u.y=w,u.z=C,x<s.x&&e.clone(u,s),x>f.x&&e.clone(u,f),w<c.y&&e.clone(u,c),w>g.y&&e.clone(u,g),C<l.z&&e.clone(u,l),C>I.z&&e.clone(u,I)}var P=e.magnitudeSquared(e.subtract(f,s,R)),D=e.magnitudeSquared(e.subtract(g,c,R)),U=e.magnitudeSquared(e.subtract(I,l,R)),L=s,F=f,z=P;D>z&&(z=D,L=c,F=g),U>z&&(z=U,L=l,F=I);var B=A;B.x=.5*(L.x+F.x),B.y=.5*(L.y+F.y),B.z=.5*(L.z+F.z);var b=e.magnitudeSquared(e.subtract(F,B,R)),G=Math.sqrt(b),q=v;q.x=s.x,q.y=c.y,q.z=l.z;var W=S;W.x=f.x,W.y=g.y,W.z=I.z;var X=e.multiplyByScalar(e.add(q,W,R),.5,N),V=0;for(M=0;M<O;M+=i){u.x=t[M]+a.x,u.y=t[M+1]+a.y,u.z=t[M+2]+a.z;var H=e.magnitude(e.subtract(u,X,R));H>V&&(V=H);var Y=e.magnitudeSquared(e.subtract(u,B,R));if(Y>b){var Z=Math.sqrt(Y);G=.5*(G+Z),b=G*G;var k=Z-G;B.x=(G*B.x+k*u.x)/Z,B.y=(G*B.y+k*u.y)/Z,B.z=(G*B.z+k*u.z)/Z}}return G<V?(e.clone(B,o.center),o.radius=G):(e.clone(X,o.center),o.radius=V),o},h.fromEncodedCartesianVertices=function(t,n,a){if(r(a)||(a=new h),!r(t)||!r(n)||t.length!==n.length||0===t.length)return a.center=e.clone(e.ZERO,a.center),a.radius=0,a;var i=T;i.x=t[0]+n[0],i.y=t[1]+n[1],i.z=t[2]+n[2];for(var o=e.clone(i,d),u=e.clone(i,E),s=e.clone(i,p),c=e.clone(i,m),l=e.clone(i,y),f=e.clone(i,_),g=t.length,I=0;I<g;I+=3){var O=t[I]+n[I],M=t[I+1]+n[I+1],x=t[I+2]+n[I+2];i.x=O,i.y=M,i.z=x,O<o.x&&e.clone(i,o),O>c.x&&e.clone(i,c),M<u.y&&e.clone(i,u),M>l.y&&e.clone(i,l),x<s.z&&e.clone(i,s),x>f.z&&e.clone(i,f)}var w=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=e.magnitudeSquared(e.subtract(f,s,R)),D=o,U=c,L=w;C>L&&(L=C,D=u,U=l),P>L&&(L=P,D=s,U=f);var F=A;F.x=.5*(D.x+U.x),F.y=.5*(D.y+U.y),F.z=.5*(D.z+U.z);var z=e.magnitudeSquared(e.subtract(U,F,R)),B=Math.sqrt(z),b=v;b.x=o.x,b.y=u.y,b.z=s.z;var G=S;G.x=c.x,G.y=l.y,G.z=f.z;var q=e.multiplyByScalar(e.add(b,G,R),.5,N),W=0;for(I=0;I<g;I+=3){i.x=t[I]+n[I],i.y=t[I+1]+n[I+1],i.z=t[I+2]+n[I+2];var X=e.magnitude(e.subtract(i,q,R));X>W&&(W=X);var V=e.magnitudeSquared(e.subtract(i,F,R));if(V>z){var H=Math.sqrt(V);B=.5*(B+H),z=B*B;var Y=H-B;F.x=(B*F.x+Y*i.x)/H,F.y=(B*F.y+Y*i.y)/H,F.z=(B*F.z+Y*i.z)/H}}return B<W?(e.clone(F,a.center),a.radius=B):(e.clone(q,a.center),a.radius=W),a},h.fromCornerPoints=function(t,n,a){r(a)||(a=new h);var i=a.center;return e.add(t,n,i),e.multiplyByScalar(i,.5,i),a.radius=e.distance(i,n),a},h.fromEllipsoid=function(t,n){return r(n)||(n=new h),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var C=new e;h.fromBoundingSpheres=function(t,n){if(r(n)||(n=new h),!r(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var a=t.length;if(1===a)return h.clone(t[0],n);if(2===a)return h.union(t[0],t[1],n);for(var i=[],o=0;o<a;o++)i.push(t[o].center);n=h.fromPoints(i,n);var u=n.center,s=n.radius;for(o=0;o<a;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,C)+c.radius)}return n.radius=s,n};var P=new e,D=new e,U=new e;h.fromOrientedBoundingBox=function(t,n){r(n)||(n=new h);var a=t.halfAxes,i=c.getColumn(a,0,P),o=c.getColumn(a,1,D),u=c.getColumn(a,2,U),s=e.magnitude(i),l=e.magnitude(o),f=e.magnitude(u);return n.center=e.clone(t.center,n.center),n.radius=Math.max(s,l,f),n},h.clone=function(t,n){if(r(t))return r(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new h(t.center,t.radius)},h.packedLength=4,h.pack=function(e,t,r){r=n(r,0);var a=e.center;return t[r++]=a.x,t[r++]=a.y,t[r++]=a.z,t[r]=e.radius,t},h.unpack=function(e,t,a){t=n(t,0),r(a)||(a=new h);var i=a.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],a.radius=e[t],a};var L=new e,F=new e;h.union=function(t,n,a){r(a)||(a=new h);var i=t.center,o=t.radius,u=n.center,s=n.radius,c=e.subtract(u,i,L),l=e.magnitude(c);if(o>=l+s)return t.clone(a),a;if(s>=l+o)return n.clone(a),a;var f=.5*(o+l+s),d=e.multiplyByScalar(c,(-o+f)/l,F);return e.add(d,i,d),e.clone(d,a.center),a.radius=f,a};var z=new e;h.expand=function(t,n,r){r=h.clone(t,r);var a=e.magnitude(e.subtract(n,r.center,z));return a>r.radius&&(r.radius=a),r},h.intersectPlane=function(t,n){var r=t.center,a=t.radius,i=n.normal,o=e.dot(i,r)+n.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},h.transform=function(e,t,n){return r(n)||(n=new h),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=l.getMaximumScale(t)*e.radius,n};var B=new e;h.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,B);return e.magnitudeSquared(r)-t.radius*t.radius},h.transformWithoutScale=function(e,t,n){return r(n)||(n=new h),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var b=new e;h.computePlaneDistances=function(t,n,a,i){r(i)||(i=new s);var o=e.subtract(t.center,n,b),u=e.dot(a,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var G=new e,q=new e,W=new e,X=new e,V=new e,H=new t,Y=new Array(8),Z=0;Z<8;++Z)Y[Z]=new e;var k=new o;return h.projectTo2D=function(t,r,a){r=n(r,k);var i=r.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,G),c=e.cross(e.UNIT_Z,s,q);e.normalize(c,c);var l=e.cross(s,c,W);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var f=e.negate(l,V),d=e.negate(c,X),E=Y,p=E[0];e.add(s,l,p),e.add(p,c,p),p=E[1],e.add(s,l,p),e.add(p,d,p),p=E[2],e.add(s,f,p),e.add(p,d,p),p=E[3],e.add(s,f,p),e.add(p,c,p),e.negate(s,s),p=E[4],e.add(s,l,p),e.add(p,c,p),p=E[5],e.add(s,l,p),e.add(p,d,p),p=E[6],e.add(s,f,p),e.add(p,d,p),p=E[7],e.add(s,f,p),e.add(p,c,p);for(var m=E.length,y=0;y<m;++y){var _=E[y];e.add(o,_,_);var T=i.cartesianToCartographic(_,H);r.project(T,_)}a=h.fromPoints(E,a),o=a.center;var R=o.x,A=o.y,v=o.z;return o.x=v,o.y=R,o.z=A,a},h.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},h.equals=function(t,n){return t===n||r(t)&&r(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},h.prototype.intersectPlane=function(e){return h.intersectPlane(this,e)},h.prototype.distanceSquaredTo=function(e){return h.distanceSquaredTo(this,e)},h.prototype.computePlaneDistances=function(e,t,n){return h.computePlaneDistances(this,e,t,n)},h.prototype.isOccluded=function(e){return h.isOccluded(this,e)},h.prototype.equals=function(e){return h.equals(this,e)},h.prototype.clone=function(e){return h.clone(this,e)},h}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return t(a,{element:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(r.requestFullscreen=a,n=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(r.requestFullscreen=a,n=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?r.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(r.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?r.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(r.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?r.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(r.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),r.fullscreenerror=a)}return n},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[r.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function a(){if(!t(A)&&(A=!1,!h())){var e=/ Chrome\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(A=!0,v=r(e[1]))}return A}function i(){return a()&&v}function o(){if(!t(S)&&(S=!1,!a()&&!h()&&/ Safari\/[\.0-9]+/.test(R.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(S=!0,N=r(e[1]))}return S}function u(){return o()&&N}function s(){if(!t(g)){g=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(R.userAgent);null!==e&&(g=!0,I=r(e[1]),I.isNightly=!!e[2])}return g}function c(){return s()&&I}function l(){if(!t(O)){O=!1;var e;"Microsoft Internet Explorer"===R.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(O=!0,M=r(e[1]))):"Netscape"===R.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(O=!0,M=r(e[1])))}return O}function f(){ -return l()&&M}function h(){if(!t(x)){x=!1;var e=/ Edge\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(x=!0,w=r(e[1]))}return x}function d(){return h()&&w}function E(){if(!t(C)){C=!1;var e=/Firefox\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(C=!0,P=r(e[1]))}return C}function p(){return t(D)||(D=/Windows/i.test(R.appVersion)),D}function m(){return E()&&P}function y(){return t(U)||(U="undefined"!=typeof PointerEvent&&(!t(R.pointerEnabled)||R.pointerEnabled)),U}function _(){if(!t(F)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;F=t(n)&&""!==n,F&&(L=n)}return F}function T(){return _()?L:void 0}var R;R="undefined"!=typeof navigator?navigator:{};var A,v,S,N,g,I,O,M,x,w,C,P,D,U,L,F,z={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isEdge:h,edgeVersion:d,isFirefox:E,firefoxVersion:m,isWindows:p,hardwareConcurrency:e(R.hardwareConcurrency,3),supportsPointerEvents:y,supportsImageRenderingPixelated:_,imageRenderingValue:T};return z.supportsFullscreen=function(){return n.supportsFullscreen()},z.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},z.supportsWebWorkers=function(){return"undefined"!=typeof Worker},z}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,a,i){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){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.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},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 Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,a){switch(r=e(r,0),a=e(a,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,a);case o.SHORT:return new Int16Array(n,r,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,a);case o.INT:return new Int32Array(n,r,a);case o.UNSIGNED_INT:return new Uint32Array(n,r,a);case o.FLOAT:return new Float32Array(n,r,a);case o.DOUBLE:return new Float64Array(n,r,a)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/CornerType",["./freezeObject"],function(e){"use strict";var t={ROUNDED:0,MITERED:1,BEVELED:2};return e(t)}),define("Core/EllipsoidGeodesic",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){var t=e._uSquared,n=e._ellipsoid.maximumRadius,r=e._ellipsoid.minimumRadius,a=(n-r)/n,i=Math.cos(e._startHeading),o=Math.sin(e._startHeading),u=(1-a)*Math.tan(e._start.latitude),s=1/Math.sqrt(1+u*u),c=s*u,l=Math.atan2(u,i),f=s*o,h=f*f,d=1-h,E=Math.sqrt(d),p=t/4,m=p*p,y=m*p,_=m*m,T=1+p-3*m/4+5*y/4-175*_/64,R=1-p+15*m/8-35*y/8,A=1-3*p+35*m/4,v=1-5*p,S=T*l-R*Math.sin(2*l)*p/2-A*Math.sin(4*l)*m/16-v*Math.sin(6*l)*y/48-5*Math.sin(8*l)*_/512,N=e._constants;N.a=n,N.b=r,N.f=a,N.cosineHeading=i,N.sineHeading=o,N.tanU=u,N.cosineU=s,N.sineU=c,N.sigma=l,N.sineAlpha=f,N.sineSquaredAlpha=h,N.cosineSquaredAlpha=d,N.cosineAlpha=E,N.u2Over4=p,N.u4Over16=m,N.u6Over64=y,N.u8Over256=_,N.a0=T,N.a1=R,N.a2=A,N.a3=v,N.distanceRatio=S}function c(e,t){return e*t*(4+e*(4-3*t))/16}function l(e,t,n,r,a,i,o){var u=c(e,n);return(1-u)*e*t*(r+u*a*(o+u*i*(2*o*o-1)))}function f(e,t,n,r,a,i,o){var s,c,f,h,d,E=(t-n)/t,p=i-r,m=Math.atan((1-E)*Math.tan(a)),y=Math.atan((1-E)*Math.tan(o)),_=Math.cos(m),T=Math.sin(m),R=Math.cos(y),A=Math.sin(y),v=_*R,S=_*A,N=T*A,g=T*R,I=p,O=u.TWO_PI,M=Math.cos(I),x=Math.sin(I);do{M=Math.cos(I),x=Math.sin(I);var w=S-g*M;f=Math.sqrt(R*R*x*x+w*w),c=N+v*M,s=Math.atan2(f,c);var C;0===f?(C=0,h=1):(C=v*x/f,h=1-C*C),O=I,d=c-2*N/h,isNaN(d)&&(d=0),I=p+l(E,C,h,s,f,c,d)}while(Math.abs(I-O)>u.EPSILON12);var P=h*(t*t-n*n)/(n*n),D=1+P*(4096+P*(P*(320-175*P)-768))/16384,U=P*(256+P*(P*(74-47*P)-128))/1024,L=d*d,F=U*f*(d+U*(c*(2*L-1)-U*d*(4*f*f-3)*(4*L-3)/6)/4),z=n*D*(s-F),B=Math.atan2(R*x,S-g*M),b=Math.atan2(_*x,S*M-g);e._distance=z,e._startHeading=B,e._endHeading=b,e._uSquared=P}function h(n,r,a,i){e.normalize(i.cartographicToCartesian(r,p),E),e.normalize(i.cartographicToCartesian(a,p),p);f(n,i.maximumRadius,i.minimumRadius,r.longitude,r.latitude,a.longitude,a.latitude),n._start=t.clone(r,n._start),n._end=t.clone(a,n._end),n._start.height=0,n._end.height=0,s(n)}function d(e,a,i){var u=n(i,o.WGS84);this._ellipsoid=u,this._start=new t,this._end=new t,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,r(e)&&r(a)&&h(this,e,a,u)}var E=new e,p=new e;return a(d.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return this._startHeading}},endHeading:{get:function(){return this._endHeading}}}),d.prototype.setEndPoints=function(e,t){h(this,e,t,this._ellipsoid)},d.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},d.prototype.interpolateUsingSurfaceDistance=function(e,n){var a=this._constants,i=a.distanceRatio+e/a.b,o=Math.cos(2*i),u=Math.cos(4*i),s=Math.cos(6*i),c=Math.sin(2*i),f=Math.sin(4*i),h=Math.sin(6*i),d=Math.sin(8*i),E=i*i,p=i*E,m=a.u8Over256,y=a.u2Over4,_=a.u6Over64,T=a.u4Over16,R=2*p*m*o/3+i*(1-y+7*T/4-15*_/4+579*m/64-(T-15*_/4+187*m/16)*o-(5*_/4-115*m/16)*u-29*m*s/16)+(y/2-T+71*_/32-85*m/16)*c+(5*T/16-5*_/4+383*m/96)*f-E*((_-11*m/2)*c+5*m*f/2)+(29*_/96-29*m/16)*h+539*m*d/1536,A=Math.asin(Math.sin(R)*a.cosineAlpha),v=Math.atan(a.a/a.b*Math.tan(A));R-=a.sigma;var S=Math.cos(2*a.sigma+R),N=Math.sin(R),g=Math.cos(R),I=a.cosineU*g,O=a.sineU*N,M=Math.atan2(N*a.sineHeading,I-O*a.cosineHeading),x=M-l(a.f,a.sineAlpha,a.cosineSquaredAlpha,R,N,g,S);return r(n)?(n.longitude=this._start.longitude+x,n.latitude=v,n.height=0,n):new t(this._start.longitude+x,v,0)},d}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function n(e,n,r){var a=e+n;return t.sign(e)!==t.sign(n)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(n)))<r?0:a}var r={};return r.computeDiscriminant=function(e,t,n){var r=t*t-4*e*n;return r},r.computeRealRoots=function(e,r,a){var i;if(0===e)return 0===r?[]:[-a/r];if(0===r){if(0===a)return[0,0];var o=Math.abs(a),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,i<0)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-r/e,i<0?[i,0]:[0,i];var c=r*r,l=4*e*a,f=n(c,-l,t.EPSILON14);if(f<0)return[];var h=-.5*n(r,t.sign(r)*Math.sqrt(f),t.EPSILON14);return r>0?[h/e,a/h]:[a/h,h/e]},r}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function n(e,t,n,r){var a,i,o=e,u=t/3,s=n/3,c=r,l=o*s,f=u*c,h=u*u,d=s*s,E=o*s-h,p=o*c-u*s,m=u*c-d,y=4*E*m-p*p;if(y<0){var _,T,R;h*f>=l*d?(_=o,T=E,R=-2*u*E+o*p):(_=c,T=m,R=-c*p+2*s*m);var A=R<0?-1:1,v=-A*Math.abs(_)*Math.sqrt(-y);i=-R+v;var S=i/2,N=S<0?-Math.pow(-S,1/3):Math.pow(S,1/3),g=i===v?-N:-T/N;return a=T<=0?N+g:-R/(N*N+g*g+T),h*f>=l*d?[(a-u)/o]:[-c/(a+s)]}var I=E,O=-2*u*E+o*p,M=m,x=-c*p+2*s*m,w=Math.sqrt(y),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*w,-O)/3);a=2*Math.sqrt(-I);var D=Math.cos(P);i=a*D;var U=a*(-D/2-C*Math.sin(P)),L=i+U>2*u?i-u:U-u,F=o,z=L/F;P=Math.abs(Math.atan2(c*w,-x)/3),a=2*Math.sqrt(-M),D=Math.cos(P),i=a*D,U=a*(-D/2-C*Math.sin(P));var B=-c,b=i+U<2*s?i+s:U+s,G=B/b,q=F*b,W=-L*b-F*B,X=L*B,V=(s*W-u*X)/(-u*W+s*q);return z<=V?z<=G?V<=G?[z,V,G]:[z,G,V]:[G,z,V]:z<=G?[V,z,G]:V<=G?[V,G,z]:[G,V,z]}var r={};return r.computeDiscriminant=function(e,t,n,r){var a=e*e,i=t*t,o=n*n,u=r*r,s=18*e*t*n*r+i*o-27*a*u-4*(e*o*n+i*t*r);return s},r.computeRealRoots=function(e,r,a,i){var o,u;if(0===e)return t.computeRealRoots(r,a,i);if(0===r){if(0===a){if(0===i)return[0,0,0];u=-i/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===i?(o=t.computeRealRoots(e,0,a),0===o.Length?[0]:[o[0],0,o[1]]):n(e,0,a,i)}return 0===a?0===i?(u=-r/e,u<0?[u,0,0]:[0,0,u]):n(e,r,0,i):0===i?(o=t.computeRealRoots(e,r,a),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):n(e,r,a,i)},r}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,n,r){"use strict";function a(t,a,i,o){var u=t*t,s=a-3*u/8,c=i-a*t/2+u*t/8,l=o-i*t/4+a*u/16-3*u*u/256,f=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(f.length>0){var h=-t/4,d=f[f.length-1];if(Math.abs(d)<n.EPSILON14){var E=r.computeRealRoots(1,s,l);if(2===E.length){var p,m=E[0],y=E[1];if(m>=0&&y>=0){var _=Math.sqrt(m),T=Math.sqrt(y);return[h-T,h-_,h+_,h+T]}if(m>=0&&y<0)return p=Math.sqrt(m),[h-p,h+p];if(m<0&&y>=0)return p=Math.sqrt(y),[h-p,h+p]}return[]}if(d>0){var R=Math.sqrt(d),A=(s+d-c/R)/2,v=(s+d+c/R)/2,S=r.computeRealRoots(1,R,A),N=r.computeRealRoots(1,-R,v);return 0!==S.length?(S[0]+=h,S[1]+=h,0!==N.length?(N[0]+=h,N[1]+=h,S[1]<=N[0]?[S[0],S[1],N[0],N[1]]:N[1]<=S[0]?[N[0],N[1],S[0],S[1]]:S[0]>=N[0]&&S[1]<=N[1]?[N[0],S[0],S[1],N[1]]:N[0]>=S[0]&&N[1]<=S[1]?[S[0],N[0],N[1],S[1]]:S[0]>N[0]&&S[0]<N[1]?[N[0],S[0],N[1],S[1]]:[S[0],N[0],S[1],N[1]]):S):0!==N.length?(N[0]+=h,N[1]+=h,N):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,f=i*t+s-4*o,h=c*o-i*a*t+u,d=e.computeRealRoots(1,l,f,h);if(d.length>0){var E,p,m=d[0],y=a-m,_=y*y,T=t/2,R=y/2,A=_-4*o,v=_+4*Math.abs(o),S=c-4*m,N=c+4*Math.abs(m);if(m<0||A*N<S*v){var g=Math.sqrt(S);E=g/2,p=0===g?0:(t*R-i)/g}else{var I=Math.sqrt(A);E=0===I?0:(t*R-i)/I,p=I/2}var O,M;0===T&&0===E?(O=0,M=0):n.sign(T)===n.sign(E)?(O=T+E,M=m/O):(M=T-E,O=m/M);var x,w;0===R&&0===p?(x=0,w=0):n.sign(R)===n.sign(p)?(x=R+p,w=o/x):(w=R-p,x=o/w);var C=r.computeRealRoots(1,O,x),P=r.computeRealRoots(1,M,w);if(0!==C.length)return 0!==P.length?C[1]<=P[0]?[C[0],C[1],P[0],P[1]]:P[1]<=C[0]?[P[0],P[1],C[0],C[1]]:C[0]>=P[0]&&C[1]<=P[1]?[P[0],C[0],C[1],P[1]]:P[0]>=C[0]&&P[1]<=C[1]?[C[0],P[0],P[1],C[1]]:C[0]>P[0]&&C[0]<P[1]?[P[0],C[0],P[1],C[1]]:[C[0],P[0],C[1],P[1]]:C;if(0!==P.length)return P}return[]}var o={};return o.computeDiscriminant=function(e,t,n,r,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=n*n,l=c*n,f=r*r,h=f*r,d=a*a,E=d*a,p=u*c*f-4*s*h-4*e*l*f+18*e*t*n*h-27*i*f*f+256*o*E+a*(18*s*n*r-4*u*l+16*e*c*c-80*e*t*c*r-6*e*u*f+144*i*n*f)+d*(144*e*u*n-27*u*u-128*i*c-192*i*t*r);return p},o.computeRealRoots=function(t,r,o,u,s){if(Math.abs(t)<n.EPSILON15)return e.computeRealRoots(r,o,u,s);var c=r/t,l=o/t,f=u/t,h=s/t,d=c<0?1:0;switch(d+=l<0?d+1:d,d+=f<0?d+1:d,d+=h<0?d+1:d){case 0:return a(c,l,f,h);case 1:return i(c,l,f,h);case 2:return i(c,l,f,h);case 3:return a(c,l,f,h);case 4:return a(c,l,f,h);case 5:return i(c,l,f,h);case 6:return a(c,l,f,h);case 7:return a(c,l,f,h);case 8:return i(c,l,f,h);case 9:return a(c,l,f,h);case 10:return a(c,l,f,h);case 11:return i(c,l,f,h);case 12:return a(c,l,f,h);case 13:return a(c,l,f,h);case 14:return a(c,l,f,h);case 15:return a(c,l,f,h);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=e.clone(t(r,e.ZERO)),e.equals(r,e.ZERO)||e.normalize(r,r),this.origin=e.clone(t(n,e.ZERO)),this.direction=r}return a.getPoint=function(t,r,a){return n(a)||(a=new e),a=e.multiplyByScalar(t.direction,r,a),e.add(t.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t,n,r){var a=t*t-4*e*n;if(!(a<0)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return u<s?(r.root0=u,r.root1=s):(r.root0=s,r.root1=u),r}var c=-t/(2*e);if(0!==c)return r.root0=r.root1=c,r}}function f(t,n,a){r(a)||(a={});var i=t.origin,o=t.direction,u=n.center,s=n.radius*n.radius,c=e.subtract(i,u,y),f=e.dot(o,o),h=2*e.dot(o,c),d=e.magnitudeSquared(c)-s,E=l(f,h,d,A);if(r(E))return a.start=E.root0,a.stop=E.root1,a}function h(e,t,n){var r=e+t;return i.sign(e)!==i.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))<n?0:r}function d(t,n,r,a,c){var l,f=a*a,d=c*c,E=(t[o.COLUMN1ROW1]-t[o.COLUMN2ROW2])*d,p=c*(a*h(t[o.COLUMN1ROW0],t[o.COLUMN0ROW1],i.EPSILON15)+n.y),m=t[o.COLUMN0ROW0]*f+t[o.COLUMN2ROW2]*d+a*n.x+r,y=d*h(t[o.COLUMN2ROW1],t[o.COLUMN1ROW2],i.EPSILON15),_=c*(a*h(t[o.COLUMN2ROW0],t[o.COLUMN0ROW2])+n.z),T=[];if(0===_&&0===y){if(l=u.computeRealRoots(E,p,m),0===l.length)return T;var R=l[0],A=Math.sqrt(Math.max(1-R*R,0));if(T.push(new e(a,c*R,c*-A)),T.push(new e(a,c*R,c*A)),2===l.length){var v=l[1],S=Math.sqrt(Math.max(1-v*v,0));T.push(new e(a,c*v,c*-S)),T.push(new e(a,c*v,c*S))}return T}var N=_*_,g=y*y,I=E*E,O=_*y,M=I+g,x=2*(p*E+O),w=2*m*E+p*p-g+N,C=2*(m*p-O),P=m*m-N;if(0===M&&0===x&&0===w&&0===C)return T;l=s.computeRealRoots(M,x,w,C,P);var D=l.length;if(0===D)return T;for(var U=0;U<D;++U){var L,F=l[U],z=F*F,B=Math.max(1-z,0),b=Math.sqrt(B);L=i.sign(E)===i.sign(m)?h(E*z+m,p*F,i.EPSILON12):i.sign(m)===i.sign(p*F)?h(E*z,p*F+m,i.EPSILON12):h(E*z+p*F,m,i.EPSILON12);var G=h(y*F,_,i.EPSILON15),q=L*G;q<0?T.push(new e(a,c*F,c*b)):q>0?T.push(new e(a,c*F,c*-b)):0!==b?(T.push(new e(a,c*F,c*-b)),T.push(new e(a,c*F,c*b)),++U):T.push(new e(a,c*F,c*b))}return T}var E={};E.rayPlane=function(t,n,a){r(a)||(a=new e);var o=t.origin,u=t.direction,s=n.normal,c=e.dot(s,u);if(!(Math.abs(c)<i.EPSILON15)){var l=(-n.distance-e.dot(s,o))/c;if(!(l<0))return a=e.multiplyByScalar(u,l,a),e.add(o,a,a)}};var p=new e,m=new e,y=new e,_=new e,T=new e;E.rayTriangleParametric=function(t,r,a,o,u){u=n(u,!1);var s,c,l,f,h,d=t.origin,E=t.direction,R=e.subtract(a,r,p),A=e.subtract(o,r,m),v=e.cross(E,A,y),S=e.dot(R,v);if(u){if(S<i.EPSILON6)return;if(s=e.subtract(d,r,_),l=e.dot(s,v),l<0||l>S)return;if(c=e.cross(s,R,T),f=e.dot(E,c),f<0||l+f>S)return;h=e.dot(A,c)/S}else{if(Math.abs(S)<i.EPSILON6)return;var N=1/S;if(s=e.subtract(d,r,_),l=e.dot(s,v)*N,l<0||l>1)return;if(c=e.cross(s,R,T),f=e.dot(E,c)*N,f<0||l+f>1)return;h=e.dot(A,c)*N}return h},E.rayTriangle=function(t,n,a,i,o,u){var s=E.rayTriangleParametric(t,n,a,i,o);if(r(s)&&!(s<0))return r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var R=new c;E.lineSegmentTriangle=function(t,n,a,i,o,u,s){var c=R;e.clone(t,c.origin),e.subtract(n,t,c.direction),e.normalize(c.direction,c.direction);var l=E.rayTriangleParametric(c,a,i,o,u);if(!(!r(l)||l<0||l>e.distance(t,n)))return r(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var A={root0:0,root1:0};E.raySphere=function(e,t,n){if(n=f(e,t,n),r(n)&&!(n.stop<0))return n.start=Math.max(n.start,0),n};var v=new c;E.lineSegmentSphere=function(t,n,a,i){var o=v;e.clone(t,o.origin);var u=e.subtract(n,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),i=f(o,a,i),!(!r(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var S=new e,N=new e;E.rayEllipsoid=function(t,n){var r,a,i,o,u,s=n.oneOverRadii,c=e.multiplyComponents(s,t.origin,S),l=e.multiplyComponents(s,t.direction,N),f=e.magnitudeSquared(c),h=e.dot(c,l);if(f>1){if(h>=0)return;var d=h*h;if(r=f-1,a=e.magnitudeSquared(l),i=a*r,d<i)return;if(d>i){o=h*h-i,u=-h+Math.sqrt(o);var E=u/a,p=r/u;return E<p?{start:E,stop:p}:{start:p,stop:E}}var m=Math.sqrt(r/a);return{start:m,stop:m}}return f<1?(r=f-1,a=e.magnitudeSquared(l),i=a*r,o=h*h-i,u=-h+Math.sqrt(o),{start:0,stop:u/a}):h<0?(a=e.magnitudeSquared(l),{start:0,stop:-h/a}):void 0};var g=new e,I=new e,O=new e,M=new e,x=new e,w=new o,C=new o,P=new o,D=new o,U=new o,L=new o,F=new o,z=new e,B=new e,b=new t;E.grazingAltitudeLocation=function(t,n){var a=t.origin,u=t.direction;if(!e.equals(a,e.ZERO)){var s=n.geodeticSurfaceNormal(a,g);if(e.dot(u,s)>=0)return a}var c=r(this.rayEllipsoid(t,n)),l=n.transformPositionToScaledSpace(u,g),f=e.normalize(l,l),h=e.mostOrthogonalAxis(l,M),E=e.normalize(e.cross(h,f,I),I),p=e.normalize(e.cross(f,E,O),O),m=w;m[0]=f.x,m[1]=f.y,m[2]=f.z,m[3]=E.x,m[4]=E.y,m[5]=E.z,m[6]=p.x,m[7]=p.y,m[8]=p.z;var y=o.transpose(m,C),_=o.fromScale(n.radii,P),T=o.fromScale(n.oneOverRadii,D),R=U;R[0]=0,R[1]=-u.z,R[2]=u.y,R[3]=u.z,R[4]=0,R[5]=-u.x,R[6]=-u.y,R[7]=u.x,R[8]=0;var A,v,S=o.multiply(o.multiply(y,T,L),R,L),N=o.multiply(o.multiply(S,_,F),m,F),G=o.multiplyByVector(S,a,x),q=d(N,e.negate(G,g),0,0,1),W=q.length;if(W>0){for(var X=e.clone(e.ZERO,B),V=Number.NEGATIVE_INFINITY,H=0;H<W;++H){A=o.multiplyByVector(_,o.multiplyByVector(m,q[H],z),z);var Y=e.normalize(e.subtract(A,a,M),M),Z=e.dot(Y,u);Z>V&&(V=Z,X=e.clone(A,X))}var k=n.cartesianToCartographic(X,b);return V=i.clamp(V,0,1),v=e.magnitude(e.subtract(X,a,M))*Math.sqrt(1-V*V),v=c?-v:v,k.height=v,n.cartographicToCartesian(k,new e)}};var G=new e;return E.lineSegmentPlane=function(t,n,a,o){r(o)||(o=new e);var u=e.subtract(n,t,G),s=a.normal,c=e.dot(s,u);if(!(Math.abs(c)<i.EPSILON6)){var l=e.dot(s,t),f=-(a.distance+l)/c;if(!(f<0||f>1))return e.multiplyByScalar(u,f,o),e.add(t,o,o),o}},E.trianglePlaneIntersection=function(t,n,r,a){var i=a.normal,o=a.distance,u=e.dot(i,t)+o<0,s=e.dot(i,n)+o<0,c=e.dot(i,r)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var f,h;if(1!==l&&2!==l||(f=new e,h=new e),1===l){if(u)return E.lineSegmentPlane(t,n,a,f),E.lineSegmentPlane(t,r,a,h),{positions:[t,n,r,f,h],indices:[0,3,4,1,2,4,1,4,3]};if(s)return E.lineSegmentPlane(n,r,a,f),E.lineSegmentPlane(n,t,a,h), -{positions:[t,n,r,f,h],indices:[1,3,4,2,0,4,2,4,3]};if(c)return E.lineSegmentPlane(r,t,a,f),E.lineSegmentPlane(r,n,a,h),{positions:[t,n,r,f,h],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return E.lineSegmentPlane(n,t,a,f),E.lineSegmentPlane(r,t,a,h),{positions:[t,n,r,f,h],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return E.lineSegmentPlane(r,n,a,f),E.lineSegmentPlane(t,n,a,h),{positions:[t,n,r,f,h],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return E.lineSegmentPlane(t,r,a,f),E.lineSegmentPlane(n,r,a,h),{positions:[t,n,r,f,h],indices:[0,1,4,0,4,3,2,3,4]}}},E}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";function a(t,n){this.normal=e.clone(t),this.distance=n}a.fromPointNormal=function(n,r,i){var o=-e.dot(r,n);return t(i)?(e.clone(r,i.normal),i.distance=o,i):new a(r,o)};var i=new e;return a.fromCartesian4=function(n,r){var o=e.fromCartesian4(n,i),u=n.w;return t(r)?(e.clone(o,r.normal),r.distance=u,r):new a(o,u)},a.getPointDistance=function(t,n){return e.dot(t.normal,n)+t.distance},a.ORIGIN_XY_PLANE=r(new a(e.UNIT_Z,0)),a.ORIGIN_YZ_PLANE=r(new a(e.UNIT_X,0)),a.ORIGIN_ZX_PLANE=r(new a(e.UNIT_Y,0)),a}),define("Core/PolylinePipeline",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidGeodesic","./IntersectionTests","./isArray","./Math","./Matrix4","./Plane"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(e,t,n){var r=N;r.length=e;var a;if(t===n){for(a=0;a<e;a++)r[a]=t;return r}var i=n-t,o=i/e;for(a=0;a<e;a++){var u=t+a*o;r[a]=u}return r}function d(t,n,r,a,i,o,u,s){var c=a.scaleToGeodeticSurface(t,M),l=a.scaleToGeodeticSurface(n,x),f=E.numberOfPoints(t,n,r),d=a.cartesianToCartographic(c,g),p=a.cartesianToCartographic(l,I),m=h(f,i,o);w.setEndPoints(d,p);var y=w.surfaceDistance/f,_=s;d.height=i;var T=a.cartographicToCartesian(d,O);e.pack(T,u,_),_+=3;for(var R=1;R<f;R++){var A=w.interpolateUsingSurfaceDistance(R*y,I);A.height=m[R],T=a.cartographicToCartesian(A,O),e.pack(T,u,_),_+=3}return _}var E={};E.numberOfPoints=function(t,n,r){var a=e.distance(t,n);return Math.ceil(a/r)};var p=new t;E.extractHeights=function(e,t){for(var n=e.length,r=new Array(n),a=0;a<n;a++){var i=e[a];r[a]=t.cartesianToCartographic(i,p).height}return r};var m=new l,y=new e,_=new e,T=new f(e.ZERO,0),R=new e,A=new f(e.ZERO,0),v=new e,S=new e,N=[],g=new t,I=new t,O=new e,M=new e,x=new e,w=new o;return E.wrapLongitude=function(t,a){var i=[],o=[];if(r(t)&&t.length>0){a=n(a,l.IDENTITY);var s=l.inverseTransformation(a,m),c=l.multiplyByPoint(s,e.ZERO,y),h=l.multiplyByPointAsVector(s,e.UNIT_Y,_),d=f.fromPointNormal(c,h,T),E=l.multiplyByPointAsVector(s,e.UNIT_X,R),p=f.fromPointNormal(c,E,A),N=1;i.push(e.clone(t[0]));for(var g=i[0],I=t.length,O=1;O<I;++O){var M=t[O];if(f.getPointDistance(p,g)<0||f.getPointDistance(p,M)<0){var x=u.lineSegmentPlane(g,M,d,v);if(r(x)){var w=e.multiplyByScalar(h,5e-9,S);f.getPointDistance(d,g)<0&&e.negate(w,w),i.push(e.add(x,w,new e)),o.push(N+1),e.negate(w,w),i.push(e.add(x,w,new e)),N=1}}i.push(e.clone(t[O])),N++,g=M}o.push(N)}return{positions:i,lengths:o}},E.generateArc=function(t){r(t)||(t={});var a=t.positions,o=a.length,u=n(t.ellipsoid,i.WGS84),l=n(t.height,0),f=s(l);if(o<1)return[];if(1===o){var h=u.scaleToGeodeticSurface(a[0],M);if(l=f?l[0]:l,0!==l){var p=u.geodeticSurfaceNormal(h,O);e.multiplyByScalar(p,l,p),e.add(h,p,h)}return[h.x,h.y,h.z]}var m=t.minDistance;if(!r(m)){var y=n(t.granularity,c.RADIANS_PER_DEGREE);m=c.chordLength(y,u.maximumRadius)}var _,T=0;for(_=0;_<o-1;_++)T+=E.numberOfPoints(a[_],a[_+1],m);var R=3*(T+1),A=new Array(R),v=0;for(_=0;_<o-1;_++){var S=a[_],I=a[_+1],x=f?l[_]:l,w=f?l[_+1]:l;v=d(S,I,m,u,x,w,A,v)}N.length=0;var C=a[o-1],P=u.cartesianToCartographic(C,g);P.height=f?l[o-1]:l;var D=u.cartographicToCartesian(P,O);return e.pack(D,A,R-3),A},E.generateCartesianArc=function(t){for(var n=E.generateArc(t),r=n.length/3,a=new Array(r),i=0;i<r;i++)a[i]=e.unpack(n,3*i);return a},E}),define("Core/Cartesian2",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a){"use strict";function i(t,n){this.x=e(t,0),this.y=e(n,0)}i.fromElements=function(e,n,r){return t(r)?(r.x=e,r.y=n,r):new i(e,n)},i.clone=function(e,n){if(t(e))return t(n)?(n.x=e.x,n.y=e.y,n):new i(e.x,e.y)},i.fromCartesian3=i.clone,i.fromCartesian4=i.clone,i.packedLength=2,i.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r]=t.y,n},i.unpack=function(n,r,a){return r=e(r,0),t(a)||(a=new i),a.x=n[r++],a.y=n[r],a},i.packArray=function(e,n){var r=e.length;t(n)?n.length=2*r:n=new Array(2*r);for(var a=0;a<r;++a)i.pack(e[a],n,2*a);return n},i.unpackArray=function(e,n){var r=e.length;t(n)?n.length=r/2:n=new Array(r/2);for(var a=0;a<r;a+=2){var o=a/2;n[o]=i.unpack(e,a,n[o])}return n},i.fromArray=i.unpack,i.maximumComponent=function(e){return Math.max(e.x,e.y)},i.minimumComponent=function(e){return Math.min(e.x,e.y)},i.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},i.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},i.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},i.magnitude=function(e){return Math.sqrt(i.magnitudeSquared(e))};var o=new i;i.distance=function(e,t){return i.subtract(e,t,o),i.magnitude(o)},i.distanceSquared=function(e,t){return i.subtract(e,t,o),i.magnitudeSquared(o)},i.normalize=function(e,t){var n=i.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t},i.dot=function(e,t){return e.x*t.x+e.y*t.y},i.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n},i.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n},i.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n},i.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n},i.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n},i.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n},i.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},i.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var u=new i;i.lerp=function(e,t,n,r){return i.multiplyByScalar(t,n,u),r=i.multiplyByScalar(e,1-n,r),i.add(u,r,r)};var s=new i,c=new i;i.angleBetween=function(e,t){return i.normalize(e,s),i.normalize(t,c),a.acosClamped(i.dot(s,c))};var l=new i;return i.mostOrthogonalAxis=function(e,t){var n=i.normalize(e,l);return i.abs(n,n),t=n.x<=n.y?i.clone(i.UNIT_X,t):i.clone(i.UNIT_Y,t)},i.equals=function(e,n){return e===n||t(e)&&t(n)&&e.x===n.x&&e.y===n.y},i.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},i.equalsEpsilon=function(e,n,r,i){return e===n||t(e)&&t(n)&&a.equalsEpsilon(e.x,n.x,r,i)&&a.equalsEpsilon(e.y,n.y,r,i)},i.ZERO=r(new i(0,0)),i.UNIT_X=r(new i(1,0)),i.UNIT_Y=r(new i(0,1)),i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i.prototype.equalsEpsilon=function(e,t,n){return i.equalsEpsilon(this,e,t,n)},i.prototype.toString=function(){return"("+this.x+", "+this.y+")"},i}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Intersect"],function(e,t,n,r,a){"use strict";function i(r,a,i){this.minimum=e.clone(t(r,e.ZERO)),this.maximum=e.clone(t(a,e.ZERO)),n(i)?i=e.clone(i):(i=e.add(this.minimum,this.maximum,new e),e.multiplyByScalar(i,.5,i)),this.center=i}i.fromPoints=function(t,r){if(n(r)||(r=new i),!n(t)||0===t.length)return r.minimum=e.clone(e.ZERO,r.minimum),r.maximum=e.clone(e.ZERO,r.maximum),r.center=e.clone(e.ZERO,r.center),r;for(var a=t[0].x,o=t[0].y,u=t[0].z,s=t[0].x,c=t[0].y,l=t[0].z,f=t.length,h=1;h<f;h++){var d=t[h],E=d.x,p=d.y,m=d.z;a=Math.min(E,a),s=Math.max(E,s),o=Math.min(p,o),c=Math.max(p,c),u=Math.min(m,u),l=Math.max(m,l)}var y=r.minimum;y.x=a,y.y=o,y.z=u;var _=r.maximum;_.x=s,_.y=c,_.z=l;var T=e.add(y,_,r.center);return e.multiplyByScalar(T,.5,T),r},i.clone=function(t,r){if(n(t))return n(r)?(r.minimum=e.clone(t.minimum,r.minimum),r.maximum=e.clone(t.maximum,r.maximum),r.center=e.clone(t.center,r.center),r):new i(t.minimum,t.maximum)},i.equals=function(t,r){return t===r||n(t)&&n(r)&&e.equals(t.center,r.center)&&e.equals(t.minimum,r.minimum)&&e.equals(t.maximum,r.maximum)};var o=new e;return i.intersectPlane=function(t,n){o=e.subtract(t.maximum,t.minimum,o);var r=e.multiplyByScalar(o,.5,o),i=n.normal,u=r.x*Math.abs(i.x)+r.y*Math.abs(i.y)+r.z*Math.abs(i.z),s=e.dot(t.center,i)+n.distance;return s-u>0?a.INSIDE:s+u<0?a.OUTSIDE:a.INTERSECTING},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.intersectPlane=function(e){return i.intersectPlane(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,n,r,a){return t(e).then(n,r,a)}function t(e){var t,n;return e instanceof r?t=e:u(e)?(n=o(),e.then(function(e){n.resolve(e)},function(e){n.reject(e)},function(e){n.progress(e)}),t=n.promise):t=a(e),t}function n(t){return e(t,i)}function r(e){this.then=e}function a(e){var n=new r(function(n){try{return t(n?n(e):e)}catch(e){return i(e)}});return n}function i(e){var n=new r(function(n,r){try{return r?t(r(e)):i(e)}catch(e){return i(e)}});return n}function o(){function e(e,t,n){return h(e,t,n)}function n(e){return E(e)}function a(e){return E(i(e))}function u(e){return d(e)}var s,c,l,f,h,d,E;return c=new r(e),s={then:e,resolve:n,reject:a,progress:u,promise:c,resolver:{resolve:n,reject:a,progress:u}},l=[],f=[],h=function(e,t,n){var r,a;return r=o(),a="function"==typeof n?function(e){try{r.progress(n(e))}catch(e){r.progress(e)}}:function(e){r.progress(e)},l.push(function(n){n.then(e,t).then(r.resolve,r.reject,a)}),f.push(a),r.promise},d=function(e){return p(f,e),e},E=function(e){return e=t(e),h=e.then,E=t,d=y,p(l,e),f=l=A,e},s}function u(e){return e&&"function"==typeof e.then}function s(t,n,r,a,i){return m(2,arguments),e(t,function(t){function u(e){p(e)}function s(e){E(e)}var c,l,f,h,d,E,p,m,_,T;if(_=t.length>>>0,c=Math.max(0,Math.min(n,_)),f=[],l=_-c+1,h=[],d=o(),c)for(m=d.progress,p=function(e){h.push(e),--l||(E=p=y,d.reject(h))},E=function(e){f.push(e),--c||(E=p=y,d.resolve(f))},T=0;T<_;++T)T in t&&e(t[T],s,u,m);else d.resolve(f);return d.then(r,a,i)})}function c(e,t,n,r){function a(e){return t?t(e[0]):e[0]}return s(e,1,a,n,r)}function l(e,t,n,r){return m(1,arguments),h(e,_).then(t,n,r)}function f(){return h(arguments,_)}function h(t,n){return e(t,function(t){var r,a,i,u,s,c;if(i=a=t.length>>>0,r=[],c=o(),i)for(u=function(t,a){e(t,n).then(function(e){r[a]=e,--i||c.resolve(r)},c.reject)},s=0;s<a;s++)s in t?u(t[s],s):--i;else c.resolve(r);return c.promise})}function d(t,n){var r=R.call(arguments,1);return e(t,function(t){var a;return a=t.length,r[0]=function(t,r,i){return e(t,function(t){return e(r,function(e){return n(t,e,i,a)})})},T.apply(t,r)})}function E(t,n,r){var a=arguments.length>2;return e(t,function(e){return e=a?r:e,n.resolve(e),e},function(e){return n.reject(e),i(e)},n.progress)}function p(e,t){for(var n,r=0;n=e[r++];)n(t)}function m(e,t){for(var n,r=t.length;r>e;)if(n=t[--r],null!=n&&"function"!=typeof n)throw new Error("arg "+r+" must be a function")}function y(){}function _(e){return e}var T,R,A;return e.defer=o,e.resolve=t,e.reject=n,e.join=f,e.all=l,e.map=h,e.reduce=d,e.any=c,e.some=s,e.chain=E,e.isPromise=u,r.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(A,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return l(t,function(t){return e.apply(A,t)})})}},R=[].slice,T=[].reduce||function(e){var t,n,r,a,i;if(i=0,t=Object(this),a=t.length>>>0,n=arguments,n.length<=1)for(;;){if(i in t){r=t[i++];break}if(++i>=a)throw new TypeError}else r=n[1];for(;i<a;++i)i in t&&(r=e(r,t[i],i,t));return r},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n,r){t(a[n])||(a[n]=!0,console.log(e(r,n)))}var a={};return r.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.",r}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,n){"use strict";function r(e,t){n(e,t)}return r}),define("Core/binarySearch",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e,t,n){for(var r,a,i=0,o=e.length-1;i<=o;)if(r=~~((i+o)/2),a=n(e[r],t),a<0)i=r+1;else{if(!(a>0))return r;o=r-1}return~(o+1)}return n}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,n,r,a){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=r,this.ut1MinusUtc=a}return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,n=0,r=t[n++],a=function(e,t,n,r){n||(n=" ");var a=e.length>=t?"":Array(1+t-e.length>>>0).join(n);return r?e+a:a+e},i=function(e,t,n,r,i,o){var u=r-e.length;return u>0&&(e=n||!i?a(e,r,o,n):e.slice(0,t.length)+a("",u,"0",!0)+e.slice(t.length)),e},o=function(e,t,n,r,o,u,s){var c=e>>>0;return n=n&&c&&{2:"0b",8:"0",16:"0x"}[t]||"",e=n+a(c.toString(t),u||0,"0",!1),i(e,n,r,o,s)},u=function(e,t,n,r,a,o){return null!=r&&(e=e.slice(0,r)),i(e,"",t,n,a,o)},s=function(e,r,s,c,l,f,h){var d,E,p,m,y;if("%%"==e)return"%";for(var _=!1,T="",R=!1,A=!1,v=" ",S=s.length,N=0;s&&N<S;N++)switch(s.charAt(N)){case" ":T=" ";break;case"+":T="+";break;case"-":_=!0;break;case"'":v=s.charAt(N+1);break;case"0":R=!0;break;case"#":A=!0}if(c=c?"*"==c?+t[n++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,c<0&&(c=-c,_=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(f=f?"*"==f?+t[n++]:"*"==f.charAt(0)?+t[f.slice(1,-1)]:+f:"fFeE".indexOf(h)>-1?6:"d"==h?0:void 0,y=r?t[r.slice(0,-1)]:t[n++],h){case"s":return u(String(y),_,c,f,R,v);case"c":return u(String.fromCharCode(+y),_,c,f,R);case"b":return o(y,2,A,_,c,f,R);case"o":return o(y,8,A,_,c,f,R);case"x":return o(y,16,A,_,c,f,R);case"X":return o(y,16,A,_,c,f,R).toUpperCase();case"u":return o(y,10,A,_,c,f,R);case"i":case"d":return d=+y||0,d=Math.round(d-d%1),E=d<0?"-":T,y=E+a(String(Math.abs(d)),f,"0",!1),i(y,E,_,c,R);case"e":case"E":case"f":case"F":case"g":case"G":return d=+y,E=d<0?"-":T,p=["toExponential","toFixed","toPrecision"]["efg".indexOf(h.toLowerCase())],m=["toString","toUpperCase"]["eEfFgG".indexOf(h)%2],y=E+Math.abs(d)[p](f),i(y,E,_,c,R)[m]();default:return e}};return r.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,n,r,a,i,o,u){this.year=e,this.month=t,this.day=n,this.hour=r,this.minute=a,this.second=i,this.millisecond=o,this.isLeapSecond=u}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e(t)}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t){return p.compare(e.julianDate,t.julianDate)}function f(e){T.julianDate=e;var n=p.leapSeconds,r=t(n,T,l);r<0&&(r=~r),r>=n.length&&(r=n.length-1);var a=n[r].offset;if(r>0){var i=p.secondsDifference(n[r].julianDate,e);i>a&&(r--,a=n[r].offset)}p.addSeconds(e,a,e)}function h(e,n){T.julianDate=e;var r=p.leapSeconds,a=t(r,T,l);if(a<0&&(a=~a),0===a)return p.addSeconds(e,-r[0].offset,n);if(a>=r.length)return p.addSeconds(e,-r[a-1].offset,n);var i=p.secondsDifference(r[a].julianDate,e);return 0===i?p.addSeconds(e,-r[a].offset,n):i<=1?void 0:p.addSeconds(e,-r[--a].offset,n)}function d(e,t,n){var r=t/s.SECONDS_PER_DAY|0;return e+=r,t-=s.SECONDS_PER_DAY*r,t<0&&(e--,t+=s.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function E(e,t,n,r,a,i,o){var u=(t-14)/12|0,c=e+4800+u,l=(1461*c/4|0)+(367*(t-2-12*u)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;r-=12,r<0&&(r+=24);var f=i+(r*s.SECONDS_PER_HOUR+a*s.SECONDS_PER_MINUTE+o*s.SECONDS_PER_MILLISECOND);return f>=43200&&(l-=1),[l,f]}function p(e,t,r){this.dayNumber=void 0,this.secondsOfDay=void 0,e=n(e,0),t=n(t,0),r=n(r,c.UTC);var a=0|e;t+=(e-a)*s.SECONDS_PER_DAY,d(a,t,this),r===c.UTC&&f(this)}var m=new i,y=[31,28,31,30,31,30,31,31,30,31,30,31],_=29,T=new u,R=/^(\d{4})$/,A=/^(\d{4})-(\d{2})$/,v=/^(\d{4})-?(\d{3})$/,S=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,N=/^(\d{4})-?(\d{2})-?(\d{2})$/,g=/([Z+\-])?(\d{2})?:?(\d{2})?$/,I=/^(\d{2})(\.\d+)?/.source+g.source,O=/^(\d{2}):?(\d{2})(\.\d+)?/.source+g.source,M=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+g.source;p.fromDate=function(e,t){var n=E(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r(t)?(d(n[0],n[1],t),f(t),t):new p(n[0],n[1],c.UTC)},p.fromIso8601=function(e,t){e=e.replace(",",".");var n,a,i,u=e.split("T"),s=1,l=1,h=0,m=0,T=0,g=0,x=u[0],w=u[1];if(u=x.match(N),null!==u)n=+u[1],s=+u[2],l=+u[3];else if(u=x.match(A),null!==u)n=+u[1],s=+u[2];else if(u=x.match(R),null!==u)n=+u[1];else{var C;if(u=x.match(v),null!==u)n=+u[1],C=+u[2],i=o(n);else if(u=x.match(S),null!==u){n=+u[1];var P=+u[2],D=+u[3]||0,U=new Date(Date.UTC(n,0,4));C=7*P+D-U.getUTCDay()-3}a=new Date(Date.UTC(n,0,1)),a.setUTCDate(C),s=a.getUTCMonth()+1,l=a.getUTCDate()}i=o(n);var L;if(r(w)){u=w.match(M),null!==u?(h=+u[1],m=+u[2],T=+u[3],g=1e3*+(u[4]||0),L=5):(u=w.match(O),null!==u?(h=+u[1],m=+u[2],T=60*+(u[3]||0),L=4):(u=w.match(I),null!==u&&(h=+u[1],m=60*+(u[2]||0),L=3)));var F=u[L],z=+u[L+1],B=+(u[L+2]||0);switch(F){case"+":h-=z,m-=B;break;case"-":h+=z,m+=B;break;case"Z":break;default:m+=new Date(Date.UTC(n,s-1,l,h,m)).getTimezoneOffset()}}else m+=new Date(n,s-1,l).getTimezoneOffset();var b=60===T;for(b&&T--;m>=60;)m-=60,h++;for(;h>=24;)h-=24,l++;for(a=i&&2===s?_:y[s-1];l>a;)l-=a,s++,s>12&&(s-=12,n++),a=i&&2===s?_:y[s-1];for(;m<0;)m+=60,h--;for(;h<0;)h+=24,l--;for(;l<1;)s--,s<1&&(s+=12,n--),a=i&&2===s?_:y[s-1],l+=a;var G=E(n,s,l,h,m,T,g);return r(t)?(d(G[0],G[1],t),f(t)):t=new p(G[0],G[1],c.UTC),b&&p.addSeconds(t,1,t),t},p.now=function(e){return p.fromDate(new Date,e)};var x=new p(0,0,c.TAI);return p.toGregorianDate=function(e,t){var n=!1,a=h(e,x);r(a)||(p.addSeconds(e,-1,x),a=h(x,x),n=!0);var o=a.dayNumber,u=a.secondsOfDay;u>=43200&&(o+=1);var c=o+68569|0,l=4*c/146097|0;c=c-((146097*l+3)/4|0)|0;var f=4e3*(c+1)/1461001|0;c=c-(1461*f/4|0)+31|0;var d=80*c/2447|0,E=c-(2447*d/80|0)|0;c=d/11|0;var m=d+2-12*c|0,y=100*(l-49)+f+c|0,_=u/s.SECONDS_PER_HOUR|0,T=u-_*s.SECONDS_PER_HOUR,R=T/s.SECONDS_PER_MINUTE|0;T-=R*s.SECONDS_PER_MINUTE;var A=0|T,v=(T-A)/s.SECONDS_PER_MILLISECOND;return _+=12,_>23&&(_-=24),n&&(A+=1),r(t)?(t.year=y,t.month=m,t.day=E,t.hour=_,t.minute=R,t.second=A,t.millisecond=v,t.isLeapSecond=n,t):new i(y,m,E,_,R,A,v,n)},p.toDate=function(e){var t=p.toGregorianDate(e,m),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))},p.toIso8601=function(t,n){var a,i=p.toGregorianDate(t,i);return r(n)||0===i.millisecond?r(n)&&0!==n?(a=(.01*i.millisecond).toFixed(n).replace(".","").slice(0,n),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",i.year,i.month,i.day,i.hour,i.minute,i.second):(a=(.01*i.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a))},p.clone=function(e,t){if(r(e))return r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new p(e.dayNumber,e.secondsOfDay,c.TAI)},p.compare=function(e,t){var n=e.dayNumber-t.dayNumber;return 0!==n?n:e.secondsOfDay-t.secondsOfDay},p.equals=function(e,t){return e===t||r(e)&&r(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},p.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(p.secondsDifference(e,t))<=n},p.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},p.secondsDifference=function(e,t){var n=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return n+(e.secondsOfDay-t.secondsOfDay)},p.daysDifference=function(e,t){var n=e.dayNumber-t.dayNumber,r=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return n+r},p.computeTaiMinusUtc=function(e){T.julianDate=e;var n=p.leapSeconds,r=t(n,T,l);return r<0&&(r=~r,--r,r<0&&(r=0)),n[r].offset},p.addSeconds=function(e,t,n){return d(e.dayNumber,e.secondsOfDay+t,n)},p.addMinutes=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return d(e.dayNumber,r,n)},p.addHours=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return d(e.dayNumber,r,n)},p.addDays=function(e,t,n){var r=e.dayNumber+t;return d(r,e.secondsOfDay,n)},p.lessThan=function(e,t){return p.compare(e,t)<0},p.lessThanOrEquals=function(e,t){return p.compare(e,t)<=0},p.greaterThan=function(e,t){return p.compare(e,t)>0},p.greaterThanOrEquals=function(e,t){return p.compare(e,t)>=0},p.prototype.clone=function(e){return p.clone(this,e)},p.prototype.equals=function(e){return p.equals(this,e)},p.prototype.equalsEpsilon=function(e,t){return p.equalsEpsilon(this,e,t)},p.prototype.toString=function(){return p.toIso8601(this)},p.leapSeconds=[new u(new p(2441317,43210,c.TAI),10),new u(new p(2441499,43211,c.TAI),11),new u(new p(2441683,43212,c.TAI),12),new u(new p(2442048,43213,c.TAI),13),new u(new p(2442413,43214,c.TAI),14),new u(new p(2442778,43215,c.TAI),15),new u(new p(2443144,43216,c.TAI),16),new u(new p(2443509,43217,c.TAI),17),new u(new p(2443874,43218,c.TAI),18),new u(new p(2444239,43219,c.TAI),19),new u(new p(2444786,43220,c.TAI),20),new u(new p(2445151,43221,c.TAI),21),new u(new p(2445516,43222,c.TAI),22),new u(new p(2446247,43223,c.TAI),23),new u(new p(2447161,43224,c.TAI),24),new u(new p(2447892,43225,c.TAI),25),new u(new p(2448257,43226,c.TAI),26),new u(new p(2448804,43227,c.TAI),27),new u(new p(2449169,43228,c.TAI),28),new u(new p(2449534,43229,c.TAI),29),new u(new p(2450083,43230,c.TAI),30),new u(new p(2450630,43231,c.TAI),31),new u(new p(2451179,43232,c.TAI),32),new u(new p(2453736,43233,c.TAI),33),new u(new p(2454832,43234,c.TAI),34),new u(new p(2456109,43235,c.TAI),35),new u(new p(2457204,43236,c.TAI),36),new u(new p(2457754,43237,c.TAI),37)],p}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(n,r){if(null===n||"object"!=typeof n)return n;r=e(r,!1);var a=new n.constructor;for(var i in n)if(n.hasOwnProperty(i)){var o=n[i];r&&(o=t(o,r)),a[i]=o}return a}return t}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var n=e.split("\r\n"),r=0;r<n.length;++r){var a=n[r],i=a.indexOf(": ");if(i>0){var o=a.substring(0,i),u=a.substring(i+2);t[o]=u}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function n(e,n,r){this.statusCode=e,this.response=n,this.responseHeaders=r,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return n.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},n}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var n=r.exec(t);this.scheme=n[1],this.authority=n[2],this.path=n[3],this.query=n[4],this.fragment=n[5]}}function t(e){var t=unescape(e);return i.test(t)?t:e.toUpperCase()}function n(e,t,n,r){return(t||"")+n.toLowerCase()+(r||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var r=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(o,n).replace(a,t)),this.path&&(this.path=this.path.replace(a,t)),this.query&&(this.query=this.query.replace(a,t)),this.fragment&&(this.fragment=this.fragment.replace(a,t))};var a=/%[0-9a-z]{2}/gi,i=/[a-zA-Z0-9\-\._~]/,o=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var n=new e;return this.scheme?(n.scheme=this.scheme,n.authority=this.authority,n.path=this.path,n.query=this.query):(n.scheme=t.scheme,this.authority?(n.authority=this.authority,n.path=this.path,n.query=this.query):(n.authority=t.authority,""==this.path?(n.path=t.path,n.query=this.query||t.query):("/"==this.path.charAt(0)?(n.path=this.path,n.removeDotSegments()):(t.authority&&""==t.path?n.path="/"+this.path:n.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,n.removeDotSegments()),n.query=this.query))),n.fragment=this.fragment,n},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),n=[],r=""==t[0];r&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?n.pop():"."!=e&&n.push(e);"."!=e&&".."!=e||n.push(""),r&&n.unshift(""),this.path=n.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n){var r=new e(n);r.normalize();var a=r.getAuthority();if(t(a)){if(a.indexOf("@")!==-1){var i=a.split("@");a=i[1]}if(a.indexOf(":")===-1){var o=r.getScheme();if(t(o)||(o=window.location.protocol,o=o.substring(0,o.length-1)),"http"===o)a+=":80";else{if("https"!==o)return;a+=":443"}}return a}}var a={},i={};return a.add=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])||(i[r]=!0)},a.remove=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])&&delete i[r]},a.contains=function(e){var n=r(e);return!(!t(n)||!t(i[n]))},a.clear=function(){i={}},a}),define("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,n,r,a,i,o){"use strict";function u(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,a=t(n.method,"GET"),i=n.data,o=n.headers,s=n.overrideMimeType;return e(n.url,function(t){var n=e.defer();return u.load(t,r,a,i,o,n,s),n.promise})}function s(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function c(e,t){for(var n=s(e,t),r=new ArrayBuffer(n.length),a=new Uint8Array(r),i=0;i<n.length;i++)a[i]=n.charCodeAt(i);return r}function l(e,n){n=t(n,"");var r=e[1],a=!!e[2],i=e[3];switch(n){case"":case"text":return s(a,i);case"arraybuffer":return c(a,i);case"blob":var o=c(a,i);return new Blob([o],{type:r});case"document":var u=new DOMParser;return u.parseFromString(s(a,i),r);case"json":return JSON.parse(s(a,i))}}var f=/^data:(.*?)(;base64)?,(.*)$/;return u.load=function(e,t,r,u,s,c,h){var d=f.exec(e);if(null!==d)return void c.resolve(l(d,t));var E=new XMLHttpRequest;if(o.contains(e)&&(E.withCredentials=!0),n(h)&&n(E.overrideMimeType)&&E.overrideMimeType(h),E.open(r,e,!0),n(s))for(var p in s)s.hasOwnProperty(p)&&E.setRequestHeader(p,s[p]);n(t)&&(E.responseType=t),E.onload=function(){if(E.status<200||E.status>=300)return void c.reject(new a(E.status,E.response,E.getAllResponseHeaders()));var e=E.response,r=E.responseType;if(!n(e)||n(t)&&r!==t)if("json"===t&&"string"==typeof e)try{c.resolve(JSON.parse(e))}catch(e){c.reject(e)}else(""===r||"document"===r)&&n(E.responseXML)&&E.responseXML.hasChildNodes()?c.resolve(E.responseXML):""!==r&&"text"!==r||!n(E.responseText)?c.reject(new i("Invalid XMLHttpRequest response type.")):c.resolve(E.responseText);else c.resolve(e)},E.onerror=function(e){c.reject(new a)},E.send(u)},u.defaultLoad=u.load,u}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,n){return e({url:t,headers:n})}return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";function a(n,a){return t(a)?t(a.Accept)||(a=e(a),a.Accept=i.Accept):a=i,r(n,a).then(function(e){return JSON.parse(e)})}var i={Accept:"application/json,*/*;q=0.01"};return a}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(t){if(t=n(t,n.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=n(t.addNewLeapSeconds,!0),r(t.data))E(this,t.data);else if(r(t.url)){var a=this;this._downloadPromise=e(s(t.url),function(e){E(a,e)},function(){a._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else E(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function d(e,t){return o.compare(e.julianDate,t)}function E(e,n){if(!r(n.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!r(n.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var a=n.columnNames.indexOf("modifiedJulianDateUtc"),i=n.columnNames.indexOf("xPoleWanderRadians"),s=n.columnNames.indexOf("yPoleWanderRadians"),c=n.columnNames.indexOf("ut1MinusUtcSeconds"),h=n.columnNames.indexOf("xCelestialPoleOffsetRadians"),E=n.columnNames.indexOf("yCelestialPoleOffsetRadians"),p=n.columnNames.indexOf("taiMinusUtcSeconds");if(a<0||i<0||s<0||c<0||h<0||E<0||p<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var m=e._samples=n.samples,y=e._dates=[];e._dateColumn=a,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=h,e._yCelestialPoleOffsetRadiansColumn=E,e._taiMinusUtcSecondsColumn=p,e._columnCount=n.columnNames.length,e._lastIndex=void 0;for(var _,T=e._addNewLeapSeconds,R=0,A=m.length;R<A;R+=e._columnCount){var v=m[R+a],S=m[R+p],N=v+l.MODIFIED_JULIAN_DATE_DIFFERENCE,g=new o(N,S,f.TAI);if(y.push(g),T){if(S!==_&&r(_)){var I=o.leapSeconds,O=t(I,g,d); -if(O<0){var M=new u(g,S);I.splice(~O,0,M)}}_=S}}}function p(e,t,n,r,a){var i=n*r;a.xPoleWander=t[i+e._xPoleWanderRadiansColumn],a.yPoleWander=t[i+e._yPoleWanderRadiansColumn],a.xPoleOffset=t[i+e._xCelestialPoleOffsetRadiansColumn],a.yPoleOffset=t[i+e._yCelestialPoleOffsetRadiansColumn],a.ut1MinusUtc=t[i+e._ut1MinusUtcSecondsColumn]}function m(e,t,n){return t+e*(n-t)}function y(e,t,n,r,a,i,u){var s=e._columnCount;if(i>t.length-1)return u.xPoleWander=0,u.yPoleWander=0,u.xPoleOffset=0,u.yPoleOffset=0,u.ut1MinusUtc=0,u;var c=t[a],l=t[i];if(c.equals(l)||r.equals(c))return p(e,n,a,s,u),u;if(r.equals(l))return p(e,n,i,s,u),u;var f=o.secondsDifference(r,c)/o.secondsDifference(l,c),h=a*s,d=i*s,E=n[h+e._ut1MinusUtcSecondsColumn],y=n[d+e._ut1MinusUtcSecondsColumn],_=y-E;if(_>.5||_<-.5){var T=n[h+e._taiMinusUtcSecondsColumn],R=n[d+e._taiMinusUtcSecondsColumn];T!==R&&(l.equals(r)?E=y:y-=R-T)}return u.xPoleWander=m(f,n[h+e._xPoleWanderRadiansColumn],n[d+e._xPoleWanderRadiansColumn]),u.yPoleWander=m(f,n[h+e._yPoleWanderRadiansColumn],n[d+e._yPoleWanderRadiansColumn]),u.xPoleOffset=m(f,n[h+e._xCelestialPoleOffsetRadiansColumn],n[d+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=m(f,n[h+e._yCelestialPoleOffsetRadiansColumn],n[d+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=m(f,E,y),u}return h.NONE=i({getPromiseToLoad:function(){return e()},compute:function(e,t){return r(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new a(0,0,0,0,0),t}}),h.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},h.prototype.compute=function(e,n){if(r(this._samples)){if(r(n)||(n=new a(0,0,0,0,0)),0===this._samples.length)return n.xPoleWander=0,n.yPoleWander=0,n.xPoleOffset=0,n.yPoleOffset=0,n.ut1MinusUtc=0,n;var i=this._dates,u=this._lastIndex,s=0,l=0;if(r(u)){var f=i[u],h=i[u+1],d=o.lessThanOrEquals(f,e),E=!r(h),p=E||o.greaterThanOrEquals(h,e);if(d&&p)return s=u,!E&&h.equals(e)&&++s,l=s+1,y(this,i,this._samples,e,s,l,n),n}var m=t(i,e,o.compare,this._dateColumn);return m>=0?(m<i.length-1&&i[m+1].equals(e)&&++m,s=m,l=m):(l=~m,s=l-1,s<0&&(s=0)),this._lastIndex=s,y(this,i,this._samples,e,s,l,n),n}if(r(this._dataError))throw new c(this._dataError)},h}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(t,n,r){this.heading=e(t,0),this.pitch=e(n,0),this.roll=e(r,0)}return a.fromQuaternion=function(e,n){t(n)||(n=new a);var r=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return n.heading=-Math.atan2(s,u),n.roll=Math.atan2(o,i),n.pitch=-Math.asin(r),n},a.fromDegrees=function(e,n,i,o){return t(o)||(o=new a),o.heading=e*r.RADIANS_PER_DEGREE,o.pitch=n*r.RADIANS_PER_DEGREE,o.roll=i*r.RADIANS_PER_DEGREE,o},a.clone=function(e,n){if(t(e))return t(n)?(n.heading=e.heading,n.pitch=e.pitch,n.roll=e.roll,n):new a(e.heading,e.pitch,e.roll)},a.equals=function(e,n){return e===n||t(e)&&t(n)&&e.heading===n.heading&&e.pitch===n.pitch&&e.roll===n.roll},a.equalsEpsilon=function(e,n,a,i){return e===n||t(e)&&t(n)&&r.equalsEpsilon(e.heading,n.heading,a,i)&&r.equalsEpsilon(e.pitch,n.pitch,a,i)&&r.equalsEpsilon(e.roll,n.roll,a,i)},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,n){return a.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},a}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=t(r,document.location.href);var a=new e(r),i=new e(n);return i.resolve(a).toString()}return a}),define("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(r,a,i){i=t(i,!0),r instanceof e||(r=new e(r)),a instanceof e||(a=new e(a)),n(a.authority)&&!n(a.scheme)&&("undefined"!=typeof document&&n(document.location)&&n(document.location.href)?a.scheme=new e(document.location.href).scheme:a.scheme=r.scheme);var o=r;a.isAbsolute()&&(o=a);var u="";n(o.scheme)&&(u+=o.scheme+":"),n(o.authority)&&(u+="//"+o.authority,""!==o.path&&"/"!==o.path&&(u=u.replace(/\/?$/,"/"),o.path=o.path.replace(/^\/?/g,""))),u+=o===r?i?r.path.replace(/\/?$/,"/")+a.path.replace(/^\/?/g,""):r.path+a.path:a.path;var s=n(r.query),c=n(a.query);s&&c?u+="?"+r.query+"&"+a.query:s&&!c?u+="?"+r.query:!s&&c&&(u+="?"+a.query);var l=n(a.fragment);return n(r.fragment)&&!l?u+="#"+r.fragment:l&&(u+="#"+a.fragment),u}return a}),define("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","./joinUrls","require"],function(e,t,n,r,a,i){"use strict";function o(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;t<n;++t){var r=e[t].getAttribute("src"),a=E.exec(r);if(null!==a)return a[1]}}function u(){if(t(f))return f;var n;return n="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:o(),f=new e(r(n))}function s(e){return i.toUrl("../"+e)}function c(e){return a(u(),e)}function l(e){t(h)||(h=t(i.toUrl)?s:c),t(d)||(d=document.createElement("a"));var n=h(e);return d.href=n,d.href=d.href,d.href}var f,h,d,E=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return l._cesiumScriptRegex=E,l.setBaseUrl=function(t){f=new e(t).resolve(new e(document.location.href))},l}),define("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,n){this.x=e,this.y=t,this.s=n}return e}),define("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){e=n(e,n.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=n(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=n(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new i(this._sampleZeroJulianEphemerisDate,0,u.TAI),this._stepSizeDays=n(e.stepSizeDays,1),this._samplesPerXysFile=n(e.samplesPerXysFile,1e3),this._totalSamples=n(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,r=this._denominators=new Array(t+1),a=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t),s=0;s<=t;++s){r[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;c<=t;++c)c!==s&&(r[s]*=s-c);r[s]=1/r[s]}this._work=new Array(t+1),this._coef=new Array(t+1)}function c(e,t,n){var r=f;return r.dayNumber=t,r.secondsOfDay=n,i.daysDifference(r,e._sampleZeroDateTT)}function l(n,a){if(n._chunkDownloadsInProgress[a])return n._chunkDownloadsInProgress[a];var i=e.defer();n._chunkDownloadsInProgress[a]=i;var u,s=n._xysFileUrlTemplate;return u=r(s)?s.replace("{0}",a):t("Assets/IAU2006_XYS/IAU2006_XYS_"+a+".json"),e(o(u),function(e){n._chunkDownloadsInProgress[a]=!1;for(var t=n._samples,r=e.samples,o=a*n._samplesPerXysFile*3,u=0,s=r.length;u<s;++u)t[o+u]=r[u];i.resolve()}),i.promise}var f=new i(0,0,u.TAI);return s.prototype.preload=function(t,n,r,a){var i=c(this,t,n),o=c(this,r,a),u=i/this._stepSizeDays-this._interpolationOrder/2|0;u<0&&(u=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var f=u/this._samplesPerXysFile|0,h=s/this._samplesPerXysFile|0,d=[],E=f;E<=h;++E)d.push(l(this,E));return e.all(d)},s.prototype.computeXysRadians=function(e,t,n){var i=c(this,e,t);if(!(i<0)){var o=i/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);s<0&&(s=0);var f=s+u;f>=this._totalSamples&&(f=this._totalSamples-1,s=f-u,s<0&&(s=0));var h=!1,d=this._samples;if(r(d[3*s])||(l(this,s/this._samplesPerXysFile|0),h=!0),r(d[3*f])||(l(this,f/this._samplesPerXysFile|0),h=!0),!h){r(n)?(n.x=0,n.y=0,n.s=0):n=new a(0,0,0);var E,p,m=i-s*this._stepSizeDays,y=this._work,_=this._denominators,T=this._coef,R=this._xTable;for(E=0;E<=u;++E)y[E]=m-R[E];for(E=0;E<=u;++E){for(T[E]=1,p=0;p<=u;++p)p!==E&&(T[E]*=y[p]);T[E]*=_[E];var A=3*(s+E);n.x+=T[E]*d[A++],n.y+=T[E]*d[A++],n.s+=T[E]*d[A]}return n}}}},s}),define("Core/Quaternion",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math","./Matrix3"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,n,r,a){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(a,0)}var c=new e;s.fromAxisAngle=function(t,r,a){var i=r/2,o=Math.sin(i);c=e.normalize(t,c);var u=c.x*o,l=c.y*o,f=c.z*o,h=Math.cos(i);return n(a)?(a.x=u,a.y=l,a.z=f,a.w=h,a):new s(u,l,f,h)};var l=[1,2,0],f=new Array(3);s.fromRotationMatrix=function(e,t){var r,a,i,o,c,h=e[u.COLUMN0ROW0],d=e[u.COLUMN1ROW1],E=e[u.COLUMN2ROW2],p=h+d+E;if(p>0)r=Math.sqrt(p+1),c=.5*r,r=.5/r,a=(e[u.COLUMN1ROW2]-e[u.COLUMN2ROW1])*r,i=(e[u.COLUMN2ROW0]-e[u.COLUMN0ROW2])*r,o=(e[u.COLUMN0ROW1]-e[u.COLUMN1ROW0])*r;else{var m=l,y=0;d>h&&(y=1),E>h&&E>d&&(y=2);var _=m[y],T=m[_];r=Math.sqrt(e[u.getElementIndex(y,y)]-e[u.getElementIndex(_,_)]-e[u.getElementIndex(T,T)]+1);var R=f;R[y]=.5*r,r=.5/r,c=(e[u.getElementIndex(T,_)]-e[u.getElementIndex(_,T)])*r,R[_]=(e[u.getElementIndex(_,y)]+e[u.getElementIndex(y,_)])*r,R[T]=(e[u.getElementIndex(T,y)]+e[u.getElementIndex(y,T)])*r,a=-R[0],i=-R[1],o=-R[2]}return n(t)?(t.x=a,t.y=i,t.z=o,t.w=c,t):new s(a,i,o,c)};var h=new s;s.fromHeadingPitchRoll=function(t,n,r,a){var i=s.fromAxisAngle(e.UNIT_X,r,h),o=s.fromAxisAngle(e.UNIT_Y,-n,a);a=s.multiply(o,i,o);var u=s.fromAxisAngle(e.UNIT_Z,-t,h);return s.multiply(u,a,a)};var d=new e,E=new e,p=new s,m=new s,y=new s;s.packedLength=4,s.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},s.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new s),a.x=e[r],a.y=e[r+1],a.z=e[r+2],a.w=e[r+3],a},s.packedInterpolationLength=3,s.convertPackedArrayForInterpolation=function(e,t,n,r){s.unpack(e,4*n,y),s.conjugate(y,y);for(var a=0,i=n-t+1;a<i;a++){var o=3*a;s.unpack(e,4*(t+a),p),s.multiply(p,y,p),p.w<0&&s.negate(p,p),s.computeAxis(p,d);var u=s.computeAngle(p);r[o]=d.x*u,r[o+1]=d.y*u,r[o+2]=d.z*u}},s.unpackInterpolationResult=function(t,r,a,i,o){n(o)||(o=new s),e.fromArray(t,0,E);var u=e.magnitude(E);return s.unpack(r,4*i,m),0===u?s.clone(s.IDENTITY,p):s.fromAxisAngle(E,u,p),s.multiply(p,m,o)},s.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new s(e.x,e.y,e.z,e.w)},s.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},s.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},s.magnitude=function(e){return Math.sqrt(s.magnitudeSquared(e))},s.normalize=function(e,t){var n=1/s.magnitude(e),r=e.x*n,a=e.y*n,i=e.z*n,o=e.w*n;return t.x=r,t.y=a,t.z=i,t.w=o,t},s.inverse=function(e,t){var n=s.magnitudeSquared(e);return t=s.conjugate(e,t),s.multiplyByScalar(t,1/n,t)},s.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},s.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},s.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},s.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},s.multiply=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=e.w,u=t.x,s=t.y,c=t.z,l=t.w,f=o*u+r*l+a*c-i*s,h=o*s-r*c+a*l+i*u,d=o*c+r*s-a*u+i*l,E=o*l-r*u-a*s-i*c;return n.x=f,n.y=h,n.z=d,n.w=E,n},s.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},s.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},s.computeAxis=function(e,t){var n=e.w;if(Math.abs(n-1)<o.EPSILON6)return t.x=t.y=t.z=0,t;var r=1/Math.sqrt(1-n*n);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},s.computeAngle=function(e){return Math.abs(e.w-1)<o.EPSILON6?0:2*Math.acos(e.w)};var _=new s;s.lerp=function(e,t,n,r){return _=s.multiplyByScalar(t,n,_),r=s.multiplyByScalar(e,1-n,r),s.add(_,r,r)};var T=new s,R=new s,A=new s;s.slerp=function(e,t,n,r){var a=s.dot(e,t),i=t;if(a<0&&(a=-a,i=T=s.negate(t,T)),1-a<o.EPSILON6)return s.lerp(e,i,n,r);var u=Math.acos(a);return R=s.multiplyByScalar(e,Math.sin((1-n)*u),R),A=s.multiplyByScalar(i,Math.sin(n*u),A),r=s.add(R,A,r),s.multiplyByScalar(r,1/Math.sin(u),r)},s.log=function(t,n){var r=o.acosClamped(t.w),a=0;return 0!==r&&(a=r/Math.sin(r)),e.multiplyByScalar(t,a,n)},s.exp=function(t,n){var r=e.magnitude(t),a=0;return 0!==r&&(a=Math.sin(r)/r),n.x=t.x*a,n.y=t.y*a,n.z=t.z*a,n.w=Math.cos(r),n};var v=new e,S=new e,N=new s,g=new s;s.computeInnerQuadrangle=function(t,n,r,a){var i=s.conjugate(n,N);s.multiply(i,r,g);var o=s.log(g,v);s.multiply(i,t,g);var u=s.log(g,S);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),s.exp(o,N),s.multiply(n,N,a)},s.squad=function(e,t,n,r,a,i){var o=s.slerp(e,t,a,N),u=s.slerp(n,r,a,g);return s.slerp(o,u,2*a*(1-a),i)};for(var I=new s,O=1.9011074535173003,M=a.supportsTypedArrays()?new Float32Array(8):[],x=a.supportsTypedArrays()?new Float32Array(8):[],w=a.supportsTypedArrays()?new Float32Array(8):[],C=a.supportsTypedArrays()?new Float32Array(8):[],P=0;P<7;++P){var D=P+1,U=2*D+1;M[P]=1/(D*U),x[P]=D/U}return M[7]=O/136,x[7]=8*O/17,s.fastSlerp=function(e,t,n,r){var a,i=s.dot(e,t);i>=0?a=1:(a=-1,i=-i);for(var o=i-1,u=1-n,c=n*n,l=u*u,f=7;f>=0;--f)w[f]=(M[f]*c-x[f])*o,C[f]=(M[f]*l-x[f])*o;var h=a*n*(1+w[0]*(1+w[1]*(1+w[2]*(1+w[3]*(1+w[4]*(1+w[5]*(1+w[6]*(1+w[7])))))))),d=u*(1+C[0]*(1+C[1]*(1+C[2]*(1+C[3]*(1+C[4]*(1+C[5]*(1+C[6]*(1+C[7])))))))),E=s.multiplyByScalar(e,d,I);return s.multiplyByScalar(t,h,r),s.add(E,r,r)},s.fastSquad=function(e,t,n,r,a,i){var o=s.fastSlerp(e,t,a,N),u=s.fastSlerp(n,r,a,g);return s.fastSlerp(o,u,2*a*(1-a),i)},s.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},s.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.x-t.x)<=r&&Math.abs(e.y-t.y)<=r&&Math.abs(e.z-t.z)<=r&&Math.abs(e.w-t.w)<=r},s.ZERO=i(new s(0,0,0,0)),s.IDENTITY=i(new s(0,0,0,1)),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.x+", "+this.y+", "+this.z+", "+this.w+")"},s}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./defaultValue","./defined","./deprecationWarning","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./HeadingPitchRoll","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,E,p,m,y,_,T,R){"use strict";var A={},v=new n,S=new n,N=new n;A.eastNorthUpToFixedFrame=function(e,t,r){if(m.equalsEpsilon(e.x,0,m.EPSILON14)&&m.equalsEpsilon(e.y,0,m.EPSILON14)){var a=m.sign(e.z);return o(r)?(r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=-a,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=a,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(0,-a,0,e.x,1,0,0,e.y,0,0,a,e.z,0,0,0,1)}var u=v,s=S,c=N;return t=i(t,f.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,c),o(r)?(r[0]=s.x,r[1]=s.y,r[2]=s.z,r[3]=0,r[4]=c.x,r[5]=c.y,r[6]=c.z,r[7]=0,r[8]=u.x,r[9]=u.y,r[10]=u.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(s.x,c.x,u.x,e.x,s.y,c.y,u.y,e.y,s.z,c.z,u.z,e.z,0,0,0,1)};var g=new n,I=new n,O=new n;A.northEastDownToFixedFrame=function(e,t,r){if(m.equalsEpsilon(e.x,0,m.EPSILON14)&&m.equalsEpsilon(e.y,0,m.EPSILON14)){var a=m.sign(e.z);return o(r)?(r[0]=-a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=-a,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(-a,0,0,e.x,0,1,0,e.y,0,0,-a,e.z,0,0,0,1)}var u=g,s=I,c=O;return t=i(t,f.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,c),o(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=s.x,r[5]=s.y,r[6]=s.z,r[7]=0,r[8]=-u.x,r[9]=-u.y,r[10]=-u.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(c.x,s.x,-u.x,e.x,c.y,s.y,-u.y,e.y,c.z,s.z,-u.z,e.z,0,0,0,1)},A.northUpEastToFixedFrame=function(e,t,r){if(m.equalsEpsilon(e.x,0,m.EPSILON14)&&m.equalsEpsilon(e.y,0,m.EPSILON14)){var a=m.sign(e.z);return o(r)?(r[0]=-a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=a,r[7]=0,r[8]=0,r[9]=1,r[10]=0,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(-a,0,0,e.x,0,0,1,e.y,0,a,0,e.z,0,0,0,1)}var u=v,s=S,c=N;return t=i(t,f.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,c),o(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=u.x,r[5]=u.y,r[6]=u.z,r[7]=0,r[8]=s.x,r[9]=s.y,r[10]=s.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(c.x,u.x,s.x,e.x,c.y,u.y,s.y,e.y,c.z,u.z,s.z,e.z,0,0,0,1)},A.northWestUpToFixedFrame=function(e,t,r){if(m.equalsEpsilon(e.x,0,m.EPSILON14)&&m.equalsEpsilon(e.y,0,m.EPSILON14)){var a=m.sign(e.z);return o(r)?(r[0]=-a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=a,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(-a,0,0,e.x,0,-1,0,e.y,0,0,a,e.z,0,0,0,1)}var u=v,s=S,c=N;return t=i(t,f.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,c),o(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=-s.x,r[5]=-s.y,r[6]=-s.z,r[7]=0,r[8]=u.x,r[9]=u.y,r[10]=u.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(c.x,-s.x,u.x,e.x,c.y,-s.y,u.y,e.y,c.z,-s.z,u.z,e.z,0,0,0,1)};var M=new T,x=new n(1,1,1),w=new _;A.headingPitchRollToFixedFrame=function(e,t,r,a,i,o){var s;"object"==typeof t?(i=r,o=a,s=t.heading,r=t.pitch,a=t.roll):(u("headingPitchRollToFixedFrame","headingPitchRollToFixedFrame with separate heading, pitch, and roll arguments was deprecated in 1.27. It will be removed in 1.30. Use a HeadingPitchRoll object."),s=t);var c=T.fromHeadingPitchRoll(s,r,a,M),l=_.fromTranslationQuaternionRotationScale(n.ZERO,c,x,w);return o=A.eastNorthUpToFixedFrame(e,i,o),_.multiply(o,l,o)};var C=new h,P=new _,D=new y;A.headingPitchRollQuaternion=function(e,t,n,r,a,i){var o;"object"==typeof t?(o=t,a=n,i=r):(u("headingPitchRollQuaternion","headingPitchRollQuaternion with separate heading, pitch, and roll arguments was deprecated in 1.27. It will be removed in 1.30. Use a HeadingPitchRoll object."),C.heading=t,C.pitch=n,C.roll=r,o=C);var s=A.headingPitchRollToFixedFrame(e,o,a,P),c=_.getRotation(s,D);return T.fromRotationMatrix(c,i)};var U=24110.54841,L=8640184.812866,F=.093104,z=-62e-7,B=1.1772758384668e-19,b=72921158553e-15,G=m.TWO_PI/86400,q=new p;A.computeTemeToPseudoFixedMatrix=function(e,t){q=p.addSeconds(e,-p.computeTaiMinusUtc(e),q);var n,r=q.dayNumber,a=q.secondsOfDay,i=r-2451545;n=a>=43200?(i+.5)/R.DAYS_PER_JULIAN_CENTURY:(i-.5)/R.DAYS_PER_JULIAN_CENTURY;var u=U+n*(L+n*(F+n*z)),s=u*G%m.TWO_PI,c=b+B*(r-2451545.5),l=(a+.5*R.SECONDS_PER_DAY)%R.SECONDS_PER_DAY,f=s+c*l,h=Math.cos(f),d=Math.sin(f);return o(t)?(t[0]=h,t[1]=-d,t[2]=0,t[3]=d,t[4]=h,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new y(h,d,0,-d,h,0,0,0,1)},A.iau2006XysData=new d,A.earthOrientationParameters=c.NONE;var W=32.184,X=2451545;A.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+W,a=t.stop.dayNumber,i=t.stop.secondsOfDay+W,o=A.iau2006XysData.preload(n,r,a,i),u=A.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},A.computeIcrfToFixedMatrix=function(e,t){o(t)||(t=new y);var n=A.computeFixedToIcrfMatrix(e,t);if(o(n))return y.transpose(n,t)};var V=new E(0,0,0),H=new l(0,0,0,0,0,0),Y=new y,Z=new y;A.computeFixedToIcrfMatrix=function(e,t){o(t)||(t=new y);var n=A.earthOrientationParameters.compute(e,H);if(o(n)){var r=e.dayNumber,a=e.secondsOfDay+W,i=A.iau2006XysData.computeXysRadians(r,a,V);if(o(i)){var u=i.x+n.xPoleOffset,s=i.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-u*u-s*s)),l=Y;l[0]=1-c*u*u,l[3]=-c*u*s,l[6]=u,l[1]=-c*u*s,l[4]=1-c*s*s,l[7]=s,l[2]=-u,l[5]=-s,l[8]=1-c*(u*u+s*s);var f=y.fromRotationZ(-i.s,Z),h=y.multiply(l,f,Y),d=e.dayNumber,E=e.secondsOfDay-p.computeTaiMinusUtc(e)+n.ut1MinusUtc,_=d-2451545,T=E/R.SECONDS_PER_DAY,v=.779057273264+T+.00273781191135448*(_+T);v=v%1*m.TWO_PI;var S=y.fromRotationZ(v,Z),N=y.multiply(h,S,Y),g=Math.cos(n.xPoleWander),I=Math.cos(n.yPoleWander),O=Math.sin(n.xPoleWander),M=Math.sin(n.yPoleWander),x=r-X+a/R.SECONDS_PER_DAY;x/=36525;var w=-47e-6*x*m.RADIANS_PER_DEGREE/3600,C=Math.cos(w),P=Math.sin(w),D=Z;return D[0]=g*C,D[1]=g*P,D[2]=O,D[3]=-I*P+M*O*C,D[4]=I*C+M*O*P,D[5]=-M*g,D[6]=-M*P-I*O*C,D[7]=M*C-I*O*P,D[8]=I*g,y.multiply(N,D,t)}}};var k=new r;A.pointToWindowCoordinates=function(e,t,n,r){return r=A.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},A.pointToGLWindowCoordinates=function(e,n,a,i){o(i)||(i=new t);var u=k;return _.multiplyByVector(e,r.fromElements(a.x,a.y,a.z,1,u),u),r.multiplyByScalar(u,1/u.w,u),_.multiplyByVector(n,u,u),t.fromCartesian4(u,i)};var j=new n,K=new n,J=new n;A.rotationMatrixFromPositionVelocity=function(e,t,r,a){var u=i(r,f.WGS84).geodeticSurfaceNormal(e,j),s=n.cross(t,u,K);n.equalsEpsilon(s,n.ZERO,m.EPSILON6)&&(s=n.clone(n.UNIT_X,s));var c=n.cross(s,t,J);return n.cross(t,c,s),n.negate(s,s),o(a)||(a=new y),a[0]=t.x,a[1]=t.y,a[2]=t.z,a[3]=s.x,a[4]=s.y,a[5]=s.z,a[6]=c.x,a[7]=c.y,a[8]=c.z,a};var Q=new a,$=new n,ee=new n,te=new r,ne=new r,re=new r,ae=new r,ie=new r,oe=new _,ue=new _;return A.basisTo2D=function(e,t,a){var i=e.ellipsoid,o=_.getColumn(t,3,te),u=i.cartesianToCartographic(o,Q),s=A.eastNorthUpToFixedFrame(o,i,oe),c=_.inverseTransformation(s,ue),l=e.project(u,$),f=ne;f.x=l.z,f.y=l.x,f.z=l.y,f.w=1;var h=_.getColumn(t,0,ee),d=n.magnitude(h),E=_.multiplyByVector(c,h,re);r.fromElements(E.z,E.x,E.y,0,E);var p=_.getColumn(t,1,ee),m=n.magnitude(p),y=_.multiplyByVector(c,p,ae);r.fromElements(y.z,y.x,y.y,0,y);var T=_.getColumn(t,2,ee),R=n.magnitude(T),v=ie;return n.cross(E,y,v),n.normalize(v,v),n.cross(y,v,E),n.normalize(E,E),n.cross(v,E,y),n.normalize(y,y),n.multiplyByScalar(E,d,E),n.multiplyByScalar(y,m,y),n.multiplyByScalar(v,R,v),_.setColumn(a,0,E,a),_.setColumn(a,1,y,a),_.setColumn(a,2,v,a),_.setColumn(a,3,f,a),a},A}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d){"use strict";function E(e,t){t=a(t,s.WGS84),e=t.scaleToGeodeticSurface(e);var r=d.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=n.fromCartesian4(l.getColumn(r,0,p)),this._yAxis=n.fromCartesian4(l.getColumn(r,1,p));var i=n.fromCartesian4(l.getColumn(r,2,p));this._plane=f.fromPointNormal(e,i)}var p=new r;o(E.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var m=new e;E.fromPoints=function(t,n){var r=e.fromPoints(t,m);return new E(r.center,n)};var y=new h,_=new n;E.prototype.projectPointOntoPlane=function(e,r){var a=y;a.origin=e,n.normalize(e,a.direction);var o=c.rayPlane(a,this._plane,_);if(i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,_)),i(o)){var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return i(r)?(r.x=s,r.y=l,r):new t(s,l)}},E.prototype.projectPointsOntoPlane=function(e,t){i(t)||(t=[]);for(var n=0,r=e.length,a=0;a<r;a++){var o=this.projectPointOntoPlane(e[a],t[n]);i(o)&&(t[n]=o,n++)}return t.length=n,t},E.prototype.projectPointToNearestOnPlane=function(e,r){i(r)||(r=new t);var a=y;a.origin=e,n.clone(this._plane.normal,a.direction);var o=c.rayPlane(a,this._plane,_);i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,_));var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return r.x=s,r.y=l,r},E.prototype.projectPointsToNearestOnPlane=function(e,t){i(t)||(t=[]);var n=e.length;t.length=n;for(var r=0;r<n;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var T=new n;return E.prototype.projectPointsOntoEllipsoid=function(e,t){var r=e.length;i(t)?t.length=r:t=new Array(r);for(var a=this._ellipsoid,o=this._origin,u=this._xAxis,s=this._yAxis,c=T,l=0;l<r;++l){var f=e[l];n.multiplyByScalar(u,f.x,c),i(t[l])||(t[l]=new n);var h=n.add(o,c,t[l]);n.multiplyByScalar(s,f.y,c),n.add(h,c,h),a.scaleToGeocentricSurface(h,h)}return t},E}),define("Core/PolylineVolumeGeometryLibrary",["./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./CornerType","./EllipsoidTangentPlane","./Math","./Matrix3","./Matrix4","./PolylinePipeline","./Quaternion","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(e,t){for(var n=new Array(e.length),r=0;r<e.length;r++){var a=e[r];D=t.cartesianToCartographic(a,D),n[r]=D.height,e[r]=t.scaleToGeodeticSurface(a,a)}return n}function d(e,n,r,a){var i,o=e[0],u=e[1],s=t.angleBetween(o,u),c=Math.ceil(s/a),l=new Array(c);if(n===r){for(i=0;i<c;i++)l[i]=n;return l.push(r),l}var f=r-n,h=f/c;for(i=1;i<c;i++){var d=n+i*h;l[i]=d}return l[0]=n,l.push(r),l}function E(n,r,a,o){var u=new i(a,o),s=u.projectPointOntoPlane(t.add(a,n,Y),Y),c=u.projectPointOntoPlane(t.add(a,r,Z),Z),l=e.angleBetween(s,c);return c.x*s.y-c.y*s.x>=0?-l:l}function p(e,n,r,a,i,o,c,l){var h=b,d=G;L=f.eastNorthUpToFixedFrame(e,i,L),h=s.multiplyByPointAsVector(L,U,h),h=t.normalize(h,h);var p=E(h,n,e,i);z=u.fromRotationZ(p,z),q.z=o,L=s.multiplyTransformation(L,s.fromRotationTranslation(z,q,F),L);var m=B;m[0]=c;for(var y=0;y<l;y++)for(var _=0;_<r.length;_+=3)d=t.fromArray(r,_,d),d=u.multiplyByVector(m,d,d),d=s.multiplyByPoint(L,d,d),a.push(d.x,d.y,d.z);return a}function m(e,n,r,a,i,o,u){for(var s=0;s<e.length;s+=3){var c=t.fromArray(e,s,W);a=p(c,n,r,a,i,o[s/3],u,1)}return a}function y(e,t){var n=e.length,r=new Array(6*n),a=0,i=t.x+t.width/2,o=t.y+t.height/2,u=e[0];r[a++]=u.x-i,r[a++]=0,r[a++]=u.y-o;for(var s=1;s<n;s++){u=e[s];var c=u.x-i,l=u.y-o;r[a++]=c,r[a++]=0,r[a++]=l,r[a++]=c,r[a++]=0,r[a++]=l}return u=e[0],r[a++]=u.x-i,r[a++]=0,r[a++]=u.y-o,r}function _(e,t){for(var n=e.length,r=new Array(3*n),a=0,i=t.x+t.width/2,o=t.y+t.height/2,u=0;u<n;u++)r[a++]=e[u].x-i,r[a++]=0,r[a++]=e[u].y-o;return r}function T(e,n,r,i,s,c,f,h,d,E){var m,y=t.angleBetween(t.subtract(n,e,w),t.subtract(r,e,C)),_=i===a.BEVELED?0:Math.ceil(y/o.toRadians(5));m=s?u.fromQuaternion(l.fromAxisAngle(t.negate(e,w),y/(_+1),X),H):u.fromQuaternion(l.fromAxisAngle(e,y/(_+1),X),H);var T,R;if(n=t.clone(n,V),_>0)for(var A=E?2:1,v=0;v<_;v++)n=u.multiplyByVector(m,n,n),T=t.subtract(n,e,w),T=t.normalize(T,T),s||(T=t.negate(T,T)),R=c.scaleToGeodeticSurface(n,C),f=p(R,T,h,f,c,d,1,A);else T=t.subtract(n,e,w),T=t.normalize(T,T),s||(T=t.negate(T,T)),R=c.scaleToGeodeticSurface(n,C),f=p(R,T,h,f,c,d,1,1),r=t.clone(r,V),T=t.subtract(r,e,w),T=t.normalize(T,T),s||(T=t.negate(T,T)),R=c.scaleToGeodeticSurface(r,C),f=p(R,T,h,f,c,d,1,1);return f}var R=[new t,new t],A=new t,v=new t,S=new t,N=new t,g=new t,I=new t,O=new t,M=new t,x=new t,w=new t,C=new t,P={},D=new r,U=new t(-1,0,0),L=new s,F=new s,z=new u,B=u.IDENTITY.clone(),b=new t,G=new n,q=new t,W=new t,X=new l,V=new t,H=new u;P.removeDuplicatesFromShape=function(t){for(var n=t.length,r=[],a=n-1,i=0;i<n;a=i++){var o=t[a],u=t[i];e.equals(o,u)||r.push(u)}return r};var Y=new t,Z=new t;P.angleIsGreaterThanPi=function(e,n,r,a){var o=new i(r,a),u=o.projectPointOntoPlane(t.add(r,e,Y),Y),s=o.projectPointOntoPlane(t.add(r,n,Z),Z);return s.x*u.y-s.y*u.x>=0};var k=new t,j=new t;return P.computePositions=function(e,n,r,i,u){var s=i._ellipsoid,l=h(e,s),f=i._granularity,E=i._cornerType,C=u?y(n,r):_(n,r),D=u?_(n,r):void 0,U=r.height/2,L=r.width/2,F=e.length,z=[],B=u?[]:void 0,b=A,G=v,q=S,W=N,X=g,V=I,H=O,Y=M,Z=x,K=e[0],J=e[1];W=s.geodeticSurfaceNormal(K,W),b=t.subtract(J,K,b),b=t.normalize(b,b),Y=t.cross(W,b,Y),Y=t.normalize(Y,Y);var Q=l[0],$=l[1];u&&(B=p(K,Y,D,B,s,Q+U,1,1)),Z=t.clone(K,Z),K=J,G=t.negate(b,G);for(var ee,te,ne=1;ne<F-1;ne++){var re=u?2:1;J=e[ne+1],b=t.subtract(J,K,b),b=t.normalize(b,b),q=t.add(b,G,q),q=t.normalize(q,q),W=s.geodeticSurfaceNormal(K,W);var ae=t.multiplyByScalar(W,t.dot(b,W),k);t.subtract(b,ae,ae),t.normalize(ae,ae);var ie=t.multiplyByScalar(W,t.dot(G,W),j);t.subtract(G,ie,ie),t.normalize(ie,ie);var oe=!o.equalsEpsilon(Math.abs(t.dot(ae,ie)),1,o.EPSILON7);if(oe){q=t.cross(q,W,q),q=t.cross(W,q,q),q=t.normalize(q,q);var ue=1/Math.max(.25,t.magnitude(t.cross(q,G,w))),se=P.angleIsGreaterThanPi(b,G,K,s);se?(X=t.add(K,t.multiplyByScalar(q,ue*L,q),X),V=t.add(X,t.multiplyByScalar(Y,L,V),V),R[0]=t.clone(Z,R[0]),R[1]=t.clone(V,R[1]),ee=d(R,Q+U,$+U,f),te=c.generateArc({positions:R,granularity:f,ellipsoid:s}),z=m(te,Y,C,z,s,ee,1),Y=t.cross(W,b,Y),Y=t.normalize(Y,Y),H=t.add(X,t.multiplyByScalar(Y,L,H),H),E===a.ROUNDED||E===a.BEVELED?T(X,V,H,E,se,s,z,C,$+U,u):(q=t.negate(q,q),z=p(K,q,C,z,s,$+U,ue,re)),Z=t.clone(H,Z)):(X=t.add(K,t.multiplyByScalar(q,ue*L,q),X),V=t.add(X,t.multiplyByScalar(Y,-L,V),V),R[0]=t.clone(Z,R[0]),R[1]=t.clone(V,R[1]),ee=d(R,Q+U,$+U,f),te=c.generateArc({positions:R,granularity:f,ellipsoid:s}),z=m(te,Y,C,z,s,ee,1),Y=t.cross(W,b,Y),Y=t.normalize(Y,Y),H=t.add(X,t.multiplyByScalar(Y,-L,H),H),E===a.ROUNDED||E===a.BEVELED?T(X,V,H,E,se,s,z,C,$+U,u):z=p(K,q,C,z,s,$+U,ue,re),Z=t.clone(H,Z)),G=t.negate(b,G)}else z=p(Z,Y,C,z,s,Q+U,1,1),Z=K;Q=$,$=l[ne+1],K=J}R[0]=t.clone(Z,R[0]),R[1]=t.clone(K,R[1]),ee=d(R,Q+U,$+U,f),te=c.generateArc({positions:R,granularity:f,ellipsoid:s}),z=m(te,Y,C,z,s,ee,1),u&&(B=p(K,Y,D,B,s,$+U,1,1)),F=z.length;var ce=u?F+B.length:F,le=new Float64Array(ce);return le.set(z),u&&le.set(B,F),le},P}),define("Core/CorridorGeometryLibrary",["./Cartesian3","./CornerType","./defined","./Math","./Matrix3","./PolylinePipeline","./PolylineVolumeGeometryLibrary","./Quaternion"],function(e,t,n,r,a,i,o,u){"use strict";function s(n,i,o,s,c){var l=e.angleBetween(e.subtract(i,n,E),e.subtract(o,n,p)),f=s===t.BEVELED?1:Math.ceil(l/r.toRadians(5))+1,h=3*f,d=new Array(h);d[h-3]=o.x,d[h-2]=o.y,d[h-1]=o.z;var m;m=c?a.fromQuaternion(u.fromAxisAngle(e.negate(n,E),l/f,x),w):a.fromQuaternion(u.fromAxisAngle(n,l/f,x),w);var y=0;i=e.clone(i,E);for(var _=0;_<f;_++)i=a.multiplyByVector(m,i,i),d[y++]=i.x,d[y++]=i.y,d[y++]=i.z;return d}function c(n){var r=T,a=R,i=A,o=n[1];a=e.fromArray(n[1],o.length-3,a),i=e.fromArray(n[0],0,i),r=e.multiplyByScalar(e.add(a,i,r),.5,r);var u=s(r,a,i,t.ROUNDED,!1),c=n.length-1,l=n[c-1];o=n[c],a=e.fromArray(l,l.length-3,a),i=e.fromArray(o,0,i),r=e.multiplyByScalar(e.add(a,i,r),.5,r);var f=s(r,a,i,t.ROUNDED,!1);return[u,f]}function l(t,n,r,a){var i=E;return a?i=e.add(t,n,i):(n=e.negate(n,n),i=e.add(t,n,i)),[i.x,i.y,i.z,r.x,r.y,r.z]}function f(t,n,r,a){for(var i=new Array(t.length),o=new Array(t.length),u=e.multiplyByScalar(n,r,E),s=e.negate(u,p),c=0,l=t.length-1,f=0;f<t.length;f+=3){var h=e.fromArray(t,f,m),d=e.add(h,s,y);i[c++]=d.x,i[c++]=d.y,i[c++]=d.z;var _=e.add(h,u,y);o[l--]=_.z,o[l--]=_.y,o[l--]=_.x}return a.push(i,o),a}function h(e,t){for(var n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}var d={},E=new e,p=new e,m=new e,y=new e,_=[new e,new e],T=new e,R=new e,A=new e,v=new e,S=new e,N=new e,g=new e,I=new e,O=new e,M=new e,x=new u,w=new a;d.addAttribute=function(e,t,r,a){var i=t.x,o=t.y,u=t.z;n(r)&&(e[r]=i,e[r+1]=o,e[r+2]=u),n(a)&&(e[a]=u,e[a-1]=o,e[a-2]=i)};var C=new e,P=new e;return d.computePositions=function(n){var a=n.granularity,u=n.positions,d=n.ellipsoid;u=h(u,d);var p=n.width/2,m=n.cornerType,y=n.saveAttributes,x=T,w=R,D=A,U=v,L=S,F=N,z=g,B=I,b=O,G=M,q=[],W=y?[]:void 0,X=y?[]:void 0,V=u[0],H=u[1];w=e.normalize(e.subtract(H,V,w),w),x=d.geodeticSurfaceNormal(V,x),U=e.normalize(e.cross(x,w,U),U),y&&(W.push(U.x,U.y,U.z),X.push(x.x,x.y,x.z)),z=e.clone(V,z),V=H,D=e.negate(w,D);var Y,Z,k=[],j=u.length;for(Z=1;Z<j-1;Z++){x=d.geodeticSurfaceNormal(V,x),H=u[Z+1],w=e.normalize(e.subtract(H,V,w),w),L=e.normalize(e.add(w,D,L),L);var K=e.multiplyByScalar(x,e.dot(w,x),C);e.subtract(w,K,K),e.normalize(K,K);var J=e.multiplyByScalar(x,e.dot(D,x),P);e.subtract(D,J,J),e.normalize(J,J);var Q=!r.equalsEpsilon(Math.abs(e.dot(K,J)),1,r.EPSILON7); -if(Q){L=e.cross(L,x,L),L=e.cross(x,L,L),L=e.normalize(L,L);var $=p/Math.max(.25,e.magnitude(e.cross(L,D,E))),ee=o.angleIsGreaterThanPi(w,D,V,d);L=e.multiplyByScalar(L,$,L),ee?(B=e.add(V,L,B),G=e.add(B,e.multiplyByScalar(U,p,G),G),b=e.add(B,e.multiplyByScalar(U,2*p,b),b),_[0]=e.clone(z,_[0]),_[1]=e.clone(G,_[1]),Y=i.generateArc({positions:_,granularity:a,ellipsoid:d}),q=f(Y,U,p,q),y&&(W.push(U.x,U.y,U.z),X.push(x.x,x.y,x.z)),F=e.clone(b,F),U=e.normalize(e.cross(x,w,U),U),b=e.add(B,e.multiplyByScalar(U,2*p,b),b),z=e.add(B,e.multiplyByScalar(U,p,z),z),m===t.ROUNDED||m===t.BEVELED?k.push({leftPositions:s(B,F,b,m,ee)}):k.push({leftPositions:l(V,e.negate(L,L),b,ee)})):(b=e.add(V,L,b),G=e.add(b,e.negate(e.multiplyByScalar(U,p,G),G),G),B=e.add(b,e.negate(e.multiplyByScalar(U,2*p,B),B),B),_[0]=e.clone(z,_[0]),_[1]=e.clone(G,_[1]),Y=i.generateArc({positions:_,granularity:a,ellipsoid:d}),q=f(Y,U,p,q),y&&(W.push(U.x,U.y,U.z),X.push(x.x,x.y,x.z)),F=e.clone(B,F),U=e.normalize(e.cross(x,w,U),U),B=e.add(b,e.negate(e.multiplyByScalar(U,2*p,B),B),B),z=e.add(b,e.negate(e.multiplyByScalar(U,p,z),z),z),m===t.ROUNDED||m===t.BEVELED?k.push({rightPositions:s(b,F,B,m,ee)}):k.push({rightPositions:l(V,L,B,ee)})),D=e.negate(w,D)}V=H}x=d.geodeticSurfaceNormal(V,x),_[0]=e.clone(z,_[0]),_[1]=e.clone(V,_[1]),Y=i.generateArc({positions:_,granularity:a,ellipsoid:d}),q=f(Y,U,p,q),y&&(W.push(U.x,U.y,U.z),X.push(x.x,x.y,x.z));var te;return m===t.ROUNDED&&(te=c(q)),{positions:q,corners:k,lefts:W,normals:X,endPositions:te}},d}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===n.POINTS||e===n.LINES||e===n.LINE_LOOP||e===n.LINE_STRIP||e===n.TRIANGLES||e===n.TRIANGLE_STRIP||e===n.TRIANGLE_FAN}};return e(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,a){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,a.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return i.computeNumberOfVertices=function(e){var n=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var a=e.attributes[r],i=a.values.length/a.componentsPerAttribute;n=i}return n},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(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 r}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.binormal=t.binormal,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,n,r,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(e){switch(e){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(t){return e(t)&&(t===i.UNSIGNED_BYTE||t===i.UNSIGNED_SHORT||t===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,n,a){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,a):new Uint16Array(t,n,a)},n(i)}),define("ThirdParty/earcut-2.1.1",[],function(){"use strict";function e(e,n,a){a=a||2;var i=n&&n.length,o=i?n[0]*a:e.length,u=t(e,0,o,a,!0),c=[];if(!u)return c;var l,f,h,d,E,p,m;if(i&&(u=s(e,n,u,a)),e.length>80*a){l=h=e[0],f=d=e[1];for(var y=a;y<o;y+=a)E=e[y],p=e[y+1],E<l&&(l=E),p<f&&(f=p),E>h&&(h=E),p>d&&(d=p);m=Math.max(h-l,d-f)}return r(u,c,a,l,f,m),c}function t(e,t,n,r,a){var i,o;if(a===M(e,t,n,r)>0)for(i=t;i<n;i+=r)o=g(i,e[i],e[i+1],o);else for(i=n-r;i>=t;i-=r)o=g(i,e[i],e[i+1],o);return o&&T(o,o.next)&&(I(o),o=o.next),o}function n(e,t){if(!e)return e;t||(t=e);var n,r=e;do if(n=!1,r.steiner||!T(r,r.next)&&0!==_(r.prev,r,r.next))r=r.next;else{if(I(r),r=t=r.prev,r===r.next)return null;n=!0}while(n||r!==t);return t}function r(e,t,s,c,l,f,d){if(e){!d&&f&&h(e,c,l,f);for(var E,p,m=e;e.prev!==e.next;)if(E=e.prev,p=e.next,f?i(e,c,l,f):a(e))t.push(E.i/s),t.push(e.i/s),t.push(p.i/s),I(e),e=p.next,m=p.next;else if(e=p,e===m){d?1===d?(e=o(e,t,s),r(e,t,s,c,l,f,2)):2===d&&u(e,t,s,c,l,f):r(n(e),t,s,c,l,f,1);break}}}function a(e){var t=e.prev,n=e,r=e.next;if(_(t,n,r)>=0)return!1;for(var a=e.next.next;a!==e.prev;){if(m(t.x,t.y,n.x,n.y,r.x,r.y,a.x,a.y)&&_(a.prev,a,a.next)>=0)return!1;a=a.next}return!0}function i(e,t,n,r){var a=e.prev,i=e,o=e.next;if(_(a,i,o)>=0)return!1;for(var u=a.x<i.x?a.x<o.x?a.x:o.x:i.x<o.x?i.x:o.x,s=a.y<i.y?a.y<o.y?a.y:o.y:i.y<o.y?i.y:o.y,c=a.x>i.x?a.x>o.x?a.x:o.x:i.x>o.x?i.x:o.x,l=a.y>i.y?a.y>o.y?a.y:o.y:i.y>o.y?i.y:o.y,f=E(u,s,t,n,r),h=E(c,l,t,n,r),d=e.nextZ;d&&d.z<=h;){if(d!==e.prev&&d!==e.next&&m(a.x,a.y,i.x,i.y,o.x,o.y,d.x,d.y)&&_(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(d=e.prevZ;d&&d.z>=f;){if(d!==e.prev&&d!==e.next&&m(a.x,a.y,i.x,i.y,o.x,o.y,d.x,d.y)&&_(d.prev,d,d.next)>=0)return!1;d=d.prevZ}return!0}function o(e,t,n){var r=e;do{var a=r.prev,i=r.next.next;!T(a,i)&&R(a,r,r.next,i)&&v(a,i)&&v(i,a)&&(t.push(a.i/n),t.push(r.i/n),t.push(i.i/n),I(r),I(r.next),r=e=i),r=r.next}while(r!==e);return r}function u(e,t,a,i,o,u){var s=e;do{for(var c=s.next.next;c!==s.prev;){if(s.i!==c.i&&y(s,c)){var l=N(s,c);return s=n(s,s.next),l=n(l,l.next),r(s,t,a,i,o,u),void r(l,t,a,i,o,u)}c=c.next}s=s.next}while(s!==e)}function s(e,r,a,i){var o,u,s,f,h,d=[];for(o=0,u=r.length;o<u;o++)s=r[o]*i,f=o<u-1?r[o+1]*i:e.length,h=t(e,s,f,i,!1),h===h.next&&(h.steiner=!0),d.push(p(h));for(d.sort(c),o=0;o<d.length;o++)l(d[o],a),a=n(a,a.next);return a}function c(e,t){return e.x-t.x}function l(e,t){if(t=f(e,t)){var r=N(t,e);n(r,r.next)}}function f(e,t){var n,r=t,a=e.x,i=e.y,o=-(1/0);do{if(i<=r.y&&i>=r.next.y){var u=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(u<=a&&u>o){if(o=u,u===a){if(i===r.y)return r;if(i===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(a===o)return n.prev;var s,c=n,l=n.x,f=n.y,h=1/0;for(r=n.next;r!==c;)a>=r.x&&r.x>=l&&m(i<f?a:o,i,l,f,i<f?o:a,i,r.x,r.y)&&(s=Math.abs(i-r.y)/(a-r.x),(s<h||s===h&&r.x>n.x)&&v(r,e)&&(n=r,h=s)),r=r.next;return n}function h(e,t,n,r){var a=e;do null===a.z&&(a.z=E(a.x,a.y,t,n,r)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next;while(a!==e);a.prevZ.nextZ=null,a.prevZ=null,d(a)}function d(e){var t,n,r,a,i,o,u,s,c=1;do{for(n=e,e=null,i=null,o=0;n;){for(o++,r=n,u=0,t=0;t<c&&(u++,r=r.nextZ,r);t++);for(s=c;u>0||s>0&&r;)0===u?(a=r,r=r.nextZ,s--):0!==s&&r?n.z<=r.z?(a=n,n=n.nextZ,u--):(a=r,r=r.nextZ,s--):(a=n,n=n.nextZ,u--),i?i.nextZ=a:e=a,a.prevZ=i,i=a;n=r}i.nextZ=null,c*=2}while(o>1);return e}function E(e,t,n,r,a){return e=32767*(e-n)/a,t=32767*(t-r)/a,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function p(e){var t=e,n=e;do t.x<n.x&&(n=t),t=t.next;while(t!==e);return n}function m(e,t,n,r,a,i,o,u){return(a-o)*(t-u)-(e-o)*(i-u)>=0&&(e-o)*(r-u)-(n-o)*(t-u)>=0&&(n-o)*(i-u)-(a-o)*(r-u)>=0}function y(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!A(e,t)&&v(e,t)&&v(t,e)&&S(e,t)}function _(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function T(e,t){return e.x===t.x&&e.y===t.y}function R(e,t,n,r){return!!(T(e,t)&&T(n,r)||T(e,r)&&T(n,t))||_(e,t,n)>0!=_(e,t,r)>0&&_(n,r,e)>0!=_(n,r,t)>0}function A(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&R(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function v(e,t){return _(e.prev,e,e.next)<0?_(e,t,e.next)>=0&&_(e,e.prev,t)>=0:_(e,t,e.prev)<0||_(e,e.next,t)<0}function S(e,t){var n=e,r=!1,a=(e.x+t.x)/2,i=(e.y+t.y)/2;do n.y>i!=n.next.y>i&&a<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function N(e,t){var n=new O(e.i,e.x,e.y),r=new O(t.i,t.x,t.y),a=e.next,i=t.prev;return e.next=t,t.prev=e,n.next=a,a.prev=n,r.next=n,n.prev=r,i.next=r,r.prev=i,r}function g(e,t,n,r){var a=new O(e,t,n);return r?(a.next=r.next,a.prev=r,r.next.prev=a,r.next=a):(a.prev=a,a.next=a),a}function I(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function O(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function M(e,t,n,r){for(var a=0,i=t,o=n-r;i<n;i+=r)a+=(e[o]-e[i])*(e[i+1]+e[o+1]),o=i;return a}return e.deviation=function(e,t,n,r){var a=t&&t.length,i=a?t[0]*n:e.length,o=Math.abs(M(e,0,i,n));if(a)for(var u=0,s=t.length;u<s;u++){var c=t[u]*n,l=u<s-1?t[u+1]*n:e.length;o-=Math.abs(M(e,c,l,n))}var f=0;for(u=0;u<r.length;u+=3){var h=r[u]*n,d=r[u+1]*n,E=r[u+2]*n;f+=Math.abs((e[h]-e[E])*(e[d+1]-e[h+1])-(e[h]-e[d])*(e[E+1]-e[h+1]))}return 0===o&&0===f?0:Math.abs((f-o)/o)},e.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,a=0;a<e.length;a++){for(var i=0;i<e[a].length;i++)for(var o=0;o<t;o++)n.vertices.push(e[a][i][o]);a>0&&(r+=e[a-1].length,n.holes.push(r))}return n},e}),define("Core/WindingOrder",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={CLOCKWISE:t.CW,COUNTER_CLOCKWISE:t.CCW,validate:function(e){return e===n.CLOCKWISE||e===n.COUNTER_CLOCKWISE}};return e(n)}),define("Core/PolygonPipeline",["../ThirdParty/earcut-2.1.1","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./Math","./PrimitiveType","./WindingOrder"],function(e,t,n,r,a,i,o,u,s,c,l,f,h){"use strict";var d=new n,E=new n,p={};p.computeArea2D=function(e){for(var t=e.length,n=0,r=t-1,a=0;a<t;r=a++){var i=e[r],o=e[a];n+=i.x*o.y-o.x*i.y}return.5*n},p.computeWindingOrder2D=function(e){var t=p.computeArea2D(e);return t>0?h.COUNTER_CLOCKWISE:h.CLOCKWISE},p.triangulate=function(n,r){var a=t.packArray(n);return e(a,r,2)};var m=new n,y=new n,_=new n,T=new n,R=new n,A=new n,v=new n;return p.computeSubdivision=function(e,t,o,u){u=a(u,l.RADIANS_PER_DEGREE);var h,d=o.slice(0),E=t.length,p=new Array(3*E),S=0;for(h=0;h<E;h++){var N=t[h];p[S++]=N.x,p[S++]=N.y,p[S++]=N.z}for(var g=[],I={},O=e.maximumRadius,M=l.chordLength(u,O),x=M*M;d.length>0;){var w,C,P=d.pop(),D=d.pop(),U=d.pop(),L=n.fromArray(p,3*U,m),F=n.fromArray(p,3*D,y),z=n.fromArray(p,3*P,_),B=n.multiplyByScalar(n.normalize(L,T),O,T),b=n.multiplyByScalar(n.normalize(F,R),O,R),G=n.multiplyByScalar(n.normalize(z,A),O,A),q=n.magnitudeSquared(n.subtract(B,b,v)),W=n.magnitudeSquared(n.subtract(b,G,v)),X=n.magnitudeSquared(n.subtract(G,B,v)),V=Math.max(q,W,X);V>x?q===V?(w=Math.min(U,D)+" "+Math.max(U,D),h=I[w],i(h)||(C=n.add(L,F,v),n.multiplyByScalar(C,.5,C),p.push(C.x,C.y,C.z),h=p.length/3-1,I[w]=h),d.push(U,h,P),d.push(h,D,P)):W===V?(w=Math.min(D,P)+" "+Math.max(D,P),h=I[w],i(h)||(C=n.add(F,z,v),n.multiplyByScalar(C,.5,C),p.push(C.x,C.y,C.z),h=p.length/3-1,I[w]=h),d.push(D,h,U),d.push(h,P,U)):X===V&&(w=Math.min(P,U)+" "+Math.max(P,U),h=I[w],i(h)||(C=n.add(z,L,v),n.multiplyByScalar(C,.5,C),p.push(C.x,C.y,C.z),h=p.length/3-1,I[w]=h),d.push(P,h,D),d.push(h,U,D)):(g.push(U),g.push(D),g.push(P))}return new s({attributes:{position:new c({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:p})},indices:g,primitiveType:f.TRIANGLES})},p.scaleToGeodeticHeight=function(e,t,r,o){r=a(r,u.WGS84);var s=d,c=E;if(t=a(t,0),o=a(o,!0),i(e))for(var l=e.length,f=0;f<l;f+=3)n.fromArray(e,f,c),o&&(c=r.scaleToGeodeticSurface(c,c)),0!==t&&(s=r.geodeticSurfaceNormal(c,s),n.multiplyByScalar(s,t,s),n.add(c,s,c)),e[f]=c.x,e[f+1]=c.y,e[f+2]=c.z;return e},p}),define("Core/CorridorOutlineGeometry",["./arrayRemoveDuplicates","./BoundingSphere","./Cartesian3","./ComponentDatatype","./CornerType","./CorridorGeometryLibrary","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolygonPipeline","./PrimitiveType"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,E,p,m){"use strict";function y(e,t){var o,s,c,l=[],E=e.positions,p=e.corners,m=e.endPositions,y=new h,_=0,T=0,S=0;for(s=0;s<E.length;s+=2)c=E[s].length-3,_+=c,S+=c/3*4,T+=E[s+1].length-3;for(_+=3,T+=3,s=0;s<p.length;s++){o=p[s];var N=p[s].leftPositions;u(N)?(c=N.length,_+=c,S+=c/3*2):(c=p[s].rightPositions.length,T+=c,S+=c/3*2)}var g,I=u(m);I&&(g=m[0].length-3,_+=g,T+=g,g/=3,S+=4*g);var O,M,x,w,C,P,D=_+T,U=new Float64Array(D),L=0,F=D-1,z=g/2,B=d.createTypedArray(D/3,S+4),b=0;if(B[b++]=L/3,B[b++]=(F-2)/3,I){l.push(L/3),P=R,C=A;var G=m[0];for(s=0;s<z;s++)P=n.fromArray(G,3*(z-1-s),P),C=n.fromArray(G,3*(z+s),C),i.addAttribute(U,C,L),i.addAttribute(U,P,void 0,F),M=L/3,w=M+1,O=(F-2)/3,x=O-1,B[b++]=O,B[b++]=x,B[b++]=M,B[b++]=w,L+=3,F-=3}var q=0,W=E[q++],X=E[q++];for(U.set(W,L),U.set(X,F-X.length+1),c=X.length-3,l.push(L/3,(F-2)/3),s=0;s<c;s+=3)M=L/3,w=M+1,O=(F-2)/3,x=O-1,B[b++]=O,B[b++]=x,B[b++]=M,B[b++]=w,L+=3,F-=3;for(s=0;s<p.length;s++){var V;o=p[s];var H,Y=o.leftPositions,Z=o.rightPositions,k=v;if(u(Y)){for(F-=3,H=x,l.push(w),V=0;V<Y.length/3;V++)k=n.fromArray(Y,3*V,k),B[b++]=H-V-1,B[b++]=H-V,i.addAttribute(U,k,void 0,F),F-=3;l.push(H-Math.floor(Y.length/6)),t===a.BEVELED&&l.push((F-2)/3+1),L+=3}else{for(L+=3,H=w,l.push(x),V=0;V<Z.length/3;V++)k=n.fromArray(Z,3*V,k),B[b++]=H+V,B[b++]=H+V+1,i.addAttribute(U,k,L),L+=3;l.push(H+Math.floor(Z.length/6)),t===a.BEVELED&&l.push(L/3-1),F-=3}for(W=E[q++],X=E[q++],W.splice(0,3),X.splice(X.length-3,3),U.set(W,L),U.set(X,F-X.length+1),c=X.length-3,V=0;V<X.length;V+=3)w=L/3,M=w-1,x=(F-2)/3,O=x+1,B[b++]=O,B[b++]=x,B[b++]=M,B[b++]=w,L+=3,F-=3;L-=3,F+=3,l.push(L/3,(F-2)/3)}if(I){L+=3,F-=3,P=R,C=A;var j=m[1];for(s=0;s<z;s++)P=n.fromArray(j,3*(g-s-1),P),C=n.fromArray(j,3*s,C),i.addAttribute(U,P,void 0,F),i.addAttribute(U,C,L),w=L/3,M=w-1,x=(F-2)/3,O=x+1,B[b++]=O,B[b++]=x,B[b++]=M,B[b++]=w,L+=3,F-=3;l.push(L/3)}else l.push(L/3,(F-2)/3);return B[b++]=L/3,B[b++]=(F-2)/3,y.position=new f({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:U}),{attributes:y,indices:B,wallIndices:l}}function _(e){var t=e.ellipsoid,n=i.computePositions(e),r=y(n,e.cornerType),a=r.wallIndices,o=e.height,u=e.extrudedHeight,s=r.attributes,c=r.indices,l=s.position.values,f=l.length,h=new Float64Array(f);h.set(l);var E=new Float64Array(2*f);l=p.scaleToGeodeticHeight(l,o,t),h=p.scaleToGeodeticHeight(h,u,t),E.set(l),E.set(h,f),s.position.values=E,f/=3;var m,_=c.length,T=d.createTypedArray(E.length/3,2*(_+a.length));T.set(c);var R=_;for(m=0;m<_;m+=2){var A=c[m],v=c[m+1];T[R++]=A+f,T[R++]=v+f}var S,N;for(m=0;m<a.length;m++)S=a[m],N=S+f,T[R++]=S,T[R++]=N;return{attributes:s,indices:T}}function T(e){e=o(e,o.EMPTY_OBJECT);var t=e.positions,r=e.width;this._positions=t,this._ellipsoid=c.clone(o(e.ellipsoid,c.WGS84)),this._width=r,this._height=o(e.height,0),this._extrudedHeight=o(e.extrudedHeight,this._height),this._cornerType=o(e.cornerType,a.ROUNDED),this._granularity=o(e.granularity,E.RADIANS_PER_DEGREE),this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*n.packedLength+c.packedLength+5}var R=new n,A=new n,v=new n;T.pack=function(e,t,r){r=o(r,0);var a=e._positions,i=a.length;t[r++]=i;for(var u=0;u<i;++u,r+=n.packedLength)n.pack(a[u],t,r);return c.pack(e._ellipsoid,t,r),r+=c.packedLength,t[r++]=e._width,t[r++]=e._height,t[r++]=e._extrudedHeight,t[r++]=e._cornerType,t[r]=e._granularity,t};var S=c.clone(c.UNIT_SPHERE),N={positions:void 0,ellipsoid:S,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0};return T.unpack=function(e,t,r){t=o(t,0);for(var a=e[t++],i=new Array(a),s=0;s<a;++s,t+=n.packedLength)i[s]=n.unpack(e,t);var l=c.unpack(e,t,S);t+=c.packedLength;var f=e[t++],h=e[t++],d=e[t++],E=e[t++],p=e[t];return u(r)?(r._positions=i,r._ellipsoid=c.clone(l,r._ellipsoid),r._width=f,r._height=h,r._extrudedHeight=d,r._cornerType=E,r._granularity=p,r):(N.positions=i,N.width=f,N.height=h,N.extrudedHeight=d,N.cornerType=E,N.granularity=p,new T(N))},T.createGeometry=function(r){var a=r._positions,o=r._height,u=r._width,s=r._extrudedHeight,c=o!==s,f=e(a,n.equalsEpsilon);if(!(f.length<2||u<=0)){var h,d=r._ellipsoid,E={ellipsoid:d,positions:f,width:u,cornerType:r._cornerType,granularity:r._granularity,saveAttributes:!1};if(c){var T=Math.max(o,s);s=Math.min(o,s),o=T,E.height=o,E.extrudedHeight=s,h=_(E)}else{var R=i.computePositions(E);h=y(R,E.cornerType),h.attributes.position.values=p.scaleToGeodeticHeight(h.attributes.position.values,o,d)}var A=h.attributes,v=t.fromVertices(A.position.values,void 0,3);return new l({attributes:A,indices:h.indices,primitiveType:m.LINES,boundingSphere:v})}},T}),define("Workers/createCorridorOutlineGeometry",["../Core/CorridorOutlineGeometry","../Core/defined","../Core/Ellipsoid"],function(e,t,n){"use strict";function r(r,a){return t(a)&&(r=e.unpack(r,a)),r._ellipsoid=n.clone(r._ellipsoid),e.createGeometry(r)}return r})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==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";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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 n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(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^=e<<7&2636928640,e^=e<<15&4022730752,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,n,r){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:e<0?-1:0},a.signNotZero=function(e){return e<0?-1:1},a.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*a.clamp(e,-1,1)+.5)*n)},a.fromSNorm=function(e,n){return n=t(n,255),a.clamp(e,0,n)/n*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},a.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},a.lerp=function(e,t,n){return(1-n)*e+n*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){var t=a.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},a.clampToLatitudeRange=function(e){return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){return(e%t+t)%t},a.equalsEpsilon=function(e,n,r,a){a=t(a,r);var i=Math.abs(e-n);return i<=a||i<=r*Math.max(Math.abs(e),Math.abs(n))};var i=[1];a.factorial=function(e){var t=i.length;if(e>=t)for(var n=i[t-1],r=t;r<=e;r++)i.push(n*r);return i[e]},a.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},a.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return a.setRandomNumberSeed=function(t){o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(e){return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){return Math.log(e)/Math.log(t)},a.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},a}),define("Core/arrayRemoveDuplicates",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(n,r,a){if(t(n)){a=e(a,!1);var o=n.length;if(o<2)return n;var u,s,c;for(u=1;u<o&&(s=n[u-1],c=n[u],!r(s,c,i));++u);if(u===o)return a&&r(n[0],n[n.length-1],i)?n.slice(1):n;for(var l=n.slice(0,u);u<o;++u)c=n[u],r(s,c,i)||(l.push(c),s=c);return a&&l.length>1&&r(l[0],l[l.length-1],i)&&l.shift(),l}}var i=r.EPSILON10;return a}),define("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e){return e+" is required, actual value was undefined"}function r(e,t,n){return"Expected "+n+" to be typeof "+t+", actual typeof was "+e}var a={};return a.typeOf={},a.defined=function(r,a){if(!e(a))throw new t(n(r))},a.typeOf.func=function(e,n){if("function"!=typeof n)throw new t(r(typeof n,"function",e))},a.typeOf.string=function(e,n){if("string"!=typeof n)throw new t(r(typeof n,"string",e))},a.typeOf.number=function(e,n){if("number"!=typeof n)throw new t(r(typeof n,"number",e))},a.typeOf.number.lessThan=function(e,n,r){if(a.typeOf.number(e,n),n>=r)throw new t("Expected "+e+" to be less than "+r+", actual value was "+n)},a.typeOf.number.lessThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n>r)throw new t("Expected "+e+" to be less than or equal to "+r+", actual value was "+n)},a.typeOf.number.greaterThan=function(e,n,r){if(a.typeOf.number(e,n),n<=r)throw new t("Expected "+e+" to be greater than "+r+", actual value was "+n)},a.typeOf.number.greaterThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n<r)throw new t("Expected "+e+" to be greater than or equal to"+r+", actual value was "+n)},a.typeOf.object=function(e,n){if("object"!=typeof n)throw new t(r(typeof n,"object",e))},a.typeOf.bool=function(e,n){if("boolean"!=typeof n)throw new t(r(typeof n,"boolean",e))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var a=e.clock,i=e.cone,u=t(e.magnitude,1),s=u*Math.sin(i);return r.x=s*Math.cos(a),r.y=s*Math.sin(a),r.z=u*Math.cos(i),r},o.fromElements=function(e,t,r,a){return n(a)?(a.x=e,a.y=t,a.z=r,a):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var a=0;a<r;++a)o.pack(e[a],t,3*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var a=0;a<r;a+=3){var i=a/3;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,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};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var n=o.dot(c,l),r=o.magnitude(o.cross(c,l,c));return Math.atan2(r,n)};var f=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)},o.cross=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=t.x,u=t.y,s=t.z,c=a*s-i*u,l=i*o-r*s,f=r*u-a*o;return n.x=c,n.y=l,n.z=f,n},o.fromDegrees=function(e,t,n,r,a){return e=i.toRadians(e),t=i.toRadians(t),o.fromRadians(e,t,n,r,a)};var h=new o,d=new o,E=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,a,i,u){a=t(a,0);var s=n(i)?i.radiiSquared:E,c=Math.cos(r);h.x=c*Math.cos(e),h.y=c*Math.sin(e),h.z=Math.sin(r),h=o.normalize(h,h),o.multiplyComponents(s,h,d);var l=Math.sqrt(o.dot(h,d));return d=o.divideByScalar(d,l,d),h=o.multiplyByScalar(h,a,h),n(u)||(u=new o),o.add(d,h,u)},o.fromDegreesArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromDegrees(u,s,0,t,r[c])}return r},o.fromRadiansArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromRadians(u,s,0,t,r[c])}return r},o.fromDegreesArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromDegrees(u,s,c,t,r[l])}return r},o.fromRadiansArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromRadians(u,s,c,t,r[l])}return r},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(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,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(n,a,u,s,c){var l=n.x,f=n.y,h=n.z,d=a.x,E=a.y,p=a.z,y=l*l*d*d,m=f*f*E*E,_=h*h*p*p,T=y+m+_,R=Math.sqrt(1/T),A=e.multiplyByScalar(n,R,i);if(T<s)return isFinite(R)?e.clone(A,c):void 0;var v=u.x,S=u.y,N=u.z,g=o;g.x=A.x*v*2,g.y=A.y*S*2,g.z=A.z*N*2;var O,M,I,x,w,C,P,U,D,L,F,z=(1-R)*e.magnitude(n)/(.5*e.magnitude(g)),B=0;do{z-=B,I=1/(1+z*v),x=1/(1+z*S),w=1/(1+z*N),C=I*I,P=x*x,U=w*w,D=C*I,L=P*x,F=U*w,O=y*C+m*P+_*U-1,M=y*D*v+m*L*S+_*F*N;var b=-2*M;B=O/b}while(Math.abs(O)>r.EPSILON12);return t(c)?(c.x=l*I,c.y=f*x,c.z=h*w,c):new e(l*I,f*x,h*w)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o){"use strict";function u(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)}u.fromRadians=function(e,r,a,i){return a=t(a,0),n(i)?(i.longitude=e,i.latitude=r,i.height=a,i):new u(e,r,a)},u.fromDegrees=function(e,t,n,r){return e=i.toRadians(e),t=i.toRadians(t),u.fromRadians(e,t,n,r)};var s=new e,c=new e,l=new e,f=new e(1/6378137,1/6378137,1/6356752.314245179),h=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),d=i.EPSILON1;return u.fromCartesian=function(t,r,a){var E=n(r)?r.oneOverRadii:f,p=n(r)?r.oneOverRadiiSquared:h,y=n(r)?r._centerToleranceSquared:d,m=o(t,E,p,y,c);if(n(m)){var _=e.multiplyComponents(m,p,s);_=e.normalize(_,_);var T=e.subtract(t,m,l),R=Math.atan2(_.y,_.x),A=Math.asin(_.z),v=i.sign(e.dot(T,t))*e.magnitude(T);return n(a)?(a.longitude=R,a.latitude=A,a.height=v,a):new u(R,A,v)}},u.clone=function(e,t){if(n(e))return n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},u.ZERO=a(new u(0,0,0)),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,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(t,r,a,i){r=n(r,0),a=n(a,0),i=n(i,0),t._radii=new e(r,a,i),t._radiiSquared=new e(r*r,a*a,i*i),t._radiiToTheFourth=new e(r*r*r*r,a*a*a*a,i*i*i*i),t._oneOverRadii=new e(0===r?0:1/r,0===a?0:1/a,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===a?0:1/(a*a),0===i?0:1/(i*i)),t._minimumRadius=Math.min(r,a,i),t._maximumRadius=Math.max(r,a,i),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,c(this,e,t,n)}a(l.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}}}),l.clone=function(t,n){if(r(t)){var a=t._radii;return r(n)?(e.clone(a,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new l(a.x,a.y,a.z)}},l.fromCartesian3=function(e,t){return r(t)||(t=new l),r(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,r,a){return a=n(a,0),e.pack(t._radii,r,a),r},l.unpack=function(t,r,a){r=n(r,0);var i=e.unpack(t,r);return l.fromCartesian3(i,a)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,n){var a=t.longitude,i=t.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return r(n)||(n=new e),n.x=u,n.y=s,n.z=c,e.normalize(n,n)},l.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var f=new e,h=new e;l.prototype.cartographicToCartesian=function(t,n){var a=f,i=h;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(e.dot(a,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(a,t.height,a),r(n)||(n=new e),e.add(i,a,n)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var d=new e,E=new e,p=new e;return l.prototype.cartesianToCartographic=function(n,a){var i=this.scaleToGeodeticSurface(n,E);if(r(i)){var o=this.geodeticSurfaceNormal(i,d),s=e.subtract(n,i,p),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),f=u.sign(e.dot(s,n))*e.magnitude(s);return r(a)?(a.longitude=c,a.latitude=l,a.height=f,a):new t(c,l,f)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var a=t.x,i=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return e.multiplyByScalar(t,s,n)},l.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},l.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},l.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,a,i){a=n(a,0);var o=this._sqauredXOverSquaredZ;if(r(i)||(i=new e),i.x=0,i.y=0,i.z=t.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},l}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,a,i,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return r(n)?(n.x=i,n.y=o,n.z=u,n):new e(i,o,u)},u.prototype.unproject=function(e,n){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,u=e.z;return r(n)?(n.longitude=i,n.latitude=o,n.height=u,n):new t(i,o,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";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a,i,o,u,s,c){this[0]=n(e,0),this[1]=n(a,0),this[2]=n(u,0),this[3]=n(t,0),this[4]=n(i,0),this[5]=n(s,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(c,0)}function c(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function l(e){for(var t=0,n=0;n<3;++n){var r=e[s.getElementIndex(p[n],E[n])];t+=2*r*r}return Math.sqrt(t)}function f(e,t){for(var n=u.EPSILON15,r=0,a=1,i=0;i<3;++i){var o=Math.abs(e[s.getElementIndex(p[i],E[i])]);o>r&&(a=i,r=o)}var c=1,l=0,f=E[a],h=p[a];if(Math.abs(e[s.getElementIndex(h,f)])>n){var d,y=e[s.getElementIndex(h,h)],m=e[s.getElementIndex(f,f)],_=e[s.getElementIndex(h,f)],T=(y-m)/2/_;d=T<0?-1/(-T+Math.sqrt(1+T*T)):1/(T+Math.sqrt(1+T*T)),c=1/Math.sqrt(1+d*d),l=d*c}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(f,f)]=t[s.getElementIndex(h,h)]=c,t[s.getElementIndex(h,f)]=l,t[s.getElementIndex(f,h)]=-l,t}s.packedLength=9,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t},s.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a},s.clone=function(e,t){if(r(e))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):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t],a[1]=e[t+1],a[2]=e[t+2],a[3]=e[t+3],a[4]=e[t+4],a[5]=e[t+5],a[6]=e[t+6],a[7]=e[t+7],a[8]=e[t+8],a},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[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 s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var n=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,u=e.y*e.y,c=e.y*e.z,l=e.y*e.w,f=e.z*e.z,h=e.z*e.w,d=e.w*e.w,E=n-u-f+d,p=2*(a-h),y=2*(i+l),m=2*(a+h),_=-n+u-f+d,T=2*(c-o),R=2*(i-l),A=2*(c+o),v=-n-u+f+d;return r(t)?(t[0]=E,t[1]=m,t[2]=R,t[3]=p,t[4]=_,t[5]=A,t[6]=y,t[7]=T,t[8]=v,t):new s(E,p,y,m,_,T,R,A,v)},s.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),a=Math.cos(-e.heading),i=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),c=Math.sin(e.roll),l=n*a,f=-i*u+c*o*a,h=c*u+i*o*a,d=n*u,E=i*a+c*o*u,p=-o*i+i*o*u,y=-o,m=c*n,_=i*n;return r(t)?(t[0]=l,t[1]=d,t[2]=y,t[3]=f,t[4]=E,t[5]=m,t[6]=h,t[7]=p,t[8]=_,t):new s(l,f,h,d,E,p,y,m,_)},s.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 s(e.x,0,0,0,e.y,0,0,0,e.z)},s.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 s(e,0,0,0,e,0,0,0,e)},s.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 s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=a,t[6]=0,t[7]=-a,t[8]=n,t):new s(1,0,0,0,n,-a,0,a,n)},s.fromRotationY=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=n,t):new s(n,0,a,0,1,0,-a,0,n)},s.fromRotationZ=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=a,t[2]=0,t[3]=-a,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(n,-a,0,a,n,0,0,0,1)},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):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,n){var r=3*t,a=e[r],i=e[r+1],o=e[r+2];return n.x=a,n.y=i,n.z=o,n},s.setColumn=function(e,t,n,r){r=s.clone(e,r);var a=3*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},s.getRow=function(e,t,n){var r=e[t],a=e[t+3],i=e[t+6];return n.x=r,n.y=a,n.z=i,n},s.setRow=function(e,t,n,r){return r=s.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var h=new e;s.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],h)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],h)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],h)),n};var d=new e;s.getMaximumScale=function(t){return s.getScale(t,d),e.maximumComponent(d)},s.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=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 n[0]=r,n[1]=a,n[2]=i,n[3]=o,n[4]=u,n[5]=s,n[6]=c,n[7]=l,n[8]=f,n},s.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},s.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},s.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[3]*a+e[6]*i,u=e[1]*r+e[4]*a+e[7]*i,s=e[2]*r+e[5]*a+e[8]*i;return n.x=o,n.y=u,n.z=s,n},s.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},s.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},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},s.transpose=function(e,t){var n=e[0],r=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=n,t[1]=r,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var E=[1,0,0],p=[2,2,1],y=new s,m=new s;return s.computeEigenDecomposition=function(e,t){var n=u.EPSILON20,a=10,i=0,o=0;r(t)||(t={});for(var h=t.unitary=s.clone(s.IDENTITY,t.unitary),d=t.diagonal=s.clone(e,t.diagonal),E=n*c(d);o<a&&l(d)>E;)f(d,y),s.transpose(y,m),s.multiply(d,y,d),s.multiply(m,d,d),s.multiply(h,y,h),++i>2&&(++o,i=0);return 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},s.determinant=function(e){var t=e[0],n=e[3],r=e[6],a=e[1],i=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*o)+a*(s*r-n*c)+u*(n*o-i*r)},s.inverse=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[3],o=e[4],u=e[5],c=e[6],l=e[7],f=e[8],h=s.determinant(e);t[0]=o*f-l*u,t[1]=l*a-r*f,t[2]=r*u-o*a,t[3]=c*u-i*f,t[4]=n*f-c*a,t[5]=i*a-n*u,t[6]=i*l-c*o,t[7]=c*r-n*l,t[8]=n*o-i*r;var d=1/h;return s.multiplyByScalar(t,d,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]},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},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,a(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r,a){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(a,0)}o.fromElements=function(e,t,r,a,i){return n(i)?(i.x=e,i.y=t,i.z=r,i.w=a,i):new o(e,t,r,a)},o.fromColor=function(e,t){return n(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(n(e))return n(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)},o.packedLength=4,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r++],a.w=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=4*r:t=new Array(4*r);for(var a=0;a<r;++a)o.pack(e[a],t,4*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/4:t=new Array(r/4);for(var a=0;a<r;a+=4){var i=a/4;t[i]=o.unpack(e,a,t[i])}return t},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,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},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 u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,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,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},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 s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,c);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)&&i.equalsEpsilon(e.w,t.w,r,a)},o.ZERO=a(new o(0,0,0,0)),o.UNIT_X=a(new o(1,0,0,0)),o.UNIT_Y=a(new o(0,1,0,0)),o.UNIT_Z=a(new o(0,0,1,0)),o.UNIT_W=a(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,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){ +this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,a,i,o,u,s,c,l){"use strict";function f(e,t,n,a,i,o,u,s,c,l,f,h,d,E,p,y){this[0]=r(e,0),this[1]=r(i,0),this[2]=r(c,0),this[3]=r(d,0),this[4]=r(t,0),this[5]=r(o,0),this[6]=r(l,0),this[7]=r(E,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(f,0),this[11]=r(p,0),this[12]=r(a,0),this[13]=r(s,0),this[14]=r(h,0),this[15]=r(y,0)}f.packedLength=16,f.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},f.unpack=function(e,t,n){return t=r(t,0),a(n)||(n=new f),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},f.clone=function(e,t){if(a(e))return a(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 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])},f.fromArray=f.unpack,f.fromColumnMajorArray=function(e,t){return f.clone(e,t)},f.fromRowMajorArray=function(e,t){return a(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 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(t,n,i){return n=r(n,e.ZERO),a(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=1,i):new f(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},f.fromTranslationQuaternionRotationScale=function(e,t,n,r){a(r)||(r=new f);var i=n.x,o=n.y,u=n.z,s=t.x*t.x,c=t.x*t.y,l=t.x*t.z,h=t.x*t.w,d=t.y*t.y,E=t.y*t.z,p=t.y*t.w,y=t.z*t.z,m=t.z*t.w,_=t.w*t.w,T=s-d-y+_,R=2*(c-m),A=2*(l+p),v=2*(c+m),S=-s+d-y+_,N=2*(E-h),g=2*(l-p),O=2*(E+h),M=-s-d+y+_;return r[0]=T*i,r[1]=v*i,r[2]=g*i,r[3]=0,r[4]=R*o,r[5]=S*o,r[6]=O*o,r[7]=0,r[8]=A*u,r[9]=N*u,r[10]=M*u,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},f.fromTranslationRotationScale=function(e,t){return f.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},f.fromTranslation=function(e,t){return f.fromRotationTranslation(c.IDENTITY,e,t)},f.fromScale=function(e,t){return a(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 f(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},f.fromUniformScale=function(e,t){return a(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 f(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var h=new e,d=new e,E=new e;f.fromCamera=function(t,n){var r=t.position,i=t.direction,o=t.up;e.normalize(i,h),e.normalize(e.cross(h,o,d),d),e.normalize(e.cross(d,h,E),E);var u=d.x,s=d.y,c=d.z,l=h.x,p=h.y,y=h.z,m=E.x,_=E.y,T=E.z,R=r.x,A=r.y,v=r.z,S=u*-R+s*-A+c*-v,N=m*-R+_*-A+T*-v,g=l*R+p*A+y*v;return a(n)?(n[0]=u,n[1]=m,n[2]=-l,n[3]=0,n[4]=s,n[5]=_,n[6]=-p,n[7]=0,n[8]=c,n[9]=T,n[10]=-y,n[11]=0,n[12]=S,n[13]=N,n[14]=g,n[15]=1,n):new f(u,s,c,S,m,_,T,N,-l,-p,-y,g,0,0,0,1)},f.computePerspectiveFieldOfView=function(e,t,n,r,a){var i=Math.tan(.5*e),o=1/i,u=o/t,s=(r+n)/(n-r),c=2*r*n/(n-r);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=c,a[15]=0,a},f.computeOrthographicOffCenter=function(e,t,n,r,a,i,o){var u=1/(t-e),s=1/(r-n),c=1/(i-a),l=-(t+e)*u,f=-(r+n)*s,h=-(i+a)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=f,o[14]=h,o[15]=1,o},f.computePerspectiveOffCenter=function(e,t,n,r,a,i,o){var u=2*a/(t-e),s=2*a/(r-n),c=(t+e)/(t-e),l=(r+n)/(r-n),f=-(i+a)/(i-a),h=-1,d=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=f,o[11]=h,o[12]=0,o[13]=0,o[14]=d,o[15]=0,o},f.computeInfinitePerspectiveOffCenter=function(e,t,n,r,a,i){var o=2*a/(t-e),u=2*a/(r-n),s=(t+e)/(t-e),c=(r+n)/(r-n),l=-1,f=-1,h=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=s,i[9]=c,i[10]=l,i[11]=f,i[12]=0,i[13]=0,i[14]=h,i[15]=0,i},f.computeViewportTransformation=function(e,t,n,a){e=r(e,r.EMPTY_OBJECT);var i=r(e.x,0),o=r(e.y,0),u=r(e.width,0),s=r(e.height,0);t=r(t,0),n=r(n,1);var c=.5*u,l=.5*s,f=.5*(n-t),h=c,d=l,E=f,p=i+c,y=o+l,m=t+f,_=1;return a[0]=h,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=d,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=E,a[11]=0,a[12]=p,a[13]=y,a[14]=m,a[15]=_,a},f.computeView=function(t,n,r,a,i){return i[0]=a.x,i[1]=r.x,i[2]=-n.x,i[3]=0,i[4]=a.y,i[5]=r.y,i[6]=-n.y,i[7]=0,i[8]=a.z,i[9]=r.z,i[10]=-n.z,i[11]=0,i[12]=-e.dot(a,t),i[13]=-e.dot(r,t),i[14]=e.dot(n,t),i[15]=1,i},f.toArray=function(e,t){return a(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]]},f.getElementIndex=function(e,t){return 4*e+t},f.getColumn=function(e,t,n){var r=4*t,a=e[r],i=e[r+1],o=e[r+2],u=e[r+3];return n.x=a,n.y=i,n.z=o,n.w=u,n},f.setColumn=function(e,t,n,r){r=f.clone(e,r);var a=4*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r[a+3]=n.w,r},f.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},f.getRow=function(e,t,n){var r=e[t],a=e[t+4],i=e[t+8],o=e[t+12];return n.x=r,n.y=a,n.z=i,n.w=o,n},f.setRow=function(e,t,n,r){return r=f.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var p=new e;f.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],p)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],p)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],p)),n};var y=new e;f.getMaximumScale=function(t){return f.getScale(t,y),e.maximumComponent(y)},f.multiply=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],f=e[8],h=e[9],d=e[10],E=e[11],p=e[12],y=e[13],m=e[14],_=e[15],T=t[0],R=t[1],A=t[2],v=t[3],S=t[4],N=t[5],g=t[6],O=t[7],M=t[8],I=t[9],x=t[10],w=t[11],C=t[12],P=t[13],U=t[14],D=t[15],L=r*T+u*R+f*A+p*v,F=a*T+s*R+h*A+y*v,z=i*T+c*R+d*A+m*v,B=o*T+l*R+E*A+_*v,b=r*S+u*N+f*g+p*O,G=a*S+s*N+h*g+y*O,q=i*S+c*N+d*g+m*O,W=o*S+l*N+E*g+_*O,X=r*M+u*I+f*x+p*w,V=a*M+s*I+h*x+y*w,H=i*M+c*I+d*x+m*w,Y=o*M+l*I+E*x+_*w,Z=r*C+u*P+f*U+p*D,k=a*C+s*P+h*U+y*D,j=i*C+c*P+d*U+m*D,K=o*C+l*P+E*U+_*D;return n[0]=L,n[1]=F,n[2]=z,n[3]=B,n[4]=b,n[5]=G,n[6]=q,n[7]=W,n[8]=X,n[9]=V,n[10]=H,n[11]=Y,n[12]=Z,n[13]=k,n[14]=j,n[15]=K,n},f.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},f.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},f.multiplyTransformation=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=e[12],d=e[13],E=e[14],p=t[0],y=t[1],m=t[2],_=t[4],T=t[5],R=t[6],A=t[8],v=t[9],S=t[10],N=t[12],g=t[13],O=t[14],M=r*p+o*y+c*m,I=a*p+u*y+l*m,x=i*p+s*y+f*m,w=r*_+o*T+c*R,C=a*_+u*T+l*R,P=i*_+s*T+f*R,U=r*A+o*v+c*S,D=a*A+u*v+l*S,L=i*A+s*v+f*S,F=r*N+o*g+c*O+h,z=a*N+u*g+l*O+d,B=i*N+s*g+f*O+E;return n[0]=M,n[1]=I,n[2]=x,n[3]=0,n[4]=w,n[5]=C,n[6]=P,n[7]=0,n[8]=U,n[9]=D,n[10]=L,n[11]=0,n[12]=F,n[13]=z,n[14]=B,n[15]=1,n},f.multiplyByMatrix3=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=t[0],d=t[1],E=t[2],p=t[3],y=t[4],m=t[5],_=t[6],T=t[7],R=t[8],A=r*h+o*d+c*E,v=a*h+u*d+l*E,S=i*h+s*d+f*E,N=r*p+o*y+c*m,g=a*p+u*y+l*m,O=i*p+s*y+f*m,M=r*_+o*T+c*R,I=a*_+u*T+l*R,x=i*_+s*T+f*R;return n[0]=A,n[1]=v,n[2]=S,n[3]=0,n[4]=N,n[5]=g,n[6]=O,n[7]=0,n[8]=M,n[9]=I,n[10]=x,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},f.multiplyByTranslation=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=r*e[0]+a*e[4]+i*e[8]+e[12],u=r*e[1]+a*e[5]+i*e[9]+e[13],s=r*e[2]+a*e[6]+i*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=s,n[15]=e[15],n};var m=new e;f.multiplyByUniformScale=function(e,t,n){return m.x=t,m.y=t,m.z=t,f.multiplyByScale(e,m,n)},f.multiplyByScale=function(e,t,n){var r=t.x,a=t.y,i=t.z;return 1===r&&1===a&&1===i?f.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=a*e[4],n[5]=a*e[5],n[6]=a*e[6],n[7]=0,n[8]=i*e[8],n[9]=i*e[9],n[10]=i*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},f.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=t.w,u=e[0]*r+e[4]*a+e[8]*i+e[12]*o,s=e[1]*r+e[5]*a+e[9]*i+e[13]*o,c=e[2]*r+e[6]*a+e[10]*i+e[14]*o,l=e[3]*r+e[7]*a+e[11]*i+e[15]*o;return n.x=u,n.y=s,n.z=c,n.w=l,n},f.multiplyByPointAsVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i,u=e[1]*r+e[5]*a+e[9]*i,s=e[2]*r+e[6]*a+e[10]*i;return n.x=o,n.y=u,n.z=s,n},f.multiplyByPoint=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i+e[12],u=e[1]*r+e[5]*a+e[9]*i+e[13],s=e[2]*r+e[6]*a+e[10]*i+e[14];return n.x=o,n.y=u,n.z=s,n},f.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},f.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},f.transpose=function(e,t){var n=e[1],r=e[2],a=e[3],i=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=o,t[14]=u,t[15]=e[15],t},f.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},f.equals=function(e,t){return e===t||a(e)&&a(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},f.equalsEpsilon=function(e,t,n){return e===t||a(e)&&a(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},f.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},f.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};var _=new c,T=new c,R=new t,A=new t(0,0,0,1);return f.inverse=function(e,n){if(c.equalsEpsilon(f.getRotation(e,_),T,s.EPSILON7)&&t.equals(f.getRow(e,3,R),A))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],a=e[4],i=e[8],o=e[12],u=e[1],h=e[5],d=e[9],E=e[13],p=e[2],y=e[6],m=e[10],v=e[14],S=e[3],N=e[7],g=e[11],O=e[15],M=m*O,I=v*g,x=y*O,w=v*N,C=y*g,P=m*N,U=p*O,D=v*S,L=p*g,F=m*S,z=p*N,B=y*S,b=M*h+w*d+C*E-(I*h+x*d+P*E),G=I*u+U*d+F*E-(M*u+D*d+L*E),q=x*u+D*h+z*E-(w*u+U*h+B*E),W=P*u+L*h+B*d-(C*u+F*h+z*d),X=I*a+x*i+P*o-(M*a+w*i+C*o),V=M*r+D*i+L*o-(I*r+U*i+F*o),H=w*r+U*a+B*o-(x*r+D*a+z*o),Y=C*r+F*a+z*i-(P*r+L*a+B*i);M=i*E,I=o*d,x=a*E,w=o*h,C=a*d,P=i*h,U=r*E,D=o*u,L=r*d,F=i*u,z=r*h,B=a*u;var Z=M*N+w*g+C*O-(I*N+x*g+P*O),k=I*S+U*g+F*O-(M*S+D*g+L*O),j=x*S+D*N+z*O-(w*S+U*N+B*O),K=P*S+L*N+B*g-(C*S+F*N+z*g),J=x*m+P*v+I*y-(C*v+M*y+w*m),Q=L*v+M*p+D*m-(U*m+F*v+I*p),$=U*y+B*v+w*p-(z*v+x*p+D*y),ee=z*m+C*p+F*y-(L*y+B*m+P*p),te=r*b+a*G+i*q+o*W;if(Math.abs(te)<s.EPSILON20)throw new l("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=b*te,n[1]=G*te,n[2]=q*te,n[3]=W*te,n[4]=X*te,n[5]=V*te,n[6]=H*te,n[7]=Y*te,n[8]=Z*te,n[9]=k*te,n[10]=j*te,n[11]=K*te,n[12]=J*te,n[13]=Q*te,n[14]=$*te,n[15]=ee*te,n},f.inverseTransformation=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],f=e[12],h=e[13],d=e[14],E=-n*f-r*h-a*d,p=-i*f-o*h-u*d,y=-s*f-c*h-l*d;return t[0]=n,t[1]=i,t[2]=s,t[3]=0,t[4]=r,t[5]=o,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=l,t[11]=0,t[12]=E,t[13]=p,t[14]=y,t[15]=1,t},f.IDENTITY=u(new f(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),f.ZERO=u(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,i(f.prototype,{length:{get:function(){return f.packedLength}}}),f.prototype.clone=function(e){return f.clone(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},f.prototype.equalsEpsilon=function(e,t){return f.equalsEpsilon(this,e,t)},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/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(e,t,r,a){this.west=n(e,0),this.south=n(t,0),this.east=n(r,0),this.north=n(a,0)}a(c.prototype,{width:{get:function(){return c.computeWidth(this)}},height:{get:function(){return c.computeHeight(this)}}}),c.packedLength=4,c.pack=function(e,t,r){return r=n(r,0),t[r++]=e.west,t[r++]=e.south,t[r++]=e.east,t[r]=e.north,t},c.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new c),a.west=e[t++],a.south=e[t++],a.east=e[t++],a.north=e[t],a},c.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=s.TWO_PI),t-n},c.computeHeight=function(e){return e.north-e.south},c.fromDegrees=function(e,t,a,i,o){return e=s.toRadians(n(e,0)),t=s.toRadians(n(t,0)),a=s.toRadians(n(a,0)),i=s.toRadians(n(i,0)),r(o)?(o.west=e,o.south=t,o.east=a,o.north=i,o):new c(e,t,a,i)},c.fromRadians=function(e,t,a,i,o){return r(o)?(o.west=n(e,0),o.south=n(t,0),o.east=n(a,0),o.north=n(i,0),o):new c(e,t,a,i)},c.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,u=Number.MAX_VALUE,l=-Number.MAX_VALUE,f=0,h=e.length;f<h;f++){var d=e[f];n=Math.min(n,d.longitude),a=Math.max(a,d.longitude),u=Math.min(u,d.latitude),l=Math.max(l,d.latitude);var E=d.longitude>=0?d.longitude:d.longitude+s.TWO_PI;i=Math.min(i,E),o=Math.max(o,E)}return a-n>o-i&&(n=i,a=o,a>s.PI&&(a-=s.TWO_PI),n>s.PI&&(n-=s.TWO_PI)),r(t)?(t.west=n,t.south=u,t.east=a,t.north=l,t):new c(n,u,a,l)},c.fromCartesianArray=function(e,t,n){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,u=-Number.MAX_VALUE,l=Number.MAX_VALUE,f=-Number.MAX_VALUE,h=0,d=e.length;h<d;h++){var E=t.cartesianToCartographic(e[h]);a=Math.min(a,E.longitude),i=Math.max(i,E.longitude),l=Math.min(l,E.latitude),f=Math.max(f,E.latitude);var p=E.longitude>=0?E.longitude:E.longitude+s.TWO_PI;o=Math.min(o,p),u=Math.max(u,p)}return i-a>u-o&&(a=o,i=u,i>s.PI&&(i-=s.TWO_PI),a>s.PI&&(a-=s.TWO_PI)),r(n)?(n.west=a,n.south=l,n.east=i,n.north=f,n):new c(a,l,i,f)},c.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new c(e.west,e.south,e.east,e.north)},c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.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},c.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},c.validate=function(e){},c.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)},c.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)},c.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)},c.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)},c.center=function(t,n){var a=t.east,i=t.west;a<i&&(a+=s.TWO_PI);var o=s.negativePiToPi(.5*(i+a)),u=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=u,n.height=0,n):new e(o,u)},c.intersection=function(e,t,n){var a=e.east,i=e.west,o=t.east,u=t.west;a<i&&o>0?a+=s.TWO_PI:o<u&&a>0&&(o+=s.TWO_PI),a<i&&u<0?u+=s.TWO_PI:o<u&&i<0&&(i+=s.TWO_PI);var l=s.negativePiToPi(Math.max(i,u)),f=s.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&f<=l)){var h=Math.max(e.south,t.south),d=Math.min(e.north,t.north);if(!(h>=d))return r(n)?(n.west=l,n.south=h,n.east=f,n.north=d,n):new c(l,h,f,d)}},c.simpleIntersection=function(e,t,n){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(i>=u||a>=o))return r(n)?(n.west=a,n.south=i,n.east=o,n.north=u,n):new c(a,i,o,u)},c.union=function(e,t,n){r(n)||(n=new c);var a=e.east,i=e.west,o=t.east,u=t.west;a<i&&o>0?a+=s.TWO_PI:o<u&&a>0&&(o+=s.TWO_PI),a<i&&u<0?u+=s.TWO_PI:o<u&&i<0&&(i+=s.TWO_PI);var l=s.convertLongitudeRange(Math.min(i,u)),f=s.convertLongitudeRange(Math.max(a,o));return n.west=l,n.south=Math.min(e.south,t.south),n.east=f,n.north=Math.max(e.north,t.north),n},c.expand=function(e,t,n){return r(n)||(n=new c),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},c.contains=function(e,t){var n=t.longitude,r=t.latitude,a=e.west,i=e.east;return i<a&&(i+=s.TWO_PI,n<0&&(n+=s.TWO_PI)),(n>a||s.equalsEpsilon(n,a,s.EPSILON14))&&(n<i||s.equalsEpsilon(n,i,s.EPSILON14))&&r>=e.south&&r<=e.north};var l=new e;return c.subsample=function(e,t,a,i){t=n(t,o.WGS84),a=n(a,0),r(i)||(i=[]);var u=0,f=e.north,h=e.south,d=e.east,E=e.west,p=l;p.height=a,p.longitude=E,p.latitude=f,i[u]=t.cartographicToCartesian(p,i[u]),u++,p.longitude=d,i[u]=t.cartographicToCartesian(p,i[u]),u++,p.latitude=h,i[u]=t.cartographicToCartesian(p,i[u]),u++,p.longitude=E,i[u]=t.cartographicToCartesian(p,i[u]),u++,f<0?p.latitude=f:h>0?p.latitude=h:p.latitude=0;for(var y=1;y<8;++y)p.longitude=-Math.PI+y*s.PI_OVER_TWO,c.contains(e,p)&&(i[u]=t.cartographicToCartesian(p,i[u]),u++);return 0===p.latitude&&(p.longitude=E,i[u]=t.cartographicToCartesian(p,i[u]),u++,p.longitude=d,i[u]=t.cartographicToCartesian(p,i[u]),u++),i.length=u,i},c.MAX_VALUE=u(new c(-Math.PI,-s.PI_OVER_TWO,Math.PI,s.PI_OVER_TWO)),c}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var d=new e,E=new e,p=new e,y=new e,m=new e,_=new e,T=new e,R=new e,A=new e,v=new e,S=new e,N=new e;h.fromPoints=function(t,n){if(a(n)||(n=new h),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var r=e.clone(t[0],T),i=e.clone(r,d),o=e.clone(r,E),u=e.clone(r,p),s=e.clone(r,y),c=e.clone(r,m),l=e.clone(r,_),f=t.length,g=1;g<f;g++){e.clone(t[g],r);var O=r.x,M=r.y,I=r.z;O<i.x&&e.clone(r,i),O>s.x&&e.clone(r,s),M<o.y&&e.clone(r,o),M>c.y&&e.clone(r,c),I<u.z&&e.clone(r,u),I>l.z&&e.clone(r,l)}var x=e.magnitudeSquared(e.subtract(s,i,R)),w=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=i,U=s,D=x;w>D&&(D=w,P=o,U=c),C>D&&(D=C,P=u,U=l);var L=A;L.x=.5*(P.x+U.x),L.y=.5*(P.y+U.y),L.z=.5*(P.z+U.z);var F=e.magnitudeSquared(e.subtract(U,L,R)),z=Math.sqrt(F),B=v;B.x=i.x,B.y=o.y,B.z=u.z;var b=S;b.x=s.x,b.y=c.y,b.z=l.z;var G=e.multiplyByScalar(e.add(B,b,R),.5,N),q=0;for(g=0;g<f;g++){e.clone(t[g],r);var W=e.magnitude(e.subtract(r,G,R));W>q&&(q=W);var X=e.magnitudeSquared(e.subtract(r,L,R));if(X>F){var V=Math.sqrt(X);z=.5*(z+V),F=z*z;var H=V-z;L.x=(z*L.x+H*r.x)/V,L.y=(z*L.y+H*r.y)/V,L.z=(z*L.z+H*r.z)/V}}return z<q?(e.clone(L,n.center),n.radius=z):(e.clone(G,n.center),n.radius=q),n};var g=new o,O=new e,M=new e,I=new t,x=new t;h.fromRectangle2D=function(e,t,n){return h.fromRectangleWithHeights2D(e,t,0,0,n)},h.fromRectangleWithHeights2D=function(t,n,i,o,u){if(a(u)||(u=new h),!a(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;n=r(n,g),f.southwest(t,I),I.height=i,f.northeast(t,x),x.height=o;var s=n.project(I,O),c=n.project(x,M),l=c.x-s.x,d=c.y-s.y,E=c.z-s.z;u.radius=.5*Math.sqrt(l*l+d*d+E*E);var p=u.center;return p.x=s.x+.5*l,p.y=s.y+.5*d,p.z=s.z+.5*E,u};var w=[];h.fromRectangle3D=function(e,t,n,o){t=r(t,i.WGS84),n=r(n,0);var u;return a(e)&&(u=f.subsample(e,t,n,w)),h.fromPoints(u,o)},h.fromVertices=function(t,n,i,o){if(a(o)||(o=new h),!a(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;n=r(n,e.ZERO),i=r(i,3);var u=T;u.x=t[0]+n.x,u.y=t[1]+n.y,u.z=t[2]+n.z;for(var s=e.clone(u,d),c=e.clone(u,E),l=e.clone(u,p),f=e.clone(u,y),g=e.clone(u,m),O=e.clone(u,_),M=t.length,I=0;I<M;I+=i){var x=t[I]+n.x,w=t[I+1]+n.y,C=t[I+2]+n.z;u.x=x,u.y=w,u.z=C,x<s.x&&e.clone(u,s),x>f.x&&e.clone(u,f),w<c.y&&e.clone(u,c),w>g.y&&e.clone(u,g),C<l.z&&e.clone(u,l),C>O.z&&e.clone(u,O)}var P=e.magnitudeSquared(e.subtract(f,s,R)),U=e.magnitudeSquared(e.subtract(g,c,R)),D=e.magnitudeSquared(e.subtract(O,l,R)),L=s,F=f,z=P;U>z&&(z=U,L=c,F=g),D>z&&(z=D,L=l,F=O);var B=A;B.x=.5*(L.x+F.x),B.y=.5*(L.y+F.y),B.z=.5*(L.z+F.z);var b=e.magnitudeSquared(e.subtract(F,B,R)),G=Math.sqrt(b),q=v;q.x=s.x,q.y=c.y,q.z=l.z;var W=S;W.x=f.x,W.y=g.y,W.z=O.z;var X=e.multiplyByScalar(e.add(q,W,R),.5,N),V=0;for(I=0;I<M;I+=i){u.x=t[I]+n.x,u.y=t[I+1]+n.y,u.z=t[I+2]+n.z;var H=e.magnitude(e.subtract(u,X,R));H>V&&(V=H);var Y=e.magnitudeSquared(e.subtract(u,B,R));if(Y>b){var Z=Math.sqrt(Y);G=.5*(G+Z),b=G*G;var k=Z-G;B.x=(G*B.x+k*u.x)/Z,B.y=(G*B.y+k*u.y)/Z,B.z=(G*B.z+k*u.z)/Z}}return G<V?(e.clone(B,o.center),o.radius=G):(e.clone(X,o.center),o.radius=V),o},h.fromEncodedCartesianVertices=function(t,n,r){if(a(r)||(r=new h),!a(t)||!a(n)||t.length!==n.length||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var i=T;i.x=t[0]+n[0],i.y=t[1]+n[1],i.z=t[2]+n[2];for(var o=e.clone(i,d),u=e.clone(i,E),s=e.clone(i,p),c=e.clone(i,y),l=e.clone(i,m),f=e.clone(i,_),g=t.length,O=0;O<g;O+=3){var M=t[O]+n[O],I=t[O+1]+n[O+1],x=t[O+2]+n[O+2];i.x=M,i.y=I,i.z=x,M<o.x&&e.clone(i,o),M>c.x&&e.clone(i,c),I<u.y&&e.clone(i,u),I>l.y&&e.clone(i,l),x<s.z&&e.clone(i,s),x>f.z&&e.clone(i,f)}var w=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=e.magnitudeSquared(e.subtract(f,s,R)),U=o,D=c,L=w;C>L&&(L=C,U=u,D=l),P>L&&(L=P,U=s,D=f);var F=A;F.x=.5*(U.x+D.x),F.y=.5*(U.y+D.y),F.z=.5*(U.z+D.z);var z=e.magnitudeSquared(e.subtract(D,F,R)),B=Math.sqrt(z),b=v;b.x=o.x,b.y=u.y,b.z=s.z;var G=S;G.x=c.x,G.y=l.y,G.z=f.z;var q=e.multiplyByScalar(e.add(b,G,R),.5,N),W=0;for(O=0;O<g;O+=3){i.x=t[O]+n[O],i.y=t[O+1]+n[O+1],i.z=t[O+2]+n[O+2];var X=e.magnitude(e.subtract(i,q,R));X>W&&(W=X);var V=e.magnitudeSquared(e.subtract(i,F,R));if(V>z){var H=Math.sqrt(V);B=.5*(B+H),z=B*B;var Y=H-B;F.x=(B*F.x+Y*i.x)/H,F.y=(B*F.y+Y*i.y)/H,F.z=(B*F.z+Y*i.z)/H}}return B<W?(e.clone(F,r.center),r.radius=B):(e.clone(q,r.center),r.radius=W),r},h.fromCornerPoints=function(t,n,r){a(r)||(r=new h);var i=r.center;return e.add(t,n,i),e.multiplyByScalar(i,.5,i),r.radius=e.distance(i,n),r},h.fromEllipsoid=function(t,n){return a(n)||(n=new h),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var C=new e;h.fromBoundingSpheres=function(t,n){if(a(n)||(n=new h),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var r=t.length;if(1===r)return h.clone(t[0],n);if(2===r)return h.union(t[0],t[1],n);for(var i=[],o=0;o<r;o++)i.push(t[o].center);n=h.fromPoints(i,n);var u=n.center,s=n.radius;for(o=0;o<r;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,C)+c.radius)}return n.radius=s,n};var P=new e,U=new e,D=new e;h.fromOrientedBoundingBox=function(t,n){a(n)||(n=new h);var r=t.halfAxes,i=c.getColumn(r,0,P),o=c.getColumn(r,1,U),u=c.getColumn(r,2,D),s=e.magnitude(i),l=e.magnitude(o),f=e.magnitude(u);return n.center=e.clone(t.center,n.center),n.radius=Math.max(s,l,f),n},h.clone=function(t,n){if(a(t))return a(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new h(t.center,t.radius)},h.packedLength=4,h.pack=function(e,t,n){n=r(n,0);var a=e.center;return t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n]=e.radius,t},h.unpack=function(e,t,n){t=r(t,0),a(n)||(n=new h);var i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};var L=new e,F=new e;h.union=function(t,n,r){a(r)||(r=new h);var i=t.center,o=t.radius,u=n.center,s=n.radius,c=e.subtract(u,i,L),l=e.magnitude(c);if(o>=l+s)return t.clone(r),r;if(s>=l+o)return n.clone(r),r;var f=.5*(o+l+s),d=e.multiplyByScalar(c,(-o+f)/l,F);return e.add(d,i,d),e.clone(d,r.center),r.radius=f,r};var z=new e;h.expand=function(t,n,r){r=h.clone(t,r);var a=e.magnitude(e.subtract(n,r.center,z));return a>r.radius&&(r.radius=a),r},h.intersectPlane=function(t,n){var r=t.center,a=t.radius,i=n.normal,o=e.dot(i,r)+n.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},h.transform=function(e,t,n){return a(n)||(n=new h),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=l.getMaximumScale(t)*e.radius,n};var B=new e;h.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,B);return e.magnitudeSquared(r)-t.radius*t.radius},h.transformWithoutScale=function(e,t,n){return a(n)||(n=new h),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var b=new e;h.computePlaneDistances=function(t,n,r,i){a(i)||(i=new s);var o=e.subtract(t.center,n,b),u=e.dot(r,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var G=new e,q=new e,W=new e,X=new e,V=new e,H=new t,Y=new Array(8),Z=0;Z<8;++Z)Y[Z]=new e;var k=new o;return h.projectTo2D=function(t,n,a){n=r(n,k);var i=n.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,G),c=e.cross(e.UNIT_Z,s,q);e.normalize(c,c);var l=e.cross(s,c,W);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var f=e.negate(l,V),d=e.negate(c,X),E=Y,p=E[0];e.add(s,l,p),e.add(p,c,p),p=E[1],e.add(s,l,p),e.add(p,d,p),p=E[2],e.add(s,f,p),e.add(p,d,p),p=E[3],e.add(s,f,p),e.add(p,c,p),e.negate(s,s),p=E[4],e.add(s,l,p),e.add(p,c,p),p=E[5],e.add(s,l,p),e.add(p,d,p),p=E[6],e.add(s,f,p),e.add(p,d,p),p=E[7],e.add(s,f,p),e.add(p,c,p);for(var y=E.length,m=0;m<y;++m){var _=E[m];e.add(o,_,_);var T=i.cartesianToCartographic(_,H);n.project(T,_)}a=h.fromPoints(E,a),o=a.center;var R=o.x,A=o.y,v=o.z;return o.x=v,o.y=R,o.z=A,a},h.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},h.equals=function(t,n){return t===n||a(t)&&a(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},h.prototype.intersectPlane=function(e){return h.intersectPlane(this,e)},h.prototype.distanceSquaredTo=function(e){return h.distanceSquaredTo(this,e)},h.prototype.computePlaneDistances=function(e,t,n){return h.computePlaneDistances(this,e,t,n)},h.prototype.isOccluded=function(e){return h.isOccluded(this,e)},h.prototype.equals=function(e){return h.equals(this,e)},h.prototype.clone=function(e){return h.clone(this,e)},h}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return t(a,{element:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(r.requestFullscreen=a,n=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(r.requestFullscreen=a,n=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?r.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(r.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?r.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(r.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?r.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(r.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),r.fullscreenerror=a)}return n},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[r.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function a(){if(!t(A)&&(A=!1,!h())){var e=/ Chrome\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(A=!0,v=r(e[1]))}return A}function i(){return a()&&v}function o(){if(!t(S)&&(S=!1,!a()&&!h()&&/ Safari\/[\.0-9]+/.test(R.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(S=!0,N=r(e[1]))}return S}function u(){return o()&&N}function s(){if(!t(g)){g=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(R.userAgent);null!==e&&(g=!0,O=r(e[1]),O.isNightly=!!e[2]); +}return g}function c(){return s()&&O}function l(){if(!t(M)){M=!1;var e;"Microsoft Internet Explorer"===R.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(M=!0,I=r(e[1]))):"Netscape"===R.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(M=!0,I=r(e[1])))}return M}function f(){return l()&&I}function h(){if(!t(x)){x=!1;var e=/ Edge\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(x=!0,w=r(e[1]))}return x}function d(){return h()&&w}function E(){if(!t(C)){C=!1;var e=/Firefox\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(C=!0,P=r(e[1]))}return C}function p(){return t(U)||(U=/Windows/i.test(R.appVersion)),U}function y(){return E()&&P}function m(){return t(D)||(D="undefined"!=typeof PointerEvent&&(!t(R.pointerEnabled)||R.pointerEnabled)),D}function _(){if(!t(F)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;F=t(n)&&""!==n,F&&(L=n)}return F}function T(){return _()?L:void 0}var R;R="undefined"!=typeof navigator?navigator:{};var A,v,S,N,g,O,M,I,x,w,C,P,U,D,L,F,z={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isEdge:h,edgeVersion:d,isFirefox:E,firefoxVersion:y,isWindows:p,hardwareConcurrency:e(R.hardwareConcurrency,3),supportsPointerEvents:m,supportsImageRenderingPixelated:_,imageRenderingValue:T};return z.supportsFullscreen=function(){return n.supportsFullscreen()},z.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},z.supportsWebWorkers=function(){return"undefined"!=typeof Worker},z}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,a,i){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){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.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},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 Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,a){switch(r=e(r,0),a=e(a,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,a);case o.SHORT:return new Int16Array(n,r,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,a);case o.INT:return new Int32Array(n,r,a);case o.UNSIGNED_INT:return new Uint32Array(n,r,a);case o.FLOAT:return new Float32Array(n,r,a);case o.DOUBLE:return new Float64Array(n,r,a)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/CornerType",["./freezeObject"],function(e){"use strict";var t={ROUNDED:0,MITERED:1,BEVELED:2};return e(t)}),define("Core/EllipsoidGeodesic",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){var t=e._uSquared,n=e._ellipsoid.maximumRadius,r=e._ellipsoid.minimumRadius,a=(n-r)/n,i=Math.cos(e._startHeading),o=Math.sin(e._startHeading),u=(1-a)*Math.tan(e._start.latitude),s=1/Math.sqrt(1+u*u),c=s*u,l=Math.atan2(u,i),f=s*o,h=f*f,d=1-h,E=Math.sqrt(d),p=t/4,y=p*p,m=y*p,_=y*y,T=1+p-3*y/4+5*m/4-175*_/64,R=1-p+15*y/8-35*m/8,A=1-3*p+35*y/4,v=1-5*p,S=T*l-R*Math.sin(2*l)*p/2-A*Math.sin(4*l)*y/16-v*Math.sin(6*l)*m/48-5*Math.sin(8*l)*_/512,N=e._constants;N.a=n,N.b=r,N.f=a,N.cosineHeading=i,N.sineHeading=o,N.tanU=u,N.cosineU=s,N.sineU=c,N.sigma=l,N.sineAlpha=f,N.sineSquaredAlpha=h,N.cosineSquaredAlpha=d,N.cosineAlpha=E,N.u2Over4=p,N.u4Over16=y,N.u6Over64=m,N.u8Over256=_,N.a0=T,N.a1=R,N.a2=A,N.a3=v,N.distanceRatio=S}function c(e,t){return e*t*(4+e*(4-3*t))/16}function l(e,t,n,r,a,i,o){var u=c(e,n);return(1-u)*e*t*(r+u*a*(o+u*i*(2*o*o-1)))}function f(e,t,n,r,a,i,o){var s,c,f,h,d,E=(t-n)/t,p=i-r,y=Math.atan((1-E)*Math.tan(a)),m=Math.atan((1-E)*Math.tan(o)),_=Math.cos(y),T=Math.sin(y),R=Math.cos(m),A=Math.sin(m),v=_*R,S=_*A,N=T*A,g=T*R,O=p,M=u.TWO_PI,I=Math.cos(O),x=Math.sin(O);do{I=Math.cos(O),x=Math.sin(O);var w=S-g*I;f=Math.sqrt(R*R*x*x+w*w),c=N+v*I,s=Math.atan2(f,c);var C;0===f?(C=0,h=1):(C=v*x/f,h=1-C*C),M=O,d=c-2*N/h,isNaN(d)&&(d=0),O=p+l(E,C,h,s,f,c,d)}while(Math.abs(O-M)>u.EPSILON12);var P=h*(t*t-n*n)/(n*n),U=1+P*(4096+P*(P*(320-175*P)-768))/16384,D=P*(256+P*(P*(74-47*P)-128))/1024,L=d*d,F=D*f*(d+D*(c*(2*L-1)-D*d*(4*f*f-3)*(4*L-3)/6)/4),z=n*U*(s-F),B=Math.atan2(R*x,S-g*I),b=Math.atan2(_*x,S*I-g);e._distance=z,e._startHeading=B,e._endHeading=b,e._uSquared=P}function h(n,r,a,i){e.normalize(i.cartographicToCartesian(r,p),E),e.normalize(i.cartographicToCartesian(a,p),p);f(n,i.maximumRadius,i.minimumRadius,r.longitude,r.latitude,a.longitude,a.latitude),n._start=t.clone(r,n._start),n._end=t.clone(a,n._end),n._start.height=0,n._end.height=0,s(n)}function d(e,a,i){var u=n(i,o.WGS84);this._ellipsoid=u,this._start=new t,this._end=new t,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,r(e)&&r(a)&&h(this,e,a,u)}var E=new e,p=new e;return a(d.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return this._startHeading}},endHeading:{get:function(){return this._endHeading}}}),d.prototype.setEndPoints=function(e,t){h(this,e,t,this._ellipsoid)},d.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},d.prototype.interpolateUsingSurfaceDistance=function(e,n){var a=this._constants,i=a.distanceRatio+e/a.b,o=Math.cos(2*i),u=Math.cos(4*i),s=Math.cos(6*i),c=Math.sin(2*i),f=Math.sin(4*i),h=Math.sin(6*i),d=Math.sin(8*i),E=i*i,p=i*E,y=a.u8Over256,m=a.u2Over4,_=a.u6Over64,T=a.u4Over16,R=2*p*y*o/3+i*(1-m+7*T/4-15*_/4+579*y/64-(T-15*_/4+187*y/16)*o-(5*_/4-115*y/16)*u-29*y*s/16)+(m/2-T+71*_/32-85*y/16)*c+(5*T/16-5*_/4+383*y/96)*f-E*((_-11*y/2)*c+5*y*f/2)+(29*_/96-29*y/16)*h+539*y*d/1536,A=Math.asin(Math.sin(R)*a.cosineAlpha),v=Math.atan(a.a/a.b*Math.tan(A));R-=a.sigma;var S=Math.cos(2*a.sigma+R),N=Math.sin(R),g=Math.cos(R),O=a.cosineU*g,M=a.sineU*N,I=Math.atan2(N*a.sineHeading,O-M*a.cosineHeading),x=I-l(a.f,a.sineAlpha,a.cosineSquaredAlpha,R,N,g,S);return r(n)?(n.longitude=this._start.longitude+x,n.latitude=v,n.height=0,n):new t(this._start.longitude+x,v,0)},d}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function n(e,n,r){var a=e+n;return t.sign(e)!==t.sign(n)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(n)))<r?0:a}var r={};return r.computeDiscriminant=function(e,t,n){var r=t*t-4*e*n;return r},r.computeRealRoots=function(e,r,a){var i;if(0===e)return 0===r?[]:[-a/r];if(0===r){if(0===a)return[0,0];var o=Math.abs(a),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,i<0)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-r/e,i<0?[i,0]:[0,i];var c=r*r,l=4*e*a,f=n(c,-l,t.EPSILON14);if(f<0)return[];var h=-.5*n(r,t.sign(r)*Math.sqrt(f),t.EPSILON14);return r>0?[h/e,a/h]:[a/h,h/e]},r}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function n(e,t,n,r){var a,i,o=e,u=t/3,s=n/3,c=r,l=o*s,f=u*c,h=u*u,d=s*s,E=o*s-h,p=o*c-u*s,y=u*c-d,m=4*E*y-p*p;if(m<0){var _,T,R;h*f>=l*d?(_=o,T=E,R=-2*u*E+o*p):(_=c,T=y,R=-c*p+2*s*y);var A=R<0?-1:1,v=-A*Math.abs(_)*Math.sqrt(-m);i=-R+v;var S=i/2,N=S<0?-Math.pow(-S,1/3):Math.pow(S,1/3),g=i===v?-N:-T/N;return a=T<=0?N+g:-R/(N*N+g*g+T),h*f>=l*d?[(a-u)/o]:[-c/(a+s)]}var O=E,M=-2*u*E+o*p,I=y,x=-c*p+2*s*y,w=Math.sqrt(m),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*w,-M)/3);a=2*Math.sqrt(-O);var U=Math.cos(P);i=a*U;var D=a*(-U/2-C*Math.sin(P)),L=i+D>2*u?i-u:D-u,F=o,z=L/F;P=Math.abs(Math.atan2(c*w,-x)/3),a=2*Math.sqrt(-I),U=Math.cos(P),i=a*U,D=a*(-U/2-C*Math.sin(P));var B=-c,b=i+D<2*s?i+s:D+s,G=B/b,q=F*b,W=-L*b-F*B,X=L*B,V=(s*W-u*X)/(-u*W+s*q);return z<=V?z<=G?V<=G?[z,V,G]:[z,G,V]:[G,z,V]:z<=G?[V,z,G]:V<=G?[V,G,z]:[G,V,z]}var r={};return r.computeDiscriminant=function(e,t,n,r){var a=e*e,i=t*t,o=n*n,u=r*r,s=18*e*t*n*r+i*o-27*a*u-4*(e*o*n+i*t*r);return s},r.computeRealRoots=function(e,r,a,i){var o,u;if(0===e)return t.computeRealRoots(r,a,i);if(0===r){if(0===a){if(0===i)return[0,0,0];u=-i/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===i?(o=t.computeRealRoots(e,0,a),0===o.Length?[0]:[o[0],0,o[1]]):n(e,0,a,i)}return 0===a?0===i?(u=-r/e,u<0?[u,0,0]:[0,0,u]):n(e,r,0,i):0===i?(o=t.computeRealRoots(e,r,a),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):n(e,r,a,i)},r}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,n,r){"use strict";function a(t,a,i,o){var u=t*t,s=a-3*u/8,c=i-a*t/2+u*t/8,l=o-i*t/4+a*u/16-3*u*u/256,f=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(f.length>0){var h=-t/4,d=f[f.length-1];if(Math.abs(d)<n.EPSILON14){var E=r.computeRealRoots(1,s,l);if(2===E.length){var p,y=E[0],m=E[1];if(y>=0&&m>=0){var _=Math.sqrt(y),T=Math.sqrt(m);return[h-T,h-_,h+_,h+T]}if(y>=0&&m<0)return p=Math.sqrt(y),[h-p,h+p];if(y<0&&m>=0)return p=Math.sqrt(m),[h-p,h+p]}return[]}if(d>0){var R=Math.sqrt(d),A=(s+d-c/R)/2,v=(s+d+c/R)/2,S=r.computeRealRoots(1,R,A),N=r.computeRealRoots(1,-R,v);return 0!==S.length?(S[0]+=h,S[1]+=h,0!==N.length?(N[0]+=h,N[1]+=h,S[1]<=N[0]?[S[0],S[1],N[0],N[1]]:N[1]<=S[0]?[N[0],N[1],S[0],S[1]]:S[0]>=N[0]&&S[1]<=N[1]?[N[0],S[0],S[1],N[1]]:N[0]>=S[0]&&N[1]<=S[1]?[S[0],N[0],N[1],S[1]]:S[0]>N[0]&&S[0]<N[1]?[N[0],S[0],N[1],S[1]]:[S[0],N[0],S[1],N[1]]):S):0!==N.length?(N[0]+=h,N[1]+=h,N):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,f=i*t+s-4*o,h=c*o-i*a*t+u,d=e.computeRealRoots(1,l,f,h);if(d.length>0){var E,p,y=d[0],m=a-y,_=m*m,T=t/2,R=m/2,A=_-4*o,v=_+4*Math.abs(o),S=c-4*y,N=c+4*Math.abs(y);if(y<0||A*N<S*v){var g=Math.sqrt(S);E=g/2,p=0===g?0:(t*R-i)/g}else{var O=Math.sqrt(A);E=0===O?0:(t*R-i)/O,p=O/2}var M,I;0===T&&0===E?(M=0,I=0):n.sign(T)===n.sign(E)?(M=T+E,I=y/M):(I=T-E,M=y/I);var x,w;0===R&&0===p?(x=0,w=0):n.sign(R)===n.sign(p)?(x=R+p,w=o/x):(w=R-p,x=o/w);var C=r.computeRealRoots(1,M,x),P=r.computeRealRoots(1,I,w);if(0!==C.length)return 0!==P.length?C[1]<=P[0]?[C[0],C[1],P[0],P[1]]:P[1]<=C[0]?[P[0],P[1],C[0],C[1]]:C[0]>=P[0]&&C[1]<=P[1]?[P[0],C[0],C[1],P[1]]:P[0]>=C[0]&&P[1]<=C[1]?[C[0],P[0],P[1],C[1]]:C[0]>P[0]&&C[0]<P[1]?[P[0],C[0],P[1],C[1]]:[C[0],P[0],C[1],P[1]]:C;if(0!==P.length)return P}return[]}var o={};return o.computeDiscriminant=function(e,t,n,r,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=n*n,l=c*n,f=r*r,h=f*r,d=a*a,E=d*a,p=u*c*f-4*s*h-4*e*l*f+18*e*t*n*h-27*i*f*f+256*o*E+a*(18*s*n*r-4*u*l+16*e*c*c-80*e*t*c*r-6*e*u*f+144*i*n*f)+d*(144*e*u*n-27*u*u-128*i*c-192*i*t*r);return p},o.computeRealRoots=function(t,r,o,u,s){if(Math.abs(t)<n.EPSILON15)return e.computeRealRoots(r,o,u,s);var c=r/t,l=o/t,f=u/t,h=s/t,d=c<0?1:0;switch(d+=l<0?d+1:d,d+=f<0?d+1:d,d+=h<0?d+1:d){case 0:return a(c,l,f,h);case 1:return i(c,l,f,h);case 2:return i(c,l,f,h);case 3:return a(c,l,f,h);case 4:return a(c,l,f,h);case 5:return i(c,l,f,h);case 6:return a(c,l,f,h);case 7:return a(c,l,f,h);case 8:return i(c,l,f,h);case 9:return a(c,l,f,h);case 10:return a(c,l,f,h);case 11:return i(c,l,f,h);case 12:return a(c,l,f,h);case 13:return a(c,l,f,h);case 14:return a(c,l,f,h);case 15:return a(c,l,f,h);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=e.clone(t(r,e.ZERO)),e.equals(r,e.ZERO)||e.normalize(r,r),this.origin=e.clone(t(n,e.ZERO)),this.direction=r}return a.getPoint=function(t,r,a){return n(a)||(a=new e),a=e.multiplyByScalar(t.direction,r,a),e.add(t.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,n,r,a,i,o,u,s,c,l){"use strict";function f(e,t,n,r){var a=t*t-4*e*n;if(!(a<0)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return u<s?(r.root0=u,r.root1=s):(r.root0=s,r.root1=u),r}var c=-t/(2*e);if(0!==c)return r.root0=r.root1=c,r}}function h(t,n,a){r(a)||(a=new i);var o=t.origin,u=t.direction,s=n.center,c=n.radius*n.radius,l=e.subtract(o,s,_),h=e.dot(u,u),d=2*e.dot(u,l),E=e.magnitudeSquared(l)-c,p=f(h,d,E,v);if(r(p))return a.start=p.root0,a.stop=p.root1,a}function d(e,t,n){var r=e+t;return o.sign(e)!==o.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))<n?0:r}function E(t,n,r,a,i){var l,f=a*a,h=i*i,E=(t[u.COLUMN1ROW1]-t[u.COLUMN2ROW2])*h,p=i*(a*d(t[u.COLUMN1ROW0],t[u.COLUMN0ROW1],o.EPSILON15)+n.y),y=t[u.COLUMN0ROW0]*f+t[u.COLUMN2ROW2]*h+a*n.x+r,m=h*d(t[u.COLUMN2ROW1],t[u.COLUMN1ROW2],o.EPSILON15),_=i*(a*d(t[u.COLUMN2ROW0],t[u.COLUMN0ROW2])+n.z),T=[];if(0===_&&0===m){if(l=s.computeRealRoots(E,p,y),0===l.length)return T;var R=l[0],A=Math.sqrt(Math.max(1-R*R,0));if(T.push(new e(a,i*R,i*-A)),T.push(new e(a,i*R,i*A)),2===l.length){var v=l[1],S=Math.sqrt(Math.max(1-v*v,0));T.push(new e(a,i*v,i*-S)),T.push(new e(a,i*v,i*S))}return T}var N=_*_,g=m*m,O=E*E,M=_*m,I=O+g,x=2*(p*E+M),w=2*y*E+p*p-g+N,C=2*(y*p-M),P=y*y-N;if(0===I&&0===x&&0===w&&0===C)return T;l=c.computeRealRoots(I,x,w,C,P);var U=l.length;if(0===U)return T;for(var D=0;D<U;++D){var L,F=l[D],z=F*F,B=Math.max(1-z,0),b=Math.sqrt(B);L=o.sign(E)===o.sign(y)?d(E*z+y,p*F,o.EPSILON12):o.sign(y)===o.sign(p*F)?d(E*z,p*F+y,o.EPSILON12):d(E*z+p*F,y,o.EPSILON12);var G=d(m*F,_,o.EPSILON15),q=L*G;q<0?T.push(new e(a,i*F,i*b)):q>0?T.push(new e(a,i*F,i*-b)):0!==b?(T.push(new e(a,i*F,i*-b)),T.push(new e(a,i*F,i*b)),++D):T.push(new e(a,i*F,i*b))}return T}var p={};p.rayPlane=function(t,n,a){r(a)||(a=new e);var i=t.origin,u=t.direction,s=n.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON15)){var l=(-n.distance-e.dot(s,i))/c;if(!(l<0))return a=e.multiplyByScalar(u,l,a),e.add(i,a,a)}};var y=new e,m=new e,_=new e,T=new e,R=new e;p.rayTriangleParametric=function(t,r,a,i,u){u=n(u,!1);var s,c,l,f,h,d=t.origin,E=t.direction,p=e.subtract(a,r,y),A=e.subtract(i,r,m),v=e.cross(E,A,_),S=e.dot(p,v);if(u){if(S<o.EPSILON6)return;if(s=e.subtract(d,r,T),l=e.dot(s,v),l<0||l>S)return;if(c=e.cross(s,p,R),f=e.dot(E,c),f<0||l+f>S)return;h=e.dot(A,c)/S}else{if(Math.abs(S)<o.EPSILON6)return;var N=1/S;if(s=e.subtract(d,r,T),l=e.dot(s,v)*N,l<0||l>1)return;if(c=e.cross(s,p,R),f=e.dot(E,c)*N,f<0||l+f>1)return;h=e.dot(A,c)*N}return h},p.rayTriangle=function(t,n,a,i,o,u){var s=p.rayTriangleParametric(t,n,a,i,o);if(r(s)&&!(s<0))return r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var A=new l;p.lineSegmentTriangle=function(t,n,a,i,o,u,s){var c=A;e.clone(t,c.origin),e.subtract(n,t,c.direction),e.normalize(c.direction,c.direction);var l=p.rayTriangleParametric(c,a,i,o,u);if(!(!r(l)||l<0||l>e.distance(t,n)))return r(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var v={root0:0,root1:0};p.raySphere=function(e,t,n){if(n=h(e,t,n),r(n)&&!(n.stop<0))return n.start=Math.max(n.start,0),n};var S=new l;p.lineSegmentSphere=function(t,n,a,i){var o=S;e.clone(t,o.origin);var u=e.subtract(n,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),i=h(o,a,i),!(!r(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var N=new e,g=new e;p.rayEllipsoid=function(t,n){var r,a,o,u,s,c=n.oneOverRadii,l=e.multiplyComponents(c,t.origin,N),f=e.multiplyComponents(c,t.direction,g),h=e.magnitudeSquared(l),d=e.dot(l,f);if(h>1){if(d>=0)return;var E=d*d;if(r=h-1,a=e.magnitudeSquared(f),o=a*r,E<o)return;if(E>o){u=d*d-o,s=-d+Math.sqrt(u);var p=s/a,y=r/s;return p<y?new i(p,y):{start:y,stop:p}}var m=Math.sqrt(r/a);return new i(m,m)}return h<1?(r=h-1,a=e.magnitudeSquared(f),o=a*r,u=d*d-o,s=-d+Math.sqrt(u),new i(0,s/a)):d<0?(a=e.magnitudeSquared(f),new i(0,-d/a)):void 0};var O=new e,M=new e,I=new e,x=new e,w=new e,C=new u,P=new u,U=new u,D=new u,L=new u,F=new u,z=new u,B=new e,b=new e,G=new t;p.grazingAltitudeLocation=function(t,n){var a=t.origin,i=t.direction;if(!e.equals(a,e.ZERO)){var s=n.geodeticSurfaceNormal(a,O);if(e.dot(i,s)>=0)return a}var c=r(this.rayEllipsoid(t,n)),l=n.transformPositionToScaledSpace(i,O),f=e.normalize(l,l),h=e.mostOrthogonalAxis(l,x),d=e.normalize(e.cross(h,f,M),M),p=e.normalize(e.cross(f,d,I),I),y=C;y[0]=f.x,y[1]=f.y,y[2]=f.z,y[3]=d.x,y[4]=d.y,y[5]=d.z,y[6]=p.x,y[7]=p.y,y[8]=p.z;var m=u.transpose(y,P),_=u.fromScale(n.radii,U),T=u.fromScale(n.oneOverRadii,D),R=L;R[0]=0,R[1]=-i.z,R[2]=i.y,R[3]=i.z,R[4]=0,R[5]=-i.x,R[6]=-i.y,R[7]=i.x,R[8]=0;var A,v,S=u.multiply(u.multiply(m,T,F),R,F),N=u.multiply(u.multiply(S,_,z),y,z),g=u.multiplyByVector(S,a,w),q=E(N,e.negate(g,O),0,0,1),W=q.length;if(W>0){for(var X=e.clone(e.ZERO,b),V=Number.NEGATIVE_INFINITY,H=0;H<W;++H){A=u.multiplyByVector(_,u.multiplyByVector(y,q[H],B),B);var Y=e.normalize(e.subtract(A,a,x),x),Z=e.dot(Y,i);Z>V&&(V=Z,X=e.clone(A,X))}var k=n.cartesianToCartographic(X,G);return V=o.clamp(V,0,1),v=e.magnitude(e.subtract(X,a,x))*Math.sqrt(1-V*V),v=c?-v:v,k.height=v,n.cartographicToCartesian(k,new e)}};var q=new e;return p.lineSegmentPlane=function(t,n,a,i){r(i)||(i=new e);var u=e.subtract(n,t,q),s=a.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON6)){var l=e.dot(s,t),f=-(a.distance+l)/c;if(!(f<0||f>1))return e.multiplyByScalar(u,f,i),e.add(t,i,i),i}},p.trianglePlaneIntersection=function(t,n,r,a){ +var i=a.normal,o=a.distance,u=e.dot(i,t)+o<0,s=e.dot(i,n)+o<0,c=e.dot(i,r)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var f,h;if(1!==l&&2!==l||(f=new e,h=new e),1===l){if(u)return p.lineSegmentPlane(t,n,a,f),p.lineSegmentPlane(t,r,a,h),{positions:[t,n,r,f,h],indices:[0,3,4,1,2,4,1,4,3]};if(s)return p.lineSegmentPlane(n,r,a,f),p.lineSegmentPlane(n,t,a,h),{positions:[t,n,r,f,h],indices:[1,3,4,2,0,4,2,4,3]};if(c)return p.lineSegmentPlane(r,t,a,f),p.lineSegmentPlane(r,n,a,h),{positions:[t,n,r,f,h],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return p.lineSegmentPlane(n,t,a,f),p.lineSegmentPlane(r,t,a,h),{positions:[t,n,r,f,h],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return p.lineSegmentPlane(r,n,a,f),p.lineSegmentPlane(t,n,a,h),{positions:[t,n,r,f,h],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return p.lineSegmentPlane(t,r,a,f),p.lineSegmentPlane(n,r,a,h),{positions:[t,n,r,f,h],indices:[0,1,4,0,4,3,2,3,4]}}},p}),define("Core/isArray",["./defined"],function(e){"use strict";var t=Array.isArray;return e(t)||(t=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),t}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";function a(t,n){this.normal=e.clone(t),this.distance=n}a.fromPointNormal=function(n,r,i){var o=-e.dot(r,n);return t(i)?(e.clone(r,i.normal),i.distance=o,i):new a(r,o)};var i=new e;return a.fromCartesian4=function(n,r){var o=e.fromCartesian4(n,i),u=n.w;return t(r)?(e.clone(o,r.normal),r.distance=u,r):new a(o,u)},a.getPointDistance=function(t,n){return e.dot(t.normal,n)+t.distance},a.ORIGIN_XY_PLANE=r(new a(e.UNIT_Z,0)),a.ORIGIN_YZ_PLANE=r(new a(e.UNIT_X,0)),a.ORIGIN_ZX_PLANE=r(new a(e.UNIT_Y,0)),a}),define("Core/PolylinePipeline",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidGeodesic","./IntersectionTests","./isArray","./Math","./Matrix4","./Plane"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(e,t,n){var r=N;r.length=e;var a;if(t===n){for(a=0;a<e;a++)r[a]=t;return r}var i=n-t,o=i/e;for(a=0;a<e;a++){var u=t+a*o;r[a]=u}return r}function d(t,n,r,a,i,o,u,s){var c=a.scaleToGeodeticSurface(t,I),l=a.scaleToGeodeticSurface(n,x),f=E.numberOfPoints(t,n,r),d=a.cartesianToCartographic(c,g),p=a.cartesianToCartographic(l,O),y=h(f,i,o);w.setEndPoints(d,p);var m=w.surfaceDistance/f,_=s;d.height=i;var T=a.cartographicToCartesian(d,M);e.pack(T,u,_),_+=3;for(var R=1;R<f;R++){var A=w.interpolateUsingSurfaceDistance(R*m,O);A.height=y[R],T=a.cartographicToCartesian(A,M),e.pack(T,u,_),_+=3}return _}var E={};E.numberOfPoints=function(t,n,r){var a=e.distance(t,n);return Math.ceil(a/r)};var p=new t;E.extractHeights=function(e,t){for(var n=e.length,r=new Array(n),a=0;a<n;a++){var i=e[a];r[a]=t.cartesianToCartographic(i,p).height}return r};var y=new l,m=new e,_=new e,T=new f(e.ZERO,0),R=new e,A=new f(e.ZERO,0),v=new e,S=new e,N=[],g=new t,O=new t,M=new e,I=new e,x=new e,w=new o;return E.wrapLongitude=function(t,a){var i=[],o=[];if(r(t)&&t.length>0){a=n(a,l.IDENTITY);var s=l.inverseTransformation(a,y),c=l.multiplyByPoint(s,e.ZERO,m),h=l.multiplyByPointAsVector(s,e.UNIT_Y,_),d=f.fromPointNormal(c,h,T),E=l.multiplyByPointAsVector(s,e.UNIT_X,R),p=f.fromPointNormal(c,E,A),N=1;i.push(e.clone(t[0]));for(var g=i[0],O=t.length,M=1;M<O;++M){var I=t[M];if(f.getPointDistance(p,g)<0||f.getPointDistance(p,I)<0){var x=u.lineSegmentPlane(g,I,d,v);if(r(x)){var w=e.multiplyByScalar(h,5e-9,S);f.getPointDistance(d,g)<0&&e.negate(w,w),i.push(e.add(x,w,new e)),o.push(N+1),e.negate(w,w),i.push(e.add(x,w,new e)),N=1}}i.push(e.clone(t[M])),N++,g=I}o.push(N)}return{positions:i,lengths:o}},E.generateArc=function(t){r(t)||(t={});var a=t.positions,o=a.length,u=n(t.ellipsoid,i.WGS84),l=n(t.height,0),f=s(l);if(o<1)return[];if(1===o){var h=u.scaleToGeodeticSurface(a[0],I);if(l=f?l[0]:l,0!==l){var p=u.geodeticSurfaceNormal(h,M);e.multiplyByScalar(p,l,p),e.add(h,p,h)}return[h.x,h.y,h.z]}var y=t.minDistance;if(!r(y)){var m=n(t.granularity,c.RADIANS_PER_DEGREE);y=c.chordLength(m,u.maximumRadius)}var _,T=0;for(_=0;_<o-1;_++)T+=E.numberOfPoints(a[_],a[_+1],y);var R=3*(T+1),A=new Array(R),v=0;for(_=0;_<o-1;_++){var S=a[_],O=a[_+1],x=f?l[_]:l,w=f?l[_+1]:l;v=d(S,O,y,u,x,w,A,v)}N.length=0;var C=a[o-1],P=u.cartesianToCartographic(C,g);P.height=f?l[o-1]:l;var U=u.cartographicToCartesian(P,M);return e.pack(U,A,R-3),A},E.generateCartesianArc=function(t){for(var n=E.generateArc(t),r=n.length/3,a=new Array(r),i=0;i<r;i++)a[i]=e.unpack(n,3*i);return a},E}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n){this.x=t(e,0),this.y=t(n,0)}o.fromElements=function(e,t,r){return n(r)?(r.x=e,r.y=t,r):new o(e,t)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t):new o(e.x,e.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r]=e.y,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=2*r:t=new Array(2*r);for(var a=0;a<r;++a)o.pack(e[a],t,2*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/2:t=new Array(r/2);for(var a=0;a<r;a+=2){var i=a/2;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y)},o.minimumComponent=function(e){return Math.min(e.x,e.y)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){return o.normalize(e,c),o.normalize(t,l),i.acosClamped(o.dot(c,l))};var f=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)},o.ZERO=a(new o(0,0)),o.UNIT_X=a(new o(1,0)),o.UNIT_Y=a(new o(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,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Intersect"],function(e,t,n,r,a){"use strict";function i(r,a,i){this.minimum=e.clone(t(r,e.ZERO)),this.maximum=e.clone(t(a,e.ZERO)),n(i)?i=e.clone(i):(i=e.add(this.minimum,this.maximum,new e),e.multiplyByScalar(i,.5,i)),this.center=i}i.fromPoints=function(t,r){if(n(r)||(r=new i),!n(t)||0===t.length)return r.minimum=e.clone(e.ZERO,r.minimum),r.maximum=e.clone(e.ZERO,r.maximum),r.center=e.clone(e.ZERO,r.center),r;for(var a=t[0].x,o=t[0].y,u=t[0].z,s=t[0].x,c=t[0].y,l=t[0].z,f=t.length,h=1;h<f;h++){var d=t[h],E=d.x,p=d.y,y=d.z;a=Math.min(E,a),s=Math.max(E,s),o=Math.min(p,o),c=Math.max(p,c),u=Math.min(y,u),l=Math.max(y,l)}var m=r.minimum;m.x=a,m.y=o,m.z=u;var _=r.maximum;_.x=s,_.y=c,_.z=l;var T=e.add(m,_,r.center);return e.multiplyByScalar(T,.5,T),r},i.clone=function(t,r){if(n(t))return n(r)?(r.minimum=e.clone(t.minimum,r.minimum),r.maximum=e.clone(t.maximum,r.maximum),r.center=e.clone(t.center,r.center),r):new i(t.minimum,t.maximum)},i.equals=function(t,r){return t===r||n(t)&&n(r)&&e.equals(t.center,r.center)&&e.equals(t.minimum,r.minimum)&&e.equals(t.maximum,r.maximum)};var o=new e;return i.intersectPlane=function(t,n){o=e.subtract(t.maximum,t.minimum,o);var r=e.multiplyByScalar(o,.5,o),i=n.normal,u=r.x*Math.abs(i.x)+r.y*Math.abs(i.y)+r.z*Math.abs(i.z),s=e.dot(t.center,i)+n.distance;return s-u>0?a.INSIDE:s+u<0?a.OUTSIDE:a.INTERSECTING},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.intersectPlane=function(e){return i.intersectPlane(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,n,r,a){return t(e).then(n,r,a)}function t(e){var t,n;return e instanceof r?t=e:u(e)?(n=o(),e.then(function(e){n.resolve(e)},function(e){n.reject(e)},function(e){n.progress(e)}),t=n.promise):t=a(e),t}function n(t){return e(t,i)}function r(e){this.then=e}function a(e){var n=new r(function(n){try{return t(n?n(e):e)}catch(e){return i(e)}});return n}function i(e){var n=new r(function(n,r){try{return r?t(r(e)):i(e)}catch(e){return i(e)}});return n}function o(){function e(e,t,n){return h(e,t,n)}function n(e){return E(e)}function a(e){return E(i(e))}function u(e){return d(e)}var s,c,l,f,h,d,E;return c=new r(e),s={then:e,resolve:n,reject:a,progress:u,promise:c,resolver:{resolve:n,reject:a,progress:u}},l=[],f=[],h=function(e,t,n){var r,a;return r=o(),a="function"==typeof n?function(e){try{r.progress(n(e))}catch(e){r.progress(e)}}:function(e){r.progress(e)},l.push(function(n){n.then(e,t).then(r.resolve,r.reject,a)}),f.push(a),r.promise},d=function(e){return p(f,e),e},E=function(e){return e=t(e),h=e.then,E=t,d=m,p(l,e),f=l=A,e},s}function u(e){return e&&"function"==typeof e.then}function s(t,n,r,a,i){return y(2,arguments),e(t,function(t){function u(e){p(e)}function s(e){E(e)}var c,l,f,h,d,E,p,y,_,T;if(_=t.length>>>0,c=Math.max(0,Math.min(n,_)),f=[],l=_-c+1,h=[],d=o(),c)for(y=d.progress,p=function(e){h.push(e),--l||(E=p=m,d.reject(h))},E=function(e){f.push(e),--c||(E=p=m,d.resolve(f))},T=0;T<_;++T)T in t&&e(t[T],s,u,y);else d.resolve(f);return d.then(r,a,i)})}function c(e,t,n,r){function a(e){return t?t(e[0]):e[0]}return s(e,1,a,n,r)}function l(e,t,n,r){return y(1,arguments),h(e,_).then(t,n,r)}function f(){return h(arguments,_)}function h(t,n){return e(t,function(t){var r,a,i,u,s,c;if(i=a=t.length>>>0,r=[],c=o(),i)for(u=function(t,a){e(t,n).then(function(e){r[a]=e,--i||c.resolve(r)},c.reject)},s=0;s<a;s++)s in t?u(t[s],s):--i;else c.resolve(r);return c.promise})}function d(t,n){var r=R.call(arguments,1);return e(t,function(t){var a;return a=t.length,r[0]=function(t,r,i){return e(t,function(t){return e(r,function(e){return n(t,e,i,a)})})},T.apply(t,r)})}function E(t,n,r){var a=arguments.length>2;return e(t,function(e){return e=a?r:e,n.resolve(e),e},function(e){return n.reject(e),i(e)},n.progress)}function p(e,t){for(var n,r=0;n=e[r++];)n(t)}function y(e,t){for(var n,r=t.length;r>e;)if(n=t[--r],null!=n&&"function"!=typeof n)throw new Error("arg "+r+" must be a function")}function m(){}function _(e){return e}var T,R,A;return e.defer=o,e.resolve=t,e.reject=n,e.join=f,e.all=l,e.map=h,e.reduce=d,e.any=c,e.some=s,e.chain=E,e.isPromise=u,r.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(A,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return l(t,function(t){return e.apply(A,t)})})}},R=[].slice,T=[].reduce||function(e){var t,n,r,a,i;if(i=0,t=Object(this),a=t.length>>>0,n=arguments,n.length<=1)for(;;){if(i in t){r=t[i++];break}if(++i>=a)throw new TypeError}else r=n[1];for(;i<a;++i)i in t&&(r=e(r,t[i],i,t));return r},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/binarySearch",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e,t,n){for(var r,a,i=0,o=e.length-1;i<=o;)if(r=~~((i+o)/2),a=n(e[r],t),a<0)i=r+1;else{if(!(a>0))return r;o=r-1}return~(o+1)}return n}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,n,r,a){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=r,this.ut1MinusUtc=a}return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,n=0,r=t[n++],a=function(e,t,n,r){n||(n=" ");var a=e.length>=t?"":Array(1+t-e.length>>>0).join(n);return r?e+a:a+e},i=function(e,t,n,r,i,o){var u=r-e.length;return u>0&&(e=n||!i?a(e,r,o,n):e.slice(0,t.length)+a("",u,"0",!0)+e.slice(t.length)),e},o=function(e,t,n,r,o,u,s){var c=e>>>0;return n=n&&c&&{2:"0b",8:"0",16:"0x"}[t]||"",e=n+a(c.toString(t),u||0,"0",!1),i(e,n,r,o,s)},u=function(e,t,n,r,a,o){return null!=r&&(e=e.slice(0,r)),i(e,"",t,n,a,o)},s=function(e,r,s,c,l,f,h){var d,E,p,y,m;if("%%"==e)return"%";for(var _=!1,T="",R=!1,A=!1,v=" ",S=s.length,N=0;s&&N<S;N++)switch(s.charAt(N)){case" ":T=" ";break;case"+":T="+";break;case"-":_=!0;break;case"'":v=s.charAt(N+1);break;case"0":R=!0;break;case"#":A=!0}if(c=c?"*"==c?+t[n++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,c<0&&(c=-c,_=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(f=f?"*"==f?+t[n++]:"*"==f.charAt(0)?+t[f.slice(1,-1)]:+f:"fFeE".indexOf(h)>-1?6:"d"==h?0:void 0,m=r?t[r.slice(0,-1)]:t[n++],h){case"s":return u(String(m),_,c,f,R,v);case"c":return u(String.fromCharCode(+m),_,c,f,R);case"b":return o(m,2,A,_,c,f,R);case"o":return o(m,8,A,_,c,f,R);case"x":return o(m,16,A,_,c,f,R);case"X":return o(m,16,A,_,c,f,R).toUpperCase();case"u":return o(m,10,A,_,c,f,R);case"i":case"d":return d=+m||0,d=Math.round(d-d%1),E=d<0?"-":T,m=E+a(String(Math.abs(d)),f,"0",!1),i(m,E,_,c,R);case"e":case"E":case"f":case"F":case"g":case"G":return d=+m,E=d<0?"-":T,p=["toExponential","toFixed","toPrecision"]["efg".indexOf(h.toLowerCase())],y=["toString","toUpperCase"]["eEfFgG".indexOf(h)%2],m=E+Math.abs(d)[p](f),i(m,E,_,c,R)[y]();default:return e}};return r.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,n,r,a,i,o,u){this.year=e,this.month=t,this.day=n,this.hour=r,this.minute=a,this.second=i,this.millisecond=o,this.isLeapSecond=u}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e(t)}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t){return p.compare(e.julianDate,t.julianDate)}function f(e){T.julianDate=e;var n=p.leapSeconds,r=t(n,T,l);r<0&&(r=~r),r>=n.length&&(r=n.length-1);var a=n[r].offset;if(r>0){var i=p.secondsDifference(n[r].julianDate,e);i>a&&(r--,a=n[r].offset)}p.addSeconds(e,a,e)}function h(e,n){T.julianDate=e;var r=p.leapSeconds,a=t(r,T,l);if(a<0&&(a=~a),0===a)return p.addSeconds(e,-r[0].offset,n);if(a>=r.length)return p.addSeconds(e,-r[a-1].offset,n);var i=p.secondsDifference(r[a].julianDate,e);return 0===i?p.addSeconds(e,-r[a].offset,n):i<=1?void 0:p.addSeconds(e,-r[--a].offset,n)}function d(e,t,n){var r=t/s.SECONDS_PER_DAY|0;return e+=r,t-=s.SECONDS_PER_DAY*r,t<0&&(e--,t+=s.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function E(e,t,n,r,a,i,o){var u=(t-14)/12|0,c=e+4800+u,l=(1461*c/4|0)+(367*(t-2-12*u)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;r-=12,r<0&&(r+=24);var f=i+(r*s.SECONDS_PER_HOUR+a*s.SECONDS_PER_MINUTE+o*s.SECONDS_PER_MILLISECOND);return f>=43200&&(l-=1),[l,f]}function p(e,t,r){this.dayNumber=void 0,this.secondsOfDay=void 0,e=n(e,0),t=n(t,0),r=n(r,c.UTC);var a=0|e;t+=(e-a)*s.SECONDS_PER_DAY,d(a,t,this),r===c.UTC&&f(this)}var y=new i,m=[31,28,31,30,31,30,31,31,30,31,30,31],_=29,T=new u,R=/^(\d{4})$/,A=/^(\d{4})-(\d{2})$/,v=/^(\d{4})-?(\d{3})$/,S=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,N=/^(\d{4})-?(\d{2})-?(\d{2})$/,g=/([Z+\-])?(\d{2})?:?(\d{2})?$/,O=/^(\d{2})(\.\d+)?/.source+g.source,M=/^(\d{2}):?(\d{2})(\.\d+)?/.source+g.source,I=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+g.source;p.fromDate=function(e,t){var n=E(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r(t)?(d(n[0],n[1],t),f(t),t):new p(n[0],n[1],c.UTC)},p.fromIso8601=function(e,t){e=e.replace(",",".");var n,a,i,u=e.split("T"),s=1,l=1,h=0,y=0,T=0,g=0,x=u[0],w=u[1];if(u=x.match(N),null!==u)n=+u[1],s=+u[2],l=+u[3];else if(u=x.match(A),null!==u)n=+u[1],s=+u[2];else if(u=x.match(R),null!==u)n=+u[1];else{var C;if(u=x.match(v),null!==u)n=+u[1],C=+u[2],i=o(n);else if(u=x.match(S),null!==u){n=+u[1];var P=+u[2],U=+u[3]||0,D=new Date(Date.UTC(n,0,4));C=7*P+U-D.getUTCDay()-3}a=new Date(Date.UTC(n,0,1)),a.setUTCDate(C),s=a.getUTCMonth()+1,l=a.getUTCDate()}i=o(n);var L;if(r(w)){u=w.match(I),null!==u?(h=+u[1],y=+u[2],T=+u[3],g=1e3*+(u[4]||0),L=5):(u=w.match(M),null!==u?(h=+u[1],y=+u[2],T=60*+(u[3]||0),L=4):(u=w.match(O),null!==u&&(h=+u[1],y=60*+(u[2]||0),L=3)));var F=u[L],z=+u[L+1],B=+(u[L+2]||0);switch(F){case"+":h-=z,y-=B;break;case"-":h+=z,y+=B;break;case"Z":break;default:y+=new Date(Date.UTC(n,s-1,l,h,y)).getTimezoneOffset()}}else y+=new Date(n,s-1,l).getTimezoneOffset();var b=60===T;for(b&&T--;y>=60;)y-=60,h++;for(;h>=24;)h-=24,l++;for(a=i&&2===s?_:m[s-1];l>a;)l-=a,s++,s>12&&(s-=12,n++),a=i&&2===s?_:m[s-1];for(;y<0;)y+=60,h--;for(;h<0;)h+=24,l--;for(;l<1;)s--,s<1&&(s+=12,n--),a=i&&2===s?_:m[s-1],l+=a;var G=E(n,s,l,h,y,T,g);return r(t)?(d(G[0],G[1],t),f(t)):t=new p(G[0],G[1],c.UTC),b&&p.addSeconds(t,1,t),t},p.now=function(e){return p.fromDate(new Date,e)};var x=new p(0,0,c.TAI);return p.toGregorianDate=function(e,t){var n=!1,a=h(e,x);r(a)||(p.addSeconds(e,-1,x),a=h(x,x),n=!0);var o=a.dayNumber,u=a.secondsOfDay;u>=43200&&(o+=1);var c=o+68569|0,l=4*c/146097|0;c=c-((146097*l+3)/4|0)|0;var f=4e3*(c+1)/1461001|0;c=c-(1461*f/4|0)+31|0;var d=80*c/2447|0,E=c-(2447*d/80|0)|0;c=d/11|0;var y=d+2-12*c|0,m=100*(l-49)+f+c|0,_=u/s.SECONDS_PER_HOUR|0,T=u-_*s.SECONDS_PER_HOUR,R=T/s.SECONDS_PER_MINUTE|0;T-=R*s.SECONDS_PER_MINUTE;var A=0|T,v=(T-A)/s.SECONDS_PER_MILLISECOND;return _+=12,_>23&&(_-=24),n&&(A+=1),r(t)?(t.year=m,t.month=y,t.day=E,t.hour=_,t.minute=R,t.second=A,t.millisecond=v,t.isLeapSecond=n,t):new i(m,y,E,_,R,A,v,n)},p.toDate=function(e){var t=p.toGregorianDate(e,y),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))},p.toIso8601=function(t,n){var a,i=p.toGregorianDate(t,i);return r(n)||0===i.millisecond?r(n)&&0!==n?(a=(.01*i.millisecond).toFixed(n).replace(".","").slice(0,n),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",i.year,i.month,i.day,i.hour,i.minute,i.second):(a=(.01*i.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a))},p.clone=function(e,t){if(r(e))return r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new p(e.dayNumber,e.secondsOfDay,c.TAI)},p.compare=function(e,t){var n=e.dayNumber-t.dayNumber;return 0!==n?n:e.secondsOfDay-t.secondsOfDay},p.equals=function(e,t){return e===t||r(e)&&r(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},p.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(p.secondsDifference(e,t))<=n},p.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},p.secondsDifference=function(e,t){var n=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return n+(e.secondsOfDay-t.secondsOfDay)},p.daysDifference=function(e,t){var n=e.dayNumber-t.dayNumber,r=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return n+r},p.computeTaiMinusUtc=function(e){T.julianDate=e;var n=p.leapSeconds,r=t(n,T,l);return r<0&&(r=~r,--r,r<0&&(r=0)),n[r].offset},p.addSeconds=function(e,t,n){return d(e.dayNumber,e.secondsOfDay+t,n)},p.addMinutes=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return d(e.dayNumber,r,n)},p.addHours=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return d(e.dayNumber,r,n)},p.addDays=function(e,t,n){var r=e.dayNumber+t;return d(r,e.secondsOfDay,n)},p.lessThan=function(e,t){return p.compare(e,t)<0},p.lessThanOrEquals=function(e,t){return p.compare(e,t)<=0},p.greaterThan=function(e,t){return p.compare(e,t)>0},p.greaterThanOrEquals=function(e,t){return p.compare(e,t)>=0},p.prototype.clone=function(e){return p.clone(this,e)},p.prototype.equals=function(e){return p.equals(this,e)},p.prototype.equalsEpsilon=function(e,t){return p.equalsEpsilon(this,e,t)},p.prototype.toString=function(){return p.toIso8601(this)},p.leapSeconds=[new u(new p(2441317,43210,c.TAI),10),new u(new p(2441499,43211,c.TAI),11),new u(new p(2441683,43212,c.TAI),12),new u(new p(2442048,43213,c.TAI),13),new u(new p(2442413,43214,c.TAI),14),new u(new p(2442778,43215,c.TAI),15),new u(new p(2443144,43216,c.TAI),16),new u(new p(2443509,43217,c.TAI),17),new u(new p(2443874,43218,c.TAI),18),new u(new p(2444239,43219,c.TAI),19),new u(new p(2444786,43220,c.TAI),20),new u(new p(2445151,43221,c.TAI),21),new u(new p(2445516,43222,c.TAI),22),new u(new p(2446247,43223,c.TAI),23),new u(new p(2447161,43224,c.TAI),24),new u(new p(2447892,43225,c.TAI),25),new u(new p(2448257,43226,c.TAI),26),new u(new p(2448804,43227,c.TAI),27),new u(new p(2449169,43228,c.TAI),28),new u(new p(2449534,43229,c.TAI),29),new u(new p(2450083,43230,c.TAI),30),new u(new p(2450630,43231,c.TAI),31),new u(new p(2451179,43232,c.TAI),32),new u(new p(2453736,43233,c.TAI),33),new u(new p(2454832,43234,c.TAI),34),new u(new p(2456109,43235,c.TAI),35),new u(new p(2457204,43236,c.TAI),36),new u(new p(2457754,43237,c.TAI),37)],p}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(n,r){if(null===n||"object"!=typeof n)return n;r=e(r,!1);var a=new n.constructor;for(var i in n)if(n.hasOwnProperty(i)){var o=n[i];r&&(o=t(o,r)),a[i]=o}return a}return t}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var n=e.split("\r\n"),r=0;r<n.length;++r){var a=n[r],i=a.indexOf(": ");if(i>0){var o=a.substring(0,i),u=a.substring(i+2);t[o]=u}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function n(e,n,r){this.statusCode=e,this.response=n,this.responseHeaders=r,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return n.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},n}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var n=r.exec(t);this.scheme=n[1],this.authority=n[2],this.path=n[3],this.query=n[4],this.fragment=n[5]}}function t(e){var t=unescape(e);return i.test(t)?t:e.toUpperCase()}function n(e,t,n,r){return(t||"")+n.toLowerCase()+(r||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var r=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(o,n).replace(a,t)),this.path&&(this.path=this.path.replace(a,t)),this.query&&(this.query=this.query.replace(a,t)),this.fragment&&(this.fragment=this.fragment.replace(a,t))};var a=/%[0-9a-z]{2}/gi,i=/[a-zA-Z0-9\-\._~]/,o=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var n=new e;return this.scheme?(n.scheme=this.scheme,n.authority=this.authority,n.path=this.path,n.query=this.query):(n.scheme=t.scheme,this.authority?(n.authority=this.authority,n.path=this.path,n.query=this.query):(n.authority=t.authority,""==this.path?(n.path=t.path,n.query=this.query||t.query):("/"==this.path.charAt(0)?(n.path=this.path,n.removeDotSegments()):(t.authority&&""==t.path?n.path="/"+this.path:n.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,n.removeDotSegments()),n.query=this.query))),n.fragment=this.fragment,n},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),n=[],r=""==t[0];r&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?n.pop():"."!=e&&n.push(e);"."!=e&&".."!=e||n.push(""),r&&n.unshift(""),this.path=n.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n){var r=new e(n);r.normalize();var a=r.getAuthority();if(t(a)){if(a.indexOf("@")!==-1){var i=a.split("@");a=i[1]}if(a.indexOf(":")===-1){var o=r.getScheme();if(t(o)||(o=window.location.protocol,o=o.substring(0,o.length-1)),"http"===o)a+=":80";else{if("https"!==o)return;a+=":443"}}return a}}var a={},i={};return a.add=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])||(i[r]=!0)},a.remove=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])&&delete i[r]},a.contains=function(e){var n=r(e);return!(!t(n)||!t(i[n]))},a.clear=function(){i={}},a}),define("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,n,r,a,i,o){"use strict";function u(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,a=t(n.method,"GET"),i=n.data,o=n.headers,s=n.overrideMimeType;return e(n.url,function(t){var n=e.defer();return u.load(t,r,a,i,o,n,s),n.promise})}function s(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function c(e,t){for(var n=s(e,t),r=new ArrayBuffer(n.length),a=new Uint8Array(r),i=0;i<n.length;i++)a[i]=n.charCodeAt(i);return r}function l(e,n){n=t(n,"");var r=e[1],a=!!e[2],i=e[3];switch(n){case"":case"text":return s(a,i);case"arraybuffer":return c(a,i);case"blob":var o=c(a,i);return new Blob([o],{type:r});case"document":var u=new DOMParser;return u.parseFromString(s(a,i),r);case"json":return JSON.parse(s(a,i))}}var f=/^data:(.*?)(;base64)?,(.*)$/;return u.load=function(e,t,r,u,s,c,h){var d=f.exec(e);if(null!==d)return void c.resolve(l(d,t));var E=new XMLHttpRequest;if(o.contains(e)&&(E.withCredentials=!0),n(h)&&n(E.overrideMimeType)&&E.overrideMimeType(h),E.open(r,e,!0),n(s))for(var p in s)s.hasOwnProperty(p)&&E.setRequestHeader(p,s[p]);n(t)&&(E.responseType=t),E.onload=function(){if(E.status<200||E.status>=300)return void c.reject(new a(E.status,E.response,E.getAllResponseHeaders()));var e=E.response,r=E.responseType;if(!n(e)||n(t)&&r!==t)if("json"===t&&"string"==typeof e)try{c.resolve(JSON.parse(e))}catch(e){c.reject(e)}else(""===r||"document"===r)&&n(E.responseXML)&&E.responseXML.hasChildNodes()?c.resolve(E.responseXML):""!==r&&"text"!==r||!n(E.responseText)?c.reject(new i("Invalid XMLHttpRequest response type.")):c.resolve(E.responseText);else c.resolve(e)},E.onerror=function(e){c.reject(new a)},E.send(u)},u.defaultLoad=u.load,u}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,n){return e({url:t,headers:n})}return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";function a(n,a){return t(a)?t(a.Accept)||(a=e(a),a.Accept=i.Accept):a=i,r(n,a).then(function(e){return JSON.parse(e)})}var i={Accept:"application/json,*/*;q=0.01"};return a}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(t){if(t=n(t,n.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=n(t.addNewLeapSeconds,!0),r(t.data))E(this,t.data);else if(r(t.url)){var a=this;this._downloadPromise=e(s(t.url),function(e){E(a,e)},function(){a._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else E(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function d(e,t){return o.compare(e.julianDate,t)}function E(e,n){if(!r(n.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!r(n.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var a=n.columnNames.indexOf("modifiedJulianDateUtc"),i=n.columnNames.indexOf("xPoleWanderRadians"),s=n.columnNames.indexOf("yPoleWanderRadians"),c=n.columnNames.indexOf("ut1MinusUtcSeconds"),h=n.columnNames.indexOf("xCelestialPoleOffsetRadians"),E=n.columnNames.indexOf("yCelestialPoleOffsetRadians"),p=n.columnNames.indexOf("taiMinusUtcSeconds");if(a<0||i<0||s<0||c<0||h<0||E<0||p<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var y=e._samples=n.samples,m=e._dates=[];e._dateColumn=a,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=h,e._yCelestialPoleOffsetRadiansColumn=E,e._taiMinusUtcSecondsColumn=p,e._columnCount=n.columnNames.length,e._lastIndex=void 0;for(var _,T=e._addNewLeapSeconds,R=0,A=y.length;R<A;R+=e._columnCount){var v=y[R+a],S=y[R+p],N=v+l.MODIFIED_JULIAN_DATE_DIFFERENCE,g=new o(N,S,f.TAI);if(m.push(g),T){if(S!==_&&r(_)){ +var O=o.leapSeconds,M=t(O,g,d);if(M<0){var I=new u(g,S);O.splice(~M,0,I)}}_=S}}}function p(e,t,n,r,a){var i=n*r;a.xPoleWander=t[i+e._xPoleWanderRadiansColumn],a.yPoleWander=t[i+e._yPoleWanderRadiansColumn],a.xPoleOffset=t[i+e._xCelestialPoleOffsetRadiansColumn],a.yPoleOffset=t[i+e._yCelestialPoleOffsetRadiansColumn],a.ut1MinusUtc=t[i+e._ut1MinusUtcSecondsColumn]}function y(e,t,n){return t+e*(n-t)}function m(e,t,n,r,a,i,u){var s=e._columnCount;if(i>t.length-1)return u.xPoleWander=0,u.yPoleWander=0,u.xPoleOffset=0,u.yPoleOffset=0,u.ut1MinusUtc=0,u;var c=t[a],l=t[i];if(c.equals(l)||r.equals(c))return p(e,n,a,s,u),u;if(r.equals(l))return p(e,n,i,s,u),u;var f=o.secondsDifference(r,c)/o.secondsDifference(l,c),h=a*s,d=i*s,E=n[h+e._ut1MinusUtcSecondsColumn],m=n[d+e._ut1MinusUtcSecondsColumn],_=m-E;if(_>.5||_<-.5){var T=n[h+e._taiMinusUtcSecondsColumn],R=n[d+e._taiMinusUtcSecondsColumn];T!==R&&(l.equals(r)?E=m:m-=R-T)}return u.xPoleWander=y(f,n[h+e._xPoleWanderRadiansColumn],n[d+e._xPoleWanderRadiansColumn]),u.yPoleWander=y(f,n[h+e._yPoleWanderRadiansColumn],n[d+e._yPoleWanderRadiansColumn]),u.xPoleOffset=y(f,n[h+e._xCelestialPoleOffsetRadiansColumn],n[d+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=y(f,n[h+e._yCelestialPoleOffsetRadiansColumn],n[d+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=y(f,E,m),u}return h.NONE=i({getPromiseToLoad:function(){return e()},compute:function(e,t){return r(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new a(0,0,0,0,0),t}}),h.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},h.prototype.compute=function(e,n){if(r(this._samples)){if(r(n)||(n=new a(0,0,0,0,0)),0===this._samples.length)return n.xPoleWander=0,n.yPoleWander=0,n.xPoleOffset=0,n.yPoleOffset=0,n.ut1MinusUtc=0,n;var i=this._dates,u=this._lastIndex,s=0,l=0;if(r(u)){var f=i[u],h=i[u+1],d=o.lessThanOrEquals(f,e),E=!r(h),p=E||o.greaterThanOrEquals(h,e);if(d&&p)return s=u,!E&&h.equals(e)&&++s,l=s+1,m(this,i,this._samples,e,s,l,n),n}var y=t(i,e,o.compare,this._dateColumn);return y>=0?(y<i.length-1&&i[y+1].equals(e)&&++y,s=y,l=y):(l=~y,s=l-1,s<0&&(s=0)),this._lastIndex=s,m(this,i,this._samples,e,s,l,n),n}if(r(this._dataError))throw new c(this._dataError)},h}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(t,n,r){this.heading=e(t,0),this.pitch=e(n,0),this.roll=e(r,0)}return a.fromQuaternion=function(e,n){t(n)||(n=new a);var r=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return n.heading=-Math.atan2(s,u),n.roll=Math.atan2(o,i),n.pitch=-Math.asin(r),n},a.fromDegrees=function(e,n,i,o){return t(o)||(o=new a),o.heading=e*r.RADIANS_PER_DEGREE,o.pitch=n*r.RADIANS_PER_DEGREE,o.roll=i*r.RADIANS_PER_DEGREE,o},a.clone=function(e,n){if(t(e))return t(n)?(n.heading=e.heading,n.pitch=e.pitch,n.roll=e.roll,n):new a(e.heading,e.pitch,e.roll)},a.equals=function(e,n){return e===n||t(e)&&t(n)&&e.heading===n.heading&&e.pitch===n.pitch&&e.roll===n.roll},a.equalsEpsilon=function(e,n,a,i){return e===n||t(e)&&t(n)&&r.equalsEpsilon(e.heading,n.heading,a,i)&&r.equalsEpsilon(e.pitch,n.pitch,a,i)&&r.equalsEpsilon(e.roll,n.roll,a,i)},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,n){return a.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},a}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=t(r,document.location.href);var a=new e(r),i=new e(n);return i.resolve(a).toString()}return a}),define("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(r,a,i){i=t(i,!0),r instanceof e||(r=new e(r)),a instanceof e||(a=new e(a)),n(a.authority)&&!n(a.scheme)&&("undefined"!=typeof document&&n(document.location)&&n(document.location.href)?a.scheme=new e(document.location.href).scheme:a.scheme=r.scheme);var o=r;a.isAbsolute()&&(o=a);var u="";n(o.scheme)&&(u+=o.scheme+":"),n(o.authority)&&(u+="//"+o.authority,""!==o.path&&"/"!==o.path&&(u=u.replace(/\/?$/,"/"),o.path=o.path.replace(/^\/?/g,""))),u+=o===r?i?r.path.replace(/\/?$/,"/")+a.path.replace(/^\/?/g,""):r.path+a.path:a.path;var s=n(r.query),c=n(a.query);s&&c?u+="?"+r.query+"&"+a.query:s&&!c?u+="?"+r.query:!s&&c&&(u+="?"+a.query);var l=n(a.fragment);return n(r.fragment)&&!l?u+="#"+r.fragment:l&&(u+="#"+a.fragment),u}return a}),define("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","./joinUrls","require"],function(e,t,n,r,a,i){"use strict";function o(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;t<n;++t){var r=e[t].getAttribute("src"),a=E.exec(r);if(null!==a)return a[1]}}function u(){if(t(f))return f;var n;return n="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:o(),f=new e(r(n))}function s(e){return i.toUrl("../"+e)}function c(e){return a(u(),e)}function l(e){t(h)||(h=t(i.toUrl)?s:c),t(d)||(d=document.createElement("a"));var n=h(e);return d.href=n,d.href=d.href,d.href}var f,h,d,E=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return l._cesiumScriptRegex=E,l.setBaseUrl=function(t){f=new e(t).resolve(new e(document.location.href))},l}),define("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,n){this.x=e,this.y=t,this.s=n}return e}),define("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){e=n(e,n.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=n(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=n(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new i(this._sampleZeroJulianEphemerisDate,0,u.TAI),this._stepSizeDays=n(e.stepSizeDays,1),this._samplesPerXysFile=n(e.samplesPerXysFile,1e3),this._totalSamples=n(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,r=this._denominators=new Array(t+1),a=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t),s=0;s<=t;++s){r[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;c<=t;++c)c!==s&&(r[s]*=s-c);r[s]=1/r[s]}this._work=new Array(t+1),this._coef=new Array(t+1)}function c(e,t,n){var r=f;return r.dayNumber=t,r.secondsOfDay=n,i.daysDifference(r,e._sampleZeroDateTT)}function l(n,a){if(n._chunkDownloadsInProgress[a])return n._chunkDownloadsInProgress[a];var i=e.defer();n._chunkDownloadsInProgress[a]=i;var u,s=n._xysFileUrlTemplate;return u=r(s)?s.replace("{0}",a):t("Assets/IAU2006_XYS/IAU2006_XYS_"+a+".json"),e(o(u),function(e){n._chunkDownloadsInProgress[a]=!1;for(var t=n._samples,r=e.samples,o=a*n._samplesPerXysFile*3,u=0,s=r.length;u<s;++u)t[o+u]=r[u];i.resolve()}),i.promise}var f=new i(0,0,u.TAI);return s.prototype.preload=function(t,n,r,a){var i=c(this,t,n),o=c(this,r,a),u=i/this._stepSizeDays-this._interpolationOrder/2|0;u<0&&(u=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var f=u/this._samplesPerXysFile|0,h=s/this._samplesPerXysFile|0,d=[],E=f;E<=h;++E)d.push(l(this,E));return e.all(d)},s.prototype.computeXysRadians=function(e,t,n){var i=c(this,e,t);if(!(i<0)){var o=i/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);s<0&&(s=0);var f=s+u;f>=this._totalSamples&&(f=this._totalSamples-1,s=f-u,s<0&&(s=0));var h=!1,d=this._samples;if(r(d[3*s])||(l(this,s/this._samplesPerXysFile|0),h=!0),r(d[3*f])||(l(this,f/this._samplesPerXysFile|0),h=!0),!h){r(n)?(n.x=0,n.y=0,n.s=0):n=new a(0,0,0);var E,p,y=i-s*this._stepSizeDays,m=this._work,_=this._denominators,T=this._coef,R=this._xTable;for(E=0;E<=u;++E)m[E]=y-R[E];for(E=0;E<=u;++E){for(T[E]=1,p=0;p<=u;++p)p!==E&&(T[E]*=m[p]);T[E]*=_[E];var A=3*(s+E);n.x+=T[E]*d[A++],n.y+=T[E]*d[A++],n.s+=T[E]*d[A]}return n}}}},s}),define("Core/Quaternion",["./Cartesian3","./Check","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math","./Matrix3"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(e,t,r,a){this.x=n(e,0),this.y=n(t,0),this.z=n(r,0),this.w=n(a,0)}var l=new e;c.fromAxisAngle=function(t,n,a){var i=n/2,o=Math.sin(i);l=e.normalize(t,l);var u=l.x*o,s=l.y*o,f=l.z*o,h=Math.cos(i);return r(a)?(a.x=u,a.y=s,a.z=f,a.w=h,a):new c(u,s,f,h)};var f=[1,2,0],h=new Array(3);c.fromRotationMatrix=function(e,t){var n,a,i,o,u,l=e[s.COLUMN0ROW0],d=e[s.COLUMN1ROW1],E=e[s.COLUMN2ROW2],p=l+d+E;if(p>0)n=Math.sqrt(p+1),u=.5*n,n=.5/n,a=(e[s.COLUMN1ROW2]-e[s.COLUMN2ROW1])*n,i=(e[s.COLUMN2ROW0]-e[s.COLUMN0ROW2])*n,o=(e[s.COLUMN0ROW1]-e[s.COLUMN1ROW0])*n;else{var y=f,m=0;d>l&&(m=1),E>l&&E>d&&(m=2);var _=y[m],T=y[_];n=Math.sqrt(e[s.getElementIndex(m,m)]-e[s.getElementIndex(_,_)]-e[s.getElementIndex(T,T)]+1);var R=h;R[m]=.5*n,n=.5/n,u=(e[s.getElementIndex(T,_)]-e[s.getElementIndex(_,T)])*n,R[_]=(e[s.getElementIndex(_,m)]+e[s.getElementIndex(m,_)])*n,R[T]=(e[s.getElementIndex(T,m)]+e[s.getElementIndex(m,T)])*n,a=-R[0],i=-R[1],o=-R[2]}return r(t)?(t.x=a,t.y=i,t.z=o,t.w=u,t):new c(a,i,o,u)};var d=new c;c.fromHeadingPitchRoll=function(t,n,r,a){var i=c.fromAxisAngle(e.UNIT_X,r,d),o=c.fromAxisAngle(e.UNIT_Y,-n,a);a=c.multiply(o,i,o);var u=c.fromAxisAngle(e.UNIT_Z,-t,d);return c.multiply(u,a,a)};var E=new e,p=new e,y=new c,m=new c,_=new c;c.packedLength=4,c.pack=function(e,t,r){return r=n(r,0),t[r++]=e.x,t[r++]=e.y,t[r++]=e.z,t[r]=e.w,t},c.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new c),a.x=e[t],a.y=e[t+1],a.z=e[t+2],a.w=e[t+3],a},c.packedInterpolationLength=3,c.convertPackedArrayForInterpolation=function(e,t,n,r){c.unpack(e,4*n,_),c.conjugate(_,_);for(var a=0,i=n-t+1;a<i;a++){var o=3*a;c.unpack(e,4*(t+a),y),c.multiply(y,_,y),y.w<0&&c.negate(y,y),c.computeAxis(y,E);var u=c.computeAngle(y);r[o]=E.x*u,r[o+1]=E.y*u,r[o+2]=E.z*u}},c.unpackInterpolationResult=function(t,n,a,i,o){r(o)||(o=new c),e.fromArray(t,0,p);var u=e.magnitude(p);return c.unpack(n,4*i,m),0===u?c.clone(c.IDENTITY,y):c.fromAxisAngle(p,u,y),c.multiply(y,m,o)},c.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new c(e.x,e.y,e.z,e.w)},c.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},c.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},c.magnitude=function(e){return Math.sqrt(c.magnitudeSquared(e))},c.normalize=function(e,t){var n=1/c.magnitude(e),r=e.x*n,a=e.y*n,i=e.z*n,o=e.w*n;return t.x=r,t.y=a,t.z=i,t.w=o,t},c.inverse=function(e,t){var n=c.magnitudeSquared(e);return t=c.conjugate(e,t),c.multiplyByScalar(t,1/n,t)},c.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},c.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},c.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},c.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},c.multiply=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=e.w,u=t.x,s=t.y,c=t.z,l=t.w,f=o*u+r*l+a*c-i*s,h=o*s-r*c+a*l+i*u,d=o*c+r*s-a*u+i*l,E=o*l-r*u-a*s-i*c;return n.x=f,n.y=h,n.z=d,n.w=E,n},c.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},c.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},c.computeAxis=function(e,t){var n=e.w;if(Math.abs(n-1)<u.EPSILON6)return t.x=t.y=t.z=0,t;var r=1/Math.sqrt(1-n*n);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},c.computeAngle=function(e){return Math.abs(e.w-1)<u.EPSILON6?0:2*Math.acos(e.w)};var T=new c;c.lerp=function(e,t,n,r){return T=c.multiplyByScalar(t,n,T),r=c.multiplyByScalar(e,1-n,r),c.add(T,r,r)};var R=new c,A=new c,v=new c;c.slerp=function(e,t,n,r){var a=c.dot(e,t),i=t;if(a<0&&(a=-a,i=R=c.negate(t,R)),1-a<u.EPSILON6)return c.lerp(e,i,n,r);var o=Math.acos(a);return A=c.multiplyByScalar(e,Math.sin((1-n)*o),A),v=c.multiplyByScalar(i,Math.sin(n*o),v),r=c.add(A,v,r),c.multiplyByScalar(r,1/Math.sin(o),r)},c.log=function(t,n){var r=u.acosClamped(t.w),a=0;return 0!==r&&(a=r/Math.sin(r)),e.multiplyByScalar(t,a,n)},c.exp=function(t,n){var r=e.magnitude(t),a=0;return 0!==r&&(a=Math.sin(r)/r),n.x=t.x*a,n.y=t.y*a,n.z=t.z*a,n.w=Math.cos(r),n};var S=new e,N=new e,g=new c,O=new c;c.computeInnerQuadrangle=function(t,n,r,a){var i=c.conjugate(n,g);c.multiply(i,r,O);var o=c.log(O,S);c.multiply(i,t,O);var u=c.log(O,N);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),c.exp(o,g),c.multiply(n,g,a)},c.squad=function(e,t,n,r,a,i){var o=c.slerp(e,t,a,g),u=c.slerp(n,r,a,O);return c.slerp(o,u,2*a*(1-a),i)};for(var M=new c,I=1.9011074535173003,x=i.supportsTypedArrays()?new Float32Array(8):[],w=i.supportsTypedArrays()?new Float32Array(8):[],C=i.supportsTypedArrays()?new Float32Array(8):[],P=i.supportsTypedArrays()?new Float32Array(8):[],U=0;U<7;++U){var D=U+1,L=2*D+1;x[U]=1/(D*L),w[U]=D/L}return x[7]=I/136,w[7]=8*I/17,c.fastSlerp=function(e,t,n,r){var a,i=c.dot(e,t);i>=0?a=1:(a=-1,i=-i);for(var o=i-1,u=1-n,s=n*n,l=u*u,f=7;f>=0;--f)C[f]=(x[f]*s-w[f])*o,P[f]=(x[f]*l-w[f])*o;var h=a*n*(1+C[0]*(1+C[1]*(1+C[2]*(1+C[3]*(1+C[4]*(1+C[5]*(1+C[6]*(1+C[7])))))))),d=u*(1+P[0]*(1+P[1]*(1+P[2]*(1+P[3]*(1+P[4]*(1+P[5]*(1+P[6]*(1+P[7])))))))),E=c.multiplyByScalar(e,d,M);return c.multiplyByScalar(t,h,r),c.add(E,r,r)},c.fastSquad=function(e,t,n,r,a,i){var o=c.fastSlerp(e,t,a,g),u=c.fastSlerp(n,r,a,O);return c.fastSlerp(o,u,2*a*(1-a),i)},c.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},c.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n},c.ZERO=o(new c(0,0,0,0)),c.IDENTITY=o(new c(0,0,0,1)),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.x+", "+this.y+", "+this.z+", "+this.w+")"},c}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./Check","./defaultValue","./defined","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./HeadingPitchRoll","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,E,p,y,m,_,T,R){"use strict";var A={},v=new n,S=new n,N=new n;A.eastNorthUpToFixedFrame=function(e,t,r){if(y.equalsEpsilon(e.x,0,y.EPSILON14)&&y.equalsEpsilon(e.y,0,y.EPSILON14)){var a=y.sign(e.z);return u(r)?(r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=-a,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=a,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(0,-a,0,e.x,1,0,0,e.y,0,0,a,e.z,0,0,0,1)}var i=v,s=S,c=N;return t=o(t,f.WGS84),t.geodeticSurfaceNormal(e,i),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(i,s,c),u(r)?(r[0]=s.x,r[1]=s.y,r[2]=s.z,r[3]=0,r[4]=c.x,r[5]=c.y,r[6]=c.z,r[7]=0,r[8]=i.x,r[9]=i.y,r[10]=i.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(s.x,c.x,i.x,e.x,s.y,c.y,i.y,e.y,s.z,c.z,i.z,e.z,0,0,0,1)};var g=new n,O=new n,M=new n;A.northEastDownToFixedFrame=function(e,t,r){if(y.equalsEpsilon(e.x,0,y.EPSILON14)&&y.equalsEpsilon(e.y,0,y.EPSILON14)){var a=y.sign(e.z);return u(r)?(r[0]=-a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=-a,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(-a,0,0,e.x,0,1,0,e.y,0,0,-a,e.z,0,0,0,1)}var i=g,s=O,c=M;return t=o(t,f.WGS84),t.geodeticSurfaceNormal(e,i),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(i,s,c),u(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=s.x,r[5]=s.y,r[6]=s.z,r[7]=0,r[8]=-i.x,r[9]=-i.y,r[10]=-i.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(c.x,s.x,-i.x,e.x,c.y,s.y,-i.y,e.y,c.z,s.z,-i.z,e.z,0,0,0,1)},A.northUpEastToFixedFrame=function(e,t,r){if(y.equalsEpsilon(e.x,0,y.EPSILON14)&&y.equalsEpsilon(e.y,0,y.EPSILON14)){var a=y.sign(e.z);return u(r)?(r[0]=-a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=a,r[7]=0,r[8]=0,r[9]=1,r[10]=0,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(-a,0,0,e.x,0,0,1,e.y,0,a,0,e.z,0,0,0,1)}var i=v,s=S,c=N;return t=o(t,f.WGS84),t.geodeticSurfaceNormal(e,i),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(i,s,c),u(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=i.x,r[5]=i.y,r[6]=i.z,r[7]=0,r[8]=s.x,r[9]=s.y,r[10]=s.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(c.x,i.x,s.x,e.x,c.y,i.y,s.y,e.y,c.z,i.z,s.z,e.z,0,0,0,1)},A.northWestUpToFixedFrame=function(e,t,r){if(y.equalsEpsilon(e.x,0,y.EPSILON14)&&y.equalsEpsilon(e.y,0,y.EPSILON14)){var a=y.sign(e.z);return u(r)?(r[0]=-a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=a,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(-a,0,0,e.x,0,-1,0,e.y,0,0,a,e.z,0,0,0,1)}var i=v,s=S,c=N;return t=o(t,f.WGS84),t.geodeticSurfaceNormal(e,i),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(i,s,c),u(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=-s.x,r[5]=-s.y,r[6]=-s.z,r[7]=0,r[8]=i.x,r[9]=i.y,r[10]=i.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(c.x,-s.x,i.x,e.x,c.y,-s.y,i.y,e.y,c.z,-s.z,i.z,e.z,0,0,0,1)};var I=new T,x=new n(1,1,1),w=new _;A.headingPitchRollToFixedFrame=function(e,t,r,a){i.typeOf.object("headingPitchRoll",t);var o=t.heading,u=t.pitch,s=t.roll,c=T.fromHeadingPitchRoll(o,u,s,I),l=_.fromTranslationQuaternionRotationScale(n.ZERO,c,x,w);return a=A.eastNorthUpToFixedFrame(e,r,a),_.multiply(a,l,a)};var C=new _,P=new m;A.headingPitchRollQuaternion=function(e,t,n,r){i.typeOf.object("headingPitchRoll",t);var a=A.headingPitchRollToFixedFrame(e,t,n,C),o=_.getRotation(a,P);return T.fromRotationMatrix(o,r)};var U=24110.54841,D=8640184.812866,L=.093104,F=-62e-7,z=1.1772758384668e-19,B=72921158553e-15,b=y.TWO_PI/86400,G=new p;A.computeTemeToPseudoFixedMatrix=function(e,t){G=p.addSeconds(e,-p.computeTaiMinusUtc(e),G);var n,r=G.dayNumber,a=G.secondsOfDay,i=r-2451545;n=a>=43200?(i+.5)/R.DAYS_PER_JULIAN_CENTURY:(i-.5)/R.DAYS_PER_JULIAN_CENTURY;var o=U+n*(D+n*(L+n*F)),s=o*b%y.TWO_PI,c=B+z*(r-2451545.5),l=(a+.5*R.SECONDS_PER_DAY)%R.SECONDS_PER_DAY,f=s+c*l,h=Math.cos(f),d=Math.sin(f);return u(t)?(t[0]=h,t[1]=-d,t[2]=0,t[3]=d,t[4]=h,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new m(h,d,0,-d,h,0,0,0,1)},A.iau2006XysData=new d,A.earthOrientationParameters=c.NONE;var q=32.184,W=2451545;A.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+q,a=t.stop.dayNumber,i=t.stop.secondsOfDay+q,o=A.iau2006XysData.preload(n,r,a,i),u=A.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},A.computeIcrfToFixedMatrix=function(e,t){u(t)||(t=new m);var n=A.computeFixedToIcrfMatrix(e,t);if(u(n))return m.transpose(n,t)};var X=new E(0,0,0),V=new l(0,0,0,0,0,0),H=new m,Y=new m;A.computeFixedToIcrfMatrix=function(e,t){u(t)||(t=new m);var n=A.earthOrientationParameters.compute(e,V);if(u(n)){var r=e.dayNumber,a=e.secondsOfDay+q,i=A.iau2006XysData.computeXysRadians(r,a,X);if(u(i)){var o=i.x+n.xPoleOffset,s=i.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-o*o-s*s)),l=H;l[0]=1-c*o*o,l[3]=-c*o*s,l[6]=o,l[1]=-c*o*s,l[4]=1-c*s*s,l[7]=s,l[2]=-o,l[5]=-s,l[8]=1-c*(o*o+s*s);var f=m.fromRotationZ(-i.s,Y),h=m.multiply(l,f,H),d=e.dayNumber,E=e.secondsOfDay-p.computeTaiMinusUtc(e)+n.ut1MinusUtc,_=d-2451545,T=E/R.SECONDS_PER_DAY,v=.779057273264+T+.00273781191135448*(_+T);v=v%1*y.TWO_PI;var S=m.fromRotationZ(v,Y),N=m.multiply(h,S,H),g=Math.cos(n.xPoleWander),O=Math.cos(n.yPoleWander),M=Math.sin(n.xPoleWander),I=Math.sin(n.yPoleWander),x=r-W+a/R.SECONDS_PER_DAY;x/=36525;var w=-47e-6*x*y.RADIANS_PER_DEGREE/3600,C=Math.cos(w),P=Math.sin(w),U=Y;return U[0]=g*C,U[1]=g*P,U[2]=M,U[3]=-O*P+I*M*C,U[4]=O*C+I*M*P,U[5]=-I*g,U[6]=-I*P-O*M*C,U[7]=I*C-O*M*P,U[8]=O*g,m.multiply(N,U,t)}}};var Z=new r;A.pointToWindowCoordinates=function(e,t,n,r){return r=A.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},A.pointToGLWindowCoordinates=function(e,n,a,i){u(i)||(i=new t);var o=Z;return _.multiplyByVector(e,r.fromElements(a.x,a.y,a.z,1,o),o),r.multiplyByScalar(o,1/o.w,o),_.multiplyByVector(n,o,o),t.fromCartesian4(o,i)};var k=new n,j=new n,K=new n;A.rotationMatrixFromPositionVelocity=function(e,t,r,a){var i=o(r,f.WGS84).geodeticSurfaceNormal(e,k),s=n.cross(t,i,j);n.equalsEpsilon(s,n.ZERO,y.EPSILON6)&&(s=n.clone(n.UNIT_X,s));var c=n.cross(s,t,K);return n.cross(t,c,s),n.negate(s,s),u(a)||(a=new m),a[0]=t.x,a[1]=t.y,a[2]=t.z,a[3]=s.x,a[4]=s.y,a[5]=s.z,a[6]=c.x,a[7]=c.y,a[8]=c.z,a};var J=new a,Q=new n,$=new n,ee=new r,te=new r,ne=new r,re=new r,ae=new r,ie=new _,oe=new _;A.basisTo2D=function(e,t,a){var i=e.ellipsoid,o=_.getColumn(t,3,ee),u=i.cartesianToCartographic(o,J),s=A.eastNorthUpToFixedFrame(o,i,ie),c=_.inverseTransformation(s,oe),l=e.project(u,Q),f=te;f.x=l.z,f.y=l.x,f.z=l.y,f.w=1;var h=_.getColumn(t,0,$),d=n.magnitude(h),E=_.multiplyByVector(c,h,ne);r.fromElements(E.z,E.x,E.y,0,E);var p=_.getColumn(t,1,$),y=n.magnitude(p),m=_.multiplyByVector(c,p,re);r.fromElements(m.z,m.x,m.y,0,m);var T=_.getColumn(t,2,$),R=n.magnitude(T),v=ae;return n.cross(E,m,v),n.normalize(v,v),n.cross(m,v,E),n.normalize(E,E),n.cross(v,E,m),n.normalize(m,m),n.multiplyByScalar(E,d,E),n.multiplyByScalar(m,y,m),n.multiplyByScalar(v,R,v),_.setColumn(a,0,E,a),_.setColumn(a,1,m,a),_.setColumn(a,2,v,a),_.setColumn(a,3,f,a),a};var ue=new _(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);return A.wgs84To2DModelMatrix=function(e,t,n){var r=e.ellipsoid,a=A.eastNorthUpToFixedFrame(t,r,ie),i=_.inverseTransformation(a,oe),o=r.cartesianToCartographic(t,J),u=e.project(o,Q),s=te;s.x=u.z,s.y=u.x,s.z=u.y,s.w=1;var c=_.fromTranslation(s,ie);return _.multiply(ue,i,n),_.multiply(c,n,n),n},A}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d){"use strict";function E(e,t){t=a(t,s.WGS84),e=t.scaleToGeodeticSurface(e);var r=d.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=n.fromCartesian4(l.getColumn(r,0,p)),this._yAxis=n.fromCartesian4(l.getColumn(r,1,p));var i=n.fromCartesian4(l.getColumn(r,2,p));this._plane=f.fromPointNormal(e,i)}var p=new r;o(E.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var y=new e;E.fromPoints=function(t,n){var r=e.fromPoints(t,y);return new E(r.center,n)};var m=new h,_=new n;E.prototype.projectPointOntoPlane=function(e,r){var a=m;a.origin=e,n.normalize(e,a.direction);var o=c.rayPlane(a,this._plane,_);if(i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,_)),i(o)){var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return i(r)?(r.x=s,r.y=l,r):new t(s,l)}},E.prototype.projectPointsOntoPlane=function(e,t){i(t)||(t=[]);for(var n=0,r=e.length,a=0;a<r;a++){var o=this.projectPointOntoPlane(e[a],t[n]);i(o)&&(t[n]=o,n++)}return t.length=n,t},E.prototype.projectPointToNearestOnPlane=function(e,r){i(r)||(r=new t);var a=m;a.origin=e,n.clone(this._plane.normal,a.direction);var o=c.rayPlane(a,this._plane,_);i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,_));var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return r.x=s,r.y=l,r},E.prototype.projectPointsToNearestOnPlane=function(e,t){i(t)||(t=[]);var n=e.length;t.length=n;for(var r=0;r<n;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var T=new n;return E.prototype.projectPointsOntoEllipsoid=function(e,t){var r=e.length;i(t)?t.length=r:t=new Array(r);for(var a=this._ellipsoid,o=this._origin,u=this._xAxis,s=this._yAxis,c=T,l=0;l<r;++l){var f=e[l];n.multiplyByScalar(u,f.x,c),i(t[l])||(t[l]=new n);var h=n.add(o,c,t[l]);n.multiplyByScalar(s,f.y,c),n.add(h,c,h),a.scaleToGeocentricSurface(h,h)}return t},E}),define("Core/PolylineVolumeGeometryLibrary",["./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./CornerType","./EllipsoidTangentPlane","./Math","./Matrix3","./Matrix4","./PolylinePipeline","./Quaternion","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(e,t){for(var n=new Array(e.length),r=0;r<e.length;r++){var a=e[r];U=t.cartesianToCartographic(a,U),n[r]=U.height,e[r]=t.scaleToGeodeticSurface(a,a)}return n}function d(e,n,r,a){var i,o=e[0],u=e[1],s=t.angleBetween(o,u),c=Math.ceil(s/a),l=new Array(c);if(n===r){for(i=0;i<c;i++)l[i]=n;return l.push(r),l}var f=r-n,h=f/c;for(i=1;i<c;i++){var d=n+i*h;l[i]=d}return l[0]=n,l.push(r),l}function E(n,r,a,o){var u=new i(a,o),s=u.projectPointOntoPlane(t.add(a,n,Y),Y),c=u.projectPointOntoPlane(t.add(a,r,Z),Z),l=e.angleBetween(s,c);return c.x*s.y-c.y*s.x>=0?-l:l}function p(e,n,r,a,i,o,c,l){var h=b,d=G;L=f.eastNorthUpToFixedFrame(e,i,L),h=s.multiplyByPointAsVector(L,D,h),h=t.normalize(h,h);var p=E(h,n,e,i);z=u.fromRotationZ(p,z),q.z=o,L=s.multiplyTransformation(L,s.fromRotationTranslation(z,q,F),L);var y=B;y[0]=c;for(var m=0;m<l;m++)for(var _=0;_<r.length;_+=3)d=t.fromArray(r,_,d),d=u.multiplyByVector(y,d,d),d=s.multiplyByPoint(L,d,d),a.push(d.x,d.y,d.z);return a}function y(e,n,r,a,i,o,u){for(var s=0;s<e.length;s+=3){var c=t.fromArray(e,s,W);a=p(c,n,r,a,i,o[s/3],u,1)}return a}function m(e,t){var n=e.length,r=new Array(6*n),a=0,i=t.x+t.width/2,o=t.y+t.height/2,u=e[0];r[a++]=u.x-i,r[a++]=0,r[a++]=u.y-o;for(var s=1;s<n;s++){u=e[s];var c=u.x-i,l=u.y-o;r[a++]=c,r[a++]=0,r[a++]=l,r[a++]=c,r[a++]=0,r[a++]=l}return u=e[0],r[a++]=u.x-i,r[a++]=0,r[a++]=u.y-o,r}function _(e,t){for(var n=e.length,r=new Array(3*n),a=0,i=t.x+t.width/2,o=t.y+t.height/2,u=0;u<n;u++)r[a++]=e[u].x-i,r[a++]=0,r[a++]=e[u].y-o;return r}function T(e,n,r,i,s,c,f,h,d,E){var y,m=t.angleBetween(t.subtract(n,e,w),t.subtract(r,e,C)),_=i===a.BEVELED?0:Math.ceil(m/o.toRadians(5));y=s?u.fromQuaternion(l.fromAxisAngle(t.negate(e,w),m/(_+1),X),H):u.fromQuaternion(l.fromAxisAngle(e,m/(_+1),X),H);var T,R;if(n=t.clone(n,V),_>0)for(var A=E?2:1,v=0;v<_;v++)n=u.multiplyByVector(y,n,n),T=t.subtract(n,e,w),T=t.normalize(T,T),s||(T=t.negate(T,T)),R=c.scaleToGeodeticSurface(n,C),f=p(R,T,h,f,c,d,1,A);else T=t.subtract(n,e,w),T=t.normalize(T,T),s||(T=t.negate(T,T)),R=c.scaleToGeodeticSurface(n,C),f=p(R,T,h,f,c,d,1,1),r=t.clone(r,V),T=t.subtract(r,e,w),T=t.normalize(T,T),s||(T=t.negate(T,T)),R=c.scaleToGeodeticSurface(r,C),f=p(R,T,h,f,c,d,1,1);return f}var R=[new t,new t],A=new t,v=new t,S=new t,N=new t,g=new t,O=new t,M=new t,I=new t,x=new t,w=new t,C=new t,P={},U=new r,D=new t(-1,0,0),L=new s,F=new s,z=new u,B=u.IDENTITY.clone(),b=new t,G=new n,q=new t,W=new t,X=new l,V=new t,H=new u;P.removeDuplicatesFromShape=function(t){for(var n=t.length,r=[],a=n-1,i=0;i<n;a=i++){var o=t[a],u=t[i];e.equals(o,u)||r.push(u)}return r};var Y=new t,Z=new t;P.angleIsGreaterThanPi=function(e,n,r,a){var o=new i(r,a),u=o.projectPointOntoPlane(t.add(r,e,Y),Y),s=o.projectPointOntoPlane(t.add(r,n,Z),Z);return s.x*u.y-s.y*u.x>=0};var k=new t,j=new t;return P.computePositions=function(e,n,r,i,u){var s=i._ellipsoid,l=h(e,s),f=i._granularity,E=i._cornerType,C=u?m(n,r):_(n,r),U=u?_(n,r):void 0,D=r.height/2,L=r.width/2,F=e.length,z=[],B=u?[]:void 0,b=A,G=v,q=S,W=N,X=g,V=O,H=M,Y=I,Z=x,K=e[0],J=e[1];W=s.geodeticSurfaceNormal(K,W),b=t.subtract(J,K,b),b=t.normalize(b,b),Y=t.cross(W,b,Y),Y=t.normalize(Y,Y);var Q=l[0],$=l[1];u&&(B=p(K,Y,U,B,s,Q+D,1,1)),Z=t.clone(K,Z),K=J,G=t.negate(b,G);for(var ee,te,ne=1;ne<F-1;ne++){var re=u?2:1;J=e[ne+1],b=t.subtract(J,K,b),b=t.normalize(b,b),q=t.add(b,G,q),q=t.normalize(q,q),W=s.geodeticSurfaceNormal(K,W);var ae=t.multiplyByScalar(W,t.dot(b,W),k);t.subtract(b,ae,ae),t.normalize(ae,ae);var ie=t.multiplyByScalar(W,t.dot(G,W),j);t.subtract(G,ie,ie),t.normalize(ie,ie);var oe=!o.equalsEpsilon(Math.abs(t.dot(ae,ie)),1,o.EPSILON7);if(oe){q=t.cross(q,W,q),q=t.cross(W,q,q),q=t.normalize(q,q);var ue=1/Math.max(.25,t.magnitude(t.cross(q,G,w))),se=P.angleIsGreaterThanPi(b,G,K,s);se?(X=t.add(K,t.multiplyByScalar(q,ue*L,q),X),V=t.add(X,t.multiplyByScalar(Y,L,V),V),R[0]=t.clone(Z,R[0]),R[1]=t.clone(V,R[1]),ee=d(R,Q+D,$+D,f),te=c.generateArc({positions:R,granularity:f,ellipsoid:s}),z=y(te,Y,C,z,s,ee,1),Y=t.cross(W,b,Y),Y=t.normalize(Y,Y),H=t.add(X,t.multiplyByScalar(Y,L,H),H),E===a.ROUNDED||E===a.BEVELED?T(X,V,H,E,se,s,z,C,$+D,u):(q=t.negate(q,q),z=p(K,q,C,z,s,$+D,ue,re)),Z=t.clone(H,Z)):(X=t.add(K,t.multiplyByScalar(q,ue*L,q),X),V=t.add(X,t.multiplyByScalar(Y,-L,V),V),R[0]=t.clone(Z,R[0]),R[1]=t.clone(V,R[1]),ee=d(R,Q+D,$+D,f),te=c.generateArc({positions:R,granularity:f,ellipsoid:s}),z=y(te,Y,C,z,s,ee,1),Y=t.cross(W,b,Y),Y=t.normalize(Y,Y),H=t.add(X,t.multiplyByScalar(Y,-L,H),H),E===a.ROUNDED||E===a.BEVELED?T(X,V,H,E,se,s,z,C,$+D,u):z=p(K,q,C,z,s,$+D,ue,re),Z=t.clone(H,Z)),G=t.negate(b,G)}else z=p(Z,Y,C,z,s,Q+D,1,1),Z=K;Q=$,$=l[ne+1],K=J}R[0]=t.clone(Z,R[0]),R[1]=t.clone(K,R[1]),ee=d(R,Q+D,$+D,f),te=c.generateArc({positions:R,granularity:f,ellipsoid:s}),z=y(te,Y,C,z,s,ee,1),u&&(B=p(K,Y,U,B,s,$+D,1,1)),F=z.length;var ce=u?F+B.length:F,le=new Float64Array(ce);return le.set(z),u&&le.set(B,F),le},P}),define("Core/CorridorGeometryLibrary",["./Cartesian3","./CornerType","./defined","./Math","./Matrix3","./PolylinePipeline","./PolylineVolumeGeometryLibrary","./Quaternion"],function(e,t,n,r,a,i,o,u){"use strict";function s(n,i,o,s,c){var l=e.angleBetween(e.subtract(i,n,E),e.subtract(o,n,p)),f=s===t.BEVELED?1:Math.ceil(l/r.toRadians(5))+1,h=3*f,d=new Array(h);d[h-3]=o.x,d[h-2]=o.y,d[h-1]=o.z;var y;y=c?a.fromQuaternion(u.fromAxisAngle(e.negate(n,E),l/f,x),w):a.fromQuaternion(u.fromAxisAngle(n,l/f,x),w);var m=0;i=e.clone(i,E);for(var _=0;_<f;_++)i=a.multiplyByVector(y,i,i),d[m++]=i.x,d[m++]=i.y,d[m++]=i.z;return d}function c(n){var r=T,a=R,i=A,o=n[1];a=e.fromArray(n[1],o.length-3,a),i=e.fromArray(n[0],0,i),r=e.multiplyByScalar(e.add(a,i,r),.5,r);var u=s(r,a,i,t.ROUNDED,!1),c=n.length-1,l=n[c-1];o=n[c],a=e.fromArray(l,l.length-3,a),i=e.fromArray(o,0,i),r=e.multiplyByScalar(e.add(a,i,r),.5,r);var f=s(r,a,i,t.ROUNDED,!1);return[u,f]}function l(t,n,r,a){var i=E;return a?i=e.add(t,n,i):(n=e.negate(n,n),i=e.add(t,n,i)),[i.x,i.y,i.z,r.x,r.y,r.z]}function f(t,n,r,a){for(var i=new Array(t.length),o=new Array(t.length),u=e.multiplyByScalar(n,r,E),s=e.negate(u,p),c=0,l=t.length-1,f=0;f<t.length;f+=3){var h=e.fromArray(t,f,y),d=e.add(h,s,m);i[c++]=d.x,i[c++]=d.y,i[c++]=d.z;var _=e.add(h,u,m);o[l--]=_.z,o[l--]=_.y,o[l--]=_.x}return a.push(i,o),a}function h(e,t){for(var n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}var d={},E=new e,p=new e,y=new e,m=new e,_=[new e,new e],T=new e,R=new e,A=new e,v=new e,S=new e,N=new e,g=new e,O=new e,M=new e,I=new e,x=new u,w=new a;d.addAttribute=function(e,t,r,a){var i=t.x,o=t.y,u=t.z;n(r)&&(e[r]=i,e[r+1]=o,e[r+2]=u),n(a)&&(e[a]=u,e[a-1]=o,e[a-2]=i)};var C=new e,P=new e;return d.computePositions=function(n){var a=n.granularity,u=n.positions,d=n.ellipsoid;u=h(u,d);var p=n.width/2,y=n.cornerType,m=n.saveAttributes,x=T,w=R,U=A,D=v,L=S,F=N,z=g,B=O,b=M,G=I,q=[],W=m?[]:void 0,X=m?[]:void 0,V=u[0],H=u[1];w=e.normalize(e.subtract(H,V,w),w),x=d.geodeticSurfaceNormal(V,x),D=e.normalize(e.cross(x,w,D),D),m&&(W.push(D.x,D.y,D.z),X.push(x.x,x.y,x.z)),z=e.clone(V,z),V=H,U=e.negate(w,U);var Y,Z,k=[],j=u.length;for(Z=1;Z<j-1;Z++){x=d.geodeticSurfaceNormal(V,x),H=u[Z+1],w=e.normalize(e.subtract(H,V,w),w),L=e.normalize(e.add(w,U,L),L);var K=e.multiplyByScalar(x,e.dot(w,x),C);e.subtract(w,K,K),e.normalize(K,K);var J=e.multiplyByScalar(x,e.dot(U,x),P);e.subtract(U,J,J),e.normalize(J,J);var Q=!r.equalsEpsilon(Math.abs(e.dot(K,J)),1,r.EPSILON7);if(Q){L=e.cross(L,x,L),L=e.cross(x,L,L),L=e.normalize(L,L); +var $=p/Math.max(.25,e.magnitude(e.cross(L,U,E))),ee=o.angleIsGreaterThanPi(w,U,V,d);L=e.multiplyByScalar(L,$,L),ee?(B=e.add(V,L,B),G=e.add(B,e.multiplyByScalar(D,p,G),G),b=e.add(B,e.multiplyByScalar(D,2*p,b),b),_[0]=e.clone(z,_[0]),_[1]=e.clone(G,_[1]),Y=i.generateArc({positions:_,granularity:a,ellipsoid:d}),q=f(Y,D,p,q),m&&(W.push(D.x,D.y,D.z),X.push(x.x,x.y,x.z)),F=e.clone(b,F),D=e.normalize(e.cross(x,w,D),D),b=e.add(B,e.multiplyByScalar(D,2*p,b),b),z=e.add(B,e.multiplyByScalar(D,p,z),z),y===t.ROUNDED||y===t.BEVELED?k.push({leftPositions:s(B,F,b,y,ee)}):k.push({leftPositions:l(V,e.negate(L,L),b,ee)})):(b=e.add(V,L,b),G=e.add(b,e.negate(e.multiplyByScalar(D,p,G),G),G),B=e.add(b,e.negate(e.multiplyByScalar(D,2*p,B),B),B),_[0]=e.clone(z,_[0]),_[1]=e.clone(G,_[1]),Y=i.generateArc({positions:_,granularity:a,ellipsoid:d}),q=f(Y,D,p,q),m&&(W.push(D.x,D.y,D.z),X.push(x.x,x.y,x.z)),F=e.clone(B,F),D=e.normalize(e.cross(x,w,D),D),B=e.add(b,e.negate(e.multiplyByScalar(D,2*p,B),B),B),z=e.add(b,e.negate(e.multiplyByScalar(D,p,z),z),z),y===t.ROUNDED||y===t.BEVELED?k.push({rightPositions:s(b,F,B,y,ee)}):k.push({rightPositions:l(V,L,B,ee)})),U=e.negate(w,U)}V=H}x=d.geodeticSurfaceNormal(V,x),_[0]=e.clone(z,_[0]),_[1]=e.clone(V,_[1]),Y=i.generateArc({positions:_,granularity:a,ellipsoid:d}),q=f(Y,D,p,q),m&&(W.push(D.x,D.y,D.z),X.push(x.x,x.y,x.z));var te;return y===t.ROUNDED&&(te=c(q)),{positions:q,corners:k,lefts:W,normals:X,endPositions:te}},d}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===n.POINTS||e===n.LINES||e===n.LINE_LOOP||e===n.LINE_STRIP||e===n.TRIANGLES||e===n.TRIANGLE_STRIP||e===n.TRIANGLE_FAN}};return e(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,a){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,a.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return i.computeNumberOfVertices=function(e){var n=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var a=e.attributes[r],i=a.values.length/a.componentsPerAttribute;n=i}return n},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(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 r}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,n,r,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(e){switch(e){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(t){return e(t)&&(t===i.UNSIGNED_BYTE||t===i.UNSIGNED_SHORT||t===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,n,a){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,a):new Uint16Array(t,n,a)},n(i)}),define("ThirdParty/earcut-2.1.1",[],function(){"use strict";function e(e,n,a){a=a||2;var i=n&&n.length,o=i?n[0]*a:e.length,u=t(e,0,o,a,!0),c=[];if(!u)return c;var l,f,h,d,E,p,y;if(i&&(u=s(e,n,u,a)),e.length>80*a){l=h=e[0],f=d=e[1];for(var m=a;m<o;m+=a)E=e[m],p=e[m+1],E<l&&(l=E),p<f&&(f=p),E>h&&(h=E),p>d&&(d=p);y=Math.max(h-l,d-f)}return r(u,c,a,l,f,y),c}function t(e,t,n,r,a){var i,o;if(a===I(e,t,n,r)>0)for(i=t;i<n;i+=r)o=g(i,e[i],e[i+1],o);else for(i=n-r;i>=t;i-=r)o=g(i,e[i],e[i+1],o);return o&&T(o,o.next)&&(O(o),o=o.next),o}function n(e,t){if(!e)return e;t||(t=e);var n,r=e;do if(n=!1,r.steiner||!T(r,r.next)&&0!==_(r.prev,r,r.next))r=r.next;else{if(O(r),r=t=r.prev,r===r.next)return null;n=!0}while(n||r!==t);return t}function r(e,t,s,c,l,f,d){if(e){!d&&f&&h(e,c,l,f);for(var E,p,y=e;e.prev!==e.next;)if(E=e.prev,p=e.next,f?i(e,c,l,f):a(e))t.push(E.i/s),t.push(e.i/s),t.push(p.i/s),O(e),e=p.next,y=p.next;else if(e=p,e===y){d?1===d?(e=o(e,t,s),r(e,t,s,c,l,f,2)):2===d&&u(e,t,s,c,l,f):r(n(e),t,s,c,l,f,1);break}}}function a(e){var t=e.prev,n=e,r=e.next;if(_(t,n,r)>=0)return!1;for(var a=e.next.next;a!==e.prev;){if(y(t.x,t.y,n.x,n.y,r.x,r.y,a.x,a.y)&&_(a.prev,a,a.next)>=0)return!1;a=a.next}return!0}function i(e,t,n,r){var a=e.prev,i=e,o=e.next;if(_(a,i,o)>=0)return!1;for(var u=a.x<i.x?a.x<o.x?a.x:o.x:i.x<o.x?i.x:o.x,s=a.y<i.y?a.y<o.y?a.y:o.y:i.y<o.y?i.y:o.y,c=a.x>i.x?a.x>o.x?a.x:o.x:i.x>o.x?i.x:o.x,l=a.y>i.y?a.y>o.y?a.y:o.y:i.y>o.y?i.y:o.y,f=E(u,s,t,n,r),h=E(c,l,t,n,r),d=e.nextZ;d&&d.z<=h;){if(d!==e.prev&&d!==e.next&&y(a.x,a.y,i.x,i.y,o.x,o.y,d.x,d.y)&&_(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(d=e.prevZ;d&&d.z>=f;){if(d!==e.prev&&d!==e.next&&y(a.x,a.y,i.x,i.y,o.x,o.y,d.x,d.y)&&_(d.prev,d,d.next)>=0)return!1;d=d.prevZ}return!0}function o(e,t,n){var r=e;do{var a=r.prev,i=r.next.next;!T(a,i)&&R(a,r,r.next,i)&&v(a,i)&&v(i,a)&&(t.push(a.i/n),t.push(r.i/n),t.push(i.i/n),O(r),O(r.next),r=e=i),r=r.next}while(r!==e);return r}function u(e,t,a,i,o,u){var s=e;do{for(var c=s.next.next;c!==s.prev;){if(s.i!==c.i&&m(s,c)){var l=N(s,c);return s=n(s,s.next),l=n(l,l.next),r(s,t,a,i,o,u),void r(l,t,a,i,o,u)}c=c.next}s=s.next}while(s!==e)}function s(e,r,a,i){var o,u,s,f,h,d=[];for(o=0,u=r.length;o<u;o++)s=r[o]*i,f=o<u-1?r[o+1]*i:e.length,h=t(e,s,f,i,!1),h===h.next&&(h.steiner=!0),d.push(p(h));for(d.sort(c),o=0;o<d.length;o++)l(d[o],a),a=n(a,a.next);return a}function c(e,t){return e.x-t.x}function l(e,t){if(t=f(e,t)){var r=N(t,e);n(r,r.next)}}function f(e,t){var n,r=t,a=e.x,i=e.y,o=-(1/0);do{if(i<=r.y&&i>=r.next.y){var u=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(u<=a&&u>o){if(o=u,u===a){if(i===r.y)return r;if(i===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(a===o)return n.prev;var s,c=n,l=n.x,f=n.y,h=1/0;for(r=n.next;r!==c;)a>=r.x&&r.x>=l&&y(i<f?a:o,i,l,f,i<f?o:a,i,r.x,r.y)&&(s=Math.abs(i-r.y)/(a-r.x),(s<h||s===h&&r.x>n.x)&&v(r,e)&&(n=r,h=s)),r=r.next;return n}function h(e,t,n,r){var a=e;do null===a.z&&(a.z=E(a.x,a.y,t,n,r)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next;while(a!==e);a.prevZ.nextZ=null,a.prevZ=null,d(a)}function d(e){var t,n,r,a,i,o,u,s,c=1;do{for(n=e,e=null,i=null,o=0;n;){for(o++,r=n,u=0,t=0;t<c&&(u++,r=r.nextZ,r);t++);for(s=c;u>0||s>0&&r;)0===u?(a=r,r=r.nextZ,s--):0!==s&&r?n.z<=r.z?(a=n,n=n.nextZ,u--):(a=r,r=r.nextZ,s--):(a=n,n=n.nextZ,u--),i?i.nextZ=a:e=a,a.prevZ=i,i=a;n=r}i.nextZ=null,c*=2}while(o>1);return e}function E(e,t,n,r,a){return e=32767*(e-n)/a,t=32767*(t-r)/a,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function p(e){var t=e,n=e;do t.x<n.x&&(n=t),t=t.next;while(t!==e);return n}function y(e,t,n,r,a,i,o,u){return(a-o)*(t-u)-(e-o)*(i-u)>=0&&(e-o)*(r-u)-(n-o)*(t-u)>=0&&(n-o)*(i-u)-(a-o)*(r-u)>=0}function m(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!A(e,t)&&v(e,t)&&v(t,e)&&S(e,t)}function _(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function T(e,t){return e.x===t.x&&e.y===t.y}function R(e,t,n,r){return!!(T(e,t)&&T(n,r)||T(e,r)&&T(n,t))||_(e,t,n)>0!=_(e,t,r)>0&&_(n,r,e)>0!=_(n,r,t)>0}function A(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&R(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function v(e,t){return _(e.prev,e,e.next)<0?_(e,t,e.next)>=0&&_(e,e.prev,t)>=0:_(e,t,e.prev)<0||_(e,e.next,t)<0}function S(e,t){var n=e,r=!1,a=(e.x+t.x)/2,i=(e.y+t.y)/2;do n.y>i!=n.next.y>i&&a<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function N(e,t){var n=new M(e.i,e.x,e.y),r=new M(t.i,t.x,t.y),a=e.next,i=t.prev;return e.next=t,t.prev=e,n.next=a,a.prev=n,r.next=n,n.prev=r,i.next=r,r.prev=i,r}function g(e,t,n,r){var a=new M(e,t,n);return r?(a.next=r.next,a.prev=r,r.next.prev=a,r.next=a):(a.prev=a,a.next=a),a}function O(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function M(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function I(e,t,n,r){for(var a=0,i=t,o=n-r;i<n;i+=r)a+=(e[o]-e[i])*(e[i+1]+e[o+1]),o=i;return a}return e.deviation=function(e,t,n,r){var a=t&&t.length,i=a?t[0]*n:e.length,o=Math.abs(I(e,0,i,n));if(a)for(var u=0,s=t.length;u<s;u++){var c=t[u]*n,l=u<s-1?t[u+1]*n:e.length;o-=Math.abs(I(e,c,l,n))}var f=0;for(u=0;u<r.length;u+=3){var h=r[u]*n,d=r[u+1]*n,E=r[u+2]*n;f+=Math.abs((e[h]-e[E])*(e[d+1]-e[h+1])-(e[h]-e[d])*(e[E+1]-e[h+1]))}return 0===o&&0===f?0:Math.abs((f-o)/o)},e.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,a=0;a<e.length;a++){for(var i=0;i<e[a].length;i++)for(var o=0;o<t;o++)n.vertices.push(e[a][i][o]);a>0&&(r+=e[a-1].length,n.holes.push(r))}return n},e}),define("Core/WindingOrder",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={CLOCKWISE:t.CW,COUNTER_CLOCKWISE:t.CCW,validate:function(e){return e===n.CLOCKWISE||e===n.COUNTER_CLOCKWISE}};return e(n)}),define("Core/PolygonPipeline",["../ThirdParty/earcut-2.1.1","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./Math","./PrimitiveType","./WindingOrder"],function(e,t,n,r,a,i,o,u,s,c,l,f,h){"use strict";var d=new n,E=new n,p={};p.computeArea2D=function(e){for(var t=e.length,n=0,r=t-1,a=0;a<t;r=a++){var i=e[r],o=e[a];n+=i.x*o.y-o.x*i.y}return.5*n},p.computeWindingOrder2D=function(e){var t=p.computeArea2D(e);return t>0?h.COUNTER_CLOCKWISE:h.CLOCKWISE},p.triangulate=function(n,r){var a=t.packArray(n);return e(a,r,2)};var y=new n,m=new n,_=new n,T=new n,R=new n,A=new n,v=new n;return p.computeSubdivision=function(e,t,o,u){u=a(u,l.RADIANS_PER_DEGREE);var h,d=o.slice(0),E=t.length,p=new Array(3*E),S=0;for(h=0;h<E;h++){var N=t[h];p[S++]=N.x,p[S++]=N.y,p[S++]=N.z}for(var g=[],O={},M=e.maximumRadius,I=l.chordLength(u,M),x=I*I;d.length>0;){var w,C,P=d.pop(),U=d.pop(),D=d.pop(),L=n.fromArray(p,3*D,y),F=n.fromArray(p,3*U,m),z=n.fromArray(p,3*P,_),B=n.multiplyByScalar(n.normalize(L,T),M,T),b=n.multiplyByScalar(n.normalize(F,R),M,R),G=n.multiplyByScalar(n.normalize(z,A),M,A),q=n.magnitudeSquared(n.subtract(B,b,v)),W=n.magnitudeSquared(n.subtract(b,G,v)),X=n.magnitudeSquared(n.subtract(G,B,v)),V=Math.max(q,W,X);V>x?q===V?(w=Math.min(D,U)+" "+Math.max(D,U),h=O[w],i(h)||(C=n.add(L,F,v),n.multiplyByScalar(C,.5,C),p.push(C.x,C.y,C.z),h=p.length/3-1,O[w]=h),d.push(D,h,P),d.push(h,U,P)):W===V?(w=Math.min(U,P)+" "+Math.max(U,P),h=O[w],i(h)||(C=n.add(F,z,v),n.multiplyByScalar(C,.5,C),p.push(C.x,C.y,C.z),h=p.length/3-1,O[w]=h),d.push(U,h,D),d.push(h,P,D)):X===V&&(w=Math.min(P,D)+" "+Math.max(P,D),h=O[w],i(h)||(C=n.add(z,L,v),n.multiplyByScalar(C,.5,C),p.push(C.x,C.y,C.z),h=p.length/3-1,O[w]=h),d.push(P,h,U),d.push(h,D,U)):(g.push(D),g.push(U),g.push(P))}return new s({attributes:{position:new c({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:p})},indices:g,primitiveType:f.TRIANGLES})},p.scaleToGeodeticHeight=function(e,t,r,o){r=a(r,u.WGS84);var s=d,c=E;if(t=a(t,0),o=a(o,!0),i(e))for(var l=e.length,f=0;f<l;f+=3)n.fromArray(e,f,c),o&&(c=r.scaleToGeodeticSurface(c,c)),0!==t&&(s=r.geodeticSurfaceNormal(c,s),n.multiplyByScalar(s,t,s),n.add(c,s,c)),e[f]=c.x,e[f+1]=c.y,e[f+2]=c.z;return e},p}),define("Core/CorridorOutlineGeometry",["./arrayRemoveDuplicates","./BoundingSphere","./Cartesian3","./ComponentDatatype","./CornerType","./CorridorGeometryLibrary","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolygonPipeline","./PrimitiveType"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,E,p,y){"use strict";function m(e,t){var o,s,c,l=[],E=e.positions,p=e.corners,y=e.endPositions,m=new h,_=0,T=0,S=0;for(s=0;s<E.length;s+=2)c=E[s].length-3,_+=c,S+=c/3*4,T+=E[s+1].length-3;for(_+=3,T+=3,s=0;s<p.length;s++){o=p[s];var N=p[s].leftPositions;u(N)?(c=N.length,_+=c,S+=c/3*2):(c=p[s].rightPositions.length,T+=c,S+=c/3*2)}var g,O=u(y);O&&(g=y[0].length-3,_+=g,T+=g,g/=3,S+=4*g);var M,I,x,w,C,P,U=_+T,D=new Float64Array(U),L=0,F=U-1,z=g/2,B=d.createTypedArray(U/3,S+4),b=0;if(B[b++]=L/3,B[b++]=(F-2)/3,O){l.push(L/3),P=R,C=A;var G=y[0];for(s=0;s<z;s++)P=n.fromArray(G,3*(z-1-s),P),C=n.fromArray(G,3*(z+s),C),i.addAttribute(D,C,L),i.addAttribute(D,P,void 0,F),I=L/3,w=I+1,M=(F-2)/3,x=M-1,B[b++]=M,B[b++]=x,B[b++]=I,B[b++]=w,L+=3,F-=3}var q=0,W=E[q++],X=E[q++];for(D.set(W,L),D.set(X,F-X.length+1),c=X.length-3,l.push(L/3,(F-2)/3),s=0;s<c;s+=3)I=L/3,w=I+1,M=(F-2)/3,x=M-1,B[b++]=M,B[b++]=x,B[b++]=I,B[b++]=w,L+=3,F-=3;for(s=0;s<p.length;s++){var V;o=p[s];var H,Y=o.leftPositions,Z=o.rightPositions,k=v;if(u(Y)){for(F-=3,H=x,l.push(w),V=0;V<Y.length/3;V++)k=n.fromArray(Y,3*V,k),B[b++]=H-V-1,B[b++]=H-V,i.addAttribute(D,k,void 0,F),F-=3;l.push(H-Math.floor(Y.length/6)),t===a.BEVELED&&l.push((F-2)/3+1),L+=3}else{for(L+=3,H=w,l.push(x),V=0;V<Z.length/3;V++)k=n.fromArray(Z,3*V,k),B[b++]=H+V,B[b++]=H+V+1,i.addAttribute(D,k,L),L+=3;l.push(H+Math.floor(Z.length/6)),t===a.BEVELED&&l.push(L/3-1),F-=3}for(W=E[q++],X=E[q++],W.splice(0,3),X.splice(X.length-3,3),D.set(W,L),D.set(X,F-X.length+1),c=X.length-3,V=0;V<X.length;V+=3)w=L/3,I=w-1,x=(F-2)/3,M=x+1,B[b++]=M,B[b++]=x,B[b++]=I,B[b++]=w,L+=3,F-=3;L-=3,F+=3,l.push(L/3,(F-2)/3)}if(O){L+=3,F-=3,P=R,C=A;var j=y[1];for(s=0;s<z;s++)P=n.fromArray(j,3*(g-s-1),P),C=n.fromArray(j,3*s,C),i.addAttribute(D,P,void 0,F),i.addAttribute(D,C,L),w=L/3,I=w-1,x=(F-2)/3,M=x+1,B[b++]=M,B[b++]=x,B[b++]=I,B[b++]=w,L+=3,F-=3;l.push(L/3)}else l.push(L/3,(F-2)/3);return B[b++]=L/3,B[b++]=(F-2)/3,m.position=new f({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:D}),{attributes:m,indices:B,wallIndices:l}}function _(e){var t=e.ellipsoid,n=i.computePositions(e),r=m(n,e.cornerType),a=r.wallIndices,o=e.height,u=e.extrudedHeight,s=r.attributes,c=r.indices,l=s.position.values,f=l.length,h=new Float64Array(f);h.set(l);var E=new Float64Array(2*f);l=p.scaleToGeodeticHeight(l,o,t),h=p.scaleToGeodeticHeight(h,u,t),E.set(l),E.set(h,f),s.position.values=E,f/=3;var y,_=c.length,T=d.createTypedArray(E.length/3,2*(_+a.length));T.set(c);var R=_;for(y=0;y<_;y+=2){var A=c[y],v=c[y+1];T[R++]=A+f,T[R++]=v+f}var S,N;for(y=0;y<a.length;y++)S=a[y],N=S+f,T[R++]=S,T[R++]=N;return{attributes:s,indices:T}}function T(e){e=o(e,o.EMPTY_OBJECT);var t=e.positions,r=e.width;this._positions=t,this._ellipsoid=c.clone(o(e.ellipsoid,c.WGS84)),this._width=r,this._height=o(e.height,0),this._extrudedHeight=o(e.extrudedHeight,this._height),this._cornerType=o(e.cornerType,a.ROUNDED),this._granularity=o(e.granularity,E.RADIANS_PER_DEGREE),this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*n.packedLength+c.packedLength+5}var R=new n,A=new n,v=new n;T.pack=function(e,t,r){r=o(r,0);var a=e._positions,i=a.length;t[r++]=i;for(var u=0;u<i;++u,r+=n.packedLength)n.pack(a[u],t,r);return c.pack(e._ellipsoid,t,r),r+=c.packedLength,t[r++]=e._width,t[r++]=e._height,t[r++]=e._extrudedHeight,t[r++]=e._cornerType,t[r]=e._granularity,t};var S=c.clone(c.UNIT_SPHERE),N={positions:void 0,ellipsoid:S,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0};return T.unpack=function(e,t,r){t=o(t,0);for(var a=e[t++],i=new Array(a),s=0;s<a;++s,t+=n.packedLength)i[s]=n.unpack(e,t);var l=c.unpack(e,t,S);t+=c.packedLength;var f=e[t++],h=e[t++],d=e[t++],E=e[t++],p=e[t];return u(r)?(r._positions=i,r._ellipsoid=c.clone(l,r._ellipsoid),r._width=f,r._height=h,r._extrudedHeight=d,r._cornerType=E,r._granularity=p,r):(N.positions=i,N.width=f,N.height=h,N.extrudedHeight=d,N.cornerType=E,N.granularity=p,new T(N))},T.createGeometry=function(r){var a=r._positions,o=r._height,u=r._width,s=r._extrudedHeight,c=o!==s,f=e(a,n.equalsEpsilon);if(!(f.length<2||u<=0)){var h,d=r._ellipsoid,E={ellipsoid:d,positions:f,width:u,cornerType:r._cornerType,granularity:r._granularity,saveAttributes:!1};if(c){var T=Math.max(o,s);s=Math.min(o,s),o=T,E.height=o,E.extrudedHeight=s,h=_(E)}else{var R=i.computePositions(E);h=m(R,E.cornerType),h.attributes.position.values=p.scaleToGeodeticHeight(h.attributes.position.values,o,d)}var A=h.attributes,v=t.fromVertices(A.position.values,void 0,3);return new l({attributes:A,indices:h.indices,primitiveType:y.LINES,boundingSphere:v})}},T}),define("Workers/createCorridorOutlineGeometry",["../Core/CorridorOutlineGeometry","../Core/defined","../Core/Ellipsoid"],function(e,t,n){"use strict";function r(r,a){return t(a)&&(r=e.unpack(r,a)),r._ellipsoid=n.clone(r._ellipsoid),e.createGeometry(r)}return r})}(); \ No newline at end of file diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createCylinderGeometry.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createCylinderGeometry.js index 615ce885..07867508 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createCylinderGeometry.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createCylinderGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,6 +55,6 @@ mersenne-twister.js - https://gist.github.com/banksean/300494 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -!function(){define("Core/defined",[],function(){"use strict";function t(t){return void 0!==t&&null!==t}return t}),define("Core/freezeObject",["./defined"],function(t){"use strict";var e=Object.freeze;return t(e)||(e=function(t){return t}),e}),define("Core/defaultValue",["./freezeObject"],function(t){"use strict";function e(t,e){return void 0!==t?t:e}return e.EMPTY_OBJECT=t({}),e}),define("Core/DeveloperError",["./defined"],function(t){"use strict";function e(t){this.name="DeveloperError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e.throwInstantiationError=function(){throw new e("This function defines an interface and should not be called directly.")},e}),define("Core/isArray",["./defined"],function(t){"use strict";var e=Array.isArray;return t(e)||(e=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),e}),define("Core/Check",["./defaultValue","./defined","./DeveloperError","./isArray"],function(t,e,n,r){"use strict";function i(t){return t+" was required but undefined."}function a(t,e,n){return"Expected "+n+" to be typeof "+e+", got "+t}var o={};return o.typeOf={},o.numeric={},o.defined=function(t,r){if(!e(t))throw new n(i(r))},o.numeric.maximum=function(t,e){if(o.typeOf.number(t),o.typeOf.number(e),t>e)throw new n("Expected "+t+" to be at most "+e)},o.numeric.minimum=function(t,e){if(o.typeOf.number(t),o.typeOf.number(e),t<e)throw new n("Expected "+t+" to be at least "+e)},o.typeOf.function=function(t,e){if("function"!=typeof t)throw new n(a(typeof t,"function",e))},o.typeOf.string=function(t,e){if("string"!=typeof t)throw new n(a(typeof t,"string",e))},o.typeOf.number=function(t,e){if("number"!=typeof t)throw new n(a(typeof t,"number",e))},o.typeOf.object=function(t,e){if("object"!=typeof t)throw new n(a(typeof t,"object",e))},o.typeOf.boolean=function(t,e){if("boolean"!=typeof t)throw new n(a(typeof t,"boolean",e))},o}),define("ThirdParty/mersenne-twister",[],function(){var t=function(t){void 0==t&&(t=(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(t)};return t.prototype.init_genrand=function(t){for(this.mt[0]=t>>>0,this.mti=1;this.mti<this.N;this.mti++){var t=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&t)>>>16)<<16)+1812433253*(65535&t)+this.mti,this.mt[this.mti]>>>=0}},t.prototype.genrand_int32=function(){var t,e=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)t=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^t>>>1^e[1&t];for(;n<this.N-1;n++)t=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^t>>>1^e[1&t];t=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^t>>>1^e[1&t],this.mti=0}return t=this.mt[this.mti++],t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,t^=t>>>18,t>>>0},t.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},t}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(t,e,n,r){"use strict";var i={};i.EPSILON1=.1,i.EPSILON2=.01,i.EPSILON3=.001,i.EPSILON4=1e-4,i.EPSILON5=1e-5,i.EPSILON6=1e-6,i.EPSILON7=1e-7,i.EPSILON8=1e-8,i.EPSILON9=1e-9,i.EPSILON10=1e-10,i.EPSILON11=1e-11,i.EPSILON12=1e-12,i.EPSILON13=1e-13,i.EPSILON14=1e-14,i.EPSILON15=1e-15,i.EPSILON16=1e-16,i.EPSILON17=1e-17,i.EPSILON18=1e-18,i.EPSILON19=1e-19,i.EPSILON20=1e-20,i.GRAVITATIONALPARAMETER=3986004418e5,i.SOLAR_RADIUS=6955e5,i.LUNAR_RADIUS=1737400,i.SIXTY_FOUR_KILOBYTES=65536,i.sign=function(t){return t>0?1:t<0?-1:0},i.signNotZero=function(t){return t<0?-1:1},i.toSNorm=function(t,n){return n=e(n,255),Math.round((.5*i.clamp(t,-1,1)+.5)*n)},i.fromSNorm=function(t,n){return n=e(n,255),i.clamp(t,0,n)/n*2-1},i.sinh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e-n)},i.cosh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e+n)},i.lerp=function(t,e,n){return(1-n)*t+n*e},i.PI=Math.PI,i.ONE_OVER_PI=1/Math.PI,i.PI_OVER_TWO=.5*Math.PI,i.PI_OVER_THREE=Math.PI/3,i.PI_OVER_FOUR=Math.PI/4,i.PI_OVER_SIX=Math.PI/6,i.THREE_PI_OVER_TWO=3*Math.PI*.5,i.TWO_PI=2*Math.PI,i.ONE_OVER_TWO_PI=1/(2*Math.PI),i.RADIANS_PER_DEGREE=Math.PI/180,i.DEGREES_PER_RADIAN=180/Math.PI,i.RADIANS_PER_ARCSECOND=i.RADIANS_PER_DEGREE/3600,i.toRadians=function(t){return t*i.RADIANS_PER_DEGREE},i.toDegrees=function(t){return t*i.DEGREES_PER_RADIAN},i.convertLongitudeRange=function(t){var e=i.TWO_PI,n=t-Math.floor(t/e)*e;return n<-Math.PI?n+e:n>=Math.PI?n-e:n},i.clampToLatitudeRange=function(t){return i.clamp(t,-1*i.PI_OVER_TWO,i.PI_OVER_TWO)},i.negativePiToPi=function(t){return i.zeroToTwoPi(t+i.PI)-i.PI},i.zeroToTwoPi=function(t){var e=i.mod(t,i.TWO_PI);return Math.abs(e)<i.EPSILON14&&Math.abs(t)>i.EPSILON14?i.TWO_PI:e},i.mod=function(t,e){return(t%e+e)%e},i.equalsEpsilon=function(t,n,r,i){i=e(i,r);var a=Math.abs(t-n);return a<=i||a<=r*Math.max(Math.abs(t),Math.abs(n))};var a=[1];i.factorial=function(t){var e=a.length;if(t>=e)for(var n=a[e-1],r=e;r<=t;r++)a.push(n*r);return a[t]},i.incrementWrap=function(t,n,r){return r=e(r,0),++t,t>n&&(t=r),t},i.isPowerOfTwo=function(t){return 0!==t&&0===(t&t-1)},i.nextPowerOfTwo=function(t){return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t,t},i.clamp=function(t,e,n){return t<e?e:t>n?n:t};var o=new t;return i.setRandomNumberSeed=function(e){o=new t(e)},i.nextRandomNumber=function(){return o.random()},i.acosClamped=function(t){return Math.acos(i.clamp(t,-1,1))},i.asinClamped=function(t){return Math.asin(i.clamp(t,-1,1))},i.chordLength=function(t,e){return 2*e*Math.sin(.5*t)},i.logBase=function(t,e){return Math.log(t)/Math.log(e)},i.fog=function(t,e){var n=t*e;return 1-Math.exp(-(n*n))},i}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a){"use strict";function o(t,n,r){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0)}o.fromSpherical=function(t,r){n(r)||(r=new o);var i=t.clock,a=t.cone,u=e(t.magnitude,1),E=u*Math.sin(a);return r.x=E*Math.cos(i),r.y=E*Math.sin(i),r.z=u*Math.cos(a),r},o.fromElements=function(t,e,r,i){return n(i)?(i.x=t,i.y=e,i.z=r,i):new o(t,e,r)},o.clone=function(t,e){if(n(t))return n(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e):new o(t.x,t.y,t.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r]=t.z,n},o.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new o),i.x=t[r++],i.y=t[r++],i.z=t[r],i},o.packArray=function(t,e){var r=t.length;n(e)?e.length=3*r:e=new Array(3*r);for(var i=0;i<r;++i)o.pack(t[i],e,3*i);return e},o.unpackArray=function(t,e){var r=t.length;n(e)?e.length=r/3:e=new Array(r/3);for(var i=0;i<r;i+=3){var a=i/3;e[a]=o.unpack(t,i,e[a])}return e},o.fromArray=o.unpack,o.maximumComponent=function(t){return Math.max(t.x,t.y,t.z)},o.minimumComponent=function(t){return Math.min(t.x,t.y,t.z)},o.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n.z=Math.min(t.z,e.z),n},o.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n.z=Math.max(t.z,e.z),n},o.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z},o.magnitude=function(t){return Math.sqrt(o.magnitudeSquared(t))};var u=new o;o.distance=function(t,e){return o.subtract(t,e,u),o.magnitude(u)},o.distanceSquared=function(t,e){return o.subtract(t,e,u),o.magnitudeSquared(u)},o.normalize=function(t,e){var n=o.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e},o.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},o.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n.z=t.z*e.z,n},o.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n.z=t.z/e.z,n},o.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n},o.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n},o.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*e,n},o.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n},o.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e},o.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e};var E=new o;o.lerp=function(t,e,n,r){return o.multiplyByScalar(e,n,E),r=o.multiplyByScalar(t,1-n,r),o.add(E,r,r)};var s=new o,c=new o;o.angleBetween=function(t,e){o.normalize(t,s),o.normalize(e,c);var n=o.dot(s,c),r=o.magnitude(o.cross(s,c,s));return Math.atan2(r,n)};var _=new o;o.mostOrthogonalAxis=function(t,e){var n=o.normalize(t,_);return o.abs(n,n),e=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,e):o.clone(o.UNIT_Z,e):n.y<=n.z?o.clone(o.UNIT_Y,e):o.clone(o.UNIT_Z,e)},o.equals=function(t,e){return t===e||n(t)&&n(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z},o.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]},o.equalsEpsilon=function(t,e,r,i){return t===e||n(t)&&n(e)&&a.equalsEpsilon(t.x,e.x,r,i)&&a.equalsEpsilon(t.y,e.y,r,i)&&a.equalsEpsilon(t.z,e.z,r,i)},o.cross=function(t,e,n){var r=t.x,i=t.y,a=t.z,o=e.x,u=e.y,E=e.z,s=i*E-a*u,c=a*o-r*E,_=r*u-i*o;return n.x=s,n.y=c,n.z=_,n},o.fromDegrees=function(t,e,n,r,i){return t=a.toRadians(t),e=a.toRadians(e),o.fromRadians(t,e,n,r,i)};var T=new o,l=new o,R=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(t,r,i,a,u){i=e(i,0);var E=n(a)?a.radiiSquared:R,s=Math.cos(r);T.x=s*Math.cos(t),T.y=s*Math.sin(t),T.z=Math.sin(r),T=o.normalize(T,T),o.multiplyComponents(E,T,l);var c=Math.sqrt(o.dot(T,l));return l=o.divideByScalar(l,c,l),T=o.multiplyByScalar(T,i,T),n(u)||(u=new o),o.add(l,T,u)},o.fromDegreesArray=function(t,e,r){var i=t.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=t[a],E=t[a+1],s=a/2;r[s]=o.fromDegrees(u,E,0,e,r[s])}return r},o.fromRadiansArray=function(t,e,r){var i=t.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=t[a],E=t[a+1],s=a/2;r[s]=o.fromRadians(u,E,0,e,r[s])}return r},o.fromDegreesArrayHeights=function(t,e,r){var i=t.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=t[a],E=t[a+1],s=t[a+2],c=a/3;r[c]=o.fromDegrees(u,E,s,e,r[c])}return r},o.fromRadiansArrayHeights=function(t,e,r){var i=t.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=t[a],E=t[a+1],s=t[a+2],c=a/3;r[c]=o.fromRadians(u,E,s,e,r[c])}return r},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(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.prototype.equalsEpsilon=function(t,e,n){return o.equalsEpsilon(this,t,e,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(t,e,n,r){"use strict";function i(n,i,u,E,s){var c=n.x,_=n.y,T=n.z,l=i.x,R=i.y,f=i.z,A=c*c*l*l,h=_*_*R*R,N=T*T*f*f,d=A+h+N,I=Math.sqrt(1/d),S=t.multiplyByScalar(n,I,a);if(d<E)return isFinite(I)?t.clone(S,s):void 0;var m=u.x,M=u.y,y=u.z,O=o;O.x=S.x*m*2,O.y=S.y*M*2,O.z=S.z*y*2;var p,C,U,L,F,P,v,g,x,w,D,B=(1-I)*t.magnitude(n)/(.5*t.magnitude(O)),z=0;do{B-=z,U=1/(1+B*m),L=1/(1+B*M),F=1/(1+B*y),P=U*U,v=L*L,g=F*F,x=P*U,w=v*L,D=g*F,p=A*P+h*v+N*g-1,C=A*x*m+h*w*M+N*D*y;var G=-2*C;z=p/G}while(Math.abs(p)>r.EPSILON12);return e(s)?(s.x=c*U,s.y=_*L,s.z=T*F,s):new t(c*U,_*L,T*F)}var a=new t,o=new t;return i}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,n,r,i,a,o){"use strict";function u(t,n,r){this.longitude=e(t,0),this.latitude=e(n,0),this.height=e(r,0)}u.fromRadians=function(t,r,i,a){return i=e(i,0),n(a)?(a.longitude=t,a.latitude=r,a.height=i,a):new u(t,r,i)},u.fromDegrees=function(t,e,n,r){return t=a.toRadians(t),e=a.toRadians(e),u.fromRadians(t,e,n,r)};var E=new t,s=new t,c=new t,_=new t(1/6378137,1/6378137,1/6356752.314245179),T=new t(1/40680631590769,1/40680631590769,1/40408299984661.445),l=a.EPSILON1;return u.fromCartesian=function(e,r,i){var R=n(r)?r.oneOverRadii:_,f=n(r)?r.oneOverRadiiSquared:T,A=n(r)?r._centerToleranceSquared:l,h=o(e,R,f,A,s);if(n(h)){var N=t.multiplyComponents(h,f,E);N=t.normalize(N,N);var d=t.subtract(e,h,c),I=Math.atan2(N.y,N.x),S=Math.asin(N.z),m=a.sign(t.dot(d,e))*t.magnitude(d);return n(i)?(i.longitude=I,i.latitude=S,i.height=m,i):new u(I,S,m)}},u.clone=function(t,e){if(n(t))return n(e)?(e.longitude=t.longitude,e.latitude=t.latitude,e.height=t.height,e):new u(t.longitude,t.latitude,t.height)},u.equals=function(t,e){return t===e||n(t)&&n(e)&&t.longitude===e.longitude&&t.latitude===e.latitude&&t.height===e.height},u.equalsEpsilon=function(t,e,r){return t===e||n(t)&&n(e)&&Math.abs(t.longitude-e.longitude)<=r&&Math.abs(t.latitude-e.latitude)<=r&&Math.abs(t.height-e.height)<=r},u.ZERO=i(new u(0,0,0)),u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.prototype.equalsEpsilon=function(t,e){return u.equalsEpsilon(this,t,e)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(t){"use strict";var e=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(t){return!1}}(),n=Object.defineProperties;return e&&t(n)||(n=function(t){return t}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,n,r,i,a,o,u,E){"use strict";function s(e,r,i,a){r=n(r,0),i=n(i,0),a=n(a,0),e._radii=new t(r,i,a),e._radiiSquared=new t(r*r,i*i,a*a),e._radiiToTheFourth=new t(r*r*r*r,i*i*i*i,a*a*a*a),e._oneOverRadii=new t(0===r?0:1/r,0===i?0:1/i,0===a?0:1/a),e._oneOverRadiiSquared=new t(0===r?0:1/(r*r),0===i?0:1/(i*i),0===a?0:1/(a*a)),e._minimumRadius=Math.min(r,i,a),e._maximumRadius=Math.max(r,i,a),e._centerToleranceSquared=u.EPSILON1,0!==e._radiiSquared.z&&(e._sqauredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function c(t,e,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,s(this,t,e,n)}i(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(e,n){if(r(e)){var i=e._radii;return r(n)?(t.clone(i,n._radii),t.clone(e._radiiSquared,n._radiiSquared),t.clone(e._radiiToTheFourth,n._radiiToTheFourth),t.clone(e._oneOverRadii,n._oneOverRadii),t.clone(e._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=e._minimumRadius,n._maximumRadius=e._maximumRadius,n._centerToleranceSquared=e._centerToleranceSquared,n):new c(i.x,i.y,i.z)}},c.fromCartesian3=function(t,e){return r(e)||(e=new c),r(t)?(s(e,t.x,t.y,t.z),e):e},c.WGS84=o(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=o(new c(1,1,1)),c.MOON=o(new c(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),c.prototype.clone=function(t){return c.clone(this,t)},c.packedLength=t.packedLength,c.pack=function(e,r,i){return i=n(i,0),t.pack(e._radii,r,i),r},c.unpack=function(e,r,i){r=n(r,0);var a=t.unpack(e,r);return c.fromCartesian3(a,i)},c.prototype.geocentricSurfaceNormal=t.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(e,n){var i=e.longitude,a=e.latitude,o=Math.cos(a),u=o*Math.cos(i),E=o*Math.sin(i),s=Math.sin(a);return r(n)||(n=new t),n.x=u,n.y=E,n.z=s,t.normalize(n,n)},c.prototype.geodeticSurfaceNormal=function(e,n){return r(n)||(n=new t),n=t.multiplyComponents(e,this._oneOverRadiiSquared,n),t.normalize(n,n)};var _=new t,T=new t;c.prototype.cartographicToCartesian=function(e,n){var i=_,a=T;this.geodeticSurfaceNormalCartographic(e,i),t.multiplyComponents(this._radiiSquared,i,a);var o=Math.sqrt(t.dot(i,a));return t.divideByScalar(a,o,a),t.multiplyByScalar(i,e.height,i),r(n)||(n=new t),t.add(a,i,n)},c.prototype.cartographicArrayToCartesianArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var i=0;i<n;i++)e[i]=this.cartographicToCartesian(t[i],e[i]);return e};var l=new t,R=new t,f=new t;return c.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,R);if(r(a)){var o=this.geodeticSurfaceNormal(a,l),E=t.subtract(n,a,f),s=Math.atan2(o.y,o.x),c=Math.asin(o.z),_=u.sign(t.dot(E,n))*t.magnitude(E);return r(i)?(i.longitude=s,i.latitude=c,i.height=_,i):new e(s,c,_)}},c.prototype.cartesianArrayToCartographicArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var i=0;i<n;++i)e[i]=this.cartesianToCartographic(t[i],e[i]);return e},c.prototype.scaleToGeodeticSurface=function(t,e){return E(t,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,e)},c.prototype.scaleToGeocentricSurface=function(e,n){r(n)||(n=new t);var i=e.x,a=e.y,o=e.z,u=this._oneOverRadiiSquared,E=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*u.z);return t.multiplyByScalar(e,E,n)},c.prototype.transformPositionToScaledSpace=function(e,n){return r(n)||(n=new t),t.multiplyComponents(e,this._oneOverRadii,n)},c.prototype.transformPositionFromScaledSpace=function(e,n){return r(n)||(n=new t),t.multiplyComponents(e,this._radii,n)},c.prototype.equals=function(e){return this===e||r(e)&&t.equals(this._radii,e._radii)},c.prototype.toString=function(){return this._radii.toString()},c.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,i,a){i=n(i,0);var o=this._sqauredXOverSquaredZ;if(r(a)||(a=new t),a.x=0,a.y=0,a.z=e.z*(1-o),!(Math.abs(a.z)>=this._radii.z-i))return a},c}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(t,e,n,r,i,a,o){"use strict";function u(t){this._ellipsoid=n(t,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return i(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(e,n){var i=this._semimajorAxis,a=e.longitude*i,o=e.latitude*i,u=e.height;return r(n)?(n.x=a,n.y=o,n.z=u,n):new t(a,o,u)},u.prototype.unproject=function(t,n){var i=this._oneOverSemimajorAxis,a=t.x*i,o=t.y*i,u=t.z;return r(n)?(n.longitude=a,n.latitude=o,n.height=u,n):new e(a,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(t){"use strict";var e={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return t(e)}),define("Core/Interval",["./defaultValue"],function(t){"use strict";function e(e,n){this.start=t(e,0),this.stop=t(n,0)}return e}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a,o){"use strict";function u(t,n,r,i,a,o,u,E,s){this[0]=e(t,0),this[1]=e(i,0),this[2]=e(u,0),this[3]=e(n,0),this[4]=e(a,0),this[5]=e(E,0),this[6]=e(r,0),this[7]=e(o,0),this[8]=e(s,0)}function E(t){for(var e=0,n=0;n<9;++n){var r=t[n];e+=r*r}return Math.sqrt(e)}function s(t){for(var e=0,n=0;n<3;++n){var r=t[u.getElementIndex(R[n],l[n])];e+=2*r*r}return Math.sqrt(e)}function c(t,e){for(var n=o.EPSILON15,r=0,i=1,a=0;a<3;++a){var E=Math.abs(t[u.getElementIndex(R[a],l[a])]);E>r&&(i=a,r=E)}var s=1,c=0,_=l[i],T=R[i];if(Math.abs(t[u.getElementIndex(T,_)])>n){var f,A=t[u.getElementIndex(T,T)],h=t[u.getElementIndex(_,_)],N=t[u.getElementIndex(T,_)],d=(A-h)/2/N;f=d<0?-1/(-d+Math.sqrt(1+d*d)):1/(d+Math.sqrt(1+d*d)),s=1/Math.sqrt(1+f*f),c=f*s}return e=u.clone(u.IDENTITY,e),e[u.getElementIndex(_,_)]=e[u.getElementIndex(T,T)]=s,e[u.getElementIndex(T,_)]=c,e[u.getElementIndex(_,T)]=-c,e}u.packedLength=9,u.pack=function(t,n,r){return r=e(r,0),n[r++]=t[0],n[r++]=t[1],n[r++]=t[2],n[r++]=t[3],n[r++]=t[4],n[r++]=t[5],n[r++]=t[6],n[r++]=t[7],n[r++]=t[8],n},u.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new u),i[0]=t[r++],i[1]=t[r++],i[2]=t[r++],i[3]=t[r++],i[4]=t[r++],i[5]=t[r++],i[6]=t[r++],i[7]=t[r++],i[8]=t[r++],i},u.clone=function(t,e){if(n(t))return n(e)?(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):new u(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8])},u.fromArray=function(t,r,i){return r=e(r,0),n(i)||(i=new u),i[0]=t[r],i[1]=t[r+1],i[2]=t[r+2],i[3]=t[r+3],i[4]=t[r+4],i[5]=t[r+5],i[6]=t[r+6],i[7]=t[r+7],i[8]=t[r+8],i},u.fromColumnMajorArray=function(t,e){return u.clone(t,e)},u.fromRowMajorArray=function(t,e){return n(e)?(e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],e):new u(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},u.fromQuaternion=function(t,e){var r=t.x*t.x,i=t.x*t.y,a=t.x*t.z,o=t.x*t.w,E=t.y*t.y,s=t.y*t.z,c=t.y*t.w,_=t.z*t.z,T=t.z*t.w,l=t.w*t.w,R=r-E-_+l,f=2*(i-T),A=2*(a+c),h=2*(i+T),N=-r+E-_+l,d=2*(s-o),I=2*(a-c),S=2*(s+o),m=-r-E+_+l;return n(e)?(e[0]=R,e[1]=h,e[2]=I,e[3]=f,e[4]=N,e[5]=S,e[6]=A,e[7]=d,e[8]=m,e):new u(R,f,A,h,N,d,I,S,m)},u.fromHeadingPitchRoll=function(t,e){var r=Math.cos(-t.pitch),i=Math.cos(-t.heading),a=Math.cos(t.roll),o=Math.sin(-t.pitch),E=Math.sin(-t.heading),s=Math.sin(t.roll),c=r*i,_=-a*E+s*o*i,T=s*E+a*o*i,l=r*E,R=a*i+s*o*E,f=-o*a+a*o*E,A=-o,h=s*r,N=a*r;return n(e)?(e[0]=c,e[1]=l,e[2]=A,e[3]=_,e[4]=R,e[5]=h,e[6]=T,e[7]=f,e[8]=N,e):new u(c,_,T,l,R,f,A,h,N)},u.fromScale=function(t,e){return n(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=t.y,e[5]=0,e[6]=0,e[7]=0,e[8]=t.z,e):new u(t.x,0,0,0,t.y,0,0,0,t.z)},u.fromUniformScale=function(t,e){return n(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=t,e[5]=0,e[6]=0,e[7]=0,e[8]=t,e):new u(t,0,0,0,t,0,0,0,t)},u.fromCrossProduct=function(t,e){return n(e)?(e[0]=0,e[1]=t.z,e[2]=-t.y,e[3]=-t.z,e[4]=0,e[5]=t.x,e[6]=t.y,e[7]=-t.x,e[8]=0,e):new u(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},u.fromRotationX=function(t,e){var r=Math.cos(t),i=Math.sin(t);return n(e)?(e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=r,e[5]=i,e[6]=0,e[7]=-i,e[8]=r,e):new u(1,0,0,0,r,-i,0,i,r)},u.fromRotationY=function(t,e){var r=Math.cos(t),i=Math.sin(t);return n(e)?(e[0]=r,e[1]=0,e[2]=-i,e[3]=0,e[4]=1,e[5]=0,e[6]=i,e[7]=0,e[8]=r,e):new u(r,0,i,0,1,0,-i,0,r)},u.fromRotationZ=function(t,e){var r=Math.cos(t),i=Math.sin(t);return n(e)?(e[0]=r,e[1]=i,e[2]=0,e[3]=-i,e[4]=r,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e):new u(r,-i,0,i,r,0,0,0,1)},u.toArray=function(t,e){return n(e)?(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):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},u.getElementIndex=function(t,e){return 3*t+e},u.getColumn=function(t,e,n){var r=3*e,i=t[r],a=t[r+1],o=t[r+2];return n.x=i,n.y=a,n.z=o,n},u.setColumn=function(t,e,n,r){r=u.clone(t,r);var i=3*e;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},u.getRow=function(t,e,n){var r=t[e],i=t[e+3],a=t[e+6];return n.x=r,n.y=i,n.z=a,n},u.setRow=function(t,e,n,r){return r=u.clone(t,r),r[e]=n.x,r[e+3]=n.y,r[e+6]=n.z,r};var _=new t;u.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],_)),n.y=t.magnitude(t.fromElements(e[3],e[4],e[5],_)),n.z=t.magnitude(t.fromElements(e[6],e[7],e[8],_)),n};var T=new t;u.getMaximumScale=function(e){return u.getScale(e,T),t.maximumComponent(T)},u.multiply=function(t,e,n){var r=t[0]*e[0]+t[3]*e[1]+t[6]*e[2],i=t[1]*e[0]+t[4]*e[1]+t[7]*e[2],a=t[2]*e[0]+t[5]*e[1]+t[8]*e[2],o=t[0]*e[3]+t[3]*e[4]+t[6]*e[5],u=t[1]*e[3]+t[4]*e[4]+t[7]*e[5],E=t[2]*e[3]+t[5]*e[4]+t[8]*e[5],s=t[0]*e[6]+t[3]*e[7]+t[6]*e[8],c=t[1]*e[6]+t[4]*e[7]+t[7]*e[8],_=t[2]*e[6]+t[5]*e[7]+t[8]*e[8];return n[0]=r,n[1]=i,n[2]=a,n[3]=o,n[4]=u,n[5]=E,n[6]=s,n[7]=c,n[8]=_,n},u.add=function(t,e,n){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n[4]=t[4]+e[4],n[5]=t[5]+e[5],n[6]=t[6]+e[6],n[7]=t[7]+e[7],n[8]=t[8]+e[8],n},u.subtract=function(t,e,n){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n[4]=t[4]-e[4],n[5]=t[5]-e[5],n[6]=t[6]-e[6],n[7]=t[7]-e[7],n[8]=t[8]-e[8],n},u.multiplyByVector=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=t[0]*r+t[3]*i+t[6]*a,u=t[1]*r+t[4]*i+t[7]*a,E=t[2]*r+t[5]*i+t[8]*a;return n.x=o,n.y=u,n.z=E,n},u.multiplyByScalar=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n[4]=t[4]*e,n[5]=t[5]*e,n[6]=t[6]*e,n[7]=t[7]*e,n[8]=t[8]*e,n},u.multiplyByScale=function(t,e,n){return n[0]=t[0]*e.x,n[1]=t[1]*e.x,n[2]=t[2]*e.x,n[3]=t[3]*e.y,n[4]=t[4]*e.y,n[5]=t[5]*e.y,n[6]=t[6]*e.z,n[7]=t[7]*e.z,n[8]=t[8]*e.z,n},u.negate=function(t,e){return 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},u.transpose=function(t,e){var n=t[0],r=t[3],i=t[6],a=t[1],o=t[4],u=t[7],E=t[2],s=t[5],c=t[8];return e[0]=n,e[1]=r,e[2]=i,e[3]=a,e[4]=o,e[5]=u,e[6]=E,e[7]=s,e[8]=c,e};var l=[1,0,0],R=[2,2,1],f=new u,A=new u;return u.computeEigenDecomposition=function(t,e){var r=o.EPSILON20,i=10,a=0,_=0;n(e)||(e={});for(var T=e.unitary=u.clone(u.IDENTITY,e.unitary),l=e.diagonal=u.clone(t,e.diagonal),R=r*E(l);_<i&&s(l)>R;)c(l,f),u.transpose(f,A),u.multiply(l,f,l),u.multiply(A,l,l),u.multiply(T,f,T),++a>2&&(++_,a=0);return e},u.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e},u.determinant=function(t){var e=t[0],n=t[3],r=t[6],i=t[1],a=t[4],o=t[7],u=t[2],E=t[5],s=t[8];return e*(a*s-E*o)+i*(E*r-n*s)+u*(n*o-a*r)},u.inverse=function(t,e){var n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],E=t[5],s=t[6],c=t[7],_=t[8],T=u.determinant(t);e[0]=o*_-c*E,e[1]=c*i-r*_,e[2]=r*E-o*i,e[3]=s*E-a*_,e[4]=n*_-s*i,e[5]=a*i-n*E,e[6]=a*c-s*o,e[7]=s*r-n*c,e[8]=n*o-a*r;var l=1/T;return u.multiplyByScalar(e,l,e)},u.equals=function(t,e){return t===e||n(t)&&n(e)&&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]},u.equalsEpsilon=function(t,e,r){return t===e||n(t)&&n(e)&&Math.abs(t[0]-e[0])<=r&&Math.abs(t[1]-e[1])<=r&&Math.abs(t[2]-e[2])<=r&&Math.abs(t[3]-e[3])<=r&&Math.abs(t[4]-e[4])<=r&&Math.abs(t[5]-e[5])<=r&&Math.abs(t[6]-e[6])<=r&&Math.abs(t[7]-e[7])<=r&&Math.abs(t[8]-e[8])<=r},u.IDENTITY=a(new u(1,0,0,0,1,0,0,0,1)),u.ZERO=a(new u(0,0,0,0,0,0,0,0,0)),u.COLUMN0ROW0=0,u.COLUMN0ROW1=1,u.COLUMN0ROW2=2,u.COLUMN1ROW0=3,u.COLUMN1ROW1=4,u.COLUMN1ROW2=5,u.COLUMN2ROW0=6,u.COLUMN2ROW1=7,u.COLUMN2ROW2=8,r(u.prototype,{length:{get:function(){return u.packedLength}}}),u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]&&t[4]===e[n+4]&&t[5]===e[n+5]&&t[6]===e[n+6]&&t[7]===e[n+7]&&t[8]===e[n+8]},u.prototype.equalsEpsilon=function(t,e){return u.equalsEpsilon(this,t,e)},u.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},u}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i){"use strict";function a(e,n,r,i){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(i,0)}a.fromElements=function(t,n,r,i,o){return e(o)?(o.x=t,o.y=n,o.z=r,o.w=i,o):new a(t,n,r,i)},a.fromColor=function(t,n){return e(n)?(n.x=t.red,n.y=t.green,n.z=t.blue,n.w=t.alpha,n):new a(t.red,t.green,t.blue,t.alpha)},a.clone=function(t,n){if(e(t))return e(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n.w=t.w,n):new a(t.x,t.y,t.z,t.w)},a.packedLength=4,a.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},a.unpack=function(n,r,i){return r=t(r,0),e(i)||(i=new a),i.x=n[r++],i.y=n[r++],i.z=n[r++],i.w=n[r],i},a.packArray=function(t,n){var r=t.length;e(n)?n.length=4*r:n=new Array(4*r);for(var i=0;i<r;++i)a.pack(t[i],n,4*i);return n},a.unpackArray=function(t,n){var r=t.length;e(n)?n.length=r/4:n=new Array(r/4);for(var i=0;i<r;i+=4){var o=i/4;n[o]=a.unpack(t,i,n[o])}return n},a.fromArray=a.unpack,a.maximumComponent=function(t){return Math.max(t.x,t.y,t.z,t.w)},a.minimumComponent=function(t){return Math.min(t.x,t.y,t.z,t.w)},a.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n.z=Math.min(t.z,e.z),n.w=Math.min(t.w,e.w),n},a.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n.z=Math.max(t.z,e.z),n.w=Math.max(t.w,e.w),n},a.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w},a.magnitude=function(t){return Math.sqrt(a.magnitudeSquared(t))};var o=new a;a.distance=function(t,e){return a.subtract(t,e,o),a.magnitude(o)},a.distanceSquared=function(t,e){return a.subtract(t,e,o),a.magnitudeSquared(o)},a.normalize=function(t,e){var n=a.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e.w=t.w/n,e},a.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z+t.w*e.w},a.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n.z=t.z*e.z,n.w=t.w*e.w,n},a.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n.z=t.z/e.z,n.w=t.w/e.w,n},a.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n.w=t.w+e.w,n},a.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n.w=t.w-e.w,n},a.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*e,n.w=t.w*e,n},a.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n.w=t.w/e,n},a.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e.w=-t.w,e},a.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e.w=Math.abs(t.w),e};var u=new a;a.lerp=function(t,e,n,r){return a.multiplyByScalar(e,n,u),r=a.multiplyByScalar(t,1-n,r),a.add(u,r,r)};var E=new a;return a.mostOrthogonalAxis=function(t,e){var n=a.normalize(t,E);return a.abs(n,n),e=n.x<=n.y?n.x<=n.z?n.x<=n.w?a.clone(a.UNIT_X,e):a.clone(a.UNIT_W,e):n.z<=n.w?a.clone(a.UNIT_Z,e):a.clone(a.UNIT_W,e):n.y<=n.z?n.y<=n.w?a.clone(a.UNIT_Y,e):a.clone(a.UNIT_W,e):n.z<=n.w?a.clone(a.UNIT_Z,e):a.clone(a.UNIT_W,e)},a.equals=function(t,n){return t===n||e(t)&&e(n)&&t.x===n.x&&t.y===n.y&&t.z===n.z&&t.w===n.w},a.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]&&t.w===e[n+3]},a.equalsEpsilon=function(t,n,r,a){return t===n||e(t)&&e(n)&&i.equalsEpsilon(t.x,n.x,r,a)&&i.equalsEpsilon(t.y,n.y,r,a)&&i.equalsEpsilon(t.z,n.z,r,a)&&i.equalsEpsilon(t.w,n.w,r,a)},a.ZERO=r(new a(0,0,0,0)),a.UNIT_X=r(new a(1,0,0,0)),a.UNIT_Y=r(new a(0,1,0,0)),a.UNIT_Z=r(new a(0,0,1,0)),a.UNIT_W=r(new a(0,0,0,1)),a.prototype.clone=function(t){return a.clone(this,t)},a.prototype.equals=function(t){return a.equals(this,t)},a.prototype.equalsEpsilon=function(t,e,n){return a.equalsEpsilon(this,t,e,n)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},a}),define("Core/RuntimeError",["./defined"],function(t){"use strict";function e(t){this.name="RuntimeError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(t,e,n,r,i,a,o,u,E,s){"use strict";function c(t,e,r,i,a,o,u,E,s,c,_,T,l,R,f,A){this[0]=n(t,0),this[1]=n(a,0),this[2]=n(s,0),this[3]=n(l,0),this[4]=n(e,0), -this[5]=n(o,0),this[6]=n(c,0),this[7]=n(R,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(_,0),this[11]=n(f,0),this[12]=n(i,0),this[13]=n(E,0),this[14]=n(T,0),this[15]=n(A,0)}c.packedLength=16,c.pack=function(t,e,r){return r=n(r,0),e[r++]=t[0],e[r++]=t[1],e[r++]=t[2],e[r++]=t[3],e[r++]=t[4],e[r++]=t[5],e[r++]=t[6],e[r++]=t[7],e[r++]=t[8],e[r++]=t[9],e[r++]=t[10],e[r++]=t[11],e[r++]=t[12],e[r++]=t[13],e[r++]=t[14],e[r]=t[15],e},c.unpack=function(t,e,i){return e=n(e,0),r(i)||(i=new c),i[0]=t[e++],i[1]=t[e++],i[2]=t[e++],i[3]=t[e++],i[4]=t[e++],i[5]=t[e++],i[6]=t[e++],i[7]=t[e++],i[8]=t[e++],i[9]=t[e++],i[10]=t[e++],i[11]=t[e++],i[12]=t[e++],i[13]=t[e++],i[14]=t[e++],i[15]=t[e],i},c.clone=function(t,e){if(r(t))return r(e)?(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],e):new c(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15])},c.fromArray=c.unpack,c.fromColumnMajorArray=function(t,e){return c.clone(t,e)},c.fromRowMajorArray=function(t,e){return r(e)?(e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15],e):new c(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},c.fromRotationTranslation=function(e,i,a){return i=n(i,t.ZERO),r(a)?(a[0]=e[0],a[1]=e[1],a[2]=e[2],a[3]=0,a[4]=e[3],a[5]=e[4],a[6]=e[5],a[7]=0,a[8]=e[6],a[9]=e[7],a[10]=e[8],a[11]=0,a[12]=i.x,a[13]=i.y,a[14]=i.z,a[15]=1,a):new c(e[0],e[3],e[6],i.x,e[1],e[4],e[7],i.y,e[2],e[5],e[8],i.z,0,0,0,1)},c.fromTranslationQuaternionRotationScale=function(t,e,n,i){r(i)||(i=new c);var a=n.x,o=n.y,u=n.z,E=e.x*e.x,s=e.x*e.y,_=e.x*e.z,T=e.x*e.w,l=e.y*e.y,R=e.y*e.z,f=e.y*e.w,A=e.z*e.z,h=e.z*e.w,N=e.w*e.w,d=E-l-A+N,I=2*(s-h),S=2*(_+f),m=2*(s+h),M=-E+l-A+N,y=2*(R-T),O=2*(_-f),p=2*(R+T),C=-E-l+A+N;return i[0]=d*a,i[1]=m*a,i[2]=O*a,i[3]=0,i[4]=I*o,i[5]=M*o,i[6]=p*o,i[7]=0,i[8]=S*u,i[9]=y*u,i[10]=C*u,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,i},c.fromTranslationRotationScale=function(t,e){return c.fromTranslationQuaternionRotationScale(t.translation,t.rotation,t.scale,e)},c.fromTranslation=function(t,e){return c.fromRotationTranslation(E.IDENTITY,t,e)},c.fromScale=function(t,e){return r(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t.y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t.z,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new c(t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1)},c.fromUniformScale=function(t,e){return r(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new c(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1)};var _=new t,T=new t,l=new t;c.fromCamera=function(e,n){var i=e.position,a=e.direction,o=e.up;t.normalize(a,_),t.normalize(t.cross(_,o,T),T),t.normalize(t.cross(T,_,l),l);var u=T.x,E=T.y,s=T.z,R=_.x,f=_.y,A=_.z,h=l.x,N=l.y,d=l.z,I=i.x,S=i.y,m=i.z,M=u*-I+E*-S+s*-m,y=h*-I+N*-S+d*-m,O=R*I+f*S+A*m;return r(n)?(n[0]=u,n[1]=h,n[2]=-R,n[3]=0,n[4]=E,n[5]=N,n[6]=-f,n[7]=0,n[8]=s,n[9]=d,n[10]=-A,n[11]=0,n[12]=M,n[13]=y,n[14]=O,n[15]=1,n):new c(u,E,s,M,h,N,d,y,-R,-f,-A,O,0,0,0,1)},c.computePerspectiveFieldOfView=function(t,e,n,r,i){var a=Math.tan(.5*t),o=1/a,u=o/e,E=(r+n)/(n-r),s=2*r*n/(n-r);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=o,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=E,i[11]=-1,i[12]=0,i[13]=0,i[14]=s,i[15]=0,i},c.computeOrthographicOffCenter=function(t,e,n,r,i,a,o){var u=1/(e-t),E=1/(r-n),s=1/(a-i),c=-(e+t)*u,_=-(r+n)*E,T=-(a+i)*s;return u*=2,E*=2,s*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=s,o[11]=0,o[12]=c,o[13]=_,o[14]=T,o[15]=1,o},c.computePerspectiveOffCenter=function(t,e,n,r,i,a,o){var u=2*i/(e-t),E=2*i/(r-n),s=(e+t)/(e-t),c=(r+n)/(r-n),_=-(a+i)/(a-i),T=-1,l=-2*a*i/(a-i);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=s,o[9]=c,o[10]=_,o[11]=T,o[12]=0,o[13]=0,o[14]=l,o[15]=0,o},c.computeInfinitePerspectiveOffCenter=function(t,e,n,r,i,a){var o=2*i/(e-t),u=2*i/(r-n),E=(e+t)/(e-t),s=(r+n)/(r-n),c=-1,_=-1,T=-2*i;return a[0]=o,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=E,a[9]=s,a[10]=c,a[11]=_,a[12]=0,a[13]=0,a[14]=T,a[15]=0,a},c.computeViewportTransformation=function(t,e,r,i){t=n(t,n.EMPTY_OBJECT);var a=n(t.x,0),o=n(t.y,0),u=n(t.width,0),E=n(t.height,0);e=n(e,0),r=n(r,1);var s=.5*u,c=.5*E,_=.5*(r-e),T=s,l=c,R=_,f=a+s,A=o+c,h=e+_,N=1;return i[0]=T,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=l,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=R,i[11]=0,i[12]=f,i[13]=A,i[14]=h,i[15]=N,i},c.computeView=function(e,n,r,i,a){return a[0]=i.x,a[1]=r.x,a[2]=-n.x,a[3]=0,a[4]=i.y,a[5]=r.y,a[6]=-n.y,a[7]=0,a[8]=i.z,a[9]=r.z,a[10]=-n.z,a[11]=0,a[12]=-t.dot(i,e),a[13]=-t.dot(r,e),a[14]=t.dot(n,e),a[15]=1,a},c.toArray=function(t,e){return r(e)?(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],e):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]},c.getElementIndex=function(t,e){return 4*t+e},c.getColumn=function(t,e,n){var r=4*e,i=t[r],a=t[r+1],o=t[r+2],u=t[r+3];return n.x=i,n.y=a,n.z=o,n.w=u,n},c.setColumn=function(t,e,n,r){r=c.clone(t,r);var i=4*e;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r[i+3]=n.w,r},c.setTranslation=function(t,e,n){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=t[15],n},c.getRow=function(t,e,n){var r=t[e],i=t[e+4],a=t[e+8],o=t[e+12];return n.x=r,n.y=i,n.z=a,n.w=o,n},c.setRow=function(t,e,n,r){return r=c.clone(t,r),r[e]=n.x,r[e+4]=n.y,r[e+8]=n.z,r[e+12]=n.w,r};var R=new t;c.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],R)),n.y=t.magnitude(t.fromElements(e[4],e[5],e[6],R)),n.z=t.magnitude(t.fromElements(e[8],e[9],e[10],R)),n};var f=new t;c.getMaximumScale=function(e){return c.getScale(e,f),t.maximumComponent(f)},c.multiply=function(t,e,n){var r=t[0],i=t[1],a=t[2],o=t[3],u=t[4],E=t[5],s=t[6],c=t[7],_=t[8],T=t[9],l=t[10],R=t[11],f=t[12],A=t[13],h=t[14],N=t[15],d=e[0],I=e[1],S=e[2],m=e[3],M=e[4],y=e[5],O=e[6],p=e[7],C=e[8],U=e[9],L=e[10],F=e[11],P=e[12],v=e[13],g=e[14],x=e[15],w=r*d+u*I+_*S+f*m,D=i*d+E*I+T*S+A*m,B=a*d+s*I+l*S+h*m,z=o*d+c*I+R*S+N*m,G=r*M+u*y+_*O+f*p,b=i*M+E*y+T*O+A*p,X=a*M+s*y+l*O+h*p,V=o*M+c*y+R*O+N*p,q=r*C+u*U+_*L+f*F,H=i*C+E*U+T*L+A*F,W=a*C+s*U+l*L+h*F,Y=o*C+c*U+R*L+N*F,K=r*P+u*v+_*g+f*x,k=i*P+E*v+T*g+A*x,Z=a*P+s*v+l*g+h*x,j=o*P+c*v+R*g+N*x;return n[0]=w,n[1]=D,n[2]=B,n[3]=z,n[4]=G,n[5]=b,n[6]=X,n[7]=V,n[8]=q,n[9]=H,n[10]=W,n[11]=Y,n[12]=K,n[13]=k,n[14]=Z,n[15]=j,n},c.add=function(t,e,n){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n[4]=t[4]+e[4],n[5]=t[5]+e[5],n[6]=t[6]+e[6],n[7]=t[7]+e[7],n[8]=t[8]+e[8],n[9]=t[9]+e[9],n[10]=t[10]+e[10],n[11]=t[11]+e[11],n[12]=t[12]+e[12],n[13]=t[13]+e[13],n[14]=t[14]+e[14],n[15]=t[15]+e[15],n},c.subtract=function(t,e,n){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n[4]=t[4]-e[4],n[5]=t[5]-e[5],n[6]=t[6]-e[6],n[7]=t[7]-e[7],n[8]=t[8]-e[8],n[9]=t[9]-e[9],n[10]=t[10]-e[10],n[11]=t[11]-e[11],n[12]=t[12]-e[12],n[13]=t[13]-e[13],n[14]=t[14]-e[14],n[15]=t[15]-e[15],n},c.multiplyTransformation=function(t,e,n){var r=t[0],i=t[1],a=t[2],o=t[4],u=t[5],E=t[6],s=t[8],c=t[9],_=t[10],T=t[12],l=t[13],R=t[14],f=e[0],A=e[1],h=e[2],N=e[4],d=e[5],I=e[6],S=e[8],m=e[9],M=e[10],y=e[12],O=e[13],p=e[14],C=r*f+o*A+s*h,U=i*f+u*A+c*h,L=a*f+E*A+_*h,F=r*N+o*d+s*I,P=i*N+u*d+c*I,v=a*N+E*d+_*I,g=r*S+o*m+s*M,x=i*S+u*m+c*M,w=a*S+E*m+_*M,D=r*y+o*O+s*p+T,B=i*y+u*O+c*p+l,z=a*y+E*O+_*p+R;return n[0]=C,n[1]=U,n[2]=L,n[3]=0,n[4]=F,n[5]=P,n[6]=v,n[7]=0,n[8]=g,n[9]=x,n[10]=w,n[11]=0,n[12]=D,n[13]=B,n[14]=z,n[15]=1,n},c.multiplyByMatrix3=function(t,e,n){var r=t[0],i=t[1],a=t[2],o=t[4],u=t[5],E=t[6],s=t[8],c=t[9],_=t[10],T=e[0],l=e[1],R=e[2],f=e[3],A=e[4],h=e[5],N=e[6],d=e[7],I=e[8],S=r*T+o*l+s*R,m=i*T+u*l+c*R,M=a*T+E*l+_*R,y=r*f+o*A+s*h,O=i*f+u*A+c*h,p=a*f+E*A+_*h,C=r*N+o*d+s*I,U=i*N+u*d+c*I,L=a*N+E*d+_*I;return n[0]=S,n[1]=m,n[2]=M,n[3]=0,n[4]=y,n[5]=O,n[6]=p,n[7]=0,n[8]=C,n[9]=U,n[10]=L,n[11]=0,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n},c.multiplyByTranslation=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=r*t[0]+i*t[4]+a*t[8]+t[12],u=r*t[1]+i*t[5]+a*t[9]+t[13],E=r*t[2]+i*t[6]+a*t[10]+t[14];return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=o,n[13]=u,n[14]=E,n[15]=t[15],n};var A=new t;c.multiplyByUniformScale=function(t,e,n){return A.x=e,A.y=e,A.z=e,c.multiplyByScale(t,A,n)},c.multiplyByScale=function(t,e,n){var r=e.x,i=e.y,a=e.z;return 1===r&&1===i&&1===a?c.clone(t,n):(n[0]=r*t[0],n[1]=r*t[1],n[2]=r*t[2],n[3]=0,n[4]=i*t[4],n[5]=i*t[5],n[6]=i*t[6],n[7]=0,n[8]=a*t[8],n[9]=a*t[9],n[10]=a*t[10],n[11]=0,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=1,n)},c.multiplyByVector=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=e.w,u=t[0]*r+t[4]*i+t[8]*a+t[12]*o,E=t[1]*r+t[5]*i+t[9]*a+t[13]*o,s=t[2]*r+t[6]*i+t[10]*a+t[14]*o,c=t[3]*r+t[7]*i+t[11]*a+t[15]*o;return n.x=u,n.y=E,n.z=s,n.w=c,n},c.multiplyByPointAsVector=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=t[0]*r+t[4]*i+t[8]*a,u=t[1]*r+t[5]*i+t[9]*a,E=t[2]*r+t[6]*i+t[10]*a;return n.x=o,n.y=u,n.z=E,n},c.multiplyByPoint=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=t[0]*r+t[4]*i+t[8]*a+t[12],u=t[1]*r+t[5]*i+t[9]*a+t[13],E=t[2]*r+t[6]*i+t[10]*a+t[14];return n.x=o,n.y=u,n.z=E,n},c.multiplyByScalar=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n[4]=t[4]*e,n[5]=t[5]*e,n[6]=t[6]*e,n[7]=t[7]*e,n[8]=t[8]*e,n[9]=t[9]*e,n[10]=t[10]*e,n[11]=t[11]*e,n[12]=t[12]*e,n[13]=t[13]*e,n[14]=t[14]*e,n[15]=t[15]*e,n},c.negate=function(t,e){return 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],e},c.transpose=function(t,e){var n=t[1],r=t[2],i=t[3],a=t[6],o=t[7],u=t[11];return e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=r,e[9]=a,e[10]=t[10],e[11]=t[14],e[12]=i,e[13]=o,e[14]=u,e[15]=t[15],e},c.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e[9]=Math.abs(t[9]),e[10]=Math.abs(t[10]),e[11]=Math.abs(t[11]),e[12]=Math.abs(t[12]),e[13]=Math.abs(t[13]),e[14]=Math.abs(t[14]),e[15]=Math.abs(t[15]),e},c.equals=function(t,e){return t===e||r(t)&&r(e)&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[3]===e[3]&&t[7]===e[7]&&t[11]===e[11]&&t[15]===e[15]},c.equalsEpsilon=function(t,e,n){return t===e||r(t)&&r(e)&&Math.abs(t[0]-e[0])<=n&&Math.abs(t[1]-e[1])<=n&&Math.abs(t[2]-e[2])<=n&&Math.abs(t[3]-e[3])<=n&&Math.abs(t[4]-e[4])<=n&&Math.abs(t[5]-e[5])<=n&&Math.abs(t[6]-e[6])<=n&&Math.abs(t[7]-e[7])<=n&&Math.abs(t[8]-e[8])<=n&&Math.abs(t[9]-e[9])<=n&&Math.abs(t[10]-e[10])<=n&&Math.abs(t[11]-e[11])<=n&&Math.abs(t[12]-e[12])<=n&&Math.abs(t[13]-e[13])<=n&&Math.abs(t[14]-e[14])<=n&&Math.abs(t[15]-e[15])<=n},c.getTranslation=function(t,e){return e.x=t[12],e.y=t[13],e.z=t[14],e},c.getRotation=function(t,e){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e};var h=new E,N=new E,d=new e,I=new e(0,0,0,1);return c.inverse=function(t,n){if(E.equalsEpsilon(c.getRotation(t,h),N,u.EPSILON7)&&e.equals(c.getRow(t,3,d),I))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-t[12],n[13]=-t[13],n[14]=-t[14],n[15]=1,n;var r=t[0],i=t[4],a=t[8],o=t[12],_=t[1],T=t[5],l=t[9],R=t[13],f=t[2],A=t[6],S=t[10],m=t[14],M=t[3],y=t[7],O=t[11],p=t[15],C=S*p,U=m*O,L=A*p,F=m*y,P=A*O,v=S*y,g=f*p,x=m*M,w=f*O,D=S*M,B=f*y,z=A*M,G=C*T+F*l+P*R-(U*T+L*l+v*R),b=U*_+g*l+D*R-(C*_+x*l+w*R),X=L*_+x*T+B*R-(F*_+g*T+z*R),V=v*_+w*T+z*l-(P*_+D*T+B*l),q=U*i+L*a+v*o-(C*i+F*a+P*o),H=C*r+x*a+w*o-(U*r+g*a+D*o),W=F*r+g*i+z*o-(L*r+x*i+B*o),Y=P*r+D*i+B*a-(v*r+w*i+z*a);C=a*R,U=o*l,L=i*R,F=o*T,P=i*l,v=a*T,g=r*R,x=o*_,w=r*l,D=a*_,B=r*T,z=i*_;var K=C*y+F*O+P*p-(U*y+L*O+v*p),k=U*M+g*O+D*p-(C*M+x*O+w*p),Z=L*M+x*y+B*p-(F*M+g*y+z*p),j=v*M+w*y+z*O-(P*M+D*y+B*O),Q=L*S+v*m+U*A-(P*m+C*A+F*S),J=w*m+C*f+x*S-(g*S+D*m+U*f),$=g*A+z*m+F*f-(B*m+L*f+x*A),tt=B*S+P*f+D*A-(w*A+z*S+v*f),et=r*G+i*b+a*X+o*V;if(Math.abs(et)<u.EPSILON20)throw new s("matrix is not invertible because its determinate is zero.");return et=1/et,n[0]=G*et,n[1]=b*et,n[2]=X*et,n[3]=V*et,n[4]=q*et,n[5]=H*et,n[6]=W*et,n[7]=Y*et,n[8]=K*et,n[9]=k*et,n[10]=Z*et,n[11]=j*et,n[12]=Q*et,n[13]=J*et,n[14]=$*et,n[15]=tt*et,n},c.inverseTransformation=function(t,e){var n=t[0],r=t[1],i=t[2],a=t[4],o=t[5],u=t[6],E=t[8],s=t[9],c=t[10],_=t[12],T=t[13],l=t[14],R=-n*_-r*T-i*l,f=-a*_-o*T-u*l,A=-E*_-s*T-c*l;return e[0]=n,e[1]=a,e[2]=E,e[3]=0,e[4]=r,e[5]=o,e[6]=s,e[7]=0,e[8]=i,e[9]=u,e[10]=c,e[11]=0,e[12]=R,e[13]=f,e[14]=A,e[15]=1,e},c.IDENTITY=o(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),c.ZERO=o(new c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN0ROW3=3,c.COLUMN1ROW0=4,c.COLUMN1ROW1=5,c.COLUMN1ROW2=6,c.COLUMN1ROW3=7,c.COLUMN2ROW0=8,c.COLUMN2ROW1=9,c.COLUMN2ROW2=10,c.COLUMN2ROW3=11,c.COLUMN3ROW0=12,c.COLUMN3ROW1=13,c.COLUMN3ROW2=14,c.COLUMN3ROW3=15,i(c.prototype,{length:{get:function(){return c.packedLength}}}),c.prototype.clone=function(t){return c.clone(this,t)},c.prototype.equals=function(t){return c.equals(this,t)},c.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]&&t[4]===e[n+4]&&t[5]===e[n+5]&&t[6]===e[n+6]&&t[7]===e[n+7]&&t[8]===e[n+8]&&t[9]===e[n+9]&&t[10]===e[n+10]&&t[11]===e[n+11]&&t[12]===e[n+12]&&t[13]===e[n+13]&&t[14]===e[n+14]&&t[15]===e[n+15]},c.prototype.equalsEpsilon=function(t,e){return c.equalsEpsilon(this,t,e)},c.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]+")"},c}),define("Core/Rectangle",["./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(t,e,n,r,i,a,o,u){"use strict";function E(t,n,r,i){this.west=e(t,0),this.south=e(n,0),this.east=e(r,0),this.north=e(i,0)}r(E.prototype,{width:{get:function(){return E.computeWidth(this)}},height:{get:function(){return E.computeHeight(this)}}}),E.packedLength=4,E.pack=function(t,n,r){return r=e(r,0),n[r++]=t.west,n[r++]=t.south,n[r++]=t.east,n[r]=t.north,n},E.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new E),i.west=t[r++],i.south=t[r++],i.east=t[r++],i.north=t[r],i},E.computeWidth=function(t){var e=t.east,n=t.west;return e<n&&(e+=u.TWO_PI),e-n},E.computeHeight=function(t){return t.north-t.south},E.fromDegrees=function(t,r,i,a,o){return t=u.toRadians(e(t,0)),r=u.toRadians(e(r,0)),i=u.toRadians(e(i,0)),a=u.toRadians(e(a,0)),n(o)?(o.west=t,o.south=r,o.east=i,o.north=a,o):new E(t,r,i,a)},E.fromCartographicArray=function(t,e){for(var r=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=Number.MAX_VALUE,c=-Number.MAX_VALUE,_=0,T=t.length;_<T;_++){var l=t[_];r=Math.min(r,l.longitude),i=Math.max(i,l.longitude),s=Math.min(s,l.latitude),c=Math.max(c,l.latitude);var R=l.longitude>=0?l.longitude:l.longitude+u.TWO_PI;a=Math.min(a,R),o=Math.max(o,R)}return i-r>o-a&&(r=a,i=o,i>u.PI&&(i-=u.TWO_PI),r>u.PI&&(r-=u.TWO_PI)),n(e)?(e.west=r,e.south=s,e.east=i,e.north=c,e):new E(r,s,i,c)},E.fromCartesianArray=function(t,e,r){for(var i=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,s=-Number.MAX_VALUE,c=Number.MAX_VALUE,_=-Number.MAX_VALUE,T=0,l=t.length;T<l;T++){var R=e.cartesianToCartographic(t[T]);i=Math.min(i,R.longitude),a=Math.max(a,R.longitude),c=Math.min(c,R.latitude),_=Math.max(_,R.latitude);var f=R.longitude>=0?R.longitude:R.longitude+u.TWO_PI;o=Math.min(o,f),s=Math.max(s,f)}return a-i>s-o&&(i=o,a=s,a>u.PI&&(a-=u.TWO_PI),i>u.PI&&(i-=u.TWO_PI)),n(r)?(r.west=i,r.south=c,r.east=a,r.north=_,r):new E(i,c,a,_)},E.clone=function(t,e){if(n(t))return n(e)?(e.west=t.west,e.south=t.south,e.east=t.east,e.north=t.north,e):new E(t.west,t.south,t.east,t.north)},E.prototype.clone=function(t){return E.clone(this,t)},E.prototype.equals=function(t){return E.equals(this,t)},E.equals=function(t,e){return t===e||n(t)&&n(e)&&t.west===e.west&&t.south===e.south&&t.east===e.east&&t.north===e.north},E.prototype.equalsEpsilon=function(t,e){return n(t)&&Math.abs(this.west-t.west)<=e&&Math.abs(this.south-t.south)<=e&&Math.abs(this.east-t.east)<=e&&Math.abs(this.north-t.north)<=e},E.validate=function(t){},E.southwest=function(e,r){return n(r)?(r.longitude=e.west,r.latitude=e.south,r.height=0,r):new t(e.west,e.south)},E.northwest=function(e,r){return n(r)?(r.longitude=e.west,r.latitude=e.north,r.height=0,r):new t(e.west,e.north)},E.northeast=function(e,r){return n(r)?(r.longitude=e.east,r.latitude=e.north,r.height=0,r):new t(e.east,e.north)},E.southeast=function(e,r){return n(r)?(r.longitude=e.east,r.latitude=e.south,r.height=0,r):new t(e.east,e.south)},E.center=function(e,r){var i=e.east,a=e.west;i<a&&(i+=u.TWO_PI);var o=u.negativePiToPi(.5*(a+i)),E=.5*(e.south+e.north);return n(r)?(r.longitude=o,r.latitude=E,r.height=0,r):new t(o,E)},E.intersection=function(t,e,r){var i=t.east,a=t.west,o=e.east,s=e.west;i<a&&o>0?i+=u.TWO_PI:o<s&&i>0&&(o+=u.TWO_PI),i<a&&s<0?s+=u.TWO_PI:o<s&&a<0&&(a+=u.TWO_PI);var c=u.negativePiToPi(Math.max(a,s)),_=u.negativePiToPi(Math.min(i,o));if(!((t.west<t.east||e.west<e.east)&&_<=c)){var T=Math.max(t.south,e.south),l=Math.min(t.north,e.north);if(!(T>=l))return n(r)?(r.west=c,r.south=T,r.east=_,r.north=l,r):new E(c,T,_,l)}},E.simpleIntersection=function(t,e,r){var i=Math.max(t.west,e.west),a=Math.max(t.south,e.south),o=Math.min(t.east,e.east),u=Math.min(t.north,e.north);if(!(a>=u||i>=o))return n(r)?(r.west=i,r.south=a,r.east=o,r.north=u,r):new E(i,a,o,u)},E.union=function(t,e,r){n(r)||(r=new E);var i=t.east,a=t.west,o=e.east,s=e.west;i<a&&o>0?i+=u.TWO_PI:o<s&&i>0&&(o+=u.TWO_PI),i<a&&s<0?s+=u.TWO_PI:o<s&&a<0&&(a+=u.TWO_PI);var c=u.convertLongitudeRange(Math.min(a,s)),_=u.convertLongitudeRange(Math.max(i,o));return r.west=c,r.south=Math.min(t.south,e.south),r.east=_,r.north=Math.max(t.north,e.north),r},E.expand=function(t,e,r){return n(r)||(r=new E),r.west=Math.min(t.west,e.longitude),r.south=Math.min(t.south,e.latitude),r.east=Math.max(t.east,e.longitude),r.north=Math.max(t.north,e.latitude),r},E.contains=function(t,e){var n=e.longitude,r=e.latitude,i=t.west,a=t.east;return a<i&&(a+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>i||u.equalsEpsilon(n,i,u.EPSILON14))&&(n<a||u.equalsEpsilon(n,a,u.EPSILON14))&&r>=t.south&&r<=t.north};var s=new t;return E.subsample=function(t,r,i,o){r=e(r,a.WGS84),i=e(i,0),n(o)||(o=[]);var c=0,_=t.north,T=t.south,l=t.east,R=t.west,f=s;f.height=i,f.longitude=R,f.latitude=_,o[c]=r.cartographicToCartesian(f,o[c]),c++,f.longitude=l,o[c]=r.cartographicToCartesian(f,o[c]),c++,f.latitude=T,o[c]=r.cartographicToCartesian(f,o[c]),c++,f.longitude=R,o[c]=r.cartographicToCartesian(f,o[c]),c++,_<0?f.latitude=_:T>0?f.latitude=T:f.latitude=0;for(var A=1;A<8;++A)f.longitude=-Math.PI+A*u.PI_OVER_TWO,E.contains(t,f)&&(o[c]=r.cartographicToCartesian(f,o[c]),c++);return 0===f.latitude&&(f.longitude=R,o[c]=r.cartographicToCartesian(f,o[c]),c++,f.longitude=l,o[c]=r.cartographicToCartesian(f,o[c]),c++),o.length=c,o},E.MAX_VALUE=o(new E(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),E}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(t,e,n,r,i,a,o,u,E,s,c,_){"use strict";function T(e,r){this.center=t.clone(n(e,t.ZERO)),this.radius=n(r,0)}var l=new t,R=new t,f=new t,A=new t,h=new t,N=new t,d=new t,I=new t,S=new t,m=new t,M=new t,y=new t;T.fromPoints=function(e,n){if(r(n)||(n=new T),!r(e)||0===e.length)return n.center=t.clone(t.ZERO,n.center),n.radius=0,n;for(var i=t.clone(e[0],d),a=t.clone(i,l),o=t.clone(i,R),u=t.clone(i,f),E=t.clone(i,A),s=t.clone(i,h),c=t.clone(i,N),_=e.length,O=1;O<_;O++){t.clone(e[O],i);var p=i.x,C=i.y,U=i.z;p<a.x&&t.clone(i,a),p>E.x&&t.clone(i,E),C<o.y&&t.clone(i,o),C>s.y&&t.clone(i,s),U<u.z&&t.clone(i,u),U>c.z&&t.clone(i,c)}var L=t.magnitudeSquared(t.subtract(E,a,I)),F=t.magnitudeSquared(t.subtract(s,o,I)),P=t.magnitudeSquared(t.subtract(c,u,I)),v=a,g=E,x=L;F>x&&(x=F,v=o,g=s),P>x&&(x=P,v=u,g=c);var w=S;w.x=.5*(v.x+g.x),w.y=.5*(v.y+g.y),w.z=.5*(v.z+g.z);var D=t.magnitudeSquared(t.subtract(g,w,I)),B=Math.sqrt(D),z=m;z.x=a.x,z.y=o.y,z.z=u.z;var G=M;G.x=E.x,G.y=s.y,G.z=c.z;var b=t.multiplyByScalar(t.add(z,G,I),.5,y),X=0;for(O=0;O<_;O++){t.clone(e[O],i);var V=t.magnitude(t.subtract(i,b,I));V>X&&(X=V);var q=t.magnitudeSquared(t.subtract(i,w,I));if(q>D){var H=Math.sqrt(q);B=.5*(B+H),D=B*B;var W=H-B;w.x=(B*w.x+W*i.x)/H,w.y=(B*w.y+W*i.y)/H,w.z=(B*w.z+W*i.z)/H}}return B<X?(t.clone(w,n.center),n.radius=B):(t.clone(b,n.center),n.radius=X),n};var O=new o,p=new t,C=new t,U=new e,L=new e;T.fromRectangle2D=function(t,e,n){return T.fromRectangleWithHeights2D(t,e,0,0,n)},T.fromRectangleWithHeights2D=function(e,i,a,o,u){if(r(u)||(u=new T),!r(e))return u.center=t.clone(t.ZERO,u.center),u.radius=0,u;i=n(i,O),_.southwest(e,U),U.height=a,_.northeast(e,L),L.height=o;var E=i.project(U,p),s=i.project(L,C),c=s.x-E.x,l=s.y-E.y,R=s.z-E.z;u.radius=.5*Math.sqrt(c*c+l*l+R*R);var f=u.center;return f.x=E.x+.5*c,f.y=E.y+.5*l,f.z=E.z+.5*R,u};var F=[];T.fromRectangle3D=function(t,e,i,o){e=n(e,a.WGS84),i=n(i,0);var u;return r(t)&&(u=_.subsample(t,e,i,F)),T.fromPoints(u,o)},T.fromVertices=function(e,i,a,o){if(r(o)||(o=new T),!r(e)||0===e.length)return o.center=t.clone(t.ZERO,o.center),o.radius=0,o;i=n(i,t.ZERO),a=n(a,3);var u=d;u.x=e[0]+i.x,u.y=e[1]+i.y,u.z=e[2]+i.z;for(var E=t.clone(u,l),s=t.clone(u,R),c=t.clone(u,f),_=t.clone(u,A),O=t.clone(u,h),p=t.clone(u,N),C=e.length,U=0;U<C;U+=a){var L=e[U]+i.x,F=e[U+1]+i.y,P=e[U+2]+i.z;u.x=L,u.y=F,u.z=P,L<E.x&&t.clone(u,E),L>_.x&&t.clone(u,_),F<s.y&&t.clone(u,s),F>O.y&&t.clone(u,O),P<c.z&&t.clone(u,c),P>p.z&&t.clone(u,p)}var v=t.magnitudeSquared(t.subtract(_,E,I)),g=t.magnitudeSquared(t.subtract(O,s,I)),x=t.magnitudeSquared(t.subtract(p,c,I)),w=E,D=_,B=v;g>B&&(B=g,w=s,D=O),x>B&&(B=x,w=c,D=p);var z=S;z.x=.5*(w.x+D.x),z.y=.5*(w.y+D.y),z.z=.5*(w.z+D.z);var G=t.magnitudeSquared(t.subtract(D,z,I)),b=Math.sqrt(G),X=m;X.x=E.x,X.y=s.y,X.z=c.z;var V=M;V.x=_.x,V.y=O.y,V.z=p.z;var q=t.multiplyByScalar(t.add(X,V,I),.5,y),H=0;for(U=0;U<C;U+=a){u.x=e[U]+i.x,u.y=e[U+1]+i.y,u.z=e[U+2]+i.z;var W=t.magnitude(t.subtract(u,q,I));W>H&&(H=W);var Y=t.magnitudeSquared(t.subtract(u,z,I));if(Y>G){var K=Math.sqrt(Y);b=.5*(b+K),G=b*b;var k=K-b;z.x=(b*z.x+k*u.x)/K,z.y=(b*z.y+k*u.y)/K,z.z=(b*z.z+k*u.z)/K}}return b<H?(t.clone(z,o.center),o.radius=b):(t.clone(q,o.center),o.radius=H),o},T.fromEncodedCartesianVertices=function(e,n,i){if(r(i)||(i=new T),!r(e)||!r(n)||e.length!==n.length||0===e.length)return i.center=t.clone(t.ZERO,i.center),i.radius=0,i;var a=d;a.x=e[0]+n[0],a.y=e[1]+n[1],a.z=e[2]+n[2];for(var o=t.clone(a,l),u=t.clone(a,R),E=t.clone(a,f),s=t.clone(a,A),c=t.clone(a,h),_=t.clone(a,N),O=e.length,p=0;p<O;p+=3){var C=e[p]+n[p],U=e[p+1]+n[p+1],L=e[p+2]+n[p+2];a.x=C,a.y=U,a.z=L,C<o.x&&t.clone(a,o),C>s.x&&t.clone(a,s),U<u.y&&t.clone(a,u),U>c.y&&t.clone(a,c),L<E.z&&t.clone(a,E),L>_.z&&t.clone(a,_)}var F=t.magnitudeSquared(t.subtract(s,o,I)),P=t.magnitudeSquared(t.subtract(c,u,I)),v=t.magnitudeSquared(t.subtract(_,E,I)),g=o,x=s,w=F;P>w&&(w=P,g=u,x=c),v>w&&(w=v,g=E,x=_);var D=S;D.x=.5*(g.x+x.x),D.y=.5*(g.y+x.y),D.z=.5*(g.z+x.z);var B=t.magnitudeSquared(t.subtract(x,D,I)),z=Math.sqrt(B),G=m;G.x=o.x,G.y=u.y,G.z=E.z;var b=M;b.x=s.x,b.y=c.y,b.z=_.z;var X=t.multiplyByScalar(t.add(G,b,I),.5,y),V=0;for(p=0;p<O;p+=3){a.x=e[p]+n[p],a.y=e[p+1]+n[p+1],a.z=e[p+2]+n[p+2];var q=t.magnitude(t.subtract(a,X,I));q>V&&(V=q);var H=t.magnitudeSquared(t.subtract(a,D,I));if(H>B){var W=Math.sqrt(H);z=.5*(z+W),B=z*z;var Y=W-z;D.x=(z*D.x+Y*a.x)/W,D.y=(z*D.y+Y*a.y)/W,D.z=(z*D.z+Y*a.z)/W}}return z<V?(t.clone(D,i.center),i.radius=z):(t.clone(X,i.center),i.radius=V),i},T.fromCornerPoints=function(e,n,i){r(i)||(i=new T);var a=i.center;return t.add(e,n,a),t.multiplyByScalar(a,.5,a),i.radius=t.distance(a,n),i},T.fromEllipsoid=function(e,n){return r(n)||(n=new T),t.clone(t.ZERO,n.center),n.radius=e.maximumRadius,n};var P=new t;T.fromBoundingSpheres=function(e,n){if(r(n)||(n=new T),!r(e)||0===e.length)return n.center=t.clone(t.ZERO,n.center),n.radius=0,n;var i=e.length;if(1===i)return T.clone(e[0],n);if(2===i)return T.union(e[0],e[1],n);for(var a=[],o=0;o<i;o++)a.push(e[o].center);n=T.fromPoints(a,n);var u=n.center,E=n.radius;for(o=0;o<i;o++){var s=e[o];E=Math.max(E,t.distance(u,s.center,P)+s.radius)}return n.radius=E,n};var v=new t,g=new t,x=new t;T.fromOrientedBoundingBox=function(e,n){r(n)||(n=new T);var i=e.halfAxes,a=s.getColumn(i,0,v),o=s.getColumn(i,1,g),u=s.getColumn(i,2,x),E=t.magnitude(a),c=t.magnitude(o),_=t.magnitude(u);return n.center=t.clone(e.center,n.center),n.radius=Math.max(E,c,_),n},T.clone=function(e,n){if(r(e))return r(n)?(n.center=t.clone(e.center,n.center),n.radius=e.radius,n):new T(e.center,e.radius)},T.packedLength=4,T.pack=function(t,e,r){r=n(r,0);var i=t.center;return e[r++]=i.x,e[r++]=i.y,e[r++]=i.z,e[r]=t.radius,e},T.unpack=function(t,e,i){e=n(e,0),r(i)||(i=new T);var a=i.center;return a.x=t[e++],a.y=t[e++],a.z=t[e++],i.radius=t[e],i};var w=new t,D=new t;T.union=function(e,n,i){r(i)||(i=new T);var a=e.center,o=e.radius,u=n.center,E=n.radius,s=t.subtract(u,a,w),c=t.magnitude(s);if(o>=c+E)return e.clone(i),i;if(E>=c+o)return n.clone(i),i;var _=.5*(o+c+E),l=t.multiplyByScalar(s,(-o+_)/c,D);return t.add(l,a,l),t.clone(l,i.center),i.radius=_,i};var B=new t;T.expand=function(e,n,r){r=T.clone(e,r);var i=t.magnitude(t.subtract(n,r.center,B));return i>r.radius&&(r.radius=i),r},T.intersectPlane=function(e,n){var r=e.center,i=e.radius,a=n.normal,o=t.dot(a,r)+n.distance;return o<-i?u.OUTSIDE:o<i?u.INTERSECTING:u.INSIDE},T.transform=function(t,e,n){return r(n)||(n=new T),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=c.getMaximumScale(e)*t.radius,n};var z=new t;T.distanceSquaredTo=function(e,n){var r=t.subtract(e.center,n,z);return t.magnitudeSquared(r)-e.radius*e.radius},T.transformWithoutScale=function(t,e,n){return r(n)||(n=new T),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=t.radius,n};var G=new t;T.computePlaneDistances=function(e,n,i,a){r(a)||(a=new E);var o=t.subtract(e.center,n,G),u=t.dot(i,o);return a.start=u-e.radius,a.stop=u+e.radius,a};for(var b=new t,X=new t,V=new t,q=new t,H=new t,W=new e,Y=new Array(8),K=0;K<8;++K)Y[K]=new t;var k=new o;return T.projectTo2D=function(e,r,i){r=n(r,k);var a=r.ellipsoid,o=e.center,u=e.radius,E=a.geodeticSurfaceNormal(o,b),s=t.cross(t.UNIT_Z,E,X);t.normalize(s,s);var c=t.cross(E,s,V);t.normalize(c,c),t.multiplyByScalar(E,u,E),t.multiplyByScalar(c,u,c),t.multiplyByScalar(s,u,s);var _=t.negate(c,H),l=t.negate(s,q),R=Y,f=R[0];t.add(E,c,f),t.add(f,s,f),f=R[1],t.add(E,c,f),t.add(f,l,f),f=R[2],t.add(E,_,f),t.add(f,l,f),f=R[3],t.add(E,_,f),t.add(f,s,f),t.negate(E,E),f=R[4],t.add(E,c,f),t.add(f,s,f),f=R[5],t.add(E,c,f),t.add(f,l,f),f=R[6],t.add(E,_,f),t.add(f,l,f),f=R[7],t.add(E,_,f),t.add(f,s,f);for(var A=R.length,h=0;h<A;++h){var N=R[h];t.add(o,N,N);var d=a.cartesianToCartographic(N,W);r.project(d,N)}i=T.fromPoints(R,i),o=i.center;var I=o.x,S=o.y,m=o.z;return o.x=m,o.y=I,o.z=S,i},T.isOccluded=function(t,e){return!e.isBoundingSphereVisible(t)},T.equals=function(e,n){return e===n||r(e)&&r(n)&&t.equals(e.center,n.center)&&e.radius===n.radius},T.prototype.intersectPlane=function(t){return T.intersectPlane(this,t)},T.prototype.distanceSquaredTo=function(t){return T.distanceSquaredTo(this,t)},T.prototype.computePlaneDistances=function(t,e,n){return T.computePlaneDistances(this,t,e,n)},T.prototype.isOccluded=function(t){return T.isOccluded(this,t)},T.prototype.equals=function(t){return T.equals(this,t)},T.prototype.clone=function(t){return T.clone(this,t)},T}),define("Core/Cartesian2",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i){"use strict";function a(e,n){this.x=t(e,0),this.y=t(n,0)}a.fromElements=function(t,n,r){return e(r)?(r.x=t,r.y=n,r):new a(t,n)},a.clone=function(t,n){if(e(t))return e(n)?(n.x=t.x,n.y=t.y,n):new a(t.x,t.y)},a.fromCartesian3=a.clone,a.fromCartesian4=a.clone,a.packedLength=2,a.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r]=e.y,n},a.unpack=function(n,r,i){return r=t(r,0),e(i)||(i=new a),i.x=n[r++],i.y=n[r],i},a.packArray=function(t,n){var r=t.length;e(n)?n.length=2*r:n=new Array(2*r);for(var i=0;i<r;++i)a.pack(t[i],n,2*i);return n},a.unpackArray=function(t,n){var r=t.length;e(n)?n.length=r/2:n=new Array(r/2);for(var i=0;i<r;i+=2){var o=i/2;n[o]=a.unpack(t,i,n[o])}return n},a.fromArray=a.unpack,a.maximumComponent=function(t){return Math.max(t.x,t.y)},a.minimumComponent=function(t){return Math.min(t.x,t.y)},a.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n},a.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n},a.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y},a.magnitude=function(t){return Math.sqrt(a.magnitudeSquared(t))};var o=new a;a.distance=function(t,e){return a.subtract(t,e,o),a.magnitude(o)},a.distanceSquared=function(t,e){return a.subtract(t,e,o),a.magnitudeSquared(o)},a.normalize=function(t,e){var n=a.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e},a.dot=function(t,e){return t.x*e.x+t.y*e.y},a.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n},a.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n},a.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n},a.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n},a.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n},a.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n},a.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e},a.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e};var u=new a;a.lerp=function(t,e,n,r){return a.multiplyByScalar(e,n,u),r=a.multiplyByScalar(t,1-n,r),a.add(u,r,r)};var E=new a,s=new a;a.angleBetween=function(t,e){return a.normalize(t,E),a.normalize(e,s),i.acosClamped(a.dot(E,s))};var c=new a;return a.mostOrthogonalAxis=function(t,e){var n=a.normalize(t,c);return a.abs(n,n),e=n.x<=n.y?a.clone(a.UNIT_X,e):a.clone(a.UNIT_Y,e)},a.equals=function(t,n){return t===n||e(t)&&e(n)&&t.x===n.x&&t.y===n.y},a.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]},a.equalsEpsilon=function(t,n,r,a){return t===n||e(t)&&e(n)&&i.equalsEpsilon(t.x,n.x,r,a)&&i.equalsEpsilon(t.y,n.y,r,a)},a.ZERO=r(new a(0,0)),a.UNIT_X=r(new a(1,0)),a.UNIT_Y=r(new a(0,1)),a.prototype.clone=function(t){return a.clone(this,t)},a.prototype.equals=function(t){return a.equals(this,t)},a.prototype.equalsEpsilon=function(t,e,n){return a.equalsEpsilon(this,t,e,n)},a.prototype.toString=function(){return"("+this.x+", "+this.y+")"},a}),define("Core/Fullscreen",["./defined","./defineProperties"],function(t,e){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},i={};return e(i,{element:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenEnabled]; -}},fullscreen:{get:function(){if(i.supportsFullscreen())return null!==i.element}}}),i.supportsFullscreen=function(){if(t(n))return n;n=!1;var e=document.body;if("function"==typeof e.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var i,a=["webkit","moz","o","ms","khtml"],o=0,u=a.length;o<u;++o){var E=a[o];i=E+"RequestFullscreen","function"==typeof e[i]?(r.requestFullscreen=i,n=!0):(i=E+"RequestFullScreen","function"==typeof e[i]&&(r.requestFullscreen=i,n=!0)),i=E+"ExitFullscreen","function"==typeof document[i]?r.exitFullscreen=i:(i=E+"CancelFullScreen","function"==typeof document[i]&&(r.exitFullscreen=i)),i=E+"FullscreenEnabled",void 0!==document[i]?r.fullscreenEnabled=i:(i=E+"FullScreenEnabled",void 0!==document[i]&&(r.fullscreenEnabled=i)),i=E+"FullscreenElement",void 0!==document[i]?r.fullscreenElement=i:(i=E+"FullScreenElement",void 0!==document[i]&&(r.fullscreenElement=i)),i=E+"fullscreenchange",void 0!==document["on"+i]&&("ms"===E&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=E+"fullscreenerror",void 0!==document["on"+i]&&("ms"===E&&(i="MSFullscreenError"),r.fullscreenerror=i)}return n},i.requestFullscreen=function(t,e){i.supportsFullscreen()&&t[r.requestFullscreen]({vrDisplay:e})},i.exitFullscreen=function(){i.supportsFullscreen()&&document[r.exitFullscreen]()},i}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(t,e,n){"use strict";function r(t){for(var e=t.split("."),n=0,r=e.length;n<r;++n)e[n]=parseInt(e[n],10);return e}function i(){if(!e(S)&&(S=!1,!T())){var t=/ Chrome\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(S=!0,m=r(t[1]))}return S}function a(){return i()&&m}function o(){if(!e(M)&&(M=!1,!i()&&!T()&&/ Safari\/[\.0-9]+/.test(I.userAgent))){var t=/ Version\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(M=!0,y=r(t[1]))}return M}function u(){return o()&&y}function E(){if(!e(O)){O=!1;var t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(I.userAgent);null!==t&&(O=!0,p=r(t[1]),p.isNightly=!!t[2])}return O}function s(){return E()&&p}function c(){if(!e(C)){C=!1;var t;"Microsoft Internet Explorer"===I.appName?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==t&&(C=!0,U=r(t[1]))):"Netscape"===I.appName&&(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==t&&(C=!0,U=r(t[1])))}return C}function _(){return c()&&U}function T(){if(!e(L)){L=!1;var t=/ Edge\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(L=!0,F=r(t[1]))}return L}function l(){return T()&&F}function R(){if(!e(P)){P=!1;var t=/Firefox\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(P=!0,v=r(t[1]))}return P}function f(){return e(g)||(g=/Windows/i.test(I.appVersion)),g}function A(){return R()&&v}function h(){return e(x)||(x="undefined"!=typeof PointerEvent&&(!e(I.pointerEnabled)||I.pointerEnabled)),x}function N(){if(!e(D)){var t=document.createElement("canvas");t.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=t.style.imageRendering;D=e(n)&&""!==n,D&&(w=n)}return D}function d(){return N()?w:void 0}var I;I="undefined"!=typeof navigator?navigator:{};var S,m,M,y,O,p,C,U,L,F,P,v,g,x,w,D,B={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:E,webkitVersion:s,isInternetExplorer:c,internetExplorerVersion:_,isEdge:T,edgeVersion:l,isFirefox:R,firefoxVersion:A,isWindows:f,hardwareConcurrency:t(I.hardwareConcurrency,3),supportsPointerEvents:h,supportsImageRenderingPixelated:N,imageRenderingValue:d};return B.supportsFullscreen=function(){return n.supportsFullscreen()},B.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},B.supportsWebWorkers=function(){return"undefined"!=typeof Worker},B}),define("Core/WebGLConstants",["./freezeObject"],function(t){"use strict";var e={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503};return t(e)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(t,e,n,r,i,a){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:a.BYTE,UNSIGNED_BYTE:a.UNSIGNED_BYTE,SHORT:a.SHORT,UNSIGNED_SHORT:a.UNSIGNED_SHORT,INT:a.INT,UNSIGNED_INT:a.UNSIGNED_INT,FLOAT:a.FLOAT,DOUBLE:a.DOUBLE};return o.getSizeInBytes=function(t){switch(t){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.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(t){return t instanceof Int8Array?o.BYTE:t instanceof Uint8Array?o.UNSIGNED_BYTE:t instanceof Int16Array?o.SHORT:t instanceof Uint16Array?o.UNSIGNED_SHORT:t instanceof Int32Array?o.INT:t instanceof Uint32Array?o.UNSIGNED_INT:t instanceof Float32Array?o.FLOAT:t instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(t){return e(t)&&(t===o.BYTE||t===o.UNSIGNED_BYTE||t===o.SHORT||t===o.UNSIGNED_SHORT||t===o.INT||t===o.UNSIGNED_INT||t===o.FLOAT||t===o.DOUBLE)},o.createTypedArray=function(t,e){switch(t){case o.BYTE:return new Int8Array(e);case o.UNSIGNED_BYTE:return new Uint8Array(e);case o.SHORT:return new Int16Array(e);case o.UNSIGNED_SHORT:return new Uint16Array(e);case o.INT:return new Int32Array(e);case o.UNSIGNED_INT:return new Uint32Array(e);case o.FLOAT:return new Float32Array(e);case o.DOUBLE:return new Float64Array(e)}},o.createArrayBufferView=function(e,n,r,i){switch(r=t(r,0),i=t(i,(n.byteLength-r)/o.getSizeInBytes(e)),e){case o.BYTE:return new Int8Array(n,r,i);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,i);case o.SHORT:return new Int16Array(n,r,i);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,i);case o.INT:return new Int32Array(n,r,i);case o.UNSIGNED_INT:return new Uint32Array(n,r,i);case o.FLOAT:return new Float32Array(n,r,i);case o.DOUBLE:return new Float64Array(n,r,i)}},o.fromName=function(t){switch(t){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},i(o)}),define("Core/CylinderGeometryLibrary",["./Math"],function(t){"use strict";var e={};return e.computePositions=function(e,n,r,i,a){var o,u=.5*e,E=-u,s=i+i,c=a?2*s:s,_=new Float64Array(3*c),T=0,l=0,R=a?3*s:0,f=a?3*(s+i):3*i;for(o=0;o<i;o++){var A=o/i*t.TWO_PI,h=Math.cos(A),N=Math.sin(A),d=h*r,I=N*r,S=h*n,m=N*n;_[l+R]=d,_[l+R+1]=I,_[l+R+2]=E,_[l+f]=S,_[l+f+1]=m,_[l+f+2]=u,l+=3,a&&(_[T++]=d,_[T++]=I,_[T++]=E,_[T++]=S,_[T++]=m,_[T++]=u)}return _},e}),define("Core/GeometryType",["./freezeObject"],function(t){"use strict";var e={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return t(e)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(t,e){"use strict";var n={POINTS:e.POINTS,LINES:e.LINES,LINE_LOOP:e.LINE_LOOP,LINE_STRIP:e.LINE_STRIP,TRIANGLES:e.TRIANGLES,TRIANGLE_STRIP:e.TRIANGLE_STRIP,TRIANGLE_FAN:e.TRIANGLE_FAN,validate:function(t){return t===n.POINTS||t===n.LINES||t===n.LINE_LOOP||t===n.LINE_STRIP||t===n.TRIANGLES||t===n.TRIANGLE_STRIP||t===n.TRIANGLE_FAN}};return t(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(t,e,n,r,i){"use strict";function a(e){e=t(e,t.EMPTY_OBJECT),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=t(e.primitiveType,i.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=t(e.geometryType,r.NONE),this.boundingSphereCV=e.boundingSphereCV}return a.computeNumberOfVertices=function(t){var n=-1;for(var r in t.attributes)if(t.attributes.hasOwnProperty(r)&&e(t.attributes[r])&&e(t.attributes[r].values)){var i=t.attributes[r],a=i.values.length/i.componentsPerAttribute;n=a}return n},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(t,e,n){"use strict";function r(e){e=t(e,t.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=t(e.normalize,!1),this.values=e.values}return r}),define("Core/GeometryAttributes",["./defaultValue"],function(t){"use strict";function e(e){e=t(e,t.EMPTY_OBJECT),this.position=e.position,this.normal=e.normal,this.st=e.st,this.binormal=e.binormal,this.tangent=e.tangent,this.color=e.color}return e}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(t,e,n,r,i){"use strict";var a={UNSIGNED_BYTE:i.UNSIGNED_BYTE,UNSIGNED_SHORT:i.UNSIGNED_SHORT,UNSIGNED_INT:i.UNSIGNED_INT};return a.getSizeInBytes=function(t){switch(t){case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},a.validate=function(e){return t(e)&&(e===a.UNSIGNED_BYTE||e===a.UNSIGNED_SHORT||e===a.UNSIGNED_INT)},a.createTypedArray=function(t,e){return t>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(e):new Uint16Array(e)},a.createTypedArrayFromArrayBuffer=function(t,e,n,i){return t>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(e,n,i):new Uint16Array(e,n,i)},n(a)}),define("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(t,e,n,r){"use strict";function i(e){e=t(e,t.EMPTY_OBJECT),this.position=t(e.position,!1),this.normal=t(e.normal,!1),this.st=t(e.st,!1),this.binormal=t(e.binormal,!1),this.tangent=t(e.tangent,!1),this.color=t(e.color,!1)}return i.POSITION_ONLY=r(new i({position:!0})),i.POSITION_AND_NORMAL=r(new i({position:!0,normal:!0})),i.POSITION_NORMAL_AND_ST=r(new i({position:!0,normal:!0,st:!0})),i.POSITION_AND_ST=r(new i({position:!0,st:!0})),i.POSITION_AND_COLOR=r(new i({position:!0,color:!0})),i.ALL=r(new i({position:!0,normal:!0,st:!0,binormal:!0,tangent:!0})),i.DEFAULT=i.POSITION_NORMAL_AND_ST,i.packedLength=6,i.pack=function(e,n,r){return r=t(r,0),n[r++]=e.position?1:0,n[r++]=e.normal?1:0,n[r++]=e.st?1:0,n[r++]=e.binormal?1:0,n[r++]=e.tangent?1:0,n[r++]=e.color?1:0,n},i.unpack=function(n,r,a){return r=t(r,0),e(a)||(a=new i),a.position=1===n[r++],a.normal=1===n[r++],a.st=1===n[r++],a.binormal=1===n[r++],a.tangent=1===n[r++],a.color=1===n[r++],a},i.clone=function(t,n){if(e(t))return e(n)||(n=new i),n.position=t.position,n.normal=t.normal,n.st=t.st,n.binormal=t.binormal,n.tangent=t.tangent,n.color=t.color,n},i}),define("Core/CylinderGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./CylinderGeometryLibrary","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./VertexFormat"],function(t,e,n,r,i,a,o,u,E,s,c,_,T,l,R){"use strict";function f(t){t=a(t,a.EMPTY_OBJECT);var e=t.length,n=t.topRadius,r=t.bottomRadius,i=a(t.vertexFormat,R.DEFAULT),o=a(t.slices,128);this._length=e,this._topRadius=n,this._bottomRadius=r,this._vertexFormat=R.clone(i),this._slices=o,this._workerName="createCylinderGeometry"}var A=new e,h=new n,N=new n,d=new n,I=new n;f.packedLength=R.packedLength+4,f.pack=function(t,e,n){return n=a(n,0),R.pack(t._vertexFormat,e,n),n+=R.packedLength,e[n++]=t._length,e[n++]=t._topRadius,e[n++]=t._bottomRadius,e[n]=t._slices,e};var S=new R,m={vertexFormat:S,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0};return f.unpack=function(t,e,n){e=a(e,0);var r=R.unpack(t,e,S);e+=R.packedLength;var i=t[e++],u=t[e++],E=t[e++],s=t[e];return o(n)?(n._vertexFormat=R.clone(r,n._vertexFormat),n._length=i,n._topRadius=u,n._bottomRadius=E,n._slices=s,n):(m.length=i,m.topRadius=u,m.bottomRadius=E,m.slices=s,new f(m))},f.createGeometry=function(a){var o=a._length,u=a._topRadius,R=a._bottomRadius,f=a._vertexFormat,S=a._slices;if(!(o<=0||u<0||R<0||0===u&&0===R)){var m,M=S+S,y=S+M,O=M+M,p=i.computePositions(o,u,R,S,!0),C=f.st?new Float32Array(2*O):void 0,U=f.normal?new Float32Array(3*O):void 0,L=f.tangent?new Float32Array(3*O):void 0,F=f.binormal?new Float32Array(3*O):void 0,P=f.normal||f.tangent||f.binormal;if(P){var v=f.tangent||f.binormal,g=0,x=0,w=0,D=h;D.z=0;var B=d,z=N;for(m=0;m<S;m++){var G=m/S*T.TWO_PI,b=Math.cos(G),X=Math.sin(G);P&&(D.x=b,D.y=X,v&&(B=n.normalize(n.cross(n.UNIT_Z,D,B),B)),f.normal&&(U[g++]=b,U[g++]=X,U[g++]=0,U[g++]=b,U[g++]=X,U[g++]=0),f.tangent&&(L[x++]=B.x,L[x++]=B.y,L[x++]=B.z,L[x++]=B.x,L[x++]=B.y,L[x++]=B.z),f.binormal&&(z=n.normalize(n.cross(D,B,z),z),F[w++]=z.x,F[w++]=z.y,F[w++]=z.z,F[w++]=z.x,F[w++]=z.y,F[w++]=z.z))}for(m=0;m<S;m++)f.normal&&(U[g++]=0,U[g++]=0,U[g++]=-1),f.tangent&&(L[x++]=1,L[x++]=0,L[x++]=0),f.binormal&&(F[w++]=0,F[w++]=-1,F[w++]=0);for(m=0;m<S;m++)f.normal&&(U[g++]=0,U[g++]=0,U[g++]=1),f.tangent&&(L[x++]=1,L[x++]=0,L[x++]=0),f.binormal&&(F[w++]=0,F[w++]=1,F[w++]=0)}var V=12*S-12,q=_.createTypedArray(O,V),H=0,W=0;for(m=0;m<S-1;m++)q[H++]=W,q[H++]=W+2,q[H++]=W+3,q[H++]=W,q[H++]=W+3,q[H++]=W+1,W+=2;for(q[H++]=M-2,q[H++]=0,q[H++]=1,q[H++]=M-2,q[H++]=1,q[H++]=M-1,m=1;m<S-1;m++)q[H++]=M+m+1,q[H++]=M+m,q[H++]=M;for(m=1;m<S-1;m++)q[H++]=y,q[H++]=y+m,q[H++]=y+m+1;var Y=0;if(f.st){var K=Math.max(u,R);for(m=0;m<O;m++){var k=n.fromArray(p,3*m,I);C[Y++]=(k.x+K)/(2*K),C[Y++]=(k.y+K)/(2*K)}}var Z=new c;f.position&&(Z.position=new s({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:p})),f.normal&&(Z.normal=new s({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:U})),f.tangent&&(Z.tangent=new s({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:L})),f.binormal&&(Z.binormal=new s({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:F})),f.st&&(Z.st=new s({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:C})),A.x=.5*o,A.y=Math.max(R,u);var j=new t(n.ZERO,e.magnitude(A));return new E({attributes:Z,indices:q,primitiveType:l.TRIANGLES,boundingSphere:j})}},f}),define("Workers/createCylinderGeometry",["../Core/CylinderGeometry","../Core/defined"],function(t,e){"use strict";return function(n,r){return e(r)&&(n=t.unpack(n,r)),t.createGeometry(n)}})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function t(t){return void 0!==t&&null!==t}return t}),define("Core/DeveloperError",["./defined"],function(t){"use strict";function e(t){this.name="DeveloperError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e.throwInstantiationError=function(){throw new e("This function defines an interface and should not be called directly.")},e}),define("Core/Check",["./defined","./DeveloperError"],function(t,e){"use strict";function n(t){return t+" is required, actual value was undefined"}function r(t,e,n){return"Expected "+n+" to be typeof "+e+", actual typeof was "+t}var a={};return a.typeOf={},a.defined=function(r,a){if(!t(a))throw new e(n(r))},a.typeOf.func=function(t,n){if("function"!=typeof n)throw new e(r(typeof n,"function",t))},a.typeOf.string=function(t,n){if("string"!=typeof n)throw new e(r(typeof n,"string",t))},a.typeOf.number=function(t,n){if("number"!=typeof n)throw new e(r(typeof n,"number",t))},a.typeOf.number.lessThan=function(t,n,r){if(a.typeOf.number(t,n),n>=r)throw new e("Expected "+t+" to be less than "+r+", actual value was "+n)},a.typeOf.number.lessThanOrEquals=function(t,n,r){if(a.typeOf.number(t,n),n>r)throw new e("Expected "+t+" to be less than or equal to "+r+", actual value was "+n)},a.typeOf.number.greaterThan=function(t,n,r){if(a.typeOf.number(t,n),n<=r)throw new e("Expected "+t+" to be greater than "+r+", actual value was "+n)},a.typeOf.number.greaterThanOrEquals=function(t,n,r){if(a.typeOf.number(t,n),n<r)throw new e("Expected "+t+" to be greater than or equal to"+r+", actual value was "+n)},a.typeOf.object=function(t,n){if("object"!=typeof n)throw new e(r(typeof n,"object",t))},a.typeOf.bool=function(t,n){if("boolean"!=typeof n)throw new e(r(typeof n,"boolean",t))},a}),define("Core/freezeObject",["./defined"],function(t){"use strict";var e=Object.freeze;return t(e)||(e=function(t){return t}),e}),define("Core/defaultValue",["./freezeObject"],function(t){"use strict";function e(t,e){return void 0!==t?t:e}return e.EMPTY_OBJECT=t({}),e}),define("ThirdParty/mersenne-twister",[],function(){var t=function(t){void 0==t&&(t=(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(t)};return t.prototype.init_genrand=function(t){for(this.mt[0]=t>>>0,this.mti=1;this.mti<this.N;this.mti++){var t=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&t)>>>16)<<16)+1812433253*(65535&t)+this.mti,this.mt[this.mti]>>>=0}},t.prototype.genrand_int32=function(){var t,e=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)t=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^t>>>1^e[1&t];for(;n<this.N-1;n++)t=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^t>>>1^e[1&t];t=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^t>>>1^e[1&t],this.mti=0}return t=this.mt[this.mti++],t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,t^=t>>>18,t>>>0},t.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},t}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(t,e,n,r){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(t){return t>0?1:t<0?-1:0},a.signNotZero=function(t){return t<0?-1:1},a.toSNorm=function(t,n){return n=e(n,255),Math.round((.5*a.clamp(t,-1,1)+.5)*n)},a.fromSNorm=function(t,n){return n=e(n,255),a.clamp(t,0,n)/n*2-1},a.sinh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e-n)},a.cosh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e+n)},a.lerp=function(t,e,n){return(1-n)*t+n*e},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(t){return t*a.RADIANS_PER_DEGREE},a.toDegrees=function(t){return t*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(t){var e=a.TWO_PI,n=t-Math.floor(t/e)*e;return n<-Math.PI?n+e:n>=Math.PI?n-e:n},a.clampToLatitudeRange=function(t){return a.clamp(t,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(t){return a.zeroToTwoPi(t+a.PI)-a.PI},a.zeroToTwoPi=function(t){var e=a.mod(t,a.TWO_PI);return Math.abs(e)<a.EPSILON14&&Math.abs(t)>a.EPSILON14?a.TWO_PI:e},a.mod=function(t,e){return(t%e+e)%e},a.equalsEpsilon=function(t,n,r,a){a=e(a,r);var i=Math.abs(t-n);return i<=a||i<=r*Math.max(Math.abs(t),Math.abs(n))};var i=[1];a.factorial=function(t){var e=i.length;if(t>=e)for(var n=i[e-1],r=e;r<=t;r++)i.push(n*r);return i[t]},a.incrementWrap=function(t,n,r){return r=e(r,0),++t,t>n&&(t=r),t},a.isPowerOfTwo=function(t){return 0!==t&&0===(t&t-1)},a.nextPowerOfTwo=function(t){return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t,t},a.clamp=function(t,e,n){return t<e?e:t>n?n:t};var o=new t;return a.setRandomNumberSeed=function(e){o=new t(e)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(t){return Math.acos(a.clamp(t,-1,1))},a.asinClamped=function(t){return Math.asin(a.clamp(t,-1,1))},a.chordLength=function(t,e){return 2*e*Math.sin(.5*t)},a.logBase=function(t,e){return Math.log(t)/Math.log(e)},a.fog=function(t,e){var n=t*e;return 1-Math.exp(-(n*n))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,a,i){"use strict";function o(t,n,r){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0)}o.fromSpherical=function(t,r){n(r)||(r=new o);var a=t.clock,i=t.cone,u=e(t.magnitude,1),E=u*Math.sin(i);return r.x=E*Math.cos(a),r.y=E*Math.sin(a),r.z=u*Math.cos(i),r},o.fromElements=function(t,e,r,a){return n(a)?(a.x=t,a.y=e,a.z=r,a):new o(t,e,r)},o.clone=function(t,e){if(n(t))return n(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e):new o(t.x,t.y,t.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r]=t.z,n},o.unpack=function(t,r,a){return r=e(r,0),n(a)||(a=new o),a.x=t[r++],a.y=t[r++],a.z=t[r],a},o.packArray=function(t,e){var r=t.length;n(e)?e.length=3*r:e=new Array(3*r);for(var a=0;a<r;++a)o.pack(t[a],e,3*a);return e},o.unpackArray=function(t,e){var r=t.length;n(e)?e.length=r/3:e=new Array(r/3);for(var a=0;a<r;a+=3){var i=a/3;e[i]=o.unpack(t,a,e[i])}return e},o.fromArray=o.unpack,o.maximumComponent=function(t){return Math.max(t.x,t.y,t.z)},o.minimumComponent=function(t){return Math.min(t.x,t.y,t.z)},o.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n.z=Math.min(t.z,e.z),n},o.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n.z=Math.max(t.z,e.z),n},o.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z},o.magnitude=function(t){return Math.sqrt(o.magnitudeSquared(t))};var u=new o;o.distance=function(t,e){return o.subtract(t,e,u),o.magnitude(u)},o.distanceSquared=function(t,e){return o.subtract(t,e,u),o.magnitudeSquared(u)},o.normalize=function(t,e){var n=o.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e},o.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},o.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n.z=t.z*e.z,n},o.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n.z=t.z/e.z,n},o.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n},o.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n},o.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*e,n},o.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n},o.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e},o.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e};var E=new o;o.lerp=function(t,e,n,r){return o.multiplyByScalar(e,n,E),r=o.multiplyByScalar(t,1-n,r),o.add(E,r,r)};var s=new o,c=new o;o.angleBetween=function(t,e){o.normalize(t,s),o.normalize(e,c);var n=o.dot(s,c),r=o.magnitude(o.cross(s,c,s));return Math.atan2(r,n)};var _=new o;o.mostOrthogonalAxis=function(t,e){var n=o.normalize(t,_);return o.abs(n,n),e=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,e):o.clone(o.UNIT_Z,e):n.y<=n.z?o.clone(o.UNIT_Y,e):o.clone(o.UNIT_Z,e)},o.equals=function(t,e){return t===e||n(t)&&n(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z},o.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]},o.equalsEpsilon=function(t,e,r,a){return t===e||n(t)&&n(e)&&i.equalsEpsilon(t.x,e.x,r,a)&&i.equalsEpsilon(t.y,e.y,r,a)&&i.equalsEpsilon(t.z,e.z,r,a)},o.cross=function(t,e,n){var r=t.x,a=t.y,i=t.z,o=e.x,u=e.y,E=e.z,s=a*E-i*u,c=i*o-r*E,_=r*u-a*o;return n.x=s,n.y=c,n.z=_,n},o.fromDegrees=function(t,e,n,r,a){return t=i.toRadians(t),e=i.toRadians(e),o.fromRadians(t,e,n,r,a)};var T=new o,R=new o,l=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(t,r,a,i,u){a=e(a,0);var E=n(i)?i.radiiSquared:l,s=Math.cos(r);T.x=s*Math.cos(t),T.y=s*Math.sin(t),T.z=Math.sin(r),T=o.normalize(T,T),o.multiplyComponents(E,T,R);var c=Math.sqrt(o.dot(T,R));return R=o.divideByScalar(R,c,R),T=o.multiplyByScalar(T,a,T),n(u)||(u=new o),o.add(R,T,u)},o.fromDegreesArray=function(t,e,r){var a=t.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=t[i],E=t[i+1],s=i/2;r[s]=o.fromDegrees(u,E,0,e,r[s])}return r},o.fromRadiansArray=function(t,e,r){var a=t.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=t[i],E=t[i+1],s=i/2;r[s]=o.fromRadians(u,E,0,e,r[s])}return r},o.fromDegreesArrayHeights=function(t,e,r){var a=t.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=t[i],E=t[i+1],s=t[i+2],c=i/3;r[c]=o.fromDegrees(u,E,s,e,r[c])}return r},o.fromRadiansArrayHeights=function(t,e,r){var a=t.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=t[i],E=t[i+1],s=t[i+2],c=i/3;r[c]=o.fromRadians(u,E,s,e,r[c])}return r},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(new o(0,0,1)),o.prototype.clone=function(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.prototype.equalsEpsilon=function(t,e,n){return o.equalsEpsilon(this,t,e,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(t,e,n,r){"use strict";function a(n,a,u,E,s){var c=n.x,_=n.y,T=n.z,R=a.x,l=a.y,f=a.z,A=c*c*R*R,h=_*_*l*l,N=T*T*f*f,d=A+h+N,I=Math.sqrt(1/d),S=t.multiplyByScalar(n,I,i);if(d<E)return isFinite(I)?t.clone(S,s):void 0;var m=u.x,O=u.y,M=u.z,y=o;y.x=S.x*m*2,y.y=S.y*O*2,y.z=S.z*M*2;var p,C,U,L,F,g,P,v,w,x,D,B=(1-I)*t.magnitude(n)/(.5*t.magnitude(y)),z=0;do{B-=z,U=1/(1+B*m),L=1/(1+B*O),F=1/(1+B*M),g=U*U,P=L*L,v=F*F,w=g*U,x=P*L,D=v*F,p=A*g+h*P+N*v-1,C=A*w*m+h*x*O+N*D*M;var G=-2*C;z=p/G}while(Math.abs(p)>r.EPSILON12);return e(s)?(s.x=c*U,s.y=_*L,s.z=T*F,s):new t(c*U,_*L,T*F)}var i=new t,o=new t;return a}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,n,r,a,i,o){"use strict";function u(t,n,r){this.longitude=e(t,0),this.latitude=e(n,0),this.height=e(r,0)}u.fromRadians=function(t,r,a,i){return a=e(a,0),n(i)?(i.longitude=t,i.latitude=r,i.height=a,i):new u(t,r,a)},u.fromDegrees=function(t,e,n,r){return t=i.toRadians(t),e=i.toRadians(e),u.fromRadians(t,e,n,r)};var E=new t,s=new t,c=new t,_=new t(1/6378137,1/6378137,1/6356752.314245179),T=new t(1/40680631590769,1/40680631590769,1/40408299984661.445),R=i.EPSILON1;return u.fromCartesian=function(e,r,a){var l=n(r)?r.oneOverRadii:_,f=n(r)?r.oneOverRadiiSquared:T,A=n(r)?r._centerToleranceSquared:R,h=o(e,l,f,A,s);if(n(h)){var N=t.multiplyComponents(h,f,E);N=t.normalize(N,N);var d=t.subtract(e,h,c),I=Math.atan2(N.y,N.x),S=Math.asin(N.z),m=i.sign(t.dot(d,e))*t.magnitude(d);return n(a)?(a.longitude=I,a.latitude=S,a.height=m,a):new u(I,S,m)}},u.clone=function(t,e){if(n(t))return n(e)?(e.longitude=t.longitude,e.latitude=t.latitude,e.height=t.height,e):new u(t.longitude,t.latitude,t.height)},u.equals=function(t,e){return t===e||n(t)&&n(e)&&t.longitude===e.longitude&&t.latitude===e.latitude&&t.height===e.height},u.equalsEpsilon=function(t,e,r){return t===e||n(t)&&n(e)&&Math.abs(t.longitude-e.longitude)<=r&&Math.abs(t.latitude-e.latitude)<=r&&Math.abs(t.height-e.height)<=r},u.ZERO=a(new u(0,0,0)),u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.prototype.equalsEpsilon=function(t,e){return u.equalsEpsilon(this,t,e)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(t){"use strict";var e=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(t){return!1}}(),n=Object.defineProperties;return e&&t(n)||(n=function(t){return t}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,n,r,a,i,o,u,E){"use strict";function s(e,r,a,i){r=n(r,0),a=n(a,0),i=n(i,0),e._radii=new t(r,a,i),e._radiiSquared=new t(r*r,a*a,i*i),e._radiiToTheFourth=new t(r*r*r*r,a*a*a*a,i*i*i*i),e._oneOverRadii=new t(0===r?0:1/r,0===a?0:1/a,0===i?0:1/i),e._oneOverRadiiSquared=new t(0===r?0:1/(r*r),0===a?0:1/(a*a),0===i?0:1/(i*i)),e._minimumRadius=Math.min(r,a,i),e._maximumRadius=Math.max(r,a,i),e._centerToleranceSquared=u.EPSILON1,0!==e._radiiSquared.z&&(e._sqauredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function c(t,e,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,s(this,t,e,n)}a(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(e,n){if(r(e)){var a=e._radii;return r(n)?(t.clone(a,n._radii),t.clone(e._radiiSquared,n._radiiSquared),t.clone(e._radiiToTheFourth,n._radiiToTheFourth),t.clone(e._oneOverRadii,n._oneOverRadii),t.clone(e._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=e._minimumRadius,n._maximumRadius=e._maximumRadius,n._centerToleranceSquared=e._centerToleranceSquared,n):new c(a.x,a.y,a.z)}},c.fromCartesian3=function(t,e){return r(e)||(e=new c),r(t)?(s(e,t.x,t.y,t.z),e):e},c.WGS84=o(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=o(new c(1,1,1)),c.MOON=o(new c(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),c.prototype.clone=function(t){return c.clone(this,t)},c.packedLength=t.packedLength,c.pack=function(e,r,a){return a=n(a,0),t.pack(e._radii,r,a),r},c.unpack=function(e,r,a){r=n(r,0);var i=t.unpack(e,r);return c.fromCartesian3(i,a)},c.prototype.geocentricSurfaceNormal=t.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(e,n){var a=e.longitude,i=e.latitude,o=Math.cos(i),u=o*Math.cos(a),E=o*Math.sin(a),s=Math.sin(i);return r(n)||(n=new t),n.x=u,n.y=E,n.z=s,t.normalize(n,n)},c.prototype.geodeticSurfaceNormal=function(e,n){return r(n)||(n=new t),n=t.multiplyComponents(e,this._oneOverRadiiSquared,n),t.normalize(n,n)};var _=new t,T=new t;c.prototype.cartographicToCartesian=function(e,n){var a=_,i=T;this.geodeticSurfaceNormalCartographic(e,a),t.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(t.dot(a,i));return t.divideByScalar(i,o,i),t.multiplyByScalar(a,e.height,a),r(n)||(n=new t),t.add(i,a,n)},c.prototype.cartographicArrayToCartesianArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var a=0;a<n;a++)e[a]=this.cartographicToCartesian(t[a],e[a]);return e};var R=new t,l=new t,f=new t;return c.prototype.cartesianToCartographic=function(n,a){var i=this.scaleToGeodeticSurface(n,l);if(r(i)){var o=this.geodeticSurfaceNormal(i,R),E=t.subtract(n,i,f),s=Math.atan2(o.y,o.x),c=Math.asin(o.z),_=u.sign(t.dot(E,n))*t.magnitude(E);return r(a)?(a.longitude=s,a.latitude=c,a.height=_,a):new e(s,c,_)}},c.prototype.cartesianArrayToCartographicArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var a=0;a<n;++a)e[a]=this.cartesianToCartographic(t[a],e[a]);return e},c.prototype.scaleToGeodeticSurface=function(t,e){return E(t,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,e)},c.prototype.scaleToGeocentricSurface=function(e,n){r(n)||(n=new t);var a=e.x,i=e.y,o=e.z,u=this._oneOverRadiiSquared,E=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return t.multiplyByScalar(e,E,n)},c.prototype.transformPositionToScaledSpace=function(e,n){return r(n)||(n=new t),t.multiplyComponents(e,this._oneOverRadii,n)},c.prototype.transformPositionFromScaledSpace=function(e,n){return r(n)||(n=new t),t.multiplyComponents(e,this._radii,n)},c.prototype.equals=function(e){return this===e||r(e)&&t.equals(this._radii,e._radii)},c.prototype.toString=function(){return this._radii.toString()},c.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,a,i){a=n(a,0);var o=this._sqauredXOverSquaredZ;if(r(i)||(i=new t),i.x=0,i.y=0,i.z=e.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},c}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(t,e,n,r,a,i,o){"use strict";function u(t){this._ellipsoid=n(t,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(e,n){var a=this._semimajorAxis,i=e.longitude*a,o=e.latitude*a,u=e.height;return r(n)?(n.x=i,n.y=o,n.z=u,n):new t(i,o,u)},u.prototype.unproject=function(t,n){var a=this._oneOverSemimajorAxis,i=t.x*a,o=t.y*a,u=t.z;return r(n)?(n.longitude=i,n.latitude=o,n.height=u,n):new e(i,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(t){"use strict";var e={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return t(e)}),define("Core/Interval",["./defaultValue"],function(t){"use strict";function e(e,n){this.start=t(e,0),this.stop=t(n,0)}return e}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,a,i,o,u){"use strict";function E(t,e,r,a,i,o,u,E,s){this[0]=n(t,0),this[1]=n(a,0),this[2]=n(u,0),this[3]=n(e,0),this[4]=n(i,0),this[5]=n(E,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(s,0)}function s(t){for(var e=0,n=0;n<9;++n){var r=t[n];e+=r*r}return Math.sqrt(e)}function c(t){for(var e=0,n=0;n<3;++n){var r=t[E.getElementIndex(f[n],l[n])];e+=2*r*r}return Math.sqrt(e)}function _(t,e){for(var n=u.EPSILON15,r=0,a=1,i=0;i<3;++i){var o=Math.abs(t[E.getElementIndex(f[i],l[i])]);o>r&&(a=i,r=o)}var s=1,c=0,_=l[a],T=f[a];if(Math.abs(t[E.getElementIndex(T,_)])>n){var R,A=t[E.getElementIndex(T,T)],h=t[E.getElementIndex(_,_)],N=t[E.getElementIndex(T,_)],d=(A-h)/2/N;R=d<0?-1/(-d+Math.sqrt(1+d*d)):1/(d+Math.sqrt(1+d*d)),s=1/Math.sqrt(1+R*R),c=R*s}return e=E.clone(E.IDENTITY,e),e[E.getElementIndex(_,_)]=e[E.getElementIndex(T,T)]=s,e[E.getElementIndex(T,_)]=c,e[E.getElementIndex(_,T)]=-c,e}E.packedLength=9,E.pack=function(t,e,r){return r=n(r,0),e[r++]=t[0],e[r++]=t[1],e[r++]=t[2],e[r++]=t[3],e[r++]=t[4],e[r++]=t[5],e[r++]=t[6],e[r++]=t[7],e[r++]=t[8],e},E.unpack=function(t,e,a){return e=n(e,0),r(a)||(a=new E),a[0]=t[e++],a[1]=t[e++],a[2]=t[e++],a[3]=t[e++],a[4]=t[e++],a[5]=t[e++],a[6]=t[e++],a[7]=t[e++],a[8]=t[e++],a},E.clone=function(t,e){if(r(t))return r(e)?(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):new E(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8])},E.fromArray=function(t,e,a){return e=n(e,0),r(a)||(a=new E),a[0]=t[e],a[1]=t[e+1],a[2]=t[e+2],a[3]=t[e+3],a[4]=t[e+4],a[5]=t[e+5],a[6]=t[e+6],a[7]=t[e+7],a[8]=t[e+8],a},E.fromColumnMajorArray=function(t,e){return E.clone(t,e)},E.fromRowMajorArray=function(t,e){return r(e)?(e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],e):new E(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},E.fromQuaternion=function(t,e){var n=t.x*t.x,a=t.x*t.y,i=t.x*t.z,o=t.x*t.w,u=t.y*t.y,s=t.y*t.z,c=t.y*t.w,_=t.z*t.z,T=t.z*t.w,R=t.w*t.w,l=n-u-_+R,f=2*(a-T),A=2*(i+c),h=2*(a+T),N=-n+u-_+R,d=2*(s-o),I=2*(i-c),S=2*(s+o),m=-n-u+_+R;return r(e)?(e[0]=l,e[1]=h,e[2]=I,e[3]=f,e[4]=N,e[5]=S,e[6]=A,e[7]=d,e[8]=m,e):new E(l,f,A,h,N,d,I,S,m)},E.fromHeadingPitchRoll=function(t,e){var n=Math.cos(-t.pitch),a=Math.cos(-t.heading),i=Math.cos(t.roll),o=Math.sin(-t.pitch),u=Math.sin(-t.heading),s=Math.sin(t.roll),c=n*a,_=-i*u+s*o*a,T=s*u+i*o*a,R=n*u,l=i*a+s*o*u,f=-o*i+i*o*u,A=-o,h=s*n,N=i*n;return r(e)?(e[0]=c,e[1]=R,e[2]=A,e[3]=_,e[4]=l,e[5]=h,e[6]=T,e[7]=f,e[8]=N,e):new E(c,_,T,R,l,f,A,h,N)},E.fromScale=function(t,e){return r(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=t.y,e[5]=0,e[6]=0,e[7]=0,e[8]=t.z,e):new E(t.x,0,0,0,t.y,0,0,0,t.z)},E.fromUniformScale=function(t,e){return r(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=t,e[5]=0,e[6]=0,e[7]=0,e[8]=t,e):new E(t,0,0,0,t,0,0,0,t)},E.fromCrossProduct=function(t,e){return r(e)?(e[0]=0,e[1]=t.z,e[2]=-t.y,e[3]=-t.z,e[4]=0,e[5]=t.x,e[6]=t.y,e[7]=-t.x,e[8]=0,e):new E(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},E.fromRotationX=function(t,e){var n=Math.cos(t),a=Math.sin(t);return r(e)?(e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=n,e[5]=a,e[6]=0,e[7]=-a,e[8]=n,e):new E(1,0,0,0,n,-a,0,a,n)},E.fromRotationY=function(t,e){var n=Math.cos(t),a=Math.sin(t);return r(e)?(e[0]=n,e[1]=0,e[2]=-a,e[3]=0,e[4]=1,e[5]=0,e[6]=a,e[7]=0,e[8]=n,e):new E(n,0,a,0,1,0,-a,0,n)},E.fromRotationZ=function(t,e){var n=Math.cos(t),a=Math.sin(t);return r(e)?(e[0]=n,e[1]=a,e[2]=0,e[3]=-a,e[4]=n,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e):new E(n,-a,0,a,n,0,0,0,1)},E.toArray=function(t,e){return r(e)?(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):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},E.getElementIndex=function(t,e){return 3*t+e},E.getColumn=function(t,e,n){var r=3*e,a=t[r],i=t[r+1],o=t[r+2];return n.x=a,n.y=i,n.z=o,n},E.setColumn=function(t,e,n,r){r=E.clone(t,r);var a=3*e;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},E.getRow=function(t,e,n){var r=t[e],a=t[e+3],i=t[e+6];return n.x=r,n.y=a,n.z=i,n},E.setRow=function(t,e,n,r){return r=E.clone(t,r),r[e]=n.x,r[e+3]=n.y,r[e+6]=n.z,r};var T=new t;E.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],T)),n.y=t.magnitude(t.fromElements(e[3],e[4],e[5],T)),n.z=t.magnitude(t.fromElements(e[6],e[7],e[8],T)),n};var R=new t;E.getMaximumScale=function(e){return E.getScale(e,R),t.maximumComponent(R)},E.multiply=function(t,e,n){var r=t[0]*e[0]+t[3]*e[1]+t[6]*e[2],a=t[1]*e[0]+t[4]*e[1]+t[7]*e[2],i=t[2]*e[0]+t[5]*e[1]+t[8]*e[2],o=t[0]*e[3]+t[3]*e[4]+t[6]*e[5],u=t[1]*e[3]+t[4]*e[4]+t[7]*e[5],E=t[2]*e[3]+t[5]*e[4]+t[8]*e[5],s=t[0]*e[6]+t[3]*e[7]+t[6]*e[8],c=t[1]*e[6]+t[4]*e[7]+t[7]*e[8],_=t[2]*e[6]+t[5]*e[7]+t[8]*e[8];return n[0]=r,n[1]=a,n[2]=i,n[3]=o,n[4]=u,n[5]=E,n[6]=s,n[7]=c,n[8]=_,n},E.add=function(t,e,n){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n[4]=t[4]+e[4],n[5]=t[5]+e[5],n[6]=t[6]+e[6],n[7]=t[7]+e[7],n[8]=t[8]+e[8],n},E.subtract=function(t,e,n){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n[4]=t[4]-e[4],n[5]=t[5]-e[5],n[6]=t[6]-e[6],n[7]=t[7]-e[7],n[8]=t[8]-e[8],n},E.multiplyByVector=function(t,e,n){var r=e.x,a=e.y,i=e.z,o=t[0]*r+t[3]*a+t[6]*i,u=t[1]*r+t[4]*a+t[7]*i,E=t[2]*r+t[5]*a+t[8]*i;return n.x=o,n.y=u,n.z=E,n},E.multiplyByScalar=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n[4]=t[4]*e,n[5]=t[5]*e,n[6]=t[6]*e,n[7]=t[7]*e,n[8]=t[8]*e,n},E.multiplyByScale=function(t,e,n){return n[0]=t[0]*e.x,n[1]=t[1]*e.x,n[2]=t[2]*e.x,n[3]=t[3]*e.y,n[4]=t[4]*e.y,n[5]=t[5]*e.y,n[6]=t[6]*e.z,n[7]=t[7]*e.z,n[8]=t[8]*e.z,n},E.negate=function(t,e){return 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},E.transpose=function(t,e){var n=t[0],r=t[3],a=t[6],i=t[1],o=t[4],u=t[7],E=t[2],s=t[5],c=t[8];return e[0]=n,e[1]=r,e[2]=a,e[3]=i,e[4]=o,e[5]=u,e[6]=E,e[7]=s,e[8]=c,e};var l=[1,0,0],f=[2,2,1],A=new E,h=new E;return E.computeEigenDecomposition=function(t,e){var n=u.EPSILON20,a=10,i=0,o=0;r(e)||(e={});for(var T=e.unitary=E.clone(E.IDENTITY,e.unitary),R=e.diagonal=E.clone(t,e.diagonal),l=n*s(R);o<a&&c(R)>l;)_(R,A),E.transpose(A,h),E.multiply(R,A,R),E.multiply(h,R,R),E.multiply(T,A,T),++i>2&&(++o,i=0);return e},E.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e},E.determinant=function(t){var e=t[0],n=t[3],r=t[6],a=t[1],i=t[4],o=t[7],u=t[2],E=t[5],s=t[8];return e*(i*s-E*o)+a*(E*r-n*s)+u*(n*o-i*r)},E.inverse=function(t,e){var n=t[0],r=t[1],a=t[2],i=t[3],o=t[4],u=t[5],s=t[6],c=t[7],_=t[8],T=E.determinant(t);e[0]=o*_-c*u,e[1]=c*a-r*_,e[2]=r*u-o*a,e[3]=s*u-i*_,e[4]=n*_-s*a,e[5]=i*a-n*u,e[6]=i*c-s*o,e[7]=s*r-n*c,e[8]=n*o-i*r;var R=1/T;return E.multiplyByScalar(e,R,e)},E.equals=function(t,e){return t===e||r(t)&&r(e)&&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]},E.equalsEpsilon=function(t,e,n){return t===e||r(t)&&r(e)&&Math.abs(t[0]-e[0])<=n&&Math.abs(t[1]-e[1])<=n&&Math.abs(t[2]-e[2])<=n&&Math.abs(t[3]-e[3])<=n&&Math.abs(t[4]-e[4])<=n&&Math.abs(t[5]-e[5])<=n&&Math.abs(t[6]-e[6])<=n&&Math.abs(t[7]-e[7])<=n&&Math.abs(t[8]-e[8])<=n},E.IDENTITY=o(new E(1,0,0,0,1,0,0,0,1)),E.ZERO=o(new E(0,0,0,0,0,0,0,0,0)),E.COLUMN0ROW0=0,E.COLUMN0ROW1=1,E.COLUMN0ROW2=2,E.COLUMN1ROW0=3,E.COLUMN1ROW1=4,E.COLUMN1ROW2=5,E.COLUMN2ROW0=6,E.COLUMN2ROW1=7,E.COLUMN2ROW2=8,a(E.prototype,{length:{get:function(){return E.packedLength}}}),E.prototype.clone=function(t){return E.clone(this,t)},E.prototype.equals=function(t){return E.equals(this,t)},E.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]&&t[4]===e[n+4]&&t[5]===e[n+5]&&t[6]===e[n+6]&&t[7]===e[n+7]&&t[8]===e[n+8]},E.prototype.equalsEpsilon=function(t,e){return E.equalsEpsilon(this,t,e)},E.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},E}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,a,i){"use strict";function o(t,n,r,a){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0),this.w=e(a,0)}o.fromElements=function(t,e,r,a,i){return n(i)?(i.x=t,i.y=e,i.z=r,i.w=a,i):new o(t,e,r,a)},o.fromColor=function(t,e){return n(e)?(e.x=t.red,e.y=t.green,e.z=t.blue,e.w=t.alpha,e):new o(t.red,t.green,t.blue,t.alpha)},o.clone=function(t,e){if(n(t))return n(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e):new o(t.x,t.y,t.z,t.w)},o.packedLength=4,o.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w,n},o.unpack=function(t,r,a){return r=e(r,0),n(a)||(a=new o),a.x=t[r++],a.y=t[r++],a.z=t[r++],a.w=t[r],a},o.packArray=function(t,e){var r=t.length;n(e)?e.length=4*r:e=new Array(4*r);for(var a=0;a<r;++a)o.pack(t[a],e,4*a);return e},o.unpackArray=function(t,e){var r=t.length;n(e)?e.length=r/4:e=new Array(r/4);for(var a=0;a<r;a+=4){var i=a/4;e[i]=o.unpack(t,a,e[i])}return e},o.fromArray=o.unpack,o.maximumComponent=function(t){return Math.max(t.x,t.y,t.z,t.w)},o.minimumComponent=function(t){return Math.min(t.x,t.y,t.z,t.w)},o.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n.z=Math.min(t.z,e.z),n.w=Math.min(t.w,e.w),n},o.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n.z=Math.max(t.z,e.z),n.w=Math.max(t.w,e.w),n},o.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w},o.magnitude=function(t){return Math.sqrt(o.magnitudeSquared(t))};var u=new o;o.distance=function(t,e){return o.subtract(t,e,u),o.magnitude(u)},o.distanceSquared=function(t,e){return o.subtract(t,e,u),o.magnitudeSquared(u)},o.normalize=function(t,e){var n=o.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e.w=t.w/n,e},o.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z+t.w*e.w},o.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n.z=t.z*e.z,n.w=t.w*e.w,n},o.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n.z=t.z/e.z,n.w=t.w/e.w,n},o.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n.w=t.w+e.w,n},o.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n.w=t.w-e.w,n},o.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*e,n.w=t.w*e,n},o.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n.w=t.w/e,n},o.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e.w=-t.w,e},o.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e.w=Math.abs(t.w),e};var E=new o;o.lerp=function(t,e,n,r){return o.multiplyByScalar(e,n,E),r=o.multiplyByScalar(t,1-n,r),o.add(E,r,r)};var s=new o;return o.mostOrthogonalAxis=function(t,e){var n=o.normalize(t,s);return o.abs(n,n),e=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,e):o.clone(o.UNIT_W,e):n.z<=n.w?o.clone(o.UNIT_Z,e):o.clone(o.UNIT_W,e):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,e):o.clone(o.UNIT_W,e):n.z<=n.w?o.clone(o.UNIT_Z,e):o.clone(o.UNIT_W,e)},o.equals=function(t,e){return t===e||n(t)&&n(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z&&t.w===e.w},o.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]&&t.w===e[n+3]},o.equalsEpsilon=function(t,e,r,a){return t===e||n(t)&&n(e)&&i.equalsEpsilon(t.x,e.x,r,a)&&i.equalsEpsilon(t.y,e.y,r,a)&&i.equalsEpsilon(t.z,e.z,r,a)&&i.equalsEpsilon(t.w,e.w,r,a)},o.ZERO=a(new o(0,0,0,0)),o.UNIT_X=a(new o(1,0,0,0)),o.UNIT_Y=a(new o(0,1,0,0)),o.UNIT_Z=a(new o(0,0,1,0)),o.UNIT_W=a(new o(0,0,0,1)),o.prototype.clone=function(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.prototype.equalsEpsilon=function(t,e,n){return o.equalsEpsilon(this,t,e,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(t){"use strict";function e(t){this.name="RuntimeError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(t,e,n,r,a,i,o,u,E,s,c){ +"use strict";function _(t,e,n,a,i,o,u,E,s,c,_,T,R,l,f,A){this[0]=r(t,0),this[1]=r(i,0),this[2]=r(s,0),this[3]=r(R,0),this[4]=r(e,0),this[5]=r(o,0),this[6]=r(c,0),this[7]=r(l,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(_,0),this[11]=r(f,0),this[12]=r(a,0),this[13]=r(E,0),this[14]=r(T,0),this[15]=r(A,0)}_.packedLength=16,_.pack=function(t,e,n){return n=r(n,0),e[n++]=t[0],e[n++]=t[1],e[n++]=t[2],e[n++]=t[3],e[n++]=t[4],e[n++]=t[5],e[n++]=t[6],e[n++]=t[7],e[n++]=t[8],e[n++]=t[9],e[n++]=t[10],e[n++]=t[11],e[n++]=t[12],e[n++]=t[13],e[n++]=t[14],e[n]=t[15],e},_.unpack=function(t,e,n){return e=r(e,0),a(n)||(n=new _),n[0]=t[e++],n[1]=t[e++],n[2]=t[e++],n[3]=t[e++],n[4]=t[e++],n[5]=t[e++],n[6]=t[e++],n[7]=t[e++],n[8]=t[e++],n[9]=t[e++],n[10]=t[e++],n[11]=t[e++],n[12]=t[e++],n[13]=t[e++],n[14]=t[e++],n[15]=t[e],n},_.clone=function(t,e){if(a(t))return a(e)?(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],e):new _(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15])},_.fromArray=_.unpack,_.fromColumnMajorArray=function(t,e){return _.clone(t,e)},_.fromRowMajorArray=function(t,e){return a(e)?(e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15],e):new _(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},_.fromRotationTranslation=function(e,n,i){return n=r(n,t.ZERO),a(i)?(i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=0,i[4]=e[3],i[5]=e[4],i[6]=e[5],i[7]=0,i[8]=e[6],i[9]=e[7],i[10]=e[8],i[11]=0,i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=1,i):new _(e[0],e[3],e[6],n.x,e[1],e[4],e[7],n.y,e[2],e[5],e[8],n.z,0,0,0,1)},_.fromTranslationQuaternionRotationScale=function(t,e,n,r){a(r)||(r=new _);var i=n.x,o=n.y,u=n.z,E=e.x*e.x,s=e.x*e.y,c=e.x*e.z,T=e.x*e.w,R=e.y*e.y,l=e.y*e.z,f=e.y*e.w,A=e.z*e.z,h=e.z*e.w,N=e.w*e.w,d=E-R-A+N,I=2*(s-h),S=2*(c+f),m=2*(s+h),O=-E+R-A+N,M=2*(l-T),y=2*(c-f),p=2*(l+T),C=-E-R+A+N;return r[0]=d*i,r[1]=m*i,r[2]=y*i,r[3]=0,r[4]=I*o,r[5]=O*o,r[6]=p*o,r[7]=0,r[8]=S*u,r[9]=M*u,r[10]=C*u,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,r},_.fromTranslationRotationScale=function(t,e){return _.fromTranslationQuaternionRotationScale(t.translation,t.rotation,t.scale,e)},_.fromTranslation=function(t,e){return _.fromRotationTranslation(s.IDENTITY,t,e)},_.fromScale=function(t,e){return a(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t.y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t.z,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new _(t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1)},_.fromUniformScale=function(t,e){return a(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new _(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1)};var T=new t,R=new t,l=new t;_.fromCamera=function(e,n){var r=e.position,i=e.direction,o=e.up;t.normalize(i,T),t.normalize(t.cross(T,o,R),R),t.normalize(t.cross(R,T,l),l);var u=R.x,E=R.y,s=R.z,c=T.x,f=T.y,A=T.z,h=l.x,N=l.y,d=l.z,I=r.x,S=r.y,m=r.z,O=u*-I+E*-S+s*-m,M=h*-I+N*-S+d*-m,y=c*I+f*S+A*m;return a(n)?(n[0]=u,n[1]=h,n[2]=-c,n[3]=0,n[4]=E,n[5]=N,n[6]=-f,n[7]=0,n[8]=s,n[9]=d,n[10]=-A,n[11]=0,n[12]=O,n[13]=M,n[14]=y,n[15]=1,n):new _(u,E,s,O,h,N,d,M,-c,-f,-A,y,0,0,0,1)},_.computePerspectiveFieldOfView=function(t,e,n,r,a){var i=Math.tan(.5*t),o=1/i,u=o/e,E=(r+n)/(n-r),s=2*r*n/(n-r);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=E,a[11]=-1,a[12]=0,a[13]=0,a[14]=s,a[15]=0,a},_.computeOrthographicOffCenter=function(t,e,n,r,a,i,o){var u=1/(e-t),E=1/(r-n),s=1/(i-a),c=-(e+t)*u,_=-(r+n)*E,T=-(i+a)*s;return u*=2,E*=2,s*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=s,o[11]=0,o[12]=c,o[13]=_,o[14]=T,o[15]=1,o},_.computePerspectiveOffCenter=function(t,e,n,r,a,i,o){var u=2*a/(e-t),E=2*a/(r-n),s=(e+t)/(e-t),c=(r+n)/(r-n),_=-(i+a)/(i-a),T=-1,R=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=s,o[9]=c,o[10]=_,o[11]=T,o[12]=0,o[13]=0,o[14]=R,o[15]=0,o},_.computeInfinitePerspectiveOffCenter=function(t,e,n,r,a,i){var o=2*a/(e-t),u=2*a/(r-n),E=(e+t)/(e-t),s=(r+n)/(r-n),c=-1,_=-1,T=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=E,i[9]=s,i[10]=c,i[11]=_,i[12]=0,i[13]=0,i[14]=T,i[15]=0,i},_.computeViewportTransformation=function(t,e,n,a){t=r(t,r.EMPTY_OBJECT);var i=r(t.x,0),o=r(t.y,0),u=r(t.width,0),E=r(t.height,0);e=r(e,0),n=r(n,1);var s=.5*u,c=.5*E,_=.5*(n-e),T=s,R=c,l=_,f=i+s,A=o+c,h=e+_,N=1;return a[0]=T,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=R,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=l,a[11]=0,a[12]=f,a[13]=A,a[14]=h,a[15]=N,a},_.computeView=function(e,n,r,a,i){return i[0]=a.x,i[1]=r.x,i[2]=-n.x,i[3]=0,i[4]=a.y,i[5]=r.y,i[6]=-n.y,i[7]=0,i[8]=a.z,i[9]=r.z,i[10]=-n.z,i[11]=0,i[12]=-t.dot(a,e),i[13]=-t.dot(r,e),i[14]=t.dot(n,e),i[15]=1,i},_.toArray=function(t,e){return a(e)?(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],e):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]},_.getElementIndex=function(t,e){return 4*t+e},_.getColumn=function(t,e,n){var r=4*e,a=t[r],i=t[r+1],o=t[r+2],u=t[r+3];return n.x=a,n.y=i,n.z=o,n.w=u,n},_.setColumn=function(t,e,n,r){r=_.clone(t,r);var a=4*e;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r[a+3]=n.w,r},_.setTranslation=function(t,e,n){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=t[15],n},_.getRow=function(t,e,n){var r=t[e],a=t[e+4],i=t[e+8],o=t[e+12];return n.x=r,n.y=a,n.z=i,n.w=o,n},_.setRow=function(t,e,n,r){return r=_.clone(t,r),r[e]=n.x,r[e+4]=n.y,r[e+8]=n.z,r[e+12]=n.w,r};var f=new t;_.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],f)),n.y=t.magnitude(t.fromElements(e[4],e[5],e[6],f)),n.z=t.magnitude(t.fromElements(e[8],e[9],e[10],f)),n};var A=new t;_.getMaximumScale=function(e){return _.getScale(e,A),t.maximumComponent(A)},_.multiply=function(t,e,n){var r=t[0],a=t[1],i=t[2],o=t[3],u=t[4],E=t[5],s=t[6],c=t[7],_=t[8],T=t[9],R=t[10],l=t[11],f=t[12],A=t[13],h=t[14],N=t[15],d=e[0],I=e[1],S=e[2],m=e[3],O=e[4],M=e[5],y=e[6],p=e[7],C=e[8],U=e[9],L=e[10],F=e[11],g=e[12],P=e[13],v=e[14],w=e[15],x=r*d+u*I+_*S+f*m,D=a*d+E*I+T*S+A*m,B=i*d+s*I+R*S+h*m,z=o*d+c*I+l*S+N*m,G=r*O+u*M+_*y+f*p,b=a*O+E*M+T*y+A*p,X=i*O+s*M+R*y+h*p,V=o*O+c*M+l*y+N*p,q=r*C+u*U+_*L+f*F,H=a*C+E*U+T*L+A*F,W=i*C+s*U+R*L+h*F,Y=o*C+c*U+l*L+N*F,k=r*g+u*P+_*v+f*w,K=a*g+E*P+T*v+A*w,Z=i*g+s*P+R*v+h*w,j=o*g+c*P+l*v+N*w;return n[0]=x,n[1]=D,n[2]=B,n[3]=z,n[4]=G,n[5]=b,n[6]=X,n[7]=V,n[8]=q,n[9]=H,n[10]=W,n[11]=Y,n[12]=k,n[13]=K,n[14]=Z,n[15]=j,n},_.add=function(t,e,n){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n[4]=t[4]+e[4],n[5]=t[5]+e[5],n[6]=t[6]+e[6],n[7]=t[7]+e[7],n[8]=t[8]+e[8],n[9]=t[9]+e[9],n[10]=t[10]+e[10],n[11]=t[11]+e[11],n[12]=t[12]+e[12],n[13]=t[13]+e[13],n[14]=t[14]+e[14],n[15]=t[15]+e[15],n},_.subtract=function(t,e,n){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n[4]=t[4]-e[4],n[5]=t[5]-e[5],n[6]=t[6]-e[6],n[7]=t[7]-e[7],n[8]=t[8]-e[8],n[9]=t[9]-e[9],n[10]=t[10]-e[10],n[11]=t[11]-e[11],n[12]=t[12]-e[12],n[13]=t[13]-e[13],n[14]=t[14]-e[14],n[15]=t[15]-e[15],n},_.multiplyTransformation=function(t,e,n){var r=t[0],a=t[1],i=t[2],o=t[4],u=t[5],E=t[6],s=t[8],c=t[9],_=t[10],T=t[12],R=t[13],l=t[14],f=e[0],A=e[1],h=e[2],N=e[4],d=e[5],I=e[6],S=e[8],m=e[9],O=e[10],M=e[12],y=e[13],p=e[14],C=r*f+o*A+s*h,U=a*f+u*A+c*h,L=i*f+E*A+_*h,F=r*N+o*d+s*I,g=a*N+u*d+c*I,P=i*N+E*d+_*I,v=r*S+o*m+s*O,w=a*S+u*m+c*O,x=i*S+E*m+_*O,D=r*M+o*y+s*p+T,B=a*M+u*y+c*p+R,z=i*M+E*y+_*p+l;return n[0]=C,n[1]=U,n[2]=L,n[3]=0,n[4]=F,n[5]=g,n[6]=P,n[7]=0,n[8]=v,n[9]=w,n[10]=x,n[11]=0,n[12]=D,n[13]=B,n[14]=z,n[15]=1,n},_.multiplyByMatrix3=function(t,e,n){var r=t[0],a=t[1],i=t[2],o=t[4],u=t[5],E=t[6],s=t[8],c=t[9],_=t[10],T=e[0],R=e[1],l=e[2],f=e[3],A=e[4],h=e[5],N=e[6],d=e[7],I=e[8],S=r*T+o*R+s*l,m=a*T+u*R+c*l,O=i*T+E*R+_*l,M=r*f+o*A+s*h,y=a*f+u*A+c*h,p=i*f+E*A+_*h,C=r*N+o*d+s*I,U=a*N+u*d+c*I,L=i*N+E*d+_*I;return n[0]=S,n[1]=m,n[2]=O,n[3]=0,n[4]=M,n[5]=y,n[6]=p,n[7]=0,n[8]=C,n[9]=U,n[10]=L,n[11]=0,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n},_.multiplyByTranslation=function(t,e,n){var r=e.x,a=e.y,i=e.z,o=r*t[0]+a*t[4]+i*t[8]+t[12],u=r*t[1]+a*t[5]+i*t[9]+t[13],E=r*t[2]+a*t[6]+i*t[10]+t[14];return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=o,n[13]=u,n[14]=E,n[15]=t[15],n};var h=new t;_.multiplyByUniformScale=function(t,e,n){return h.x=e,h.y=e,h.z=e,_.multiplyByScale(t,h,n)},_.multiplyByScale=function(t,e,n){var r=e.x,a=e.y,i=e.z;return 1===r&&1===a&&1===i?_.clone(t,n):(n[0]=r*t[0],n[1]=r*t[1],n[2]=r*t[2],n[3]=0,n[4]=a*t[4],n[5]=a*t[5],n[6]=a*t[6],n[7]=0,n[8]=i*t[8],n[9]=i*t[9],n[10]=i*t[10],n[11]=0,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=1,n)},_.multiplyByVector=function(t,e,n){var r=e.x,a=e.y,i=e.z,o=e.w,u=t[0]*r+t[4]*a+t[8]*i+t[12]*o,E=t[1]*r+t[5]*a+t[9]*i+t[13]*o,s=t[2]*r+t[6]*a+t[10]*i+t[14]*o,c=t[3]*r+t[7]*a+t[11]*i+t[15]*o;return n.x=u,n.y=E,n.z=s,n.w=c,n},_.multiplyByPointAsVector=function(t,e,n){var r=e.x,a=e.y,i=e.z,o=t[0]*r+t[4]*a+t[8]*i,u=t[1]*r+t[5]*a+t[9]*i,E=t[2]*r+t[6]*a+t[10]*i;return n.x=o,n.y=u,n.z=E,n},_.multiplyByPoint=function(t,e,n){var r=e.x,a=e.y,i=e.z,o=t[0]*r+t[4]*a+t[8]*i+t[12],u=t[1]*r+t[5]*a+t[9]*i+t[13],E=t[2]*r+t[6]*a+t[10]*i+t[14];return n.x=o,n.y=u,n.z=E,n},_.multiplyByScalar=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n[4]=t[4]*e,n[5]=t[5]*e,n[6]=t[6]*e,n[7]=t[7]*e,n[8]=t[8]*e,n[9]=t[9]*e,n[10]=t[10]*e,n[11]=t[11]*e,n[12]=t[12]*e,n[13]=t[13]*e,n[14]=t[14]*e,n[15]=t[15]*e,n},_.negate=function(t,e){return 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],e},_.transpose=function(t,e){var n=t[1],r=t[2],a=t[3],i=t[6],o=t[7],u=t[11];return e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=r,e[9]=i,e[10]=t[10],e[11]=t[14],e[12]=a,e[13]=o,e[14]=u,e[15]=t[15],e},_.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e[9]=Math.abs(t[9]),e[10]=Math.abs(t[10]),e[11]=Math.abs(t[11]),e[12]=Math.abs(t[12]),e[13]=Math.abs(t[13]),e[14]=Math.abs(t[14]),e[15]=Math.abs(t[15]),e},_.equals=function(t,e){return t===e||a(t)&&a(e)&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[3]===e[3]&&t[7]===e[7]&&t[11]===e[11]&&t[15]===e[15]},_.equalsEpsilon=function(t,e,n){return t===e||a(t)&&a(e)&&Math.abs(t[0]-e[0])<=n&&Math.abs(t[1]-e[1])<=n&&Math.abs(t[2]-e[2])<=n&&Math.abs(t[3]-e[3])<=n&&Math.abs(t[4]-e[4])<=n&&Math.abs(t[5]-e[5])<=n&&Math.abs(t[6]-e[6])<=n&&Math.abs(t[7]-e[7])<=n&&Math.abs(t[8]-e[8])<=n&&Math.abs(t[9]-e[9])<=n&&Math.abs(t[10]-e[10])<=n&&Math.abs(t[11]-e[11])<=n&&Math.abs(t[12]-e[12])<=n&&Math.abs(t[13]-e[13])<=n&&Math.abs(t[14]-e[14])<=n&&Math.abs(t[15]-e[15])<=n},_.getTranslation=function(t,e){return e.x=t[12],e.y=t[13],e.z=t[14],e},_.getRotation=function(t,e){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e};var N=new s,d=new s,I=new e,S=new e(0,0,0,1);return _.inverse=function(t,n){if(s.equalsEpsilon(_.getRotation(t,N),d,E.EPSILON7)&&e.equals(_.getRow(t,3,I),S))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-t[12],n[13]=-t[13],n[14]=-t[14],n[15]=1,n;var r=t[0],a=t[4],i=t[8],o=t[12],u=t[1],T=t[5],R=t[9],l=t[13],f=t[2],A=t[6],h=t[10],m=t[14],O=t[3],M=t[7],y=t[11],p=t[15],C=h*p,U=m*y,L=A*p,F=m*M,g=A*y,P=h*M,v=f*p,w=m*O,x=f*y,D=h*O,B=f*M,z=A*O,G=C*T+F*R+g*l-(U*T+L*R+P*l),b=U*u+v*R+D*l-(C*u+w*R+x*l),X=L*u+w*T+B*l-(F*u+v*T+z*l),V=P*u+x*T+z*R-(g*u+D*T+B*R),q=U*a+L*i+P*o-(C*a+F*i+g*o),H=C*r+w*i+x*o-(U*r+v*i+D*o),W=F*r+v*a+z*o-(L*r+w*a+B*o),Y=g*r+D*a+B*i-(P*r+x*a+z*i);C=i*l,U=o*R,L=a*l,F=o*T,g=a*R,P=i*T,v=r*l,w=o*u,x=r*R,D=i*u,B=r*T,z=a*u;var k=C*M+F*y+g*p-(U*M+L*y+P*p),K=U*O+v*y+D*p-(C*O+w*y+x*p),Z=L*O+w*M+B*p-(F*O+v*M+z*p),j=P*O+x*M+z*y-(g*O+D*M+B*y),Q=L*h+P*m+U*A-(g*m+C*A+F*h),J=x*m+C*f+w*h-(v*h+D*m+U*f),$=v*A+z*m+F*f-(B*m+L*f+w*A),tt=B*h+g*f+D*A-(x*A+z*h+P*f),et=r*G+a*b+i*X+o*V;if(Math.abs(et)<E.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return et=1/et,n[0]=G*et,n[1]=b*et,n[2]=X*et,n[3]=V*et,n[4]=q*et,n[5]=H*et,n[6]=W*et,n[7]=Y*et,n[8]=k*et,n[9]=K*et,n[10]=Z*et,n[11]=j*et,n[12]=Q*et,n[13]=J*et,n[14]=$*et,n[15]=tt*et,n},_.inverseTransformation=function(t,e){var n=t[0],r=t[1],a=t[2],i=t[4],o=t[5],u=t[6],E=t[8],s=t[9],c=t[10],_=t[12],T=t[13],R=t[14],l=-n*_-r*T-a*R,f=-i*_-o*T-u*R,A=-E*_-s*T-c*R;return e[0]=n,e[1]=i,e[2]=E,e[3]=0,e[4]=r,e[5]=o,e[6]=s,e[7]=0,e[8]=a,e[9]=u,e[10]=c,e[11]=0,e[12]=l,e[13]=f,e[14]=A,e[15]=1,e},_.IDENTITY=u(new _(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),_.ZERO=u(new _(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),_.COLUMN0ROW0=0,_.COLUMN0ROW1=1,_.COLUMN0ROW2=2,_.COLUMN0ROW3=3,_.COLUMN1ROW0=4,_.COLUMN1ROW1=5,_.COLUMN1ROW2=6,_.COLUMN1ROW3=7,_.COLUMN2ROW0=8,_.COLUMN2ROW1=9,_.COLUMN2ROW2=10,_.COLUMN2ROW3=11,_.COLUMN3ROW0=12,_.COLUMN3ROW1=13,_.COLUMN3ROW2=14,_.COLUMN3ROW3=15,i(_.prototype,{length:{get:function(){return _.packedLength}}}),_.prototype.clone=function(t){return _.clone(this,t)},_.prototype.equals=function(t){return _.equals(this,t)},_.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]&&t[4]===e[n+4]&&t[5]===e[n+5]&&t[6]===e[n+6]&&t[7]===e[n+7]&&t[8]===e[n+8]&&t[9]===e[n+9]&&t[10]===e[n+10]&&t[11]===e[n+11]&&t[12]===e[n+12]&&t[13]===e[n+13]&&t[14]===e[n+14]&&t[15]===e[n+15]},_.prototype.equalsEpsilon=function(t,e){return _.equalsEpsilon(this,t,e)},_.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]+")"},_}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(t,e,n,r,a,i,o,u,E){"use strict";function s(t,e,r,a){this.west=n(t,0),this.south=n(e,0),this.east=n(r,0),this.north=n(a,0)}a(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(t,e,r){return r=n(r,0),e[r++]=t.west,e[r++]=t.south,e[r++]=t.east,e[r]=t.north,e},s.unpack=function(t,e,a){return e=n(e,0),r(a)||(a=new s),a.west=t[e++],a.south=t[e++],a.east=t[e++],a.north=t[e],a},s.computeWidth=function(t){var e=t.east,n=t.west;return e<n&&(e+=E.TWO_PI),e-n},s.computeHeight=function(t){return t.north-t.south},s.fromDegrees=function(t,e,a,i,o){return t=E.toRadians(n(t,0)),e=E.toRadians(n(e,0)),a=E.toRadians(n(a,0)),i=E.toRadians(n(i,0)),r(o)?(o.west=t,o.south=e,o.east=a,o.north=i,o):new s(t,e,a,i)},s.fromRadians=function(t,e,a,i,o){return r(o)?(o.west=n(t,0),o.south=n(e,0),o.east=n(a,0),o.north=n(i,0),o):new s(t,e,a,i)},s.fromCartographicArray=function(t,e){for(var n=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,u=Number.MAX_VALUE,c=-Number.MAX_VALUE,_=0,T=t.length;_<T;_++){var R=t[_];n=Math.min(n,R.longitude),a=Math.max(a,R.longitude),u=Math.min(u,R.latitude),c=Math.max(c,R.latitude);var l=R.longitude>=0?R.longitude:R.longitude+E.TWO_PI;i=Math.min(i,l),o=Math.max(o,l)}return a-n>o-i&&(n=i,a=o,a>E.PI&&(a-=E.TWO_PI),n>E.PI&&(n-=E.TWO_PI)),r(e)?(e.west=n,e.south=u,e.east=a,e.north=c,e):new s(n,u,a,c)},s.fromCartesianArray=function(t,e,n){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,u=-Number.MAX_VALUE,c=Number.MAX_VALUE,_=-Number.MAX_VALUE,T=0,R=t.length;T<R;T++){var l=e.cartesianToCartographic(t[T]);a=Math.min(a,l.longitude),i=Math.max(i,l.longitude),c=Math.min(c,l.latitude),_=Math.max(_,l.latitude);var f=l.longitude>=0?l.longitude:l.longitude+E.TWO_PI;o=Math.min(o,f),u=Math.max(u,f)}return i-a>u-o&&(a=o,i=u,i>E.PI&&(i-=E.TWO_PI),a>E.PI&&(a-=E.TWO_PI)),r(n)?(n.west=a,n.south=c,n.east=i,n.north=_,n):new s(a,c,i,_)},s.clone=function(t,e){if(r(t))return r(e)?(e.west=t.west,e.south=t.south,e.east=t.east,e.north=t.north,e):new s(t.west,t.south,t.east,t.north)},s.prototype.clone=function(t){return s.clone(this,t)},s.prototype.equals=function(t){return s.equals(this,t)},s.equals=function(t,e){return t===e||r(t)&&r(e)&&t.west===e.west&&t.south===e.south&&t.east===e.east&&t.north===e.north},s.prototype.equalsEpsilon=function(t,e){return r(t)&&Math.abs(this.west-t.west)<=e&&Math.abs(this.south-t.south)<=e&&Math.abs(this.east-t.east)<=e&&Math.abs(this.north-t.north)<=e},s.validate=function(t){},s.southwest=function(e,n){return r(n)?(n.longitude=e.west,n.latitude=e.south,n.height=0,n):new t(e.west,e.south)},s.northwest=function(e,n){return r(n)?(n.longitude=e.west,n.latitude=e.north,n.height=0,n):new t(e.west,e.north)},s.northeast=function(e,n){return r(n)?(n.longitude=e.east,n.latitude=e.north,n.height=0,n):new t(e.east,e.north)},s.southeast=function(e,n){return r(n)?(n.longitude=e.east,n.latitude=e.south,n.height=0,n):new t(e.east,e.south)},s.center=function(e,n){var a=e.east,i=e.west;a<i&&(a+=E.TWO_PI);var o=E.negativePiToPi(.5*(i+a)),u=.5*(e.south+e.north);return r(n)?(n.longitude=o,n.latitude=u,n.height=0,n):new t(o,u)},s.intersection=function(t,e,n){var a=t.east,i=t.west,o=e.east,u=e.west;a<i&&o>0?a+=E.TWO_PI:o<u&&a>0&&(o+=E.TWO_PI),a<i&&u<0?u+=E.TWO_PI:o<u&&i<0&&(i+=E.TWO_PI);var c=E.negativePiToPi(Math.max(i,u)),_=E.negativePiToPi(Math.min(a,o));if(!((t.west<t.east||e.west<e.east)&&_<=c)){var T=Math.max(t.south,e.south),R=Math.min(t.north,e.north);if(!(T>=R))return r(n)?(n.west=c,n.south=T,n.east=_,n.north=R,n):new s(c,T,_,R)}},s.simpleIntersection=function(t,e,n){var a=Math.max(t.west,e.west),i=Math.max(t.south,e.south),o=Math.min(t.east,e.east),u=Math.min(t.north,e.north);if(!(i>=u||a>=o))return r(n)?(n.west=a,n.south=i,n.east=o,n.north=u,n):new s(a,i,o,u)},s.union=function(t,e,n){r(n)||(n=new s);var a=t.east,i=t.west,o=e.east,u=e.west;a<i&&o>0?a+=E.TWO_PI:o<u&&a>0&&(o+=E.TWO_PI),a<i&&u<0?u+=E.TWO_PI:o<u&&i<0&&(i+=E.TWO_PI);var c=E.convertLongitudeRange(Math.min(i,u)),_=E.convertLongitudeRange(Math.max(a,o));return n.west=c,n.south=Math.min(t.south,e.south),n.east=_,n.north=Math.max(t.north,e.north),n},s.expand=function(t,e,n){return r(n)||(n=new s),n.west=Math.min(t.west,e.longitude),n.south=Math.min(t.south,e.latitude),n.east=Math.max(t.east,e.longitude),n.north=Math.max(t.north,e.latitude),n},s.contains=function(t,e){var n=e.longitude,r=e.latitude,a=t.west,i=t.east;return i<a&&(i+=E.TWO_PI,n<0&&(n+=E.TWO_PI)),(n>a||E.equalsEpsilon(n,a,E.EPSILON14))&&(n<i||E.equalsEpsilon(n,i,E.EPSILON14))&&r>=t.south&&r<=t.north};var c=new t;return s.subsample=function(t,e,a,i){e=n(e,o.WGS84),a=n(a,0),r(i)||(i=[]);var u=0,_=t.north,T=t.south,R=t.east,l=t.west,f=c;f.height=a,f.longitude=l,f.latitude=_,i[u]=e.cartographicToCartesian(f,i[u]),u++,f.longitude=R,i[u]=e.cartographicToCartesian(f,i[u]),u++,f.latitude=T,i[u]=e.cartographicToCartesian(f,i[u]),u++,f.longitude=l,i[u]=e.cartographicToCartesian(f,i[u]),u++,_<0?f.latitude=_:T>0?f.latitude=T:f.latitude=0;for(var A=1;A<8;++A)f.longitude=-Math.PI+A*E.PI_OVER_TWO,s.contains(t,f)&&(i[u]=e.cartographicToCartesian(f,i[u]),u++);return 0===f.latitude&&(f.longitude=l,i[u]=e.cartographicToCartesian(f,i[u]),u++,f.longitude=R,i[u]=e.cartographicToCartesian(f,i[u]),u++),i.length=u,i},s.MAX_VALUE=u(new s(-Math.PI,-E.PI_OVER_TWO,Math.PI,E.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(t,e,n,r,a,i,o,u,E,s,c,_){"use strict";function T(e,n){this.center=t.clone(r(e,t.ZERO)),this.radius=r(n,0)}var R=new t,l=new t,f=new t,A=new t,h=new t,N=new t,d=new t,I=new t,S=new t,m=new t,O=new t,M=new t;T.fromPoints=function(e,n){if(a(n)||(n=new T),!a(e)||0===e.length)return n.center=t.clone(t.ZERO,n.center),n.radius=0,n;for(var r=t.clone(e[0],d),i=t.clone(r,R),o=t.clone(r,l),u=t.clone(r,f),E=t.clone(r,A),s=t.clone(r,h),c=t.clone(r,N),_=e.length,y=1;y<_;y++){t.clone(e[y],r);var p=r.x,C=r.y,U=r.z;p<i.x&&t.clone(r,i),p>E.x&&t.clone(r,E),C<o.y&&t.clone(r,o),C>s.y&&t.clone(r,s),U<u.z&&t.clone(r,u),U>c.z&&t.clone(r,c)}var L=t.magnitudeSquared(t.subtract(E,i,I)),F=t.magnitudeSquared(t.subtract(s,o,I)),g=t.magnitudeSquared(t.subtract(c,u,I)),P=i,v=E,w=L;F>w&&(w=F,P=o,v=s),g>w&&(w=g,P=u,v=c);var x=S;x.x=.5*(P.x+v.x),x.y=.5*(P.y+v.y),x.z=.5*(P.z+v.z);var D=t.magnitudeSquared(t.subtract(v,x,I)),B=Math.sqrt(D),z=m;z.x=i.x,z.y=o.y,z.z=u.z;var G=O;G.x=E.x,G.y=s.y,G.z=c.z;var b=t.multiplyByScalar(t.add(z,G,I),.5,M),X=0;for(y=0;y<_;y++){t.clone(e[y],r);var V=t.magnitude(t.subtract(r,b,I));V>X&&(X=V);var q=t.magnitudeSquared(t.subtract(r,x,I));if(q>D){var H=Math.sqrt(q);B=.5*(B+H),D=B*B;var W=H-B;x.x=(B*x.x+W*r.x)/H,x.y=(B*x.y+W*r.y)/H,x.z=(B*x.z+W*r.z)/H}}return B<X?(t.clone(x,n.center),n.radius=B):(t.clone(b,n.center),n.radius=X),n};var y=new o,p=new t,C=new t,U=new e,L=new e;T.fromRectangle2D=function(t,e,n){return T.fromRectangleWithHeights2D(t,e,0,0,n)},T.fromRectangleWithHeights2D=function(e,n,i,o,u){if(a(u)||(u=new T),!a(e))return u.center=t.clone(t.ZERO,u.center),u.radius=0,u;n=r(n,y),_.southwest(e,U),U.height=i,_.northeast(e,L),L.height=o;var E=n.project(U,p),s=n.project(L,C),c=s.x-E.x,R=s.y-E.y,l=s.z-E.z;u.radius=.5*Math.sqrt(c*c+R*R+l*l);var f=u.center;return f.x=E.x+.5*c,f.y=E.y+.5*R,f.z=E.z+.5*l,u};var F=[];T.fromRectangle3D=function(t,e,n,o){e=r(e,i.WGS84),n=r(n,0);var u;return a(t)&&(u=_.subsample(t,e,n,F)),T.fromPoints(u,o)},T.fromVertices=function(e,n,i,o){if(a(o)||(o=new T),!a(e)||0===e.length)return o.center=t.clone(t.ZERO,o.center),o.radius=0,o;n=r(n,t.ZERO),i=r(i,3);var u=d;u.x=e[0]+n.x,u.y=e[1]+n.y,u.z=e[2]+n.z;for(var E=t.clone(u,R),s=t.clone(u,l),c=t.clone(u,f),_=t.clone(u,A),y=t.clone(u,h),p=t.clone(u,N),C=e.length,U=0;U<C;U+=i){var L=e[U]+n.x,F=e[U+1]+n.y,g=e[U+2]+n.z;u.x=L,u.y=F,u.z=g,L<E.x&&t.clone(u,E),L>_.x&&t.clone(u,_),F<s.y&&t.clone(u,s),F>y.y&&t.clone(u,y),g<c.z&&t.clone(u,c),g>p.z&&t.clone(u,p)}var P=t.magnitudeSquared(t.subtract(_,E,I)),v=t.magnitudeSquared(t.subtract(y,s,I)),w=t.magnitudeSquared(t.subtract(p,c,I)),x=E,D=_,B=P;v>B&&(B=v,x=s,D=y),w>B&&(B=w,x=c,D=p);var z=S;z.x=.5*(x.x+D.x),z.y=.5*(x.y+D.y),z.z=.5*(x.z+D.z);var G=t.magnitudeSquared(t.subtract(D,z,I)),b=Math.sqrt(G),X=m;X.x=E.x,X.y=s.y,X.z=c.z;var V=O;V.x=_.x,V.y=y.y,V.z=p.z;var q=t.multiplyByScalar(t.add(X,V,I),.5,M),H=0;for(U=0;U<C;U+=i){u.x=e[U]+n.x,u.y=e[U+1]+n.y,u.z=e[U+2]+n.z;var W=t.magnitude(t.subtract(u,q,I));W>H&&(H=W);var Y=t.magnitudeSquared(t.subtract(u,z,I));if(Y>G){var k=Math.sqrt(Y);b=.5*(b+k),G=b*b;var K=k-b;z.x=(b*z.x+K*u.x)/k,z.y=(b*z.y+K*u.y)/k,z.z=(b*z.z+K*u.z)/k}}return b<H?(t.clone(z,o.center),o.radius=b):(t.clone(q,o.center),o.radius=H),o},T.fromEncodedCartesianVertices=function(e,n,r){if(a(r)||(r=new T),!a(e)||!a(n)||e.length!==n.length||0===e.length)return r.center=t.clone(t.ZERO,r.center),r.radius=0,r;var i=d;i.x=e[0]+n[0],i.y=e[1]+n[1],i.z=e[2]+n[2];for(var o=t.clone(i,R),u=t.clone(i,l),E=t.clone(i,f),s=t.clone(i,A),c=t.clone(i,h),_=t.clone(i,N),y=e.length,p=0;p<y;p+=3){var C=e[p]+n[p],U=e[p+1]+n[p+1],L=e[p+2]+n[p+2];i.x=C,i.y=U,i.z=L,C<o.x&&t.clone(i,o),C>s.x&&t.clone(i,s),U<u.y&&t.clone(i,u),U>c.y&&t.clone(i,c),L<E.z&&t.clone(i,E),L>_.z&&t.clone(i,_)}var F=t.magnitudeSquared(t.subtract(s,o,I)),g=t.magnitudeSquared(t.subtract(c,u,I)),P=t.magnitudeSquared(t.subtract(_,E,I)),v=o,w=s,x=F;g>x&&(x=g,v=u,w=c),P>x&&(x=P,v=E,w=_);var D=S;D.x=.5*(v.x+w.x),D.y=.5*(v.y+w.y),D.z=.5*(v.z+w.z);var B=t.magnitudeSquared(t.subtract(w,D,I)),z=Math.sqrt(B),G=m;G.x=o.x,G.y=u.y,G.z=E.z;var b=O;b.x=s.x,b.y=c.y,b.z=_.z;var X=t.multiplyByScalar(t.add(G,b,I),.5,M),V=0;for(p=0;p<y;p+=3){i.x=e[p]+n[p],i.y=e[p+1]+n[p+1],i.z=e[p+2]+n[p+2];var q=t.magnitude(t.subtract(i,X,I));q>V&&(V=q);var H=t.magnitudeSquared(t.subtract(i,D,I));if(H>B){var W=Math.sqrt(H);z=.5*(z+W),B=z*z;var Y=W-z;D.x=(z*D.x+Y*i.x)/W,D.y=(z*D.y+Y*i.y)/W,D.z=(z*D.z+Y*i.z)/W}}return z<V?(t.clone(D,r.center),r.radius=z):(t.clone(X,r.center),r.radius=V),r},T.fromCornerPoints=function(e,n,r){a(r)||(r=new T);var i=r.center;return t.add(e,n,i),t.multiplyByScalar(i,.5,i),r.radius=t.distance(i,n),r},T.fromEllipsoid=function(e,n){return a(n)||(n=new T),t.clone(t.ZERO,n.center),n.radius=e.maximumRadius,n};var g=new t;T.fromBoundingSpheres=function(e,n){if(a(n)||(n=new T),!a(e)||0===e.length)return n.center=t.clone(t.ZERO,n.center),n.radius=0,n;var r=e.length;if(1===r)return T.clone(e[0],n);if(2===r)return T.union(e[0],e[1],n);for(var i=[],o=0;o<r;o++)i.push(e[o].center);n=T.fromPoints(i,n);var u=n.center,E=n.radius;for(o=0;o<r;o++){var s=e[o];E=Math.max(E,t.distance(u,s.center,g)+s.radius)}return n.radius=E,n};var P=new t,v=new t,w=new t;T.fromOrientedBoundingBox=function(e,n){a(n)||(n=new T);var r=e.halfAxes,i=s.getColumn(r,0,P),o=s.getColumn(r,1,v),u=s.getColumn(r,2,w),E=t.magnitude(i),c=t.magnitude(o),_=t.magnitude(u);return n.center=t.clone(e.center,n.center),n.radius=Math.max(E,c,_),n},T.clone=function(e,n){if(a(e))return a(n)?(n.center=t.clone(e.center,n.center),n.radius=e.radius,n):new T(e.center,e.radius)},T.packedLength=4,T.pack=function(t,e,n){n=r(n,0);var a=t.center;return e[n++]=a.x,e[n++]=a.y,e[n++]=a.z,e[n]=t.radius,e},T.unpack=function(t,e,n){e=r(e,0),a(n)||(n=new T);var i=n.center;return i.x=t[e++],i.y=t[e++],i.z=t[e++],n.radius=t[e],n};var x=new t,D=new t;T.union=function(e,n,r){a(r)||(r=new T);var i=e.center,o=e.radius,u=n.center,E=n.radius,s=t.subtract(u,i,x),c=t.magnitude(s);if(o>=c+E)return e.clone(r),r;if(E>=c+o)return n.clone(r),r;var _=.5*(o+c+E),R=t.multiplyByScalar(s,(-o+_)/c,D);return t.add(R,i,R),t.clone(R,r.center),r.radius=_,r};var B=new t;T.expand=function(e,n,r){r=T.clone(e,r);var a=t.magnitude(t.subtract(n,r.center,B));return a>r.radius&&(r.radius=a),r},T.intersectPlane=function(e,n){var r=e.center,a=e.radius,i=n.normal,o=t.dot(i,r)+n.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},T.transform=function(t,e,n){return a(n)||(n=new T),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=c.getMaximumScale(e)*t.radius,n};var z=new t;T.distanceSquaredTo=function(e,n){var r=t.subtract(e.center,n,z);return t.magnitudeSquared(r)-e.radius*e.radius},T.transformWithoutScale=function(t,e,n){return a(n)||(n=new T),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=t.radius,n};var G=new t;T.computePlaneDistances=function(e,n,r,i){a(i)||(i=new E);var o=t.subtract(e.center,n,G),u=t.dot(r,o);return i.start=u-e.radius,i.stop=u+e.radius,i};for(var b=new t,X=new t,V=new t,q=new t,H=new t,W=new e,Y=new Array(8),k=0;k<8;++k)Y[k]=new t;var K=new o;return T.projectTo2D=function(e,n,a){n=r(n,K);var i=n.ellipsoid,o=e.center,u=e.radius,E=i.geodeticSurfaceNormal(o,b),s=t.cross(t.UNIT_Z,E,X);t.normalize(s,s);var c=t.cross(E,s,V);t.normalize(c,c),t.multiplyByScalar(E,u,E),t.multiplyByScalar(c,u,c),t.multiplyByScalar(s,u,s);var _=t.negate(c,H),R=t.negate(s,q),l=Y,f=l[0];t.add(E,c,f),t.add(f,s,f),f=l[1],t.add(E,c,f),t.add(f,R,f),f=l[2],t.add(E,_,f),t.add(f,R,f),f=l[3],t.add(E,_,f),t.add(f,s,f),t.negate(E,E),f=l[4],t.add(E,c,f),t.add(f,s,f),f=l[5],t.add(E,c,f),t.add(f,R,f),f=l[6],t.add(E,_,f),t.add(f,R,f),f=l[7],t.add(E,_,f),t.add(f,s,f);for(var A=l.length,h=0;h<A;++h){var N=l[h];t.add(o,N,N);var d=i.cartesianToCartographic(N,W);n.project(d,N)}a=T.fromPoints(l,a),o=a.center;var I=o.x,S=o.y,m=o.z;return o.x=m,o.y=I,o.z=S,a},T.isOccluded=function(t,e){return!e.isBoundingSphereVisible(t)},T.equals=function(e,n){return e===n||a(e)&&a(n)&&t.equals(e.center,n.center)&&e.radius===n.radius},T.prototype.intersectPlane=function(t){return T.intersectPlane(this,t)},T.prototype.distanceSquaredTo=function(t){return T.distanceSquaredTo(this,t)},T.prototype.computePlaneDistances=function(t,e,n){return T.computePlaneDistances(this,t,e,n)},T.prototype.isOccluded=function(t){return T.isOccluded(this,t)},T.prototype.equals=function(t){return T.equals(this,t)},T.prototype.clone=function(t){return T.clone(this,t)},T}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,a,i){"use strict";function o(t,n){this.x=e(t,0),this.y=e(n,0)}o.fromElements=function(t,e,r){return n(r)?(r.x=t,r.y=e,r):new o(t,e)},o.clone=function(t,e){if(n(t))return n(e)?(e.x=t.x,e.y=t.y,e):new o(t.x,t.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r]=t.y,n},o.unpack=function(t,r,a){return r=e(r,0),n(a)||(a=new o),a.x=t[r++],a.y=t[r],a},o.packArray=function(t,e){var r=t.length;n(e)?e.length=2*r:e=new Array(2*r);for(var a=0;a<r;++a)o.pack(t[a],e,2*a);return e},o.unpackArray=function(t,e){var r=t.length;n(e)?e.length=r/2:e=new Array(r/2);for(var a=0;a<r;a+=2){var i=a/2;e[i]=o.unpack(t,a,e[i])}return e},o.fromArray=o.unpack,o.maximumComponent=function(t){return Math.max(t.x,t.y)},o.minimumComponent=function(t){return Math.min(t.x,t.y)},o.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n},o.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n},o.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y},o.magnitude=function(t){return Math.sqrt(o.magnitudeSquared(t))};var u=new o;o.distance=function(t,e){return o.subtract(t,e,u),o.magnitude(u)},o.distanceSquared=function(t,e){return o.subtract(t,e,u),o.magnitudeSquared(u)},o.normalize=function(t,e){var n=o.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e},o.dot=function(t,e){return t.x*e.x+t.y*e.y},o.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n},o.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n},o.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n},o.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n},o.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n},o.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n},o.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e},o.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e};var E=new o;o.lerp=function(t,e,n,r){return o.multiplyByScalar(e,n,E),r=o.multiplyByScalar(t,1-n,r),o.add(E,r,r)};var s=new o,c=new o;o.angleBetween=function(t,e){return o.normalize(t,s),o.normalize(e,c),i.acosClamped(o.dot(s,c))};var _=new o;return o.mostOrthogonalAxis=function(t,e){var n=o.normalize(t,_);return o.abs(n,n),e=n.x<=n.y?o.clone(o.UNIT_X,e):o.clone(o.UNIT_Y,e)},o.equals=function(t,e){return t===e||n(t)&&n(e)&&t.x===e.x&&t.y===e.y},o.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]},o.equalsEpsilon=function(t,e,r,a){return t===e||n(t)&&n(e)&&i.equalsEpsilon(t.x,e.x,r,a)&&i.equalsEpsilon(t.y,e.y,r,a)},o.ZERO=a(new o(0,0)),o.UNIT_X=a(new o(1,0)),o.UNIT_Y=a(new o(0,1)),o.prototype.clone=function(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.prototype.equalsEpsilon=function(t,e,n){return o.equalsEpsilon(this,t,e,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/Fullscreen",["./defined","./defineProperties"],function(t,e){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return e(a,{element:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenElement]; +}},changeEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(t(n))return n;n=!1;var e=document.body;if("function"==typeof e.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var E=i[o];a=E+"RequestFullscreen","function"==typeof e[a]?(r.requestFullscreen=a,n=!0):(a=E+"RequestFullScreen","function"==typeof e[a]&&(r.requestFullscreen=a,n=!0)),a=E+"ExitFullscreen","function"==typeof document[a]?r.exitFullscreen=a:(a=E+"CancelFullScreen","function"==typeof document[a]&&(r.exitFullscreen=a)),a=E+"FullscreenEnabled",void 0!==document[a]?r.fullscreenEnabled=a:(a=E+"FullScreenEnabled",void 0!==document[a]&&(r.fullscreenEnabled=a)),a=E+"FullscreenElement",void 0!==document[a]?r.fullscreenElement=a:(a=E+"FullScreenElement",void 0!==document[a]&&(r.fullscreenElement=a)),a=E+"fullscreenchange",void 0!==document["on"+a]&&("ms"===E&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=E+"fullscreenerror",void 0!==document["on"+a]&&("ms"===E&&(a="MSFullscreenError"),r.fullscreenerror=a)}return n},a.requestFullscreen=function(t,e){a.supportsFullscreen()&&t[r.requestFullscreen]({vrDisplay:e})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[r.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(t,e,n){"use strict";function r(t){for(var e=t.split("."),n=0,r=e.length;n<r;++n)e[n]=parseInt(e[n],10);return e}function a(){if(!e(S)&&(S=!1,!T())){var t=/ Chrome\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(S=!0,m=r(t[1]))}return S}function i(){return a()&&m}function o(){if(!e(O)&&(O=!1,!a()&&!T()&&/ Safari\/[\.0-9]+/.test(I.userAgent))){var t=/ Version\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(O=!0,M=r(t[1]))}return O}function u(){return o()&&M}function E(){if(!e(y)){y=!1;var t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(I.userAgent);null!==t&&(y=!0,p=r(t[1]),p.isNightly=!!t[2])}return y}function s(){return E()&&p}function c(){if(!e(C)){C=!1;var t;"Microsoft Internet Explorer"===I.appName?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==t&&(C=!0,U=r(t[1]))):"Netscape"===I.appName&&(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==t&&(C=!0,U=r(t[1])))}return C}function _(){return c()&&U}function T(){if(!e(L)){L=!1;var t=/ Edge\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(L=!0,F=r(t[1]))}return L}function R(){return T()&&F}function l(){if(!e(g)){g=!1;var t=/Firefox\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(g=!0,P=r(t[1]))}return g}function f(){return e(v)||(v=/Windows/i.test(I.appVersion)),v}function A(){return l()&&P}function h(){return e(w)||(w="undefined"!=typeof PointerEvent&&(!e(I.pointerEnabled)||I.pointerEnabled)),w}function N(){if(!e(D)){var t=document.createElement("canvas");t.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=t.style.imageRendering;D=e(n)&&""!==n,D&&(x=n)}return D}function d(){return N()?x:void 0}var I;I="undefined"!=typeof navigator?navigator:{};var S,m,O,M,y,p,C,U,L,F,g,P,v,w,x,D,B={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:E,webkitVersion:s,isInternetExplorer:c,internetExplorerVersion:_,isEdge:T,edgeVersion:R,isFirefox:l,firefoxVersion:A,isWindows:f,hardwareConcurrency:t(I.hardwareConcurrency,3),supportsPointerEvents:h,supportsImageRenderingPixelated:N,imageRenderingValue:d};return B.supportsFullscreen=function(){return n.supportsFullscreen()},B.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},B.supportsWebWorkers=function(){return"undefined"!=typeof Worker},B}),define("Core/WebGLConstants",["./freezeObject"],function(t){"use strict";var e={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047};return t(e)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(t,e,n,r,a,i){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(t){switch(t){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.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(t){return t instanceof Int8Array?o.BYTE:t instanceof Uint8Array?o.UNSIGNED_BYTE:t instanceof Int16Array?o.SHORT:t instanceof Uint16Array?o.UNSIGNED_SHORT:t instanceof Int32Array?o.INT:t instanceof Uint32Array?o.UNSIGNED_INT:t instanceof Float32Array?o.FLOAT:t instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(t){return e(t)&&(t===o.BYTE||t===o.UNSIGNED_BYTE||t===o.SHORT||t===o.UNSIGNED_SHORT||t===o.INT||t===o.UNSIGNED_INT||t===o.FLOAT||t===o.DOUBLE)},o.createTypedArray=function(t,e){switch(t){case o.BYTE:return new Int8Array(e);case o.UNSIGNED_BYTE:return new Uint8Array(e);case o.SHORT:return new Int16Array(e);case o.UNSIGNED_SHORT:return new Uint16Array(e);case o.INT:return new Int32Array(e);case o.UNSIGNED_INT:return new Uint32Array(e);case o.FLOAT:return new Float32Array(e);case o.DOUBLE:return new Float64Array(e)}},o.createArrayBufferView=function(e,n,r,a){switch(r=t(r,0),a=t(a,(n.byteLength-r)/o.getSizeInBytes(e)),e){case o.BYTE:return new Int8Array(n,r,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,a);case o.SHORT:return new Int16Array(n,r,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,a);case o.INT:return new Int32Array(n,r,a);case o.UNSIGNED_INT:return new Uint32Array(n,r,a);case o.FLOAT:return new Float32Array(n,r,a);case o.DOUBLE:return new Float64Array(n,r,a)}},o.fromName=function(t){switch(t){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/CylinderGeometryLibrary",["./Math"],function(t){"use strict";var e={};return e.computePositions=function(e,n,r,a,i){var o,u=.5*e,E=-u,s=a+a,c=i?2*s:s,_=new Float64Array(3*c),T=0,R=0,l=i?3*s:0,f=i?3*(s+a):3*a;for(o=0;o<a;o++){var A=o/a*t.TWO_PI,h=Math.cos(A),N=Math.sin(A),d=h*r,I=N*r,S=h*n,m=N*n;_[R+l]=d,_[R+l+1]=I,_[R+l+2]=E,_[R+f]=S,_[R+f+1]=m,_[R+f+2]=u,R+=3,i&&(_[T++]=d,_[T++]=I,_[T++]=E,_[T++]=S,_[T++]=m,_[T++]=u)}return _},e}),define("Core/GeometryType",["./freezeObject"],function(t){"use strict";var e={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return t(e)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(t,e){"use strict";var n={POINTS:e.POINTS,LINES:e.LINES,LINE_LOOP:e.LINE_LOOP,LINE_STRIP:e.LINE_STRIP,TRIANGLES:e.TRIANGLES,TRIANGLE_STRIP:e.TRIANGLE_STRIP,TRIANGLE_FAN:e.TRIANGLE_FAN,validate:function(t){return t===n.POINTS||t===n.LINES||t===n.LINE_LOOP||t===n.LINE_STRIP||t===n.TRIANGLES||t===n.TRIANGLE_STRIP||t===n.TRIANGLE_FAN}};return t(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(t,e,n,r,a){"use strict";function i(e){e=t(e,t.EMPTY_OBJECT),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=t(e.primitiveType,a.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=t(e.geometryType,r.NONE),this.boundingSphereCV=e.boundingSphereCV}return i.computeNumberOfVertices=function(t){var n=-1;for(var r in t.attributes)if(t.attributes.hasOwnProperty(r)&&e(t.attributes[r])&&e(t.attributes[r].values)){var a=t.attributes[r],i=a.values.length/a.componentsPerAttribute;n=i}return n},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(t,e,n){"use strict";function r(e){e=t(e,t.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=t(e.normalize,!1),this.values=e.values}return r}),define("Core/GeometryAttributes",["./defaultValue"],function(t){"use strict";function e(e){e=t(e,t.EMPTY_OBJECT),this.position=e.position,this.normal=e.normal,this.st=e.st,this.bitangent=e.bitangent,this.tangent=e.tangent,this.color=e.color}return e}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(t,e,n,r,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(t){switch(t){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(e){return t(e)&&(e===i.UNSIGNED_BYTE||e===i.UNSIGNED_SHORT||e===i.UNSIGNED_INT)},i.createTypedArray=function(t,e){return t>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(e):new Uint16Array(e)},i.createTypedArrayFromArrayBuffer=function(t,e,n,a){return t>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(e,n,a):new Uint16Array(e,n,a)},n(i)}),define("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(t,e,n,r){"use strict";function a(e){e=t(e,t.EMPTY_OBJECT),this.position=t(e.position,!1),this.normal=t(e.normal,!1),this.st=t(e.st,!1),this.bitangent=t(e.bitangent,!1),this.tangent=t(e.tangent,!1),this.color=t(e.color,!1)}return a.POSITION_ONLY=r(new a({position:!0})),a.POSITION_AND_NORMAL=r(new a({position:!0,normal:!0})),a.POSITION_NORMAL_AND_ST=r(new a({position:!0,normal:!0,st:!0})),a.POSITION_AND_ST=r(new a({position:!0,st:!0})),a.POSITION_AND_COLOR=r(new a({position:!0,color:!0})),a.ALL=r(new a({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0})),a.DEFAULT=a.POSITION_NORMAL_AND_ST,a.packedLength=6,a.pack=function(e,n,r){return r=t(r,0),n[r++]=e.position?1:0,n[r++]=e.normal?1:0,n[r++]=e.st?1:0,n[r++]=e.tangent?1:0,n[r++]=e.bitangent?1:0,n[r++]=e.color?1:0,n},a.unpack=function(n,r,i){return r=t(r,0),e(i)||(i=new a),i.position=1===n[r++],i.normal=1===n[r++],i.st=1===n[r++],i.tangent=1===n[r++],i.bitangent=1===n[r++],i.color=1===n[r++],i},a.clone=function(t,n){if(e(t))return e(n)||(n=new a),n.position=t.position,n.normal=t.normal,n.st=t.st,n.tangent=t.tangent,n.bitangent=t.bitangent,n.color=t.color,n},a}),define("Core/CylinderGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./CylinderGeometryLibrary","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./VertexFormat"],function(t,e,n,r,a,i,o,u,E,s,c,_,T,R,l){"use strict";function f(t){t=i(t,i.EMPTY_OBJECT);var e=t.length,n=t.topRadius,r=t.bottomRadius,a=i(t.vertexFormat,l.DEFAULT),o=i(t.slices,128);this._length=e,this._topRadius=n,this._bottomRadius=r,this._vertexFormat=l.clone(a),this._slices=o,this._workerName="createCylinderGeometry"}var A=new e,h=new n,N=new n,d=new n,I=new n;f.packedLength=l.packedLength+4,f.pack=function(t,e,n){return n=i(n,0),l.pack(t._vertexFormat,e,n),n+=l.packedLength,e[n++]=t._length,e[n++]=t._topRadius,e[n++]=t._bottomRadius,e[n]=t._slices,e};var S=new l,m={vertexFormat:S,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0};return f.unpack=function(t,e,n){e=i(e,0);var r=l.unpack(t,e,S);e+=l.packedLength;var a=t[e++],u=t[e++],E=t[e++],s=t[e];return o(n)?(n._vertexFormat=l.clone(r,n._vertexFormat),n._length=a,n._topRadius=u,n._bottomRadius=E,n._slices=s,n):(m.length=a,m.topRadius=u,m.bottomRadius=E,m.slices=s,new f(m))},f.createGeometry=function(i){var o=i._length,u=i._topRadius,l=i._bottomRadius,f=i._vertexFormat,S=i._slices;if(!(o<=0||u<0||l<0||0===u&&0===l)){var m,O=S+S,M=S+O,y=O+O,p=a.computePositions(o,u,l,S,!0),C=f.st?new Float32Array(2*y):void 0,U=f.normal?new Float32Array(3*y):void 0,L=f.tangent?new Float32Array(3*y):void 0,F=f.bitangent?new Float32Array(3*y):void 0,g=f.normal||f.tangent||f.bitangent;if(g){var P=f.tangent||f.bitangent,v=0,w=0,x=0,D=h;D.z=0;var B=d,z=N;for(m=0;m<S;m++){var G=m/S*T.TWO_PI,b=Math.cos(G),X=Math.sin(G);g&&(D.x=b,D.y=X,P&&(B=n.normalize(n.cross(n.UNIT_Z,D,B),B)),f.normal&&(U[v++]=b,U[v++]=X,U[v++]=0,U[v++]=b,U[v++]=X,U[v++]=0),f.tangent&&(L[w++]=B.x,L[w++]=B.y,L[w++]=B.z,L[w++]=B.x,L[w++]=B.y,L[w++]=B.z),f.bitangent&&(z=n.normalize(n.cross(D,B,z),z),F[x++]=z.x,F[x++]=z.y,F[x++]=z.z,F[x++]=z.x,F[x++]=z.y,F[x++]=z.z))}for(m=0;m<S;m++)f.normal&&(U[v++]=0,U[v++]=0,U[v++]=-1),f.tangent&&(L[w++]=1,L[w++]=0,L[w++]=0),f.bitangent&&(F[x++]=0,F[x++]=-1,F[x++]=0);for(m=0;m<S;m++)f.normal&&(U[v++]=0,U[v++]=0,U[v++]=1),f.tangent&&(L[w++]=1,L[w++]=0,L[w++]=0),f.bitangent&&(F[x++]=0,F[x++]=1,F[x++]=0)}var V=12*S-12,q=_.createTypedArray(y,V),H=0,W=0;for(m=0;m<S-1;m++)q[H++]=W,q[H++]=W+2,q[H++]=W+3,q[H++]=W,q[H++]=W+3,q[H++]=W+1,W+=2;for(q[H++]=O-2,q[H++]=0,q[H++]=1,q[H++]=O-2,q[H++]=1,q[H++]=O-1,m=1;m<S-1;m++)q[H++]=O+m+1,q[H++]=O+m,q[H++]=O;for(m=1;m<S-1;m++)q[H++]=M,q[H++]=M+m,q[H++]=M+m+1;var Y=0;if(f.st){var k=Math.max(u,l);for(m=0;m<y;m++){var K=n.fromArray(p,3*m,I);C[Y++]=(K.x+k)/(2*k),C[Y++]=(K.y+k)/(2*k)}}var Z=new c;f.position&&(Z.position=new s({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:p})),f.normal&&(Z.normal=new s({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:U})),f.tangent&&(Z.tangent=new s({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:L})),f.bitangent&&(Z.bitangent=new s({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:F})),f.st&&(Z.st=new s({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:C})),A.x=.5*o,A.y=Math.max(l,u);var j=new t(n.ZERO,e.magnitude(A));return new E({attributes:Z,indices:q,primitiveType:R.TRIANGLES,boundingSphere:j})}},f}),define("Workers/createCylinderGeometry",["../Core/CylinderGeometry","../Core/defined"],function(t,e){"use strict";return function(n,r){return e(r)&&(n=t.unpack(n,r)),t.createGeometry(n)}})}(); \ No newline at end of file diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createCylinderOutlineGeometry.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createCylinderOutlineGeometry.js index 8243c542..19f2b9a2 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createCylinderOutlineGeometry.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createCylinderOutlineGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,6 +55,6 @@ mersenne-twister.js - https://gist.github.com/banksean/300494 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -!function(){define("Core/defined",[],function(){"use strict";function t(t){return void 0!==t&&null!==t}return t}),define("Core/freezeObject",["./defined"],function(t){"use strict";var e=Object.freeze;return t(e)||(e=function(t){return t}),e}),define("Core/defaultValue",["./freezeObject"],function(t){"use strict";function e(t,e){return void 0!==t?t:e}return e.EMPTY_OBJECT=t({}),e}),define("Core/DeveloperError",["./defined"],function(t){"use strict";function e(t){this.name="DeveloperError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e.throwInstantiationError=function(){throw new e("This function defines an interface and should not be called directly.")},e}),define("Core/isArray",["./defined"],function(t){"use strict";var e=Array.isArray;return t(e)||(e=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),e}),define("Core/Check",["./defaultValue","./defined","./DeveloperError","./isArray"],function(t,e,n,r){"use strict";function i(t){return t+" was required but undefined."}function a(t,e,n){return"Expected "+n+" to be typeof "+e+", got "+t}var o={};return o.typeOf={},o.numeric={},o.defined=function(t,r){if(!e(t))throw new n(i(r))},o.numeric.maximum=function(t,e){if(o.typeOf.number(t),o.typeOf.number(e),t>e)throw new n("Expected "+t+" to be at most "+e)},o.numeric.minimum=function(t,e){if(o.typeOf.number(t),o.typeOf.number(e),t<e)throw new n("Expected "+t+" to be at least "+e)},o.typeOf.function=function(t,e){if("function"!=typeof t)throw new n(a(typeof t,"function",e))},o.typeOf.string=function(t,e){if("string"!=typeof t)throw new n(a(typeof t,"string",e))},o.typeOf.number=function(t,e){if("number"!=typeof t)throw new n(a(typeof t,"number",e))},o.typeOf.object=function(t,e){if("object"!=typeof t)throw new n(a(typeof t,"object",e))},o.typeOf.boolean=function(t,e){if("boolean"!=typeof t)throw new n(a(typeof t,"boolean",e))},o}),define("ThirdParty/mersenne-twister",[],function(){var t=function(t){void 0==t&&(t=(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(t)};return t.prototype.init_genrand=function(t){for(this.mt[0]=t>>>0,this.mti=1;this.mti<this.N;this.mti++){var t=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&t)>>>16)<<16)+1812433253*(65535&t)+this.mti,this.mt[this.mti]>>>=0}},t.prototype.genrand_int32=function(){var t,e=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)t=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^t>>>1^e[1&t];for(;n<this.N-1;n++)t=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^t>>>1^e[1&t];t=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^t>>>1^e[1&t],this.mti=0}return t=this.mt[this.mti++],t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,t^=t>>>18,t>>>0},t.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},t}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(t,e,n,r){"use strict";var i={};i.EPSILON1=.1,i.EPSILON2=.01,i.EPSILON3=.001,i.EPSILON4=1e-4,i.EPSILON5=1e-5,i.EPSILON6=1e-6,i.EPSILON7=1e-7,i.EPSILON8=1e-8,i.EPSILON9=1e-9,i.EPSILON10=1e-10,i.EPSILON11=1e-11,i.EPSILON12=1e-12,i.EPSILON13=1e-13,i.EPSILON14=1e-14,i.EPSILON15=1e-15,i.EPSILON16=1e-16,i.EPSILON17=1e-17,i.EPSILON18=1e-18,i.EPSILON19=1e-19,i.EPSILON20=1e-20,i.GRAVITATIONALPARAMETER=3986004418e5,i.SOLAR_RADIUS=6955e5,i.LUNAR_RADIUS=1737400,i.SIXTY_FOUR_KILOBYTES=65536,i.sign=function(t){return t>0?1:t<0?-1:0},i.signNotZero=function(t){return t<0?-1:1},i.toSNorm=function(t,n){return n=e(n,255),Math.round((.5*i.clamp(t,-1,1)+.5)*n)},i.fromSNorm=function(t,n){return n=e(n,255),i.clamp(t,0,n)/n*2-1},i.sinh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e-n)},i.cosh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e+n)},i.lerp=function(t,e,n){return(1-n)*t+n*e},i.PI=Math.PI,i.ONE_OVER_PI=1/Math.PI,i.PI_OVER_TWO=.5*Math.PI,i.PI_OVER_THREE=Math.PI/3,i.PI_OVER_FOUR=Math.PI/4,i.PI_OVER_SIX=Math.PI/6,i.THREE_PI_OVER_TWO=3*Math.PI*.5,i.TWO_PI=2*Math.PI,i.ONE_OVER_TWO_PI=1/(2*Math.PI),i.RADIANS_PER_DEGREE=Math.PI/180,i.DEGREES_PER_RADIAN=180/Math.PI,i.RADIANS_PER_ARCSECOND=i.RADIANS_PER_DEGREE/3600,i.toRadians=function(t){return t*i.RADIANS_PER_DEGREE},i.toDegrees=function(t){return t*i.DEGREES_PER_RADIAN},i.convertLongitudeRange=function(t){var e=i.TWO_PI,n=t-Math.floor(t/e)*e;return n<-Math.PI?n+e:n>=Math.PI?n-e:n},i.clampToLatitudeRange=function(t){return i.clamp(t,-1*i.PI_OVER_TWO,i.PI_OVER_TWO)},i.negativePiToPi=function(t){return i.zeroToTwoPi(t+i.PI)-i.PI},i.zeroToTwoPi=function(t){var e=i.mod(t,i.TWO_PI);return Math.abs(e)<i.EPSILON14&&Math.abs(t)>i.EPSILON14?i.TWO_PI:e},i.mod=function(t,e){return(t%e+e)%e},i.equalsEpsilon=function(t,n,r,i){i=e(i,r);var a=Math.abs(t-n);return a<=i||a<=r*Math.max(Math.abs(t),Math.abs(n))};var a=[1];i.factorial=function(t){var e=a.length;if(t>=e)for(var n=a[e-1],r=e;r<=t;r++)a.push(n*r);return a[t]},i.incrementWrap=function(t,n,r){return r=e(r,0),++t,t>n&&(t=r),t},i.isPowerOfTwo=function(t){return 0!==t&&0===(t&t-1)},i.nextPowerOfTwo=function(t){return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t,t},i.clamp=function(t,e,n){return t<e?e:t>n?n:t};var o=new t;return i.setRandomNumberSeed=function(e){o=new t(e)},i.nextRandomNumber=function(){return o.random()},i.acosClamped=function(t){return Math.acos(i.clamp(t,-1,1))},i.asinClamped=function(t){return Math.asin(i.clamp(t,-1,1))},i.chordLength=function(t,e){return 2*e*Math.sin(.5*t)},i.logBase=function(t,e){return Math.log(t)/Math.log(e)},i.fog=function(t,e){var n=t*e;return 1-Math.exp(-(n*n))},i}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a){"use strict";function o(t,n,r){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0)}o.fromSpherical=function(t,r){n(r)||(r=new o);var i=t.clock,a=t.cone,u=e(t.magnitude,1),E=u*Math.sin(a);return r.x=E*Math.cos(i),r.y=E*Math.sin(i),r.z=u*Math.cos(a),r},o.fromElements=function(t,e,r,i){return n(i)?(i.x=t,i.y=e,i.z=r,i):new o(t,e,r)},o.clone=function(t,e){if(n(t))return n(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e):new o(t.x,t.y,t.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r]=t.z,n},o.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new o),i.x=t[r++],i.y=t[r++],i.z=t[r],i},o.packArray=function(t,e){var r=t.length;n(e)?e.length=3*r:e=new Array(3*r);for(var i=0;i<r;++i)o.pack(t[i],e,3*i);return e},o.unpackArray=function(t,e){var r=t.length;n(e)?e.length=r/3:e=new Array(r/3);for(var i=0;i<r;i+=3){var a=i/3;e[a]=o.unpack(t,i,e[a])}return e},o.fromArray=o.unpack,o.maximumComponent=function(t){return Math.max(t.x,t.y,t.z)},o.minimumComponent=function(t){return Math.min(t.x,t.y,t.z)},o.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n.z=Math.min(t.z,e.z),n},o.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n.z=Math.max(t.z,e.z),n},o.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z},o.magnitude=function(t){return Math.sqrt(o.magnitudeSquared(t))};var u=new o;o.distance=function(t,e){return o.subtract(t,e,u),o.magnitude(u)},o.distanceSquared=function(t,e){return o.subtract(t,e,u),o.magnitudeSquared(u)},o.normalize=function(t,e){var n=o.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e},o.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},o.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n.z=t.z*e.z,n},o.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n.z=t.z/e.z,n},o.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n},o.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n},o.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*e,n},o.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n},o.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e},o.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e};var E=new o;o.lerp=function(t,e,n,r){return o.multiplyByScalar(e,n,E),r=o.multiplyByScalar(t,1-n,r),o.add(E,r,r)};var s=new o,c=new o;o.angleBetween=function(t,e){o.normalize(t,s),o.normalize(e,c);var n=o.dot(s,c),r=o.magnitude(o.cross(s,c,s));return Math.atan2(r,n)};var _=new o;o.mostOrthogonalAxis=function(t,e){var n=o.normalize(t,_);return o.abs(n,n),e=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,e):o.clone(o.UNIT_Z,e):n.y<=n.z?o.clone(o.UNIT_Y,e):o.clone(o.UNIT_Z,e)},o.equals=function(t,e){return t===e||n(t)&&n(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z},o.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]},o.equalsEpsilon=function(t,e,r,i){return t===e||n(t)&&n(e)&&a.equalsEpsilon(t.x,e.x,r,i)&&a.equalsEpsilon(t.y,e.y,r,i)&&a.equalsEpsilon(t.z,e.z,r,i)},o.cross=function(t,e,n){var r=t.x,i=t.y,a=t.z,o=e.x,u=e.y,E=e.z,s=i*E-a*u,c=a*o-r*E,_=r*u-i*o;return n.x=s,n.y=c,n.z=_,n},o.fromDegrees=function(t,e,n,r,i){return t=a.toRadians(t),e=a.toRadians(e),o.fromRadians(t,e,n,r,i)};var T=new o,R=new o,l=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(t,r,i,a,u){i=e(i,0);var E=n(a)?a.radiiSquared:l,s=Math.cos(r);T.x=s*Math.cos(t),T.y=s*Math.sin(t),T.z=Math.sin(r),T=o.normalize(T,T),o.multiplyComponents(E,T,R);var c=Math.sqrt(o.dot(T,R));return R=o.divideByScalar(R,c,R),T=o.multiplyByScalar(T,i,T),n(u)||(u=new o),o.add(R,T,u)},o.fromDegreesArray=function(t,e,r){var i=t.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=t[a],E=t[a+1],s=a/2;r[s]=o.fromDegrees(u,E,0,e,r[s])}return r},o.fromRadiansArray=function(t,e,r){var i=t.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=t[a],E=t[a+1],s=a/2;r[s]=o.fromRadians(u,E,0,e,r[s])}return r},o.fromDegreesArrayHeights=function(t,e,r){var i=t.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=t[a],E=t[a+1],s=t[a+2],c=a/3;r[c]=o.fromDegrees(u,E,s,e,r[c])}return r},o.fromRadiansArrayHeights=function(t,e,r){var i=t.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=t[a],E=t[a+1],s=t[a+2],c=a/3;r[c]=o.fromRadians(u,E,s,e,r[c])}return r},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(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.prototype.equalsEpsilon=function(t,e,n){return o.equalsEpsilon(this,t,e,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(t,e,n,r){"use strict";function i(n,i,u,E,s){var c=n.x,_=n.y,T=n.z,R=i.x,l=i.y,f=i.z,A=c*c*R*R,h=_*_*l*l,N=T*T*f*f,d=A+h+N,I=Math.sqrt(1/d),S=t.multiplyByScalar(n,I,a);if(d<E)return isFinite(I)?t.clone(S,s):void 0;var m=u.x,M=u.y,y=u.z,O=o;O.x=S.x*m*2,O.y=S.y*M*2,O.z=S.z*y*2;var p,C,U,L,F,P,v,x,g,w,D,B=(1-I)*t.magnitude(n)/(.5*t.magnitude(O)),z=0;do{B-=z,U=1/(1+B*m),L=1/(1+B*M),F=1/(1+B*y),P=U*U,v=L*L,x=F*F,g=P*U,w=v*L,D=x*F,p=A*P+h*v+N*x-1,C=A*g*m+h*w*M+N*D*y;var G=-2*C;z=p/G}while(Math.abs(p)>r.EPSILON12);return e(s)?(s.x=c*U,s.y=_*L,s.z=T*F,s):new t(c*U,_*L,T*F)}var a=new t,o=new t;return i}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,n,r,i,a,o){"use strict";function u(t,n,r){this.longitude=e(t,0),this.latitude=e(n,0),this.height=e(r,0)}u.fromRadians=function(t,r,i,a){return i=e(i,0),n(a)?(a.longitude=t,a.latitude=r,a.height=i,a):new u(t,r,i)},u.fromDegrees=function(t,e,n,r){return t=a.toRadians(t),e=a.toRadians(e),u.fromRadians(t,e,n,r)};var E=new t,s=new t,c=new t,_=new t(1/6378137,1/6378137,1/6356752.314245179),T=new t(1/40680631590769,1/40680631590769,1/40408299984661.445),R=a.EPSILON1;return u.fromCartesian=function(e,r,i){var l=n(r)?r.oneOverRadii:_,f=n(r)?r.oneOverRadiiSquared:T,A=n(r)?r._centerToleranceSquared:R,h=o(e,l,f,A,s);if(n(h)){var N=t.multiplyComponents(h,f,E);N=t.normalize(N,N);var d=t.subtract(e,h,c),I=Math.atan2(N.y,N.x),S=Math.asin(N.z),m=a.sign(t.dot(d,e))*t.magnitude(d);return n(i)?(i.longitude=I,i.latitude=S,i.height=m,i):new u(I,S,m)}},u.clone=function(t,e){if(n(t))return n(e)?(e.longitude=t.longitude,e.latitude=t.latitude,e.height=t.height,e):new u(t.longitude,t.latitude,t.height)},u.equals=function(t,e){return t===e||n(t)&&n(e)&&t.longitude===e.longitude&&t.latitude===e.latitude&&t.height===e.height},u.equalsEpsilon=function(t,e,r){return t===e||n(t)&&n(e)&&Math.abs(t.longitude-e.longitude)<=r&&Math.abs(t.latitude-e.latitude)<=r&&Math.abs(t.height-e.height)<=r},u.ZERO=i(new u(0,0,0)),u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.prototype.equalsEpsilon=function(t,e){return u.equalsEpsilon(this,t,e)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(t){"use strict";var e=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(t){return!1}}(),n=Object.defineProperties;return e&&t(n)||(n=function(t){return t}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,n,r,i,a,o,u,E){"use strict";function s(e,r,i,a){r=n(r,0),i=n(i,0),a=n(a,0),e._radii=new t(r,i,a),e._radiiSquared=new t(r*r,i*i,a*a),e._radiiToTheFourth=new t(r*r*r*r,i*i*i*i,a*a*a*a),e._oneOverRadii=new t(0===r?0:1/r,0===i?0:1/i,0===a?0:1/a),e._oneOverRadiiSquared=new t(0===r?0:1/(r*r),0===i?0:1/(i*i),0===a?0:1/(a*a)),e._minimumRadius=Math.min(r,i,a),e._maximumRadius=Math.max(r,i,a),e._centerToleranceSquared=u.EPSILON1,0!==e._radiiSquared.z&&(e._sqauredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function c(t,e,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,s(this,t,e,n)}i(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(e,n){if(r(e)){var i=e._radii;return r(n)?(t.clone(i,n._radii),t.clone(e._radiiSquared,n._radiiSquared),t.clone(e._radiiToTheFourth,n._radiiToTheFourth),t.clone(e._oneOverRadii,n._oneOverRadii),t.clone(e._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=e._minimumRadius,n._maximumRadius=e._maximumRadius,n._centerToleranceSquared=e._centerToleranceSquared,n):new c(i.x,i.y,i.z)}},c.fromCartesian3=function(t,e){return r(e)||(e=new c),r(t)?(s(e,t.x,t.y,t.z),e):e},c.WGS84=o(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=o(new c(1,1,1)),c.MOON=o(new c(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),c.prototype.clone=function(t){return c.clone(this,t)},c.packedLength=t.packedLength,c.pack=function(e,r,i){return i=n(i,0),t.pack(e._radii,r,i),r},c.unpack=function(e,r,i){r=n(r,0);var a=t.unpack(e,r);return c.fromCartesian3(a,i)},c.prototype.geocentricSurfaceNormal=t.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(e,n){var i=e.longitude,a=e.latitude,o=Math.cos(a),u=o*Math.cos(i),E=o*Math.sin(i),s=Math.sin(a);return r(n)||(n=new t),n.x=u,n.y=E,n.z=s,t.normalize(n,n)},c.prototype.geodeticSurfaceNormal=function(e,n){return r(n)||(n=new t),n=t.multiplyComponents(e,this._oneOverRadiiSquared,n),t.normalize(n,n)};var _=new t,T=new t;c.prototype.cartographicToCartesian=function(e,n){var i=_,a=T;this.geodeticSurfaceNormalCartographic(e,i),t.multiplyComponents(this._radiiSquared,i,a);var o=Math.sqrt(t.dot(i,a));return t.divideByScalar(a,o,a),t.multiplyByScalar(i,e.height,i),r(n)||(n=new t),t.add(a,i,n)},c.prototype.cartographicArrayToCartesianArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var i=0;i<n;i++)e[i]=this.cartographicToCartesian(t[i],e[i]);return e};var R=new t,l=new t,f=new t;return c.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,l);if(r(a)){var o=this.geodeticSurfaceNormal(a,R),E=t.subtract(n,a,f),s=Math.atan2(o.y,o.x),c=Math.asin(o.z),_=u.sign(t.dot(E,n))*t.magnitude(E);return r(i)?(i.longitude=s,i.latitude=c,i.height=_,i):new e(s,c,_)}},c.prototype.cartesianArrayToCartographicArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var i=0;i<n;++i)e[i]=this.cartesianToCartographic(t[i],e[i]);return e},c.prototype.scaleToGeodeticSurface=function(t,e){return E(t,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,e)},c.prototype.scaleToGeocentricSurface=function(e,n){r(n)||(n=new t);var i=e.x,a=e.y,o=e.z,u=this._oneOverRadiiSquared,E=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*u.z);return t.multiplyByScalar(e,E,n)},c.prototype.transformPositionToScaledSpace=function(e,n){return r(n)||(n=new t),t.multiplyComponents(e,this._oneOverRadii,n)},c.prototype.transformPositionFromScaledSpace=function(e,n){return r(n)||(n=new t),t.multiplyComponents(e,this._radii,n)},c.prototype.equals=function(e){return this===e||r(e)&&t.equals(this._radii,e._radii)},c.prototype.toString=function(){return this._radii.toString()},c.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,i,a){i=n(i,0);var o=this._sqauredXOverSquaredZ;if(r(a)||(a=new t),a.x=0,a.y=0,a.z=e.z*(1-o),!(Math.abs(a.z)>=this._radii.z-i))return a},c}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(t,e,n,r,i,a,o){"use strict";function u(t){this._ellipsoid=n(t,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return i(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(e,n){var i=this._semimajorAxis,a=e.longitude*i,o=e.latitude*i,u=e.height;return r(n)?(n.x=a,n.y=o,n.z=u,n):new t(a,o,u)},u.prototype.unproject=function(t,n){var i=this._oneOverSemimajorAxis,a=t.x*i,o=t.y*i,u=t.z;return r(n)?(n.longitude=a,n.latitude=o,n.height=u,n):new e(a,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(t){"use strict";var e={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return t(e)}),define("Core/Interval",["./defaultValue"],function(t){"use strict";function e(e,n){this.start=t(e,0),this.stop=t(n,0)}return e}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a,o){"use strict";function u(t,n,r,i,a,o,u,E,s){this[0]=e(t,0),this[1]=e(i,0),this[2]=e(u,0),this[3]=e(n,0),this[4]=e(a,0),this[5]=e(E,0),this[6]=e(r,0),this[7]=e(o,0),this[8]=e(s,0)}function E(t){for(var e=0,n=0;n<9;++n){var r=t[n];e+=r*r}return Math.sqrt(e)}function s(t){for(var e=0,n=0;n<3;++n){var r=t[u.getElementIndex(l[n],R[n])];e+=2*r*r}return Math.sqrt(e)}function c(t,e){for(var n=o.EPSILON15,r=0,i=1,a=0;a<3;++a){var E=Math.abs(t[u.getElementIndex(l[a],R[a])]);E>r&&(i=a,r=E)}var s=1,c=0,_=R[i],T=l[i];if(Math.abs(t[u.getElementIndex(T,_)])>n){var f,A=t[u.getElementIndex(T,T)],h=t[u.getElementIndex(_,_)],N=t[u.getElementIndex(T,_)],d=(A-h)/2/N;f=d<0?-1/(-d+Math.sqrt(1+d*d)):1/(d+Math.sqrt(1+d*d)),s=1/Math.sqrt(1+f*f),c=f*s}return e=u.clone(u.IDENTITY,e),e[u.getElementIndex(_,_)]=e[u.getElementIndex(T,T)]=s,e[u.getElementIndex(T,_)]=c,e[u.getElementIndex(_,T)]=-c,e}u.packedLength=9,u.pack=function(t,n,r){return r=e(r,0),n[r++]=t[0],n[r++]=t[1],n[r++]=t[2],n[r++]=t[3],n[r++]=t[4],n[r++]=t[5],n[r++]=t[6],n[r++]=t[7],n[r++]=t[8],n},u.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new u),i[0]=t[r++],i[1]=t[r++],i[2]=t[r++],i[3]=t[r++],i[4]=t[r++],i[5]=t[r++],i[6]=t[r++],i[7]=t[r++],i[8]=t[r++],i},u.clone=function(t,e){if(n(t))return n(e)?(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):new u(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8])},u.fromArray=function(t,r,i){return r=e(r,0),n(i)||(i=new u),i[0]=t[r],i[1]=t[r+1],i[2]=t[r+2],i[3]=t[r+3],i[4]=t[r+4],i[5]=t[r+5],i[6]=t[r+6],i[7]=t[r+7],i[8]=t[r+8],i},u.fromColumnMajorArray=function(t,e){return u.clone(t,e)},u.fromRowMajorArray=function(t,e){return n(e)?(e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],e):new u(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},u.fromQuaternion=function(t,e){var r=t.x*t.x,i=t.x*t.y,a=t.x*t.z,o=t.x*t.w,E=t.y*t.y,s=t.y*t.z,c=t.y*t.w,_=t.z*t.z,T=t.z*t.w,R=t.w*t.w,l=r-E-_+R,f=2*(i-T),A=2*(a+c),h=2*(i+T),N=-r+E-_+R,d=2*(s-o),I=2*(a-c),S=2*(s+o),m=-r-E+_+R;return n(e)?(e[0]=l,e[1]=h,e[2]=I,e[3]=f,e[4]=N,e[5]=S,e[6]=A,e[7]=d,e[8]=m,e):new u(l,f,A,h,N,d,I,S,m)},u.fromHeadingPitchRoll=function(t,e){var r=Math.cos(-t.pitch),i=Math.cos(-t.heading),a=Math.cos(t.roll),o=Math.sin(-t.pitch),E=Math.sin(-t.heading),s=Math.sin(t.roll),c=r*i,_=-a*E+s*o*i,T=s*E+a*o*i,R=r*E,l=a*i+s*o*E,f=-o*a+a*o*E,A=-o,h=s*r,N=a*r;return n(e)?(e[0]=c,e[1]=R,e[2]=A,e[3]=_,e[4]=l,e[5]=h,e[6]=T,e[7]=f,e[8]=N,e):new u(c,_,T,R,l,f,A,h,N)},u.fromScale=function(t,e){return n(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=t.y,e[5]=0,e[6]=0,e[7]=0,e[8]=t.z,e):new u(t.x,0,0,0,t.y,0,0,0,t.z)},u.fromUniformScale=function(t,e){return n(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=t,e[5]=0,e[6]=0,e[7]=0,e[8]=t,e):new u(t,0,0,0,t,0,0,0,t)},u.fromCrossProduct=function(t,e){return n(e)?(e[0]=0,e[1]=t.z,e[2]=-t.y,e[3]=-t.z,e[4]=0,e[5]=t.x,e[6]=t.y,e[7]=-t.x,e[8]=0,e):new u(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},u.fromRotationX=function(t,e){var r=Math.cos(t),i=Math.sin(t);return n(e)?(e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=r,e[5]=i,e[6]=0,e[7]=-i,e[8]=r,e):new u(1,0,0,0,r,-i,0,i,r)},u.fromRotationY=function(t,e){var r=Math.cos(t),i=Math.sin(t);return n(e)?(e[0]=r,e[1]=0,e[2]=-i,e[3]=0,e[4]=1,e[5]=0,e[6]=i,e[7]=0,e[8]=r,e):new u(r,0,i,0,1,0,-i,0,r)},u.fromRotationZ=function(t,e){var r=Math.cos(t),i=Math.sin(t);return n(e)?(e[0]=r,e[1]=i,e[2]=0,e[3]=-i,e[4]=r,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e):new u(r,-i,0,i,r,0,0,0,1)},u.toArray=function(t,e){return n(e)?(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):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},u.getElementIndex=function(t,e){return 3*t+e},u.getColumn=function(t,e,n){var r=3*e,i=t[r],a=t[r+1],o=t[r+2];return n.x=i,n.y=a,n.z=o,n},u.setColumn=function(t,e,n,r){r=u.clone(t,r);var i=3*e;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},u.getRow=function(t,e,n){var r=t[e],i=t[e+3],a=t[e+6];return n.x=r,n.y=i,n.z=a,n},u.setRow=function(t,e,n,r){return r=u.clone(t,r),r[e]=n.x,r[e+3]=n.y,r[e+6]=n.z,r};var _=new t;u.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],_)),n.y=t.magnitude(t.fromElements(e[3],e[4],e[5],_)),n.z=t.magnitude(t.fromElements(e[6],e[7],e[8],_)),n};var T=new t;u.getMaximumScale=function(e){return u.getScale(e,T),t.maximumComponent(T)},u.multiply=function(t,e,n){var r=t[0]*e[0]+t[3]*e[1]+t[6]*e[2],i=t[1]*e[0]+t[4]*e[1]+t[7]*e[2],a=t[2]*e[0]+t[5]*e[1]+t[8]*e[2],o=t[0]*e[3]+t[3]*e[4]+t[6]*e[5],u=t[1]*e[3]+t[4]*e[4]+t[7]*e[5],E=t[2]*e[3]+t[5]*e[4]+t[8]*e[5],s=t[0]*e[6]+t[3]*e[7]+t[6]*e[8],c=t[1]*e[6]+t[4]*e[7]+t[7]*e[8],_=t[2]*e[6]+t[5]*e[7]+t[8]*e[8];return n[0]=r,n[1]=i,n[2]=a,n[3]=o,n[4]=u,n[5]=E,n[6]=s,n[7]=c,n[8]=_,n},u.add=function(t,e,n){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n[4]=t[4]+e[4],n[5]=t[5]+e[5],n[6]=t[6]+e[6],n[7]=t[7]+e[7],n[8]=t[8]+e[8],n},u.subtract=function(t,e,n){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n[4]=t[4]-e[4],n[5]=t[5]-e[5],n[6]=t[6]-e[6],n[7]=t[7]-e[7],n[8]=t[8]-e[8],n},u.multiplyByVector=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=t[0]*r+t[3]*i+t[6]*a,u=t[1]*r+t[4]*i+t[7]*a,E=t[2]*r+t[5]*i+t[8]*a;return n.x=o,n.y=u,n.z=E,n},u.multiplyByScalar=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n[4]=t[4]*e,n[5]=t[5]*e,n[6]=t[6]*e,n[7]=t[7]*e,n[8]=t[8]*e,n},u.multiplyByScale=function(t,e,n){return n[0]=t[0]*e.x,n[1]=t[1]*e.x,n[2]=t[2]*e.x,n[3]=t[3]*e.y,n[4]=t[4]*e.y,n[5]=t[5]*e.y,n[6]=t[6]*e.z,n[7]=t[7]*e.z,n[8]=t[8]*e.z,n},u.negate=function(t,e){return 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},u.transpose=function(t,e){var n=t[0],r=t[3],i=t[6],a=t[1],o=t[4],u=t[7],E=t[2],s=t[5],c=t[8];return e[0]=n,e[1]=r,e[2]=i,e[3]=a,e[4]=o,e[5]=u,e[6]=E,e[7]=s,e[8]=c,e};var R=[1,0,0],l=[2,2,1],f=new u,A=new u;return u.computeEigenDecomposition=function(t,e){var r=o.EPSILON20,i=10,a=0,_=0;n(e)||(e={});for(var T=e.unitary=u.clone(u.IDENTITY,e.unitary),R=e.diagonal=u.clone(t,e.diagonal),l=r*E(R);_<i&&s(R)>l;)c(R,f),u.transpose(f,A),u.multiply(R,f,R),u.multiply(A,R,R),u.multiply(T,f,T),++a>2&&(++_,a=0);return e},u.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e},u.determinant=function(t){var e=t[0],n=t[3],r=t[6],i=t[1],a=t[4],o=t[7],u=t[2],E=t[5],s=t[8];return e*(a*s-E*o)+i*(E*r-n*s)+u*(n*o-a*r)},u.inverse=function(t,e){var n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],E=t[5],s=t[6],c=t[7],_=t[8],T=u.determinant(t);e[0]=o*_-c*E,e[1]=c*i-r*_,e[2]=r*E-o*i,e[3]=s*E-a*_,e[4]=n*_-s*i,e[5]=a*i-n*E,e[6]=a*c-s*o,e[7]=s*r-n*c,e[8]=n*o-a*r;var R=1/T;return u.multiplyByScalar(e,R,e)},u.equals=function(t,e){return t===e||n(t)&&n(e)&&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]},u.equalsEpsilon=function(t,e,r){return t===e||n(t)&&n(e)&&Math.abs(t[0]-e[0])<=r&&Math.abs(t[1]-e[1])<=r&&Math.abs(t[2]-e[2])<=r&&Math.abs(t[3]-e[3])<=r&&Math.abs(t[4]-e[4])<=r&&Math.abs(t[5]-e[5])<=r&&Math.abs(t[6]-e[6])<=r&&Math.abs(t[7]-e[7])<=r&&Math.abs(t[8]-e[8])<=r},u.IDENTITY=a(new u(1,0,0,0,1,0,0,0,1)),u.ZERO=a(new u(0,0,0,0,0,0,0,0,0)),u.COLUMN0ROW0=0,u.COLUMN0ROW1=1,u.COLUMN0ROW2=2,u.COLUMN1ROW0=3,u.COLUMN1ROW1=4,u.COLUMN1ROW2=5,u.COLUMN2ROW0=6,u.COLUMN2ROW1=7,u.COLUMN2ROW2=8,r(u.prototype,{length:{get:function(){return u.packedLength}}}),u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]&&t[4]===e[n+4]&&t[5]===e[n+5]&&t[6]===e[n+6]&&t[7]===e[n+7]&&t[8]===e[n+8]},u.prototype.equalsEpsilon=function(t,e){return u.equalsEpsilon(this,t,e)},u.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},u}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i){"use strict";function a(e,n,r,i){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(i,0)}a.fromElements=function(t,n,r,i,o){return e(o)?(o.x=t,o.y=n,o.z=r,o.w=i,o):new a(t,n,r,i)},a.fromColor=function(t,n){return e(n)?(n.x=t.red,n.y=t.green,n.z=t.blue,n.w=t.alpha,n):new a(t.red,t.green,t.blue,t.alpha)},a.clone=function(t,n){if(e(t))return e(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n.w=t.w,n):new a(t.x,t.y,t.z,t.w)},a.packedLength=4,a.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},a.unpack=function(n,r,i){return r=t(r,0),e(i)||(i=new a),i.x=n[r++],i.y=n[r++],i.z=n[r++],i.w=n[r],i},a.packArray=function(t,n){var r=t.length;e(n)?n.length=4*r:n=new Array(4*r);for(var i=0;i<r;++i)a.pack(t[i],n,4*i);return n},a.unpackArray=function(t,n){var r=t.length;e(n)?n.length=r/4:n=new Array(r/4);for(var i=0;i<r;i+=4){var o=i/4;n[o]=a.unpack(t,i,n[o])}return n},a.fromArray=a.unpack,a.maximumComponent=function(t){return Math.max(t.x,t.y,t.z,t.w)},a.minimumComponent=function(t){return Math.min(t.x,t.y,t.z,t.w)},a.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n.z=Math.min(t.z,e.z),n.w=Math.min(t.w,e.w),n},a.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n.z=Math.max(t.z,e.z),n.w=Math.max(t.w,e.w),n},a.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w},a.magnitude=function(t){return Math.sqrt(a.magnitudeSquared(t))};var o=new a;a.distance=function(t,e){return a.subtract(t,e,o),a.magnitude(o)},a.distanceSquared=function(t,e){return a.subtract(t,e,o),a.magnitudeSquared(o)},a.normalize=function(t,e){var n=a.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e.w=t.w/n,e},a.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z+t.w*e.w},a.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n.z=t.z*e.z,n.w=t.w*e.w,n},a.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n.z=t.z/e.z,n.w=t.w/e.w,n},a.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n.w=t.w+e.w,n},a.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n.w=t.w-e.w,n},a.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*e,n.w=t.w*e,n},a.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n.w=t.w/e,n},a.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e.w=-t.w,e},a.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e.w=Math.abs(t.w),e};var u=new a;a.lerp=function(t,e,n,r){return a.multiplyByScalar(e,n,u),r=a.multiplyByScalar(t,1-n,r),a.add(u,r,r)};var E=new a;return a.mostOrthogonalAxis=function(t,e){var n=a.normalize(t,E);return a.abs(n,n),e=n.x<=n.y?n.x<=n.z?n.x<=n.w?a.clone(a.UNIT_X,e):a.clone(a.UNIT_W,e):n.z<=n.w?a.clone(a.UNIT_Z,e):a.clone(a.UNIT_W,e):n.y<=n.z?n.y<=n.w?a.clone(a.UNIT_Y,e):a.clone(a.UNIT_W,e):n.z<=n.w?a.clone(a.UNIT_Z,e):a.clone(a.UNIT_W,e)},a.equals=function(t,n){return t===n||e(t)&&e(n)&&t.x===n.x&&t.y===n.y&&t.z===n.z&&t.w===n.w},a.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]&&t.w===e[n+3]},a.equalsEpsilon=function(t,n,r,a){return t===n||e(t)&&e(n)&&i.equalsEpsilon(t.x,n.x,r,a)&&i.equalsEpsilon(t.y,n.y,r,a)&&i.equalsEpsilon(t.z,n.z,r,a)&&i.equalsEpsilon(t.w,n.w,r,a)},a.ZERO=r(new a(0,0,0,0)),a.UNIT_X=r(new a(1,0,0,0)),a.UNIT_Y=r(new a(0,1,0,0)),a.UNIT_Z=r(new a(0,0,1,0)),a.UNIT_W=r(new a(0,0,0,1)),a.prototype.clone=function(t){return a.clone(this,t)},a.prototype.equals=function(t){return a.equals(this,t)},a.prototype.equalsEpsilon=function(t,e,n){return a.equalsEpsilon(this,t,e,n)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},a}),define("Core/RuntimeError",["./defined"],function(t){"use strict";function e(t){this.name="RuntimeError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(t,e,n,r,i,a,o,u,E,s){"use strict";function c(t,e,r,i,a,o,u,E,s,c,_,T,R,l,f,A){this[0]=n(t,0),this[1]=n(a,0),this[2]=n(s,0),this[3]=n(R,0),this[4]=n(e,0), -this[5]=n(o,0),this[6]=n(c,0),this[7]=n(l,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(_,0),this[11]=n(f,0),this[12]=n(i,0),this[13]=n(E,0),this[14]=n(T,0),this[15]=n(A,0)}c.packedLength=16,c.pack=function(t,e,r){return r=n(r,0),e[r++]=t[0],e[r++]=t[1],e[r++]=t[2],e[r++]=t[3],e[r++]=t[4],e[r++]=t[5],e[r++]=t[6],e[r++]=t[7],e[r++]=t[8],e[r++]=t[9],e[r++]=t[10],e[r++]=t[11],e[r++]=t[12],e[r++]=t[13],e[r++]=t[14],e[r]=t[15],e},c.unpack=function(t,e,i){return e=n(e,0),r(i)||(i=new c),i[0]=t[e++],i[1]=t[e++],i[2]=t[e++],i[3]=t[e++],i[4]=t[e++],i[5]=t[e++],i[6]=t[e++],i[7]=t[e++],i[8]=t[e++],i[9]=t[e++],i[10]=t[e++],i[11]=t[e++],i[12]=t[e++],i[13]=t[e++],i[14]=t[e++],i[15]=t[e],i},c.clone=function(t,e){if(r(t))return r(e)?(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],e):new c(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15])},c.fromArray=c.unpack,c.fromColumnMajorArray=function(t,e){return c.clone(t,e)},c.fromRowMajorArray=function(t,e){return r(e)?(e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15],e):new c(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},c.fromRotationTranslation=function(e,i,a){return i=n(i,t.ZERO),r(a)?(a[0]=e[0],a[1]=e[1],a[2]=e[2],a[3]=0,a[4]=e[3],a[5]=e[4],a[6]=e[5],a[7]=0,a[8]=e[6],a[9]=e[7],a[10]=e[8],a[11]=0,a[12]=i.x,a[13]=i.y,a[14]=i.z,a[15]=1,a):new c(e[0],e[3],e[6],i.x,e[1],e[4],e[7],i.y,e[2],e[5],e[8],i.z,0,0,0,1)},c.fromTranslationQuaternionRotationScale=function(t,e,n,i){r(i)||(i=new c);var a=n.x,o=n.y,u=n.z,E=e.x*e.x,s=e.x*e.y,_=e.x*e.z,T=e.x*e.w,R=e.y*e.y,l=e.y*e.z,f=e.y*e.w,A=e.z*e.z,h=e.z*e.w,N=e.w*e.w,d=E-R-A+N,I=2*(s-h),S=2*(_+f),m=2*(s+h),M=-E+R-A+N,y=2*(l-T),O=2*(_-f),p=2*(l+T),C=-E-R+A+N;return i[0]=d*a,i[1]=m*a,i[2]=O*a,i[3]=0,i[4]=I*o,i[5]=M*o,i[6]=p*o,i[7]=0,i[8]=S*u,i[9]=y*u,i[10]=C*u,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,i},c.fromTranslationRotationScale=function(t,e){return c.fromTranslationQuaternionRotationScale(t.translation,t.rotation,t.scale,e)},c.fromTranslation=function(t,e){return c.fromRotationTranslation(E.IDENTITY,t,e)},c.fromScale=function(t,e){return r(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t.y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t.z,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new c(t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1)},c.fromUniformScale=function(t,e){return r(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new c(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1)};var _=new t,T=new t,R=new t;c.fromCamera=function(e,n){var i=e.position,a=e.direction,o=e.up;t.normalize(a,_),t.normalize(t.cross(_,o,T),T),t.normalize(t.cross(T,_,R),R);var u=T.x,E=T.y,s=T.z,l=_.x,f=_.y,A=_.z,h=R.x,N=R.y,d=R.z,I=i.x,S=i.y,m=i.z,M=u*-I+E*-S+s*-m,y=h*-I+N*-S+d*-m,O=l*I+f*S+A*m;return r(n)?(n[0]=u,n[1]=h,n[2]=-l,n[3]=0,n[4]=E,n[5]=N,n[6]=-f,n[7]=0,n[8]=s,n[9]=d,n[10]=-A,n[11]=0,n[12]=M,n[13]=y,n[14]=O,n[15]=1,n):new c(u,E,s,M,h,N,d,y,-l,-f,-A,O,0,0,0,1)},c.computePerspectiveFieldOfView=function(t,e,n,r,i){var a=Math.tan(.5*t),o=1/a,u=o/e,E=(r+n)/(n-r),s=2*r*n/(n-r);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=o,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=E,i[11]=-1,i[12]=0,i[13]=0,i[14]=s,i[15]=0,i},c.computeOrthographicOffCenter=function(t,e,n,r,i,a,o){var u=1/(e-t),E=1/(r-n),s=1/(a-i),c=-(e+t)*u,_=-(r+n)*E,T=-(a+i)*s;return u*=2,E*=2,s*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=s,o[11]=0,o[12]=c,o[13]=_,o[14]=T,o[15]=1,o},c.computePerspectiveOffCenter=function(t,e,n,r,i,a,o){var u=2*i/(e-t),E=2*i/(r-n),s=(e+t)/(e-t),c=(r+n)/(r-n),_=-(a+i)/(a-i),T=-1,R=-2*a*i/(a-i);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=s,o[9]=c,o[10]=_,o[11]=T,o[12]=0,o[13]=0,o[14]=R,o[15]=0,o},c.computeInfinitePerspectiveOffCenter=function(t,e,n,r,i,a){var o=2*i/(e-t),u=2*i/(r-n),E=(e+t)/(e-t),s=(r+n)/(r-n),c=-1,_=-1,T=-2*i;return a[0]=o,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=E,a[9]=s,a[10]=c,a[11]=_,a[12]=0,a[13]=0,a[14]=T,a[15]=0,a},c.computeViewportTransformation=function(t,e,r,i){t=n(t,n.EMPTY_OBJECT);var a=n(t.x,0),o=n(t.y,0),u=n(t.width,0),E=n(t.height,0);e=n(e,0),r=n(r,1);var s=.5*u,c=.5*E,_=.5*(r-e),T=s,R=c,l=_,f=a+s,A=o+c,h=e+_,N=1;return i[0]=T,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=R,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=l,i[11]=0,i[12]=f,i[13]=A,i[14]=h,i[15]=N,i},c.computeView=function(e,n,r,i,a){return a[0]=i.x,a[1]=r.x,a[2]=-n.x,a[3]=0,a[4]=i.y,a[5]=r.y,a[6]=-n.y,a[7]=0,a[8]=i.z,a[9]=r.z,a[10]=-n.z,a[11]=0,a[12]=-t.dot(i,e),a[13]=-t.dot(r,e),a[14]=t.dot(n,e),a[15]=1,a},c.toArray=function(t,e){return r(e)?(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],e):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]},c.getElementIndex=function(t,e){return 4*t+e},c.getColumn=function(t,e,n){var r=4*e,i=t[r],a=t[r+1],o=t[r+2],u=t[r+3];return n.x=i,n.y=a,n.z=o,n.w=u,n},c.setColumn=function(t,e,n,r){r=c.clone(t,r);var i=4*e;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r[i+3]=n.w,r},c.setTranslation=function(t,e,n){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=t[15],n},c.getRow=function(t,e,n){var r=t[e],i=t[e+4],a=t[e+8],o=t[e+12];return n.x=r,n.y=i,n.z=a,n.w=o,n},c.setRow=function(t,e,n,r){return r=c.clone(t,r),r[e]=n.x,r[e+4]=n.y,r[e+8]=n.z,r[e+12]=n.w,r};var l=new t;c.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],l)),n.y=t.magnitude(t.fromElements(e[4],e[5],e[6],l)),n.z=t.magnitude(t.fromElements(e[8],e[9],e[10],l)),n};var f=new t;c.getMaximumScale=function(e){return c.getScale(e,f),t.maximumComponent(f)},c.multiply=function(t,e,n){var r=t[0],i=t[1],a=t[2],o=t[3],u=t[4],E=t[5],s=t[6],c=t[7],_=t[8],T=t[9],R=t[10],l=t[11],f=t[12],A=t[13],h=t[14],N=t[15],d=e[0],I=e[1],S=e[2],m=e[3],M=e[4],y=e[5],O=e[6],p=e[7],C=e[8],U=e[9],L=e[10],F=e[11],P=e[12],v=e[13],x=e[14],g=e[15],w=r*d+u*I+_*S+f*m,D=i*d+E*I+T*S+A*m,B=a*d+s*I+R*S+h*m,z=o*d+c*I+l*S+N*m,G=r*M+u*y+_*O+f*p,b=i*M+E*y+T*O+A*p,X=a*M+s*y+R*O+h*p,V=o*M+c*y+l*O+N*p,q=r*C+u*U+_*L+f*F,H=i*C+E*U+T*L+A*F,W=a*C+s*U+R*L+h*F,Y=o*C+c*U+l*L+N*F,K=r*P+u*v+_*x+f*g,k=i*P+E*v+T*x+A*g,Z=a*P+s*v+R*x+h*g,j=o*P+c*v+l*x+N*g;return n[0]=w,n[1]=D,n[2]=B,n[3]=z,n[4]=G,n[5]=b,n[6]=X,n[7]=V,n[8]=q,n[9]=H,n[10]=W,n[11]=Y,n[12]=K,n[13]=k,n[14]=Z,n[15]=j,n},c.add=function(t,e,n){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n[4]=t[4]+e[4],n[5]=t[5]+e[5],n[6]=t[6]+e[6],n[7]=t[7]+e[7],n[8]=t[8]+e[8],n[9]=t[9]+e[9],n[10]=t[10]+e[10],n[11]=t[11]+e[11],n[12]=t[12]+e[12],n[13]=t[13]+e[13],n[14]=t[14]+e[14],n[15]=t[15]+e[15],n},c.subtract=function(t,e,n){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n[4]=t[4]-e[4],n[5]=t[5]-e[5],n[6]=t[6]-e[6],n[7]=t[7]-e[7],n[8]=t[8]-e[8],n[9]=t[9]-e[9],n[10]=t[10]-e[10],n[11]=t[11]-e[11],n[12]=t[12]-e[12],n[13]=t[13]-e[13],n[14]=t[14]-e[14],n[15]=t[15]-e[15],n},c.multiplyTransformation=function(t,e,n){var r=t[0],i=t[1],a=t[2],o=t[4],u=t[5],E=t[6],s=t[8],c=t[9],_=t[10],T=t[12],R=t[13],l=t[14],f=e[0],A=e[1],h=e[2],N=e[4],d=e[5],I=e[6],S=e[8],m=e[9],M=e[10],y=e[12],O=e[13],p=e[14],C=r*f+o*A+s*h,U=i*f+u*A+c*h,L=a*f+E*A+_*h,F=r*N+o*d+s*I,P=i*N+u*d+c*I,v=a*N+E*d+_*I,x=r*S+o*m+s*M,g=i*S+u*m+c*M,w=a*S+E*m+_*M,D=r*y+o*O+s*p+T,B=i*y+u*O+c*p+R,z=a*y+E*O+_*p+l;return n[0]=C,n[1]=U,n[2]=L,n[3]=0,n[4]=F,n[5]=P,n[6]=v,n[7]=0,n[8]=x,n[9]=g,n[10]=w,n[11]=0,n[12]=D,n[13]=B,n[14]=z,n[15]=1,n},c.multiplyByMatrix3=function(t,e,n){var r=t[0],i=t[1],a=t[2],o=t[4],u=t[5],E=t[6],s=t[8],c=t[9],_=t[10],T=e[0],R=e[1],l=e[2],f=e[3],A=e[4],h=e[5],N=e[6],d=e[7],I=e[8],S=r*T+o*R+s*l,m=i*T+u*R+c*l,M=a*T+E*R+_*l,y=r*f+o*A+s*h,O=i*f+u*A+c*h,p=a*f+E*A+_*h,C=r*N+o*d+s*I,U=i*N+u*d+c*I,L=a*N+E*d+_*I;return n[0]=S,n[1]=m,n[2]=M,n[3]=0,n[4]=y,n[5]=O,n[6]=p,n[7]=0,n[8]=C,n[9]=U,n[10]=L,n[11]=0,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n},c.multiplyByTranslation=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=r*t[0]+i*t[4]+a*t[8]+t[12],u=r*t[1]+i*t[5]+a*t[9]+t[13],E=r*t[2]+i*t[6]+a*t[10]+t[14];return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=o,n[13]=u,n[14]=E,n[15]=t[15],n};var A=new t;c.multiplyByUniformScale=function(t,e,n){return A.x=e,A.y=e,A.z=e,c.multiplyByScale(t,A,n)},c.multiplyByScale=function(t,e,n){var r=e.x,i=e.y,a=e.z;return 1===r&&1===i&&1===a?c.clone(t,n):(n[0]=r*t[0],n[1]=r*t[1],n[2]=r*t[2],n[3]=0,n[4]=i*t[4],n[5]=i*t[5],n[6]=i*t[6],n[7]=0,n[8]=a*t[8],n[9]=a*t[9],n[10]=a*t[10],n[11]=0,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=1,n)},c.multiplyByVector=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=e.w,u=t[0]*r+t[4]*i+t[8]*a+t[12]*o,E=t[1]*r+t[5]*i+t[9]*a+t[13]*o,s=t[2]*r+t[6]*i+t[10]*a+t[14]*o,c=t[3]*r+t[7]*i+t[11]*a+t[15]*o;return n.x=u,n.y=E,n.z=s,n.w=c,n},c.multiplyByPointAsVector=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=t[0]*r+t[4]*i+t[8]*a,u=t[1]*r+t[5]*i+t[9]*a,E=t[2]*r+t[6]*i+t[10]*a;return n.x=o,n.y=u,n.z=E,n},c.multiplyByPoint=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=t[0]*r+t[4]*i+t[8]*a+t[12],u=t[1]*r+t[5]*i+t[9]*a+t[13],E=t[2]*r+t[6]*i+t[10]*a+t[14];return n.x=o,n.y=u,n.z=E,n},c.multiplyByScalar=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n[4]=t[4]*e,n[5]=t[5]*e,n[6]=t[6]*e,n[7]=t[7]*e,n[8]=t[8]*e,n[9]=t[9]*e,n[10]=t[10]*e,n[11]=t[11]*e,n[12]=t[12]*e,n[13]=t[13]*e,n[14]=t[14]*e,n[15]=t[15]*e,n},c.negate=function(t,e){return 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],e},c.transpose=function(t,e){var n=t[1],r=t[2],i=t[3],a=t[6],o=t[7],u=t[11];return e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=r,e[9]=a,e[10]=t[10],e[11]=t[14],e[12]=i,e[13]=o,e[14]=u,e[15]=t[15],e},c.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e[9]=Math.abs(t[9]),e[10]=Math.abs(t[10]),e[11]=Math.abs(t[11]),e[12]=Math.abs(t[12]),e[13]=Math.abs(t[13]),e[14]=Math.abs(t[14]),e[15]=Math.abs(t[15]),e},c.equals=function(t,e){return t===e||r(t)&&r(e)&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[3]===e[3]&&t[7]===e[7]&&t[11]===e[11]&&t[15]===e[15]},c.equalsEpsilon=function(t,e,n){return t===e||r(t)&&r(e)&&Math.abs(t[0]-e[0])<=n&&Math.abs(t[1]-e[1])<=n&&Math.abs(t[2]-e[2])<=n&&Math.abs(t[3]-e[3])<=n&&Math.abs(t[4]-e[4])<=n&&Math.abs(t[5]-e[5])<=n&&Math.abs(t[6]-e[6])<=n&&Math.abs(t[7]-e[7])<=n&&Math.abs(t[8]-e[8])<=n&&Math.abs(t[9]-e[9])<=n&&Math.abs(t[10]-e[10])<=n&&Math.abs(t[11]-e[11])<=n&&Math.abs(t[12]-e[12])<=n&&Math.abs(t[13]-e[13])<=n&&Math.abs(t[14]-e[14])<=n&&Math.abs(t[15]-e[15])<=n},c.getTranslation=function(t,e){return e.x=t[12],e.y=t[13],e.z=t[14],e},c.getRotation=function(t,e){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e};var h=new E,N=new E,d=new e,I=new e(0,0,0,1);return c.inverse=function(t,n){if(E.equalsEpsilon(c.getRotation(t,h),N,u.EPSILON7)&&e.equals(c.getRow(t,3,d),I))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-t[12],n[13]=-t[13],n[14]=-t[14],n[15]=1,n;var r=t[0],i=t[4],a=t[8],o=t[12],_=t[1],T=t[5],R=t[9],l=t[13],f=t[2],A=t[6],S=t[10],m=t[14],M=t[3],y=t[7],O=t[11],p=t[15],C=S*p,U=m*O,L=A*p,F=m*y,P=A*O,v=S*y,x=f*p,g=m*M,w=f*O,D=S*M,B=f*y,z=A*M,G=C*T+F*R+P*l-(U*T+L*R+v*l),b=U*_+x*R+D*l-(C*_+g*R+w*l),X=L*_+g*T+B*l-(F*_+x*T+z*l),V=v*_+w*T+z*R-(P*_+D*T+B*R),q=U*i+L*a+v*o-(C*i+F*a+P*o),H=C*r+g*a+w*o-(U*r+x*a+D*o),W=F*r+x*i+z*o-(L*r+g*i+B*o),Y=P*r+D*i+B*a-(v*r+w*i+z*a);C=a*l,U=o*R,L=i*l,F=o*T,P=i*R,v=a*T,x=r*l,g=o*_,w=r*R,D=a*_,B=r*T,z=i*_;var K=C*y+F*O+P*p-(U*y+L*O+v*p),k=U*M+x*O+D*p-(C*M+g*O+w*p),Z=L*M+g*y+B*p-(F*M+x*y+z*p),j=v*M+w*y+z*O-(P*M+D*y+B*O),Q=L*S+v*m+U*A-(P*m+C*A+F*S),J=w*m+C*f+g*S-(x*S+D*m+U*f),$=x*A+z*m+F*f-(B*m+L*f+g*A),tt=B*S+P*f+D*A-(w*A+z*S+v*f),et=r*G+i*b+a*X+o*V;if(Math.abs(et)<u.EPSILON20)throw new s("matrix is not invertible because its determinate is zero.");return et=1/et,n[0]=G*et,n[1]=b*et,n[2]=X*et,n[3]=V*et,n[4]=q*et,n[5]=H*et,n[6]=W*et,n[7]=Y*et,n[8]=K*et,n[9]=k*et,n[10]=Z*et,n[11]=j*et,n[12]=Q*et,n[13]=J*et,n[14]=$*et,n[15]=tt*et,n},c.inverseTransformation=function(t,e){var n=t[0],r=t[1],i=t[2],a=t[4],o=t[5],u=t[6],E=t[8],s=t[9],c=t[10],_=t[12],T=t[13],R=t[14],l=-n*_-r*T-i*R,f=-a*_-o*T-u*R,A=-E*_-s*T-c*R;return e[0]=n,e[1]=a,e[2]=E,e[3]=0,e[4]=r,e[5]=o,e[6]=s,e[7]=0,e[8]=i,e[9]=u,e[10]=c,e[11]=0,e[12]=l,e[13]=f,e[14]=A,e[15]=1,e},c.IDENTITY=o(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),c.ZERO=o(new c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN0ROW3=3,c.COLUMN1ROW0=4,c.COLUMN1ROW1=5,c.COLUMN1ROW2=6,c.COLUMN1ROW3=7,c.COLUMN2ROW0=8,c.COLUMN2ROW1=9,c.COLUMN2ROW2=10,c.COLUMN2ROW3=11,c.COLUMN3ROW0=12,c.COLUMN3ROW1=13,c.COLUMN3ROW2=14,c.COLUMN3ROW3=15,i(c.prototype,{length:{get:function(){return c.packedLength}}}),c.prototype.clone=function(t){return c.clone(this,t)},c.prototype.equals=function(t){return c.equals(this,t)},c.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]&&t[4]===e[n+4]&&t[5]===e[n+5]&&t[6]===e[n+6]&&t[7]===e[n+7]&&t[8]===e[n+8]&&t[9]===e[n+9]&&t[10]===e[n+10]&&t[11]===e[n+11]&&t[12]===e[n+12]&&t[13]===e[n+13]&&t[14]===e[n+14]&&t[15]===e[n+15]},c.prototype.equalsEpsilon=function(t,e){return c.equalsEpsilon(this,t,e)},c.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]+")"},c}),define("Core/Rectangle",["./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(t,e,n,r,i,a,o,u){"use strict";function E(t,n,r,i){this.west=e(t,0),this.south=e(n,0),this.east=e(r,0),this.north=e(i,0)}r(E.prototype,{width:{get:function(){return E.computeWidth(this)}},height:{get:function(){return E.computeHeight(this)}}}),E.packedLength=4,E.pack=function(t,n,r){return r=e(r,0),n[r++]=t.west,n[r++]=t.south,n[r++]=t.east,n[r]=t.north,n},E.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new E),i.west=t[r++],i.south=t[r++],i.east=t[r++],i.north=t[r],i},E.computeWidth=function(t){var e=t.east,n=t.west;return e<n&&(e+=u.TWO_PI),e-n},E.computeHeight=function(t){return t.north-t.south},E.fromDegrees=function(t,r,i,a,o){return t=u.toRadians(e(t,0)),r=u.toRadians(e(r,0)),i=u.toRadians(e(i,0)),a=u.toRadians(e(a,0)),n(o)?(o.west=t,o.south=r,o.east=i,o.north=a,o):new E(t,r,i,a)},E.fromCartographicArray=function(t,e){for(var r=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=Number.MAX_VALUE,c=-Number.MAX_VALUE,_=0,T=t.length;_<T;_++){var R=t[_];r=Math.min(r,R.longitude),i=Math.max(i,R.longitude),s=Math.min(s,R.latitude),c=Math.max(c,R.latitude);var l=R.longitude>=0?R.longitude:R.longitude+u.TWO_PI;a=Math.min(a,l),o=Math.max(o,l)}return i-r>o-a&&(r=a,i=o,i>u.PI&&(i-=u.TWO_PI),r>u.PI&&(r-=u.TWO_PI)),n(e)?(e.west=r,e.south=s,e.east=i,e.north=c,e):new E(r,s,i,c)},E.fromCartesianArray=function(t,e,r){for(var i=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,s=-Number.MAX_VALUE,c=Number.MAX_VALUE,_=-Number.MAX_VALUE,T=0,R=t.length;T<R;T++){var l=e.cartesianToCartographic(t[T]);i=Math.min(i,l.longitude),a=Math.max(a,l.longitude),c=Math.min(c,l.latitude),_=Math.max(_,l.latitude);var f=l.longitude>=0?l.longitude:l.longitude+u.TWO_PI;o=Math.min(o,f),s=Math.max(s,f)}return a-i>s-o&&(i=o,a=s,a>u.PI&&(a-=u.TWO_PI),i>u.PI&&(i-=u.TWO_PI)),n(r)?(r.west=i,r.south=c,r.east=a,r.north=_,r):new E(i,c,a,_)},E.clone=function(t,e){if(n(t))return n(e)?(e.west=t.west,e.south=t.south,e.east=t.east,e.north=t.north,e):new E(t.west,t.south,t.east,t.north)},E.prototype.clone=function(t){return E.clone(this,t)},E.prototype.equals=function(t){return E.equals(this,t)},E.equals=function(t,e){return t===e||n(t)&&n(e)&&t.west===e.west&&t.south===e.south&&t.east===e.east&&t.north===e.north},E.prototype.equalsEpsilon=function(t,e){return n(t)&&Math.abs(this.west-t.west)<=e&&Math.abs(this.south-t.south)<=e&&Math.abs(this.east-t.east)<=e&&Math.abs(this.north-t.north)<=e},E.validate=function(t){},E.southwest=function(e,r){return n(r)?(r.longitude=e.west,r.latitude=e.south,r.height=0,r):new t(e.west,e.south)},E.northwest=function(e,r){return n(r)?(r.longitude=e.west,r.latitude=e.north,r.height=0,r):new t(e.west,e.north)},E.northeast=function(e,r){return n(r)?(r.longitude=e.east,r.latitude=e.north,r.height=0,r):new t(e.east,e.north)},E.southeast=function(e,r){return n(r)?(r.longitude=e.east,r.latitude=e.south,r.height=0,r):new t(e.east,e.south)},E.center=function(e,r){var i=e.east,a=e.west;i<a&&(i+=u.TWO_PI);var o=u.negativePiToPi(.5*(a+i)),E=.5*(e.south+e.north);return n(r)?(r.longitude=o,r.latitude=E,r.height=0,r):new t(o,E)},E.intersection=function(t,e,r){var i=t.east,a=t.west,o=e.east,s=e.west;i<a&&o>0?i+=u.TWO_PI:o<s&&i>0&&(o+=u.TWO_PI),i<a&&s<0?s+=u.TWO_PI:o<s&&a<0&&(a+=u.TWO_PI);var c=u.negativePiToPi(Math.max(a,s)),_=u.negativePiToPi(Math.min(i,o));if(!((t.west<t.east||e.west<e.east)&&_<=c)){var T=Math.max(t.south,e.south),R=Math.min(t.north,e.north);if(!(T>=R))return n(r)?(r.west=c,r.south=T,r.east=_,r.north=R,r):new E(c,T,_,R)}},E.simpleIntersection=function(t,e,r){var i=Math.max(t.west,e.west),a=Math.max(t.south,e.south),o=Math.min(t.east,e.east),u=Math.min(t.north,e.north);if(!(a>=u||i>=o))return n(r)?(r.west=i,r.south=a,r.east=o,r.north=u,r):new E(i,a,o,u)},E.union=function(t,e,r){n(r)||(r=new E);var i=t.east,a=t.west,o=e.east,s=e.west;i<a&&o>0?i+=u.TWO_PI:o<s&&i>0&&(o+=u.TWO_PI),i<a&&s<0?s+=u.TWO_PI:o<s&&a<0&&(a+=u.TWO_PI);var c=u.convertLongitudeRange(Math.min(a,s)),_=u.convertLongitudeRange(Math.max(i,o));return r.west=c,r.south=Math.min(t.south,e.south),r.east=_,r.north=Math.max(t.north,e.north),r},E.expand=function(t,e,r){return n(r)||(r=new E),r.west=Math.min(t.west,e.longitude),r.south=Math.min(t.south,e.latitude),r.east=Math.max(t.east,e.longitude),r.north=Math.max(t.north,e.latitude),r},E.contains=function(t,e){var n=e.longitude,r=e.latitude,i=t.west,a=t.east;return a<i&&(a+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>i||u.equalsEpsilon(n,i,u.EPSILON14))&&(n<a||u.equalsEpsilon(n,a,u.EPSILON14))&&r>=t.south&&r<=t.north};var s=new t;return E.subsample=function(t,r,i,o){r=e(r,a.WGS84),i=e(i,0),n(o)||(o=[]);var c=0,_=t.north,T=t.south,R=t.east,l=t.west,f=s;f.height=i,f.longitude=l,f.latitude=_,o[c]=r.cartographicToCartesian(f,o[c]),c++,f.longitude=R,o[c]=r.cartographicToCartesian(f,o[c]),c++,f.latitude=T,o[c]=r.cartographicToCartesian(f,o[c]),c++,f.longitude=l,o[c]=r.cartographicToCartesian(f,o[c]),c++,_<0?f.latitude=_:T>0?f.latitude=T:f.latitude=0;for(var A=1;A<8;++A)f.longitude=-Math.PI+A*u.PI_OVER_TWO,E.contains(t,f)&&(o[c]=r.cartographicToCartesian(f,o[c]),c++);return 0===f.latitude&&(f.longitude=l,o[c]=r.cartographicToCartesian(f,o[c]),c++,f.longitude=R,o[c]=r.cartographicToCartesian(f,o[c]),c++),o.length=c,o},E.MAX_VALUE=o(new E(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),E}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(t,e,n,r,i,a,o,u,E,s,c,_){"use strict";function T(e,r){this.center=t.clone(n(e,t.ZERO)),this.radius=n(r,0)}var R=new t,l=new t,f=new t,A=new t,h=new t,N=new t,d=new t,I=new t,S=new t,m=new t,M=new t,y=new t;T.fromPoints=function(e,n){if(r(n)||(n=new T),!r(e)||0===e.length)return n.center=t.clone(t.ZERO,n.center),n.radius=0,n;for(var i=t.clone(e[0],d),a=t.clone(i,R),o=t.clone(i,l),u=t.clone(i,f),E=t.clone(i,A),s=t.clone(i,h),c=t.clone(i,N),_=e.length,O=1;O<_;O++){t.clone(e[O],i);var p=i.x,C=i.y,U=i.z;p<a.x&&t.clone(i,a),p>E.x&&t.clone(i,E),C<o.y&&t.clone(i,o),C>s.y&&t.clone(i,s),U<u.z&&t.clone(i,u),U>c.z&&t.clone(i,c)}var L=t.magnitudeSquared(t.subtract(E,a,I)),F=t.magnitudeSquared(t.subtract(s,o,I)),P=t.magnitudeSquared(t.subtract(c,u,I)),v=a,x=E,g=L;F>g&&(g=F,v=o,x=s),P>g&&(g=P,v=u,x=c);var w=S;w.x=.5*(v.x+x.x),w.y=.5*(v.y+x.y),w.z=.5*(v.z+x.z);var D=t.magnitudeSquared(t.subtract(x,w,I)),B=Math.sqrt(D),z=m;z.x=a.x,z.y=o.y,z.z=u.z;var G=M;G.x=E.x,G.y=s.y,G.z=c.z;var b=t.multiplyByScalar(t.add(z,G,I),.5,y),X=0;for(O=0;O<_;O++){t.clone(e[O],i);var V=t.magnitude(t.subtract(i,b,I));V>X&&(X=V);var q=t.magnitudeSquared(t.subtract(i,w,I));if(q>D){var H=Math.sqrt(q);B=.5*(B+H),D=B*B;var W=H-B;w.x=(B*w.x+W*i.x)/H,w.y=(B*w.y+W*i.y)/H,w.z=(B*w.z+W*i.z)/H}}return B<X?(t.clone(w,n.center),n.radius=B):(t.clone(b,n.center),n.radius=X),n};var O=new o,p=new t,C=new t,U=new e,L=new e;T.fromRectangle2D=function(t,e,n){return T.fromRectangleWithHeights2D(t,e,0,0,n)},T.fromRectangleWithHeights2D=function(e,i,a,o,u){if(r(u)||(u=new T),!r(e))return u.center=t.clone(t.ZERO,u.center),u.radius=0,u;i=n(i,O),_.southwest(e,U),U.height=a,_.northeast(e,L),L.height=o;var E=i.project(U,p),s=i.project(L,C),c=s.x-E.x,R=s.y-E.y,l=s.z-E.z;u.radius=.5*Math.sqrt(c*c+R*R+l*l);var f=u.center;return f.x=E.x+.5*c,f.y=E.y+.5*R,f.z=E.z+.5*l,u};var F=[];T.fromRectangle3D=function(t,e,i,o){e=n(e,a.WGS84),i=n(i,0);var u;return r(t)&&(u=_.subsample(t,e,i,F)),T.fromPoints(u,o)},T.fromVertices=function(e,i,a,o){if(r(o)||(o=new T),!r(e)||0===e.length)return o.center=t.clone(t.ZERO,o.center),o.radius=0,o;i=n(i,t.ZERO),a=n(a,3);var u=d;u.x=e[0]+i.x,u.y=e[1]+i.y,u.z=e[2]+i.z;for(var E=t.clone(u,R),s=t.clone(u,l),c=t.clone(u,f),_=t.clone(u,A),O=t.clone(u,h),p=t.clone(u,N),C=e.length,U=0;U<C;U+=a){var L=e[U]+i.x,F=e[U+1]+i.y,P=e[U+2]+i.z;u.x=L,u.y=F,u.z=P,L<E.x&&t.clone(u,E),L>_.x&&t.clone(u,_),F<s.y&&t.clone(u,s),F>O.y&&t.clone(u,O),P<c.z&&t.clone(u,c),P>p.z&&t.clone(u,p)}var v=t.magnitudeSquared(t.subtract(_,E,I)),x=t.magnitudeSquared(t.subtract(O,s,I)),g=t.magnitudeSquared(t.subtract(p,c,I)),w=E,D=_,B=v;x>B&&(B=x,w=s,D=O),g>B&&(B=g,w=c,D=p);var z=S;z.x=.5*(w.x+D.x),z.y=.5*(w.y+D.y),z.z=.5*(w.z+D.z);var G=t.magnitudeSquared(t.subtract(D,z,I)),b=Math.sqrt(G),X=m;X.x=E.x,X.y=s.y,X.z=c.z;var V=M;V.x=_.x,V.y=O.y,V.z=p.z;var q=t.multiplyByScalar(t.add(X,V,I),.5,y),H=0;for(U=0;U<C;U+=a){u.x=e[U]+i.x,u.y=e[U+1]+i.y,u.z=e[U+2]+i.z;var W=t.magnitude(t.subtract(u,q,I));W>H&&(H=W);var Y=t.magnitudeSquared(t.subtract(u,z,I));if(Y>G){var K=Math.sqrt(Y);b=.5*(b+K),G=b*b;var k=K-b;z.x=(b*z.x+k*u.x)/K,z.y=(b*z.y+k*u.y)/K,z.z=(b*z.z+k*u.z)/K}}return b<H?(t.clone(z,o.center),o.radius=b):(t.clone(q,o.center),o.radius=H),o},T.fromEncodedCartesianVertices=function(e,n,i){if(r(i)||(i=new T),!r(e)||!r(n)||e.length!==n.length||0===e.length)return i.center=t.clone(t.ZERO,i.center),i.radius=0,i;var a=d;a.x=e[0]+n[0],a.y=e[1]+n[1],a.z=e[2]+n[2];for(var o=t.clone(a,R),u=t.clone(a,l),E=t.clone(a,f),s=t.clone(a,A),c=t.clone(a,h),_=t.clone(a,N),O=e.length,p=0;p<O;p+=3){var C=e[p]+n[p],U=e[p+1]+n[p+1],L=e[p+2]+n[p+2];a.x=C,a.y=U,a.z=L,C<o.x&&t.clone(a,o),C>s.x&&t.clone(a,s),U<u.y&&t.clone(a,u),U>c.y&&t.clone(a,c),L<E.z&&t.clone(a,E),L>_.z&&t.clone(a,_)}var F=t.magnitudeSquared(t.subtract(s,o,I)),P=t.magnitudeSquared(t.subtract(c,u,I)),v=t.magnitudeSquared(t.subtract(_,E,I)),x=o,g=s,w=F;P>w&&(w=P,x=u,g=c),v>w&&(w=v,x=E,g=_);var D=S;D.x=.5*(x.x+g.x),D.y=.5*(x.y+g.y),D.z=.5*(x.z+g.z);var B=t.magnitudeSquared(t.subtract(g,D,I)),z=Math.sqrt(B),G=m;G.x=o.x,G.y=u.y,G.z=E.z;var b=M;b.x=s.x,b.y=c.y,b.z=_.z;var X=t.multiplyByScalar(t.add(G,b,I),.5,y),V=0;for(p=0;p<O;p+=3){a.x=e[p]+n[p],a.y=e[p+1]+n[p+1],a.z=e[p+2]+n[p+2];var q=t.magnitude(t.subtract(a,X,I));q>V&&(V=q);var H=t.magnitudeSquared(t.subtract(a,D,I));if(H>B){var W=Math.sqrt(H);z=.5*(z+W),B=z*z;var Y=W-z;D.x=(z*D.x+Y*a.x)/W,D.y=(z*D.y+Y*a.y)/W,D.z=(z*D.z+Y*a.z)/W}}return z<V?(t.clone(D,i.center),i.radius=z):(t.clone(X,i.center),i.radius=V),i},T.fromCornerPoints=function(e,n,i){r(i)||(i=new T);var a=i.center;return t.add(e,n,a),t.multiplyByScalar(a,.5,a),i.radius=t.distance(a,n),i},T.fromEllipsoid=function(e,n){return r(n)||(n=new T),t.clone(t.ZERO,n.center),n.radius=e.maximumRadius,n};var P=new t;T.fromBoundingSpheres=function(e,n){if(r(n)||(n=new T),!r(e)||0===e.length)return n.center=t.clone(t.ZERO,n.center),n.radius=0,n;var i=e.length;if(1===i)return T.clone(e[0],n);if(2===i)return T.union(e[0],e[1],n);for(var a=[],o=0;o<i;o++)a.push(e[o].center);n=T.fromPoints(a,n);var u=n.center,E=n.radius;for(o=0;o<i;o++){var s=e[o];E=Math.max(E,t.distance(u,s.center,P)+s.radius)}return n.radius=E,n};var v=new t,x=new t,g=new t;T.fromOrientedBoundingBox=function(e,n){r(n)||(n=new T);var i=e.halfAxes,a=s.getColumn(i,0,v),o=s.getColumn(i,1,x),u=s.getColumn(i,2,g),E=t.magnitude(a),c=t.magnitude(o),_=t.magnitude(u);return n.center=t.clone(e.center,n.center),n.radius=Math.max(E,c,_),n},T.clone=function(e,n){if(r(e))return r(n)?(n.center=t.clone(e.center,n.center),n.radius=e.radius,n):new T(e.center,e.radius)},T.packedLength=4,T.pack=function(t,e,r){r=n(r,0);var i=t.center;return e[r++]=i.x,e[r++]=i.y,e[r++]=i.z,e[r]=t.radius,e},T.unpack=function(t,e,i){e=n(e,0),r(i)||(i=new T);var a=i.center;return a.x=t[e++],a.y=t[e++],a.z=t[e++],i.radius=t[e],i};var w=new t,D=new t;T.union=function(e,n,i){r(i)||(i=new T);var a=e.center,o=e.radius,u=n.center,E=n.radius,s=t.subtract(u,a,w),c=t.magnitude(s);if(o>=c+E)return e.clone(i),i;if(E>=c+o)return n.clone(i),i;var _=.5*(o+c+E),R=t.multiplyByScalar(s,(-o+_)/c,D);return t.add(R,a,R),t.clone(R,i.center),i.radius=_,i};var B=new t;T.expand=function(e,n,r){r=T.clone(e,r);var i=t.magnitude(t.subtract(n,r.center,B));return i>r.radius&&(r.radius=i),r},T.intersectPlane=function(e,n){var r=e.center,i=e.radius,a=n.normal,o=t.dot(a,r)+n.distance;return o<-i?u.OUTSIDE:o<i?u.INTERSECTING:u.INSIDE},T.transform=function(t,e,n){return r(n)||(n=new T),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=c.getMaximumScale(e)*t.radius,n};var z=new t;T.distanceSquaredTo=function(e,n){var r=t.subtract(e.center,n,z);return t.magnitudeSquared(r)-e.radius*e.radius},T.transformWithoutScale=function(t,e,n){return r(n)||(n=new T),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=t.radius,n};var G=new t;T.computePlaneDistances=function(e,n,i,a){r(a)||(a=new E);var o=t.subtract(e.center,n,G),u=t.dot(i,o);return a.start=u-e.radius,a.stop=u+e.radius,a};for(var b=new t,X=new t,V=new t,q=new t,H=new t,W=new e,Y=new Array(8),K=0;K<8;++K)Y[K]=new t;var k=new o;return T.projectTo2D=function(e,r,i){r=n(r,k);var a=r.ellipsoid,o=e.center,u=e.radius,E=a.geodeticSurfaceNormal(o,b),s=t.cross(t.UNIT_Z,E,X);t.normalize(s,s);var c=t.cross(E,s,V);t.normalize(c,c),t.multiplyByScalar(E,u,E),t.multiplyByScalar(c,u,c),t.multiplyByScalar(s,u,s);var _=t.negate(c,H),R=t.negate(s,q),l=Y,f=l[0];t.add(E,c,f),t.add(f,s,f),f=l[1],t.add(E,c,f),t.add(f,R,f),f=l[2],t.add(E,_,f),t.add(f,R,f),f=l[3],t.add(E,_,f),t.add(f,s,f),t.negate(E,E),f=l[4],t.add(E,c,f),t.add(f,s,f),f=l[5],t.add(E,c,f),t.add(f,R,f),f=l[6],t.add(E,_,f),t.add(f,R,f),f=l[7],t.add(E,_,f),t.add(f,s,f);for(var A=l.length,h=0;h<A;++h){var N=l[h];t.add(o,N,N);var d=a.cartesianToCartographic(N,W);r.project(d,N)}i=T.fromPoints(l,i),o=i.center;var I=o.x,S=o.y,m=o.z;return o.x=m,o.y=I,o.z=S,i},T.isOccluded=function(t,e){return!e.isBoundingSphereVisible(t)},T.equals=function(e,n){return e===n||r(e)&&r(n)&&t.equals(e.center,n.center)&&e.radius===n.radius},T.prototype.intersectPlane=function(t){return T.intersectPlane(this,t)},T.prototype.distanceSquaredTo=function(t){return T.distanceSquaredTo(this,t)},T.prototype.computePlaneDistances=function(t,e,n){return T.computePlaneDistances(this,t,e,n)},T.prototype.isOccluded=function(t){return T.isOccluded(this,t)},T.prototype.equals=function(t){return T.equals(this,t)},T.prototype.clone=function(t){return T.clone(this,t)},T}),define("Core/Cartesian2",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i){"use strict";function a(e,n){this.x=t(e,0),this.y=t(n,0)}a.fromElements=function(t,n,r){return e(r)?(r.x=t,r.y=n,r):new a(t,n)},a.clone=function(t,n){if(e(t))return e(n)?(n.x=t.x,n.y=t.y,n):new a(t.x,t.y)},a.fromCartesian3=a.clone,a.fromCartesian4=a.clone,a.packedLength=2,a.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r]=e.y,n},a.unpack=function(n,r,i){return r=t(r,0),e(i)||(i=new a),i.x=n[r++],i.y=n[r],i},a.packArray=function(t,n){var r=t.length;e(n)?n.length=2*r:n=new Array(2*r);for(var i=0;i<r;++i)a.pack(t[i],n,2*i);return n},a.unpackArray=function(t,n){var r=t.length;e(n)?n.length=r/2:n=new Array(r/2);for(var i=0;i<r;i+=2){var o=i/2;n[o]=a.unpack(t,i,n[o])}return n},a.fromArray=a.unpack,a.maximumComponent=function(t){return Math.max(t.x,t.y)},a.minimumComponent=function(t){return Math.min(t.x,t.y)},a.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n},a.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n},a.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y},a.magnitude=function(t){return Math.sqrt(a.magnitudeSquared(t))};var o=new a;a.distance=function(t,e){return a.subtract(t,e,o),a.magnitude(o)},a.distanceSquared=function(t,e){return a.subtract(t,e,o),a.magnitudeSquared(o)},a.normalize=function(t,e){var n=a.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e},a.dot=function(t,e){return t.x*e.x+t.y*e.y},a.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n},a.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n},a.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n},a.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n},a.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n},a.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n},a.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e},a.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e};var u=new a;a.lerp=function(t,e,n,r){return a.multiplyByScalar(e,n,u),r=a.multiplyByScalar(t,1-n,r),a.add(u,r,r)};var E=new a,s=new a;a.angleBetween=function(t,e){return a.normalize(t,E),a.normalize(e,s),i.acosClamped(a.dot(E,s))};var c=new a;return a.mostOrthogonalAxis=function(t,e){var n=a.normalize(t,c);return a.abs(n,n),e=n.x<=n.y?a.clone(a.UNIT_X,e):a.clone(a.UNIT_Y,e)},a.equals=function(t,n){return t===n||e(t)&&e(n)&&t.x===n.x&&t.y===n.y},a.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]},a.equalsEpsilon=function(t,n,r,a){return t===n||e(t)&&e(n)&&i.equalsEpsilon(t.x,n.x,r,a)&&i.equalsEpsilon(t.y,n.y,r,a)},a.ZERO=r(new a(0,0)),a.UNIT_X=r(new a(1,0)),a.UNIT_Y=r(new a(0,1)),a.prototype.clone=function(t){return a.clone(this,t)},a.prototype.equals=function(t){return a.equals(this,t)},a.prototype.equalsEpsilon=function(t,e,n){return a.equalsEpsilon(this,t,e,n)},a.prototype.toString=function(){return"("+this.x+", "+this.y+")"},a}),define("Core/Fullscreen",["./defined","./defineProperties"],function(t,e){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},i={};return e(i,{element:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenEnabled]; -}},fullscreen:{get:function(){if(i.supportsFullscreen())return null!==i.element}}}),i.supportsFullscreen=function(){if(t(n))return n;n=!1;var e=document.body;if("function"==typeof e.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var i,a=["webkit","moz","o","ms","khtml"],o=0,u=a.length;o<u;++o){var E=a[o];i=E+"RequestFullscreen","function"==typeof e[i]?(r.requestFullscreen=i,n=!0):(i=E+"RequestFullScreen","function"==typeof e[i]&&(r.requestFullscreen=i,n=!0)),i=E+"ExitFullscreen","function"==typeof document[i]?r.exitFullscreen=i:(i=E+"CancelFullScreen","function"==typeof document[i]&&(r.exitFullscreen=i)),i=E+"FullscreenEnabled",void 0!==document[i]?r.fullscreenEnabled=i:(i=E+"FullScreenEnabled",void 0!==document[i]&&(r.fullscreenEnabled=i)),i=E+"FullscreenElement",void 0!==document[i]?r.fullscreenElement=i:(i=E+"FullScreenElement",void 0!==document[i]&&(r.fullscreenElement=i)),i=E+"fullscreenchange",void 0!==document["on"+i]&&("ms"===E&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=E+"fullscreenerror",void 0!==document["on"+i]&&("ms"===E&&(i="MSFullscreenError"),r.fullscreenerror=i)}return n},i.requestFullscreen=function(t,e){i.supportsFullscreen()&&t[r.requestFullscreen]({vrDisplay:e})},i.exitFullscreen=function(){i.supportsFullscreen()&&document[r.exitFullscreen]()},i}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(t,e,n){"use strict";function r(t){for(var e=t.split("."),n=0,r=e.length;n<r;++n)e[n]=parseInt(e[n],10);return e}function i(){if(!e(S)&&(S=!1,!T())){var t=/ Chrome\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(S=!0,m=r(t[1]))}return S}function a(){return i()&&m}function o(){if(!e(M)&&(M=!1,!i()&&!T()&&/ Safari\/[\.0-9]+/.test(I.userAgent))){var t=/ Version\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(M=!0,y=r(t[1]))}return M}function u(){return o()&&y}function E(){if(!e(O)){O=!1;var t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(I.userAgent);null!==t&&(O=!0,p=r(t[1]),p.isNightly=!!t[2])}return O}function s(){return E()&&p}function c(){if(!e(C)){C=!1;var t;"Microsoft Internet Explorer"===I.appName?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==t&&(C=!0,U=r(t[1]))):"Netscape"===I.appName&&(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==t&&(C=!0,U=r(t[1])))}return C}function _(){return c()&&U}function T(){if(!e(L)){L=!1;var t=/ Edge\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(L=!0,F=r(t[1]))}return L}function R(){return T()&&F}function l(){if(!e(P)){P=!1;var t=/Firefox\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(P=!0,v=r(t[1]))}return P}function f(){return e(x)||(x=/Windows/i.test(I.appVersion)),x}function A(){return l()&&v}function h(){return e(g)||(g="undefined"!=typeof PointerEvent&&(!e(I.pointerEnabled)||I.pointerEnabled)),g}function N(){if(!e(D)){var t=document.createElement("canvas");t.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=t.style.imageRendering;D=e(n)&&""!==n,D&&(w=n)}return D}function d(){return N()?w:void 0}var I;I="undefined"!=typeof navigator?navigator:{};var S,m,M,y,O,p,C,U,L,F,P,v,x,g,w,D,B={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:E,webkitVersion:s,isInternetExplorer:c,internetExplorerVersion:_,isEdge:T,edgeVersion:R,isFirefox:l,firefoxVersion:A,isWindows:f,hardwareConcurrency:t(I.hardwareConcurrency,3),supportsPointerEvents:h,supportsImageRenderingPixelated:N,imageRenderingValue:d};return B.supportsFullscreen=function(){return n.supportsFullscreen()},B.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},B.supportsWebWorkers=function(){return"undefined"!=typeof Worker},B}),define("Core/WebGLConstants",["./freezeObject"],function(t){"use strict";var e={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503};return t(e)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(t,e,n,r,i,a){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:a.BYTE,UNSIGNED_BYTE:a.UNSIGNED_BYTE,SHORT:a.SHORT,UNSIGNED_SHORT:a.UNSIGNED_SHORT,INT:a.INT,UNSIGNED_INT:a.UNSIGNED_INT,FLOAT:a.FLOAT,DOUBLE:a.DOUBLE};return o.getSizeInBytes=function(t){switch(t){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.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(t){return t instanceof Int8Array?o.BYTE:t instanceof Uint8Array?o.UNSIGNED_BYTE:t instanceof Int16Array?o.SHORT:t instanceof Uint16Array?o.UNSIGNED_SHORT:t instanceof Int32Array?o.INT:t instanceof Uint32Array?o.UNSIGNED_INT:t instanceof Float32Array?o.FLOAT:t instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(t){return e(t)&&(t===o.BYTE||t===o.UNSIGNED_BYTE||t===o.SHORT||t===o.UNSIGNED_SHORT||t===o.INT||t===o.UNSIGNED_INT||t===o.FLOAT||t===o.DOUBLE)},o.createTypedArray=function(t,e){switch(t){case o.BYTE:return new Int8Array(e);case o.UNSIGNED_BYTE:return new Uint8Array(e);case o.SHORT:return new Int16Array(e);case o.UNSIGNED_SHORT:return new Uint16Array(e);case o.INT:return new Int32Array(e);case o.UNSIGNED_INT:return new Uint32Array(e);case o.FLOAT:return new Float32Array(e);case o.DOUBLE:return new Float64Array(e)}},o.createArrayBufferView=function(e,n,r,i){switch(r=t(r,0),i=t(i,(n.byteLength-r)/o.getSizeInBytes(e)),e){case o.BYTE:return new Int8Array(n,r,i);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,i);case o.SHORT:return new Int16Array(n,r,i);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,i);case o.INT:return new Int32Array(n,r,i);case o.UNSIGNED_INT:return new Uint32Array(n,r,i);case o.FLOAT:return new Float32Array(n,r,i);case o.DOUBLE:return new Float64Array(n,r,i)}},o.fromName=function(t){switch(t){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},i(o)}),define("Core/CylinderGeometryLibrary",["./Math"],function(t){"use strict";var e={};return e.computePositions=function(e,n,r,i,a){var o,u=.5*e,E=-u,s=i+i,c=a?2*s:s,_=new Float64Array(3*c),T=0,R=0,l=a?3*s:0,f=a?3*(s+i):3*i;for(o=0;o<i;o++){var A=o/i*t.TWO_PI,h=Math.cos(A),N=Math.sin(A),d=h*r,I=N*r,S=h*n,m=N*n;_[R+l]=d,_[R+l+1]=I,_[R+l+2]=E,_[R+f]=S,_[R+f+1]=m,_[R+f+2]=u,R+=3,a&&(_[T++]=d,_[T++]=I,_[T++]=E,_[T++]=S,_[T++]=m,_[T++]=u)}return _},e}),define("Core/GeometryType",["./freezeObject"],function(t){"use strict";var e={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return t(e)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(t,e){"use strict";var n={POINTS:e.POINTS,LINES:e.LINES,LINE_LOOP:e.LINE_LOOP,LINE_STRIP:e.LINE_STRIP,TRIANGLES:e.TRIANGLES,TRIANGLE_STRIP:e.TRIANGLE_STRIP,TRIANGLE_FAN:e.TRIANGLE_FAN,validate:function(t){return t===n.POINTS||t===n.LINES||t===n.LINE_LOOP||t===n.LINE_STRIP||t===n.TRIANGLES||t===n.TRIANGLE_STRIP||t===n.TRIANGLE_FAN}};return t(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(t,e,n,r,i){"use strict";function a(e){e=t(e,t.EMPTY_OBJECT),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=t(e.primitiveType,i.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=t(e.geometryType,r.NONE),this.boundingSphereCV=e.boundingSphereCV}return a.computeNumberOfVertices=function(t){var n=-1;for(var r in t.attributes)if(t.attributes.hasOwnProperty(r)&&e(t.attributes[r])&&e(t.attributes[r].values)){var i=t.attributes[r],a=i.values.length/i.componentsPerAttribute;n=a}return n},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(t,e,n){"use strict";function r(e){e=t(e,t.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=t(e.normalize,!1),this.values=e.values}return r}),define("Core/GeometryAttributes",["./defaultValue"],function(t){"use strict";function e(e){e=t(e,t.EMPTY_OBJECT),this.position=e.position,this.normal=e.normal,this.st=e.st,this.binormal=e.binormal,this.tangent=e.tangent,this.color=e.color}return e}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(t,e,n,r,i){"use strict";var a={UNSIGNED_BYTE:i.UNSIGNED_BYTE,UNSIGNED_SHORT:i.UNSIGNED_SHORT,UNSIGNED_INT:i.UNSIGNED_INT};return a.getSizeInBytes=function(t){switch(t){case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},a.validate=function(e){return t(e)&&(e===a.UNSIGNED_BYTE||e===a.UNSIGNED_SHORT||e===a.UNSIGNED_INT)},a.createTypedArray=function(t,e){return t>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(e):new Uint16Array(e)},a.createTypedArrayFromArrayBuffer=function(t,e,n,i){return t>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(e,n,i):new Uint16Array(e,n,i)},n(a)}),define("Core/CylinderOutlineGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./CylinderGeometryLibrary","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./PrimitiveType"],function(t,e,n,r,i,a,o,u,E,s,c,_,T){"use strict";function R(t){t=a(t,a.EMPTY_OBJECT);var e=t.length,n=t.topRadius,r=t.bottomRadius,i=a(t.slices,128),o=Math.max(a(t.numberOfVerticalLines,16),0);this._length=e,this._topRadius=n,this._bottomRadius=r,this._slices=i,this._numberOfVerticalLines=o,this._workerName="createCylinderOutlineGeometry"}var l=new e;R.packedLength=5,R.pack=function(t,e,n){return n=a(n,0),e[n++]=t._length,e[n++]=t._topRadius,e[n++]=t._bottomRadius,e[n++]=t._slices,e[n]=t._numberOfVerticalLines,e};var f={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0};return R.unpack=function(t,e,n){e=a(e,0);var r=t[e++],i=t[e++],u=t[e++],E=t[e++],s=t[e];return o(n)?(n._length=r,n._topRadius=i,n._bottomRadius=u,n._slices=E,n._numberOfVerticalLines=s,n):(f.length=r,f.topRadius=i,f.bottomRadius=u,f.slices=E,f.numberOfVerticalLines=s,new R(f))},R.createGeometry=function(a){var o=a._length,u=a._topRadius,R=a._bottomRadius,f=a._slices,A=a._numberOfVerticalLines;if(!(o<=0||u<0||R<0||0===u&&0===R)){var h,N=2*f,d=i.computePositions(o,u,R,f,!1),I=2*f;if(A>0){var S=Math.min(A,f);h=Math.round(f/S),I+=S}for(var m=_.createTypedArray(N,2*I),M=0,y=0;y<f-1;y++)m[M++]=y,m[M++]=y+1,m[M++]=y+f,m[M++]=y+1+f;if(m[M++]=f-1,m[M++]=0,m[M++]=f+f-1,m[M++]=f,A>0)for(y=0;y<f;y+=h)m[M++]=y,m[M++]=y+f;var O=new c;O.position=new s({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:d}),l.x=.5*o,l.y=Math.max(R,u);var p=new t(n.ZERO,e.magnitude(l));return new E({attributes:O,indices:m,primitiveType:T.LINES,boundingSphere:p})}},R}),define("Workers/createCylinderOutlineGeometry",["../Core/CylinderOutlineGeometry","../Core/defined"],function(t,e){"use strict";return function(n,r){return e(r)&&(n=t.unpack(n,r)),t.createGeometry(n)}})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e){return e+" is required, actual value was undefined"}function r(e,t,n){return"Expected "+n+" to be typeof "+t+", actual typeof was "+e}var i={};return i.typeOf={},i.defined=function(r,i){if(!e(i))throw new t(n(r))},i.typeOf.func=function(e,n){if("function"!=typeof n)throw new t(r(typeof n,"function",e))},i.typeOf.string=function(e,n){if("string"!=typeof n)throw new t(r(typeof n,"string",e))},i.typeOf.number=function(e,n){if("number"!=typeof n)throw new t(r(typeof n,"number",e))},i.typeOf.number.lessThan=function(e,n,r){if(i.typeOf.number(e,n),n>=r)throw new t("Expected "+e+" to be less than "+r+", actual value was "+n)},i.typeOf.number.lessThanOrEquals=function(e,n,r){if(i.typeOf.number(e,n),n>r)throw new t("Expected "+e+" to be less than or equal to "+r+", actual value was "+n)},i.typeOf.number.greaterThan=function(e,n,r){if(i.typeOf.number(e,n),n<=r)throw new t("Expected "+e+" to be greater than "+r+", actual value was "+n)},i.typeOf.number.greaterThanOrEquals=function(e,n,r){if(i.typeOf.number(e,n),n<r)throw new t("Expected "+e+" to be greater than or equal to"+r+", actual value was "+n)},i.typeOf.object=function(e,n){if("object"!=typeof n)throw new t(r(typeof n,"object",e))},i.typeOf.bool=function(e,n){if("boolean"!=typeof n)throw new t(r(typeof n,"boolean",e))},i}),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";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),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 n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(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^=e<<7&2636928640,e^=e<<15&4022730752,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,n,r){"use strict";var i={};i.EPSILON1=.1,i.EPSILON2=.01,i.EPSILON3=.001,i.EPSILON4=1e-4,i.EPSILON5=1e-5,i.EPSILON6=1e-6,i.EPSILON7=1e-7,i.EPSILON8=1e-8,i.EPSILON9=1e-9,i.EPSILON10=1e-10,i.EPSILON11=1e-11,i.EPSILON12=1e-12,i.EPSILON13=1e-13,i.EPSILON14=1e-14,i.EPSILON15=1e-15,i.EPSILON16=1e-16,i.EPSILON17=1e-17,i.EPSILON18=1e-18,i.EPSILON19=1e-19,i.EPSILON20=1e-20,i.GRAVITATIONALPARAMETER=3986004418e5,i.SOLAR_RADIUS=6955e5,i.LUNAR_RADIUS=1737400,i.SIXTY_FOUR_KILOBYTES=65536,i.sign=function(e){return e>0?1:e<0?-1:0},i.signNotZero=function(e){return e<0?-1:1},i.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*i.clamp(e,-1,1)+.5)*n)},i.fromSNorm=function(e,n){return n=t(n,255),i.clamp(e,0,n)/n*2-1},i.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},i.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},i.lerp=function(e,t,n){return(1-n)*e+n*t},i.PI=Math.PI,i.ONE_OVER_PI=1/Math.PI,i.PI_OVER_TWO=.5*Math.PI,i.PI_OVER_THREE=Math.PI/3,i.PI_OVER_FOUR=Math.PI/4,i.PI_OVER_SIX=Math.PI/6,i.THREE_PI_OVER_TWO=3*Math.PI*.5,i.TWO_PI=2*Math.PI,i.ONE_OVER_TWO_PI=1/(2*Math.PI),i.RADIANS_PER_DEGREE=Math.PI/180,i.DEGREES_PER_RADIAN=180/Math.PI,i.RADIANS_PER_ARCSECOND=i.RADIANS_PER_DEGREE/3600,i.toRadians=function(e){return e*i.RADIANS_PER_DEGREE},i.toDegrees=function(e){return e*i.DEGREES_PER_RADIAN},i.convertLongitudeRange=function(e){var t=i.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},i.clampToLatitudeRange=function(e){return i.clamp(e,-1*i.PI_OVER_TWO,i.PI_OVER_TWO)},i.negativePiToPi=function(e){return i.zeroToTwoPi(e+i.PI)-i.PI},i.zeroToTwoPi=function(e){var t=i.mod(e,i.TWO_PI);return Math.abs(t)<i.EPSILON14&&Math.abs(e)>i.EPSILON14?i.TWO_PI:t},i.mod=function(e,t){return(e%t+t)%t},i.equalsEpsilon=function(e,n,r,i){i=t(i,r);var a=Math.abs(e-n);return a<=i||a<=r*Math.max(Math.abs(e),Math.abs(n))};var a=[1];i.factorial=function(e){var t=a.length;if(e>=t)for(var n=a[t-1],r=t;r<=e;r++)a.push(n*r);return a[e]},i.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},i.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},i.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},i.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return i.setRandomNumberSeed=function(t){o=new e(t)},i.nextRandomNumber=function(){return o.random()},i.acosClamped=function(e){return Math.acos(i.clamp(e,-1,1))},i.asinClamped=function(e){return Math.asin(i.clamp(e,-1,1))},i.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},i.logBase=function(e,t){return Math.log(e)/Math.log(t)},i.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},i}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var i=e.clock,a=e.cone,u=t(e.magnitude,1),E=u*Math.sin(a);return r.x=E*Math.cos(i),r.y=E*Math.sin(i),r.z=u*Math.cos(a),r},o.fromElements=function(e,t,r,i){return n(i)?(i.x=e,i.y=t,i.z=r,i):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new o),i.x=e[r++],i.y=e[r++],i.z=e[r],i},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var i=0;i<r;++i)o.pack(e[i],t,3*i);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var i=0;i<r;i+=3){var a=i/3;t[a]=o.unpack(e,i,t[a])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,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};var E=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,E),r=o.multiplyByScalar(e,1-n,r),o.add(E,r,r)};var s=new o,c=new o;o.angleBetween=function(e,t){o.normalize(e,s),o.normalize(t,c);var n=o.dot(s,c),r=o.magnitude(o.cross(s,c,s));return Math.atan2(r,n)};var _=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,_);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,i){return e===t||n(e)&&n(t)&&a.equalsEpsilon(e.x,t.x,r,i)&&a.equalsEpsilon(e.y,t.y,r,i)&&a.equalsEpsilon(e.z,t.z,r,i)},o.cross=function(e,t,n){var r=e.x,i=e.y,a=e.z,o=t.x,u=t.y,E=t.z,s=i*E-a*u,c=a*o-r*E,_=r*u-i*o;return n.x=s,n.y=c,n.z=_,n},o.fromDegrees=function(e,t,n,r,i){return e=a.toRadians(e),t=a.toRadians(t),o.fromRadians(e,t,n,r,i)};var T=new o,R=new o,l=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,i,a,u){i=t(i,0);var E=n(a)?a.radiiSquared:l,s=Math.cos(r);T.x=s*Math.cos(e),T.y=s*Math.sin(e),T.z=Math.sin(r),T=o.normalize(T,T),o.multiplyComponents(E,T,R);var c=Math.sqrt(o.dot(T,R));return R=o.divideByScalar(R,c,R),T=o.multiplyByScalar(T,i,T),n(u)||(u=new o),o.add(R,T,u)},o.fromDegreesArray=function(e,t,r){var i=e.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],E=e[a+1],s=a/2;r[s]=o.fromDegrees(u,E,0,t,r[s])}return r},o.fromRadiansArray=function(e,t,r){var i=e.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],E=e[a+1],s=a/2;r[s]=o.fromRadians(u,E,0,t,r[s])}return r},o.fromDegreesArrayHeights=function(e,t,r){var i=e.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],E=e[a+1],s=e[a+2],c=a/3;r[c]=o.fromDegrees(u,E,s,t,r[c])}return r},o.fromRadiansArrayHeights=function(e,t,r){var i=e.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],E=e[a+1],s=e[a+2],c=a/3;r[c]=o.fromRadians(u,E,s,t,r[c])}return r},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,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function i(n,i,u,E,s){var c=n.x,_=n.y,T=n.z,R=i.x,l=i.y,f=i.z,A=c*c*R*R,h=_*_*l*l,N=T*T*f*f,d=A+h+N,I=Math.sqrt(1/d),S=e.multiplyByScalar(n,I,a);if(d<E)return isFinite(I)?e.clone(S,s):void 0;var M=u.x,m=u.y,O=u.z,y=o;y.x=S.x*M*2,y.y=S.y*m*2,y.z=S.z*O*2;var p,C,U,L,F,P,v,w,g,x,D,B=(1-I)*e.magnitude(n)/(.5*e.magnitude(y)),z=0;do{B-=z,U=1/(1+B*M),L=1/(1+B*m),F=1/(1+B*O),P=U*U,v=L*L,w=F*F,g=P*U,x=v*L,D=w*F,p=A*P+h*v+N*w-1,C=A*g*M+h*x*m+N*D*O;var G=-2*C;z=p/G}while(Math.abs(p)>r.EPSILON12);return t(s)?(s.x=c*U,s.y=_*L,s.z=T*F,s):new e(c*U,_*L,T*F)}var a=new e,o=new e;return i}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,i,a,o){"use strict";function u(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)}u.fromRadians=function(e,r,i,a){return i=t(i,0),n(a)?(a.longitude=e,a.latitude=r,a.height=i,a):new u(e,r,i)},u.fromDegrees=function(e,t,n,r){return e=a.toRadians(e),t=a.toRadians(t),u.fromRadians(e,t,n,r)};var E=new e,s=new e,c=new e,_=new e(1/6378137,1/6378137,1/6356752.314245179),T=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),R=a.EPSILON1;return u.fromCartesian=function(t,r,i){var l=n(r)?r.oneOverRadii:_,f=n(r)?r.oneOverRadiiSquared:T,A=n(r)?r._centerToleranceSquared:R,h=o(t,l,f,A,s);if(n(h)){var N=e.multiplyComponents(h,f,E);N=e.normalize(N,N);var d=e.subtract(t,h,c),I=Math.atan2(N.y,N.x),S=Math.asin(N.z),M=a.sign(e.dot(d,t))*e.magnitude(d);return n(i)?(i.longitude=I,i.latitude=S,i.height=M,i):new u(I,S,M)}},u.clone=function(e,t){if(n(e))return n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},u.ZERO=i(new u(0,0,0)),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,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,i,a,o,u,E){"use strict";function s(t,r,i,a){r=n(r,0),i=n(i,0),a=n(a,0),t._radii=new e(r,i,a),t._radiiSquared=new e(r*r,i*i,a*a),t._radiiToTheFourth=new e(r*r*r*r,i*i*i*i,a*a*a*a),t._oneOverRadii=new e(0===r?0:1/r,0===i?0:1/i,0===a?0:1/a),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===i?0:1/(i*i),0===a?0:1/(a*a)),t._minimumRadius=Math.min(r,i,a),t._maximumRadius=Math.max(r,i,a),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function c(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,s(this,e,t,n)}i(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,n){if(r(t)){var i=t._radii;return r(n)?(e.clone(i,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new c(i.x,i.y,i.z)}},c.fromCartesian3=function(e,t){return r(t)||(t=new c),r(e)?(s(t,e.x,e.y,e.z),t):t},c.WGS84=o(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=o(new c(1,1,1)),c.MOON=o(new c(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),c.prototype.clone=function(e){return c.clone(this,e)},c.packedLength=e.packedLength,c.pack=function(t,r,i){return i=n(i,0),e.pack(t._radii,r,i),r},c.unpack=function(t,r,i){r=n(r,0);var a=e.unpack(t,r);return c.fromCartesian3(a,i)},c.prototype.geocentricSurfaceNormal=e.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(t,n){var i=t.longitude,a=t.latitude,o=Math.cos(a),u=o*Math.cos(i),E=o*Math.sin(i),s=Math.sin(a);return r(n)||(n=new e),n.x=u,n.y=E,n.z=s,e.normalize(n,n)},c.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var _=new e,T=new e;c.prototype.cartographicToCartesian=function(t,n){var i=_,a=T;this.geodeticSurfaceNormalCartographic(t,i),e.multiplyComponents(this._radiiSquared,i,a);var o=Math.sqrt(e.dot(i,a));return e.divideByScalar(a,o,a),e.multiplyByScalar(i,t.height,i),r(n)||(n=new e),e.add(a,i,n)},c.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;i<n;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var R=new e,l=new e,f=new e;return c.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,l);if(r(a)){var o=this.geodeticSurfaceNormal(a,R),E=e.subtract(n,a,f),s=Math.atan2(o.y,o.x),c=Math.asin(o.z),_=u.sign(e.dot(E,n))*e.magnitude(E);return r(i)?(i.longitude=s,i.latitude=c,i.height=_,i):new t(s,c,_)}},c.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;i<n;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t},c.prototype.scaleToGeodeticSurface=function(e,t){return E(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},c.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var i=t.x,a=t.y,o=t.z,u=this._oneOverRadiiSquared,E=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*u.z);return e.multiplyByScalar(t,E,n)},c.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},c.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},c.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},c.prototype.toString=function(){return this._radii.toString()},c.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,i,a){i=n(i,0);var o=this._sqauredXOverSquaredZ;if(r(a)||(a=new e),a.x=0,a.y=0,a.z=t.z*(1-o),!(Math.abs(a.z)>=this._radii.z-i))return a},c}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,i,a,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return i(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var i=this._semimajorAxis,a=t.longitude*i,o=t.latitude*i,u=t.height;return r(n)?(n.x=a,n.y=o,n.z=u,n):new e(a,o,u)},u.prototype.unproject=function(e,n){var i=this._oneOverSemimajorAxis,a=e.x*i,o=e.y*i,u=e.z;return r(n)?(n.longitude=a,n.latitude=o,n.height=u,n):new t(a,o,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";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a,o,u){"use strict";function E(e,t,r,i,a,o,u,E,s){this[0]=n(e,0),this[1]=n(i,0),this[2]=n(u,0),this[3]=n(t,0),this[4]=n(a,0),this[5]=n(E,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(s,0)}function s(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function c(e){for(var t=0,n=0;n<3;++n){var r=e[E.getElementIndex(f[n],l[n])];t+=2*r*r}return Math.sqrt(t)}function _(e,t){for(var n=u.EPSILON15,r=0,i=1,a=0;a<3;++a){var o=Math.abs(e[E.getElementIndex(f[a],l[a])]);o>r&&(i=a,r=o)}var s=1,c=0,_=l[i],T=f[i];if(Math.abs(e[E.getElementIndex(T,_)])>n){var R,A=e[E.getElementIndex(T,T)],h=e[E.getElementIndex(_,_)],N=e[E.getElementIndex(T,_)],d=(A-h)/2/N;R=d<0?-1/(-d+Math.sqrt(1+d*d)):1/(d+Math.sqrt(1+d*d)),s=1/Math.sqrt(1+R*R),c=R*s}return t=E.clone(E.IDENTITY,t),t[E.getElementIndex(_,_)]=t[E.getElementIndex(T,T)]=s,t[E.getElementIndex(T,_)]=c,t[E.getElementIndex(_,T)]=-c,t}E.packedLength=9,E.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t},E.unpack=function(e,t,i){return t=n(t,0),r(i)||(i=new E),i[0]=e[t++],i[1]=e[t++],i[2]=e[t++],i[3]=e[t++],i[4]=e[t++],i[5]=e[t++],i[6]=e[t++],i[7]=e[t++],i[8]=e[t++],i},E.clone=function(e,t){if(r(e))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):new E(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},E.fromArray=function(e,t,i){return t=n(t,0),r(i)||(i=new E),i[0]=e[t],i[1]=e[t+1],i[2]=e[t+2],i[3]=e[t+3],i[4]=e[t+4],i[5]=e[t+5],i[6]=e[t+6],i[7]=e[t+7],i[8]=e[t+8],i},E.fromColumnMajorArray=function(e,t){return E.clone(e,t)},E.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 E(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},E.fromQuaternion=function(e,t){var n=e.x*e.x,i=e.x*e.y,a=e.x*e.z,o=e.x*e.w,u=e.y*e.y,s=e.y*e.z,c=e.y*e.w,_=e.z*e.z,T=e.z*e.w,R=e.w*e.w,l=n-u-_+R,f=2*(i-T),A=2*(a+c),h=2*(i+T),N=-n+u-_+R,d=2*(s-o),I=2*(a-c),S=2*(s+o),M=-n-u+_+R;return r(t)?(t[0]=l,t[1]=h,t[2]=I,t[3]=f,t[4]=N,t[5]=S,t[6]=A,t[7]=d,t[8]=M,t):new E(l,f,A,h,N,d,I,S,M)},E.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),i=Math.cos(-e.heading),a=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),s=Math.sin(e.roll),c=n*i,_=-a*u+s*o*i,T=s*u+a*o*i,R=n*u,l=a*i+s*o*u,f=-o*a+a*o*u,A=-o,h=s*n,N=a*n;return r(t)?(t[0]=c,t[1]=R,t[2]=A,t[3]=_,t[4]=l,t[5]=h,t[6]=T,t[7]=f,t[8]=N,t):new E(c,_,T,R,l,f,A,h,N)},E.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 E(e.x,0,0,0,e.y,0,0,0,e.z)},E.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 E(e,0,0,0,e,0,0,0,e)},E.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 E(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},E.fromRotationX=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=i,t[6]=0,t[7]=-i,t[8]=n,t):new E(1,0,0,0,n,-i,0,i,n)},E.fromRotationY=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-i,t[3]=0,t[4]=1,t[5]=0,t[6]=i,t[7]=0,t[8]=n,t):new E(n,0,i,0,1,0,-i,0,n)},E.fromRotationZ=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=n,t[1]=i,t[2]=0,t[3]=-i,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new E(n,-i,0,i,n,0,0,0,1)},E.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]]},E.getElementIndex=function(e,t){return 3*e+t},E.getColumn=function(e,t,n){var r=3*t,i=e[r],a=e[r+1],o=e[r+2];return n.x=i,n.y=a,n.z=o,n},E.setColumn=function(e,t,n,r){r=E.clone(e,r);var i=3*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},E.getRow=function(e,t,n){var r=e[t],i=e[t+3],a=e[t+6];return n.x=r,n.y=i,n.z=a,n},E.setRow=function(e,t,n,r){return r=E.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var T=new e;E.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],T)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],T)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],T)),n};var R=new e;E.getMaximumScale=function(t){return E.getScale(t,R),e.maximumComponent(R)},E.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],i=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],o=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],E=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],s=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],c=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],_=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=r,n[1]=i,n[2]=a,n[3]=o,n[4]=u,n[5]=E,n[6]=s,n[7]=c,n[8]=_,n},E.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},E.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},E.multiplyByVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[3]*i+e[6]*a,u=e[1]*r+e[4]*i+e[7]*a,E=e[2]*r+e[5]*i+e[8]*a;return n.x=o,n.y=u,n.z=E,n},E.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},E.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},E.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},E.transpose=function(e,t){var n=e[0],r=e[3],i=e[6],a=e[1],o=e[4],u=e[7],E=e[2],s=e[5],c=e[8];return t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=u,t[6]=E,t[7]=s,t[8]=c,t};var l=[1,0,0],f=[2,2,1],A=new E,h=new E;return E.computeEigenDecomposition=function(e,t){var n=u.EPSILON20,i=10,a=0,o=0;r(t)||(t={});for(var T=t.unitary=E.clone(E.IDENTITY,t.unitary),R=t.diagonal=E.clone(e,t.diagonal),l=n*s(R);o<i&&c(R)>l;)_(R,A),E.transpose(A,h),E.multiply(R,A,R),E.multiply(h,R,R),E.multiply(T,A,T),++a>2&&(++o,a=0);return t},E.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},E.determinant=function(e){var t=e[0],n=e[3],r=e[6],i=e[1],a=e[4],o=e[7],u=e[2],E=e[5],s=e[8];return t*(a*s-E*o)+i*(E*r-n*s)+u*(n*o-a*r)},E.inverse=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],u=e[5],s=e[6],c=e[7],_=e[8],T=E.determinant(e);t[0]=o*_-c*u,t[1]=c*i-r*_,t[2]=r*u-o*i,t[3]=s*u-a*_,t[4]=n*_-s*i,t[5]=a*i-n*u,t[6]=a*c-s*o,t[7]=s*r-n*c,t[8]=n*o-a*r;var R=1/T;return E.multiplyByScalar(t,R,t)},E.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.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},E.IDENTITY=o(new E(1,0,0,0,1,0,0,0,1)),E.ZERO=o(new E(0,0,0,0,0,0,0,0,0)),E.COLUMN0ROW0=0,E.COLUMN0ROW1=1,E.COLUMN0ROW2=2,E.COLUMN1ROW0=3,E.COLUMN1ROW1=4,E.COLUMN1ROW2=5,E.COLUMN2ROW0=6,E.COLUMN2ROW1=7,E.COLUMN2ROW2=8,i(E.prototype,{length:{get:function(){return E.packedLength}}}),E.prototype.clone=function(e){return E.clone(this,e)},E.prototype.equals=function(e){return E.equals(this,e)},E.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},E.prototype.equalsEpsilon=function(e,t){return E.equalsEpsilon(this,e,t)},E.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},E}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(e,n,r,i){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(i,0)}o.fromElements=function(e,t,r,i,a){return n(a)?(a.x=e,a.y=t,a.z=r,a.w=i,a):new o(e,t,r,i)},o.fromColor=function(e,t){return n(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(n(e))return n(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)},o.packedLength=4,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},o.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new o),i.x=e[r++],i.y=e[r++],i.z=e[r++],i.w=e[r],i},o.packArray=function(e,t){var r=e.length;n(t)?t.length=4*r:t=new Array(4*r);for(var i=0;i<r;++i)o.pack(e[i],t,4*i);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/4:t=new Array(r/4);for(var i=0;i<r;i+=4){var a=i/4;t[a]=o.unpack(e,i,t[a])}return t},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,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},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 u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,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,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},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 E=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,E),r=o.multiplyByScalar(e,1-n,r),o.add(E,r,r)};var s=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,s);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},o.equalsEpsilon=function(e,t,r,i){return e===t||n(e)&&n(t)&&a.equalsEpsilon(e.x,t.x,r,i)&&a.equalsEpsilon(e.y,t.y,r,i)&&a.equalsEpsilon(e.z,t.z,r,i)&&a.equalsEpsilon(e.w,t.w,r,i)},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,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,i,a,o,u,E,s,c){ +"use strict";function _(e,t,n,i,a,o,u,E,s,c,_,T,R,l,f,A){this[0]=r(e,0),this[1]=r(a,0),this[2]=r(s,0),this[3]=r(R,0),this[4]=r(t,0),this[5]=r(o,0),this[6]=r(c,0),this[7]=r(l,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(_,0),this[11]=r(f,0),this[12]=r(i,0),this[13]=r(E,0),this[14]=r(T,0),this[15]=r(A,0)}_.packedLength=16,_.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},_.unpack=function(e,t,n){return t=r(t,0),i(n)||(n=new _),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},_.clone=function(e,t){if(i(e))return i(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 _(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])},_.fromArray=_.unpack,_.fromColumnMajorArray=function(e,t){return _.clone(e,t)},_.fromRowMajorArray=function(e,t){return i(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 _(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])},_.fromRotationTranslation=function(t,n,a){return n=r(n,e.ZERO),i(a)?(a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=0,a[4]=t[3],a[5]=t[4],a[6]=t[5],a[7]=0,a[8]=t[6],a[9]=t[7],a[10]=t[8],a[11]=0,a[12]=n.x,a[13]=n.y,a[14]=n.z,a[15]=1,a):new _(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},_.fromTranslationQuaternionRotationScale=function(e,t,n,r){i(r)||(r=new _);var a=n.x,o=n.y,u=n.z,E=t.x*t.x,s=t.x*t.y,c=t.x*t.z,T=t.x*t.w,R=t.y*t.y,l=t.y*t.z,f=t.y*t.w,A=t.z*t.z,h=t.z*t.w,N=t.w*t.w,d=E-R-A+N,I=2*(s-h),S=2*(c+f),M=2*(s+h),m=-E+R-A+N,O=2*(l-T),y=2*(c-f),p=2*(l+T),C=-E-R+A+N;return r[0]=d*a,r[1]=M*a,r[2]=y*a,r[3]=0,r[4]=I*o,r[5]=m*o,r[6]=p*o,r[7]=0,r[8]=S*u,r[9]=O*u,r[10]=C*u,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},_.fromTranslationRotationScale=function(e,t){return _.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},_.fromTranslation=function(e,t){return _.fromRotationTranslation(s.IDENTITY,e,t)},_.fromScale=function(e,t){return i(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 _(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},_.fromUniformScale=function(e,t){return i(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 _(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var T=new e,R=new e,l=new e;_.fromCamera=function(t,n){var r=t.position,a=t.direction,o=t.up;e.normalize(a,T),e.normalize(e.cross(T,o,R),R),e.normalize(e.cross(R,T,l),l);var u=R.x,E=R.y,s=R.z,c=T.x,f=T.y,A=T.z,h=l.x,N=l.y,d=l.z,I=r.x,S=r.y,M=r.z,m=u*-I+E*-S+s*-M,O=h*-I+N*-S+d*-M,y=c*I+f*S+A*M;return i(n)?(n[0]=u,n[1]=h,n[2]=-c,n[3]=0,n[4]=E,n[5]=N,n[6]=-f,n[7]=0,n[8]=s,n[9]=d,n[10]=-A,n[11]=0,n[12]=m,n[13]=O,n[14]=y,n[15]=1,n):new _(u,E,s,m,h,N,d,O,-c,-f,-A,y,0,0,0,1)},_.computePerspectiveFieldOfView=function(e,t,n,r,i){var a=Math.tan(.5*e),o=1/a,u=o/t,E=(r+n)/(n-r),s=2*r*n/(n-r);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=o,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=E,i[11]=-1,i[12]=0,i[13]=0,i[14]=s,i[15]=0,i},_.computeOrthographicOffCenter=function(e,t,n,r,i,a,o){var u=1/(t-e),E=1/(r-n),s=1/(a-i),c=-(t+e)*u,_=-(r+n)*E,T=-(a+i)*s;return u*=2,E*=2,s*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=s,o[11]=0,o[12]=c,o[13]=_,o[14]=T,o[15]=1,o},_.computePerspectiveOffCenter=function(e,t,n,r,i,a,o){var u=2*i/(t-e),E=2*i/(r-n),s=(t+e)/(t-e),c=(r+n)/(r-n),_=-(a+i)/(a-i),T=-1,R=-2*a*i/(a-i);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=s,o[9]=c,o[10]=_,o[11]=T,o[12]=0,o[13]=0,o[14]=R,o[15]=0,o},_.computeInfinitePerspectiveOffCenter=function(e,t,n,r,i,a){var o=2*i/(t-e),u=2*i/(r-n),E=(t+e)/(t-e),s=(r+n)/(r-n),c=-1,_=-1,T=-2*i;return a[0]=o,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=E,a[9]=s,a[10]=c,a[11]=_,a[12]=0,a[13]=0,a[14]=T,a[15]=0,a},_.computeViewportTransformation=function(e,t,n,i){e=r(e,r.EMPTY_OBJECT);var a=r(e.x,0),o=r(e.y,0),u=r(e.width,0),E=r(e.height,0);t=r(t,0),n=r(n,1);var s=.5*u,c=.5*E,_=.5*(n-t),T=s,R=c,l=_,f=a+s,A=o+c,h=t+_,N=1;return i[0]=T,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=R,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=l,i[11]=0,i[12]=f,i[13]=A,i[14]=h,i[15]=N,i},_.computeView=function(t,n,r,i,a){return a[0]=i.x,a[1]=r.x,a[2]=-n.x,a[3]=0,a[4]=i.y,a[5]=r.y,a[6]=-n.y,a[7]=0,a[8]=i.z,a[9]=r.z,a[10]=-n.z,a[11]=0,a[12]=-e.dot(i,t),a[13]=-e.dot(r,t),a[14]=e.dot(n,t),a[15]=1,a},_.toArray=function(e,t){return i(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]]},_.getElementIndex=function(e,t){return 4*e+t},_.getColumn=function(e,t,n){var r=4*t,i=e[r],a=e[r+1],o=e[r+2],u=e[r+3];return n.x=i,n.y=a,n.z=o,n.w=u,n},_.setColumn=function(e,t,n,r){r=_.clone(e,r);var i=4*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r[i+3]=n.w,r},_.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},_.getRow=function(e,t,n){var r=e[t],i=e[t+4],a=e[t+8],o=e[t+12];return n.x=r,n.y=i,n.z=a,n.w=o,n},_.setRow=function(e,t,n,r){return r=_.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var f=new e;_.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],f)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],f)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],f)),n};var A=new e;_.getMaximumScale=function(t){return _.getScale(t,A),e.maximumComponent(A)},_.multiply=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[3],u=e[4],E=e[5],s=e[6],c=e[7],_=e[8],T=e[9],R=e[10],l=e[11],f=e[12],A=e[13],h=e[14],N=e[15],d=t[0],I=t[1],S=t[2],M=t[3],m=t[4],O=t[5],y=t[6],p=t[7],C=t[8],U=t[9],L=t[10],F=t[11],P=t[12],v=t[13],w=t[14],g=t[15],x=r*d+u*I+_*S+f*M,D=i*d+E*I+T*S+A*M,B=a*d+s*I+R*S+h*M,z=o*d+c*I+l*S+N*M,G=r*m+u*O+_*y+f*p,b=i*m+E*O+T*y+A*p,X=a*m+s*O+R*y+h*p,V=o*m+c*O+l*y+N*p,q=r*C+u*U+_*L+f*F,H=i*C+E*U+T*L+A*F,W=a*C+s*U+R*L+h*F,Y=o*C+c*U+l*L+N*F,K=r*P+u*v+_*w+f*g,k=i*P+E*v+T*w+A*g,Z=a*P+s*v+R*w+h*g,j=o*P+c*v+l*w+N*g;return n[0]=x,n[1]=D,n[2]=B,n[3]=z,n[4]=G,n[5]=b,n[6]=X,n[7]=V,n[8]=q,n[9]=H,n[10]=W,n[11]=Y,n[12]=K,n[13]=k,n[14]=Z,n[15]=j,n},_.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},_.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},_.multiplyTransformation=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[4],u=e[5],E=e[6],s=e[8],c=e[9],_=e[10],T=e[12],R=e[13],l=e[14],f=t[0],A=t[1],h=t[2],N=t[4],d=t[5],I=t[6],S=t[8],M=t[9],m=t[10],O=t[12],y=t[13],p=t[14],C=r*f+o*A+s*h,U=i*f+u*A+c*h,L=a*f+E*A+_*h,F=r*N+o*d+s*I,P=i*N+u*d+c*I,v=a*N+E*d+_*I,w=r*S+o*M+s*m,g=i*S+u*M+c*m,x=a*S+E*M+_*m,D=r*O+o*y+s*p+T,B=i*O+u*y+c*p+R,z=a*O+E*y+_*p+l;return n[0]=C,n[1]=U,n[2]=L,n[3]=0,n[4]=F,n[5]=P,n[6]=v,n[7]=0,n[8]=w,n[9]=g,n[10]=x,n[11]=0,n[12]=D,n[13]=B,n[14]=z,n[15]=1,n},_.multiplyByMatrix3=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[4],u=e[5],E=e[6],s=e[8],c=e[9],_=e[10],T=t[0],R=t[1],l=t[2],f=t[3],A=t[4],h=t[5],N=t[6],d=t[7],I=t[8],S=r*T+o*R+s*l,M=i*T+u*R+c*l,m=a*T+E*R+_*l,O=r*f+o*A+s*h,y=i*f+u*A+c*h,p=a*f+E*A+_*h,C=r*N+o*d+s*I,U=i*N+u*d+c*I,L=a*N+E*d+_*I;return n[0]=S,n[1]=M,n[2]=m,n[3]=0,n[4]=O,n[5]=y,n[6]=p,n[7]=0,n[8]=C,n[9]=U,n[10]=L,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},_.multiplyByTranslation=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=r*e[0]+i*e[4]+a*e[8]+e[12],u=r*e[1]+i*e[5]+a*e[9]+e[13],E=r*e[2]+i*e[6]+a*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=E,n[15]=e[15],n};var h=new e;_.multiplyByUniformScale=function(e,t,n){return h.x=t,h.y=t,h.z=t,_.multiplyByScale(e,h,n)},_.multiplyByScale=function(e,t,n){var r=t.x,i=t.y,a=t.z;return 1===r&&1===i&&1===a?_.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=i*e[4],n[5]=i*e[5],n[6]=i*e[6],n[7]=0,n[8]=a*e[8],n[9]=a*e[9],n[10]=a*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},_.multiplyByVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=t.w,u=e[0]*r+e[4]*i+e[8]*a+e[12]*o,E=e[1]*r+e[5]*i+e[9]*a+e[13]*o,s=e[2]*r+e[6]*i+e[10]*a+e[14]*o,c=e[3]*r+e[7]*i+e[11]*a+e[15]*o;return n.x=u,n.y=E,n.z=s,n.w=c,n},_.multiplyByPointAsVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[4]*i+e[8]*a,u=e[1]*r+e[5]*i+e[9]*a,E=e[2]*r+e[6]*i+e[10]*a;return n.x=o,n.y=u,n.z=E,n},_.multiplyByPoint=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[4]*i+e[8]*a+e[12],u=e[1]*r+e[5]*i+e[9]*a+e[13],E=e[2]*r+e[6]*i+e[10]*a+e[14];return n.x=o,n.y=u,n.z=E,n},_.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},_.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},_.transpose=function(e,t){var n=e[1],r=e[2],i=e[3],a=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=a,t[10]=e[10],t[11]=e[14],t[12]=i,t[13]=o,t[14]=u,t[15]=e[15],t},_.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},_.equals=function(e,t){return e===t||i(e)&&i(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},_.equalsEpsilon=function(e,t,n){return e===t||i(e)&&i(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},_.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},_.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};var N=new s,d=new s,I=new t,S=new t(0,0,0,1);return _.inverse=function(e,n){if(s.equalsEpsilon(_.getRotation(e,N),d,E.EPSILON7)&&t.equals(_.getRow(e,3,I),S))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],i=e[4],a=e[8],o=e[12],u=e[1],T=e[5],R=e[9],l=e[13],f=e[2],A=e[6],h=e[10],M=e[14],m=e[3],O=e[7],y=e[11],p=e[15],C=h*p,U=M*y,L=A*p,F=M*O,P=A*y,v=h*O,w=f*p,g=M*m,x=f*y,D=h*m,B=f*O,z=A*m,G=C*T+F*R+P*l-(U*T+L*R+v*l),b=U*u+w*R+D*l-(C*u+g*R+x*l),X=L*u+g*T+B*l-(F*u+w*T+z*l),V=v*u+x*T+z*R-(P*u+D*T+B*R),q=U*i+L*a+v*o-(C*i+F*a+P*o),H=C*r+g*a+x*o-(U*r+w*a+D*o),W=F*r+w*i+z*o-(L*r+g*i+B*o),Y=P*r+D*i+B*a-(v*r+x*i+z*a);C=a*l,U=o*R,L=i*l,F=o*T,P=i*R,v=a*T,w=r*l,g=o*u,x=r*R,D=a*u,B=r*T,z=i*u;var K=C*O+F*y+P*p-(U*O+L*y+v*p),k=U*m+w*y+D*p-(C*m+g*y+x*p),Z=L*m+g*O+B*p-(F*m+w*O+z*p),j=v*m+x*O+z*y-(P*m+D*O+B*y),Q=L*h+v*M+U*A-(P*M+C*A+F*h),J=x*M+C*f+g*h-(w*h+D*M+U*f),$=w*A+z*M+F*f-(B*M+L*f+g*A),ee=B*h+P*f+D*A-(x*A+z*h+v*f),te=r*G+i*b+a*X+o*V;if(Math.abs(te)<E.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=G*te,n[1]=b*te,n[2]=X*te,n[3]=V*te,n[4]=q*te,n[5]=H*te,n[6]=W*te,n[7]=Y*te,n[8]=K*te,n[9]=k*te,n[10]=Z*te,n[11]=j*te,n[12]=Q*te,n[13]=J*te,n[14]=$*te,n[15]=ee*te,n},_.inverseTransformation=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[4],o=e[5],u=e[6],E=e[8],s=e[9],c=e[10],_=e[12],T=e[13],R=e[14],l=-n*_-r*T-i*R,f=-a*_-o*T-u*R,A=-E*_-s*T-c*R;return t[0]=n,t[1]=a,t[2]=E,t[3]=0,t[4]=r,t[5]=o,t[6]=s,t[7]=0,t[8]=i,t[9]=u,t[10]=c,t[11]=0,t[12]=l,t[13]=f,t[14]=A,t[15]=1,t},_.IDENTITY=u(new _(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),_.ZERO=u(new _(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),_.COLUMN0ROW0=0,_.COLUMN0ROW1=1,_.COLUMN0ROW2=2,_.COLUMN0ROW3=3,_.COLUMN1ROW0=4,_.COLUMN1ROW1=5,_.COLUMN1ROW2=6,_.COLUMN1ROW3=7,_.COLUMN2ROW0=8,_.COLUMN2ROW1=9,_.COLUMN2ROW2=10,_.COLUMN2ROW3=11,_.COLUMN3ROW0=12,_.COLUMN3ROW1=13,_.COLUMN3ROW2=14,_.COLUMN3ROW3=15,a(_.prototype,{length:{get:function(){return _.packedLength}}}),_.prototype.clone=function(e){return _.clone(this,e)},_.prototype.equals=function(e){return _.equals(this,e)},_.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},_.prototype.equalsEpsilon=function(e,t){return _.equalsEpsilon(this,e,t)},_.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]+")"},_}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,i,a,o,u,E){"use strict";function s(e,t,r,i){this.west=n(e,0),this.south=n(t,0),this.east=n(r,0),this.north=n(i,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,t,r){return r=n(r,0),t[r++]=e.west,t[r++]=e.south,t[r++]=e.east,t[r]=e.north,t},s.unpack=function(e,t,i){return t=n(t,0),r(i)||(i=new s),i.west=e[t++],i.south=e[t++],i.east=e[t++],i.north=e[t],i},s.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=E.TWO_PI),t-n},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,t,i,a,o){return e=E.toRadians(n(e,0)),t=E.toRadians(n(t,0)),i=E.toRadians(n(i,0)),a=E.toRadians(n(a,0)),r(o)?(o.west=e,o.south=t,o.east=i,o.north=a,o):new s(e,t,i,a)},s.fromRadians=function(e,t,i,a,o){return r(o)?(o.west=n(e,0),o.south=n(t,0),o.east=n(i,0),o.north=n(a,0),o):new s(e,t,i,a)},s.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,u=Number.MAX_VALUE,c=-Number.MAX_VALUE,_=0,T=e.length;_<T;_++){var R=e[_];n=Math.min(n,R.longitude),i=Math.max(i,R.longitude),u=Math.min(u,R.latitude),c=Math.max(c,R.latitude);var l=R.longitude>=0?R.longitude:R.longitude+E.TWO_PI;a=Math.min(a,l),o=Math.max(o,l)}return i-n>o-a&&(n=a,i=o,i>E.PI&&(i-=E.TWO_PI),n>E.PI&&(n-=E.TWO_PI)),r(t)?(t.west=n,t.south=u,t.east=i,t.north=c,t):new s(n,u,i,c)},s.fromCartesianArray=function(e,t,n){for(var i=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,u=-Number.MAX_VALUE,c=Number.MAX_VALUE,_=-Number.MAX_VALUE,T=0,R=e.length;T<R;T++){var l=t.cartesianToCartographic(e[T]);i=Math.min(i,l.longitude),a=Math.max(a,l.longitude),c=Math.min(c,l.latitude),_=Math.max(_,l.latitude);var f=l.longitude>=0?l.longitude:l.longitude+E.TWO_PI;o=Math.min(o,f),u=Math.max(u,f)}return a-i>u-o&&(i=o,a=u,a>E.PI&&(a-=E.TWO_PI),i>E.PI&&(i-=E.TWO_PI)),r(n)?(n.west=i,n.south=c,n.east=a,n.north=_,n):new s(i,c,a,_)},s.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.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},s.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},s.validate=function(e){},s.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)},s.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)},s.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)},s.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)},s.center=function(t,n){var i=t.east,a=t.west;i<a&&(i+=E.TWO_PI);var o=E.negativePiToPi(.5*(a+i)),u=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=u,n.height=0,n):new e(o,u)},s.intersection=function(e,t,n){var i=e.east,a=e.west,o=t.east,u=t.west;i<a&&o>0?i+=E.TWO_PI:o<u&&i>0&&(o+=E.TWO_PI),i<a&&u<0?u+=E.TWO_PI:o<u&&a<0&&(a+=E.TWO_PI);var c=E.negativePiToPi(Math.max(a,u)),_=E.negativePiToPi(Math.min(i,o));if(!((e.west<e.east||t.west<t.east)&&_<=c)){var T=Math.max(e.south,t.south),R=Math.min(e.north,t.north);if(!(T>=R))return r(n)?(n.west=c,n.south=T,n.east=_,n.north=R,n):new s(c,T,_,R)}},s.simpleIntersection=function(e,t,n){var i=Math.max(e.west,t.west),a=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(a>=u||i>=o))return r(n)?(n.west=i,n.south=a,n.east=o,n.north=u,n):new s(i,a,o,u)},s.union=function(e,t,n){r(n)||(n=new s);var i=e.east,a=e.west,o=t.east,u=t.west;i<a&&o>0?i+=E.TWO_PI:o<u&&i>0&&(o+=E.TWO_PI),i<a&&u<0?u+=E.TWO_PI:o<u&&a<0&&(a+=E.TWO_PI);var c=E.convertLongitudeRange(Math.min(a,u)),_=E.convertLongitudeRange(Math.max(i,o));return n.west=c,n.south=Math.min(e.south,t.south),n.east=_,n.north=Math.max(e.north,t.north),n},s.expand=function(e,t,n){return r(n)||(n=new s),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},s.contains=function(e,t){var n=t.longitude,r=t.latitude,i=e.west,a=e.east;return a<i&&(a+=E.TWO_PI,n<0&&(n+=E.TWO_PI)),(n>i||E.equalsEpsilon(n,i,E.EPSILON14))&&(n<a||E.equalsEpsilon(n,a,E.EPSILON14))&&r>=e.south&&r<=e.north};var c=new e;return s.subsample=function(e,t,i,a){t=n(t,o.WGS84),i=n(i,0),r(a)||(a=[]);var u=0,_=e.north,T=e.south,R=e.east,l=e.west,f=c;f.height=i,f.longitude=l,f.latitude=_,a[u]=t.cartographicToCartesian(f,a[u]),u++,f.longitude=R,a[u]=t.cartographicToCartesian(f,a[u]),u++,f.latitude=T,a[u]=t.cartographicToCartesian(f,a[u]),u++,f.longitude=l,a[u]=t.cartographicToCartesian(f,a[u]),u++,_<0?f.latitude=_:T>0?f.latitude=T:f.latitude=0;for(var A=1;A<8;++A)f.longitude=-Math.PI+A*E.PI_OVER_TWO,s.contains(e,f)&&(a[u]=t.cartographicToCartesian(f,a[u]),u++);return 0===f.latitude&&(f.longitude=l,a[u]=t.cartographicToCartesian(f,a[u]),u++,f.longitude=R,a[u]=t.cartographicToCartesian(f,a[u]),u++),a.length=u,a},s.MAX_VALUE=u(new s(-Math.PI,-E.PI_OVER_TWO,Math.PI,E.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,i,a,o,u,E,s,c,_){"use strict";function T(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var R=new e,l=new e,f=new e,A=new e,h=new e,N=new e,d=new e,I=new e,S=new e,M=new e,m=new e,O=new e;T.fromPoints=function(t,n){if(i(n)||(n=new T),!i(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var r=e.clone(t[0],d),a=e.clone(r,R),o=e.clone(r,l),u=e.clone(r,f),E=e.clone(r,A),s=e.clone(r,h),c=e.clone(r,N),_=t.length,y=1;y<_;y++){e.clone(t[y],r);var p=r.x,C=r.y,U=r.z;p<a.x&&e.clone(r,a),p>E.x&&e.clone(r,E),C<o.y&&e.clone(r,o),C>s.y&&e.clone(r,s),U<u.z&&e.clone(r,u),U>c.z&&e.clone(r,c)}var L=e.magnitudeSquared(e.subtract(E,a,I)),F=e.magnitudeSquared(e.subtract(s,o,I)),P=e.magnitudeSquared(e.subtract(c,u,I)),v=a,w=E,g=L;F>g&&(g=F,v=o,w=s),P>g&&(g=P,v=u,w=c);var x=S;x.x=.5*(v.x+w.x),x.y=.5*(v.y+w.y),x.z=.5*(v.z+w.z);var D=e.magnitudeSquared(e.subtract(w,x,I)),B=Math.sqrt(D),z=M;z.x=a.x,z.y=o.y,z.z=u.z;var G=m;G.x=E.x,G.y=s.y,G.z=c.z;var b=e.multiplyByScalar(e.add(z,G,I),.5,O),X=0;for(y=0;y<_;y++){e.clone(t[y],r);var V=e.magnitude(e.subtract(r,b,I));V>X&&(X=V);var q=e.magnitudeSquared(e.subtract(r,x,I));if(q>D){var H=Math.sqrt(q);B=.5*(B+H),D=B*B;var W=H-B;x.x=(B*x.x+W*r.x)/H,x.y=(B*x.y+W*r.y)/H,x.z=(B*x.z+W*r.z)/H}}return B<X?(e.clone(x,n.center),n.radius=B):(e.clone(b,n.center),n.radius=X),n};var y=new o,p=new e,C=new e,U=new t,L=new t;T.fromRectangle2D=function(e,t,n){return T.fromRectangleWithHeights2D(e,t,0,0,n)},T.fromRectangleWithHeights2D=function(t,n,a,o,u){if(i(u)||(u=new T),!i(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;n=r(n,y),_.southwest(t,U),U.height=a,_.northeast(t,L),L.height=o;var E=n.project(U,p),s=n.project(L,C),c=s.x-E.x,R=s.y-E.y,l=s.z-E.z;u.radius=.5*Math.sqrt(c*c+R*R+l*l);var f=u.center;return f.x=E.x+.5*c,f.y=E.y+.5*R,f.z=E.z+.5*l,u};var F=[];T.fromRectangle3D=function(e,t,n,o){t=r(t,a.WGS84),n=r(n,0);var u;return i(e)&&(u=_.subsample(e,t,n,F)),T.fromPoints(u,o)},T.fromVertices=function(t,n,a,o){if(i(o)||(o=new T),!i(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;n=r(n,e.ZERO),a=r(a,3);var u=d;u.x=t[0]+n.x,u.y=t[1]+n.y,u.z=t[2]+n.z;for(var E=e.clone(u,R),s=e.clone(u,l),c=e.clone(u,f),_=e.clone(u,A),y=e.clone(u,h),p=e.clone(u,N),C=t.length,U=0;U<C;U+=a){var L=t[U]+n.x,F=t[U+1]+n.y,P=t[U+2]+n.z;u.x=L,u.y=F,u.z=P,L<E.x&&e.clone(u,E),L>_.x&&e.clone(u,_),F<s.y&&e.clone(u,s),F>y.y&&e.clone(u,y),P<c.z&&e.clone(u,c),P>p.z&&e.clone(u,p)}var v=e.magnitudeSquared(e.subtract(_,E,I)),w=e.magnitudeSquared(e.subtract(y,s,I)),g=e.magnitudeSquared(e.subtract(p,c,I)),x=E,D=_,B=v;w>B&&(B=w,x=s,D=y),g>B&&(B=g,x=c,D=p);var z=S;z.x=.5*(x.x+D.x),z.y=.5*(x.y+D.y),z.z=.5*(x.z+D.z);var G=e.magnitudeSquared(e.subtract(D,z,I)),b=Math.sqrt(G),X=M;X.x=E.x,X.y=s.y,X.z=c.z;var V=m;V.x=_.x,V.y=y.y,V.z=p.z;var q=e.multiplyByScalar(e.add(X,V,I),.5,O),H=0;for(U=0;U<C;U+=a){u.x=t[U]+n.x,u.y=t[U+1]+n.y,u.z=t[U+2]+n.z;var W=e.magnitude(e.subtract(u,q,I));W>H&&(H=W);var Y=e.magnitudeSquared(e.subtract(u,z,I));if(Y>G){var K=Math.sqrt(Y);b=.5*(b+K),G=b*b;var k=K-b;z.x=(b*z.x+k*u.x)/K,z.y=(b*z.y+k*u.y)/K,z.z=(b*z.z+k*u.z)/K}}return b<H?(e.clone(z,o.center),o.radius=b):(e.clone(q,o.center),o.radius=H),o},T.fromEncodedCartesianVertices=function(t,n,r){if(i(r)||(r=new T),!i(t)||!i(n)||t.length!==n.length||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var a=d;a.x=t[0]+n[0],a.y=t[1]+n[1],a.z=t[2]+n[2];for(var o=e.clone(a,R),u=e.clone(a,l),E=e.clone(a,f),s=e.clone(a,A),c=e.clone(a,h),_=e.clone(a,N),y=t.length,p=0;p<y;p+=3){var C=t[p]+n[p],U=t[p+1]+n[p+1],L=t[p+2]+n[p+2];a.x=C,a.y=U,a.z=L,C<o.x&&e.clone(a,o),C>s.x&&e.clone(a,s),U<u.y&&e.clone(a,u),U>c.y&&e.clone(a,c),L<E.z&&e.clone(a,E),L>_.z&&e.clone(a,_)}var F=e.magnitudeSquared(e.subtract(s,o,I)),P=e.magnitudeSquared(e.subtract(c,u,I)),v=e.magnitudeSquared(e.subtract(_,E,I)),w=o,g=s,x=F;P>x&&(x=P,w=u,g=c),v>x&&(x=v,w=E,g=_);var D=S;D.x=.5*(w.x+g.x),D.y=.5*(w.y+g.y),D.z=.5*(w.z+g.z);var B=e.magnitudeSquared(e.subtract(g,D,I)),z=Math.sqrt(B),G=M;G.x=o.x,G.y=u.y,G.z=E.z;var b=m;b.x=s.x,b.y=c.y,b.z=_.z;var X=e.multiplyByScalar(e.add(G,b,I),.5,O),V=0;for(p=0;p<y;p+=3){a.x=t[p]+n[p],a.y=t[p+1]+n[p+1],a.z=t[p+2]+n[p+2];var q=e.magnitude(e.subtract(a,X,I));q>V&&(V=q);var H=e.magnitudeSquared(e.subtract(a,D,I));if(H>B){var W=Math.sqrt(H);z=.5*(z+W),B=z*z;var Y=W-z;D.x=(z*D.x+Y*a.x)/W,D.y=(z*D.y+Y*a.y)/W,D.z=(z*D.z+Y*a.z)/W}}return z<V?(e.clone(D,r.center),r.radius=z):(e.clone(X,r.center),r.radius=V),r},T.fromCornerPoints=function(t,n,r){i(r)||(r=new T);var a=r.center;return e.add(t,n,a),e.multiplyByScalar(a,.5,a),r.radius=e.distance(a,n),r},T.fromEllipsoid=function(t,n){return i(n)||(n=new T),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var P=new e;T.fromBoundingSpheres=function(t,n){if(i(n)||(n=new T),!i(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var r=t.length;if(1===r)return T.clone(t[0],n);if(2===r)return T.union(t[0],t[1],n);for(var a=[],o=0;o<r;o++)a.push(t[o].center);n=T.fromPoints(a,n);var u=n.center,E=n.radius;for(o=0;o<r;o++){var s=t[o];E=Math.max(E,e.distance(u,s.center,P)+s.radius)}return n.radius=E,n};var v=new e,w=new e,g=new e;T.fromOrientedBoundingBox=function(t,n){i(n)||(n=new T);var r=t.halfAxes,a=s.getColumn(r,0,v),o=s.getColumn(r,1,w),u=s.getColumn(r,2,g),E=e.magnitude(a),c=e.magnitude(o),_=e.magnitude(u);return n.center=e.clone(t.center,n.center),n.radius=Math.max(E,c,_),n},T.clone=function(t,n){if(i(t))return i(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new T(t.center,t.radius)},T.packedLength=4,T.pack=function(e,t,n){n=r(n,0);var i=e.center;return t[n++]=i.x,t[n++]=i.y,t[n++]=i.z,t[n]=e.radius,t},T.unpack=function(e,t,n){t=r(t,0),i(n)||(n=new T);var a=n.center;return a.x=e[t++],a.y=e[t++],a.z=e[t++],n.radius=e[t],n};var x=new e,D=new e;T.union=function(t,n,r){i(r)||(r=new T);var a=t.center,o=t.radius,u=n.center,E=n.radius,s=e.subtract(u,a,x),c=e.magnitude(s);if(o>=c+E)return t.clone(r),r;if(E>=c+o)return n.clone(r),r;var _=.5*(o+c+E),R=e.multiplyByScalar(s,(-o+_)/c,D);return e.add(R,a,R),e.clone(R,r.center),r.radius=_,r};var B=new e;T.expand=function(t,n,r){r=T.clone(t,r);var i=e.magnitude(e.subtract(n,r.center,B));return i>r.radius&&(r.radius=i),r},T.intersectPlane=function(t,n){var r=t.center,i=t.radius,a=n.normal,o=e.dot(a,r)+n.distance;return o<-i?u.OUTSIDE:o<i?u.INTERSECTING:u.INSIDE},T.transform=function(e,t,n){return i(n)||(n=new T),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=c.getMaximumScale(t)*e.radius,n};var z=new e;T.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,z);return e.magnitudeSquared(r)-t.radius*t.radius},T.transformWithoutScale=function(e,t,n){return i(n)||(n=new T),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var G=new e;T.computePlaneDistances=function(t,n,r,a){i(a)||(a=new E);var o=e.subtract(t.center,n,G),u=e.dot(r,o);return a.start=u-t.radius,a.stop=u+t.radius,a};for(var b=new e,X=new e,V=new e,q=new e,H=new e,W=new t,Y=new Array(8),K=0;K<8;++K)Y[K]=new e;var k=new o;return T.projectTo2D=function(t,n,i){n=r(n,k);var a=n.ellipsoid,o=t.center,u=t.radius,E=a.geodeticSurfaceNormal(o,b),s=e.cross(e.UNIT_Z,E,X);e.normalize(s,s);var c=e.cross(E,s,V);e.normalize(c,c),e.multiplyByScalar(E,u,E),e.multiplyByScalar(c,u,c),e.multiplyByScalar(s,u,s);var _=e.negate(c,H),R=e.negate(s,q),l=Y,f=l[0];e.add(E,c,f),e.add(f,s,f),f=l[1],e.add(E,c,f),e.add(f,R,f),f=l[2],e.add(E,_,f),e.add(f,R,f),f=l[3],e.add(E,_,f),e.add(f,s,f),e.negate(E,E),f=l[4],e.add(E,c,f),e.add(f,s,f),f=l[5],e.add(E,c,f),e.add(f,R,f),f=l[6],e.add(E,_,f),e.add(f,R,f),f=l[7],e.add(E,_,f),e.add(f,s,f);for(var A=l.length,h=0;h<A;++h){var N=l[h];e.add(o,N,N);var d=a.cartesianToCartographic(N,W);n.project(d,N)}i=T.fromPoints(l,i),o=i.center;var I=o.x,S=o.y,M=o.z;return o.x=M,o.y=I,o.z=S,i},T.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},T.equals=function(t,n){return t===n||i(t)&&i(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},T.prototype.intersectPlane=function(e){return T.intersectPlane(this,e)},T.prototype.distanceSquaredTo=function(e){return T.distanceSquaredTo(this,e)},T.prototype.computePlaneDistances=function(e,t,n){return T.computePlaneDistances(this,e,t,n)},T.prototype.isOccluded=function(e){return T.isOccluded(this,e)},T.prototype.equals=function(e){return T.equals(this,e)},T.prototype.clone=function(e){return T.clone(this,e)},T}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(e,n){this.x=t(e,0),this.y=t(n,0)}o.fromElements=function(e,t,r){return n(r)?(r.x=e,r.y=t,r):new o(e,t)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t):new o(e.x,e.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r]=e.y,n},o.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new o),i.x=e[r++],i.y=e[r],i},o.packArray=function(e,t){var r=e.length;n(t)?t.length=2*r:t=new Array(2*r);for(var i=0;i<r;++i)o.pack(e[i],t,2*i);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/2:t=new Array(r/2);for(var i=0;i<r;i+=2){var a=i/2;t[a]=o.unpack(e,i,t[a])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y)},o.minimumComponent=function(e){return Math.min(e.x,e.y)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var E=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,E),r=o.multiplyByScalar(e,1-n,r),o.add(E,r,r)};var s=new o,c=new o;o.angleBetween=function(e,t){return o.normalize(e,s),o.normalize(t,c),a.acosClamped(o.dot(s,c))};var _=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,_);return o.abs(n,n),t=n.x<=n.y?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},o.equalsEpsilon=function(e,t,r,i){return e===t||n(e)&&n(t)&&a.equalsEpsilon(e.x,t.x,r,i)&&a.equalsEpsilon(e.y,t.y,r,i)},o.ZERO=i(new o(0,0)),o.UNIT_X=i(new o(1,0)),o.UNIT_Y=i(new o(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,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},i={};return t(i,{element:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenElement]; +}},changeEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(i.supportsFullscreen())return null!==i.element}}}),i.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var i,a=["webkit","moz","o","ms","khtml"],o=0,u=a.length;o<u;++o){var E=a[o];i=E+"RequestFullscreen","function"==typeof t[i]?(r.requestFullscreen=i,n=!0):(i=E+"RequestFullScreen","function"==typeof t[i]&&(r.requestFullscreen=i,n=!0)),i=E+"ExitFullscreen","function"==typeof document[i]?r.exitFullscreen=i:(i=E+"CancelFullScreen","function"==typeof document[i]&&(r.exitFullscreen=i)),i=E+"FullscreenEnabled",void 0!==document[i]?r.fullscreenEnabled=i:(i=E+"FullScreenEnabled",void 0!==document[i]&&(r.fullscreenEnabled=i)),i=E+"FullscreenElement",void 0!==document[i]?r.fullscreenElement=i:(i=E+"FullScreenElement",void 0!==document[i]&&(r.fullscreenElement=i)),i=E+"fullscreenchange",void 0!==document["on"+i]&&("ms"===E&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=E+"fullscreenerror",void 0!==document["on"+i]&&("ms"===E&&(i="MSFullscreenError"),r.fullscreenerror=i)}return n},i.requestFullscreen=function(e,t){i.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},i.exitFullscreen=function(){i.supportsFullscreen()&&document[r.exitFullscreen]()},i}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function i(){if(!t(S)&&(S=!1,!T())){var e=/ Chrome\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(S=!0,M=r(e[1]))}return S}function a(){return i()&&M}function o(){if(!t(m)&&(m=!1,!i()&&!T()&&/ Safari\/[\.0-9]+/.test(I.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(m=!0,O=r(e[1]))}return m}function u(){return o()&&O}function E(){if(!t(y)){y=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(I.userAgent);null!==e&&(y=!0,p=r(e[1]),p.isNightly=!!e[2])}return y}function s(){return E()&&p}function c(){if(!t(C)){C=!1;var e;"Microsoft Internet Explorer"===I.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==e&&(C=!0,U=r(e[1]))):"Netscape"===I.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==e&&(C=!0,U=r(e[1])))}return C}function _(){return c()&&U}function T(){if(!t(L)){L=!1;var e=/ Edge\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(L=!0,F=r(e[1]))}return L}function R(){return T()&&F}function l(){if(!t(P)){P=!1;var e=/Firefox\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(P=!0,v=r(e[1]))}return P}function f(){return t(w)||(w=/Windows/i.test(I.appVersion)),w}function A(){return l()&&v}function h(){return t(g)||(g="undefined"!=typeof PointerEvent&&(!t(I.pointerEnabled)||I.pointerEnabled)),g}function N(){if(!t(D)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;D=t(n)&&""!==n,D&&(x=n)}return D}function d(){return N()?x:void 0}var I;I="undefined"!=typeof navigator?navigator:{};var S,M,m,O,y,p,C,U,L,F,P,v,w,g,x,D,B={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:E,webkitVersion:s,isInternetExplorer:c,internetExplorerVersion:_,isEdge:T,edgeVersion:R,isFirefox:l,firefoxVersion:A,isWindows:f,hardwareConcurrency:e(I.hardwareConcurrency,3),supportsPointerEvents:h,supportsImageRenderingPixelated:N,imageRenderingValue:d};return B.supportsFullscreen=function(){return n.supportsFullscreen()},B.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},B.supportsWebWorkers=function(){return"undefined"!=typeof Worker},B}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,i,a){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:a.BYTE,UNSIGNED_BYTE:a.UNSIGNED_BYTE,SHORT:a.SHORT,UNSIGNED_SHORT:a.UNSIGNED_SHORT,INT:a.INT,UNSIGNED_INT:a.UNSIGNED_INT,FLOAT:a.FLOAT,DOUBLE:a.DOUBLE};return o.getSizeInBytes=function(e){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.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},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 Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,i){switch(r=e(r,0),i=e(i,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,i);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,i);case o.SHORT:return new Int16Array(n,r,i);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,i);case o.INT:return new Int32Array(n,r,i);case o.UNSIGNED_INT:return new Uint32Array(n,r,i);case o.FLOAT:return new Float32Array(n,r,i);case o.DOUBLE:return new Float64Array(n,r,i)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},i(o)}),define("Core/CylinderGeometryLibrary",["./Math"],function(e){"use strict";var t={};return t.computePositions=function(t,n,r,i,a){var o,u=.5*t,E=-u,s=i+i,c=a?2*s:s,_=new Float64Array(3*c),T=0,R=0,l=a?3*s:0,f=a?3*(s+i):3*i;for(o=0;o<i;o++){var A=o/i*e.TWO_PI,h=Math.cos(A),N=Math.sin(A),d=h*r,I=N*r,S=h*n,M=N*n;_[R+l]=d,_[R+l+1]=I,_[R+l+2]=E,_[R+f]=S,_[R+f+1]=M,_[R+f+2]=u,R+=3,a&&(_[T++]=d,_[T++]=I,_[T++]=E,_[T++]=S,_[T++]=M,_[T++]=u)}return _},t}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===n.POINTS||e===n.LINES||e===n.LINE_LOOP||e===n.LINE_STRIP||e===n.TRIANGLES||e===n.TRIANGLE_STRIP||e===n.TRIANGLE_FAN}};return e(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,i){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,i.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return a.computeNumberOfVertices=function(e){var n=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var i=e.attributes[r],a=i.values.length/i.componentsPerAttribute;n=a}return n},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(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 r}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,n,r,i){"use strict";var a={UNSIGNED_BYTE:i.UNSIGNED_BYTE,UNSIGNED_SHORT:i.UNSIGNED_SHORT,UNSIGNED_INT:i.UNSIGNED_INT};return a.getSizeInBytes=function(e){switch(e){case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},a.validate=function(t){return e(t)&&(t===a.UNSIGNED_BYTE||t===a.UNSIGNED_SHORT||t===a.UNSIGNED_INT)},a.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},a.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)},n(a)}),define("Core/CylinderOutlineGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./CylinderGeometryLibrary","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./PrimitiveType"],function(e,t,n,r,i,a,o,u,E,s,c,_,T){"use strict";function R(e){e=a(e,a.EMPTY_OBJECT);var t=e.length,n=e.topRadius,r=e.bottomRadius,i=a(e.slices,128),o=Math.max(a(e.numberOfVerticalLines,16),0);this._length=t,this._topRadius=n,this._bottomRadius=r,this._slices=i,this._numberOfVerticalLines=o,this._workerName="createCylinderOutlineGeometry"}var l=new t;R.packedLength=5,R.pack=function(e,t,n){return n=a(n,0),t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n]=e._numberOfVerticalLines,t};var f={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0};return R.unpack=function(e,t,n){t=a(t,0);var r=e[t++],i=e[t++],u=e[t++],E=e[t++],s=e[t];return o(n)?(n._length=r,n._topRadius=i,n._bottomRadius=u,n._slices=E,n._numberOfVerticalLines=s,n):(f.length=r,f.topRadius=i,f.bottomRadius=u,f.slices=E,f.numberOfVerticalLines=s,new R(f))},R.createGeometry=function(a){var o=a._length,u=a._topRadius,R=a._bottomRadius,f=a._slices,A=a._numberOfVerticalLines;if(!(o<=0||u<0||R<0||0===u&&0===R)){var h,N=2*f,d=i.computePositions(o,u,R,f,!1),I=2*f;if(A>0){var S=Math.min(A,f);h=Math.round(f/S),I+=S}for(var M=_.createTypedArray(N,2*I),m=0,O=0;O<f-1;O++)M[m++]=O,M[m++]=O+1,M[m++]=O+f,M[m++]=O+1+f;if(M[m++]=f-1,M[m++]=0,M[m++]=f+f-1,M[m++]=f,A>0)for(O=0;O<f;O+=h)M[m++]=O,M[m++]=O+f;var y=new c;y.position=new s({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:d}),l.x=.5*o,l.y=Math.max(R,u);var p=new e(n.ZERO,t.magnitude(l));return new E({attributes:y,indices:M,primitiveType:T.LINES,boundingSphere:p})}},R}),define("Workers/createCylinderOutlineGeometry",["../Core/CylinderOutlineGeometry","../Core/defined"],function(e,t){"use strict";return function(n,r){return t(r)&&(n=e.unpack(n,r)),e.createGeometry(n)}})}(); \ No newline at end of file diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createEllipseGeometry.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createEllipseGeometry.js index 4417e449..fad742a1 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createEllipseGeometry.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createEllipseGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -222,9 +222,9 @@ OTHER DEALINGS IN THE SOFTWARE. * */ -!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==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";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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("Core/isArray",["./defined"],function(e){"use strict";var t=Array.isArray;return e(t)||(t=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),t}),define("Core/Check",["./defaultValue","./defined","./DeveloperError","./isArray"],function(e,t,r,n){"use strict";function a(e){return e+" was required but undefined."}function i(e,t,r){return"Expected "+r+" to be typeof "+t+", got "+e}var o={};return o.typeOf={},o.numeric={},o.defined=function(e,n){if(!t(e))throw new r(a(n))},o.numeric.maximum=function(e,t){if(o.typeOf.number(e),o.typeOf.number(t),e>t)throw new r("Expected "+e+" to be at most "+t)},o.numeric.minimum=function(e,t){if(o.typeOf.number(e),o.typeOf.number(t),e<t)throw new r("Expected "+e+" to be at least "+t)},o.typeOf.function=function(e,t){if("function"!=typeof e)throw new r(i(typeof e,"function",t))},o.typeOf.string=function(e,t){if("string"!=typeof e)throw new r(i(typeof e,"string",t))},o.typeOf.number=function(e,t){if("number"!=typeof e)throw new r(i(typeof e,"number",t))},o.typeOf.object=function(e,t){if("object"!=typeof e)throw new r(i(typeof e,"object",t))},o.typeOf.boolean=function(e,t){if("boolean"!=typeof e)throw new r(i(typeof e,"boolean",t))},o}),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^=e<<7&2636928640,e^=e<<15&4022730752,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,r,n){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:e<0?-1:0},a.signNotZero=function(e){return e<0?-1:1},a.toSNorm=function(e,r){return r=t(r,255),Math.round((.5*a.clamp(e,-1,1)+.5)*r)},a.fromSNorm=function(e,r){return r=t(r,255),a.clamp(e,0,r)/r*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t-r)},a.cosh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t+r)},a.lerp=function(e,t,r){return(1-r)*e+r*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){var t=a.TWO_PI,r=e-Math.floor(e/t)*t;return r<-Math.PI?r+t:r>=Math.PI?r-t:r},a.clampToLatitudeRange=function(e){return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){return(e%t+t)%t},a.equalsEpsilon=function(e,r,n,a){a=t(a,n);var i=Math.abs(e-r);return i<=a||i<=n*Math.max(Math.abs(e),Math.abs(r))};var i=[1];a.factorial=function(e){var t=i.length;if(e>=t)for(var r=i[t-1],n=t;n<=e;n++)i.push(r*n);return i[e]},a.incrementWrap=function(e,r,n){return n=t(n,0),++e,e>r&&(e=n),e},a.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,r){return e<t?t:e>r?r:e};var o=new e;return a.setRandomNumberSeed=function(t){o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(e){return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){return Math.log(e)/Math.log(t)},a.fog=function(e,t){var r=e*t;return 1-Math.exp(-(r*r))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i){"use strict";function o(e,r,n){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0)}o.fromSpherical=function(e,n){r(n)||(n=new o);var a=e.clock,i=e.cone,u=t(e.magnitude,1),s=u*Math.sin(i);return n.x=s*Math.cos(a),n.y=s*Math.sin(a),n.z=u*Math.cos(i),n},o.fromElements=function(e,t,n,a){return r(a)?(a.x=e,a.y=t,a.z=n,a):new o(e,t,n)},o.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n]=e.z,r},o.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new o),a.x=e[n++],a.y=e[n++],a.z=e[n],a},o.packArray=function(e,t){var n=e.length;r(t)?t.length=3*n:t=new Array(3*n);for(var a=0;a<n;++a)o.pack(e[a],t,3*a);return t},o.unpackArray=function(e,t){var n=e.length;r(t)?t.length=n/3:t=new Array(n/3);for(var a=0;a<n;a+=3){var i=a/3;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},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},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},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},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},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},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},o.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r.z=e.z/t.z,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},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},o.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*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},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,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};var s=new o;o.lerp=function(e,t,r,n){return o.multiplyByScalar(t,r,s),n=o.multiplyByScalar(e,1-r,n),o.add(s,n,n)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var r=o.dot(c,l),n=o.magnitude(o.cross(c,l,c));return Math.atan2(n,r)};var f=new o;o.mostOrthogonalAxis=function(e,t){var r=o.normalize(e,f);return o.abs(r,r),t=r.x<=r.y?r.x<=r.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):r.y<=r.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},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,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]},o.equalsEpsilon=function(e,t,n,a){return e===t||r(e)&&r(t)&&i.equalsEpsilon(e.x,t.x,n,a)&&i.equalsEpsilon(e.y,t.y,n,a)&&i.equalsEpsilon(e.z,t.z,n,a)},o.cross=function(e,t,r){var n=e.x,a=e.y,i=e.z,o=t.x,u=t.y,s=t.z,c=a*s-i*u,l=i*o-n*s,f=n*u-a*o;return r.x=c,r.y=l,r.z=f,r},o.fromDegrees=function(e,t,r,n,a){return e=i.toRadians(e),t=i.toRadians(t),o.fromRadians(e,t,r,n,a)};var d=new o,h=new o,E=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,n,a,i,u){a=t(a,0);var s=r(i)?i.radiiSquared:E,c=Math.cos(n);d.x=c*Math.cos(e),d.y=c*Math.sin(e),d.z=Math.sin(n),d=o.normalize(d,d),o.multiplyComponents(s,d,h);var l=Math.sqrt(o.dot(d,h));return h=o.divideByScalar(h,l,h),d=o.multiplyByScalar(d,a,d),r(u)||(u=new o),o.add(h,d,u)},o.fromDegreesArray=function(e,t,n){var a=e.length;r(n)?n.length=a/2:n=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;n[c]=o.fromDegrees(u,s,0,t,n[c])}return n},o.fromRadiansArray=function(e,t,n){var a=e.length;r(n)?n.length=a/2:n=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;n[c]=o.fromRadians(u,s,0,t,n[c])}return n},o.fromDegreesArrayHeights=function(e,t,n){var a=e.length;r(n)?n.length=a/3:n=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;n[l]=o.fromDegrees(u,s,c,t,n[l])}return n},o.fromRadiansArrayHeights=function(e,t,n){var a=e.length;r(n)?n.length=a/3:n=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;n[l]=o.fromRadians(u,s,c,t,n[l])}return n},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(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,t,r){return o.equalsEpsilon(this,e,t,r)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,r,n){"use strict";function a(r,a,u,s,c){var l=r.x,f=r.y,d=r.z,h=a.x,E=a.y,m=a.z,p=l*l*h*h,y=f*f*E*E,_=d*d*m*m,T=p+y+_,R=Math.sqrt(1/T),v=e.multiplyByScalar(r,R,i);if(T<s)return isFinite(R)?e.clone(v,c):void 0;var A=u.x,S=u.y,N=u.z,I=o;I.x=v.x*A*2,I.y=v.y*S*2,I.z=v.z*N*2;var g,O,M,w,x,P,C,D,L,U,b,F=(1-R)*e.magnitude(r)/(.5*e.magnitude(I)),z=0;do{F-=z,M=1/(1+F*A),w=1/(1+F*S),x=1/(1+F*N),P=M*M,C=w*w,D=x*x,L=P*M,U=C*w,b=D*x,g=p*P+y*C+_*D-1,O=p*L*A+y*U*S+_*b*N;var B=-2*O;z=g/B}while(Math.abs(g)>n.EPSILON12);return t(c)?(c.x=l*M,c.y=f*w,c.z=d*x,c):new e(l*M,f*w,d*x)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,r,n,a,i,o){"use strict";function u(e,r,n){this.longitude=t(e,0),this.latitude=t(r,0),this.height=t(n,0)}u.fromRadians=function(e,n,a,i){return a=t(a,0),r(i)?(i.longitude=e,i.latitude=n,i.height=a,i):new u(e,n,a)},u.fromDegrees=function(e,t,r,n){return e=i.toRadians(e),t=i.toRadians(t),u.fromRadians(e,t,r,n)};var s=new e,c=new e,l=new e,f=new e(1/6378137,1/6378137,1/6356752.314245179),d=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),h=i.EPSILON1;return u.fromCartesian=function(t,n,a){var E=r(n)?n.oneOverRadii:f,m=r(n)?n.oneOverRadiiSquared:d,p=r(n)?n._centerToleranceSquared:h,y=o(t,E,m,p,c);if(r(y)){var _=e.multiplyComponents(y,m,s);_=e.normalize(_,_);var T=e.subtract(t,y,l),R=Math.atan2(_.y,_.x),v=Math.asin(_.z),A=i.sign(e.dot(T,t))*e.magnitude(T);return r(a)?(a.longitude=R,a.latitude=v,a.height=A,a):new u(R,v,A)}},u.clone=function(e,t){if(r(e))return r(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||r(e)&&r(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n},u.ZERO=a(new u(0,0,0)),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,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),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","./scaleToGeodeticSurface"],function(e,t,r,n,a,i,o,u,s){"use strict";function c(t,n,a,i){n=r(n,0),a=r(a,0),i=r(i,0),t._radii=new e(n,a,i),t._radiiSquared=new e(n*n,a*a,i*i),t._radiiToTheFourth=new e(n*n*n*n,a*a*a*a,i*i*i*i),t._oneOverRadii=new e(0===n?0:1/n,0===a?0:1/a,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===n?0:1/(n*n),0===a?0:1/(a*a),0===i?0:1/(i*i)),t._minimumRadius=Math.min(n,a,i),t._maximumRadius=Math.max(n,a,i),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(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,this._sqauredXOverSquaredZ=void 0,c(this,e,t,r)}a(l.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}}}),l.clone=function(t,r){if(n(t)){var a=t._radii;return n(r)?(e.clone(a,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 l(a.x,a.y,a.z)}},l.fromCartesian3=function(e,t){return n(t)||(t=new l),n(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,n,a){return a=r(a,0),e.pack(t._radii,n,a),n},l.unpack=function(t,n,a){n=r(n,0);var i=e.unpack(t,n);return l.fromCartesian3(i,a)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,r){var a=t.longitude,i=t.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return n(r)||(r=new e),r.x=u,r.y=s,r.z=c,e.normalize(r,r)},l.prototype.geodeticSurfaceNormal=function(t,r){return n(r)||(r=new e),r=e.multiplyComponents(t,this._oneOverRadiiSquared,r),e.normalize(r,r)};var f=new e,d=new e;l.prototype.cartographicToCartesian=function(t,r){var a=f,i=d;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(e.dot(a,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(a,t.height,a),n(r)||(r=new e),e.add(i,a,r)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var a=0;a<r;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var h=new e,E=new e,m=new e;return l.prototype.cartesianToCartographic=function(r,a){var i=this.scaleToGeodeticSurface(r,E);if(n(i)){var o=this.geodeticSurfaceNormal(i,h),s=e.subtract(r,i,m),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),f=u.sign(e.dot(s,r))*e.magnitude(s);return n(a)?(a.longitude=c,a.latitude=l,a.height=f,a):new t(c,l,f)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var a=0;a<r;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,r){n(r)||(r=new e);var a=t.x,i=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return e.multiplyByScalar(t,s,r)},l.prototype.transformPositionToScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._oneOverRadii,r)},l.prototype.transformPositionFromScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._radii,r)},l.prototype.equals=function(t){return this===t||n(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,a,i){a=r(a,0);var o=this._sqauredXOverSquaredZ;if(n(i)||(i=new e),i.x=0,i.y=0,i.z=t.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},l}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,r,n,a,i,o){"use strict";function u(e){this._ellipsoid=r(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,r){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return n(r)?(r.x=i,r.y=o,r.z=u,r):new e(i,o,u)},u.prototype.unproject=function(e,r){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,u=e.z;return n(r)?(r.longitude=i,r.latitude=o,r.height=u,r):new t(i,o,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";function t(t,r){this.start=e(t,0),this.stop=e(r,0)}return t}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i,o){"use strict";function u(e,r,n,a,i,o,u,s,c){this[0]=t(e,0),this[1]=t(a,0),this[2]=t(u,0),this[3]=t(r,0),this[4]=t(i,0),this[5]=t(s,0),this[6]=t(n,0),this[7]=t(o,0),this[8]=t(c,0)}function s(e){for(var t=0,r=0;r<9;++r){var n=e[r];t+=n*n}return Math.sqrt(t)}function c(e){for(var t=0,r=0;r<3;++r){var n=e[u.getElementIndex(E[r],h[r])];t+=2*n*n}return Math.sqrt(t)}function l(e,t){for(var r=o.EPSILON15,n=0,a=1,i=0;i<3;++i){var s=Math.abs(e[u.getElementIndex(E[i],h[i])]);s>n&&(a=i,n=s)}var c=1,l=0,f=h[a],d=E[a];if(Math.abs(e[u.getElementIndex(d,f)])>r){var m,p=e[u.getElementIndex(d,d)],y=e[u.getElementIndex(f,f)],_=e[u.getElementIndex(d,f)],T=(p-y)/2/_;m=T<0?-1/(-T+Math.sqrt(1+T*T)):1/(T+Math.sqrt(1+T*T)),c=1/Math.sqrt(1+m*m),l=m*c}return t=u.clone(u.IDENTITY,t),t[u.getElementIndex(f,f)]=t[u.getElementIndex(d,d)]=c,t[u.getElementIndex(d,f)]=l,t[u.getElementIndex(f,d)]=-l,t}u.packedLength=9,u.pack=function(e,r,n){return 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},u.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new u),a[0]=e[n++],a[1]=e[n++],a[2]=e[n++],a[3]=e[n++],a[4]=e[n++],a[5]=e[n++],a[6]=e[n++],a[7]=e[n++],a[8]=e[n++],a},u.clone=function(e,t){if(r(e))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):new u(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},u.fromArray=function(e,n,a){return n=t(n,0),r(a)||(a=new u),a[0]=e[n],a[1]=e[n+1],a[2]=e[n+2],a[3]=e[n+3],a[4]=e[n+4],a[5]=e[n+5],a[6]=e[n+6],a[7]=e[n+7],a[8]=e[n+8],a},u.fromColumnMajorArray=function(e,t){return u.clone(e,t)},u.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 u(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},u.fromQuaternion=function(e,t){var n=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,s=e.y*e.y,c=e.y*e.z,l=e.y*e.w,f=e.z*e.z,d=e.z*e.w,h=e.w*e.w,E=n-s-f+h,m=2*(a-d),p=2*(i+l),y=2*(a+d),_=-n+s-f+h,T=2*(c-o),R=2*(i-l),v=2*(c+o),A=-n-s+f+h;return r(t)?(t[0]=E,t[1]=y,t[2]=R,t[3]=m,t[4]=_,t[5]=v,t[6]=p,t[7]=T,t[8]=A,t):new u(E,m,p,y,_,T,R,v,A)},u.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),a=Math.cos(-e.heading),i=Math.cos(e.roll),o=Math.sin(-e.pitch),s=Math.sin(-e.heading),c=Math.sin(e.roll),l=n*a,f=-i*s+c*o*a,d=c*s+i*o*a,h=n*s,E=i*a+c*o*s,m=-o*i+i*o*s,p=-o,y=c*n,_=i*n;return r(t)?(t[0]=l,t[1]=h,t[2]=p,t[3]=f,t[4]=E,t[5]=y,t[6]=d,t[7]=m,t[8]=_,t):new u(l,f,d,h,E,m,p,y,_)},u.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 u(e.x,0,0,0,e.y,0,0,0,e.z)},u.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 u(e,0,0,0,e,0,0,0,e)},u.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 u(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},u.fromRotationX=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=a,t[6]=0,t[7]=-a,t[8]=n,t):new u(1,0,0,0,n,-a,0,a,n)},u.fromRotationY=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=n,t):new u(n,0,a,0,1,0,-a,0,n)},u.fromRotationZ=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=a,t[2]=0,t[3]=-a,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new u(n,-a,0,a,n,0,0,0,1)},u.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]]},u.getElementIndex=function(e,t){return 3*e+t},u.getColumn=function(e,t,r){var n=3*t,a=e[n],i=e[n+1],o=e[n+2];return r.x=a,r.y=i,r.z=o,r},u.setColumn=function(e,t,r,n){n=u.clone(e,n);var a=3*t;return n[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n},u.getRow=function(e,t,r){var n=e[t],a=e[t+3],i=e[t+6];return r.x=n,r.y=a,r.z=i,r},u.setRow=function(e,t,r,n){return n=u.clone(e,n),n[t]=r.x,n[t+3]=r.y,n[t+6]=r.z,n};var f=new e;u.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],f)),r.y=e.magnitude(e.fromElements(t[3],t[4],t[5],f)),r.z=e.magnitude(e.fromElements(t[6],t[7],t[8],f)),r};var d=new e;u.getMaximumScale=function(t){return u.getScale(t,d),e.maximumComponent(d)},u.multiply=function(e,t,r){var n=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=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]=a,r[2]=i,r[3]=o,r[4]=u,r[5]=s,r[6]=c,r[7]=l,r[8]=f,r},u.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},u.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},u.multiplyByVector=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=e[0]*n+e[3]*a+e[6]*i,u=e[1]*n+e[4]*a+e[7]*i,s=e[2]*n+e[5]*a+e[8]*i;return r.x=o,r.y=u,r.z=s,r},u.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},u.multiplyByScale=function(e,t,r){return r[0]=e[0]*t.x,r[1]=e[1]*t.x,r[2]=e[2]*t.x,r[3]=e[3]*t.y,r[4]=e[4]*t.y,r[5]=e[5]*t.y,r[6]=e[6]*t.z,r[7]=e[7]*t.z,r[8]=e[8]*t.z,r},u.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},u.transpose=function(e,t){var r=e[0],n=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=r,t[1]=n,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var h=[1,0,0],E=[2,2,1],m=new u,p=new u;return u.computeEigenDecomposition=function(e,t){var n=o.EPSILON20,a=10,i=0,f=0;r(t)||(t={});for(var d=t.unitary=u.clone(u.IDENTITY,t.unitary),h=t.diagonal=u.clone(e,t.diagonal),E=n*s(h);f<a&&c(h)>E;)l(h,m),u.transpose(m,p),u.multiply(h,m,h),u.multiply(p,h,h),u.multiply(d,m,d),++i>2&&(++f,i=0);return t},u.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},u.determinant=function(e){var t=e[0],r=e[3],n=e[6],a=e[1],i=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*o)+a*(s*n-r*c)+u*(r*o-i*n)},u.inverse=function(e,t){var r=e[0],n=e[1],a=e[2],i=e[3],o=e[4],s=e[5],c=e[6],l=e[7],f=e[8],d=u.determinant(e);t[0]=o*f-l*s,t[1]=l*a-n*f,t[2]=n*s-o*a,t[3]=c*s-i*f,t[4]=r*f-c*a,t[5]=i*a-r*s,t[6]=i*l-c*o,t[7]=c*n-r*l,t[8]=r*o-i*n;var h=1/d;return u.multiplyByScalar(t,h,t)},u.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]},u.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},u.IDENTITY=i(new u(1,0,0,0,1,0,0,0,1)),u.ZERO=i(new u(0,0,0,0,0,0,0,0,0)),u.COLUMN0ROW0=0,u.COLUMN0ROW1=1,u.COLUMN0ROW2=2,u.COLUMN1ROW0=3,u.COLUMN1ROW1=4,u.COLUMN1ROW2=5,u.COLUMN2ROW0=6,u.COLUMN2ROW1=7,u.COLUMN2ROW2=8,n(u.prototype,{length:{get:function(){return u.packedLength}}}),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},u}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a){"use strict";function i(t,r,n,a){this.x=e(t,0),this.y=e(r,0),this.z=e(n,0),this.w=e(a,0)}i.fromElements=function(e,r,n,a,o){return t(o)?(o.x=e,o.y=r,o.z=n,o.w=a,o):new i(e,r,n,a)},i.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 i(e.red,e.green,e.blue,e.alpha)},i.clone=function(e,r){if(t(e))return t(r)?(r.x=e.x,r.y=e.y,r.z=e.z,r.w=e.w,r):new i(e.x,e.y,e.z,e.w)},i.packedLength=4,i.pack=function(t,r,n){return n=e(n,0),r[n++]=t.x,r[n++]=t.y,r[n++]=t.z,r[n]=t.w,r},i.unpack=function(r,n,a){return n=e(n,0),t(a)||(a=new i),a.x=r[n++],a.y=r[n++],a.z=r[n++],a.w=r[n],a},i.packArray=function(e,r){var n=e.length;t(r)?r.length=4*n:r=new Array(4*n);for(var a=0;a<n;++a)i.pack(e[a],r,4*a);return r},i.unpackArray=function(e,r){var n=e.length;t(r)?r.length=n/4:r=new Array(n/4);for(var a=0;a<n;a+=4){var o=a/4;r[o]=i.unpack(e,a,r[o])}return r},i.fromArray=i.unpack,i.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},i.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},i.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},i.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},i.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},i.magnitude=function(e){return Math.sqrt(i.magnitudeSquared(e))};var o=new i;i.distance=function(e,t){return i.subtract(e,t,o),i.magnitude(o)},i.distanceSquared=function(e,t){return i.subtract(e,t,o),i.magnitudeSquared(o)},i.normalize=function(e,t){var r=i.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t.z=e.z/r,t.w=e.w/r,t},i.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},i.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},i.divideComponents=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},i.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},i.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},i.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},i.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},i.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},i.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 u=new i;i.lerp=function(e,t,r,n){return i.multiplyByScalar(t,r,u),n=i.multiplyByScalar(e,1-r,n),i.add(u,n,n)};var s=new i;return i.mostOrthogonalAxis=function(e,t){var r=i.normalize(e,s);return i.abs(r,r),t=r.x<=r.y?r.x<=r.z?r.x<=r.w?i.clone(i.UNIT_X,t):i.clone(i.UNIT_W,t):r.z<=r.w?i.clone(i.UNIT_Z,t):i.clone(i.UNIT_W,t):r.y<=r.z?r.y<=r.w?i.clone(i.UNIT_Y,t):i.clone(i.UNIT_W,t):r.z<=r.w?i.clone(i.UNIT_Z,t):i.clone(i.UNIT_W,t)},i.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},i.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]&&e.w===t[r+3]},i.equalsEpsilon=function(e,r,n,i){return e===r||t(e)&&t(r)&&a.equalsEpsilon(e.x,r.x,n,i)&&a.equalsEpsilon(e.y,r.y,n,i)&&a.equalsEpsilon(e.z,r.z,n,i)&&a.equalsEpsilon(e.w,r.w,n,i)},i.ZERO=n(new i(0,0,0,0)),i.UNIT_X=n(new i(1,0,0,0)),i.UNIT_Y=n(new i(0,1,0,0)),i.UNIT_Z=n(new i(0,0,1,0)),i.UNIT_W=n(new i(0,0,0,1)),i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i.prototype.equalsEpsilon=function(e,t,r){return i.equalsEpsilon(this,e,t,r)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},i}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,r,n,a,i,o,u,s,c){"use strict";function l(e,t,n,a,i,o,u,s,c,l,f,d,h,E,m,p){this[0]=r(e,0),this[1]=r(i,0),this[2]=r(c,0),this[3]=r(h,0),this[4]=r(t,0), -this[5]=r(o,0),this[6]=r(l,0),this[7]=r(E,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(f,0),this[11]=r(m,0),this[12]=r(a,0),this[13]=r(s,0),this[14]=r(d,0),this[15]=r(p,0)}l.packedLength=16,l.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},l.unpack=function(e,t,a){return t=r(t,0),n(a)||(a=new l),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a[9]=e[t++],a[10]=e[t++],a[11]=e[t++],a[12]=e[t++],a[13]=e[t++],a[14]=e[t++],a[15]=e[t],a},l.clone=function(e,t){if(n(e))return n(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 l(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])},l.fromArray=l.unpack,l.fromColumnMajorArray=function(e,t){return l.clone(e,t)},l.fromRowMajorArray=function(e,t){return n(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 l(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])},l.fromRotationTranslation=function(t,a,i){return a=r(a,e.ZERO),n(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=a.x,i[13]=a.y,i[14]=a.z,i[15]=1,i):new l(t[0],t[3],t[6],a.x,t[1],t[4],t[7],a.y,t[2],t[5],t[8],a.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(e,t,r,a){n(a)||(a=new l);var i=r.x,o=r.y,u=r.z,s=t.x*t.x,c=t.x*t.y,f=t.x*t.z,d=t.x*t.w,h=t.y*t.y,E=t.y*t.z,m=t.y*t.w,p=t.z*t.z,y=t.z*t.w,_=t.w*t.w,T=s-h-p+_,R=2*(c-y),v=2*(f+m),A=2*(c+y),S=-s+h-p+_,N=2*(E-d),I=2*(f-m),g=2*(E+d),O=-s-h+p+_;return a[0]=T*i,a[1]=A*i,a[2]=I*i,a[3]=0,a[4]=R*o,a[5]=S*o,a[6]=g*o,a[7]=0,a[8]=v*u,a[9]=N*u,a[10]=O*u,a[11]=0,a[12]=e.x,a[13]=e.y,a[14]=e.z,a[15]=1,a},l.fromTranslationRotationScale=function(e,t){return l.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},l.fromTranslation=function(e,t){return l.fromRotationTranslation(s.IDENTITY,e,t)},l.fromScale=function(e,t){return n(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 l(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},l.fromUniformScale=function(e,t){return n(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 l(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var f=new e,d=new e,h=new e;l.fromCamera=function(t,r){var a=t.position,i=t.direction,o=t.up;e.normalize(i,f),e.normalize(e.cross(f,o,d),d),e.normalize(e.cross(d,f,h),h);var u=d.x,s=d.y,c=d.z,E=f.x,m=f.y,p=f.z,y=h.x,_=h.y,T=h.z,R=a.x,v=a.y,A=a.z,S=u*-R+s*-v+c*-A,N=y*-R+_*-v+T*-A,I=E*R+m*v+p*A;return n(r)?(r[0]=u,r[1]=y,r[2]=-E,r[3]=0,r[4]=s,r[5]=_,r[6]=-m,r[7]=0,r[8]=c,r[9]=T,r[10]=-p,r[11]=0,r[12]=S,r[13]=N,r[14]=I,r[15]=1,r):new l(u,s,c,S,y,_,T,N,-E,-m,-p,I,0,0,0,1)},l.computePerspectiveFieldOfView=function(e,t,r,n,a){var i=Math.tan(.5*e),o=1/i,u=o/t,s=(n+r)/(r-n),c=2*n*r/(r-n);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=c,a[15]=0,a},l.computeOrthographicOffCenter=function(e,t,r,n,a,i,o){var u=1/(t-e),s=1/(n-r),c=1/(i-a),l=-(t+e)*u,f=-(n+r)*s,d=-(i+a)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=f,o[14]=d,o[15]=1,o},l.computePerspectiveOffCenter=function(e,t,r,n,a,i,o){var u=2*a/(t-e),s=2*a/(n-r),c=(t+e)/(t-e),l=(n+r)/(n-r),f=-(i+a)/(i-a),d=-1,h=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=f,o[11]=d,o[12]=0,o[13]=0,o[14]=h,o[15]=0,o},l.computeInfinitePerspectiveOffCenter=function(e,t,r,n,a,i){var o=2*a/(t-e),u=2*a/(n-r),s=(t+e)/(t-e),c=(n+r)/(n-r),l=-1,f=-1,d=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=s,i[9]=c,i[10]=l,i[11]=f,i[12]=0,i[13]=0,i[14]=d,i[15]=0,i},l.computeViewportTransformation=function(e,t,n,a){e=r(e,r.EMPTY_OBJECT);var i=r(e.x,0),o=r(e.y,0),u=r(e.width,0),s=r(e.height,0);t=r(t,0),n=r(n,1);var c=.5*u,l=.5*s,f=.5*(n-t),d=c,h=l,E=f,m=i+c,p=o+l,y=t+f,_=1;return a[0]=d,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=h,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=E,a[11]=0,a[12]=m,a[13]=p,a[14]=y,a[15]=_,a},l.computeView=function(t,r,n,a,i){return i[0]=a.x,i[1]=n.x,i[2]=-r.x,i[3]=0,i[4]=a.y,i[5]=n.y,i[6]=-r.y,i[7]=0,i[8]=a.z,i[9]=n.z,i[10]=-r.z,i[11]=0,i[12]=-e.dot(a,t),i[13]=-e.dot(n,t),i[14]=e.dot(r,t),i[15]=1,i},l.toArray=function(e,t){return n(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]]},l.getElementIndex=function(e,t){return 4*e+t},l.getColumn=function(e,t,r){var n=4*t,a=e[n],i=e[n+1],o=e[n+2],u=e[n+3];return r.x=a,r.y=i,r.z=o,r.w=u,r},l.setColumn=function(e,t,r,n){n=l.clone(e,n);var a=4*t;return n[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n[a+3]=r.w,n},l.setTranslation=function(e,t,r){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]=t.x,r[13]=t.y,r[14]=t.z,r[15]=e[15],r},l.getRow=function(e,t,r){var n=e[t],a=e[t+4],i=e[t+8],o=e[t+12];return r.x=n,r.y=a,r.z=i,r.w=o,r},l.setRow=function(e,t,r,n){return n=l.clone(e,n),n[t]=r.x,n[t+4]=r.y,n[t+8]=r.z,n[t+12]=r.w,n};var E=new e;l.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],E)),r.y=e.magnitude(e.fromElements(t[4],t[5],t[6],E)),r.z=e.magnitude(e.fromElements(t[8],t[9],t[10],E)),r};var m=new e;l.getMaximumScale=function(t){return l.getScale(t,m),e.maximumComponent(m)},l.multiply=function(e,t,r){var n=e[0],a=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],f=e[8],d=e[9],h=e[10],E=e[11],m=e[12],p=e[13],y=e[14],_=e[15],T=t[0],R=t[1],v=t[2],A=t[3],S=t[4],N=t[5],I=t[6],g=t[7],O=t[8],M=t[9],w=t[10],x=t[11],P=t[12],C=t[13],D=t[14],L=t[15],U=n*T+u*R+f*v+m*A,b=a*T+s*R+d*v+p*A,F=i*T+c*R+h*v+y*A,z=o*T+l*R+E*v+_*A,B=n*S+u*N+f*I+m*g,G=a*S+s*N+d*I+p*g,q=i*S+c*N+h*I+y*g,V=o*S+l*N+E*I+_*g,W=n*O+u*M+f*w+m*x,X=a*O+s*M+d*w+p*x,H=i*O+c*M+h*w+y*x,Y=o*O+l*M+E*w+_*x,k=n*P+u*C+f*D+m*L,j=a*P+s*C+d*D+p*L,Z=i*P+c*C+h*D+y*L,K=o*P+l*C+E*D+_*L;return r[0]=U,r[1]=b,r[2]=F,r[3]=z,r[4]=B,r[5]=G,r[6]=q,r[7]=V,r[8]=W,r[9]=X,r[10]=H,r[11]=Y,r[12]=k,r[13]=j,r[14]=Z,r[15]=K,r},l.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},l.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},l.multiplyTransformation=function(e,t,r){var n=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],d=e[12],h=e[13],E=e[14],m=t[0],p=t[1],y=t[2],_=t[4],T=t[5],R=t[6],v=t[8],A=t[9],S=t[10],N=t[12],I=t[13],g=t[14],O=n*m+o*p+c*y,M=a*m+u*p+l*y,w=i*m+s*p+f*y,x=n*_+o*T+c*R,P=a*_+u*T+l*R,C=i*_+s*T+f*R,D=n*v+o*A+c*S,L=a*v+u*A+l*S,U=i*v+s*A+f*S,b=n*N+o*I+c*g+d,F=a*N+u*I+l*g+h,z=i*N+s*I+f*g+E;return r[0]=O,r[1]=M,r[2]=w,r[3]=0,r[4]=x,r[5]=P,r[6]=C,r[7]=0,r[8]=D,r[9]=L,r[10]=U,r[11]=0,r[12]=b,r[13]=F,r[14]=z,r[15]=1,r},l.multiplyByMatrix3=function(e,t,r){var n=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],d=t[0],h=t[1],E=t[2],m=t[3],p=t[4],y=t[5],_=t[6],T=t[7],R=t[8],v=n*d+o*h+c*E,A=a*d+u*h+l*E,S=i*d+s*h+f*E,N=n*m+o*p+c*y,I=a*m+u*p+l*y,g=i*m+s*p+f*y,O=n*_+o*T+c*R,M=a*_+u*T+l*R,w=i*_+s*T+f*R;return r[0]=v,r[1]=A,r[2]=S,r[3]=0,r[4]=N,r[5]=I,r[6]=g,r[7]=0,r[8]=O,r[9]=M,r[10]=w,r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r},l.multiplyByTranslation=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=n*e[0]+a*e[4]+i*e[8]+e[12],u=n*e[1]+a*e[5]+i*e[9]+e[13],s=n*e[2]+a*e[6]+i*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]=o,r[13]=u,r[14]=s,r[15]=e[15],r};var p=new e;l.multiplyByUniformScale=function(e,t,r){return p.x=t,p.y=t,p.z=t,l.multiplyByScale(e,p,r)},l.multiplyByScale=function(e,t,r){var n=t.x,a=t.y,i=t.z;return 1===n&&1===a&&1===i?l.clone(e,r):(r[0]=n*e[0],r[1]=n*e[1],r[2]=n*e[2],r[3]=0,r[4]=a*e[4],r[5]=a*e[5],r[6]=a*e[6],r[7]=0,r[8]=i*e[8],r[9]=i*e[9],r[10]=i*e[10],r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=1,r)},l.multiplyByVector=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=t.w,u=e[0]*n+e[4]*a+e[8]*i+e[12]*o,s=e[1]*n+e[5]*a+e[9]*i+e[13]*o,c=e[2]*n+e[6]*a+e[10]*i+e[14]*o,l=e[3]*n+e[7]*a+e[11]*i+e[15]*o;return r.x=u,r.y=s,r.z=c,r.w=l,r},l.multiplyByPointAsVector=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=e[0]*n+e[4]*a+e[8]*i,u=e[1]*n+e[5]*a+e[9]*i,s=e[2]*n+e[6]*a+e[10]*i;return r.x=o,r.y=u,r.z=s,r},l.multiplyByPoint=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=e[0]*n+e[4]*a+e[8]*i+e[12],u=e[1]*n+e[5]*a+e[9]*i+e[13],s=e[2]*n+e[6]*a+e[10]*i+e[14];return r.x=o,r.y=u,r.z=s,r},l.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},l.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},l.transpose=function(e,t){var r=e[1],n=e[2],a=e[3],i=e[6],o=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]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=o,t[14]=u,t[15]=e[15],t},l.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},l.equals=function(e,t){return e===t||n(e)&&n(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},l.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r&&Math.abs(e[9]-t[9])<=r&&Math.abs(e[10]-t[10])<=r&&Math.abs(e[11]-t[11])<=r&&Math.abs(e[12]-t[12])<=r&&Math.abs(e[13]-t[13])<=r&&Math.abs(e[14]-t[14])<=r&&Math.abs(e[15]-t[15])<=r},l.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},l.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};var y=new s,_=new s,T=new t,R=new t(0,0,0,1);return l.inverse=function(e,r){if(s.equalsEpsilon(l.getRotation(e,y),_,u.EPSILON7)&&t.equals(l.getRow(e,3,T),R))return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=0,r[11]=0,r[12]=-e[12],r[13]=-e[13],r[14]=-e[14],r[15]=1,r;var n=e[0],a=e[4],i=e[8],o=e[12],f=e[1],d=e[5],h=e[9],E=e[13],m=e[2],p=e[6],v=e[10],A=e[14],S=e[3],N=e[7],I=e[11],g=e[15],O=v*g,M=A*I,w=p*g,x=A*N,P=p*I,C=v*N,D=m*g,L=A*S,U=m*I,b=v*S,F=m*N,z=p*S,B=O*d+x*h+P*E-(M*d+w*h+C*E),G=M*f+D*h+b*E-(O*f+L*h+U*E),q=w*f+L*d+F*E-(x*f+D*d+z*E),V=C*f+U*d+z*h-(P*f+b*d+F*h),W=M*a+w*i+C*o-(O*a+x*i+P*o),X=O*n+L*i+U*o-(M*n+D*i+b*o),H=x*n+D*a+z*o-(w*n+L*a+F*o),Y=P*n+b*a+F*i-(C*n+U*a+z*i);O=i*E,M=o*h,w=a*E,x=o*d,P=a*h,C=i*d,D=n*E,L=o*f,U=n*h,b=i*f,F=n*d,z=a*f;var k=O*N+x*I+P*g-(M*N+w*I+C*g),j=M*S+D*I+b*g-(O*S+L*I+U*g),Z=w*S+L*N+F*g-(x*S+D*N+z*g),K=C*S+U*N+z*I-(P*S+b*N+F*I),J=w*v+C*A+M*p-(P*A+O*p+x*v),Q=U*A+O*m+L*v-(D*v+b*A+M*m),$=D*p+z*A+x*m-(F*A+w*m+L*p),ee=F*v+P*m+b*p-(U*p+z*v+C*m),te=n*B+a*G+i*q+o*V;if(Math.abs(te)<u.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return te=1/te,r[0]=B*te,r[1]=G*te,r[2]=q*te,r[3]=V*te,r[4]=W*te,r[5]=X*te,r[6]=H*te,r[7]=Y*te,r[8]=k*te,r[9]=j*te,r[10]=Z*te,r[11]=K*te,r[12]=J*te,r[13]=Q*te,r[14]=$*te,r[15]=ee*te,r},l.inverseTransformation=function(e,t){var r=e[0],n=e[1],a=e[2],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],f=e[12],d=e[13],h=e[14],E=-r*f-n*d-a*h,m=-i*f-o*d-u*h,p=-s*f-c*d-l*h;return t[0]=r,t[1]=i,t[2]=s,t[3]=0,t[4]=n,t[5]=o,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=l,t[11]=0,t[12]=E,t[13]=m,t[14]=p,t[15]=1,t},l.IDENTITY=o(new l(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),l.ZERO=o(new l(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN0ROW3=3,l.COLUMN1ROW0=4,l.COLUMN1ROW1=5,l.COLUMN1ROW2=6,l.COLUMN1ROW3=7,l.COLUMN2ROW0=8,l.COLUMN2ROW1=9,l.COLUMN2ROW2=10,l.COLUMN2ROW3=11,l.COLUMN3ROW0=12,l.COLUMN3ROW1=13,l.COLUMN3ROW2=14,l.COLUMN3ROW3=15,a(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]&&e[9]===t[r+9]&&e[10]===t[r+10]&&e[11]===t[r+11]&&e[12]===t[r+12]&&e[13]===t[r+13]&&e[14]===t[r+14]&&e[15]===t[r+15]},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.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]+")"},l}),define("Core/Rectangle",["./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,r,n,a,i,o,u){"use strict";function s(e,r,n,a){this.west=t(e,0),this.south=t(r,0),this.east=t(n,0),this.north=t(a,0)}n(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,r,n){return n=t(n,0),r[n++]=e.west,r[n++]=e.south,r[n++]=e.east,r[n]=e.north,r},s.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new s),a.west=e[n++],a.south=e[n++],a.east=e[n++],a.north=e[n],a},s.computeWidth=function(e){var t=e.east,r=e.west;return t<r&&(t+=u.TWO_PI),t-r},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,n,a,i,o){return e=u.toRadians(t(e,0)),n=u.toRadians(t(n,0)),a=u.toRadians(t(a,0)),i=u.toRadians(t(i,0)),r(o)?(o.west=e,o.south=n,o.east=a,o.north=i,o):new s(e,n,a,i)},s.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE,f=0,d=e.length;f<d;f++){var h=e[f];n=Math.min(n,h.longitude),a=Math.max(a,h.longitude),c=Math.min(c,h.latitude),l=Math.max(l,h.latitude);var E=h.longitude>=0?h.longitude:h.longitude+u.TWO_PI;i=Math.min(i,E),o=Math.max(o,E)}return a-n>o-i&&(n=i,a=o,a>u.PI&&(a-=u.TWO_PI),n>u.PI&&(n-=u.TWO_PI)),r(t)?(t.west=n,t.south=c,t.east=a,t.north=l,t):new s(n,c,a,l)},s.fromCartesianArray=function(e,t,n){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=Number.MAX_VALUE,f=-Number.MAX_VALUE,d=0,h=e.length;d<h;d++){var E=t.cartesianToCartographic(e[d]);a=Math.min(a,E.longitude),i=Math.max(i,E.longitude),l=Math.min(l,E.latitude),f=Math.max(f,E.latitude);var m=E.longitude>=0?E.longitude:E.longitude+u.TWO_PI;o=Math.min(o,m),c=Math.max(c,m)}return i-a>c-o&&(a=o,i=c,i>u.PI&&(i-=u.TWO_PI),a>u.PI&&(a-=u.TWO_PI)),r(n)?(n.west=a,n.south=l,n.east=i,n.north=f,n):new s(a,l,i,f)},s.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.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},s.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},s.validate=function(e){},s.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)},s.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)},s.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)},s.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)},s.center=function(t,n){var a=t.east,i=t.west;a<i&&(a+=u.TWO_PI);var o=u.negativePiToPi(.5*(i+a)),s=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=s,n.height=0,n):new e(o,s)},s.intersection=function(e,t,n){var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.negativePiToPi(Math.max(i,c)),f=u.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&f<=l)){var d=Math.max(e.south,t.south),h=Math.min(e.north,t.north);if(!(d>=h))return r(n)?(n.west=l,n.south=d,n.east=f,n.north=h,n):new s(l,d,f,h)}},s.simpleIntersection=function(e,t,n){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(i>=u||a>=o))return r(n)?(n.west=a,n.south=i,n.east=o,n.north=u,n):new s(a,i,o,u)},s.union=function(e,t,n){r(n)||(n=new s);var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.convertLongitudeRange(Math.min(i,c)),f=u.convertLongitudeRange(Math.max(a,o));return n.west=l,n.south=Math.min(e.south,t.south),n.east=f,n.north=Math.max(e.north,t.north),n},s.expand=function(e,t,n){return r(n)||(n=new s),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},s.contains=function(e,t){var r=t.longitude,n=t.latitude,a=e.west,i=e.east;return i<a&&(i+=u.TWO_PI,r<0&&(r+=u.TWO_PI)),(r>a||u.equalsEpsilon(r,a,u.EPSILON14))&&(r<i||u.equalsEpsilon(r,i,u.EPSILON14))&&n>=e.south&&n<=e.north};var c=new e;return s.subsample=function(e,n,a,o){n=t(n,i.WGS84),a=t(a,0),r(o)||(o=[]);var l=0,f=e.north,d=e.south,h=e.east,E=e.west,m=c;m.height=a,m.longitude=E,m.latitude=f,o[l]=n.cartographicToCartesian(m,o[l]),l++,m.longitude=h,o[l]=n.cartographicToCartesian(m,o[l]),l++,m.latitude=d,o[l]=n.cartographicToCartesian(m,o[l]),l++,m.longitude=E,o[l]=n.cartographicToCartesian(m,o[l]),l++,f<0?m.latitude=f:d>0?m.latitude=d:m.latitude=0;for(var p=1;p<8;++p)m.longitude=-Math.PI+p*u.PI_OVER_TWO,s.contains(e,m)&&(o[l]=n.cartographicToCartesian(m,o[l]),l++);return 0===m.latitude&&(m.longitude=E,o[l]=n.cartographicToCartesian(m,o[l]),l++,m.longitude=h,o[l]=n.cartographicToCartesian(m,o[l]),l++),o.length=l,o},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,r,n,a,i,o,u,s,c,l,f){"use strict";function d(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var h=new e,E=new e,m=new e,p=new e,y=new e,_=new e,T=new e,R=new e,v=new e,A=new e,S=new e,N=new e;d.fromPoints=function(t,r){if(n(r)||(r=new d),!n(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;for(var a=e.clone(t[0],T),i=e.clone(a,h),o=e.clone(a,E),u=e.clone(a,m),s=e.clone(a,p),c=e.clone(a,y),l=e.clone(a,_),f=t.length,I=1;I<f;I++){e.clone(t[I],a);var g=a.x,O=a.y,M=a.z;g<i.x&&e.clone(a,i),g>s.x&&e.clone(a,s),O<o.y&&e.clone(a,o),O>c.y&&e.clone(a,c),M<u.z&&e.clone(a,u),M>l.z&&e.clone(a,l)}var w=e.magnitudeSquared(e.subtract(s,i,R)),x=e.magnitudeSquared(e.subtract(c,o,R)),P=e.magnitudeSquared(e.subtract(l,u,R)),C=i,D=s,L=w;x>L&&(L=x,C=o,D=c),P>L&&(L=P,C=u,D=l);var U=v;U.x=.5*(C.x+D.x),U.y=.5*(C.y+D.y),U.z=.5*(C.z+D.z);var b=e.magnitudeSquared(e.subtract(D,U,R)),F=Math.sqrt(b),z=A;z.x=i.x,z.y=o.y,z.z=u.z;var B=S;B.x=s.x,B.y=c.y,B.z=l.z;var G=e.multiplyByScalar(e.add(z,B,R),.5,N),q=0;for(I=0;I<f;I++){e.clone(t[I],a);var V=e.magnitude(e.subtract(a,G,R));V>q&&(q=V);var W=e.magnitudeSquared(e.subtract(a,U,R));if(W>b){var X=Math.sqrt(W);F=.5*(F+X),b=F*F;var H=X-F;U.x=(F*U.x+H*a.x)/X,U.y=(F*U.y+H*a.y)/X,U.z=(F*U.z+H*a.z)/X}}return F<q?(e.clone(U,r.center),r.radius=F):(e.clone(G,r.center),r.radius=q),r};var I=new o,g=new e,O=new e,M=new t,w=new t;d.fromRectangle2D=function(e,t,r){return d.fromRectangleWithHeights2D(e,t,0,0,r)},d.fromRectangleWithHeights2D=function(t,a,i,o,u){if(n(u)||(u=new d),!n(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;a=r(a,I),f.southwest(t,M),M.height=i,f.northeast(t,w),w.height=o;var s=a.project(M,g),c=a.project(w,O),l=c.x-s.x,h=c.y-s.y,E=c.z-s.z;u.radius=.5*Math.sqrt(l*l+h*h+E*E);var m=u.center;return m.x=s.x+.5*l,m.y=s.y+.5*h,m.z=s.z+.5*E,u};var x=[];d.fromRectangle3D=function(e,t,a,o){t=r(t,i.WGS84),a=r(a,0);var u;return n(e)&&(u=f.subsample(e,t,a,x)),d.fromPoints(u,o)},d.fromVertices=function(t,a,i,o){if(n(o)||(o=new d),!n(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;a=r(a,e.ZERO),i=r(i,3);var u=T;u.x=t[0]+a.x,u.y=t[1]+a.y,u.z=t[2]+a.z;for(var s=e.clone(u,h),c=e.clone(u,E),l=e.clone(u,m),f=e.clone(u,p),I=e.clone(u,y),g=e.clone(u,_),O=t.length,M=0;M<O;M+=i){var w=t[M]+a.x,x=t[M+1]+a.y,P=t[M+2]+a.z;u.x=w,u.y=x,u.z=P,w<s.x&&e.clone(u,s),w>f.x&&e.clone(u,f),x<c.y&&e.clone(u,c),x>I.y&&e.clone(u,I),P<l.z&&e.clone(u,l),P>g.z&&e.clone(u,g)}var C=e.magnitudeSquared(e.subtract(f,s,R)),D=e.magnitudeSquared(e.subtract(I,c,R)),L=e.magnitudeSquared(e.subtract(g,l,R)),U=s,b=f,F=C;D>F&&(F=D,U=c,b=I),L>F&&(F=L,U=l,b=g);var z=v;z.x=.5*(U.x+b.x),z.y=.5*(U.y+b.y),z.z=.5*(U.z+b.z);var B=e.magnitudeSquared(e.subtract(b,z,R)),G=Math.sqrt(B),q=A;q.x=s.x,q.y=c.y,q.z=l.z;var V=S;V.x=f.x,V.y=I.y,V.z=g.z;var W=e.multiplyByScalar(e.add(q,V,R),.5,N),X=0;for(M=0;M<O;M+=i){u.x=t[M]+a.x,u.y=t[M+1]+a.y,u.z=t[M+2]+a.z;var H=e.magnitude(e.subtract(u,W,R));H>X&&(X=H);var Y=e.magnitudeSquared(e.subtract(u,z,R));if(Y>B){var k=Math.sqrt(Y);G=.5*(G+k),B=G*G;var j=k-G;z.x=(G*z.x+j*u.x)/k,z.y=(G*z.y+j*u.y)/k,z.z=(G*z.z+j*u.z)/k}}return G<X?(e.clone(z,o.center),o.radius=G):(e.clone(W,o.center),o.radius=X),o},d.fromEncodedCartesianVertices=function(t,r,a){if(n(a)||(a=new d),!n(t)||!n(r)||t.length!==r.length||0===t.length)return a.center=e.clone(e.ZERO,a.center),a.radius=0,a;var i=T;i.x=t[0]+r[0],i.y=t[1]+r[1],i.z=t[2]+r[2];for(var o=e.clone(i,h),u=e.clone(i,E),s=e.clone(i,m),c=e.clone(i,p),l=e.clone(i,y),f=e.clone(i,_),I=t.length,g=0;g<I;g+=3){var O=t[g]+r[g],M=t[g+1]+r[g+1],w=t[g+2]+r[g+2];i.x=O,i.y=M,i.z=w,O<o.x&&e.clone(i,o),O>c.x&&e.clone(i,c),M<u.y&&e.clone(i,u),M>l.y&&e.clone(i,l),w<s.z&&e.clone(i,s),w>f.z&&e.clone(i,f)}var x=e.magnitudeSquared(e.subtract(c,o,R)),P=e.magnitudeSquared(e.subtract(l,u,R)),C=e.magnitudeSquared(e.subtract(f,s,R)),D=o,L=c,U=x;P>U&&(U=P,D=u,L=l),C>U&&(U=C,D=s,L=f);var b=v;b.x=.5*(D.x+L.x),b.y=.5*(D.y+L.y),b.z=.5*(D.z+L.z);var F=e.magnitudeSquared(e.subtract(L,b,R)),z=Math.sqrt(F),B=A;B.x=o.x,B.y=u.y,B.z=s.z;var G=S;G.x=c.x,G.y=l.y,G.z=f.z;var q=e.multiplyByScalar(e.add(B,G,R),.5,N),V=0;for(g=0;g<I;g+=3){i.x=t[g]+r[g],i.y=t[g+1]+r[g+1],i.z=t[g+2]+r[g+2];var W=e.magnitude(e.subtract(i,q,R));W>V&&(V=W);var X=e.magnitudeSquared(e.subtract(i,b,R));if(X>F){var H=Math.sqrt(X);z=.5*(z+H),F=z*z;var Y=H-z;b.x=(z*b.x+Y*i.x)/H,b.y=(z*b.y+Y*i.y)/H,b.z=(z*b.z+Y*i.z)/H}}return z<V?(e.clone(b,a.center),a.radius=z):(e.clone(q,a.center),a.radius=V),a},d.fromCornerPoints=function(t,r,a){n(a)||(a=new d);var i=a.center;return e.add(t,r,i),e.multiplyByScalar(i,.5,i),a.radius=e.distance(i,r),a},d.fromEllipsoid=function(t,r){return n(r)||(r=new d),e.clone(e.ZERO,r.center),r.radius=t.maximumRadius,r};var P=new e;d.fromBoundingSpheres=function(t,r){if(n(r)||(r=new d),!n(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var a=t.length;if(1===a)return d.clone(t[0],r);if(2===a)return d.union(t[0],t[1],r);for(var i=[],o=0;o<a;o++)i.push(t[o].center);r=d.fromPoints(i,r);var u=r.center,s=r.radius;for(o=0;o<a;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,P)+c.radius)}return r.radius=s,r};var C=new e,D=new e,L=new e;d.fromOrientedBoundingBox=function(t,r){n(r)||(r=new d);var a=t.halfAxes,i=c.getColumn(a,0,C),o=c.getColumn(a,1,D),u=c.getColumn(a,2,L),s=e.magnitude(i),l=e.magnitude(o),f=e.magnitude(u);return r.center=e.clone(t.center,r.center),r.radius=Math.max(s,l,f),r},d.clone=function(t,r){if(n(t))return n(r)?(r.center=e.clone(t.center,r.center),r.radius=t.radius,r):new d(t.center,t.radius)},d.packedLength=4,d.pack=function(e,t,n){n=r(n,0);var a=e.center;return t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n]=e.radius,t},d.unpack=function(e,t,a){t=r(t,0),n(a)||(a=new d);var i=a.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],a.radius=e[t],a};var U=new e,b=new e;d.union=function(t,r,a){n(a)||(a=new d);var i=t.center,o=t.radius,u=r.center,s=r.radius,c=e.subtract(u,i,U),l=e.magnitude(c);if(o>=l+s)return t.clone(a),a;if(s>=l+o)return r.clone(a),a;var f=.5*(o+l+s),h=e.multiplyByScalar(c,(-o+f)/l,b);return e.add(h,i,h),e.clone(h,a.center),a.radius=f,a};var F=new e;d.expand=function(t,r,n){n=d.clone(t,n);var a=e.magnitude(e.subtract(r,n.center,F));return a>n.radius&&(n.radius=a),n},d.intersectPlane=function(t,r){var n=t.center,a=t.radius,i=r.normal,o=e.dot(i,n)+r.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},d.transform=function(e,t,r){return n(r)||(r=new d),r.center=l.multiplyByPoint(t,e.center,r.center),r.radius=l.getMaximumScale(t)*e.radius,r};var z=new e;d.distanceSquaredTo=function(t,r){var n=e.subtract(t.center,r,z);return e.magnitudeSquared(n)-t.radius*t.radius},d.transformWithoutScale=function(e,t,r){return n(r)||(r=new d),r.center=l.multiplyByPoint(t,e.center,r.center),r.radius=e.radius,r};var B=new e;d.computePlaneDistances=function(t,r,a,i){n(i)||(i=new s);var o=e.subtract(t.center,r,B),u=e.dot(a,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var G=new e,q=new e,V=new e,W=new e,X=new e,H=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var j=new o;return d.projectTo2D=function(t,n,a){n=r(n,j);var i=n.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,G),c=e.cross(e.UNIT_Z,s,q);e.normalize(c,c);var l=e.cross(s,c,V);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var f=e.negate(l,X),h=e.negate(c,W),E=Y,m=E[0];e.add(s,l,m),e.add(m,c,m),m=E[1],e.add(s,l,m),e.add(m,h,m),m=E[2],e.add(s,f,m),e.add(m,h,m),m=E[3],e.add(s,f,m),e.add(m,c,m),e.negate(s,s),m=E[4],e.add(s,l,m),e.add(m,c,m),m=E[5],e.add(s,l,m),e.add(m,h,m),m=E[6],e.add(s,f,m),e.add(m,h,m),m=E[7],e.add(s,f,m),e.add(m,c,m);for(var p=E.length,y=0;y<p;++y){var _=E[y];e.add(o,_,_);var T=i.cartesianToCartographic(_,H);n.project(T,_)}a=d.fromPoints(E,a),o=a.center;var R=o.x,v=o.y,A=o.z;return o.x=A,o.y=R,o.z=v,a},d.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},d.equals=function(t,r){return t===r||n(t)&&n(r)&&e.equals(t.center,r.center)&&t.radius===r.radius},d.prototype.intersectPlane=function(e){return d.intersectPlane(this,e)},d.prototype.distanceSquaredTo=function(e){return d.distanceSquaredTo(this,e)},d.prototype.computePlaneDistances=function(e,t,r){return d.computePlaneDistances(this,e,t,r)},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/Cartesian2",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a){"use strict";function i(t,r){this.x=e(t,0),this.y=e(r,0)}i.fromElements=function(e,r,n){return t(n)?(n.x=e,n.y=r,n):new i(e,r)},i.clone=function(e,r){if(t(e))return t(r)?(r.x=e.x,r.y=e.y,r):new i(e.x,e.y)},i.fromCartesian3=i.clone,i.fromCartesian4=i.clone,i.packedLength=2,i.pack=function(t,r,n){return n=e(n,0),r[n++]=t.x,r[n]=t.y,r},i.unpack=function(r,n,a){return n=e(n,0),t(a)||(a=new i),a.x=r[n++],a.y=r[n],a},i.packArray=function(e,r){var n=e.length;t(r)?r.length=2*n:r=new Array(2*n);for(var a=0;a<n;++a)i.pack(e[a],r,2*a);return r},i.unpackArray=function(e,r){var n=e.length;t(r)?r.length=n/2:r=new Array(n/2);for(var a=0;a<n;a+=2){var o=a/2;r[o]=i.unpack(e,a,r[o])}return r},i.fromArray=i.unpack,i.maximumComponent=function(e){return Math.max(e.x,e.y)},i.minimumComponent=function(e){return Math.min(e.x,e.y)},i.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r},i.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r},i.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},i.magnitude=function(e){return Math.sqrt(i.magnitudeSquared(e))};var o=new i;i.distance=function(e,t){return i.subtract(e,t,o),i.magnitude(o)},i.distanceSquared=function(e,t){return i.subtract(e,t,o),i.magnitudeSquared(o)},i.normalize=function(e,t){var r=i.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t},i.dot=function(e,t){return e.x*t.x+e.y*t.y},i.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r},i.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r},i.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r},i.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r},i.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r},i.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r},i.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},i.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var u=new i;i.lerp=function(e,t,r,n){return i.multiplyByScalar(t,r,u),n=i.multiplyByScalar(e,1-r,n),i.add(u,n,n)};var s=new i,c=new i;i.angleBetween=function(e,t){return i.normalize(e,s),i.normalize(t,c),a.acosClamped(i.dot(s,c))};var l=new i;return i.mostOrthogonalAxis=function(e,t){var r=i.normalize(e,l);return i.abs(r,r),t=r.x<=r.y?i.clone(i.UNIT_X,t):i.clone(i.UNIT_Y,t)},i.equals=function(e,r){return e===r||t(e)&&t(r)&&e.x===r.x&&e.y===r.y},i.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]},i.equalsEpsilon=function(e,r,n,i){return e===r||t(e)&&t(r)&&a.equalsEpsilon(e.x,r.x,n,i)&&a.equalsEpsilon(e.y,r.y,n,i)},i.ZERO=n(new i(0,0)),i.UNIT_X=n(new i(1,0)),i.UNIT_Y=n(new i(0,1)),i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i.prototype.equalsEpsilon=function(e,t,r){return i.equalsEpsilon(this,e,t,r)},i.prototype.toString=function(){return"("+this.x+", "+this.y+")"},i}),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},a={};return t(a,{element:{get:function(){if(a.supportsFullscreen())return document[n.fullscreenElement]}},changeEventName:{get:function(){if(a.supportsFullscreen())return n.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return n.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[n.fullscreenEnabled]; -}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.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 a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(n.requestFullscreen=a,r=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(n.requestFullscreen=a,r=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?n.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(n.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?n.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(n.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?n.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(n.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),n.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),n.fullscreenerror=a)}return r},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[n.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[n.exitFullscreen]()},a}),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;r<n;++r)t[r]=parseInt(t[r],10);return t}function a(){if(!t(v)&&(v=!1,!d())){var e=/ Chrome\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(v=!0,A=n(e[1]))}return v}function i(){return a()&&A}function o(){if(!t(S)&&(S=!1,!a()&&!d()&&/ Safari\/[\.0-9]+/.test(R.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(S=!0,N=n(e[1]))}return S}function u(){return o()&&N}function s(){if(!t(I)){I=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(R.userAgent);null!==e&&(I=!0,g=n(e[1]),g.isNightly=!!e[2])}return I}function c(){return s()&&g}function l(){if(!t(O)){O=!1;var e;"Microsoft Internet Explorer"===R.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(O=!0,M=n(e[1]))):"Netscape"===R.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(O=!0,M=n(e[1])))}return O}function f(){return l()&&M}function d(){if(!t(w)){w=!1;var e=/ Edge\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(w=!0,x=n(e[1]))}return w}function h(){return d()&&x}function E(){if(!t(P)){P=!1;var e=/Firefox\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(P=!0,C=n(e[1]))}return P}function m(){return t(D)||(D=/Windows/i.test(R.appVersion)),D}function p(){return E()&&C}function y(){return t(L)||(L="undefined"!=typeof PointerEvent&&(!t(R.pointerEnabled)||R.pointerEnabled)),L}function _(){if(!t(b)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var r=e.style.imageRendering;b=t(r)&&""!==r,b&&(U=r)}return b}function T(){return _()?U:void 0}var R;R="undefined"!=typeof navigator?navigator:{};var v,A,S,N,I,g,O,M,w,x,P,C,D,L,U,b,F={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isEdge:d,edgeVersion:h,isFirefox:E,firefoxVersion:p,isWindows:m,hardwareConcurrency:e(R.hardwareConcurrency,3),supportsPointerEvents:y,supportsImageRenderingPixelated:_,imageRenderingValue:T};return F.supportsFullscreen=function(){return r.supportsFullscreen()},F.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},F.supportsWebWorkers=function(){return"undefined"!=typeof Worker},F}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,r,n,a,i){"use strict";if(!n.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){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.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},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 Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,r,n,a){switch(n=e(n,0),a=e(a,(r.byteLength-n)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(r,n,a);case o.UNSIGNED_BYTE:return new Uint8Array(r,n,a);case o.SHORT:return new Int16Array(r,n,a);case o.UNSIGNED_SHORT:return new Uint16Array(r,n,a);case o.INT:return new Int32Array(r,n,a);case o.UNSIGNED_INT:return new Uint32Array(r,n,a);case o.FLOAT:return new Float32Array(r,n,a);case o.DOUBLE:return new Float64Array(r,n,a)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/Quaternion",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math","./Matrix3"],function(e,t,r,n,a,i,o,u){"use strict";function s(e,r,n,a){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0),this.w=t(a,0)}var c=new e;s.fromAxisAngle=function(t,n,a){var i=n/2,o=Math.sin(i);c=e.normalize(t,c);var u=c.x*o,l=c.y*o,f=c.z*o,d=Math.cos(i);return r(a)?(a.x=u,a.y=l,a.z=f,a.w=d,a):new s(u,l,f,d)};var l=[1,2,0],f=new Array(3);s.fromRotationMatrix=function(e,t){var n,a,i,o,c,d=e[u.COLUMN0ROW0],h=e[u.COLUMN1ROW1],E=e[u.COLUMN2ROW2],m=d+h+E;if(m>0)n=Math.sqrt(m+1),c=.5*n,n=.5/n,a=(e[u.COLUMN1ROW2]-e[u.COLUMN2ROW1])*n,i=(e[u.COLUMN2ROW0]-e[u.COLUMN0ROW2])*n,o=(e[u.COLUMN0ROW1]-e[u.COLUMN1ROW0])*n;else{var p=l,y=0;h>d&&(y=1),E>d&&E>h&&(y=2);var _=p[y],T=p[_];n=Math.sqrt(e[u.getElementIndex(y,y)]-e[u.getElementIndex(_,_)]-e[u.getElementIndex(T,T)]+1);var R=f;R[y]=.5*n,n=.5/n,c=(e[u.getElementIndex(T,_)]-e[u.getElementIndex(_,T)])*n,R[_]=(e[u.getElementIndex(_,y)]+e[u.getElementIndex(y,_)])*n,R[T]=(e[u.getElementIndex(T,y)]+e[u.getElementIndex(y,T)])*n,a=-R[0],i=-R[1],o=-R[2]}return r(t)?(t.x=a,t.y=i,t.z=o,t.w=c,t):new s(a,i,o,c)};var d=new s;s.fromHeadingPitchRoll=function(t,r,n,a){var i=s.fromAxisAngle(e.UNIT_X,n,d),o=s.fromAxisAngle(e.UNIT_Y,-r,a);a=s.multiply(o,i,o);var u=s.fromAxisAngle(e.UNIT_Z,-t,d);return s.multiply(u,a,a)};var h=new e,E=new e,m=new s,p=new s,y=new s;s.packedLength=4,s.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n++]=e.z,r[n]=e.w,r},s.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new s),a.x=e[n],a.y=e[n+1],a.z=e[n+2],a.w=e[n+3],a},s.packedInterpolationLength=3,s.convertPackedArrayForInterpolation=function(e,t,r,n){s.unpack(e,4*r,y),s.conjugate(y,y);for(var a=0,i=r-t+1;a<i;a++){var o=3*a;s.unpack(e,4*(t+a),m),s.multiply(m,y,m),m.w<0&&s.negate(m,m),s.computeAxis(m,h);var u=s.computeAngle(m);n[o]=h.x*u,n[o+1]=h.y*u,n[o+2]=h.z*u}},s.unpackInterpolationResult=function(t,n,a,i,o){r(o)||(o=new s),e.fromArray(t,0,E);var u=e.magnitude(E);return s.unpack(n,4*i,p),0===u?s.clone(s.IDENTITY,m):s.fromAxisAngle(E,u,m),s.multiply(m,p,o)},s.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new s(e.x,e.y,e.z,e.w)},s.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},s.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},s.magnitude=function(e){return Math.sqrt(s.magnitudeSquared(e))},s.normalize=function(e,t){var r=1/s.magnitude(e),n=e.x*r,a=e.y*r,i=e.z*r,o=e.w*r;return t.x=n,t.y=a,t.z=i,t.w=o,t},s.inverse=function(e,t){var r=s.magnitudeSquared(e);return t=s.conjugate(e,t),s.multiplyByScalar(t,1/r,t)},s.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},s.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},s.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},s.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},s.multiply=function(e,t,r){var n=e.x,a=e.y,i=e.z,o=e.w,u=t.x,s=t.y,c=t.z,l=t.w,f=o*u+n*l+a*c-i*s,d=o*s-n*c+a*l+i*u,h=o*c+n*s-a*u+i*l,E=o*l-n*u-a*s-i*c;return r.x=f,r.y=d,r.z=h,r.w=E,r},s.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},s.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},s.computeAxis=function(e,t){var r=e.w;if(Math.abs(r-1)<o.EPSILON6)return t.x=t.y=t.z=0,t;var n=1/Math.sqrt(1-r*r);return t.x=e.x*n,t.y=e.y*n,t.z=e.z*n,t},s.computeAngle=function(e){return Math.abs(e.w-1)<o.EPSILON6?0:2*Math.acos(e.w)};var _=new s;s.lerp=function(e,t,r,n){return _=s.multiplyByScalar(t,r,_),n=s.multiplyByScalar(e,1-r,n),s.add(_,n,n)};var T=new s,R=new s,v=new s;s.slerp=function(e,t,r,n){var a=s.dot(e,t),i=t;if(a<0&&(a=-a,i=T=s.negate(t,T)),1-a<o.EPSILON6)return s.lerp(e,i,r,n);var u=Math.acos(a);return R=s.multiplyByScalar(e,Math.sin((1-r)*u),R),v=s.multiplyByScalar(i,Math.sin(r*u),v),n=s.add(R,v,n),s.multiplyByScalar(n,1/Math.sin(u),n)},s.log=function(t,r){var n=o.acosClamped(t.w),a=0;return 0!==n&&(a=n/Math.sin(n)),e.multiplyByScalar(t,a,r)},s.exp=function(t,r){var n=e.magnitude(t),a=0;return 0!==n&&(a=Math.sin(n)/n),r.x=t.x*a,r.y=t.y*a,r.z=t.z*a,r.w=Math.cos(n),r};var A=new e,S=new e,N=new s,I=new s;s.computeInnerQuadrangle=function(t,r,n,a){var i=s.conjugate(r,N);s.multiply(i,n,I);var o=s.log(I,A);s.multiply(i,t,I);var u=s.log(I,S);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),s.exp(o,N),s.multiply(r,N,a)},s.squad=function(e,t,r,n,a,i){var o=s.slerp(e,t,a,N),u=s.slerp(r,n,a,I);return s.slerp(o,u,2*a*(1-a),i)};for(var g=new s,O=1.9011074535173003,M=a.supportsTypedArrays()?new Float32Array(8):[],w=a.supportsTypedArrays()?new Float32Array(8):[],x=a.supportsTypedArrays()?new Float32Array(8):[],P=a.supportsTypedArrays()?new Float32Array(8):[],C=0;C<7;++C){var D=C+1,L=2*D+1;M[C]=1/(D*L),w[C]=D/L}return M[7]=O/136,w[7]=8*O/17,s.fastSlerp=function(e,t,r,n){var a,i=s.dot(e,t);i>=0?a=1:(a=-1,i=-i);for(var o=i-1,u=1-r,c=r*r,l=u*u,f=7;f>=0;--f)x[f]=(M[f]*c-w[f])*o,P[f]=(M[f]*l-w[f])*o;var d=a*r*(1+x[0]*(1+x[1]*(1+x[2]*(1+x[3]*(1+x[4]*(1+x[5]*(1+x[6]*(1+x[7])))))))),h=u*(1+P[0]*(1+P[1]*(1+P[2]*(1+P[3]*(1+P[4]*(1+P[5]*(1+P[6]*(1+P[7])))))))),E=s.multiplyByScalar(e,h,g);return s.multiplyByScalar(t,d,n),s.add(E,n,n)},s.fastSquad=function(e,t,r,n,a,i){var o=s.fastSlerp(e,t,a,N),u=s.fastSlerp(r,n,a,I);return s.fastSlerp(o,u,2*a*(1-a),i)},s.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},s.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n},s.ZERO=i(new s(0,0,0,0)),s.IDENTITY=i(new s(0,0,0,1)),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.x+", "+this.y+", "+this.z+", "+this.w+")"},s}),define("Core/EllipseGeometryLibrary",["./Cartesian3","./Math","./Matrix3","./Quaternion"],function(e,t,r,n){"use strict";function a(t,a,i,l,f,d,h,E,m,p){var y=t+a;e.multiplyByScalar(l,Math.cos(y),o),e.multiplyByScalar(i,Math.sin(y),u),e.add(o,u,o);var _=Math.cos(t);_*=_;var T=Math.sin(t);T*=T;var R=d/Math.sqrt(h*_+f*T),v=R/E;return n.fromAxisAngle(o,v,s),r.fromQuaternion(s,c),r.multiplyByVector(c,m,p),e.normalize(p,p),e.multiplyByScalar(p,E,p),p}var i={},o=new e,u=new e,s=new n,c=new r,l=new e,f=new e,d=new e,h=new e;i.raisePositionsToHeight=function(t,r,n){for(var a=r.ellipsoid,i=r.height,o=r.extrudedHeight,u=n?t.length/3*2:t.length/3,s=new Float64Array(3*u),c=t.length,E=n?c:0,m=0;m<c;m+=3){var p=m+1,y=m+2,_=e.fromArray(t,m,l);a.scaleToGeodeticSurface(_,_);var T=e.clone(_,f),R=a.geodeticSurfaceNormal(_,h),v=e.multiplyByScalar(R,i,d);e.add(_,v,_),n&&(e.multiplyByScalar(R,o,v),e.add(T,v,T),s[m+E]=T.x,s[p+E]=T.y,s[y+E]=T.z),s[m]=_.x,s[p]=_.y,s[y]=_.z}return s};var E=new e,m=new e,p=new e;return i.computeEllipsePositions=function(r,n,i){var o=r.semiMinorAxis,u=r.semiMajorAxis,s=r.rotation,c=r.center,h=8*r.granularity,y=o*o,_=u*u,T=u*o,R=e.magnitude(c),v=e.normalize(c,E),A=e.cross(e.UNIT_Z,c,m);A=e.normalize(A,A);var S=e.cross(v,A,p),N=1+Math.ceil(t.PI_OVER_TWO/h),I=t.PI_OVER_TWO/(N-1),g=t.PI_OVER_TWO-N*I;g<0&&(N-=Math.ceil(Math.abs(g)/I));var O,M,w,x,P,C=2*(N*(N+2)),D=n?new Array(3*C):void 0,L=0,U=l,b=f,F=4*N*3,z=F-1,B=0,G=i?new Array(F):void 0;for(g=t.PI_OVER_TWO,U=a(g,s,S,A,y,T,_,R,v,U),n&&(D[L++]=U.x,D[L++]=U.y,D[L++]=U.z),i&&(G[z--]=U.z,G[z--]=U.y,G[z--]=U.x),g=t.PI_OVER_TWO-I,O=1;O<N+1;++O){if(U=a(g,s,S,A,y,T,_,R,v,U),b=a(Math.PI-g,s,S,A,y,T,_,R,v,b),n){for(D[L++]=U.x,D[L++]=U.y,D[L++]=U.z,w=2*O+2,M=1;M<w-1;++M)x=M/(w-1),P=e.lerp(U,b,x,d),D[L++]=P.x,D[L++]=P.y,D[L++]=P.z;D[L++]=b.x,D[L++]=b.y,D[L++]=b.z}i&&(G[z--]=U.z,G[z--]=U.y,G[z--]=U.x,G[B++]=b.x,G[B++]=b.y,G[B++]=b.z),g=t.PI_OVER_TWO-(O+1)*I}for(O=N;O>1;--O){if(g=t.PI_OVER_TWO-(O-1)*I,U=a(-g,s,S,A,y,T,_,R,v,U),b=a(g+Math.PI,s,S,A,y,T,_,R,v,b),n){for(D[L++]=U.x,D[L++]=U.y,D[L++]=U.z,w=2*(O-1)+2,M=1;M<w-1;++M)x=M/(w-1),P=e.lerp(U,b,x,d),D[L++]=P.x,D[L++]=P.y,D[L++]=P.z;D[L++]=b.x,D[L++]=b.y,D[L++]=b.z}i&&(G[z--]=U.z,G[z--]=U.y,G[z--]=U.x,G[B++]=b.x,G[B++]=b.y,G[B++]=b.z)}g=t.PI_OVER_TWO,U=a(-g,s,S,A,y,T,_,R,v,U);var q={};return n&&(D[L++]=U.x,D[L++]=U.y,D[L++]=U.z,q.positions=D,q.numPts=N),i&&(G[z--]=U.z,G[z--]=U.y,G[z--]=U.x,q.outerPositions=G),q},i}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var r={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,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,t,r,n,a){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,a.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,n.NONE),this.boundingSphereCV=t.boundingSphereCV}return i.computeNumberOfVertices=function(e){var r=-1;for(var n in e.attributes)if(e.attributes.hasOwnProperty(n)&&t(e.attributes[n])&&t(e.attributes[n].values)){var a=e.attributes[n],i=a.values.length/a.componentsPerAttribute;r=i}return r},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(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 n}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.binormal=t.binormal,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/GeometryInstance",["./defaultValue","./defined","./DeveloperError","./Matrix4"],function(e,t,r,n){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.geometry=t.geometry,this.modelMatrix=n.clone(e(t.modelMatrix,n.IDENTITY)),this.id=t.id,this.pickPrimitive=t.pickPrimitive,this.attributes=e(t.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}return a}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,r,n,a){"use strict";var i={};i.octEncodeInRange=function(e,t,r){if(r.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),r.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var n=r.x,i=r.y;r.x=(1-Math.abs(i))*a.signNotZero(n),r.y=(1-Math.abs(n))*a.signNotZero(i)}return r.x=a.toSNorm(r.x,t),r.y=a.toSNorm(r.y,t),r},i.octEncode=function(e,t){return i.octEncodeInRange(e,255,t)},i.octDecodeInRange=function(e,r,n,i){if(i.x=a.fromSNorm(e,n),i.y=a.fromSNorm(r,n),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){var o=i.x;i.x=(1-Math.abs(i.y))*a.signNotZero(o),i.y=(1-Math.abs(o))*a.signNotZero(i.y)}return t.normalize(i,i)},i.octDecode=function(e,t,r){return i.octDecodeInRange(e,t,255,r)},i.octPackFloat=function(e){return 256*e.x+e.y};var o=new e;return i.octEncodeFloat=function(e){return i.octEncode(e,o),i.octPackFloat(o)},i.octDecodeFloat=function(e,t){var r=e/256,n=Math.floor(r),a=256*(r-n);return i.octDecode(n,a,t)},i.octPack=function(e,t,r,n){var a=i.octEncodeFloat(e),u=i.octEncodeFloat(t),s=i.octEncode(r,o);return n.x=65536*s.x+a,n.y=65536*s.y+u,n},i.octUnpack=function(e,t,r,n){var a=e.x/65536,o=Math.floor(a),u=65536*(a-o);a=e.y/65536;var s=Math.floor(a),c=65536*(a-s);i.octDecodeFloat(u,t),i.octDecodeFloat(c,r),i.octDecode(o,s,n)},i.compressTextureCoordinates=function(e){var t=4095*e.x|0,r=4095*e.y|0;return 4096*t+r},i.decompressTextureCoordinates=function(e,t){var r=e/4096,n=Math.floor(r);return t.x=n/4095,t.y=(e-4096*n)/4095,t},i}),define("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function a(n,a,s,c,l){r(l)||(l=new t);var f,d,h,E,m,p,y,_;r(a.z)?(f=t.subtract(s,a,i),d=t.subtract(c,a,o),h=t.subtract(n,a,u),E=t.dot(f,f),m=t.dot(f,d),p=t.dot(f,h),y=t.dot(d,d),_=t.dot(d,h)):(f=e.subtract(s,a,i),d=e.subtract(c,a,o),h=e.subtract(n,a,u),E=e.dot(f,f),m=e.dot(f,d),p=e.dot(f,h),y=e.dot(d,d),_=e.dot(d,h));var T=1/(E*y-m*m);return l.y=(y*p-m*_)*T,l.z=(E*_-m*p)*T,l.x=1-l.y-l.z,l}var i=new t,o=new t,u=new t; -return a}),define("Core/EncodedCartesian3",["./Cartesian3","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(){this.high=e.clone(e.ZERO),this.low=e.clone(e.ZERO)}n.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 a={high:0,low:0};n.fromCartesian=function(e,r){t(r)||(r=new n);var i=r.high,o=r.low;return n.encode(e.x,a),i.x=a.high,o.x=a.low,n.encode(e.y,a),i.y=a.high,o.y=a.low,n.encode(e.z,a),i.z=a.high,o.z=a.low,r};var i=new n;return n.writeElements=function(e,t,r){n.fromCartesian(e,i);var a=i.high,o=i.low;t[r]=a.x,t[r+1]=a.y,t[r+2]=a.z,t[r+3]=o.x,t[r+4]=o.y,t[r+5]=o.z},n}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,r,n,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(e){switch(e){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(t){return e(t)&&(t===i.UNSIGNED_BYTE||t===i.UNSIGNED_SHORT||t===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,r,a){return e>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,r,a):new Uint16Array(t,r,a)},r(i)}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function r(e,r,n){var a=e+r;return t.sign(e)!==t.sign(r)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(r)))<n?0:a}var n={};return n.computeDiscriminant=function(e,t,r){var n=t*t-4*e*r;return n},n.computeRealRoots=function(e,n,a){var i;if(0===e)return 0===n?[]:[-a/n];if(0===n){if(0===a)return[0,0];var o=Math.abs(a),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,i<0)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-n/e,i<0?[i,0]:[0,i];var c=n*n,l=4*e*a,f=r(c,-l,t.EPSILON14);if(f<0)return[];var d=-.5*r(n,t.sign(n)*Math.sqrt(f),t.EPSILON14);return n>0?[d/e,a/d]:[a/d,d/e]},n}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function r(e,t,r,n){var a,i,o=e,u=t/3,s=r/3,c=n,l=o*s,f=u*c,d=u*u,h=s*s,E=o*s-d,m=o*c-u*s,p=u*c-h,y=4*E*p-m*m;if(y<0){var _,T,R;d*f>=l*h?(_=o,T=E,R=-2*u*E+o*m):(_=c,T=p,R=-c*m+2*s*p);var v=R<0?-1:1,A=-v*Math.abs(_)*Math.sqrt(-y);i=-R+A;var S=i/2,N=S<0?-Math.pow(-S,1/3):Math.pow(S,1/3),I=i===A?-N:-T/N;return a=T<=0?N+I:-R/(N*N+I*I+T),d*f>=l*h?[(a-u)/o]:[-c/(a+s)]}var g=E,O=-2*u*E+o*m,M=p,w=-c*m+2*s*p,x=Math.sqrt(y),P=Math.sqrt(3)/2,C=Math.abs(Math.atan2(o*x,-O)/3);a=2*Math.sqrt(-g);var D=Math.cos(C);i=a*D;var L=a*(-D/2-P*Math.sin(C)),U=i+L>2*u?i-u:L-u,b=o,F=U/b;C=Math.abs(Math.atan2(c*x,-w)/3),a=2*Math.sqrt(-M),D=Math.cos(C),i=a*D,L=a*(-D/2-P*Math.sin(C));var z=-c,B=i+L<2*s?i+s:L+s,G=z/B,q=b*B,V=-U*B-b*z,W=U*z,X=(s*V-u*W)/(-u*V+s*q);return F<=X?F<=G?X<=G?[F,X,G]:[F,G,X]:[G,F,X]:F<=G?[X,F,G]:X<=G?[X,G,F]:[G,X,F]}var n={};return n.computeDiscriminant=function(e,t,r,n){var a=e*e,i=t*t,o=r*r,u=n*n,s=18*e*t*r*n+i*o-27*a*u-4*(e*o*r+i*t*n);return s},n.computeRealRoots=function(e,n,a,i){var o,u;if(0===e)return t.computeRealRoots(n,a,i);if(0===n){if(0===a){if(0===i)return[0,0,0];u=-i/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===i?(o=t.computeRealRoots(e,0,a),0===o.Length?[0]:[o[0],0,o[1]]):r(e,0,a,i)}return 0===a?0===i?(u=-n/e,u<0?[u,0,0]:[0,0,u]):r(e,n,0,i):0===i?(o=t.computeRealRoots(e,n,a),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):r(e,n,a,i)},n}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,r,n){"use strict";function a(t,a,i,o){var u=t*t,s=a-3*u/8,c=i-a*t/2+u*t/8,l=o-i*t/4+a*u/16-3*u*u/256,f=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(f.length>0){var d=-t/4,h=f[f.length-1];if(Math.abs(h)<r.EPSILON14){var E=n.computeRealRoots(1,s,l);if(2===E.length){var m,p=E[0],y=E[1];if(p>=0&&y>=0){var _=Math.sqrt(p),T=Math.sqrt(y);return[d-T,d-_,d+_,d+T]}if(p>=0&&y<0)return m=Math.sqrt(p),[d-m,d+m];if(p<0&&y>=0)return m=Math.sqrt(y),[d-m,d+m]}return[]}if(h>0){var R=Math.sqrt(h),v=(s+h-c/R)/2,A=(s+h+c/R)/2,S=n.computeRealRoots(1,R,v),N=n.computeRealRoots(1,-R,A);return 0!==S.length?(S[0]+=d,S[1]+=d,0!==N.length?(N[0]+=d,N[1]+=d,S[1]<=N[0]?[S[0],S[1],N[0],N[1]]:N[1]<=S[0]?[N[0],N[1],S[0],S[1]]:S[0]>=N[0]&&S[1]<=N[1]?[N[0],S[0],S[1],N[1]]:N[0]>=S[0]&&N[1]<=S[1]?[S[0],N[0],N[1],S[1]]:S[0]>N[0]&&S[0]<N[1]?[N[0],S[0],N[1],S[1]]:[S[0],N[0],S[1],N[1]]):S):0!==N.length?(N[0]+=d,N[1]+=d,N):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,f=i*t+s-4*o,d=c*o-i*a*t+u,h=e.computeRealRoots(1,l,f,d);if(h.length>0){var E,m,p=h[0],y=a-p,_=y*y,T=t/2,R=y/2,v=_-4*o,A=_+4*Math.abs(o),S=c-4*p,N=c+4*Math.abs(p);if(p<0||v*N<S*A){var I=Math.sqrt(S);E=I/2,m=0===I?0:(t*R-i)/I}else{var g=Math.sqrt(v);E=0===g?0:(t*R-i)/g,m=g/2}var O,M;0===T&&0===E?(O=0,M=0):r.sign(T)===r.sign(E)?(O=T+E,M=p/O):(M=T-E,O=p/M);var w,x;0===R&&0===m?(w=0,x=0):r.sign(R)===r.sign(m)?(w=R+m,x=o/w):(x=R-m,w=o/x);var P=n.computeRealRoots(1,O,w),C=n.computeRealRoots(1,M,x);if(0!==P.length)return 0!==C.length?P[1]<=C[0]?[P[0],P[1],C[0],C[1]]:C[1]<=P[0]?[C[0],C[1],P[0],P[1]]:P[0]>=C[0]&&P[1]<=C[1]?[C[0],P[0],P[1],C[1]]:C[0]>=P[0]&&C[1]<=P[1]?[P[0],C[0],C[1],P[1]]:P[0]>C[0]&&P[0]<C[1]?[C[0],P[0],C[1],P[1]]:[P[0],C[0],P[1],C[1]]:P;if(0!==C.length)return C}return[]}var o={};return o.computeDiscriminant=function(e,t,r,n,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=r*r,l=c*r,f=n*n,d=f*n,h=a*a,E=h*a,m=u*c*f-4*s*d-4*e*l*f+18*e*t*r*d-27*i*f*f+256*o*E+a*(18*s*r*n-4*u*l+16*e*c*c-80*e*t*c*n-6*e*u*f+144*i*r*f)+h*(144*e*u*r-27*u*u-128*i*c-192*i*t*n);return m},o.computeRealRoots=function(t,n,o,u,s){if(Math.abs(t)<r.EPSILON15)return e.computeRealRoots(n,o,u,s);var c=n/t,l=o/t,f=u/t,d=s/t,h=c<0?1:0;switch(h+=l<0?h+1:h,h+=f<0?h+1:h,h+=d<0?h+1:h){case 0:return a(c,l,f,d);case 1:return i(c,l,f,d);case 2:return i(c,l,f,d);case 3:return a(c,l,f,d);case 4:return a(c,l,f,d);case 5:return i(c,l,f,d);case 6:return a(c,l,f,d);case 7:return a(c,l,f,d);case 8:return i(c,l,f,d);case 9:return a(c,l,f,d);case 10:return a(c,l,f,d);case 11:return i(c,l,f,d);case 12:return a(c,l,f,d);case 13:return a(c,l,f,d);case 14:return a(c,l,f,d);case 15:return a(c,l,f,d);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function a(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 a.getPoint=function(t,n,a){return r(a)||(a=new e),a=e.multiplyByScalar(t.direction,n,a),e.add(t.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,r,n,a,i,o,u,s,c){"use strict";function l(e,t,r,n){var a=t*t-4*e*r;if(!(a<0)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return u<s?(n.root0=u,n.root1=s):(n.root0=s,n.root1=u),n}var c=-t/(2*e);if(0!==c)return n.root0=n.root1=c,n}}function f(t,r,a){n(a)||(a={});var i=t.origin,o=t.direction,u=r.center,s=r.radius*r.radius,c=e.subtract(i,u,y),f=e.dot(o,o),d=2*e.dot(o,c),h=e.magnitudeSquared(c)-s,E=l(f,d,h,v);if(n(E))return a.start=E.root0,a.stop=E.root1,a}function d(e,t,r){var n=e+t;return i.sign(e)!==i.sign(t)&&Math.abs(n/Math.max(Math.abs(e),Math.abs(t)))<r?0:n}function h(t,r,n,a,c){var l,f=a*a,h=c*c,E=(t[o.COLUMN1ROW1]-t[o.COLUMN2ROW2])*h,m=c*(a*d(t[o.COLUMN1ROW0],t[o.COLUMN0ROW1],i.EPSILON15)+r.y),p=t[o.COLUMN0ROW0]*f+t[o.COLUMN2ROW2]*h+a*r.x+n,y=h*d(t[o.COLUMN2ROW1],t[o.COLUMN1ROW2],i.EPSILON15),_=c*(a*d(t[o.COLUMN2ROW0],t[o.COLUMN0ROW2])+r.z),T=[];if(0===_&&0===y){if(l=u.computeRealRoots(E,m,p),0===l.length)return T;var R=l[0],v=Math.sqrt(Math.max(1-R*R,0));if(T.push(new e(a,c*R,c*-v)),T.push(new e(a,c*R,c*v)),2===l.length){var A=l[1],S=Math.sqrt(Math.max(1-A*A,0));T.push(new e(a,c*A,c*-S)),T.push(new e(a,c*A,c*S))}return T}var N=_*_,I=y*y,g=E*E,O=_*y,M=g+I,w=2*(m*E+O),x=2*p*E+m*m-I+N,P=2*(p*m-O),C=p*p-N;if(0===M&&0===w&&0===x&&0===P)return T;l=s.computeRealRoots(M,w,x,P,C);var D=l.length;if(0===D)return T;for(var L=0;L<D;++L){var U,b=l[L],F=b*b,z=Math.max(1-F,0),B=Math.sqrt(z);U=i.sign(E)===i.sign(p)?d(E*F+p,m*b,i.EPSILON12):i.sign(p)===i.sign(m*b)?d(E*F,m*b+p,i.EPSILON12):d(E*F+m*b,p,i.EPSILON12);var G=d(y*b,_,i.EPSILON15),q=U*G;q<0?T.push(new e(a,c*b,c*B)):q>0?T.push(new e(a,c*b,c*-B)):0!==B?(T.push(new e(a,c*b,c*-B)),T.push(new e(a,c*b,c*B)),++L):T.push(new e(a,c*b,c*B))}return T}var E={};E.rayPlane=function(t,r,a){n(a)||(a=new e);var o=t.origin,u=t.direction,s=r.normal,c=e.dot(s,u);if(!(Math.abs(c)<i.EPSILON15)){var l=(-r.distance-e.dot(s,o))/c;if(!(l<0))return a=e.multiplyByScalar(u,l,a),e.add(o,a,a)}};var m=new e,p=new e,y=new e,_=new e,T=new e;E.rayTriangleParametric=function(t,n,a,o,u){u=r(u,!1);var s,c,l,f,d,h=t.origin,E=t.direction,R=e.subtract(a,n,m),v=e.subtract(o,n,p),A=e.cross(E,v,y),S=e.dot(R,A);if(u){if(S<i.EPSILON6)return;if(s=e.subtract(h,n,_),l=e.dot(s,A),l<0||l>S)return;if(c=e.cross(s,R,T),f=e.dot(E,c),f<0||l+f>S)return;d=e.dot(v,c)/S}else{if(Math.abs(S)<i.EPSILON6)return;var N=1/S;if(s=e.subtract(h,n,_),l=e.dot(s,A)*N,l<0||l>1)return;if(c=e.cross(s,R,T),f=e.dot(E,c)*N,f<0||l+f>1)return;d=e.dot(v,c)*N}return d},E.rayTriangle=function(t,r,a,i,o,u){var s=E.rayTriangleParametric(t,r,a,i,o);if(n(s)&&!(s<0))return n(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var R=new c;E.lineSegmentTriangle=function(t,r,a,i,o,u,s){var c=R;e.clone(t,c.origin),e.subtract(r,t,c.direction),e.normalize(c.direction,c.direction);var l=E.rayTriangleParametric(c,a,i,o,u);if(!(!n(l)||l<0||l>e.distance(t,r)))return n(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var v={root0:0,root1:0};E.raySphere=function(e,t,r){if(r=f(e,t,r),n(r)&&!(r.stop<0))return r.start=Math.max(r.start,0),r};var A=new c;E.lineSegmentSphere=function(t,r,a,i){var o=A;e.clone(t,o.origin);var u=e.subtract(r,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),i=f(o,a,i),!(!n(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var S=new e,N=new e;E.rayEllipsoid=function(t,r){var n,a,i,o,u,s=r.oneOverRadii,c=e.multiplyComponents(s,t.origin,S),l=e.multiplyComponents(s,t.direction,N),f=e.magnitudeSquared(c),d=e.dot(c,l);if(f>1){if(d>=0)return;var h=d*d;if(n=f-1,a=e.magnitudeSquared(l),i=a*n,h<i)return;if(h>i){o=d*d-i,u=-d+Math.sqrt(o);var E=u/a,m=n/u;return E<m?{start:E,stop:m}:{start:m,stop:E}}var p=Math.sqrt(n/a);return{start:p,stop:p}}return f<1?(n=f-1,a=e.magnitudeSquared(l),i=a*n,o=d*d-i,u=-d+Math.sqrt(o),{start:0,stop:u/a}):d<0?(a=e.magnitudeSquared(l),{start:0,stop:-d/a}):void 0};var I=new e,g=new e,O=new e,M=new e,w=new e,x=new o,P=new o,C=new o,D=new o,L=new o,U=new o,b=new o,F=new e,z=new e,B=new t;E.grazingAltitudeLocation=function(t,r){var a=t.origin,u=t.direction;if(!e.equals(a,e.ZERO)){var s=r.geodeticSurfaceNormal(a,I);if(e.dot(u,s)>=0)return a}var c=n(this.rayEllipsoid(t,r)),l=r.transformPositionToScaledSpace(u,I),f=e.normalize(l,l),d=e.mostOrthogonalAxis(l,M),E=e.normalize(e.cross(d,f,g),g),m=e.normalize(e.cross(f,E,O),O),p=x;p[0]=f.x,p[1]=f.y,p[2]=f.z,p[3]=E.x,p[4]=E.y,p[5]=E.z,p[6]=m.x,p[7]=m.y,p[8]=m.z;var y=o.transpose(p,P),_=o.fromScale(r.radii,C),T=o.fromScale(r.oneOverRadii,D),R=L;R[0]=0,R[1]=-u.z,R[2]=u.y,R[3]=u.z,R[4]=0,R[5]=-u.x,R[6]=-u.y,R[7]=u.x,R[8]=0;var v,A,S=o.multiply(o.multiply(y,T,U),R,U),N=o.multiply(o.multiply(S,_,b),p,b),G=o.multiplyByVector(S,a,w),q=h(N,e.negate(G,I),0,0,1),V=q.length;if(V>0){for(var W=e.clone(e.ZERO,z),X=Number.NEGATIVE_INFINITY,H=0;H<V;++H){v=o.multiplyByVector(_,o.multiplyByVector(p,q[H],F),F);var Y=e.normalize(e.subtract(v,a,M),M),k=e.dot(Y,u);k>X&&(X=k,W=e.clone(v,W))}var j=r.cartesianToCartographic(W,B);return X=i.clamp(X,0,1),A=e.magnitude(e.subtract(W,a,M))*Math.sqrt(1-X*X),A=c?-A:A,j.height=A,r.cartographicToCartesian(j,new e)}};var G=new e;return E.lineSegmentPlane=function(t,r,a,o){n(o)||(o=new e);var u=e.subtract(r,t,G),s=a.normal,c=e.dot(s,u);if(!(Math.abs(c)<i.EPSILON6)){var l=e.dot(s,t),f=-(a.distance+l)/c;if(!(f<0||f>1))return e.multiplyByScalar(u,f,o),e.add(t,o,o),o}},E.trianglePlaneIntersection=function(t,r,n,a){var i=a.normal,o=a.distance,u=e.dot(i,t)+o<0,s=e.dot(i,r)+o<0,c=e.dot(i,n)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var f,d;if(1!==l&&2!==l||(f=new e,d=new e),1===l){if(u)return E.lineSegmentPlane(t,r,a,f),E.lineSegmentPlane(t,n,a,d),{positions:[t,r,n,f,d],indices:[0,3,4,1,2,4,1,4,3]};if(s)return E.lineSegmentPlane(r,n,a,f),E.lineSegmentPlane(r,t,a,d),{positions:[t,r,n,f,d],indices:[1,3,4,2,0,4,2,4,3]};if(c)return E.lineSegmentPlane(n,t,a,f),E.lineSegmentPlane(n,r,a,d),{positions:[t,r,n,f,d],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return E.lineSegmentPlane(r,t,a,f),E.lineSegmentPlane(n,t,a,d),{positions:[t,r,n,f,d],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return E.lineSegmentPlane(n,r,a,f),E.lineSegmentPlane(t,r,a,d),{positions:[t,r,n,f,d],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return E.lineSegmentPlane(t,n,a,f),E.lineSegmentPlane(r,n,a,d),{positions:[t,r,n,f,d],indices:[0,1,4,0,4,3,2,3,4]}}},E}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,r,n){"use strict";function a(t,r){this.normal=e.clone(t),this.distance=r}a.fromPointNormal=function(r,n,i){var o=-e.dot(n,r);return t(i)?(e.clone(n,i.normal),i.distance=o,i):new a(n,o)};var i=new e;return a.fromCartesian4=function(r,n){var o=e.fromCartesian4(r,i),u=r.w;return t(n)?(e.clone(o,n.normal),n.distance=u,n):new a(o,u)},a.getPointDistance=function(t,r){return e.dot(t.normal,r)+t.distance},a.ORIGIN_XY_PLANE=n(new a(e.UNIT_Z,0)),a.ORIGIN_YZ_PLANE=n(new a(e.UNIT_X,0)),a.ORIGIN_ZX_PLANE=n(new a(e.UNIT_Y,0)),a}),define("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";var n={};return n.calculateACMR=function(r){r=e(r,e.EMPTY_OBJECT);var n=r.indices,a=r.maximumIndex,i=e(r.cacheSize,24),o=n.length;if(!t(a)){a=0;for(var u=0,s=n[u];u<o;)s>a&&(a=s),++u,s=n[u]}for(var c=[],l=0;l<a+1;l++)c[l]=0;for(var f=i+1,d=0;d<o;++d)f-c[n[d]]>i&&(c[n[d]]=f,++f);return(f-i+1)/(o/3)},n.tipsify=function(r){function n(e,t,r,n){for(;t.length>=1;){var a=t[t.length-1];if(t.splice(t.length-1,1),e[a].numLiveTriangles>0)return a}for(;i<n;){if(e[i].numLiveTriangles>0)return++i,i-1;++i}return-1}function a(e,t,r,a,i,o,u){for(var s,c=-1,l=-1,f=0;f<r.length;){var d=r[f];a[d].numLiveTriangles&&(s=0,i-a[d].timeStamp+2*a[d].numLiveTriangles<=t&&(s=i-a[d].timeStamp),(s>l||l===-1)&&(l=s,c=d)),++f}return c===-1?n(a,o,e,u):c}r=e(r,e.EMPTY_OBJECT);var i,o=r.indices,u=r.maximumIndex,s=e(r.cacheSize,24),c=o.length,l=0,f=0,d=o[f],h=c;if(t(u))l=u+1;else{for(;f<h;)d>l&&(l=d),++f,d=o[f];if(l===-1)return 0;++l}for(var E=[],m=0;m<l;m++)E[m]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};f=0;for(var p=0;f<h;)E[o[f]].vertexTriangles.push(p),++E[o[f]].numLiveTriangles,E[o[f+1]].vertexTriangles.push(p),++E[o[f+1]].numLiveTriangles,E[o[f+2]].vertexTriangles.push(p),++E[o[f+2]].numLiveTriangles,++p,f+=3;var y=0,_=s+1;i=1;var T,R,v=[],A=[],S=0,N=[],I=c/3,g=[];for(m=0;m<I;m++)g[m]=!1;for(var O,M;y!==-1;){v=[],R=E[y],M=R.vertexTriangles.length;for(var w=0;w<M;++w)if(p=R.vertexTriangles[w],!g[p]){g[p]=!0,f=p+p+p;for(var x=0;x<3;++x)O=o[f],v.push(O),A.push(O),N[S]=O,++S,T=E[O],--T.numLiveTriangles,_-T.timeStamp>s&&(T.timeStamp=_,++_),++f}y=a(o,s,v,E,_,A,l)}return N},n}),define("Core/GeometryPipeline",["./AttributeCompression","./barycentricCoordinates","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EncodedCartesian3","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryType","./IndexDatatype","./Intersect","./IntersectionTests","./Math","./Matrix3","./Matrix4","./Plane","./PrimitiveType","./Tipsify"],function(e,t,r,n,a,i,o,u,s,c,l,f,d,h,E,m,p,y,_,T,R,v,A,S,N){"use strict";function I(e,t,r,n,a){e[t++]=r,e[t++]=n,e[t++]=n,e[t++]=a,e[t++]=a,e[t]=r}function g(e){for(var t=e.length,r=t/3*6,n=p.createTypedArray(t,r),a=0,i=0;i<t;i+=3,a+=6)I(n,a,e[i],e[i+1],e[i+2]);return n}function O(e){var t=e.length;if(t>=3){var r=6*(t-2),n=p.createTypedArray(t,r);I(n,0,e[0],e[1],e[2]);for(var a=6,i=3;i<t;++i,a+=6)I(n,a,e[i-1],e[i],e[i-2]);return n}return new Uint16Array}function M(e){if(e.length>0){for(var t=e.length-1,r=6*(t-1),n=p.createTypedArray(t,r),a=e[0],i=0,o=1;o<t;++o,i+=6)I(n,i,a,e[o],e[o+1]);return n}return new Uint16Array}function w(e){var t={};for(var r in e)if(e.hasOwnProperty(r)&&c(e[r])&&c(e[r].values)){var n=e[r];t[r]=new E({componentDatatype:n.componentDatatype,componentsPerAttribute:n.componentsPerAttribute,normalize:n.normalize,values:[]})}return t}function x(e,t,r){for(var n in t)if(t.hasOwnProperty(n)&&c(t[n])&&c(t[n].values))for(var a=t[n],i=0;i<a.componentsPerAttribute;++i)e[n].values.push(a.values[r*a.componentsPerAttribute+i])}function P(e,t){if(c(t))for(var r=t.values,n=r.length,i=0;i<n;i+=3)a.unpack(r,i,ie),v.multiplyByPoint(e,ie,ie),a.pack(ie,r,i)}function C(e,t){if(c(t))for(var r=t.values,n=r.length,i=0;i<n;i+=3)a.unpack(r,i,ie),R.multiplyByVector(e,ie,ie),ie=a.normalize(ie,ie),a.pack(ie,r,i)}function D(e,t){var r,n=e.length,a={},i=e[0][t].attributes;for(r in i)if(i.hasOwnProperty(r)&&c(i[r])&&c(i[r].values)){for(var o=i[r],s=o.values.length,l=!0,f=1;f<n;++f){var d=e[f][t].attributes[r];if(!c(d)||o.componentDatatype!==d.componentDatatype||o.componentsPerAttribute!==d.componentsPerAttribute||o.normalize!==d.normalize){l=!1;break}s+=d.values.length}l&&(a[r]=new E({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:u.createTypedArray(o.componentDatatype,s)}))}return a}function L(e,t){var n,i,o,u,s,l,f,d=e.length,E=(e[0].modelMatrix,c(e[0][t].indices)),m=e[0][t].primitiveType,y=D(e,t);for(n in y)if(y.hasOwnProperty(n))for(s=y[n].values,u=0,i=0;i<d;++i)for(l=e[i][t].attributes[n].values,f=l.length,o=0;o<f;++o)s[u++]=l[o];var _;if(E){var T=0;for(i=0;i<d;++i)T+=e[i][t].indices.length;var R=h.computeNumberOfVertices(new h({attributes:y,primitiveType:S.POINTS})),v=p.createTypedArray(R,T),A=0,N=0;for(i=0;i<d;++i){var I=e[i][t].indices,g=I.length;for(u=0;u<g;++u)v[A++]=N+I[u];N+=h.computeNumberOfVertices(e[i][t])}_=v}var O,M=new a,w=0;for(i=0;i<d;++i){if(O=e[i][t].boundingSphere,!c(O)){M=void 0;break}a.add(O.center,M,M)}if(c(M))for(a.divideByScalar(M,d,M),i=0;i<d;++i){O=e[i][t].boundingSphere;var x=a.magnitude(a.subtract(O.center,M,se))+O.radius;x>w&&(w=x)}return new h({attributes:y,indices:_,primitiveType:m,boundingSphere:c(M)?new r(M,w):void 0})}function U(e){if(c(e.indices))return e;for(var t=h.computeNumberOfVertices(e),r=p.createTypedArray(t,t),n=0;n<t;++n)r[n]=n;return e.indices=r,e}function b(e){var t=h.computeNumberOfVertices(e),r=p.createTypedArray(t,3*(t-2));r[0]=1,r[1]=0,r[2]=2;for(var n=3,a=3;a<t;++a)r[n++]=a-1,r[n++]=0,r[n++]=a;return e.indices=r,e.primitiveType=S.TRIANGLES,e}function F(e){var t=h.computeNumberOfVertices(e),r=p.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,a=3;a<t-1;a+=2)r[n++]=a,r[n++]=a-1,r[n++]=a+1,a+2<t&&(r[n++]=a,r[n++]=a+1,r[n++]=a+2);return e.indices=r,e.primitiveType=S.TRIANGLES,e}function z(e){if(c(e.indices))return e;for(var t=h.computeNumberOfVertices(e),r=p.createTypedArray(t,t),n=0;n<t;++n)r[n]=n;return e.indices=r,e}function B(e){var t=h.computeNumberOfVertices(e),r=p.createTypedArray(t,2*(t-1));r[0]=0,r[1]=1;for(var n=2,a=2;a<t;++a)r[n++]=a-1,r[n++]=a;return e.indices=r,e.primitiveType=S.LINES,e}function G(e){var t=h.computeNumberOfVertices(e),r=p.createTypedArray(t,2*t);r[0]=0,r[1]=1;for(var n=2,a=2;a<t;++a)r[n++]=a-1,r[n++]=a;return r[n++]=t-1,r[n]=0,e.indices=r,e.primitiveType=S.LINES,e}function q(e){switch(e.primitiveType){case S.TRIANGLE_FAN:return b(e);case S.TRIANGLE_STRIP:return F(e);case S.TRIANGLES:return U(e);case S.LINE_STRIP:return B(e);case S.LINE_LOOP:return G(e);case S.LINES:return z(e)}return e}function V(e,t){Math.abs(e.y)<T.EPSILON6&&(t?e.y=-T.EPSILON6:e.y=T.EPSILON6)}function W(e,t,r){if(0!==e.y&&0!==t.y&&0!==r.y)return V(e,e.y<0),V(t,t.y<0),void V(r,r.y<0);var n,a=Math.abs(e.y),i=Math.abs(t.y),o=Math.abs(r.y);n=a>i?a>o?T.sign(e.y):T.sign(r.y):i>o?T.sign(t.y):T.sign(r.y);var u=n<0;V(e,u),V(t,u),V(r,u)}function X(e,t,r,n){a.add(e,a.multiplyByScalar(a.subtract(t,e,Re),e.y/(e.y-t.y),Re),r),a.clone(r,n),V(r,!0),V(n,!1)}function H(e,t,r){if(!(e.x>=0||t.x>=0||r.x>=0)){W(e,t,r);var n=e.y<0,a=t.y<0,i=r.y<0,o=0;o+=n?1:0,o+=a?1:0,o+=i?1:0;var u=Ie.indices;1===o?(u[1]=3,u[2]=4,u[5]=6,u[7]=6,u[8]=5,n?(X(e,t,ve,Se),X(e,r,Ae,Ne),u[0]=0,u[3]=1,u[4]=2,u[6]=1):a?(X(t,r,ve,Se),X(t,e,Ae,Ne),u[0]=1,u[3]=2,u[4]=0,u[6]=2):i&&(X(r,e,ve,Se),X(r,t,Ae,Ne),u[0]=2,u[3]=0,u[4]=1,u[6]=0)):2===o&&(u[2]=4,u[4]=4,u[5]=3,u[7]=5,u[8]=6,n?a?i||(X(r,e,ve,Se),X(r,t,Ae,Ne),u[0]=0,u[1]=1,u[3]=0,u[6]=2):(X(t,r,ve,Se),X(t,e,Ae,Ne),u[0]=2,u[1]=0,u[3]=2,u[6]=1):(X(e,t,ve,Se),X(e,r,Ae,Ne),u[0]=1,u[1]=2,u[3]=1,u[6]=0));var s=Ie.positions;return s[0]=e,s[1]=t,s[2]=r,s.length=3,1!==o&&2!==o||(s[3]=ve,s[4]=Ae,s[5]=Se,s[6]=Ne,s.length=7),Ie}}function Y(e,t){var n=e.attributes;if(0!==n.position.values.length){for(var a in n)if(n.hasOwnProperty(a)&&c(n[a])&&c(n[a].values)){var i=n[a];i.values=u.createTypedArray(i.componentDatatype,i.values)}var o=h.computeNumberOfVertices(e);return e.indices=p.createTypedArray(o,e.indices),t&&(e.boundingSphere=r.fromVertices(n.position.values)),e}}function k(e){var t=e.attributes,r={};for(var n in t)if(t.hasOwnProperty(n)&&c(t[n])&&c(t[n].values)){var a=t[n];r[n]=new E({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:[]})}return new h({attributes:r,indices:[],primitiveType:e.primitiveType})}function j(e,t,r){var n=c(e.geometry.boundingSphere);t=Y(t,n),r=Y(r,n),c(r)&&!c(t)?e.geometry=r:!c(r)&&c(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=r,e.geometry=void 0)}function Z(e,r,i,o,u,s,l,f,d,h,E){if(c(s)||c(l)||c(f)||c(d)){var m=a.fromArray(u,3*e,ge),p=a.fromArray(u,3*r,Oe),y=a.fromArray(u,3*i,Me),_=t(o,m,p,y,we);if(c(s)){var T=a.fromArray(s,3*e,ge),R=a.fromArray(s,3*r,Oe),v=a.fromArray(s,3*i,Me);a.multiplyByScalar(T,_.x,T),a.multiplyByScalar(R,_.y,R),a.multiplyByScalar(v,_.z,v);var A=a.add(T,R,T);a.add(A,v,A),a.normalize(A,A),a.pack(A,h.normal.values,3*E)}if(c(l)){var S=a.fromArray(l,3*e,ge),N=a.fromArray(l,3*r,Oe),I=a.fromArray(l,3*i,Me);a.multiplyByScalar(S,_.x,S),a.multiplyByScalar(N,_.y,N),a.multiplyByScalar(I,_.z,I);var g=a.add(S,N,S);a.add(g,I,g),a.normalize(g,g),a.pack(g,h.binormal.values,3*E)}if(c(f)){var O=a.fromArray(f,3*e,ge),M=a.fromArray(f,3*r,Oe),w=a.fromArray(f,3*i,Me);a.multiplyByScalar(O,_.x,O),a.multiplyByScalar(M,_.y,M),a.multiplyByScalar(w,_.z,w);var x=a.add(O,M,O);a.add(x,w,x),a.normalize(x,x),a.pack(x,h.tangent.values,3*E)}if(c(d)){var P=n.fromArray(d,2*e,xe),C=n.fromArray(d,2*r,Pe),D=n.fromArray(d,2*i,Ce);n.multiplyByScalar(P,_.x,P),n.multiplyByScalar(C,_.y,C),n.multiplyByScalar(D,_.z,D);var L=n.add(P,C,P);n.add(L,D,L),n.pack(L,h.st.values,2*E)}}}function K(e,t,r,n,a,i){var o=e.position.values.length/3;if(a!==-1){var u=n[a],s=r[u];return s===-1?(r[u]=o,e.position.values.push(i.x,i.y,i.z),t.push(o),o):(t.push(s),s)}return e.position.values.push(i.x,i.y,i.z),t.push(o),o}function J(e){var t,r,n,i,o,u=e.geometry,s=u.attributes,l=s.position.values,f=c(s.normal)?s.normal.values:void 0,d=c(s.binormal)?s.binormal.values:void 0,h=c(s.tangent)?s.tangent.values:void 0,E=c(s.st)?s.st.values:void 0,m=u.indices,p=k(u),y=k(u),_=[];_.length=l.length/3;var T=[];for(T.length=l.length/3,o=0;o<_.length;++o)_[o]=-1,T[o]=-1;var R=m.length;for(o=0;o<R;o+=3){var v=m[o],A=m[o+1],S=m[o+2],N=a.fromArray(l,3*v),I=a.fromArray(l,3*A),g=a.fromArray(l,3*S),O=H(N,I,g);if(c(O)&&O.positions.length>3)for(var M=O.positions,w=O.indices,x=w.length,P=0;P<x;++P){var C=w[P],D=M[C];D.y<0?(t=y.attributes,r=y.indices,n=_):(t=p.attributes,r=p.indices,n=T),i=K(t,r,n,m,C<3?o+C:-1,D),Z(v,A,S,D,l,f,d,h,E,t,i)}else c(O)&&(N=O.positions[0],I=O.positions[1],g=O.positions[2]),N.y<0?(t=y.attributes,r=y.indices,n=_):(t=p.attributes,r=p.indices,n=T),i=K(t,r,n,m,o,N),Z(v,A,S,N,l,f,d,h,E,t,i),i=K(t,r,n,m,o+1,I),Z(v,A,S,I,l,f,d,h,E,t,i),i=K(t,r,n,m,o+2,g),Z(v,A,S,g,l,f,d,h,E,t,i)}j(e,y,p)}function Q(e){var t,r=e.geometry,n=r.attributes,i=n.position.values,o=r.indices,u=k(r),s=k(r),l=o.length,f=[];f.length=i.length/3;var d=[];for(d.length=i.length/3,t=0;t<f.length;++t)f[t]=-1,d[t]=-1;for(t=0;t<l;t+=2){var h=o[t],E=o[t+1],m=a.fromArray(i,3*h,ge),p=a.fromArray(i,3*E,Oe);Math.abs(m.y)<T.EPSILON6&&(m.y<0?m.y=-T.EPSILON6:m.y=T.EPSILON6),Math.abs(p.y)<T.EPSILON6&&(p.y<0?p.y=-T.EPSILON6:p.y=T.EPSILON6);var y=u.attributes,R=u.indices,v=d,A=s.attributes,S=s.indices,N=f,I=_.lineSegmentPlane(m,p,De,Me);if(c(I)){var g=a.multiplyByScalar(a.UNIT_Y,5*T.EPSILON9,Le);m.y<0&&(a.negate(g,g),y=s.attributes,R=s.indices,v=f,A=u.attributes,S=u.indices,N=d);var O=a.add(I,g,Ue);K(y,R,v,o,t,m),K(y,R,v,o,-1,O),a.negate(g,g),a.add(I,g,O),K(A,S,N,o,-1,O),K(A,S,N,o,t+1,p)}else{var M,w,x;m.y<0?(M=s.attributes,w=s.indices,x=f):(M=u.attributes,w=u.indices,x=d),K(M,w,x,o,t,m),K(M,w,x,o,t+1,p)}}j(e,s,u)}function $(e){for(var t=e.attributes,r=t.position.values,n=t.prevPosition.values,i=t.nextPosition.values,o=r.length,u=0;u<o;u+=3){var s=a.unpack(r,u,ze);if(!(s.x>0)){var c=a.unpack(n,u,Be);(s.y<0&&c.y>0||s.y>0&&c.y<0)&&(u-3>0?(n[u]=r[u-3],n[u+1]=r[u-2],n[u+2]=r[u-1]):a.pack(s,n,u));var l=a.unpack(i,u,Ge);(s.y<0&&l.y>0||s.y>0&&l.y<0)&&(u+3<o?(i[u]=r[u+3],i[u+1]=r[u+4],i[u+2]=r[u+5]):a.pack(s,i,u))}}}function ee(e){var t,r,o,u=e.geometry,s=u.attributes,l=s.position.values,f=s.prevPosition.values,d=s.nextPosition.values,h=s.expandAndWidth.values,E=c(s.st)?s.st.values:void 0,m=c(s.color)?s.color.values:void 0,p=k(u),y=k(u),R=!1,v=l.length/3;for(t=0;t<v;t+=4){var A=t,S=t+2,N=a.fromArray(l,3*A,ze),I=a.fromArray(l,3*S,Be);if(Math.abs(N.y)<Ye)for(N.y=Ye*(I.y<0?-1:1),l[3*t+1]=N.y,l[3*(t+1)+1]=N.y,r=3*A;r<3*A+12;r+=3)f[r]=l[3*t],f[r+1]=l[3*t+1],f[r+2]=l[3*t+2];if(Math.abs(I.y)<Ye)for(I.y=Ye*(N.y<0?-1:1),l[3*(t+2)+1]=I.y,l[3*(t+3)+1]=I.y,r=3*A;r<3*A+12;r+=3)d[r]=l[3*(t+2)],d[r+1]=l[3*(t+2)+1],d[r+2]=l[3*(t+2)+2];var g=p.attributes,O=p.indices,M=y.attributes,w=y.indices,x=_.lineSegmentPlane(N,I,De,qe);if(c(x)){R=!0;var P=a.multiplyByScalar(a.UNIT_Y,He,Ve);N.y<0&&(a.negate(P,P),g=y.attributes,O=y.indices,M=p.attributes,w=p.indices);var C=a.add(x,P,We);g.position.values.push(N.x,N.y,N.z,N.x,N.y,N.z),g.position.values.push(C.x,C.y,C.z),g.position.values.push(C.x,C.y,C.z),g.prevPosition.values.push(f[3*A],f[3*A+1],f[3*A+2]),g.prevPosition.values.push(f[3*A+3],f[3*A+4],f[3*A+5]),g.prevPosition.values.push(N.x,N.y,N.z,N.x,N.y,N.z),g.nextPosition.values.push(C.x,C.y,C.z),g.nextPosition.values.push(C.x,C.y,C.z),g.nextPosition.values.push(C.x,C.y,C.z),g.nextPosition.values.push(C.x,C.y,C.z),a.negate(P,P),a.add(x,P,C),M.position.values.push(C.x,C.y,C.z),M.position.values.push(C.x,C.y,C.z),M.position.values.push(I.x,I.y,I.z,I.x,I.y,I.z),M.prevPosition.values.push(C.x,C.y,C.z),M.prevPosition.values.push(C.x,C.y,C.z),M.prevPosition.values.push(C.x,C.y,C.z),M.prevPosition.values.push(C.x,C.y,C.z),M.nextPosition.values.push(I.x,I.y,I.z,I.x,I.y,I.z),M.nextPosition.values.push(d[3*S],d[3*S+1],d[3*S+2]),M.nextPosition.values.push(d[3*S+3],d[3*S+4],d[3*S+5]);var D=n.fromArray(h,2*A,be),L=Math.abs(D.y);g.expandAndWidth.values.push(-1,L,1,L),g.expandAndWidth.values.push(-1,-L,1,-L),M.expandAndWidth.values.push(-1,L,1,L),M.expandAndWidth.values.push(-1,-L,1,-L);var U=a.magnitudeSquared(a.subtract(x,N,Ge));if(U/=a.magnitudeSquared(a.subtract(I,N,Ge)),c(m)){var b=i.fromArray(m,4*A,Xe),F=i.fromArray(m,4*S,Xe),z=T.lerp(b.x,F.x,U),B=T.lerp(b.y,F.y,U),G=T.lerp(b.z,F.z,U),q=T.lerp(b.w,F.w,U);for(r=4*A;r<4*A+8;++r)g.color.values.push(m[r]);for(g.color.values.push(z,B,G,q),g.color.values.push(z,B,G,q),M.color.values.push(z,B,G,q),M.color.values.push(z,B,G,q),r=4*S;r<4*S+8;++r)M.color.values.push(m[r])}if(c(E)){var V=n.fromArray(E,2*A,be),W=n.fromArray(E,2*(t+3),Fe),X=T.lerp(V.x,W.x,U);for(r=2*A;r<2*A+4;++r)g.st.values.push(E[r]);for(g.st.values.push(X,V.y),g.st.values.push(X,W.y),M.st.values.push(X,V.y),M.st.values.push(X,W.y),r=2*S;r<2*S+4;++r)M.st.values.push(E[r])}o=g.position.values.length/3-4,O.push(o,o+2,o+1),O.push(o+1,o+2,o+3),o=M.position.values.length/3-4,w.push(o,o+2,o+1),w.push(o+1,o+2,o+3)}else{var H,Y;for(N.y<0?(H=y.attributes,Y=y.indices):(H=p.attributes,Y=p.indices),H.position.values.push(N.x,N.y,N.z),H.position.values.push(N.x,N.y,N.z),H.position.values.push(I.x,I.y,I.z),H.position.values.push(I.x,I.y,I.z),r=3*t;r<3*t+12;++r)H.prevPosition.values.push(f[r]),H.nextPosition.values.push(d[r]);for(r=2*t;r<2*t+8;++r)H.expandAndWidth.values.push(h[r]),c(E)&&H.st.values.push(E[r]);if(c(m))for(r=4*t;r<4*t+16;++r)H.color.values.push(m[r]);o=H.position.values.length/3-4,Y.push(o,o+2,o+1),Y.push(o+1,o+2,o+3)}}R&&($(y),$(p)),j(e,y,p)}var te={};te.toWireframe=function(e){var t=e.indices;if(c(t)){switch(e.primitiveType){case S.TRIANGLES:e.indices=g(t);break;case S.TRIANGLE_STRIP:e.indices=O(t);break;case S.TRIANGLE_FAN:e.indices=M(t)}e.primitiveType=S.LINES}return e},te.createLineSegmentsForVectors=function(e,t,n){t=s(t,"normal"),n=s(n,1e4);for(var a=e.attributes.position.values,i=e.attributes[t].values,o=a.length,l=new Float64Array(2*o),f=0,d=0;d<o;d+=3)l[f++]=a[d],l[f++]=a[d+1],l[f++]=a[d+2],l[f++]=a[d]+i[d]*n,l[f++]=a[d+1]+i[d+1]*n,l[f++]=a[d+2]+i[d+2]*n;var m,p=e.boundingSphere;return c(p)&&(m=new r(p.center,p.radius+n)),new h({attributes:{position:new E({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:S.LINES,boundingSphere:m})},te.createAttributeLocations=function(e){var t,r=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","binormal","tangent","compressedAttributes"],n=e.attributes,a={},i=0,o=r.length;for(t=0;t<o;++t){var u=r[t];c(n[u])&&(a[u]=i++)}for(var s in n)n.hasOwnProperty(s)&&!c(a[s])&&(a[s]=i++);return a},te.reorderForPreVertexCache=function(e){var t=h.computeNumberOfVertices(e),r=e.indices;if(c(r)){for(var n=new Int32Array(t),a=0;a<t;a++)n[a]=-1;for(var i,o=r,s=o.length,l=p.createTypedArray(t,s),f=0,d=0,E=0;f<s;)i=n[o[f]],i!==-1?l[d]=i:(i=o[f],n[i]=E,l[d]=E,++E),++f,++d;e.indices=l;var m=e.attributes;for(var y in m)if(m.hasOwnProperty(y)&&c(m[y])&&c(m[y].values)){for(var _=m[y],T=_.values,R=0,v=_.componentsPerAttribute,A=u.createTypedArray(_.componentDatatype,E*v);R<t;){var S=n[R];if(S!==-1)for(a=0;a<v;a++)A[v*S+a]=T[v*R+a];++R}_.values=A}}return e},te.reorderForPostVertexCache=function(e,t){var r=e.indices;if(e.primitiveType===S.TRIANGLES&&c(r)){for(var n=r.length,a=0,i=0;i<n;i++)r[i]>a&&(a=r[i]);e.indices=N.tipsify({indices:r,maximumIndex:a,cacheSize:t})}return e},te.fitToUnsignedShortIndices=function(e){var t=[],r=h.computeNumberOfVertices(e);if(c(e.indices)&&r>=T.SIXTY_FOUR_KILOBYTES){var n,a=[],i=[],o=0,u=w(e.attributes),s=e.indices,l=s.length;e.primitiveType===S.TRIANGLES?n=3:e.primitiveType===S.LINES?n=2:e.primitiveType===S.POINTS&&(n=1);for(var f=0;f<l;f+=n){for(var d=0;d<n;++d){var E=s[f+d],m=a[E];c(m)||(m=o++,a[E]=m,x(u,e.attributes,E)),i.push(m)}o+n>=T.SIXTY_FOUR_KILOBYTES&&(t.push(new h({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),a=[],i=[],o=0,u=w(e.attributes))}0!==i.length&&t.push(new h({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e); -return t};var re=new a,ne=new o;te.projectTo2D=function(e,t,r,n,i){var o=e.attributes[t];i=c(i)?i:new d;for(var s=i.ellipsoid,l=o.values,f=new Float64Array(l.length),h=0,m=0;m<l.length;m+=3){var p=a.fromArray(l,m,re),y=s.cartesianToCartographic(p,ne),_=i.project(y,re);f[h++]=_.x,f[h++]=_.y,f[h++]=_.z}return e.attributes[r]=o,e.attributes[n]=new E({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:f}),delete e.attributes[t],e};var ae={high:0,low:0};te.encodeAttribute=function(e,t,r,n){for(var a=e.attributes[t],i=a.values,o=i.length,s=new Float32Array(o),c=new Float32Array(o),l=0;l<o;++l)f.encode(i[l],ae),s[l]=ae.high,c[l]=ae.low;var d=a.componentsPerAttribute;return e.attributes[r]=new E({componentDatatype:u.FLOAT,componentsPerAttribute:d,values:s}),e.attributes[n]=new E({componentDatatype:u.FLOAT,componentsPerAttribute:d,values:c}),delete e.attributes[t],e};var ie=new a,oe=new v,ue=new R;te.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(v.equals(t,v.IDENTITY))return e;var n=e.geometry.attributes;P(t,n.position),P(t,n.prevPosition),P(t,n.nextPosition),(c(n.normal)||c(n.binormal)||c(n.tangent))&&(v.inverse(t,oe),v.transpose(oe,oe),v.getRotation(oe,ue),C(ue,n.normal),C(ue,n.binormal),C(ue,n.tangent));var a=e.geometry.boundingSphere;return c(a)&&(e.geometry.boundingSphere=r.transform(a,t,a)),e.modelMatrix=v.clone(v.IDENTITY),e};var se=new a;te.combineInstances=function(e){for(var t=[],r=[],n=e.length,a=0;a<n;++a){var i=e[a];c(i.geometry)?t.push(i):c(i.westHemisphereGeometry)&&c(i.eastHemisphereGeometry)&&r.push(i)}var o=[];return t.length>0&&o.push(L(t,"geometry")),r.length>0&&(o.push(L(r,"westHemisphereGeometry")),o.push(L(r,"eastHemisphereGeometry"))),o};var ce=new a,le=new a,fe=new a,de=new a;te.computeNormal=function(e){for(var t=e.indices,r=e.attributes,n=r.position.values,i=r.position.values.length/3,o=t.length,s=new Array(i),c=new Array(o/3),l=new Array(o),f=0;f<i;f++)s[f]={indexOffset:0,count:0,currentCount:0};var d=0;for(f=0;f<o;f+=3){var h=t[f],m=t[f+1],p=t[f+2],y=3*h,_=3*m,T=3*p;le.x=n[y],le.y=n[y+1],le.z=n[y+2],fe.x=n[_],fe.y=n[_+1],fe.z=n[_+2],de.x=n[T],de.y=n[T+1],de.z=n[T+2],s[h].count++,s[m].count++,s[p].count++,a.subtract(fe,le,fe),a.subtract(de,le,de),c[d]=a.cross(fe,de,new a),d++}var R=0;for(f=0;f<i;f++)s[f].indexOffset+=R,R+=s[f].count;d=0;var v;for(f=0;f<o;f+=3){v=s[t[f]];var A=v.indexOffset+v.currentCount;l[A]=d,v.currentCount++,v=s[t[f+1]],A=v.indexOffset+v.currentCount,l[A]=d,v.currentCount++,v=s[t[f+2]],A=v.indexOffset+v.currentCount,l[A]=d,v.currentCount++,d++}var S=new Float32Array(3*i);for(f=0;f<i;f++){var N=3*f;if(v=s[f],v.count>0){for(a.clone(a.ZERO,ce),d=0;d<v.count;d++)a.add(ce,c[l[v.indexOffset+d]],ce);a.normalize(ce,ce),S[N]=ce.x,S[N+1]=ce.y,S[N+2]=ce.z}else S[N]=0,S[N+1]=0,S[N+2]=1}return e.attributes.normal=new E({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:S}),e};var he=new a,Ee=new a,me=new a;te.computeBinormalAndTangent=function(e){for(var t=(e.attributes,e.indices),r=e.attributes.position.values,n=e.attributes.normal.values,i=e.attributes.st.values,o=e.attributes.position.values.length/3,s=t.length,c=new Array(3*o),l=0;l<c.length;l++)c[l]=0;var f,d,h;for(l=0;l<s;l+=3){var m=t[l],p=t[l+1],y=t[l+2];f=3*m,d=3*p,h=3*y;var _=2*m,T=2*p,R=2*y,v=r[f],A=r[f+1],S=r[f+2],N=i[_],I=i[_+1],g=i[T+1]-I,O=i[R+1]-I,M=1/((i[T]-N)*O-(i[R]-N)*g),w=(O*(r[d]-v)-g*(r[h]-v))*M,x=(O*(r[d+1]-A)-g*(r[h+1]-A))*M,P=(O*(r[d+2]-S)-g*(r[h+2]-S))*M;c[f]+=w,c[f+1]+=x,c[f+2]+=P,c[d]+=w,c[d+1]+=x,c[d+2]+=P,c[h]+=w,c[h+1]+=x,c[h+2]+=P}var C=new Float32Array(3*o),D=new Float32Array(3*o);for(l=0;l<o;l++){f=3*l,d=f+1,h=f+2;var L=a.fromArray(n,f,he),U=a.fromArray(c,f,me),b=a.dot(L,U);a.multiplyByScalar(L,b,Ee),a.normalize(a.subtract(U,Ee,U),U),D[f]=U.x,D[d]=U.y,D[h]=U.z,a.normalize(a.cross(L,U,U),U),C[f]=U.x,C[d]=U.y,C[h]=U.z}return e.attributes.tangent=new E({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:D}),e.attributes.binormal=new E({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:C}),e};var pe=new n,ye=new a,_e=new a,Te=new a;te.compressVertices=function(t){var r=t.attributes.normal,i=t.attributes.st;if(!c(r)&&!c(i))return t;var o,s,l,f,d=t.attributes.tangent,h=t.attributes.binormal;c(r)&&(o=r.values),c(i)&&(s=i.values),c(d)&&(l=d.values),h&&(f=h.values);var m=c(o)?o.length:s.length,p=c(o)?3:2,y=m/p,_=y,T=c(s)&&c(o)?2:1;T+=c(l)||c(f)?1:0,_*=T;for(var R=new Float32Array(_),v=0,A=0;A<y;++A){c(s)&&(n.fromArray(s,2*A,pe),R[v++]=e.compressTextureCoordinates(pe));var S=3*A;c(o)&&c(l)&&c(f)?(a.fromArray(o,S,ye),a.fromArray(l,S,_e),a.fromArray(f,S,Te),e.octPack(ye,_e,Te,pe),R[v++]=pe.x,R[v++]=pe.y):(c(o)&&(a.fromArray(o,S,ye),R[v++]=e.octEncodeFloat(ye)),c(l)&&(a.fromArray(l,S,ye),R[v++]=e.octEncodeFloat(ye)),c(f)&&(a.fromArray(f,S,ye),R[v++]=e.octEncodeFloat(ye)))}return t.attributes.compressedAttributes=new E({componentDatatype:u.FLOAT,componentsPerAttribute:T,values:R}),c(o)&&delete t.attributes.normal,c(s)&&delete t.attributes.st,c(l)&&delete t.attributes.tangent,c(f)&&delete t.attributes.binormal,t};var Re=new a,ve=new a,Ae=new a,Se=new a,Ne=new a,Ie={positions:new Array(7),indices:new Array(9)},ge=new a,Oe=new a,Me=new a,we=new a,xe=new n,Pe=new n,Ce=new n,De=A.fromPointNormal(a.ZERO,a.UNIT_Y),Le=new a,Ue=new a,be=new n,Fe=new n,ze=new a,Be=new a,Ge=new a,qe=new a,Ve=new a,We=new a,Xe=new i,He=5*T.EPSILON9,Ye=T.EPSILON6;return te.splitLongitude=function(e){var t=e.geometry,n=t.boundingSphere;if(c(n)){var a=n.center.x-n.radius;if(a>0||r.intersectPlane(n,A.ORIGIN_ZX_PLANE)!==y.INTERSECTING)return e}if(t.geometryType!==m.NONE)switch(t.geometryType){case m.POLYLINES:ee(e);break;case m.TRIANGLES:J(e);break;case m.LINES:Q(e)}else q(t),t.primitiveType===S.TRIANGLES?J(e):t.primitiveType===S.LINES&&Q(e);return e},te}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,r,n,a){return t(e).then(r,n,a)}function t(e){var t,r;return e instanceof n?t=e:u(e)?(r=o(),e.then(function(e){r.resolve(e)},function(e){r.reject(e)},function(e){r.progress(e)}),t=r.promise):t=a(e),t}function r(t){return e(t,i)}function n(e){this.then=e}function a(e){var r=new n(function(r){try{return t(r?r(e):e)}catch(e){return i(e)}});return r}function i(e){var r=new n(function(r,n){try{return n?t(n(e)):i(e)}catch(e){return i(e)}});return r}function o(){function e(e,t,r){return d(e,t,r)}function r(e){return E(e)}function a(e){return E(i(e))}function u(e){return h(e)}var s,c,l,f,d,h,E;return c=new n(e),s={then:e,resolve:r,reject:a,progress:u,promise:c,resolver:{resolve:r,reject:a,progress:u}},l=[],f=[],d=function(e,t,r){var n,a;return n=o(),a="function"==typeof r?function(e){try{n.progress(r(e))}catch(e){n.progress(e)}}:function(e){n.progress(e)},l.push(function(r){r.then(e,t).then(n.resolve,n.reject,a)}),f.push(a),n.promise},h=function(e){return m(f,e),e},E=function(e){return e=t(e),d=e.then,E=t,h=y,m(l,e),f=l=v,e},s}function u(e){return e&&"function"==typeof e.then}function s(t,r,n,a,i){return p(2,arguments),e(t,function(t){function u(e){m(e)}function s(e){E(e)}var c,l,f,d,h,E,m,p,_,T;if(_=t.length>>>0,c=Math.max(0,Math.min(r,_)),f=[],l=_-c+1,d=[],h=o(),c)for(p=h.progress,m=function(e){d.push(e),--l||(E=m=y,h.reject(d))},E=function(e){f.push(e),--c||(E=m=y,h.resolve(f))},T=0;T<_;++T)T in t&&e(t[T],s,u,p);else h.resolve(f);return h.then(n,a,i)})}function c(e,t,r,n){function a(e){return t?t(e[0]):e[0]}return s(e,1,a,r,n)}function l(e,t,r,n){return p(1,arguments),d(e,_).then(t,r,n)}function f(){return d(arguments,_)}function d(t,r){return e(t,function(t){var n,a,i,u,s,c;if(i=a=t.length>>>0,n=[],c=o(),i)for(u=function(t,a){e(t,r).then(function(e){n[a]=e,--i||c.resolve(n)},c.reject)},s=0;s<a;s++)s in t?u(t[s],s):--i;else c.resolve(n);return c.promise})}function h(t,r){var n=R.call(arguments,1);return e(t,function(t){var a;return a=t.length,n[0]=function(t,n,i){return e(t,function(t){return e(n,function(e){return r(t,e,i,a)})})},T.apply(t,n)})}function E(t,r,n){var a=arguments.length>2;return e(t,function(e){return e=a?n:e,r.resolve(e),e},function(e){return r.reject(e),i(e)},r.progress)}function m(e,t){for(var r,n=0;r=e[n++];)r(t)}function p(e,t){for(var r,n=t.length;n>e;)if(r=t[--n],null!=r&&"function"!=typeof r)throw new Error("arg "+n+" must be a function")}function y(){}function _(e){return e}var T,R,v;return e.defer=o,e.resolve=t,e.reject=r,e.join=f,e.all=l,e.map=d,e.reduce=h,e.any=c,e.some=s,e.chain=E,e.isPromise=u,n.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(v,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return l(t,function(t){return e.apply(v,t)})})}},R=[].slice,T=[].reduce||function(e){var t,r,n,a,i;if(i=0,t=Object(this),a=t.length>>>0,r=arguments,r.length<=1)for(;;){if(i in t){n=t[i++];break}if(++i>=a)throw new TypeError}else n=r[1];for(;i<a;++i)i in t&&(n=e(n,t[i],i,t));return n},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(r,n){t(a[r])||(a[r]=!0,console.log(e(n,r)))}var a={};return n.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.",n}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,r){"use strict";function n(e,t){r(e,t)}return n}),define("Core/binarySearch",["./defined","./DeveloperError"],function(e,t){"use strict";function r(e,t,r){for(var n,a,i=0,o=e.length-1;i<=o;)if(n=~~((i+o)/2),a=r(e[n],t),a<0)i=n+1;else{if(!(a>0))return n;o=n-1}return~(o+1)}return r}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,r,n,a){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=r,this.yPoleOffset=n,this.ut1MinusUtc=a}return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,r=0,n=t[r++],a=function(e,t,r,n){r||(r=" ");var a=e.length>=t?"":Array(1+t-e.length>>>0).join(r);return n?e+a:a+e},i=function(e,t,r,n,i,o){var u=n-e.length;return u>0&&(e=r||!i?a(e,n,o,r):e.slice(0,t.length)+a("",u,"0",!0)+e.slice(t.length)),e},o=function(e,t,r,n,o,u,s){var c=e>>>0;return r=r&&c&&{2:"0b",8:"0",16:"0x"}[t]||"",e=r+a(c.toString(t),u||0,"0",!1),i(e,r,n,o,s)},u=function(e,t,r,n,a,o){return null!=n&&(e=e.slice(0,n)),i(e,"",t,r,a,o)},s=function(e,n,s,c,l,f,d){var h,E,m,p,y;if("%%"==e)return"%";for(var _=!1,T="",R=!1,v=!1,A=" ",S=s.length,N=0;s&&N<S;N++)switch(s.charAt(N)){case" ":T=" ";break;case"+":T="+";break;case"-":_=!0;break;case"'":A=s.charAt(N+1);break;case"0":R=!0;break;case"#":v=!0}if(c=c?"*"==c?+t[r++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,c<0&&(c=-c,_=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(f=f?"*"==f?+t[r++]:"*"==f.charAt(0)?+t[f.slice(1,-1)]:+f:"fFeE".indexOf(d)>-1?6:"d"==d?0:void 0,y=n?t[n.slice(0,-1)]:t[r++],d){case"s":return u(String(y),_,c,f,R,A);case"c":return u(String.fromCharCode(+y),_,c,f,R);case"b":return o(y,2,v,_,c,f,R);case"o":return o(y,8,v,_,c,f,R);case"x":return o(y,16,v,_,c,f,R);case"X":return o(y,16,v,_,c,f,R).toUpperCase();case"u":return o(y,10,v,_,c,f,R);case"i":case"d":return h=+y||0,h=Math.round(h-h%1),E=h<0?"-":T,y=E+a(String(Math.abs(h)),f,"0",!1),i(y,E,_,c,R);case"e":case"E":case"f":case"F":case"g":case"G":return h=+y,E=h<0?"-":T,m=["toExponential","toFixed","toPrecision"]["efg".indexOf(d.toLowerCase())],p=["toString","toUpperCase"]["eEfFgG".indexOf(d)%2],y=E+Math.abs(h)[m](f),i(y,E,_,c,R)[p]();default:return e}};return n.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,r,n,a,i,o,u){this.year=e,this.month=t,this.day=r,this.hour=n,this.minute=a,this.second=i,this.millisecond=o,this.isLeapSecond=u}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e(t)}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,r,n,a,i,o,u,s,c){"use strict";function l(e,t){return m.compare(e.julianDate,t.julianDate)}function f(e){T.julianDate=e;var r=m.leapSeconds,n=t(r,T,l);n<0&&(n=~n),n>=r.length&&(n=r.length-1);var a=r[n].offset;if(n>0){var i=m.secondsDifference(r[n].julianDate,e);i>a&&(n--,a=r[n].offset)}m.addSeconds(e,a,e)}function d(e,r){T.julianDate=e;var n=m.leapSeconds,a=t(n,T,l);if(a<0&&(a=~a),0===a)return m.addSeconds(e,-n[0].offset,r);if(a>=n.length)return m.addSeconds(e,-n[a-1].offset,r);var i=m.secondsDifference(n[a].julianDate,e);return 0===i?m.addSeconds(e,-n[a].offset,r):i<=1?void 0:m.addSeconds(e,-n[--a].offset,r)}function h(e,t,r){var n=t/s.SECONDS_PER_DAY|0;return e+=n,t-=s.SECONDS_PER_DAY*n,t<0&&(e--,t+=s.SECONDS_PER_DAY),r.dayNumber=e,r.secondsOfDay=t,r}function E(e,t,r,n,a,i,o){var u=(t-14)/12|0,c=e+4800+u,l=(1461*c/4|0)+(367*(t-2-12*u)/12|0)-(3*((c+100)/100|0)/4|0)+r-32075;n-=12,n<0&&(n+=24);var f=i+(n*s.SECONDS_PER_HOUR+a*s.SECONDS_PER_MINUTE+o*s.SECONDS_PER_MILLISECOND);return f>=43200&&(l-=1),[l,f]}function m(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=r(e,0),t=r(t,0),n=r(n,c.UTC);var a=0|e;t+=(e-a)*s.SECONDS_PER_DAY,h(a,t,this),n===c.UTC&&f(this)}var p=new i,y=[31,28,31,30,31,30,31,31,30,31,30,31],_=29,T=new u,R=/^(\d{4})$/,v=/^(\d{4})-(\d{2})$/,A=/^(\d{4})-?(\d{3})$/,S=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,N=/^(\d{4})-?(\d{2})-?(\d{2})$/,I=/([Z+\-])?(\d{2})?:?(\d{2})?$/,g=/^(\d{2})(\.\d+)?/.source+I.source,O=/^(\d{2}):?(\d{2})(\.\d+)?/.source+I.source,M=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+I.source;m.fromDate=function(e,t){var r=E(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return n(t)?(h(r[0],r[1],t),f(t),t):new m(r[0],r[1],c.UTC)},m.fromIso8601=function(e,t){e=e.replace(",",".");var r,a,i,u=e.split("T"),s=1,l=1,d=0,p=0,T=0,I=0,w=u[0],x=u[1];if(u=w.match(N),null!==u)r=+u[1],s=+u[2],l=+u[3];else if(u=w.match(v),null!==u)r=+u[1],s=+u[2];else if(u=w.match(R),null!==u)r=+u[1];else{var P;if(u=w.match(A),null!==u)r=+u[1],P=+u[2],i=o(r);else if(u=w.match(S),null!==u){r=+u[1];var C=+u[2],D=+u[3]||0,L=new Date(Date.UTC(r,0,4));P=7*C+D-L.getUTCDay()-3}a=new Date(Date.UTC(r,0,1)),a.setUTCDate(P),s=a.getUTCMonth()+1,l=a.getUTCDate()}i=o(r);var U;if(n(x)){u=x.match(M),null!==u?(d=+u[1],p=+u[2],T=+u[3],I=1e3*+(u[4]||0),U=5):(u=x.match(O),null!==u?(d=+u[1],p=+u[2],T=60*+(u[3]||0),U=4):(u=x.match(g),null!==u&&(d=+u[1],p=60*+(u[2]||0),U=3)));var b=u[U],F=+u[U+1],z=+(u[U+2]||0);switch(b){case"+":d-=F,p-=z;break;case"-":d+=F,p+=z;break;case"Z":break;default:p+=new Date(Date.UTC(r,s-1,l,d,p)).getTimezoneOffset()}}else p+=new Date(r,s-1,l).getTimezoneOffset();var B=60===T;for(B&&T--;p>=60;)p-=60,d++;for(;d>=24;)d-=24,l++;for(a=i&&2===s?_:y[s-1];l>a;)l-=a,s++,s>12&&(s-=12,r++),a=i&&2===s?_:y[s-1];for(;p<0;)p+=60,d--;for(;d<0;)d+=24,l--;for(;l<1;)s--,s<1&&(s+=12,r--),a=i&&2===s?_:y[s-1],l+=a;var G=E(r,s,l,d,p,T,I);return n(t)?(h(G[0],G[1],t),f(t)):t=new m(G[0],G[1],c.UTC),B&&m.addSeconds(t,1,t),t},m.now=function(e){return m.fromDate(new Date,e)};var w=new m(0,0,c.TAI);return m.toGregorianDate=function(e,t){var r=!1,a=d(e,w);n(a)||(m.addSeconds(e,-1,w),a=d(w,w),r=!0);var o=a.dayNumber,u=a.secondsOfDay;u>=43200&&(o+=1);var c=o+68569|0,l=4*c/146097|0;c=c-((146097*l+3)/4|0)|0;var f=4e3*(c+1)/1461001|0;c=c-(1461*f/4|0)+31|0;var h=80*c/2447|0,E=c-(2447*h/80|0)|0;c=h/11|0;var p=h+2-12*c|0,y=100*(l-49)+f+c|0,_=u/s.SECONDS_PER_HOUR|0,T=u-_*s.SECONDS_PER_HOUR,R=T/s.SECONDS_PER_MINUTE|0;T-=R*s.SECONDS_PER_MINUTE;var v=0|T,A=(T-v)/s.SECONDS_PER_MILLISECOND;return _+=12,_>23&&(_-=24),r&&(v+=1),n(t)?(t.year=y,t.month=p,t.day=E,t.hour=_,t.minute=R,t.second=v,t.millisecond=A,t.isLeapSecond=r,t):new i(y,p,E,_,R,v,A,r)},m.toDate=function(e){var t=m.toGregorianDate(e,p),r=t.second;return t.isLeapSecond&&(r-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,r,t.millisecond))},m.toIso8601=function(t,r){var a,i=m.toGregorianDate(t,i);return n(r)||0===i.millisecond?n(r)&&0!==r?(a=(.01*i.millisecond).toFixed(r).replace(".","").slice(0,r),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",i.year,i.month,i.day,i.hour,i.minute,i.second):(a=(.01*i.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a))},m.clone=function(e,t){if(n(e))return n(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new m(e.dayNumber,e.secondsOfDay,c.TAI)},m.compare=function(e,t){var r=e.dayNumber-t.dayNumber;return 0!==r?r:e.secondsOfDay-t.secondsOfDay},m.equals=function(e,t){return e===t||n(e)&&n(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},m.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(m.secondsDifference(e,t))<=r},m.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},m.secondsDifference=function(e,t){var r=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return r+(e.secondsOfDay-t.secondsOfDay)},m.daysDifference=function(e,t){var r=e.dayNumber-t.dayNumber,n=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return r+n},m.computeTaiMinusUtc=function(e){T.julianDate=e;var r=m.leapSeconds,n=t(r,T,l);return n<0&&(n=~n,--n,n<0&&(n=0)),r[n].offset},m.addSeconds=function(e,t,r){return h(e.dayNumber,e.secondsOfDay+t,r)},m.addMinutes=function(e,t,r){var n=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return h(e.dayNumber,n,r)},m.addHours=function(e,t,r){var n=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return h(e.dayNumber,n,r)},m.addDays=function(e,t,r){var n=e.dayNumber+t;return h(n,e.secondsOfDay,r)},m.lessThan=function(e,t){return m.compare(e,t)<0},m.lessThanOrEquals=function(e,t){return m.compare(e,t)<=0},m.greaterThan=function(e,t){return m.compare(e,t)>0},m.greaterThanOrEquals=function(e,t){return m.compare(e,t)>=0},m.prototype.clone=function(e){return m.clone(this,e)},m.prototype.equals=function(e){return m.equals(this,e)},m.prototype.equalsEpsilon=function(e,t){return m.equalsEpsilon(this,e,t)},m.prototype.toString=function(){return m.toIso8601(this)},m.leapSeconds=[new u(new m(2441317,43210,c.TAI),10),new u(new m(2441499,43211,c.TAI),11),new u(new m(2441683,43212,c.TAI),12),new u(new m(2442048,43213,c.TAI),13),new u(new m(2442413,43214,c.TAI),14),new u(new m(2442778,43215,c.TAI),15),new u(new m(2443144,43216,c.TAI),16),new u(new m(2443509,43217,c.TAI),17),new u(new m(2443874,43218,c.TAI),18),new u(new m(2444239,43219,c.TAI),19),new u(new m(2444786,43220,c.TAI),20),new u(new m(2445151,43221,c.TAI),21),new u(new m(2445516,43222,c.TAI),22),new u(new m(2446247,43223,c.TAI),23),new u(new m(2447161,43224,c.TAI),24),new u(new m(2447892,43225,c.TAI),25),new u(new m(2448257,43226,c.TAI),26),new u(new m(2448804,43227,c.TAI),27),new u(new m(2449169,43228,c.TAI),28),new u(new m(2449534,43229,c.TAI),29),new u(new m(2450083,43230,c.TAI),30),new u(new m(2450630,43231,c.TAI),31),new u(new m(2451179,43232,c.TAI),32),new u(new m(2453736,43233,c.TAI),33),new u(new m(2454832,43234,c.TAI),34),new u(new m(2456109,43235,c.TAI),35),new u(new m(2457204,43236,c.TAI),36),new u(new m(2457754,43237,c.TAI),37)],m}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(r,n){if(null===r||"object"!=typeof r)return r;n=e(n,!1);var a=new r.constructor;for(var i in r)if(r.hasOwnProperty(i)){var o=r[i];n&&(o=t(o,n)),a[i]=o}return a}return t}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var r=e.split("\r\n"),n=0;n<r.length;++n){var a=r[n],i=a.indexOf(": ");if(i>0){var o=a.substring(0,i),u=a.substring(i+2);t[o]=u}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function r(e,r,n){this.statusCode=e,this.response=r,this.responseHeaders=n,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return r.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},r}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var r=n.exec(t);this.scheme=r[1],this.authority=r[2],this.path=r[3],this.query=r[4],this.fragment=r[5]}}function t(e){var t=unescape(e);return i.test(t)?t:e.toUpperCase()}function r(e,t,r,n){return(t||"")+r.toLowerCase()+(n||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var n=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(o,r).replace(a,t)),this.path&&(this.path=this.path.replace(a,t)),this.query&&(this.query=this.query.replace(a,t)),this.fragment&&(this.fragment=this.fragment.replace(a,t))};var a=/%[0-9a-z]{2}/gi,i=/[a-zA-Z0-9\-\._~]/,o=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var r=new e;return this.scheme?(r.scheme=this.scheme,r.authority=this.authority,r.path=this.path,r.query=this.query):(r.scheme=t.scheme,this.authority?(r.authority=this.authority,r.path=this.path,r.query=this.query):(r.authority=t.authority,""==this.path?(r.path=t.path,r.query=this.query||t.query):("/"==this.path.charAt(0)?(r.path=this.path,r.removeDotSegments()):(t.authority&&""==t.path?r.path="/"+this.path:r.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,r.removeDotSegments()),r.query=this.query))),r.fragment=this.fragment,r},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),r=[],n=""==t[0];n&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?r.pop():"."!=e&&r.push(e);"."!=e&&".."!=e||r.push(""),n&&r.unshift(""),this.path=r.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(r){var n=new e(r);n.normalize();var a=n.getAuthority();if(t(a)){if(a.indexOf("@")!==-1){var i=a.split("@");a=i[1]}if(a.indexOf(":")===-1){var o=n.getScheme();if(t(o)||(o=window.location.protocol,o=o.substring(0,o.length-1)),"http"===o)a+=":80";else{if("https"!==o)return;a+=":443"}}return a}}var a={},i={};return a.add=function(e,r){var n=e.toLowerCase()+":"+r;t(i[n])||(i[n]=!0)},a.remove=function(e,r){var n=e.toLowerCase()+":"+r;t(i[n])&&delete i[n]},a.contains=function(e){var r=n(e);return!(!t(r)||!t(i[r]))},a.clear=function(){i={}},a}),define("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,r,n,a,i,o){"use strict";function u(r){r=t(r,t.EMPTY_OBJECT);var n=r.responseType,a=t(r.method,"GET"),i=r.data,o=r.headers,s=r.overrideMimeType;return e(r.url,function(t){var r=e.defer();return u.load(t,n,a,i,o,r,s),r.promise})}function s(e,t){var r=decodeURIComponent(t);return e?atob(r):r}function c(e,t){for(var r=s(e,t),n=new ArrayBuffer(r.length),a=new Uint8Array(n),i=0;i<r.length;i++)a[i]=r.charCodeAt(i);return n}function l(e,r){r=t(r,"");var n=e[1],a=!!e[2],i=e[3];switch(r){case"":case"text":return s(a,i);case"arraybuffer":return c(a,i);case"blob":var o=c(a,i);return new Blob([o],{type:n});case"document":var u=new DOMParser;return u.parseFromString(s(a,i),n);case"json":return JSON.parse(s(a,i))}}var f=/^data:(.*?)(;base64)?,(.*)$/;return u.load=function(e,t,n,u,s,c,d){var h=f.exec(e);if(null!==h)return void c.resolve(l(h,t));var E=new XMLHttpRequest;if(o.contains(e)&&(E.withCredentials=!0),r(d)&&r(E.overrideMimeType)&&E.overrideMimeType(d),E.open(n,e,!0),r(s))for(var m in s)s.hasOwnProperty(m)&&E.setRequestHeader(m,s[m]);r(t)&&(E.responseType=t),E.onload=function(){if(E.status<200||E.status>=300)return void c.reject(new a(E.status,E.response,E.getAllResponseHeaders()));var e=E.response,n=E.responseType;if(!r(e)||r(t)&&n!==t)if("json"===t&&"string"==typeof e)try{c.resolve(JSON.parse(e))}catch(e){c.reject(e)}else(""===n||"document"===n)&&r(E.responseXML)&&E.responseXML.hasChildNodes()?c.resolve(E.responseXML):""!==n&&"text"!==n||!r(E.responseText)?c.reject(new i("Invalid XMLHttpRequest response type.")):c.resolve(E.responseText);else c.resolve(e)},E.onerror=function(e){c.reject(new a)},E.send(u)},u.defaultLoad=u.load,u}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,r){return e({url:t,headers:r})}return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,r,n){"use strict";function a(r,a){return t(a)?t(a.Accept)||(a=e(a),a.Accept=i.Accept):a=i,n(r,a).then(function(e){return JSON.parse(e)})}var i={Accept:"application/json,*/*;q=0.01"};return a}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,r,n,a,i,o,u,s,c,l,f){"use strict";function d(t){if(t=r(t,r.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=r(t.addNewLeapSeconds,!0),n(t.data))E(this,t.data);else if(n(t.url)){var a=this;this._downloadPromise=e(s(t.url),function(e){E(a,e)},function(){a._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else E(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function h(e,t){return o.compare(e.julianDate,t)}function E(e,r){if(!n(r.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!n(r.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var a=r.columnNames.indexOf("modifiedJulianDateUtc"),i=r.columnNames.indexOf("xPoleWanderRadians"),s=r.columnNames.indexOf("yPoleWanderRadians"),c=r.columnNames.indexOf("ut1MinusUtcSeconds"),d=r.columnNames.indexOf("xCelestialPoleOffsetRadians"),E=r.columnNames.indexOf("yCelestialPoleOffsetRadians"),m=r.columnNames.indexOf("taiMinusUtcSeconds");if(a<0||i<0||s<0||c<0||d<0||E<0||m<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var p=e._samples=r.samples,y=e._dates=[];e._dateColumn=a,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=d,e._yCelestialPoleOffsetRadiansColumn=E,e._taiMinusUtcSecondsColumn=m,e._columnCount=r.columnNames.length,e._lastIndex=void 0;for(var _,T=e._addNewLeapSeconds,R=0,v=p.length;R<v;R+=e._columnCount){var A=p[R+a],S=p[R+m],N=A+l.MODIFIED_JULIAN_DATE_DIFFERENCE,I=new o(N,S,f.TAI);if(y.push(I),T){if(S!==_&&n(_)){var g=o.leapSeconds,O=t(g,I,h);if(O<0){var M=new u(I,S);g.splice(~O,0,M)}}_=S}}}function m(e,t,r,n,a){var i=r*n;a.xPoleWander=t[i+e._xPoleWanderRadiansColumn],a.yPoleWander=t[i+e._yPoleWanderRadiansColumn],a.xPoleOffset=t[i+e._xCelestialPoleOffsetRadiansColumn],a.yPoleOffset=t[i+e._yCelestialPoleOffsetRadiansColumn],a.ut1MinusUtc=t[i+e._ut1MinusUtcSecondsColumn]}function p(e,t,r){return t+e*(r-t)}function y(e,t,r,n,a,i,u){var s=e._columnCount;if(i>t.length-1)return u.xPoleWander=0,u.yPoleWander=0,u.xPoleOffset=0,u.yPoleOffset=0,u.ut1MinusUtc=0,u;var c=t[a],l=t[i];if(c.equals(l)||n.equals(c))return m(e,r,a,s,u),u;if(n.equals(l))return m(e,r,i,s,u),u;var f=o.secondsDifference(n,c)/o.secondsDifference(l,c),d=a*s,h=i*s,E=r[d+e._ut1MinusUtcSecondsColumn],y=r[h+e._ut1MinusUtcSecondsColumn],_=y-E;if(_>.5||_<-.5){var T=r[d+e._taiMinusUtcSecondsColumn],R=r[h+e._taiMinusUtcSecondsColumn];T!==R&&(l.equals(n)?E=y:y-=R-T)}return u.xPoleWander=p(f,r[d+e._xPoleWanderRadiansColumn],r[h+e._xPoleWanderRadiansColumn]),u.yPoleWander=p(f,r[d+e._yPoleWanderRadiansColumn],r[h+e._yPoleWanderRadiansColumn]),u.xPoleOffset=p(f,r[d+e._xCelestialPoleOffsetRadiansColumn],r[h+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=p(f,r[d+e._yCelestialPoleOffsetRadiansColumn],r[h+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=p(f,E,y),u}return d.NONE=i({getPromiseToLoad:function(){return e()},compute:function(e,t){return n(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new a(0,0,0,0,0),t}}),d.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},d.prototype.compute=function(e,r){if(n(this._samples)){if(n(r)||(r=new a(0,0,0,0,0)),0===this._samples.length)return r.xPoleWander=0,r.yPoleWander=0,r.xPoleOffset=0,r.yPoleOffset=0,r.ut1MinusUtc=0,r;var i=this._dates,u=this._lastIndex,s=0,l=0;if(n(u)){var f=i[u],d=i[u+1],h=o.lessThanOrEquals(f,e),E=!n(d),m=E||o.greaterThanOrEquals(d,e);if(h&&m)return s=u,!E&&d.equals(e)&&++s,l=s+1,y(this,i,this._samples,e,s,l,r),r}var p=t(i,e,o.compare,this._dateColumn);return p>=0?(p<i.length-1&&i[p+1].equals(e)&&++p,s=p,l=p):(l=~p,s=l-1,s<0&&(s=0)),this._lastIndex=s,y(this,i,this._samples,e,s,l,r),r}if(n(this._dataError))throw new c(this._dataError)},d}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,r,n){"use strict";function a(t,r,n){this.heading=e(t,0),this.pitch=e(r,0),this.roll=e(n,0)}return a.fromQuaternion=function(e,r){t(r)||(r=new a);var n=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return r.heading=-Math.atan2(s,u),r.roll=Math.atan2(o,i),r.pitch=-Math.asin(n),r},a.fromDegrees=function(e,r,i,o){return t(o)||(o=new a),o.heading=e*n.RADIANS_PER_DEGREE,o.pitch=r*n.RADIANS_PER_DEGREE,o.roll=i*n.RADIANS_PER_DEGREE, -o},a.clone=function(e,r){if(t(e))return t(r)?(r.heading=e.heading,r.pitch=e.pitch,r.roll=e.roll,r):new a(e.heading,e.pitch,e.roll)},a.equals=function(e,r){return e===r||t(e)&&t(r)&&e.heading===r.heading&&e.pitch===r.pitch&&e.roll===r.roll},a.equalsEpsilon=function(e,r,a,i){return e===r||t(e)&&t(r)&&n.equalsEpsilon(e.heading,r.heading,a,i)&&n.equalsEpsilon(e.pitch,r.pitch,a,i)&&n.equalsEpsilon(e.roll,r.roll,a,i)},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,r){return a.equalsEpsilon(this,e,t,r)},a.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},a}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function a(r,n){n=t(n,document.location.href);var a=new e(n),i=new e(r);return i.resolve(a).toString()}return a}),define("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function a(n,a,i){i=t(i,!0),n instanceof e||(n=new e(n)),a instanceof e||(a=new e(a)),r(a.authority)&&!r(a.scheme)&&("undefined"!=typeof document&&r(document.location)&&r(document.location.href)?a.scheme=new e(document.location.href).scheme:a.scheme=n.scheme);var o=n;a.isAbsolute()&&(o=a);var u="";r(o.scheme)&&(u+=o.scheme+":"),r(o.authority)&&(u+="//"+o.authority,""!==o.path&&"/"!==o.path&&(u=u.replace(/\/?$/,"/"),o.path=o.path.replace(/^\/?/g,""))),u+=o===n?i?n.path.replace(/\/?$/,"/")+a.path.replace(/^\/?/g,""):n.path+a.path:a.path;var s=r(n.query),c=r(a.query);s&&c?u+="?"+n.query+"&"+a.query:s&&!c?u+="?"+n.query:!s&&c&&(u+="?"+a.query);var l=r(a.fragment);return r(n.fragment)&&!l?u+="#"+n.fragment:l&&(u+="#"+a.fragment),u}return a}),define("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","./joinUrls","require"],function(e,t,r,n,a,i){"use strict";function o(){for(var e=document.getElementsByTagName("script"),t=0,r=e.length;t<r;++t){var n=e[t].getAttribute("src"),a=E.exec(n);if(null!==a)return a[1]}}function u(){if(t(f))return f;var r;return r="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:o(),f=new e(n(r))}function s(e){return i.toUrl("../"+e)}function c(e){return a(u(),e)}function l(e){t(d)||(d=t(i.toUrl)?s:c),t(h)||(h=document.createElement("a"));var r=d(e);return h.href=r,h.href=h.href,h.href}var f,d,h,E=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return l._cesiumScriptRegex=E,l.setBaseUrl=function(t){f=new e(t).resolve(new e(document.location.href))},l}),define("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,r){this.x=e,this.y=t,this.s=r}return e}),define("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,r,n,a,i,o,u){"use strict";function s(e){e=r(e,r.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=r(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=r(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new i(this._sampleZeroJulianEphemerisDate,0,u.TAI),this._stepSizeDays=r(e.stepSizeDays,1),this._samplesPerXysFile=r(e.samplesPerXysFile,1e3),this._totalSamples=r(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,n=this._denominators=new Array(t+1),a=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t),s=0;s<=t;++s){n[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;c<=t;++c)c!==s&&(n[s]*=s-c);n[s]=1/n[s]}this._work=new Array(t+1),this._coef=new Array(t+1)}function c(e,t,r){var n=f;return n.dayNumber=t,n.secondsOfDay=r,i.daysDifference(n,e._sampleZeroDateTT)}function l(r,a){if(r._chunkDownloadsInProgress[a])return r._chunkDownloadsInProgress[a];var i=e.defer();r._chunkDownloadsInProgress[a]=i;var u,s=r._xysFileUrlTemplate;return u=n(s)?s.replace("{0}",a):t("Assets/IAU2006_XYS/IAU2006_XYS_"+a+".json"),e(o(u),function(e){r._chunkDownloadsInProgress[a]=!1;for(var t=r._samples,n=e.samples,o=a*r._samplesPerXysFile*3,u=0,s=n.length;u<s;++u)t[o+u]=n[u];i.resolve()}),i.promise}var f=new i(0,0,u.TAI);return s.prototype.preload=function(t,r,n,a){var i=c(this,t,r),o=c(this,n,a),u=i/this._stepSizeDays-this._interpolationOrder/2|0;u<0&&(u=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var f=u/this._samplesPerXysFile|0,d=s/this._samplesPerXysFile|0,h=[],E=f;E<=d;++E)h.push(l(this,E));return e.all(h)},s.prototype.computeXysRadians=function(e,t,r){var i=c(this,e,t);if(!(i<0)){var o=i/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);s<0&&(s=0);var f=s+u;f>=this._totalSamples&&(f=this._totalSamples-1,s=f-u,s<0&&(s=0));var d=!1,h=this._samples;if(n(h[3*s])||(l(this,s/this._samplesPerXysFile|0),d=!0),n(h[3*f])||(l(this,f/this._samplesPerXysFile|0),d=!0),!d){n(r)?(r.x=0,r.y=0,r.s=0):r=new a(0,0,0);var E,m,p=i-s*this._stepSizeDays,y=this._work,_=this._denominators,T=this._coef,R=this._xTable;for(E=0;E<=u;++E)y[E]=p-R[E];for(E=0;E<=u;++E){for(T[E]=1,m=0;m<=u;++m)m!==E&&(T[E]*=y[m]);T[E]*=_[E];var v=3*(s+E);r.x+=T[E]*h[v++],r.y+=T[E]*h[v++],r.s+=T[E]*h[v]}return r}}}},s}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./defaultValue","./defined","./deprecationWarning","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./HeadingPitchRoll","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,r,n,a,i,o,u,s,c,l,f,d,h,E,m,p,y,_,T,R){"use strict";var v={},A=new r,S=new r,N=new r;v.eastNorthUpToFixedFrame=function(e,t,n){if(p.equalsEpsilon(e.x,0,p.EPSILON14)&&p.equalsEpsilon(e.y,0,p.EPSILON14)){var a=p.sign(e.z);return o(n)?(n[0]=0,n[1]=1,n[2]=0,n[3]=0,n[4]=-a,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=a,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new _(0,-a,0,e.x,1,0,0,e.y,0,0,a,e.z,0,0,0,1)}var u=A,s=S,c=N;return t=i(t,f.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,r.normalize(s,s),r.cross(u,s,c),o(n)?(n[0]=s.x,n[1]=s.y,n[2]=s.z,n[3]=0,n[4]=c.x,n[5]=c.y,n[6]=c.z,n[7]=0,n[8]=u.x,n[9]=u.y,n[10]=u.z,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new _(s.x,c.x,u.x,e.x,s.y,c.y,u.y,e.y,s.z,c.z,u.z,e.z,0,0,0,1)};var I=new r,g=new r,O=new r;v.northEastDownToFixedFrame=function(e,t,n){if(p.equalsEpsilon(e.x,0,p.EPSILON14)&&p.equalsEpsilon(e.y,0,p.EPSILON14)){var a=p.sign(e.z);return o(n)?(n[0]=-a,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=1,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=-a,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new _(-a,0,0,e.x,0,1,0,e.y,0,0,-a,e.z,0,0,0,1)}var u=I,s=g,c=O;return t=i(t,f.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,r.normalize(s,s),r.cross(u,s,c),o(n)?(n[0]=c.x,n[1]=c.y,n[2]=c.z,n[3]=0,n[4]=s.x,n[5]=s.y,n[6]=s.z,n[7]=0,n[8]=-u.x,n[9]=-u.y,n[10]=-u.z,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new _(c.x,s.x,-u.x,e.x,c.y,s.y,-u.y,e.y,c.z,s.z,-u.z,e.z,0,0,0,1)},v.northUpEastToFixedFrame=function(e,t,n){if(p.equalsEpsilon(e.x,0,p.EPSILON14)&&p.equalsEpsilon(e.y,0,p.EPSILON14)){var a=p.sign(e.z);return o(n)?(n[0]=-a,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=a,n[7]=0,n[8]=0,n[9]=1,n[10]=0,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new _(-a,0,0,e.x,0,0,1,e.y,0,a,0,e.z,0,0,0,1)}var u=A,s=S,c=N;return t=i(t,f.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,r.normalize(s,s),r.cross(u,s,c),o(n)?(n[0]=c.x,n[1]=c.y,n[2]=c.z,n[3]=0,n[4]=u.x,n[5]=u.y,n[6]=u.z,n[7]=0,n[8]=s.x,n[9]=s.y,n[10]=s.z,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new _(c.x,u.x,s.x,e.x,c.y,u.y,s.y,e.y,c.z,u.z,s.z,e.z,0,0,0,1)},v.northWestUpToFixedFrame=function(e,t,n){if(p.equalsEpsilon(e.x,0,p.EPSILON14)&&p.equalsEpsilon(e.y,0,p.EPSILON14)){var a=p.sign(e.z);return o(n)?(n[0]=-a,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=-1,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=a,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new _(-a,0,0,e.x,0,-1,0,e.y,0,0,a,e.z,0,0,0,1)}var u=A,s=S,c=N;return t=i(t,f.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,r.normalize(s,s),r.cross(u,s,c),o(n)?(n[0]=c.x,n[1]=c.y,n[2]=c.z,n[3]=0,n[4]=-s.x,n[5]=-s.y,n[6]=-s.z,n[7]=0,n[8]=u.x,n[9]=u.y,n[10]=u.z,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new _(c.x,-s.x,u.x,e.x,c.y,-s.y,u.y,e.y,c.z,-s.z,u.z,e.z,0,0,0,1)};var M=new T,w=new r(1,1,1),x=new _;v.headingPitchRollToFixedFrame=function(e,t,n,a,i,o){var s;"object"==typeof t?(i=n,o=a,s=t.heading,n=t.pitch,a=t.roll):(u("headingPitchRollToFixedFrame","headingPitchRollToFixedFrame with separate heading, pitch, and roll arguments was deprecated in 1.27. It will be removed in 1.30. Use a HeadingPitchRoll object."),s=t);var c=T.fromHeadingPitchRoll(s,n,a,M),l=_.fromTranslationQuaternionRotationScale(r.ZERO,c,w,x);return o=v.eastNorthUpToFixedFrame(e,i,o),_.multiply(o,l,o)};var P=new d,C=new _,D=new y;v.headingPitchRollQuaternion=function(e,t,r,n,a,i){var o;"object"==typeof t?(o=t,a=r,i=n):(u("headingPitchRollQuaternion","headingPitchRollQuaternion with separate heading, pitch, and roll arguments was deprecated in 1.27. It will be removed in 1.30. Use a HeadingPitchRoll object."),P.heading=t,P.pitch=r,P.roll=n,o=P);var s=v.headingPitchRollToFixedFrame(e,o,a,C),c=_.getRotation(s,D);return T.fromRotationMatrix(c,i)};var L=24110.54841,U=8640184.812866,b=.093104,F=-62e-7,z=1.1772758384668e-19,B=72921158553e-15,G=p.TWO_PI/86400,q=new m;v.computeTemeToPseudoFixedMatrix=function(e,t){q=m.addSeconds(e,-m.computeTaiMinusUtc(e),q);var r,n=q.dayNumber,a=q.secondsOfDay,i=n-2451545;r=a>=43200?(i+.5)/R.DAYS_PER_JULIAN_CENTURY:(i-.5)/R.DAYS_PER_JULIAN_CENTURY;var u=L+r*(U+r*(b+r*F)),s=u*G%p.TWO_PI,c=B+z*(n-2451545.5),l=(a+.5*R.SECONDS_PER_DAY)%R.SECONDS_PER_DAY,f=s+c*l,d=Math.cos(f),h=Math.sin(f);return o(t)?(t[0]=d,t[1]=-h,t[2]=0,t[3]=h,t[4]=d,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new y(d,h,0,-h,d,0,0,0,1)},v.iau2006XysData=new h,v.earthOrientationParameters=c.NONE;var V=32.184,W=2451545;v.preloadIcrfFixed=function(t){var r=t.start.dayNumber,n=t.start.secondsOfDay+V,a=t.stop.dayNumber,i=t.stop.secondsOfDay+V,o=v.iau2006XysData.preload(r,n,a,i),u=v.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},v.computeIcrfToFixedMatrix=function(e,t){o(t)||(t=new y);var r=v.computeFixedToIcrfMatrix(e,t);if(o(r))return y.transpose(r,t)};var X=new E(0,0,0),H=new l(0,0,0,0,0,0),Y=new y,k=new y;v.computeFixedToIcrfMatrix=function(e,t){o(t)||(t=new y);var r=v.earthOrientationParameters.compute(e,H);if(o(r)){var n=e.dayNumber,a=e.secondsOfDay+V,i=v.iau2006XysData.computeXysRadians(n,a,X);if(o(i)){var u=i.x+r.xPoleOffset,s=i.y+r.yPoleOffset,c=1/(1+Math.sqrt(1-u*u-s*s)),l=Y;l[0]=1-c*u*u,l[3]=-c*u*s,l[6]=u,l[1]=-c*u*s,l[4]=1-c*s*s,l[7]=s,l[2]=-u,l[5]=-s,l[8]=1-c*(u*u+s*s);var f=y.fromRotationZ(-i.s,k),d=y.multiply(l,f,Y),h=e.dayNumber,E=e.secondsOfDay-m.computeTaiMinusUtc(e)+r.ut1MinusUtc,_=h-2451545,T=E/R.SECONDS_PER_DAY,A=.779057273264+T+.00273781191135448*(_+T);A=A%1*p.TWO_PI;var S=y.fromRotationZ(A,k),N=y.multiply(d,S,Y),I=Math.cos(r.xPoleWander),g=Math.cos(r.yPoleWander),O=Math.sin(r.xPoleWander),M=Math.sin(r.yPoleWander),w=n-W+a/R.SECONDS_PER_DAY;w/=36525;var x=-47e-6*w*p.RADIANS_PER_DEGREE/3600,P=Math.cos(x),C=Math.sin(x),D=k;return D[0]=I*P,D[1]=I*C,D[2]=O,D[3]=-g*C+M*O*P,D[4]=g*P+M*O*C,D[5]=-M*I,D[6]=-M*C-g*O*P,D[7]=M*P-g*O*C,D[8]=g*I,y.multiply(N,D,t)}}};var j=new n;v.pointToWindowCoordinates=function(e,t,r,n){return n=v.pointToGLWindowCoordinates(e,t,r,n),n.y=2*t[5]-n.y,n},v.pointToGLWindowCoordinates=function(e,r,a,i){o(i)||(i=new t);var u=j;return _.multiplyByVector(e,n.fromElements(a.x,a.y,a.z,1,u),u),n.multiplyByScalar(u,1/u.w,u),_.multiplyByVector(r,u,u),t.fromCartesian4(u,i)};var Z=new r,K=new r,J=new r;v.rotationMatrixFromPositionVelocity=function(e,t,n,a){var u=i(n,f.WGS84).geodeticSurfaceNormal(e,Z),s=r.cross(t,u,K);r.equalsEpsilon(s,r.ZERO,p.EPSILON6)&&(s=r.clone(r.UNIT_X,s));var c=r.cross(s,t,J);return r.cross(t,c,s),r.negate(s,s),o(a)||(a=new y),a[0]=t.x,a[1]=t.y,a[2]=t.z,a[3]=s.x,a[4]=s.y,a[5]=s.z,a[6]=c.x,a[7]=c.y,a[8]=c.z,a};var Q=new a,$=new r,ee=new r,te=new n,re=new n,ne=new n,ae=new n,ie=new n,oe=new _,ue=new _;return v.basisTo2D=function(e,t,a){var i=e.ellipsoid,o=_.getColumn(t,3,te),u=i.cartesianToCartographic(o,Q),s=v.eastNorthUpToFixedFrame(o,i,oe),c=_.inverseTransformation(s,ue),l=e.project(u,$),f=re;f.x=l.z,f.y=l.x,f.z=l.y,f.w=1;var d=_.getColumn(t,0,ee),h=r.magnitude(d),E=_.multiplyByVector(c,d,ne);n.fromElements(E.z,E.x,E.y,0,E);var m=_.getColumn(t,1,ee),p=r.magnitude(m),y=_.multiplyByVector(c,m,ae);n.fromElements(y.z,y.x,y.y,0,y);var T=_.getColumn(t,2,ee),R=r.magnitude(T),A=ie;return r.cross(E,y,A),r.normalize(A,A),r.cross(y,A,E),r.normalize(E,E),r.cross(A,E,y),r.normalize(y,y),r.multiplyByScalar(E,h,E),r.multiplyByScalar(y,p,y),r.multiplyByScalar(A,R,A),_.setColumn(a,0,E,a),_.setColumn(a,1,y,a),_.setColumn(a,2,A,a),_.setColumn(a,3,f,a),a},v}),define("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,r,n){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.position=e(t.position,!1),this.normal=e(t.normal,!1),this.st=e(t.st,!1),this.binormal=e(t.binormal,!1),this.tangent=e(t.tangent,!1),this.color=e(t.color,!1)}return a.POSITION_ONLY=n(new a({position:!0})),a.POSITION_AND_NORMAL=n(new a({position:!0,normal:!0})),a.POSITION_NORMAL_AND_ST=n(new a({position:!0,normal:!0,st:!0})),a.POSITION_AND_ST=n(new a({position:!0,st:!0})),a.POSITION_AND_COLOR=n(new a({position:!0,color:!0})),a.ALL=n(new a({position:!0,normal:!0,st:!0,binormal:!0,tangent:!0})),a.DEFAULT=a.POSITION_NORMAL_AND_ST,a.packedLength=6,a.pack=function(t,r,n){return n=e(n,0),r[n++]=t.position?1:0,r[n++]=t.normal?1:0,r[n++]=t.st?1:0,r[n++]=t.binormal?1:0,r[n++]=t.tangent?1:0,r[n++]=t.color?1:0,r},a.unpack=function(r,n,i){return n=e(n,0),t(i)||(i=new a),i.position=1===r[n++],i.normal=1===r[n++],i.st=1===r[n++],i.binormal=1===r[n++],i.tangent=1===r[n++],i.color=1===r[n++],i},a.clone=function(e,r){if(t(e))return t(r)||(r=new a),r.position=e.position,r.normal=e.normal,r.st=e.st,r.binormal=e.binormal,r.tangent=e.tangent,r.color=e.color,r},a}),define("Core/EllipseGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError","./EllipseGeometryLibrary","./Ellipsoid","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix3","./Matrix4","./PrimitiveType","./Quaternion","./Rectangle","./Transforms","./VertexFormat"],function(e,t,r,n,a,i,o,u,s,c,l,f,d,h,E,m,p,y,_,T,R,v,A,S,N,I){"use strict";function g(e,n,i){var o=n.vertexFormat,u=n.center,s=n.semiMajorAxis,l=n.semiMinorAxis,d=n.ellipsoid,m=n.stRotation,p=i?e.length/3*2:e.length/3,y=o.st?new Float32Array(2*p):void 0,_=o.normal?new Float32Array(3*p):void 0,R=o.tangent?new Float32Array(3*p):void 0,v=o.binormal?new Float32Array(3*p):void 0,S=0,N=q,I=V,g=W,O=new f(d),M=O.project(d.cartesianToCartographic(u,X),H),w=d.scaleToGeodeticSurface(u,L);d.geodeticSurfaceNormal(w,w);for(var x=A.fromAxisAngle(w,m,G),P=T.fromQuaternion(x,B),C=t.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Y),D=t.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,k),F=e.length,j=i?F:0,Z=j/3*2,K=0;K<F;K+=3){var J=K+1,Q=K+2,$=r.fromArray(e,K,L);if(o.st){var ee=T.multiplyByVector(P,$,U),te=O.project(d.cartesianToCartographic(ee,X),b);r.subtract(te,M,te),z.x=(te.x+s)/(2*s),z.y=(te.y+l)/(2*l),C.x=Math.min(z.x,C.x),C.y=Math.min(z.y,C.y),D.x=Math.max(z.x,D.x),D.y=Math.max(z.y,D.y),i&&(y[S+Z]=z.x,y[S+1+Z]=z.y),y[S++]=z.x,y[S++]=z.y}N=d.geodeticSurfaceNormal($,N),(o.normal||o.tangent||o.binormal)&&((o.tangent||o.binormal)&&(I=r.normalize(r.cross(r.UNIT_Z,N,I),I),T.multiplyByVector(P,I,I)),o.normal&&(_[K]=N.x,_[J]=N.y,_[Q]=N.z,i&&(_[K+j]=-N.x,_[J+j]=-N.y,_[Q+j]=-N.z)),o.tangent&&(R[K]=I.x,R[J]=I.y,R[Q]=I.z,i&&(R[K+j]=-I.x,R[J+j]=-I.y,R[Q+j]=-I.z)),o.binormal&&(g=r.normalize(r.cross(N,I,g),g),v[K]=g.x,v[J]=g.y,v[Q]=g.z,i&&(v[K+j]=g.x,v[J+j]=g.y,v[Q+j]=g.z)))}if(o.st){F=y.length;for(var re=0;re<F;re+=2)y[re]=(y[re]-C.x)/(D.x-C.x),y[re+1]=(y[re+1]-C.y)/(D.y-C.y)}var ne=new E;if(o.position){var ae=c.raisePositionsToHeight(e,n,i);ne.position=new h({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:ae})}return o.st&&(ne.st=new h({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:y})),o.normal&&(ne.normal=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:_})),o.tangent&&(ne.tangent=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:R})),o.binormal&&(ne.binormal=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:v})),ne}function O(e){var t,r,n,a,i,o=new Array(12*(e*(e+1))-6),u=0;for(t=0,n=1,a=0;a<3;a++)o[u++]=n++,o[u++]=t,o[u++]=n;for(a=2;a<e+1;++a){for(n=a*(a+1)-1,t=(a-1)*a-1,o[u++]=n++,o[u++]=t,o[u++]=n,r=2*a,i=0;i<r-1;++i)o[u++]=n,o[u++]=t++,o[u++]=t,o[u++]=n++,o[u++]=t,o[u++]=n;o[u++]=n++,o[u++]=t,o[u++]=n}for(r=2*e,++n,++t,a=0;a<r-1;++a)o[u++]=n,o[u++]=t++,o[u++]=t,o[u++]=n++,o[u++]=t,o[u++]=n;for(o[u++]=n,o[u++]=t++,o[u++]=t,o[u++]=n++,o[u++]=t++,o[u++]=t,++t,a=e-1;a>1;--a){for(o[u++]=t++,o[u++]=t,o[u++]=n,r=2*a,i=0;i<r-1;++i)o[u++]=n,o[u++]=t++,o[u++]=t,o[u++]=n++,o[u++]=t,o[u++]=n;o[u++]=t++,o[u++]=t++,o[u++]=n++}for(a=0;a<3;a++)o[u++]=t++,o[u++]=t,o[u++]=n;return o}function M(t){var n=t.center;j=r.multiplyByScalar(t.ellipsoid.geodeticSurfaceNormal(n,j),t.height,j),j=r.add(n,j,j);var a=new e(j,t.semiMajorAxis),i=c.computeEllipsePositions(t,!0,!1),o=i.positions,u=i.numPts,s=g(o,t,!1),l=O(u);return l=y.createTypedArray(o.length/3,l),{boundingSphere:a,attributes:s,indices:l}}function w(e,n){var i=n.vertexFormat,o=n.center,u=n.semiMajorAxis,s=n.semiMinorAxis,c=n.ellipsoid,l=n.height,d=n.extrudedHeight,m=n.stRotation,p=e.length/3*2,y=new Float64Array(3*p),_=i.st?new Float32Array(2*p):void 0,R=i.normal?new Float32Array(3*p):void 0,v=i.tangent?new Float32Array(3*p):void 0,S=i.binormal?new Float32Array(3*p):void 0,N=0,I=q,g=V,O=W,M=new f(c),w=M.project(c.cartesianToCartographic(o,X),H),x=c.scaleToGeodeticSurface(o,L);c.geodeticSurfaceNormal(x,x);for(var P=A.fromAxisAngle(x,m,G),C=T.fromQuaternion(P,B),D=t.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Y),j=t.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,k),Z=e.length,K=Z/3*2,J=0;J<Z;J+=3){var Q,$=J+1,ee=J+2,te=r.fromArray(e,J,L);if(i.st){var re=T.multiplyByVector(C,te,U),ne=M.project(c.cartesianToCartographic(re,X),b);r.subtract(ne,w,ne),z.x=(ne.x+u)/(2*u),z.y=(ne.y+s)/(2*s),D.x=Math.min(z.x,D.x),D.y=Math.min(z.y,D.y),j.x=Math.max(z.x,j.x),j.y=Math.max(z.y,j.y),_[N+K]=z.x,_[N+1+K]=z.y,_[N++]=z.x,_[N++]=z.y}te=c.scaleToGeodeticSurface(te,te),Q=r.clone(te,U),I=c.geodeticSurfaceNormal(te,I);var ae=r.multiplyByScalar(I,l,F);if(te=r.add(te,ae,te),ae=r.multiplyByScalar(I,d,ae),Q=r.add(Q,ae,Q),i.position&&(y[J+Z]=Q.x,y[$+Z]=Q.y,y[ee+Z]=Q.z,y[J]=te.x,y[$]=te.y,y[ee]=te.z),i.normal||i.tangent||i.binormal){O=r.clone(I,O);var ie=r.fromArray(e,(J+3)%Z,F);r.subtract(ie,te,ie);var oe=r.subtract(Q,te,b);I=r.normalize(r.cross(oe,ie,I),I),i.normal&&(R[J]=I.x,R[$]=I.y,R[ee]=I.z,R[J+Z]=I.x,R[$+Z]=I.y,R[ee+Z]=I.z),i.tangent&&(g=r.normalize(r.cross(O,I,g),g),v[J]=g.x,v[$]=g.y,v[ee]=g.z,v[J+Z]=g.x,v[J+1+Z]=g.y,v[J+2+Z]=g.z),i.binormal&&(S[J]=O.x,S[$]=O.y,S[ee]=O.z,S[J+Z]=O.x,S[$+Z]=O.y,S[ee+Z]=O.z)}}if(i.st){Z=_.length;for(var ue=0;ue<Z;ue+=2)_[ue]=(_[ue]-D.x)/(j.x-D.x),_[ue+1]=(_[ue+1]-D.y)/(j.y-D.y)}var se=new E;return i.position&&(se.position=new h({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:y})),i.st&&(se.st=new h({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:_})),i.normal&&(se.normal=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:R})),i.tangent&&(se.tangent=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:v})),i.binormal&&(se.binormal=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:S})),se}function x(e){for(var t=e.length/3,r=y.createTypedArray(t,6*t),n=0,a=0;a<t;a++){var i=a,o=a+t,u=(i+1)%t,s=u+t;r[n++]=i,r[n++]=o,r[n++]=u,r[n++]=u,r[n++]=o,r[n++]=s}return r}function P(t){var n=t.center,a=t.ellipsoid,i=t.semiMajorAxis,o=r.multiplyByScalar(a.geodeticSurfaceNormal(n,L),t.height,L);Z.center=r.add(n,o,Z.center),Z.radius=i,o=r.multiplyByScalar(a.geodeticSurfaceNormal(n,o),t.extrudedHeight,o),K.center=r.add(n,o,K.center),K.radius=i;var u=c.computeEllipsePositions(t,!0,!0),s=u.positions,l=u.numPts,f=u.outerPositions,h=e.union(Z,K),E=g(s,t,!0),_=O(l),T=_.length;_.length=2*T;for(var R=s.length/3,A=0;A<T;A+=3)_[A+T]=_[A+2]+R,_[A+1+T]=_[A+1]+R,_[A+2+T]=_[A]+R;var S=y.createTypedArray(2*R/3,_),N=new d({attributes:E,indices:S,primitiveType:v.TRIANGLES}),I=w(f,t);_=x(f);var M=y.createTypedArray(2*f.length/3,_),P=new d({attributes:I,indices:M,primitiveType:v.TRIANGLES}),C=p.combineInstances([new m({geometry:N}),new m({geometry:P})]);return{boundingSphere:h,attributes:C[0].attributes,indices:C[0].indices}}function C(e,t,n,a,i){N.eastNorthUpToFixedFrame(e,t,J),R.inverseTransformation(J,Q);for(var o=0;o<4;++o)r.clone(r.ZERO,ee[o]);for(ee[0].x+=n,ee[1].x-=n,ee[2].y+=a,ee[3].y-=a,T.fromRotationZ(i,$),o=0;o<4;++o)T.multiplyByVector($,ee[o],ee[o]),R.multiplyByPoint(J,ee[o],ee[o]),t.cartesianToCartographic(ee[o],te[o]);return S.fromCartographicArray(te)}function D(e){e=i(e,i.EMPTY_OBJECT);var t=e.center,n=i(e.ellipsoid,l.WGS84),a=e.semiMajorAxis,u=e.semiMinorAxis,s=i(e.granularity,_.RADIANS_PER_DEGREE),c=i(e.height,0),f=e.extrudedHeight,d=o(f)&&Math.abs(c-f)>1,h=i(e.vertexFormat,I.DEFAULT);this._center=r.clone(t),this._semiMajorAxis=a,this._semiMinorAxis=u,this._ellipsoid=l.clone(n),this._rotation=i(e.rotation,0),this._stRotation=i(e.stRotation,0),this._height=c,this._granularity=s,this._vertexFormat=I.clone(h),this._extrudedHeight=i(f,c),this._extrude=d,this._workerName="createEllipseGeometry",this._rectangle=C(this._center,this._ellipsoid,a,u,this._rotation)}var L=new r,U=new r,b=new r,F=new r,z=new t,B=new T,G=new A,q=new r,V=new r,W=new r,X=new n,H=new r,Y=new t,k=new t,j=new r,Z=new e,K=new e,J=new R,Q=new R,$=new T,ee=[new r,new r,new r,new r],te=[new n,new n,new n,new n];D.packedLength=r.packedLength+l.packedLength+I.packedLength+S.packedLength+8,D.pack=function(e,t,n){return n=i(n,0),r.pack(e._center,t,n),n+=r.packedLength,l.pack(e._ellipsoid,t,n),n+=l.packedLength,I.pack(e._vertexFormat,t,n),n+=I.packedLength,S.pack(e._rectangle,t,n),n+=S.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n]=e._extrude?1:0,t};var re=new r,ne=new l,ae=new I,ie=new S,oe={center:re,ellipsoid:ne,vertexFormat:ae,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0};return D.unpack=function(e,t,n){t=i(t,0);var a=r.unpack(e,t,re);t+=r.packedLength;var u=l.unpack(e,t,ne);t+=l.packedLength;var s=I.unpack(e,t,ae);t+=I.packedLength;var c=S.unpack(e,t,ie);t+=S.packedLength;var f=e[t++],d=e[t++],h=e[t++],E=e[t++],m=e[t++],p=e[t++],y=e[t++],_=1===e[t];return o(n)?(n._center=r.clone(a,n._center),n._ellipsoid=l.clone(u,n._ellipsoid),n._vertexFormat=I.clone(s,n._vertexFormat),n._semiMajorAxis=f,n._semiMinorAxis=d,n._rotation=h,n._stRotation=E,n._height=m,n._granularity=p,n._extrudedHeight=y,n._extrude=_,n._rectangle=S.clone(c),n):(oe.height=m,oe.extrudedHeight=y,oe.granularity=p,oe.stRotation=E,oe.rotation=h,oe.semiMajorAxis=f,oe.semiMinorAxis=d,new D(oe))},D.createGeometry=function(e){if(!(e._semiMajorAxis<=0||e._semiMinorAxis<=0)){e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);var t,r={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:e._height,extrudedHeight:e._extrudedHeight,granularity:e._granularity,vertexFormat:e._vertexFormat,stRotation:e._stRotation};return e._extrude?(r.extrudedHeight=Math.min(e._extrudedHeight,e._height),r.height=Math.max(e._extrudedHeight,e._height),t=P(r)):t=M(r),new d({attributes:t.attributes,indices:t.indices,primitiveType:v.TRIANGLES,boundingSphere:t.boundingSphere})}},D.createShadowVolume=function(e,t,r){var n=e._granularity,a=e._ellipsoid,i=t(n,a),o=r(n,a);return new D({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:a,rotation:e._rotation,stRotation:e._stRotation,granularity:n,extrudedHeight:i,height:o,vertexFormat:I.POSITION_ONLY})},u(D.prototype,{rectangle:{get:function(){return this._rectangle}}}),D}),define("Workers/createEllipseGeometry",["../Core/Cartesian3","../Core/defined","../Core/EllipseGeometry","../Core/Ellipsoid"],function(e,t,r,n){"use strict";function a(a,i){return t(i)&&(a=r.unpack(a,i)),a._center=e.clone(a._center),a._ellipsoid=n.clone(a._ellipsoid),r.createGeometry(a)}return a})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function r(e){return e+" is required, actual value was undefined"}function n(e,t,r){return"Expected "+r+" to be typeof "+t+", actual typeof was "+e}var a={};return a.typeOf={},a.defined=function(n,a){if(!e(a))throw new t(r(n))},a.typeOf.func=function(e,r){if("function"!=typeof r)throw new t(n(typeof r,"function",e))},a.typeOf.string=function(e,r){if("string"!=typeof r)throw new t(n(typeof r,"string",e))},a.typeOf.number=function(e,r){if("number"!=typeof r)throw new t(n(typeof r,"number",e))},a.typeOf.number.lessThan=function(e,r,n){if(a.typeOf.number(e,r),r>=n)throw new t("Expected "+e+" to be less than "+n+", actual value was "+r)},a.typeOf.number.lessThanOrEquals=function(e,r,n){if(a.typeOf.number(e,r),r>n)throw new t("Expected "+e+" to be less than or equal to "+n+", actual value was "+r)},a.typeOf.number.greaterThan=function(e,r,n){if(a.typeOf.number(e,r),r<=n)throw new t("Expected "+e+" to be greater than "+n+", actual value was "+r)},a.typeOf.number.greaterThanOrEquals=function(e,r,n){if(a.typeOf.number(e,r),r<n)throw new t("Expected "+e+" to be greater than or equal to"+n+", actual value was "+r)},a.typeOf.object=function(e,r){if("object"!=typeof r)throw new t(n(typeof r,"object",e))},a.typeOf.bool=function(e,r){if("boolean"!=typeof r)throw new t(n(typeof r,"boolean",e))},a}),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";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),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^=e<<7&2636928640,e^=e<<15&4022730752,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,r,n){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:e<0?-1:0},a.signNotZero=function(e){return e<0?-1:1},a.toSNorm=function(e,r){return r=t(r,255),Math.round((.5*a.clamp(e,-1,1)+.5)*r)},a.fromSNorm=function(e,r){return r=t(r,255),a.clamp(e,0,r)/r*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t-r)},a.cosh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t+r)},a.lerp=function(e,t,r){return(1-r)*e+r*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){var t=a.TWO_PI,r=e-Math.floor(e/t)*t;return r<-Math.PI?r+t:r>=Math.PI?r-t:r},a.clampToLatitudeRange=function(e){return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){return(e%t+t)%t},a.equalsEpsilon=function(e,r,n,a){a=t(a,n);var i=Math.abs(e-r);return i<=a||i<=n*Math.max(Math.abs(e),Math.abs(r))};var i=[1];a.factorial=function(e){var t=i.length;if(e>=t)for(var r=i[t-1],n=t;n<=e;n++)i.push(r*n);return i[e]},a.incrementWrap=function(e,r,n){return n=t(n,0),++e,e>r&&(e=n),e},a.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,r){return e<t?t:e>r?r:e};var o=new e;return a.setRandomNumberSeed=function(t){o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(e){return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){return Math.log(e)/Math.log(t)},a.fog=function(e,t){var r=e*t;return 1-Math.exp(-(r*r))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i){"use strict";function o(e,r,n){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0)}o.fromSpherical=function(e,n){r(n)||(n=new o);var a=e.clock,i=e.cone,u=t(e.magnitude,1),s=u*Math.sin(i);return n.x=s*Math.cos(a),n.y=s*Math.sin(a),n.z=u*Math.cos(i),n},o.fromElements=function(e,t,n,a){return r(a)?(a.x=e,a.y=t,a.z=n,a):new o(e,t,n)},o.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n]=e.z,r},o.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new o),a.x=e[n++],a.y=e[n++],a.z=e[n],a},o.packArray=function(e,t){var n=e.length;r(t)?t.length=3*n:t=new Array(3*n);for(var a=0;a<n;++a)o.pack(e[a],t,3*a);return t},o.unpackArray=function(e,t){var n=e.length;r(t)?t.length=n/3:t=new Array(n/3);for(var a=0;a<n;a+=3){var i=a/3;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},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},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},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},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},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},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},o.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r.z=e.z/t.z,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},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},o.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*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},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,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};var s=new o;o.lerp=function(e,t,r,n){return o.multiplyByScalar(t,r,s),n=o.multiplyByScalar(e,1-r,n),o.add(s,n,n)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var r=o.dot(c,l),n=o.magnitude(o.cross(c,l,c));return Math.atan2(n,r)};var f=new o;o.mostOrthogonalAxis=function(e,t){var r=o.normalize(e,f);return o.abs(r,r),t=r.x<=r.y?r.x<=r.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):r.y<=r.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},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,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]},o.equalsEpsilon=function(e,t,n,a){return e===t||r(e)&&r(t)&&i.equalsEpsilon(e.x,t.x,n,a)&&i.equalsEpsilon(e.y,t.y,n,a)&&i.equalsEpsilon(e.z,t.z,n,a)},o.cross=function(e,t,r){var n=e.x,a=e.y,i=e.z,o=t.x,u=t.y,s=t.z,c=a*s-i*u,l=i*o-n*s,f=n*u-a*o;return r.x=c,r.y=l,r.z=f,r},o.fromDegrees=function(e,t,r,n,a){return e=i.toRadians(e),t=i.toRadians(t),o.fromRadians(e,t,r,n,a)};var d=new o,h=new o,E=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,n,a,i,u){a=t(a,0);var s=r(i)?i.radiiSquared:E,c=Math.cos(n);d.x=c*Math.cos(e),d.y=c*Math.sin(e),d.z=Math.sin(n),d=o.normalize(d,d),o.multiplyComponents(s,d,h);var l=Math.sqrt(o.dot(d,h));return h=o.divideByScalar(h,l,h),d=o.multiplyByScalar(d,a,d),r(u)||(u=new o),o.add(h,d,u)},o.fromDegreesArray=function(e,t,n){var a=e.length;r(n)?n.length=a/2:n=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;n[c]=o.fromDegrees(u,s,0,t,n[c])}return n},o.fromRadiansArray=function(e,t,n){var a=e.length;r(n)?n.length=a/2:n=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;n[c]=o.fromRadians(u,s,0,t,n[c])}return n},o.fromDegreesArrayHeights=function(e,t,n){var a=e.length;r(n)?n.length=a/3:n=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;n[l]=o.fromDegrees(u,s,c,t,n[l])}return n},o.fromRadiansArrayHeights=function(e,t,n){var a=e.length;r(n)?n.length=a/3:n=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;n[l]=o.fromRadians(u,s,c,t,n[l])}return n},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(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,t,r){return o.equalsEpsilon(this,e,t,r)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,r,n){"use strict";function a(r,a,u,s,c){var l=r.x,f=r.y,d=r.z,h=a.x,E=a.y,p=a.z,m=l*l*h*h,y=f*f*E*E,_=d*d*p*p,T=m+y+_,v=Math.sqrt(1/T),R=e.multiplyByScalar(r,v,i);if(T<s)return isFinite(v)?e.clone(R,c):void 0;var A=u.x,S=u.y,N=u.z,I=o;I.x=R.x*A*2,I.y=R.y*S*2,I.z=R.z*N*2;var g,O,w,M,x,C,P,D,L,U,b,F=(1-v)*e.magnitude(r)/(.5*e.magnitude(I)),z=0;do{F-=z,w=1/(1+F*A),M=1/(1+F*S),x=1/(1+F*N),C=w*w,P=M*M,D=x*x,L=C*w,U=P*M,b=D*x,g=m*C+y*P+_*D-1,O=m*L*A+y*U*S+_*b*N;var B=-2*O;z=g/B}while(Math.abs(g)>n.EPSILON12);return t(c)?(c.x=l*w,c.y=f*M,c.z=d*x,c):new e(l*w,f*M,d*x)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,r,n,a,i,o){"use strict";function u(e,r,n){this.longitude=t(e,0),this.latitude=t(r,0),this.height=t(n,0)}u.fromRadians=function(e,n,a,i){return a=t(a,0),r(i)?(i.longitude=e,i.latitude=n,i.height=a,i):new u(e,n,a)},u.fromDegrees=function(e,t,r,n){return e=i.toRadians(e),t=i.toRadians(t),u.fromRadians(e,t,r,n)};var s=new e,c=new e,l=new e,f=new e(1/6378137,1/6378137,1/6356752.314245179),d=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),h=i.EPSILON1;return u.fromCartesian=function(t,n,a){var E=r(n)?n.oneOverRadii:f,p=r(n)?n.oneOverRadiiSquared:d,m=r(n)?n._centerToleranceSquared:h,y=o(t,E,p,m,c);if(r(y)){var _=e.multiplyComponents(y,p,s);_=e.normalize(_,_);var T=e.subtract(t,y,l),v=Math.atan2(_.y,_.x),R=Math.asin(_.z),A=i.sign(e.dot(T,t))*e.magnitude(T);return r(a)?(a.longitude=v,a.latitude=R,a.height=A,a):new u(v,R,A)}},u.clone=function(e,t){if(r(e))return r(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||r(e)&&r(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n},u.ZERO=a(new u(0,0,0)),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,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),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","./scaleToGeodeticSurface"],function(e,t,r,n,a,i,o,u,s){"use strict";function c(t,n,a,i){n=r(n,0),a=r(a,0),i=r(i,0),t._radii=new e(n,a,i),t._radiiSquared=new e(n*n,a*a,i*i),t._radiiToTheFourth=new e(n*n*n*n,a*a*a*a,i*i*i*i),t._oneOverRadii=new e(0===n?0:1/n,0===a?0:1/a,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===n?0:1/(n*n),0===a?0:1/(a*a),0===i?0:1/(i*i)),t._minimumRadius=Math.min(n,a,i),t._maximumRadius=Math.max(n,a,i),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(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,this._sqauredXOverSquaredZ=void 0,c(this,e,t,r)}a(l.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}}}),l.clone=function(t,r){if(n(t)){var a=t._radii;return n(r)?(e.clone(a,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 l(a.x,a.y,a.z)}},l.fromCartesian3=function(e,t){return n(t)||(t=new l),n(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,n,a){return a=r(a,0),e.pack(t._radii,n,a),n},l.unpack=function(t,n,a){n=r(n,0);var i=e.unpack(t,n);return l.fromCartesian3(i,a)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,r){var a=t.longitude,i=t.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return n(r)||(r=new e),r.x=u,r.y=s,r.z=c,e.normalize(r,r)},l.prototype.geodeticSurfaceNormal=function(t,r){return n(r)||(r=new e),r=e.multiplyComponents(t,this._oneOverRadiiSquared,r),e.normalize(r,r)};var f=new e,d=new e;l.prototype.cartographicToCartesian=function(t,r){var a=f,i=d;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(e.dot(a,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(a,t.height,a),n(r)||(r=new e),e.add(i,a,r)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var a=0;a<r;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var h=new e,E=new e,p=new e;return l.prototype.cartesianToCartographic=function(r,a){var i=this.scaleToGeodeticSurface(r,E);if(n(i)){var o=this.geodeticSurfaceNormal(i,h),s=e.subtract(r,i,p),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),f=u.sign(e.dot(s,r))*e.magnitude(s);return n(a)?(a.longitude=c,a.latitude=l,a.height=f,a):new t(c,l,f)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var a=0;a<r;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,r){n(r)||(r=new e);var a=t.x,i=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return e.multiplyByScalar(t,s,r)},l.prototype.transformPositionToScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._oneOverRadii,r)},l.prototype.transformPositionFromScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._radii,r)},l.prototype.equals=function(t){return this===t||n(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,a,i){a=r(a,0);var o=this._sqauredXOverSquaredZ;if(n(i)||(i=new e),i.x=0,i.y=0,i.z=t.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},l}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,r,n,a,i,o){"use strict";function u(e){this._ellipsoid=r(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,r){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return n(r)?(r.x=i,r.y=o,r.z=u,r):new e(i,o,u)},u.prototype.unproject=function(e,r){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,u=e.z;return n(r)?(r.longitude=i,r.latitude=o,r.height=u,r):new t(i,o,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";function t(t,r){this.start=e(t,0),this.stop=e(r,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i,o,u){"use strict";function s(e,t,n,a,i,o,u,s,c){this[0]=r(e,0),this[1]=r(a,0),this[2]=r(u,0),this[3]=r(t,0),this[4]=r(i,0),this[5]=r(s,0),this[6]=r(n,0),this[7]=r(o,0),this[8]=r(c,0)}function c(e){for(var t=0,r=0;r<9;++r){var n=e[r];t+=n*n}return Math.sqrt(t)}function l(e){for(var t=0,r=0;r<3;++r){var n=e[s.getElementIndex(p[r],E[r])];t+=2*n*n}return Math.sqrt(t)}function f(e,t){for(var r=u.EPSILON15,n=0,a=1,i=0;i<3;++i){var o=Math.abs(e[s.getElementIndex(p[i],E[i])]);o>n&&(a=i,n=o)}var c=1,l=0,f=E[a],d=p[a];if(Math.abs(e[s.getElementIndex(d,f)])>r){var h,m=e[s.getElementIndex(d,d)],y=e[s.getElementIndex(f,f)],_=e[s.getElementIndex(d,f)],T=(m-y)/2/_;h=T<0?-1/(-T+Math.sqrt(1+T*T)):1/(T+Math.sqrt(1+T*T)),c=1/Math.sqrt(1+h*h),l=h*c}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(f,f)]=t[s.getElementIndex(d,d)]=c,t[s.getElementIndex(d,f)]=l,t[s.getElementIndex(f,d)]=-l,t}s.packedLength=9,s.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t},s.unpack=function(e,t,a){return t=r(t,0),n(a)||(a=new s),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a},s.clone=function(e,t){if(n(e))return n(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 s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,a){return t=r(t,0),n(a)||(a=new s),a[0]=e[t],a[1]=e[t+1],a[2]=e[t+2],a[3]=e[t+3],a[4]=e[t+4],a[5]=e[t+5],a[6]=e[t+6],a[7]=e[t+7],a[8]=e[t+8],a},s.fromColumnMajorArray=function(e,t){return s.clone(e,t)},s.fromRowMajorArray=function(e,t){return n(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 s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var r=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,u=e.y*e.y,c=e.y*e.z,l=e.y*e.w,f=e.z*e.z,d=e.z*e.w,h=e.w*e.w,E=r-u-f+h,p=2*(a-d),m=2*(i+l),y=2*(a+d),_=-r+u-f+h,T=2*(c-o),v=2*(i-l),R=2*(c+o),A=-r-u+f+h;return n(t)?(t[0]=E,t[1]=y,t[2]=v,t[3]=p,t[4]=_,t[5]=R,t[6]=m,t[7]=T,t[8]=A,t):new s(E,p,m,y,_,T,v,R,A)},s.fromHeadingPitchRoll=function(e,t){var r=Math.cos(-e.pitch),a=Math.cos(-e.heading),i=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),c=Math.sin(e.roll),l=r*a,f=-i*u+c*o*a,d=c*u+i*o*a,h=r*u,E=i*a+c*o*u,p=-o*i+i*o*u,m=-o,y=c*r,_=i*r;return n(t)?(t[0]=l,t[1]=h,t[2]=m,t[3]=f,t[4]=E,t[5]=y,t[6]=d,t[7]=p,t[8]=_,t):new s(l,f,d,h,E,p,m,y,_)},s.fromScale=function(e,t){return n(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 s(e.x,0,0,0,e.y,0,0,0,e.z)},s.fromUniformScale=function(e,t){return n(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 s(e,0,0,0,e,0,0,0,e)},s.fromCrossProduct=function(e,t){return n(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 s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=r,t[5]=a,t[6]=0,t[7]=-a,t[8]=r,t):new s(1,0,0,0,r,-a,0,a,r)},s.fromRotationY=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=r,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=r,t):new s(r,0,a,0,1,0,-a,0,r)},s.fromRotationZ=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=r,t[1]=a,t[2]=0,t[3]=-a,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(r,-a,0,a,r,0,0,0,1)},s.toArray=function(e,t){return n(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]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,r){var n=3*t,a=e[n],i=e[n+1],o=e[n+2];return r.x=a,r.y=i,r.z=o,r},s.setColumn=function(e,t,r,n){n=s.clone(e,n);var a=3*t;return n[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n},s.getRow=function(e,t,r){var n=e[t],a=e[t+3],i=e[t+6];return r.x=n,r.y=a,r.z=i,r},s.setRow=function(e,t,r,n){return n=s.clone(e,n),n[t]=r.x,n[t+3]=r.y,n[t+6]=r.z,n};var d=new e;s.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],d)),r.y=e.magnitude(e.fromElements(t[3],t[4],t[5],d)),r.z=e.magnitude(e.fromElements(t[6],t[7],t[8],d)),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]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=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]=a,r[2]=i,r[3]=o,r[4]=u,r[5]=s,r[6]=c,r[7]=l,r[8]=f,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},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},s.multiplyByVector=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=e[0]*n+e[3]*a+e[6]*i,u=e[1]*n+e[4]*a+e[7]*i,s=e[2]*n+e[5]*a+e[8]*i;return r.x=o,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},s.multiplyByScale=function(e,t,r){return r[0]=e[0]*t.x,r[1]=e[1]*t.x,r[2]=e[2]*t.x,r[3]=e[3]*t.y,r[4]=e[4]*t.y,r[5]=e[5]*t.y,r[6]=e[6]*t.z,r[7]=e[7]*t.z,r[8]=e[8]*t.z,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},s.transpose=function(e,t){var r=e[0],n=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=r,t[1]=n,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var E=[1,0,0],p=[2,2,1],m=new s,y=new s;return s.computeEigenDecomposition=function(e,t){var r=u.EPSILON20,a=10,i=0,o=0;n(t)||(t={});for(var d=t.unitary=s.clone(s.IDENTITY,t.unitary),h=t.diagonal=s.clone(e,t.diagonal),E=r*c(h);o<a&&l(h)>E;)f(h,m),s.transpose(m,y),s.multiply(h,m,h),s.multiply(y,h,h),s.multiply(d,m,d),++i>2&&(++o,i=0);return 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},s.determinant=function(e){var t=e[0],r=e[3],n=e[6],a=e[1],i=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*o)+a*(s*n-r*c)+u*(r*o-i*n)},s.inverse=function(e,t){var r=e[0],n=e[1],a=e[2],i=e[3],o=e[4],u=e[5],c=e[6],l=e[7],f=e[8],d=s.determinant(e);t[0]=o*f-l*u,t[1]=l*a-n*f,t[2]=n*u-o*a,t[3]=c*u-i*f,t[4]=r*f-c*a,t[5]=i*a-r*u,t[6]=i*l-c*o,t[7]=c*n-r*l,t[8]=r*o-i*n;var h=1/d;return s.multiplyByScalar(t,h,t)},s.equals=function(e,t){return e===t||n(e)&&n(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]},s.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,a(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i){"use strict";function o(e,r,n,a){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0),this.w=t(a,0)}o.fromElements=function(e,t,n,a,i){return r(i)?(i.x=e,i.y=t,i.z=n,i.w=a,i):new o(e,t,n,a)},o.fromColor=function(e,t){return r(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(r(e))return 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)},o.packedLength=4,o.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n++]=e.z,r[n]=e.w,r},o.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new o),a.x=e[n++],a.y=e[n++],a.z=e[n++],a.w=e[n],a},o.packArray=function(e,t){var n=e.length;r(t)?t.length=4*n:t=new Array(4*n);for(var a=0;a<n;++a)o.pack(e[a],t,4*a);return t},o.unpackArray=function(e,t){var n=e.length;r(t)?t.length=n/4:t=new Array(n/4);for(var a=0;a<n;a+=4){var i=a/4;t[i]=o.unpack(e,a,t[i])}return t},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 u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},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.divideComponents=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 s=new o;o.lerp=function(e,t,r,n){return o.multiplyByScalar(t,r,s),n=o.multiplyByScalar(e,1-r,n),o.add(s,n,n)};var c=new o;return o.mostOrthogonalAxis=function(e,t){var r=o.normalize(e,c);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,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,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]&&e.w===t[r+3]},o.equalsEpsilon=function(e,t,n,a){return e===t||r(e)&&r(t)&&i.equalsEpsilon(e.x,t.x,n,a)&&i.equalsEpsilon(e.y,t.y,n,a)&&i.equalsEpsilon(e.z,t.z,n,a)&&i.equalsEpsilon(e.w,t.w,n,a)},o.ZERO=a(new o(0,0,0,0)),o.UNIT_X=a(new o(1,0,0,0)),o.UNIT_Y=a(new o(0,1,0,0)),o.UNIT_Z=a(new o(0,0,1,0)),o.UNIT_W=a(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,r){return o.equalsEpsilon(this,e,t,r)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,r,n,a,i,o,u,s,c,l){ +"use strict";function f(e,t,r,a,i,o,u,s,c,l,f,d,h,E,p,m){this[0]=n(e,0),this[1]=n(i,0),this[2]=n(c,0),this[3]=n(h,0),this[4]=n(t,0),this[5]=n(o,0),this[6]=n(l,0),this[7]=n(E,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(f,0),this[11]=n(p,0),this[12]=n(a,0),this[13]=n(s,0),this[14]=n(d,0),this[15]=n(m,0)}f.packedLength=16,f.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t[r++]=e[9],t[r++]=e[10],t[r++]=e[11],t[r++]=e[12],t[r++]=e[13],t[r++]=e[14],t[r]=e[15],t},f.unpack=function(e,t,r){return t=n(t,0),a(r)||(r=new f),r[0]=e[t++],r[1]=e[t++],r[2]=e[t++],r[3]=e[t++],r[4]=e[t++],r[5]=e[t++],r[6]=e[t++],r[7]=e[t++],r[8]=e[t++],r[9]=e[t++],r[10]=e[t++],r[11]=e[t++],r[12]=e[t++],r[13]=e[t++],r[14]=e[t++],r[15]=e[t],r},f.clone=function(e,t){if(a(e))return a(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 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])},f.fromArray=f.unpack,f.fromColumnMajorArray=function(e,t){return f.clone(e,t)},f.fromRowMajorArray=function(e,t){return a(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 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(t,r,i){return r=n(r,e.ZERO),a(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=r.x,i[13]=r.y,i[14]=r.z,i[15]=1,i):new f(t[0],t[3],t[6],r.x,t[1],t[4],t[7],r.y,t[2],t[5],t[8],r.z,0,0,0,1)},f.fromTranslationQuaternionRotationScale=function(e,t,r,n){a(n)||(n=new f);var i=r.x,o=r.y,u=r.z,s=t.x*t.x,c=t.x*t.y,l=t.x*t.z,d=t.x*t.w,h=t.y*t.y,E=t.y*t.z,p=t.y*t.w,m=t.z*t.z,y=t.z*t.w,_=t.w*t.w,T=s-h-m+_,v=2*(c-y),R=2*(l+p),A=2*(c+y),S=-s+h-m+_,N=2*(E-d),I=2*(l-p),g=2*(E+d),O=-s-h+m+_;return n[0]=T*i,n[1]=A*i,n[2]=I*i,n[3]=0,n[4]=v*o,n[5]=S*o,n[6]=g*o,n[7]=0,n[8]=R*u,n[9]=N*u,n[10]=O*u,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n},f.fromTranslationRotationScale=function(e,t){return f.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},f.fromTranslation=function(e,t){return f.fromRotationTranslation(c.IDENTITY,e,t)},f.fromScale=function(e,t){return a(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 f(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},f.fromUniformScale=function(e,t){return a(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 f(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var d=new e,h=new e,E=new e;f.fromCamera=function(t,r){var n=t.position,i=t.direction,o=t.up;e.normalize(i,d),e.normalize(e.cross(d,o,h),h),e.normalize(e.cross(h,d,E),E);var u=h.x,s=h.y,c=h.z,l=d.x,p=d.y,m=d.z,y=E.x,_=E.y,T=E.z,v=n.x,R=n.y,A=n.z,S=u*-v+s*-R+c*-A,N=y*-v+_*-R+T*-A,I=l*v+p*R+m*A;return a(r)?(r[0]=u,r[1]=y,r[2]=-l,r[3]=0,r[4]=s,r[5]=_,r[6]=-p,r[7]=0,r[8]=c,r[9]=T,r[10]=-m,r[11]=0,r[12]=S,r[13]=N,r[14]=I,r[15]=1,r):new f(u,s,c,S,y,_,T,N,-l,-p,-m,I,0,0,0,1)},f.computePerspectiveFieldOfView=function(e,t,r,n,a){var i=Math.tan(.5*e),o=1/i,u=o/t,s=(n+r)/(r-n),c=2*n*r/(r-n);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=c,a[15]=0,a},f.computeOrthographicOffCenter=function(e,t,r,n,a,i,o){var u=1/(t-e),s=1/(n-r),c=1/(i-a),l=-(t+e)*u,f=-(n+r)*s,d=-(i+a)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=f,o[14]=d,o[15]=1,o},f.computePerspectiveOffCenter=function(e,t,r,n,a,i,o){var u=2*a/(t-e),s=2*a/(n-r),c=(t+e)/(t-e),l=(n+r)/(n-r),f=-(i+a)/(i-a),d=-1,h=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=f,o[11]=d,o[12]=0,o[13]=0,o[14]=h,o[15]=0,o},f.computeInfinitePerspectiveOffCenter=function(e,t,r,n,a,i){var o=2*a/(t-e),u=2*a/(n-r),s=(t+e)/(t-e),c=(n+r)/(n-r),l=-1,f=-1,d=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=s,i[9]=c,i[10]=l,i[11]=f,i[12]=0,i[13]=0,i[14]=d,i[15]=0,i},f.computeViewportTransformation=function(e,t,r,a){e=n(e,n.EMPTY_OBJECT);var i=n(e.x,0),o=n(e.y,0),u=n(e.width,0),s=n(e.height,0);t=n(t,0),r=n(r,1);var c=.5*u,l=.5*s,f=.5*(r-t),d=c,h=l,E=f,p=i+c,m=o+l,y=t+f,_=1;return a[0]=d,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=h,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=E,a[11]=0,a[12]=p,a[13]=m,a[14]=y,a[15]=_,a},f.computeView=function(t,r,n,a,i){return i[0]=a.x,i[1]=n.x,i[2]=-r.x,i[3]=0,i[4]=a.y,i[5]=n.y,i[6]=-r.y,i[7]=0,i[8]=a.z,i[9]=n.z,i[10]=-r.z,i[11]=0,i[12]=-e.dot(a,t),i[13]=-e.dot(n,t),i[14]=e.dot(r,t),i[15]=1,i},f.toArray=function(e,t){return a(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]]},f.getElementIndex=function(e,t){return 4*e+t},f.getColumn=function(e,t,r){var n=4*t,a=e[n],i=e[n+1],o=e[n+2],u=e[n+3];return r.x=a,r.y=i,r.z=o,r.w=u,r},f.setColumn=function(e,t,r,n){n=f.clone(e,n);var a=4*t;return n[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n[a+3]=r.w,n},f.setTranslation=function(e,t,r){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]=t.x,r[13]=t.y,r[14]=t.z,r[15]=e[15],r},f.getRow=function(e,t,r){var n=e[t],a=e[t+4],i=e[t+8],o=e[t+12];return r.x=n,r.y=a,r.z=i,r.w=o,r},f.setRow=function(e,t,r,n){return n=f.clone(e,n),n[t]=r.x,n[t+4]=r.y,n[t+8]=r.z,n[t+12]=r.w,n};var p=new e;f.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],p)),r.y=e.magnitude(e.fromElements(t[4],t[5],t[6],p)),r.z=e.magnitude(e.fromElements(t[8],t[9],t[10],p)),r};var m=new e;f.getMaximumScale=function(t){return f.getScale(t,m),e.maximumComponent(m)},f.multiply=function(e,t,r){var n=e[0],a=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],f=e[8],d=e[9],h=e[10],E=e[11],p=e[12],m=e[13],y=e[14],_=e[15],T=t[0],v=t[1],R=t[2],A=t[3],S=t[4],N=t[5],I=t[6],g=t[7],O=t[8],w=t[9],M=t[10],x=t[11],C=t[12],P=t[13],D=t[14],L=t[15],U=n*T+u*v+f*R+p*A,b=a*T+s*v+d*R+m*A,F=i*T+c*v+h*R+y*A,z=o*T+l*v+E*R+_*A,B=n*S+u*N+f*I+p*g,G=a*S+s*N+d*I+m*g,q=i*S+c*N+h*I+y*g,V=o*S+l*N+E*I+_*g,W=n*O+u*w+f*M+p*x,X=a*O+s*w+d*M+m*x,H=i*O+c*w+h*M+y*x,Y=o*O+l*w+E*M+_*x,k=n*C+u*P+f*D+p*L,j=a*C+s*P+d*D+m*L,Z=i*C+c*P+h*D+y*L,K=o*C+l*P+E*D+_*L;return r[0]=U,r[1]=b,r[2]=F,r[3]=z,r[4]=B,r[5]=G,r[6]=q,r[7]=V,r[8]=W,r[9]=X,r[10]=H,r[11]=Y,r[12]=k,r[13]=j,r[14]=Z,r[15]=K,r},f.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},f.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},f.multiplyTransformation=function(e,t,r){var n=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],d=e[12],h=e[13],E=e[14],p=t[0],m=t[1],y=t[2],_=t[4],T=t[5],v=t[6],R=t[8],A=t[9],S=t[10],N=t[12],I=t[13],g=t[14],O=n*p+o*m+c*y,w=a*p+u*m+l*y,M=i*p+s*m+f*y,x=n*_+o*T+c*v,C=a*_+u*T+l*v,P=i*_+s*T+f*v,D=n*R+o*A+c*S,L=a*R+u*A+l*S,U=i*R+s*A+f*S,b=n*N+o*I+c*g+d,F=a*N+u*I+l*g+h,z=i*N+s*I+f*g+E;return r[0]=O,r[1]=w,r[2]=M,r[3]=0,r[4]=x,r[5]=C,r[6]=P,r[7]=0,r[8]=D,r[9]=L,r[10]=U,r[11]=0,r[12]=b,r[13]=F,r[14]=z,r[15]=1,r},f.multiplyByMatrix3=function(e,t,r){var n=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],d=t[0],h=t[1],E=t[2],p=t[3],m=t[4],y=t[5],_=t[6],T=t[7],v=t[8],R=n*d+o*h+c*E,A=a*d+u*h+l*E,S=i*d+s*h+f*E,N=n*p+o*m+c*y,I=a*p+u*m+l*y,g=i*p+s*m+f*y,O=n*_+o*T+c*v,w=a*_+u*T+l*v,M=i*_+s*T+f*v;return r[0]=R,r[1]=A,r[2]=S,r[3]=0,r[4]=N,r[5]=I,r[6]=g,r[7]=0,r[8]=O,r[9]=w,r[10]=M,r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r},f.multiplyByTranslation=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=n*e[0]+a*e[4]+i*e[8]+e[12],u=n*e[1]+a*e[5]+i*e[9]+e[13],s=n*e[2]+a*e[6]+i*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]=o,r[13]=u,r[14]=s,r[15]=e[15],r};var y=new e;f.multiplyByUniformScale=function(e,t,r){return y.x=t,y.y=t,y.z=t,f.multiplyByScale(e,y,r)},f.multiplyByScale=function(e,t,r){var n=t.x,a=t.y,i=t.z;return 1===n&&1===a&&1===i?f.clone(e,r):(r[0]=n*e[0],r[1]=n*e[1],r[2]=n*e[2],r[3]=0,r[4]=a*e[4],r[5]=a*e[5],r[6]=a*e[6],r[7]=0,r[8]=i*e[8],r[9]=i*e[9],r[10]=i*e[10],r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=1,r)},f.multiplyByVector=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=t.w,u=e[0]*n+e[4]*a+e[8]*i+e[12]*o,s=e[1]*n+e[5]*a+e[9]*i+e[13]*o,c=e[2]*n+e[6]*a+e[10]*i+e[14]*o,l=e[3]*n+e[7]*a+e[11]*i+e[15]*o;return r.x=u,r.y=s,r.z=c,r.w=l,r},f.multiplyByPointAsVector=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=e[0]*n+e[4]*a+e[8]*i,u=e[1]*n+e[5]*a+e[9]*i,s=e[2]*n+e[6]*a+e[10]*i;return r.x=o,r.y=u,r.z=s,r},f.multiplyByPoint=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=e[0]*n+e[4]*a+e[8]*i+e[12],u=e[1]*n+e[5]*a+e[9]*i+e[13],s=e[2]*n+e[6]*a+e[10]*i+e[14];return r.x=o,r.y=u,r.z=s,r},f.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},f.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},f.transpose=function(e,t){var r=e[1],n=e[2],a=e[3],i=e[6],o=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]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=o,t[14]=u,t[15]=e[15],t},f.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},f.equals=function(e,t){return e===t||a(e)&&a(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},f.equalsEpsilon=function(e,t,r){return e===t||a(e)&&a(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r&&Math.abs(e[9]-t[9])<=r&&Math.abs(e[10]-t[10])<=r&&Math.abs(e[11]-t[11])<=r&&Math.abs(e[12]-t[12])<=r&&Math.abs(e[13]-t[13])<=r&&Math.abs(e[14]-t[14])<=r&&Math.abs(e[15]-t[15])<=r},f.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},f.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};var _=new c,T=new c,v=new t,R=new t(0,0,0,1);return f.inverse=function(e,r){if(c.equalsEpsilon(f.getRotation(e,_),T,s.EPSILON7)&&t.equals(f.getRow(e,3,v),R))return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=0,r[11]=0,r[12]=-e[12],r[13]=-e[13],r[14]=-e[14],r[15]=1,r;var n=e[0],a=e[4],i=e[8],o=e[12],u=e[1],d=e[5],h=e[9],E=e[13],p=e[2],m=e[6],y=e[10],A=e[14],S=e[3],N=e[7],I=e[11],g=e[15],O=y*g,w=A*I,M=m*g,x=A*N,C=m*I,P=y*N,D=p*g,L=A*S,U=p*I,b=y*S,F=p*N,z=m*S,B=O*d+x*h+C*E-(w*d+M*h+P*E),G=w*u+D*h+b*E-(O*u+L*h+U*E),q=M*u+L*d+F*E-(x*u+D*d+z*E),V=P*u+U*d+z*h-(C*u+b*d+F*h),W=w*a+M*i+P*o-(O*a+x*i+C*o),X=O*n+L*i+U*o-(w*n+D*i+b*o),H=x*n+D*a+z*o-(M*n+L*a+F*o),Y=C*n+b*a+F*i-(P*n+U*a+z*i);O=i*E,w=o*h,M=a*E,x=o*d,C=a*h,P=i*d,D=n*E,L=o*u,U=n*h,b=i*u,F=n*d,z=a*u;var k=O*N+x*I+C*g-(w*N+M*I+P*g),j=w*S+D*I+b*g-(O*S+L*I+U*g),Z=M*S+L*N+F*g-(x*S+D*N+z*g),K=P*S+U*N+z*I-(C*S+b*N+F*I),J=M*y+P*A+w*m-(C*A+O*m+x*y),Q=U*A+O*p+L*y-(D*y+b*A+w*p),$=D*m+z*A+x*p-(F*A+M*p+L*m),ee=F*y+C*p+b*m-(U*m+z*y+P*p),te=n*B+a*G+i*q+o*V;if(Math.abs(te)<s.EPSILON20)throw new l("matrix is not invertible because its determinate is zero.");return te=1/te,r[0]=B*te,r[1]=G*te,r[2]=q*te,r[3]=V*te,r[4]=W*te,r[5]=X*te,r[6]=H*te,r[7]=Y*te,r[8]=k*te,r[9]=j*te,r[10]=Z*te,r[11]=K*te,r[12]=J*te,r[13]=Q*te,r[14]=$*te,r[15]=ee*te,r},f.inverseTransformation=function(e,t){var r=e[0],n=e[1],a=e[2],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],f=e[12],d=e[13],h=e[14],E=-r*f-n*d-a*h,p=-i*f-o*d-u*h,m=-s*f-c*d-l*h;return t[0]=r,t[1]=i,t[2]=s,t[3]=0,t[4]=n,t[5]=o,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=l,t[11]=0,t[12]=E,t[13]=p,t[14]=m,t[15]=1,t},f.IDENTITY=u(new f(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),f.ZERO=u(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,i(f.prototype,{length:{get:function(){return f.packedLength}}}),f.prototype.clone=function(e){return f.clone(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]&&e[9]===t[r+9]&&e[10]===t[r+10]&&e[11]===t[r+11]&&e[12]===t[r+12]&&e[13]===t[r+13]&&e[14]===t[r+14]&&e[15]===t[r+15]},f.prototype.equalsEpsilon=function(e,t){return f.equalsEpsilon(this,e,t)},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/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,r,n,a,i,o,u,s){"use strict";function c(e,t,n,a){this.west=r(e,0),this.south=r(t,0),this.east=r(n,0),this.north=r(a,0)}a(c.prototype,{width:{get:function(){return c.computeWidth(this)}},height:{get:function(){return c.computeHeight(this)}}}),c.packedLength=4,c.pack=function(e,t,n){return n=r(n,0),t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t},c.unpack=function(e,t,a){return t=r(t,0),n(a)||(a=new c),a.west=e[t++],a.south=e[t++],a.east=e[t++],a.north=e[t],a},c.computeWidth=function(e){var t=e.east,r=e.west;return t<r&&(t+=s.TWO_PI),t-r},c.computeHeight=function(e){return e.north-e.south},c.fromDegrees=function(e,t,a,i,o){return e=s.toRadians(r(e,0)),t=s.toRadians(r(t,0)),a=s.toRadians(r(a,0)),i=s.toRadians(r(i,0)),n(o)?(o.west=e,o.south=t,o.east=a,o.north=i,o):new c(e,t,a,i)},c.fromRadians=function(e,t,a,i,o){return n(o)?(o.west=r(e,0),o.south=r(t,0),o.east=r(a,0),o.north=r(i,0),o):new c(e,t,a,i)},c.fromCartographicArray=function(e,t){for(var r=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,u=Number.MAX_VALUE,l=-Number.MAX_VALUE,f=0,d=e.length;f<d;f++){var h=e[f];r=Math.min(r,h.longitude),a=Math.max(a,h.longitude),u=Math.min(u,h.latitude),l=Math.max(l,h.latitude);var E=h.longitude>=0?h.longitude:h.longitude+s.TWO_PI;i=Math.min(i,E),o=Math.max(o,E)}return a-r>o-i&&(r=i,a=o,a>s.PI&&(a-=s.TWO_PI),r>s.PI&&(r-=s.TWO_PI)),n(t)?(t.west=r,t.south=u,t.east=a,t.north=l,t):new c(r,u,a,l)},c.fromCartesianArray=function(e,t,r){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,u=-Number.MAX_VALUE,l=Number.MAX_VALUE,f=-Number.MAX_VALUE,d=0,h=e.length;d<h;d++){var E=t.cartesianToCartographic(e[d]);a=Math.min(a,E.longitude),i=Math.max(i,E.longitude),l=Math.min(l,E.latitude),f=Math.max(f,E.latitude);var p=E.longitude>=0?E.longitude:E.longitude+s.TWO_PI;o=Math.min(o,p),u=Math.max(u,p)}return i-a>u-o&&(a=o,i=u,i>s.PI&&(i-=s.TWO_PI),a>s.PI&&(a-=s.TWO_PI)),n(r)?(r.west=a,r.south=l,r.east=i,r.north=f,r):new c(a,l,i,f)},c.clone=function(e,t){if(n(e))return n(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new c(e.west,e.south,e.east,e.north)},c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.equals=function(e,t){return e===t||n(e)&&n(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},c.prototype.equalsEpsilon=function(e,t){return n(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},c.validate=function(e){},c.southwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.south,r.height=0,r):new e(t.west,t.south)},c.northwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.north,r.height=0,r):new e(t.west,t.north)},c.northeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.north,r.height=0,r):new e(t.east,t.north)},c.southeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.south,r.height=0,r):new e(t.east,t.south)},c.center=function(t,r){var a=t.east,i=t.west;a<i&&(a+=s.TWO_PI);var o=s.negativePiToPi(.5*(i+a)),u=.5*(t.south+t.north);return n(r)?(r.longitude=o,r.latitude=u,r.height=0,r):new e(o,u)},c.intersection=function(e,t,r){var a=e.east,i=e.west,o=t.east,u=t.west;a<i&&o>0?a+=s.TWO_PI:o<u&&a>0&&(o+=s.TWO_PI),a<i&&u<0?u+=s.TWO_PI:o<u&&i<0&&(i+=s.TWO_PI);var l=s.negativePiToPi(Math.max(i,u)),f=s.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&f<=l)){var d=Math.max(e.south,t.south),h=Math.min(e.north,t.north);if(!(d>=h))return n(r)?(r.west=l,r.south=d,r.east=f,r.north=h,r):new c(l,d,f,h)}},c.simpleIntersection=function(e,t,r){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(i>=u||a>=o))return n(r)?(r.west=a,r.south=i,r.east=o,r.north=u,r):new c(a,i,o,u)},c.union=function(e,t,r){n(r)||(r=new c);var a=e.east,i=e.west,o=t.east,u=t.west;a<i&&o>0?a+=s.TWO_PI:o<u&&a>0&&(o+=s.TWO_PI),a<i&&u<0?u+=s.TWO_PI:o<u&&i<0&&(i+=s.TWO_PI);var l=s.convertLongitudeRange(Math.min(i,u)),f=s.convertLongitudeRange(Math.max(a,o));return r.west=l,r.south=Math.min(e.south,t.south),r.east=f,r.north=Math.max(e.north,t.north),r},c.expand=function(e,t,r){return n(r)||(r=new c),r.west=Math.min(e.west,t.longitude),r.south=Math.min(e.south,t.latitude),r.east=Math.max(e.east,t.longitude),r.north=Math.max(e.north,t.latitude),r},c.contains=function(e,t){var r=t.longitude,n=t.latitude,a=e.west,i=e.east;return i<a&&(i+=s.TWO_PI,r<0&&(r+=s.TWO_PI)),(r>a||s.equalsEpsilon(r,a,s.EPSILON14))&&(r<i||s.equalsEpsilon(r,i,s.EPSILON14))&&n>=e.south&&n<=e.north};var l=new e;return c.subsample=function(e,t,a,i){t=r(t,o.WGS84),a=r(a,0),n(i)||(i=[]);var u=0,f=e.north,d=e.south,h=e.east,E=e.west,p=l;p.height=a,p.longitude=E,p.latitude=f,i[u]=t.cartographicToCartesian(p,i[u]),u++,p.longitude=h,i[u]=t.cartographicToCartesian(p,i[u]),u++,p.latitude=d,i[u]=t.cartographicToCartesian(p,i[u]),u++,p.longitude=E,i[u]=t.cartographicToCartesian(p,i[u]),u++,f<0?p.latitude=f:d>0?p.latitude=d:p.latitude=0;for(var m=1;m<8;++m)p.longitude=-Math.PI+m*s.PI_OVER_TWO,c.contains(e,p)&&(i[u]=t.cartographicToCartesian(p,i[u]),u++);return 0===p.latitude&&(p.longitude=E,i[u]=t.cartographicToCartesian(p,i[u]),u++,p.longitude=h,i[u]=t.cartographicToCartesian(p,i[u]),u++),i.length=u,i},c.MAX_VALUE=u(new c(-Math.PI,-s.PI_OVER_TWO,Math.PI,s.PI_OVER_TWO)),c}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,r,n,a,i,o,u,s,c,l,f){"use strict";function d(t,r){this.center=e.clone(n(t,e.ZERO)),this.radius=n(r,0)}var h=new e,E=new e,p=new e,m=new e,y=new e,_=new e,T=new e,v=new e,R=new e,A=new e,S=new e,N=new e;d.fromPoints=function(t,r){if(a(r)||(r=new d),!a(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;for(var n=e.clone(t[0],T),i=e.clone(n,h),o=e.clone(n,E),u=e.clone(n,p),s=e.clone(n,m),c=e.clone(n,y),l=e.clone(n,_),f=t.length,I=1;I<f;I++){e.clone(t[I],n);var g=n.x,O=n.y,w=n.z;g<i.x&&e.clone(n,i),g>s.x&&e.clone(n,s),O<o.y&&e.clone(n,o),O>c.y&&e.clone(n,c),w<u.z&&e.clone(n,u),w>l.z&&e.clone(n,l)}var M=e.magnitudeSquared(e.subtract(s,i,v)),x=e.magnitudeSquared(e.subtract(c,o,v)),C=e.magnitudeSquared(e.subtract(l,u,v)),P=i,D=s,L=M;x>L&&(L=x,P=o,D=c),C>L&&(L=C,P=u,D=l);var U=R;U.x=.5*(P.x+D.x),U.y=.5*(P.y+D.y),U.z=.5*(P.z+D.z);var b=e.magnitudeSquared(e.subtract(D,U,v)),F=Math.sqrt(b),z=A;z.x=i.x,z.y=o.y,z.z=u.z;var B=S;B.x=s.x,B.y=c.y,B.z=l.z;var G=e.multiplyByScalar(e.add(z,B,v),.5,N),q=0;for(I=0;I<f;I++){e.clone(t[I],n);var V=e.magnitude(e.subtract(n,G,v));V>q&&(q=V);var W=e.magnitudeSquared(e.subtract(n,U,v));if(W>b){var X=Math.sqrt(W);F=.5*(F+X),b=F*F;var H=X-F;U.x=(F*U.x+H*n.x)/X,U.y=(F*U.y+H*n.y)/X,U.z=(F*U.z+H*n.z)/X}}return F<q?(e.clone(U,r.center),r.radius=F):(e.clone(G,r.center),r.radius=q),r};var I=new o,g=new e,O=new e,w=new t,M=new t;d.fromRectangle2D=function(e,t,r){return d.fromRectangleWithHeights2D(e,t,0,0,r)},d.fromRectangleWithHeights2D=function(t,r,i,o,u){if(a(u)||(u=new d),!a(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;r=n(r,I),f.southwest(t,w),w.height=i,f.northeast(t,M),M.height=o;var s=r.project(w,g),c=r.project(M,O),l=c.x-s.x,h=c.y-s.y,E=c.z-s.z;u.radius=.5*Math.sqrt(l*l+h*h+E*E);var p=u.center;return p.x=s.x+.5*l,p.y=s.y+.5*h,p.z=s.z+.5*E,u};var x=[];d.fromRectangle3D=function(e,t,r,o){t=n(t,i.WGS84),r=n(r,0);var u;return a(e)&&(u=f.subsample(e,t,r,x)),d.fromPoints(u,o)},d.fromVertices=function(t,r,i,o){if(a(o)||(o=new d),!a(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;r=n(r,e.ZERO),i=n(i,3);var u=T;u.x=t[0]+r.x,u.y=t[1]+r.y,u.z=t[2]+r.z;for(var s=e.clone(u,h),c=e.clone(u,E),l=e.clone(u,p),f=e.clone(u,m),I=e.clone(u,y),g=e.clone(u,_),O=t.length,w=0;w<O;w+=i){var M=t[w]+r.x,x=t[w+1]+r.y,C=t[w+2]+r.z;u.x=M,u.y=x,u.z=C,M<s.x&&e.clone(u,s),M>f.x&&e.clone(u,f),x<c.y&&e.clone(u,c),x>I.y&&e.clone(u,I),C<l.z&&e.clone(u,l),C>g.z&&e.clone(u,g)}var P=e.magnitudeSquared(e.subtract(f,s,v)),D=e.magnitudeSquared(e.subtract(I,c,v)),L=e.magnitudeSquared(e.subtract(g,l,v)),U=s,b=f,F=P;D>F&&(F=D,U=c,b=I),L>F&&(F=L,U=l,b=g);var z=R;z.x=.5*(U.x+b.x),z.y=.5*(U.y+b.y),z.z=.5*(U.z+b.z);var B=e.magnitudeSquared(e.subtract(b,z,v)),G=Math.sqrt(B),q=A;q.x=s.x,q.y=c.y,q.z=l.z;var V=S;V.x=f.x,V.y=I.y,V.z=g.z;var W=e.multiplyByScalar(e.add(q,V,v),.5,N),X=0;for(w=0;w<O;w+=i){u.x=t[w]+r.x,u.y=t[w+1]+r.y,u.z=t[w+2]+r.z;var H=e.magnitude(e.subtract(u,W,v));H>X&&(X=H);var Y=e.magnitudeSquared(e.subtract(u,z,v));if(Y>B){var k=Math.sqrt(Y);G=.5*(G+k),B=G*G;var j=k-G;z.x=(G*z.x+j*u.x)/k,z.y=(G*z.y+j*u.y)/k,z.z=(G*z.z+j*u.z)/k}}return G<X?(e.clone(z,o.center),o.radius=G):(e.clone(W,o.center),o.radius=X),o},d.fromEncodedCartesianVertices=function(t,r,n){if(a(n)||(n=new d),!a(t)||!a(r)||t.length!==r.length||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var i=T;i.x=t[0]+r[0],i.y=t[1]+r[1],i.z=t[2]+r[2];for(var o=e.clone(i,h),u=e.clone(i,E),s=e.clone(i,p),c=e.clone(i,m),l=e.clone(i,y),f=e.clone(i,_),I=t.length,g=0;g<I;g+=3){var O=t[g]+r[g],w=t[g+1]+r[g+1],M=t[g+2]+r[g+2];i.x=O,i.y=w,i.z=M,O<o.x&&e.clone(i,o),O>c.x&&e.clone(i,c),w<u.y&&e.clone(i,u),w>l.y&&e.clone(i,l),M<s.z&&e.clone(i,s),M>f.z&&e.clone(i,f)}var x=e.magnitudeSquared(e.subtract(c,o,v)),C=e.magnitudeSquared(e.subtract(l,u,v)),P=e.magnitudeSquared(e.subtract(f,s,v)),D=o,L=c,U=x;C>U&&(U=C,D=u,L=l),P>U&&(U=P,D=s,L=f);var b=R;b.x=.5*(D.x+L.x),b.y=.5*(D.y+L.y),b.z=.5*(D.z+L.z);var F=e.magnitudeSquared(e.subtract(L,b,v)),z=Math.sqrt(F),B=A;B.x=o.x,B.y=u.y,B.z=s.z;var G=S;G.x=c.x,G.y=l.y,G.z=f.z;var q=e.multiplyByScalar(e.add(B,G,v),.5,N),V=0;for(g=0;g<I;g+=3){i.x=t[g]+r[g],i.y=t[g+1]+r[g+1],i.z=t[g+2]+r[g+2];var W=e.magnitude(e.subtract(i,q,v));W>V&&(V=W);var X=e.magnitudeSquared(e.subtract(i,b,v));if(X>F){var H=Math.sqrt(X);z=.5*(z+H),F=z*z;var Y=H-z;b.x=(z*b.x+Y*i.x)/H,b.y=(z*b.y+Y*i.y)/H,b.z=(z*b.z+Y*i.z)/H}}return z<V?(e.clone(b,n.center),n.radius=z):(e.clone(q,n.center),n.radius=V),n},d.fromCornerPoints=function(t,r,n){a(n)||(n=new d);var i=n.center;return e.add(t,r,i),e.multiplyByScalar(i,.5,i),n.radius=e.distance(i,r),n},d.fromEllipsoid=function(t,r){return a(r)||(r=new d),e.clone(e.ZERO,r.center),r.radius=t.maximumRadius,r};var C=new e;d.fromBoundingSpheres=function(t,r){if(a(r)||(r=new d),!a(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var n=t.length;if(1===n)return d.clone(t[0],r);if(2===n)return d.union(t[0],t[1],r);for(var i=[],o=0;o<n;o++)i.push(t[o].center);r=d.fromPoints(i,r);var u=r.center,s=r.radius;for(o=0;o<n;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,C)+c.radius)}return r.radius=s,r};var P=new e,D=new e,L=new e;d.fromOrientedBoundingBox=function(t,r){a(r)||(r=new d);var n=t.halfAxes,i=c.getColumn(n,0,P),o=c.getColumn(n,1,D),u=c.getColumn(n,2,L),s=e.magnitude(i),l=e.magnitude(o),f=e.magnitude(u);return r.center=e.clone(t.center,r.center),r.radius=Math.max(s,l,f),r},d.clone=function(t,r){if(a(t))return a(r)?(r.center=e.clone(t.center,r.center),r.radius=t.radius,r):new d(t.center,t.radius)},d.packedLength=4,d.pack=function(e,t,r){r=n(r,0);var a=e.center;return t[r++]=a.x,t[r++]=a.y,t[r++]=a.z,t[r]=e.radius,t},d.unpack=function(e,t,r){t=n(t,0),a(r)||(r=new d);var i=r.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],r.radius=e[t],r};var U=new e,b=new e;d.union=function(t,r,n){a(n)||(n=new d);var i=t.center,o=t.radius,u=r.center,s=r.radius,c=e.subtract(u,i,U),l=e.magnitude(c);if(o>=l+s)return t.clone(n),n;if(s>=l+o)return r.clone(n),n;var f=.5*(o+l+s),h=e.multiplyByScalar(c,(-o+f)/l,b);return e.add(h,i,h),e.clone(h,n.center),n.radius=f,n};var F=new e;d.expand=function(t,r,n){n=d.clone(t,n);var a=e.magnitude(e.subtract(r,n.center,F));return a>n.radius&&(n.radius=a),n},d.intersectPlane=function(t,r){var n=t.center,a=t.radius,i=r.normal,o=e.dot(i,n)+r.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},d.transform=function(e,t,r){return a(r)||(r=new d),r.center=l.multiplyByPoint(t,e.center,r.center),r.radius=l.getMaximumScale(t)*e.radius,r};var z=new e;d.distanceSquaredTo=function(t,r){var n=e.subtract(t.center,r,z);return e.magnitudeSquared(n)-t.radius*t.radius},d.transformWithoutScale=function(e,t,r){return a(r)||(r=new d),r.center=l.multiplyByPoint(t,e.center,r.center),r.radius=e.radius,r};var B=new e;d.computePlaneDistances=function(t,r,n,i){a(i)||(i=new s);var o=e.subtract(t.center,r,B),u=e.dot(n,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var G=new e,q=new e,V=new e,W=new e,X=new e,H=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var j=new o;return d.projectTo2D=function(t,r,a){r=n(r,j);var i=r.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,G),c=e.cross(e.UNIT_Z,s,q);e.normalize(c,c);var l=e.cross(s,c,V);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var f=e.negate(l,X),h=e.negate(c,W),E=Y,p=E[0];e.add(s,l,p),e.add(p,c,p),p=E[1],e.add(s,l,p),e.add(p,h,p),p=E[2],e.add(s,f,p),e.add(p,h,p),p=E[3],e.add(s,f,p),e.add(p,c,p),e.negate(s,s),p=E[4],e.add(s,l,p),e.add(p,c,p),p=E[5],e.add(s,l,p),e.add(p,h,p),p=E[6],e.add(s,f,p),e.add(p,h,p),p=E[7],e.add(s,f,p),e.add(p,c,p);for(var m=E.length,y=0;y<m;++y){var _=E[y];e.add(o,_,_);var T=i.cartesianToCartographic(_,H);r.project(T,_)}a=d.fromPoints(E,a),o=a.center;var v=o.x,R=o.y,A=o.z;return o.x=A,o.y=v,o.z=R,a},d.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},d.equals=function(t,r){return t===r||a(t)&&a(r)&&e.equals(t.center,r.center)&&t.radius===r.radius},d.prototype.intersectPlane=function(e){return d.intersectPlane(this,e)},d.prototype.distanceSquaredTo=function(e){return d.distanceSquaredTo(this,e)},d.prototype.computePlaneDistances=function(e,t,r){return d.computePlaneDistances(this,e,t,r)},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/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i){"use strict";function o(e,r){this.x=t(e,0),this.y=t(r,0)}o.fromElements=function(e,t,n){return r(n)?(n.x=e,n.y=t,n):new o(e,t)},o.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t):new o(e.x,e.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n]=e.y,r},o.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new o),a.x=e[n++],a.y=e[n],a},o.packArray=function(e,t){var n=e.length;r(t)?t.length=2*n:t=new Array(2*n);for(var a=0;a<n;++a)o.pack(e[a],t,2*a);return t},o.unpackArray=function(e,t){var n=e.length;r(t)?t.length=n/2:t=new Array(n/2);for(var a=0;a<n;a+=2){var i=a/2;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y)},o.minimumComponent=function(e){return Math.min(e.x,e.y)},o.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),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},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var r=o.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y},o.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r},o.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r},o.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r},o.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r},o.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r},o.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var s=new o;o.lerp=function(e,t,r,n){return o.multiplyByScalar(t,r,s),n=o.multiplyByScalar(e,1-r,n),o.add(s,n,n)};var c=new o,l=new o;o.angleBetween=function(e,t){return o.normalize(e,c),o.normalize(t,l),i.acosClamped(o.dot(c,l))};var f=new o;return o.mostOrthogonalAxis=function(e,t){var r=o.normalize(e,f);return o.abs(r,r),t=r.x<=r.y?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y},o.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]},o.equalsEpsilon=function(e,t,n,a){return e===t||r(e)&&r(t)&&i.equalsEpsilon(e.x,t.x,n,a)&&i.equalsEpsilon(e.y,t.y,n,a)},o.ZERO=a(new o(0,0)),o.UNIT_X=a(new o(1,0)),o.UNIT_Y=a(new o(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,r){return o.equalsEpsilon(this,e,t,r)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),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},a={};return t(a,{element:{get:function(){if(a.supportsFullscreen())return document[n.fullscreenElement]; +}},changeEventName:{get:function(){if(a.supportsFullscreen())return n.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return n.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[n.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.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 a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(n.requestFullscreen=a,r=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(n.requestFullscreen=a,r=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?n.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(n.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?n.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(n.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?n.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(n.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),n.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),n.fullscreenerror=a)}return r},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[n.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[n.exitFullscreen]()},a}),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;r<n;++r)t[r]=parseInt(t[r],10);return t}function a(){if(!t(R)&&(R=!1,!d())){var e=/ Chrome\/([\.0-9]+)/.exec(v.userAgent);null!==e&&(R=!0,A=n(e[1]))}return R}function i(){return a()&&A}function o(){if(!t(S)&&(S=!1,!a()&&!d()&&/ Safari\/[\.0-9]+/.test(v.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(v.userAgent);null!==e&&(S=!0,N=n(e[1]))}return S}function u(){return o()&&N}function s(){if(!t(I)){I=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(v.userAgent);null!==e&&(I=!0,g=n(e[1]),g.isNightly=!!e[2])}return I}function c(){return s()&&g}function l(){if(!t(O)){O=!1;var e;"Microsoft Internet Explorer"===v.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(v.userAgent),null!==e&&(O=!0,w=n(e[1]))):"Netscape"===v.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(v.userAgent),null!==e&&(O=!0,w=n(e[1])))}return O}function f(){return l()&&w}function d(){if(!t(M)){M=!1;var e=/ Edge\/([\.0-9]+)/.exec(v.userAgent);null!==e&&(M=!0,x=n(e[1]))}return M}function h(){return d()&&x}function E(){if(!t(C)){C=!1;var e=/Firefox\/([\.0-9]+)/.exec(v.userAgent);null!==e&&(C=!0,P=n(e[1]))}return C}function p(){return t(D)||(D=/Windows/i.test(v.appVersion)),D}function m(){return E()&&P}function y(){return t(L)||(L="undefined"!=typeof PointerEvent&&(!t(v.pointerEnabled)||v.pointerEnabled)),L}function _(){if(!t(b)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var r=e.style.imageRendering;b=t(r)&&""!==r,b&&(U=r)}return b}function T(){return _()?U:void 0}var v;v="undefined"!=typeof navigator?navigator:{};var R,A,S,N,I,g,O,w,M,x,C,P,D,L,U,b,F={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isEdge:d,edgeVersion:h,isFirefox:E,firefoxVersion:m,isWindows:p,hardwareConcurrency:e(v.hardwareConcurrency,3),supportsPointerEvents:y,supportsImageRenderingPixelated:_,imageRenderingValue:T};return F.supportsFullscreen=function(){return r.supportsFullscreen()},F.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},F.supportsWebWorkers=function(){return"undefined"!=typeof Worker},F}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,r,n,a,i){"use strict";if(!n.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){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.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},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 Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,r,n,a){switch(n=e(n,0),a=e(a,(r.byteLength-n)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(r,n,a);case o.UNSIGNED_BYTE:return new Uint8Array(r,n,a);case o.SHORT:return new Int16Array(r,n,a);case o.UNSIGNED_SHORT:return new Uint16Array(r,n,a);case o.INT:return new Int32Array(r,n,a);case o.UNSIGNED_INT:return new Uint32Array(r,n,a);case o.FLOAT:return new Float32Array(r,n,a);case o.DOUBLE:return new Float64Array(r,n,a)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/Quaternion",["./Cartesian3","./Check","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math","./Matrix3"],function(e,t,r,n,a,i,o,u,s){"use strict";function c(e,t,n,a){this.x=r(e,0),this.y=r(t,0),this.z=r(n,0),this.w=r(a,0)}var l=new e;c.fromAxisAngle=function(t,r,a){var i=r/2,o=Math.sin(i);l=e.normalize(t,l);var u=l.x*o,s=l.y*o,f=l.z*o,d=Math.cos(i);return n(a)?(a.x=u,a.y=s,a.z=f,a.w=d,a):new c(u,s,f,d)};var f=[1,2,0],d=new Array(3);c.fromRotationMatrix=function(e,t){var r,a,i,o,u,l=e[s.COLUMN0ROW0],h=e[s.COLUMN1ROW1],E=e[s.COLUMN2ROW2],p=l+h+E;if(p>0)r=Math.sqrt(p+1),u=.5*r,r=.5/r,a=(e[s.COLUMN1ROW2]-e[s.COLUMN2ROW1])*r,i=(e[s.COLUMN2ROW0]-e[s.COLUMN0ROW2])*r,o=(e[s.COLUMN0ROW1]-e[s.COLUMN1ROW0])*r;else{var m=f,y=0;h>l&&(y=1),E>l&&E>h&&(y=2);var _=m[y],T=m[_];r=Math.sqrt(e[s.getElementIndex(y,y)]-e[s.getElementIndex(_,_)]-e[s.getElementIndex(T,T)]+1);var v=d;v[y]=.5*r,r=.5/r,u=(e[s.getElementIndex(T,_)]-e[s.getElementIndex(_,T)])*r,v[_]=(e[s.getElementIndex(_,y)]+e[s.getElementIndex(y,_)])*r,v[T]=(e[s.getElementIndex(T,y)]+e[s.getElementIndex(y,T)])*r,a=-v[0],i=-v[1],o=-v[2]}return n(t)?(t.x=a,t.y=i,t.z=o,t.w=u,t):new c(a,i,o,u)};var h=new c;c.fromHeadingPitchRoll=function(t,r,n,a){var i=c.fromAxisAngle(e.UNIT_X,n,h),o=c.fromAxisAngle(e.UNIT_Y,-r,a);a=c.multiply(o,i,o);var u=c.fromAxisAngle(e.UNIT_Z,-t,h);return c.multiply(u,a,a)};var E=new e,p=new e,m=new c,y=new c,_=new c;c.packedLength=4,c.pack=function(e,t,n){return n=r(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t},c.unpack=function(e,t,a){return t=r(t,0),n(a)||(a=new c),a.x=e[t],a.y=e[t+1],a.z=e[t+2],a.w=e[t+3],a},c.packedInterpolationLength=3,c.convertPackedArrayForInterpolation=function(e,t,r,n){c.unpack(e,4*r,_),c.conjugate(_,_);for(var a=0,i=r-t+1;a<i;a++){var o=3*a;c.unpack(e,4*(t+a),m),c.multiply(m,_,m),m.w<0&&c.negate(m,m),c.computeAxis(m,E);var u=c.computeAngle(m);n[o]=E.x*u,n[o+1]=E.y*u,n[o+2]=E.z*u}},c.unpackInterpolationResult=function(t,r,a,i,o){n(o)||(o=new c),e.fromArray(t,0,p);var u=e.magnitude(p);return c.unpack(r,4*i,y),0===u?c.clone(c.IDENTITY,m):c.fromAxisAngle(p,u,m),c.multiply(m,y,o)},c.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new c(e.x,e.y,e.z,e.w)},c.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},c.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},c.magnitude=function(e){return Math.sqrt(c.magnitudeSquared(e))},c.normalize=function(e,t){var r=1/c.magnitude(e),n=e.x*r,a=e.y*r,i=e.z*r,o=e.w*r;return t.x=n,t.y=a,t.z=i,t.w=o,t},c.inverse=function(e,t){var r=c.magnitudeSquared(e);return t=c.conjugate(e,t),c.multiplyByScalar(t,1/r,t)},c.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},c.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},c.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},c.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},c.multiply=function(e,t,r){var n=e.x,a=e.y,i=e.z,o=e.w,u=t.x,s=t.y,c=t.z,l=t.w,f=o*u+n*l+a*c-i*s,d=o*s-n*c+a*l+i*u,h=o*c+n*s-a*u+i*l,E=o*l-n*u-a*s-i*c;return r.x=f,r.y=d,r.z=h,r.w=E,r},c.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},c.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},c.computeAxis=function(e,t){var r=e.w;if(Math.abs(r-1)<u.EPSILON6)return t.x=t.y=t.z=0,t;var n=1/Math.sqrt(1-r*r);return t.x=e.x*n,t.y=e.y*n,t.z=e.z*n,t},c.computeAngle=function(e){return Math.abs(e.w-1)<u.EPSILON6?0:2*Math.acos(e.w)};var T=new c;c.lerp=function(e,t,r,n){return T=c.multiplyByScalar(t,r,T),n=c.multiplyByScalar(e,1-r,n),c.add(T,n,n)};var v=new c,R=new c,A=new c;c.slerp=function(e,t,r,n){var a=c.dot(e,t),i=t;if(a<0&&(a=-a,i=v=c.negate(t,v)),1-a<u.EPSILON6)return c.lerp(e,i,r,n);var o=Math.acos(a);return R=c.multiplyByScalar(e,Math.sin((1-r)*o),R),A=c.multiplyByScalar(i,Math.sin(r*o),A),n=c.add(R,A,n),c.multiplyByScalar(n,1/Math.sin(o),n)},c.log=function(t,r){var n=u.acosClamped(t.w),a=0;return 0!==n&&(a=n/Math.sin(n)),e.multiplyByScalar(t,a,r)},c.exp=function(t,r){var n=e.magnitude(t),a=0;return 0!==n&&(a=Math.sin(n)/n),r.x=t.x*a,r.y=t.y*a,r.z=t.z*a,r.w=Math.cos(n),r};var S=new e,N=new e,I=new c,g=new c;c.computeInnerQuadrangle=function(t,r,n,a){var i=c.conjugate(r,I);c.multiply(i,n,g);var o=c.log(g,S);c.multiply(i,t,g);var u=c.log(g,N);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),c.exp(o,I),c.multiply(r,I,a)},c.squad=function(e,t,r,n,a,i){var o=c.slerp(e,t,a,I),u=c.slerp(r,n,a,g);return c.slerp(o,u,2*a*(1-a),i)};for(var O=new c,w=1.9011074535173003,M=i.supportsTypedArrays()?new Float32Array(8):[],x=i.supportsTypedArrays()?new Float32Array(8):[],C=i.supportsTypedArrays()?new Float32Array(8):[],P=i.supportsTypedArrays()?new Float32Array(8):[],D=0;D<7;++D){var L=D+1,U=2*L+1;M[D]=1/(L*U),x[D]=L/U}return M[7]=w/136,x[7]=8*w/17,c.fastSlerp=function(e,t,r,n){var a,i=c.dot(e,t);i>=0?a=1:(a=-1,i=-i);for(var o=i-1,u=1-r,s=r*r,l=u*u,f=7;f>=0;--f)C[f]=(M[f]*s-x[f])*o,P[f]=(M[f]*l-x[f])*o;var d=a*r*(1+C[0]*(1+C[1]*(1+C[2]*(1+C[3]*(1+C[4]*(1+C[5]*(1+C[6]*(1+C[7])))))))),h=u*(1+P[0]*(1+P[1]*(1+P[2]*(1+P[3]*(1+P[4]*(1+P[5]*(1+P[6]*(1+P[7])))))))),E=c.multiplyByScalar(e,h,O);return c.multiplyByScalar(t,d,n),c.add(E,n,n)},c.fastSquad=function(e,t,r,n,a,i){var o=c.fastSlerp(e,t,a,I),u=c.fastSlerp(r,n,a,g);return c.fastSlerp(o,u,2*a*(1-a),i)},c.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},c.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.x-t.x)<=r&&Math.abs(e.y-t.y)<=r&&Math.abs(e.z-t.z)<=r&&Math.abs(e.w-t.w)<=r},c.ZERO=o(new c(0,0,0,0)),c.IDENTITY=o(new c(0,0,0,1)),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.x+", "+this.y+", "+this.z+", "+this.w+")"},c}),define("Core/EllipseGeometryLibrary",["./Cartesian3","./Math","./Matrix3","./Quaternion"],function(e,t,r,n){"use strict";function a(t,a,i,l,f,d,h,E,p,m){var y=t+a;e.multiplyByScalar(l,Math.cos(y),o),e.multiplyByScalar(i,Math.sin(y),u),e.add(o,u,o);var _=Math.cos(t);_*=_;var T=Math.sin(t);T*=T;var v=d/Math.sqrt(h*_+f*T),R=v/E;return n.fromAxisAngle(o,R,s),r.fromQuaternion(s,c),r.multiplyByVector(c,p,m),e.normalize(m,m),e.multiplyByScalar(m,E,m),m}var i={},o=new e,u=new e,s=new n,c=new r,l=new e,f=new e,d=new e,h=new e;i.raisePositionsToHeight=function(t,r,n){for(var a=r.ellipsoid,i=r.height,o=r.extrudedHeight,u=n?t.length/3*2:t.length/3,s=new Float64Array(3*u),c=t.length,E=n?c:0,p=0;p<c;p+=3){var m=p+1,y=p+2,_=e.fromArray(t,p,l);a.scaleToGeodeticSurface(_,_);var T=e.clone(_,f),v=a.geodeticSurfaceNormal(_,h),R=e.multiplyByScalar(v,i,d);e.add(_,R,_),n&&(e.multiplyByScalar(v,o,R),e.add(T,R,T),s[p+E]=T.x,s[m+E]=T.y,s[y+E]=T.z),s[p]=_.x,s[m]=_.y,s[y]=_.z}return s};var E=new e,p=new e,m=new e;return i.computeEllipsePositions=function(r,n,i){var o=r.semiMinorAxis,u=r.semiMajorAxis,s=r.rotation,c=r.center,h=8*r.granularity,y=o*o,_=u*u,T=u*o,v=e.magnitude(c),R=e.normalize(c,E),A=e.cross(e.UNIT_Z,c,p);A=e.normalize(A,A);var S=e.cross(R,A,m),N=1+Math.ceil(t.PI_OVER_TWO/h),I=t.PI_OVER_TWO/(N-1),g=t.PI_OVER_TWO-N*I;g<0&&(N-=Math.ceil(Math.abs(g)/I));var O,w,M,x,C,P=2*(N*(N+2)),D=n?new Array(3*P):void 0,L=0,U=l,b=f,F=4*N*3,z=F-1,B=0,G=i?new Array(F):void 0;for(g=t.PI_OVER_TWO,U=a(g,s,S,A,y,T,_,v,R,U),n&&(D[L++]=U.x,D[L++]=U.y,D[L++]=U.z),i&&(G[z--]=U.z,G[z--]=U.y,G[z--]=U.x),g=t.PI_OVER_TWO-I,O=1;O<N+1;++O){if(U=a(g,s,S,A,y,T,_,v,R,U),b=a(Math.PI-g,s,S,A,y,T,_,v,R,b),n){for(D[L++]=U.x,D[L++]=U.y,D[L++]=U.z,M=2*O+2,w=1;w<M-1;++w)x=w/(M-1),C=e.lerp(U,b,x,d),D[L++]=C.x,D[L++]=C.y,D[L++]=C.z;D[L++]=b.x,D[L++]=b.y,D[L++]=b.z}i&&(G[z--]=U.z,G[z--]=U.y,G[z--]=U.x,G[B++]=b.x,G[B++]=b.y,G[B++]=b.z),g=t.PI_OVER_TWO-(O+1)*I}for(O=N;O>1;--O){if(g=t.PI_OVER_TWO-(O-1)*I,U=a(-g,s,S,A,y,T,_,v,R,U),b=a(g+Math.PI,s,S,A,y,T,_,v,R,b),n){for(D[L++]=U.x,D[L++]=U.y,D[L++]=U.z,M=2*(O-1)+2,w=1;w<M-1;++w)x=w/(M-1),C=e.lerp(U,b,x,d),D[L++]=C.x,D[L++]=C.y,D[L++]=C.z;D[L++]=b.x,D[L++]=b.y,D[L++]=b.z}i&&(G[z--]=U.z,G[z--]=U.y,G[z--]=U.x,G[B++]=b.x,G[B++]=b.y,G[B++]=b.z)}g=t.PI_OVER_TWO,U=a(-g,s,S,A,y,T,_,v,R,U);var q={};return n&&(D[L++]=U.x,D[L++]=U.y,D[L++]=U.z,q.positions=D,q.numPts=N),i&&(G[z--]=U.z,G[z--]=U.y,G[z--]=U.x,q.outerPositions=G),q},i}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var r={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,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,t,r,n,a){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,a.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,n.NONE),this.boundingSphereCV=t.boundingSphereCV}return i.computeNumberOfVertices=function(e){var r=-1;for(var n in e.attributes)if(e.attributes.hasOwnProperty(n)&&t(e.attributes[n])&&t(e.attributes[n].values)){var a=e.attributes[n],i=a.values.length/a.componentsPerAttribute;r=i}return r},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(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 n}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/GeometryInstance",["./defaultValue","./defined","./DeveloperError","./Matrix4"],function(e,t,r,n){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.geometry=t.geometry,this.modelMatrix=n.clone(e(t.modelMatrix,n.IDENTITY)),this.id=t.id,this.pickPrimitive=t.pickPrimitive,this.attributes=e(t.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}return a}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,r,n,a){"use strict";var i={};i.octEncodeInRange=function(e,t,r){if(r.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),r.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var n=r.x,i=r.y;r.x=(1-Math.abs(i))*a.signNotZero(n),r.y=(1-Math.abs(n))*a.signNotZero(i)}return r.x=a.toSNorm(r.x,t),r.y=a.toSNorm(r.y,t),r},i.octEncode=function(e,t){return i.octEncodeInRange(e,255,t)},i.octDecodeInRange=function(e,r,n,i){if(i.x=a.fromSNorm(e,n),i.y=a.fromSNorm(r,n),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){var o=i.x;i.x=(1-Math.abs(i.y))*a.signNotZero(o),i.y=(1-Math.abs(o))*a.signNotZero(i.y)}return t.normalize(i,i)},i.octDecode=function(e,t,r){return i.octDecodeInRange(e,t,255,r)},i.octPackFloat=function(e){return 256*e.x+e.y};var o=new e;return i.octEncodeFloat=function(e){return i.octEncode(e,o),i.octPackFloat(o)},i.octDecodeFloat=function(e,t){var r=e/256,n=Math.floor(r),a=256*(r-n);return i.octDecode(n,a,t)},i.octPack=function(e,t,r,n){var a=i.octEncodeFloat(e),u=i.octEncodeFloat(t),s=i.octEncode(r,o);return n.x=65536*s.x+a,n.y=65536*s.y+u,n},i.octUnpack=function(e,t,r,n){var a=e.x/65536,o=Math.floor(a),u=65536*(a-o);a=e.y/65536;var s=Math.floor(a),c=65536*(a-s);i.octDecodeFloat(u,t),i.octDecodeFloat(c,r),i.octDecode(o,s,n)},i.compressTextureCoordinates=function(e){var t=4095*e.x|0,r=4095*e.y|0;return 4096*t+r},i.decompressTextureCoordinates=function(e,t){var r=e/4096,n=Math.floor(r);return t.x=n/4095,t.y=(e-4096*n)/4095,t},i}),define("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function a(n,a,s,c,l){r(l)||(l=new t);var f,d,h,E,p,m,y,_;r(a.z)?(f=t.subtract(s,a,i),d=t.subtract(c,a,o), +h=t.subtract(n,a,u),E=t.dot(f,f),p=t.dot(f,d),m=t.dot(f,h),y=t.dot(d,d),_=t.dot(d,h)):(f=e.subtract(s,a,i),d=e.subtract(c,a,o),h=e.subtract(n,a,u),E=e.dot(f,f),p=e.dot(f,d),m=e.dot(f,h),y=e.dot(d,d),_=e.dot(d,h));var T=1/(E*y-p*p);return l.y=(y*m-p*_)*T,l.z=(E*_-p*m)*T,l.x=1-l.y-l.z,l}var i=new t,o=new t,u=new t;return a}),define("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(r,n){t(a[r])||(a[r]=!0,console.warn(e(n,r)))}var a={};return n.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.",n}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,r){"use strict";function n(e,t){r(e,t)}return n}),define("Core/EncodedCartesian3",["./Cartesian3","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(){this.high=e.clone(e.ZERO),this.low=e.clone(e.ZERO)}n.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 a={high:0,low:0};n.fromCartesian=function(e,r){t(r)||(r=new n);var i=r.high,o=r.low;return n.encode(e.x,a),i.x=a.high,o.x=a.low,n.encode(e.y,a),i.y=a.high,o.y=a.low,n.encode(e.z,a),i.z=a.high,o.z=a.low,r};var i=new n;return n.writeElements=function(e,t,r){n.fromCartesian(e,i);var a=i.high,o=i.low;t[r]=a.x,t[r+1]=a.y,t[r+2]=a.z,t[r+3]=o.x,t[r+4]=o.y,t[r+5]=o.z},n}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,r,n,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(e){switch(e){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(t){return e(t)&&(t===i.UNSIGNED_BYTE||t===i.UNSIGNED_SHORT||t===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,r,a){return e>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,r,a):new Uint16Array(t,r,a)},r(i)}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function r(e,r,n){var a=e+r;return t.sign(e)!==t.sign(r)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(r)))<n?0:a}var n={};return n.computeDiscriminant=function(e,t,r){var n=t*t-4*e*r;return n},n.computeRealRoots=function(e,n,a){var i;if(0===e)return 0===n?[]:[-a/n];if(0===n){if(0===a)return[0,0];var o=Math.abs(a),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,i<0)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-n/e,i<0?[i,0]:[0,i];var c=n*n,l=4*e*a,f=r(c,-l,t.EPSILON14);if(f<0)return[];var d=-.5*r(n,t.sign(n)*Math.sqrt(f),t.EPSILON14);return n>0?[d/e,a/d]:[a/d,d/e]},n}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function r(e,t,r,n){var a,i,o=e,u=t/3,s=r/3,c=n,l=o*s,f=u*c,d=u*u,h=s*s,E=o*s-d,p=o*c-u*s,m=u*c-h,y=4*E*m-p*p;if(y<0){var _,T,v;d*f>=l*h?(_=o,T=E,v=-2*u*E+o*p):(_=c,T=m,v=-c*p+2*s*m);var R=v<0?-1:1,A=-R*Math.abs(_)*Math.sqrt(-y);i=-v+A;var S=i/2,N=S<0?-Math.pow(-S,1/3):Math.pow(S,1/3),I=i===A?-N:-T/N;return a=T<=0?N+I:-v/(N*N+I*I+T),d*f>=l*h?[(a-u)/o]:[-c/(a+s)]}var g=E,O=-2*u*E+o*p,w=m,M=-c*p+2*s*m,x=Math.sqrt(y),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*x,-O)/3);a=2*Math.sqrt(-g);var D=Math.cos(P);i=a*D;var L=a*(-D/2-C*Math.sin(P)),U=i+L>2*u?i-u:L-u,b=o,F=U/b;P=Math.abs(Math.atan2(c*x,-M)/3),a=2*Math.sqrt(-w),D=Math.cos(P),i=a*D,L=a*(-D/2-C*Math.sin(P));var z=-c,B=i+L<2*s?i+s:L+s,G=z/B,q=b*B,V=-U*B-b*z,W=U*z,X=(s*V-u*W)/(-u*V+s*q);return F<=X?F<=G?X<=G?[F,X,G]:[F,G,X]:[G,F,X]:F<=G?[X,F,G]:X<=G?[X,G,F]:[G,X,F]}var n={};return n.computeDiscriminant=function(e,t,r,n){var a=e*e,i=t*t,o=r*r,u=n*n,s=18*e*t*r*n+i*o-27*a*u-4*(e*o*r+i*t*n);return s},n.computeRealRoots=function(e,n,a,i){var o,u;if(0===e)return t.computeRealRoots(n,a,i);if(0===n){if(0===a){if(0===i)return[0,0,0];u=-i/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===i?(o=t.computeRealRoots(e,0,a),0===o.Length?[0]:[o[0],0,o[1]]):r(e,0,a,i)}return 0===a?0===i?(u=-n/e,u<0?[u,0,0]:[0,0,u]):r(e,n,0,i):0===i?(o=t.computeRealRoots(e,n,a),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):r(e,n,a,i)},n}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,r,n){"use strict";function a(t,a,i,o){var u=t*t,s=a-3*u/8,c=i-a*t/2+u*t/8,l=o-i*t/4+a*u/16-3*u*u/256,f=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(f.length>0){var d=-t/4,h=f[f.length-1];if(Math.abs(h)<r.EPSILON14){var E=n.computeRealRoots(1,s,l);if(2===E.length){var p,m=E[0],y=E[1];if(m>=0&&y>=0){var _=Math.sqrt(m),T=Math.sqrt(y);return[d-T,d-_,d+_,d+T]}if(m>=0&&y<0)return p=Math.sqrt(m),[d-p,d+p];if(m<0&&y>=0)return p=Math.sqrt(y),[d-p,d+p]}return[]}if(h>0){var v=Math.sqrt(h),R=(s+h-c/v)/2,A=(s+h+c/v)/2,S=n.computeRealRoots(1,v,R),N=n.computeRealRoots(1,-v,A);return 0!==S.length?(S[0]+=d,S[1]+=d,0!==N.length?(N[0]+=d,N[1]+=d,S[1]<=N[0]?[S[0],S[1],N[0],N[1]]:N[1]<=S[0]?[N[0],N[1],S[0],S[1]]:S[0]>=N[0]&&S[1]<=N[1]?[N[0],S[0],S[1],N[1]]:N[0]>=S[0]&&N[1]<=S[1]?[S[0],N[0],N[1],S[1]]:S[0]>N[0]&&S[0]<N[1]?[N[0],S[0],N[1],S[1]]:[S[0],N[0],S[1],N[1]]):S):0!==N.length?(N[0]+=d,N[1]+=d,N):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,f=i*t+s-4*o,d=c*o-i*a*t+u,h=e.computeRealRoots(1,l,f,d);if(h.length>0){var E,p,m=h[0],y=a-m,_=y*y,T=t/2,v=y/2,R=_-4*o,A=_+4*Math.abs(o),S=c-4*m,N=c+4*Math.abs(m);if(m<0||R*N<S*A){var I=Math.sqrt(S);E=I/2,p=0===I?0:(t*v-i)/I}else{var g=Math.sqrt(R);E=0===g?0:(t*v-i)/g,p=g/2}var O,w;0===T&&0===E?(O=0,w=0):r.sign(T)===r.sign(E)?(O=T+E,w=m/O):(w=T-E,O=m/w);var M,x;0===v&&0===p?(M=0,x=0):r.sign(v)===r.sign(p)?(M=v+p,x=o/M):(x=v-p,M=o/x);var C=n.computeRealRoots(1,O,M),P=n.computeRealRoots(1,w,x);if(0!==C.length)return 0!==P.length?C[1]<=P[0]?[C[0],C[1],P[0],P[1]]:P[1]<=C[0]?[P[0],P[1],C[0],C[1]]:C[0]>=P[0]&&C[1]<=P[1]?[P[0],C[0],C[1],P[1]]:P[0]>=C[0]&&P[1]<=C[1]?[C[0],P[0],P[1],C[1]]:C[0]>P[0]&&C[0]<P[1]?[P[0],C[0],P[1],C[1]]:[C[0],P[0],C[1],P[1]]:C;if(0!==P.length)return P}return[]}var o={};return o.computeDiscriminant=function(e,t,r,n,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=r*r,l=c*r,f=n*n,d=f*n,h=a*a,E=h*a,p=u*c*f-4*s*d-4*e*l*f+18*e*t*r*d-27*i*f*f+256*o*E+a*(18*s*r*n-4*u*l+16*e*c*c-80*e*t*c*n-6*e*u*f+144*i*r*f)+h*(144*e*u*r-27*u*u-128*i*c-192*i*t*n);return p},o.computeRealRoots=function(t,n,o,u,s){if(Math.abs(t)<r.EPSILON15)return e.computeRealRoots(n,o,u,s);var c=n/t,l=o/t,f=u/t,d=s/t,h=c<0?1:0;switch(h+=l<0?h+1:h,h+=f<0?h+1:h,h+=d<0?h+1:h){case 0:return a(c,l,f,d);case 1:return i(c,l,f,d);case 2:return i(c,l,f,d);case 3:return a(c,l,f,d);case 4:return a(c,l,f,d);case 5:return i(c,l,f,d);case 6:return a(c,l,f,d);case 7:return a(c,l,f,d);case 8:return i(c,l,f,d);case 9:return a(c,l,f,d);case 10:return a(c,l,f,d);case 11:return i(c,l,f,d);case 12:return a(c,l,f,d);case 13:return a(c,l,f,d);case 14:return a(c,l,f,d);case 15:return a(c,l,f,d);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function a(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 a.getPoint=function(t,n,a){return r(a)||(a=new e),a=e.multiplyByScalar(t.direction,n,a),e.add(t.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,r,n,a,i,o,u,s,c,l){"use strict";function f(e,t,r,n){var a=t*t-4*e*r;if(!(a<0)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return u<s?(n.root0=u,n.root1=s):(n.root0=s,n.root1=u),n}var c=-t/(2*e);if(0!==c)return n.root0=n.root1=c,n}}function d(t,r,a){n(a)||(a=new i);var o=t.origin,u=t.direction,s=r.center,c=r.radius*r.radius,l=e.subtract(o,s,_),d=e.dot(u,u),h=2*e.dot(u,l),E=e.magnitudeSquared(l)-c,p=f(d,h,E,A);if(n(p))return a.start=p.root0,a.stop=p.root1,a}function h(e,t,r){var n=e+t;return o.sign(e)!==o.sign(t)&&Math.abs(n/Math.max(Math.abs(e),Math.abs(t)))<r?0:n}function E(t,r,n,a,i){var l,f=a*a,d=i*i,E=(t[u.COLUMN1ROW1]-t[u.COLUMN2ROW2])*d,p=i*(a*h(t[u.COLUMN1ROW0],t[u.COLUMN0ROW1],o.EPSILON15)+r.y),m=t[u.COLUMN0ROW0]*f+t[u.COLUMN2ROW2]*d+a*r.x+n,y=d*h(t[u.COLUMN2ROW1],t[u.COLUMN1ROW2],o.EPSILON15),_=i*(a*h(t[u.COLUMN2ROW0],t[u.COLUMN0ROW2])+r.z),T=[];if(0===_&&0===y){if(l=s.computeRealRoots(E,p,m),0===l.length)return T;var v=l[0],R=Math.sqrt(Math.max(1-v*v,0));if(T.push(new e(a,i*v,i*-R)),T.push(new e(a,i*v,i*R)),2===l.length){var A=l[1],S=Math.sqrt(Math.max(1-A*A,0));T.push(new e(a,i*A,i*-S)),T.push(new e(a,i*A,i*S))}return T}var N=_*_,I=y*y,g=E*E,O=_*y,w=g+I,M=2*(p*E+O),x=2*m*E+p*p-I+N,C=2*(m*p-O),P=m*m-N;if(0===w&&0===M&&0===x&&0===C)return T;l=c.computeRealRoots(w,M,x,C,P);var D=l.length;if(0===D)return T;for(var L=0;L<D;++L){var U,b=l[L],F=b*b,z=Math.max(1-F,0),B=Math.sqrt(z);U=o.sign(E)===o.sign(m)?h(E*F+m,p*b,o.EPSILON12):o.sign(m)===o.sign(p*b)?h(E*F,p*b+m,o.EPSILON12):h(E*F+p*b,m,o.EPSILON12);var G=h(y*b,_,o.EPSILON15),q=U*G;q<0?T.push(new e(a,i*b,i*B)):q>0?T.push(new e(a,i*b,i*-B)):0!==B?(T.push(new e(a,i*b,i*-B)),T.push(new e(a,i*b,i*B)),++L):T.push(new e(a,i*b,i*B))}return T}var p={};p.rayPlane=function(t,r,a){n(a)||(a=new e);var i=t.origin,u=t.direction,s=r.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON15)){var l=(-r.distance-e.dot(s,i))/c;if(!(l<0))return a=e.multiplyByScalar(u,l,a),e.add(i,a,a)}};var m=new e,y=new e,_=new e,T=new e,v=new e;p.rayTriangleParametric=function(t,n,a,i,u){u=r(u,!1);var s,c,l,f,d,h=t.origin,E=t.direction,p=e.subtract(a,n,m),R=e.subtract(i,n,y),A=e.cross(E,R,_),S=e.dot(p,A);if(u){if(S<o.EPSILON6)return;if(s=e.subtract(h,n,T),l=e.dot(s,A),l<0||l>S)return;if(c=e.cross(s,p,v),f=e.dot(E,c),f<0||l+f>S)return;d=e.dot(R,c)/S}else{if(Math.abs(S)<o.EPSILON6)return;var N=1/S;if(s=e.subtract(h,n,T),l=e.dot(s,A)*N,l<0||l>1)return;if(c=e.cross(s,p,v),f=e.dot(E,c)*N,f<0||l+f>1)return;d=e.dot(R,c)*N}return d},p.rayTriangle=function(t,r,a,i,o,u){var s=p.rayTriangleParametric(t,r,a,i,o);if(n(s)&&!(s<0))return n(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var R=new l;p.lineSegmentTriangle=function(t,r,a,i,o,u,s){var c=R;e.clone(t,c.origin),e.subtract(r,t,c.direction),e.normalize(c.direction,c.direction);var l=p.rayTriangleParametric(c,a,i,o,u);if(!(!n(l)||l<0||l>e.distance(t,r)))return n(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var A={root0:0,root1:0};p.raySphere=function(e,t,r){if(r=d(e,t,r),n(r)&&!(r.stop<0))return r.start=Math.max(r.start,0),r};var S=new l;p.lineSegmentSphere=function(t,r,a,i){var o=S;e.clone(t,o.origin);var u=e.subtract(r,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),i=d(o,a,i),!(!n(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var N=new e,I=new e;p.rayEllipsoid=function(t,r){var n,a,o,u,s,c=r.oneOverRadii,l=e.multiplyComponents(c,t.origin,N),f=e.multiplyComponents(c,t.direction,I),d=e.magnitudeSquared(l),h=e.dot(l,f);if(d>1){if(h>=0)return;var E=h*h;if(n=d-1,a=e.magnitudeSquared(f),o=a*n,E<o)return;if(E>o){u=h*h-o,s=-h+Math.sqrt(u);var p=s/a,m=n/s;return p<m?new i(p,m):{start:m,stop:p}}var y=Math.sqrt(n/a);return new i(y,y)}return d<1?(n=d-1,a=e.magnitudeSquared(f),o=a*n,u=h*h-o,s=-h+Math.sqrt(u),new i(0,s/a)):h<0?(a=e.magnitudeSquared(f),new i(0,-h/a)):void 0};var g=new e,O=new e,w=new e,M=new e,x=new e,C=new u,P=new u,D=new u,L=new u,U=new u,b=new u,F=new u,z=new e,B=new e,G=new t;p.grazingAltitudeLocation=function(t,r){var a=t.origin,i=t.direction;if(!e.equals(a,e.ZERO)){var s=r.geodeticSurfaceNormal(a,g);if(e.dot(i,s)>=0)return a}var c=n(this.rayEllipsoid(t,r)),l=r.transformPositionToScaledSpace(i,g),f=e.normalize(l,l),d=e.mostOrthogonalAxis(l,M),h=e.normalize(e.cross(d,f,O),O),p=e.normalize(e.cross(f,h,w),w),m=C;m[0]=f.x,m[1]=f.y,m[2]=f.z,m[3]=h.x,m[4]=h.y,m[5]=h.z,m[6]=p.x,m[7]=p.y,m[8]=p.z;var y=u.transpose(m,P),_=u.fromScale(r.radii,D),T=u.fromScale(r.oneOverRadii,L),v=U;v[0]=0,v[1]=-i.z,v[2]=i.y,v[3]=i.z,v[4]=0,v[5]=-i.x,v[6]=-i.y,v[7]=i.x,v[8]=0;var R,A,S=u.multiply(u.multiply(y,T,b),v,b),N=u.multiply(u.multiply(S,_,F),m,F),I=u.multiplyByVector(S,a,x),q=E(N,e.negate(I,g),0,0,1),V=q.length;if(V>0){for(var W=e.clone(e.ZERO,B),X=Number.NEGATIVE_INFINITY,H=0;H<V;++H){R=u.multiplyByVector(_,u.multiplyByVector(m,q[H],z),z);var Y=e.normalize(e.subtract(R,a,M),M),k=e.dot(Y,i);k>X&&(X=k,W=e.clone(R,W))}var j=r.cartesianToCartographic(W,G);return X=o.clamp(X,0,1),A=e.magnitude(e.subtract(W,a,M))*Math.sqrt(1-X*X),A=c?-A:A,j.height=A,r.cartographicToCartesian(j,new e)}};var q=new e;return p.lineSegmentPlane=function(t,r,a,i){n(i)||(i=new e);var u=e.subtract(r,t,q),s=a.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON6)){var l=e.dot(s,t),f=-(a.distance+l)/c;if(!(f<0||f>1))return e.multiplyByScalar(u,f,i),e.add(t,i,i),i}},p.trianglePlaneIntersection=function(t,r,n,a){var i=a.normal,o=a.distance,u=e.dot(i,t)+o<0,s=e.dot(i,r)+o<0,c=e.dot(i,n)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var f,d;if(1!==l&&2!==l||(f=new e,d=new e),1===l){if(u)return p.lineSegmentPlane(t,r,a,f),p.lineSegmentPlane(t,n,a,d),{positions:[t,r,n,f,d],indices:[0,3,4,1,2,4,1,4,3]};if(s)return p.lineSegmentPlane(r,n,a,f),p.lineSegmentPlane(r,t,a,d),{positions:[t,r,n,f,d],indices:[1,3,4,2,0,4,2,4,3]};if(c)return p.lineSegmentPlane(n,t,a,f),p.lineSegmentPlane(n,r,a,d),{positions:[t,r,n,f,d],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return p.lineSegmentPlane(r,t,a,f),p.lineSegmentPlane(n,t,a,d),{positions:[t,r,n,f,d],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return p.lineSegmentPlane(n,r,a,f),p.lineSegmentPlane(t,r,a,d),{positions:[t,r,n,f,d],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return p.lineSegmentPlane(t,n,a,f),p.lineSegmentPlane(r,n,a,d),{positions:[t,r,n,f,d],indices:[0,1,4,0,4,3,2,3,4]}}},p}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,r,n){"use strict";function a(t,r){this.normal=e.clone(t),this.distance=r}a.fromPointNormal=function(r,n,i){var o=-e.dot(n,r);return t(i)?(e.clone(n,i.normal),i.distance=o,i):new a(n,o)};var i=new e;return a.fromCartesian4=function(r,n){var o=e.fromCartesian4(r,i),u=r.w;return t(n)?(e.clone(o,n.normal),n.distance=u,n):new a(o,u)},a.getPointDistance=function(t,r){return e.dot(t.normal,r)+t.distance},a.ORIGIN_XY_PLANE=n(new a(e.UNIT_Z,0)),a.ORIGIN_YZ_PLANE=n(new a(e.UNIT_X,0)),a.ORIGIN_ZX_PLANE=n(new a(e.UNIT_Y,0)),a}),define("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";var n={};return n.calculateACMR=function(r){r=e(r,e.EMPTY_OBJECT);var n=r.indices,a=r.maximumIndex,i=e(r.cacheSize,24),o=n.length;if(!t(a)){a=0;for(var u=0,s=n[u];u<o;)s>a&&(a=s),++u,s=n[u]}for(var c=[],l=0;l<a+1;l++)c[l]=0;for(var f=i+1,d=0;d<o;++d)f-c[n[d]]>i&&(c[n[d]]=f,++f);return(f-i+1)/(o/3)},n.tipsify=function(r){function n(e,t,r,n){for(;t.length>=1;){var a=t[t.length-1];if(t.splice(t.length-1,1),e[a].numLiveTriangles>0)return a}for(;i<n;){if(e[i].numLiveTriangles>0)return++i,i-1;++i}return-1}function a(e,t,r,a,i,o,u){for(var s,c=-1,l=-1,f=0;f<r.length;){var d=r[f];a[d].numLiveTriangles&&(s=0,i-a[d].timeStamp+2*a[d].numLiveTriangles<=t&&(s=i-a[d].timeStamp),(s>l||l===-1)&&(l=s,c=d)),++f}return c===-1?n(a,o,e,u):c}r=e(r,e.EMPTY_OBJECT);var i,o=r.indices,u=r.maximumIndex,s=e(r.cacheSize,24),c=o.length,l=0,f=0,d=o[f],h=c;if(t(u))l=u+1;else{for(;f<h;)d>l&&(l=d),++f,d=o[f];if(l===-1)return 0;++l}for(var E=[],p=0;p<l;p++)E[p]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};f=0;for(var m=0;f<h;)E[o[f]].vertexTriangles.push(m),++E[o[f]].numLiveTriangles,E[o[f+1]].vertexTriangles.push(m),++E[o[f+1]].numLiveTriangles,E[o[f+2]].vertexTriangles.push(m),++E[o[f+2]].numLiveTriangles,++m,f+=3;var y=0,_=s+1;i=1;var T,v,R=[],A=[],S=0,N=[],I=c/3,g=[];for(p=0;p<I;p++)g[p]=!1;for(var O,w;y!==-1;){R=[],v=E[y],w=v.vertexTriangles.length;for(var M=0;M<w;++M)if(m=v.vertexTriangles[M],!g[m]){g[m]=!0,f=m+m+m;for(var x=0;x<3;++x)O=o[f],R.push(O),A.push(O),N[S]=O,++S,T=E[O],--T.numLiveTriangles,_-T.timeStamp>s&&(T.timeStamp=_,++_),++f}y=a(o,s,R,E,_,A,l)}return N},n}),define("Core/GeometryPipeline",["./AttributeCompression","./barycentricCoordinates","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./deprecationWarning","./DeveloperError","./EncodedCartesian3","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryType","./IndexDatatype","./Intersect","./IntersectionTests","./Math","./Matrix3","./Matrix4","./Plane","./PrimitiveType","./Tipsify"],function(e,t,r,n,a,i,o,u,s,c,l,f,d,h,E,p,m,y,_,T,v,R,A,S,N,I){"use strict";function g(e,t,r,n,a){e[t++]=r,e[t++]=n,e[t++]=n,e[t++]=a,e[t++]=a,e[t]=r}function O(e){for(var t=e.length,r=t/3*6,n=y.createTypedArray(t,r),a=0,i=0;i<t;i+=3,a+=6)g(n,a,e[i],e[i+1],e[i+2]);return n}function w(e){var t=e.length;if(t>=3){var r=6*(t-2),n=y.createTypedArray(t,r);g(n,0,e[0],e[1],e[2]);for(var a=6,i=3;i<t;++i,a+=6)g(n,a,e[i-1],e[i],e[i-2]);return n}return new Uint16Array}function M(e){if(e.length>0){for(var t=e.length-1,r=6*(t-1),n=y.createTypedArray(t,r),a=e[0],i=0,o=1;o<t;++o,i+=6)g(n,i,a,e[o],e[o+1]);return n}return new Uint16Array}function x(e){var t={};for(var r in e)if(e.hasOwnProperty(r)&&c(e[r])&&c(e[r].values)){var n=e[r];t[r]=new p({componentDatatype:n.componentDatatype,componentsPerAttribute:n.componentsPerAttribute,normalize:n.normalize,values:[]})}return t}function C(e,t,r){for(var n in t)if(t.hasOwnProperty(n)&&c(t[n])&&c(t[n].values))for(var a=t[n],i=0;i<a.componentsPerAttribute;++i)e[n].values.push(a.values[r*a.componentsPerAttribute+i])}function P(e,t){if(c(t))for(var r=t.values,n=r.length,i=0;i<n;i+=3)a.unpack(r,i,oe),A.multiplyByPoint(e,oe,oe),a.pack(oe,r,i)}function D(e,t){if(c(t))for(var r=t.values,n=r.length,i=0;i<n;i+=3)a.unpack(r,i,oe),R.multiplyByVector(e,oe,oe),oe=a.normalize(oe,oe),a.pack(oe,r,i)}function L(e,t){var r,n=e.length,a={},i=e[0][t].attributes;for(r in i)if(i.hasOwnProperty(r)&&c(i[r])&&c(i[r].values)){for(var o=i[r],s=o.values.length,l=!0,f=1;f<n;++f){var d=e[f][t].attributes[r];if(!c(d)||o.componentDatatype!==d.componentDatatype||o.componentsPerAttribute!==d.componentsPerAttribute||o.normalize!==d.normalize){l=!1;break}s+=d.values.length}l&&(a[r]=new p({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:u.createTypedArray(o.componentDatatype,s)}))}return a}function U(e,t){var n,i,o,u,s,l,f,d=e.length,h=(e[0].modelMatrix,c(e[0][t].indices)),p=e[0][t].primitiveType,m=L(e,t);for(n in m)if(m.hasOwnProperty(n))for(s=m[n].values,u=0,i=0;i<d;++i)for(l=e[i][t].attributes[n].values,f=l.length,o=0;o<f;++o)s[u++]=l[o];var _;if(h){var T=0;for(i=0;i<d;++i)T+=e[i][t].indices.length;var v=E.computeNumberOfVertices(new E({attributes:m,primitiveType:N.POINTS})),R=y.createTypedArray(v,T),A=0,S=0;for(i=0;i<d;++i){var I=e[i][t].indices,g=I.length;for(u=0;u<g;++u)R[A++]=S+I[u];S+=E.computeNumberOfVertices(e[i][t])}_=R}var O,w=new a,M=0;for(i=0;i<d;++i){if(O=e[i][t].boundingSphere,!c(O)){w=void 0;break}a.add(O.center,w,w)}if(c(w))for(a.divideByScalar(w,d,w),i=0;i<d;++i){O=e[i][t].boundingSphere;var x=a.magnitude(a.subtract(O.center,w,ce))+O.radius;x>M&&(M=x)}return new E({attributes:m,indices:_,primitiveType:p,boundingSphere:c(w)?new r(w,M):void 0})}function b(e){if(c(e.indices))return e;for(var t=E.computeNumberOfVertices(e),r=y.createTypedArray(t,t),n=0;n<t;++n)r[n]=n;return e.indices=r,e}function F(e){var t=E.computeNumberOfVertices(e),r=y.createTypedArray(t,3*(t-2));r[0]=1,r[1]=0,r[2]=2;for(var n=3,a=3;a<t;++a)r[n++]=a-1,r[n++]=0,r[n++]=a;return e.indices=r,e.primitiveType=N.TRIANGLES,e}function z(e){var t=E.computeNumberOfVertices(e),r=y.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,a=3;a<t-1;a+=2)r[n++]=a,r[n++]=a-1,r[n++]=a+1,a+2<t&&(r[n++]=a,r[n++]=a+1,r[n++]=a+2);return e.indices=r,e.primitiveType=N.TRIANGLES,e}function B(e){if(c(e.indices))return e;for(var t=E.computeNumberOfVertices(e),r=y.createTypedArray(t,t),n=0;n<t;++n)r[n]=n;return e.indices=r,e}function G(e){var t=E.computeNumberOfVertices(e),r=y.createTypedArray(t,2*(t-1));r[0]=0,r[1]=1;for(var n=2,a=2;a<t;++a)r[n++]=a-1,r[n++]=a;return e.indices=r,e.primitiveType=N.LINES,e}function q(e){var t=E.computeNumberOfVertices(e),r=y.createTypedArray(t,2*t);r[0]=0,r[1]=1;for(var n=2,a=2;a<t;++a)r[n++]=a-1,r[n++]=a;return r[n++]=t-1,r[n]=0,e.indices=r,e.primitiveType=N.LINES,e}function V(e){switch(e.primitiveType){case N.TRIANGLE_FAN:return F(e);case N.TRIANGLE_STRIP:return z(e);case N.TRIANGLES:return b(e);case N.LINE_STRIP:return G(e);case N.LINE_LOOP:return q(e);case N.LINES:return B(e)}return e}function W(e,t){Math.abs(e.y)<v.EPSILON6&&(t?e.y=-v.EPSILON6:e.y=v.EPSILON6)}function X(e,t,r){if(0!==e.y&&0!==t.y&&0!==r.y)return W(e,e.y<0),W(t,t.y<0),void W(r,r.y<0);var n,a=Math.abs(e.y),i=Math.abs(t.y),o=Math.abs(r.y);n=a>i?a>o?v.sign(e.y):v.sign(r.y):i>o?v.sign(t.y):v.sign(r.y);var u=n<0;W(e,u),W(t,u),W(r,u)}function H(e,t,r,n){a.add(e,a.multiplyByScalar(a.subtract(t,e,Ae),e.y/(e.y-t.y),Ae),r),a.clone(r,n),W(r,!0),W(n,!1)}function Y(e,t,r){if(!(e.x>=0||t.x>=0||r.x>=0)){X(e,t,r);var n=e.y<0,a=t.y<0,i=r.y<0,o=0;o+=n?1:0,o+=a?1:0,o+=i?1:0;var u=Oe.indices;1===o?(u[1]=3,u[2]=4,u[5]=6,u[7]=6,u[8]=5,n?(H(e,t,Se,Ie),H(e,r,Ne,ge),u[0]=0,u[3]=1,u[4]=2,u[6]=1):a?(H(t,r,Se,Ie),H(t,e,Ne,ge),u[0]=1,u[3]=2,u[4]=0,u[6]=2):i&&(H(r,e,Se,Ie),H(r,t,Ne,ge),u[0]=2,u[3]=0,u[4]=1,u[6]=0)):2===o&&(u[2]=4,u[4]=4,u[5]=3,u[7]=5,u[8]=6,n?a?i||(H(r,e,Se,Ie),H(r,t,Ne,ge),u[0]=0,u[1]=1,u[3]=0,u[6]=2):(H(t,r,Se,Ie),H(t,e,Ne,ge),u[0]=2,u[1]=0,u[3]=2,u[6]=1):(H(e,t,Se,Ie),H(e,r,Ne,ge),u[0]=1,u[1]=2,u[3]=1,u[6]=0));var s=Oe.positions;return s[0]=e,s[1]=t,s[2]=r,s.length=3,1!==o&&2!==o||(s[3]=Se,s[4]=Ne,s[5]=Ie,s[6]=ge,s.length=7),Oe}}function k(e,t){var n=e.attributes;if(0!==n.position.values.length){for(var a in n)if(n.hasOwnProperty(a)&&c(n[a])&&c(n[a].values)){var i=n[a];i.values=u.createTypedArray(i.componentDatatype,i.values)}var o=E.computeNumberOfVertices(e);return e.indices=y.createTypedArray(o,e.indices),t&&(e.boundingSphere=r.fromVertices(n.position.values)),e}}function j(e){var t=e.attributes,r={};for(var n in t)if(t.hasOwnProperty(n)&&c(t[n])&&c(t[n].values)){var a=t[n];r[n]=new p({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:[]})}return new E({attributes:r,indices:[],primitiveType:e.primitiveType})}function Z(e,t,r){var n=c(e.geometry.boundingSphere);t=k(t,n),r=k(r,n),c(r)&&!c(t)?e.geometry=r:!c(r)&&c(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=r,e.geometry=void 0)}function K(e,r,i,o,u,s,l,f,d,h,E,p){if(c(s)||c(l)||c(f)||c(d)||c(h)){var m=a.fromArray(u,3*e,we),y=a.fromArray(u,3*r,Me),_=a.fromArray(u,3*i,xe),T=t(o,m,y,_,Ce);if(c(s)){var v=a.fromArray(s,3*e,we),R=a.fromArray(s,3*r,Me),A=a.fromArray(s,3*i,xe);a.multiplyByScalar(v,T.x,v),a.multiplyByScalar(R,T.y,R),a.multiplyByScalar(A,T.z,A);var S=a.add(v,R,v);a.add(S,A,S),a.normalize(S,S),a.pack(S,E.normal.values,3*p)}if(c(h)){var N=a.fromArray(h,3*e,we),I=a.fromArray(h,3*r,Me),g=a.fromArray(h,3*i,xe);a.multiplyByScalar(N,T.x,N),a.multiplyByScalar(I,T.y,I),a.multiplyByScalar(g,T.z,g);var O;a.equals(N,a.ZERO)&&a.equals(I,a.ZERO)&&a.equals(g,a.ZERO)?(O=we,O.x=0,O.y=0,O.z=0):(O=a.add(N,I,N),a.add(O,g,O),a.normalize(O,O)),a.pack(O,E.extrudeDirection.values,3*p)}if(c(l)){var w=a.fromArray(l,3*e,we),M=a.fromArray(l,3*r,Me),x=a.fromArray(l,3*i,xe);a.multiplyByScalar(w,T.x,w),a.multiplyByScalar(M,T.y,M),a.multiplyByScalar(x,T.z,x);var C=a.add(w,M,w);a.add(C,x,C),a.normalize(C,C),a.pack(C,E.tangent.values,3*p)}if(c(f)){var P=a.fromArray(f,3*e,we),D=a.fromArray(f,3*r,Me),L=a.fromArray(f,3*i,xe);a.multiplyByScalar(P,T.x,P),a.multiplyByScalar(D,T.y,D),a.multiplyByScalar(L,T.z,L);var U=a.add(P,D,P);a.add(U,L,U),a.normalize(U,U),a.pack(U,E.bitangent.values,3*p)}if(c(d)){var b=n.fromArray(d,2*e,Pe),F=n.fromArray(d,2*r,De),z=n.fromArray(d,2*i,Le);n.multiplyByScalar(b,T.x,b),n.multiplyByScalar(F,T.y,F),n.multiplyByScalar(z,T.z,z);var B=n.add(b,F,b);n.add(B,z,B),n.pack(B,E.st.values,2*p)}}}function J(e,t,r,n,a,i){var o=e.position.values.length/3;if(a!==-1){var u=n[a],s=r[u];return s===-1?(r[u]=o,e.position.values.push(i.x,i.y,i.z),t.push(o),o):(t.push(s),s)}return e.position.values.push(i.x,i.y,i.z),t.push(o),o}function Q(e){var t,r,n,i,o,u=e.geometry,s=u.attributes,l=s.position.values,f=c(s.normal)?s.normal.values:void 0,d=c(s.bitangent)?s.bitangent.values:void 0,h=c(s.tangent)?s.tangent.values:void 0,E=c(s.st)?s.st.values:void 0,p=c(s.extrudeDirection)?s.extrudeDirection.values:void 0,m=u.indices,y=j(u),_=j(u),T=[];T.length=l.length/3;var v=[];for(v.length=l.length/3,o=0;o<T.length;++o)T[o]=-1,v[o]=-1;var R=m.length;for(o=0;o<R;o+=3){var A=m[o],S=m[o+1],N=m[o+2],I=a.fromArray(l,3*A),g=a.fromArray(l,3*S),O=a.fromArray(l,3*N),w=Y(I,g,O);if(c(w)&&w.positions.length>3)for(var M=w.positions,x=w.indices,C=x.length,P=0;P<C;++P){var D=x[P],L=M[D];L.y<0?(t=_.attributes,r=_.indices,n=T):(t=y.attributes,r=y.indices,n=v),i=J(t,r,n,m,D<3?o+D:-1,L),K(A,S,N,L,l,f,h,d,E,p,t,i)}else c(w)&&(I=w.positions[0],g=w.positions[1],O=w.positions[2]),I.y<0?(t=_.attributes,r=_.indices,n=T):(t=y.attributes,r=y.indices,n=v),i=J(t,r,n,m,o,I),K(A,S,N,I,l,f,h,d,E,p,t,i),i=J(t,r,n,m,o+1,g),K(A,S,N,g,l,f,h,d,E,p,t,i),i=J(t,r,n,m,o+2,O),K(A,S,N,O,l,f,h,d,E,p,t,i)}Z(e,_,y)}function $(e){var t,r=e.geometry,n=r.attributes,i=n.position.values,o=r.indices,u=j(r),s=j(r),l=o.length,f=[];f.length=i.length/3;var d=[];for(d.length=i.length/3,t=0;t<f.length;++t)f[t]=-1,d[t]=-1;for(t=0;t<l;t+=2){var h=o[t],E=o[t+1],p=a.fromArray(i,3*h,we),m=a.fromArray(i,3*E,Me);Math.abs(p.y)<v.EPSILON6&&(p.y<0?p.y=-v.EPSILON6:p.y=v.EPSILON6),Math.abs(m.y)<v.EPSILON6&&(m.y<0?m.y=-v.EPSILON6:m.y=v.EPSILON6);var y=u.attributes,_=u.indices,R=d,A=s.attributes,S=s.indices,N=f,I=T.lineSegmentPlane(p,m,Ue,xe);if(c(I)){var g=a.multiplyByScalar(a.UNIT_Y,5*v.EPSILON9,be);p.y<0&&(a.negate(g,g),y=s.attributes,_=s.indices,R=f,A=u.attributes,S=u.indices,N=d);var O=a.add(I,g,Fe);J(y,_,R,o,t,p),J(y,_,R,o,-1,O),a.negate(g,g),a.add(I,g,O),J(A,S,N,o,-1,O),J(A,S,N,o,t+1,m)}else{var w,M,x;p.y<0?(w=s.attributes,M=s.indices,x=f):(w=u.attributes,M=u.indices,x=d),J(w,M,x,o,t,p),J(w,M,x,o,t+1,m)}}Z(e,s,u)}function ee(e){for(var t=e.attributes,r=t.position.values,n=t.prevPosition.values,i=t.nextPosition.values,o=r.length,u=0;u<o;u+=3){var s=a.unpack(r,u,Ge);if(!(s.x>0)){var c=a.unpack(n,u,qe);(s.y<0&&c.y>0||s.y>0&&c.y<0)&&(u-3>0?(n[u]=r[u-3],n[u+1]=r[u-2],n[u+2]=r[u-1]):a.pack(s,n,u));var l=a.unpack(i,u,Ve);(s.y<0&&l.y>0||s.y>0&&l.y<0)&&(u+3<o?(i[u]=r[u+3],i[u+1]=r[u+4],i[u+2]=r[u+5]):a.pack(s,i,u))}}}function te(e){var t,r,o,u=e.geometry,s=u.attributes,l=s.position.values,f=s.prevPosition.values,d=s.nextPosition.values,h=s.expandAndWidth.values,E=c(s.st)?s.st.values:void 0,p=c(s.color)?s.color.values:void 0,m=j(u),y=j(u),_=!1,R=l.length/3;for(t=0;t<R;t+=4){var A=t,S=t+2,N=a.fromArray(l,3*A,Ge),I=a.fromArray(l,3*S,qe);if(Math.abs(N.y)<je)for(N.y=je*(I.y<0?-1:1),l[3*t+1]=N.y,l[3*(t+1)+1]=N.y,r=3*A;r<3*A+12;r+=3)f[r]=l[3*t],f[r+1]=l[3*t+1],f[r+2]=l[3*t+2];if(Math.abs(I.y)<je)for(I.y=je*(N.y<0?-1:1),l[3*(t+2)+1]=I.y,l[3*(t+3)+1]=I.y,r=3*A;r<3*A+12;r+=3)d[r]=l[3*(t+2)],d[r+1]=l[3*(t+2)+1],d[r+2]=l[3*(t+2)+2];var g=m.attributes,O=m.indices,w=y.attributes,M=y.indices,x=T.lineSegmentPlane(N,I,Ue,We);if(c(x)){_=!0;var C=a.multiplyByScalar(a.UNIT_Y,ke,Xe);N.y<0&&(a.negate(C,C),g=y.attributes,O=y.indices,w=m.attributes,M=m.indices);var P=a.add(x,C,He);g.position.values.push(N.x,N.y,N.z,N.x,N.y,N.z),g.position.values.push(P.x,P.y,P.z),g.position.values.push(P.x,P.y,P.z),g.prevPosition.values.push(f[3*A],f[3*A+1],f[3*A+2]),g.prevPosition.values.push(f[3*A+3],f[3*A+4],f[3*A+5]),g.prevPosition.values.push(N.x,N.y,N.z,N.x,N.y,N.z),g.nextPosition.values.push(P.x,P.y,P.z),g.nextPosition.values.push(P.x,P.y,P.z),g.nextPosition.values.push(P.x,P.y,P.z),g.nextPosition.values.push(P.x,P.y,P.z),a.negate(C,C),a.add(x,C,P),w.position.values.push(P.x,P.y,P.z),w.position.values.push(P.x,P.y,P.z),w.position.values.push(I.x,I.y,I.z,I.x,I.y,I.z),w.prevPosition.values.push(P.x,P.y,P.z),w.prevPosition.values.push(P.x,P.y,P.z),w.prevPosition.values.push(P.x,P.y,P.z),w.prevPosition.values.push(P.x,P.y,P.z),w.nextPosition.values.push(I.x,I.y,I.z,I.x,I.y,I.z),w.nextPosition.values.push(d[3*S],d[3*S+1],d[3*S+2]),w.nextPosition.values.push(d[3*S+3],d[3*S+4],d[3*S+5]);var D=n.fromArray(h,2*A,ze),L=Math.abs(D.y);g.expandAndWidth.values.push(-1,L,1,L),g.expandAndWidth.values.push(-1,-L,1,-L),w.expandAndWidth.values.push(-1,L,1,L),w.expandAndWidth.values.push(-1,-L,1,-L);var U=a.magnitudeSquared(a.subtract(x,N,Ve));if(U/=a.magnitudeSquared(a.subtract(I,N,Ve)),c(p)){var b=i.fromArray(p,4*A,Ye),F=i.fromArray(p,4*S,Ye),z=v.lerp(b.x,F.x,U),B=v.lerp(b.y,F.y,U),G=v.lerp(b.z,F.z,U),q=v.lerp(b.w,F.w,U);for(r=4*A;r<4*A+8;++r)g.color.values.push(p[r]);for(g.color.values.push(z,B,G,q),g.color.values.push(z,B,G,q),w.color.values.push(z,B,G,q),w.color.values.push(z,B,G,q),r=4*S;r<4*S+8;++r)w.color.values.push(p[r])}if(c(E)){var V=n.fromArray(E,2*A,ze),W=n.fromArray(E,2*(t+3),Be),X=v.lerp(V.x,W.x,U);for(r=2*A;r<2*A+4;++r)g.st.values.push(E[r]);for(g.st.values.push(X,V.y),g.st.values.push(X,W.y),w.st.values.push(X,V.y),w.st.values.push(X,W.y),r=2*S;r<2*S+4;++r)w.st.values.push(E[r])}o=g.position.values.length/3-4,O.push(o,o+2,o+1),O.push(o+1,o+2,o+3),o=w.position.values.length/3-4,M.push(o,o+2,o+1),M.push(o+1,o+2,o+3)}else{var H,Y;for(N.y<0?(H=y.attributes,Y=y.indices):(H=m.attributes,Y=m.indices),H.position.values.push(N.x,N.y,N.z),H.position.values.push(N.x,N.y,N.z),H.position.values.push(I.x,I.y,I.z),H.position.values.push(I.x,I.y,I.z),r=3*t;r<3*t+12;++r)H.prevPosition.values.push(f[r]),H.nextPosition.values.push(d[r]);for(r=2*t;r<2*t+8;++r)H.expandAndWidth.values.push(h[r]),c(E)&&H.st.values.push(E[r]);if(c(p))for(r=4*t;r<4*t+16;++r)H.color.values.push(p[r]);o=H.position.values.length/3-4,Y.push(o,o+2,o+1),Y.push(o+1,o+2,o+3)}}_&&(ee(y),ee(m)),Z(e,y,m)}var re={};re.toWireframe=function(e){var t=e.indices;if(c(t)){switch(e.primitiveType){case N.TRIANGLES:e.indices=O(t);break;case N.TRIANGLE_STRIP:e.indices=w(t);break;case N.TRIANGLE_FAN:e.indices=M(t)}e.primitiveType=N.LINES}return e},re.createLineSegmentsForVectors=function(e,t,n){t=s(t,"normal"),n=s(n,1e4);for(var a=e.attributes.position.values,i=e.attributes[t].values,o=a.length,l=new Float64Array(2*o),f=0,d=0;d<o;d+=3)l[f++]=a[d],l[f++]=a[d+1],l[f++]=a[d+2],l[f++]=a[d]+i[d]*n,l[f++]=a[d+1]+i[d+1]*n,l[f++]=a[d+2]+i[d+2]*n;var h,m=e.boundingSphere;return c(m)&&(h=new r(m.center,m.radius+n)),new E({attributes:{position:new p({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:N.LINES,boundingSphere:h})},re.createAttributeLocations=function(e){var t,r=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=e.attributes,a={},i=0,o=r.length;for(t=0;t<o;++t){var u=r[t];c(n[u])&&(a[u]=i++)}for(var s in n)n.hasOwnProperty(s)&&!c(a[s])&&(a[s]=i++);return a},re.reorderForPreVertexCache=function(e){var t=E.computeNumberOfVertices(e),r=e.indices;if(c(r)){for(var n=new Int32Array(t),a=0;a<t;a++)n[a]=-1;for(var i,o=r,s=o.length,l=y.createTypedArray(t,s),f=0,d=0,h=0;f<s;)i=n[o[f]],i!==-1?l[d]=i:(i=o[f], +n[i]=h,l[d]=h,++h),++f,++d;e.indices=l;var p=e.attributes;for(var m in p)if(p.hasOwnProperty(m)&&c(p[m])&&c(p[m].values)){for(var _=p[m],T=_.values,v=0,R=_.componentsPerAttribute,A=u.createTypedArray(_.componentDatatype,h*R);v<t;){var S=n[v];if(S!==-1)for(a=0;a<R;a++)A[R*S+a]=T[R*v+a];++v}_.values=A}}return e},re.reorderForPostVertexCache=function(e,t){var r=e.indices;if(e.primitiveType===N.TRIANGLES&&c(r)){for(var n=r.length,a=0,i=0;i<n;i++)r[i]>a&&(a=r[i]);e.indices=I.tipsify({indices:r,maximumIndex:a,cacheSize:t})}return e},re.fitToUnsignedShortIndices=function(e){var t=[],r=E.computeNumberOfVertices(e);if(c(e.indices)&&r>=v.SIXTY_FOUR_KILOBYTES){var n,a=[],i=[],o=0,u=x(e.attributes),s=e.indices,l=s.length;e.primitiveType===N.TRIANGLES?n=3:e.primitiveType===N.LINES?n=2:e.primitiveType===N.POINTS&&(n=1);for(var f=0;f<l;f+=n){for(var d=0;d<n;++d){var h=s[f+d],p=a[h];c(p)||(p=o++,a[h]=p,C(u,e.attributes,h)),i.push(p)}o+n>=v.SIXTY_FOUR_KILOBYTES&&(t.push(new E({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),a=[],i=[],o=0,u=x(e.attributes))}0!==i.length&&t.push(new E({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var ne=new a,ae=new o;re.projectTo2D=function(e,t,r,n,i){var o=e.attributes[t];i=c(i)?i:new h;for(var s=i.ellipsoid,l=o.values,f=new Float64Array(l.length),d=0,E=0;E<l.length;E+=3){var m=a.fromArray(l,E,ne),y=s.cartesianToCartographic(m,ae),_=i.project(y,ne);f[d++]=_.x,f[d++]=_.y,f[d++]=_.z}return e.attributes[r]=o,e.attributes[n]=new p({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:f}),delete e.attributes[t],e};var ie={high:0,low:0};re.encodeAttribute=function(e,t,r,n){for(var a=e.attributes[t],i=a.values,o=i.length,s=new Float32Array(o),c=new Float32Array(o),l=0;l<o;++l)d.encode(i[l],ie),s[l]=ie.high,c[l]=ie.low;var f=a.componentsPerAttribute;return e.attributes[r]=new p({componentDatatype:u.FLOAT,componentsPerAttribute:f,values:s}),e.attributes[n]=new p({componentDatatype:u.FLOAT,componentsPerAttribute:f,values:c}),delete e.attributes[t],e};var oe=new a,ue=new A,se=new R;re.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(A.equals(t,A.IDENTITY))return e;var n=e.geometry.attributes;P(t,n.position),P(t,n.prevPosition),P(t,n.nextPosition),(c(n.normal)||c(n.tangent)||c(n.bitangent))&&(A.inverse(t,ue),A.transpose(ue,ue),A.getRotation(ue,se),D(se,n.normal),D(se,n.tangent),D(se,n.bitangent));var a=e.geometry.boundingSphere;return c(a)&&(e.geometry.boundingSphere=r.transform(a,t,a)),e.modelMatrix=A.clone(A.IDENTITY),e};var ce=new a;re.combineInstances=function(e){for(var t=[],r=[],n=e.length,a=0;a<n;++a){var i=e[a];c(i.geometry)?t.push(i):c(i.westHemisphereGeometry)&&c(i.eastHemisphereGeometry)&&r.push(i)}var o=[];return t.length>0&&o.push(U(t,"geometry")),r.length>0&&(o.push(U(r,"westHemisphereGeometry")),o.push(U(r,"eastHemisphereGeometry"))),o};var le=new a,fe=new a,de=new a,he=new a;re.computeNormal=function(e){for(var t=e.indices,r=e.attributes,n=r.position.values,i=r.position.values.length/3,o=t.length,s=new Array(i),c=new Array(o/3),l=new Array(o),f=0;f<i;f++)s[f]={indexOffset:0,count:0,currentCount:0};var d=0;for(f=0;f<o;f+=3){var h=t[f],E=t[f+1],m=t[f+2],y=3*h,_=3*E,T=3*m;fe.x=n[y],fe.y=n[y+1],fe.z=n[y+2],de.x=n[_],de.y=n[_+1],de.z=n[_+2],he.x=n[T],he.y=n[T+1],he.z=n[T+2],s[h].count++,s[E].count++,s[m].count++,a.subtract(de,fe,de),a.subtract(he,fe,he),c[d]=a.cross(de,he,new a),d++}var v=0;for(f=0;f<i;f++)s[f].indexOffset+=v,v+=s[f].count;d=0;var R;for(f=0;f<o;f+=3){R=s[t[f]];var A=R.indexOffset+R.currentCount;l[A]=d,R.currentCount++,R=s[t[f+1]],A=R.indexOffset+R.currentCount,l[A]=d,R.currentCount++,R=s[t[f+2]],A=R.indexOffset+R.currentCount,l[A]=d,R.currentCount++,d++}var S=new Float32Array(3*i);for(f=0;f<i;f++){var N=3*f;if(R=s[f],R.count>0){for(a.clone(a.ZERO,le),d=0;d<R.count;d++)a.add(le,c[l[R.indexOffset+d]],le);a.normalize(le,le),S[N]=le.x,S[N+1]=le.y,S[N+2]=le.z}else S[N]=0,S[N+1]=0,S[N+2]=1}return e.attributes.normal=new p({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:S}),e};var Ee=new a,pe=new a,me=new a;re.computeTangentAndBitangent=function(e){for(var t=(e.attributes,e.indices),r=e.attributes.position.values,n=e.attributes.normal.values,i=e.attributes.st.values,o=e.attributes.position.values.length/3,s=t.length,c=new Array(3*o),l=0;l<c.length;l++)c[l]=0;var f,d,h;for(l=0;l<s;l+=3){var E=t[l],m=t[l+1],y=t[l+2];f=3*E,d=3*m,h=3*y;var _=2*E,T=2*m,v=2*y,R=r[f],A=r[f+1],S=r[f+2],N=i[_],I=i[_+1],g=i[T+1]-I,O=i[v+1]-I,w=1/((i[T]-N)*O-(i[v]-N)*g),M=(O*(r[d]-R)-g*(r[h]-R))*w,x=(O*(r[d+1]-A)-g*(r[h+1]-A))*w,C=(O*(r[d+2]-S)-g*(r[h+2]-S))*w;c[f]+=M,c[f+1]+=x,c[f+2]+=C,c[d]+=M,c[d+1]+=x,c[d+2]+=C,c[h]+=M,c[h+1]+=x,c[h+2]+=C}var P=new Float32Array(3*o),D=new Float32Array(3*o);for(l=0;l<o;l++){f=3*l,d=f+1,h=f+2;var L=a.fromArray(n,f,Ee),U=a.fromArray(c,f,me),b=a.dot(L,U);a.multiplyByScalar(L,b,pe),a.normalize(a.subtract(U,pe,U),U),P[f]=U.x,P[d]=U.y,P[h]=U.z,a.normalize(a.cross(L,U,U),U),D[f]=U.x,D[d]=U.y,D[h]=U.z}return e.attributes.tangent=new p({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:P}),e.attributes.bitangent=new p({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:D}),e},re.computeBinormalAndTangent=function(e){return l("computeBinormalAndTangent","computeBinormalAndTangent was deprecated in 1.30. It will be removed in 1.31. Use a computeTangentAndBitangent."),re.computeTangentAndBitangent(e),e.attributes.binormal=e.attributes.bitangent,e};var ye=new n,_e=new a,Te=new a,ve=new a,Re=new n;re.compressVertices=function(t){var r,i,o=t.attributes.extrudeDirection;if(c(o)){var s=o.values;i=s.length/3;var l=new Float32Array(2*i),f=0;for(r=0;r<i;++r)a.fromArray(s,3*r,_e),a.equals(_e,a.ZERO)?f+=2:(Re=e.octEncodeInRange(_e,65535,Re),l[f++]=Re.x,l[f++]=Re.y);return t.attributes.compressedAttributes=new p({componentDatatype:u.FLOAT,componentsPerAttribute:2,values:l}),delete t.attributes.extrudeDirection,t}var d=t.attributes.normal,h=t.attributes.st,E=c(d),m=c(h);if(!E&&!m)return t;var y,_,T,v,R=t.attributes.tangent,A=t.attributes.bitangent,S=c(R),N=c(A);E&&(y=d.values),m&&(_=h.values),S&&(T=R.values),N&&(v=A.values);var I=E?y.length:_.length,g=E?3:2;i=I/g;var O=i,w=m&&E?2:1;w+=S||N?1:0,O*=w;var M=new Float32Array(O),x=0;for(r=0;r<i;++r){m&&(n.fromArray(_,2*r,ye),M[x++]=e.compressTextureCoordinates(ye));var C=3*r;E&&c(T)&&c(v)?(a.fromArray(y,C,_e),a.fromArray(T,C,Te),a.fromArray(v,C,ve),e.octPack(_e,Te,ve,ye),M[x++]=ye.x,M[x++]=ye.y):(E&&(a.fromArray(y,C,_e),M[x++]=e.octEncodeFloat(_e)),S&&(a.fromArray(T,C,_e),M[x++]=e.octEncodeFloat(_e)),N&&(a.fromArray(v,C,_e),M[x++]=e.octEncodeFloat(_e)))}return t.attributes.compressedAttributes=new p({componentDatatype:u.FLOAT,componentsPerAttribute:w,values:M}),E&&delete t.attributes.normal,m&&delete t.attributes.st,N&&delete t.attributes.bitangent,S&&delete t.attributes.tangent,t};var Ae=new a,Se=new a,Ne=new a,Ie=new a,ge=new a,Oe={positions:new Array(7),indices:new Array(9)},we=new a,Me=new a,xe=new a,Ce=new a,Pe=new n,De=new n,Le=new n,Ue=S.fromPointNormal(a.ZERO,a.UNIT_Y),be=new a,Fe=new a,ze=new n,Be=new n,Ge=new a,qe=new a,Ve=new a,We=new a,Xe=new a,He=new a,Ye=new i,ke=5*v.EPSILON9,je=v.EPSILON6;return re.splitLongitude=function(e){var t=e.geometry,n=t.boundingSphere;if(c(n)){var a=n.center.x-n.radius;if(a>0||r.intersectPlane(n,S.ORIGIN_ZX_PLANE)!==_.INTERSECTING)return e}if(t.geometryType!==m.NONE)switch(t.geometryType){case m.POLYLINES:te(e);break;case m.TRIANGLES:Q(e);break;case m.LINES:$(e)}else V(t),t.primitiveType===N.TRIANGLES?Q(e):t.primitiveType===N.LINES&&$(e);return e},re}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,r,n,a){return t(e).then(r,n,a)}function t(e){var t,r;return e instanceof n?t=e:u(e)?(r=o(),e.then(function(e){r.resolve(e)},function(e){r.reject(e)},function(e){r.progress(e)}),t=r.promise):t=a(e),t}function r(t){return e(t,i)}function n(e){this.then=e}function a(e){var r=new n(function(r){try{return t(r?r(e):e)}catch(e){return i(e)}});return r}function i(e){var r=new n(function(r,n){try{return n?t(n(e)):i(e)}catch(e){return i(e)}});return r}function o(){function e(e,t,r){return d(e,t,r)}function r(e){return E(e)}function a(e){return E(i(e))}function u(e){return h(e)}var s,c,l,f,d,h,E;return c=new n(e),s={then:e,resolve:r,reject:a,progress:u,promise:c,resolver:{resolve:r,reject:a,progress:u}},l=[],f=[],d=function(e,t,r){var n,a;return n=o(),a="function"==typeof r?function(e){try{n.progress(r(e))}catch(e){n.progress(e)}}:function(e){n.progress(e)},l.push(function(r){r.then(e,t).then(n.resolve,n.reject,a)}),f.push(a),n.promise},h=function(e){return p(f,e),e},E=function(e){return e=t(e),d=e.then,E=t,h=y,p(l,e),f=l=R,e},s}function u(e){return e&&"function"==typeof e.then}function s(t,r,n,a,i){return m(2,arguments),e(t,function(t){function u(e){p(e)}function s(e){E(e)}var c,l,f,d,h,E,p,m,_,T;if(_=t.length>>>0,c=Math.max(0,Math.min(r,_)),f=[],l=_-c+1,d=[],h=o(),c)for(m=h.progress,p=function(e){d.push(e),--l||(E=p=y,h.reject(d))},E=function(e){f.push(e),--c||(E=p=y,h.resolve(f))},T=0;T<_;++T)T in t&&e(t[T],s,u,m);else h.resolve(f);return h.then(n,a,i)})}function c(e,t,r,n){function a(e){return t?t(e[0]):e[0]}return s(e,1,a,r,n)}function l(e,t,r,n){return m(1,arguments),d(e,_).then(t,r,n)}function f(){return d(arguments,_)}function d(t,r){return e(t,function(t){var n,a,i,u,s,c;if(i=a=t.length>>>0,n=[],c=o(),i)for(u=function(t,a){e(t,r).then(function(e){n[a]=e,--i||c.resolve(n)},c.reject)},s=0;s<a;s++)s in t?u(t[s],s):--i;else c.resolve(n);return c.promise})}function h(t,r){var n=v.call(arguments,1);return e(t,function(t){var a;return a=t.length,n[0]=function(t,n,i){return e(t,function(t){return e(n,function(e){return r(t,e,i,a)})})},T.apply(t,n)})}function E(t,r,n){var a=arguments.length>2;return e(t,function(e){return e=a?n:e,r.resolve(e),e},function(e){return r.reject(e),i(e)},r.progress)}function p(e,t){for(var r,n=0;r=e[n++];)r(t)}function m(e,t){for(var r,n=t.length;n>e;)if(r=t[--n],null!=r&&"function"!=typeof r)throw new Error("arg "+n+" must be a function")}function y(){}function _(e){return e}var T,v,R;return e.defer=o,e.resolve=t,e.reject=r,e.join=f,e.all=l,e.map=d,e.reduce=h,e.any=c,e.some=s,e.chain=E,e.isPromise=u,n.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(R,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return l(t,function(t){return e.apply(R,t)})})}},v=[].slice,T=[].reduce||function(e){var t,r,n,a,i;if(i=0,t=Object(this),a=t.length>>>0,r=arguments,r.length<=1)for(;;){if(i in t){n=t[i++];break}if(++i>=a)throw new TypeError}else n=r[1];for(;i<a;++i)i in t&&(n=e(n,t[i],i,t));return n},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/binarySearch",["./defined","./DeveloperError"],function(e,t){"use strict";function r(e,t,r){for(var n,a,i=0,o=e.length-1;i<=o;)if(n=~~((i+o)/2),a=r(e[n],t),a<0)i=n+1;else{if(!(a>0))return n;o=n-1}return~(o+1)}return r}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,r,n,a){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=r,this.yPoleOffset=n,this.ut1MinusUtc=a}return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,r=0,n=t[r++],a=function(e,t,r,n){r||(r=" ");var a=e.length>=t?"":Array(1+t-e.length>>>0).join(r);return n?e+a:a+e},i=function(e,t,r,n,i,o){var u=n-e.length;return u>0&&(e=r||!i?a(e,n,o,r):e.slice(0,t.length)+a("",u,"0",!0)+e.slice(t.length)),e},o=function(e,t,r,n,o,u,s){var c=e>>>0;return r=r&&c&&{2:"0b",8:"0",16:"0x"}[t]||"",e=r+a(c.toString(t),u||0,"0",!1),i(e,r,n,o,s)},u=function(e,t,r,n,a,o){return null!=n&&(e=e.slice(0,n)),i(e,"",t,r,a,o)},s=function(e,n,s,c,l,f,d){var h,E,p,m,y;if("%%"==e)return"%";for(var _=!1,T="",v=!1,R=!1,A=" ",S=s.length,N=0;s&&N<S;N++)switch(s.charAt(N)){case" ":T=" ";break;case"+":T="+";break;case"-":_=!0;break;case"'":A=s.charAt(N+1);break;case"0":v=!0;break;case"#":R=!0}if(c=c?"*"==c?+t[r++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,c<0&&(c=-c,_=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(f=f?"*"==f?+t[r++]:"*"==f.charAt(0)?+t[f.slice(1,-1)]:+f:"fFeE".indexOf(d)>-1?6:"d"==d?0:void 0,y=n?t[n.slice(0,-1)]:t[r++],d){case"s":return u(String(y),_,c,f,v,A);case"c":return u(String.fromCharCode(+y),_,c,f,v);case"b":return o(y,2,R,_,c,f,v);case"o":return o(y,8,R,_,c,f,v);case"x":return o(y,16,R,_,c,f,v);case"X":return o(y,16,R,_,c,f,v).toUpperCase();case"u":return o(y,10,R,_,c,f,v);case"i":case"d":return h=+y||0,h=Math.round(h-h%1),E=h<0?"-":T,y=E+a(String(Math.abs(h)),f,"0",!1),i(y,E,_,c,v);case"e":case"E":case"f":case"F":case"g":case"G":return h=+y,E=h<0?"-":T,p=["toExponential","toFixed","toPrecision"]["efg".indexOf(d.toLowerCase())],m=["toString","toUpperCase"]["eEfFgG".indexOf(d)%2],y=E+Math.abs(h)[p](f),i(y,E,_,c,v)[m]();default:return e}};return n.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,r,n,a,i,o,u){this.year=e,this.month=t,this.day=r,this.hour=n,this.minute=a,this.second=i,this.millisecond=o,this.isLeapSecond=u}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e(t)}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,r,n,a,i,o,u,s,c){"use strict";function l(e,t){return p.compare(e.julianDate,t.julianDate)}function f(e){T.julianDate=e;var r=p.leapSeconds,n=t(r,T,l);n<0&&(n=~n),n>=r.length&&(n=r.length-1);var a=r[n].offset;if(n>0){var i=p.secondsDifference(r[n].julianDate,e);i>a&&(n--,a=r[n].offset)}p.addSeconds(e,a,e)}function d(e,r){T.julianDate=e;var n=p.leapSeconds,a=t(n,T,l);if(a<0&&(a=~a),0===a)return p.addSeconds(e,-n[0].offset,r);if(a>=n.length)return p.addSeconds(e,-n[a-1].offset,r);var i=p.secondsDifference(n[a].julianDate,e);return 0===i?p.addSeconds(e,-n[a].offset,r):i<=1?void 0:p.addSeconds(e,-n[--a].offset,r)}function h(e,t,r){var n=t/s.SECONDS_PER_DAY|0;return e+=n,t-=s.SECONDS_PER_DAY*n,t<0&&(e--,t+=s.SECONDS_PER_DAY),r.dayNumber=e,r.secondsOfDay=t,r}function E(e,t,r,n,a,i,o){var u=(t-14)/12|0,c=e+4800+u,l=(1461*c/4|0)+(367*(t-2-12*u)/12|0)-(3*((c+100)/100|0)/4|0)+r-32075;n-=12,n<0&&(n+=24);var f=i+(n*s.SECONDS_PER_HOUR+a*s.SECONDS_PER_MINUTE+o*s.SECONDS_PER_MILLISECOND);return f>=43200&&(l-=1),[l,f]}function p(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=r(e,0),t=r(t,0),n=r(n,c.UTC);var a=0|e;t+=(e-a)*s.SECONDS_PER_DAY,h(a,t,this),n===c.UTC&&f(this)}var m=new i,y=[31,28,31,30,31,30,31,31,30,31,30,31],_=29,T=new u,v=/^(\d{4})$/,R=/^(\d{4})-(\d{2})$/,A=/^(\d{4})-?(\d{3})$/,S=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,N=/^(\d{4})-?(\d{2})-?(\d{2})$/,I=/([Z+\-])?(\d{2})?:?(\d{2})?$/,g=/^(\d{2})(\.\d+)?/.source+I.source,O=/^(\d{2}):?(\d{2})(\.\d+)?/.source+I.source,w=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+I.source;p.fromDate=function(e,t){var r=E(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return n(t)?(h(r[0],r[1],t),f(t),t):new p(r[0],r[1],c.UTC)},p.fromIso8601=function(e,t){e=e.replace(",",".");var r,a,i,u=e.split("T"),s=1,l=1,d=0,m=0,T=0,I=0,M=u[0],x=u[1];if(u=M.match(N),null!==u)r=+u[1],s=+u[2],l=+u[3];else if(u=M.match(R),null!==u)r=+u[1],s=+u[2];else if(u=M.match(v),null!==u)r=+u[1];else{var C;if(u=M.match(A),null!==u)r=+u[1],C=+u[2],i=o(r);else if(u=M.match(S),null!==u){r=+u[1];var P=+u[2],D=+u[3]||0,L=new Date(Date.UTC(r,0,4));C=7*P+D-L.getUTCDay()-3}a=new Date(Date.UTC(r,0,1)),a.setUTCDate(C),s=a.getUTCMonth()+1,l=a.getUTCDate()}i=o(r);var U;if(n(x)){u=x.match(w),null!==u?(d=+u[1],m=+u[2],T=+u[3],I=1e3*+(u[4]||0),U=5):(u=x.match(O),null!==u?(d=+u[1],m=+u[2],T=60*+(u[3]||0),U=4):(u=x.match(g),null!==u&&(d=+u[1],m=60*+(u[2]||0),U=3)));var b=u[U],F=+u[U+1],z=+(u[U+2]||0);switch(b){case"+":d-=F,m-=z;break;case"-":d+=F,m+=z;break;case"Z":break;default:m+=new Date(Date.UTC(r,s-1,l,d,m)).getTimezoneOffset()}}else m+=new Date(r,s-1,l).getTimezoneOffset();var B=60===T;for(B&&T--;m>=60;)m-=60,d++;for(;d>=24;)d-=24,l++;for(a=i&&2===s?_:y[s-1];l>a;)l-=a,s++,s>12&&(s-=12,r++),a=i&&2===s?_:y[s-1];for(;m<0;)m+=60,d--;for(;d<0;)d+=24,l--;for(;l<1;)s--,s<1&&(s+=12,r--),a=i&&2===s?_:y[s-1],l+=a;var G=E(r,s,l,d,m,T,I);return n(t)?(h(G[0],G[1],t),f(t)):t=new p(G[0],G[1],c.UTC),B&&p.addSeconds(t,1,t),t},p.now=function(e){return p.fromDate(new Date,e)};var M=new p(0,0,c.TAI);return p.toGregorianDate=function(e,t){var r=!1,a=d(e,M);n(a)||(p.addSeconds(e,-1,M),a=d(M,M),r=!0);var o=a.dayNumber,u=a.secondsOfDay;u>=43200&&(o+=1);var c=o+68569|0,l=4*c/146097|0;c=c-((146097*l+3)/4|0)|0;var f=4e3*(c+1)/1461001|0;c=c-(1461*f/4|0)+31|0;var h=80*c/2447|0,E=c-(2447*h/80|0)|0;c=h/11|0;var m=h+2-12*c|0,y=100*(l-49)+f+c|0,_=u/s.SECONDS_PER_HOUR|0,T=u-_*s.SECONDS_PER_HOUR,v=T/s.SECONDS_PER_MINUTE|0;T-=v*s.SECONDS_PER_MINUTE;var R=0|T,A=(T-R)/s.SECONDS_PER_MILLISECOND;return _+=12,_>23&&(_-=24),r&&(R+=1),n(t)?(t.year=y,t.month=m,t.day=E,t.hour=_,t.minute=v,t.second=R,t.millisecond=A,t.isLeapSecond=r,t):new i(y,m,E,_,v,R,A,r)},p.toDate=function(e){var t=p.toGregorianDate(e,m),r=t.second;return t.isLeapSecond&&(r-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,r,t.millisecond))},p.toIso8601=function(t,r){var a,i=p.toGregorianDate(t,i);return n(r)||0===i.millisecond?n(r)&&0!==r?(a=(.01*i.millisecond).toFixed(r).replace(".","").slice(0,r),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",i.year,i.month,i.day,i.hour,i.minute,i.second):(a=(.01*i.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a))},p.clone=function(e,t){if(n(e))return n(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new p(e.dayNumber,e.secondsOfDay,c.TAI)},p.compare=function(e,t){var r=e.dayNumber-t.dayNumber;return 0!==r?r:e.secondsOfDay-t.secondsOfDay},p.equals=function(e,t){return e===t||n(e)&&n(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},p.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(p.secondsDifference(e,t))<=r},p.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},p.secondsDifference=function(e,t){var r=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return r+(e.secondsOfDay-t.secondsOfDay)},p.daysDifference=function(e,t){var r=e.dayNumber-t.dayNumber,n=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return r+n},p.computeTaiMinusUtc=function(e){T.julianDate=e;var r=p.leapSeconds,n=t(r,T,l);return n<0&&(n=~n,--n,n<0&&(n=0)),r[n].offset},p.addSeconds=function(e,t,r){return h(e.dayNumber,e.secondsOfDay+t,r)},p.addMinutes=function(e,t,r){var n=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return h(e.dayNumber,n,r)},p.addHours=function(e,t,r){var n=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return h(e.dayNumber,n,r)},p.addDays=function(e,t,r){var n=e.dayNumber+t;return h(n,e.secondsOfDay,r)},p.lessThan=function(e,t){return p.compare(e,t)<0},p.lessThanOrEquals=function(e,t){return p.compare(e,t)<=0},p.greaterThan=function(e,t){return p.compare(e,t)>0},p.greaterThanOrEquals=function(e,t){return p.compare(e,t)>=0},p.prototype.clone=function(e){return p.clone(this,e)},p.prototype.equals=function(e){return p.equals(this,e)},p.prototype.equalsEpsilon=function(e,t){return p.equalsEpsilon(this,e,t)},p.prototype.toString=function(){return p.toIso8601(this)},p.leapSeconds=[new u(new p(2441317,43210,c.TAI),10),new u(new p(2441499,43211,c.TAI),11),new u(new p(2441683,43212,c.TAI),12),new u(new p(2442048,43213,c.TAI),13),new u(new p(2442413,43214,c.TAI),14),new u(new p(2442778,43215,c.TAI),15),new u(new p(2443144,43216,c.TAI),16),new u(new p(2443509,43217,c.TAI),17),new u(new p(2443874,43218,c.TAI),18),new u(new p(2444239,43219,c.TAI),19),new u(new p(2444786,43220,c.TAI),20),new u(new p(2445151,43221,c.TAI),21),new u(new p(2445516,43222,c.TAI),22),new u(new p(2446247,43223,c.TAI),23),new u(new p(2447161,43224,c.TAI),24),new u(new p(2447892,43225,c.TAI),25),new u(new p(2448257,43226,c.TAI),26),new u(new p(2448804,43227,c.TAI),27),new u(new p(2449169,43228,c.TAI),28),new u(new p(2449534,43229,c.TAI),29),new u(new p(2450083,43230,c.TAI),30),new u(new p(2450630,43231,c.TAI),31),new u(new p(2451179,43232,c.TAI),32),new u(new p(2453736,43233,c.TAI),33),new u(new p(2454832,43234,c.TAI),34),new u(new p(2456109,43235,c.TAI),35),new u(new p(2457204,43236,c.TAI),36),new u(new p(2457754,43237,c.TAI),37)],p}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(r,n){if(null===r||"object"!=typeof r)return r;n=e(n,!1);var a=new r.constructor;for(var i in r)if(r.hasOwnProperty(i)){var o=r[i];n&&(o=t(o,n)),a[i]=o}return a}return t}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var r=e.split("\r\n"),n=0;n<r.length;++n){var a=r[n],i=a.indexOf(": ");if(i>0){var o=a.substring(0,i),u=a.substring(i+2);t[o]=u}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function r(e,r,n){this.statusCode=e,this.response=r,this.responseHeaders=n,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return r.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},r}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var r=n.exec(t);this.scheme=r[1],this.authority=r[2],this.path=r[3],this.query=r[4],this.fragment=r[5]}}function t(e){var t=unescape(e);return i.test(t)?t:e.toUpperCase()}function r(e,t,r,n){return(t||"")+r.toLowerCase()+(n||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var n=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(o,r).replace(a,t)),this.path&&(this.path=this.path.replace(a,t)),this.query&&(this.query=this.query.replace(a,t)),this.fragment&&(this.fragment=this.fragment.replace(a,t))};var a=/%[0-9a-z]{2}/gi,i=/[a-zA-Z0-9\-\._~]/,o=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var r=new e;return this.scheme?(r.scheme=this.scheme,r.authority=this.authority,r.path=this.path,r.query=this.query):(r.scheme=t.scheme,this.authority?(r.authority=this.authority,r.path=this.path,r.query=this.query):(r.authority=t.authority,""==this.path?(r.path=t.path,r.query=this.query||t.query):("/"==this.path.charAt(0)?(r.path=this.path,r.removeDotSegments()):(t.authority&&""==t.path?r.path="/"+this.path:r.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,r.removeDotSegments()),r.query=this.query))),r.fragment=this.fragment,r},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),r=[],n=""==t[0];n&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?r.pop():"."!=e&&r.push(e);"."!=e&&".."!=e||r.push(""),n&&r.unshift(""),this.path=r.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(r){var n=new e(r);n.normalize();var a=n.getAuthority();if(t(a)){if(a.indexOf("@")!==-1){var i=a.split("@");a=i[1]}if(a.indexOf(":")===-1){var o=n.getScheme();if(t(o)||(o=window.location.protocol,o=o.substring(0,o.length-1)),"http"===o)a+=":80";else{if("https"!==o)return;a+=":443"}}return a}}var a={},i={};return a.add=function(e,r){var n=e.toLowerCase()+":"+r;t(i[n])||(i[n]=!0)},a.remove=function(e,r){var n=e.toLowerCase()+":"+r;t(i[n])&&delete i[n]},a.contains=function(e){var r=n(e);return!(!t(r)||!t(i[r]))},a.clear=function(){i={}},a}),define("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,r,n,a,i,o){"use strict";function u(r){r=t(r,t.EMPTY_OBJECT);var n=r.responseType,a=t(r.method,"GET"),i=r.data,o=r.headers,s=r.overrideMimeType;return e(r.url,function(t){var r=e.defer();return u.load(t,n,a,i,o,r,s),r.promise})}function s(e,t){var r=decodeURIComponent(t);return e?atob(r):r}function c(e,t){for(var r=s(e,t),n=new ArrayBuffer(r.length),a=new Uint8Array(n),i=0;i<r.length;i++)a[i]=r.charCodeAt(i);return n}function l(e,r){r=t(r,"");var n=e[1],a=!!e[2],i=e[3];switch(r){case"":case"text":return s(a,i);case"arraybuffer":return c(a,i);case"blob":var o=c(a,i);return new Blob([o],{type:n});case"document":var u=new DOMParser;return u.parseFromString(s(a,i),n);case"json":return JSON.parse(s(a,i))}}var f=/^data:(.*?)(;base64)?,(.*)$/;return u.load=function(e,t,n,u,s,c,d){var h=f.exec(e);if(null!==h)return void c.resolve(l(h,t));var E=new XMLHttpRequest;if(o.contains(e)&&(E.withCredentials=!0),r(d)&&r(E.overrideMimeType)&&E.overrideMimeType(d),E.open(n,e,!0),r(s))for(var p in s)s.hasOwnProperty(p)&&E.setRequestHeader(p,s[p]);r(t)&&(E.responseType=t),E.onload=function(){if(E.status<200||E.status>=300)return void c.reject(new a(E.status,E.response,E.getAllResponseHeaders()));var e=E.response,n=E.responseType;if(!r(e)||r(t)&&n!==t)if("json"===t&&"string"==typeof e)try{c.resolve(JSON.parse(e))}catch(e){c.reject(e)}else(""===n||"document"===n)&&r(E.responseXML)&&E.responseXML.hasChildNodes()?c.resolve(E.responseXML):""!==n&&"text"!==n||!r(E.responseText)?c.reject(new i("Invalid XMLHttpRequest response type.")):c.resolve(E.responseText);else c.resolve(e)},E.onerror=function(e){c.reject(new a)},E.send(u)},u.defaultLoad=u.load,u}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,r){return e({url:t,headers:r})}return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,r,n){"use strict";function a(r,a){return t(a)?t(a.Accept)||(a=e(a),a.Accept=i.Accept):a=i,n(r,a).then(function(e){return JSON.parse(e)})}var i={Accept:"application/json,*/*;q=0.01"};return a}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,r,n,a,i,o,u,s,c,l,f){"use strict";function d(t){if(t=r(t,r.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=r(t.addNewLeapSeconds,!0),n(t.data))E(this,t.data);else if(n(t.url)){var a=this;this._downloadPromise=e(s(t.url),function(e){E(a,e)},function(){a._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else E(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function h(e,t){return o.compare(e.julianDate,t)}function E(e,r){if(!n(r.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!n(r.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var a=r.columnNames.indexOf("modifiedJulianDateUtc"),i=r.columnNames.indexOf("xPoleWanderRadians"),s=r.columnNames.indexOf("yPoleWanderRadians"),c=r.columnNames.indexOf("ut1MinusUtcSeconds"),d=r.columnNames.indexOf("xCelestialPoleOffsetRadians"),E=r.columnNames.indexOf("yCelestialPoleOffsetRadians"),p=r.columnNames.indexOf("taiMinusUtcSeconds");if(a<0||i<0||s<0||c<0||d<0||E<0||p<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var m=e._samples=r.samples,y=e._dates=[];e._dateColumn=a,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=d,e._yCelestialPoleOffsetRadiansColumn=E,e._taiMinusUtcSecondsColumn=p,e._columnCount=r.columnNames.length,e._lastIndex=void 0;for(var _,T=e._addNewLeapSeconds,v=0,R=m.length;v<R;v+=e._columnCount){var A=m[v+a],S=m[v+p],N=A+l.MODIFIED_JULIAN_DATE_DIFFERENCE,I=new o(N,S,f.TAI);if(y.push(I),T){if(S!==_&&n(_)){var g=o.leapSeconds,O=t(g,I,h);if(O<0){var w=new u(I,S);g.splice(~O,0,w)}}_=S}}}function p(e,t,r,n,a){var i=r*n;a.xPoleWander=t[i+e._xPoleWanderRadiansColumn],a.yPoleWander=t[i+e._yPoleWanderRadiansColumn],a.xPoleOffset=t[i+e._xCelestialPoleOffsetRadiansColumn],a.yPoleOffset=t[i+e._yCelestialPoleOffsetRadiansColumn],a.ut1MinusUtc=t[i+e._ut1MinusUtcSecondsColumn]}function m(e,t,r){return t+e*(r-t)}function y(e,t,r,n,a,i,u){var s=e._columnCount;if(i>t.length-1)return u.xPoleWander=0,u.yPoleWander=0,u.xPoleOffset=0,u.yPoleOffset=0,u.ut1MinusUtc=0,u;var c=t[a],l=t[i];if(c.equals(l)||n.equals(c))return p(e,r,a,s,u),u;if(n.equals(l))return p(e,r,i,s,u),u;var f=o.secondsDifference(n,c)/o.secondsDifference(l,c),d=a*s,h=i*s,E=r[d+e._ut1MinusUtcSecondsColumn],y=r[h+e._ut1MinusUtcSecondsColumn],_=y-E;if(_>.5||_<-.5){var T=r[d+e._taiMinusUtcSecondsColumn],v=r[h+e._taiMinusUtcSecondsColumn];T!==v&&(l.equals(n)?E=y:y-=v-T)}return u.xPoleWander=m(f,r[d+e._xPoleWanderRadiansColumn],r[h+e._xPoleWanderRadiansColumn]),u.yPoleWander=m(f,r[d+e._yPoleWanderRadiansColumn],r[h+e._yPoleWanderRadiansColumn]),u.xPoleOffset=m(f,r[d+e._xCelestialPoleOffsetRadiansColumn],r[h+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=m(f,r[d+e._yCelestialPoleOffsetRadiansColumn],r[h+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=m(f,E,y),u}return d.NONE=i({getPromiseToLoad:function(){return e()},compute:function(e,t){return n(t)?(t.xPoleWander=0, +t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new a(0,0,0,0,0),t}}),d.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},d.prototype.compute=function(e,r){if(n(this._samples)){if(n(r)||(r=new a(0,0,0,0,0)),0===this._samples.length)return r.xPoleWander=0,r.yPoleWander=0,r.xPoleOffset=0,r.yPoleOffset=0,r.ut1MinusUtc=0,r;var i=this._dates,u=this._lastIndex,s=0,l=0;if(n(u)){var f=i[u],d=i[u+1],h=o.lessThanOrEquals(f,e),E=!n(d),p=E||o.greaterThanOrEquals(d,e);if(h&&p)return s=u,!E&&d.equals(e)&&++s,l=s+1,y(this,i,this._samples,e,s,l,r),r}var m=t(i,e,o.compare,this._dateColumn);return m>=0?(m<i.length-1&&i[m+1].equals(e)&&++m,s=m,l=m):(l=~m,s=l-1,s<0&&(s=0)),this._lastIndex=s,y(this,i,this._samples,e,s,l,r),r}if(n(this._dataError))throw new c(this._dataError)},d}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,r,n){"use strict";function a(t,r,n){this.heading=e(t,0),this.pitch=e(r,0),this.roll=e(n,0)}return a.fromQuaternion=function(e,r){t(r)||(r=new a);var n=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return r.heading=-Math.atan2(s,u),r.roll=Math.atan2(o,i),r.pitch=-Math.asin(n),r},a.fromDegrees=function(e,r,i,o){return t(o)||(o=new a),o.heading=e*n.RADIANS_PER_DEGREE,o.pitch=r*n.RADIANS_PER_DEGREE,o.roll=i*n.RADIANS_PER_DEGREE,o},a.clone=function(e,r){if(t(e))return t(r)?(r.heading=e.heading,r.pitch=e.pitch,r.roll=e.roll,r):new a(e.heading,e.pitch,e.roll)},a.equals=function(e,r){return e===r||t(e)&&t(r)&&e.heading===r.heading&&e.pitch===r.pitch&&e.roll===r.roll},a.equalsEpsilon=function(e,r,a,i){return e===r||t(e)&&t(r)&&n.equalsEpsilon(e.heading,r.heading,a,i)&&n.equalsEpsilon(e.pitch,r.pitch,a,i)&&n.equalsEpsilon(e.roll,r.roll,a,i)},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,r){return a.equalsEpsilon(this,e,t,r)},a.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},a}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function a(r,n){n=t(n,document.location.href);var a=new e(n),i=new e(r);return i.resolve(a).toString()}return a}),define("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function a(n,a,i){i=t(i,!0),n instanceof e||(n=new e(n)),a instanceof e||(a=new e(a)),r(a.authority)&&!r(a.scheme)&&("undefined"!=typeof document&&r(document.location)&&r(document.location.href)?a.scheme=new e(document.location.href).scheme:a.scheme=n.scheme);var o=n;a.isAbsolute()&&(o=a);var u="";r(o.scheme)&&(u+=o.scheme+":"),r(o.authority)&&(u+="//"+o.authority,""!==o.path&&"/"!==o.path&&(u=u.replace(/\/?$/,"/"),o.path=o.path.replace(/^\/?/g,""))),u+=o===n?i?n.path.replace(/\/?$/,"/")+a.path.replace(/^\/?/g,""):n.path+a.path:a.path;var s=r(n.query),c=r(a.query);s&&c?u+="?"+n.query+"&"+a.query:s&&!c?u+="?"+n.query:!s&&c&&(u+="?"+a.query);var l=r(a.fragment);return r(n.fragment)&&!l?u+="#"+n.fragment:l&&(u+="#"+a.fragment),u}return a}),define("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","./joinUrls","require"],function(e,t,r,n,a,i){"use strict";function o(){for(var e=document.getElementsByTagName("script"),t=0,r=e.length;t<r;++t){var n=e[t].getAttribute("src"),a=E.exec(n);if(null!==a)return a[1]}}function u(){if(t(f))return f;var r;return r="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:o(),f=new e(n(r))}function s(e){return i.toUrl("../"+e)}function c(e){return a(u(),e)}function l(e){t(d)||(d=t(i.toUrl)?s:c),t(h)||(h=document.createElement("a"));var r=d(e);return h.href=r,h.href=h.href,h.href}var f,d,h,E=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return l._cesiumScriptRegex=E,l.setBaseUrl=function(t){f=new e(t).resolve(new e(document.location.href))},l}),define("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,r){this.x=e,this.y=t,this.s=r}return e}),define("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,r,n,a,i,o,u){"use strict";function s(e){e=r(e,r.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=r(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=r(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new i(this._sampleZeroJulianEphemerisDate,0,u.TAI),this._stepSizeDays=r(e.stepSizeDays,1),this._samplesPerXysFile=r(e.samplesPerXysFile,1e3),this._totalSamples=r(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,n=this._denominators=new Array(t+1),a=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t),s=0;s<=t;++s){n[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;c<=t;++c)c!==s&&(n[s]*=s-c);n[s]=1/n[s]}this._work=new Array(t+1),this._coef=new Array(t+1)}function c(e,t,r){var n=f;return n.dayNumber=t,n.secondsOfDay=r,i.daysDifference(n,e._sampleZeroDateTT)}function l(r,a){if(r._chunkDownloadsInProgress[a])return r._chunkDownloadsInProgress[a];var i=e.defer();r._chunkDownloadsInProgress[a]=i;var u,s=r._xysFileUrlTemplate;return u=n(s)?s.replace("{0}",a):t("Assets/IAU2006_XYS/IAU2006_XYS_"+a+".json"),e(o(u),function(e){r._chunkDownloadsInProgress[a]=!1;for(var t=r._samples,n=e.samples,o=a*r._samplesPerXysFile*3,u=0,s=n.length;u<s;++u)t[o+u]=n[u];i.resolve()}),i.promise}var f=new i(0,0,u.TAI);return s.prototype.preload=function(t,r,n,a){var i=c(this,t,r),o=c(this,n,a),u=i/this._stepSizeDays-this._interpolationOrder/2|0;u<0&&(u=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var f=u/this._samplesPerXysFile|0,d=s/this._samplesPerXysFile|0,h=[],E=f;E<=d;++E)h.push(l(this,E));return e.all(h)},s.prototype.computeXysRadians=function(e,t,r){var i=c(this,e,t);if(!(i<0)){var o=i/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);s<0&&(s=0);var f=s+u;f>=this._totalSamples&&(f=this._totalSamples-1,s=f-u,s<0&&(s=0));var d=!1,h=this._samples;if(n(h[3*s])||(l(this,s/this._samplesPerXysFile|0),d=!0),n(h[3*f])||(l(this,f/this._samplesPerXysFile|0),d=!0),!d){n(r)?(r.x=0,r.y=0,r.s=0):r=new a(0,0,0);var E,p,m=i-s*this._stepSizeDays,y=this._work,_=this._denominators,T=this._coef,v=this._xTable;for(E=0;E<=u;++E)y[E]=m-v[E];for(E=0;E<=u;++E){for(T[E]=1,p=0;p<=u;++p)p!==E&&(T[E]*=y[p]);T[E]*=_[E];var R=3*(s+E);r.x+=T[E]*h[R++],r.y+=T[E]*h[R++],r.s+=T[E]*h[R]}return r}}}},s}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./Check","./defaultValue","./defined","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./HeadingPitchRoll","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,r,n,a,i,o,u,s,c,l,f,d,h,E,p,m,y,_,T,v){"use strict";var R={},A=new r,S=new r,N=new r;R.eastNorthUpToFixedFrame=function(e,t,n){if(m.equalsEpsilon(e.x,0,m.EPSILON14)&&m.equalsEpsilon(e.y,0,m.EPSILON14)){var a=m.sign(e.z);return u(n)?(n[0]=0,n[1]=1,n[2]=0,n[3]=0,n[4]=-a,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=a,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new _(0,-a,0,e.x,1,0,0,e.y,0,0,a,e.z,0,0,0,1)}var i=A,s=S,c=N;return t=o(t,f.WGS84),t.geodeticSurfaceNormal(e,i),s.x=-e.y,s.y=e.x,s.z=0,r.normalize(s,s),r.cross(i,s,c),u(n)?(n[0]=s.x,n[1]=s.y,n[2]=s.z,n[3]=0,n[4]=c.x,n[5]=c.y,n[6]=c.z,n[7]=0,n[8]=i.x,n[9]=i.y,n[10]=i.z,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new _(s.x,c.x,i.x,e.x,s.y,c.y,i.y,e.y,s.z,c.z,i.z,e.z,0,0,0,1)};var I=new r,g=new r,O=new r;R.northEastDownToFixedFrame=function(e,t,n){if(m.equalsEpsilon(e.x,0,m.EPSILON14)&&m.equalsEpsilon(e.y,0,m.EPSILON14)){var a=m.sign(e.z);return u(n)?(n[0]=-a,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=1,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=-a,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new _(-a,0,0,e.x,0,1,0,e.y,0,0,-a,e.z,0,0,0,1)}var i=I,s=g,c=O;return t=o(t,f.WGS84),t.geodeticSurfaceNormal(e,i),s.x=-e.y,s.y=e.x,s.z=0,r.normalize(s,s),r.cross(i,s,c),u(n)?(n[0]=c.x,n[1]=c.y,n[2]=c.z,n[3]=0,n[4]=s.x,n[5]=s.y,n[6]=s.z,n[7]=0,n[8]=-i.x,n[9]=-i.y,n[10]=-i.z,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new _(c.x,s.x,-i.x,e.x,c.y,s.y,-i.y,e.y,c.z,s.z,-i.z,e.z,0,0,0,1)},R.northUpEastToFixedFrame=function(e,t,n){if(m.equalsEpsilon(e.x,0,m.EPSILON14)&&m.equalsEpsilon(e.y,0,m.EPSILON14)){var a=m.sign(e.z);return u(n)?(n[0]=-a,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=a,n[7]=0,n[8]=0,n[9]=1,n[10]=0,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new _(-a,0,0,e.x,0,0,1,e.y,0,a,0,e.z,0,0,0,1)}var i=A,s=S,c=N;return t=o(t,f.WGS84),t.geodeticSurfaceNormal(e,i),s.x=-e.y,s.y=e.x,s.z=0,r.normalize(s,s),r.cross(i,s,c),u(n)?(n[0]=c.x,n[1]=c.y,n[2]=c.z,n[3]=0,n[4]=i.x,n[5]=i.y,n[6]=i.z,n[7]=0,n[8]=s.x,n[9]=s.y,n[10]=s.z,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new _(c.x,i.x,s.x,e.x,c.y,i.y,s.y,e.y,c.z,i.z,s.z,e.z,0,0,0,1)},R.northWestUpToFixedFrame=function(e,t,n){if(m.equalsEpsilon(e.x,0,m.EPSILON14)&&m.equalsEpsilon(e.y,0,m.EPSILON14)){var a=m.sign(e.z);return u(n)?(n[0]=-a,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=-1,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=a,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new _(-a,0,0,e.x,0,-1,0,e.y,0,0,a,e.z,0,0,0,1)}var i=A,s=S,c=N;return t=o(t,f.WGS84),t.geodeticSurfaceNormal(e,i),s.x=-e.y,s.y=e.x,s.z=0,r.normalize(s,s),r.cross(i,s,c),u(n)?(n[0]=c.x,n[1]=c.y,n[2]=c.z,n[3]=0,n[4]=-s.x,n[5]=-s.y,n[6]=-s.z,n[7]=0,n[8]=i.x,n[9]=i.y,n[10]=i.z,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new _(c.x,-s.x,i.x,e.x,c.y,-s.y,i.y,e.y,c.z,-s.z,i.z,e.z,0,0,0,1)};var w=new T,M=new r(1,1,1),x=new _;R.headingPitchRollToFixedFrame=function(e,t,n,a){i.typeOf.object("headingPitchRoll",t);var o=t.heading,u=t.pitch,s=t.roll,c=T.fromHeadingPitchRoll(o,u,s,w),l=_.fromTranslationQuaternionRotationScale(r.ZERO,c,M,x);return a=R.eastNorthUpToFixedFrame(e,n,a),_.multiply(a,l,a)};var C=new _,P=new y;R.headingPitchRollQuaternion=function(e,t,r,n){i.typeOf.object("headingPitchRoll",t);var a=R.headingPitchRollToFixedFrame(e,t,r,C),o=_.getRotation(a,P);return T.fromRotationMatrix(o,n)};var D=24110.54841,L=8640184.812866,U=.093104,b=-62e-7,F=1.1772758384668e-19,z=72921158553e-15,B=m.TWO_PI/86400,G=new p;R.computeTemeToPseudoFixedMatrix=function(e,t){G=p.addSeconds(e,-p.computeTaiMinusUtc(e),G);var r,n=G.dayNumber,a=G.secondsOfDay,i=n-2451545;r=a>=43200?(i+.5)/v.DAYS_PER_JULIAN_CENTURY:(i-.5)/v.DAYS_PER_JULIAN_CENTURY;var o=D+r*(L+r*(U+r*b)),s=o*B%m.TWO_PI,c=z+F*(n-2451545.5),l=(a+.5*v.SECONDS_PER_DAY)%v.SECONDS_PER_DAY,f=s+c*l,d=Math.cos(f),h=Math.sin(f);return u(t)?(t[0]=d,t[1]=-h,t[2]=0,t[3]=h,t[4]=d,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new y(d,h,0,-h,d,0,0,0,1)},R.iau2006XysData=new h,R.earthOrientationParameters=c.NONE;var q=32.184,V=2451545;R.preloadIcrfFixed=function(t){var r=t.start.dayNumber,n=t.start.secondsOfDay+q,a=t.stop.dayNumber,i=t.stop.secondsOfDay+q,o=R.iau2006XysData.preload(r,n,a,i),u=R.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},R.computeIcrfToFixedMatrix=function(e,t){u(t)||(t=new y);var r=R.computeFixedToIcrfMatrix(e,t);if(u(r))return y.transpose(r,t)};var W=new E(0,0,0),X=new l(0,0,0,0,0,0),H=new y,Y=new y;R.computeFixedToIcrfMatrix=function(e,t){u(t)||(t=new y);var r=R.earthOrientationParameters.compute(e,X);if(u(r)){var n=e.dayNumber,a=e.secondsOfDay+q,i=R.iau2006XysData.computeXysRadians(n,a,W);if(u(i)){var o=i.x+r.xPoleOffset,s=i.y+r.yPoleOffset,c=1/(1+Math.sqrt(1-o*o-s*s)),l=H;l[0]=1-c*o*o,l[3]=-c*o*s,l[6]=o,l[1]=-c*o*s,l[4]=1-c*s*s,l[7]=s,l[2]=-o,l[5]=-s,l[8]=1-c*(o*o+s*s);var f=y.fromRotationZ(-i.s,Y),d=y.multiply(l,f,H),h=e.dayNumber,E=e.secondsOfDay-p.computeTaiMinusUtc(e)+r.ut1MinusUtc,_=h-2451545,T=E/v.SECONDS_PER_DAY,A=.779057273264+T+.00273781191135448*(_+T);A=A%1*m.TWO_PI;var S=y.fromRotationZ(A,Y),N=y.multiply(d,S,H),I=Math.cos(r.xPoleWander),g=Math.cos(r.yPoleWander),O=Math.sin(r.xPoleWander),w=Math.sin(r.yPoleWander),M=n-V+a/v.SECONDS_PER_DAY;M/=36525;var x=-47e-6*M*m.RADIANS_PER_DEGREE/3600,C=Math.cos(x),P=Math.sin(x),D=Y;return D[0]=I*C,D[1]=I*P,D[2]=O,D[3]=-g*P+w*O*C,D[4]=g*C+w*O*P,D[5]=-w*I,D[6]=-w*P-g*O*C,D[7]=w*C-g*O*P,D[8]=g*I,y.multiply(N,D,t)}}};var k=new n;R.pointToWindowCoordinates=function(e,t,r,n){return n=R.pointToGLWindowCoordinates(e,t,r,n),n.y=2*t[5]-n.y,n},R.pointToGLWindowCoordinates=function(e,r,a,i){u(i)||(i=new t);var o=k;return _.multiplyByVector(e,n.fromElements(a.x,a.y,a.z,1,o),o),n.multiplyByScalar(o,1/o.w,o),_.multiplyByVector(r,o,o),t.fromCartesian4(o,i)};var j=new r,Z=new r,K=new r;R.rotationMatrixFromPositionVelocity=function(e,t,n,a){var i=o(n,f.WGS84).geodeticSurfaceNormal(e,j),s=r.cross(t,i,Z);r.equalsEpsilon(s,r.ZERO,m.EPSILON6)&&(s=r.clone(r.UNIT_X,s));var c=r.cross(s,t,K);return r.cross(t,c,s),r.negate(s,s),u(a)||(a=new y),a[0]=t.x,a[1]=t.y,a[2]=t.z,a[3]=s.x,a[4]=s.y,a[5]=s.z,a[6]=c.x,a[7]=c.y,a[8]=c.z,a};var J=new a,Q=new r,$=new r,ee=new n,te=new n,re=new n,ne=new n,ae=new n,ie=new _,oe=new _;R.basisTo2D=function(e,t,a){var i=e.ellipsoid,o=_.getColumn(t,3,ee),u=i.cartesianToCartographic(o,J),s=R.eastNorthUpToFixedFrame(o,i,ie),c=_.inverseTransformation(s,oe),l=e.project(u,Q),f=te;f.x=l.z,f.y=l.x,f.z=l.y,f.w=1;var d=_.getColumn(t,0,$),h=r.magnitude(d),E=_.multiplyByVector(c,d,re);n.fromElements(E.z,E.x,E.y,0,E);var p=_.getColumn(t,1,$),m=r.magnitude(p),y=_.multiplyByVector(c,p,ne);n.fromElements(y.z,y.x,y.y,0,y);var T=_.getColumn(t,2,$),v=r.magnitude(T),A=ae;return r.cross(E,y,A),r.normalize(A,A),r.cross(y,A,E),r.normalize(E,E),r.cross(A,E,y),r.normalize(y,y),r.multiplyByScalar(E,h,E),r.multiplyByScalar(y,m,y),r.multiplyByScalar(A,v,A),_.setColumn(a,0,E,a),_.setColumn(a,1,y,a),_.setColumn(a,2,A,a),_.setColumn(a,3,f,a),a};var ue=new _(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);return R.wgs84To2DModelMatrix=function(e,t,r){var n=e.ellipsoid,a=R.eastNorthUpToFixedFrame(t,n,ie),i=_.inverseTransformation(a,oe),o=n.cartesianToCartographic(t,J),u=e.project(o,Q),s=te;s.x=u.z,s.y=u.x,s.z=u.y,s.w=1;var c=_.fromTranslation(s,ie);return _.multiply(ue,i,r),_.multiply(c,r,r),r},R}),define("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,r,n){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.position=e(t.position,!1),this.normal=e(t.normal,!1),this.st=e(t.st,!1),this.bitangent=e(t.bitangent,!1),this.tangent=e(t.tangent,!1),this.color=e(t.color,!1)}return a.POSITION_ONLY=n(new a({position:!0})),a.POSITION_AND_NORMAL=n(new a({position:!0,normal:!0})),a.POSITION_NORMAL_AND_ST=n(new a({position:!0,normal:!0,st:!0})),a.POSITION_AND_ST=n(new a({position:!0,st:!0})),a.POSITION_AND_COLOR=n(new a({position:!0,color:!0})),a.ALL=n(new a({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0})),a.DEFAULT=a.POSITION_NORMAL_AND_ST,a.packedLength=6,a.pack=function(t,r,n){return n=e(n,0),r[n++]=t.position?1:0,r[n++]=t.normal?1:0,r[n++]=t.st?1:0,r[n++]=t.tangent?1:0,r[n++]=t.bitangent?1:0,r[n++]=t.color?1:0,r},a.unpack=function(r,n,i){return n=e(n,0),t(i)||(i=new a),i.position=1===r[n++],i.normal=1===r[n++],i.st=1===r[n++],i.tangent=1===r[n++],i.bitangent=1===r[n++],i.color=1===r[n++],i},a.clone=function(e,r){if(t(e))return t(r)||(r=new a),r.position=e.position,r.normal=e.normal,r.st=e.st,r.tangent=e.tangent,r.bitangent=e.bitangent,r.color=e.color,r},a}),define("Core/EllipseGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError","./EllipseGeometryLibrary","./Ellipsoid","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix3","./Matrix4","./PrimitiveType","./Quaternion","./Rectangle","./Transforms","./VertexFormat"],function(e,t,r,n,a,i,o,u,s,c,l,f,d,h,E,p,m,y,_,T,v,R,A,S,N,I){"use strict";function g(e,n,i){var o=n.vertexFormat,u=n.center,s=n.semiMajorAxis,l=n.semiMinorAxis,d=n.ellipsoid,p=n.stRotation,m=i?e.length/3*2:e.length/3,y=n.shadowVolume,_=o.st?new Float32Array(2*m):void 0,v=o.normal?new Float32Array(3*m):void 0,R=o.tangent?new Float32Array(3*m):void 0,S=o.bitangent?new Float32Array(3*m):void 0,N=y?new Float32Array(3*m):void 0,I=0,g=q,O=V,w=W,M=new f(d),x=M.project(d.cartesianToCartographic(u,X),H),C=d.scaleToGeodeticSurface(u,L);d.geodeticSurfaceNormal(C,C);for(var P=A.fromAxisAngle(C,p,G),D=T.fromQuaternion(P,B),F=t.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Y),j=t.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,k),Z=e.length,K=i?Z:0,J=K/3*2,Q=0;Q<Z;Q+=3){var $=Q+1,ee=Q+2,te=r.fromArray(e,Q,L);if(o.st){var re=T.multiplyByVector(D,te,U),ne=M.project(d.cartesianToCartographic(re,X),b);r.subtract(ne,x,ne),z.x=(ne.x+s)/(2*s),z.y=(ne.y+l)/(2*l),F.x=Math.min(z.x,F.x),F.y=Math.min(z.y,F.y),j.x=Math.max(z.x,j.x),j.y=Math.max(z.y,j.y),i&&(_[I+J]=z.x,_[I+1+J]=z.y),_[I++]=z.x,_[I++]=z.y}(o.normal||o.tangent||o.bitangent||y)&&(g=d.geodeticSurfaceNormal(te,g),y&&(N[Q+K]=-g.x,N[$+K]=-g.y,N[ee+K]=-g.z),(o.normal||o.tangent||o.bitangent)&&((o.tangent||o.bitangent)&&(O=r.normalize(r.cross(r.UNIT_Z,g,O),O),T.multiplyByVector(D,O,O)),o.normal&&(v[Q]=g.x,v[$]=g.y,v[ee]=g.z,i&&(v[Q+K]=-g.x,v[$+K]=-g.y,v[ee+K]=-g.z)),o.tangent&&(R[Q]=O.x,R[$]=O.y,R[ee]=O.z,i&&(R[Q+K]=-O.x,R[$+K]=-O.y,R[ee+K]=-O.z)),o.bitangent&&(w=r.normalize(r.cross(g,O,w),w),S[Q]=w.x,S[$]=w.y,S[ee]=w.z,i&&(S[Q+K]=w.x,S[$+K]=w.y,S[ee+K]=w.z))))}if(o.st){Z=_.length;for(var ae=0;ae<Z;ae+=2)_[ae]=(_[ae]-F.x)/(j.x-F.x),_[ae+1]=(_[ae+1]-F.y)/(j.y-F.y)}var ie=new E;if(o.position){var oe=c.raisePositionsToHeight(e,n,i);ie.position=new h({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:oe})}return o.st&&(ie.st=new h({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:_})),o.normal&&(ie.normal=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:v})),o.tangent&&(ie.tangent=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:R})),o.bitangent&&(ie.bitangent=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:S})),y&&(ie.extrudeDirection=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:N})),ie}function O(e){var t,r,n,a,i,o=new Array(12*(e*(e+1))-6),u=0;for(t=0,n=1,a=0;a<3;a++)o[u++]=n++,o[u++]=t,o[u++]=n;for(a=2;a<e+1;++a){for(n=a*(a+1)-1,t=(a-1)*a-1,o[u++]=n++,o[u++]=t,o[u++]=n,r=2*a,i=0;i<r-1;++i)o[u++]=n,o[u++]=t++,o[u++]=t,o[u++]=n++,o[u++]=t,o[u++]=n;o[u++]=n++,o[u++]=t,o[u++]=n}for(r=2*e,++n,++t,a=0;a<r-1;++a)o[u++]=n,o[u++]=t++,o[u++]=t,o[u++]=n++,o[u++]=t,o[u++]=n;for(o[u++]=n,o[u++]=t++,o[u++]=t,o[u++]=n++,o[u++]=t++,o[u++]=t,++t,a=e-1;a>1;--a){for(o[u++]=t++,o[u++]=t,o[u++]=n,r=2*a,i=0;i<r-1;++i)o[u++]=n,o[u++]=t++,o[u++]=t,o[u++]=n++,o[u++]=t,o[u++]=n;o[u++]=t++,o[u++]=t++,o[u++]=n++}for(a=0;a<3;a++)o[u++]=t++,o[u++]=t,o[u++]=n;return o}function w(t){var n=t.center;j=r.multiplyByScalar(t.ellipsoid.geodeticSurfaceNormal(n,j),t.height,j),j=r.add(n,j,j);var a=new e(j,t.semiMajorAxis),i=c.computeEllipsePositions(t,!0,!1),o=i.positions,u=i.numPts,s=g(o,t,!1),l=O(u);return l=y.createTypedArray(o.length/3,l),{boundingSphere:a,attributes:s,indices:l}}function M(e,n){var i=n.vertexFormat,o=n.center,u=n.semiMajorAxis,s=n.semiMinorAxis,c=n.ellipsoid,l=n.height,d=n.extrudedHeight,p=n.stRotation,m=e.length/3*2,y=new Float64Array(3*m),_=i.st?new Float32Array(2*m):void 0,v=i.normal?new Float32Array(3*m):void 0,R=i.tangent?new Float32Array(3*m):void 0,S=i.bitangent?new Float32Array(3*m):void 0,N=n.shadowVolume,I=N?new Float32Array(3*m):void 0,g=0,O=q,w=V,M=W,x=new f(c),C=x.project(c.cartesianToCartographic(o,X),H),P=c.scaleToGeodeticSurface(o,L);c.geodeticSurfaceNormal(P,P);for(var D=A.fromAxisAngle(P,p,G),j=T.fromQuaternion(D,B),Z=t.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Y),K=t.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,k),J=e.length,Q=J/3*2,$=0;$<J;$+=3){var ee,te=$+1,re=$+2,ne=r.fromArray(e,$,L);if(i.st){var ae=T.multiplyByVector(j,ne,U),ie=x.project(c.cartesianToCartographic(ae,X),b);r.subtract(ie,C,ie),z.x=(ie.x+u)/(2*u),z.y=(ie.y+s)/(2*s),Z.x=Math.min(z.x,Z.x),Z.y=Math.min(z.y,Z.y),K.x=Math.max(z.x,K.x),K.y=Math.max(z.y,K.y),_[g+Q]=z.x,_[g+1+Q]=z.y,_[g++]=z.x,_[g++]=z.y}ne=c.scaleToGeodeticSurface(ne,ne),ee=r.clone(ne,U),O=c.geodeticSurfaceNormal(ne,O),N&&(I[$+J]=-O.x,I[te+J]=-O.y,I[re+J]=-O.z);var oe=r.multiplyByScalar(O,l,F);if(ne=r.add(ne,oe,ne),oe=r.multiplyByScalar(O,d,oe),ee=r.add(ee,oe,ee),i.position&&(y[$+J]=ee.x,y[te+J]=ee.y,y[re+J]=ee.z,y[$]=ne.x,y[te]=ne.y,y[re]=ne.z),i.normal||i.tangent||i.bitangent){M=r.clone(O,M);var ue=r.fromArray(e,($+3)%J,F);r.subtract(ue,ne,ue);var se=r.subtract(ee,ne,b);O=r.normalize(r.cross(se,ue,O),O),i.normal&&(v[$]=O.x,v[te]=O.y,v[re]=O.z,v[$+J]=O.x,v[te+J]=O.y,v[re+J]=O.z),i.tangent&&(w=r.normalize(r.cross(M,O,w),w),R[$]=w.x,R[te]=w.y,R[re]=w.z,R[$+J]=w.x,R[$+1+J]=w.y,R[$+2+J]=w.z),i.bitangent&&(S[$]=M.x,S[te]=M.y,S[re]=M.z,S[$+J]=M.x,S[te+J]=M.y,S[re+J]=M.z)}}if(i.st){J=_.length;for(var ce=0;ce<J;ce+=2)_[ce]=(_[ce]-Z.x)/(K.x-Z.x),_[ce+1]=(_[ce+1]-Z.y)/(K.y-Z.y)}var le=new E;return i.position&&(le.position=new h({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:y})),i.st&&(le.st=new h({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:_})),i.normal&&(le.normal=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:v})),i.tangent&&(le.tangent=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:R})),i.bitangent&&(le.bitangent=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:S})),N&&(le.extrudeDirection=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:I})),le}function x(e){for(var t=e.length/3,r=y.createTypedArray(t,6*t),n=0,a=0;a<t;a++){var i=a,o=a+t,u=(i+1)%t,s=u+t;r[n++]=i,r[n++]=o,r[n++]=u,r[n++]=u,r[n++]=o,r[n++]=s}return r}function C(t){var n=t.center,a=t.ellipsoid,i=t.semiMajorAxis,o=r.multiplyByScalar(a.geodeticSurfaceNormal(n,L),t.height,L);Z.center=r.add(n,o,Z.center),Z.radius=i,o=r.multiplyByScalar(a.geodeticSurfaceNormal(n,o),t.extrudedHeight,o),K.center=r.add(n,o,K.center),K.radius=i;var u=c.computeEllipsePositions(t,!0,!0),s=u.positions,l=u.numPts,f=u.outerPositions,h=e.union(Z,K),E=g(s,t,!0),_=O(l),T=_.length;_.length=2*T;for(var v=s.length/3,A=0;A<T;A+=3)_[A+T]=_[A+2]+v,_[A+1+T]=_[A+1]+v,_[A+2+T]=_[A]+v;var S=y.createTypedArray(2*v/3,_),N=new d({attributes:E,indices:S,primitiveType:R.TRIANGLES}),I=M(f,t);_=x(f);var w=y.createTypedArray(2*f.length/3,_),C=new d({attributes:I,indices:w,primitiveType:R.TRIANGLES}),P=m.combineInstances([new p({geometry:N}),new p({geometry:C})]);return{boundingSphere:h,attributes:P[0].attributes,indices:P[0].indices}}function P(e,t,n,a,i){N.eastNorthUpToFixedFrame(e,t,J),v.inverseTransformation(J,Q);for(var o=0;o<4;++o)r.clone(r.ZERO,ee[o]);for(ee[0].x+=n,ee[1].x-=n,ee[2].y+=a,ee[3].y-=a,T.fromRotationZ(i,$),o=0;o<4;++o)T.multiplyByVector($,ee[o],ee[o]),v.multiplyByPoint(J,ee[o],ee[o]),t.cartesianToCartographic(ee[o],te[o]);return S.fromCartographicArray(te)}function D(e){e=i(e,i.EMPTY_OBJECT);var t=e.center,n=i(e.ellipsoid,l.WGS84),a=e.semiMajorAxis,u=e.semiMinorAxis,s=i(e.granularity,_.RADIANS_PER_DEGREE),c=i(e.height,0),f=e.extrudedHeight,d=o(f)&&Math.abs(c-f)>1,h=i(e.vertexFormat,I.DEFAULT);this._center=r.clone(t),this._semiMajorAxis=a,this._semiMinorAxis=u,this._ellipsoid=l.clone(n),this._rotation=i(e.rotation,0),this._stRotation=i(e.stRotation,0),this._height=c,this._granularity=s,this._vertexFormat=I.clone(h),this._extrudedHeight=i(f,c),this._extrude=d,this._shadowVolume=i(e.shadowVolume,!1),this._workerName="createEllipseGeometry",this._rectangle=P(this._center,this._ellipsoid,a,u,this._rotation)}var L=new r,U=new r,b=new r,F=new r,z=new t,B=new T,G=new A,q=new r,V=new r,W=new r,X=new n,H=new r,Y=new t,k=new t,j=new r,Z=new e,K=new e,J=new v,Q=new v,$=new T,ee=[new r,new r,new r,new r],te=[new n,new n,new n,new n];D.packedLength=r.packedLength+l.packedLength+I.packedLength+S.packedLength+9,D.pack=function(e,t,n){return n=i(n,0),r.pack(e._center,t,n),n+=r.packedLength,l.pack(e._ellipsoid,t,n),n+=l.packedLength,I.pack(e._vertexFormat,t,n),n+=I.packedLength,S.pack(e._rectangle,t,n),n+=S.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._extrude?1:0,t[n]=e._shadowVolume?1:0,t};var re=new r,ne=new l,ae=new I,ie=new S,oe={center:re,ellipsoid:ne,vertexFormat:ae,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,shadowVolume:void 0};return D.unpack=function(e,t,n){t=i(t,0);var a=r.unpack(e,t,re);t+=r.packedLength;var u=l.unpack(e,t,ne);t+=l.packedLength;var s=I.unpack(e,t,ae);t+=I.packedLength;var c=S.unpack(e,t,ie);t+=S.packedLength;var f=e[t++],d=e[t++],h=e[t++],E=e[t++],p=e[t++],m=e[t++],y=e[t++],_=1===e[t++],T=1===e[t];return o(n)?(n._center=r.clone(a,n._center),n._ellipsoid=l.clone(u,n._ellipsoid),n._vertexFormat=I.clone(s,n._vertexFormat),n._semiMajorAxis=f,n._semiMinorAxis=d,n._rotation=h,n._stRotation=E,n._height=p,n._granularity=m,n._extrudedHeight=y,n._extrude=_,n._shadowVolume=T,n._rectangle=S.clone(c),n):(oe.height=p,oe.extrudedHeight=y,oe.granularity=m,oe.stRotation=E,oe.rotation=h,oe.semiMajorAxis=f,oe.semiMinorAxis=d,oe.shadowVolume=T,new D(oe))},D.createGeometry=function(e){if(!(e._semiMajorAxis<=0||e._semiMinorAxis<=0)){e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);var t,r={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:e._height,extrudedHeight:e._extrudedHeight,granularity:e._granularity,vertexFormat:e._vertexFormat,stRotation:e._stRotation};return e._extrude?(r.extrudedHeight=Math.min(e._extrudedHeight,e._height),r.height=Math.max(e._extrudedHeight,e._height),r.shadowVolume=e._shadowVolume,t=C(r)):t=w(r),new d({attributes:t.attributes,indices:t.indices,primitiveType:R.TRIANGLES,boundingSphere:t.boundingSphere})}},D.createShadowVolume=function(e,t,r){var n=e._granularity,a=e._ellipsoid,i=t(n,a),o=r(n,a);return new D({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:a,rotation:e._rotation,stRotation:e._stRotation,granularity:n,extrudedHeight:i,height:o,vertexFormat:I.POSITION_ONLY,shadowVolume:!0})},u(D.prototype,{rectangle:{get:function(){return this._rectangle}}}),D}),define("Workers/createEllipseGeometry",["../Core/Cartesian3","../Core/defined","../Core/EllipseGeometry","../Core/Ellipsoid"],function(e,t,r,n){"use strict";function a(a,i){return t(i)&&(a=r.unpack(a,i)),a._center=e.clone(a._center),a._ellipsoid=n.clone(a._ellipsoid),r.createGeometry(a)}return a})}(); \ No newline at end of file diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createEllipseOutlineGeometry.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createEllipseOutlineGeometry.js index d35f3af5..33f49897 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createEllipseOutlineGeometry.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createEllipseOutlineGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,6 +55,6 @@ mersenne-twister.js - https://gist.github.com/banksean/300494 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==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";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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("Core/isArray",["./defined"],function(e){"use strict";var t=Array.isArray;return e(t)||(t=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),t}),define("Core/Check",["./defaultValue","./defined","./DeveloperError","./isArray"],function(e,t,n,r){"use strict";function i(e){return e+" was required but undefined."}function a(e,t,n){return"Expected "+n+" to be typeof "+t+", got "+e}var o={};return o.typeOf={},o.numeric={},o.defined=function(e,r){if(!t(e))throw new n(i(r))},o.numeric.maximum=function(e,t){if(o.typeOf.number(e),o.typeOf.number(t),e>t)throw new n("Expected "+e+" to be at most "+t)},o.numeric.minimum=function(e,t){if(o.typeOf.number(e),o.typeOf.number(t),e<t)throw new n("Expected "+e+" to be at least "+t)},o.typeOf.function=function(e,t){if("function"!=typeof e)throw new n(a(typeof e,"function",t))},o.typeOf.string=function(e,t){if("string"!=typeof e)throw new n(a(typeof e,"string",t))},o.typeOf.number=function(e,t){if("number"!=typeof e)throw new n(a(typeof e,"number",t))},o.typeOf.object=function(e,t){if("object"!=typeof e)throw new n(a(typeof e,"object",t))},o.typeOf.boolean=function(e,t){if("boolean"!=typeof e)throw new n(a(typeof e,"boolean",t))},o}),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 n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(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^=e<<7&2636928640,e^=e<<15&4022730752,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,n,r){"use strict";var i={};i.EPSILON1=.1,i.EPSILON2=.01,i.EPSILON3=.001,i.EPSILON4=1e-4,i.EPSILON5=1e-5,i.EPSILON6=1e-6,i.EPSILON7=1e-7,i.EPSILON8=1e-8,i.EPSILON9=1e-9,i.EPSILON10=1e-10,i.EPSILON11=1e-11,i.EPSILON12=1e-12,i.EPSILON13=1e-13,i.EPSILON14=1e-14,i.EPSILON15=1e-15,i.EPSILON16=1e-16,i.EPSILON17=1e-17,i.EPSILON18=1e-18,i.EPSILON19=1e-19,i.EPSILON20=1e-20,i.GRAVITATIONALPARAMETER=3986004418e5,i.SOLAR_RADIUS=6955e5,i.LUNAR_RADIUS=1737400,i.SIXTY_FOUR_KILOBYTES=65536,i.sign=function(e){return e>0?1:e<0?-1:0},i.signNotZero=function(e){return e<0?-1:1},i.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*i.clamp(e,-1,1)+.5)*n)},i.fromSNorm=function(e,n){return n=t(n,255),i.clamp(e,0,n)/n*2-1},i.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},i.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},i.lerp=function(e,t,n){return(1-n)*e+n*t},i.PI=Math.PI,i.ONE_OVER_PI=1/Math.PI,i.PI_OVER_TWO=.5*Math.PI,i.PI_OVER_THREE=Math.PI/3,i.PI_OVER_FOUR=Math.PI/4,i.PI_OVER_SIX=Math.PI/6,i.THREE_PI_OVER_TWO=3*Math.PI*.5,i.TWO_PI=2*Math.PI,i.ONE_OVER_TWO_PI=1/(2*Math.PI),i.RADIANS_PER_DEGREE=Math.PI/180,i.DEGREES_PER_RADIAN=180/Math.PI,i.RADIANS_PER_ARCSECOND=i.RADIANS_PER_DEGREE/3600,i.toRadians=function(e){return e*i.RADIANS_PER_DEGREE},i.toDegrees=function(e){return e*i.DEGREES_PER_RADIAN},i.convertLongitudeRange=function(e){var t=i.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},i.clampToLatitudeRange=function(e){return i.clamp(e,-1*i.PI_OVER_TWO,i.PI_OVER_TWO)},i.negativePiToPi=function(e){return i.zeroToTwoPi(e+i.PI)-i.PI},i.zeroToTwoPi=function(e){var t=i.mod(e,i.TWO_PI);return Math.abs(t)<i.EPSILON14&&Math.abs(e)>i.EPSILON14?i.TWO_PI:t},i.mod=function(e,t){return(e%t+t)%t},i.equalsEpsilon=function(e,n,r,i){i=t(i,r);var a=Math.abs(e-n);return a<=i||a<=r*Math.max(Math.abs(e),Math.abs(n))};var a=[1];i.factorial=function(e){var t=a.length;if(e>=t)for(var n=a[t-1],r=t;r<=e;r++)a.push(n*r);return a[e]},i.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},i.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},i.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},i.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return i.setRandomNumberSeed=function(t){o=new e(t)},i.nextRandomNumber=function(){return o.random()},i.acosClamped=function(e){return Math.acos(i.clamp(e,-1,1))},i.asinClamped=function(e){return Math.asin(i.clamp(e,-1,1))},i.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},i.logBase=function(e,t){return Math.log(e)/Math.log(t)},i.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},i}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var i=e.clock,a=e.cone,u=t(e.magnitude,1),E=u*Math.sin(a);return r.x=E*Math.cos(i),r.y=E*Math.sin(i),r.z=u*Math.cos(a),r},o.fromElements=function(e,t,r,i){return n(i)?(i.x=e,i.y=t,i.z=r,i):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new o),i.x=e[r++],i.y=e[r++],i.z=e[r],i},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var i=0;i<r;++i)o.pack(e[i],t,3*i);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var i=0;i<r;i+=3){var a=i/3;t[a]=o.unpack(e,i,t[a])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,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};var E=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,E),r=o.multiplyByScalar(e,1-n,r),o.add(E,r,r)};var s=new o,c=new o;o.angleBetween=function(e,t){o.normalize(e,s),o.normalize(t,c);var n=o.dot(s,c),r=o.magnitude(o.cross(s,c,s));return Math.atan2(r,n)};var _=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,_);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,i){return e===t||n(e)&&n(t)&&a.equalsEpsilon(e.x,t.x,r,i)&&a.equalsEpsilon(e.y,t.y,r,i)&&a.equalsEpsilon(e.z,t.z,r,i)},o.cross=function(e,t,n){var r=e.x,i=e.y,a=e.z,o=t.x,u=t.y,E=t.z,s=i*E-a*u,c=a*o-r*E,_=r*u-i*o;return n.x=s,n.y=c,n.z=_,n},o.fromDegrees=function(e,t,n,r,i){return e=a.toRadians(e),t=a.toRadians(t),o.fromRadians(e,t,n,r,i)};var l=new o,T=new o,R=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,i,a,u){i=t(i,0);var E=n(a)?a.radiiSquared:R,s=Math.cos(r);l.x=s*Math.cos(e),l.y=s*Math.sin(e),l.z=Math.sin(r),l=o.normalize(l,l),o.multiplyComponents(E,l,T);var c=Math.sqrt(o.dot(l,T));return T=o.divideByScalar(T,c,T),l=o.multiplyByScalar(l,i,l),n(u)||(u=new o),o.add(T,l,u)},o.fromDegreesArray=function(e,t,r){var i=e.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],E=e[a+1],s=a/2;r[s]=o.fromDegrees(u,E,0,t,r[s])}return r},o.fromRadiansArray=function(e,t,r){var i=e.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],E=e[a+1],s=a/2;r[s]=o.fromRadians(u,E,0,t,r[s])}return r},o.fromDegreesArrayHeights=function(e,t,r){var i=e.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],E=e[a+1],s=e[a+2],c=a/3;r[c]=o.fromDegrees(u,E,s,t,r[c])}return r},o.fromRadiansArrayHeights=function(e,t,r){var i=e.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],E=e[a+1],s=e[a+2],c=a/3;r[c]=o.fromRadians(u,E,s,t,r[c])}return r},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,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function i(n,i,u,E,s){var c=n.x,_=n.y,l=n.z,T=i.x,R=i.y,f=i.z,A=c*c*T*T,h=_*_*R*R,d=l*l*f*f,N=A+h+d,I=Math.sqrt(1/N),S=e.multiplyByScalar(n,I,a);if(N<E)return isFinite(I)?e.clone(S,s):void 0;var M=u.x,y=u.y,m=u.z,O=o;O.x=S.x*M*2,O.y=S.y*y*2,O.z=S.z*m*2;var p,C,U,L,g,w,x,v,F,P,B,D=(1-I)*e.magnitude(n)/(.5*e.magnitude(O)),z=0;do{D-=z,U=1/(1+D*M),L=1/(1+D*y),g=1/(1+D*m),w=U*U,x=L*L,v=g*g,F=w*U,P=x*L,B=v*g,p=A*w+h*x+d*v-1,C=A*F*M+h*P*y+d*B*m;var G=-2*C;z=p/G}while(Math.abs(p)>r.EPSILON12);return t(s)?(s.x=c*U,s.y=_*L,s.z=l*g,s):new e(c*U,_*L,l*g)}var a=new e,o=new e;return i}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,i,a,o){"use strict";function u(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)}u.fromRadians=function(e,r,i,a){return i=t(i,0),n(a)?(a.longitude=e,a.latitude=r,a.height=i,a):new u(e,r,i)},u.fromDegrees=function(e,t,n,r){return e=a.toRadians(e),t=a.toRadians(t),u.fromRadians(e,t,n,r)};var E=new e,s=new e,c=new e,_=new e(1/6378137,1/6378137,1/6356752.314245179),l=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),T=a.EPSILON1;return u.fromCartesian=function(t,r,i){var R=n(r)?r.oneOverRadii:_,f=n(r)?r.oneOverRadiiSquared:l,A=n(r)?r._centerToleranceSquared:T,h=o(t,R,f,A,s);if(n(h)){var d=e.multiplyComponents(h,f,E);d=e.normalize(d,d);var N=e.subtract(t,h,c),I=Math.atan2(d.y,d.x),S=Math.asin(d.z),M=a.sign(e.dot(N,t))*e.magnitude(N);return n(i)?(i.longitude=I,i.latitude=S,i.height=M,i):new u(I,S,M)}},u.clone=function(e,t){if(n(e))return n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},u.ZERO=i(new u(0,0,0)),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,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,i,a,o,u,E){"use strict";function s(t,r,i,a){r=n(r,0),i=n(i,0),a=n(a,0),t._radii=new e(r,i,a),t._radiiSquared=new e(r*r,i*i,a*a),t._radiiToTheFourth=new e(r*r*r*r,i*i*i*i,a*a*a*a),t._oneOverRadii=new e(0===r?0:1/r,0===i?0:1/i,0===a?0:1/a),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===i?0:1/(i*i),0===a?0:1/(a*a)),t._minimumRadius=Math.min(r,i,a),t._maximumRadius=Math.max(r,i,a),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function c(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,s(this,e,t,n)}i(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,n){if(r(t)){var i=t._radii;return r(n)?(e.clone(i,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new c(i.x,i.y,i.z)}},c.fromCartesian3=function(e,t){return r(t)||(t=new c),r(e)?(s(t,e.x,e.y,e.z),t):t},c.WGS84=o(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=o(new c(1,1,1)),c.MOON=o(new c(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),c.prototype.clone=function(e){return c.clone(this,e)},c.packedLength=e.packedLength,c.pack=function(t,r,i){return i=n(i,0),e.pack(t._radii,r,i),r},c.unpack=function(t,r,i){r=n(r,0);var a=e.unpack(t,r);return c.fromCartesian3(a,i)},c.prototype.geocentricSurfaceNormal=e.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(t,n){var i=t.longitude,a=t.latitude,o=Math.cos(a),u=o*Math.cos(i),E=o*Math.sin(i),s=Math.sin(a);return r(n)||(n=new e),n.x=u,n.y=E,n.z=s,e.normalize(n,n)},c.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var _=new e,l=new e;c.prototype.cartographicToCartesian=function(t,n){var i=_,a=l;this.geodeticSurfaceNormalCartographic(t,i),e.multiplyComponents(this._radiiSquared,i,a);var o=Math.sqrt(e.dot(i,a));return e.divideByScalar(a,o,a),e.multiplyByScalar(i,t.height,i),r(n)||(n=new e),e.add(a,i,n)},c.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;i<n;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var T=new e,R=new e,f=new e;return c.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,R);if(r(a)){var o=this.geodeticSurfaceNormal(a,T),E=e.subtract(n,a,f),s=Math.atan2(o.y,o.x),c=Math.asin(o.z),_=u.sign(e.dot(E,n))*e.magnitude(E);return r(i)?(i.longitude=s,i.latitude=c,i.height=_,i):new t(s,c,_)}},c.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;i<n;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t},c.prototype.scaleToGeodeticSurface=function(e,t){return E(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},c.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var i=t.x,a=t.y,o=t.z,u=this._oneOverRadiiSquared,E=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*u.z);return e.multiplyByScalar(t,E,n)},c.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},c.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},c.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},c.prototype.toString=function(){return this._radii.toString()},c.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,i,a){i=n(i,0);var o=this._sqauredXOverSquaredZ;if(r(a)||(a=new e),a.x=0,a.y=0,a.z=t.z*(1-o),!(Math.abs(a.z)>=this._radii.z-i))return a},c}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,i,a,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return i(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var i=this._semimajorAxis,a=t.longitude*i,o=t.latitude*i,u=t.height;return r(n)?(n.x=a,n.y=o,n.z=u,n):new e(a,o,u)},u.prototype.unproject=function(e,n){var i=this._oneOverSemimajorAxis,a=e.x*i,o=e.y*i,u=e.z;return r(n)?(n.longitude=a,n.latitude=o,n.height=u,n):new t(a,o,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";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a,o){"use strict";function u(e,n,r,i,a,o,u,E,s){this[0]=t(e,0),this[1]=t(i,0),this[2]=t(u,0),this[3]=t(n,0),this[4]=t(a,0),this[5]=t(E,0),this[6]=t(r,0),this[7]=t(o,0),this[8]=t(s,0)}function E(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function s(e){for(var t=0,n=0;n<3;++n){var r=e[u.getElementIndex(R[n],T[n])];t+=2*r*r}return Math.sqrt(t)}function c(e,t){for(var n=o.EPSILON15,r=0,i=1,a=0;a<3;++a){var E=Math.abs(e[u.getElementIndex(R[a],T[a])]);E>r&&(i=a,r=E)}var s=1,c=0,_=T[i],l=R[i];if(Math.abs(e[u.getElementIndex(l,_)])>n){var f,A=e[u.getElementIndex(l,l)],h=e[u.getElementIndex(_,_)],d=e[u.getElementIndex(l,_)],N=(A-h)/2/d;f=N<0?-1/(-N+Math.sqrt(1+N*N)):1/(N+Math.sqrt(1+N*N)),s=1/Math.sqrt(1+f*f),c=f*s}return t=u.clone(u.IDENTITY,t),t[u.getElementIndex(_,_)]=t[u.getElementIndex(l,l)]=s,t[u.getElementIndex(l,_)]=c,t[u.getElementIndex(_,l)]=-c,t}u.packedLength=9,u.pack=function(e,n,r){return r=t(r,0),n[r++]=e[0],n[r++]=e[1],n[r++]=e[2],n[r++]=e[3],n[r++]=e[4],n[r++]=e[5],n[r++]=e[6],n[r++]=e[7],n[r++]=e[8],n},u.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new u),i[0]=e[r++],i[1]=e[r++],i[2]=e[r++],i[3]=e[r++],i[4]=e[r++],i[5]=e[r++],i[6]=e[r++],i[7]=e[r++],i[8]=e[r++],i},u.clone=function(e,t){if(n(e))return n(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 u(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},u.fromArray=function(e,r,i){return r=t(r,0),n(i)||(i=new u),i[0]=e[r],i[1]=e[r+1],i[2]=e[r+2],i[3]=e[r+3],i[4]=e[r+4],i[5]=e[r+5],i[6]=e[r+6],i[7]=e[r+7],i[8]=e[r+8],i},u.fromColumnMajorArray=function(e,t){return u.clone(e,t)},u.fromRowMajorArray=function(e,t){return n(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 u(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},u.fromQuaternion=function(e,t){var r=e.x*e.x,i=e.x*e.y,a=e.x*e.z,o=e.x*e.w,E=e.y*e.y,s=e.y*e.z,c=e.y*e.w,_=e.z*e.z,l=e.z*e.w,T=e.w*e.w,R=r-E-_+T,f=2*(i-l),A=2*(a+c),h=2*(i+l),d=-r+E-_+T,N=2*(s-o),I=2*(a-c),S=2*(s+o),M=-r-E+_+T;return n(t)?(t[0]=R,t[1]=h,t[2]=I,t[3]=f,t[4]=d,t[5]=S,t[6]=A,t[7]=N,t[8]=M,t):new u(R,f,A,h,d,N,I,S,M)},u.fromHeadingPitchRoll=function(e,t){var r=Math.cos(-e.pitch),i=Math.cos(-e.heading),a=Math.cos(e.roll),o=Math.sin(-e.pitch),E=Math.sin(-e.heading),s=Math.sin(e.roll),c=r*i,_=-a*E+s*o*i,l=s*E+a*o*i,T=r*E,R=a*i+s*o*E,f=-o*a+a*o*E,A=-o,h=s*r,d=a*r;return n(t)?(t[0]=c,t[1]=T,t[2]=A,t[3]=_,t[4]=R,t[5]=h,t[6]=l,t[7]=f,t[8]=d,t):new u(c,_,l,T,R,f,A,h,d)},u.fromScale=function(e,t){return n(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 u(e.x,0,0,0,e.y,0,0,0,e.z)},u.fromUniformScale=function(e,t){return n(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 u(e,0,0,0,e,0,0,0,e)},u.fromCrossProduct=function(e,t){return n(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 u(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},u.fromRotationX=function(e,t){var r=Math.cos(e),i=Math.sin(e);return n(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=r,t[5]=i,t[6]=0,t[7]=-i,t[8]=r,t):new u(1,0,0,0,r,-i,0,i,r)},u.fromRotationY=function(e,t){var r=Math.cos(e),i=Math.sin(e);return n(t)?(t[0]=r,t[1]=0,t[2]=-i,t[3]=0,t[4]=1,t[5]=0,t[6]=i,t[7]=0,t[8]=r,t):new u(r,0,i,0,1,0,-i,0,r)},u.fromRotationZ=function(e,t){var r=Math.cos(e),i=Math.sin(e);return n(t)?(t[0]=r,t[1]=i,t[2]=0,t[3]=-i,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new u(r,-i,0,i,r,0,0,0,1)},u.toArray=function(e,t){return n(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]]},u.getElementIndex=function(e,t){return 3*e+t},u.getColumn=function(e,t,n){var r=3*t,i=e[r],a=e[r+1],o=e[r+2];return n.x=i,n.y=a,n.z=o,n},u.setColumn=function(e,t,n,r){r=u.clone(e,r);var i=3*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},u.getRow=function(e,t,n){var r=e[t],i=e[t+3],a=e[t+6];return n.x=r,n.y=i,n.z=a,n},u.setRow=function(e,t,n,r){return r=u.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var _=new e;u.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],_)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],_)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],_)),n};var l=new e;u.getMaximumScale=function(t){return u.getScale(t,l),e.maximumComponent(l)},u.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],i=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],o=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],E=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],s=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],c=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],_=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=r,n[1]=i,n[2]=a,n[3]=o,n[4]=u,n[5]=E,n[6]=s,n[7]=c,n[8]=_,n},u.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},u.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},u.multiplyByVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[3]*i+e[6]*a,u=e[1]*r+e[4]*i+e[7]*a,E=e[2]*r+e[5]*i+e[8]*a;return n.x=o,n.y=u,n.z=E,n},u.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},u.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},u.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},u.transpose=function(e,t){var n=e[0],r=e[3],i=e[6],a=e[1],o=e[4],u=e[7],E=e[2],s=e[5],c=e[8];return t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=u,t[6]=E,t[7]=s,t[8]=c,t};var T=[1,0,0],R=[2,2,1],f=new u,A=new u;return u.computeEigenDecomposition=function(e,t){var r=o.EPSILON20,i=10,a=0,_=0;n(t)||(t={});for(var l=t.unitary=u.clone(u.IDENTITY,t.unitary),T=t.diagonal=u.clone(e,t.diagonal),R=r*E(T);_<i&&s(T)>R;)c(T,f),u.transpose(f,A),u.multiply(T,f,T),u.multiply(A,T,T),u.multiply(l,f,l),++a>2&&(++_,a=0);return t},u.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},u.determinant=function(e){var t=e[0],n=e[3],r=e[6],i=e[1],a=e[4],o=e[7],u=e[2],E=e[5],s=e[8];return t*(a*s-E*o)+i*(E*r-n*s)+u*(n*o-a*r)},u.inverse=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],E=e[5],s=e[6],c=e[7],_=e[8],l=u.determinant(e);t[0]=o*_-c*E,t[1]=c*i-r*_,t[2]=r*E-o*i,t[3]=s*E-a*_,t[4]=n*_-s*i,t[5]=a*i-n*E,t[6]=a*c-s*o,t[7]=s*r-n*c,t[8]=n*o-a*r;var T=1/l;return u.multiplyByScalar(t,T,t)},u.equals=function(e,t){return e===t||n(e)&&n(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]},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r},u.IDENTITY=a(new u(1,0,0,0,1,0,0,0,1)),u.ZERO=a(new u(0,0,0,0,0,0,0,0,0)),u.COLUMN0ROW0=0,u.COLUMN0ROW1=1,u.COLUMN0ROW2=2,u.COLUMN1ROW0=3,u.COLUMN1ROW1=4,u.COLUMN1ROW2=5,u.COLUMN2ROW0=6,u.COLUMN2ROW1=7,u.COLUMN2ROW2=8,r(u.prototype,{length:{get:function(){return u.packedLength}}}),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},u}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i){"use strict";function a(t,n,r,i){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0),this.w=e(i,0)}a.fromElements=function(e,n,r,i,o){return t(o)?(o.x=e,o.y=n,o.z=r,o.w=i,o):new a(e,n,r,i)},a.fromColor=function(e,n){return t(n)?(n.x=e.red,n.y=e.green,n.z=e.blue,n.w=e.alpha,n):new a(e.red,e.green,e.blue,e.alpha)},a.clone=function(e,n){if(t(e))return t(n)?(n.x=e.x,n.y=e.y,n.z=e.z,n.w=e.w,n):new a(e.x,e.y,e.z,e.w)},a.packedLength=4,a.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w,n},a.unpack=function(n,r,i){return r=e(r,0),t(i)||(i=new a),i.x=n[r++],i.y=n[r++],i.z=n[r++],i.w=n[r],i},a.packArray=function(e,n){var r=e.length;t(n)?n.length=4*r:n=new Array(4*r);for(var i=0;i<r;++i)a.pack(e[i],n,4*i);return n},a.unpackArray=function(e,n){var r=e.length;t(n)?n.length=r/4:n=new Array(r/4);for(var i=0;i<r;i+=4){var o=i/4;n[o]=a.unpack(e,i,n[o])}return n},a.fromArray=a.unpack,a.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},a.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},a.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},a.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},a.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},a.magnitude=function(e){return Math.sqrt(a.magnitudeSquared(e))};var o=new a;a.distance=function(e,t){return a.subtract(e,t,o),a.magnitude(o)},a.distanceSquared=function(e,t){return a.subtract(e,t,o),a.magnitudeSquared(o)},a.normalize=function(e,t){var n=a.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t},a.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},a.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},a.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},a.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},a.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},a.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},a.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},a.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,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.w=Math.abs(e.w),t};var u=new a;a.lerp=function(e,t,n,r){return a.multiplyByScalar(t,n,u),r=a.multiplyByScalar(e,1-n,r),a.add(u,r,r)};var E=new a;return a.mostOrthogonalAxis=function(e,t){var n=a.normalize(e,E);return a.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?a.clone(a.UNIT_X,t):a.clone(a.UNIT_W,t):n.z<=n.w?a.clone(a.UNIT_Z,t):a.clone(a.UNIT_W,t):n.y<=n.z?n.y<=n.w?a.clone(a.UNIT_Y,t):a.clone(a.UNIT_W,t):n.z<=n.w?a.clone(a.UNIT_Z,t):a.clone(a.UNIT_W,t)},a.equals=function(e,n){return e===n||t(e)&&t(n)&&e.x===n.x&&e.y===n.y&&e.z===n.z&&e.w===n.w},a.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},a.equalsEpsilon=function(e,n,r,a){return e===n||t(e)&&t(n)&&i.equalsEpsilon(e.x,n.x,r,a)&&i.equalsEpsilon(e.y,n.y,r,a)&&i.equalsEpsilon(e.z,n.z,r,a)&&i.equalsEpsilon(e.w,n.w,r,a)},a.ZERO=r(new a(0,0,0,0)),a.UNIT_X=r(new a(1,0,0,0)),a.UNIT_Y=r(new a(0,1,0,0)),a.UNIT_Z=r(new a(0,0,1,0)),a.UNIT_W=r(new a(0,0,0,1)),a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,n){return a.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},a}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,i,a,o,u,E,s){"use strict";function c(e,t,r,i,a,o,u,E,s,c,_,l,T,R,f,A){this[0]=n(e,0),this[1]=n(a,0),this[2]=n(s,0),this[3]=n(T,0),this[4]=n(t,0), -this[5]=n(o,0),this[6]=n(c,0),this[7]=n(R,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(_,0),this[11]=n(f,0),this[12]=n(i,0),this[13]=n(E,0),this[14]=n(l,0),this[15]=n(A,0)}c.packedLength=16,c.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t[r++]=e[9],t[r++]=e[10],t[r++]=e[11],t[r++]=e[12],t[r++]=e[13],t[r++]=e[14],t[r]=e[15],t},c.unpack=function(e,t,i){return t=n(t,0),r(i)||(i=new c),i[0]=e[t++],i[1]=e[t++],i[2]=e[t++],i[3]=e[t++],i[4]=e[t++],i[5]=e[t++],i[6]=e[t++],i[7]=e[t++],i[8]=e[t++],i[9]=e[t++],i[10]=e[t++],i[11]=e[t++],i[12]=e[t++],i[13]=e[t++],i[14]=e[t++],i[15]=e[t],i},c.clone=function(e,t){if(r(e))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):new c(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])},c.fromArray=c.unpack,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[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 c(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])},c.fromRotationTranslation=function(t,i,a){return i=n(i,e.ZERO),r(a)?(a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=0,a[4]=t[3],a[5]=t[4],a[6]=t[5],a[7]=0,a[8]=t[6],a[9]=t[7],a[10]=t[8],a[11]=0,a[12]=i.x,a[13]=i.y,a[14]=i.z,a[15]=1,a):new c(t[0],t[3],t[6],i.x,t[1],t[4],t[7],i.y,t[2],t[5],t[8],i.z,0,0,0,1)},c.fromTranslationQuaternionRotationScale=function(e,t,n,i){r(i)||(i=new c);var a=n.x,o=n.y,u=n.z,E=t.x*t.x,s=t.x*t.y,_=t.x*t.z,l=t.x*t.w,T=t.y*t.y,R=t.y*t.z,f=t.y*t.w,A=t.z*t.z,h=t.z*t.w,d=t.w*t.w,N=E-T-A+d,I=2*(s-h),S=2*(_+f),M=2*(s+h),y=-E+T-A+d,m=2*(R-l),O=2*(_-f),p=2*(R+l),C=-E-T+A+d;return i[0]=N*a,i[1]=M*a,i[2]=O*a,i[3]=0,i[4]=I*o,i[5]=y*o,i[6]=p*o,i[7]=0,i[8]=S*u,i[9]=m*u,i[10]=C*u,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i},c.fromTranslationRotationScale=function(e,t){return c.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},c.fromTranslation=function(e,t){return c.fromRotationTranslation(E.IDENTITY,e,t)},c.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 c(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},c.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 c(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var _=new e,l=new e,T=new e;c.fromCamera=function(t,n){var i=t.position,a=t.direction,o=t.up;e.normalize(a,_),e.normalize(e.cross(_,o,l),l),e.normalize(e.cross(l,_,T),T);var u=l.x,E=l.y,s=l.z,R=_.x,f=_.y,A=_.z,h=T.x,d=T.y,N=T.z,I=i.x,S=i.y,M=i.z,y=u*-I+E*-S+s*-M,m=h*-I+d*-S+N*-M,O=R*I+f*S+A*M;return r(n)?(n[0]=u,n[1]=h,n[2]=-R,n[3]=0,n[4]=E,n[5]=d,n[6]=-f,n[7]=0,n[8]=s,n[9]=N,n[10]=-A,n[11]=0,n[12]=y,n[13]=m,n[14]=O,n[15]=1,n):new c(u,E,s,y,h,d,N,m,-R,-f,-A,O,0,0,0,1)},c.computePerspectiveFieldOfView=function(e,t,n,r,i){var a=Math.tan(.5*e),o=1/a,u=o/t,E=(r+n)/(n-r),s=2*r*n/(n-r);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=o,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=E,i[11]=-1,i[12]=0,i[13]=0,i[14]=s,i[15]=0,i},c.computeOrthographicOffCenter=function(e,t,n,r,i,a,o){var u=1/(t-e),E=1/(r-n),s=1/(a-i),c=-(t+e)*u,_=-(r+n)*E,l=-(a+i)*s;return u*=2,E*=2,s*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=s,o[11]=0,o[12]=c,o[13]=_,o[14]=l,o[15]=1,o},c.computePerspectiveOffCenter=function(e,t,n,r,i,a,o){var u=2*i/(t-e),E=2*i/(r-n),s=(t+e)/(t-e),c=(r+n)/(r-n),_=-(a+i)/(a-i),l=-1,T=-2*a*i/(a-i);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=s,o[9]=c,o[10]=_,o[11]=l,o[12]=0,o[13]=0,o[14]=T,o[15]=0,o},c.computeInfinitePerspectiveOffCenter=function(e,t,n,r,i,a){var o=2*i/(t-e),u=2*i/(r-n),E=(t+e)/(t-e),s=(r+n)/(r-n),c=-1,_=-1,l=-2*i;return a[0]=o,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=E,a[9]=s,a[10]=c,a[11]=_,a[12]=0,a[13]=0,a[14]=l,a[15]=0,a},c.computeViewportTransformation=function(e,t,r,i){e=n(e,n.EMPTY_OBJECT);var a=n(e.x,0),o=n(e.y,0),u=n(e.width,0),E=n(e.height,0);t=n(t,0),r=n(r,1);var s=.5*u,c=.5*E,_=.5*(r-t),l=s,T=c,R=_,f=a+s,A=o+c,h=t+_,d=1;return i[0]=l,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=T,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=R,i[11]=0,i[12]=f,i[13]=A,i[14]=h,i[15]=d,i},c.computeView=function(t,n,r,i,a){return a[0]=i.x,a[1]=r.x,a[2]=-n.x,a[3]=0,a[4]=i.y,a[5]=r.y,a[6]=-n.y,a[7]=0,a[8]=i.z,a[9]=r.z,a[10]=-n.z,a[11]=0,a[12]=-e.dot(i,t),a[13]=-e.dot(r,t),a[14]=e.dot(n,t),a[15]=1,a},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[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]]},c.getElementIndex=function(e,t){return 4*e+t},c.getColumn=function(e,t,n){var r=4*t,i=e[r],a=e[r+1],o=e[r+2],u=e[r+3];return n.x=i,n.y=a,n.z=o,n.w=u,n},c.setColumn=function(e,t,n,r){r=c.clone(e,r);var i=4*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r[i+3]=n.w,r},c.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},c.getRow=function(e,t,n){var r=e[t],i=e[t+4],a=e[t+8],o=e[t+12];return n.x=r,n.y=i,n.z=a,n.w=o,n},c.setRow=function(e,t,n,r){return r=c.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var R=new e;c.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],R)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],R)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],R)),n};var f=new e;c.getMaximumScale=function(t){return c.getScale(t,f),e.maximumComponent(f)},c.multiply=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[3],u=e[4],E=e[5],s=e[6],c=e[7],_=e[8],l=e[9],T=e[10],R=e[11],f=e[12],A=e[13],h=e[14],d=e[15],N=t[0],I=t[1],S=t[2],M=t[3],y=t[4],m=t[5],O=t[6],p=t[7],C=t[8],U=t[9],L=t[10],g=t[11],w=t[12],x=t[13],v=t[14],F=t[15],P=r*N+u*I+_*S+f*M,B=i*N+E*I+l*S+A*M,D=a*N+s*I+T*S+h*M,z=o*N+c*I+R*S+d*M,G=r*y+u*m+_*O+f*p,b=i*y+E*m+l*O+A*p,V=a*y+s*m+T*O+h*p,X=o*y+c*m+R*O+d*p,H=r*C+u*U+_*L+f*g,W=i*C+E*U+l*L+A*g,q=a*C+s*U+T*L+h*g,Y=o*C+c*U+R*L+d*g,k=r*w+u*x+_*v+f*F,K=i*w+E*x+l*v+A*F,j=a*w+s*x+T*v+h*F,Z=o*w+c*x+R*v+d*F;return n[0]=P,n[1]=B,n[2]=D,n[3]=z,n[4]=G,n[5]=b,n[6]=V,n[7]=X,n[8]=H,n[9]=W,n[10]=q,n[11]=Y,n[12]=k,n[13]=K,n[14]=j,n[15]=Z,n},c.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},c.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},c.multiplyTransformation=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[4],u=e[5],E=e[6],s=e[8],c=e[9],_=e[10],l=e[12],T=e[13],R=e[14],f=t[0],A=t[1],h=t[2],d=t[4],N=t[5],I=t[6],S=t[8],M=t[9],y=t[10],m=t[12],O=t[13],p=t[14],C=r*f+o*A+s*h,U=i*f+u*A+c*h,L=a*f+E*A+_*h,g=r*d+o*N+s*I,w=i*d+u*N+c*I,x=a*d+E*N+_*I,v=r*S+o*M+s*y,F=i*S+u*M+c*y,P=a*S+E*M+_*y,B=r*m+o*O+s*p+l,D=i*m+u*O+c*p+T,z=a*m+E*O+_*p+R;return n[0]=C,n[1]=U,n[2]=L,n[3]=0,n[4]=g,n[5]=w,n[6]=x,n[7]=0,n[8]=v,n[9]=F,n[10]=P,n[11]=0,n[12]=B,n[13]=D,n[14]=z,n[15]=1,n},c.multiplyByMatrix3=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[4],u=e[5],E=e[6],s=e[8],c=e[9],_=e[10],l=t[0],T=t[1],R=t[2],f=t[3],A=t[4],h=t[5],d=t[6],N=t[7],I=t[8],S=r*l+o*T+s*R,M=i*l+u*T+c*R,y=a*l+E*T+_*R,m=r*f+o*A+s*h,O=i*f+u*A+c*h,p=a*f+E*A+_*h,C=r*d+o*N+s*I,U=i*d+u*N+c*I,L=a*d+E*N+_*I;return n[0]=S,n[1]=M,n[2]=y,n[3]=0,n[4]=m,n[5]=O,n[6]=p,n[7]=0,n[8]=C,n[9]=U,n[10]=L,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},c.multiplyByTranslation=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=r*e[0]+i*e[4]+a*e[8]+e[12],u=r*e[1]+i*e[5]+a*e[9]+e[13],E=r*e[2]+i*e[6]+a*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=E,n[15]=e[15],n};var A=new e;c.multiplyByUniformScale=function(e,t,n){return A.x=t,A.y=t,A.z=t,c.multiplyByScale(e,A,n)},c.multiplyByScale=function(e,t,n){var r=t.x,i=t.y,a=t.z;return 1===r&&1===i&&1===a?c.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=i*e[4],n[5]=i*e[5],n[6]=i*e[6],n[7]=0,n[8]=a*e[8],n[9]=a*e[9],n[10]=a*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},c.multiplyByVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=t.w,u=e[0]*r+e[4]*i+e[8]*a+e[12]*o,E=e[1]*r+e[5]*i+e[9]*a+e[13]*o,s=e[2]*r+e[6]*i+e[10]*a+e[14]*o,c=e[3]*r+e[7]*i+e[11]*a+e[15]*o;return n.x=u,n.y=E,n.z=s,n.w=c,n},c.multiplyByPointAsVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[4]*i+e[8]*a,u=e[1]*r+e[5]*i+e[9]*a,E=e[2]*r+e[6]*i+e[10]*a;return n.x=o,n.y=u,n.z=E,n},c.multiplyByPoint=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[4]*i+e[8]*a+e[12],u=e[1]*r+e[5]*i+e[9]*a+e[13],E=e[2]*r+e[6]*i+e[10]*a+e[14];return n.x=o,n.y=u,n.z=E,n},c.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},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[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},c.transpose=function(e,t){var n=e[1],r=e[2],i=e[3],a=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=a,t[10]=e[10],t[11]=e[14],t[12]=i,t[13]=o,t[14]=u,t[15]=e[15],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[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},c.equals=function(e,t){return e===t||r(e)&&r(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},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&&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},c.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},c.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};var h=new E,d=new E,N=new t,I=new t(0,0,0,1);return c.inverse=function(e,n){if(E.equalsEpsilon(c.getRotation(e,h),d,u.EPSILON7)&&t.equals(c.getRow(e,3,N),I))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],i=e[4],a=e[8],o=e[12],_=e[1],l=e[5],T=e[9],R=e[13],f=e[2],A=e[6],S=e[10],M=e[14],y=e[3],m=e[7],O=e[11],p=e[15],C=S*p,U=M*O,L=A*p,g=M*m,w=A*O,x=S*m,v=f*p,F=M*y,P=f*O,B=S*y,D=f*m,z=A*y,G=C*l+g*T+w*R-(U*l+L*T+x*R),b=U*_+v*T+B*R-(C*_+F*T+P*R),V=L*_+F*l+D*R-(g*_+v*l+z*R),X=x*_+P*l+z*T-(w*_+B*l+D*T),H=U*i+L*a+x*o-(C*i+g*a+w*o),W=C*r+F*a+P*o-(U*r+v*a+B*o),q=g*r+v*i+z*o-(L*r+F*i+D*o),Y=w*r+B*i+D*a-(x*r+P*i+z*a);C=a*R,U=o*T,L=i*R,g=o*l,w=i*T,x=a*l,v=r*R,F=o*_,P=r*T,B=a*_,D=r*l,z=i*_;var k=C*m+g*O+w*p-(U*m+L*O+x*p),K=U*y+v*O+B*p-(C*y+F*O+P*p),j=L*y+F*m+D*p-(g*y+v*m+z*p),Z=x*y+P*m+z*O-(w*y+B*m+D*O),Q=L*S+x*M+U*A-(w*M+C*A+g*S),J=P*M+C*f+F*S-(v*S+B*M+U*f),$=v*A+z*M+g*f-(D*M+L*f+F*A),ee=D*S+w*f+B*A-(P*A+z*S+x*f),te=r*G+i*b+a*V+o*X;if(Math.abs(te)<u.EPSILON20)throw new s("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=G*te,n[1]=b*te,n[2]=V*te,n[3]=X*te,n[4]=H*te,n[5]=W*te,n[6]=q*te,n[7]=Y*te,n[8]=k*te,n[9]=K*te,n[10]=j*te,n[11]=Z*te,n[12]=Q*te,n[13]=J*te,n[14]=$*te,n[15]=ee*te,n},c.inverseTransformation=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[4],o=e[5],u=e[6],E=e[8],s=e[9],c=e[10],_=e[12],l=e[13],T=e[14],R=-n*_-r*l-i*T,f=-a*_-o*l-u*T,A=-E*_-s*l-c*T;return t[0]=n,t[1]=a,t[2]=E,t[3]=0,t[4]=r,t[5]=o,t[6]=s,t[7]=0,t[8]=i,t[9]=u,t[10]=c,t[11]=0,t[12]=R,t[13]=f,t[14]=A,t[15]=1,t},c.IDENTITY=o(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),c.ZERO=o(new c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN0ROW3=3,c.COLUMN1ROW0=4,c.COLUMN1ROW1=5,c.COLUMN1ROW2=6,c.COLUMN1ROW3=7,c.COLUMN2ROW0=8,c.COLUMN2ROW1=9,c.COLUMN2ROW2=10,c.COLUMN2ROW3=11,c.COLUMN3ROW0=12,c.COLUMN3ROW1=13,c.COLUMN3ROW2=14,c.COLUMN3ROW3=15,i(c.prototype,{length:{get:function(){return c.packedLength}}}),c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.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]+")"},c}),define("Core/Rectangle",["./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,i,a,o,u){"use strict";function E(e,n,r,i){this.west=t(e,0),this.south=t(n,0),this.east=t(r,0),this.north=t(i,0)}r(E.prototype,{width:{get:function(){return E.computeWidth(this)}},height:{get:function(){return E.computeHeight(this)}}}),E.packedLength=4,E.pack=function(e,n,r){return r=t(r,0),n[r++]=e.west,n[r++]=e.south,n[r++]=e.east,n[r]=e.north,n},E.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new E),i.west=e[r++],i.south=e[r++],i.east=e[r++],i.north=e[r],i},E.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=u.TWO_PI),t-n},E.computeHeight=function(e){return e.north-e.south},E.fromDegrees=function(e,r,i,a,o){return e=u.toRadians(t(e,0)),r=u.toRadians(t(r,0)),i=u.toRadians(t(i,0)),a=u.toRadians(t(a,0)),n(o)?(o.west=e,o.south=r,o.east=i,o.north=a,o):new E(e,r,i,a)},E.fromCartographicArray=function(e,t){for(var r=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=Number.MAX_VALUE,c=-Number.MAX_VALUE,_=0,l=e.length;_<l;_++){var T=e[_];r=Math.min(r,T.longitude),i=Math.max(i,T.longitude),s=Math.min(s,T.latitude),c=Math.max(c,T.latitude);var R=T.longitude>=0?T.longitude:T.longitude+u.TWO_PI;a=Math.min(a,R),o=Math.max(o,R)}return i-r>o-a&&(r=a,i=o,i>u.PI&&(i-=u.TWO_PI),r>u.PI&&(r-=u.TWO_PI)),n(t)?(t.west=r,t.south=s,t.east=i,t.north=c,t):new E(r,s,i,c)},E.fromCartesianArray=function(e,t,r){for(var i=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,s=-Number.MAX_VALUE,c=Number.MAX_VALUE,_=-Number.MAX_VALUE,l=0,T=e.length;l<T;l++){var R=t.cartesianToCartographic(e[l]);i=Math.min(i,R.longitude),a=Math.max(a,R.longitude),c=Math.min(c,R.latitude),_=Math.max(_,R.latitude);var f=R.longitude>=0?R.longitude:R.longitude+u.TWO_PI;o=Math.min(o,f),s=Math.max(s,f)}return a-i>s-o&&(i=o,a=s,a>u.PI&&(a-=u.TWO_PI),i>u.PI&&(i-=u.TWO_PI)),n(r)?(r.west=i,r.south=c,r.east=a,r.north=_,r):new E(i,c,a,_)},E.clone=function(e,t){if(n(e))return n(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new E(e.west,e.south,e.east,e.north)},E.prototype.clone=function(e){return E.clone(this,e)},E.prototype.equals=function(e){return E.equals(this,e)},E.equals=function(e,t){return e===t||n(e)&&n(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},E.prototype.equalsEpsilon=function(e,t){return n(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},E.validate=function(e){},E.southwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.south,r.height=0,r):new e(t.west,t.south)},E.northwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.north,r.height=0,r):new e(t.west,t.north)},E.northeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.north,r.height=0,r):new e(t.east,t.north)},E.southeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.south,r.height=0,r):new e(t.east,t.south)},E.center=function(t,r){var i=t.east,a=t.west;i<a&&(i+=u.TWO_PI);var o=u.negativePiToPi(.5*(a+i)),E=.5*(t.south+t.north);return n(r)?(r.longitude=o,r.latitude=E,r.height=0,r):new e(o,E)},E.intersection=function(e,t,r){var i=e.east,a=e.west,o=t.east,s=t.west;i<a&&o>0?i+=u.TWO_PI:o<s&&i>0&&(o+=u.TWO_PI),i<a&&s<0?s+=u.TWO_PI:o<s&&a<0&&(a+=u.TWO_PI);var c=u.negativePiToPi(Math.max(a,s)),_=u.negativePiToPi(Math.min(i,o));if(!((e.west<e.east||t.west<t.east)&&_<=c)){var l=Math.max(e.south,t.south),T=Math.min(e.north,t.north);if(!(l>=T))return n(r)?(r.west=c,r.south=l,r.east=_,r.north=T,r):new E(c,l,_,T)}},E.simpleIntersection=function(e,t,r){var i=Math.max(e.west,t.west),a=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(a>=u||i>=o))return n(r)?(r.west=i,r.south=a,r.east=o,r.north=u,r):new E(i,a,o,u)},E.union=function(e,t,r){n(r)||(r=new E);var i=e.east,a=e.west,o=t.east,s=t.west;i<a&&o>0?i+=u.TWO_PI:o<s&&i>0&&(o+=u.TWO_PI),i<a&&s<0?s+=u.TWO_PI:o<s&&a<0&&(a+=u.TWO_PI);var c=u.convertLongitudeRange(Math.min(a,s)),_=u.convertLongitudeRange(Math.max(i,o));return r.west=c,r.south=Math.min(e.south,t.south),r.east=_,r.north=Math.max(e.north,t.north),r},E.expand=function(e,t,r){return n(r)||(r=new E),r.west=Math.min(e.west,t.longitude),r.south=Math.min(e.south,t.latitude),r.east=Math.max(e.east,t.longitude),r.north=Math.max(e.north,t.latitude),r},E.contains=function(e,t){var n=t.longitude,r=t.latitude,i=e.west,a=e.east;return a<i&&(a+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>i||u.equalsEpsilon(n,i,u.EPSILON14))&&(n<a||u.equalsEpsilon(n,a,u.EPSILON14))&&r>=e.south&&r<=e.north};var s=new e;return E.subsample=function(e,r,i,o){r=t(r,a.WGS84),i=t(i,0),n(o)||(o=[]);var c=0,_=e.north,l=e.south,T=e.east,R=e.west,f=s;f.height=i,f.longitude=R,f.latitude=_,o[c]=r.cartographicToCartesian(f,o[c]),c++,f.longitude=T,o[c]=r.cartographicToCartesian(f,o[c]),c++,f.latitude=l,o[c]=r.cartographicToCartesian(f,o[c]),c++,f.longitude=R,o[c]=r.cartographicToCartesian(f,o[c]),c++,_<0?f.latitude=_:l>0?f.latitude=l:f.latitude=0;for(var A=1;A<8;++A)f.longitude=-Math.PI+A*u.PI_OVER_TWO,E.contains(e,f)&&(o[c]=r.cartographicToCartesian(f,o[c]),c++);return 0===f.latitude&&(f.longitude=R,o[c]=r.cartographicToCartesian(f,o[c]),c++,f.longitude=T,o[c]=r.cartographicToCartesian(f,o[c]),c++),o.length=c,o},E.MAX_VALUE=o(new E(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),E}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,i,a,o,u,E,s,c,_){"use strict";function l(t,r){this.center=e.clone(n(t,e.ZERO)),this.radius=n(r,0)}var T=new e,R=new e,f=new e,A=new e,h=new e,d=new e,N=new e,I=new e,S=new e,M=new e,y=new e,m=new e;l.fromPoints=function(t,n){if(r(n)||(n=new l),!r(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var i=e.clone(t[0],N),a=e.clone(i,T),o=e.clone(i,R),u=e.clone(i,f),E=e.clone(i,A),s=e.clone(i,h),c=e.clone(i,d),_=t.length,O=1;O<_;O++){e.clone(t[O],i);var p=i.x,C=i.y,U=i.z;p<a.x&&e.clone(i,a),p>E.x&&e.clone(i,E),C<o.y&&e.clone(i,o),C>s.y&&e.clone(i,s),U<u.z&&e.clone(i,u),U>c.z&&e.clone(i,c)}var L=e.magnitudeSquared(e.subtract(E,a,I)),g=e.magnitudeSquared(e.subtract(s,o,I)),w=e.magnitudeSquared(e.subtract(c,u,I)),x=a,v=E,F=L;g>F&&(F=g,x=o,v=s),w>F&&(F=w,x=u,v=c);var P=S;P.x=.5*(x.x+v.x),P.y=.5*(x.y+v.y),P.z=.5*(x.z+v.z);var B=e.magnitudeSquared(e.subtract(v,P,I)),D=Math.sqrt(B),z=M;z.x=a.x,z.y=o.y,z.z=u.z;var G=y;G.x=E.x,G.y=s.y,G.z=c.z;var b=e.multiplyByScalar(e.add(z,G,I),.5,m),V=0;for(O=0;O<_;O++){e.clone(t[O],i);var X=e.magnitude(e.subtract(i,b,I));X>V&&(V=X);var H=e.magnitudeSquared(e.subtract(i,P,I));if(H>B){var W=Math.sqrt(H);D=.5*(D+W),B=D*D;var q=W-D;P.x=(D*P.x+q*i.x)/W,P.y=(D*P.y+q*i.y)/W,P.z=(D*P.z+q*i.z)/W}}return D<V?(e.clone(P,n.center),n.radius=D):(e.clone(b,n.center),n.radius=V),n};var O=new o,p=new e,C=new e,U=new t,L=new t;l.fromRectangle2D=function(e,t,n){return l.fromRectangleWithHeights2D(e,t,0,0,n)},l.fromRectangleWithHeights2D=function(t,i,a,o,u){if(r(u)||(u=new l),!r(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;i=n(i,O),_.southwest(t,U),U.height=a,_.northeast(t,L),L.height=o;var E=i.project(U,p),s=i.project(L,C),c=s.x-E.x,T=s.y-E.y,R=s.z-E.z;u.radius=.5*Math.sqrt(c*c+T*T+R*R);var f=u.center;return f.x=E.x+.5*c,f.y=E.y+.5*T,f.z=E.z+.5*R,u};var g=[];l.fromRectangle3D=function(e,t,i,o){t=n(t,a.WGS84),i=n(i,0);var u;return r(e)&&(u=_.subsample(e,t,i,g)),l.fromPoints(u,o)},l.fromVertices=function(t,i,a,o){if(r(o)||(o=new l),!r(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;i=n(i,e.ZERO),a=n(a,3);var u=N;u.x=t[0]+i.x,u.y=t[1]+i.y,u.z=t[2]+i.z;for(var E=e.clone(u,T),s=e.clone(u,R),c=e.clone(u,f),_=e.clone(u,A),O=e.clone(u,h),p=e.clone(u,d),C=t.length,U=0;U<C;U+=a){var L=t[U]+i.x,g=t[U+1]+i.y,w=t[U+2]+i.z;u.x=L,u.y=g,u.z=w,L<E.x&&e.clone(u,E),L>_.x&&e.clone(u,_),g<s.y&&e.clone(u,s),g>O.y&&e.clone(u,O),w<c.z&&e.clone(u,c),w>p.z&&e.clone(u,p)}var x=e.magnitudeSquared(e.subtract(_,E,I)),v=e.magnitudeSquared(e.subtract(O,s,I)),F=e.magnitudeSquared(e.subtract(p,c,I)),P=E,B=_,D=x;v>D&&(D=v,P=s,B=O),F>D&&(D=F,P=c,B=p);var z=S;z.x=.5*(P.x+B.x),z.y=.5*(P.y+B.y),z.z=.5*(P.z+B.z);var G=e.magnitudeSquared(e.subtract(B,z,I)),b=Math.sqrt(G),V=M;V.x=E.x,V.y=s.y,V.z=c.z;var X=y;X.x=_.x,X.y=O.y,X.z=p.z;var H=e.multiplyByScalar(e.add(V,X,I),.5,m),W=0;for(U=0;U<C;U+=a){u.x=t[U]+i.x,u.y=t[U+1]+i.y,u.z=t[U+2]+i.z;var q=e.magnitude(e.subtract(u,H,I));q>W&&(W=q);var Y=e.magnitudeSquared(e.subtract(u,z,I));if(Y>G){var k=Math.sqrt(Y);b=.5*(b+k),G=b*b;var K=k-b;z.x=(b*z.x+K*u.x)/k,z.y=(b*z.y+K*u.y)/k,z.z=(b*z.z+K*u.z)/k}}return b<W?(e.clone(z,o.center),o.radius=b):(e.clone(H,o.center),o.radius=W),o},l.fromEncodedCartesianVertices=function(t,n,i){if(r(i)||(i=new l),!r(t)||!r(n)||t.length!==n.length||0===t.length)return i.center=e.clone(e.ZERO,i.center),i.radius=0,i;var a=N;a.x=t[0]+n[0],a.y=t[1]+n[1],a.z=t[2]+n[2];for(var o=e.clone(a,T),u=e.clone(a,R),E=e.clone(a,f),s=e.clone(a,A),c=e.clone(a,h),_=e.clone(a,d),O=t.length,p=0;p<O;p+=3){var C=t[p]+n[p],U=t[p+1]+n[p+1],L=t[p+2]+n[p+2];a.x=C,a.y=U,a.z=L,C<o.x&&e.clone(a,o),C>s.x&&e.clone(a,s),U<u.y&&e.clone(a,u),U>c.y&&e.clone(a,c),L<E.z&&e.clone(a,E),L>_.z&&e.clone(a,_)}var g=e.magnitudeSquared(e.subtract(s,o,I)),w=e.magnitudeSquared(e.subtract(c,u,I)),x=e.magnitudeSquared(e.subtract(_,E,I)),v=o,F=s,P=g;w>P&&(P=w,v=u,F=c),x>P&&(P=x,v=E,F=_);var B=S;B.x=.5*(v.x+F.x),B.y=.5*(v.y+F.y),B.z=.5*(v.z+F.z);var D=e.magnitudeSquared(e.subtract(F,B,I)),z=Math.sqrt(D),G=M;G.x=o.x,G.y=u.y,G.z=E.z;var b=y;b.x=s.x,b.y=c.y,b.z=_.z;var V=e.multiplyByScalar(e.add(G,b,I),.5,m),X=0;for(p=0;p<O;p+=3){a.x=t[p]+n[p],a.y=t[p+1]+n[p+1],a.z=t[p+2]+n[p+2];var H=e.magnitude(e.subtract(a,V,I));H>X&&(X=H);var W=e.magnitudeSquared(e.subtract(a,B,I));if(W>D){var q=Math.sqrt(W);z=.5*(z+q),D=z*z;var Y=q-z;B.x=(z*B.x+Y*a.x)/q,B.y=(z*B.y+Y*a.y)/q,B.z=(z*B.z+Y*a.z)/q}}return z<X?(e.clone(B,i.center),i.radius=z):(e.clone(V,i.center),i.radius=X),i},l.fromCornerPoints=function(t,n,i){r(i)||(i=new l);var a=i.center;return e.add(t,n,a),e.multiplyByScalar(a,.5,a),i.radius=e.distance(a,n),i},l.fromEllipsoid=function(t,n){return r(n)||(n=new l),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var w=new e;l.fromBoundingSpheres=function(t,n){if(r(n)||(n=new l),!r(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var i=t.length;if(1===i)return l.clone(t[0],n);if(2===i)return l.union(t[0],t[1],n);for(var a=[],o=0;o<i;o++)a.push(t[o].center);n=l.fromPoints(a,n);var u=n.center,E=n.radius;for(o=0;o<i;o++){var s=t[o];E=Math.max(E,e.distance(u,s.center,w)+s.radius)}return n.radius=E,n};var x=new e,v=new e,F=new e;l.fromOrientedBoundingBox=function(t,n){r(n)||(n=new l);var i=t.halfAxes,a=s.getColumn(i,0,x),o=s.getColumn(i,1,v),u=s.getColumn(i,2,F),E=e.magnitude(a),c=e.magnitude(o),_=e.magnitude(u);return n.center=e.clone(t.center,n.center),n.radius=Math.max(E,c,_),n},l.clone=function(t,n){if(r(t))return r(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new l(t.center,t.radius)},l.packedLength=4,l.pack=function(e,t,r){r=n(r,0);var i=e.center;return t[r++]=i.x,t[r++]=i.y,t[r++]=i.z,t[r]=e.radius,t},l.unpack=function(e,t,i){t=n(t,0),r(i)||(i=new l);var a=i.center;return a.x=e[t++],a.y=e[t++],a.z=e[t++],i.radius=e[t],i};var P=new e,B=new e;l.union=function(t,n,i){r(i)||(i=new l);var a=t.center,o=t.radius,u=n.center,E=n.radius,s=e.subtract(u,a,P),c=e.magnitude(s);if(o>=c+E)return t.clone(i),i;if(E>=c+o)return n.clone(i),i;var _=.5*(o+c+E),T=e.multiplyByScalar(s,(-o+_)/c,B);return e.add(T,a,T),e.clone(T,i.center),i.radius=_,i};var D=new e;l.expand=function(t,n,r){r=l.clone(t,r);var i=e.magnitude(e.subtract(n,r.center,D));return i>r.radius&&(r.radius=i),r},l.intersectPlane=function(t,n){var r=t.center,i=t.radius,a=n.normal,o=e.dot(a,r)+n.distance;return o<-i?u.OUTSIDE:o<i?u.INTERSECTING:u.INSIDE},l.transform=function(e,t,n){return r(n)||(n=new l),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=c.getMaximumScale(t)*e.radius,n};var z=new e;l.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,z);return e.magnitudeSquared(r)-t.radius*t.radius},l.transformWithoutScale=function(e,t,n){return r(n)||(n=new l),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var G=new e;l.computePlaneDistances=function(t,n,i,a){r(a)||(a=new E);var o=e.subtract(t.center,n,G),u=e.dot(i,o);return a.start=u-t.radius,a.stop=u+t.radius,a};for(var b=new e,V=new e,X=new e,H=new e,W=new e,q=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var K=new o;return l.projectTo2D=function(t,r,i){r=n(r,K);var a=r.ellipsoid,o=t.center,u=t.radius,E=a.geodeticSurfaceNormal(o,b),s=e.cross(e.UNIT_Z,E,V);e.normalize(s,s);var c=e.cross(E,s,X);e.normalize(c,c),e.multiplyByScalar(E,u,E),e.multiplyByScalar(c,u,c),e.multiplyByScalar(s,u,s);var _=e.negate(c,W),T=e.negate(s,H),R=Y,f=R[0];e.add(E,c,f),e.add(f,s,f),f=R[1],e.add(E,c,f),e.add(f,T,f),f=R[2],e.add(E,_,f),e.add(f,T,f),f=R[3],e.add(E,_,f),e.add(f,s,f),e.negate(E,E),f=R[4],e.add(E,c,f),e.add(f,s,f),f=R[5],e.add(E,c,f),e.add(f,T,f),f=R[6],e.add(E,_,f),e.add(f,T,f),f=R[7],e.add(E,_,f),e.add(f,s,f);for(var A=R.length,h=0;h<A;++h){var d=R[h];e.add(o,d,d);var N=a.cartesianToCartographic(d,q);r.project(N,d)}i=l.fromPoints(R,i),o=i.center;var I=o.x,S=o.y,M=o.z;return o.x=M,o.y=I,o.z=S,i},l.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},l.equals=function(t,n){return t===n||r(t)&&r(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},l.prototype.intersectPlane=function(e){return l.intersectPlane(this,e)},l.prototype.distanceSquaredTo=function(e){return l.distanceSquaredTo(this,e)},l.prototype.computePlaneDistances=function(e,t,n){return l.computePlaneDistances(this,e,t,n)},l.prototype.isOccluded=function(e){return l.isOccluded(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.prototype.clone=function(e){return l.clone(this,e)},l}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},i={};return t(i,{element:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(i.supportsFullscreen())return null!==i.element}}}),i.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var i,a=["webkit","moz","o","ms","khtml"],o=0,u=a.length;o<u;++o){var E=a[o];i=E+"RequestFullscreen","function"==typeof t[i]?(r.requestFullscreen=i,n=!0):(i=E+"RequestFullScreen","function"==typeof t[i]&&(r.requestFullscreen=i,n=!0)),i=E+"ExitFullscreen","function"==typeof document[i]?r.exitFullscreen=i:(i=E+"CancelFullScreen","function"==typeof document[i]&&(r.exitFullscreen=i)),i=E+"FullscreenEnabled",void 0!==document[i]?r.fullscreenEnabled=i:(i=E+"FullScreenEnabled",void 0!==document[i]&&(r.fullscreenEnabled=i)),i=E+"FullscreenElement",void 0!==document[i]?r.fullscreenElement=i:(i=E+"FullScreenElement",void 0!==document[i]&&(r.fullscreenElement=i)),i=E+"fullscreenchange",void 0!==document["on"+i]&&("ms"===E&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=E+"fullscreenerror",void 0!==document["on"+i]&&("ms"===E&&(i="MSFullscreenError"),r.fullscreenerror=i)}return n},i.requestFullscreen=function(e,t){i.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},i.exitFullscreen=function(){i.supportsFullscreen()&&document[r.exitFullscreen]()},i}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function i(){if(!t(S)&&(S=!1,!l())){var e=/ Chrome\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(S=!0,M=r(e[1]))}return S}function a(){return i()&&M}function o(){if(!t(y)&&(y=!1,!i()&&!l()&&/ Safari\/[\.0-9]+/.test(I.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(y=!0,m=r(e[1]))}return y}function u(){return o()&&m}function E(){if(!t(O)){O=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(I.userAgent);null!==e&&(O=!0,p=r(e[1]),p.isNightly=!!e[2])}return O}function s(){return E()&&p}function c(){if(!t(C)){C=!1;var e;"Microsoft Internet Explorer"===I.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==e&&(C=!0,U=r(e[1]))):"Netscape"===I.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==e&&(C=!0,U=r(e[1])))}return C}function _(){return c()&&U}function l(){if(!t(L)){L=!1;var e=/ Edge\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(L=!0,g=r(e[1]))}return L}function T(){return l()&&g}function R(){if(!t(w)){w=!1;var e=/Firefox\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(w=!0,x=r(e[1]))}return w}function f(){return t(v)||(v=/Windows/i.test(I.appVersion)),v}function A(){return R()&&x}function h(){return t(F)||(F="undefined"!=typeof PointerEvent&&(!t(I.pointerEnabled)||I.pointerEnabled)),F}function d(){ -if(!t(B)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;B=t(n)&&""!==n,B&&(P=n)}return B}function N(){return d()?P:void 0}var I;I="undefined"!=typeof navigator?navigator:{};var S,M,y,m,O,p,C,U,L,g,w,x,v,F,P,B,D={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:E,webkitVersion:s,isInternetExplorer:c,internetExplorerVersion:_,isEdge:l,edgeVersion:T,isFirefox:R,firefoxVersion:A,isWindows:f,hardwareConcurrency:e(I.hardwareConcurrency,3),supportsPointerEvents:h,supportsImageRenderingPixelated:d,imageRenderingValue:N};return D.supportsFullscreen=function(){return n.supportsFullscreen()},D.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},D.supportsWebWorkers=function(){return"undefined"!=typeof Worker},D}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,i,a){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:a.BYTE,UNSIGNED_BYTE:a.UNSIGNED_BYTE,SHORT:a.SHORT,UNSIGNED_SHORT:a.UNSIGNED_SHORT,INT:a.INT,UNSIGNED_INT:a.UNSIGNED_INT,FLOAT:a.FLOAT,DOUBLE:a.DOUBLE};return o.getSizeInBytes=function(e){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.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},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 Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,i){switch(r=e(r,0),i=e(i,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,i);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,i);case o.SHORT:return new Int16Array(n,r,i);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,i);case o.INT:return new Int32Array(n,r,i);case o.UNSIGNED_INT:return new Uint32Array(n,r,i);case o.FLOAT:return new Float32Array(n,r,i);case o.DOUBLE:return new Float64Array(n,r,i)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},i(o)}),define("Core/Quaternion",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math","./Matrix3"],function(e,t,n,r,i,a,o,u){"use strict";function E(e,n,r,i){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(i,0)}var s=new e;E.fromAxisAngle=function(t,r,i){var a=r/2,o=Math.sin(a);s=e.normalize(t,s);var u=s.x*o,c=s.y*o,_=s.z*o,l=Math.cos(a);return n(i)?(i.x=u,i.y=c,i.z=_,i.w=l,i):new E(u,c,_,l)};var c=[1,2,0],_=new Array(3);E.fromRotationMatrix=function(e,t){var r,i,a,o,s,l=e[u.COLUMN0ROW0],T=e[u.COLUMN1ROW1],R=e[u.COLUMN2ROW2],f=l+T+R;if(f>0)r=Math.sqrt(f+1),s=.5*r,r=.5/r,i=(e[u.COLUMN1ROW2]-e[u.COLUMN2ROW1])*r,a=(e[u.COLUMN2ROW0]-e[u.COLUMN0ROW2])*r,o=(e[u.COLUMN0ROW1]-e[u.COLUMN1ROW0])*r;else{var A=c,h=0;T>l&&(h=1),R>l&&R>T&&(h=2);var d=A[h],N=A[d];r=Math.sqrt(e[u.getElementIndex(h,h)]-e[u.getElementIndex(d,d)]-e[u.getElementIndex(N,N)]+1);var I=_;I[h]=.5*r,r=.5/r,s=(e[u.getElementIndex(N,d)]-e[u.getElementIndex(d,N)])*r,I[d]=(e[u.getElementIndex(d,h)]+e[u.getElementIndex(h,d)])*r,I[N]=(e[u.getElementIndex(N,h)]+e[u.getElementIndex(h,N)])*r,i=-I[0],a=-I[1],o=-I[2]}return n(t)?(t.x=i,t.y=a,t.z=o,t.w=s,t):new E(i,a,o,s)};var l=new E;E.fromHeadingPitchRoll=function(t,n,r,i){var a=E.fromAxisAngle(e.UNIT_X,r,l),o=E.fromAxisAngle(e.UNIT_Y,-n,i);i=E.multiply(o,a,o);var u=E.fromAxisAngle(e.UNIT_Z,-t,l);return E.multiply(u,i,i)};var T=new e,R=new e,f=new E,A=new E,h=new E;E.packedLength=4,E.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},E.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new E),i.x=e[r],i.y=e[r+1],i.z=e[r+2],i.w=e[r+3],i},E.packedInterpolationLength=3,E.convertPackedArrayForInterpolation=function(e,t,n,r){E.unpack(e,4*n,h),E.conjugate(h,h);for(var i=0,a=n-t+1;i<a;i++){var o=3*i;E.unpack(e,4*(t+i),f),E.multiply(f,h,f),f.w<0&&E.negate(f,f),E.computeAxis(f,T);var u=E.computeAngle(f);r[o]=T.x*u,r[o+1]=T.y*u,r[o+2]=T.z*u}},E.unpackInterpolationResult=function(t,r,i,a,o){n(o)||(o=new E),e.fromArray(t,0,R);var u=e.magnitude(R);return E.unpack(r,4*a,A),0===u?E.clone(E.IDENTITY,f):E.fromAxisAngle(R,u,f),E.multiply(f,A,o)},E.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new E(e.x,e.y,e.z,e.w)},E.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},E.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},E.magnitude=function(e){return Math.sqrt(E.magnitudeSquared(e))},E.normalize=function(e,t){var n=1/E.magnitude(e),r=e.x*n,i=e.y*n,a=e.z*n,o=e.w*n;return t.x=r,t.y=i,t.z=a,t.w=o,t},E.inverse=function(e,t){var n=E.magnitudeSquared(e);return t=E.conjugate(e,t),E.multiplyByScalar(t,1/n,t)},E.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},E.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},E.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},E.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},E.multiply=function(e,t,n){var r=e.x,i=e.y,a=e.z,o=e.w,u=t.x,E=t.y,s=t.z,c=t.w,_=o*u+r*c+i*s-a*E,l=o*E-r*s+i*c+a*u,T=o*s+r*E-i*u+a*c,R=o*c-r*u-i*E-a*s;return n.x=_,n.y=l,n.z=T,n.w=R,n},E.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},E.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},E.computeAxis=function(e,t){var n=e.w;if(Math.abs(n-1)<o.EPSILON6)return t.x=t.y=t.z=0,t;var r=1/Math.sqrt(1-n*n);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},E.computeAngle=function(e){return Math.abs(e.w-1)<o.EPSILON6?0:2*Math.acos(e.w)};var d=new E;E.lerp=function(e,t,n,r){return d=E.multiplyByScalar(t,n,d),r=E.multiplyByScalar(e,1-n,r),E.add(d,r,r)};var N=new E,I=new E,S=new E;E.slerp=function(e,t,n,r){var i=E.dot(e,t),a=t;if(i<0&&(i=-i,a=N=E.negate(t,N)),1-i<o.EPSILON6)return E.lerp(e,a,n,r);var u=Math.acos(i);return I=E.multiplyByScalar(e,Math.sin((1-n)*u),I),S=E.multiplyByScalar(a,Math.sin(n*u),S),r=E.add(I,S,r),E.multiplyByScalar(r,1/Math.sin(u),r)},E.log=function(t,n){var r=o.acosClamped(t.w),i=0;return 0!==r&&(i=r/Math.sin(r)),e.multiplyByScalar(t,i,n)},E.exp=function(t,n){var r=e.magnitude(t),i=0;return 0!==r&&(i=Math.sin(r)/r),n.x=t.x*i,n.y=t.y*i,n.z=t.z*i,n.w=Math.cos(r),n};var M=new e,y=new e,m=new E,O=new E;E.computeInnerQuadrangle=function(t,n,r,i){var a=E.conjugate(n,m);E.multiply(a,r,O);var o=E.log(O,M);E.multiply(a,t,O);var u=E.log(O,y);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),E.exp(o,m),E.multiply(n,m,i)},E.squad=function(e,t,n,r,i,a){var o=E.slerp(e,t,i,m),u=E.slerp(n,r,i,O);return E.slerp(o,u,2*i*(1-i),a)};for(var p=new E,C=1.9011074535173003,U=i.supportsTypedArrays()?new Float32Array(8):[],L=i.supportsTypedArrays()?new Float32Array(8):[],g=i.supportsTypedArrays()?new Float32Array(8):[],w=i.supportsTypedArrays()?new Float32Array(8):[],x=0;x<7;++x){var v=x+1,F=2*v+1;U[x]=1/(v*F),L[x]=v/F}return U[7]=C/136,L[7]=8*C/17,E.fastSlerp=function(e,t,n,r){var i,a=E.dot(e,t);a>=0?i=1:(i=-1,a=-a);for(var o=a-1,u=1-n,s=n*n,c=u*u,_=7;_>=0;--_)g[_]=(U[_]*s-L[_])*o,w[_]=(U[_]*c-L[_])*o;var l=i*n*(1+g[0]*(1+g[1]*(1+g[2]*(1+g[3]*(1+g[4]*(1+g[5]*(1+g[6]*(1+g[7])))))))),T=u*(1+w[0]*(1+w[1]*(1+w[2]*(1+w[3]*(1+w[4]*(1+w[5]*(1+w[6]*(1+w[7])))))))),R=E.multiplyByScalar(e,T,p);return E.multiplyByScalar(t,l,r),E.add(R,r,r)},E.fastSquad=function(e,t,n,r,i,a){var o=E.fastSlerp(e,t,i,m),u=E.fastSlerp(n,r,i,O);return E.fastSlerp(o,u,2*i*(1-i),a)},E.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},E.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.x-t.x)<=r&&Math.abs(e.y-t.y)<=r&&Math.abs(e.z-t.z)<=r&&Math.abs(e.w-t.w)<=r},E.ZERO=a(new E(0,0,0,0)),E.IDENTITY=a(new E(0,0,0,1)),E.prototype.clone=function(e){return E.clone(this,e)},E.prototype.equals=function(e){return E.equals(this,e)},E.prototype.equalsEpsilon=function(e,t){return E.equalsEpsilon(this,e,t)},E.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},E}),define("Core/EllipseGeometryLibrary",["./Cartesian3","./Math","./Matrix3","./Quaternion"],function(e,t,n,r){"use strict";function i(t,i,a,c,_,l,T,R,f,A){var h=t+i;e.multiplyByScalar(c,Math.cos(h),o),e.multiplyByScalar(a,Math.sin(h),u),e.add(o,u,o);var d=Math.cos(t);d*=d;var N=Math.sin(t);N*=N;var I=l/Math.sqrt(T*d+_*N),S=I/R;return r.fromAxisAngle(o,S,E),n.fromQuaternion(E,s),n.multiplyByVector(s,f,A),e.normalize(A,A),e.multiplyByScalar(A,R,A),A}var a={},o=new e,u=new e,E=new r,s=new n,c=new e,_=new e,l=new e,T=new e;a.raisePositionsToHeight=function(t,n,r){for(var i=n.ellipsoid,a=n.height,o=n.extrudedHeight,u=r?t.length/3*2:t.length/3,E=new Float64Array(3*u),s=t.length,R=r?s:0,f=0;f<s;f+=3){var A=f+1,h=f+2,d=e.fromArray(t,f,c);i.scaleToGeodeticSurface(d,d);var N=e.clone(d,_),I=i.geodeticSurfaceNormal(d,T),S=e.multiplyByScalar(I,a,l);e.add(d,S,d),r&&(e.multiplyByScalar(I,o,S),e.add(N,S,N),E[f+R]=N.x,E[A+R]=N.y,E[h+R]=N.z),E[f]=d.x,E[A]=d.y,E[h]=d.z}return E};var R=new e,f=new e,A=new e;return a.computeEllipsePositions=function(n,r,a){var o=n.semiMinorAxis,u=n.semiMajorAxis,E=n.rotation,s=n.center,T=8*n.granularity,h=o*o,d=u*u,N=u*o,I=e.magnitude(s),S=e.normalize(s,R),M=e.cross(e.UNIT_Z,s,f);M=e.normalize(M,M);var y=e.cross(S,M,A),m=1+Math.ceil(t.PI_OVER_TWO/T),O=t.PI_OVER_TWO/(m-1),p=t.PI_OVER_TWO-m*O;p<0&&(m-=Math.ceil(Math.abs(p)/O));var C,U,L,g,w,x=2*(m*(m+2)),v=r?new Array(3*x):void 0,F=0,P=c,B=_,D=4*m*3,z=D-1,G=0,b=a?new Array(D):void 0;for(p=t.PI_OVER_TWO,P=i(p,E,y,M,h,N,d,I,S,P),r&&(v[F++]=P.x,v[F++]=P.y,v[F++]=P.z),a&&(b[z--]=P.z,b[z--]=P.y,b[z--]=P.x),p=t.PI_OVER_TWO-O,C=1;C<m+1;++C){if(P=i(p,E,y,M,h,N,d,I,S,P),B=i(Math.PI-p,E,y,M,h,N,d,I,S,B),r){for(v[F++]=P.x,v[F++]=P.y,v[F++]=P.z,L=2*C+2,U=1;U<L-1;++U)g=U/(L-1),w=e.lerp(P,B,g,l),v[F++]=w.x,v[F++]=w.y,v[F++]=w.z;v[F++]=B.x,v[F++]=B.y,v[F++]=B.z}a&&(b[z--]=P.z,b[z--]=P.y,b[z--]=P.x,b[G++]=B.x,b[G++]=B.y,b[G++]=B.z),p=t.PI_OVER_TWO-(C+1)*O}for(C=m;C>1;--C){if(p=t.PI_OVER_TWO-(C-1)*O,P=i(-p,E,y,M,h,N,d,I,S,P),B=i(p+Math.PI,E,y,M,h,N,d,I,S,B),r){for(v[F++]=P.x,v[F++]=P.y,v[F++]=P.z,L=2*(C-1)+2,U=1;U<L-1;++U)g=U/(L-1),w=e.lerp(P,B,g,l),v[F++]=w.x,v[F++]=w.y,v[F++]=w.z;v[F++]=B.x,v[F++]=B.y,v[F++]=B.z}a&&(b[z--]=P.z,b[z--]=P.y,b[z--]=P.x,b[G++]=B.x,b[G++]=B.y,b[G++]=B.z)}p=t.PI_OVER_TWO,P=i(-p,E,y,M,h,N,d,I,S,P);var V={};return r&&(v[F++]=P.x,v[F++]=P.y,v[F++]=P.z,V.positions=v,V.numPts=m),a&&(b[z--]=P.z,b[z--]=P.y,b[z--]=P.x,V.outerPositions=b),V},a}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===n.POINTS||e===n.LINES||e===n.LINE_LOOP||e===n.LINE_STRIP||e===n.TRIANGLES||e===n.TRIANGLE_STRIP||e===n.TRIANGLE_FAN}};return e(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,i){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,i.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return a.computeNumberOfVertices=function(e){var n=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var i=e.attributes[r],a=i.values.length/i.componentsPerAttribute;n=a}return n},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(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 r}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.binormal=t.binormal,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,n,r,i){"use strict";var a={UNSIGNED_BYTE:i.UNSIGNED_BYTE,UNSIGNED_SHORT:i.UNSIGNED_SHORT,UNSIGNED_INT:i.UNSIGNED_INT};return a.getSizeInBytes=function(e){switch(e){case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},a.validate=function(t){return e(t)&&(t===a.UNSIGNED_BYTE||t===a.UNSIGNED_SHORT||t===a.UNSIGNED_INT)},a.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},a.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)},n(a)}),define("Core/EllipseOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EllipseGeometryLibrary","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType"],function(e,t,n,r,i,a,o,u,E,s,c,_,l,T){"use strict";function R(r){var i=r.center;d=t.multiplyByScalar(r.ellipsoid.geodeticSurfaceNormal(i,d),r.height,d),d=t.add(i,d,d);for(var a=new e(d,r.semiMajorAxis),u=o.computeEllipsePositions(r,!1,!0).outerPositions,E=new c({position:new s({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:o.raisePositionsToHeight(u,r,!1)})}),l=u.length/3,T=_.createTypedArray(l,2*l),R=0,f=0;f<l;++f)T[R++]=f,T[R++]=(f+1)%l;return{boundingSphere:a,attributes:E,indices:T}}function f(i){var a=i.center,u=i.ellipsoid,E=i.semiMajorAxis,T=t.multiplyByScalar(u.geodeticSurfaceNormal(a,h),i.height,h);N.center=t.add(a,T,N.center),N.radius=E,T=t.multiplyByScalar(u.geodeticSurfaceNormal(a,T),i.extrudedHeight,T),I.center=t.add(a,T,I.center),I.radius=E;var R=o.computeEllipsePositions(i,!1,!0).outerPositions,f=new c({position:new s({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:o.raisePositionsToHeight(R,i,!0)})});R=f.position.values;var A=e.union(N,I),d=R.length/3,S=r(i.numberOfVerticalLines,16);S=l.clamp(S,0,d/2);var M=_.createTypedArray(d,2*d+2*S);d/=2;var y,m=0;for(y=0;y<d;++y)M[m++]=y,M[m++]=(y+1)%d,M[m++]=y+d,M[m++]=(y+1)%d+d;var O;if(S>0){var p=Math.min(S,d);O=Math.round(d/p);var C=Math.min(O*S,d);for(y=0;y<C;y+=O)M[m++]=y,M[m++]=y+d}return{boundingSphere:A,attributes:f,indices:M}}function A(e){e=r(e,r.EMPTY_OBJECT);var n=e.center,a=r(e.ellipsoid,u.WGS84),o=e.semiMajorAxis,E=e.semiMinorAxis,s=r(e.granularity,l.RADIANS_PER_DEGREE),c=r(e.height,0),_=e.extrudedHeight,T=i(_)&&Math.abs(c-_)>1;this._center=t.clone(n),this._semiMajorAxis=o,this._semiMinorAxis=E,this._ellipsoid=u.clone(a),this._rotation=r(e.rotation,0),this._height=c,this._granularity=s,this._extrudedHeight=_,this._extrude=T,this._numberOfVerticalLines=Math.max(r(e.numberOfVerticalLines,16),0),this._workerName="createEllipseOutlineGeometry"}var h=new t,d=new t,N=new e,I=new e;A.packedLength=t.packedLength+u.packedLength+9,A.pack=function(e,n,a){return a=r(a,0),t.pack(e._center,n,a),a+=t.packedLength,u.pack(e._ellipsoid,n,a),a+=u.packedLength,n[a++]=e._semiMajorAxis,n[a++]=e._semiMinorAxis,n[a++]=e._rotation,n[a++]=e._height,n[a++]=e._granularity,n[a++]=i(e._extrudedHeight)?1:0,n[a++]=r(e._extrudedHeight,0),n[a++]=e._extrude?1:0,n[a]=e._numberOfVerticalLines,n};var S=new t,M=new u,y={center:S,ellipsoid:M,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0};return A.unpack=function(e,n,a){n=r(n,0);var o=t.unpack(e,n,S);n+=t.packedLength;var E=u.unpack(e,n,M);n+=u.packedLength;var s=e[n++],c=e[n++],_=e[n++],l=e[n++],T=e[n++],R=e[n++],f=e[n++],h=1===e[n++],d=e[n];return i(a)?(a._center=t.clone(o,a._center),a._ellipsoid=u.clone(E,a._ellipsoid),a._semiMajorAxis=s,a._semiMinorAxis=c,a._rotation=_,a._height=l,a._granularity=T,a._extrudedHeight=R?f:void 0,a._extrude=h,a._numberOfVerticalLines=d,a):(y.height=l,y.extrudedHeight=R?f:void 0,y.granularity=T,y.rotation=_,y.semiMajorAxis=s,y.semiMinorAxis=c,y.numberOfVerticalLines=d,new A(y))},A.createGeometry=function(e){if(!(e._semiMajorAxis<=0||e._semiMinorAxis<=0)){e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);var t,n={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:e._height,extrudedHeight:e._extrudedHeight,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines};return e._extrude?(n.extrudedHeight=Math.min(e._extrudedHeight,e._height),n.height=Math.max(e._extrudedHeight,e._height),t=f(n)):t=R(n),new E({attributes:t.attributes,indices:t.indices,primitiveType:T.LINES,boundingSphere:t.boundingSphere})}},A}),define("Workers/createEllipseOutlineGeometry",["../Core/Cartesian3","../Core/defined","../Core/EllipseOutlineGeometry","../Core/Ellipsoid"],function(e,t,n,r){"use strict";function i(i,a){return t(a)&&(i=n.unpack(i,a)),i._center=e.clone(i._center),i._ellipsoid=r.clone(i._ellipsoid),n.createGeometry(i)}return i})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e){return e+" is required, actual value was undefined"}function r(e,t,n){return"Expected "+n+" to be typeof "+t+", actual typeof was "+e}var i={};return i.typeOf={},i.defined=function(r,i){if(!e(i))throw new t(n(r))},i.typeOf.func=function(e,n){if("function"!=typeof n)throw new t(r(typeof n,"function",e))},i.typeOf.string=function(e,n){if("string"!=typeof n)throw new t(r(typeof n,"string",e))},i.typeOf.number=function(e,n){if("number"!=typeof n)throw new t(r(typeof n,"number",e))},i.typeOf.number.lessThan=function(e,n,r){if(i.typeOf.number(e,n),n>=r)throw new t("Expected "+e+" to be less than "+r+", actual value was "+n)},i.typeOf.number.lessThanOrEquals=function(e,n,r){if(i.typeOf.number(e,n),n>r)throw new t("Expected "+e+" to be less than or equal to "+r+", actual value was "+n)},i.typeOf.number.greaterThan=function(e,n,r){if(i.typeOf.number(e,n),n<=r)throw new t("Expected "+e+" to be greater than "+r+", actual value was "+n)},i.typeOf.number.greaterThanOrEquals=function(e,n,r){if(i.typeOf.number(e,n),n<r)throw new t("Expected "+e+" to be greater than or equal to"+r+", actual value was "+n)},i.typeOf.object=function(e,n){if("object"!=typeof n)throw new t(r(typeof n,"object",e))},i.typeOf.bool=function(e,n){if("boolean"!=typeof n)throw new t(r(typeof n,"boolean",e))},i}),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";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),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 n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(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^=e<<7&2636928640,e^=e<<15&4022730752,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,n,r){"use strict";var i={};i.EPSILON1=.1,i.EPSILON2=.01,i.EPSILON3=.001,i.EPSILON4=1e-4,i.EPSILON5=1e-5,i.EPSILON6=1e-6,i.EPSILON7=1e-7,i.EPSILON8=1e-8,i.EPSILON9=1e-9,i.EPSILON10=1e-10,i.EPSILON11=1e-11,i.EPSILON12=1e-12,i.EPSILON13=1e-13,i.EPSILON14=1e-14,i.EPSILON15=1e-15,i.EPSILON16=1e-16,i.EPSILON17=1e-17,i.EPSILON18=1e-18,i.EPSILON19=1e-19,i.EPSILON20=1e-20,i.GRAVITATIONALPARAMETER=3986004418e5,i.SOLAR_RADIUS=6955e5,i.LUNAR_RADIUS=1737400,i.SIXTY_FOUR_KILOBYTES=65536,i.sign=function(e){return e>0?1:e<0?-1:0},i.signNotZero=function(e){return e<0?-1:1},i.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*i.clamp(e,-1,1)+.5)*n)},i.fromSNorm=function(e,n){return n=t(n,255),i.clamp(e,0,n)/n*2-1},i.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},i.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},i.lerp=function(e,t,n){return(1-n)*e+n*t},i.PI=Math.PI,i.ONE_OVER_PI=1/Math.PI,i.PI_OVER_TWO=.5*Math.PI,i.PI_OVER_THREE=Math.PI/3,i.PI_OVER_FOUR=Math.PI/4,i.PI_OVER_SIX=Math.PI/6,i.THREE_PI_OVER_TWO=3*Math.PI*.5,i.TWO_PI=2*Math.PI,i.ONE_OVER_TWO_PI=1/(2*Math.PI),i.RADIANS_PER_DEGREE=Math.PI/180,i.DEGREES_PER_RADIAN=180/Math.PI,i.RADIANS_PER_ARCSECOND=i.RADIANS_PER_DEGREE/3600,i.toRadians=function(e){return e*i.RADIANS_PER_DEGREE},i.toDegrees=function(e){return e*i.DEGREES_PER_RADIAN},i.convertLongitudeRange=function(e){var t=i.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},i.clampToLatitudeRange=function(e){return i.clamp(e,-1*i.PI_OVER_TWO,i.PI_OVER_TWO)},i.negativePiToPi=function(e){return i.zeroToTwoPi(e+i.PI)-i.PI},i.zeroToTwoPi=function(e){var t=i.mod(e,i.TWO_PI);return Math.abs(t)<i.EPSILON14&&Math.abs(e)>i.EPSILON14?i.TWO_PI:t},i.mod=function(e,t){return(e%t+t)%t},i.equalsEpsilon=function(e,n,r,i){i=t(i,r);var a=Math.abs(e-n);return a<=i||a<=r*Math.max(Math.abs(e),Math.abs(n))};var a=[1];i.factorial=function(e){var t=a.length;if(e>=t)for(var n=a[t-1],r=t;r<=e;r++)a.push(n*r);return a[e]},i.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},i.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},i.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},i.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return i.setRandomNumberSeed=function(t){o=new e(t)},i.nextRandomNumber=function(){return o.random()},i.acosClamped=function(e){return Math.acos(i.clamp(e,-1,1))},i.asinClamped=function(e){return Math.asin(i.clamp(e,-1,1))},i.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},i.logBase=function(e,t){return Math.log(e)/Math.log(t)},i.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},i}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var i=e.clock,a=e.cone,u=t(e.magnitude,1),s=u*Math.sin(a);return r.x=s*Math.cos(i),r.y=s*Math.sin(i),r.z=u*Math.cos(a),r},o.fromElements=function(e,t,r,i){return n(i)?(i.x=e,i.y=t,i.z=r,i):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new o),i.x=e[r++],i.y=e[r++],i.z=e[r],i},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var i=0;i<r;++i)o.pack(e[i],t,3*i);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var i=0;i<r;i+=3){var a=i/3;t[a]=o.unpack(e,i,t[a])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,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};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var E=new o,c=new o;o.angleBetween=function(e,t){o.normalize(e,E),o.normalize(t,c);var n=o.dot(E,c),r=o.magnitude(o.cross(E,c,E));return Math.atan2(r,n)};var _=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,_);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,i){return e===t||n(e)&&n(t)&&a.equalsEpsilon(e.x,t.x,r,i)&&a.equalsEpsilon(e.y,t.y,r,i)&&a.equalsEpsilon(e.z,t.z,r,i)},o.cross=function(e,t,n){var r=e.x,i=e.y,a=e.z,o=t.x,u=t.y,s=t.z,E=i*s-a*u,c=a*o-r*s,_=r*u-i*o;return n.x=E,n.y=c,n.z=_,n},o.fromDegrees=function(e,t,n,r,i){return e=a.toRadians(e),t=a.toRadians(t),o.fromRadians(e,t,n,r,i)};var l=new o,T=new o,R=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,i,a,u){i=t(i,0);var s=n(a)?a.radiiSquared:R,E=Math.cos(r);l.x=E*Math.cos(e),l.y=E*Math.sin(e),l.z=Math.sin(r),l=o.normalize(l,l),o.multiplyComponents(s,l,T);var c=Math.sqrt(o.dot(l,T));return T=o.divideByScalar(T,c,T),l=o.multiplyByScalar(l,i,l),n(u)||(u=new o),o.add(T,l,u)},o.fromDegreesArray=function(e,t,r){var i=e.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],s=e[a+1],E=a/2;r[E]=o.fromDegrees(u,s,0,t,r[E])}return r},o.fromRadiansArray=function(e,t,r){var i=e.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],s=e[a+1],E=a/2;r[E]=o.fromRadians(u,s,0,t,r[E])}return r},o.fromDegreesArrayHeights=function(e,t,r){var i=e.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],s=e[a+1],E=e[a+2],c=a/3;r[c]=o.fromDegrees(u,s,E,t,r[c])}return r},o.fromRadiansArrayHeights=function(e,t,r){var i=e.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],s=e[a+1],E=e[a+2],c=a/3;r[c]=o.fromRadians(u,s,E,t,r[c])}return r},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,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function i(n,i,u,s,E){var c=n.x,_=n.y,l=n.z,T=i.x,R=i.y,f=i.z,A=c*c*T*T,h=_*_*R*R,d=l*l*f*f,N=A+h+d,I=Math.sqrt(1/N),S=e.multiplyByScalar(n,I,a);if(N<s)return isFinite(I)?e.clone(S,E):void 0;var M=u.x,y=u.y,m=u.z,O=o;O.x=S.x*M*2,O.y=S.y*y*2,O.z=S.z*m*2;var p,C,U,L,w,g,x,v,F,P,B,D=(1-I)*e.magnitude(n)/(.5*e.magnitude(O)),z=0;do{D-=z,U=1/(1+D*M),L=1/(1+D*y),w=1/(1+D*m),g=U*U,x=L*L,v=w*w,F=g*U,P=x*L,B=v*w,p=A*g+h*x+d*v-1,C=A*F*M+h*P*y+d*B*m;var G=-2*C;z=p/G}while(Math.abs(p)>r.EPSILON12);return t(E)?(E.x=c*U,E.y=_*L,E.z=l*w,E):new e(c*U,_*L,l*w)}var a=new e,o=new e;return i}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,i,a,o){"use strict";function u(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)}u.fromRadians=function(e,r,i,a){return i=t(i,0),n(a)?(a.longitude=e,a.latitude=r,a.height=i,a):new u(e,r,i)},u.fromDegrees=function(e,t,n,r){return e=a.toRadians(e),t=a.toRadians(t),u.fromRadians(e,t,n,r)};var s=new e,E=new e,c=new e,_=new e(1/6378137,1/6378137,1/6356752.314245179),l=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),T=a.EPSILON1;return u.fromCartesian=function(t,r,i){var R=n(r)?r.oneOverRadii:_,f=n(r)?r.oneOverRadiiSquared:l,A=n(r)?r._centerToleranceSquared:T,h=o(t,R,f,A,E);if(n(h)){var d=e.multiplyComponents(h,f,s);d=e.normalize(d,d);var N=e.subtract(t,h,c),I=Math.atan2(d.y,d.x),S=Math.asin(d.z),M=a.sign(e.dot(N,t))*e.magnitude(N);return n(i)?(i.longitude=I,i.latitude=S,i.height=M,i):new u(I,S,M)}},u.clone=function(e,t){if(n(e))return n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},u.ZERO=i(new u(0,0,0)),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,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,i,a,o,u,s){"use strict";function E(t,r,i,a){r=n(r,0),i=n(i,0),a=n(a,0),t._radii=new e(r,i,a),t._radiiSquared=new e(r*r,i*i,a*a),t._radiiToTheFourth=new e(r*r*r*r,i*i*i*i,a*a*a*a),t._oneOverRadii=new e(0===r?0:1/r,0===i?0:1/i,0===a?0:1/a),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===i?0:1/(i*i),0===a?0:1/(a*a)),t._minimumRadius=Math.min(r,i,a),t._maximumRadius=Math.max(r,i,a),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function c(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,E(this,e,t,n)}i(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,n){if(r(t)){var i=t._radii;return r(n)?(e.clone(i,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new c(i.x,i.y,i.z)}},c.fromCartesian3=function(e,t){return r(t)||(t=new c),r(e)?(E(t,e.x,e.y,e.z),t):t},c.WGS84=o(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=o(new c(1,1,1)),c.MOON=o(new c(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),c.prototype.clone=function(e){return c.clone(this,e)},c.packedLength=e.packedLength,c.pack=function(t,r,i){return i=n(i,0),e.pack(t._radii,r,i),r},c.unpack=function(t,r,i){r=n(r,0);var a=e.unpack(t,r);return c.fromCartesian3(a,i)},c.prototype.geocentricSurfaceNormal=e.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(t,n){var i=t.longitude,a=t.latitude,o=Math.cos(a),u=o*Math.cos(i),s=o*Math.sin(i),E=Math.sin(a);return r(n)||(n=new e),n.x=u,n.y=s,n.z=E,e.normalize(n,n)},c.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var _=new e,l=new e;c.prototype.cartographicToCartesian=function(t,n){var i=_,a=l;this.geodeticSurfaceNormalCartographic(t,i),e.multiplyComponents(this._radiiSquared,i,a);var o=Math.sqrt(e.dot(i,a));return e.divideByScalar(a,o,a),e.multiplyByScalar(i,t.height,i),r(n)||(n=new e),e.add(a,i,n)},c.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;i<n;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var T=new e,R=new e,f=new e;return c.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,R);if(r(a)){var o=this.geodeticSurfaceNormal(a,T),s=e.subtract(n,a,f),E=Math.atan2(o.y,o.x),c=Math.asin(o.z),_=u.sign(e.dot(s,n))*e.magnitude(s);return r(i)?(i.longitude=E,i.latitude=c,i.height=_,i):new t(E,c,_)}},c.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;i<n;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t},c.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},c.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var i=t.x,a=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*u.z);return e.multiplyByScalar(t,s,n)},c.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},c.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},c.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},c.prototype.toString=function(){return this._radii.toString()},c.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,i,a){i=n(i,0);var o=this._sqauredXOverSquaredZ;if(r(a)||(a=new e),a.x=0,a.y=0,a.z=t.z*(1-o),!(Math.abs(a.z)>=this._radii.z-i))return a},c}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,i,a,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return i(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var i=this._semimajorAxis,a=t.longitude*i,o=t.latitude*i,u=t.height;return r(n)?(n.x=a,n.y=o,n.z=u,n):new e(a,o,u)},u.prototype.unproject=function(e,n){var i=this._oneOverSemimajorAxis,a=e.x*i,o=e.y*i,u=e.z;return r(n)?(n.longitude=a,n.latitude=o,n.height=u,n):new t(a,o,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";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a,o,u){"use strict";function s(e,t,r,i,a,o,u,s,E){this[0]=n(e,0),this[1]=n(i,0),this[2]=n(u,0),this[3]=n(t,0),this[4]=n(a,0),this[5]=n(s,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(E,0)}function E(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function c(e){for(var t=0,n=0;n<3;++n){var r=e[s.getElementIndex(f[n],R[n])];t+=2*r*r}return Math.sqrt(t)}function _(e,t){for(var n=u.EPSILON15,r=0,i=1,a=0;a<3;++a){var o=Math.abs(e[s.getElementIndex(f[a],R[a])]);o>r&&(i=a,r=o)}var E=1,c=0,_=R[i],l=f[i];if(Math.abs(e[s.getElementIndex(l,_)])>n){var T,A=e[s.getElementIndex(l,l)],h=e[s.getElementIndex(_,_)],d=e[s.getElementIndex(l,_)],N=(A-h)/2/d;T=N<0?-1/(-N+Math.sqrt(1+N*N)):1/(N+Math.sqrt(1+N*N)),E=1/Math.sqrt(1+T*T),c=T*E}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(_,_)]=t[s.getElementIndex(l,l)]=E,t[s.getElementIndex(l,_)]=c,t[s.getElementIndex(_,l)]=-c,t}s.packedLength=9,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t},s.unpack=function(e,t,i){return t=n(t,0),r(i)||(i=new s),i[0]=e[t++],i[1]=e[t++],i[2]=e[t++],i[3]=e[t++],i[4]=e[t++],i[5]=e[t++],i[6]=e[t++],i[7]=e[t++],i[8]=e[t++],i},s.clone=function(e,t){if(r(e))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):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,i){return t=n(t,0),r(i)||(i=new s),i[0]=e[t],i[1]=e[t+1],i[2]=e[t+2],i[3]=e[t+3],i[4]=e[t+4],i[5]=e[t+5],i[6]=e[t+6],i[7]=e[t+7],i[8]=e[t+8],i},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[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 s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var n=e.x*e.x,i=e.x*e.y,a=e.x*e.z,o=e.x*e.w,u=e.y*e.y,E=e.y*e.z,c=e.y*e.w,_=e.z*e.z,l=e.z*e.w,T=e.w*e.w,R=n-u-_+T,f=2*(i-l),A=2*(a+c),h=2*(i+l),d=-n+u-_+T,N=2*(E-o),I=2*(a-c),S=2*(E+o),M=-n-u+_+T;return r(t)?(t[0]=R,t[1]=h,t[2]=I,t[3]=f,t[4]=d,t[5]=S,t[6]=A,t[7]=N,t[8]=M,t):new s(R,f,A,h,d,N,I,S,M)},s.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),i=Math.cos(-e.heading),a=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),E=Math.sin(e.roll),c=n*i,_=-a*u+E*o*i,l=E*u+a*o*i,T=n*u,R=a*i+E*o*u,f=-o*a+a*o*u,A=-o,h=E*n,d=a*n;return r(t)?(t[0]=c,t[1]=T,t[2]=A,t[3]=_,t[4]=R,t[5]=h,t[6]=l,t[7]=f,t[8]=d,t):new s(c,_,l,T,R,f,A,h,d)},s.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 s(e.x,0,0,0,e.y,0,0,0,e.z)},s.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 s(e,0,0,0,e,0,0,0,e)},s.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 s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=i,t[6]=0,t[7]=-i,t[8]=n,t):new s(1,0,0,0,n,-i,0,i,n)},s.fromRotationY=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-i,t[3]=0,t[4]=1,t[5]=0,t[6]=i,t[7]=0,t[8]=n,t):new s(n,0,i,0,1,0,-i,0,n)},s.fromRotationZ=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=n,t[1]=i,t[2]=0,t[3]=-i,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(n,-i,0,i,n,0,0,0,1)},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):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,n){var r=3*t,i=e[r],a=e[r+1],o=e[r+2];return n.x=i,n.y=a,n.z=o,n},s.setColumn=function(e,t,n,r){r=s.clone(e,r);var i=3*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},s.getRow=function(e,t,n){var r=e[t],i=e[t+3],a=e[t+6];return n.x=r,n.y=i,n.z=a,n},s.setRow=function(e,t,n,r){return r=s.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var l=new e;s.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],l)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],l)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],l)),n};var T=new e;s.getMaximumScale=function(t){return s.getScale(t,T),e.maximumComponent(T)},s.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],i=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],o=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],E=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],c=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],_=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=r,n[1]=i,n[2]=a,n[3]=o,n[4]=u,n[5]=s,n[6]=E,n[7]=c,n[8]=_,n},s.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},s.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},s.multiplyByVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[3]*i+e[6]*a,u=e[1]*r+e[4]*i+e[7]*a,s=e[2]*r+e[5]*i+e[8]*a;return n.x=o,n.y=u,n.z=s,n},s.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},s.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},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},s.transpose=function(e,t){var n=e[0],r=e[3],i=e[6],a=e[1],o=e[4],u=e[7],s=e[2],E=e[5],c=e[8];return t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=u,t[6]=s,t[7]=E,t[8]=c,t};var R=[1,0,0],f=[2,2,1],A=new s,h=new s;return s.computeEigenDecomposition=function(e,t){var n=u.EPSILON20,i=10,a=0,o=0;r(t)||(t={});for(var l=t.unitary=s.clone(s.IDENTITY,t.unitary),T=t.diagonal=s.clone(e,t.diagonal),R=n*E(T);o<i&&c(T)>R;)_(T,A),s.transpose(A,h),s.multiply(T,A,T),s.multiply(h,T,T),s.multiply(l,A,l),++a>2&&(++o,a=0);return 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},s.determinant=function(e){var t=e[0],n=e[3],r=e[6],i=e[1],a=e[4],o=e[7],u=e[2],s=e[5],E=e[8];return t*(a*E-s*o)+i*(s*r-n*E)+u*(n*o-a*r)},s.inverse=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],u=e[5],E=e[6],c=e[7],_=e[8],l=s.determinant(e);t[0]=o*_-c*u,t[1]=c*i-r*_,t[2]=r*u-o*i,t[3]=E*u-a*_,t[4]=n*_-E*i,t[5]=a*i-n*u,t[6]=a*c-E*o,t[7]=E*r-n*c,t[8]=n*o-a*r;var T=1/l;return s.multiplyByScalar(t,T,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]},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},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,i(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(e,n,r,i){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(i,0)}o.fromElements=function(e,t,r,i,a){return n(a)?(a.x=e,a.y=t,a.z=r,a.w=i,a):new o(e,t,r,i)},o.fromColor=function(e,t){return n(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(n(e))return n(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)},o.packedLength=4,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},o.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new o),i.x=e[r++],i.y=e[r++],i.z=e[r++],i.w=e[r],i},o.packArray=function(e,t){var r=e.length;n(t)?t.length=4*r:t=new Array(4*r);for(var i=0;i<r;++i)o.pack(e[i],t,4*i);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/4:t=new Array(r/4);for(var i=0;i<r;i+=4){var a=i/4;t[a]=o.unpack(e,i,t[a])}return t},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,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},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 u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,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,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},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 s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var E=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,E);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},o.equalsEpsilon=function(e,t,r,i){return e===t||n(e)&&n(t)&&a.equalsEpsilon(e.x,t.x,r,i)&&a.equalsEpsilon(e.y,t.y,r,i)&&a.equalsEpsilon(e.z,t.z,r,i)&&a.equalsEpsilon(e.w,t.w,r,i)},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,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,i,a,o,u,s,E,c){ +"use strict";function _(e,t,n,i,a,o,u,s,E,c,_,l,T,R,f,A){this[0]=r(e,0),this[1]=r(a,0),this[2]=r(E,0),this[3]=r(T,0),this[4]=r(t,0),this[5]=r(o,0),this[6]=r(c,0),this[7]=r(R,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(_,0),this[11]=r(f,0),this[12]=r(i,0),this[13]=r(s,0),this[14]=r(l,0),this[15]=r(A,0)}_.packedLength=16,_.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},_.unpack=function(e,t,n){return t=r(t,0),i(n)||(n=new _),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},_.clone=function(e,t){if(i(e))return i(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 _(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])},_.fromArray=_.unpack,_.fromColumnMajorArray=function(e,t){return _.clone(e,t)},_.fromRowMajorArray=function(e,t){return i(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 _(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])},_.fromRotationTranslation=function(t,n,a){return n=r(n,e.ZERO),i(a)?(a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=0,a[4]=t[3],a[5]=t[4],a[6]=t[5],a[7]=0,a[8]=t[6],a[9]=t[7],a[10]=t[8],a[11]=0,a[12]=n.x,a[13]=n.y,a[14]=n.z,a[15]=1,a):new _(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},_.fromTranslationQuaternionRotationScale=function(e,t,n,r){i(r)||(r=new _);var a=n.x,o=n.y,u=n.z,s=t.x*t.x,E=t.x*t.y,c=t.x*t.z,l=t.x*t.w,T=t.y*t.y,R=t.y*t.z,f=t.y*t.w,A=t.z*t.z,h=t.z*t.w,d=t.w*t.w,N=s-T-A+d,I=2*(E-h),S=2*(c+f),M=2*(E+h),y=-s+T-A+d,m=2*(R-l),O=2*(c-f),p=2*(R+l),C=-s-T+A+d;return r[0]=N*a,r[1]=M*a,r[2]=O*a,r[3]=0,r[4]=I*o,r[5]=y*o,r[6]=p*o,r[7]=0,r[8]=S*u,r[9]=m*u,r[10]=C*u,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},_.fromTranslationRotationScale=function(e,t){return _.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},_.fromTranslation=function(e,t){return _.fromRotationTranslation(E.IDENTITY,e,t)},_.fromScale=function(e,t){return i(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 _(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},_.fromUniformScale=function(e,t){return i(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 _(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var l=new e,T=new e,R=new e;_.fromCamera=function(t,n){var r=t.position,a=t.direction,o=t.up;e.normalize(a,l),e.normalize(e.cross(l,o,T),T),e.normalize(e.cross(T,l,R),R);var u=T.x,s=T.y,E=T.z,c=l.x,f=l.y,A=l.z,h=R.x,d=R.y,N=R.z,I=r.x,S=r.y,M=r.z,y=u*-I+s*-S+E*-M,m=h*-I+d*-S+N*-M,O=c*I+f*S+A*M;return i(n)?(n[0]=u,n[1]=h,n[2]=-c,n[3]=0,n[4]=s,n[5]=d,n[6]=-f,n[7]=0,n[8]=E,n[9]=N,n[10]=-A,n[11]=0,n[12]=y,n[13]=m,n[14]=O,n[15]=1,n):new _(u,s,E,y,h,d,N,m,-c,-f,-A,O,0,0,0,1)},_.computePerspectiveFieldOfView=function(e,t,n,r,i){var a=Math.tan(.5*e),o=1/a,u=o/t,s=(r+n)/(n-r),E=2*r*n/(n-r);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=o,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=s,i[11]=-1,i[12]=0,i[13]=0,i[14]=E,i[15]=0,i},_.computeOrthographicOffCenter=function(e,t,n,r,i,a,o){var u=1/(t-e),s=1/(r-n),E=1/(a-i),c=-(t+e)*u,_=-(r+n)*s,l=-(a+i)*E;return u*=2,s*=2,E*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=E,o[11]=0,o[12]=c,o[13]=_,o[14]=l,o[15]=1,o},_.computePerspectiveOffCenter=function(e,t,n,r,i,a,o){var u=2*i/(t-e),s=2*i/(r-n),E=(t+e)/(t-e),c=(r+n)/(r-n),_=-(a+i)/(a-i),l=-1,T=-2*a*i/(a-i);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=E,o[9]=c,o[10]=_,o[11]=l,o[12]=0,o[13]=0,o[14]=T,o[15]=0,o},_.computeInfinitePerspectiveOffCenter=function(e,t,n,r,i,a){var o=2*i/(t-e),u=2*i/(r-n),s=(t+e)/(t-e),E=(r+n)/(r-n),c=-1,_=-1,l=-2*i;return a[0]=o,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]=E,a[10]=c,a[11]=_,a[12]=0,a[13]=0,a[14]=l,a[15]=0,a},_.computeViewportTransformation=function(e,t,n,i){e=r(e,r.EMPTY_OBJECT);var a=r(e.x,0),o=r(e.y,0),u=r(e.width,0),s=r(e.height,0);t=r(t,0),n=r(n,1);var E=.5*u,c=.5*s,_=.5*(n-t),l=E,T=c,R=_,f=a+E,A=o+c,h=t+_,d=1;return i[0]=l,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=T,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=R,i[11]=0,i[12]=f,i[13]=A,i[14]=h,i[15]=d,i},_.computeView=function(t,n,r,i,a){return a[0]=i.x,a[1]=r.x,a[2]=-n.x,a[3]=0,a[4]=i.y,a[5]=r.y,a[6]=-n.y,a[7]=0,a[8]=i.z,a[9]=r.z,a[10]=-n.z,a[11]=0,a[12]=-e.dot(i,t),a[13]=-e.dot(r,t),a[14]=e.dot(n,t),a[15]=1,a},_.toArray=function(e,t){return i(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]]},_.getElementIndex=function(e,t){return 4*e+t},_.getColumn=function(e,t,n){var r=4*t,i=e[r],a=e[r+1],o=e[r+2],u=e[r+3];return n.x=i,n.y=a,n.z=o,n.w=u,n},_.setColumn=function(e,t,n,r){r=_.clone(e,r);var i=4*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r[i+3]=n.w,r},_.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},_.getRow=function(e,t,n){var r=e[t],i=e[t+4],a=e[t+8],o=e[t+12];return n.x=r,n.y=i,n.z=a,n.w=o,n},_.setRow=function(e,t,n,r){return r=_.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var f=new e;_.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],f)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],f)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],f)),n};var A=new e;_.getMaximumScale=function(t){return _.getScale(t,A),e.maximumComponent(A)},_.multiply=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[3],u=e[4],s=e[5],E=e[6],c=e[7],_=e[8],l=e[9],T=e[10],R=e[11],f=e[12],A=e[13],h=e[14],d=e[15],N=t[0],I=t[1],S=t[2],M=t[3],y=t[4],m=t[5],O=t[6],p=t[7],C=t[8],U=t[9],L=t[10],w=t[11],g=t[12],x=t[13],v=t[14],F=t[15],P=r*N+u*I+_*S+f*M,B=i*N+s*I+l*S+A*M,D=a*N+E*I+T*S+h*M,z=o*N+c*I+R*S+d*M,G=r*y+u*m+_*O+f*p,b=i*y+s*m+l*O+A*p,X=a*y+E*m+T*O+h*p,V=o*y+c*m+R*O+d*p,H=r*C+u*U+_*L+f*w,q=i*C+s*U+l*L+A*w,W=a*C+E*U+T*L+h*w,Y=o*C+c*U+R*L+d*w,k=r*g+u*x+_*v+f*F,K=i*g+s*x+l*v+A*F,Z=a*g+E*x+T*v+h*F,j=o*g+c*x+R*v+d*F;return n[0]=P,n[1]=B,n[2]=D,n[3]=z,n[4]=G,n[5]=b,n[6]=X,n[7]=V,n[8]=H,n[9]=q,n[10]=W,n[11]=Y,n[12]=k,n[13]=K,n[14]=Z,n[15]=j,n},_.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},_.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},_.multiplyTransformation=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[4],u=e[5],s=e[6],E=e[8],c=e[9],_=e[10],l=e[12],T=e[13],R=e[14],f=t[0],A=t[1],h=t[2],d=t[4],N=t[5],I=t[6],S=t[8],M=t[9],y=t[10],m=t[12],O=t[13],p=t[14],C=r*f+o*A+E*h,U=i*f+u*A+c*h,L=a*f+s*A+_*h,w=r*d+o*N+E*I,g=i*d+u*N+c*I,x=a*d+s*N+_*I,v=r*S+o*M+E*y,F=i*S+u*M+c*y,P=a*S+s*M+_*y,B=r*m+o*O+E*p+l,D=i*m+u*O+c*p+T,z=a*m+s*O+_*p+R;return n[0]=C,n[1]=U,n[2]=L,n[3]=0,n[4]=w,n[5]=g,n[6]=x,n[7]=0,n[8]=v,n[9]=F,n[10]=P,n[11]=0,n[12]=B,n[13]=D,n[14]=z,n[15]=1,n},_.multiplyByMatrix3=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[4],u=e[5],s=e[6],E=e[8],c=e[9],_=e[10],l=t[0],T=t[1],R=t[2],f=t[3],A=t[4],h=t[5],d=t[6],N=t[7],I=t[8],S=r*l+o*T+E*R,M=i*l+u*T+c*R,y=a*l+s*T+_*R,m=r*f+o*A+E*h,O=i*f+u*A+c*h,p=a*f+s*A+_*h,C=r*d+o*N+E*I,U=i*d+u*N+c*I,L=a*d+s*N+_*I;return n[0]=S,n[1]=M,n[2]=y,n[3]=0,n[4]=m,n[5]=O,n[6]=p,n[7]=0,n[8]=C,n[9]=U,n[10]=L,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},_.multiplyByTranslation=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=r*e[0]+i*e[4]+a*e[8]+e[12],u=r*e[1]+i*e[5]+a*e[9]+e[13],s=r*e[2]+i*e[6]+a*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=s,n[15]=e[15],n};var h=new e;_.multiplyByUniformScale=function(e,t,n){return h.x=t,h.y=t,h.z=t,_.multiplyByScale(e,h,n)},_.multiplyByScale=function(e,t,n){var r=t.x,i=t.y,a=t.z;return 1===r&&1===i&&1===a?_.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=i*e[4],n[5]=i*e[5],n[6]=i*e[6],n[7]=0,n[8]=a*e[8],n[9]=a*e[9],n[10]=a*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},_.multiplyByVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=t.w,u=e[0]*r+e[4]*i+e[8]*a+e[12]*o,s=e[1]*r+e[5]*i+e[9]*a+e[13]*o,E=e[2]*r+e[6]*i+e[10]*a+e[14]*o,c=e[3]*r+e[7]*i+e[11]*a+e[15]*o;return n.x=u,n.y=s,n.z=E,n.w=c,n},_.multiplyByPointAsVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[4]*i+e[8]*a,u=e[1]*r+e[5]*i+e[9]*a,s=e[2]*r+e[6]*i+e[10]*a;return n.x=o,n.y=u,n.z=s,n},_.multiplyByPoint=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[4]*i+e[8]*a+e[12],u=e[1]*r+e[5]*i+e[9]*a+e[13],s=e[2]*r+e[6]*i+e[10]*a+e[14];return n.x=o,n.y=u,n.z=s,n},_.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},_.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},_.transpose=function(e,t){var n=e[1],r=e[2],i=e[3],a=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=a,t[10]=e[10],t[11]=e[14],t[12]=i,t[13]=o,t[14]=u,t[15]=e[15],t},_.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},_.equals=function(e,t){return e===t||i(e)&&i(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},_.equalsEpsilon=function(e,t,n){return e===t||i(e)&&i(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},_.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},_.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};var d=new E,N=new E,I=new t,S=new t(0,0,0,1);return _.inverse=function(e,n){if(E.equalsEpsilon(_.getRotation(e,d),N,s.EPSILON7)&&t.equals(_.getRow(e,3,I),S))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],i=e[4],a=e[8],o=e[12],u=e[1],l=e[5],T=e[9],R=e[13],f=e[2],A=e[6],h=e[10],M=e[14],y=e[3],m=e[7],O=e[11],p=e[15],C=h*p,U=M*O,L=A*p,w=M*m,g=A*O,x=h*m,v=f*p,F=M*y,P=f*O,B=h*y,D=f*m,z=A*y,G=C*l+w*T+g*R-(U*l+L*T+x*R),b=U*u+v*T+B*R-(C*u+F*T+P*R),X=L*u+F*l+D*R-(w*u+v*l+z*R),V=x*u+P*l+z*T-(g*u+B*l+D*T),H=U*i+L*a+x*o-(C*i+w*a+g*o),q=C*r+F*a+P*o-(U*r+v*a+B*o),W=w*r+v*i+z*o-(L*r+F*i+D*o),Y=g*r+B*i+D*a-(x*r+P*i+z*a);C=a*R,U=o*T,L=i*R,w=o*l,g=i*T,x=a*l,v=r*R,F=o*u,P=r*T,B=a*u,D=r*l,z=i*u;var k=C*m+w*O+g*p-(U*m+L*O+x*p),K=U*y+v*O+B*p-(C*y+F*O+P*p),Z=L*y+F*m+D*p-(w*y+v*m+z*p),j=x*y+P*m+z*O-(g*y+B*m+D*O),Q=L*h+x*M+U*A-(g*M+C*A+w*h),J=P*M+C*f+F*h-(v*h+B*M+U*f),$=v*A+z*M+w*f-(D*M+L*f+F*A),ee=D*h+g*f+B*A-(P*A+z*h+x*f),te=r*G+i*b+a*X+o*V;if(Math.abs(te)<s.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=G*te,n[1]=b*te,n[2]=X*te,n[3]=V*te,n[4]=H*te,n[5]=q*te,n[6]=W*te,n[7]=Y*te,n[8]=k*te,n[9]=K*te,n[10]=Z*te,n[11]=j*te,n[12]=Q*te,n[13]=J*te,n[14]=$*te,n[15]=ee*te,n},_.inverseTransformation=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[4],o=e[5],u=e[6],s=e[8],E=e[9],c=e[10],_=e[12],l=e[13],T=e[14],R=-n*_-r*l-i*T,f=-a*_-o*l-u*T,A=-s*_-E*l-c*T;return t[0]=n,t[1]=a,t[2]=s,t[3]=0,t[4]=r,t[5]=o,t[6]=E,t[7]=0,t[8]=i,t[9]=u,t[10]=c,t[11]=0,t[12]=R,t[13]=f,t[14]=A,t[15]=1,t},_.IDENTITY=u(new _(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),_.ZERO=u(new _(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),_.COLUMN0ROW0=0,_.COLUMN0ROW1=1,_.COLUMN0ROW2=2,_.COLUMN0ROW3=3,_.COLUMN1ROW0=4,_.COLUMN1ROW1=5,_.COLUMN1ROW2=6,_.COLUMN1ROW3=7,_.COLUMN2ROW0=8,_.COLUMN2ROW1=9,_.COLUMN2ROW2=10,_.COLUMN2ROW3=11,_.COLUMN3ROW0=12,_.COLUMN3ROW1=13,_.COLUMN3ROW2=14,_.COLUMN3ROW3=15,a(_.prototype,{length:{get:function(){return _.packedLength}}}),_.prototype.clone=function(e){return _.clone(this,e)},_.prototype.equals=function(e){return _.equals(this,e)},_.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},_.prototype.equalsEpsilon=function(e,t){return _.equalsEpsilon(this,e,t)},_.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]+")"},_}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,i,a,o,u,s){"use strict";function E(e,t,r,i){this.west=n(e,0),this.south=n(t,0),this.east=n(r,0),this.north=n(i,0)}i(E.prototype,{width:{get:function(){return E.computeWidth(this)}},height:{get:function(){return E.computeHeight(this)}}}),E.packedLength=4,E.pack=function(e,t,r){return r=n(r,0),t[r++]=e.west,t[r++]=e.south,t[r++]=e.east,t[r]=e.north,t},E.unpack=function(e,t,i){return t=n(t,0),r(i)||(i=new E),i.west=e[t++],i.south=e[t++],i.east=e[t++],i.north=e[t],i},E.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=s.TWO_PI),t-n},E.computeHeight=function(e){return e.north-e.south},E.fromDegrees=function(e,t,i,a,o){return e=s.toRadians(n(e,0)),t=s.toRadians(n(t,0)),i=s.toRadians(n(i,0)),a=s.toRadians(n(a,0)),r(o)?(o.west=e,o.south=t,o.east=i,o.north=a,o):new E(e,t,i,a)},E.fromRadians=function(e,t,i,a,o){return r(o)?(o.west=n(e,0),o.south=n(t,0),o.east=n(i,0),o.north=n(a,0),o):new E(e,t,i,a)},E.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,u=Number.MAX_VALUE,c=-Number.MAX_VALUE,_=0,l=e.length;_<l;_++){var T=e[_];n=Math.min(n,T.longitude),i=Math.max(i,T.longitude),u=Math.min(u,T.latitude),c=Math.max(c,T.latitude);var R=T.longitude>=0?T.longitude:T.longitude+s.TWO_PI;a=Math.min(a,R),o=Math.max(o,R)}return i-n>o-a&&(n=a,i=o,i>s.PI&&(i-=s.TWO_PI),n>s.PI&&(n-=s.TWO_PI)),r(t)?(t.west=n,t.south=u,t.east=i,t.north=c,t):new E(n,u,i,c)},E.fromCartesianArray=function(e,t,n){for(var i=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,u=-Number.MAX_VALUE,c=Number.MAX_VALUE,_=-Number.MAX_VALUE,l=0,T=e.length;l<T;l++){var R=t.cartesianToCartographic(e[l]);i=Math.min(i,R.longitude),a=Math.max(a,R.longitude),c=Math.min(c,R.latitude),_=Math.max(_,R.latitude);var f=R.longitude>=0?R.longitude:R.longitude+s.TWO_PI;o=Math.min(o,f),u=Math.max(u,f)}return a-i>u-o&&(i=o,a=u,a>s.PI&&(a-=s.TWO_PI),i>s.PI&&(i-=s.TWO_PI)),r(n)?(n.west=i,n.south=c,n.east=a,n.north=_,n):new E(i,c,a,_)},E.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new E(e.west,e.south,e.east,e.north)},E.prototype.clone=function(e){return E.clone(this,e)},E.prototype.equals=function(e){return E.equals(this,e)},E.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},E.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},E.validate=function(e){},E.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)},E.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)},E.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)},E.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)},E.center=function(t,n){var i=t.east,a=t.west;i<a&&(i+=s.TWO_PI);var o=s.negativePiToPi(.5*(a+i)),u=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=u,n.height=0,n):new e(o,u)},E.intersection=function(e,t,n){var i=e.east,a=e.west,o=t.east,u=t.west;i<a&&o>0?i+=s.TWO_PI:o<u&&i>0&&(o+=s.TWO_PI),i<a&&u<0?u+=s.TWO_PI:o<u&&a<0&&(a+=s.TWO_PI);var c=s.negativePiToPi(Math.max(a,u)),_=s.negativePiToPi(Math.min(i,o));if(!((e.west<e.east||t.west<t.east)&&_<=c)){var l=Math.max(e.south,t.south),T=Math.min(e.north,t.north);if(!(l>=T))return r(n)?(n.west=c,n.south=l,n.east=_,n.north=T,n):new E(c,l,_,T)}},E.simpleIntersection=function(e,t,n){var i=Math.max(e.west,t.west),a=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(a>=u||i>=o))return r(n)?(n.west=i,n.south=a,n.east=o,n.north=u,n):new E(i,a,o,u)},E.union=function(e,t,n){r(n)||(n=new E);var i=e.east,a=e.west,o=t.east,u=t.west;i<a&&o>0?i+=s.TWO_PI:o<u&&i>0&&(o+=s.TWO_PI),i<a&&u<0?u+=s.TWO_PI:o<u&&a<0&&(a+=s.TWO_PI);var c=s.convertLongitudeRange(Math.min(a,u)),_=s.convertLongitudeRange(Math.max(i,o));return n.west=c,n.south=Math.min(e.south,t.south),n.east=_,n.north=Math.max(e.north,t.north),n},E.expand=function(e,t,n){return r(n)||(n=new E),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},E.contains=function(e,t){var n=t.longitude,r=t.latitude,i=e.west,a=e.east;return a<i&&(a+=s.TWO_PI,n<0&&(n+=s.TWO_PI)),(n>i||s.equalsEpsilon(n,i,s.EPSILON14))&&(n<a||s.equalsEpsilon(n,a,s.EPSILON14))&&r>=e.south&&r<=e.north};var c=new e;return E.subsample=function(e,t,i,a){t=n(t,o.WGS84),i=n(i,0),r(a)||(a=[]);var u=0,_=e.north,l=e.south,T=e.east,R=e.west,f=c;f.height=i,f.longitude=R,f.latitude=_,a[u]=t.cartographicToCartesian(f,a[u]),u++,f.longitude=T,a[u]=t.cartographicToCartesian(f,a[u]),u++,f.latitude=l,a[u]=t.cartographicToCartesian(f,a[u]),u++,f.longitude=R,a[u]=t.cartographicToCartesian(f,a[u]),u++,_<0?f.latitude=_:l>0?f.latitude=l:f.latitude=0;for(var A=1;A<8;++A)f.longitude=-Math.PI+A*s.PI_OVER_TWO,E.contains(e,f)&&(a[u]=t.cartographicToCartesian(f,a[u]),u++);return 0===f.latitude&&(f.longitude=R,a[u]=t.cartographicToCartesian(f,a[u]),u++,f.longitude=T,a[u]=t.cartographicToCartesian(f,a[u]),u++),a.length=u,a},E.MAX_VALUE=u(new E(-Math.PI,-s.PI_OVER_TWO,Math.PI,s.PI_OVER_TWO)),E}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,i,a,o,u,s,E,c,_){"use strict";function l(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var T=new e,R=new e,f=new e,A=new e,h=new e,d=new e,N=new e,I=new e,S=new e,M=new e,y=new e,m=new e;l.fromPoints=function(t,n){if(i(n)||(n=new l),!i(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var r=e.clone(t[0],N),a=e.clone(r,T),o=e.clone(r,R),u=e.clone(r,f),s=e.clone(r,A),E=e.clone(r,h),c=e.clone(r,d),_=t.length,O=1;O<_;O++){e.clone(t[O],r);var p=r.x,C=r.y,U=r.z;p<a.x&&e.clone(r,a),p>s.x&&e.clone(r,s),C<o.y&&e.clone(r,o),C>E.y&&e.clone(r,E),U<u.z&&e.clone(r,u),U>c.z&&e.clone(r,c)}var L=e.magnitudeSquared(e.subtract(s,a,I)),w=e.magnitudeSquared(e.subtract(E,o,I)),g=e.magnitudeSquared(e.subtract(c,u,I)),x=a,v=s,F=L;w>F&&(F=w,x=o,v=E),g>F&&(F=g,x=u,v=c);var P=S;P.x=.5*(x.x+v.x),P.y=.5*(x.y+v.y),P.z=.5*(x.z+v.z);var B=e.magnitudeSquared(e.subtract(v,P,I)),D=Math.sqrt(B),z=M;z.x=a.x,z.y=o.y,z.z=u.z;var G=y;G.x=s.x,G.y=E.y,G.z=c.z;var b=e.multiplyByScalar(e.add(z,G,I),.5,m),X=0;for(O=0;O<_;O++){e.clone(t[O],r);var V=e.magnitude(e.subtract(r,b,I));V>X&&(X=V);var H=e.magnitudeSquared(e.subtract(r,P,I));if(H>B){var q=Math.sqrt(H);D=.5*(D+q),B=D*D;var W=q-D;P.x=(D*P.x+W*r.x)/q,P.y=(D*P.y+W*r.y)/q,P.z=(D*P.z+W*r.z)/q}}return D<X?(e.clone(P,n.center),n.radius=D):(e.clone(b,n.center),n.radius=X),n};var O=new o,p=new e,C=new e,U=new t,L=new t;l.fromRectangle2D=function(e,t,n){return l.fromRectangleWithHeights2D(e,t,0,0,n)},l.fromRectangleWithHeights2D=function(t,n,a,o,u){if(i(u)||(u=new l),!i(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;n=r(n,O),_.southwest(t,U),U.height=a,_.northeast(t,L),L.height=o;var s=n.project(U,p),E=n.project(L,C),c=E.x-s.x,T=E.y-s.y,R=E.z-s.z;u.radius=.5*Math.sqrt(c*c+T*T+R*R);var f=u.center;return f.x=s.x+.5*c,f.y=s.y+.5*T,f.z=s.z+.5*R,u};var w=[];l.fromRectangle3D=function(e,t,n,o){t=r(t,a.WGS84),n=r(n,0);var u;return i(e)&&(u=_.subsample(e,t,n,w)),l.fromPoints(u,o)},l.fromVertices=function(t,n,a,o){if(i(o)||(o=new l),!i(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;n=r(n,e.ZERO),a=r(a,3);var u=N;u.x=t[0]+n.x,u.y=t[1]+n.y,u.z=t[2]+n.z;for(var s=e.clone(u,T),E=e.clone(u,R),c=e.clone(u,f),_=e.clone(u,A),O=e.clone(u,h),p=e.clone(u,d),C=t.length,U=0;U<C;U+=a){var L=t[U]+n.x,w=t[U+1]+n.y,g=t[U+2]+n.z;u.x=L,u.y=w,u.z=g,L<s.x&&e.clone(u,s),L>_.x&&e.clone(u,_),w<E.y&&e.clone(u,E),w>O.y&&e.clone(u,O),g<c.z&&e.clone(u,c),g>p.z&&e.clone(u,p)}var x=e.magnitudeSquared(e.subtract(_,s,I)),v=e.magnitudeSquared(e.subtract(O,E,I)),F=e.magnitudeSquared(e.subtract(p,c,I)),P=s,B=_,D=x;v>D&&(D=v,P=E,B=O),F>D&&(D=F,P=c,B=p);var z=S;z.x=.5*(P.x+B.x),z.y=.5*(P.y+B.y),z.z=.5*(P.z+B.z);var G=e.magnitudeSquared(e.subtract(B,z,I)),b=Math.sqrt(G),X=M;X.x=s.x,X.y=E.y,X.z=c.z;var V=y;V.x=_.x,V.y=O.y,V.z=p.z;var H=e.multiplyByScalar(e.add(X,V,I),.5,m),q=0;for(U=0;U<C;U+=a){u.x=t[U]+n.x,u.y=t[U+1]+n.y,u.z=t[U+2]+n.z;var W=e.magnitude(e.subtract(u,H,I));W>q&&(q=W);var Y=e.magnitudeSquared(e.subtract(u,z,I));if(Y>G){var k=Math.sqrt(Y);b=.5*(b+k),G=b*b;var K=k-b;z.x=(b*z.x+K*u.x)/k,z.y=(b*z.y+K*u.y)/k,z.z=(b*z.z+K*u.z)/k}}return b<q?(e.clone(z,o.center),o.radius=b):(e.clone(H,o.center),o.radius=q),o},l.fromEncodedCartesianVertices=function(t,n,r){if(i(r)||(r=new l),!i(t)||!i(n)||t.length!==n.length||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var a=N;a.x=t[0]+n[0],a.y=t[1]+n[1],a.z=t[2]+n[2];for(var o=e.clone(a,T),u=e.clone(a,R),s=e.clone(a,f),E=e.clone(a,A),c=e.clone(a,h),_=e.clone(a,d),O=t.length,p=0;p<O;p+=3){var C=t[p]+n[p],U=t[p+1]+n[p+1],L=t[p+2]+n[p+2];a.x=C,a.y=U,a.z=L,C<o.x&&e.clone(a,o),C>E.x&&e.clone(a,E),U<u.y&&e.clone(a,u),U>c.y&&e.clone(a,c),L<s.z&&e.clone(a,s),L>_.z&&e.clone(a,_)}var w=e.magnitudeSquared(e.subtract(E,o,I)),g=e.magnitudeSquared(e.subtract(c,u,I)),x=e.magnitudeSquared(e.subtract(_,s,I)),v=o,F=E,P=w;g>P&&(P=g,v=u,F=c),x>P&&(P=x,v=s,F=_);var B=S;B.x=.5*(v.x+F.x),B.y=.5*(v.y+F.y),B.z=.5*(v.z+F.z);var D=e.magnitudeSquared(e.subtract(F,B,I)),z=Math.sqrt(D),G=M;G.x=o.x,G.y=u.y,G.z=s.z;var b=y;b.x=E.x,b.y=c.y,b.z=_.z;var X=e.multiplyByScalar(e.add(G,b,I),.5,m),V=0;for(p=0;p<O;p+=3){a.x=t[p]+n[p],a.y=t[p+1]+n[p+1],a.z=t[p+2]+n[p+2];var H=e.magnitude(e.subtract(a,X,I));H>V&&(V=H);var q=e.magnitudeSquared(e.subtract(a,B,I));if(q>D){var W=Math.sqrt(q);z=.5*(z+W),D=z*z;var Y=W-z;B.x=(z*B.x+Y*a.x)/W,B.y=(z*B.y+Y*a.y)/W,B.z=(z*B.z+Y*a.z)/W}}return z<V?(e.clone(B,r.center),r.radius=z):(e.clone(X,r.center),r.radius=V),r},l.fromCornerPoints=function(t,n,r){i(r)||(r=new l);var a=r.center;return e.add(t,n,a),e.multiplyByScalar(a,.5,a),r.radius=e.distance(a,n),r},l.fromEllipsoid=function(t,n){return i(n)||(n=new l),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var g=new e;l.fromBoundingSpheres=function(t,n){if(i(n)||(n=new l),!i(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var r=t.length;if(1===r)return l.clone(t[0],n);if(2===r)return l.union(t[0],t[1],n);for(var a=[],o=0;o<r;o++)a.push(t[o].center);n=l.fromPoints(a,n);var u=n.center,s=n.radius;for(o=0;o<r;o++){var E=t[o];s=Math.max(s,e.distance(u,E.center,g)+E.radius)}return n.radius=s,n};var x=new e,v=new e,F=new e;l.fromOrientedBoundingBox=function(t,n){i(n)||(n=new l);var r=t.halfAxes,a=E.getColumn(r,0,x),o=E.getColumn(r,1,v),u=E.getColumn(r,2,F),s=e.magnitude(a),c=e.magnitude(o),_=e.magnitude(u);return n.center=e.clone(t.center,n.center),n.radius=Math.max(s,c,_),n},l.clone=function(t,n){if(i(t))return i(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new l(t.center,t.radius)},l.packedLength=4,l.pack=function(e,t,n){n=r(n,0);var i=e.center;return t[n++]=i.x,t[n++]=i.y,t[n++]=i.z,t[n]=e.radius,t},l.unpack=function(e,t,n){t=r(t,0),i(n)||(n=new l);var a=n.center;return a.x=e[t++],a.y=e[t++],a.z=e[t++],n.radius=e[t],n};var P=new e,B=new e;l.union=function(t,n,r){i(r)||(r=new l);var a=t.center,o=t.radius,u=n.center,s=n.radius,E=e.subtract(u,a,P),c=e.magnitude(E);if(o>=c+s)return t.clone(r),r;if(s>=c+o)return n.clone(r),r;var _=.5*(o+c+s),T=e.multiplyByScalar(E,(-o+_)/c,B);return e.add(T,a,T),e.clone(T,r.center),r.radius=_,r};var D=new e;l.expand=function(t,n,r){r=l.clone(t,r);var i=e.magnitude(e.subtract(n,r.center,D));return i>r.radius&&(r.radius=i),r},l.intersectPlane=function(t,n){var r=t.center,i=t.radius,a=n.normal,o=e.dot(a,r)+n.distance;return o<-i?u.OUTSIDE:o<i?u.INTERSECTING:u.INSIDE},l.transform=function(e,t,n){return i(n)||(n=new l),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=c.getMaximumScale(t)*e.radius,n};var z=new e;l.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,z);return e.magnitudeSquared(r)-t.radius*t.radius},l.transformWithoutScale=function(e,t,n){return i(n)||(n=new l),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var G=new e;l.computePlaneDistances=function(t,n,r,a){i(a)||(a=new s);var o=e.subtract(t.center,n,G),u=e.dot(r,o);return a.start=u-t.radius,a.stop=u+t.radius,a};for(var b=new e,X=new e,V=new e,H=new e,q=new e,W=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var K=new o;return l.projectTo2D=function(t,n,i){n=r(n,K);var a=n.ellipsoid,o=t.center,u=t.radius,s=a.geodeticSurfaceNormal(o,b),E=e.cross(e.UNIT_Z,s,X);e.normalize(E,E);var c=e.cross(s,E,V);e.normalize(c,c),e.multiplyByScalar(s,u,s),e.multiplyByScalar(c,u,c),e.multiplyByScalar(E,u,E);var _=e.negate(c,q),T=e.negate(E,H),R=Y,f=R[0];e.add(s,c,f),e.add(f,E,f),f=R[1],e.add(s,c,f),e.add(f,T,f),f=R[2],e.add(s,_,f),e.add(f,T,f),f=R[3],e.add(s,_,f),e.add(f,E,f),e.negate(s,s),f=R[4],e.add(s,c,f),e.add(f,E,f),f=R[5],e.add(s,c,f),e.add(f,T,f),f=R[6],e.add(s,_,f),e.add(f,T,f),f=R[7],e.add(s,_,f),e.add(f,E,f);for(var A=R.length,h=0;h<A;++h){var d=R[h];e.add(o,d,d);var N=a.cartesianToCartographic(d,W);n.project(N,d)}i=l.fromPoints(R,i),o=i.center;var I=o.x,S=o.y,M=o.z;return o.x=M,o.y=I,o.z=S,i},l.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},l.equals=function(t,n){return t===n||i(t)&&i(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},l.prototype.intersectPlane=function(e){return l.intersectPlane(this,e)},l.prototype.distanceSquaredTo=function(e){return l.distanceSquaredTo(this,e)},l.prototype.computePlaneDistances=function(e,t,n){return l.computePlaneDistances(this,e,t,n)},l.prototype.isOccluded=function(e){return l.isOccluded(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.prototype.clone=function(e){return l.clone(this,e)},l}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},i={};return t(i,{element:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(i.supportsFullscreen())return null!==i.element}}}),i.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var i,a=["webkit","moz","o","ms","khtml"],o=0,u=a.length;o<u;++o){var s=a[o];i=s+"RequestFullscreen","function"==typeof t[i]?(r.requestFullscreen=i,n=!0):(i=s+"RequestFullScreen","function"==typeof t[i]&&(r.requestFullscreen=i,n=!0)),i=s+"ExitFullscreen","function"==typeof document[i]?r.exitFullscreen=i:(i=s+"CancelFullScreen","function"==typeof document[i]&&(r.exitFullscreen=i)),i=s+"FullscreenEnabled",void 0!==document[i]?r.fullscreenEnabled=i:(i=s+"FullScreenEnabled",void 0!==document[i]&&(r.fullscreenEnabled=i)),i=s+"FullscreenElement",void 0!==document[i]?r.fullscreenElement=i:(i=s+"FullScreenElement",void 0!==document[i]&&(r.fullscreenElement=i)),i=s+"fullscreenchange",void 0!==document["on"+i]&&("ms"===s&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=s+"fullscreenerror",void 0!==document["on"+i]&&("ms"===s&&(i="MSFullscreenError"),r.fullscreenerror=i)}return n},i.requestFullscreen=function(e,t){i.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},i.exitFullscreen=function(){i.supportsFullscreen()&&document[r.exitFullscreen]()},i}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function i(){if(!t(S)&&(S=!1,!l())){var e=/ Chrome\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(S=!0,M=r(e[1]))}return S}function a(){return i()&&M}function o(){if(!t(y)&&(y=!1,!i()&&!l()&&/ Safari\/[\.0-9]+/.test(I.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(y=!0,m=r(e[1]))}return y}function u(){return o()&&m}function s(){if(!t(O)){O=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(I.userAgent);null!==e&&(O=!0,p=r(e[1]),p.isNightly=!!e[2])}return O}function E(){return s()&&p}function c(){if(!t(C)){C=!1;var e;"Microsoft Internet Explorer"===I.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==e&&(C=!0,U=r(e[1]))):"Netscape"===I.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==e&&(C=!0,U=r(e[1])))}return C}function _(){return c()&&U}function l(){if(!t(L)){L=!1;var e=/ Edge\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(L=!0,w=r(e[1]))}return L}function T(){return l()&&w}function R(){if(!t(g)){g=!1;var e=/Firefox\/([\.0-9]+)/.exec(I.userAgent); +null!==e&&(g=!0,x=r(e[1]))}return g}function f(){return t(v)||(v=/Windows/i.test(I.appVersion)),v}function A(){return R()&&x}function h(){return t(F)||(F="undefined"!=typeof PointerEvent&&(!t(I.pointerEnabled)||I.pointerEnabled)),F}function d(){if(!t(B)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;B=t(n)&&""!==n,B&&(P=n)}return B}function N(){return d()?P:void 0}var I;I="undefined"!=typeof navigator?navigator:{};var S,M,y,m,O,p,C,U,L,w,g,x,v,F,P,B,D={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:E,isInternetExplorer:c,internetExplorerVersion:_,isEdge:l,edgeVersion:T,isFirefox:R,firefoxVersion:A,isWindows:f,hardwareConcurrency:e(I.hardwareConcurrency,3),supportsPointerEvents:h,supportsImageRenderingPixelated:d,imageRenderingValue:N};return D.supportsFullscreen=function(){return n.supportsFullscreen()},D.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},D.supportsWebWorkers=function(){return"undefined"!=typeof Worker},D}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,i,a){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:a.BYTE,UNSIGNED_BYTE:a.UNSIGNED_BYTE,SHORT:a.SHORT,UNSIGNED_SHORT:a.UNSIGNED_SHORT,INT:a.INT,UNSIGNED_INT:a.UNSIGNED_INT,FLOAT:a.FLOAT,DOUBLE:a.DOUBLE};return o.getSizeInBytes=function(e){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.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},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 Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,i){switch(r=e(r,0),i=e(i,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,i);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,i);case o.SHORT:return new Int16Array(n,r,i);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,i);case o.INT:return new Int32Array(n,r,i);case o.UNSIGNED_INT:return new Uint32Array(n,r,i);case o.FLOAT:return new Float32Array(n,r,i);case o.DOUBLE:return new Float64Array(n,r,i)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},i(o)}),define("Core/Quaternion",["./Cartesian3","./Check","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math","./Matrix3"],function(e,t,n,r,i,a,o,u,s){"use strict";function E(e,t,r,i){this.x=n(e,0),this.y=n(t,0),this.z=n(r,0),this.w=n(i,0)}var c=new e;E.fromAxisAngle=function(t,n,i){var a=n/2,o=Math.sin(a);c=e.normalize(t,c);var u=c.x*o,s=c.y*o,_=c.z*o,l=Math.cos(a);return r(i)?(i.x=u,i.y=s,i.z=_,i.w=l,i):new E(u,s,_,l)};var _=[1,2,0],l=new Array(3);E.fromRotationMatrix=function(e,t){var n,i,a,o,u,c=e[s.COLUMN0ROW0],T=e[s.COLUMN1ROW1],R=e[s.COLUMN2ROW2],f=c+T+R;if(f>0)n=Math.sqrt(f+1),u=.5*n,n=.5/n,i=(e[s.COLUMN1ROW2]-e[s.COLUMN2ROW1])*n,a=(e[s.COLUMN2ROW0]-e[s.COLUMN0ROW2])*n,o=(e[s.COLUMN0ROW1]-e[s.COLUMN1ROW0])*n;else{var A=_,h=0;T>c&&(h=1),R>c&&R>T&&(h=2);var d=A[h],N=A[d];n=Math.sqrt(e[s.getElementIndex(h,h)]-e[s.getElementIndex(d,d)]-e[s.getElementIndex(N,N)]+1);var I=l;I[h]=.5*n,n=.5/n,u=(e[s.getElementIndex(N,d)]-e[s.getElementIndex(d,N)])*n,I[d]=(e[s.getElementIndex(d,h)]+e[s.getElementIndex(h,d)])*n,I[N]=(e[s.getElementIndex(N,h)]+e[s.getElementIndex(h,N)])*n,i=-I[0],a=-I[1],o=-I[2]}return r(t)?(t.x=i,t.y=a,t.z=o,t.w=u,t):new E(i,a,o,u)};var T=new E;E.fromHeadingPitchRoll=function(t,n,r,i){var a=E.fromAxisAngle(e.UNIT_X,r,T),o=E.fromAxisAngle(e.UNIT_Y,-n,i);i=E.multiply(o,a,o);var u=E.fromAxisAngle(e.UNIT_Z,-t,T);return E.multiply(u,i,i)};var R=new e,f=new e,A=new E,h=new E,d=new E;E.packedLength=4,E.pack=function(e,t,r){return r=n(r,0),t[r++]=e.x,t[r++]=e.y,t[r++]=e.z,t[r]=e.w,t},E.unpack=function(e,t,i){return t=n(t,0),r(i)||(i=new E),i.x=e[t],i.y=e[t+1],i.z=e[t+2],i.w=e[t+3],i},E.packedInterpolationLength=3,E.convertPackedArrayForInterpolation=function(e,t,n,r){E.unpack(e,4*n,d),E.conjugate(d,d);for(var i=0,a=n-t+1;i<a;i++){var o=3*i;E.unpack(e,4*(t+i),A),E.multiply(A,d,A),A.w<0&&E.negate(A,A),E.computeAxis(A,R);var u=E.computeAngle(A);r[o]=R.x*u,r[o+1]=R.y*u,r[o+2]=R.z*u}},E.unpackInterpolationResult=function(t,n,i,a,o){r(o)||(o=new E),e.fromArray(t,0,f);var u=e.magnitude(f);return E.unpack(n,4*a,h),0===u?E.clone(E.IDENTITY,A):E.fromAxisAngle(f,u,A),E.multiply(A,h,o)},E.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new E(e.x,e.y,e.z,e.w)},E.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},E.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},E.magnitude=function(e){return Math.sqrt(E.magnitudeSquared(e))},E.normalize=function(e,t){var n=1/E.magnitude(e),r=e.x*n,i=e.y*n,a=e.z*n,o=e.w*n;return t.x=r,t.y=i,t.z=a,t.w=o,t},E.inverse=function(e,t){var n=E.magnitudeSquared(e);return t=E.conjugate(e,t),E.multiplyByScalar(t,1/n,t)},E.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},E.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},E.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},E.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},E.multiply=function(e,t,n){var r=e.x,i=e.y,a=e.z,o=e.w,u=t.x,s=t.y,E=t.z,c=t.w,_=o*u+r*c+i*E-a*s,l=o*s-r*E+i*c+a*u,T=o*E+r*s-i*u+a*c,R=o*c-r*u-i*s-a*E;return n.x=_,n.y=l,n.z=T,n.w=R,n},E.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},E.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},E.computeAxis=function(e,t){var n=e.w;if(Math.abs(n-1)<u.EPSILON6)return t.x=t.y=t.z=0,t;var r=1/Math.sqrt(1-n*n);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},E.computeAngle=function(e){return Math.abs(e.w-1)<u.EPSILON6?0:2*Math.acos(e.w)};var N=new E;E.lerp=function(e,t,n,r){return N=E.multiplyByScalar(t,n,N),r=E.multiplyByScalar(e,1-n,r),E.add(N,r,r)};var I=new E,S=new E,M=new E;E.slerp=function(e,t,n,r){var i=E.dot(e,t),a=t;if(i<0&&(i=-i,a=I=E.negate(t,I)),1-i<u.EPSILON6)return E.lerp(e,a,n,r);var o=Math.acos(i);return S=E.multiplyByScalar(e,Math.sin((1-n)*o),S),M=E.multiplyByScalar(a,Math.sin(n*o),M),r=E.add(S,M,r),E.multiplyByScalar(r,1/Math.sin(o),r)},E.log=function(t,n){var r=u.acosClamped(t.w),i=0;return 0!==r&&(i=r/Math.sin(r)),e.multiplyByScalar(t,i,n)},E.exp=function(t,n){var r=e.magnitude(t),i=0;return 0!==r&&(i=Math.sin(r)/r),n.x=t.x*i,n.y=t.y*i,n.z=t.z*i,n.w=Math.cos(r),n};var y=new e,m=new e,O=new E,p=new E;E.computeInnerQuadrangle=function(t,n,r,i){var a=E.conjugate(n,O);E.multiply(a,r,p);var o=E.log(p,y);E.multiply(a,t,p);var u=E.log(p,m);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),E.exp(o,O),E.multiply(n,O,i)},E.squad=function(e,t,n,r,i,a){var o=E.slerp(e,t,i,O),u=E.slerp(n,r,i,p);return E.slerp(o,u,2*i*(1-i),a)};for(var C=new E,U=1.9011074535173003,L=a.supportsTypedArrays()?new Float32Array(8):[],w=a.supportsTypedArrays()?new Float32Array(8):[],g=a.supportsTypedArrays()?new Float32Array(8):[],x=a.supportsTypedArrays()?new Float32Array(8):[],v=0;v<7;++v){var F=v+1,P=2*F+1;L[v]=1/(F*P),w[v]=F/P}return L[7]=U/136,w[7]=8*U/17,E.fastSlerp=function(e,t,n,r){var i,a=E.dot(e,t);a>=0?i=1:(i=-1,a=-a);for(var o=a-1,u=1-n,s=n*n,c=u*u,_=7;_>=0;--_)g[_]=(L[_]*s-w[_])*o,x[_]=(L[_]*c-w[_])*o;var l=i*n*(1+g[0]*(1+g[1]*(1+g[2]*(1+g[3]*(1+g[4]*(1+g[5]*(1+g[6]*(1+g[7])))))))),T=u*(1+x[0]*(1+x[1]*(1+x[2]*(1+x[3]*(1+x[4]*(1+x[5]*(1+x[6]*(1+x[7])))))))),R=E.multiplyByScalar(e,T,C);return E.multiplyByScalar(t,l,r),E.add(R,r,r)},E.fastSquad=function(e,t,n,r,i,a){var o=E.fastSlerp(e,t,i,O),u=E.fastSlerp(n,r,i,p);return E.fastSlerp(o,u,2*i*(1-i),a)},E.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},E.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n},E.ZERO=o(new E(0,0,0,0)),E.IDENTITY=o(new E(0,0,0,1)),E.prototype.clone=function(e){return E.clone(this,e)},E.prototype.equals=function(e){return E.equals(this,e)},E.prototype.equalsEpsilon=function(e,t){return E.equalsEpsilon(this,e,t)},E.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},E}),define("Core/EllipseGeometryLibrary",["./Cartesian3","./Math","./Matrix3","./Quaternion"],function(e,t,n,r){"use strict";function i(t,i,a,c,_,l,T,R,f,A){var h=t+i;e.multiplyByScalar(c,Math.cos(h),o),e.multiplyByScalar(a,Math.sin(h),u),e.add(o,u,o);var d=Math.cos(t);d*=d;var N=Math.sin(t);N*=N;var I=l/Math.sqrt(T*d+_*N),S=I/R;return r.fromAxisAngle(o,S,s),n.fromQuaternion(s,E),n.multiplyByVector(E,f,A),e.normalize(A,A),e.multiplyByScalar(A,R,A),A}var a={},o=new e,u=new e,s=new r,E=new n,c=new e,_=new e,l=new e,T=new e;a.raisePositionsToHeight=function(t,n,r){for(var i=n.ellipsoid,a=n.height,o=n.extrudedHeight,u=r?t.length/3*2:t.length/3,s=new Float64Array(3*u),E=t.length,R=r?E:0,f=0;f<E;f+=3){var A=f+1,h=f+2,d=e.fromArray(t,f,c);i.scaleToGeodeticSurface(d,d);var N=e.clone(d,_),I=i.geodeticSurfaceNormal(d,T),S=e.multiplyByScalar(I,a,l);e.add(d,S,d),r&&(e.multiplyByScalar(I,o,S),e.add(N,S,N),s[f+R]=N.x,s[A+R]=N.y,s[h+R]=N.z),s[f]=d.x,s[A]=d.y,s[h]=d.z}return s};var R=new e,f=new e,A=new e;return a.computeEllipsePositions=function(n,r,a){var o=n.semiMinorAxis,u=n.semiMajorAxis,s=n.rotation,E=n.center,T=8*n.granularity,h=o*o,d=u*u,N=u*o,I=e.magnitude(E),S=e.normalize(E,R),M=e.cross(e.UNIT_Z,E,f);M=e.normalize(M,M);var y=e.cross(S,M,A),m=1+Math.ceil(t.PI_OVER_TWO/T),O=t.PI_OVER_TWO/(m-1),p=t.PI_OVER_TWO-m*O;p<0&&(m-=Math.ceil(Math.abs(p)/O));var C,U,L,w,g,x=2*(m*(m+2)),v=r?new Array(3*x):void 0,F=0,P=c,B=_,D=4*m*3,z=D-1,G=0,b=a?new Array(D):void 0;for(p=t.PI_OVER_TWO,P=i(p,s,y,M,h,N,d,I,S,P),r&&(v[F++]=P.x,v[F++]=P.y,v[F++]=P.z),a&&(b[z--]=P.z,b[z--]=P.y,b[z--]=P.x),p=t.PI_OVER_TWO-O,C=1;C<m+1;++C){if(P=i(p,s,y,M,h,N,d,I,S,P),B=i(Math.PI-p,s,y,M,h,N,d,I,S,B),r){for(v[F++]=P.x,v[F++]=P.y,v[F++]=P.z,L=2*C+2,U=1;U<L-1;++U)w=U/(L-1),g=e.lerp(P,B,w,l),v[F++]=g.x,v[F++]=g.y,v[F++]=g.z;v[F++]=B.x,v[F++]=B.y,v[F++]=B.z}a&&(b[z--]=P.z,b[z--]=P.y,b[z--]=P.x,b[G++]=B.x,b[G++]=B.y,b[G++]=B.z),p=t.PI_OVER_TWO-(C+1)*O}for(C=m;C>1;--C){if(p=t.PI_OVER_TWO-(C-1)*O,P=i(-p,s,y,M,h,N,d,I,S,P),B=i(p+Math.PI,s,y,M,h,N,d,I,S,B),r){for(v[F++]=P.x,v[F++]=P.y,v[F++]=P.z,L=2*(C-1)+2,U=1;U<L-1;++U)w=U/(L-1),g=e.lerp(P,B,w,l),v[F++]=g.x,v[F++]=g.y,v[F++]=g.z;v[F++]=B.x,v[F++]=B.y,v[F++]=B.z}a&&(b[z--]=P.z,b[z--]=P.y,b[z--]=P.x,b[G++]=B.x,b[G++]=B.y,b[G++]=B.z)}p=t.PI_OVER_TWO,P=i(-p,s,y,M,h,N,d,I,S,P);var X={};return r&&(v[F++]=P.x,v[F++]=P.y,v[F++]=P.z,X.positions=v,X.numPts=m),a&&(b[z--]=P.z,b[z--]=P.y,b[z--]=P.x,X.outerPositions=b),X},a}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===n.POINTS||e===n.LINES||e===n.LINE_LOOP||e===n.LINE_STRIP||e===n.TRIANGLES||e===n.TRIANGLE_STRIP||e===n.TRIANGLE_FAN}};return e(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,i){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,i.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return a.computeNumberOfVertices=function(e){var n=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var i=e.attributes[r],a=i.values.length/i.componentsPerAttribute;n=a}return n},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(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 r}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,n,r,i){"use strict";var a={UNSIGNED_BYTE:i.UNSIGNED_BYTE,UNSIGNED_SHORT:i.UNSIGNED_SHORT,UNSIGNED_INT:i.UNSIGNED_INT};return a.getSizeInBytes=function(e){switch(e){case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},a.validate=function(t){return e(t)&&(t===a.UNSIGNED_BYTE||t===a.UNSIGNED_SHORT||t===a.UNSIGNED_INT)},a.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},a.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)},n(a)}),define("Core/EllipseOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EllipseGeometryLibrary","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType"],function(e,t,n,r,i,a,o,u,s,E,c,_,l,T){"use strict";function R(r){var i=r.center;d=t.multiplyByScalar(r.ellipsoid.geodeticSurfaceNormal(i,d),r.height,d),d=t.add(i,d,d);for(var a=new e(d,r.semiMajorAxis),u=o.computeEllipsePositions(r,!1,!0).outerPositions,s=new c({position:new E({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:o.raisePositionsToHeight(u,r,!1)})}),l=u.length/3,T=_.createTypedArray(l,2*l),R=0,f=0;f<l;++f)T[R++]=f,T[R++]=(f+1)%l;return{boundingSphere:a,attributes:s,indices:T}}function f(i){var a=i.center,u=i.ellipsoid,s=i.semiMajorAxis,T=t.multiplyByScalar(u.geodeticSurfaceNormal(a,h),i.height,h);N.center=t.add(a,T,N.center),N.radius=s,T=t.multiplyByScalar(u.geodeticSurfaceNormal(a,T),i.extrudedHeight,T),I.center=t.add(a,T,I.center),I.radius=s;var R=o.computeEllipsePositions(i,!1,!0).outerPositions,f=new c({position:new E({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:o.raisePositionsToHeight(R,i,!0)})});R=f.position.values;var A=e.union(N,I),d=R.length/3,S=r(i.numberOfVerticalLines,16);S=l.clamp(S,0,d/2);var M=_.createTypedArray(d,2*d+2*S);d/=2;var y,m=0;for(y=0;y<d;++y)M[m++]=y,M[m++]=(y+1)%d,M[m++]=y+d,M[m++]=(y+1)%d+d;var O;if(S>0){var p=Math.min(S,d);O=Math.round(d/p);var C=Math.min(O*S,d);for(y=0;y<C;y+=O)M[m++]=y,M[m++]=y+d}return{boundingSphere:A,attributes:f,indices:M}}function A(e){e=r(e,r.EMPTY_OBJECT);var n=e.center,a=r(e.ellipsoid,u.WGS84),o=e.semiMajorAxis,s=e.semiMinorAxis,E=r(e.granularity,l.RADIANS_PER_DEGREE),c=r(e.height,0),_=e.extrudedHeight,T=i(_)&&Math.abs(c-_)>1;this._center=t.clone(n),this._semiMajorAxis=o,this._semiMinorAxis=s,this._ellipsoid=u.clone(a),this._rotation=r(e.rotation,0),this._height=c,this._granularity=E,this._extrudedHeight=_,this._extrude=T,this._numberOfVerticalLines=Math.max(r(e.numberOfVerticalLines,16),0),this._workerName="createEllipseOutlineGeometry"}var h=new t,d=new t,N=new e,I=new e;A.packedLength=t.packedLength+u.packedLength+9,A.pack=function(e,n,a){return a=r(a,0),t.pack(e._center,n,a),a+=t.packedLength,u.pack(e._ellipsoid,n,a),a+=u.packedLength,n[a++]=e._semiMajorAxis,n[a++]=e._semiMinorAxis,n[a++]=e._rotation,n[a++]=e._height,n[a++]=e._granularity,n[a++]=i(e._extrudedHeight)?1:0,n[a++]=r(e._extrudedHeight,0),n[a++]=e._extrude?1:0,n[a]=e._numberOfVerticalLines,n};var S=new t,M=new u,y={center:S,ellipsoid:M,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0};return A.unpack=function(e,n,a){n=r(n,0);var o=t.unpack(e,n,S);n+=t.packedLength;var s=u.unpack(e,n,M);n+=u.packedLength;var E=e[n++],c=e[n++],_=e[n++],l=e[n++],T=e[n++],R=e[n++],f=e[n++],h=1===e[n++],d=e[n];return i(a)?(a._center=t.clone(o,a._center),a._ellipsoid=u.clone(s,a._ellipsoid),a._semiMajorAxis=E,a._semiMinorAxis=c,a._rotation=_,a._height=l,a._granularity=T,a._extrudedHeight=R?f:void 0,a._extrude=h,a._numberOfVerticalLines=d,a):(y.height=l,y.extrudedHeight=R?f:void 0,y.granularity=T,y.rotation=_,y.semiMajorAxis=E,y.semiMinorAxis=c,y.numberOfVerticalLines=d,new A(y))},A.createGeometry=function(e){if(!(e._semiMajorAxis<=0||e._semiMinorAxis<=0)){e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);var t,n={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:e._height,extrudedHeight:e._extrudedHeight,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines};return e._extrude?(n.extrudedHeight=Math.min(e._extrudedHeight,e._height),n.height=Math.max(e._extrudedHeight,e._height),t=f(n)):t=R(n),new s({attributes:t.attributes,indices:t.indices,primitiveType:T.LINES,boundingSphere:t.boundingSphere})}},A}),define("Workers/createEllipseOutlineGeometry",["../Core/Cartesian3","../Core/defined","../Core/EllipseOutlineGeometry","../Core/Ellipsoid"],function(e,t,n,r){"use strict";function i(i,a){return t(a)&&(i=n.unpack(i,a)),i._center=e.clone(i._center),i._ellipsoid=r.clone(i._ellipsoid),n.createGeometry(i)}return i})}(); \ No newline at end of file diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createEllipsoidGeometry.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createEllipsoidGeometry.js index 6bb182ea..344fd7c3 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createEllipsoidGeometry.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createEllipsoidGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,6 +55,6 @@ mersenne-twister.js - https://gist.github.com/banksean/300494 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -!function(){define("Core/defined",[],function(){"use strict";function t(t){return void 0!==t&&null!==t}return t}),define("Core/freezeObject",["./defined"],function(t){"use strict";var e=Object.freeze;return t(e)||(e=function(t){return t}),e}),define("Core/defaultValue",["./freezeObject"],function(t){"use strict";function e(t,e){return void 0!==t?t:e}return e.EMPTY_OBJECT=t({}),e}),define("Core/DeveloperError",["./defined"],function(t){"use strict";function e(t){this.name="DeveloperError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e.throwInstantiationError=function(){throw new e("This function defines an interface and should not be called directly.")},e}),define("Core/isArray",["./defined"],function(t){"use strict";var e=Array.isArray;return t(e)||(e=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),e}),define("Core/Check",["./defaultValue","./defined","./DeveloperError","./isArray"],function(t,e,n,r){"use strict";function i(t){return t+" was required but undefined."}function a(t,e,n){return"Expected "+n+" to be typeof "+e+", got "+t}var o={};return o.typeOf={},o.numeric={},o.defined=function(t,r){if(!e(t))throw new n(i(r))},o.numeric.maximum=function(t,e){if(o.typeOf.number(t),o.typeOf.number(e),t>e)throw new n("Expected "+t+" to be at most "+e)},o.numeric.minimum=function(t,e){if(o.typeOf.number(t),o.typeOf.number(e),t<e)throw new n("Expected "+t+" to be at least "+e)},o.typeOf.function=function(t,e){if("function"!=typeof t)throw new n(a(typeof t,"function",e))},o.typeOf.string=function(t,e){if("string"!=typeof t)throw new n(a(typeof t,"string",e))},o.typeOf.number=function(t,e){if("number"!=typeof t)throw new n(a(typeof t,"number",e))},o.typeOf.object=function(t,e){if("object"!=typeof t)throw new n(a(typeof t,"object",e))},o.typeOf.boolean=function(t,e){if("boolean"!=typeof t)throw new n(a(typeof t,"boolean",e))},o}),define("ThirdParty/mersenne-twister",[],function(){var t=function(t){void 0==t&&(t=(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(t)};return t.prototype.init_genrand=function(t){for(this.mt[0]=t>>>0,this.mti=1;this.mti<this.N;this.mti++){var t=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&t)>>>16)<<16)+1812433253*(65535&t)+this.mti,this.mt[this.mti]>>>=0}},t.prototype.genrand_int32=function(){var t,e=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)t=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^t>>>1^e[1&t];for(;n<this.N-1;n++)t=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^t>>>1^e[1&t];t=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^t>>>1^e[1&t],this.mti=0}return t=this.mt[this.mti++],t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,t^=t>>>18,t>>>0},t.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},t}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(t,e,n,r){"use strict";var i={};i.EPSILON1=.1,i.EPSILON2=.01,i.EPSILON3=.001,i.EPSILON4=1e-4,i.EPSILON5=1e-5,i.EPSILON6=1e-6,i.EPSILON7=1e-7,i.EPSILON8=1e-8,i.EPSILON9=1e-9,i.EPSILON10=1e-10,i.EPSILON11=1e-11,i.EPSILON12=1e-12,i.EPSILON13=1e-13,i.EPSILON14=1e-14,i.EPSILON15=1e-15,i.EPSILON16=1e-16,i.EPSILON17=1e-17,i.EPSILON18=1e-18,i.EPSILON19=1e-19,i.EPSILON20=1e-20,i.GRAVITATIONALPARAMETER=3986004418e5,i.SOLAR_RADIUS=6955e5,i.LUNAR_RADIUS=1737400,i.SIXTY_FOUR_KILOBYTES=65536,i.sign=function(t){return t>0?1:t<0?-1:0},i.signNotZero=function(t){return t<0?-1:1},i.toSNorm=function(t,n){return n=e(n,255),Math.round((.5*i.clamp(t,-1,1)+.5)*n)},i.fromSNorm=function(t,n){return n=e(n,255),i.clamp(t,0,n)/n*2-1},i.sinh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e-n)},i.cosh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e+n)},i.lerp=function(t,e,n){return(1-n)*t+n*e},i.PI=Math.PI,i.ONE_OVER_PI=1/Math.PI,i.PI_OVER_TWO=.5*Math.PI,i.PI_OVER_THREE=Math.PI/3,i.PI_OVER_FOUR=Math.PI/4,i.PI_OVER_SIX=Math.PI/6,i.THREE_PI_OVER_TWO=3*Math.PI*.5,i.TWO_PI=2*Math.PI,i.ONE_OVER_TWO_PI=1/(2*Math.PI),i.RADIANS_PER_DEGREE=Math.PI/180,i.DEGREES_PER_RADIAN=180/Math.PI,i.RADIANS_PER_ARCSECOND=i.RADIANS_PER_DEGREE/3600,i.toRadians=function(t){return t*i.RADIANS_PER_DEGREE},i.toDegrees=function(t){return t*i.DEGREES_PER_RADIAN},i.convertLongitudeRange=function(t){var e=i.TWO_PI,n=t-Math.floor(t/e)*e;return n<-Math.PI?n+e:n>=Math.PI?n-e:n},i.clampToLatitudeRange=function(t){return i.clamp(t,-1*i.PI_OVER_TWO,i.PI_OVER_TWO)},i.negativePiToPi=function(t){return i.zeroToTwoPi(t+i.PI)-i.PI},i.zeroToTwoPi=function(t){var e=i.mod(t,i.TWO_PI);return Math.abs(e)<i.EPSILON14&&Math.abs(t)>i.EPSILON14?i.TWO_PI:e},i.mod=function(t,e){return(t%e+e)%e},i.equalsEpsilon=function(t,n,r,i){i=e(i,r);var a=Math.abs(t-n);return a<=i||a<=r*Math.max(Math.abs(t),Math.abs(n))};var a=[1];i.factorial=function(t){var e=a.length;if(t>=e)for(var n=a[e-1],r=e;r<=t;r++)a.push(n*r);return a[t]},i.incrementWrap=function(t,n,r){return r=e(r,0),++t,t>n&&(t=r),t},i.isPowerOfTwo=function(t){return 0!==t&&0===(t&t-1)},i.nextPowerOfTwo=function(t){return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t,t},i.clamp=function(t,e,n){return t<e?e:t>n?n:t};var o=new t;return i.setRandomNumberSeed=function(e){o=new t(e)},i.nextRandomNumber=function(){return o.random()},i.acosClamped=function(t){return Math.acos(i.clamp(t,-1,1))},i.asinClamped=function(t){return Math.asin(i.clamp(t,-1,1))},i.chordLength=function(t,e){return 2*e*Math.sin(.5*t)},i.logBase=function(t,e){return Math.log(t)/Math.log(e)},i.fog=function(t,e){var n=t*e;return 1-Math.exp(-(n*n))},i}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a){"use strict";function o(t,n,r){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0)}o.fromSpherical=function(t,r){n(r)||(r=new o);var i=t.clock,a=t.cone,u=e(t.magnitude,1),E=u*Math.sin(a);return r.x=E*Math.cos(i),r.y=E*Math.sin(i),r.z=u*Math.cos(a),r},o.fromElements=function(t,e,r,i){return n(i)?(i.x=t,i.y=e,i.z=r,i):new o(t,e,r)},o.clone=function(t,e){if(n(t))return n(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e):new o(t.x,t.y,t.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r]=t.z,n},o.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new o),i.x=t[r++],i.y=t[r++],i.z=t[r],i},o.packArray=function(t,e){var r=t.length;n(e)?e.length=3*r:e=new Array(3*r);for(var i=0;i<r;++i)o.pack(t[i],e,3*i);return e},o.unpackArray=function(t,e){var r=t.length;n(e)?e.length=r/3:e=new Array(r/3);for(var i=0;i<r;i+=3){var a=i/3;e[a]=o.unpack(t,i,e[a])}return e},o.fromArray=o.unpack,o.maximumComponent=function(t){return Math.max(t.x,t.y,t.z)},o.minimumComponent=function(t){return Math.min(t.x,t.y,t.z)},o.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n.z=Math.min(t.z,e.z),n},o.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n.z=Math.max(t.z,e.z),n},o.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z},o.magnitude=function(t){return Math.sqrt(o.magnitudeSquared(t))};var u=new o;o.distance=function(t,e){return o.subtract(t,e,u),o.magnitude(u)},o.distanceSquared=function(t,e){return o.subtract(t,e,u),o.magnitudeSquared(u)},o.normalize=function(t,e){var n=o.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e},o.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},o.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n.z=t.z*e.z,n},o.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n.z=t.z/e.z,n},o.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n},o.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n},o.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*e,n},o.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n},o.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e},o.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e};var E=new o;o.lerp=function(t,e,n,r){return o.multiplyByScalar(e,n,E),r=o.multiplyByScalar(t,1-n,r),o.add(E,r,r)};var s=new o,c=new o;o.angleBetween=function(t,e){o.normalize(t,s),o.normalize(e,c);var n=o.dot(s,c),r=o.magnitude(o.cross(s,c,s));return Math.atan2(r,n)};var _=new o;o.mostOrthogonalAxis=function(t,e){var n=o.normalize(t,_);return o.abs(n,n),e=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,e):o.clone(o.UNIT_Z,e):n.y<=n.z?o.clone(o.UNIT_Y,e):o.clone(o.UNIT_Z,e)},o.equals=function(t,e){return t===e||n(t)&&n(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z},o.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]},o.equalsEpsilon=function(t,e,r,i){return t===e||n(t)&&n(e)&&a.equalsEpsilon(t.x,e.x,r,i)&&a.equalsEpsilon(t.y,e.y,r,i)&&a.equalsEpsilon(t.z,e.z,r,i)},o.cross=function(t,e,n){var r=t.x,i=t.y,a=t.z,o=e.x,u=e.y,E=e.z,s=i*E-a*u,c=a*o-r*E,_=r*u-i*o;return n.x=s,n.y=c,n.z=_,n},o.fromDegrees=function(t,e,n,r,i){return t=a.toRadians(t),e=a.toRadians(e),o.fromRadians(t,e,n,r,i)};var T=new o,l=new o,R=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(t,r,i,a,u){i=e(i,0);var E=n(a)?a.radiiSquared:R,s=Math.cos(r);T.x=s*Math.cos(t),T.y=s*Math.sin(t),T.z=Math.sin(r),T=o.normalize(T,T),o.multiplyComponents(E,T,l);var c=Math.sqrt(o.dot(T,l));return l=o.divideByScalar(l,c,l),T=o.multiplyByScalar(T,i,T),n(u)||(u=new o),o.add(l,T,u)},o.fromDegreesArray=function(t,e,r){var i=t.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=t[a],E=t[a+1],s=a/2;r[s]=o.fromDegrees(u,E,0,e,r[s])}return r},o.fromRadiansArray=function(t,e,r){var i=t.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=t[a],E=t[a+1],s=a/2;r[s]=o.fromRadians(u,E,0,e,r[s])}return r},o.fromDegreesArrayHeights=function(t,e,r){var i=t.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=t[a],E=t[a+1],s=t[a+2],c=a/3;r[c]=o.fromDegrees(u,E,s,e,r[c])}return r},o.fromRadiansArrayHeights=function(t,e,r){var i=t.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=t[a],E=t[a+1],s=t[a+2],c=a/3;r[c]=o.fromRadians(u,E,s,e,r[c])}return r},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(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.prototype.equalsEpsilon=function(t,e,n){return o.equalsEpsilon(this,t,e,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(t,e,n,r){"use strict";function i(n,i,u,E,s){var c=n.x,_=n.y,T=n.z,l=i.x,R=i.y,f=i.z,A=c*c*l*l,N=_*_*R*R,h=T*T*f*f,d=A+N+h,I=Math.sqrt(1/d),S=t.multiplyByScalar(n,I,a);if(d<E)return isFinite(I)?t.clone(S,s):void 0;var m=u.x,M=u.y,O=u.z,y=o;y.x=S.x*m*2,y.y=S.y*M*2,y.z=S.z*O*2;var p,C,U,L,F,P,v,w,g,x,D,B=(1-I)*t.magnitude(n)/(.5*t.magnitude(y)),z=0;do{B-=z,U=1/(1+B*m),L=1/(1+B*M),F=1/(1+B*O),P=U*U,v=L*L,w=F*F,g=P*U,x=v*L,D=w*F,p=A*P+N*v+h*w-1,C=A*g*m+N*x*M+h*D*O;var G=-2*C;z=p/G}while(Math.abs(p)>r.EPSILON12);return e(s)?(s.x=c*U,s.y=_*L,s.z=T*F,s):new t(c*U,_*L,T*F)}var a=new t,o=new t;return i}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,n,r,i,a,o){"use strict";function u(t,n,r){this.longitude=e(t,0),this.latitude=e(n,0),this.height=e(r,0)}u.fromRadians=function(t,r,i,a){return i=e(i,0),n(a)?(a.longitude=t,a.latitude=r,a.height=i,a):new u(t,r,i)},u.fromDegrees=function(t,e,n,r){return t=a.toRadians(t),e=a.toRadians(e),u.fromRadians(t,e,n,r)};var E=new t,s=new t,c=new t,_=new t(1/6378137,1/6378137,1/6356752.314245179),T=new t(1/40680631590769,1/40680631590769,1/40408299984661.445),l=a.EPSILON1;return u.fromCartesian=function(e,r,i){var R=n(r)?r.oneOverRadii:_,f=n(r)?r.oneOverRadiiSquared:T,A=n(r)?r._centerToleranceSquared:l,N=o(e,R,f,A,s);if(n(N)){var h=t.multiplyComponents(N,f,E);h=t.normalize(h,h);var d=t.subtract(e,N,c),I=Math.atan2(h.y,h.x),S=Math.asin(h.z),m=a.sign(t.dot(d,e))*t.magnitude(d);return n(i)?(i.longitude=I,i.latitude=S,i.height=m,i):new u(I,S,m)}},u.clone=function(t,e){if(n(t))return n(e)?(e.longitude=t.longitude,e.latitude=t.latitude,e.height=t.height,e):new u(t.longitude,t.latitude,t.height)},u.equals=function(t,e){return t===e||n(t)&&n(e)&&t.longitude===e.longitude&&t.latitude===e.latitude&&t.height===e.height},u.equalsEpsilon=function(t,e,r){return t===e||n(t)&&n(e)&&Math.abs(t.longitude-e.longitude)<=r&&Math.abs(t.latitude-e.latitude)<=r&&Math.abs(t.height-e.height)<=r},u.ZERO=i(new u(0,0,0)),u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.prototype.equalsEpsilon=function(t,e){return u.equalsEpsilon(this,t,e)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(t){"use strict";var e=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(t){return!1}}(),n=Object.defineProperties;return e&&t(n)||(n=function(t){return t}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,n,r,i,a,o,u,E){"use strict";function s(e,r,i,a){r=n(r,0),i=n(i,0),a=n(a,0),e._radii=new t(r,i,a),e._radiiSquared=new t(r*r,i*i,a*a),e._radiiToTheFourth=new t(r*r*r*r,i*i*i*i,a*a*a*a),e._oneOverRadii=new t(0===r?0:1/r,0===i?0:1/i,0===a?0:1/a),e._oneOverRadiiSquared=new t(0===r?0:1/(r*r),0===i?0:1/(i*i),0===a?0:1/(a*a)),e._minimumRadius=Math.min(r,i,a),e._maximumRadius=Math.max(r,i,a),e._centerToleranceSquared=u.EPSILON1,0!==e._radiiSquared.z&&(e._sqauredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function c(t,e,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,s(this,t,e,n)}i(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(e,n){if(r(e)){var i=e._radii;return r(n)?(t.clone(i,n._radii),t.clone(e._radiiSquared,n._radiiSquared),t.clone(e._radiiToTheFourth,n._radiiToTheFourth),t.clone(e._oneOverRadii,n._oneOverRadii),t.clone(e._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=e._minimumRadius,n._maximumRadius=e._maximumRadius,n._centerToleranceSquared=e._centerToleranceSquared,n):new c(i.x,i.y,i.z)}},c.fromCartesian3=function(t,e){return r(e)||(e=new c),r(t)?(s(e,t.x,t.y,t.z),e):e},c.WGS84=o(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=o(new c(1,1,1)),c.MOON=o(new c(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),c.prototype.clone=function(t){return c.clone(this,t)},c.packedLength=t.packedLength,c.pack=function(e,r,i){return i=n(i,0),t.pack(e._radii,r,i),r},c.unpack=function(e,r,i){r=n(r,0);var a=t.unpack(e,r);return c.fromCartesian3(a,i)},c.prototype.geocentricSurfaceNormal=t.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(e,n){var i=e.longitude,a=e.latitude,o=Math.cos(a),u=o*Math.cos(i),E=o*Math.sin(i),s=Math.sin(a);return r(n)||(n=new t),n.x=u,n.y=E,n.z=s,t.normalize(n,n)},c.prototype.geodeticSurfaceNormal=function(e,n){return r(n)||(n=new t),n=t.multiplyComponents(e,this._oneOverRadiiSquared,n),t.normalize(n,n)};var _=new t,T=new t;c.prototype.cartographicToCartesian=function(e,n){var i=_,a=T;this.geodeticSurfaceNormalCartographic(e,i),t.multiplyComponents(this._radiiSquared,i,a);var o=Math.sqrt(t.dot(i,a));return t.divideByScalar(a,o,a),t.multiplyByScalar(i,e.height,i),r(n)||(n=new t),t.add(a,i,n)},c.prototype.cartographicArrayToCartesianArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var i=0;i<n;i++)e[i]=this.cartographicToCartesian(t[i],e[i]);return e};var l=new t,R=new t,f=new t;return c.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,R);if(r(a)){var o=this.geodeticSurfaceNormal(a,l),E=t.subtract(n,a,f),s=Math.atan2(o.y,o.x),c=Math.asin(o.z),_=u.sign(t.dot(E,n))*t.magnitude(E);return r(i)?(i.longitude=s,i.latitude=c,i.height=_,i):new e(s,c,_)}},c.prototype.cartesianArrayToCartographicArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var i=0;i<n;++i)e[i]=this.cartesianToCartographic(t[i],e[i]);return e},c.prototype.scaleToGeodeticSurface=function(t,e){return E(t,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,e)},c.prototype.scaleToGeocentricSurface=function(e,n){r(n)||(n=new t);var i=e.x,a=e.y,o=e.z,u=this._oneOverRadiiSquared,E=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*u.z);return t.multiplyByScalar(e,E,n)},c.prototype.transformPositionToScaledSpace=function(e,n){return r(n)||(n=new t),t.multiplyComponents(e,this._oneOverRadii,n)},c.prototype.transformPositionFromScaledSpace=function(e,n){return r(n)||(n=new t),t.multiplyComponents(e,this._radii,n)},c.prototype.equals=function(e){return this===e||r(e)&&t.equals(this._radii,e._radii)},c.prototype.toString=function(){return this._radii.toString()},c.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,i,a){i=n(i,0);var o=this._sqauredXOverSquaredZ;if(r(a)||(a=new t),a.x=0,a.y=0,a.z=e.z*(1-o),!(Math.abs(a.z)>=this._radii.z-i))return a},c}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(t,e,n,r,i,a,o){"use strict";function u(t){this._ellipsoid=n(t,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return i(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(e,n){var i=this._semimajorAxis,a=e.longitude*i,o=e.latitude*i,u=e.height;return r(n)?(n.x=a,n.y=o,n.z=u,n):new t(a,o,u)},u.prototype.unproject=function(t,n){var i=this._oneOverSemimajorAxis,a=t.x*i,o=t.y*i,u=t.z;return r(n)?(n.longitude=a,n.latitude=o,n.height=u,n):new e(a,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(t){"use strict";var e={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return t(e)}),define("Core/Interval",["./defaultValue"],function(t){"use strict";function e(e,n){this.start=t(e,0),this.stop=t(n,0)}return e}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a,o){"use strict";function u(t,n,r,i,a,o,u,E,s){this[0]=e(t,0),this[1]=e(i,0),this[2]=e(u,0),this[3]=e(n,0),this[4]=e(a,0),this[5]=e(E,0),this[6]=e(r,0),this[7]=e(o,0),this[8]=e(s,0)}function E(t){for(var e=0,n=0;n<9;++n){var r=t[n];e+=r*r}return Math.sqrt(e)}function s(t){for(var e=0,n=0;n<3;++n){var r=t[u.getElementIndex(R[n],l[n])];e+=2*r*r}return Math.sqrt(e)}function c(t,e){for(var n=o.EPSILON15,r=0,i=1,a=0;a<3;++a){var E=Math.abs(t[u.getElementIndex(R[a],l[a])]);E>r&&(i=a,r=E)}var s=1,c=0,_=l[i],T=R[i];if(Math.abs(t[u.getElementIndex(T,_)])>n){var f,A=t[u.getElementIndex(T,T)],N=t[u.getElementIndex(_,_)],h=t[u.getElementIndex(T,_)],d=(A-N)/2/h;f=d<0?-1/(-d+Math.sqrt(1+d*d)):1/(d+Math.sqrt(1+d*d)),s=1/Math.sqrt(1+f*f),c=f*s}return e=u.clone(u.IDENTITY,e),e[u.getElementIndex(_,_)]=e[u.getElementIndex(T,T)]=s,e[u.getElementIndex(T,_)]=c,e[u.getElementIndex(_,T)]=-c,e}u.packedLength=9,u.pack=function(t,n,r){return r=e(r,0),n[r++]=t[0],n[r++]=t[1],n[r++]=t[2],n[r++]=t[3],n[r++]=t[4],n[r++]=t[5],n[r++]=t[6],n[r++]=t[7],n[r++]=t[8],n},u.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new u),i[0]=t[r++],i[1]=t[r++],i[2]=t[r++],i[3]=t[r++],i[4]=t[r++],i[5]=t[r++],i[6]=t[r++],i[7]=t[r++],i[8]=t[r++],i},u.clone=function(t,e){if(n(t))return n(e)?(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):new u(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8])},u.fromArray=function(t,r,i){return r=e(r,0),n(i)||(i=new u),i[0]=t[r],i[1]=t[r+1],i[2]=t[r+2],i[3]=t[r+3],i[4]=t[r+4],i[5]=t[r+5],i[6]=t[r+6],i[7]=t[r+7],i[8]=t[r+8],i},u.fromColumnMajorArray=function(t,e){return u.clone(t,e)},u.fromRowMajorArray=function(t,e){return n(e)?(e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],e):new u(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},u.fromQuaternion=function(t,e){var r=t.x*t.x,i=t.x*t.y,a=t.x*t.z,o=t.x*t.w,E=t.y*t.y,s=t.y*t.z,c=t.y*t.w,_=t.z*t.z,T=t.z*t.w,l=t.w*t.w,R=r-E-_+l,f=2*(i-T),A=2*(a+c),N=2*(i+T),h=-r+E-_+l,d=2*(s-o),I=2*(a-c),S=2*(s+o),m=-r-E+_+l;return n(e)?(e[0]=R,e[1]=N,e[2]=I,e[3]=f,e[4]=h,e[5]=S,e[6]=A,e[7]=d,e[8]=m,e):new u(R,f,A,N,h,d,I,S,m)},u.fromHeadingPitchRoll=function(t,e){var r=Math.cos(-t.pitch),i=Math.cos(-t.heading),a=Math.cos(t.roll),o=Math.sin(-t.pitch),E=Math.sin(-t.heading),s=Math.sin(t.roll),c=r*i,_=-a*E+s*o*i,T=s*E+a*o*i,l=r*E,R=a*i+s*o*E,f=-o*a+a*o*E,A=-o,N=s*r,h=a*r;return n(e)?(e[0]=c,e[1]=l,e[2]=A,e[3]=_,e[4]=R,e[5]=N,e[6]=T,e[7]=f,e[8]=h,e):new u(c,_,T,l,R,f,A,N,h)},u.fromScale=function(t,e){return n(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=t.y,e[5]=0,e[6]=0,e[7]=0,e[8]=t.z,e):new u(t.x,0,0,0,t.y,0,0,0,t.z)},u.fromUniformScale=function(t,e){return n(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=t,e[5]=0,e[6]=0,e[7]=0,e[8]=t,e):new u(t,0,0,0,t,0,0,0,t)},u.fromCrossProduct=function(t,e){return n(e)?(e[0]=0,e[1]=t.z,e[2]=-t.y,e[3]=-t.z,e[4]=0,e[5]=t.x,e[6]=t.y,e[7]=-t.x,e[8]=0,e):new u(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},u.fromRotationX=function(t,e){var r=Math.cos(t),i=Math.sin(t);return n(e)?(e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=r,e[5]=i,e[6]=0,e[7]=-i,e[8]=r,e):new u(1,0,0,0,r,-i,0,i,r)},u.fromRotationY=function(t,e){var r=Math.cos(t),i=Math.sin(t);return n(e)?(e[0]=r,e[1]=0,e[2]=-i,e[3]=0,e[4]=1,e[5]=0,e[6]=i,e[7]=0,e[8]=r,e):new u(r,0,i,0,1,0,-i,0,r)},u.fromRotationZ=function(t,e){var r=Math.cos(t),i=Math.sin(t);return n(e)?(e[0]=r,e[1]=i,e[2]=0,e[3]=-i,e[4]=r,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e):new u(r,-i,0,i,r,0,0,0,1)},u.toArray=function(t,e){return n(e)?(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):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},u.getElementIndex=function(t,e){return 3*t+e},u.getColumn=function(t,e,n){var r=3*e,i=t[r],a=t[r+1],o=t[r+2];return n.x=i,n.y=a,n.z=o,n},u.setColumn=function(t,e,n,r){r=u.clone(t,r);var i=3*e;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},u.getRow=function(t,e,n){var r=t[e],i=t[e+3],a=t[e+6];return n.x=r,n.y=i,n.z=a,n},u.setRow=function(t,e,n,r){return r=u.clone(t,r),r[e]=n.x,r[e+3]=n.y,r[e+6]=n.z,r};var _=new t;u.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],_)),n.y=t.magnitude(t.fromElements(e[3],e[4],e[5],_)),n.z=t.magnitude(t.fromElements(e[6],e[7],e[8],_)),n};var T=new t;u.getMaximumScale=function(e){return u.getScale(e,T),t.maximumComponent(T)},u.multiply=function(t,e,n){var r=t[0]*e[0]+t[3]*e[1]+t[6]*e[2],i=t[1]*e[0]+t[4]*e[1]+t[7]*e[2],a=t[2]*e[0]+t[5]*e[1]+t[8]*e[2],o=t[0]*e[3]+t[3]*e[4]+t[6]*e[5],u=t[1]*e[3]+t[4]*e[4]+t[7]*e[5],E=t[2]*e[3]+t[5]*e[4]+t[8]*e[5],s=t[0]*e[6]+t[3]*e[7]+t[6]*e[8],c=t[1]*e[6]+t[4]*e[7]+t[7]*e[8],_=t[2]*e[6]+t[5]*e[7]+t[8]*e[8];return n[0]=r,n[1]=i,n[2]=a,n[3]=o,n[4]=u,n[5]=E,n[6]=s,n[7]=c,n[8]=_,n},u.add=function(t,e,n){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n[4]=t[4]+e[4],n[5]=t[5]+e[5],n[6]=t[6]+e[6],n[7]=t[7]+e[7],n[8]=t[8]+e[8],n},u.subtract=function(t,e,n){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n[4]=t[4]-e[4],n[5]=t[5]-e[5],n[6]=t[6]-e[6],n[7]=t[7]-e[7],n[8]=t[8]-e[8],n},u.multiplyByVector=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=t[0]*r+t[3]*i+t[6]*a,u=t[1]*r+t[4]*i+t[7]*a,E=t[2]*r+t[5]*i+t[8]*a;return n.x=o,n.y=u,n.z=E,n},u.multiplyByScalar=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n[4]=t[4]*e,n[5]=t[5]*e,n[6]=t[6]*e,n[7]=t[7]*e,n[8]=t[8]*e,n},u.multiplyByScale=function(t,e,n){return n[0]=t[0]*e.x,n[1]=t[1]*e.x,n[2]=t[2]*e.x,n[3]=t[3]*e.y,n[4]=t[4]*e.y,n[5]=t[5]*e.y,n[6]=t[6]*e.z,n[7]=t[7]*e.z,n[8]=t[8]*e.z,n},u.negate=function(t,e){return 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},u.transpose=function(t,e){var n=t[0],r=t[3],i=t[6],a=t[1],o=t[4],u=t[7],E=t[2],s=t[5],c=t[8];return e[0]=n,e[1]=r,e[2]=i,e[3]=a,e[4]=o,e[5]=u,e[6]=E,e[7]=s,e[8]=c,e};var l=[1,0,0],R=[2,2,1],f=new u,A=new u;return u.computeEigenDecomposition=function(t,e){var r=o.EPSILON20,i=10,a=0,_=0;n(e)||(e={});for(var T=e.unitary=u.clone(u.IDENTITY,e.unitary),l=e.diagonal=u.clone(t,e.diagonal),R=r*E(l);_<i&&s(l)>R;)c(l,f),u.transpose(f,A),u.multiply(l,f,l),u.multiply(A,l,l),u.multiply(T,f,T),++a>2&&(++_,a=0);return e},u.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e},u.determinant=function(t){var e=t[0],n=t[3],r=t[6],i=t[1],a=t[4],o=t[7],u=t[2],E=t[5],s=t[8];return e*(a*s-E*o)+i*(E*r-n*s)+u*(n*o-a*r)},u.inverse=function(t,e){var n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],E=t[5],s=t[6],c=t[7],_=t[8],T=u.determinant(t);e[0]=o*_-c*E,e[1]=c*i-r*_,e[2]=r*E-o*i,e[3]=s*E-a*_,e[4]=n*_-s*i,e[5]=a*i-n*E,e[6]=a*c-s*o,e[7]=s*r-n*c,e[8]=n*o-a*r;var l=1/T;return u.multiplyByScalar(e,l,e)},u.equals=function(t,e){return t===e||n(t)&&n(e)&&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]},u.equalsEpsilon=function(t,e,r){return t===e||n(t)&&n(e)&&Math.abs(t[0]-e[0])<=r&&Math.abs(t[1]-e[1])<=r&&Math.abs(t[2]-e[2])<=r&&Math.abs(t[3]-e[3])<=r&&Math.abs(t[4]-e[4])<=r&&Math.abs(t[5]-e[5])<=r&&Math.abs(t[6]-e[6])<=r&&Math.abs(t[7]-e[7])<=r&&Math.abs(t[8]-e[8])<=r},u.IDENTITY=a(new u(1,0,0,0,1,0,0,0,1)),u.ZERO=a(new u(0,0,0,0,0,0,0,0,0)),u.COLUMN0ROW0=0,u.COLUMN0ROW1=1,u.COLUMN0ROW2=2,u.COLUMN1ROW0=3,u.COLUMN1ROW1=4,u.COLUMN1ROW2=5,u.COLUMN2ROW0=6,u.COLUMN2ROW1=7,u.COLUMN2ROW2=8,r(u.prototype,{length:{get:function(){return u.packedLength}}}),u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]&&t[4]===e[n+4]&&t[5]===e[n+5]&&t[6]===e[n+6]&&t[7]===e[n+7]&&t[8]===e[n+8]},u.prototype.equalsEpsilon=function(t,e){return u.equalsEpsilon(this,t,e)},u.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},u}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i){"use strict";function a(e,n,r,i){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(i,0)}a.fromElements=function(t,n,r,i,o){return e(o)?(o.x=t,o.y=n,o.z=r,o.w=i,o):new a(t,n,r,i)},a.fromColor=function(t,n){return e(n)?(n.x=t.red,n.y=t.green,n.z=t.blue,n.w=t.alpha,n):new a(t.red,t.green,t.blue,t.alpha)},a.clone=function(t,n){if(e(t))return e(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n.w=t.w,n):new a(t.x,t.y,t.z,t.w)},a.packedLength=4,a.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},a.unpack=function(n,r,i){return r=t(r,0),e(i)||(i=new a),i.x=n[r++],i.y=n[r++],i.z=n[r++],i.w=n[r],i},a.packArray=function(t,n){var r=t.length;e(n)?n.length=4*r:n=new Array(4*r);for(var i=0;i<r;++i)a.pack(t[i],n,4*i);return n},a.unpackArray=function(t,n){var r=t.length;e(n)?n.length=r/4:n=new Array(r/4);for(var i=0;i<r;i+=4){var o=i/4;n[o]=a.unpack(t,i,n[o])}return n},a.fromArray=a.unpack,a.maximumComponent=function(t){return Math.max(t.x,t.y,t.z,t.w)},a.minimumComponent=function(t){return Math.min(t.x,t.y,t.z,t.w)},a.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n.z=Math.min(t.z,e.z),n.w=Math.min(t.w,e.w),n},a.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n.z=Math.max(t.z,e.z),n.w=Math.max(t.w,e.w),n},a.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w},a.magnitude=function(t){return Math.sqrt(a.magnitudeSquared(t))};var o=new a;a.distance=function(t,e){return a.subtract(t,e,o),a.magnitude(o)},a.distanceSquared=function(t,e){return a.subtract(t,e,o),a.magnitudeSquared(o)},a.normalize=function(t,e){var n=a.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e.w=t.w/n,e},a.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z+t.w*e.w},a.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n.z=t.z*e.z,n.w=t.w*e.w,n},a.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n.z=t.z/e.z,n.w=t.w/e.w,n},a.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n.w=t.w+e.w,n},a.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n.w=t.w-e.w,n},a.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*e,n.w=t.w*e,n},a.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n.w=t.w/e,n},a.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e.w=-t.w,e},a.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e.w=Math.abs(t.w),e};var u=new a;a.lerp=function(t,e,n,r){return a.multiplyByScalar(e,n,u),r=a.multiplyByScalar(t,1-n,r),a.add(u,r,r)};var E=new a;return a.mostOrthogonalAxis=function(t,e){var n=a.normalize(t,E);return a.abs(n,n),e=n.x<=n.y?n.x<=n.z?n.x<=n.w?a.clone(a.UNIT_X,e):a.clone(a.UNIT_W,e):n.z<=n.w?a.clone(a.UNIT_Z,e):a.clone(a.UNIT_W,e):n.y<=n.z?n.y<=n.w?a.clone(a.UNIT_Y,e):a.clone(a.UNIT_W,e):n.z<=n.w?a.clone(a.UNIT_Z,e):a.clone(a.UNIT_W,e)},a.equals=function(t,n){return t===n||e(t)&&e(n)&&t.x===n.x&&t.y===n.y&&t.z===n.z&&t.w===n.w},a.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]&&t.w===e[n+3]},a.equalsEpsilon=function(t,n,r,a){return t===n||e(t)&&e(n)&&i.equalsEpsilon(t.x,n.x,r,a)&&i.equalsEpsilon(t.y,n.y,r,a)&&i.equalsEpsilon(t.z,n.z,r,a)&&i.equalsEpsilon(t.w,n.w,r,a)},a.ZERO=r(new a(0,0,0,0)),a.UNIT_X=r(new a(1,0,0,0)),a.UNIT_Y=r(new a(0,1,0,0)),a.UNIT_Z=r(new a(0,0,1,0)),a.UNIT_W=r(new a(0,0,0,1)),a.prototype.clone=function(t){return a.clone(this,t)},a.prototype.equals=function(t){return a.equals(this,t)},a.prototype.equalsEpsilon=function(t,e,n){return a.equalsEpsilon(this,t,e,n)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},a}),define("Core/RuntimeError",["./defined"],function(t){"use strict";function e(t){this.name="RuntimeError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(t,e,n,r,i,a,o,u,E,s){"use strict";function c(t,e,r,i,a,o,u,E,s,c,_,T,l,R,f,A){this[0]=n(t,0),this[1]=n(a,0),this[2]=n(s,0),this[3]=n(l,0),this[4]=n(e,0), -this[5]=n(o,0),this[6]=n(c,0),this[7]=n(R,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(_,0),this[11]=n(f,0),this[12]=n(i,0),this[13]=n(E,0),this[14]=n(T,0),this[15]=n(A,0)}c.packedLength=16,c.pack=function(t,e,r){return r=n(r,0),e[r++]=t[0],e[r++]=t[1],e[r++]=t[2],e[r++]=t[3],e[r++]=t[4],e[r++]=t[5],e[r++]=t[6],e[r++]=t[7],e[r++]=t[8],e[r++]=t[9],e[r++]=t[10],e[r++]=t[11],e[r++]=t[12],e[r++]=t[13],e[r++]=t[14],e[r]=t[15],e},c.unpack=function(t,e,i){return e=n(e,0),r(i)||(i=new c),i[0]=t[e++],i[1]=t[e++],i[2]=t[e++],i[3]=t[e++],i[4]=t[e++],i[5]=t[e++],i[6]=t[e++],i[7]=t[e++],i[8]=t[e++],i[9]=t[e++],i[10]=t[e++],i[11]=t[e++],i[12]=t[e++],i[13]=t[e++],i[14]=t[e++],i[15]=t[e],i},c.clone=function(t,e){if(r(t))return r(e)?(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],e):new c(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15])},c.fromArray=c.unpack,c.fromColumnMajorArray=function(t,e){return c.clone(t,e)},c.fromRowMajorArray=function(t,e){return r(e)?(e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15],e):new c(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},c.fromRotationTranslation=function(e,i,a){return i=n(i,t.ZERO),r(a)?(a[0]=e[0],a[1]=e[1],a[2]=e[2],a[3]=0,a[4]=e[3],a[5]=e[4],a[6]=e[5],a[7]=0,a[8]=e[6],a[9]=e[7],a[10]=e[8],a[11]=0,a[12]=i.x,a[13]=i.y,a[14]=i.z,a[15]=1,a):new c(e[0],e[3],e[6],i.x,e[1],e[4],e[7],i.y,e[2],e[5],e[8],i.z,0,0,0,1)},c.fromTranslationQuaternionRotationScale=function(t,e,n,i){r(i)||(i=new c);var a=n.x,o=n.y,u=n.z,E=e.x*e.x,s=e.x*e.y,_=e.x*e.z,T=e.x*e.w,l=e.y*e.y,R=e.y*e.z,f=e.y*e.w,A=e.z*e.z,N=e.z*e.w,h=e.w*e.w,d=E-l-A+h,I=2*(s-N),S=2*(_+f),m=2*(s+N),M=-E+l-A+h,O=2*(R-T),y=2*(_-f),p=2*(R+T),C=-E-l+A+h;return i[0]=d*a,i[1]=m*a,i[2]=y*a,i[3]=0,i[4]=I*o,i[5]=M*o,i[6]=p*o,i[7]=0,i[8]=S*u,i[9]=O*u,i[10]=C*u,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,i},c.fromTranslationRotationScale=function(t,e){return c.fromTranslationQuaternionRotationScale(t.translation,t.rotation,t.scale,e)},c.fromTranslation=function(t,e){return c.fromRotationTranslation(E.IDENTITY,t,e)},c.fromScale=function(t,e){return r(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t.y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t.z,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new c(t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1)},c.fromUniformScale=function(t,e){return r(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new c(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1)};var _=new t,T=new t,l=new t;c.fromCamera=function(e,n){var i=e.position,a=e.direction,o=e.up;t.normalize(a,_),t.normalize(t.cross(_,o,T),T),t.normalize(t.cross(T,_,l),l);var u=T.x,E=T.y,s=T.z,R=_.x,f=_.y,A=_.z,N=l.x,h=l.y,d=l.z,I=i.x,S=i.y,m=i.z,M=u*-I+E*-S+s*-m,O=N*-I+h*-S+d*-m,y=R*I+f*S+A*m;return r(n)?(n[0]=u,n[1]=N,n[2]=-R,n[3]=0,n[4]=E,n[5]=h,n[6]=-f,n[7]=0,n[8]=s,n[9]=d,n[10]=-A,n[11]=0,n[12]=M,n[13]=O,n[14]=y,n[15]=1,n):new c(u,E,s,M,N,h,d,O,-R,-f,-A,y,0,0,0,1)},c.computePerspectiveFieldOfView=function(t,e,n,r,i){var a=Math.tan(.5*t),o=1/a,u=o/e,E=(r+n)/(n-r),s=2*r*n/(n-r);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=o,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=E,i[11]=-1,i[12]=0,i[13]=0,i[14]=s,i[15]=0,i},c.computeOrthographicOffCenter=function(t,e,n,r,i,a,o){var u=1/(e-t),E=1/(r-n),s=1/(a-i),c=-(e+t)*u,_=-(r+n)*E,T=-(a+i)*s;return u*=2,E*=2,s*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=s,o[11]=0,o[12]=c,o[13]=_,o[14]=T,o[15]=1,o},c.computePerspectiveOffCenter=function(t,e,n,r,i,a,o){var u=2*i/(e-t),E=2*i/(r-n),s=(e+t)/(e-t),c=(r+n)/(r-n),_=-(a+i)/(a-i),T=-1,l=-2*a*i/(a-i);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=s,o[9]=c,o[10]=_,o[11]=T,o[12]=0,o[13]=0,o[14]=l,o[15]=0,o},c.computeInfinitePerspectiveOffCenter=function(t,e,n,r,i,a){var o=2*i/(e-t),u=2*i/(r-n),E=(e+t)/(e-t),s=(r+n)/(r-n),c=-1,_=-1,T=-2*i;return a[0]=o,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=E,a[9]=s,a[10]=c,a[11]=_,a[12]=0,a[13]=0,a[14]=T,a[15]=0,a},c.computeViewportTransformation=function(t,e,r,i){t=n(t,n.EMPTY_OBJECT);var a=n(t.x,0),o=n(t.y,0),u=n(t.width,0),E=n(t.height,0);e=n(e,0),r=n(r,1);var s=.5*u,c=.5*E,_=.5*(r-e),T=s,l=c,R=_,f=a+s,A=o+c,N=e+_,h=1;return i[0]=T,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=l,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=R,i[11]=0,i[12]=f,i[13]=A,i[14]=N,i[15]=h,i},c.computeView=function(e,n,r,i,a){return a[0]=i.x,a[1]=r.x,a[2]=-n.x,a[3]=0,a[4]=i.y,a[5]=r.y,a[6]=-n.y,a[7]=0,a[8]=i.z,a[9]=r.z,a[10]=-n.z,a[11]=0,a[12]=-t.dot(i,e),a[13]=-t.dot(r,e),a[14]=t.dot(n,e),a[15]=1,a},c.toArray=function(t,e){return r(e)?(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],e):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]},c.getElementIndex=function(t,e){return 4*t+e},c.getColumn=function(t,e,n){var r=4*e,i=t[r],a=t[r+1],o=t[r+2],u=t[r+3];return n.x=i,n.y=a,n.z=o,n.w=u,n},c.setColumn=function(t,e,n,r){r=c.clone(t,r);var i=4*e;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r[i+3]=n.w,r},c.setTranslation=function(t,e,n){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=t[15],n},c.getRow=function(t,e,n){var r=t[e],i=t[e+4],a=t[e+8],o=t[e+12];return n.x=r,n.y=i,n.z=a,n.w=o,n},c.setRow=function(t,e,n,r){return r=c.clone(t,r),r[e]=n.x,r[e+4]=n.y,r[e+8]=n.z,r[e+12]=n.w,r};var R=new t;c.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],R)),n.y=t.magnitude(t.fromElements(e[4],e[5],e[6],R)),n.z=t.magnitude(t.fromElements(e[8],e[9],e[10],R)),n};var f=new t;c.getMaximumScale=function(e){return c.getScale(e,f),t.maximumComponent(f)},c.multiply=function(t,e,n){var r=t[0],i=t[1],a=t[2],o=t[3],u=t[4],E=t[5],s=t[6],c=t[7],_=t[8],T=t[9],l=t[10],R=t[11],f=t[12],A=t[13],N=t[14],h=t[15],d=e[0],I=e[1],S=e[2],m=e[3],M=e[4],O=e[5],y=e[6],p=e[7],C=e[8],U=e[9],L=e[10],F=e[11],P=e[12],v=e[13],w=e[14],g=e[15],x=r*d+u*I+_*S+f*m,D=i*d+E*I+T*S+A*m,B=a*d+s*I+l*S+N*m,z=o*d+c*I+R*S+h*m,G=r*M+u*O+_*y+f*p,b=i*M+E*O+T*y+A*p,X=a*M+s*O+l*y+N*p,V=o*M+c*O+R*y+h*p,q=r*C+u*U+_*L+f*F,H=i*C+E*U+T*L+A*F,W=a*C+s*U+l*L+N*F,Y=o*C+c*U+R*L+h*F,k=r*P+u*v+_*w+f*g,K=i*P+E*v+T*w+A*g,Z=a*P+s*v+l*w+N*g,j=o*P+c*v+R*w+h*g;return n[0]=x,n[1]=D,n[2]=B,n[3]=z,n[4]=G,n[5]=b,n[6]=X,n[7]=V,n[8]=q,n[9]=H,n[10]=W,n[11]=Y,n[12]=k,n[13]=K,n[14]=Z,n[15]=j,n},c.add=function(t,e,n){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n[4]=t[4]+e[4],n[5]=t[5]+e[5],n[6]=t[6]+e[6],n[7]=t[7]+e[7],n[8]=t[8]+e[8],n[9]=t[9]+e[9],n[10]=t[10]+e[10],n[11]=t[11]+e[11],n[12]=t[12]+e[12],n[13]=t[13]+e[13],n[14]=t[14]+e[14],n[15]=t[15]+e[15],n},c.subtract=function(t,e,n){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n[4]=t[4]-e[4],n[5]=t[5]-e[5],n[6]=t[6]-e[6],n[7]=t[7]-e[7],n[8]=t[8]-e[8],n[9]=t[9]-e[9],n[10]=t[10]-e[10],n[11]=t[11]-e[11],n[12]=t[12]-e[12],n[13]=t[13]-e[13],n[14]=t[14]-e[14],n[15]=t[15]-e[15],n},c.multiplyTransformation=function(t,e,n){var r=t[0],i=t[1],a=t[2],o=t[4],u=t[5],E=t[6],s=t[8],c=t[9],_=t[10],T=t[12],l=t[13],R=t[14],f=e[0],A=e[1],N=e[2],h=e[4],d=e[5],I=e[6],S=e[8],m=e[9],M=e[10],O=e[12],y=e[13],p=e[14],C=r*f+o*A+s*N,U=i*f+u*A+c*N,L=a*f+E*A+_*N,F=r*h+o*d+s*I,P=i*h+u*d+c*I,v=a*h+E*d+_*I,w=r*S+o*m+s*M,g=i*S+u*m+c*M,x=a*S+E*m+_*M,D=r*O+o*y+s*p+T,B=i*O+u*y+c*p+l,z=a*O+E*y+_*p+R;return n[0]=C,n[1]=U,n[2]=L,n[3]=0,n[4]=F,n[5]=P,n[6]=v,n[7]=0,n[8]=w,n[9]=g,n[10]=x,n[11]=0,n[12]=D,n[13]=B,n[14]=z,n[15]=1,n},c.multiplyByMatrix3=function(t,e,n){var r=t[0],i=t[1],a=t[2],o=t[4],u=t[5],E=t[6],s=t[8],c=t[9],_=t[10],T=e[0],l=e[1],R=e[2],f=e[3],A=e[4],N=e[5],h=e[6],d=e[7],I=e[8],S=r*T+o*l+s*R,m=i*T+u*l+c*R,M=a*T+E*l+_*R,O=r*f+o*A+s*N,y=i*f+u*A+c*N,p=a*f+E*A+_*N,C=r*h+o*d+s*I,U=i*h+u*d+c*I,L=a*h+E*d+_*I;return n[0]=S,n[1]=m,n[2]=M,n[3]=0,n[4]=O,n[5]=y,n[6]=p,n[7]=0,n[8]=C,n[9]=U,n[10]=L,n[11]=0,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n},c.multiplyByTranslation=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=r*t[0]+i*t[4]+a*t[8]+t[12],u=r*t[1]+i*t[5]+a*t[9]+t[13],E=r*t[2]+i*t[6]+a*t[10]+t[14];return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=o,n[13]=u,n[14]=E,n[15]=t[15],n};var A=new t;c.multiplyByUniformScale=function(t,e,n){return A.x=e,A.y=e,A.z=e,c.multiplyByScale(t,A,n)},c.multiplyByScale=function(t,e,n){var r=e.x,i=e.y,a=e.z;return 1===r&&1===i&&1===a?c.clone(t,n):(n[0]=r*t[0],n[1]=r*t[1],n[2]=r*t[2],n[3]=0,n[4]=i*t[4],n[5]=i*t[5],n[6]=i*t[6],n[7]=0,n[8]=a*t[8],n[9]=a*t[9],n[10]=a*t[10],n[11]=0,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=1,n)},c.multiplyByVector=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=e.w,u=t[0]*r+t[4]*i+t[8]*a+t[12]*o,E=t[1]*r+t[5]*i+t[9]*a+t[13]*o,s=t[2]*r+t[6]*i+t[10]*a+t[14]*o,c=t[3]*r+t[7]*i+t[11]*a+t[15]*o;return n.x=u,n.y=E,n.z=s,n.w=c,n},c.multiplyByPointAsVector=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=t[0]*r+t[4]*i+t[8]*a,u=t[1]*r+t[5]*i+t[9]*a,E=t[2]*r+t[6]*i+t[10]*a;return n.x=o,n.y=u,n.z=E,n},c.multiplyByPoint=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=t[0]*r+t[4]*i+t[8]*a+t[12],u=t[1]*r+t[5]*i+t[9]*a+t[13],E=t[2]*r+t[6]*i+t[10]*a+t[14];return n.x=o,n.y=u,n.z=E,n},c.multiplyByScalar=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n[4]=t[4]*e,n[5]=t[5]*e,n[6]=t[6]*e,n[7]=t[7]*e,n[8]=t[8]*e,n[9]=t[9]*e,n[10]=t[10]*e,n[11]=t[11]*e,n[12]=t[12]*e,n[13]=t[13]*e,n[14]=t[14]*e,n[15]=t[15]*e,n},c.negate=function(t,e){return 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],e},c.transpose=function(t,e){var n=t[1],r=t[2],i=t[3],a=t[6],o=t[7],u=t[11];return e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=r,e[9]=a,e[10]=t[10],e[11]=t[14],e[12]=i,e[13]=o,e[14]=u,e[15]=t[15],e},c.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e[9]=Math.abs(t[9]),e[10]=Math.abs(t[10]),e[11]=Math.abs(t[11]),e[12]=Math.abs(t[12]),e[13]=Math.abs(t[13]),e[14]=Math.abs(t[14]),e[15]=Math.abs(t[15]),e},c.equals=function(t,e){return t===e||r(t)&&r(e)&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[3]===e[3]&&t[7]===e[7]&&t[11]===e[11]&&t[15]===e[15]},c.equalsEpsilon=function(t,e,n){return t===e||r(t)&&r(e)&&Math.abs(t[0]-e[0])<=n&&Math.abs(t[1]-e[1])<=n&&Math.abs(t[2]-e[2])<=n&&Math.abs(t[3]-e[3])<=n&&Math.abs(t[4]-e[4])<=n&&Math.abs(t[5]-e[5])<=n&&Math.abs(t[6]-e[6])<=n&&Math.abs(t[7]-e[7])<=n&&Math.abs(t[8]-e[8])<=n&&Math.abs(t[9]-e[9])<=n&&Math.abs(t[10]-e[10])<=n&&Math.abs(t[11]-e[11])<=n&&Math.abs(t[12]-e[12])<=n&&Math.abs(t[13]-e[13])<=n&&Math.abs(t[14]-e[14])<=n&&Math.abs(t[15]-e[15])<=n},c.getTranslation=function(t,e){return e.x=t[12],e.y=t[13],e.z=t[14],e},c.getRotation=function(t,e){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e};var N=new E,h=new E,d=new e,I=new e(0,0,0,1);return c.inverse=function(t,n){if(E.equalsEpsilon(c.getRotation(t,N),h,u.EPSILON7)&&e.equals(c.getRow(t,3,d),I))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-t[12],n[13]=-t[13],n[14]=-t[14],n[15]=1,n;var r=t[0],i=t[4],a=t[8],o=t[12],_=t[1],T=t[5],l=t[9],R=t[13],f=t[2],A=t[6],S=t[10],m=t[14],M=t[3],O=t[7],y=t[11],p=t[15],C=S*p,U=m*y,L=A*p,F=m*O,P=A*y,v=S*O,w=f*p,g=m*M,x=f*y,D=S*M,B=f*O,z=A*M,G=C*T+F*l+P*R-(U*T+L*l+v*R),b=U*_+w*l+D*R-(C*_+g*l+x*R),X=L*_+g*T+B*R-(F*_+w*T+z*R),V=v*_+x*T+z*l-(P*_+D*T+B*l),q=U*i+L*a+v*o-(C*i+F*a+P*o),H=C*r+g*a+x*o-(U*r+w*a+D*o),W=F*r+w*i+z*o-(L*r+g*i+B*o),Y=P*r+D*i+B*a-(v*r+x*i+z*a);C=a*R,U=o*l,L=i*R,F=o*T,P=i*l,v=a*T,w=r*R,g=o*_,x=r*l,D=a*_,B=r*T,z=i*_;var k=C*O+F*y+P*p-(U*O+L*y+v*p),K=U*M+w*y+D*p-(C*M+g*y+x*p),Z=L*M+g*O+B*p-(F*M+w*O+z*p),j=v*M+x*O+z*y-(P*M+D*O+B*y),Q=L*S+v*m+U*A-(P*m+C*A+F*S),J=x*m+C*f+g*S-(w*S+D*m+U*f),$=w*A+z*m+F*f-(B*m+L*f+g*A),tt=B*S+P*f+D*A-(x*A+z*S+v*f),et=r*G+i*b+a*X+o*V;if(Math.abs(et)<u.EPSILON20)throw new s("matrix is not invertible because its determinate is zero.");return et=1/et,n[0]=G*et,n[1]=b*et,n[2]=X*et,n[3]=V*et,n[4]=q*et,n[5]=H*et,n[6]=W*et,n[7]=Y*et,n[8]=k*et,n[9]=K*et,n[10]=Z*et,n[11]=j*et,n[12]=Q*et,n[13]=J*et,n[14]=$*et,n[15]=tt*et,n},c.inverseTransformation=function(t,e){var n=t[0],r=t[1],i=t[2],a=t[4],o=t[5],u=t[6],E=t[8],s=t[9],c=t[10],_=t[12],T=t[13],l=t[14],R=-n*_-r*T-i*l,f=-a*_-o*T-u*l,A=-E*_-s*T-c*l;return e[0]=n,e[1]=a,e[2]=E,e[3]=0,e[4]=r,e[5]=o,e[6]=s,e[7]=0,e[8]=i,e[9]=u,e[10]=c,e[11]=0,e[12]=R,e[13]=f,e[14]=A,e[15]=1,e},c.IDENTITY=o(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),c.ZERO=o(new c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN0ROW3=3,c.COLUMN1ROW0=4,c.COLUMN1ROW1=5,c.COLUMN1ROW2=6,c.COLUMN1ROW3=7,c.COLUMN2ROW0=8,c.COLUMN2ROW1=9,c.COLUMN2ROW2=10,c.COLUMN2ROW3=11,c.COLUMN3ROW0=12,c.COLUMN3ROW1=13,c.COLUMN3ROW2=14,c.COLUMN3ROW3=15,i(c.prototype,{length:{get:function(){return c.packedLength}}}),c.prototype.clone=function(t){return c.clone(this,t)},c.prototype.equals=function(t){return c.equals(this,t)},c.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]&&t[4]===e[n+4]&&t[5]===e[n+5]&&t[6]===e[n+6]&&t[7]===e[n+7]&&t[8]===e[n+8]&&t[9]===e[n+9]&&t[10]===e[n+10]&&t[11]===e[n+11]&&t[12]===e[n+12]&&t[13]===e[n+13]&&t[14]===e[n+14]&&t[15]===e[n+15]},c.prototype.equalsEpsilon=function(t,e){return c.equalsEpsilon(this,t,e)},c.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]+")"},c}),define("Core/Rectangle",["./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(t,e,n,r,i,a,o,u){"use strict";function E(t,n,r,i){this.west=e(t,0),this.south=e(n,0),this.east=e(r,0),this.north=e(i,0)}r(E.prototype,{width:{get:function(){return E.computeWidth(this)}},height:{get:function(){return E.computeHeight(this)}}}),E.packedLength=4,E.pack=function(t,n,r){return r=e(r,0),n[r++]=t.west,n[r++]=t.south,n[r++]=t.east,n[r]=t.north,n},E.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new E),i.west=t[r++],i.south=t[r++],i.east=t[r++],i.north=t[r],i},E.computeWidth=function(t){var e=t.east,n=t.west;return e<n&&(e+=u.TWO_PI),e-n},E.computeHeight=function(t){return t.north-t.south},E.fromDegrees=function(t,r,i,a,o){return t=u.toRadians(e(t,0)),r=u.toRadians(e(r,0)),i=u.toRadians(e(i,0)),a=u.toRadians(e(a,0)),n(o)?(o.west=t,o.south=r,o.east=i,o.north=a,o):new E(t,r,i,a)},E.fromCartographicArray=function(t,e){for(var r=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=Number.MAX_VALUE,c=-Number.MAX_VALUE,_=0,T=t.length;_<T;_++){var l=t[_];r=Math.min(r,l.longitude),i=Math.max(i,l.longitude),s=Math.min(s,l.latitude),c=Math.max(c,l.latitude);var R=l.longitude>=0?l.longitude:l.longitude+u.TWO_PI;a=Math.min(a,R),o=Math.max(o,R)}return i-r>o-a&&(r=a,i=o,i>u.PI&&(i-=u.TWO_PI),r>u.PI&&(r-=u.TWO_PI)),n(e)?(e.west=r,e.south=s,e.east=i,e.north=c,e):new E(r,s,i,c)},E.fromCartesianArray=function(t,e,r){for(var i=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,s=-Number.MAX_VALUE,c=Number.MAX_VALUE,_=-Number.MAX_VALUE,T=0,l=t.length;T<l;T++){var R=e.cartesianToCartographic(t[T]);i=Math.min(i,R.longitude),a=Math.max(a,R.longitude),c=Math.min(c,R.latitude),_=Math.max(_,R.latitude);var f=R.longitude>=0?R.longitude:R.longitude+u.TWO_PI;o=Math.min(o,f),s=Math.max(s,f)}return a-i>s-o&&(i=o,a=s,a>u.PI&&(a-=u.TWO_PI),i>u.PI&&(i-=u.TWO_PI)),n(r)?(r.west=i,r.south=c,r.east=a,r.north=_,r):new E(i,c,a,_)},E.clone=function(t,e){if(n(t))return n(e)?(e.west=t.west,e.south=t.south,e.east=t.east,e.north=t.north,e):new E(t.west,t.south,t.east,t.north)},E.prototype.clone=function(t){return E.clone(this,t)},E.prototype.equals=function(t){return E.equals(this,t)},E.equals=function(t,e){return t===e||n(t)&&n(e)&&t.west===e.west&&t.south===e.south&&t.east===e.east&&t.north===e.north},E.prototype.equalsEpsilon=function(t,e){return n(t)&&Math.abs(this.west-t.west)<=e&&Math.abs(this.south-t.south)<=e&&Math.abs(this.east-t.east)<=e&&Math.abs(this.north-t.north)<=e},E.validate=function(t){},E.southwest=function(e,r){return n(r)?(r.longitude=e.west,r.latitude=e.south,r.height=0,r):new t(e.west,e.south)},E.northwest=function(e,r){return n(r)?(r.longitude=e.west,r.latitude=e.north,r.height=0,r):new t(e.west,e.north)},E.northeast=function(e,r){return n(r)?(r.longitude=e.east,r.latitude=e.north,r.height=0,r):new t(e.east,e.north)},E.southeast=function(e,r){return n(r)?(r.longitude=e.east,r.latitude=e.south,r.height=0,r):new t(e.east,e.south)},E.center=function(e,r){var i=e.east,a=e.west;i<a&&(i+=u.TWO_PI);var o=u.negativePiToPi(.5*(a+i)),E=.5*(e.south+e.north);return n(r)?(r.longitude=o,r.latitude=E,r.height=0,r):new t(o,E)},E.intersection=function(t,e,r){var i=t.east,a=t.west,o=e.east,s=e.west;i<a&&o>0?i+=u.TWO_PI:o<s&&i>0&&(o+=u.TWO_PI),i<a&&s<0?s+=u.TWO_PI:o<s&&a<0&&(a+=u.TWO_PI);var c=u.negativePiToPi(Math.max(a,s)),_=u.negativePiToPi(Math.min(i,o));if(!((t.west<t.east||e.west<e.east)&&_<=c)){var T=Math.max(t.south,e.south),l=Math.min(t.north,e.north);if(!(T>=l))return n(r)?(r.west=c,r.south=T,r.east=_,r.north=l,r):new E(c,T,_,l)}},E.simpleIntersection=function(t,e,r){var i=Math.max(t.west,e.west),a=Math.max(t.south,e.south),o=Math.min(t.east,e.east),u=Math.min(t.north,e.north);if(!(a>=u||i>=o))return n(r)?(r.west=i,r.south=a,r.east=o,r.north=u,r):new E(i,a,o,u)},E.union=function(t,e,r){n(r)||(r=new E);var i=t.east,a=t.west,o=e.east,s=e.west;i<a&&o>0?i+=u.TWO_PI:o<s&&i>0&&(o+=u.TWO_PI),i<a&&s<0?s+=u.TWO_PI:o<s&&a<0&&(a+=u.TWO_PI);var c=u.convertLongitudeRange(Math.min(a,s)),_=u.convertLongitudeRange(Math.max(i,o));return r.west=c,r.south=Math.min(t.south,e.south),r.east=_,r.north=Math.max(t.north,e.north),r},E.expand=function(t,e,r){return n(r)||(r=new E),r.west=Math.min(t.west,e.longitude),r.south=Math.min(t.south,e.latitude),r.east=Math.max(t.east,e.longitude),r.north=Math.max(t.north,e.latitude),r},E.contains=function(t,e){var n=e.longitude,r=e.latitude,i=t.west,a=t.east;return a<i&&(a+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>i||u.equalsEpsilon(n,i,u.EPSILON14))&&(n<a||u.equalsEpsilon(n,a,u.EPSILON14))&&r>=t.south&&r<=t.north};var s=new t;return E.subsample=function(t,r,i,o){r=e(r,a.WGS84),i=e(i,0),n(o)||(o=[]);var c=0,_=t.north,T=t.south,l=t.east,R=t.west,f=s;f.height=i,f.longitude=R,f.latitude=_,o[c]=r.cartographicToCartesian(f,o[c]),c++,f.longitude=l,o[c]=r.cartographicToCartesian(f,o[c]),c++,f.latitude=T,o[c]=r.cartographicToCartesian(f,o[c]),c++,f.longitude=R,o[c]=r.cartographicToCartesian(f,o[c]),c++,_<0?f.latitude=_:T>0?f.latitude=T:f.latitude=0;for(var A=1;A<8;++A)f.longitude=-Math.PI+A*u.PI_OVER_TWO,E.contains(t,f)&&(o[c]=r.cartographicToCartesian(f,o[c]),c++);return 0===f.latitude&&(f.longitude=R,o[c]=r.cartographicToCartesian(f,o[c]),c++,f.longitude=l,o[c]=r.cartographicToCartesian(f,o[c]),c++),o.length=c,o},E.MAX_VALUE=o(new E(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),E}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(t,e,n,r,i,a,o,u,E,s,c,_){"use strict";function T(e,r){this.center=t.clone(n(e,t.ZERO)),this.radius=n(r,0)}var l=new t,R=new t,f=new t,A=new t,N=new t,h=new t,d=new t,I=new t,S=new t,m=new t,M=new t,O=new t;T.fromPoints=function(e,n){if(r(n)||(n=new T),!r(e)||0===e.length)return n.center=t.clone(t.ZERO,n.center),n.radius=0,n;for(var i=t.clone(e[0],d),a=t.clone(i,l),o=t.clone(i,R),u=t.clone(i,f),E=t.clone(i,A),s=t.clone(i,N),c=t.clone(i,h),_=e.length,y=1;y<_;y++){t.clone(e[y],i);var p=i.x,C=i.y,U=i.z;p<a.x&&t.clone(i,a),p>E.x&&t.clone(i,E),C<o.y&&t.clone(i,o),C>s.y&&t.clone(i,s),U<u.z&&t.clone(i,u),U>c.z&&t.clone(i,c)}var L=t.magnitudeSquared(t.subtract(E,a,I)),F=t.magnitudeSquared(t.subtract(s,o,I)),P=t.magnitudeSquared(t.subtract(c,u,I)),v=a,w=E,g=L;F>g&&(g=F,v=o,w=s),P>g&&(g=P,v=u,w=c);var x=S;x.x=.5*(v.x+w.x),x.y=.5*(v.y+w.y),x.z=.5*(v.z+w.z);var D=t.magnitudeSquared(t.subtract(w,x,I)),B=Math.sqrt(D),z=m;z.x=a.x,z.y=o.y,z.z=u.z;var G=M;G.x=E.x,G.y=s.y,G.z=c.z;var b=t.multiplyByScalar(t.add(z,G,I),.5,O),X=0;for(y=0;y<_;y++){t.clone(e[y],i);var V=t.magnitude(t.subtract(i,b,I));V>X&&(X=V);var q=t.magnitudeSquared(t.subtract(i,x,I));if(q>D){var H=Math.sqrt(q);B=.5*(B+H),D=B*B;var W=H-B;x.x=(B*x.x+W*i.x)/H,x.y=(B*x.y+W*i.y)/H,x.z=(B*x.z+W*i.z)/H}}return B<X?(t.clone(x,n.center),n.radius=B):(t.clone(b,n.center),n.radius=X),n};var y=new o,p=new t,C=new t,U=new e,L=new e;T.fromRectangle2D=function(t,e,n){return T.fromRectangleWithHeights2D(t,e,0,0,n)},T.fromRectangleWithHeights2D=function(e,i,a,o,u){if(r(u)||(u=new T),!r(e))return u.center=t.clone(t.ZERO,u.center),u.radius=0,u;i=n(i,y),_.southwest(e,U),U.height=a,_.northeast(e,L),L.height=o;var E=i.project(U,p),s=i.project(L,C),c=s.x-E.x,l=s.y-E.y,R=s.z-E.z;u.radius=.5*Math.sqrt(c*c+l*l+R*R);var f=u.center;return f.x=E.x+.5*c,f.y=E.y+.5*l,f.z=E.z+.5*R,u};var F=[];T.fromRectangle3D=function(t,e,i,o){e=n(e,a.WGS84),i=n(i,0);var u;return r(t)&&(u=_.subsample(t,e,i,F)),T.fromPoints(u,o)},T.fromVertices=function(e,i,a,o){if(r(o)||(o=new T),!r(e)||0===e.length)return o.center=t.clone(t.ZERO,o.center),o.radius=0,o;i=n(i,t.ZERO),a=n(a,3);var u=d;u.x=e[0]+i.x,u.y=e[1]+i.y,u.z=e[2]+i.z;for(var E=t.clone(u,l),s=t.clone(u,R),c=t.clone(u,f),_=t.clone(u,A),y=t.clone(u,N),p=t.clone(u,h),C=e.length,U=0;U<C;U+=a){var L=e[U]+i.x,F=e[U+1]+i.y,P=e[U+2]+i.z;u.x=L,u.y=F,u.z=P,L<E.x&&t.clone(u,E),L>_.x&&t.clone(u,_),F<s.y&&t.clone(u,s),F>y.y&&t.clone(u,y),P<c.z&&t.clone(u,c),P>p.z&&t.clone(u,p)}var v=t.magnitudeSquared(t.subtract(_,E,I)),w=t.magnitudeSquared(t.subtract(y,s,I)),g=t.magnitudeSquared(t.subtract(p,c,I)),x=E,D=_,B=v;w>B&&(B=w,x=s,D=y),g>B&&(B=g,x=c,D=p);var z=S;z.x=.5*(x.x+D.x),z.y=.5*(x.y+D.y),z.z=.5*(x.z+D.z);var G=t.magnitudeSquared(t.subtract(D,z,I)),b=Math.sqrt(G),X=m;X.x=E.x,X.y=s.y,X.z=c.z;var V=M;V.x=_.x,V.y=y.y,V.z=p.z;var q=t.multiplyByScalar(t.add(X,V,I),.5,O),H=0;for(U=0;U<C;U+=a){u.x=e[U]+i.x,u.y=e[U+1]+i.y,u.z=e[U+2]+i.z;var W=t.magnitude(t.subtract(u,q,I));W>H&&(H=W);var Y=t.magnitudeSquared(t.subtract(u,z,I));if(Y>G){var k=Math.sqrt(Y);b=.5*(b+k),G=b*b;var K=k-b;z.x=(b*z.x+K*u.x)/k,z.y=(b*z.y+K*u.y)/k,z.z=(b*z.z+K*u.z)/k}}return b<H?(t.clone(z,o.center),o.radius=b):(t.clone(q,o.center),o.radius=H),o},T.fromEncodedCartesianVertices=function(e,n,i){if(r(i)||(i=new T),!r(e)||!r(n)||e.length!==n.length||0===e.length)return i.center=t.clone(t.ZERO,i.center),i.radius=0,i;var a=d;a.x=e[0]+n[0],a.y=e[1]+n[1],a.z=e[2]+n[2];for(var o=t.clone(a,l),u=t.clone(a,R),E=t.clone(a,f),s=t.clone(a,A),c=t.clone(a,N),_=t.clone(a,h),y=e.length,p=0;p<y;p+=3){var C=e[p]+n[p],U=e[p+1]+n[p+1],L=e[p+2]+n[p+2];a.x=C,a.y=U,a.z=L,C<o.x&&t.clone(a,o),C>s.x&&t.clone(a,s),U<u.y&&t.clone(a,u),U>c.y&&t.clone(a,c),L<E.z&&t.clone(a,E),L>_.z&&t.clone(a,_)}var F=t.magnitudeSquared(t.subtract(s,o,I)),P=t.magnitudeSquared(t.subtract(c,u,I)),v=t.magnitudeSquared(t.subtract(_,E,I)),w=o,g=s,x=F;P>x&&(x=P,w=u,g=c),v>x&&(x=v,w=E,g=_);var D=S;D.x=.5*(w.x+g.x),D.y=.5*(w.y+g.y),D.z=.5*(w.z+g.z);var B=t.magnitudeSquared(t.subtract(g,D,I)),z=Math.sqrt(B),G=m;G.x=o.x,G.y=u.y,G.z=E.z;var b=M;b.x=s.x,b.y=c.y,b.z=_.z;var X=t.multiplyByScalar(t.add(G,b,I),.5,O),V=0;for(p=0;p<y;p+=3){a.x=e[p]+n[p],a.y=e[p+1]+n[p+1],a.z=e[p+2]+n[p+2];var q=t.magnitude(t.subtract(a,X,I));q>V&&(V=q);var H=t.magnitudeSquared(t.subtract(a,D,I));if(H>B){var W=Math.sqrt(H);z=.5*(z+W),B=z*z;var Y=W-z;D.x=(z*D.x+Y*a.x)/W,D.y=(z*D.y+Y*a.y)/W,D.z=(z*D.z+Y*a.z)/W}}return z<V?(t.clone(D,i.center),i.radius=z):(t.clone(X,i.center),i.radius=V),i},T.fromCornerPoints=function(e,n,i){r(i)||(i=new T);var a=i.center;return t.add(e,n,a),t.multiplyByScalar(a,.5,a),i.radius=t.distance(a,n),i},T.fromEllipsoid=function(e,n){return r(n)||(n=new T),t.clone(t.ZERO,n.center),n.radius=e.maximumRadius,n};var P=new t;T.fromBoundingSpheres=function(e,n){if(r(n)||(n=new T),!r(e)||0===e.length)return n.center=t.clone(t.ZERO,n.center),n.radius=0,n;var i=e.length;if(1===i)return T.clone(e[0],n);if(2===i)return T.union(e[0],e[1],n);for(var a=[],o=0;o<i;o++)a.push(e[o].center);n=T.fromPoints(a,n);var u=n.center,E=n.radius;for(o=0;o<i;o++){var s=e[o];E=Math.max(E,t.distance(u,s.center,P)+s.radius)}return n.radius=E,n};var v=new t,w=new t,g=new t;T.fromOrientedBoundingBox=function(e,n){r(n)||(n=new T);var i=e.halfAxes,a=s.getColumn(i,0,v),o=s.getColumn(i,1,w),u=s.getColumn(i,2,g),E=t.magnitude(a),c=t.magnitude(o),_=t.magnitude(u);return n.center=t.clone(e.center,n.center),n.radius=Math.max(E,c,_),n},T.clone=function(e,n){if(r(e))return r(n)?(n.center=t.clone(e.center,n.center),n.radius=e.radius,n):new T(e.center,e.radius)},T.packedLength=4,T.pack=function(t,e,r){r=n(r,0);var i=t.center;return e[r++]=i.x,e[r++]=i.y,e[r++]=i.z,e[r]=t.radius,e},T.unpack=function(t,e,i){e=n(e,0),r(i)||(i=new T);var a=i.center;return a.x=t[e++],a.y=t[e++],a.z=t[e++],i.radius=t[e],i};var x=new t,D=new t;T.union=function(e,n,i){r(i)||(i=new T);var a=e.center,o=e.radius,u=n.center,E=n.radius,s=t.subtract(u,a,x),c=t.magnitude(s);if(o>=c+E)return e.clone(i),i;if(E>=c+o)return n.clone(i),i;var _=.5*(o+c+E),l=t.multiplyByScalar(s,(-o+_)/c,D);return t.add(l,a,l),t.clone(l,i.center),i.radius=_,i};var B=new t;T.expand=function(e,n,r){r=T.clone(e,r);var i=t.magnitude(t.subtract(n,r.center,B));return i>r.radius&&(r.radius=i),r},T.intersectPlane=function(e,n){var r=e.center,i=e.radius,a=n.normal,o=t.dot(a,r)+n.distance;return o<-i?u.OUTSIDE:o<i?u.INTERSECTING:u.INSIDE},T.transform=function(t,e,n){return r(n)||(n=new T),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=c.getMaximumScale(e)*t.radius,n};var z=new t;T.distanceSquaredTo=function(e,n){var r=t.subtract(e.center,n,z);return t.magnitudeSquared(r)-e.radius*e.radius},T.transformWithoutScale=function(t,e,n){return r(n)||(n=new T),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=t.radius,n};var G=new t;T.computePlaneDistances=function(e,n,i,a){r(a)||(a=new E);var o=t.subtract(e.center,n,G),u=t.dot(i,o);return a.start=u-e.radius,a.stop=u+e.radius,a};for(var b=new t,X=new t,V=new t,q=new t,H=new t,W=new e,Y=new Array(8),k=0;k<8;++k)Y[k]=new t;var K=new o;return T.projectTo2D=function(e,r,i){r=n(r,K);var a=r.ellipsoid,o=e.center,u=e.radius,E=a.geodeticSurfaceNormal(o,b),s=t.cross(t.UNIT_Z,E,X);t.normalize(s,s);var c=t.cross(E,s,V);t.normalize(c,c),t.multiplyByScalar(E,u,E),t.multiplyByScalar(c,u,c),t.multiplyByScalar(s,u,s);var _=t.negate(c,H),l=t.negate(s,q),R=Y,f=R[0];t.add(E,c,f),t.add(f,s,f),f=R[1],t.add(E,c,f),t.add(f,l,f),f=R[2],t.add(E,_,f),t.add(f,l,f),f=R[3],t.add(E,_,f),t.add(f,s,f),t.negate(E,E),f=R[4],t.add(E,c,f),t.add(f,s,f),f=R[5],t.add(E,c,f),t.add(f,l,f),f=R[6],t.add(E,_,f),t.add(f,l,f),f=R[7],t.add(E,_,f),t.add(f,s,f);for(var A=R.length,N=0;N<A;++N){var h=R[N];t.add(o,h,h);var d=a.cartesianToCartographic(h,W);r.project(d,h)}i=T.fromPoints(R,i),o=i.center;var I=o.x,S=o.y,m=o.z;return o.x=m,o.y=I,o.z=S,i},T.isOccluded=function(t,e){return!e.isBoundingSphereVisible(t)},T.equals=function(e,n){return e===n||r(e)&&r(n)&&t.equals(e.center,n.center)&&e.radius===n.radius},T.prototype.intersectPlane=function(t){return T.intersectPlane(this,t)},T.prototype.distanceSquaredTo=function(t){return T.distanceSquaredTo(this,t)},T.prototype.computePlaneDistances=function(t,e,n){return T.computePlaneDistances(this,t,e,n)},T.prototype.isOccluded=function(t){return T.isOccluded(this,t)},T.prototype.equals=function(t){return T.equals(this,t)},T.prototype.clone=function(t){return T.clone(this,t)},T}),define("Core/Cartesian2",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i){"use strict";function a(e,n){this.x=t(e,0),this.y=t(n,0)}a.fromElements=function(t,n,r){return e(r)?(r.x=t,r.y=n,r):new a(t,n)},a.clone=function(t,n){if(e(t))return e(n)?(n.x=t.x,n.y=t.y,n):new a(t.x,t.y)},a.fromCartesian3=a.clone,a.fromCartesian4=a.clone,a.packedLength=2,a.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r]=e.y,n},a.unpack=function(n,r,i){return r=t(r,0),e(i)||(i=new a),i.x=n[r++],i.y=n[r],i},a.packArray=function(t,n){var r=t.length;e(n)?n.length=2*r:n=new Array(2*r);for(var i=0;i<r;++i)a.pack(t[i],n,2*i);return n},a.unpackArray=function(t,n){var r=t.length;e(n)?n.length=r/2:n=new Array(r/2);for(var i=0;i<r;i+=2){var o=i/2;n[o]=a.unpack(t,i,n[o])}return n},a.fromArray=a.unpack,a.maximumComponent=function(t){return Math.max(t.x,t.y)},a.minimumComponent=function(t){return Math.min(t.x,t.y)},a.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n},a.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n},a.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y},a.magnitude=function(t){return Math.sqrt(a.magnitudeSquared(t))};var o=new a;a.distance=function(t,e){return a.subtract(t,e,o),a.magnitude(o)},a.distanceSquared=function(t,e){return a.subtract(t,e,o),a.magnitudeSquared(o)},a.normalize=function(t,e){var n=a.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e},a.dot=function(t,e){return t.x*e.x+t.y*e.y},a.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n},a.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n},a.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n},a.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n},a.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n},a.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n},a.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e},a.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e};var u=new a;a.lerp=function(t,e,n,r){return a.multiplyByScalar(e,n,u),r=a.multiplyByScalar(t,1-n,r),a.add(u,r,r)};var E=new a,s=new a;a.angleBetween=function(t,e){return a.normalize(t,E),a.normalize(e,s),i.acosClamped(a.dot(E,s))};var c=new a;return a.mostOrthogonalAxis=function(t,e){var n=a.normalize(t,c);return a.abs(n,n),e=n.x<=n.y?a.clone(a.UNIT_X,e):a.clone(a.UNIT_Y,e)},a.equals=function(t,n){return t===n||e(t)&&e(n)&&t.x===n.x&&t.y===n.y},a.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]},a.equalsEpsilon=function(t,n,r,a){return t===n||e(t)&&e(n)&&i.equalsEpsilon(t.x,n.x,r,a)&&i.equalsEpsilon(t.y,n.y,r,a)},a.ZERO=r(new a(0,0)),a.UNIT_X=r(new a(1,0)),a.UNIT_Y=r(new a(0,1)),a.prototype.clone=function(t){return a.clone(this,t)},a.prototype.equals=function(t){return a.equals(this,t)},a.prototype.equalsEpsilon=function(t,e,n){return a.equalsEpsilon(this,t,e,n)},a.prototype.toString=function(){return"("+this.x+", "+this.y+")"},a}),define("Core/Fullscreen",["./defined","./defineProperties"],function(t,e){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},i={};return e(i,{element:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenEnabled]; -}},fullscreen:{get:function(){if(i.supportsFullscreen())return null!==i.element}}}),i.supportsFullscreen=function(){if(t(n))return n;n=!1;var e=document.body;if("function"==typeof e.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var i,a=["webkit","moz","o","ms","khtml"],o=0,u=a.length;o<u;++o){var E=a[o];i=E+"RequestFullscreen","function"==typeof e[i]?(r.requestFullscreen=i,n=!0):(i=E+"RequestFullScreen","function"==typeof e[i]&&(r.requestFullscreen=i,n=!0)),i=E+"ExitFullscreen","function"==typeof document[i]?r.exitFullscreen=i:(i=E+"CancelFullScreen","function"==typeof document[i]&&(r.exitFullscreen=i)),i=E+"FullscreenEnabled",void 0!==document[i]?r.fullscreenEnabled=i:(i=E+"FullScreenEnabled",void 0!==document[i]&&(r.fullscreenEnabled=i)),i=E+"FullscreenElement",void 0!==document[i]?r.fullscreenElement=i:(i=E+"FullScreenElement",void 0!==document[i]&&(r.fullscreenElement=i)),i=E+"fullscreenchange",void 0!==document["on"+i]&&("ms"===E&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=E+"fullscreenerror",void 0!==document["on"+i]&&("ms"===E&&(i="MSFullscreenError"),r.fullscreenerror=i)}return n},i.requestFullscreen=function(t,e){i.supportsFullscreen()&&t[r.requestFullscreen]({vrDisplay:e})},i.exitFullscreen=function(){i.supportsFullscreen()&&document[r.exitFullscreen]()},i}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(t,e,n){"use strict";function r(t){for(var e=t.split("."),n=0,r=e.length;n<r;++n)e[n]=parseInt(e[n],10);return e}function i(){if(!e(S)&&(S=!1,!T())){var t=/ Chrome\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(S=!0,m=r(t[1]))}return S}function a(){return i()&&m}function o(){if(!e(M)&&(M=!1,!i()&&!T()&&/ Safari\/[\.0-9]+/.test(I.userAgent))){var t=/ Version\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(M=!0,O=r(t[1]))}return M}function u(){return o()&&O}function E(){if(!e(y)){y=!1;var t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(I.userAgent);null!==t&&(y=!0,p=r(t[1]),p.isNightly=!!t[2])}return y}function s(){return E()&&p}function c(){if(!e(C)){C=!1;var t;"Microsoft Internet Explorer"===I.appName?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==t&&(C=!0,U=r(t[1]))):"Netscape"===I.appName&&(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==t&&(C=!0,U=r(t[1])))}return C}function _(){return c()&&U}function T(){if(!e(L)){L=!1;var t=/ Edge\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(L=!0,F=r(t[1]))}return L}function l(){return T()&&F}function R(){if(!e(P)){P=!1;var t=/Firefox\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(P=!0,v=r(t[1]))}return P}function f(){return e(w)||(w=/Windows/i.test(I.appVersion)),w}function A(){return R()&&v}function N(){return e(g)||(g="undefined"!=typeof PointerEvent&&(!e(I.pointerEnabled)||I.pointerEnabled)),g}function h(){if(!e(D)){var t=document.createElement("canvas");t.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=t.style.imageRendering;D=e(n)&&""!==n,D&&(x=n)}return D}function d(){return h()?x:void 0}var I;I="undefined"!=typeof navigator?navigator:{};var S,m,M,O,y,p,C,U,L,F,P,v,w,g,x,D,B={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:E,webkitVersion:s,isInternetExplorer:c,internetExplorerVersion:_,isEdge:T,edgeVersion:l,isFirefox:R,firefoxVersion:A,isWindows:f,hardwareConcurrency:t(I.hardwareConcurrency,3),supportsPointerEvents:N,supportsImageRenderingPixelated:h,imageRenderingValue:d};return B.supportsFullscreen=function(){return n.supportsFullscreen()},B.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},B.supportsWebWorkers=function(){return"undefined"!=typeof Worker},B}),define("Core/WebGLConstants",["./freezeObject"],function(t){"use strict";var e={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503};return t(e)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(t,e,n,r,i,a){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:a.BYTE,UNSIGNED_BYTE:a.UNSIGNED_BYTE,SHORT:a.SHORT,UNSIGNED_SHORT:a.UNSIGNED_SHORT,INT:a.INT,UNSIGNED_INT:a.UNSIGNED_INT,FLOAT:a.FLOAT,DOUBLE:a.DOUBLE};return o.getSizeInBytes=function(t){switch(t){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.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(t){return t instanceof Int8Array?o.BYTE:t instanceof Uint8Array?o.UNSIGNED_BYTE:t instanceof Int16Array?o.SHORT:t instanceof Uint16Array?o.UNSIGNED_SHORT:t instanceof Int32Array?o.INT:t instanceof Uint32Array?o.UNSIGNED_INT:t instanceof Float32Array?o.FLOAT:t instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(t){return e(t)&&(t===o.BYTE||t===o.UNSIGNED_BYTE||t===o.SHORT||t===o.UNSIGNED_SHORT||t===o.INT||t===o.UNSIGNED_INT||t===o.FLOAT||t===o.DOUBLE)},o.createTypedArray=function(t,e){switch(t){case o.BYTE:return new Int8Array(e);case o.UNSIGNED_BYTE:return new Uint8Array(e);case o.SHORT:return new Int16Array(e);case o.UNSIGNED_SHORT:return new Uint16Array(e);case o.INT:return new Int32Array(e);case o.UNSIGNED_INT:return new Uint32Array(e);case o.FLOAT:return new Float32Array(e);case o.DOUBLE:return new Float64Array(e)}},o.createArrayBufferView=function(e,n,r,i){switch(r=t(r,0),i=t(i,(n.byteLength-r)/o.getSizeInBytes(e)),e){case o.BYTE:return new Int8Array(n,r,i);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,i);case o.SHORT:return new Int16Array(n,r,i);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,i);case o.INT:return new Int32Array(n,r,i);case o.UNSIGNED_INT:return new Uint32Array(n,r,i);case o.FLOAT:return new Float32Array(n,r,i);case o.DOUBLE:return new Float64Array(n,r,i)}},o.fromName=function(t){switch(t){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},i(o)}),define("Core/GeometryType",["./freezeObject"],function(t){"use strict";var e={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return t(e)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(t,e){"use strict";var n={POINTS:e.POINTS,LINES:e.LINES,LINE_LOOP:e.LINE_LOOP,LINE_STRIP:e.LINE_STRIP,TRIANGLES:e.TRIANGLES,TRIANGLE_STRIP:e.TRIANGLE_STRIP,TRIANGLE_FAN:e.TRIANGLE_FAN,validate:function(t){return t===n.POINTS||t===n.LINES||t===n.LINE_LOOP||t===n.LINE_STRIP||t===n.TRIANGLES||t===n.TRIANGLE_STRIP||t===n.TRIANGLE_FAN}};return t(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(t,e,n,r,i){"use strict";function a(e){e=t(e,t.EMPTY_OBJECT),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=t(e.primitiveType,i.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=t(e.geometryType,r.NONE),this.boundingSphereCV=e.boundingSphereCV}return a.computeNumberOfVertices=function(t){var n=-1;for(var r in t.attributes)if(t.attributes.hasOwnProperty(r)&&e(t.attributes[r])&&e(t.attributes[r].values)){var i=t.attributes[r],a=i.values.length/i.componentsPerAttribute;n=a}return n},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(t,e,n){"use strict";function r(e){e=t(e,t.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=t(e.normalize,!1),this.values=e.values}return r}),define("Core/GeometryAttributes",["./defaultValue"],function(t){"use strict";function e(e){e=t(e,t.EMPTY_OBJECT),this.position=e.position,this.normal=e.normal,this.st=e.st,this.binormal=e.binormal,this.tangent=e.tangent,this.color=e.color}return e}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(t,e,n,r,i){"use strict";var a={UNSIGNED_BYTE:i.UNSIGNED_BYTE,UNSIGNED_SHORT:i.UNSIGNED_SHORT,UNSIGNED_INT:i.UNSIGNED_INT};return a.getSizeInBytes=function(t){switch(t){case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},a.validate=function(e){return t(e)&&(e===a.UNSIGNED_BYTE||e===a.UNSIGNED_SHORT||e===a.UNSIGNED_INT)},a.createTypedArray=function(t,e){return t>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(e):new Uint16Array(e)},a.createTypedArrayFromArrayBuffer=function(t,e,n,i){return t>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(e,n,i):new Uint16Array(e,n,i)},n(a)}),define("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(t,e,n,r){"use strict";function i(e){e=t(e,t.EMPTY_OBJECT),this.position=t(e.position,!1),this.normal=t(e.normal,!1),this.st=t(e.st,!1),this.binormal=t(e.binormal,!1),this.tangent=t(e.tangent,!1),this.color=t(e.color,!1)}return i.POSITION_ONLY=r(new i({position:!0})),i.POSITION_AND_NORMAL=r(new i({position:!0,normal:!0})),i.POSITION_NORMAL_AND_ST=r(new i({position:!0,normal:!0,st:!0})),i.POSITION_AND_ST=r(new i({position:!0,st:!0})),i.POSITION_AND_COLOR=r(new i({position:!0,color:!0})),i.ALL=r(new i({position:!0,normal:!0,st:!0,binormal:!0,tangent:!0})),i.DEFAULT=i.POSITION_NORMAL_AND_ST,i.packedLength=6,i.pack=function(e,n,r){return r=t(r,0),n[r++]=e.position?1:0,n[r++]=e.normal?1:0,n[r++]=e.st?1:0,n[r++]=e.binormal?1:0,n[r++]=e.tangent?1:0,n[r++]=e.color?1:0,n},i.unpack=function(n,r,a){return r=t(r,0),e(a)||(a=new i),a.position=1===n[r++],a.normal=1===n[r++],a.st=1===n[r++],a.binormal=1===n[r++],a.tangent=1===n[r++],a.color=1===n[r++],a},i.clone=function(t,n){if(e(t))return e(n)||(n=new i),n.position=t.position,n.normal=t.normal,n.st=t.st,n.binormal=t.binormal,n.tangent=t.tangent,n.color=t.color,n},i}),define("Core/EllipsoidGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./VertexFormat"],function(t,e,n,r,i,a,o,u,E,s,c,_,T,l,R){"use strict";function f(t){t=i(t,i.EMPTY_OBJECT);var e=i(t.radii,S),r=i(t.stackPartitions,64),a=i(t.slicePartitions,64),o=i(t.vertexFormat,R.DEFAULT);this._radii=n.clone(e),this._stackPartitions=r,this._slicePartitions=a,this._vertexFormat=R.clone(o),this._workerName="createEllipsoidGeometry"}var A=new n,N=new n,h=new n,d=new n,I=new n,S=new n(1,1,1),m=Math.cos,M=Math.sin;f.packedLength=n.packedLength+R.packedLength+2,f.pack=function(t,e,r){return r=i(r,0),n.pack(t._radii,e,r),r+=n.packedLength,R.pack(t._vertexFormat,e,r),r+=R.packedLength,e[r++]=t._stackPartitions,e[r]=t._slicePartitions,e};var O=new n,y=new R,p={radii:O,vertexFormat:y,stackPartitions:void 0,slicePartitions:void 0};return f.unpack=function(t,e,r){e=i(e,0);var o=n.unpack(t,e,O);e+=n.packedLength;var u=R.unpack(t,e,y);e+=R.packedLength;var E=t[e++],s=t[e];return a(r)?(r._radii=n.clone(o,r._radii),r._vertexFormat=R.clone(u,r._vertexFormat),r._stackPartitions=E,r._slicePartitions=s,r):(p.stackPartitions=E,p.slicePartitions=s,new f(p))},f.createGeometry=function(i){var a=i._radii;if(!(a.x<=0||a.y<=0||a.z<=0)){var o,R,f=u.fromCartesian3(a),S=i._vertexFormat,O=i._slicePartitions+1,y=i._stackPartitions+1,p=y*O,C=new Float64Array(3*p),U=6*(O-1)*(y-2),L=_.createTypedArray(p,U),F=S.normal?new Float32Array(3*p):void 0,P=S.tangent?new Float32Array(3*p):void 0,v=S.binormal?new Float32Array(3*p):void 0,w=S.st?new Float32Array(2*p):void 0,g=new Array(O),x=new Array(O),D=0;for(o=0;o<O;o++){var B=T.TWO_PI*o/(O-1);g[o]=m(B),x[o]=M(B),C[D++]=0,C[D++]=0,C[D++]=a.z}for(o=1;o<y-1;o++){var z=Math.PI*o/(y-1),G=M(z),b=a.x*G,X=a.y*G,V=a.z*m(z);for(R=0;R<O;R++)C[D++]=g[R]*b,C[D++]=x[R]*X,C[D++]=V}for(o=0;o<O;o++)C[D++]=0,C[D++]=0,C[D++]=-a.z;var q=new c;S.position&&(q.position=new s({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:C}));var H=0,W=0,Y=0,k=0;if(S.st||S.normal||S.tangent||S.binormal){for(o=0;o<p;o++){var K=n.fromArray(C,3*o,A),Z=f.geodeticSurfaceNormal(K,N);if(S.st){var j=e.negate(Z,I);e.magnitude(j)<T.EPSILON6&&(D=3*(o+O*Math.floor(.5*y)),D>C.length&&(D=3*(o-O*Math.floor(.5*y))),n.fromArray(C,D,j),f.geodeticSurfaceNormal(j,j),e.negate(j,j)),w[H++]=Math.atan2(j.y,j.x)/T.TWO_PI+.5,w[H++]=Math.asin(Z.z)/Math.PI+.5}if(S.normal&&(F[W++]=Z.x,F[W++]=Z.y,F[W++]=Z.z),S.tangent||S.binormal){var Q=h;if(o<O||o>p-O-1?(n.cross(n.UNIT_X,Z,Q),n.normalize(Q,Q)):(n.cross(n.UNIT_Z,Z,Q),n.normalize(Q,Q)),S.tangent&&(P[Y++]=Q.x,P[Y++]=Q.y,P[Y++]=Q.z),S.binormal){var J=n.cross(Z,Q,d);n.normalize(J,J),v[k++]=J.x,v[k++]=J.y,v[k++]=J.z}}}S.st&&(q.st=new s({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:w})),S.normal&&(q.normal=new s({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:F})),S.tangent&&(q.tangent=new s({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:P})),S.binormal&&(q.binormal=new s({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:v}))}for(D=0,R=0;R<O-1;R++)L[D++]=O+R,L[D++]=O+R+1,L[D++]=R+1;var $,tt;for(o=1;o<y-2;o++)for($=o*O,tt=(o+1)*O,R=0;R<O-1;R++)L[D++]=tt+R,L[D++]=tt+R+1,L[D++]=$+R+1,L[D++]=tt+R,L[D++]=$+R+1,L[D++]=$+R;for(o=y-2,$=o*O,tt=(o+1)*O,R=0;R<O-1;R++)L[D++]=tt+R,L[D++]=$+R+1,L[D++]=$+R;return new E({attributes:q,indices:L,primitiveType:l.TRIANGLES,boundingSphere:t.fromEllipsoid(f)})}},f}),define("Workers/createEllipsoidGeometry",["../Core/defined","../Core/EllipsoidGeometry"],function(t,e){"use strict";return function(n,r){return t(r)&&(n=e.unpack(n,r)),e.createGeometry(n)}})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function t(t){return void 0!==t&&null!==t}return t}),define("Core/DeveloperError",["./defined"],function(t){"use strict";function e(t){this.name="DeveloperError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e.throwInstantiationError=function(){throw new e("This function defines an interface and should not be called directly.")},e}),define("Core/Check",["./defined","./DeveloperError"],function(t,e){"use strict";function n(t){return t+" is required, actual value was undefined"}function r(t,e,n){return"Expected "+n+" to be typeof "+e+", actual typeof was "+t}var a={};return a.typeOf={},a.defined=function(r,a){if(!t(a))throw new e(n(r))},a.typeOf.func=function(t,n){if("function"!=typeof n)throw new e(r(typeof n,"function",t))},a.typeOf.string=function(t,n){if("string"!=typeof n)throw new e(r(typeof n,"string",t))},a.typeOf.number=function(t,n){if("number"!=typeof n)throw new e(r(typeof n,"number",t))},a.typeOf.number.lessThan=function(t,n,r){if(a.typeOf.number(t,n),n>=r)throw new e("Expected "+t+" to be less than "+r+", actual value was "+n)},a.typeOf.number.lessThanOrEquals=function(t,n,r){if(a.typeOf.number(t,n),n>r)throw new e("Expected "+t+" to be less than or equal to "+r+", actual value was "+n)},a.typeOf.number.greaterThan=function(t,n,r){if(a.typeOf.number(t,n),n<=r)throw new e("Expected "+t+" to be greater than "+r+", actual value was "+n)},a.typeOf.number.greaterThanOrEquals=function(t,n,r){if(a.typeOf.number(t,n),n<r)throw new e("Expected "+t+" to be greater than or equal to"+r+", actual value was "+n)},a.typeOf.object=function(t,n){if("object"!=typeof n)throw new e(r(typeof n,"object",t))},a.typeOf.bool=function(t,n){if("boolean"!=typeof n)throw new e(r(typeof n,"boolean",t))},a}),define("Core/freezeObject",["./defined"],function(t){"use strict";var e=Object.freeze;return t(e)||(e=function(t){return t}),e}),define("Core/defaultValue",["./freezeObject"],function(t){"use strict";function e(t,e){return void 0!==t?t:e}return e.EMPTY_OBJECT=t({}),e}),define("ThirdParty/mersenne-twister",[],function(){var t=function(t){void 0==t&&(t=(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(t)};return t.prototype.init_genrand=function(t){for(this.mt[0]=t>>>0,this.mti=1;this.mti<this.N;this.mti++){var t=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&t)>>>16)<<16)+1812433253*(65535&t)+this.mti,this.mt[this.mti]>>>=0}},t.prototype.genrand_int32=function(){var t,e=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)t=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^t>>>1^e[1&t];for(;n<this.N-1;n++)t=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^t>>>1^e[1&t];t=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^t>>>1^e[1&t],this.mti=0}return t=this.mt[this.mti++],t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,t^=t>>>18,t>>>0},t.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},t}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(t,e,n,r){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(t){return t>0?1:t<0?-1:0},a.signNotZero=function(t){return t<0?-1:1},a.toSNorm=function(t,n){return n=e(n,255),Math.round((.5*a.clamp(t,-1,1)+.5)*n)},a.fromSNorm=function(t,n){return n=e(n,255),a.clamp(t,0,n)/n*2-1},a.sinh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e-n)},a.cosh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e+n)},a.lerp=function(t,e,n){return(1-n)*t+n*e},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(t){return t*a.RADIANS_PER_DEGREE},a.toDegrees=function(t){return t*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(t){var e=a.TWO_PI,n=t-Math.floor(t/e)*e;return n<-Math.PI?n+e:n>=Math.PI?n-e:n},a.clampToLatitudeRange=function(t){return a.clamp(t,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(t){return a.zeroToTwoPi(t+a.PI)-a.PI},a.zeroToTwoPi=function(t){var e=a.mod(t,a.TWO_PI);return Math.abs(e)<a.EPSILON14&&Math.abs(t)>a.EPSILON14?a.TWO_PI:e},a.mod=function(t,e){return(t%e+e)%e},a.equalsEpsilon=function(t,n,r,a){a=e(a,r);var i=Math.abs(t-n);return i<=a||i<=r*Math.max(Math.abs(t),Math.abs(n))};var i=[1];a.factorial=function(t){var e=i.length;if(t>=e)for(var n=i[e-1],r=e;r<=t;r++)i.push(n*r);return i[t]},a.incrementWrap=function(t,n,r){return r=e(r,0),++t,t>n&&(t=r),t},a.isPowerOfTwo=function(t){return 0!==t&&0===(t&t-1)},a.nextPowerOfTwo=function(t){return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t,t},a.clamp=function(t,e,n){return t<e?e:t>n?n:t};var o=new t;return a.setRandomNumberSeed=function(e){o=new t(e)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(t){return Math.acos(a.clamp(t,-1,1))},a.asinClamped=function(t){return Math.asin(a.clamp(t,-1,1))},a.chordLength=function(t,e){return 2*e*Math.sin(.5*t)},a.logBase=function(t,e){return Math.log(t)/Math.log(e)},a.fog=function(t,e){var n=t*e;return 1-Math.exp(-(n*n))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,a,i){"use strict";function o(t,n,r){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0)}o.fromSpherical=function(t,r){n(r)||(r=new o);var a=t.clock,i=t.cone,u=e(t.magnitude,1),E=u*Math.sin(i);return r.x=E*Math.cos(a),r.y=E*Math.sin(a),r.z=u*Math.cos(i),r},o.fromElements=function(t,e,r,a){return n(a)?(a.x=t,a.y=e,a.z=r,a):new o(t,e,r)},o.clone=function(t,e){if(n(t))return n(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e):new o(t.x,t.y,t.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r]=t.z,n},o.unpack=function(t,r,a){return r=e(r,0),n(a)||(a=new o),a.x=t[r++],a.y=t[r++],a.z=t[r],a},o.packArray=function(t,e){var r=t.length;n(e)?e.length=3*r:e=new Array(3*r);for(var a=0;a<r;++a)o.pack(t[a],e,3*a);return e},o.unpackArray=function(t,e){var r=t.length;n(e)?e.length=r/3:e=new Array(r/3);for(var a=0;a<r;a+=3){var i=a/3;e[i]=o.unpack(t,a,e[i])}return e},o.fromArray=o.unpack,o.maximumComponent=function(t){return Math.max(t.x,t.y,t.z)},o.minimumComponent=function(t){return Math.min(t.x,t.y,t.z)},o.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n.z=Math.min(t.z,e.z),n},o.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n.z=Math.max(t.z,e.z),n},o.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z},o.magnitude=function(t){return Math.sqrt(o.magnitudeSquared(t))};var u=new o;o.distance=function(t,e){return o.subtract(t,e,u),o.magnitude(u)},o.distanceSquared=function(t,e){return o.subtract(t,e,u),o.magnitudeSquared(u)},o.normalize=function(t,e){var n=o.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e},o.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},o.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n.z=t.z*e.z,n},o.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n.z=t.z/e.z,n},o.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n},o.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n},o.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*e,n},o.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n},o.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e},o.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e};var E=new o;o.lerp=function(t,e,n,r){return o.multiplyByScalar(e,n,E),r=o.multiplyByScalar(t,1-n,r),o.add(E,r,r)};var s=new o,c=new o;o.angleBetween=function(t,e){o.normalize(t,s),o.normalize(e,c);var n=o.dot(s,c),r=o.magnitude(o.cross(s,c,s));return Math.atan2(r,n)};var _=new o;o.mostOrthogonalAxis=function(t,e){var n=o.normalize(t,_);return o.abs(n,n),e=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,e):o.clone(o.UNIT_Z,e):n.y<=n.z?o.clone(o.UNIT_Y,e):o.clone(o.UNIT_Z,e)},o.equals=function(t,e){return t===e||n(t)&&n(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z},o.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]},o.equalsEpsilon=function(t,e,r,a){return t===e||n(t)&&n(e)&&i.equalsEpsilon(t.x,e.x,r,a)&&i.equalsEpsilon(t.y,e.y,r,a)&&i.equalsEpsilon(t.z,e.z,r,a)},o.cross=function(t,e,n){var r=t.x,a=t.y,i=t.z,o=e.x,u=e.y,E=e.z,s=a*E-i*u,c=i*o-r*E,_=r*u-a*o;return n.x=s,n.y=c,n.z=_,n},o.fromDegrees=function(t,e,n,r,a){return t=i.toRadians(t),e=i.toRadians(e),o.fromRadians(t,e,n,r,a)};var T=new o,l=new o,R=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(t,r,a,i,u){a=e(a,0);var E=n(i)?i.radiiSquared:R,s=Math.cos(r);T.x=s*Math.cos(t),T.y=s*Math.sin(t),T.z=Math.sin(r),T=o.normalize(T,T),o.multiplyComponents(E,T,l);var c=Math.sqrt(o.dot(T,l));return l=o.divideByScalar(l,c,l),T=o.multiplyByScalar(T,a,T),n(u)||(u=new o),o.add(l,T,u)},o.fromDegreesArray=function(t,e,r){var a=t.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=t[i],E=t[i+1],s=i/2;r[s]=o.fromDegrees(u,E,0,e,r[s])}return r},o.fromRadiansArray=function(t,e,r){var a=t.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=t[i],E=t[i+1],s=i/2;r[s]=o.fromRadians(u,E,0,e,r[s])}return r},o.fromDegreesArrayHeights=function(t,e,r){var a=t.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=t[i],E=t[i+1],s=t[i+2],c=i/3;r[c]=o.fromDegrees(u,E,s,e,r[c])}return r},o.fromRadiansArrayHeights=function(t,e,r){var a=t.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=t[i],E=t[i+1],s=t[i+2],c=i/3;r[c]=o.fromRadians(u,E,s,e,r[c])}return r},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(new o(0,0,1)),o.prototype.clone=function(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.prototype.equalsEpsilon=function(t,e,n){return o.equalsEpsilon(this,t,e,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(t,e,n,r){"use strict";function a(n,a,u,E,s){var c=n.x,_=n.y,T=n.z,l=a.x,R=a.y,f=a.z,A=c*c*l*l,h=_*_*R*R,N=T*T*f*f,d=A+h+N,I=Math.sqrt(1/d),S=t.multiplyByScalar(n,I,i);if(d<E)return isFinite(I)?t.clone(S,s):void 0;var m=u.x,M=u.y,O=u.z,y=o;y.x=S.x*m*2,y.y=S.y*M*2,y.z=S.z*O*2;var p,C,U,L,F,P,g,w,v,x,D,B=(1-I)*t.magnitude(n)/(.5*t.magnitude(y)),z=0;do{B-=z,U=1/(1+B*m),L=1/(1+B*M),F=1/(1+B*O),P=U*U,g=L*L,w=F*F,v=P*U,x=g*L,D=w*F,p=A*P+h*g+N*w-1,C=A*v*m+h*x*M+N*D*O;var G=-2*C;z=p/G}while(Math.abs(p)>r.EPSILON12);return e(s)?(s.x=c*U,s.y=_*L,s.z=T*F,s):new t(c*U,_*L,T*F)}var i=new t,o=new t;return a}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,n,r,a,i,o){"use strict";function u(t,n,r){this.longitude=e(t,0),this.latitude=e(n,0),this.height=e(r,0)}u.fromRadians=function(t,r,a,i){return a=e(a,0),n(i)?(i.longitude=t,i.latitude=r,i.height=a,i):new u(t,r,a)},u.fromDegrees=function(t,e,n,r){return t=i.toRadians(t),e=i.toRadians(e),u.fromRadians(t,e,n,r)};var E=new t,s=new t,c=new t,_=new t(1/6378137,1/6378137,1/6356752.314245179),T=new t(1/40680631590769,1/40680631590769,1/40408299984661.445),l=i.EPSILON1;return u.fromCartesian=function(e,r,a){var R=n(r)?r.oneOverRadii:_,f=n(r)?r.oneOverRadiiSquared:T,A=n(r)?r._centerToleranceSquared:l,h=o(e,R,f,A,s);if(n(h)){var N=t.multiplyComponents(h,f,E);N=t.normalize(N,N);var d=t.subtract(e,h,c),I=Math.atan2(N.y,N.x),S=Math.asin(N.z),m=i.sign(t.dot(d,e))*t.magnitude(d);return n(a)?(a.longitude=I,a.latitude=S,a.height=m,a):new u(I,S,m)}},u.clone=function(t,e){if(n(t))return n(e)?(e.longitude=t.longitude,e.latitude=t.latitude,e.height=t.height,e):new u(t.longitude,t.latitude,t.height)},u.equals=function(t,e){return t===e||n(t)&&n(e)&&t.longitude===e.longitude&&t.latitude===e.latitude&&t.height===e.height},u.equalsEpsilon=function(t,e,r){return t===e||n(t)&&n(e)&&Math.abs(t.longitude-e.longitude)<=r&&Math.abs(t.latitude-e.latitude)<=r&&Math.abs(t.height-e.height)<=r},u.ZERO=a(new u(0,0,0)),u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.prototype.equalsEpsilon=function(t,e){return u.equalsEpsilon(this,t,e)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(t){"use strict";var e=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(t){return!1}}(),n=Object.defineProperties;return e&&t(n)||(n=function(t){return t}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,n,r,a,i,o,u,E){"use strict";function s(e,r,a,i){r=n(r,0),a=n(a,0),i=n(i,0),e._radii=new t(r,a,i),e._radiiSquared=new t(r*r,a*a,i*i),e._radiiToTheFourth=new t(r*r*r*r,a*a*a*a,i*i*i*i),e._oneOverRadii=new t(0===r?0:1/r,0===a?0:1/a,0===i?0:1/i),e._oneOverRadiiSquared=new t(0===r?0:1/(r*r),0===a?0:1/(a*a),0===i?0:1/(i*i)),e._minimumRadius=Math.min(r,a,i),e._maximumRadius=Math.max(r,a,i),e._centerToleranceSquared=u.EPSILON1,0!==e._radiiSquared.z&&(e._sqauredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function c(t,e,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,s(this,t,e,n)}a(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(e,n){if(r(e)){var a=e._radii;return r(n)?(t.clone(a,n._radii),t.clone(e._radiiSquared,n._radiiSquared),t.clone(e._radiiToTheFourth,n._radiiToTheFourth),t.clone(e._oneOverRadii,n._oneOverRadii),t.clone(e._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=e._minimumRadius,n._maximumRadius=e._maximumRadius,n._centerToleranceSquared=e._centerToleranceSquared,n):new c(a.x,a.y,a.z)}},c.fromCartesian3=function(t,e){return r(e)||(e=new c),r(t)?(s(e,t.x,t.y,t.z),e):e},c.WGS84=o(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=o(new c(1,1,1)),c.MOON=o(new c(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),c.prototype.clone=function(t){return c.clone(this,t)},c.packedLength=t.packedLength,c.pack=function(e,r,a){return a=n(a,0),t.pack(e._radii,r,a),r},c.unpack=function(e,r,a){r=n(r,0);var i=t.unpack(e,r);return c.fromCartesian3(i,a)},c.prototype.geocentricSurfaceNormal=t.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(e,n){var a=e.longitude,i=e.latitude,o=Math.cos(i),u=o*Math.cos(a),E=o*Math.sin(a),s=Math.sin(i);return r(n)||(n=new t),n.x=u,n.y=E,n.z=s,t.normalize(n,n)},c.prototype.geodeticSurfaceNormal=function(e,n){return r(n)||(n=new t),n=t.multiplyComponents(e,this._oneOverRadiiSquared,n),t.normalize(n,n)};var _=new t,T=new t;c.prototype.cartographicToCartesian=function(e,n){var a=_,i=T;this.geodeticSurfaceNormalCartographic(e,a),t.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(t.dot(a,i));return t.divideByScalar(i,o,i),t.multiplyByScalar(a,e.height,a),r(n)||(n=new t),t.add(i,a,n)},c.prototype.cartographicArrayToCartesianArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var a=0;a<n;a++)e[a]=this.cartographicToCartesian(t[a],e[a]);return e};var l=new t,R=new t,f=new t;return c.prototype.cartesianToCartographic=function(n,a){var i=this.scaleToGeodeticSurface(n,R);if(r(i)){var o=this.geodeticSurfaceNormal(i,l),E=t.subtract(n,i,f),s=Math.atan2(o.y,o.x),c=Math.asin(o.z),_=u.sign(t.dot(E,n))*t.magnitude(E);return r(a)?(a.longitude=s,a.latitude=c,a.height=_,a):new e(s,c,_)}},c.prototype.cartesianArrayToCartographicArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var a=0;a<n;++a)e[a]=this.cartesianToCartographic(t[a],e[a]);return e},c.prototype.scaleToGeodeticSurface=function(t,e){return E(t,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,e)},c.prototype.scaleToGeocentricSurface=function(e,n){r(n)||(n=new t);var a=e.x,i=e.y,o=e.z,u=this._oneOverRadiiSquared,E=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return t.multiplyByScalar(e,E,n)},c.prototype.transformPositionToScaledSpace=function(e,n){return r(n)||(n=new t),t.multiplyComponents(e,this._oneOverRadii,n)},c.prototype.transformPositionFromScaledSpace=function(e,n){return r(n)||(n=new t),t.multiplyComponents(e,this._radii,n)},c.prototype.equals=function(e){return this===e||r(e)&&t.equals(this._radii,e._radii)},c.prototype.toString=function(){return this._radii.toString()},c.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,a,i){a=n(a,0);var o=this._sqauredXOverSquaredZ;if(r(i)||(i=new t),i.x=0,i.y=0,i.z=e.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},c}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(t,e,n,r,a,i,o){"use strict";function u(t){this._ellipsoid=n(t,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(e,n){var a=this._semimajorAxis,i=e.longitude*a,o=e.latitude*a,u=e.height;return r(n)?(n.x=i,n.y=o,n.z=u,n):new t(i,o,u)},u.prototype.unproject=function(t,n){var a=this._oneOverSemimajorAxis,i=t.x*a,o=t.y*a,u=t.z;return r(n)?(n.longitude=i,n.latitude=o,n.height=u,n):new e(i,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(t){"use strict";var e={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return t(e)}),define("Core/Interval",["./defaultValue"],function(t){"use strict";function e(e,n){this.start=t(e,0),this.stop=t(n,0)}return e}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,a,i,o,u){"use strict";function E(t,e,r,a,i,o,u,E,s){this[0]=n(t,0),this[1]=n(a,0),this[2]=n(u,0),this[3]=n(e,0),this[4]=n(i,0),this[5]=n(E,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(s,0)}function s(t){for(var e=0,n=0;n<9;++n){var r=t[n];e+=r*r}return Math.sqrt(e)}function c(t){for(var e=0,n=0;n<3;++n){var r=t[E.getElementIndex(f[n],R[n])];e+=2*r*r}return Math.sqrt(e)}function _(t,e){for(var n=u.EPSILON15,r=0,a=1,i=0;i<3;++i){var o=Math.abs(t[E.getElementIndex(f[i],R[i])]);o>r&&(a=i,r=o)}var s=1,c=0,_=R[a],T=f[a];if(Math.abs(t[E.getElementIndex(T,_)])>n){var l,A=t[E.getElementIndex(T,T)],h=t[E.getElementIndex(_,_)],N=t[E.getElementIndex(T,_)],d=(A-h)/2/N;l=d<0?-1/(-d+Math.sqrt(1+d*d)):1/(d+Math.sqrt(1+d*d)),s=1/Math.sqrt(1+l*l),c=l*s}return e=E.clone(E.IDENTITY,e),e[E.getElementIndex(_,_)]=e[E.getElementIndex(T,T)]=s,e[E.getElementIndex(T,_)]=c,e[E.getElementIndex(_,T)]=-c,e}E.packedLength=9,E.pack=function(t,e,r){return r=n(r,0),e[r++]=t[0],e[r++]=t[1],e[r++]=t[2],e[r++]=t[3],e[r++]=t[4],e[r++]=t[5],e[r++]=t[6],e[r++]=t[7],e[r++]=t[8],e},E.unpack=function(t,e,a){return e=n(e,0),r(a)||(a=new E),a[0]=t[e++],a[1]=t[e++],a[2]=t[e++],a[3]=t[e++],a[4]=t[e++],a[5]=t[e++],a[6]=t[e++],a[7]=t[e++],a[8]=t[e++],a},E.clone=function(t,e){if(r(t))return r(e)?(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):new E(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8])},E.fromArray=function(t,e,a){return e=n(e,0),r(a)||(a=new E),a[0]=t[e],a[1]=t[e+1],a[2]=t[e+2],a[3]=t[e+3],a[4]=t[e+4],a[5]=t[e+5],a[6]=t[e+6],a[7]=t[e+7],a[8]=t[e+8],a},E.fromColumnMajorArray=function(t,e){return E.clone(t,e)},E.fromRowMajorArray=function(t,e){return r(e)?(e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],e):new E(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},E.fromQuaternion=function(t,e){var n=t.x*t.x,a=t.x*t.y,i=t.x*t.z,o=t.x*t.w,u=t.y*t.y,s=t.y*t.z,c=t.y*t.w,_=t.z*t.z,T=t.z*t.w,l=t.w*t.w,R=n-u-_+l,f=2*(a-T),A=2*(i+c),h=2*(a+T),N=-n+u-_+l,d=2*(s-o),I=2*(i-c),S=2*(s+o),m=-n-u+_+l;return r(e)?(e[0]=R,e[1]=h,e[2]=I,e[3]=f,e[4]=N,e[5]=S,e[6]=A,e[7]=d,e[8]=m,e):new E(R,f,A,h,N,d,I,S,m)},E.fromHeadingPitchRoll=function(t,e){var n=Math.cos(-t.pitch),a=Math.cos(-t.heading),i=Math.cos(t.roll),o=Math.sin(-t.pitch),u=Math.sin(-t.heading),s=Math.sin(t.roll),c=n*a,_=-i*u+s*o*a,T=s*u+i*o*a,l=n*u,R=i*a+s*o*u,f=-o*i+i*o*u,A=-o,h=s*n,N=i*n;return r(e)?(e[0]=c,e[1]=l,e[2]=A,e[3]=_,e[4]=R,e[5]=h,e[6]=T,e[7]=f,e[8]=N,e):new E(c,_,T,l,R,f,A,h,N)},E.fromScale=function(t,e){return r(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=t.y,e[5]=0,e[6]=0,e[7]=0,e[8]=t.z,e):new E(t.x,0,0,0,t.y,0,0,0,t.z)},E.fromUniformScale=function(t,e){return r(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=t,e[5]=0,e[6]=0,e[7]=0,e[8]=t,e):new E(t,0,0,0,t,0,0,0,t)},E.fromCrossProduct=function(t,e){return r(e)?(e[0]=0,e[1]=t.z,e[2]=-t.y,e[3]=-t.z,e[4]=0,e[5]=t.x,e[6]=t.y,e[7]=-t.x,e[8]=0,e):new E(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},E.fromRotationX=function(t,e){var n=Math.cos(t),a=Math.sin(t);return r(e)?(e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=n,e[5]=a,e[6]=0,e[7]=-a,e[8]=n,e):new E(1,0,0,0,n,-a,0,a,n)},E.fromRotationY=function(t,e){var n=Math.cos(t),a=Math.sin(t);return r(e)?(e[0]=n,e[1]=0,e[2]=-a,e[3]=0,e[4]=1,e[5]=0,e[6]=a,e[7]=0,e[8]=n,e):new E(n,0,a,0,1,0,-a,0,n)},E.fromRotationZ=function(t,e){var n=Math.cos(t),a=Math.sin(t);return r(e)?(e[0]=n,e[1]=a,e[2]=0,e[3]=-a,e[4]=n,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e):new E(n,-a,0,a,n,0,0,0,1)},E.toArray=function(t,e){return r(e)?(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):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},E.getElementIndex=function(t,e){return 3*t+e},E.getColumn=function(t,e,n){var r=3*e,a=t[r],i=t[r+1],o=t[r+2];return n.x=a,n.y=i,n.z=o,n},E.setColumn=function(t,e,n,r){r=E.clone(t,r);var a=3*e;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},E.getRow=function(t,e,n){var r=t[e],a=t[e+3],i=t[e+6];return n.x=r,n.y=a,n.z=i,n},E.setRow=function(t,e,n,r){return r=E.clone(t,r),r[e]=n.x,r[e+3]=n.y,r[e+6]=n.z,r};var T=new t;E.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],T)),n.y=t.magnitude(t.fromElements(e[3],e[4],e[5],T)),n.z=t.magnitude(t.fromElements(e[6],e[7],e[8],T)),n};var l=new t;E.getMaximumScale=function(e){return E.getScale(e,l),t.maximumComponent(l)},E.multiply=function(t,e,n){var r=t[0]*e[0]+t[3]*e[1]+t[6]*e[2],a=t[1]*e[0]+t[4]*e[1]+t[7]*e[2],i=t[2]*e[0]+t[5]*e[1]+t[8]*e[2],o=t[0]*e[3]+t[3]*e[4]+t[6]*e[5],u=t[1]*e[3]+t[4]*e[4]+t[7]*e[5],E=t[2]*e[3]+t[5]*e[4]+t[8]*e[5],s=t[0]*e[6]+t[3]*e[7]+t[6]*e[8],c=t[1]*e[6]+t[4]*e[7]+t[7]*e[8],_=t[2]*e[6]+t[5]*e[7]+t[8]*e[8];return n[0]=r,n[1]=a,n[2]=i,n[3]=o,n[4]=u,n[5]=E,n[6]=s,n[7]=c,n[8]=_,n},E.add=function(t,e,n){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n[4]=t[4]+e[4],n[5]=t[5]+e[5],n[6]=t[6]+e[6],n[7]=t[7]+e[7],n[8]=t[8]+e[8],n},E.subtract=function(t,e,n){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n[4]=t[4]-e[4],n[5]=t[5]-e[5],n[6]=t[6]-e[6],n[7]=t[7]-e[7],n[8]=t[8]-e[8],n},E.multiplyByVector=function(t,e,n){var r=e.x,a=e.y,i=e.z,o=t[0]*r+t[3]*a+t[6]*i,u=t[1]*r+t[4]*a+t[7]*i,E=t[2]*r+t[5]*a+t[8]*i;return n.x=o,n.y=u,n.z=E,n},E.multiplyByScalar=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n[4]=t[4]*e,n[5]=t[5]*e,n[6]=t[6]*e,n[7]=t[7]*e,n[8]=t[8]*e,n},E.multiplyByScale=function(t,e,n){return n[0]=t[0]*e.x,n[1]=t[1]*e.x,n[2]=t[2]*e.x,n[3]=t[3]*e.y,n[4]=t[4]*e.y,n[5]=t[5]*e.y,n[6]=t[6]*e.z,n[7]=t[7]*e.z,n[8]=t[8]*e.z,n},E.negate=function(t,e){return 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},E.transpose=function(t,e){var n=t[0],r=t[3],a=t[6],i=t[1],o=t[4],u=t[7],E=t[2],s=t[5],c=t[8];return e[0]=n,e[1]=r,e[2]=a,e[3]=i,e[4]=o,e[5]=u,e[6]=E,e[7]=s,e[8]=c,e};var R=[1,0,0],f=[2,2,1],A=new E,h=new E;return E.computeEigenDecomposition=function(t,e){var n=u.EPSILON20,a=10,i=0,o=0;r(e)||(e={});for(var T=e.unitary=E.clone(E.IDENTITY,e.unitary),l=e.diagonal=E.clone(t,e.diagonal),R=n*s(l);o<a&&c(l)>R;)_(l,A),E.transpose(A,h),E.multiply(l,A,l),E.multiply(h,l,l),E.multiply(T,A,T),++i>2&&(++o,i=0);return e},E.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e},E.determinant=function(t){var e=t[0],n=t[3],r=t[6],a=t[1],i=t[4],o=t[7],u=t[2],E=t[5],s=t[8];return e*(i*s-E*o)+a*(E*r-n*s)+u*(n*o-i*r)},E.inverse=function(t,e){var n=t[0],r=t[1],a=t[2],i=t[3],o=t[4],u=t[5],s=t[6],c=t[7],_=t[8],T=E.determinant(t);e[0]=o*_-c*u,e[1]=c*a-r*_,e[2]=r*u-o*a,e[3]=s*u-i*_,e[4]=n*_-s*a,e[5]=i*a-n*u,e[6]=i*c-s*o,e[7]=s*r-n*c,e[8]=n*o-i*r;var l=1/T;return E.multiplyByScalar(e,l,e)},E.equals=function(t,e){return t===e||r(t)&&r(e)&&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]},E.equalsEpsilon=function(t,e,n){return t===e||r(t)&&r(e)&&Math.abs(t[0]-e[0])<=n&&Math.abs(t[1]-e[1])<=n&&Math.abs(t[2]-e[2])<=n&&Math.abs(t[3]-e[3])<=n&&Math.abs(t[4]-e[4])<=n&&Math.abs(t[5]-e[5])<=n&&Math.abs(t[6]-e[6])<=n&&Math.abs(t[7]-e[7])<=n&&Math.abs(t[8]-e[8])<=n},E.IDENTITY=o(new E(1,0,0,0,1,0,0,0,1)),E.ZERO=o(new E(0,0,0,0,0,0,0,0,0)),E.COLUMN0ROW0=0,E.COLUMN0ROW1=1,E.COLUMN0ROW2=2,E.COLUMN1ROW0=3,E.COLUMN1ROW1=4,E.COLUMN1ROW2=5,E.COLUMN2ROW0=6,E.COLUMN2ROW1=7,E.COLUMN2ROW2=8,a(E.prototype,{length:{get:function(){return E.packedLength}}}),E.prototype.clone=function(t){return E.clone(this,t)},E.prototype.equals=function(t){return E.equals(this,t)},E.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]&&t[4]===e[n+4]&&t[5]===e[n+5]&&t[6]===e[n+6]&&t[7]===e[n+7]&&t[8]===e[n+8]},E.prototype.equalsEpsilon=function(t,e){return E.equalsEpsilon(this,t,e)},E.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},E}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,a,i){"use strict";function o(t,n,r,a){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0),this.w=e(a,0)}o.fromElements=function(t,e,r,a,i){return n(i)?(i.x=t,i.y=e,i.z=r,i.w=a,i):new o(t,e,r,a)},o.fromColor=function(t,e){return n(e)?(e.x=t.red,e.y=t.green,e.z=t.blue,e.w=t.alpha,e):new o(t.red,t.green,t.blue,t.alpha)},o.clone=function(t,e){if(n(t))return n(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e):new o(t.x,t.y,t.z,t.w)},o.packedLength=4,o.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w,n},o.unpack=function(t,r,a){return r=e(r,0),n(a)||(a=new o),a.x=t[r++],a.y=t[r++],a.z=t[r++],a.w=t[r],a},o.packArray=function(t,e){var r=t.length;n(e)?e.length=4*r:e=new Array(4*r);for(var a=0;a<r;++a)o.pack(t[a],e,4*a);return e},o.unpackArray=function(t,e){var r=t.length;n(e)?e.length=r/4:e=new Array(r/4);for(var a=0;a<r;a+=4){var i=a/4;e[i]=o.unpack(t,a,e[i])}return e},o.fromArray=o.unpack,o.maximumComponent=function(t){return Math.max(t.x,t.y,t.z,t.w)},o.minimumComponent=function(t){return Math.min(t.x,t.y,t.z,t.w)},o.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n.z=Math.min(t.z,e.z),n.w=Math.min(t.w,e.w),n},o.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n.z=Math.max(t.z,e.z),n.w=Math.max(t.w,e.w),n},o.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w},o.magnitude=function(t){return Math.sqrt(o.magnitudeSquared(t))};var u=new o;o.distance=function(t,e){return o.subtract(t,e,u),o.magnitude(u)},o.distanceSquared=function(t,e){return o.subtract(t,e,u),o.magnitudeSquared(u)},o.normalize=function(t,e){var n=o.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e.w=t.w/n,e},o.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z+t.w*e.w},o.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n.z=t.z*e.z,n.w=t.w*e.w,n},o.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n.z=t.z/e.z,n.w=t.w/e.w,n},o.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n.w=t.w+e.w,n},o.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n.w=t.w-e.w,n},o.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*e,n.w=t.w*e,n},o.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n.w=t.w/e,n},o.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e.w=-t.w,e},o.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e.w=Math.abs(t.w),e};var E=new o;o.lerp=function(t,e,n,r){return o.multiplyByScalar(e,n,E),r=o.multiplyByScalar(t,1-n,r),o.add(E,r,r)};var s=new o;return o.mostOrthogonalAxis=function(t,e){var n=o.normalize(t,s);return o.abs(n,n),e=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,e):o.clone(o.UNIT_W,e):n.z<=n.w?o.clone(o.UNIT_Z,e):o.clone(o.UNIT_W,e):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,e):o.clone(o.UNIT_W,e):n.z<=n.w?o.clone(o.UNIT_Z,e):o.clone(o.UNIT_W,e)},o.equals=function(t,e){return t===e||n(t)&&n(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z&&t.w===e.w},o.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]&&t.w===e[n+3]},o.equalsEpsilon=function(t,e,r,a){return t===e||n(t)&&n(e)&&i.equalsEpsilon(t.x,e.x,r,a)&&i.equalsEpsilon(t.y,e.y,r,a)&&i.equalsEpsilon(t.z,e.z,r,a)&&i.equalsEpsilon(t.w,e.w,r,a)},o.ZERO=a(new o(0,0,0,0)),o.UNIT_X=a(new o(1,0,0,0)),o.UNIT_Y=a(new o(0,1,0,0)),o.UNIT_Z=a(new o(0,0,1,0)),o.UNIT_W=a(new o(0,0,0,1)),o.prototype.clone=function(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.prototype.equalsEpsilon=function(t,e,n){return o.equalsEpsilon(this,t,e,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(t){"use strict";function e(t){this.name="RuntimeError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(t,e,n,r,a,i,o,u,E,s,c){ +"use strict";function _(t,e,n,a,i,o,u,E,s,c,_,T,l,R,f,A){this[0]=r(t,0),this[1]=r(i,0),this[2]=r(s,0),this[3]=r(l,0),this[4]=r(e,0),this[5]=r(o,0),this[6]=r(c,0),this[7]=r(R,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(_,0),this[11]=r(f,0),this[12]=r(a,0),this[13]=r(E,0),this[14]=r(T,0),this[15]=r(A,0)}_.packedLength=16,_.pack=function(t,e,n){return n=r(n,0),e[n++]=t[0],e[n++]=t[1],e[n++]=t[2],e[n++]=t[3],e[n++]=t[4],e[n++]=t[5],e[n++]=t[6],e[n++]=t[7],e[n++]=t[8],e[n++]=t[9],e[n++]=t[10],e[n++]=t[11],e[n++]=t[12],e[n++]=t[13],e[n++]=t[14],e[n]=t[15],e},_.unpack=function(t,e,n){return e=r(e,0),a(n)||(n=new _),n[0]=t[e++],n[1]=t[e++],n[2]=t[e++],n[3]=t[e++],n[4]=t[e++],n[5]=t[e++],n[6]=t[e++],n[7]=t[e++],n[8]=t[e++],n[9]=t[e++],n[10]=t[e++],n[11]=t[e++],n[12]=t[e++],n[13]=t[e++],n[14]=t[e++],n[15]=t[e],n},_.clone=function(t,e){if(a(t))return a(e)?(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],e):new _(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15])},_.fromArray=_.unpack,_.fromColumnMajorArray=function(t,e){return _.clone(t,e)},_.fromRowMajorArray=function(t,e){return a(e)?(e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15],e):new _(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},_.fromRotationTranslation=function(e,n,i){return n=r(n,t.ZERO),a(i)?(i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=0,i[4]=e[3],i[5]=e[4],i[6]=e[5],i[7]=0,i[8]=e[6],i[9]=e[7],i[10]=e[8],i[11]=0,i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=1,i):new _(e[0],e[3],e[6],n.x,e[1],e[4],e[7],n.y,e[2],e[5],e[8],n.z,0,0,0,1)},_.fromTranslationQuaternionRotationScale=function(t,e,n,r){a(r)||(r=new _);var i=n.x,o=n.y,u=n.z,E=e.x*e.x,s=e.x*e.y,c=e.x*e.z,T=e.x*e.w,l=e.y*e.y,R=e.y*e.z,f=e.y*e.w,A=e.z*e.z,h=e.z*e.w,N=e.w*e.w,d=E-l-A+N,I=2*(s-h),S=2*(c+f),m=2*(s+h),M=-E+l-A+N,O=2*(R-T),y=2*(c-f),p=2*(R+T),C=-E-l+A+N;return r[0]=d*i,r[1]=m*i,r[2]=y*i,r[3]=0,r[4]=I*o,r[5]=M*o,r[6]=p*o,r[7]=0,r[8]=S*u,r[9]=O*u,r[10]=C*u,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,r},_.fromTranslationRotationScale=function(t,e){return _.fromTranslationQuaternionRotationScale(t.translation,t.rotation,t.scale,e)},_.fromTranslation=function(t,e){return _.fromRotationTranslation(s.IDENTITY,t,e)},_.fromScale=function(t,e){return a(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t.y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t.z,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new _(t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1)},_.fromUniformScale=function(t,e){return a(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new _(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1)};var T=new t,l=new t,R=new t;_.fromCamera=function(e,n){var r=e.position,i=e.direction,o=e.up;t.normalize(i,T),t.normalize(t.cross(T,o,l),l),t.normalize(t.cross(l,T,R),R);var u=l.x,E=l.y,s=l.z,c=T.x,f=T.y,A=T.z,h=R.x,N=R.y,d=R.z,I=r.x,S=r.y,m=r.z,M=u*-I+E*-S+s*-m,O=h*-I+N*-S+d*-m,y=c*I+f*S+A*m;return a(n)?(n[0]=u,n[1]=h,n[2]=-c,n[3]=0,n[4]=E,n[5]=N,n[6]=-f,n[7]=0,n[8]=s,n[9]=d,n[10]=-A,n[11]=0,n[12]=M,n[13]=O,n[14]=y,n[15]=1,n):new _(u,E,s,M,h,N,d,O,-c,-f,-A,y,0,0,0,1)},_.computePerspectiveFieldOfView=function(t,e,n,r,a){var i=Math.tan(.5*t),o=1/i,u=o/e,E=(r+n)/(n-r),s=2*r*n/(n-r);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=E,a[11]=-1,a[12]=0,a[13]=0,a[14]=s,a[15]=0,a},_.computeOrthographicOffCenter=function(t,e,n,r,a,i,o){var u=1/(e-t),E=1/(r-n),s=1/(i-a),c=-(e+t)*u,_=-(r+n)*E,T=-(i+a)*s;return u*=2,E*=2,s*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=s,o[11]=0,o[12]=c,o[13]=_,o[14]=T,o[15]=1,o},_.computePerspectiveOffCenter=function(t,e,n,r,a,i,o){var u=2*a/(e-t),E=2*a/(r-n),s=(e+t)/(e-t),c=(r+n)/(r-n),_=-(i+a)/(i-a),T=-1,l=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=s,o[9]=c,o[10]=_,o[11]=T,o[12]=0,o[13]=0,o[14]=l,o[15]=0,o},_.computeInfinitePerspectiveOffCenter=function(t,e,n,r,a,i){var o=2*a/(e-t),u=2*a/(r-n),E=(e+t)/(e-t),s=(r+n)/(r-n),c=-1,_=-1,T=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=E,i[9]=s,i[10]=c,i[11]=_,i[12]=0,i[13]=0,i[14]=T,i[15]=0,i},_.computeViewportTransformation=function(t,e,n,a){t=r(t,r.EMPTY_OBJECT);var i=r(t.x,0),o=r(t.y,0),u=r(t.width,0),E=r(t.height,0);e=r(e,0),n=r(n,1);var s=.5*u,c=.5*E,_=.5*(n-e),T=s,l=c,R=_,f=i+s,A=o+c,h=e+_,N=1;return a[0]=T,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=l,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=R,a[11]=0,a[12]=f,a[13]=A,a[14]=h,a[15]=N,a},_.computeView=function(e,n,r,a,i){return i[0]=a.x,i[1]=r.x,i[2]=-n.x,i[3]=0,i[4]=a.y,i[5]=r.y,i[6]=-n.y,i[7]=0,i[8]=a.z,i[9]=r.z,i[10]=-n.z,i[11]=0,i[12]=-t.dot(a,e),i[13]=-t.dot(r,e),i[14]=t.dot(n,e),i[15]=1,i},_.toArray=function(t,e){return a(e)?(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],e):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]},_.getElementIndex=function(t,e){return 4*t+e},_.getColumn=function(t,e,n){var r=4*e,a=t[r],i=t[r+1],o=t[r+2],u=t[r+3];return n.x=a,n.y=i,n.z=o,n.w=u,n},_.setColumn=function(t,e,n,r){r=_.clone(t,r);var a=4*e;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r[a+3]=n.w,r},_.setTranslation=function(t,e,n){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=t[15],n},_.getRow=function(t,e,n){var r=t[e],a=t[e+4],i=t[e+8],o=t[e+12];return n.x=r,n.y=a,n.z=i,n.w=o,n},_.setRow=function(t,e,n,r){return r=_.clone(t,r),r[e]=n.x,r[e+4]=n.y,r[e+8]=n.z,r[e+12]=n.w,r};var f=new t;_.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],f)),n.y=t.magnitude(t.fromElements(e[4],e[5],e[6],f)),n.z=t.magnitude(t.fromElements(e[8],e[9],e[10],f)),n};var A=new t;_.getMaximumScale=function(e){return _.getScale(e,A),t.maximumComponent(A)},_.multiply=function(t,e,n){var r=t[0],a=t[1],i=t[2],o=t[3],u=t[4],E=t[5],s=t[6],c=t[7],_=t[8],T=t[9],l=t[10],R=t[11],f=t[12],A=t[13],h=t[14],N=t[15],d=e[0],I=e[1],S=e[2],m=e[3],M=e[4],O=e[5],y=e[6],p=e[7],C=e[8],U=e[9],L=e[10],F=e[11],P=e[12],g=e[13],w=e[14],v=e[15],x=r*d+u*I+_*S+f*m,D=a*d+E*I+T*S+A*m,B=i*d+s*I+l*S+h*m,z=o*d+c*I+R*S+N*m,G=r*M+u*O+_*y+f*p,b=a*M+E*O+T*y+A*p,X=i*M+s*O+l*y+h*p,V=o*M+c*O+R*y+N*p,q=r*C+u*U+_*L+f*F,H=a*C+E*U+T*L+A*F,W=i*C+s*U+l*L+h*F,Y=o*C+c*U+R*L+N*F,k=r*P+u*g+_*w+f*v,K=a*P+E*g+T*w+A*v,Z=i*P+s*g+l*w+h*v,j=o*P+c*g+R*w+N*v;return n[0]=x,n[1]=D,n[2]=B,n[3]=z,n[4]=G,n[5]=b,n[6]=X,n[7]=V,n[8]=q,n[9]=H,n[10]=W,n[11]=Y,n[12]=k,n[13]=K,n[14]=Z,n[15]=j,n},_.add=function(t,e,n){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n[4]=t[4]+e[4],n[5]=t[5]+e[5],n[6]=t[6]+e[6],n[7]=t[7]+e[7],n[8]=t[8]+e[8],n[9]=t[9]+e[9],n[10]=t[10]+e[10],n[11]=t[11]+e[11],n[12]=t[12]+e[12],n[13]=t[13]+e[13],n[14]=t[14]+e[14],n[15]=t[15]+e[15],n},_.subtract=function(t,e,n){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n[4]=t[4]-e[4],n[5]=t[5]-e[5],n[6]=t[6]-e[6],n[7]=t[7]-e[7],n[8]=t[8]-e[8],n[9]=t[9]-e[9],n[10]=t[10]-e[10],n[11]=t[11]-e[11],n[12]=t[12]-e[12],n[13]=t[13]-e[13],n[14]=t[14]-e[14],n[15]=t[15]-e[15],n},_.multiplyTransformation=function(t,e,n){var r=t[0],a=t[1],i=t[2],o=t[4],u=t[5],E=t[6],s=t[8],c=t[9],_=t[10],T=t[12],l=t[13],R=t[14],f=e[0],A=e[1],h=e[2],N=e[4],d=e[5],I=e[6],S=e[8],m=e[9],M=e[10],O=e[12],y=e[13],p=e[14],C=r*f+o*A+s*h,U=a*f+u*A+c*h,L=i*f+E*A+_*h,F=r*N+o*d+s*I,P=a*N+u*d+c*I,g=i*N+E*d+_*I,w=r*S+o*m+s*M,v=a*S+u*m+c*M,x=i*S+E*m+_*M,D=r*O+o*y+s*p+T,B=a*O+u*y+c*p+l,z=i*O+E*y+_*p+R;return n[0]=C,n[1]=U,n[2]=L,n[3]=0,n[4]=F,n[5]=P,n[6]=g,n[7]=0,n[8]=w,n[9]=v,n[10]=x,n[11]=0,n[12]=D,n[13]=B,n[14]=z,n[15]=1,n},_.multiplyByMatrix3=function(t,e,n){var r=t[0],a=t[1],i=t[2],o=t[4],u=t[5],E=t[6],s=t[8],c=t[9],_=t[10],T=e[0],l=e[1],R=e[2],f=e[3],A=e[4],h=e[5],N=e[6],d=e[7],I=e[8],S=r*T+o*l+s*R,m=a*T+u*l+c*R,M=i*T+E*l+_*R,O=r*f+o*A+s*h,y=a*f+u*A+c*h,p=i*f+E*A+_*h,C=r*N+o*d+s*I,U=a*N+u*d+c*I,L=i*N+E*d+_*I;return n[0]=S,n[1]=m,n[2]=M,n[3]=0,n[4]=O,n[5]=y,n[6]=p,n[7]=0,n[8]=C,n[9]=U,n[10]=L,n[11]=0,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n},_.multiplyByTranslation=function(t,e,n){var r=e.x,a=e.y,i=e.z,o=r*t[0]+a*t[4]+i*t[8]+t[12],u=r*t[1]+a*t[5]+i*t[9]+t[13],E=r*t[2]+a*t[6]+i*t[10]+t[14];return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=o,n[13]=u,n[14]=E,n[15]=t[15],n};var h=new t;_.multiplyByUniformScale=function(t,e,n){return h.x=e,h.y=e,h.z=e,_.multiplyByScale(t,h,n)},_.multiplyByScale=function(t,e,n){var r=e.x,a=e.y,i=e.z;return 1===r&&1===a&&1===i?_.clone(t,n):(n[0]=r*t[0],n[1]=r*t[1],n[2]=r*t[2],n[3]=0,n[4]=a*t[4],n[5]=a*t[5],n[6]=a*t[6],n[7]=0,n[8]=i*t[8],n[9]=i*t[9],n[10]=i*t[10],n[11]=0,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=1,n)},_.multiplyByVector=function(t,e,n){var r=e.x,a=e.y,i=e.z,o=e.w,u=t[0]*r+t[4]*a+t[8]*i+t[12]*o,E=t[1]*r+t[5]*a+t[9]*i+t[13]*o,s=t[2]*r+t[6]*a+t[10]*i+t[14]*o,c=t[3]*r+t[7]*a+t[11]*i+t[15]*o;return n.x=u,n.y=E,n.z=s,n.w=c,n},_.multiplyByPointAsVector=function(t,e,n){var r=e.x,a=e.y,i=e.z,o=t[0]*r+t[4]*a+t[8]*i,u=t[1]*r+t[5]*a+t[9]*i,E=t[2]*r+t[6]*a+t[10]*i;return n.x=o,n.y=u,n.z=E,n},_.multiplyByPoint=function(t,e,n){var r=e.x,a=e.y,i=e.z,o=t[0]*r+t[4]*a+t[8]*i+t[12],u=t[1]*r+t[5]*a+t[9]*i+t[13],E=t[2]*r+t[6]*a+t[10]*i+t[14];return n.x=o,n.y=u,n.z=E,n},_.multiplyByScalar=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n[4]=t[4]*e,n[5]=t[5]*e,n[6]=t[6]*e,n[7]=t[7]*e,n[8]=t[8]*e,n[9]=t[9]*e,n[10]=t[10]*e,n[11]=t[11]*e,n[12]=t[12]*e,n[13]=t[13]*e,n[14]=t[14]*e,n[15]=t[15]*e,n},_.negate=function(t,e){return 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],e},_.transpose=function(t,e){var n=t[1],r=t[2],a=t[3],i=t[6],o=t[7],u=t[11];return e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=r,e[9]=i,e[10]=t[10],e[11]=t[14],e[12]=a,e[13]=o,e[14]=u,e[15]=t[15],e},_.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e[9]=Math.abs(t[9]),e[10]=Math.abs(t[10]),e[11]=Math.abs(t[11]),e[12]=Math.abs(t[12]),e[13]=Math.abs(t[13]),e[14]=Math.abs(t[14]),e[15]=Math.abs(t[15]),e},_.equals=function(t,e){return t===e||a(t)&&a(e)&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[3]===e[3]&&t[7]===e[7]&&t[11]===e[11]&&t[15]===e[15]},_.equalsEpsilon=function(t,e,n){return t===e||a(t)&&a(e)&&Math.abs(t[0]-e[0])<=n&&Math.abs(t[1]-e[1])<=n&&Math.abs(t[2]-e[2])<=n&&Math.abs(t[3]-e[3])<=n&&Math.abs(t[4]-e[4])<=n&&Math.abs(t[5]-e[5])<=n&&Math.abs(t[6]-e[6])<=n&&Math.abs(t[7]-e[7])<=n&&Math.abs(t[8]-e[8])<=n&&Math.abs(t[9]-e[9])<=n&&Math.abs(t[10]-e[10])<=n&&Math.abs(t[11]-e[11])<=n&&Math.abs(t[12]-e[12])<=n&&Math.abs(t[13]-e[13])<=n&&Math.abs(t[14]-e[14])<=n&&Math.abs(t[15]-e[15])<=n},_.getTranslation=function(t,e){return e.x=t[12],e.y=t[13],e.z=t[14],e},_.getRotation=function(t,e){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e};var N=new s,d=new s,I=new e,S=new e(0,0,0,1);return _.inverse=function(t,n){if(s.equalsEpsilon(_.getRotation(t,N),d,E.EPSILON7)&&e.equals(_.getRow(t,3,I),S))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-t[12],n[13]=-t[13],n[14]=-t[14],n[15]=1,n;var r=t[0],a=t[4],i=t[8],o=t[12],u=t[1],T=t[5],l=t[9],R=t[13],f=t[2],A=t[6],h=t[10],m=t[14],M=t[3],O=t[7],y=t[11],p=t[15],C=h*p,U=m*y,L=A*p,F=m*O,P=A*y,g=h*O,w=f*p,v=m*M,x=f*y,D=h*M,B=f*O,z=A*M,G=C*T+F*l+P*R-(U*T+L*l+g*R),b=U*u+w*l+D*R-(C*u+v*l+x*R),X=L*u+v*T+B*R-(F*u+w*T+z*R),V=g*u+x*T+z*l-(P*u+D*T+B*l),q=U*a+L*i+g*o-(C*a+F*i+P*o),H=C*r+v*i+x*o-(U*r+w*i+D*o),W=F*r+w*a+z*o-(L*r+v*a+B*o),Y=P*r+D*a+B*i-(g*r+x*a+z*i);C=i*R,U=o*l,L=a*R,F=o*T,P=a*l,g=i*T,w=r*R,v=o*u,x=r*l,D=i*u,B=r*T,z=a*u;var k=C*O+F*y+P*p-(U*O+L*y+g*p),K=U*M+w*y+D*p-(C*M+v*y+x*p),Z=L*M+v*O+B*p-(F*M+w*O+z*p),j=g*M+x*O+z*y-(P*M+D*O+B*y),Q=L*h+g*m+U*A-(P*m+C*A+F*h),J=x*m+C*f+v*h-(w*h+D*m+U*f),$=w*A+z*m+F*f-(B*m+L*f+v*A),tt=B*h+P*f+D*A-(x*A+z*h+g*f),et=r*G+a*b+i*X+o*V;if(Math.abs(et)<E.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return et=1/et,n[0]=G*et,n[1]=b*et,n[2]=X*et,n[3]=V*et,n[4]=q*et,n[5]=H*et,n[6]=W*et,n[7]=Y*et,n[8]=k*et,n[9]=K*et,n[10]=Z*et,n[11]=j*et,n[12]=Q*et,n[13]=J*et,n[14]=$*et,n[15]=tt*et,n},_.inverseTransformation=function(t,e){var n=t[0],r=t[1],a=t[2],i=t[4],o=t[5],u=t[6],E=t[8],s=t[9],c=t[10],_=t[12],T=t[13],l=t[14],R=-n*_-r*T-a*l,f=-i*_-o*T-u*l,A=-E*_-s*T-c*l;return e[0]=n,e[1]=i,e[2]=E,e[3]=0,e[4]=r,e[5]=o,e[6]=s,e[7]=0,e[8]=a,e[9]=u,e[10]=c,e[11]=0,e[12]=R,e[13]=f,e[14]=A,e[15]=1,e},_.IDENTITY=u(new _(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),_.ZERO=u(new _(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),_.COLUMN0ROW0=0,_.COLUMN0ROW1=1,_.COLUMN0ROW2=2,_.COLUMN0ROW3=3,_.COLUMN1ROW0=4,_.COLUMN1ROW1=5,_.COLUMN1ROW2=6,_.COLUMN1ROW3=7,_.COLUMN2ROW0=8,_.COLUMN2ROW1=9,_.COLUMN2ROW2=10,_.COLUMN2ROW3=11,_.COLUMN3ROW0=12,_.COLUMN3ROW1=13,_.COLUMN3ROW2=14,_.COLUMN3ROW3=15,i(_.prototype,{length:{get:function(){return _.packedLength}}}),_.prototype.clone=function(t){return _.clone(this,t)},_.prototype.equals=function(t){return _.equals(this,t)},_.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]&&t[4]===e[n+4]&&t[5]===e[n+5]&&t[6]===e[n+6]&&t[7]===e[n+7]&&t[8]===e[n+8]&&t[9]===e[n+9]&&t[10]===e[n+10]&&t[11]===e[n+11]&&t[12]===e[n+12]&&t[13]===e[n+13]&&t[14]===e[n+14]&&t[15]===e[n+15]},_.prototype.equalsEpsilon=function(t,e){return _.equalsEpsilon(this,t,e)},_.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]+")"},_}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(t,e,n,r,a,i,o,u,E){"use strict";function s(t,e,r,a){this.west=n(t,0),this.south=n(e,0),this.east=n(r,0),this.north=n(a,0)}a(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(t,e,r){return r=n(r,0),e[r++]=t.west,e[r++]=t.south,e[r++]=t.east,e[r]=t.north,e},s.unpack=function(t,e,a){return e=n(e,0),r(a)||(a=new s),a.west=t[e++],a.south=t[e++],a.east=t[e++],a.north=t[e],a},s.computeWidth=function(t){var e=t.east,n=t.west;return e<n&&(e+=E.TWO_PI),e-n},s.computeHeight=function(t){return t.north-t.south},s.fromDegrees=function(t,e,a,i,o){return t=E.toRadians(n(t,0)),e=E.toRadians(n(e,0)),a=E.toRadians(n(a,0)),i=E.toRadians(n(i,0)),r(o)?(o.west=t,o.south=e,o.east=a,o.north=i,o):new s(t,e,a,i)},s.fromRadians=function(t,e,a,i,o){return r(o)?(o.west=n(t,0),o.south=n(e,0),o.east=n(a,0),o.north=n(i,0),o):new s(t,e,a,i)},s.fromCartographicArray=function(t,e){for(var n=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,u=Number.MAX_VALUE,c=-Number.MAX_VALUE,_=0,T=t.length;_<T;_++){var l=t[_];n=Math.min(n,l.longitude),a=Math.max(a,l.longitude),u=Math.min(u,l.latitude),c=Math.max(c,l.latitude);var R=l.longitude>=0?l.longitude:l.longitude+E.TWO_PI;i=Math.min(i,R),o=Math.max(o,R)}return a-n>o-i&&(n=i,a=o,a>E.PI&&(a-=E.TWO_PI),n>E.PI&&(n-=E.TWO_PI)),r(e)?(e.west=n,e.south=u,e.east=a,e.north=c,e):new s(n,u,a,c)},s.fromCartesianArray=function(t,e,n){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,u=-Number.MAX_VALUE,c=Number.MAX_VALUE,_=-Number.MAX_VALUE,T=0,l=t.length;T<l;T++){var R=e.cartesianToCartographic(t[T]);a=Math.min(a,R.longitude),i=Math.max(i,R.longitude),c=Math.min(c,R.latitude),_=Math.max(_,R.latitude);var f=R.longitude>=0?R.longitude:R.longitude+E.TWO_PI;o=Math.min(o,f),u=Math.max(u,f)}return i-a>u-o&&(a=o,i=u,i>E.PI&&(i-=E.TWO_PI),a>E.PI&&(a-=E.TWO_PI)),r(n)?(n.west=a,n.south=c,n.east=i,n.north=_,n):new s(a,c,i,_)},s.clone=function(t,e){if(r(t))return r(e)?(e.west=t.west,e.south=t.south,e.east=t.east,e.north=t.north,e):new s(t.west,t.south,t.east,t.north)},s.prototype.clone=function(t){return s.clone(this,t)},s.prototype.equals=function(t){return s.equals(this,t)},s.equals=function(t,e){return t===e||r(t)&&r(e)&&t.west===e.west&&t.south===e.south&&t.east===e.east&&t.north===e.north},s.prototype.equalsEpsilon=function(t,e){return r(t)&&Math.abs(this.west-t.west)<=e&&Math.abs(this.south-t.south)<=e&&Math.abs(this.east-t.east)<=e&&Math.abs(this.north-t.north)<=e},s.validate=function(t){},s.southwest=function(e,n){return r(n)?(n.longitude=e.west,n.latitude=e.south,n.height=0,n):new t(e.west,e.south)},s.northwest=function(e,n){return r(n)?(n.longitude=e.west,n.latitude=e.north,n.height=0,n):new t(e.west,e.north)},s.northeast=function(e,n){return r(n)?(n.longitude=e.east,n.latitude=e.north,n.height=0,n):new t(e.east,e.north)},s.southeast=function(e,n){return r(n)?(n.longitude=e.east,n.latitude=e.south,n.height=0,n):new t(e.east,e.south)},s.center=function(e,n){var a=e.east,i=e.west;a<i&&(a+=E.TWO_PI);var o=E.negativePiToPi(.5*(i+a)),u=.5*(e.south+e.north);return r(n)?(n.longitude=o,n.latitude=u,n.height=0,n):new t(o,u)},s.intersection=function(t,e,n){var a=t.east,i=t.west,o=e.east,u=e.west;a<i&&o>0?a+=E.TWO_PI:o<u&&a>0&&(o+=E.TWO_PI),a<i&&u<0?u+=E.TWO_PI:o<u&&i<0&&(i+=E.TWO_PI);var c=E.negativePiToPi(Math.max(i,u)),_=E.negativePiToPi(Math.min(a,o));if(!((t.west<t.east||e.west<e.east)&&_<=c)){var T=Math.max(t.south,e.south),l=Math.min(t.north,e.north);if(!(T>=l))return r(n)?(n.west=c,n.south=T,n.east=_,n.north=l,n):new s(c,T,_,l)}},s.simpleIntersection=function(t,e,n){var a=Math.max(t.west,e.west),i=Math.max(t.south,e.south),o=Math.min(t.east,e.east),u=Math.min(t.north,e.north);if(!(i>=u||a>=o))return r(n)?(n.west=a,n.south=i,n.east=o,n.north=u,n):new s(a,i,o,u)},s.union=function(t,e,n){r(n)||(n=new s);var a=t.east,i=t.west,o=e.east,u=e.west;a<i&&o>0?a+=E.TWO_PI:o<u&&a>0&&(o+=E.TWO_PI),a<i&&u<0?u+=E.TWO_PI:o<u&&i<0&&(i+=E.TWO_PI);var c=E.convertLongitudeRange(Math.min(i,u)),_=E.convertLongitudeRange(Math.max(a,o));return n.west=c,n.south=Math.min(t.south,e.south),n.east=_,n.north=Math.max(t.north,e.north),n},s.expand=function(t,e,n){return r(n)||(n=new s),n.west=Math.min(t.west,e.longitude),n.south=Math.min(t.south,e.latitude),n.east=Math.max(t.east,e.longitude),n.north=Math.max(t.north,e.latitude),n},s.contains=function(t,e){var n=e.longitude,r=e.latitude,a=t.west,i=t.east;return i<a&&(i+=E.TWO_PI,n<0&&(n+=E.TWO_PI)),(n>a||E.equalsEpsilon(n,a,E.EPSILON14))&&(n<i||E.equalsEpsilon(n,i,E.EPSILON14))&&r>=t.south&&r<=t.north};var c=new t;return s.subsample=function(t,e,a,i){e=n(e,o.WGS84),a=n(a,0),r(i)||(i=[]);var u=0,_=t.north,T=t.south,l=t.east,R=t.west,f=c;f.height=a,f.longitude=R,f.latitude=_,i[u]=e.cartographicToCartesian(f,i[u]),u++,f.longitude=l,i[u]=e.cartographicToCartesian(f,i[u]),u++,f.latitude=T,i[u]=e.cartographicToCartesian(f,i[u]),u++,f.longitude=R,i[u]=e.cartographicToCartesian(f,i[u]),u++,_<0?f.latitude=_:T>0?f.latitude=T:f.latitude=0;for(var A=1;A<8;++A)f.longitude=-Math.PI+A*E.PI_OVER_TWO,s.contains(t,f)&&(i[u]=e.cartographicToCartesian(f,i[u]),u++);return 0===f.latitude&&(f.longitude=R,i[u]=e.cartographicToCartesian(f,i[u]),u++,f.longitude=l,i[u]=e.cartographicToCartesian(f,i[u]),u++),i.length=u,i},s.MAX_VALUE=u(new s(-Math.PI,-E.PI_OVER_TWO,Math.PI,E.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(t,e,n,r,a,i,o,u,E,s,c,_){"use strict";function T(e,n){this.center=t.clone(r(e,t.ZERO)),this.radius=r(n,0)}var l=new t,R=new t,f=new t,A=new t,h=new t,N=new t,d=new t,I=new t,S=new t,m=new t,M=new t,O=new t;T.fromPoints=function(e,n){if(a(n)||(n=new T),!a(e)||0===e.length)return n.center=t.clone(t.ZERO,n.center),n.radius=0,n;for(var r=t.clone(e[0],d),i=t.clone(r,l),o=t.clone(r,R),u=t.clone(r,f),E=t.clone(r,A),s=t.clone(r,h),c=t.clone(r,N),_=e.length,y=1;y<_;y++){t.clone(e[y],r);var p=r.x,C=r.y,U=r.z;p<i.x&&t.clone(r,i),p>E.x&&t.clone(r,E),C<o.y&&t.clone(r,o),C>s.y&&t.clone(r,s),U<u.z&&t.clone(r,u),U>c.z&&t.clone(r,c)}var L=t.magnitudeSquared(t.subtract(E,i,I)),F=t.magnitudeSquared(t.subtract(s,o,I)),P=t.magnitudeSquared(t.subtract(c,u,I)),g=i,w=E,v=L;F>v&&(v=F,g=o,w=s),P>v&&(v=P,g=u,w=c);var x=S;x.x=.5*(g.x+w.x),x.y=.5*(g.y+w.y),x.z=.5*(g.z+w.z);var D=t.magnitudeSquared(t.subtract(w,x,I)),B=Math.sqrt(D),z=m;z.x=i.x,z.y=o.y,z.z=u.z;var G=M;G.x=E.x,G.y=s.y,G.z=c.z;var b=t.multiplyByScalar(t.add(z,G,I),.5,O),X=0;for(y=0;y<_;y++){t.clone(e[y],r);var V=t.magnitude(t.subtract(r,b,I));V>X&&(X=V);var q=t.magnitudeSquared(t.subtract(r,x,I));if(q>D){var H=Math.sqrt(q);B=.5*(B+H),D=B*B;var W=H-B;x.x=(B*x.x+W*r.x)/H,x.y=(B*x.y+W*r.y)/H,x.z=(B*x.z+W*r.z)/H}}return B<X?(t.clone(x,n.center),n.radius=B):(t.clone(b,n.center),n.radius=X),n};var y=new o,p=new t,C=new t,U=new e,L=new e;T.fromRectangle2D=function(t,e,n){return T.fromRectangleWithHeights2D(t,e,0,0,n)},T.fromRectangleWithHeights2D=function(e,n,i,o,u){if(a(u)||(u=new T),!a(e))return u.center=t.clone(t.ZERO,u.center),u.radius=0,u;n=r(n,y),_.southwest(e,U),U.height=i,_.northeast(e,L),L.height=o;var E=n.project(U,p),s=n.project(L,C),c=s.x-E.x,l=s.y-E.y,R=s.z-E.z;u.radius=.5*Math.sqrt(c*c+l*l+R*R);var f=u.center;return f.x=E.x+.5*c,f.y=E.y+.5*l,f.z=E.z+.5*R,u};var F=[];T.fromRectangle3D=function(t,e,n,o){e=r(e,i.WGS84),n=r(n,0);var u;return a(t)&&(u=_.subsample(t,e,n,F)),T.fromPoints(u,o)},T.fromVertices=function(e,n,i,o){if(a(o)||(o=new T),!a(e)||0===e.length)return o.center=t.clone(t.ZERO,o.center),o.radius=0,o;n=r(n,t.ZERO),i=r(i,3);var u=d;u.x=e[0]+n.x,u.y=e[1]+n.y,u.z=e[2]+n.z;for(var E=t.clone(u,l),s=t.clone(u,R),c=t.clone(u,f),_=t.clone(u,A),y=t.clone(u,h),p=t.clone(u,N),C=e.length,U=0;U<C;U+=i){var L=e[U]+n.x,F=e[U+1]+n.y,P=e[U+2]+n.z;u.x=L,u.y=F,u.z=P,L<E.x&&t.clone(u,E),L>_.x&&t.clone(u,_),F<s.y&&t.clone(u,s),F>y.y&&t.clone(u,y),P<c.z&&t.clone(u,c),P>p.z&&t.clone(u,p)}var g=t.magnitudeSquared(t.subtract(_,E,I)),w=t.magnitudeSquared(t.subtract(y,s,I)),v=t.magnitudeSquared(t.subtract(p,c,I)),x=E,D=_,B=g;w>B&&(B=w,x=s,D=y),v>B&&(B=v,x=c,D=p);var z=S;z.x=.5*(x.x+D.x),z.y=.5*(x.y+D.y),z.z=.5*(x.z+D.z);var G=t.magnitudeSquared(t.subtract(D,z,I)),b=Math.sqrt(G),X=m;X.x=E.x,X.y=s.y,X.z=c.z;var V=M;V.x=_.x,V.y=y.y,V.z=p.z;var q=t.multiplyByScalar(t.add(X,V,I),.5,O),H=0;for(U=0;U<C;U+=i){u.x=e[U]+n.x,u.y=e[U+1]+n.y,u.z=e[U+2]+n.z;var W=t.magnitude(t.subtract(u,q,I));W>H&&(H=W);var Y=t.magnitudeSquared(t.subtract(u,z,I));if(Y>G){var k=Math.sqrt(Y);b=.5*(b+k),G=b*b;var K=k-b;z.x=(b*z.x+K*u.x)/k,z.y=(b*z.y+K*u.y)/k,z.z=(b*z.z+K*u.z)/k}}return b<H?(t.clone(z,o.center),o.radius=b):(t.clone(q,o.center),o.radius=H),o},T.fromEncodedCartesianVertices=function(e,n,r){if(a(r)||(r=new T),!a(e)||!a(n)||e.length!==n.length||0===e.length)return r.center=t.clone(t.ZERO,r.center),r.radius=0,r;var i=d;i.x=e[0]+n[0],i.y=e[1]+n[1],i.z=e[2]+n[2];for(var o=t.clone(i,l),u=t.clone(i,R),E=t.clone(i,f),s=t.clone(i,A),c=t.clone(i,h),_=t.clone(i,N),y=e.length,p=0;p<y;p+=3){var C=e[p]+n[p],U=e[p+1]+n[p+1],L=e[p+2]+n[p+2];i.x=C,i.y=U,i.z=L,C<o.x&&t.clone(i,o),C>s.x&&t.clone(i,s),U<u.y&&t.clone(i,u),U>c.y&&t.clone(i,c),L<E.z&&t.clone(i,E),L>_.z&&t.clone(i,_)}var F=t.magnitudeSquared(t.subtract(s,o,I)),P=t.magnitudeSquared(t.subtract(c,u,I)),g=t.magnitudeSquared(t.subtract(_,E,I)),w=o,v=s,x=F;P>x&&(x=P,w=u,v=c),g>x&&(x=g,w=E,v=_);var D=S;D.x=.5*(w.x+v.x),D.y=.5*(w.y+v.y),D.z=.5*(w.z+v.z);var B=t.magnitudeSquared(t.subtract(v,D,I)),z=Math.sqrt(B),G=m;G.x=o.x,G.y=u.y,G.z=E.z;var b=M;b.x=s.x,b.y=c.y,b.z=_.z;var X=t.multiplyByScalar(t.add(G,b,I),.5,O),V=0;for(p=0;p<y;p+=3){i.x=e[p]+n[p],i.y=e[p+1]+n[p+1],i.z=e[p+2]+n[p+2];var q=t.magnitude(t.subtract(i,X,I));q>V&&(V=q);var H=t.magnitudeSquared(t.subtract(i,D,I));if(H>B){var W=Math.sqrt(H);z=.5*(z+W),B=z*z;var Y=W-z;D.x=(z*D.x+Y*i.x)/W,D.y=(z*D.y+Y*i.y)/W,D.z=(z*D.z+Y*i.z)/W}}return z<V?(t.clone(D,r.center),r.radius=z):(t.clone(X,r.center),r.radius=V),r},T.fromCornerPoints=function(e,n,r){a(r)||(r=new T);var i=r.center;return t.add(e,n,i),t.multiplyByScalar(i,.5,i),r.radius=t.distance(i,n),r},T.fromEllipsoid=function(e,n){return a(n)||(n=new T),t.clone(t.ZERO,n.center),n.radius=e.maximumRadius,n};var P=new t;T.fromBoundingSpheres=function(e,n){if(a(n)||(n=new T),!a(e)||0===e.length)return n.center=t.clone(t.ZERO,n.center),n.radius=0,n;var r=e.length;if(1===r)return T.clone(e[0],n);if(2===r)return T.union(e[0],e[1],n);for(var i=[],o=0;o<r;o++)i.push(e[o].center);n=T.fromPoints(i,n);var u=n.center,E=n.radius;for(o=0;o<r;o++){var s=e[o];E=Math.max(E,t.distance(u,s.center,P)+s.radius)}return n.radius=E,n};var g=new t,w=new t,v=new t;T.fromOrientedBoundingBox=function(e,n){a(n)||(n=new T);var r=e.halfAxes,i=s.getColumn(r,0,g),o=s.getColumn(r,1,w),u=s.getColumn(r,2,v),E=t.magnitude(i),c=t.magnitude(o),_=t.magnitude(u);return n.center=t.clone(e.center,n.center),n.radius=Math.max(E,c,_),n},T.clone=function(e,n){if(a(e))return a(n)?(n.center=t.clone(e.center,n.center),n.radius=e.radius,n):new T(e.center,e.radius)},T.packedLength=4,T.pack=function(t,e,n){n=r(n,0);var a=t.center;return e[n++]=a.x,e[n++]=a.y,e[n++]=a.z,e[n]=t.radius,e},T.unpack=function(t,e,n){e=r(e,0),a(n)||(n=new T);var i=n.center;return i.x=t[e++],i.y=t[e++],i.z=t[e++],n.radius=t[e],n};var x=new t,D=new t;T.union=function(e,n,r){a(r)||(r=new T);var i=e.center,o=e.radius,u=n.center,E=n.radius,s=t.subtract(u,i,x),c=t.magnitude(s);if(o>=c+E)return e.clone(r),r;if(E>=c+o)return n.clone(r),r;var _=.5*(o+c+E),l=t.multiplyByScalar(s,(-o+_)/c,D);return t.add(l,i,l),t.clone(l,r.center),r.radius=_,r};var B=new t;T.expand=function(e,n,r){r=T.clone(e,r);var a=t.magnitude(t.subtract(n,r.center,B));return a>r.radius&&(r.radius=a),r},T.intersectPlane=function(e,n){var r=e.center,a=e.radius,i=n.normal,o=t.dot(i,r)+n.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},T.transform=function(t,e,n){return a(n)||(n=new T),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=c.getMaximumScale(e)*t.radius,n};var z=new t;T.distanceSquaredTo=function(e,n){var r=t.subtract(e.center,n,z);return t.magnitudeSquared(r)-e.radius*e.radius},T.transformWithoutScale=function(t,e,n){return a(n)||(n=new T),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=t.radius,n};var G=new t;T.computePlaneDistances=function(e,n,r,i){a(i)||(i=new E);var o=t.subtract(e.center,n,G),u=t.dot(r,o);return i.start=u-e.radius,i.stop=u+e.radius,i};for(var b=new t,X=new t,V=new t,q=new t,H=new t,W=new e,Y=new Array(8),k=0;k<8;++k)Y[k]=new t;var K=new o;return T.projectTo2D=function(e,n,a){n=r(n,K);var i=n.ellipsoid,o=e.center,u=e.radius,E=i.geodeticSurfaceNormal(o,b),s=t.cross(t.UNIT_Z,E,X);t.normalize(s,s);var c=t.cross(E,s,V);t.normalize(c,c),t.multiplyByScalar(E,u,E),t.multiplyByScalar(c,u,c),t.multiplyByScalar(s,u,s);var _=t.negate(c,H),l=t.negate(s,q),R=Y,f=R[0];t.add(E,c,f),t.add(f,s,f),f=R[1],t.add(E,c,f),t.add(f,l,f),f=R[2],t.add(E,_,f),t.add(f,l,f),f=R[3],t.add(E,_,f),t.add(f,s,f),t.negate(E,E),f=R[4],t.add(E,c,f),t.add(f,s,f),f=R[5],t.add(E,c,f),t.add(f,l,f),f=R[6],t.add(E,_,f),t.add(f,l,f),f=R[7],t.add(E,_,f),t.add(f,s,f);for(var A=R.length,h=0;h<A;++h){var N=R[h];t.add(o,N,N);var d=i.cartesianToCartographic(N,W);n.project(d,N)}a=T.fromPoints(R,a),o=a.center;var I=o.x,S=o.y,m=o.z;return o.x=m,o.y=I,o.z=S,a},T.isOccluded=function(t,e){return!e.isBoundingSphereVisible(t)},T.equals=function(e,n){return e===n||a(e)&&a(n)&&t.equals(e.center,n.center)&&e.radius===n.radius},T.prototype.intersectPlane=function(t){return T.intersectPlane(this,t)},T.prototype.distanceSquaredTo=function(t){return T.distanceSquaredTo(this,t)},T.prototype.computePlaneDistances=function(t,e,n){return T.computePlaneDistances(this,t,e,n)},T.prototype.isOccluded=function(t){return T.isOccluded(this,t)},T.prototype.equals=function(t){return T.equals(this,t)},T.prototype.clone=function(t){return T.clone(this,t)},T}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,a,i){"use strict";function o(t,n){this.x=e(t,0),this.y=e(n,0)}o.fromElements=function(t,e,r){return n(r)?(r.x=t,r.y=e,r):new o(t,e)},o.clone=function(t,e){if(n(t))return n(e)?(e.x=t.x,e.y=t.y,e):new o(t.x,t.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r]=t.y,n},o.unpack=function(t,r,a){return r=e(r,0),n(a)||(a=new o),a.x=t[r++],a.y=t[r],a},o.packArray=function(t,e){var r=t.length;n(e)?e.length=2*r:e=new Array(2*r);for(var a=0;a<r;++a)o.pack(t[a],e,2*a);return e},o.unpackArray=function(t,e){var r=t.length;n(e)?e.length=r/2:e=new Array(r/2);for(var a=0;a<r;a+=2){var i=a/2;e[i]=o.unpack(t,a,e[i])}return e},o.fromArray=o.unpack,o.maximumComponent=function(t){return Math.max(t.x,t.y)},o.minimumComponent=function(t){return Math.min(t.x,t.y)},o.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n},o.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n},o.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y},o.magnitude=function(t){return Math.sqrt(o.magnitudeSquared(t))};var u=new o;o.distance=function(t,e){return o.subtract(t,e,u),o.magnitude(u)},o.distanceSquared=function(t,e){return o.subtract(t,e,u),o.magnitudeSquared(u)},o.normalize=function(t,e){var n=o.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e},o.dot=function(t,e){return t.x*e.x+t.y*e.y},o.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n},o.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n},o.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n},o.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n},o.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n},o.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n},o.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e},o.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e};var E=new o;o.lerp=function(t,e,n,r){return o.multiplyByScalar(e,n,E),r=o.multiplyByScalar(t,1-n,r),o.add(E,r,r)};var s=new o,c=new o;o.angleBetween=function(t,e){return o.normalize(t,s),o.normalize(e,c),i.acosClamped(o.dot(s,c))};var _=new o;return o.mostOrthogonalAxis=function(t,e){var n=o.normalize(t,_);return o.abs(n,n),e=n.x<=n.y?o.clone(o.UNIT_X,e):o.clone(o.UNIT_Y,e)},o.equals=function(t,e){return t===e||n(t)&&n(e)&&t.x===e.x&&t.y===e.y},o.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]},o.equalsEpsilon=function(t,e,r,a){return t===e||n(t)&&n(e)&&i.equalsEpsilon(t.x,e.x,r,a)&&i.equalsEpsilon(t.y,e.y,r,a)},o.ZERO=a(new o(0,0)),o.UNIT_X=a(new o(1,0)),o.UNIT_Y=a(new o(0,1)),o.prototype.clone=function(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.prototype.equalsEpsilon=function(t,e,n){return o.equalsEpsilon(this,t,e,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/Fullscreen",["./defined","./defineProperties"],function(t,e){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return e(a,{element:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenElement]; +}},changeEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(t(n))return n;n=!1;var e=document.body;if("function"==typeof e.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var E=i[o];a=E+"RequestFullscreen","function"==typeof e[a]?(r.requestFullscreen=a,n=!0):(a=E+"RequestFullScreen","function"==typeof e[a]&&(r.requestFullscreen=a,n=!0)),a=E+"ExitFullscreen","function"==typeof document[a]?r.exitFullscreen=a:(a=E+"CancelFullScreen","function"==typeof document[a]&&(r.exitFullscreen=a)),a=E+"FullscreenEnabled",void 0!==document[a]?r.fullscreenEnabled=a:(a=E+"FullScreenEnabled",void 0!==document[a]&&(r.fullscreenEnabled=a)),a=E+"FullscreenElement",void 0!==document[a]?r.fullscreenElement=a:(a=E+"FullScreenElement",void 0!==document[a]&&(r.fullscreenElement=a)),a=E+"fullscreenchange",void 0!==document["on"+a]&&("ms"===E&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=E+"fullscreenerror",void 0!==document["on"+a]&&("ms"===E&&(a="MSFullscreenError"),r.fullscreenerror=a)}return n},a.requestFullscreen=function(t,e){a.supportsFullscreen()&&t[r.requestFullscreen]({vrDisplay:e})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[r.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(t,e,n){"use strict";function r(t){for(var e=t.split("."),n=0,r=e.length;n<r;++n)e[n]=parseInt(e[n],10);return e}function a(){if(!e(S)&&(S=!1,!T())){var t=/ Chrome\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(S=!0,m=r(t[1]))}return S}function i(){return a()&&m}function o(){if(!e(M)&&(M=!1,!a()&&!T()&&/ Safari\/[\.0-9]+/.test(I.userAgent))){var t=/ Version\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(M=!0,O=r(t[1]))}return M}function u(){return o()&&O}function E(){if(!e(y)){y=!1;var t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(I.userAgent);null!==t&&(y=!0,p=r(t[1]),p.isNightly=!!t[2])}return y}function s(){return E()&&p}function c(){if(!e(C)){C=!1;var t;"Microsoft Internet Explorer"===I.appName?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==t&&(C=!0,U=r(t[1]))):"Netscape"===I.appName&&(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==t&&(C=!0,U=r(t[1])))}return C}function _(){return c()&&U}function T(){if(!e(L)){L=!1;var t=/ Edge\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(L=!0,F=r(t[1]))}return L}function l(){return T()&&F}function R(){if(!e(P)){P=!1;var t=/Firefox\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(P=!0,g=r(t[1]))}return P}function f(){return e(w)||(w=/Windows/i.test(I.appVersion)),w}function A(){return R()&&g}function h(){return e(v)||(v="undefined"!=typeof PointerEvent&&(!e(I.pointerEnabled)||I.pointerEnabled)),v}function N(){if(!e(D)){var t=document.createElement("canvas");t.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=t.style.imageRendering;D=e(n)&&""!==n,D&&(x=n)}return D}function d(){return N()?x:void 0}var I;I="undefined"!=typeof navigator?navigator:{};var S,m,M,O,y,p,C,U,L,F,P,g,w,v,x,D,B={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:E,webkitVersion:s,isInternetExplorer:c,internetExplorerVersion:_,isEdge:T,edgeVersion:l,isFirefox:R,firefoxVersion:A,isWindows:f,hardwareConcurrency:t(I.hardwareConcurrency,3),supportsPointerEvents:h,supportsImageRenderingPixelated:N,imageRenderingValue:d};return B.supportsFullscreen=function(){return n.supportsFullscreen()},B.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},B.supportsWebWorkers=function(){return"undefined"!=typeof Worker},B}),define("Core/WebGLConstants",["./freezeObject"],function(t){"use strict";var e={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047};return t(e)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(t,e,n,r,a,i){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(t){switch(t){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.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(t){return t instanceof Int8Array?o.BYTE:t instanceof Uint8Array?o.UNSIGNED_BYTE:t instanceof Int16Array?o.SHORT:t instanceof Uint16Array?o.UNSIGNED_SHORT:t instanceof Int32Array?o.INT:t instanceof Uint32Array?o.UNSIGNED_INT:t instanceof Float32Array?o.FLOAT:t instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(t){return e(t)&&(t===o.BYTE||t===o.UNSIGNED_BYTE||t===o.SHORT||t===o.UNSIGNED_SHORT||t===o.INT||t===o.UNSIGNED_INT||t===o.FLOAT||t===o.DOUBLE)},o.createTypedArray=function(t,e){switch(t){case o.BYTE:return new Int8Array(e);case o.UNSIGNED_BYTE:return new Uint8Array(e);case o.SHORT:return new Int16Array(e);case o.UNSIGNED_SHORT:return new Uint16Array(e);case o.INT:return new Int32Array(e);case o.UNSIGNED_INT:return new Uint32Array(e);case o.FLOAT:return new Float32Array(e);case o.DOUBLE:return new Float64Array(e)}},o.createArrayBufferView=function(e,n,r,a){switch(r=t(r,0),a=t(a,(n.byteLength-r)/o.getSizeInBytes(e)),e){case o.BYTE:return new Int8Array(n,r,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,a);case o.SHORT:return new Int16Array(n,r,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,a);case o.INT:return new Int32Array(n,r,a);case o.UNSIGNED_INT:return new Uint32Array(n,r,a);case o.FLOAT:return new Float32Array(n,r,a);case o.DOUBLE:return new Float64Array(n,r,a)}},o.fromName=function(t){switch(t){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/GeometryType",["./freezeObject"],function(t){"use strict";var e={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return t(e)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(t,e){"use strict";var n={POINTS:e.POINTS,LINES:e.LINES,LINE_LOOP:e.LINE_LOOP,LINE_STRIP:e.LINE_STRIP,TRIANGLES:e.TRIANGLES,TRIANGLE_STRIP:e.TRIANGLE_STRIP,TRIANGLE_FAN:e.TRIANGLE_FAN,validate:function(t){return t===n.POINTS||t===n.LINES||t===n.LINE_LOOP||t===n.LINE_STRIP||t===n.TRIANGLES||t===n.TRIANGLE_STRIP||t===n.TRIANGLE_FAN}};return t(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(t,e,n,r,a){"use strict";function i(e){e=t(e,t.EMPTY_OBJECT),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=t(e.primitiveType,a.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=t(e.geometryType,r.NONE),this.boundingSphereCV=e.boundingSphereCV}return i.computeNumberOfVertices=function(t){var n=-1;for(var r in t.attributes)if(t.attributes.hasOwnProperty(r)&&e(t.attributes[r])&&e(t.attributes[r].values)){var a=t.attributes[r],i=a.values.length/a.componentsPerAttribute;n=i}return n},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(t,e,n){"use strict";function r(e){e=t(e,t.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=t(e.normalize,!1),this.values=e.values}return r}),define("Core/GeometryAttributes",["./defaultValue"],function(t){"use strict";function e(e){e=t(e,t.EMPTY_OBJECT),this.position=e.position,this.normal=e.normal,this.st=e.st,this.bitangent=e.bitangent,this.tangent=e.tangent,this.color=e.color}return e}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(t,e,n,r,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(t){switch(t){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(e){return t(e)&&(e===i.UNSIGNED_BYTE||e===i.UNSIGNED_SHORT||e===i.UNSIGNED_INT)},i.createTypedArray=function(t,e){return t>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(e):new Uint16Array(e)},i.createTypedArrayFromArrayBuffer=function(t,e,n,a){return t>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(e,n,a):new Uint16Array(e,n,a)},n(i)}),define("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(t,e,n,r){"use strict";function a(e){e=t(e,t.EMPTY_OBJECT),this.position=t(e.position,!1),this.normal=t(e.normal,!1),this.st=t(e.st,!1),this.bitangent=t(e.bitangent,!1),this.tangent=t(e.tangent,!1),this.color=t(e.color,!1)}return a.POSITION_ONLY=r(new a({position:!0})),a.POSITION_AND_NORMAL=r(new a({position:!0,normal:!0})),a.POSITION_NORMAL_AND_ST=r(new a({position:!0,normal:!0,st:!0})),a.POSITION_AND_ST=r(new a({position:!0,st:!0})),a.POSITION_AND_COLOR=r(new a({position:!0,color:!0})),a.ALL=r(new a({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0})),a.DEFAULT=a.POSITION_NORMAL_AND_ST,a.packedLength=6,a.pack=function(e,n,r){return r=t(r,0),n[r++]=e.position?1:0,n[r++]=e.normal?1:0,n[r++]=e.st?1:0,n[r++]=e.tangent?1:0,n[r++]=e.bitangent?1:0,n[r++]=e.color?1:0,n},a.unpack=function(n,r,i){return r=t(r,0),e(i)||(i=new a),i.position=1===n[r++],i.normal=1===n[r++],i.st=1===n[r++],i.tangent=1===n[r++],i.bitangent=1===n[r++],i.color=1===n[r++],i},a.clone=function(t,n){if(e(t))return e(n)||(n=new a),n.position=t.position,n.normal=t.normal,n.st=t.st,n.tangent=t.tangent,n.bitangent=t.bitangent,n.color=t.color,n},a}),define("Core/EllipsoidGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./VertexFormat"],function(t,e,n,r,a,i,o,u,E,s,c,_,T,l,R){"use strict";function f(t){t=a(t,a.EMPTY_OBJECT);var e=a(t.radii,S),r=a(t.stackPartitions,64),i=a(t.slicePartitions,64),o=a(t.vertexFormat,R.DEFAULT);this._radii=n.clone(e),this._stackPartitions=r,this._slicePartitions=i,this._vertexFormat=R.clone(o),this._workerName="createEllipsoidGeometry"}var A=new n,h=new n,N=new n,d=new n,I=new n,S=new n(1,1,1),m=Math.cos,M=Math.sin;f.packedLength=n.packedLength+R.packedLength+2,f.pack=function(t,e,r){return r=a(r,0),n.pack(t._radii,e,r),r+=n.packedLength,R.pack(t._vertexFormat,e,r),r+=R.packedLength,e[r++]=t._stackPartitions,e[r]=t._slicePartitions,e};var O=new n,y=new R,p={radii:O,vertexFormat:y,stackPartitions:void 0,slicePartitions:void 0};return f.unpack=function(t,e,r){e=a(e,0);var o=n.unpack(t,e,O);e+=n.packedLength;var u=R.unpack(t,e,y);e+=R.packedLength;var E=t[e++],s=t[e];return i(r)?(r._radii=n.clone(o,r._radii),r._vertexFormat=R.clone(u,r._vertexFormat),r._stackPartitions=E,r._slicePartitions=s,r):(p.stackPartitions=E,p.slicePartitions=s,new f(p))},f.createGeometry=function(a){var i=a._radii;if(!(i.x<=0||i.y<=0||i.z<=0)){var o,R,f=u.fromCartesian3(i),S=a._vertexFormat,O=a._slicePartitions+1,y=a._stackPartitions+1,p=y*O,C=new Float64Array(3*p),U=6*(O-1)*(y-2),L=_.createTypedArray(p,U),F=S.normal?new Float32Array(3*p):void 0,P=S.tangent?new Float32Array(3*p):void 0,g=S.bitangent?new Float32Array(3*p):void 0,w=S.st?new Float32Array(2*p):void 0,v=new Array(O),x=new Array(O),D=0;for(o=0;o<O;o++){var B=T.TWO_PI*o/(O-1);v[o]=m(B),x[o]=M(B),C[D++]=0,C[D++]=0,C[D++]=i.z}for(o=1;o<y-1;o++){var z=Math.PI*o/(y-1),G=M(z),b=i.x*G,X=i.y*G,V=i.z*m(z);for(R=0;R<O;R++)C[D++]=v[R]*b,C[D++]=x[R]*X,C[D++]=V}for(o=0;o<O;o++)C[D++]=0,C[D++]=0,C[D++]=-i.z;var q=new c;S.position&&(q.position=new s({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:C}));var H=0,W=0,Y=0,k=0;if(S.st||S.normal||S.tangent||S.bitangent){for(o=0;o<p;o++){var K=n.fromArray(C,3*o,A),Z=f.geodeticSurfaceNormal(K,h);if(S.st){var j=e.negate(Z,I);e.magnitude(j)<T.EPSILON6&&(D=3*(o+O*Math.floor(.5*y)),D>C.length&&(D=3*(o-O*Math.floor(.5*y))),n.fromArray(C,D,j),f.geodeticSurfaceNormal(j,j),e.negate(j,j)),w[H++]=Math.atan2(j.y,j.x)/T.TWO_PI+.5,w[H++]=Math.asin(Z.z)/Math.PI+.5}if(S.normal&&(F[W++]=Z.x,F[W++]=Z.y,F[W++]=Z.z),S.tangent||S.bitangent){var Q=N;if(o<O||o>p-O-1?(n.cross(n.UNIT_X,Z,Q),n.normalize(Q,Q)):(n.cross(n.UNIT_Z,Z,Q),n.normalize(Q,Q)),S.tangent&&(P[Y++]=Q.x,P[Y++]=Q.y,P[Y++]=Q.z),S.bitangent){var J=n.cross(Z,Q,d);n.normalize(J,J),g[k++]=J.x,g[k++]=J.y,g[k++]=J.z}}}S.st&&(q.st=new s({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:w})),S.normal&&(q.normal=new s({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:F})),S.tangent&&(q.tangent=new s({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:P})),S.bitangent&&(q.bitangent=new s({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:g}))}for(D=0,R=0;R<O-1;R++)L[D++]=O+R,L[D++]=O+R+1,L[D++]=R+1;var $,tt;for(o=1;o<y-2;o++)for($=o*O,tt=(o+1)*O,R=0;R<O-1;R++)L[D++]=tt+R,L[D++]=tt+R+1,L[D++]=$+R+1,L[D++]=tt+R,L[D++]=$+R+1,L[D++]=$+R;for(o=y-2,$=o*O,tt=(o+1)*O,R=0;R<O-1;R++)L[D++]=tt+R,L[D++]=$+R+1,L[D++]=$+R;return new E({attributes:q,indices:L,primitiveType:l.TRIANGLES,boundingSphere:t.fromEllipsoid(f)})}},f}),define("Workers/createEllipsoidGeometry",["../Core/defined","../Core/EllipsoidGeometry"],function(t,e){"use strict";return function(n,r){return t(r)&&(n=e.unpack(n,r)),e.createGeometry(n)}})}(); \ No newline at end of file diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createEllipsoidOutlineGeometry.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createEllipsoidOutlineGeometry.js index 5b3af74a..4eae5b10 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createEllipsoidOutlineGeometry.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createEllipsoidOutlineGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,6 +55,6 @@ mersenne-twister.js - https://gist.github.com/banksean/300494 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -!function(){define("Core/defined",[],function(){"use strict";function t(t){return void 0!==t&&null!==t}return t}),define("Core/freezeObject",["./defined"],function(t){"use strict";var e=Object.freeze;return t(e)||(e=function(t){return t}),e}),define("Core/defaultValue",["./freezeObject"],function(t){"use strict";function e(t,e){return void 0!==t?t:e}return e.EMPTY_OBJECT=t({}),e}),define("Core/DeveloperError",["./defined"],function(t){"use strict";function e(t){this.name="DeveloperError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e.throwInstantiationError=function(){throw new e("This function defines an interface and should not be called directly.")},e}),define("Core/isArray",["./defined"],function(t){"use strict";var e=Array.isArray;return t(e)||(e=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),e}),define("Core/Check",["./defaultValue","./defined","./DeveloperError","./isArray"],function(t,e,n,r){"use strict";function i(t){return t+" was required but undefined."}function a(t,e,n){return"Expected "+n+" to be typeof "+e+", got "+t}var o={};return o.typeOf={},o.numeric={},o.defined=function(t,r){if(!e(t))throw new n(i(r))},o.numeric.maximum=function(t,e){if(o.typeOf.number(t),o.typeOf.number(e),t>e)throw new n("Expected "+t+" to be at most "+e)},o.numeric.minimum=function(t,e){if(o.typeOf.number(t),o.typeOf.number(e),t<e)throw new n("Expected "+t+" to be at least "+e)},o.typeOf.function=function(t,e){if("function"!=typeof t)throw new n(a(typeof t,"function",e))},o.typeOf.string=function(t,e){if("string"!=typeof t)throw new n(a(typeof t,"string",e))},o.typeOf.number=function(t,e){if("number"!=typeof t)throw new n(a(typeof t,"number",e))},o.typeOf.object=function(t,e){if("object"!=typeof t)throw new n(a(typeof t,"object",e))},o.typeOf.boolean=function(t,e){if("boolean"!=typeof t)throw new n(a(typeof t,"boolean",e))},o}),define("ThirdParty/mersenne-twister",[],function(){var t=function(t){void 0==t&&(t=(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(t)};return t.prototype.init_genrand=function(t){for(this.mt[0]=t>>>0,this.mti=1;this.mti<this.N;this.mti++){var t=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&t)>>>16)<<16)+1812433253*(65535&t)+this.mti,this.mt[this.mti]>>>=0}},t.prototype.genrand_int32=function(){var t,e=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)t=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^t>>>1^e[1&t];for(;n<this.N-1;n++)t=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^t>>>1^e[1&t];t=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^t>>>1^e[1&t],this.mti=0}return t=this.mt[this.mti++],t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,t^=t>>>18,t>>>0},t.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},t}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(t,e,n,r){"use strict";var i={};i.EPSILON1=.1,i.EPSILON2=.01,i.EPSILON3=.001,i.EPSILON4=1e-4,i.EPSILON5=1e-5,i.EPSILON6=1e-6,i.EPSILON7=1e-7,i.EPSILON8=1e-8,i.EPSILON9=1e-9,i.EPSILON10=1e-10,i.EPSILON11=1e-11,i.EPSILON12=1e-12,i.EPSILON13=1e-13,i.EPSILON14=1e-14,i.EPSILON15=1e-15,i.EPSILON16=1e-16,i.EPSILON17=1e-17,i.EPSILON18=1e-18,i.EPSILON19=1e-19,i.EPSILON20=1e-20,i.GRAVITATIONALPARAMETER=3986004418e5,i.SOLAR_RADIUS=6955e5,i.LUNAR_RADIUS=1737400,i.SIXTY_FOUR_KILOBYTES=65536,i.sign=function(t){return t>0?1:t<0?-1:0},i.signNotZero=function(t){return t<0?-1:1},i.toSNorm=function(t,n){return n=e(n,255),Math.round((.5*i.clamp(t,-1,1)+.5)*n)},i.fromSNorm=function(t,n){return n=e(n,255),i.clamp(t,0,n)/n*2-1},i.sinh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e-n)},i.cosh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e+n)},i.lerp=function(t,e,n){return(1-n)*t+n*e},i.PI=Math.PI,i.ONE_OVER_PI=1/Math.PI,i.PI_OVER_TWO=.5*Math.PI,i.PI_OVER_THREE=Math.PI/3,i.PI_OVER_FOUR=Math.PI/4,i.PI_OVER_SIX=Math.PI/6,i.THREE_PI_OVER_TWO=3*Math.PI*.5,i.TWO_PI=2*Math.PI,i.ONE_OVER_TWO_PI=1/(2*Math.PI),i.RADIANS_PER_DEGREE=Math.PI/180,i.DEGREES_PER_RADIAN=180/Math.PI,i.RADIANS_PER_ARCSECOND=i.RADIANS_PER_DEGREE/3600,i.toRadians=function(t){return t*i.RADIANS_PER_DEGREE},i.toDegrees=function(t){return t*i.DEGREES_PER_RADIAN},i.convertLongitudeRange=function(t){var e=i.TWO_PI,n=t-Math.floor(t/e)*e;return n<-Math.PI?n+e:n>=Math.PI?n-e:n},i.clampToLatitudeRange=function(t){return i.clamp(t,-1*i.PI_OVER_TWO,i.PI_OVER_TWO)},i.negativePiToPi=function(t){return i.zeroToTwoPi(t+i.PI)-i.PI},i.zeroToTwoPi=function(t){var e=i.mod(t,i.TWO_PI);return Math.abs(e)<i.EPSILON14&&Math.abs(t)>i.EPSILON14?i.TWO_PI:e},i.mod=function(t,e){return(t%e+e)%e},i.equalsEpsilon=function(t,n,r,i){i=e(i,r);var a=Math.abs(t-n);return a<=i||a<=r*Math.max(Math.abs(t),Math.abs(n))};var a=[1];i.factorial=function(t){var e=a.length;if(t>=e)for(var n=a[e-1],r=e;r<=t;r++)a.push(n*r);return a[t]},i.incrementWrap=function(t,n,r){return r=e(r,0),++t,t>n&&(t=r),t},i.isPowerOfTwo=function(t){return 0!==t&&0===(t&t-1)},i.nextPowerOfTwo=function(t){return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t,t},i.clamp=function(t,e,n){return t<e?e:t>n?n:t};var o=new t;return i.setRandomNumberSeed=function(e){o=new t(e)},i.nextRandomNumber=function(){return o.random()},i.acosClamped=function(t){return Math.acos(i.clamp(t,-1,1))},i.asinClamped=function(t){return Math.asin(i.clamp(t,-1,1))},i.chordLength=function(t,e){return 2*e*Math.sin(.5*t)},i.logBase=function(t,e){return Math.log(t)/Math.log(e)},i.fog=function(t,e){var n=t*e;return 1-Math.exp(-(n*n))},i}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a){"use strict";function o(t,n,r){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0)}o.fromSpherical=function(t,r){n(r)||(r=new o);var i=t.clock,a=t.cone,u=e(t.magnitude,1),E=u*Math.sin(a);return r.x=E*Math.cos(i),r.y=E*Math.sin(i),r.z=u*Math.cos(a),r},o.fromElements=function(t,e,r,i){return n(i)?(i.x=t,i.y=e,i.z=r,i):new o(t,e,r)},o.clone=function(t,e){if(n(t))return n(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e):new o(t.x,t.y,t.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r]=t.z,n},o.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new o),i.x=t[r++],i.y=t[r++],i.z=t[r],i},o.packArray=function(t,e){var r=t.length;n(e)?e.length=3*r:e=new Array(3*r);for(var i=0;i<r;++i)o.pack(t[i],e,3*i);return e},o.unpackArray=function(t,e){var r=t.length;n(e)?e.length=r/3:e=new Array(r/3);for(var i=0;i<r;i+=3){var a=i/3;e[a]=o.unpack(t,i,e[a])}return e},o.fromArray=o.unpack,o.maximumComponent=function(t){return Math.max(t.x,t.y,t.z)},o.minimumComponent=function(t){return Math.min(t.x,t.y,t.z)},o.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n.z=Math.min(t.z,e.z),n},o.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n.z=Math.max(t.z,e.z),n},o.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z},o.magnitude=function(t){return Math.sqrt(o.magnitudeSquared(t))};var u=new o;o.distance=function(t,e){return o.subtract(t,e,u),o.magnitude(u)},o.distanceSquared=function(t,e){return o.subtract(t,e,u),o.magnitudeSquared(u)},o.normalize=function(t,e){var n=o.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e},o.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},o.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n.z=t.z*e.z,n},o.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n.z=t.z/e.z,n},o.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n},o.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n},o.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*e,n},o.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n},o.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e},o.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e};var E=new o;o.lerp=function(t,e,n,r){return o.multiplyByScalar(e,n,E),r=o.multiplyByScalar(t,1-n,r),o.add(E,r,r)};var s=new o,c=new o;o.angleBetween=function(t,e){o.normalize(t,s),o.normalize(e,c);var n=o.dot(s,c),r=o.magnitude(o.cross(s,c,s));return Math.atan2(r,n)};var _=new o;o.mostOrthogonalAxis=function(t,e){var n=o.normalize(t,_);return o.abs(n,n),e=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,e):o.clone(o.UNIT_Z,e):n.y<=n.z?o.clone(o.UNIT_Y,e):o.clone(o.UNIT_Z,e)},o.equals=function(t,e){return t===e||n(t)&&n(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z},o.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]},o.equalsEpsilon=function(t,e,r,i){return t===e||n(t)&&n(e)&&a.equalsEpsilon(t.x,e.x,r,i)&&a.equalsEpsilon(t.y,e.y,r,i)&&a.equalsEpsilon(t.z,e.z,r,i)},o.cross=function(t,e,n){var r=t.x,i=t.y,a=t.z,o=e.x,u=e.y,E=e.z,s=i*E-a*u,c=a*o-r*E,_=r*u-i*o;return n.x=s,n.y=c,n.z=_,n},o.fromDegrees=function(t,e,n,r,i){return t=a.toRadians(t),e=a.toRadians(e),o.fromRadians(t,e,n,r,i)};var T=new o,R=new o,l=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(t,r,i,a,u){i=e(i,0);var E=n(a)?a.radiiSquared:l,s=Math.cos(r);T.x=s*Math.cos(t),T.y=s*Math.sin(t),T.z=Math.sin(r),T=o.normalize(T,T),o.multiplyComponents(E,T,R);var c=Math.sqrt(o.dot(T,R));return R=o.divideByScalar(R,c,R),T=o.multiplyByScalar(T,i,T),n(u)||(u=new o),o.add(R,T,u)},o.fromDegreesArray=function(t,e,r){var i=t.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=t[a],E=t[a+1],s=a/2;r[s]=o.fromDegrees(u,E,0,e,r[s])}return r},o.fromRadiansArray=function(t,e,r){var i=t.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=t[a],E=t[a+1],s=a/2;r[s]=o.fromRadians(u,E,0,e,r[s])}return r},o.fromDegreesArrayHeights=function(t,e,r){var i=t.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=t[a],E=t[a+1],s=t[a+2],c=a/3;r[c]=o.fromDegrees(u,E,s,e,r[c])}return r},o.fromRadiansArrayHeights=function(t,e,r){var i=t.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=t[a],E=t[a+1],s=t[a+2],c=a/3;r[c]=o.fromRadians(u,E,s,e,r[c])}return r},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(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.prototype.equalsEpsilon=function(t,e,n){return o.equalsEpsilon(this,t,e,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(t,e,n,r){"use strict";function i(n,i,u,E,s){var c=n.x,_=n.y,T=n.z,R=i.x,l=i.y,A=i.z,f=c*c*R*R,N=_*_*l*l,h=T*T*A*A,d=f+N+h,I=Math.sqrt(1/d),S=t.multiplyByScalar(n,I,a);if(d<E)return isFinite(I)?t.clone(S,s):void 0;var M=u.x,O=u.y,m=u.z,y=o;y.x=S.x*M*2,y.y=S.y*O*2,y.z=S.z*m*2;var p,C,U,L,F,P,v,D,g,w,B,x=(1-I)*t.magnitude(n)/(.5*t.magnitude(y)),z=0;do{x-=z,U=1/(1+x*M),L=1/(1+x*O),F=1/(1+x*m),P=U*U,v=L*L,D=F*F,g=P*U,w=v*L,B=D*F,p=f*P+N*v+h*D-1,C=f*g*M+N*w*O+h*B*m;var G=-2*C;z=p/G}while(Math.abs(p)>r.EPSILON12);return e(s)?(s.x=c*U,s.y=_*L,s.z=T*F,s):new t(c*U,_*L,T*F)}var a=new t,o=new t;return i}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,n,r,i,a,o){"use strict";function u(t,n,r){this.longitude=e(t,0),this.latitude=e(n,0),this.height=e(r,0)}u.fromRadians=function(t,r,i,a){return i=e(i,0),n(a)?(a.longitude=t,a.latitude=r,a.height=i,a):new u(t,r,i)},u.fromDegrees=function(t,e,n,r){return t=a.toRadians(t),e=a.toRadians(e),u.fromRadians(t,e,n,r)};var E=new t,s=new t,c=new t,_=new t(1/6378137,1/6378137,1/6356752.314245179),T=new t(1/40680631590769,1/40680631590769,1/40408299984661.445),R=a.EPSILON1;return u.fromCartesian=function(e,r,i){var l=n(r)?r.oneOverRadii:_,A=n(r)?r.oneOverRadiiSquared:T,f=n(r)?r._centerToleranceSquared:R,N=o(e,l,A,f,s);if(n(N)){var h=t.multiplyComponents(N,A,E);h=t.normalize(h,h);var d=t.subtract(e,N,c),I=Math.atan2(h.y,h.x),S=Math.asin(h.z),M=a.sign(t.dot(d,e))*t.magnitude(d);return n(i)?(i.longitude=I,i.latitude=S,i.height=M,i):new u(I,S,M)}},u.clone=function(t,e){if(n(t))return n(e)?(e.longitude=t.longitude,e.latitude=t.latitude,e.height=t.height,e):new u(t.longitude,t.latitude,t.height)},u.equals=function(t,e){return t===e||n(t)&&n(e)&&t.longitude===e.longitude&&t.latitude===e.latitude&&t.height===e.height},u.equalsEpsilon=function(t,e,r){return t===e||n(t)&&n(e)&&Math.abs(t.longitude-e.longitude)<=r&&Math.abs(t.latitude-e.latitude)<=r&&Math.abs(t.height-e.height)<=r},u.ZERO=i(new u(0,0,0)),u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.prototype.equalsEpsilon=function(t,e){return u.equalsEpsilon(this,t,e)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(t){"use strict";var e=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(t){return!1}}(),n=Object.defineProperties;return e&&t(n)||(n=function(t){return t}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,n,r,i,a,o,u,E){"use strict";function s(e,r,i,a){r=n(r,0),i=n(i,0),a=n(a,0),e._radii=new t(r,i,a),e._radiiSquared=new t(r*r,i*i,a*a),e._radiiToTheFourth=new t(r*r*r*r,i*i*i*i,a*a*a*a),e._oneOverRadii=new t(0===r?0:1/r,0===i?0:1/i,0===a?0:1/a),e._oneOverRadiiSquared=new t(0===r?0:1/(r*r),0===i?0:1/(i*i),0===a?0:1/(a*a)),e._minimumRadius=Math.min(r,i,a),e._maximumRadius=Math.max(r,i,a),e._centerToleranceSquared=u.EPSILON1,0!==e._radiiSquared.z&&(e._sqauredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function c(t,e,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,s(this,t,e,n)}i(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(e,n){if(r(e)){var i=e._radii;return r(n)?(t.clone(i,n._radii),t.clone(e._radiiSquared,n._radiiSquared),t.clone(e._radiiToTheFourth,n._radiiToTheFourth),t.clone(e._oneOverRadii,n._oneOverRadii),t.clone(e._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=e._minimumRadius,n._maximumRadius=e._maximumRadius,n._centerToleranceSquared=e._centerToleranceSquared,n):new c(i.x,i.y,i.z)}},c.fromCartesian3=function(t,e){return r(e)||(e=new c),r(t)?(s(e,t.x,t.y,t.z),e):e},c.WGS84=o(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=o(new c(1,1,1)),c.MOON=o(new c(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),c.prototype.clone=function(t){return c.clone(this,t)},c.packedLength=t.packedLength,c.pack=function(e,r,i){return i=n(i,0),t.pack(e._radii,r,i),r},c.unpack=function(e,r,i){r=n(r,0);var a=t.unpack(e,r);return c.fromCartesian3(a,i)},c.prototype.geocentricSurfaceNormal=t.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(e,n){var i=e.longitude,a=e.latitude,o=Math.cos(a),u=o*Math.cos(i),E=o*Math.sin(i),s=Math.sin(a);return r(n)||(n=new t),n.x=u,n.y=E,n.z=s,t.normalize(n,n)},c.prototype.geodeticSurfaceNormal=function(e,n){return r(n)||(n=new t),n=t.multiplyComponents(e,this._oneOverRadiiSquared,n),t.normalize(n,n)};var _=new t,T=new t;c.prototype.cartographicToCartesian=function(e,n){var i=_,a=T;this.geodeticSurfaceNormalCartographic(e,i),t.multiplyComponents(this._radiiSquared,i,a);var o=Math.sqrt(t.dot(i,a));return t.divideByScalar(a,o,a),t.multiplyByScalar(i,e.height,i),r(n)||(n=new t),t.add(a,i,n)},c.prototype.cartographicArrayToCartesianArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var i=0;i<n;i++)e[i]=this.cartographicToCartesian(t[i],e[i]);return e};var R=new t,l=new t,A=new t;return c.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,l);if(r(a)){var o=this.geodeticSurfaceNormal(a,R),E=t.subtract(n,a,A),s=Math.atan2(o.y,o.x),c=Math.asin(o.z),_=u.sign(t.dot(E,n))*t.magnitude(E);return r(i)?(i.longitude=s,i.latitude=c,i.height=_,i):new e(s,c,_)}},c.prototype.cartesianArrayToCartographicArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var i=0;i<n;++i)e[i]=this.cartesianToCartographic(t[i],e[i]);return e},c.prototype.scaleToGeodeticSurface=function(t,e){return E(t,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,e)},c.prototype.scaleToGeocentricSurface=function(e,n){r(n)||(n=new t);var i=e.x,a=e.y,o=e.z,u=this._oneOverRadiiSquared,E=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*u.z);return t.multiplyByScalar(e,E,n)},c.prototype.transformPositionToScaledSpace=function(e,n){return r(n)||(n=new t),t.multiplyComponents(e,this._oneOverRadii,n)},c.prototype.transformPositionFromScaledSpace=function(e,n){return r(n)||(n=new t),t.multiplyComponents(e,this._radii,n)},c.prototype.equals=function(e){return this===e||r(e)&&t.equals(this._radii,e._radii)},c.prototype.toString=function(){return this._radii.toString()},c.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,i,a){i=n(i,0);var o=this._sqauredXOverSquaredZ;if(r(a)||(a=new t),a.x=0,a.y=0,a.z=e.z*(1-o),!(Math.abs(a.z)>=this._radii.z-i))return a},c}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(t,e,n,r,i,a,o){"use strict";function u(t){this._ellipsoid=n(t,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return i(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(e,n){var i=this._semimajorAxis,a=e.longitude*i,o=e.latitude*i,u=e.height;return r(n)?(n.x=a,n.y=o,n.z=u,n):new t(a,o,u)},u.prototype.unproject=function(t,n){var i=this._oneOverSemimajorAxis,a=t.x*i,o=t.y*i,u=t.z;return r(n)?(n.longitude=a,n.latitude=o,n.height=u,n):new e(a,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(t){"use strict";var e={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return t(e)}),define("Core/Interval",["./defaultValue"],function(t){"use strict";function e(e,n){this.start=t(e,0),this.stop=t(n,0)}return e}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a,o){"use strict";function u(t,n,r,i,a,o,u,E,s){this[0]=e(t,0),this[1]=e(i,0),this[2]=e(u,0),this[3]=e(n,0),this[4]=e(a,0),this[5]=e(E,0),this[6]=e(r,0),this[7]=e(o,0),this[8]=e(s,0)}function E(t){for(var e=0,n=0;n<9;++n){var r=t[n];e+=r*r}return Math.sqrt(e)}function s(t){for(var e=0,n=0;n<3;++n){var r=t[u.getElementIndex(l[n],R[n])];e+=2*r*r}return Math.sqrt(e)}function c(t,e){for(var n=o.EPSILON15,r=0,i=1,a=0;a<3;++a){var E=Math.abs(t[u.getElementIndex(l[a],R[a])]);E>r&&(i=a,r=E)}var s=1,c=0,_=R[i],T=l[i];if(Math.abs(t[u.getElementIndex(T,_)])>n){var A,f=t[u.getElementIndex(T,T)],N=t[u.getElementIndex(_,_)],h=t[u.getElementIndex(T,_)],d=(f-N)/2/h;A=d<0?-1/(-d+Math.sqrt(1+d*d)):1/(d+Math.sqrt(1+d*d)),s=1/Math.sqrt(1+A*A),c=A*s}return e=u.clone(u.IDENTITY,e),e[u.getElementIndex(_,_)]=e[u.getElementIndex(T,T)]=s,e[u.getElementIndex(T,_)]=c,e[u.getElementIndex(_,T)]=-c,e}u.packedLength=9,u.pack=function(t,n,r){return r=e(r,0),n[r++]=t[0],n[r++]=t[1],n[r++]=t[2],n[r++]=t[3],n[r++]=t[4],n[r++]=t[5],n[r++]=t[6],n[r++]=t[7],n[r++]=t[8],n},u.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new u),i[0]=t[r++],i[1]=t[r++],i[2]=t[r++],i[3]=t[r++],i[4]=t[r++],i[5]=t[r++],i[6]=t[r++],i[7]=t[r++],i[8]=t[r++],i},u.clone=function(t,e){if(n(t))return n(e)?(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):new u(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8])},u.fromArray=function(t,r,i){return r=e(r,0),n(i)||(i=new u),i[0]=t[r],i[1]=t[r+1],i[2]=t[r+2],i[3]=t[r+3],i[4]=t[r+4],i[5]=t[r+5],i[6]=t[r+6],i[7]=t[r+7],i[8]=t[r+8],i},u.fromColumnMajorArray=function(t,e){return u.clone(t,e)},u.fromRowMajorArray=function(t,e){return n(e)?(e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],e):new u(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},u.fromQuaternion=function(t,e){var r=t.x*t.x,i=t.x*t.y,a=t.x*t.z,o=t.x*t.w,E=t.y*t.y,s=t.y*t.z,c=t.y*t.w,_=t.z*t.z,T=t.z*t.w,R=t.w*t.w,l=r-E-_+R,A=2*(i-T),f=2*(a+c),N=2*(i+T),h=-r+E-_+R,d=2*(s-o),I=2*(a-c),S=2*(s+o),M=-r-E+_+R;return n(e)?(e[0]=l,e[1]=N,e[2]=I,e[3]=A,e[4]=h,e[5]=S,e[6]=f,e[7]=d,e[8]=M,e):new u(l,A,f,N,h,d,I,S,M)},u.fromHeadingPitchRoll=function(t,e){var r=Math.cos(-t.pitch),i=Math.cos(-t.heading),a=Math.cos(t.roll),o=Math.sin(-t.pitch),E=Math.sin(-t.heading),s=Math.sin(t.roll),c=r*i,_=-a*E+s*o*i,T=s*E+a*o*i,R=r*E,l=a*i+s*o*E,A=-o*a+a*o*E,f=-o,N=s*r,h=a*r;return n(e)?(e[0]=c,e[1]=R,e[2]=f,e[3]=_,e[4]=l,e[5]=N,e[6]=T,e[7]=A,e[8]=h,e):new u(c,_,T,R,l,A,f,N,h)},u.fromScale=function(t,e){return n(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=t.y,e[5]=0,e[6]=0,e[7]=0,e[8]=t.z,e):new u(t.x,0,0,0,t.y,0,0,0,t.z)},u.fromUniformScale=function(t,e){return n(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=t,e[5]=0,e[6]=0,e[7]=0,e[8]=t,e):new u(t,0,0,0,t,0,0,0,t)},u.fromCrossProduct=function(t,e){return n(e)?(e[0]=0,e[1]=t.z,e[2]=-t.y,e[3]=-t.z,e[4]=0,e[5]=t.x,e[6]=t.y,e[7]=-t.x,e[8]=0,e):new u(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},u.fromRotationX=function(t,e){var r=Math.cos(t),i=Math.sin(t);return n(e)?(e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=r,e[5]=i,e[6]=0,e[7]=-i,e[8]=r,e):new u(1,0,0,0,r,-i,0,i,r)},u.fromRotationY=function(t,e){var r=Math.cos(t),i=Math.sin(t);return n(e)?(e[0]=r,e[1]=0,e[2]=-i,e[3]=0,e[4]=1,e[5]=0,e[6]=i,e[7]=0,e[8]=r,e):new u(r,0,i,0,1,0,-i,0,r)},u.fromRotationZ=function(t,e){var r=Math.cos(t),i=Math.sin(t);return n(e)?(e[0]=r,e[1]=i,e[2]=0,e[3]=-i,e[4]=r,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e):new u(r,-i,0,i,r,0,0,0,1)},u.toArray=function(t,e){return n(e)?(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):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},u.getElementIndex=function(t,e){return 3*t+e},u.getColumn=function(t,e,n){var r=3*e,i=t[r],a=t[r+1],o=t[r+2];return n.x=i,n.y=a,n.z=o,n},u.setColumn=function(t,e,n,r){r=u.clone(t,r);var i=3*e;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},u.getRow=function(t,e,n){var r=t[e],i=t[e+3],a=t[e+6];return n.x=r,n.y=i,n.z=a,n},u.setRow=function(t,e,n,r){return r=u.clone(t,r),r[e]=n.x,r[e+3]=n.y,r[e+6]=n.z,r};var _=new t;u.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],_)),n.y=t.magnitude(t.fromElements(e[3],e[4],e[5],_)),n.z=t.magnitude(t.fromElements(e[6],e[7],e[8],_)),n};var T=new t;u.getMaximumScale=function(e){return u.getScale(e,T),t.maximumComponent(T)},u.multiply=function(t,e,n){var r=t[0]*e[0]+t[3]*e[1]+t[6]*e[2],i=t[1]*e[0]+t[4]*e[1]+t[7]*e[2],a=t[2]*e[0]+t[5]*e[1]+t[8]*e[2],o=t[0]*e[3]+t[3]*e[4]+t[6]*e[5],u=t[1]*e[3]+t[4]*e[4]+t[7]*e[5],E=t[2]*e[3]+t[5]*e[4]+t[8]*e[5],s=t[0]*e[6]+t[3]*e[7]+t[6]*e[8],c=t[1]*e[6]+t[4]*e[7]+t[7]*e[8],_=t[2]*e[6]+t[5]*e[7]+t[8]*e[8];return n[0]=r,n[1]=i,n[2]=a,n[3]=o,n[4]=u,n[5]=E,n[6]=s,n[7]=c,n[8]=_,n},u.add=function(t,e,n){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n[4]=t[4]+e[4],n[5]=t[5]+e[5],n[6]=t[6]+e[6],n[7]=t[7]+e[7],n[8]=t[8]+e[8],n},u.subtract=function(t,e,n){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n[4]=t[4]-e[4],n[5]=t[5]-e[5],n[6]=t[6]-e[6],n[7]=t[7]-e[7],n[8]=t[8]-e[8],n},u.multiplyByVector=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=t[0]*r+t[3]*i+t[6]*a,u=t[1]*r+t[4]*i+t[7]*a,E=t[2]*r+t[5]*i+t[8]*a;return n.x=o,n.y=u,n.z=E,n},u.multiplyByScalar=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n[4]=t[4]*e,n[5]=t[5]*e,n[6]=t[6]*e,n[7]=t[7]*e,n[8]=t[8]*e,n},u.multiplyByScale=function(t,e,n){return n[0]=t[0]*e.x,n[1]=t[1]*e.x,n[2]=t[2]*e.x,n[3]=t[3]*e.y,n[4]=t[4]*e.y,n[5]=t[5]*e.y,n[6]=t[6]*e.z,n[7]=t[7]*e.z,n[8]=t[8]*e.z,n},u.negate=function(t,e){return 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},u.transpose=function(t,e){var n=t[0],r=t[3],i=t[6],a=t[1],o=t[4],u=t[7],E=t[2],s=t[5],c=t[8];return e[0]=n,e[1]=r,e[2]=i,e[3]=a,e[4]=o,e[5]=u,e[6]=E,e[7]=s,e[8]=c,e};var R=[1,0,0],l=[2,2,1],A=new u,f=new u;return u.computeEigenDecomposition=function(t,e){var r=o.EPSILON20,i=10,a=0,_=0;n(e)||(e={});for(var T=e.unitary=u.clone(u.IDENTITY,e.unitary),R=e.diagonal=u.clone(t,e.diagonal),l=r*E(R);_<i&&s(R)>l;)c(R,A),u.transpose(A,f),u.multiply(R,A,R),u.multiply(f,R,R),u.multiply(T,A,T),++a>2&&(++_,a=0);return e},u.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e},u.determinant=function(t){var e=t[0],n=t[3],r=t[6],i=t[1],a=t[4],o=t[7],u=t[2],E=t[5],s=t[8];return e*(a*s-E*o)+i*(E*r-n*s)+u*(n*o-a*r)},u.inverse=function(t,e){var n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],E=t[5],s=t[6],c=t[7],_=t[8],T=u.determinant(t);e[0]=o*_-c*E,e[1]=c*i-r*_,e[2]=r*E-o*i,e[3]=s*E-a*_,e[4]=n*_-s*i,e[5]=a*i-n*E,e[6]=a*c-s*o,e[7]=s*r-n*c,e[8]=n*o-a*r;var R=1/T;return u.multiplyByScalar(e,R,e)},u.equals=function(t,e){return t===e||n(t)&&n(e)&&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]},u.equalsEpsilon=function(t,e,r){return t===e||n(t)&&n(e)&&Math.abs(t[0]-e[0])<=r&&Math.abs(t[1]-e[1])<=r&&Math.abs(t[2]-e[2])<=r&&Math.abs(t[3]-e[3])<=r&&Math.abs(t[4]-e[4])<=r&&Math.abs(t[5]-e[5])<=r&&Math.abs(t[6]-e[6])<=r&&Math.abs(t[7]-e[7])<=r&&Math.abs(t[8]-e[8])<=r},u.IDENTITY=a(new u(1,0,0,0,1,0,0,0,1)),u.ZERO=a(new u(0,0,0,0,0,0,0,0,0)),u.COLUMN0ROW0=0,u.COLUMN0ROW1=1,u.COLUMN0ROW2=2,u.COLUMN1ROW0=3,u.COLUMN1ROW1=4,u.COLUMN1ROW2=5,u.COLUMN2ROW0=6,u.COLUMN2ROW1=7,u.COLUMN2ROW2=8,r(u.prototype,{length:{get:function(){return u.packedLength}}}),u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]&&t[4]===e[n+4]&&t[5]===e[n+5]&&t[6]===e[n+6]&&t[7]===e[n+7]&&t[8]===e[n+8]},u.prototype.equalsEpsilon=function(t,e){return u.equalsEpsilon(this,t,e)},u.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},u}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i){"use strict";function a(e,n,r,i){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(i,0)}a.fromElements=function(t,n,r,i,o){return e(o)?(o.x=t,o.y=n,o.z=r,o.w=i,o):new a(t,n,r,i)},a.fromColor=function(t,n){return e(n)?(n.x=t.red,n.y=t.green,n.z=t.blue,n.w=t.alpha,n):new a(t.red,t.green,t.blue,t.alpha)},a.clone=function(t,n){if(e(t))return e(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n.w=t.w,n):new a(t.x,t.y,t.z,t.w)},a.packedLength=4,a.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},a.unpack=function(n,r,i){return r=t(r,0),e(i)||(i=new a),i.x=n[r++],i.y=n[r++],i.z=n[r++],i.w=n[r],i},a.packArray=function(t,n){var r=t.length;e(n)?n.length=4*r:n=new Array(4*r);for(var i=0;i<r;++i)a.pack(t[i],n,4*i);return n},a.unpackArray=function(t,n){var r=t.length;e(n)?n.length=r/4:n=new Array(r/4);for(var i=0;i<r;i+=4){var o=i/4;n[o]=a.unpack(t,i,n[o])}return n},a.fromArray=a.unpack,a.maximumComponent=function(t){return Math.max(t.x,t.y,t.z,t.w)},a.minimumComponent=function(t){return Math.min(t.x,t.y,t.z,t.w)},a.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n.z=Math.min(t.z,e.z),n.w=Math.min(t.w,e.w),n},a.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n.z=Math.max(t.z,e.z),n.w=Math.max(t.w,e.w),n},a.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w},a.magnitude=function(t){return Math.sqrt(a.magnitudeSquared(t))};var o=new a;a.distance=function(t,e){return a.subtract(t,e,o),a.magnitude(o)},a.distanceSquared=function(t,e){return a.subtract(t,e,o),a.magnitudeSquared(o)},a.normalize=function(t,e){var n=a.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e.w=t.w/n,e},a.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z+t.w*e.w},a.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n.z=t.z*e.z,n.w=t.w*e.w,n},a.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n.z=t.z/e.z,n.w=t.w/e.w,n},a.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n.w=t.w+e.w,n},a.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n.w=t.w-e.w,n},a.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*e,n.w=t.w*e,n},a.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n.w=t.w/e,n},a.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e.w=-t.w,e},a.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e.w=Math.abs(t.w),e};var u=new a;a.lerp=function(t,e,n,r){return a.multiplyByScalar(e,n,u),r=a.multiplyByScalar(t,1-n,r),a.add(u,r,r)};var E=new a;return a.mostOrthogonalAxis=function(t,e){var n=a.normalize(t,E);return a.abs(n,n),e=n.x<=n.y?n.x<=n.z?n.x<=n.w?a.clone(a.UNIT_X,e):a.clone(a.UNIT_W,e):n.z<=n.w?a.clone(a.UNIT_Z,e):a.clone(a.UNIT_W,e):n.y<=n.z?n.y<=n.w?a.clone(a.UNIT_Y,e):a.clone(a.UNIT_W,e):n.z<=n.w?a.clone(a.UNIT_Z,e):a.clone(a.UNIT_W,e)},a.equals=function(t,n){return t===n||e(t)&&e(n)&&t.x===n.x&&t.y===n.y&&t.z===n.z&&t.w===n.w},a.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]&&t.w===e[n+3]},a.equalsEpsilon=function(t,n,r,a){return t===n||e(t)&&e(n)&&i.equalsEpsilon(t.x,n.x,r,a)&&i.equalsEpsilon(t.y,n.y,r,a)&&i.equalsEpsilon(t.z,n.z,r,a)&&i.equalsEpsilon(t.w,n.w,r,a)},a.ZERO=r(new a(0,0,0,0)),a.UNIT_X=r(new a(1,0,0,0)),a.UNIT_Y=r(new a(0,1,0,0)),a.UNIT_Z=r(new a(0,0,1,0)),a.UNIT_W=r(new a(0,0,0,1)),a.prototype.clone=function(t){return a.clone(this,t)},a.prototype.equals=function(t){return a.equals(this,t)},a.prototype.equalsEpsilon=function(t,e,n){return a.equalsEpsilon(this,t,e,n)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},a}),define("Core/RuntimeError",["./defined"],function(t){"use strict";function e(t){this.name="RuntimeError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(t,e,n,r,i,a,o,u,E,s){"use strict";function c(t,e,r,i,a,o,u,E,s,c,_,T,R,l,A,f){this[0]=n(t,0),this[1]=n(a,0),this[2]=n(s,0),this[3]=n(R,0),this[4]=n(e,0), -this[5]=n(o,0),this[6]=n(c,0),this[7]=n(l,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(_,0),this[11]=n(A,0),this[12]=n(i,0),this[13]=n(E,0),this[14]=n(T,0),this[15]=n(f,0)}c.packedLength=16,c.pack=function(t,e,r){return r=n(r,0),e[r++]=t[0],e[r++]=t[1],e[r++]=t[2],e[r++]=t[3],e[r++]=t[4],e[r++]=t[5],e[r++]=t[6],e[r++]=t[7],e[r++]=t[8],e[r++]=t[9],e[r++]=t[10],e[r++]=t[11],e[r++]=t[12],e[r++]=t[13],e[r++]=t[14],e[r]=t[15],e},c.unpack=function(t,e,i){return e=n(e,0),r(i)||(i=new c),i[0]=t[e++],i[1]=t[e++],i[2]=t[e++],i[3]=t[e++],i[4]=t[e++],i[5]=t[e++],i[6]=t[e++],i[7]=t[e++],i[8]=t[e++],i[9]=t[e++],i[10]=t[e++],i[11]=t[e++],i[12]=t[e++],i[13]=t[e++],i[14]=t[e++],i[15]=t[e],i},c.clone=function(t,e){if(r(t))return r(e)?(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],e):new c(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15])},c.fromArray=c.unpack,c.fromColumnMajorArray=function(t,e){return c.clone(t,e)},c.fromRowMajorArray=function(t,e){return r(e)?(e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15],e):new c(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},c.fromRotationTranslation=function(e,i,a){return i=n(i,t.ZERO),r(a)?(a[0]=e[0],a[1]=e[1],a[2]=e[2],a[3]=0,a[4]=e[3],a[5]=e[4],a[6]=e[5],a[7]=0,a[8]=e[6],a[9]=e[7],a[10]=e[8],a[11]=0,a[12]=i.x,a[13]=i.y,a[14]=i.z,a[15]=1,a):new c(e[0],e[3],e[6],i.x,e[1],e[4],e[7],i.y,e[2],e[5],e[8],i.z,0,0,0,1)},c.fromTranslationQuaternionRotationScale=function(t,e,n,i){r(i)||(i=new c);var a=n.x,o=n.y,u=n.z,E=e.x*e.x,s=e.x*e.y,_=e.x*e.z,T=e.x*e.w,R=e.y*e.y,l=e.y*e.z,A=e.y*e.w,f=e.z*e.z,N=e.z*e.w,h=e.w*e.w,d=E-R-f+h,I=2*(s-N),S=2*(_+A),M=2*(s+N),O=-E+R-f+h,m=2*(l-T),y=2*(_-A),p=2*(l+T),C=-E-R+f+h;return i[0]=d*a,i[1]=M*a,i[2]=y*a,i[3]=0,i[4]=I*o,i[5]=O*o,i[6]=p*o,i[7]=0,i[8]=S*u,i[9]=m*u,i[10]=C*u,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,i},c.fromTranslationRotationScale=function(t,e){return c.fromTranslationQuaternionRotationScale(t.translation,t.rotation,t.scale,e)},c.fromTranslation=function(t,e){return c.fromRotationTranslation(E.IDENTITY,t,e)},c.fromScale=function(t,e){return r(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t.y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t.z,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new c(t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1)},c.fromUniformScale=function(t,e){return r(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new c(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1)};var _=new t,T=new t,R=new t;c.fromCamera=function(e,n){var i=e.position,a=e.direction,o=e.up;t.normalize(a,_),t.normalize(t.cross(_,o,T),T),t.normalize(t.cross(T,_,R),R);var u=T.x,E=T.y,s=T.z,l=_.x,A=_.y,f=_.z,N=R.x,h=R.y,d=R.z,I=i.x,S=i.y,M=i.z,O=u*-I+E*-S+s*-M,m=N*-I+h*-S+d*-M,y=l*I+A*S+f*M;return r(n)?(n[0]=u,n[1]=N,n[2]=-l,n[3]=0,n[4]=E,n[5]=h,n[6]=-A,n[7]=0,n[8]=s,n[9]=d,n[10]=-f,n[11]=0,n[12]=O,n[13]=m,n[14]=y,n[15]=1,n):new c(u,E,s,O,N,h,d,m,-l,-A,-f,y,0,0,0,1)},c.computePerspectiveFieldOfView=function(t,e,n,r,i){var a=Math.tan(.5*t),o=1/a,u=o/e,E=(r+n)/(n-r),s=2*r*n/(n-r);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=o,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=E,i[11]=-1,i[12]=0,i[13]=0,i[14]=s,i[15]=0,i},c.computeOrthographicOffCenter=function(t,e,n,r,i,a,o){var u=1/(e-t),E=1/(r-n),s=1/(a-i),c=-(e+t)*u,_=-(r+n)*E,T=-(a+i)*s;return u*=2,E*=2,s*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=s,o[11]=0,o[12]=c,o[13]=_,o[14]=T,o[15]=1,o},c.computePerspectiveOffCenter=function(t,e,n,r,i,a,o){var u=2*i/(e-t),E=2*i/(r-n),s=(e+t)/(e-t),c=(r+n)/(r-n),_=-(a+i)/(a-i),T=-1,R=-2*a*i/(a-i);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=s,o[9]=c,o[10]=_,o[11]=T,o[12]=0,o[13]=0,o[14]=R,o[15]=0,o},c.computeInfinitePerspectiveOffCenter=function(t,e,n,r,i,a){var o=2*i/(e-t),u=2*i/(r-n),E=(e+t)/(e-t),s=(r+n)/(r-n),c=-1,_=-1,T=-2*i;return a[0]=o,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=E,a[9]=s,a[10]=c,a[11]=_,a[12]=0,a[13]=0,a[14]=T,a[15]=0,a},c.computeViewportTransformation=function(t,e,r,i){t=n(t,n.EMPTY_OBJECT);var a=n(t.x,0),o=n(t.y,0),u=n(t.width,0),E=n(t.height,0);e=n(e,0),r=n(r,1);var s=.5*u,c=.5*E,_=.5*(r-e),T=s,R=c,l=_,A=a+s,f=o+c,N=e+_,h=1;return i[0]=T,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=R,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=l,i[11]=0,i[12]=A,i[13]=f,i[14]=N,i[15]=h,i},c.computeView=function(e,n,r,i,a){return a[0]=i.x,a[1]=r.x,a[2]=-n.x,a[3]=0,a[4]=i.y,a[5]=r.y,a[6]=-n.y,a[7]=0,a[8]=i.z,a[9]=r.z,a[10]=-n.z,a[11]=0,a[12]=-t.dot(i,e),a[13]=-t.dot(r,e),a[14]=t.dot(n,e),a[15]=1,a},c.toArray=function(t,e){return r(e)?(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],e):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]},c.getElementIndex=function(t,e){return 4*t+e},c.getColumn=function(t,e,n){var r=4*e,i=t[r],a=t[r+1],o=t[r+2],u=t[r+3];return n.x=i,n.y=a,n.z=o,n.w=u,n},c.setColumn=function(t,e,n,r){r=c.clone(t,r);var i=4*e;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r[i+3]=n.w,r},c.setTranslation=function(t,e,n){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=t[15],n},c.getRow=function(t,e,n){var r=t[e],i=t[e+4],a=t[e+8],o=t[e+12];return n.x=r,n.y=i,n.z=a,n.w=o,n},c.setRow=function(t,e,n,r){return r=c.clone(t,r),r[e]=n.x,r[e+4]=n.y,r[e+8]=n.z,r[e+12]=n.w,r};var l=new t;c.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],l)),n.y=t.magnitude(t.fromElements(e[4],e[5],e[6],l)),n.z=t.magnitude(t.fromElements(e[8],e[9],e[10],l)),n};var A=new t;c.getMaximumScale=function(e){return c.getScale(e,A),t.maximumComponent(A)},c.multiply=function(t,e,n){var r=t[0],i=t[1],a=t[2],o=t[3],u=t[4],E=t[5],s=t[6],c=t[7],_=t[8],T=t[9],R=t[10],l=t[11],A=t[12],f=t[13],N=t[14],h=t[15],d=e[0],I=e[1],S=e[2],M=e[3],O=e[4],m=e[5],y=e[6],p=e[7],C=e[8],U=e[9],L=e[10],F=e[11],P=e[12],v=e[13],D=e[14],g=e[15],w=r*d+u*I+_*S+A*M,B=i*d+E*I+T*S+f*M,x=a*d+s*I+R*S+N*M,z=o*d+c*I+l*S+h*M,G=r*O+u*m+_*y+A*p,b=i*O+E*m+T*y+f*p,X=a*O+s*m+R*y+N*p,V=o*O+c*m+l*y+h*p,H=r*C+u*U+_*L+A*F,W=i*C+E*U+T*L+f*F,q=a*C+s*U+R*L+N*F,Y=o*C+c*U+l*L+h*F,K=r*P+u*v+_*D+A*g,k=i*P+E*v+T*D+f*g,Z=a*P+s*v+R*D+N*g,j=o*P+c*v+l*D+h*g;return n[0]=w,n[1]=B,n[2]=x,n[3]=z,n[4]=G,n[5]=b,n[6]=X,n[7]=V,n[8]=H,n[9]=W,n[10]=q,n[11]=Y,n[12]=K,n[13]=k,n[14]=Z,n[15]=j,n},c.add=function(t,e,n){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n[4]=t[4]+e[4],n[5]=t[5]+e[5],n[6]=t[6]+e[6],n[7]=t[7]+e[7],n[8]=t[8]+e[8],n[9]=t[9]+e[9],n[10]=t[10]+e[10],n[11]=t[11]+e[11],n[12]=t[12]+e[12],n[13]=t[13]+e[13],n[14]=t[14]+e[14],n[15]=t[15]+e[15],n},c.subtract=function(t,e,n){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n[4]=t[4]-e[4],n[5]=t[5]-e[5],n[6]=t[6]-e[6],n[7]=t[7]-e[7],n[8]=t[8]-e[8],n[9]=t[9]-e[9],n[10]=t[10]-e[10],n[11]=t[11]-e[11],n[12]=t[12]-e[12],n[13]=t[13]-e[13],n[14]=t[14]-e[14],n[15]=t[15]-e[15],n},c.multiplyTransformation=function(t,e,n){var r=t[0],i=t[1],a=t[2],o=t[4],u=t[5],E=t[6],s=t[8],c=t[9],_=t[10],T=t[12],R=t[13],l=t[14],A=e[0],f=e[1],N=e[2],h=e[4],d=e[5],I=e[6],S=e[8],M=e[9],O=e[10],m=e[12],y=e[13],p=e[14],C=r*A+o*f+s*N,U=i*A+u*f+c*N,L=a*A+E*f+_*N,F=r*h+o*d+s*I,P=i*h+u*d+c*I,v=a*h+E*d+_*I,D=r*S+o*M+s*O,g=i*S+u*M+c*O,w=a*S+E*M+_*O,B=r*m+o*y+s*p+T,x=i*m+u*y+c*p+R,z=a*m+E*y+_*p+l;return n[0]=C,n[1]=U,n[2]=L,n[3]=0,n[4]=F,n[5]=P,n[6]=v,n[7]=0,n[8]=D,n[9]=g,n[10]=w,n[11]=0,n[12]=B,n[13]=x,n[14]=z,n[15]=1,n},c.multiplyByMatrix3=function(t,e,n){var r=t[0],i=t[1],a=t[2],o=t[4],u=t[5],E=t[6],s=t[8],c=t[9],_=t[10],T=e[0],R=e[1],l=e[2],A=e[3],f=e[4],N=e[5],h=e[6],d=e[7],I=e[8],S=r*T+o*R+s*l,M=i*T+u*R+c*l,O=a*T+E*R+_*l,m=r*A+o*f+s*N,y=i*A+u*f+c*N,p=a*A+E*f+_*N,C=r*h+o*d+s*I,U=i*h+u*d+c*I,L=a*h+E*d+_*I;return n[0]=S,n[1]=M,n[2]=O,n[3]=0,n[4]=m,n[5]=y,n[6]=p,n[7]=0,n[8]=C,n[9]=U,n[10]=L,n[11]=0,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n},c.multiplyByTranslation=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=r*t[0]+i*t[4]+a*t[8]+t[12],u=r*t[1]+i*t[5]+a*t[9]+t[13],E=r*t[2]+i*t[6]+a*t[10]+t[14];return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=o,n[13]=u,n[14]=E,n[15]=t[15],n};var f=new t;c.multiplyByUniformScale=function(t,e,n){return f.x=e,f.y=e,f.z=e,c.multiplyByScale(t,f,n)},c.multiplyByScale=function(t,e,n){var r=e.x,i=e.y,a=e.z;return 1===r&&1===i&&1===a?c.clone(t,n):(n[0]=r*t[0],n[1]=r*t[1],n[2]=r*t[2],n[3]=0,n[4]=i*t[4],n[5]=i*t[5],n[6]=i*t[6],n[7]=0,n[8]=a*t[8],n[9]=a*t[9],n[10]=a*t[10],n[11]=0,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=1,n)},c.multiplyByVector=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=e.w,u=t[0]*r+t[4]*i+t[8]*a+t[12]*o,E=t[1]*r+t[5]*i+t[9]*a+t[13]*o,s=t[2]*r+t[6]*i+t[10]*a+t[14]*o,c=t[3]*r+t[7]*i+t[11]*a+t[15]*o;return n.x=u,n.y=E,n.z=s,n.w=c,n},c.multiplyByPointAsVector=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=t[0]*r+t[4]*i+t[8]*a,u=t[1]*r+t[5]*i+t[9]*a,E=t[2]*r+t[6]*i+t[10]*a;return n.x=o,n.y=u,n.z=E,n},c.multiplyByPoint=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=t[0]*r+t[4]*i+t[8]*a+t[12],u=t[1]*r+t[5]*i+t[9]*a+t[13],E=t[2]*r+t[6]*i+t[10]*a+t[14];return n.x=o,n.y=u,n.z=E,n},c.multiplyByScalar=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n[4]=t[4]*e,n[5]=t[5]*e,n[6]=t[6]*e,n[7]=t[7]*e,n[8]=t[8]*e,n[9]=t[9]*e,n[10]=t[10]*e,n[11]=t[11]*e,n[12]=t[12]*e,n[13]=t[13]*e,n[14]=t[14]*e,n[15]=t[15]*e,n},c.negate=function(t,e){return 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],e},c.transpose=function(t,e){var n=t[1],r=t[2],i=t[3],a=t[6],o=t[7],u=t[11];return e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=r,e[9]=a,e[10]=t[10],e[11]=t[14],e[12]=i,e[13]=o,e[14]=u,e[15]=t[15],e},c.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e[9]=Math.abs(t[9]),e[10]=Math.abs(t[10]),e[11]=Math.abs(t[11]),e[12]=Math.abs(t[12]),e[13]=Math.abs(t[13]),e[14]=Math.abs(t[14]),e[15]=Math.abs(t[15]),e},c.equals=function(t,e){return t===e||r(t)&&r(e)&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[3]===e[3]&&t[7]===e[7]&&t[11]===e[11]&&t[15]===e[15]},c.equalsEpsilon=function(t,e,n){return t===e||r(t)&&r(e)&&Math.abs(t[0]-e[0])<=n&&Math.abs(t[1]-e[1])<=n&&Math.abs(t[2]-e[2])<=n&&Math.abs(t[3]-e[3])<=n&&Math.abs(t[4]-e[4])<=n&&Math.abs(t[5]-e[5])<=n&&Math.abs(t[6]-e[6])<=n&&Math.abs(t[7]-e[7])<=n&&Math.abs(t[8]-e[8])<=n&&Math.abs(t[9]-e[9])<=n&&Math.abs(t[10]-e[10])<=n&&Math.abs(t[11]-e[11])<=n&&Math.abs(t[12]-e[12])<=n&&Math.abs(t[13]-e[13])<=n&&Math.abs(t[14]-e[14])<=n&&Math.abs(t[15]-e[15])<=n},c.getTranslation=function(t,e){return e.x=t[12],e.y=t[13],e.z=t[14],e},c.getRotation=function(t,e){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e};var N=new E,h=new E,d=new e,I=new e(0,0,0,1);return c.inverse=function(t,n){if(E.equalsEpsilon(c.getRotation(t,N),h,u.EPSILON7)&&e.equals(c.getRow(t,3,d),I))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-t[12],n[13]=-t[13],n[14]=-t[14],n[15]=1,n;var r=t[0],i=t[4],a=t[8],o=t[12],_=t[1],T=t[5],R=t[9],l=t[13],A=t[2],f=t[6],S=t[10],M=t[14],O=t[3],m=t[7],y=t[11],p=t[15],C=S*p,U=M*y,L=f*p,F=M*m,P=f*y,v=S*m,D=A*p,g=M*O,w=A*y,B=S*O,x=A*m,z=f*O,G=C*T+F*R+P*l-(U*T+L*R+v*l),b=U*_+D*R+B*l-(C*_+g*R+w*l),X=L*_+g*T+x*l-(F*_+D*T+z*l),V=v*_+w*T+z*R-(P*_+B*T+x*R),H=U*i+L*a+v*o-(C*i+F*a+P*o),W=C*r+g*a+w*o-(U*r+D*a+B*o),q=F*r+D*i+z*o-(L*r+g*i+x*o),Y=P*r+B*i+x*a-(v*r+w*i+z*a);C=a*l,U=o*R,L=i*l,F=o*T,P=i*R,v=a*T,D=r*l,g=o*_,w=r*R,B=a*_,x=r*T,z=i*_;var K=C*m+F*y+P*p-(U*m+L*y+v*p),k=U*O+D*y+B*p-(C*O+g*y+w*p),Z=L*O+g*m+x*p-(F*O+D*m+z*p),j=v*O+w*m+z*y-(P*O+B*m+x*y),Q=L*S+v*M+U*f-(P*M+C*f+F*S),J=w*M+C*A+g*S-(D*S+B*M+U*A),$=D*f+z*M+F*A-(x*M+L*A+g*f),tt=x*S+P*A+B*f-(w*f+z*S+v*A),et=r*G+i*b+a*X+o*V;if(Math.abs(et)<u.EPSILON20)throw new s("matrix is not invertible because its determinate is zero.");return et=1/et,n[0]=G*et,n[1]=b*et,n[2]=X*et,n[3]=V*et,n[4]=H*et,n[5]=W*et,n[6]=q*et,n[7]=Y*et,n[8]=K*et,n[9]=k*et,n[10]=Z*et,n[11]=j*et,n[12]=Q*et,n[13]=J*et,n[14]=$*et,n[15]=tt*et,n},c.inverseTransformation=function(t,e){var n=t[0],r=t[1],i=t[2],a=t[4],o=t[5],u=t[6],E=t[8],s=t[9],c=t[10],_=t[12],T=t[13],R=t[14],l=-n*_-r*T-i*R,A=-a*_-o*T-u*R,f=-E*_-s*T-c*R;return e[0]=n,e[1]=a,e[2]=E,e[3]=0,e[4]=r,e[5]=o,e[6]=s,e[7]=0,e[8]=i,e[9]=u,e[10]=c,e[11]=0,e[12]=l,e[13]=A,e[14]=f,e[15]=1,e},c.IDENTITY=o(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),c.ZERO=o(new c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN0ROW3=3,c.COLUMN1ROW0=4,c.COLUMN1ROW1=5,c.COLUMN1ROW2=6,c.COLUMN1ROW3=7,c.COLUMN2ROW0=8,c.COLUMN2ROW1=9,c.COLUMN2ROW2=10,c.COLUMN2ROW3=11,c.COLUMN3ROW0=12,c.COLUMN3ROW1=13,c.COLUMN3ROW2=14,c.COLUMN3ROW3=15,i(c.prototype,{length:{get:function(){return c.packedLength}}}),c.prototype.clone=function(t){return c.clone(this,t)},c.prototype.equals=function(t){return c.equals(this,t)},c.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]&&t[4]===e[n+4]&&t[5]===e[n+5]&&t[6]===e[n+6]&&t[7]===e[n+7]&&t[8]===e[n+8]&&t[9]===e[n+9]&&t[10]===e[n+10]&&t[11]===e[n+11]&&t[12]===e[n+12]&&t[13]===e[n+13]&&t[14]===e[n+14]&&t[15]===e[n+15]},c.prototype.equalsEpsilon=function(t,e){return c.equalsEpsilon(this,t,e)},c.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]+")"},c}),define("Core/Rectangle",["./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(t,e,n,r,i,a,o,u){"use strict";function E(t,n,r,i){this.west=e(t,0),this.south=e(n,0),this.east=e(r,0),this.north=e(i,0)}r(E.prototype,{width:{get:function(){return E.computeWidth(this)}},height:{get:function(){return E.computeHeight(this)}}}),E.packedLength=4,E.pack=function(t,n,r){return r=e(r,0),n[r++]=t.west,n[r++]=t.south,n[r++]=t.east,n[r]=t.north,n},E.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new E),i.west=t[r++],i.south=t[r++],i.east=t[r++],i.north=t[r],i},E.computeWidth=function(t){var e=t.east,n=t.west;return e<n&&(e+=u.TWO_PI),e-n},E.computeHeight=function(t){return t.north-t.south},E.fromDegrees=function(t,r,i,a,o){return t=u.toRadians(e(t,0)),r=u.toRadians(e(r,0)),i=u.toRadians(e(i,0)),a=u.toRadians(e(a,0)),n(o)?(o.west=t,o.south=r,o.east=i,o.north=a,o):new E(t,r,i,a)},E.fromCartographicArray=function(t,e){for(var r=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=Number.MAX_VALUE,c=-Number.MAX_VALUE,_=0,T=t.length;_<T;_++){var R=t[_];r=Math.min(r,R.longitude),i=Math.max(i,R.longitude),s=Math.min(s,R.latitude),c=Math.max(c,R.latitude);var l=R.longitude>=0?R.longitude:R.longitude+u.TWO_PI;a=Math.min(a,l),o=Math.max(o,l)}return i-r>o-a&&(r=a,i=o,i>u.PI&&(i-=u.TWO_PI),r>u.PI&&(r-=u.TWO_PI)),n(e)?(e.west=r,e.south=s,e.east=i,e.north=c,e):new E(r,s,i,c)},E.fromCartesianArray=function(t,e,r){for(var i=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,s=-Number.MAX_VALUE,c=Number.MAX_VALUE,_=-Number.MAX_VALUE,T=0,R=t.length;T<R;T++){var l=e.cartesianToCartographic(t[T]);i=Math.min(i,l.longitude),a=Math.max(a,l.longitude),c=Math.min(c,l.latitude),_=Math.max(_,l.latitude);var A=l.longitude>=0?l.longitude:l.longitude+u.TWO_PI;o=Math.min(o,A),s=Math.max(s,A)}return a-i>s-o&&(i=o,a=s,a>u.PI&&(a-=u.TWO_PI),i>u.PI&&(i-=u.TWO_PI)),n(r)?(r.west=i,r.south=c,r.east=a,r.north=_,r):new E(i,c,a,_)},E.clone=function(t,e){if(n(t))return n(e)?(e.west=t.west,e.south=t.south,e.east=t.east,e.north=t.north,e):new E(t.west,t.south,t.east,t.north)},E.prototype.clone=function(t){return E.clone(this,t)},E.prototype.equals=function(t){return E.equals(this,t)},E.equals=function(t,e){return t===e||n(t)&&n(e)&&t.west===e.west&&t.south===e.south&&t.east===e.east&&t.north===e.north},E.prototype.equalsEpsilon=function(t,e){return n(t)&&Math.abs(this.west-t.west)<=e&&Math.abs(this.south-t.south)<=e&&Math.abs(this.east-t.east)<=e&&Math.abs(this.north-t.north)<=e},E.validate=function(t){},E.southwest=function(e,r){return n(r)?(r.longitude=e.west,r.latitude=e.south,r.height=0,r):new t(e.west,e.south)},E.northwest=function(e,r){return n(r)?(r.longitude=e.west,r.latitude=e.north,r.height=0,r):new t(e.west,e.north)},E.northeast=function(e,r){return n(r)?(r.longitude=e.east,r.latitude=e.north,r.height=0,r):new t(e.east,e.north)},E.southeast=function(e,r){return n(r)?(r.longitude=e.east,r.latitude=e.south,r.height=0,r):new t(e.east,e.south)},E.center=function(e,r){var i=e.east,a=e.west;i<a&&(i+=u.TWO_PI);var o=u.negativePiToPi(.5*(a+i)),E=.5*(e.south+e.north);return n(r)?(r.longitude=o,r.latitude=E,r.height=0,r):new t(o,E)},E.intersection=function(t,e,r){var i=t.east,a=t.west,o=e.east,s=e.west;i<a&&o>0?i+=u.TWO_PI:o<s&&i>0&&(o+=u.TWO_PI),i<a&&s<0?s+=u.TWO_PI:o<s&&a<0&&(a+=u.TWO_PI);var c=u.negativePiToPi(Math.max(a,s)),_=u.negativePiToPi(Math.min(i,o));if(!((t.west<t.east||e.west<e.east)&&_<=c)){var T=Math.max(t.south,e.south),R=Math.min(t.north,e.north);if(!(T>=R))return n(r)?(r.west=c,r.south=T,r.east=_,r.north=R,r):new E(c,T,_,R)}},E.simpleIntersection=function(t,e,r){var i=Math.max(t.west,e.west),a=Math.max(t.south,e.south),o=Math.min(t.east,e.east),u=Math.min(t.north,e.north);if(!(a>=u||i>=o))return n(r)?(r.west=i,r.south=a,r.east=o,r.north=u,r):new E(i,a,o,u)},E.union=function(t,e,r){n(r)||(r=new E);var i=t.east,a=t.west,o=e.east,s=e.west;i<a&&o>0?i+=u.TWO_PI:o<s&&i>0&&(o+=u.TWO_PI),i<a&&s<0?s+=u.TWO_PI:o<s&&a<0&&(a+=u.TWO_PI);var c=u.convertLongitudeRange(Math.min(a,s)),_=u.convertLongitudeRange(Math.max(i,o));return r.west=c,r.south=Math.min(t.south,e.south),r.east=_,r.north=Math.max(t.north,e.north),r},E.expand=function(t,e,r){return n(r)||(r=new E),r.west=Math.min(t.west,e.longitude),r.south=Math.min(t.south,e.latitude),r.east=Math.max(t.east,e.longitude),r.north=Math.max(t.north,e.latitude),r},E.contains=function(t,e){var n=e.longitude,r=e.latitude,i=t.west,a=t.east;return a<i&&(a+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>i||u.equalsEpsilon(n,i,u.EPSILON14))&&(n<a||u.equalsEpsilon(n,a,u.EPSILON14))&&r>=t.south&&r<=t.north};var s=new t;return E.subsample=function(t,r,i,o){r=e(r,a.WGS84),i=e(i,0),n(o)||(o=[]);var c=0,_=t.north,T=t.south,R=t.east,l=t.west,A=s;A.height=i,A.longitude=l,A.latitude=_,o[c]=r.cartographicToCartesian(A,o[c]),c++,A.longitude=R,o[c]=r.cartographicToCartesian(A,o[c]),c++,A.latitude=T,o[c]=r.cartographicToCartesian(A,o[c]),c++,A.longitude=l,o[c]=r.cartographicToCartesian(A,o[c]),c++,_<0?A.latitude=_:T>0?A.latitude=T:A.latitude=0;for(var f=1;f<8;++f)A.longitude=-Math.PI+f*u.PI_OVER_TWO,E.contains(t,A)&&(o[c]=r.cartographicToCartesian(A,o[c]),c++);return 0===A.latitude&&(A.longitude=l,o[c]=r.cartographicToCartesian(A,o[c]),c++,A.longitude=R,o[c]=r.cartographicToCartesian(A,o[c]),c++),o.length=c,o},E.MAX_VALUE=o(new E(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),E}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(t,e,n,r,i,a,o,u,E,s,c,_){"use strict";function T(e,r){this.center=t.clone(n(e,t.ZERO)),this.radius=n(r,0)}var R=new t,l=new t,A=new t,f=new t,N=new t,h=new t,d=new t,I=new t,S=new t,M=new t,O=new t,m=new t;T.fromPoints=function(e,n){if(r(n)||(n=new T),!r(e)||0===e.length)return n.center=t.clone(t.ZERO,n.center),n.radius=0,n;for(var i=t.clone(e[0],d),a=t.clone(i,R),o=t.clone(i,l),u=t.clone(i,A),E=t.clone(i,f),s=t.clone(i,N),c=t.clone(i,h),_=e.length,y=1;y<_;y++){t.clone(e[y],i);var p=i.x,C=i.y,U=i.z;p<a.x&&t.clone(i,a),p>E.x&&t.clone(i,E),C<o.y&&t.clone(i,o),C>s.y&&t.clone(i,s),U<u.z&&t.clone(i,u),U>c.z&&t.clone(i,c)}var L=t.magnitudeSquared(t.subtract(E,a,I)),F=t.magnitudeSquared(t.subtract(s,o,I)),P=t.magnitudeSquared(t.subtract(c,u,I)),v=a,D=E,g=L;F>g&&(g=F,v=o,D=s),P>g&&(g=P,v=u,D=c);var w=S;w.x=.5*(v.x+D.x),w.y=.5*(v.y+D.y),w.z=.5*(v.z+D.z);var B=t.magnitudeSquared(t.subtract(D,w,I)),x=Math.sqrt(B),z=M;z.x=a.x,z.y=o.y,z.z=u.z;var G=O;G.x=E.x,G.y=s.y,G.z=c.z;var b=t.multiplyByScalar(t.add(z,G,I),.5,m),X=0;for(y=0;y<_;y++){t.clone(e[y],i);var V=t.magnitude(t.subtract(i,b,I));V>X&&(X=V);var H=t.magnitudeSquared(t.subtract(i,w,I));if(H>B){var W=Math.sqrt(H);x=.5*(x+W),B=x*x;var q=W-x;w.x=(x*w.x+q*i.x)/W,w.y=(x*w.y+q*i.y)/W,w.z=(x*w.z+q*i.z)/W}}return x<X?(t.clone(w,n.center),n.radius=x):(t.clone(b,n.center),n.radius=X),n};var y=new o,p=new t,C=new t,U=new e,L=new e;T.fromRectangle2D=function(t,e,n){return T.fromRectangleWithHeights2D(t,e,0,0,n)},T.fromRectangleWithHeights2D=function(e,i,a,o,u){if(r(u)||(u=new T),!r(e))return u.center=t.clone(t.ZERO,u.center),u.radius=0,u;i=n(i,y),_.southwest(e,U),U.height=a,_.northeast(e,L),L.height=o;var E=i.project(U,p),s=i.project(L,C),c=s.x-E.x,R=s.y-E.y,l=s.z-E.z;u.radius=.5*Math.sqrt(c*c+R*R+l*l);var A=u.center;return A.x=E.x+.5*c,A.y=E.y+.5*R,A.z=E.z+.5*l,u};var F=[];T.fromRectangle3D=function(t,e,i,o){e=n(e,a.WGS84),i=n(i,0);var u;return r(t)&&(u=_.subsample(t,e,i,F)),T.fromPoints(u,o)},T.fromVertices=function(e,i,a,o){if(r(o)||(o=new T),!r(e)||0===e.length)return o.center=t.clone(t.ZERO,o.center),o.radius=0,o;i=n(i,t.ZERO),a=n(a,3);var u=d;u.x=e[0]+i.x,u.y=e[1]+i.y,u.z=e[2]+i.z;for(var E=t.clone(u,R),s=t.clone(u,l),c=t.clone(u,A),_=t.clone(u,f),y=t.clone(u,N),p=t.clone(u,h),C=e.length,U=0;U<C;U+=a){var L=e[U]+i.x,F=e[U+1]+i.y,P=e[U+2]+i.z;u.x=L,u.y=F,u.z=P,L<E.x&&t.clone(u,E),L>_.x&&t.clone(u,_),F<s.y&&t.clone(u,s),F>y.y&&t.clone(u,y),P<c.z&&t.clone(u,c),P>p.z&&t.clone(u,p)}var v=t.magnitudeSquared(t.subtract(_,E,I)),D=t.magnitudeSquared(t.subtract(y,s,I)),g=t.magnitudeSquared(t.subtract(p,c,I)),w=E,B=_,x=v;D>x&&(x=D,w=s,B=y),g>x&&(x=g,w=c,B=p);var z=S;z.x=.5*(w.x+B.x),z.y=.5*(w.y+B.y),z.z=.5*(w.z+B.z);var G=t.magnitudeSquared(t.subtract(B,z,I)),b=Math.sqrt(G),X=M;X.x=E.x,X.y=s.y,X.z=c.z;var V=O;V.x=_.x,V.y=y.y,V.z=p.z;var H=t.multiplyByScalar(t.add(X,V,I),.5,m),W=0;for(U=0;U<C;U+=a){u.x=e[U]+i.x,u.y=e[U+1]+i.y,u.z=e[U+2]+i.z;var q=t.magnitude(t.subtract(u,H,I));q>W&&(W=q);var Y=t.magnitudeSquared(t.subtract(u,z,I));if(Y>G){var K=Math.sqrt(Y);b=.5*(b+K),G=b*b;var k=K-b;z.x=(b*z.x+k*u.x)/K,z.y=(b*z.y+k*u.y)/K,z.z=(b*z.z+k*u.z)/K}}return b<W?(t.clone(z,o.center),o.radius=b):(t.clone(H,o.center),o.radius=W),o},T.fromEncodedCartesianVertices=function(e,n,i){if(r(i)||(i=new T),!r(e)||!r(n)||e.length!==n.length||0===e.length)return i.center=t.clone(t.ZERO,i.center),i.radius=0,i;var a=d;a.x=e[0]+n[0],a.y=e[1]+n[1],a.z=e[2]+n[2];for(var o=t.clone(a,R),u=t.clone(a,l),E=t.clone(a,A),s=t.clone(a,f),c=t.clone(a,N),_=t.clone(a,h),y=e.length,p=0;p<y;p+=3){var C=e[p]+n[p],U=e[p+1]+n[p+1],L=e[p+2]+n[p+2];a.x=C,a.y=U,a.z=L,C<o.x&&t.clone(a,o),C>s.x&&t.clone(a,s),U<u.y&&t.clone(a,u),U>c.y&&t.clone(a,c),L<E.z&&t.clone(a,E),L>_.z&&t.clone(a,_)}var F=t.magnitudeSquared(t.subtract(s,o,I)),P=t.magnitudeSquared(t.subtract(c,u,I)),v=t.magnitudeSquared(t.subtract(_,E,I)),D=o,g=s,w=F;P>w&&(w=P,D=u,g=c),v>w&&(w=v,D=E,g=_);var B=S;B.x=.5*(D.x+g.x),B.y=.5*(D.y+g.y),B.z=.5*(D.z+g.z);var x=t.magnitudeSquared(t.subtract(g,B,I)),z=Math.sqrt(x),G=M;G.x=o.x,G.y=u.y,G.z=E.z;var b=O;b.x=s.x,b.y=c.y,b.z=_.z;var X=t.multiplyByScalar(t.add(G,b,I),.5,m),V=0;for(p=0;p<y;p+=3){a.x=e[p]+n[p],a.y=e[p+1]+n[p+1],a.z=e[p+2]+n[p+2];var H=t.magnitude(t.subtract(a,X,I));H>V&&(V=H);var W=t.magnitudeSquared(t.subtract(a,B,I));if(W>x){var q=Math.sqrt(W);z=.5*(z+q),x=z*z;var Y=q-z;B.x=(z*B.x+Y*a.x)/q,B.y=(z*B.y+Y*a.y)/q,B.z=(z*B.z+Y*a.z)/q}}return z<V?(t.clone(B,i.center),i.radius=z):(t.clone(X,i.center),i.radius=V),i},T.fromCornerPoints=function(e,n,i){r(i)||(i=new T);var a=i.center;return t.add(e,n,a),t.multiplyByScalar(a,.5,a),i.radius=t.distance(a,n),i},T.fromEllipsoid=function(e,n){return r(n)||(n=new T),t.clone(t.ZERO,n.center),n.radius=e.maximumRadius,n};var P=new t;T.fromBoundingSpheres=function(e,n){if(r(n)||(n=new T),!r(e)||0===e.length)return n.center=t.clone(t.ZERO,n.center),n.radius=0,n;var i=e.length;if(1===i)return T.clone(e[0],n);if(2===i)return T.union(e[0],e[1],n);for(var a=[],o=0;o<i;o++)a.push(e[o].center);n=T.fromPoints(a,n);var u=n.center,E=n.radius;for(o=0;o<i;o++){var s=e[o];E=Math.max(E,t.distance(u,s.center,P)+s.radius)}return n.radius=E,n};var v=new t,D=new t,g=new t;T.fromOrientedBoundingBox=function(e,n){r(n)||(n=new T);var i=e.halfAxes,a=s.getColumn(i,0,v),o=s.getColumn(i,1,D),u=s.getColumn(i,2,g),E=t.magnitude(a),c=t.magnitude(o),_=t.magnitude(u);return n.center=t.clone(e.center,n.center),n.radius=Math.max(E,c,_),n},T.clone=function(e,n){if(r(e))return r(n)?(n.center=t.clone(e.center,n.center),n.radius=e.radius,n):new T(e.center,e.radius)},T.packedLength=4,T.pack=function(t,e,r){r=n(r,0);var i=t.center;return e[r++]=i.x,e[r++]=i.y,e[r++]=i.z,e[r]=t.radius,e},T.unpack=function(t,e,i){e=n(e,0),r(i)||(i=new T);var a=i.center;return a.x=t[e++],a.y=t[e++],a.z=t[e++],i.radius=t[e],i};var w=new t,B=new t;T.union=function(e,n,i){r(i)||(i=new T);var a=e.center,o=e.radius,u=n.center,E=n.radius,s=t.subtract(u,a,w),c=t.magnitude(s);if(o>=c+E)return e.clone(i),i;if(E>=c+o)return n.clone(i),i;var _=.5*(o+c+E),R=t.multiplyByScalar(s,(-o+_)/c,B);return t.add(R,a,R),t.clone(R,i.center),i.radius=_,i};var x=new t;T.expand=function(e,n,r){r=T.clone(e,r);var i=t.magnitude(t.subtract(n,r.center,x));return i>r.radius&&(r.radius=i),r},T.intersectPlane=function(e,n){var r=e.center,i=e.radius,a=n.normal,o=t.dot(a,r)+n.distance;return o<-i?u.OUTSIDE:o<i?u.INTERSECTING:u.INSIDE},T.transform=function(t,e,n){return r(n)||(n=new T),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=c.getMaximumScale(e)*t.radius,n};var z=new t;T.distanceSquaredTo=function(e,n){var r=t.subtract(e.center,n,z);return t.magnitudeSquared(r)-e.radius*e.radius},T.transformWithoutScale=function(t,e,n){return r(n)||(n=new T),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=t.radius,n};var G=new t;T.computePlaneDistances=function(e,n,i,a){r(a)||(a=new E);var o=t.subtract(e.center,n,G),u=t.dot(i,o);return a.start=u-e.radius,a.stop=u+e.radius,a};for(var b=new t,X=new t,V=new t,H=new t,W=new t,q=new e,Y=new Array(8),K=0;K<8;++K)Y[K]=new t;var k=new o;return T.projectTo2D=function(e,r,i){r=n(r,k);var a=r.ellipsoid,o=e.center,u=e.radius,E=a.geodeticSurfaceNormal(o,b),s=t.cross(t.UNIT_Z,E,X);t.normalize(s,s);var c=t.cross(E,s,V);t.normalize(c,c),t.multiplyByScalar(E,u,E),t.multiplyByScalar(c,u,c),t.multiplyByScalar(s,u,s);var _=t.negate(c,W),R=t.negate(s,H),l=Y,A=l[0];t.add(E,c,A),t.add(A,s,A),A=l[1],t.add(E,c,A),t.add(A,R,A),A=l[2],t.add(E,_,A),t.add(A,R,A),A=l[3],t.add(E,_,A),t.add(A,s,A),t.negate(E,E),A=l[4],t.add(E,c,A),t.add(A,s,A),A=l[5],t.add(E,c,A),t.add(A,R,A),A=l[6],t.add(E,_,A),t.add(A,R,A),A=l[7],t.add(E,_,A),t.add(A,s,A);for(var f=l.length,N=0;N<f;++N){var h=l[N];t.add(o,h,h);var d=a.cartesianToCartographic(h,q);r.project(d,h)}i=T.fromPoints(l,i),o=i.center;var I=o.x,S=o.y,M=o.z;return o.x=M,o.y=I,o.z=S,i},T.isOccluded=function(t,e){return!e.isBoundingSphereVisible(t)},T.equals=function(e,n){return e===n||r(e)&&r(n)&&t.equals(e.center,n.center)&&e.radius===n.radius},T.prototype.intersectPlane=function(t){return T.intersectPlane(this,t)},T.prototype.distanceSquaredTo=function(t){return T.distanceSquaredTo(this,t)},T.prototype.computePlaneDistances=function(t,e,n){return T.computePlaneDistances(this,t,e,n)},T.prototype.isOccluded=function(t){return T.isOccluded(this,t)},T.prototype.equals=function(t){return T.equals(this,t)},T.prototype.clone=function(t){return T.clone(this,t)},T}),define("Core/Fullscreen",["./defined","./defineProperties"],function(t,e){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},i={};return e(i,{element:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(i.supportsFullscreen())return null!==i.element}}}),i.supportsFullscreen=function(){if(t(n))return n;n=!1;var e=document.body;if("function"==typeof e.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var i,a=["webkit","moz","o","ms","khtml"],o=0,u=a.length;o<u;++o){var E=a[o];i=E+"RequestFullscreen","function"==typeof e[i]?(r.requestFullscreen=i,n=!0):(i=E+"RequestFullScreen","function"==typeof e[i]&&(r.requestFullscreen=i,n=!0)),i=E+"ExitFullscreen","function"==typeof document[i]?r.exitFullscreen=i:(i=E+"CancelFullScreen","function"==typeof document[i]&&(r.exitFullscreen=i)),i=E+"FullscreenEnabled",void 0!==document[i]?r.fullscreenEnabled=i:(i=E+"FullScreenEnabled",void 0!==document[i]&&(r.fullscreenEnabled=i)),i=E+"FullscreenElement",void 0!==document[i]?r.fullscreenElement=i:(i=E+"FullScreenElement",void 0!==document[i]&&(r.fullscreenElement=i)),i=E+"fullscreenchange",void 0!==document["on"+i]&&("ms"===E&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=E+"fullscreenerror",void 0!==document["on"+i]&&("ms"===E&&(i="MSFullscreenError"),r.fullscreenerror=i)}return n},i.requestFullscreen=function(t,e){i.supportsFullscreen()&&t[r.requestFullscreen]({vrDisplay:e})},i.exitFullscreen=function(){i.supportsFullscreen()&&document[r.exitFullscreen]()},i}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(t,e,n){"use strict";function r(t){for(var e=t.split("."),n=0,r=e.length;n<r;++n)e[n]=parseInt(e[n],10);return e}function i(){if(!e(S)&&(S=!1,!T())){var t=/ Chrome\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(S=!0,M=r(t[1]))}return S}function a(){return i()&&M}function o(){if(!e(O)&&(O=!1,!i()&&!T()&&/ Safari\/[\.0-9]+/.test(I.userAgent))){var t=/ Version\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(O=!0,m=r(t[1]))}return O}function u(){return o()&&m}function E(){if(!e(y)){y=!1;var t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(I.userAgent);null!==t&&(y=!0,p=r(t[1]),p.isNightly=!!t[2])}return y}function s(){return E()&&p}function c(){if(!e(C)){C=!1;var t;"Microsoft Internet Explorer"===I.appName?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==t&&(C=!0,U=r(t[1]))):"Netscape"===I.appName&&(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==t&&(C=!0,U=r(t[1])))}return C}function _(){return c()&&U}function T(){if(!e(L)){L=!1;var t=/ Edge\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(L=!0,F=r(t[1]))}return L}function R(){return T()&&F}function l(){if(!e(P)){P=!1;var t=/Firefox\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(P=!0,v=r(t[1]))}return P}function A(){return e(D)||(D=/Windows/i.test(I.appVersion)),D}function f(){return l()&&v}function N(){return e(g)||(g="undefined"!=typeof PointerEvent&&(!e(I.pointerEnabled)||I.pointerEnabled)),g}function h(){ -if(!e(B)){var t=document.createElement("canvas");t.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=t.style.imageRendering;B=e(n)&&""!==n,B&&(w=n)}return B}function d(){return h()?w:void 0}var I;I="undefined"!=typeof navigator?navigator:{};var S,M,O,m,y,p,C,U,L,F,P,v,D,g,w,B,x={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:E,webkitVersion:s,isInternetExplorer:c,internetExplorerVersion:_,isEdge:T,edgeVersion:R,isFirefox:l,firefoxVersion:f,isWindows:A,hardwareConcurrency:t(I.hardwareConcurrency,3),supportsPointerEvents:N,supportsImageRenderingPixelated:h,imageRenderingValue:d};return x.supportsFullscreen=function(){return n.supportsFullscreen()},x.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},x.supportsWebWorkers=function(){return"undefined"!=typeof Worker},x}),define("Core/WebGLConstants",["./freezeObject"],function(t){"use strict";var e={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503};return t(e)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(t,e,n,r,i,a){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:a.BYTE,UNSIGNED_BYTE:a.UNSIGNED_BYTE,SHORT:a.SHORT,UNSIGNED_SHORT:a.UNSIGNED_SHORT,INT:a.INT,UNSIGNED_INT:a.UNSIGNED_INT,FLOAT:a.FLOAT,DOUBLE:a.DOUBLE};return o.getSizeInBytes=function(t){switch(t){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.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(t){return t instanceof Int8Array?o.BYTE:t instanceof Uint8Array?o.UNSIGNED_BYTE:t instanceof Int16Array?o.SHORT:t instanceof Uint16Array?o.UNSIGNED_SHORT:t instanceof Int32Array?o.INT:t instanceof Uint32Array?o.UNSIGNED_INT:t instanceof Float32Array?o.FLOAT:t instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(t){return e(t)&&(t===o.BYTE||t===o.UNSIGNED_BYTE||t===o.SHORT||t===o.UNSIGNED_SHORT||t===o.INT||t===o.UNSIGNED_INT||t===o.FLOAT||t===o.DOUBLE)},o.createTypedArray=function(t,e){switch(t){case o.BYTE:return new Int8Array(e);case o.UNSIGNED_BYTE:return new Uint8Array(e);case o.SHORT:return new Int16Array(e);case o.UNSIGNED_SHORT:return new Uint16Array(e);case o.INT:return new Int32Array(e);case o.UNSIGNED_INT:return new Uint32Array(e);case o.FLOAT:return new Float32Array(e);case o.DOUBLE:return new Float64Array(e)}},o.createArrayBufferView=function(e,n,r,i){switch(r=t(r,0),i=t(i,(n.byteLength-r)/o.getSizeInBytes(e)),e){case o.BYTE:return new Int8Array(n,r,i);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,i);case o.SHORT:return new Int16Array(n,r,i);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,i);case o.INT:return new Int32Array(n,r,i);case o.UNSIGNED_INT:return new Uint32Array(n,r,i);case o.FLOAT:return new Float32Array(n,r,i);case o.DOUBLE:return new Float64Array(n,r,i)}},o.fromName=function(t){switch(t){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},i(o)}),define("Core/GeometryType",["./freezeObject"],function(t){"use strict";var e={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return t(e)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(t,e){"use strict";var n={POINTS:e.POINTS,LINES:e.LINES,LINE_LOOP:e.LINE_LOOP,LINE_STRIP:e.LINE_STRIP,TRIANGLES:e.TRIANGLES,TRIANGLE_STRIP:e.TRIANGLE_STRIP,TRIANGLE_FAN:e.TRIANGLE_FAN,validate:function(t){return t===n.POINTS||t===n.LINES||t===n.LINE_LOOP||t===n.LINE_STRIP||t===n.TRIANGLES||t===n.TRIANGLE_STRIP||t===n.TRIANGLE_FAN}};return t(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(t,e,n,r,i){"use strict";function a(e){e=t(e,t.EMPTY_OBJECT),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=t(e.primitiveType,i.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=t(e.geometryType,r.NONE),this.boundingSphereCV=e.boundingSphereCV}return a.computeNumberOfVertices=function(t){var n=-1;for(var r in t.attributes)if(t.attributes.hasOwnProperty(r)&&e(t.attributes[r])&&e(t.attributes[r].values)){var i=t.attributes[r],a=i.values.length/i.componentsPerAttribute;n=a}return n},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(t,e,n){"use strict";function r(e){e=t(e,t.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=t(e.normalize,!1),this.values=e.values}return r}),define("Core/GeometryAttributes",["./defaultValue"],function(t){"use strict";function e(e){e=t(e,t.EMPTY_OBJECT),this.position=e.position,this.normal=e.normal,this.st=e.st,this.binormal=e.binormal,this.tangent=e.tangent,this.color=e.color}return e}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(t,e,n,r,i){"use strict";var a={UNSIGNED_BYTE:i.UNSIGNED_BYTE,UNSIGNED_SHORT:i.UNSIGNED_SHORT,UNSIGNED_INT:i.UNSIGNED_INT};return a.getSizeInBytes=function(t){switch(t){case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},a.validate=function(e){return t(e)&&(e===a.UNSIGNED_BYTE||e===a.UNSIGNED_SHORT||e===a.UNSIGNED_INT)},a.createTypedArray=function(t,e){return t>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(e):new Uint16Array(e)},a.createTypedArrayFromArrayBuffer=function(t,e,n,i){return t>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(e,n,i):new Uint16Array(e,n,i)},n(a)}),define("Core/EllipsoidOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType"],function(t,e,n,r,i,a,o,u,E,s,c,_,T){"use strict";function R(t){t=r(t,r.EMPTY_OBJECT);var n=r(t.radii,l),i=r(t.stackPartitions,10),a=r(t.slicePartitions,8),o=r(t.subdivisions,128);this._radii=e.clone(n),this._stackPartitions=i,this._slicePartitions=a,this._subdivisions=o,this._workerName="createEllipsoidOutlineGeometry"}var l=new e(1,1,1),A=Math.cos,f=Math.sin;R.packedLength=e.packedLength+3,R.pack=function(t,n,i){return i=r(i,0),e.pack(t._radii,n,i),i+=e.packedLength,n[i++]=t._stackPartitions,n[i++]=t._slicePartitions,n[i]=t._subdivisions,n};var N=new e,h={radii:N,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};return R.unpack=function(t,n,a){n=r(n,0);var o=e.unpack(t,n,N);n+=e.packedLength;var u=t[n++],E=t[n++],s=t[n++];return i(a)?(a._radii=e.clone(o,a._radii),a._stackPartitions=u,a._slicePartitions=E,a._subdivisions=s,a):(h.stackPartitions=u,h.slicePartitions=E,h.subdivisions=s,new R(h))},R.createGeometry=function(e){var r=e._radii;if(!(r.x<=0||r.y<=0||r.z<=0)){var i,a,R,l,N,h,d=o.fromCartesian3(r),I=e._stackPartitions,S=e._slicePartitions,M=e._subdivisions,O=M*(I+S-1),m=O-S+2,y=new Float64Array(3*m),p=c.createTypedArray(m,2*O),C=0,U=new Array(M),L=new Array(M);for(i=0;i<M;i++)R=_.TWO_PI*i/M,U[i]=A(R),L[i]=f(R);for(i=1;i<I;i++)for(l=Math.PI*i/I,N=A(l),h=f(l),a=0;a<M;a++)y[C++]=r.x*U[a]*h,y[C++]=r.y*L[a]*h,y[C++]=r.z*N;for(U.length=S,L.length=S,i=0;i<S;i++)R=_.TWO_PI*i/S,U[i]=A(R),L[i]=f(R);for(y[C++]=0,y[C++]=0,y[C++]=r.z,i=1;i<M;i++)for(l=Math.PI*i/M,N=A(l),h=f(l),a=0;a<S;a++)y[C++]=r.x*U[a]*h,y[C++]=r.y*L[a]*h,y[C++]=r.z*N;for(y[C++]=0,y[C++]=0,y[C++]=-r.z,C=0,i=0;i<I-1;++i){var F=i*M;for(a=0;a<M-1;++a)p[C++]=F+a,p[C++]=F+a+1;p[C++]=F+M-1,p[C++]=F}var P=M*(I-1);for(a=1;a<S+1;++a)p[C++]=P,p[C++]=P+a;for(i=0;i<M-2;++i){var v=i*S+1+P,D=(i+1)*S+1+P;for(a=0;a<S-1;++a)p[C++]=D+a,p[C++]=v+a;p[C++]=D+S-1,p[C++]=v+S-1}var g=y.length/3-1;for(a=g-1;a>g-S-1;--a)p[C++]=g,p[C++]=a;var w=new s({position:new E({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:y})});return new u({attributes:w,indices:p,primitiveType:T.LINES,boundingSphere:t.fromEllipsoid(d)})}},R}),define("Workers/createEllipsoidOutlineGeometry",["../Core/defined","../Core/EllipsoidOutlineGeometry"],function(t,e){"use strict";return function(n,r){return t(n.buffer,r)&&(n=e.unpack(n,r)),e.createGeometry(n)}})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function t(t){return void 0!==t&&null!==t}return t}),define("Core/DeveloperError",["./defined"],function(t){"use strict";function e(t){this.name="DeveloperError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e.throwInstantiationError=function(){throw new e("This function defines an interface and should not be called directly.")},e}),define("Core/Check",["./defined","./DeveloperError"],function(t,e){"use strict";function n(t){return t+" is required, actual value was undefined"}function r(t,e,n){return"Expected "+n+" to be typeof "+e+", actual typeof was "+t}var i={};return i.typeOf={},i.defined=function(r,i){if(!t(i))throw new e(n(r))},i.typeOf.func=function(t,n){if("function"!=typeof n)throw new e(r(typeof n,"function",t))},i.typeOf.string=function(t,n){if("string"!=typeof n)throw new e(r(typeof n,"string",t))},i.typeOf.number=function(t,n){if("number"!=typeof n)throw new e(r(typeof n,"number",t))},i.typeOf.number.lessThan=function(t,n,r){if(i.typeOf.number(t,n),n>=r)throw new e("Expected "+t+" to be less than "+r+", actual value was "+n)},i.typeOf.number.lessThanOrEquals=function(t,n,r){if(i.typeOf.number(t,n),n>r)throw new e("Expected "+t+" to be less than or equal to "+r+", actual value was "+n)},i.typeOf.number.greaterThan=function(t,n,r){if(i.typeOf.number(t,n),n<=r)throw new e("Expected "+t+" to be greater than "+r+", actual value was "+n)},i.typeOf.number.greaterThanOrEquals=function(t,n,r){if(i.typeOf.number(t,n),n<r)throw new e("Expected "+t+" to be greater than or equal to"+r+", actual value was "+n)},i.typeOf.object=function(t,n){if("object"!=typeof n)throw new e(r(typeof n,"object",t))},i.typeOf.bool=function(t,n){if("boolean"!=typeof n)throw new e(r(typeof n,"boolean",t))},i}),define("Core/freezeObject",["./defined"],function(t){"use strict";var e=Object.freeze;return t(e)||(e=function(t){return t}),e}),define("Core/defaultValue",["./freezeObject"],function(t){"use strict";function e(t,e){return void 0!==t?t:e}return e.EMPTY_OBJECT=t({}),e}),define("ThirdParty/mersenne-twister",[],function(){var t=function(t){void 0==t&&(t=(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(t)};return t.prototype.init_genrand=function(t){for(this.mt[0]=t>>>0,this.mti=1;this.mti<this.N;this.mti++){var t=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&t)>>>16)<<16)+1812433253*(65535&t)+this.mti,this.mt[this.mti]>>>=0}},t.prototype.genrand_int32=function(){var t,e=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)t=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^t>>>1^e[1&t];for(;n<this.N-1;n++)t=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^t>>>1^e[1&t];t=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^t>>>1^e[1&t],this.mti=0}return t=this.mt[this.mti++],t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,t^=t>>>18,t>>>0},t.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},t}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(t,e,n,r){"use strict";var i={};i.EPSILON1=.1,i.EPSILON2=.01,i.EPSILON3=.001,i.EPSILON4=1e-4,i.EPSILON5=1e-5,i.EPSILON6=1e-6,i.EPSILON7=1e-7,i.EPSILON8=1e-8,i.EPSILON9=1e-9,i.EPSILON10=1e-10,i.EPSILON11=1e-11,i.EPSILON12=1e-12,i.EPSILON13=1e-13,i.EPSILON14=1e-14,i.EPSILON15=1e-15,i.EPSILON16=1e-16,i.EPSILON17=1e-17,i.EPSILON18=1e-18,i.EPSILON19=1e-19,i.EPSILON20=1e-20,i.GRAVITATIONALPARAMETER=3986004418e5,i.SOLAR_RADIUS=6955e5,i.LUNAR_RADIUS=1737400,i.SIXTY_FOUR_KILOBYTES=65536,i.sign=function(t){return t>0?1:t<0?-1:0},i.signNotZero=function(t){return t<0?-1:1},i.toSNorm=function(t,n){return n=e(n,255),Math.round((.5*i.clamp(t,-1,1)+.5)*n)},i.fromSNorm=function(t,n){return n=e(n,255),i.clamp(t,0,n)/n*2-1},i.sinh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e-n)},i.cosh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e+n)},i.lerp=function(t,e,n){return(1-n)*t+n*e},i.PI=Math.PI,i.ONE_OVER_PI=1/Math.PI,i.PI_OVER_TWO=.5*Math.PI,i.PI_OVER_THREE=Math.PI/3,i.PI_OVER_FOUR=Math.PI/4,i.PI_OVER_SIX=Math.PI/6,i.THREE_PI_OVER_TWO=3*Math.PI*.5,i.TWO_PI=2*Math.PI,i.ONE_OVER_TWO_PI=1/(2*Math.PI),i.RADIANS_PER_DEGREE=Math.PI/180,i.DEGREES_PER_RADIAN=180/Math.PI,i.RADIANS_PER_ARCSECOND=i.RADIANS_PER_DEGREE/3600,i.toRadians=function(t){return t*i.RADIANS_PER_DEGREE},i.toDegrees=function(t){return t*i.DEGREES_PER_RADIAN},i.convertLongitudeRange=function(t){var e=i.TWO_PI,n=t-Math.floor(t/e)*e;return n<-Math.PI?n+e:n>=Math.PI?n-e:n},i.clampToLatitudeRange=function(t){return i.clamp(t,-1*i.PI_OVER_TWO,i.PI_OVER_TWO)},i.negativePiToPi=function(t){return i.zeroToTwoPi(t+i.PI)-i.PI},i.zeroToTwoPi=function(t){var e=i.mod(t,i.TWO_PI);return Math.abs(e)<i.EPSILON14&&Math.abs(t)>i.EPSILON14?i.TWO_PI:e},i.mod=function(t,e){return(t%e+e)%e},i.equalsEpsilon=function(t,n,r,i){i=e(i,r);var a=Math.abs(t-n);return a<=i||a<=r*Math.max(Math.abs(t),Math.abs(n))};var a=[1];i.factorial=function(t){var e=a.length;if(t>=e)for(var n=a[e-1],r=e;r<=t;r++)a.push(n*r);return a[t]},i.incrementWrap=function(t,n,r){return r=e(r,0),++t,t>n&&(t=r),t},i.isPowerOfTwo=function(t){return 0!==t&&0===(t&t-1)},i.nextPowerOfTwo=function(t){return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t,t},i.clamp=function(t,e,n){return t<e?e:t>n?n:t};var o=new t;return i.setRandomNumberSeed=function(e){o=new t(e)},i.nextRandomNumber=function(){return o.random()},i.acosClamped=function(t){return Math.acos(i.clamp(t,-1,1))},i.asinClamped=function(t){return Math.asin(i.clamp(t,-1,1))},i.chordLength=function(t,e){return 2*e*Math.sin(.5*t)},i.logBase=function(t,e){return Math.log(t)/Math.log(e)},i.fog=function(t,e){var n=t*e;return 1-Math.exp(-(n*n))},i}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a){"use strict";function o(t,n,r){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0)}o.fromSpherical=function(t,r){n(r)||(r=new o);var i=t.clock,a=t.cone,u=e(t.magnitude,1),E=u*Math.sin(a);return r.x=E*Math.cos(i),r.y=E*Math.sin(i),r.z=u*Math.cos(a),r},o.fromElements=function(t,e,r,i){return n(i)?(i.x=t,i.y=e,i.z=r,i):new o(t,e,r)},o.clone=function(t,e){if(n(t))return n(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e):new o(t.x,t.y,t.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r]=t.z,n},o.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new o),i.x=t[r++],i.y=t[r++],i.z=t[r],i},o.packArray=function(t,e){var r=t.length;n(e)?e.length=3*r:e=new Array(3*r);for(var i=0;i<r;++i)o.pack(t[i],e,3*i);return e},o.unpackArray=function(t,e){var r=t.length;n(e)?e.length=r/3:e=new Array(r/3);for(var i=0;i<r;i+=3){var a=i/3;e[a]=o.unpack(t,i,e[a])}return e},o.fromArray=o.unpack,o.maximumComponent=function(t){return Math.max(t.x,t.y,t.z)},o.minimumComponent=function(t){return Math.min(t.x,t.y,t.z)},o.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n.z=Math.min(t.z,e.z),n},o.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n.z=Math.max(t.z,e.z),n},o.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z},o.magnitude=function(t){return Math.sqrt(o.magnitudeSquared(t))};var u=new o;o.distance=function(t,e){return o.subtract(t,e,u),o.magnitude(u)},o.distanceSquared=function(t,e){return o.subtract(t,e,u),o.magnitudeSquared(u)},o.normalize=function(t,e){var n=o.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e},o.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},o.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n.z=t.z*e.z,n},o.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n.z=t.z/e.z,n},o.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n},o.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n},o.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*e,n},o.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n},o.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e},o.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e};var E=new o;o.lerp=function(t,e,n,r){return o.multiplyByScalar(e,n,E),r=o.multiplyByScalar(t,1-n,r),o.add(E,r,r)};var s=new o,c=new o;o.angleBetween=function(t,e){o.normalize(t,s),o.normalize(e,c);var n=o.dot(s,c),r=o.magnitude(o.cross(s,c,s));return Math.atan2(r,n)};var _=new o;o.mostOrthogonalAxis=function(t,e){var n=o.normalize(t,_);return o.abs(n,n),e=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,e):o.clone(o.UNIT_Z,e):n.y<=n.z?o.clone(o.UNIT_Y,e):o.clone(o.UNIT_Z,e)},o.equals=function(t,e){return t===e||n(t)&&n(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z},o.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]},o.equalsEpsilon=function(t,e,r,i){return t===e||n(t)&&n(e)&&a.equalsEpsilon(t.x,e.x,r,i)&&a.equalsEpsilon(t.y,e.y,r,i)&&a.equalsEpsilon(t.z,e.z,r,i)},o.cross=function(t,e,n){var r=t.x,i=t.y,a=t.z,o=e.x,u=e.y,E=e.z,s=i*E-a*u,c=a*o-r*E,_=r*u-i*o;return n.x=s,n.y=c,n.z=_,n},o.fromDegrees=function(t,e,n,r,i){return t=a.toRadians(t),e=a.toRadians(e),o.fromRadians(t,e,n,r,i)};var T=new o,R=new o,l=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(t,r,i,a,u){i=e(i,0);var E=n(a)?a.radiiSquared:l,s=Math.cos(r);T.x=s*Math.cos(t),T.y=s*Math.sin(t),T.z=Math.sin(r),T=o.normalize(T,T),o.multiplyComponents(E,T,R);var c=Math.sqrt(o.dot(T,R));return R=o.divideByScalar(R,c,R),T=o.multiplyByScalar(T,i,T),n(u)||(u=new o),o.add(R,T,u)},o.fromDegreesArray=function(t,e,r){var i=t.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=t[a],E=t[a+1],s=a/2;r[s]=o.fromDegrees(u,E,0,e,r[s])}return r},o.fromRadiansArray=function(t,e,r){var i=t.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=t[a],E=t[a+1],s=a/2;r[s]=o.fromRadians(u,E,0,e,r[s])}return r},o.fromDegreesArrayHeights=function(t,e,r){var i=t.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=t[a],E=t[a+1],s=t[a+2],c=a/3;r[c]=o.fromDegrees(u,E,s,e,r[c])}return r},o.fromRadiansArrayHeights=function(t,e,r){var i=t.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=t[a],E=t[a+1],s=t[a+2],c=a/3;r[c]=o.fromRadians(u,E,s,e,r[c])}return r},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(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.prototype.equalsEpsilon=function(t,e,n){return o.equalsEpsilon(this,t,e,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(t,e,n,r){"use strict";function i(n,i,u,E,s){var c=n.x,_=n.y,T=n.z,R=i.x,l=i.y,A=i.z,f=c*c*R*R,h=_*_*l*l,N=T*T*A*A,d=f+h+N,I=Math.sqrt(1/d),S=t.multiplyByScalar(n,I,a);if(d<E)return isFinite(I)?t.clone(S,s):void 0;var M=u.x,O=u.y,m=u.z,y=o;y.x=S.x*M*2,y.y=S.y*O*2,y.z=S.z*m*2;var p,C,U,L,F,P,v,w,D,g,B,x=(1-I)*t.magnitude(n)/(.5*t.magnitude(y)),z=0;do{x-=z,U=1/(1+x*M),L=1/(1+x*O),F=1/(1+x*m),P=U*U,v=L*L,w=F*F,D=P*U,g=v*L,B=w*F,p=f*P+h*v+N*w-1,C=f*D*M+h*g*O+N*B*m;var G=-2*C;z=p/G}while(Math.abs(p)>r.EPSILON12);return e(s)?(s.x=c*U,s.y=_*L,s.z=T*F,s):new t(c*U,_*L,T*F)}var a=new t,o=new t;return i}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,n,r,i,a,o){"use strict";function u(t,n,r){this.longitude=e(t,0),this.latitude=e(n,0),this.height=e(r,0)}u.fromRadians=function(t,r,i,a){return i=e(i,0),n(a)?(a.longitude=t,a.latitude=r,a.height=i,a):new u(t,r,i)},u.fromDegrees=function(t,e,n,r){return t=a.toRadians(t),e=a.toRadians(e),u.fromRadians(t,e,n,r)};var E=new t,s=new t,c=new t,_=new t(1/6378137,1/6378137,1/6356752.314245179),T=new t(1/40680631590769,1/40680631590769,1/40408299984661.445),R=a.EPSILON1;return u.fromCartesian=function(e,r,i){var l=n(r)?r.oneOverRadii:_,A=n(r)?r.oneOverRadiiSquared:T,f=n(r)?r._centerToleranceSquared:R,h=o(e,l,A,f,s);if(n(h)){var N=t.multiplyComponents(h,A,E);N=t.normalize(N,N);var d=t.subtract(e,h,c),I=Math.atan2(N.y,N.x),S=Math.asin(N.z),M=a.sign(t.dot(d,e))*t.magnitude(d);return n(i)?(i.longitude=I,i.latitude=S,i.height=M,i):new u(I,S,M)}},u.clone=function(t,e){if(n(t))return n(e)?(e.longitude=t.longitude,e.latitude=t.latitude,e.height=t.height,e):new u(t.longitude,t.latitude,t.height)},u.equals=function(t,e){return t===e||n(t)&&n(e)&&t.longitude===e.longitude&&t.latitude===e.latitude&&t.height===e.height},u.equalsEpsilon=function(t,e,r){return t===e||n(t)&&n(e)&&Math.abs(t.longitude-e.longitude)<=r&&Math.abs(t.latitude-e.latitude)<=r&&Math.abs(t.height-e.height)<=r},u.ZERO=i(new u(0,0,0)),u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.prototype.equalsEpsilon=function(t,e){return u.equalsEpsilon(this,t,e)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(t){"use strict";var e=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(t){return!1}}(),n=Object.defineProperties;return e&&t(n)||(n=function(t){return t}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,n,r,i,a,o,u,E){"use strict";function s(e,r,i,a){r=n(r,0),i=n(i,0),a=n(a,0),e._radii=new t(r,i,a),e._radiiSquared=new t(r*r,i*i,a*a),e._radiiToTheFourth=new t(r*r*r*r,i*i*i*i,a*a*a*a),e._oneOverRadii=new t(0===r?0:1/r,0===i?0:1/i,0===a?0:1/a),e._oneOverRadiiSquared=new t(0===r?0:1/(r*r),0===i?0:1/(i*i),0===a?0:1/(a*a)),e._minimumRadius=Math.min(r,i,a),e._maximumRadius=Math.max(r,i,a),e._centerToleranceSquared=u.EPSILON1,0!==e._radiiSquared.z&&(e._sqauredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function c(t,e,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,s(this,t,e,n)}i(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(e,n){if(r(e)){var i=e._radii;return r(n)?(t.clone(i,n._radii),t.clone(e._radiiSquared,n._radiiSquared),t.clone(e._radiiToTheFourth,n._radiiToTheFourth),t.clone(e._oneOverRadii,n._oneOverRadii),t.clone(e._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=e._minimumRadius,n._maximumRadius=e._maximumRadius,n._centerToleranceSquared=e._centerToleranceSquared,n):new c(i.x,i.y,i.z)}},c.fromCartesian3=function(t,e){return r(e)||(e=new c),r(t)?(s(e,t.x,t.y,t.z),e):e},c.WGS84=o(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=o(new c(1,1,1)),c.MOON=o(new c(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),c.prototype.clone=function(t){return c.clone(this,t)},c.packedLength=t.packedLength,c.pack=function(e,r,i){return i=n(i,0),t.pack(e._radii,r,i),r},c.unpack=function(e,r,i){r=n(r,0);var a=t.unpack(e,r);return c.fromCartesian3(a,i)},c.prototype.geocentricSurfaceNormal=t.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(e,n){var i=e.longitude,a=e.latitude,o=Math.cos(a),u=o*Math.cos(i),E=o*Math.sin(i),s=Math.sin(a);return r(n)||(n=new t),n.x=u,n.y=E,n.z=s,t.normalize(n,n)},c.prototype.geodeticSurfaceNormal=function(e,n){return r(n)||(n=new t),n=t.multiplyComponents(e,this._oneOverRadiiSquared,n),t.normalize(n,n)};var _=new t,T=new t;c.prototype.cartographicToCartesian=function(e,n){var i=_,a=T;this.geodeticSurfaceNormalCartographic(e,i),t.multiplyComponents(this._radiiSquared,i,a);var o=Math.sqrt(t.dot(i,a));return t.divideByScalar(a,o,a),t.multiplyByScalar(i,e.height,i),r(n)||(n=new t),t.add(a,i,n)},c.prototype.cartographicArrayToCartesianArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var i=0;i<n;i++)e[i]=this.cartographicToCartesian(t[i],e[i]);return e};var R=new t,l=new t,A=new t;return c.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,l);if(r(a)){var o=this.geodeticSurfaceNormal(a,R),E=t.subtract(n,a,A),s=Math.atan2(o.y,o.x),c=Math.asin(o.z),_=u.sign(t.dot(E,n))*t.magnitude(E);return r(i)?(i.longitude=s,i.latitude=c,i.height=_,i):new e(s,c,_)}},c.prototype.cartesianArrayToCartographicArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var i=0;i<n;++i)e[i]=this.cartesianToCartographic(t[i],e[i]);return e},c.prototype.scaleToGeodeticSurface=function(t,e){return E(t,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,e)},c.prototype.scaleToGeocentricSurface=function(e,n){r(n)||(n=new t);var i=e.x,a=e.y,o=e.z,u=this._oneOverRadiiSquared,E=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*u.z);return t.multiplyByScalar(e,E,n)},c.prototype.transformPositionToScaledSpace=function(e,n){return r(n)||(n=new t),t.multiplyComponents(e,this._oneOverRadii,n)},c.prototype.transformPositionFromScaledSpace=function(e,n){return r(n)||(n=new t),t.multiplyComponents(e,this._radii,n)},c.prototype.equals=function(e){return this===e||r(e)&&t.equals(this._radii,e._radii)},c.prototype.toString=function(){return this._radii.toString()},c.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,i,a){i=n(i,0);var o=this._sqauredXOverSquaredZ;if(r(a)||(a=new t),a.x=0,a.y=0,a.z=e.z*(1-o),!(Math.abs(a.z)>=this._radii.z-i))return a},c}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(t,e,n,r,i,a,o){"use strict";function u(t){this._ellipsoid=n(t,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return i(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(e,n){var i=this._semimajorAxis,a=e.longitude*i,o=e.latitude*i,u=e.height;return r(n)?(n.x=a,n.y=o,n.z=u,n):new t(a,o,u)},u.prototype.unproject=function(t,n){var i=this._oneOverSemimajorAxis,a=t.x*i,o=t.y*i,u=t.z;return r(n)?(n.longitude=a,n.latitude=o,n.height=u,n):new e(a,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(t){"use strict";var e={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return t(e)}),define("Core/Interval",["./defaultValue"],function(t){"use strict";function e(e,n){this.start=t(e,0),this.stop=t(n,0)}return e}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a,o,u){"use strict";function E(t,e,r,i,a,o,u,E,s){this[0]=n(t,0),this[1]=n(i,0),this[2]=n(u,0),this[3]=n(e,0),this[4]=n(a,0),this[5]=n(E,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(s,0)}function s(t){for(var e=0,n=0;n<9;++n){var r=t[n];e+=r*r}return Math.sqrt(e)}function c(t){for(var e=0,n=0;n<3;++n){var r=t[E.getElementIndex(A[n],l[n])];e+=2*r*r}return Math.sqrt(e)}function _(t,e){for(var n=u.EPSILON15,r=0,i=1,a=0;a<3;++a){var o=Math.abs(t[E.getElementIndex(A[a],l[a])]);o>r&&(i=a,r=o)}var s=1,c=0,_=l[i],T=A[i];if(Math.abs(t[E.getElementIndex(T,_)])>n){var R,f=t[E.getElementIndex(T,T)],h=t[E.getElementIndex(_,_)],N=t[E.getElementIndex(T,_)],d=(f-h)/2/N;R=d<0?-1/(-d+Math.sqrt(1+d*d)):1/(d+Math.sqrt(1+d*d)),s=1/Math.sqrt(1+R*R),c=R*s}return e=E.clone(E.IDENTITY,e),e[E.getElementIndex(_,_)]=e[E.getElementIndex(T,T)]=s,e[E.getElementIndex(T,_)]=c,e[E.getElementIndex(_,T)]=-c,e}E.packedLength=9,E.pack=function(t,e,r){return r=n(r,0),e[r++]=t[0],e[r++]=t[1],e[r++]=t[2],e[r++]=t[3],e[r++]=t[4],e[r++]=t[5],e[r++]=t[6],e[r++]=t[7],e[r++]=t[8],e},E.unpack=function(t,e,i){return e=n(e,0),r(i)||(i=new E),i[0]=t[e++],i[1]=t[e++],i[2]=t[e++],i[3]=t[e++],i[4]=t[e++],i[5]=t[e++],i[6]=t[e++],i[7]=t[e++],i[8]=t[e++],i},E.clone=function(t,e){if(r(t))return r(e)?(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):new E(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8])},E.fromArray=function(t,e,i){return e=n(e,0),r(i)||(i=new E),i[0]=t[e],i[1]=t[e+1],i[2]=t[e+2],i[3]=t[e+3],i[4]=t[e+4],i[5]=t[e+5],i[6]=t[e+6],i[7]=t[e+7],i[8]=t[e+8],i},E.fromColumnMajorArray=function(t,e){return E.clone(t,e)},E.fromRowMajorArray=function(t,e){return r(e)?(e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],e):new E(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},E.fromQuaternion=function(t,e){var n=t.x*t.x,i=t.x*t.y,a=t.x*t.z,o=t.x*t.w,u=t.y*t.y,s=t.y*t.z,c=t.y*t.w,_=t.z*t.z,T=t.z*t.w,R=t.w*t.w,l=n-u-_+R,A=2*(i-T),f=2*(a+c),h=2*(i+T),N=-n+u-_+R,d=2*(s-o),I=2*(a-c),S=2*(s+o),M=-n-u+_+R;return r(e)?(e[0]=l,e[1]=h,e[2]=I,e[3]=A,e[4]=N,e[5]=S,e[6]=f,e[7]=d,e[8]=M,e):new E(l,A,f,h,N,d,I,S,M)},E.fromHeadingPitchRoll=function(t,e){var n=Math.cos(-t.pitch),i=Math.cos(-t.heading),a=Math.cos(t.roll),o=Math.sin(-t.pitch),u=Math.sin(-t.heading),s=Math.sin(t.roll),c=n*i,_=-a*u+s*o*i,T=s*u+a*o*i,R=n*u,l=a*i+s*o*u,A=-o*a+a*o*u,f=-o,h=s*n,N=a*n;return r(e)?(e[0]=c,e[1]=R,e[2]=f,e[3]=_,e[4]=l,e[5]=h,e[6]=T,e[7]=A,e[8]=N,e):new E(c,_,T,R,l,A,f,h,N)},E.fromScale=function(t,e){return r(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=t.y,e[5]=0,e[6]=0,e[7]=0,e[8]=t.z,e):new E(t.x,0,0,0,t.y,0,0,0,t.z)},E.fromUniformScale=function(t,e){return r(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=t,e[5]=0,e[6]=0,e[7]=0,e[8]=t,e):new E(t,0,0,0,t,0,0,0,t)},E.fromCrossProduct=function(t,e){return r(e)?(e[0]=0,e[1]=t.z,e[2]=-t.y,e[3]=-t.z,e[4]=0,e[5]=t.x,e[6]=t.y,e[7]=-t.x,e[8]=0,e):new E(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},E.fromRotationX=function(t,e){var n=Math.cos(t),i=Math.sin(t);return r(e)?(e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=n,e[5]=i,e[6]=0,e[7]=-i,e[8]=n,e):new E(1,0,0,0,n,-i,0,i,n)},E.fromRotationY=function(t,e){var n=Math.cos(t),i=Math.sin(t);return r(e)?(e[0]=n,e[1]=0,e[2]=-i,e[3]=0,e[4]=1,e[5]=0,e[6]=i,e[7]=0,e[8]=n,e):new E(n,0,i,0,1,0,-i,0,n)},E.fromRotationZ=function(t,e){var n=Math.cos(t),i=Math.sin(t);return r(e)?(e[0]=n,e[1]=i,e[2]=0,e[3]=-i,e[4]=n,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e):new E(n,-i,0,i,n,0,0,0,1)},E.toArray=function(t,e){return r(e)?(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):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},E.getElementIndex=function(t,e){return 3*t+e},E.getColumn=function(t,e,n){var r=3*e,i=t[r],a=t[r+1],o=t[r+2];return n.x=i,n.y=a,n.z=o,n},E.setColumn=function(t,e,n,r){r=E.clone(t,r);var i=3*e;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},E.getRow=function(t,e,n){var r=t[e],i=t[e+3],a=t[e+6];return n.x=r,n.y=i,n.z=a,n},E.setRow=function(t,e,n,r){return r=E.clone(t,r),r[e]=n.x,r[e+3]=n.y,r[e+6]=n.z,r};var T=new t;E.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],T)),n.y=t.magnitude(t.fromElements(e[3],e[4],e[5],T)),n.z=t.magnitude(t.fromElements(e[6],e[7],e[8],T)),n};var R=new t;E.getMaximumScale=function(e){return E.getScale(e,R),t.maximumComponent(R)},E.multiply=function(t,e,n){var r=t[0]*e[0]+t[3]*e[1]+t[6]*e[2],i=t[1]*e[0]+t[4]*e[1]+t[7]*e[2],a=t[2]*e[0]+t[5]*e[1]+t[8]*e[2],o=t[0]*e[3]+t[3]*e[4]+t[6]*e[5],u=t[1]*e[3]+t[4]*e[4]+t[7]*e[5],E=t[2]*e[3]+t[5]*e[4]+t[8]*e[5],s=t[0]*e[6]+t[3]*e[7]+t[6]*e[8],c=t[1]*e[6]+t[4]*e[7]+t[7]*e[8],_=t[2]*e[6]+t[5]*e[7]+t[8]*e[8];return n[0]=r,n[1]=i,n[2]=a,n[3]=o,n[4]=u,n[5]=E,n[6]=s,n[7]=c,n[8]=_,n},E.add=function(t,e,n){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n[4]=t[4]+e[4],n[5]=t[5]+e[5],n[6]=t[6]+e[6],n[7]=t[7]+e[7],n[8]=t[8]+e[8],n},E.subtract=function(t,e,n){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n[4]=t[4]-e[4],n[5]=t[5]-e[5],n[6]=t[6]-e[6],n[7]=t[7]-e[7],n[8]=t[8]-e[8],n},E.multiplyByVector=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=t[0]*r+t[3]*i+t[6]*a,u=t[1]*r+t[4]*i+t[7]*a,E=t[2]*r+t[5]*i+t[8]*a;return n.x=o,n.y=u,n.z=E,n},E.multiplyByScalar=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n[4]=t[4]*e,n[5]=t[5]*e,n[6]=t[6]*e,n[7]=t[7]*e,n[8]=t[8]*e,n},E.multiplyByScale=function(t,e,n){return n[0]=t[0]*e.x,n[1]=t[1]*e.x,n[2]=t[2]*e.x,n[3]=t[3]*e.y,n[4]=t[4]*e.y,n[5]=t[5]*e.y,n[6]=t[6]*e.z,n[7]=t[7]*e.z,n[8]=t[8]*e.z,n},E.negate=function(t,e){return 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},E.transpose=function(t,e){var n=t[0],r=t[3],i=t[6],a=t[1],o=t[4],u=t[7],E=t[2],s=t[5],c=t[8];return e[0]=n,e[1]=r,e[2]=i,e[3]=a,e[4]=o,e[5]=u,e[6]=E,e[7]=s,e[8]=c,e};var l=[1,0,0],A=[2,2,1],f=new E,h=new E;return E.computeEigenDecomposition=function(t,e){var n=u.EPSILON20,i=10,a=0,o=0;r(e)||(e={});for(var T=e.unitary=E.clone(E.IDENTITY,e.unitary),R=e.diagonal=E.clone(t,e.diagonal),l=n*s(R);o<i&&c(R)>l;)_(R,f),E.transpose(f,h),E.multiply(R,f,R),E.multiply(h,R,R),E.multiply(T,f,T),++a>2&&(++o,a=0);return e},E.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e},E.determinant=function(t){var e=t[0],n=t[3],r=t[6],i=t[1],a=t[4],o=t[7],u=t[2],E=t[5],s=t[8];return e*(a*s-E*o)+i*(E*r-n*s)+u*(n*o-a*r)},E.inverse=function(t,e){var n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],u=t[5],s=t[6],c=t[7],_=t[8],T=E.determinant(t);e[0]=o*_-c*u,e[1]=c*i-r*_,e[2]=r*u-o*i,e[3]=s*u-a*_,e[4]=n*_-s*i,e[5]=a*i-n*u,e[6]=a*c-s*o,e[7]=s*r-n*c,e[8]=n*o-a*r;var R=1/T;return E.multiplyByScalar(e,R,e)},E.equals=function(t,e){return t===e||r(t)&&r(e)&&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]},E.equalsEpsilon=function(t,e,n){return t===e||r(t)&&r(e)&&Math.abs(t[0]-e[0])<=n&&Math.abs(t[1]-e[1])<=n&&Math.abs(t[2]-e[2])<=n&&Math.abs(t[3]-e[3])<=n&&Math.abs(t[4]-e[4])<=n&&Math.abs(t[5]-e[5])<=n&&Math.abs(t[6]-e[6])<=n&&Math.abs(t[7]-e[7])<=n&&Math.abs(t[8]-e[8])<=n},E.IDENTITY=o(new E(1,0,0,0,1,0,0,0,1)),E.ZERO=o(new E(0,0,0,0,0,0,0,0,0)),E.COLUMN0ROW0=0,E.COLUMN0ROW1=1,E.COLUMN0ROW2=2,E.COLUMN1ROW0=3,E.COLUMN1ROW1=4,E.COLUMN1ROW2=5,E.COLUMN2ROW0=6,E.COLUMN2ROW1=7,E.COLUMN2ROW2=8,i(E.prototype,{length:{get:function(){return E.packedLength}}}),E.prototype.clone=function(t){return E.clone(this,t)},E.prototype.equals=function(t){return E.equals(this,t)},E.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]&&t[4]===e[n+4]&&t[5]===e[n+5]&&t[6]===e[n+6]&&t[7]===e[n+7]&&t[8]===e[n+8]},E.prototype.equalsEpsilon=function(t,e){return E.equalsEpsilon(this,t,e)},E.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},E}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a){"use strict";function o(t,n,r,i){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0),this.w=e(i,0)}o.fromElements=function(t,e,r,i,a){return n(a)?(a.x=t,a.y=e,a.z=r,a.w=i,a):new o(t,e,r,i)},o.fromColor=function(t,e){return n(e)?(e.x=t.red,e.y=t.green,e.z=t.blue,e.w=t.alpha,e):new o(t.red,t.green,t.blue,t.alpha)},o.clone=function(t,e){if(n(t))return n(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e):new o(t.x,t.y,t.z,t.w)},o.packedLength=4,o.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w,n},o.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new o),i.x=t[r++],i.y=t[r++],i.z=t[r++],i.w=t[r],i},o.packArray=function(t,e){var r=t.length;n(e)?e.length=4*r:e=new Array(4*r);for(var i=0;i<r;++i)o.pack(t[i],e,4*i);return e},o.unpackArray=function(t,e){var r=t.length;n(e)?e.length=r/4:e=new Array(r/4);for(var i=0;i<r;i+=4){var a=i/4;e[a]=o.unpack(t,i,e[a])}return e},o.fromArray=o.unpack,o.maximumComponent=function(t){return Math.max(t.x,t.y,t.z,t.w)},o.minimumComponent=function(t){return Math.min(t.x,t.y,t.z,t.w)},o.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n.z=Math.min(t.z,e.z),n.w=Math.min(t.w,e.w),n},o.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n.z=Math.max(t.z,e.z),n.w=Math.max(t.w,e.w),n},o.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w},o.magnitude=function(t){return Math.sqrt(o.magnitudeSquared(t))};var u=new o;o.distance=function(t,e){return o.subtract(t,e,u),o.magnitude(u)},o.distanceSquared=function(t,e){return o.subtract(t,e,u),o.magnitudeSquared(u)},o.normalize=function(t,e){var n=o.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e.w=t.w/n,e},o.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z+t.w*e.w},o.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n.z=t.z*e.z,n.w=t.w*e.w,n},o.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n.z=t.z/e.z,n.w=t.w/e.w,n},o.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n.w=t.w+e.w,n},o.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n.w=t.w-e.w,n},o.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*e,n.w=t.w*e,n},o.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n.w=t.w/e,n},o.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e.w=-t.w,e},o.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e.w=Math.abs(t.w),e};var E=new o;o.lerp=function(t,e,n,r){return o.multiplyByScalar(e,n,E),r=o.multiplyByScalar(t,1-n,r),o.add(E,r,r)};var s=new o;return o.mostOrthogonalAxis=function(t,e){var n=o.normalize(t,s);return o.abs(n,n),e=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,e):o.clone(o.UNIT_W,e):n.z<=n.w?o.clone(o.UNIT_Z,e):o.clone(o.UNIT_W,e):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,e):o.clone(o.UNIT_W,e):n.z<=n.w?o.clone(o.UNIT_Z,e):o.clone(o.UNIT_W,e)},o.equals=function(t,e){return t===e||n(t)&&n(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z&&t.w===e.w},o.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]&&t.w===e[n+3]},o.equalsEpsilon=function(t,e,r,i){return t===e||n(t)&&n(e)&&a.equalsEpsilon(t.x,e.x,r,i)&&a.equalsEpsilon(t.y,e.y,r,i)&&a.equalsEpsilon(t.z,e.z,r,i)&&a.equalsEpsilon(t.w,e.w,r,i)},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(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.prototype.equalsEpsilon=function(t,e,n){return o.equalsEpsilon(this,t,e,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(t){"use strict";function e(t){this.name="RuntimeError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(t,e,n,r,i,a,o,u,E,s,c){ +"use strict";function _(t,e,n,i,a,o,u,E,s,c,_,T,R,l,A,f){this[0]=r(t,0),this[1]=r(a,0),this[2]=r(s,0),this[3]=r(R,0),this[4]=r(e,0),this[5]=r(o,0),this[6]=r(c,0),this[7]=r(l,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(_,0),this[11]=r(A,0),this[12]=r(i,0),this[13]=r(E,0),this[14]=r(T,0),this[15]=r(f,0)}_.packedLength=16,_.pack=function(t,e,n){return n=r(n,0),e[n++]=t[0],e[n++]=t[1],e[n++]=t[2],e[n++]=t[3],e[n++]=t[4],e[n++]=t[5],e[n++]=t[6],e[n++]=t[7],e[n++]=t[8],e[n++]=t[9],e[n++]=t[10],e[n++]=t[11],e[n++]=t[12],e[n++]=t[13],e[n++]=t[14],e[n]=t[15],e},_.unpack=function(t,e,n){return e=r(e,0),i(n)||(n=new _),n[0]=t[e++],n[1]=t[e++],n[2]=t[e++],n[3]=t[e++],n[4]=t[e++],n[5]=t[e++],n[6]=t[e++],n[7]=t[e++],n[8]=t[e++],n[9]=t[e++],n[10]=t[e++],n[11]=t[e++],n[12]=t[e++],n[13]=t[e++],n[14]=t[e++],n[15]=t[e],n},_.clone=function(t,e){if(i(t))return i(e)?(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],e):new _(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15])},_.fromArray=_.unpack,_.fromColumnMajorArray=function(t,e){return _.clone(t,e)},_.fromRowMajorArray=function(t,e){return i(e)?(e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15],e):new _(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},_.fromRotationTranslation=function(e,n,a){return n=r(n,t.ZERO),i(a)?(a[0]=e[0],a[1]=e[1],a[2]=e[2],a[3]=0,a[4]=e[3],a[5]=e[4],a[6]=e[5],a[7]=0,a[8]=e[6],a[9]=e[7],a[10]=e[8],a[11]=0,a[12]=n.x,a[13]=n.y,a[14]=n.z,a[15]=1,a):new _(e[0],e[3],e[6],n.x,e[1],e[4],e[7],n.y,e[2],e[5],e[8],n.z,0,0,0,1)},_.fromTranslationQuaternionRotationScale=function(t,e,n,r){i(r)||(r=new _);var a=n.x,o=n.y,u=n.z,E=e.x*e.x,s=e.x*e.y,c=e.x*e.z,T=e.x*e.w,R=e.y*e.y,l=e.y*e.z,A=e.y*e.w,f=e.z*e.z,h=e.z*e.w,N=e.w*e.w,d=E-R-f+N,I=2*(s-h),S=2*(c+A),M=2*(s+h),O=-E+R-f+N,m=2*(l-T),y=2*(c-A),p=2*(l+T),C=-E-R+f+N;return r[0]=d*a,r[1]=M*a,r[2]=y*a,r[3]=0,r[4]=I*o,r[5]=O*o,r[6]=p*o,r[7]=0,r[8]=S*u,r[9]=m*u,r[10]=C*u,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,r},_.fromTranslationRotationScale=function(t,e){return _.fromTranslationQuaternionRotationScale(t.translation,t.rotation,t.scale,e)},_.fromTranslation=function(t,e){return _.fromRotationTranslation(s.IDENTITY,t,e)},_.fromScale=function(t,e){return i(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t.y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t.z,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new _(t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1)},_.fromUniformScale=function(t,e){return i(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new _(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1)};var T=new t,R=new t,l=new t;_.fromCamera=function(e,n){var r=e.position,a=e.direction,o=e.up;t.normalize(a,T),t.normalize(t.cross(T,o,R),R),t.normalize(t.cross(R,T,l),l);var u=R.x,E=R.y,s=R.z,c=T.x,A=T.y,f=T.z,h=l.x,N=l.y,d=l.z,I=r.x,S=r.y,M=r.z,O=u*-I+E*-S+s*-M,m=h*-I+N*-S+d*-M,y=c*I+A*S+f*M;return i(n)?(n[0]=u,n[1]=h,n[2]=-c,n[3]=0,n[4]=E,n[5]=N,n[6]=-A,n[7]=0,n[8]=s,n[9]=d,n[10]=-f,n[11]=0,n[12]=O,n[13]=m,n[14]=y,n[15]=1,n):new _(u,E,s,O,h,N,d,m,-c,-A,-f,y,0,0,0,1)},_.computePerspectiveFieldOfView=function(t,e,n,r,i){var a=Math.tan(.5*t),o=1/a,u=o/e,E=(r+n)/(n-r),s=2*r*n/(n-r);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=o,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=E,i[11]=-1,i[12]=0,i[13]=0,i[14]=s,i[15]=0,i},_.computeOrthographicOffCenter=function(t,e,n,r,i,a,o){var u=1/(e-t),E=1/(r-n),s=1/(a-i),c=-(e+t)*u,_=-(r+n)*E,T=-(a+i)*s;return u*=2,E*=2,s*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=s,o[11]=0,o[12]=c,o[13]=_,o[14]=T,o[15]=1,o},_.computePerspectiveOffCenter=function(t,e,n,r,i,a,o){var u=2*i/(e-t),E=2*i/(r-n),s=(e+t)/(e-t),c=(r+n)/(r-n),_=-(a+i)/(a-i),T=-1,R=-2*a*i/(a-i);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=s,o[9]=c,o[10]=_,o[11]=T,o[12]=0,o[13]=0,o[14]=R,o[15]=0,o},_.computeInfinitePerspectiveOffCenter=function(t,e,n,r,i,a){var o=2*i/(e-t),u=2*i/(r-n),E=(e+t)/(e-t),s=(r+n)/(r-n),c=-1,_=-1,T=-2*i;return a[0]=o,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=E,a[9]=s,a[10]=c,a[11]=_,a[12]=0,a[13]=0,a[14]=T,a[15]=0,a},_.computeViewportTransformation=function(t,e,n,i){t=r(t,r.EMPTY_OBJECT);var a=r(t.x,0),o=r(t.y,0),u=r(t.width,0),E=r(t.height,0);e=r(e,0),n=r(n,1);var s=.5*u,c=.5*E,_=.5*(n-e),T=s,R=c,l=_,A=a+s,f=o+c,h=e+_,N=1;return i[0]=T,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=R,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=l,i[11]=0,i[12]=A,i[13]=f,i[14]=h,i[15]=N,i},_.computeView=function(e,n,r,i,a){return a[0]=i.x,a[1]=r.x,a[2]=-n.x,a[3]=0,a[4]=i.y,a[5]=r.y,a[6]=-n.y,a[7]=0,a[8]=i.z,a[9]=r.z,a[10]=-n.z,a[11]=0,a[12]=-t.dot(i,e),a[13]=-t.dot(r,e),a[14]=t.dot(n,e),a[15]=1,a},_.toArray=function(t,e){return i(e)?(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],e):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]},_.getElementIndex=function(t,e){return 4*t+e},_.getColumn=function(t,e,n){var r=4*e,i=t[r],a=t[r+1],o=t[r+2],u=t[r+3];return n.x=i,n.y=a,n.z=o,n.w=u,n},_.setColumn=function(t,e,n,r){r=_.clone(t,r);var i=4*e;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r[i+3]=n.w,r},_.setTranslation=function(t,e,n){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=t[15],n},_.getRow=function(t,e,n){var r=t[e],i=t[e+4],a=t[e+8],o=t[e+12];return n.x=r,n.y=i,n.z=a,n.w=o,n},_.setRow=function(t,e,n,r){return r=_.clone(t,r),r[e]=n.x,r[e+4]=n.y,r[e+8]=n.z,r[e+12]=n.w,r};var A=new t;_.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],A)),n.y=t.magnitude(t.fromElements(e[4],e[5],e[6],A)),n.z=t.magnitude(t.fromElements(e[8],e[9],e[10],A)),n};var f=new t;_.getMaximumScale=function(e){return _.getScale(e,f),t.maximumComponent(f)},_.multiply=function(t,e,n){var r=t[0],i=t[1],a=t[2],o=t[3],u=t[4],E=t[5],s=t[6],c=t[7],_=t[8],T=t[9],R=t[10],l=t[11],A=t[12],f=t[13],h=t[14],N=t[15],d=e[0],I=e[1],S=e[2],M=e[3],O=e[4],m=e[5],y=e[6],p=e[7],C=e[8],U=e[9],L=e[10],F=e[11],P=e[12],v=e[13],w=e[14],D=e[15],g=r*d+u*I+_*S+A*M,B=i*d+E*I+T*S+f*M,x=a*d+s*I+R*S+h*M,z=o*d+c*I+l*S+N*M,G=r*O+u*m+_*y+A*p,b=i*O+E*m+T*y+f*p,X=a*O+s*m+R*y+h*p,V=o*O+c*m+l*y+N*p,H=r*C+u*U+_*L+A*F,q=i*C+E*U+T*L+f*F,W=a*C+s*U+R*L+h*F,Y=o*C+c*U+l*L+N*F,k=r*P+u*v+_*w+A*D,K=i*P+E*v+T*w+f*D,Z=a*P+s*v+R*w+h*D,j=o*P+c*v+l*w+N*D;return n[0]=g,n[1]=B,n[2]=x,n[3]=z,n[4]=G,n[5]=b,n[6]=X,n[7]=V,n[8]=H,n[9]=q,n[10]=W,n[11]=Y,n[12]=k,n[13]=K,n[14]=Z,n[15]=j,n},_.add=function(t,e,n){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n[4]=t[4]+e[4],n[5]=t[5]+e[5],n[6]=t[6]+e[6],n[7]=t[7]+e[7],n[8]=t[8]+e[8],n[9]=t[9]+e[9],n[10]=t[10]+e[10],n[11]=t[11]+e[11],n[12]=t[12]+e[12],n[13]=t[13]+e[13],n[14]=t[14]+e[14],n[15]=t[15]+e[15],n},_.subtract=function(t,e,n){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n[4]=t[4]-e[4],n[5]=t[5]-e[5],n[6]=t[6]-e[6],n[7]=t[7]-e[7],n[8]=t[8]-e[8],n[9]=t[9]-e[9],n[10]=t[10]-e[10],n[11]=t[11]-e[11],n[12]=t[12]-e[12],n[13]=t[13]-e[13],n[14]=t[14]-e[14],n[15]=t[15]-e[15],n},_.multiplyTransformation=function(t,e,n){var r=t[0],i=t[1],a=t[2],o=t[4],u=t[5],E=t[6],s=t[8],c=t[9],_=t[10],T=t[12],R=t[13],l=t[14],A=e[0],f=e[1],h=e[2],N=e[4],d=e[5],I=e[6],S=e[8],M=e[9],O=e[10],m=e[12],y=e[13],p=e[14],C=r*A+o*f+s*h,U=i*A+u*f+c*h,L=a*A+E*f+_*h,F=r*N+o*d+s*I,P=i*N+u*d+c*I,v=a*N+E*d+_*I,w=r*S+o*M+s*O,D=i*S+u*M+c*O,g=a*S+E*M+_*O,B=r*m+o*y+s*p+T,x=i*m+u*y+c*p+R,z=a*m+E*y+_*p+l;return n[0]=C,n[1]=U,n[2]=L,n[3]=0,n[4]=F,n[5]=P,n[6]=v,n[7]=0,n[8]=w,n[9]=D,n[10]=g,n[11]=0,n[12]=B,n[13]=x,n[14]=z,n[15]=1,n},_.multiplyByMatrix3=function(t,e,n){var r=t[0],i=t[1],a=t[2],o=t[4],u=t[5],E=t[6],s=t[8],c=t[9],_=t[10],T=e[0],R=e[1],l=e[2],A=e[3],f=e[4],h=e[5],N=e[6],d=e[7],I=e[8],S=r*T+o*R+s*l,M=i*T+u*R+c*l,O=a*T+E*R+_*l,m=r*A+o*f+s*h,y=i*A+u*f+c*h,p=a*A+E*f+_*h,C=r*N+o*d+s*I,U=i*N+u*d+c*I,L=a*N+E*d+_*I;return n[0]=S,n[1]=M,n[2]=O,n[3]=0,n[4]=m,n[5]=y,n[6]=p,n[7]=0,n[8]=C,n[9]=U,n[10]=L,n[11]=0,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n},_.multiplyByTranslation=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=r*t[0]+i*t[4]+a*t[8]+t[12],u=r*t[1]+i*t[5]+a*t[9]+t[13],E=r*t[2]+i*t[6]+a*t[10]+t[14];return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=o,n[13]=u,n[14]=E,n[15]=t[15],n};var h=new t;_.multiplyByUniformScale=function(t,e,n){return h.x=e,h.y=e,h.z=e,_.multiplyByScale(t,h,n)},_.multiplyByScale=function(t,e,n){var r=e.x,i=e.y,a=e.z;return 1===r&&1===i&&1===a?_.clone(t,n):(n[0]=r*t[0],n[1]=r*t[1],n[2]=r*t[2],n[3]=0,n[4]=i*t[4],n[5]=i*t[5],n[6]=i*t[6],n[7]=0,n[8]=a*t[8],n[9]=a*t[9],n[10]=a*t[10],n[11]=0,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=1,n)},_.multiplyByVector=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=e.w,u=t[0]*r+t[4]*i+t[8]*a+t[12]*o,E=t[1]*r+t[5]*i+t[9]*a+t[13]*o,s=t[2]*r+t[6]*i+t[10]*a+t[14]*o,c=t[3]*r+t[7]*i+t[11]*a+t[15]*o;return n.x=u,n.y=E,n.z=s,n.w=c,n},_.multiplyByPointAsVector=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=t[0]*r+t[4]*i+t[8]*a,u=t[1]*r+t[5]*i+t[9]*a,E=t[2]*r+t[6]*i+t[10]*a;return n.x=o,n.y=u,n.z=E,n},_.multiplyByPoint=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=t[0]*r+t[4]*i+t[8]*a+t[12],u=t[1]*r+t[5]*i+t[9]*a+t[13],E=t[2]*r+t[6]*i+t[10]*a+t[14];return n.x=o,n.y=u,n.z=E,n},_.multiplyByScalar=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n[4]=t[4]*e,n[5]=t[5]*e,n[6]=t[6]*e,n[7]=t[7]*e,n[8]=t[8]*e,n[9]=t[9]*e,n[10]=t[10]*e,n[11]=t[11]*e,n[12]=t[12]*e,n[13]=t[13]*e,n[14]=t[14]*e,n[15]=t[15]*e,n},_.negate=function(t,e){return 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],e},_.transpose=function(t,e){var n=t[1],r=t[2],i=t[3],a=t[6],o=t[7],u=t[11];return e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=r,e[9]=a,e[10]=t[10],e[11]=t[14],e[12]=i,e[13]=o,e[14]=u,e[15]=t[15],e},_.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e[9]=Math.abs(t[9]),e[10]=Math.abs(t[10]),e[11]=Math.abs(t[11]),e[12]=Math.abs(t[12]),e[13]=Math.abs(t[13]),e[14]=Math.abs(t[14]),e[15]=Math.abs(t[15]),e},_.equals=function(t,e){return t===e||i(t)&&i(e)&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[3]===e[3]&&t[7]===e[7]&&t[11]===e[11]&&t[15]===e[15]},_.equalsEpsilon=function(t,e,n){return t===e||i(t)&&i(e)&&Math.abs(t[0]-e[0])<=n&&Math.abs(t[1]-e[1])<=n&&Math.abs(t[2]-e[2])<=n&&Math.abs(t[3]-e[3])<=n&&Math.abs(t[4]-e[4])<=n&&Math.abs(t[5]-e[5])<=n&&Math.abs(t[6]-e[6])<=n&&Math.abs(t[7]-e[7])<=n&&Math.abs(t[8]-e[8])<=n&&Math.abs(t[9]-e[9])<=n&&Math.abs(t[10]-e[10])<=n&&Math.abs(t[11]-e[11])<=n&&Math.abs(t[12]-e[12])<=n&&Math.abs(t[13]-e[13])<=n&&Math.abs(t[14]-e[14])<=n&&Math.abs(t[15]-e[15])<=n},_.getTranslation=function(t,e){return e.x=t[12],e.y=t[13],e.z=t[14],e},_.getRotation=function(t,e){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e};var N=new s,d=new s,I=new e,S=new e(0,0,0,1);return _.inverse=function(t,n){if(s.equalsEpsilon(_.getRotation(t,N),d,E.EPSILON7)&&e.equals(_.getRow(t,3,I),S))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-t[12],n[13]=-t[13],n[14]=-t[14],n[15]=1,n;var r=t[0],i=t[4],a=t[8],o=t[12],u=t[1],T=t[5],R=t[9],l=t[13],A=t[2],f=t[6],h=t[10],M=t[14],O=t[3],m=t[7],y=t[11],p=t[15],C=h*p,U=M*y,L=f*p,F=M*m,P=f*y,v=h*m,w=A*p,D=M*O,g=A*y,B=h*O,x=A*m,z=f*O,G=C*T+F*R+P*l-(U*T+L*R+v*l),b=U*u+w*R+B*l-(C*u+D*R+g*l),X=L*u+D*T+x*l-(F*u+w*T+z*l),V=v*u+g*T+z*R-(P*u+B*T+x*R),H=U*i+L*a+v*o-(C*i+F*a+P*o),q=C*r+D*a+g*o-(U*r+w*a+B*o),W=F*r+w*i+z*o-(L*r+D*i+x*o),Y=P*r+B*i+x*a-(v*r+g*i+z*a);C=a*l,U=o*R,L=i*l,F=o*T,P=i*R,v=a*T,w=r*l,D=o*u,g=r*R,B=a*u,x=r*T,z=i*u;var k=C*m+F*y+P*p-(U*m+L*y+v*p),K=U*O+w*y+B*p-(C*O+D*y+g*p),Z=L*O+D*m+x*p-(F*O+w*m+z*p),j=v*O+g*m+z*y-(P*O+B*m+x*y),Q=L*h+v*M+U*f-(P*M+C*f+F*h),J=g*M+C*A+D*h-(w*h+B*M+U*A),$=w*f+z*M+F*A-(x*M+L*A+D*f),tt=x*h+P*A+B*f-(g*f+z*h+v*A),et=r*G+i*b+a*X+o*V;if(Math.abs(et)<E.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return et=1/et,n[0]=G*et,n[1]=b*et,n[2]=X*et,n[3]=V*et,n[4]=H*et,n[5]=q*et,n[6]=W*et,n[7]=Y*et,n[8]=k*et,n[9]=K*et,n[10]=Z*et,n[11]=j*et,n[12]=Q*et,n[13]=J*et,n[14]=$*et,n[15]=tt*et,n},_.inverseTransformation=function(t,e){var n=t[0],r=t[1],i=t[2],a=t[4],o=t[5],u=t[6],E=t[8],s=t[9],c=t[10],_=t[12],T=t[13],R=t[14],l=-n*_-r*T-i*R,A=-a*_-o*T-u*R,f=-E*_-s*T-c*R;return e[0]=n,e[1]=a,e[2]=E,e[3]=0,e[4]=r,e[5]=o,e[6]=s,e[7]=0,e[8]=i,e[9]=u,e[10]=c,e[11]=0,e[12]=l,e[13]=A,e[14]=f,e[15]=1,e},_.IDENTITY=u(new _(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),_.ZERO=u(new _(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),_.COLUMN0ROW0=0,_.COLUMN0ROW1=1,_.COLUMN0ROW2=2,_.COLUMN0ROW3=3,_.COLUMN1ROW0=4,_.COLUMN1ROW1=5,_.COLUMN1ROW2=6,_.COLUMN1ROW3=7,_.COLUMN2ROW0=8,_.COLUMN2ROW1=9,_.COLUMN2ROW2=10,_.COLUMN2ROW3=11,_.COLUMN3ROW0=12,_.COLUMN3ROW1=13,_.COLUMN3ROW2=14,_.COLUMN3ROW3=15,a(_.prototype,{length:{get:function(){return _.packedLength}}}),_.prototype.clone=function(t){return _.clone(this,t)},_.prototype.equals=function(t){return _.equals(this,t)},_.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]&&t[4]===e[n+4]&&t[5]===e[n+5]&&t[6]===e[n+6]&&t[7]===e[n+7]&&t[8]===e[n+8]&&t[9]===e[n+9]&&t[10]===e[n+10]&&t[11]===e[n+11]&&t[12]===e[n+12]&&t[13]===e[n+13]&&t[14]===e[n+14]&&t[15]===e[n+15]},_.prototype.equalsEpsilon=function(t,e){return _.equalsEpsilon(this,t,e)},_.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]+")"},_}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(t,e,n,r,i,a,o,u,E){"use strict";function s(t,e,r,i){this.west=n(t,0),this.south=n(e,0),this.east=n(r,0),this.north=n(i,0)}i(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(t,e,r){return r=n(r,0),e[r++]=t.west,e[r++]=t.south,e[r++]=t.east,e[r]=t.north,e},s.unpack=function(t,e,i){return e=n(e,0),r(i)||(i=new s),i.west=t[e++],i.south=t[e++],i.east=t[e++],i.north=t[e],i},s.computeWidth=function(t){var e=t.east,n=t.west;return e<n&&(e+=E.TWO_PI),e-n},s.computeHeight=function(t){return t.north-t.south},s.fromDegrees=function(t,e,i,a,o){return t=E.toRadians(n(t,0)),e=E.toRadians(n(e,0)),i=E.toRadians(n(i,0)),a=E.toRadians(n(a,0)),r(o)?(o.west=t,o.south=e,o.east=i,o.north=a,o):new s(t,e,i,a)},s.fromRadians=function(t,e,i,a,o){return r(o)?(o.west=n(t,0),o.south=n(e,0),o.east=n(i,0),o.north=n(a,0),o):new s(t,e,i,a)},s.fromCartographicArray=function(t,e){for(var n=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,u=Number.MAX_VALUE,c=-Number.MAX_VALUE,_=0,T=t.length;_<T;_++){var R=t[_];n=Math.min(n,R.longitude),i=Math.max(i,R.longitude),u=Math.min(u,R.latitude),c=Math.max(c,R.latitude);var l=R.longitude>=0?R.longitude:R.longitude+E.TWO_PI;a=Math.min(a,l),o=Math.max(o,l)}return i-n>o-a&&(n=a,i=o,i>E.PI&&(i-=E.TWO_PI),n>E.PI&&(n-=E.TWO_PI)),r(e)?(e.west=n,e.south=u,e.east=i,e.north=c,e):new s(n,u,i,c)},s.fromCartesianArray=function(t,e,n){for(var i=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,u=-Number.MAX_VALUE,c=Number.MAX_VALUE,_=-Number.MAX_VALUE,T=0,R=t.length;T<R;T++){var l=e.cartesianToCartographic(t[T]);i=Math.min(i,l.longitude),a=Math.max(a,l.longitude),c=Math.min(c,l.latitude),_=Math.max(_,l.latitude);var A=l.longitude>=0?l.longitude:l.longitude+E.TWO_PI;o=Math.min(o,A),u=Math.max(u,A)}return a-i>u-o&&(i=o,a=u,a>E.PI&&(a-=E.TWO_PI),i>E.PI&&(i-=E.TWO_PI)),r(n)?(n.west=i,n.south=c,n.east=a,n.north=_,n):new s(i,c,a,_)},s.clone=function(t,e){if(r(t))return r(e)?(e.west=t.west,e.south=t.south,e.east=t.east,e.north=t.north,e):new s(t.west,t.south,t.east,t.north)},s.prototype.clone=function(t){return s.clone(this,t)},s.prototype.equals=function(t){return s.equals(this,t)},s.equals=function(t,e){return t===e||r(t)&&r(e)&&t.west===e.west&&t.south===e.south&&t.east===e.east&&t.north===e.north},s.prototype.equalsEpsilon=function(t,e){return r(t)&&Math.abs(this.west-t.west)<=e&&Math.abs(this.south-t.south)<=e&&Math.abs(this.east-t.east)<=e&&Math.abs(this.north-t.north)<=e},s.validate=function(t){},s.southwest=function(e,n){return r(n)?(n.longitude=e.west,n.latitude=e.south,n.height=0,n):new t(e.west,e.south)},s.northwest=function(e,n){return r(n)?(n.longitude=e.west,n.latitude=e.north,n.height=0,n):new t(e.west,e.north)},s.northeast=function(e,n){return r(n)?(n.longitude=e.east,n.latitude=e.north,n.height=0,n):new t(e.east,e.north)},s.southeast=function(e,n){return r(n)?(n.longitude=e.east,n.latitude=e.south,n.height=0,n):new t(e.east,e.south)},s.center=function(e,n){var i=e.east,a=e.west;i<a&&(i+=E.TWO_PI);var o=E.negativePiToPi(.5*(a+i)),u=.5*(e.south+e.north);return r(n)?(n.longitude=o,n.latitude=u,n.height=0,n):new t(o,u)},s.intersection=function(t,e,n){var i=t.east,a=t.west,o=e.east,u=e.west;i<a&&o>0?i+=E.TWO_PI:o<u&&i>0&&(o+=E.TWO_PI),i<a&&u<0?u+=E.TWO_PI:o<u&&a<0&&(a+=E.TWO_PI);var c=E.negativePiToPi(Math.max(a,u)),_=E.negativePiToPi(Math.min(i,o));if(!((t.west<t.east||e.west<e.east)&&_<=c)){var T=Math.max(t.south,e.south),R=Math.min(t.north,e.north);if(!(T>=R))return r(n)?(n.west=c,n.south=T,n.east=_,n.north=R,n):new s(c,T,_,R)}},s.simpleIntersection=function(t,e,n){var i=Math.max(t.west,e.west),a=Math.max(t.south,e.south),o=Math.min(t.east,e.east),u=Math.min(t.north,e.north);if(!(a>=u||i>=o))return r(n)?(n.west=i,n.south=a,n.east=o,n.north=u,n):new s(i,a,o,u)},s.union=function(t,e,n){r(n)||(n=new s);var i=t.east,a=t.west,o=e.east,u=e.west;i<a&&o>0?i+=E.TWO_PI:o<u&&i>0&&(o+=E.TWO_PI),i<a&&u<0?u+=E.TWO_PI:o<u&&a<0&&(a+=E.TWO_PI);var c=E.convertLongitudeRange(Math.min(a,u)),_=E.convertLongitudeRange(Math.max(i,o));return n.west=c,n.south=Math.min(t.south,e.south),n.east=_,n.north=Math.max(t.north,e.north),n},s.expand=function(t,e,n){return r(n)||(n=new s),n.west=Math.min(t.west,e.longitude),n.south=Math.min(t.south,e.latitude),n.east=Math.max(t.east,e.longitude),n.north=Math.max(t.north,e.latitude),n},s.contains=function(t,e){var n=e.longitude,r=e.latitude,i=t.west,a=t.east;return a<i&&(a+=E.TWO_PI,n<0&&(n+=E.TWO_PI)),(n>i||E.equalsEpsilon(n,i,E.EPSILON14))&&(n<a||E.equalsEpsilon(n,a,E.EPSILON14))&&r>=t.south&&r<=t.north};var c=new t;return s.subsample=function(t,e,i,a){e=n(e,o.WGS84),i=n(i,0),r(a)||(a=[]);var u=0,_=t.north,T=t.south,R=t.east,l=t.west,A=c;A.height=i,A.longitude=l,A.latitude=_,a[u]=e.cartographicToCartesian(A,a[u]),u++,A.longitude=R,a[u]=e.cartographicToCartesian(A,a[u]),u++,A.latitude=T,a[u]=e.cartographicToCartesian(A,a[u]),u++,A.longitude=l,a[u]=e.cartographicToCartesian(A,a[u]),u++,_<0?A.latitude=_:T>0?A.latitude=T:A.latitude=0;for(var f=1;f<8;++f)A.longitude=-Math.PI+f*E.PI_OVER_TWO,s.contains(t,A)&&(a[u]=e.cartographicToCartesian(A,a[u]),u++);return 0===A.latitude&&(A.longitude=l,a[u]=e.cartographicToCartesian(A,a[u]),u++,A.longitude=R,a[u]=e.cartographicToCartesian(A,a[u]),u++),a.length=u,a},s.MAX_VALUE=u(new s(-Math.PI,-E.PI_OVER_TWO,Math.PI,E.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(t,e,n,r,i,a,o,u,E,s,c,_){"use strict";function T(e,n){this.center=t.clone(r(e,t.ZERO)),this.radius=r(n,0)}var R=new t,l=new t,A=new t,f=new t,h=new t,N=new t,d=new t,I=new t,S=new t,M=new t,O=new t,m=new t;T.fromPoints=function(e,n){if(i(n)||(n=new T),!i(e)||0===e.length)return n.center=t.clone(t.ZERO,n.center),n.radius=0,n;for(var r=t.clone(e[0],d),a=t.clone(r,R),o=t.clone(r,l),u=t.clone(r,A),E=t.clone(r,f),s=t.clone(r,h),c=t.clone(r,N),_=e.length,y=1;y<_;y++){t.clone(e[y],r);var p=r.x,C=r.y,U=r.z;p<a.x&&t.clone(r,a),p>E.x&&t.clone(r,E),C<o.y&&t.clone(r,o),C>s.y&&t.clone(r,s),U<u.z&&t.clone(r,u),U>c.z&&t.clone(r,c)}var L=t.magnitudeSquared(t.subtract(E,a,I)),F=t.magnitudeSquared(t.subtract(s,o,I)),P=t.magnitudeSquared(t.subtract(c,u,I)),v=a,w=E,D=L;F>D&&(D=F,v=o,w=s),P>D&&(D=P,v=u,w=c);var g=S;g.x=.5*(v.x+w.x),g.y=.5*(v.y+w.y),g.z=.5*(v.z+w.z);var B=t.magnitudeSquared(t.subtract(w,g,I)),x=Math.sqrt(B),z=M;z.x=a.x,z.y=o.y,z.z=u.z;var G=O;G.x=E.x,G.y=s.y,G.z=c.z;var b=t.multiplyByScalar(t.add(z,G,I),.5,m),X=0;for(y=0;y<_;y++){t.clone(e[y],r);var V=t.magnitude(t.subtract(r,b,I));V>X&&(X=V);var H=t.magnitudeSquared(t.subtract(r,g,I));if(H>B){var q=Math.sqrt(H);x=.5*(x+q),B=x*x;var W=q-x;g.x=(x*g.x+W*r.x)/q,g.y=(x*g.y+W*r.y)/q,g.z=(x*g.z+W*r.z)/q}}return x<X?(t.clone(g,n.center),n.radius=x):(t.clone(b,n.center),n.radius=X),n};var y=new o,p=new t,C=new t,U=new e,L=new e;T.fromRectangle2D=function(t,e,n){return T.fromRectangleWithHeights2D(t,e,0,0,n)},T.fromRectangleWithHeights2D=function(e,n,a,o,u){if(i(u)||(u=new T),!i(e))return u.center=t.clone(t.ZERO,u.center),u.radius=0,u;n=r(n,y),_.southwest(e,U),U.height=a,_.northeast(e,L),L.height=o;var E=n.project(U,p),s=n.project(L,C),c=s.x-E.x,R=s.y-E.y,l=s.z-E.z;u.radius=.5*Math.sqrt(c*c+R*R+l*l);var A=u.center;return A.x=E.x+.5*c,A.y=E.y+.5*R,A.z=E.z+.5*l,u};var F=[];T.fromRectangle3D=function(t,e,n,o){e=r(e,a.WGS84),n=r(n,0);var u;return i(t)&&(u=_.subsample(t,e,n,F)),T.fromPoints(u,o)},T.fromVertices=function(e,n,a,o){if(i(o)||(o=new T),!i(e)||0===e.length)return o.center=t.clone(t.ZERO,o.center),o.radius=0,o;n=r(n,t.ZERO),a=r(a,3);var u=d;u.x=e[0]+n.x,u.y=e[1]+n.y,u.z=e[2]+n.z;for(var E=t.clone(u,R),s=t.clone(u,l),c=t.clone(u,A),_=t.clone(u,f),y=t.clone(u,h),p=t.clone(u,N),C=e.length,U=0;U<C;U+=a){var L=e[U]+n.x,F=e[U+1]+n.y,P=e[U+2]+n.z;u.x=L,u.y=F,u.z=P,L<E.x&&t.clone(u,E),L>_.x&&t.clone(u,_),F<s.y&&t.clone(u,s),F>y.y&&t.clone(u,y),P<c.z&&t.clone(u,c),P>p.z&&t.clone(u,p)}var v=t.magnitudeSquared(t.subtract(_,E,I)),w=t.magnitudeSquared(t.subtract(y,s,I)),D=t.magnitudeSquared(t.subtract(p,c,I)),g=E,B=_,x=v;w>x&&(x=w,g=s,B=y),D>x&&(x=D,g=c,B=p);var z=S;z.x=.5*(g.x+B.x),z.y=.5*(g.y+B.y),z.z=.5*(g.z+B.z);var G=t.magnitudeSquared(t.subtract(B,z,I)),b=Math.sqrt(G),X=M;X.x=E.x,X.y=s.y,X.z=c.z;var V=O;V.x=_.x,V.y=y.y,V.z=p.z;var H=t.multiplyByScalar(t.add(X,V,I),.5,m),q=0;for(U=0;U<C;U+=a){u.x=e[U]+n.x,u.y=e[U+1]+n.y,u.z=e[U+2]+n.z;var W=t.magnitude(t.subtract(u,H,I));W>q&&(q=W);var Y=t.magnitudeSquared(t.subtract(u,z,I));if(Y>G){var k=Math.sqrt(Y);b=.5*(b+k),G=b*b;var K=k-b;z.x=(b*z.x+K*u.x)/k,z.y=(b*z.y+K*u.y)/k,z.z=(b*z.z+K*u.z)/k}}return b<q?(t.clone(z,o.center),o.radius=b):(t.clone(H,o.center),o.radius=q),o},T.fromEncodedCartesianVertices=function(e,n,r){if(i(r)||(r=new T),!i(e)||!i(n)||e.length!==n.length||0===e.length)return r.center=t.clone(t.ZERO,r.center),r.radius=0,r;var a=d;a.x=e[0]+n[0],a.y=e[1]+n[1],a.z=e[2]+n[2];for(var o=t.clone(a,R),u=t.clone(a,l),E=t.clone(a,A),s=t.clone(a,f),c=t.clone(a,h),_=t.clone(a,N),y=e.length,p=0;p<y;p+=3){var C=e[p]+n[p],U=e[p+1]+n[p+1],L=e[p+2]+n[p+2];a.x=C,a.y=U,a.z=L,C<o.x&&t.clone(a,o),C>s.x&&t.clone(a,s),U<u.y&&t.clone(a,u),U>c.y&&t.clone(a,c),L<E.z&&t.clone(a,E),L>_.z&&t.clone(a,_)}var F=t.magnitudeSquared(t.subtract(s,o,I)),P=t.magnitudeSquared(t.subtract(c,u,I)),v=t.magnitudeSquared(t.subtract(_,E,I)),w=o,D=s,g=F;P>g&&(g=P,w=u,D=c),v>g&&(g=v,w=E,D=_);var B=S;B.x=.5*(w.x+D.x),B.y=.5*(w.y+D.y),B.z=.5*(w.z+D.z);var x=t.magnitudeSquared(t.subtract(D,B,I)),z=Math.sqrt(x),G=M;G.x=o.x,G.y=u.y,G.z=E.z;var b=O;b.x=s.x,b.y=c.y,b.z=_.z;var X=t.multiplyByScalar(t.add(G,b,I),.5,m),V=0;for(p=0;p<y;p+=3){a.x=e[p]+n[p],a.y=e[p+1]+n[p+1],a.z=e[p+2]+n[p+2];var H=t.magnitude(t.subtract(a,X,I));H>V&&(V=H);var q=t.magnitudeSquared(t.subtract(a,B,I));if(q>x){var W=Math.sqrt(q);z=.5*(z+W),x=z*z;var Y=W-z;B.x=(z*B.x+Y*a.x)/W,B.y=(z*B.y+Y*a.y)/W,B.z=(z*B.z+Y*a.z)/W}}return z<V?(t.clone(B,r.center),r.radius=z):(t.clone(X,r.center),r.radius=V),r},T.fromCornerPoints=function(e,n,r){i(r)||(r=new T);var a=r.center;return t.add(e,n,a),t.multiplyByScalar(a,.5,a),r.radius=t.distance(a,n),r},T.fromEllipsoid=function(e,n){return i(n)||(n=new T),t.clone(t.ZERO,n.center),n.radius=e.maximumRadius,n};var P=new t;T.fromBoundingSpheres=function(e,n){if(i(n)||(n=new T),!i(e)||0===e.length)return n.center=t.clone(t.ZERO,n.center),n.radius=0,n;var r=e.length;if(1===r)return T.clone(e[0],n);if(2===r)return T.union(e[0],e[1],n);for(var a=[],o=0;o<r;o++)a.push(e[o].center);n=T.fromPoints(a,n);var u=n.center,E=n.radius;for(o=0;o<r;o++){var s=e[o];E=Math.max(E,t.distance(u,s.center,P)+s.radius)}return n.radius=E,n};var v=new t,w=new t,D=new t;T.fromOrientedBoundingBox=function(e,n){i(n)||(n=new T);var r=e.halfAxes,a=s.getColumn(r,0,v),o=s.getColumn(r,1,w),u=s.getColumn(r,2,D),E=t.magnitude(a),c=t.magnitude(o),_=t.magnitude(u);return n.center=t.clone(e.center,n.center),n.radius=Math.max(E,c,_),n},T.clone=function(e,n){if(i(e))return i(n)?(n.center=t.clone(e.center,n.center),n.radius=e.radius,n):new T(e.center,e.radius)},T.packedLength=4,T.pack=function(t,e,n){n=r(n,0);var i=t.center;return e[n++]=i.x,e[n++]=i.y,e[n++]=i.z,e[n]=t.radius,e},T.unpack=function(t,e,n){e=r(e,0),i(n)||(n=new T);var a=n.center;return a.x=t[e++],a.y=t[e++],a.z=t[e++],n.radius=t[e],n};var g=new t,B=new t;T.union=function(e,n,r){i(r)||(r=new T);var a=e.center,o=e.radius,u=n.center,E=n.radius,s=t.subtract(u,a,g),c=t.magnitude(s);if(o>=c+E)return e.clone(r),r;if(E>=c+o)return n.clone(r),r;var _=.5*(o+c+E),R=t.multiplyByScalar(s,(-o+_)/c,B);return t.add(R,a,R),t.clone(R,r.center),r.radius=_,r};var x=new t;T.expand=function(e,n,r){r=T.clone(e,r);var i=t.magnitude(t.subtract(n,r.center,x));return i>r.radius&&(r.radius=i),r},T.intersectPlane=function(e,n){var r=e.center,i=e.radius,a=n.normal,o=t.dot(a,r)+n.distance;return o<-i?u.OUTSIDE:o<i?u.INTERSECTING:u.INSIDE},T.transform=function(t,e,n){return i(n)||(n=new T),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=c.getMaximumScale(e)*t.radius,n};var z=new t;T.distanceSquaredTo=function(e,n){var r=t.subtract(e.center,n,z);return t.magnitudeSquared(r)-e.radius*e.radius},T.transformWithoutScale=function(t,e,n){return i(n)||(n=new T),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=t.radius,n};var G=new t;T.computePlaneDistances=function(e,n,r,a){i(a)||(a=new E);var o=t.subtract(e.center,n,G),u=t.dot(r,o);return a.start=u-e.radius,a.stop=u+e.radius,a};for(var b=new t,X=new t,V=new t,H=new t,q=new t,W=new e,Y=new Array(8),k=0;k<8;++k)Y[k]=new t;var K=new o;return T.projectTo2D=function(e,n,i){n=r(n,K);var a=n.ellipsoid,o=e.center,u=e.radius,E=a.geodeticSurfaceNormal(o,b),s=t.cross(t.UNIT_Z,E,X);t.normalize(s,s);var c=t.cross(E,s,V);t.normalize(c,c),t.multiplyByScalar(E,u,E),t.multiplyByScalar(c,u,c),t.multiplyByScalar(s,u,s);var _=t.negate(c,q),R=t.negate(s,H),l=Y,A=l[0];t.add(E,c,A),t.add(A,s,A),A=l[1],t.add(E,c,A),t.add(A,R,A),A=l[2],t.add(E,_,A),t.add(A,R,A),A=l[3],t.add(E,_,A),t.add(A,s,A),t.negate(E,E),A=l[4],t.add(E,c,A),t.add(A,s,A),A=l[5],t.add(E,c,A),t.add(A,R,A),A=l[6],t.add(E,_,A),t.add(A,R,A),A=l[7],t.add(E,_,A),t.add(A,s,A);for(var f=l.length,h=0;h<f;++h){var N=l[h];t.add(o,N,N);var d=a.cartesianToCartographic(N,W);n.project(d,N)}i=T.fromPoints(l,i),o=i.center;var I=o.x,S=o.y,M=o.z;return o.x=M,o.y=I,o.z=S,i},T.isOccluded=function(t,e){return!e.isBoundingSphereVisible(t)},T.equals=function(e,n){return e===n||i(e)&&i(n)&&t.equals(e.center,n.center)&&e.radius===n.radius},T.prototype.intersectPlane=function(t){return T.intersectPlane(this,t)},T.prototype.distanceSquaredTo=function(t){return T.distanceSquaredTo(this,t)},T.prototype.computePlaneDistances=function(t,e,n){return T.computePlaneDistances(this,t,e,n)},T.prototype.isOccluded=function(t){return T.isOccluded(this,t)},T.prototype.equals=function(t){return T.equals(this,t)},T.prototype.clone=function(t){return T.clone(this,t)},T}),define("Core/Fullscreen",["./defined","./defineProperties"],function(t,e){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},i={};return e(i,{element:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(i.supportsFullscreen())return null!==i.element}}}),i.supportsFullscreen=function(){if(t(n))return n;n=!1;var e=document.body;if("function"==typeof e.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var i,a=["webkit","moz","o","ms","khtml"],o=0,u=a.length;o<u;++o){var E=a[o];i=E+"RequestFullscreen","function"==typeof e[i]?(r.requestFullscreen=i,n=!0):(i=E+"RequestFullScreen","function"==typeof e[i]&&(r.requestFullscreen=i,n=!0)),i=E+"ExitFullscreen","function"==typeof document[i]?r.exitFullscreen=i:(i=E+"CancelFullScreen","function"==typeof document[i]&&(r.exitFullscreen=i)),i=E+"FullscreenEnabled",void 0!==document[i]?r.fullscreenEnabled=i:(i=E+"FullScreenEnabled",void 0!==document[i]&&(r.fullscreenEnabled=i)),i=E+"FullscreenElement",void 0!==document[i]?r.fullscreenElement=i:(i=E+"FullScreenElement",void 0!==document[i]&&(r.fullscreenElement=i)),i=E+"fullscreenchange",void 0!==document["on"+i]&&("ms"===E&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=E+"fullscreenerror",void 0!==document["on"+i]&&("ms"===E&&(i="MSFullscreenError"),r.fullscreenerror=i)}return n},i.requestFullscreen=function(t,e){i.supportsFullscreen()&&t[r.requestFullscreen]({vrDisplay:e})},i.exitFullscreen=function(){i.supportsFullscreen()&&document[r.exitFullscreen]()},i}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(t,e,n){"use strict";function r(t){for(var e=t.split("."),n=0,r=e.length;n<r;++n)e[n]=parseInt(e[n],10);return e}function i(){if(!e(S)&&(S=!1,!T())){var t=/ Chrome\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(S=!0,M=r(t[1]))}return S}function a(){return i()&&M}function o(){if(!e(O)&&(O=!1,!i()&&!T()&&/ Safari\/[\.0-9]+/.test(I.userAgent))){var t=/ Version\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(O=!0,m=r(t[1]))}return O}function u(){return o()&&m}function E(){if(!e(y)){y=!1;var t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(I.userAgent);null!==t&&(y=!0,p=r(t[1]),p.isNightly=!!t[2])}return y}function s(){return E()&&p}function c(){if(!e(C)){C=!1;var t;"Microsoft Internet Explorer"===I.appName?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==t&&(C=!0,U=r(t[1]))):"Netscape"===I.appName&&(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==t&&(C=!0,U=r(t[1])))}return C}function _(){return c()&&U}function T(){if(!e(L)){L=!1;var t=/ Edge\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(L=!0,F=r(t[1]))}return L}function R(){return T()&&F}function l(){if(!e(P)){P=!1;var t=/Firefox\/([\.0-9]+)/.exec(I.userAgent); +null!==t&&(P=!0,v=r(t[1]))}return P}function A(){return e(w)||(w=/Windows/i.test(I.appVersion)),w}function f(){return l()&&v}function h(){return e(D)||(D="undefined"!=typeof PointerEvent&&(!e(I.pointerEnabled)||I.pointerEnabled)),D}function N(){if(!e(B)){var t=document.createElement("canvas");t.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=t.style.imageRendering;B=e(n)&&""!==n,B&&(g=n)}return B}function d(){return N()?g:void 0}var I;I="undefined"!=typeof navigator?navigator:{};var S,M,O,m,y,p,C,U,L,F,P,v,w,D,g,B,x={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:E,webkitVersion:s,isInternetExplorer:c,internetExplorerVersion:_,isEdge:T,edgeVersion:R,isFirefox:l,firefoxVersion:f,isWindows:A,hardwareConcurrency:t(I.hardwareConcurrency,3),supportsPointerEvents:h,supportsImageRenderingPixelated:N,imageRenderingValue:d};return x.supportsFullscreen=function(){return n.supportsFullscreen()},x.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},x.supportsWebWorkers=function(){return"undefined"!=typeof Worker},x}),define("Core/WebGLConstants",["./freezeObject"],function(t){"use strict";var e={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047};return t(e)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(t,e,n,r,i,a){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:a.BYTE,UNSIGNED_BYTE:a.UNSIGNED_BYTE,SHORT:a.SHORT,UNSIGNED_SHORT:a.UNSIGNED_SHORT,INT:a.INT,UNSIGNED_INT:a.UNSIGNED_INT,FLOAT:a.FLOAT,DOUBLE:a.DOUBLE};return o.getSizeInBytes=function(t){switch(t){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.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(t){return t instanceof Int8Array?o.BYTE:t instanceof Uint8Array?o.UNSIGNED_BYTE:t instanceof Int16Array?o.SHORT:t instanceof Uint16Array?o.UNSIGNED_SHORT:t instanceof Int32Array?o.INT:t instanceof Uint32Array?o.UNSIGNED_INT:t instanceof Float32Array?o.FLOAT:t instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(t){return e(t)&&(t===o.BYTE||t===o.UNSIGNED_BYTE||t===o.SHORT||t===o.UNSIGNED_SHORT||t===o.INT||t===o.UNSIGNED_INT||t===o.FLOAT||t===o.DOUBLE)},o.createTypedArray=function(t,e){switch(t){case o.BYTE:return new Int8Array(e);case o.UNSIGNED_BYTE:return new Uint8Array(e);case o.SHORT:return new Int16Array(e);case o.UNSIGNED_SHORT:return new Uint16Array(e);case o.INT:return new Int32Array(e);case o.UNSIGNED_INT:return new Uint32Array(e);case o.FLOAT:return new Float32Array(e);case o.DOUBLE:return new Float64Array(e)}},o.createArrayBufferView=function(e,n,r,i){switch(r=t(r,0),i=t(i,(n.byteLength-r)/o.getSizeInBytes(e)),e){case o.BYTE:return new Int8Array(n,r,i);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,i);case o.SHORT:return new Int16Array(n,r,i);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,i);case o.INT:return new Int32Array(n,r,i);case o.UNSIGNED_INT:return new Uint32Array(n,r,i);case o.FLOAT:return new Float32Array(n,r,i);case o.DOUBLE:return new Float64Array(n,r,i)}},o.fromName=function(t){switch(t){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},i(o)}),define("Core/GeometryType",["./freezeObject"],function(t){"use strict";var e={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return t(e)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(t,e){"use strict";var n={POINTS:e.POINTS,LINES:e.LINES,LINE_LOOP:e.LINE_LOOP,LINE_STRIP:e.LINE_STRIP,TRIANGLES:e.TRIANGLES,TRIANGLE_STRIP:e.TRIANGLE_STRIP,TRIANGLE_FAN:e.TRIANGLE_FAN,validate:function(t){return t===n.POINTS||t===n.LINES||t===n.LINE_LOOP||t===n.LINE_STRIP||t===n.TRIANGLES||t===n.TRIANGLE_STRIP||t===n.TRIANGLE_FAN}};return t(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(t,e,n,r,i){"use strict";function a(e){e=t(e,t.EMPTY_OBJECT),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=t(e.primitiveType,i.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=t(e.geometryType,r.NONE),this.boundingSphereCV=e.boundingSphereCV}return a.computeNumberOfVertices=function(t){var n=-1;for(var r in t.attributes)if(t.attributes.hasOwnProperty(r)&&e(t.attributes[r])&&e(t.attributes[r].values)){var i=t.attributes[r],a=i.values.length/i.componentsPerAttribute;n=a}return n},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(t,e,n){"use strict";function r(e){e=t(e,t.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=t(e.normalize,!1),this.values=e.values}return r}),define("Core/GeometryAttributes",["./defaultValue"],function(t){"use strict";function e(e){e=t(e,t.EMPTY_OBJECT),this.position=e.position,this.normal=e.normal,this.st=e.st,this.bitangent=e.bitangent,this.tangent=e.tangent,this.color=e.color}return e}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(t,e,n,r,i){"use strict";var a={UNSIGNED_BYTE:i.UNSIGNED_BYTE,UNSIGNED_SHORT:i.UNSIGNED_SHORT,UNSIGNED_INT:i.UNSIGNED_INT};return a.getSizeInBytes=function(t){switch(t){case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},a.validate=function(e){return t(e)&&(e===a.UNSIGNED_BYTE||e===a.UNSIGNED_SHORT||e===a.UNSIGNED_INT)},a.createTypedArray=function(t,e){return t>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(e):new Uint16Array(e)},a.createTypedArrayFromArrayBuffer=function(t,e,n,i){return t>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(e,n,i):new Uint16Array(e,n,i)},n(a)}),define("Core/EllipsoidOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType"],function(t,e,n,r,i,a,o,u,E,s,c,_,T){"use strict";function R(t){t=r(t,r.EMPTY_OBJECT);var n=r(t.radii,l),i=r(t.stackPartitions,10),a=r(t.slicePartitions,8),o=r(t.subdivisions,128);this._radii=e.clone(n),this._stackPartitions=i,this._slicePartitions=a,this._subdivisions=o,this._workerName="createEllipsoidOutlineGeometry"}var l=new e(1,1,1),A=Math.cos,f=Math.sin;R.packedLength=e.packedLength+3,R.pack=function(t,n,i){return i=r(i,0),e.pack(t._radii,n,i),i+=e.packedLength,n[i++]=t._stackPartitions,n[i++]=t._slicePartitions,n[i]=t._subdivisions,n};var h=new e,N={radii:h,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};return R.unpack=function(t,n,a){n=r(n,0);var o=e.unpack(t,n,h);n+=e.packedLength;var u=t[n++],E=t[n++],s=t[n++];return i(a)?(a._radii=e.clone(o,a._radii),a._stackPartitions=u,a._slicePartitions=E,a._subdivisions=s,a):(N.stackPartitions=u,N.slicePartitions=E,N.subdivisions=s,new R(N))},R.createGeometry=function(e){var r=e._radii;if(!(r.x<=0||r.y<=0||r.z<=0)){var i,a,R,l,h,N,d=o.fromCartesian3(r),I=e._stackPartitions,S=e._slicePartitions,M=e._subdivisions,O=M*(I+S-1),m=O-S+2,y=new Float64Array(3*m),p=c.createTypedArray(m,2*O),C=0,U=new Array(M),L=new Array(M);for(i=0;i<M;i++)R=_.TWO_PI*i/M,U[i]=A(R),L[i]=f(R);for(i=1;i<I;i++)for(l=Math.PI*i/I,h=A(l),N=f(l),a=0;a<M;a++)y[C++]=r.x*U[a]*N,y[C++]=r.y*L[a]*N,y[C++]=r.z*h;for(U.length=S,L.length=S,i=0;i<S;i++)R=_.TWO_PI*i/S,U[i]=A(R),L[i]=f(R);for(y[C++]=0,y[C++]=0,y[C++]=r.z,i=1;i<M;i++)for(l=Math.PI*i/M,h=A(l),N=f(l),a=0;a<S;a++)y[C++]=r.x*U[a]*N,y[C++]=r.y*L[a]*N,y[C++]=r.z*h;for(y[C++]=0,y[C++]=0,y[C++]=-r.z,C=0,i=0;i<I-1;++i){var F=i*M;for(a=0;a<M-1;++a)p[C++]=F+a,p[C++]=F+a+1;p[C++]=F+M-1,p[C++]=F}var P=M*(I-1);for(a=1;a<S+1;++a)p[C++]=P,p[C++]=P+a;for(i=0;i<M-2;++i){var v=i*S+1+P,w=(i+1)*S+1+P;for(a=0;a<S-1;++a)p[C++]=w+a,p[C++]=v+a;p[C++]=w+S-1,p[C++]=v+S-1}var D=y.length/3-1;for(a=D-1;a>D-S-1;--a)p[C++]=D,p[C++]=a;var g=new s({position:new E({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:y})});return new u({attributes:g,indices:p,primitiveType:T.LINES,boundingSphere:t.fromEllipsoid(d)})}},R}),define("Workers/createEllipsoidOutlineGeometry",["../Core/defined","../Core/EllipsoidOutlineGeometry"],function(t,e){"use strict";return function(n,r){return t(n.buffer,r)&&(n=e.unpack(n,r)),e.createGeometry(n)}})}(); \ No newline at end of file diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createGeometry.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createGeometry.js index f700ed29..ce486310 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createGeometry.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,8 +55,8 @@ mersenne-twister.js - https://gist.github.com/banksean/300494 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==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";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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("Core/isArray",["./defined"],function(e){"use strict";var t=Array.isArray;return e(t)||(t=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),t}),define("Core/Check",["./defaultValue","./defined","./DeveloperError","./isArray"],function(e,t,r,n){"use strict";function a(e){return e+" was required but undefined."}function i(e,t,r){return"Expected "+r+" to be typeof "+t+", got "+e}var o={};return o.typeOf={},o.numeric={},o.defined=function(e,n){if(!t(e))throw new r(a(n))},o.numeric.maximum=function(e,t){if(o.typeOf.number(e),o.typeOf.number(t),e>t)throw new r("Expected "+e+" to be at most "+t)},o.numeric.minimum=function(e,t){if(o.typeOf.number(e),o.typeOf.number(t),e<t)throw new r("Expected "+e+" to be at least "+t)},o.typeOf.function=function(e,t){if("function"!=typeof e)throw new r(i(typeof e,"function",t))},o.typeOf.string=function(e,t){if("string"!=typeof e)throw new r(i(typeof e,"string",t))},o.typeOf.number=function(e,t){if("number"!=typeof e)throw new r(i(typeof e,"number",t))},o.typeOf.object=function(e,t){if("object"!=typeof e)throw new r(i(typeof e,"object",t))},o.typeOf.boolean=function(e,t){if("boolean"!=typeof e)throw new r(i(typeof e,"boolean",t))},o}),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^=e<<7&2636928640,e^=e<<15&4022730752,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,r,n){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:e<0?-1:0},a.signNotZero=function(e){return e<0?-1:1},a.toSNorm=function(e,r){return r=t(r,255),Math.round((.5*a.clamp(e,-1,1)+.5)*r)},a.fromSNorm=function(e,r){return r=t(r,255),a.clamp(e,0,r)/r*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t-r)},a.cosh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t+r)},a.lerp=function(e,t,r){return(1-r)*e+r*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){var t=a.TWO_PI,r=e-Math.floor(e/t)*t;return r<-Math.PI?r+t:r>=Math.PI?r-t:r},a.clampToLatitudeRange=function(e){return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){return(e%t+t)%t},a.equalsEpsilon=function(e,r,n,a){a=t(a,n);var i=Math.abs(e-r);return i<=a||i<=n*Math.max(Math.abs(e),Math.abs(r))};var i=[1];a.factorial=function(e){var t=i.length;if(e>=t)for(var r=i[t-1],n=t;n<=e;n++)i.push(r*n);return i[e]},a.incrementWrap=function(e,r,n){return n=t(n,0),++e,e>r&&(e=n),e},a.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,r){return e<t?t:e>r?r:e};var o=new e;return a.setRandomNumberSeed=function(t){o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(e){return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){return Math.log(e)/Math.log(t)},a.fog=function(e,t){var r=e*t;return 1-Math.exp(-(r*r))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i){"use strict";function o(e,r,n){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0)}o.fromSpherical=function(e,n){r(n)||(n=new o);var a=e.clock,i=e.cone,u=t(e.magnitude,1),s=u*Math.sin(i);return n.x=s*Math.cos(a),n.y=s*Math.sin(a),n.z=u*Math.cos(i),n},o.fromElements=function(e,t,n,a){return r(a)?(a.x=e,a.y=t,a.z=n,a):new o(e,t,n)},o.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n]=e.z,r},o.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new o),a.x=e[n++],a.y=e[n++],a.z=e[n],a},o.packArray=function(e,t){var n=e.length;r(t)?t.length=3*n:t=new Array(3*n);for(var a=0;a<n;++a)o.pack(e[a],t,3*a);return t},o.unpackArray=function(e,t){var n=e.length;r(t)?t.length=n/3:t=new Array(n/3);for(var a=0;a<n;a+=3){var i=a/3;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},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},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},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},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},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},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},o.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r.z=e.z/t.z,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},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},o.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*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},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,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};var s=new o;o.lerp=function(e,t,r,n){return o.multiplyByScalar(t,r,s),n=o.multiplyByScalar(e,1-r,n),o.add(s,n,n)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var r=o.dot(c,l),n=o.magnitude(o.cross(c,l,c));return Math.atan2(n,r)};var E=new o;o.mostOrthogonalAxis=function(e,t){var r=o.normalize(e,E);return o.abs(r,r),t=r.x<=r.y?r.x<=r.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):r.y<=r.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},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,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]},o.equalsEpsilon=function(e,t,n,a){return e===t||r(e)&&r(t)&&i.equalsEpsilon(e.x,t.x,n,a)&&i.equalsEpsilon(e.y,t.y,n,a)&&i.equalsEpsilon(e.z,t.z,n,a)},o.cross=function(e,t,r){var n=e.x,a=e.y,i=e.z,o=t.x,u=t.y,s=t.z,c=a*s-i*u,l=i*o-n*s,E=n*u-a*o;return r.x=c,r.y=l,r.z=E,r},o.fromDegrees=function(e,t,r,n,a){return e=i.toRadians(e),t=i.toRadians(t),o.fromRadians(e,t,r,n,a)};var f=new o,h=new o,d=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,n,a,i,u){a=t(a,0);var s=r(i)?i.radiiSquared:d,c=Math.cos(n);f.x=c*Math.cos(e),f.y=c*Math.sin(e),f.z=Math.sin(n),f=o.normalize(f,f),o.multiplyComponents(s,f,h);var l=Math.sqrt(o.dot(f,h));return h=o.divideByScalar(h,l,h),f=o.multiplyByScalar(f,a,f),r(u)||(u=new o),o.add(h,f,u)},o.fromDegreesArray=function(e,t,n){var a=e.length;r(n)?n.length=a/2:n=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;n[c]=o.fromDegrees(u,s,0,t,n[c])}return n},o.fromRadiansArray=function(e,t,n){var a=e.length;r(n)?n.length=a/2:n=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;n[c]=o.fromRadians(u,s,0,t,n[c])}return n},o.fromDegreesArrayHeights=function(e,t,n){var a=e.length;r(n)?n.length=a/3:n=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;n[l]=o.fromDegrees(u,s,c,t,n[l])}return n},o.fromRadiansArrayHeights=function(e,t,n){var a=e.length;r(n)?n.length=a/3:n=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;n[l]=o.fromRadians(u,s,c,t,n[l])}return n},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(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,t,r){return o.equalsEpsilon(this,e,t,r)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,r,n){"use strict";function a(r,a,u,s,c){var l=r.x,E=r.y,f=r.z,h=a.x,d=a.y,p=a.z,m=l*l*h*h,_=E*E*d*d,T=f*f*p*p,y=m+_+T,R=Math.sqrt(1/y),A=e.multiplyByScalar(r,R,i);if(y<s)return isFinite(R)?e.clone(A,c):void 0;var v=u.x,N=u.y,S=u.z,I=o;I.x=A.x*v*2,I.y=A.y*N*2,I.z=A.z*S*2;var M,O,g,C,w,P,x,L,U,b,F,D=(1-R)*e.magnitude(r)/(.5*e.magnitude(I)),B=0;do{D-=B,g=1/(1+D*v),C=1/(1+D*N),w=1/(1+D*S),P=g*g,x=C*C,L=w*w,U=P*g,b=x*C,F=L*w,M=m*P+_*x+T*L-1,O=m*U*v+_*b*N+T*F*S;var z=-2*O;B=M/z}while(Math.abs(M)>n.EPSILON12);return t(c)?(c.x=l*g,c.y=E*C,c.z=f*w,c):new e(l*g,E*C,f*w)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,r,n,a,i,o){"use strict";function u(e,r,n){this.longitude=t(e,0),this.latitude=t(r,0),this.height=t(n,0)}u.fromRadians=function(e,n,a,i){return a=t(a,0),r(i)?(i.longitude=e,i.latitude=n,i.height=a,i):new u(e,n,a)},u.fromDegrees=function(e,t,r,n){return e=i.toRadians(e),t=i.toRadians(t),u.fromRadians(e,t,r,n)};var s=new e,c=new e,l=new e,E=new e(1/6378137,1/6378137,1/6356752.314245179),f=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),h=i.EPSILON1;return u.fromCartesian=function(t,n,a){var d=r(n)?n.oneOverRadii:E,p=r(n)?n.oneOverRadiiSquared:f,m=r(n)?n._centerToleranceSquared:h,_=o(t,d,p,m,c);if(r(_)){var T=e.multiplyComponents(_,p,s);T=e.normalize(T,T);var y=e.subtract(t,_,l),R=Math.atan2(T.y,T.x),A=Math.asin(T.z),v=i.sign(e.dot(y,t))*e.magnitude(y);return r(a)?(a.longitude=R,a.latitude=A,a.height=v,a):new u(R,A,v)}},u.clone=function(e,t){if(r(e))return r(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||r(e)&&r(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n},u.ZERO=a(new u(0,0,0)),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,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),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","./scaleToGeodeticSurface"],function(e,t,r,n,a,i,o,u,s){"use strict";function c(t,n,a,i){n=r(n,0),a=r(a,0),i=r(i,0),t._radii=new e(n,a,i),t._radiiSquared=new e(n*n,a*a,i*i),t._radiiToTheFourth=new e(n*n*n*n,a*a*a*a,i*i*i*i),t._oneOverRadii=new e(0===n?0:1/n,0===a?0:1/a,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===n?0:1/(n*n),0===a?0:1/(a*a),0===i?0:1/(i*i)),t._minimumRadius=Math.min(n,a,i),t._maximumRadius=Math.max(n,a,i),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(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,this._sqauredXOverSquaredZ=void 0,c(this,e,t,r)}a(l.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}}}),l.clone=function(t,r){if(n(t)){var a=t._radii;return n(r)?(e.clone(a,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 l(a.x,a.y,a.z)}},l.fromCartesian3=function(e,t){return n(t)||(t=new l),n(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,n,a){return a=r(a,0),e.pack(t._radii,n,a),n},l.unpack=function(t,n,a){n=r(n,0);var i=e.unpack(t,n);return l.fromCartesian3(i,a)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,r){var a=t.longitude,i=t.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return n(r)||(r=new e),r.x=u,r.y=s,r.z=c,e.normalize(r,r)},l.prototype.geodeticSurfaceNormal=function(t,r){return n(r)||(r=new e),r=e.multiplyComponents(t,this._oneOverRadiiSquared,r),e.normalize(r,r)};var E=new e,f=new e;l.prototype.cartographicToCartesian=function(t,r){var a=E,i=f;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(e.dot(a,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(a,t.height,a),n(r)||(r=new e),e.add(i,a,r)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var a=0;a<r;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var h=new e,d=new e,p=new e;return l.prototype.cartesianToCartographic=function(r,a){var i=this.scaleToGeodeticSurface(r,d);if(n(i)){var o=this.geodeticSurfaceNormal(i,h),s=e.subtract(r,i,p),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),E=u.sign(e.dot(s,r))*e.magnitude(s);return n(a)?(a.longitude=c,a.latitude=l,a.height=E,a):new t(c,l,E)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var a=0;a<r;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,r){n(r)||(r=new e);var a=t.x,i=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return e.multiplyByScalar(t,s,r)},l.prototype.transformPositionToScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._oneOverRadii,r)},l.prototype.transformPositionFromScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._radii,r)},l.prototype.equals=function(t){return this===t||n(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,a,i){a=r(a,0);var o=this._sqauredXOverSquaredZ;if(n(i)||(i=new e),i.x=0,i.y=0,i.z=t.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},l}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,r,n,a,i,o){"use strict";function u(e){this._ellipsoid=r(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,r){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return n(r)?(r.x=i,r.y=o,r.z=u,r):new e(i,o,u)},u.prototype.unproject=function(e,r){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,u=e.z;return n(r)?(r.longitude=i,r.latitude=o,r.height=u,r):new t(i,o,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";function t(t,r){this.start=e(t,0),this.stop=e(r,0)}return t}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i,o){"use strict";function u(e,r,n,a,i,o,u,s,c){this[0]=t(e,0),this[1]=t(a,0),this[2]=t(u,0),this[3]=t(r,0),this[4]=t(i,0),this[5]=t(s,0),this[6]=t(n,0),this[7]=t(o,0),this[8]=t(c,0)}function s(e){for(var t=0,r=0;r<9;++r){var n=e[r];t+=n*n}return Math.sqrt(t)}function c(e){for(var t=0,r=0;r<3;++r){var n=e[u.getElementIndex(d[r],h[r])];t+=2*n*n}return Math.sqrt(t)}function l(e,t){for(var r=o.EPSILON15,n=0,a=1,i=0;i<3;++i){var s=Math.abs(e[u.getElementIndex(d[i],h[i])]);s>n&&(a=i,n=s)}var c=1,l=0,E=h[a],f=d[a];if(Math.abs(e[u.getElementIndex(f,E)])>r){var p,m=e[u.getElementIndex(f,f)],_=e[u.getElementIndex(E,E)],T=e[u.getElementIndex(f,E)],y=(m-_)/2/T;p=y<0?-1/(-y+Math.sqrt(1+y*y)):1/(y+Math.sqrt(1+y*y)),c=1/Math.sqrt(1+p*p),l=p*c}return t=u.clone(u.IDENTITY,t),t[u.getElementIndex(E,E)]=t[u.getElementIndex(f,f)]=c,t[u.getElementIndex(f,E)]=l,t[u.getElementIndex(E,f)]=-l,t}u.packedLength=9,u.pack=function(e,r,n){return 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},u.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new u),a[0]=e[n++],a[1]=e[n++],a[2]=e[n++],a[3]=e[n++],a[4]=e[n++],a[5]=e[n++],a[6]=e[n++],a[7]=e[n++],a[8]=e[n++],a},u.clone=function(e,t){if(r(e))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):new u(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},u.fromArray=function(e,n,a){return n=t(n,0),r(a)||(a=new u),a[0]=e[n],a[1]=e[n+1],a[2]=e[n+2],a[3]=e[n+3],a[4]=e[n+4],a[5]=e[n+5],a[6]=e[n+6],a[7]=e[n+7],a[8]=e[n+8],a},u.fromColumnMajorArray=function(e,t){return u.clone(e,t)},u.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 u(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},u.fromQuaternion=function(e,t){var n=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,s=e.y*e.y,c=e.y*e.z,l=e.y*e.w,E=e.z*e.z,f=e.z*e.w,h=e.w*e.w,d=n-s-E+h,p=2*(a-f),m=2*(i+l),_=2*(a+f),T=-n+s-E+h,y=2*(c-o),R=2*(i-l),A=2*(c+o),v=-n-s+E+h;return r(t)?(t[0]=d,t[1]=_,t[2]=R,t[3]=p,t[4]=T,t[5]=A,t[6]=m,t[7]=y,t[8]=v,t):new u(d,p,m,_,T,y,R,A,v)},u.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),a=Math.cos(-e.heading),i=Math.cos(e.roll),o=Math.sin(-e.pitch),s=Math.sin(-e.heading),c=Math.sin(e.roll),l=n*a,E=-i*s+c*o*a,f=c*s+i*o*a,h=n*s,d=i*a+c*o*s,p=-o*i+i*o*s,m=-o,_=c*n,T=i*n;return r(t)?(t[0]=l,t[1]=h,t[2]=m,t[3]=E,t[4]=d,t[5]=_,t[6]=f,t[7]=p,t[8]=T,t):new u(l,E,f,h,d,p,m,_,T)},u.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 u(e.x,0,0,0,e.y,0,0,0,e.z)},u.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 u(e,0,0,0,e,0,0,0,e)},u.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 u(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},u.fromRotationX=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=a,t[6]=0,t[7]=-a,t[8]=n,t):new u(1,0,0,0,n,-a,0,a,n)},u.fromRotationY=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=n,t):new u(n,0,a,0,1,0,-a,0,n)},u.fromRotationZ=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=a,t[2]=0,t[3]=-a,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new u(n,-a,0,a,n,0,0,0,1)},u.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]]},u.getElementIndex=function(e,t){return 3*e+t},u.getColumn=function(e,t,r){var n=3*t,a=e[n],i=e[n+1],o=e[n+2];return r.x=a,r.y=i,r.z=o,r},u.setColumn=function(e,t,r,n){n=u.clone(e,n);var a=3*t;return n[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n},u.getRow=function(e,t,r){var n=e[t],a=e[t+3],i=e[t+6];return r.x=n,r.y=a,r.z=i,r},u.setRow=function(e,t,r,n){return n=u.clone(e,n),n[t]=r.x,n[t+3]=r.y,n[t+6]=r.z,n};var E=new e;u.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],E)),r.y=e.magnitude(e.fromElements(t[3],t[4],t[5],E)),r.z=e.magnitude(e.fromElements(t[6],t[7],t[8],E)),r};var f=new e;u.getMaximumScale=function(t){return u.getScale(t,f),e.maximumComponent(f)},u.multiply=function(e,t,r){var n=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=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],E=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return r[0]=n,r[1]=a,r[2]=i,r[3]=o,r[4]=u,r[5]=s,r[6]=c,r[7]=l,r[8]=E,r},u.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},u.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},u.multiplyByVector=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=e[0]*n+e[3]*a+e[6]*i,u=e[1]*n+e[4]*a+e[7]*i,s=e[2]*n+e[5]*a+e[8]*i;return r.x=o,r.y=u,r.z=s,r},u.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},u.multiplyByScale=function(e,t,r){return r[0]=e[0]*t.x,r[1]=e[1]*t.x,r[2]=e[2]*t.x,r[3]=e[3]*t.y,r[4]=e[4]*t.y,r[5]=e[5]*t.y,r[6]=e[6]*t.z,r[7]=e[7]*t.z,r[8]=e[8]*t.z,r},u.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},u.transpose=function(e,t){var r=e[0],n=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=r,t[1]=n,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var h=[1,0,0],d=[2,2,1],p=new u,m=new u;return u.computeEigenDecomposition=function(e,t){var n=o.EPSILON20,a=10,i=0,E=0;r(t)||(t={});for(var f=t.unitary=u.clone(u.IDENTITY,t.unitary),h=t.diagonal=u.clone(e,t.diagonal),d=n*s(h);E<a&&c(h)>d;)l(h,p),u.transpose(p,m),u.multiply(h,p,h),u.multiply(m,h,h),u.multiply(f,p,f),++i>2&&(++E,i=0);return t},u.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},u.determinant=function(e){var t=e[0],r=e[3],n=e[6],a=e[1],i=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*o)+a*(s*n-r*c)+u*(r*o-i*n)},u.inverse=function(e,t){var r=e[0],n=e[1],a=e[2],i=e[3],o=e[4],s=e[5],c=e[6],l=e[7],E=e[8],f=u.determinant(e);t[0]=o*E-l*s,t[1]=l*a-n*E,t[2]=n*s-o*a,t[3]=c*s-i*E,t[4]=r*E-c*a,t[5]=i*a-r*s,t[6]=i*l-c*o,t[7]=c*n-r*l,t[8]=r*o-i*n;var h=1/f;return u.multiplyByScalar(t,h,t)},u.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]},u.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},u.IDENTITY=i(new u(1,0,0,0,1,0,0,0,1)),u.ZERO=i(new u(0,0,0,0,0,0,0,0,0)),u.COLUMN0ROW0=0,u.COLUMN0ROW1=1,u.COLUMN0ROW2=2,u.COLUMN1ROW0=3,u.COLUMN1ROW1=4,u.COLUMN1ROW2=5,u.COLUMN2ROW0=6,u.COLUMN2ROW1=7,u.COLUMN2ROW2=8,n(u.prototype,{length:{get:function(){return u.packedLength}}}),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},u}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a){"use strict";function i(t,r,n,a){this.x=e(t,0),this.y=e(r,0),this.z=e(n,0),this.w=e(a,0)}i.fromElements=function(e,r,n,a,o){return t(o)?(o.x=e,o.y=r,o.z=n,o.w=a,o):new i(e,r,n,a)},i.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 i(e.red,e.green,e.blue,e.alpha)},i.clone=function(e,r){if(t(e))return t(r)?(r.x=e.x,r.y=e.y,r.z=e.z,r.w=e.w,r):new i(e.x,e.y,e.z,e.w)},i.packedLength=4,i.pack=function(t,r,n){return n=e(n,0),r[n++]=t.x,r[n++]=t.y,r[n++]=t.z,r[n]=t.w,r},i.unpack=function(r,n,a){return n=e(n,0),t(a)||(a=new i),a.x=r[n++],a.y=r[n++],a.z=r[n++],a.w=r[n],a},i.packArray=function(e,r){var n=e.length;t(r)?r.length=4*n:r=new Array(4*n);for(var a=0;a<n;++a)i.pack(e[a],r,4*a);return r},i.unpackArray=function(e,r){var n=e.length;t(r)?r.length=n/4:r=new Array(n/4);for(var a=0;a<n;a+=4){var o=a/4;r[o]=i.unpack(e,a,r[o])}return r},i.fromArray=i.unpack,i.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},i.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},i.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},i.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},i.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},i.magnitude=function(e){return Math.sqrt(i.magnitudeSquared(e))};var o=new i;i.distance=function(e,t){return i.subtract(e,t,o),i.magnitude(o)},i.distanceSquared=function(e,t){return i.subtract(e,t,o),i.magnitudeSquared(o)},i.normalize=function(e,t){var r=i.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t.z=e.z/r,t.w=e.w/r,t},i.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},i.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},i.divideComponents=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},i.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},i.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},i.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},i.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},i.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},i.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 u=new i;i.lerp=function(e,t,r,n){return i.multiplyByScalar(t,r,u),n=i.multiplyByScalar(e,1-r,n),i.add(u,n,n)};var s=new i;return i.mostOrthogonalAxis=function(e,t){var r=i.normalize(e,s);return i.abs(r,r),t=r.x<=r.y?r.x<=r.z?r.x<=r.w?i.clone(i.UNIT_X,t):i.clone(i.UNIT_W,t):r.z<=r.w?i.clone(i.UNIT_Z,t):i.clone(i.UNIT_W,t):r.y<=r.z?r.y<=r.w?i.clone(i.UNIT_Y,t):i.clone(i.UNIT_W,t):r.z<=r.w?i.clone(i.UNIT_Z,t):i.clone(i.UNIT_W,t)},i.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},i.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]&&e.w===t[r+3]},i.equalsEpsilon=function(e,r,n,i){return e===r||t(e)&&t(r)&&a.equalsEpsilon(e.x,r.x,n,i)&&a.equalsEpsilon(e.y,r.y,n,i)&&a.equalsEpsilon(e.z,r.z,n,i)&&a.equalsEpsilon(e.w,r.w,n,i)},i.ZERO=n(new i(0,0,0,0)),i.UNIT_X=n(new i(1,0,0,0)),i.UNIT_Y=n(new i(0,1,0,0)),i.UNIT_Z=n(new i(0,0,1,0)),i.UNIT_W=n(new i(0,0,0,1)),i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i.prototype.equalsEpsilon=function(e,t,r){return i.equalsEpsilon(this,e,t,r)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},i}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,r,n,a,i,o,u,s,c){"use strict";function l(e,t,n,a,i,o,u,s,c,l,E,f,h,d,p,m){this[0]=r(e,0),this[1]=r(i,0),this[2]=r(c,0),this[3]=r(h,0),this[4]=r(t,0), -this[5]=r(o,0),this[6]=r(l,0),this[7]=r(d,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(E,0),this[11]=r(p,0),this[12]=r(a,0),this[13]=r(s,0),this[14]=r(f,0),this[15]=r(m,0)}l.packedLength=16,l.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},l.unpack=function(e,t,a){return t=r(t,0),n(a)||(a=new l),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a[9]=e[t++],a[10]=e[t++],a[11]=e[t++],a[12]=e[t++],a[13]=e[t++],a[14]=e[t++],a[15]=e[t],a},l.clone=function(e,t){if(n(e))return n(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 l(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])},l.fromArray=l.unpack,l.fromColumnMajorArray=function(e,t){return l.clone(e,t)},l.fromRowMajorArray=function(e,t){return n(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 l(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])},l.fromRotationTranslation=function(t,a,i){return a=r(a,e.ZERO),n(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=a.x,i[13]=a.y,i[14]=a.z,i[15]=1,i):new l(t[0],t[3],t[6],a.x,t[1],t[4],t[7],a.y,t[2],t[5],t[8],a.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(e,t,r,a){n(a)||(a=new l);var i=r.x,o=r.y,u=r.z,s=t.x*t.x,c=t.x*t.y,E=t.x*t.z,f=t.x*t.w,h=t.y*t.y,d=t.y*t.z,p=t.y*t.w,m=t.z*t.z,_=t.z*t.w,T=t.w*t.w,y=s-h-m+T,R=2*(c-_),A=2*(E+p),v=2*(c+_),N=-s+h-m+T,S=2*(d-f),I=2*(E-p),M=2*(d+f),O=-s-h+m+T;return a[0]=y*i,a[1]=v*i,a[2]=I*i,a[3]=0,a[4]=R*o,a[5]=N*o,a[6]=M*o,a[7]=0,a[8]=A*u,a[9]=S*u,a[10]=O*u,a[11]=0,a[12]=e.x,a[13]=e.y,a[14]=e.z,a[15]=1,a},l.fromTranslationRotationScale=function(e,t){return l.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},l.fromTranslation=function(e,t){return l.fromRotationTranslation(s.IDENTITY,e,t)},l.fromScale=function(e,t){return n(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 l(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},l.fromUniformScale=function(e,t){return n(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 l(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var E=new e,f=new e,h=new e;l.fromCamera=function(t,r){var a=t.position,i=t.direction,o=t.up;e.normalize(i,E),e.normalize(e.cross(E,o,f),f),e.normalize(e.cross(f,E,h),h);var u=f.x,s=f.y,c=f.z,d=E.x,p=E.y,m=E.z,_=h.x,T=h.y,y=h.z,R=a.x,A=a.y,v=a.z,N=u*-R+s*-A+c*-v,S=_*-R+T*-A+y*-v,I=d*R+p*A+m*v;return n(r)?(r[0]=u,r[1]=_,r[2]=-d,r[3]=0,r[4]=s,r[5]=T,r[6]=-p,r[7]=0,r[8]=c,r[9]=y,r[10]=-m,r[11]=0,r[12]=N,r[13]=S,r[14]=I,r[15]=1,r):new l(u,s,c,N,_,T,y,S,-d,-p,-m,I,0,0,0,1)},l.computePerspectiveFieldOfView=function(e,t,r,n,a){var i=Math.tan(.5*e),o=1/i,u=o/t,s=(n+r)/(r-n),c=2*n*r/(r-n);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=c,a[15]=0,a},l.computeOrthographicOffCenter=function(e,t,r,n,a,i,o){var u=1/(t-e),s=1/(n-r),c=1/(i-a),l=-(t+e)*u,E=-(n+r)*s,f=-(i+a)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=E,o[14]=f,o[15]=1,o},l.computePerspectiveOffCenter=function(e,t,r,n,a,i,o){var u=2*a/(t-e),s=2*a/(n-r),c=(t+e)/(t-e),l=(n+r)/(n-r),E=-(i+a)/(i-a),f=-1,h=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=E,o[11]=f,o[12]=0,o[13]=0,o[14]=h,o[15]=0,o},l.computeInfinitePerspectiveOffCenter=function(e,t,r,n,a,i){var o=2*a/(t-e),u=2*a/(n-r),s=(t+e)/(t-e),c=(n+r)/(n-r),l=-1,E=-1,f=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=s,i[9]=c,i[10]=l,i[11]=E,i[12]=0,i[13]=0,i[14]=f,i[15]=0,i},l.computeViewportTransformation=function(e,t,n,a){e=r(e,r.EMPTY_OBJECT);var i=r(e.x,0),o=r(e.y,0),u=r(e.width,0),s=r(e.height,0);t=r(t,0),n=r(n,1);var c=.5*u,l=.5*s,E=.5*(n-t),f=c,h=l,d=E,p=i+c,m=o+l,_=t+E,T=1;return a[0]=f,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=h,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=d,a[11]=0,a[12]=p,a[13]=m,a[14]=_,a[15]=T,a},l.computeView=function(t,r,n,a,i){return i[0]=a.x,i[1]=n.x,i[2]=-r.x,i[3]=0,i[4]=a.y,i[5]=n.y,i[6]=-r.y,i[7]=0,i[8]=a.z,i[9]=n.z,i[10]=-r.z,i[11]=0,i[12]=-e.dot(a,t),i[13]=-e.dot(n,t),i[14]=e.dot(r,t),i[15]=1,i},l.toArray=function(e,t){return n(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]]},l.getElementIndex=function(e,t){return 4*e+t},l.getColumn=function(e,t,r){var n=4*t,a=e[n],i=e[n+1],o=e[n+2],u=e[n+3];return r.x=a,r.y=i,r.z=o,r.w=u,r},l.setColumn=function(e,t,r,n){n=l.clone(e,n);var a=4*t;return n[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n[a+3]=r.w,n},l.setTranslation=function(e,t,r){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]=t.x,r[13]=t.y,r[14]=t.z,r[15]=e[15],r},l.getRow=function(e,t,r){var n=e[t],a=e[t+4],i=e[t+8],o=e[t+12];return r.x=n,r.y=a,r.z=i,r.w=o,r},l.setRow=function(e,t,r,n){return n=l.clone(e,n),n[t]=r.x,n[t+4]=r.y,n[t+8]=r.z,n[t+12]=r.w,n};var d=new e;l.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],d)),r.y=e.magnitude(e.fromElements(t[4],t[5],t[6],d)),r.z=e.magnitude(e.fromElements(t[8],t[9],t[10],d)),r};var p=new e;l.getMaximumScale=function(t){return l.getScale(t,p),e.maximumComponent(p)},l.multiply=function(e,t,r){var n=e[0],a=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],E=e[8],f=e[9],h=e[10],d=e[11],p=e[12],m=e[13],_=e[14],T=e[15],y=t[0],R=t[1],A=t[2],v=t[3],N=t[4],S=t[5],I=t[6],M=t[7],O=t[8],g=t[9],C=t[10],w=t[11],P=t[12],x=t[13],L=t[14],U=t[15],b=n*y+u*R+E*A+p*v,F=a*y+s*R+f*A+m*v,D=i*y+c*R+h*A+_*v,B=o*y+l*R+d*A+T*v,z=n*N+u*S+E*I+p*M,G=a*N+s*S+f*I+m*M,V=i*N+c*S+h*I+_*M,q=o*N+l*S+d*I+T*M,X=n*O+u*g+E*C+p*w,H=a*O+s*g+f*C+m*w,W=i*O+c*g+h*C+_*w,k=o*O+l*g+d*C+T*w,Y=n*P+u*x+E*L+p*U,K=a*P+s*x+f*L+m*U,Z=i*P+c*x+h*L+_*U,j=o*P+l*x+d*L+T*U;return r[0]=b,r[1]=F,r[2]=D,r[3]=B,r[4]=z,r[5]=G,r[6]=V,r[7]=q,r[8]=X,r[9]=H,r[10]=W,r[11]=k,r[12]=Y,r[13]=K,r[14]=Z,r[15]=j,r},l.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},l.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},l.multiplyTransformation=function(e,t,r){var n=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],E=e[10],f=e[12],h=e[13],d=e[14],p=t[0],m=t[1],_=t[2],T=t[4],y=t[5],R=t[6],A=t[8],v=t[9],N=t[10],S=t[12],I=t[13],M=t[14],O=n*p+o*m+c*_,g=a*p+u*m+l*_,C=i*p+s*m+E*_,w=n*T+o*y+c*R,P=a*T+u*y+l*R,x=i*T+s*y+E*R,L=n*A+o*v+c*N,U=a*A+u*v+l*N,b=i*A+s*v+E*N,F=n*S+o*I+c*M+f,D=a*S+u*I+l*M+h,B=i*S+s*I+E*M+d;return r[0]=O,r[1]=g,r[2]=C,r[3]=0,r[4]=w,r[5]=P,r[6]=x,r[7]=0,r[8]=L,r[9]=U,r[10]=b,r[11]=0,r[12]=F,r[13]=D,r[14]=B,r[15]=1,r},l.multiplyByMatrix3=function(e,t,r){var n=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],E=e[10],f=t[0],h=t[1],d=t[2],p=t[3],m=t[4],_=t[5],T=t[6],y=t[7],R=t[8],A=n*f+o*h+c*d,v=a*f+u*h+l*d,N=i*f+s*h+E*d,S=n*p+o*m+c*_,I=a*p+u*m+l*_,M=i*p+s*m+E*_,O=n*T+o*y+c*R,g=a*T+u*y+l*R,C=i*T+s*y+E*R;return r[0]=A,r[1]=v,r[2]=N,r[3]=0,r[4]=S,r[5]=I,r[6]=M,r[7]=0,r[8]=O,r[9]=g,r[10]=C,r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r},l.multiplyByTranslation=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=n*e[0]+a*e[4]+i*e[8]+e[12],u=n*e[1]+a*e[5]+i*e[9]+e[13],s=n*e[2]+a*e[6]+i*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]=o,r[13]=u,r[14]=s,r[15]=e[15],r};var m=new e;l.multiplyByUniformScale=function(e,t,r){return m.x=t,m.y=t,m.z=t,l.multiplyByScale(e,m,r)},l.multiplyByScale=function(e,t,r){var n=t.x,a=t.y,i=t.z;return 1===n&&1===a&&1===i?l.clone(e,r):(r[0]=n*e[0],r[1]=n*e[1],r[2]=n*e[2],r[3]=0,r[4]=a*e[4],r[5]=a*e[5],r[6]=a*e[6],r[7]=0,r[8]=i*e[8],r[9]=i*e[9],r[10]=i*e[10],r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=1,r)},l.multiplyByVector=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=t.w,u=e[0]*n+e[4]*a+e[8]*i+e[12]*o,s=e[1]*n+e[5]*a+e[9]*i+e[13]*o,c=e[2]*n+e[6]*a+e[10]*i+e[14]*o,l=e[3]*n+e[7]*a+e[11]*i+e[15]*o;return r.x=u,r.y=s,r.z=c,r.w=l,r},l.multiplyByPointAsVector=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=e[0]*n+e[4]*a+e[8]*i,u=e[1]*n+e[5]*a+e[9]*i,s=e[2]*n+e[6]*a+e[10]*i;return r.x=o,r.y=u,r.z=s,r},l.multiplyByPoint=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=e[0]*n+e[4]*a+e[8]*i+e[12],u=e[1]*n+e[5]*a+e[9]*i+e[13],s=e[2]*n+e[6]*a+e[10]*i+e[14];return r.x=o,r.y=u,r.z=s,r},l.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},l.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},l.transpose=function(e,t){var r=e[1],n=e[2],a=e[3],i=e[6],o=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]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=o,t[14]=u,t[15]=e[15],t},l.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},l.equals=function(e,t){return e===t||n(e)&&n(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},l.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r&&Math.abs(e[9]-t[9])<=r&&Math.abs(e[10]-t[10])<=r&&Math.abs(e[11]-t[11])<=r&&Math.abs(e[12]-t[12])<=r&&Math.abs(e[13]-t[13])<=r&&Math.abs(e[14]-t[14])<=r&&Math.abs(e[15]-t[15])<=r},l.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},l.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};var _=new s,T=new s,y=new t,R=new t(0,0,0,1);return l.inverse=function(e,r){if(s.equalsEpsilon(l.getRotation(e,_),T,u.EPSILON7)&&t.equals(l.getRow(e,3,y),R))return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=0,r[11]=0,r[12]=-e[12],r[13]=-e[13],r[14]=-e[14],r[15]=1,r;var n=e[0],a=e[4],i=e[8],o=e[12],E=e[1],f=e[5],h=e[9],d=e[13],p=e[2],m=e[6],A=e[10],v=e[14],N=e[3],S=e[7],I=e[11],M=e[15],O=A*M,g=v*I,C=m*M,w=v*S,P=m*I,x=A*S,L=p*M,U=v*N,b=p*I,F=A*N,D=p*S,B=m*N,z=O*f+w*h+P*d-(g*f+C*h+x*d),G=g*E+L*h+F*d-(O*E+U*h+b*d),V=C*E+U*f+D*d-(w*E+L*f+B*d),q=x*E+b*f+B*h-(P*E+F*f+D*h),X=g*a+C*i+x*o-(O*a+w*i+P*o),H=O*n+U*i+b*o-(g*n+L*i+F*o),W=w*n+L*a+B*o-(C*n+U*a+D*o),k=P*n+F*a+D*i-(x*n+b*a+B*i);O=i*d,g=o*h,C=a*d,w=o*f,P=a*h,x=i*f,L=n*d,U=o*E,b=n*h,F=i*E,D=n*f,B=a*E;var Y=O*S+w*I+P*M-(g*S+C*I+x*M),K=g*N+L*I+F*M-(O*N+U*I+b*M),Z=C*N+U*S+D*M-(w*N+L*S+B*M),j=x*N+b*S+B*I-(P*N+F*S+D*I),Q=C*A+x*v+g*m-(P*v+O*m+w*A),J=b*v+O*p+U*A-(L*A+F*v+g*p),$=L*m+B*v+w*p-(D*v+C*p+U*m),ee=D*A+P*p+F*m-(b*m+B*A+x*p),te=n*z+a*G+i*V+o*q;if(Math.abs(te)<u.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return te=1/te,r[0]=z*te,r[1]=G*te,r[2]=V*te,r[3]=q*te,r[4]=X*te,r[5]=H*te,r[6]=W*te,r[7]=k*te,r[8]=Y*te,r[9]=K*te,r[10]=Z*te,r[11]=j*te,r[12]=Q*te,r[13]=J*te,r[14]=$*te,r[15]=ee*te,r},l.inverseTransformation=function(e,t){var r=e[0],n=e[1],a=e[2],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],E=e[12],f=e[13],h=e[14],d=-r*E-n*f-a*h,p=-i*E-o*f-u*h,m=-s*E-c*f-l*h;return t[0]=r,t[1]=i,t[2]=s,t[3]=0,t[4]=n,t[5]=o,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=l,t[11]=0,t[12]=d,t[13]=p,t[14]=m,t[15]=1,t},l.IDENTITY=o(new l(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),l.ZERO=o(new l(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN0ROW3=3,l.COLUMN1ROW0=4,l.COLUMN1ROW1=5,l.COLUMN1ROW2=6,l.COLUMN1ROW3=7,l.COLUMN2ROW0=8,l.COLUMN2ROW1=9,l.COLUMN2ROW2=10,l.COLUMN2ROW3=11,l.COLUMN3ROW0=12,l.COLUMN3ROW1=13,l.COLUMN3ROW2=14,l.COLUMN3ROW3=15,a(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]&&e[9]===t[r+9]&&e[10]===t[r+10]&&e[11]===t[r+11]&&e[12]===t[r+12]&&e[13]===t[r+13]&&e[14]===t[r+14]&&e[15]===t[r+15]},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.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]+")"},l}),define("Core/Rectangle",["./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,r,n,a,i,o,u){"use strict";function s(e,r,n,a){this.west=t(e,0),this.south=t(r,0),this.east=t(n,0),this.north=t(a,0)}n(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,r,n){return n=t(n,0),r[n++]=e.west,r[n++]=e.south,r[n++]=e.east,r[n]=e.north,r},s.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new s),a.west=e[n++],a.south=e[n++],a.east=e[n++],a.north=e[n],a},s.computeWidth=function(e){var t=e.east,r=e.west;return t<r&&(t+=u.TWO_PI),t-r},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,n,a,i,o){return e=u.toRadians(t(e,0)),n=u.toRadians(t(n,0)),a=u.toRadians(t(a,0)),i=u.toRadians(t(i,0)),r(o)?(o.west=e,o.south=n,o.east=a,o.north=i,o):new s(e,n,a,i)},s.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE,E=0,f=e.length;E<f;E++){var h=e[E];n=Math.min(n,h.longitude),a=Math.max(a,h.longitude),c=Math.min(c,h.latitude),l=Math.max(l,h.latitude);var d=h.longitude>=0?h.longitude:h.longitude+u.TWO_PI;i=Math.min(i,d),o=Math.max(o,d)}return a-n>o-i&&(n=i,a=o,a>u.PI&&(a-=u.TWO_PI),n>u.PI&&(n-=u.TWO_PI)),r(t)?(t.west=n,t.south=c,t.east=a,t.north=l,t):new s(n,c,a,l)},s.fromCartesianArray=function(e,t,n){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=Number.MAX_VALUE,E=-Number.MAX_VALUE,f=0,h=e.length;f<h;f++){var d=t.cartesianToCartographic(e[f]);a=Math.min(a,d.longitude),i=Math.max(i,d.longitude),l=Math.min(l,d.latitude),E=Math.max(E,d.latitude);var p=d.longitude>=0?d.longitude:d.longitude+u.TWO_PI;o=Math.min(o,p),c=Math.max(c,p)}return i-a>c-o&&(a=o,i=c,i>u.PI&&(i-=u.TWO_PI),a>u.PI&&(a-=u.TWO_PI)),r(n)?(n.west=a,n.south=l,n.east=i,n.north=E,n):new s(a,l,i,E)},s.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.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},s.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},s.validate=function(e){},s.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)},s.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)},s.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)},s.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)},s.center=function(t,n){var a=t.east,i=t.west;a<i&&(a+=u.TWO_PI);var o=u.negativePiToPi(.5*(i+a)),s=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=s,n.height=0,n):new e(o,s)},s.intersection=function(e,t,n){var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.negativePiToPi(Math.max(i,c)),E=u.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&E<=l)){var f=Math.max(e.south,t.south),h=Math.min(e.north,t.north);if(!(f>=h))return r(n)?(n.west=l,n.south=f,n.east=E,n.north=h,n):new s(l,f,E,h)}},s.simpleIntersection=function(e,t,n){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(i>=u||a>=o))return r(n)?(n.west=a,n.south=i,n.east=o,n.north=u,n):new s(a,i,o,u)},s.union=function(e,t,n){r(n)||(n=new s);var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.convertLongitudeRange(Math.min(i,c)),E=u.convertLongitudeRange(Math.max(a,o));return n.west=l,n.south=Math.min(e.south,t.south),n.east=E,n.north=Math.max(e.north,t.north),n},s.expand=function(e,t,n){return r(n)||(n=new s),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},s.contains=function(e,t){var r=t.longitude,n=t.latitude,a=e.west,i=e.east;return i<a&&(i+=u.TWO_PI,r<0&&(r+=u.TWO_PI)),(r>a||u.equalsEpsilon(r,a,u.EPSILON14))&&(r<i||u.equalsEpsilon(r,i,u.EPSILON14))&&n>=e.south&&n<=e.north};var c=new e;return s.subsample=function(e,n,a,o){n=t(n,i.WGS84),a=t(a,0),r(o)||(o=[]);var l=0,E=e.north,f=e.south,h=e.east,d=e.west,p=c;p.height=a,p.longitude=d,p.latitude=E,o[l]=n.cartographicToCartesian(p,o[l]),l++,p.longitude=h,o[l]=n.cartographicToCartesian(p,o[l]),l++,p.latitude=f,o[l]=n.cartographicToCartesian(p,o[l]),l++,p.longitude=d,o[l]=n.cartographicToCartesian(p,o[l]),l++,E<0?p.latitude=E:f>0?p.latitude=f:p.latitude=0;for(var m=1;m<8;++m)p.longitude=-Math.PI+m*u.PI_OVER_TWO,s.contains(e,p)&&(o[l]=n.cartographicToCartesian(p,o[l]),l++);return 0===p.latitude&&(p.longitude=d,o[l]=n.cartographicToCartesian(p,o[l]),l++,p.longitude=h,o[l]=n.cartographicToCartesian(p,o[l]),l++),o.length=l,o},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,r,n,a,i,o,u,s,c,l,E){"use strict";function f(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var h=new e,d=new e,p=new e,m=new e,_=new e,T=new e,y=new e,R=new e,A=new e,v=new e,N=new e,S=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 a=e.clone(t[0],y),i=e.clone(a,h),o=e.clone(a,d),u=e.clone(a,p),s=e.clone(a,m),c=e.clone(a,_),l=e.clone(a,T),E=t.length,I=1;I<E;I++){e.clone(t[I],a);var M=a.x,O=a.y,g=a.z;M<i.x&&e.clone(a,i),M>s.x&&e.clone(a,s),O<o.y&&e.clone(a,o),O>c.y&&e.clone(a,c),g<u.z&&e.clone(a,u),g>l.z&&e.clone(a,l)}var C=e.magnitudeSquared(e.subtract(s,i,R)),w=e.magnitudeSquared(e.subtract(c,o,R)),P=e.magnitudeSquared(e.subtract(l,u,R)),x=i,L=s,U=C;w>U&&(U=w,x=o,L=c),P>U&&(U=P,x=u,L=l);var b=A;b.x=.5*(x.x+L.x),b.y=.5*(x.y+L.y),b.z=.5*(x.z+L.z);var F=e.magnitudeSquared(e.subtract(L,b,R)),D=Math.sqrt(F),B=v;B.x=i.x,B.y=o.y,B.z=u.z;var z=N;z.x=s.x,z.y=c.y,z.z=l.z;var G=e.multiplyByScalar(e.add(B,z,R),.5,S),V=0;for(I=0;I<E;I++){e.clone(t[I],a);var q=e.magnitude(e.subtract(a,G,R));q>V&&(V=q);var X=e.magnitudeSquared(e.subtract(a,b,R));if(X>F){var H=Math.sqrt(X);D=.5*(D+H),F=D*D;var W=H-D;b.x=(D*b.x+W*a.x)/H,b.y=(D*b.y+W*a.y)/H,b.z=(D*b.z+W*a.z)/H}}return D<V?(e.clone(b,r.center),r.radius=D):(e.clone(G,r.center),r.radius=V),r};var I=new o,M=new e,O=new e,g=new t,C=new t;f.fromRectangle2D=function(e,t,r){return f.fromRectangleWithHeights2D(e,t,0,0,r)},f.fromRectangleWithHeights2D=function(t,a,i,o,u){if(n(u)||(u=new f),!n(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;a=r(a,I),E.southwest(t,g),g.height=i,E.northeast(t,C),C.height=o;var s=a.project(g,M),c=a.project(C,O),l=c.x-s.x,h=c.y-s.y,d=c.z-s.z;u.radius=.5*Math.sqrt(l*l+h*h+d*d);var p=u.center;return p.x=s.x+.5*l,p.y=s.y+.5*h,p.z=s.z+.5*d,u};var w=[];f.fromRectangle3D=function(e,t,a,o){t=r(t,i.WGS84),a=r(a,0);var u;return n(e)&&(u=E.subsample(e,t,a,w)),f.fromPoints(u,o)},f.fromVertices=function(t,a,i,o){if(n(o)||(o=new f),!n(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;a=r(a,e.ZERO),i=r(i,3);var u=y;u.x=t[0]+a.x,u.y=t[1]+a.y,u.z=t[2]+a.z;for(var s=e.clone(u,h),c=e.clone(u,d),l=e.clone(u,p),E=e.clone(u,m),I=e.clone(u,_),M=e.clone(u,T),O=t.length,g=0;g<O;g+=i){var C=t[g]+a.x,w=t[g+1]+a.y,P=t[g+2]+a.z;u.x=C,u.y=w,u.z=P,C<s.x&&e.clone(u,s),C>E.x&&e.clone(u,E),w<c.y&&e.clone(u,c),w>I.y&&e.clone(u,I),P<l.z&&e.clone(u,l),P>M.z&&e.clone(u,M)}var x=e.magnitudeSquared(e.subtract(E,s,R)),L=e.magnitudeSquared(e.subtract(I,c,R)),U=e.magnitudeSquared(e.subtract(M,l,R)),b=s,F=E,D=x;L>D&&(D=L,b=c,F=I),U>D&&(D=U,b=l,F=M);var B=A;B.x=.5*(b.x+F.x),B.y=.5*(b.y+F.y),B.z=.5*(b.z+F.z);var z=e.magnitudeSquared(e.subtract(F,B,R)),G=Math.sqrt(z),V=v;V.x=s.x,V.y=c.y,V.z=l.z;var q=N;q.x=E.x,q.y=I.y,q.z=M.z;var X=e.multiplyByScalar(e.add(V,q,R),.5,S),H=0;for(g=0;g<O;g+=i){u.x=t[g]+a.x,u.y=t[g+1]+a.y,u.z=t[g+2]+a.z;var W=e.magnitude(e.subtract(u,X,R));W>H&&(H=W);var k=e.magnitudeSquared(e.subtract(u,B,R));if(k>z){var Y=Math.sqrt(k);G=.5*(G+Y),z=G*G;var K=Y-G;B.x=(G*B.x+K*u.x)/Y,B.y=(G*B.y+K*u.y)/Y,B.z=(G*B.z+K*u.z)/Y}}return G<H?(e.clone(B,o.center),o.radius=G):(e.clone(X,o.center),o.radius=H),o},f.fromEncodedCartesianVertices=function(t,r,a){if(n(a)||(a=new f),!n(t)||!n(r)||t.length!==r.length||0===t.length)return a.center=e.clone(e.ZERO,a.center),a.radius=0,a;var i=y;i.x=t[0]+r[0],i.y=t[1]+r[1],i.z=t[2]+r[2];for(var o=e.clone(i,h),u=e.clone(i,d),s=e.clone(i,p),c=e.clone(i,m),l=e.clone(i,_),E=e.clone(i,T),I=t.length,M=0;M<I;M+=3){var O=t[M]+r[M],g=t[M+1]+r[M+1],C=t[M+2]+r[M+2];i.x=O,i.y=g,i.z=C,O<o.x&&e.clone(i,o),O>c.x&&e.clone(i,c),g<u.y&&e.clone(i,u),g>l.y&&e.clone(i,l),C<s.z&&e.clone(i,s),C>E.z&&e.clone(i,E)}var w=e.magnitudeSquared(e.subtract(c,o,R)),P=e.magnitudeSquared(e.subtract(l,u,R)),x=e.magnitudeSquared(e.subtract(E,s,R)),L=o,U=c,b=w;P>b&&(b=P,L=u,U=l),x>b&&(b=x,L=s,U=E);var F=A;F.x=.5*(L.x+U.x),F.y=.5*(L.y+U.y),F.z=.5*(L.z+U.z);var D=e.magnitudeSquared(e.subtract(U,F,R)),B=Math.sqrt(D),z=v;z.x=o.x,z.y=u.y,z.z=s.z;var G=N;G.x=c.x,G.y=l.y,G.z=E.z;var V=e.multiplyByScalar(e.add(z,G,R),.5,S),q=0;for(M=0;M<I;M+=3){i.x=t[M]+r[M],i.y=t[M+1]+r[M+1],i.z=t[M+2]+r[M+2];var X=e.magnitude(e.subtract(i,V,R));X>q&&(q=X);var H=e.magnitudeSquared(e.subtract(i,F,R));if(H>D){var W=Math.sqrt(H);B=.5*(B+W),D=B*B;var k=W-B;F.x=(B*F.x+k*i.x)/W,F.y=(B*F.y+k*i.y)/W,F.z=(B*F.z+k*i.z)/W}}return B<q?(e.clone(F,a.center),a.radius=B):(e.clone(V,a.center),a.radius=q),a},f.fromCornerPoints=function(t,r,a){n(a)||(a=new f);var i=a.center;return e.add(t,r,i),e.multiplyByScalar(i,.5,i),a.radius=e.distance(i,r),a},f.fromEllipsoid=function(t,r){return n(r)||(r=new f),e.clone(e.ZERO,r.center),r.radius=t.maximumRadius,r};var P=new e;f.fromBoundingSpheres=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;var a=t.length;if(1===a)return f.clone(t[0],r);if(2===a)return f.union(t[0],t[1],r);for(var i=[],o=0;o<a;o++)i.push(t[o].center);r=f.fromPoints(i,r);var u=r.center,s=r.radius;for(o=0;o<a;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,P)+c.radius)}return r.radius=s,r};var x=new e,L=new e,U=new e;f.fromOrientedBoundingBox=function(t,r){n(r)||(r=new f);var a=t.halfAxes,i=c.getColumn(a,0,x),o=c.getColumn(a,1,L),u=c.getColumn(a,2,U),s=e.magnitude(i),l=e.magnitude(o),E=e.magnitude(u);return r.center=e.clone(t.center,r.center),r.radius=Math.max(s,l,E),r},f.clone=function(t,r){if(n(t))return n(r)?(r.center=e.clone(t.center,r.center),r.radius=t.radius,r):new f(t.center,t.radius)},f.packedLength=4,f.pack=function(e,t,n){n=r(n,0);var a=e.center;return t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n]=e.radius,t},f.unpack=function(e,t,a){t=r(t,0),n(a)||(a=new f);var i=a.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],a.radius=e[t],a};var b=new e,F=new e;f.union=function(t,r,a){n(a)||(a=new f);var i=t.center,o=t.radius,u=r.center,s=r.radius,c=e.subtract(u,i,b),l=e.magnitude(c);if(o>=l+s)return t.clone(a),a;if(s>=l+o)return r.clone(a),a;var E=.5*(o+l+s),h=e.multiplyByScalar(c,(-o+E)/l,F);return e.add(h,i,h),e.clone(h,a.center),a.radius=E,a};var D=new e;f.expand=function(t,r,n){n=f.clone(t,n);var a=e.magnitude(e.subtract(r,n.center,D));return a>n.radius&&(n.radius=a),n},f.intersectPlane=function(t,r){var n=t.center,a=t.radius,i=r.normal,o=e.dot(i,n)+r.distance;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=l.multiplyByPoint(t,e.center,r.center),r.radius=l.getMaximumScale(t)*e.radius,r};var B=new e;f.distanceSquaredTo=function(t,r){var n=e.subtract(t.center,r,B);return e.magnitudeSquared(n)-t.radius*t.radius},f.transformWithoutScale=function(e,t,r){return n(r)||(r=new f),r.center=l.multiplyByPoint(t,e.center,r.center),r.radius=e.radius,r};var z=new e;f.computePlaneDistances=function(t,r,a,i){n(i)||(i=new s);var o=e.subtract(t.center,r,z),u=e.dot(a,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var G=new e,V=new e,q=new e,X=new e,H=new e,W=new t,k=new Array(8),Y=0;Y<8;++Y)k[Y]=new e;var K=new o;return f.projectTo2D=function(t,n,a){n=r(n,K);var i=n.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,G),c=e.cross(e.UNIT_Z,s,V);e.normalize(c,c);var l=e.cross(s,c,q);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var E=e.negate(l,H),h=e.negate(c,X),d=k,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,E,p),e.add(p,h,p),p=d[3],e.add(s,E,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,E,p),e.add(p,h,p),p=d[7],e.add(s,E,p),e.add(p,c,p);for(var m=d.length,_=0;_<m;++_){var T=d[_];e.add(o,T,T);var y=i.cartesianToCartographic(T,W);n.project(y,T)}a=f.fromPoints(d,a),o=a.center;var R=o.x,A=o.y,v=o.z;return o.x=v,o.y=R,o.z=A,a},f.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},f.equals=function(t,r){return t===r||n(t)&&n(r)&&e.equals(t.center,r.center)&&t.radius===r.radius},f.prototype.intersectPlane=function(e){return f.intersectPlane(this,e)},f.prototype.distanceSquaredTo=function(e){return f.distanceSquaredTo(this,e)},f.prototype.computePlaneDistances=function(e,t,r){return f.computePlaneDistances(this,e,t,r)},f.prototype.isOccluded=function(e){return f.isOccluded(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},a={};return t(a,{element:{get:function(){if(a.supportsFullscreen())return document[n.fullscreenElement]}},changeEventName:{get:function(){if(a.supportsFullscreen())return n.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return n.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[n.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.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 a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(n.requestFullscreen=a,r=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(n.requestFullscreen=a,r=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?n.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(n.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?n.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(n.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?n.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(n.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),n.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),n.fullscreenerror=a)}return r},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[n.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[n.exitFullscreen]()},a}),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;r<n;++r)t[r]=parseInt(t[r],10);return t}function a(){if(!t(A)&&(A=!1,!f())){var e=/ Chrome\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(A=!0,v=n(e[1]))}return A}function i(){return a()&&v}function o(){if(!t(N)&&(N=!1,!a()&&!f()&&/ Safari\/[\.0-9]+/.test(R.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(N=!0,S=n(e[1]))}return N}function u(){return o()&&S}function s(){if(!t(I)){I=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(R.userAgent);null!==e&&(I=!0,M=n(e[1]),M.isNightly=!!e[2])}return I}function c(){return s()&&M}function l(){if(!t(O)){O=!1;var e;"Microsoft Internet Explorer"===R.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(O=!0,g=n(e[1]))):"Netscape"===R.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(O=!0,g=n(e[1])))}return O}function E(){return l()&&g}function f(){if(!t(C)){C=!1;var e=/ Edge\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(C=!0,w=n(e[1]))}return C}function h(){return f()&&w}function d(){if(!t(P)){P=!1;var e=/Firefox\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(P=!0,x=n(e[1]))}return P}function p(){return t(L)||(L=/Windows/i.test(R.appVersion)),L}function m(){return d()&&x}function _(){return t(U)||(U="undefined"!=typeof PointerEvent&&(!t(R.pointerEnabled)||R.pointerEnabled)),U}function T(){ -if(!t(F)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var r=e.style.imageRendering;F=t(r)&&""!==r,F&&(b=r)}return F}function y(){return T()?b:void 0}var R;R="undefined"!=typeof navigator?navigator:{};var A,v,N,S,I,M,O,g,C,w,P,x,L,U,b,F,D={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:E,isEdge:f,edgeVersion:h,isFirefox:d,firefoxVersion:m,isWindows:p,hardwareConcurrency:e(R.hardwareConcurrency,3),supportsPointerEvents:_,supportsImageRenderingPixelated:T,imageRenderingValue:y};return D.supportsFullscreen=function(){return r.supportsFullscreen()},D.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},D.supportsWebWorkers=function(){return"undefined"!=typeof Worker},D}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,r,n,a,i){"use strict";if(!n.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){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.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},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 Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,r,n,a){switch(n=e(n,0),a=e(a,(r.byteLength-n)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(r,n,a);case o.UNSIGNED_BYTE:return new Uint8Array(r,n,a);case o.SHORT:return new Int16Array(r,n,a);case o.UNSIGNED_SHORT:return new Uint16Array(r,n,a);case o.INT:return new Int32Array(r,n,a);case o.UNSIGNED_INT:return new Uint32Array(r,n,a);case o.FLOAT:return new Float32Array(r,n,a);case o.DOUBLE:return new Float64Array(r,n,a)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var r={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,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,t,r,n,a){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,a.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,n.NONE),this.boundingSphereCV=t.boundingSphereCV}return i.computeNumberOfVertices=function(e){var r=-1;for(var n in e.attributes)if(e.attributes.hasOwnProperty(n)&&t(e.attributes[n])&&t(e.attributes[n].values)){var a=e.attributes[n],i=a.values.length/a.componentsPerAttribute;r=i}return r},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(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 n}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.binormal=t.binormal,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/Cartesian2",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a){"use strict";function i(t,r){this.x=e(t,0),this.y=e(r,0)}i.fromElements=function(e,r,n){return t(n)?(n.x=e,n.y=r,n):new i(e,r)},i.clone=function(e,r){if(t(e))return t(r)?(r.x=e.x,r.y=e.y,r):new i(e.x,e.y)},i.fromCartesian3=i.clone,i.fromCartesian4=i.clone,i.packedLength=2,i.pack=function(t,r,n){return n=e(n,0),r[n++]=t.x,r[n]=t.y,r},i.unpack=function(r,n,a){return n=e(n,0),t(a)||(a=new i),a.x=r[n++],a.y=r[n],a},i.packArray=function(e,r){var n=e.length;t(r)?r.length=2*n:r=new Array(2*n);for(var a=0;a<n;++a)i.pack(e[a],r,2*a);return r},i.unpackArray=function(e,r){var n=e.length;t(r)?r.length=n/2:r=new Array(n/2);for(var a=0;a<n;a+=2){var o=a/2;r[o]=i.unpack(e,a,r[o])}return r},i.fromArray=i.unpack,i.maximumComponent=function(e){return Math.max(e.x,e.y)},i.minimumComponent=function(e){return Math.min(e.x,e.y)},i.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r},i.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r},i.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},i.magnitude=function(e){return Math.sqrt(i.magnitudeSquared(e))};var o=new i;i.distance=function(e,t){return i.subtract(e,t,o),i.magnitude(o)},i.distanceSquared=function(e,t){return i.subtract(e,t,o),i.magnitudeSquared(o)},i.normalize=function(e,t){var r=i.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t},i.dot=function(e,t){return e.x*t.x+e.y*t.y},i.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r},i.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r},i.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r},i.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r},i.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r},i.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r},i.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},i.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var u=new i;i.lerp=function(e,t,r,n){return i.multiplyByScalar(t,r,u),n=i.multiplyByScalar(e,1-r,n),i.add(u,n,n)};var s=new i,c=new i;i.angleBetween=function(e,t){return i.normalize(e,s),i.normalize(t,c),a.acosClamped(i.dot(s,c))};var l=new i;return i.mostOrthogonalAxis=function(e,t){var r=i.normalize(e,l);return i.abs(r,r),t=r.x<=r.y?i.clone(i.UNIT_X,t):i.clone(i.UNIT_Y,t)},i.equals=function(e,r){return e===r||t(e)&&t(r)&&e.x===r.x&&e.y===r.y},i.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]},i.equalsEpsilon=function(e,r,n,i){return e===r||t(e)&&t(r)&&a.equalsEpsilon(e.x,r.x,n,i)&&a.equalsEpsilon(e.y,r.y,n,i)},i.ZERO=n(new i(0,0)),i.UNIT_X=n(new i(1,0)),i.UNIT_Y=n(new i(0,1)),i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i.prototype.equalsEpsilon=function(e,t,r){return i.equalsEpsilon(this,e,t,r)},i.prototype.toString=function(){return"("+this.x+", "+this.y+")"},i}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,r,n,a){"use strict";var i={};i.octEncodeInRange=function(e,t,r){if(r.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),r.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var n=r.x,i=r.y;r.x=(1-Math.abs(i))*a.signNotZero(n),r.y=(1-Math.abs(n))*a.signNotZero(i)}return r.x=a.toSNorm(r.x,t),r.y=a.toSNorm(r.y,t),r},i.octEncode=function(e,t){return i.octEncodeInRange(e,255,t)},i.octDecodeInRange=function(e,r,n,i){if(i.x=a.fromSNorm(e,n),i.y=a.fromSNorm(r,n),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){var o=i.x;i.x=(1-Math.abs(i.y))*a.signNotZero(o),i.y=(1-Math.abs(o))*a.signNotZero(i.y)}return t.normalize(i,i)},i.octDecode=function(e,t,r){return i.octDecodeInRange(e,t,255,r)},i.octPackFloat=function(e){return 256*e.x+e.y};var o=new e;return i.octEncodeFloat=function(e){return i.octEncode(e,o),i.octPackFloat(o)},i.octDecodeFloat=function(e,t){var r=e/256,n=Math.floor(r),a=256*(r-n);return i.octDecode(n,a,t)},i.octPack=function(e,t,r,n){var a=i.octEncodeFloat(e),u=i.octEncodeFloat(t),s=i.octEncode(r,o);return n.x=65536*s.x+a,n.y=65536*s.y+u,n},i.octUnpack=function(e,t,r,n){var a=e.x/65536,o=Math.floor(a),u=65536*(a-o);a=e.y/65536;var s=Math.floor(a),c=65536*(a-s);i.octDecodeFloat(u,t),i.octDecodeFloat(c,r),i.octDecode(o,s,n)},i.compressTextureCoordinates=function(e){var t=4095*e.x|0,r=4095*e.y|0;return 4096*t+r},i.decompressTextureCoordinates=function(e,t){var r=e/4096,n=Math.floor(r);return t.x=n/4095,t.y=(e-4096*n)/4095,t},i}),define("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function a(n,a,s,c,l){r(l)||(l=new t);var E,f,h,d,p,m,_,T;r(a.z)?(E=t.subtract(s,a,i),f=t.subtract(c,a,o),h=t.subtract(n,a,u),d=t.dot(E,E),p=t.dot(E,f),m=t.dot(E,h),_=t.dot(f,f),T=t.dot(f,h)):(E=e.subtract(s,a,i),f=e.subtract(c,a,o),h=e.subtract(n,a,u),d=e.dot(E,E),p=e.dot(E,f),m=e.dot(E,h),_=e.dot(f,f),T=e.dot(f,h));var y=1/(d*_-p*p);return l.y=(_*m-p*T)*y,l.z=(d*T-p*m)*y,l.x=1-l.y-l.z,l}var i=new t,o=new t,u=new t;return a}),define("Core/EncodedCartesian3",["./Cartesian3","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(){this.high=e.clone(e.ZERO),this.low=e.clone(e.ZERO)}n.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 a={high:0,low:0};n.fromCartesian=function(e,r){t(r)||(r=new n);var i=r.high,o=r.low;return n.encode(e.x,a),i.x=a.high,o.x=a.low,n.encode(e.y,a),i.y=a.high,o.y=a.low,n.encode(e.z,a),i.z=a.high,o.z=a.low,r};var i=new n;return n.writeElements=function(e,t,r){n.fromCartesian(e,i);var a=i.high,o=i.low;t[r]=a.x,t[r+1]=a.y,t[r+2]=a.z,t[r+3]=o.x,t[r+4]=o.y,t[r+5]=o.z},n}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,r,n,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(e){switch(e){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(t){return e(t)&&(t===i.UNSIGNED_BYTE||t===i.UNSIGNED_SHORT||t===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,r,a){return e>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,r,a):new Uint16Array(t,r,a)},r(i)}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function r(e,r,n){var a=e+r;return t.sign(e)!==t.sign(r)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(r)))<n?0:a}var n={};return n.computeDiscriminant=function(e,t,r){var n=t*t-4*e*r;return n},n.computeRealRoots=function(e,n,a){var i;if(0===e)return 0===n?[]:[-a/n];if(0===n){if(0===a)return[0,0];var o=Math.abs(a),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,i<0)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-n/e,i<0?[i,0]:[0,i];var c=n*n,l=4*e*a,E=r(c,-l,t.EPSILON14);if(E<0)return[];var f=-.5*r(n,t.sign(n)*Math.sqrt(E),t.EPSILON14);return n>0?[f/e,a/f]:[a/f,f/e]},n}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function r(e,t,r,n){var a,i,o=e,u=t/3,s=r/3,c=n,l=o*s,E=u*c,f=u*u,h=s*s,d=o*s-f,p=o*c-u*s,m=u*c-h,_=4*d*m-p*p;if(_<0){var T,y,R;f*E>=l*h?(T=o,y=d,R=-2*u*d+o*p):(T=c,y=m,R=-c*p+2*s*m);var A=R<0?-1:1,v=-A*Math.abs(T)*Math.sqrt(-_);i=-R+v;var N=i/2,S=N<0?-Math.pow(-N,1/3):Math.pow(N,1/3),I=i===v?-S:-y/S;return a=y<=0?S+I:-R/(S*S+I*I+y),f*E>=l*h?[(a-u)/o]:[-c/(a+s)]}var M=d,O=-2*u*d+o*p,g=m,C=-c*p+2*s*m,w=Math.sqrt(_),P=Math.sqrt(3)/2,x=Math.abs(Math.atan2(o*w,-O)/3);a=2*Math.sqrt(-M);var L=Math.cos(x);i=a*L;var U=a*(-L/2-P*Math.sin(x)),b=i+U>2*u?i-u:U-u,F=o,D=b/F;x=Math.abs(Math.atan2(c*w,-C)/3),a=2*Math.sqrt(-g),L=Math.cos(x),i=a*L,U=a*(-L/2-P*Math.sin(x));var B=-c,z=i+U<2*s?i+s:U+s,G=B/z,V=F*z,q=-b*z-F*B,X=b*B,H=(s*q-u*X)/(-u*q+s*V);return D<=H?D<=G?H<=G?[D,H,G]:[D,G,H]:[G,D,H]:D<=G?[H,D,G]:H<=G?[H,G,D]:[G,H,D]}var n={};return n.computeDiscriminant=function(e,t,r,n){var a=e*e,i=t*t,o=r*r,u=n*n,s=18*e*t*r*n+i*o-27*a*u-4*(e*o*r+i*t*n);return s},n.computeRealRoots=function(e,n,a,i){var o,u;if(0===e)return t.computeRealRoots(n,a,i);if(0===n){if(0===a){if(0===i)return[0,0,0];u=-i/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===i?(o=t.computeRealRoots(e,0,a),0===o.Length?[0]:[o[0],0,o[1]]):r(e,0,a,i)}return 0===a?0===i?(u=-n/e,u<0?[u,0,0]:[0,0,u]):r(e,n,0,i):0===i?(o=t.computeRealRoots(e,n,a),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):r(e,n,a,i)},n}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,r,n){"use strict";function a(t,a,i,o){var u=t*t,s=a-3*u/8,c=i-a*t/2+u*t/8,l=o-i*t/4+a*u/16-3*u*u/256,E=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(E.length>0){var f=-t/4,h=E[E.length-1];if(Math.abs(h)<r.EPSILON14){var d=n.computeRealRoots(1,s,l);if(2===d.length){var p,m=d[0],_=d[1];if(m>=0&&_>=0){var T=Math.sqrt(m),y=Math.sqrt(_);return[f-y,f-T,f+T,f+y]}if(m>=0&&_<0)return p=Math.sqrt(m),[f-p,f+p];if(m<0&&_>=0)return p=Math.sqrt(_),[f-p,f+p]}return[]}if(h>0){var R=Math.sqrt(h),A=(s+h-c/R)/2,v=(s+h+c/R)/2,N=n.computeRealRoots(1,R,A),S=n.computeRealRoots(1,-R,v);return 0!==N.length?(N[0]+=f,N[1]+=f,0!==S.length?(S[0]+=f,S[1]+=f,N[1]<=S[0]?[N[0],N[1],S[0],S[1]]:S[1]<=N[0]?[S[0],S[1],N[0],N[1]]:N[0]>=S[0]&&N[1]<=S[1]?[S[0],N[0],N[1],S[1]]:S[0]>=N[0]&&S[1]<=N[1]?[N[0],S[0],S[1],N[1]]:N[0]>S[0]&&N[0]<S[1]?[S[0],N[0],S[1],N[1]]:[N[0],S[0],N[1],S[1]]):N):0!==S.length?(S[0]+=f,S[1]+=f,S):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,E=i*t+s-4*o,f=c*o-i*a*t+u,h=e.computeRealRoots(1,l,E,f);if(h.length>0){var d,p,m=h[0],_=a-m,T=_*_,y=t/2,R=_/2,A=T-4*o,v=T+4*Math.abs(o),N=c-4*m,S=c+4*Math.abs(m);if(m<0||A*S<N*v){var I=Math.sqrt(N);d=I/2,p=0===I?0:(t*R-i)/I}else{var M=Math.sqrt(A);d=0===M?0:(t*R-i)/M,p=M/2}var O,g;0===y&&0===d?(O=0,g=0):r.sign(y)===r.sign(d)?(O=y+d,g=m/O):(g=y-d,O=m/g);var C,w;0===R&&0===p?(C=0,w=0):r.sign(R)===r.sign(p)?(C=R+p,w=o/C):(w=R-p,C=o/w);var P=n.computeRealRoots(1,O,C),x=n.computeRealRoots(1,g,w);if(0!==P.length)return 0!==x.length?P[1]<=x[0]?[P[0],P[1],x[0],x[1]]:x[1]<=P[0]?[x[0],x[1],P[0],P[1]]:P[0]>=x[0]&&P[1]<=x[1]?[x[0],P[0],P[1],x[1]]:x[0]>=P[0]&&x[1]<=P[1]?[P[0],x[0],x[1],P[1]]:P[0]>x[0]&&P[0]<x[1]?[x[0],P[0],x[1],P[1]]:[P[0],x[0],P[1],x[1]]:P;if(0!==x.length)return x}return[]}var o={};return o.computeDiscriminant=function(e,t,r,n,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=r*r,l=c*r,E=n*n,f=E*n,h=a*a,d=h*a,p=u*c*E-4*s*f-4*e*l*E+18*e*t*r*f-27*i*E*E+256*o*d+a*(18*s*r*n-4*u*l+16*e*c*c-80*e*t*c*n-6*e*u*E+144*i*r*E)+h*(144*e*u*r-27*u*u-128*i*c-192*i*t*n);return p},o.computeRealRoots=function(t,n,o,u,s){if(Math.abs(t)<r.EPSILON15)return e.computeRealRoots(n,o,u,s);var c=n/t,l=o/t,E=u/t,f=s/t,h=c<0?1:0;switch(h+=l<0?h+1:h,h+=E<0?h+1:h,h+=f<0?h+1:h){case 0:return a(c,l,E,f);case 1:return i(c,l,E,f);case 2:return i(c,l,E,f);case 3:return a(c,l,E,f);case 4:return a(c,l,E,f);case 5:return i(c,l,E,f);case 6:return a(c,l,E,f);case 7:return a(c,l,E,f);case 8:return i(c,l,E,f);case 9:return a(c,l,E,f);case 10:return a(c,l,E,f);case 11:return i(c,l,E,f);case 12:return a(c,l,E,f);case 13:return a(c,l,E,f);case 14:return a(c,l,E,f);case 15:return a(c,l,E,f);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function a(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 a.getPoint=function(t,n,a){return r(a)||(a=new e),a=e.multiplyByScalar(t.direction,n,a),e.add(t.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,r,n,a,i,o,u,s,c){"use strict";function l(e,t,r,n){var a=t*t-4*e*r;if(!(a<0)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return u<s?(n.root0=u,n.root1=s):(n.root0=s,n.root1=u),n}var c=-t/(2*e);if(0!==c)return n.root0=n.root1=c,n}}function E(t,r,a){n(a)||(a={});var i=t.origin,o=t.direction,u=r.center,s=r.radius*r.radius,c=e.subtract(i,u,_),E=e.dot(o,o),f=2*e.dot(o,c),h=e.magnitudeSquared(c)-s,d=l(E,f,h,A);if(n(d))return a.start=d.root0,a.stop=d.root1,a}function f(e,t,r){var n=e+t;return i.sign(e)!==i.sign(t)&&Math.abs(n/Math.max(Math.abs(e),Math.abs(t)))<r?0:n}function h(t,r,n,a,c){var l,E=a*a,h=c*c,d=(t[o.COLUMN1ROW1]-t[o.COLUMN2ROW2])*h,p=c*(a*f(t[o.COLUMN1ROW0],t[o.COLUMN0ROW1],i.EPSILON15)+r.y),m=t[o.COLUMN0ROW0]*E+t[o.COLUMN2ROW2]*h+a*r.x+n,_=h*f(t[o.COLUMN2ROW1],t[o.COLUMN1ROW2],i.EPSILON15),T=c*(a*f(t[o.COLUMN2ROW0],t[o.COLUMN0ROW2])+r.z),y=[];if(0===T&&0===_){if(l=u.computeRealRoots(d,p,m),0===l.length)return y;var R=l[0],A=Math.sqrt(Math.max(1-R*R,0));if(y.push(new e(a,c*R,c*-A)),y.push(new e(a,c*R,c*A)),2===l.length){var v=l[1],N=Math.sqrt(Math.max(1-v*v,0));y.push(new e(a,c*v,c*-N)),y.push(new e(a,c*v,c*N))}return y}var S=T*T,I=_*_,M=d*d,O=T*_,g=M+I,C=2*(p*d+O),w=2*m*d+p*p-I+S,P=2*(m*p-O),x=m*m-S;if(0===g&&0===C&&0===w&&0===P)return y;l=s.computeRealRoots(g,C,w,P,x);var L=l.length;if(0===L)return y;for(var U=0;U<L;++U){var b,F=l[U],D=F*F,B=Math.max(1-D,0),z=Math.sqrt(B);b=i.sign(d)===i.sign(m)?f(d*D+m,p*F,i.EPSILON12):i.sign(m)===i.sign(p*F)?f(d*D,p*F+m,i.EPSILON12):f(d*D+p*F,m,i.EPSILON12);var G=f(_*F,T,i.EPSILON15),V=b*G;V<0?y.push(new e(a,c*F,c*z)):V>0?y.push(new e(a,c*F,c*-z)):0!==z?(y.push(new e(a,c*F,c*-z)),y.push(new e(a,c*F,c*z)), -++U):y.push(new e(a,c*F,c*z))}return y}var d={};d.rayPlane=function(t,r,a){n(a)||(a=new e);var o=t.origin,u=t.direction,s=r.normal,c=e.dot(s,u);if(!(Math.abs(c)<i.EPSILON15)){var l=(-r.distance-e.dot(s,o))/c;if(!(l<0))return a=e.multiplyByScalar(u,l,a),e.add(o,a,a)}};var p=new e,m=new e,_=new e,T=new e,y=new e;d.rayTriangleParametric=function(t,n,a,o,u){u=r(u,!1);var s,c,l,E,f,h=t.origin,d=t.direction,R=e.subtract(a,n,p),A=e.subtract(o,n,m),v=e.cross(d,A,_),N=e.dot(R,v);if(u){if(N<i.EPSILON6)return;if(s=e.subtract(h,n,T),l=e.dot(s,v),l<0||l>N)return;if(c=e.cross(s,R,y),E=e.dot(d,c),E<0||l+E>N)return;f=e.dot(A,c)/N}else{if(Math.abs(N)<i.EPSILON6)return;var S=1/N;if(s=e.subtract(h,n,T),l=e.dot(s,v)*S,l<0||l>1)return;if(c=e.cross(s,R,y),E=e.dot(d,c)*S,E<0||l+E>1)return;f=e.dot(A,c)*S}return f},d.rayTriangle=function(t,r,a,i,o,u){var s=d.rayTriangleParametric(t,r,a,i,o);if(n(s)&&!(s<0))return n(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var R=new c;d.lineSegmentTriangle=function(t,r,a,i,o,u,s){var c=R;e.clone(t,c.origin),e.subtract(r,t,c.direction),e.normalize(c.direction,c.direction);var l=d.rayTriangleParametric(c,a,i,o,u);if(!(!n(l)||l<0||l>e.distance(t,r)))return n(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var A={root0:0,root1:0};d.raySphere=function(e,t,r){if(r=E(e,t,r),n(r)&&!(r.stop<0))return r.start=Math.max(r.start,0),r};var v=new c;d.lineSegmentSphere=function(t,r,a,i){var o=v;e.clone(t,o.origin);var u=e.subtract(r,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),i=E(o,a,i),!(!n(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var N=new e,S=new e;d.rayEllipsoid=function(t,r){var n,a,i,o,u,s=r.oneOverRadii,c=e.multiplyComponents(s,t.origin,N),l=e.multiplyComponents(s,t.direction,S),E=e.magnitudeSquared(c),f=e.dot(c,l);if(E>1){if(f>=0)return;var h=f*f;if(n=E-1,a=e.magnitudeSquared(l),i=a*n,h<i)return;if(h>i){o=f*f-i,u=-f+Math.sqrt(o);var d=u/a,p=n/u;return d<p?{start:d,stop:p}:{start:p,stop:d}}var m=Math.sqrt(n/a);return{start:m,stop:m}}return E<1?(n=E-1,a=e.magnitudeSquared(l),i=a*n,o=f*f-i,u=-f+Math.sqrt(o),{start:0,stop:u/a}):f<0?(a=e.magnitudeSquared(l),{start:0,stop:-f/a}):void 0};var I=new e,M=new e,O=new e,g=new e,C=new e,w=new o,P=new o,x=new o,L=new o,U=new o,b=new o,F=new o,D=new e,B=new e,z=new t;d.grazingAltitudeLocation=function(t,r){var a=t.origin,u=t.direction;if(!e.equals(a,e.ZERO)){var s=r.geodeticSurfaceNormal(a,I);if(e.dot(u,s)>=0)return a}var c=n(this.rayEllipsoid(t,r)),l=r.transformPositionToScaledSpace(u,I),E=e.normalize(l,l),f=e.mostOrthogonalAxis(l,g),d=e.normalize(e.cross(f,E,M),M),p=e.normalize(e.cross(E,d,O),O),m=w;m[0]=E.x,m[1]=E.y,m[2]=E.z,m[3]=d.x,m[4]=d.y,m[5]=d.z,m[6]=p.x,m[7]=p.y,m[8]=p.z;var _=o.transpose(m,P),T=o.fromScale(r.radii,x),y=o.fromScale(r.oneOverRadii,L),R=U;R[0]=0,R[1]=-u.z,R[2]=u.y,R[3]=u.z,R[4]=0,R[5]=-u.x,R[6]=-u.y,R[7]=u.x,R[8]=0;var A,v,N=o.multiply(o.multiply(_,y,b),R,b),S=o.multiply(o.multiply(N,T,F),m,F),G=o.multiplyByVector(N,a,C),V=h(S,e.negate(G,I),0,0,1),q=V.length;if(q>0){for(var X=e.clone(e.ZERO,B),H=Number.NEGATIVE_INFINITY,W=0;W<q;++W){A=o.multiplyByVector(T,o.multiplyByVector(m,V[W],D),D);var k=e.normalize(e.subtract(A,a,g),g),Y=e.dot(k,u);Y>H&&(H=Y,X=e.clone(A,X))}var K=r.cartesianToCartographic(X,z);return H=i.clamp(H,0,1),v=e.magnitude(e.subtract(X,a,g))*Math.sqrt(1-H*H),v=c?-v:v,K.height=v,r.cartographicToCartesian(K,new e)}};var G=new e;return d.lineSegmentPlane=function(t,r,a,o){n(o)||(o=new e);var u=e.subtract(r,t,G),s=a.normal,c=e.dot(s,u);if(!(Math.abs(c)<i.EPSILON6)){var l=e.dot(s,t),E=-(a.distance+l)/c;if(!(E<0||E>1))return e.multiplyByScalar(u,E,o),e.add(t,o,o),o}},d.trianglePlaneIntersection=function(t,r,n,a){var i=a.normal,o=a.distance,u=e.dot(i,t)+o<0,s=e.dot(i,r)+o<0,c=e.dot(i,n)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var E,f;if(1!==l&&2!==l||(E=new e,f=new e),1===l){if(u)return d.lineSegmentPlane(t,r,a,E),d.lineSegmentPlane(t,n,a,f),{positions:[t,r,n,E,f],indices:[0,3,4,1,2,4,1,4,3]};if(s)return d.lineSegmentPlane(r,n,a,E),d.lineSegmentPlane(r,t,a,f),{positions:[t,r,n,E,f],indices:[1,3,4,2,0,4,2,4,3]};if(c)return d.lineSegmentPlane(n,t,a,E),d.lineSegmentPlane(n,r,a,f),{positions:[t,r,n,E,f],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return d.lineSegmentPlane(r,t,a,E),d.lineSegmentPlane(n,t,a,f),{positions:[t,r,n,E,f],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return d.lineSegmentPlane(n,r,a,E),d.lineSegmentPlane(t,r,a,f),{positions:[t,r,n,E,f],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return d.lineSegmentPlane(t,n,a,E),d.lineSegmentPlane(r,n,a,f),{positions:[t,r,n,E,f],indices:[0,1,4,0,4,3,2,3,4]}}},d}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,r,n){"use strict";function a(t,r){this.normal=e.clone(t),this.distance=r}a.fromPointNormal=function(r,n,i){var o=-e.dot(n,r);return t(i)?(e.clone(n,i.normal),i.distance=o,i):new a(n,o)};var i=new e;return a.fromCartesian4=function(r,n){var o=e.fromCartesian4(r,i),u=r.w;return t(n)?(e.clone(o,n.normal),n.distance=u,n):new a(o,u)},a.getPointDistance=function(t,r){return e.dot(t.normal,r)+t.distance},a.ORIGIN_XY_PLANE=n(new a(e.UNIT_Z,0)),a.ORIGIN_YZ_PLANE=n(new a(e.UNIT_X,0)),a.ORIGIN_ZX_PLANE=n(new a(e.UNIT_Y,0)),a}),define("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";var n={};return n.calculateACMR=function(r){r=e(r,e.EMPTY_OBJECT);var n=r.indices,a=r.maximumIndex,i=e(r.cacheSize,24),o=n.length;if(!t(a)){a=0;for(var u=0,s=n[u];u<o;)s>a&&(a=s),++u,s=n[u]}for(var c=[],l=0;l<a+1;l++)c[l]=0;for(var E=i+1,f=0;f<o;++f)E-c[n[f]]>i&&(c[n[f]]=E,++E);return(E-i+1)/(o/3)},n.tipsify=function(r){function n(e,t,r,n){for(;t.length>=1;){var a=t[t.length-1];if(t.splice(t.length-1,1),e[a].numLiveTriangles>0)return a}for(;i<n;){if(e[i].numLiveTriangles>0)return++i,i-1;++i}return-1}function a(e,t,r,a,i,o,u){for(var s,c=-1,l=-1,E=0;E<r.length;){var f=r[E];a[f].numLiveTriangles&&(s=0,i-a[f].timeStamp+2*a[f].numLiveTriangles<=t&&(s=i-a[f].timeStamp),(s>l||l===-1)&&(l=s,c=f)),++E}return c===-1?n(a,o,e,u):c}r=e(r,e.EMPTY_OBJECT);var i,o=r.indices,u=r.maximumIndex,s=e(r.cacheSize,24),c=o.length,l=0,E=0,f=o[E],h=c;if(t(u))l=u+1;else{for(;E<h;)f>l&&(l=f),++E,f=o[E];if(l===-1)return 0;++l}for(var d=[],p=0;p<l;p++)d[p]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};E=0;for(var m=0;E<h;)d[o[E]].vertexTriangles.push(m),++d[o[E]].numLiveTriangles,d[o[E+1]].vertexTriangles.push(m),++d[o[E+1]].numLiveTriangles,d[o[E+2]].vertexTriangles.push(m),++d[o[E+2]].numLiveTriangles,++m,E+=3;var _=0,T=s+1;i=1;var y,R,A=[],v=[],N=0,S=[],I=c/3,M=[];for(p=0;p<I;p++)M[p]=!1;for(var O,g;_!==-1;){A=[],R=d[_],g=R.vertexTriangles.length;for(var C=0;C<g;++C)if(m=R.vertexTriangles[C],!M[m]){M[m]=!0,E=m+m+m;for(var w=0;w<3;++w)O=o[E],A.push(O),v.push(O),S[N]=O,++N,y=d[O],--y.numLiveTriangles,T-y.timeStamp>s&&(y.timeStamp=T,++T),++E}_=a(o,s,A,d,T,v,l)}return S},n}),define("Core/GeometryPipeline",["./AttributeCompression","./barycentricCoordinates","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EncodedCartesian3","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryType","./IndexDatatype","./Intersect","./IntersectionTests","./Math","./Matrix3","./Matrix4","./Plane","./PrimitiveType","./Tipsify"],function(e,t,r,n,a,i,o,u,s,c,l,E,f,h,d,p,m,_,T,y,R,A,v,N,S){"use strict";function I(e,t,r,n,a){e[t++]=r,e[t++]=n,e[t++]=n,e[t++]=a,e[t++]=a,e[t]=r}function M(e){for(var t=e.length,r=t/3*6,n=m.createTypedArray(t,r),a=0,i=0;i<t;i+=3,a+=6)I(n,a,e[i],e[i+1],e[i+2]);return n}function O(e){var t=e.length;if(t>=3){var r=6*(t-2),n=m.createTypedArray(t,r);I(n,0,e[0],e[1],e[2]);for(var a=6,i=3;i<t;++i,a+=6)I(n,a,e[i-1],e[i],e[i-2]);return n}return new Uint16Array}function g(e){if(e.length>0){for(var t=e.length-1,r=6*(t-1),n=m.createTypedArray(t,r),a=e[0],i=0,o=1;o<t;++o,i+=6)I(n,i,a,e[o],e[o+1]);return n}return new Uint16Array}function C(e){var t={};for(var r in e)if(e.hasOwnProperty(r)&&c(e[r])&&c(e[r].values)){var n=e[r];t[r]=new d({componentDatatype:n.componentDatatype,componentsPerAttribute:n.componentsPerAttribute,normalize:n.normalize,values:[]})}return t}function w(e,t,r){for(var n in t)if(t.hasOwnProperty(n)&&c(t[n])&&c(t[n].values))for(var a=t[n],i=0;i<a.componentsPerAttribute;++i)e[n].values.push(a.values[r*a.componentsPerAttribute+i])}function P(e,t){if(c(t))for(var r=t.values,n=r.length,i=0;i<n;i+=3)a.unpack(r,i,ie),A.multiplyByPoint(e,ie,ie),a.pack(ie,r,i)}function x(e,t){if(c(t))for(var r=t.values,n=r.length,i=0;i<n;i+=3)a.unpack(r,i,ie),R.multiplyByVector(e,ie,ie),ie=a.normalize(ie,ie),a.pack(ie,r,i)}function L(e,t){var r,n=e.length,a={},i=e[0][t].attributes;for(r in i)if(i.hasOwnProperty(r)&&c(i[r])&&c(i[r].values)){for(var o=i[r],s=o.values.length,l=!0,E=1;E<n;++E){var f=e[E][t].attributes[r];if(!c(f)||o.componentDatatype!==f.componentDatatype||o.componentsPerAttribute!==f.componentsPerAttribute||o.normalize!==f.normalize){l=!1;break}s+=f.values.length}l&&(a[r]=new d({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:u.createTypedArray(o.componentDatatype,s)}))}return a}function U(e,t){var n,i,o,u,s,l,E,f=e.length,d=(e[0].modelMatrix,c(e[0][t].indices)),p=e[0][t].primitiveType,_=L(e,t);for(n in _)if(_.hasOwnProperty(n))for(s=_[n].values,u=0,i=0;i<f;++i)for(l=e[i][t].attributes[n].values,E=l.length,o=0;o<E;++o)s[u++]=l[o];var T;if(d){var y=0;for(i=0;i<f;++i)y+=e[i][t].indices.length;var R=h.computeNumberOfVertices(new h({attributes:_,primitiveType:N.POINTS})),A=m.createTypedArray(R,y),v=0,S=0;for(i=0;i<f;++i){var I=e[i][t].indices,M=I.length;for(u=0;u<M;++u)A[v++]=S+I[u];S+=h.computeNumberOfVertices(e[i][t])}T=A}var O,g=new a,C=0;for(i=0;i<f;++i){if(O=e[i][t].boundingSphere,!c(O)){g=void 0;break}a.add(O.center,g,g)}if(c(g))for(a.divideByScalar(g,f,g),i=0;i<f;++i){O=e[i][t].boundingSphere;var w=a.magnitude(a.subtract(O.center,g,se))+O.radius;w>C&&(C=w)}return new h({attributes:_,indices:T,primitiveType:p,boundingSphere:c(g)?new r(g,C):void 0})}function b(e){if(c(e.indices))return e;for(var t=h.computeNumberOfVertices(e),r=m.createTypedArray(t,t),n=0;n<t;++n)r[n]=n;return e.indices=r,e}function F(e){var t=h.computeNumberOfVertices(e),r=m.createTypedArray(t,3*(t-2));r[0]=1,r[1]=0,r[2]=2;for(var n=3,a=3;a<t;++a)r[n++]=a-1,r[n++]=0,r[n++]=a;return e.indices=r,e.primitiveType=N.TRIANGLES,e}function D(e){var t=h.computeNumberOfVertices(e),r=m.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,a=3;a<t-1;a+=2)r[n++]=a,r[n++]=a-1,r[n++]=a+1,a+2<t&&(r[n++]=a,r[n++]=a+1,r[n++]=a+2);return e.indices=r,e.primitiveType=N.TRIANGLES,e}function B(e){if(c(e.indices))return e;for(var t=h.computeNumberOfVertices(e),r=m.createTypedArray(t,t),n=0;n<t;++n)r[n]=n;return e.indices=r,e}function z(e){var t=h.computeNumberOfVertices(e),r=m.createTypedArray(t,2*(t-1));r[0]=0,r[1]=1;for(var n=2,a=2;a<t;++a)r[n++]=a-1,r[n++]=a;return e.indices=r,e.primitiveType=N.LINES,e}function G(e){var t=h.computeNumberOfVertices(e),r=m.createTypedArray(t,2*t);r[0]=0,r[1]=1;for(var n=2,a=2;a<t;++a)r[n++]=a-1,r[n++]=a;return r[n++]=t-1,r[n]=0,e.indices=r,e.primitiveType=N.LINES,e}function V(e){switch(e.primitiveType){case N.TRIANGLE_FAN:return F(e);case N.TRIANGLE_STRIP:return D(e);case N.TRIANGLES:return b(e);case N.LINE_STRIP:return z(e);case N.LINE_LOOP:return G(e);case N.LINES:return B(e)}return e}function q(e,t){Math.abs(e.y)<y.EPSILON6&&(t?e.y=-y.EPSILON6:e.y=y.EPSILON6)}function X(e,t,r){if(0!==e.y&&0!==t.y&&0!==r.y)return q(e,e.y<0),q(t,t.y<0),void q(r,r.y<0);var n,a=Math.abs(e.y),i=Math.abs(t.y),o=Math.abs(r.y);n=a>i?a>o?y.sign(e.y):y.sign(r.y):i>o?y.sign(t.y):y.sign(r.y);var u=n<0;q(e,u),q(t,u),q(r,u)}function H(e,t,r,n){a.add(e,a.multiplyByScalar(a.subtract(t,e,Re),e.y/(e.y-t.y),Re),r),a.clone(r,n),q(r,!0),q(n,!1)}function W(e,t,r){if(!(e.x>=0||t.x>=0||r.x>=0)){X(e,t,r);var n=e.y<0,a=t.y<0,i=r.y<0,o=0;o+=n?1:0,o+=a?1:0,o+=i?1:0;var u=Ie.indices;1===o?(u[1]=3,u[2]=4,u[5]=6,u[7]=6,u[8]=5,n?(H(e,t,Ae,Ne),H(e,r,ve,Se),u[0]=0,u[3]=1,u[4]=2,u[6]=1):a?(H(t,r,Ae,Ne),H(t,e,ve,Se),u[0]=1,u[3]=2,u[4]=0,u[6]=2):i&&(H(r,e,Ae,Ne),H(r,t,ve,Se),u[0]=2,u[3]=0,u[4]=1,u[6]=0)):2===o&&(u[2]=4,u[4]=4,u[5]=3,u[7]=5,u[8]=6,n?a?i||(H(r,e,Ae,Ne),H(r,t,ve,Se),u[0]=0,u[1]=1,u[3]=0,u[6]=2):(H(t,r,Ae,Ne),H(t,e,ve,Se),u[0]=2,u[1]=0,u[3]=2,u[6]=1):(H(e,t,Ae,Ne),H(e,r,ve,Se),u[0]=1,u[1]=2,u[3]=1,u[6]=0));var s=Ie.positions;return s[0]=e,s[1]=t,s[2]=r,s.length=3,1!==o&&2!==o||(s[3]=Ae,s[4]=ve,s[5]=Ne,s[6]=Se,s.length=7),Ie}}function k(e,t){var n=e.attributes;if(0!==n.position.values.length){for(var a in n)if(n.hasOwnProperty(a)&&c(n[a])&&c(n[a].values)){var i=n[a];i.values=u.createTypedArray(i.componentDatatype,i.values)}var o=h.computeNumberOfVertices(e);return e.indices=m.createTypedArray(o,e.indices),t&&(e.boundingSphere=r.fromVertices(n.position.values)),e}}function Y(e){var t=e.attributes,r={};for(var n in t)if(t.hasOwnProperty(n)&&c(t[n])&&c(t[n].values)){var a=t[n];r[n]=new d({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:[]})}return new h({attributes:r,indices:[],primitiveType:e.primitiveType})}function K(e,t,r){var n=c(e.geometry.boundingSphere);t=k(t,n),r=k(r,n),c(r)&&!c(t)?e.geometry=r:!c(r)&&c(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=r,e.geometry=void 0)}function Z(e,r,i,o,u,s,l,E,f,h,d){if(c(s)||c(l)||c(E)||c(f)){var p=a.fromArray(u,3*e,Me),m=a.fromArray(u,3*r,Oe),_=a.fromArray(u,3*i,ge),T=t(o,p,m,_,Ce);if(c(s)){var y=a.fromArray(s,3*e,Me),R=a.fromArray(s,3*r,Oe),A=a.fromArray(s,3*i,ge);a.multiplyByScalar(y,T.x,y),a.multiplyByScalar(R,T.y,R),a.multiplyByScalar(A,T.z,A);var v=a.add(y,R,y);a.add(v,A,v),a.normalize(v,v),a.pack(v,h.normal.values,3*d)}if(c(l)){var N=a.fromArray(l,3*e,Me),S=a.fromArray(l,3*r,Oe),I=a.fromArray(l,3*i,ge);a.multiplyByScalar(N,T.x,N),a.multiplyByScalar(S,T.y,S),a.multiplyByScalar(I,T.z,I);var M=a.add(N,S,N);a.add(M,I,M),a.normalize(M,M),a.pack(M,h.binormal.values,3*d)}if(c(E)){var O=a.fromArray(E,3*e,Me),g=a.fromArray(E,3*r,Oe),C=a.fromArray(E,3*i,ge);a.multiplyByScalar(O,T.x,O),a.multiplyByScalar(g,T.y,g),a.multiplyByScalar(C,T.z,C);var w=a.add(O,g,O);a.add(w,C,w),a.normalize(w,w),a.pack(w,h.tangent.values,3*d)}if(c(f)){var P=n.fromArray(f,2*e,we),x=n.fromArray(f,2*r,Pe),L=n.fromArray(f,2*i,xe);n.multiplyByScalar(P,T.x,P),n.multiplyByScalar(x,T.y,x),n.multiplyByScalar(L,T.z,L);var U=n.add(P,x,P);n.add(U,L,U),n.pack(U,h.st.values,2*d)}}}function j(e,t,r,n,a,i){var o=e.position.values.length/3;if(a!==-1){var u=n[a],s=r[u];return s===-1?(r[u]=o,e.position.values.push(i.x,i.y,i.z),t.push(o),o):(t.push(s),s)}return e.position.values.push(i.x,i.y,i.z),t.push(o),o}function Q(e){var t,r,n,i,o,u=e.geometry,s=u.attributes,l=s.position.values,E=c(s.normal)?s.normal.values:void 0,f=c(s.binormal)?s.binormal.values:void 0,h=c(s.tangent)?s.tangent.values:void 0,d=c(s.st)?s.st.values:void 0,p=u.indices,m=Y(u),_=Y(u),T=[];T.length=l.length/3;var y=[];for(y.length=l.length/3,o=0;o<T.length;++o)T[o]=-1,y[o]=-1;var R=p.length;for(o=0;o<R;o+=3){var A=p[o],v=p[o+1],N=p[o+2],S=a.fromArray(l,3*A),I=a.fromArray(l,3*v),M=a.fromArray(l,3*N),O=W(S,I,M);if(c(O)&&O.positions.length>3)for(var g=O.positions,C=O.indices,w=C.length,P=0;P<w;++P){var x=C[P],L=g[x];L.y<0?(t=_.attributes,r=_.indices,n=T):(t=m.attributes,r=m.indices,n=y),i=j(t,r,n,p,x<3?o+x:-1,L),Z(A,v,N,L,l,E,f,h,d,t,i)}else c(O)&&(S=O.positions[0],I=O.positions[1],M=O.positions[2]),S.y<0?(t=_.attributes,r=_.indices,n=T):(t=m.attributes,r=m.indices,n=y),i=j(t,r,n,p,o,S),Z(A,v,N,S,l,E,f,h,d,t,i),i=j(t,r,n,p,o+1,I),Z(A,v,N,I,l,E,f,h,d,t,i),i=j(t,r,n,p,o+2,M),Z(A,v,N,M,l,E,f,h,d,t,i)}K(e,_,m)}function J(e){var t,r=e.geometry,n=r.attributes,i=n.position.values,o=r.indices,u=Y(r),s=Y(r),l=o.length,E=[];E.length=i.length/3;var f=[];for(f.length=i.length/3,t=0;t<E.length;++t)E[t]=-1,f[t]=-1;for(t=0;t<l;t+=2){var h=o[t],d=o[t+1],p=a.fromArray(i,3*h,Me),m=a.fromArray(i,3*d,Oe);Math.abs(p.y)<y.EPSILON6&&(p.y<0?p.y=-y.EPSILON6:p.y=y.EPSILON6),Math.abs(m.y)<y.EPSILON6&&(m.y<0?m.y=-y.EPSILON6:m.y=y.EPSILON6);var _=u.attributes,R=u.indices,A=f,v=s.attributes,N=s.indices,S=E,I=T.lineSegmentPlane(p,m,Le,ge);if(c(I)){var M=a.multiplyByScalar(a.UNIT_Y,5*y.EPSILON9,Ue);p.y<0&&(a.negate(M,M),_=s.attributes,R=s.indices,A=E,v=u.attributes,N=u.indices,S=f);var O=a.add(I,M,be);j(_,R,A,o,t,p),j(_,R,A,o,-1,O),a.negate(M,M),a.add(I,M,O),j(v,N,S,o,-1,O),j(v,N,S,o,t+1,m)}else{var g,C,w;p.y<0?(g=s.attributes,C=s.indices,w=E):(g=u.attributes,C=u.indices,w=f),j(g,C,w,o,t,p),j(g,C,w,o,t+1,m)}}K(e,s,u)}function $(e){for(var t=e.attributes,r=t.position.values,n=t.prevPosition.values,i=t.nextPosition.values,o=r.length,u=0;u<o;u+=3){var s=a.unpack(r,u,Be);if(!(s.x>0)){var c=a.unpack(n,u,ze);(s.y<0&&c.y>0||s.y>0&&c.y<0)&&(u-3>0?(n[u]=r[u-3],n[u+1]=r[u-2],n[u+2]=r[u-1]):a.pack(s,n,u));var l=a.unpack(i,u,Ge);(s.y<0&&l.y>0||s.y>0&&l.y<0)&&(u+3<o?(i[u]=r[u+3],i[u+1]=r[u+4],i[u+2]=r[u+5]):a.pack(s,i,u))}}}function ee(e){var t,r,o,u=e.geometry,s=u.attributes,l=s.position.values,E=s.prevPosition.values,f=s.nextPosition.values,h=s.expandAndWidth.values,d=c(s.st)?s.st.values:void 0,p=c(s.color)?s.color.values:void 0,m=Y(u),_=Y(u),R=!1,A=l.length/3;for(t=0;t<A;t+=4){var v=t,N=t+2,S=a.fromArray(l,3*v,Be),I=a.fromArray(l,3*N,ze);if(Math.abs(S.y)<ke)for(S.y=ke*(I.y<0?-1:1),l[3*t+1]=S.y,l[3*(t+1)+1]=S.y,r=3*v;r<3*v+12;r+=3)E[r]=l[3*t],E[r+1]=l[3*t+1],E[r+2]=l[3*t+2];if(Math.abs(I.y)<ke)for(I.y=ke*(S.y<0?-1:1),l[3*(t+2)+1]=I.y,l[3*(t+3)+1]=I.y,r=3*v;r<3*v+12;r+=3)f[r]=l[3*(t+2)],f[r+1]=l[3*(t+2)+1],f[r+2]=l[3*(t+2)+2];var M=m.attributes,O=m.indices,g=_.attributes,C=_.indices,w=T.lineSegmentPlane(S,I,Le,Ve);if(c(w)){R=!0;var P=a.multiplyByScalar(a.UNIT_Y,We,qe);S.y<0&&(a.negate(P,P),M=_.attributes,O=_.indices,g=m.attributes,C=m.indices);var x=a.add(w,P,Xe);M.position.values.push(S.x,S.y,S.z,S.x,S.y,S.z),M.position.values.push(x.x,x.y,x.z),M.position.values.push(x.x,x.y,x.z),M.prevPosition.values.push(E[3*v],E[3*v+1],E[3*v+2]),M.prevPosition.values.push(E[3*v+3],E[3*v+4],E[3*v+5]),M.prevPosition.values.push(S.x,S.y,S.z,S.x,S.y,S.z),M.nextPosition.values.push(x.x,x.y,x.z),M.nextPosition.values.push(x.x,x.y,x.z),M.nextPosition.values.push(x.x,x.y,x.z),M.nextPosition.values.push(x.x,x.y,x.z),a.negate(P,P),a.add(w,P,x),g.position.values.push(x.x,x.y,x.z),g.position.values.push(x.x,x.y,x.z),g.position.values.push(I.x,I.y,I.z,I.x,I.y,I.z),g.prevPosition.values.push(x.x,x.y,x.z),g.prevPosition.values.push(x.x,x.y,x.z),g.prevPosition.values.push(x.x,x.y,x.z),g.prevPosition.values.push(x.x,x.y,x.z),g.nextPosition.values.push(I.x,I.y,I.z,I.x,I.y,I.z),g.nextPosition.values.push(f[3*N],f[3*N+1],f[3*N+2]),g.nextPosition.values.push(f[3*N+3],f[3*N+4],f[3*N+5]);var L=n.fromArray(h,2*v,Fe),U=Math.abs(L.y);M.expandAndWidth.values.push(-1,U,1,U),M.expandAndWidth.values.push(-1,-U,1,-U),g.expandAndWidth.values.push(-1,U,1,U),g.expandAndWidth.values.push(-1,-U,1,-U);var b=a.magnitudeSquared(a.subtract(w,S,Ge));if(b/=a.magnitudeSquared(a.subtract(I,S,Ge)),c(p)){var F=i.fromArray(p,4*v,He),D=i.fromArray(p,4*N,He),B=y.lerp(F.x,D.x,b),z=y.lerp(F.y,D.y,b),G=y.lerp(F.z,D.z,b),V=y.lerp(F.w,D.w,b);for(r=4*v;r<4*v+8;++r)M.color.values.push(p[r]);for(M.color.values.push(B,z,G,V),M.color.values.push(B,z,G,V),g.color.values.push(B,z,G,V),g.color.values.push(B,z,G,V),r=4*N;r<4*N+8;++r)g.color.values.push(p[r])}if(c(d)){var q=n.fromArray(d,2*v,Fe),X=n.fromArray(d,2*(t+3),De),H=y.lerp(q.x,X.x,b);for(r=2*v;r<2*v+4;++r)M.st.values.push(d[r]);for(M.st.values.push(H,q.y),M.st.values.push(H,X.y),g.st.values.push(H,q.y),g.st.values.push(H,X.y),r=2*N;r<2*N+4;++r)g.st.values.push(d[r])}o=M.position.values.length/3-4,O.push(o,o+2,o+1),O.push(o+1,o+2,o+3),o=g.position.values.length/3-4,C.push(o,o+2,o+1),C.push(o+1,o+2,o+3)}else{var W,k;for(S.y<0?(W=_.attributes,k=_.indices):(W=m.attributes,k=m.indices),W.position.values.push(S.x,S.y,S.z),W.position.values.push(S.x,S.y,S.z),W.position.values.push(I.x,I.y,I.z),W.position.values.push(I.x,I.y,I.z),r=3*t;r<3*t+12;++r)W.prevPosition.values.push(E[r]),W.nextPosition.values.push(f[r]);for(r=2*t;r<2*t+8;++r)W.expandAndWidth.values.push(h[r]),c(d)&&W.st.values.push(d[r]);if(c(p))for(r=4*t;r<4*t+16;++r)W.color.values.push(p[r]);o=W.position.values.length/3-4,k.push(o,o+2,o+1),k.push(o+1,o+2,o+3)}}R&&($(_),$(m)),K(e,_,m)}var te={};te.toWireframe=function(e){var t=e.indices;if(c(t)){switch(e.primitiveType){case N.TRIANGLES:e.indices=M(t);break;case N.TRIANGLE_STRIP:e.indices=O(t);break;case N.TRIANGLE_FAN:e.indices=g(t)}e.primitiveType=N.LINES}return e},te.createLineSegmentsForVectors=function(e,t,n){t=s(t,"normal"),n=s(n,1e4);for(var a=e.attributes.position.values,i=e.attributes[t].values,o=a.length,l=new Float64Array(2*o),E=0,f=0;f<o;f+=3)l[E++]=a[f],l[E++]=a[f+1],l[E++]=a[f+2],l[E++]=a[f]+i[f]*n,l[E++]=a[f+1]+i[f+1]*n,l[E++]=a[f+2]+i[f+2]*n;var p,m=e.boundingSphere;return c(m)&&(p=new r(m.center,m.radius+n)),new h({attributes:{position:new d({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:N.LINES,boundingSphere:p})},te.createAttributeLocations=function(e){var t,r=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","binormal","tangent","compressedAttributes"],n=e.attributes,a={},i=0,o=r.length;for(t=0;t<o;++t){var u=r[t];c(n[u])&&(a[u]=i++)}for(var s in n)n.hasOwnProperty(s)&&!c(a[s])&&(a[s]=i++);return a},te.reorderForPreVertexCache=function(e){var t=h.computeNumberOfVertices(e),r=e.indices;if(c(r)){for(var n=new Int32Array(t),a=0;a<t;a++)n[a]=-1;for(var i,o=r,s=o.length,l=m.createTypedArray(t,s),E=0,f=0,d=0;E<s;)i=n[o[E]],i!==-1?l[f]=i:(i=o[E],n[i]=d,l[f]=d,++d),++E,++f;e.indices=l;var p=e.attributes;for(var _ in p)if(p.hasOwnProperty(_)&&c(p[_])&&c(p[_].values)){for(var T=p[_],y=T.values,R=0,A=T.componentsPerAttribute,v=u.createTypedArray(T.componentDatatype,d*A);R<t;){var N=n[R];if(N!==-1)for(a=0;a<A;a++)v[A*N+a]=y[A*R+a];++R}T.values=v}}return e},te.reorderForPostVertexCache=function(e,t){var r=e.indices;if(e.primitiveType===N.TRIANGLES&&c(r)){for(var n=r.length,a=0,i=0;i<n;i++)r[i]>a&&(a=r[i]);e.indices=S.tipsify({indices:r,maximumIndex:a,cacheSize:t})}return e},te.fitToUnsignedShortIndices=function(e){var t=[],r=h.computeNumberOfVertices(e);if(c(e.indices)&&r>=y.SIXTY_FOUR_KILOBYTES){var n,a=[],i=[],o=0,u=C(e.attributes),s=e.indices,l=s.length;e.primitiveType===N.TRIANGLES?n=3:e.primitiveType===N.LINES?n=2:e.primitiveType===N.POINTS&&(n=1);for(var E=0;E<l;E+=n){for(var f=0;f<n;++f){var d=s[E+f],p=a[d];c(p)||(p=o++,a[d]=p,w(u,e.attributes,d)),i.push(p)}o+n>=y.SIXTY_FOUR_KILOBYTES&&(t.push(new h({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),a=[],i=[],o=0,u=C(e.attributes))}0!==i.length&&t.push(new h({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var re=new a,ne=new o;te.projectTo2D=function(e,t,r,n,i){var o=e.attributes[t];i=c(i)?i:new f;for(var s=i.ellipsoid,l=o.values,E=new Float64Array(l.length),h=0,p=0;p<l.length;p+=3){var m=a.fromArray(l,p,re),_=s.cartesianToCartographic(m,ne),T=i.project(_,re);E[h++]=T.x,E[h++]=T.y,E[h++]=T.z}return e.attributes[r]=o,e.attributes[n]=new d({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:E}),delete e.attributes[t],e};var ae={high:0,low:0};te.encodeAttribute=function(e,t,r,n){for(var a=e.attributes[t],i=a.values,o=i.length,s=new Float32Array(o),c=new Float32Array(o),l=0;l<o;++l)E.encode(i[l],ae),s[l]=ae.high,c[l]=ae.low;var f=a.componentsPerAttribute;return e.attributes[r]=new d({componentDatatype:u.FLOAT,componentsPerAttribute:f,values:s}),e.attributes[n]=new d({componentDatatype:u.FLOAT,componentsPerAttribute:f,values:c}),delete e.attributes[t],e};var ie=new a,oe=new A,ue=new R;te.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(A.equals(t,A.IDENTITY))return e;var n=e.geometry.attributes;P(t,n.position),P(t,n.prevPosition),P(t,n.nextPosition),(c(n.normal)||c(n.binormal)||c(n.tangent))&&(A.inverse(t,oe),A.transpose(oe,oe),A.getRotation(oe,ue),x(ue,n.normal),x(ue,n.binormal),x(ue,n.tangent));var a=e.geometry.boundingSphere;return c(a)&&(e.geometry.boundingSphere=r.transform(a,t,a)),e.modelMatrix=A.clone(A.IDENTITY),e};var se=new a;te.combineInstances=function(e){for(var t=[],r=[],n=e.length,a=0;a<n;++a){var i=e[a];c(i.geometry)?t.push(i):c(i.westHemisphereGeometry)&&c(i.eastHemisphereGeometry)&&r.push(i)}var o=[];return t.length>0&&o.push(U(t,"geometry")),r.length>0&&(o.push(U(r,"westHemisphereGeometry")),o.push(U(r,"eastHemisphereGeometry"))),o};var ce=new a,le=new a,Ee=new a,fe=new a;te.computeNormal=function(e){for(var t=e.indices,r=e.attributes,n=r.position.values,i=r.position.values.length/3,o=t.length,s=new Array(i),c=new Array(o/3),l=new Array(o),E=0;E<i;E++)s[E]={indexOffset:0,count:0,currentCount:0};var f=0;for(E=0;E<o;E+=3){var h=t[E],p=t[E+1],m=t[E+2],_=3*h,T=3*p,y=3*m;le.x=n[_],le.y=n[_+1],le.z=n[_+2],Ee.x=n[T],Ee.y=n[T+1],Ee.z=n[T+2],fe.x=n[y],fe.y=n[y+1],fe.z=n[y+2],s[h].count++,s[p].count++,s[m].count++,a.subtract(Ee,le,Ee),a.subtract(fe,le,fe),c[f]=a.cross(Ee,fe,new a),f++}var R=0;for(E=0;E<i;E++)s[E].indexOffset+=R,R+=s[E].count;f=0;var A;for(E=0;E<o;E+=3){A=s[t[E]];var v=A.indexOffset+A.currentCount;l[v]=f,A.currentCount++,A=s[t[E+1]],v=A.indexOffset+A.currentCount,l[v]=f,A.currentCount++,A=s[t[E+2]],v=A.indexOffset+A.currentCount,l[v]=f,A.currentCount++,f++}var N=new Float32Array(3*i);for(E=0;E<i;E++){var S=3*E;if(A=s[E],A.count>0){for(a.clone(a.ZERO,ce),f=0;f<A.count;f++)a.add(ce,c[l[A.indexOffset+f]],ce);a.normalize(ce,ce),N[S]=ce.x,N[S+1]=ce.y,N[S+2]=ce.z}else N[S]=0,N[S+1]=0,N[S+2]=1}return e.attributes.normal=new d({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:N}),e};var he=new a,de=new a,pe=new a;te.computeBinormalAndTangent=function(e){for(var t=(e.attributes,e.indices),r=e.attributes.position.values,n=e.attributes.normal.values,i=e.attributes.st.values,o=e.attributes.position.values.length/3,s=t.length,c=new Array(3*o),l=0;l<c.length;l++)c[l]=0;var E,f,h;for(l=0;l<s;l+=3){var p=t[l],m=t[l+1],_=t[l+2];E=3*p,f=3*m,h=3*_;var T=2*p,y=2*m,R=2*_,A=r[E],v=r[E+1],N=r[E+2],S=i[T],I=i[T+1],M=i[y+1]-I,O=i[R+1]-I,g=1/((i[y]-S)*O-(i[R]-S)*M),C=(O*(r[f]-A)-M*(r[h]-A))*g,w=(O*(r[f+1]-v)-M*(r[h+1]-v))*g,P=(O*(r[f+2]-N)-M*(r[h+2]-N))*g;c[E]+=C,c[E+1]+=w,c[E+2]+=P,c[f]+=C,c[f+1]+=w,c[f+2]+=P,c[h]+=C,c[h+1]+=w,c[h+2]+=P}var x=new Float32Array(3*o),L=new Float32Array(3*o);for(l=0;l<o;l++){E=3*l,f=E+1,h=E+2;var U=a.fromArray(n,E,he),b=a.fromArray(c,E,pe),F=a.dot(U,b);a.multiplyByScalar(U,F,de),a.normalize(a.subtract(b,de,b),b),L[E]=b.x,L[f]=b.y,L[h]=b.z,a.normalize(a.cross(U,b,b),b),x[E]=b.x,x[f]=b.y,x[h]=b.z}return e.attributes.tangent=new d({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:L}),e.attributes.binormal=new d({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:x}),e};var me=new n,_e=new a,Te=new a,ye=new a;te.compressVertices=function(t){var r=t.attributes.normal,i=t.attributes.st;if(!c(r)&&!c(i))return t;var o,s,l,E,f=t.attributes.tangent,h=t.attributes.binormal;c(r)&&(o=r.values),c(i)&&(s=i.values),c(f)&&(l=f.values),h&&(E=h.values);var p=c(o)?o.length:s.length,m=c(o)?3:2,_=p/m,T=_,y=c(s)&&c(o)?2:1;y+=c(l)||c(E)?1:0,T*=y;for(var R=new Float32Array(T),A=0,v=0;v<_;++v){c(s)&&(n.fromArray(s,2*v,me),R[A++]=e.compressTextureCoordinates(me));var N=3*v;c(o)&&c(l)&&c(E)?(a.fromArray(o,N,_e),a.fromArray(l,N,Te),a.fromArray(E,N,ye),e.octPack(_e,Te,ye,me),R[A++]=me.x,R[A++]=me.y):(c(o)&&(a.fromArray(o,N,_e),R[A++]=e.octEncodeFloat(_e)),c(l)&&(a.fromArray(l,N,_e),R[A++]=e.octEncodeFloat(_e)),c(E)&&(a.fromArray(E,N,_e),R[A++]=e.octEncodeFloat(_e)))}return t.attributes.compressedAttributes=new d({componentDatatype:u.FLOAT,componentsPerAttribute:y,values:R}),c(o)&&delete t.attributes.normal,c(s)&&delete t.attributes.st,c(l)&&delete t.attributes.tangent,c(E)&&delete t.attributes.binormal,t};var Re=new a,Ae=new a,ve=new a,Ne=new a,Se=new a,Ie={positions:new Array(7),indices:new Array(9)},Me=new a,Oe=new a,ge=new a,Ce=new a,we=new n,Pe=new n,xe=new n,Le=v.fromPointNormal(a.ZERO,a.UNIT_Y),Ue=new a,be=new a,Fe=new n,De=new n,Be=new a,ze=new a,Ge=new a,Ve=new a,qe=new a,Xe=new a,He=new i,We=5*y.EPSILON9,ke=y.EPSILON6;return te.splitLongitude=function(e){var t=e.geometry,n=t.boundingSphere;if(c(n)){var a=n.center.x-n.radius;if(a>0||r.intersectPlane(n,v.ORIGIN_ZX_PLANE)!==_.INTERSECTING)return e}if(t.geometryType!==p.NONE)switch(t.geometryType){case p.POLYLINES:ee(e);break;case p.TRIANGLES:Q(e);break;case p.LINES:J(e)}else V(t),t.primitiveType===N.TRIANGLES?Q(e):t.primitiveType===N.LINES&&J(e);return e},te}),define("Core/WebMercatorProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,r,n,a,i,o,u){"use strict";function s(e){this._ellipsoid=r(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(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 a=this._semimajorAxis,i=t.longitude*a,o=s.geodeticLatitudeToMercatorAngle(t.latitude)*a,u=t.height;return n(r)?(r.x=i,r.y=o,r.z=u,r):new e(i,o,u)},s.prototype.unproject=function(e,r){var a=this._oneOverSemimajorAxis,i=e.x*a,o=s.mercatorAngleToGeodeticLatitude(e.y*a),u=e.z;return n(r)?(r.longitude=i,r.latitude=o,r.height=u,r):new t(i,o,u)},s}),define("Scene/PrimitivePipeline",["../Core/BoundingSphere","../Core/ComponentDatatype","../Core/defined","../Core/DeveloperError","../Core/Ellipsoid","../Core/FeatureDetection","../Core/GeographicProjection","../Core/Geometry","../Core/GeometryAttribute","../Core/GeometryAttributes","../Core/GeometryPipeline","../Core/IndexDatatype","../Core/Matrix4","../Core/WebMercatorProjection"],function(e,t,r,n,a,i,o,u,s,c,l,E,f,h){"use strict";function d(e,t,n){var a,i=!n,o=e.length;if(!i&&o>1){var u=e[0].modelMatrix;for(a=1;a<o;++a)if(!f.equals(u,e[a].modelMatrix)){i=!0;break}}if(i)for(a=0;a<o;++a)r(e[a].geometry)&&l.transformToWorldCoordinates(e[a]);else f.multiplyTransformation(t,e[0].modelMatrix,t)}function p(e,r){var n=e.attributes,a=n.position,i=a.values.length/a.componentsPerAttribute;n.batchId=new s({componentDatatype:t.FLOAT,componentsPerAttribute:1,values:new Float32Array(i)});for(var o=n.batchId.values,u=0;u<i;++u)o[u]=r}function m(e){for(var t=e.length,n=0;n<t;++n){var a=e[n];r(a.geometry)?p(a.geometry,n):r(a.westHemisphereGeometry)&&r(a.eastHemisphereGeometry)&&(p(a.westHemisphereGeometry,n),p(a.eastHemisphereGeometry,n))}}function _(n){var a,i,o,u=n.instances,s=n.projection,c=n.elementIndexUintSupported,E=n.scene3DOnly,f=n.vertexCacheOptimize,h=n.compressVertices,p=n.modelMatrix,_=u.length;for(a=0;a<_;++a)if(r(u[a].geometry)){o=u[a].geometry.primitiveType;break}if(d(u,p,E),!E)for(a=0;a<_;++a)r(u[a].geometry)&&l.splitLongitude(u[a]);if(m(u),f)for(a=0;a<_;++a){var T=u[a];r(T.geometry)?(l.reorderForPostVertexCache(T.geometry),l.reorderForPreVertexCache(T.geometry)):r(T.westHemisphereGeometry)&&r(T.eastHemisphereGeometry)&&(l.reorderForPostVertexCache(T.westHemisphereGeometry),l.reorderForPreVertexCache(T.westHemisphereGeometry),l.reorderForPostVertexCache(T.eastHemisphereGeometry),l.reorderForPreVertexCache(T.eastHemisphereGeometry))}var y=l.combineInstances(u); -for(_=y.length,a=0;a<_;++a){i=y[a];var R,A=i.attributes;if(E)for(R in A)A.hasOwnProperty(R)&&A[R].componentDatatype===t.DOUBLE&&l.encodeAttribute(i,R,R+"3DHigh",R+"3DLow");else for(R in A)if(A.hasOwnProperty(R)&&A[R].componentDatatype===t.DOUBLE){var v=R+"3D",N=R+"2D";l.projectTo2D(i,R,v,N,s),r(i.boundingSphere)&&"position"===R&&(i.boundingSphereCV=e.fromVertices(i.attributes.position2D.values)),l.encodeAttribute(i,v,v+"High",v+"Low"),l.encodeAttribute(i,N,N+"High",N+"Low")}h&&l.compressVertices(i)}if(!c){var S=[];for(_=y.length,a=0;a<_;++a)i=y[a],S=S.concat(l.fitToUnsignedShortIndices(i));y=S}return y}function T(e,t,n,a){var i,o,u,s=a.length-1;if(s>=0){var c=a[s];i=c.offset+c.count,u=c.index,o=n[u].indices.length}else i=0,u=0,o=n[u].indices.length;for(var l=e.length,E=0;E<l;++E){var f=e[E],h=f[t];if(r(h)){var d=h.indices.length;i+d>o&&(i=0,o=n[++u].indices.length),a.push({index:u,offset:i,count:d}),i+=d}}}function y(e,t){var r=[];return T(e,"geometry",t,r),T(e,"westHemisphereGeometry",t,r),T(e,"eastHemisphereGeometry",t,r),r}function R(e,t){var n=e.attributes;for(var a in n)if(n.hasOwnProperty(a)){var i=n[a];r(i)&&r(i.values)&&t.push(i.values.buffer)}r(e.indices)&&t.push(e.indices.buffer)}function A(e,t){for(var r=e.length,n=0;n<r;++n)R(e[n],t)}function v(t){for(var n=1,a=t.length,i=0;i<a;i++){var o=t[i];if(++n,r(o)){var u=o.attributes;n+=6+2*e.packedLength+(r(o.indices)?o.indices.length:0);for(var s in u)if(u.hasOwnProperty(s)&&r(u[s])){var c=u[s];n+=5+c.values.length}}}return n}function N(e,t){var r=e.length,n=new Float64Array(1+16*r),a=0;n[a++]=r;for(var i=0;i<r;i++){var o=e[i];f.pack(o.modelMatrix,n,a),a+=f.packedLength}return t.push(n.buffer),n}function S(e){for(var t=e,r=new Array(t[0]),n=0,a=1;a<t.length;){var i=f.unpack(t,a);a+=f.packedLength,r[n++]={modelMatrix:i}}return r}function I(t){var n=t.length,a=1+(e.packedLength+1)*n,i=new Float32Array(a),o=0;i[o++]=n;for(var u=0;u<n;++u){var s=t[u];r(s)?(i[o++]=1,e.pack(t[u],i,o)):i[o++]=0,o+=e.packedLength}return i}function M(t){for(var r=new Array(t[0]),n=0,a=1;a<t.length;)1===t[a++]&&(r[n]=e.unpack(t,a)),++n,a+=e.packedLength;return r}if(!i.supportsTypedArrays())return{};var O={};return O.combineGeometry=function(t){var n,a,i=t.instances,o=i.length;o>0&&(n=_(t),n.length>0&&(a=l.createAttributeLocations(n[0])));var u;t.createPickOffsets&&n.length>0&&(u=y(i,n));for(var s=new Array(o),c=new Array(o),E=0;E<o;++E){var f=i[E],h=f.geometry;r(h)&&(s[E]=h.boundingSphere,c[E]=h.boundingSphereCV);var d=f.eastHemisphereGeometry,p=f.westHemisphereGeometry;r(d)&&r(p)&&(r(d.boundingSphere)&&r(p.boundingSphere)&&(s[E]=e.union(d.boundingSphere,p.boundingSphere)),r(d.boundingSphereCV)&&r(p.boundingSphereCV)&&(c[E]=e.union(d.boundingSphereCV,p.boundingSphereCV)))}return{geometries:n,modelMatrix:t.modelMatrix,attributeLocations:a,pickOffsets:u,boundingSpheres:s,boundingSpheresCV:c}},O.packCreateGeometryResults=function(t,n){var a=new Float64Array(v(t)),i=[],o={},u=t.length,s=0;a[s++]=u;for(var c=0;c<u;c++){var l=t[c],E=r(l);if(a[s++]=E?1:0,E){a[s++]=l.primitiveType,a[s++]=l.geometryType;var f=r(l.boundingSphere)?1:0;a[s++]=f,f&&e.pack(l.boundingSphere,a,s),s+=e.packedLength;var h=r(l.boundingSphereCV)?1:0;a[s++]=h,h&&e.pack(l.boundingSphereCV,a,s),s+=e.packedLength;var d=l.attributes,p=[];for(var m in d)d.hasOwnProperty(m)&&r(d[m])&&(p.push(m),r(o[m])||(o[m]=i.length,i.push(m)));a[s++]=p.length;for(var _=0;_<p.length;_++){var T=p[_],y=d[T];a[s++]=o[T],a[s++]=y.componentDatatype,a[s++]=y.componentsPerAttribute,a[s++]=y.normalize?1:0,a[s++]=y.values.length,a.set(y.values,s),s+=y.values.length}var R=r(l.indices)?l.indices.length:0;a[s++]=R,R>0&&(a.set(l.indices,s),s+=R)}}return n.push(a.buffer),{stringTable:i,packedData:a}},O.unpackCreateGeometryResults=function(r){for(var n,a=r.stringTable,i=r.packedData,o=new Array(i[0]),l=0,f=1;f<i.length;){var h=1===i[f++];if(h){var d,p,m=i[f++],_=i[f++],T=1===i[f++];T&&(d=e.unpack(i,f)),f+=e.packedLength;var y=1===i[f++];y&&(p=e.unpack(i,f)),f+=e.packedLength;var R,A,v,N=new c,S=i[f++];for(n=0;n<S;n++){var I=a[i[f++]],M=i[f++];v=i[f++];var O=0!==i[f++];R=i[f++],A=t.createTypedArray(M,R);for(var g=0;g<R;g++)A[g]=i[f++];N[I]=new s({componentDatatype:M,componentsPerAttribute:v,normalize:O,values:A})}var C;if(R=i[f++],R>0){var w=A.length/v;for(C=E.createTypedArray(w,R),n=0;n<R;n++)C[n]=i[f++]}o[l++]=new u({primitiveType:m,geometryType:_,boundingSphere:d,boundingSphereCV:p,indices:C,attributes:N})}else o[l++]=void 0}return o},O.packCombineGeometryParameters=function(e,t){for(var r=e.createGeometryResults,n=r.length,a=0;a<n;a++)t.push(r[a].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:N(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof o,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}},O.unpackCombineGeometryParameters=function(e){for(var t=S(e.packedInstances),r=e.createGeometryResults,n=r.length,i=0,u=0;u<n;u++)for(var s=O.unpackCreateGeometryResults(r[u]),c=s.length,l=0;l<c;l++){var E=s[l],d=t[i];d.geometry=E,++i}var p=a.clone(e.ellipsoid),m=e.isGeographic?new o(p):new h(p);return{instances:t,ellipsoid:p,projection:m,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:f.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}},O.packCombineGeometryResults=function(e,t){r(e.geometries)&&A(e.geometries,t);var n=I(e.boundingSpheres),a=I(e.boundingSpheresCV);return t.push(n.buffer,a.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,boundingSpheres:n,boundingSpheresCV:a}},O.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,boundingSpheres:M(e.boundingSpheres),boundingSpheresCV:M(e.boundingSpheresCV)}},O}),define("Core/formatError",["./defined"],function(e){"use strict";function t(t){var r,n=t.name,a=t.message;r=e(n)&&e(a)?n+": "+a:t.toString();var i=t.stack;return e(i)&&(r+="\n"+i),r}return t}),define("Workers/createTaskProcessorWorker",["../Core/defaultValue","../Core/defined","../Core/formatError"],function(e,t,r){"use strict";function n(n){var a,i=[],o={id:void 0,result:void 0,error:void 0};return function(u){var s=u.data;i.length=0,o.id=s.id,o.error=void 0,o.result=void 0;try{o.result=n(s.parameters,i)}catch(e){e instanceof Error?o.error={name:e.name,message:e.message,stack:e.stack}:o.error=e}t(a)||(a=e(self.webkitPostMessage,self.postMessage)),s.canTransferArrayBuffer||(i.length=0);try{a(o,i)}catch(e){o.result=void 0,o.error="postMessage failed with error: "+r(e)+"\n with responseMessage: "+JSON.stringify(o),a(o)}}}return n}),define("Workers/createGeometry",["../Core/defined","../Scene/PrimitivePipeline","./createTaskProcessorWorker","require"],function(e,t,r,n){"use strict";function a(t){var r=o[t];return e(r)||("object"==typeof exports?o[r]=r=n("Workers/"+t):n(["./"+t],function(e){r=e,o[r]=e})),r}function i(r,n){for(var i=r.subTasks,o=i.length,u=new Array(o),s=0;s<o;s++){var c=i[s],l=c.geometry,E=c.moduleName;if(e(E)){var f=a(E);u[s]=f(l,c.offset)}else u[s]=l}return t.packCreateGeometryResults(u,n)}var o={};return r(i)})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function r(e){return e+" is required, actual value was undefined"}function n(e,t,r){return"Expected "+r+" to be typeof "+t+", actual typeof was "+e}var a={};return a.typeOf={},a.defined=function(n,a){if(!e(a))throw new t(r(n))},a.typeOf.func=function(e,r){if("function"!=typeof r)throw new t(n(typeof r,"function",e))},a.typeOf.string=function(e,r){if("string"!=typeof r)throw new t(n(typeof r,"string",e))},a.typeOf.number=function(e,r){if("number"!=typeof r)throw new t(n(typeof r,"number",e))},a.typeOf.number.lessThan=function(e,r,n){if(a.typeOf.number(e,r),r>=n)throw new t("Expected "+e+" to be less than "+n+", actual value was "+r)},a.typeOf.number.lessThanOrEquals=function(e,r,n){if(a.typeOf.number(e,r),r>n)throw new t("Expected "+e+" to be less than or equal to "+n+", actual value was "+r)},a.typeOf.number.greaterThan=function(e,r,n){if(a.typeOf.number(e,r),r<=n)throw new t("Expected "+e+" to be greater than "+n+", actual value was "+r)},a.typeOf.number.greaterThanOrEquals=function(e,r,n){if(a.typeOf.number(e,r),r<n)throw new t("Expected "+e+" to be greater than or equal to"+n+", actual value was "+r)},a.typeOf.object=function(e,r){if("object"!=typeof r)throw new t(n(typeof r,"object",e))},a.typeOf.bool=function(e,r){if("boolean"!=typeof r)throw new t(n(typeof r,"boolean",e))},a}),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";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),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^=e<<7&2636928640,e^=e<<15&4022730752,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,r,n){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:e<0?-1:0},a.signNotZero=function(e){return e<0?-1:1},a.toSNorm=function(e,r){return r=t(r,255),Math.round((.5*a.clamp(e,-1,1)+.5)*r)},a.fromSNorm=function(e,r){return r=t(r,255),a.clamp(e,0,r)/r*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t-r)},a.cosh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t+r)},a.lerp=function(e,t,r){return(1-r)*e+r*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){var t=a.TWO_PI,r=e-Math.floor(e/t)*t;return r<-Math.PI?r+t:r>=Math.PI?r-t:r},a.clampToLatitudeRange=function(e){return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){return(e%t+t)%t},a.equalsEpsilon=function(e,r,n,a){a=t(a,n);var i=Math.abs(e-r);return i<=a||i<=n*Math.max(Math.abs(e),Math.abs(r))};var i=[1];a.factorial=function(e){var t=i.length;if(e>=t)for(var r=i[t-1],n=t;n<=e;n++)i.push(r*n);return i[e]},a.incrementWrap=function(e,r,n){return n=t(n,0),++e,e>r&&(e=n),e},a.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,r){return e<t?t:e>r?r:e};var o=new e;return a.setRandomNumberSeed=function(t){o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(e){return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){return Math.log(e)/Math.log(t)},a.fog=function(e,t){var r=e*t;return 1-Math.exp(-(r*r))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i){"use strict";function o(e,r,n){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0)}o.fromSpherical=function(e,n){r(n)||(n=new o);var a=e.clock,i=e.cone,u=t(e.magnitude,1),s=u*Math.sin(i);return n.x=s*Math.cos(a),n.y=s*Math.sin(a),n.z=u*Math.cos(i),n},o.fromElements=function(e,t,n,a){return r(a)?(a.x=e,a.y=t,a.z=n,a):new o(e,t,n)},o.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n]=e.z,r},o.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new o),a.x=e[n++],a.y=e[n++],a.z=e[n],a},o.packArray=function(e,t){var n=e.length;r(t)?t.length=3*n:t=new Array(3*n);for(var a=0;a<n;++a)o.pack(e[a],t,3*a);return t},o.unpackArray=function(e,t){var n=e.length;r(t)?t.length=n/3:t=new Array(n/3);for(var a=0;a<n;a+=3){var i=a/3;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},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},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},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},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},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},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},o.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r.z=e.z/t.z,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},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},o.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*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},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,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};var s=new o;o.lerp=function(e,t,r,n){return o.multiplyByScalar(t,r,s),n=o.multiplyByScalar(e,1-r,n),o.add(s,n,n)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var r=o.dot(c,l),n=o.magnitude(o.cross(c,l,c));return Math.atan2(n,r)};var E=new o;o.mostOrthogonalAxis=function(e,t){var r=o.normalize(e,E);return o.abs(r,r),t=r.x<=r.y?r.x<=r.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):r.y<=r.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},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,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]},o.equalsEpsilon=function(e,t,n,a){return e===t||r(e)&&r(t)&&i.equalsEpsilon(e.x,t.x,n,a)&&i.equalsEpsilon(e.y,t.y,n,a)&&i.equalsEpsilon(e.z,t.z,n,a)},o.cross=function(e,t,r){var n=e.x,a=e.y,i=e.z,o=t.x,u=t.y,s=t.z,c=a*s-i*u,l=i*o-n*s,E=n*u-a*o;return r.x=c,r.y=l,r.z=E,r},o.fromDegrees=function(e,t,r,n,a){return e=i.toRadians(e),t=i.toRadians(t),o.fromRadians(e,t,r,n,a)};var f=new o,h=new o,d=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,n,a,i,u){a=t(a,0);var s=r(i)?i.radiiSquared:d,c=Math.cos(n);f.x=c*Math.cos(e),f.y=c*Math.sin(e),f.z=Math.sin(n),f=o.normalize(f,f),o.multiplyComponents(s,f,h);var l=Math.sqrt(o.dot(f,h));return h=o.divideByScalar(h,l,h),f=o.multiplyByScalar(f,a,f),r(u)||(u=new o),o.add(h,f,u)},o.fromDegreesArray=function(e,t,n){var a=e.length;r(n)?n.length=a/2:n=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;n[c]=o.fromDegrees(u,s,0,t,n[c])}return n},o.fromRadiansArray=function(e,t,n){var a=e.length;r(n)?n.length=a/2:n=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;n[c]=o.fromRadians(u,s,0,t,n[c])}return n},o.fromDegreesArrayHeights=function(e,t,n){var a=e.length;r(n)?n.length=a/3:n=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;n[l]=o.fromDegrees(u,s,c,t,n[l])}return n},o.fromRadiansArrayHeights=function(e,t,n){var a=e.length;r(n)?n.length=a/3:n=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;n[l]=o.fromRadians(u,s,c,t,n[l])}return n},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(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,t,r){return o.equalsEpsilon(this,e,t,r)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,r,n){"use strict";function a(r,a,u,s,c){var l=r.x,E=r.y,f=r.z,h=a.x,d=a.y,p=a.z,m=l*l*h*h,_=E*E*d*d,T=f*f*p*p,y=m+_+T,R=Math.sqrt(1/y),A=e.multiplyByScalar(r,R,i);if(y<s)return isFinite(R)?e.clone(A,c):void 0;var v=u.x,N=u.y,S=u.z,I=o;I.x=A.x*v*2,I.y=A.y*N*2,I.z=A.z*S*2;var g,M,O,C,w,x,P,L,b,U,F,D=(1-R)*e.magnitude(r)/(.5*e.magnitude(I)),B=0;do{D-=B,O=1/(1+D*v),C=1/(1+D*N),w=1/(1+D*S),x=O*O,P=C*C,L=w*w,b=x*O,U=P*C,F=L*w,g=m*x+_*P+T*L-1,M=m*b*v+_*U*N+T*F*S;var z=-2*M;B=g/z}while(Math.abs(g)>n.EPSILON12);return t(c)?(c.x=l*O,c.y=E*C,c.z=f*w,c):new e(l*O,E*C,f*w)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,r,n,a,i,o){"use strict";function u(e,r,n){this.longitude=t(e,0),this.latitude=t(r,0),this.height=t(n,0)}u.fromRadians=function(e,n,a,i){return a=t(a,0),r(i)?(i.longitude=e,i.latitude=n,i.height=a,i):new u(e,n,a)},u.fromDegrees=function(e,t,r,n){return e=i.toRadians(e),t=i.toRadians(t),u.fromRadians(e,t,r,n)};var s=new e,c=new e,l=new e,E=new e(1/6378137,1/6378137,1/6356752.314245179),f=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),h=i.EPSILON1;return u.fromCartesian=function(t,n,a){var d=r(n)?n.oneOverRadii:E,p=r(n)?n.oneOverRadiiSquared:f,m=r(n)?n._centerToleranceSquared:h,_=o(t,d,p,m,c);if(r(_)){var T=e.multiplyComponents(_,p,s);T=e.normalize(T,T);var y=e.subtract(t,_,l),R=Math.atan2(T.y,T.x),A=Math.asin(T.z),v=i.sign(e.dot(y,t))*e.magnitude(y);return r(a)?(a.longitude=R,a.latitude=A,a.height=v,a):new u(R,A,v)}},u.clone=function(e,t){if(r(e))return r(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||r(e)&&r(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n},u.ZERO=a(new u(0,0,0)),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,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),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","./scaleToGeodeticSurface"],function(e,t,r,n,a,i,o,u,s){"use strict";function c(t,n,a,i){n=r(n,0),a=r(a,0),i=r(i,0),t._radii=new e(n,a,i),t._radiiSquared=new e(n*n,a*a,i*i),t._radiiToTheFourth=new e(n*n*n*n,a*a*a*a,i*i*i*i),t._oneOverRadii=new e(0===n?0:1/n,0===a?0:1/a,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===n?0:1/(n*n),0===a?0:1/(a*a),0===i?0:1/(i*i)),t._minimumRadius=Math.min(n,a,i),t._maximumRadius=Math.max(n,a,i),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(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,this._sqauredXOverSquaredZ=void 0,c(this,e,t,r)}a(l.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}}}),l.clone=function(t,r){if(n(t)){var a=t._radii;return n(r)?(e.clone(a,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 l(a.x,a.y,a.z)}},l.fromCartesian3=function(e,t){return n(t)||(t=new l),n(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,n,a){return a=r(a,0),e.pack(t._radii,n,a),n},l.unpack=function(t,n,a){n=r(n,0);var i=e.unpack(t,n);return l.fromCartesian3(i,a)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,r){var a=t.longitude,i=t.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return n(r)||(r=new e),r.x=u,r.y=s,r.z=c,e.normalize(r,r)},l.prototype.geodeticSurfaceNormal=function(t,r){return n(r)||(r=new e),r=e.multiplyComponents(t,this._oneOverRadiiSquared,r),e.normalize(r,r)};var E=new e,f=new e;l.prototype.cartographicToCartesian=function(t,r){var a=E,i=f;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(e.dot(a,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(a,t.height,a),n(r)||(r=new e),e.add(i,a,r)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var a=0;a<r;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var h=new e,d=new e,p=new e;return l.prototype.cartesianToCartographic=function(r,a){var i=this.scaleToGeodeticSurface(r,d);if(n(i)){var o=this.geodeticSurfaceNormal(i,h),s=e.subtract(r,i,p),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),E=u.sign(e.dot(s,r))*e.magnitude(s);return n(a)?(a.longitude=c,a.latitude=l,a.height=E,a):new t(c,l,E)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var a=0;a<r;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,r){n(r)||(r=new e);var a=t.x,i=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return e.multiplyByScalar(t,s,r)},l.prototype.transformPositionToScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._oneOverRadii,r)},l.prototype.transformPositionFromScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._radii,r)},l.prototype.equals=function(t){return this===t||n(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,a,i){a=r(a,0);var o=this._sqauredXOverSquaredZ;if(n(i)||(i=new e),i.x=0,i.y=0,i.z=t.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},l}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,r,n,a,i,o){"use strict";function u(e){this._ellipsoid=r(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,r){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return n(r)?(r.x=i,r.y=o,r.z=u,r):new e(i,o,u)},u.prototype.unproject=function(e,r){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,u=e.z;return n(r)?(r.longitude=i,r.latitude=o,r.height=u,r):new t(i,o,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";function t(t,r){this.start=e(t,0),this.stop=e(r,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i,o,u){"use strict";function s(e,t,n,a,i,o,u,s,c){this[0]=r(e,0),this[1]=r(a,0),this[2]=r(u,0),this[3]=r(t,0),this[4]=r(i,0),this[5]=r(s,0),this[6]=r(n,0),this[7]=r(o,0),this[8]=r(c,0)}function c(e){for(var t=0,r=0;r<9;++r){var n=e[r];t+=n*n}return Math.sqrt(t)}function l(e){for(var t=0,r=0;r<3;++r){var n=e[s.getElementIndex(p[r],d[r])];t+=2*n*n}return Math.sqrt(t)}function E(e,t){for(var r=u.EPSILON15,n=0,a=1,i=0;i<3;++i){var o=Math.abs(e[s.getElementIndex(p[i],d[i])]);o>n&&(a=i,n=o)}var c=1,l=0,E=d[a],f=p[a];if(Math.abs(e[s.getElementIndex(f,E)])>r){var h,m=e[s.getElementIndex(f,f)],_=e[s.getElementIndex(E,E)],T=e[s.getElementIndex(f,E)],y=(m-_)/2/T;h=y<0?-1/(-y+Math.sqrt(1+y*y)):1/(y+Math.sqrt(1+y*y)),c=1/Math.sqrt(1+h*h),l=h*c}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(E,E)]=t[s.getElementIndex(f,f)]=c,t[s.getElementIndex(f,E)]=l,t[s.getElementIndex(E,f)]=-l,t}s.packedLength=9,s.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t},s.unpack=function(e,t,a){return t=r(t,0),n(a)||(a=new s),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a},s.clone=function(e,t){if(n(e))return n(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 s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,a){return t=r(t,0),n(a)||(a=new s),a[0]=e[t],a[1]=e[t+1],a[2]=e[t+2],a[3]=e[t+3],a[4]=e[t+4],a[5]=e[t+5],a[6]=e[t+6],a[7]=e[t+7],a[8]=e[t+8],a},s.fromColumnMajorArray=function(e,t){return s.clone(e,t)},s.fromRowMajorArray=function(e,t){return n(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 s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var r=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,u=e.y*e.y,c=e.y*e.z,l=e.y*e.w,E=e.z*e.z,f=e.z*e.w,h=e.w*e.w,d=r-u-E+h,p=2*(a-f),m=2*(i+l),_=2*(a+f),T=-r+u-E+h,y=2*(c-o),R=2*(i-l),A=2*(c+o),v=-r-u+E+h;return n(t)?(t[0]=d,t[1]=_,t[2]=R,t[3]=p,t[4]=T,t[5]=A,t[6]=m,t[7]=y,t[8]=v,t):new s(d,p,m,_,T,y,R,A,v)},s.fromHeadingPitchRoll=function(e,t){var r=Math.cos(-e.pitch),a=Math.cos(-e.heading),i=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),c=Math.sin(e.roll),l=r*a,E=-i*u+c*o*a,f=c*u+i*o*a,h=r*u,d=i*a+c*o*u,p=-o*i+i*o*u,m=-o,_=c*r,T=i*r;return n(t)?(t[0]=l,t[1]=h,t[2]=m,t[3]=E,t[4]=d,t[5]=_,t[6]=f,t[7]=p,t[8]=T,t):new s(l,E,f,h,d,p,m,_,T)},s.fromScale=function(e,t){return n(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 s(e.x,0,0,0,e.y,0,0,0,e.z)},s.fromUniformScale=function(e,t){return n(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 s(e,0,0,0,e,0,0,0,e)},s.fromCrossProduct=function(e,t){return n(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 s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=r,t[5]=a,t[6]=0,t[7]=-a,t[8]=r,t):new s(1,0,0,0,r,-a,0,a,r)},s.fromRotationY=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=r,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=r,t):new s(r,0,a,0,1,0,-a,0,r)},s.fromRotationZ=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=r,t[1]=a,t[2]=0,t[3]=-a,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(r,-a,0,a,r,0,0,0,1)},s.toArray=function(e,t){return n(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]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,r){var n=3*t,a=e[n],i=e[n+1],o=e[n+2];return r.x=a,r.y=i,r.z=o,r},s.setColumn=function(e,t,r,n){n=s.clone(e,n);var a=3*t;return n[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n},s.getRow=function(e,t,r){var n=e[t],a=e[t+3],i=e[t+6];return r.x=n,r.y=a,r.z=i,r},s.setRow=function(e,t,r,n){return n=s.clone(e,n),n[t]=r.x,n[t+3]=r.y,n[t+6]=r.z,n};var f=new e;s.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],f)),r.y=e.magnitude(e.fromElements(t[3],t[4],t[5],f)),r.z=e.magnitude(e.fromElements(t[6],t[7],t[8],f)),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]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=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],E=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return r[0]=n,r[1]=a,r[2]=i,r[3]=o,r[4]=u,r[5]=s,r[6]=c,r[7]=l,r[8]=E,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},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},s.multiplyByVector=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=e[0]*n+e[3]*a+e[6]*i,u=e[1]*n+e[4]*a+e[7]*i,s=e[2]*n+e[5]*a+e[8]*i;return r.x=o,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},s.multiplyByScale=function(e,t,r){return r[0]=e[0]*t.x,r[1]=e[1]*t.x,r[2]=e[2]*t.x,r[3]=e[3]*t.y,r[4]=e[4]*t.y,r[5]=e[5]*t.y,r[6]=e[6]*t.z,r[7]=e[7]*t.z,r[8]=e[8]*t.z,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},s.transpose=function(e,t){var r=e[0],n=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=r,t[1]=n,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var d=[1,0,0],p=[2,2,1],m=new s,_=new s;return s.computeEigenDecomposition=function(e,t){var r=u.EPSILON20,a=10,i=0,o=0;n(t)||(t={});for(var f=t.unitary=s.clone(s.IDENTITY,t.unitary),h=t.diagonal=s.clone(e,t.diagonal),d=r*c(h);o<a&&l(h)>d;)E(h,m),s.transpose(m,_),s.multiply(h,m,h),s.multiply(_,h,h),s.multiply(f,m,f),++i>2&&(++o,i=0);return 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},s.determinant=function(e){var t=e[0],r=e[3],n=e[6],a=e[1],i=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*o)+a*(s*n-r*c)+u*(r*o-i*n)},s.inverse=function(e,t){var r=e[0],n=e[1],a=e[2],i=e[3],o=e[4],u=e[5],c=e[6],l=e[7],E=e[8],f=s.determinant(e);t[0]=o*E-l*u,t[1]=l*a-n*E,t[2]=n*u-o*a,t[3]=c*u-i*E,t[4]=r*E-c*a,t[5]=i*a-r*u,t[6]=i*l-c*o,t[7]=c*n-r*l,t[8]=r*o-i*n;var h=1/f;return s.multiplyByScalar(t,h,t)},s.equals=function(e,t){return e===t||n(e)&&n(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]},s.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,a(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i){"use strict";function o(e,r,n,a){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0),this.w=t(a,0)}o.fromElements=function(e,t,n,a,i){return r(i)?(i.x=e,i.y=t,i.z=n,i.w=a,i):new o(e,t,n,a)},o.fromColor=function(e,t){return r(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(r(e))return 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)},o.packedLength=4,o.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n++]=e.z,r[n]=e.w,r},o.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new o),a.x=e[n++],a.y=e[n++],a.z=e[n++],a.w=e[n],a},o.packArray=function(e,t){var n=e.length;r(t)?t.length=4*n:t=new Array(4*n);for(var a=0;a<n;++a)o.pack(e[a],t,4*a);return t},o.unpackArray=function(e,t){var n=e.length;r(t)?t.length=n/4:t=new Array(n/4);for(var a=0;a<n;a+=4){var i=a/4;t[i]=o.unpack(e,a,t[i])}return t},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 u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},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.divideComponents=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 s=new o;o.lerp=function(e,t,r,n){return o.multiplyByScalar(t,r,s),n=o.multiplyByScalar(e,1-r,n),o.add(s,n,n)};var c=new o;return o.mostOrthogonalAxis=function(e,t){var r=o.normalize(e,c);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,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,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]&&e.w===t[r+3]},o.equalsEpsilon=function(e,t,n,a){return e===t||r(e)&&r(t)&&i.equalsEpsilon(e.x,t.x,n,a)&&i.equalsEpsilon(e.y,t.y,n,a)&&i.equalsEpsilon(e.z,t.z,n,a)&&i.equalsEpsilon(e.w,t.w,n,a)},o.ZERO=a(new o(0,0,0,0)),o.UNIT_X=a(new o(1,0,0,0)),o.UNIT_Y=a(new o(0,1,0,0)),o.UNIT_Z=a(new o(0,0,1,0)),o.UNIT_W=a(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,r){return o.equalsEpsilon(this,e,t,r)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,r,n,a,i,o,u,s,c,l){ +"use strict";function E(e,t,r,a,i,o,u,s,c,l,E,f,h,d,p,m){this[0]=n(e,0),this[1]=n(i,0),this[2]=n(c,0),this[3]=n(h,0),this[4]=n(t,0),this[5]=n(o,0),this[6]=n(l,0),this[7]=n(d,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(E,0),this[11]=n(p,0),this[12]=n(a,0),this[13]=n(s,0),this[14]=n(f,0),this[15]=n(m,0)}E.packedLength=16,E.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t[r++]=e[9],t[r++]=e[10],t[r++]=e[11],t[r++]=e[12],t[r++]=e[13],t[r++]=e[14],t[r]=e[15],t},E.unpack=function(e,t,r){return t=n(t,0),a(r)||(r=new E),r[0]=e[t++],r[1]=e[t++],r[2]=e[t++],r[3]=e[t++],r[4]=e[t++],r[5]=e[t++],r[6]=e[t++],r[7]=e[t++],r[8]=e[t++],r[9]=e[t++],r[10]=e[t++],r[11]=e[t++],r[12]=e[t++],r[13]=e[t++],r[14]=e[t++],r[15]=e[t],r},E.clone=function(e,t){if(a(e))return a(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 E(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])},E.fromArray=E.unpack,E.fromColumnMajorArray=function(e,t){return E.clone(e,t)},E.fromRowMajorArray=function(e,t){return a(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 E(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])},E.fromRotationTranslation=function(t,r,i){return r=n(r,e.ZERO),a(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=r.x,i[13]=r.y,i[14]=r.z,i[15]=1,i):new E(t[0],t[3],t[6],r.x,t[1],t[4],t[7],r.y,t[2],t[5],t[8],r.z,0,0,0,1)},E.fromTranslationQuaternionRotationScale=function(e,t,r,n){a(n)||(n=new E);var i=r.x,o=r.y,u=r.z,s=t.x*t.x,c=t.x*t.y,l=t.x*t.z,f=t.x*t.w,h=t.y*t.y,d=t.y*t.z,p=t.y*t.w,m=t.z*t.z,_=t.z*t.w,T=t.w*t.w,y=s-h-m+T,R=2*(c-_),A=2*(l+p),v=2*(c+_),N=-s+h-m+T,S=2*(d-f),I=2*(l-p),g=2*(d+f),M=-s-h+m+T;return n[0]=y*i,n[1]=v*i,n[2]=I*i,n[3]=0,n[4]=R*o,n[5]=N*o,n[6]=g*o,n[7]=0,n[8]=A*u,n[9]=S*u,n[10]=M*u,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n},E.fromTranslationRotationScale=function(e,t){return E.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},E.fromTranslation=function(e,t){return E.fromRotationTranslation(c.IDENTITY,e,t)},E.fromScale=function(e,t){return a(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 E(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},E.fromUniformScale=function(e,t){return a(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 E(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var f=new e,h=new e,d=new e;E.fromCamera=function(t,r){var n=t.position,i=t.direction,o=t.up;e.normalize(i,f),e.normalize(e.cross(f,o,h),h),e.normalize(e.cross(h,f,d),d);var u=h.x,s=h.y,c=h.z,l=f.x,p=f.y,m=f.z,_=d.x,T=d.y,y=d.z,R=n.x,A=n.y,v=n.z,N=u*-R+s*-A+c*-v,S=_*-R+T*-A+y*-v,I=l*R+p*A+m*v;return a(r)?(r[0]=u,r[1]=_,r[2]=-l,r[3]=0,r[4]=s,r[5]=T,r[6]=-p,r[7]=0,r[8]=c,r[9]=y,r[10]=-m,r[11]=0,r[12]=N,r[13]=S,r[14]=I,r[15]=1,r):new E(u,s,c,N,_,T,y,S,-l,-p,-m,I,0,0,0,1)},E.computePerspectiveFieldOfView=function(e,t,r,n,a){var i=Math.tan(.5*e),o=1/i,u=o/t,s=(n+r)/(r-n),c=2*n*r/(r-n);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=c,a[15]=0,a},E.computeOrthographicOffCenter=function(e,t,r,n,a,i,o){var u=1/(t-e),s=1/(n-r),c=1/(i-a),l=-(t+e)*u,E=-(n+r)*s,f=-(i+a)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=E,o[14]=f,o[15]=1,o},E.computePerspectiveOffCenter=function(e,t,r,n,a,i,o){var u=2*a/(t-e),s=2*a/(n-r),c=(t+e)/(t-e),l=(n+r)/(n-r),E=-(i+a)/(i-a),f=-1,h=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=E,o[11]=f,o[12]=0,o[13]=0,o[14]=h,o[15]=0,o},E.computeInfinitePerspectiveOffCenter=function(e,t,r,n,a,i){var o=2*a/(t-e),u=2*a/(n-r),s=(t+e)/(t-e),c=(n+r)/(n-r),l=-1,E=-1,f=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=s,i[9]=c,i[10]=l,i[11]=E,i[12]=0,i[13]=0,i[14]=f,i[15]=0,i},E.computeViewportTransformation=function(e,t,r,a){e=n(e,n.EMPTY_OBJECT);var i=n(e.x,0),o=n(e.y,0),u=n(e.width,0),s=n(e.height,0);t=n(t,0),r=n(r,1);var c=.5*u,l=.5*s,E=.5*(r-t),f=c,h=l,d=E,p=i+c,m=o+l,_=t+E,T=1;return a[0]=f,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=h,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=d,a[11]=0,a[12]=p,a[13]=m,a[14]=_,a[15]=T,a},E.computeView=function(t,r,n,a,i){return i[0]=a.x,i[1]=n.x,i[2]=-r.x,i[3]=0,i[4]=a.y,i[5]=n.y,i[6]=-r.y,i[7]=0,i[8]=a.z,i[9]=n.z,i[10]=-r.z,i[11]=0,i[12]=-e.dot(a,t),i[13]=-e.dot(n,t),i[14]=e.dot(r,t),i[15]=1,i},E.toArray=function(e,t){return a(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]]},E.getElementIndex=function(e,t){return 4*e+t},E.getColumn=function(e,t,r){var n=4*t,a=e[n],i=e[n+1],o=e[n+2],u=e[n+3];return r.x=a,r.y=i,r.z=o,r.w=u,r},E.setColumn=function(e,t,r,n){n=E.clone(e,n);var a=4*t;return n[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n[a+3]=r.w,n},E.setTranslation=function(e,t,r){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]=t.x,r[13]=t.y,r[14]=t.z,r[15]=e[15],r},E.getRow=function(e,t,r){var n=e[t],a=e[t+4],i=e[t+8],o=e[t+12];return r.x=n,r.y=a,r.z=i,r.w=o,r},E.setRow=function(e,t,r,n){return n=E.clone(e,n),n[t]=r.x,n[t+4]=r.y,n[t+8]=r.z,n[t+12]=r.w,n};var p=new e;E.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],p)),r.y=e.magnitude(e.fromElements(t[4],t[5],t[6],p)),r.z=e.magnitude(e.fromElements(t[8],t[9],t[10],p)),r};var m=new e;E.getMaximumScale=function(t){return E.getScale(t,m),e.maximumComponent(m)},E.multiply=function(e,t,r){var n=e[0],a=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],E=e[8],f=e[9],h=e[10],d=e[11],p=e[12],m=e[13],_=e[14],T=e[15],y=t[0],R=t[1],A=t[2],v=t[3],N=t[4],S=t[5],I=t[6],g=t[7],M=t[8],O=t[9],C=t[10],w=t[11],x=t[12],P=t[13],L=t[14],b=t[15],U=n*y+u*R+E*A+p*v,F=a*y+s*R+f*A+m*v,D=i*y+c*R+h*A+_*v,B=o*y+l*R+d*A+T*v,z=n*N+u*S+E*I+p*g,G=a*N+s*S+f*I+m*g,V=i*N+c*S+h*I+_*g,q=o*N+l*S+d*I+T*g,X=n*M+u*O+E*C+p*w,H=a*M+s*O+f*C+m*w,W=i*M+c*O+h*C+_*w,k=o*M+l*O+d*C+T*w,Y=n*x+u*P+E*L+p*b,Z=a*x+s*P+f*L+m*b,K=i*x+c*P+h*L+_*b,j=o*x+l*P+d*L+T*b;return r[0]=U,r[1]=F,r[2]=D,r[3]=B,r[4]=z,r[5]=G,r[6]=V,r[7]=q,r[8]=X,r[9]=H,r[10]=W,r[11]=k,r[12]=Y,r[13]=Z,r[14]=K,r[15]=j,r},E.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},E.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},E.multiplyTransformation=function(e,t,r){var n=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],E=e[10],f=e[12],h=e[13],d=e[14],p=t[0],m=t[1],_=t[2],T=t[4],y=t[5],R=t[6],A=t[8],v=t[9],N=t[10],S=t[12],I=t[13],g=t[14],M=n*p+o*m+c*_,O=a*p+u*m+l*_,C=i*p+s*m+E*_,w=n*T+o*y+c*R,x=a*T+u*y+l*R,P=i*T+s*y+E*R,L=n*A+o*v+c*N,b=a*A+u*v+l*N,U=i*A+s*v+E*N,F=n*S+o*I+c*g+f,D=a*S+u*I+l*g+h,B=i*S+s*I+E*g+d;return r[0]=M,r[1]=O,r[2]=C,r[3]=0,r[4]=w,r[5]=x,r[6]=P,r[7]=0,r[8]=L,r[9]=b,r[10]=U,r[11]=0,r[12]=F,r[13]=D,r[14]=B,r[15]=1,r},E.multiplyByMatrix3=function(e,t,r){var n=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],E=e[10],f=t[0],h=t[1],d=t[2],p=t[3],m=t[4],_=t[5],T=t[6],y=t[7],R=t[8],A=n*f+o*h+c*d,v=a*f+u*h+l*d,N=i*f+s*h+E*d,S=n*p+o*m+c*_,I=a*p+u*m+l*_,g=i*p+s*m+E*_,M=n*T+o*y+c*R,O=a*T+u*y+l*R,C=i*T+s*y+E*R;return r[0]=A,r[1]=v,r[2]=N,r[3]=0,r[4]=S,r[5]=I,r[6]=g,r[7]=0,r[8]=M,r[9]=O,r[10]=C,r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r},E.multiplyByTranslation=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=n*e[0]+a*e[4]+i*e[8]+e[12],u=n*e[1]+a*e[5]+i*e[9]+e[13],s=n*e[2]+a*e[6]+i*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]=o,r[13]=u,r[14]=s,r[15]=e[15],r};var _=new e;E.multiplyByUniformScale=function(e,t,r){return _.x=t,_.y=t,_.z=t,E.multiplyByScale(e,_,r)},E.multiplyByScale=function(e,t,r){var n=t.x,a=t.y,i=t.z;return 1===n&&1===a&&1===i?E.clone(e,r):(r[0]=n*e[0],r[1]=n*e[1],r[2]=n*e[2],r[3]=0,r[4]=a*e[4],r[5]=a*e[5],r[6]=a*e[6],r[7]=0,r[8]=i*e[8],r[9]=i*e[9],r[10]=i*e[10],r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=1,r)},E.multiplyByVector=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=t.w,u=e[0]*n+e[4]*a+e[8]*i+e[12]*o,s=e[1]*n+e[5]*a+e[9]*i+e[13]*o,c=e[2]*n+e[6]*a+e[10]*i+e[14]*o,l=e[3]*n+e[7]*a+e[11]*i+e[15]*o;return r.x=u,r.y=s,r.z=c,r.w=l,r},E.multiplyByPointAsVector=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=e[0]*n+e[4]*a+e[8]*i,u=e[1]*n+e[5]*a+e[9]*i,s=e[2]*n+e[6]*a+e[10]*i;return r.x=o,r.y=u,r.z=s,r},E.multiplyByPoint=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=e[0]*n+e[4]*a+e[8]*i+e[12],u=e[1]*n+e[5]*a+e[9]*i+e[13],s=e[2]*n+e[6]*a+e[10]*i+e[14];return r.x=o,r.y=u,r.z=s,r},E.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},E.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},E.transpose=function(e,t){var r=e[1],n=e[2],a=e[3],i=e[6],o=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]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=o,t[14]=u,t[15]=e[15],t},E.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},E.equals=function(e,t){return e===t||a(e)&&a(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},E.equalsEpsilon=function(e,t,r){return e===t||a(e)&&a(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r&&Math.abs(e[9]-t[9])<=r&&Math.abs(e[10]-t[10])<=r&&Math.abs(e[11]-t[11])<=r&&Math.abs(e[12]-t[12])<=r&&Math.abs(e[13]-t[13])<=r&&Math.abs(e[14]-t[14])<=r&&Math.abs(e[15]-t[15])<=r},E.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},E.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};var T=new c,y=new c,R=new t,A=new t(0,0,0,1);return E.inverse=function(e,r){if(c.equalsEpsilon(E.getRotation(e,T),y,s.EPSILON7)&&t.equals(E.getRow(e,3,R),A))return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=0,r[11]=0,r[12]=-e[12],r[13]=-e[13],r[14]=-e[14],r[15]=1,r;var n=e[0],a=e[4],i=e[8],o=e[12],u=e[1],f=e[5],h=e[9],d=e[13],p=e[2],m=e[6],_=e[10],v=e[14],N=e[3],S=e[7],I=e[11],g=e[15],M=_*g,O=v*I,C=m*g,w=v*S,x=m*I,P=_*S,L=p*g,b=v*N,U=p*I,F=_*N,D=p*S,B=m*N,z=M*f+w*h+x*d-(O*f+C*h+P*d),G=O*u+L*h+F*d-(M*u+b*h+U*d),V=C*u+b*f+D*d-(w*u+L*f+B*d),q=P*u+U*f+B*h-(x*u+F*f+D*h),X=O*a+C*i+P*o-(M*a+w*i+x*o),H=M*n+b*i+U*o-(O*n+L*i+F*o),W=w*n+L*a+B*o-(C*n+b*a+D*o),k=x*n+F*a+D*i-(P*n+U*a+B*i);M=i*d,O=o*h,C=a*d,w=o*f,x=a*h,P=i*f,L=n*d,b=o*u,U=n*h,F=i*u,D=n*f,B=a*u;var Y=M*S+w*I+x*g-(O*S+C*I+P*g),Z=O*N+L*I+F*g-(M*N+b*I+U*g),K=C*N+b*S+D*g-(w*N+L*S+B*g),j=P*N+U*S+B*I-(x*N+F*S+D*I),Q=C*_+P*v+O*m-(x*v+M*m+w*_),J=U*v+M*p+b*_-(L*_+F*v+O*p),$=L*m+B*v+w*p-(D*v+C*p+b*m),ee=D*_+x*p+F*m-(U*m+B*_+P*p),te=n*z+a*G+i*V+o*q;if(Math.abs(te)<s.EPSILON20)throw new l("matrix is not invertible because its determinate is zero.");return te=1/te,r[0]=z*te,r[1]=G*te,r[2]=V*te,r[3]=q*te,r[4]=X*te,r[5]=H*te,r[6]=W*te,r[7]=k*te,r[8]=Y*te,r[9]=Z*te,r[10]=K*te,r[11]=j*te,r[12]=Q*te,r[13]=J*te,r[14]=$*te,r[15]=ee*te,r},E.inverseTransformation=function(e,t){var r=e[0],n=e[1],a=e[2],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],E=e[12],f=e[13],h=e[14],d=-r*E-n*f-a*h,p=-i*E-o*f-u*h,m=-s*E-c*f-l*h;return t[0]=r,t[1]=i,t[2]=s,t[3]=0,t[4]=n,t[5]=o,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=l,t[11]=0,t[12]=d,t[13]=p,t[14]=m,t[15]=1,t},E.IDENTITY=u(new E(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),E.ZERO=u(new E(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),E.COLUMN0ROW0=0,E.COLUMN0ROW1=1,E.COLUMN0ROW2=2,E.COLUMN0ROW3=3,E.COLUMN1ROW0=4,E.COLUMN1ROW1=5,E.COLUMN1ROW2=6,E.COLUMN1ROW3=7,E.COLUMN2ROW0=8,E.COLUMN2ROW1=9,E.COLUMN2ROW2=10,E.COLUMN2ROW3=11,E.COLUMN3ROW0=12,E.COLUMN3ROW1=13,E.COLUMN3ROW2=14,E.COLUMN3ROW3=15,i(E.prototype,{length:{get:function(){return E.packedLength}}}),E.prototype.clone=function(e){return E.clone(this,e)},E.prototype.equals=function(e){return E.equals(this,e)},E.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]&&e[9]===t[r+9]&&e[10]===t[r+10]&&e[11]===t[r+11]&&e[12]===t[r+12]&&e[13]===t[r+13]&&e[14]===t[r+14]&&e[15]===t[r+15]},E.prototype.equalsEpsilon=function(e,t){return E.equalsEpsilon(this,e,t)},E.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]+")"},E}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,r,n,a,i,o,u,s){"use strict";function c(e,t,n,a){this.west=r(e,0),this.south=r(t,0),this.east=r(n,0),this.north=r(a,0)}a(c.prototype,{width:{get:function(){return c.computeWidth(this)}},height:{get:function(){return c.computeHeight(this)}}}),c.packedLength=4,c.pack=function(e,t,n){return n=r(n,0),t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t},c.unpack=function(e,t,a){return t=r(t,0),n(a)||(a=new c),a.west=e[t++],a.south=e[t++],a.east=e[t++],a.north=e[t],a},c.computeWidth=function(e){var t=e.east,r=e.west;return t<r&&(t+=s.TWO_PI),t-r},c.computeHeight=function(e){return e.north-e.south},c.fromDegrees=function(e,t,a,i,o){return e=s.toRadians(r(e,0)),t=s.toRadians(r(t,0)),a=s.toRadians(r(a,0)),i=s.toRadians(r(i,0)),n(o)?(o.west=e,o.south=t,o.east=a,o.north=i,o):new c(e,t,a,i)},c.fromRadians=function(e,t,a,i,o){return n(o)?(o.west=r(e,0),o.south=r(t,0),o.east=r(a,0),o.north=r(i,0),o):new c(e,t,a,i)},c.fromCartographicArray=function(e,t){for(var r=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,u=Number.MAX_VALUE,l=-Number.MAX_VALUE,E=0,f=e.length;E<f;E++){var h=e[E];r=Math.min(r,h.longitude),a=Math.max(a,h.longitude),u=Math.min(u,h.latitude),l=Math.max(l,h.latitude);var d=h.longitude>=0?h.longitude:h.longitude+s.TWO_PI;i=Math.min(i,d),o=Math.max(o,d)}return a-r>o-i&&(r=i,a=o,a>s.PI&&(a-=s.TWO_PI),r>s.PI&&(r-=s.TWO_PI)),n(t)?(t.west=r,t.south=u,t.east=a,t.north=l,t):new c(r,u,a,l)},c.fromCartesianArray=function(e,t,r){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,u=-Number.MAX_VALUE,l=Number.MAX_VALUE,E=-Number.MAX_VALUE,f=0,h=e.length;f<h;f++){var d=t.cartesianToCartographic(e[f]);a=Math.min(a,d.longitude),i=Math.max(i,d.longitude),l=Math.min(l,d.latitude),E=Math.max(E,d.latitude);var p=d.longitude>=0?d.longitude:d.longitude+s.TWO_PI;o=Math.min(o,p),u=Math.max(u,p)}return i-a>u-o&&(a=o,i=u,i>s.PI&&(i-=s.TWO_PI),a>s.PI&&(a-=s.TWO_PI)),n(r)?(r.west=a,r.south=l,r.east=i,r.north=E,r):new c(a,l,i,E)},c.clone=function(e,t){if(n(e))return n(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new c(e.west,e.south,e.east,e.north)},c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.equals=function(e,t){return e===t||n(e)&&n(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},c.prototype.equalsEpsilon=function(e,t){return n(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},c.validate=function(e){},c.southwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.south,r.height=0,r):new e(t.west,t.south)},c.northwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.north,r.height=0,r):new e(t.west,t.north)},c.northeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.north,r.height=0,r):new e(t.east,t.north)},c.southeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.south,r.height=0,r):new e(t.east,t.south)},c.center=function(t,r){var a=t.east,i=t.west;a<i&&(a+=s.TWO_PI);var o=s.negativePiToPi(.5*(i+a)),u=.5*(t.south+t.north);return n(r)?(r.longitude=o,r.latitude=u,r.height=0,r):new e(o,u)},c.intersection=function(e,t,r){var a=e.east,i=e.west,o=t.east,u=t.west;a<i&&o>0?a+=s.TWO_PI:o<u&&a>0&&(o+=s.TWO_PI),a<i&&u<0?u+=s.TWO_PI:o<u&&i<0&&(i+=s.TWO_PI);var l=s.negativePiToPi(Math.max(i,u)),E=s.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&E<=l)){var f=Math.max(e.south,t.south),h=Math.min(e.north,t.north);if(!(f>=h))return n(r)?(r.west=l,r.south=f,r.east=E,r.north=h,r):new c(l,f,E,h)}},c.simpleIntersection=function(e,t,r){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(i>=u||a>=o))return n(r)?(r.west=a,r.south=i,r.east=o,r.north=u,r):new c(a,i,o,u)},c.union=function(e,t,r){n(r)||(r=new c);var a=e.east,i=e.west,o=t.east,u=t.west;a<i&&o>0?a+=s.TWO_PI:o<u&&a>0&&(o+=s.TWO_PI),a<i&&u<0?u+=s.TWO_PI:o<u&&i<0&&(i+=s.TWO_PI);var l=s.convertLongitudeRange(Math.min(i,u)),E=s.convertLongitudeRange(Math.max(a,o));return r.west=l,r.south=Math.min(e.south,t.south),r.east=E,r.north=Math.max(e.north,t.north),r},c.expand=function(e,t,r){return n(r)||(r=new c),r.west=Math.min(e.west,t.longitude),r.south=Math.min(e.south,t.latitude),r.east=Math.max(e.east,t.longitude),r.north=Math.max(e.north,t.latitude),r},c.contains=function(e,t){var r=t.longitude,n=t.latitude,a=e.west,i=e.east;return i<a&&(i+=s.TWO_PI,r<0&&(r+=s.TWO_PI)),(r>a||s.equalsEpsilon(r,a,s.EPSILON14))&&(r<i||s.equalsEpsilon(r,i,s.EPSILON14))&&n>=e.south&&n<=e.north};var l=new e;return c.subsample=function(e,t,a,i){t=r(t,o.WGS84),a=r(a,0),n(i)||(i=[]);var u=0,E=e.north,f=e.south,h=e.east,d=e.west,p=l;p.height=a,p.longitude=d,p.latitude=E,i[u]=t.cartographicToCartesian(p,i[u]),u++,p.longitude=h,i[u]=t.cartographicToCartesian(p,i[u]),u++,p.latitude=f,i[u]=t.cartographicToCartesian(p,i[u]),u++,p.longitude=d,i[u]=t.cartographicToCartesian(p,i[u]),u++,E<0?p.latitude=E:f>0?p.latitude=f:p.latitude=0;for(var m=1;m<8;++m)p.longitude=-Math.PI+m*s.PI_OVER_TWO,c.contains(e,p)&&(i[u]=t.cartographicToCartesian(p,i[u]),u++);return 0===p.latitude&&(p.longitude=d,i[u]=t.cartographicToCartesian(p,i[u]),u++,p.longitude=h,i[u]=t.cartographicToCartesian(p,i[u]),u++),i.length=u,i},c.MAX_VALUE=u(new c(-Math.PI,-s.PI_OVER_TWO,Math.PI,s.PI_OVER_TWO)),c}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,r,n,a,i,o,u,s,c,l,E){"use strict";function f(t,r){this.center=e.clone(n(t,e.ZERO)),this.radius=n(r,0)}var h=new e,d=new e,p=new e,m=new e,_=new e,T=new e,y=new e,R=new e,A=new e,v=new e,N=new e,S=new e;f.fromPoints=function(t,r){if(a(r)||(r=new f),!a(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;for(var n=e.clone(t[0],y),i=e.clone(n,h),o=e.clone(n,d),u=e.clone(n,p),s=e.clone(n,m),c=e.clone(n,_),l=e.clone(n,T),E=t.length,I=1;I<E;I++){e.clone(t[I],n);var g=n.x,M=n.y,O=n.z;g<i.x&&e.clone(n,i),g>s.x&&e.clone(n,s),M<o.y&&e.clone(n,o),M>c.y&&e.clone(n,c),O<u.z&&e.clone(n,u),O>l.z&&e.clone(n,l)}var C=e.magnitudeSquared(e.subtract(s,i,R)),w=e.magnitudeSquared(e.subtract(c,o,R)),x=e.magnitudeSquared(e.subtract(l,u,R)),P=i,L=s,b=C;w>b&&(b=w,P=o,L=c),x>b&&(b=x,P=u,L=l);var U=A;U.x=.5*(P.x+L.x),U.y=.5*(P.y+L.y),U.z=.5*(P.z+L.z);var F=e.magnitudeSquared(e.subtract(L,U,R)),D=Math.sqrt(F),B=v;B.x=i.x,B.y=o.y,B.z=u.z;var z=N;z.x=s.x,z.y=c.y,z.z=l.z;var G=e.multiplyByScalar(e.add(B,z,R),.5,S),V=0;for(I=0;I<E;I++){e.clone(t[I],n);var q=e.magnitude(e.subtract(n,G,R));q>V&&(V=q);var X=e.magnitudeSquared(e.subtract(n,U,R));if(X>F){var H=Math.sqrt(X);D=.5*(D+H),F=D*D;var W=H-D;U.x=(D*U.x+W*n.x)/H,U.y=(D*U.y+W*n.y)/H,U.z=(D*U.z+W*n.z)/H}}return D<V?(e.clone(U,r.center),r.radius=D):(e.clone(G,r.center),r.radius=V),r};var I=new o,g=new e,M=new e,O=new t,C=new t;f.fromRectangle2D=function(e,t,r){return f.fromRectangleWithHeights2D(e,t,0,0,r)},f.fromRectangleWithHeights2D=function(t,r,i,o,u){if(a(u)||(u=new f),!a(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;r=n(r,I),E.southwest(t,O),O.height=i,E.northeast(t,C),C.height=o;var s=r.project(O,g),c=r.project(C,M),l=c.x-s.x,h=c.y-s.y,d=c.z-s.z;u.radius=.5*Math.sqrt(l*l+h*h+d*d);var p=u.center;return p.x=s.x+.5*l,p.y=s.y+.5*h,p.z=s.z+.5*d,u};var w=[];f.fromRectangle3D=function(e,t,r,o){t=n(t,i.WGS84),r=n(r,0);var u;return a(e)&&(u=E.subsample(e,t,r,w)),f.fromPoints(u,o)},f.fromVertices=function(t,r,i,o){if(a(o)||(o=new f),!a(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;r=n(r,e.ZERO),i=n(i,3);var u=y;u.x=t[0]+r.x,u.y=t[1]+r.y,u.z=t[2]+r.z;for(var s=e.clone(u,h),c=e.clone(u,d),l=e.clone(u,p),E=e.clone(u,m),I=e.clone(u,_),g=e.clone(u,T),M=t.length,O=0;O<M;O+=i){var C=t[O]+r.x,w=t[O+1]+r.y,x=t[O+2]+r.z;u.x=C,u.y=w,u.z=x,C<s.x&&e.clone(u,s),C>E.x&&e.clone(u,E),w<c.y&&e.clone(u,c),w>I.y&&e.clone(u,I),x<l.z&&e.clone(u,l),x>g.z&&e.clone(u,g)}var P=e.magnitudeSquared(e.subtract(E,s,R)),L=e.magnitudeSquared(e.subtract(I,c,R)),b=e.magnitudeSquared(e.subtract(g,l,R)),U=s,F=E,D=P;L>D&&(D=L,U=c,F=I),b>D&&(D=b,U=l,F=g);var B=A;B.x=.5*(U.x+F.x),B.y=.5*(U.y+F.y),B.z=.5*(U.z+F.z);var z=e.magnitudeSquared(e.subtract(F,B,R)),G=Math.sqrt(z),V=v;V.x=s.x,V.y=c.y,V.z=l.z;var q=N;q.x=E.x,q.y=I.y,q.z=g.z;var X=e.multiplyByScalar(e.add(V,q,R),.5,S),H=0;for(O=0;O<M;O+=i){u.x=t[O]+r.x,u.y=t[O+1]+r.y,u.z=t[O+2]+r.z;var W=e.magnitude(e.subtract(u,X,R));W>H&&(H=W);var k=e.magnitudeSquared(e.subtract(u,B,R));if(k>z){var Y=Math.sqrt(k);G=.5*(G+Y),z=G*G;var Z=Y-G;B.x=(G*B.x+Z*u.x)/Y,B.y=(G*B.y+Z*u.y)/Y,B.z=(G*B.z+Z*u.z)/Y}}return G<H?(e.clone(B,o.center),o.radius=G):(e.clone(X,o.center),o.radius=H),o},f.fromEncodedCartesianVertices=function(t,r,n){if(a(n)||(n=new f),!a(t)||!a(r)||t.length!==r.length||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var i=y;i.x=t[0]+r[0],i.y=t[1]+r[1],i.z=t[2]+r[2];for(var o=e.clone(i,h),u=e.clone(i,d),s=e.clone(i,p),c=e.clone(i,m),l=e.clone(i,_),E=e.clone(i,T),I=t.length,g=0;g<I;g+=3){var M=t[g]+r[g],O=t[g+1]+r[g+1],C=t[g+2]+r[g+2];i.x=M,i.y=O,i.z=C,M<o.x&&e.clone(i,o),M>c.x&&e.clone(i,c),O<u.y&&e.clone(i,u),O>l.y&&e.clone(i,l),C<s.z&&e.clone(i,s),C>E.z&&e.clone(i,E)}var w=e.magnitudeSquared(e.subtract(c,o,R)),x=e.magnitudeSquared(e.subtract(l,u,R)),P=e.magnitudeSquared(e.subtract(E,s,R)),L=o,b=c,U=w;x>U&&(U=x,L=u,b=l),P>U&&(U=P,L=s,b=E);var F=A;F.x=.5*(L.x+b.x),F.y=.5*(L.y+b.y),F.z=.5*(L.z+b.z);var D=e.magnitudeSquared(e.subtract(b,F,R)),B=Math.sqrt(D),z=v;z.x=o.x,z.y=u.y,z.z=s.z;var G=N;G.x=c.x,G.y=l.y,G.z=E.z;var V=e.multiplyByScalar(e.add(z,G,R),.5,S),q=0;for(g=0;g<I;g+=3){i.x=t[g]+r[g],i.y=t[g+1]+r[g+1],i.z=t[g+2]+r[g+2];var X=e.magnitude(e.subtract(i,V,R));X>q&&(q=X);var H=e.magnitudeSquared(e.subtract(i,F,R));if(H>D){var W=Math.sqrt(H);B=.5*(B+W),D=B*B;var k=W-B;F.x=(B*F.x+k*i.x)/W,F.y=(B*F.y+k*i.y)/W,F.z=(B*F.z+k*i.z)/W}}return B<q?(e.clone(F,n.center),n.radius=B):(e.clone(V,n.center),n.radius=q),n},f.fromCornerPoints=function(t,r,n){a(n)||(n=new f);var i=n.center;return e.add(t,r,i),e.multiplyByScalar(i,.5,i),n.radius=e.distance(i,r),n},f.fromEllipsoid=function(t,r){return a(r)||(r=new f),e.clone(e.ZERO,r.center),r.radius=t.maximumRadius,r};var x=new e;f.fromBoundingSpheres=function(t,r){if(a(r)||(r=new f),!a(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var n=t.length;if(1===n)return f.clone(t[0],r);if(2===n)return f.union(t[0],t[1],r);for(var i=[],o=0;o<n;o++)i.push(t[o].center);r=f.fromPoints(i,r);var u=r.center,s=r.radius;for(o=0;o<n;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,x)+c.radius)}return r.radius=s,r};var P=new e,L=new e,b=new e;f.fromOrientedBoundingBox=function(t,r){a(r)||(r=new f);var n=t.halfAxes,i=c.getColumn(n,0,P),o=c.getColumn(n,1,L),u=c.getColumn(n,2,b),s=e.magnitude(i),l=e.magnitude(o),E=e.magnitude(u);return r.center=e.clone(t.center,r.center),r.radius=Math.max(s,l,E),r},f.clone=function(t,r){if(a(t))return a(r)?(r.center=e.clone(t.center,r.center),r.radius=t.radius,r):new f(t.center,t.radius)},f.packedLength=4,f.pack=function(e,t,r){r=n(r,0);var a=e.center;return t[r++]=a.x,t[r++]=a.y,t[r++]=a.z,t[r]=e.radius,t},f.unpack=function(e,t,r){t=n(t,0),a(r)||(r=new f);var i=r.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],r.radius=e[t],r};var U=new e,F=new e;f.union=function(t,r,n){a(n)||(n=new f);var i=t.center,o=t.radius,u=r.center,s=r.radius,c=e.subtract(u,i,U),l=e.magnitude(c);if(o>=l+s)return t.clone(n),n;if(s>=l+o)return r.clone(n),n;var E=.5*(o+l+s),h=e.multiplyByScalar(c,(-o+E)/l,F);return e.add(h,i,h),e.clone(h,n.center),n.radius=E,n};var D=new e;f.expand=function(t,r,n){n=f.clone(t,n);var a=e.magnitude(e.subtract(r,n.center,D));return a>n.radius&&(n.radius=a),n},f.intersectPlane=function(t,r){var n=t.center,a=t.radius,i=r.normal,o=e.dot(i,n)+r.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},f.transform=function(e,t,r){return a(r)||(r=new f),r.center=l.multiplyByPoint(t,e.center,r.center),r.radius=l.getMaximumScale(t)*e.radius,r};var B=new e;f.distanceSquaredTo=function(t,r){var n=e.subtract(t.center,r,B);return e.magnitudeSquared(n)-t.radius*t.radius},f.transformWithoutScale=function(e,t,r){return a(r)||(r=new f),r.center=l.multiplyByPoint(t,e.center,r.center),r.radius=e.radius,r};var z=new e;f.computePlaneDistances=function(t,r,n,i){a(i)||(i=new s);var o=e.subtract(t.center,r,z),u=e.dot(n,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var G=new e,V=new e,q=new e,X=new e,H=new e,W=new t,k=new Array(8),Y=0;Y<8;++Y)k[Y]=new e;var Z=new o;return f.projectTo2D=function(t,r,a){r=n(r,Z);var i=r.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,G),c=e.cross(e.UNIT_Z,s,V);e.normalize(c,c);var l=e.cross(s,c,q);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var E=e.negate(l,H),h=e.negate(c,X),d=k,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,E,p),e.add(p,h,p),p=d[3],e.add(s,E,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,E,p),e.add(p,h,p),p=d[7],e.add(s,E,p),e.add(p,c,p);for(var m=d.length,_=0;_<m;++_){var T=d[_];e.add(o,T,T);var y=i.cartesianToCartographic(T,W);r.project(y,T)}a=f.fromPoints(d,a),o=a.center;var R=o.x,A=o.y,v=o.z;return o.x=v,o.y=R,o.z=A,a},f.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},f.equals=function(t,r){return t===r||a(t)&&a(r)&&e.equals(t.center,r.center)&&t.radius===r.radius},f.prototype.intersectPlane=function(e){return f.intersectPlane(this,e)},f.prototype.distanceSquaredTo=function(e){return f.distanceSquaredTo(this,e)},f.prototype.computePlaneDistances=function(e,t,r){return f.computePlaneDistances(this,e,t,r)},f.prototype.isOccluded=function(e){return f.isOccluded(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},a={};return t(a,{element:{get:function(){if(a.supportsFullscreen())return document[n.fullscreenElement]}},changeEventName:{get:function(){if(a.supportsFullscreen())return n.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return n.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[n.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.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 a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(n.requestFullscreen=a,r=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(n.requestFullscreen=a,r=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?n.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(n.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?n.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(n.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?n.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(n.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),n.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),n.fullscreenerror=a)}return r},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[n.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[n.exitFullscreen]()},a}),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;r<n;++r)t[r]=parseInt(t[r],10);return t}function a(){if(!t(A)&&(A=!1,!f())){var e=/ Chrome\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(A=!0,v=n(e[1]))}return A}function i(){return a()&&v}function o(){if(!t(N)&&(N=!1,!a()&&!f()&&/ Safari\/[\.0-9]+/.test(R.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(N=!0,S=n(e[1]))}return N}function u(){return o()&&S}function s(){if(!t(I)){I=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(R.userAgent);null!==e&&(I=!0,g=n(e[1]),g.isNightly=!!e[2])}return I}function c(){return s()&&g}function l(){if(!t(M)){M=!1;var e;"Microsoft Internet Explorer"===R.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(M=!0,O=n(e[1]))):"Netscape"===R.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(M=!0,O=n(e[1])))}return M}function E(){return l()&&O}function f(){if(!t(C)){C=!1;var e=/ Edge\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(C=!0,w=n(e[1]))}return C}function h(){return f()&&w}function d(){if(!t(x)){x=!1;var e=/Firefox\/([\.0-9]+)/.exec(R.userAgent); +null!==e&&(x=!0,P=n(e[1]))}return x}function p(){return t(L)||(L=/Windows/i.test(R.appVersion)),L}function m(){return d()&&P}function _(){return t(b)||(b="undefined"!=typeof PointerEvent&&(!t(R.pointerEnabled)||R.pointerEnabled)),b}function T(){if(!t(F)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var r=e.style.imageRendering;F=t(r)&&""!==r,F&&(U=r)}return F}function y(){return T()?U:void 0}var R;R="undefined"!=typeof navigator?navigator:{};var A,v,N,S,I,g,M,O,C,w,x,P,L,b,U,F,D={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:E,isEdge:f,edgeVersion:h,isFirefox:d,firefoxVersion:m,isWindows:p,hardwareConcurrency:e(R.hardwareConcurrency,3),supportsPointerEvents:_,supportsImageRenderingPixelated:T,imageRenderingValue:y};return D.supportsFullscreen=function(){return r.supportsFullscreen()},D.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},D.supportsWebWorkers=function(){return"undefined"!=typeof Worker},D}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,r,n,a,i){"use strict";if(!n.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){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.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},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 Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,r,n,a){switch(n=e(n,0),a=e(a,(r.byteLength-n)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(r,n,a);case o.UNSIGNED_BYTE:return new Uint8Array(r,n,a);case o.SHORT:return new Int16Array(r,n,a);case o.UNSIGNED_SHORT:return new Uint16Array(r,n,a);case o.INT:return new Int32Array(r,n,a);case o.UNSIGNED_INT:return new Uint32Array(r,n,a);case o.FLOAT:return new Float32Array(r,n,a);case o.DOUBLE:return new Float64Array(r,n,a)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var r={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,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,t,r,n,a){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,a.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,n.NONE),this.boundingSphereCV=t.boundingSphereCV}return i.computeNumberOfVertices=function(e){var r=-1;for(var n in e.attributes)if(e.attributes.hasOwnProperty(n)&&t(e.attributes[n])&&t(e.attributes[n].values)){var a=e.attributes[n],i=a.values.length/a.componentsPerAttribute;r=i}return r},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(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 n}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i){"use strict";function o(e,r){this.x=t(e,0),this.y=t(r,0)}o.fromElements=function(e,t,n){return r(n)?(n.x=e,n.y=t,n):new o(e,t)},o.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t):new o(e.x,e.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n]=e.y,r},o.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new o),a.x=e[n++],a.y=e[n],a},o.packArray=function(e,t){var n=e.length;r(t)?t.length=2*n:t=new Array(2*n);for(var a=0;a<n;++a)o.pack(e[a],t,2*a);return t},o.unpackArray=function(e,t){var n=e.length;r(t)?t.length=n/2:t=new Array(n/2);for(var a=0;a<n;a+=2){var i=a/2;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y)},o.minimumComponent=function(e){return Math.min(e.x,e.y)},o.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),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},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var r=o.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y},o.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r},o.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r},o.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r},o.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r},o.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r},o.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var s=new o;o.lerp=function(e,t,r,n){return o.multiplyByScalar(t,r,s),n=o.multiplyByScalar(e,1-r,n),o.add(s,n,n)};var c=new o,l=new o;o.angleBetween=function(e,t){return o.normalize(e,c),o.normalize(t,l),i.acosClamped(o.dot(c,l))};var E=new o;return o.mostOrthogonalAxis=function(e,t){var r=o.normalize(e,E);return o.abs(r,r),t=r.x<=r.y?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y},o.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]},o.equalsEpsilon=function(e,t,n,a){return e===t||r(e)&&r(t)&&i.equalsEpsilon(e.x,t.x,n,a)&&i.equalsEpsilon(e.y,t.y,n,a)},o.ZERO=a(new o(0,0)),o.UNIT_X=a(new o(1,0)),o.UNIT_Y=a(new o(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,r){return o.equalsEpsilon(this,e,t,r)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,r,n,a){"use strict";var i={};i.octEncodeInRange=function(e,t,r){if(r.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),r.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var n=r.x,i=r.y;r.x=(1-Math.abs(i))*a.signNotZero(n),r.y=(1-Math.abs(n))*a.signNotZero(i)}return r.x=a.toSNorm(r.x,t),r.y=a.toSNorm(r.y,t),r},i.octEncode=function(e,t){return i.octEncodeInRange(e,255,t)},i.octDecodeInRange=function(e,r,n,i){if(i.x=a.fromSNorm(e,n),i.y=a.fromSNorm(r,n),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){var o=i.x;i.x=(1-Math.abs(i.y))*a.signNotZero(o),i.y=(1-Math.abs(o))*a.signNotZero(i.y)}return t.normalize(i,i)},i.octDecode=function(e,t,r){return i.octDecodeInRange(e,t,255,r)},i.octPackFloat=function(e){return 256*e.x+e.y};var o=new e;return i.octEncodeFloat=function(e){return i.octEncode(e,o),i.octPackFloat(o)},i.octDecodeFloat=function(e,t){var r=e/256,n=Math.floor(r),a=256*(r-n);return i.octDecode(n,a,t)},i.octPack=function(e,t,r,n){var a=i.octEncodeFloat(e),u=i.octEncodeFloat(t),s=i.octEncode(r,o);return n.x=65536*s.x+a,n.y=65536*s.y+u,n},i.octUnpack=function(e,t,r,n){var a=e.x/65536,o=Math.floor(a),u=65536*(a-o);a=e.y/65536;var s=Math.floor(a),c=65536*(a-s);i.octDecodeFloat(u,t),i.octDecodeFloat(c,r),i.octDecode(o,s,n)},i.compressTextureCoordinates=function(e){var t=4095*e.x|0,r=4095*e.y|0;return 4096*t+r},i.decompressTextureCoordinates=function(e,t){var r=e/4096,n=Math.floor(r);return t.x=n/4095,t.y=(e-4096*n)/4095,t},i}),define("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function a(n,a,s,c,l){r(l)||(l=new t);var E,f,h,d,p,m,_,T;r(a.z)?(E=t.subtract(s,a,i),f=t.subtract(c,a,o),h=t.subtract(n,a,u),d=t.dot(E,E),p=t.dot(E,f),m=t.dot(E,h),_=t.dot(f,f),T=t.dot(f,h)):(E=e.subtract(s,a,i),f=e.subtract(c,a,o),h=e.subtract(n,a,u),d=e.dot(E,E),p=e.dot(E,f),m=e.dot(E,h),_=e.dot(f,f),T=e.dot(f,h));var y=1/(d*_-p*p);return l.y=(_*m-p*T)*y,l.z=(d*T-p*m)*y,l.x=1-l.y-l.z,l}var i=new t,o=new t,u=new t;return a}),define("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(r,n){t(a[r])||(a[r]=!0,console.warn(e(n,r)))}var a={};return n.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.",n}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,r){"use strict";function n(e,t){r(e,t)}return n}),define("Core/EncodedCartesian3",["./Cartesian3","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(){this.high=e.clone(e.ZERO),this.low=e.clone(e.ZERO)}n.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 a={high:0,low:0};n.fromCartesian=function(e,r){t(r)||(r=new n);var i=r.high,o=r.low;return n.encode(e.x,a),i.x=a.high,o.x=a.low,n.encode(e.y,a),i.y=a.high,o.y=a.low,n.encode(e.z,a),i.z=a.high,o.z=a.low,r};var i=new n;return n.writeElements=function(e,t,r){n.fromCartesian(e,i);var a=i.high,o=i.low;t[r]=a.x,t[r+1]=a.y,t[r+2]=a.z,t[r+3]=o.x,t[r+4]=o.y,t[r+5]=o.z},n}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,r,n,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(e){switch(e){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(t){return e(t)&&(t===i.UNSIGNED_BYTE||t===i.UNSIGNED_SHORT||t===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,r,a){return e>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,r,a):new Uint16Array(t,r,a)},r(i)}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function r(e,r,n){var a=e+r;return t.sign(e)!==t.sign(r)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(r)))<n?0:a}var n={};return n.computeDiscriminant=function(e,t,r){var n=t*t-4*e*r;return n},n.computeRealRoots=function(e,n,a){var i;if(0===e)return 0===n?[]:[-a/n];if(0===n){if(0===a)return[0,0];var o=Math.abs(a),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,i<0)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-n/e,i<0?[i,0]:[0,i];var c=n*n,l=4*e*a,E=r(c,-l,t.EPSILON14);if(E<0)return[];var f=-.5*r(n,t.sign(n)*Math.sqrt(E),t.EPSILON14);return n>0?[f/e,a/f]:[a/f,f/e]},n}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function r(e,t,r,n){var a,i,o=e,u=t/3,s=r/3,c=n,l=o*s,E=u*c,f=u*u,h=s*s,d=o*s-f,p=o*c-u*s,m=u*c-h,_=4*d*m-p*p;if(_<0){var T,y,R;f*E>=l*h?(T=o,y=d,R=-2*u*d+o*p):(T=c,y=m,R=-c*p+2*s*m);var A=R<0?-1:1,v=-A*Math.abs(T)*Math.sqrt(-_);i=-R+v;var N=i/2,S=N<0?-Math.pow(-N,1/3):Math.pow(N,1/3),I=i===v?-S:-y/S;return a=y<=0?S+I:-R/(S*S+I*I+y),f*E>=l*h?[(a-u)/o]:[-c/(a+s)]}var g=d,M=-2*u*d+o*p,O=m,C=-c*p+2*s*m,w=Math.sqrt(_),x=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*w,-M)/3);a=2*Math.sqrt(-g);var L=Math.cos(P);i=a*L;var b=a*(-L/2-x*Math.sin(P)),U=i+b>2*u?i-u:b-u,F=o,D=U/F;P=Math.abs(Math.atan2(c*w,-C)/3),a=2*Math.sqrt(-O),L=Math.cos(P),i=a*L,b=a*(-L/2-x*Math.sin(P));var B=-c,z=i+b<2*s?i+s:b+s,G=B/z,V=F*z,q=-U*z-F*B,X=U*B,H=(s*q-u*X)/(-u*q+s*V);return D<=H?D<=G?H<=G?[D,H,G]:[D,G,H]:[G,D,H]:D<=G?[H,D,G]:H<=G?[H,G,D]:[G,H,D]}var n={};return n.computeDiscriminant=function(e,t,r,n){var a=e*e,i=t*t,o=r*r,u=n*n,s=18*e*t*r*n+i*o-27*a*u-4*(e*o*r+i*t*n);return s},n.computeRealRoots=function(e,n,a,i){var o,u;if(0===e)return t.computeRealRoots(n,a,i);if(0===n){if(0===a){if(0===i)return[0,0,0];u=-i/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===i?(o=t.computeRealRoots(e,0,a),0===o.Length?[0]:[o[0],0,o[1]]):r(e,0,a,i)}return 0===a?0===i?(u=-n/e,u<0?[u,0,0]:[0,0,u]):r(e,n,0,i):0===i?(o=t.computeRealRoots(e,n,a),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):r(e,n,a,i)},n}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,r,n){"use strict";function a(t,a,i,o){var u=t*t,s=a-3*u/8,c=i-a*t/2+u*t/8,l=o-i*t/4+a*u/16-3*u*u/256,E=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(E.length>0){var f=-t/4,h=E[E.length-1];if(Math.abs(h)<r.EPSILON14){var d=n.computeRealRoots(1,s,l);if(2===d.length){var p,m=d[0],_=d[1];if(m>=0&&_>=0){var T=Math.sqrt(m),y=Math.sqrt(_);return[f-y,f-T,f+T,f+y]}if(m>=0&&_<0)return p=Math.sqrt(m),[f-p,f+p];if(m<0&&_>=0)return p=Math.sqrt(_),[f-p,f+p]}return[]}if(h>0){var R=Math.sqrt(h),A=(s+h-c/R)/2,v=(s+h+c/R)/2,N=n.computeRealRoots(1,R,A),S=n.computeRealRoots(1,-R,v);return 0!==N.length?(N[0]+=f,N[1]+=f,0!==S.length?(S[0]+=f,S[1]+=f,N[1]<=S[0]?[N[0],N[1],S[0],S[1]]:S[1]<=N[0]?[S[0],S[1],N[0],N[1]]:N[0]>=S[0]&&N[1]<=S[1]?[S[0],N[0],N[1],S[1]]:S[0]>=N[0]&&S[1]<=N[1]?[N[0],S[0],S[1],N[1]]:N[0]>S[0]&&N[0]<S[1]?[S[0],N[0],S[1],N[1]]:[N[0],S[0],N[1],S[1]]):N):0!==S.length?(S[0]+=f,S[1]+=f,S):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,E=i*t+s-4*o,f=c*o-i*a*t+u,h=e.computeRealRoots(1,l,E,f);if(h.length>0){var d,p,m=h[0],_=a-m,T=_*_,y=t/2,R=_/2,A=T-4*o,v=T+4*Math.abs(o),N=c-4*m,S=c+4*Math.abs(m);if(m<0||A*S<N*v){var I=Math.sqrt(N);d=I/2,p=0===I?0:(t*R-i)/I}else{var g=Math.sqrt(A);d=0===g?0:(t*R-i)/g,p=g/2}var M,O;0===y&&0===d?(M=0,O=0):r.sign(y)===r.sign(d)?(M=y+d,O=m/M):(O=y-d,M=m/O);var C,w;0===R&&0===p?(C=0,w=0):r.sign(R)===r.sign(p)?(C=R+p,w=o/C):(w=R-p,C=o/w);var x=n.computeRealRoots(1,M,C),P=n.computeRealRoots(1,O,w);if(0!==x.length)return 0!==P.length?x[1]<=P[0]?[x[0],x[1],P[0],P[1]]:P[1]<=x[0]?[P[0],P[1],x[0],x[1]]:x[0]>=P[0]&&x[1]<=P[1]?[P[0],x[0],x[1],P[1]]:P[0]>=x[0]&&P[1]<=x[1]?[x[0],P[0],P[1],x[1]]:x[0]>P[0]&&x[0]<P[1]?[P[0],x[0],P[1],x[1]]:[x[0],P[0],x[1],P[1]]:x;if(0!==P.length)return P}return[]}var o={};return o.computeDiscriminant=function(e,t,r,n,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=r*r,l=c*r,E=n*n,f=E*n,h=a*a,d=h*a,p=u*c*E-4*s*f-4*e*l*E+18*e*t*r*f-27*i*E*E+256*o*d+a*(18*s*r*n-4*u*l+16*e*c*c-80*e*t*c*n-6*e*u*E+144*i*r*E)+h*(144*e*u*r-27*u*u-128*i*c-192*i*t*n);return p},o.computeRealRoots=function(t,n,o,u,s){if(Math.abs(t)<r.EPSILON15)return e.computeRealRoots(n,o,u,s);var c=n/t,l=o/t,E=u/t,f=s/t,h=c<0?1:0;switch(h+=l<0?h+1:h,h+=E<0?h+1:h,h+=f<0?h+1:h){case 0:return a(c,l,E,f);case 1:return i(c,l,E,f);case 2:return i(c,l,E,f);case 3:return a(c,l,E,f);case 4:return a(c,l,E,f);case 5:return i(c,l,E,f);case 6:return a(c,l,E,f);case 7:return a(c,l,E,f);case 8:return i(c,l,E,f);case 9:return a(c,l,E,f);case 10:return a(c,l,E,f);case 11:return i(c,l,E,f);case 12:return a(c,l,E,f);case 13:return a(c,l,E,f);case 14:return a(c,l,E,f);case 15:return a(c,l,E,f);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function a(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 a.getPoint=function(t,n,a){return r(a)||(a=new e),a=e.multiplyByScalar(t.direction,n,a),e.add(t.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,r,n,a,i,o,u,s,c,l){"use strict";function E(e,t,r,n){var a=t*t-4*e*r;if(!(a<0)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return u<s?(n.root0=u,n.root1=s):(n.root0=s,n.root1=u),n}var c=-t/(2*e);if(0!==c)return n.root0=n.root1=c,n}}function f(t,r,a){n(a)||(a=new i);var o=t.origin,u=t.direction,s=r.center,c=r.radius*r.radius,l=e.subtract(o,s,T),f=e.dot(u,u),h=2*e.dot(u,l),d=e.magnitudeSquared(l)-c,p=E(f,h,d,v);if(n(p))return a.start=p.root0,a.stop=p.root1,a}function h(e,t,r){var n=e+t;return o.sign(e)!==o.sign(t)&&Math.abs(n/Math.max(Math.abs(e),Math.abs(t)))<r?0:n}function d(t,r,n,a,i){var l,E=a*a,f=i*i,d=(t[u.COLUMN1ROW1]-t[u.COLUMN2ROW2])*f,p=i*(a*h(t[u.COLUMN1ROW0],t[u.COLUMN0ROW1],o.EPSILON15)+r.y),m=t[u.COLUMN0ROW0]*E+t[u.COLUMN2ROW2]*f+a*r.x+n,_=f*h(t[u.COLUMN2ROW1],t[u.COLUMN1ROW2],o.EPSILON15),T=i*(a*h(t[u.COLUMN2ROW0],t[u.COLUMN0ROW2])+r.z),y=[]; +if(0===T&&0===_){if(l=s.computeRealRoots(d,p,m),0===l.length)return y;var R=l[0],A=Math.sqrt(Math.max(1-R*R,0));if(y.push(new e(a,i*R,i*-A)),y.push(new e(a,i*R,i*A)),2===l.length){var v=l[1],N=Math.sqrt(Math.max(1-v*v,0));y.push(new e(a,i*v,i*-N)),y.push(new e(a,i*v,i*N))}return y}var S=T*T,I=_*_,g=d*d,M=T*_,O=g+I,C=2*(p*d+M),w=2*m*d+p*p-I+S,x=2*(m*p-M),P=m*m-S;if(0===O&&0===C&&0===w&&0===x)return y;l=c.computeRealRoots(O,C,w,x,P);var L=l.length;if(0===L)return y;for(var b=0;b<L;++b){var U,F=l[b],D=F*F,B=Math.max(1-D,0),z=Math.sqrt(B);U=o.sign(d)===o.sign(m)?h(d*D+m,p*F,o.EPSILON12):o.sign(m)===o.sign(p*F)?h(d*D,p*F+m,o.EPSILON12):h(d*D+p*F,m,o.EPSILON12);var G=h(_*F,T,o.EPSILON15),V=U*G;V<0?y.push(new e(a,i*F,i*z)):V>0?y.push(new e(a,i*F,i*-z)):0!==z?(y.push(new e(a,i*F,i*-z)),y.push(new e(a,i*F,i*z)),++b):y.push(new e(a,i*F,i*z))}return y}var p={};p.rayPlane=function(t,r,a){n(a)||(a=new e);var i=t.origin,u=t.direction,s=r.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON15)){var l=(-r.distance-e.dot(s,i))/c;if(!(l<0))return a=e.multiplyByScalar(u,l,a),e.add(i,a,a)}};var m=new e,_=new e,T=new e,y=new e,R=new e;p.rayTriangleParametric=function(t,n,a,i,u){u=r(u,!1);var s,c,l,E,f,h=t.origin,d=t.direction,p=e.subtract(a,n,m),A=e.subtract(i,n,_),v=e.cross(d,A,T),N=e.dot(p,v);if(u){if(N<o.EPSILON6)return;if(s=e.subtract(h,n,y),l=e.dot(s,v),l<0||l>N)return;if(c=e.cross(s,p,R),E=e.dot(d,c),E<0||l+E>N)return;f=e.dot(A,c)/N}else{if(Math.abs(N)<o.EPSILON6)return;var S=1/N;if(s=e.subtract(h,n,y),l=e.dot(s,v)*S,l<0||l>1)return;if(c=e.cross(s,p,R),E=e.dot(d,c)*S,E<0||l+E>1)return;f=e.dot(A,c)*S}return f},p.rayTriangle=function(t,r,a,i,o,u){var s=p.rayTriangleParametric(t,r,a,i,o);if(n(s)&&!(s<0))return n(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var A=new l;p.lineSegmentTriangle=function(t,r,a,i,o,u,s){var c=A;e.clone(t,c.origin),e.subtract(r,t,c.direction),e.normalize(c.direction,c.direction);var l=p.rayTriangleParametric(c,a,i,o,u);if(!(!n(l)||l<0||l>e.distance(t,r)))return n(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var v={root0:0,root1:0};p.raySphere=function(e,t,r){if(r=f(e,t,r),n(r)&&!(r.stop<0))return r.start=Math.max(r.start,0),r};var N=new l;p.lineSegmentSphere=function(t,r,a,i){var o=N;e.clone(t,o.origin);var u=e.subtract(r,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),i=f(o,a,i),!(!n(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var S=new e,I=new e;p.rayEllipsoid=function(t,r){var n,a,o,u,s,c=r.oneOverRadii,l=e.multiplyComponents(c,t.origin,S),E=e.multiplyComponents(c,t.direction,I),f=e.magnitudeSquared(l),h=e.dot(l,E);if(f>1){if(h>=0)return;var d=h*h;if(n=f-1,a=e.magnitudeSquared(E),o=a*n,d<o)return;if(d>o){u=h*h-o,s=-h+Math.sqrt(u);var p=s/a,m=n/s;return p<m?new i(p,m):{start:m,stop:p}}var _=Math.sqrt(n/a);return new i(_,_)}return f<1?(n=f-1,a=e.magnitudeSquared(E),o=a*n,u=h*h-o,s=-h+Math.sqrt(u),new i(0,s/a)):h<0?(a=e.magnitudeSquared(E),new i(0,-h/a)):void 0};var g=new e,M=new e,O=new e,C=new e,w=new e,x=new u,P=new u,L=new u,b=new u,U=new u,F=new u,D=new u,B=new e,z=new e,G=new t;p.grazingAltitudeLocation=function(t,r){var a=t.origin,i=t.direction;if(!e.equals(a,e.ZERO)){var s=r.geodeticSurfaceNormal(a,g);if(e.dot(i,s)>=0)return a}var c=n(this.rayEllipsoid(t,r)),l=r.transformPositionToScaledSpace(i,g),E=e.normalize(l,l),f=e.mostOrthogonalAxis(l,C),h=e.normalize(e.cross(f,E,M),M),p=e.normalize(e.cross(E,h,O),O),m=x;m[0]=E.x,m[1]=E.y,m[2]=E.z,m[3]=h.x,m[4]=h.y,m[5]=h.z,m[6]=p.x,m[7]=p.y,m[8]=p.z;var _=u.transpose(m,P),T=u.fromScale(r.radii,L),y=u.fromScale(r.oneOverRadii,b),R=U;R[0]=0,R[1]=-i.z,R[2]=i.y,R[3]=i.z,R[4]=0,R[5]=-i.x,R[6]=-i.y,R[7]=i.x,R[8]=0;var A,v,N=u.multiply(u.multiply(_,y,F),R,F),S=u.multiply(u.multiply(N,T,D),m,D),I=u.multiplyByVector(N,a,w),V=d(S,e.negate(I,g),0,0,1),q=V.length;if(q>0){for(var X=e.clone(e.ZERO,z),H=Number.NEGATIVE_INFINITY,W=0;W<q;++W){A=u.multiplyByVector(T,u.multiplyByVector(m,V[W],B),B);var k=e.normalize(e.subtract(A,a,C),C),Y=e.dot(k,i);Y>H&&(H=Y,X=e.clone(A,X))}var Z=r.cartesianToCartographic(X,G);return H=o.clamp(H,0,1),v=e.magnitude(e.subtract(X,a,C))*Math.sqrt(1-H*H),v=c?-v:v,Z.height=v,r.cartographicToCartesian(Z,new e)}};var V=new e;return p.lineSegmentPlane=function(t,r,a,i){n(i)||(i=new e);var u=e.subtract(r,t,V),s=a.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON6)){var l=e.dot(s,t),E=-(a.distance+l)/c;if(!(E<0||E>1))return e.multiplyByScalar(u,E,i),e.add(t,i,i),i}},p.trianglePlaneIntersection=function(t,r,n,a){var i=a.normal,o=a.distance,u=e.dot(i,t)+o<0,s=e.dot(i,r)+o<0,c=e.dot(i,n)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var E,f;if(1!==l&&2!==l||(E=new e,f=new e),1===l){if(u)return p.lineSegmentPlane(t,r,a,E),p.lineSegmentPlane(t,n,a,f),{positions:[t,r,n,E,f],indices:[0,3,4,1,2,4,1,4,3]};if(s)return p.lineSegmentPlane(r,n,a,E),p.lineSegmentPlane(r,t,a,f),{positions:[t,r,n,E,f],indices:[1,3,4,2,0,4,2,4,3]};if(c)return p.lineSegmentPlane(n,t,a,E),p.lineSegmentPlane(n,r,a,f),{positions:[t,r,n,E,f],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return p.lineSegmentPlane(r,t,a,E),p.lineSegmentPlane(n,t,a,f),{positions:[t,r,n,E,f],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return p.lineSegmentPlane(n,r,a,E),p.lineSegmentPlane(t,r,a,f),{positions:[t,r,n,E,f],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return p.lineSegmentPlane(t,n,a,E),p.lineSegmentPlane(r,n,a,f),{positions:[t,r,n,E,f],indices:[0,1,4,0,4,3,2,3,4]}}},p}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,r,n){"use strict";function a(t,r){this.normal=e.clone(t),this.distance=r}a.fromPointNormal=function(r,n,i){var o=-e.dot(n,r);return t(i)?(e.clone(n,i.normal),i.distance=o,i):new a(n,o)};var i=new e;return a.fromCartesian4=function(r,n){var o=e.fromCartesian4(r,i),u=r.w;return t(n)?(e.clone(o,n.normal),n.distance=u,n):new a(o,u)},a.getPointDistance=function(t,r){return e.dot(t.normal,r)+t.distance},a.ORIGIN_XY_PLANE=n(new a(e.UNIT_Z,0)),a.ORIGIN_YZ_PLANE=n(new a(e.UNIT_X,0)),a.ORIGIN_ZX_PLANE=n(new a(e.UNIT_Y,0)),a}),define("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";var n={};return n.calculateACMR=function(r){r=e(r,e.EMPTY_OBJECT);var n=r.indices,a=r.maximumIndex,i=e(r.cacheSize,24),o=n.length;if(!t(a)){a=0;for(var u=0,s=n[u];u<o;)s>a&&(a=s),++u,s=n[u]}for(var c=[],l=0;l<a+1;l++)c[l]=0;for(var E=i+1,f=0;f<o;++f)E-c[n[f]]>i&&(c[n[f]]=E,++E);return(E-i+1)/(o/3)},n.tipsify=function(r){function n(e,t,r,n){for(;t.length>=1;){var a=t[t.length-1];if(t.splice(t.length-1,1),e[a].numLiveTriangles>0)return a}for(;i<n;){if(e[i].numLiveTriangles>0)return++i,i-1;++i}return-1}function a(e,t,r,a,i,o,u){for(var s,c=-1,l=-1,E=0;E<r.length;){var f=r[E];a[f].numLiveTriangles&&(s=0,i-a[f].timeStamp+2*a[f].numLiveTriangles<=t&&(s=i-a[f].timeStamp),(s>l||l===-1)&&(l=s,c=f)),++E}return c===-1?n(a,o,e,u):c}r=e(r,e.EMPTY_OBJECT);var i,o=r.indices,u=r.maximumIndex,s=e(r.cacheSize,24),c=o.length,l=0,E=0,f=o[E],h=c;if(t(u))l=u+1;else{for(;E<h;)f>l&&(l=f),++E,f=o[E];if(l===-1)return 0;++l}for(var d=[],p=0;p<l;p++)d[p]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};E=0;for(var m=0;E<h;)d[o[E]].vertexTriangles.push(m),++d[o[E]].numLiveTriangles,d[o[E+1]].vertexTriangles.push(m),++d[o[E+1]].numLiveTriangles,d[o[E+2]].vertexTriangles.push(m),++d[o[E+2]].numLiveTriangles,++m,E+=3;var _=0,T=s+1;i=1;var y,R,A=[],v=[],N=0,S=[],I=c/3,g=[];for(p=0;p<I;p++)g[p]=!1;for(var M,O;_!==-1;){A=[],R=d[_],O=R.vertexTriangles.length;for(var C=0;C<O;++C)if(m=R.vertexTriangles[C],!g[m]){g[m]=!0,E=m+m+m;for(var w=0;w<3;++w)M=o[E],A.push(M),v.push(M),S[N]=M,++N,y=d[M],--y.numLiveTriangles,T-y.timeStamp>s&&(y.timeStamp=T,++T),++E}_=a(o,s,A,d,T,v,l)}return S},n}),define("Core/GeometryPipeline",["./AttributeCompression","./barycentricCoordinates","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./deprecationWarning","./DeveloperError","./EncodedCartesian3","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryType","./IndexDatatype","./Intersect","./IntersectionTests","./Math","./Matrix3","./Matrix4","./Plane","./PrimitiveType","./Tipsify"],function(e,t,r,n,a,i,o,u,s,c,l,E,f,h,d,p,m,_,T,y,R,A,v,N,S,I){"use strict";function g(e,t,r,n,a){e[t++]=r,e[t++]=n,e[t++]=n,e[t++]=a,e[t++]=a,e[t]=r}function M(e){for(var t=e.length,r=t/3*6,n=_.createTypedArray(t,r),a=0,i=0;i<t;i+=3,a+=6)g(n,a,e[i],e[i+1],e[i+2]);return n}function O(e){var t=e.length;if(t>=3){var r=6*(t-2),n=_.createTypedArray(t,r);g(n,0,e[0],e[1],e[2]);for(var a=6,i=3;i<t;++i,a+=6)g(n,a,e[i-1],e[i],e[i-2]);return n}return new Uint16Array}function C(e){if(e.length>0){for(var t=e.length-1,r=6*(t-1),n=_.createTypedArray(t,r),a=e[0],i=0,o=1;o<t;++o,i+=6)g(n,i,a,e[o],e[o+1]);return n}return new Uint16Array}function w(e){var t={};for(var r in e)if(e.hasOwnProperty(r)&&c(e[r])&&c(e[r].values)){var n=e[r];t[r]=new p({componentDatatype:n.componentDatatype,componentsPerAttribute:n.componentsPerAttribute,normalize:n.normalize,values:[]})}return t}function x(e,t,r){for(var n in t)if(t.hasOwnProperty(n)&&c(t[n])&&c(t[n].values))for(var a=t[n],i=0;i<a.componentsPerAttribute;++i)e[n].values.push(a.values[r*a.componentsPerAttribute+i])}function P(e,t){if(c(t))for(var r=t.values,n=r.length,i=0;i<n;i+=3)a.unpack(r,i,oe),v.multiplyByPoint(e,oe,oe),a.pack(oe,r,i)}function L(e,t){if(c(t))for(var r=t.values,n=r.length,i=0;i<n;i+=3)a.unpack(r,i,oe),A.multiplyByVector(e,oe,oe),oe=a.normalize(oe,oe),a.pack(oe,r,i)}function b(e,t){var r,n=e.length,a={},i=e[0][t].attributes;for(r in i)if(i.hasOwnProperty(r)&&c(i[r])&&c(i[r].values)){for(var o=i[r],s=o.values.length,l=!0,E=1;E<n;++E){var f=e[E][t].attributes[r];if(!c(f)||o.componentDatatype!==f.componentDatatype||o.componentsPerAttribute!==f.componentsPerAttribute||o.normalize!==f.normalize){l=!1;break}s+=f.values.length}l&&(a[r]=new p({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:u.createTypedArray(o.componentDatatype,s)}))}return a}function U(e,t){var n,i,o,u,s,l,E,f=e.length,h=(e[0].modelMatrix,c(e[0][t].indices)),p=e[0][t].primitiveType,m=b(e,t);for(n in m)if(m.hasOwnProperty(n))for(s=m[n].values,u=0,i=0;i<f;++i)for(l=e[i][t].attributes[n].values,E=l.length,o=0;o<E;++o)s[u++]=l[o];var T;if(h){var y=0;for(i=0;i<f;++i)y+=e[i][t].indices.length;var R=d.computeNumberOfVertices(new d({attributes:m,primitiveType:S.POINTS})),A=_.createTypedArray(R,y),v=0,N=0;for(i=0;i<f;++i){var I=e[i][t].indices,g=I.length;for(u=0;u<g;++u)A[v++]=N+I[u];N+=d.computeNumberOfVertices(e[i][t])}T=A}var M,O=new a,C=0;for(i=0;i<f;++i){if(M=e[i][t].boundingSphere,!c(M)){O=void 0;break}a.add(M.center,O,O)}if(c(O))for(a.divideByScalar(O,f,O),i=0;i<f;++i){M=e[i][t].boundingSphere;var w=a.magnitude(a.subtract(M.center,O,ce))+M.radius;w>C&&(C=w)}return new d({attributes:m,indices:T,primitiveType:p,boundingSphere:c(O)?new r(O,C):void 0})}function F(e){if(c(e.indices))return e;for(var t=d.computeNumberOfVertices(e),r=_.createTypedArray(t,t),n=0;n<t;++n)r[n]=n;return e.indices=r,e}function D(e){var t=d.computeNumberOfVertices(e),r=_.createTypedArray(t,3*(t-2));r[0]=1,r[1]=0,r[2]=2;for(var n=3,a=3;a<t;++a)r[n++]=a-1,r[n++]=0,r[n++]=a;return e.indices=r,e.primitiveType=S.TRIANGLES,e}function B(e){var t=d.computeNumberOfVertices(e),r=_.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,a=3;a<t-1;a+=2)r[n++]=a,r[n++]=a-1,r[n++]=a+1,a+2<t&&(r[n++]=a,r[n++]=a+1,r[n++]=a+2);return e.indices=r,e.primitiveType=S.TRIANGLES,e}function z(e){if(c(e.indices))return e;for(var t=d.computeNumberOfVertices(e),r=_.createTypedArray(t,t),n=0;n<t;++n)r[n]=n;return e.indices=r,e}function G(e){var t=d.computeNumberOfVertices(e),r=_.createTypedArray(t,2*(t-1));r[0]=0,r[1]=1;for(var n=2,a=2;a<t;++a)r[n++]=a-1,r[n++]=a;return e.indices=r,e.primitiveType=S.LINES,e}function V(e){var t=d.computeNumberOfVertices(e),r=_.createTypedArray(t,2*t);r[0]=0,r[1]=1;for(var n=2,a=2;a<t;++a)r[n++]=a-1,r[n++]=a;return r[n++]=t-1,r[n]=0,e.indices=r,e.primitiveType=S.LINES,e}function q(e){switch(e.primitiveType){case S.TRIANGLE_FAN:return D(e);case S.TRIANGLE_STRIP:return B(e);case S.TRIANGLES:return F(e);case S.LINE_STRIP:return G(e);case S.LINE_LOOP:return V(e);case S.LINES:return z(e)}return e}function X(e,t){Math.abs(e.y)<R.EPSILON6&&(t?e.y=-R.EPSILON6:e.y=R.EPSILON6)}function H(e,t,r){if(0!==e.y&&0!==t.y&&0!==r.y)return X(e,e.y<0),X(t,t.y<0),void X(r,r.y<0);var n,a=Math.abs(e.y),i=Math.abs(t.y),o=Math.abs(r.y);n=a>i?a>o?R.sign(e.y):R.sign(r.y):i>o?R.sign(t.y):R.sign(r.y);var u=n<0;X(e,u),X(t,u),X(r,u)}function W(e,t,r,n){a.add(e,a.multiplyByScalar(a.subtract(t,e,ve),e.y/(e.y-t.y),ve),r),a.clone(r,n),X(r,!0),X(n,!1)}function k(e,t,r){if(!(e.x>=0||t.x>=0||r.x>=0)){H(e,t,r);var n=e.y<0,a=t.y<0,i=r.y<0,o=0;o+=n?1:0,o+=a?1:0,o+=i?1:0;var u=Me.indices;1===o?(u[1]=3,u[2]=4,u[5]=6,u[7]=6,u[8]=5,n?(W(e,t,Ne,Ie),W(e,r,Se,ge),u[0]=0,u[3]=1,u[4]=2,u[6]=1):a?(W(t,r,Ne,Ie),W(t,e,Se,ge),u[0]=1,u[3]=2,u[4]=0,u[6]=2):i&&(W(r,e,Ne,Ie),W(r,t,Se,ge),u[0]=2,u[3]=0,u[4]=1,u[6]=0)):2===o&&(u[2]=4,u[4]=4,u[5]=3,u[7]=5,u[8]=6,n?a?i||(W(r,e,Ne,Ie),W(r,t,Se,ge),u[0]=0,u[1]=1,u[3]=0,u[6]=2):(W(t,r,Ne,Ie),W(t,e,Se,ge),u[0]=2,u[1]=0,u[3]=2,u[6]=1):(W(e,t,Ne,Ie),W(e,r,Se,ge),u[0]=1,u[1]=2,u[3]=1,u[6]=0));var s=Me.positions;return s[0]=e,s[1]=t,s[2]=r,s.length=3,1!==o&&2!==o||(s[3]=Ne,s[4]=Se,s[5]=Ie,s[6]=ge,s.length=7),Me}}function Y(e,t){var n=e.attributes;if(0!==n.position.values.length){for(var a in n)if(n.hasOwnProperty(a)&&c(n[a])&&c(n[a].values)){var i=n[a];i.values=u.createTypedArray(i.componentDatatype,i.values)}var o=d.computeNumberOfVertices(e);return e.indices=_.createTypedArray(o,e.indices),t&&(e.boundingSphere=r.fromVertices(n.position.values)),e}}function Z(e){var t=e.attributes,r={};for(var n in t)if(t.hasOwnProperty(n)&&c(t[n])&&c(t[n].values)){var a=t[n];r[n]=new p({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:[]})}return new d({attributes:r,indices:[],primitiveType:e.primitiveType})}function K(e,t,r){var n=c(e.geometry.boundingSphere);t=Y(t,n),r=Y(r,n),c(r)&&!c(t)?e.geometry=r:!c(r)&&c(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=r,e.geometry=void 0)}function j(e,r,i,o,u,s,l,E,f,h,d,p){if(c(s)||c(l)||c(E)||c(f)||c(h)){var m=a.fromArray(u,3*e,Oe),_=a.fromArray(u,3*r,Ce),T=a.fromArray(u,3*i,we),y=t(o,m,_,T,xe);if(c(s)){var R=a.fromArray(s,3*e,Oe),A=a.fromArray(s,3*r,Ce),v=a.fromArray(s,3*i,we);a.multiplyByScalar(R,y.x,R),a.multiplyByScalar(A,y.y,A),a.multiplyByScalar(v,y.z,v);var N=a.add(R,A,R);a.add(N,v,N),a.normalize(N,N),a.pack(N,d.normal.values,3*p)}if(c(h)){var S=a.fromArray(h,3*e,Oe),I=a.fromArray(h,3*r,Ce),g=a.fromArray(h,3*i,we);a.multiplyByScalar(S,y.x,S),a.multiplyByScalar(I,y.y,I),a.multiplyByScalar(g,y.z,g);var M;a.equals(S,a.ZERO)&&a.equals(I,a.ZERO)&&a.equals(g,a.ZERO)?(M=Oe,M.x=0,M.y=0,M.z=0):(M=a.add(S,I,S),a.add(M,g,M),a.normalize(M,M)),a.pack(M,d.extrudeDirection.values,3*p)}if(c(l)){var O=a.fromArray(l,3*e,Oe),C=a.fromArray(l,3*r,Ce),w=a.fromArray(l,3*i,we);a.multiplyByScalar(O,y.x,O),a.multiplyByScalar(C,y.y,C),a.multiplyByScalar(w,y.z,w);var x=a.add(O,C,O);a.add(x,w,x),a.normalize(x,x),a.pack(x,d.tangent.values,3*p)}if(c(E)){var P=a.fromArray(E,3*e,Oe),L=a.fromArray(E,3*r,Ce),b=a.fromArray(E,3*i,we);a.multiplyByScalar(P,y.x,P),a.multiplyByScalar(L,y.y,L),a.multiplyByScalar(b,y.z,b);var U=a.add(P,L,P);a.add(U,b,U),a.normalize(U,U),a.pack(U,d.bitangent.values,3*p)}if(c(f)){var F=n.fromArray(f,2*e,Pe),D=n.fromArray(f,2*r,Le),B=n.fromArray(f,2*i,be);n.multiplyByScalar(F,y.x,F),n.multiplyByScalar(D,y.y,D),n.multiplyByScalar(B,y.z,B);var z=n.add(F,D,F);n.add(z,B,z),n.pack(z,d.st.values,2*p)}}}function Q(e,t,r,n,a,i){var o=e.position.values.length/3;if(a!==-1){var u=n[a],s=r[u];return s===-1?(r[u]=o,e.position.values.push(i.x,i.y,i.z),t.push(o),o):(t.push(s),s)}return e.position.values.push(i.x,i.y,i.z),t.push(o),o}function J(e){var t,r,n,i,o,u=e.geometry,s=u.attributes,l=s.position.values,E=c(s.normal)?s.normal.values:void 0,f=c(s.bitangent)?s.bitangent.values:void 0,h=c(s.tangent)?s.tangent.values:void 0,d=c(s.st)?s.st.values:void 0,p=c(s.extrudeDirection)?s.extrudeDirection.values:void 0,m=u.indices,_=Z(u),T=Z(u),y=[];y.length=l.length/3;var R=[];for(R.length=l.length/3,o=0;o<y.length;++o)y[o]=-1,R[o]=-1;var A=m.length;for(o=0;o<A;o+=3){var v=m[o],N=m[o+1],S=m[o+2],I=a.fromArray(l,3*v),g=a.fromArray(l,3*N),M=a.fromArray(l,3*S),O=k(I,g,M);if(c(O)&&O.positions.length>3)for(var C=O.positions,w=O.indices,x=w.length,P=0;P<x;++P){var L=w[P],b=C[L];b.y<0?(t=T.attributes,r=T.indices,n=y):(t=_.attributes,r=_.indices,n=R),i=Q(t,r,n,m,L<3?o+L:-1,b),j(v,N,S,b,l,E,h,f,d,p,t,i)}else c(O)&&(I=O.positions[0],g=O.positions[1],M=O.positions[2]),I.y<0?(t=T.attributes,r=T.indices,n=y):(t=_.attributes,r=_.indices,n=R),i=Q(t,r,n,m,o,I),j(v,N,S,I,l,E,h,f,d,p,t,i),i=Q(t,r,n,m,o+1,g),j(v,N,S,g,l,E,h,f,d,p,t,i),i=Q(t,r,n,m,o+2,M),j(v,N,S,M,l,E,h,f,d,p,t,i)}K(e,T,_)}function $(e){var t,r=e.geometry,n=r.attributes,i=n.position.values,o=r.indices,u=Z(r),s=Z(r),l=o.length,E=[];E.length=i.length/3;var f=[];for(f.length=i.length/3,t=0;t<E.length;++t)E[t]=-1,f[t]=-1;for(t=0;t<l;t+=2){var h=o[t],d=o[t+1],p=a.fromArray(i,3*h,Oe),m=a.fromArray(i,3*d,Ce);Math.abs(p.y)<R.EPSILON6&&(p.y<0?p.y=-R.EPSILON6:p.y=R.EPSILON6),Math.abs(m.y)<R.EPSILON6&&(m.y<0?m.y=-R.EPSILON6:m.y=R.EPSILON6);var _=u.attributes,T=u.indices,A=f,v=s.attributes,N=s.indices,S=E,I=y.lineSegmentPlane(p,m,Ue,we);if(c(I)){var g=a.multiplyByScalar(a.UNIT_Y,5*R.EPSILON9,Fe);p.y<0&&(a.negate(g,g),_=s.attributes,T=s.indices,A=E,v=u.attributes,N=u.indices,S=f);var M=a.add(I,g,De);Q(_,T,A,o,t,p),Q(_,T,A,o,-1,M),a.negate(g,g),a.add(I,g,M),Q(v,N,S,o,-1,M),Q(v,N,S,o,t+1,m)}else{var O,C,w;p.y<0?(O=s.attributes,C=s.indices,w=E):(O=u.attributes,C=u.indices,w=f),Q(O,C,w,o,t,p),Q(O,C,w,o,t+1,m)}}K(e,s,u)}function ee(e){for(var t=e.attributes,r=t.position.values,n=t.prevPosition.values,i=t.nextPosition.values,o=r.length,u=0;u<o;u+=3){var s=a.unpack(r,u,Ge);if(!(s.x>0)){var c=a.unpack(n,u,Ve);(s.y<0&&c.y>0||s.y>0&&c.y<0)&&(u-3>0?(n[u]=r[u-3],n[u+1]=r[u-2],n[u+2]=r[u-1]):a.pack(s,n,u));var l=a.unpack(i,u,qe);(s.y<0&&l.y>0||s.y>0&&l.y<0)&&(u+3<o?(i[u]=r[u+3],i[u+1]=r[u+4],i[u+2]=r[u+5]):a.pack(s,i,u))}}}function te(e){var t,r,o,u=e.geometry,s=u.attributes,l=s.position.values,E=s.prevPosition.values,f=s.nextPosition.values,h=s.expandAndWidth.values,d=c(s.st)?s.st.values:void 0,p=c(s.color)?s.color.values:void 0,m=Z(u),_=Z(u),T=!1,A=l.length/3;for(t=0;t<A;t+=4){var v=t,N=t+2,S=a.fromArray(l,3*v,Ge),I=a.fromArray(l,3*N,Ve);if(Math.abs(S.y)<Ze)for(S.y=Ze*(I.y<0?-1:1),l[3*t+1]=S.y,l[3*(t+1)+1]=S.y,r=3*v;r<3*v+12;r+=3)E[r]=l[3*t],E[r+1]=l[3*t+1],E[r+2]=l[3*t+2];if(Math.abs(I.y)<Ze)for(I.y=Ze*(S.y<0?-1:1),l[3*(t+2)+1]=I.y,l[3*(t+3)+1]=I.y,r=3*v;r<3*v+12;r+=3)f[r]=l[3*(t+2)],f[r+1]=l[3*(t+2)+1],f[r+2]=l[3*(t+2)+2];var g=m.attributes,M=m.indices,O=_.attributes,C=_.indices,w=y.lineSegmentPlane(S,I,Ue,Xe);if(c(w)){T=!0;var x=a.multiplyByScalar(a.UNIT_Y,Ye,He);S.y<0&&(a.negate(x,x),g=_.attributes,M=_.indices,O=m.attributes,C=m.indices);var P=a.add(w,x,We);g.position.values.push(S.x,S.y,S.z,S.x,S.y,S.z),g.position.values.push(P.x,P.y,P.z),g.position.values.push(P.x,P.y,P.z),g.prevPosition.values.push(E[3*v],E[3*v+1],E[3*v+2]),g.prevPosition.values.push(E[3*v+3],E[3*v+4],E[3*v+5]),g.prevPosition.values.push(S.x,S.y,S.z,S.x,S.y,S.z),g.nextPosition.values.push(P.x,P.y,P.z),g.nextPosition.values.push(P.x,P.y,P.z),g.nextPosition.values.push(P.x,P.y,P.z),g.nextPosition.values.push(P.x,P.y,P.z),a.negate(x,x),a.add(w,x,P),O.position.values.push(P.x,P.y,P.z),O.position.values.push(P.x,P.y,P.z),O.position.values.push(I.x,I.y,I.z,I.x,I.y,I.z),O.prevPosition.values.push(P.x,P.y,P.z),O.prevPosition.values.push(P.x,P.y,P.z),O.prevPosition.values.push(P.x,P.y,P.z),O.prevPosition.values.push(P.x,P.y,P.z),O.nextPosition.values.push(I.x,I.y,I.z,I.x,I.y,I.z),O.nextPosition.values.push(f[3*N],f[3*N+1],f[3*N+2]),O.nextPosition.values.push(f[3*N+3],f[3*N+4],f[3*N+5]);var L=n.fromArray(h,2*v,Be),b=Math.abs(L.y);g.expandAndWidth.values.push(-1,b,1,b),g.expandAndWidth.values.push(-1,-b,1,-b),O.expandAndWidth.values.push(-1,b,1,b),O.expandAndWidth.values.push(-1,-b,1,-b);var U=a.magnitudeSquared(a.subtract(w,S,qe));if(U/=a.magnitudeSquared(a.subtract(I,S,qe)),c(p)){var F=i.fromArray(p,4*v,ke),D=i.fromArray(p,4*N,ke),B=R.lerp(F.x,D.x,U),z=R.lerp(F.y,D.y,U),G=R.lerp(F.z,D.z,U),V=R.lerp(F.w,D.w,U);for(r=4*v;r<4*v+8;++r)g.color.values.push(p[r]);for(g.color.values.push(B,z,G,V),g.color.values.push(B,z,G,V),O.color.values.push(B,z,G,V),O.color.values.push(B,z,G,V),r=4*N;r<4*N+8;++r)O.color.values.push(p[r])}if(c(d)){var q=n.fromArray(d,2*v,Be),X=n.fromArray(d,2*(t+3),ze),H=R.lerp(q.x,X.x,U);for(r=2*v;r<2*v+4;++r)g.st.values.push(d[r]);for(g.st.values.push(H,q.y),g.st.values.push(H,X.y),O.st.values.push(H,q.y),O.st.values.push(H,X.y),r=2*N;r<2*N+4;++r)O.st.values.push(d[r])}o=g.position.values.length/3-4,M.push(o,o+2,o+1),M.push(o+1,o+2,o+3),o=O.position.values.length/3-4,C.push(o,o+2,o+1),C.push(o+1,o+2,o+3)}else{var W,k;for(S.y<0?(W=_.attributes,k=_.indices):(W=m.attributes,k=m.indices),W.position.values.push(S.x,S.y,S.z),W.position.values.push(S.x,S.y,S.z),W.position.values.push(I.x,I.y,I.z),W.position.values.push(I.x,I.y,I.z),r=3*t;r<3*t+12;++r)W.prevPosition.values.push(E[r]),W.nextPosition.values.push(f[r]);for(r=2*t;r<2*t+8;++r)W.expandAndWidth.values.push(h[r]),c(d)&&W.st.values.push(d[r]);if(c(p))for(r=4*t;r<4*t+16;++r)W.color.values.push(p[r]);o=W.position.values.length/3-4,k.push(o,o+2,o+1),k.push(o+1,o+2,o+3)}}T&&(ee(_),ee(m)),K(e,_,m)}var re={};re.toWireframe=function(e){var t=e.indices;if(c(t)){switch(e.primitiveType){case S.TRIANGLES:e.indices=M(t);break;case S.TRIANGLE_STRIP:e.indices=O(t);break;case S.TRIANGLE_FAN:e.indices=C(t)}e.primitiveType=S.LINES}return e},re.createLineSegmentsForVectors=function(e,t,n){t=s(t,"normal"),n=s(n,1e4);for(var a=e.attributes.position.values,i=e.attributes[t].values,o=a.length,l=new Float64Array(2*o),E=0,f=0;f<o;f+=3)l[E++]=a[f],l[E++]=a[f+1],l[E++]=a[f+2],l[E++]=a[f]+i[f]*n,l[E++]=a[f+1]+i[f+1]*n,l[E++]=a[f+2]+i[f+2]*n;var h,m=e.boundingSphere;return c(m)&&(h=new r(m.center,m.radius+n)),new d({attributes:{position:new p({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:S.LINES,boundingSphere:h})},re.createAttributeLocations=function(e){var t,r=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=e.attributes,a={},i=0,o=r.length;for(t=0;t<o;++t){var u=r[t];c(n[u])&&(a[u]=i++)}for(var s in n)n.hasOwnProperty(s)&&!c(a[s])&&(a[s]=i++);return a},re.reorderForPreVertexCache=function(e){var t=d.computeNumberOfVertices(e),r=e.indices;if(c(r)){for(var n=new Int32Array(t),a=0;a<t;a++)n[a]=-1;for(var i,o=r,s=o.length,l=_.createTypedArray(t,s),E=0,f=0,h=0;E<s;)i=n[o[E]],i!==-1?l[f]=i:(i=o[E],n[i]=h,l[f]=h,++h),++E,++f;e.indices=l;var p=e.attributes;for(var m in p)if(p.hasOwnProperty(m)&&c(p[m])&&c(p[m].values)){for(var T=p[m],y=T.values,R=0,A=T.componentsPerAttribute,v=u.createTypedArray(T.componentDatatype,h*A);R<t;){var N=n[R];if(N!==-1)for(a=0;a<A;a++)v[A*N+a]=y[A*R+a];++R}T.values=v}}return e},re.reorderForPostVertexCache=function(e,t){var r=e.indices;if(e.primitiveType===S.TRIANGLES&&c(r)){for(var n=r.length,a=0,i=0;i<n;i++)r[i]>a&&(a=r[i]);e.indices=I.tipsify({indices:r,maximumIndex:a,cacheSize:t})}return e},re.fitToUnsignedShortIndices=function(e){var t=[],r=d.computeNumberOfVertices(e);if(c(e.indices)&&r>=R.SIXTY_FOUR_KILOBYTES){var n,a=[],i=[],o=0,u=w(e.attributes),s=e.indices,l=s.length;e.primitiveType===S.TRIANGLES?n=3:e.primitiveType===S.LINES?n=2:e.primitiveType===S.POINTS&&(n=1);for(var E=0;E<l;E+=n){for(var f=0;f<n;++f){var h=s[E+f],p=a[h];c(p)||(p=o++,a[h]=p,x(u,e.attributes,h)),i.push(p)}o+n>=R.SIXTY_FOUR_KILOBYTES&&(t.push(new d({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),a=[],i=[],o=0,u=w(e.attributes))}0!==i.length&&t.push(new d({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var ne=new a,ae=new o;re.projectTo2D=function(e,t,r,n,i){var o=e.attributes[t];i=c(i)?i:new h;for(var s=i.ellipsoid,l=o.values,E=new Float64Array(l.length),f=0,d=0;d<l.length;d+=3){var m=a.fromArray(l,d,ne),_=s.cartesianToCartographic(m,ae),T=i.project(_,ne);E[f++]=T.x,E[f++]=T.y,E[f++]=T.z}return e.attributes[r]=o,e.attributes[n]=new p({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:E}),delete e.attributes[t],e};var ie={high:0,low:0};re.encodeAttribute=function(e,t,r,n){for(var a=e.attributes[t],i=a.values,o=i.length,s=new Float32Array(o),c=new Float32Array(o),l=0;l<o;++l)f.encode(i[l],ie),s[l]=ie.high,c[l]=ie.low;var E=a.componentsPerAttribute;return e.attributes[r]=new p({componentDatatype:u.FLOAT,componentsPerAttribute:E,values:s}),e.attributes[n]=new p({componentDatatype:u.FLOAT,componentsPerAttribute:E,values:c}),delete e.attributes[t],e};var oe=new a,ue=new v,se=new A;re.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(v.equals(t,v.IDENTITY))return e;var n=e.geometry.attributes;P(t,n.position),P(t,n.prevPosition),P(t,n.nextPosition),(c(n.normal)||c(n.tangent)||c(n.bitangent))&&(v.inverse(t,ue),v.transpose(ue,ue),v.getRotation(ue,se),L(se,n.normal),L(se,n.tangent),L(se,n.bitangent));var a=e.geometry.boundingSphere;return c(a)&&(e.geometry.boundingSphere=r.transform(a,t,a)),e.modelMatrix=v.clone(v.IDENTITY),e};var ce=new a;re.combineInstances=function(e){for(var t=[],r=[],n=e.length,a=0;a<n;++a){var i=e[a];c(i.geometry)?t.push(i):c(i.westHemisphereGeometry)&&c(i.eastHemisphereGeometry)&&r.push(i)}var o=[];return t.length>0&&o.push(U(t,"geometry")),r.length>0&&(o.push(U(r,"westHemisphereGeometry")),o.push(U(r,"eastHemisphereGeometry"))),o};var le=new a,Ee=new a,fe=new a,he=new a;re.computeNormal=function(e){for(var t=e.indices,r=e.attributes,n=r.position.values,i=r.position.values.length/3,o=t.length,s=new Array(i),c=new Array(o/3),l=new Array(o),E=0;E<i;E++)s[E]={indexOffset:0,count:0,currentCount:0};var f=0;for(E=0;E<o;E+=3){var h=t[E],d=t[E+1],m=t[E+2],_=3*h,T=3*d,y=3*m;Ee.x=n[_],Ee.y=n[_+1],Ee.z=n[_+2],fe.x=n[T],fe.y=n[T+1],fe.z=n[T+2],he.x=n[y],he.y=n[y+1],he.z=n[y+2],s[h].count++,s[d].count++,s[m].count++,a.subtract(fe,Ee,fe),a.subtract(he,Ee,he),c[f]=a.cross(fe,he,new a),f++}var R=0;for(E=0;E<i;E++)s[E].indexOffset+=R,R+=s[E].count;f=0;var A;for(E=0;E<o;E+=3){A=s[t[E]];var v=A.indexOffset+A.currentCount;l[v]=f,A.currentCount++,A=s[t[E+1]],v=A.indexOffset+A.currentCount,l[v]=f,A.currentCount++,A=s[t[E+2]],v=A.indexOffset+A.currentCount,l[v]=f,A.currentCount++,f++}var N=new Float32Array(3*i);for(E=0;E<i;E++){var S=3*E;if(A=s[E],A.count>0){for(a.clone(a.ZERO,le),f=0;f<A.count;f++)a.add(le,c[l[A.indexOffset+f]],le);a.normalize(le,le),N[S]=le.x,N[S+1]=le.y,N[S+2]=le.z}else N[S]=0,N[S+1]=0,N[S+2]=1}return e.attributes.normal=new p({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:N}),e};var de=new a,pe=new a,me=new a;re.computeTangentAndBitangent=function(e){for(var t=(e.attributes,e.indices),r=e.attributes.position.values,n=e.attributes.normal.values,i=e.attributes.st.values,o=e.attributes.position.values.length/3,s=t.length,c=new Array(3*o),l=0;l<c.length;l++)c[l]=0;var E,f,h;for(l=0;l<s;l+=3){var d=t[l],m=t[l+1],_=t[l+2];E=3*d,f=3*m,h=3*_;var T=2*d,y=2*m,R=2*_,A=r[E],v=r[E+1],N=r[E+2],S=i[T],I=i[T+1],g=i[y+1]-I,M=i[R+1]-I,O=1/((i[y]-S)*M-(i[R]-S)*g),C=(M*(r[f]-A)-g*(r[h]-A))*O,w=(M*(r[f+1]-v)-g*(r[h+1]-v))*O,x=(M*(r[f+2]-N)-g*(r[h+2]-N))*O;c[E]+=C,c[E+1]+=w,c[E+2]+=x,c[f]+=C,c[f+1]+=w,c[f+2]+=x,c[h]+=C,c[h+1]+=w,c[h+2]+=x}var P=new Float32Array(3*o),L=new Float32Array(3*o);for(l=0;l<o;l++){E=3*l,f=E+1,h=E+2;var b=a.fromArray(n,E,de),U=a.fromArray(c,E,me),F=a.dot(b,U);a.multiplyByScalar(b,F,pe),a.normalize(a.subtract(U,pe,U),U),P[E]=U.x,P[f]=U.y,P[h]=U.z,a.normalize(a.cross(b,U,U),U),L[E]=U.x,L[f]=U.y,L[h]=U.z}return e.attributes.tangent=new p({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:P}),e.attributes.bitangent=new p({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:L}),e},re.computeBinormalAndTangent=function(e){return l("computeBinormalAndTangent","computeBinormalAndTangent was deprecated in 1.30. It will be removed in 1.31. Use a computeTangentAndBitangent."),re.computeTangentAndBitangent(e),e.attributes.binormal=e.attributes.bitangent,e};var _e=new n,Te=new a,ye=new a,Re=new a,Ae=new n;re.compressVertices=function(t){var r,i,o=t.attributes.extrudeDirection;if(c(o)){var s=o.values;i=s.length/3;var l=new Float32Array(2*i),E=0;for(r=0;r<i;++r)a.fromArray(s,3*r,Te),a.equals(Te,a.ZERO)?E+=2:(Ae=e.octEncodeInRange(Te,65535,Ae),l[E++]=Ae.x,l[E++]=Ae.y);return t.attributes.compressedAttributes=new p({componentDatatype:u.FLOAT,componentsPerAttribute:2,values:l}),delete t.attributes.extrudeDirection,t}var f=t.attributes.normal,h=t.attributes.st,d=c(f),m=c(h);if(!d&&!m)return t;var _,T,y,R,A=t.attributes.tangent,v=t.attributes.bitangent,N=c(A),S=c(v);d&&(_=f.values),m&&(T=h.values),N&&(y=A.values),S&&(R=v.values);var I=d?_.length:T.length,g=d?3:2;i=I/g;var M=i,O=m&&d?2:1;O+=N||S?1:0,M*=O;var C=new Float32Array(M),w=0;for(r=0;r<i;++r){m&&(n.fromArray(T,2*r,_e),C[w++]=e.compressTextureCoordinates(_e));var x=3*r;d&&c(y)&&c(R)?(a.fromArray(_,x,Te),a.fromArray(y,x,ye),a.fromArray(R,x,Re),e.octPack(Te,ye,Re,_e),C[w++]=_e.x,C[w++]=_e.y):(d&&(a.fromArray(_,x,Te),C[w++]=e.octEncodeFloat(Te)),N&&(a.fromArray(y,x,Te),C[w++]=e.octEncodeFloat(Te)),S&&(a.fromArray(R,x,Te),C[w++]=e.octEncodeFloat(Te)))}return t.attributes.compressedAttributes=new p({componentDatatype:u.FLOAT,componentsPerAttribute:O,values:C}),d&&delete t.attributes.normal,m&&delete t.attributes.st,S&&delete t.attributes.bitangent,N&&delete t.attributes.tangent,t};var ve=new a,Ne=new a,Se=new a,Ie=new a,ge=new a,Me={positions:new Array(7),indices:new Array(9)},Oe=new a,Ce=new a,we=new a,xe=new a,Pe=new n,Le=new n,be=new n,Ue=N.fromPointNormal(a.ZERO,a.UNIT_Y),Fe=new a,De=new a,Be=new n,ze=new n,Ge=new a,Ve=new a,qe=new a,Xe=new a,He=new a,We=new a,ke=new i,Ye=5*R.EPSILON9,Ze=R.EPSILON6;return re.splitLongitude=function(e){var t=e.geometry,n=t.boundingSphere;if(c(n)){var a=n.center.x-n.radius;if(a>0||r.intersectPlane(n,N.ORIGIN_ZX_PLANE)!==T.INTERSECTING)return e}if(t.geometryType!==m.NONE)switch(t.geometryType){case m.POLYLINES:te(e);break;case m.TRIANGLES:J(e);break;case m.LINES:$(e)}else q(t),t.primitiveType===S.TRIANGLES?J(e):t.primitiveType===S.LINES&&$(e);return e},re}),define("Core/WebMercatorProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,r,n,a,i,o,u){"use strict";function s(e){this._ellipsoid=r(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(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 a=this._semimajorAxis,i=t.longitude*a,o=s.geodeticLatitudeToMercatorAngle(t.latitude)*a,u=t.height;return n(r)?(r.x=i,r.y=o,r.z=u,r):new e(i,o,u)},s.prototype.unproject=function(e,r){var a=this._oneOverSemimajorAxis,i=e.x*a,o=s.mercatorAngleToGeodeticLatitude(e.y*a),u=e.z;return n(r)?(r.longitude=i,r.latitude=o,r.height=u,r):new t(i,o,u); +},s}),define("Scene/PrimitivePipeline",["../Core/BoundingSphere","../Core/ComponentDatatype","../Core/defined","../Core/DeveloperError","../Core/Ellipsoid","../Core/FeatureDetection","../Core/GeographicProjection","../Core/Geometry","../Core/GeometryAttribute","../Core/GeometryAttributes","../Core/GeometryPipeline","../Core/IndexDatatype","../Core/Matrix4","../Core/WebMercatorProjection"],function(e,t,r,n,a,i,o,u,s,c,l,E,f,h){"use strict";function d(e,t,n){var a,i=!n,o=e.length;if(!i&&o>1){var u=e[0].modelMatrix;for(a=1;a<o;++a)if(!f.equals(u,e[a].modelMatrix)){i=!0;break}}if(i)for(a=0;a<o;++a)r(e[a].geometry)&&l.transformToWorldCoordinates(e[a]);else f.multiplyTransformation(t,e[0].modelMatrix,t)}function p(e,r){var n=e.attributes,a=n.position,i=a.values.length/a.componentsPerAttribute;n.batchId=new s({componentDatatype:t.FLOAT,componentsPerAttribute:1,values:new Float32Array(i)});for(var o=n.batchId.values,u=0;u<i;++u)o[u]=r}function m(e){for(var t=e.length,n=0;n<t;++n){var a=e[n];r(a.geometry)?p(a.geometry,n):r(a.westHemisphereGeometry)&&r(a.eastHemisphereGeometry)&&(p(a.westHemisphereGeometry,n),p(a.eastHemisphereGeometry,n))}}function _(n){var a,i,o,u=n.instances,s=n.projection,c=n.elementIndexUintSupported,E=n.scene3DOnly,f=n.vertexCacheOptimize,h=n.compressVertices,p=n.modelMatrix,_=u.length;for(a=0;a<_;++a)if(r(u[a].geometry)){o=u[a].geometry.primitiveType;break}if(d(u,p,E),!E)for(a=0;a<_;++a)r(u[a].geometry)&&l.splitLongitude(u[a]);if(m(u),f)for(a=0;a<_;++a){var T=u[a];r(T.geometry)?(l.reorderForPostVertexCache(T.geometry),l.reorderForPreVertexCache(T.geometry)):r(T.westHemisphereGeometry)&&r(T.eastHemisphereGeometry)&&(l.reorderForPostVertexCache(T.westHemisphereGeometry),l.reorderForPreVertexCache(T.westHemisphereGeometry),l.reorderForPostVertexCache(T.eastHemisphereGeometry),l.reorderForPreVertexCache(T.eastHemisphereGeometry))}var y=l.combineInstances(u);for(_=y.length,a=0;a<_;++a){i=y[a];var R,A=i.attributes;if(E)for(R in A)A.hasOwnProperty(R)&&A[R].componentDatatype===t.DOUBLE&&l.encodeAttribute(i,R,R+"3DHigh",R+"3DLow");else for(R in A)if(A.hasOwnProperty(R)&&A[R].componentDatatype===t.DOUBLE){var v=R+"3D",N=R+"2D";l.projectTo2D(i,R,v,N,s),r(i.boundingSphere)&&"position"===R&&(i.boundingSphereCV=e.fromVertices(i.attributes.position2D.values)),l.encodeAttribute(i,v,v+"High",v+"Low"),l.encodeAttribute(i,N,N+"High",N+"Low")}h&&l.compressVertices(i)}if(!c){var S=[];for(_=y.length,a=0;a<_;++a)i=y[a],S=S.concat(l.fitToUnsignedShortIndices(i));y=S}return y}function T(e,t,n,a){var i,o,u,s=a.length-1;if(s>=0){var c=a[s];i=c.offset+c.count,u=c.index,o=n[u].indices.length}else i=0,u=0,o=n[u].indices.length;for(var l=e.length,E=0;E<l;++E){var f=e[E],h=f[t];if(r(h)){var d=h.indices.length;i+d>o&&(i=0,o=n[++u].indices.length),a.push({index:u,offset:i,count:d}),i+=d}}}function y(e,t){var r=[];return T(e,"geometry",t,r),T(e,"westHemisphereGeometry",t,r),T(e,"eastHemisphereGeometry",t,r),r}function R(e,t){var n=e.attributes;for(var a in n)if(n.hasOwnProperty(a)){var i=n[a];r(i)&&r(i.values)&&t.push(i.values.buffer)}r(e.indices)&&t.push(e.indices.buffer)}function A(e,t){for(var r=e.length,n=0;n<r;++n)R(e[n],t)}function v(t){for(var n=1,a=t.length,i=0;i<a;i++){var o=t[i];if(++n,r(o)){var u=o.attributes;n+=6+2*e.packedLength+(r(o.indices)?o.indices.length:0);for(var s in u)if(u.hasOwnProperty(s)&&r(u[s])){var c=u[s];n+=5+c.values.length}}}return n}function N(e,t){var r=e.length,n=new Float64Array(1+16*r),a=0;n[a++]=r;for(var i=0;i<r;i++){var o=e[i];f.pack(o.modelMatrix,n,a),a+=f.packedLength}return t.push(n.buffer),n}function S(e){for(var t=e,r=new Array(t[0]),n=0,a=1;a<t.length;){var i=f.unpack(t,a);a+=f.packedLength,r[n++]={modelMatrix:i}}return r}function I(t){var n=t.length,a=1+(e.packedLength+1)*n,i=new Float32Array(a),o=0;i[o++]=n;for(var u=0;u<n;++u){var s=t[u];r(s)?(i[o++]=1,e.pack(t[u],i,o)):i[o++]=0,o+=e.packedLength}return i}function g(t){for(var r=new Array(t[0]),n=0,a=1;a<t.length;)1===t[a++]&&(r[n]=e.unpack(t,a)),++n,a+=e.packedLength;return r}if(!i.supportsTypedArrays())return{};var M={};return M.combineGeometry=function(t){var n,a,i=t.instances,o=i.length;o>0&&(n=_(t),n.length>0&&(a=l.createAttributeLocations(n[0])));var u;t.createPickOffsets&&n.length>0&&(u=y(i,n));for(var s=new Array(o),c=new Array(o),E=0;E<o;++E){var f=i[E],h=f.geometry;r(h)&&(s[E]=h.boundingSphere,c[E]=h.boundingSphereCV);var d=f.eastHemisphereGeometry,p=f.westHemisphereGeometry;r(d)&&r(p)&&(r(d.boundingSphere)&&r(p.boundingSphere)&&(s[E]=e.union(d.boundingSphere,p.boundingSphere)),r(d.boundingSphereCV)&&r(p.boundingSphereCV)&&(c[E]=e.union(d.boundingSphereCV,p.boundingSphereCV)))}return{geometries:n,modelMatrix:t.modelMatrix,attributeLocations:a,pickOffsets:u,boundingSpheres:s,boundingSpheresCV:c}},M.packCreateGeometryResults=function(t,n){var a=new Float64Array(v(t)),i=[],o={},u=t.length,s=0;a[s++]=u;for(var c=0;c<u;c++){var l=t[c],E=r(l);if(a[s++]=E?1:0,E){a[s++]=l.primitiveType,a[s++]=l.geometryType;var f=r(l.boundingSphere)?1:0;a[s++]=f,f&&e.pack(l.boundingSphere,a,s),s+=e.packedLength;var h=r(l.boundingSphereCV)?1:0;a[s++]=h,h&&e.pack(l.boundingSphereCV,a,s),s+=e.packedLength;var d=l.attributes,p=[];for(var m in d)d.hasOwnProperty(m)&&r(d[m])&&(p.push(m),r(o[m])||(o[m]=i.length,i.push(m)));a[s++]=p.length;for(var _=0;_<p.length;_++){var T=p[_],y=d[T];a[s++]=o[T],a[s++]=y.componentDatatype,a[s++]=y.componentsPerAttribute,a[s++]=y.normalize?1:0,a[s++]=y.values.length,a.set(y.values,s),s+=y.values.length}var R=r(l.indices)?l.indices.length:0;a[s++]=R,R>0&&(a.set(l.indices,s),s+=R)}}return n.push(a.buffer),{stringTable:i,packedData:a}},M.unpackCreateGeometryResults=function(r){for(var n,a=r.stringTable,i=r.packedData,o=new Array(i[0]),l=0,f=1;f<i.length;){var h=1===i[f++];if(h){var d,p,m=i[f++],_=i[f++],T=1===i[f++];T&&(d=e.unpack(i,f)),f+=e.packedLength;var y=1===i[f++];y&&(p=e.unpack(i,f)),f+=e.packedLength;var R,A,v,N=new c,S=i[f++];for(n=0;n<S;n++){var I=a[i[f++]],g=i[f++];v=i[f++];var M=0!==i[f++];R=i[f++],A=t.createTypedArray(g,R);for(var O=0;O<R;O++)A[O]=i[f++];N[I]=new s({componentDatatype:g,componentsPerAttribute:v,normalize:M,values:A})}var C;if(R=i[f++],R>0){var w=A.length/v;for(C=E.createTypedArray(w,R),n=0;n<R;n++)C[n]=i[f++]}o[l++]=new u({primitiveType:m,geometryType:_,boundingSphere:d,boundingSphereCV:p,indices:C,attributes:N})}else o[l++]=void 0}return o},M.packCombineGeometryParameters=function(e,t){for(var r=e.createGeometryResults,n=r.length,a=0;a<n;a++)t.push(r[a].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:N(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof o,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}},M.unpackCombineGeometryParameters=function(e){for(var t=S(e.packedInstances),r=e.createGeometryResults,n=r.length,i=0,u=0;u<n;u++)for(var s=M.unpackCreateGeometryResults(r[u]),c=s.length,l=0;l<c;l++){var E=s[l],d=t[i];d.geometry=E,++i}var p=a.clone(e.ellipsoid),m=e.isGeographic?new o(p):new h(p);return{instances:t,ellipsoid:p,projection:m,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:f.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}},M.packCombineGeometryResults=function(e,t){r(e.geometries)&&A(e.geometries,t);var n=I(e.boundingSpheres),a=I(e.boundingSpheresCV);return t.push(n.buffer,a.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,boundingSpheres:n,boundingSpheresCV:a}},M.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,boundingSpheres:g(e.boundingSpheres),boundingSpheresCV:g(e.boundingSpheresCV)}},M}),define("Core/formatError",["./defined"],function(e){"use strict";function t(t){var r,n=t.name,a=t.message;r=e(n)&&e(a)?n+": "+a:t.toString();var i=t.stack;return e(i)&&(r+="\n"+i),r}return t}),define("Workers/createTaskProcessorWorker",["../Core/defaultValue","../Core/defined","../Core/formatError"],function(e,t,r){"use strict";function n(n){var a,i=[],o={id:void 0,result:void 0,error:void 0};return function(u){var s=u.data;i.length=0,o.id=s.id,o.error=void 0,o.result=void 0;try{o.result=n(s.parameters,i)}catch(e){e instanceof Error?o.error={name:e.name,message:e.message,stack:e.stack}:o.error=e}t(a)||(a=e(self.webkitPostMessage,self.postMessage)),s.canTransferArrayBuffer||(i.length=0);try{a(o,i)}catch(e){o.result=void 0,o.error="postMessage failed with error: "+r(e)+"\n with responseMessage: "+JSON.stringify(o),a(o)}}}return n}),define("Workers/createGeometry",["../Core/defined","../Scene/PrimitivePipeline","./createTaskProcessorWorker","require"],function(e,t,r,n){"use strict";function a(t){var r=o[t];return e(r)||("object"==typeof exports?o[r]=r=n("Workers/"+t):n(["./"+t],function(e){r=e,o[r]=e})),r}function i(r,n){for(var i=r.subTasks,o=i.length,u=new Array(o),s=0;s<o;s++){var c=i[s],l=c.geometry,E=c.moduleName;if(e(E)){var f=a(E);u[s]=f(l,c.offset)}else u[s]=l}return t.packCreateGeometryResults(u,n)}var o={};return r(i)})}(); \ No newline at end of file diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createPointGeometry.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createPointGeometry.js index d2bba5d5..cba79073 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createPointGeometry.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createPointGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,6 +55,6 @@ mersenne-twister.js - https://gist.github.com/banksean/300494 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==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";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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("Core/isArray",["./defined"],function(e){"use strict";var t=Array.isArray;return e(t)||(t=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),t}),define("Core/Check",["./defaultValue","./defined","./DeveloperError","./isArray"],function(e,t,n,r){"use strict";function i(e){return e+" was required but undefined."}function a(e,t,n){return"Expected "+n+" to be typeof "+t+", got "+e}var o={};return o.typeOf={},o.numeric={},o.defined=function(e,r){if(!t(e))throw new n(i(r))},o.numeric.maximum=function(e,t){if(o.typeOf.number(e),o.typeOf.number(t),e>t)throw new n("Expected "+e+" to be at most "+t)},o.numeric.minimum=function(e,t){if(o.typeOf.number(e),o.typeOf.number(t),e<t)throw new n("Expected "+e+" to be at least "+t)},o.typeOf.function=function(e,t){if("function"!=typeof e)throw new n(a(typeof e,"function",t))},o.typeOf.string=function(e,t){if("string"!=typeof e)throw new n(a(typeof e,"string",t))},o.typeOf.number=function(e,t){if("number"!=typeof e)throw new n(a(typeof e,"number",t))},o.typeOf.object=function(e,t){if("object"!=typeof e)throw new n(a(typeof e,"object",t))},o.typeOf.boolean=function(e,t){if("boolean"!=typeof e)throw new n(a(typeof e,"boolean",t))},o}),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 n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(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^=e<<7&2636928640,e^=e<<15&4022730752,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,n,r){"use strict";var i={};i.EPSILON1=.1,i.EPSILON2=.01,i.EPSILON3=.001,i.EPSILON4=1e-4,i.EPSILON5=1e-5,i.EPSILON6=1e-6,i.EPSILON7=1e-7,i.EPSILON8=1e-8,i.EPSILON9=1e-9,i.EPSILON10=1e-10,i.EPSILON11=1e-11,i.EPSILON12=1e-12,i.EPSILON13=1e-13,i.EPSILON14=1e-14,i.EPSILON15=1e-15,i.EPSILON16=1e-16,i.EPSILON17=1e-17,i.EPSILON18=1e-18,i.EPSILON19=1e-19,i.EPSILON20=1e-20,i.GRAVITATIONALPARAMETER=3986004418e5,i.SOLAR_RADIUS=6955e5,i.LUNAR_RADIUS=1737400,i.SIXTY_FOUR_KILOBYTES=65536,i.sign=function(e){return e>0?1:e<0?-1:0},i.signNotZero=function(e){return e<0?-1:1},i.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*i.clamp(e,-1,1)+.5)*n)},i.fromSNorm=function(e,n){return n=t(n,255),i.clamp(e,0,n)/n*2-1},i.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},i.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},i.lerp=function(e,t,n){return(1-n)*e+n*t},i.PI=Math.PI,i.ONE_OVER_PI=1/Math.PI,i.PI_OVER_TWO=.5*Math.PI,i.PI_OVER_THREE=Math.PI/3,i.PI_OVER_FOUR=Math.PI/4,i.PI_OVER_SIX=Math.PI/6,i.THREE_PI_OVER_TWO=3*Math.PI*.5,i.TWO_PI=2*Math.PI,i.ONE_OVER_TWO_PI=1/(2*Math.PI),i.RADIANS_PER_DEGREE=Math.PI/180,i.DEGREES_PER_RADIAN=180/Math.PI,i.RADIANS_PER_ARCSECOND=i.RADIANS_PER_DEGREE/3600,i.toRadians=function(e){return e*i.RADIANS_PER_DEGREE},i.toDegrees=function(e){return e*i.DEGREES_PER_RADIAN},i.convertLongitudeRange=function(e){var t=i.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},i.clampToLatitudeRange=function(e){return i.clamp(e,-1*i.PI_OVER_TWO,i.PI_OVER_TWO)},i.negativePiToPi=function(e){return i.zeroToTwoPi(e+i.PI)-i.PI},i.zeroToTwoPi=function(e){var t=i.mod(e,i.TWO_PI);return Math.abs(t)<i.EPSILON14&&Math.abs(e)>i.EPSILON14?i.TWO_PI:t},i.mod=function(e,t){return(e%t+t)%t},i.equalsEpsilon=function(e,n,r,i){i=t(i,r);var a=Math.abs(e-n);return a<=i||a<=r*Math.max(Math.abs(e),Math.abs(n))};var a=[1];i.factorial=function(e){var t=a.length;if(e>=t)for(var n=a[t-1],r=t;r<=e;r++)a.push(n*r);return a[e]},i.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},i.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},i.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},i.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return i.setRandomNumberSeed=function(t){o=new e(t)},i.nextRandomNumber=function(){return o.random()},i.acosClamped=function(e){return Math.acos(i.clamp(e,-1,1))},i.asinClamped=function(e){return Math.asin(i.clamp(e,-1,1))},i.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},i.logBase=function(e,t){return Math.log(e)/Math.log(t)},i.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},i}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var i=e.clock,a=e.cone,u=t(e.magnitude,1),E=u*Math.sin(a);return r.x=E*Math.cos(i),r.y=E*Math.sin(i),r.z=u*Math.cos(a),r},o.fromElements=function(e,t,r,i){return n(i)?(i.x=e,i.y=t,i.z=r,i):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new o),i.x=e[r++],i.y=e[r++],i.z=e[r],i},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var i=0;i<r;++i)o.pack(e[i],t,3*i);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var i=0;i<r;i+=3){var a=i/3;t[a]=o.unpack(e,i,t[a])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,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};var E=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,E),r=o.multiplyByScalar(e,1-n,r),o.add(E,r,r)};var s=new o,c=new o;o.angleBetween=function(e,t){o.normalize(e,s),o.normalize(t,c);var n=o.dot(s,c),r=o.magnitude(o.cross(s,c,s));return Math.atan2(r,n)};var _=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,_);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,i){return e===t||n(e)&&n(t)&&a.equalsEpsilon(e.x,t.x,r,i)&&a.equalsEpsilon(e.y,t.y,r,i)&&a.equalsEpsilon(e.z,t.z,r,i)},o.cross=function(e,t,n){var r=e.x,i=e.y,a=e.z,o=t.x,u=t.y,E=t.z,s=i*E-a*u,c=a*o-r*E,_=r*u-i*o;return n.x=s,n.y=c,n.z=_,n},o.fromDegrees=function(e,t,n,r,i){return e=a.toRadians(e),t=a.toRadians(t),o.fromRadians(e,t,n,r,i)};var T=new o,R=new o,l=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,i,a,u){i=t(i,0);var E=n(a)?a.radiiSquared:l,s=Math.cos(r);T.x=s*Math.cos(e),T.y=s*Math.sin(e),T.z=Math.sin(r),T=o.normalize(T,T),o.multiplyComponents(E,T,R);var c=Math.sqrt(o.dot(T,R));return R=o.divideByScalar(R,c,R),T=o.multiplyByScalar(T,i,T),n(u)||(u=new o),o.add(R,T,u)},o.fromDegreesArray=function(e,t,r){var i=e.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],E=e[a+1],s=a/2;r[s]=o.fromDegrees(u,E,0,t,r[s])}return r},o.fromRadiansArray=function(e,t,r){var i=e.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],E=e[a+1],s=a/2;r[s]=o.fromRadians(u,E,0,t,r[s])}return r},o.fromDegreesArrayHeights=function(e,t,r){var i=e.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],E=e[a+1],s=e[a+2],c=a/3;r[c]=o.fromDegrees(u,E,s,t,r[c])}return r},o.fromRadiansArrayHeights=function(e,t,r){var i=e.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],E=e[a+1],s=e[a+2],c=a/3;r[c]=o.fromRadians(u,E,s,t,r[c])}return r},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,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function i(n,i,u,E,s){var c=n.x,_=n.y,T=n.z,R=i.x,l=i.y,A=i.z,f=c*c*R*R,h=_*_*l*l,N=T*T*A*A,d=f+h+N,I=Math.sqrt(1/d),S=e.multiplyByScalar(n,I,a);if(d<E)return isFinite(I)?e.clone(S,s):void 0;var M=u.x,O=u.y,m=u.z,y=o;y.x=S.x*M*2,y.y=S.y*O*2,y.z=S.z*m*2;var p,C,U,L,F,P,g,D,w,v,B,x=(1-I)*e.magnitude(n)/(.5*e.magnitude(y)),z=0;do{x-=z,U=1/(1+x*M),L=1/(1+x*O),F=1/(1+x*m),P=U*U,g=L*L,D=F*F,w=P*U,v=g*L,B=D*F,p=f*P+h*g+N*D-1,C=f*w*M+h*v*O+N*B*m;var G=-2*C;z=p/G}while(Math.abs(p)>r.EPSILON12);return t(s)?(s.x=c*U,s.y=_*L,s.z=T*F,s):new e(c*U,_*L,T*F)}var a=new e,o=new e;return i}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,i,a,o){"use strict";function u(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)}u.fromRadians=function(e,r,i,a){return i=t(i,0),n(a)?(a.longitude=e,a.latitude=r,a.height=i,a):new u(e,r,i)},u.fromDegrees=function(e,t,n,r){return e=a.toRadians(e),t=a.toRadians(t),u.fromRadians(e,t,n,r)};var E=new e,s=new e,c=new e,_=new e(1/6378137,1/6378137,1/6356752.314245179),T=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),R=a.EPSILON1;return u.fromCartesian=function(t,r,i){var l=n(r)?r.oneOverRadii:_,A=n(r)?r.oneOverRadiiSquared:T,f=n(r)?r._centerToleranceSquared:R,h=o(t,l,A,f,s);if(n(h)){var N=e.multiplyComponents(h,A,E);N=e.normalize(N,N);var d=e.subtract(t,h,c),I=Math.atan2(N.y,N.x),S=Math.asin(N.z),M=a.sign(e.dot(d,t))*e.magnitude(d);return n(i)?(i.longitude=I,i.latitude=S,i.height=M,i):new u(I,S,M)}},u.clone=function(e,t){if(n(e))return n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},u.ZERO=i(new u(0,0,0)),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,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,i,a,o,u,E){"use strict";function s(t,r,i,a){r=n(r,0),i=n(i,0),a=n(a,0),t._radii=new e(r,i,a),t._radiiSquared=new e(r*r,i*i,a*a),t._radiiToTheFourth=new e(r*r*r*r,i*i*i*i,a*a*a*a),t._oneOverRadii=new e(0===r?0:1/r,0===i?0:1/i,0===a?0:1/a),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===i?0:1/(i*i),0===a?0:1/(a*a)),t._minimumRadius=Math.min(r,i,a),t._maximumRadius=Math.max(r,i,a),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function c(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,s(this,e,t,n)}i(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,n){if(r(t)){var i=t._radii;return r(n)?(e.clone(i,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new c(i.x,i.y,i.z)}},c.fromCartesian3=function(e,t){return r(t)||(t=new c),r(e)?(s(t,e.x,e.y,e.z),t):t},c.WGS84=o(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=o(new c(1,1,1)),c.MOON=o(new c(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),c.prototype.clone=function(e){return c.clone(this,e)},c.packedLength=e.packedLength,c.pack=function(t,r,i){return i=n(i,0),e.pack(t._radii,r,i),r},c.unpack=function(t,r,i){r=n(r,0);var a=e.unpack(t,r);return c.fromCartesian3(a,i)},c.prototype.geocentricSurfaceNormal=e.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(t,n){var i=t.longitude,a=t.latitude,o=Math.cos(a),u=o*Math.cos(i),E=o*Math.sin(i),s=Math.sin(a);return r(n)||(n=new e),n.x=u,n.y=E,n.z=s,e.normalize(n,n)},c.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var _=new e,T=new e;c.prototype.cartographicToCartesian=function(t,n){var i=_,a=T;this.geodeticSurfaceNormalCartographic(t,i),e.multiplyComponents(this._radiiSquared,i,a);var o=Math.sqrt(e.dot(i,a));return e.divideByScalar(a,o,a),e.multiplyByScalar(i,t.height,i),r(n)||(n=new e),e.add(a,i,n)},c.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;i<n;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var R=new e,l=new e,A=new e;return c.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,l);if(r(a)){var o=this.geodeticSurfaceNormal(a,R),E=e.subtract(n,a,A),s=Math.atan2(o.y,o.x),c=Math.asin(o.z),_=u.sign(e.dot(E,n))*e.magnitude(E);return r(i)?(i.longitude=s,i.latitude=c,i.height=_,i):new t(s,c,_)}},c.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;i<n;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t},c.prototype.scaleToGeodeticSurface=function(e,t){return E(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},c.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var i=t.x,a=t.y,o=t.z,u=this._oneOverRadiiSquared,E=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*u.z);return e.multiplyByScalar(t,E,n)},c.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},c.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},c.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},c.prototype.toString=function(){return this._radii.toString()},c.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,i,a){i=n(i,0);var o=this._sqauredXOverSquaredZ;if(r(a)||(a=new e),a.x=0,a.y=0,a.z=t.z*(1-o),!(Math.abs(a.z)>=this._radii.z-i))return a},c}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,i,a,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return i(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var i=this._semimajorAxis,a=t.longitude*i,o=t.latitude*i,u=t.height;return r(n)?(n.x=a,n.y=o,n.z=u,n):new e(a,o,u)},u.prototype.unproject=function(e,n){var i=this._oneOverSemimajorAxis,a=e.x*i,o=e.y*i,u=e.z;return r(n)?(n.longitude=a,n.latitude=o,n.height=u,n):new t(a,o,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";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a,o){"use strict";function u(e,n,r,i,a,o,u,E,s){this[0]=t(e,0),this[1]=t(i,0),this[2]=t(u,0),this[3]=t(n,0),this[4]=t(a,0),this[5]=t(E,0),this[6]=t(r,0),this[7]=t(o,0),this[8]=t(s,0)}function E(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function s(e){for(var t=0,n=0;n<3;++n){var r=e[u.getElementIndex(l[n],R[n])];t+=2*r*r}return Math.sqrt(t)}function c(e,t){for(var n=o.EPSILON15,r=0,i=1,a=0;a<3;++a){var E=Math.abs(e[u.getElementIndex(l[a],R[a])]);E>r&&(i=a,r=E)}var s=1,c=0,_=R[i],T=l[i];if(Math.abs(e[u.getElementIndex(T,_)])>n){var A,f=e[u.getElementIndex(T,T)],h=e[u.getElementIndex(_,_)],N=e[u.getElementIndex(T,_)],d=(f-h)/2/N;A=d<0?-1/(-d+Math.sqrt(1+d*d)):1/(d+Math.sqrt(1+d*d)),s=1/Math.sqrt(1+A*A),c=A*s}return t=u.clone(u.IDENTITY,t),t[u.getElementIndex(_,_)]=t[u.getElementIndex(T,T)]=s,t[u.getElementIndex(T,_)]=c,t[u.getElementIndex(_,T)]=-c,t}u.packedLength=9,u.pack=function(e,n,r){return r=t(r,0),n[r++]=e[0],n[r++]=e[1],n[r++]=e[2],n[r++]=e[3],n[r++]=e[4],n[r++]=e[5],n[r++]=e[6],n[r++]=e[7],n[r++]=e[8],n},u.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new u),i[0]=e[r++],i[1]=e[r++],i[2]=e[r++],i[3]=e[r++],i[4]=e[r++],i[5]=e[r++],i[6]=e[r++],i[7]=e[r++],i[8]=e[r++],i},u.clone=function(e,t){if(n(e))return n(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 u(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},u.fromArray=function(e,r,i){return r=t(r,0),n(i)||(i=new u),i[0]=e[r],i[1]=e[r+1],i[2]=e[r+2],i[3]=e[r+3],i[4]=e[r+4],i[5]=e[r+5],i[6]=e[r+6],i[7]=e[r+7],i[8]=e[r+8],i},u.fromColumnMajorArray=function(e,t){return u.clone(e,t)},u.fromRowMajorArray=function(e,t){return n(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 u(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},u.fromQuaternion=function(e,t){var r=e.x*e.x,i=e.x*e.y,a=e.x*e.z,o=e.x*e.w,E=e.y*e.y,s=e.y*e.z,c=e.y*e.w,_=e.z*e.z,T=e.z*e.w,R=e.w*e.w,l=r-E-_+R,A=2*(i-T),f=2*(a+c),h=2*(i+T),N=-r+E-_+R,d=2*(s-o),I=2*(a-c),S=2*(s+o),M=-r-E+_+R;return n(t)?(t[0]=l,t[1]=h,t[2]=I,t[3]=A,t[4]=N,t[5]=S,t[6]=f,t[7]=d,t[8]=M,t):new u(l,A,f,h,N,d,I,S,M)},u.fromHeadingPitchRoll=function(e,t){var r=Math.cos(-e.pitch),i=Math.cos(-e.heading),a=Math.cos(e.roll),o=Math.sin(-e.pitch),E=Math.sin(-e.heading),s=Math.sin(e.roll),c=r*i,_=-a*E+s*o*i,T=s*E+a*o*i,R=r*E,l=a*i+s*o*E,A=-o*a+a*o*E,f=-o,h=s*r,N=a*r;return n(t)?(t[0]=c,t[1]=R,t[2]=f,t[3]=_,t[4]=l,t[5]=h,t[6]=T,t[7]=A,t[8]=N,t):new u(c,_,T,R,l,A,f,h,N)},u.fromScale=function(e,t){return n(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 u(e.x,0,0,0,e.y,0,0,0,e.z)},u.fromUniformScale=function(e,t){return n(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 u(e,0,0,0,e,0,0,0,e)},u.fromCrossProduct=function(e,t){return n(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 u(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},u.fromRotationX=function(e,t){var r=Math.cos(e),i=Math.sin(e);return n(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=r,t[5]=i,t[6]=0,t[7]=-i,t[8]=r,t):new u(1,0,0,0,r,-i,0,i,r)},u.fromRotationY=function(e,t){var r=Math.cos(e),i=Math.sin(e);return n(t)?(t[0]=r,t[1]=0,t[2]=-i,t[3]=0,t[4]=1,t[5]=0,t[6]=i,t[7]=0,t[8]=r,t):new u(r,0,i,0,1,0,-i,0,r)},u.fromRotationZ=function(e,t){var r=Math.cos(e),i=Math.sin(e);return n(t)?(t[0]=r,t[1]=i,t[2]=0,t[3]=-i,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new u(r,-i,0,i,r,0,0,0,1)},u.toArray=function(e,t){return n(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]]},u.getElementIndex=function(e,t){return 3*e+t},u.getColumn=function(e,t,n){var r=3*t,i=e[r],a=e[r+1],o=e[r+2];return n.x=i,n.y=a,n.z=o,n},u.setColumn=function(e,t,n,r){r=u.clone(e,r);var i=3*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},u.getRow=function(e,t,n){var r=e[t],i=e[t+3],a=e[t+6];return n.x=r,n.y=i,n.z=a,n},u.setRow=function(e,t,n,r){return r=u.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var _=new e;u.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],_)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],_)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],_)),n};var T=new e;u.getMaximumScale=function(t){return u.getScale(t,T),e.maximumComponent(T)},u.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],i=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],o=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],E=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],s=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],c=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],_=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=r,n[1]=i,n[2]=a,n[3]=o,n[4]=u,n[5]=E,n[6]=s,n[7]=c,n[8]=_,n},u.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},u.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},u.multiplyByVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[3]*i+e[6]*a,u=e[1]*r+e[4]*i+e[7]*a,E=e[2]*r+e[5]*i+e[8]*a;return n.x=o,n.y=u,n.z=E,n},u.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},u.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},u.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},u.transpose=function(e,t){var n=e[0],r=e[3],i=e[6],a=e[1],o=e[4],u=e[7],E=e[2],s=e[5],c=e[8];return t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=u,t[6]=E,t[7]=s,t[8]=c,t};var R=[1,0,0],l=[2,2,1],A=new u,f=new u;return u.computeEigenDecomposition=function(e,t){var r=o.EPSILON20,i=10,a=0,_=0;n(t)||(t={});for(var T=t.unitary=u.clone(u.IDENTITY,t.unitary),R=t.diagonal=u.clone(e,t.diagonal),l=r*E(R);_<i&&s(R)>l;)c(R,A),u.transpose(A,f),u.multiply(R,A,R),u.multiply(f,R,R),u.multiply(T,A,T),++a>2&&(++_,a=0);return t},u.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},u.determinant=function(e){var t=e[0],n=e[3],r=e[6],i=e[1],a=e[4],o=e[7],u=e[2],E=e[5],s=e[8];return t*(a*s-E*o)+i*(E*r-n*s)+u*(n*o-a*r)},u.inverse=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],E=e[5],s=e[6],c=e[7],_=e[8],T=u.determinant(e);t[0]=o*_-c*E,t[1]=c*i-r*_,t[2]=r*E-o*i,t[3]=s*E-a*_,t[4]=n*_-s*i,t[5]=a*i-n*E,t[6]=a*c-s*o,t[7]=s*r-n*c,t[8]=n*o-a*r;var R=1/T;return u.multiplyByScalar(t,R,t)},u.equals=function(e,t){return e===t||n(e)&&n(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]},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r},u.IDENTITY=a(new u(1,0,0,0,1,0,0,0,1)),u.ZERO=a(new u(0,0,0,0,0,0,0,0,0)),u.COLUMN0ROW0=0,u.COLUMN0ROW1=1,u.COLUMN0ROW2=2,u.COLUMN1ROW0=3,u.COLUMN1ROW1=4,u.COLUMN1ROW2=5,u.COLUMN2ROW0=6,u.COLUMN2ROW1=7,u.COLUMN2ROW2=8,r(u.prototype,{length:{get:function(){return u.packedLength}}}),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},u}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i){"use strict";function a(t,n,r,i){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0),this.w=e(i,0)}a.fromElements=function(e,n,r,i,o){return t(o)?(o.x=e,o.y=n,o.z=r,o.w=i,o):new a(e,n,r,i)},a.fromColor=function(e,n){return t(n)?(n.x=e.red,n.y=e.green,n.z=e.blue,n.w=e.alpha,n):new a(e.red,e.green,e.blue,e.alpha)},a.clone=function(e,n){if(t(e))return t(n)?(n.x=e.x,n.y=e.y,n.z=e.z,n.w=e.w,n):new a(e.x,e.y,e.z,e.w)},a.packedLength=4,a.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w,n},a.unpack=function(n,r,i){return r=e(r,0),t(i)||(i=new a),i.x=n[r++],i.y=n[r++],i.z=n[r++],i.w=n[r],i},a.packArray=function(e,n){var r=e.length;t(n)?n.length=4*r:n=new Array(4*r);for(var i=0;i<r;++i)a.pack(e[i],n,4*i);return n},a.unpackArray=function(e,n){var r=e.length;t(n)?n.length=r/4:n=new Array(r/4);for(var i=0;i<r;i+=4){var o=i/4;n[o]=a.unpack(e,i,n[o])}return n},a.fromArray=a.unpack,a.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},a.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},a.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},a.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},a.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},a.magnitude=function(e){return Math.sqrt(a.magnitudeSquared(e))};var o=new a;a.distance=function(e,t){return a.subtract(e,t,o),a.magnitude(o)},a.distanceSquared=function(e,t){return a.subtract(e,t,o),a.magnitudeSquared(o)},a.normalize=function(e,t){var n=a.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t},a.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},a.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},a.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},a.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},a.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},a.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},a.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},a.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,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.w=Math.abs(e.w),t};var u=new a;a.lerp=function(e,t,n,r){return a.multiplyByScalar(t,n,u),r=a.multiplyByScalar(e,1-n,r),a.add(u,r,r)};var E=new a;return a.mostOrthogonalAxis=function(e,t){var n=a.normalize(e,E);return a.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?a.clone(a.UNIT_X,t):a.clone(a.UNIT_W,t):n.z<=n.w?a.clone(a.UNIT_Z,t):a.clone(a.UNIT_W,t):n.y<=n.z?n.y<=n.w?a.clone(a.UNIT_Y,t):a.clone(a.UNIT_W,t):n.z<=n.w?a.clone(a.UNIT_Z,t):a.clone(a.UNIT_W,t)},a.equals=function(e,n){return e===n||t(e)&&t(n)&&e.x===n.x&&e.y===n.y&&e.z===n.z&&e.w===n.w},a.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},a.equalsEpsilon=function(e,n,r,a){return e===n||t(e)&&t(n)&&i.equalsEpsilon(e.x,n.x,r,a)&&i.equalsEpsilon(e.y,n.y,r,a)&&i.equalsEpsilon(e.z,n.z,r,a)&&i.equalsEpsilon(e.w,n.w,r,a)},a.ZERO=r(new a(0,0,0,0)),a.UNIT_X=r(new a(1,0,0,0)),a.UNIT_Y=r(new a(0,1,0,0)),a.UNIT_Z=r(new a(0,0,1,0)),a.UNIT_W=r(new a(0,0,0,1)),a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,n){return a.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},a}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,i,a,o,u,E,s){"use strict";function c(e,t,r,i,a,o,u,E,s,c,_,T,R,l,A,f){this[0]=n(e,0),this[1]=n(a,0),this[2]=n(s,0),this[3]=n(R,0),this[4]=n(t,0), -this[5]=n(o,0),this[6]=n(c,0),this[7]=n(l,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(_,0),this[11]=n(A,0),this[12]=n(i,0),this[13]=n(E,0),this[14]=n(T,0),this[15]=n(f,0)}c.packedLength=16,c.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t[r++]=e[9],t[r++]=e[10],t[r++]=e[11],t[r++]=e[12],t[r++]=e[13],t[r++]=e[14],t[r]=e[15],t},c.unpack=function(e,t,i){return t=n(t,0),r(i)||(i=new c),i[0]=e[t++],i[1]=e[t++],i[2]=e[t++],i[3]=e[t++],i[4]=e[t++],i[5]=e[t++],i[6]=e[t++],i[7]=e[t++],i[8]=e[t++],i[9]=e[t++],i[10]=e[t++],i[11]=e[t++],i[12]=e[t++],i[13]=e[t++],i[14]=e[t++],i[15]=e[t],i},c.clone=function(e,t){if(r(e))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):new c(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])},c.fromArray=c.unpack,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[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 c(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])},c.fromRotationTranslation=function(t,i,a){return i=n(i,e.ZERO),r(a)?(a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=0,a[4]=t[3],a[5]=t[4],a[6]=t[5],a[7]=0,a[8]=t[6],a[9]=t[7],a[10]=t[8],a[11]=0,a[12]=i.x,a[13]=i.y,a[14]=i.z,a[15]=1,a):new c(t[0],t[3],t[6],i.x,t[1],t[4],t[7],i.y,t[2],t[5],t[8],i.z,0,0,0,1)},c.fromTranslationQuaternionRotationScale=function(e,t,n,i){r(i)||(i=new c);var a=n.x,o=n.y,u=n.z,E=t.x*t.x,s=t.x*t.y,_=t.x*t.z,T=t.x*t.w,R=t.y*t.y,l=t.y*t.z,A=t.y*t.w,f=t.z*t.z,h=t.z*t.w,N=t.w*t.w,d=E-R-f+N,I=2*(s-h),S=2*(_+A),M=2*(s+h),O=-E+R-f+N,m=2*(l-T),y=2*(_-A),p=2*(l+T),C=-E-R+f+N;return i[0]=d*a,i[1]=M*a,i[2]=y*a,i[3]=0,i[4]=I*o,i[5]=O*o,i[6]=p*o,i[7]=0,i[8]=S*u,i[9]=m*u,i[10]=C*u,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i},c.fromTranslationRotationScale=function(e,t){return c.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},c.fromTranslation=function(e,t){return c.fromRotationTranslation(E.IDENTITY,e,t)},c.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 c(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},c.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 c(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var _=new e,T=new e,R=new e;c.fromCamera=function(t,n){var i=t.position,a=t.direction,o=t.up;e.normalize(a,_),e.normalize(e.cross(_,o,T),T),e.normalize(e.cross(T,_,R),R);var u=T.x,E=T.y,s=T.z,l=_.x,A=_.y,f=_.z,h=R.x,N=R.y,d=R.z,I=i.x,S=i.y,M=i.z,O=u*-I+E*-S+s*-M,m=h*-I+N*-S+d*-M,y=l*I+A*S+f*M;return r(n)?(n[0]=u,n[1]=h,n[2]=-l,n[3]=0,n[4]=E,n[5]=N,n[6]=-A,n[7]=0,n[8]=s,n[9]=d,n[10]=-f,n[11]=0,n[12]=O,n[13]=m,n[14]=y,n[15]=1,n):new c(u,E,s,O,h,N,d,m,-l,-A,-f,y,0,0,0,1)},c.computePerspectiveFieldOfView=function(e,t,n,r,i){var a=Math.tan(.5*e),o=1/a,u=o/t,E=(r+n)/(n-r),s=2*r*n/(n-r);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=o,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=E,i[11]=-1,i[12]=0,i[13]=0,i[14]=s,i[15]=0,i},c.computeOrthographicOffCenter=function(e,t,n,r,i,a,o){var u=1/(t-e),E=1/(r-n),s=1/(a-i),c=-(t+e)*u,_=-(r+n)*E,T=-(a+i)*s;return u*=2,E*=2,s*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=s,o[11]=0,o[12]=c,o[13]=_,o[14]=T,o[15]=1,o},c.computePerspectiveOffCenter=function(e,t,n,r,i,a,o){var u=2*i/(t-e),E=2*i/(r-n),s=(t+e)/(t-e),c=(r+n)/(r-n),_=-(a+i)/(a-i),T=-1,R=-2*a*i/(a-i);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=s,o[9]=c,o[10]=_,o[11]=T,o[12]=0,o[13]=0,o[14]=R,o[15]=0,o},c.computeInfinitePerspectiveOffCenter=function(e,t,n,r,i,a){var o=2*i/(t-e),u=2*i/(r-n),E=(t+e)/(t-e),s=(r+n)/(r-n),c=-1,_=-1,T=-2*i;return a[0]=o,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=E,a[9]=s,a[10]=c,a[11]=_,a[12]=0,a[13]=0,a[14]=T,a[15]=0,a},c.computeViewportTransformation=function(e,t,r,i){e=n(e,n.EMPTY_OBJECT);var a=n(e.x,0),o=n(e.y,0),u=n(e.width,0),E=n(e.height,0);t=n(t,0),r=n(r,1);var s=.5*u,c=.5*E,_=.5*(r-t),T=s,R=c,l=_,A=a+s,f=o+c,h=t+_,N=1;return i[0]=T,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=R,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=l,i[11]=0,i[12]=A,i[13]=f,i[14]=h,i[15]=N,i},c.computeView=function(t,n,r,i,a){return a[0]=i.x,a[1]=r.x,a[2]=-n.x,a[3]=0,a[4]=i.y,a[5]=r.y,a[6]=-n.y,a[7]=0,a[8]=i.z,a[9]=r.z,a[10]=-n.z,a[11]=0,a[12]=-e.dot(i,t),a[13]=-e.dot(r,t),a[14]=e.dot(n,t),a[15]=1,a},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[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]]},c.getElementIndex=function(e,t){return 4*e+t},c.getColumn=function(e,t,n){var r=4*t,i=e[r],a=e[r+1],o=e[r+2],u=e[r+3];return n.x=i,n.y=a,n.z=o,n.w=u,n},c.setColumn=function(e,t,n,r){r=c.clone(e,r);var i=4*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r[i+3]=n.w,r},c.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},c.getRow=function(e,t,n){var r=e[t],i=e[t+4],a=e[t+8],o=e[t+12];return n.x=r,n.y=i,n.z=a,n.w=o,n},c.setRow=function(e,t,n,r){return r=c.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var l=new e;c.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],l)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],l)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],l)),n};var A=new e;c.getMaximumScale=function(t){return c.getScale(t,A),e.maximumComponent(A)},c.multiply=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[3],u=e[4],E=e[5],s=e[6],c=e[7],_=e[8],T=e[9],R=e[10],l=e[11],A=e[12],f=e[13],h=e[14],N=e[15],d=t[0],I=t[1],S=t[2],M=t[3],O=t[4],m=t[5],y=t[6],p=t[7],C=t[8],U=t[9],L=t[10],F=t[11],P=t[12],g=t[13],D=t[14],w=t[15],v=r*d+u*I+_*S+A*M,B=i*d+E*I+T*S+f*M,x=a*d+s*I+R*S+h*M,z=o*d+c*I+l*S+N*M,G=r*O+u*m+_*y+A*p,b=i*O+E*m+T*y+f*p,X=a*O+s*m+R*y+h*p,V=o*O+c*m+l*y+N*p,H=r*C+u*U+_*L+A*F,W=i*C+E*U+T*L+f*F,q=a*C+s*U+R*L+h*F,Y=o*C+c*U+l*L+N*F,K=r*P+u*g+_*D+A*w,Z=i*P+E*g+T*D+f*w,k=a*P+s*g+R*D+h*w,j=o*P+c*g+l*D+N*w;return n[0]=v,n[1]=B,n[2]=x,n[3]=z,n[4]=G,n[5]=b,n[6]=X,n[7]=V,n[8]=H,n[9]=W,n[10]=q,n[11]=Y,n[12]=K,n[13]=Z,n[14]=k,n[15]=j,n},c.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},c.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},c.multiplyTransformation=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[4],u=e[5],E=e[6],s=e[8],c=e[9],_=e[10],T=e[12],R=e[13],l=e[14],A=t[0],f=t[1],h=t[2],N=t[4],d=t[5],I=t[6],S=t[8],M=t[9],O=t[10],m=t[12],y=t[13],p=t[14],C=r*A+o*f+s*h,U=i*A+u*f+c*h,L=a*A+E*f+_*h,F=r*N+o*d+s*I,P=i*N+u*d+c*I,g=a*N+E*d+_*I,D=r*S+o*M+s*O,w=i*S+u*M+c*O,v=a*S+E*M+_*O,B=r*m+o*y+s*p+T,x=i*m+u*y+c*p+R,z=a*m+E*y+_*p+l;return n[0]=C,n[1]=U,n[2]=L,n[3]=0,n[4]=F,n[5]=P,n[6]=g,n[7]=0,n[8]=D,n[9]=w,n[10]=v,n[11]=0,n[12]=B,n[13]=x,n[14]=z,n[15]=1,n},c.multiplyByMatrix3=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[4],u=e[5],E=e[6],s=e[8],c=e[9],_=e[10],T=t[0],R=t[1],l=t[2],A=t[3],f=t[4],h=t[5],N=t[6],d=t[7],I=t[8],S=r*T+o*R+s*l,M=i*T+u*R+c*l,O=a*T+E*R+_*l,m=r*A+o*f+s*h,y=i*A+u*f+c*h,p=a*A+E*f+_*h,C=r*N+o*d+s*I,U=i*N+u*d+c*I,L=a*N+E*d+_*I;return n[0]=S,n[1]=M,n[2]=O,n[3]=0,n[4]=m,n[5]=y,n[6]=p,n[7]=0,n[8]=C,n[9]=U,n[10]=L,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},c.multiplyByTranslation=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=r*e[0]+i*e[4]+a*e[8]+e[12],u=r*e[1]+i*e[5]+a*e[9]+e[13],E=r*e[2]+i*e[6]+a*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=E,n[15]=e[15],n};var f=new e;c.multiplyByUniformScale=function(e,t,n){return f.x=t,f.y=t,f.z=t,c.multiplyByScale(e,f,n)},c.multiplyByScale=function(e,t,n){var r=t.x,i=t.y,a=t.z;return 1===r&&1===i&&1===a?c.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=i*e[4],n[5]=i*e[5],n[6]=i*e[6],n[7]=0,n[8]=a*e[8],n[9]=a*e[9],n[10]=a*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},c.multiplyByVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=t.w,u=e[0]*r+e[4]*i+e[8]*a+e[12]*o,E=e[1]*r+e[5]*i+e[9]*a+e[13]*o,s=e[2]*r+e[6]*i+e[10]*a+e[14]*o,c=e[3]*r+e[7]*i+e[11]*a+e[15]*o;return n.x=u,n.y=E,n.z=s,n.w=c,n},c.multiplyByPointAsVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[4]*i+e[8]*a,u=e[1]*r+e[5]*i+e[9]*a,E=e[2]*r+e[6]*i+e[10]*a;return n.x=o,n.y=u,n.z=E,n},c.multiplyByPoint=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[4]*i+e[8]*a+e[12],u=e[1]*r+e[5]*i+e[9]*a+e[13],E=e[2]*r+e[6]*i+e[10]*a+e[14];return n.x=o,n.y=u,n.z=E,n},c.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},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[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},c.transpose=function(e,t){var n=e[1],r=e[2],i=e[3],a=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=a,t[10]=e[10],t[11]=e[14],t[12]=i,t[13]=o,t[14]=u,t[15]=e[15],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[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},c.equals=function(e,t){return e===t||r(e)&&r(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},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&&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},c.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},c.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};var h=new E,N=new E,d=new t,I=new t(0,0,0,1);return c.inverse=function(e,n){if(E.equalsEpsilon(c.getRotation(e,h),N,u.EPSILON7)&&t.equals(c.getRow(e,3,d),I))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],i=e[4],a=e[8],o=e[12],_=e[1],T=e[5],R=e[9],l=e[13],A=e[2],f=e[6],S=e[10],M=e[14],O=e[3],m=e[7],y=e[11],p=e[15],C=S*p,U=M*y,L=f*p,F=M*m,P=f*y,g=S*m,D=A*p,w=M*O,v=A*y,B=S*O,x=A*m,z=f*O,G=C*T+F*R+P*l-(U*T+L*R+g*l),b=U*_+D*R+B*l-(C*_+w*R+v*l),X=L*_+w*T+x*l-(F*_+D*T+z*l),V=g*_+v*T+z*R-(P*_+B*T+x*R),H=U*i+L*a+g*o-(C*i+F*a+P*o),W=C*r+w*a+v*o-(U*r+D*a+B*o),q=F*r+D*i+z*o-(L*r+w*i+x*o),Y=P*r+B*i+x*a-(g*r+v*i+z*a);C=a*l,U=o*R,L=i*l,F=o*T,P=i*R,g=a*T,D=r*l,w=o*_,v=r*R,B=a*_,x=r*T,z=i*_;var K=C*m+F*y+P*p-(U*m+L*y+g*p),Z=U*O+D*y+B*p-(C*O+w*y+v*p),k=L*O+w*m+x*p-(F*O+D*m+z*p),j=g*O+v*m+z*y-(P*O+B*m+x*y),Q=L*S+g*M+U*f-(P*M+C*f+F*S),J=v*M+C*A+w*S-(D*S+B*M+U*A),$=D*f+z*M+F*A-(x*M+L*A+w*f),ee=x*S+P*A+B*f-(v*f+z*S+g*A),te=r*G+i*b+a*X+o*V;if(Math.abs(te)<u.EPSILON20)throw new s("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=G*te,n[1]=b*te,n[2]=X*te,n[3]=V*te,n[4]=H*te,n[5]=W*te,n[6]=q*te,n[7]=Y*te,n[8]=K*te,n[9]=Z*te,n[10]=k*te,n[11]=j*te,n[12]=Q*te,n[13]=J*te,n[14]=$*te,n[15]=ee*te,n},c.inverseTransformation=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[4],o=e[5],u=e[6],E=e[8],s=e[9],c=e[10],_=e[12],T=e[13],R=e[14],l=-n*_-r*T-i*R,A=-a*_-o*T-u*R,f=-E*_-s*T-c*R;return t[0]=n,t[1]=a,t[2]=E,t[3]=0,t[4]=r,t[5]=o,t[6]=s,t[7]=0,t[8]=i,t[9]=u,t[10]=c,t[11]=0,t[12]=l,t[13]=A,t[14]=f,t[15]=1,t},c.IDENTITY=o(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),c.ZERO=o(new c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN0ROW3=3,c.COLUMN1ROW0=4,c.COLUMN1ROW1=5,c.COLUMN1ROW2=6,c.COLUMN1ROW3=7,c.COLUMN2ROW0=8,c.COLUMN2ROW1=9,c.COLUMN2ROW2=10,c.COLUMN2ROW3=11,c.COLUMN3ROW0=12,c.COLUMN3ROW1=13,c.COLUMN3ROW2=14,c.COLUMN3ROW3=15,i(c.prototype,{length:{get:function(){return c.packedLength}}}),c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.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]+")"},c}),define("Core/Rectangle",["./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,i,a,o,u){"use strict";function E(e,n,r,i){this.west=t(e,0),this.south=t(n,0),this.east=t(r,0),this.north=t(i,0)}r(E.prototype,{width:{get:function(){return E.computeWidth(this)}},height:{get:function(){return E.computeHeight(this)}}}),E.packedLength=4,E.pack=function(e,n,r){return r=t(r,0),n[r++]=e.west,n[r++]=e.south,n[r++]=e.east,n[r]=e.north,n},E.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new E),i.west=e[r++],i.south=e[r++],i.east=e[r++],i.north=e[r],i},E.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=u.TWO_PI),t-n},E.computeHeight=function(e){return e.north-e.south},E.fromDegrees=function(e,r,i,a,o){return e=u.toRadians(t(e,0)),r=u.toRadians(t(r,0)),i=u.toRadians(t(i,0)),a=u.toRadians(t(a,0)),n(o)?(o.west=e,o.south=r,o.east=i,o.north=a,o):new E(e,r,i,a)},E.fromCartographicArray=function(e,t){for(var r=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=Number.MAX_VALUE,c=-Number.MAX_VALUE,_=0,T=e.length;_<T;_++){var R=e[_];r=Math.min(r,R.longitude),i=Math.max(i,R.longitude),s=Math.min(s,R.latitude),c=Math.max(c,R.latitude);var l=R.longitude>=0?R.longitude:R.longitude+u.TWO_PI;a=Math.min(a,l),o=Math.max(o,l)}return i-r>o-a&&(r=a,i=o,i>u.PI&&(i-=u.TWO_PI),r>u.PI&&(r-=u.TWO_PI)),n(t)?(t.west=r,t.south=s,t.east=i,t.north=c,t):new E(r,s,i,c)},E.fromCartesianArray=function(e,t,r){for(var i=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,s=-Number.MAX_VALUE,c=Number.MAX_VALUE,_=-Number.MAX_VALUE,T=0,R=e.length;T<R;T++){var l=t.cartesianToCartographic(e[T]);i=Math.min(i,l.longitude),a=Math.max(a,l.longitude),c=Math.min(c,l.latitude),_=Math.max(_,l.latitude);var A=l.longitude>=0?l.longitude:l.longitude+u.TWO_PI;o=Math.min(o,A),s=Math.max(s,A)}return a-i>s-o&&(i=o,a=s,a>u.PI&&(a-=u.TWO_PI),i>u.PI&&(i-=u.TWO_PI)),n(r)?(r.west=i,r.south=c,r.east=a,r.north=_,r):new E(i,c,a,_)},E.clone=function(e,t){if(n(e))return n(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new E(e.west,e.south,e.east,e.north)},E.prototype.clone=function(e){return E.clone(this,e)},E.prototype.equals=function(e){return E.equals(this,e)},E.equals=function(e,t){return e===t||n(e)&&n(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},E.prototype.equalsEpsilon=function(e,t){return n(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},E.validate=function(e){},E.southwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.south,r.height=0,r):new e(t.west,t.south)},E.northwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.north,r.height=0,r):new e(t.west,t.north)},E.northeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.north,r.height=0,r):new e(t.east,t.north)},E.southeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.south,r.height=0,r):new e(t.east,t.south)},E.center=function(t,r){var i=t.east,a=t.west;i<a&&(i+=u.TWO_PI);var o=u.negativePiToPi(.5*(a+i)),E=.5*(t.south+t.north);return n(r)?(r.longitude=o,r.latitude=E,r.height=0,r):new e(o,E)},E.intersection=function(e,t,r){var i=e.east,a=e.west,o=t.east,s=t.west;i<a&&o>0?i+=u.TWO_PI:o<s&&i>0&&(o+=u.TWO_PI),i<a&&s<0?s+=u.TWO_PI:o<s&&a<0&&(a+=u.TWO_PI);var c=u.negativePiToPi(Math.max(a,s)),_=u.negativePiToPi(Math.min(i,o));if(!((e.west<e.east||t.west<t.east)&&_<=c)){var T=Math.max(e.south,t.south),R=Math.min(e.north,t.north);if(!(T>=R))return n(r)?(r.west=c,r.south=T,r.east=_,r.north=R,r):new E(c,T,_,R)}},E.simpleIntersection=function(e,t,r){var i=Math.max(e.west,t.west),a=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(a>=u||i>=o))return n(r)?(r.west=i,r.south=a,r.east=o,r.north=u,r):new E(i,a,o,u)},E.union=function(e,t,r){n(r)||(r=new E);var i=e.east,a=e.west,o=t.east,s=t.west;i<a&&o>0?i+=u.TWO_PI:o<s&&i>0&&(o+=u.TWO_PI),i<a&&s<0?s+=u.TWO_PI:o<s&&a<0&&(a+=u.TWO_PI);var c=u.convertLongitudeRange(Math.min(a,s)),_=u.convertLongitudeRange(Math.max(i,o));return r.west=c,r.south=Math.min(e.south,t.south),r.east=_,r.north=Math.max(e.north,t.north),r},E.expand=function(e,t,r){return n(r)||(r=new E),r.west=Math.min(e.west,t.longitude),r.south=Math.min(e.south,t.latitude),r.east=Math.max(e.east,t.longitude),r.north=Math.max(e.north,t.latitude),r},E.contains=function(e,t){var n=t.longitude,r=t.latitude,i=e.west,a=e.east;return a<i&&(a+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>i||u.equalsEpsilon(n,i,u.EPSILON14))&&(n<a||u.equalsEpsilon(n,a,u.EPSILON14))&&r>=e.south&&r<=e.north};var s=new e;return E.subsample=function(e,r,i,o){r=t(r,a.WGS84),i=t(i,0),n(o)||(o=[]);var c=0,_=e.north,T=e.south,R=e.east,l=e.west,A=s;A.height=i,A.longitude=l,A.latitude=_,o[c]=r.cartographicToCartesian(A,o[c]),c++,A.longitude=R,o[c]=r.cartographicToCartesian(A,o[c]),c++,A.latitude=T,o[c]=r.cartographicToCartesian(A,o[c]),c++,A.longitude=l,o[c]=r.cartographicToCartesian(A,o[c]),c++,_<0?A.latitude=_:T>0?A.latitude=T:A.latitude=0;for(var f=1;f<8;++f)A.longitude=-Math.PI+f*u.PI_OVER_TWO,E.contains(e,A)&&(o[c]=r.cartographicToCartesian(A,o[c]),c++);return 0===A.latitude&&(A.longitude=l,o[c]=r.cartographicToCartesian(A,o[c]),c++,A.longitude=R,o[c]=r.cartographicToCartesian(A,o[c]),c++),o.length=c,o},E.MAX_VALUE=o(new E(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),E}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,i,a,o,u,E,s,c,_){"use strict";function T(t,r){this.center=e.clone(n(t,e.ZERO)),this.radius=n(r,0)}var R=new e,l=new e,A=new e,f=new e,h=new e,N=new e,d=new e,I=new e,S=new e,M=new e,O=new e,m=new e;T.fromPoints=function(t,n){if(r(n)||(n=new T),!r(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var i=e.clone(t[0],d),a=e.clone(i,R),o=e.clone(i,l),u=e.clone(i,A),E=e.clone(i,f),s=e.clone(i,h),c=e.clone(i,N),_=t.length,y=1;y<_;y++){e.clone(t[y],i);var p=i.x,C=i.y,U=i.z;p<a.x&&e.clone(i,a),p>E.x&&e.clone(i,E),C<o.y&&e.clone(i,o),C>s.y&&e.clone(i,s),U<u.z&&e.clone(i,u),U>c.z&&e.clone(i,c)}var L=e.magnitudeSquared(e.subtract(E,a,I)),F=e.magnitudeSquared(e.subtract(s,o,I)),P=e.magnitudeSquared(e.subtract(c,u,I)),g=a,D=E,w=L;F>w&&(w=F,g=o,D=s),P>w&&(w=P,g=u,D=c);var v=S;v.x=.5*(g.x+D.x),v.y=.5*(g.y+D.y),v.z=.5*(g.z+D.z);var B=e.magnitudeSquared(e.subtract(D,v,I)),x=Math.sqrt(B),z=M;z.x=a.x,z.y=o.y,z.z=u.z;var G=O;G.x=E.x,G.y=s.y,G.z=c.z;var b=e.multiplyByScalar(e.add(z,G,I),.5,m),X=0;for(y=0;y<_;y++){e.clone(t[y],i);var V=e.magnitude(e.subtract(i,b,I));V>X&&(X=V);var H=e.magnitudeSquared(e.subtract(i,v,I));if(H>B){var W=Math.sqrt(H);x=.5*(x+W),B=x*x;var q=W-x;v.x=(x*v.x+q*i.x)/W,v.y=(x*v.y+q*i.y)/W,v.z=(x*v.z+q*i.z)/W}}return x<X?(e.clone(v,n.center),n.radius=x):(e.clone(b,n.center),n.radius=X),n};var y=new o,p=new e,C=new e,U=new t,L=new t;T.fromRectangle2D=function(e,t,n){return T.fromRectangleWithHeights2D(e,t,0,0,n)},T.fromRectangleWithHeights2D=function(t,i,a,o,u){if(r(u)||(u=new T),!r(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;i=n(i,y),_.southwest(t,U),U.height=a,_.northeast(t,L),L.height=o;var E=i.project(U,p),s=i.project(L,C),c=s.x-E.x,R=s.y-E.y,l=s.z-E.z;u.radius=.5*Math.sqrt(c*c+R*R+l*l);var A=u.center;return A.x=E.x+.5*c,A.y=E.y+.5*R,A.z=E.z+.5*l,u};var F=[];T.fromRectangle3D=function(e,t,i,o){t=n(t,a.WGS84),i=n(i,0);var u;return r(e)&&(u=_.subsample(e,t,i,F)),T.fromPoints(u,o)},T.fromVertices=function(t,i,a,o){if(r(o)||(o=new T),!r(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;i=n(i,e.ZERO),a=n(a,3);var u=d;u.x=t[0]+i.x,u.y=t[1]+i.y,u.z=t[2]+i.z;for(var E=e.clone(u,R),s=e.clone(u,l),c=e.clone(u,A),_=e.clone(u,f),y=e.clone(u,h),p=e.clone(u,N),C=t.length,U=0;U<C;U+=a){var L=t[U]+i.x,F=t[U+1]+i.y,P=t[U+2]+i.z;u.x=L,u.y=F,u.z=P,L<E.x&&e.clone(u,E),L>_.x&&e.clone(u,_),F<s.y&&e.clone(u,s),F>y.y&&e.clone(u,y),P<c.z&&e.clone(u,c),P>p.z&&e.clone(u,p)}var g=e.magnitudeSquared(e.subtract(_,E,I)),D=e.magnitudeSquared(e.subtract(y,s,I)),w=e.magnitudeSquared(e.subtract(p,c,I)),v=E,B=_,x=g;D>x&&(x=D,v=s,B=y),w>x&&(x=w,v=c,B=p);var z=S;z.x=.5*(v.x+B.x),z.y=.5*(v.y+B.y),z.z=.5*(v.z+B.z);var G=e.magnitudeSquared(e.subtract(B,z,I)),b=Math.sqrt(G),X=M;X.x=E.x,X.y=s.y,X.z=c.z;var V=O;V.x=_.x,V.y=y.y,V.z=p.z;var H=e.multiplyByScalar(e.add(X,V,I),.5,m),W=0;for(U=0;U<C;U+=a){u.x=t[U]+i.x,u.y=t[U+1]+i.y,u.z=t[U+2]+i.z;var q=e.magnitude(e.subtract(u,H,I));q>W&&(W=q);var Y=e.magnitudeSquared(e.subtract(u,z,I));if(Y>G){var K=Math.sqrt(Y);b=.5*(b+K),G=b*b;var Z=K-b;z.x=(b*z.x+Z*u.x)/K,z.y=(b*z.y+Z*u.y)/K,z.z=(b*z.z+Z*u.z)/K}}return b<W?(e.clone(z,o.center),o.radius=b):(e.clone(H,o.center),o.radius=W),o},T.fromEncodedCartesianVertices=function(t,n,i){if(r(i)||(i=new T),!r(t)||!r(n)||t.length!==n.length||0===t.length)return i.center=e.clone(e.ZERO,i.center),i.radius=0,i;var a=d;a.x=t[0]+n[0],a.y=t[1]+n[1],a.z=t[2]+n[2];for(var o=e.clone(a,R),u=e.clone(a,l),E=e.clone(a,A),s=e.clone(a,f),c=e.clone(a,h),_=e.clone(a,N),y=t.length,p=0;p<y;p+=3){var C=t[p]+n[p],U=t[p+1]+n[p+1],L=t[p+2]+n[p+2];a.x=C,a.y=U,a.z=L,C<o.x&&e.clone(a,o),C>s.x&&e.clone(a,s),U<u.y&&e.clone(a,u),U>c.y&&e.clone(a,c),L<E.z&&e.clone(a,E),L>_.z&&e.clone(a,_)}var F=e.magnitudeSquared(e.subtract(s,o,I)),P=e.magnitudeSquared(e.subtract(c,u,I)),g=e.magnitudeSquared(e.subtract(_,E,I)),D=o,w=s,v=F;P>v&&(v=P,D=u,w=c),g>v&&(v=g,D=E,w=_);var B=S;B.x=.5*(D.x+w.x),B.y=.5*(D.y+w.y),B.z=.5*(D.z+w.z);var x=e.magnitudeSquared(e.subtract(w,B,I)),z=Math.sqrt(x),G=M;G.x=o.x,G.y=u.y,G.z=E.z;var b=O;b.x=s.x,b.y=c.y,b.z=_.z;var X=e.multiplyByScalar(e.add(G,b,I),.5,m),V=0;for(p=0;p<y;p+=3){a.x=t[p]+n[p],a.y=t[p+1]+n[p+1],a.z=t[p+2]+n[p+2];var H=e.magnitude(e.subtract(a,X,I));H>V&&(V=H);var W=e.magnitudeSquared(e.subtract(a,B,I));if(W>x){var q=Math.sqrt(W);z=.5*(z+q),x=z*z;var Y=q-z;B.x=(z*B.x+Y*a.x)/q,B.y=(z*B.y+Y*a.y)/q,B.z=(z*B.z+Y*a.z)/q}}return z<V?(e.clone(B,i.center),i.radius=z):(e.clone(X,i.center),i.radius=V),i},T.fromCornerPoints=function(t,n,i){r(i)||(i=new T);var a=i.center;return e.add(t,n,a),e.multiplyByScalar(a,.5,a),i.radius=e.distance(a,n),i},T.fromEllipsoid=function(t,n){return r(n)||(n=new T),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var P=new e;T.fromBoundingSpheres=function(t,n){if(r(n)||(n=new T),!r(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var i=t.length;if(1===i)return T.clone(t[0],n);if(2===i)return T.union(t[0],t[1],n);for(var a=[],o=0;o<i;o++)a.push(t[o].center);n=T.fromPoints(a,n);var u=n.center,E=n.radius;for(o=0;o<i;o++){var s=t[o];E=Math.max(E,e.distance(u,s.center,P)+s.radius)}return n.radius=E,n};var g=new e,D=new e,w=new e;T.fromOrientedBoundingBox=function(t,n){r(n)||(n=new T);var i=t.halfAxes,a=s.getColumn(i,0,g),o=s.getColumn(i,1,D),u=s.getColumn(i,2,w),E=e.magnitude(a),c=e.magnitude(o),_=e.magnitude(u);return n.center=e.clone(t.center,n.center),n.radius=Math.max(E,c,_),n},T.clone=function(t,n){if(r(t))return r(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new T(t.center,t.radius)},T.packedLength=4,T.pack=function(e,t,r){r=n(r,0);var i=e.center;return t[r++]=i.x,t[r++]=i.y,t[r++]=i.z,t[r]=e.radius,t},T.unpack=function(e,t,i){t=n(t,0),r(i)||(i=new T);var a=i.center;return a.x=e[t++],a.y=e[t++],a.z=e[t++],i.radius=e[t],i};var v=new e,B=new e;T.union=function(t,n,i){r(i)||(i=new T);var a=t.center,o=t.radius,u=n.center,E=n.radius,s=e.subtract(u,a,v),c=e.magnitude(s);if(o>=c+E)return t.clone(i),i;if(E>=c+o)return n.clone(i),i;var _=.5*(o+c+E),R=e.multiplyByScalar(s,(-o+_)/c,B);return e.add(R,a,R),e.clone(R,i.center),i.radius=_,i};var x=new e;T.expand=function(t,n,r){r=T.clone(t,r);var i=e.magnitude(e.subtract(n,r.center,x));return i>r.radius&&(r.radius=i),r},T.intersectPlane=function(t,n){var r=t.center,i=t.radius,a=n.normal,o=e.dot(a,r)+n.distance;return o<-i?u.OUTSIDE:o<i?u.INTERSECTING:u.INSIDE},T.transform=function(e,t,n){return r(n)||(n=new T),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=c.getMaximumScale(t)*e.radius,n};var z=new e;T.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,z);return e.magnitudeSquared(r)-t.radius*t.radius},T.transformWithoutScale=function(e,t,n){return r(n)||(n=new T),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var G=new e;T.computePlaneDistances=function(t,n,i,a){r(a)||(a=new E);var o=e.subtract(t.center,n,G),u=e.dot(i,o);return a.start=u-t.radius,a.stop=u+t.radius,a};for(var b=new e,X=new e,V=new e,H=new e,W=new e,q=new t,Y=new Array(8),K=0;K<8;++K)Y[K]=new e;var Z=new o;return T.projectTo2D=function(t,r,i){r=n(r,Z);var a=r.ellipsoid,o=t.center,u=t.radius,E=a.geodeticSurfaceNormal(o,b),s=e.cross(e.UNIT_Z,E,X);e.normalize(s,s);var c=e.cross(E,s,V);e.normalize(c,c),e.multiplyByScalar(E,u,E),e.multiplyByScalar(c,u,c),e.multiplyByScalar(s,u,s);var _=e.negate(c,W),R=e.negate(s,H),l=Y,A=l[0];e.add(E,c,A),e.add(A,s,A),A=l[1],e.add(E,c,A),e.add(A,R,A),A=l[2],e.add(E,_,A),e.add(A,R,A),A=l[3],e.add(E,_,A),e.add(A,s,A),e.negate(E,E),A=l[4],e.add(E,c,A),e.add(A,s,A),A=l[5],e.add(E,c,A),e.add(A,R,A),A=l[6],e.add(E,_,A),e.add(A,R,A),A=l[7],e.add(E,_,A),e.add(A,s,A);for(var f=l.length,h=0;h<f;++h){var N=l[h];e.add(o,N,N);var d=a.cartesianToCartographic(N,q);r.project(d,N)}i=T.fromPoints(l,i),o=i.center;var I=o.x,S=o.y,M=o.z;return o.x=M,o.y=I,o.z=S,i},T.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},T.equals=function(t,n){return t===n||r(t)&&r(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},T.prototype.intersectPlane=function(e){return T.intersectPlane(this,e)},T.prototype.distanceSquaredTo=function(e){return T.distanceSquaredTo(this,e)},T.prototype.computePlaneDistances=function(e,t,n){return T.computePlaneDistances(this,e,t,n)},T.prototype.isOccluded=function(e){return T.isOccluded(this,e)},T.prototype.equals=function(e){return T.equals(this,e)},T.prototype.clone=function(e){return T.clone(this,e)},T}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},i={};return t(i,{element:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(i.supportsFullscreen())return null!==i.element}}}),i.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var i,a=["webkit","moz","o","ms","khtml"],o=0,u=a.length;o<u;++o){var E=a[o];i=E+"RequestFullscreen","function"==typeof t[i]?(r.requestFullscreen=i,n=!0):(i=E+"RequestFullScreen","function"==typeof t[i]&&(r.requestFullscreen=i,n=!0)),i=E+"ExitFullscreen","function"==typeof document[i]?r.exitFullscreen=i:(i=E+"CancelFullScreen","function"==typeof document[i]&&(r.exitFullscreen=i)),i=E+"FullscreenEnabled",void 0!==document[i]?r.fullscreenEnabled=i:(i=E+"FullScreenEnabled",void 0!==document[i]&&(r.fullscreenEnabled=i)),i=E+"FullscreenElement",void 0!==document[i]?r.fullscreenElement=i:(i=E+"FullScreenElement",void 0!==document[i]&&(r.fullscreenElement=i)),i=E+"fullscreenchange",void 0!==document["on"+i]&&("ms"===E&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=E+"fullscreenerror",void 0!==document["on"+i]&&("ms"===E&&(i="MSFullscreenError"),r.fullscreenerror=i)}return n},i.requestFullscreen=function(e,t){i.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},i.exitFullscreen=function(){i.supportsFullscreen()&&document[r.exitFullscreen]()},i}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function i(){if(!t(S)&&(S=!1,!T())){var e=/ Chrome\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(S=!0,M=r(e[1]))}return S}function a(){return i()&&M}function o(){if(!t(O)&&(O=!1,!i()&&!T()&&/ Safari\/[\.0-9]+/.test(I.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(O=!0,m=r(e[1]))}return O}function u(){return o()&&m}function E(){if(!t(y)){y=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(I.userAgent);null!==e&&(y=!0,p=r(e[1]),p.isNightly=!!e[2])}return y}function s(){return E()&&p}function c(){if(!t(C)){C=!1;var e;"Microsoft Internet Explorer"===I.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==e&&(C=!0,U=r(e[1]))):"Netscape"===I.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==e&&(C=!0,U=r(e[1])))}return C}function _(){return c()&&U}function T(){if(!t(L)){L=!1;var e=/ Edge\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(L=!0,F=r(e[1]))}return L}function R(){return T()&&F}function l(){if(!t(P)){P=!1;var e=/Firefox\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(P=!0,g=r(e[1]))}return P}function A(){return t(D)||(D=/Windows/i.test(I.appVersion)),D}function f(){return l()&&g}function h(){return t(w)||(w="undefined"!=typeof PointerEvent&&(!t(I.pointerEnabled)||I.pointerEnabled)),w}function N(){ -if(!t(B)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;B=t(n)&&""!==n,B&&(v=n)}return B}function d(){return N()?v:void 0}var I;I="undefined"!=typeof navigator?navigator:{};var S,M,O,m,y,p,C,U,L,F,P,g,D,w,v,B,x={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:E,webkitVersion:s,isInternetExplorer:c,internetExplorerVersion:_,isEdge:T,edgeVersion:R,isFirefox:l,firefoxVersion:f,isWindows:A,hardwareConcurrency:e(I.hardwareConcurrency,3),supportsPointerEvents:h,supportsImageRenderingPixelated:N,imageRenderingValue:d};return x.supportsFullscreen=function(){return n.supportsFullscreen()},x.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},x.supportsWebWorkers=function(){return"undefined"!=typeof Worker},x}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,i,a){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:a.BYTE,UNSIGNED_BYTE:a.UNSIGNED_BYTE,SHORT:a.SHORT,UNSIGNED_SHORT:a.UNSIGNED_SHORT,INT:a.INT,UNSIGNED_INT:a.UNSIGNED_INT,FLOAT:a.FLOAT,DOUBLE:a.DOUBLE};return o.getSizeInBytes=function(e){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.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},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 Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,i){switch(r=e(r,0),i=e(i,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,i);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,i);case o.SHORT:return new Int16Array(n,r,i);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,i);case o.INT:return new Int32Array(n,r,i);case o.UNSIGNED_INT:return new Uint32Array(n,r,i);case o.FLOAT:return new Float32Array(n,r,i);case o.DOUBLE:return new Float64Array(n,r,i)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},i(o)}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===n.POINTS||e===n.LINES||e===n.LINE_LOOP||e===n.LINE_STRIP||e===n.TRIANGLES||e===n.TRIANGLE_STRIP||e===n.TRIANGLE_FAN}};return e(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,i){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,i.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return a.computeNumberOfVertices=function(e){var n=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var i=e.attributes[r],a=i.values.length/i.componentsPerAttribute;n=a}return n},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(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 r}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.binormal=t.binormal,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/PointGeometry",["./BoundingSphere","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./PrimitiveType"],function(e,t,n,r,i,a,o,u,E){"use strict";function s(t){t=n(t,n.EMPTY_OBJECT),this._positionsTypedArray=t.positionsTypedArray,this._colorsTypedArray=t.colorsTypedArray,this._boundingSphere=e.clone(t.boundingSphere),this._workerName="createPointGeometry"}return s.createGeometry=function(n){var i=n._positionsTypedArray,s=i.byteLength/i.length,c=4===s?t.FLOAT:t.DOUBLE,_=new u;_.position=new o({componentDatatype:c,componentsPerAttribute:3,values:i}),_.color=new o({componentDatatype:t.UNSIGNED_BYTE,componentsPerAttribute:3,values:n._colorsTypedArray,normalize:!0});var T=n._boundingSphere;return r(T)||(T=e.fromVertices(i)),new a({attributes:_,primitiveType:E.POINTS,boundingSphere:T})},s}),define("Workers/createPointGeometry",["../Core/PointGeometry"],function(e){"use strict";return e.createGeometry})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e){return e+" is required, actual value was undefined"}function r(e,t,n){return"Expected "+n+" to be typeof "+t+", actual typeof was "+e}var i={};return i.typeOf={},i.defined=function(r,i){if(!e(i))throw new t(n(r))},i.typeOf.func=function(e,n){if("function"!=typeof n)throw new t(r(typeof n,"function",e))},i.typeOf.string=function(e,n){if("string"!=typeof n)throw new t(r(typeof n,"string",e))},i.typeOf.number=function(e,n){if("number"!=typeof n)throw new t(r(typeof n,"number",e))},i.typeOf.number.lessThan=function(e,n,r){if(i.typeOf.number(e,n),n>=r)throw new t("Expected "+e+" to be less than "+r+", actual value was "+n)},i.typeOf.number.lessThanOrEquals=function(e,n,r){if(i.typeOf.number(e,n),n>r)throw new t("Expected "+e+" to be less than or equal to "+r+", actual value was "+n)},i.typeOf.number.greaterThan=function(e,n,r){if(i.typeOf.number(e,n),n<=r)throw new t("Expected "+e+" to be greater than "+r+", actual value was "+n)},i.typeOf.number.greaterThanOrEquals=function(e,n,r){if(i.typeOf.number(e,n),n<r)throw new t("Expected "+e+" to be greater than or equal to"+r+", actual value was "+n)},i.typeOf.object=function(e,n){if("object"!=typeof n)throw new t(r(typeof n,"object",e))},i.typeOf.bool=function(e,n){if("boolean"!=typeof n)throw new t(r(typeof n,"boolean",e))},i}),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";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),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 n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(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^=e<<7&2636928640,e^=e<<15&4022730752,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,n,r){"use strict";var i={};i.EPSILON1=.1,i.EPSILON2=.01,i.EPSILON3=.001,i.EPSILON4=1e-4,i.EPSILON5=1e-5,i.EPSILON6=1e-6,i.EPSILON7=1e-7,i.EPSILON8=1e-8,i.EPSILON9=1e-9,i.EPSILON10=1e-10,i.EPSILON11=1e-11,i.EPSILON12=1e-12,i.EPSILON13=1e-13,i.EPSILON14=1e-14,i.EPSILON15=1e-15,i.EPSILON16=1e-16,i.EPSILON17=1e-17,i.EPSILON18=1e-18,i.EPSILON19=1e-19,i.EPSILON20=1e-20,i.GRAVITATIONALPARAMETER=3986004418e5,i.SOLAR_RADIUS=6955e5,i.LUNAR_RADIUS=1737400,i.SIXTY_FOUR_KILOBYTES=65536,i.sign=function(e){return e>0?1:e<0?-1:0},i.signNotZero=function(e){return e<0?-1:1},i.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*i.clamp(e,-1,1)+.5)*n)},i.fromSNorm=function(e,n){return n=t(n,255),i.clamp(e,0,n)/n*2-1},i.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},i.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},i.lerp=function(e,t,n){return(1-n)*e+n*t},i.PI=Math.PI,i.ONE_OVER_PI=1/Math.PI,i.PI_OVER_TWO=.5*Math.PI,i.PI_OVER_THREE=Math.PI/3,i.PI_OVER_FOUR=Math.PI/4,i.PI_OVER_SIX=Math.PI/6,i.THREE_PI_OVER_TWO=3*Math.PI*.5,i.TWO_PI=2*Math.PI,i.ONE_OVER_TWO_PI=1/(2*Math.PI),i.RADIANS_PER_DEGREE=Math.PI/180,i.DEGREES_PER_RADIAN=180/Math.PI,i.RADIANS_PER_ARCSECOND=i.RADIANS_PER_DEGREE/3600,i.toRadians=function(e){return e*i.RADIANS_PER_DEGREE},i.toDegrees=function(e){return e*i.DEGREES_PER_RADIAN},i.convertLongitudeRange=function(e){var t=i.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},i.clampToLatitudeRange=function(e){return i.clamp(e,-1*i.PI_OVER_TWO,i.PI_OVER_TWO)},i.negativePiToPi=function(e){return i.zeroToTwoPi(e+i.PI)-i.PI},i.zeroToTwoPi=function(e){var t=i.mod(e,i.TWO_PI);return Math.abs(t)<i.EPSILON14&&Math.abs(e)>i.EPSILON14?i.TWO_PI:t},i.mod=function(e,t){return(e%t+t)%t},i.equalsEpsilon=function(e,n,r,i){i=t(i,r);var a=Math.abs(e-n);return a<=i||a<=r*Math.max(Math.abs(e),Math.abs(n))};var a=[1];i.factorial=function(e){var t=a.length;if(e>=t)for(var n=a[t-1],r=t;r<=e;r++)a.push(n*r);return a[e]},i.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},i.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},i.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},i.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return i.setRandomNumberSeed=function(t){o=new e(t)},i.nextRandomNumber=function(){return o.random()},i.acosClamped=function(e){return Math.acos(i.clamp(e,-1,1))},i.asinClamped=function(e){return Math.asin(i.clamp(e,-1,1))},i.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},i.logBase=function(e,t){return Math.log(e)/Math.log(t)},i.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},i}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var i=e.clock,a=e.cone,u=t(e.magnitude,1),E=u*Math.sin(a);return r.x=E*Math.cos(i),r.y=E*Math.sin(i),r.z=u*Math.cos(a),r},o.fromElements=function(e,t,r,i){return n(i)?(i.x=e,i.y=t,i.z=r,i):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new o),i.x=e[r++],i.y=e[r++],i.z=e[r],i},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var i=0;i<r;++i)o.pack(e[i],t,3*i);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var i=0;i<r;i+=3){var a=i/3;t[a]=o.unpack(e,i,t[a])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,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};var E=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,E),r=o.multiplyByScalar(e,1-n,r),o.add(E,r,r)};var s=new o,c=new o;o.angleBetween=function(e,t){o.normalize(e,s),o.normalize(t,c);var n=o.dot(s,c),r=o.magnitude(o.cross(s,c,s));return Math.atan2(r,n)};var _=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,_);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,i){return e===t||n(e)&&n(t)&&a.equalsEpsilon(e.x,t.x,r,i)&&a.equalsEpsilon(e.y,t.y,r,i)&&a.equalsEpsilon(e.z,t.z,r,i)},o.cross=function(e,t,n){var r=e.x,i=e.y,a=e.z,o=t.x,u=t.y,E=t.z,s=i*E-a*u,c=a*o-r*E,_=r*u-i*o;return n.x=s,n.y=c,n.z=_,n},o.fromDegrees=function(e,t,n,r,i){return e=a.toRadians(e),t=a.toRadians(t),o.fromRadians(e,t,n,r,i)};var T=new o,R=new o,l=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,i,a,u){i=t(i,0);var E=n(a)?a.radiiSquared:l,s=Math.cos(r);T.x=s*Math.cos(e),T.y=s*Math.sin(e),T.z=Math.sin(r),T=o.normalize(T,T),o.multiplyComponents(E,T,R);var c=Math.sqrt(o.dot(T,R));return R=o.divideByScalar(R,c,R),T=o.multiplyByScalar(T,i,T),n(u)||(u=new o),o.add(R,T,u)},o.fromDegreesArray=function(e,t,r){var i=e.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],E=e[a+1],s=a/2;r[s]=o.fromDegrees(u,E,0,t,r[s])}return r},o.fromRadiansArray=function(e,t,r){var i=e.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],E=e[a+1],s=a/2;r[s]=o.fromRadians(u,E,0,t,r[s])}return r},o.fromDegreesArrayHeights=function(e,t,r){var i=e.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],E=e[a+1],s=e[a+2],c=a/3;r[c]=o.fromDegrees(u,E,s,t,r[c])}return r},o.fromRadiansArrayHeights=function(e,t,r){var i=e.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],E=e[a+1],s=e[a+2],c=a/3;r[c]=o.fromRadians(u,E,s,t,r[c])}return r},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,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function i(n,i,u,E,s){var c=n.x,_=n.y,T=n.z,R=i.x,l=i.y,A=i.z,f=c*c*R*R,h=_*_*l*l,N=T*T*A*A,d=f+h+N,I=Math.sqrt(1/d),S=e.multiplyByScalar(n,I,a);if(d<E)return isFinite(I)?e.clone(S,s):void 0;var M=u.x,O=u.y,m=u.z,y=o;y.x=S.x*M*2,y.y=S.y*O*2,y.z=S.z*m*2;var p,C,U,L,F,P,g,w,D,v,B,x=(1-I)*e.magnitude(n)/(.5*e.magnitude(y)),z=0;do{x-=z,U=1/(1+x*M),L=1/(1+x*O),F=1/(1+x*m),P=U*U,g=L*L,w=F*F,D=P*U,v=g*L,B=w*F,p=f*P+h*g+N*w-1,C=f*D*M+h*v*O+N*B*m;var G=-2*C;z=p/G}while(Math.abs(p)>r.EPSILON12);return t(s)?(s.x=c*U,s.y=_*L,s.z=T*F,s):new e(c*U,_*L,T*F)}var a=new e,o=new e;return i}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,i,a,o){"use strict";function u(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)}u.fromRadians=function(e,r,i,a){return i=t(i,0),n(a)?(a.longitude=e,a.latitude=r,a.height=i,a):new u(e,r,i)},u.fromDegrees=function(e,t,n,r){return e=a.toRadians(e),t=a.toRadians(t),u.fromRadians(e,t,n,r)};var E=new e,s=new e,c=new e,_=new e(1/6378137,1/6378137,1/6356752.314245179),T=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),R=a.EPSILON1;return u.fromCartesian=function(t,r,i){var l=n(r)?r.oneOverRadii:_,A=n(r)?r.oneOverRadiiSquared:T,f=n(r)?r._centerToleranceSquared:R,h=o(t,l,A,f,s);if(n(h)){var N=e.multiplyComponents(h,A,E);N=e.normalize(N,N);var d=e.subtract(t,h,c),I=Math.atan2(N.y,N.x),S=Math.asin(N.z),M=a.sign(e.dot(d,t))*e.magnitude(d);return n(i)?(i.longitude=I,i.latitude=S,i.height=M,i):new u(I,S,M)}},u.clone=function(e,t){if(n(e))return n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},u.ZERO=i(new u(0,0,0)),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,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,i,a,o,u,E){"use strict";function s(t,r,i,a){r=n(r,0),i=n(i,0),a=n(a,0),t._radii=new e(r,i,a),t._radiiSquared=new e(r*r,i*i,a*a),t._radiiToTheFourth=new e(r*r*r*r,i*i*i*i,a*a*a*a),t._oneOverRadii=new e(0===r?0:1/r,0===i?0:1/i,0===a?0:1/a),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===i?0:1/(i*i),0===a?0:1/(a*a)),t._minimumRadius=Math.min(r,i,a),t._maximumRadius=Math.max(r,i,a),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function c(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,s(this,e,t,n)}i(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,n){if(r(t)){var i=t._radii;return r(n)?(e.clone(i,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new c(i.x,i.y,i.z)}},c.fromCartesian3=function(e,t){return r(t)||(t=new c),r(e)?(s(t,e.x,e.y,e.z),t):t},c.WGS84=o(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=o(new c(1,1,1)),c.MOON=o(new c(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),c.prototype.clone=function(e){return c.clone(this,e)},c.packedLength=e.packedLength,c.pack=function(t,r,i){return i=n(i,0),e.pack(t._radii,r,i),r},c.unpack=function(t,r,i){r=n(r,0);var a=e.unpack(t,r);return c.fromCartesian3(a,i)},c.prototype.geocentricSurfaceNormal=e.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(t,n){var i=t.longitude,a=t.latitude,o=Math.cos(a),u=o*Math.cos(i),E=o*Math.sin(i),s=Math.sin(a);return r(n)||(n=new e),n.x=u,n.y=E,n.z=s,e.normalize(n,n)},c.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var _=new e,T=new e;c.prototype.cartographicToCartesian=function(t,n){var i=_,a=T;this.geodeticSurfaceNormalCartographic(t,i),e.multiplyComponents(this._radiiSquared,i,a);var o=Math.sqrt(e.dot(i,a));return e.divideByScalar(a,o,a),e.multiplyByScalar(i,t.height,i),r(n)||(n=new e),e.add(a,i,n)},c.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;i<n;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var R=new e,l=new e,A=new e;return c.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,l);if(r(a)){var o=this.geodeticSurfaceNormal(a,R),E=e.subtract(n,a,A),s=Math.atan2(o.y,o.x),c=Math.asin(o.z),_=u.sign(e.dot(E,n))*e.magnitude(E);return r(i)?(i.longitude=s,i.latitude=c,i.height=_,i):new t(s,c,_)}},c.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;i<n;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t},c.prototype.scaleToGeodeticSurface=function(e,t){return E(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},c.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var i=t.x,a=t.y,o=t.z,u=this._oneOverRadiiSquared,E=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*u.z);return e.multiplyByScalar(t,E,n)},c.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},c.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},c.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},c.prototype.toString=function(){return this._radii.toString()},c.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,i,a){i=n(i,0);var o=this._sqauredXOverSquaredZ;if(r(a)||(a=new e),a.x=0,a.y=0,a.z=t.z*(1-o),!(Math.abs(a.z)>=this._radii.z-i))return a},c}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,i,a,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return i(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var i=this._semimajorAxis,a=t.longitude*i,o=t.latitude*i,u=t.height;return r(n)?(n.x=a,n.y=o,n.z=u,n):new e(a,o,u)},u.prototype.unproject=function(e,n){var i=this._oneOverSemimajorAxis,a=e.x*i,o=e.y*i,u=e.z;return r(n)?(n.longitude=a,n.latitude=o,n.height=u,n):new t(a,o,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";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a,o,u){"use strict";function E(e,t,r,i,a,o,u,E,s){this[0]=n(e,0),this[1]=n(i,0),this[2]=n(u,0),this[3]=n(t,0),this[4]=n(a,0),this[5]=n(E,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(s,0)}function s(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function c(e){for(var t=0,n=0;n<3;++n){var r=e[E.getElementIndex(A[n],l[n])];t+=2*r*r}return Math.sqrt(t)}function _(e,t){for(var n=u.EPSILON15,r=0,i=1,a=0;a<3;++a){var o=Math.abs(e[E.getElementIndex(A[a],l[a])]);o>r&&(i=a,r=o)}var s=1,c=0,_=l[i],T=A[i];if(Math.abs(e[E.getElementIndex(T,_)])>n){var R,f=e[E.getElementIndex(T,T)],h=e[E.getElementIndex(_,_)],N=e[E.getElementIndex(T,_)],d=(f-h)/2/N;R=d<0?-1/(-d+Math.sqrt(1+d*d)):1/(d+Math.sqrt(1+d*d)),s=1/Math.sqrt(1+R*R),c=R*s}return t=E.clone(E.IDENTITY,t),t[E.getElementIndex(_,_)]=t[E.getElementIndex(T,T)]=s,t[E.getElementIndex(T,_)]=c,t[E.getElementIndex(_,T)]=-c,t}E.packedLength=9,E.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t},E.unpack=function(e,t,i){return t=n(t,0),r(i)||(i=new E),i[0]=e[t++],i[1]=e[t++],i[2]=e[t++],i[3]=e[t++],i[4]=e[t++],i[5]=e[t++],i[6]=e[t++],i[7]=e[t++],i[8]=e[t++],i},E.clone=function(e,t){if(r(e))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):new E(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},E.fromArray=function(e,t,i){return t=n(t,0),r(i)||(i=new E),i[0]=e[t],i[1]=e[t+1],i[2]=e[t+2],i[3]=e[t+3],i[4]=e[t+4],i[5]=e[t+5],i[6]=e[t+6],i[7]=e[t+7],i[8]=e[t+8],i},E.fromColumnMajorArray=function(e,t){return E.clone(e,t)},E.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 E(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},E.fromQuaternion=function(e,t){var n=e.x*e.x,i=e.x*e.y,a=e.x*e.z,o=e.x*e.w,u=e.y*e.y,s=e.y*e.z,c=e.y*e.w,_=e.z*e.z,T=e.z*e.w,R=e.w*e.w,l=n-u-_+R,A=2*(i-T),f=2*(a+c),h=2*(i+T),N=-n+u-_+R,d=2*(s-o),I=2*(a-c),S=2*(s+o),M=-n-u+_+R;return r(t)?(t[0]=l,t[1]=h,t[2]=I,t[3]=A,t[4]=N,t[5]=S,t[6]=f,t[7]=d,t[8]=M,t):new E(l,A,f,h,N,d,I,S,M)},E.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),i=Math.cos(-e.heading),a=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),s=Math.sin(e.roll),c=n*i,_=-a*u+s*o*i,T=s*u+a*o*i,R=n*u,l=a*i+s*o*u,A=-o*a+a*o*u,f=-o,h=s*n,N=a*n;return r(t)?(t[0]=c,t[1]=R,t[2]=f,t[3]=_,t[4]=l,t[5]=h,t[6]=T,t[7]=A,t[8]=N,t):new E(c,_,T,R,l,A,f,h,N)},E.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 E(e.x,0,0,0,e.y,0,0,0,e.z)},E.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 E(e,0,0,0,e,0,0,0,e)},E.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 E(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},E.fromRotationX=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=i,t[6]=0,t[7]=-i,t[8]=n,t):new E(1,0,0,0,n,-i,0,i,n)},E.fromRotationY=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-i,t[3]=0,t[4]=1,t[5]=0,t[6]=i,t[7]=0,t[8]=n,t):new E(n,0,i,0,1,0,-i,0,n)},E.fromRotationZ=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=n,t[1]=i,t[2]=0,t[3]=-i,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new E(n,-i,0,i,n,0,0,0,1)},E.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]]},E.getElementIndex=function(e,t){return 3*e+t},E.getColumn=function(e,t,n){var r=3*t,i=e[r],a=e[r+1],o=e[r+2];return n.x=i,n.y=a,n.z=o,n},E.setColumn=function(e,t,n,r){r=E.clone(e,r);var i=3*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},E.getRow=function(e,t,n){var r=e[t],i=e[t+3],a=e[t+6];return n.x=r,n.y=i,n.z=a,n},E.setRow=function(e,t,n,r){return r=E.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var T=new e;E.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],T)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],T)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],T)),n};var R=new e;E.getMaximumScale=function(t){return E.getScale(t,R),e.maximumComponent(R)},E.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],i=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],o=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],E=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],s=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],c=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],_=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=r,n[1]=i,n[2]=a,n[3]=o,n[4]=u,n[5]=E,n[6]=s,n[7]=c,n[8]=_,n},E.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},E.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},E.multiplyByVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[3]*i+e[6]*a,u=e[1]*r+e[4]*i+e[7]*a,E=e[2]*r+e[5]*i+e[8]*a;return n.x=o,n.y=u,n.z=E,n},E.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},E.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},E.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},E.transpose=function(e,t){var n=e[0],r=e[3],i=e[6],a=e[1],o=e[4],u=e[7],E=e[2],s=e[5],c=e[8];return t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=u,t[6]=E,t[7]=s,t[8]=c,t};var l=[1,0,0],A=[2,2,1],f=new E,h=new E;return E.computeEigenDecomposition=function(e,t){var n=u.EPSILON20,i=10,a=0,o=0;r(t)||(t={});for(var T=t.unitary=E.clone(E.IDENTITY,t.unitary),R=t.diagonal=E.clone(e,t.diagonal),l=n*s(R);o<i&&c(R)>l;)_(R,f),E.transpose(f,h),E.multiply(R,f,R),E.multiply(h,R,R),E.multiply(T,f,T),++a>2&&(++o,a=0);return t},E.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},E.determinant=function(e){var t=e[0],n=e[3],r=e[6],i=e[1],a=e[4],o=e[7],u=e[2],E=e[5],s=e[8];return t*(a*s-E*o)+i*(E*r-n*s)+u*(n*o-a*r)},E.inverse=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],u=e[5],s=e[6],c=e[7],_=e[8],T=E.determinant(e);t[0]=o*_-c*u,t[1]=c*i-r*_,t[2]=r*u-o*i,t[3]=s*u-a*_,t[4]=n*_-s*i,t[5]=a*i-n*u,t[6]=a*c-s*o,t[7]=s*r-n*c,t[8]=n*o-a*r;var R=1/T;return E.multiplyByScalar(t,R,t)},E.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.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},E.IDENTITY=o(new E(1,0,0,0,1,0,0,0,1)),E.ZERO=o(new E(0,0,0,0,0,0,0,0,0)),E.COLUMN0ROW0=0,E.COLUMN0ROW1=1,E.COLUMN0ROW2=2,E.COLUMN1ROW0=3,E.COLUMN1ROW1=4,E.COLUMN1ROW2=5,E.COLUMN2ROW0=6,E.COLUMN2ROW1=7,E.COLUMN2ROW2=8,i(E.prototype,{length:{get:function(){return E.packedLength}}}),E.prototype.clone=function(e){return E.clone(this,e)},E.prototype.equals=function(e){return E.equals(this,e)},E.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},E.prototype.equalsEpsilon=function(e,t){return E.equalsEpsilon(this,e,t)},E.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},E}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(e,n,r,i){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(i,0)}o.fromElements=function(e,t,r,i,a){return n(a)?(a.x=e,a.y=t,a.z=r,a.w=i,a):new o(e,t,r,i)},o.fromColor=function(e,t){return n(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(n(e))return n(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)},o.packedLength=4,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},o.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new o),i.x=e[r++],i.y=e[r++],i.z=e[r++],i.w=e[r],i},o.packArray=function(e,t){var r=e.length;n(t)?t.length=4*r:t=new Array(4*r);for(var i=0;i<r;++i)o.pack(e[i],t,4*i);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/4:t=new Array(r/4);for(var i=0;i<r;i+=4){var a=i/4;t[a]=o.unpack(e,i,t[a])}return t},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,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},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 u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,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,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},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 E=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,E),r=o.multiplyByScalar(e,1-n,r),o.add(E,r,r)};var s=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,s);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},o.equalsEpsilon=function(e,t,r,i){return e===t||n(e)&&n(t)&&a.equalsEpsilon(e.x,t.x,r,i)&&a.equalsEpsilon(e.y,t.y,r,i)&&a.equalsEpsilon(e.z,t.z,r,i)&&a.equalsEpsilon(e.w,t.w,r,i)},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,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,i,a,o,u,E,s,c){ +"use strict";function _(e,t,n,i,a,o,u,E,s,c,_,T,R,l,A,f){this[0]=r(e,0),this[1]=r(a,0),this[2]=r(s,0),this[3]=r(R,0),this[4]=r(t,0),this[5]=r(o,0),this[6]=r(c,0),this[7]=r(l,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(_,0),this[11]=r(A,0),this[12]=r(i,0),this[13]=r(E,0),this[14]=r(T,0),this[15]=r(f,0)}_.packedLength=16,_.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},_.unpack=function(e,t,n){return t=r(t,0),i(n)||(n=new _),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},_.clone=function(e,t){if(i(e))return i(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 _(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])},_.fromArray=_.unpack,_.fromColumnMajorArray=function(e,t){return _.clone(e,t)},_.fromRowMajorArray=function(e,t){return i(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 _(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])},_.fromRotationTranslation=function(t,n,a){return n=r(n,e.ZERO),i(a)?(a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=0,a[4]=t[3],a[5]=t[4],a[6]=t[5],a[7]=0,a[8]=t[6],a[9]=t[7],a[10]=t[8],a[11]=0,a[12]=n.x,a[13]=n.y,a[14]=n.z,a[15]=1,a):new _(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},_.fromTranslationQuaternionRotationScale=function(e,t,n,r){i(r)||(r=new _);var a=n.x,o=n.y,u=n.z,E=t.x*t.x,s=t.x*t.y,c=t.x*t.z,T=t.x*t.w,R=t.y*t.y,l=t.y*t.z,A=t.y*t.w,f=t.z*t.z,h=t.z*t.w,N=t.w*t.w,d=E-R-f+N,I=2*(s-h),S=2*(c+A),M=2*(s+h),O=-E+R-f+N,m=2*(l-T),y=2*(c-A),p=2*(l+T),C=-E-R+f+N;return r[0]=d*a,r[1]=M*a,r[2]=y*a,r[3]=0,r[4]=I*o,r[5]=O*o,r[6]=p*o,r[7]=0,r[8]=S*u,r[9]=m*u,r[10]=C*u,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},_.fromTranslationRotationScale=function(e,t){return _.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},_.fromTranslation=function(e,t){return _.fromRotationTranslation(s.IDENTITY,e,t)},_.fromScale=function(e,t){return i(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 _(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},_.fromUniformScale=function(e,t){return i(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 _(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var T=new e,R=new e,l=new e;_.fromCamera=function(t,n){var r=t.position,a=t.direction,o=t.up;e.normalize(a,T),e.normalize(e.cross(T,o,R),R),e.normalize(e.cross(R,T,l),l);var u=R.x,E=R.y,s=R.z,c=T.x,A=T.y,f=T.z,h=l.x,N=l.y,d=l.z,I=r.x,S=r.y,M=r.z,O=u*-I+E*-S+s*-M,m=h*-I+N*-S+d*-M,y=c*I+A*S+f*M;return i(n)?(n[0]=u,n[1]=h,n[2]=-c,n[3]=0,n[4]=E,n[5]=N,n[6]=-A,n[7]=0,n[8]=s,n[9]=d,n[10]=-f,n[11]=0,n[12]=O,n[13]=m,n[14]=y,n[15]=1,n):new _(u,E,s,O,h,N,d,m,-c,-A,-f,y,0,0,0,1)},_.computePerspectiveFieldOfView=function(e,t,n,r,i){var a=Math.tan(.5*e),o=1/a,u=o/t,E=(r+n)/(n-r),s=2*r*n/(n-r);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=o,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=E,i[11]=-1,i[12]=0,i[13]=0,i[14]=s,i[15]=0,i},_.computeOrthographicOffCenter=function(e,t,n,r,i,a,o){var u=1/(t-e),E=1/(r-n),s=1/(a-i),c=-(t+e)*u,_=-(r+n)*E,T=-(a+i)*s;return u*=2,E*=2,s*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=s,o[11]=0,o[12]=c,o[13]=_,o[14]=T,o[15]=1,o},_.computePerspectiveOffCenter=function(e,t,n,r,i,a,o){var u=2*i/(t-e),E=2*i/(r-n),s=(t+e)/(t-e),c=(r+n)/(r-n),_=-(a+i)/(a-i),T=-1,R=-2*a*i/(a-i);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=s,o[9]=c,o[10]=_,o[11]=T,o[12]=0,o[13]=0,o[14]=R,o[15]=0,o},_.computeInfinitePerspectiveOffCenter=function(e,t,n,r,i,a){var o=2*i/(t-e),u=2*i/(r-n),E=(t+e)/(t-e),s=(r+n)/(r-n),c=-1,_=-1,T=-2*i;return a[0]=o,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=E,a[9]=s,a[10]=c,a[11]=_,a[12]=0,a[13]=0,a[14]=T,a[15]=0,a},_.computeViewportTransformation=function(e,t,n,i){e=r(e,r.EMPTY_OBJECT);var a=r(e.x,0),o=r(e.y,0),u=r(e.width,0),E=r(e.height,0);t=r(t,0),n=r(n,1);var s=.5*u,c=.5*E,_=.5*(n-t),T=s,R=c,l=_,A=a+s,f=o+c,h=t+_,N=1;return i[0]=T,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=R,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=l,i[11]=0,i[12]=A,i[13]=f,i[14]=h,i[15]=N,i},_.computeView=function(t,n,r,i,a){return a[0]=i.x,a[1]=r.x,a[2]=-n.x,a[3]=0,a[4]=i.y,a[5]=r.y,a[6]=-n.y,a[7]=0,a[8]=i.z,a[9]=r.z,a[10]=-n.z,a[11]=0,a[12]=-e.dot(i,t),a[13]=-e.dot(r,t),a[14]=e.dot(n,t),a[15]=1,a},_.toArray=function(e,t){return i(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]]},_.getElementIndex=function(e,t){return 4*e+t},_.getColumn=function(e,t,n){var r=4*t,i=e[r],a=e[r+1],o=e[r+2],u=e[r+3];return n.x=i,n.y=a,n.z=o,n.w=u,n},_.setColumn=function(e,t,n,r){r=_.clone(e,r);var i=4*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r[i+3]=n.w,r},_.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},_.getRow=function(e,t,n){var r=e[t],i=e[t+4],a=e[t+8],o=e[t+12];return n.x=r,n.y=i,n.z=a,n.w=o,n},_.setRow=function(e,t,n,r){return r=_.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var A=new e;_.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],A)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],A)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],A)),n};var f=new e;_.getMaximumScale=function(t){return _.getScale(t,f),e.maximumComponent(f)},_.multiply=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[3],u=e[4],E=e[5],s=e[6],c=e[7],_=e[8],T=e[9],R=e[10],l=e[11],A=e[12],f=e[13],h=e[14],N=e[15],d=t[0],I=t[1],S=t[2],M=t[3],O=t[4],m=t[5],y=t[6],p=t[7],C=t[8],U=t[9],L=t[10],F=t[11],P=t[12],g=t[13],w=t[14],D=t[15],v=r*d+u*I+_*S+A*M,B=i*d+E*I+T*S+f*M,x=a*d+s*I+R*S+h*M,z=o*d+c*I+l*S+N*M,G=r*O+u*m+_*y+A*p,b=i*O+E*m+T*y+f*p,X=a*O+s*m+R*y+h*p,V=o*O+c*m+l*y+N*p,q=r*C+u*U+_*L+A*F,H=i*C+E*U+T*L+f*F,W=a*C+s*U+R*L+h*F,Y=o*C+c*U+l*L+N*F,K=r*P+u*g+_*w+A*D,k=i*P+E*g+T*w+f*D,Z=a*P+s*g+R*w+h*D,j=o*P+c*g+l*w+N*D;return n[0]=v,n[1]=B,n[2]=x,n[3]=z,n[4]=G,n[5]=b,n[6]=X,n[7]=V,n[8]=q,n[9]=H,n[10]=W,n[11]=Y,n[12]=K,n[13]=k,n[14]=Z,n[15]=j,n},_.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},_.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},_.multiplyTransformation=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[4],u=e[5],E=e[6],s=e[8],c=e[9],_=e[10],T=e[12],R=e[13],l=e[14],A=t[0],f=t[1],h=t[2],N=t[4],d=t[5],I=t[6],S=t[8],M=t[9],O=t[10],m=t[12],y=t[13],p=t[14],C=r*A+o*f+s*h,U=i*A+u*f+c*h,L=a*A+E*f+_*h,F=r*N+o*d+s*I,P=i*N+u*d+c*I,g=a*N+E*d+_*I,w=r*S+o*M+s*O,D=i*S+u*M+c*O,v=a*S+E*M+_*O,B=r*m+o*y+s*p+T,x=i*m+u*y+c*p+R,z=a*m+E*y+_*p+l;return n[0]=C,n[1]=U,n[2]=L,n[3]=0,n[4]=F,n[5]=P,n[6]=g,n[7]=0,n[8]=w,n[9]=D,n[10]=v,n[11]=0,n[12]=B,n[13]=x,n[14]=z,n[15]=1,n},_.multiplyByMatrix3=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[4],u=e[5],E=e[6],s=e[8],c=e[9],_=e[10],T=t[0],R=t[1],l=t[2],A=t[3],f=t[4],h=t[5],N=t[6],d=t[7],I=t[8],S=r*T+o*R+s*l,M=i*T+u*R+c*l,O=a*T+E*R+_*l,m=r*A+o*f+s*h,y=i*A+u*f+c*h,p=a*A+E*f+_*h,C=r*N+o*d+s*I,U=i*N+u*d+c*I,L=a*N+E*d+_*I;return n[0]=S,n[1]=M,n[2]=O,n[3]=0,n[4]=m,n[5]=y,n[6]=p,n[7]=0,n[8]=C,n[9]=U,n[10]=L,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},_.multiplyByTranslation=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=r*e[0]+i*e[4]+a*e[8]+e[12],u=r*e[1]+i*e[5]+a*e[9]+e[13],E=r*e[2]+i*e[6]+a*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=E,n[15]=e[15],n};var h=new e;_.multiplyByUniformScale=function(e,t,n){return h.x=t,h.y=t,h.z=t,_.multiplyByScale(e,h,n)},_.multiplyByScale=function(e,t,n){var r=t.x,i=t.y,a=t.z;return 1===r&&1===i&&1===a?_.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=i*e[4],n[5]=i*e[5],n[6]=i*e[6],n[7]=0,n[8]=a*e[8],n[9]=a*e[9],n[10]=a*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},_.multiplyByVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=t.w,u=e[0]*r+e[4]*i+e[8]*a+e[12]*o,E=e[1]*r+e[5]*i+e[9]*a+e[13]*o,s=e[2]*r+e[6]*i+e[10]*a+e[14]*o,c=e[3]*r+e[7]*i+e[11]*a+e[15]*o;return n.x=u,n.y=E,n.z=s,n.w=c,n},_.multiplyByPointAsVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[4]*i+e[8]*a,u=e[1]*r+e[5]*i+e[9]*a,E=e[2]*r+e[6]*i+e[10]*a;return n.x=o,n.y=u,n.z=E,n},_.multiplyByPoint=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[4]*i+e[8]*a+e[12],u=e[1]*r+e[5]*i+e[9]*a+e[13],E=e[2]*r+e[6]*i+e[10]*a+e[14];return n.x=o,n.y=u,n.z=E,n},_.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},_.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},_.transpose=function(e,t){var n=e[1],r=e[2],i=e[3],a=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=a,t[10]=e[10],t[11]=e[14],t[12]=i,t[13]=o,t[14]=u,t[15]=e[15],t},_.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},_.equals=function(e,t){return e===t||i(e)&&i(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},_.equalsEpsilon=function(e,t,n){return e===t||i(e)&&i(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},_.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},_.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};var N=new s,d=new s,I=new t,S=new t(0,0,0,1);return _.inverse=function(e,n){if(s.equalsEpsilon(_.getRotation(e,N),d,E.EPSILON7)&&t.equals(_.getRow(e,3,I),S))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],i=e[4],a=e[8],o=e[12],u=e[1],T=e[5],R=e[9],l=e[13],A=e[2],f=e[6],h=e[10],M=e[14],O=e[3],m=e[7],y=e[11],p=e[15],C=h*p,U=M*y,L=f*p,F=M*m,P=f*y,g=h*m,w=A*p,D=M*O,v=A*y,B=h*O,x=A*m,z=f*O,G=C*T+F*R+P*l-(U*T+L*R+g*l),b=U*u+w*R+B*l-(C*u+D*R+v*l),X=L*u+D*T+x*l-(F*u+w*T+z*l),V=g*u+v*T+z*R-(P*u+B*T+x*R),q=U*i+L*a+g*o-(C*i+F*a+P*o),H=C*r+D*a+v*o-(U*r+w*a+B*o),W=F*r+w*i+z*o-(L*r+D*i+x*o),Y=P*r+B*i+x*a-(g*r+v*i+z*a);C=a*l,U=o*R,L=i*l,F=o*T,P=i*R,g=a*T,w=r*l,D=o*u,v=r*R,B=a*u,x=r*T,z=i*u;var K=C*m+F*y+P*p-(U*m+L*y+g*p),k=U*O+w*y+B*p-(C*O+D*y+v*p),Z=L*O+D*m+x*p-(F*O+w*m+z*p),j=g*O+v*m+z*y-(P*O+B*m+x*y),Q=L*h+g*M+U*f-(P*M+C*f+F*h),J=v*M+C*A+D*h-(w*h+B*M+U*A),$=w*f+z*M+F*A-(x*M+L*A+D*f),ee=x*h+P*A+B*f-(v*f+z*h+g*A),te=r*G+i*b+a*X+o*V;if(Math.abs(te)<E.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=G*te,n[1]=b*te,n[2]=X*te,n[3]=V*te,n[4]=q*te,n[5]=H*te,n[6]=W*te,n[7]=Y*te,n[8]=K*te,n[9]=k*te,n[10]=Z*te,n[11]=j*te,n[12]=Q*te,n[13]=J*te,n[14]=$*te,n[15]=ee*te,n},_.inverseTransformation=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[4],o=e[5],u=e[6],E=e[8],s=e[9],c=e[10],_=e[12],T=e[13],R=e[14],l=-n*_-r*T-i*R,A=-a*_-o*T-u*R,f=-E*_-s*T-c*R;return t[0]=n,t[1]=a,t[2]=E,t[3]=0,t[4]=r,t[5]=o,t[6]=s,t[7]=0,t[8]=i,t[9]=u,t[10]=c,t[11]=0,t[12]=l,t[13]=A,t[14]=f,t[15]=1,t},_.IDENTITY=u(new _(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),_.ZERO=u(new _(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),_.COLUMN0ROW0=0,_.COLUMN0ROW1=1,_.COLUMN0ROW2=2,_.COLUMN0ROW3=3,_.COLUMN1ROW0=4,_.COLUMN1ROW1=5,_.COLUMN1ROW2=6,_.COLUMN1ROW3=7,_.COLUMN2ROW0=8,_.COLUMN2ROW1=9,_.COLUMN2ROW2=10,_.COLUMN2ROW3=11,_.COLUMN3ROW0=12,_.COLUMN3ROW1=13,_.COLUMN3ROW2=14,_.COLUMN3ROW3=15,a(_.prototype,{length:{get:function(){return _.packedLength}}}),_.prototype.clone=function(e){return _.clone(this,e)},_.prototype.equals=function(e){return _.equals(this,e)},_.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},_.prototype.equalsEpsilon=function(e,t){return _.equalsEpsilon(this,e,t)},_.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]+")"},_}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,i,a,o,u,E){"use strict";function s(e,t,r,i){this.west=n(e,0),this.south=n(t,0),this.east=n(r,0),this.north=n(i,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,t,r){return r=n(r,0),t[r++]=e.west,t[r++]=e.south,t[r++]=e.east,t[r]=e.north,t},s.unpack=function(e,t,i){return t=n(t,0),r(i)||(i=new s),i.west=e[t++],i.south=e[t++],i.east=e[t++],i.north=e[t],i},s.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=E.TWO_PI),t-n},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,t,i,a,o){return e=E.toRadians(n(e,0)),t=E.toRadians(n(t,0)),i=E.toRadians(n(i,0)),a=E.toRadians(n(a,0)),r(o)?(o.west=e,o.south=t,o.east=i,o.north=a,o):new s(e,t,i,a)},s.fromRadians=function(e,t,i,a,o){return r(o)?(o.west=n(e,0),o.south=n(t,0),o.east=n(i,0),o.north=n(a,0),o):new s(e,t,i,a)},s.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,u=Number.MAX_VALUE,c=-Number.MAX_VALUE,_=0,T=e.length;_<T;_++){var R=e[_];n=Math.min(n,R.longitude),i=Math.max(i,R.longitude),u=Math.min(u,R.latitude),c=Math.max(c,R.latitude);var l=R.longitude>=0?R.longitude:R.longitude+E.TWO_PI;a=Math.min(a,l),o=Math.max(o,l)}return i-n>o-a&&(n=a,i=o,i>E.PI&&(i-=E.TWO_PI),n>E.PI&&(n-=E.TWO_PI)),r(t)?(t.west=n,t.south=u,t.east=i,t.north=c,t):new s(n,u,i,c)},s.fromCartesianArray=function(e,t,n){for(var i=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,u=-Number.MAX_VALUE,c=Number.MAX_VALUE,_=-Number.MAX_VALUE,T=0,R=e.length;T<R;T++){var l=t.cartesianToCartographic(e[T]);i=Math.min(i,l.longitude),a=Math.max(a,l.longitude),c=Math.min(c,l.latitude),_=Math.max(_,l.latitude);var A=l.longitude>=0?l.longitude:l.longitude+E.TWO_PI;o=Math.min(o,A),u=Math.max(u,A)}return a-i>u-o&&(i=o,a=u,a>E.PI&&(a-=E.TWO_PI),i>E.PI&&(i-=E.TWO_PI)),r(n)?(n.west=i,n.south=c,n.east=a,n.north=_,n):new s(i,c,a,_)},s.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.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},s.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},s.validate=function(e){},s.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)},s.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)},s.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)},s.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)},s.center=function(t,n){var i=t.east,a=t.west;i<a&&(i+=E.TWO_PI);var o=E.negativePiToPi(.5*(a+i)),u=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=u,n.height=0,n):new e(o,u)},s.intersection=function(e,t,n){var i=e.east,a=e.west,o=t.east,u=t.west;i<a&&o>0?i+=E.TWO_PI:o<u&&i>0&&(o+=E.TWO_PI),i<a&&u<0?u+=E.TWO_PI:o<u&&a<0&&(a+=E.TWO_PI);var c=E.negativePiToPi(Math.max(a,u)),_=E.negativePiToPi(Math.min(i,o));if(!((e.west<e.east||t.west<t.east)&&_<=c)){var T=Math.max(e.south,t.south),R=Math.min(e.north,t.north);if(!(T>=R))return r(n)?(n.west=c,n.south=T,n.east=_,n.north=R,n):new s(c,T,_,R)}},s.simpleIntersection=function(e,t,n){var i=Math.max(e.west,t.west),a=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(a>=u||i>=o))return r(n)?(n.west=i,n.south=a,n.east=o,n.north=u,n):new s(i,a,o,u)},s.union=function(e,t,n){r(n)||(n=new s);var i=e.east,a=e.west,o=t.east,u=t.west;i<a&&o>0?i+=E.TWO_PI:o<u&&i>0&&(o+=E.TWO_PI),i<a&&u<0?u+=E.TWO_PI:o<u&&a<0&&(a+=E.TWO_PI);var c=E.convertLongitudeRange(Math.min(a,u)),_=E.convertLongitudeRange(Math.max(i,o));return n.west=c,n.south=Math.min(e.south,t.south),n.east=_,n.north=Math.max(e.north,t.north),n},s.expand=function(e,t,n){return r(n)||(n=new s),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},s.contains=function(e,t){var n=t.longitude,r=t.latitude,i=e.west,a=e.east;return a<i&&(a+=E.TWO_PI,n<0&&(n+=E.TWO_PI)),(n>i||E.equalsEpsilon(n,i,E.EPSILON14))&&(n<a||E.equalsEpsilon(n,a,E.EPSILON14))&&r>=e.south&&r<=e.north};var c=new e;return s.subsample=function(e,t,i,a){t=n(t,o.WGS84),i=n(i,0),r(a)||(a=[]);var u=0,_=e.north,T=e.south,R=e.east,l=e.west,A=c;A.height=i,A.longitude=l,A.latitude=_,a[u]=t.cartographicToCartesian(A,a[u]),u++,A.longitude=R,a[u]=t.cartographicToCartesian(A,a[u]),u++,A.latitude=T,a[u]=t.cartographicToCartesian(A,a[u]),u++,A.longitude=l,a[u]=t.cartographicToCartesian(A,a[u]),u++,_<0?A.latitude=_:T>0?A.latitude=T:A.latitude=0;for(var f=1;f<8;++f)A.longitude=-Math.PI+f*E.PI_OVER_TWO,s.contains(e,A)&&(a[u]=t.cartographicToCartesian(A,a[u]),u++);return 0===A.latitude&&(A.longitude=l,a[u]=t.cartographicToCartesian(A,a[u]),u++,A.longitude=R,a[u]=t.cartographicToCartesian(A,a[u]),u++),a.length=u,a},s.MAX_VALUE=u(new s(-Math.PI,-E.PI_OVER_TWO,Math.PI,E.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,i,a,o,u,E,s,c,_){"use strict";function T(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var R=new e,l=new e,A=new e,f=new e,h=new e,N=new e,d=new e,I=new e,S=new e,M=new e,O=new e,m=new e;T.fromPoints=function(t,n){if(i(n)||(n=new T),!i(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var r=e.clone(t[0],d),a=e.clone(r,R),o=e.clone(r,l),u=e.clone(r,A),E=e.clone(r,f),s=e.clone(r,h),c=e.clone(r,N),_=t.length,y=1;y<_;y++){e.clone(t[y],r);var p=r.x,C=r.y,U=r.z;p<a.x&&e.clone(r,a),p>E.x&&e.clone(r,E),C<o.y&&e.clone(r,o),C>s.y&&e.clone(r,s),U<u.z&&e.clone(r,u),U>c.z&&e.clone(r,c)}var L=e.magnitudeSquared(e.subtract(E,a,I)),F=e.magnitudeSquared(e.subtract(s,o,I)),P=e.magnitudeSquared(e.subtract(c,u,I)),g=a,w=E,D=L;F>D&&(D=F,g=o,w=s),P>D&&(D=P,g=u,w=c);var v=S;v.x=.5*(g.x+w.x),v.y=.5*(g.y+w.y),v.z=.5*(g.z+w.z);var B=e.magnitudeSquared(e.subtract(w,v,I)),x=Math.sqrt(B),z=M;z.x=a.x,z.y=o.y,z.z=u.z;var G=O;G.x=E.x,G.y=s.y,G.z=c.z;var b=e.multiplyByScalar(e.add(z,G,I),.5,m),X=0;for(y=0;y<_;y++){e.clone(t[y],r);var V=e.magnitude(e.subtract(r,b,I));V>X&&(X=V);var q=e.magnitudeSquared(e.subtract(r,v,I));if(q>B){var H=Math.sqrt(q);x=.5*(x+H),B=x*x;var W=H-x;v.x=(x*v.x+W*r.x)/H,v.y=(x*v.y+W*r.y)/H,v.z=(x*v.z+W*r.z)/H}}return x<X?(e.clone(v,n.center),n.radius=x):(e.clone(b,n.center),n.radius=X),n};var y=new o,p=new e,C=new e,U=new t,L=new t;T.fromRectangle2D=function(e,t,n){return T.fromRectangleWithHeights2D(e,t,0,0,n)},T.fromRectangleWithHeights2D=function(t,n,a,o,u){if(i(u)||(u=new T),!i(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;n=r(n,y),_.southwest(t,U),U.height=a,_.northeast(t,L),L.height=o;var E=n.project(U,p),s=n.project(L,C),c=s.x-E.x,R=s.y-E.y,l=s.z-E.z;u.radius=.5*Math.sqrt(c*c+R*R+l*l);var A=u.center;return A.x=E.x+.5*c,A.y=E.y+.5*R,A.z=E.z+.5*l,u};var F=[];T.fromRectangle3D=function(e,t,n,o){t=r(t,a.WGS84),n=r(n,0);var u;return i(e)&&(u=_.subsample(e,t,n,F)),T.fromPoints(u,o)},T.fromVertices=function(t,n,a,o){if(i(o)||(o=new T),!i(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;n=r(n,e.ZERO),a=r(a,3);var u=d;u.x=t[0]+n.x,u.y=t[1]+n.y,u.z=t[2]+n.z;for(var E=e.clone(u,R),s=e.clone(u,l),c=e.clone(u,A),_=e.clone(u,f),y=e.clone(u,h),p=e.clone(u,N),C=t.length,U=0;U<C;U+=a){var L=t[U]+n.x,F=t[U+1]+n.y,P=t[U+2]+n.z;u.x=L,u.y=F,u.z=P,L<E.x&&e.clone(u,E),L>_.x&&e.clone(u,_),F<s.y&&e.clone(u,s),F>y.y&&e.clone(u,y),P<c.z&&e.clone(u,c),P>p.z&&e.clone(u,p)}var g=e.magnitudeSquared(e.subtract(_,E,I)),w=e.magnitudeSquared(e.subtract(y,s,I)),D=e.magnitudeSquared(e.subtract(p,c,I)),v=E,B=_,x=g;w>x&&(x=w,v=s,B=y),D>x&&(x=D,v=c,B=p);var z=S;z.x=.5*(v.x+B.x),z.y=.5*(v.y+B.y),z.z=.5*(v.z+B.z);var G=e.magnitudeSquared(e.subtract(B,z,I)),b=Math.sqrt(G),X=M;X.x=E.x,X.y=s.y,X.z=c.z;var V=O;V.x=_.x,V.y=y.y,V.z=p.z;var q=e.multiplyByScalar(e.add(X,V,I),.5,m),H=0;for(U=0;U<C;U+=a){u.x=t[U]+n.x,u.y=t[U+1]+n.y,u.z=t[U+2]+n.z;var W=e.magnitude(e.subtract(u,q,I));W>H&&(H=W);var Y=e.magnitudeSquared(e.subtract(u,z,I));if(Y>G){var K=Math.sqrt(Y);b=.5*(b+K),G=b*b;var k=K-b;z.x=(b*z.x+k*u.x)/K,z.y=(b*z.y+k*u.y)/K,z.z=(b*z.z+k*u.z)/K}}return b<H?(e.clone(z,o.center),o.radius=b):(e.clone(q,o.center),o.radius=H),o},T.fromEncodedCartesianVertices=function(t,n,r){if(i(r)||(r=new T),!i(t)||!i(n)||t.length!==n.length||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var a=d;a.x=t[0]+n[0],a.y=t[1]+n[1],a.z=t[2]+n[2];for(var o=e.clone(a,R),u=e.clone(a,l),E=e.clone(a,A),s=e.clone(a,f),c=e.clone(a,h),_=e.clone(a,N),y=t.length,p=0;p<y;p+=3){var C=t[p]+n[p],U=t[p+1]+n[p+1],L=t[p+2]+n[p+2];a.x=C,a.y=U,a.z=L,C<o.x&&e.clone(a,o),C>s.x&&e.clone(a,s),U<u.y&&e.clone(a,u),U>c.y&&e.clone(a,c),L<E.z&&e.clone(a,E),L>_.z&&e.clone(a,_)}var F=e.magnitudeSquared(e.subtract(s,o,I)),P=e.magnitudeSquared(e.subtract(c,u,I)),g=e.magnitudeSquared(e.subtract(_,E,I)),w=o,D=s,v=F;P>v&&(v=P,w=u,D=c),g>v&&(v=g,w=E,D=_);var B=S;B.x=.5*(w.x+D.x),B.y=.5*(w.y+D.y),B.z=.5*(w.z+D.z);var x=e.magnitudeSquared(e.subtract(D,B,I)),z=Math.sqrt(x),G=M;G.x=o.x,G.y=u.y,G.z=E.z;var b=O;b.x=s.x,b.y=c.y,b.z=_.z;var X=e.multiplyByScalar(e.add(G,b,I),.5,m),V=0;for(p=0;p<y;p+=3){a.x=t[p]+n[p],a.y=t[p+1]+n[p+1],a.z=t[p+2]+n[p+2];var q=e.magnitude(e.subtract(a,X,I));q>V&&(V=q);var H=e.magnitudeSquared(e.subtract(a,B,I));if(H>x){var W=Math.sqrt(H);z=.5*(z+W),x=z*z;var Y=W-z;B.x=(z*B.x+Y*a.x)/W,B.y=(z*B.y+Y*a.y)/W,B.z=(z*B.z+Y*a.z)/W}}return z<V?(e.clone(B,r.center),r.radius=z):(e.clone(X,r.center),r.radius=V),r},T.fromCornerPoints=function(t,n,r){i(r)||(r=new T);var a=r.center;return e.add(t,n,a),e.multiplyByScalar(a,.5,a),r.radius=e.distance(a,n),r},T.fromEllipsoid=function(t,n){return i(n)||(n=new T),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var P=new e;T.fromBoundingSpheres=function(t,n){if(i(n)||(n=new T),!i(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var r=t.length;if(1===r)return T.clone(t[0],n);if(2===r)return T.union(t[0],t[1],n);for(var a=[],o=0;o<r;o++)a.push(t[o].center);n=T.fromPoints(a,n);var u=n.center,E=n.radius;for(o=0;o<r;o++){var s=t[o];E=Math.max(E,e.distance(u,s.center,P)+s.radius)}return n.radius=E,n};var g=new e,w=new e,D=new e;T.fromOrientedBoundingBox=function(t,n){i(n)||(n=new T);var r=t.halfAxes,a=s.getColumn(r,0,g),o=s.getColumn(r,1,w),u=s.getColumn(r,2,D),E=e.magnitude(a),c=e.magnitude(o),_=e.magnitude(u);return n.center=e.clone(t.center,n.center),n.radius=Math.max(E,c,_),n},T.clone=function(t,n){if(i(t))return i(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new T(t.center,t.radius)},T.packedLength=4,T.pack=function(e,t,n){n=r(n,0);var i=e.center;return t[n++]=i.x,t[n++]=i.y,t[n++]=i.z,t[n]=e.radius,t},T.unpack=function(e,t,n){t=r(t,0),i(n)||(n=new T);var a=n.center;return a.x=e[t++],a.y=e[t++],a.z=e[t++],n.radius=e[t],n};var v=new e,B=new e;T.union=function(t,n,r){i(r)||(r=new T);var a=t.center,o=t.radius,u=n.center,E=n.radius,s=e.subtract(u,a,v),c=e.magnitude(s);if(o>=c+E)return t.clone(r),r;if(E>=c+o)return n.clone(r),r;var _=.5*(o+c+E),R=e.multiplyByScalar(s,(-o+_)/c,B);return e.add(R,a,R),e.clone(R,r.center),r.radius=_,r};var x=new e;T.expand=function(t,n,r){r=T.clone(t,r);var i=e.magnitude(e.subtract(n,r.center,x));return i>r.radius&&(r.radius=i),r},T.intersectPlane=function(t,n){var r=t.center,i=t.radius,a=n.normal,o=e.dot(a,r)+n.distance;return o<-i?u.OUTSIDE:o<i?u.INTERSECTING:u.INSIDE},T.transform=function(e,t,n){return i(n)||(n=new T),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=c.getMaximumScale(t)*e.radius,n};var z=new e;T.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,z);return e.magnitudeSquared(r)-t.radius*t.radius},T.transformWithoutScale=function(e,t,n){return i(n)||(n=new T),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var G=new e;T.computePlaneDistances=function(t,n,r,a){i(a)||(a=new E);var o=e.subtract(t.center,n,G),u=e.dot(r,o);return a.start=u-t.radius,a.stop=u+t.radius,a};for(var b=new e,X=new e,V=new e,q=new e,H=new e,W=new t,Y=new Array(8),K=0;K<8;++K)Y[K]=new e;var k=new o;return T.projectTo2D=function(t,n,i){n=r(n,k);var a=n.ellipsoid,o=t.center,u=t.radius,E=a.geodeticSurfaceNormal(o,b),s=e.cross(e.UNIT_Z,E,X);e.normalize(s,s);var c=e.cross(E,s,V);e.normalize(c,c),e.multiplyByScalar(E,u,E),e.multiplyByScalar(c,u,c),e.multiplyByScalar(s,u,s);var _=e.negate(c,H),R=e.negate(s,q),l=Y,A=l[0];e.add(E,c,A),e.add(A,s,A),A=l[1],e.add(E,c,A),e.add(A,R,A),A=l[2],e.add(E,_,A),e.add(A,R,A),A=l[3],e.add(E,_,A),e.add(A,s,A),e.negate(E,E),A=l[4],e.add(E,c,A),e.add(A,s,A),A=l[5],e.add(E,c,A),e.add(A,R,A),A=l[6],e.add(E,_,A),e.add(A,R,A),A=l[7],e.add(E,_,A),e.add(A,s,A);for(var f=l.length,h=0;h<f;++h){var N=l[h];e.add(o,N,N);var d=a.cartesianToCartographic(N,W);n.project(d,N)}i=T.fromPoints(l,i),o=i.center;var I=o.x,S=o.y,M=o.z;return o.x=M,o.y=I,o.z=S,i},T.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},T.equals=function(t,n){return t===n||i(t)&&i(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},T.prototype.intersectPlane=function(e){return T.intersectPlane(this,e)},T.prototype.distanceSquaredTo=function(e){return T.distanceSquaredTo(this,e)},T.prototype.computePlaneDistances=function(e,t,n){return T.computePlaneDistances(this,e,t,n)},T.prototype.isOccluded=function(e){return T.isOccluded(this,e)},T.prototype.equals=function(e){return T.equals(this,e)},T.prototype.clone=function(e){return T.clone(this,e)},T}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},i={};return t(i,{element:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(i.supportsFullscreen())return null!==i.element}}}),i.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var i,a=["webkit","moz","o","ms","khtml"],o=0,u=a.length;o<u;++o){var E=a[o];i=E+"RequestFullscreen","function"==typeof t[i]?(r.requestFullscreen=i,n=!0):(i=E+"RequestFullScreen","function"==typeof t[i]&&(r.requestFullscreen=i,n=!0)),i=E+"ExitFullscreen","function"==typeof document[i]?r.exitFullscreen=i:(i=E+"CancelFullScreen","function"==typeof document[i]&&(r.exitFullscreen=i)),i=E+"FullscreenEnabled",void 0!==document[i]?r.fullscreenEnabled=i:(i=E+"FullScreenEnabled",void 0!==document[i]&&(r.fullscreenEnabled=i)),i=E+"FullscreenElement",void 0!==document[i]?r.fullscreenElement=i:(i=E+"FullScreenElement",void 0!==document[i]&&(r.fullscreenElement=i)),i=E+"fullscreenchange",void 0!==document["on"+i]&&("ms"===E&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=E+"fullscreenerror",void 0!==document["on"+i]&&("ms"===E&&(i="MSFullscreenError"),r.fullscreenerror=i)}return n},i.requestFullscreen=function(e,t){i.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},i.exitFullscreen=function(){i.supportsFullscreen()&&document[r.exitFullscreen]()},i}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function i(){if(!t(S)&&(S=!1,!T())){var e=/ Chrome\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(S=!0,M=r(e[1]))}return S}function a(){return i()&&M}function o(){if(!t(O)&&(O=!1,!i()&&!T()&&/ Safari\/[\.0-9]+/.test(I.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(O=!0,m=r(e[1]))}return O}function u(){return o()&&m}function E(){if(!t(y)){y=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(I.userAgent);null!==e&&(y=!0,p=r(e[1]),p.isNightly=!!e[2])}return y}function s(){return E()&&p}function c(){if(!t(C)){C=!1;var e;"Microsoft Internet Explorer"===I.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==e&&(C=!0,U=r(e[1]))):"Netscape"===I.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==e&&(C=!0,U=r(e[1])))}return C}function _(){return c()&&U}function T(){if(!t(L)){L=!1;var e=/ Edge\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(L=!0,F=r(e[1]))}return L}function R(){return T()&&F}function l(){if(!t(P)){P=!1;var e=/Firefox\/([\.0-9]+)/.exec(I.userAgent); +null!==e&&(P=!0,g=r(e[1]))}return P}function A(){return t(w)||(w=/Windows/i.test(I.appVersion)),w}function f(){return l()&&g}function h(){return t(D)||(D="undefined"!=typeof PointerEvent&&(!t(I.pointerEnabled)||I.pointerEnabled)),D}function N(){if(!t(B)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;B=t(n)&&""!==n,B&&(v=n)}return B}function d(){return N()?v:void 0}var I;I="undefined"!=typeof navigator?navigator:{};var S,M,O,m,y,p,C,U,L,F,P,g,w,D,v,B,x={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:E,webkitVersion:s,isInternetExplorer:c,internetExplorerVersion:_,isEdge:T,edgeVersion:R,isFirefox:l,firefoxVersion:f,isWindows:A,hardwareConcurrency:e(I.hardwareConcurrency,3),supportsPointerEvents:h,supportsImageRenderingPixelated:N,imageRenderingValue:d};return x.supportsFullscreen=function(){return n.supportsFullscreen()},x.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},x.supportsWebWorkers=function(){return"undefined"!=typeof Worker},x}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,i,a){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:a.BYTE,UNSIGNED_BYTE:a.UNSIGNED_BYTE,SHORT:a.SHORT,UNSIGNED_SHORT:a.UNSIGNED_SHORT,INT:a.INT,UNSIGNED_INT:a.UNSIGNED_INT,FLOAT:a.FLOAT,DOUBLE:a.DOUBLE};return o.getSizeInBytes=function(e){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.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},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 Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,i){switch(r=e(r,0),i=e(i,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,i);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,i);case o.SHORT:return new Int16Array(n,r,i);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,i);case o.INT:return new Int32Array(n,r,i);case o.UNSIGNED_INT:return new Uint32Array(n,r,i);case o.FLOAT:return new Float32Array(n,r,i);case o.DOUBLE:return new Float64Array(n,r,i)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},i(o)}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===n.POINTS||e===n.LINES||e===n.LINE_LOOP||e===n.LINE_STRIP||e===n.TRIANGLES||e===n.TRIANGLE_STRIP||e===n.TRIANGLE_FAN}};return e(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,i){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,i.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return a.computeNumberOfVertices=function(e){var n=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var i=e.attributes[r],a=i.values.length/i.componentsPerAttribute;n=a}return n},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(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 r}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/PointGeometry",["./BoundingSphere","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./PrimitiveType"],function(e,t,n,r,i,a,o,u,E){"use strict";function s(t){t=n(t,n.EMPTY_OBJECT),this._positionsTypedArray=t.positionsTypedArray,this._colorsTypedArray=t.colorsTypedArray,this._boundingSphere=e.clone(t.boundingSphere),this._workerName="createPointGeometry"}return s.createGeometry=function(n){var i=n._positionsTypedArray,s=i.byteLength/i.length,c=4===s?t.FLOAT:t.DOUBLE,_=new u;_.position=new o({componentDatatype:c,componentsPerAttribute:3,values:i}),_.color=new o({componentDatatype:t.UNSIGNED_BYTE,componentsPerAttribute:3,values:n._colorsTypedArray,normalize:!0});var T=n._boundingSphere;return r(T)||(T=e.fromVertices(i)),new a({attributes:_,primitiveType:E.POINTS,boundingSphere:T})},s}),define("Workers/createPointGeometry",["../Core/PointGeometry"],function(e){"use strict";return e.createGeometry})}(); \ No newline at end of file diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createPolygonGeometry.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createPolygonGeometry.js index d4de703f..8e03fca8 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createPolygonGeometry.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createPolygonGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -222,10 +222,10 @@ OTHER DEALINGS IN THE SOFTWARE. * */ -!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==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";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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("Core/isArray",["./defined"],function(e){"use strict";var t=Array.isArray;return e(t)||(t=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),t}),define("Core/Check",["./defaultValue","./defined","./DeveloperError","./isArray"],function(e,t,r,n){"use strict";function i(e){return e+" was required but undefined."}function a(e,t,r){return"Expected "+r+" to be typeof "+t+", got "+e}var o={};return o.typeOf={},o.numeric={},o.defined=function(e,n){if(!t(e))throw new r(i(n))},o.numeric.maximum=function(e,t){if(o.typeOf.number(e),o.typeOf.number(t),e>t)throw new r("Expected "+e+" to be at most "+t)},o.numeric.minimum=function(e,t){if(o.typeOf.number(e),o.typeOf.number(t),e<t)throw new r("Expected "+e+" to be at least "+t)},o.typeOf.function=function(e,t){if("function"!=typeof e)throw new r(a(typeof e,"function",t))},o.typeOf.string=function(e,t){if("string"!=typeof e)throw new r(a(typeof e,"string",t))},o.typeOf.number=function(e,t){if("number"!=typeof e)throw new r(a(typeof e,"number",t))},o.typeOf.object=function(e,t){if("object"!=typeof e)throw new r(a(typeof e,"object",t))},o.typeOf.boolean=function(e,t){if("boolean"!=typeof e)throw new r(a(typeof e,"boolean",t))},o}),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^=e<<7&2636928640,e^=e<<15&4022730752,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,r,n){"use strict";var i={};i.EPSILON1=.1,i.EPSILON2=.01,i.EPSILON3=.001,i.EPSILON4=1e-4,i.EPSILON5=1e-5,i.EPSILON6=1e-6,i.EPSILON7=1e-7,i.EPSILON8=1e-8,i.EPSILON9=1e-9,i.EPSILON10=1e-10,i.EPSILON11=1e-11,i.EPSILON12=1e-12,i.EPSILON13=1e-13,i.EPSILON14=1e-14,i.EPSILON15=1e-15,i.EPSILON16=1e-16,i.EPSILON17=1e-17,i.EPSILON18=1e-18,i.EPSILON19=1e-19,i.EPSILON20=1e-20,i.GRAVITATIONALPARAMETER=3986004418e5,i.SOLAR_RADIUS=6955e5,i.LUNAR_RADIUS=1737400,i.SIXTY_FOUR_KILOBYTES=65536,i.sign=function(e){return e>0?1:e<0?-1:0},i.signNotZero=function(e){return e<0?-1:1},i.toSNorm=function(e,r){return r=t(r,255),Math.round((.5*i.clamp(e,-1,1)+.5)*r)},i.fromSNorm=function(e,r){return r=t(r,255),i.clamp(e,0,r)/r*2-1},i.sinh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t-r)},i.cosh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t+r)},i.lerp=function(e,t,r){return(1-r)*e+r*t},i.PI=Math.PI,i.ONE_OVER_PI=1/Math.PI,i.PI_OVER_TWO=.5*Math.PI,i.PI_OVER_THREE=Math.PI/3,i.PI_OVER_FOUR=Math.PI/4,i.PI_OVER_SIX=Math.PI/6,i.THREE_PI_OVER_TWO=3*Math.PI*.5,i.TWO_PI=2*Math.PI,i.ONE_OVER_TWO_PI=1/(2*Math.PI),i.RADIANS_PER_DEGREE=Math.PI/180,i.DEGREES_PER_RADIAN=180/Math.PI,i.RADIANS_PER_ARCSECOND=i.RADIANS_PER_DEGREE/3600,i.toRadians=function(e){return e*i.RADIANS_PER_DEGREE},i.toDegrees=function(e){return e*i.DEGREES_PER_RADIAN},i.convertLongitudeRange=function(e){var t=i.TWO_PI,r=e-Math.floor(e/t)*t;return r<-Math.PI?r+t:r>=Math.PI?r-t:r},i.clampToLatitudeRange=function(e){return i.clamp(e,-1*i.PI_OVER_TWO,i.PI_OVER_TWO)},i.negativePiToPi=function(e){return i.zeroToTwoPi(e+i.PI)-i.PI},i.zeroToTwoPi=function(e){var t=i.mod(e,i.TWO_PI);return Math.abs(t)<i.EPSILON14&&Math.abs(e)>i.EPSILON14?i.TWO_PI:t},i.mod=function(e,t){return(e%t+t)%t},i.equalsEpsilon=function(e,r,n,i){i=t(i,n);var a=Math.abs(e-r);return a<=i||a<=n*Math.max(Math.abs(e),Math.abs(r))};var a=[1];i.factorial=function(e){var t=a.length;if(e>=t)for(var r=a[t-1],n=t;n<=e;n++)a.push(r*n);return a[e]},i.incrementWrap=function(e,r,n){return n=t(n,0),++e,e>r&&(e=n),e},i.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},i.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},i.clamp=function(e,t,r){return e<t?t:e>r?r:e};var o=new e;return i.setRandomNumberSeed=function(t){o=new e(t)},i.nextRandomNumber=function(){return o.random()},i.acosClamped=function(e){return Math.acos(i.clamp(e,-1,1))},i.asinClamped=function(e){return Math.asin(i.clamp(e,-1,1))},i.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},i.logBase=function(e,t){return Math.log(e)/Math.log(t)},i.fog=function(e,t){var r=e*t;return 1-Math.exp(-(r*r))},i}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,i,a){"use strict";function o(e,r,n){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0)}o.fromSpherical=function(e,n){r(n)||(n=new o);var i=e.clock,a=e.cone,u=t(e.magnitude,1),s=u*Math.sin(a);return n.x=s*Math.cos(i),n.y=s*Math.sin(i),n.z=u*Math.cos(a),n},o.fromElements=function(e,t,n,i){return r(i)?(i.x=e,i.y=t,i.z=n,i):new o(e,t,n)},o.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n]=e.z,r},o.unpack=function(e,n,i){return n=t(n,0),r(i)||(i=new o),i.x=e[n++],i.y=e[n++],i.z=e[n],i},o.packArray=function(e,t){var n=e.length;r(t)?t.length=3*n:t=new Array(3*n);for(var i=0;i<n;++i)o.pack(e[i],t,3*i);return t},o.unpackArray=function(e,t){var n=e.length;r(t)?t.length=n/3:t=new Array(n/3);for(var i=0;i<n;i+=3){var a=i/3;t[a]=o.unpack(e,i,t[a])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},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},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},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},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},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},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},o.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r.z=e.z/t.z,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},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},o.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*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},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,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};var s=new o;o.lerp=function(e,t,r,n){return o.multiplyByScalar(t,r,s),n=o.multiplyByScalar(e,1-r,n),o.add(s,n,n)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var r=o.dot(c,l),n=o.magnitude(o.cross(c,l,c));return Math.atan2(n,r)};var f=new o;o.mostOrthogonalAxis=function(e,t){var r=o.normalize(e,f);return o.abs(r,r),t=r.x<=r.y?r.x<=r.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):r.y<=r.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},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,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]},o.equalsEpsilon=function(e,t,n,i){return e===t||r(e)&&r(t)&&a.equalsEpsilon(e.x,t.x,n,i)&&a.equalsEpsilon(e.y,t.y,n,i)&&a.equalsEpsilon(e.z,t.z,n,i)},o.cross=function(e,t,r){var n=e.x,i=e.y,a=e.z,o=t.x,u=t.y,s=t.z,c=i*s-a*u,l=a*o-n*s,f=n*u-i*o;return r.x=c,r.y=l,r.z=f,r},o.fromDegrees=function(e,t,r,n,i){return e=a.toRadians(e),t=a.toRadians(t),o.fromRadians(e,t,r,n,i)};var h=new o,d=new o,p=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,n,i,a,u){i=t(i,0);var s=r(a)?a.radiiSquared:p,c=Math.cos(n);h.x=c*Math.cos(e),h.y=c*Math.sin(e),h.z=Math.sin(n),h=o.normalize(h,h),o.multiplyComponents(s,h,d);var l=Math.sqrt(o.dot(h,d));return d=o.divideByScalar(d,l,d),h=o.multiplyByScalar(h,i,h),r(u)||(u=new o),o.add(d,h,u)},o.fromDegreesArray=function(e,t,n){var i=e.length;r(n)?n.length=i/2:n=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],s=e[a+1],c=a/2;n[c]=o.fromDegrees(u,s,0,t,n[c])}return n},o.fromRadiansArray=function(e,t,n){var i=e.length;r(n)?n.length=i/2:n=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],s=e[a+1],c=a/2;n[c]=o.fromRadians(u,s,0,t,n[c])}return n},o.fromDegreesArrayHeights=function(e,t,n){var i=e.length;r(n)?n.length=i/3:n=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],s=e[a+1],c=e[a+2],l=a/3;n[l]=o.fromDegrees(u,s,c,t,n[l])}return n},o.fromRadiansArrayHeights=function(e,t,n){var i=e.length;r(n)?n.length=i/3:n=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],s=e[a+1],c=e[a+2],l=a/3;n[l]=o.fromRadians(u,s,c,t,n[l])}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,t,r){return o.equalsEpsilon(this,e,t,r)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,r,n){"use strict";function i(r,i,u,s,c){var l=r.x,f=r.y,h=r.z,d=i.x,p=i.y,y=i.z,E=l*l*d*d,m=f*f*p*p,_=h*h*y*y,v=E+m+_,T=Math.sqrt(1/v),R=e.multiplyByScalar(r,T,a);if(v<s)return isFinite(T)?e.clone(R,c):void 0;var A=u.x,g=u.y,S=u.z,N=o;N.x=R.x*A*2,N.y=R.y*g*2,N.z=R.z*S*2;var x,I,O,w,M,P,C,D,L,U,b,F=(1-T)*e.magnitude(r)/(.5*e.magnitude(N)),z=0;do{F-=z,O=1/(1+F*A),w=1/(1+F*g),M=1/(1+F*S),P=O*O,C=w*w,D=M*M,L=P*O,U=C*w,b=D*M,x=E*P+m*C+_*D-1,I=E*L*A+m*U*g+_*b*S;var B=-2*I;z=x/B}while(Math.abs(x)>n.EPSILON12);return t(c)?(c.x=l*O,c.y=f*w,c.z=h*M,c):new e(l*O,f*w,h*M)}var a=new e,o=new e;return i}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,r,n,i,a,o){"use strict";function u(e,r,n){this.longitude=t(e,0),this.latitude=t(r,0),this.height=t(n,0)}u.fromRadians=function(e,n,i,a){return i=t(i,0),r(a)?(a.longitude=e,a.latitude=n,a.height=i,a):new u(e,n,i)},u.fromDegrees=function(e,t,r,n){return e=a.toRadians(e),t=a.toRadians(t),u.fromRadians(e,t,r,n)};var s=new e,c=new e,l=new e,f=new e(1/6378137,1/6378137,1/6356752.314245179),h=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),d=a.EPSILON1;return u.fromCartesian=function(t,n,i){var p=r(n)?n.oneOverRadii:f,y=r(n)?n.oneOverRadiiSquared:h,E=r(n)?n._centerToleranceSquared:d,m=o(t,p,y,E,c);if(r(m)){var _=e.multiplyComponents(m,y,s);_=e.normalize(_,_);var v=e.subtract(t,m,l),T=Math.atan2(_.y,_.x),R=Math.asin(_.z),A=a.sign(e.dot(v,t))*e.magnitude(v);return r(i)?(i.longitude=T,i.latitude=R,i.height=A,i):new u(T,R,A)}},u.clone=function(e,t){if(r(e))return r(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||r(e)&&r(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n},u.ZERO=i(new u(0,0,0)),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,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),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","./scaleToGeodeticSurface"],function(e,t,r,n,i,a,o,u,s){"use strict";function c(t,n,i,a){n=r(n,0),i=r(i,0),a=r(a,0),t._radii=new e(n,i,a),t._radiiSquared=new e(n*n,i*i,a*a),t._radiiToTheFourth=new e(n*n*n*n,i*i*i*i,a*a*a*a),t._oneOverRadii=new e(0===n?0:1/n,0===i?0:1/i,0===a?0:1/a),t._oneOverRadiiSquared=new e(0===n?0:1/(n*n),0===i?0:1/(i*i),0===a?0:1/(a*a)),t._minimumRadius=Math.min(n,i,a),t._maximumRadius=Math.max(n,i,a),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(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,this._sqauredXOverSquaredZ=void 0,c(this,e,t,r)}i(l.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}}}),l.clone=function(t,r){if(n(t)){var i=t._radii;return n(r)?(e.clone(i,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 l(i.x,i.y,i.z)}},l.fromCartesian3=function(e,t){return n(t)||(t=new l),n(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,n,i){return i=r(i,0),e.pack(t._radii,n,i),n},l.unpack=function(t,n,i){n=r(n,0);var a=e.unpack(t,n);return l.fromCartesian3(a,i)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,r){var i=t.longitude,a=t.latitude,o=Math.cos(a),u=o*Math.cos(i),s=o*Math.sin(i),c=Math.sin(a);return n(r)||(r=new e),r.x=u,r.y=s,r.z=c,e.normalize(r,r)},l.prototype.geodeticSurfaceNormal=function(t,r){return n(r)||(r=new e),r=e.multiplyComponents(t,this._oneOverRadiiSquared,r),e.normalize(r,r)};var f=new e,h=new e;l.prototype.cartographicToCartesian=function(t,r){var i=f,a=h;this.geodeticSurfaceNormalCartographic(t,i),e.multiplyComponents(this._radiiSquared,i,a);var o=Math.sqrt(e.dot(i,a));return e.divideByScalar(a,o,a),e.multiplyByScalar(i,t.height,i),n(r)||(r=new e),e.add(a,i,r)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var i=0;i<r;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var d=new e,p=new e,y=new e;return l.prototype.cartesianToCartographic=function(r,i){var a=this.scaleToGeodeticSurface(r,p);if(n(a)){var o=this.geodeticSurfaceNormal(a,d),s=e.subtract(r,a,y),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),f=u.sign(e.dot(s,r))*e.magnitude(s);return n(i)?(i.longitude=c,i.latitude=l,i.height=f,i):new t(c,l,f)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var i=0;i<r;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,r){n(r)||(r=new e);var i=t.x,a=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*u.z);return e.multiplyByScalar(t,s,r)},l.prototype.transformPositionToScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._oneOverRadii,r)},l.prototype.transformPositionFromScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._radii,r)},l.prototype.equals=function(t){return this===t||n(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,i,a){i=r(i,0);var o=this._sqauredXOverSquaredZ;if(n(a)||(a=new e),a.x=0,a.y=0,a.z=t.z*(1-o),!(Math.abs(a.z)>=this._radii.z-i))return a},l}),define("Core/Cartesian2",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,i){"use strict";function a(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){if(t(e))return t(r)?(r.x=e.x,r.y=e.y,r):new a(e.x,e.y)},a.fromCartesian3=a.clone,a.fromCartesian4=a.clone,a.packedLength=2,a.pack=function(t,r,n){return n=e(n,0),r[n++]=t.x,r[n]=t.y,r},a.unpack=function(r,n,i){return n=e(n,0),t(i)||(i=new a),i.x=r[n++],i.y=r[n],i},a.packArray=function(e,r){var n=e.length;t(r)?r.length=2*n:r=new Array(2*n);for(var i=0;i<n;++i)a.pack(e[i],r,2*i);return r},a.unpackArray=function(e,r){var n=e.length;t(r)?r.length=n/2:r=new Array(n/2);for(var i=0;i<n;i+=2){var o=i/2;r[o]=a.unpack(e,i,r[o])}return r},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 o=new a;a.distance=function(e,t){return a.subtract(e,t,o),a.magnitude(o)},a.distanceSquared=function(e,t){return a.subtract(e,t,o),a.magnitudeSquared(o)},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.divideComponents=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),i.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.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]},a.equalsEpsilon=function(e,r,n,a){return e===r||t(e)&&t(r)&&i.equalsEpsilon(e.x,r.x,n,a)&&i.equalsEpsilon(e.y,r.y,n,a)},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,r){return a.equalsEpsilon(this,e,t,r)},a.prototype.toString=function(){return"("+this.x+", "+this.y+")"},a}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,r,n,i,a,o){"use strict";function u(e){this._ellipsoid=r(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return i(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,r){var i=this._semimajorAxis,a=t.longitude*i,o=t.latitude*i,u=t.height;return n(r)?(r.x=a,r.y=o,r.z=u,r):new e(a,o,u)},u.prototype.unproject=function(e,r){var i=this._oneOverSemimajorAxis,a=e.x*i,o=e.y*i,u=e.z;return n(r)?(r.longitude=a,r.latitude=o,r.height=u,r):new t(a,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/Rectangle",["./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,r,n,i,a,o,u){"use strict";function s(e,r,n,i){this.west=t(e,0),this.south=t(r,0),this.east=t(n,0),this.north=t(i,0)}n(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,r,n){return n=t(n,0),r[n++]=e.west,r[n++]=e.south,r[n++]=e.east,r[n]=e.north,r},s.unpack=function(e,n,i){return n=t(n,0),r(i)||(i=new s),i.west=e[n++],i.south=e[n++],i.east=e[n++],i.north=e[n],i},s.computeWidth=function(e){var t=e.east,r=e.west;return t<r&&(t+=u.TWO_PI),t-r},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,n,i,a,o){return e=u.toRadians(t(e,0)),n=u.toRadians(t(n,0)),i=u.toRadians(t(i,0)),a=u.toRadians(t(a,0)),r(o)?(o.west=e,o.south=n,o.east=i,o.north=a,o):new s(e,n,i,a)},s.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE,f=0,h=e.length;f<h;f++){var d=e[f];n=Math.min(n,d.longitude),i=Math.max(i,d.longitude),c=Math.min(c,d.latitude),l=Math.max(l,d.latitude);var p=d.longitude>=0?d.longitude:d.longitude+u.TWO_PI;a=Math.min(a,p),o=Math.max(o,p)}return i-n>o-a&&(n=a,i=o,i>u.PI&&(i-=u.TWO_PI),n>u.PI&&(n-=u.TWO_PI)),r(t)?(t.west=n,t.south=c,t.east=i,t.north=l,t):new s(n,c,i,l)},s.fromCartesianArray=function(e,t,n){for(var i=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=Number.MAX_VALUE,f=-Number.MAX_VALUE,h=0,d=e.length;h<d;h++){var p=t.cartesianToCartographic(e[h]);i=Math.min(i,p.longitude),a=Math.max(a,p.longitude),l=Math.min(l,p.latitude),f=Math.max(f,p.latitude);var y=p.longitude>=0?p.longitude:p.longitude+u.TWO_PI;o=Math.min(o,y),c=Math.max(c,y)}return a-i>c-o&&(i=o,a=c,a>u.PI&&(a-=u.TWO_PI),i>u.PI&&(i-=u.TWO_PI)),r(n)?(n.west=i,n.south=l,n.east=a,n.north=f,n):new s(i,l,a,f)},s.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.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},s.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},s.validate=function(e){},s.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)},s.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)},s.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)},s.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)},s.center=function(t,n){var i=t.east,a=t.west;i<a&&(i+=u.TWO_PI);var o=u.negativePiToPi(.5*(a+i)),s=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=s,n.height=0,n):new e(o,s)},s.intersection=function(e,t,n){var i=e.east,a=e.west,o=t.east,c=t.west;i<a&&o>0?i+=u.TWO_PI:o<c&&i>0&&(o+=u.TWO_PI),i<a&&c<0?c+=u.TWO_PI:o<c&&a<0&&(a+=u.TWO_PI);var l=u.negativePiToPi(Math.max(a,c)),f=u.negativePiToPi(Math.min(i,o));if(!((e.west<e.east||t.west<t.east)&&f<=l)){var h=Math.max(e.south,t.south),d=Math.min(e.north,t.north);if(!(h>=d))return r(n)?(n.west=l,n.south=h,n.east=f,n.north=d,n):new s(l,h,f,d)}},s.simpleIntersection=function(e,t,n){var i=Math.max(e.west,t.west),a=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(a>=u||i>=o))return r(n)?(n.west=i,n.south=a,n.east=o,n.north=u,n):new s(i,a,o,u)},s.union=function(e,t,n){r(n)||(n=new s);var i=e.east,a=e.west,o=t.east,c=t.west;i<a&&o>0?i+=u.TWO_PI:o<c&&i>0&&(o+=u.TWO_PI),i<a&&c<0?c+=u.TWO_PI:o<c&&a<0&&(a+=u.TWO_PI);var l=u.convertLongitudeRange(Math.min(a,c)),f=u.convertLongitudeRange(Math.max(i,o));return n.west=l,n.south=Math.min(e.south,t.south),n.east=f,n.north=Math.max(e.north,t.north),n},s.expand=function(e,t,n){return r(n)||(n=new s),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},s.contains=function(e,t){var r=t.longitude,n=t.latitude,i=e.west,a=e.east;return a<i&&(a+=u.TWO_PI,r<0&&(r+=u.TWO_PI)),(r>i||u.equalsEpsilon(r,i,u.EPSILON14))&&(r<a||u.equalsEpsilon(r,a,u.EPSILON14))&&n>=e.south&&n<=e.north};var c=new e;return s.subsample=function(e,n,i,o){n=t(n,a.WGS84),i=t(i,0),r(o)||(o=[]);var l=0,f=e.north,h=e.south,d=e.east,p=e.west,y=c;y.height=i,y.longitude=p,y.latitude=f,o[l]=n.cartographicToCartesian(y,o[l]),l++,y.longitude=d,o[l]=n.cartographicToCartesian(y,o[l]),l++,y.latitude=h,o[l]=n.cartographicToCartesian(y,o[l]),l++,y.longitude=p,o[l]=n.cartographicToCartesian(y,o[l]),l++,f<0?y.latitude=f:h>0?y.latitude=h:y.latitude=0;for(var E=1;E<8;++E)y.longitude=-Math.PI+E*u.PI_OVER_TWO,s.contains(e,y)&&(o[l]=n.cartographicToCartesian(y,o[l]),l++);return 0===y.latitude&&(y.longitude=p,o[l]=n.cartographicToCartesian(y,o[l]),l++,y.longitude=d,o[l]=n.cartographicToCartesian(y,o[l]),l++),o.length=l,o},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingRectangle",["./Cartesian2","./Cartographic","./defaultValue","./defined","./DeveloperError","./GeographicProjection","./Intersect","./Rectangle"],function(e,t,r,n,i,a,o,u){"use strict";function s(e,t,n,i){this.x=r(e,0),this.y=r(t,0),this.width=r(n,0),this.height=r(i,0)}s.packedLength=4,s.pack=function(e,t,n){return n=r(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.width,t[n]=e.height,t},s.unpack=function(e,t,i){return t=r(t,0),n(i)||(i=new s),i.x=e[t++],i.y=e[t++],i.width=e[t++],i.height=e[t],i},s.fromPoints=function(e,t){if(n(t)||(t=new s),!n(e)||0===e.length)return t.x=0,t.y=0,t.width=0,t.height=0,t;for(var r=e.length,i=e[0].x,a=e[0].y,o=e[0].x,u=e[0].y,c=1;c<r;c++){var l=e[c],f=l.x,h=l.y;i=Math.min(f,i),o=Math.max(f,o),a=Math.min(h,a),u=Math.max(h,u)}return t.x=i,t.y=a,t.width=o-i,t.height=u-a,t};var c=new a,l=new t,f=new t;return s.fromRectangle=function(t,i,a){if(n(a)||(a=new s),!n(t))return a.x=0,a.y=0,a.width=0,a.height=0,a;i=r(i,c);var o=i.project(u.southwest(t,l)),h=i.project(u.northeast(t,f));return e.subtract(h,o,h),a.x=o.x,a.y=o.y,a.width=h.x,a.height=h.y,a},s.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t):new s(e.x,e.y,e.width,e.height)},s.union=function(e,t,r){n(r)||(r=new s);var i=Math.min(e.x,t.x),a=Math.min(e.y,t.y),o=Math.max(e.x+e.width,t.x+t.width),u=Math.max(e.y+e.height,t.y+t.height);return r.x=i,r.y=a,r.width=o-i,r.height=u-a,r},s.expand=function(e,t,r){r=s.clone(e,r);var n=t.x-r.x,i=t.y-r.y;return n>r.width?r.width=n:n<0&&(r.width-=n,r.x=t.x),i>r.height?r.height=i:i<0&&(r.height-=i,r.y=t.y),r},s.intersect=function(e,t){var r=e.x,n=e.y,i=t.x,a=t.y;return r>i+t.width||r+e.width<i||n+e.height<a||n>a+t.height?o.OUTSIDE:o.INTERSECTING},s.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.intersect=function(e){return s.intersect(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,r){this.start=e(t,0),this.stop=e(r,0)}return t}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,i,a,o){"use strict";function u(e,r,n,i,a,o,u,s,c){this[0]=t(e,0),this[1]=t(i,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(o,0),this[8]=t(c,0)}function s(e){for(var t=0,r=0;r<9;++r){var n=e[r];t+=n*n}return Math.sqrt(t)}function c(e){for(var t=0,r=0;r<3;++r){var n=e[u.getElementIndex(p[r],d[r])];t+=2*n*n}return Math.sqrt(t)}function l(e,t){for(var r=o.EPSILON15,n=0,i=1,a=0;a<3;++a){var s=Math.abs(e[u.getElementIndex(p[a],d[a])]);s>n&&(i=a,n=s)}var c=1,l=0,f=d[i],h=p[i];if(Math.abs(e[u.getElementIndex(h,f)])>r){var y,E=e[u.getElementIndex(h,h)],m=e[u.getElementIndex(f,f)],_=e[u.getElementIndex(h,f)],v=(E-m)/2/_;y=v<0?-1/(-v+Math.sqrt(1+v*v)):1/(v+Math.sqrt(1+v*v)),c=1/Math.sqrt(1+y*y),l=y*c}return t=u.clone(u.IDENTITY,t),t[u.getElementIndex(f,f)]=t[u.getElementIndex(h,h)]=c,t[u.getElementIndex(h,f)]=l,t[u.getElementIndex(f,h)]=-l,t}u.packedLength=9,u.pack=function(e,r,n){return 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},u.unpack=function(e,n,i){return n=t(n,0),r(i)||(i=new u),i[0]=e[n++],i[1]=e[n++],i[2]=e[n++],i[3]=e[n++],i[4]=e[n++],i[5]=e[n++],i[6]=e[n++],i[7]=e[n++],i[8]=e[n++],i},u.clone=function(e,t){if(r(e))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):new u(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},u.fromArray=function(e,n,i){return n=t(n,0),r(i)||(i=new u),i[0]=e[n],i[1]=e[n+1],i[2]=e[n+2],i[3]=e[n+3],i[4]=e[n+4],i[5]=e[n+5],i[6]=e[n+6],i[7]=e[n+7],i[8]=e[n+8],i},u.fromColumnMajorArray=function(e,t){return u.clone(e,t)},u.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 u(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},u.fromQuaternion=function(e,t){var n=e.x*e.x,i=e.x*e.y,a=e.x*e.z,o=e.x*e.w,s=e.y*e.y,c=e.y*e.z,l=e.y*e.w,f=e.z*e.z,h=e.z*e.w,d=e.w*e.w,p=n-s-f+d,y=2*(i-h),E=2*(a+l),m=2*(i+h),_=-n+s-f+d,v=2*(c-o),T=2*(a-l),R=2*(c+o),A=-n-s+f+d;return r(t)?(t[0]=p,t[1]=m,t[2]=T, -t[3]=y,t[4]=_,t[5]=R,t[6]=E,t[7]=v,t[8]=A,t):new u(p,y,E,m,_,v,T,R,A)},u.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),i=Math.cos(-e.heading),a=Math.cos(e.roll),o=Math.sin(-e.pitch),s=Math.sin(-e.heading),c=Math.sin(e.roll),l=n*i,f=-a*s+c*o*i,h=c*s+a*o*i,d=n*s,p=a*i+c*o*s,y=-o*a+a*o*s,E=-o,m=c*n,_=a*n;return r(t)?(t[0]=l,t[1]=d,t[2]=E,t[3]=f,t[4]=p,t[5]=m,t[6]=h,t[7]=y,t[8]=_,t):new u(l,f,h,d,p,y,E,m,_)},u.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 u(e.x,0,0,0,e.y,0,0,0,e.z)},u.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 u(e,0,0,0,e,0,0,0,e)},u.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 u(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},u.fromRotationX=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=i,t[6]=0,t[7]=-i,t[8]=n,t):new u(1,0,0,0,n,-i,0,i,n)},u.fromRotationY=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-i,t[3]=0,t[4]=1,t[5]=0,t[6]=i,t[7]=0,t[8]=n,t):new u(n,0,i,0,1,0,-i,0,n)},u.fromRotationZ=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=n,t[1]=i,t[2]=0,t[3]=-i,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new u(n,-i,0,i,n,0,0,0,1)},u.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]]},u.getElementIndex=function(e,t){return 3*e+t},u.getColumn=function(e,t,r){var n=3*t,i=e[n],a=e[n+1],o=e[n+2];return r.x=i,r.y=a,r.z=o,r},u.setColumn=function(e,t,r,n){n=u.clone(e,n);var i=3*t;return n[i]=r.x,n[i+1]=r.y,n[i+2]=r.z,n},u.getRow=function(e,t,r){var n=e[t],i=e[t+3],a=e[t+6];return r.x=n,r.y=i,r.z=a,r},u.setRow=function(e,t,r,n){return n=u.clone(e,n),n[t]=r.x,n[t+3]=r.y,n[t+6]=r.z,n};var f=new e;u.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],f)),r.y=e.magnitude(e.fromElements(t[3],t[4],t[5],f)),r.z=e.magnitude(e.fromElements(t[6],t[7],t[8],f)),r};var h=new e;u.getMaximumScale=function(t){return u.getScale(t,h),e.maximumComponent(h)},u.multiply=function(e,t,r){var n=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],i=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],o=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]=i,r[2]=a,r[3]=o,r[4]=u,r[5]=s,r[6]=c,r[7]=l,r[8]=f,r},u.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},u.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},u.multiplyByVector=function(e,t,r){var n=t.x,i=t.y,a=t.z,o=e[0]*n+e[3]*i+e[6]*a,u=e[1]*n+e[4]*i+e[7]*a,s=e[2]*n+e[5]*i+e[8]*a;return r.x=o,r.y=u,r.z=s,r},u.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},u.multiplyByScale=function(e,t,r){return r[0]=e[0]*t.x,r[1]=e[1]*t.x,r[2]=e[2]*t.x,r[3]=e[3]*t.y,r[4]=e[4]*t.y,r[5]=e[5]*t.y,r[6]=e[6]*t.z,r[7]=e[7]*t.z,r[8]=e[8]*t.z,r},u.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},u.transpose=function(e,t){var r=e[0],n=e[3],i=e[6],a=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=r,t[1]=n,t[2]=i,t[3]=a,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var d=[1,0,0],p=[2,2,1],y=new u,E=new u;return u.computeEigenDecomposition=function(e,t){var n=o.EPSILON20,i=10,a=0,f=0;r(t)||(t={});for(var h=t.unitary=u.clone(u.IDENTITY,t.unitary),d=t.diagonal=u.clone(e,t.diagonal),p=n*s(d);f<i&&c(d)>p;)l(d,y),u.transpose(y,E),u.multiply(d,y,d),u.multiply(E,d,d),u.multiply(h,y,h),++a>2&&(++f,a=0);return t},u.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},u.determinant=function(e){var t=e[0],r=e[3],n=e[6],i=e[1],a=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(a*c-s*o)+i*(s*n-r*c)+u*(r*o-a*n)},u.inverse=function(e,t){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],l=e[7],f=e[8],h=u.determinant(e);t[0]=o*f-l*s,t[1]=l*i-n*f,t[2]=n*s-o*i,t[3]=c*s-a*f,t[4]=r*f-c*i,t[5]=a*i-r*s,t[6]=a*l-c*o,t[7]=c*n-r*l,t[8]=r*o-a*n;var d=1/h;return u.multiplyByScalar(t,d,t)},u.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]},u.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},u.IDENTITY=a(new u(1,0,0,0,1,0,0,0,1)),u.ZERO=a(new u(0,0,0,0,0,0,0,0,0)),u.COLUMN0ROW0=0,u.COLUMN0ROW1=1,u.COLUMN0ROW2=2,u.COLUMN1ROW0=3,u.COLUMN1ROW1=4,u.COLUMN1ROW2=5,u.COLUMN2ROW0=6,u.COLUMN2ROW1=7,u.COLUMN2ROW2=8,n(u.prototype,{length:{get:function(){return u.packedLength}}}),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},u}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,i){"use strict";function a(t,r,n,i){this.x=e(t,0),this.y=e(r,0),this.z=e(n,0),this.w=e(i,0)}a.fromElements=function(e,r,n,i,o){return t(o)?(o.x=e,o.y=r,o.z=n,o.w=i,o):new a(e,r,n,i)},a.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 a(e.red,e.green,e.blue,e.alpha)},a.clone=function(e,r){if(t(e))return t(r)?(r.x=e.x,r.y=e.y,r.z=e.z,r.w=e.w,r):new a(e.x,e.y,e.z,e.w)},a.packedLength=4,a.pack=function(t,r,n){return n=e(n,0),r[n++]=t.x,r[n++]=t.y,r[n++]=t.z,r[n]=t.w,r},a.unpack=function(r,n,i){return n=e(n,0),t(i)||(i=new a),i.x=r[n++],i.y=r[n++],i.z=r[n++],i.w=r[n],i},a.packArray=function(e,r){var n=e.length;t(r)?r.length=4*n:r=new Array(4*n);for(var i=0;i<n;++i)a.pack(e[i],r,4*i);return r},a.unpackArray=function(e,r){var n=e.length;t(r)?r.length=n/4:r=new Array(n/4);for(var i=0;i<n;i+=4){var o=i/4;r[o]=a.unpack(e,i,r[o])}return r},a.fromArray=a.unpack,a.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},a.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},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.w=Math.min(e.w,t.w),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.w=Math.max(e.w,t.w),r},a.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},a.magnitude=function(e){return Math.sqrt(a.magnitudeSquared(e))};var o=new a;a.distance=function(e,t){return a.subtract(e,t,o),a.magnitude(o)},a.distanceSquared=function(e,t){return a.subtract(e,t,o),a.magnitudeSquared(o)},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.w=e.w/r,t},a.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},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.w=e.w*t.w,r},a.divideComponents=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},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.w=e.w+t.w,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.w=e.w-t.w,r},a.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},a.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},a.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,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.w=Math.abs(e.w),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;return a.mostOrthogonalAxis=function(e,t){var r=a.normalize(e,s);return a.abs(r,r),t=r.x<=r.y?r.x<=r.z?r.x<=r.w?a.clone(a.UNIT_X,t):a.clone(a.UNIT_W,t):r.z<=r.w?a.clone(a.UNIT_Z,t):a.clone(a.UNIT_W,t):r.y<=r.z?r.y<=r.w?a.clone(a.UNIT_Y,t):a.clone(a.UNIT_W,t):r.z<=r.w?a.clone(a.UNIT_Z,t):a.clone(a.UNIT_W,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&&e.w===r.w},a.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]&&e.w===t[r+3]},a.equalsEpsilon=function(e,r,n,a){return e===r||t(e)&&t(r)&&i.equalsEpsilon(e.x,r.x,n,a)&&i.equalsEpsilon(e.y,r.y,n,a)&&i.equalsEpsilon(e.z,r.z,n,a)&&i.equalsEpsilon(e.w,r.w,n,a)},a.ZERO=n(new a(0,0,0,0)),a.UNIT_X=n(new a(1,0,0,0)),a.UNIT_Y=n(new a(0,1,0,0)),a.UNIT_Z=n(new a(0,0,1,0)),a.UNIT_W=n(new a(0,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,r){return a.equalsEpsilon(this,e,t,r)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},a}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,r,n,i,a,o,u,s,c){"use strict";function l(e,t,n,i,a,o,u,s,c,l,f,h,d,p,y,E){this[0]=r(e,0),this[1]=r(a,0),this[2]=r(c,0),this[3]=r(d,0),this[4]=r(t,0),this[5]=r(o,0),this[6]=r(l,0),this[7]=r(p,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(f,0),this[11]=r(y,0),this[12]=r(i,0),this[13]=r(s,0),this[14]=r(h,0),this[15]=r(E,0)}l.packedLength=16,l.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},l.unpack=function(e,t,i){return t=r(t,0),n(i)||(i=new l),i[0]=e[t++],i[1]=e[t++],i[2]=e[t++],i[3]=e[t++],i[4]=e[t++],i[5]=e[t++],i[6]=e[t++],i[7]=e[t++],i[8]=e[t++],i[9]=e[t++],i[10]=e[t++],i[11]=e[t++],i[12]=e[t++],i[13]=e[t++],i[14]=e[t++],i[15]=e[t],i},l.clone=function(e,t){if(n(e))return n(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 l(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])},l.fromArray=l.unpack,l.fromColumnMajorArray=function(e,t){return l.clone(e,t)},l.fromRowMajorArray=function(e,t){return n(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 l(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])},l.fromRotationTranslation=function(t,i,a){return i=r(i,e.ZERO),n(a)?(a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=0,a[4]=t[3],a[5]=t[4],a[6]=t[5],a[7]=0,a[8]=t[6],a[9]=t[7],a[10]=t[8],a[11]=0,a[12]=i.x,a[13]=i.y,a[14]=i.z,a[15]=1,a):new l(t[0],t[3],t[6],i.x,t[1],t[4],t[7],i.y,t[2],t[5],t[8],i.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(e,t,r,i){n(i)||(i=new l);var a=r.x,o=r.y,u=r.z,s=t.x*t.x,c=t.x*t.y,f=t.x*t.z,h=t.x*t.w,d=t.y*t.y,p=t.y*t.z,y=t.y*t.w,E=t.z*t.z,m=t.z*t.w,_=t.w*t.w,v=s-d-E+_,T=2*(c-m),R=2*(f+y),A=2*(c+m),g=-s+d-E+_,S=2*(p-h),N=2*(f-y),x=2*(p+h),I=-s-d+E+_;return i[0]=v*a,i[1]=A*a,i[2]=N*a,i[3]=0,i[4]=T*o,i[5]=g*o,i[6]=x*o,i[7]=0,i[8]=R*u,i[9]=S*u,i[10]=I*u,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i},l.fromTranslationRotationScale=function(e,t){return l.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},l.fromTranslation=function(e,t){return l.fromRotationTranslation(s.IDENTITY,e,t)},l.fromScale=function(e,t){return n(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 l(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},l.fromUniformScale=function(e,t){return n(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 l(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var f=new e,h=new e,d=new e;l.fromCamera=function(t,r){var i=t.position,a=t.direction,o=t.up;e.normalize(a,f),e.normalize(e.cross(f,o,h),h),e.normalize(e.cross(h,f,d),d);var u=h.x,s=h.y,c=h.z,p=f.x,y=f.y,E=f.z,m=d.x,_=d.y,v=d.z,T=i.x,R=i.y,A=i.z,g=u*-T+s*-R+c*-A,S=m*-T+_*-R+v*-A,N=p*T+y*R+E*A;return n(r)?(r[0]=u,r[1]=m,r[2]=-p,r[3]=0,r[4]=s,r[5]=_,r[6]=-y,r[7]=0,r[8]=c,r[9]=v,r[10]=-E,r[11]=0,r[12]=g,r[13]=S,r[14]=N,r[15]=1,r):new l(u,s,c,g,m,_,v,S,-p,-y,-E,N,0,0,0,1)},l.computePerspectiveFieldOfView=function(e,t,r,n,i){var a=Math.tan(.5*e),o=1/a,u=o/t,s=(n+r)/(r-n),c=2*n*r/(r-n);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=o,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=s,i[11]=-1,i[12]=0,i[13]=0,i[14]=c,i[15]=0,i},l.computeOrthographicOffCenter=function(e,t,r,n,i,a,o){var u=1/(t-e),s=1/(n-r),c=1/(a-i),l=-(t+e)*u,f=-(n+r)*s,h=-(a+i)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=f,o[14]=h,o[15]=1,o},l.computePerspectiveOffCenter=function(e,t,r,n,i,a,o){var u=2*i/(t-e),s=2*i/(n-r),c=(t+e)/(t-e),l=(n+r)/(n-r),f=-(a+i)/(a-i),h=-1,d=-2*a*i/(a-i);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=f,o[11]=h,o[12]=0,o[13]=0,o[14]=d,o[15]=0,o},l.computeInfinitePerspectiveOffCenter=function(e,t,r,n,i,a){var o=2*i/(t-e),u=2*i/(n-r),s=(t+e)/(t-e),c=(n+r)/(n-r),l=-1,f=-1,h=-2*i;return a[0]=o,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]=h,a[15]=0,a},l.computeViewportTransformation=function(e,t,n,i){e=r(e,r.EMPTY_OBJECT);var a=r(e.x,0),o=r(e.y,0),u=r(e.width,0),s=r(e.height,0);t=r(t,0),n=r(n,1);var c=.5*u,l=.5*s,f=.5*(n-t),h=c,d=l,p=f,y=a+c,E=o+l,m=t+f,_=1;return i[0]=h,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=d,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=p,i[11]=0,i[12]=y,i[13]=E,i[14]=m,i[15]=_,i},l.computeView=function(t,r,n,i,a){return a[0]=i.x,a[1]=n.x,a[2]=-r.x,a[3]=0,a[4]=i.y,a[5]=n.y,a[6]=-r.y,a[7]=0,a[8]=i.z,a[9]=n.z,a[10]=-r.z,a[11]=0,a[12]=-e.dot(i,t),a[13]=-e.dot(n,t),a[14]=e.dot(r,t),a[15]=1,a},l.toArray=function(e,t){return n(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]]},l.getElementIndex=function(e,t){return 4*e+t},l.getColumn=function(e,t,r){var n=4*t,i=e[n],a=e[n+1],o=e[n+2],u=e[n+3];return r.x=i,r.y=a,r.z=o,r.w=u,r},l.setColumn=function(e,t,r,n){n=l.clone(e,n);var i=4*t;return n[i]=r.x,n[i+1]=r.y,n[i+2]=r.z,n[i+3]=r.w,n},l.setTranslation=function(e,t,r){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]=t.x,r[13]=t.y,r[14]=t.z,r[15]=e[15],r},l.getRow=function(e,t,r){var n=e[t],i=e[t+4],a=e[t+8],o=e[t+12];return r.x=n,r.y=i,r.z=a,r.w=o,r},l.setRow=function(e,t,r,n){return n=l.clone(e,n),n[t]=r.x,n[t+4]=r.y,n[t+8]=r.z,n[t+12]=r.w,n};var p=new e;l.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],p)),r.y=e.magnitude(e.fromElements(t[4],t[5],t[6],p)),r.z=e.magnitude(e.fromElements(t[8],t[9],t[10],p)),r};var y=new e;l.getMaximumScale=function(t){return l.getScale(t,y),e.maximumComponent(y)},l.multiply=function(e,t,r){var n=e[0],i=e[1],a=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],f=e[8],h=e[9],d=e[10],p=e[11],y=e[12],E=e[13],m=e[14],_=e[15],v=t[0],T=t[1],R=t[2],A=t[3],g=t[4],S=t[5],N=t[6],x=t[7],I=t[8],O=t[9],w=t[10],M=t[11],P=t[12],C=t[13],D=t[14],L=t[15],U=n*v+u*T+f*R+y*A,b=i*v+s*T+h*R+E*A,F=a*v+c*T+d*R+m*A,z=o*v+l*T+p*R+_*A,B=n*g+u*S+f*N+y*x,G=i*g+s*S+h*N+E*x,q=a*g+c*S+d*N+m*x,W=o*g+l*S+p*N+_*x,H=n*I+u*O+f*w+y*M,V=i*I+s*O+h*w+E*M,X=a*I+c*O+d*w+m*M,Y=o*I+l*O+p*w+_*M,k=n*P+u*C+f*D+y*L,Z=i*P+s*C+h*D+E*L,j=a*P+c*C+d*D+m*L,K=o*P+l*C+p*D+_*L;return r[0]=U,r[1]=b,r[2]=F,r[3]=z,r[4]=B,r[5]=G,r[6]=q,r[7]=W,r[8]=H,r[9]=V,r[10]=X,r[11]=Y,r[12]=k,r[13]=Z,r[14]=j,r[15]=K,r},l.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},l.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},l.multiplyTransformation=function(e,t,r){var n=e[0],i=e[1],a=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=e[12],d=e[13],p=e[14],y=t[0],E=t[1],m=t[2],_=t[4],v=t[5],T=t[6],R=t[8],A=t[9],g=t[10],S=t[12],N=t[13],x=t[14],I=n*y+o*E+c*m,O=i*y+u*E+l*m,w=a*y+s*E+f*m,M=n*_+o*v+c*T,P=i*_+u*v+l*T,C=a*_+s*v+f*T,D=n*R+o*A+c*g,L=i*R+u*A+l*g,U=a*R+s*A+f*g,b=n*S+o*N+c*x+h,F=i*S+u*N+l*x+d,z=a*S+s*N+f*x+p;return r[0]=I,r[1]=O,r[2]=w,r[3]=0,r[4]=M,r[5]=P,r[6]=C,r[7]=0,r[8]=D,r[9]=L,r[10]=U,r[11]=0,r[12]=b,r[13]=F,r[14]=z,r[15]=1,r},l.multiplyByMatrix3=function(e,t,r){var n=e[0],i=e[1],a=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=t[0],d=t[1],p=t[2],y=t[3],E=t[4],m=t[5],_=t[6],v=t[7],T=t[8],R=n*h+o*d+c*p,A=i*h+u*d+l*p,g=a*h+s*d+f*p,S=n*y+o*E+c*m,N=i*y+u*E+l*m,x=a*y+s*E+f*m,I=n*_+o*v+c*T,O=i*_+u*v+l*T,w=a*_+s*v+f*T;return r[0]=R,r[1]=A,r[2]=g,r[3]=0,r[4]=S,r[5]=N,r[6]=x,r[7]=0,r[8]=I,r[9]=O,r[10]=w,r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r},l.multiplyByTranslation=function(e,t,r){var n=t.x,i=t.y,a=t.z,o=n*e[0]+i*e[4]+a*e[8]+e[12],u=n*e[1]+i*e[5]+a*e[9]+e[13],s=n*e[2]+i*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]=o,r[13]=u,r[14]=s,r[15]=e[15],r};var E=new e;l.multiplyByUniformScale=function(e,t,r){return E.x=t,E.y=t,E.z=t,l.multiplyByScale(e,E,r)},l.multiplyByScale=function(e,t,r){var n=t.x,i=t.y,a=t.z;return 1===n&&1===i&&1===a?l.clone(e,r):(r[0]=n*e[0],r[1]=n*e[1],r[2]=n*e[2],r[3]=0,r[4]=i*e[4],r[5]=i*e[5],r[6]=i*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)},l.multiplyByVector=function(e,t,r){var n=t.x,i=t.y,a=t.z,o=t.w,u=e[0]*n+e[4]*i+e[8]*a+e[12]*o,s=e[1]*n+e[5]*i+e[9]*a+e[13]*o,c=e[2]*n+e[6]*i+e[10]*a+e[14]*o,l=e[3]*n+e[7]*i+e[11]*a+e[15]*o;return r.x=u,r.y=s,r.z=c,r.w=l,r},l.multiplyByPointAsVector=function(e,t,r){var n=t.x,i=t.y,a=t.z,o=e[0]*n+e[4]*i+e[8]*a,u=e[1]*n+e[5]*i+e[9]*a,s=e[2]*n+e[6]*i+e[10]*a;return r.x=o,r.y=u,r.z=s,r},l.multiplyByPoint=function(e,t,r){var n=t.x,i=t.y,a=t.z,o=e[0]*n+e[4]*i+e[8]*a+e[12],u=e[1]*n+e[5]*i+e[9]*a+e[13],s=e[2]*n+e[6]*i+e[10]*a+e[14];return r.x=o,r.y=u,r.z=s,r},l.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},l.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},l.transpose=function(e,t){var r=e[1],n=e[2],i=e[3],a=e[6],o=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]=i,t[13]=o,t[14]=u,t[15]=e[15],t},l.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},l.equals=function(e,t){return e===t||n(e)&&n(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},l.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r&&Math.abs(e[9]-t[9])<=r&&Math.abs(e[10]-t[10])<=r&&Math.abs(e[11]-t[11])<=r&&Math.abs(e[12]-t[12])<=r&&Math.abs(e[13]-t[13])<=r&&Math.abs(e[14]-t[14])<=r&&Math.abs(e[15]-t[15])<=r},l.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},l.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};var m=new s,_=new s,v=new t,T=new t(0,0,0,1);return l.inverse=function(e,r){if(s.equalsEpsilon(l.getRotation(e,m),_,u.EPSILON7)&&t.equals(l.getRow(e,3,v),T))return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=0,r[11]=0,r[12]=-e[12],r[13]=-e[13],r[14]=-e[14],r[15]=1,r;var n=e[0],i=e[4],a=e[8],o=e[12],f=e[1],h=e[5],d=e[9],p=e[13],y=e[2],E=e[6],R=e[10],A=e[14],g=e[3],S=e[7],N=e[11],x=e[15],I=R*x,O=A*N,w=E*x,M=A*S,P=E*N,C=R*S,D=y*x,L=A*g,U=y*N,b=R*g,F=y*S,z=E*g,B=I*h+M*d+P*p-(O*h+w*d+C*p),G=O*f+D*d+b*p-(I*f+L*d+U*p),q=w*f+L*h+F*p-(M*f+D*h+z*p),W=C*f+U*h+z*d-(P*f+b*h+F*d),H=O*i+w*a+C*o-(I*i+M*a+P*o),V=I*n+L*a+U*o-(O*n+D*a+b*o),X=M*n+D*i+z*o-(w*n+L*i+F*o),Y=P*n+b*i+F*a-(C*n+U*i+z*a);I=a*p,O=o*d,w=i*p,M=o*h,P=i*d,C=a*h,D=n*p,L=o*f,U=n*d,b=a*f,F=n*h,z=i*f;var k=I*S+M*N+P*x-(O*S+w*N+C*x),Z=O*g+D*N+b*x-(I*g+L*N+U*x),j=w*g+L*S+F*x-(M*g+D*S+z*x),K=C*g+U*S+z*N-(P*g+b*S+F*N),J=w*R+C*A+O*E-(P*A+I*E+M*R),Q=U*A+I*y+L*R-(D*R+b*A+O*y),$=D*E+z*A+M*y-(F*A+w*y+L*E),ee=F*R+P*y+b*E-(U*E+z*R+C*y),te=n*B+i*G+a*q+o*W;if(Math.abs(te)<u.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return te=1/te,r[0]=B*te,r[1]=G*te,r[2]=q*te,r[3]=W*te,r[4]=H*te,r[5]=V*te,r[6]=X*te,r[7]=Y*te,r[8]=k*te,r[9]=Z*te,r[10]=j*te,r[11]=K*te,r[12]=J*te,r[13]=Q*te,r[14]=$*te,r[15]=ee*te,r},l.inverseTransformation=function(e,t){var r=e[0],n=e[1],i=e[2],a=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],f=e[12],h=e[13],d=e[14],p=-r*f-n*h-i*d,y=-a*f-o*h-u*d,E=-s*f-c*h-l*d;return t[0]=r,t[1]=a,t[2]=s,t[3]=0,t[4]=n,t[5]=o,t[6]=c,t[7]=0,t[8]=i,t[9]=u,t[10]=l,t[11]=0,t[12]=p,t[13]=y,t[14]=E,t[15]=1,t},l.IDENTITY=o(new l(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),l.ZERO=o(new l(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN0ROW3=3,l.COLUMN1ROW0=4,l.COLUMN1ROW1=5,l.COLUMN1ROW2=6,l.COLUMN1ROW3=7,l.COLUMN2ROW0=8,l.COLUMN2ROW1=9,l.COLUMN2ROW2=10,l.COLUMN2ROW3=11,l.COLUMN3ROW0=12,l.COLUMN3ROW1=13,l.COLUMN3ROW2=14,l.COLUMN3ROW3=15,i(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]&&e[9]===t[r+9]&&e[10]===t[r+10]&&e[11]===t[r+11]&&e[12]===t[r+12]&&e[13]===t[r+13]&&e[14]===t[r+14]&&e[15]===t[r+15]},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.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]+")"},l}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,r,n,i,a,o,u,s,c,l,f){"use strict";function h(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var d=new e,p=new e,y=new e,E=new e,m=new e,_=new e,v=new e,T=new e,R=new e,A=new e,g=new e,S=new e;h.fromPoints=function(t,r){if(n(r)||(r=new h),!n(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;for(var i=e.clone(t[0],v),a=e.clone(i,d),o=e.clone(i,p),u=e.clone(i,y),s=e.clone(i,E),c=e.clone(i,m),l=e.clone(i,_),f=t.length,N=1;N<f;N++){e.clone(t[N],i);var x=i.x,I=i.y,O=i.z;x<a.x&&e.clone(i,a),x>s.x&&e.clone(i,s),I<o.y&&e.clone(i,o),I>c.y&&e.clone(i,c),O<u.z&&e.clone(i,u),O>l.z&&e.clone(i,l)}var w=e.magnitudeSquared(e.subtract(s,a,T)),M=e.magnitudeSquared(e.subtract(c,o,T)),P=e.magnitudeSquared(e.subtract(l,u,T)),C=a,D=s,L=w;M>L&&(L=M,C=o,D=c),P>L&&(L=P,C=u,D=l);var U=R;U.x=.5*(C.x+D.x),U.y=.5*(C.y+D.y),U.z=.5*(C.z+D.z);var b=e.magnitudeSquared(e.subtract(D,U,T)),F=Math.sqrt(b),z=A;z.x=a.x,z.y=o.y,z.z=u.z;var B=g;B.x=s.x,B.y=c.y,B.z=l.z;var G=e.multiplyByScalar(e.add(z,B,T),.5,S),q=0;for(N=0;N<f;N++){e.clone(t[N],i);var W=e.magnitude(e.subtract(i,G,T));W>q&&(q=W);var H=e.magnitudeSquared(e.subtract(i,U,T));if(H>b){var V=Math.sqrt(H);F=.5*(F+V),b=F*F;var X=V-F;U.x=(F*U.x+X*i.x)/V,U.y=(F*U.y+X*i.y)/V,U.z=(F*U.z+X*i.z)/V}}return F<q?(e.clone(U,r.center),r.radius=F):(e.clone(G,r.center),r.radius=q),r};var N=new o,x=new e,I=new e,O=new t,w=new t;h.fromRectangle2D=function(e,t,r){return h.fromRectangleWithHeights2D(e,t,0,0,r)},h.fromRectangleWithHeights2D=function(t,i,a,o,u){if(n(u)||(u=new h),!n(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;i=r(i,N),f.southwest(t,O),O.height=a,f.northeast(t,w),w.height=o;var s=i.project(O,x),c=i.project(w,I),l=c.x-s.x,d=c.y-s.y,p=c.z-s.z;u.radius=.5*Math.sqrt(l*l+d*d+p*p);var y=u.center;return y.x=s.x+.5*l,y.y=s.y+.5*d,y.z=s.z+.5*p,u};var M=[];h.fromRectangle3D=function(e,t,i,o){t=r(t,a.WGS84),i=r(i,0);var u;return n(e)&&(u=f.subsample(e,t,i,M)),h.fromPoints(u,o)},h.fromVertices=function(t,i,a,o){if(n(o)||(o=new h),!n(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;i=r(i,e.ZERO),a=r(a,3);var u=v;u.x=t[0]+i.x,u.y=t[1]+i.y,u.z=t[2]+i.z;for(var s=e.clone(u,d),c=e.clone(u,p),l=e.clone(u,y),f=e.clone(u,E),N=e.clone(u,m),x=e.clone(u,_),I=t.length,O=0;O<I;O+=a){var w=t[O]+i.x,M=t[O+1]+i.y,P=t[O+2]+i.z;u.x=w,u.y=M,u.z=P,w<s.x&&e.clone(u,s),w>f.x&&e.clone(u,f),M<c.y&&e.clone(u,c),M>N.y&&e.clone(u,N),P<l.z&&e.clone(u,l),P>x.z&&e.clone(u,x)}var C=e.magnitudeSquared(e.subtract(f,s,T)),D=e.magnitudeSquared(e.subtract(N,c,T)),L=e.magnitudeSquared(e.subtract(x,l,T)),U=s,b=f,F=C;D>F&&(F=D,U=c,b=N),L>F&&(F=L,U=l,b=x);var z=R;z.x=.5*(U.x+b.x),z.y=.5*(U.y+b.y),z.z=.5*(U.z+b.z);var B=e.magnitudeSquared(e.subtract(b,z,T)),G=Math.sqrt(B),q=A;q.x=s.x,q.y=c.y,q.z=l.z;var W=g;W.x=f.x,W.y=N.y,W.z=x.z;var H=e.multiplyByScalar(e.add(q,W,T),.5,S),V=0;for(O=0;O<I;O+=a){u.x=t[O]+i.x,u.y=t[O+1]+i.y,u.z=t[O+2]+i.z;var X=e.magnitude(e.subtract(u,H,T));X>V&&(V=X);var Y=e.magnitudeSquared(e.subtract(u,z,T));if(Y>B){var k=Math.sqrt(Y);G=.5*(G+k),B=G*G;var Z=k-G;z.x=(G*z.x+Z*u.x)/k,z.y=(G*z.y+Z*u.y)/k,z.z=(G*z.z+Z*u.z)/k}}return G<V?(e.clone(z,o.center),o.radius=G):(e.clone(H,o.center),o.radius=V),o},h.fromEncodedCartesianVertices=function(t,r,i){if(n(i)||(i=new h),!n(t)||!n(r)||t.length!==r.length||0===t.length)return i.center=e.clone(e.ZERO,i.center),i.radius=0,i;var a=v;a.x=t[0]+r[0],a.y=t[1]+r[1],a.z=t[2]+r[2];for(var o=e.clone(a,d),u=e.clone(a,p),s=e.clone(a,y),c=e.clone(a,E),l=e.clone(a,m),f=e.clone(a,_),N=t.length,x=0;x<N;x+=3){var I=t[x]+r[x],O=t[x+1]+r[x+1],w=t[x+2]+r[x+2];a.x=I,a.y=O,a.z=w,I<o.x&&e.clone(a,o),I>c.x&&e.clone(a,c),O<u.y&&e.clone(a,u),O>l.y&&e.clone(a,l),w<s.z&&e.clone(a,s),w>f.z&&e.clone(a,f)}var M=e.magnitudeSquared(e.subtract(c,o,T)),P=e.magnitudeSquared(e.subtract(l,u,T)),C=e.magnitudeSquared(e.subtract(f,s,T)),D=o,L=c,U=M;P>U&&(U=P,D=u,L=l),C>U&&(U=C,D=s,L=f);var b=R;b.x=.5*(D.x+L.x),b.y=.5*(D.y+L.y),b.z=.5*(D.z+L.z);var F=e.magnitudeSquared(e.subtract(L,b,T)),z=Math.sqrt(F),B=A;B.x=o.x,B.y=u.y,B.z=s.z;var G=g;G.x=c.x,G.y=l.y,G.z=f.z;var q=e.multiplyByScalar(e.add(B,G,T),.5,S),W=0;for(x=0;x<N;x+=3){a.x=t[x]+r[x],a.y=t[x+1]+r[x+1],a.z=t[x+2]+r[x+2];var H=e.magnitude(e.subtract(a,q,T));H>W&&(W=H);var V=e.magnitudeSquared(e.subtract(a,b,T));if(V>F){var X=Math.sqrt(V);z=.5*(z+X),F=z*z;var Y=X-z;b.x=(z*b.x+Y*a.x)/X,b.y=(z*b.y+Y*a.y)/X,b.z=(z*b.z+Y*a.z)/X}}return z<W?(e.clone(b,i.center),i.radius=z):(e.clone(q,i.center),i.radius=W),i},h.fromCornerPoints=function(t,r,i){n(i)||(i=new h);var a=i.center;return e.add(t,r,a),e.multiplyByScalar(a,.5,a),i.radius=e.distance(a,r),i},h.fromEllipsoid=function(t,r){return n(r)||(r=new h),e.clone(e.ZERO,r.center),r.radius=t.maximumRadius,r};var P=new e;h.fromBoundingSpheres=function(t,r){if(n(r)||(r=new h),!n(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var i=t.length;if(1===i)return h.clone(t[0],r);if(2===i)return h.union(t[0],t[1],r);for(var a=[],o=0;o<i;o++)a.push(t[o].center);r=h.fromPoints(a,r);var u=r.center,s=r.radius;for(o=0;o<i;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,P)+c.radius)}return r.radius=s,r};var C=new e,D=new e,L=new e;h.fromOrientedBoundingBox=function(t,r){n(r)||(r=new h);var i=t.halfAxes,a=c.getColumn(i,0,C),o=c.getColumn(i,1,D),u=c.getColumn(i,2,L),s=e.magnitude(a),l=e.magnitude(o),f=e.magnitude(u);return r.center=e.clone(t.center,r.center),r.radius=Math.max(s,l,f),r},h.clone=function(t,r){if(n(t))return n(r)?(r.center=e.clone(t.center,r.center),r.radius=t.radius,r):new h(t.center,t.radius)},h.packedLength=4,h.pack=function(e,t,n){n=r(n,0);var i=e.center;return t[n++]=i.x,t[n++]=i.y,t[n++]=i.z,t[n]=e.radius,t},h.unpack=function(e,t,i){t=r(t,0),n(i)||(i=new h);var a=i.center;return a.x=e[t++],a.y=e[t++],a.z=e[t++],i.radius=e[t],i};var U=new e,b=new e;h.union=function(t,r,i){n(i)||(i=new h);var a=t.center,o=t.radius,u=r.center,s=r.radius,c=e.subtract(u,a,U),l=e.magnitude(c);if(o>=l+s)return t.clone(i),i;if(s>=l+o)return r.clone(i),i;var f=.5*(o+l+s),d=e.multiplyByScalar(c,(-o+f)/l,b);return e.add(d,a,d),e.clone(d,i.center),i.radius=f,i};var F=new e;h.expand=function(t,r,n){n=h.clone(t,n);var i=e.magnitude(e.subtract(r,n.center,F));return i>n.radius&&(n.radius=i),n},h.intersectPlane=function(t,r){var n=t.center,i=t.radius,a=r.normal,o=e.dot(a,n)+r.distance;return o<-i?u.OUTSIDE:o<i?u.INTERSECTING:u.INSIDE},h.transform=function(e,t,r){return n(r)||(r=new h),r.center=l.multiplyByPoint(t,e.center,r.center),r.radius=l.getMaximumScale(t)*e.radius,r};var z=new e;h.distanceSquaredTo=function(t,r){var n=e.subtract(t.center,r,z);return e.magnitudeSquared(n)-t.radius*t.radius},h.transformWithoutScale=function(e,t,r){return n(r)||(r=new h),r.center=l.multiplyByPoint(t,e.center,r.center),r.radius=e.radius,r};var B=new e;h.computePlaneDistances=function(t,r,i,a){n(a)||(a=new s);var o=e.subtract(t.center,r,B),u=e.dot(i,o);return a.start=u-t.radius,a.stop=u+t.radius,a};for(var G=new e,q=new e,W=new e,H=new e,V=new e,X=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e; -var Z=new o;return h.projectTo2D=function(t,n,i){n=r(n,Z);var a=n.ellipsoid,o=t.center,u=t.radius,s=a.geodeticSurfaceNormal(o,G),c=e.cross(e.UNIT_Z,s,q);e.normalize(c,c);var l=e.cross(s,c,W);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var f=e.negate(l,V),d=e.negate(c,H),p=Y,y=p[0];e.add(s,l,y),e.add(y,c,y),y=p[1],e.add(s,l,y),e.add(y,d,y),y=p[2],e.add(s,f,y),e.add(y,d,y),y=p[3],e.add(s,f,y),e.add(y,c,y),e.negate(s,s),y=p[4],e.add(s,l,y),e.add(y,c,y),y=p[5],e.add(s,l,y),e.add(y,d,y),y=p[6],e.add(s,f,y),e.add(y,d,y),y=p[7],e.add(s,f,y),e.add(y,c,y);for(var E=p.length,m=0;m<E;++m){var _=p[m];e.add(o,_,_);var v=a.cartesianToCartographic(_,X);n.project(v,_)}i=h.fromPoints(p,i),o=i.center;var T=o.x,R=o.y,A=o.z;return o.x=A,o.y=T,o.z=R,i},h.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},h.equals=function(t,r){return t===r||n(t)&&n(r)&&e.equals(t.center,r.center)&&t.radius===r.radius},h.prototype.intersectPlane=function(e){return h.intersectPlane(this,e)},h.prototype.distanceSquaredTo=function(e){return h.distanceSquaredTo(this,e)},h.prototype.computePlaneDistances=function(e,t,r){return h.computePlaneDistances(this,e,t,r)},h.prototype.isOccluded=function(e){return h.isOccluded(this,e)},h.prototype.equals=function(e){return h.equals(this,e)},h.prototype.clone=function(e){return h.clone(this,e)},h}),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},i={};return t(i,{element:{get:function(){if(i.supportsFullscreen())return document[n.fullscreenElement]}},changeEventName:{get:function(){if(i.supportsFullscreen())return n.fullscreenchange}},errorEventName:{get:function(){if(i.supportsFullscreen())return n.fullscreenerror}},enabled:{get:function(){if(i.supportsFullscreen())return document[n.fullscreenEnabled]}},fullscreen:{get:function(){if(i.supportsFullscreen())return null!==i.element}}}),i.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 i,a=["webkit","moz","o","ms","khtml"],o=0,u=a.length;o<u;++o){var s=a[o];i=s+"RequestFullscreen","function"==typeof t[i]?(n.requestFullscreen=i,r=!0):(i=s+"RequestFullScreen","function"==typeof t[i]&&(n.requestFullscreen=i,r=!0)),i=s+"ExitFullscreen","function"==typeof document[i]?n.exitFullscreen=i:(i=s+"CancelFullScreen","function"==typeof document[i]&&(n.exitFullscreen=i)),i=s+"FullscreenEnabled",void 0!==document[i]?n.fullscreenEnabled=i:(i=s+"FullScreenEnabled",void 0!==document[i]&&(n.fullscreenEnabled=i)),i=s+"FullscreenElement",void 0!==document[i]?n.fullscreenElement=i:(i=s+"FullScreenElement",void 0!==document[i]&&(n.fullscreenElement=i)),i=s+"fullscreenchange",void 0!==document["on"+i]&&("ms"===s&&(i="MSFullscreenChange"),n.fullscreenchange=i),i=s+"fullscreenerror",void 0!==document["on"+i]&&("ms"===s&&(i="MSFullscreenError"),n.fullscreenerror=i)}return r},i.requestFullscreen=function(e,t){i.supportsFullscreen()&&e[n.requestFullscreen]({vrDisplay:t})},i.exitFullscreen=function(){i.supportsFullscreen()&&document[n.exitFullscreen]()},i}),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;r<n;++r)t[r]=parseInt(t[r],10);return t}function i(){if(!t(R)&&(R=!1,!h())){var e=/ Chrome\/([\.0-9]+)/.exec(T.userAgent);null!==e&&(R=!0,A=n(e[1]))}return R}function a(){return i()&&A}function o(){if(!t(g)&&(g=!1,!i()&&!h()&&/ Safari\/[\.0-9]+/.test(T.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(T.userAgent);null!==e&&(g=!0,S=n(e[1]))}return g}function u(){return o()&&S}function s(){if(!t(N)){N=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(T.userAgent);null!==e&&(N=!0,x=n(e[1]),x.isNightly=!!e[2])}return N}function c(){return s()&&x}function l(){if(!t(I)){I=!1;var e;"Microsoft Internet Explorer"===T.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(T.userAgent),null!==e&&(I=!0,O=n(e[1]))):"Netscape"===T.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(T.userAgent),null!==e&&(I=!0,O=n(e[1])))}return I}function f(){return l()&&O}function h(){if(!t(w)){w=!1;var e=/ Edge\/([\.0-9]+)/.exec(T.userAgent);null!==e&&(w=!0,M=n(e[1]))}return w}function d(){return h()&&M}function p(){if(!t(P)){P=!1;var e=/Firefox\/([\.0-9]+)/.exec(T.userAgent);null!==e&&(P=!0,C=n(e[1]))}return P}function y(){return t(D)||(D=/Windows/i.test(T.appVersion)),D}function E(){return p()&&C}function m(){return t(L)||(L="undefined"!=typeof PointerEvent&&(!t(T.pointerEnabled)||T.pointerEnabled)),L}function _(){if(!t(b)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var r=e.style.imageRendering;b=t(r)&&""!==r,b&&(U=r)}return b}function v(){return _()?U:void 0}var T;T="undefined"!=typeof navigator?navigator:{};var R,A,g,S,N,x,I,O,w,M,P,C,D,L,U,b,F={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isEdge:h,edgeVersion:d,isFirefox:p,firefoxVersion:E,isWindows:y,hardwareConcurrency:e(T.hardwareConcurrency,3),supportsPointerEvents:m,supportsImageRenderingPixelated:_,imageRenderingValue:v};return F.supportsFullscreen=function(){return r.supportsFullscreen()},F.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},F.supportsWebWorkers=function(){return"undefined"!=typeof Worker},F}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,r,n,i,a){"use strict";if(!n.supportsTypedArrays())return{};var o={BYTE:a.BYTE,UNSIGNED_BYTE:a.UNSIGNED_BYTE,SHORT:a.SHORT,UNSIGNED_SHORT:a.UNSIGNED_SHORT,INT:a.INT,UNSIGNED_INT:a.UNSIGNED_INT,FLOAT:a.FLOAT,DOUBLE:a.DOUBLE};return o.getSizeInBytes=function(e){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.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},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 Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,r,n,i){switch(n=e(n,0),i=e(i,(r.byteLength-n)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(r,n,i);case o.UNSIGNED_BYTE:return new Uint8Array(r,n,i);case o.SHORT:return new Int16Array(r,n,i);case o.UNSIGNED_SHORT:return new Uint16Array(r,n,i);case o.INT:return new Int32Array(r,n,i);case o.UNSIGNED_INT:return new Uint32Array(r,n,i);case o.FLOAT:return new Float32Array(r,n,i);case o.DOUBLE:return new Float64Array(r,n,i)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},i(o)}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Intersect"],function(e,t,r,n,i){"use strict";function a(n,i,a){this.minimum=e.clone(t(n,e.ZERO)),this.maximum=e.clone(t(i,e.ZERO)),r(a)?a=e.clone(a):(a=e.add(this.minimum,this.maximum,new e),e.multiplyByScalar(a,.5,a)),this.center=a}a.fromPoints=function(t,n){if(r(n)||(n=new a),!r(t)||0===t.length)return n.minimum=e.clone(e.ZERO,n.minimum),n.maximum=e.clone(e.ZERO,n.maximum),n.center=e.clone(e.ZERO,n.center),n;for(var i=t[0].x,o=t[0].y,u=t[0].z,s=t[0].x,c=t[0].y,l=t[0].z,f=t.length,h=1;h<f;h++){var d=t[h],p=d.x,y=d.y,E=d.z;i=Math.min(p,i),s=Math.max(p,s),o=Math.min(y,o),c=Math.max(y,c),u=Math.min(E,u),l=Math.max(E,l)}var m=n.minimum;m.x=i,m.y=o,m.z=u;var _=n.maximum;_.x=s,_.y=c,_.z=l;var v=e.add(m,_,n.center);return e.multiplyByScalar(v,.5,v),n},a.clone=function(t,n){if(r(t))return r(n)?(n.minimum=e.clone(t.minimum,n.minimum),n.maximum=e.clone(t.maximum,n.maximum),n.center=e.clone(t.center,n.center),n):new a(t.minimum,t.maximum)},a.equals=function(t,n){return t===n||r(t)&&r(n)&&e.equals(t.center,n.center)&&e.equals(t.minimum,n.minimum)&&e.equals(t.maximum,n.maximum)};var o=new e;return a.intersectPlane=function(t,r){o=e.subtract(t.maximum,t.minimum,o);var n=e.multiplyByScalar(o,.5,o),a=r.normal,u=n.x*Math.abs(a.x)+n.y*Math.abs(a.y)+n.z*Math.abs(a.z),s=e.dot(t.center,a)+r.distance;return s-u>0?i.INSIDE:s+u<0?i.OUTSIDE:i.INTERSECTING},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.intersectPlane=function(e){return a.intersectPlane(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function r(e,r,n){var i=e+r;return t.sign(e)!==t.sign(r)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(r)))<n?0:i}var n={};return n.computeDiscriminant=function(e,t,r){var n=t*t-4*e*r;return n},n.computeRealRoots=function(e,n,i){var a;if(0===e)return 0===n?[]:[-i/n];if(0===n){if(0===i)return[0,0];var o=Math.abs(i),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(a=-i/e,a<0)return[];var s=Math.sqrt(a);return[-s,s]}if(0===i)return a=-n/e,a<0?[a,0]:[0,a];var c=n*n,l=4*e*i,f=r(c,-l,t.EPSILON14);if(f<0)return[];var h=-.5*r(n,t.sign(n)*Math.sqrt(f),t.EPSILON14);return n>0?[h/e,i/h]:[i/h,h/e]},n}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function r(e,t,r,n){var i,a,o=e,u=t/3,s=r/3,c=n,l=o*s,f=u*c,h=u*u,d=s*s,p=o*s-h,y=o*c-u*s,E=u*c-d,m=4*p*E-y*y;if(m<0){var _,v,T;h*f>=l*d?(_=o,v=p,T=-2*u*p+o*y):(_=c,v=E,T=-c*y+2*s*E);var R=T<0?-1:1,A=-R*Math.abs(_)*Math.sqrt(-m);a=-T+A;var g=a/2,S=g<0?-Math.pow(-g,1/3):Math.pow(g,1/3),N=a===A?-S:-v/S;return i=v<=0?S+N:-T/(S*S+N*N+v),h*f>=l*d?[(i-u)/o]:[-c/(i+s)]}var x=p,I=-2*u*p+o*y,O=E,w=-c*y+2*s*E,M=Math.sqrt(m),P=Math.sqrt(3)/2,C=Math.abs(Math.atan2(o*M,-I)/3);i=2*Math.sqrt(-x);var D=Math.cos(C);a=i*D;var L=i*(-D/2-P*Math.sin(C)),U=a+L>2*u?a-u:L-u,b=o,F=U/b;C=Math.abs(Math.atan2(c*M,-w)/3),i=2*Math.sqrt(-O),D=Math.cos(C),a=i*D,L=i*(-D/2-P*Math.sin(C));var z=-c,B=a+L<2*s?a+s:L+s,G=z/B,q=b*B,W=-U*B-b*z,H=U*z,V=(s*W-u*H)/(-u*W+s*q);return F<=V?F<=G?V<=G?[F,V,G]:[F,G,V]:[G,F,V]:F<=G?[V,F,G]:V<=G?[V,G,F]:[G,V,F]}var n={};return n.computeDiscriminant=function(e,t,r,n){var i=e*e,a=t*t,o=r*r,u=n*n,s=18*e*t*r*n+a*o-27*i*u-4*(e*o*r+a*t*n);return s},n.computeRealRoots=function(e,n,i,a){var o,u;if(0===e)return t.computeRealRoots(n,i,a);if(0===n){if(0===i){if(0===a)return[0,0,0];u=-a/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===a?(o=t.computeRealRoots(e,0,i),0===o.Length?[0]:[o[0],0,o[1]]):r(e,0,i,a)}return 0===i?0===a?(u=-n/e,u<0?[u,0,0]:[0,0,u]):r(e,n,0,a):0===a?(o=t.computeRealRoots(e,n,i),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):r(e,n,i,a)},n}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,r,n){"use strict";function i(t,i,a,o){var u=t*t,s=i-3*u/8,c=a-i*t/2+u*t/8,l=o-a*t/4+i*u/16-3*u*u/256,f=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(f.length>0){var h=-t/4,d=f[f.length-1];if(Math.abs(d)<r.EPSILON14){var p=n.computeRealRoots(1,s,l);if(2===p.length){var y,E=p[0],m=p[1];if(E>=0&&m>=0){var _=Math.sqrt(E),v=Math.sqrt(m);return[h-v,h-_,h+_,h+v]}if(E>=0&&m<0)return y=Math.sqrt(E),[h-y,h+y];if(E<0&&m>=0)return y=Math.sqrt(m),[h-y,h+y]}return[]}if(d>0){var T=Math.sqrt(d),R=(s+d-c/T)/2,A=(s+d+c/T)/2,g=n.computeRealRoots(1,T,R),S=n.computeRealRoots(1,-T,A);return 0!==g.length?(g[0]+=h,g[1]+=h,0!==S.length?(S[0]+=h,S[1]+=h,g[1]<=S[0]?[g[0],g[1],S[0],S[1]]:S[1]<=g[0]?[S[0],S[1],g[0],g[1]]:g[0]>=S[0]&&g[1]<=S[1]?[S[0],g[0],g[1],S[1]]:S[0]>=g[0]&&S[1]<=g[1]?[g[0],S[0],S[1],g[1]]:g[0]>S[0]&&g[0]<S[1]?[S[0],g[0],S[1],g[1]]:[g[0],S[0],g[1],S[1]]):g):0!==S.length?(S[0]+=h,S[1]+=h,S):[]}}return[]}function a(t,i,a,o){var u=a*a,s=i*i,c=t*t,l=-2*i,f=a*t+s-4*o,h=c*o-a*i*t+u,d=e.computeRealRoots(1,l,f,h);if(d.length>0){var p,y,E=d[0],m=i-E,_=m*m,v=t/2,T=m/2,R=_-4*o,A=_+4*Math.abs(o),g=c-4*E,S=c+4*Math.abs(E);if(E<0||R*S<g*A){var N=Math.sqrt(g);p=N/2,y=0===N?0:(t*T-a)/N}else{var x=Math.sqrt(R);p=0===x?0:(t*T-a)/x,y=x/2}var I,O;0===v&&0===p?(I=0,O=0):r.sign(v)===r.sign(p)?(I=v+p,O=E/I):(O=v-p,I=E/O);var w,M;0===T&&0===y?(w=0,M=0):r.sign(T)===r.sign(y)?(w=T+y,M=o/w):(M=T-y,w=o/M);var P=n.computeRealRoots(1,I,w),C=n.computeRealRoots(1,O,M);if(0!==P.length)return 0!==C.length?P[1]<=C[0]?[P[0],P[1],C[0],C[1]]:C[1]<=P[0]?[C[0],C[1],P[0],P[1]]:P[0]>=C[0]&&P[1]<=C[1]?[C[0],P[0],P[1],C[1]]:C[0]>=P[0]&&C[1]<=P[1]?[P[0],C[0],C[1],P[1]]:P[0]>C[0]&&P[0]<C[1]?[C[0],P[0],C[1],P[1]]:[P[0],C[0],P[1],C[1]]:P;if(0!==C.length)return C}return[]}var o={};return o.computeDiscriminant=function(e,t,r,n,i){var a=e*e,o=a*e,u=t*t,s=u*t,c=r*r,l=c*r,f=n*n,h=f*n,d=i*i,p=d*i,y=u*c*f-4*s*h-4*e*l*f+18*e*t*r*h-27*a*f*f+256*o*p+i*(18*s*r*n-4*u*l+16*e*c*c-80*e*t*c*n-6*e*u*f+144*a*r*f)+d*(144*e*u*r-27*u*u-128*a*c-192*a*t*n);return y},o.computeRealRoots=function(t,n,o,u,s){if(Math.abs(t)<r.EPSILON15)return e.computeRealRoots(n,o,u,s);var c=n/t,l=o/t,f=u/t,h=s/t,d=c<0?1:0;switch(d+=l<0?d+1:d,d+=f<0?d+1:d,d+=h<0?d+1:d){case 0:return i(c,l,f,h);case 1:return a(c,l,f,h);case 2:return a(c,l,f,h);case 3:return i(c,l,f,h);case 4:return i(c,l,f,h);case 5:return a(c,l,f,h);case 6:return i(c,l,f,h);case 7:return i(c,l,f,h);case 8:return a(c,l,f,h);case 9:return i(c,l,f,h);case 10:return i(c,l,f,h);case 11:return a(c,l,f,h);case 12:return i(c,l,f,h);case 13:return i(c,l,f,h);case 14:return i(c,l,f,h);case 15:return i(c,l,f,h);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function i(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 i.getPoint=function(t,n,i){return r(i)||(i=new e),i=e.multiplyByScalar(t.direction,n,i),e.add(t.origin,i,i)},i}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,r,n,i,a,o,u,s,c){"use strict";function l(e,t,r,n){var i=t*t-4*e*r;if(!(i<0)){if(i>0){var a=1/(2*e),o=Math.sqrt(i),u=(-t+o)*a,s=(-t-o)*a;return u<s?(n.root0=u,n.root1=s):(n.root0=s,n.root1=u),n}var c=-t/(2*e);if(0!==c)return n.root0=n.root1=c,n}}function f(t,r,i){n(i)||(i={});var a=t.origin,o=t.direction,u=r.center,s=r.radius*r.radius,c=e.subtract(a,u,m),f=e.dot(o,o),h=2*e.dot(o,c),d=e.magnitudeSquared(c)-s,p=l(f,h,d,R);if(n(p))return i.start=p.root0,i.stop=p.root1,i}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,i,c){var l,f=i*i,d=c*c,p=(t[o.COLUMN1ROW1]-t[o.COLUMN2ROW2])*d,y=c*(i*h(t[o.COLUMN1ROW0],t[o.COLUMN0ROW1],a.EPSILON15)+r.y),E=t[o.COLUMN0ROW0]*f+t[o.COLUMN2ROW2]*d+i*r.x+n,m=d*h(t[o.COLUMN2ROW1],t[o.COLUMN1ROW2],a.EPSILON15),_=c*(i*h(t[o.COLUMN2ROW0],t[o.COLUMN0ROW2])+r.z),v=[];if(0===_&&0===m){if(l=u.computeRealRoots(p,y,E),0===l.length)return v;var T=l[0],R=Math.sqrt(Math.max(1-T*T,0));if(v.push(new e(i,c*T,c*-R)),v.push(new e(i,c*T,c*R)),2===l.length){var A=l[1],g=Math.sqrt(Math.max(1-A*A,0));v.push(new e(i,c*A,c*-g)),v.push(new e(i,c*A,c*g))}return v}var S=_*_,N=m*m,x=p*p,I=_*m,O=x+N,w=2*(y*p+I),M=2*E*p+y*y-N+S,P=2*(E*y-I),C=E*E-S;if(0===O&&0===w&&0===M&&0===P)return v;l=s.computeRealRoots(O,w,M,P,C);var D=l.length;if(0===D)return v;for(var L=0;L<D;++L){var U,b=l[L],F=b*b,z=Math.max(1-F,0),B=Math.sqrt(z);U=a.sign(p)===a.sign(E)?h(p*F+E,y*b,a.EPSILON12):a.sign(E)===a.sign(y*b)?h(p*F,y*b+E,a.EPSILON12):h(p*F+y*b,E,a.EPSILON12);var G=h(m*b,_,a.EPSILON15),q=U*G;q<0?v.push(new e(i,c*b,c*B)):q>0?v.push(new e(i,c*b,c*-B)):0!==B?(v.push(new e(i,c*b,c*-B)),v.push(new e(i,c*b,c*B)),++L):v.push(new e(i,c*b,c*B))}return v}var p={};p.rayPlane=function(t,r,i){n(i)||(i=new e);var o=t.origin,u=t.direction,s=r.normal,c=e.dot(s,u);if(!(Math.abs(c)<a.EPSILON15)){var l=(-r.distance-e.dot(s,o))/c;if(!(l<0))return i=e.multiplyByScalar(u,l,i),e.add(o,i,i)}};var y=new e,E=new e,m=new e,_=new e,v=new e;p.rayTriangleParametric=function(t,n,i,o,u){u=r(u,!1);var s,c,l,f,h,d=t.origin,p=t.direction,T=e.subtract(i,n,y),R=e.subtract(o,n,E),A=e.cross(p,R,m),g=e.dot(T,A);if(u){if(g<a.EPSILON6)return;if(s=e.subtract(d,n,_),l=e.dot(s,A),l<0||l>g)return;if(c=e.cross(s,T,v),f=e.dot(p,c),f<0||l+f>g)return;h=e.dot(R,c)/g}else{if(Math.abs(g)<a.EPSILON6)return;var S=1/g;if(s=e.subtract(d,n,_),l=e.dot(s,A)*S,l<0||l>1)return;if(c=e.cross(s,T,v),f=e.dot(p,c)*S,f<0||l+f>1)return;h=e.dot(R,c)*S}return h},p.rayTriangle=function(t,r,i,a,o,u){var s=p.rayTriangleParametric(t,r,i,a,o);if(n(s)&&!(s<0))return n(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var T=new c;p.lineSegmentTriangle=function(t,r,i,a,o,u,s){var c=T;e.clone(t,c.origin),e.subtract(r,t,c.direction),e.normalize(c.direction,c.direction);var l=p.rayTriangleParametric(c,i,a,o,u);if(!(!n(l)||l<0||l>e.distance(t,r)))return n(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var R={root0:0,root1:0};p.raySphere=function(e,t,r){if(r=f(e,t,r),n(r)&&!(r.stop<0))return r.start=Math.max(r.start,0),r};var A=new c;p.lineSegmentSphere=function(t,r,i,a){var o=A;e.clone(t,o.origin);var u=e.subtract(r,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),a=f(o,i,a),!(!n(a)||a.stop<0||a.start>s))return a.start=Math.max(a.start,0),a.stop=Math.min(a.stop,s),a};var g=new e,S=new e;p.rayEllipsoid=function(t,r){var n,i,a,o,u,s=r.oneOverRadii,c=e.multiplyComponents(s,t.origin,g),l=e.multiplyComponents(s,t.direction,S),f=e.magnitudeSquared(c),h=e.dot(c,l); -if(f>1){if(h>=0)return;var d=h*h;if(n=f-1,i=e.magnitudeSquared(l),a=i*n,d<a)return;if(d>a){o=h*h-a,u=-h+Math.sqrt(o);var p=u/i,y=n/u;return p<y?{start:p,stop:y}:{start:y,stop:p}}var E=Math.sqrt(n/i);return{start:E,stop:E}}return f<1?(n=f-1,i=e.magnitudeSquared(l),a=i*n,o=h*h-a,u=-h+Math.sqrt(o),{start:0,stop:u/i}):h<0?(i=e.magnitudeSquared(l),{start:0,stop:-h/i}):void 0};var N=new e,x=new e,I=new e,O=new e,w=new e,M=new o,P=new o,C=new o,D=new o,L=new o,U=new o,b=new o,F=new e,z=new e,B=new t;p.grazingAltitudeLocation=function(t,r){var i=t.origin,u=t.direction;if(!e.equals(i,e.ZERO)){var s=r.geodeticSurfaceNormal(i,N);if(e.dot(u,s)>=0)return i}var c=n(this.rayEllipsoid(t,r)),l=r.transformPositionToScaledSpace(u,N),f=e.normalize(l,l),h=e.mostOrthogonalAxis(l,O),p=e.normalize(e.cross(h,f,x),x),y=e.normalize(e.cross(f,p,I),I),E=M;E[0]=f.x,E[1]=f.y,E[2]=f.z,E[3]=p.x,E[4]=p.y,E[5]=p.z,E[6]=y.x,E[7]=y.y,E[8]=y.z;var m=o.transpose(E,P),_=o.fromScale(r.radii,C),v=o.fromScale(r.oneOverRadii,D),T=L;T[0]=0,T[1]=-u.z,T[2]=u.y,T[3]=u.z,T[4]=0,T[5]=-u.x,T[6]=-u.y,T[7]=u.x,T[8]=0;var R,A,g=o.multiply(o.multiply(m,v,U),T,U),S=o.multiply(o.multiply(g,_,b),E,b),G=o.multiplyByVector(g,i,w),q=d(S,e.negate(G,N),0,0,1),W=q.length;if(W>0){for(var H=e.clone(e.ZERO,z),V=Number.NEGATIVE_INFINITY,X=0;X<W;++X){R=o.multiplyByVector(_,o.multiplyByVector(E,q[X],F),F);var Y=e.normalize(e.subtract(R,i,O),O),k=e.dot(Y,u);k>V&&(V=k,H=e.clone(R,H))}var Z=r.cartesianToCartographic(H,B);return V=a.clamp(V,0,1),A=e.magnitude(e.subtract(H,i,O))*Math.sqrt(1-V*V),A=c?-A:A,Z.height=A,r.cartographicToCartesian(Z,new e)}};var G=new e;return p.lineSegmentPlane=function(t,r,i,o){n(o)||(o=new e);var u=e.subtract(r,t,G),s=i.normal,c=e.dot(s,u);if(!(Math.abs(c)<a.EPSILON6)){var l=e.dot(s,t),f=-(i.distance+l)/c;if(!(f<0||f>1))return e.multiplyByScalar(u,f,o),e.add(t,o,o),o}},p.trianglePlaneIntersection=function(t,r,n,i){var a=i.normal,o=i.distance,u=e.dot(a,t)+o<0,s=e.dot(a,r)+o<0,c=e.dot(a,n)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var f,h;if(1!==l&&2!==l||(f=new e,h=new e),1===l){if(u)return p.lineSegmentPlane(t,r,i,f),p.lineSegmentPlane(t,n,i,h),{positions:[t,r,n,f,h],indices:[0,3,4,1,2,4,1,4,3]};if(s)return p.lineSegmentPlane(r,n,i,f),p.lineSegmentPlane(r,t,i,h),{positions:[t,r,n,f,h],indices:[1,3,4,2,0,4,2,4,3]};if(c)return p.lineSegmentPlane(n,t,i,f),p.lineSegmentPlane(n,r,i,h),{positions:[t,r,n,f,h],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return p.lineSegmentPlane(r,t,i,f),p.lineSegmentPlane(n,t,i,h),{positions:[t,r,n,f,h],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return p.lineSegmentPlane(n,r,i,f),p.lineSegmentPlane(t,r,i,h),{positions:[t,r,n,f,h],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return p.lineSegmentPlane(t,n,i,f),p.lineSegmentPlane(r,n,i,h),{positions:[t,r,n,f,h],indices:[0,1,4,0,4,3,2,3,4]}}},p}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,r,n){"use strict";function i(t,r){this.normal=e.clone(t),this.distance=r}i.fromPointNormal=function(r,n,a){var o=-e.dot(n,r);return t(a)?(e.clone(n,a.normal),a.distance=o,a):new i(n,o)};var a=new e;return i.fromCartesian4=function(r,n){var o=e.fromCartesian4(r,a),u=r.w;return t(n)?(e.clone(o,n.normal),n.distance=u,n):new i(o,u)},i.getPointDistance=function(t,r){return e.dot(t.normal,r)+t.distance},i.ORIGIN_XY_PLANE=n(new i(e.UNIT_Z,0)),i.ORIGIN_YZ_PLANE=n(new i(e.UNIT_X,0)),i.ORIGIN_ZX_PLANE=n(new i(e.UNIT_Y,0)),i}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,r,n,i){return t(e).then(r,n,i)}function t(e){var t,r;return e instanceof n?t=e:u(e)?(r=o(),e.then(function(e){r.resolve(e)},function(e){r.reject(e)},function(e){r.progress(e)}),t=r.promise):t=i(e),t}function r(t){return e(t,a)}function n(e){this.then=e}function i(e){var r=new n(function(r){try{return t(r?r(e):e)}catch(e){return a(e)}});return r}function a(e){var r=new n(function(r,n){try{return n?t(n(e)):a(e)}catch(e){return a(e)}});return r}function o(){function e(e,t,r){return h(e,t,r)}function r(e){return p(e)}function i(e){return p(a(e))}function u(e){return d(e)}var s,c,l,f,h,d,p;return c=new n(e),s={then:e,resolve:r,reject:i,progress:u,promise:c,resolver:{resolve:r,reject:i,progress:u}},l=[],f=[],h=function(e,t,r){var n,i;return n=o(),i="function"==typeof r?function(e){try{n.progress(r(e))}catch(e){n.progress(e)}}:function(e){n.progress(e)},l.push(function(r){r.then(e,t).then(n.resolve,n.reject,i)}),f.push(i),n.promise},d=function(e){return y(f,e),e},p=function(e){return e=t(e),h=e.then,p=t,d=m,y(l,e),f=l=R,e},s}function u(e){return e&&"function"==typeof e.then}function s(t,r,n,i,a){return E(2,arguments),e(t,function(t){function u(e){y(e)}function s(e){p(e)}var c,l,f,h,d,p,y,E,_,v;if(_=t.length>>>0,c=Math.max(0,Math.min(r,_)),f=[],l=_-c+1,h=[],d=o(),c)for(E=d.progress,y=function(e){h.push(e),--l||(p=y=m,d.reject(h))},p=function(e){f.push(e),--c||(p=y=m,d.resolve(f))},v=0;v<_;++v)v in t&&e(t[v],s,u,E);else d.resolve(f);return d.then(n,i,a)})}function c(e,t,r,n){function i(e){return t?t(e[0]):e[0]}return s(e,1,i,r,n)}function l(e,t,r,n){return E(1,arguments),h(e,_).then(t,r,n)}function f(){return h(arguments,_)}function h(t,r){return e(t,function(t){var n,i,a,u,s,c;if(a=i=t.length>>>0,n=[],c=o(),a)for(u=function(t,i){e(t,r).then(function(e){n[i]=e,--a||c.resolve(n)},c.reject)},s=0;s<i;s++)s in t?u(t[s],s):--a;else c.resolve(n);return c.promise})}function d(t,r){var n=T.call(arguments,1);return e(t,function(t){var i;return i=t.length,n[0]=function(t,n,a){return e(t,function(t){return e(n,function(e){return r(t,e,a,i)})})},v.apply(t,n)})}function p(t,r,n){var i=arguments.length>2;return e(t,function(e){return e=i?n:e,r.resolve(e),e},function(e){return r.reject(e),a(e)},r.progress)}function y(e,t){for(var r,n=0;r=e[n++];)r(t)}function E(e,t){for(var r,n=t.length;n>e;)if(r=t[--n],null!=r&&"function"!=typeof r)throw new Error("arg "+n+" must be a function")}function m(){}function _(e){return e}var v,T,R;return e.defer=o,e.resolve=t,e.reject=r,e.join=f,e.all=l,e.map=h,e.reduce=d,e.any=c,e.some=s,e.chain=p,e.isPromise=u,n.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(R,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return l(t,function(t){return e.apply(R,t)})})}},T=[].slice,v=[].reduce||function(e){var t,r,n,i,a;if(a=0,t=Object(this),i=t.length>>>0,r=arguments,r.length<=1)for(;;){if(a in t){n=t[a++];break}if(++a>=i)throw new TypeError}else n=r[1];for(;a<i;++a)a in t&&(n=e(n,t[a],a,t));return n},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(r,n){t(i[r])||(i[r]=!0,console.log(e(n,r)))}var i={};return n.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.",n}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,r){"use strict";function n(e,t){r(e,t)}return n}),define("Core/binarySearch",["./defined","./DeveloperError"],function(e,t){"use strict";function r(e,t,r){for(var n,i,a=0,o=e.length-1;a<=o;)if(n=~~((a+o)/2),i=r(e[n],t),i<0)a=n+1;else{if(!(i>0))return n;o=n-1}return~(o+1)}return r}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,r,n,i){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=r,this.yPoleOffset=n,this.ut1MinusUtc=i}return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,r=0,n=t[r++],i=function(e,t,r,n){r||(r=" ");var i=e.length>=t?"":Array(1+t-e.length>>>0).join(r);return n?e+i:i+e},a=function(e,t,r,n,a,o){var u=n-e.length;return u>0&&(e=r||!a?i(e,n,o,r):e.slice(0,t.length)+i("",u,"0",!0)+e.slice(t.length)),e},o=function(e,t,r,n,o,u,s){var c=e>>>0;return r=r&&c&&{2:"0b",8:"0",16:"0x"}[t]||"",e=r+i(c.toString(t),u||0,"0",!1),a(e,r,n,o,s)},u=function(e,t,r,n,i,o){return null!=n&&(e=e.slice(0,n)),a(e,"",t,r,i,o)},s=function(e,n,s,c,l,f,h){var d,p,y,E,m;if("%%"==e)return"%";for(var _=!1,v="",T=!1,R=!1,A=" ",g=s.length,S=0;s&&S<g;S++)switch(s.charAt(S)){case" ":v=" ";break;case"+":v="+";break;case"-":_=!0;break;case"'":A=s.charAt(S+1);break;case"0":T=!0;break;case"#":R=!0}if(c=c?"*"==c?+t[r++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,c<0&&(c=-c,_=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(f=f?"*"==f?+t[r++]:"*"==f.charAt(0)?+t[f.slice(1,-1)]:+f:"fFeE".indexOf(h)>-1?6:"d"==h?0:void 0,m=n?t[n.slice(0,-1)]:t[r++],h){case"s":return u(String(m),_,c,f,T,A);case"c":return u(String.fromCharCode(+m),_,c,f,T);case"b":return o(m,2,R,_,c,f,T);case"o":return o(m,8,R,_,c,f,T);case"x":return o(m,16,R,_,c,f,T);case"X":return o(m,16,R,_,c,f,T).toUpperCase();case"u":return o(m,10,R,_,c,f,T);case"i":case"d":return d=+m||0,d=Math.round(d-d%1),p=d<0?"-":v,m=p+i(String(Math.abs(d)),f,"0",!1),a(m,p,_,c,T);case"e":case"E":case"f":case"F":case"g":case"G":return d=+m,p=d<0?"-":v,y=["toExponential","toFixed","toPrecision"]["efg".indexOf(h.toLowerCase())],E=["toString","toUpperCase"]["eEfFgG".indexOf(h)%2],m=p+Math.abs(d)[y](f),a(m,p,_,c,T)[E]();default:return e}};return n.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,r,n,i,a,o,u){this.year=e,this.month=t,this.day=r,this.hour=n,this.minute=i,this.second=a,this.millisecond=o,this.isLeapSecond=u}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e(t)}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,r,n,i,a,o,u,s,c){"use strict";function l(e,t){return y.compare(e.julianDate,t.julianDate)}function f(e){v.julianDate=e;var r=y.leapSeconds,n=t(r,v,l);n<0&&(n=~n),n>=r.length&&(n=r.length-1);var i=r[n].offset;if(n>0){var a=y.secondsDifference(r[n].julianDate,e);a>i&&(n--,i=r[n].offset)}y.addSeconds(e,i,e)}function h(e,r){v.julianDate=e;var n=y.leapSeconds,i=t(n,v,l);if(i<0&&(i=~i),0===i)return y.addSeconds(e,-n[0].offset,r);if(i>=n.length)return y.addSeconds(e,-n[i-1].offset,r);var a=y.secondsDifference(n[i].julianDate,e);return 0===a?y.addSeconds(e,-n[i].offset,r):a<=1?void 0:y.addSeconds(e,-n[--i].offset,r)}function d(e,t,r){var n=t/s.SECONDS_PER_DAY|0;return e+=n,t-=s.SECONDS_PER_DAY*n,t<0&&(e--,t+=s.SECONDS_PER_DAY),r.dayNumber=e,r.secondsOfDay=t,r}function p(e,t,r,n,i,a,o){var u=(t-14)/12|0,c=e+4800+u,l=(1461*c/4|0)+(367*(t-2-12*u)/12|0)-(3*((c+100)/100|0)/4|0)+r-32075;n-=12,n<0&&(n+=24);var f=a+(n*s.SECONDS_PER_HOUR+i*s.SECONDS_PER_MINUTE+o*s.SECONDS_PER_MILLISECOND);return f>=43200&&(l-=1),[l,f]}function y(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=r(e,0),t=r(t,0),n=r(n,c.UTC);var i=0|e;t+=(e-i)*s.SECONDS_PER_DAY,d(i,t,this),n===c.UTC&&f(this)}var E=new a,m=[31,28,31,30,31,30,31,31,30,31,30,31],_=29,v=new u,T=/^(\d{4})$/,R=/^(\d{4})-(\d{2})$/,A=/^(\d{4})-?(\d{3})$/,g=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,S=/^(\d{4})-?(\d{2})-?(\d{2})$/,N=/([Z+\-])?(\d{2})?:?(\d{2})?$/,x=/^(\d{2})(\.\d+)?/.source+N.source,I=/^(\d{2}):?(\d{2})(\.\d+)?/.source+N.source,O=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+N.source;y.fromDate=function(e,t){var r=p(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return n(t)?(d(r[0],r[1],t),f(t),t):new y(r[0],r[1],c.UTC)},y.fromIso8601=function(e,t){e=e.replace(",",".");var r,i,a,u=e.split("T"),s=1,l=1,h=0,E=0,v=0,N=0,w=u[0],M=u[1];if(u=w.match(S),null!==u)r=+u[1],s=+u[2],l=+u[3];else if(u=w.match(R),null!==u)r=+u[1],s=+u[2];else if(u=w.match(T),null!==u)r=+u[1];else{var P;if(u=w.match(A),null!==u)r=+u[1],P=+u[2],a=o(r);else if(u=w.match(g),null!==u){r=+u[1];var C=+u[2],D=+u[3]||0,L=new Date(Date.UTC(r,0,4));P=7*C+D-L.getUTCDay()-3}i=new Date(Date.UTC(r,0,1)),i.setUTCDate(P),s=i.getUTCMonth()+1,l=i.getUTCDate()}a=o(r);var U;if(n(M)){u=M.match(O),null!==u?(h=+u[1],E=+u[2],v=+u[3],N=1e3*+(u[4]||0),U=5):(u=M.match(I),null!==u?(h=+u[1],E=+u[2],v=60*+(u[3]||0),U=4):(u=M.match(x),null!==u&&(h=+u[1],E=60*+(u[2]||0),U=3)));var b=u[U],F=+u[U+1],z=+(u[U+2]||0);switch(b){case"+":h-=F,E-=z;break;case"-":h+=F,E+=z;break;case"Z":break;default:E+=new Date(Date.UTC(r,s-1,l,h,E)).getTimezoneOffset()}}else E+=new Date(r,s-1,l).getTimezoneOffset();var B=60===v;for(B&&v--;E>=60;)E-=60,h++;for(;h>=24;)h-=24,l++;for(i=a&&2===s?_:m[s-1];l>i;)l-=i,s++,s>12&&(s-=12,r++),i=a&&2===s?_:m[s-1];for(;E<0;)E+=60,h--;for(;h<0;)h+=24,l--;for(;l<1;)s--,s<1&&(s+=12,r--),i=a&&2===s?_:m[s-1],l+=i;var G=p(r,s,l,h,E,v,N);return n(t)?(d(G[0],G[1],t),f(t)):t=new y(G[0],G[1],c.UTC),B&&y.addSeconds(t,1,t),t},y.now=function(e){return y.fromDate(new Date,e)};var w=new y(0,0,c.TAI);return y.toGregorianDate=function(e,t){var r=!1,i=h(e,w);n(i)||(y.addSeconds(e,-1,w),i=h(w,w),r=!0);var o=i.dayNumber,u=i.secondsOfDay;u>=43200&&(o+=1);var c=o+68569|0,l=4*c/146097|0;c=c-((146097*l+3)/4|0)|0;var f=4e3*(c+1)/1461001|0;c=c-(1461*f/4|0)+31|0;var d=80*c/2447|0,p=c-(2447*d/80|0)|0;c=d/11|0;var E=d+2-12*c|0,m=100*(l-49)+f+c|0,_=u/s.SECONDS_PER_HOUR|0,v=u-_*s.SECONDS_PER_HOUR,T=v/s.SECONDS_PER_MINUTE|0;v-=T*s.SECONDS_PER_MINUTE;var R=0|v,A=(v-R)/s.SECONDS_PER_MILLISECOND;return _+=12,_>23&&(_-=24),r&&(R+=1),n(t)?(t.year=m,t.month=E,t.day=p,t.hour=_,t.minute=T,t.second=R,t.millisecond=A,t.isLeapSecond=r,t):new a(m,E,p,_,T,R,A,r)},y.toDate=function(e){var t=y.toGregorianDate(e,E),r=t.second;return t.isLeapSecond&&(r-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,r,t.millisecond))},y.toIso8601=function(t,r){var i,a=y.toGregorianDate(t,a);return n(r)||0===a.millisecond?n(r)&&0!==r?(i=(.01*a.millisecond).toFixed(r).replace(".","").slice(0,r),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",a.year,a.month,a.day,a.hour,a.minute,a.second,i)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",a.year,a.month,a.day,a.hour,a.minute,a.second):(i=(.01*a.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",a.year,a.month,a.day,a.hour,a.minute,a.second,i))},y.clone=function(e,t){if(n(e))return n(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new y(e.dayNumber,e.secondsOfDay,c.TAI)},y.compare=function(e,t){var r=e.dayNumber-t.dayNumber;return 0!==r?r:e.secondsOfDay-t.secondsOfDay},y.equals=function(e,t){return e===t||n(e)&&n(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},y.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(y.secondsDifference(e,t))<=r},y.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},y.secondsDifference=function(e,t){var r=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return r+(e.secondsOfDay-t.secondsOfDay)},y.daysDifference=function(e,t){var r=e.dayNumber-t.dayNumber,n=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return r+n},y.computeTaiMinusUtc=function(e){v.julianDate=e;var r=y.leapSeconds,n=t(r,v,l);return n<0&&(n=~n,--n,n<0&&(n=0)),r[n].offset},y.addSeconds=function(e,t,r){return d(e.dayNumber,e.secondsOfDay+t,r)},y.addMinutes=function(e,t,r){var n=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return d(e.dayNumber,n,r)},y.addHours=function(e,t,r){var n=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return d(e.dayNumber,n,r)},y.addDays=function(e,t,r){var n=e.dayNumber+t;return d(n,e.secondsOfDay,r)},y.lessThan=function(e,t){return y.compare(e,t)<0},y.lessThanOrEquals=function(e,t){return y.compare(e,t)<=0},y.greaterThan=function(e,t){return y.compare(e,t)>0},y.greaterThanOrEquals=function(e,t){return y.compare(e,t)>=0},y.prototype.clone=function(e){return y.clone(this,e)},y.prototype.equals=function(e){return y.equals(this,e)},y.prototype.equalsEpsilon=function(e,t){return y.equalsEpsilon(this,e,t)},y.prototype.toString=function(){return y.toIso8601(this)},y.leapSeconds=[new u(new y(2441317,43210,c.TAI),10),new u(new y(2441499,43211,c.TAI),11),new u(new y(2441683,43212,c.TAI),12),new u(new y(2442048,43213,c.TAI),13),new u(new y(2442413,43214,c.TAI),14),new u(new y(2442778,43215,c.TAI),15),new u(new y(2443144,43216,c.TAI),16),new u(new y(2443509,43217,c.TAI),17),new u(new y(2443874,43218,c.TAI),18),new u(new y(2444239,43219,c.TAI),19),new u(new y(2444786,43220,c.TAI),20),new u(new y(2445151,43221,c.TAI),21),new u(new y(2445516,43222,c.TAI),22),new u(new y(2446247,43223,c.TAI),23),new u(new y(2447161,43224,c.TAI),24),new u(new y(2447892,43225,c.TAI),25),new u(new y(2448257,43226,c.TAI),26),new u(new y(2448804,43227,c.TAI),27),new u(new y(2449169,43228,c.TAI),28),new u(new y(2449534,43229,c.TAI),29),new u(new y(2450083,43230,c.TAI),30),new u(new y(2450630,43231,c.TAI),31),new u(new y(2451179,43232,c.TAI),32),new u(new y(2453736,43233,c.TAI),33),new u(new y(2454832,43234,c.TAI),34),new u(new y(2456109,43235,c.TAI),35),new u(new y(2457204,43236,c.TAI),36),new u(new y(2457754,43237,c.TAI),37)],y}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(r,n){if(null===r||"object"!=typeof r)return r;n=e(n,!1);var i=new r.constructor;for(var a in r)if(r.hasOwnProperty(a)){var o=r[a];n&&(o=t(o,n)),i[a]=o}return i}return t}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var r=e.split("\r\n"),n=0;n<r.length;++n){var i=r[n],a=i.indexOf(": ");if(a>0){var o=i.substring(0,a),u=i.substring(a+2);t[o]=u}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function r(e,r,n){this.statusCode=e,this.response=r,this.responseHeaders=n,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return r.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},r}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var r=n.exec(t);this.scheme=r[1],this.authority=r[2],this.path=r[3],this.query=r[4],this.fragment=r[5]}}function t(e){var t=unescape(e);return a.test(t)?t:e.toUpperCase()}function r(e,t,r,n){return(t||"")+r.toLowerCase()+(n||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var n=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(o,r).replace(i,t)),this.path&&(this.path=this.path.replace(i,t)),this.query&&(this.query=this.query.replace(i,t)),this.fragment&&(this.fragment=this.fragment.replace(i,t))};var i=/%[0-9a-z]{2}/gi,a=/[a-zA-Z0-9\-\._~]/,o=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var r=new e;return this.scheme?(r.scheme=this.scheme,r.authority=this.authority,r.path=this.path,r.query=this.query):(r.scheme=t.scheme,this.authority?(r.authority=this.authority,r.path=this.path,r.query=this.query):(r.authority=t.authority,""==this.path?(r.path=t.path,r.query=this.query||t.query):("/"==this.path.charAt(0)?(r.path=this.path,r.removeDotSegments()):(t.authority&&""==t.path?r.path="/"+this.path:r.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,r.removeDotSegments()),r.query=this.query))),r.fragment=this.fragment,r},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),r=[],n=""==t[0];n&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?r.pop():"."!=e&&r.push(e);"."!=e&&".."!=e||r.push(""),n&&r.unshift(""),this.path=r.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(r){var n=new e(r);n.normalize();var i=n.getAuthority();if(t(i)){if(i.indexOf("@")!==-1){var a=i.split("@");i=a[1]}if(i.indexOf(":")===-1){var o=n.getScheme();if(t(o)||(o=window.location.protocol,o=o.substring(0,o.length-1)),"http"===o)i+=":80";else{if("https"!==o)return;i+=":443"}}return i}}var i={},a={};return i.add=function(e,r){var n=e.toLowerCase()+":"+r;t(a[n])||(a[n]=!0)},i.remove=function(e,r){var n=e.toLowerCase()+":"+r;t(a[n])&&delete a[n]},i.contains=function(e){var r=n(e);return!(!t(r)||!t(a[r]))},i.clear=function(){a={}},i}),define("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,r,n,i,a,o){"use strict";function u(r){r=t(r,t.EMPTY_OBJECT);var n=r.responseType,i=t(r.method,"GET"),a=r.data,o=r.headers,s=r.overrideMimeType;return e(r.url,function(t){var r=e.defer();return u.load(t,n,i,a,o,r,s),r.promise})}function s(e,t){var r=decodeURIComponent(t);return e?atob(r):r}function c(e,t){for(var r=s(e,t),n=new ArrayBuffer(r.length),i=new Uint8Array(n),a=0;a<r.length;a++)i[a]=r.charCodeAt(a);return n}function l(e,r){r=t(r,"");var n=e[1],i=!!e[2],a=e[3];switch(r){case"":case"text":return s(i,a);case"arraybuffer":return c(i,a);case"blob":var o=c(i,a);return new Blob([o],{type:n});case"document":var u=new DOMParser;return u.parseFromString(s(i,a),n);case"json":return JSON.parse(s(i,a))}}var f=/^data:(.*?)(;base64)?,(.*)$/;return u.load=function(e,t,n,u,s,c,h){var d=f.exec(e);if(null!==d)return void c.resolve(l(d,t));var p=new XMLHttpRequest;if(o.contains(e)&&(p.withCredentials=!0),r(h)&&r(p.overrideMimeType)&&p.overrideMimeType(h),p.open(n,e,!0),r(s))for(var y in s)s.hasOwnProperty(y)&&p.setRequestHeader(y,s[y]);r(t)&&(p.responseType=t),p.onload=function(){if(p.status<200||p.status>=300)return void c.reject(new i(p.status,p.response,p.getAllResponseHeaders()));var e=p.response,n=p.responseType;if(!r(e)||r(t)&&n!==t)if("json"===t&&"string"==typeof e)try{c.resolve(JSON.parse(e))}catch(e){c.reject(e)}else(""===n||"document"===n)&&r(p.responseXML)&&p.responseXML.hasChildNodes()?c.resolve(p.responseXML):""!==n&&"text"!==n||!r(p.responseText)?c.reject(new a("Invalid XMLHttpRequest response type.")):c.resolve(p.responseText);else c.resolve(e)},p.onerror=function(e){c.reject(new i)},p.send(u)},u.defaultLoad=u.load,u}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,r){return e({url:t,headers:r})}return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,r,n){"use strict";function i(r,i){return t(i)?t(i.Accept)||(i=e(i),i.Accept=a.Accept):i=a,n(r,i).then(function(e){return JSON.parse(e)})}var a={Accept:"application/json,*/*;q=0.01"};return i}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,r,n,i,a,o,u,s,c,l,f){"use strict";function h(t){if(t=r(t,r.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=r(t.addNewLeapSeconds,!0),n(t.data))p(this,t.data);else if(n(t.url)){var i=this;this._downloadPromise=e(s(t.url),function(e){p(i,e)},function(){i._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else p(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function d(e,t){return o.compare(e.julianDate,t)}function p(e,r){if(!n(r.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!n(r.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var i=r.columnNames.indexOf("modifiedJulianDateUtc"),a=r.columnNames.indexOf("xPoleWanderRadians"),s=r.columnNames.indexOf("yPoleWanderRadians"),c=r.columnNames.indexOf("ut1MinusUtcSeconds"),h=r.columnNames.indexOf("xCelestialPoleOffsetRadians"),p=r.columnNames.indexOf("yCelestialPoleOffsetRadians"),y=r.columnNames.indexOf("taiMinusUtcSeconds");if(i<0||a<0||s<0||c<0||h<0||p<0||y<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var E=e._samples=r.samples,m=e._dates=[];e._dateColumn=i,e._xPoleWanderRadiansColumn=a,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=h,e._yCelestialPoleOffsetRadiansColumn=p,e._taiMinusUtcSecondsColumn=y,e._columnCount=r.columnNames.length,e._lastIndex=void 0;for(var _,v=e._addNewLeapSeconds,T=0,R=E.length;T<R;T+=e._columnCount){var A=E[T+i],g=E[T+y],S=A+l.MODIFIED_JULIAN_DATE_DIFFERENCE,N=new o(S,g,f.TAI);if(m.push(N),v){if(g!==_&&n(_)){var x=o.leapSeconds,I=t(x,N,d);if(I<0){var O=new u(N,g);x.splice(~I,0,O)}}_=g}}}function y(e,t,r,n,i){var a=r*n;i.xPoleWander=t[a+e._xPoleWanderRadiansColumn],i.yPoleWander=t[a+e._yPoleWanderRadiansColumn],i.xPoleOffset=t[a+e._xCelestialPoleOffsetRadiansColumn],i.yPoleOffset=t[a+e._yCelestialPoleOffsetRadiansColumn],i.ut1MinusUtc=t[a+e._ut1MinusUtcSecondsColumn]}function E(e,t,r){return t+e*(r-t)}function m(e,t,r,n,i,a,u){var s=e._columnCount;if(a>t.length-1)return u.xPoleWander=0,u.yPoleWander=0,u.xPoleOffset=0,u.yPoleOffset=0,u.ut1MinusUtc=0,u;var c=t[i],l=t[a];if(c.equals(l)||n.equals(c))return y(e,r,i,s,u),u;if(n.equals(l))return y(e,r,a,s,u),u;var f=o.secondsDifference(n,c)/o.secondsDifference(l,c),h=i*s,d=a*s,p=r[h+e._ut1MinusUtcSecondsColumn],m=r[d+e._ut1MinusUtcSecondsColumn],_=m-p;if(_>.5||_<-.5){var v=r[h+e._taiMinusUtcSecondsColumn],T=r[d+e._taiMinusUtcSecondsColumn];v!==T&&(l.equals(n)?p=m:m-=T-v)}return u.xPoleWander=E(f,r[h+e._xPoleWanderRadiansColumn],r[d+e._xPoleWanderRadiansColumn]),u.yPoleWander=E(f,r[h+e._yPoleWanderRadiansColumn],r[d+e._yPoleWanderRadiansColumn]),u.xPoleOffset=E(f,r[h+e._xCelestialPoleOffsetRadiansColumn],r[d+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=E(f,r[h+e._yCelestialPoleOffsetRadiansColumn],r[d+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=E(f,p,m),u}return h.NONE=a({getPromiseToLoad:function(){return e()},compute:function(e,t){return n(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new i(0,0,0,0,0),t}}),h.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},h.prototype.compute=function(e,r){if(n(this._samples)){if(n(r)||(r=new i(0,0,0,0,0)),0===this._samples.length)return r.xPoleWander=0,r.yPoleWander=0,r.xPoleOffset=0,r.yPoleOffset=0,r.ut1MinusUtc=0,r;var a=this._dates,u=this._lastIndex,s=0,l=0;if(n(u)){var f=a[u],h=a[u+1],d=o.lessThanOrEquals(f,e),p=!n(h),y=p||o.greaterThanOrEquals(h,e);if(d&&y)return s=u,!p&&h.equals(e)&&++s,l=s+1,m(this,a,this._samples,e,s,l,r),r}var E=t(a,e,o.compare,this._dateColumn);return E>=0?(E<a.length-1&&a[E+1].equals(e)&&++E,s=E,l=E):(l=~E,s=l-1,s<0&&(s=0)),this._lastIndex=s,m(this,a,this._samples,e,s,l,r),r}if(n(this._dataError))throw new c(this._dataError)},h}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,r,n){"use strict";function i(t,r,n){this.heading=e(t,0),this.pitch=e(r,0),this.roll=e(n,0)}return i.fromQuaternion=function(e,r){t(r)||(r=new i);var n=2*(e.w*e.y-e.z*e.x),a=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return r.heading=-Math.atan2(s,u),r.roll=Math.atan2(o,a),r.pitch=-Math.asin(n),r},i.fromDegrees=function(e,r,a,o){return t(o)||(o=new i),o.heading=e*n.RADIANS_PER_DEGREE,o.pitch=r*n.RADIANS_PER_DEGREE,o.roll=a*n.RADIANS_PER_DEGREE,o},i.clone=function(e,r){if(t(e))return t(r)?(r.heading=e.heading,r.pitch=e.pitch,r.roll=e.roll,r):new i(e.heading,e.pitch,e.roll)},i.equals=function(e,r){return e===r||t(e)&&t(r)&&e.heading===r.heading&&e.pitch===r.pitch&&e.roll===r.roll},i.equalsEpsilon=function(e,r,i,a){return e===r||t(e)&&t(r)&&n.equalsEpsilon(e.heading,r.heading,i,a)&&n.equalsEpsilon(e.pitch,r.pitch,i,a)&&n.equalsEpsilon(e.roll,r.roll,i,a)},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i.prototype.equalsEpsilon=function(e,t,r){return i.equalsEpsilon(this,e,t,r)},i.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},i}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function i(r,n){n=t(n,document.location.href);var i=new e(n),a=new e(r);return a.resolve(i).toString()}return i}),define("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function i(n,i,a){a=t(a,!0),n instanceof e||(n=new e(n)),i instanceof e||(i=new e(i)),r(i.authority)&&!r(i.scheme)&&("undefined"!=typeof document&&r(document.location)&&r(document.location.href)?i.scheme=new e(document.location.href).scheme:i.scheme=n.scheme);var o=n;i.isAbsolute()&&(o=i);var u="";r(o.scheme)&&(u+=o.scheme+":"),r(o.authority)&&(u+="//"+o.authority,""!==o.path&&"/"!==o.path&&(u=u.replace(/\/?$/,"/"),o.path=o.path.replace(/^\/?/g,""))),u+=o===n?a?n.path.replace(/\/?$/,"/")+i.path.replace(/^\/?/g,""):n.path+i.path:i.path;var s=r(n.query),c=r(i.query);s&&c?u+="?"+n.query+"&"+i.query:s&&!c?u+="?"+n.query:!s&&c&&(u+="?"+i.query);var l=r(i.fragment);return r(n.fragment)&&!l?u+="#"+n.fragment:l&&(u+="#"+i.fragment),u}return i}),define("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","./joinUrls","require"],function(e,t,r,n,i,a){"use strict";function o(){for(var e=document.getElementsByTagName("script"),t=0,r=e.length;t<r;++t){var n=e[t].getAttribute("src"),i=p.exec(n);if(null!==i)return i[1]}}function u(){if(t(f))return f;var r;return r="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:o(),f=new e(n(r))}function s(e){return a.toUrl("../"+e)}function c(e){return i(u(),e)}function l(e){t(h)||(h=t(a.toUrl)?s:c), -t(d)||(d=document.createElement("a"));var r=h(e);return d.href=r,d.href=d.href,d.href}var f,h,d,p=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return l._cesiumScriptRegex=p,l.setBaseUrl=function(t){f=new e(t).resolve(new e(document.location.href))},l}),define("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,r){this.x=e,this.y=t,this.s=r}return e}),define("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,r,n,i,a,o,u){"use strict";function s(e){e=r(e,r.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=r(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=r(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new a(this._sampleZeroJulianEphemerisDate,0,u.TAI),this._stepSizeDays=r(e.stepSizeDays,1),this._samplesPerXysFile=r(e.samplesPerXysFile,1e3),this._totalSamples=r(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,n=this._denominators=new Array(t+1),i=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t),s=0;s<=t;++s){n[s]=o,i[s]=s*this._stepSizeDays;for(var c=0;c<=t;++c)c!==s&&(n[s]*=s-c);n[s]=1/n[s]}this._work=new Array(t+1),this._coef=new Array(t+1)}function c(e,t,r){var n=f;return n.dayNumber=t,n.secondsOfDay=r,a.daysDifference(n,e._sampleZeroDateTT)}function l(r,i){if(r._chunkDownloadsInProgress[i])return r._chunkDownloadsInProgress[i];var a=e.defer();r._chunkDownloadsInProgress[i]=a;var u,s=r._xysFileUrlTemplate;return u=n(s)?s.replace("{0}",i):t("Assets/IAU2006_XYS/IAU2006_XYS_"+i+".json"),e(o(u),function(e){r._chunkDownloadsInProgress[i]=!1;for(var t=r._samples,n=e.samples,o=i*r._samplesPerXysFile*3,u=0,s=n.length;u<s;++u)t[o+u]=n[u];a.resolve()}),a.promise}var f=new a(0,0,u.TAI);return s.prototype.preload=function(t,r,n,i){var a=c(this,t,r),o=c(this,n,i),u=a/this._stepSizeDays-this._interpolationOrder/2|0;u<0&&(u=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var f=u/this._samplesPerXysFile|0,h=s/this._samplesPerXysFile|0,d=[],p=f;p<=h;++p)d.push(l(this,p));return e.all(d)},s.prototype.computeXysRadians=function(e,t,r){var a=c(this,e,t);if(!(a<0)){var o=a/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);s<0&&(s=0);var f=s+u;f>=this._totalSamples&&(f=this._totalSamples-1,s=f-u,s<0&&(s=0));var h=!1,d=this._samples;if(n(d[3*s])||(l(this,s/this._samplesPerXysFile|0),h=!0),n(d[3*f])||(l(this,f/this._samplesPerXysFile|0),h=!0),!h){n(r)?(r.x=0,r.y=0,r.s=0):r=new i(0,0,0);var p,y,E=a-s*this._stepSizeDays,m=this._work,_=this._denominators,v=this._coef,T=this._xTable;for(p=0;p<=u;++p)m[p]=E-T[p];for(p=0;p<=u;++p){for(v[p]=1,y=0;y<=u;++y)y!==p&&(v[p]*=m[y]);v[p]*=_[p];var R=3*(s+p);r.x+=v[p]*d[R++],r.y+=v[p]*d[R++],r.s+=v[p]*d[R]}return r}}}},s}),define("Core/Quaternion",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math","./Matrix3"],function(e,t,r,n,i,a,o,u){"use strict";function s(e,r,n,i){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0),this.w=t(i,0)}var c=new e;s.fromAxisAngle=function(t,n,i){var a=n/2,o=Math.sin(a);c=e.normalize(t,c);var u=c.x*o,l=c.y*o,f=c.z*o,h=Math.cos(a);return r(i)?(i.x=u,i.y=l,i.z=f,i.w=h,i):new s(u,l,f,h)};var l=[1,2,0],f=new Array(3);s.fromRotationMatrix=function(e,t){var n,i,a,o,c,h=e[u.COLUMN0ROW0],d=e[u.COLUMN1ROW1],p=e[u.COLUMN2ROW2],y=h+d+p;if(y>0)n=Math.sqrt(y+1),c=.5*n,n=.5/n,i=(e[u.COLUMN1ROW2]-e[u.COLUMN2ROW1])*n,a=(e[u.COLUMN2ROW0]-e[u.COLUMN0ROW2])*n,o=(e[u.COLUMN0ROW1]-e[u.COLUMN1ROW0])*n;else{var E=l,m=0;d>h&&(m=1),p>h&&p>d&&(m=2);var _=E[m],v=E[_];n=Math.sqrt(e[u.getElementIndex(m,m)]-e[u.getElementIndex(_,_)]-e[u.getElementIndex(v,v)]+1);var T=f;T[m]=.5*n,n=.5/n,c=(e[u.getElementIndex(v,_)]-e[u.getElementIndex(_,v)])*n,T[_]=(e[u.getElementIndex(_,m)]+e[u.getElementIndex(m,_)])*n,T[v]=(e[u.getElementIndex(v,m)]+e[u.getElementIndex(m,v)])*n,i=-T[0],a=-T[1],o=-T[2]}return r(t)?(t.x=i,t.y=a,t.z=o,t.w=c,t):new s(i,a,o,c)};var h=new s;s.fromHeadingPitchRoll=function(t,r,n,i){var a=s.fromAxisAngle(e.UNIT_X,n,h),o=s.fromAxisAngle(e.UNIT_Y,-r,i);i=s.multiply(o,a,o);var u=s.fromAxisAngle(e.UNIT_Z,-t,h);return s.multiply(u,i,i)};var d=new e,p=new e,y=new s,E=new s,m=new s;s.packedLength=4,s.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n++]=e.z,r[n]=e.w,r},s.unpack=function(e,n,i){return n=t(n,0),r(i)||(i=new s),i.x=e[n],i.y=e[n+1],i.z=e[n+2],i.w=e[n+3],i},s.packedInterpolationLength=3,s.convertPackedArrayForInterpolation=function(e,t,r,n){s.unpack(e,4*r,m),s.conjugate(m,m);for(var i=0,a=r-t+1;i<a;i++){var o=3*i;s.unpack(e,4*(t+i),y),s.multiply(y,m,y),y.w<0&&s.negate(y,y),s.computeAxis(y,d);var u=s.computeAngle(y);n[o]=d.x*u,n[o+1]=d.y*u,n[o+2]=d.z*u}},s.unpackInterpolationResult=function(t,n,i,a,o){r(o)||(o=new s),e.fromArray(t,0,p);var u=e.magnitude(p);return s.unpack(n,4*a,E),0===u?s.clone(s.IDENTITY,y):s.fromAxisAngle(p,u,y),s.multiply(y,E,o)},s.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new s(e.x,e.y,e.z,e.w)},s.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},s.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},s.magnitude=function(e){return Math.sqrt(s.magnitudeSquared(e))},s.normalize=function(e,t){var r=1/s.magnitude(e),n=e.x*r,i=e.y*r,a=e.z*r,o=e.w*r;return t.x=n,t.y=i,t.z=a,t.w=o,t},s.inverse=function(e,t){var r=s.magnitudeSquared(e);return t=s.conjugate(e,t),s.multiplyByScalar(t,1/r,t)},s.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},s.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},s.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},s.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},s.multiply=function(e,t,r){var n=e.x,i=e.y,a=e.z,o=e.w,u=t.x,s=t.y,c=t.z,l=t.w,f=o*u+n*l+i*c-a*s,h=o*s-n*c+i*l+a*u,d=o*c+n*s-i*u+a*l,p=o*l-n*u-i*s-a*c;return r.x=f,r.y=h,r.z=d,r.w=p,r},s.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},s.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},s.computeAxis=function(e,t){var r=e.w;if(Math.abs(r-1)<o.EPSILON6)return t.x=t.y=t.z=0,t;var n=1/Math.sqrt(1-r*r);return t.x=e.x*n,t.y=e.y*n,t.z=e.z*n,t},s.computeAngle=function(e){return Math.abs(e.w-1)<o.EPSILON6?0:2*Math.acos(e.w)};var _=new s;s.lerp=function(e,t,r,n){return _=s.multiplyByScalar(t,r,_),n=s.multiplyByScalar(e,1-r,n),s.add(_,n,n)};var v=new s,T=new s,R=new s;s.slerp=function(e,t,r,n){var i=s.dot(e,t),a=t;if(i<0&&(i=-i,a=v=s.negate(t,v)),1-i<o.EPSILON6)return s.lerp(e,a,r,n);var u=Math.acos(i);return T=s.multiplyByScalar(e,Math.sin((1-r)*u),T),R=s.multiplyByScalar(a,Math.sin(r*u),R),n=s.add(T,R,n),s.multiplyByScalar(n,1/Math.sin(u),n)},s.log=function(t,r){var n=o.acosClamped(t.w),i=0;return 0!==n&&(i=n/Math.sin(n)),e.multiplyByScalar(t,i,r)},s.exp=function(t,r){var n=e.magnitude(t),i=0;return 0!==n&&(i=Math.sin(n)/n),r.x=t.x*i,r.y=t.y*i,r.z=t.z*i,r.w=Math.cos(n),r};var A=new e,g=new e,S=new s,N=new s;s.computeInnerQuadrangle=function(t,r,n,i){var a=s.conjugate(r,S);s.multiply(a,n,N);var o=s.log(N,A);s.multiply(a,t,N);var u=s.log(N,g);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),s.exp(o,S),s.multiply(r,S,i)},s.squad=function(e,t,r,n,i,a){var o=s.slerp(e,t,i,S),u=s.slerp(r,n,i,N);return s.slerp(o,u,2*i*(1-i),a)};for(var x=new s,I=1.9011074535173003,O=i.supportsTypedArrays()?new Float32Array(8):[],w=i.supportsTypedArrays()?new Float32Array(8):[],M=i.supportsTypedArrays()?new Float32Array(8):[],P=i.supportsTypedArrays()?new Float32Array(8):[],C=0;C<7;++C){var D=C+1,L=2*D+1;O[C]=1/(D*L),w[C]=D/L}return O[7]=I/136,w[7]=8*I/17,s.fastSlerp=function(e,t,r,n){var i,a=s.dot(e,t);a>=0?i=1:(i=-1,a=-a);for(var o=a-1,u=1-r,c=r*r,l=u*u,f=7;f>=0;--f)M[f]=(O[f]*c-w[f])*o,P[f]=(O[f]*l-w[f])*o;var h=i*r*(1+M[0]*(1+M[1]*(1+M[2]*(1+M[3]*(1+M[4]*(1+M[5]*(1+M[6]*(1+M[7])))))))),d=u*(1+P[0]*(1+P[1]*(1+P[2]*(1+P[3]*(1+P[4]*(1+P[5]*(1+P[6]*(1+P[7])))))))),p=s.multiplyByScalar(e,d,x);return s.multiplyByScalar(t,h,n),s.add(p,n,n)},s.fastSquad=function(e,t,r,n,i,a){var o=s.fastSlerp(e,t,i,S),u=s.fastSlerp(r,n,i,N);return s.fastSlerp(o,u,2*i*(1-i),a)},s.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},s.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n},s.ZERO=a(new s(0,0,0,0)),s.IDENTITY=a(new s(0,0,0,1)),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.x+", "+this.y+", "+this.z+", "+this.w+")"},s}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./defaultValue","./defined","./deprecationWarning","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./HeadingPitchRoll","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,r,n,i,a,o,u,s,c,l,f,h,d,p,y,E,m,_,v,T){"use strict";var R={},A=new r,g=new r,S=new r;R.eastNorthUpToFixedFrame=function(e,t,n){if(E.equalsEpsilon(e.x,0,E.EPSILON14)&&E.equalsEpsilon(e.y,0,E.EPSILON14)){var i=E.sign(e.z);return o(n)?(n[0]=0,n[1]=1,n[2]=0,n[3]=0,n[4]=-i,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=i,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new _(0,-i,0,e.x,1,0,0,e.y,0,0,i,e.z,0,0,0,1)}var u=A,s=g,c=S;return t=a(t,f.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,r.normalize(s,s),r.cross(u,s,c),o(n)?(n[0]=s.x,n[1]=s.y,n[2]=s.z,n[3]=0,n[4]=c.x,n[5]=c.y,n[6]=c.z,n[7]=0,n[8]=u.x,n[9]=u.y,n[10]=u.z,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new _(s.x,c.x,u.x,e.x,s.y,c.y,u.y,e.y,s.z,c.z,u.z,e.z,0,0,0,1)};var N=new r,x=new r,I=new r;R.northEastDownToFixedFrame=function(e,t,n){if(E.equalsEpsilon(e.x,0,E.EPSILON14)&&E.equalsEpsilon(e.y,0,E.EPSILON14)){var i=E.sign(e.z);return o(n)?(n[0]=-i,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=1,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=-i,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new _(-i,0,0,e.x,0,1,0,e.y,0,0,-i,e.z,0,0,0,1)}var u=N,s=x,c=I;return t=a(t,f.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,r.normalize(s,s),r.cross(u,s,c),o(n)?(n[0]=c.x,n[1]=c.y,n[2]=c.z,n[3]=0,n[4]=s.x,n[5]=s.y,n[6]=s.z,n[7]=0,n[8]=-u.x,n[9]=-u.y,n[10]=-u.z,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new _(c.x,s.x,-u.x,e.x,c.y,s.y,-u.y,e.y,c.z,s.z,-u.z,e.z,0,0,0,1)},R.northUpEastToFixedFrame=function(e,t,n){if(E.equalsEpsilon(e.x,0,E.EPSILON14)&&E.equalsEpsilon(e.y,0,E.EPSILON14)){var i=E.sign(e.z);return o(n)?(n[0]=-i,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=i,n[7]=0,n[8]=0,n[9]=1,n[10]=0,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new _(-i,0,0,e.x,0,0,1,e.y,0,i,0,e.z,0,0,0,1)}var u=A,s=g,c=S;return t=a(t,f.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,r.normalize(s,s),r.cross(u,s,c),o(n)?(n[0]=c.x,n[1]=c.y,n[2]=c.z,n[3]=0,n[4]=u.x,n[5]=u.y,n[6]=u.z,n[7]=0,n[8]=s.x,n[9]=s.y,n[10]=s.z,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new _(c.x,u.x,s.x,e.x,c.y,u.y,s.y,e.y,c.z,u.z,s.z,e.z,0,0,0,1)},R.northWestUpToFixedFrame=function(e,t,n){if(E.equalsEpsilon(e.x,0,E.EPSILON14)&&E.equalsEpsilon(e.y,0,E.EPSILON14)){var i=E.sign(e.z);return o(n)?(n[0]=-i,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=-1,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=i,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new _(-i,0,0,e.x,0,-1,0,e.y,0,0,i,e.z,0,0,0,1)}var u=A,s=g,c=S;return t=a(t,f.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,r.normalize(s,s),r.cross(u,s,c),o(n)?(n[0]=c.x,n[1]=c.y,n[2]=c.z,n[3]=0,n[4]=-s.x,n[5]=-s.y,n[6]=-s.z,n[7]=0,n[8]=u.x,n[9]=u.y,n[10]=u.z,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new _(c.x,-s.x,u.x,e.x,c.y,-s.y,u.y,e.y,c.z,-s.z,u.z,e.z,0,0,0,1)};var O=new v,w=new r(1,1,1),M=new _;R.headingPitchRollToFixedFrame=function(e,t,n,i,a,o){var s;"object"==typeof t?(a=n,o=i,s=t.heading,n=t.pitch,i=t.roll):(u("headingPitchRollToFixedFrame","headingPitchRollToFixedFrame with separate heading, pitch, and roll arguments was deprecated in 1.27. It will be removed in 1.30. Use a HeadingPitchRoll object."),s=t);var c=v.fromHeadingPitchRoll(s,n,i,O),l=_.fromTranslationQuaternionRotationScale(r.ZERO,c,w,M);return o=R.eastNorthUpToFixedFrame(e,a,o),_.multiply(o,l,o)};var P=new h,C=new _,D=new m;R.headingPitchRollQuaternion=function(e,t,r,n,i,a){var o;"object"==typeof t?(o=t,i=r,a=n):(u("headingPitchRollQuaternion","headingPitchRollQuaternion with separate heading, pitch, and roll arguments was deprecated in 1.27. It will be removed in 1.30. Use a HeadingPitchRoll object."),P.heading=t,P.pitch=r,P.roll=n,o=P);var s=R.headingPitchRollToFixedFrame(e,o,i,C),c=_.getRotation(s,D);return v.fromRotationMatrix(c,a)};var L=24110.54841,U=8640184.812866,b=.093104,F=-62e-7,z=1.1772758384668e-19,B=72921158553e-15,G=E.TWO_PI/86400,q=new y;R.computeTemeToPseudoFixedMatrix=function(e,t){q=y.addSeconds(e,-y.computeTaiMinusUtc(e),q);var r,n=q.dayNumber,i=q.secondsOfDay,a=n-2451545;r=i>=43200?(a+.5)/T.DAYS_PER_JULIAN_CENTURY:(a-.5)/T.DAYS_PER_JULIAN_CENTURY;var u=L+r*(U+r*(b+r*F)),s=u*G%E.TWO_PI,c=B+z*(n-2451545.5),l=(i+.5*T.SECONDS_PER_DAY)%T.SECONDS_PER_DAY,f=s+c*l,h=Math.cos(f),d=Math.sin(f);return o(t)?(t[0]=h,t[1]=-d,t[2]=0,t[3]=d,t[4]=h,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new m(h,d,0,-d,h,0,0,0,1)},R.iau2006XysData=new d,R.earthOrientationParameters=c.NONE;var W=32.184,H=2451545;R.preloadIcrfFixed=function(t){var r=t.start.dayNumber,n=t.start.secondsOfDay+W,i=t.stop.dayNumber,a=t.stop.secondsOfDay+W,o=R.iau2006XysData.preload(r,n,i,a),u=R.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},R.computeIcrfToFixedMatrix=function(e,t){o(t)||(t=new m);var r=R.computeFixedToIcrfMatrix(e,t);if(o(r))return m.transpose(r,t)};var V=new p(0,0,0),X=new l(0,0,0,0,0,0),Y=new m,k=new m;R.computeFixedToIcrfMatrix=function(e,t){o(t)||(t=new m);var r=R.earthOrientationParameters.compute(e,X);if(o(r)){var n=e.dayNumber,i=e.secondsOfDay+W,a=R.iau2006XysData.computeXysRadians(n,i,V);if(o(a)){var u=a.x+r.xPoleOffset,s=a.y+r.yPoleOffset,c=1/(1+Math.sqrt(1-u*u-s*s)),l=Y;l[0]=1-c*u*u,l[3]=-c*u*s,l[6]=u,l[1]=-c*u*s,l[4]=1-c*s*s,l[7]=s,l[2]=-u,l[5]=-s,l[8]=1-c*(u*u+s*s);var f=m.fromRotationZ(-a.s,k),h=m.multiply(l,f,Y),d=e.dayNumber,p=e.secondsOfDay-y.computeTaiMinusUtc(e)+r.ut1MinusUtc,_=d-2451545,v=p/T.SECONDS_PER_DAY,A=.779057273264+v+.00273781191135448*(_+v);A=A%1*E.TWO_PI;var g=m.fromRotationZ(A,k),S=m.multiply(h,g,Y),N=Math.cos(r.xPoleWander),x=Math.cos(r.yPoleWander),I=Math.sin(r.xPoleWander),O=Math.sin(r.yPoleWander),w=n-H+i/T.SECONDS_PER_DAY;w/=36525;var M=-47e-6*w*E.RADIANS_PER_DEGREE/3600,P=Math.cos(M),C=Math.sin(M),D=k;return D[0]=N*P,D[1]=N*C,D[2]=I,D[3]=-x*C+O*I*P,D[4]=x*P+O*I*C,D[5]=-O*N,D[6]=-O*C-x*I*P,D[7]=O*P-x*I*C,D[8]=x*N,m.multiply(S,D,t)}}};var Z=new n;R.pointToWindowCoordinates=function(e,t,r,n){return n=R.pointToGLWindowCoordinates(e,t,r,n),n.y=2*t[5]-n.y,n},R.pointToGLWindowCoordinates=function(e,r,i,a){o(a)||(a=new t);var u=Z;return _.multiplyByVector(e,n.fromElements(i.x,i.y,i.z,1,u),u),n.multiplyByScalar(u,1/u.w,u),_.multiplyByVector(r,u,u),t.fromCartesian4(u,a)};var j=new r,K=new r,J=new r;R.rotationMatrixFromPositionVelocity=function(e,t,n,i){var u=a(n,f.WGS84).geodeticSurfaceNormal(e,j),s=r.cross(t,u,K);r.equalsEpsilon(s,r.ZERO,E.EPSILON6)&&(s=r.clone(r.UNIT_X,s));var c=r.cross(s,t,J);return r.cross(t,c,s),r.negate(s,s),o(i)||(i=new m),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=s.x,i[4]=s.y,i[5]=s.z,i[6]=c.x,i[7]=c.y,i[8]=c.z,i};var Q=new i,$=new r,ee=new r,te=new n,re=new n,ne=new n,ie=new n,ae=new n,oe=new _,ue=new _;return R.basisTo2D=function(e,t,i){var a=e.ellipsoid,o=_.getColumn(t,3,te),u=a.cartesianToCartographic(o,Q),s=R.eastNorthUpToFixedFrame(o,a,oe),c=_.inverseTransformation(s,ue),l=e.project(u,$),f=re;f.x=l.z,f.y=l.x,f.z=l.y,f.w=1;var h=_.getColumn(t,0,ee),d=r.magnitude(h),p=_.multiplyByVector(c,h,ne);n.fromElements(p.z,p.x,p.y,0,p);var y=_.getColumn(t,1,ee),E=r.magnitude(y),m=_.multiplyByVector(c,y,ie);n.fromElements(m.z,m.x,m.y,0,m);var v=_.getColumn(t,2,ee),T=r.magnitude(v),A=ae;return r.cross(p,m,A),r.normalize(A,A),r.cross(m,A,p),r.normalize(p,p),r.cross(A,p,m),r.normalize(m,m),r.multiplyByScalar(p,d,p),r.multiplyByScalar(m,E,m),r.multiplyByScalar(A,T,A),_.setColumn(i,0,p,i),_.setColumn(i,1,m,i),_.setColumn(i,2,A,i),_.setColumn(i,3,f,i),i},R}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,r,n,i,a,o,u,s,c,l,f,h,d){"use strict";function p(e,t){t=i(t,s.WGS84),e=t.scaleToGeodeticSurface(e);var n=d.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=r.fromCartesian4(l.getColumn(n,0,y)),this._yAxis=r.fromCartesian4(l.getColumn(n,1,y));var a=r.fromCartesian4(l.getColumn(n,2,y));this._plane=f.fromPointNormal(e,a)}var y=new n;o(p.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var E=new e;p.fromPoints=function(t,r){var n=e.fromPoints(t,E);return new p(n.center,r)};var m=new h,_=new r;p.prototype.projectPointOntoPlane=function(e,n){var i=m;i.origin=e,r.normalize(e,i.direction);var o=c.rayPlane(i,this._plane,_);if(a(o)||(r.negate(i.direction,i.direction),o=c.rayPlane(i,this._plane,_)),a(o)){var u=r.subtract(o,this._origin,o),s=r.dot(this._xAxis,u),l=r.dot(this._yAxis,u);return a(n)?(n.x=s,n.y=l,n):new t(s,l)}},p.prototype.projectPointsOntoPlane=function(e,t){a(t)||(t=[]);for(var r=0,n=e.length,i=0;i<n;i++){var o=this.projectPointOntoPlane(e[i],t[r]);a(o)&&(t[r]=o,r++)}return t.length=r,t},p.prototype.projectPointToNearestOnPlane=function(e,n){a(n)||(n=new t);var i=m;i.origin=e,r.clone(this._plane.normal,i.direction);var o=c.rayPlane(i,this._plane,_);a(o)||(r.negate(i.direction,i.direction),o=c.rayPlane(i,this._plane,_));var u=r.subtract(o,this._origin,o),s=r.dot(this._xAxis,u),l=r.dot(this._yAxis,u);return n.x=s,n.y=l,n},p.prototype.projectPointsToNearestOnPlane=function(e,t){a(t)||(t=[]);var r=e.length;t.length=r;for(var n=0;n<r;n++)t[n]=this.projectPointToNearestOnPlane(e[n],t[n]);return t};var v=new r;return p.prototype.projectPointsOntoEllipsoid=function(e,t){var n=e.length;a(t)?t.length=n:t=new Array(n);for(var i=this._ellipsoid,o=this._origin,u=this._xAxis,s=this._yAxis,c=v,l=0;l<n;++l){var f=e[l];r.multiplyByScalar(u,f.x,c),a(t[l])||(t[l]=new r);var h=r.add(o,c,t[l]);r.multiplyByScalar(s,f.y,c),r.add(h,c,h),i.scaleToGeocentricSurface(h,h)}return t},p}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var r={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,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,t,r,n,i){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,i.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,n.NONE),this.boundingSphereCV=t.boundingSphereCV}return a.computeNumberOfVertices=function(e){var r=-1;for(var n in e.attributes)if(e.attributes.hasOwnProperty(n)&&t(e.attributes[n])&&t(e.attributes[n].values)){var i=e.attributes[n],a=i.values.length/i.componentsPerAttribute;r=a}return r},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(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 n}),define("Core/GeometryInstance",["./defaultValue","./defined","./DeveloperError","./Matrix4"],function(e,t,r,n){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.geometry=t.geometry,this.modelMatrix=n.clone(e(t.modelMatrix,n.IDENTITY)),this.id=t.id,this.pickPrimitive=t.pickPrimitive,this.attributes=e(t.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}return i}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,r,n,i){"use strict";var a={};a.octEncodeInRange=function(e,t,r){if(r.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),r.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var n=r.x,a=r.y;r.x=(1-Math.abs(a))*i.signNotZero(n),r.y=(1-Math.abs(n))*i.signNotZero(a)}return r.x=i.toSNorm(r.x,t),r.y=i.toSNorm(r.y,t),r},a.octEncode=function(e,t){return a.octEncodeInRange(e,255,t)},a.octDecodeInRange=function(e,r,n,a){if(a.x=i.fromSNorm(e,n),a.y=i.fromSNorm(r,n),a.z=1-(Math.abs(a.x)+Math.abs(a.y)),a.z<0){var o=a.x;a.x=(1-Math.abs(a.y))*i.signNotZero(o),a.y=(1-Math.abs(o))*i.signNotZero(a.y)}return t.normalize(a,a)},a.octDecode=function(e,t,r){return a.octDecodeInRange(e,t,255,r)},a.octPackFloat=function(e){return 256*e.x+e.y};var o=new e;return a.octEncodeFloat=function(e){return a.octEncode(e,o),a.octPackFloat(o)},a.octDecodeFloat=function(e,t){var r=e/256,n=Math.floor(r),i=256*(r-n);return a.octDecode(n,i,t)},a.octPack=function(e,t,r,n){var i=a.octEncodeFloat(e),u=a.octEncodeFloat(t),s=a.octEncode(r,o);return n.x=65536*s.x+i,n.y=65536*s.y+u,n},a.octUnpack=function(e,t,r,n){var i=e.x/65536,o=Math.floor(i),u=65536*(i-o);i=e.y/65536;var s=Math.floor(i),c=65536*(i-s);a.octDecodeFloat(u,t),a.octDecodeFloat(c,r),a.octDecode(o,s,n)},a.compressTextureCoordinates=function(e){var t=4095*e.x|0,r=4095*e.y|0;return 4096*t+r},a.decompressTextureCoordinates=function(e,t){var r=e/4096,n=Math.floor(r);return t.x=n/4095,t.y=(e-4096*n)/4095,t},a}),define("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function i(n,i,s,c,l){r(l)||(l=new t);var f,h,d,p,y,E,m,_;r(i.z)?(f=t.subtract(s,i,a),h=t.subtract(c,i,o),d=t.subtract(n,i,u),p=t.dot(f,f),y=t.dot(f,h),E=t.dot(f,d),m=t.dot(h,h),_=t.dot(h,d)):(f=e.subtract(s,i,a),h=e.subtract(c,i,o),d=e.subtract(n,i,u),p=e.dot(f,f),y=e.dot(f,h),E=e.dot(f,d),m=e.dot(h,h),_=e.dot(h,d));var v=1/(p*m-y*y);return l.y=(m*E-y*_)*v,l.z=(p*_-y*E)*v,l.x=1-l.y-l.z,l}var a=new t,o=new t,u=new t;return i}),define("Core/EncodedCartesian3",["./Cartesian3","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(){this.high=e.clone(e.ZERO),this.low=e.clone(e.ZERO)}n.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 i={high:0,low:0};n.fromCartesian=function(e,r){t(r)||(r=new n);var a=r.high,o=r.low;return n.encode(e.x,i),a.x=i.high,o.x=i.low,n.encode(e.y,i),a.y=i.high,o.y=i.low,n.encode(e.z,i),a.z=i.high,o.z=i.low,r};var a=new n;return n.writeElements=function(e,t,r){n.fromCartesian(e,a);var i=a.high,o=a.low;t[r]=i.x,t[r+1]=i.y,t[r+2]=i.z,t[r+3]=o.x,t[r+4]=o.y,t[r+5]=o.z},n}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,r,n,i){"use strict";var a={UNSIGNED_BYTE:i.UNSIGNED_BYTE,UNSIGNED_SHORT:i.UNSIGNED_SHORT,UNSIGNED_INT:i.UNSIGNED_INT};return a.getSizeInBytes=function(e){switch(e){case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},a.validate=function(t){return e(t)&&(t===a.UNSIGNED_BYTE||t===a.UNSIGNED_SHORT||t===a.UNSIGNED_INT)},a.createTypedArray=function(e,t){return e>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},a.createTypedArrayFromArrayBuffer=function(e,t,r,i){return e>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,r,i):new Uint16Array(t,r,i)},r(a)}),define("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";var n={};return n.calculateACMR=function(r){r=e(r,e.EMPTY_OBJECT);var n=r.indices,i=r.maximumIndex,a=e(r.cacheSize,24),o=n.length;if(!t(i)){i=0;for(var u=0,s=n[u];u<o;)s>i&&(i=s),++u,s=n[u]}for(var c=[],l=0;l<i+1;l++)c[l]=0;for(var f=a+1,h=0;h<o;++h)f-c[n[h]]>a&&(c[n[h]]=f,++f);return(f-a+1)/(o/3)},n.tipsify=function(r){function n(e,t,r,n){for(;t.length>=1;){var i=t[t.length-1];if(t.splice(t.length-1,1),e[i].numLiveTriangles>0)return i}for(;a<n;){if(e[a].numLiveTriangles>0)return++a,a-1;++a}return-1}function i(e,t,r,i,a,o,u){for(var s,c=-1,l=-1,f=0;f<r.length;){var h=r[f];i[h].numLiveTriangles&&(s=0,a-i[h].timeStamp+2*i[h].numLiveTriangles<=t&&(s=a-i[h].timeStamp),(s>l||l===-1)&&(l=s,c=h)),++f}return c===-1?n(i,o,e,u):c}r=e(r,e.EMPTY_OBJECT);var a,o=r.indices,u=r.maximumIndex,s=e(r.cacheSize,24),c=o.length,l=0,f=0,h=o[f],d=c;if(t(u))l=u+1;else{for(;f<d;)h>l&&(l=h),++f,h=o[f];if(l===-1)return 0;++l}for(var p=[],y=0;y<l;y++)p[y]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};f=0;for(var E=0;f<d;)p[o[f]].vertexTriangles.push(E),++p[o[f]].numLiveTriangles,p[o[f+1]].vertexTriangles.push(E),++p[o[f+1]].numLiveTriangles,p[o[f+2]].vertexTriangles.push(E),++p[o[f+2]].numLiveTriangles,++E,f+=3;var m=0,_=s+1;a=1;var v,T,R=[],A=[],g=0,S=[],N=c/3,x=[];for(y=0;y<N;y++)x[y]=!1;for(var I,O;m!==-1;){R=[],T=p[m],O=T.vertexTriangles.length;for(var w=0;w<O;++w)if(E=T.vertexTriangles[w],!x[E]){x[E]=!0,f=E+E+E;for(var M=0;M<3;++M)I=o[f],R.push(I),A.push(I),S[g]=I,++g,v=p[I],--v.numLiveTriangles,_-v.timeStamp>s&&(v.timeStamp=_,++_),++f}m=i(o,s,R,p,_,A,l)}return S},n}),define("Core/GeometryPipeline",["./AttributeCompression","./barycentricCoordinates","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EncodedCartesian3","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryType","./IndexDatatype","./Intersect","./IntersectionTests","./Math","./Matrix3","./Matrix4","./Plane","./PrimitiveType","./Tipsify"],function(e,t,r,n,i,a,o,u,s,c,l,f,h,d,p,y,E,m,_,v,T,R,A,g,S){"use strict";function N(e,t,r,n,i){e[t++]=r,e[t++]=n,e[t++]=n,e[t++]=i,e[t++]=i,e[t]=r}function x(e){for(var t=e.length,r=t/3*6,n=E.createTypedArray(t,r),i=0,a=0;a<t;a+=3,i+=6)N(n,i,e[a],e[a+1],e[a+2]);return n}function I(e){var t=e.length;if(t>=3){var r=6*(t-2),n=E.createTypedArray(t,r);N(n,0,e[0],e[1],e[2]);for(var i=6,a=3;a<t;++a,i+=6)N(n,i,e[a-1],e[a],e[a-2]);return n}return new Uint16Array}function O(e){if(e.length>0){for(var t=e.length-1,r=6*(t-1),n=E.createTypedArray(t,r),i=e[0],a=0,o=1;o<t;++o,a+=6)N(n,a,i,e[o],e[o+1]);return n}return new Uint16Array}function w(e){var t={};for(var r in e)if(e.hasOwnProperty(r)&&c(e[r])&&c(e[r].values)){var n=e[r];t[r]=new p({componentDatatype:n.componentDatatype,componentsPerAttribute:n.componentsPerAttribute,normalize:n.normalize,values:[]})}return t}function M(e,t,r){for(var n in t)if(t.hasOwnProperty(n)&&c(t[n])&&c(t[n].values))for(var i=t[n],a=0;a<i.componentsPerAttribute;++a)e[n].values.push(i.values[r*i.componentsPerAttribute+a])}function P(e,t){if(c(t))for(var r=t.values,n=r.length,a=0;a<n;a+=3)i.unpack(r,a,ae),R.multiplyByPoint(e,ae,ae),i.pack(ae,r,a)}function C(e,t){if(c(t))for(var r=t.values,n=r.length,a=0;a<n;a+=3)i.unpack(r,a,ae),T.multiplyByVector(e,ae,ae),ae=i.normalize(ae,ae),i.pack(ae,r,a)}function D(e,t){var r,n=e.length,i={},a=e[0][t].attributes;for(r in a)if(a.hasOwnProperty(r)&&c(a[r])&&c(a[r].values)){for(var o=a[r],s=o.values.length,l=!0,f=1;f<n;++f){var h=e[f][t].attributes[r];if(!c(h)||o.componentDatatype!==h.componentDatatype||o.componentsPerAttribute!==h.componentsPerAttribute||o.normalize!==h.normalize){l=!1;break}s+=h.values.length}l&&(i[r]=new p({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:u.createTypedArray(o.componentDatatype,s)}))}return i}function L(e,t){var n,a,o,u,s,l,f,h=e.length,p=(e[0].modelMatrix,c(e[0][t].indices)),y=e[0][t].primitiveType,m=D(e,t);for(n in m)if(m.hasOwnProperty(n))for(s=m[n].values,u=0,a=0;a<h;++a)for(l=e[a][t].attributes[n].values,f=l.length,o=0;o<f;++o)s[u++]=l[o];var _;if(p){var v=0;for(a=0;a<h;++a)v+=e[a][t].indices.length;var T=d.computeNumberOfVertices(new d({attributes:m,primitiveType:g.POINTS})),R=E.createTypedArray(T,v),A=0,S=0;for(a=0;a<h;++a){var N=e[a][t].indices,x=N.length;for(u=0;u<x;++u)R[A++]=S+N[u];S+=d.computeNumberOfVertices(e[a][t])}_=R}var I,O=new i,w=0;for(a=0;a<h;++a){if(I=e[a][t].boundingSphere,!c(I)){O=void 0;break}i.add(I.center,O,O)}if(c(O))for(i.divideByScalar(O,h,O),a=0;a<h;++a){I=e[a][t].boundingSphere;var M=i.magnitude(i.subtract(I.center,O,se))+I.radius;M>w&&(w=M)}return new d({attributes:m,indices:_,primitiveType:y,boundingSphere:c(O)?new r(O,w):void 0})}function U(e){if(c(e.indices))return e;for(var t=d.computeNumberOfVertices(e),r=E.createTypedArray(t,t),n=0;n<t;++n)r[n]=n;return e.indices=r,e}function b(e){var t=d.computeNumberOfVertices(e),r=E.createTypedArray(t,3*(t-2));r[0]=1,r[1]=0,r[2]=2;for(var n=3,i=3;i<t;++i)r[n++]=i-1,r[n++]=0,r[n++]=i;return e.indices=r,e.primitiveType=g.TRIANGLES,e}function F(e){var t=d.computeNumberOfVertices(e),r=E.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,i=3;i<t-1;i+=2)r[n++]=i,r[n++]=i-1,r[n++]=i+1,i+2<t&&(r[n++]=i,r[n++]=i+1,r[n++]=i+2);return e.indices=r,e.primitiveType=g.TRIANGLES,e}function z(e){if(c(e.indices))return e;for(var t=d.computeNumberOfVertices(e),r=E.createTypedArray(t,t),n=0;n<t;++n)r[n]=n;return e.indices=r,e}function B(e){var t=d.computeNumberOfVertices(e),r=E.createTypedArray(t,2*(t-1));r[0]=0,r[1]=1;for(var n=2,i=2;i<t;++i)r[n++]=i-1,r[n++]=i;return e.indices=r,e.primitiveType=g.LINES,e}function G(e){var t=d.computeNumberOfVertices(e),r=E.createTypedArray(t,2*t);r[0]=0,r[1]=1;for(var n=2,i=2;i<t;++i)r[n++]=i-1,r[n++]=i;return r[n++]=t-1,r[n]=0,e.indices=r,e.primitiveType=g.LINES,e}function q(e){switch(e.primitiveType){case g.TRIANGLE_FAN:return b(e);case g.TRIANGLE_STRIP:return F(e);case g.TRIANGLES:return U(e);case g.LINE_STRIP:return B(e);case g.LINE_LOOP:return G(e);case g.LINES:return z(e)}return e}function W(e,t){Math.abs(e.y)<v.EPSILON6&&(t?e.y=-v.EPSILON6:e.y=v.EPSILON6)}function H(e,t,r){if(0!==e.y&&0!==t.y&&0!==r.y)return W(e,e.y<0),W(t,t.y<0),void W(r,r.y<0);var n,i=Math.abs(e.y),a=Math.abs(t.y),o=Math.abs(r.y);n=i>a?i>o?v.sign(e.y):v.sign(r.y):a>o?v.sign(t.y):v.sign(r.y);var u=n<0;W(e,u),W(t,u),W(r,u)}function V(e,t,r,n){i.add(e,i.multiplyByScalar(i.subtract(t,e,Te),e.y/(e.y-t.y),Te),r),i.clone(r,n),W(r,!0),W(n,!1)}function X(e,t,r){if(!(e.x>=0||t.x>=0||r.x>=0)){H(e,t,r);var n=e.y<0,i=t.y<0,a=r.y<0,o=0;o+=n?1:0,o+=i?1:0,o+=a?1:0;var u=Ne.indices;1===o?(u[1]=3,u[2]=4,u[5]=6,u[7]=6,u[8]=5,n?(V(e,t,Re,ge),V(e,r,Ae,Se),u[0]=0,u[3]=1,u[4]=2,u[6]=1):i?(V(t,r,Re,ge),V(t,e,Ae,Se),u[0]=1,u[3]=2,u[4]=0,u[6]=2):a&&(V(r,e,Re,ge),V(r,t,Ae,Se),u[0]=2,u[3]=0,u[4]=1,u[6]=0)):2===o&&(u[2]=4,u[4]=4,u[5]=3,u[7]=5,u[8]=6,n?i?a||(V(r,e,Re,ge),V(r,t,Ae,Se),u[0]=0,u[1]=1,u[3]=0,u[6]=2):(V(t,r,Re,ge),V(t,e,Ae,Se),u[0]=2,u[1]=0,u[3]=2,u[6]=1):(V(e,t,Re,ge),V(e,r,Ae,Se),u[0]=1, -u[1]=2,u[3]=1,u[6]=0));var s=Ne.positions;return s[0]=e,s[1]=t,s[2]=r,s.length=3,1!==o&&2!==o||(s[3]=Re,s[4]=Ae,s[5]=ge,s[6]=Se,s.length=7),Ne}}function Y(e,t){var n=e.attributes;if(0!==n.position.values.length){for(var i in n)if(n.hasOwnProperty(i)&&c(n[i])&&c(n[i].values)){var a=n[i];a.values=u.createTypedArray(a.componentDatatype,a.values)}var o=d.computeNumberOfVertices(e);return e.indices=E.createTypedArray(o,e.indices),t&&(e.boundingSphere=r.fromVertices(n.position.values)),e}}function k(e){var t=e.attributes,r={};for(var n in t)if(t.hasOwnProperty(n)&&c(t[n])&&c(t[n].values)){var i=t[n];r[n]=new p({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return new d({attributes:r,indices:[],primitiveType:e.primitiveType})}function Z(e,t,r){var n=c(e.geometry.boundingSphere);t=Y(t,n),r=Y(r,n),c(r)&&!c(t)?e.geometry=r:!c(r)&&c(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=r,e.geometry=void 0)}function j(e,r,a,o,u,s,l,f,h,d,p){if(c(s)||c(l)||c(f)||c(h)){var y=i.fromArray(u,3*e,xe),E=i.fromArray(u,3*r,Ie),m=i.fromArray(u,3*a,Oe),_=t(o,y,E,m,we);if(c(s)){var v=i.fromArray(s,3*e,xe),T=i.fromArray(s,3*r,Ie),R=i.fromArray(s,3*a,Oe);i.multiplyByScalar(v,_.x,v),i.multiplyByScalar(T,_.y,T),i.multiplyByScalar(R,_.z,R);var A=i.add(v,T,v);i.add(A,R,A),i.normalize(A,A),i.pack(A,d.normal.values,3*p)}if(c(l)){var g=i.fromArray(l,3*e,xe),S=i.fromArray(l,3*r,Ie),N=i.fromArray(l,3*a,Oe);i.multiplyByScalar(g,_.x,g),i.multiplyByScalar(S,_.y,S),i.multiplyByScalar(N,_.z,N);var x=i.add(g,S,g);i.add(x,N,x),i.normalize(x,x),i.pack(x,d.binormal.values,3*p)}if(c(f)){var I=i.fromArray(f,3*e,xe),O=i.fromArray(f,3*r,Ie),w=i.fromArray(f,3*a,Oe);i.multiplyByScalar(I,_.x,I),i.multiplyByScalar(O,_.y,O),i.multiplyByScalar(w,_.z,w);var M=i.add(I,O,I);i.add(M,w,M),i.normalize(M,M),i.pack(M,d.tangent.values,3*p)}if(c(h)){var P=n.fromArray(h,2*e,Me),C=n.fromArray(h,2*r,Pe),D=n.fromArray(h,2*a,Ce);n.multiplyByScalar(P,_.x,P),n.multiplyByScalar(C,_.y,C),n.multiplyByScalar(D,_.z,D);var L=n.add(P,C,P);n.add(L,D,L),n.pack(L,d.st.values,2*p)}}}function K(e,t,r,n,i,a){var o=e.position.values.length/3;if(i!==-1){var u=n[i],s=r[u];return s===-1?(r[u]=o,e.position.values.push(a.x,a.y,a.z),t.push(o),o):(t.push(s),s)}return e.position.values.push(a.x,a.y,a.z),t.push(o),o}function J(e){var t,r,n,a,o,u=e.geometry,s=u.attributes,l=s.position.values,f=c(s.normal)?s.normal.values:void 0,h=c(s.binormal)?s.binormal.values:void 0,d=c(s.tangent)?s.tangent.values:void 0,p=c(s.st)?s.st.values:void 0,y=u.indices,E=k(u),m=k(u),_=[];_.length=l.length/3;var v=[];for(v.length=l.length/3,o=0;o<_.length;++o)_[o]=-1,v[o]=-1;var T=y.length;for(o=0;o<T;o+=3){var R=y[o],A=y[o+1],g=y[o+2],S=i.fromArray(l,3*R),N=i.fromArray(l,3*A),x=i.fromArray(l,3*g),I=X(S,N,x);if(c(I)&&I.positions.length>3)for(var O=I.positions,w=I.indices,M=w.length,P=0;P<M;++P){var C=w[P],D=O[C];D.y<0?(t=m.attributes,r=m.indices,n=_):(t=E.attributes,r=E.indices,n=v),a=K(t,r,n,y,C<3?o+C:-1,D),j(R,A,g,D,l,f,h,d,p,t,a)}else c(I)&&(S=I.positions[0],N=I.positions[1],x=I.positions[2]),S.y<0?(t=m.attributes,r=m.indices,n=_):(t=E.attributes,r=E.indices,n=v),a=K(t,r,n,y,o,S),j(R,A,g,S,l,f,h,d,p,t,a),a=K(t,r,n,y,o+1,N),j(R,A,g,N,l,f,h,d,p,t,a),a=K(t,r,n,y,o+2,x),j(R,A,g,x,l,f,h,d,p,t,a)}Z(e,m,E)}function Q(e){var t,r=e.geometry,n=r.attributes,a=n.position.values,o=r.indices,u=k(r),s=k(r),l=o.length,f=[];f.length=a.length/3;var h=[];for(h.length=a.length/3,t=0;t<f.length;++t)f[t]=-1,h[t]=-1;for(t=0;t<l;t+=2){var d=o[t],p=o[t+1],y=i.fromArray(a,3*d,xe),E=i.fromArray(a,3*p,Ie);Math.abs(y.y)<v.EPSILON6&&(y.y<0?y.y=-v.EPSILON6:y.y=v.EPSILON6),Math.abs(E.y)<v.EPSILON6&&(E.y<0?E.y=-v.EPSILON6:E.y=v.EPSILON6);var m=u.attributes,T=u.indices,R=h,A=s.attributes,g=s.indices,S=f,N=_.lineSegmentPlane(y,E,De,Oe);if(c(N)){var x=i.multiplyByScalar(i.UNIT_Y,5*v.EPSILON9,Le);y.y<0&&(i.negate(x,x),m=s.attributes,T=s.indices,R=f,A=u.attributes,g=u.indices,S=h);var I=i.add(N,x,Ue);K(m,T,R,o,t,y),K(m,T,R,o,-1,I),i.negate(x,x),i.add(N,x,I),K(A,g,S,o,-1,I),K(A,g,S,o,t+1,E)}else{var O,w,M;y.y<0?(O=s.attributes,w=s.indices,M=f):(O=u.attributes,w=u.indices,M=h),K(O,w,M,o,t,y),K(O,w,M,o,t+1,E)}}Z(e,s,u)}function $(e){for(var t=e.attributes,r=t.position.values,n=t.prevPosition.values,a=t.nextPosition.values,o=r.length,u=0;u<o;u+=3){var s=i.unpack(r,u,ze);if(!(s.x>0)){var c=i.unpack(n,u,Be);(s.y<0&&c.y>0||s.y>0&&c.y<0)&&(u-3>0?(n[u]=r[u-3],n[u+1]=r[u-2],n[u+2]=r[u-1]):i.pack(s,n,u));var l=i.unpack(a,u,Ge);(s.y<0&&l.y>0||s.y>0&&l.y<0)&&(u+3<o?(a[u]=r[u+3],a[u+1]=r[u+4],a[u+2]=r[u+5]):i.pack(s,a,u))}}}function ee(e){var t,r,o,u=e.geometry,s=u.attributes,l=s.position.values,f=s.prevPosition.values,h=s.nextPosition.values,d=s.expandAndWidth.values,p=c(s.st)?s.st.values:void 0,y=c(s.color)?s.color.values:void 0,E=k(u),m=k(u),T=!1,R=l.length/3;for(t=0;t<R;t+=4){var A=t,g=t+2,S=i.fromArray(l,3*A,ze),N=i.fromArray(l,3*g,Be);if(Math.abs(S.y)<Ye)for(S.y=Ye*(N.y<0?-1:1),l[3*t+1]=S.y,l[3*(t+1)+1]=S.y,r=3*A;r<3*A+12;r+=3)f[r]=l[3*t],f[r+1]=l[3*t+1],f[r+2]=l[3*t+2];if(Math.abs(N.y)<Ye)for(N.y=Ye*(S.y<0?-1:1),l[3*(t+2)+1]=N.y,l[3*(t+3)+1]=N.y,r=3*A;r<3*A+12;r+=3)h[r]=l[3*(t+2)],h[r+1]=l[3*(t+2)+1],h[r+2]=l[3*(t+2)+2];var x=E.attributes,I=E.indices,O=m.attributes,w=m.indices,M=_.lineSegmentPlane(S,N,De,qe);if(c(M)){T=!0;var P=i.multiplyByScalar(i.UNIT_Y,Xe,We);S.y<0&&(i.negate(P,P),x=m.attributes,I=m.indices,O=E.attributes,w=E.indices);var C=i.add(M,P,He);x.position.values.push(S.x,S.y,S.z,S.x,S.y,S.z),x.position.values.push(C.x,C.y,C.z),x.position.values.push(C.x,C.y,C.z),x.prevPosition.values.push(f[3*A],f[3*A+1],f[3*A+2]),x.prevPosition.values.push(f[3*A+3],f[3*A+4],f[3*A+5]),x.prevPosition.values.push(S.x,S.y,S.z,S.x,S.y,S.z),x.nextPosition.values.push(C.x,C.y,C.z),x.nextPosition.values.push(C.x,C.y,C.z),x.nextPosition.values.push(C.x,C.y,C.z),x.nextPosition.values.push(C.x,C.y,C.z),i.negate(P,P),i.add(M,P,C),O.position.values.push(C.x,C.y,C.z),O.position.values.push(C.x,C.y,C.z),O.position.values.push(N.x,N.y,N.z,N.x,N.y,N.z),O.prevPosition.values.push(C.x,C.y,C.z),O.prevPosition.values.push(C.x,C.y,C.z),O.prevPosition.values.push(C.x,C.y,C.z),O.prevPosition.values.push(C.x,C.y,C.z),O.nextPosition.values.push(N.x,N.y,N.z,N.x,N.y,N.z),O.nextPosition.values.push(h[3*g],h[3*g+1],h[3*g+2]),O.nextPosition.values.push(h[3*g+3],h[3*g+4],h[3*g+5]);var D=n.fromArray(d,2*A,be),L=Math.abs(D.y);x.expandAndWidth.values.push(-1,L,1,L),x.expandAndWidth.values.push(-1,-L,1,-L),O.expandAndWidth.values.push(-1,L,1,L),O.expandAndWidth.values.push(-1,-L,1,-L);var U=i.magnitudeSquared(i.subtract(M,S,Ge));if(U/=i.magnitudeSquared(i.subtract(N,S,Ge)),c(y)){var b=a.fromArray(y,4*A,Ve),F=a.fromArray(y,4*g,Ve),z=v.lerp(b.x,F.x,U),B=v.lerp(b.y,F.y,U),G=v.lerp(b.z,F.z,U),q=v.lerp(b.w,F.w,U);for(r=4*A;r<4*A+8;++r)x.color.values.push(y[r]);for(x.color.values.push(z,B,G,q),x.color.values.push(z,B,G,q),O.color.values.push(z,B,G,q),O.color.values.push(z,B,G,q),r=4*g;r<4*g+8;++r)O.color.values.push(y[r])}if(c(p)){var W=n.fromArray(p,2*A,be),H=n.fromArray(p,2*(t+3),Fe),V=v.lerp(W.x,H.x,U);for(r=2*A;r<2*A+4;++r)x.st.values.push(p[r]);for(x.st.values.push(V,W.y),x.st.values.push(V,H.y),O.st.values.push(V,W.y),O.st.values.push(V,H.y),r=2*g;r<2*g+4;++r)O.st.values.push(p[r])}o=x.position.values.length/3-4,I.push(o,o+2,o+1),I.push(o+1,o+2,o+3),o=O.position.values.length/3-4,w.push(o,o+2,o+1),w.push(o+1,o+2,o+3)}else{var X,Y;for(S.y<0?(X=m.attributes,Y=m.indices):(X=E.attributes,Y=E.indices),X.position.values.push(S.x,S.y,S.z),X.position.values.push(S.x,S.y,S.z),X.position.values.push(N.x,N.y,N.z),X.position.values.push(N.x,N.y,N.z),r=3*t;r<3*t+12;++r)X.prevPosition.values.push(f[r]),X.nextPosition.values.push(h[r]);for(r=2*t;r<2*t+8;++r)X.expandAndWidth.values.push(d[r]),c(p)&&X.st.values.push(p[r]);if(c(y))for(r=4*t;r<4*t+16;++r)X.color.values.push(y[r]);o=X.position.values.length/3-4,Y.push(o,o+2,o+1),Y.push(o+1,o+2,o+3)}}T&&($(m),$(E)),Z(e,m,E)}var te={};te.toWireframe=function(e){var t=e.indices;if(c(t)){switch(e.primitiveType){case g.TRIANGLES:e.indices=x(t);break;case g.TRIANGLE_STRIP:e.indices=I(t);break;case g.TRIANGLE_FAN:e.indices=O(t)}e.primitiveType=g.LINES}return e},te.createLineSegmentsForVectors=function(e,t,n){t=s(t,"normal"),n=s(n,1e4);for(var i=e.attributes.position.values,a=e.attributes[t].values,o=i.length,l=new Float64Array(2*o),f=0,h=0;h<o;h+=3)l[f++]=i[h],l[f++]=i[h+1],l[f++]=i[h+2],l[f++]=i[h]+a[h]*n,l[f++]=i[h+1]+a[h+1]*n,l[f++]=i[h+2]+a[h+2]*n;var y,E=e.boundingSphere;return c(E)&&(y=new r(E.center,E.radius+n)),new d({attributes:{position:new p({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:g.LINES,boundingSphere:y})},te.createAttributeLocations=function(e){var t,r=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","binormal","tangent","compressedAttributes"],n=e.attributes,i={},a=0,o=r.length;for(t=0;t<o;++t){var u=r[t];c(n[u])&&(i[u]=a++)}for(var s in n)n.hasOwnProperty(s)&&!c(i[s])&&(i[s]=a++);return i},te.reorderForPreVertexCache=function(e){var t=d.computeNumberOfVertices(e),r=e.indices;if(c(r)){for(var n=new Int32Array(t),i=0;i<t;i++)n[i]=-1;for(var a,o=r,s=o.length,l=E.createTypedArray(t,s),f=0,h=0,p=0;f<s;)a=n[o[f]],a!==-1?l[h]=a:(a=o[f],n[a]=p,l[h]=p,++p),++f,++h;e.indices=l;var y=e.attributes;for(var m in y)if(y.hasOwnProperty(m)&&c(y[m])&&c(y[m].values)){for(var _=y[m],v=_.values,T=0,R=_.componentsPerAttribute,A=u.createTypedArray(_.componentDatatype,p*R);T<t;){var g=n[T];if(g!==-1)for(i=0;i<R;i++)A[R*g+i]=v[R*T+i];++T}_.values=A}}return e},te.reorderForPostVertexCache=function(e,t){var r=e.indices;if(e.primitiveType===g.TRIANGLES&&c(r)){for(var n=r.length,i=0,a=0;a<n;a++)r[a]>i&&(i=r[a]);e.indices=S.tipsify({indices:r,maximumIndex:i,cacheSize:t})}return e},te.fitToUnsignedShortIndices=function(e){var t=[],r=d.computeNumberOfVertices(e);if(c(e.indices)&&r>=v.SIXTY_FOUR_KILOBYTES){var n,i=[],a=[],o=0,u=w(e.attributes),s=e.indices,l=s.length;e.primitiveType===g.TRIANGLES?n=3:e.primitiveType===g.LINES?n=2:e.primitiveType===g.POINTS&&(n=1);for(var f=0;f<l;f+=n){for(var h=0;h<n;++h){var p=s[f+h],y=i[p];c(y)||(y=o++,i[p]=y,M(u,e.attributes,p)),a.push(y)}o+n>=v.SIXTY_FOUR_KILOBYTES&&(t.push(new d({attributes:u,indices:a,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),i=[],a=[],o=0,u=w(e.attributes))}0!==a.length&&t.push(new d({attributes:u,indices:a,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var re=new i,ne=new o;te.projectTo2D=function(e,t,r,n,a){var o=e.attributes[t];a=c(a)?a:new h;for(var s=a.ellipsoid,l=o.values,f=new Float64Array(l.length),d=0,y=0;y<l.length;y+=3){var E=i.fromArray(l,y,re),m=s.cartesianToCartographic(E,ne),_=a.project(m,re);f[d++]=_.x,f[d++]=_.y,f[d++]=_.z}return e.attributes[r]=o,e.attributes[n]=new p({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:f}),delete e.attributes[t],e};var ie={high:0,low:0};te.encodeAttribute=function(e,t,r,n){for(var i=e.attributes[t],a=i.values,o=a.length,s=new Float32Array(o),c=new Float32Array(o),l=0;l<o;++l)f.encode(a[l],ie),s[l]=ie.high,c[l]=ie.low;var h=i.componentsPerAttribute;return e.attributes[r]=new p({componentDatatype:u.FLOAT,componentsPerAttribute:h,values:s}),e.attributes[n]=new p({componentDatatype:u.FLOAT,componentsPerAttribute:h,values:c}),delete e.attributes[t],e};var ae=new i,oe=new R,ue=new T;te.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(R.equals(t,R.IDENTITY))return e;var n=e.geometry.attributes;P(t,n.position),P(t,n.prevPosition),P(t,n.nextPosition),(c(n.normal)||c(n.binormal)||c(n.tangent))&&(R.inverse(t,oe),R.transpose(oe,oe),R.getRotation(oe,ue),C(ue,n.normal),C(ue,n.binormal),C(ue,n.tangent));var i=e.geometry.boundingSphere;return c(i)&&(e.geometry.boundingSphere=r.transform(i,t,i)),e.modelMatrix=R.clone(R.IDENTITY),e};var se=new i;te.combineInstances=function(e){for(var t=[],r=[],n=e.length,i=0;i<n;++i){var a=e[i];c(a.geometry)?t.push(a):c(a.westHemisphereGeometry)&&c(a.eastHemisphereGeometry)&&r.push(a)}var o=[];return t.length>0&&o.push(L(t,"geometry")),r.length>0&&(o.push(L(r,"westHemisphereGeometry")),o.push(L(r,"eastHemisphereGeometry"))),o};var ce=new i,le=new i,fe=new i,he=new i;te.computeNormal=function(e){for(var t=e.indices,r=e.attributes,n=r.position.values,a=r.position.values.length/3,o=t.length,s=new Array(a),c=new Array(o/3),l=new Array(o),f=0;f<a;f++)s[f]={indexOffset:0,count:0,currentCount:0};var h=0;for(f=0;f<o;f+=3){var d=t[f],y=t[f+1],E=t[f+2],m=3*d,_=3*y,v=3*E;le.x=n[m],le.y=n[m+1],le.z=n[m+2],fe.x=n[_],fe.y=n[_+1],fe.z=n[_+2],he.x=n[v],he.y=n[v+1],he.z=n[v+2],s[d].count++,s[y].count++,s[E].count++,i.subtract(fe,le,fe),i.subtract(he,le,he),c[h]=i.cross(fe,he,new i),h++}var T=0;for(f=0;f<a;f++)s[f].indexOffset+=T,T+=s[f].count;h=0;var R;for(f=0;f<o;f+=3){R=s[t[f]];var A=R.indexOffset+R.currentCount;l[A]=h,R.currentCount++,R=s[t[f+1]],A=R.indexOffset+R.currentCount,l[A]=h,R.currentCount++,R=s[t[f+2]],A=R.indexOffset+R.currentCount,l[A]=h,R.currentCount++,h++}var g=new Float32Array(3*a);for(f=0;f<a;f++){var S=3*f;if(R=s[f],R.count>0){for(i.clone(i.ZERO,ce),h=0;h<R.count;h++)i.add(ce,c[l[R.indexOffset+h]],ce);i.normalize(ce,ce),g[S]=ce.x,g[S+1]=ce.y,g[S+2]=ce.z}else g[S]=0,g[S+1]=0,g[S+2]=1}return e.attributes.normal=new p({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:g}),e};var de=new i,pe=new i,ye=new i;te.computeBinormalAndTangent=function(e){for(var t=(e.attributes,e.indices),r=e.attributes.position.values,n=e.attributes.normal.values,a=e.attributes.st.values,o=e.attributes.position.values.length/3,s=t.length,c=new Array(3*o),l=0;l<c.length;l++)c[l]=0;var f,h,d;for(l=0;l<s;l+=3){var y=t[l],E=t[l+1],m=t[l+2];f=3*y,h=3*E,d=3*m;var _=2*y,v=2*E,T=2*m,R=r[f],A=r[f+1],g=r[f+2],S=a[_],N=a[_+1],x=a[v+1]-N,I=a[T+1]-N,O=1/((a[v]-S)*I-(a[T]-S)*x),w=(I*(r[h]-R)-x*(r[d]-R))*O,M=(I*(r[h+1]-A)-x*(r[d+1]-A))*O,P=(I*(r[h+2]-g)-x*(r[d+2]-g))*O;c[f]+=w,c[f+1]+=M,c[f+2]+=P,c[h]+=w,c[h+1]+=M,c[h+2]+=P,c[d]+=w,c[d+1]+=M,c[d+2]+=P}var C=new Float32Array(3*o),D=new Float32Array(3*o);for(l=0;l<o;l++){f=3*l,h=f+1,d=f+2;var L=i.fromArray(n,f,de),U=i.fromArray(c,f,ye),b=i.dot(L,U);i.multiplyByScalar(L,b,pe),i.normalize(i.subtract(U,pe,U),U),D[f]=U.x,D[h]=U.y,D[d]=U.z,i.normalize(i.cross(L,U,U),U),C[f]=U.x,C[h]=U.y,C[d]=U.z}return e.attributes.tangent=new p({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:D}),e.attributes.binormal=new p({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:C}),e};var Ee=new n,me=new i,_e=new i,ve=new i;te.compressVertices=function(t){var r=t.attributes.normal,a=t.attributes.st;if(!c(r)&&!c(a))return t;var o,s,l,f,h=t.attributes.tangent,d=t.attributes.binormal;c(r)&&(o=r.values),c(a)&&(s=a.values),c(h)&&(l=h.values),d&&(f=d.values);var y=c(o)?o.length:s.length,E=c(o)?3:2,m=y/E,_=m,v=c(s)&&c(o)?2:1;v+=c(l)||c(f)?1:0,_*=v;for(var T=new Float32Array(_),R=0,A=0;A<m;++A){c(s)&&(n.fromArray(s,2*A,Ee),T[R++]=e.compressTextureCoordinates(Ee));var g=3*A;c(o)&&c(l)&&c(f)?(i.fromArray(o,g,me),i.fromArray(l,g,_e),i.fromArray(f,g,ve),e.octPack(me,_e,ve,Ee),T[R++]=Ee.x,T[R++]=Ee.y):(c(o)&&(i.fromArray(o,g,me),T[R++]=e.octEncodeFloat(me)),c(l)&&(i.fromArray(l,g,me),T[R++]=e.octEncodeFloat(me)),c(f)&&(i.fromArray(f,g,me),T[R++]=e.octEncodeFloat(me)))}return t.attributes.compressedAttributes=new p({componentDatatype:u.FLOAT,componentsPerAttribute:v,values:T}),c(o)&&delete t.attributes.normal,c(s)&&delete t.attributes.st,c(l)&&delete t.attributes.tangent,c(f)&&delete t.attributes.binormal,t};var Te=new i,Re=new i,Ae=new i,ge=new i,Se=new i,Ne={positions:new Array(7),indices:new Array(9)},xe=new i,Ie=new i,Oe=new i,we=new i,Me=new n,Pe=new n,Ce=new n,De=A.fromPointNormal(i.ZERO,i.UNIT_Y),Le=new i,Ue=new i,be=new n,Fe=new n,ze=new i,Be=new i,Ge=new i,qe=new i,We=new i,He=new i,Ve=new a,Xe=5*v.EPSILON9,Ye=v.EPSILON6;return te.splitLongitude=function(e){var t=e.geometry,n=t.boundingSphere;if(c(n)){var i=n.center.x-n.radius;if(i>0||r.intersectPlane(n,A.ORIGIN_ZX_PLANE)!==m.INTERSECTING)return e}if(t.geometryType!==y.NONE)switch(t.geometryType){case y.POLYLINES:ee(e);break;case y.TRIANGLES:J(e);break;case y.LINES:Q(e)}else q(t),t.primitiveType===g.TRIANGLES?J(e):t.primitiveType===g.LINES&&Q(e);return e},te}),define("Core/arrayRemoveDuplicates",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,r,n){"use strict";function i(r,n,i){if(t(r)){i=e(i,!1);var o=r.length;if(o<2)return r;var u,s,c;for(u=1;u<o&&(s=r[u-1],c=r[u],!n(s,c,a));++u);if(u===o)return i&&n(r[0],r[r.length-1],a)?r.slice(1):r;for(var l=r.slice(0,u);u<o;++u)c=r[u],n(s,c,a)||(l.push(c),s=c);return i&&l.length>1&&n(l[0],l[l.length-1],a)&&l.shift(),l}}var a=n.EPSILON10;return i}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.binormal=t.binormal,this.tangent=t.tangent,this.color=t.color}return t}),define("ThirdParty/earcut-2.1.1",[],function(){"use strict";function e(e,r,i){i=i||2;var a=r&&r.length,o=a?r[0]*i:e.length,u=t(e,0,o,i,!0),c=[];if(!u)return c;var l,f,h,d,p,y,E;if(a&&(u=s(e,r,u,i)),e.length>80*i){l=h=e[0],f=d=e[1];for(var m=i;m<o;m+=i)p=e[m],y=e[m+1],p<l&&(l=p),y<f&&(f=y),p>h&&(h=p),y>d&&(d=y);E=Math.max(h-l,d-f)}return n(u,c,i,l,f,E),c}function t(e,t,r,n,i){var a,o;if(i===O(e,t,r,n)>0)for(a=t;a<r;a+=n)o=N(a,e[a],e[a+1],o);else for(a=r-n;a>=t;a-=n)o=N(a,e[a],e[a+1],o);return o&&v(o,o.next)&&(x(o),o=o.next),o}function r(e,t){if(!e)return e;t||(t=e);var r,n=e;do if(r=!1,n.steiner||!v(n,n.next)&&0!==_(n.prev,n,n.next))n=n.next;else{if(x(n),n=t=n.prev,n===n.next)return null;r=!0}while(r||n!==t);return t}function n(e,t,s,c,l,f,d){if(e){!d&&f&&h(e,c,l,f);for(var p,y,E=e;e.prev!==e.next;)if(p=e.prev,y=e.next,f?a(e,c,l,f):i(e))t.push(p.i/s),t.push(e.i/s),t.push(y.i/s),x(e),e=y.next,E=y.next;else if(e=y,e===E){d?1===d?(e=o(e,t,s),n(e,t,s,c,l,f,2)):2===d&&u(e,t,s,c,l,f):n(r(e),t,s,c,l,f,1);break}}}function i(e){var t=e.prev,r=e,n=e.next;if(_(t,r,n)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(E(t.x,t.y,r.x,r.y,n.x,n.y,i.x,i.y)&&_(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function a(e,t,r,n){var i=e.prev,a=e,o=e.next;if(_(i,a,o)>=0)return!1;for(var u=i.x<a.x?i.x<o.x?i.x:o.x:a.x<o.x?a.x:o.x,s=i.y<a.y?i.y<o.y?i.y:o.y:a.y<o.y?a.y:o.y,c=i.x>a.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,l=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,f=p(u,s,t,r,n),h=p(c,l,t,r,n),d=e.nextZ;d&&d.z<=h;){if(d!==e.prev&&d!==e.next&&E(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&_(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(d=e.prevZ;d&&d.z>=f;){if(d!==e.prev&&d!==e.next&&E(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&_(d.prev,d,d.next)>=0)return!1;d=d.prevZ}return!0}function o(e,t,r){var n=e;do{var i=n.prev,a=n.next.next;!v(i,a)&&T(i,n,n.next,a)&&A(i,a)&&A(a,i)&&(t.push(i.i/r),t.push(n.i/r),t.push(a.i/r),x(n),x(n.next),n=e=a),n=n.next}while(n!==e);return n}function u(e,t,i,a,o,u){var s=e;do{for(var c=s.next.next;c!==s.prev;){if(s.i!==c.i&&m(s,c)){var l=S(s,c);return s=r(s,s.next),l=r(l,l.next),n(s,t,i,a,o,u),void n(l,t,i,a,o,u)}c=c.next}s=s.next}while(s!==e)}function s(e,n,i,a){var o,u,s,f,h,d=[];for(o=0,u=n.length;o<u;o++)s=n[o]*a,f=o<u-1?n[o+1]*a:e.length,h=t(e,s,f,a,!1),h===h.next&&(h.steiner=!0),d.push(y(h));for(d.sort(c),o=0;o<d.length;o++)l(d[o],i),i=r(i,i.next);return i}function c(e,t){return e.x-t.x}function l(e,t){if(t=f(e,t)){var n=S(t,e);r(n,n.next)}}function f(e,t){var r,n=t,i=e.x,a=e.y,o=-(1/0);do{if(a<=n.y&&a>=n.next.y){var u=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(u<=i&&u>o){if(o=u,u===i){if(a===n.y)return n;if(a===n.next.y)return n.next}r=n.x<n.next.x?n:n.next}}n=n.next}while(n!==t);if(!r)return null;if(i===o)return r.prev;var s,c=r,l=r.x,f=r.y,h=1/0;for(n=r.next;n!==c;)i>=n.x&&n.x>=l&&E(a<f?i:o,a,l,f,a<f?o:i,a,n.x,n.y)&&(s=Math.abs(a-n.y)/(i-n.x),(s<h||s===h&&n.x>r.x)&&A(n,e)&&(r=n,h=s)),n=n.next;return r}function h(e,t,r,n){var i=e;do null===i.z&&(i.z=p(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,d(i)}function d(e){var t,r,n,i,a,o,u,s,c=1;do{for(r=e,e=null,a=null,o=0;r;){for(o++,n=r,u=0,t=0;t<c&&(u++,n=n.nextZ,n);t++);for(s=c;u>0||s>0&&n;)0===u?(i=n,n=n.nextZ,s--):0!==s&&n?r.z<=n.z?(i=r,r=r.nextZ,u--):(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,u--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;r=n}a.nextZ=null,c*=2}while(o>1);return e}function p(e,t,r,n,i){return e=32767*(e-r)/i,t=32767*(t-n)/i,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function y(e){var t=e,r=e;do t.x<r.x&&(r=t),t=t.next;while(t!==e);return r}function E(e,t,r,n,i,a,o,u){return(i-o)*(t-u)-(e-o)*(a-u)>=0&&(e-o)*(n-u)-(r-o)*(t-u)>=0&&(r-o)*(a-u)-(i-o)*(n-u)>=0}function m(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!R(e,t)&&A(e,t)&&A(t,e)&&g(e,t)}function _(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function v(e,t){return e.x===t.x&&e.y===t.y}function T(e,t,r,n){return!!(v(e,t)&&v(r,n)||v(e,n)&&v(r,t))||_(e,t,r)>0!=_(e,t,n)>0&&_(r,n,e)>0!=_(r,n,t)>0}function R(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&T(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}function A(e,t){return _(e.prev,e,e.next)<0?_(e,t,e.next)>=0&&_(e,e.prev,t)>=0:_(e,t,e.prev)<0||_(e,e.next,t)<0}function g(e,t){var r=e,n=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do r.y>a!=r.next.y>a&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next;while(r!==e);return n}function S(e,t){var r=new I(e.i,e.x,e.y),n=new I(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function N(e,t,r,n){var i=new I(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function x(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function I(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function O(e,t,r,n){for(var i=0,a=t,o=r-n;a<r;a+=n)i+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return i}return e.deviation=function(e,t,r,n){var i=t&&t.length,a=i?t[0]*r:e.length,o=Math.abs(O(e,0,a,r));if(i)for(var u=0,s=t.length;u<s;u++){var c=t[u]*r,l=u<s-1?t[u+1]*r:e.length;o-=Math.abs(O(e,c,l,r))}var f=0;for(u=0;u<n.length;u+=3){var h=n[u]*r,d=n[u+1]*r,p=n[u+2]*r;f+=Math.abs((e[h]-e[p])*(e[d+1]-e[h+1])-(e[h]-e[d])*(e[p+1]-e[h+1]))}return 0===o&&0===f?0:Math.abs((f-o)/o)},e.flatten=function(e){for(var t=e[0][0].length,r={vertices:[],holes:[],dimensions:t},n=0,i=0;i<e.length;i++){for(var a=0;a<e[i].length;a++)for(var o=0;o<t;o++)r.vertices.push(e[i][a][o]);i>0&&(n+=e[i-1].length,r.holes.push(n))}return r},e}),define("Core/WindingOrder",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var r={CLOCKWISE:t.CW,COUNTER_CLOCKWISE:t.CCW,validate:function(e){return e===r.CLOCKWISE||e===r.COUNTER_CLOCKWISE}};return e(r)}),define("Core/PolygonPipeline",["../ThirdParty/earcut-2.1.1","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./Math","./PrimitiveType","./WindingOrder"],function(e,t,r,n,i,a,o,u,s,c,l,f,h){"use strict";var d=new r,p=new r,y={};y.computeArea2D=function(e){for(var t=e.length,r=0,n=t-1,i=0;i<t;n=i++){var a=e[n],o=e[i];r+=a.x*o.y-o.x*a.y}return.5*r},y.computeWindingOrder2D=function(e){var t=y.computeArea2D(e);return t>0?h.COUNTER_CLOCKWISE:h.CLOCKWISE},y.triangulate=function(r,n){var i=t.packArray(r);return e(i,n,2)};var E=new r,m=new r,_=new r,v=new r,T=new r,R=new r,A=new r;return y.computeSubdivision=function(e,t,o,u){u=i(u,l.RADIANS_PER_DEGREE);var h,d=o.slice(0),p=t.length,y=new Array(3*p),g=0;for(h=0;h<p;h++){var S=t[h];y[g++]=S.x,y[g++]=S.y,y[g++]=S.z}for(var N=[],x={},I=e.maximumRadius,O=l.chordLength(u,I),w=O*O;d.length>0;){var M,P,C=d.pop(),D=d.pop(),L=d.pop(),U=r.fromArray(y,3*L,E),b=r.fromArray(y,3*D,m),F=r.fromArray(y,3*C,_),z=r.multiplyByScalar(r.normalize(U,v),I,v),B=r.multiplyByScalar(r.normalize(b,T),I,T),G=r.multiplyByScalar(r.normalize(F,R),I,R),q=r.magnitudeSquared(r.subtract(z,B,A)),W=r.magnitudeSquared(r.subtract(B,G,A)),H=r.magnitudeSquared(r.subtract(G,z,A)),V=Math.max(q,W,H);V>w?q===V?(M=Math.min(L,D)+" "+Math.max(L,D),h=x[M],a(h)||(P=r.add(U,b,A),r.multiplyByScalar(P,.5,P),y.push(P.x,P.y,P.z),h=y.length/3-1,x[M]=h),d.push(L,h,C),d.push(h,D,C)):W===V?(M=Math.min(D,C)+" "+Math.max(D,C),h=x[M],a(h)||(P=r.add(b,F,A),r.multiplyByScalar(P,.5,P),y.push(P.x,P.y,P.z),h=y.length/3-1,x[M]=h),d.push(D,h,L),d.push(h,C,L)):H===V&&(M=Math.min(C,L)+" "+Math.max(C,L),h=x[M],a(h)||(P=r.add(F,U,A),r.multiplyByScalar(P,.5,P),y.push(P.x,P.y,P.z),h=y.length/3-1,x[M]=h),d.push(C,h,D),d.push(h,L,D)):(N.push(L),N.push(D),N.push(C))}return new s({attributes:{position:new c({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:y})},indices:N,primitiveType:f.TRIANGLES})},y.scaleToGeodeticHeight=function(e,t,n,o){n=i(n,u.WGS84);var s=d,c=p;if(t=i(t,0),o=i(o,!0),a(e))for(var l=e.length,f=0;f<l;f+=3)r.fromArray(e,f,c),o&&(c=n.scaleToGeodeticSurface(c,c)),0!==t&&(s=n.geodeticSurfaceNormal(c,s),r.multiplyByScalar(s,t,s),r.add(c,s,c)),e[f]=c.x,e[f+1]=c.y,e[f+2]=c.z;return e},y}),define("Core/Queue",["./defineProperties"],function(e){"use strict";function t(){this._array=[],this._offset=0,this._length=0}return e(t.prototype,{length:{get:function(){return this._length}}}),t.prototype.enqueue=function(e){this._array.push(e),this._length++},t.prototype.dequeue=function(){if(0!==this._length){var e=this._array,t=this._offset,r=e[t];return e[t]=void 0,t++,t>10&&2*t>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,r}},t.prototype.peek=function(){if(0!==this._length)return this._array[this._offset]},t.prototype.contains=function(e){return this._array.indexOf(e)!==-1},t.prototype.clear=function(){this._array.length=this._offset=this._length=0},t.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)},t}),define("Core/PolygonGeometryLibrary",["./arrayRemoveDuplicates","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryPipeline","./IndexDatatype","./Math","./PolygonPipeline","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,r,n,i,a,o,u,s,c,l,f,h,d,p,y){"use strict";function E(e,r,n,i){return t.subtract(r,e,_),t.multiplyByScalar(_,n/i,_),t.add(e,_,_),[_.x,_.y,_.z]}var m={};m.computeHierarchyPackedLength=function(e){for(var r=0,n=[e];n.length>0;){var a=n.pop();if(i(a)){r+=2;var o=a.positions,u=a.holes;if(i(o)&&(r+=o.length*t.packedLength),i(u))for(var s=u.length,c=0;c<s;++c)n.push(u[c])}}return r},m.packPolygonHierarchy=function(e,r,n){for(var a=[e];a.length>0;){var o=a.pop();if(i(o)){var u=o.positions,s=o.holes;if(r[n++]=i(u)?u.length:0,r[n++]=i(s)?s.length:0,i(u))for(var c=u.length,l=0;l<c;++l,n+=3)t.pack(u[l],r,n);if(i(s))for(var f=s.length,h=0;h<f;++h)a.push(s[h])}}return n},m.unpackPolygonHierarchy=function(e,r){for(var n=e[r++],i=e[r++],a=new Array(n),o=i>0?new Array(i):void 0,u=0;u<n;++u,r+=t.packedLength)a[u]=t.unpack(e,r);for(var s=0;s<i;++s)o[s]=m.unpackPolygonHierarchy(e,r),r=o[s].startingIndex,delete o[s].startingIndex;return{positions:a,holes:o,startingIndex:r}};var _=new t;m.subdivideLineCount=function(e,r,n){var i=t.distance(e,r),a=i/n,o=Math.max(0,Math.ceil(Math.log(a)/Math.log(2)));return Math.pow(2,o)},m.subdivideLine=function(e,r,n,a){var o=m.subdivideLineCount(e,r,n),u=t.distance(e,r),s=u/o;i(a)||(a=[]);var c=a;c.length=3*o;for(var l=0,f=0;f<o;f++){var h=E(e,r,f*s,u);c[l++]=h[0],c[l++]=h[1],c[l++]=h[2]}return c};var v=new t,T=new t,R=new t,A=new t;m.scaleToGeodeticHeightExtruded=function(e,r,o,u,s){u=n(u,a.WGS84);var c=v,l=T,f=R,h=A;if(i(e)&&i(e.attributes)&&i(e.attributes.position))for(var d=e.attributes.position.values,p=d.length/2,y=0;y<p;y+=3)t.fromArray(d,y,f),u.geodeticSurfaceNormal(f,c),h=u.scaleToGeodeticSurface(f,h),l=t.multiplyByScalar(c,o,l),l=t.add(h,l,l),d[y+p]=l.x,d[y+1+p]=l.y,d[y+2+p]=l.z,s&&(h=t.clone(f,h)),l=t.multiplyByScalar(c,r,l),l=t.add(h,l,l),d[y]=l.x,d[y+1]=l.y,d[y+2]=l.z;return e},m.polygonsFromHierarchy=function(r,n,a,o){var u=[],s=[],c=new p;for(c.enqueue(r);0!==c.length;){var l=c.dequeue(),f=l.positions,d=l.holes;if(f=e(f,t.equalsEpsilon,!0),!(f.length<3)){var E=a.projectPointsOntoPlane(f),m=[],_=h.computeWindingOrder2D(E);_===y.CLOCKWISE&&(E.reverse(),f=f.slice().reverse());var v,T,R=f.slice(),A=i(d)?d.length:0,g=[];for(v=0;v<A;v++){var S=d[v],N=e(S.positions,t.equalsEpsilon,!0);if(!(N.length<3)){var x=a.projectPointsOntoPlane(N);_=h.computeWindingOrder2D(x),_===y.CLOCKWISE&&(x.reverse(),N=N.slice().reverse()),g.push(N),m.push(R.length),R=R.concat(N),E=E.concat(x);var I=0;for(i(S.holes)&&(I=S.holes.length),T=0;T<I;T++)c.enqueue(S.holes[T])}}if(!n){for(v=0;v<f.length;v++)o.scaleToGeodeticSurface(f[v],f[v]);for(v=0;v<g.length;v++){var O=g[v];for(T=0;T<O.length;++T)o.scaleToGeodeticSurface(O[T],O[T])}}u.push({outerRing:f,holes:g}),s.push({positions:R,positions2D:E,holes:m})}}return{hierarchy:u,polygons:s}},m.createGeometryFromPositions=function(e,t,n,i,a){var s=h.triangulate(t.positions2D,t.holes);s.length<3&&(s=[0,1,2]);var l=t.positions;if(i){for(var f=l.length,p=new Array(3*f),y=0,E=0;E<f;E++){var m=l[E];p[y++]=m.x,p[y++]=m.y,p[y++]=m.z}var _=new o({attributes:{position:new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:p})},indices:s,primitiveType:d.TRIANGLES});return a.normal?c.computeNormal(_):_}return h.computeSubdivision(e,l,s,n)};var g=[],S=new t,N=new t;return m.computeWallGeometry=function(e,n,i,a){var c,h,p,y,E,_=e.length,v=0;if(a)for(h=3*_*2,c=new Array(2*h),p=0;p<_;p++)y=e[p],E=e[(p+1)%_],c[v]=c[v+h]=y.x,++v,c[v]=c[v+h]=y.y,++v,c[v]=c[v+h]=y.z,++v,c[v]=c[v+h]=E.x,++v,c[v]=c[v+h]=E.y,++v,c[v]=c[v+h]=E.z,++v;else{var T=f.chordLength(i,n.maximumRadius),R=0;for(p=0;p<_;p++)R+=m.subdivideLineCount(e[p],e[(p+1)%_],T);for(h=3*(R+_),c=new Array(2*h),p=0;p<_;p++){y=e[p],E=e[(p+1)%_];for(var A=m.subdivideLine(y,E,T,g),x=A.length,I=0;I<x;++I,++v)c[v]=A[I],c[v+h]=A[I];c[v]=E.x,c[v+h]=E.x,++v,c[v]=E.y,c[v+h]=E.y,++v,c[v]=E.z,c[v+h]=E.z,++v}}_=c.length;var O=l.createTypedArray(_/3,_-6*e.length),w=0;for(_/=6,p=0;p<_;p++){var M=p,P=M+1,C=M+_,D=C+1;y=t.fromArray(c,3*M,S),E=t.fromArray(c,3*P,N),t.equalsEpsilon(y,E,f.EPSILON14)||(O[w++]=M,O[w++]=C,O[w++]=P,O[w++]=P,O[w++]=C,O[w++]=D)}return new o({attributes:new s({position:new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:c})}),indices:O,primitiveType:d.TRIANGLES})},m}),define("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,r,n){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.position=e(t.position,!1),this.normal=e(t.normal,!1),this.st=e(t.st,!1),this.binormal=e(t.binormal,!1),this.tangent=e(t.tangent,!1),this.color=e(t.color,!1)}return i.POSITION_ONLY=n(new i({position:!0})),i.POSITION_AND_NORMAL=n(new i({position:!0,normal:!0})),i.POSITION_NORMAL_AND_ST=n(new i({position:!0,normal:!0,st:!0})),i.POSITION_AND_ST=n(new i({position:!0,st:!0})),i.POSITION_AND_COLOR=n(new i({position:!0,color:!0})),i.ALL=n(new i({position:!0,normal:!0,st:!0,binormal:!0,tangent:!0})),i.DEFAULT=i.POSITION_NORMAL_AND_ST,i.packedLength=6,i.pack=function(t,r,n){return n=e(n,0),r[n++]=t.position?1:0,r[n++]=t.normal?1:0,r[n++]=t.st?1:0,r[n++]=t.binormal?1:0,r[n++]=t.tangent?1:0,r[n++]=t.color?1:0,r},i.unpack=function(r,n,a){return n=e(n,0),t(a)||(a=new i),a.position=1===r[n++],a.normal=1===r[n++],a.st=1===r[n++],a.binormal=1===r[n++],a.tangent=1===r[n++],a.color=1===r[n++],a},i.clone=function(e,r){if(t(e))return t(r)||(r=new i),r.position=e.position,r.normal=e.normal, -r.st=e.st,r.binormal=e.binormal,r.tangent=e.tangent,r.color=e.color,r},i}),define("Core/PolygonGeometry",["./BoundingRectangle","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix3","./PolygonGeometryLibrary","./PolygonPipeline","./Quaternion","./Rectangle","./VertexFormat","./WindingOrder"],function(e,t,r,n,i,a,o,u,s,c,l,f,h,d,p,y,E,m,_,v,T,R,A,g,S){"use strict";function N(e,t,r,i){for(var a=R.fromAxisAngle(e._plane.normal,r,C),o=_.fromQuaternion(a,D),s=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,l=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,h=t.length,d=0;d<h;++d){var p=n.clone(t[d],P);_.multiplyByVector(o,p,p);var y=e.projectPointOntoPlane(p,M);u(y)&&(s=Math.min(s,y.x),c=Math.max(c,y.x),l=Math.min(l,y.y),f=Math.max(f,y.y))}return i.x=s,i.y=l,i.width=c-s,i.height=f-l,i}function x(e,t,r,n){var i=n.cartesianToCartographic(e,L),a=i.height,o=n.cartesianToCartographic(t,U);o.height=a,n.cartographicToCartesian(o,t);var u=n.cartesianToCartographic(r,U);u.height=a-100,n.cartographicToCartesian(u,r)}function I(e){var t=e.vertexFormat,i=e.geometry;if(t.st||t.normal||t.tangent||t.binormal){var o=e.boundingRectangle,u=e.tangentPlane,s=e.ellipsoid,c=e.stRotation,l=e.wall,f=e.top||l,h=e.bottom||l,p=e.perPositionHeight,y=Y;y.x=o.x,y.y=o.y;var E,v=i.attributes.position.values,T=v.length,A=t.st?new Float32Array(2*(T/3)):void 0;t.normal&&(E=p&&f&&!l?i.attributes.normal.values:new Float32Array(T));var g=t.tangent?new Float32Array(T):void 0,S=t.binormal?new Float32Array(T):void 0,N=0,I=0,O=z,w=B,M=G,P=!0,C=R.fromAxisAngle(u._plane.normal,c,j),D=_.fromQuaternion(C,K),L=0,U=0;f&&h&&(L=T/2,U=T/3,T/=2);for(var b=0;b<T;b+=3){var J=n.fromArray(v,b,Z);if(t.st){var Q=_.multiplyByVector(D,J,F);Q=s.scaleToGeodeticSurface(Q,Q);var $=u.projectPointOntoPlane(Q,k);r.subtract($,y,$);var ee=m.clamp($.x/o.width,0,1),te=m.clamp($.y/o.height,0,1);h&&(A[N+U]=ee,A[N+1+U]=te),f&&(A[N]=ee,A[N+1]=te),N+=2}if(t.normal||t.tangent||t.binormal){var re=I+1,ne=I+2;if(l){if(b+3<T){var ie=n.fromArray(v,b+3,q);if(P){var ae=n.fromArray(v,b+T,W);p&&x(J,ie,ae,s),n.subtract(ie,J,ie),n.subtract(ae,J,ae),O=n.normalize(n.cross(ae,ie,O),O),P=!1}n.equalsEpsilon(ie,J,m.EPSILON10)&&(P=!0)}(t.tangent||t.binormal)&&(M=s.geodeticSurfaceNormal(J,M),t.tangent&&(w=n.normalize(n.cross(M,O,w),w)))}else O=s.geodeticSurfaceNormal(J,O),(t.tangent||t.binormal)&&(p&&(H=n.fromArray(E,I,H),V=n.cross(n.UNIT_Z,H,V),V=n.normalize(_.multiplyByVector(D,V,V),V),t.binormal&&(X=n.normalize(n.cross(H,V,X),X))),w=n.cross(n.UNIT_Z,O,w),w=n.normalize(_.multiplyByVector(D,w,w),w),t.binormal&&(M=n.normalize(n.cross(O,w,M),M)));t.normal&&(e.wall?(E[I+L]=O.x,E[re+L]=O.y,E[ne+L]=O.z):h&&(E[I+L]=-O.x,E[re+L]=-O.y,E[ne+L]=-O.z),(f&&!p||l)&&(E[I]=O.x,E[re]=O.y,E[ne]=O.z)),t.tangent&&(e.wall?(g[I+L]=w.x,g[re+L]=w.y,g[ne+L]=w.z):h&&(g[I+L]=-w.x,g[re+L]=-w.y,g[ne+L]=-w.z),f&&(p?(g[I]=V.x,g[re]=V.y,g[ne]=V.z):(g[I]=w.x,g[re]=w.y,g[ne]=w.z))),t.binormal&&(h&&(S[I+L]=M.x,S[re+L]=M.y,S[ne+L]=M.z),f&&(p?(S[I]=X.x,S[re]=X.y,S[ne]=X.z):(S[I]=M.x,S[re]=M.y,S[ne]=M.z))),I+=3}}t.st&&(i.attributes.st=new d({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:A})),t.normal&&(i.attributes.normal=new d({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:E})),t.tangent&&(i.attributes.tangent=new d({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:g})),t.binormal&&(i.attributes.binormal=new d({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:S}))}return i}function O(e,t,r,n,i,a,o,u){var s,c={walls:[]};if(a||o){var l,h,d=v.createGeometryFromPositions(e,t,r,i,u),y=d.attributes.position.values,m=d.indices;if(a&&o){var _=y.concat(y);l=_.length/3,h=E.createTypedArray(l,2*m.length),h.set(m);var R=m.length,A=l/2;for(s=0;s<R;s+=3){var g=h[s]+A,N=h[s+1]+A,x=h[s+2]+A;h[s+R]=x,h[s+1+R]=N,h[s+2+R]=g}if(d.attributes.position.values=_,i){var I=d.attributes.normal.values;d.attributes.normal.values=new Float32Array(_.length),d.attributes.normal.values.set(I)}d.indices=h}else if(o){for(l=y.length/3,h=E.createTypedArray(l,m.length),s=0;s<m.length;s+=3)h[s]=m[s+2],h[s+1]=m[s+1],h[s+2]=m[s];d.indices=h}c.topAndBottom=new p({geometry:d})}var O=n.outerRing,w=f.fromPoints(O,e),M=w.projectPointsOntoPlane(O,J),P=T.computeWindingOrder2D(M);P===S.CLOCKWISE&&(O=O.slice().reverse());var C=v.computeWallGeometry(O,e,r,i);c.walls.push(new p({geometry:C}));var D=n.holes;for(s=0;s<D.length;s++){var L=D[s];w=f.fromPoints(L,e),M=w.projectPointsOntoPlane(L,J),P=T.computeWindingOrder2D(M),P===S.COUNTER_CLOCKWISE&&(L=L.slice().reverse()),C=v.computeWallGeometry(L,e,r),c.walls.push(new p({geometry:C}))}return c}function w(e){var t=e.polygonHierarchy,r=o(e.vertexFormat,g.DEFAULT),n=o(e.ellipsoid,l.WGS84),i=o(e.granularity,m.RADIANS_PER_DEGREE),a=o(e.stRotation,0),s=o(e.height,0),c=o(e.perPositionHeight,!1),f=e.extrudedHeight,h=u(f);if(!c&&h)if(m.equalsEpsilon(s,f,m.EPSILON10))f=void 0,h=!1;else{var d=f;f=Math.min(d,s),s=Math.max(d,s)}this._vertexFormat=g.clone(r),this._ellipsoid=l.clone(n),this._granularity=i,this._stRotation=a,this._height=s,this._extrudedHeight=o(f,0),this._extrude=h,this._closeTop=o(e.closeTop,!0),this._closeBottom=o(e.closeBottom,!0),this._polygonHierarchy=t,this._perPositionHeight=c,this._workerName="createPolygonGeometry";var p=t.positions;!u(p)||p.length<3?this._rectangle=new A:this._rectangle=A.fromCartesianArray(p,n),this.packedLength=v.computeHierarchyPackedLength(t)+l.packedLength+g.packedLength+A.packedLength+9}var M=new r,P=new n,C=new R,D=new _,L=new i,U=new i,b=new e,F=new n,z=new n,B=new n,G=new n,q=new n,W=new n,H=new n,V=new n,X=new n,Y=new r,k=new r,Z=new n,j=new R,K=new _,J=[];w.fromPositions=function(e){e=o(e,o.EMPTY_OBJECT);var t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,closeTop:e.closeTop,closeBottom:e.closeBottom};return new w(t)},w.pack=function(e,t,r){return r=o(r,0),r=v.packPolygonHierarchy(e._polygonHierarchy,t,r),l.pack(e._ellipsoid,t,r),r+=l.packedLength,g.pack(e._vertexFormat,t,r),r+=g.packedLength,A.pack(e._rectangle,t,r),r+=A.packedLength,t[r++]=e._height,t[r++]=e._extrudedHeight,t[r++]=e._granularity,t[r++]=e._stRotation,t[r++]=e._extrude?1:0,t[r++]=e._perPositionHeight?1:0,t[r++]=e._closeTop?1:0,t[r++]=e._closeBottom?1:0,t[r]=e.packedLength,t};var Q=l.clone(l.UNIT_SPHERE),$=new g,ee=new A,te={polygonHierarchy:{}};return w.unpack=function(e,t,r){t=o(t,0);var n=v.unpackPolygonHierarchy(e,t);t=n.startingIndex,delete n.startingIndex;var i=l.unpack(e,t,Q);t+=l.packedLength;var a=g.unpack(e,t,$);t+=g.packedLength;var s=A.unpack(e,t,ee);t+=A.packedLength;var c=e[t++],f=e[t++],h=e[t++],d=e[t++],p=1===e[t++],y=1===e[t++],E=1===e[t++],m=1===e[t++],_=e[t];return u(r)||(r=new w(te)),r._polygonHierarchy=n,r._ellipsoid=l.clone(i,r._ellipsoid),r._vertexFormat=g.clone(a,r._vertexFormat),r._height=c,r._extrudedHeight=f,r._granularity=h,r._stRotation=d,r._extrude=p,r._perPositionHeight=y,r._closeTop=E,r._closeBottom=m,r._rectangle=A.clone(s),r.packedLength=_,r},w.createGeometry=function(e){var r=e._vertexFormat,n=e._ellipsoid,i=e._granularity,a=e._stRotation,o=e._height,u=e._extrudedHeight,s=e._extrude,c=e._polygonHierarchy,l=e._perPositionHeight,d=e._closeTop,m=e._closeBottom,_=c.positions;if(!(_.length<3)){var R=f.fromPoints(_,n),A=v.polygonsFromHierarchy(c,l,R,n),g=A.hierarchy,S=A.polygons;if(0!==g.length){_=g[0].outerRing;var x,w,M=N(R,_,a,b),P=[],C={perPositionHeight:l,vertexFormat:r,geometry:void 0,tangentPlane:R,boundingRectangle:M,ellipsoid:n,stRotation:a,bottom:!1,top:!0,wall:!1};if(s)for(C.top=d,C.bottom=m,w=0;w<S.length;w++){x=O(n,S[w],i,g[w],l,d,m,r);var D;d&&m?(D=x.topAndBottom,C.geometry=v.scaleToGeodeticHeightExtruded(D.geometry,o,u,n,l)):d?(D=x.topAndBottom,D.geometry.attributes.position.values=T.scaleToGeodeticHeight(D.geometry.attributes.position.values,o,n,!l),C.geometry=D.geometry):m&&(D=x.topAndBottom,D.geometry.attributes.position.values=T.scaleToGeodeticHeight(D.geometry.attributes.position.values,u,n,!0),C.geometry=D.geometry),(d||m)&&(C.wall=!1,D.geometry=I(C),P.push(D));var L=x.walls;C.wall=!0;for(var U=0;U<L.length;U++){var F=L[U];C.geometry=v.scaleToGeodeticHeightExtruded(F.geometry,o,u,n,l),F.geometry=I(C),P.push(F)}}else for(w=0;w<S.length;w++)x=new p({geometry:v.createGeometryFromPositions(n,S[w],i,l,r)}),x.geometry.attributes.position.values=T.scaleToGeodeticHeight(x.geometry.attributes.position.values,o,n,!l),C.geometry=x.geometry,x.geometry=I(C),P.push(x);x=y.combineInstances(P)[0],x.attributes.position.values=new Float64Array(x.attributes.position.values),x.indices=E.createTypedArray(x.attributes.position.values.length/3,x.indices);var z=x.attributes,B=t.fromVertices(z.position.values);return r.position||delete z.position,new h({attributes:z,indices:x.indices,primitiveType:x.primitiveType,boundingSphere:B})}}},w.createShadowVolume=function(e,t,r){var n=e._granularity,i=e._ellipsoid,a=t(n,i),o=r(n,i);return new w({polygonHierarchy:e._polygonHierarchy,ellipsoid:i,stRotation:e._stRotation,granularity:n,perPositionHeight:!1,extrudedHeight:a,height:o,vertexFormat:g.POSITION_ONLY})},s(w.prototype,{rectangle:{get:function(){return this._rectangle}}}),w}),define("Workers/createPolygonGeometry",["../Core/defined","../Core/Ellipsoid","../Core/PolygonGeometry"],function(e,t,r){"use strict";function n(n,i){return e(i)&&(n=r.unpack(n,i)),n._ellipsoid=t.clone(n._ellipsoid),r.createGeometry(n)}return n})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e){return e+" is required, actual value was undefined"}function r(e,t,n){return"Expected "+n+" to be typeof "+t+", actual typeof was "+e}var i={};return i.typeOf={},i.defined=function(r,i){if(!e(i))throw new t(n(r))},i.typeOf.func=function(e,n){if("function"!=typeof n)throw new t(r(typeof n,"function",e))},i.typeOf.string=function(e,n){if("string"!=typeof n)throw new t(r(typeof n,"string",e))},i.typeOf.number=function(e,n){if("number"!=typeof n)throw new t(r(typeof n,"number",e))},i.typeOf.number.lessThan=function(e,n,r){if(i.typeOf.number(e,n),n>=r)throw new t("Expected "+e+" to be less than "+r+", actual value was "+n)},i.typeOf.number.lessThanOrEquals=function(e,n,r){if(i.typeOf.number(e,n),n>r)throw new t("Expected "+e+" to be less than or equal to "+r+", actual value was "+n)},i.typeOf.number.greaterThan=function(e,n,r){if(i.typeOf.number(e,n),n<=r)throw new t("Expected "+e+" to be greater than "+r+", actual value was "+n)},i.typeOf.number.greaterThanOrEquals=function(e,n,r){if(i.typeOf.number(e,n),n<r)throw new t("Expected "+e+" to be greater than or equal to"+r+", actual value was "+n)},i.typeOf.object=function(e,n){if("object"!=typeof n)throw new t(r(typeof n,"object",e))},i.typeOf.bool=function(e,n){if("boolean"!=typeof n)throw new t(r(typeof n,"boolean",e))},i}),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";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),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 n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(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^=e<<7&2636928640,e^=e<<15&4022730752,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,n,r){"use strict";var i={};i.EPSILON1=.1,i.EPSILON2=.01,i.EPSILON3=.001,i.EPSILON4=1e-4,i.EPSILON5=1e-5,i.EPSILON6=1e-6,i.EPSILON7=1e-7,i.EPSILON8=1e-8,i.EPSILON9=1e-9,i.EPSILON10=1e-10,i.EPSILON11=1e-11,i.EPSILON12=1e-12,i.EPSILON13=1e-13,i.EPSILON14=1e-14,i.EPSILON15=1e-15,i.EPSILON16=1e-16,i.EPSILON17=1e-17,i.EPSILON18=1e-18,i.EPSILON19=1e-19,i.EPSILON20=1e-20,i.GRAVITATIONALPARAMETER=3986004418e5,i.SOLAR_RADIUS=6955e5,i.LUNAR_RADIUS=1737400,i.SIXTY_FOUR_KILOBYTES=65536,i.sign=function(e){return e>0?1:e<0?-1:0},i.signNotZero=function(e){return e<0?-1:1},i.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*i.clamp(e,-1,1)+.5)*n)},i.fromSNorm=function(e,n){return n=t(n,255),i.clamp(e,0,n)/n*2-1},i.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},i.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},i.lerp=function(e,t,n){return(1-n)*e+n*t},i.PI=Math.PI,i.ONE_OVER_PI=1/Math.PI,i.PI_OVER_TWO=.5*Math.PI,i.PI_OVER_THREE=Math.PI/3,i.PI_OVER_FOUR=Math.PI/4,i.PI_OVER_SIX=Math.PI/6,i.THREE_PI_OVER_TWO=3*Math.PI*.5,i.TWO_PI=2*Math.PI,i.ONE_OVER_TWO_PI=1/(2*Math.PI),i.RADIANS_PER_DEGREE=Math.PI/180,i.DEGREES_PER_RADIAN=180/Math.PI,i.RADIANS_PER_ARCSECOND=i.RADIANS_PER_DEGREE/3600,i.toRadians=function(e){return e*i.RADIANS_PER_DEGREE},i.toDegrees=function(e){return e*i.DEGREES_PER_RADIAN},i.convertLongitudeRange=function(e){var t=i.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},i.clampToLatitudeRange=function(e){return i.clamp(e,-1*i.PI_OVER_TWO,i.PI_OVER_TWO)},i.negativePiToPi=function(e){return i.zeroToTwoPi(e+i.PI)-i.PI},i.zeroToTwoPi=function(e){var t=i.mod(e,i.TWO_PI);return Math.abs(t)<i.EPSILON14&&Math.abs(e)>i.EPSILON14?i.TWO_PI:t},i.mod=function(e,t){return(e%t+t)%t},i.equalsEpsilon=function(e,n,r,i){i=t(i,r);var a=Math.abs(e-n);return a<=i||a<=r*Math.max(Math.abs(e),Math.abs(n))};var a=[1];i.factorial=function(e){var t=a.length;if(e>=t)for(var n=a[t-1],r=t;r<=e;r++)a.push(n*r);return a[e]},i.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},i.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},i.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},i.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return i.setRandomNumberSeed=function(t){o=new e(t)},i.nextRandomNumber=function(){return o.random()},i.acosClamped=function(e){return Math.acos(i.clamp(e,-1,1))},i.asinClamped=function(e){return Math.asin(i.clamp(e,-1,1))},i.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},i.logBase=function(e,t){return Math.log(e)/Math.log(t)},i.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},i}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var i=e.clock,a=e.cone,u=t(e.magnitude,1),s=u*Math.sin(a);return r.x=s*Math.cos(i),r.y=s*Math.sin(i),r.z=u*Math.cos(a),r},o.fromElements=function(e,t,r,i){return n(i)?(i.x=e,i.y=t,i.z=r,i):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new o),i.x=e[r++],i.y=e[r++],i.z=e[r],i},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var i=0;i<r;++i)o.pack(e[i],t,3*i);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var i=0;i<r;i+=3){var a=i/3;t[a]=o.unpack(e,i,t[a])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,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};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var n=o.dot(c,l),r=o.magnitude(o.cross(c,l,c));return Math.atan2(r,n)};var f=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,i){return e===t||n(e)&&n(t)&&a.equalsEpsilon(e.x,t.x,r,i)&&a.equalsEpsilon(e.y,t.y,r,i)&&a.equalsEpsilon(e.z,t.z,r,i)},o.cross=function(e,t,n){var r=e.x,i=e.y,a=e.z,o=t.x,u=t.y,s=t.z,c=i*s-a*u,l=a*o-r*s,f=r*u-i*o;return n.x=c,n.y=l,n.z=f,n},o.fromDegrees=function(e,t,n,r,i){return e=a.toRadians(e),t=a.toRadians(t),o.fromRadians(e,t,n,r,i)};var h=new o,d=new o,p=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,i,a,u){i=t(i,0);var s=n(a)?a.radiiSquared:p,c=Math.cos(r);h.x=c*Math.cos(e),h.y=c*Math.sin(e),h.z=Math.sin(r),h=o.normalize(h,h),o.multiplyComponents(s,h,d);var l=Math.sqrt(o.dot(h,d));return d=o.divideByScalar(d,l,d),h=o.multiplyByScalar(h,i,h),n(u)||(u=new o),o.add(d,h,u)},o.fromDegreesArray=function(e,t,r){var i=e.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],s=e[a+1],c=a/2;r[c]=o.fromDegrees(u,s,0,t,r[c])}return r},o.fromRadiansArray=function(e,t,r){var i=e.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],s=e[a+1],c=a/2;r[c]=o.fromRadians(u,s,0,t,r[c])}return r},o.fromDegreesArrayHeights=function(e,t,r){var i=e.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],s=e[a+1],c=e[a+2],l=a/3;r[l]=o.fromDegrees(u,s,c,t,r[l])}return r},o.fromRadiansArrayHeights=function(e,t,r){var i=e.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],s=e[a+1],c=e[a+2],l=a/3;r[l]=o.fromRadians(u,s,c,t,r[l])}return r},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,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function i(n,i,u,s,c){var l=n.x,f=n.y,h=n.z,d=i.x,p=i.y,y=i.z,E=l*l*d*d,m=f*f*p*p,_=h*h*y*y,v=E+m+_,T=Math.sqrt(1/v),R=e.multiplyByScalar(n,T,a);if(v<s)return isFinite(T)?e.clone(R,c):void 0;var g=u.x,A=u.y,S=u.z,N=o;N.x=R.x*g*2,N.y=R.y*A*2,N.z=R.z*S*2;var x,I,O,w,M,C,P,D,L,U,b,F=(1-T)*e.magnitude(n)/(.5*e.magnitude(N)),z=0;do{F-=z,O=1/(1+F*g),w=1/(1+F*A),M=1/(1+F*S),C=O*O,P=w*w,D=M*M,L=C*O,U=P*w,b=D*M,x=E*C+m*P+_*D-1,I=E*L*g+m*U*A+_*b*S;var B=-2*I;z=x/B}while(Math.abs(x)>r.EPSILON12);return t(c)?(c.x=l*O,c.y=f*w,c.z=h*M,c):new e(l*O,f*w,h*M)}var a=new e,o=new e;return i}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,i,a,o){"use strict";function u(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)}u.fromRadians=function(e,r,i,a){return i=t(i,0),n(a)?(a.longitude=e,a.latitude=r,a.height=i,a):new u(e,r,i)},u.fromDegrees=function(e,t,n,r){return e=a.toRadians(e),t=a.toRadians(t),u.fromRadians(e,t,n,r)};var s=new e,c=new e,l=new e,f=new e(1/6378137,1/6378137,1/6356752.314245179),h=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),d=a.EPSILON1;return u.fromCartesian=function(t,r,i){var p=n(r)?r.oneOverRadii:f,y=n(r)?r.oneOverRadiiSquared:h,E=n(r)?r._centerToleranceSquared:d,m=o(t,p,y,E,c);if(n(m)){var _=e.multiplyComponents(m,y,s);_=e.normalize(_,_);var v=e.subtract(t,m,l),T=Math.atan2(_.y,_.x),R=Math.asin(_.z),g=a.sign(e.dot(v,t))*e.magnitude(v);return n(i)?(i.longitude=T,i.latitude=R,i.height=g,i):new u(T,R,g)}},u.clone=function(e,t){if(n(e))return n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},u.ZERO=i(new u(0,0,0)),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,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,i,a,o,u,s){"use strict";function c(t,r,i,a){r=n(r,0),i=n(i,0),a=n(a,0),t._radii=new e(r,i,a),t._radiiSquared=new e(r*r,i*i,a*a),t._radiiToTheFourth=new e(r*r*r*r,i*i*i*i,a*a*a*a),t._oneOverRadii=new e(0===r?0:1/r,0===i?0:1/i,0===a?0:1/a),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===i?0:1/(i*i),0===a?0:1/(a*a)),t._minimumRadius=Math.min(r,i,a),t._maximumRadius=Math.max(r,i,a),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,c(this,e,t,n)}i(l.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}}}),l.clone=function(t,n){if(r(t)){var i=t._radii;return r(n)?(e.clone(i,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new l(i.x,i.y,i.z)}},l.fromCartesian3=function(e,t){return r(t)||(t=new l),r(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,r,i){return i=n(i,0),e.pack(t._radii,r,i),r},l.unpack=function(t,r,i){r=n(r,0);var a=e.unpack(t,r);return l.fromCartesian3(a,i)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,n){var i=t.longitude,a=t.latitude,o=Math.cos(a),u=o*Math.cos(i),s=o*Math.sin(i),c=Math.sin(a);return r(n)||(n=new e),n.x=u,n.y=s,n.z=c,e.normalize(n,n)},l.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var f=new e,h=new e;l.prototype.cartographicToCartesian=function(t,n){var i=f,a=h;this.geodeticSurfaceNormalCartographic(t,i),e.multiplyComponents(this._radiiSquared,i,a);var o=Math.sqrt(e.dot(i,a));return e.divideByScalar(a,o,a),e.multiplyByScalar(i,t.height,i),r(n)||(n=new e),e.add(a,i,n)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;i<n;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var d=new e,p=new e,y=new e;return l.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,p);if(r(a)){var o=this.geodeticSurfaceNormal(a,d),s=e.subtract(n,a,y),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),f=u.sign(e.dot(s,n))*e.magnitude(s);return r(i)?(i.longitude=c,i.latitude=l,i.height=f,i):new t(c,l,f)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;i<n;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var i=t.x,a=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*u.z);return e.multiplyByScalar(t,s,n)},l.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},l.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},l.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,i,a){i=n(i,0);var o=this._sqauredXOverSquaredZ;if(r(a)||(a=new e),a.x=0,a.y=0,a.z=t.z*(1-o),!(Math.abs(a.z)>=this._radii.z-i))return a},l}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(e,n){this.x=t(e,0),this.y=t(n,0)}o.fromElements=function(e,t,r){return n(r)?(r.x=e,r.y=t,r):new o(e,t)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t):new o(e.x,e.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r]=e.y,n},o.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new o),i.x=e[r++],i.y=e[r],i},o.packArray=function(e,t){var r=e.length;n(t)?t.length=2*r:t=new Array(2*r);for(var i=0;i<r;++i)o.pack(e[i],t,2*i);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/2:t=new Array(r/2);for(var i=0;i<r;i+=2){var a=i/2;t[a]=o.unpack(e,i,t[a])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y)},o.minimumComponent=function(e){return Math.min(e.x,e.y)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){return o.normalize(e,c),o.normalize(t,l),a.acosClamped(o.dot(c,l))};var f=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},o.equalsEpsilon=function(e,t,r,i){return e===t||n(e)&&n(t)&&a.equalsEpsilon(e.x,t.x,r,i)&&a.equalsEpsilon(e.y,t.y,r,i)},o.ZERO=i(new o(0,0)),o.UNIT_X=i(new o(1,0)),o.UNIT_Y=i(new o(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,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,i,a,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return i(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var i=this._semimajorAxis,a=t.longitude*i,o=t.latitude*i,u=t.height;return r(n)?(n.x=a,n.y=o,n.z=u,n):new e(a,o,u)},u.prototype.unproject=function(e,n){var i=this._oneOverSemimajorAxis,a=e.x*i,o=e.y*i,u=e.z;return r(n)?(n.longitude=a,n.latitude=o,n.height=u,n):new t(a,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,i,a,o,u,s){"use strict";function c(e,t,r,i){this.west=n(e,0),this.south=n(t,0),this.east=n(r,0),this.north=n(i,0)}i(c.prototype,{width:{get:function(){return c.computeWidth(this)}},height:{get:function(){return c.computeHeight(this)}}}),c.packedLength=4,c.pack=function(e,t,r){return r=n(r,0),t[r++]=e.west,t[r++]=e.south,t[r++]=e.east,t[r]=e.north,t},c.unpack=function(e,t,i){return t=n(t,0),r(i)||(i=new c),i.west=e[t++],i.south=e[t++],i.east=e[t++],i.north=e[t],i},c.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=s.TWO_PI),t-n},c.computeHeight=function(e){return e.north-e.south},c.fromDegrees=function(e,t,i,a,o){return e=s.toRadians(n(e,0)),t=s.toRadians(n(t,0)),i=s.toRadians(n(i,0)),a=s.toRadians(n(a,0)),r(o)?(o.west=e,o.south=t,o.east=i,o.north=a,o):new c(e,t,i,a)},c.fromRadians=function(e,t,i,a,o){return r(o)?(o.west=n(e,0),o.south=n(t,0),o.east=n(i,0),o.north=n(a,0),o):new c(e,t,i,a)},c.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,u=Number.MAX_VALUE,l=-Number.MAX_VALUE,f=0,h=e.length;f<h;f++){var d=e[f];n=Math.min(n,d.longitude),i=Math.max(i,d.longitude),u=Math.min(u,d.latitude),l=Math.max(l,d.latitude);var p=d.longitude>=0?d.longitude:d.longitude+s.TWO_PI;a=Math.min(a,p),o=Math.max(o,p)}return i-n>o-a&&(n=a,i=o,i>s.PI&&(i-=s.TWO_PI),n>s.PI&&(n-=s.TWO_PI)),r(t)?(t.west=n,t.south=u,t.east=i,t.north=l,t):new c(n,u,i,l)},c.fromCartesianArray=function(e,t,n){for(var i=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,u=-Number.MAX_VALUE,l=Number.MAX_VALUE,f=-Number.MAX_VALUE,h=0,d=e.length;h<d;h++){var p=t.cartesianToCartographic(e[h]);i=Math.min(i,p.longitude),a=Math.max(a,p.longitude),l=Math.min(l,p.latitude),f=Math.max(f,p.latitude);var y=p.longitude>=0?p.longitude:p.longitude+s.TWO_PI;o=Math.min(o,y),u=Math.max(u,y)}return a-i>u-o&&(i=o,a=u,a>s.PI&&(a-=s.TWO_PI),i>s.PI&&(i-=s.TWO_PI)),r(n)?(n.west=i,n.south=l,n.east=a,n.north=f,n):new c(i,l,a,f)},c.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new c(e.west,e.south,e.east,e.north)},c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.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},c.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},c.validate=function(e){},c.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)},c.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)},c.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)},c.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)},c.center=function(t,n){var i=t.east,a=t.west;i<a&&(i+=s.TWO_PI);var o=s.negativePiToPi(.5*(a+i)),u=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=u,n.height=0,n):new e(o,u)},c.intersection=function(e,t,n){var i=e.east,a=e.west,o=t.east,u=t.west;i<a&&o>0?i+=s.TWO_PI:o<u&&i>0&&(o+=s.TWO_PI),i<a&&u<0?u+=s.TWO_PI:o<u&&a<0&&(a+=s.TWO_PI);var l=s.negativePiToPi(Math.max(a,u)),f=s.negativePiToPi(Math.min(i,o));if(!((e.west<e.east||t.west<t.east)&&f<=l)){var h=Math.max(e.south,t.south),d=Math.min(e.north,t.north);if(!(h>=d))return r(n)?(n.west=l,n.south=h,n.east=f,n.north=d,n):new c(l,h,f,d)}},c.simpleIntersection=function(e,t,n){var i=Math.max(e.west,t.west),a=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(a>=u||i>=o))return r(n)?(n.west=i,n.south=a,n.east=o,n.north=u,n):new c(i,a,o,u)},c.union=function(e,t,n){r(n)||(n=new c);var i=e.east,a=e.west,o=t.east,u=t.west;i<a&&o>0?i+=s.TWO_PI:o<u&&i>0&&(o+=s.TWO_PI),i<a&&u<0?u+=s.TWO_PI:o<u&&a<0&&(a+=s.TWO_PI);var l=s.convertLongitudeRange(Math.min(a,u)),f=s.convertLongitudeRange(Math.max(i,o));return n.west=l,n.south=Math.min(e.south,t.south),n.east=f,n.north=Math.max(e.north,t.north),n},c.expand=function(e,t,n){return r(n)||(n=new c),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},c.contains=function(e,t){var n=t.longitude,r=t.latitude,i=e.west,a=e.east;return a<i&&(a+=s.TWO_PI,n<0&&(n+=s.TWO_PI)),(n>i||s.equalsEpsilon(n,i,s.EPSILON14))&&(n<a||s.equalsEpsilon(n,a,s.EPSILON14))&&r>=e.south&&r<=e.north};var l=new e;return c.subsample=function(e,t,i,a){t=n(t,o.WGS84),i=n(i,0),r(a)||(a=[]);var u=0,f=e.north,h=e.south,d=e.east,p=e.west,y=l;y.height=i,y.longitude=p,y.latitude=f,a[u]=t.cartographicToCartesian(y,a[u]),u++,y.longitude=d,a[u]=t.cartographicToCartesian(y,a[u]),u++,y.latitude=h,a[u]=t.cartographicToCartesian(y,a[u]),u++,y.longitude=p,a[u]=t.cartographicToCartesian(y,a[u]),u++,f<0?y.latitude=f:h>0?y.latitude=h:y.latitude=0;for(var E=1;E<8;++E)y.longitude=-Math.PI+E*s.PI_OVER_TWO,c.contains(e,y)&&(a[u]=t.cartographicToCartesian(y,a[u]),u++);return 0===y.latitude&&(y.longitude=p,a[u]=t.cartographicToCartesian(y,a[u]),u++,y.longitude=d,a[u]=t.cartographicToCartesian(y,a[u]),u++),a.length=u,a},c.MAX_VALUE=u(new c(-Math.PI,-s.PI_OVER_TWO,Math.PI,s.PI_OVER_TWO)),c}),define("Core/BoundingRectangle",["./Cartesian2","./Cartographic","./Check","./defaultValue","./defined","./GeographicProjection","./Intersect","./Rectangle"],function(e,t,n,r,i,a,o,u){"use strict";function s(e,t,n,i){this.x=r(e,0),this.y=r(t,0),this.width=r(n,0),this.height=r(i,0)}s.packedLength=4,s.pack=function(e,t,n){return n=r(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.width,t[n]=e.height,t},s.unpack=function(e,t,n){return t=r(t,0),i(n)||(n=new s),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n},s.fromPoints=function(e,t){if(i(t)||(t=new s),!i(e)||0===e.length)return t.x=0,t.y=0,t.width=0,t.height=0,t;for(var n=e.length,r=e[0].x,a=e[0].y,o=e[0].x,u=e[0].y,c=1;c<n;c++){var l=e[c],f=l.x,h=l.y;r=Math.min(f,r),o=Math.max(f,o),a=Math.min(h,a),u=Math.max(h,u)}return t.x=r,t.y=a,t.width=o-r,t.height=u-a,t};var c=new a,l=new t,f=new t;return s.fromRectangle=function(t,n,a){if(i(a)||(a=new s),!i(t))return a.x=0,a.y=0,a.width=0,a.height=0,a;n=r(n,c);var o=n.project(u.southwest(t,l)),h=n.project(u.northeast(t,f));return e.subtract(h,o,h),a.x=o.x,a.y=o.y,a.width=h.x,a.height=h.y,a},s.clone=function(e,t){if(i(e))return i(t)?(t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t):new s(e.x,e.y,e.width,e.height)},s.union=function(e,t,n){i(n)||(n=new s);var r=Math.min(e.x,t.x),a=Math.min(e.y,t.y),o=Math.max(e.x+e.width,t.x+t.width),u=Math.max(e.y+e.height,t.y+t.height);return n.x=r,n.y=a,n.width=o-r,n.height=u-a,n},s.expand=function(e,t,n){n=s.clone(e,n);var r=t.x-n.x,i=t.y-n.y;return r>n.width?n.width=r:r<0&&(n.width-=r,n.x=t.x),i>n.height?n.height=i:i<0&&(n.height-=i,n.y=t.y),n},s.intersect=function(e,t){var n=e.x,r=e.y,i=t.x,a=t.y;return n>i+t.width||n+e.width<i||r+e.height<a||r>a+t.height?o.OUTSIDE:o.INTERSECTING},s.equals=function(e,t){return e===t||i(e)&&i(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.intersect=function(e){return s.intersect(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a,o,u){"use strict";function s(e,t,r,i,a,o,u,s,c){this[0]=n(e,0),this[1]=n(i,0),this[2]=n(u,0),this[3]=n(t,0),this[4]=n(a,0),this[5]=n(s,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(c,0)}function c(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function l(e){for(var t=0,n=0;n<3;++n){var r=e[s.getElementIndex(y[n],p[n])];t+=2*r*r}return Math.sqrt(t)}function f(e,t){for(var n=u.EPSILON15,r=0,i=1,a=0;a<3;++a){var o=Math.abs(e[s.getElementIndex(y[a],p[a])]);o>r&&(i=a,r=o)}var c=1,l=0,f=p[i],h=y[i];if(Math.abs(e[s.getElementIndex(h,f)])>n){var d,E=e[s.getElementIndex(h,h)],m=e[s.getElementIndex(f,f)],_=e[s.getElementIndex(h,f)],v=(E-m)/2/_;d=v<0?-1/(-v+Math.sqrt(1+v*v)):1/(v+Math.sqrt(1+v*v)),c=1/Math.sqrt(1+d*d),l=d*c}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(f,f)]=t[s.getElementIndex(h,h)]=c,t[s.getElementIndex(h,f)]=l,t[s.getElementIndex(f,h)]=-l,t}s.packedLength=9,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t},s.unpack=function(e,t,i){return t=n(t,0),r(i)||(i=new s),i[0]=e[t++],i[1]=e[t++],i[2]=e[t++],i[3]=e[t++],i[4]=e[t++],i[5]=e[t++],i[6]=e[t++],i[7]=e[t++],i[8]=e[t++],i},s.clone=function(e,t){if(r(e))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):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,i){return t=n(t,0),r(i)||(i=new s),i[0]=e[t],i[1]=e[t+1],i[2]=e[t+2],i[3]=e[t+3],i[4]=e[t+4],i[5]=e[t+5],i[6]=e[t+6],i[7]=e[t+7],i[8]=e[t+8],i},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[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 s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var n=e.x*e.x,i=e.x*e.y,a=e.x*e.z,o=e.x*e.w,u=e.y*e.y,c=e.y*e.z,l=e.y*e.w,f=e.z*e.z,h=e.z*e.w,d=e.w*e.w,p=n-u-f+d,y=2*(i-h),E=2*(a+l),m=2*(i+h),_=-n+u-f+d,v=2*(c-o),T=2*(a-l),R=2*(c+o),g=-n-u+f+d;return r(t)?(t[0]=p,t[1]=m,t[2]=T,t[3]=y,t[4]=_,t[5]=R,t[6]=E,t[7]=v,t[8]=g,t):new s(p,y,E,m,_,v,T,R,g)},s.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),i=Math.cos(-e.heading),a=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),c=Math.sin(e.roll),l=n*i,f=-a*u+c*o*i,h=c*u+a*o*i,d=n*u,p=a*i+c*o*u,y=-o*a+a*o*u,E=-o,m=c*n,_=a*n;return r(t)?(t[0]=l,t[1]=d,t[2]=E,t[3]=f,t[4]=p,t[5]=m,t[6]=h,t[7]=y,t[8]=_,t):new s(l,f,h,d,p,y,E,m,_)},s.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 s(e.x,0,0,0,e.y,0,0,0,e.z)},s.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 s(e,0,0,0,e,0,0,0,e)},s.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 s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=i,t[6]=0,t[7]=-i,t[8]=n,t):new s(1,0,0,0,n,-i,0,i,n)},s.fromRotationY=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-i,t[3]=0,t[4]=1,t[5]=0,t[6]=i,t[7]=0,t[8]=n,t):new s(n,0,i,0,1,0,-i,0,n)},s.fromRotationZ=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=n,t[1]=i,t[2]=0,t[3]=-i,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(n,-i,0,i,n,0,0,0,1)},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):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,n){var r=3*t,i=e[r],a=e[r+1],o=e[r+2];return n.x=i,n.y=a,n.z=o,n},s.setColumn=function(e,t,n,r){r=s.clone(e,r);var i=3*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},s.getRow=function(e,t,n){var r=e[t],i=e[t+3],a=e[t+6];return n.x=r,n.y=i,n.z=a,n},s.setRow=function(e,t,n,r){return r=s.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var h=new e;s.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],h)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],h)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],h)),n};var d=new e;s.getMaximumScale=function(t){return s.getScale(t,d),e.maximumComponent(d)},s.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],i=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],o=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 n[0]=r,n[1]=i,n[2]=a,n[3]=o,n[4]=u,n[5]=s,n[6]=c,n[7]=l,n[8]=f,n},s.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},s.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},s.multiplyByVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[3]*i+e[6]*a,u=e[1]*r+e[4]*i+e[7]*a,s=e[2]*r+e[5]*i+e[8]*a;return n.x=o,n.y=u,n.z=s,n},s.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},s.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},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},s.transpose=function(e,t){var n=e[0],r=e[3],i=e[6],a=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var p=[1,0,0],y=[2,2,1],E=new s,m=new s;return s.computeEigenDecomposition=function(e,t){var n=u.EPSILON20,i=10,a=0,o=0;r(t)||(t={});for(var h=t.unitary=s.clone(s.IDENTITY,t.unitary),d=t.diagonal=s.clone(e,t.diagonal),p=n*c(d);o<i&&l(d)>p;)f(d,E),s.transpose(E,m),s.multiply(d,E,d),s.multiply(m,d,d),s.multiply(h,E,h),++a>2&&(++o,a=0);return 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},s.determinant=function(e){var t=e[0],n=e[3],r=e[6],i=e[1],a=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(a*c-s*o)+i*(s*r-n*c)+u*(n*o-a*r)},s.inverse=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],u=e[5],c=e[6],l=e[7],f=e[8],h=s.determinant(e);t[0]=o*f-l*u,t[1]=l*i-r*f,t[2]=r*u-o*i,t[3]=c*u-a*f,t[4]=n*f-c*i,t[5]=a*i-n*u,t[6]=a*l-c*o,t[7]=c*r-n*l,t[8]=n*o-a*r;var d=1/h;return s.multiplyByScalar(t,d,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]},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},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,i(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(e,n,r,i){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(i,0)}o.fromElements=function(e,t,r,i,a){return n(a)?(a.x=e,a.y=t,a.z=r,a.w=i,a):new o(e,t,r,i)},o.fromColor=function(e,t){return n(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(n(e))return n(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)},o.packedLength=4,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},o.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new o),i.x=e[r++],i.y=e[r++],i.z=e[r++],i.w=e[r],i},o.packArray=function(e,t){var r=e.length;n(t)?t.length=4*r:t=new Array(4*r);for(var i=0;i<r;++i)o.pack(e[i],t,4*i);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/4:t=new Array(r/4);for(var i=0;i<r;i+=4){var a=i/4;t[a]=o.unpack(e,i,t[a])}return t},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,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},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 u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,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,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},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 s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,c);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},o.equalsEpsilon=function(e,t,r,i){return e===t||n(e)&&n(t)&&a.equalsEpsilon(e.x,t.x,r,i)&&a.equalsEpsilon(e.y,t.y,r,i)&&a.equalsEpsilon(e.z,t.z,r,i)&&a.equalsEpsilon(e.w,t.w,r,i)},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,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,i,a,o,u,s,c,l){"use strict";function f(e,t,n,i,a,o,u,s,c,l,f,h,d,p,y,E){this[0]=r(e,0),this[1]=r(a,0),this[2]=r(c,0),this[3]=r(d,0),this[4]=r(t,0),this[5]=r(o,0),this[6]=r(l,0),this[7]=r(p,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(f,0),this[11]=r(y,0),this[12]=r(i,0),this[13]=r(s,0),this[14]=r(h,0),this[15]=r(E,0)}f.packedLength=16,f.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},f.unpack=function(e,t,n){return t=r(t,0),i(n)||(n=new f),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},f.clone=function(e,t){if(i(e))return i(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 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])},f.fromArray=f.unpack,f.fromColumnMajorArray=function(e,t){return f.clone(e,t)},f.fromRowMajorArray=function(e,t){return i(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 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(t,n,a){return n=r(n,e.ZERO),i(a)?(a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=0,a[4]=t[3],a[5]=t[4],a[6]=t[5],a[7]=0,a[8]=t[6],a[9]=t[7],a[10]=t[8],a[11]=0,a[12]=n.x,a[13]=n.y,a[14]=n.z,a[15]=1,a):new f(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},f.fromTranslationQuaternionRotationScale=function(e,t,n,r){i(r)||(r=new f);var a=n.x,o=n.y,u=n.z,s=t.x*t.x,c=t.x*t.y,l=t.x*t.z,h=t.x*t.w,d=t.y*t.y,p=t.y*t.z,y=t.y*t.w,E=t.z*t.z,m=t.z*t.w,_=t.w*t.w,v=s-d-E+_,T=2*(c-m),R=2*(l+y),g=2*(c+m),A=-s+d-E+_,S=2*(p-h),N=2*(l-y),x=2*(p+h),I=-s-d+E+_;return r[0]=v*a,r[1]=g*a,r[2]=N*a,r[3]=0,r[4]=T*o,r[5]=A*o,r[6]=x*o,r[7]=0,r[8]=R*u,r[9]=S*u,r[10]=I*u,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},f.fromTranslationRotationScale=function(e,t){return f.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},f.fromTranslation=function(e,t){return f.fromRotationTranslation(c.IDENTITY,e,t)},f.fromScale=function(e,t){return i(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 f(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},f.fromUniformScale=function(e,t){return i(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 f(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var h=new e,d=new e,p=new e;f.fromCamera=function(t,n){var r=t.position,a=t.direction,o=t.up;e.normalize(a,h),e.normalize(e.cross(h,o,d),d),e.normalize(e.cross(d,h,p),p);var u=d.x,s=d.y,c=d.z,l=h.x,y=h.y,E=h.z,m=p.x,_=p.y,v=p.z,T=r.x,R=r.y,g=r.z,A=u*-T+s*-R+c*-g,S=m*-T+_*-R+v*-g,N=l*T+y*R+E*g;return i(n)?(n[0]=u,n[1]=m,n[2]=-l,n[3]=0,n[4]=s,n[5]=_,n[6]=-y,n[7]=0,n[8]=c,n[9]=v,n[10]=-E,n[11]=0,n[12]=A,n[13]=S,n[14]=N,n[15]=1,n):new f(u,s,c,A,m,_,v,S,-l,-y,-E,N,0,0,0,1)},f.computePerspectiveFieldOfView=function(e,t,n,r,i){var a=Math.tan(.5*e),o=1/a,u=o/t,s=(r+n)/(n-r),c=2*r*n/(n-r);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=o,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=s,i[11]=-1,i[12]=0,i[13]=0,i[14]=c,i[15]=0,i},f.computeOrthographicOffCenter=function(e,t,n,r,i,a,o){var u=1/(t-e),s=1/(r-n),c=1/(a-i),l=-(t+e)*u,f=-(r+n)*s,h=-(a+i)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=f,o[14]=h,o[15]=1,o},f.computePerspectiveOffCenter=function(e,t,n,r,i,a,o){var u=2*i/(t-e),s=2*i/(r-n),c=(t+e)/(t-e),l=(r+n)/(r-n),f=-(a+i)/(a-i),h=-1,d=-2*a*i/(a-i);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=f,o[11]=h,o[12]=0,o[13]=0,o[14]=d,o[15]=0,o},f.computeInfinitePerspectiveOffCenter=function(e,t,n,r,i,a){var o=2*i/(t-e),u=2*i/(r-n),s=(t+e)/(t-e),c=(r+n)/(r-n),l=-1,f=-1,h=-2*i;return a[0]=o,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]=h,a[15]=0,a},f.computeViewportTransformation=function(e,t,n,i){e=r(e,r.EMPTY_OBJECT);var a=r(e.x,0),o=r(e.y,0),u=r(e.width,0),s=r(e.height,0);t=r(t,0),n=r(n,1);var c=.5*u,l=.5*s,f=.5*(n-t),h=c,d=l,p=f,y=a+c,E=o+l,m=t+f,_=1;return i[0]=h,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=d,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=p,i[11]=0,i[12]=y,i[13]=E,i[14]=m,i[15]=_,i},f.computeView=function(t,n,r,i,a){return a[0]=i.x,a[1]=r.x,a[2]=-n.x,a[3]=0,a[4]=i.y,a[5]=r.y,a[6]=-n.y,a[7]=0,a[8]=i.z,a[9]=r.z,a[10]=-n.z,a[11]=0,a[12]=-e.dot(i,t),a[13]=-e.dot(r,t),a[14]=e.dot(n,t),a[15]=1,a},f.toArray=function(e,t){return i(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]]},f.getElementIndex=function(e,t){return 4*e+t},f.getColumn=function(e,t,n){var r=4*t,i=e[r],a=e[r+1],o=e[r+2],u=e[r+3];return n.x=i,n.y=a,n.z=o,n.w=u,n},f.setColumn=function(e,t,n,r){r=f.clone(e,r);var i=4*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r[i+3]=n.w,r},f.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},f.getRow=function(e,t,n){var r=e[t],i=e[t+4],a=e[t+8],o=e[t+12];return n.x=r,n.y=i,n.z=a,n.w=o,n},f.setRow=function(e,t,n,r){return r=f.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var y=new e;f.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],y)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],y)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],y)),n};var E=new e;f.getMaximumScale=function(t){return f.getScale(t,E),e.maximumComponent(E)},f.multiply=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],f=e[8],h=e[9],d=e[10],p=e[11],y=e[12],E=e[13],m=e[14],_=e[15],v=t[0],T=t[1],R=t[2],g=t[3],A=t[4],S=t[5],N=t[6],x=t[7],I=t[8],O=t[9],w=t[10],M=t[11],C=t[12],P=t[13],D=t[14],L=t[15],U=r*v+u*T+f*R+y*g,b=i*v+s*T+h*R+E*g,F=a*v+c*T+d*R+m*g,z=o*v+l*T+p*R+_*g,B=r*A+u*S+f*N+y*x,G=i*A+s*S+h*N+E*x,q=a*A+c*S+d*N+m*x,W=o*A+l*S+p*N+_*x,V=r*I+u*O+f*w+y*M,H=i*I+s*O+h*w+E*M,X=a*I+c*O+d*w+m*M,Y=o*I+l*O+p*w+_*M,k=r*C+u*P+f*D+y*L,Z=i*C+s*P+h*D+E*L,j=a*C+c*P+d*D+m*L,K=o*C+l*P+p*D+_*L;return n[0]=U,n[1]=b,n[2]=F,n[3]=z,n[4]=B,n[5]=G,n[6]=q,n[7]=W,n[8]=V,n[9]=H,n[10]=X,n[11]=Y,n[12]=k,n[13]=Z,n[14]=j,n[15]=K,n},f.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},f.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},f.multiplyTransformation=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=e[12],d=e[13],p=e[14],y=t[0],E=t[1],m=t[2],_=t[4],v=t[5],T=t[6],R=t[8],g=t[9],A=t[10],S=t[12],N=t[13],x=t[14],I=r*y+o*E+c*m,O=i*y+u*E+l*m,w=a*y+s*E+f*m,M=r*_+o*v+c*T,C=i*_+u*v+l*T,P=a*_+s*v+f*T,D=r*R+o*g+c*A,L=i*R+u*g+l*A,U=a*R+s*g+f*A,b=r*S+o*N+c*x+h,F=i*S+u*N+l*x+d,z=a*S+s*N+f*x+p;return n[0]=I,n[1]=O,n[2]=w,n[3]=0,n[4]=M,n[5]=C,n[6]=P,n[7]=0,n[8]=D,n[9]=L,n[10]=U,n[11]=0,n[12]=b,n[13]=F,n[14]=z,n[15]=1,n},f.multiplyByMatrix3=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=t[0],d=t[1],p=t[2],y=t[3],E=t[4],m=t[5],_=t[6],v=t[7],T=t[8],R=r*h+o*d+c*p,g=i*h+u*d+l*p,A=a*h+s*d+f*p,S=r*y+o*E+c*m,N=i*y+u*E+l*m,x=a*y+s*E+f*m,I=r*_+o*v+c*T,O=i*_+u*v+l*T,w=a*_+s*v+f*T;return n[0]=R,n[1]=g,n[2]=A,n[3]=0,n[4]=S,n[5]=N,n[6]=x,n[7]=0,n[8]=I,n[9]=O,n[10]=w,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},f.multiplyByTranslation=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=r*e[0]+i*e[4]+a*e[8]+e[12],u=r*e[1]+i*e[5]+a*e[9]+e[13],s=r*e[2]+i*e[6]+a*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=s,n[15]=e[15],n};var m=new e;f.multiplyByUniformScale=function(e,t,n){return m.x=t,m.y=t,m.z=t,f.multiplyByScale(e,m,n)},f.multiplyByScale=function(e,t,n){var r=t.x,i=t.y,a=t.z;return 1===r&&1===i&&1===a?f.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=i*e[4],n[5]=i*e[5],n[6]=i*e[6],n[7]=0,n[8]=a*e[8],n[9]=a*e[9],n[10]=a*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},f.multiplyByVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=t.w,u=e[0]*r+e[4]*i+e[8]*a+e[12]*o,s=e[1]*r+e[5]*i+e[9]*a+e[13]*o,c=e[2]*r+e[6]*i+e[10]*a+e[14]*o,l=e[3]*r+e[7]*i+e[11]*a+e[15]*o;return n.x=u,n.y=s,n.z=c,n.w=l,n},f.multiplyByPointAsVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[4]*i+e[8]*a,u=e[1]*r+e[5]*i+e[9]*a,s=e[2]*r+e[6]*i+e[10]*a;return n.x=o,n.y=u,n.z=s,n},f.multiplyByPoint=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[4]*i+e[8]*a+e[12],u=e[1]*r+e[5]*i+e[9]*a+e[13],s=e[2]*r+e[6]*i+e[10]*a+e[14];return n.x=o,n.y=u,n.z=s,n},f.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},f.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},f.transpose=function(e,t){var n=e[1],r=e[2],i=e[3],a=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=a,t[10]=e[10],t[11]=e[14],t[12]=i,t[13]=o,t[14]=u,t[15]=e[15],t},f.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},f.equals=function(e,t){return e===t||i(e)&&i(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},f.equalsEpsilon=function(e,t,n){return e===t||i(e)&&i(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},f.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},f.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};var _=new c,v=new c,T=new t,R=new t(0,0,0,1);return f.inverse=function(e,n){if(c.equalsEpsilon(f.getRotation(e,_),v,s.EPSILON7)&&t.equals(f.getRow(e,3,T),R))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],i=e[4],a=e[8],o=e[12],u=e[1],h=e[5],d=e[9],p=e[13],y=e[2],E=e[6],m=e[10],g=e[14],A=e[3],S=e[7],N=e[11],x=e[15],I=m*x,O=g*N,w=E*x,M=g*S,C=E*N,P=m*S,D=y*x,L=g*A,U=y*N,b=m*A,F=y*S,z=E*A,B=I*h+M*d+C*p-(O*h+w*d+P*p),G=O*u+D*d+b*p-(I*u+L*d+U*p),q=w*u+L*h+F*p-(M*u+D*h+z*p),W=P*u+U*h+z*d-(C*u+b*h+F*d),V=O*i+w*a+P*o-(I*i+M*a+C*o),H=I*r+L*a+U*o-(O*r+D*a+b*o),X=M*r+D*i+z*o-(w*r+L*i+F*o),Y=C*r+b*i+F*a-(P*r+U*i+z*a);I=a*p,O=o*d,w=i*p,M=o*h,C=i*d,P=a*h,D=r*p,L=o*u,U=r*d,b=a*u,F=r*h,z=i*u;var k=I*S+M*N+C*x-(O*S+w*N+P*x),Z=O*A+D*N+b*x-(I*A+L*N+U*x),j=w*A+L*S+F*x-(M*A+D*S+z*x),K=P*A+U*S+z*N-(C*A+b*S+F*N),J=w*m+P*g+O*E-(C*g+I*E+M*m),Q=U*g+I*y+L*m-(D*m+b*g+O*y),$=D*E+z*g+M*y-(F*g+w*y+L*E),ee=F*m+C*y+b*E-(U*E+z*m+P*y),te=r*B+i*G+a*q+o*W;if(Math.abs(te)<s.EPSILON20)throw new l("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=B*te,n[1]=G*te,n[2]=q*te,n[3]=W*te,n[4]=V*te,n[5]=H*te,n[6]=X*te,n[7]=Y*te,n[8]=k*te,n[9]=Z*te,n[10]=j*te,n[11]=K*te,n[12]=J*te,n[13]=Q*te,n[14]=$*te,n[15]=ee*te,n},f.inverseTransformation=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],f=e[12],h=e[13],d=e[14],p=-n*f-r*h-i*d,y=-a*f-o*h-u*d,E=-s*f-c*h-l*d;return t[0]=n,t[1]=a,t[2]=s,t[3]=0,t[4]=r,t[5]=o,t[6]=c,t[7]=0,t[8]=i,t[9]=u,t[10]=l,t[11]=0,t[12]=p,t[13]=y,t[14]=E,t[15]=1,t},f.IDENTITY=u(new f(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),f.ZERO=u(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,a(f.prototype,{length:{get:function(){return f.packedLength}}}),f.prototype.clone=function(e){return f.clone(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},f.prototype.equalsEpsilon=function(e,t){return f.equalsEpsilon(this,e,t)},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/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,i,a,o,u,s,c,l,f){"use strict";function h(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var d=new e,p=new e,y=new e,E=new e,m=new e,_=new e,v=new e,T=new e,R=new e,g=new e,A=new e,S=new e;h.fromPoints=function(t,n){if(i(n)||(n=new h),!i(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var r=e.clone(t[0],v),a=e.clone(r,d),o=e.clone(r,p),u=e.clone(r,y),s=e.clone(r,E),c=e.clone(r,m),l=e.clone(r,_),f=t.length,N=1;N<f;N++){e.clone(t[N],r);var x=r.x,I=r.y,O=r.z;x<a.x&&e.clone(r,a),x>s.x&&e.clone(r,s),I<o.y&&e.clone(r,o),I>c.y&&e.clone(r,c),O<u.z&&e.clone(r,u),O>l.z&&e.clone(r,l)}var w=e.magnitudeSquared(e.subtract(s,a,T)),M=e.magnitudeSquared(e.subtract(c,o,T)),C=e.magnitudeSquared(e.subtract(l,u,T)),P=a,D=s,L=w;M>L&&(L=M,P=o,D=c),C>L&&(L=C,P=u,D=l);var U=R;U.x=.5*(P.x+D.x),U.y=.5*(P.y+D.y),U.z=.5*(P.z+D.z);var b=e.magnitudeSquared(e.subtract(D,U,T)),F=Math.sqrt(b),z=g;z.x=a.x,z.y=o.y,z.z=u.z;var B=A;B.x=s.x,B.y=c.y,B.z=l.z;var G=e.multiplyByScalar(e.add(z,B,T),.5,S),q=0;for(N=0;N<f;N++){e.clone(t[N],r);var W=e.magnitude(e.subtract(r,G,T));W>q&&(q=W);var V=e.magnitudeSquared(e.subtract(r,U,T));if(V>b){var H=Math.sqrt(V);F=.5*(F+H),b=F*F;var X=H-F;U.x=(F*U.x+X*r.x)/H,U.y=(F*U.y+X*r.y)/H,U.z=(F*U.z+X*r.z)/H}}return F<q?(e.clone(U,n.center),n.radius=F):(e.clone(G,n.center),n.radius=q),n};var N=new o,x=new e,I=new e,O=new t,w=new t;h.fromRectangle2D=function(e,t,n){return h.fromRectangleWithHeights2D(e,t,0,0,n)},h.fromRectangleWithHeights2D=function(t,n,a,o,u){if(i(u)||(u=new h),!i(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;n=r(n,N),f.southwest(t,O),O.height=a,f.northeast(t,w),w.height=o;var s=n.project(O,x),c=n.project(w,I),l=c.x-s.x,d=c.y-s.y,p=c.z-s.z;u.radius=.5*Math.sqrt(l*l+d*d+p*p);var y=u.center;return y.x=s.x+.5*l,y.y=s.y+.5*d,y.z=s.z+.5*p,u};var M=[];h.fromRectangle3D=function(e,t,n,o){t=r(t,a.WGS84),n=r(n,0);var u;return i(e)&&(u=f.subsample(e,t,n,M)),h.fromPoints(u,o)},h.fromVertices=function(t,n,a,o){if(i(o)||(o=new h),!i(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;n=r(n,e.ZERO),a=r(a,3);var u=v;u.x=t[0]+n.x,u.y=t[1]+n.y,u.z=t[2]+n.z;for(var s=e.clone(u,d),c=e.clone(u,p),l=e.clone(u,y),f=e.clone(u,E),N=e.clone(u,m),x=e.clone(u,_),I=t.length,O=0;O<I;O+=a){var w=t[O]+n.x,M=t[O+1]+n.y,C=t[O+2]+n.z;u.x=w,u.y=M,u.z=C,w<s.x&&e.clone(u,s),w>f.x&&e.clone(u,f),M<c.y&&e.clone(u,c),M>N.y&&e.clone(u,N),C<l.z&&e.clone(u,l),C>x.z&&e.clone(u,x)}var P=e.magnitudeSquared(e.subtract(f,s,T)),D=e.magnitudeSquared(e.subtract(N,c,T)),L=e.magnitudeSquared(e.subtract(x,l,T)),U=s,b=f,F=P;D>F&&(F=D,U=c,b=N),L>F&&(F=L,U=l,b=x);var z=R;z.x=.5*(U.x+b.x),z.y=.5*(U.y+b.y),z.z=.5*(U.z+b.z);var B=e.magnitudeSquared(e.subtract(b,z,T)),G=Math.sqrt(B),q=g;q.x=s.x,q.y=c.y,q.z=l.z;var W=A;W.x=f.x,W.y=N.y,W.z=x.z;var V=e.multiplyByScalar(e.add(q,W,T),.5,S),H=0;for(O=0;O<I;O+=a){u.x=t[O]+n.x,u.y=t[O+1]+n.y,u.z=t[O+2]+n.z;var X=e.magnitude(e.subtract(u,V,T));X>H&&(H=X);var Y=e.magnitudeSquared(e.subtract(u,z,T));if(Y>B){var k=Math.sqrt(Y);G=.5*(G+k),B=G*G;var Z=k-G;z.x=(G*z.x+Z*u.x)/k,z.y=(G*z.y+Z*u.y)/k,z.z=(G*z.z+Z*u.z)/k}}return G<H?(e.clone(z,o.center),o.radius=G):(e.clone(V,o.center),o.radius=H),o},h.fromEncodedCartesianVertices=function(t,n,r){if(i(r)||(r=new h),!i(t)||!i(n)||t.length!==n.length||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var a=v;a.x=t[0]+n[0],a.y=t[1]+n[1],a.z=t[2]+n[2];for(var o=e.clone(a,d),u=e.clone(a,p),s=e.clone(a,y),c=e.clone(a,E),l=e.clone(a,m),f=e.clone(a,_),N=t.length,x=0;x<N;x+=3){var I=t[x]+n[x],O=t[x+1]+n[x+1],w=t[x+2]+n[x+2];a.x=I,a.y=O,a.z=w,I<o.x&&e.clone(a,o),I>c.x&&e.clone(a,c),O<u.y&&e.clone(a,u),O>l.y&&e.clone(a,l),w<s.z&&e.clone(a,s),w>f.z&&e.clone(a,f)}var M=e.magnitudeSquared(e.subtract(c,o,T)),C=e.magnitudeSquared(e.subtract(l,u,T)),P=e.magnitudeSquared(e.subtract(f,s,T)),D=o,L=c,U=M;C>U&&(U=C,D=u,L=l),P>U&&(U=P,D=s,L=f);var b=R;b.x=.5*(D.x+L.x),b.y=.5*(D.y+L.y),b.z=.5*(D.z+L.z);var F=e.magnitudeSquared(e.subtract(L,b,T)),z=Math.sqrt(F),B=g;B.x=o.x,B.y=u.y,B.z=s.z;var G=A;G.x=c.x,G.y=l.y,G.z=f.z;var q=e.multiplyByScalar(e.add(B,G,T),.5,S),W=0;for(x=0;x<N;x+=3){a.x=t[x]+n[x],a.y=t[x+1]+n[x+1],a.z=t[x+2]+n[x+2];var V=e.magnitude(e.subtract(a,q,T));V>W&&(W=V);var H=e.magnitudeSquared(e.subtract(a,b,T));if(H>F){var X=Math.sqrt(H);z=.5*(z+X),F=z*z;var Y=X-z;b.x=(z*b.x+Y*a.x)/X,b.y=(z*b.y+Y*a.y)/X,b.z=(z*b.z+Y*a.z)/X}}return z<W?(e.clone(b,r.center),r.radius=z):(e.clone(q,r.center),r.radius=W),r},h.fromCornerPoints=function(t,n,r){i(r)||(r=new h);var a=r.center;return e.add(t,n,a),e.multiplyByScalar(a,.5,a),r.radius=e.distance(a,n),r},h.fromEllipsoid=function(t,n){return i(n)||(n=new h),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var C=new e;h.fromBoundingSpheres=function(t,n){if(i(n)||(n=new h),!i(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var r=t.length;if(1===r)return h.clone(t[0],n);if(2===r)return h.union(t[0],t[1],n);for(var a=[],o=0;o<r;o++)a.push(t[o].center);n=h.fromPoints(a,n);var u=n.center,s=n.radius;for(o=0;o<r;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,C)+c.radius)}return n.radius=s,n};var P=new e,D=new e,L=new e;h.fromOrientedBoundingBox=function(t,n){i(n)||(n=new h);var r=t.halfAxes,a=c.getColumn(r,0,P),o=c.getColumn(r,1,D),u=c.getColumn(r,2,L),s=e.magnitude(a),l=e.magnitude(o),f=e.magnitude(u);return n.center=e.clone(t.center,n.center),n.radius=Math.max(s,l,f),n},h.clone=function(t,n){if(i(t))return i(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new h(t.center,t.radius)},h.packedLength=4,h.pack=function(e,t,n){n=r(n,0);var i=e.center;return t[n++]=i.x,t[n++]=i.y,t[n++]=i.z,t[n]=e.radius,t},h.unpack=function(e,t,n){t=r(t,0),i(n)||(n=new h);var a=n.center;return a.x=e[t++],a.y=e[t++],a.z=e[t++],n.radius=e[t],n};var U=new e,b=new e;h.union=function(t,n,r){i(r)||(r=new h);var a=t.center,o=t.radius,u=n.center,s=n.radius,c=e.subtract(u,a,U),l=e.magnitude(c);if(o>=l+s)return t.clone(r),r;if(s>=l+o)return n.clone(r),r;var f=.5*(o+l+s),d=e.multiplyByScalar(c,(-o+f)/l,b);return e.add(d,a,d),e.clone(d,r.center),r.radius=f,r};var F=new e;h.expand=function(t,n,r){r=h.clone(t,r);var i=e.magnitude(e.subtract(n,r.center,F));return i>r.radius&&(r.radius=i),r},h.intersectPlane=function(t,n){var r=t.center,i=t.radius,a=n.normal,o=e.dot(a,r)+n.distance;return o<-i?u.OUTSIDE:o<i?u.INTERSECTING:u.INSIDE},h.transform=function(e,t,n){return i(n)||(n=new h),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=l.getMaximumScale(t)*e.radius,n};var z=new e;h.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,z);return e.magnitudeSquared(r)-t.radius*t.radius; +},h.transformWithoutScale=function(e,t,n){return i(n)||(n=new h),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var B=new e;h.computePlaneDistances=function(t,n,r,a){i(a)||(a=new s);var o=e.subtract(t.center,n,B),u=e.dot(r,o);return a.start=u-t.radius,a.stop=u+t.radius,a};for(var G=new e,q=new e,W=new e,V=new e,H=new e,X=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var Z=new o;return h.projectTo2D=function(t,n,i){n=r(n,Z);var a=n.ellipsoid,o=t.center,u=t.radius,s=a.geodeticSurfaceNormal(o,G),c=e.cross(e.UNIT_Z,s,q);e.normalize(c,c);var l=e.cross(s,c,W);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var f=e.negate(l,H),d=e.negate(c,V),p=Y,y=p[0];e.add(s,l,y),e.add(y,c,y),y=p[1],e.add(s,l,y),e.add(y,d,y),y=p[2],e.add(s,f,y),e.add(y,d,y),y=p[3],e.add(s,f,y),e.add(y,c,y),e.negate(s,s),y=p[4],e.add(s,l,y),e.add(y,c,y),y=p[5],e.add(s,l,y),e.add(y,d,y),y=p[6],e.add(s,f,y),e.add(y,d,y),y=p[7],e.add(s,f,y),e.add(y,c,y);for(var E=p.length,m=0;m<E;++m){var _=p[m];e.add(o,_,_);var v=a.cartesianToCartographic(_,X);n.project(v,_)}i=h.fromPoints(p,i),o=i.center;var T=o.x,R=o.y,g=o.z;return o.x=g,o.y=T,o.z=R,i},h.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},h.equals=function(t,n){return t===n||i(t)&&i(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},h.prototype.intersectPlane=function(e){return h.intersectPlane(this,e)},h.prototype.distanceSquaredTo=function(e){return h.distanceSquaredTo(this,e)},h.prototype.computePlaneDistances=function(e,t,n){return h.computePlaneDistances(this,e,t,n)},h.prototype.isOccluded=function(e){return h.isOccluded(this,e)},h.prototype.equals=function(e){return h.equals(this,e)},h.prototype.clone=function(e){return h.clone(this,e)},h}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},i={};return t(i,{element:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(i.supportsFullscreen())return null!==i.element}}}),i.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var i,a=["webkit","moz","o","ms","khtml"],o=0,u=a.length;o<u;++o){var s=a[o];i=s+"RequestFullscreen","function"==typeof t[i]?(r.requestFullscreen=i,n=!0):(i=s+"RequestFullScreen","function"==typeof t[i]&&(r.requestFullscreen=i,n=!0)),i=s+"ExitFullscreen","function"==typeof document[i]?r.exitFullscreen=i:(i=s+"CancelFullScreen","function"==typeof document[i]&&(r.exitFullscreen=i)),i=s+"FullscreenEnabled",void 0!==document[i]?r.fullscreenEnabled=i:(i=s+"FullScreenEnabled",void 0!==document[i]&&(r.fullscreenEnabled=i)),i=s+"FullscreenElement",void 0!==document[i]?r.fullscreenElement=i:(i=s+"FullScreenElement",void 0!==document[i]&&(r.fullscreenElement=i)),i=s+"fullscreenchange",void 0!==document["on"+i]&&("ms"===s&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=s+"fullscreenerror",void 0!==document["on"+i]&&("ms"===s&&(i="MSFullscreenError"),r.fullscreenerror=i)}return n},i.requestFullscreen=function(e,t){i.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},i.exitFullscreen=function(){i.supportsFullscreen()&&document[r.exitFullscreen]()},i}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function i(){if(!t(R)&&(R=!1,!h())){var e=/ Chrome\/([\.0-9]+)/.exec(T.userAgent);null!==e&&(R=!0,g=r(e[1]))}return R}function a(){return i()&&g}function o(){if(!t(A)&&(A=!1,!i()&&!h()&&/ Safari\/[\.0-9]+/.test(T.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(T.userAgent);null!==e&&(A=!0,S=r(e[1]))}return A}function u(){return o()&&S}function s(){if(!t(N)){N=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(T.userAgent);null!==e&&(N=!0,x=r(e[1]),x.isNightly=!!e[2])}return N}function c(){return s()&&x}function l(){if(!t(I)){I=!1;var e;"Microsoft Internet Explorer"===T.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(T.userAgent),null!==e&&(I=!0,O=r(e[1]))):"Netscape"===T.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(T.userAgent),null!==e&&(I=!0,O=r(e[1])))}return I}function f(){return l()&&O}function h(){if(!t(w)){w=!1;var e=/ Edge\/([\.0-9]+)/.exec(T.userAgent);null!==e&&(w=!0,M=r(e[1]))}return w}function d(){return h()&&M}function p(){if(!t(C)){C=!1;var e=/Firefox\/([\.0-9]+)/.exec(T.userAgent);null!==e&&(C=!0,P=r(e[1]))}return C}function y(){return t(D)||(D=/Windows/i.test(T.appVersion)),D}function E(){return p()&&P}function m(){return t(L)||(L="undefined"!=typeof PointerEvent&&(!t(T.pointerEnabled)||T.pointerEnabled)),L}function _(){if(!t(b)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;b=t(n)&&""!==n,b&&(U=n)}return b}function v(){return _()?U:void 0}var T;T="undefined"!=typeof navigator?navigator:{};var R,g,A,S,N,x,I,O,w,M,C,P,D,L,U,b,F={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isEdge:h,edgeVersion:d,isFirefox:p,firefoxVersion:E,isWindows:y,hardwareConcurrency:e(T.hardwareConcurrency,3),supportsPointerEvents:m,supportsImageRenderingPixelated:_,imageRenderingValue:v};return F.supportsFullscreen=function(){return n.supportsFullscreen()},F.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},F.supportsWebWorkers=function(){return"undefined"!=typeof Worker},F}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,i,a){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:a.BYTE,UNSIGNED_BYTE:a.UNSIGNED_BYTE,SHORT:a.SHORT,UNSIGNED_SHORT:a.UNSIGNED_SHORT,INT:a.INT,UNSIGNED_INT:a.UNSIGNED_INT,FLOAT:a.FLOAT,DOUBLE:a.DOUBLE};return o.getSizeInBytes=function(e){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.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},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 Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,i){switch(r=e(r,0),i=e(i,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,i);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,i);case o.SHORT:return new Int16Array(n,r,i);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,i);case o.INT:return new Int32Array(n,r,i);case o.UNSIGNED_INT:return new Uint32Array(n,r,i);case o.FLOAT:return new Float32Array(n,r,i);case o.DOUBLE:return new Float64Array(n,r,i)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},i(o)}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Intersect"],function(e,t,n,r,i){"use strict";function a(r,i,a){this.minimum=e.clone(t(r,e.ZERO)),this.maximum=e.clone(t(i,e.ZERO)),n(a)?a=e.clone(a):(a=e.add(this.minimum,this.maximum,new e),e.multiplyByScalar(a,.5,a)),this.center=a}a.fromPoints=function(t,r){if(n(r)||(r=new a),!n(t)||0===t.length)return r.minimum=e.clone(e.ZERO,r.minimum),r.maximum=e.clone(e.ZERO,r.maximum),r.center=e.clone(e.ZERO,r.center),r;for(var i=t[0].x,o=t[0].y,u=t[0].z,s=t[0].x,c=t[0].y,l=t[0].z,f=t.length,h=1;h<f;h++){var d=t[h],p=d.x,y=d.y,E=d.z;i=Math.min(p,i),s=Math.max(p,s),o=Math.min(y,o),c=Math.max(y,c),u=Math.min(E,u),l=Math.max(E,l)}var m=r.minimum;m.x=i,m.y=o,m.z=u;var _=r.maximum;_.x=s,_.y=c,_.z=l;var v=e.add(m,_,r.center);return e.multiplyByScalar(v,.5,v),r},a.clone=function(t,r){if(n(t))return n(r)?(r.minimum=e.clone(t.minimum,r.minimum),r.maximum=e.clone(t.maximum,r.maximum),r.center=e.clone(t.center,r.center),r):new a(t.minimum,t.maximum)},a.equals=function(t,r){return t===r||n(t)&&n(r)&&e.equals(t.center,r.center)&&e.equals(t.minimum,r.minimum)&&e.equals(t.maximum,r.maximum)};var o=new e;return a.intersectPlane=function(t,n){o=e.subtract(t.maximum,t.minimum,o);var r=e.multiplyByScalar(o,.5,o),a=n.normal,u=r.x*Math.abs(a.x)+r.y*Math.abs(a.y)+r.z*Math.abs(a.z),s=e.dot(t.center,a)+n.distance;return s-u>0?i.INSIDE:s+u<0?i.OUTSIDE:i.INTERSECTING},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.intersectPlane=function(e){return a.intersectPlane(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function n(e,n,r){var i=e+n;return t.sign(e)!==t.sign(n)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(n)))<r?0:i}var r={};return r.computeDiscriminant=function(e,t,n){var r=t*t-4*e*n;return r},r.computeRealRoots=function(e,r,i){var a;if(0===e)return 0===r?[]:[-i/r];if(0===r){if(0===i)return[0,0];var o=Math.abs(i),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(a=-i/e,a<0)return[];var s=Math.sqrt(a);return[-s,s]}if(0===i)return a=-r/e,a<0?[a,0]:[0,a];var c=r*r,l=4*e*i,f=n(c,-l,t.EPSILON14);if(f<0)return[];var h=-.5*n(r,t.sign(r)*Math.sqrt(f),t.EPSILON14);return r>0?[h/e,i/h]:[i/h,h/e]},r}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function n(e,t,n,r){var i,a,o=e,u=t/3,s=n/3,c=r,l=o*s,f=u*c,h=u*u,d=s*s,p=o*s-h,y=o*c-u*s,E=u*c-d,m=4*p*E-y*y;if(m<0){var _,v,T;h*f>=l*d?(_=o,v=p,T=-2*u*p+o*y):(_=c,v=E,T=-c*y+2*s*E);var R=T<0?-1:1,g=-R*Math.abs(_)*Math.sqrt(-m);a=-T+g;var A=a/2,S=A<0?-Math.pow(-A,1/3):Math.pow(A,1/3),N=a===g?-S:-v/S;return i=v<=0?S+N:-T/(S*S+N*N+v),h*f>=l*d?[(i-u)/o]:[-c/(i+s)]}var x=p,I=-2*u*p+o*y,O=E,w=-c*y+2*s*E,M=Math.sqrt(m),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*M,-I)/3);i=2*Math.sqrt(-x);var D=Math.cos(P);a=i*D;var L=i*(-D/2-C*Math.sin(P)),U=a+L>2*u?a-u:L-u,b=o,F=U/b;P=Math.abs(Math.atan2(c*M,-w)/3),i=2*Math.sqrt(-O),D=Math.cos(P),a=i*D,L=i*(-D/2-C*Math.sin(P));var z=-c,B=a+L<2*s?a+s:L+s,G=z/B,q=b*B,W=-U*B-b*z,V=U*z,H=(s*W-u*V)/(-u*W+s*q);return F<=H?F<=G?H<=G?[F,H,G]:[F,G,H]:[G,F,H]:F<=G?[H,F,G]:H<=G?[H,G,F]:[G,H,F]}var r={};return r.computeDiscriminant=function(e,t,n,r){var i=e*e,a=t*t,o=n*n,u=r*r,s=18*e*t*n*r+a*o-27*i*u-4*(e*o*n+a*t*r);return s},r.computeRealRoots=function(e,r,i,a){var o,u;if(0===e)return t.computeRealRoots(r,i,a);if(0===r){if(0===i){if(0===a)return[0,0,0];u=-a/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===a?(o=t.computeRealRoots(e,0,i),0===o.Length?[0]:[o[0],0,o[1]]):n(e,0,i,a)}return 0===i?0===a?(u=-r/e,u<0?[u,0,0]:[0,0,u]):n(e,r,0,a):0===a?(o=t.computeRealRoots(e,r,i),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):n(e,r,i,a)},r}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,n,r){"use strict";function i(t,i,a,o){var u=t*t,s=i-3*u/8,c=a-i*t/2+u*t/8,l=o-a*t/4+i*u/16-3*u*u/256,f=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(f.length>0){var h=-t/4,d=f[f.length-1];if(Math.abs(d)<n.EPSILON14){var p=r.computeRealRoots(1,s,l);if(2===p.length){var y,E=p[0],m=p[1];if(E>=0&&m>=0){var _=Math.sqrt(E),v=Math.sqrt(m);return[h-v,h-_,h+_,h+v]}if(E>=0&&m<0)return y=Math.sqrt(E),[h-y,h+y];if(E<0&&m>=0)return y=Math.sqrt(m),[h-y,h+y]}return[]}if(d>0){var T=Math.sqrt(d),R=(s+d-c/T)/2,g=(s+d+c/T)/2,A=r.computeRealRoots(1,T,R),S=r.computeRealRoots(1,-T,g);return 0!==A.length?(A[0]+=h,A[1]+=h,0!==S.length?(S[0]+=h,S[1]+=h,A[1]<=S[0]?[A[0],A[1],S[0],S[1]]:S[1]<=A[0]?[S[0],S[1],A[0],A[1]]:A[0]>=S[0]&&A[1]<=S[1]?[S[0],A[0],A[1],S[1]]:S[0]>=A[0]&&S[1]<=A[1]?[A[0],S[0],S[1],A[1]]:A[0]>S[0]&&A[0]<S[1]?[S[0],A[0],S[1],A[1]]:[A[0],S[0],A[1],S[1]]):A):0!==S.length?(S[0]+=h,S[1]+=h,S):[]}}return[]}function a(t,i,a,o){var u=a*a,s=i*i,c=t*t,l=-2*i,f=a*t+s-4*o,h=c*o-a*i*t+u,d=e.computeRealRoots(1,l,f,h);if(d.length>0){var p,y,E=d[0],m=i-E,_=m*m,v=t/2,T=m/2,R=_-4*o,g=_+4*Math.abs(o),A=c-4*E,S=c+4*Math.abs(E);if(E<0||R*S<A*g){var N=Math.sqrt(A);p=N/2,y=0===N?0:(t*T-a)/N}else{var x=Math.sqrt(R);p=0===x?0:(t*T-a)/x,y=x/2}var I,O;0===v&&0===p?(I=0,O=0):n.sign(v)===n.sign(p)?(I=v+p,O=E/I):(O=v-p,I=E/O);var w,M;0===T&&0===y?(w=0,M=0):n.sign(T)===n.sign(y)?(w=T+y,M=o/w):(M=T-y,w=o/M);var C=r.computeRealRoots(1,I,w),P=r.computeRealRoots(1,O,M);if(0!==C.length)return 0!==P.length?C[1]<=P[0]?[C[0],C[1],P[0],P[1]]:P[1]<=C[0]?[P[0],P[1],C[0],C[1]]:C[0]>=P[0]&&C[1]<=P[1]?[P[0],C[0],C[1],P[1]]:P[0]>=C[0]&&P[1]<=C[1]?[C[0],P[0],P[1],C[1]]:C[0]>P[0]&&C[0]<P[1]?[P[0],C[0],P[1],C[1]]:[C[0],P[0],C[1],P[1]]:C;if(0!==P.length)return P}return[]}var o={};return o.computeDiscriminant=function(e,t,n,r,i){var a=e*e,o=a*e,u=t*t,s=u*t,c=n*n,l=c*n,f=r*r,h=f*r,d=i*i,p=d*i,y=u*c*f-4*s*h-4*e*l*f+18*e*t*n*h-27*a*f*f+256*o*p+i*(18*s*n*r-4*u*l+16*e*c*c-80*e*t*c*r-6*e*u*f+144*a*n*f)+d*(144*e*u*n-27*u*u-128*a*c-192*a*t*r);return y},o.computeRealRoots=function(t,r,o,u,s){if(Math.abs(t)<n.EPSILON15)return e.computeRealRoots(r,o,u,s);var c=r/t,l=o/t,f=u/t,h=s/t,d=c<0?1:0;switch(d+=l<0?d+1:d,d+=f<0?d+1:d,d+=h<0?d+1:d){case 0:return i(c,l,f,h);case 1:return a(c,l,f,h);case 2:return a(c,l,f,h);case 3:return i(c,l,f,h);case 4:return i(c,l,f,h);case 5:return a(c,l,f,h);case 6:return i(c,l,f,h);case 7:return i(c,l,f,h);case 8:return a(c,l,f,h);case 9:return i(c,l,f,h);case 10:return i(c,l,f,h);case 11:return a(c,l,f,h);case 12:return i(c,l,f,h);case 13:return i(c,l,f,h);case 14:return i(c,l,f,h);case 15:return i(c,l,f,h);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function i(n,r){r=e.clone(t(r,e.ZERO)),e.equals(r,e.ZERO)||e.normalize(r,r),this.origin=e.clone(t(n,e.ZERO)),this.direction=r}return i.getPoint=function(t,r,i){return n(i)||(i=new e),i=e.multiplyByScalar(t.direction,r,i),e.add(t.origin,i,i)},i}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,n,r,i,a,o,u,s,c,l){"use strict";function f(e,t,n,r){var i=t*t-4*e*n;if(!(i<0)){if(i>0){var a=1/(2*e),o=Math.sqrt(i),u=(-t+o)*a,s=(-t-o)*a;return u<s?(r.root0=u,r.root1=s):(r.root0=s,r.root1=u),r}var c=-t/(2*e);if(0!==c)return r.root0=r.root1=c,r}}function h(t,n,i){r(i)||(i=new a);var o=t.origin,u=t.direction,s=n.center,c=n.radius*n.radius,l=e.subtract(o,s,_),h=e.dot(u,u),d=2*e.dot(u,l),p=e.magnitudeSquared(l)-c,y=f(h,d,p,g);if(r(y))return i.start=y.root0,i.stop=y.root1,i}function d(e,t,n){var r=e+t;return o.sign(e)!==o.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))<n?0:r}function p(t,n,r,i,a){var l,f=i*i,h=a*a,p=(t[u.COLUMN1ROW1]-t[u.COLUMN2ROW2])*h,y=a*(i*d(t[u.COLUMN1ROW0],t[u.COLUMN0ROW1],o.EPSILON15)+n.y),E=t[u.COLUMN0ROW0]*f+t[u.COLUMN2ROW2]*h+i*n.x+r,m=h*d(t[u.COLUMN2ROW1],t[u.COLUMN1ROW2],o.EPSILON15),_=a*(i*d(t[u.COLUMN2ROW0],t[u.COLUMN0ROW2])+n.z),v=[];if(0===_&&0===m){if(l=s.computeRealRoots(p,y,E),0===l.length)return v;var T=l[0],R=Math.sqrt(Math.max(1-T*T,0));if(v.push(new e(i,a*T,a*-R)),v.push(new e(i,a*T,a*R)),2===l.length){var g=l[1],A=Math.sqrt(Math.max(1-g*g,0));v.push(new e(i,a*g,a*-A)),v.push(new e(i,a*g,a*A))}return v}var S=_*_,N=m*m,x=p*p,I=_*m,O=x+N,w=2*(y*p+I),M=2*E*p+y*y-N+S,C=2*(E*y-I),P=E*E-S;if(0===O&&0===w&&0===M&&0===C)return v;l=c.computeRealRoots(O,w,M,C,P);var D=l.length;if(0===D)return v;for(var L=0;L<D;++L){var U,b=l[L],F=b*b,z=Math.max(1-F,0),B=Math.sqrt(z);U=o.sign(p)===o.sign(E)?d(p*F+E,y*b,o.EPSILON12):o.sign(E)===o.sign(y*b)?d(p*F,y*b+E,o.EPSILON12):d(p*F+y*b,E,o.EPSILON12);var G=d(m*b,_,o.EPSILON15),q=U*G;q<0?v.push(new e(i,a*b,a*B)):q>0?v.push(new e(i,a*b,a*-B)):0!==B?(v.push(new e(i,a*b,a*-B)),v.push(new e(i,a*b,a*B)),++L):v.push(new e(i,a*b,a*B))}return v}var y={};y.rayPlane=function(t,n,i){r(i)||(i=new e);var a=t.origin,u=t.direction,s=n.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON15)){var l=(-n.distance-e.dot(s,a))/c;if(!(l<0))return i=e.multiplyByScalar(u,l,i),e.add(a,i,i)}};var E=new e,m=new e,_=new e,v=new e,T=new e;y.rayTriangleParametric=function(t,r,i,a,u){u=n(u,!1);var s,c,l,f,h,d=t.origin,p=t.direction,y=e.subtract(i,r,E),R=e.subtract(a,r,m),g=e.cross(p,R,_),A=e.dot(y,g);if(u){if(A<o.EPSILON6)return;if(s=e.subtract(d,r,v),l=e.dot(s,g),l<0||l>A)return;if(c=e.cross(s,y,T),f=e.dot(p,c),f<0||l+f>A)return;h=e.dot(R,c)/A}else{if(Math.abs(A)<o.EPSILON6)return;var S=1/A;if(s=e.subtract(d,r,v),l=e.dot(s,g)*S,l<0||l>1)return;if(c=e.cross(s,y,T),f=e.dot(p,c)*S,f<0||l+f>1)return;h=e.dot(R,c)*S}return h},y.rayTriangle=function(t,n,i,a,o,u){var s=y.rayTriangleParametric(t,n,i,a,o);if(r(s)&&!(s<0))return r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var R=new l;y.lineSegmentTriangle=function(t,n,i,a,o,u,s){var c=R;e.clone(t,c.origin),e.subtract(n,t,c.direction),e.normalize(c.direction,c.direction);var l=y.rayTriangleParametric(c,i,a,o,u);if(!(!r(l)||l<0||l>e.distance(t,n)))return r(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var g={root0:0,root1:0};y.raySphere=function(e,t,n){if(n=h(e,t,n), +r(n)&&!(n.stop<0))return n.start=Math.max(n.start,0),n};var A=new l;y.lineSegmentSphere=function(t,n,i,a){var o=A;e.clone(t,o.origin);var u=e.subtract(n,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),a=h(o,i,a),!(!r(a)||a.stop<0||a.start>s))return a.start=Math.max(a.start,0),a.stop=Math.min(a.stop,s),a};var S=new e,N=new e;y.rayEllipsoid=function(t,n){var r,i,o,u,s,c=n.oneOverRadii,l=e.multiplyComponents(c,t.origin,S),f=e.multiplyComponents(c,t.direction,N),h=e.magnitudeSquared(l),d=e.dot(l,f);if(h>1){if(d>=0)return;var p=d*d;if(r=h-1,i=e.magnitudeSquared(f),o=i*r,p<o)return;if(p>o){u=d*d-o,s=-d+Math.sqrt(u);var y=s/i,E=r/s;return y<E?new a(y,E):{start:E,stop:y}}var m=Math.sqrt(r/i);return new a(m,m)}return h<1?(r=h-1,i=e.magnitudeSquared(f),o=i*r,u=d*d-o,s=-d+Math.sqrt(u),new a(0,s/i)):d<0?(i=e.magnitudeSquared(f),new a(0,-d/i)):void 0};var x=new e,I=new e,O=new e,w=new e,M=new e,C=new u,P=new u,D=new u,L=new u,U=new u,b=new u,F=new u,z=new e,B=new e,G=new t;y.grazingAltitudeLocation=function(t,n){var i=t.origin,a=t.direction;if(!e.equals(i,e.ZERO)){var s=n.geodeticSurfaceNormal(i,x);if(e.dot(a,s)>=0)return i}var c=r(this.rayEllipsoid(t,n)),l=n.transformPositionToScaledSpace(a,x),f=e.normalize(l,l),h=e.mostOrthogonalAxis(l,w),d=e.normalize(e.cross(h,f,I),I),y=e.normalize(e.cross(f,d,O),O),E=C;E[0]=f.x,E[1]=f.y,E[2]=f.z,E[3]=d.x,E[4]=d.y,E[5]=d.z,E[6]=y.x,E[7]=y.y,E[8]=y.z;var m=u.transpose(E,P),_=u.fromScale(n.radii,D),v=u.fromScale(n.oneOverRadii,L),T=U;T[0]=0,T[1]=-a.z,T[2]=a.y,T[3]=a.z,T[4]=0,T[5]=-a.x,T[6]=-a.y,T[7]=a.x,T[8]=0;var R,g,A=u.multiply(u.multiply(m,v,b),T,b),S=u.multiply(u.multiply(A,_,F),E,F),N=u.multiplyByVector(A,i,M),q=p(S,e.negate(N,x),0,0,1),W=q.length;if(W>0){for(var V=e.clone(e.ZERO,B),H=Number.NEGATIVE_INFINITY,X=0;X<W;++X){R=u.multiplyByVector(_,u.multiplyByVector(E,q[X],z),z);var Y=e.normalize(e.subtract(R,i,w),w),k=e.dot(Y,a);k>H&&(H=k,V=e.clone(R,V))}var Z=n.cartesianToCartographic(V,G);return H=o.clamp(H,0,1),g=e.magnitude(e.subtract(V,i,w))*Math.sqrt(1-H*H),g=c?-g:g,Z.height=g,n.cartographicToCartesian(Z,new e)}};var q=new e;return y.lineSegmentPlane=function(t,n,i,a){r(a)||(a=new e);var u=e.subtract(n,t,q),s=i.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON6)){var l=e.dot(s,t),f=-(i.distance+l)/c;if(!(f<0||f>1))return e.multiplyByScalar(u,f,a),e.add(t,a,a),a}},y.trianglePlaneIntersection=function(t,n,r,i){var a=i.normal,o=i.distance,u=e.dot(a,t)+o<0,s=e.dot(a,n)+o<0,c=e.dot(a,r)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var f,h;if(1!==l&&2!==l||(f=new e,h=new e),1===l){if(u)return y.lineSegmentPlane(t,n,i,f),y.lineSegmentPlane(t,r,i,h),{positions:[t,n,r,f,h],indices:[0,3,4,1,2,4,1,4,3]};if(s)return y.lineSegmentPlane(n,r,i,f),y.lineSegmentPlane(n,t,i,h),{positions:[t,n,r,f,h],indices:[1,3,4,2,0,4,2,4,3]};if(c)return y.lineSegmentPlane(r,t,i,f),y.lineSegmentPlane(r,n,i,h),{positions:[t,n,r,f,h],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return y.lineSegmentPlane(n,t,i,f),y.lineSegmentPlane(r,t,i,h),{positions:[t,n,r,f,h],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return y.lineSegmentPlane(r,n,i,f),y.lineSegmentPlane(t,n,i,h),{positions:[t,n,r,f,h],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return y.lineSegmentPlane(t,r,i,f),y.lineSegmentPlane(n,r,i,h),{positions:[t,n,r,f,h],indices:[0,1,4,0,4,3,2,3,4]}}},y}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";function i(t,n){this.normal=e.clone(t),this.distance=n}i.fromPointNormal=function(n,r,a){var o=-e.dot(r,n);return t(a)?(e.clone(r,a.normal),a.distance=o,a):new i(r,o)};var a=new e;return i.fromCartesian4=function(n,r){var o=e.fromCartesian4(n,a),u=n.w;return t(r)?(e.clone(o,r.normal),r.distance=u,r):new i(o,u)},i.getPointDistance=function(t,n){return e.dot(t.normal,n)+t.distance},i.ORIGIN_XY_PLANE=r(new i(e.UNIT_Z,0)),i.ORIGIN_YZ_PLANE=r(new i(e.UNIT_X,0)),i.ORIGIN_ZX_PLANE=r(new i(e.UNIT_Y,0)),i}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,n,r,i){return t(e).then(n,r,i)}function t(e){var t,n;return e instanceof r?t=e:u(e)?(n=o(),e.then(function(e){n.resolve(e)},function(e){n.reject(e)},function(e){n.progress(e)}),t=n.promise):t=i(e),t}function n(t){return e(t,a)}function r(e){this.then=e}function i(e){var n=new r(function(n){try{return t(n?n(e):e)}catch(e){return a(e)}});return n}function a(e){var n=new r(function(n,r){try{return r?t(r(e)):a(e)}catch(e){return a(e)}});return n}function o(){function e(e,t,n){return h(e,t,n)}function n(e){return p(e)}function i(e){return p(a(e))}function u(e){return d(e)}var s,c,l,f,h,d,p;return c=new r(e),s={then:e,resolve:n,reject:i,progress:u,promise:c,resolver:{resolve:n,reject:i,progress:u}},l=[],f=[],h=function(e,t,n){var r,i;return r=o(),i="function"==typeof n?function(e){try{r.progress(n(e))}catch(e){r.progress(e)}}:function(e){r.progress(e)},l.push(function(n){n.then(e,t).then(r.resolve,r.reject,i)}),f.push(i),r.promise},d=function(e){return y(f,e),e},p=function(e){return e=t(e),h=e.then,p=t,d=m,y(l,e),f=l=R,e},s}function u(e){return e&&"function"==typeof e.then}function s(t,n,r,i,a){return E(2,arguments),e(t,function(t){function u(e){y(e)}function s(e){p(e)}var c,l,f,h,d,p,y,E,_,v;if(_=t.length>>>0,c=Math.max(0,Math.min(n,_)),f=[],l=_-c+1,h=[],d=o(),c)for(E=d.progress,y=function(e){h.push(e),--l||(p=y=m,d.reject(h))},p=function(e){f.push(e),--c||(p=y=m,d.resolve(f))},v=0;v<_;++v)v in t&&e(t[v],s,u,E);else d.resolve(f);return d.then(r,i,a)})}function c(e,t,n,r){function i(e){return t?t(e[0]):e[0]}return s(e,1,i,n,r)}function l(e,t,n,r){return E(1,arguments),h(e,_).then(t,n,r)}function f(){return h(arguments,_)}function h(t,n){return e(t,function(t){var r,i,a,u,s,c;if(a=i=t.length>>>0,r=[],c=o(),a)for(u=function(t,i){e(t,n).then(function(e){r[i]=e,--a||c.resolve(r)},c.reject)},s=0;s<i;s++)s in t?u(t[s],s):--a;else c.resolve(r);return c.promise})}function d(t,n){var r=T.call(arguments,1);return e(t,function(t){var i;return i=t.length,r[0]=function(t,r,a){return e(t,function(t){return e(r,function(e){return n(t,e,a,i)})})},v.apply(t,r)})}function p(t,n,r){var i=arguments.length>2;return e(t,function(e){return e=i?r:e,n.resolve(e),e},function(e){return n.reject(e),a(e)},n.progress)}function y(e,t){for(var n,r=0;n=e[r++];)n(t)}function E(e,t){for(var n,r=t.length;r>e;)if(n=t[--r],null!=n&&"function"!=typeof n)throw new Error("arg "+r+" must be a function")}function m(){}function _(e){return e}var v,T,R;return e.defer=o,e.resolve=t,e.reject=n,e.join=f,e.all=l,e.map=h,e.reduce=d,e.any=c,e.some=s,e.chain=p,e.isPromise=u,r.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(R,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return l(t,function(t){return e.apply(R,t)})})}},T=[].slice,v=[].reduce||function(e){var t,n,r,i,a;if(a=0,t=Object(this),i=t.length>>>0,n=arguments,n.length<=1)for(;;){if(a in t){r=t[a++];break}if(++a>=i)throw new TypeError}else r=n[1];for(;a<i;++a)a in t&&(r=e(r,t[a],a,t));return r},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/binarySearch",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e,t,n){for(var r,i,a=0,o=e.length-1;a<=o;)if(r=~~((a+o)/2),i=n(e[r],t),i<0)a=r+1;else{if(!(i>0))return r;o=r-1}return~(o+1)}return n}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,n,r,i){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=r,this.ut1MinusUtc=i}return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,n=0,r=t[n++],i=function(e,t,n,r){n||(n=" ");var i=e.length>=t?"":Array(1+t-e.length>>>0).join(n);return r?e+i:i+e},a=function(e,t,n,r,a,o){var u=r-e.length;return u>0&&(e=n||!a?i(e,r,o,n):e.slice(0,t.length)+i("",u,"0",!0)+e.slice(t.length)),e},o=function(e,t,n,r,o,u,s){var c=e>>>0;return n=n&&c&&{2:"0b",8:"0",16:"0x"}[t]||"",e=n+i(c.toString(t),u||0,"0",!1),a(e,n,r,o,s)},u=function(e,t,n,r,i,o){return null!=r&&(e=e.slice(0,r)),a(e,"",t,n,i,o)},s=function(e,r,s,c,l,f,h){var d,p,y,E,m;if("%%"==e)return"%";for(var _=!1,v="",T=!1,R=!1,g=" ",A=s.length,S=0;s&&S<A;S++)switch(s.charAt(S)){case" ":v=" ";break;case"+":v="+";break;case"-":_=!0;break;case"'":g=s.charAt(S+1);break;case"0":T=!0;break;case"#":R=!0}if(c=c?"*"==c?+t[n++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,c<0&&(c=-c,_=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(f=f?"*"==f?+t[n++]:"*"==f.charAt(0)?+t[f.slice(1,-1)]:+f:"fFeE".indexOf(h)>-1?6:"d"==h?0:void 0,m=r?t[r.slice(0,-1)]:t[n++],h){case"s":return u(String(m),_,c,f,T,g);case"c":return u(String.fromCharCode(+m),_,c,f,T);case"b":return o(m,2,R,_,c,f,T);case"o":return o(m,8,R,_,c,f,T);case"x":return o(m,16,R,_,c,f,T);case"X":return o(m,16,R,_,c,f,T).toUpperCase();case"u":return o(m,10,R,_,c,f,T);case"i":case"d":return d=+m||0,d=Math.round(d-d%1),p=d<0?"-":v,m=p+i(String(Math.abs(d)),f,"0",!1),a(m,p,_,c,T);case"e":case"E":case"f":case"F":case"g":case"G":return d=+m,p=d<0?"-":v,y=["toExponential","toFixed","toPrecision"]["efg".indexOf(h.toLowerCase())],E=["toString","toUpperCase"]["eEfFgG".indexOf(h)%2],m=p+Math.abs(d)[y](f),a(m,p,_,c,T)[E]();default:return e}};return r.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,n,r,i,a,o,u){this.year=e,this.month=t,this.day=n,this.hour=r,this.minute=i,this.second=a,this.millisecond=o,this.isLeapSecond=u}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e(t)}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,n,r,i,a,o,u,s,c){"use strict";function l(e,t){return y.compare(e.julianDate,t.julianDate)}function f(e){v.julianDate=e;var n=y.leapSeconds,r=t(n,v,l);r<0&&(r=~r),r>=n.length&&(r=n.length-1);var i=n[r].offset;if(r>0){var a=y.secondsDifference(n[r].julianDate,e);a>i&&(r--,i=n[r].offset)}y.addSeconds(e,i,e)}function h(e,n){v.julianDate=e;var r=y.leapSeconds,i=t(r,v,l);if(i<0&&(i=~i),0===i)return y.addSeconds(e,-r[0].offset,n);if(i>=r.length)return y.addSeconds(e,-r[i-1].offset,n);var a=y.secondsDifference(r[i].julianDate,e);return 0===a?y.addSeconds(e,-r[i].offset,n):a<=1?void 0:y.addSeconds(e,-r[--i].offset,n)}function d(e,t,n){var r=t/s.SECONDS_PER_DAY|0;return e+=r,t-=s.SECONDS_PER_DAY*r,t<0&&(e--,t+=s.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function p(e,t,n,r,i,a,o){var u=(t-14)/12|0,c=e+4800+u,l=(1461*c/4|0)+(367*(t-2-12*u)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;r-=12,r<0&&(r+=24);var f=a+(r*s.SECONDS_PER_HOUR+i*s.SECONDS_PER_MINUTE+o*s.SECONDS_PER_MILLISECOND);return f>=43200&&(l-=1),[l,f]}function y(e,t,r){this.dayNumber=void 0,this.secondsOfDay=void 0,e=n(e,0),t=n(t,0),r=n(r,c.UTC);var i=0|e;t+=(e-i)*s.SECONDS_PER_DAY,d(i,t,this),r===c.UTC&&f(this)}var E=new a,m=[31,28,31,30,31,30,31,31,30,31,30,31],_=29,v=new u,T=/^(\d{4})$/,R=/^(\d{4})-(\d{2})$/,g=/^(\d{4})-?(\d{3})$/,A=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,S=/^(\d{4})-?(\d{2})-?(\d{2})$/,N=/([Z+\-])?(\d{2})?:?(\d{2})?$/,x=/^(\d{2})(\.\d+)?/.source+N.source,I=/^(\d{2}):?(\d{2})(\.\d+)?/.source+N.source,O=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+N.source;y.fromDate=function(e,t){var n=p(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r(t)?(d(n[0],n[1],t),f(t),t):new y(n[0],n[1],c.UTC)},y.fromIso8601=function(e,t){e=e.replace(",",".");var n,i,a,u=e.split("T"),s=1,l=1,h=0,E=0,v=0,N=0,w=u[0],M=u[1];if(u=w.match(S),null!==u)n=+u[1],s=+u[2],l=+u[3];else if(u=w.match(R),null!==u)n=+u[1],s=+u[2];else if(u=w.match(T),null!==u)n=+u[1];else{var C;if(u=w.match(g),null!==u)n=+u[1],C=+u[2],a=o(n);else if(u=w.match(A),null!==u){n=+u[1];var P=+u[2],D=+u[3]||0,L=new Date(Date.UTC(n,0,4));C=7*P+D-L.getUTCDay()-3}i=new Date(Date.UTC(n,0,1)),i.setUTCDate(C),s=i.getUTCMonth()+1,l=i.getUTCDate()}a=o(n);var U;if(r(M)){u=M.match(O),null!==u?(h=+u[1],E=+u[2],v=+u[3],N=1e3*+(u[4]||0),U=5):(u=M.match(I),null!==u?(h=+u[1],E=+u[2],v=60*+(u[3]||0),U=4):(u=M.match(x),null!==u&&(h=+u[1],E=60*+(u[2]||0),U=3)));var b=u[U],F=+u[U+1],z=+(u[U+2]||0);switch(b){case"+":h-=F,E-=z;break;case"-":h+=F,E+=z;break;case"Z":break;default:E+=new Date(Date.UTC(n,s-1,l,h,E)).getTimezoneOffset()}}else E+=new Date(n,s-1,l).getTimezoneOffset();var B=60===v;for(B&&v--;E>=60;)E-=60,h++;for(;h>=24;)h-=24,l++;for(i=a&&2===s?_:m[s-1];l>i;)l-=i,s++,s>12&&(s-=12,n++),i=a&&2===s?_:m[s-1];for(;E<0;)E+=60,h--;for(;h<0;)h+=24,l--;for(;l<1;)s--,s<1&&(s+=12,n--),i=a&&2===s?_:m[s-1],l+=i;var G=p(n,s,l,h,E,v,N);return r(t)?(d(G[0],G[1],t),f(t)):t=new y(G[0],G[1],c.UTC),B&&y.addSeconds(t,1,t),t},y.now=function(e){return y.fromDate(new Date,e)};var w=new y(0,0,c.TAI);return y.toGregorianDate=function(e,t){var n=!1,i=h(e,w);r(i)||(y.addSeconds(e,-1,w),i=h(w,w),n=!0);var o=i.dayNumber,u=i.secondsOfDay;u>=43200&&(o+=1);var c=o+68569|0,l=4*c/146097|0;c=c-((146097*l+3)/4|0)|0;var f=4e3*(c+1)/1461001|0;c=c-(1461*f/4|0)+31|0;var d=80*c/2447|0,p=c-(2447*d/80|0)|0;c=d/11|0;var E=d+2-12*c|0,m=100*(l-49)+f+c|0,_=u/s.SECONDS_PER_HOUR|0,v=u-_*s.SECONDS_PER_HOUR,T=v/s.SECONDS_PER_MINUTE|0;v-=T*s.SECONDS_PER_MINUTE;var R=0|v,g=(v-R)/s.SECONDS_PER_MILLISECOND;return _+=12,_>23&&(_-=24),n&&(R+=1),r(t)?(t.year=m,t.month=E,t.day=p,t.hour=_,t.minute=T,t.second=R,t.millisecond=g,t.isLeapSecond=n,t):new a(m,E,p,_,T,R,g,n)},y.toDate=function(e){var t=y.toGregorianDate(e,E),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))},y.toIso8601=function(t,n){var i,a=y.toGregorianDate(t,a);return r(n)||0===a.millisecond?r(n)&&0!==n?(i=(.01*a.millisecond).toFixed(n).replace(".","").slice(0,n),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",a.year,a.month,a.day,a.hour,a.minute,a.second,i)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",a.year,a.month,a.day,a.hour,a.minute,a.second):(i=(.01*a.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",a.year,a.month,a.day,a.hour,a.minute,a.second,i))},y.clone=function(e,t){if(r(e))return r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new y(e.dayNumber,e.secondsOfDay,c.TAI)},y.compare=function(e,t){var n=e.dayNumber-t.dayNumber;return 0!==n?n:e.secondsOfDay-t.secondsOfDay},y.equals=function(e,t){return e===t||r(e)&&r(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},y.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(y.secondsDifference(e,t))<=n},y.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},y.secondsDifference=function(e,t){var n=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return n+(e.secondsOfDay-t.secondsOfDay)},y.daysDifference=function(e,t){var n=e.dayNumber-t.dayNumber,r=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return n+r},y.computeTaiMinusUtc=function(e){v.julianDate=e;var n=y.leapSeconds,r=t(n,v,l);return r<0&&(r=~r,--r,r<0&&(r=0)),n[r].offset},y.addSeconds=function(e,t,n){return d(e.dayNumber,e.secondsOfDay+t,n)},y.addMinutes=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return d(e.dayNumber,r,n)},y.addHours=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return d(e.dayNumber,r,n)},y.addDays=function(e,t,n){var r=e.dayNumber+t;return d(r,e.secondsOfDay,n)},y.lessThan=function(e,t){return y.compare(e,t)<0},y.lessThanOrEquals=function(e,t){return y.compare(e,t)<=0},y.greaterThan=function(e,t){return y.compare(e,t)>0},y.greaterThanOrEquals=function(e,t){return y.compare(e,t)>=0},y.prototype.clone=function(e){return y.clone(this,e)},y.prototype.equals=function(e){return y.equals(this,e)},y.prototype.equalsEpsilon=function(e,t){return y.equalsEpsilon(this,e,t)},y.prototype.toString=function(){return y.toIso8601(this)},y.leapSeconds=[new u(new y(2441317,43210,c.TAI),10),new u(new y(2441499,43211,c.TAI),11),new u(new y(2441683,43212,c.TAI),12),new u(new y(2442048,43213,c.TAI),13),new u(new y(2442413,43214,c.TAI),14),new u(new y(2442778,43215,c.TAI),15),new u(new y(2443144,43216,c.TAI),16),new u(new y(2443509,43217,c.TAI),17),new u(new y(2443874,43218,c.TAI),18),new u(new y(2444239,43219,c.TAI),19),new u(new y(2444786,43220,c.TAI),20),new u(new y(2445151,43221,c.TAI),21),new u(new y(2445516,43222,c.TAI),22),new u(new y(2446247,43223,c.TAI),23),new u(new y(2447161,43224,c.TAI),24),new u(new y(2447892,43225,c.TAI),25),new u(new y(2448257,43226,c.TAI),26),new u(new y(2448804,43227,c.TAI),27),new u(new y(2449169,43228,c.TAI),28),new u(new y(2449534,43229,c.TAI),29),new u(new y(2450083,43230,c.TAI),30),new u(new y(2450630,43231,c.TAI),31),new u(new y(2451179,43232,c.TAI),32),new u(new y(2453736,43233,c.TAI),33),new u(new y(2454832,43234,c.TAI),34),new u(new y(2456109,43235,c.TAI),35),new u(new y(2457204,43236,c.TAI),36),new u(new y(2457754,43237,c.TAI),37)],y}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(n,r){if(null===n||"object"!=typeof n)return n;r=e(r,!1);var i=new n.constructor;for(var a in n)if(n.hasOwnProperty(a)){var o=n[a];r&&(o=t(o,r)),i[a]=o}return i}return t}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var n=e.split("\r\n"),r=0;r<n.length;++r){var i=n[r],a=i.indexOf(": ");if(a>0){var o=i.substring(0,a),u=i.substring(a+2);t[o]=u}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function n(e,n,r){this.statusCode=e,this.response=n,this.responseHeaders=r,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return n.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},n}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var n=r.exec(t);this.scheme=n[1],this.authority=n[2],this.path=n[3],this.query=n[4],this.fragment=n[5]}}function t(e){var t=unescape(e);return a.test(t)?t:e.toUpperCase()}function n(e,t,n,r){return(t||"")+n.toLowerCase()+(r||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var r=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(o,n).replace(i,t)),this.path&&(this.path=this.path.replace(i,t)),this.query&&(this.query=this.query.replace(i,t)),this.fragment&&(this.fragment=this.fragment.replace(i,t))};var i=/%[0-9a-z]{2}/gi,a=/[a-zA-Z0-9\-\._~]/,o=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var n=new e;return this.scheme?(n.scheme=this.scheme,n.authority=this.authority,n.path=this.path,n.query=this.query):(n.scheme=t.scheme,this.authority?(n.authority=this.authority,n.path=this.path,n.query=this.query):(n.authority=t.authority,""==this.path?(n.path=t.path,n.query=this.query||t.query):("/"==this.path.charAt(0)?(n.path=this.path,n.removeDotSegments()):(t.authority&&""==t.path?n.path="/"+this.path:n.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,n.removeDotSegments()),n.query=this.query))),n.fragment=this.fragment,n},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),n=[],r=""==t[0];r&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?n.pop():"."!=e&&n.push(e);"."!=e&&".."!=e||n.push(""),r&&n.unshift(""),this.path=n.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n){var r=new e(n);r.normalize();var i=r.getAuthority();if(t(i)){if(i.indexOf("@")!==-1){var a=i.split("@");i=a[1]}if(i.indexOf(":")===-1){var o=r.getScheme();if(t(o)||(o=window.location.protocol,o=o.substring(0,o.length-1)),"http"===o)i+=":80";else{if("https"!==o)return;i+=":443"}}return i}}var i={},a={};return i.add=function(e,n){var r=e.toLowerCase()+":"+n;t(a[r])||(a[r]=!0)},i.remove=function(e,n){var r=e.toLowerCase()+":"+n;t(a[r])&&delete a[r]},i.contains=function(e){var n=r(e);return!(!t(n)||!t(a[n]))},i.clear=function(){a={}},i}),define("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,n,r,i,a,o){"use strict";function u(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,i=t(n.method,"GET"),a=n.data,o=n.headers,s=n.overrideMimeType;return e(n.url,function(t){var n=e.defer();return u.load(t,r,i,a,o,n,s),n.promise})}function s(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function c(e,t){for(var n=s(e,t),r=new ArrayBuffer(n.length),i=new Uint8Array(r),a=0;a<n.length;a++)i[a]=n.charCodeAt(a);return r}function l(e,n){n=t(n,"");var r=e[1],i=!!e[2],a=e[3];switch(n){case"":case"text":return s(i,a);case"arraybuffer":return c(i,a);case"blob":var o=c(i,a);return new Blob([o],{type:r});case"document":var u=new DOMParser;return u.parseFromString(s(i,a),r);case"json":return JSON.parse(s(i,a))}}var f=/^data:(.*?)(;base64)?,(.*)$/;return u.load=function(e,t,r,u,s,c,h){var d=f.exec(e);if(null!==d)return void c.resolve(l(d,t));var p=new XMLHttpRequest;if(o.contains(e)&&(p.withCredentials=!0),n(h)&&n(p.overrideMimeType)&&p.overrideMimeType(h),p.open(r,e,!0),n(s))for(var y in s)s.hasOwnProperty(y)&&p.setRequestHeader(y,s[y]);n(t)&&(p.responseType=t),p.onload=function(){if(p.status<200||p.status>=300)return void c.reject(new i(p.status,p.response,p.getAllResponseHeaders()));var e=p.response,r=p.responseType;if(!n(e)||n(t)&&r!==t)if("json"===t&&"string"==typeof e)try{c.resolve(JSON.parse(e))}catch(e){c.reject(e)}else(""===r||"document"===r)&&n(p.responseXML)&&p.responseXML.hasChildNodes()?c.resolve(p.responseXML):""!==r&&"text"!==r||!n(p.responseText)?c.reject(new a("Invalid XMLHttpRequest response type.")):c.resolve(p.responseText);else c.resolve(e)},p.onerror=function(e){c.reject(new i)},p.send(u)},u.defaultLoad=u.load,u}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,n){return e({url:t,headers:n})}return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";function i(n,i){return t(i)?t(i.Accept)||(i=e(i),i.Accept=a.Accept):i=a,r(n,i).then(function(e){return JSON.parse(e)})}var a={Accept:"application/json,*/*;q=0.01"};return i}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,n,r,i,a,o,u,s,c,l,f){"use strict";function h(t){if(t=n(t,n.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=n(t.addNewLeapSeconds,!0),r(t.data))p(this,t.data);else if(r(t.url)){var i=this;this._downloadPromise=e(s(t.url),function(e){p(i,e)},function(){i._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else p(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function d(e,t){return o.compare(e.julianDate,t)}function p(e,n){if(!r(n.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!r(n.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var i=n.columnNames.indexOf("modifiedJulianDateUtc"),a=n.columnNames.indexOf("xPoleWanderRadians"),s=n.columnNames.indexOf("yPoleWanderRadians"),c=n.columnNames.indexOf("ut1MinusUtcSeconds"),h=n.columnNames.indexOf("xCelestialPoleOffsetRadians"),p=n.columnNames.indexOf("yCelestialPoleOffsetRadians"),y=n.columnNames.indexOf("taiMinusUtcSeconds");if(i<0||a<0||s<0||c<0||h<0||p<0||y<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var E=e._samples=n.samples,m=e._dates=[];e._dateColumn=i,e._xPoleWanderRadiansColumn=a,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=h,e._yCelestialPoleOffsetRadiansColumn=p,e._taiMinusUtcSecondsColumn=y,e._columnCount=n.columnNames.length,e._lastIndex=void 0;for(var _,v=e._addNewLeapSeconds,T=0,R=E.length;T<R;T+=e._columnCount){var g=E[T+i],A=E[T+y],S=g+l.MODIFIED_JULIAN_DATE_DIFFERENCE,N=new o(S,A,f.TAI);if(m.push(N),v){if(A!==_&&r(_)){var x=o.leapSeconds,I=t(x,N,d);if(I<0){var O=new u(N,A);x.splice(~I,0,O)}}_=A}}}function y(e,t,n,r,i){var a=n*r;i.xPoleWander=t[a+e._xPoleWanderRadiansColumn],i.yPoleWander=t[a+e._yPoleWanderRadiansColumn],i.xPoleOffset=t[a+e._xCelestialPoleOffsetRadiansColumn],i.yPoleOffset=t[a+e._yCelestialPoleOffsetRadiansColumn],i.ut1MinusUtc=t[a+e._ut1MinusUtcSecondsColumn]}function E(e,t,n){return t+e*(n-t)}function m(e,t,n,r,i,a,u){var s=e._columnCount;if(a>t.length-1)return u.xPoleWander=0,u.yPoleWander=0,u.xPoleOffset=0,u.yPoleOffset=0,u.ut1MinusUtc=0,u;var c=t[i],l=t[a];if(c.equals(l)||r.equals(c))return y(e,n,i,s,u),u;if(r.equals(l))return y(e,n,a,s,u),u;var f=o.secondsDifference(r,c)/o.secondsDifference(l,c),h=i*s,d=a*s,p=n[h+e._ut1MinusUtcSecondsColumn],m=n[d+e._ut1MinusUtcSecondsColumn],_=m-p;if(_>.5||_<-.5){var v=n[h+e._taiMinusUtcSecondsColumn],T=n[d+e._taiMinusUtcSecondsColumn];v!==T&&(l.equals(r)?p=m:m-=T-v)}return u.xPoleWander=E(f,n[h+e._xPoleWanderRadiansColumn],n[d+e._xPoleWanderRadiansColumn]),u.yPoleWander=E(f,n[h+e._yPoleWanderRadiansColumn],n[d+e._yPoleWanderRadiansColumn]),u.xPoleOffset=E(f,n[h+e._xCelestialPoleOffsetRadiansColumn],n[d+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=E(f,n[h+e._yCelestialPoleOffsetRadiansColumn],n[d+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=E(f,p,m),u}return h.NONE=a({getPromiseToLoad:function(){return e()},compute:function(e,t){return r(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new i(0,0,0,0,0),t}}),h.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},h.prototype.compute=function(e,n){if(r(this._samples)){if(r(n)||(n=new i(0,0,0,0,0)),0===this._samples.length)return n.xPoleWander=0,n.yPoleWander=0,n.xPoleOffset=0,n.yPoleOffset=0,n.ut1MinusUtc=0,n;var a=this._dates,u=this._lastIndex,s=0,l=0;if(r(u)){var f=a[u],h=a[u+1],d=o.lessThanOrEquals(f,e),p=!r(h),y=p||o.greaterThanOrEquals(h,e);if(d&&y)return s=u,!p&&h.equals(e)&&++s,l=s+1,m(this,a,this._samples,e,s,l,n),n}var E=t(a,e,o.compare,this._dateColumn);return E>=0?(E<a.length-1&&a[E+1].equals(e)&&++E,s=E,l=E):(l=~E,s=l-1,s<0&&(s=0)),this._lastIndex=s,m(this,a,this._samples,e,s,l,n),n}if(r(this._dataError))throw new c(this._dataError)},h}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function i(t,n,r){this.heading=e(t,0),this.pitch=e(n,0),this.roll=e(r,0)}return i.fromQuaternion=function(e,n){t(n)||(n=new i);var r=2*(e.w*e.y-e.z*e.x),a=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return n.heading=-Math.atan2(s,u),n.roll=Math.atan2(o,a),n.pitch=-Math.asin(r),n},i.fromDegrees=function(e,n,a,o){return t(o)||(o=new i),o.heading=e*r.RADIANS_PER_DEGREE,o.pitch=n*r.RADIANS_PER_DEGREE,o.roll=a*r.RADIANS_PER_DEGREE,o},i.clone=function(e,n){if(t(e))return t(n)?(n.heading=e.heading,n.pitch=e.pitch,n.roll=e.roll,n):new i(e.heading,e.pitch,e.roll)},i.equals=function(e,n){return e===n||t(e)&&t(n)&&e.heading===n.heading&&e.pitch===n.pitch&&e.roll===n.roll},i.equalsEpsilon=function(e,n,i,a){return e===n||t(e)&&t(n)&&r.equalsEpsilon(e.heading,n.heading,i,a)&&r.equalsEpsilon(e.pitch,n.pitch,i,a)&&r.equalsEpsilon(e.roll,n.roll,i,a)},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i.prototype.equalsEpsilon=function(e,t,n){return i.equalsEpsilon(this,e,t,n)},i.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},i}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function i(n,r){r=t(r,document.location.href);var i=new e(r),a=new e(n);return a.resolve(i).toString()}return i}),define("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function i(r,i,a){a=t(a,!0),r instanceof e||(r=new e(r)),i instanceof e||(i=new e(i)),n(i.authority)&&!n(i.scheme)&&("undefined"!=typeof document&&n(document.location)&&n(document.location.href)?i.scheme=new e(document.location.href).scheme:i.scheme=r.scheme);var o=r;i.isAbsolute()&&(o=i);var u="";n(o.scheme)&&(u+=o.scheme+":"),n(o.authority)&&(u+="//"+o.authority,""!==o.path&&"/"!==o.path&&(u=u.replace(/\/?$/,"/"),o.path=o.path.replace(/^\/?/g,""))),u+=o===r?a?r.path.replace(/\/?$/,"/")+i.path.replace(/^\/?/g,""):r.path+i.path:i.path;var s=n(r.query),c=n(i.query);s&&c?u+="?"+r.query+"&"+i.query:s&&!c?u+="?"+r.query:!s&&c&&(u+="?"+i.query);var l=n(i.fragment);return n(r.fragment)&&!l?u+="#"+r.fragment:l&&(u+="#"+i.fragment),u}return i}),define("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","./joinUrls","require"],function(e,t,n,r,i,a){"use strict";function o(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;t<n;++t){var r=e[t].getAttribute("src"),i=p.exec(r);if(null!==i)return i[1]}}function u(){if(t(f))return f;var n;return n="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:o(),f=new e(r(n))}function s(e){return a.toUrl("../"+e)}function c(e){return i(u(),e)}function l(e){t(h)||(h=t(a.toUrl)?s:c),t(d)||(d=document.createElement("a")); +var n=h(e);return d.href=n,d.href=d.href,d.href}var f,h,d,p=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return l._cesiumScriptRegex=p,l.setBaseUrl=function(t){f=new e(t).resolve(new e(document.location.href))},l}),define("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,n){this.x=e,this.y=t,this.s=n}return e}),define("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,n,r,i,a,o,u){"use strict";function s(e){e=n(e,n.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=n(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=n(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new a(this._sampleZeroJulianEphemerisDate,0,u.TAI),this._stepSizeDays=n(e.stepSizeDays,1),this._samplesPerXysFile=n(e.samplesPerXysFile,1e3),this._totalSamples=n(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,r=this._denominators=new Array(t+1),i=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t),s=0;s<=t;++s){r[s]=o,i[s]=s*this._stepSizeDays;for(var c=0;c<=t;++c)c!==s&&(r[s]*=s-c);r[s]=1/r[s]}this._work=new Array(t+1),this._coef=new Array(t+1)}function c(e,t,n){var r=f;return r.dayNumber=t,r.secondsOfDay=n,a.daysDifference(r,e._sampleZeroDateTT)}function l(n,i){if(n._chunkDownloadsInProgress[i])return n._chunkDownloadsInProgress[i];var a=e.defer();n._chunkDownloadsInProgress[i]=a;var u,s=n._xysFileUrlTemplate;return u=r(s)?s.replace("{0}",i):t("Assets/IAU2006_XYS/IAU2006_XYS_"+i+".json"),e(o(u),function(e){n._chunkDownloadsInProgress[i]=!1;for(var t=n._samples,r=e.samples,o=i*n._samplesPerXysFile*3,u=0,s=r.length;u<s;++u)t[o+u]=r[u];a.resolve()}),a.promise}var f=new a(0,0,u.TAI);return s.prototype.preload=function(t,n,r,i){var a=c(this,t,n),o=c(this,r,i),u=a/this._stepSizeDays-this._interpolationOrder/2|0;u<0&&(u=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var f=u/this._samplesPerXysFile|0,h=s/this._samplesPerXysFile|0,d=[],p=f;p<=h;++p)d.push(l(this,p));return e.all(d)},s.prototype.computeXysRadians=function(e,t,n){var a=c(this,e,t);if(!(a<0)){var o=a/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);s<0&&(s=0);var f=s+u;f>=this._totalSamples&&(f=this._totalSamples-1,s=f-u,s<0&&(s=0));var h=!1,d=this._samples;if(r(d[3*s])||(l(this,s/this._samplesPerXysFile|0),h=!0),r(d[3*f])||(l(this,f/this._samplesPerXysFile|0),h=!0),!h){r(n)?(n.x=0,n.y=0,n.s=0):n=new i(0,0,0);var p,y,E=a-s*this._stepSizeDays,m=this._work,_=this._denominators,v=this._coef,T=this._xTable;for(p=0;p<=u;++p)m[p]=E-T[p];for(p=0;p<=u;++p){for(v[p]=1,y=0;y<=u;++y)y!==p&&(v[p]*=m[y]);v[p]*=_[p];var R=3*(s+p);n.x+=v[p]*d[R++],n.y+=v[p]*d[R++],n.s+=v[p]*d[R]}return n}}}},s}),define("Core/Quaternion",["./Cartesian3","./Check","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math","./Matrix3"],function(e,t,n,r,i,a,o,u,s){"use strict";function c(e,t,r,i){this.x=n(e,0),this.y=n(t,0),this.z=n(r,0),this.w=n(i,0)}var l=new e;c.fromAxisAngle=function(t,n,i){var a=n/2,o=Math.sin(a);l=e.normalize(t,l);var u=l.x*o,s=l.y*o,f=l.z*o,h=Math.cos(a);return r(i)?(i.x=u,i.y=s,i.z=f,i.w=h,i):new c(u,s,f,h)};var f=[1,2,0],h=new Array(3);c.fromRotationMatrix=function(e,t){var n,i,a,o,u,l=e[s.COLUMN0ROW0],d=e[s.COLUMN1ROW1],p=e[s.COLUMN2ROW2],y=l+d+p;if(y>0)n=Math.sqrt(y+1),u=.5*n,n=.5/n,i=(e[s.COLUMN1ROW2]-e[s.COLUMN2ROW1])*n,a=(e[s.COLUMN2ROW0]-e[s.COLUMN0ROW2])*n,o=(e[s.COLUMN0ROW1]-e[s.COLUMN1ROW0])*n;else{var E=f,m=0;d>l&&(m=1),p>l&&p>d&&(m=2);var _=E[m],v=E[_];n=Math.sqrt(e[s.getElementIndex(m,m)]-e[s.getElementIndex(_,_)]-e[s.getElementIndex(v,v)]+1);var T=h;T[m]=.5*n,n=.5/n,u=(e[s.getElementIndex(v,_)]-e[s.getElementIndex(_,v)])*n,T[_]=(e[s.getElementIndex(_,m)]+e[s.getElementIndex(m,_)])*n,T[v]=(e[s.getElementIndex(v,m)]+e[s.getElementIndex(m,v)])*n,i=-T[0],a=-T[1],o=-T[2]}return r(t)?(t.x=i,t.y=a,t.z=o,t.w=u,t):new c(i,a,o,u)};var d=new c;c.fromHeadingPitchRoll=function(t,n,r,i){var a=c.fromAxisAngle(e.UNIT_X,r,d),o=c.fromAxisAngle(e.UNIT_Y,-n,i);i=c.multiply(o,a,o);var u=c.fromAxisAngle(e.UNIT_Z,-t,d);return c.multiply(u,i,i)};var p=new e,y=new e,E=new c,m=new c,_=new c;c.packedLength=4,c.pack=function(e,t,r){return r=n(r,0),t[r++]=e.x,t[r++]=e.y,t[r++]=e.z,t[r]=e.w,t},c.unpack=function(e,t,i){return t=n(t,0),r(i)||(i=new c),i.x=e[t],i.y=e[t+1],i.z=e[t+2],i.w=e[t+3],i},c.packedInterpolationLength=3,c.convertPackedArrayForInterpolation=function(e,t,n,r){c.unpack(e,4*n,_),c.conjugate(_,_);for(var i=0,a=n-t+1;i<a;i++){var o=3*i;c.unpack(e,4*(t+i),E),c.multiply(E,_,E),E.w<0&&c.negate(E,E),c.computeAxis(E,p);var u=c.computeAngle(E);r[o]=p.x*u,r[o+1]=p.y*u,r[o+2]=p.z*u}},c.unpackInterpolationResult=function(t,n,i,a,o){r(o)||(o=new c),e.fromArray(t,0,y);var u=e.magnitude(y);return c.unpack(n,4*a,m),0===u?c.clone(c.IDENTITY,E):c.fromAxisAngle(y,u,E),c.multiply(E,m,o)},c.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new c(e.x,e.y,e.z,e.w)},c.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},c.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},c.magnitude=function(e){return Math.sqrt(c.magnitudeSquared(e))},c.normalize=function(e,t){var n=1/c.magnitude(e),r=e.x*n,i=e.y*n,a=e.z*n,o=e.w*n;return t.x=r,t.y=i,t.z=a,t.w=o,t},c.inverse=function(e,t){var n=c.magnitudeSquared(e);return t=c.conjugate(e,t),c.multiplyByScalar(t,1/n,t)},c.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},c.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},c.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},c.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},c.multiply=function(e,t,n){var r=e.x,i=e.y,a=e.z,o=e.w,u=t.x,s=t.y,c=t.z,l=t.w,f=o*u+r*l+i*c-a*s,h=o*s-r*c+i*l+a*u,d=o*c+r*s-i*u+a*l,p=o*l-r*u-i*s-a*c;return n.x=f,n.y=h,n.z=d,n.w=p,n},c.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},c.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},c.computeAxis=function(e,t){var n=e.w;if(Math.abs(n-1)<u.EPSILON6)return t.x=t.y=t.z=0,t;var r=1/Math.sqrt(1-n*n);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},c.computeAngle=function(e){return Math.abs(e.w-1)<u.EPSILON6?0:2*Math.acos(e.w)};var v=new c;c.lerp=function(e,t,n,r){return v=c.multiplyByScalar(t,n,v),r=c.multiplyByScalar(e,1-n,r),c.add(v,r,r)};var T=new c,R=new c,g=new c;c.slerp=function(e,t,n,r){var i=c.dot(e,t),a=t;if(i<0&&(i=-i,a=T=c.negate(t,T)),1-i<u.EPSILON6)return c.lerp(e,a,n,r);var o=Math.acos(i);return R=c.multiplyByScalar(e,Math.sin((1-n)*o),R),g=c.multiplyByScalar(a,Math.sin(n*o),g),r=c.add(R,g,r),c.multiplyByScalar(r,1/Math.sin(o),r)},c.log=function(t,n){var r=u.acosClamped(t.w),i=0;return 0!==r&&(i=r/Math.sin(r)),e.multiplyByScalar(t,i,n)},c.exp=function(t,n){var r=e.magnitude(t),i=0;return 0!==r&&(i=Math.sin(r)/r),n.x=t.x*i,n.y=t.y*i,n.z=t.z*i,n.w=Math.cos(r),n};var A=new e,S=new e,N=new c,x=new c;c.computeInnerQuadrangle=function(t,n,r,i){var a=c.conjugate(n,N);c.multiply(a,r,x);var o=c.log(x,A);c.multiply(a,t,x);var u=c.log(x,S);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),c.exp(o,N),c.multiply(n,N,i)},c.squad=function(e,t,n,r,i,a){var o=c.slerp(e,t,i,N),u=c.slerp(n,r,i,x);return c.slerp(o,u,2*i*(1-i),a)};for(var I=new c,O=1.9011074535173003,w=a.supportsTypedArrays()?new Float32Array(8):[],M=a.supportsTypedArrays()?new Float32Array(8):[],C=a.supportsTypedArrays()?new Float32Array(8):[],P=a.supportsTypedArrays()?new Float32Array(8):[],D=0;D<7;++D){var L=D+1,U=2*L+1;w[D]=1/(L*U),M[D]=L/U}return w[7]=O/136,M[7]=8*O/17,c.fastSlerp=function(e,t,n,r){var i,a=c.dot(e,t);a>=0?i=1:(i=-1,a=-a);for(var o=a-1,u=1-n,s=n*n,l=u*u,f=7;f>=0;--f)C[f]=(w[f]*s-M[f])*o,P[f]=(w[f]*l-M[f])*o;var h=i*n*(1+C[0]*(1+C[1]*(1+C[2]*(1+C[3]*(1+C[4]*(1+C[5]*(1+C[6]*(1+C[7])))))))),d=u*(1+P[0]*(1+P[1]*(1+P[2]*(1+P[3]*(1+P[4]*(1+P[5]*(1+P[6]*(1+P[7])))))))),p=c.multiplyByScalar(e,d,I);return c.multiplyByScalar(t,h,r),c.add(p,r,r)},c.fastSquad=function(e,t,n,r,i,a){var o=c.fastSlerp(e,t,i,N),u=c.fastSlerp(n,r,i,x);return c.fastSlerp(o,u,2*i*(1-i),a)},c.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},c.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n},c.ZERO=o(new c(0,0,0,0)),c.IDENTITY=o(new c(0,0,0,1)),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.x+", "+this.y+", "+this.z+", "+this.w+")"},c}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./Check","./defaultValue","./defined","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./HeadingPitchRoll","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,n,r,i,a,o,u,s,c,l,f,h,d,p,y,E,m,_,v,T){"use strict";var R={},g=new n,A=new n,S=new n;R.eastNorthUpToFixedFrame=function(e,t,r){if(E.equalsEpsilon(e.x,0,E.EPSILON14)&&E.equalsEpsilon(e.y,0,E.EPSILON14)){var i=E.sign(e.z);return u(r)?(r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=-i,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=i,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(0,-i,0,e.x,1,0,0,e.y,0,0,i,e.z,0,0,0,1)}var a=g,s=A,c=S;return t=o(t,f.WGS84),t.geodeticSurfaceNormal(e,a),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(a,s,c),u(r)?(r[0]=s.x,r[1]=s.y,r[2]=s.z,r[3]=0,r[4]=c.x,r[5]=c.y,r[6]=c.z,r[7]=0,r[8]=a.x,r[9]=a.y,r[10]=a.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(s.x,c.x,a.x,e.x,s.y,c.y,a.y,e.y,s.z,c.z,a.z,e.z,0,0,0,1)};var N=new n,x=new n,I=new n;R.northEastDownToFixedFrame=function(e,t,r){if(E.equalsEpsilon(e.x,0,E.EPSILON14)&&E.equalsEpsilon(e.y,0,E.EPSILON14)){var i=E.sign(e.z);return u(r)?(r[0]=-i,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=-i,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(-i,0,0,e.x,0,1,0,e.y,0,0,-i,e.z,0,0,0,1)}var a=N,s=x,c=I;return t=o(t,f.WGS84),t.geodeticSurfaceNormal(e,a),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(a,s,c),u(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=s.x,r[5]=s.y,r[6]=s.z,r[7]=0,r[8]=-a.x,r[9]=-a.y,r[10]=-a.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(c.x,s.x,-a.x,e.x,c.y,s.y,-a.y,e.y,c.z,s.z,-a.z,e.z,0,0,0,1)},R.northUpEastToFixedFrame=function(e,t,r){if(E.equalsEpsilon(e.x,0,E.EPSILON14)&&E.equalsEpsilon(e.y,0,E.EPSILON14)){var i=E.sign(e.z);return u(r)?(r[0]=-i,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=i,r[7]=0,r[8]=0,r[9]=1,r[10]=0,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(-i,0,0,e.x,0,0,1,e.y,0,i,0,e.z,0,0,0,1)}var a=g,s=A,c=S;return t=o(t,f.WGS84),t.geodeticSurfaceNormal(e,a),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(a,s,c),u(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=a.x,r[5]=a.y,r[6]=a.z,r[7]=0,r[8]=s.x,r[9]=s.y,r[10]=s.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(c.x,a.x,s.x,e.x,c.y,a.y,s.y,e.y,c.z,a.z,s.z,e.z,0,0,0,1)},R.northWestUpToFixedFrame=function(e,t,r){if(E.equalsEpsilon(e.x,0,E.EPSILON14)&&E.equalsEpsilon(e.y,0,E.EPSILON14)){var i=E.sign(e.z);return u(r)?(r[0]=-i,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=i,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(-i,0,0,e.x,0,-1,0,e.y,0,0,i,e.z,0,0,0,1)}var a=g,s=A,c=S;return t=o(t,f.WGS84),t.geodeticSurfaceNormal(e,a),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(a,s,c),u(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=-s.x,r[5]=-s.y,r[6]=-s.z,r[7]=0,r[8]=a.x,r[9]=a.y,r[10]=a.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(c.x,-s.x,a.x,e.x,c.y,-s.y,a.y,e.y,c.z,-s.z,a.z,e.z,0,0,0,1)};var O=new v,w=new n(1,1,1),M=new _;R.headingPitchRollToFixedFrame=function(e,t,r,i){a.typeOf.object("headingPitchRoll",t);var o=t.heading,u=t.pitch,s=t.roll,c=v.fromHeadingPitchRoll(o,u,s,O),l=_.fromTranslationQuaternionRotationScale(n.ZERO,c,w,M);return i=R.eastNorthUpToFixedFrame(e,r,i),_.multiply(i,l,i)};var C=new _,P=new m;R.headingPitchRollQuaternion=function(e,t,n,r){a.typeOf.object("headingPitchRoll",t);var i=R.headingPitchRollToFixedFrame(e,t,n,C),o=_.getRotation(i,P);return v.fromRotationMatrix(o,r)};var D=24110.54841,L=8640184.812866,U=.093104,b=-62e-7,F=1.1772758384668e-19,z=72921158553e-15,B=E.TWO_PI/86400,G=new y;R.computeTemeToPseudoFixedMatrix=function(e,t){G=y.addSeconds(e,-y.computeTaiMinusUtc(e),G);var n,r=G.dayNumber,i=G.secondsOfDay,a=r-2451545;n=i>=43200?(a+.5)/T.DAYS_PER_JULIAN_CENTURY:(a-.5)/T.DAYS_PER_JULIAN_CENTURY;var o=D+n*(L+n*(U+n*b)),s=o*B%E.TWO_PI,c=z+F*(r-2451545.5),l=(i+.5*T.SECONDS_PER_DAY)%T.SECONDS_PER_DAY,f=s+c*l,h=Math.cos(f),d=Math.sin(f);return u(t)?(t[0]=h,t[1]=-d,t[2]=0,t[3]=d,t[4]=h,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new m(h,d,0,-d,h,0,0,0,1)},R.iau2006XysData=new d,R.earthOrientationParameters=c.NONE;var q=32.184,W=2451545;R.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+q,i=t.stop.dayNumber,a=t.stop.secondsOfDay+q,o=R.iau2006XysData.preload(n,r,i,a),u=R.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},R.computeIcrfToFixedMatrix=function(e,t){u(t)||(t=new m);var n=R.computeFixedToIcrfMatrix(e,t);if(u(n))return m.transpose(n,t)};var V=new p(0,0,0),H=new l(0,0,0,0,0,0),X=new m,Y=new m;R.computeFixedToIcrfMatrix=function(e,t){u(t)||(t=new m);var n=R.earthOrientationParameters.compute(e,H);if(u(n)){var r=e.dayNumber,i=e.secondsOfDay+q,a=R.iau2006XysData.computeXysRadians(r,i,V);if(u(a)){var o=a.x+n.xPoleOffset,s=a.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-o*o-s*s)),l=X;l[0]=1-c*o*o,l[3]=-c*o*s,l[6]=o,l[1]=-c*o*s,l[4]=1-c*s*s,l[7]=s,l[2]=-o,l[5]=-s,l[8]=1-c*(o*o+s*s);var f=m.fromRotationZ(-a.s,Y),h=m.multiply(l,f,X),d=e.dayNumber,p=e.secondsOfDay-y.computeTaiMinusUtc(e)+n.ut1MinusUtc,_=d-2451545,v=p/T.SECONDS_PER_DAY,g=.779057273264+v+.00273781191135448*(_+v);g=g%1*E.TWO_PI;var A=m.fromRotationZ(g,Y),S=m.multiply(h,A,X),N=Math.cos(n.xPoleWander),x=Math.cos(n.yPoleWander),I=Math.sin(n.xPoleWander),O=Math.sin(n.yPoleWander),w=r-W+i/T.SECONDS_PER_DAY;w/=36525;var M=-47e-6*w*E.RADIANS_PER_DEGREE/3600,C=Math.cos(M),P=Math.sin(M),D=Y;return D[0]=N*C,D[1]=N*P,D[2]=I,D[3]=-x*P+O*I*C,D[4]=x*C+O*I*P,D[5]=-O*N,D[6]=-O*P-x*I*C,D[7]=O*C-x*I*P,D[8]=x*N,m.multiply(S,D,t)}}};var k=new r;R.pointToWindowCoordinates=function(e,t,n,r){return r=R.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},R.pointToGLWindowCoordinates=function(e,n,i,a){u(a)||(a=new t);var o=k;return _.multiplyByVector(e,r.fromElements(i.x,i.y,i.z,1,o),o),r.multiplyByScalar(o,1/o.w,o),_.multiplyByVector(n,o,o),t.fromCartesian4(o,a)};var Z=new n,j=new n,K=new n;R.rotationMatrixFromPositionVelocity=function(e,t,r,i){var a=o(r,f.WGS84).geodeticSurfaceNormal(e,Z),s=n.cross(t,a,j);n.equalsEpsilon(s,n.ZERO,E.EPSILON6)&&(s=n.clone(n.UNIT_X,s));var c=n.cross(s,t,K);return n.cross(t,c,s),n.negate(s,s),u(i)||(i=new m),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=s.x,i[4]=s.y,i[5]=s.z,i[6]=c.x,i[7]=c.y,i[8]=c.z,i};var J=new i,Q=new n,$=new n,ee=new r,te=new r,ne=new r,re=new r,ie=new r,ae=new _,oe=new _;R.basisTo2D=function(e,t,i){var a=e.ellipsoid,o=_.getColumn(t,3,ee),u=a.cartesianToCartographic(o,J),s=R.eastNorthUpToFixedFrame(o,a,ae),c=_.inverseTransformation(s,oe),l=e.project(u,Q),f=te;f.x=l.z,f.y=l.x,f.z=l.y,f.w=1;var h=_.getColumn(t,0,$),d=n.magnitude(h),p=_.multiplyByVector(c,h,ne);r.fromElements(p.z,p.x,p.y,0,p);var y=_.getColumn(t,1,$),E=n.magnitude(y),m=_.multiplyByVector(c,y,re);r.fromElements(m.z,m.x,m.y,0,m);var v=_.getColumn(t,2,$),T=n.magnitude(v),g=ie;return n.cross(p,m,g),n.normalize(g,g),n.cross(m,g,p),n.normalize(p,p),n.cross(g,p,m),n.normalize(m,m),n.multiplyByScalar(p,d,p),n.multiplyByScalar(m,E,m),n.multiplyByScalar(g,T,g),_.setColumn(i,0,p,i),_.setColumn(i,1,m,i),_.setColumn(i,2,g,i),_.setColumn(i,3,f,i),i};var ue=new _(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);return R.wgs84To2DModelMatrix=function(e,t,n){var r=e.ellipsoid,i=R.eastNorthUpToFixedFrame(t,r,ae),a=_.inverseTransformation(i,oe),o=r.cartesianToCartographic(t,J),u=e.project(o,Q),s=te;s.x=u.z,s.y=u.x,s.z=u.y,s.w=1;var c=_.fromTranslation(s,ae);return _.multiply(ue,a,n),_.multiply(c,n,n),n},R}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,n,r,i,a,o,u,s,c,l,f,h,d){"use strict";function p(e,t){t=i(t,s.WGS84),e=t.scaleToGeodeticSurface(e);var r=d.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=n.fromCartesian4(l.getColumn(r,0,y)),this._yAxis=n.fromCartesian4(l.getColumn(r,1,y));var a=n.fromCartesian4(l.getColumn(r,2,y));this._plane=f.fromPointNormal(e,a)}var y=new r;o(p.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var E=new e;p.fromPoints=function(t,n){var r=e.fromPoints(t,E);return new p(r.center,n)};var m=new h,_=new n;p.prototype.projectPointOntoPlane=function(e,r){var i=m;i.origin=e,n.normalize(e,i.direction);var o=c.rayPlane(i,this._plane,_);if(a(o)||(n.negate(i.direction,i.direction),o=c.rayPlane(i,this._plane,_)),a(o)){var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return a(r)?(r.x=s,r.y=l,r):new t(s,l)}},p.prototype.projectPointsOntoPlane=function(e,t){a(t)||(t=[]);for(var n=0,r=e.length,i=0;i<r;i++){var o=this.projectPointOntoPlane(e[i],t[n]);a(o)&&(t[n]=o,n++)}return t.length=n,t},p.prototype.projectPointToNearestOnPlane=function(e,r){a(r)||(r=new t);var i=m;i.origin=e,n.clone(this._plane.normal,i.direction);var o=c.rayPlane(i,this._plane,_);a(o)||(n.negate(i.direction,i.direction),o=c.rayPlane(i,this._plane,_));var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return r.x=s,r.y=l,r},p.prototype.projectPointsToNearestOnPlane=function(e,t){a(t)||(t=[]);var n=e.length;t.length=n;for(var r=0;r<n;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var v=new n;return p.prototype.projectPointsOntoEllipsoid=function(e,t){var r=e.length;a(t)?t.length=r:t=new Array(r);for(var i=this._ellipsoid,o=this._origin,u=this._xAxis,s=this._yAxis,c=v,l=0;l<r;++l){var f=e[l];n.multiplyByScalar(u,f.x,c),a(t[l])||(t[l]=new n);var h=n.add(o,c,t[l]);n.multiplyByScalar(s,f.y,c),n.add(h,c,h),i.scaleToGeocentricSurface(h,h)}return t},p}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===n.POINTS||e===n.LINES||e===n.LINE_LOOP||e===n.LINE_STRIP||e===n.TRIANGLES||e===n.TRIANGLE_STRIP||e===n.TRIANGLE_FAN}};return e(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,i){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,i.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return a.computeNumberOfVertices=function(e){var n=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var i=e.attributes[r],a=i.values.length/i.componentsPerAttribute;n=a}return n},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(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 r}),define("Core/GeometryInstance",["./defaultValue","./defined","./DeveloperError","./Matrix4"],function(e,t,n,r){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.geometry=t.geometry,this.modelMatrix=r.clone(e(t.modelMatrix,r.IDENTITY)),this.id=t.id,this.pickPrimitive=t.pickPrimitive,this.attributes=e(t.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}return i}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r,i){"use strict";var a={};a.octEncodeInRange=function(e,t,n){if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var r=n.x,a=n.y;n.x=(1-Math.abs(a))*i.signNotZero(r),n.y=(1-Math.abs(r))*i.signNotZero(a)}return n.x=i.toSNorm(n.x,t),n.y=i.toSNorm(n.y,t),n},a.octEncode=function(e,t){return a.octEncodeInRange(e,255,t)},a.octDecodeInRange=function(e,n,r,a){if(a.x=i.fromSNorm(e,r),a.y=i.fromSNorm(n,r),a.z=1-(Math.abs(a.x)+Math.abs(a.y)),a.z<0){var o=a.x;a.x=(1-Math.abs(a.y))*i.signNotZero(o),a.y=(1-Math.abs(o))*i.signNotZero(a.y)}return t.normalize(a,a)},a.octDecode=function(e,t,n){return a.octDecodeInRange(e,t,255,n)},a.octPackFloat=function(e){return 256*e.x+e.y};var o=new e;return a.octEncodeFloat=function(e){return a.octEncode(e,o),a.octPackFloat(o)},a.octDecodeFloat=function(e,t){var n=e/256,r=Math.floor(n),i=256*(n-r);return a.octDecode(r,i,t)},a.octPack=function(e,t,n,r){var i=a.octEncodeFloat(e),u=a.octEncodeFloat(t),s=a.octEncode(n,o);return r.x=65536*s.x+i,r.y=65536*s.y+u,r},a.octUnpack=function(e,t,n,r){var i=e.x/65536,o=Math.floor(i),u=65536*(i-o);i=e.y/65536;var s=Math.floor(i),c=65536*(i-s);a.octDecodeFloat(u,t),a.octDecodeFloat(c,n),a.octDecode(o,s,r)},a.compressTextureCoordinates=function(e){var t=4095*e.x|0,n=4095*e.y|0;return 4096*t+n},a.decompressTextureCoordinates=function(e,t){var n=e/4096,r=Math.floor(n);return t.x=r/4095,t.y=(e-4096*r)/4095,t},a}),define("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function i(r,i,s,c,l){n(l)||(l=new t);var f,h,d,p,y,E,m,_;n(i.z)?(f=t.subtract(s,i,a),h=t.subtract(c,i,o),d=t.subtract(r,i,u),p=t.dot(f,f),y=t.dot(f,h),E=t.dot(f,d),m=t.dot(h,h),_=t.dot(h,d)):(f=e.subtract(s,i,a),h=e.subtract(c,i,o),d=e.subtract(r,i,u),p=e.dot(f,f),y=e.dot(f,h),E=e.dot(f,d),m=e.dot(h,h),_=e.dot(h,d));var v=1/(p*m-y*y);return l.y=(m*E-y*_)*v,l.z=(p*_-y*E)*v,l.x=1-l.y-l.z,l}var a=new t,o=new t,u=new t;return i}),define("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n,r){t(i[n])||(i[n]=!0,console.warn(e(r,n)))}var i={};return r.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.",r}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,n){"use strict";function r(e,t){n(e,t)}return r}),define("Core/EncodedCartesian3",["./Cartesian3","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(){this.high=e.clone(e.ZERO),this.low=e.clone(e.ZERO)}r.encode=function(e,n){t(n)||(n={high:0,low:0});var r;return e>=0?(r=65536*Math.floor(e/65536),n.high=r,n.low=e-r):(r=65536*Math.floor(-e/65536),n.high=-r,n.low=e+r),n};var i={high:0,low:0};r.fromCartesian=function(e,n){t(n)||(n=new r);var a=n.high,o=n.low;return r.encode(e.x,i),a.x=i.high,o.x=i.low,r.encode(e.y,i),a.y=i.high,o.y=i.low,r.encode(e.z,i),a.z=i.high,o.z=i.low,n};var a=new r;return r.writeElements=function(e,t,n){r.fromCartesian(e,a);var i=a.high,o=a.low;t[n]=i.x,t[n+1]=i.y,t[n+2]=i.z,t[n+3]=o.x,t[n+4]=o.y,t[n+5]=o.z},r}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,n,r,i){"use strict";var a={UNSIGNED_BYTE:i.UNSIGNED_BYTE,UNSIGNED_SHORT:i.UNSIGNED_SHORT,UNSIGNED_INT:i.UNSIGNED_INT};return a.getSizeInBytes=function(e){switch(e){case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},a.validate=function(t){return e(t)&&(t===a.UNSIGNED_BYTE||t===a.UNSIGNED_SHORT||t===a.UNSIGNED_INT)},a.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},a.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)},n(a)}),define("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";var r={};return r.calculateACMR=function(n){n=e(n,e.EMPTY_OBJECT);var r=n.indices,i=n.maximumIndex,a=e(n.cacheSize,24),o=r.length;if(!t(i)){i=0;for(var u=0,s=r[u];u<o;)s>i&&(i=s),++u,s=r[u]}for(var c=[],l=0;l<i+1;l++)c[l]=0;for(var f=a+1,h=0;h<o;++h)f-c[r[h]]>a&&(c[r[h]]=f,++f);return(f-a+1)/(o/3)},r.tipsify=function(n){function r(e,t,n,r){for(;t.length>=1;){var i=t[t.length-1];if(t.splice(t.length-1,1),e[i].numLiveTriangles>0)return i}for(;a<r;){if(e[a].numLiveTriangles>0)return++a,a-1;++a}return-1}function i(e,t,n,i,a,o,u){for(var s,c=-1,l=-1,f=0;f<n.length;){var h=n[f];i[h].numLiveTriangles&&(s=0,a-i[h].timeStamp+2*i[h].numLiveTriangles<=t&&(s=a-i[h].timeStamp),(s>l||l===-1)&&(l=s,c=h)),++f}return c===-1?r(i,o,e,u):c}n=e(n,e.EMPTY_OBJECT);var a,o=n.indices,u=n.maximumIndex,s=e(n.cacheSize,24),c=o.length,l=0,f=0,h=o[f],d=c;if(t(u))l=u+1;else{for(;f<d;)h>l&&(l=h),++f,h=o[f];if(l===-1)return 0;++l}for(var p=[],y=0;y<l;y++)p[y]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};f=0;for(var E=0;f<d;)p[o[f]].vertexTriangles.push(E),++p[o[f]].numLiveTriangles,p[o[f+1]].vertexTriangles.push(E),++p[o[f+1]].numLiveTriangles,p[o[f+2]].vertexTriangles.push(E),++p[o[f+2]].numLiveTriangles,++E,f+=3;var m=0,_=s+1;a=1;var v,T,R=[],g=[],A=0,S=[],N=c/3,x=[];for(y=0;y<N;y++)x[y]=!1;for(var I,O;m!==-1;){R=[],T=p[m],O=T.vertexTriangles.length;for(var w=0;w<O;++w)if(E=T.vertexTriangles[w],!x[E]){x[E]=!0,f=E+E+E;for(var M=0;M<3;++M)I=o[f],R.push(I),g.push(I),S[A]=I,++A,v=p[I],--v.numLiveTriangles,_-v.timeStamp>s&&(v.timeStamp=_,++_),++f}m=i(o,s,R,p,_,g,l)}return S},r}),define("Core/GeometryPipeline",["./AttributeCompression","./barycentricCoordinates","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./deprecationWarning","./DeveloperError","./EncodedCartesian3","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryType","./IndexDatatype","./Intersect","./IntersectionTests","./Math","./Matrix3","./Matrix4","./Plane","./PrimitiveType","./Tipsify"],function(e,t,n,r,i,a,o,u,s,c,l,f,h,d,p,y,E,m,_,v,T,R,g,A,S,N){"use strict";function x(e,t,n,r,i){e[t++]=n,e[t++]=r,e[t++]=r,e[t++]=i,e[t++]=i,e[t]=n}function I(e){for(var t=e.length,n=t/3*6,r=m.createTypedArray(t,n),i=0,a=0;a<t;a+=3,i+=6)x(r,i,e[a],e[a+1],e[a+2]);return r}function O(e){var t=e.length;if(t>=3){var n=6*(t-2),r=m.createTypedArray(t,n);x(r,0,e[0],e[1],e[2]);for(var i=6,a=3;a<t;++a,i+=6)x(r,i,e[a-1],e[a],e[a-2]);return r}return new Uint16Array}function w(e){if(e.length>0){for(var t=e.length-1,n=6*(t-1),r=m.createTypedArray(t,n),i=e[0],a=0,o=1;o<t;++o,a+=6)x(r,a,i,e[o],e[o+1]);return r}return new Uint16Array}function M(e){var t={};for(var n in e)if(e.hasOwnProperty(n)&&c(e[n])&&c(e[n].values)){var r=e[n];t[n]=new y({componentDatatype:r.componentDatatype,componentsPerAttribute:r.componentsPerAttribute,normalize:r.normalize,values:[]})}return t}function C(e,t,n){for(var r in t)if(t.hasOwnProperty(r)&&c(t[r])&&c(t[r].values))for(var i=t[r],a=0;a<i.componentsPerAttribute;++a)e[r].values.push(i.values[n*i.componentsPerAttribute+a])}function P(e,t){if(c(t))for(var n=t.values,r=n.length,a=0;a<r;a+=3)i.unpack(n,a,oe),g.multiplyByPoint(e,oe,oe),i.pack(oe,n,a)}function D(e,t){if(c(t))for(var n=t.values,r=n.length,a=0;a<r;a+=3)i.unpack(n,a,oe),R.multiplyByVector(e,oe,oe),oe=i.normalize(oe,oe),i.pack(oe,n,a)}function L(e,t){var n,r=e.length,i={},a=e[0][t].attributes;for(n in a)if(a.hasOwnProperty(n)&&c(a[n])&&c(a[n].values)){for(var o=a[n],s=o.values.length,l=!0,f=1;f<r;++f){var h=e[f][t].attributes[n];if(!c(h)||o.componentDatatype!==h.componentDatatype||o.componentsPerAttribute!==h.componentsPerAttribute||o.normalize!==h.normalize){l=!1;break}s+=h.values.length}l&&(i[n]=new y({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:u.createTypedArray(o.componentDatatype,s)}))}return i}function U(e,t){var r,a,o,u,s,l,f,h=e.length,d=(e[0].modelMatrix,c(e[0][t].indices)),y=e[0][t].primitiveType,E=L(e,t);for(r in E)if(E.hasOwnProperty(r))for(s=E[r].values,u=0,a=0;a<h;++a)for(l=e[a][t].attributes[r].values,f=l.length,o=0;o<f;++o)s[u++]=l[o];var _;if(d){var v=0;for(a=0;a<h;++a)v+=e[a][t].indices.length;var T=p.computeNumberOfVertices(new p({attributes:E,primitiveType:S.POINTS})),R=m.createTypedArray(T,v),g=0,A=0;for(a=0;a<h;++a){var N=e[a][t].indices,x=N.length;for(u=0;u<x;++u)R[g++]=A+N[u];A+=p.computeNumberOfVertices(e[a][t])}_=R}var I,O=new i,w=0;for(a=0;a<h;++a){if(I=e[a][t].boundingSphere,!c(I)){O=void 0;break}i.add(I.center,O,O)}if(c(O))for(i.divideByScalar(O,h,O),a=0;a<h;++a){I=e[a][t].boundingSphere;var M=i.magnitude(i.subtract(I.center,O,ce))+I.radius;M>w&&(w=M)}return new p({attributes:E,indices:_,primitiveType:y,boundingSphere:c(O)?new n(O,w):void 0})}function b(e){if(c(e.indices))return e;for(var t=p.computeNumberOfVertices(e),n=m.createTypedArray(t,t),r=0;r<t;++r)n[r]=r;return e.indices=n,e}function F(e){var t=p.computeNumberOfVertices(e),n=m.createTypedArray(t,3*(t-2));n[0]=1,n[1]=0,n[2]=2;for(var r=3,i=3;i<t;++i)n[r++]=i-1,n[r++]=0,n[r++]=i;return e.indices=n,e.primitiveType=S.TRIANGLES,e}function z(e){var t=p.computeNumberOfVertices(e),n=m.createTypedArray(t,3*(t-2));n[0]=0,n[1]=1,n[2]=2,t>3&&(n[3]=0,n[4]=2,n[5]=3);for(var r=6,i=3;i<t-1;i+=2)n[r++]=i,n[r++]=i-1,n[r++]=i+1,i+2<t&&(n[r++]=i,n[r++]=i+1,n[r++]=i+2);return e.indices=n,e.primitiveType=S.TRIANGLES,e}function B(e){if(c(e.indices))return e;for(var t=p.computeNumberOfVertices(e),n=m.createTypedArray(t,t),r=0;r<t;++r)n[r]=r;return e.indices=n,e}function G(e){var t=p.computeNumberOfVertices(e),n=m.createTypedArray(t,2*(t-1));n[0]=0,n[1]=1;for(var r=2,i=2;i<t;++i)n[r++]=i-1,n[r++]=i;return e.indices=n,e.primitiveType=S.LINES,e}function q(e){var t=p.computeNumberOfVertices(e),n=m.createTypedArray(t,2*t);n[0]=0,n[1]=1;for(var r=2,i=2;i<t;++i)n[r++]=i-1,n[r++]=i;return n[r++]=t-1,n[r]=0,e.indices=n,e.primitiveType=S.LINES,e}function W(e){switch(e.primitiveType){case S.TRIANGLE_FAN:return F(e);case S.TRIANGLE_STRIP:return z(e);case S.TRIANGLES:return b(e);case S.LINE_STRIP:return G(e);case S.LINE_LOOP:return q(e);case S.LINES:return B(e)}return e}function V(e,t){Math.abs(e.y)<T.EPSILON6&&(t?e.y=-T.EPSILON6:e.y=T.EPSILON6)}function H(e,t,n){if(0!==e.y&&0!==t.y&&0!==n.y)return V(e,e.y<0),V(t,t.y<0),void V(n,n.y<0);var r,i=Math.abs(e.y),a=Math.abs(t.y),o=Math.abs(n.y);r=i>a?i>o?T.sign(e.y):T.sign(n.y):a>o?T.sign(t.y):T.sign(n.y);var u=r<0;V(e,u),V(t,u),V(n,u)}function X(e,t,n,r){i.add(e,i.multiplyByScalar(i.subtract(t,e,ge),e.y/(e.y-t.y),ge),n),i.clone(n,r),V(n,!0),V(r,!1)}function Y(e,t,n){if(!(e.x>=0||t.x>=0||n.x>=0)){H(e,t,n);var r=e.y<0,i=t.y<0,a=n.y<0,o=0;o+=r?1:0,o+=i?1:0,o+=a?1:0;var u=Ie.indices;1===o?(u[1]=3,u[2]=4,u[5]=6, +u[7]=6,u[8]=5,r?(X(e,t,Ae,Ne),X(e,n,Se,xe),u[0]=0,u[3]=1,u[4]=2,u[6]=1):i?(X(t,n,Ae,Ne),X(t,e,Se,xe),u[0]=1,u[3]=2,u[4]=0,u[6]=2):a&&(X(n,e,Ae,Ne),X(n,t,Se,xe),u[0]=2,u[3]=0,u[4]=1,u[6]=0)):2===o&&(u[2]=4,u[4]=4,u[5]=3,u[7]=5,u[8]=6,r?i?a||(X(n,e,Ae,Ne),X(n,t,Se,xe),u[0]=0,u[1]=1,u[3]=0,u[6]=2):(X(t,n,Ae,Ne),X(t,e,Se,xe),u[0]=2,u[1]=0,u[3]=2,u[6]=1):(X(e,t,Ae,Ne),X(e,n,Se,xe),u[0]=1,u[1]=2,u[3]=1,u[6]=0));var s=Ie.positions;return s[0]=e,s[1]=t,s[2]=n,s.length=3,1!==o&&2!==o||(s[3]=Ae,s[4]=Se,s[5]=Ne,s[6]=xe,s.length=7),Ie}}function k(e,t){var r=e.attributes;if(0!==r.position.values.length){for(var i in r)if(r.hasOwnProperty(i)&&c(r[i])&&c(r[i].values)){var a=r[i];a.values=u.createTypedArray(a.componentDatatype,a.values)}var o=p.computeNumberOfVertices(e);return e.indices=m.createTypedArray(o,e.indices),t&&(e.boundingSphere=n.fromVertices(r.position.values)),e}}function Z(e){var t=e.attributes,n={};for(var r in t)if(t.hasOwnProperty(r)&&c(t[r])&&c(t[r].values)){var i=t[r];n[r]=new y({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return new p({attributes:n,indices:[],primitiveType:e.primitiveType})}function j(e,t,n){var r=c(e.geometry.boundingSphere);t=k(t,r),n=k(n,r),c(n)&&!c(t)?e.geometry=n:!c(n)&&c(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=n,e.geometry=void 0)}function K(e,n,a,o,u,s,l,f,h,d,p,y){if(c(s)||c(l)||c(f)||c(h)||c(d)){var E=i.fromArray(u,3*e,Oe),m=i.fromArray(u,3*n,we),_=i.fromArray(u,3*a,Me),v=t(o,E,m,_,Ce);if(c(s)){var T=i.fromArray(s,3*e,Oe),R=i.fromArray(s,3*n,we),g=i.fromArray(s,3*a,Me);i.multiplyByScalar(T,v.x,T),i.multiplyByScalar(R,v.y,R),i.multiplyByScalar(g,v.z,g);var A=i.add(T,R,T);i.add(A,g,A),i.normalize(A,A),i.pack(A,p.normal.values,3*y)}if(c(d)){var S=i.fromArray(d,3*e,Oe),N=i.fromArray(d,3*n,we),x=i.fromArray(d,3*a,Me);i.multiplyByScalar(S,v.x,S),i.multiplyByScalar(N,v.y,N),i.multiplyByScalar(x,v.z,x);var I;i.equals(S,i.ZERO)&&i.equals(N,i.ZERO)&&i.equals(x,i.ZERO)?(I=Oe,I.x=0,I.y=0,I.z=0):(I=i.add(S,N,S),i.add(I,x,I),i.normalize(I,I)),i.pack(I,p.extrudeDirection.values,3*y)}if(c(l)){var O=i.fromArray(l,3*e,Oe),w=i.fromArray(l,3*n,we),M=i.fromArray(l,3*a,Me);i.multiplyByScalar(O,v.x,O),i.multiplyByScalar(w,v.y,w),i.multiplyByScalar(M,v.z,M);var C=i.add(O,w,O);i.add(C,M,C),i.normalize(C,C),i.pack(C,p.tangent.values,3*y)}if(c(f)){var P=i.fromArray(f,3*e,Oe),D=i.fromArray(f,3*n,we),L=i.fromArray(f,3*a,Me);i.multiplyByScalar(P,v.x,P),i.multiplyByScalar(D,v.y,D),i.multiplyByScalar(L,v.z,L);var U=i.add(P,D,P);i.add(U,L,U),i.normalize(U,U),i.pack(U,p.bitangent.values,3*y)}if(c(h)){var b=r.fromArray(h,2*e,Pe),F=r.fromArray(h,2*n,De),z=r.fromArray(h,2*a,Le);r.multiplyByScalar(b,v.x,b),r.multiplyByScalar(F,v.y,F),r.multiplyByScalar(z,v.z,z);var B=r.add(b,F,b);r.add(B,z,B),r.pack(B,p.st.values,2*y)}}}function J(e,t,n,r,i,a){var o=e.position.values.length/3;if(i!==-1){var u=r[i],s=n[u];return s===-1?(n[u]=o,e.position.values.push(a.x,a.y,a.z),t.push(o),o):(t.push(s),s)}return e.position.values.push(a.x,a.y,a.z),t.push(o),o}function Q(e){var t,n,r,a,o,u=e.geometry,s=u.attributes,l=s.position.values,f=c(s.normal)?s.normal.values:void 0,h=c(s.bitangent)?s.bitangent.values:void 0,d=c(s.tangent)?s.tangent.values:void 0,p=c(s.st)?s.st.values:void 0,y=c(s.extrudeDirection)?s.extrudeDirection.values:void 0,E=u.indices,m=Z(u),_=Z(u),v=[];v.length=l.length/3;var T=[];for(T.length=l.length/3,o=0;o<v.length;++o)v[o]=-1,T[o]=-1;var R=E.length;for(o=0;o<R;o+=3){var g=E[o],A=E[o+1],S=E[o+2],N=i.fromArray(l,3*g),x=i.fromArray(l,3*A),I=i.fromArray(l,3*S),O=Y(N,x,I);if(c(O)&&O.positions.length>3)for(var w=O.positions,M=O.indices,C=M.length,P=0;P<C;++P){var D=M[P],L=w[D];L.y<0?(t=_.attributes,n=_.indices,r=v):(t=m.attributes,n=m.indices,r=T),a=J(t,n,r,E,D<3?o+D:-1,L),K(g,A,S,L,l,f,d,h,p,y,t,a)}else c(O)&&(N=O.positions[0],x=O.positions[1],I=O.positions[2]),N.y<0?(t=_.attributes,n=_.indices,r=v):(t=m.attributes,n=m.indices,r=T),a=J(t,n,r,E,o,N),K(g,A,S,N,l,f,d,h,p,y,t,a),a=J(t,n,r,E,o+1,x),K(g,A,S,x,l,f,d,h,p,y,t,a),a=J(t,n,r,E,o+2,I),K(g,A,S,I,l,f,d,h,p,y,t,a)}j(e,_,m)}function $(e){var t,n=e.geometry,r=n.attributes,a=r.position.values,o=n.indices,u=Z(n),s=Z(n),l=o.length,f=[];f.length=a.length/3;var h=[];for(h.length=a.length/3,t=0;t<f.length;++t)f[t]=-1,h[t]=-1;for(t=0;t<l;t+=2){var d=o[t],p=o[t+1],y=i.fromArray(a,3*d,Oe),E=i.fromArray(a,3*p,we);Math.abs(y.y)<T.EPSILON6&&(y.y<0?y.y=-T.EPSILON6:y.y=T.EPSILON6),Math.abs(E.y)<T.EPSILON6&&(E.y<0?E.y=-T.EPSILON6:E.y=T.EPSILON6);var m=u.attributes,_=u.indices,R=h,g=s.attributes,A=s.indices,S=f,N=v.lineSegmentPlane(y,E,Ue,Me);if(c(N)){var x=i.multiplyByScalar(i.UNIT_Y,5*T.EPSILON9,be);y.y<0&&(i.negate(x,x),m=s.attributes,_=s.indices,R=f,g=u.attributes,A=u.indices,S=h);var I=i.add(N,x,Fe);J(m,_,R,o,t,y),J(m,_,R,o,-1,I),i.negate(x,x),i.add(N,x,I),J(g,A,S,o,-1,I),J(g,A,S,o,t+1,E)}else{var O,w,M;y.y<0?(O=s.attributes,w=s.indices,M=f):(O=u.attributes,w=u.indices,M=h),J(O,w,M,o,t,y),J(O,w,M,o,t+1,E)}}j(e,s,u)}function ee(e){for(var t=e.attributes,n=t.position.values,r=t.prevPosition.values,a=t.nextPosition.values,o=n.length,u=0;u<o;u+=3){var s=i.unpack(n,u,Ge);if(!(s.x>0)){var c=i.unpack(r,u,qe);(s.y<0&&c.y>0||s.y>0&&c.y<0)&&(u-3>0?(r[u]=n[u-3],r[u+1]=n[u-2],r[u+2]=n[u-1]):i.pack(s,r,u));var l=i.unpack(a,u,We);(s.y<0&&l.y>0||s.y>0&&l.y<0)&&(u+3<o?(a[u]=n[u+3],a[u+1]=n[u+4],a[u+2]=n[u+5]):i.pack(s,a,u))}}}function te(e){var t,n,o,u=e.geometry,s=u.attributes,l=s.position.values,f=s.prevPosition.values,h=s.nextPosition.values,d=s.expandAndWidth.values,p=c(s.st)?s.st.values:void 0,y=c(s.color)?s.color.values:void 0,E=Z(u),m=Z(u),_=!1,R=l.length/3;for(t=0;t<R;t+=4){var g=t,A=t+2,S=i.fromArray(l,3*g,Ge),N=i.fromArray(l,3*A,qe);if(Math.abs(S.y)<Ze)for(S.y=Ze*(N.y<0?-1:1),l[3*t+1]=S.y,l[3*(t+1)+1]=S.y,n=3*g;n<3*g+12;n+=3)f[n]=l[3*t],f[n+1]=l[3*t+1],f[n+2]=l[3*t+2];if(Math.abs(N.y)<Ze)for(N.y=Ze*(S.y<0?-1:1),l[3*(t+2)+1]=N.y,l[3*(t+3)+1]=N.y,n=3*g;n<3*g+12;n+=3)h[n]=l[3*(t+2)],h[n+1]=l[3*(t+2)+1],h[n+2]=l[3*(t+2)+2];var x=E.attributes,I=E.indices,O=m.attributes,w=m.indices,M=v.lineSegmentPlane(S,N,Ue,Ve);if(c(M)){_=!0;var C=i.multiplyByScalar(i.UNIT_Y,ke,He);S.y<0&&(i.negate(C,C),x=m.attributes,I=m.indices,O=E.attributes,w=E.indices);var P=i.add(M,C,Xe);x.position.values.push(S.x,S.y,S.z,S.x,S.y,S.z),x.position.values.push(P.x,P.y,P.z),x.position.values.push(P.x,P.y,P.z),x.prevPosition.values.push(f[3*g],f[3*g+1],f[3*g+2]),x.prevPosition.values.push(f[3*g+3],f[3*g+4],f[3*g+5]),x.prevPosition.values.push(S.x,S.y,S.z,S.x,S.y,S.z),x.nextPosition.values.push(P.x,P.y,P.z),x.nextPosition.values.push(P.x,P.y,P.z),x.nextPosition.values.push(P.x,P.y,P.z),x.nextPosition.values.push(P.x,P.y,P.z),i.negate(C,C),i.add(M,C,P),O.position.values.push(P.x,P.y,P.z),O.position.values.push(P.x,P.y,P.z),O.position.values.push(N.x,N.y,N.z,N.x,N.y,N.z),O.prevPosition.values.push(P.x,P.y,P.z),O.prevPosition.values.push(P.x,P.y,P.z),O.prevPosition.values.push(P.x,P.y,P.z),O.prevPosition.values.push(P.x,P.y,P.z),O.nextPosition.values.push(N.x,N.y,N.z,N.x,N.y,N.z),O.nextPosition.values.push(h[3*A],h[3*A+1],h[3*A+2]),O.nextPosition.values.push(h[3*A+3],h[3*A+4],h[3*A+5]);var D=r.fromArray(d,2*g,ze),L=Math.abs(D.y);x.expandAndWidth.values.push(-1,L,1,L),x.expandAndWidth.values.push(-1,-L,1,-L),O.expandAndWidth.values.push(-1,L,1,L),O.expandAndWidth.values.push(-1,-L,1,-L);var U=i.magnitudeSquared(i.subtract(M,S,We));if(U/=i.magnitudeSquared(i.subtract(N,S,We)),c(y)){var b=a.fromArray(y,4*g,Ye),F=a.fromArray(y,4*A,Ye),z=T.lerp(b.x,F.x,U),B=T.lerp(b.y,F.y,U),G=T.lerp(b.z,F.z,U),q=T.lerp(b.w,F.w,U);for(n=4*g;n<4*g+8;++n)x.color.values.push(y[n]);for(x.color.values.push(z,B,G,q),x.color.values.push(z,B,G,q),O.color.values.push(z,B,G,q),O.color.values.push(z,B,G,q),n=4*A;n<4*A+8;++n)O.color.values.push(y[n])}if(c(p)){var W=r.fromArray(p,2*g,ze),V=r.fromArray(p,2*(t+3),Be),H=T.lerp(W.x,V.x,U);for(n=2*g;n<2*g+4;++n)x.st.values.push(p[n]);for(x.st.values.push(H,W.y),x.st.values.push(H,V.y),O.st.values.push(H,W.y),O.st.values.push(H,V.y),n=2*A;n<2*A+4;++n)O.st.values.push(p[n])}o=x.position.values.length/3-4,I.push(o,o+2,o+1),I.push(o+1,o+2,o+3),o=O.position.values.length/3-4,w.push(o,o+2,o+1),w.push(o+1,o+2,o+3)}else{var X,Y;for(S.y<0?(X=m.attributes,Y=m.indices):(X=E.attributes,Y=E.indices),X.position.values.push(S.x,S.y,S.z),X.position.values.push(S.x,S.y,S.z),X.position.values.push(N.x,N.y,N.z),X.position.values.push(N.x,N.y,N.z),n=3*t;n<3*t+12;++n)X.prevPosition.values.push(f[n]),X.nextPosition.values.push(h[n]);for(n=2*t;n<2*t+8;++n)X.expandAndWidth.values.push(d[n]),c(p)&&X.st.values.push(p[n]);if(c(y))for(n=4*t;n<4*t+16;++n)X.color.values.push(y[n]);o=X.position.values.length/3-4,Y.push(o,o+2,o+1),Y.push(o+1,o+2,o+3)}}_&&(ee(m),ee(E)),j(e,m,E)}var ne={};ne.toWireframe=function(e){var t=e.indices;if(c(t)){switch(e.primitiveType){case S.TRIANGLES:e.indices=I(t);break;case S.TRIANGLE_STRIP:e.indices=O(t);break;case S.TRIANGLE_FAN:e.indices=w(t)}e.primitiveType=S.LINES}return e},ne.createLineSegmentsForVectors=function(e,t,r){t=s(t,"normal"),r=s(r,1e4);for(var i=e.attributes.position.values,a=e.attributes[t].values,o=i.length,l=new Float64Array(2*o),f=0,h=0;h<o;h+=3)l[f++]=i[h],l[f++]=i[h+1],l[f++]=i[h+2],l[f++]=i[h]+a[h]*r,l[f++]=i[h+1]+a[h+1]*r,l[f++]=i[h+2]+a[h+2]*r;var d,E=e.boundingSphere;return c(E)&&(d=new n(E.center,E.radius+r)),new p({attributes:{position:new y({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:S.LINES,boundingSphere:d})},ne.createAttributeLocations=function(e){var t,n=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],r=e.attributes,i={},a=0,o=n.length;for(t=0;t<o;++t){var u=n[t];c(r[u])&&(i[u]=a++)}for(var s in r)r.hasOwnProperty(s)&&!c(i[s])&&(i[s]=a++);return i},ne.reorderForPreVertexCache=function(e){var t=p.computeNumberOfVertices(e),n=e.indices;if(c(n)){for(var r=new Int32Array(t),i=0;i<t;i++)r[i]=-1;for(var a,o=n,s=o.length,l=m.createTypedArray(t,s),f=0,h=0,d=0;f<s;)a=r[o[f]],a!==-1?l[h]=a:(a=o[f],r[a]=d,l[h]=d,++d),++f,++h;e.indices=l;var y=e.attributes;for(var E in y)if(y.hasOwnProperty(E)&&c(y[E])&&c(y[E].values)){for(var _=y[E],v=_.values,T=0,R=_.componentsPerAttribute,g=u.createTypedArray(_.componentDatatype,d*R);T<t;){var A=r[T];if(A!==-1)for(i=0;i<R;i++)g[R*A+i]=v[R*T+i];++T}_.values=g}}return e},ne.reorderForPostVertexCache=function(e,t){var n=e.indices;if(e.primitiveType===S.TRIANGLES&&c(n)){for(var r=n.length,i=0,a=0;a<r;a++)n[a]>i&&(i=n[a]);e.indices=N.tipsify({indices:n,maximumIndex:i,cacheSize:t})}return e},ne.fitToUnsignedShortIndices=function(e){var t=[],n=p.computeNumberOfVertices(e);if(c(e.indices)&&n>=T.SIXTY_FOUR_KILOBYTES){var r,i=[],a=[],o=0,u=M(e.attributes),s=e.indices,l=s.length;e.primitiveType===S.TRIANGLES?r=3:e.primitiveType===S.LINES?r=2:e.primitiveType===S.POINTS&&(r=1);for(var f=0;f<l;f+=r){for(var h=0;h<r;++h){var d=s[f+h],y=i[d];c(y)||(y=o++,i[d]=y,C(u,e.attributes,d)),a.push(y)}o+r>=T.SIXTY_FOUR_KILOBYTES&&(t.push(new p({attributes:u,indices:a,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),i=[],a=[],o=0,u=M(e.attributes))}0!==a.length&&t.push(new p({attributes:u,indices:a,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var re=new i,ie=new o;ne.projectTo2D=function(e,t,n,r,a){var o=e.attributes[t];a=c(a)?a:new d;for(var s=a.ellipsoid,l=o.values,f=new Float64Array(l.length),h=0,p=0;p<l.length;p+=3){var E=i.fromArray(l,p,re),m=s.cartesianToCartographic(E,ie),_=a.project(m,re);f[h++]=_.x,f[h++]=_.y,f[h++]=_.z}return e.attributes[n]=o,e.attributes[r]=new y({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:f}),delete e.attributes[t],e};var ae={high:0,low:0};ne.encodeAttribute=function(e,t,n,r){for(var i=e.attributes[t],a=i.values,o=a.length,s=new Float32Array(o),c=new Float32Array(o),l=0;l<o;++l)h.encode(a[l],ae),s[l]=ae.high,c[l]=ae.low;var f=i.componentsPerAttribute;return e.attributes[n]=new y({componentDatatype:u.FLOAT,componentsPerAttribute:f,values:s}),e.attributes[r]=new y({componentDatatype:u.FLOAT,componentsPerAttribute:f,values:c}),delete e.attributes[t],e};var oe=new i,ue=new g,se=new R;ne.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(g.equals(t,g.IDENTITY))return e;var r=e.geometry.attributes;P(t,r.position),P(t,r.prevPosition),P(t,r.nextPosition),(c(r.normal)||c(r.tangent)||c(r.bitangent))&&(g.inverse(t,ue),g.transpose(ue,ue),g.getRotation(ue,se),D(se,r.normal),D(se,r.tangent),D(se,r.bitangent));var i=e.geometry.boundingSphere;return c(i)&&(e.geometry.boundingSphere=n.transform(i,t,i)),e.modelMatrix=g.clone(g.IDENTITY),e};var ce=new i;ne.combineInstances=function(e){for(var t=[],n=[],r=e.length,i=0;i<r;++i){var a=e[i];c(a.geometry)?t.push(a):c(a.westHemisphereGeometry)&&c(a.eastHemisphereGeometry)&&n.push(a)}var o=[];return t.length>0&&o.push(U(t,"geometry")),n.length>0&&(o.push(U(n,"westHemisphereGeometry")),o.push(U(n,"eastHemisphereGeometry"))),o};var le=new i,fe=new i,he=new i,de=new i;ne.computeNormal=function(e){for(var t=e.indices,n=e.attributes,r=n.position.values,a=n.position.values.length/3,o=t.length,s=new Array(a),c=new Array(o/3),l=new Array(o),f=0;f<a;f++)s[f]={indexOffset:0,count:0,currentCount:0};var h=0;for(f=0;f<o;f+=3){var d=t[f],p=t[f+1],E=t[f+2],m=3*d,_=3*p,v=3*E;fe.x=r[m],fe.y=r[m+1],fe.z=r[m+2],he.x=r[_],he.y=r[_+1],he.z=r[_+2],de.x=r[v],de.y=r[v+1],de.z=r[v+2],s[d].count++,s[p].count++,s[E].count++,i.subtract(he,fe,he),i.subtract(de,fe,de),c[h]=i.cross(he,de,new i),h++}var T=0;for(f=0;f<a;f++)s[f].indexOffset+=T,T+=s[f].count;h=0;var R;for(f=0;f<o;f+=3){R=s[t[f]];var g=R.indexOffset+R.currentCount;l[g]=h,R.currentCount++,R=s[t[f+1]],g=R.indexOffset+R.currentCount,l[g]=h,R.currentCount++,R=s[t[f+2]],g=R.indexOffset+R.currentCount,l[g]=h,R.currentCount++,h++}var A=new Float32Array(3*a);for(f=0;f<a;f++){var S=3*f;if(R=s[f],R.count>0){for(i.clone(i.ZERO,le),h=0;h<R.count;h++)i.add(le,c[l[R.indexOffset+h]],le);i.normalize(le,le),A[S]=le.x,A[S+1]=le.y,A[S+2]=le.z}else A[S]=0,A[S+1]=0,A[S+2]=1}return e.attributes.normal=new y({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:A}),e};var pe=new i,ye=new i,Ee=new i;ne.computeTangentAndBitangent=function(e){for(var t=(e.attributes,e.indices),n=e.attributes.position.values,r=e.attributes.normal.values,a=e.attributes.st.values,o=e.attributes.position.values.length/3,s=t.length,c=new Array(3*o),l=0;l<c.length;l++)c[l]=0;var f,h,d;for(l=0;l<s;l+=3){var p=t[l],E=t[l+1],m=t[l+2];f=3*p,h=3*E,d=3*m;var _=2*p,v=2*E,T=2*m,R=n[f],g=n[f+1],A=n[f+2],S=a[_],N=a[_+1],x=a[v+1]-N,I=a[T+1]-N,O=1/((a[v]-S)*I-(a[T]-S)*x),w=(I*(n[h]-R)-x*(n[d]-R))*O,M=(I*(n[h+1]-g)-x*(n[d+1]-g))*O,C=(I*(n[h+2]-A)-x*(n[d+2]-A))*O;c[f]+=w,c[f+1]+=M,c[f+2]+=C,c[h]+=w,c[h+1]+=M,c[h+2]+=C,c[d]+=w,c[d+1]+=M,c[d+2]+=C}var P=new Float32Array(3*o),D=new Float32Array(3*o);for(l=0;l<o;l++){f=3*l,h=f+1,d=f+2;var L=i.fromArray(r,f,pe),U=i.fromArray(c,f,Ee),b=i.dot(L,U);i.multiplyByScalar(L,b,ye),i.normalize(i.subtract(U,ye,U),U),P[f]=U.x,P[h]=U.y,P[d]=U.z,i.normalize(i.cross(L,U,U),U),D[f]=U.x,D[h]=U.y,D[d]=U.z}return e.attributes.tangent=new y({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:P}),e.attributes.bitangent=new y({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:D}),e},ne.computeBinormalAndTangent=function(e){return l("computeBinormalAndTangent","computeBinormalAndTangent was deprecated in 1.30. It will be removed in 1.31. Use a computeTangentAndBitangent."),ne.computeTangentAndBitangent(e),e.attributes.binormal=e.attributes.bitangent,e};var me=new r,_e=new i,ve=new i,Te=new i,Re=new r;ne.compressVertices=function(t){var n,a,o=t.attributes.extrudeDirection;if(c(o)){var s=o.values;a=s.length/3;var l=new Float32Array(2*a),f=0;for(n=0;n<a;++n)i.fromArray(s,3*n,_e),i.equals(_e,i.ZERO)?f+=2:(Re=e.octEncodeInRange(_e,65535,Re),l[f++]=Re.x,l[f++]=Re.y);return t.attributes.compressedAttributes=new y({componentDatatype:u.FLOAT,componentsPerAttribute:2,values:l}),delete t.attributes.extrudeDirection,t}var h=t.attributes.normal,d=t.attributes.st,p=c(h),E=c(d);if(!p&&!E)return t;var m,_,v,T,R=t.attributes.tangent,g=t.attributes.bitangent,A=c(R),S=c(g);p&&(m=h.values),E&&(_=d.values),A&&(v=R.values),S&&(T=g.values);var N=p?m.length:_.length,x=p?3:2;a=N/x;var I=a,O=E&&p?2:1;O+=A||S?1:0,I*=O;var w=new Float32Array(I),M=0;for(n=0;n<a;++n){E&&(r.fromArray(_,2*n,me),w[M++]=e.compressTextureCoordinates(me));var C=3*n;p&&c(v)&&c(T)?(i.fromArray(m,C,_e),i.fromArray(v,C,ve),i.fromArray(T,C,Te),e.octPack(_e,ve,Te,me),w[M++]=me.x,w[M++]=me.y):(p&&(i.fromArray(m,C,_e),w[M++]=e.octEncodeFloat(_e)),A&&(i.fromArray(v,C,_e),w[M++]=e.octEncodeFloat(_e)),S&&(i.fromArray(T,C,_e),w[M++]=e.octEncodeFloat(_e)))}return t.attributes.compressedAttributes=new y({componentDatatype:u.FLOAT,componentsPerAttribute:O,values:w}),p&&delete t.attributes.normal,E&&delete t.attributes.st,S&&delete t.attributes.bitangent,A&&delete t.attributes.tangent,t};var ge=new i,Ae=new i,Se=new i,Ne=new i,xe=new i,Ie={positions:new Array(7),indices:new Array(9)},Oe=new i,we=new i,Me=new i,Ce=new i,Pe=new r,De=new r,Le=new r,Ue=A.fromPointNormal(i.ZERO,i.UNIT_Y),be=new i,Fe=new i,ze=new r,Be=new r,Ge=new i,qe=new i,We=new i,Ve=new i,He=new i,Xe=new i,Ye=new a,ke=5*T.EPSILON9,Ze=T.EPSILON6;return ne.splitLongitude=function(e){var t=e.geometry,r=t.boundingSphere;if(c(r)){var i=r.center.x-r.radius;if(i>0||n.intersectPlane(r,A.ORIGIN_ZX_PLANE)!==_.INTERSECTING)return e}if(t.geometryType!==E.NONE)switch(t.geometryType){case E.POLYLINES:te(e);break;case E.TRIANGLES:Q(e);break;case E.LINES:$(e)}else W(t),t.primitiveType===S.TRIANGLES?Q(e):t.primitiveType===S.LINES&&$(e);return e},ne}),define("Core/arrayRemoveDuplicates",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function i(n,r,i){if(t(n)){i=e(i,!1);var o=n.length;if(o<2)return n;var u,s,c;for(u=1;u<o&&(s=n[u-1],c=n[u],!r(s,c,a));++u);if(u===o)return i&&r(n[0],n[n.length-1],a)?n.slice(1):n;for(var l=n.slice(0,u);u<o;++u)c=n[u],r(s,c,a)||(l.push(c),s=c);return i&&l.length>1&&r(l[0],l[l.length-1],a)&&l.shift(),l}}var a=r.EPSILON10;return i}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("ThirdParty/earcut-2.1.1",[],function(){"use strict";function e(e,n,i){i=i||2;var a=n&&n.length,o=a?n[0]*i:e.length,u=t(e,0,o,i,!0),c=[];if(!u)return c;var l,f,h,d,p,y,E;if(a&&(u=s(e,n,u,i)),e.length>80*i){l=h=e[0],f=d=e[1];for(var m=i;m<o;m+=i)p=e[m],y=e[m+1],p<l&&(l=p),y<f&&(f=y),p>h&&(h=p),y>d&&(d=y);E=Math.max(h-l,d-f)}return r(u,c,i,l,f,E),c}function t(e,t,n,r,i){var a,o;if(i===O(e,t,n,r)>0)for(a=t;a<n;a+=r)o=N(a,e[a],e[a+1],o);else for(a=n-r;a>=t;a-=r)o=N(a,e[a],e[a+1],o);return o&&v(o,o.next)&&(x(o),o=o.next),o}function n(e,t){if(!e)return e;t||(t=e);var n,r=e;do if(n=!1,r.steiner||!v(r,r.next)&&0!==_(r.prev,r,r.next))r=r.next;else{if(x(r),r=t=r.prev,r===r.next)return null;n=!0}while(n||r!==t);return t}function r(e,t,s,c,l,f,d){if(e){!d&&f&&h(e,c,l,f);for(var p,y,E=e;e.prev!==e.next;)if(p=e.prev,y=e.next,f?a(e,c,l,f):i(e))t.push(p.i/s),t.push(e.i/s),t.push(y.i/s),x(e),e=y.next,E=y.next;else if(e=y,e===E){d?1===d?(e=o(e,t,s),r(e,t,s,c,l,f,2)):2===d&&u(e,t,s,c,l,f):r(n(e),t,s,c,l,f,1);break}}}function i(e){var t=e.prev,n=e,r=e.next;if(_(t,n,r)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(E(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&_(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function a(e,t,n,r){var i=e.prev,a=e,o=e.next;if(_(i,a,o)>=0)return!1;for(var u=i.x<a.x?i.x<o.x?i.x:o.x:a.x<o.x?a.x:o.x,s=i.y<a.y?i.y<o.y?i.y:o.y:a.y<o.y?a.y:o.y,c=i.x>a.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,l=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,f=p(u,s,t,n,r),h=p(c,l,t,n,r),d=e.nextZ;d&&d.z<=h;){if(d!==e.prev&&d!==e.next&&E(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&_(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(d=e.prevZ;d&&d.z>=f;){if(d!==e.prev&&d!==e.next&&E(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&_(d.prev,d,d.next)>=0)return!1;d=d.prevZ}return!0}function o(e,t,n){var r=e;do{var i=r.prev,a=r.next.next;!v(i,a)&&T(i,r,r.next,a)&&g(i,a)&&g(a,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(a.i/n),x(r),x(r.next),r=e=a),r=r.next}while(r!==e);return r}function u(e,t,i,a,o,u){var s=e;do{for(var c=s.next.next;c!==s.prev;){if(s.i!==c.i&&m(s,c)){var l=S(s,c);return s=n(s,s.next),l=n(l,l.next),r(s,t,i,a,o,u),void r(l,t,i,a,o,u)}c=c.next}s=s.next}while(s!==e)}function s(e,r,i,a){var o,u,s,f,h,d=[];for(o=0,u=r.length;o<u;o++)s=r[o]*a,f=o<u-1?r[o+1]*a:e.length,h=t(e,s,f,a,!1),h===h.next&&(h.steiner=!0),d.push(y(h));for(d.sort(c),o=0;o<d.length;o++)l(d[o],i),i=n(i,i.next);return i}function c(e,t){return e.x-t.x}function l(e,t){if(t=f(e,t)){var r=S(t,e);n(r,r.next)}}function f(e,t){var n,r=t,i=e.x,a=e.y,o=-(1/0);do{if(a<=r.y&&a>=r.next.y){var u=r.x+(a-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(u<=i&&u>o){if(o=u,u===i){if(a===r.y)return r;if(a===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(i===o)return n.prev;var s,c=n,l=n.x,f=n.y,h=1/0;for(r=n.next;r!==c;)i>=r.x&&r.x>=l&&E(a<f?i:o,a,l,f,a<f?o:i,a,r.x,r.y)&&(s=Math.abs(a-r.y)/(i-r.x),(s<h||s===h&&r.x>n.x)&&g(r,e)&&(n=r,h=s)),r=r.next;return n}function h(e,t,n,r){var i=e;do null===i.z&&(i.z=p(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,d(i)}function d(e){var t,n,r,i,a,o,u,s,c=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,r=n,u=0,t=0;t<c&&(u++,r=r.nextZ,r);t++);for(s=c;u>0||s>0&&r;)0===u?(i=r,r=r.nextZ,s--):0!==s&&r?n.z<=r.z?(i=n,n=n.nextZ,u--):(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,u--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;n=r}a.nextZ=null,c*=2}while(o>1);return e}function p(e,t,n,r,i){return e=32767*(e-n)/i,t=32767*(t-r)/i,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function y(e){var t=e,n=e;do t.x<n.x&&(n=t),t=t.next;while(t!==e);return n}function E(e,t,n,r,i,a,o,u){return(i-o)*(t-u)-(e-o)*(a-u)>=0&&(e-o)*(r-u)-(n-o)*(t-u)>=0&&(n-o)*(a-u)-(i-o)*(r-u)>=0}function m(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!R(e,t)&&g(e,t)&&g(t,e)&&A(e,t)}function _(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function v(e,t){return e.x===t.x&&e.y===t.y}function T(e,t,n,r){return!!(v(e,t)&&v(n,r)||v(e,r)&&v(n,t))||_(e,t,n)>0!=_(e,t,r)>0&&_(n,r,e)>0!=_(n,r,t)>0}function R(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&T(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function g(e,t){return _(e.prev,e,e.next)<0?_(e,t,e.next)>=0&&_(e,e.prev,t)>=0:_(e,t,e.prev)<0||_(e,e.next,t)<0}function A(e,t){var n=e,r=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do n.y>a!=n.next.y>a&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function S(e,t){var n=new I(e.i,e.x,e.y),r=new I(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function N(e,t,n,r){var i=new I(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function x(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function I(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function O(e,t,n,r){for(var i=0,a=t,o=n-r;a<n;a+=r)i+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return i}return e.deviation=function(e,t,n,r){var i=t&&t.length,a=i?t[0]*n:e.length,o=Math.abs(O(e,0,a,n));if(i)for(var u=0,s=t.length;u<s;u++){var c=t[u]*n,l=u<s-1?t[u+1]*n:e.length;o-=Math.abs(O(e,c,l,n))}var f=0;for(u=0;u<r.length;u+=3){var h=r[u]*n,d=r[u+1]*n,p=r[u+2]*n;f+=Math.abs((e[h]-e[p])*(e[d+1]-e[h+1])-(e[h]-e[d])*(e[p+1]-e[h+1]))}return 0===o&&0===f?0:Math.abs((f-o)/o)},e.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,i=0;i<e.length;i++){for(var a=0;a<e[i].length;a++)for(var o=0;o<t;o++)n.vertices.push(e[i][a][o]);i>0&&(r+=e[i-1].length,n.holes.push(r))}return n},e}),define("Core/WindingOrder",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={CLOCKWISE:t.CW,COUNTER_CLOCKWISE:t.CCW,validate:function(e){return e===n.CLOCKWISE||e===n.COUNTER_CLOCKWISE}};return e(n)}),define("Core/PolygonPipeline",["../ThirdParty/earcut-2.1.1","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./Math","./PrimitiveType","./WindingOrder"],function(e,t,n,r,i,a,o,u,s,c,l,f,h){"use strict";var d=new n,p=new n,y={};y.computeArea2D=function(e){for(var t=e.length,n=0,r=t-1,i=0;i<t;r=i++){var a=e[r],o=e[i];n+=a.x*o.y-o.x*a.y}return.5*n},y.computeWindingOrder2D=function(e){var t=y.computeArea2D(e);return t>0?h.COUNTER_CLOCKWISE:h.CLOCKWISE},y.triangulate=function(n,r){var i=t.packArray(n);return e(i,r,2)};var E=new n,m=new n,_=new n,v=new n,T=new n,R=new n,g=new n;return y.computeSubdivision=function(e,t,o,u){u=i(u,l.RADIANS_PER_DEGREE);var h,d=o.slice(0),p=t.length,y=new Array(3*p),A=0;for(h=0;h<p;h++){var S=t[h];y[A++]=S.x,y[A++]=S.y,y[A++]=S.z}for(var N=[],x={},I=e.maximumRadius,O=l.chordLength(u,I),w=O*O;d.length>0;){var M,C,P=d.pop(),D=d.pop(),L=d.pop(),U=n.fromArray(y,3*L,E),b=n.fromArray(y,3*D,m),F=n.fromArray(y,3*P,_),z=n.multiplyByScalar(n.normalize(U,v),I,v),B=n.multiplyByScalar(n.normalize(b,T),I,T),G=n.multiplyByScalar(n.normalize(F,R),I,R),q=n.magnitudeSquared(n.subtract(z,B,g)),W=n.magnitudeSquared(n.subtract(B,G,g)),V=n.magnitudeSquared(n.subtract(G,z,g)),H=Math.max(q,W,V);H>w?q===H?(M=Math.min(L,D)+" "+Math.max(L,D),h=x[M],a(h)||(C=n.add(U,b,g),n.multiplyByScalar(C,.5,C),y.push(C.x,C.y,C.z),h=y.length/3-1,x[M]=h),d.push(L,h,P),d.push(h,D,P)):W===H?(M=Math.min(D,P)+" "+Math.max(D,P),h=x[M],a(h)||(C=n.add(b,F,g),n.multiplyByScalar(C,.5,C),y.push(C.x,C.y,C.z),h=y.length/3-1,x[M]=h),d.push(D,h,L),d.push(h,P,L)):V===H&&(M=Math.min(P,L)+" "+Math.max(P,L),h=x[M],a(h)||(C=n.add(F,U,g),n.multiplyByScalar(C,.5,C),y.push(C.x,C.y,C.z),h=y.length/3-1,x[M]=h),d.push(P,h,D),d.push(h,L,D)):(N.push(L),N.push(D),N.push(P))}return new s({attributes:{position:new c({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:y})},indices:N,primitiveType:f.TRIANGLES})},y.scaleToGeodeticHeight=function(e,t,r,o){r=i(r,u.WGS84);var s=d,c=p;if(t=i(t,0),o=i(o,!0),a(e))for(var l=e.length,f=0;f<l;f+=3)n.fromArray(e,f,c),o&&(c=r.scaleToGeodeticSurface(c,c)),0!==t&&(s=r.geodeticSurfaceNormal(c,s),n.multiplyByScalar(s,t,s),n.add(c,s,c)),e[f]=c.x,e[f+1]=c.y,e[f+2]=c.z;return e},y}),define("Core/Queue",["./defineProperties"],function(e){"use strict";function t(){this._array=[],this._offset=0,this._length=0}return e(t.prototype,{length:{get:function(){return this._length}}}),t.prototype.enqueue=function(e){this._array.push(e),this._length++},t.prototype.dequeue=function(){if(0!==this._length){var e=this._array,t=this._offset,n=e[t];return e[t]=void 0,t++,t>10&&2*t>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,n}},t.prototype.peek=function(){if(0!==this._length)return this._array[this._offset]},t.prototype.contains=function(e){return this._array.indexOf(e)!==-1},t.prototype.clear=function(){this._array.length=this._offset=this._length=0},t.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)},t}),define("Core/PolygonGeometryLibrary",["./arrayRemoveDuplicates","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryPipeline","./IndexDatatype","./Math","./PolygonPipeline","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,n,r,i,a,o,u,s,c,l,f,h,d,p,y){"use strict";function E(e,n,r,i){return t.subtract(n,e,_),t.multiplyByScalar(_,r/i,_),t.add(e,_,_),[_.x,_.y,_.z]}var m={};m.computeHierarchyPackedLength=function(e){for(var n=0,r=[e];r.length>0;){var a=r.pop();if(i(a)){n+=2;var o=a.positions,u=a.holes;if(i(o)&&(n+=o.length*t.packedLength),i(u))for(var s=u.length,c=0;c<s;++c)r.push(u[c])}}return n},m.packPolygonHierarchy=function(e,n,r){for(var a=[e];a.length>0;){var o=a.pop();if(i(o)){var u=o.positions,s=o.holes;if(n[r++]=i(u)?u.length:0,n[r++]=i(s)?s.length:0,i(u))for(var c=u.length,l=0;l<c;++l,r+=3)t.pack(u[l],n,r);if(i(s))for(var f=s.length,h=0;h<f;++h)a.push(s[h])}}return r},m.unpackPolygonHierarchy=function(e,n){for(var r=e[n++],i=e[n++],a=new Array(r),o=i>0?new Array(i):void 0,u=0;u<r;++u,n+=t.packedLength)a[u]=t.unpack(e,n);for(var s=0;s<i;++s)o[s]=m.unpackPolygonHierarchy(e,n),n=o[s].startingIndex,delete o[s].startingIndex;return{positions:a,holes:o,startingIndex:n}};var _=new t;m.subdivideLineCount=function(e,n,r){var i=t.distance(e,n),a=i/r,o=Math.max(0,Math.ceil(Math.log(a)/Math.log(2)));return Math.pow(2,o)},m.subdivideLine=function(e,n,r,a){var o=m.subdivideLineCount(e,n,r),u=t.distance(e,n),s=u/o;i(a)||(a=[]);var c=a;c.length=3*o;for(var l=0,f=0;f<o;f++){var h=E(e,n,f*s,u);c[l++]=h[0],c[l++]=h[1],c[l++]=h[2]}return c};var v=new t,T=new t,R=new t,g=new t;m.scaleToGeodeticHeightExtruded=function(e,n,o,u,s){u=r(u,a.WGS84);var c=v,l=T,f=R,h=g;if(i(e)&&i(e.attributes)&&i(e.attributes.position))for(var d=e.attributes.position.values,p=d.length/2,y=0;y<p;y+=3)t.fromArray(d,y,f),u.geodeticSurfaceNormal(f,c),h=u.scaleToGeodeticSurface(f,h),l=t.multiplyByScalar(c,o,l),l=t.add(h,l,l),d[y+p]=l.x,d[y+1+p]=l.y,d[y+2+p]=l.z,s&&(h=t.clone(f,h)),l=t.multiplyByScalar(c,n,l),l=t.add(h,l,l),d[y]=l.x,d[y+1]=l.y,d[y+2]=l.z;return e},m.polygonsFromHierarchy=function(n,r,a,o){var u=[],s=[],c=new p;for(c.enqueue(n);0!==c.length;){var l=c.dequeue(),f=l.positions,d=l.holes;if(f=e(f,t.equalsEpsilon,!0),!(f.length<3)){var E=a.projectPointsOntoPlane(f),m=[],_=h.computeWindingOrder2D(E);_===y.CLOCKWISE&&(E.reverse(),f=f.slice().reverse());var v,T,R=f.slice(),g=i(d)?d.length:0,A=[];for(v=0;v<g;v++){var S=d[v],N=e(S.positions,t.equalsEpsilon,!0);if(!(N.length<3)){var x=a.projectPointsOntoPlane(N);_=h.computeWindingOrder2D(x),_===y.CLOCKWISE&&(x.reverse(),N=N.slice().reverse()),A.push(N),m.push(R.length),R=R.concat(N),E=E.concat(x);var I=0;for(i(S.holes)&&(I=S.holes.length),T=0;T<I;T++)c.enqueue(S.holes[T])}}if(!r){for(v=0;v<f.length;v++)o.scaleToGeodeticSurface(f[v],f[v]);for(v=0;v<A.length;v++){var O=A[v];for(T=0;T<O.length;++T)o.scaleToGeodeticSurface(O[T],O[T])}}u.push({outerRing:f,holes:A}),s.push({positions:R,positions2D:E,holes:m})}}return{hierarchy:u,polygons:s}},m.createGeometryFromPositions=function(e,t,r,i,a){var s=h.triangulate(t.positions2D,t.holes);s.length<3&&(s=[0,1,2]);var l=t.positions;if(i){for(var f=l.length,p=new Array(3*f),y=0,E=0;E<f;E++){var m=l[E];p[y++]=m.x,p[y++]=m.y,p[y++]=m.z}var _=new o({attributes:{position:new u({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:p})},indices:s,primitiveType:d.TRIANGLES});return a.normal?c.computeNormal(_):_}return h.computeSubdivision(e,l,s,r)};var A=[],S=new t,N=new t;return m.computeWallGeometry=function(e,r,i,a){var c,h,p,y,E,_=e.length,v=0;if(a)for(h=3*_*2,c=new Array(2*h),p=0;p<_;p++)y=e[p],E=e[(p+1)%_],c[v]=c[v+h]=y.x,++v,c[v]=c[v+h]=y.y,++v,c[v]=c[v+h]=y.z,++v,c[v]=c[v+h]=E.x,++v,c[v]=c[v+h]=E.y,++v,c[v]=c[v+h]=E.z,++v;else{var T=f.chordLength(i,r.maximumRadius),R=0;for(p=0;p<_;p++)R+=m.subdivideLineCount(e[p],e[(p+1)%_],T);for(h=3*(R+_),c=new Array(2*h),p=0;p<_;p++){y=e[p],E=e[(p+1)%_];for(var g=m.subdivideLine(y,E,T,A),x=g.length,I=0;I<x;++I,++v)c[v]=g[I],c[v+h]=g[I];c[v]=E.x,c[v+h]=E.x,++v,c[v]=E.y,c[v+h]=E.y,++v,c[v]=E.z,c[v+h]=E.z,++v}}_=c.length;var O=l.createTypedArray(_/3,_-6*e.length),w=0; +for(_/=6,p=0;p<_;p++){var M=p,C=M+1,P=M+_,D=P+1;y=t.fromArray(c,3*M,S),E=t.fromArray(c,3*C,N),t.equalsEpsilon(y,E,f.EPSILON14)||(O[w++]=M,O[w++]=P,O[w++]=C,O[w++]=C,O[w++]=P,O[w++]=D)}return new o({attributes:new s({position:new u({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:c})}),indices:O,primitiveType:d.TRIANGLES})},m}),define("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.position=e(t.position,!1),this.normal=e(t.normal,!1),this.st=e(t.st,!1),this.bitangent=e(t.bitangent,!1),this.tangent=e(t.tangent,!1),this.color=e(t.color,!1)}return i.POSITION_ONLY=r(new i({position:!0})),i.POSITION_AND_NORMAL=r(new i({position:!0,normal:!0})),i.POSITION_NORMAL_AND_ST=r(new i({position:!0,normal:!0,st:!0})),i.POSITION_AND_ST=r(new i({position:!0,st:!0})),i.POSITION_AND_COLOR=r(new i({position:!0,color:!0})),i.ALL=r(new i({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0})),i.DEFAULT=i.POSITION_NORMAL_AND_ST,i.packedLength=6,i.pack=function(t,n,r){return r=e(r,0),n[r++]=t.position?1:0,n[r++]=t.normal?1:0,n[r++]=t.st?1:0,n[r++]=t.tangent?1:0,n[r++]=t.bitangent?1:0,n[r++]=t.color?1:0,n},i.unpack=function(n,r,a){return r=e(r,0),t(a)||(a=new i),a.position=1===n[r++],a.normal=1===n[r++],a.st=1===n[r++],a.tangent=1===n[r++],a.bitangent=1===n[r++],a.color=1===n[r++],a},i.clone=function(e,n){if(t(e))return t(n)||(n=new i),n.position=e.position,n.normal=e.normal,n.st=e.st,n.tangent=e.tangent,n.bitangent=e.bitangent,n.color=e.color,n},i}),define("Core/PolygonGeometry",["./BoundingRectangle","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./Check","./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix3","./PolygonGeometryLibrary","./PolygonPipeline","./Quaternion","./Rectangle","./VertexFormat","./WindingOrder"],function(e,t,n,r,i,a,o,u,s,c,l,f,h,d,p,y,E,m,_,v,T,R,g,A,S,N){"use strict";function x(e,t,n,i){for(var a=g.fromAxisAngle(e._plane.normal,n,D),o=v.fromQuaternion(a,L),u=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,l=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,h=t.length,d=0;d<h;++d){var p=r.clone(t[d],P);v.multiplyByVector(o,p,p);var y=e.projectPointOntoPlane(p,C);s(y)&&(u=Math.min(u,y.x),c=Math.max(c,y.x),l=Math.min(l,y.y),f=Math.max(f,y.y))}return i.x=u,i.y=l,i.width=c-u,i.height=f-l,i}function I(e,t,n,r){var i=r.cartesianToCartographic(e,U),a=i.height,o=r.cartesianToCartographic(t,b);o.height=a,r.cartographicToCartesian(o,t);var u=r.cartesianToCartographic(n,b);u.height=a-100,r.cartographicToCartesian(u,n)}function O(e){var t=e.vertexFormat,i=e.geometry,a=e.shadowVolume;if(t.st||t.normal||t.tangent||t.bitangent||a){var u=e.boundingRectangle,s=e.tangentPlane,c=e.ellipsoid,l=e.stRotation,f=e.wall,h=e.top||f,d=e.bottom||f,y=e.perPositionHeight,E=k;E.x=u.x,E.y=u.y;var m,T=i.attributes.position.values,R=T.length,A=t.st?new Float32Array(2*(R/3)):void 0;t.normal&&(m=y&&h&&!f?i.attributes.normal.values:new Float32Array(R));var S=t.tangent?new Float32Array(R):void 0,N=t.bitangent?new Float32Array(R):void 0,x=a?new Float32Array(R):void 0,O=0,w=0,M=B,C=G,P=q,D=!0,L=g.fromAxisAngle(s._plane.normal,l,K),U=v.fromQuaternion(L,J),b=0,F=0;h&&d&&(b=R/2,F=R/3,R/=2);for(var Q=0;Q<R;Q+=3){var $=r.fromArray(T,Q,j);if(t.st){var ee=v.multiplyByVector(U,$,z);ee=c.scaleToGeodeticSurface(ee,ee);var te=s.projectPointOntoPlane(ee,Z);n.subtract(te,E,te);var ne=_.clamp(te.x/u.width,0,1),re=_.clamp(te.y/u.height,0,1);d&&(A[O+F]=ne,A[O+1+F]=re),h&&(A[O]=ne,A[O+1]=re),O+=2}if(t.normal||t.tangent||t.bitangent||a){var ie=w+1,ae=w+2;if(f){if(Q+3<R){var oe=r.fromArray(T,Q+3,W);if(D){var ue=r.fromArray(T,Q+R,V);y&&I($,oe,ue,c),r.subtract(oe,$,oe),r.subtract(ue,$,ue),M=r.normalize(r.cross(ue,oe,M),M),D=!1}r.equalsEpsilon(oe,$,_.EPSILON10)&&(D=!0)}(t.tangent||t.bitangent)&&(P=c.geodeticSurfaceNormal($,P),t.tangent&&(C=r.normalize(r.cross(P,M,C),C)))}else M=c.geodeticSurfaceNormal($,M),(t.tangent||t.bitangent)&&(y&&(H=r.fromArray(m,w,H),X=r.cross(r.UNIT_Z,H,X),X=r.normalize(v.multiplyByVector(U,X,X),X),t.bitangent&&(Y=r.normalize(r.cross(H,X,Y),Y))),C=r.cross(r.UNIT_Z,M,C),C=r.normalize(v.multiplyByVector(U,C,C),C),t.bitangent&&(P=r.normalize(r.cross(M,C,P),P)));t.normal&&(e.wall?(m[w+b]=M.x,m[ie+b]=M.y,m[ae+b]=M.z):d&&(m[w+b]=-M.x,m[ie+b]=-M.y,m[ae+b]=-M.z),(h&&!y||f)&&(m[w]=M.x,m[ie]=M.y,m[ae]=M.z)),a&&(f&&(M=c.geodeticSurfaceNormal($,M)),x[w+b]=-M.x,x[ie+b]=-M.y,x[ae+b]=-M.z),t.tangent&&(e.wall?(S[w+b]=C.x,S[ie+b]=C.y,S[ae+b]=C.z):d&&(S[w+b]=-C.x,S[ie+b]=-C.y,S[ae+b]=-C.z),h&&(y?(S[w]=X.x,S[ie]=X.y,S[ae]=X.z):(S[w]=C.x,S[ie]=C.y,S[ae]=C.z))),t.bitangent&&(d&&(N[w+b]=P.x,N[ie+b]=P.y,N[ae+b]=P.z),h&&(y?(N[w]=Y.x,N[ie]=Y.y,N[ae]=Y.z):(N[w]=P.x,N[ie]=P.y,N[ae]=P.z))),w+=3}}t.st&&(i.attributes.st=new p({componentDatatype:o.FLOAT,componentsPerAttribute:2,values:A})),t.normal&&(i.attributes.normal=new p({componentDatatype:o.FLOAT,componentsPerAttribute:3,values:m})),t.tangent&&(i.attributes.tangent=new p({componentDatatype:o.FLOAT,componentsPerAttribute:3,values:S})),t.bitangent&&(i.attributes.bitangent=new p({componentDatatype:o.FLOAT,componentsPerAttribute:3,values:N})),a&&(i.attributes.extrudeDirection=new p({componentDatatype:o.FLOAT,componentsPerAttribute:3,values:x}))}return i}function w(e,t,n,r,i,a,o,u){var s,c={walls:[]};if(a||o){var l,f,d=T.createGeometryFromPositions(e,t,n,i,u),p=d.attributes.position.values,E=d.indices;if(a&&o){var _=p.concat(p);l=_.length/3,f=m.createTypedArray(l,2*E.length),f.set(E);var v=E.length,g=l/2;for(s=0;s<v;s+=3){var A=f[s]+g,S=f[s+1]+g,x=f[s+2]+g;f[s+v]=x,f[s+1+v]=S,f[s+2+v]=A}if(d.attributes.position.values=_,i){var I=d.attributes.normal.values;d.attributes.normal.values=new Float32Array(_.length),d.attributes.normal.values.set(I)}d.indices=f}else if(o){for(l=p.length/3,f=m.createTypedArray(l,E.length),s=0;s<E.length;s+=3)f[s]=E[s+2],f[s+1]=E[s+1],f[s+2]=E[s];d.indices=f}c.topAndBottom=new y({geometry:d})}var O=r.outerRing,w=h.fromPoints(O,e),M=w.projectPointsOntoPlane(O,Q),C=R.computeWindingOrder2D(M);C===N.CLOCKWISE&&(O=O.slice().reverse());var P=T.computeWallGeometry(O,e,n,i);c.walls.push(new y({geometry:P}));var D=r.holes;for(s=0;s<D.length;s++){var L=D[s];w=h.fromPoints(L,e),M=w.projectPointsOntoPlane(L,Q),C=R.computeWindingOrder2D(M),C===N.COUNTER_CLOCKWISE&&(L=L.slice().reverse()),P=T.computeWallGeometry(L,e,n),c.walls.push(new y({geometry:P}))}return c}function M(e){var t=e.polygonHierarchy,n=u(e.vertexFormat,S.DEFAULT),r=u(e.ellipsoid,f.WGS84),i=u(e.granularity,_.RADIANS_PER_DEGREE),a=u(e.stRotation,0),o=u(e.height,0),c=u(e.perPositionHeight,!1),l=e.extrudedHeight,h=s(l);if(!c&&h)if(_.equalsEpsilon(o,l,_.EPSILON10))l=void 0,h=!1;else{var d=l;l=Math.min(d,o),o=Math.max(d,o)}this._vertexFormat=S.clone(n),this._ellipsoid=f.clone(r),this._granularity=i,this._stRotation=a,this._height=o,this._extrudedHeight=u(l,0),this._extrude=h,this._closeTop=u(e.closeTop,!0),this._closeBottom=u(e.closeBottom,!0),this._polygonHierarchy=t,this._perPositionHeight=c,this._shadowVolume=u(e.shadowVolume,!1),this._workerName="createPolygonGeometry";var p=t.positions;!s(p)||p.length<3?this._rectangle=new A:this._rectangle=A.fromCartesianArray(p,r),this.packedLength=T.computeHierarchyPackedLength(t)+f.packedLength+S.packedLength+A.packedLength+10}var C=new n,P=new r,D=new g,L=new v,U=new i,b=new i,F=new e,z=new r,B=new r,G=new r,q=new r,W=new r,V=new r,H=new r,X=new r,Y=new r,k=new n,Z=new n,j=new r,K=new g,J=new v,Q=[];M.fromPositions=function(e){e=u(e,u.EMPTY_OBJECT);var t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,closeTop:e.closeTop,closeBottom:e.closeBottom};return new M(t)},M.pack=function(e,t,n){return n=u(n,0),n=T.packPolygonHierarchy(e._polygonHierarchy,t,n),f.pack(e._ellipsoid,t,n),n+=f.packedLength,S.pack(e._vertexFormat,t,n),n+=S.packedLength,A.pack(e._rectangle,t,n),n+=A.packedLength,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._granularity,t[n++]=e._stRotation,t[n++]=e._extrude?1:0,t[n++]=e._perPositionHeight?1:0,t[n++]=e._closeTop?1:0,t[n++]=e._closeBottom?1:0,t[n++]=e._shadowVolume?1:0,t[n]=e.packedLength,t};var $=f.clone(f.UNIT_SPHERE),ee=new S,te=new A,ne={polygonHierarchy:{}};return M.unpack=function(e,t,n){t=u(t,0);var r=T.unpackPolygonHierarchy(e,t);t=r.startingIndex,delete r.startingIndex;var i=f.unpack(e,t,$);t+=f.packedLength;var a=S.unpack(e,t,ee);t+=S.packedLength;var o=A.unpack(e,t,te);t+=A.packedLength;var c=e[t++],l=e[t++],h=e[t++],d=e[t++],p=1===e[t++],y=1===e[t++],E=1===e[t++],m=1===e[t++],_=1===e[t++],v=e[t];return s(n)||(n=new M(ne)),n._polygonHierarchy=r,n._ellipsoid=f.clone(i,n._ellipsoid),n._vertexFormat=S.clone(a,n._vertexFormat),n._height=c,n._extrudedHeight=l,n._granularity=h,n._stRotation=d,n._extrude=p,n._perPositionHeight=y,n._closeTop=E,n._closeBottom=m,n._rectangle=A.clone(o),n._shadowVolume=_,n.packedLength=v,n},M.createGeometry=function(e){var n=e._vertexFormat,r=e._ellipsoid,i=e._granularity,a=e._stRotation,o=e._height,u=e._extrudedHeight,s=e._extrude,c=e._polygonHierarchy,l=e._perPositionHeight,f=e._closeTop,p=e._closeBottom,_=c.positions;if(!(_.length<3)){var v=h.fromPoints(_,r),g=T.polygonsFromHierarchy(c,l,v,r),A=g.hierarchy,S=g.polygons;if(0!==A.length){_=A[0].outerRing;var N,I,M=x(v,_,a,F),C=[],P={perPositionHeight:l,vertexFormat:n,geometry:void 0,tangentPlane:v,boundingRectangle:M,ellipsoid:r,stRotation:a,bottom:!1,top:!0,wall:!1};if(s)for(P.top=f,P.bottom=p,P.shadowVolume=e._shadowVolume,I=0;I<S.length;I++){N=w(r,S[I],i,A[I],l,f,p,n);var D;f&&p?(D=N.topAndBottom,P.geometry=T.scaleToGeodeticHeightExtruded(D.geometry,o,u,r,l)):f?(D=N.topAndBottom,D.geometry.attributes.position.values=R.scaleToGeodeticHeight(D.geometry.attributes.position.values,o,r,!l),P.geometry=D.geometry):p&&(D=N.topAndBottom,D.geometry.attributes.position.values=R.scaleToGeodeticHeight(D.geometry.attributes.position.values,u,r,!0),P.geometry=D.geometry),(f||p)&&(P.wall=!1,D.geometry=O(P),C.push(D));var L=N.walls;P.wall=!0;for(var U=0;U<L.length;U++){var b=L[U];P.geometry=T.scaleToGeodeticHeightExtruded(b.geometry,o,u,r,l),b.geometry=O(P),C.push(b)}}else for(I=0;I<S.length;I++)N=new y({geometry:T.createGeometryFromPositions(r,S[I],i,l,n)}),N.geometry.attributes.position.values=R.scaleToGeodeticHeight(N.geometry.attributes.position.values,o,r,!l),P.geometry=N.geometry,N.geometry=O(P),C.push(N);N=E.combineInstances(C)[0],N.attributes.position.values=new Float64Array(N.attributes.position.values),N.indices=m.createTypedArray(N.attributes.position.values.length/3,N.indices);var z=N.attributes,B=t.fromVertices(z.position.values);return n.position||delete z.position,new d({attributes:z,indices:N.indices,primitiveType:N.primitiveType,boundingSphere:B})}}},M.createShadowVolume=function(e,t,n){var r=e._granularity,i=e._ellipsoid,a=t(r,i),o=n(r,i);return new M({polygonHierarchy:e._polygonHierarchy,ellipsoid:i,stRotation:e._stRotation,granularity:r,perPositionHeight:!1,extrudedHeight:a,height:o,vertexFormat:S.POSITION_ONLY,shadowVolume:!0})},c(M.prototype,{rectangle:{get:function(){return this._rectangle}}}),M}),define("Workers/createPolygonGeometry",["../Core/defined","../Core/Ellipsoid","../Core/PolygonGeometry"],function(e,t,n){"use strict";function r(r,i){return e(i)&&(r=n.unpack(r,i)),r._ellipsoid=t.clone(r._ellipsoid),n.createGeometry(r)}return r})}(); \ No newline at end of file diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createPolygonOutlineGeometry.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createPolygonOutlineGeometry.js index 574b8090..bdb5ff14 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createPolygonOutlineGeometry.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createPolygonOutlineGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -222,10 +222,10 @@ OTHER DEALINGS IN THE SOFTWARE. * */ -!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==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";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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("Core/isArray",["./defined"],function(e){"use strict";var t=Array.isArray;return e(t)||(t=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),t}),define("Core/Check",["./defaultValue","./defined","./DeveloperError","./isArray"],function(e,t,r,n){"use strict";function i(e){return e+" was required but undefined."}function a(e,t,r){return"Expected "+r+" to be typeof "+t+", got "+e}var o={};return o.typeOf={},o.numeric={},o.defined=function(e,n){if(!t(e))throw new r(i(n))},o.numeric.maximum=function(e,t){if(o.typeOf.number(e),o.typeOf.number(t),e>t)throw new r("Expected "+e+" to be at most "+t)},o.numeric.minimum=function(e,t){if(o.typeOf.number(e),o.typeOf.number(t),e<t)throw new r("Expected "+e+" to be at least "+t)},o.typeOf.function=function(e,t){if("function"!=typeof e)throw new r(a(typeof e,"function",t))},o.typeOf.string=function(e,t){if("string"!=typeof e)throw new r(a(typeof e,"string",t))},o.typeOf.number=function(e,t){if("number"!=typeof e)throw new r(a(typeof e,"number",t))},o.typeOf.object=function(e,t){if("object"!=typeof e)throw new r(a(typeof e,"object",t))},o.typeOf.boolean=function(e,t){if("boolean"!=typeof e)throw new r(a(typeof e,"boolean",t))},o}),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^=e<<7&2636928640,e^=e<<15&4022730752,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,r,n){"use strict";var i={};i.EPSILON1=.1,i.EPSILON2=.01,i.EPSILON3=.001,i.EPSILON4=1e-4,i.EPSILON5=1e-5,i.EPSILON6=1e-6,i.EPSILON7=1e-7,i.EPSILON8=1e-8,i.EPSILON9=1e-9,i.EPSILON10=1e-10,i.EPSILON11=1e-11,i.EPSILON12=1e-12,i.EPSILON13=1e-13,i.EPSILON14=1e-14,i.EPSILON15=1e-15,i.EPSILON16=1e-16,i.EPSILON17=1e-17,i.EPSILON18=1e-18,i.EPSILON19=1e-19,i.EPSILON20=1e-20,i.GRAVITATIONALPARAMETER=3986004418e5,i.SOLAR_RADIUS=6955e5,i.LUNAR_RADIUS=1737400,i.SIXTY_FOUR_KILOBYTES=65536,i.sign=function(e){return e>0?1:e<0?-1:0},i.signNotZero=function(e){return e<0?-1:1},i.toSNorm=function(e,r){return r=t(r,255),Math.round((.5*i.clamp(e,-1,1)+.5)*r)},i.fromSNorm=function(e,r){return r=t(r,255),i.clamp(e,0,r)/r*2-1},i.sinh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t-r)},i.cosh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t+r)},i.lerp=function(e,t,r){return(1-r)*e+r*t},i.PI=Math.PI,i.ONE_OVER_PI=1/Math.PI,i.PI_OVER_TWO=.5*Math.PI,i.PI_OVER_THREE=Math.PI/3,i.PI_OVER_FOUR=Math.PI/4,i.PI_OVER_SIX=Math.PI/6,i.THREE_PI_OVER_TWO=3*Math.PI*.5,i.TWO_PI=2*Math.PI,i.ONE_OVER_TWO_PI=1/(2*Math.PI),i.RADIANS_PER_DEGREE=Math.PI/180,i.DEGREES_PER_RADIAN=180/Math.PI,i.RADIANS_PER_ARCSECOND=i.RADIANS_PER_DEGREE/3600,i.toRadians=function(e){return e*i.RADIANS_PER_DEGREE},i.toDegrees=function(e){return e*i.DEGREES_PER_RADIAN},i.convertLongitudeRange=function(e){var t=i.TWO_PI,r=e-Math.floor(e/t)*t;return r<-Math.PI?r+t:r>=Math.PI?r-t:r},i.clampToLatitudeRange=function(e){return i.clamp(e,-1*i.PI_OVER_TWO,i.PI_OVER_TWO)},i.negativePiToPi=function(e){return i.zeroToTwoPi(e+i.PI)-i.PI},i.zeroToTwoPi=function(e){var t=i.mod(e,i.TWO_PI);return Math.abs(t)<i.EPSILON14&&Math.abs(e)>i.EPSILON14?i.TWO_PI:t},i.mod=function(e,t){return(e%t+t)%t},i.equalsEpsilon=function(e,r,n,i){i=t(i,n);var a=Math.abs(e-r);return a<=i||a<=n*Math.max(Math.abs(e),Math.abs(r))};var a=[1];i.factorial=function(e){var t=a.length;if(e>=t)for(var r=a[t-1],n=t;n<=e;n++)a.push(r*n);return a[e]},i.incrementWrap=function(e,r,n){return n=t(n,0),++e,e>r&&(e=n),e},i.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},i.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},i.clamp=function(e,t,r){return e<t?t:e>r?r:e};var o=new e;return i.setRandomNumberSeed=function(t){o=new e(t)},i.nextRandomNumber=function(){return o.random()},i.acosClamped=function(e){return Math.acos(i.clamp(e,-1,1))},i.asinClamped=function(e){return Math.asin(i.clamp(e,-1,1))},i.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},i.logBase=function(e,t){return Math.log(e)/Math.log(t)},i.fog=function(e,t){var r=e*t;return 1-Math.exp(-(r*r))},i}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,i,a){"use strict";function o(e,r,n){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0)}o.fromSpherical=function(e,n){r(n)||(n=new o);var i=e.clock,a=e.cone,u=t(e.magnitude,1),s=u*Math.sin(a);return n.x=s*Math.cos(i),n.y=s*Math.sin(i),n.z=u*Math.cos(a),n},o.fromElements=function(e,t,n,i){return r(i)?(i.x=e,i.y=t,i.z=n,i):new o(e,t,n)},o.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n]=e.z,r},o.unpack=function(e,n,i){return n=t(n,0),r(i)||(i=new o),i.x=e[n++],i.y=e[n++],i.z=e[n],i},o.packArray=function(e,t){var n=e.length;r(t)?t.length=3*n:t=new Array(3*n);for(var i=0;i<n;++i)o.pack(e[i],t,3*i);return t},o.unpackArray=function(e,t){var n=e.length;r(t)?t.length=n/3:t=new Array(n/3);for(var i=0;i<n;i+=3){var a=i/3;t[a]=o.unpack(e,i,t[a])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},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},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},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},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},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},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},o.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r.z=e.z/t.z,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},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},o.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*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},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,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};var s=new o;o.lerp=function(e,t,r,n){return o.multiplyByScalar(t,r,s),n=o.multiplyByScalar(e,1-r,n),o.add(s,n,n)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var r=o.dot(c,l),n=o.magnitude(o.cross(c,l,c));return Math.atan2(n,r)};var f=new o;o.mostOrthogonalAxis=function(e,t){var r=o.normalize(e,f);return o.abs(r,r),t=r.x<=r.y?r.x<=r.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):r.y<=r.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},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,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]},o.equalsEpsilon=function(e,t,n,i){return e===t||r(e)&&r(t)&&a.equalsEpsilon(e.x,t.x,n,i)&&a.equalsEpsilon(e.y,t.y,n,i)&&a.equalsEpsilon(e.z,t.z,n,i)},o.cross=function(e,t,r){var n=e.x,i=e.y,a=e.z,o=t.x,u=t.y,s=t.z,c=i*s-a*u,l=a*o-n*s,f=n*u-i*o;return r.x=c,r.y=l,r.z=f,r},o.fromDegrees=function(e,t,r,n,i){return e=a.toRadians(e),t=a.toRadians(t),o.fromRadians(e,t,r,n,i)};var h=new o,d=new o,E=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,n,i,a,u){i=t(i,0);var s=r(a)?a.radiiSquared:E,c=Math.cos(n);h.x=c*Math.cos(e),h.y=c*Math.sin(e),h.z=Math.sin(n),h=o.normalize(h,h),o.multiplyComponents(s,h,d);var l=Math.sqrt(o.dot(h,d));return d=o.divideByScalar(d,l,d),h=o.multiplyByScalar(h,i,h),r(u)||(u=new o),o.add(d,h,u)},o.fromDegreesArray=function(e,t,n){var i=e.length;r(n)?n.length=i/2:n=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],s=e[a+1],c=a/2;n[c]=o.fromDegrees(u,s,0,t,n[c])}return n},o.fromRadiansArray=function(e,t,n){var i=e.length;r(n)?n.length=i/2:n=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],s=e[a+1],c=a/2;n[c]=o.fromRadians(u,s,0,t,n[c])}return n},o.fromDegreesArrayHeights=function(e,t,n){var i=e.length;r(n)?n.length=i/3:n=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],s=e[a+1],c=e[a+2],l=a/3;n[l]=o.fromDegrees(u,s,c,t,n[l])}return n},o.fromRadiansArrayHeights=function(e,t,n){var i=e.length;r(n)?n.length=i/3:n=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],s=e[a+1],c=e[a+2],l=a/3;n[l]=o.fromRadians(u,s,c,t,n[l])}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,t,r){return o.equalsEpsilon(this,e,t,r)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,r,n){"use strict";function i(r,i,u,s,c){var l=r.x,f=r.y,h=r.z,d=i.x,E=i.y,p=i.z,y=l*l*d*d,m=f*f*E*E,_=h*h*p*p,v=y+m+_,T=Math.sqrt(1/v),R=e.multiplyByScalar(r,T,a);if(v<s)return isFinite(T)?e.clone(R,c):void 0;var A=u.x,S=u.y,g=u.z,N=o;N.x=R.x*A*2,N.y=R.y*S*2,N.z=R.z*g*2;var x,I,O,w,M,C,P,D,L,U,b,z=(1-T)*e.magnitude(r)/(.5*e.magnitude(N)),F=0;do{z-=F,O=1/(1+z*A),w=1/(1+z*S),M=1/(1+z*g),C=O*O,P=w*w,D=M*M,L=C*O,U=P*w,b=D*M,x=y*C+m*P+_*D-1,I=y*L*A+m*U*S+_*b*g;var B=-2*I;F=x/B}while(Math.abs(x)>n.EPSILON12);return t(c)?(c.x=l*O,c.y=f*w,c.z=h*M,c):new e(l*O,f*w,h*M)}var a=new e,o=new e;return i}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,r,n,i,a,o){"use strict";function u(e,r,n){this.longitude=t(e,0),this.latitude=t(r,0),this.height=t(n,0)}u.fromRadians=function(e,n,i,a){return i=t(i,0),r(a)?(a.longitude=e,a.latitude=n,a.height=i,a):new u(e,n,i)},u.fromDegrees=function(e,t,r,n){return e=a.toRadians(e),t=a.toRadians(t),u.fromRadians(e,t,r,n)};var s=new e,c=new e,l=new e,f=new e(1/6378137,1/6378137,1/6356752.314245179),h=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),d=a.EPSILON1;return u.fromCartesian=function(t,n,i){var E=r(n)?n.oneOverRadii:f,p=r(n)?n.oneOverRadiiSquared:h,y=r(n)?n._centerToleranceSquared:d,m=o(t,E,p,y,c);if(r(m)){var _=e.multiplyComponents(m,p,s);_=e.normalize(_,_);var v=e.subtract(t,m,l),T=Math.atan2(_.y,_.x),R=Math.asin(_.z),A=a.sign(e.dot(v,t))*e.magnitude(v);return r(i)?(i.longitude=T,i.latitude=R,i.height=A,i):new u(T,R,A)}},u.clone=function(e,t){if(r(e))return r(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||r(e)&&r(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n},u.ZERO=i(new u(0,0,0)),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,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),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","./scaleToGeodeticSurface"],function(e,t,r,n,i,a,o,u,s){"use strict";function c(t,n,i,a){n=r(n,0),i=r(i,0),a=r(a,0),t._radii=new e(n,i,a),t._radiiSquared=new e(n*n,i*i,a*a),t._radiiToTheFourth=new e(n*n*n*n,i*i*i*i,a*a*a*a),t._oneOverRadii=new e(0===n?0:1/n,0===i?0:1/i,0===a?0:1/a),t._oneOverRadiiSquared=new e(0===n?0:1/(n*n),0===i?0:1/(i*i),0===a?0:1/(a*a)),t._minimumRadius=Math.min(n,i,a),t._maximumRadius=Math.max(n,i,a),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(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,this._sqauredXOverSquaredZ=void 0,c(this,e,t,r)}i(l.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}}}),l.clone=function(t,r){if(n(t)){var i=t._radii;return n(r)?(e.clone(i,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 l(i.x,i.y,i.z)}},l.fromCartesian3=function(e,t){return n(t)||(t=new l),n(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,n,i){return i=r(i,0),e.pack(t._radii,n,i),n},l.unpack=function(t,n,i){n=r(n,0);var a=e.unpack(t,n);return l.fromCartesian3(a,i)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,r){var i=t.longitude,a=t.latitude,o=Math.cos(a),u=o*Math.cos(i),s=o*Math.sin(i),c=Math.sin(a);return n(r)||(r=new e),r.x=u,r.y=s,r.z=c,e.normalize(r,r)},l.prototype.geodeticSurfaceNormal=function(t,r){return n(r)||(r=new e),r=e.multiplyComponents(t,this._oneOverRadiiSquared,r),e.normalize(r,r)};var f=new e,h=new e;l.prototype.cartographicToCartesian=function(t,r){var i=f,a=h;this.geodeticSurfaceNormalCartographic(t,i),e.multiplyComponents(this._radiiSquared,i,a);var o=Math.sqrt(e.dot(i,a));return e.divideByScalar(a,o,a),e.multiplyByScalar(i,t.height,i),n(r)||(r=new e),e.add(a,i,r)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var i=0;i<r;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var d=new e,E=new e,p=new e;return l.prototype.cartesianToCartographic=function(r,i){var a=this.scaleToGeodeticSurface(r,E);if(n(a)){var o=this.geodeticSurfaceNormal(a,d),s=e.subtract(r,a,p),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),f=u.sign(e.dot(s,r))*e.magnitude(s);return n(i)?(i.longitude=c,i.latitude=l,i.height=f,i):new t(c,l,f)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var i=0;i<r;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,r){n(r)||(r=new e);var i=t.x,a=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*u.z);return e.multiplyByScalar(t,s,r)},l.prototype.transformPositionToScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._oneOverRadii,r)},l.prototype.transformPositionFromScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._radii,r)},l.prototype.equals=function(t){return this===t||n(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,i,a){i=r(i,0);var o=this._sqauredXOverSquaredZ;if(n(a)||(a=new e),a.x=0,a.y=0,a.z=t.z*(1-o),!(Math.abs(a.z)>=this._radii.z-i))return a},l}),define("Core/arrayRemoveDuplicates",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,r,n){"use strict";function i(r,n,i){if(t(r)){i=e(i,!1);var o=r.length;if(o<2)return r;var u,s,c;for(u=1;u<o&&(s=r[u-1],c=r[u],!n(s,c,a));++u);if(u===o)return i&&n(r[0],r[r.length-1],a)?r.slice(1):r;for(var l=r.slice(0,u);u<o;++u)c=r[u],n(s,c,a)||(l.push(c),s=c);return i&&l.length>1&&n(l[0],l[l.length-1],a)&&l.shift(),l}}var a=n.EPSILON10;return i}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,r,n,i,a,o){"use strict";function u(e){this._ellipsoid=r(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return i(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,r){var i=this._semimajorAxis,a=t.longitude*i,o=t.latitude*i,u=t.height;return n(r)?(r.x=a,r.y=o,r.z=u,r):new e(a,o,u)},u.prototype.unproject=function(e,r){var i=this._oneOverSemimajorAxis,a=e.x*i,o=e.y*i,u=e.z;return n(r)?(r.longitude=a,r.latitude=o,r.height=u,r):new t(a,o,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";function t(t,r){this.start=e(t,0),this.stop=e(r,0)}return t}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,i,a,o){"use strict";function u(e,r,n,i,a,o,u,s,c){this[0]=t(e,0),this[1]=t(i,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(o,0),this[8]=t(c,0)}function s(e){for(var t=0,r=0;r<9;++r){var n=e[r];t+=n*n}return Math.sqrt(t)}function c(e){for(var t=0,r=0;r<3;++r){var n=e[u.getElementIndex(E[r],d[r])];t+=2*n*n}return Math.sqrt(t)}function l(e,t){for(var r=o.EPSILON15,n=0,i=1,a=0;a<3;++a){var s=Math.abs(e[u.getElementIndex(E[a],d[a])]);s>n&&(i=a,n=s)}var c=1,l=0,f=d[i],h=E[i];if(Math.abs(e[u.getElementIndex(h,f)])>r){var p,y=e[u.getElementIndex(h,h)],m=e[u.getElementIndex(f,f)],_=e[u.getElementIndex(h,f)],v=(y-m)/2/_;p=v<0?-1/(-v+Math.sqrt(1+v*v)):1/(v+Math.sqrt(1+v*v)),c=1/Math.sqrt(1+p*p),l=p*c}return t=u.clone(u.IDENTITY,t),t[u.getElementIndex(f,f)]=t[u.getElementIndex(h,h)]=c,t[u.getElementIndex(h,f)]=l,t[u.getElementIndex(f,h)]=-l,t}u.packedLength=9,u.pack=function(e,r,n){return 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},u.unpack=function(e,n,i){return n=t(n,0),r(i)||(i=new u),i[0]=e[n++],i[1]=e[n++],i[2]=e[n++],i[3]=e[n++],i[4]=e[n++],i[5]=e[n++],i[6]=e[n++],i[7]=e[n++],i[8]=e[n++],i},u.clone=function(e,t){if(r(e))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):new u(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},u.fromArray=function(e,n,i){return n=t(n,0),r(i)||(i=new u),i[0]=e[n],i[1]=e[n+1],i[2]=e[n+2],i[3]=e[n+3],i[4]=e[n+4],i[5]=e[n+5],i[6]=e[n+6],i[7]=e[n+7],i[8]=e[n+8],i},u.fromColumnMajorArray=function(e,t){return u.clone(e,t)},u.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 u(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},u.fromQuaternion=function(e,t){var n=e.x*e.x,i=e.x*e.y,a=e.x*e.z,o=e.x*e.w,s=e.y*e.y,c=e.y*e.z,l=e.y*e.w,f=e.z*e.z,h=e.z*e.w,d=e.w*e.w,E=n-s-f+d,p=2*(i-h),y=2*(a+l),m=2*(i+h),_=-n+s-f+d,v=2*(c-o),T=2*(a-l),R=2*(c+o),A=-n-s+f+d;return r(t)?(t[0]=E,t[1]=m,t[2]=T,t[3]=p,t[4]=_,t[5]=R,t[6]=y,t[7]=v,t[8]=A,t):new u(E,p,y,m,_,v,T,R,A)},u.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),i=Math.cos(-e.heading),a=Math.cos(e.roll),o=Math.sin(-e.pitch),s=Math.sin(-e.heading),c=Math.sin(e.roll),l=n*i,f=-a*s+c*o*i,h=c*s+a*o*i,d=n*s,E=a*i+c*o*s,p=-o*a+a*o*s,y=-o,m=c*n,_=a*n;return r(t)?(t[0]=l,t[1]=d,t[2]=y,t[3]=f,t[4]=E,t[5]=m,t[6]=h,t[7]=p,t[8]=_,t):new u(l,f,h,d,E,p,y,m,_)},u.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 u(e.x,0,0,0,e.y,0,0,0,e.z)},u.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 u(e,0,0,0,e,0,0,0,e)},u.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 u(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},u.fromRotationX=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=i,t[6]=0,t[7]=-i,t[8]=n,t):new u(1,0,0,0,n,-i,0,i,n)},u.fromRotationY=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-i,t[3]=0,t[4]=1,t[5]=0,t[6]=i,t[7]=0,t[8]=n,t):new u(n,0,i,0,1,0,-i,0,n)},u.fromRotationZ=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=n,t[1]=i,t[2]=0,t[3]=-i,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new u(n,-i,0,i,n,0,0,0,1)},u.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]]},u.getElementIndex=function(e,t){return 3*e+t},u.getColumn=function(e,t,r){var n=3*t,i=e[n],a=e[n+1],o=e[n+2];return r.x=i,r.y=a,r.z=o,r},u.setColumn=function(e,t,r,n){n=u.clone(e,n);var i=3*t;return n[i]=r.x,n[i+1]=r.y,n[i+2]=r.z,n},u.getRow=function(e,t,r){var n=e[t],i=e[t+3],a=e[t+6];return r.x=n,r.y=i,r.z=a,r},u.setRow=function(e,t,r,n){return n=u.clone(e,n),n[t]=r.x,n[t+3]=r.y,n[t+6]=r.z,n};var f=new e;u.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],f)),r.y=e.magnitude(e.fromElements(t[3],t[4],t[5],f)),r.z=e.magnitude(e.fromElements(t[6],t[7],t[8],f)),r};var h=new e;u.getMaximumScale=function(t){return u.getScale(t,h),e.maximumComponent(h)},u.multiply=function(e,t,r){var n=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],i=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],o=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]=i,r[2]=a,r[3]=o,r[4]=u,r[5]=s,r[6]=c,r[7]=l,r[8]=f,r},u.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},u.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},u.multiplyByVector=function(e,t,r){var n=t.x,i=t.y,a=t.z,o=e[0]*n+e[3]*i+e[6]*a,u=e[1]*n+e[4]*i+e[7]*a,s=e[2]*n+e[5]*i+e[8]*a;return r.x=o,r.y=u,r.z=s,r},u.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},u.multiplyByScale=function(e,t,r){return r[0]=e[0]*t.x,r[1]=e[1]*t.x,r[2]=e[2]*t.x,r[3]=e[3]*t.y,r[4]=e[4]*t.y,r[5]=e[5]*t.y,r[6]=e[6]*t.z,r[7]=e[7]*t.z,r[8]=e[8]*t.z,r},u.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},u.transpose=function(e,t){var r=e[0],n=e[3],i=e[6],a=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=r,t[1]=n,t[2]=i,t[3]=a,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var d=[1,0,0],E=[2,2,1],p=new u,y=new u;return u.computeEigenDecomposition=function(e,t){var n=o.EPSILON20,i=10,a=0,f=0;r(t)||(t={});for(var h=t.unitary=u.clone(u.IDENTITY,t.unitary),d=t.diagonal=u.clone(e,t.diagonal),E=n*s(d);f<i&&c(d)>E;)l(d,p),u.transpose(p,y),u.multiply(d,p,d),u.multiply(y,d,d),u.multiply(h,p,h),++a>2&&(++f,a=0);return t},u.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},u.determinant=function(e){var t=e[0],r=e[3],n=e[6],i=e[1],a=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(a*c-s*o)+i*(s*n-r*c)+u*(r*o-a*n)},u.inverse=function(e,t){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],l=e[7],f=e[8],h=u.determinant(e);t[0]=o*f-l*s,t[1]=l*i-n*f,t[2]=n*s-o*i,t[3]=c*s-a*f,t[4]=r*f-c*i,t[5]=a*i-r*s,t[6]=a*l-c*o,t[7]=c*n-r*l,t[8]=r*o-a*n;var d=1/h;return u.multiplyByScalar(t,d,t)},u.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]},u.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},u.IDENTITY=a(new u(1,0,0,0,1,0,0,0,1)),u.ZERO=a(new u(0,0,0,0,0,0,0,0,0)),u.COLUMN0ROW0=0,u.COLUMN0ROW1=1,u.COLUMN0ROW2=2,u.COLUMN1ROW0=3,u.COLUMN1ROW1=4,u.COLUMN1ROW2=5,u.COLUMN2ROW0=6,u.COLUMN2ROW1=7,u.COLUMN2ROW2=8,n(u.prototype,{length:{get:function(){return u.packedLength}}}),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},u}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,i){"use strict";function a(t,r,n,i){this.x=e(t,0),this.y=e(r,0),this.z=e(n,0),this.w=e(i,0)}a.fromElements=function(e,r,n,i,o){return t(o)?(o.x=e,o.y=r,o.z=n,o.w=i,o):new a(e,r,n,i)},a.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 a(e.red,e.green,e.blue,e.alpha)},a.clone=function(e,r){if(t(e))return t(r)?(r.x=e.x,r.y=e.y,r.z=e.z,r.w=e.w,r):new a(e.x,e.y,e.z,e.w)},a.packedLength=4,a.pack=function(t,r,n){return n=e(n,0),r[n++]=t.x,r[n++]=t.y,r[n++]=t.z,r[n]=t.w,r},a.unpack=function(r,n,i){return n=e(n,0),t(i)||(i=new a),i.x=r[n++],i.y=r[n++],i.z=r[n++],i.w=r[n],i},a.packArray=function(e,r){var n=e.length;t(r)?r.length=4*n:r=new Array(4*n);for(var i=0;i<n;++i)a.pack(e[i],r,4*i);return r},a.unpackArray=function(e,r){var n=e.length;t(r)?r.length=n/4:r=new Array(n/4);for(var i=0;i<n;i+=4){var o=i/4;r[o]=a.unpack(e,i,r[o])}return r},a.fromArray=a.unpack,a.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},a.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},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.w=Math.min(e.w,t.w),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.w=Math.max(e.w,t.w),r},a.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},a.magnitude=function(e){return Math.sqrt(a.magnitudeSquared(e))};var o=new a;a.distance=function(e,t){return a.subtract(e,t,o),a.magnitude(o)},a.distanceSquared=function(e,t){return a.subtract(e,t,o),a.magnitudeSquared(o)},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.w=e.w/r,t},a.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},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.w=e.w*t.w,r},a.divideComponents=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},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.w=e.w+t.w,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.w=e.w-t.w,r},a.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},a.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},a.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,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.w=Math.abs(e.w),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;return a.mostOrthogonalAxis=function(e,t){var r=a.normalize(e,s);return a.abs(r,r),t=r.x<=r.y?r.x<=r.z?r.x<=r.w?a.clone(a.UNIT_X,t):a.clone(a.UNIT_W,t):r.z<=r.w?a.clone(a.UNIT_Z,t):a.clone(a.UNIT_W,t):r.y<=r.z?r.y<=r.w?a.clone(a.UNIT_Y,t):a.clone(a.UNIT_W,t):r.z<=r.w?a.clone(a.UNIT_Z,t):a.clone(a.UNIT_W,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&&e.w===r.w},a.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]&&e.w===t[r+3]},a.equalsEpsilon=function(e,r,n,a){return e===r||t(e)&&t(r)&&i.equalsEpsilon(e.x,r.x,n,a)&&i.equalsEpsilon(e.y,r.y,n,a)&&i.equalsEpsilon(e.z,r.z,n,a)&&i.equalsEpsilon(e.w,r.w,n,a)},a.ZERO=n(new a(0,0,0,0)),a.UNIT_X=n(new a(1,0,0,0)),a.UNIT_Y=n(new a(0,1,0,0)),a.UNIT_Z=n(new a(0,0,1,0)),a.UNIT_W=n(new a(0,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,r){return a.equalsEpsilon(this,e,t,r)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},a}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t), -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","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,r,n,i,a,o,u,s,c){"use strict";function l(e,t,n,i,a,o,u,s,c,l,f,h,d,E,p,y){this[0]=r(e,0),this[1]=r(a,0),this[2]=r(c,0),this[3]=r(d,0),this[4]=r(t,0),this[5]=r(o,0),this[6]=r(l,0),this[7]=r(E,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(f,0),this[11]=r(p,0),this[12]=r(i,0),this[13]=r(s,0),this[14]=r(h,0),this[15]=r(y,0)}l.packedLength=16,l.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},l.unpack=function(e,t,i){return t=r(t,0),n(i)||(i=new l),i[0]=e[t++],i[1]=e[t++],i[2]=e[t++],i[3]=e[t++],i[4]=e[t++],i[5]=e[t++],i[6]=e[t++],i[7]=e[t++],i[8]=e[t++],i[9]=e[t++],i[10]=e[t++],i[11]=e[t++],i[12]=e[t++],i[13]=e[t++],i[14]=e[t++],i[15]=e[t],i},l.clone=function(e,t){if(n(e))return n(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 l(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])},l.fromArray=l.unpack,l.fromColumnMajorArray=function(e,t){return l.clone(e,t)},l.fromRowMajorArray=function(e,t){return n(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 l(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])},l.fromRotationTranslation=function(t,i,a){return i=r(i,e.ZERO),n(a)?(a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=0,a[4]=t[3],a[5]=t[4],a[6]=t[5],a[7]=0,a[8]=t[6],a[9]=t[7],a[10]=t[8],a[11]=0,a[12]=i.x,a[13]=i.y,a[14]=i.z,a[15]=1,a):new l(t[0],t[3],t[6],i.x,t[1],t[4],t[7],i.y,t[2],t[5],t[8],i.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(e,t,r,i){n(i)||(i=new l);var a=r.x,o=r.y,u=r.z,s=t.x*t.x,c=t.x*t.y,f=t.x*t.z,h=t.x*t.w,d=t.y*t.y,E=t.y*t.z,p=t.y*t.w,y=t.z*t.z,m=t.z*t.w,_=t.w*t.w,v=s-d-y+_,T=2*(c-m),R=2*(f+p),A=2*(c+m),S=-s+d-y+_,g=2*(E-h),N=2*(f-p),x=2*(E+h),I=-s-d+y+_;return i[0]=v*a,i[1]=A*a,i[2]=N*a,i[3]=0,i[4]=T*o,i[5]=S*o,i[6]=x*o,i[7]=0,i[8]=R*u,i[9]=g*u,i[10]=I*u,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i},l.fromTranslationRotationScale=function(e,t){return l.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},l.fromTranslation=function(e,t){return l.fromRotationTranslation(s.IDENTITY,e,t)},l.fromScale=function(e,t){return n(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 l(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},l.fromUniformScale=function(e,t){return n(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 l(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var f=new e,h=new e,d=new e;l.fromCamera=function(t,r){var i=t.position,a=t.direction,o=t.up;e.normalize(a,f),e.normalize(e.cross(f,o,h),h),e.normalize(e.cross(h,f,d),d);var u=h.x,s=h.y,c=h.z,E=f.x,p=f.y,y=f.z,m=d.x,_=d.y,v=d.z,T=i.x,R=i.y,A=i.z,S=u*-T+s*-R+c*-A,g=m*-T+_*-R+v*-A,N=E*T+p*R+y*A;return n(r)?(r[0]=u,r[1]=m,r[2]=-E,r[3]=0,r[4]=s,r[5]=_,r[6]=-p,r[7]=0,r[8]=c,r[9]=v,r[10]=-y,r[11]=0,r[12]=S,r[13]=g,r[14]=N,r[15]=1,r):new l(u,s,c,S,m,_,v,g,-E,-p,-y,N,0,0,0,1)},l.computePerspectiveFieldOfView=function(e,t,r,n,i){var a=Math.tan(.5*e),o=1/a,u=o/t,s=(n+r)/(r-n),c=2*n*r/(r-n);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=o,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=s,i[11]=-1,i[12]=0,i[13]=0,i[14]=c,i[15]=0,i},l.computeOrthographicOffCenter=function(e,t,r,n,i,a,o){var u=1/(t-e),s=1/(n-r),c=1/(a-i),l=-(t+e)*u,f=-(n+r)*s,h=-(a+i)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=f,o[14]=h,o[15]=1,o},l.computePerspectiveOffCenter=function(e,t,r,n,i,a,o){var u=2*i/(t-e),s=2*i/(n-r),c=(t+e)/(t-e),l=(n+r)/(n-r),f=-(a+i)/(a-i),h=-1,d=-2*a*i/(a-i);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=f,o[11]=h,o[12]=0,o[13]=0,o[14]=d,o[15]=0,o},l.computeInfinitePerspectiveOffCenter=function(e,t,r,n,i,a){var o=2*i/(t-e),u=2*i/(n-r),s=(t+e)/(t-e),c=(n+r)/(n-r),l=-1,f=-1,h=-2*i;return a[0]=o,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]=h,a[15]=0,a},l.computeViewportTransformation=function(e,t,n,i){e=r(e,r.EMPTY_OBJECT);var a=r(e.x,0),o=r(e.y,0),u=r(e.width,0),s=r(e.height,0);t=r(t,0),n=r(n,1);var c=.5*u,l=.5*s,f=.5*(n-t),h=c,d=l,E=f,p=a+c,y=o+l,m=t+f,_=1;return i[0]=h,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=d,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=E,i[11]=0,i[12]=p,i[13]=y,i[14]=m,i[15]=_,i},l.computeView=function(t,r,n,i,a){return a[0]=i.x,a[1]=n.x,a[2]=-r.x,a[3]=0,a[4]=i.y,a[5]=n.y,a[6]=-r.y,a[7]=0,a[8]=i.z,a[9]=n.z,a[10]=-r.z,a[11]=0,a[12]=-e.dot(i,t),a[13]=-e.dot(n,t),a[14]=e.dot(r,t),a[15]=1,a},l.toArray=function(e,t){return n(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]]},l.getElementIndex=function(e,t){return 4*e+t},l.getColumn=function(e,t,r){var n=4*t,i=e[n],a=e[n+1],o=e[n+2],u=e[n+3];return r.x=i,r.y=a,r.z=o,r.w=u,r},l.setColumn=function(e,t,r,n){n=l.clone(e,n);var i=4*t;return n[i]=r.x,n[i+1]=r.y,n[i+2]=r.z,n[i+3]=r.w,n},l.setTranslation=function(e,t,r){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]=t.x,r[13]=t.y,r[14]=t.z,r[15]=e[15],r},l.getRow=function(e,t,r){var n=e[t],i=e[t+4],a=e[t+8],o=e[t+12];return r.x=n,r.y=i,r.z=a,r.w=o,r},l.setRow=function(e,t,r,n){return n=l.clone(e,n),n[t]=r.x,n[t+4]=r.y,n[t+8]=r.z,n[t+12]=r.w,n};var E=new e;l.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],E)),r.y=e.magnitude(e.fromElements(t[4],t[5],t[6],E)),r.z=e.magnitude(e.fromElements(t[8],t[9],t[10],E)),r};var p=new e;l.getMaximumScale=function(t){return l.getScale(t,p),e.maximumComponent(p)},l.multiply=function(e,t,r){var n=e[0],i=e[1],a=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],f=e[8],h=e[9],d=e[10],E=e[11],p=e[12],y=e[13],m=e[14],_=e[15],v=t[0],T=t[1],R=t[2],A=t[3],S=t[4],g=t[5],N=t[6],x=t[7],I=t[8],O=t[9],w=t[10],M=t[11],C=t[12],P=t[13],D=t[14],L=t[15],U=n*v+u*T+f*R+p*A,b=i*v+s*T+h*R+y*A,z=a*v+c*T+d*R+m*A,F=o*v+l*T+E*R+_*A,B=n*S+u*g+f*N+p*x,G=i*S+s*g+h*N+y*x,q=a*S+c*g+d*N+m*x,W=o*S+l*g+E*N+_*x,H=n*I+u*O+f*w+p*M,X=i*I+s*O+h*w+y*M,V=a*I+c*O+d*w+m*M,Y=o*I+l*O+E*w+_*M,k=n*C+u*P+f*D+p*L,Z=i*C+s*P+h*D+y*L,j=a*C+c*P+d*D+m*L,K=o*C+l*P+E*D+_*L;return r[0]=U,r[1]=b,r[2]=z,r[3]=F,r[4]=B,r[5]=G,r[6]=q,r[7]=W,r[8]=H,r[9]=X,r[10]=V,r[11]=Y,r[12]=k,r[13]=Z,r[14]=j,r[15]=K,r},l.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},l.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},l.multiplyTransformation=function(e,t,r){var n=e[0],i=e[1],a=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=e[12],d=e[13],E=e[14],p=t[0],y=t[1],m=t[2],_=t[4],v=t[5],T=t[6],R=t[8],A=t[9],S=t[10],g=t[12],N=t[13],x=t[14],I=n*p+o*y+c*m,O=i*p+u*y+l*m,w=a*p+s*y+f*m,M=n*_+o*v+c*T,C=i*_+u*v+l*T,P=a*_+s*v+f*T,D=n*R+o*A+c*S,L=i*R+u*A+l*S,U=a*R+s*A+f*S,b=n*g+o*N+c*x+h,z=i*g+u*N+l*x+d,F=a*g+s*N+f*x+E;return r[0]=I,r[1]=O,r[2]=w,r[3]=0,r[4]=M,r[5]=C,r[6]=P,r[7]=0,r[8]=D,r[9]=L,r[10]=U,r[11]=0,r[12]=b,r[13]=z,r[14]=F,r[15]=1,r},l.multiplyByMatrix3=function(e,t,r){var n=e[0],i=e[1],a=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=t[0],d=t[1],E=t[2],p=t[3],y=t[4],m=t[5],_=t[6],v=t[7],T=t[8],R=n*h+o*d+c*E,A=i*h+u*d+l*E,S=a*h+s*d+f*E,g=n*p+o*y+c*m,N=i*p+u*y+l*m,x=a*p+s*y+f*m,I=n*_+o*v+c*T,O=i*_+u*v+l*T,w=a*_+s*v+f*T;return r[0]=R,r[1]=A,r[2]=S,r[3]=0,r[4]=g,r[5]=N,r[6]=x,r[7]=0,r[8]=I,r[9]=O,r[10]=w,r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r},l.multiplyByTranslation=function(e,t,r){var n=t.x,i=t.y,a=t.z,o=n*e[0]+i*e[4]+a*e[8]+e[12],u=n*e[1]+i*e[5]+a*e[9]+e[13],s=n*e[2]+i*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]=o,r[13]=u,r[14]=s,r[15]=e[15],r};var y=new e;l.multiplyByUniformScale=function(e,t,r){return y.x=t,y.y=t,y.z=t,l.multiplyByScale(e,y,r)},l.multiplyByScale=function(e,t,r){var n=t.x,i=t.y,a=t.z;return 1===n&&1===i&&1===a?l.clone(e,r):(r[0]=n*e[0],r[1]=n*e[1],r[2]=n*e[2],r[3]=0,r[4]=i*e[4],r[5]=i*e[5],r[6]=i*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)},l.multiplyByVector=function(e,t,r){var n=t.x,i=t.y,a=t.z,o=t.w,u=e[0]*n+e[4]*i+e[8]*a+e[12]*o,s=e[1]*n+e[5]*i+e[9]*a+e[13]*o,c=e[2]*n+e[6]*i+e[10]*a+e[14]*o,l=e[3]*n+e[7]*i+e[11]*a+e[15]*o;return r.x=u,r.y=s,r.z=c,r.w=l,r},l.multiplyByPointAsVector=function(e,t,r){var n=t.x,i=t.y,a=t.z,o=e[0]*n+e[4]*i+e[8]*a,u=e[1]*n+e[5]*i+e[9]*a,s=e[2]*n+e[6]*i+e[10]*a;return r.x=o,r.y=u,r.z=s,r},l.multiplyByPoint=function(e,t,r){var n=t.x,i=t.y,a=t.z,o=e[0]*n+e[4]*i+e[8]*a+e[12],u=e[1]*n+e[5]*i+e[9]*a+e[13],s=e[2]*n+e[6]*i+e[10]*a+e[14];return r.x=o,r.y=u,r.z=s,r},l.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},l.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},l.transpose=function(e,t){var r=e[1],n=e[2],i=e[3],a=e[6],o=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]=i,t[13]=o,t[14]=u,t[15]=e[15],t},l.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},l.equals=function(e,t){return e===t||n(e)&&n(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},l.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r&&Math.abs(e[9]-t[9])<=r&&Math.abs(e[10]-t[10])<=r&&Math.abs(e[11]-t[11])<=r&&Math.abs(e[12]-t[12])<=r&&Math.abs(e[13]-t[13])<=r&&Math.abs(e[14]-t[14])<=r&&Math.abs(e[15]-t[15])<=r},l.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},l.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};var m=new s,_=new s,v=new t,T=new t(0,0,0,1);return l.inverse=function(e,r){if(s.equalsEpsilon(l.getRotation(e,m),_,u.EPSILON7)&&t.equals(l.getRow(e,3,v),T))return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=0,r[11]=0,r[12]=-e[12],r[13]=-e[13],r[14]=-e[14],r[15]=1,r;var n=e[0],i=e[4],a=e[8],o=e[12],f=e[1],h=e[5],d=e[9],E=e[13],p=e[2],y=e[6],R=e[10],A=e[14],S=e[3],g=e[7],N=e[11],x=e[15],I=R*x,O=A*N,w=y*x,M=A*g,C=y*N,P=R*g,D=p*x,L=A*S,U=p*N,b=R*S,z=p*g,F=y*S,B=I*h+M*d+C*E-(O*h+w*d+P*E),G=O*f+D*d+b*E-(I*f+L*d+U*E),q=w*f+L*h+z*E-(M*f+D*h+F*E),W=P*f+U*h+F*d-(C*f+b*h+z*d),H=O*i+w*a+P*o-(I*i+M*a+C*o),X=I*n+L*a+U*o-(O*n+D*a+b*o),V=M*n+D*i+F*o-(w*n+L*i+z*o),Y=C*n+b*i+z*a-(P*n+U*i+F*a);I=a*E,O=o*d,w=i*E,M=o*h,C=i*d,P=a*h,D=n*E,L=o*f,U=n*d,b=a*f,z=n*h,F=i*f;var k=I*g+M*N+C*x-(O*g+w*N+P*x),Z=O*S+D*N+b*x-(I*S+L*N+U*x),j=w*S+L*g+z*x-(M*S+D*g+F*x),K=P*S+U*g+F*N-(C*S+b*g+z*N),J=w*R+P*A+O*y-(C*A+I*y+M*R),Q=U*A+I*p+L*R-(D*R+b*A+O*p),$=D*y+F*A+M*p-(z*A+w*p+L*y),ee=z*R+C*p+b*y-(U*y+F*R+P*p),te=n*B+i*G+a*q+o*W;if(Math.abs(te)<u.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return te=1/te,r[0]=B*te,r[1]=G*te,r[2]=q*te,r[3]=W*te,r[4]=H*te,r[5]=X*te,r[6]=V*te,r[7]=Y*te,r[8]=k*te,r[9]=Z*te,r[10]=j*te,r[11]=K*te,r[12]=J*te,r[13]=Q*te,r[14]=$*te,r[15]=ee*te,r},l.inverseTransformation=function(e,t){var r=e[0],n=e[1],i=e[2],a=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],f=e[12],h=e[13],d=e[14],E=-r*f-n*h-i*d,p=-a*f-o*h-u*d,y=-s*f-c*h-l*d;return t[0]=r,t[1]=a,t[2]=s,t[3]=0,t[4]=n,t[5]=o,t[6]=c,t[7]=0,t[8]=i,t[9]=u,t[10]=l,t[11]=0,t[12]=E,t[13]=p,t[14]=y,t[15]=1,t},l.IDENTITY=o(new l(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),l.ZERO=o(new l(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN0ROW3=3,l.COLUMN1ROW0=4,l.COLUMN1ROW1=5,l.COLUMN1ROW2=6,l.COLUMN1ROW3=7,l.COLUMN2ROW0=8,l.COLUMN2ROW1=9,l.COLUMN2ROW2=10,l.COLUMN2ROW3=11,l.COLUMN3ROW0=12,l.COLUMN3ROW1=13,l.COLUMN3ROW2=14,l.COLUMN3ROW3=15,i(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]&&e[9]===t[r+9]&&e[10]===t[r+10]&&e[11]===t[r+11]&&e[12]===t[r+12]&&e[13]===t[r+13]&&e[14]===t[r+14]&&e[15]===t[r+15]},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.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]+")"},l}),define("Core/Rectangle",["./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,r,n,i,a,o,u){"use strict";function s(e,r,n,i){this.west=t(e,0),this.south=t(r,0),this.east=t(n,0),this.north=t(i,0)}n(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,r,n){return n=t(n,0),r[n++]=e.west,r[n++]=e.south,r[n++]=e.east,r[n]=e.north,r},s.unpack=function(e,n,i){return n=t(n,0),r(i)||(i=new s),i.west=e[n++],i.south=e[n++],i.east=e[n++],i.north=e[n],i},s.computeWidth=function(e){var t=e.east,r=e.west;return t<r&&(t+=u.TWO_PI),t-r},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,n,i,a,o){return e=u.toRadians(t(e,0)),n=u.toRadians(t(n,0)),i=u.toRadians(t(i,0)),a=u.toRadians(t(a,0)),r(o)?(o.west=e,o.south=n,o.east=i,o.north=a,o):new s(e,n,i,a)},s.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE,f=0,h=e.length;f<h;f++){var d=e[f];n=Math.min(n,d.longitude),i=Math.max(i,d.longitude),c=Math.min(c,d.latitude),l=Math.max(l,d.latitude);var E=d.longitude>=0?d.longitude:d.longitude+u.TWO_PI;a=Math.min(a,E),o=Math.max(o,E)}return i-n>o-a&&(n=a,i=o,i>u.PI&&(i-=u.TWO_PI),n>u.PI&&(n-=u.TWO_PI)),r(t)?(t.west=n,t.south=c,t.east=i,t.north=l,t):new s(n,c,i,l)},s.fromCartesianArray=function(e,t,n){for(var i=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=Number.MAX_VALUE,f=-Number.MAX_VALUE,h=0,d=e.length;h<d;h++){var E=t.cartesianToCartographic(e[h]);i=Math.min(i,E.longitude),a=Math.max(a,E.longitude),l=Math.min(l,E.latitude),f=Math.max(f,E.latitude);var p=E.longitude>=0?E.longitude:E.longitude+u.TWO_PI;o=Math.min(o,p),c=Math.max(c,p)}return a-i>c-o&&(i=o,a=c,a>u.PI&&(a-=u.TWO_PI),i>u.PI&&(i-=u.TWO_PI)),r(n)?(n.west=i,n.south=l,n.east=a,n.north=f,n):new s(i,l,a,f)},s.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.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},s.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},s.validate=function(e){},s.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)},s.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)},s.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)},s.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)},s.center=function(t,n){var i=t.east,a=t.west;i<a&&(i+=u.TWO_PI);var o=u.negativePiToPi(.5*(a+i)),s=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=s,n.height=0,n):new e(o,s)},s.intersection=function(e,t,n){var i=e.east,a=e.west,o=t.east,c=t.west;i<a&&o>0?i+=u.TWO_PI:o<c&&i>0&&(o+=u.TWO_PI),i<a&&c<0?c+=u.TWO_PI:o<c&&a<0&&(a+=u.TWO_PI);var l=u.negativePiToPi(Math.max(a,c)),f=u.negativePiToPi(Math.min(i,o));if(!((e.west<e.east||t.west<t.east)&&f<=l)){var h=Math.max(e.south,t.south),d=Math.min(e.north,t.north);if(!(h>=d))return r(n)?(n.west=l,n.south=h,n.east=f,n.north=d,n):new s(l,h,f,d)}},s.simpleIntersection=function(e,t,n){var i=Math.max(e.west,t.west),a=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(a>=u||i>=o))return r(n)?(n.west=i,n.south=a,n.east=o,n.north=u,n):new s(i,a,o,u)},s.union=function(e,t,n){r(n)||(n=new s);var i=e.east,a=e.west,o=t.east,c=t.west;i<a&&o>0?i+=u.TWO_PI:o<c&&i>0&&(o+=u.TWO_PI),i<a&&c<0?c+=u.TWO_PI:o<c&&a<0&&(a+=u.TWO_PI);var l=u.convertLongitudeRange(Math.min(a,c)),f=u.convertLongitudeRange(Math.max(i,o));return n.west=l,n.south=Math.min(e.south,t.south),n.east=f,n.north=Math.max(e.north,t.north),n},s.expand=function(e,t,n){return r(n)||(n=new s),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},s.contains=function(e,t){var r=t.longitude,n=t.latitude,i=e.west,a=e.east;return a<i&&(a+=u.TWO_PI,r<0&&(r+=u.TWO_PI)),(r>i||u.equalsEpsilon(r,i,u.EPSILON14))&&(r<a||u.equalsEpsilon(r,a,u.EPSILON14))&&n>=e.south&&n<=e.north};var c=new e;return s.subsample=function(e,n,i,o){n=t(n,a.WGS84),i=t(i,0),r(o)||(o=[]);var l=0,f=e.north,h=e.south,d=e.east,E=e.west,p=c;p.height=i,p.longitude=E,p.latitude=f,o[l]=n.cartographicToCartesian(p,o[l]),l++,p.longitude=d,o[l]=n.cartographicToCartesian(p,o[l]),l++,p.latitude=h,o[l]=n.cartographicToCartesian(p,o[l]),l++,p.longitude=E,o[l]=n.cartographicToCartesian(p,o[l]),l++,f<0?p.latitude=f:h>0?p.latitude=h:p.latitude=0;for(var y=1;y<8;++y)p.longitude=-Math.PI+y*u.PI_OVER_TWO,s.contains(e,p)&&(o[l]=n.cartographicToCartesian(p,o[l]),l++);return 0===p.latitude&&(p.longitude=E,o[l]=n.cartographicToCartesian(p,o[l]),l++,p.longitude=d,o[l]=n.cartographicToCartesian(p,o[l]),l++),o.length=l,o},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,r,n,i,a,o,u,s,c,l,f){"use strict";function h(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var d=new e,E=new e,p=new e,y=new e,m=new e,_=new e,v=new e,T=new e,R=new e,A=new e,S=new e,g=new e;h.fromPoints=function(t,r){if(n(r)||(r=new h),!n(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;for(var i=e.clone(t[0],v),a=e.clone(i,d),o=e.clone(i,E),u=e.clone(i,p),s=e.clone(i,y),c=e.clone(i,m),l=e.clone(i,_),f=t.length,N=1;N<f;N++){e.clone(t[N],i);var x=i.x,I=i.y,O=i.z;x<a.x&&e.clone(i,a),x>s.x&&e.clone(i,s),I<o.y&&e.clone(i,o),I>c.y&&e.clone(i,c),O<u.z&&e.clone(i,u),O>l.z&&e.clone(i,l)}var w=e.magnitudeSquared(e.subtract(s,a,T)),M=e.magnitudeSquared(e.subtract(c,o,T)),C=e.magnitudeSquared(e.subtract(l,u,T)),P=a,D=s,L=w;M>L&&(L=M,P=o,D=c),C>L&&(L=C,P=u,D=l);var U=R;U.x=.5*(P.x+D.x),U.y=.5*(P.y+D.y),U.z=.5*(P.z+D.z);var b=e.magnitudeSquared(e.subtract(D,U,T)),z=Math.sqrt(b),F=A;F.x=a.x,F.y=o.y,F.z=u.z;var B=S;B.x=s.x,B.y=c.y,B.z=l.z;var G=e.multiplyByScalar(e.add(F,B,T),.5,g),q=0;for(N=0;N<f;N++){e.clone(t[N],i);var W=e.magnitude(e.subtract(i,G,T));W>q&&(q=W);var H=e.magnitudeSquared(e.subtract(i,U,T));if(H>b){var X=Math.sqrt(H);z=.5*(z+X),b=z*z;var V=X-z;U.x=(z*U.x+V*i.x)/X,U.y=(z*U.y+V*i.y)/X,U.z=(z*U.z+V*i.z)/X}}return z<q?(e.clone(U,r.center),r.radius=z):(e.clone(G,r.center),r.radius=q),r};var N=new o,x=new e,I=new e,O=new t,w=new t;h.fromRectangle2D=function(e,t,r){return h.fromRectangleWithHeights2D(e,t,0,0,r)},h.fromRectangleWithHeights2D=function(t,i,a,o,u){if(n(u)||(u=new h),!n(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;i=r(i,N),f.southwest(t,O),O.height=a,f.northeast(t,w),w.height=o;var s=i.project(O,x),c=i.project(w,I),l=c.x-s.x,d=c.y-s.y,E=c.z-s.z;u.radius=.5*Math.sqrt(l*l+d*d+E*E);var p=u.center;return p.x=s.x+.5*l,p.y=s.y+.5*d,p.z=s.z+.5*E,u};var M=[];h.fromRectangle3D=function(e,t,i,o){t=r(t,a.WGS84),i=r(i,0);var u;return n(e)&&(u=f.subsample(e,t,i,M)),h.fromPoints(u,o)},h.fromVertices=function(t,i,a,o){if(n(o)||(o=new h),!n(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;i=r(i,e.ZERO),a=r(a,3);var u=v;u.x=t[0]+i.x,u.y=t[1]+i.y,u.z=t[2]+i.z;for(var s=e.clone(u,d),c=e.clone(u,E),l=e.clone(u,p),f=e.clone(u,y),N=e.clone(u,m),x=e.clone(u,_),I=t.length,O=0;O<I;O+=a){var w=t[O]+i.x,M=t[O+1]+i.y,C=t[O+2]+i.z;u.x=w,u.y=M,u.z=C,w<s.x&&e.clone(u,s),w>f.x&&e.clone(u,f),M<c.y&&e.clone(u,c),M>N.y&&e.clone(u,N),C<l.z&&e.clone(u,l),C>x.z&&e.clone(u,x)}var P=e.magnitudeSquared(e.subtract(f,s,T)),D=e.magnitudeSquared(e.subtract(N,c,T)),L=e.magnitudeSquared(e.subtract(x,l,T)),U=s,b=f,z=P;D>z&&(z=D,U=c,b=N),L>z&&(z=L,U=l,b=x);var F=R;F.x=.5*(U.x+b.x),F.y=.5*(U.y+b.y),F.z=.5*(U.z+b.z);var B=e.magnitudeSquared(e.subtract(b,F,T)),G=Math.sqrt(B),q=A;q.x=s.x,q.y=c.y,q.z=l.z;var W=S;W.x=f.x,W.y=N.y,W.z=x.z;var H=e.multiplyByScalar(e.add(q,W,T),.5,g),X=0;for(O=0;O<I;O+=a){u.x=t[O]+i.x,u.y=t[O+1]+i.y,u.z=t[O+2]+i.z;var V=e.magnitude(e.subtract(u,H,T));V>X&&(X=V);var Y=e.magnitudeSquared(e.subtract(u,F,T));if(Y>B){var k=Math.sqrt(Y);G=.5*(G+k),B=G*G;var Z=k-G;F.x=(G*F.x+Z*u.x)/k,F.y=(G*F.y+Z*u.y)/k,F.z=(G*F.z+Z*u.z)/k}}return G<X?(e.clone(F,o.center),o.radius=G):(e.clone(H,o.center),o.radius=X),o},h.fromEncodedCartesianVertices=function(t,r,i){if(n(i)||(i=new h),!n(t)||!n(r)||t.length!==r.length||0===t.length)return i.center=e.clone(e.ZERO,i.center),i.radius=0,i;var a=v;a.x=t[0]+r[0],a.y=t[1]+r[1],a.z=t[2]+r[2];for(var o=e.clone(a,d),u=e.clone(a,E),s=e.clone(a,p),c=e.clone(a,y),l=e.clone(a,m),f=e.clone(a,_),N=t.length,x=0;x<N;x+=3){var I=t[x]+r[x],O=t[x+1]+r[x+1],w=t[x+2]+r[x+2];a.x=I,a.y=O,a.z=w,I<o.x&&e.clone(a,o),I>c.x&&e.clone(a,c),O<u.y&&e.clone(a,u),O>l.y&&e.clone(a,l),w<s.z&&e.clone(a,s),w>f.z&&e.clone(a,f)}var M=e.magnitudeSquared(e.subtract(c,o,T)),C=e.magnitudeSquared(e.subtract(l,u,T)),P=e.magnitudeSquared(e.subtract(f,s,T)),D=o,L=c,U=M;C>U&&(U=C,D=u,L=l),P>U&&(U=P,D=s,L=f);var b=R;b.x=.5*(D.x+L.x),b.y=.5*(D.y+L.y),b.z=.5*(D.z+L.z);var z=e.magnitudeSquared(e.subtract(L,b,T)),F=Math.sqrt(z),B=A;B.x=o.x,B.y=u.y,B.z=s.z;var G=S;G.x=c.x,G.y=l.y,G.z=f.z;var q=e.multiplyByScalar(e.add(B,G,T),.5,g),W=0;for(x=0;x<N;x+=3){a.x=t[x]+r[x],a.y=t[x+1]+r[x+1],a.z=t[x+2]+r[x+2];var H=e.magnitude(e.subtract(a,q,T));H>W&&(W=H);var X=e.magnitudeSquared(e.subtract(a,b,T));if(X>z){var V=Math.sqrt(X);F=.5*(F+V),z=F*F;var Y=V-F;b.x=(F*b.x+Y*a.x)/V,b.y=(F*b.y+Y*a.y)/V,b.z=(F*b.z+Y*a.z)/V}}return F<W?(e.clone(b,i.center),i.radius=F):(e.clone(q,i.center),i.radius=W),i},h.fromCornerPoints=function(t,r,i){n(i)||(i=new h);var a=i.center;return e.add(t,r,a),e.multiplyByScalar(a,.5,a),i.radius=e.distance(a,r),i},h.fromEllipsoid=function(t,r){return n(r)||(r=new h),e.clone(e.ZERO,r.center),r.radius=t.maximumRadius,r};var C=new e;h.fromBoundingSpheres=function(t,r){if(n(r)||(r=new h),!n(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var i=t.length;if(1===i)return h.clone(t[0],r);if(2===i)return h.union(t[0],t[1],r);for(var a=[],o=0;o<i;o++)a.push(t[o].center);r=h.fromPoints(a,r);var u=r.center,s=r.radius;for(o=0;o<i;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,C)+c.radius)}return r.radius=s,r};var P=new e,D=new e,L=new e;h.fromOrientedBoundingBox=function(t,r){n(r)||(r=new h);var i=t.halfAxes,a=c.getColumn(i,0,P),o=c.getColumn(i,1,D),u=c.getColumn(i,2,L),s=e.magnitude(a),l=e.magnitude(o),f=e.magnitude(u);return r.center=e.clone(t.center,r.center),r.radius=Math.max(s,l,f),r},h.clone=function(t,r){if(n(t))return n(r)?(r.center=e.clone(t.center,r.center),r.radius=t.radius,r):new h(t.center,t.radius)},h.packedLength=4,h.pack=function(e,t,n){n=r(n,0);var i=e.center;return t[n++]=i.x,t[n++]=i.y,t[n++]=i.z,t[n]=e.radius,t},h.unpack=function(e,t,i){t=r(t,0),n(i)||(i=new h);var a=i.center;return a.x=e[t++],a.y=e[t++],a.z=e[t++],i.radius=e[t],i};var U=new e,b=new e;h.union=function(t,r,i){n(i)||(i=new h);var a=t.center,o=t.radius,u=r.center,s=r.radius,c=e.subtract(u,a,U),l=e.magnitude(c);if(o>=l+s)return t.clone(i),i;if(s>=l+o)return r.clone(i),i;var f=.5*(o+l+s),d=e.multiplyByScalar(c,(-o+f)/l,b);return e.add(d,a,d),e.clone(d,i.center),i.radius=f,i};var z=new e;h.expand=function(t,r,n){n=h.clone(t,n);var i=e.magnitude(e.subtract(r,n.center,z));return i>n.radius&&(n.radius=i),n},h.intersectPlane=function(t,r){var n=t.center,i=t.radius,a=r.normal,o=e.dot(a,n)+r.distance;return o<-i?u.OUTSIDE:o<i?u.INTERSECTING:u.INSIDE},h.transform=function(e,t,r){return n(r)||(r=new h),r.center=l.multiplyByPoint(t,e.center,r.center),r.radius=l.getMaximumScale(t)*e.radius,r};var F=new e;h.distanceSquaredTo=function(t,r){var n=e.subtract(t.center,r,F);return e.magnitudeSquared(n)-t.radius*t.radius},h.transformWithoutScale=function(e,t,r){return n(r)||(r=new h),r.center=l.multiplyByPoint(t,e.center,r.center),r.radius=e.radius,r};var B=new e;h.computePlaneDistances=function(t,r,i,a){n(a)||(a=new s);var o=e.subtract(t.center,r,B),u=e.dot(i,o);return a.start=u-t.radius,a.stop=u+t.radius,a};for(var G=new e,q=new e,W=new e,H=new e,X=new e,V=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var Z=new o;return h.projectTo2D=function(t,n,i){n=r(n,Z);var a=n.ellipsoid,o=t.center,u=t.radius,s=a.geodeticSurfaceNormal(o,G),c=e.cross(e.UNIT_Z,s,q);e.normalize(c,c);var l=e.cross(s,c,W);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var f=e.negate(l,X),d=e.negate(c,H),E=Y,p=E[0];e.add(s,l,p),e.add(p,c,p),p=E[1],e.add(s,l,p),e.add(p,d,p),p=E[2],e.add(s,f,p),e.add(p,d,p),p=E[3],e.add(s,f,p),e.add(p,c,p),e.negate(s,s),p=E[4],e.add(s,l,p),e.add(p,c,p),p=E[5],e.add(s,l,p),e.add(p,d,p),p=E[6],e.add(s,f,p),e.add(p,d,p),p=E[7],e.add(s,f,p),e.add(p,c,p);for(var y=E.length,m=0;m<y;++m){var _=E[m];e.add(o,_,_);var v=a.cartesianToCartographic(_,V);n.project(v,_)}i=h.fromPoints(E,i),o=i.center;var T=o.x,R=o.y,A=o.z;return o.x=A,o.y=T,o.z=R,i},h.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},h.equals=function(t,r){return t===r||n(t)&&n(r)&&e.equals(t.center,r.center)&&t.radius===r.radius},h.prototype.intersectPlane=function(e){return h.intersectPlane(this,e)},h.prototype.distanceSquaredTo=function(e){return h.distanceSquaredTo(this,e)},h.prototype.computePlaneDistances=function(e,t,r){return h.computePlaneDistances(this,e,t,r)},h.prototype.isOccluded=function(e){return h.isOccluded(this,e)},h.prototype.equals=function(e){return h.equals(this,e)},h.prototype.clone=function(e){return h.clone(this,e)},h}),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},i={};return t(i,{element:{get:function(){if(i.supportsFullscreen())return document[n.fullscreenElement]}},changeEventName:{get:function(){if(i.supportsFullscreen())return n.fullscreenchange}},errorEventName:{get:function(){if(i.supportsFullscreen())return n.fullscreenerror}},enabled:{get:function(){if(i.supportsFullscreen())return document[n.fullscreenEnabled]}},fullscreen:{get:function(){if(i.supportsFullscreen())return null!==i.element}}}),i.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 i,a=["webkit","moz","o","ms","khtml"],o=0,u=a.length;o<u;++o){var s=a[o];i=s+"RequestFullscreen","function"==typeof t[i]?(n.requestFullscreen=i,r=!0):(i=s+"RequestFullScreen","function"==typeof t[i]&&(n.requestFullscreen=i,r=!0)),i=s+"ExitFullscreen","function"==typeof document[i]?n.exitFullscreen=i:(i=s+"CancelFullScreen","function"==typeof document[i]&&(n.exitFullscreen=i)),i=s+"FullscreenEnabled",void 0!==document[i]?n.fullscreenEnabled=i:(i=s+"FullScreenEnabled",void 0!==document[i]&&(n.fullscreenEnabled=i)),i=s+"FullscreenElement",void 0!==document[i]?n.fullscreenElement=i:(i=s+"FullScreenElement",void 0!==document[i]&&(n.fullscreenElement=i)),i=s+"fullscreenchange",void 0!==document["on"+i]&&("ms"===s&&(i="MSFullscreenChange"),n.fullscreenchange=i),i=s+"fullscreenerror",void 0!==document["on"+i]&&("ms"===s&&(i="MSFullscreenError"),n.fullscreenerror=i)}return r},i.requestFullscreen=function(e,t){i.supportsFullscreen()&&e[n.requestFullscreen]({vrDisplay:t})},i.exitFullscreen=function(){i.supportsFullscreen()&&document[n.exitFullscreen]()},i}),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;r<n;++r)t[r]=parseInt(t[r],10);return t}function i(){if(!t(R)&&(R=!1,!h())){var e=/ Chrome\/([\.0-9]+)/.exec(T.userAgent);null!==e&&(R=!0,A=n(e[1]))}return R}function a(){return i()&&A}function o(){if(!t(S)&&(S=!1,!i()&&!h()&&/ Safari\/[\.0-9]+/.test(T.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(T.userAgent);null!==e&&(S=!0,g=n(e[1]))}return S}function u(){return o()&&g}function s(){if(!t(N)){N=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(T.userAgent);null!==e&&(N=!0,x=n(e[1]),x.isNightly=!!e[2])}return N}function c(){return s()&&x}function l(){if(!t(I)){I=!1;var e;"Microsoft Internet Explorer"===T.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(T.userAgent),null!==e&&(I=!0,O=n(e[1]))):"Netscape"===T.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(T.userAgent),null!==e&&(I=!0,O=n(e[1])))}return I}function f(){ -return l()&&O}function h(){if(!t(w)){w=!1;var e=/ Edge\/([\.0-9]+)/.exec(T.userAgent);null!==e&&(w=!0,M=n(e[1]))}return w}function d(){return h()&&M}function E(){if(!t(C)){C=!1;var e=/Firefox\/([\.0-9]+)/.exec(T.userAgent);null!==e&&(C=!0,P=n(e[1]))}return C}function p(){return t(D)||(D=/Windows/i.test(T.appVersion)),D}function y(){return E()&&P}function m(){return t(L)||(L="undefined"!=typeof PointerEvent&&(!t(T.pointerEnabled)||T.pointerEnabled)),L}function _(){if(!t(b)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var r=e.style.imageRendering;b=t(r)&&""!==r,b&&(U=r)}return b}function v(){return _()?U:void 0}var T;T="undefined"!=typeof navigator?navigator:{};var R,A,S,g,N,x,I,O,w,M,C,P,D,L,U,b,z={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isEdge:h,edgeVersion:d,isFirefox:E,firefoxVersion:y,isWindows:p,hardwareConcurrency:e(T.hardwareConcurrency,3),supportsPointerEvents:m,supportsImageRenderingPixelated:_,imageRenderingValue:v};return z.supportsFullscreen=function(){return r.supportsFullscreen()},z.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},z.supportsWebWorkers=function(){return"undefined"!=typeof Worker},z}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,r,n,i,a){"use strict";if(!n.supportsTypedArrays())return{};var o={BYTE:a.BYTE,UNSIGNED_BYTE:a.UNSIGNED_BYTE,SHORT:a.SHORT,UNSIGNED_SHORT:a.UNSIGNED_SHORT,INT:a.INT,UNSIGNED_INT:a.UNSIGNED_INT,FLOAT:a.FLOAT,DOUBLE:a.DOUBLE};return o.getSizeInBytes=function(e){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.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},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 Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,r,n,i){switch(n=e(n,0),i=e(i,(r.byteLength-n)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(r,n,i);case o.UNSIGNED_BYTE:return new Uint8Array(r,n,i);case o.SHORT:return new Int16Array(r,n,i);case o.UNSIGNED_SHORT:return new Uint16Array(r,n,i);case o.INT:return new Int32Array(r,n,i);case o.UNSIGNED_INT:return new Uint32Array(r,n,i);case o.FLOAT:return new Float32Array(r,n,i);case o.DOUBLE:return new Float64Array(r,n,i)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},i(o)}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Intersect"],function(e,t,r,n,i){"use strict";function a(n,i,a){this.minimum=e.clone(t(n,e.ZERO)),this.maximum=e.clone(t(i,e.ZERO)),r(a)?a=e.clone(a):(a=e.add(this.minimum,this.maximum,new e),e.multiplyByScalar(a,.5,a)),this.center=a}a.fromPoints=function(t,n){if(r(n)||(n=new a),!r(t)||0===t.length)return n.minimum=e.clone(e.ZERO,n.minimum),n.maximum=e.clone(e.ZERO,n.maximum),n.center=e.clone(e.ZERO,n.center),n;for(var i=t[0].x,o=t[0].y,u=t[0].z,s=t[0].x,c=t[0].y,l=t[0].z,f=t.length,h=1;h<f;h++){var d=t[h],E=d.x,p=d.y,y=d.z;i=Math.min(E,i),s=Math.max(E,s),o=Math.min(p,o),c=Math.max(p,c),u=Math.min(y,u),l=Math.max(y,l)}var m=n.minimum;m.x=i,m.y=o,m.z=u;var _=n.maximum;_.x=s,_.y=c,_.z=l;var v=e.add(m,_,n.center);return e.multiplyByScalar(v,.5,v),n},a.clone=function(t,n){if(r(t))return r(n)?(n.minimum=e.clone(t.minimum,n.minimum),n.maximum=e.clone(t.maximum,n.maximum),n.center=e.clone(t.center,n.center),n):new a(t.minimum,t.maximum)},a.equals=function(t,n){return t===n||r(t)&&r(n)&&e.equals(t.center,n.center)&&e.equals(t.minimum,n.minimum)&&e.equals(t.maximum,n.maximum)};var o=new e;return a.intersectPlane=function(t,r){o=e.subtract(t.maximum,t.minimum,o);var n=e.multiplyByScalar(o,.5,o),a=r.normal,u=n.x*Math.abs(a.x)+n.y*Math.abs(a.y)+n.z*Math.abs(a.z),s=e.dot(t.center,a)+r.distance;return s-u>0?i.INSIDE:s+u<0?i.OUTSIDE:i.INTERSECTING},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.intersectPlane=function(e){return a.intersectPlane(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a}),define("Core/Cartesian2",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,i){"use strict";function a(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){if(t(e))return t(r)?(r.x=e.x,r.y=e.y,r):new a(e.x,e.y)},a.fromCartesian3=a.clone,a.fromCartesian4=a.clone,a.packedLength=2,a.pack=function(t,r,n){return n=e(n,0),r[n++]=t.x,r[n]=t.y,r},a.unpack=function(r,n,i){return n=e(n,0),t(i)||(i=new a),i.x=r[n++],i.y=r[n],i},a.packArray=function(e,r){var n=e.length;t(r)?r.length=2*n:r=new Array(2*n);for(var i=0;i<n;++i)a.pack(e[i],r,2*i);return r},a.unpackArray=function(e,r){var n=e.length;t(r)?r.length=n/2:r=new Array(n/2);for(var i=0;i<n;i+=2){var o=i/2;r[o]=a.unpack(e,i,r[o])}return r},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 o=new a;a.distance=function(e,t){return a.subtract(e,t,o),a.magnitude(o)},a.distanceSquared=function(e,t){return a.subtract(e,t,o),a.magnitudeSquared(o)},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.divideComponents=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),i.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.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]},a.equalsEpsilon=function(e,r,n,a){return e===r||t(e)&&t(r)&&i.equalsEpsilon(e.x,r.x,n,a)&&i.equalsEpsilon(e.y,r.y,n,a)},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,r){return a.equalsEpsilon(this,e,t,r)},a.prototype.toString=function(){return"("+this.x+", "+this.y+")"},a}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function r(e,r,n){var i=e+r;return t.sign(e)!==t.sign(r)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(r)))<n?0:i}var n={};return n.computeDiscriminant=function(e,t,r){var n=t*t-4*e*r;return n},n.computeRealRoots=function(e,n,i){var a;if(0===e)return 0===n?[]:[-i/n];if(0===n){if(0===i)return[0,0];var o=Math.abs(i),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(a=-i/e,a<0)return[];var s=Math.sqrt(a);return[-s,s]}if(0===i)return a=-n/e,a<0?[a,0]:[0,a];var c=n*n,l=4*e*i,f=r(c,-l,t.EPSILON14);if(f<0)return[];var h=-.5*r(n,t.sign(n)*Math.sqrt(f),t.EPSILON14);return n>0?[h/e,i/h]:[i/h,h/e]},n}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function r(e,t,r,n){var i,a,o=e,u=t/3,s=r/3,c=n,l=o*s,f=u*c,h=u*u,d=s*s,E=o*s-h,p=o*c-u*s,y=u*c-d,m=4*E*y-p*p;if(m<0){var _,v,T;h*f>=l*d?(_=o,v=E,T=-2*u*E+o*p):(_=c,v=y,T=-c*p+2*s*y);var R=T<0?-1:1,A=-R*Math.abs(_)*Math.sqrt(-m);a=-T+A;var S=a/2,g=S<0?-Math.pow(-S,1/3):Math.pow(S,1/3),N=a===A?-g:-v/g;return i=v<=0?g+N:-T/(g*g+N*N+v),h*f>=l*d?[(i-u)/o]:[-c/(i+s)]}var x=E,I=-2*u*E+o*p,O=y,w=-c*p+2*s*y,M=Math.sqrt(m),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*M,-I)/3);i=2*Math.sqrt(-x);var D=Math.cos(P);a=i*D;var L=i*(-D/2-C*Math.sin(P)),U=a+L>2*u?a-u:L-u,b=o,z=U/b;P=Math.abs(Math.atan2(c*M,-w)/3),i=2*Math.sqrt(-O),D=Math.cos(P),a=i*D,L=i*(-D/2-C*Math.sin(P));var F=-c,B=a+L<2*s?a+s:L+s,G=F/B,q=b*B,W=-U*B-b*F,H=U*F,X=(s*W-u*H)/(-u*W+s*q);return z<=X?z<=G?X<=G?[z,X,G]:[z,G,X]:[G,z,X]:z<=G?[X,z,G]:X<=G?[X,G,z]:[G,X,z]}var n={};return n.computeDiscriminant=function(e,t,r,n){var i=e*e,a=t*t,o=r*r,u=n*n,s=18*e*t*r*n+a*o-27*i*u-4*(e*o*r+a*t*n);return s},n.computeRealRoots=function(e,n,i,a){var o,u;if(0===e)return t.computeRealRoots(n,i,a);if(0===n){if(0===i){if(0===a)return[0,0,0];u=-a/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===a?(o=t.computeRealRoots(e,0,i),0===o.Length?[0]:[o[0],0,o[1]]):r(e,0,i,a)}return 0===i?0===a?(u=-n/e,u<0?[u,0,0]:[0,0,u]):r(e,n,0,a):0===a?(o=t.computeRealRoots(e,n,i),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):r(e,n,i,a)},n}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,r,n){"use strict";function i(t,i,a,o){var u=t*t,s=i-3*u/8,c=a-i*t/2+u*t/8,l=o-a*t/4+i*u/16-3*u*u/256,f=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(f.length>0){var h=-t/4,d=f[f.length-1];if(Math.abs(d)<r.EPSILON14){var E=n.computeRealRoots(1,s,l);if(2===E.length){var p,y=E[0],m=E[1];if(y>=0&&m>=0){var _=Math.sqrt(y),v=Math.sqrt(m);return[h-v,h-_,h+_,h+v]}if(y>=0&&m<0)return p=Math.sqrt(y),[h-p,h+p];if(y<0&&m>=0)return p=Math.sqrt(m),[h-p,h+p]}return[]}if(d>0){var T=Math.sqrt(d),R=(s+d-c/T)/2,A=(s+d+c/T)/2,S=n.computeRealRoots(1,T,R),g=n.computeRealRoots(1,-T,A);return 0!==S.length?(S[0]+=h,S[1]+=h,0!==g.length?(g[0]+=h,g[1]+=h,S[1]<=g[0]?[S[0],S[1],g[0],g[1]]:g[1]<=S[0]?[g[0],g[1],S[0],S[1]]:S[0]>=g[0]&&S[1]<=g[1]?[g[0],S[0],S[1],g[1]]:g[0]>=S[0]&&g[1]<=S[1]?[S[0],g[0],g[1],S[1]]:S[0]>g[0]&&S[0]<g[1]?[g[0],S[0],g[1],S[1]]:[S[0],g[0],S[1],g[1]]):S):0!==g.length?(g[0]+=h,g[1]+=h,g):[]}}return[]}function a(t,i,a,o){var u=a*a,s=i*i,c=t*t,l=-2*i,f=a*t+s-4*o,h=c*o-a*i*t+u,d=e.computeRealRoots(1,l,f,h);if(d.length>0){var E,p,y=d[0],m=i-y,_=m*m,v=t/2,T=m/2,R=_-4*o,A=_+4*Math.abs(o),S=c-4*y,g=c+4*Math.abs(y);if(y<0||R*g<S*A){var N=Math.sqrt(S);E=N/2,p=0===N?0:(t*T-a)/N}else{var x=Math.sqrt(R);E=0===x?0:(t*T-a)/x,p=x/2}var I,O;0===v&&0===E?(I=0,O=0):r.sign(v)===r.sign(E)?(I=v+E,O=y/I):(O=v-E,I=y/O);var w,M;0===T&&0===p?(w=0,M=0):r.sign(T)===r.sign(p)?(w=T+p,M=o/w):(M=T-p,w=o/M);var C=n.computeRealRoots(1,I,w),P=n.computeRealRoots(1,O,M);if(0!==C.length)return 0!==P.length?C[1]<=P[0]?[C[0],C[1],P[0],P[1]]:P[1]<=C[0]?[P[0],P[1],C[0],C[1]]:C[0]>=P[0]&&C[1]<=P[1]?[P[0],C[0],C[1],P[1]]:P[0]>=C[0]&&P[1]<=C[1]?[C[0],P[0],P[1],C[1]]:C[0]>P[0]&&C[0]<P[1]?[P[0],C[0],P[1],C[1]]:[C[0],P[0],C[1],P[1]]:C;if(0!==P.length)return P}return[]}var o={};return o.computeDiscriminant=function(e,t,r,n,i){var a=e*e,o=a*e,u=t*t,s=u*t,c=r*r,l=c*r,f=n*n,h=f*n,d=i*i,E=d*i,p=u*c*f-4*s*h-4*e*l*f+18*e*t*r*h-27*a*f*f+256*o*E+i*(18*s*r*n-4*u*l+16*e*c*c-80*e*t*c*n-6*e*u*f+144*a*r*f)+d*(144*e*u*r-27*u*u-128*a*c-192*a*t*n);return p},o.computeRealRoots=function(t,n,o,u,s){if(Math.abs(t)<r.EPSILON15)return e.computeRealRoots(n,o,u,s);var c=n/t,l=o/t,f=u/t,h=s/t,d=c<0?1:0;switch(d+=l<0?d+1:d,d+=f<0?d+1:d,d+=h<0?d+1:d){case 0:return i(c,l,f,h);case 1:return a(c,l,f,h);case 2:return a(c,l,f,h);case 3:return i(c,l,f,h);case 4:return i(c,l,f,h);case 5:return a(c,l,f,h);case 6:return i(c,l,f,h);case 7:return i(c,l,f,h);case 8:return a(c,l,f,h);case 9:return i(c,l,f,h);case 10:return i(c,l,f,h);case 11:return a(c,l,f,h);case 12:return i(c,l,f,h);case 13:return i(c,l,f,h);case 14:return i(c,l,f,h);case 15:return i(c,l,f,h);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function i(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 i.getPoint=function(t,n,i){return r(i)||(i=new e),i=e.multiplyByScalar(t.direction,n,i),e.add(t.origin,i,i)},i}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,r,n,i,a,o,u,s,c){"use strict";function l(e,t,r,n){var i=t*t-4*e*r;if(!(i<0)){if(i>0){var a=1/(2*e),o=Math.sqrt(i),u=(-t+o)*a,s=(-t-o)*a;return u<s?(n.root0=u,n.root1=s):(n.root0=s,n.root1=u),n}var c=-t/(2*e);if(0!==c)return n.root0=n.root1=c,n}}function f(t,r,i){n(i)||(i={});var a=t.origin,o=t.direction,u=r.center,s=r.radius*r.radius,c=e.subtract(a,u,m),f=e.dot(o,o),h=2*e.dot(o,c),d=e.magnitudeSquared(c)-s,E=l(f,h,d,R);if(n(E))return i.start=E.root0,i.stop=E.root1,i}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,i,c){var l,f=i*i,d=c*c,E=(t[o.COLUMN1ROW1]-t[o.COLUMN2ROW2])*d,p=c*(i*h(t[o.COLUMN1ROW0],t[o.COLUMN0ROW1],a.EPSILON15)+r.y),y=t[o.COLUMN0ROW0]*f+t[o.COLUMN2ROW2]*d+i*r.x+n,m=d*h(t[o.COLUMN2ROW1],t[o.COLUMN1ROW2],a.EPSILON15),_=c*(i*h(t[o.COLUMN2ROW0],t[o.COLUMN0ROW2])+r.z),v=[];if(0===_&&0===m){if(l=u.computeRealRoots(E,p,y),0===l.length)return v;var T=l[0],R=Math.sqrt(Math.max(1-T*T,0));if(v.push(new e(i,c*T,c*-R)),v.push(new e(i,c*T,c*R)),2===l.length){var A=l[1],S=Math.sqrt(Math.max(1-A*A,0));v.push(new e(i,c*A,c*-S)),v.push(new e(i,c*A,c*S))}return v}var g=_*_,N=m*m,x=E*E,I=_*m,O=x+N,w=2*(p*E+I),M=2*y*E+p*p-N+g,C=2*(y*p-I),P=y*y-g;if(0===O&&0===w&&0===M&&0===C)return v;l=s.computeRealRoots(O,w,M,C,P);var D=l.length;if(0===D)return v;for(var L=0;L<D;++L){var U,b=l[L],z=b*b,F=Math.max(1-z,0),B=Math.sqrt(F);U=a.sign(E)===a.sign(y)?h(E*z+y,p*b,a.EPSILON12):a.sign(y)===a.sign(p*b)?h(E*z,p*b+y,a.EPSILON12):h(E*z+p*b,y,a.EPSILON12);var G=h(m*b,_,a.EPSILON15),q=U*G;q<0?v.push(new e(i,c*b,c*B)):q>0?v.push(new e(i,c*b,c*-B)):0!==B?(v.push(new e(i,c*b,c*-B)),v.push(new e(i,c*b,c*B)),++L):v.push(new e(i,c*b,c*B))}return v}var E={};E.rayPlane=function(t,r,i){n(i)||(i=new e);var o=t.origin,u=t.direction,s=r.normal,c=e.dot(s,u);if(!(Math.abs(c)<a.EPSILON15)){var l=(-r.distance-e.dot(s,o))/c;if(!(l<0))return i=e.multiplyByScalar(u,l,i),e.add(o,i,i)}};var p=new e,y=new e,m=new e,_=new e,v=new e;E.rayTriangleParametric=function(t,n,i,o,u){u=r(u,!1);var s,c,l,f,h,d=t.origin,E=t.direction,T=e.subtract(i,n,p),R=e.subtract(o,n,y),A=e.cross(E,R,m),S=e.dot(T,A);if(u){if(S<a.EPSILON6)return;if(s=e.subtract(d,n,_),l=e.dot(s,A),l<0||l>S)return;if(c=e.cross(s,T,v),f=e.dot(E,c),f<0||l+f>S)return;h=e.dot(R,c)/S}else{if(Math.abs(S)<a.EPSILON6)return;var g=1/S;if(s=e.subtract(d,n,_),l=e.dot(s,A)*g,l<0||l>1)return;if(c=e.cross(s,T,v),f=e.dot(E,c)*g,f<0||l+f>1)return;h=e.dot(R,c)*g}return h},E.rayTriangle=function(t,r,i,a,o,u){var s=E.rayTriangleParametric(t,r,i,a,o);if(n(s)&&!(s<0))return n(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var T=new c;E.lineSegmentTriangle=function(t,r,i,a,o,u,s){var c=T;e.clone(t,c.origin),e.subtract(r,t,c.direction),e.normalize(c.direction,c.direction);var l=E.rayTriangleParametric(c,i,a,o,u);if(!(!n(l)||l<0||l>e.distance(t,r)))return n(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var R={root0:0,root1:0};E.raySphere=function(e,t,r){if(r=f(e,t,r),n(r)&&!(r.stop<0))return r.start=Math.max(r.start,0),r};var A=new c;E.lineSegmentSphere=function(t,r,i,a){var o=A;e.clone(t,o.origin);var u=e.subtract(r,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),a=f(o,i,a),!(!n(a)||a.stop<0||a.start>s))return a.start=Math.max(a.start,0),a.stop=Math.min(a.stop,s),a};var S=new e,g=new e;E.rayEllipsoid=function(t,r){var n,i,a,o,u,s=r.oneOverRadii,c=e.multiplyComponents(s,t.origin,S),l=e.multiplyComponents(s,t.direction,g),f=e.magnitudeSquared(c),h=e.dot(c,l);if(f>1){if(h>=0)return;var d=h*h;if(n=f-1,i=e.magnitudeSquared(l),a=i*n,d<a)return;if(d>a){o=h*h-a,u=-h+Math.sqrt(o);var E=u/i,p=n/u;return E<p?{start:E,stop:p}:{start:p,stop:E}}var y=Math.sqrt(n/i);return{start:y,stop:y}}return f<1?(n=f-1,i=e.magnitudeSquared(l),a=i*n,o=h*h-a,u=-h+Math.sqrt(o),{start:0,stop:u/i}):h<0?(i=e.magnitudeSquared(l),{start:0,stop:-h/i}):void 0};var N=new e,x=new e,I=new e,O=new e,w=new e,M=new o,C=new o,P=new o,D=new o,L=new o,U=new o,b=new o,z=new e,F=new e,B=new t;E.grazingAltitudeLocation=function(t,r){var i=t.origin,u=t.direction;if(!e.equals(i,e.ZERO)){var s=r.geodeticSurfaceNormal(i,N);if(e.dot(u,s)>=0)return i}var c=n(this.rayEllipsoid(t,r)),l=r.transformPositionToScaledSpace(u,N),f=e.normalize(l,l),h=e.mostOrthogonalAxis(l,O),E=e.normalize(e.cross(h,f,x),x),p=e.normalize(e.cross(f,E,I),I),y=M;y[0]=f.x,y[1]=f.y,y[2]=f.z,y[3]=E.x,y[4]=E.y,y[5]=E.z,y[6]=p.x,y[7]=p.y,y[8]=p.z;var m=o.transpose(y,C),_=o.fromScale(r.radii,P),v=o.fromScale(r.oneOverRadii,D),T=L;T[0]=0,T[1]=-u.z,T[2]=u.y,T[3]=u.z,T[4]=0,T[5]=-u.x,T[6]=-u.y,T[7]=u.x,T[8]=0;var R,A,S=o.multiply(o.multiply(m,v,U),T,U),g=o.multiply(o.multiply(S,_,b),y,b),G=o.multiplyByVector(S,i,w),q=d(g,e.negate(G,N),0,0,1),W=q.length;if(W>0){for(var H=e.clone(e.ZERO,F),X=Number.NEGATIVE_INFINITY,V=0;V<W;++V){R=o.multiplyByVector(_,o.multiplyByVector(y,q[V],z),z);var Y=e.normalize(e.subtract(R,i,O),O),k=e.dot(Y,u);k>X&&(X=k,H=e.clone(R,H)); -}var Z=r.cartesianToCartographic(H,B);return X=a.clamp(X,0,1),A=e.magnitude(e.subtract(H,i,O))*Math.sqrt(1-X*X),A=c?-A:A,Z.height=A,r.cartographicToCartesian(Z,new e)}};var G=new e;return E.lineSegmentPlane=function(t,r,i,o){n(o)||(o=new e);var u=e.subtract(r,t,G),s=i.normal,c=e.dot(s,u);if(!(Math.abs(c)<a.EPSILON6)){var l=e.dot(s,t),f=-(i.distance+l)/c;if(!(f<0||f>1))return e.multiplyByScalar(u,f,o),e.add(t,o,o),o}},E.trianglePlaneIntersection=function(t,r,n,i){var a=i.normal,o=i.distance,u=e.dot(a,t)+o<0,s=e.dot(a,r)+o<0,c=e.dot(a,n)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var f,h;if(1!==l&&2!==l||(f=new e,h=new e),1===l){if(u)return E.lineSegmentPlane(t,r,i,f),E.lineSegmentPlane(t,n,i,h),{positions:[t,r,n,f,h],indices:[0,3,4,1,2,4,1,4,3]};if(s)return E.lineSegmentPlane(r,n,i,f),E.lineSegmentPlane(r,t,i,h),{positions:[t,r,n,f,h],indices:[1,3,4,2,0,4,2,4,3]};if(c)return E.lineSegmentPlane(n,t,i,f),E.lineSegmentPlane(n,r,i,h),{positions:[t,r,n,f,h],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return E.lineSegmentPlane(r,t,i,f),E.lineSegmentPlane(n,t,i,h),{positions:[t,r,n,f,h],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return E.lineSegmentPlane(n,r,i,f),E.lineSegmentPlane(t,r,i,h),{positions:[t,r,n,f,h],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return E.lineSegmentPlane(t,n,i,f),E.lineSegmentPlane(r,n,i,h),{positions:[t,r,n,f,h],indices:[0,1,4,0,4,3,2,3,4]}}},E}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,r,n){"use strict";function i(t,r){this.normal=e.clone(t),this.distance=r}i.fromPointNormal=function(r,n,a){var o=-e.dot(n,r);return t(a)?(e.clone(n,a.normal),a.distance=o,a):new i(n,o)};var a=new e;return i.fromCartesian4=function(r,n){var o=e.fromCartesian4(r,a),u=r.w;return t(n)?(e.clone(o,n.normal),n.distance=u,n):new i(o,u)},i.getPointDistance=function(t,r){return e.dot(t.normal,r)+t.distance},i.ORIGIN_XY_PLANE=n(new i(e.UNIT_Z,0)),i.ORIGIN_YZ_PLANE=n(new i(e.UNIT_X,0)),i.ORIGIN_ZX_PLANE=n(new i(e.UNIT_Y,0)),i}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,r,n,i){return t(e).then(r,n,i)}function t(e){var t,r;return e instanceof n?t=e:u(e)?(r=o(),e.then(function(e){r.resolve(e)},function(e){r.reject(e)},function(e){r.progress(e)}),t=r.promise):t=i(e),t}function r(t){return e(t,a)}function n(e){this.then=e}function i(e){var r=new n(function(r){try{return t(r?r(e):e)}catch(e){return a(e)}});return r}function a(e){var r=new n(function(r,n){try{return n?t(n(e)):a(e)}catch(e){return a(e)}});return r}function o(){function e(e,t,r){return h(e,t,r)}function r(e){return E(e)}function i(e){return E(a(e))}function u(e){return d(e)}var s,c,l,f,h,d,E;return c=new n(e),s={then:e,resolve:r,reject:i,progress:u,promise:c,resolver:{resolve:r,reject:i,progress:u}},l=[],f=[],h=function(e,t,r){var n,i;return n=o(),i="function"==typeof r?function(e){try{n.progress(r(e))}catch(e){n.progress(e)}}:function(e){n.progress(e)},l.push(function(r){r.then(e,t).then(n.resolve,n.reject,i)}),f.push(i),n.promise},d=function(e){return p(f,e),e},E=function(e){return e=t(e),h=e.then,E=t,d=m,p(l,e),f=l=R,e},s}function u(e){return e&&"function"==typeof e.then}function s(t,r,n,i,a){return y(2,arguments),e(t,function(t){function u(e){p(e)}function s(e){E(e)}var c,l,f,h,d,E,p,y,_,v;if(_=t.length>>>0,c=Math.max(0,Math.min(r,_)),f=[],l=_-c+1,h=[],d=o(),c)for(y=d.progress,p=function(e){h.push(e),--l||(E=p=m,d.reject(h))},E=function(e){f.push(e),--c||(E=p=m,d.resolve(f))},v=0;v<_;++v)v in t&&e(t[v],s,u,y);else d.resolve(f);return d.then(n,i,a)})}function c(e,t,r,n){function i(e){return t?t(e[0]):e[0]}return s(e,1,i,r,n)}function l(e,t,r,n){return y(1,arguments),h(e,_).then(t,r,n)}function f(){return h(arguments,_)}function h(t,r){return e(t,function(t){var n,i,a,u,s,c;if(a=i=t.length>>>0,n=[],c=o(),a)for(u=function(t,i){e(t,r).then(function(e){n[i]=e,--a||c.resolve(n)},c.reject)},s=0;s<i;s++)s in t?u(t[s],s):--a;else c.resolve(n);return c.promise})}function d(t,r){var n=T.call(arguments,1);return e(t,function(t){var i;return i=t.length,n[0]=function(t,n,a){return e(t,function(t){return e(n,function(e){return r(t,e,a,i)})})},v.apply(t,n)})}function E(t,r,n){var i=arguments.length>2;return e(t,function(e){return e=i?n:e,r.resolve(e),e},function(e){return r.reject(e),a(e)},r.progress)}function p(e,t){for(var r,n=0;r=e[n++];)r(t)}function y(e,t){for(var r,n=t.length;n>e;)if(r=t[--n],null!=r&&"function"!=typeof r)throw new Error("arg "+n+" must be a function")}function m(){}function _(e){return e}var v,T,R;return e.defer=o,e.resolve=t,e.reject=r,e.join=f,e.all=l,e.map=h,e.reduce=d,e.any=c,e.some=s,e.chain=E,e.isPromise=u,n.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(R,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return l(t,function(t){return e.apply(R,t)})})}},T=[].slice,v=[].reduce||function(e){var t,r,n,i,a;if(a=0,t=Object(this),i=t.length>>>0,r=arguments,r.length<=1)for(;;){if(a in t){n=t[a++];break}if(++a>=i)throw new TypeError}else n=r[1];for(;a<i;++a)a in t&&(n=e(n,t[a],a,t));return n},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(r,n){t(i[r])||(i[r]=!0,console.log(e(n,r)))}var i={};return n.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.",n}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,r){"use strict";function n(e,t){r(e,t)}return n}),define("Core/binarySearch",["./defined","./DeveloperError"],function(e,t){"use strict";function r(e,t,r){for(var n,i,a=0,o=e.length-1;a<=o;)if(n=~~((a+o)/2),i=r(e[n],t),i<0)a=n+1;else{if(!(i>0))return n;o=n-1}return~(o+1)}return r}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,r,n,i){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=r,this.yPoleOffset=n,this.ut1MinusUtc=i}return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,r=0,n=t[r++],i=function(e,t,r,n){r||(r=" ");var i=e.length>=t?"":Array(1+t-e.length>>>0).join(r);return n?e+i:i+e},a=function(e,t,r,n,a,o){var u=n-e.length;return u>0&&(e=r||!a?i(e,n,o,r):e.slice(0,t.length)+i("",u,"0",!0)+e.slice(t.length)),e},o=function(e,t,r,n,o,u,s){var c=e>>>0;return r=r&&c&&{2:"0b",8:"0",16:"0x"}[t]||"",e=r+i(c.toString(t),u||0,"0",!1),a(e,r,n,o,s)},u=function(e,t,r,n,i,o){return null!=n&&(e=e.slice(0,n)),a(e,"",t,r,i,o)},s=function(e,n,s,c,l,f,h){var d,E,p,y,m;if("%%"==e)return"%";for(var _=!1,v="",T=!1,R=!1,A=" ",S=s.length,g=0;s&&g<S;g++)switch(s.charAt(g)){case" ":v=" ";break;case"+":v="+";break;case"-":_=!0;break;case"'":A=s.charAt(g+1);break;case"0":T=!0;break;case"#":R=!0}if(c=c?"*"==c?+t[r++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,c<0&&(c=-c,_=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(f=f?"*"==f?+t[r++]:"*"==f.charAt(0)?+t[f.slice(1,-1)]:+f:"fFeE".indexOf(h)>-1?6:"d"==h?0:void 0,m=n?t[n.slice(0,-1)]:t[r++],h){case"s":return u(String(m),_,c,f,T,A);case"c":return u(String.fromCharCode(+m),_,c,f,T);case"b":return o(m,2,R,_,c,f,T);case"o":return o(m,8,R,_,c,f,T);case"x":return o(m,16,R,_,c,f,T);case"X":return o(m,16,R,_,c,f,T).toUpperCase();case"u":return o(m,10,R,_,c,f,T);case"i":case"d":return d=+m||0,d=Math.round(d-d%1),E=d<0?"-":v,m=E+i(String(Math.abs(d)),f,"0",!1),a(m,E,_,c,T);case"e":case"E":case"f":case"F":case"g":case"G":return d=+m,E=d<0?"-":v,p=["toExponential","toFixed","toPrecision"]["efg".indexOf(h.toLowerCase())],y=["toString","toUpperCase"]["eEfFgG".indexOf(h)%2],m=E+Math.abs(d)[p](f),a(m,E,_,c,T)[y]();default:return e}};return n.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,r,n,i,a,o,u){this.year=e,this.month=t,this.day=r,this.hour=n,this.minute=i,this.second=a,this.millisecond=o,this.isLeapSecond=u}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e(t)}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,r,n,i,a,o,u,s,c){"use strict";function l(e,t){return p.compare(e.julianDate,t.julianDate)}function f(e){v.julianDate=e;var r=p.leapSeconds,n=t(r,v,l);n<0&&(n=~n),n>=r.length&&(n=r.length-1);var i=r[n].offset;if(n>0){var a=p.secondsDifference(r[n].julianDate,e);a>i&&(n--,i=r[n].offset)}p.addSeconds(e,i,e)}function h(e,r){v.julianDate=e;var n=p.leapSeconds,i=t(n,v,l);if(i<0&&(i=~i),0===i)return p.addSeconds(e,-n[0].offset,r);if(i>=n.length)return p.addSeconds(e,-n[i-1].offset,r);var a=p.secondsDifference(n[i].julianDate,e);return 0===a?p.addSeconds(e,-n[i].offset,r):a<=1?void 0:p.addSeconds(e,-n[--i].offset,r)}function d(e,t,r){var n=t/s.SECONDS_PER_DAY|0;return e+=n,t-=s.SECONDS_PER_DAY*n,t<0&&(e--,t+=s.SECONDS_PER_DAY),r.dayNumber=e,r.secondsOfDay=t,r}function E(e,t,r,n,i,a,o){var u=(t-14)/12|0,c=e+4800+u,l=(1461*c/4|0)+(367*(t-2-12*u)/12|0)-(3*((c+100)/100|0)/4|0)+r-32075;n-=12,n<0&&(n+=24);var f=a+(n*s.SECONDS_PER_HOUR+i*s.SECONDS_PER_MINUTE+o*s.SECONDS_PER_MILLISECOND);return f>=43200&&(l-=1),[l,f]}function p(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=r(e,0),t=r(t,0),n=r(n,c.UTC);var i=0|e;t+=(e-i)*s.SECONDS_PER_DAY,d(i,t,this),n===c.UTC&&f(this)}var y=new a,m=[31,28,31,30,31,30,31,31,30,31,30,31],_=29,v=new u,T=/^(\d{4})$/,R=/^(\d{4})-(\d{2})$/,A=/^(\d{4})-?(\d{3})$/,S=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,g=/^(\d{4})-?(\d{2})-?(\d{2})$/,N=/([Z+\-])?(\d{2})?:?(\d{2})?$/,x=/^(\d{2})(\.\d+)?/.source+N.source,I=/^(\d{2}):?(\d{2})(\.\d+)?/.source+N.source,O=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+N.source;p.fromDate=function(e,t){var r=E(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return n(t)?(d(r[0],r[1],t),f(t),t):new p(r[0],r[1],c.UTC)},p.fromIso8601=function(e,t){e=e.replace(",",".");var r,i,a,u=e.split("T"),s=1,l=1,h=0,y=0,v=0,N=0,w=u[0],M=u[1];if(u=w.match(g),null!==u)r=+u[1],s=+u[2],l=+u[3];else if(u=w.match(R),null!==u)r=+u[1],s=+u[2];else if(u=w.match(T),null!==u)r=+u[1];else{var C;if(u=w.match(A),null!==u)r=+u[1],C=+u[2],a=o(r);else if(u=w.match(S),null!==u){r=+u[1];var P=+u[2],D=+u[3]||0,L=new Date(Date.UTC(r,0,4));C=7*P+D-L.getUTCDay()-3}i=new Date(Date.UTC(r,0,1)),i.setUTCDate(C),s=i.getUTCMonth()+1,l=i.getUTCDate()}a=o(r);var U;if(n(M)){u=M.match(O),null!==u?(h=+u[1],y=+u[2],v=+u[3],N=1e3*+(u[4]||0),U=5):(u=M.match(I),null!==u?(h=+u[1],y=+u[2],v=60*+(u[3]||0),U=4):(u=M.match(x),null!==u&&(h=+u[1],y=60*+(u[2]||0),U=3)));var b=u[U],z=+u[U+1],F=+(u[U+2]||0);switch(b){case"+":h-=z,y-=F;break;case"-":h+=z,y+=F;break;case"Z":break;default:y+=new Date(Date.UTC(r,s-1,l,h,y)).getTimezoneOffset()}}else y+=new Date(r,s-1,l).getTimezoneOffset();var B=60===v;for(B&&v--;y>=60;)y-=60,h++;for(;h>=24;)h-=24,l++;for(i=a&&2===s?_:m[s-1];l>i;)l-=i,s++,s>12&&(s-=12,r++),i=a&&2===s?_:m[s-1];for(;y<0;)y+=60,h--;for(;h<0;)h+=24,l--;for(;l<1;)s--,s<1&&(s+=12,r--),i=a&&2===s?_:m[s-1],l+=i;var G=E(r,s,l,h,y,v,N);return n(t)?(d(G[0],G[1],t),f(t)):t=new p(G[0],G[1],c.UTC),B&&p.addSeconds(t,1,t),t},p.now=function(e){return p.fromDate(new Date,e)};var w=new p(0,0,c.TAI);return p.toGregorianDate=function(e,t){var r=!1,i=h(e,w);n(i)||(p.addSeconds(e,-1,w),i=h(w,w),r=!0);var o=i.dayNumber,u=i.secondsOfDay;u>=43200&&(o+=1);var c=o+68569|0,l=4*c/146097|0;c=c-((146097*l+3)/4|0)|0;var f=4e3*(c+1)/1461001|0;c=c-(1461*f/4|0)+31|0;var d=80*c/2447|0,E=c-(2447*d/80|0)|0;c=d/11|0;var y=d+2-12*c|0,m=100*(l-49)+f+c|0,_=u/s.SECONDS_PER_HOUR|0,v=u-_*s.SECONDS_PER_HOUR,T=v/s.SECONDS_PER_MINUTE|0;v-=T*s.SECONDS_PER_MINUTE;var R=0|v,A=(v-R)/s.SECONDS_PER_MILLISECOND;return _+=12,_>23&&(_-=24),r&&(R+=1),n(t)?(t.year=m,t.month=y,t.day=E,t.hour=_,t.minute=T,t.second=R,t.millisecond=A,t.isLeapSecond=r,t):new a(m,y,E,_,T,R,A,r)},p.toDate=function(e){var t=p.toGregorianDate(e,y),r=t.second;return t.isLeapSecond&&(r-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,r,t.millisecond))},p.toIso8601=function(t,r){var i,a=p.toGregorianDate(t,a);return n(r)||0===a.millisecond?n(r)&&0!==r?(i=(.01*a.millisecond).toFixed(r).replace(".","").slice(0,r),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",a.year,a.month,a.day,a.hour,a.minute,a.second,i)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",a.year,a.month,a.day,a.hour,a.minute,a.second):(i=(.01*a.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",a.year,a.month,a.day,a.hour,a.minute,a.second,i))},p.clone=function(e,t){if(n(e))return n(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new p(e.dayNumber,e.secondsOfDay,c.TAI)},p.compare=function(e,t){var r=e.dayNumber-t.dayNumber;return 0!==r?r:e.secondsOfDay-t.secondsOfDay},p.equals=function(e,t){return e===t||n(e)&&n(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},p.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(p.secondsDifference(e,t))<=r},p.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},p.secondsDifference=function(e,t){var r=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return r+(e.secondsOfDay-t.secondsOfDay)},p.daysDifference=function(e,t){var r=e.dayNumber-t.dayNumber,n=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return r+n},p.computeTaiMinusUtc=function(e){v.julianDate=e;var r=p.leapSeconds,n=t(r,v,l);return n<0&&(n=~n,--n,n<0&&(n=0)),r[n].offset},p.addSeconds=function(e,t,r){return d(e.dayNumber,e.secondsOfDay+t,r)},p.addMinutes=function(e,t,r){var n=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return d(e.dayNumber,n,r)},p.addHours=function(e,t,r){var n=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return d(e.dayNumber,n,r)},p.addDays=function(e,t,r){var n=e.dayNumber+t;return d(n,e.secondsOfDay,r)},p.lessThan=function(e,t){return p.compare(e,t)<0},p.lessThanOrEquals=function(e,t){return p.compare(e,t)<=0},p.greaterThan=function(e,t){return p.compare(e,t)>0},p.greaterThanOrEquals=function(e,t){return p.compare(e,t)>=0},p.prototype.clone=function(e){return p.clone(this,e)},p.prototype.equals=function(e){return p.equals(this,e)},p.prototype.equalsEpsilon=function(e,t){return p.equalsEpsilon(this,e,t)},p.prototype.toString=function(){return p.toIso8601(this)},p.leapSeconds=[new u(new p(2441317,43210,c.TAI),10),new u(new p(2441499,43211,c.TAI),11),new u(new p(2441683,43212,c.TAI),12),new u(new p(2442048,43213,c.TAI),13),new u(new p(2442413,43214,c.TAI),14),new u(new p(2442778,43215,c.TAI),15),new u(new p(2443144,43216,c.TAI),16),new u(new p(2443509,43217,c.TAI),17),new u(new p(2443874,43218,c.TAI),18),new u(new p(2444239,43219,c.TAI),19),new u(new p(2444786,43220,c.TAI),20),new u(new p(2445151,43221,c.TAI),21),new u(new p(2445516,43222,c.TAI),22),new u(new p(2446247,43223,c.TAI),23),new u(new p(2447161,43224,c.TAI),24),new u(new p(2447892,43225,c.TAI),25),new u(new p(2448257,43226,c.TAI),26),new u(new p(2448804,43227,c.TAI),27),new u(new p(2449169,43228,c.TAI),28),new u(new p(2449534,43229,c.TAI),29),new u(new p(2450083,43230,c.TAI),30),new u(new p(2450630,43231,c.TAI),31),new u(new p(2451179,43232,c.TAI),32),new u(new p(2453736,43233,c.TAI),33),new u(new p(2454832,43234,c.TAI),34),new u(new p(2456109,43235,c.TAI),35),new u(new p(2457204,43236,c.TAI),36),new u(new p(2457754,43237,c.TAI),37)],p}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(r,n){if(null===r||"object"!=typeof r)return r;n=e(n,!1);var i=new r.constructor;for(var a in r)if(r.hasOwnProperty(a)){var o=r[a];n&&(o=t(o,n)),i[a]=o}return i}return t}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var r=e.split("\r\n"),n=0;n<r.length;++n){var i=r[n],a=i.indexOf(": ");if(a>0){var o=i.substring(0,a),u=i.substring(a+2);t[o]=u}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function r(e,r,n){this.statusCode=e,this.response=r,this.responseHeaders=n,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return r.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},r}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var r=n.exec(t);this.scheme=r[1],this.authority=r[2],this.path=r[3],this.query=r[4],this.fragment=r[5]}}function t(e){var t=unescape(e);return a.test(t)?t:e.toUpperCase()}function r(e,t,r,n){return(t||"")+r.toLowerCase()+(n||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var n=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(o,r).replace(i,t)),this.path&&(this.path=this.path.replace(i,t)),this.query&&(this.query=this.query.replace(i,t)),this.fragment&&(this.fragment=this.fragment.replace(i,t))};var i=/%[0-9a-z]{2}/gi,a=/[a-zA-Z0-9\-\._~]/,o=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var r=new e;return this.scheme?(r.scheme=this.scheme,r.authority=this.authority,r.path=this.path,r.query=this.query):(r.scheme=t.scheme,this.authority?(r.authority=this.authority,r.path=this.path,r.query=this.query):(r.authority=t.authority,""==this.path?(r.path=t.path,r.query=this.query||t.query):("/"==this.path.charAt(0)?(r.path=this.path,r.removeDotSegments()):(t.authority&&""==t.path?r.path="/"+this.path:r.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,r.removeDotSegments()),r.query=this.query))),r.fragment=this.fragment,r},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),r=[],n=""==t[0];n&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?r.pop():"."!=e&&r.push(e);"."!=e&&".."!=e||r.push(""),n&&r.unshift(""),this.path=r.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(r){var n=new e(r);n.normalize();var i=n.getAuthority();if(t(i)){if(i.indexOf("@")!==-1){var a=i.split("@");i=a[1]}if(i.indexOf(":")===-1){var o=n.getScheme();if(t(o)||(o=window.location.protocol,o=o.substring(0,o.length-1)),"http"===o)i+=":80";else{if("https"!==o)return;i+=":443"}}return i}}var i={},a={};return i.add=function(e,r){var n=e.toLowerCase()+":"+r;t(a[n])||(a[n]=!0)},i.remove=function(e,r){var n=e.toLowerCase()+":"+r;t(a[n])&&delete a[n]},i.contains=function(e){var r=n(e);return!(!t(r)||!t(a[r]))},i.clear=function(){a={}},i}),define("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,r,n,i,a,o){"use strict";function u(r){r=t(r,t.EMPTY_OBJECT);var n=r.responseType,i=t(r.method,"GET"),a=r.data,o=r.headers,s=r.overrideMimeType;return e(r.url,function(t){var r=e.defer();return u.load(t,n,i,a,o,r,s),r.promise})}function s(e,t){var r=decodeURIComponent(t);return e?atob(r):r}function c(e,t){for(var r=s(e,t),n=new ArrayBuffer(r.length),i=new Uint8Array(n),a=0;a<r.length;a++)i[a]=r.charCodeAt(a);return n}function l(e,r){r=t(r,"");var n=e[1],i=!!e[2],a=e[3];switch(r){case"":case"text":return s(i,a);case"arraybuffer":return c(i,a);case"blob":var o=c(i,a);return new Blob([o],{type:n});case"document":var u=new DOMParser;return u.parseFromString(s(i,a),n);case"json":return JSON.parse(s(i,a))}}var f=/^data:(.*?)(;base64)?,(.*)$/;return u.load=function(e,t,n,u,s,c,h){var d=f.exec(e);if(null!==d)return void c.resolve(l(d,t));var E=new XMLHttpRequest;if(o.contains(e)&&(E.withCredentials=!0),r(h)&&r(E.overrideMimeType)&&E.overrideMimeType(h),E.open(n,e,!0),r(s))for(var p in s)s.hasOwnProperty(p)&&E.setRequestHeader(p,s[p]);r(t)&&(E.responseType=t),E.onload=function(){if(E.status<200||E.status>=300)return void c.reject(new i(E.status,E.response,E.getAllResponseHeaders()));var e=E.response,n=E.responseType;if(!r(e)||r(t)&&n!==t)if("json"===t&&"string"==typeof e)try{c.resolve(JSON.parse(e))}catch(e){c.reject(e)}else(""===n||"document"===n)&&r(E.responseXML)&&E.responseXML.hasChildNodes()?c.resolve(E.responseXML):""!==n&&"text"!==n||!r(E.responseText)?c.reject(new a("Invalid XMLHttpRequest response type.")):c.resolve(E.responseText);else c.resolve(e)},E.onerror=function(e){c.reject(new i)},E.send(u)},u.defaultLoad=u.load,u}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,r){return e({url:t,headers:r})}return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,r,n){"use strict";function i(r,i){return t(i)?t(i.Accept)||(i=e(i),i.Accept=a.Accept):i=a,n(r,i).then(function(e){return JSON.parse(e)})}var a={Accept:"application/json,*/*;q=0.01"};return i}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,r,n,i,a,o,u,s,c,l,f){"use strict";function h(t){if(t=r(t,r.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=r(t.addNewLeapSeconds,!0),n(t.data))E(this,t.data);else if(n(t.url)){var i=this;this._downloadPromise=e(s(t.url),function(e){E(i,e)},function(){i._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else E(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function d(e,t){return o.compare(e.julianDate,t)}function E(e,r){if(!n(r.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!n(r.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var i=r.columnNames.indexOf("modifiedJulianDateUtc"),a=r.columnNames.indexOf("xPoleWanderRadians"),s=r.columnNames.indexOf("yPoleWanderRadians"),c=r.columnNames.indexOf("ut1MinusUtcSeconds"),h=r.columnNames.indexOf("xCelestialPoleOffsetRadians"),E=r.columnNames.indexOf("yCelestialPoleOffsetRadians"),p=r.columnNames.indexOf("taiMinusUtcSeconds");if(i<0||a<0||s<0||c<0||h<0||E<0||p<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var y=e._samples=r.samples,m=e._dates=[];e._dateColumn=i,e._xPoleWanderRadiansColumn=a,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=h,e._yCelestialPoleOffsetRadiansColumn=E,e._taiMinusUtcSecondsColumn=p,e._columnCount=r.columnNames.length,e._lastIndex=void 0;for(var _,v=e._addNewLeapSeconds,T=0,R=y.length;T<R;T+=e._columnCount){var A=y[T+i],S=y[T+p],g=A+l.MODIFIED_JULIAN_DATE_DIFFERENCE,N=new o(g,S,f.TAI);if(m.push(N),v){if(S!==_&&n(_)){var x=o.leapSeconds,I=t(x,N,d);if(I<0){var O=new u(N,S);x.splice(~I,0,O)}}_=S}}}function p(e,t,r,n,i){var a=r*n;i.xPoleWander=t[a+e._xPoleWanderRadiansColumn],i.yPoleWander=t[a+e._yPoleWanderRadiansColumn],i.xPoleOffset=t[a+e._xCelestialPoleOffsetRadiansColumn],i.yPoleOffset=t[a+e._yCelestialPoleOffsetRadiansColumn],i.ut1MinusUtc=t[a+e._ut1MinusUtcSecondsColumn]}function y(e,t,r){return t+e*(r-t)}function m(e,t,r,n,i,a,u){var s=e._columnCount;if(a>t.length-1)return u.xPoleWander=0,u.yPoleWander=0,u.xPoleOffset=0,u.yPoleOffset=0,u.ut1MinusUtc=0,u;var c=t[i],l=t[a];if(c.equals(l)||n.equals(c))return p(e,r,i,s,u),u;if(n.equals(l))return p(e,r,a,s,u),u;var f=o.secondsDifference(n,c)/o.secondsDifference(l,c),h=i*s,d=a*s,E=r[h+e._ut1MinusUtcSecondsColumn],m=r[d+e._ut1MinusUtcSecondsColumn],_=m-E;if(_>.5||_<-.5){var v=r[h+e._taiMinusUtcSecondsColumn],T=r[d+e._taiMinusUtcSecondsColumn];v!==T&&(l.equals(n)?E=m:m-=T-v)}return u.xPoleWander=y(f,r[h+e._xPoleWanderRadiansColumn],r[d+e._xPoleWanderRadiansColumn]),u.yPoleWander=y(f,r[h+e._yPoleWanderRadiansColumn],r[d+e._yPoleWanderRadiansColumn]),u.xPoleOffset=y(f,r[h+e._xCelestialPoleOffsetRadiansColumn],r[d+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=y(f,r[h+e._yCelestialPoleOffsetRadiansColumn],r[d+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=y(f,E,m),u}return h.NONE=a({getPromiseToLoad:function(){return e()},compute:function(e,t){return n(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new i(0,0,0,0,0),t}}),h.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},h.prototype.compute=function(e,r){if(n(this._samples)){if(n(r)||(r=new i(0,0,0,0,0)),0===this._samples.length)return r.xPoleWander=0,r.yPoleWander=0,r.xPoleOffset=0,r.yPoleOffset=0,r.ut1MinusUtc=0,r;var a=this._dates,u=this._lastIndex,s=0,l=0;if(n(u)){var f=a[u],h=a[u+1],d=o.lessThanOrEquals(f,e),E=!n(h),p=E||o.greaterThanOrEquals(h,e);if(d&&p)return s=u,!E&&h.equals(e)&&++s,l=s+1,m(this,a,this._samples,e,s,l,r),r}var y=t(a,e,o.compare,this._dateColumn);return y>=0?(y<a.length-1&&a[y+1].equals(e)&&++y,s=y,l=y):(l=~y,s=l-1,s<0&&(s=0)),this._lastIndex=s,m(this,a,this._samples,e,s,l,r),r}if(n(this._dataError))throw new c(this._dataError)},h}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,r,n){"use strict";function i(t,r,n){this.heading=e(t,0),this.pitch=e(r,0),this.roll=e(n,0)}return i.fromQuaternion=function(e,r){t(r)||(r=new i);var n=2*(e.w*e.y-e.z*e.x),a=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return r.heading=-Math.atan2(s,u),r.roll=Math.atan2(o,a),r.pitch=-Math.asin(n),r},i.fromDegrees=function(e,r,a,o){return t(o)||(o=new i),o.heading=e*n.RADIANS_PER_DEGREE,o.pitch=r*n.RADIANS_PER_DEGREE,o.roll=a*n.RADIANS_PER_DEGREE,o},i.clone=function(e,r){if(t(e))return t(r)?(r.heading=e.heading,r.pitch=e.pitch,r.roll=e.roll,r):new i(e.heading,e.pitch,e.roll)},i.equals=function(e,r){return e===r||t(e)&&t(r)&&e.heading===r.heading&&e.pitch===r.pitch&&e.roll===r.roll},i.equalsEpsilon=function(e,r,i,a){return e===r||t(e)&&t(r)&&n.equalsEpsilon(e.heading,r.heading,i,a)&&n.equalsEpsilon(e.pitch,r.pitch,i,a)&&n.equalsEpsilon(e.roll,r.roll,i,a)},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i.prototype.equalsEpsilon=function(e,t,r){return i.equalsEpsilon(this,e,t,r)},i.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},i}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function i(r,n){n=t(n,document.location.href);var i=new e(n),a=new e(r);return a.resolve(i).toString()}return i}),define("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function i(n,i,a){a=t(a,!0),n instanceof e||(n=new e(n)),i instanceof e||(i=new e(i)),r(i.authority)&&!r(i.scheme)&&("undefined"!=typeof document&&r(document.location)&&r(document.location.href)?i.scheme=new e(document.location.href).scheme:i.scheme=n.scheme);var o=n;i.isAbsolute()&&(o=i);var u="";r(o.scheme)&&(u+=o.scheme+":"),r(o.authority)&&(u+="//"+o.authority,""!==o.path&&"/"!==o.path&&(u=u.replace(/\/?$/,"/"),o.path=o.path.replace(/^\/?/g,""))),u+=o===n?a?n.path.replace(/\/?$/,"/")+i.path.replace(/^\/?/g,""):n.path+i.path:i.path;var s=r(n.query),c=r(i.query);s&&c?u+="?"+n.query+"&"+i.query:s&&!c?u+="?"+n.query:!s&&c&&(u+="?"+i.query);var l=r(i.fragment);return r(n.fragment)&&!l?u+="#"+n.fragment:l&&(u+="#"+i.fragment),u}return i}),define("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","./joinUrls","require"],function(e,t,r,n,i,a){"use strict";function o(){for(var e=document.getElementsByTagName("script"),t=0,r=e.length;t<r;++t){var n=e[t].getAttribute("src"),i=E.exec(n);if(null!==i)return i[1]}}function u(){if(t(f))return f;var r;return r="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:o(),f=new e(n(r))}function s(e){return a.toUrl("../"+e)}function c(e){return i(u(),e)}function l(e){t(h)||(h=t(a.toUrl)?s:c),t(d)||(d=document.createElement("a"));var r=h(e);return d.href=r,d.href=d.href,d.href}var f,h,d,E=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return l._cesiumScriptRegex=E,l.setBaseUrl=function(t){f=new e(t).resolve(new e(document.location.href))},l}),define("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,r){this.x=e,this.y=t,this.s=r}return e}),define("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,r,n,i,a,o,u){"use strict";function s(e){e=r(e,r.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=r(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=r(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new a(this._sampleZeroJulianEphemerisDate,0,u.TAI),this._stepSizeDays=r(e.stepSizeDays,1),this._samplesPerXysFile=r(e.samplesPerXysFile,1e3),this._totalSamples=r(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,n=this._denominators=new Array(t+1),i=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t),s=0;s<=t;++s){n[s]=o,i[s]=s*this._stepSizeDays;for(var c=0;c<=t;++c)c!==s&&(n[s]*=s-c);n[s]=1/n[s]}this._work=new Array(t+1),this._coef=new Array(t+1)}function c(e,t,r){var n=f;return n.dayNumber=t,n.secondsOfDay=r,a.daysDifference(n,e._sampleZeroDateTT); -}function l(r,i){if(r._chunkDownloadsInProgress[i])return r._chunkDownloadsInProgress[i];var a=e.defer();r._chunkDownloadsInProgress[i]=a;var u,s=r._xysFileUrlTemplate;return u=n(s)?s.replace("{0}",i):t("Assets/IAU2006_XYS/IAU2006_XYS_"+i+".json"),e(o(u),function(e){r._chunkDownloadsInProgress[i]=!1;for(var t=r._samples,n=e.samples,o=i*r._samplesPerXysFile*3,u=0,s=n.length;u<s;++u)t[o+u]=n[u];a.resolve()}),a.promise}var f=new a(0,0,u.TAI);return s.prototype.preload=function(t,r,n,i){var a=c(this,t,r),o=c(this,n,i),u=a/this._stepSizeDays-this._interpolationOrder/2|0;u<0&&(u=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var f=u/this._samplesPerXysFile|0,h=s/this._samplesPerXysFile|0,d=[],E=f;E<=h;++E)d.push(l(this,E));return e.all(d)},s.prototype.computeXysRadians=function(e,t,r){var a=c(this,e,t);if(!(a<0)){var o=a/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);s<0&&(s=0);var f=s+u;f>=this._totalSamples&&(f=this._totalSamples-1,s=f-u,s<0&&(s=0));var h=!1,d=this._samples;if(n(d[3*s])||(l(this,s/this._samplesPerXysFile|0),h=!0),n(d[3*f])||(l(this,f/this._samplesPerXysFile|0),h=!0),!h){n(r)?(r.x=0,r.y=0,r.s=0):r=new i(0,0,0);var E,p,y=a-s*this._stepSizeDays,m=this._work,_=this._denominators,v=this._coef,T=this._xTable;for(E=0;E<=u;++E)m[E]=y-T[E];for(E=0;E<=u;++E){for(v[E]=1,p=0;p<=u;++p)p!==E&&(v[E]*=m[p]);v[E]*=_[E];var R=3*(s+E);r.x+=v[E]*d[R++],r.y+=v[E]*d[R++],r.s+=v[E]*d[R]}return r}}}},s}),define("Core/Quaternion",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math","./Matrix3"],function(e,t,r,n,i,a,o,u){"use strict";function s(e,r,n,i){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0),this.w=t(i,0)}var c=new e;s.fromAxisAngle=function(t,n,i){var a=n/2,o=Math.sin(a);c=e.normalize(t,c);var u=c.x*o,l=c.y*o,f=c.z*o,h=Math.cos(a);return r(i)?(i.x=u,i.y=l,i.z=f,i.w=h,i):new s(u,l,f,h)};var l=[1,2,0],f=new Array(3);s.fromRotationMatrix=function(e,t){var n,i,a,o,c,h=e[u.COLUMN0ROW0],d=e[u.COLUMN1ROW1],E=e[u.COLUMN2ROW2],p=h+d+E;if(p>0)n=Math.sqrt(p+1),c=.5*n,n=.5/n,i=(e[u.COLUMN1ROW2]-e[u.COLUMN2ROW1])*n,a=(e[u.COLUMN2ROW0]-e[u.COLUMN0ROW2])*n,o=(e[u.COLUMN0ROW1]-e[u.COLUMN1ROW0])*n;else{var y=l,m=0;d>h&&(m=1),E>h&&E>d&&(m=2);var _=y[m],v=y[_];n=Math.sqrt(e[u.getElementIndex(m,m)]-e[u.getElementIndex(_,_)]-e[u.getElementIndex(v,v)]+1);var T=f;T[m]=.5*n,n=.5/n,c=(e[u.getElementIndex(v,_)]-e[u.getElementIndex(_,v)])*n,T[_]=(e[u.getElementIndex(_,m)]+e[u.getElementIndex(m,_)])*n,T[v]=(e[u.getElementIndex(v,m)]+e[u.getElementIndex(m,v)])*n,i=-T[0],a=-T[1],o=-T[2]}return r(t)?(t.x=i,t.y=a,t.z=o,t.w=c,t):new s(i,a,o,c)};var h=new s;s.fromHeadingPitchRoll=function(t,r,n,i){var a=s.fromAxisAngle(e.UNIT_X,n,h),o=s.fromAxisAngle(e.UNIT_Y,-r,i);i=s.multiply(o,a,o);var u=s.fromAxisAngle(e.UNIT_Z,-t,h);return s.multiply(u,i,i)};var d=new e,E=new e,p=new s,y=new s,m=new s;s.packedLength=4,s.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n++]=e.z,r[n]=e.w,r},s.unpack=function(e,n,i){return n=t(n,0),r(i)||(i=new s),i.x=e[n],i.y=e[n+1],i.z=e[n+2],i.w=e[n+3],i},s.packedInterpolationLength=3,s.convertPackedArrayForInterpolation=function(e,t,r,n){s.unpack(e,4*r,m),s.conjugate(m,m);for(var i=0,a=r-t+1;i<a;i++){var o=3*i;s.unpack(e,4*(t+i),p),s.multiply(p,m,p),p.w<0&&s.negate(p,p),s.computeAxis(p,d);var u=s.computeAngle(p);n[o]=d.x*u,n[o+1]=d.y*u,n[o+2]=d.z*u}},s.unpackInterpolationResult=function(t,n,i,a,o){r(o)||(o=new s),e.fromArray(t,0,E);var u=e.magnitude(E);return s.unpack(n,4*a,y),0===u?s.clone(s.IDENTITY,p):s.fromAxisAngle(E,u,p),s.multiply(p,y,o)},s.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new s(e.x,e.y,e.z,e.w)},s.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},s.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},s.magnitude=function(e){return Math.sqrt(s.magnitudeSquared(e))},s.normalize=function(e,t){var r=1/s.magnitude(e),n=e.x*r,i=e.y*r,a=e.z*r,o=e.w*r;return t.x=n,t.y=i,t.z=a,t.w=o,t},s.inverse=function(e,t){var r=s.magnitudeSquared(e);return t=s.conjugate(e,t),s.multiplyByScalar(t,1/r,t)},s.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},s.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},s.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},s.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},s.multiply=function(e,t,r){var n=e.x,i=e.y,a=e.z,o=e.w,u=t.x,s=t.y,c=t.z,l=t.w,f=o*u+n*l+i*c-a*s,h=o*s-n*c+i*l+a*u,d=o*c+n*s-i*u+a*l,E=o*l-n*u-i*s-a*c;return r.x=f,r.y=h,r.z=d,r.w=E,r},s.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},s.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},s.computeAxis=function(e,t){var r=e.w;if(Math.abs(r-1)<o.EPSILON6)return t.x=t.y=t.z=0,t;var n=1/Math.sqrt(1-r*r);return t.x=e.x*n,t.y=e.y*n,t.z=e.z*n,t},s.computeAngle=function(e){return Math.abs(e.w-1)<o.EPSILON6?0:2*Math.acos(e.w)};var _=new s;s.lerp=function(e,t,r,n){return _=s.multiplyByScalar(t,r,_),n=s.multiplyByScalar(e,1-r,n),s.add(_,n,n)};var v=new s,T=new s,R=new s;s.slerp=function(e,t,r,n){var i=s.dot(e,t),a=t;if(i<0&&(i=-i,a=v=s.negate(t,v)),1-i<o.EPSILON6)return s.lerp(e,a,r,n);var u=Math.acos(i);return T=s.multiplyByScalar(e,Math.sin((1-r)*u),T),R=s.multiplyByScalar(a,Math.sin(r*u),R),n=s.add(T,R,n),s.multiplyByScalar(n,1/Math.sin(u),n)},s.log=function(t,r){var n=o.acosClamped(t.w),i=0;return 0!==n&&(i=n/Math.sin(n)),e.multiplyByScalar(t,i,r)},s.exp=function(t,r){var n=e.magnitude(t),i=0;return 0!==n&&(i=Math.sin(n)/n),r.x=t.x*i,r.y=t.y*i,r.z=t.z*i,r.w=Math.cos(n),r};var A=new e,S=new e,g=new s,N=new s;s.computeInnerQuadrangle=function(t,r,n,i){var a=s.conjugate(r,g);s.multiply(a,n,N);var o=s.log(N,A);s.multiply(a,t,N);var u=s.log(N,S);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),s.exp(o,g),s.multiply(r,g,i)},s.squad=function(e,t,r,n,i,a){var o=s.slerp(e,t,i,g),u=s.slerp(r,n,i,N);return s.slerp(o,u,2*i*(1-i),a)};for(var x=new s,I=1.9011074535173003,O=i.supportsTypedArrays()?new Float32Array(8):[],w=i.supportsTypedArrays()?new Float32Array(8):[],M=i.supportsTypedArrays()?new Float32Array(8):[],C=i.supportsTypedArrays()?new Float32Array(8):[],P=0;P<7;++P){var D=P+1,L=2*D+1;O[P]=1/(D*L),w[P]=D/L}return O[7]=I/136,w[7]=8*I/17,s.fastSlerp=function(e,t,r,n){var i,a=s.dot(e,t);a>=0?i=1:(i=-1,a=-a);for(var o=a-1,u=1-r,c=r*r,l=u*u,f=7;f>=0;--f)M[f]=(O[f]*c-w[f])*o,C[f]=(O[f]*l-w[f])*o;var h=i*r*(1+M[0]*(1+M[1]*(1+M[2]*(1+M[3]*(1+M[4]*(1+M[5]*(1+M[6]*(1+M[7])))))))),d=u*(1+C[0]*(1+C[1]*(1+C[2]*(1+C[3]*(1+C[4]*(1+C[5]*(1+C[6]*(1+C[7])))))))),E=s.multiplyByScalar(e,d,x);return s.multiplyByScalar(t,h,n),s.add(E,n,n)},s.fastSquad=function(e,t,r,n,i,a){var o=s.fastSlerp(e,t,i,g),u=s.fastSlerp(r,n,i,N);return s.fastSlerp(o,u,2*i*(1-i),a)},s.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},s.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n},s.ZERO=a(new s(0,0,0,0)),s.IDENTITY=a(new s(0,0,0,1)),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.x+", "+this.y+", "+this.z+", "+this.w+")"},s}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./defaultValue","./defined","./deprecationWarning","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./HeadingPitchRoll","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,r,n,i,a,o,u,s,c,l,f,h,d,E,p,y,m,_,v,T){"use strict";var R={},A=new r,S=new r,g=new r;R.eastNorthUpToFixedFrame=function(e,t,n){if(y.equalsEpsilon(e.x,0,y.EPSILON14)&&y.equalsEpsilon(e.y,0,y.EPSILON14)){var i=y.sign(e.z);return o(n)?(n[0]=0,n[1]=1,n[2]=0,n[3]=0,n[4]=-i,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=i,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new _(0,-i,0,e.x,1,0,0,e.y,0,0,i,e.z,0,0,0,1)}var u=A,s=S,c=g;return t=a(t,f.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,r.normalize(s,s),r.cross(u,s,c),o(n)?(n[0]=s.x,n[1]=s.y,n[2]=s.z,n[3]=0,n[4]=c.x,n[5]=c.y,n[6]=c.z,n[7]=0,n[8]=u.x,n[9]=u.y,n[10]=u.z,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new _(s.x,c.x,u.x,e.x,s.y,c.y,u.y,e.y,s.z,c.z,u.z,e.z,0,0,0,1)};var N=new r,x=new r,I=new r;R.northEastDownToFixedFrame=function(e,t,n){if(y.equalsEpsilon(e.x,0,y.EPSILON14)&&y.equalsEpsilon(e.y,0,y.EPSILON14)){var i=y.sign(e.z);return o(n)?(n[0]=-i,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=1,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=-i,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new _(-i,0,0,e.x,0,1,0,e.y,0,0,-i,e.z,0,0,0,1)}var u=N,s=x,c=I;return t=a(t,f.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,r.normalize(s,s),r.cross(u,s,c),o(n)?(n[0]=c.x,n[1]=c.y,n[2]=c.z,n[3]=0,n[4]=s.x,n[5]=s.y,n[6]=s.z,n[7]=0,n[8]=-u.x,n[9]=-u.y,n[10]=-u.z,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new _(c.x,s.x,-u.x,e.x,c.y,s.y,-u.y,e.y,c.z,s.z,-u.z,e.z,0,0,0,1)},R.northUpEastToFixedFrame=function(e,t,n){if(y.equalsEpsilon(e.x,0,y.EPSILON14)&&y.equalsEpsilon(e.y,0,y.EPSILON14)){var i=y.sign(e.z);return o(n)?(n[0]=-i,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=i,n[7]=0,n[8]=0,n[9]=1,n[10]=0,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new _(-i,0,0,e.x,0,0,1,e.y,0,i,0,e.z,0,0,0,1)}var u=A,s=S,c=g;return t=a(t,f.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,r.normalize(s,s),r.cross(u,s,c),o(n)?(n[0]=c.x,n[1]=c.y,n[2]=c.z,n[3]=0,n[4]=u.x,n[5]=u.y,n[6]=u.z,n[7]=0,n[8]=s.x,n[9]=s.y,n[10]=s.z,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new _(c.x,u.x,s.x,e.x,c.y,u.y,s.y,e.y,c.z,u.z,s.z,e.z,0,0,0,1)},R.northWestUpToFixedFrame=function(e,t,n){if(y.equalsEpsilon(e.x,0,y.EPSILON14)&&y.equalsEpsilon(e.y,0,y.EPSILON14)){var i=y.sign(e.z);return o(n)?(n[0]=-i,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=-1,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=i,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new _(-i,0,0,e.x,0,-1,0,e.y,0,0,i,e.z,0,0,0,1)}var u=A,s=S,c=g;return t=a(t,f.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,r.normalize(s,s),r.cross(u,s,c),o(n)?(n[0]=c.x,n[1]=c.y,n[2]=c.z,n[3]=0,n[4]=-s.x,n[5]=-s.y,n[6]=-s.z,n[7]=0,n[8]=u.x,n[9]=u.y,n[10]=u.z,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n):new _(c.x,-s.x,u.x,e.x,c.y,-s.y,u.y,e.y,c.z,-s.z,u.z,e.z,0,0,0,1)};var O=new v,w=new r(1,1,1),M=new _;R.headingPitchRollToFixedFrame=function(e,t,n,i,a,o){var s;"object"==typeof t?(a=n,o=i,s=t.heading,n=t.pitch,i=t.roll):(u("headingPitchRollToFixedFrame","headingPitchRollToFixedFrame with separate heading, pitch, and roll arguments was deprecated in 1.27. It will be removed in 1.30. Use a HeadingPitchRoll object."),s=t);var c=v.fromHeadingPitchRoll(s,n,i,O),l=_.fromTranslationQuaternionRotationScale(r.ZERO,c,w,M);return o=R.eastNorthUpToFixedFrame(e,a,o),_.multiply(o,l,o)};var C=new h,P=new _,D=new m;R.headingPitchRollQuaternion=function(e,t,r,n,i,a){var o;"object"==typeof t?(o=t,i=r,a=n):(u("headingPitchRollQuaternion","headingPitchRollQuaternion with separate heading, pitch, and roll arguments was deprecated in 1.27. It will be removed in 1.30. Use a HeadingPitchRoll object."),C.heading=t,C.pitch=r,C.roll=n,o=C);var s=R.headingPitchRollToFixedFrame(e,o,i,P),c=_.getRotation(s,D);return v.fromRotationMatrix(c,a)};var L=24110.54841,U=8640184.812866,b=.093104,z=-62e-7,F=1.1772758384668e-19,B=72921158553e-15,G=y.TWO_PI/86400,q=new p;R.computeTemeToPseudoFixedMatrix=function(e,t){q=p.addSeconds(e,-p.computeTaiMinusUtc(e),q);var r,n=q.dayNumber,i=q.secondsOfDay,a=n-2451545;r=i>=43200?(a+.5)/T.DAYS_PER_JULIAN_CENTURY:(a-.5)/T.DAYS_PER_JULIAN_CENTURY;var u=L+r*(U+r*(b+r*z)),s=u*G%y.TWO_PI,c=B+F*(n-2451545.5),l=(i+.5*T.SECONDS_PER_DAY)%T.SECONDS_PER_DAY,f=s+c*l,h=Math.cos(f),d=Math.sin(f);return o(t)?(t[0]=h,t[1]=-d,t[2]=0,t[3]=d,t[4]=h,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new m(h,d,0,-d,h,0,0,0,1)},R.iau2006XysData=new d,R.earthOrientationParameters=c.NONE;var W=32.184,H=2451545;R.preloadIcrfFixed=function(t){var r=t.start.dayNumber,n=t.start.secondsOfDay+W,i=t.stop.dayNumber,a=t.stop.secondsOfDay+W,o=R.iau2006XysData.preload(r,n,i,a),u=R.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},R.computeIcrfToFixedMatrix=function(e,t){o(t)||(t=new m);var r=R.computeFixedToIcrfMatrix(e,t);if(o(r))return m.transpose(r,t)};var X=new E(0,0,0),V=new l(0,0,0,0,0,0),Y=new m,k=new m;R.computeFixedToIcrfMatrix=function(e,t){o(t)||(t=new m);var r=R.earthOrientationParameters.compute(e,V);if(o(r)){var n=e.dayNumber,i=e.secondsOfDay+W,a=R.iau2006XysData.computeXysRadians(n,i,X);if(o(a)){var u=a.x+r.xPoleOffset,s=a.y+r.yPoleOffset,c=1/(1+Math.sqrt(1-u*u-s*s)),l=Y;l[0]=1-c*u*u,l[3]=-c*u*s,l[6]=u,l[1]=-c*u*s,l[4]=1-c*s*s,l[7]=s,l[2]=-u,l[5]=-s,l[8]=1-c*(u*u+s*s);var f=m.fromRotationZ(-a.s,k),h=m.multiply(l,f,Y),d=e.dayNumber,E=e.secondsOfDay-p.computeTaiMinusUtc(e)+r.ut1MinusUtc,_=d-2451545,v=E/T.SECONDS_PER_DAY,A=.779057273264+v+.00273781191135448*(_+v);A=A%1*y.TWO_PI;var S=m.fromRotationZ(A,k),g=m.multiply(h,S,Y),N=Math.cos(r.xPoleWander),x=Math.cos(r.yPoleWander),I=Math.sin(r.xPoleWander),O=Math.sin(r.yPoleWander),w=n-H+i/T.SECONDS_PER_DAY;w/=36525;var M=-47e-6*w*y.RADIANS_PER_DEGREE/3600,C=Math.cos(M),P=Math.sin(M),D=k;return D[0]=N*C,D[1]=N*P,D[2]=I,D[3]=-x*P+O*I*C,D[4]=x*C+O*I*P,D[5]=-O*N,D[6]=-O*P-x*I*C,D[7]=O*C-x*I*P,D[8]=x*N,m.multiply(g,D,t)}}};var Z=new n;R.pointToWindowCoordinates=function(e,t,r,n){return n=R.pointToGLWindowCoordinates(e,t,r,n),n.y=2*t[5]-n.y,n},R.pointToGLWindowCoordinates=function(e,r,i,a){o(a)||(a=new t);var u=Z;return _.multiplyByVector(e,n.fromElements(i.x,i.y,i.z,1,u),u),n.multiplyByScalar(u,1/u.w,u),_.multiplyByVector(r,u,u),t.fromCartesian4(u,a)};var j=new r,K=new r,J=new r;R.rotationMatrixFromPositionVelocity=function(e,t,n,i){var u=a(n,f.WGS84).geodeticSurfaceNormal(e,j),s=r.cross(t,u,K);r.equalsEpsilon(s,r.ZERO,y.EPSILON6)&&(s=r.clone(r.UNIT_X,s));var c=r.cross(s,t,J);return r.cross(t,c,s),r.negate(s,s),o(i)||(i=new m),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=s.x,i[4]=s.y,i[5]=s.z,i[6]=c.x,i[7]=c.y,i[8]=c.z,i};var Q=new i,$=new r,ee=new r,te=new n,re=new n,ne=new n,ie=new n,ae=new n,oe=new _,ue=new _;return R.basisTo2D=function(e,t,i){var a=e.ellipsoid,o=_.getColumn(t,3,te),u=a.cartesianToCartographic(o,Q),s=R.eastNorthUpToFixedFrame(o,a,oe),c=_.inverseTransformation(s,ue),l=e.project(u,$),f=re;f.x=l.z,f.y=l.x,f.z=l.y,f.w=1;var h=_.getColumn(t,0,ee),d=r.magnitude(h),E=_.multiplyByVector(c,h,ne);n.fromElements(E.z,E.x,E.y,0,E);var p=_.getColumn(t,1,ee),y=r.magnitude(p),m=_.multiplyByVector(c,p,ie);n.fromElements(m.z,m.x,m.y,0,m);var v=_.getColumn(t,2,ee),T=r.magnitude(v),A=ae;return r.cross(E,m,A),r.normalize(A,A),r.cross(m,A,E),r.normalize(E,E),r.cross(A,E,m),r.normalize(m,m),r.multiplyByScalar(E,d,E),r.multiplyByScalar(m,y,m),r.multiplyByScalar(A,T,A),_.setColumn(i,0,E,i),_.setColumn(i,1,m,i),_.setColumn(i,2,A,i),_.setColumn(i,3,f,i),i},R}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,r,n,i,a,o,u,s,c,l,f,h,d){"use strict";function E(e,t){t=i(t,s.WGS84),e=t.scaleToGeodeticSurface(e);var n=d.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=r.fromCartesian4(l.getColumn(n,0,p)),this._yAxis=r.fromCartesian4(l.getColumn(n,1,p));var a=r.fromCartesian4(l.getColumn(n,2,p));this._plane=f.fromPointNormal(e,a)}var p=new n;o(E.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var y=new e;E.fromPoints=function(t,r){var n=e.fromPoints(t,y);return new E(n.center,r)};var m=new h,_=new r;E.prototype.projectPointOntoPlane=function(e,n){var i=m;i.origin=e,r.normalize(e,i.direction);var o=c.rayPlane(i,this._plane,_);if(a(o)||(r.negate(i.direction,i.direction),o=c.rayPlane(i,this._plane,_)),a(o)){var u=r.subtract(o,this._origin,o),s=r.dot(this._xAxis,u),l=r.dot(this._yAxis,u);return a(n)?(n.x=s,n.y=l,n):new t(s,l)}},E.prototype.projectPointsOntoPlane=function(e,t){a(t)||(t=[]);for(var r=0,n=e.length,i=0;i<n;i++){var o=this.projectPointOntoPlane(e[i],t[r]);a(o)&&(t[r]=o,r++)}return t.length=r,t},E.prototype.projectPointToNearestOnPlane=function(e,n){a(n)||(n=new t);var i=m;i.origin=e,r.clone(this._plane.normal,i.direction);var o=c.rayPlane(i,this._plane,_);a(o)||(r.negate(i.direction,i.direction),o=c.rayPlane(i,this._plane,_));var u=r.subtract(o,this._origin,o),s=r.dot(this._xAxis,u),l=r.dot(this._yAxis,u);return n.x=s,n.y=l,n},E.prototype.projectPointsToNearestOnPlane=function(e,t){a(t)||(t=[]);var r=e.length;t.length=r;for(var n=0;n<r;n++)t[n]=this.projectPointToNearestOnPlane(e[n],t[n]);return t};var v=new r;return E.prototype.projectPointsOntoEllipsoid=function(e,t){var n=e.length;a(t)?t.length=n:t=new Array(n);for(var i=this._ellipsoid,o=this._origin,u=this._xAxis,s=this._yAxis,c=v,l=0;l<n;++l){var f=e[l];r.multiplyByScalar(u,f.x,c),a(t[l])||(t[l]=new r);var h=r.add(o,c,t[l]);r.multiplyByScalar(s,f.y,c),r.add(h,c,h),i.scaleToGeocentricSurface(h,h)}return t},E}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var r={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,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,t,r,n,i){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,i.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,n.NONE),this.boundingSphereCV=t.boundingSphereCV}return a.computeNumberOfVertices=function(e){var r=-1;for(var n in e.attributes)if(e.attributes.hasOwnProperty(n)&&t(e.attributes[n])&&t(e.attributes[n].values)){var i=e.attributes[n],a=i.values.length/i.componentsPerAttribute;r=a}return r},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(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 n}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.binormal=t.binormal,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/GeometryInstance",["./defaultValue","./defined","./DeveloperError","./Matrix4"],function(e,t,r,n){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.geometry=t.geometry,this.modelMatrix=n.clone(e(t.modelMatrix,n.IDENTITY)),this.id=t.id,this.pickPrimitive=t.pickPrimitive,this.attributes=e(t.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}return i}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,r,n,i){"use strict";var a={};a.octEncodeInRange=function(e,t,r){if(r.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),r.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var n=r.x,a=r.y;r.x=(1-Math.abs(a))*i.signNotZero(n),r.y=(1-Math.abs(n))*i.signNotZero(a)}return r.x=i.toSNorm(r.x,t),r.y=i.toSNorm(r.y,t),r},a.octEncode=function(e,t){return a.octEncodeInRange(e,255,t)},a.octDecodeInRange=function(e,r,n,a){if(a.x=i.fromSNorm(e,n),a.y=i.fromSNorm(r,n),a.z=1-(Math.abs(a.x)+Math.abs(a.y)),a.z<0){var o=a.x;a.x=(1-Math.abs(a.y))*i.signNotZero(o),a.y=(1-Math.abs(o))*i.signNotZero(a.y)}return t.normalize(a,a)},a.octDecode=function(e,t,r){return a.octDecodeInRange(e,t,255,r)},a.octPackFloat=function(e){return 256*e.x+e.y};var o=new e;return a.octEncodeFloat=function(e){return a.octEncode(e,o),a.octPackFloat(o)},a.octDecodeFloat=function(e,t){var r=e/256,n=Math.floor(r),i=256*(r-n);return a.octDecode(n,i,t)},a.octPack=function(e,t,r,n){var i=a.octEncodeFloat(e),u=a.octEncodeFloat(t),s=a.octEncode(r,o);return n.x=65536*s.x+i,n.y=65536*s.y+u,n},a.octUnpack=function(e,t,r,n){var i=e.x/65536,o=Math.floor(i),u=65536*(i-o);i=e.y/65536;var s=Math.floor(i),c=65536*(i-s);a.octDecodeFloat(u,t),a.octDecodeFloat(c,r),a.octDecode(o,s,n)},a.compressTextureCoordinates=function(e){var t=4095*e.x|0,r=4095*e.y|0;return 4096*t+r},a.decompressTextureCoordinates=function(e,t){var r=e/4096,n=Math.floor(r);return t.x=n/4095,t.y=(e-4096*n)/4095,t},a}),define("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function i(n,i,s,c,l){r(l)||(l=new t);var f,h,d,E,p,y,m,_;r(i.z)?(f=t.subtract(s,i,a),h=t.subtract(c,i,o),d=t.subtract(n,i,u),E=t.dot(f,f),p=t.dot(f,h),y=t.dot(f,d),m=t.dot(h,h),_=t.dot(h,d)):(f=e.subtract(s,i,a),h=e.subtract(c,i,o),d=e.subtract(n,i,u),E=e.dot(f,f),p=e.dot(f,h),y=e.dot(f,d),m=e.dot(h,h),_=e.dot(h,d));var v=1/(E*m-p*p);return l.y=(m*y-p*_)*v,l.z=(E*_-p*y)*v,l.x=1-l.y-l.z,l}var a=new t,o=new t,u=new t;return i}),define("Core/EncodedCartesian3",["./Cartesian3","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(){this.high=e.clone(e.ZERO),this.low=e.clone(e.ZERO)}n.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 i={high:0,low:0};n.fromCartesian=function(e,r){t(r)||(r=new n);var a=r.high,o=r.low;return n.encode(e.x,i),a.x=i.high,o.x=i.low,n.encode(e.y,i),a.y=i.high,o.y=i.low,n.encode(e.z,i),a.z=i.high,o.z=i.low,r};var a=new n;return n.writeElements=function(e,t,r){n.fromCartesian(e,a);var i=a.high,o=a.low;t[r]=i.x,t[r+1]=i.y,t[r+2]=i.z,t[r+3]=o.x,t[r+4]=o.y,t[r+5]=o.z},n}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,r,n,i){"use strict";var a={UNSIGNED_BYTE:i.UNSIGNED_BYTE,UNSIGNED_SHORT:i.UNSIGNED_SHORT,UNSIGNED_INT:i.UNSIGNED_INT};return a.getSizeInBytes=function(e){switch(e){case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},a.validate=function(t){return e(t)&&(t===a.UNSIGNED_BYTE||t===a.UNSIGNED_SHORT||t===a.UNSIGNED_INT)},a.createTypedArray=function(e,t){return e>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},a.createTypedArrayFromArrayBuffer=function(e,t,r,i){return e>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,r,i):new Uint16Array(t,r,i)},r(a)}),define("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";var n={};return n.calculateACMR=function(r){r=e(r,e.EMPTY_OBJECT);var n=r.indices,i=r.maximumIndex,a=e(r.cacheSize,24),o=n.length;if(!t(i)){i=0;for(var u=0,s=n[u];u<o;)s>i&&(i=s),++u,s=n[u]}for(var c=[],l=0;l<i+1;l++)c[l]=0;for(var f=a+1,h=0;h<o;++h)f-c[n[h]]>a&&(c[n[h]]=f,++f);return(f-a+1)/(o/3)},n.tipsify=function(r){function n(e,t,r,n){for(;t.length>=1;){var i=t[t.length-1];if(t.splice(t.length-1,1),e[i].numLiveTriangles>0)return i}for(;a<n;){if(e[a].numLiveTriangles>0)return++a,a-1;++a}return-1}function i(e,t,r,i,a,o,u){for(var s,c=-1,l=-1,f=0;f<r.length;){var h=r[f];i[h].numLiveTriangles&&(s=0,a-i[h].timeStamp+2*i[h].numLiveTriangles<=t&&(s=a-i[h].timeStamp),(s>l||l===-1)&&(l=s,c=h)),++f}return c===-1?n(i,o,e,u):c}r=e(r,e.EMPTY_OBJECT);var a,o=r.indices,u=r.maximumIndex,s=e(r.cacheSize,24),c=o.length,l=0,f=0,h=o[f],d=c;if(t(u))l=u+1;else{for(;f<d;)h>l&&(l=h),++f,h=o[f];if(l===-1)return 0;++l}for(var E=[],p=0;p<l;p++)E[p]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};f=0;for(var y=0;f<d;)E[o[f]].vertexTriangles.push(y),++E[o[f]].numLiveTriangles,E[o[f+1]].vertexTriangles.push(y),++E[o[f+1]].numLiveTriangles,E[o[f+2]].vertexTriangles.push(y),++E[o[f+2]].numLiveTriangles,++y,f+=3;var m=0,_=s+1;a=1;var v,T,R=[],A=[],S=0,g=[],N=c/3,x=[];for(p=0;p<N;p++)x[p]=!1;for(var I,O;m!==-1;){R=[],T=E[m],O=T.vertexTriangles.length;for(var w=0;w<O;++w)if(y=T.vertexTriangles[w],!x[y]){x[y]=!0,f=y+y+y;for(var M=0;M<3;++M)I=o[f],R.push(I),A.push(I),g[S]=I,++S,v=E[I],--v.numLiveTriangles,_-v.timeStamp>s&&(v.timeStamp=_,++_),++f}m=i(o,s,R,E,_,A,l)}return g},n}),define("Core/GeometryPipeline",["./AttributeCompression","./barycentricCoordinates","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EncodedCartesian3","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryType","./IndexDatatype","./Intersect","./IntersectionTests","./Math","./Matrix3","./Matrix4","./Plane","./PrimitiveType","./Tipsify"],function(e,t,r,n,i,a,o,u,s,c,l,f,h,d,E,p,y,m,_,v,T,R,A,S,g){"use strict";function N(e,t,r,n,i){e[t++]=r,e[t++]=n,e[t++]=n,e[t++]=i,e[t++]=i,e[t]=r}function x(e){for(var t=e.length,r=t/3*6,n=y.createTypedArray(t,r),i=0,a=0;a<t;a+=3,i+=6)N(n,i,e[a],e[a+1],e[a+2]);return n}function I(e){var t=e.length;if(t>=3){var r=6*(t-2),n=y.createTypedArray(t,r);N(n,0,e[0],e[1],e[2]);for(var i=6,a=3;a<t;++a,i+=6)N(n,i,e[a-1],e[a],e[a-2]);return n}return new Uint16Array}function O(e){if(e.length>0){for(var t=e.length-1,r=6*(t-1),n=y.createTypedArray(t,r),i=e[0],a=0,o=1;o<t;++o,a+=6)N(n,a,i,e[o],e[o+1]);return n}return new Uint16Array}function w(e){var t={};for(var r in e)if(e.hasOwnProperty(r)&&c(e[r])&&c(e[r].values)){var n=e[r];t[r]=new E({componentDatatype:n.componentDatatype,componentsPerAttribute:n.componentsPerAttribute,normalize:n.normalize,values:[]})}return t}function M(e,t,r){for(var n in t)if(t.hasOwnProperty(n)&&c(t[n])&&c(t[n].values))for(var i=t[n],a=0;a<i.componentsPerAttribute;++a)e[n].values.push(i.values[r*i.componentsPerAttribute+a])}function C(e,t){if(c(t))for(var r=t.values,n=r.length,a=0;a<n;a+=3)i.unpack(r,a,ae),R.multiplyByPoint(e,ae,ae),i.pack(ae,r,a)}function P(e,t){if(c(t))for(var r=t.values,n=r.length,a=0;a<n;a+=3)i.unpack(r,a,ae),T.multiplyByVector(e,ae,ae),ae=i.normalize(ae,ae),i.pack(ae,r,a)}function D(e,t){var r,n=e.length,i={},a=e[0][t].attributes;for(r in a)if(a.hasOwnProperty(r)&&c(a[r])&&c(a[r].values)){for(var o=a[r],s=o.values.length,l=!0,f=1;f<n;++f){var h=e[f][t].attributes[r];if(!c(h)||o.componentDatatype!==h.componentDatatype||o.componentsPerAttribute!==h.componentsPerAttribute||o.normalize!==h.normalize){l=!1;break}s+=h.values.length}l&&(i[r]=new E({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:u.createTypedArray(o.componentDatatype,s)}))}return i}function L(e,t){var n,a,o,u,s,l,f,h=e.length,E=(e[0].modelMatrix,c(e[0][t].indices)),p=e[0][t].primitiveType,m=D(e,t);for(n in m)if(m.hasOwnProperty(n))for(s=m[n].values,u=0,a=0;a<h;++a)for(l=e[a][t].attributes[n].values,f=l.length,o=0;o<f;++o)s[u++]=l[o];var _;if(E){var v=0;for(a=0;a<h;++a)v+=e[a][t].indices.length;var T=d.computeNumberOfVertices(new d({attributes:m,primitiveType:S.POINTS})),R=y.createTypedArray(T,v),A=0,g=0;for(a=0;a<h;++a){var N=e[a][t].indices,x=N.length;for(u=0;u<x;++u)R[A++]=g+N[u];g+=d.computeNumberOfVertices(e[a][t])}_=R}var I,O=new i,w=0;for(a=0;a<h;++a){if(I=e[a][t].boundingSphere,!c(I)){O=void 0;break}i.add(I.center,O,O)}if(c(O))for(i.divideByScalar(O,h,O),a=0;a<h;++a){I=e[a][t].boundingSphere;var M=i.magnitude(i.subtract(I.center,O,se))+I.radius;M>w&&(w=M)}return new d({attributes:m,indices:_,primitiveType:p,boundingSphere:c(O)?new r(O,w):void 0})}function U(e){if(c(e.indices))return e;for(var t=d.computeNumberOfVertices(e),r=y.createTypedArray(t,t),n=0;n<t;++n)r[n]=n;return e.indices=r,e}function b(e){var t=d.computeNumberOfVertices(e),r=y.createTypedArray(t,3*(t-2));r[0]=1,r[1]=0,r[2]=2;for(var n=3,i=3;i<t;++i)r[n++]=i-1,r[n++]=0,r[n++]=i;return e.indices=r,e.primitiveType=S.TRIANGLES,e}function z(e){var t=d.computeNumberOfVertices(e),r=y.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,i=3;i<t-1;i+=2)r[n++]=i,r[n++]=i-1,r[n++]=i+1,i+2<t&&(r[n++]=i,r[n++]=i+1,r[n++]=i+2);return e.indices=r,e.primitiveType=S.TRIANGLES,e}function F(e){if(c(e.indices))return e;for(var t=d.computeNumberOfVertices(e),r=y.createTypedArray(t,t),n=0;n<t;++n)r[n]=n;return e.indices=r,e}function B(e){var t=d.computeNumberOfVertices(e),r=y.createTypedArray(t,2*(t-1));r[0]=0,r[1]=1;for(var n=2,i=2;i<t;++i)r[n++]=i-1,r[n++]=i;return e.indices=r,e.primitiveType=S.LINES,e}function G(e){var t=d.computeNumberOfVertices(e),r=y.createTypedArray(t,2*t);r[0]=0,r[1]=1;for(var n=2,i=2;i<t;++i)r[n++]=i-1,r[n++]=i;return r[n++]=t-1,r[n]=0,e.indices=r,e.primitiveType=S.LINES,e}function q(e){switch(e.primitiveType){case S.TRIANGLE_FAN:return b(e);case S.TRIANGLE_STRIP:return z(e);case S.TRIANGLES:return U(e);case S.LINE_STRIP:return B(e);case S.LINE_LOOP:return G(e);case S.LINES:return F(e)}return e}function W(e,t){Math.abs(e.y)<v.EPSILON6&&(t?e.y=-v.EPSILON6:e.y=v.EPSILON6)}function H(e,t,r){if(0!==e.y&&0!==t.y&&0!==r.y)return W(e,e.y<0),W(t,t.y<0),void W(r,r.y<0);var n,i=Math.abs(e.y),a=Math.abs(t.y),o=Math.abs(r.y);n=i>a?i>o?v.sign(e.y):v.sign(r.y):a>o?v.sign(t.y):v.sign(r.y);var u=n<0;W(e,u),W(t,u),W(r,u)}function X(e,t,r,n){i.add(e,i.multiplyByScalar(i.subtract(t,e,Te),e.y/(e.y-t.y),Te),r),i.clone(r,n),W(r,!0),W(n,!1)}function V(e,t,r){if(!(e.x>=0||t.x>=0||r.x>=0)){H(e,t,r);var n=e.y<0,i=t.y<0,a=r.y<0,o=0;o+=n?1:0,o+=i?1:0,o+=a?1:0;var u=Ne.indices;1===o?(u[1]=3,u[2]=4,u[5]=6,u[7]=6,u[8]=5,n?(X(e,t,Re,Se),X(e,r,Ae,ge),u[0]=0,u[3]=1,u[4]=2,u[6]=1):i?(X(t,r,Re,Se),X(t,e,Ae,ge),u[0]=1,u[3]=2,u[4]=0,u[6]=2):a&&(X(r,e,Re,Se),X(r,t,Ae,ge),u[0]=2,u[3]=0,u[4]=1,u[6]=0)):2===o&&(u[2]=4,u[4]=4,u[5]=3,u[7]=5,u[8]=6,n?i?a||(X(r,e,Re,Se),X(r,t,Ae,ge),u[0]=0,u[1]=1,u[3]=0,u[6]=2):(X(t,r,Re,Se),X(t,e,Ae,ge),u[0]=2,u[1]=0,u[3]=2,u[6]=1):(X(e,t,Re,Se),X(e,r,Ae,ge),u[0]=1,u[1]=2,u[3]=1,u[6]=0));var s=Ne.positions;return s[0]=e,s[1]=t,s[2]=r,s.length=3,1!==o&&2!==o||(s[3]=Re,s[4]=Ae,s[5]=Se,s[6]=ge,s.length=7),Ne}}function Y(e,t){var n=e.attributes;if(0!==n.position.values.length){for(var i in n)if(n.hasOwnProperty(i)&&c(n[i])&&c(n[i].values)){var a=n[i];a.values=u.createTypedArray(a.componentDatatype,a.values)}var o=d.computeNumberOfVertices(e);return e.indices=y.createTypedArray(o,e.indices),t&&(e.boundingSphere=r.fromVertices(n.position.values)),e}}function k(e){var t=e.attributes,r={};for(var n in t)if(t.hasOwnProperty(n)&&c(t[n])&&c(t[n].values)){var i=t[n];r[n]=new E({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return new d({attributes:r,indices:[],primitiveType:e.primitiveType})}function Z(e,t,r){var n=c(e.geometry.boundingSphere);t=Y(t,n),r=Y(r,n),c(r)&&!c(t)?e.geometry=r:!c(r)&&c(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=r,e.geometry=void 0)}function j(e,r,a,o,u,s,l,f,h,d,E){if(c(s)||c(l)||c(f)||c(h)){var p=i.fromArray(u,3*e,xe),y=i.fromArray(u,3*r,Ie),m=i.fromArray(u,3*a,Oe),_=t(o,p,y,m,we);if(c(s)){var v=i.fromArray(s,3*e,xe),T=i.fromArray(s,3*r,Ie),R=i.fromArray(s,3*a,Oe); -i.multiplyByScalar(v,_.x,v),i.multiplyByScalar(T,_.y,T),i.multiplyByScalar(R,_.z,R);var A=i.add(v,T,v);i.add(A,R,A),i.normalize(A,A),i.pack(A,d.normal.values,3*E)}if(c(l)){var S=i.fromArray(l,3*e,xe),g=i.fromArray(l,3*r,Ie),N=i.fromArray(l,3*a,Oe);i.multiplyByScalar(S,_.x,S),i.multiplyByScalar(g,_.y,g),i.multiplyByScalar(N,_.z,N);var x=i.add(S,g,S);i.add(x,N,x),i.normalize(x,x),i.pack(x,d.binormal.values,3*E)}if(c(f)){var I=i.fromArray(f,3*e,xe),O=i.fromArray(f,3*r,Ie),w=i.fromArray(f,3*a,Oe);i.multiplyByScalar(I,_.x,I),i.multiplyByScalar(O,_.y,O),i.multiplyByScalar(w,_.z,w);var M=i.add(I,O,I);i.add(M,w,M),i.normalize(M,M),i.pack(M,d.tangent.values,3*E)}if(c(h)){var C=n.fromArray(h,2*e,Me),P=n.fromArray(h,2*r,Ce),D=n.fromArray(h,2*a,Pe);n.multiplyByScalar(C,_.x,C),n.multiplyByScalar(P,_.y,P),n.multiplyByScalar(D,_.z,D);var L=n.add(C,P,C);n.add(L,D,L),n.pack(L,d.st.values,2*E)}}}function K(e,t,r,n,i,a){var o=e.position.values.length/3;if(i!==-1){var u=n[i],s=r[u];return s===-1?(r[u]=o,e.position.values.push(a.x,a.y,a.z),t.push(o),o):(t.push(s),s)}return e.position.values.push(a.x,a.y,a.z),t.push(o),o}function J(e){var t,r,n,a,o,u=e.geometry,s=u.attributes,l=s.position.values,f=c(s.normal)?s.normal.values:void 0,h=c(s.binormal)?s.binormal.values:void 0,d=c(s.tangent)?s.tangent.values:void 0,E=c(s.st)?s.st.values:void 0,p=u.indices,y=k(u),m=k(u),_=[];_.length=l.length/3;var v=[];for(v.length=l.length/3,o=0;o<_.length;++o)_[o]=-1,v[o]=-1;var T=p.length;for(o=0;o<T;o+=3){var R=p[o],A=p[o+1],S=p[o+2],g=i.fromArray(l,3*R),N=i.fromArray(l,3*A),x=i.fromArray(l,3*S),I=V(g,N,x);if(c(I)&&I.positions.length>3)for(var O=I.positions,w=I.indices,M=w.length,C=0;C<M;++C){var P=w[C],D=O[P];D.y<0?(t=m.attributes,r=m.indices,n=_):(t=y.attributes,r=y.indices,n=v),a=K(t,r,n,p,P<3?o+P:-1,D),j(R,A,S,D,l,f,h,d,E,t,a)}else c(I)&&(g=I.positions[0],N=I.positions[1],x=I.positions[2]),g.y<0?(t=m.attributes,r=m.indices,n=_):(t=y.attributes,r=y.indices,n=v),a=K(t,r,n,p,o,g),j(R,A,S,g,l,f,h,d,E,t,a),a=K(t,r,n,p,o+1,N),j(R,A,S,N,l,f,h,d,E,t,a),a=K(t,r,n,p,o+2,x),j(R,A,S,x,l,f,h,d,E,t,a)}Z(e,m,y)}function Q(e){var t,r=e.geometry,n=r.attributes,a=n.position.values,o=r.indices,u=k(r),s=k(r),l=o.length,f=[];f.length=a.length/3;var h=[];for(h.length=a.length/3,t=0;t<f.length;++t)f[t]=-1,h[t]=-1;for(t=0;t<l;t+=2){var d=o[t],E=o[t+1],p=i.fromArray(a,3*d,xe),y=i.fromArray(a,3*E,Ie);Math.abs(p.y)<v.EPSILON6&&(p.y<0?p.y=-v.EPSILON6:p.y=v.EPSILON6),Math.abs(y.y)<v.EPSILON6&&(y.y<0?y.y=-v.EPSILON6:y.y=v.EPSILON6);var m=u.attributes,T=u.indices,R=h,A=s.attributes,S=s.indices,g=f,N=_.lineSegmentPlane(p,y,De,Oe);if(c(N)){var x=i.multiplyByScalar(i.UNIT_Y,5*v.EPSILON9,Le);p.y<0&&(i.negate(x,x),m=s.attributes,T=s.indices,R=f,A=u.attributes,S=u.indices,g=h);var I=i.add(N,x,Ue);K(m,T,R,o,t,p),K(m,T,R,o,-1,I),i.negate(x,x),i.add(N,x,I),K(A,S,g,o,-1,I),K(A,S,g,o,t+1,y)}else{var O,w,M;p.y<0?(O=s.attributes,w=s.indices,M=f):(O=u.attributes,w=u.indices,M=h),K(O,w,M,o,t,p),K(O,w,M,o,t+1,y)}}Z(e,s,u)}function $(e){for(var t=e.attributes,r=t.position.values,n=t.prevPosition.values,a=t.nextPosition.values,o=r.length,u=0;u<o;u+=3){var s=i.unpack(r,u,Fe);if(!(s.x>0)){var c=i.unpack(n,u,Be);(s.y<0&&c.y>0||s.y>0&&c.y<0)&&(u-3>0?(n[u]=r[u-3],n[u+1]=r[u-2],n[u+2]=r[u-1]):i.pack(s,n,u));var l=i.unpack(a,u,Ge);(s.y<0&&l.y>0||s.y>0&&l.y<0)&&(u+3<o?(a[u]=r[u+3],a[u+1]=r[u+4],a[u+2]=r[u+5]):i.pack(s,a,u))}}}function ee(e){var t,r,o,u=e.geometry,s=u.attributes,l=s.position.values,f=s.prevPosition.values,h=s.nextPosition.values,d=s.expandAndWidth.values,E=c(s.st)?s.st.values:void 0,p=c(s.color)?s.color.values:void 0,y=k(u),m=k(u),T=!1,R=l.length/3;for(t=0;t<R;t+=4){var A=t,S=t+2,g=i.fromArray(l,3*A,Fe),N=i.fromArray(l,3*S,Be);if(Math.abs(g.y)<Ye)for(g.y=Ye*(N.y<0?-1:1),l[3*t+1]=g.y,l[3*(t+1)+1]=g.y,r=3*A;r<3*A+12;r+=3)f[r]=l[3*t],f[r+1]=l[3*t+1],f[r+2]=l[3*t+2];if(Math.abs(N.y)<Ye)for(N.y=Ye*(g.y<0?-1:1),l[3*(t+2)+1]=N.y,l[3*(t+3)+1]=N.y,r=3*A;r<3*A+12;r+=3)h[r]=l[3*(t+2)],h[r+1]=l[3*(t+2)+1],h[r+2]=l[3*(t+2)+2];var x=y.attributes,I=y.indices,O=m.attributes,w=m.indices,M=_.lineSegmentPlane(g,N,De,qe);if(c(M)){T=!0;var C=i.multiplyByScalar(i.UNIT_Y,Ve,We);g.y<0&&(i.negate(C,C),x=m.attributes,I=m.indices,O=y.attributes,w=y.indices);var P=i.add(M,C,He);x.position.values.push(g.x,g.y,g.z,g.x,g.y,g.z),x.position.values.push(P.x,P.y,P.z),x.position.values.push(P.x,P.y,P.z),x.prevPosition.values.push(f[3*A],f[3*A+1],f[3*A+2]),x.prevPosition.values.push(f[3*A+3],f[3*A+4],f[3*A+5]),x.prevPosition.values.push(g.x,g.y,g.z,g.x,g.y,g.z),x.nextPosition.values.push(P.x,P.y,P.z),x.nextPosition.values.push(P.x,P.y,P.z),x.nextPosition.values.push(P.x,P.y,P.z),x.nextPosition.values.push(P.x,P.y,P.z),i.negate(C,C),i.add(M,C,P),O.position.values.push(P.x,P.y,P.z),O.position.values.push(P.x,P.y,P.z),O.position.values.push(N.x,N.y,N.z,N.x,N.y,N.z),O.prevPosition.values.push(P.x,P.y,P.z),O.prevPosition.values.push(P.x,P.y,P.z),O.prevPosition.values.push(P.x,P.y,P.z),O.prevPosition.values.push(P.x,P.y,P.z),O.nextPosition.values.push(N.x,N.y,N.z,N.x,N.y,N.z),O.nextPosition.values.push(h[3*S],h[3*S+1],h[3*S+2]),O.nextPosition.values.push(h[3*S+3],h[3*S+4],h[3*S+5]);var D=n.fromArray(d,2*A,be),L=Math.abs(D.y);x.expandAndWidth.values.push(-1,L,1,L),x.expandAndWidth.values.push(-1,-L,1,-L),O.expandAndWidth.values.push(-1,L,1,L),O.expandAndWidth.values.push(-1,-L,1,-L);var U=i.magnitudeSquared(i.subtract(M,g,Ge));if(U/=i.magnitudeSquared(i.subtract(N,g,Ge)),c(p)){var b=a.fromArray(p,4*A,Xe),z=a.fromArray(p,4*S,Xe),F=v.lerp(b.x,z.x,U),B=v.lerp(b.y,z.y,U),G=v.lerp(b.z,z.z,U),q=v.lerp(b.w,z.w,U);for(r=4*A;r<4*A+8;++r)x.color.values.push(p[r]);for(x.color.values.push(F,B,G,q),x.color.values.push(F,B,G,q),O.color.values.push(F,B,G,q),O.color.values.push(F,B,G,q),r=4*S;r<4*S+8;++r)O.color.values.push(p[r])}if(c(E)){var W=n.fromArray(E,2*A,be),H=n.fromArray(E,2*(t+3),ze),X=v.lerp(W.x,H.x,U);for(r=2*A;r<2*A+4;++r)x.st.values.push(E[r]);for(x.st.values.push(X,W.y),x.st.values.push(X,H.y),O.st.values.push(X,W.y),O.st.values.push(X,H.y),r=2*S;r<2*S+4;++r)O.st.values.push(E[r])}o=x.position.values.length/3-4,I.push(o,o+2,o+1),I.push(o+1,o+2,o+3),o=O.position.values.length/3-4,w.push(o,o+2,o+1),w.push(o+1,o+2,o+3)}else{var V,Y;for(g.y<0?(V=m.attributes,Y=m.indices):(V=y.attributes,Y=y.indices),V.position.values.push(g.x,g.y,g.z),V.position.values.push(g.x,g.y,g.z),V.position.values.push(N.x,N.y,N.z),V.position.values.push(N.x,N.y,N.z),r=3*t;r<3*t+12;++r)V.prevPosition.values.push(f[r]),V.nextPosition.values.push(h[r]);for(r=2*t;r<2*t+8;++r)V.expandAndWidth.values.push(d[r]),c(E)&&V.st.values.push(E[r]);if(c(p))for(r=4*t;r<4*t+16;++r)V.color.values.push(p[r]);o=V.position.values.length/3-4,Y.push(o,o+2,o+1),Y.push(o+1,o+2,o+3)}}T&&($(m),$(y)),Z(e,m,y)}var te={};te.toWireframe=function(e){var t=e.indices;if(c(t)){switch(e.primitiveType){case S.TRIANGLES:e.indices=x(t);break;case S.TRIANGLE_STRIP:e.indices=I(t);break;case S.TRIANGLE_FAN:e.indices=O(t)}e.primitiveType=S.LINES}return e},te.createLineSegmentsForVectors=function(e,t,n){t=s(t,"normal"),n=s(n,1e4);for(var i=e.attributes.position.values,a=e.attributes[t].values,o=i.length,l=new Float64Array(2*o),f=0,h=0;h<o;h+=3)l[f++]=i[h],l[f++]=i[h+1],l[f++]=i[h+2],l[f++]=i[h]+a[h]*n,l[f++]=i[h+1]+a[h+1]*n,l[f++]=i[h+2]+a[h+2]*n;var p,y=e.boundingSphere;return c(y)&&(p=new r(y.center,y.radius+n)),new d({attributes:{position:new E({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:S.LINES,boundingSphere:p})},te.createAttributeLocations=function(e){var t,r=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","binormal","tangent","compressedAttributes"],n=e.attributes,i={},a=0,o=r.length;for(t=0;t<o;++t){var u=r[t];c(n[u])&&(i[u]=a++)}for(var s in n)n.hasOwnProperty(s)&&!c(i[s])&&(i[s]=a++);return i},te.reorderForPreVertexCache=function(e){var t=d.computeNumberOfVertices(e),r=e.indices;if(c(r)){for(var n=new Int32Array(t),i=0;i<t;i++)n[i]=-1;for(var a,o=r,s=o.length,l=y.createTypedArray(t,s),f=0,h=0,E=0;f<s;)a=n[o[f]],a!==-1?l[h]=a:(a=o[f],n[a]=E,l[h]=E,++E),++f,++h;e.indices=l;var p=e.attributes;for(var m in p)if(p.hasOwnProperty(m)&&c(p[m])&&c(p[m].values)){for(var _=p[m],v=_.values,T=0,R=_.componentsPerAttribute,A=u.createTypedArray(_.componentDatatype,E*R);T<t;){var S=n[T];if(S!==-1)for(i=0;i<R;i++)A[R*S+i]=v[R*T+i];++T}_.values=A}}return e},te.reorderForPostVertexCache=function(e,t){var r=e.indices;if(e.primitiveType===S.TRIANGLES&&c(r)){for(var n=r.length,i=0,a=0;a<n;a++)r[a]>i&&(i=r[a]);e.indices=g.tipsify({indices:r,maximumIndex:i,cacheSize:t})}return e},te.fitToUnsignedShortIndices=function(e){var t=[],r=d.computeNumberOfVertices(e);if(c(e.indices)&&r>=v.SIXTY_FOUR_KILOBYTES){var n,i=[],a=[],o=0,u=w(e.attributes),s=e.indices,l=s.length;e.primitiveType===S.TRIANGLES?n=3:e.primitiveType===S.LINES?n=2:e.primitiveType===S.POINTS&&(n=1);for(var f=0;f<l;f+=n){for(var h=0;h<n;++h){var E=s[f+h],p=i[E];c(p)||(p=o++,i[E]=p,M(u,e.attributes,E)),a.push(p)}o+n>=v.SIXTY_FOUR_KILOBYTES&&(t.push(new d({attributes:u,indices:a,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),i=[],a=[],o=0,u=w(e.attributes))}0!==a.length&&t.push(new d({attributes:u,indices:a,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var re=new i,ne=new o;te.projectTo2D=function(e,t,r,n,a){var o=e.attributes[t];a=c(a)?a:new h;for(var s=a.ellipsoid,l=o.values,f=new Float64Array(l.length),d=0,p=0;p<l.length;p+=3){var y=i.fromArray(l,p,re),m=s.cartesianToCartographic(y,ne),_=a.project(m,re);f[d++]=_.x,f[d++]=_.y,f[d++]=_.z}return e.attributes[r]=o,e.attributes[n]=new E({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:f}),delete e.attributes[t],e};var ie={high:0,low:0};te.encodeAttribute=function(e,t,r,n){for(var i=e.attributes[t],a=i.values,o=a.length,s=new Float32Array(o),c=new Float32Array(o),l=0;l<o;++l)f.encode(a[l],ie),s[l]=ie.high,c[l]=ie.low;var h=i.componentsPerAttribute;return e.attributes[r]=new E({componentDatatype:u.FLOAT,componentsPerAttribute:h,values:s}),e.attributes[n]=new E({componentDatatype:u.FLOAT,componentsPerAttribute:h,values:c}),delete e.attributes[t],e};var ae=new i,oe=new R,ue=new T;te.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(R.equals(t,R.IDENTITY))return e;var n=e.geometry.attributes;C(t,n.position),C(t,n.prevPosition),C(t,n.nextPosition),(c(n.normal)||c(n.binormal)||c(n.tangent))&&(R.inverse(t,oe),R.transpose(oe,oe),R.getRotation(oe,ue),P(ue,n.normal),P(ue,n.binormal),P(ue,n.tangent));var i=e.geometry.boundingSphere;return c(i)&&(e.geometry.boundingSphere=r.transform(i,t,i)),e.modelMatrix=R.clone(R.IDENTITY),e};var se=new i;te.combineInstances=function(e){for(var t=[],r=[],n=e.length,i=0;i<n;++i){var a=e[i];c(a.geometry)?t.push(a):c(a.westHemisphereGeometry)&&c(a.eastHemisphereGeometry)&&r.push(a)}var o=[];return t.length>0&&o.push(L(t,"geometry")),r.length>0&&(o.push(L(r,"westHemisphereGeometry")),o.push(L(r,"eastHemisphereGeometry"))),o};var ce=new i,le=new i,fe=new i,he=new i;te.computeNormal=function(e){for(var t=e.indices,r=e.attributes,n=r.position.values,a=r.position.values.length/3,o=t.length,s=new Array(a),c=new Array(o/3),l=new Array(o),f=0;f<a;f++)s[f]={indexOffset:0,count:0,currentCount:0};var h=0;for(f=0;f<o;f+=3){var d=t[f],p=t[f+1],y=t[f+2],m=3*d,_=3*p,v=3*y;le.x=n[m],le.y=n[m+1],le.z=n[m+2],fe.x=n[_],fe.y=n[_+1],fe.z=n[_+2],he.x=n[v],he.y=n[v+1],he.z=n[v+2],s[d].count++,s[p].count++,s[y].count++,i.subtract(fe,le,fe),i.subtract(he,le,he),c[h]=i.cross(fe,he,new i),h++}var T=0;for(f=0;f<a;f++)s[f].indexOffset+=T,T+=s[f].count;h=0;var R;for(f=0;f<o;f+=3){R=s[t[f]];var A=R.indexOffset+R.currentCount;l[A]=h,R.currentCount++,R=s[t[f+1]],A=R.indexOffset+R.currentCount,l[A]=h,R.currentCount++,R=s[t[f+2]],A=R.indexOffset+R.currentCount,l[A]=h,R.currentCount++,h++}var S=new Float32Array(3*a);for(f=0;f<a;f++){var g=3*f;if(R=s[f],R.count>0){for(i.clone(i.ZERO,ce),h=0;h<R.count;h++)i.add(ce,c[l[R.indexOffset+h]],ce);i.normalize(ce,ce),S[g]=ce.x,S[g+1]=ce.y,S[g+2]=ce.z}else S[g]=0,S[g+1]=0,S[g+2]=1}return e.attributes.normal=new E({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:S}),e};var de=new i,Ee=new i,pe=new i;te.computeBinormalAndTangent=function(e){for(var t=(e.attributes,e.indices),r=e.attributes.position.values,n=e.attributes.normal.values,a=e.attributes.st.values,o=e.attributes.position.values.length/3,s=t.length,c=new Array(3*o),l=0;l<c.length;l++)c[l]=0;var f,h,d;for(l=0;l<s;l+=3){var p=t[l],y=t[l+1],m=t[l+2];f=3*p,h=3*y,d=3*m;var _=2*p,v=2*y,T=2*m,R=r[f],A=r[f+1],S=r[f+2],g=a[_],N=a[_+1],x=a[v+1]-N,I=a[T+1]-N,O=1/((a[v]-g)*I-(a[T]-g)*x),w=(I*(r[h]-R)-x*(r[d]-R))*O,M=(I*(r[h+1]-A)-x*(r[d+1]-A))*O,C=(I*(r[h+2]-S)-x*(r[d+2]-S))*O;c[f]+=w,c[f+1]+=M,c[f+2]+=C,c[h]+=w,c[h+1]+=M,c[h+2]+=C,c[d]+=w,c[d+1]+=M,c[d+2]+=C}var P=new Float32Array(3*o),D=new Float32Array(3*o);for(l=0;l<o;l++){f=3*l,h=f+1,d=f+2;var L=i.fromArray(n,f,de),U=i.fromArray(c,f,pe),b=i.dot(L,U);i.multiplyByScalar(L,b,Ee),i.normalize(i.subtract(U,Ee,U),U),D[f]=U.x,D[h]=U.y,D[d]=U.z,i.normalize(i.cross(L,U,U),U),P[f]=U.x,P[h]=U.y,P[d]=U.z}return e.attributes.tangent=new E({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:D}),e.attributes.binormal=new E({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:P}),e};var ye=new n,me=new i,_e=new i,ve=new i;te.compressVertices=function(t){var r=t.attributes.normal,a=t.attributes.st;if(!c(r)&&!c(a))return t;var o,s,l,f,h=t.attributes.tangent,d=t.attributes.binormal;c(r)&&(o=r.values),c(a)&&(s=a.values),c(h)&&(l=h.values),d&&(f=d.values);var p=c(o)?o.length:s.length,y=c(o)?3:2,m=p/y,_=m,v=c(s)&&c(o)?2:1;v+=c(l)||c(f)?1:0,_*=v;for(var T=new Float32Array(_),R=0,A=0;A<m;++A){c(s)&&(n.fromArray(s,2*A,ye),T[R++]=e.compressTextureCoordinates(ye));var S=3*A;c(o)&&c(l)&&c(f)?(i.fromArray(o,S,me),i.fromArray(l,S,_e),i.fromArray(f,S,ve),e.octPack(me,_e,ve,ye),T[R++]=ye.x,T[R++]=ye.y):(c(o)&&(i.fromArray(o,S,me),T[R++]=e.octEncodeFloat(me)),c(l)&&(i.fromArray(l,S,me),T[R++]=e.octEncodeFloat(me)),c(f)&&(i.fromArray(f,S,me),T[R++]=e.octEncodeFloat(me)))}return t.attributes.compressedAttributes=new E({componentDatatype:u.FLOAT,componentsPerAttribute:v,values:T}),c(o)&&delete t.attributes.normal,c(s)&&delete t.attributes.st,c(l)&&delete t.attributes.tangent,c(f)&&delete t.attributes.binormal,t};var Te=new i,Re=new i,Ae=new i,Se=new i,ge=new i,Ne={positions:new Array(7),indices:new Array(9)},xe=new i,Ie=new i,Oe=new i,we=new i,Me=new n,Ce=new n,Pe=new n,De=A.fromPointNormal(i.ZERO,i.UNIT_Y),Le=new i,Ue=new i,be=new n,ze=new n,Fe=new i,Be=new i,Ge=new i,qe=new i,We=new i,He=new i,Xe=new a,Ve=5*v.EPSILON9,Ye=v.EPSILON6;return te.splitLongitude=function(e){var t=e.geometry,n=t.boundingSphere;if(c(n)){var i=n.center.x-n.radius;if(i>0||r.intersectPlane(n,A.ORIGIN_ZX_PLANE)!==m.INTERSECTING)return e}if(t.geometryType!==p.NONE)switch(t.geometryType){case p.POLYLINES:ee(e);break;case p.TRIANGLES:J(e);break;case p.LINES:Q(e)}else q(t),t.primitiveType===S.TRIANGLES?J(e):t.primitiveType===S.LINES&&Q(e);return e},te}),define("ThirdParty/earcut-2.1.1",[],function(){"use strict";function e(e,r,i){i=i||2;var a=r&&r.length,o=a?r[0]*i:e.length,u=t(e,0,o,i,!0),c=[];if(!u)return c;var l,f,h,d,E,p,y;if(a&&(u=s(e,r,u,i)),e.length>80*i){l=h=e[0],f=d=e[1];for(var m=i;m<o;m+=i)E=e[m],p=e[m+1],E<l&&(l=E),p<f&&(f=p),E>h&&(h=E),p>d&&(d=p);y=Math.max(h-l,d-f)}return n(u,c,i,l,f,y),c}function t(e,t,r,n,i){var a,o;if(i===O(e,t,r,n)>0)for(a=t;a<r;a+=n)o=N(a,e[a],e[a+1],o);else for(a=r-n;a>=t;a-=n)o=N(a,e[a],e[a+1],o);return o&&v(o,o.next)&&(x(o),o=o.next),o}function r(e,t){if(!e)return e;t||(t=e);var r,n=e;do if(r=!1,n.steiner||!v(n,n.next)&&0!==_(n.prev,n,n.next))n=n.next;else{if(x(n),n=t=n.prev,n===n.next)return null;r=!0}while(r||n!==t);return t}function n(e,t,s,c,l,f,d){if(e){!d&&f&&h(e,c,l,f);for(var E,p,y=e;e.prev!==e.next;)if(E=e.prev,p=e.next,f?a(e,c,l,f):i(e))t.push(E.i/s),t.push(e.i/s),t.push(p.i/s),x(e),e=p.next,y=p.next;else if(e=p,e===y){d?1===d?(e=o(e,t,s),n(e,t,s,c,l,f,2)):2===d&&u(e,t,s,c,l,f):n(r(e),t,s,c,l,f,1);break}}}function i(e){var t=e.prev,r=e,n=e.next;if(_(t,r,n)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(y(t.x,t.y,r.x,r.y,n.x,n.y,i.x,i.y)&&_(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function a(e,t,r,n){var i=e.prev,a=e,o=e.next;if(_(i,a,o)>=0)return!1;for(var u=i.x<a.x?i.x<o.x?i.x:o.x:a.x<o.x?a.x:o.x,s=i.y<a.y?i.y<o.y?i.y:o.y:a.y<o.y?a.y:o.y,c=i.x>a.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,l=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,f=E(u,s,t,r,n),h=E(c,l,t,r,n),d=e.nextZ;d&&d.z<=h;){if(d!==e.prev&&d!==e.next&&y(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&_(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(d=e.prevZ;d&&d.z>=f;){if(d!==e.prev&&d!==e.next&&y(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&_(d.prev,d,d.next)>=0)return!1;d=d.prevZ}return!0}function o(e,t,r){var n=e;do{var i=n.prev,a=n.next.next;!v(i,a)&&T(i,n,n.next,a)&&A(i,a)&&A(a,i)&&(t.push(i.i/r),t.push(n.i/r),t.push(a.i/r),x(n),x(n.next),n=e=a),n=n.next}while(n!==e);return n}function u(e,t,i,a,o,u){var s=e;do{for(var c=s.next.next;c!==s.prev;){if(s.i!==c.i&&m(s,c)){var l=g(s,c);return s=r(s,s.next),l=r(l,l.next),n(s,t,i,a,o,u),void n(l,t,i,a,o,u)}c=c.next}s=s.next}while(s!==e)}function s(e,n,i,a){var o,u,s,f,h,d=[];for(o=0,u=n.length;o<u;o++)s=n[o]*a,f=o<u-1?n[o+1]*a:e.length,h=t(e,s,f,a,!1),h===h.next&&(h.steiner=!0),d.push(p(h));for(d.sort(c),o=0;o<d.length;o++)l(d[o],i),i=r(i,i.next);return i}function c(e,t){return e.x-t.x}function l(e,t){if(t=f(e,t)){var n=g(t,e);r(n,n.next)}}function f(e,t){var r,n=t,i=e.x,a=e.y,o=-(1/0);do{if(a<=n.y&&a>=n.next.y){var u=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(u<=i&&u>o){if(o=u,u===i){if(a===n.y)return n;if(a===n.next.y)return n.next}r=n.x<n.next.x?n:n.next}}n=n.next}while(n!==t);if(!r)return null;if(i===o)return r.prev;var s,c=r,l=r.x,f=r.y,h=1/0;for(n=r.next;n!==c;)i>=n.x&&n.x>=l&&y(a<f?i:o,a,l,f,a<f?o:i,a,n.x,n.y)&&(s=Math.abs(a-n.y)/(i-n.x),(s<h||s===h&&n.x>r.x)&&A(n,e)&&(r=n,h=s)),n=n.next;return r}function h(e,t,r,n){var i=e;do null===i.z&&(i.z=E(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,d(i)}function d(e){var t,r,n,i,a,o,u,s,c=1;do{for(r=e,e=null,a=null,o=0;r;){for(o++,n=r,u=0,t=0;t<c&&(u++,n=n.nextZ,n);t++);for(s=c;u>0||s>0&&n;)0===u?(i=n,n=n.nextZ,s--):0!==s&&n?r.z<=n.z?(i=r,r=r.nextZ,u--):(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,u--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;r=n}a.nextZ=null,c*=2}while(o>1);return e}function E(e,t,r,n,i){return e=32767*(e-r)/i,t=32767*(t-n)/i,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function p(e){var t=e,r=e;do t.x<r.x&&(r=t),t=t.next;while(t!==e);return r}function y(e,t,r,n,i,a,o,u){return(i-o)*(t-u)-(e-o)*(a-u)>=0&&(e-o)*(n-u)-(r-o)*(t-u)>=0&&(r-o)*(a-u)-(i-o)*(n-u)>=0}function m(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!R(e,t)&&A(e,t)&&A(t,e)&&S(e,t)}function _(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function v(e,t){return e.x===t.x&&e.y===t.y}function T(e,t,r,n){return!!(v(e,t)&&v(r,n)||v(e,n)&&v(r,t))||_(e,t,r)>0!=_(e,t,n)>0&&_(r,n,e)>0!=_(r,n,t)>0}function R(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&T(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}function A(e,t){return _(e.prev,e,e.next)<0?_(e,t,e.next)>=0&&_(e,e.prev,t)>=0:_(e,t,e.prev)<0||_(e,e.next,t)<0}function S(e,t){var r=e,n=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do r.y>a!=r.next.y>a&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next;while(r!==e);return n}function g(e,t){var r=new I(e.i,e.x,e.y),n=new I(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function N(e,t,r,n){var i=new I(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function x(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function I(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function O(e,t,r,n){for(var i=0,a=t,o=r-n;a<r;a+=n)i+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return i}return e.deviation=function(e,t,r,n){var i=t&&t.length,a=i?t[0]*r:e.length,o=Math.abs(O(e,0,a,r));if(i)for(var u=0,s=t.length;u<s;u++){var c=t[u]*r,l=u<s-1?t[u+1]*r:e.length;o-=Math.abs(O(e,c,l,r))}var f=0;for(u=0;u<n.length;u+=3){var h=n[u]*r,d=n[u+1]*r,E=n[u+2]*r;f+=Math.abs((e[h]-e[E])*(e[d+1]-e[h+1])-(e[h]-e[d])*(e[E+1]-e[h+1]))}return 0===o&&0===f?0:Math.abs((f-o)/o)},e.flatten=function(e){for(var t=e[0][0].length,r={vertices:[],holes:[],dimensions:t},n=0,i=0;i<e.length;i++){for(var a=0;a<e[i].length;a++)for(var o=0;o<t;o++)r.vertices.push(e[i][a][o]);i>0&&(n+=e[i-1].length,r.holes.push(n))}return r},e}),define("Core/WindingOrder",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var r={CLOCKWISE:t.CW,COUNTER_CLOCKWISE:t.CCW,validate:function(e){return e===r.CLOCKWISE||e===r.COUNTER_CLOCKWISE}};return e(r)}),define("Core/PolygonPipeline",["../ThirdParty/earcut-2.1.1","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./Math","./PrimitiveType","./WindingOrder"],function(e,t,r,n,i,a,o,u,s,c,l,f,h){"use strict";var d=new r,E=new r,p={};p.computeArea2D=function(e){for(var t=e.length,r=0,n=t-1,i=0;i<t;n=i++){var a=e[n],o=e[i];r+=a.x*o.y-o.x*a.y}return.5*r},p.computeWindingOrder2D=function(e){var t=p.computeArea2D(e);return t>0?h.COUNTER_CLOCKWISE:h.CLOCKWISE},p.triangulate=function(r,n){var i=t.packArray(r);return e(i,n,2)};var y=new r,m=new r,_=new r,v=new r,T=new r,R=new r,A=new r;return p.computeSubdivision=function(e,t,o,u){u=i(u,l.RADIANS_PER_DEGREE);var h,d=o.slice(0),E=t.length,p=new Array(3*E),S=0;for(h=0;h<E;h++){var g=t[h];p[S++]=g.x,p[S++]=g.y,p[S++]=g.z}for(var N=[],x={},I=e.maximumRadius,O=l.chordLength(u,I),w=O*O;d.length>0;){var M,C,P=d.pop(),D=d.pop(),L=d.pop(),U=r.fromArray(p,3*L,y),b=r.fromArray(p,3*D,m),z=r.fromArray(p,3*P,_),F=r.multiplyByScalar(r.normalize(U,v),I,v),B=r.multiplyByScalar(r.normalize(b,T),I,T),G=r.multiplyByScalar(r.normalize(z,R),I,R),q=r.magnitudeSquared(r.subtract(F,B,A)),W=r.magnitudeSquared(r.subtract(B,G,A)),H=r.magnitudeSquared(r.subtract(G,F,A)),X=Math.max(q,W,H);X>w?q===X?(M=Math.min(L,D)+" "+Math.max(L,D),h=x[M],a(h)||(C=r.add(U,b,A),r.multiplyByScalar(C,.5,C),p.push(C.x,C.y,C.z),h=p.length/3-1,x[M]=h),d.push(L,h,P),d.push(h,D,P)):W===X?(M=Math.min(D,P)+" "+Math.max(D,P),h=x[M],a(h)||(C=r.add(b,z,A),r.multiplyByScalar(C,.5,C),p.push(C.x,C.y,C.z),h=p.length/3-1,x[M]=h),d.push(D,h,L),d.push(h,P,L)):H===X&&(M=Math.min(P,L)+" "+Math.max(P,L),h=x[M],a(h)||(C=r.add(z,U,A),r.multiplyByScalar(C,.5,C),p.push(C.x,C.y,C.z),h=p.length/3-1,x[M]=h),d.push(P,h,D),d.push(h,L,D)):(N.push(L),N.push(D),N.push(P))}return new s({attributes:{position:new c({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:p})},indices:N,primitiveType:f.TRIANGLES})},p.scaleToGeodeticHeight=function(e,t,n,o){n=i(n,u.WGS84);var s=d,c=E;if(t=i(t,0),o=i(o,!0),a(e))for(var l=e.length,f=0;f<l;f+=3)r.fromArray(e,f,c),o&&(c=n.scaleToGeodeticSurface(c,c)),0!==t&&(s=n.geodeticSurfaceNormal(c,s),r.multiplyByScalar(s,t,s),r.add(c,s,c)),e[f]=c.x,e[f+1]=c.y,e[f+2]=c.z;return e},p}),define("Core/Queue",["./defineProperties"],function(e){"use strict";function t(){this._array=[],this._offset=0,this._length=0}return e(t.prototype,{length:{get:function(){return this._length}}}),t.prototype.enqueue=function(e){this._array.push(e),this._length++},t.prototype.dequeue=function(){if(0!==this._length){var e=this._array,t=this._offset,r=e[t];return e[t]=void 0,t++,t>10&&2*t>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,r}},t.prototype.peek=function(){if(0!==this._length)return this._array[this._offset]},t.prototype.contains=function(e){return this._array.indexOf(e)!==-1},t.prototype.clear=function(){this._array.length=this._offset=this._length=0},t.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)},t}),define("Core/PolygonGeometryLibrary",["./arrayRemoveDuplicates","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryPipeline","./IndexDatatype","./Math","./PolygonPipeline","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,r,n,i,a,o,u,s,c,l,f,h,d,E,p){"use strict";function y(e,r,n,i){return t.subtract(r,e,_),t.multiplyByScalar(_,n/i,_),t.add(e,_,_),[_.x,_.y,_.z]}var m={};m.computeHierarchyPackedLength=function(e){for(var r=0,n=[e];n.length>0;){var a=n.pop();if(i(a)){r+=2;var o=a.positions,u=a.holes;if(i(o)&&(r+=o.length*t.packedLength),i(u))for(var s=u.length,c=0;c<s;++c)n.push(u[c])}}return r},m.packPolygonHierarchy=function(e,r,n){for(var a=[e];a.length>0;){var o=a.pop();if(i(o)){var u=o.positions,s=o.holes;if(r[n++]=i(u)?u.length:0,r[n++]=i(s)?s.length:0,i(u))for(var c=u.length,l=0;l<c;++l,n+=3)t.pack(u[l],r,n);if(i(s))for(var f=s.length,h=0;h<f;++h)a.push(s[h])}}return n},m.unpackPolygonHierarchy=function(e,r){for(var n=e[r++],i=e[r++],a=new Array(n),o=i>0?new Array(i):void 0,u=0;u<n;++u,r+=t.packedLength)a[u]=t.unpack(e,r);for(var s=0;s<i;++s)o[s]=m.unpackPolygonHierarchy(e,r),r=o[s].startingIndex,delete o[s].startingIndex;return{positions:a,holes:o,startingIndex:r}};var _=new t;m.subdivideLineCount=function(e,r,n){var i=t.distance(e,r),a=i/n,o=Math.max(0,Math.ceil(Math.log(a)/Math.log(2)));return Math.pow(2,o)},m.subdivideLine=function(e,r,n,a){var o=m.subdivideLineCount(e,r,n),u=t.distance(e,r),s=u/o;i(a)||(a=[]);var c=a;c.length=3*o;for(var l=0,f=0;f<o;f++){var h=y(e,r,f*s,u);c[l++]=h[0],c[l++]=h[1],c[l++]=h[2]}return c};var v=new t,T=new t,R=new t,A=new t;m.scaleToGeodeticHeightExtruded=function(e,r,o,u,s){u=n(u,a.WGS84);var c=v,l=T,f=R,h=A;if(i(e)&&i(e.attributes)&&i(e.attributes.position))for(var d=e.attributes.position.values,E=d.length/2,p=0;p<E;p+=3)t.fromArray(d,p,f),u.geodeticSurfaceNormal(f,c),h=u.scaleToGeodeticSurface(f,h),l=t.multiplyByScalar(c,o,l),l=t.add(h,l,l),d[p+E]=l.x,d[p+1+E]=l.y,d[p+2+E]=l.z,s&&(h=t.clone(f,h)),l=t.multiplyByScalar(c,r,l),l=t.add(h,l,l),d[p]=l.x,d[p+1]=l.y,d[p+2]=l.z;return e},m.polygonsFromHierarchy=function(r,n,a,o){var u=[],s=[],c=new E;for(c.enqueue(r);0!==c.length;){var l=c.dequeue(),f=l.positions,d=l.holes;if(f=e(f,t.equalsEpsilon,!0),!(f.length<3)){var y=a.projectPointsOntoPlane(f),m=[],_=h.computeWindingOrder2D(y);_===p.CLOCKWISE&&(y.reverse(),f=f.slice().reverse());var v,T,R=f.slice(),A=i(d)?d.length:0,S=[];for(v=0;v<A;v++){var g=d[v],N=e(g.positions,t.equalsEpsilon,!0);if(!(N.length<3)){var x=a.projectPointsOntoPlane(N);_=h.computeWindingOrder2D(x),_===p.CLOCKWISE&&(x.reverse(),N=N.slice().reverse()),S.push(N),m.push(R.length),R=R.concat(N),y=y.concat(x);var I=0;for(i(g.holes)&&(I=g.holes.length),T=0;T<I;T++)c.enqueue(g.holes[T])}}if(!n){for(v=0;v<f.length;v++)o.scaleToGeodeticSurface(f[v],f[v]);for(v=0;v<S.length;v++){var O=S[v];for(T=0;T<O.length;++T)o.scaleToGeodeticSurface(O[T],O[T])}}u.push({outerRing:f,holes:S}),s.push({positions:R,positions2D:y,holes:m})}}return{hierarchy:u,polygons:s}},m.createGeometryFromPositions=function(e,t,n,i,a){var s=h.triangulate(t.positions2D,t.holes);s.length<3&&(s=[0,1,2]);var l=t.positions;if(i){for(var f=l.length,E=new Array(3*f),p=0,y=0;y<f;y++){var m=l[y];E[p++]=m.x,E[p++]=m.y,E[p++]=m.z}var _=new o({attributes:{position:new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:E})},indices:s,primitiveType:d.TRIANGLES});return a.normal?c.computeNormal(_):_}return h.computeSubdivision(e,l,s,n)};var S=[],g=new t,N=new t;return m.computeWallGeometry=function(e,n,i,a){var c,h,E,p,y,_=e.length,v=0;if(a)for(h=3*_*2,c=new Array(2*h),E=0;E<_;E++)p=e[E],y=e[(E+1)%_],c[v]=c[v+h]=p.x,++v,c[v]=c[v+h]=p.y,++v,c[v]=c[v+h]=p.z,++v,c[v]=c[v+h]=y.x,++v,c[v]=c[v+h]=y.y,++v,c[v]=c[v+h]=y.z,++v;else{var T=f.chordLength(i,n.maximumRadius),R=0;for(E=0;E<_;E++)R+=m.subdivideLineCount(e[E],e[(E+1)%_],T);for(h=3*(R+_),c=new Array(2*h),E=0;E<_;E++){p=e[E],y=e[(E+1)%_];for(var A=m.subdivideLine(p,y,T,S),x=A.length,I=0;I<x;++I,++v)c[v]=A[I],c[v+h]=A[I];c[v]=y.x,c[v+h]=y.x,++v,c[v]=y.y,c[v+h]=y.y,++v,c[v]=y.z,c[v+h]=y.z,++v}}_=c.length;var O=l.createTypedArray(_/3,_-6*e.length),w=0;for(_/=6,E=0;E<_;E++){var M=E,C=M+1,P=M+_,D=P+1;p=t.fromArray(c,3*M,g),y=t.fromArray(c,3*C,N),t.equalsEpsilon(p,y,f.EPSILON14)||(O[w++]=M,O[w++]=P,O[w++]=C,O[w++]=C,O[w++]=P,O[w++]=D)}return new o({attributes:new s({position:new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:c})}),indices:O,primitiveType:d.TRIANGLES})},m}),define("Core/PolygonOutlineGeometry",["./arrayRemoveDuplicates","./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./PolygonGeometryLibrary","./PolygonPipeline","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,r,n,i,a,o,u,s,c,l,f,h,d,E,p,y,m,_,v,T){"use strict";function R(e,t,r,i){var a=s.fromPoints(t,e),o=a.projectPointsOntoPlane(t,g),u=m.computeWindingOrder2D(o);u===T.CLOCKWISE&&(o.reverse(),t=t.slice().reverse());var d,p,v=t.length,R=0;if(i)for(d=new Float64Array(2*v*3),p=0;p<v;p++){var A=t[p],S=t[(p+1)%v];d[R++]=A.x,d[R++]=A.y,d[R++]=A.z,d[R++]=S.x,d[R++]=S.y,d[R++]=S.z}else{var x=0;for(p=0;p<v;p++)x+=y.subdivideLineCount(t[p],t[(p+1)%v],r);for(d=new Float64Array(3*x),p=0;p<v;p++)for(var I=y.subdivideLine(t[p],t[(p+1)%v],r,N),O=I.length,w=0;w<O;++w)d[R++]=I[w]}v=d.length/3;var M=2*v,C=E.createTypedArray(v,M);for(R=0,p=0;p<v-1;p++)C[R++]=p,C[R++]=p+1;return C[R++]=v-1,C[R++]=0,new h({geometry:new c({attributes:new f({position:new l({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:d})}),indices:C,primitiveType:_.LINES})})}function A(e,t,r,i){var a=s.fromPoints(t,e),o=a.projectPointsOntoPlane(t,g),u=m.computeWindingOrder2D(o);u===T.CLOCKWISE&&(o.reverse(),t=t.slice().reverse());var d,p,v=t.length,R=new Array(v),A=0;if(i)for(d=new Float64Array(2*v*3*2),p=0;p<v;++p){R[p]=A/3;var S=t[p],x=t[(p+1)%v];d[A++]=S.x,d[A++]=S.y,d[A++]=S.z,d[A++]=x.x,d[A++]=x.y,d[A++]=x.z}else{var I=0;for(p=0;p<v;p++)I+=y.subdivideLineCount(t[p],t[(p+1)%v],r);for(d=new Float64Array(3*I*2),p=0;p<v;++p){R[p]=A/3;for(var O=y.subdivideLine(t[p],t[(p+1)%v],r,N),w=O.length,M=0;M<w;++M)d[A++]=O[M]}}v=d.length/6;var C=R.length,P=2*(2*v+C),D=E.createTypedArray(v,P);for(A=0,p=0;p<v;++p)D[A++]=p,D[A++]=(p+1)%v,D[A++]=p+v,D[A++]=(p+1)%v+v;for(p=0;p<C;p++){var L=R[p];D[A++]=L,D[A++]=L+v}return new h({geometry:new c({attributes:new f({position:new l({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:d})}),indices:D,primitiveType:_.LINES})})}function S(e){var t=e.polygonHierarchy,r=i(e.ellipsoid,u.WGS84),n=i(e.granularity,p.RADIANS_PER_DEGREE),o=i(e.height,0),s=i(e.perPositionHeight,!1),c=e.extrudedHeight,l=a(c);if(l&&!s){var f=c;c=Math.min(f,o),o=Math.max(f,o)}this._ellipsoid=u.clone(r),this._granularity=n,this._height=o,this._extrudedHeight=i(c,0),this._extrude=l,this._polygonHierarchy=t,this._perPositionHeight=s,this._workerName="createPolygonOutlineGeometry",this.packedLength=y.computeHierarchyPackedLength(t)+u.packedLength+6}var g=[],N=[];S.pack=function(e,t,r){return r=i(r,0),r=y.packPolygonHierarchy(e._polygonHierarchy,t,r),u.pack(e._ellipsoid,t,r),r+=u.packedLength,t[r++]=e._height,t[r++]=e._extrudedHeight,t[r++]=e._granularity,t[r++]=e._extrude?1:0,t[r++]=e._perPositionHeight?1:0,t[r++]=e.packedLength,t};var x=u.clone(u.UNIT_SPHERE),I={polygonHierarchy:{}};return S.unpack=function(e,t,r){t=i(t,0);var n=y.unpackPolygonHierarchy(e,t); -t=n.startingIndex,delete n.startingIndex;var o=u.unpack(e,t,x);t+=u.packedLength;var s=e[t++],c=e[t++],l=e[t++],f=1===e[t++],h=1===e[t++],d=e[t++];return a(r)||(r=new S(I)),r._polygonHierarchy=n,r._ellipsoid=u.clone(o,r._ellipsoid),r._height=s,r._extrudedHeight=c,r._granularity=l,r._extrude=f,r._perPositionHeight=h,r.packedLength=d,r},S.fromPositions=function(e){e=i(e,i.EMPTY_OBJECT);var t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight};return new S(t)},S.createGeometry=function(n){var i=n._ellipsoid,o=n._granularity,u=n._height,s=n._extrudedHeight,l=n._extrude,f=n._polygonHierarchy,h=n._perPositionHeight,E=[],_=new v;_.enqueue(f);for(var T;0!==_.length;){var S=_.dequeue(),g=S.positions;if(g=e(g,r.equalsEpsilon,!0),!(g.length<3)){var N=S.holes?S.holes.length:0;for(T=0;T<N;T++){var x=S.holes[T];if(x.positions=e(x.positions,r.equalsEpsilon,!0),!(x.positions.length<3)){E.push(x.positions);var I=0;a(x.holes)&&(I=x.holes.length);for(var O=0;O<I;O++)_.enqueue(x.holes[O])}}E.push(g)}}if(0!==E.length){var w,M=[],C=p.chordLength(o,i.maximumRadius);if(l)for(T=0;T<E.length;T++)w=A(i,E[T],C,h),w.geometry=y.scaleToGeodeticHeightExtruded(w.geometry,u,s,i,h),M.push(w);else for(T=0;T<E.length;T++)w=R(i,E[T],C,h),w.geometry.attributes.position.values=m.scaleToGeodeticHeight(w.geometry.attributes.position.values,u,i,!h),M.push(w);w=d.combineInstances(M)[0];var P=t.fromVertices(w.attributes.position.values);return new c({attributes:w.attributes,indices:w.indices,primitiveType:w.primitiveType,boundingSphere:P})}},S}),define("Workers/createPolygonOutlineGeometry",["../Core/defined","../Core/Ellipsoid","../Core/PolygonOutlineGeometry"],function(e,t,r){"use strict";function n(n,i){return e(i)&&(n=r.unpack(n,i)),n._ellipsoid=t.clone(n._ellipsoid),r.createGeometry(n)}return n})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e){return e+" is required, actual value was undefined"}function r(e,t,n){return"Expected "+n+" to be typeof "+t+", actual typeof was "+e}var i={};return i.typeOf={},i.defined=function(r,i){if(!e(i))throw new t(n(r))},i.typeOf.func=function(e,n){if("function"!=typeof n)throw new t(r(typeof n,"function",e))},i.typeOf.string=function(e,n){if("string"!=typeof n)throw new t(r(typeof n,"string",e))},i.typeOf.number=function(e,n){if("number"!=typeof n)throw new t(r(typeof n,"number",e))},i.typeOf.number.lessThan=function(e,n,r){if(i.typeOf.number(e,n),n>=r)throw new t("Expected "+e+" to be less than "+r+", actual value was "+n)},i.typeOf.number.lessThanOrEquals=function(e,n,r){if(i.typeOf.number(e,n),n>r)throw new t("Expected "+e+" to be less than or equal to "+r+", actual value was "+n)},i.typeOf.number.greaterThan=function(e,n,r){if(i.typeOf.number(e,n),n<=r)throw new t("Expected "+e+" to be greater than "+r+", actual value was "+n)},i.typeOf.number.greaterThanOrEquals=function(e,n,r){if(i.typeOf.number(e,n),n<r)throw new t("Expected "+e+" to be greater than or equal to"+r+", actual value was "+n)},i.typeOf.object=function(e,n){if("object"!=typeof n)throw new t(r(typeof n,"object",e))},i.typeOf.bool=function(e,n){if("boolean"!=typeof n)throw new t(r(typeof n,"boolean",e))},i}),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";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),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 n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(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^=e<<7&2636928640,e^=e<<15&4022730752,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,n,r){"use strict";var i={};i.EPSILON1=.1,i.EPSILON2=.01,i.EPSILON3=.001,i.EPSILON4=1e-4,i.EPSILON5=1e-5,i.EPSILON6=1e-6,i.EPSILON7=1e-7,i.EPSILON8=1e-8,i.EPSILON9=1e-9,i.EPSILON10=1e-10,i.EPSILON11=1e-11,i.EPSILON12=1e-12,i.EPSILON13=1e-13,i.EPSILON14=1e-14,i.EPSILON15=1e-15,i.EPSILON16=1e-16,i.EPSILON17=1e-17,i.EPSILON18=1e-18,i.EPSILON19=1e-19,i.EPSILON20=1e-20,i.GRAVITATIONALPARAMETER=3986004418e5,i.SOLAR_RADIUS=6955e5,i.LUNAR_RADIUS=1737400,i.SIXTY_FOUR_KILOBYTES=65536,i.sign=function(e){return e>0?1:e<0?-1:0},i.signNotZero=function(e){return e<0?-1:1},i.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*i.clamp(e,-1,1)+.5)*n)},i.fromSNorm=function(e,n){return n=t(n,255),i.clamp(e,0,n)/n*2-1},i.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},i.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},i.lerp=function(e,t,n){return(1-n)*e+n*t},i.PI=Math.PI,i.ONE_OVER_PI=1/Math.PI,i.PI_OVER_TWO=.5*Math.PI,i.PI_OVER_THREE=Math.PI/3,i.PI_OVER_FOUR=Math.PI/4,i.PI_OVER_SIX=Math.PI/6,i.THREE_PI_OVER_TWO=3*Math.PI*.5,i.TWO_PI=2*Math.PI,i.ONE_OVER_TWO_PI=1/(2*Math.PI),i.RADIANS_PER_DEGREE=Math.PI/180,i.DEGREES_PER_RADIAN=180/Math.PI,i.RADIANS_PER_ARCSECOND=i.RADIANS_PER_DEGREE/3600,i.toRadians=function(e){return e*i.RADIANS_PER_DEGREE},i.toDegrees=function(e){return e*i.DEGREES_PER_RADIAN},i.convertLongitudeRange=function(e){var t=i.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},i.clampToLatitudeRange=function(e){return i.clamp(e,-1*i.PI_OVER_TWO,i.PI_OVER_TWO)},i.negativePiToPi=function(e){return i.zeroToTwoPi(e+i.PI)-i.PI},i.zeroToTwoPi=function(e){var t=i.mod(e,i.TWO_PI);return Math.abs(t)<i.EPSILON14&&Math.abs(e)>i.EPSILON14?i.TWO_PI:t},i.mod=function(e,t){return(e%t+t)%t},i.equalsEpsilon=function(e,n,r,i){i=t(i,r);var a=Math.abs(e-n);return a<=i||a<=r*Math.max(Math.abs(e),Math.abs(n))};var a=[1];i.factorial=function(e){var t=a.length;if(e>=t)for(var n=a[t-1],r=t;r<=e;r++)a.push(n*r);return a[e]},i.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},i.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},i.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},i.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return i.setRandomNumberSeed=function(t){o=new e(t)},i.nextRandomNumber=function(){return o.random()},i.acosClamped=function(e){return Math.acos(i.clamp(e,-1,1))},i.asinClamped=function(e){return Math.asin(i.clamp(e,-1,1))},i.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},i.logBase=function(e,t){return Math.log(e)/Math.log(t)},i.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},i}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var i=e.clock,a=e.cone,u=t(e.magnitude,1),s=u*Math.sin(a);return r.x=s*Math.cos(i),r.y=s*Math.sin(i),r.z=u*Math.cos(a),r},o.fromElements=function(e,t,r,i){return n(i)?(i.x=e,i.y=t,i.z=r,i):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new o),i.x=e[r++],i.y=e[r++],i.z=e[r],i},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var i=0;i<r;++i)o.pack(e[i],t,3*i);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var i=0;i<r;i+=3){var a=i/3;t[a]=o.unpack(e,i,t[a])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,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};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var n=o.dot(c,l),r=o.magnitude(o.cross(c,l,c));return Math.atan2(r,n)};var f=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,i){return e===t||n(e)&&n(t)&&a.equalsEpsilon(e.x,t.x,r,i)&&a.equalsEpsilon(e.y,t.y,r,i)&&a.equalsEpsilon(e.z,t.z,r,i)},o.cross=function(e,t,n){var r=e.x,i=e.y,a=e.z,o=t.x,u=t.y,s=t.z,c=i*s-a*u,l=a*o-r*s,f=r*u-i*o;return n.x=c,n.y=l,n.z=f,n},o.fromDegrees=function(e,t,n,r,i){return e=a.toRadians(e),t=a.toRadians(t),o.fromRadians(e,t,n,r,i)};var h=new o,d=new o,p=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,i,a,u){i=t(i,0);var s=n(a)?a.radiiSquared:p,c=Math.cos(r);h.x=c*Math.cos(e),h.y=c*Math.sin(e),h.z=Math.sin(r),h=o.normalize(h,h),o.multiplyComponents(s,h,d);var l=Math.sqrt(o.dot(h,d));return d=o.divideByScalar(d,l,d),h=o.multiplyByScalar(h,i,h),n(u)||(u=new o),o.add(d,h,u)},o.fromDegreesArray=function(e,t,r){var i=e.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],s=e[a+1],c=a/2;r[c]=o.fromDegrees(u,s,0,t,r[c])}return r},o.fromRadiansArray=function(e,t,r){var i=e.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],s=e[a+1],c=a/2;r[c]=o.fromRadians(u,s,0,t,r[c])}return r},o.fromDegreesArrayHeights=function(e,t,r){var i=e.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],s=e[a+1],c=e[a+2],l=a/3;r[l]=o.fromDegrees(u,s,c,t,r[l])}return r},o.fromRadiansArrayHeights=function(e,t,r){var i=e.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],s=e[a+1],c=e[a+2],l=a/3;r[l]=o.fromRadians(u,s,c,t,r[l])}return r},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,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function i(n,i,u,s,c){var l=n.x,f=n.y,h=n.z,d=i.x,p=i.y,E=i.z,y=l*l*d*d,m=f*f*p*p,_=h*h*E*E,v=y+m+_,T=Math.sqrt(1/v),R=e.multiplyByScalar(n,T,a);if(v<s)return isFinite(T)?e.clone(R,c):void 0;var A=u.x,S=u.y,g=u.z,N=o;N.x=R.x*A*2,N.y=R.y*S*2,N.z=R.z*g*2;var x,I,O,w,M,C,P,D,L,U,b,z=(1-T)*e.magnitude(n)/(.5*e.magnitude(N)),F=0;do{z-=F,O=1/(1+z*A),w=1/(1+z*S),M=1/(1+z*g),C=O*O,P=w*w,D=M*M,L=C*O,U=P*w,b=D*M,x=y*C+m*P+_*D-1,I=y*L*A+m*U*S+_*b*g;var B=-2*I;F=x/B}while(Math.abs(x)>r.EPSILON12);return t(c)?(c.x=l*O,c.y=f*w,c.z=h*M,c):new e(l*O,f*w,h*M)}var a=new e,o=new e;return i}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,i,a,o){"use strict";function u(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)}u.fromRadians=function(e,r,i,a){return i=t(i,0),n(a)?(a.longitude=e,a.latitude=r,a.height=i,a):new u(e,r,i)},u.fromDegrees=function(e,t,n,r){return e=a.toRadians(e),t=a.toRadians(t),u.fromRadians(e,t,n,r)};var s=new e,c=new e,l=new e,f=new e(1/6378137,1/6378137,1/6356752.314245179),h=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),d=a.EPSILON1;return u.fromCartesian=function(t,r,i){var p=n(r)?r.oneOverRadii:f,E=n(r)?r.oneOverRadiiSquared:h,y=n(r)?r._centerToleranceSquared:d,m=o(t,p,E,y,c);if(n(m)){var _=e.multiplyComponents(m,E,s);_=e.normalize(_,_);var v=e.subtract(t,m,l),T=Math.atan2(_.y,_.x),R=Math.asin(_.z),A=a.sign(e.dot(v,t))*e.magnitude(v);return n(i)?(i.longitude=T,i.latitude=R,i.height=A,i):new u(T,R,A)}},u.clone=function(e,t){if(n(e))return n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},u.ZERO=i(new u(0,0,0)),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,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,i,a,o,u,s){"use strict";function c(t,r,i,a){r=n(r,0),i=n(i,0),a=n(a,0),t._radii=new e(r,i,a),t._radiiSquared=new e(r*r,i*i,a*a),t._radiiToTheFourth=new e(r*r*r*r,i*i*i*i,a*a*a*a),t._oneOverRadii=new e(0===r?0:1/r,0===i?0:1/i,0===a?0:1/a),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===i?0:1/(i*i),0===a?0:1/(a*a)),t._minimumRadius=Math.min(r,i,a),t._maximumRadius=Math.max(r,i,a),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,c(this,e,t,n)}i(l.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}}}),l.clone=function(t,n){if(r(t)){var i=t._radii;return r(n)?(e.clone(i,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new l(i.x,i.y,i.z)}},l.fromCartesian3=function(e,t){return r(t)||(t=new l),r(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,r,i){return i=n(i,0),e.pack(t._radii,r,i),r},l.unpack=function(t,r,i){r=n(r,0);var a=e.unpack(t,r);return l.fromCartesian3(a,i)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,n){var i=t.longitude,a=t.latitude,o=Math.cos(a),u=o*Math.cos(i),s=o*Math.sin(i),c=Math.sin(a);return r(n)||(n=new e),n.x=u,n.y=s,n.z=c,e.normalize(n,n)},l.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var f=new e,h=new e;l.prototype.cartographicToCartesian=function(t,n){var i=f,a=h;this.geodeticSurfaceNormalCartographic(t,i),e.multiplyComponents(this._radiiSquared,i,a);var o=Math.sqrt(e.dot(i,a));return e.divideByScalar(a,o,a),e.multiplyByScalar(i,t.height,i),r(n)||(n=new e),e.add(a,i,n)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;i<n;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var d=new e,p=new e,E=new e;return l.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,p);if(r(a)){var o=this.geodeticSurfaceNormal(a,d),s=e.subtract(n,a,E),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),f=u.sign(e.dot(s,n))*e.magnitude(s);return r(i)?(i.longitude=c,i.latitude=l,i.height=f,i):new t(c,l,f)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;i<n;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var i=t.x,a=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*u.z);return e.multiplyByScalar(t,s,n)},l.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},l.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},l.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,i,a){i=n(i,0);var o=this._sqauredXOverSquaredZ;if(r(a)||(a=new e),a.x=0,a.y=0,a.z=t.z*(1-o),!(Math.abs(a.z)>=this._radii.z-i))return a},l}),define("Core/arrayRemoveDuplicates",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function i(n,r,i){if(t(n)){i=e(i,!1);var o=n.length;if(o<2)return n;var u,s,c;for(u=1;u<o&&(s=n[u-1],c=n[u],!r(s,c,a));++u);if(u===o)return i&&r(n[0],n[n.length-1],a)?n.slice(1):n;for(var l=n.slice(0,u);u<o;++u)c=n[u],r(s,c,a)||(l.push(c),s=c);return i&&l.length>1&&r(l[0],l[l.length-1],a)&&l.shift(),l}}var a=r.EPSILON10;return i}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,i,a,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return i(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var i=this._semimajorAxis,a=t.longitude*i,o=t.latitude*i,u=t.height;return r(n)?(n.x=a,n.y=o,n.z=u,n):new e(a,o,u)},u.prototype.unproject=function(e,n){var i=this._oneOverSemimajorAxis,a=e.x*i,o=e.y*i,u=e.z;return r(n)?(n.longitude=a,n.latitude=o,n.height=u,n):new t(a,o,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";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a,o,u){"use strict";function s(e,t,r,i,a,o,u,s,c){this[0]=n(e,0),this[1]=n(i,0),this[2]=n(u,0),this[3]=n(t,0),this[4]=n(a,0),this[5]=n(s,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(c,0)}function c(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function l(e){for(var t=0,n=0;n<3;++n){var r=e[s.getElementIndex(E[n],p[n])];t+=2*r*r}return Math.sqrt(t)}function f(e,t){for(var n=u.EPSILON15,r=0,i=1,a=0;a<3;++a){var o=Math.abs(e[s.getElementIndex(E[a],p[a])]);o>r&&(i=a,r=o)}var c=1,l=0,f=p[i],h=E[i];if(Math.abs(e[s.getElementIndex(h,f)])>n){var d,y=e[s.getElementIndex(h,h)],m=e[s.getElementIndex(f,f)],_=e[s.getElementIndex(h,f)],v=(y-m)/2/_;d=v<0?-1/(-v+Math.sqrt(1+v*v)):1/(v+Math.sqrt(1+v*v)),c=1/Math.sqrt(1+d*d),l=d*c}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(f,f)]=t[s.getElementIndex(h,h)]=c,t[s.getElementIndex(h,f)]=l,t[s.getElementIndex(f,h)]=-l,t}s.packedLength=9,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t},s.unpack=function(e,t,i){return t=n(t,0),r(i)||(i=new s),i[0]=e[t++],i[1]=e[t++],i[2]=e[t++],i[3]=e[t++],i[4]=e[t++],i[5]=e[t++],i[6]=e[t++],i[7]=e[t++],i[8]=e[t++],i},s.clone=function(e,t){if(r(e))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):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,i){return t=n(t,0),r(i)||(i=new s),i[0]=e[t],i[1]=e[t+1],i[2]=e[t+2],i[3]=e[t+3],i[4]=e[t+4],i[5]=e[t+5],i[6]=e[t+6],i[7]=e[t+7],i[8]=e[t+8],i},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[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 s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var n=e.x*e.x,i=e.x*e.y,a=e.x*e.z,o=e.x*e.w,u=e.y*e.y,c=e.y*e.z,l=e.y*e.w,f=e.z*e.z,h=e.z*e.w,d=e.w*e.w,p=n-u-f+d,E=2*(i-h),y=2*(a+l),m=2*(i+h),_=-n+u-f+d,v=2*(c-o),T=2*(a-l),R=2*(c+o),A=-n-u+f+d;return r(t)?(t[0]=p,t[1]=m,t[2]=T,t[3]=E,t[4]=_,t[5]=R,t[6]=y,t[7]=v,t[8]=A,t):new s(p,E,y,m,_,v,T,R,A)},s.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),i=Math.cos(-e.heading),a=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),c=Math.sin(e.roll),l=n*i,f=-a*u+c*o*i,h=c*u+a*o*i,d=n*u,p=a*i+c*o*u,E=-o*a+a*o*u,y=-o,m=c*n,_=a*n;return r(t)?(t[0]=l,t[1]=d,t[2]=y,t[3]=f,t[4]=p,t[5]=m,t[6]=h,t[7]=E,t[8]=_,t):new s(l,f,h,d,p,E,y,m,_)},s.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 s(e.x,0,0,0,e.y,0,0,0,e.z)},s.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 s(e,0,0,0,e,0,0,0,e)},s.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 s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=i,t[6]=0,t[7]=-i,t[8]=n,t):new s(1,0,0,0,n,-i,0,i,n)},s.fromRotationY=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-i,t[3]=0,t[4]=1,t[5]=0,t[6]=i,t[7]=0,t[8]=n,t):new s(n,0,i,0,1,0,-i,0,n)},s.fromRotationZ=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=n,t[1]=i,t[2]=0,t[3]=-i,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(n,-i,0,i,n,0,0,0,1)},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):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,n){var r=3*t,i=e[r],a=e[r+1],o=e[r+2];return n.x=i,n.y=a,n.z=o,n},s.setColumn=function(e,t,n,r){r=s.clone(e,r);var i=3*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},s.getRow=function(e,t,n){var r=e[t],i=e[t+3],a=e[t+6];return n.x=r,n.y=i,n.z=a,n},s.setRow=function(e,t,n,r){return r=s.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var h=new e;s.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],h)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],h)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],h)),n};var d=new e;s.getMaximumScale=function(t){return s.getScale(t,d),e.maximumComponent(d)},s.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],i=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],o=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 n[0]=r,n[1]=i,n[2]=a,n[3]=o,n[4]=u,n[5]=s,n[6]=c,n[7]=l,n[8]=f,n},s.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},s.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},s.multiplyByVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[3]*i+e[6]*a,u=e[1]*r+e[4]*i+e[7]*a,s=e[2]*r+e[5]*i+e[8]*a;return n.x=o,n.y=u,n.z=s,n},s.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},s.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},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},s.transpose=function(e,t){var n=e[0],r=e[3],i=e[6],a=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var p=[1,0,0],E=[2,2,1],y=new s,m=new s;return s.computeEigenDecomposition=function(e,t){var n=u.EPSILON20,i=10,a=0,o=0;r(t)||(t={});for(var h=t.unitary=s.clone(s.IDENTITY,t.unitary),d=t.diagonal=s.clone(e,t.diagonal),p=n*c(d);o<i&&l(d)>p;)f(d,y),s.transpose(y,m),s.multiply(d,y,d),s.multiply(m,d,d),s.multiply(h,y,h),++a>2&&(++o,a=0);return 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},s.determinant=function(e){var t=e[0],n=e[3],r=e[6],i=e[1],a=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(a*c-s*o)+i*(s*r-n*c)+u*(n*o-a*r)},s.inverse=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],u=e[5],c=e[6],l=e[7],f=e[8],h=s.determinant(e);t[0]=o*f-l*u,t[1]=l*i-r*f,t[2]=r*u-o*i,t[3]=c*u-a*f,t[4]=n*f-c*i,t[5]=a*i-n*u,t[6]=a*l-c*o,t[7]=c*r-n*l,t[8]=n*o-a*r;var d=1/h;return s.multiplyByScalar(t,d,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]},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},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,i(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(e,n,r,i){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(i,0)}o.fromElements=function(e,t,r,i,a){return n(a)?(a.x=e,a.y=t,a.z=r,a.w=i,a):new o(e,t,r,i)},o.fromColor=function(e,t){return n(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(n(e))return n(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)},o.packedLength=4,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},o.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new o),i.x=e[r++],i.y=e[r++],i.z=e[r++],i.w=e[r],i},o.packArray=function(e,t){var r=e.length;n(t)?t.length=4*r:t=new Array(4*r);for(var i=0;i<r;++i)o.pack(e[i],t,4*i);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/4:t=new Array(r/4);for(var i=0;i<r;i+=4){var a=i/4;t[a]=o.unpack(e,i,t[a])}return t},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,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},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 u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,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,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},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 s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,c);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},o.equalsEpsilon=function(e,t,r,i){return e===t||n(e)&&n(t)&&a.equalsEpsilon(e.x,t.x,r,i)&&a.equalsEpsilon(e.y,t.y,r,i)&&a.equalsEpsilon(e.z,t.z,r,i)&&a.equalsEpsilon(e.w,t.w,r,i)},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,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){ +this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,i,a,o,u,s,c,l){"use strict";function f(e,t,n,i,a,o,u,s,c,l,f,h,d,p,E,y){this[0]=r(e,0),this[1]=r(a,0),this[2]=r(c,0),this[3]=r(d,0),this[4]=r(t,0),this[5]=r(o,0),this[6]=r(l,0),this[7]=r(p,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(f,0),this[11]=r(E,0),this[12]=r(i,0),this[13]=r(s,0),this[14]=r(h,0),this[15]=r(y,0)}f.packedLength=16,f.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},f.unpack=function(e,t,n){return t=r(t,0),i(n)||(n=new f),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},f.clone=function(e,t){if(i(e))return i(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 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])},f.fromArray=f.unpack,f.fromColumnMajorArray=function(e,t){return f.clone(e,t)},f.fromRowMajorArray=function(e,t){return i(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 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(t,n,a){return n=r(n,e.ZERO),i(a)?(a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=0,a[4]=t[3],a[5]=t[4],a[6]=t[5],a[7]=0,a[8]=t[6],a[9]=t[7],a[10]=t[8],a[11]=0,a[12]=n.x,a[13]=n.y,a[14]=n.z,a[15]=1,a):new f(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},f.fromTranslationQuaternionRotationScale=function(e,t,n,r){i(r)||(r=new f);var a=n.x,o=n.y,u=n.z,s=t.x*t.x,c=t.x*t.y,l=t.x*t.z,h=t.x*t.w,d=t.y*t.y,p=t.y*t.z,E=t.y*t.w,y=t.z*t.z,m=t.z*t.w,_=t.w*t.w,v=s-d-y+_,T=2*(c-m),R=2*(l+E),A=2*(c+m),S=-s+d-y+_,g=2*(p-h),N=2*(l-E),x=2*(p+h),I=-s-d+y+_;return r[0]=v*a,r[1]=A*a,r[2]=N*a,r[3]=0,r[4]=T*o,r[5]=S*o,r[6]=x*o,r[7]=0,r[8]=R*u,r[9]=g*u,r[10]=I*u,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},f.fromTranslationRotationScale=function(e,t){return f.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},f.fromTranslation=function(e,t){return f.fromRotationTranslation(c.IDENTITY,e,t)},f.fromScale=function(e,t){return i(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 f(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},f.fromUniformScale=function(e,t){return i(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 f(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var h=new e,d=new e,p=new e;f.fromCamera=function(t,n){var r=t.position,a=t.direction,o=t.up;e.normalize(a,h),e.normalize(e.cross(h,o,d),d),e.normalize(e.cross(d,h,p),p);var u=d.x,s=d.y,c=d.z,l=h.x,E=h.y,y=h.z,m=p.x,_=p.y,v=p.z,T=r.x,R=r.y,A=r.z,S=u*-T+s*-R+c*-A,g=m*-T+_*-R+v*-A,N=l*T+E*R+y*A;return i(n)?(n[0]=u,n[1]=m,n[2]=-l,n[3]=0,n[4]=s,n[5]=_,n[6]=-E,n[7]=0,n[8]=c,n[9]=v,n[10]=-y,n[11]=0,n[12]=S,n[13]=g,n[14]=N,n[15]=1,n):new f(u,s,c,S,m,_,v,g,-l,-E,-y,N,0,0,0,1)},f.computePerspectiveFieldOfView=function(e,t,n,r,i){var a=Math.tan(.5*e),o=1/a,u=o/t,s=(r+n)/(n-r),c=2*r*n/(n-r);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=o,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=s,i[11]=-1,i[12]=0,i[13]=0,i[14]=c,i[15]=0,i},f.computeOrthographicOffCenter=function(e,t,n,r,i,a,o){var u=1/(t-e),s=1/(r-n),c=1/(a-i),l=-(t+e)*u,f=-(r+n)*s,h=-(a+i)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=f,o[14]=h,o[15]=1,o},f.computePerspectiveOffCenter=function(e,t,n,r,i,a,o){var u=2*i/(t-e),s=2*i/(r-n),c=(t+e)/(t-e),l=(r+n)/(r-n),f=-(a+i)/(a-i),h=-1,d=-2*a*i/(a-i);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=f,o[11]=h,o[12]=0,o[13]=0,o[14]=d,o[15]=0,o},f.computeInfinitePerspectiveOffCenter=function(e,t,n,r,i,a){var o=2*i/(t-e),u=2*i/(r-n),s=(t+e)/(t-e),c=(r+n)/(r-n),l=-1,f=-1,h=-2*i;return a[0]=o,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]=h,a[15]=0,a},f.computeViewportTransformation=function(e,t,n,i){e=r(e,r.EMPTY_OBJECT);var a=r(e.x,0),o=r(e.y,0),u=r(e.width,0),s=r(e.height,0);t=r(t,0),n=r(n,1);var c=.5*u,l=.5*s,f=.5*(n-t),h=c,d=l,p=f,E=a+c,y=o+l,m=t+f,_=1;return i[0]=h,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=d,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=p,i[11]=0,i[12]=E,i[13]=y,i[14]=m,i[15]=_,i},f.computeView=function(t,n,r,i,a){return a[0]=i.x,a[1]=r.x,a[2]=-n.x,a[3]=0,a[4]=i.y,a[5]=r.y,a[6]=-n.y,a[7]=0,a[8]=i.z,a[9]=r.z,a[10]=-n.z,a[11]=0,a[12]=-e.dot(i,t),a[13]=-e.dot(r,t),a[14]=e.dot(n,t),a[15]=1,a},f.toArray=function(e,t){return i(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]]},f.getElementIndex=function(e,t){return 4*e+t},f.getColumn=function(e,t,n){var r=4*t,i=e[r],a=e[r+1],o=e[r+2],u=e[r+3];return n.x=i,n.y=a,n.z=o,n.w=u,n},f.setColumn=function(e,t,n,r){r=f.clone(e,r);var i=4*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r[i+3]=n.w,r},f.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},f.getRow=function(e,t,n){var r=e[t],i=e[t+4],a=e[t+8],o=e[t+12];return n.x=r,n.y=i,n.z=a,n.w=o,n},f.setRow=function(e,t,n,r){return r=f.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var E=new e;f.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],E)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],E)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],E)),n};var y=new e;f.getMaximumScale=function(t){return f.getScale(t,y),e.maximumComponent(y)},f.multiply=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],f=e[8],h=e[9],d=e[10],p=e[11],E=e[12],y=e[13],m=e[14],_=e[15],v=t[0],T=t[1],R=t[2],A=t[3],S=t[4],g=t[5],N=t[6],x=t[7],I=t[8],O=t[9],w=t[10],M=t[11],C=t[12],P=t[13],D=t[14],L=t[15],U=r*v+u*T+f*R+E*A,b=i*v+s*T+h*R+y*A,z=a*v+c*T+d*R+m*A,F=o*v+l*T+p*R+_*A,B=r*S+u*g+f*N+E*x,G=i*S+s*g+h*N+y*x,q=a*S+c*g+d*N+m*x,W=o*S+l*g+p*N+_*x,X=r*I+u*O+f*w+E*M,H=i*I+s*O+h*w+y*M,V=a*I+c*O+d*w+m*M,Y=o*I+l*O+p*w+_*M,k=r*C+u*P+f*D+E*L,Z=i*C+s*P+h*D+y*L,j=a*C+c*P+d*D+m*L,K=o*C+l*P+p*D+_*L;return n[0]=U,n[1]=b,n[2]=z,n[3]=F,n[4]=B,n[5]=G,n[6]=q,n[7]=W,n[8]=X,n[9]=H,n[10]=V,n[11]=Y,n[12]=k,n[13]=Z,n[14]=j,n[15]=K,n},f.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},f.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},f.multiplyTransformation=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=e[12],d=e[13],p=e[14],E=t[0],y=t[1],m=t[2],_=t[4],v=t[5],T=t[6],R=t[8],A=t[9],S=t[10],g=t[12],N=t[13],x=t[14],I=r*E+o*y+c*m,O=i*E+u*y+l*m,w=a*E+s*y+f*m,M=r*_+o*v+c*T,C=i*_+u*v+l*T,P=a*_+s*v+f*T,D=r*R+o*A+c*S,L=i*R+u*A+l*S,U=a*R+s*A+f*S,b=r*g+o*N+c*x+h,z=i*g+u*N+l*x+d,F=a*g+s*N+f*x+p;return n[0]=I,n[1]=O,n[2]=w,n[3]=0,n[4]=M,n[5]=C,n[6]=P,n[7]=0,n[8]=D,n[9]=L,n[10]=U,n[11]=0,n[12]=b,n[13]=z,n[14]=F,n[15]=1,n},f.multiplyByMatrix3=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=t[0],d=t[1],p=t[2],E=t[3],y=t[4],m=t[5],_=t[6],v=t[7],T=t[8],R=r*h+o*d+c*p,A=i*h+u*d+l*p,S=a*h+s*d+f*p,g=r*E+o*y+c*m,N=i*E+u*y+l*m,x=a*E+s*y+f*m,I=r*_+o*v+c*T,O=i*_+u*v+l*T,w=a*_+s*v+f*T;return n[0]=R,n[1]=A,n[2]=S,n[3]=0,n[4]=g,n[5]=N,n[6]=x,n[7]=0,n[8]=I,n[9]=O,n[10]=w,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},f.multiplyByTranslation=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=r*e[0]+i*e[4]+a*e[8]+e[12],u=r*e[1]+i*e[5]+a*e[9]+e[13],s=r*e[2]+i*e[6]+a*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=s,n[15]=e[15],n};var m=new e;f.multiplyByUniformScale=function(e,t,n){return m.x=t,m.y=t,m.z=t,f.multiplyByScale(e,m,n)},f.multiplyByScale=function(e,t,n){var r=t.x,i=t.y,a=t.z;return 1===r&&1===i&&1===a?f.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=i*e[4],n[5]=i*e[5],n[6]=i*e[6],n[7]=0,n[8]=a*e[8],n[9]=a*e[9],n[10]=a*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},f.multiplyByVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=t.w,u=e[0]*r+e[4]*i+e[8]*a+e[12]*o,s=e[1]*r+e[5]*i+e[9]*a+e[13]*o,c=e[2]*r+e[6]*i+e[10]*a+e[14]*o,l=e[3]*r+e[7]*i+e[11]*a+e[15]*o;return n.x=u,n.y=s,n.z=c,n.w=l,n},f.multiplyByPointAsVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[4]*i+e[8]*a,u=e[1]*r+e[5]*i+e[9]*a,s=e[2]*r+e[6]*i+e[10]*a;return n.x=o,n.y=u,n.z=s,n},f.multiplyByPoint=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[4]*i+e[8]*a+e[12],u=e[1]*r+e[5]*i+e[9]*a+e[13],s=e[2]*r+e[6]*i+e[10]*a+e[14];return n.x=o,n.y=u,n.z=s,n},f.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},f.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},f.transpose=function(e,t){var n=e[1],r=e[2],i=e[3],a=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=a,t[10]=e[10],t[11]=e[14],t[12]=i,t[13]=o,t[14]=u,t[15]=e[15],t},f.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},f.equals=function(e,t){return e===t||i(e)&&i(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},f.equalsEpsilon=function(e,t,n){return e===t||i(e)&&i(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},f.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},f.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};var _=new c,v=new c,T=new t,R=new t(0,0,0,1);return f.inverse=function(e,n){if(c.equalsEpsilon(f.getRotation(e,_),v,s.EPSILON7)&&t.equals(f.getRow(e,3,T),R))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],i=e[4],a=e[8],o=e[12],u=e[1],h=e[5],d=e[9],p=e[13],E=e[2],y=e[6],m=e[10],A=e[14],S=e[3],g=e[7],N=e[11],x=e[15],I=m*x,O=A*N,w=y*x,M=A*g,C=y*N,P=m*g,D=E*x,L=A*S,U=E*N,b=m*S,z=E*g,F=y*S,B=I*h+M*d+C*p-(O*h+w*d+P*p),G=O*u+D*d+b*p-(I*u+L*d+U*p),q=w*u+L*h+z*p-(M*u+D*h+F*p),W=P*u+U*h+F*d-(C*u+b*h+z*d),X=O*i+w*a+P*o-(I*i+M*a+C*o),H=I*r+L*a+U*o-(O*r+D*a+b*o),V=M*r+D*i+F*o-(w*r+L*i+z*o),Y=C*r+b*i+z*a-(P*r+U*i+F*a);I=a*p,O=o*d,w=i*p,M=o*h,C=i*d,P=a*h,D=r*p,L=o*u,U=r*d,b=a*u,z=r*h,F=i*u;var k=I*g+M*N+C*x-(O*g+w*N+P*x),Z=O*S+D*N+b*x-(I*S+L*N+U*x),j=w*S+L*g+z*x-(M*S+D*g+F*x),K=P*S+U*g+F*N-(C*S+b*g+z*N),J=w*m+P*A+O*y-(C*A+I*y+M*m),Q=U*A+I*E+L*m-(D*m+b*A+O*E),$=D*y+F*A+M*E-(z*A+w*E+L*y),ee=z*m+C*E+b*y-(U*y+F*m+P*E),te=r*B+i*G+a*q+o*W;if(Math.abs(te)<s.EPSILON20)throw new l("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=B*te,n[1]=G*te,n[2]=q*te,n[3]=W*te,n[4]=X*te,n[5]=H*te,n[6]=V*te,n[7]=Y*te,n[8]=k*te,n[9]=Z*te,n[10]=j*te,n[11]=K*te,n[12]=J*te,n[13]=Q*te,n[14]=$*te,n[15]=ee*te,n},f.inverseTransformation=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],f=e[12],h=e[13],d=e[14],p=-n*f-r*h-i*d,E=-a*f-o*h-u*d,y=-s*f-c*h-l*d;return t[0]=n,t[1]=a,t[2]=s,t[3]=0,t[4]=r,t[5]=o,t[6]=c,t[7]=0,t[8]=i,t[9]=u,t[10]=l,t[11]=0,t[12]=p,t[13]=E,t[14]=y,t[15]=1,t},f.IDENTITY=u(new f(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),f.ZERO=u(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,a(f.prototype,{length:{get:function(){return f.packedLength}}}),f.prototype.clone=function(e){return f.clone(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},f.prototype.equalsEpsilon=function(e,t){return f.equalsEpsilon(this,e,t)},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/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,i,a,o,u,s){"use strict";function c(e,t,r,i){this.west=n(e,0),this.south=n(t,0),this.east=n(r,0),this.north=n(i,0)}i(c.prototype,{width:{get:function(){return c.computeWidth(this)}},height:{get:function(){return c.computeHeight(this)}}}),c.packedLength=4,c.pack=function(e,t,r){return r=n(r,0),t[r++]=e.west,t[r++]=e.south,t[r++]=e.east,t[r]=e.north,t},c.unpack=function(e,t,i){return t=n(t,0),r(i)||(i=new c),i.west=e[t++],i.south=e[t++],i.east=e[t++],i.north=e[t],i},c.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=s.TWO_PI),t-n},c.computeHeight=function(e){return e.north-e.south},c.fromDegrees=function(e,t,i,a,o){return e=s.toRadians(n(e,0)),t=s.toRadians(n(t,0)),i=s.toRadians(n(i,0)),a=s.toRadians(n(a,0)),r(o)?(o.west=e,o.south=t,o.east=i,o.north=a,o):new c(e,t,i,a)},c.fromRadians=function(e,t,i,a,o){return r(o)?(o.west=n(e,0),o.south=n(t,0),o.east=n(i,0),o.north=n(a,0),o):new c(e,t,i,a)},c.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,u=Number.MAX_VALUE,l=-Number.MAX_VALUE,f=0,h=e.length;f<h;f++){var d=e[f];n=Math.min(n,d.longitude),i=Math.max(i,d.longitude),u=Math.min(u,d.latitude),l=Math.max(l,d.latitude);var p=d.longitude>=0?d.longitude:d.longitude+s.TWO_PI;a=Math.min(a,p),o=Math.max(o,p)}return i-n>o-a&&(n=a,i=o,i>s.PI&&(i-=s.TWO_PI),n>s.PI&&(n-=s.TWO_PI)),r(t)?(t.west=n,t.south=u,t.east=i,t.north=l,t):new c(n,u,i,l)},c.fromCartesianArray=function(e,t,n){for(var i=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,u=-Number.MAX_VALUE,l=Number.MAX_VALUE,f=-Number.MAX_VALUE,h=0,d=e.length;h<d;h++){var p=t.cartesianToCartographic(e[h]);i=Math.min(i,p.longitude),a=Math.max(a,p.longitude),l=Math.min(l,p.latitude),f=Math.max(f,p.latitude);var E=p.longitude>=0?p.longitude:p.longitude+s.TWO_PI;o=Math.min(o,E),u=Math.max(u,E)}return a-i>u-o&&(i=o,a=u,a>s.PI&&(a-=s.TWO_PI),i>s.PI&&(i-=s.TWO_PI)),r(n)?(n.west=i,n.south=l,n.east=a,n.north=f,n):new c(i,l,a,f)},c.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new c(e.west,e.south,e.east,e.north)},c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.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},c.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},c.validate=function(e){},c.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)},c.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)},c.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)},c.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)},c.center=function(t,n){var i=t.east,a=t.west;i<a&&(i+=s.TWO_PI);var o=s.negativePiToPi(.5*(a+i)),u=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=u,n.height=0,n):new e(o,u)},c.intersection=function(e,t,n){var i=e.east,a=e.west,o=t.east,u=t.west;i<a&&o>0?i+=s.TWO_PI:o<u&&i>0&&(o+=s.TWO_PI),i<a&&u<0?u+=s.TWO_PI:o<u&&a<0&&(a+=s.TWO_PI);var l=s.negativePiToPi(Math.max(a,u)),f=s.negativePiToPi(Math.min(i,o));if(!((e.west<e.east||t.west<t.east)&&f<=l)){var h=Math.max(e.south,t.south),d=Math.min(e.north,t.north);if(!(h>=d))return r(n)?(n.west=l,n.south=h,n.east=f,n.north=d,n):new c(l,h,f,d)}},c.simpleIntersection=function(e,t,n){var i=Math.max(e.west,t.west),a=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(a>=u||i>=o))return r(n)?(n.west=i,n.south=a,n.east=o,n.north=u,n):new c(i,a,o,u)},c.union=function(e,t,n){r(n)||(n=new c);var i=e.east,a=e.west,o=t.east,u=t.west;i<a&&o>0?i+=s.TWO_PI:o<u&&i>0&&(o+=s.TWO_PI),i<a&&u<0?u+=s.TWO_PI:o<u&&a<0&&(a+=s.TWO_PI);var l=s.convertLongitudeRange(Math.min(a,u)),f=s.convertLongitudeRange(Math.max(i,o));return n.west=l,n.south=Math.min(e.south,t.south),n.east=f,n.north=Math.max(e.north,t.north),n},c.expand=function(e,t,n){return r(n)||(n=new c),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},c.contains=function(e,t){var n=t.longitude,r=t.latitude,i=e.west,a=e.east;return a<i&&(a+=s.TWO_PI,n<0&&(n+=s.TWO_PI)),(n>i||s.equalsEpsilon(n,i,s.EPSILON14))&&(n<a||s.equalsEpsilon(n,a,s.EPSILON14))&&r>=e.south&&r<=e.north};var l=new e;return c.subsample=function(e,t,i,a){t=n(t,o.WGS84),i=n(i,0),r(a)||(a=[]);var u=0,f=e.north,h=e.south,d=e.east,p=e.west,E=l;E.height=i,E.longitude=p,E.latitude=f,a[u]=t.cartographicToCartesian(E,a[u]),u++,E.longitude=d,a[u]=t.cartographicToCartesian(E,a[u]),u++,E.latitude=h,a[u]=t.cartographicToCartesian(E,a[u]),u++,E.longitude=p,a[u]=t.cartographicToCartesian(E,a[u]),u++,f<0?E.latitude=f:h>0?E.latitude=h:E.latitude=0;for(var y=1;y<8;++y)E.longitude=-Math.PI+y*s.PI_OVER_TWO,c.contains(e,E)&&(a[u]=t.cartographicToCartesian(E,a[u]),u++);return 0===E.latitude&&(E.longitude=p,a[u]=t.cartographicToCartesian(E,a[u]),u++,E.longitude=d,a[u]=t.cartographicToCartesian(E,a[u]),u++),a.length=u,a},c.MAX_VALUE=u(new c(-Math.PI,-s.PI_OVER_TWO,Math.PI,s.PI_OVER_TWO)),c}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,i,a,o,u,s,c,l,f){"use strict";function h(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var d=new e,p=new e,E=new e,y=new e,m=new e,_=new e,v=new e,T=new e,R=new e,A=new e,S=new e,g=new e;h.fromPoints=function(t,n){if(i(n)||(n=new h),!i(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var r=e.clone(t[0],v),a=e.clone(r,d),o=e.clone(r,p),u=e.clone(r,E),s=e.clone(r,y),c=e.clone(r,m),l=e.clone(r,_),f=t.length,N=1;N<f;N++){e.clone(t[N],r);var x=r.x,I=r.y,O=r.z;x<a.x&&e.clone(r,a),x>s.x&&e.clone(r,s),I<o.y&&e.clone(r,o),I>c.y&&e.clone(r,c),O<u.z&&e.clone(r,u),O>l.z&&e.clone(r,l)}var w=e.magnitudeSquared(e.subtract(s,a,T)),M=e.magnitudeSquared(e.subtract(c,o,T)),C=e.magnitudeSquared(e.subtract(l,u,T)),P=a,D=s,L=w;M>L&&(L=M,P=o,D=c),C>L&&(L=C,P=u,D=l);var U=R;U.x=.5*(P.x+D.x),U.y=.5*(P.y+D.y),U.z=.5*(P.z+D.z);var b=e.magnitudeSquared(e.subtract(D,U,T)),z=Math.sqrt(b),F=A;F.x=a.x,F.y=o.y,F.z=u.z;var B=S;B.x=s.x,B.y=c.y,B.z=l.z;var G=e.multiplyByScalar(e.add(F,B,T),.5,g),q=0;for(N=0;N<f;N++){e.clone(t[N],r);var W=e.magnitude(e.subtract(r,G,T));W>q&&(q=W);var X=e.magnitudeSquared(e.subtract(r,U,T));if(X>b){var H=Math.sqrt(X);z=.5*(z+H),b=z*z;var V=H-z;U.x=(z*U.x+V*r.x)/H,U.y=(z*U.y+V*r.y)/H,U.z=(z*U.z+V*r.z)/H}}return z<q?(e.clone(U,n.center),n.radius=z):(e.clone(G,n.center),n.radius=q),n};var N=new o,x=new e,I=new e,O=new t,w=new t;h.fromRectangle2D=function(e,t,n){return h.fromRectangleWithHeights2D(e,t,0,0,n)},h.fromRectangleWithHeights2D=function(t,n,a,o,u){if(i(u)||(u=new h),!i(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;n=r(n,N),f.southwest(t,O),O.height=a,f.northeast(t,w),w.height=o;var s=n.project(O,x),c=n.project(w,I),l=c.x-s.x,d=c.y-s.y,p=c.z-s.z;u.radius=.5*Math.sqrt(l*l+d*d+p*p);var E=u.center;return E.x=s.x+.5*l,E.y=s.y+.5*d,E.z=s.z+.5*p,u};var M=[];h.fromRectangle3D=function(e,t,n,o){t=r(t,a.WGS84),n=r(n,0);var u;return i(e)&&(u=f.subsample(e,t,n,M)),h.fromPoints(u,o)},h.fromVertices=function(t,n,a,o){if(i(o)||(o=new h),!i(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;n=r(n,e.ZERO),a=r(a,3);var u=v;u.x=t[0]+n.x,u.y=t[1]+n.y,u.z=t[2]+n.z;for(var s=e.clone(u,d),c=e.clone(u,p),l=e.clone(u,E),f=e.clone(u,y),N=e.clone(u,m),x=e.clone(u,_),I=t.length,O=0;O<I;O+=a){var w=t[O]+n.x,M=t[O+1]+n.y,C=t[O+2]+n.z;u.x=w,u.y=M,u.z=C,w<s.x&&e.clone(u,s),w>f.x&&e.clone(u,f),M<c.y&&e.clone(u,c),M>N.y&&e.clone(u,N),C<l.z&&e.clone(u,l),C>x.z&&e.clone(u,x)}var P=e.magnitudeSquared(e.subtract(f,s,T)),D=e.magnitudeSquared(e.subtract(N,c,T)),L=e.magnitudeSquared(e.subtract(x,l,T)),U=s,b=f,z=P;D>z&&(z=D,U=c,b=N),L>z&&(z=L,U=l,b=x);var F=R;F.x=.5*(U.x+b.x),F.y=.5*(U.y+b.y),F.z=.5*(U.z+b.z);var B=e.magnitudeSquared(e.subtract(b,F,T)),G=Math.sqrt(B),q=A;q.x=s.x,q.y=c.y,q.z=l.z;var W=S;W.x=f.x,W.y=N.y,W.z=x.z;var X=e.multiplyByScalar(e.add(q,W,T),.5,g),H=0;for(O=0;O<I;O+=a){u.x=t[O]+n.x,u.y=t[O+1]+n.y,u.z=t[O+2]+n.z;var V=e.magnitude(e.subtract(u,X,T));V>H&&(H=V);var Y=e.magnitudeSquared(e.subtract(u,F,T));if(Y>B){var k=Math.sqrt(Y);G=.5*(G+k),B=G*G;var Z=k-G;F.x=(G*F.x+Z*u.x)/k,F.y=(G*F.y+Z*u.y)/k,F.z=(G*F.z+Z*u.z)/k}}return G<H?(e.clone(F,o.center),o.radius=G):(e.clone(X,o.center),o.radius=H),o},h.fromEncodedCartesianVertices=function(t,n,r){if(i(r)||(r=new h),!i(t)||!i(n)||t.length!==n.length||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var a=v;a.x=t[0]+n[0],a.y=t[1]+n[1],a.z=t[2]+n[2];for(var o=e.clone(a,d),u=e.clone(a,p),s=e.clone(a,E),c=e.clone(a,y),l=e.clone(a,m),f=e.clone(a,_),N=t.length,x=0;x<N;x+=3){var I=t[x]+n[x],O=t[x+1]+n[x+1],w=t[x+2]+n[x+2];a.x=I,a.y=O,a.z=w,I<o.x&&e.clone(a,o),I>c.x&&e.clone(a,c),O<u.y&&e.clone(a,u),O>l.y&&e.clone(a,l),w<s.z&&e.clone(a,s),w>f.z&&e.clone(a,f)}var M=e.magnitudeSquared(e.subtract(c,o,T)),C=e.magnitudeSquared(e.subtract(l,u,T)),P=e.magnitudeSquared(e.subtract(f,s,T)),D=o,L=c,U=M;C>U&&(U=C,D=u,L=l),P>U&&(U=P,D=s,L=f);var b=R;b.x=.5*(D.x+L.x),b.y=.5*(D.y+L.y),b.z=.5*(D.z+L.z);var z=e.magnitudeSquared(e.subtract(L,b,T)),F=Math.sqrt(z),B=A;B.x=o.x,B.y=u.y,B.z=s.z;var G=S;G.x=c.x,G.y=l.y,G.z=f.z;var q=e.multiplyByScalar(e.add(B,G,T),.5,g),W=0;for(x=0;x<N;x+=3){a.x=t[x]+n[x],a.y=t[x+1]+n[x+1],a.z=t[x+2]+n[x+2];var X=e.magnitude(e.subtract(a,q,T));X>W&&(W=X);var H=e.magnitudeSquared(e.subtract(a,b,T));if(H>z){var V=Math.sqrt(H);F=.5*(F+V),z=F*F;var Y=V-F;b.x=(F*b.x+Y*a.x)/V,b.y=(F*b.y+Y*a.y)/V,b.z=(F*b.z+Y*a.z)/V}}return F<W?(e.clone(b,r.center),r.radius=F):(e.clone(q,r.center),r.radius=W),r},h.fromCornerPoints=function(t,n,r){i(r)||(r=new h);var a=r.center;return e.add(t,n,a),e.multiplyByScalar(a,.5,a),r.radius=e.distance(a,n),r},h.fromEllipsoid=function(t,n){return i(n)||(n=new h),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var C=new e;h.fromBoundingSpheres=function(t,n){if(i(n)||(n=new h),!i(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var r=t.length;if(1===r)return h.clone(t[0],n);if(2===r)return h.union(t[0],t[1],n);for(var a=[],o=0;o<r;o++)a.push(t[o].center);n=h.fromPoints(a,n);var u=n.center,s=n.radius;for(o=0;o<r;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,C)+c.radius)}return n.radius=s,n};var P=new e,D=new e,L=new e;h.fromOrientedBoundingBox=function(t,n){i(n)||(n=new h);var r=t.halfAxes,a=c.getColumn(r,0,P),o=c.getColumn(r,1,D),u=c.getColumn(r,2,L),s=e.magnitude(a),l=e.magnitude(o),f=e.magnitude(u);return n.center=e.clone(t.center,n.center),n.radius=Math.max(s,l,f),n},h.clone=function(t,n){if(i(t))return i(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new h(t.center,t.radius)},h.packedLength=4,h.pack=function(e,t,n){n=r(n,0);var i=e.center;return t[n++]=i.x,t[n++]=i.y,t[n++]=i.z,t[n]=e.radius,t},h.unpack=function(e,t,n){t=r(t,0),i(n)||(n=new h);var a=n.center;return a.x=e[t++],a.y=e[t++],a.z=e[t++],n.radius=e[t],n};var U=new e,b=new e;h.union=function(t,n,r){i(r)||(r=new h);var a=t.center,o=t.radius,u=n.center,s=n.radius,c=e.subtract(u,a,U),l=e.magnitude(c);if(o>=l+s)return t.clone(r),r;if(s>=l+o)return n.clone(r),r;var f=.5*(o+l+s),d=e.multiplyByScalar(c,(-o+f)/l,b);return e.add(d,a,d),e.clone(d,r.center),r.radius=f,r};var z=new e;h.expand=function(t,n,r){r=h.clone(t,r);var i=e.magnitude(e.subtract(n,r.center,z));return i>r.radius&&(r.radius=i),r},h.intersectPlane=function(t,n){var r=t.center,i=t.radius,a=n.normal,o=e.dot(a,r)+n.distance;return o<-i?u.OUTSIDE:o<i?u.INTERSECTING:u.INSIDE},h.transform=function(e,t,n){return i(n)||(n=new h),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=l.getMaximumScale(t)*e.radius,n};var F=new e;h.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,F);return e.magnitudeSquared(r)-t.radius*t.radius},h.transformWithoutScale=function(e,t,n){return i(n)||(n=new h),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var B=new e;h.computePlaneDistances=function(t,n,r,a){i(a)||(a=new s);var o=e.subtract(t.center,n,B),u=e.dot(r,o);return a.start=u-t.radius,a.stop=u+t.radius,a};for(var G=new e,q=new e,W=new e,X=new e,H=new e,V=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var Z=new o;return h.projectTo2D=function(t,n,i){n=r(n,Z);var a=n.ellipsoid,o=t.center,u=t.radius,s=a.geodeticSurfaceNormal(o,G),c=e.cross(e.UNIT_Z,s,q);e.normalize(c,c);var l=e.cross(s,c,W);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var f=e.negate(l,H),d=e.negate(c,X),p=Y,E=p[0];e.add(s,l,E),e.add(E,c,E),E=p[1],e.add(s,l,E),e.add(E,d,E),E=p[2],e.add(s,f,E),e.add(E,d,E),E=p[3],e.add(s,f,E),e.add(E,c,E),e.negate(s,s),E=p[4],e.add(s,l,E),e.add(E,c,E),E=p[5],e.add(s,l,E),e.add(E,d,E),E=p[6],e.add(s,f,E),e.add(E,d,E),E=p[7],e.add(s,f,E),e.add(E,c,E);for(var y=p.length,m=0;m<y;++m){var _=p[m];e.add(o,_,_);var v=a.cartesianToCartographic(_,V);n.project(v,_)}i=h.fromPoints(p,i),o=i.center;var T=o.x,R=o.y,A=o.z;return o.x=A,o.y=T,o.z=R,i},h.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},h.equals=function(t,n){return t===n||i(t)&&i(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},h.prototype.intersectPlane=function(e){return h.intersectPlane(this,e)},h.prototype.distanceSquaredTo=function(e){return h.distanceSquaredTo(this,e)},h.prototype.computePlaneDistances=function(e,t,n){return h.computePlaneDistances(this,e,t,n)},h.prototype.isOccluded=function(e){return h.isOccluded(this,e)},h.prototype.equals=function(e){return h.equals(this,e)},h.prototype.clone=function(e){return h.clone(this,e)},h}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},i={};return t(i,{element:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(i.supportsFullscreen())return null!==i.element}}}),i.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var i,a=["webkit","moz","o","ms","khtml"],o=0,u=a.length;o<u;++o){var s=a[o];i=s+"RequestFullscreen","function"==typeof t[i]?(r.requestFullscreen=i,n=!0):(i=s+"RequestFullScreen","function"==typeof t[i]&&(r.requestFullscreen=i,n=!0)),i=s+"ExitFullscreen","function"==typeof document[i]?r.exitFullscreen=i:(i=s+"CancelFullScreen","function"==typeof document[i]&&(r.exitFullscreen=i)),i=s+"FullscreenEnabled",void 0!==document[i]?r.fullscreenEnabled=i:(i=s+"FullScreenEnabled",void 0!==document[i]&&(r.fullscreenEnabled=i)),i=s+"FullscreenElement",void 0!==document[i]?r.fullscreenElement=i:(i=s+"FullScreenElement",void 0!==document[i]&&(r.fullscreenElement=i)),i=s+"fullscreenchange",void 0!==document["on"+i]&&("ms"===s&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=s+"fullscreenerror",void 0!==document["on"+i]&&("ms"===s&&(i="MSFullscreenError"),r.fullscreenerror=i)}return n},i.requestFullscreen=function(e,t){i.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},i.exitFullscreen=function(){i.supportsFullscreen()&&document[r.exitFullscreen]()},i}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function i(){if(!t(R)&&(R=!1,!h())){var e=/ Chrome\/([\.0-9]+)/.exec(T.userAgent);null!==e&&(R=!0,A=r(e[1]))}return R}function a(){return i()&&A}function o(){if(!t(S)&&(S=!1,!i()&&!h()&&/ Safari\/[\.0-9]+/.test(T.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(T.userAgent);null!==e&&(S=!0,g=r(e[1]))}return S}function u(){return o()&&g}function s(){if(!t(N)){N=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(T.userAgent);null!==e&&(N=!0,x=r(e[1]),x.isNightly=!!e[2]); +}return N}function c(){return s()&&x}function l(){if(!t(I)){I=!1;var e;"Microsoft Internet Explorer"===T.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(T.userAgent),null!==e&&(I=!0,O=r(e[1]))):"Netscape"===T.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(T.userAgent),null!==e&&(I=!0,O=r(e[1])))}return I}function f(){return l()&&O}function h(){if(!t(w)){w=!1;var e=/ Edge\/([\.0-9]+)/.exec(T.userAgent);null!==e&&(w=!0,M=r(e[1]))}return w}function d(){return h()&&M}function p(){if(!t(C)){C=!1;var e=/Firefox\/([\.0-9]+)/.exec(T.userAgent);null!==e&&(C=!0,P=r(e[1]))}return C}function E(){return t(D)||(D=/Windows/i.test(T.appVersion)),D}function y(){return p()&&P}function m(){return t(L)||(L="undefined"!=typeof PointerEvent&&(!t(T.pointerEnabled)||T.pointerEnabled)),L}function _(){if(!t(b)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;b=t(n)&&""!==n,b&&(U=n)}return b}function v(){return _()?U:void 0}var T;T="undefined"!=typeof navigator?navigator:{};var R,A,S,g,N,x,I,O,w,M,C,P,D,L,U,b,z={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isEdge:h,edgeVersion:d,isFirefox:p,firefoxVersion:y,isWindows:E,hardwareConcurrency:e(T.hardwareConcurrency,3),supportsPointerEvents:m,supportsImageRenderingPixelated:_,imageRenderingValue:v};return z.supportsFullscreen=function(){return n.supportsFullscreen()},z.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},z.supportsWebWorkers=function(){return"undefined"!=typeof Worker},z}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,i,a){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:a.BYTE,UNSIGNED_BYTE:a.UNSIGNED_BYTE,SHORT:a.SHORT,UNSIGNED_SHORT:a.UNSIGNED_SHORT,INT:a.INT,UNSIGNED_INT:a.UNSIGNED_INT,FLOAT:a.FLOAT,DOUBLE:a.DOUBLE};return o.getSizeInBytes=function(e){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.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},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 Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,i){switch(r=e(r,0),i=e(i,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,i);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,i);case o.SHORT:return new Int16Array(n,r,i);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,i);case o.INT:return new Int32Array(n,r,i);case o.UNSIGNED_INT:return new Uint32Array(n,r,i);case o.FLOAT:return new Float32Array(n,r,i);case o.DOUBLE:return new Float64Array(n,r,i)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},i(o)}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Intersect"],function(e,t,n,r,i){"use strict";function a(r,i,a){this.minimum=e.clone(t(r,e.ZERO)),this.maximum=e.clone(t(i,e.ZERO)),n(a)?a=e.clone(a):(a=e.add(this.minimum,this.maximum,new e),e.multiplyByScalar(a,.5,a)),this.center=a}a.fromPoints=function(t,r){if(n(r)||(r=new a),!n(t)||0===t.length)return r.minimum=e.clone(e.ZERO,r.minimum),r.maximum=e.clone(e.ZERO,r.maximum),r.center=e.clone(e.ZERO,r.center),r;for(var i=t[0].x,o=t[0].y,u=t[0].z,s=t[0].x,c=t[0].y,l=t[0].z,f=t.length,h=1;h<f;h++){var d=t[h],p=d.x,E=d.y,y=d.z;i=Math.min(p,i),s=Math.max(p,s),o=Math.min(E,o),c=Math.max(E,c),u=Math.min(y,u),l=Math.max(y,l)}var m=r.minimum;m.x=i,m.y=o,m.z=u;var _=r.maximum;_.x=s,_.y=c,_.z=l;var v=e.add(m,_,r.center);return e.multiplyByScalar(v,.5,v),r},a.clone=function(t,r){if(n(t))return n(r)?(r.minimum=e.clone(t.minimum,r.minimum),r.maximum=e.clone(t.maximum,r.maximum),r.center=e.clone(t.center,r.center),r):new a(t.minimum,t.maximum)},a.equals=function(t,r){return t===r||n(t)&&n(r)&&e.equals(t.center,r.center)&&e.equals(t.minimum,r.minimum)&&e.equals(t.maximum,r.maximum)};var o=new e;return a.intersectPlane=function(t,n){o=e.subtract(t.maximum,t.minimum,o);var r=e.multiplyByScalar(o,.5,o),a=n.normal,u=r.x*Math.abs(a.x)+r.y*Math.abs(a.y)+r.z*Math.abs(a.z),s=e.dot(t.center,a)+n.distance;return s-u>0?i.INSIDE:s+u<0?i.OUTSIDE:i.INTERSECTING},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.intersectPlane=function(e){return a.intersectPlane(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(e,n){this.x=t(e,0),this.y=t(n,0)}o.fromElements=function(e,t,r){return n(r)?(r.x=e,r.y=t,r):new o(e,t)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t):new o(e.x,e.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r]=e.y,n},o.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new o),i.x=e[r++],i.y=e[r],i},o.packArray=function(e,t){var r=e.length;n(t)?t.length=2*r:t=new Array(2*r);for(var i=0;i<r;++i)o.pack(e[i],t,2*i);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/2:t=new Array(r/2);for(var i=0;i<r;i+=2){var a=i/2;t[a]=o.unpack(e,i,t[a])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y)},o.minimumComponent=function(e){return Math.min(e.x,e.y)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){return o.normalize(e,c),o.normalize(t,l),a.acosClamped(o.dot(c,l))};var f=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},o.equalsEpsilon=function(e,t,r,i){return e===t||n(e)&&n(t)&&a.equalsEpsilon(e.x,t.x,r,i)&&a.equalsEpsilon(e.y,t.y,r,i)},o.ZERO=i(new o(0,0)),o.UNIT_X=i(new o(1,0)),o.UNIT_Y=i(new o(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,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function n(e,n,r){var i=e+n;return t.sign(e)!==t.sign(n)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(n)))<r?0:i}var r={};return r.computeDiscriminant=function(e,t,n){var r=t*t-4*e*n;return r},r.computeRealRoots=function(e,r,i){var a;if(0===e)return 0===r?[]:[-i/r];if(0===r){if(0===i)return[0,0];var o=Math.abs(i),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(a=-i/e,a<0)return[];var s=Math.sqrt(a);return[-s,s]}if(0===i)return a=-r/e,a<0?[a,0]:[0,a];var c=r*r,l=4*e*i,f=n(c,-l,t.EPSILON14);if(f<0)return[];var h=-.5*n(r,t.sign(r)*Math.sqrt(f),t.EPSILON14);return r>0?[h/e,i/h]:[i/h,h/e]},r}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function n(e,t,n,r){var i,a,o=e,u=t/3,s=n/3,c=r,l=o*s,f=u*c,h=u*u,d=s*s,p=o*s-h,E=o*c-u*s,y=u*c-d,m=4*p*y-E*E;if(m<0){var _,v,T;h*f>=l*d?(_=o,v=p,T=-2*u*p+o*E):(_=c,v=y,T=-c*E+2*s*y);var R=T<0?-1:1,A=-R*Math.abs(_)*Math.sqrt(-m);a=-T+A;var S=a/2,g=S<0?-Math.pow(-S,1/3):Math.pow(S,1/3),N=a===A?-g:-v/g;return i=v<=0?g+N:-T/(g*g+N*N+v),h*f>=l*d?[(i-u)/o]:[-c/(i+s)]}var x=p,I=-2*u*p+o*E,O=y,w=-c*E+2*s*y,M=Math.sqrt(m),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*M,-I)/3);i=2*Math.sqrt(-x);var D=Math.cos(P);a=i*D;var L=i*(-D/2-C*Math.sin(P)),U=a+L>2*u?a-u:L-u,b=o,z=U/b;P=Math.abs(Math.atan2(c*M,-w)/3),i=2*Math.sqrt(-O),D=Math.cos(P),a=i*D,L=i*(-D/2-C*Math.sin(P));var F=-c,B=a+L<2*s?a+s:L+s,G=F/B,q=b*B,W=-U*B-b*F,X=U*F,H=(s*W-u*X)/(-u*W+s*q);return z<=H?z<=G?H<=G?[z,H,G]:[z,G,H]:[G,z,H]:z<=G?[H,z,G]:H<=G?[H,G,z]:[G,H,z]}var r={};return r.computeDiscriminant=function(e,t,n,r){var i=e*e,a=t*t,o=n*n,u=r*r,s=18*e*t*n*r+a*o-27*i*u-4*(e*o*n+a*t*r);return s},r.computeRealRoots=function(e,r,i,a){var o,u;if(0===e)return t.computeRealRoots(r,i,a);if(0===r){if(0===i){if(0===a)return[0,0,0];u=-a/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===a?(o=t.computeRealRoots(e,0,i),0===o.Length?[0]:[o[0],0,o[1]]):n(e,0,i,a)}return 0===i?0===a?(u=-r/e,u<0?[u,0,0]:[0,0,u]):n(e,r,0,a):0===a?(o=t.computeRealRoots(e,r,i),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):n(e,r,i,a)},r}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,n,r){"use strict";function i(t,i,a,o){var u=t*t,s=i-3*u/8,c=a-i*t/2+u*t/8,l=o-a*t/4+i*u/16-3*u*u/256,f=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(f.length>0){var h=-t/4,d=f[f.length-1];if(Math.abs(d)<n.EPSILON14){var p=r.computeRealRoots(1,s,l);if(2===p.length){var E,y=p[0],m=p[1];if(y>=0&&m>=0){var _=Math.sqrt(y),v=Math.sqrt(m);return[h-v,h-_,h+_,h+v]}if(y>=0&&m<0)return E=Math.sqrt(y),[h-E,h+E];if(y<0&&m>=0)return E=Math.sqrt(m),[h-E,h+E]}return[]}if(d>0){var T=Math.sqrt(d),R=(s+d-c/T)/2,A=(s+d+c/T)/2,S=r.computeRealRoots(1,T,R),g=r.computeRealRoots(1,-T,A);return 0!==S.length?(S[0]+=h,S[1]+=h,0!==g.length?(g[0]+=h,g[1]+=h,S[1]<=g[0]?[S[0],S[1],g[0],g[1]]:g[1]<=S[0]?[g[0],g[1],S[0],S[1]]:S[0]>=g[0]&&S[1]<=g[1]?[g[0],S[0],S[1],g[1]]:g[0]>=S[0]&&g[1]<=S[1]?[S[0],g[0],g[1],S[1]]:S[0]>g[0]&&S[0]<g[1]?[g[0],S[0],g[1],S[1]]:[S[0],g[0],S[1],g[1]]):S):0!==g.length?(g[0]+=h,g[1]+=h,g):[]}}return[]}function a(t,i,a,o){var u=a*a,s=i*i,c=t*t,l=-2*i,f=a*t+s-4*o,h=c*o-a*i*t+u,d=e.computeRealRoots(1,l,f,h);if(d.length>0){var p,E,y=d[0],m=i-y,_=m*m,v=t/2,T=m/2,R=_-4*o,A=_+4*Math.abs(o),S=c-4*y,g=c+4*Math.abs(y);if(y<0||R*g<S*A){var N=Math.sqrt(S);p=N/2,E=0===N?0:(t*T-a)/N}else{var x=Math.sqrt(R);p=0===x?0:(t*T-a)/x,E=x/2}var I,O;0===v&&0===p?(I=0,O=0):n.sign(v)===n.sign(p)?(I=v+p,O=y/I):(O=v-p,I=y/O);var w,M;0===T&&0===E?(w=0,M=0):n.sign(T)===n.sign(E)?(w=T+E,M=o/w):(M=T-E,w=o/M);var C=r.computeRealRoots(1,I,w),P=r.computeRealRoots(1,O,M);if(0!==C.length)return 0!==P.length?C[1]<=P[0]?[C[0],C[1],P[0],P[1]]:P[1]<=C[0]?[P[0],P[1],C[0],C[1]]:C[0]>=P[0]&&C[1]<=P[1]?[P[0],C[0],C[1],P[1]]:P[0]>=C[0]&&P[1]<=C[1]?[C[0],P[0],P[1],C[1]]:C[0]>P[0]&&C[0]<P[1]?[P[0],C[0],P[1],C[1]]:[C[0],P[0],C[1],P[1]]:C;if(0!==P.length)return P}return[]}var o={};return o.computeDiscriminant=function(e,t,n,r,i){var a=e*e,o=a*e,u=t*t,s=u*t,c=n*n,l=c*n,f=r*r,h=f*r,d=i*i,p=d*i,E=u*c*f-4*s*h-4*e*l*f+18*e*t*n*h-27*a*f*f+256*o*p+i*(18*s*n*r-4*u*l+16*e*c*c-80*e*t*c*r-6*e*u*f+144*a*n*f)+d*(144*e*u*n-27*u*u-128*a*c-192*a*t*r);return E},o.computeRealRoots=function(t,r,o,u,s){if(Math.abs(t)<n.EPSILON15)return e.computeRealRoots(r,o,u,s);var c=r/t,l=o/t,f=u/t,h=s/t,d=c<0?1:0;switch(d+=l<0?d+1:d,d+=f<0?d+1:d,d+=h<0?d+1:d){case 0:return i(c,l,f,h);case 1:return a(c,l,f,h);case 2:return a(c,l,f,h);case 3:return i(c,l,f,h);case 4:return i(c,l,f,h);case 5:return a(c,l,f,h);case 6:return i(c,l,f,h);case 7:return i(c,l,f,h);case 8:return a(c,l,f,h);case 9:return i(c,l,f,h);case 10:return i(c,l,f,h);case 11:return a(c,l,f,h);case 12:return i(c,l,f,h);case 13:return i(c,l,f,h);case 14:return i(c,l,f,h);case 15:return i(c,l,f,h);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function i(n,r){r=e.clone(t(r,e.ZERO)),e.equals(r,e.ZERO)||e.normalize(r,r),this.origin=e.clone(t(n,e.ZERO)),this.direction=r}return i.getPoint=function(t,r,i){return n(i)||(i=new e),i=e.multiplyByScalar(t.direction,r,i),e.add(t.origin,i,i)},i}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,n,r,i,a,o,u,s,c,l){"use strict";function f(e,t,n,r){var i=t*t-4*e*n;if(!(i<0)){if(i>0){var a=1/(2*e),o=Math.sqrt(i),u=(-t+o)*a,s=(-t-o)*a;return u<s?(r.root0=u,r.root1=s):(r.root0=s,r.root1=u),r}var c=-t/(2*e);if(0!==c)return r.root0=r.root1=c,r}}function h(t,n,i){r(i)||(i=new a);var o=t.origin,u=t.direction,s=n.center,c=n.radius*n.radius,l=e.subtract(o,s,_),h=e.dot(u,u),d=2*e.dot(u,l),p=e.magnitudeSquared(l)-c,E=f(h,d,p,A);if(r(E))return i.start=E.root0,i.stop=E.root1,i}function d(e,t,n){var r=e+t;return o.sign(e)!==o.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))<n?0:r}function p(t,n,r,i,a){var l,f=i*i,h=a*a,p=(t[u.COLUMN1ROW1]-t[u.COLUMN2ROW2])*h,E=a*(i*d(t[u.COLUMN1ROW0],t[u.COLUMN0ROW1],o.EPSILON15)+n.y),y=t[u.COLUMN0ROW0]*f+t[u.COLUMN2ROW2]*h+i*n.x+r,m=h*d(t[u.COLUMN2ROW1],t[u.COLUMN1ROW2],o.EPSILON15),_=a*(i*d(t[u.COLUMN2ROW0],t[u.COLUMN0ROW2])+n.z),v=[];if(0===_&&0===m){if(l=s.computeRealRoots(p,E,y),0===l.length)return v;var T=l[0],R=Math.sqrt(Math.max(1-T*T,0));if(v.push(new e(i,a*T,a*-R)),v.push(new e(i,a*T,a*R)),2===l.length){var A=l[1],S=Math.sqrt(Math.max(1-A*A,0));v.push(new e(i,a*A,a*-S)),v.push(new e(i,a*A,a*S))}return v}var g=_*_,N=m*m,x=p*p,I=_*m,O=x+N,w=2*(E*p+I),M=2*y*p+E*E-N+g,C=2*(y*E-I),P=y*y-g;if(0===O&&0===w&&0===M&&0===C)return v;l=c.computeRealRoots(O,w,M,C,P);var D=l.length;if(0===D)return v;for(var L=0;L<D;++L){var U,b=l[L],z=b*b,F=Math.max(1-z,0),B=Math.sqrt(F);U=o.sign(p)===o.sign(y)?d(p*z+y,E*b,o.EPSILON12):o.sign(y)===o.sign(E*b)?d(p*z,E*b+y,o.EPSILON12):d(p*z+E*b,y,o.EPSILON12);var G=d(m*b,_,o.EPSILON15),q=U*G;q<0?v.push(new e(i,a*b,a*B)):q>0?v.push(new e(i,a*b,a*-B)):0!==B?(v.push(new e(i,a*b,a*-B)),v.push(new e(i,a*b,a*B)),++L):v.push(new e(i,a*b,a*B))}return v}var E={};E.rayPlane=function(t,n,i){r(i)||(i=new e);var a=t.origin,u=t.direction,s=n.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON15)){var l=(-n.distance-e.dot(s,a))/c;if(!(l<0))return i=e.multiplyByScalar(u,l,i),e.add(a,i,i)}};var y=new e,m=new e,_=new e,v=new e,T=new e;E.rayTriangleParametric=function(t,r,i,a,u){u=n(u,!1);var s,c,l,f,h,d=t.origin,p=t.direction,E=e.subtract(i,r,y),R=e.subtract(a,r,m),A=e.cross(p,R,_),S=e.dot(E,A);if(u){if(S<o.EPSILON6)return;if(s=e.subtract(d,r,v),l=e.dot(s,A),l<0||l>S)return;if(c=e.cross(s,E,T),f=e.dot(p,c),f<0||l+f>S)return;h=e.dot(R,c)/S}else{if(Math.abs(S)<o.EPSILON6)return;var g=1/S;if(s=e.subtract(d,r,v),l=e.dot(s,A)*g,l<0||l>1)return;if(c=e.cross(s,E,T),f=e.dot(p,c)*g,f<0||l+f>1)return;h=e.dot(R,c)*g}return h},E.rayTriangle=function(t,n,i,a,o,u){var s=E.rayTriangleParametric(t,n,i,a,o);if(r(s)&&!(s<0))return r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var R=new l;E.lineSegmentTriangle=function(t,n,i,a,o,u,s){var c=R;e.clone(t,c.origin),e.subtract(n,t,c.direction),e.normalize(c.direction,c.direction);var l=E.rayTriangleParametric(c,i,a,o,u);if(!(!r(l)||l<0||l>e.distance(t,n)))return r(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var A={root0:0,root1:0};E.raySphere=function(e,t,n){if(n=h(e,t,n),r(n)&&!(n.stop<0))return n.start=Math.max(n.start,0),n};var S=new l;E.lineSegmentSphere=function(t,n,i,a){var o=S;e.clone(t,o.origin);var u=e.subtract(n,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),a=h(o,i,a),!(!r(a)||a.stop<0||a.start>s))return a.start=Math.max(a.start,0),a.stop=Math.min(a.stop,s),a};var g=new e,N=new e;E.rayEllipsoid=function(t,n){var r,i,o,u,s,c=n.oneOverRadii,l=e.multiplyComponents(c,t.origin,g),f=e.multiplyComponents(c,t.direction,N),h=e.magnitudeSquared(l),d=e.dot(l,f);if(h>1){if(d>=0)return;var p=d*d;if(r=h-1,i=e.magnitudeSquared(f),o=i*r,p<o)return;if(p>o){u=d*d-o,s=-d+Math.sqrt(u);var E=s/i,y=r/s;return E<y?new a(E,y):{start:y,stop:E}}var m=Math.sqrt(r/i);return new a(m,m)}return h<1?(r=h-1,i=e.magnitudeSquared(f),o=i*r,u=d*d-o,s=-d+Math.sqrt(u),new a(0,s/i)):d<0?(i=e.magnitudeSquared(f),new a(0,-d/i)):void 0};var x=new e,I=new e,O=new e,w=new e,M=new e,C=new u,P=new u,D=new u,L=new u,U=new u,b=new u,z=new u,F=new e,B=new e,G=new t;E.grazingAltitudeLocation=function(t,n){var i=t.origin,a=t.direction;if(!e.equals(i,e.ZERO)){var s=n.geodeticSurfaceNormal(i,x);if(e.dot(a,s)>=0)return i}var c=r(this.rayEllipsoid(t,n)),l=n.transformPositionToScaledSpace(a,x),f=e.normalize(l,l),h=e.mostOrthogonalAxis(l,w),d=e.normalize(e.cross(h,f,I),I),E=e.normalize(e.cross(f,d,O),O),y=C;y[0]=f.x,y[1]=f.y,y[2]=f.z,y[3]=d.x,y[4]=d.y,y[5]=d.z,y[6]=E.x,y[7]=E.y,y[8]=E.z;var m=u.transpose(y,P),_=u.fromScale(n.radii,D),v=u.fromScale(n.oneOverRadii,L),T=U;T[0]=0,T[1]=-a.z,T[2]=a.y,T[3]=a.z,T[4]=0,T[5]=-a.x,T[6]=-a.y, +T[7]=a.x,T[8]=0;var R,A,S=u.multiply(u.multiply(m,v,b),T,b),g=u.multiply(u.multiply(S,_,z),y,z),N=u.multiplyByVector(S,i,M),q=p(g,e.negate(N,x),0,0,1),W=q.length;if(W>0){for(var X=e.clone(e.ZERO,B),H=Number.NEGATIVE_INFINITY,V=0;V<W;++V){R=u.multiplyByVector(_,u.multiplyByVector(y,q[V],F),F);var Y=e.normalize(e.subtract(R,i,w),w),k=e.dot(Y,a);k>H&&(H=k,X=e.clone(R,X))}var Z=n.cartesianToCartographic(X,G);return H=o.clamp(H,0,1),A=e.magnitude(e.subtract(X,i,w))*Math.sqrt(1-H*H),A=c?-A:A,Z.height=A,n.cartographicToCartesian(Z,new e)}};var q=new e;return E.lineSegmentPlane=function(t,n,i,a){r(a)||(a=new e);var u=e.subtract(n,t,q),s=i.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON6)){var l=e.dot(s,t),f=-(i.distance+l)/c;if(!(f<0||f>1))return e.multiplyByScalar(u,f,a),e.add(t,a,a),a}},E.trianglePlaneIntersection=function(t,n,r,i){var a=i.normal,o=i.distance,u=e.dot(a,t)+o<0,s=e.dot(a,n)+o<0,c=e.dot(a,r)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var f,h;if(1!==l&&2!==l||(f=new e,h=new e),1===l){if(u)return E.lineSegmentPlane(t,n,i,f),E.lineSegmentPlane(t,r,i,h),{positions:[t,n,r,f,h],indices:[0,3,4,1,2,4,1,4,3]};if(s)return E.lineSegmentPlane(n,r,i,f),E.lineSegmentPlane(n,t,i,h),{positions:[t,n,r,f,h],indices:[1,3,4,2,0,4,2,4,3]};if(c)return E.lineSegmentPlane(r,t,i,f),E.lineSegmentPlane(r,n,i,h),{positions:[t,n,r,f,h],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return E.lineSegmentPlane(n,t,i,f),E.lineSegmentPlane(r,t,i,h),{positions:[t,n,r,f,h],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return E.lineSegmentPlane(r,n,i,f),E.lineSegmentPlane(t,n,i,h),{positions:[t,n,r,f,h],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return E.lineSegmentPlane(t,r,i,f),E.lineSegmentPlane(n,r,i,h),{positions:[t,n,r,f,h],indices:[0,1,4,0,4,3,2,3,4]}}},E}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";function i(t,n){this.normal=e.clone(t),this.distance=n}i.fromPointNormal=function(n,r,a){var o=-e.dot(r,n);return t(a)?(e.clone(r,a.normal),a.distance=o,a):new i(r,o)};var a=new e;return i.fromCartesian4=function(n,r){var o=e.fromCartesian4(n,a),u=n.w;return t(r)?(e.clone(o,r.normal),r.distance=u,r):new i(o,u)},i.getPointDistance=function(t,n){return e.dot(t.normal,n)+t.distance},i.ORIGIN_XY_PLANE=r(new i(e.UNIT_Z,0)),i.ORIGIN_YZ_PLANE=r(new i(e.UNIT_X,0)),i.ORIGIN_ZX_PLANE=r(new i(e.UNIT_Y,0)),i}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,n,r,i){return t(e).then(n,r,i)}function t(e){var t,n;return e instanceof r?t=e:u(e)?(n=o(),e.then(function(e){n.resolve(e)},function(e){n.reject(e)},function(e){n.progress(e)}),t=n.promise):t=i(e),t}function n(t){return e(t,a)}function r(e){this.then=e}function i(e){var n=new r(function(n){try{return t(n?n(e):e)}catch(e){return a(e)}});return n}function a(e){var n=new r(function(n,r){try{return r?t(r(e)):a(e)}catch(e){return a(e)}});return n}function o(){function e(e,t,n){return h(e,t,n)}function n(e){return p(e)}function i(e){return p(a(e))}function u(e){return d(e)}var s,c,l,f,h,d,p;return c=new r(e),s={then:e,resolve:n,reject:i,progress:u,promise:c,resolver:{resolve:n,reject:i,progress:u}},l=[],f=[],h=function(e,t,n){var r,i;return r=o(),i="function"==typeof n?function(e){try{r.progress(n(e))}catch(e){r.progress(e)}}:function(e){r.progress(e)},l.push(function(n){n.then(e,t).then(r.resolve,r.reject,i)}),f.push(i),r.promise},d=function(e){return E(f,e),e},p=function(e){return e=t(e),h=e.then,p=t,d=m,E(l,e),f=l=R,e},s}function u(e){return e&&"function"==typeof e.then}function s(t,n,r,i,a){return y(2,arguments),e(t,function(t){function u(e){E(e)}function s(e){p(e)}var c,l,f,h,d,p,E,y,_,v;if(_=t.length>>>0,c=Math.max(0,Math.min(n,_)),f=[],l=_-c+1,h=[],d=o(),c)for(y=d.progress,E=function(e){h.push(e),--l||(p=E=m,d.reject(h))},p=function(e){f.push(e),--c||(p=E=m,d.resolve(f))},v=0;v<_;++v)v in t&&e(t[v],s,u,y);else d.resolve(f);return d.then(r,i,a)})}function c(e,t,n,r){function i(e){return t?t(e[0]):e[0]}return s(e,1,i,n,r)}function l(e,t,n,r){return y(1,arguments),h(e,_).then(t,n,r)}function f(){return h(arguments,_)}function h(t,n){return e(t,function(t){var r,i,a,u,s,c;if(a=i=t.length>>>0,r=[],c=o(),a)for(u=function(t,i){e(t,n).then(function(e){r[i]=e,--a||c.resolve(r)},c.reject)},s=0;s<i;s++)s in t?u(t[s],s):--a;else c.resolve(r);return c.promise})}function d(t,n){var r=T.call(arguments,1);return e(t,function(t){var i;return i=t.length,r[0]=function(t,r,a){return e(t,function(t){return e(r,function(e){return n(t,e,a,i)})})},v.apply(t,r)})}function p(t,n,r){var i=arguments.length>2;return e(t,function(e){return e=i?r:e,n.resolve(e),e},function(e){return n.reject(e),a(e)},n.progress)}function E(e,t){for(var n,r=0;n=e[r++];)n(t)}function y(e,t){for(var n,r=t.length;r>e;)if(n=t[--r],null!=n&&"function"!=typeof n)throw new Error("arg "+r+" must be a function")}function m(){}function _(e){return e}var v,T,R;return e.defer=o,e.resolve=t,e.reject=n,e.join=f,e.all=l,e.map=h,e.reduce=d,e.any=c,e.some=s,e.chain=p,e.isPromise=u,r.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(R,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return l(t,function(t){return e.apply(R,t)})})}},T=[].slice,v=[].reduce||function(e){var t,n,r,i,a;if(a=0,t=Object(this),i=t.length>>>0,n=arguments,n.length<=1)for(;;){if(a in t){r=t[a++];break}if(++a>=i)throw new TypeError}else r=n[1];for(;a<i;++a)a in t&&(r=e(r,t[a],a,t));return r},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/binarySearch",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e,t,n){for(var r,i,a=0,o=e.length-1;a<=o;)if(r=~~((a+o)/2),i=n(e[r],t),i<0)a=r+1;else{if(!(i>0))return r;o=r-1}return~(o+1)}return n}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,n,r,i){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=r,this.ut1MinusUtc=i}return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,n=0,r=t[n++],i=function(e,t,n,r){n||(n=" ");var i=e.length>=t?"":Array(1+t-e.length>>>0).join(n);return r?e+i:i+e},a=function(e,t,n,r,a,o){var u=r-e.length;return u>0&&(e=n||!a?i(e,r,o,n):e.slice(0,t.length)+i("",u,"0",!0)+e.slice(t.length)),e},o=function(e,t,n,r,o,u,s){var c=e>>>0;return n=n&&c&&{2:"0b",8:"0",16:"0x"}[t]||"",e=n+i(c.toString(t),u||0,"0",!1),a(e,n,r,o,s)},u=function(e,t,n,r,i,o){return null!=r&&(e=e.slice(0,r)),a(e,"",t,n,i,o)},s=function(e,r,s,c,l,f,h){var d,p,E,y,m;if("%%"==e)return"%";for(var _=!1,v="",T=!1,R=!1,A=" ",S=s.length,g=0;s&&g<S;g++)switch(s.charAt(g)){case" ":v=" ";break;case"+":v="+";break;case"-":_=!0;break;case"'":A=s.charAt(g+1);break;case"0":T=!0;break;case"#":R=!0}if(c=c?"*"==c?+t[n++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,c<0&&(c=-c,_=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(f=f?"*"==f?+t[n++]:"*"==f.charAt(0)?+t[f.slice(1,-1)]:+f:"fFeE".indexOf(h)>-1?6:"d"==h?0:void 0,m=r?t[r.slice(0,-1)]:t[n++],h){case"s":return u(String(m),_,c,f,T,A);case"c":return u(String.fromCharCode(+m),_,c,f,T);case"b":return o(m,2,R,_,c,f,T);case"o":return o(m,8,R,_,c,f,T);case"x":return o(m,16,R,_,c,f,T);case"X":return o(m,16,R,_,c,f,T).toUpperCase();case"u":return o(m,10,R,_,c,f,T);case"i":case"d":return d=+m||0,d=Math.round(d-d%1),p=d<0?"-":v,m=p+i(String(Math.abs(d)),f,"0",!1),a(m,p,_,c,T);case"e":case"E":case"f":case"F":case"g":case"G":return d=+m,p=d<0?"-":v,E=["toExponential","toFixed","toPrecision"]["efg".indexOf(h.toLowerCase())],y=["toString","toUpperCase"]["eEfFgG".indexOf(h)%2],m=p+Math.abs(d)[E](f),a(m,p,_,c,T)[y]();default:return e}};return r.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,n,r,i,a,o,u){this.year=e,this.month=t,this.day=n,this.hour=r,this.minute=i,this.second=a,this.millisecond=o,this.isLeapSecond=u}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e(t)}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,n,r,i,a,o,u,s,c){"use strict";function l(e,t){return E.compare(e.julianDate,t.julianDate)}function f(e){v.julianDate=e;var n=E.leapSeconds,r=t(n,v,l);r<0&&(r=~r),r>=n.length&&(r=n.length-1);var i=n[r].offset;if(r>0){var a=E.secondsDifference(n[r].julianDate,e);a>i&&(r--,i=n[r].offset)}E.addSeconds(e,i,e)}function h(e,n){v.julianDate=e;var r=E.leapSeconds,i=t(r,v,l);if(i<0&&(i=~i),0===i)return E.addSeconds(e,-r[0].offset,n);if(i>=r.length)return E.addSeconds(e,-r[i-1].offset,n);var a=E.secondsDifference(r[i].julianDate,e);return 0===a?E.addSeconds(e,-r[i].offset,n):a<=1?void 0:E.addSeconds(e,-r[--i].offset,n)}function d(e,t,n){var r=t/s.SECONDS_PER_DAY|0;return e+=r,t-=s.SECONDS_PER_DAY*r,t<0&&(e--,t+=s.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function p(e,t,n,r,i,a,o){var u=(t-14)/12|0,c=e+4800+u,l=(1461*c/4|0)+(367*(t-2-12*u)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;r-=12,r<0&&(r+=24);var f=a+(r*s.SECONDS_PER_HOUR+i*s.SECONDS_PER_MINUTE+o*s.SECONDS_PER_MILLISECOND);return f>=43200&&(l-=1),[l,f]}function E(e,t,r){this.dayNumber=void 0,this.secondsOfDay=void 0,e=n(e,0),t=n(t,0),r=n(r,c.UTC);var i=0|e;t+=(e-i)*s.SECONDS_PER_DAY,d(i,t,this),r===c.UTC&&f(this)}var y=new a,m=[31,28,31,30,31,30,31,31,30,31,30,31],_=29,v=new u,T=/^(\d{4})$/,R=/^(\d{4})-(\d{2})$/,A=/^(\d{4})-?(\d{3})$/,S=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,g=/^(\d{4})-?(\d{2})-?(\d{2})$/,N=/([Z+\-])?(\d{2})?:?(\d{2})?$/,x=/^(\d{2})(\.\d+)?/.source+N.source,I=/^(\d{2}):?(\d{2})(\.\d+)?/.source+N.source,O=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+N.source;E.fromDate=function(e,t){var n=p(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r(t)?(d(n[0],n[1],t),f(t),t):new E(n[0],n[1],c.UTC)},E.fromIso8601=function(e,t){e=e.replace(",",".");var n,i,a,u=e.split("T"),s=1,l=1,h=0,y=0,v=0,N=0,w=u[0],M=u[1];if(u=w.match(g),null!==u)n=+u[1],s=+u[2],l=+u[3];else if(u=w.match(R),null!==u)n=+u[1],s=+u[2];else if(u=w.match(T),null!==u)n=+u[1];else{var C;if(u=w.match(A),null!==u)n=+u[1],C=+u[2],a=o(n);else if(u=w.match(S),null!==u){n=+u[1];var P=+u[2],D=+u[3]||0,L=new Date(Date.UTC(n,0,4));C=7*P+D-L.getUTCDay()-3}i=new Date(Date.UTC(n,0,1)),i.setUTCDate(C),s=i.getUTCMonth()+1,l=i.getUTCDate()}a=o(n);var U;if(r(M)){u=M.match(O),null!==u?(h=+u[1],y=+u[2],v=+u[3],N=1e3*+(u[4]||0),U=5):(u=M.match(I),null!==u?(h=+u[1],y=+u[2],v=60*+(u[3]||0),U=4):(u=M.match(x),null!==u&&(h=+u[1],y=60*+(u[2]||0),U=3)));var b=u[U],z=+u[U+1],F=+(u[U+2]||0);switch(b){case"+":h-=z,y-=F;break;case"-":h+=z,y+=F;break;case"Z":break;default:y+=new Date(Date.UTC(n,s-1,l,h,y)).getTimezoneOffset()}}else y+=new Date(n,s-1,l).getTimezoneOffset();var B=60===v;for(B&&v--;y>=60;)y-=60,h++;for(;h>=24;)h-=24,l++;for(i=a&&2===s?_:m[s-1];l>i;)l-=i,s++,s>12&&(s-=12,n++),i=a&&2===s?_:m[s-1];for(;y<0;)y+=60,h--;for(;h<0;)h+=24,l--;for(;l<1;)s--,s<1&&(s+=12,n--),i=a&&2===s?_:m[s-1],l+=i;var G=p(n,s,l,h,y,v,N);return r(t)?(d(G[0],G[1],t),f(t)):t=new E(G[0],G[1],c.UTC),B&&E.addSeconds(t,1,t),t},E.now=function(e){return E.fromDate(new Date,e)};var w=new E(0,0,c.TAI);return E.toGregorianDate=function(e,t){var n=!1,i=h(e,w);r(i)||(E.addSeconds(e,-1,w),i=h(w,w),n=!0);var o=i.dayNumber,u=i.secondsOfDay;u>=43200&&(o+=1);var c=o+68569|0,l=4*c/146097|0;c=c-((146097*l+3)/4|0)|0;var f=4e3*(c+1)/1461001|0;c=c-(1461*f/4|0)+31|0;var d=80*c/2447|0,p=c-(2447*d/80|0)|0;c=d/11|0;var y=d+2-12*c|0,m=100*(l-49)+f+c|0,_=u/s.SECONDS_PER_HOUR|0,v=u-_*s.SECONDS_PER_HOUR,T=v/s.SECONDS_PER_MINUTE|0;v-=T*s.SECONDS_PER_MINUTE;var R=0|v,A=(v-R)/s.SECONDS_PER_MILLISECOND;return _+=12,_>23&&(_-=24),n&&(R+=1),r(t)?(t.year=m,t.month=y,t.day=p,t.hour=_,t.minute=T,t.second=R,t.millisecond=A,t.isLeapSecond=n,t):new a(m,y,p,_,T,R,A,n)},E.toDate=function(e){var t=E.toGregorianDate(e,y),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))},E.toIso8601=function(t,n){var i,a=E.toGregorianDate(t,a);return r(n)||0===a.millisecond?r(n)&&0!==n?(i=(.01*a.millisecond).toFixed(n).replace(".","").slice(0,n),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",a.year,a.month,a.day,a.hour,a.minute,a.second,i)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",a.year,a.month,a.day,a.hour,a.minute,a.second):(i=(.01*a.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",a.year,a.month,a.day,a.hour,a.minute,a.second,i))},E.clone=function(e,t){if(r(e))return r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new E(e.dayNumber,e.secondsOfDay,c.TAI)},E.compare=function(e,t){var n=e.dayNumber-t.dayNumber;return 0!==n?n:e.secondsOfDay-t.secondsOfDay},E.equals=function(e,t){return e===t||r(e)&&r(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},E.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(E.secondsDifference(e,t))<=n},E.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},E.secondsDifference=function(e,t){var n=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return n+(e.secondsOfDay-t.secondsOfDay)},E.daysDifference=function(e,t){var n=e.dayNumber-t.dayNumber,r=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return n+r},E.computeTaiMinusUtc=function(e){v.julianDate=e;var n=E.leapSeconds,r=t(n,v,l);return r<0&&(r=~r,--r,r<0&&(r=0)),n[r].offset},E.addSeconds=function(e,t,n){return d(e.dayNumber,e.secondsOfDay+t,n)},E.addMinutes=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return d(e.dayNumber,r,n)},E.addHours=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return d(e.dayNumber,r,n)},E.addDays=function(e,t,n){var r=e.dayNumber+t;return d(r,e.secondsOfDay,n)},E.lessThan=function(e,t){return E.compare(e,t)<0},E.lessThanOrEquals=function(e,t){return E.compare(e,t)<=0},E.greaterThan=function(e,t){return E.compare(e,t)>0},E.greaterThanOrEquals=function(e,t){return E.compare(e,t)>=0},E.prototype.clone=function(e){return E.clone(this,e)},E.prototype.equals=function(e){return E.equals(this,e)},E.prototype.equalsEpsilon=function(e,t){return E.equalsEpsilon(this,e,t)},E.prototype.toString=function(){return E.toIso8601(this)},E.leapSeconds=[new u(new E(2441317,43210,c.TAI),10),new u(new E(2441499,43211,c.TAI),11),new u(new E(2441683,43212,c.TAI),12),new u(new E(2442048,43213,c.TAI),13),new u(new E(2442413,43214,c.TAI),14),new u(new E(2442778,43215,c.TAI),15),new u(new E(2443144,43216,c.TAI),16),new u(new E(2443509,43217,c.TAI),17),new u(new E(2443874,43218,c.TAI),18),new u(new E(2444239,43219,c.TAI),19),new u(new E(2444786,43220,c.TAI),20),new u(new E(2445151,43221,c.TAI),21),new u(new E(2445516,43222,c.TAI),22),new u(new E(2446247,43223,c.TAI),23),new u(new E(2447161,43224,c.TAI),24),new u(new E(2447892,43225,c.TAI),25),new u(new E(2448257,43226,c.TAI),26),new u(new E(2448804,43227,c.TAI),27),new u(new E(2449169,43228,c.TAI),28),new u(new E(2449534,43229,c.TAI),29),new u(new E(2450083,43230,c.TAI),30),new u(new E(2450630,43231,c.TAI),31),new u(new E(2451179,43232,c.TAI),32),new u(new E(2453736,43233,c.TAI),33),new u(new E(2454832,43234,c.TAI),34),new u(new E(2456109,43235,c.TAI),35),new u(new E(2457204,43236,c.TAI),36),new u(new E(2457754,43237,c.TAI),37)],E}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(n,r){if(null===n||"object"!=typeof n)return n;r=e(r,!1);var i=new n.constructor;for(var a in n)if(n.hasOwnProperty(a)){var o=n[a];r&&(o=t(o,r)),i[a]=o}return i}return t}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var n=e.split("\r\n"),r=0;r<n.length;++r){var i=n[r],a=i.indexOf(": ");if(a>0){var o=i.substring(0,a),u=i.substring(a+2);t[o]=u}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function n(e,n,r){this.statusCode=e,this.response=n,this.responseHeaders=r,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return n.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},n}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var n=r.exec(t);this.scheme=n[1],this.authority=n[2],this.path=n[3],this.query=n[4],this.fragment=n[5]}}function t(e){var t=unescape(e);return a.test(t)?t:e.toUpperCase()}function n(e,t,n,r){return(t||"")+n.toLowerCase()+(r||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var r=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(o,n).replace(i,t)),this.path&&(this.path=this.path.replace(i,t)),this.query&&(this.query=this.query.replace(i,t)),this.fragment&&(this.fragment=this.fragment.replace(i,t))};var i=/%[0-9a-z]{2}/gi,a=/[a-zA-Z0-9\-\._~]/,o=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var n=new e;return this.scheme?(n.scheme=this.scheme,n.authority=this.authority,n.path=this.path,n.query=this.query):(n.scheme=t.scheme,this.authority?(n.authority=this.authority,n.path=this.path,n.query=this.query):(n.authority=t.authority,""==this.path?(n.path=t.path,n.query=this.query||t.query):("/"==this.path.charAt(0)?(n.path=this.path,n.removeDotSegments()):(t.authority&&""==t.path?n.path="/"+this.path:n.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,n.removeDotSegments()),n.query=this.query))),n.fragment=this.fragment,n},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),n=[],r=""==t[0];r&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?n.pop():"."!=e&&n.push(e);"."!=e&&".."!=e||n.push(""),r&&n.unshift(""),this.path=n.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n){var r=new e(n);r.normalize();var i=r.getAuthority();if(t(i)){if(i.indexOf("@")!==-1){var a=i.split("@");i=a[1]}if(i.indexOf(":")===-1){var o=r.getScheme();if(t(o)||(o=window.location.protocol,o=o.substring(0,o.length-1)),"http"===o)i+=":80";else{if("https"!==o)return;i+=":443"}}return i}}var i={},a={};return i.add=function(e,n){var r=e.toLowerCase()+":"+n;t(a[r])||(a[r]=!0)},i.remove=function(e,n){var r=e.toLowerCase()+":"+n;t(a[r])&&delete a[r]},i.contains=function(e){var n=r(e);return!(!t(n)||!t(a[n]))},i.clear=function(){a={}},i}),define("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,n,r,i,a,o){"use strict";function u(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,i=t(n.method,"GET"),a=n.data,o=n.headers,s=n.overrideMimeType;return e(n.url,function(t){var n=e.defer();return u.load(t,r,i,a,o,n,s),n.promise})}function s(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function c(e,t){for(var n=s(e,t),r=new ArrayBuffer(n.length),i=new Uint8Array(r),a=0;a<n.length;a++)i[a]=n.charCodeAt(a);return r}function l(e,n){n=t(n,"");var r=e[1],i=!!e[2],a=e[3];switch(n){case"":case"text":return s(i,a);case"arraybuffer":return c(i,a);case"blob":var o=c(i,a);return new Blob([o],{type:r});case"document":var u=new DOMParser;return u.parseFromString(s(i,a),r);case"json":return JSON.parse(s(i,a))}}var f=/^data:(.*?)(;base64)?,(.*)$/;return u.load=function(e,t,r,u,s,c,h){var d=f.exec(e);if(null!==d)return void c.resolve(l(d,t));var p=new XMLHttpRequest;if(o.contains(e)&&(p.withCredentials=!0),n(h)&&n(p.overrideMimeType)&&p.overrideMimeType(h),p.open(r,e,!0),n(s))for(var E in s)s.hasOwnProperty(E)&&p.setRequestHeader(E,s[E]);n(t)&&(p.responseType=t),p.onload=function(){if(p.status<200||p.status>=300)return void c.reject(new i(p.status,p.response,p.getAllResponseHeaders()));var e=p.response,r=p.responseType;if(!n(e)||n(t)&&r!==t)if("json"===t&&"string"==typeof e)try{c.resolve(JSON.parse(e))}catch(e){c.reject(e)}else(""===r||"document"===r)&&n(p.responseXML)&&p.responseXML.hasChildNodes()?c.resolve(p.responseXML):""!==r&&"text"!==r||!n(p.responseText)?c.reject(new a("Invalid XMLHttpRequest response type.")):c.resolve(p.responseText);else c.resolve(e)},p.onerror=function(e){c.reject(new i)},p.send(u)},u.defaultLoad=u.load,u}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,n){return e({url:t,headers:n})}return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";function i(n,i){return t(i)?t(i.Accept)||(i=e(i),i.Accept=a.Accept):i=a,r(n,i).then(function(e){return JSON.parse(e)})}var a={Accept:"application/json,*/*;q=0.01"};return i}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,n,r,i,a,o,u,s,c,l,f){"use strict";function h(t){if(t=n(t,n.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=n(t.addNewLeapSeconds,!0),r(t.data))p(this,t.data);else if(r(t.url)){var i=this;this._downloadPromise=e(s(t.url),function(e){p(i,e)},function(){i._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else p(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function d(e,t){return o.compare(e.julianDate,t)}function p(e,n){if(!r(n.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!r(n.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var i=n.columnNames.indexOf("modifiedJulianDateUtc"),a=n.columnNames.indexOf("xPoleWanderRadians"),s=n.columnNames.indexOf("yPoleWanderRadians"),c=n.columnNames.indexOf("ut1MinusUtcSeconds"),h=n.columnNames.indexOf("xCelestialPoleOffsetRadians"),p=n.columnNames.indexOf("yCelestialPoleOffsetRadians"),E=n.columnNames.indexOf("taiMinusUtcSeconds");if(i<0||a<0||s<0||c<0||h<0||p<0||E<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var y=e._samples=n.samples,m=e._dates=[];e._dateColumn=i,e._xPoleWanderRadiansColumn=a,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=h,e._yCelestialPoleOffsetRadiansColumn=p,e._taiMinusUtcSecondsColumn=E,e._columnCount=n.columnNames.length,e._lastIndex=void 0;for(var _,v=e._addNewLeapSeconds,T=0,R=y.length;T<R;T+=e._columnCount){var A=y[T+i],S=y[T+E],g=A+l.MODIFIED_JULIAN_DATE_DIFFERENCE,N=new o(g,S,f.TAI);if(m.push(N),v){if(S!==_&&r(_)){var x=o.leapSeconds,I=t(x,N,d);if(I<0){var O=new u(N,S);x.splice(~I,0,O)}}_=S}}}function E(e,t,n,r,i){var a=n*r;i.xPoleWander=t[a+e._xPoleWanderRadiansColumn],i.yPoleWander=t[a+e._yPoleWanderRadiansColumn],i.xPoleOffset=t[a+e._xCelestialPoleOffsetRadiansColumn],i.yPoleOffset=t[a+e._yCelestialPoleOffsetRadiansColumn],i.ut1MinusUtc=t[a+e._ut1MinusUtcSecondsColumn]}function y(e,t,n){return t+e*(n-t)}function m(e,t,n,r,i,a,u){var s=e._columnCount;if(a>t.length-1)return u.xPoleWander=0,u.yPoleWander=0,u.xPoleOffset=0,u.yPoleOffset=0,u.ut1MinusUtc=0,u;var c=t[i],l=t[a];if(c.equals(l)||r.equals(c))return E(e,n,i,s,u),u;if(r.equals(l))return E(e,n,a,s,u),u;var f=o.secondsDifference(r,c)/o.secondsDifference(l,c),h=i*s,d=a*s,p=n[h+e._ut1MinusUtcSecondsColumn],m=n[d+e._ut1MinusUtcSecondsColumn],_=m-p;if(_>.5||_<-.5){var v=n[h+e._taiMinusUtcSecondsColumn],T=n[d+e._taiMinusUtcSecondsColumn];v!==T&&(l.equals(r)?p=m:m-=T-v)}return u.xPoleWander=y(f,n[h+e._xPoleWanderRadiansColumn],n[d+e._xPoleWanderRadiansColumn]),u.yPoleWander=y(f,n[h+e._yPoleWanderRadiansColumn],n[d+e._yPoleWanderRadiansColumn]),u.xPoleOffset=y(f,n[h+e._xCelestialPoleOffsetRadiansColumn],n[d+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=y(f,n[h+e._yCelestialPoleOffsetRadiansColumn],n[d+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=y(f,p,m),u}return h.NONE=a({getPromiseToLoad:function(){return e()},compute:function(e,t){return r(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new i(0,0,0,0,0),t}}),h.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},h.prototype.compute=function(e,n){if(r(this._samples)){if(r(n)||(n=new i(0,0,0,0,0)),0===this._samples.length)return n.xPoleWander=0,n.yPoleWander=0,n.xPoleOffset=0,n.yPoleOffset=0,n.ut1MinusUtc=0,n;var a=this._dates,u=this._lastIndex,s=0,l=0;if(r(u)){var f=a[u],h=a[u+1],d=o.lessThanOrEquals(f,e),p=!r(h),E=p||o.greaterThanOrEquals(h,e);if(d&&E)return s=u,!p&&h.equals(e)&&++s,l=s+1,m(this,a,this._samples,e,s,l,n),n}var y=t(a,e,o.compare,this._dateColumn);return y>=0?(y<a.length-1&&a[y+1].equals(e)&&++y,s=y,l=y):(l=~y,s=l-1,s<0&&(s=0)),this._lastIndex=s,m(this,a,this._samples,e,s,l,n),n}if(r(this._dataError))throw new c(this._dataError)},h}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function i(t,n,r){this.heading=e(t,0),this.pitch=e(n,0),this.roll=e(r,0)}return i.fromQuaternion=function(e,n){t(n)||(n=new i);var r=2*(e.w*e.y-e.z*e.x),a=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return n.heading=-Math.atan2(s,u),n.roll=Math.atan2(o,a),n.pitch=-Math.asin(r),n},i.fromDegrees=function(e,n,a,o){return t(o)||(o=new i),o.heading=e*r.RADIANS_PER_DEGREE,o.pitch=n*r.RADIANS_PER_DEGREE,o.roll=a*r.RADIANS_PER_DEGREE,o},i.clone=function(e,n){if(t(e))return t(n)?(n.heading=e.heading,n.pitch=e.pitch,n.roll=e.roll,n):new i(e.heading,e.pitch,e.roll)},i.equals=function(e,n){return e===n||t(e)&&t(n)&&e.heading===n.heading&&e.pitch===n.pitch&&e.roll===n.roll},i.equalsEpsilon=function(e,n,i,a){return e===n||t(e)&&t(n)&&r.equalsEpsilon(e.heading,n.heading,i,a)&&r.equalsEpsilon(e.pitch,n.pitch,i,a)&&r.equalsEpsilon(e.roll,n.roll,i,a)},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i.prototype.equalsEpsilon=function(e,t,n){return i.equalsEpsilon(this,e,t,n)},i.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},i}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function i(n,r){r=t(r,document.location.href);var i=new e(r),a=new e(n);return a.resolve(i).toString()}return i}),define("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function i(r,i,a){a=t(a,!0),r instanceof e||(r=new e(r)),i instanceof e||(i=new e(i)),n(i.authority)&&!n(i.scheme)&&("undefined"!=typeof document&&n(document.location)&&n(document.location.href)?i.scheme=new e(document.location.href).scheme:i.scheme=r.scheme);var o=r;i.isAbsolute()&&(o=i);var u="";n(o.scheme)&&(u+=o.scheme+":"),n(o.authority)&&(u+="//"+o.authority,""!==o.path&&"/"!==o.path&&(u=u.replace(/\/?$/,"/"),o.path=o.path.replace(/^\/?/g,""))),u+=o===r?a?r.path.replace(/\/?$/,"/")+i.path.replace(/^\/?/g,""):r.path+i.path:i.path;var s=n(r.query),c=n(i.query);s&&c?u+="?"+r.query+"&"+i.query:s&&!c?u+="?"+r.query:!s&&c&&(u+="?"+i.query);var l=n(i.fragment);return n(r.fragment)&&!l?u+="#"+r.fragment:l&&(u+="#"+i.fragment),u}return i}),define("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","./joinUrls","require"],function(e,t,n,r,i,a){"use strict";function o(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;t<n;++t){var r=e[t].getAttribute("src"),i=p.exec(r);if(null!==i)return i[1]}}function u(){if(t(f))return f;var n;return n="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:o(),f=new e(r(n))}function s(e){return a.toUrl("../"+e)}function c(e){return i(u(),e)}function l(e){t(h)||(h=t(a.toUrl)?s:c),t(d)||(d=document.createElement("a"));var n=h(e);return d.href=n,d.href=d.href,d.href}var f,h,d,p=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return l._cesiumScriptRegex=p,l.setBaseUrl=function(t){f=new e(t).resolve(new e(document.location.href))},l}),define("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,n){this.x=e,this.y=t,this.s=n}return e}),define("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,n,r,i,a,o,u){"use strict";function s(e){e=n(e,n.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=n(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=n(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new a(this._sampleZeroJulianEphemerisDate,0,u.TAI),this._stepSizeDays=n(e.stepSizeDays,1),this._samplesPerXysFile=n(e.samplesPerXysFile,1e3),this._totalSamples=n(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,r=this._denominators=new Array(t+1),i=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t),s=0;s<=t;++s){r[s]=o,i[s]=s*this._stepSizeDays;for(var c=0;c<=t;++c)c!==s&&(r[s]*=s-c);r[s]=1/r[s]}this._work=new Array(t+1),this._coef=new Array(t+1)}function c(e,t,n){var r=f;return r.dayNumber=t,r.secondsOfDay=n,a.daysDifference(r,e._sampleZeroDateTT)}function l(n,i){if(n._chunkDownloadsInProgress[i])return n._chunkDownloadsInProgress[i];var a=e.defer();n._chunkDownloadsInProgress[i]=a; +var u,s=n._xysFileUrlTemplate;return u=r(s)?s.replace("{0}",i):t("Assets/IAU2006_XYS/IAU2006_XYS_"+i+".json"),e(o(u),function(e){n._chunkDownloadsInProgress[i]=!1;for(var t=n._samples,r=e.samples,o=i*n._samplesPerXysFile*3,u=0,s=r.length;u<s;++u)t[o+u]=r[u];a.resolve()}),a.promise}var f=new a(0,0,u.TAI);return s.prototype.preload=function(t,n,r,i){var a=c(this,t,n),o=c(this,r,i),u=a/this._stepSizeDays-this._interpolationOrder/2|0;u<0&&(u=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var f=u/this._samplesPerXysFile|0,h=s/this._samplesPerXysFile|0,d=[],p=f;p<=h;++p)d.push(l(this,p));return e.all(d)},s.prototype.computeXysRadians=function(e,t,n){var a=c(this,e,t);if(!(a<0)){var o=a/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);s<0&&(s=0);var f=s+u;f>=this._totalSamples&&(f=this._totalSamples-1,s=f-u,s<0&&(s=0));var h=!1,d=this._samples;if(r(d[3*s])||(l(this,s/this._samplesPerXysFile|0),h=!0),r(d[3*f])||(l(this,f/this._samplesPerXysFile|0),h=!0),!h){r(n)?(n.x=0,n.y=0,n.s=0):n=new i(0,0,0);var p,E,y=a-s*this._stepSizeDays,m=this._work,_=this._denominators,v=this._coef,T=this._xTable;for(p=0;p<=u;++p)m[p]=y-T[p];for(p=0;p<=u;++p){for(v[p]=1,E=0;E<=u;++E)E!==p&&(v[p]*=m[E]);v[p]*=_[p];var R=3*(s+p);n.x+=v[p]*d[R++],n.y+=v[p]*d[R++],n.s+=v[p]*d[R]}return n}}}},s}),define("Core/Quaternion",["./Cartesian3","./Check","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math","./Matrix3"],function(e,t,n,r,i,a,o,u,s){"use strict";function c(e,t,r,i){this.x=n(e,0),this.y=n(t,0),this.z=n(r,0),this.w=n(i,0)}var l=new e;c.fromAxisAngle=function(t,n,i){var a=n/2,o=Math.sin(a);l=e.normalize(t,l);var u=l.x*o,s=l.y*o,f=l.z*o,h=Math.cos(a);return r(i)?(i.x=u,i.y=s,i.z=f,i.w=h,i):new c(u,s,f,h)};var f=[1,2,0],h=new Array(3);c.fromRotationMatrix=function(e,t){var n,i,a,o,u,l=e[s.COLUMN0ROW0],d=e[s.COLUMN1ROW1],p=e[s.COLUMN2ROW2],E=l+d+p;if(E>0)n=Math.sqrt(E+1),u=.5*n,n=.5/n,i=(e[s.COLUMN1ROW2]-e[s.COLUMN2ROW1])*n,a=(e[s.COLUMN2ROW0]-e[s.COLUMN0ROW2])*n,o=(e[s.COLUMN0ROW1]-e[s.COLUMN1ROW0])*n;else{var y=f,m=0;d>l&&(m=1),p>l&&p>d&&(m=2);var _=y[m],v=y[_];n=Math.sqrt(e[s.getElementIndex(m,m)]-e[s.getElementIndex(_,_)]-e[s.getElementIndex(v,v)]+1);var T=h;T[m]=.5*n,n=.5/n,u=(e[s.getElementIndex(v,_)]-e[s.getElementIndex(_,v)])*n,T[_]=(e[s.getElementIndex(_,m)]+e[s.getElementIndex(m,_)])*n,T[v]=(e[s.getElementIndex(v,m)]+e[s.getElementIndex(m,v)])*n,i=-T[0],a=-T[1],o=-T[2]}return r(t)?(t.x=i,t.y=a,t.z=o,t.w=u,t):new c(i,a,o,u)};var d=new c;c.fromHeadingPitchRoll=function(t,n,r,i){var a=c.fromAxisAngle(e.UNIT_X,r,d),o=c.fromAxisAngle(e.UNIT_Y,-n,i);i=c.multiply(o,a,o);var u=c.fromAxisAngle(e.UNIT_Z,-t,d);return c.multiply(u,i,i)};var p=new e,E=new e,y=new c,m=new c,_=new c;c.packedLength=4,c.pack=function(e,t,r){return r=n(r,0),t[r++]=e.x,t[r++]=e.y,t[r++]=e.z,t[r]=e.w,t},c.unpack=function(e,t,i){return t=n(t,0),r(i)||(i=new c),i.x=e[t],i.y=e[t+1],i.z=e[t+2],i.w=e[t+3],i},c.packedInterpolationLength=3,c.convertPackedArrayForInterpolation=function(e,t,n,r){c.unpack(e,4*n,_),c.conjugate(_,_);for(var i=0,a=n-t+1;i<a;i++){var o=3*i;c.unpack(e,4*(t+i),y),c.multiply(y,_,y),y.w<0&&c.negate(y,y),c.computeAxis(y,p);var u=c.computeAngle(y);r[o]=p.x*u,r[o+1]=p.y*u,r[o+2]=p.z*u}},c.unpackInterpolationResult=function(t,n,i,a,o){r(o)||(o=new c),e.fromArray(t,0,E);var u=e.magnitude(E);return c.unpack(n,4*a,m),0===u?c.clone(c.IDENTITY,y):c.fromAxisAngle(E,u,y),c.multiply(y,m,o)},c.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new c(e.x,e.y,e.z,e.w)},c.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},c.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},c.magnitude=function(e){return Math.sqrt(c.magnitudeSquared(e))},c.normalize=function(e,t){var n=1/c.magnitude(e),r=e.x*n,i=e.y*n,a=e.z*n,o=e.w*n;return t.x=r,t.y=i,t.z=a,t.w=o,t},c.inverse=function(e,t){var n=c.magnitudeSquared(e);return t=c.conjugate(e,t),c.multiplyByScalar(t,1/n,t)},c.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},c.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},c.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},c.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},c.multiply=function(e,t,n){var r=e.x,i=e.y,a=e.z,o=e.w,u=t.x,s=t.y,c=t.z,l=t.w,f=o*u+r*l+i*c-a*s,h=o*s-r*c+i*l+a*u,d=o*c+r*s-i*u+a*l,p=o*l-r*u-i*s-a*c;return n.x=f,n.y=h,n.z=d,n.w=p,n},c.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},c.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},c.computeAxis=function(e,t){var n=e.w;if(Math.abs(n-1)<u.EPSILON6)return t.x=t.y=t.z=0,t;var r=1/Math.sqrt(1-n*n);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},c.computeAngle=function(e){return Math.abs(e.w-1)<u.EPSILON6?0:2*Math.acos(e.w)};var v=new c;c.lerp=function(e,t,n,r){return v=c.multiplyByScalar(t,n,v),r=c.multiplyByScalar(e,1-n,r),c.add(v,r,r)};var T=new c,R=new c,A=new c;c.slerp=function(e,t,n,r){var i=c.dot(e,t),a=t;if(i<0&&(i=-i,a=T=c.negate(t,T)),1-i<u.EPSILON6)return c.lerp(e,a,n,r);var o=Math.acos(i);return R=c.multiplyByScalar(e,Math.sin((1-n)*o),R),A=c.multiplyByScalar(a,Math.sin(n*o),A),r=c.add(R,A,r),c.multiplyByScalar(r,1/Math.sin(o),r)},c.log=function(t,n){var r=u.acosClamped(t.w),i=0;return 0!==r&&(i=r/Math.sin(r)),e.multiplyByScalar(t,i,n)},c.exp=function(t,n){var r=e.magnitude(t),i=0;return 0!==r&&(i=Math.sin(r)/r),n.x=t.x*i,n.y=t.y*i,n.z=t.z*i,n.w=Math.cos(r),n};var S=new e,g=new e,N=new c,x=new c;c.computeInnerQuadrangle=function(t,n,r,i){var a=c.conjugate(n,N);c.multiply(a,r,x);var o=c.log(x,S);c.multiply(a,t,x);var u=c.log(x,g);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),c.exp(o,N),c.multiply(n,N,i)},c.squad=function(e,t,n,r,i,a){var o=c.slerp(e,t,i,N),u=c.slerp(n,r,i,x);return c.slerp(o,u,2*i*(1-i),a)};for(var I=new c,O=1.9011074535173003,w=a.supportsTypedArrays()?new Float32Array(8):[],M=a.supportsTypedArrays()?new Float32Array(8):[],C=a.supportsTypedArrays()?new Float32Array(8):[],P=a.supportsTypedArrays()?new Float32Array(8):[],D=0;D<7;++D){var L=D+1,U=2*L+1;w[D]=1/(L*U),M[D]=L/U}return w[7]=O/136,M[7]=8*O/17,c.fastSlerp=function(e,t,n,r){var i,a=c.dot(e,t);a>=0?i=1:(i=-1,a=-a);for(var o=a-1,u=1-n,s=n*n,l=u*u,f=7;f>=0;--f)C[f]=(w[f]*s-M[f])*o,P[f]=(w[f]*l-M[f])*o;var h=i*n*(1+C[0]*(1+C[1]*(1+C[2]*(1+C[3]*(1+C[4]*(1+C[5]*(1+C[6]*(1+C[7])))))))),d=u*(1+P[0]*(1+P[1]*(1+P[2]*(1+P[3]*(1+P[4]*(1+P[5]*(1+P[6]*(1+P[7])))))))),p=c.multiplyByScalar(e,d,I);return c.multiplyByScalar(t,h,r),c.add(p,r,r)},c.fastSquad=function(e,t,n,r,i,a){var o=c.fastSlerp(e,t,i,N),u=c.fastSlerp(n,r,i,x);return c.fastSlerp(o,u,2*i*(1-i),a)},c.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},c.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n},c.ZERO=o(new c(0,0,0,0)),c.IDENTITY=o(new c(0,0,0,1)),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.x+", "+this.y+", "+this.z+", "+this.w+")"},c}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./Check","./defaultValue","./defined","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./HeadingPitchRoll","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,n,r,i,a,o,u,s,c,l,f,h,d,p,E,y,m,_,v,T){"use strict";var R={},A=new n,S=new n,g=new n;R.eastNorthUpToFixedFrame=function(e,t,r){if(y.equalsEpsilon(e.x,0,y.EPSILON14)&&y.equalsEpsilon(e.y,0,y.EPSILON14)){var i=y.sign(e.z);return u(r)?(r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=-i,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=i,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(0,-i,0,e.x,1,0,0,e.y,0,0,i,e.z,0,0,0,1)}var a=A,s=S,c=g;return t=o(t,f.WGS84),t.geodeticSurfaceNormal(e,a),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(a,s,c),u(r)?(r[0]=s.x,r[1]=s.y,r[2]=s.z,r[3]=0,r[4]=c.x,r[5]=c.y,r[6]=c.z,r[7]=0,r[8]=a.x,r[9]=a.y,r[10]=a.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(s.x,c.x,a.x,e.x,s.y,c.y,a.y,e.y,s.z,c.z,a.z,e.z,0,0,0,1)};var N=new n,x=new n,I=new n;R.northEastDownToFixedFrame=function(e,t,r){if(y.equalsEpsilon(e.x,0,y.EPSILON14)&&y.equalsEpsilon(e.y,0,y.EPSILON14)){var i=y.sign(e.z);return u(r)?(r[0]=-i,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=-i,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(-i,0,0,e.x,0,1,0,e.y,0,0,-i,e.z,0,0,0,1)}var a=N,s=x,c=I;return t=o(t,f.WGS84),t.geodeticSurfaceNormal(e,a),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(a,s,c),u(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=s.x,r[5]=s.y,r[6]=s.z,r[7]=0,r[8]=-a.x,r[9]=-a.y,r[10]=-a.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(c.x,s.x,-a.x,e.x,c.y,s.y,-a.y,e.y,c.z,s.z,-a.z,e.z,0,0,0,1)},R.northUpEastToFixedFrame=function(e,t,r){if(y.equalsEpsilon(e.x,0,y.EPSILON14)&&y.equalsEpsilon(e.y,0,y.EPSILON14)){var i=y.sign(e.z);return u(r)?(r[0]=-i,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=i,r[7]=0,r[8]=0,r[9]=1,r[10]=0,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(-i,0,0,e.x,0,0,1,e.y,0,i,0,e.z,0,0,0,1)}var a=A,s=S,c=g;return t=o(t,f.WGS84),t.geodeticSurfaceNormal(e,a),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(a,s,c),u(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=a.x,r[5]=a.y,r[6]=a.z,r[7]=0,r[8]=s.x,r[9]=s.y,r[10]=s.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(c.x,a.x,s.x,e.x,c.y,a.y,s.y,e.y,c.z,a.z,s.z,e.z,0,0,0,1)},R.northWestUpToFixedFrame=function(e,t,r){if(y.equalsEpsilon(e.x,0,y.EPSILON14)&&y.equalsEpsilon(e.y,0,y.EPSILON14)){var i=y.sign(e.z);return u(r)?(r[0]=-i,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=i,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(-i,0,0,e.x,0,-1,0,e.y,0,0,i,e.z,0,0,0,1)}var a=A,s=S,c=g;return t=o(t,f.WGS84),t.geodeticSurfaceNormal(e,a),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(a,s,c),u(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=-s.x,r[5]=-s.y,r[6]=-s.z,r[7]=0,r[8]=a.x,r[9]=a.y,r[10]=a.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(c.x,-s.x,a.x,e.x,c.y,-s.y,a.y,e.y,c.z,-s.z,a.z,e.z,0,0,0,1)};var O=new v,w=new n(1,1,1),M=new _;R.headingPitchRollToFixedFrame=function(e,t,r,i){a.typeOf.object("headingPitchRoll",t);var o=t.heading,u=t.pitch,s=t.roll,c=v.fromHeadingPitchRoll(o,u,s,O),l=_.fromTranslationQuaternionRotationScale(n.ZERO,c,w,M);return i=R.eastNorthUpToFixedFrame(e,r,i),_.multiply(i,l,i)};var C=new _,P=new m;R.headingPitchRollQuaternion=function(e,t,n,r){a.typeOf.object("headingPitchRoll",t);var i=R.headingPitchRollToFixedFrame(e,t,n,C),o=_.getRotation(i,P);return v.fromRotationMatrix(o,r)};var D=24110.54841,L=8640184.812866,U=.093104,b=-62e-7,z=1.1772758384668e-19,F=72921158553e-15,B=y.TWO_PI/86400,G=new E;R.computeTemeToPseudoFixedMatrix=function(e,t){G=E.addSeconds(e,-E.computeTaiMinusUtc(e),G);var n,r=G.dayNumber,i=G.secondsOfDay,a=r-2451545;n=i>=43200?(a+.5)/T.DAYS_PER_JULIAN_CENTURY:(a-.5)/T.DAYS_PER_JULIAN_CENTURY;var o=D+n*(L+n*(U+n*b)),s=o*B%y.TWO_PI,c=F+z*(r-2451545.5),l=(i+.5*T.SECONDS_PER_DAY)%T.SECONDS_PER_DAY,f=s+c*l,h=Math.cos(f),d=Math.sin(f);return u(t)?(t[0]=h,t[1]=-d,t[2]=0,t[3]=d,t[4]=h,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new m(h,d,0,-d,h,0,0,0,1)},R.iau2006XysData=new d,R.earthOrientationParameters=c.NONE;var q=32.184,W=2451545;R.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+q,i=t.stop.dayNumber,a=t.stop.secondsOfDay+q,o=R.iau2006XysData.preload(n,r,i,a),u=R.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},R.computeIcrfToFixedMatrix=function(e,t){u(t)||(t=new m);var n=R.computeFixedToIcrfMatrix(e,t);if(u(n))return m.transpose(n,t)};var X=new p(0,0,0),H=new l(0,0,0,0,0,0),V=new m,Y=new m;R.computeFixedToIcrfMatrix=function(e,t){u(t)||(t=new m);var n=R.earthOrientationParameters.compute(e,H);if(u(n)){var r=e.dayNumber,i=e.secondsOfDay+q,a=R.iau2006XysData.computeXysRadians(r,i,X);if(u(a)){var o=a.x+n.xPoleOffset,s=a.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-o*o-s*s)),l=V;l[0]=1-c*o*o,l[3]=-c*o*s,l[6]=o,l[1]=-c*o*s,l[4]=1-c*s*s,l[7]=s,l[2]=-o,l[5]=-s,l[8]=1-c*(o*o+s*s);var f=m.fromRotationZ(-a.s,Y),h=m.multiply(l,f,V),d=e.dayNumber,p=e.secondsOfDay-E.computeTaiMinusUtc(e)+n.ut1MinusUtc,_=d-2451545,v=p/T.SECONDS_PER_DAY,A=.779057273264+v+.00273781191135448*(_+v);A=A%1*y.TWO_PI;var S=m.fromRotationZ(A,Y),g=m.multiply(h,S,V),N=Math.cos(n.xPoleWander),x=Math.cos(n.yPoleWander),I=Math.sin(n.xPoleWander),O=Math.sin(n.yPoleWander),w=r-W+i/T.SECONDS_PER_DAY;w/=36525;var M=-47e-6*w*y.RADIANS_PER_DEGREE/3600,C=Math.cos(M),P=Math.sin(M),D=Y;return D[0]=N*C,D[1]=N*P,D[2]=I,D[3]=-x*P+O*I*C,D[4]=x*C+O*I*P,D[5]=-O*N,D[6]=-O*P-x*I*C,D[7]=O*C-x*I*P,D[8]=x*N,m.multiply(g,D,t)}}};var k=new r;R.pointToWindowCoordinates=function(e,t,n,r){return r=R.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},R.pointToGLWindowCoordinates=function(e,n,i,a){u(a)||(a=new t);var o=k;return _.multiplyByVector(e,r.fromElements(i.x,i.y,i.z,1,o),o),r.multiplyByScalar(o,1/o.w,o),_.multiplyByVector(n,o,o),t.fromCartesian4(o,a)};var Z=new n,j=new n,K=new n;R.rotationMatrixFromPositionVelocity=function(e,t,r,i){var a=o(r,f.WGS84).geodeticSurfaceNormal(e,Z),s=n.cross(t,a,j);n.equalsEpsilon(s,n.ZERO,y.EPSILON6)&&(s=n.clone(n.UNIT_X,s));var c=n.cross(s,t,K);return n.cross(t,c,s),n.negate(s,s),u(i)||(i=new m),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=s.x,i[4]=s.y,i[5]=s.z,i[6]=c.x,i[7]=c.y,i[8]=c.z,i};var J=new i,Q=new n,$=new n,ee=new r,te=new r,ne=new r,re=new r,ie=new r,ae=new _,oe=new _;R.basisTo2D=function(e,t,i){var a=e.ellipsoid,o=_.getColumn(t,3,ee),u=a.cartesianToCartographic(o,J),s=R.eastNorthUpToFixedFrame(o,a,ae),c=_.inverseTransformation(s,oe),l=e.project(u,Q),f=te;f.x=l.z,f.y=l.x,f.z=l.y,f.w=1;var h=_.getColumn(t,0,$),d=n.magnitude(h),p=_.multiplyByVector(c,h,ne);r.fromElements(p.z,p.x,p.y,0,p);var E=_.getColumn(t,1,$),y=n.magnitude(E),m=_.multiplyByVector(c,E,re);r.fromElements(m.z,m.x,m.y,0,m);var v=_.getColumn(t,2,$),T=n.magnitude(v),A=ie;return n.cross(p,m,A),n.normalize(A,A),n.cross(m,A,p),n.normalize(p,p),n.cross(A,p,m),n.normalize(m,m),n.multiplyByScalar(p,d,p),n.multiplyByScalar(m,y,m),n.multiplyByScalar(A,T,A),_.setColumn(i,0,p,i),_.setColumn(i,1,m,i),_.setColumn(i,2,A,i),_.setColumn(i,3,f,i),i};var ue=new _(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);return R.wgs84To2DModelMatrix=function(e,t,n){var r=e.ellipsoid,i=R.eastNorthUpToFixedFrame(t,r,ae),a=_.inverseTransformation(i,oe),o=r.cartesianToCartographic(t,J),u=e.project(o,Q),s=te;s.x=u.z,s.y=u.x,s.z=u.y,s.w=1;var c=_.fromTranslation(s,ae);return _.multiply(ue,a,n),_.multiply(c,n,n),n},R}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,n,r,i,a,o,u,s,c,l,f,h,d){"use strict";function p(e,t){t=i(t,s.WGS84),e=t.scaleToGeodeticSurface(e);var r=d.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=n.fromCartesian4(l.getColumn(r,0,E)),this._yAxis=n.fromCartesian4(l.getColumn(r,1,E));var a=n.fromCartesian4(l.getColumn(r,2,E));this._plane=f.fromPointNormal(e,a)}var E=new r;o(p.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var y=new e;p.fromPoints=function(t,n){var r=e.fromPoints(t,y);return new p(r.center,n)};var m=new h,_=new n;p.prototype.projectPointOntoPlane=function(e,r){var i=m;i.origin=e,n.normalize(e,i.direction);var o=c.rayPlane(i,this._plane,_);if(a(o)||(n.negate(i.direction,i.direction),o=c.rayPlane(i,this._plane,_)),a(o)){var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return a(r)?(r.x=s,r.y=l,r):new t(s,l)}},p.prototype.projectPointsOntoPlane=function(e,t){a(t)||(t=[]);for(var n=0,r=e.length,i=0;i<r;i++){var o=this.projectPointOntoPlane(e[i],t[n]);a(o)&&(t[n]=o,n++)}return t.length=n,t},p.prototype.projectPointToNearestOnPlane=function(e,r){a(r)||(r=new t);var i=m;i.origin=e,n.clone(this._plane.normal,i.direction);var o=c.rayPlane(i,this._plane,_);a(o)||(n.negate(i.direction,i.direction),o=c.rayPlane(i,this._plane,_));var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return r.x=s,r.y=l,r},p.prototype.projectPointsToNearestOnPlane=function(e,t){a(t)||(t=[]);var n=e.length;t.length=n;for(var r=0;r<n;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var v=new n;return p.prototype.projectPointsOntoEllipsoid=function(e,t){var r=e.length;a(t)?t.length=r:t=new Array(r);for(var i=this._ellipsoid,o=this._origin,u=this._xAxis,s=this._yAxis,c=v,l=0;l<r;++l){var f=e[l];n.multiplyByScalar(u,f.x,c),a(t[l])||(t[l]=new n);var h=n.add(o,c,t[l]);n.multiplyByScalar(s,f.y,c),n.add(h,c,h),i.scaleToGeocentricSurface(h,h)}return t},p}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===n.POINTS||e===n.LINES||e===n.LINE_LOOP||e===n.LINE_STRIP||e===n.TRIANGLES||e===n.TRIANGLE_STRIP||e===n.TRIANGLE_FAN}};return e(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,i){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,i.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return a.computeNumberOfVertices=function(e){var n=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var i=e.attributes[r],a=i.values.length/i.componentsPerAttribute;n=a}return n},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(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 r}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/GeometryInstance",["./defaultValue","./defined","./DeveloperError","./Matrix4"],function(e,t,n,r){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.geometry=t.geometry,this.modelMatrix=r.clone(e(t.modelMatrix,r.IDENTITY)),this.id=t.id,this.pickPrimitive=t.pickPrimitive,this.attributes=e(t.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}return i}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r,i){"use strict";var a={};a.octEncodeInRange=function(e,t,n){if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var r=n.x,a=n.y;n.x=(1-Math.abs(a))*i.signNotZero(r),n.y=(1-Math.abs(r))*i.signNotZero(a)}return n.x=i.toSNorm(n.x,t),n.y=i.toSNorm(n.y,t),n},a.octEncode=function(e,t){return a.octEncodeInRange(e,255,t)},a.octDecodeInRange=function(e,n,r,a){if(a.x=i.fromSNorm(e,r),a.y=i.fromSNorm(n,r),a.z=1-(Math.abs(a.x)+Math.abs(a.y)),a.z<0){var o=a.x;a.x=(1-Math.abs(a.y))*i.signNotZero(o),a.y=(1-Math.abs(o))*i.signNotZero(a.y)}return t.normalize(a,a)},a.octDecode=function(e,t,n){return a.octDecodeInRange(e,t,255,n)},a.octPackFloat=function(e){return 256*e.x+e.y};var o=new e;return a.octEncodeFloat=function(e){return a.octEncode(e,o),a.octPackFloat(o)},a.octDecodeFloat=function(e,t){var n=e/256,r=Math.floor(n),i=256*(n-r);return a.octDecode(r,i,t)},a.octPack=function(e,t,n,r){var i=a.octEncodeFloat(e),u=a.octEncodeFloat(t),s=a.octEncode(n,o);return r.x=65536*s.x+i,r.y=65536*s.y+u,r},a.octUnpack=function(e,t,n,r){var i=e.x/65536,o=Math.floor(i),u=65536*(i-o);i=e.y/65536;var s=Math.floor(i),c=65536*(i-s);a.octDecodeFloat(u,t),a.octDecodeFloat(c,n),a.octDecode(o,s,r)},a.compressTextureCoordinates=function(e){var t=4095*e.x|0,n=4095*e.y|0;return 4096*t+n},a.decompressTextureCoordinates=function(e,t){var n=e/4096,r=Math.floor(n);return t.x=r/4095,t.y=(e-4096*r)/4095,t},a}),define("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function i(r,i,s,c,l){n(l)||(l=new t);var f,h,d,p,E,y,m,_;n(i.z)?(f=t.subtract(s,i,a),h=t.subtract(c,i,o),d=t.subtract(r,i,u),p=t.dot(f,f),E=t.dot(f,h),y=t.dot(f,d),m=t.dot(h,h),_=t.dot(h,d)):(f=e.subtract(s,i,a),h=e.subtract(c,i,o),d=e.subtract(r,i,u),p=e.dot(f,f),E=e.dot(f,h),y=e.dot(f,d),m=e.dot(h,h),_=e.dot(h,d));var v=1/(p*m-E*E);return l.y=(m*y-E*_)*v,l.z=(p*_-E*y)*v,l.x=1-l.y-l.z,l}var a=new t,o=new t,u=new t;return i}),define("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n,r){t(i[n])||(i[n]=!0,console.warn(e(r,n)))}var i={};return r.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.",r}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,n){"use strict";function r(e,t){n(e,t)}return r}),define("Core/EncodedCartesian3",["./Cartesian3","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(){this.high=e.clone(e.ZERO),this.low=e.clone(e.ZERO)}r.encode=function(e,n){t(n)||(n={high:0,low:0});var r;return e>=0?(r=65536*Math.floor(e/65536),n.high=r,n.low=e-r):(r=65536*Math.floor(-e/65536),n.high=-r,n.low=e+r),n};var i={high:0,low:0};r.fromCartesian=function(e,n){t(n)||(n=new r);var a=n.high,o=n.low;return r.encode(e.x,i),a.x=i.high,o.x=i.low,r.encode(e.y,i),a.y=i.high,o.y=i.low,r.encode(e.z,i),a.z=i.high,o.z=i.low,n};var a=new r;return r.writeElements=function(e,t,n){r.fromCartesian(e,a);var i=a.high,o=a.low;t[n]=i.x,t[n+1]=i.y,t[n+2]=i.z,t[n+3]=o.x,t[n+4]=o.y,t[n+5]=o.z},r}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,n,r,i){"use strict";var a={UNSIGNED_BYTE:i.UNSIGNED_BYTE,UNSIGNED_SHORT:i.UNSIGNED_SHORT,UNSIGNED_INT:i.UNSIGNED_INT};return a.getSizeInBytes=function(e){switch(e){case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},a.validate=function(t){return e(t)&&(t===a.UNSIGNED_BYTE||t===a.UNSIGNED_SHORT||t===a.UNSIGNED_INT)},a.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},a.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)},n(a)}),define("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";var r={};return r.calculateACMR=function(n){n=e(n,e.EMPTY_OBJECT);var r=n.indices,i=n.maximumIndex,a=e(n.cacheSize,24),o=r.length;if(!t(i)){i=0;for(var u=0,s=r[u];u<o;)s>i&&(i=s),++u,s=r[u]}for(var c=[],l=0;l<i+1;l++)c[l]=0;for(var f=a+1,h=0;h<o;++h)f-c[r[h]]>a&&(c[r[h]]=f,++f);return(f-a+1)/(o/3)},r.tipsify=function(n){function r(e,t,n,r){for(;t.length>=1;){var i=t[t.length-1];if(t.splice(t.length-1,1),e[i].numLiveTriangles>0)return i}for(;a<r;){if(e[a].numLiveTriangles>0)return++a,a-1;++a}return-1}function i(e,t,n,i,a,o,u){for(var s,c=-1,l=-1,f=0;f<n.length;){var h=n[f];i[h].numLiveTriangles&&(s=0,a-i[h].timeStamp+2*i[h].numLiveTriangles<=t&&(s=a-i[h].timeStamp),(s>l||l===-1)&&(l=s,c=h)),++f}return c===-1?r(i,o,e,u):c}n=e(n,e.EMPTY_OBJECT);var a,o=n.indices,u=n.maximumIndex,s=e(n.cacheSize,24),c=o.length,l=0,f=0,h=o[f],d=c;if(t(u))l=u+1;else{for(;f<d;)h>l&&(l=h),++f,h=o[f];if(l===-1)return 0;++l}for(var p=[],E=0;E<l;E++)p[E]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};f=0;for(var y=0;f<d;)p[o[f]].vertexTriangles.push(y),++p[o[f]].numLiveTriangles,p[o[f+1]].vertexTriangles.push(y),++p[o[f+1]].numLiveTriangles,p[o[f+2]].vertexTriangles.push(y),++p[o[f+2]].numLiveTriangles,++y,f+=3;var m=0,_=s+1;a=1;var v,T,R=[],A=[],S=0,g=[],N=c/3,x=[];for(E=0;E<N;E++)x[E]=!1;for(var I,O;m!==-1;){R=[],T=p[m],O=T.vertexTriangles.length;for(var w=0;w<O;++w)if(y=T.vertexTriangles[w],!x[y]){x[y]=!0,f=y+y+y;for(var M=0;M<3;++M)I=o[f],R.push(I),A.push(I),g[S]=I,++S,v=p[I],--v.numLiveTriangles,_-v.timeStamp>s&&(v.timeStamp=_,++_),++f}m=i(o,s,R,p,_,A,l)}return g},r}),define("Core/GeometryPipeline",["./AttributeCompression","./barycentricCoordinates","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./deprecationWarning","./DeveloperError","./EncodedCartesian3","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryType","./IndexDatatype","./Intersect","./IntersectionTests","./Math","./Matrix3","./Matrix4","./Plane","./PrimitiveType","./Tipsify"],function(e,t,n,r,i,a,o,u,s,c,l,f,h,d,p,E,y,m,_,v,T,R,A,S,g,N){"use strict";function x(e,t,n,r,i){e[t++]=n,e[t++]=r,e[t++]=r,e[t++]=i,e[t++]=i,e[t]=n}function I(e){for(var t=e.length,n=t/3*6,r=m.createTypedArray(t,n),i=0,a=0;a<t;a+=3,i+=6)x(r,i,e[a],e[a+1],e[a+2]);return r}function O(e){var t=e.length;if(t>=3){var n=6*(t-2),r=m.createTypedArray(t,n);x(r,0,e[0],e[1],e[2]);for(var i=6,a=3;a<t;++a,i+=6)x(r,i,e[a-1],e[a],e[a-2]);return r}return new Uint16Array}function w(e){if(e.length>0){for(var t=e.length-1,n=6*(t-1),r=m.createTypedArray(t,n),i=e[0],a=0,o=1;o<t;++o,a+=6)x(r,a,i,e[o],e[o+1]);return r}return new Uint16Array}function M(e){var t={};for(var n in e)if(e.hasOwnProperty(n)&&c(e[n])&&c(e[n].values)){var r=e[n];t[n]=new E({componentDatatype:r.componentDatatype,componentsPerAttribute:r.componentsPerAttribute,normalize:r.normalize,values:[]})}return t}function C(e,t,n){for(var r in t)if(t.hasOwnProperty(r)&&c(t[r])&&c(t[r].values))for(var i=t[r],a=0;a<i.componentsPerAttribute;++a)e[r].values.push(i.values[n*i.componentsPerAttribute+a])}function P(e,t){if(c(t))for(var n=t.values,r=n.length,a=0;a<r;a+=3)i.unpack(n,a,oe),A.multiplyByPoint(e,oe,oe),i.pack(oe,n,a)}function D(e,t){if(c(t))for(var n=t.values,r=n.length,a=0;a<r;a+=3)i.unpack(n,a,oe),R.multiplyByVector(e,oe,oe),oe=i.normalize(oe,oe),i.pack(oe,n,a)}function L(e,t){var n,r=e.length,i={},a=e[0][t].attributes;for(n in a)if(a.hasOwnProperty(n)&&c(a[n])&&c(a[n].values)){for(var o=a[n],s=o.values.length,l=!0,f=1;f<r;++f){var h=e[f][t].attributes[n];if(!c(h)||o.componentDatatype!==h.componentDatatype||o.componentsPerAttribute!==h.componentsPerAttribute||o.normalize!==h.normalize){l=!1;break}s+=h.values.length}l&&(i[n]=new E({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:u.createTypedArray(o.componentDatatype,s)}))}return i}function U(e,t){var r,a,o,u,s,l,f,h=e.length,d=(e[0].modelMatrix,c(e[0][t].indices)),E=e[0][t].primitiveType,y=L(e,t);for(r in y)if(y.hasOwnProperty(r))for(s=y[r].values,u=0,a=0;a<h;++a)for(l=e[a][t].attributes[r].values,f=l.length,o=0;o<f;++o)s[u++]=l[o];var _;if(d){var v=0;for(a=0;a<h;++a)v+=e[a][t].indices.length;var T=p.computeNumberOfVertices(new p({attributes:y,primitiveType:g.POINTS})),R=m.createTypedArray(T,v),A=0,S=0;for(a=0;a<h;++a){var N=e[a][t].indices,x=N.length;for(u=0;u<x;++u)R[A++]=S+N[u];S+=p.computeNumberOfVertices(e[a][t])}_=R}var I,O=new i,w=0;for(a=0;a<h;++a){if(I=e[a][t].boundingSphere,!c(I)){O=void 0;break}i.add(I.center,O,O)}if(c(O))for(i.divideByScalar(O,h,O),a=0;a<h;++a){I=e[a][t].boundingSphere;var M=i.magnitude(i.subtract(I.center,O,ce))+I.radius;M>w&&(w=M)}return new p({attributes:y,indices:_,primitiveType:E,boundingSphere:c(O)?new n(O,w):void 0})}function b(e){if(c(e.indices))return e;for(var t=p.computeNumberOfVertices(e),n=m.createTypedArray(t,t),r=0;r<t;++r)n[r]=r;return e.indices=n,e}function z(e){var t=p.computeNumberOfVertices(e),n=m.createTypedArray(t,3*(t-2));n[0]=1,n[1]=0,n[2]=2;for(var r=3,i=3;i<t;++i)n[r++]=i-1,n[r++]=0,n[r++]=i;return e.indices=n,e.primitiveType=g.TRIANGLES,e}function F(e){var t=p.computeNumberOfVertices(e),n=m.createTypedArray(t,3*(t-2));n[0]=0,n[1]=1,n[2]=2,t>3&&(n[3]=0,n[4]=2,n[5]=3);for(var r=6,i=3;i<t-1;i+=2)n[r++]=i,n[r++]=i-1,n[r++]=i+1,i+2<t&&(n[r++]=i,n[r++]=i+1,n[r++]=i+2);return e.indices=n,e.primitiveType=g.TRIANGLES,e}function B(e){if(c(e.indices))return e;for(var t=p.computeNumberOfVertices(e),n=m.createTypedArray(t,t),r=0;r<t;++r)n[r]=r;return e.indices=n,e}function G(e){var t=p.computeNumberOfVertices(e),n=m.createTypedArray(t,2*(t-1));n[0]=0,n[1]=1;for(var r=2,i=2;i<t;++i)n[r++]=i-1,n[r++]=i;return e.indices=n,e.primitiveType=g.LINES,e}function q(e){var t=p.computeNumberOfVertices(e),n=m.createTypedArray(t,2*t);n[0]=0,n[1]=1;for(var r=2,i=2;i<t;++i)n[r++]=i-1,n[r++]=i;return n[r++]=t-1,n[r]=0,e.indices=n,e.primitiveType=g.LINES,e}function W(e){switch(e.primitiveType){case g.TRIANGLE_FAN:return z(e);case g.TRIANGLE_STRIP:return F(e);case g.TRIANGLES:return b(e);case g.LINE_STRIP:return G(e);case g.LINE_LOOP:return q(e);case g.LINES:return B(e)}return e}function X(e,t){Math.abs(e.y)<T.EPSILON6&&(t?e.y=-T.EPSILON6:e.y=T.EPSILON6)}function H(e,t,n){if(0!==e.y&&0!==t.y&&0!==n.y)return X(e,e.y<0),X(t,t.y<0),void X(n,n.y<0);var r,i=Math.abs(e.y),a=Math.abs(t.y),o=Math.abs(n.y);r=i>a?i>o?T.sign(e.y):T.sign(n.y):a>o?T.sign(t.y):T.sign(n.y);var u=r<0;X(e,u),X(t,u),X(n,u)}function V(e,t,n,r){i.add(e,i.multiplyByScalar(i.subtract(t,e,Ae),e.y/(e.y-t.y),Ae),n),i.clone(n,r),X(n,!0),X(r,!1)}function Y(e,t,n){if(!(e.x>=0||t.x>=0||n.x>=0)){H(e,t,n);var r=e.y<0,i=t.y<0,a=n.y<0,o=0;o+=r?1:0,o+=i?1:0,o+=a?1:0;var u=Ie.indices;1===o?(u[1]=3,u[2]=4,u[5]=6,u[7]=6,u[8]=5,r?(V(e,t,Se,Ne),V(e,n,ge,xe),u[0]=0,u[3]=1,u[4]=2,u[6]=1):i?(V(t,n,Se,Ne),V(t,e,ge,xe),u[0]=1,u[3]=2,u[4]=0,u[6]=2):a&&(V(n,e,Se,Ne),V(n,t,ge,xe),u[0]=2,u[3]=0,u[4]=1,u[6]=0)):2===o&&(u[2]=4,u[4]=4,u[5]=3,u[7]=5,u[8]=6,r?i?a||(V(n,e,Se,Ne),V(n,t,ge,xe),u[0]=0,u[1]=1,u[3]=0,u[6]=2):(V(t,n,Se,Ne),V(t,e,ge,xe),u[0]=2,u[1]=0,u[3]=2,u[6]=1):(V(e,t,Se,Ne),V(e,n,ge,xe),u[0]=1,u[1]=2,u[3]=1,u[6]=0));var s=Ie.positions;return s[0]=e,s[1]=t,s[2]=n,s.length=3,1!==o&&2!==o||(s[3]=Se,s[4]=ge,s[5]=Ne,s[6]=xe,s.length=7),Ie}}function k(e,t){var r=e.attributes;if(0!==r.position.values.length){for(var i in r)if(r.hasOwnProperty(i)&&c(r[i])&&c(r[i].values)){var a=r[i];a.values=u.createTypedArray(a.componentDatatype,a.values)}var o=p.computeNumberOfVertices(e);return e.indices=m.createTypedArray(o,e.indices),t&&(e.boundingSphere=n.fromVertices(r.position.values)),e}}function Z(e){var t=e.attributes,n={};for(var r in t)if(t.hasOwnProperty(r)&&c(t[r])&&c(t[r].values)){var i=t[r];n[r]=new E({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return new p({attributes:n,indices:[],primitiveType:e.primitiveType})}function j(e,t,n){var r=c(e.geometry.boundingSphere);t=k(t,r),n=k(n,r),c(n)&&!c(t)?e.geometry=n:!c(n)&&c(t)?e.geometry=t:(e.westHemisphereGeometry=t, +e.eastHemisphereGeometry=n,e.geometry=void 0)}function K(e,n,a,o,u,s,l,f,h,d,p,E){if(c(s)||c(l)||c(f)||c(h)||c(d)){var y=i.fromArray(u,3*e,Oe),m=i.fromArray(u,3*n,we),_=i.fromArray(u,3*a,Me),v=t(o,y,m,_,Ce);if(c(s)){var T=i.fromArray(s,3*e,Oe),R=i.fromArray(s,3*n,we),A=i.fromArray(s,3*a,Me);i.multiplyByScalar(T,v.x,T),i.multiplyByScalar(R,v.y,R),i.multiplyByScalar(A,v.z,A);var S=i.add(T,R,T);i.add(S,A,S),i.normalize(S,S),i.pack(S,p.normal.values,3*E)}if(c(d)){var g=i.fromArray(d,3*e,Oe),N=i.fromArray(d,3*n,we),x=i.fromArray(d,3*a,Me);i.multiplyByScalar(g,v.x,g),i.multiplyByScalar(N,v.y,N),i.multiplyByScalar(x,v.z,x);var I;i.equals(g,i.ZERO)&&i.equals(N,i.ZERO)&&i.equals(x,i.ZERO)?(I=Oe,I.x=0,I.y=0,I.z=0):(I=i.add(g,N,g),i.add(I,x,I),i.normalize(I,I)),i.pack(I,p.extrudeDirection.values,3*E)}if(c(l)){var O=i.fromArray(l,3*e,Oe),w=i.fromArray(l,3*n,we),M=i.fromArray(l,3*a,Me);i.multiplyByScalar(O,v.x,O),i.multiplyByScalar(w,v.y,w),i.multiplyByScalar(M,v.z,M);var C=i.add(O,w,O);i.add(C,M,C),i.normalize(C,C),i.pack(C,p.tangent.values,3*E)}if(c(f)){var P=i.fromArray(f,3*e,Oe),D=i.fromArray(f,3*n,we),L=i.fromArray(f,3*a,Me);i.multiplyByScalar(P,v.x,P),i.multiplyByScalar(D,v.y,D),i.multiplyByScalar(L,v.z,L);var U=i.add(P,D,P);i.add(U,L,U),i.normalize(U,U),i.pack(U,p.bitangent.values,3*E)}if(c(h)){var b=r.fromArray(h,2*e,Pe),z=r.fromArray(h,2*n,De),F=r.fromArray(h,2*a,Le);r.multiplyByScalar(b,v.x,b),r.multiplyByScalar(z,v.y,z),r.multiplyByScalar(F,v.z,F);var B=r.add(b,z,b);r.add(B,F,B),r.pack(B,p.st.values,2*E)}}}function J(e,t,n,r,i,a){var o=e.position.values.length/3;if(i!==-1){var u=r[i],s=n[u];return s===-1?(n[u]=o,e.position.values.push(a.x,a.y,a.z),t.push(o),o):(t.push(s),s)}return e.position.values.push(a.x,a.y,a.z),t.push(o),o}function Q(e){var t,n,r,a,o,u=e.geometry,s=u.attributes,l=s.position.values,f=c(s.normal)?s.normal.values:void 0,h=c(s.bitangent)?s.bitangent.values:void 0,d=c(s.tangent)?s.tangent.values:void 0,p=c(s.st)?s.st.values:void 0,E=c(s.extrudeDirection)?s.extrudeDirection.values:void 0,y=u.indices,m=Z(u),_=Z(u),v=[];v.length=l.length/3;var T=[];for(T.length=l.length/3,o=0;o<v.length;++o)v[o]=-1,T[o]=-1;var R=y.length;for(o=0;o<R;o+=3){var A=y[o],S=y[o+1],g=y[o+2],N=i.fromArray(l,3*A),x=i.fromArray(l,3*S),I=i.fromArray(l,3*g),O=Y(N,x,I);if(c(O)&&O.positions.length>3)for(var w=O.positions,M=O.indices,C=M.length,P=0;P<C;++P){var D=M[P],L=w[D];L.y<0?(t=_.attributes,n=_.indices,r=v):(t=m.attributes,n=m.indices,r=T),a=J(t,n,r,y,D<3?o+D:-1,L),K(A,S,g,L,l,f,d,h,p,E,t,a)}else c(O)&&(N=O.positions[0],x=O.positions[1],I=O.positions[2]),N.y<0?(t=_.attributes,n=_.indices,r=v):(t=m.attributes,n=m.indices,r=T),a=J(t,n,r,y,o,N),K(A,S,g,N,l,f,d,h,p,E,t,a),a=J(t,n,r,y,o+1,x),K(A,S,g,x,l,f,d,h,p,E,t,a),a=J(t,n,r,y,o+2,I),K(A,S,g,I,l,f,d,h,p,E,t,a)}j(e,_,m)}function $(e){var t,n=e.geometry,r=n.attributes,a=r.position.values,o=n.indices,u=Z(n),s=Z(n),l=o.length,f=[];f.length=a.length/3;var h=[];for(h.length=a.length/3,t=0;t<f.length;++t)f[t]=-1,h[t]=-1;for(t=0;t<l;t+=2){var d=o[t],p=o[t+1],E=i.fromArray(a,3*d,Oe),y=i.fromArray(a,3*p,we);Math.abs(E.y)<T.EPSILON6&&(E.y<0?E.y=-T.EPSILON6:E.y=T.EPSILON6),Math.abs(y.y)<T.EPSILON6&&(y.y<0?y.y=-T.EPSILON6:y.y=T.EPSILON6);var m=u.attributes,_=u.indices,R=h,A=s.attributes,S=s.indices,g=f,N=v.lineSegmentPlane(E,y,Ue,Me);if(c(N)){var x=i.multiplyByScalar(i.UNIT_Y,5*T.EPSILON9,be);E.y<0&&(i.negate(x,x),m=s.attributes,_=s.indices,R=f,A=u.attributes,S=u.indices,g=h);var I=i.add(N,x,ze);J(m,_,R,o,t,E),J(m,_,R,o,-1,I),i.negate(x,x),i.add(N,x,I),J(A,S,g,o,-1,I),J(A,S,g,o,t+1,y)}else{var O,w,M;E.y<0?(O=s.attributes,w=s.indices,M=f):(O=u.attributes,w=u.indices,M=h),J(O,w,M,o,t,E),J(O,w,M,o,t+1,y)}}j(e,s,u)}function ee(e){for(var t=e.attributes,n=t.position.values,r=t.prevPosition.values,a=t.nextPosition.values,o=n.length,u=0;u<o;u+=3){var s=i.unpack(n,u,Ge);if(!(s.x>0)){var c=i.unpack(r,u,qe);(s.y<0&&c.y>0||s.y>0&&c.y<0)&&(u-3>0?(r[u]=n[u-3],r[u+1]=n[u-2],r[u+2]=n[u-1]):i.pack(s,r,u));var l=i.unpack(a,u,We);(s.y<0&&l.y>0||s.y>0&&l.y<0)&&(u+3<o?(a[u]=n[u+3],a[u+1]=n[u+4],a[u+2]=n[u+5]):i.pack(s,a,u))}}}function te(e){var t,n,o,u=e.geometry,s=u.attributes,l=s.position.values,f=s.prevPosition.values,h=s.nextPosition.values,d=s.expandAndWidth.values,p=c(s.st)?s.st.values:void 0,E=c(s.color)?s.color.values:void 0,y=Z(u),m=Z(u),_=!1,R=l.length/3;for(t=0;t<R;t+=4){var A=t,S=t+2,g=i.fromArray(l,3*A,Ge),N=i.fromArray(l,3*S,qe);if(Math.abs(g.y)<Ze)for(g.y=Ze*(N.y<0?-1:1),l[3*t+1]=g.y,l[3*(t+1)+1]=g.y,n=3*A;n<3*A+12;n+=3)f[n]=l[3*t],f[n+1]=l[3*t+1],f[n+2]=l[3*t+2];if(Math.abs(N.y)<Ze)for(N.y=Ze*(g.y<0?-1:1),l[3*(t+2)+1]=N.y,l[3*(t+3)+1]=N.y,n=3*A;n<3*A+12;n+=3)h[n]=l[3*(t+2)],h[n+1]=l[3*(t+2)+1],h[n+2]=l[3*(t+2)+2];var x=y.attributes,I=y.indices,O=m.attributes,w=m.indices,M=v.lineSegmentPlane(g,N,Ue,Xe);if(c(M)){_=!0;var C=i.multiplyByScalar(i.UNIT_Y,ke,He);g.y<0&&(i.negate(C,C),x=m.attributes,I=m.indices,O=y.attributes,w=y.indices);var P=i.add(M,C,Ve);x.position.values.push(g.x,g.y,g.z,g.x,g.y,g.z),x.position.values.push(P.x,P.y,P.z),x.position.values.push(P.x,P.y,P.z),x.prevPosition.values.push(f[3*A],f[3*A+1],f[3*A+2]),x.prevPosition.values.push(f[3*A+3],f[3*A+4],f[3*A+5]),x.prevPosition.values.push(g.x,g.y,g.z,g.x,g.y,g.z),x.nextPosition.values.push(P.x,P.y,P.z),x.nextPosition.values.push(P.x,P.y,P.z),x.nextPosition.values.push(P.x,P.y,P.z),x.nextPosition.values.push(P.x,P.y,P.z),i.negate(C,C),i.add(M,C,P),O.position.values.push(P.x,P.y,P.z),O.position.values.push(P.x,P.y,P.z),O.position.values.push(N.x,N.y,N.z,N.x,N.y,N.z),O.prevPosition.values.push(P.x,P.y,P.z),O.prevPosition.values.push(P.x,P.y,P.z),O.prevPosition.values.push(P.x,P.y,P.z),O.prevPosition.values.push(P.x,P.y,P.z),O.nextPosition.values.push(N.x,N.y,N.z,N.x,N.y,N.z),O.nextPosition.values.push(h[3*S],h[3*S+1],h[3*S+2]),O.nextPosition.values.push(h[3*S+3],h[3*S+4],h[3*S+5]);var D=r.fromArray(d,2*A,Fe),L=Math.abs(D.y);x.expandAndWidth.values.push(-1,L,1,L),x.expandAndWidth.values.push(-1,-L,1,-L),O.expandAndWidth.values.push(-1,L,1,L),O.expandAndWidth.values.push(-1,-L,1,-L);var U=i.magnitudeSquared(i.subtract(M,g,We));if(U/=i.magnitudeSquared(i.subtract(N,g,We)),c(E)){var b=a.fromArray(E,4*A,Ye),z=a.fromArray(E,4*S,Ye),F=T.lerp(b.x,z.x,U),B=T.lerp(b.y,z.y,U),G=T.lerp(b.z,z.z,U),q=T.lerp(b.w,z.w,U);for(n=4*A;n<4*A+8;++n)x.color.values.push(E[n]);for(x.color.values.push(F,B,G,q),x.color.values.push(F,B,G,q),O.color.values.push(F,B,G,q),O.color.values.push(F,B,G,q),n=4*S;n<4*S+8;++n)O.color.values.push(E[n])}if(c(p)){var W=r.fromArray(p,2*A,Fe),X=r.fromArray(p,2*(t+3),Be),H=T.lerp(W.x,X.x,U);for(n=2*A;n<2*A+4;++n)x.st.values.push(p[n]);for(x.st.values.push(H,W.y),x.st.values.push(H,X.y),O.st.values.push(H,W.y),O.st.values.push(H,X.y),n=2*S;n<2*S+4;++n)O.st.values.push(p[n])}o=x.position.values.length/3-4,I.push(o,o+2,o+1),I.push(o+1,o+2,o+3),o=O.position.values.length/3-4,w.push(o,o+2,o+1),w.push(o+1,o+2,o+3)}else{var V,Y;for(g.y<0?(V=m.attributes,Y=m.indices):(V=y.attributes,Y=y.indices),V.position.values.push(g.x,g.y,g.z),V.position.values.push(g.x,g.y,g.z),V.position.values.push(N.x,N.y,N.z),V.position.values.push(N.x,N.y,N.z),n=3*t;n<3*t+12;++n)V.prevPosition.values.push(f[n]),V.nextPosition.values.push(h[n]);for(n=2*t;n<2*t+8;++n)V.expandAndWidth.values.push(d[n]),c(p)&&V.st.values.push(p[n]);if(c(E))for(n=4*t;n<4*t+16;++n)V.color.values.push(E[n]);o=V.position.values.length/3-4,Y.push(o,o+2,o+1),Y.push(o+1,o+2,o+3)}}_&&(ee(m),ee(y)),j(e,m,y)}var ne={};ne.toWireframe=function(e){var t=e.indices;if(c(t)){switch(e.primitiveType){case g.TRIANGLES:e.indices=I(t);break;case g.TRIANGLE_STRIP:e.indices=O(t);break;case g.TRIANGLE_FAN:e.indices=w(t)}e.primitiveType=g.LINES}return e},ne.createLineSegmentsForVectors=function(e,t,r){t=s(t,"normal"),r=s(r,1e4);for(var i=e.attributes.position.values,a=e.attributes[t].values,o=i.length,l=new Float64Array(2*o),f=0,h=0;h<o;h+=3)l[f++]=i[h],l[f++]=i[h+1],l[f++]=i[h+2],l[f++]=i[h]+a[h]*r,l[f++]=i[h+1]+a[h+1]*r,l[f++]=i[h+2]+a[h+2]*r;var d,y=e.boundingSphere;return c(y)&&(d=new n(y.center,y.radius+r)),new p({attributes:{position:new E({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:g.LINES,boundingSphere:d})},ne.createAttributeLocations=function(e){var t,n=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],r=e.attributes,i={},a=0,o=n.length;for(t=0;t<o;++t){var u=n[t];c(r[u])&&(i[u]=a++)}for(var s in r)r.hasOwnProperty(s)&&!c(i[s])&&(i[s]=a++);return i},ne.reorderForPreVertexCache=function(e){var t=p.computeNumberOfVertices(e),n=e.indices;if(c(n)){for(var r=new Int32Array(t),i=0;i<t;i++)r[i]=-1;for(var a,o=n,s=o.length,l=m.createTypedArray(t,s),f=0,h=0,d=0;f<s;)a=r[o[f]],a!==-1?l[h]=a:(a=o[f],r[a]=d,l[h]=d,++d),++f,++h;e.indices=l;var E=e.attributes;for(var y in E)if(E.hasOwnProperty(y)&&c(E[y])&&c(E[y].values)){for(var _=E[y],v=_.values,T=0,R=_.componentsPerAttribute,A=u.createTypedArray(_.componentDatatype,d*R);T<t;){var S=r[T];if(S!==-1)for(i=0;i<R;i++)A[R*S+i]=v[R*T+i];++T}_.values=A}}return e},ne.reorderForPostVertexCache=function(e,t){var n=e.indices;if(e.primitiveType===g.TRIANGLES&&c(n)){for(var r=n.length,i=0,a=0;a<r;a++)n[a]>i&&(i=n[a]);e.indices=N.tipsify({indices:n,maximumIndex:i,cacheSize:t})}return e},ne.fitToUnsignedShortIndices=function(e){var t=[],n=p.computeNumberOfVertices(e);if(c(e.indices)&&n>=T.SIXTY_FOUR_KILOBYTES){var r,i=[],a=[],o=0,u=M(e.attributes),s=e.indices,l=s.length;e.primitiveType===g.TRIANGLES?r=3:e.primitiveType===g.LINES?r=2:e.primitiveType===g.POINTS&&(r=1);for(var f=0;f<l;f+=r){for(var h=0;h<r;++h){var d=s[f+h],E=i[d];c(E)||(E=o++,i[d]=E,C(u,e.attributes,d)),a.push(E)}o+r>=T.SIXTY_FOUR_KILOBYTES&&(t.push(new p({attributes:u,indices:a,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),i=[],a=[],o=0,u=M(e.attributes))}0!==a.length&&t.push(new p({attributes:u,indices:a,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var re=new i,ie=new o;ne.projectTo2D=function(e,t,n,r,a){var o=e.attributes[t];a=c(a)?a:new d;for(var s=a.ellipsoid,l=o.values,f=new Float64Array(l.length),h=0,p=0;p<l.length;p+=3){var y=i.fromArray(l,p,re),m=s.cartesianToCartographic(y,ie),_=a.project(m,re);f[h++]=_.x,f[h++]=_.y,f[h++]=_.z}return e.attributes[n]=o,e.attributes[r]=new E({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:f}),delete e.attributes[t],e};var ae={high:0,low:0};ne.encodeAttribute=function(e,t,n,r){for(var i=e.attributes[t],a=i.values,o=a.length,s=new Float32Array(o),c=new Float32Array(o),l=0;l<o;++l)h.encode(a[l],ae),s[l]=ae.high,c[l]=ae.low;var f=i.componentsPerAttribute;return e.attributes[n]=new E({componentDatatype:u.FLOAT,componentsPerAttribute:f,values:s}),e.attributes[r]=new E({componentDatatype:u.FLOAT,componentsPerAttribute:f,values:c}),delete e.attributes[t],e};var oe=new i,ue=new A,se=new R;ne.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(A.equals(t,A.IDENTITY))return e;var r=e.geometry.attributes;P(t,r.position),P(t,r.prevPosition),P(t,r.nextPosition),(c(r.normal)||c(r.tangent)||c(r.bitangent))&&(A.inverse(t,ue),A.transpose(ue,ue),A.getRotation(ue,se),D(se,r.normal),D(se,r.tangent),D(se,r.bitangent));var i=e.geometry.boundingSphere;return c(i)&&(e.geometry.boundingSphere=n.transform(i,t,i)),e.modelMatrix=A.clone(A.IDENTITY),e};var ce=new i;ne.combineInstances=function(e){for(var t=[],n=[],r=e.length,i=0;i<r;++i){var a=e[i];c(a.geometry)?t.push(a):c(a.westHemisphereGeometry)&&c(a.eastHemisphereGeometry)&&n.push(a)}var o=[];return t.length>0&&o.push(U(t,"geometry")),n.length>0&&(o.push(U(n,"westHemisphereGeometry")),o.push(U(n,"eastHemisphereGeometry"))),o};var le=new i,fe=new i,he=new i,de=new i;ne.computeNormal=function(e){for(var t=e.indices,n=e.attributes,r=n.position.values,a=n.position.values.length/3,o=t.length,s=new Array(a),c=new Array(o/3),l=new Array(o),f=0;f<a;f++)s[f]={indexOffset:0,count:0,currentCount:0};var h=0;for(f=0;f<o;f+=3){var d=t[f],p=t[f+1],y=t[f+2],m=3*d,_=3*p,v=3*y;fe.x=r[m],fe.y=r[m+1],fe.z=r[m+2],he.x=r[_],he.y=r[_+1],he.z=r[_+2],de.x=r[v],de.y=r[v+1],de.z=r[v+2],s[d].count++,s[p].count++,s[y].count++,i.subtract(he,fe,he),i.subtract(de,fe,de),c[h]=i.cross(he,de,new i),h++}var T=0;for(f=0;f<a;f++)s[f].indexOffset+=T,T+=s[f].count;h=0;var R;for(f=0;f<o;f+=3){R=s[t[f]];var A=R.indexOffset+R.currentCount;l[A]=h,R.currentCount++,R=s[t[f+1]],A=R.indexOffset+R.currentCount,l[A]=h,R.currentCount++,R=s[t[f+2]],A=R.indexOffset+R.currentCount,l[A]=h,R.currentCount++,h++}var S=new Float32Array(3*a);for(f=0;f<a;f++){var g=3*f;if(R=s[f],R.count>0){for(i.clone(i.ZERO,le),h=0;h<R.count;h++)i.add(le,c[l[R.indexOffset+h]],le);i.normalize(le,le),S[g]=le.x,S[g+1]=le.y,S[g+2]=le.z}else S[g]=0,S[g+1]=0,S[g+2]=1}return e.attributes.normal=new E({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:S}),e};var pe=new i,Ee=new i,ye=new i;ne.computeTangentAndBitangent=function(e){for(var t=(e.attributes,e.indices),n=e.attributes.position.values,r=e.attributes.normal.values,a=e.attributes.st.values,o=e.attributes.position.values.length/3,s=t.length,c=new Array(3*o),l=0;l<c.length;l++)c[l]=0;var f,h,d;for(l=0;l<s;l+=3){var p=t[l],y=t[l+1],m=t[l+2];f=3*p,h=3*y,d=3*m;var _=2*p,v=2*y,T=2*m,R=n[f],A=n[f+1],S=n[f+2],g=a[_],N=a[_+1],x=a[v+1]-N,I=a[T+1]-N,O=1/((a[v]-g)*I-(a[T]-g)*x),w=(I*(n[h]-R)-x*(n[d]-R))*O,M=(I*(n[h+1]-A)-x*(n[d+1]-A))*O,C=(I*(n[h+2]-S)-x*(n[d+2]-S))*O;c[f]+=w,c[f+1]+=M,c[f+2]+=C,c[h]+=w,c[h+1]+=M,c[h+2]+=C,c[d]+=w,c[d+1]+=M,c[d+2]+=C}var P=new Float32Array(3*o),D=new Float32Array(3*o);for(l=0;l<o;l++){f=3*l,h=f+1,d=f+2;var L=i.fromArray(r,f,pe),U=i.fromArray(c,f,ye),b=i.dot(L,U);i.multiplyByScalar(L,b,Ee),i.normalize(i.subtract(U,Ee,U),U),P[f]=U.x,P[h]=U.y,P[d]=U.z,i.normalize(i.cross(L,U,U),U),D[f]=U.x,D[h]=U.y,D[d]=U.z}return e.attributes.tangent=new E({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:P}),e.attributes.bitangent=new E({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:D}),e},ne.computeBinormalAndTangent=function(e){return l("computeBinormalAndTangent","computeBinormalAndTangent was deprecated in 1.30. It will be removed in 1.31. Use a computeTangentAndBitangent."),ne.computeTangentAndBitangent(e),e.attributes.binormal=e.attributes.bitangent,e};var me=new r,_e=new i,ve=new i,Te=new i,Re=new r;ne.compressVertices=function(t){var n,a,o=t.attributes.extrudeDirection;if(c(o)){var s=o.values;a=s.length/3;var l=new Float32Array(2*a),f=0;for(n=0;n<a;++n)i.fromArray(s,3*n,_e),i.equals(_e,i.ZERO)?f+=2:(Re=e.octEncodeInRange(_e,65535,Re),l[f++]=Re.x,l[f++]=Re.y);return t.attributes.compressedAttributes=new E({componentDatatype:u.FLOAT,componentsPerAttribute:2,values:l}),delete t.attributes.extrudeDirection,t}var h=t.attributes.normal,d=t.attributes.st,p=c(h),y=c(d);if(!p&&!y)return t;var m,_,v,T,R=t.attributes.tangent,A=t.attributes.bitangent,S=c(R),g=c(A);p&&(m=h.values),y&&(_=d.values),S&&(v=R.values),g&&(T=A.values);var N=p?m.length:_.length,x=p?3:2;a=N/x;var I=a,O=y&&p?2:1;O+=S||g?1:0,I*=O;var w=new Float32Array(I),M=0;for(n=0;n<a;++n){y&&(r.fromArray(_,2*n,me),w[M++]=e.compressTextureCoordinates(me));var C=3*n;p&&c(v)&&c(T)?(i.fromArray(m,C,_e),i.fromArray(v,C,ve),i.fromArray(T,C,Te),e.octPack(_e,ve,Te,me),w[M++]=me.x,w[M++]=me.y):(p&&(i.fromArray(m,C,_e),w[M++]=e.octEncodeFloat(_e)),S&&(i.fromArray(v,C,_e),w[M++]=e.octEncodeFloat(_e)),g&&(i.fromArray(T,C,_e),w[M++]=e.octEncodeFloat(_e)))}return t.attributes.compressedAttributes=new E({componentDatatype:u.FLOAT,componentsPerAttribute:O,values:w}),p&&delete t.attributes.normal,y&&delete t.attributes.st,g&&delete t.attributes.bitangent,S&&delete t.attributes.tangent,t};var Ae=new i,Se=new i,ge=new i,Ne=new i,xe=new i,Ie={positions:new Array(7),indices:new Array(9)},Oe=new i,we=new i,Me=new i,Ce=new i,Pe=new r,De=new r,Le=new r,Ue=S.fromPointNormal(i.ZERO,i.UNIT_Y),be=new i,ze=new i,Fe=new r,Be=new r,Ge=new i,qe=new i,We=new i,Xe=new i,He=new i,Ve=new i,Ye=new a,ke=5*T.EPSILON9,Ze=T.EPSILON6;return ne.splitLongitude=function(e){var t=e.geometry,r=t.boundingSphere;if(c(r)){var i=r.center.x-r.radius;if(i>0||n.intersectPlane(r,S.ORIGIN_ZX_PLANE)!==_.INTERSECTING)return e}if(t.geometryType!==y.NONE)switch(t.geometryType){case y.POLYLINES:te(e);break;case y.TRIANGLES:Q(e);break;case y.LINES:$(e)}else W(t),t.primitiveType===g.TRIANGLES?Q(e):t.primitiveType===g.LINES&&$(e);return e},ne}),define("ThirdParty/earcut-2.1.1",[],function(){"use strict";function e(e,n,i){i=i||2;var a=n&&n.length,o=a?n[0]*i:e.length,u=t(e,0,o,i,!0),c=[];if(!u)return c;var l,f,h,d,p,E,y;if(a&&(u=s(e,n,u,i)),e.length>80*i){l=h=e[0],f=d=e[1];for(var m=i;m<o;m+=i)p=e[m],E=e[m+1],p<l&&(l=p),E<f&&(f=E),p>h&&(h=p),E>d&&(d=E);y=Math.max(h-l,d-f)}return r(u,c,i,l,f,y),c}function t(e,t,n,r,i){var a,o;if(i===O(e,t,n,r)>0)for(a=t;a<n;a+=r)o=N(a,e[a],e[a+1],o);else for(a=n-r;a>=t;a-=r)o=N(a,e[a],e[a+1],o);return o&&v(o,o.next)&&(x(o),o=o.next),o}function n(e,t){if(!e)return e;t||(t=e);var n,r=e;do if(n=!1,r.steiner||!v(r,r.next)&&0!==_(r.prev,r,r.next))r=r.next;else{if(x(r),r=t=r.prev,r===r.next)return null;n=!0}while(n||r!==t);return t}function r(e,t,s,c,l,f,d){if(e){!d&&f&&h(e,c,l,f);for(var p,E,y=e;e.prev!==e.next;)if(p=e.prev,E=e.next,f?a(e,c,l,f):i(e))t.push(p.i/s),t.push(e.i/s),t.push(E.i/s),x(e),e=E.next,y=E.next;else if(e=E,e===y){d?1===d?(e=o(e,t,s),r(e,t,s,c,l,f,2)):2===d&&u(e,t,s,c,l,f):r(n(e),t,s,c,l,f,1);break}}}function i(e){var t=e.prev,n=e,r=e.next;if(_(t,n,r)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(y(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&_(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function a(e,t,n,r){var i=e.prev,a=e,o=e.next;if(_(i,a,o)>=0)return!1;for(var u=i.x<a.x?i.x<o.x?i.x:o.x:a.x<o.x?a.x:o.x,s=i.y<a.y?i.y<o.y?i.y:o.y:a.y<o.y?a.y:o.y,c=i.x>a.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,l=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,f=p(u,s,t,n,r),h=p(c,l,t,n,r),d=e.nextZ;d&&d.z<=h;){if(d!==e.prev&&d!==e.next&&y(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&_(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(d=e.prevZ;d&&d.z>=f;){if(d!==e.prev&&d!==e.next&&y(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&_(d.prev,d,d.next)>=0)return!1;d=d.prevZ}return!0}function o(e,t,n){var r=e;do{var i=r.prev,a=r.next.next;!v(i,a)&&T(i,r,r.next,a)&&A(i,a)&&A(a,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(a.i/n),x(r),x(r.next),r=e=a),r=r.next}while(r!==e);return r}function u(e,t,i,a,o,u){var s=e;do{for(var c=s.next.next;c!==s.prev;){if(s.i!==c.i&&m(s,c)){var l=g(s,c);return s=n(s,s.next),l=n(l,l.next),r(s,t,i,a,o,u),void r(l,t,i,a,o,u)}c=c.next}s=s.next}while(s!==e)}function s(e,r,i,a){var o,u,s,f,h,d=[];for(o=0,u=r.length;o<u;o++)s=r[o]*a,f=o<u-1?r[o+1]*a:e.length,h=t(e,s,f,a,!1),h===h.next&&(h.steiner=!0),d.push(E(h));for(d.sort(c),o=0;o<d.length;o++)l(d[o],i),i=n(i,i.next);return i}function c(e,t){return e.x-t.x}function l(e,t){if(t=f(e,t)){var r=g(t,e);n(r,r.next)}}function f(e,t){var n,r=t,i=e.x,a=e.y,o=-(1/0);do{if(a<=r.y&&a>=r.next.y){var u=r.x+(a-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(u<=i&&u>o){if(o=u,u===i){if(a===r.y)return r;if(a===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(i===o)return n.prev;var s,c=n,l=n.x,f=n.y,h=1/0;for(r=n.next;r!==c;)i>=r.x&&r.x>=l&&y(a<f?i:o,a,l,f,a<f?o:i,a,r.x,r.y)&&(s=Math.abs(a-r.y)/(i-r.x),(s<h||s===h&&r.x>n.x)&&A(r,e)&&(n=r,h=s)),r=r.next;return n}function h(e,t,n,r){var i=e;do null===i.z&&(i.z=p(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,d(i)}function d(e){var t,n,r,i,a,o,u,s,c=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,r=n,u=0,t=0;t<c&&(u++,r=r.nextZ,r);t++);for(s=c;u>0||s>0&&r;)0===u?(i=r,r=r.nextZ,s--):0!==s&&r?n.z<=r.z?(i=n,n=n.nextZ,u--):(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,u--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;n=r}a.nextZ=null,c*=2}while(o>1);return e}function p(e,t,n,r,i){return e=32767*(e-n)/i,t=32767*(t-r)/i,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function E(e){var t=e,n=e;do t.x<n.x&&(n=t),t=t.next;while(t!==e);return n}function y(e,t,n,r,i,a,o,u){return(i-o)*(t-u)-(e-o)*(a-u)>=0&&(e-o)*(r-u)-(n-o)*(t-u)>=0&&(n-o)*(a-u)-(i-o)*(r-u)>=0}function m(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!R(e,t)&&A(e,t)&&A(t,e)&&S(e,t)}function _(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function v(e,t){return e.x===t.x&&e.y===t.y}function T(e,t,n,r){return!!(v(e,t)&&v(n,r)||v(e,r)&&v(n,t))||_(e,t,n)>0!=_(e,t,r)>0&&_(n,r,e)>0!=_(n,r,t)>0}function R(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&T(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function A(e,t){return _(e.prev,e,e.next)<0?_(e,t,e.next)>=0&&_(e,e.prev,t)>=0:_(e,t,e.prev)<0||_(e,e.next,t)<0}function S(e,t){var n=e,r=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do n.y>a!=n.next.y>a&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function g(e,t){var n=new I(e.i,e.x,e.y),r=new I(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function N(e,t,n,r){var i=new I(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function x(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function I(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function O(e,t,n,r){for(var i=0,a=t,o=n-r;a<n;a+=r)i+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return i}return e.deviation=function(e,t,n,r){var i=t&&t.length,a=i?t[0]*n:e.length,o=Math.abs(O(e,0,a,n));if(i)for(var u=0,s=t.length;u<s;u++){var c=t[u]*n,l=u<s-1?t[u+1]*n:e.length;o-=Math.abs(O(e,c,l,n))}var f=0;for(u=0;u<r.length;u+=3){var h=r[u]*n,d=r[u+1]*n,p=r[u+2]*n;f+=Math.abs((e[h]-e[p])*(e[d+1]-e[h+1])-(e[h]-e[d])*(e[p+1]-e[h+1]))}return 0===o&&0===f?0:Math.abs((f-o)/o)},e.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,i=0;i<e.length;i++){for(var a=0;a<e[i].length;a++)for(var o=0;o<t;o++)n.vertices.push(e[i][a][o]);i>0&&(r+=e[i-1].length,n.holes.push(r))}return n},e}),define("Core/WindingOrder",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={CLOCKWISE:t.CW,COUNTER_CLOCKWISE:t.CCW,validate:function(e){return e===n.CLOCKWISE||e===n.COUNTER_CLOCKWISE}};return e(n)}),define("Core/PolygonPipeline",["../ThirdParty/earcut-2.1.1","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./Math","./PrimitiveType","./WindingOrder"],function(e,t,n,r,i,a,o,u,s,c,l,f,h){"use strict";var d=new n,p=new n,E={};E.computeArea2D=function(e){for(var t=e.length,n=0,r=t-1,i=0;i<t;r=i++){var a=e[r],o=e[i];n+=a.x*o.y-o.x*a.y}return.5*n},E.computeWindingOrder2D=function(e){var t=E.computeArea2D(e);return t>0?h.COUNTER_CLOCKWISE:h.CLOCKWISE},E.triangulate=function(n,r){var i=t.packArray(n);return e(i,r,2)};var y=new n,m=new n,_=new n,v=new n,T=new n,R=new n,A=new n;return E.computeSubdivision=function(e,t,o,u){u=i(u,l.RADIANS_PER_DEGREE);var h,d=o.slice(0),p=t.length,E=new Array(3*p),S=0;for(h=0;h<p;h++){var g=t[h];E[S++]=g.x,E[S++]=g.y,E[S++]=g.z}for(var N=[],x={},I=e.maximumRadius,O=l.chordLength(u,I),w=O*O;d.length>0;){var M,C,P=d.pop(),D=d.pop(),L=d.pop(),U=n.fromArray(E,3*L,y),b=n.fromArray(E,3*D,m),z=n.fromArray(E,3*P,_),F=n.multiplyByScalar(n.normalize(U,v),I,v),B=n.multiplyByScalar(n.normalize(b,T),I,T),G=n.multiplyByScalar(n.normalize(z,R),I,R),q=n.magnitudeSquared(n.subtract(F,B,A)),W=n.magnitudeSquared(n.subtract(B,G,A)),X=n.magnitudeSquared(n.subtract(G,F,A)),H=Math.max(q,W,X);H>w?q===H?(M=Math.min(L,D)+" "+Math.max(L,D),h=x[M],a(h)||(C=n.add(U,b,A),n.multiplyByScalar(C,.5,C),E.push(C.x,C.y,C.z),h=E.length/3-1,x[M]=h),d.push(L,h,P),d.push(h,D,P)):W===H?(M=Math.min(D,P)+" "+Math.max(D,P),h=x[M],a(h)||(C=n.add(b,z,A),n.multiplyByScalar(C,.5,C),E.push(C.x,C.y,C.z),h=E.length/3-1,x[M]=h),d.push(D,h,L),d.push(h,P,L)):X===H&&(M=Math.min(P,L)+" "+Math.max(P,L),h=x[M],a(h)||(C=n.add(z,U,A),n.multiplyByScalar(C,.5,C),E.push(C.x,C.y,C.z),h=E.length/3-1,x[M]=h),d.push(P,h,D),d.push(h,L,D)):(N.push(L),N.push(D),N.push(P))}return new s({attributes:{position:new c({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:E})},indices:N,primitiveType:f.TRIANGLES})},E.scaleToGeodeticHeight=function(e,t,r,o){r=i(r,u.WGS84);var s=d,c=p;if(t=i(t,0),o=i(o,!0),a(e))for(var l=e.length,f=0;f<l;f+=3)n.fromArray(e,f,c),o&&(c=r.scaleToGeodeticSurface(c,c)),0!==t&&(s=r.geodeticSurfaceNormal(c,s),n.multiplyByScalar(s,t,s),n.add(c,s,c)),e[f]=c.x,e[f+1]=c.y,e[f+2]=c.z;return e},E}),define("Core/Queue",["./defineProperties"],function(e){"use strict";function t(){this._array=[],this._offset=0,this._length=0}return e(t.prototype,{length:{get:function(){return this._length}}}),t.prototype.enqueue=function(e){this._array.push(e),this._length++},t.prototype.dequeue=function(){if(0!==this._length){var e=this._array,t=this._offset,n=e[t];return e[t]=void 0,t++,t>10&&2*t>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,n}},t.prototype.peek=function(){if(0!==this._length)return this._array[this._offset]},t.prototype.contains=function(e){return this._array.indexOf(e)!==-1},t.prototype.clear=function(){this._array.length=this._offset=this._length=0},t.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)},t}),define("Core/PolygonGeometryLibrary",["./arrayRemoveDuplicates","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryPipeline","./IndexDatatype","./Math","./PolygonPipeline","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,n,r,i,a,o,u,s,c,l,f,h,d,p,E){"use strict";function y(e,n,r,i){return t.subtract(n,e,_),t.multiplyByScalar(_,r/i,_),t.add(e,_,_),[_.x,_.y,_.z]}var m={};m.computeHierarchyPackedLength=function(e){for(var n=0,r=[e];r.length>0;){var a=r.pop();if(i(a)){n+=2;var o=a.positions,u=a.holes;if(i(o)&&(n+=o.length*t.packedLength),i(u))for(var s=u.length,c=0;c<s;++c)r.push(u[c])}}return n},m.packPolygonHierarchy=function(e,n,r){for(var a=[e];a.length>0;){var o=a.pop();if(i(o)){var u=o.positions,s=o.holes;if(n[r++]=i(u)?u.length:0,n[r++]=i(s)?s.length:0,i(u))for(var c=u.length,l=0;l<c;++l,r+=3)t.pack(u[l],n,r);if(i(s))for(var f=s.length,h=0;h<f;++h)a.push(s[h])}}return r},m.unpackPolygonHierarchy=function(e,n){for(var r=e[n++],i=e[n++],a=new Array(r),o=i>0?new Array(i):void 0,u=0;u<r;++u,n+=t.packedLength)a[u]=t.unpack(e,n);for(var s=0;s<i;++s)o[s]=m.unpackPolygonHierarchy(e,n),n=o[s].startingIndex,delete o[s].startingIndex;return{positions:a,holes:o,startingIndex:n}};var _=new t;m.subdivideLineCount=function(e,n,r){var i=t.distance(e,n),a=i/r,o=Math.max(0,Math.ceil(Math.log(a)/Math.log(2)));return Math.pow(2,o)},m.subdivideLine=function(e,n,r,a){var o=m.subdivideLineCount(e,n,r),u=t.distance(e,n),s=u/o;i(a)||(a=[]);var c=a;c.length=3*o;for(var l=0,f=0;f<o;f++){var h=y(e,n,f*s,u);c[l++]=h[0],c[l++]=h[1],c[l++]=h[2]}return c};var v=new t,T=new t,R=new t,A=new t;m.scaleToGeodeticHeightExtruded=function(e,n,o,u,s){u=r(u,a.WGS84);var c=v,l=T,f=R,h=A;if(i(e)&&i(e.attributes)&&i(e.attributes.position))for(var d=e.attributes.position.values,p=d.length/2,E=0;E<p;E+=3)t.fromArray(d,E,f),u.geodeticSurfaceNormal(f,c),h=u.scaleToGeodeticSurface(f,h),l=t.multiplyByScalar(c,o,l),l=t.add(h,l,l),d[E+p]=l.x,d[E+1+p]=l.y,d[E+2+p]=l.z,s&&(h=t.clone(f,h)),l=t.multiplyByScalar(c,n,l),l=t.add(h,l,l),d[E]=l.x,d[E+1]=l.y,d[E+2]=l.z;return e},m.polygonsFromHierarchy=function(n,r,a,o){var u=[],s=[],c=new p;for(c.enqueue(n);0!==c.length;){var l=c.dequeue(),f=l.positions,d=l.holes;if(f=e(f,t.equalsEpsilon,!0),!(f.length<3)){var y=a.projectPointsOntoPlane(f),m=[],_=h.computeWindingOrder2D(y);_===E.CLOCKWISE&&(y.reverse(),f=f.slice().reverse());var v,T,R=f.slice(),A=i(d)?d.length:0,S=[];for(v=0;v<A;v++){var g=d[v],N=e(g.positions,t.equalsEpsilon,!0);if(!(N.length<3)){var x=a.projectPointsOntoPlane(N);_=h.computeWindingOrder2D(x),_===E.CLOCKWISE&&(x.reverse(),N=N.slice().reverse()),S.push(N),m.push(R.length),R=R.concat(N),y=y.concat(x);var I=0;for(i(g.holes)&&(I=g.holes.length),T=0;T<I;T++)c.enqueue(g.holes[T])}}if(!r){for(v=0;v<f.length;v++)o.scaleToGeodeticSurface(f[v],f[v]);for(v=0;v<S.length;v++){var O=S[v];for(T=0;T<O.length;++T)o.scaleToGeodeticSurface(O[T],O[T])}}u.push({outerRing:f,holes:S}),s.push({positions:R,positions2D:y,holes:m})}}return{hierarchy:u,polygons:s}},m.createGeometryFromPositions=function(e,t,r,i,a){var s=h.triangulate(t.positions2D,t.holes);s.length<3&&(s=[0,1,2]);var l=t.positions;if(i){for(var f=l.length,p=new Array(3*f),E=0,y=0;y<f;y++){var m=l[y];p[E++]=m.x,p[E++]=m.y,p[E++]=m.z}var _=new o({attributes:{position:new u({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:p})},indices:s,primitiveType:d.TRIANGLES});return a.normal?c.computeNormal(_):_}return h.computeSubdivision(e,l,s,r)};var S=[],g=new t,N=new t;return m.computeWallGeometry=function(e,r,i,a){var c,h,p,E,y,_=e.length,v=0;if(a)for(h=3*_*2,c=new Array(2*h),p=0;p<_;p++)E=e[p],y=e[(p+1)%_],c[v]=c[v+h]=E.x,++v,c[v]=c[v+h]=E.y,++v,c[v]=c[v+h]=E.z,++v,c[v]=c[v+h]=y.x,++v,c[v]=c[v+h]=y.y,++v,c[v]=c[v+h]=y.z,++v;else{var T=f.chordLength(i,r.maximumRadius),R=0;for(p=0;p<_;p++)R+=m.subdivideLineCount(e[p],e[(p+1)%_],T);for(h=3*(R+_),c=new Array(2*h),p=0;p<_;p++){E=e[p],y=e[(p+1)%_];for(var A=m.subdivideLine(E,y,T,S),x=A.length,I=0;I<x;++I,++v)c[v]=A[I],c[v+h]=A[I];c[v]=y.x,c[v+h]=y.x,++v,c[v]=y.y,c[v+h]=y.y,++v,c[v]=y.z,c[v+h]=y.z,++v}}_=c.length;var O=l.createTypedArray(_/3,_-6*e.length),w=0;for(_/=6,p=0;p<_;p++){var M=p,C=M+1,P=M+_,D=P+1;E=t.fromArray(c,3*M,g),y=t.fromArray(c,3*C,N),t.equalsEpsilon(E,y,f.EPSILON14)||(O[w++]=M,O[w++]=P,O[w++]=C,O[w++]=C,O[w++]=P,O[w++]=D)}return new o({attributes:new s({position:new u({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:c})}),indices:O,primitiveType:d.TRIANGLES})},m}),define("Core/PolygonOutlineGeometry",["./arrayRemoveDuplicates","./BoundingSphere","./Cartesian3","./Check","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./PolygonGeometryLibrary","./PolygonPipeline","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,n,r,i,a,o,u,s,c,l,f,h,d,p,E,y,m,_,v,T,R){"use strict";function A(e,t,n,r){var a=c.fromPoints(t,e),o=a.projectPointsOntoPlane(t,N),u=_.computeWindingOrder2D(o);u===R.CLOCKWISE&&(o.reverse(),t=t.slice().reverse());var s,p,y=t.length,T=0;if(r)for(s=new Float64Array(2*y*3),p=0;p<y;p++){var A=t[p],S=t[(p+1)%y];s[T++]=A.x,s[T++]=A.y,s[T++]=A.z,s[T++]=S.x,s[T++]=S.y,s[T++]=S.z}else{var g=0;for(p=0;p<y;p++)g+=m.subdivideLineCount(t[p],t[(p+1)%y],n);for(s=new Float64Array(3*g),p=0;p<y;p++)for(var I=m.subdivideLine(t[p],t[(p+1)%y],n,x),O=I.length,w=0;w<O;++w)s[T++]=I[w]}y=s.length/3;var M=2*y,C=E.createTypedArray(y,M);for(T=0,p=0;p<y-1;p++)C[T++]=p,C[T++]=p+1;return C[T++]=y-1,C[T++]=0,new d({geometry:new l({attributes:new h({position:new f({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:s})}),indices:C,primitiveType:v.LINES})})}function S(e,t,n,r){var a=c.fromPoints(t,e),o=a.projectPointsOntoPlane(t,N),u=_.computeWindingOrder2D(o);u===R.CLOCKWISE&&(o.reverse(),t=t.slice().reverse());var s,p,y=t.length,T=new Array(y),A=0;if(r)for(s=new Float64Array(2*y*3*2),p=0;p<y;++p){T[p]=A/3;var S=t[p],g=t[(p+1)%y];s[A++]=S.x,s[A++]=S.y,s[A++]=S.z,s[A++]=g.x,s[A++]=g.y,s[A++]=g.z}else{var I=0;for(p=0;p<y;p++)I+=m.subdivideLineCount(t[p],t[(p+1)%y],n); +for(s=new Float64Array(3*I*2),p=0;p<y;++p){T[p]=A/3;for(var O=m.subdivideLine(t[p],t[(p+1)%y],n,x),w=O.length,M=0;M<w;++M)s[A++]=O[M]}}y=s.length/6;var C=T.length,P=2*(2*y+C),D=E.createTypedArray(y,P);for(A=0,p=0;p<y;++p)D[A++]=p,D[A++]=(p+1)%y,D[A++]=p+y,D[A++]=(p+1)%y+y;for(p=0;p<C;p++){var L=T[p];D[A++]=L,D[A++]=L+y}return new d({geometry:new l({attributes:new h({position:new f({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:s})}),indices:D,primitiveType:v.LINES})})}function g(e){var t=e.polygonHierarchy,n=a(e.ellipsoid,s.WGS84),r=a(e.granularity,y.RADIANS_PER_DEGREE),i=a(e.height,0),u=a(e.perPositionHeight,!1),c=e.extrudedHeight,l=o(c);if(l&&!u){var f=c;c=Math.min(f,i),i=Math.max(f,i)}this._ellipsoid=s.clone(n),this._granularity=r,this._height=i,this._extrudedHeight=a(c,0),this._extrude=l,this._polygonHierarchy=t,this._perPositionHeight=u,this._workerName="createPolygonOutlineGeometry",this.packedLength=m.computeHierarchyPackedLength(t)+s.packedLength+6}var N=[],x=[];g.pack=function(e,t,n){return n=a(n,0),n=m.packPolygonHierarchy(e._polygonHierarchy,t,n),s.pack(e._ellipsoid,t,n),n+=s.packedLength,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._granularity,t[n++]=e._extrude?1:0,t[n++]=e._perPositionHeight?1:0,t[n++]=e.packedLength,t};var I=s.clone(s.UNIT_SPHERE),O={polygonHierarchy:{}};return g.unpack=function(e,t,n){t=a(t,0);var r=m.unpackPolygonHierarchy(e,t);t=r.startingIndex,delete r.startingIndex;var i=s.unpack(e,t,I);t+=s.packedLength;var u=e[t++],c=e[t++],l=e[t++],f=1===e[t++],h=1===e[t++],d=e[t++];return o(n)||(n=new g(O)),n._polygonHierarchy=r,n._ellipsoid=s.clone(i,n._ellipsoid),n._height=u,n._extrudedHeight=c,n._granularity=l,n._extrude=f,n._perPositionHeight=h,n.packedLength=d,n},g.fromPositions=function(e){e=a(e,a.EMPTY_OBJECT);var t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight};return new g(t)},g.createGeometry=function(r){var i=r._ellipsoid,a=r._granularity,u=r._height,s=r._extrudedHeight,c=r._extrude,f=r._polygonHierarchy,h=r._perPositionHeight,d=[],E=new T;E.enqueue(f);for(var v;0!==E.length;){var R=E.dequeue(),g=R.positions;if(g=e(g,n.equalsEpsilon,!0),!(g.length<3)){var N=R.holes?R.holes.length:0;for(v=0;v<N;v++){var x=R.holes[v];if(x.positions=e(x.positions,n.equalsEpsilon,!0),!(x.positions.length<3)){d.push(x.positions);var I=0;o(x.holes)&&(I=x.holes.length);for(var O=0;O<I;O++)E.enqueue(x.holes[O])}}d.push(g)}}if(0!==d.length){var w,M=[],C=y.chordLength(a,i.maximumRadius);if(c)for(v=0;v<d.length;v++)w=S(i,d[v],C,h),w.geometry=m.scaleToGeodeticHeightExtruded(w.geometry,u,s,i,h),M.push(w);else for(v=0;v<d.length;v++)w=A(i,d[v],C,h),w.geometry.attributes.position.values=_.scaleToGeodeticHeight(w.geometry.attributes.position.values,u,i,!h),M.push(w);w=p.combineInstances(M)[0];var P=t.fromVertices(w.attributes.position.values);return new l({attributes:w.attributes,indices:w.indices,primitiveType:w.primitiveType,boundingSphere:P})}},g}),define("Workers/createPolygonOutlineGeometry",["../Core/defined","../Core/Ellipsoid","../Core/PolygonOutlineGeometry"],function(e,t,n){"use strict";function r(r,i){return e(i)&&(r=n.unpack(r,i)),r._ellipsoid=t.clone(r._ellipsoid),n.createGeometry(r)}return r})}(); \ No newline at end of file diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createPolylineGeometry.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createPolylineGeometry.js index 0d30123b..70f93d9d 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createPolylineGeometry.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createPolylineGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,7 +55,7 @@ mersenne-twister.js - https://gist.github.com/banksean/300494 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -!function(){define("Core/defined",[],function(){"use strict";function t(t){return void 0!==t&&null!==t}return t}),define("Core/freezeObject",["./defined"],function(t){"use strict";var e=Object.freeze;return t(e)||(e=function(t){return t}),e}),define("Core/defaultValue",["./freezeObject"],function(t){"use strict";function e(t,e){return void 0!==t?t:e}return e.EMPTY_OBJECT=t({}),e}),define("Core/DeveloperError",["./defined"],function(t){"use strict";function e(t){this.name="DeveloperError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e.throwInstantiationError=function(){throw new e("This function defines an interface and should not be called directly.")},e}),define("Core/isArray",["./defined"],function(t){"use strict";var e=Array.isArray;return t(e)||(e=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),e}),define("Core/Check",["./defaultValue","./defined","./DeveloperError","./isArray"],function(t,e,r,n){"use strict";function o(t){return t+" was required but undefined."}function a(t,e,r){return"Expected "+r+" to be typeof "+e+", got "+t}var i={};return i.typeOf={},i.numeric={},i.defined=function(t,n){if(!e(t))throw new r(o(n))},i.numeric.maximum=function(t,e){if(i.typeOf.number(t),i.typeOf.number(e),t>e)throw new r("Expected "+t+" to be at most "+e)},i.numeric.minimum=function(t,e){if(i.typeOf.number(t),i.typeOf.number(e),t<e)throw new r("Expected "+t+" to be at least "+e)},i.typeOf.function=function(t,e){if("function"!=typeof t)throw new r(a(typeof t,"function",e))},i.typeOf.string=function(t,e){if("string"!=typeof t)throw new r(a(typeof t,"string",e))},i.typeOf.number=function(t,e){if("number"!=typeof t)throw new r(a(typeof t,"number",e))},i.typeOf.object=function(t,e){if("object"!=typeof t)throw new r(a(typeof t,"object",e))},i.typeOf.boolean=function(t,e){if("boolean"!=typeof t)throw new r(a(typeof t,"boolean",e))},i}),define("ThirdParty/mersenne-twister",[],function(){var t=function(t){void 0==t&&(t=(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(t)};return t.prototype.init_genrand=function(t){for(this.mt[0]=t>>>0,this.mti=1;this.mti<this.N;this.mti++){var t=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&t)>>>16)<<16)+1812433253*(65535&t)+this.mti,this.mt[this.mti]>>>=0}},t.prototype.genrand_int32=function(){var t,e=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++)t=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+this.M]^t>>>1^e[1&t];for(;r<this.N-1;r++)t=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+(this.M-this.N)]^t>>>1^e[1&t];t=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^t>>>1^e[1&t],this.mti=0}return t=this.mt[this.mti++],t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,t^=t>>>18,t>>>0},t.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},t}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(t,e,r,n){"use strict";var o={};o.EPSILON1=.1,o.EPSILON2=.01,o.EPSILON3=.001,o.EPSILON4=1e-4,o.EPSILON5=1e-5,o.EPSILON6=1e-6,o.EPSILON7=1e-7,o.EPSILON8=1e-8,o.EPSILON9=1e-9,o.EPSILON10=1e-10,o.EPSILON11=1e-11,o.EPSILON12=1e-12,o.EPSILON13=1e-13,o.EPSILON14=1e-14,o.EPSILON15=1e-15,o.EPSILON16=1e-16,o.EPSILON17=1e-17,o.EPSILON18=1e-18,o.EPSILON19=1e-19,o.EPSILON20=1e-20,o.GRAVITATIONALPARAMETER=3986004418e5,o.SOLAR_RADIUS=6955e5,o.LUNAR_RADIUS=1737400,o.SIXTY_FOUR_KILOBYTES=65536,o.sign=function(t){return t>0?1:t<0?-1:0},o.signNotZero=function(t){return t<0?-1:1},o.toSNorm=function(t,r){return r=e(r,255),Math.round((.5*o.clamp(t,-1,1)+.5)*r)},o.fromSNorm=function(t,r){return r=e(r,255),o.clamp(t,0,r)/r*2-1},o.sinh=function(t){var e=Math.pow(Math.E,t),r=Math.pow(Math.E,-1*t);return.5*(e-r)},o.cosh=function(t){var e=Math.pow(Math.E,t),r=Math.pow(Math.E,-1*t);return.5*(e+r)},o.lerp=function(t,e,r){return(1-r)*t+r*e},o.PI=Math.PI,o.ONE_OVER_PI=1/Math.PI,o.PI_OVER_TWO=.5*Math.PI,o.PI_OVER_THREE=Math.PI/3,o.PI_OVER_FOUR=Math.PI/4,o.PI_OVER_SIX=Math.PI/6,o.THREE_PI_OVER_TWO=3*Math.PI*.5,o.TWO_PI=2*Math.PI,o.ONE_OVER_TWO_PI=1/(2*Math.PI),o.RADIANS_PER_DEGREE=Math.PI/180,o.DEGREES_PER_RADIAN=180/Math.PI,o.RADIANS_PER_ARCSECOND=o.RADIANS_PER_DEGREE/3600,o.toRadians=function(t){return t*o.RADIANS_PER_DEGREE},o.toDegrees=function(t){return t*o.DEGREES_PER_RADIAN},o.convertLongitudeRange=function(t){var e=o.TWO_PI,r=t-Math.floor(t/e)*e;return r<-Math.PI?r+e:r>=Math.PI?r-e:r},o.clampToLatitudeRange=function(t){return o.clamp(t,-1*o.PI_OVER_TWO,o.PI_OVER_TWO)},o.negativePiToPi=function(t){return o.zeroToTwoPi(t+o.PI)-o.PI},o.zeroToTwoPi=function(t){var e=o.mod(t,o.TWO_PI);return Math.abs(e)<o.EPSILON14&&Math.abs(t)>o.EPSILON14?o.TWO_PI:e},o.mod=function(t,e){return(t%e+e)%e},o.equalsEpsilon=function(t,r,n,o){o=e(o,n);var a=Math.abs(t-r);return a<=o||a<=n*Math.max(Math.abs(t),Math.abs(r))};var a=[1];o.factorial=function(t){var e=a.length;if(t>=e)for(var r=a[e-1],n=e;n<=t;n++)a.push(r*n);return a[t]},o.incrementWrap=function(t,r,n){return n=e(n,0),++t,t>r&&(t=n),t},o.isPowerOfTwo=function(t){return 0!==t&&0===(t&t-1)},o.nextPowerOfTwo=function(t){return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t,t},o.clamp=function(t,e,r){return t<e?e:t>r?r:t};var i=new t;return o.setRandomNumberSeed=function(e){i=new t(e)},o.nextRandomNumber=function(){return i.random()},o.acosClamped=function(t){return Math.acos(o.clamp(t,-1,1))},o.asinClamped=function(t){return Math.asin(o.clamp(t,-1,1))},o.chordLength=function(t,e){return 2*e*Math.sin(.5*t)},o.logBase=function(t,e){return Math.log(t)/Math.log(e)},o.fog=function(t,e){var r=t*e;return 1-Math.exp(-(r*r))},o}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,r,n,o,a){"use strict";function i(t,r,n){this.x=e(t,0),this.y=e(r,0),this.z=e(n,0)}i.fromSpherical=function(t,n){r(n)||(n=new i);var o=t.clock,a=t.cone,u=e(t.magnitude,1),s=u*Math.sin(a);return n.x=s*Math.cos(o),n.y=s*Math.sin(o),n.z=u*Math.cos(a),n},i.fromElements=function(t,e,n,o){return r(o)?(o.x=t,o.y=e,o.z=n,o):new i(t,e,n)},i.clone=function(t,e){if(r(t))return r(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e):new i(t.x,t.y,t.z)},i.fromCartesian4=i.clone,i.packedLength=3,i.pack=function(t,r,n){return n=e(n,0),r[n++]=t.x,r[n++]=t.y,r[n]=t.z,r},i.unpack=function(t,n,o){return n=e(n,0),r(o)||(o=new i),o.x=t[n++],o.y=t[n++],o.z=t[n],o},i.packArray=function(t,e){var n=t.length;r(e)?e.length=3*n:e=new Array(3*n);for(var o=0;o<n;++o)i.pack(t[o],e,3*o);return e},i.unpackArray=function(t,e){var n=t.length;r(e)?e.length=n/3:e=new Array(n/3);for(var o=0;o<n;o+=3){var a=o/3;e[a]=i.unpack(t,o,e[a])}return e},i.fromArray=i.unpack,i.maximumComponent=function(t){return Math.max(t.x,t.y,t.z)},i.minimumComponent=function(t){return Math.min(t.x,t.y,t.z)},i.minimumByComponent=function(t,e,r){return r.x=Math.min(t.x,e.x),r.y=Math.min(t.y,e.y),r.z=Math.min(t.z,e.z),r},i.maximumByComponent=function(t,e,r){return r.x=Math.max(t.x,e.x),r.y=Math.max(t.y,e.y),r.z=Math.max(t.z,e.z),r},i.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z},i.magnitude=function(t){return Math.sqrt(i.magnitudeSquared(t))};var u=new i;i.distance=function(t,e){return i.subtract(t,e,u),i.magnitude(u)},i.distanceSquared=function(t,e){return i.subtract(t,e,u),i.magnitudeSquared(u)},i.normalize=function(t,e){var r=i.magnitude(t);return e.x=t.x/r,e.y=t.y/r,e.z=t.z/r,e},i.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},i.multiplyComponents=function(t,e,r){return r.x=t.x*e.x,r.y=t.y*e.y,r.z=t.z*e.z,r},i.divideComponents=function(t,e,r){return r.x=t.x/e.x,r.y=t.y/e.y,r.z=t.z/e.z,r},i.add=function(t,e,r){return r.x=t.x+e.x,r.y=t.y+e.y,r.z=t.z+e.z,r},i.subtract=function(t,e,r){return r.x=t.x-e.x,r.y=t.y-e.y,r.z=t.z-e.z,r},i.multiplyByScalar=function(t,e,r){return r.x=t.x*e,r.y=t.y*e,r.z=t.z*e,r},i.divideByScalar=function(t,e,r){return r.x=t.x/e,r.y=t.y/e,r.z=t.z/e,r},i.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e},i.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e};var s=new i;i.lerp=function(t,e,r,n){return i.multiplyByScalar(e,r,s),n=i.multiplyByScalar(t,1-r,n),i.add(s,n,n)};var E=new i,c=new i;i.angleBetween=function(t,e){i.normalize(t,E),i.normalize(e,c);var r=i.dot(E,c),n=i.magnitude(i.cross(E,c,E));return Math.atan2(n,r)};var l=new i;i.mostOrthogonalAxis=function(t,e){var r=i.normalize(t,l);return i.abs(r,r),e=r.x<=r.y?r.x<=r.z?i.clone(i.UNIT_X,e):i.clone(i.UNIT_Z,e):r.y<=r.z?i.clone(i.UNIT_Y,e):i.clone(i.UNIT_Z,e)},i.equals=function(t,e){return t===e||r(t)&&r(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z},i.equalsArray=function(t,e,r){return t.x===e[r]&&t.y===e[r+1]&&t.z===e[r+2]},i.equalsEpsilon=function(t,e,n,o){return t===e||r(t)&&r(e)&&a.equalsEpsilon(t.x,e.x,n,o)&&a.equalsEpsilon(t.y,e.y,n,o)&&a.equalsEpsilon(t.z,e.z,n,o)},i.cross=function(t,e,r){var n=t.x,o=t.y,a=t.z,i=e.x,u=e.y,s=e.z,E=o*s-a*u,c=a*i-n*s,l=n*u-o*i;return r.x=E,r.y=c,r.z=l,r},i.fromDegrees=function(t,e,r,n,o){return t=a.toRadians(t),e=a.toRadians(e),i.fromRadians(t,e,r,n,o)};var f=new i,_=new i,R=new i(40680631590769,40680631590769,40408299984661.445);return i.fromRadians=function(t,n,o,a,u){o=e(o,0);var s=r(a)?a.radiiSquared:R,E=Math.cos(n);f.x=E*Math.cos(t),f.y=E*Math.sin(t),f.z=Math.sin(n),f=i.normalize(f,f),i.multiplyComponents(s,f,_);var c=Math.sqrt(i.dot(f,_));return _=i.divideByScalar(_,c,_),f=i.multiplyByScalar(f,o,f),r(u)||(u=new i),i.add(_,f,u)},i.fromDegreesArray=function(t,e,n){var o=t.length;r(n)?n.length=o/2:n=new Array(o/2);for(var a=0;a<o;a+=2){var u=t[a],s=t[a+1],E=a/2;n[E]=i.fromDegrees(u,s,0,e,n[E])}return n},i.fromRadiansArray=function(t,e,n){var o=t.length;r(n)?n.length=o/2:n=new Array(o/2);for(var a=0;a<o;a+=2){var u=t[a],s=t[a+1],E=a/2;n[E]=i.fromRadians(u,s,0,e,n[E])}return n},i.fromDegreesArrayHeights=function(t,e,n){var o=t.length;r(n)?n.length=o/3:n=new Array(o/3);for(var a=0;a<o;a+=3){var u=t[a],s=t[a+1],E=t[a+2],c=a/3;n[c]=i.fromDegrees(u,s,E,e,n[c])}return n},i.fromRadiansArrayHeights=function(t,e,n){var o=t.length;r(n)?n.length=o/3:n=new Array(o/3);for(var a=0;a<o;a+=3){var u=t[a],s=t[a+1],E=t[a+2],c=a/3;n[c]=i.fromRadians(u,s,E,e,n[c])}return n},i.ZERO=o(new i(0,0,0)),i.UNIT_X=o(new i(1,0,0)),i.UNIT_Y=o(new i(0,1,0)),i.UNIT_Z=o(new i(0,0,1)),i.prototype.clone=function(t){return i.clone(this,t)},i.prototype.equals=function(t){return i.equals(this,t)},i.prototype.equalsEpsilon=function(t,e,r){return i.equalsEpsilon(this,t,e,r)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},i}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(t,e,r,n){"use strict";function o(r,o,u,s,E){var c=r.x,l=r.y,f=r.z,_=o.x,R=o.y,h=o.z,T=c*c*_*_,A=l*l*R*R,d=f*f*h*h,S=T+A+d,m=Math.sqrt(1/S),N=t.multiplyByScalar(r,m,a);if(S<s)return isFinite(m)?t.clone(N,E):void 0;var C=u.x,I=u.y,p=u.z,M=i;M.x=N.x*C*2,M.y=N.y*I*2,M.z=N.z*p*2;var O,g,y,F,L,v,U,D,P,w,B,x=(1-m)*t.magnitude(r)/(.5*t.magnitude(M)),b=0;do{x-=b,y=1/(1+x*C),F=1/(1+x*I),L=1/(1+x*p),v=y*y,U=F*F,D=L*L,P=v*y,w=U*F,B=D*L,O=T*v+A*U+d*D-1,g=T*P*C+A*w*I+d*B*p;var G=-2*g;b=O/G}while(Math.abs(O)>n.EPSILON12);return e(E)?(E.x=c*y,E.y=l*F,E.z=f*L,E):new t(c*y,l*F,f*L)}var a=new t,i=new t;return o}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,r,n,o,a,i){"use strict";function u(t,r,n){this.longitude=e(t,0),this.latitude=e(r,0),this.height=e(n,0)}u.fromRadians=function(t,n,o,a){return o=e(o,0),r(a)?(a.longitude=t,a.latitude=n,a.height=o,a):new u(t,n,o)},u.fromDegrees=function(t,e,r,n){return t=a.toRadians(t),e=a.toRadians(e),u.fromRadians(t,e,r,n)};var s=new t,E=new t,c=new t,l=new t(1/6378137,1/6378137,1/6356752.314245179),f=new t(1/40680631590769,1/40680631590769,1/40408299984661.445),_=a.EPSILON1;return u.fromCartesian=function(e,n,o){var R=r(n)?n.oneOverRadii:l,h=r(n)?n.oneOverRadiiSquared:f,T=r(n)?n._centerToleranceSquared:_,A=i(e,R,h,T,E);if(r(A)){var d=t.multiplyComponents(A,h,s);d=t.normalize(d,d);var S=t.subtract(e,A,c),m=Math.atan2(d.y,d.x),N=Math.asin(d.z),C=a.sign(t.dot(S,e))*t.magnitude(S);return r(o)?(o.longitude=m,o.latitude=N,o.height=C,o):new u(m,N,C)}},u.clone=function(t,e){if(r(t))return r(e)?(e.longitude=t.longitude,e.latitude=t.latitude,e.height=t.height,e):new u(t.longitude,t.latitude,t.height)},u.equals=function(t,e){return t===e||r(t)&&r(e)&&t.longitude===e.longitude&&t.latitude===e.latitude&&t.height===e.height},u.equalsEpsilon=function(t,e,n){return t===e||r(t)&&r(e)&&Math.abs(t.longitude-e.longitude)<=n&&Math.abs(t.latitude-e.latitude)<=n&&Math.abs(t.height-e.height)<=n},u.ZERO=o(new u(0,0,0)),u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.prototype.equalsEpsilon=function(t,e){return u.equalsEpsilon(this,t,e)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(t){"use strict";var e=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(t){return!1}}(),r=Object.defineProperties;return e&&t(r)||(r=function(t){return t}),r}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,r,n,o,a,i,u,s){"use strict";function E(e,n,o,a){n=r(n,0),o=r(o,0),a=r(a,0),e._radii=new t(n,o,a),e._radiiSquared=new t(n*n,o*o,a*a),e._radiiToTheFourth=new t(n*n*n*n,o*o*o*o,a*a*a*a),e._oneOverRadii=new t(0===n?0:1/n,0===o?0:1/o,0===a?0:1/a),e._oneOverRadiiSquared=new t(0===n?0:1/(n*n),0===o?0:1/(o*o),0===a?0:1/(a*a)),e._minimumRadius=Math.min(n,o,a),e._maximumRadius=Math.max(n,o,a),e._centerToleranceSquared=u.EPSILON1,0!==e._radiiSquared.z&&(e._sqauredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function c(t,e,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,this._sqauredXOverSquaredZ=void 0,E(this,t,e,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(e,r){if(n(e)){var o=e._radii;return n(r)?(t.clone(o,r._radii),t.clone(e._radiiSquared,r._radiiSquared),t.clone(e._radiiToTheFourth,r._radiiToTheFourth),t.clone(e._oneOverRadii,r._oneOverRadii),t.clone(e._oneOverRadiiSquared,r._oneOverRadiiSquared),r._minimumRadius=e._minimumRadius,r._maximumRadius=e._maximumRadius,r._centerToleranceSquared=e._centerToleranceSquared,r):new c(o.x,o.y,o.z)}},c.fromCartesian3=function(t,e){return n(e)||(e=new c),n(t)?(E(e,t.x,t.y,t.z),e):e},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(t){return c.clone(this,t)},c.packedLength=t.packedLength,c.pack=function(e,n,o){return o=r(o,0),t.pack(e._radii,n,o),n},c.unpack=function(e,n,o){n=r(n,0);var a=t.unpack(e,n);return c.fromCartesian3(a,o)},c.prototype.geocentricSurfaceNormal=t.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(e,r){var o=e.longitude,a=e.latitude,i=Math.cos(a),u=i*Math.cos(o),s=i*Math.sin(o),E=Math.sin(a);return n(r)||(r=new t),r.x=u,r.y=s,r.z=E,t.normalize(r,r)},c.prototype.geodeticSurfaceNormal=function(e,r){return n(r)||(r=new t),r=t.multiplyComponents(e,this._oneOverRadiiSquared,r),t.normalize(r,r)};var l=new t,f=new t;c.prototype.cartographicToCartesian=function(e,r){var o=l,a=f;this.geodeticSurfaceNormalCartographic(e,o),t.multiplyComponents(this._radiiSquared,o,a);var i=Math.sqrt(t.dot(o,a));return t.divideByScalar(a,i,a),t.multiplyByScalar(o,e.height,o),n(r)||(r=new t),t.add(a,o,r)},c.prototype.cartographicArrayToCartesianArray=function(t,e){var r=t.length;n(e)?e.length=r:e=new Array(r);for(var o=0;o<r;o++)e[o]=this.cartographicToCartesian(t[o],e[o]);return e};var _=new t,R=new t,h=new t;return c.prototype.cartesianToCartographic=function(r,o){var a=this.scaleToGeodeticSurface(r,R);if(n(a)){var i=this.geodeticSurfaceNormal(a,_),s=t.subtract(r,a,h),E=Math.atan2(i.y,i.x),c=Math.asin(i.z),l=u.sign(t.dot(s,r))*t.magnitude(s);return n(o)?(o.longitude=E,o.latitude=c,o.height=l,o):new e(E,c,l)}},c.prototype.cartesianArrayToCartographicArray=function(t,e){var r=t.length;n(e)?e.length=r:e=new Array(r);for(var o=0;o<r;++o)e[o]=this.cartesianToCartographic(t[o],e[o]);return e},c.prototype.scaleToGeodeticSurface=function(t,e){return s(t,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,e)},c.prototype.scaleToGeocentricSurface=function(e,r){n(r)||(r=new t);var o=e.x,a=e.y,i=e.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(o*o*u.x+a*a*u.y+i*i*u.z);return t.multiplyByScalar(e,s,r)},c.prototype.transformPositionToScaledSpace=function(e,r){return n(r)||(r=new t),t.multiplyComponents(e,this._oneOverRadii,r)},c.prototype.transformPositionFromScaledSpace=function(e,r){return n(r)||(r=new t),t.multiplyComponents(e,this._radii,r)},c.prototype.equals=function(e){return this===e||n(e)&&t.equals(this._radii,e._radii)},c.prototype.toString=function(){return this._radii.toString()},c.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,o,a){o=r(o,0);var i=this._sqauredXOverSquaredZ;if(n(a)||(a=new t),a.x=0,a.y=0,a.z=e.z*(1-i),!(Math.abs(a.z)>=this._radii.z-o))return a},c}),define("Core/arrayRemoveDuplicates",["./defaultValue","./defined","./DeveloperError","./Math"],function(t,e,r,n){"use strict";function o(r,n,o){if(e(r)){o=t(o,!1);var i=r.length;if(i<2)return r;var u,s,E;for(u=1;u<i&&(s=r[u-1],E=r[u],!n(s,E,a));++u);if(u===i)return o&&n(r[0],r[r.length-1],a)?r.slice(1):r;for(var c=r.slice(0,u);u<i;++u)E=r[u],n(s,E,a)||(c.push(E),s=E);return o&&c.length>1&&n(c[0],c[c.length-1],a)&&c.shift(),c}}var a=n.EPSILON10;return o}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(t,e,r,n,o,a,i){"use strict";function u(t){this._ellipsoid=r(t,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(e,r){var o=this._semimajorAxis,a=e.longitude*o,i=e.latitude*o,u=e.height;return n(r)?(r.x=a,r.y=i,r.z=u,r):new t(a,i,u)},u.prototype.unproject=function(t,r){var o=this._oneOverSemimajorAxis,a=t.x*o,i=t.y*o,u=t.z;return n(r)?(r.longitude=a,r.latitude=i,r.height=u,r):new e(a,i,u)},u}),define("Core/Intersect",["./freezeObject"],function(t){"use strict";var e={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return t(e)}),define("Core/Interval",["./defaultValue"],function(t){"use strict";function e(e,r){this.start=t(e,0),this.stop=t(r,0)}return e}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(t,e,r,n,o,a,i){"use strict";function u(t,r,n,o,a,i,u,s,E){this[0]=e(t,0),this[1]=e(o,0),this[2]=e(u,0),this[3]=e(r,0),this[4]=e(a,0),this[5]=e(s,0),this[6]=e(n,0),this[7]=e(i,0),this[8]=e(E,0)}function s(t){for(var e=0,r=0;r<9;++r){var n=t[r];e+=n*n}return Math.sqrt(e)}function E(t){for(var e=0,r=0;r<3;++r){var n=t[u.getElementIndex(R[r],_[r])];e+=2*n*n}return Math.sqrt(e)}function c(t,e){for(var r=i.EPSILON15,n=0,o=1,a=0;a<3;++a){var s=Math.abs(t[u.getElementIndex(R[a],_[a])]);s>n&&(o=a,n=s)}var E=1,c=0,l=_[o],f=R[o];if(Math.abs(t[u.getElementIndex(f,l)])>r){var h,T=t[u.getElementIndex(f,f)],A=t[u.getElementIndex(l,l)],d=t[u.getElementIndex(f,l)],S=(T-A)/2/d;h=S<0?-1/(-S+Math.sqrt(1+S*S)):1/(S+Math.sqrt(1+S*S)),E=1/Math.sqrt(1+h*h),c=h*E}return e=u.clone(u.IDENTITY,e),e[u.getElementIndex(l,l)]=e[u.getElementIndex(f,f)]=E,e[u.getElementIndex(f,l)]=c,e[u.getElementIndex(l,f)]=-c,e}u.packedLength=9,u.pack=function(t,r,n){return n=e(n,0),r[n++]=t[0],r[n++]=t[1],r[n++]=t[2],r[n++]=t[3],r[n++]=t[4],r[n++]=t[5],r[n++]=t[6],r[n++]=t[7],r[n++]=t[8],r},u.unpack=function(t,n,o){return n=e(n,0),r(o)||(o=new u),o[0]=t[n++],o[1]=t[n++],o[2]=t[n++],o[3]=t[n++],o[4]=t[n++],o[5]=t[n++],o[6]=t[n++],o[7]=t[n++],o[8]=t[n++],o},u.clone=function(t,e){if(r(t))return r(e)?(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):new u(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8])},u.fromArray=function(t,n,o){return n=e(n,0),r(o)||(o=new u),o[0]=t[n],o[1]=t[n+1],o[2]=t[n+2],o[3]=t[n+3],o[4]=t[n+4],o[5]=t[n+5],o[6]=t[n+6],o[7]=t[n+7],o[8]=t[n+8],o},u.fromColumnMajorArray=function(t,e){return u.clone(t,e)},u.fromRowMajorArray=function(t,e){return r(e)?(e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],e):new u(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},u.fromQuaternion=function(t,e){var n=t.x*t.x,o=t.x*t.y,a=t.x*t.z,i=t.x*t.w,s=t.y*t.y,E=t.y*t.z,c=t.y*t.w,l=t.z*t.z,f=t.z*t.w,_=t.w*t.w,R=n-s-l+_,h=2*(o-f),T=2*(a+c),A=2*(o+f),d=-n+s-l+_,S=2*(E-i),m=2*(a-c),N=2*(E+i),C=-n-s+l+_;return r(e)?(e[0]=R,e[1]=A,e[2]=m,e[3]=h,e[4]=d,e[5]=N,e[6]=T,e[7]=S,e[8]=C,e):new u(R,h,T,A,d,S,m,N,C)},u.fromHeadingPitchRoll=function(t,e){var n=Math.cos(-t.pitch),o=Math.cos(-t.heading),a=Math.cos(t.roll),i=Math.sin(-t.pitch),s=Math.sin(-t.heading),E=Math.sin(t.roll),c=n*o,l=-a*s+E*i*o,f=E*s+a*i*o,_=n*s,R=a*o+E*i*s,h=-i*a+a*i*s,T=-i,A=E*n,d=a*n;return r(e)?(e[0]=c,e[1]=_,e[2]=T,e[3]=l,e[4]=R,e[5]=A,e[6]=f,e[7]=h,e[8]=d,e):new u(c,l,f,_,R,h,T,A,d)},u.fromScale=function(t,e){return r(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=t.y,e[5]=0,e[6]=0,e[7]=0,e[8]=t.z,e):new u(t.x,0,0,0,t.y,0,0,0,t.z)},u.fromUniformScale=function(t,e){return r(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=t,e[5]=0,e[6]=0,e[7]=0,e[8]=t,e):new u(t,0,0,0,t,0,0,0,t)},u.fromCrossProduct=function(t,e){return r(e)?(e[0]=0,e[1]=t.z,e[2]=-t.y,e[3]=-t.z,e[4]=0,e[5]=t.x,e[6]=t.y,e[7]=-t.x,e[8]=0,e):new u(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},u.fromRotationX=function(t,e){var n=Math.cos(t),o=Math.sin(t);return r(e)?(e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=n,e[5]=o,e[6]=0,e[7]=-o,e[8]=n,e):new u(1,0,0,0,n,-o,0,o,n)},u.fromRotationY=function(t,e){var n=Math.cos(t),o=Math.sin(t);return r(e)?(e[0]=n,e[1]=0,e[2]=-o,e[3]=0,e[4]=1,e[5]=0,e[6]=o,e[7]=0,e[8]=n,e):new u(n,0,o,0,1,0,-o,0,n)},u.fromRotationZ=function(t,e){var n=Math.cos(t),o=Math.sin(t);return r(e)?(e[0]=n,e[1]=o,e[2]=0,e[3]=-o,e[4]=n,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e):new u(n,-o,0,o,n,0,0,0,1)},u.toArray=function(t,e){return r(e)?(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):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},u.getElementIndex=function(t,e){return 3*t+e},u.getColumn=function(t,e,r){var n=3*e,o=t[n],a=t[n+1],i=t[n+2];return r.x=o,r.y=a,r.z=i,r},u.setColumn=function(t,e,r,n){n=u.clone(t,n);var o=3*e;return n[o]=r.x,n[o+1]=r.y,n[o+2]=r.z,n},u.getRow=function(t,e,r){var n=t[e],o=t[e+3],a=t[e+6];return r.x=n,r.y=o,r.z=a,r},u.setRow=function(t,e,r,n){return n=u.clone(t,n),n[e]=r.x,n[e+3]=r.y,n[e+6]=r.z,n};var l=new t;u.getScale=function(e,r){return r.x=t.magnitude(t.fromElements(e[0],e[1],e[2],l)),r.y=t.magnitude(t.fromElements(e[3],e[4],e[5],l)),r.z=t.magnitude(t.fromElements(e[6],e[7],e[8],l)),r};var f=new t;u.getMaximumScale=function(e){return u.getScale(e,f),t.maximumComponent(f)},u.multiply=function(t,e,r){var n=t[0]*e[0]+t[3]*e[1]+t[6]*e[2],o=t[1]*e[0]+t[4]*e[1]+t[7]*e[2],a=t[2]*e[0]+t[5]*e[1]+t[8]*e[2],i=t[0]*e[3]+t[3]*e[4]+t[6]*e[5],u=t[1]*e[3]+t[4]*e[4]+t[7]*e[5],s=t[2]*e[3]+t[5]*e[4]+t[8]*e[5],E=t[0]*e[6]+t[3]*e[7]+t[6]*e[8],c=t[1]*e[6]+t[4]*e[7]+t[7]*e[8],l=t[2]*e[6]+t[5]*e[7]+t[8]*e[8];return r[0]=n,r[1]=o,r[2]=a,r[3]=i,r[4]=u,r[5]=s,r[6]=E,r[7]=c,r[8]=l,r},u.add=function(t,e,r){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r[2]=t[2]+e[2],r[3]=t[3]+e[3],r[4]=t[4]+e[4],r[5]=t[5]+e[5],r[6]=t[6]+e[6],r[7]=t[7]+e[7],r[8]=t[8]+e[8],r},u.subtract=function(t,e,r){return r[0]=t[0]-e[0],r[1]=t[1]-e[1],r[2]=t[2]-e[2],r[3]=t[3]-e[3],r[4]=t[4]-e[4],r[5]=t[5]-e[5],r[6]=t[6]-e[6],r[7]=t[7]-e[7],r[8]=t[8]-e[8],r},u.multiplyByVector=function(t,e,r){var n=e.x,o=e.y,a=e.z,i=t[0]*n+t[3]*o+t[6]*a,u=t[1]*n+t[4]*o+t[7]*a,s=t[2]*n+t[5]*o+t[8]*a;return r.x=i,r.y=u,r.z=s,r},u.multiplyByScalar=function(t,e,r){return r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e,r[3]=t[3]*e,r[4]=t[4]*e,r[5]=t[5]*e,r[6]=t[6]*e,r[7]=t[7]*e,r[8]=t[8]*e,r},u.multiplyByScale=function(t,e,r){return r[0]=t[0]*e.x,r[1]=t[1]*e.x,r[2]=t[2]*e.x,r[3]=t[3]*e.y,r[4]=t[4]*e.y,r[5]=t[5]*e.y,r[6]=t[6]*e.z,r[7]=t[7]*e.z,r[8]=t[8]*e.z,r},u.negate=function(t,e){return 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},u.transpose=function(t,e){var r=t[0],n=t[3],o=t[6],a=t[1],i=t[4],u=t[7],s=t[2],E=t[5],c=t[8];return e[0]=r,e[1]=n,e[2]=o,e[3]=a,e[4]=i,e[5]=u,e[6]=s,e[7]=E,e[8]=c,e};var _=[1,0,0],R=[2,2,1],h=new u,T=new u;return u.computeEigenDecomposition=function(t,e){var n=i.EPSILON20,o=10,a=0,l=0;r(e)||(e={});for(var f=e.unitary=u.clone(u.IDENTITY,e.unitary),_=e.diagonal=u.clone(t,e.diagonal),R=n*s(_);l<o&&E(_)>R;)c(_,h),u.transpose(h,T),u.multiply(_,h,_),u.multiply(T,_,_),u.multiply(f,h,f),++a>2&&(++l,a=0);return e},u.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e},u.determinant=function(t){var e=t[0],r=t[3],n=t[6],o=t[1],a=t[4],i=t[7],u=t[2],s=t[5],E=t[8];return e*(a*E-s*i)+o*(s*n-r*E)+u*(r*i-a*n)},u.inverse=function(t,e){var r=t[0],n=t[1],o=t[2],a=t[3],i=t[4],s=t[5],E=t[6],c=t[7],l=t[8],f=u.determinant(t);e[0]=i*l-c*s,e[1]=c*o-n*l,e[2]=n*s-i*o,e[3]=E*s-a*l,e[4]=r*l-E*o,e[5]=a*o-r*s,e[6]=a*c-E*i,e[7]=E*n-r*c,e[8]=r*i-a*n;var _=1/f;return u.multiplyByScalar(e,_,e)},u.equals=function(t,e){return t===e||r(t)&&r(e)&&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]},u.equalsEpsilon=function(t,e,n){return t===e||r(t)&&r(e)&&Math.abs(t[0]-e[0])<=n&&Math.abs(t[1]-e[1])<=n&&Math.abs(t[2]-e[2])<=n&&Math.abs(t[3]-e[3])<=n&&Math.abs(t[4]-e[4])<=n&&Math.abs(t[5]-e[5])<=n&&Math.abs(t[6]-e[6])<=n&&Math.abs(t[7]-e[7])<=n&&Math.abs(t[8]-e[8])<=n},u.IDENTITY=a(new u(1,0,0,0,1,0,0,0,1)),u.ZERO=a(new u(0,0,0,0,0,0,0,0,0)),u.COLUMN0ROW0=0,u.COLUMN0ROW1=1,u.COLUMN0ROW2=2,u.COLUMN1ROW0=3,u.COLUMN1ROW1=4,u.COLUMN1ROW2=5,u.COLUMN2ROW0=6,u.COLUMN2ROW1=7,u.COLUMN2ROW2=8,n(u.prototype,{length:{get:function(){return u.packedLength}}}),u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.equalsArray=function(t,e,r){return t[0]===e[r]&&t[1]===e[r+1]&&t[2]===e[r+2]&&t[3]===e[r+3]&&t[4]===e[r+4]&&t[5]===e[r+5]&&t[6]===e[r+6]&&t[7]===e[r+7]&&t[8]===e[r+8]},u.prototype.equalsEpsilon=function(t,e){return u.equalsEpsilon(this,t,e)},u.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},u}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,r,n,o){"use strict";function a(e,r,n,o){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0),this.w=t(o,0)}a.fromElements=function(t,r,n,o,i){return e(i)?(i.x=t,i.y=r,i.z=n,i.w=o,i):new a(t,r,n,o)},a.fromColor=function(t,r){return e(r)?(r.x=t.red,r.y=t.green,r.z=t.blue,r.w=t.alpha,r):new a(t.red,t.green,t.blue,t.alpha)},a.clone=function(t,r){if(e(t))return e(r)?(r.x=t.x,r.y=t.y,r.z=t.z,r.w=t.w,r):new a(t.x,t.y,t.z,t.w)},a.packedLength=4,a.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n++]=e.z,r[n]=e.w,r},a.unpack=function(r,n,o){return n=t(n,0),e(o)||(o=new a),o.x=r[n++],o.y=r[n++],o.z=r[n++],o.w=r[n],o},a.packArray=function(t,r){var n=t.length;e(r)?r.length=4*n:r=new Array(4*n);for(var o=0;o<n;++o)a.pack(t[o],r,4*o);return r},a.unpackArray=function(t,r){var n=t.length;e(r)?r.length=n/4:r=new Array(n/4);for(var o=0;o<n;o+=4){var i=o/4;r[i]=a.unpack(t,o,r[i])}return r},a.fromArray=a.unpack,a.maximumComponent=function(t){return Math.max(t.x,t.y,t.z,t.w)},a.minimumComponent=function(t){return Math.min(t.x,t.y,t.z,t.w)},a.minimumByComponent=function(t,e,r){return r.x=Math.min(t.x,e.x),r.y=Math.min(t.y,e.y),r.z=Math.min(t.z,e.z),r.w=Math.min(t.w,e.w),r},a.maximumByComponent=function(t,e,r){return r.x=Math.max(t.x,e.x),r.y=Math.max(t.y,e.y),r.z=Math.max(t.z,e.z),r.w=Math.max(t.w,e.w),r},a.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w},a.magnitude=function(t){return Math.sqrt(a.magnitudeSquared(t))};var i=new a;a.distance=function(t,e){return a.subtract(t,e,i),a.magnitude(i)},a.distanceSquared=function(t,e){return a.subtract(t,e,i),a.magnitudeSquared(i)},a.normalize=function(t,e){var r=a.magnitude(t);return e.x=t.x/r,e.y=t.y/r,e.z=t.z/r,e.w=t.w/r,e},a.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z+t.w*e.w},a.multiplyComponents=function(t,e,r){return r.x=t.x*e.x,r.y=t.y*e.y,r.z=t.z*e.z,r.w=t.w*e.w,r},a.divideComponents=function(t,e,r){return r.x=t.x/e.x,r.y=t.y/e.y,r.z=t.z/e.z,r.w=t.w/e.w,r},a.add=function(t,e,r){return r.x=t.x+e.x,r.y=t.y+e.y,r.z=t.z+e.z,r.w=t.w+e.w,r},a.subtract=function(t,e,r){return r.x=t.x-e.x,r.y=t.y-e.y,r.z=t.z-e.z,r.w=t.w-e.w,r},a.multiplyByScalar=function(t,e,r){return r.x=t.x*e,r.y=t.y*e,r.z=t.z*e,r.w=t.w*e,r},a.divideByScalar=function(t,e,r){return r.x=t.x/e,r.y=t.y/e,r.z=t.z/e,r.w=t.w/e,r},a.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e.w=-t.w,e},a.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e.w=Math.abs(t.w),e};var u=new a;a.lerp=function(t,e,r,n){return a.multiplyByScalar(e,r,u),n=a.multiplyByScalar(t,1-r,n),a.add(u,n,n)};var s=new a;return a.mostOrthogonalAxis=function(t,e){var r=a.normalize(t,s);return a.abs(r,r),e=r.x<=r.y?r.x<=r.z?r.x<=r.w?a.clone(a.UNIT_X,e):a.clone(a.UNIT_W,e):r.z<=r.w?a.clone(a.UNIT_Z,e):a.clone(a.UNIT_W,e):r.y<=r.z?r.y<=r.w?a.clone(a.UNIT_Y,e):a.clone(a.UNIT_W,e):r.z<=r.w?a.clone(a.UNIT_Z,e):a.clone(a.UNIT_W,e)},a.equals=function(t,r){return t===r||e(t)&&e(r)&&t.x===r.x&&t.y===r.y&&t.z===r.z&&t.w===r.w},a.equalsArray=function(t,e,r){return t.x===e[r]&&t.y===e[r+1]&&t.z===e[r+2]&&t.w===e[r+3]},a.equalsEpsilon=function(t,r,n,a){return t===r||e(t)&&e(r)&&o.equalsEpsilon(t.x,r.x,n,a)&&o.equalsEpsilon(t.y,r.y,n,a)&&o.equalsEpsilon(t.z,r.z,n,a)&&o.equalsEpsilon(t.w,r.w,n,a)},a.ZERO=n(new a(0,0,0,0)),a.UNIT_X=n(new a(1,0,0,0)),a.UNIT_Y=n(new a(0,1,0,0)),a.UNIT_Z=n(new a(0,0,1,0)),a.UNIT_W=n(new a(0,0,0,1)),a.prototype.clone=function(t){return a.clone(this,t)},a.prototype.equals=function(t){return a.equals(this,t)},a.prototype.equalsEpsilon=function(t,e,r){return a.equalsEpsilon(this,t,e,r)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},a}),define("Core/RuntimeError",["./defined"],function(t){"use strict";function e(t){this.name="RuntimeError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e), -e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(t,e,r,n,o,a,i,u,s,E){"use strict";function c(t,e,n,o,a,i,u,s,E,c,l,f,_,R,h,T){this[0]=r(t,0),this[1]=r(a,0),this[2]=r(E,0),this[3]=r(_,0),this[4]=r(e,0),this[5]=r(i,0),this[6]=r(c,0),this[7]=r(R,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(l,0),this[11]=r(h,0),this[12]=r(o,0),this[13]=r(s,0),this[14]=r(f,0),this[15]=r(T,0)}c.packedLength=16,c.pack=function(t,e,n){return n=r(n,0),e[n++]=t[0],e[n++]=t[1],e[n++]=t[2],e[n++]=t[3],e[n++]=t[4],e[n++]=t[5],e[n++]=t[6],e[n++]=t[7],e[n++]=t[8],e[n++]=t[9],e[n++]=t[10],e[n++]=t[11],e[n++]=t[12],e[n++]=t[13],e[n++]=t[14],e[n]=t[15],e},c.unpack=function(t,e,o){return e=r(e,0),n(o)||(o=new c),o[0]=t[e++],o[1]=t[e++],o[2]=t[e++],o[3]=t[e++],o[4]=t[e++],o[5]=t[e++],o[6]=t[e++],o[7]=t[e++],o[8]=t[e++],o[9]=t[e++],o[10]=t[e++],o[11]=t[e++],o[12]=t[e++],o[13]=t[e++],o[14]=t[e++],o[15]=t[e],o},c.clone=function(t,e){if(n(t))return n(e)?(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],e):new c(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15])},c.fromArray=c.unpack,c.fromColumnMajorArray=function(t,e){return c.clone(t,e)},c.fromRowMajorArray=function(t,e){return n(e)?(e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15],e):new c(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},c.fromRotationTranslation=function(e,o,a){return o=r(o,t.ZERO),n(a)?(a[0]=e[0],a[1]=e[1],a[2]=e[2],a[3]=0,a[4]=e[3],a[5]=e[4],a[6]=e[5],a[7]=0,a[8]=e[6],a[9]=e[7],a[10]=e[8],a[11]=0,a[12]=o.x,a[13]=o.y,a[14]=o.z,a[15]=1,a):new c(e[0],e[3],e[6],o.x,e[1],e[4],e[7],o.y,e[2],e[5],e[8],o.z,0,0,0,1)},c.fromTranslationQuaternionRotationScale=function(t,e,r,o){n(o)||(o=new c);var a=r.x,i=r.y,u=r.z,s=e.x*e.x,E=e.x*e.y,l=e.x*e.z,f=e.x*e.w,_=e.y*e.y,R=e.y*e.z,h=e.y*e.w,T=e.z*e.z,A=e.z*e.w,d=e.w*e.w,S=s-_-T+d,m=2*(E-A),N=2*(l+h),C=2*(E+A),I=-s+_-T+d,p=2*(R-f),M=2*(l-h),O=2*(R+f),g=-s-_+T+d;return o[0]=S*a,o[1]=C*a,o[2]=M*a,o[3]=0,o[4]=m*i,o[5]=I*i,o[6]=O*i,o[7]=0,o[8]=N*u,o[9]=p*u,o[10]=g*u,o[11]=0,o[12]=t.x,o[13]=t.y,o[14]=t.z,o[15]=1,o},c.fromTranslationRotationScale=function(t,e){return c.fromTranslationQuaternionRotationScale(t.translation,t.rotation,t.scale,e)},c.fromTranslation=function(t,e){return c.fromRotationTranslation(s.IDENTITY,t,e)},c.fromScale=function(t,e){return n(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t.y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t.z,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new c(t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1)},c.fromUniformScale=function(t,e){return n(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new c(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1)};var l=new t,f=new t,_=new t;c.fromCamera=function(e,r){var o=e.position,a=e.direction,i=e.up;t.normalize(a,l),t.normalize(t.cross(l,i,f),f),t.normalize(t.cross(f,l,_),_);var u=f.x,s=f.y,E=f.z,R=l.x,h=l.y,T=l.z,A=_.x,d=_.y,S=_.z,m=o.x,N=o.y,C=o.z,I=u*-m+s*-N+E*-C,p=A*-m+d*-N+S*-C,M=R*m+h*N+T*C;return n(r)?(r[0]=u,r[1]=A,r[2]=-R,r[3]=0,r[4]=s,r[5]=d,r[6]=-h,r[7]=0,r[8]=E,r[9]=S,r[10]=-T,r[11]=0,r[12]=I,r[13]=p,r[14]=M,r[15]=1,r):new c(u,s,E,I,A,d,S,p,-R,-h,-T,M,0,0,0,1)},c.computePerspectiveFieldOfView=function(t,e,r,n,o){var a=Math.tan(.5*t),i=1/a,u=i/e,s=(n+r)/(r-n),E=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]=E,o[15]=0,o},c.computeOrthographicOffCenter=function(t,e,r,n,o,a,i){var u=1/(e-t),s=1/(n-r),E=1/(a-o),c=-(e+t)*u,l=-(n+r)*s,f=-(a+o)*E;return u*=2,s*=2,E*=-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]=E,i[11]=0,i[12]=c,i[13]=l,i[14]=f,i[15]=1,i},c.computePerspectiveOffCenter=function(t,e,r,n,o,a,i){var u=2*o/(e-t),s=2*o/(n-r),E=(e+t)/(e-t),c=(n+r)/(n-r),l=-(a+o)/(a-o),f=-1,_=-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]=E,i[9]=c,i[10]=l,i[11]=f,i[12]=0,i[13]=0,i[14]=_,i[15]=0,i},c.computeInfinitePerspectiveOffCenter=function(t,e,r,n,o,a){var i=2*o/(e-t),u=2*o/(n-r),s=(e+t)/(e-t),E=(n+r)/(n-r),c=-1,l=-1,f=-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]=E,a[10]=c,a[11]=l,a[12]=0,a[13]=0,a[14]=f,a[15]=0,a},c.computeViewportTransformation=function(t,e,n,o){t=r(t,r.EMPTY_OBJECT);var a=r(t.x,0),i=r(t.y,0),u=r(t.width,0),s=r(t.height,0);e=r(e,0),n=r(n,1);var E=.5*u,c=.5*s,l=.5*(n-e),f=E,_=c,R=l,h=a+E,T=i+c,A=e+l,d=1;return o[0]=f,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=_,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=R,o[11]=0,o[12]=h,o[13]=T,o[14]=A,o[15]=d,o},c.computeView=function(e,r,n,o,a){return a[0]=o.x,a[1]=n.x,a[2]=-r.x,a[3]=0,a[4]=o.y,a[5]=n.y,a[6]=-r.y,a[7]=0,a[8]=o.z,a[9]=n.z,a[10]=-r.z,a[11]=0,a[12]=-t.dot(o,e),a[13]=-t.dot(n,e),a[14]=t.dot(r,e),a[15]=1,a},c.toArray=function(t,e){return n(e)?(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],e):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]},c.getElementIndex=function(t,e){return 4*t+e},c.getColumn=function(t,e,r){var n=4*e,o=t[n],a=t[n+1],i=t[n+2],u=t[n+3];return r.x=o,r.y=a,r.z=i,r.w=u,r},c.setColumn=function(t,e,r,n){n=c.clone(t,n);var o=4*e;return n[o]=r.x,n[o+1]=r.y,n[o+2]=r.z,n[o+3]=r.w,n},c.setTranslation=function(t,e,r){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[8]=t[8],r[9]=t[9],r[10]=t[10],r[11]=t[11],r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=t[15],r},c.getRow=function(t,e,r){var n=t[e],o=t[e+4],a=t[e+8],i=t[e+12];return r.x=n,r.y=o,r.z=a,r.w=i,r},c.setRow=function(t,e,r,n){return n=c.clone(t,n),n[e]=r.x,n[e+4]=r.y,n[e+8]=r.z,n[e+12]=r.w,n};var R=new t;c.getScale=function(e,r){return r.x=t.magnitude(t.fromElements(e[0],e[1],e[2],R)),r.y=t.magnitude(t.fromElements(e[4],e[5],e[6],R)),r.z=t.magnitude(t.fromElements(e[8],e[9],e[10],R)),r};var h=new t;c.getMaximumScale=function(e){return c.getScale(e,h),t.maximumComponent(h)},c.multiply=function(t,e,r){var n=t[0],o=t[1],a=t[2],i=t[3],u=t[4],s=t[5],E=t[6],c=t[7],l=t[8],f=t[9],_=t[10],R=t[11],h=t[12],T=t[13],A=t[14],d=t[15],S=e[0],m=e[1],N=e[2],C=e[3],I=e[4],p=e[5],M=e[6],O=e[7],g=e[8],y=e[9],F=e[10],L=e[11],v=e[12],U=e[13],D=e[14],P=e[15],w=n*S+u*m+l*N+h*C,B=o*S+s*m+f*N+T*C,x=a*S+E*m+_*N+A*C,b=i*S+c*m+R*N+d*C,G=n*I+u*p+l*M+h*O,z=o*I+s*p+f*M+T*O,H=a*I+E*p+_*M+A*O,V=i*I+c*p+R*M+d*O,q=n*g+u*y+l*F+h*L,W=o*g+s*y+f*F+T*L,X=a*g+E*y+_*F+A*L,Y=i*g+c*y+R*F+d*L,K=n*v+u*U+l*D+h*P,k=o*v+s*U+f*D+T*P,Z=a*v+E*U+_*D+A*P,j=i*v+c*U+R*D+d*P;return r[0]=w,r[1]=B,r[2]=x,r[3]=b,r[4]=G,r[5]=z,r[6]=H,r[7]=V,r[8]=q,r[9]=W,r[10]=X,r[11]=Y,r[12]=K,r[13]=k,r[14]=Z,r[15]=j,r},c.add=function(t,e,r){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r[2]=t[2]+e[2],r[3]=t[3]+e[3],r[4]=t[4]+e[4],r[5]=t[5]+e[5],r[6]=t[6]+e[6],r[7]=t[7]+e[7],r[8]=t[8]+e[8],r[9]=t[9]+e[9],r[10]=t[10]+e[10],r[11]=t[11]+e[11],r[12]=t[12]+e[12],r[13]=t[13]+e[13],r[14]=t[14]+e[14],r[15]=t[15]+e[15],r},c.subtract=function(t,e,r){return r[0]=t[0]-e[0],r[1]=t[1]-e[1],r[2]=t[2]-e[2],r[3]=t[3]-e[3],r[4]=t[4]-e[4],r[5]=t[5]-e[5],r[6]=t[6]-e[6],r[7]=t[7]-e[7],r[8]=t[8]-e[8],r[9]=t[9]-e[9],r[10]=t[10]-e[10],r[11]=t[11]-e[11],r[12]=t[12]-e[12],r[13]=t[13]-e[13],r[14]=t[14]-e[14],r[15]=t[15]-e[15],r},c.multiplyTransformation=function(t,e,r){var n=t[0],o=t[1],a=t[2],i=t[4],u=t[5],s=t[6],E=t[8],c=t[9],l=t[10],f=t[12],_=t[13],R=t[14],h=e[0],T=e[1],A=e[2],d=e[4],S=e[5],m=e[6],N=e[8],C=e[9],I=e[10],p=e[12],M=e[13],O=e[14],g=n*h+i*T+E*A,y=o*h+u*T+c*A,F=a*h+s*T+l*A,L=n*d+i*S+E*m,v=o*d+u*S+c*m,U=a*d+s*S+l*m,D=n*N+i*C+E*I,P=o*N+u*C+c*I,w=a*N+s*C+l*I,B=n*p+i*M+E*O+f,x=o*p+u*M+c*O+_,b=a*p+s*M+l*O+R;return r[0]=g,r[1]=y,r[2]=F,r[3]=0,r[4]=L,r[5]=v,r[6]=U,r[7]=0,r[8]=D,r[9]=P,r[10]=w,r[11]=0,r[12]=B,r[13]=x,r[14]=b,r[15]=1,r},c.multiplyByMatrix3=function(t,e,r){var n=t[0],o=t[1],a=t[2],i=t[4],u=t[5],s=t[6],E=t[8],c=t[9],l=t[10],f=e[0],_=e[1],R=e[2],h=e[3],T=e[4],A=e[5],d=e[6],S=e[7],m=e[8],N=n*f+i*_+E*R,C=o*f+u*_+c*R,I=a*f+s*_+l*R,p=n*h+i*T+E*A,M=o*h+u*T+c*A,O=a*h+s*T+l*A,g=n*d+i*S+E*m,y=o*d+u*S+c*m,F=a*d+s*S+l*m;return r[0]=N,r[1]=C,r[2]=I,r[3]=0,r[4]=p,r[5]=M,r[6]=O,r[7]=0,r[8]=g,r[9]=y,r[10]=F,r[11]=0,r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15],r},c.multiplyByTranslation=function(t,e,r){var n=e.x,o=e.y,a=e.z,i=n*t[0]+o*t[4]+a*t[8]+t[12],u=n*t[1]+o*t[5]+a*t[9]+t[13],s=n*t[2]+o*t[6]+a*t[10]+t[14];return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[8]=t[8],r[9]=t[9],r[10]=t[10],r[11]=t[11],r[12]=i,r[13]=u,r[14]=s,r[15]=t[15],r};var T=new t;c.multiplyByUniformScale=function(t,e,r){return T.x=e,T.y=e,T.z=e,c.multiplyByScale(t,T,r)},c.multiplyByScale=function(t,e,r){var n=e.x,o=e.y,a=e.z;return 1===n&&1===o&&1===a?c.clone(t,r):(r[0]=n*t[0],r[1]=n*t[1],r[2]=n*t[2],r[3]=0,r[4]=o*t[4],r[5]=o*t[5],r[6]=o*t[6],r[7]=0,r[8]=a*t[8],r[9]=a*t[9],r[10]=a*t[10],r[11]=0,r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=1,r)},c.multiplyByVector=function(t,e,r){var n=e.x,o=e.y,a=e.z,i=e.w,u=t[0]*n+t[4]*o+t[8]*a+t[12]*i,s=t[1]*n+t[5]*o+t[9]*a+t[13]*i,E=t[2]*n+t[6]*o+t[10]*a+t[14]*i,c=t[3]*n+t[7]*o+t[11]*a+t[15]*i;return r.x=u,r.y=s,r.z=E,r.w=c,r},c.multiplyByPointAsVector=function(t,e,r){var n=e.x,o=e.y,a=e.z,i=t[0]*n+t[4]*o+t[8]*a,u=t[1]*n+t[5]*o+t[9]*a,s=t[2]*n+t[6]*o+t[10]*a;return r.x=i,r.y=u,r.z=s,r},c.multiplyByPoint=function(t,e,r){var n=e.x,o=e.y,a=e.z,i=t[0]*n+t[4]*o+t[8]*a+t[12],u=t[1]*n+t[5]*o+t[9]*a+t[13],s=t[2]*n+t[6]*o+t[10]*a+t[14];return r.x=i,r.y=u,r.z=s,r},c.multiplyByScalar=function(t,e,r){return r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e,r[3]=t[3]*e,r[4]=t[4]*e,r[5]=t[5]*e,r[6]=t[6]*e,r[7]=t[7]*e,r[8]=t[8]*e,r[9]=t[9]*e,r[10]=t[10]*e,r[11]=t[11]*e,r[12]=t[12]*e,r[13]=t[13]*e,r[14]=t[14]*e,r[15]=t[15]*e,r},c.negate=function(t,e){return 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],e},c.transpose=function(t,e){var r=t[1],n=t[2],o=t[3],a=t[6],i=t[7],u=t[11];return e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=a,e[10]=t[10],e[11]=t[14],e[12]=o,e[13]=i,e[14]=u,e[15]=t[15],e},c.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e[9]=Math.abs(t[9]),e[10]=Math.abs(t[10]),e[11]=Math.abs(t[11]),e[12]=Math.abs(t[12]),e[13]=Math.abs(t[13]),e[14]=Math.abs(t[14]),e[15]=Math.abs(t[15]),e},c.equals=function(t,e){return t===e||n(t)&&n(e)&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[3]===e[3]&&t[7]===e[7]&&t[11]===e[11]&&t[15]===e[15]},c.equalsEpsilon=function(t,e,r){return t===e||n(t)&&n(e)&&Math.abs(t[0]-e[0])<=r&&Math.abs(t[1]-e[1])<=r&&Math.abs(t[2]-e[2])<=r&&Math.abs(t[3]-e[3])<=r&&Math.abs(t[4]-e[4])<=r&&Math.abs(t[5]-e[5])<=r&&Math.abs(t[6]-e[6])<=r&&Math.abs(t[7]-e[7])<=r&&Math.abs(t[8]-e[8])<=r&&Math.abs(t[9]-e[9])<=r&&Math.abs(t[10]-e[10])<=r&&Math.abs(t[11]-e[11])<=r&&Math.abs(t[12]-e[12])<=r&&Math.abs(t[13]-e[13])<=r&&Math.abs(t[14]-e[14])<=r&&Math.abs(t[15]-e[15])<=r},c.getTranslation=function(t,e){return e.x=t[12],e.y=t[13],e.z=t[14],e},c.getRotation=function(t,e){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e};var A=new s,d=new s,S=new e,m=new e(0,0,0,1);return c.inverse=function(t,r){if(s.equalsEpsilon(c.getRotation(t,A),d,u.EPSILON7)&&e.equals(c.getRow(t,3,S),m))return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=0,r[11]=0,r[12]=-t[12],r[13]=-t[13],r[14]=-t[14],r[15]=1,r;var n=t[0],o=t[4],a=t[8],i=t[12],l=t[1],f=t[5],_=t[9],R=t[13],h=t[2],T=t[6],N=t[10],C=t[14],I=t[3],p=t[7],M=t[11],O=t[15],g=N*O,y=C*M,F=T*O,L=C*p,v=T*M,U=N*p,D=h*O,P=C*I,w=h*M,B=N*I,x=h*p,b=T*I,G=g*f+L*_+v*R-(y*f+F*_+U*R),z=y*l+D*_+B*R-(g*l+P*_+w*R),H=F*l+P*f+x*R-(L*l+D*f+b*R),V=U*l+w*f+b*_-(v*l+B*f+x*_),q=y*o+F*a+U*i-(g*o+L*a+v*i),W=g*n+P*a+w*i-(y*n+D*a+B*i),X=L*n+D*o+b*i-(F*n+P*o+x*i),Y=v*n+B*o+x*a-(U*n+w*o+b*a);g=a*R,y=i*_,F=o*R,L=i*f,v=o*_,U=a*f,D=n*R,P=i*l,w=n*_,B=a*l,x=n*f,b=o*l;var K=g*p+L*M+v*O-(y*p+F*M+U*O),k=y*I+D*M+B*O-(g*I+P*M+w*O),Z=F*I+P*p+x*O-(L*I+D*p+b*O),j=U*I+w*p+b*M-(v*I+B*p+x*M),Q=F*N+U*C+y*T-(v*C+g*T+L*N),J=w*C+g*h+P*N-(D*N+B*C+y*h),$=D*T+b*C+L*h-(x*C+F*h+P*T),tt=x*N+v*h+B*T-(w*T+b*N+U*h),et=n*G+o*z+a*H+i*V;if(Math.abs(et)<u.EPSILON20)throw new E("matrix is not invertible because its determinate is zero.");return et=1/et,r[0]=G*et,r[1]=z*et,r[2]=H*et,r[3]=V*et,r[4]=q*et,r[5]=W*et,r[6]=X*et,r[7]=Y*et,r[8]=K*et,r[9]=k*et,r[10]=Z*et,r[11]=j*et,r[12]=Q*et,r[13]=J*et,r[14]=$*et,r[15]=tt*et,r},c.inverseTransformation=function(t,e){var r=t[0],n=t[1],o=t[2],a=t[4],i=t[5],u=t[6],s=t[8],E=t[9],c=t[10],l=t[12],f=t[13],_=t[14],R=-r*l-n*f-o*_,h=-a*l-i*f-u*_,T=-s*l-E*f-c*_;return e[0]=r,e[1]=a,e[2]=s,e[3]=0,e[4]=n,e[5]=i,e[6]=E,e[7]=0,e[8]=o,e[9]=u,e[10]=c,e[11]=0,e[12]=R,e[13]=h,e[14]=T,e[15]=1,e},c.IDENTITY=i(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),c.ZERO=i(new c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN0ROW3=3,c.COLUMN1ROW0=4,c.COLUMN1ROW1=5,c.COLUMN1ROW2=6,c.COLUMN1ROW3=7,c.COLUMN2ROW0=8,c.COLUMN2ROW1=9,c.COLUMN2ROW2=10,c.COLUMN2ROW3=11,c.COLUMN3ROW0=12,c.COLUMN3ROW1=13,c.COLUMN3ROW2=14,c.COLUMN3ROW3=15,o(c.prototype,{length:{get:function(){return c.packedLength}}}),c.prototype.clone=function(t){return c.clone(this,t)},c.prototype.equals=function(t){return c.equals(this,t)},c.equalsArray=function(t,e,r){return t[0]===e[r]&&t[1]===e[r+1]&&t[2]===e[r+2]&&t[3]===e[r+3]&&t[4]===e[r+4]&&t[5]===e[r+5]&&t[6]===e[r+6]&&t[7]===e[r+7]&&t[8]===e[r+8]&&t[9]===e[r+9]&&t[10]===e[r+10]&&t[11]===e[r+11]&&t[12]===e[r+12]&&t[13]===e[r+13]&&t[14]===e[r+14]&&t[15]===e[r+15]},c.prototype.equalsEpsilon=function(t,e){return c.equalsEpsilon(this,t,e)},c.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]+")"},c}),define("Core/Rectangle",["./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(t,e,r,n,o,a,i,u){"use strict";function s(t,r,n,o){this.west=e(t,0),this.south=e(r,0),this.east=e(n,0),this.north=e(o,0)}n(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(t,r,n){return n=e(n,0),r[n++]=t.west,r[n++]=t.south,r[n++]=t.east,r[n]=t.north,r},s.unpack=function(t,n,o){return n=e(n,0),r(o)||(o=new s),o.west=t[n++],o.south=t[n++],o.east=t[n++],o.north=t[n],o},s.computeWidth=function(t){var e=t.east,r=t.west;return e<r&&(e+=u.TWO_PI),e-r},s.computeHeight=function(t){return t.north-t.south},s.fromDegrees=function(t,n,o,a,i){return t=u.toRadians(e(t,0)),n=u.toRadians(e(n,0)),o=u.toRadians(e(o,0)),a=u.toRadians(e(a,0)),r(i)?(i.west=t,i.south=n,i.east=o,i.north=a,i):new s(t,n,o,a)},s.fromCartographicArray=function(t,e){for(var n=Number.MAX_VALUE,o=-Number.MAX_VALUE,a=Number.MAX_VALUE,i=-Number.MAX_VALUE,E=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=0,f=t.length;l<f;l++){var _=t[l];n=Math.min(n,_.longitude),o=Math.max(o,_.longitude),E=Math.min(E,_.latitude),c=Math.max(c,_.latitude);var R=_.longitude>=0?_.longitude:_.longitude+u.TWO_PI;a=Math.min(a,R),i=Math.max(i,R)}return o-n>i-a&&(n=a,o=i,o>u.PI&&(o-=u.TWO_PI),n>u.PI&&(n-=u.TWO_PI)),r(e)?(e.west=n,e.south=E,e.east=o,e.north=c,e):new s(n,E,o,c)},s.fromCartesianArray=function(t,e,n){for(var o=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,E=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE,f=0,_=t.length;f<_;f++){var R=e.cartesianToCartographic(t[f]);o=Math.min(o,R.longitude),a=Math.max(a,R.longitude),c=Math.min(c,R.latitude),l=Math.max(l,R.latitude);var h=R.longitude>=0?R.longitude:R.longitude+u.TWO_PI;i=Math.min(i,h),E=Math.max(E,h)}return a-o>E-i&&(o=i,a=E,a>u.PI&&(a-=u.TWO_PI),o>u.PI&&(o-=u.TWO_PI)),r(n)?(n.west=o,n.south=c,n.east=a,n.north=l,n):new s(o,c,a,l)},s.clone=function(t,e){if(r(t))return r(e)?(e.west=t.west,e.south=t.south,e.east=t.east,e.north=t.north,e):new s(t.west,t.south,t.east,t.north)},s.prototype.clone=function(t){return s.clone(this,t)},s.prototype.equals=function(t){return s.equals(this,t)},s.equals=function(t,e){return t===e||r(t)&&r(e)&&t.west===e.west&&t.south===e.south&&t.east===e.east&&t.north===e.north},s.prototype.equalsEpsilon=function(t,e){return r(t)&&Math.abs(this.west-t.west)<=e&&Math.abs(this.south-t.south)<=e&&Math.abs(this.east-t.east)<=e&&Math.abs(this.north-t.north)<=e},s.validate=function(t){},s.southwest=function(e,n){return r(n)?(n.longitude=e.west,n.latitude=e.south,n.height=0,n):new t(e.west,e.south)},s.northwest=function(e,n){return r(n)?(n.longitude=e.west,n.latitude=e.north,n.height=0,n):new t(e.west,e.north)},s.northeast=function(e,n){return r(n)?(n.longitude=e.east,n.latitude=e.north,n.height=0,n):new t(e.east,e.north)},s.southeast=function(e,n){return r(n)?(n.longitude=e.east,n.latitude=e.south,n.height=0,n):new t(e.east,e.south)},s.center=function(e,n){var o=e.east,a=e.west;o<a&&(o+=u.TWO_PI);var i=u.negativePiToPi(.5*(a+o)),s=.5*(e.south+e.north);return r(n)?(n.longitude=i,n.latitude=s,n.height=0,n):new t(i,s)},s.intersection=function(t,e,n){var o=t.east,a=t.west,i=e.east,E=e.west;o<a&&i>0?o+=u.TWO_PI:i<E&&o>0&&(i+=u.TWO_PI),o<a&&E<0?E+=u.TWO_PI:i<E&&a<0&&(a+=u.TWO_PI);var c=u.negativePiToPi(Math.max(a,E)),l=u.negativePiToPi(Math.min(o,i));if(!((t.west<t.east||e.west<e.east)&&l<=c)){var f=Math.max(t.south,e.south),_=Math.min(t.north,e.north);if(!(f>=_))return r(n)?(n.west=c,n.south=f,n.east=l,n.north=_,n):new s(c,f,l,_)}},s.simpleIntersection=function(t,e,n){var o=Math.max(t.west,e.west),a=Math.max(t.south,e.south),i=Math.min(t.east,e.east),u=Math.min(t.north,e.north);if(!(a>=u||o>=i))return r(n)?(n.west=o,n.south=a,n.east=i,n.north=u,n):new s(o,a,i,u)},s.union=function(t,e,n){r(n)||(n=new s);var o=t.east,a=t.west,i=e.east,E=e.west;o<a&&i>0?o+=u.TWO_PI:i<E&&o>0&&(i+=u.TWO_PI),o<a&&E<0?E+=u.TWO_PI:i<E&&a<0&&(a+=u.TWO_PI);var c=u.convertLongitudeRange(Math.min(a,E)),l=u.convertLongitudeRange(Math.max(o,i));return n.west=c,n.south=Math.min(t.south,e.south),n.east=l,n.north=Math.max(t.north,e.north),n},s.expand=function(t,e,n){return r(n)||(n=new s),n.west=Math.min(t.west,e.longitude),n.south=Math.min(t.south,e.latitude),n.east=Math.max(t.east,e.longitude),n.north=Math.max(t.north,e.latitude),n},s.contains=function(t,e){var r=e.longitude,n=e.latitude,o=t.west,a=t.east;return a<o&&(a+=u.TWO_PI,r<0&&(r+=u.TWO_PI)),(r>o||u.equalsEpsilon(r,o,u.EPSILON14))&&(r<a||u.equalsEpsilon(r,a,u.EPSILON14))&&n>=t.south&&n<=t.north};var E=new t;return s.subsample=function(t,n,o,i){n=e(n,a.WGS84),o=e(o,0),r(i)||(i=[]);var c=0,l=t.north,f=t.south,_=t.east,R=t.west,h=E;h.height=o,h.longitude=R,h.latitude=l,i[c]=n.cartographicToCartesian(h,i[c]),c++,h.longitude=_,i[c]=n.cartographicToCartesian(h,i[c]),c++,h.latitude=f,i[c]=n.cartographicToCartesian(h,i[c]),c++,h.longitude=R,i[c]=n.cartographicToCartesian(h,i[c]),c++,l<0?h.latitude=l:f>0?h.latitude=f:h.latitude=0;for(var T=1;T<8;++T)h.longitude=-Math.PI+T*u.PI_OVER_TWO,s.contains(t,h)&&(i[c]=n.cartographicToCartesian(h,i[c]),c++);return 0===h.latitude&&(h.longitude=R,i[c]=n.cartographicToCartesian(h,i[c]),c++,h.longitude=_,i[c]=n.cartographicToCartesian(h,i[c]),c++),i.length=c,i},s.MAX_VALUE=i(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(t,e,r,n,o,a,i,u,s,E,c,l){"use strict";function f(e,n){this.center=t.clone(r(e,t.ZERO)),this.radius=r(n,0)}var _=new t,R=new t,h=new t,T=new t,A=new t,d=new t,S=new t,m=new t,N=new t,C=new t,I=new t,p=new t;f.fromPoints=function(e,r){if(n(r)||(r=new f),!n(e)||0===e.length)return r.center=t.clone(t.ZERO,r.center),r.radius=0,r;for(var o=t.clone(e[0],S),a=t.clone(o,_),i=t.clone(o,R),u=t.clone(o,h),s=t.clone(o,T),E=t.clone(o,A),c=t.clone(o,d),l=e.length,M=1;M<l;M++){t.clone(e[M],o);var O=o.x,g=o.y,y=o.z;O<a.x&&t.clone(o,a),O>s.x&&t.clone(o,s),g<i.y&&t.clone(o,i),g>E.y&&t.clone(o,E),y<u.z&&t.clone(o,u),y>c.z&&t.clone(o,c)}var F=t.magnitudeSquared(t.subtract(s,a,m)),L=t.magnitudeSquared(t.subtract(E,i,m)),v=t.magnitudeSquared(t.subtract(c,u,m)),U=a,D=s,P=F;L>P&&(P=L,U=i,D=E),v>P&&(P=v,U=u,D=c);var w=N;w.x=.5*(U.x+D.x),w.y=.5*(U.y+D.y),w.z=.5*(U.z+D.z);var B=t.magnitudeSquared(t.subtract(D,w,m)),x=Math.sqrt(B),b=C;b.x=a.x,b.y=i.y,b.z=u.z;var G=I;G.x=s.x,G.y=E.y,G.z=c.z;var z=t.multiplyByScalar(t.add(b,G,m),.5,p),H=0;for(M=0;M<l;M++){t.clone(e[M],o);var V=t.magnitude(t.subtract(o,z,m));V>H&&(H=V);var q=t.magnitudeSquared(t.subtract(o,w,m));if(q>B){var W=Math.sqrt(q);x=.5*(x+W),B=x*x;var X=W-x;w.x=(x*w.x+X*o.x)/W,w.y=(x*w.y+X*o.y)/W,w.z=(x*w.z+X*o.z)/W}}return x<H?(t.clone(w,r.center),r.radius=x):(t.clone(z,r.center),r.radius=H),r};var M=new i,O=new t,g=new t,y=new e,F=new e;f.fromRectangle2D=function(t,e,r){return f.fromRectangleWithHeights2D(t,e,0,0,r)},f.fromRectangleWithHeights2D=function(e,o,a,i,u){if(n(u)||(u=new f),!n(e))return u.center=t.clone(t.ZERO,u.center),u.radius=0,u;o=r(o,M),l.southwest(e,y),y.height=a,l.northeast(e,F),F.height=i;var s=o.project(y,O),E=o.project(F,g),c=E.x-s.x,_=E.y-s.y,R=E.z-s.z;u.radius=.5*Math.sqrt(c*c+_*_+R*R);var h=u.center;return h.x=s.x+.5*c,h.y=s.y+.5*_,h.z=s.z+.5*R,u};var L=[];f.fromRectangle3D=function(t,e,o,i){e=r(e,a.WGS84),o=r(o,0);var u;return n(t)&&(u=l.subsample(t,e,o,L)),f.fromPoints(u,i)},f.fromVertices=function(e,o,a,i){if(n(i)||(i=new f),!n(e)||0===e.length)return i.center=t.clone(t.ZERO,i.center),i.radius=0,i;o=r(o,t.ZERO),a=r(a,3);var u=S;u.x=e[0]+o.x,u.y=e[1]+o.y,u.z=e[2]+o.z;for(var s=t.clone(u,_),E=t.clone(u,R),c=t.clone(u,h),l=t.clone(u,T),M=t.clone(u,A),O=t.clone(u,d),g=e.length,y=0;y<g;y+=a){var F=e[y]+o.x,L=e[y+1]+o.y,v=e[y+2]+o.z;u.x=F,u.y=L,u.z=v,F<s.x&&t.clone(u,s),F>l.x&&t.clone(u,l),L<E.y&&t.clone(u,E),L>M.y&&t.clone(u,M),v<c.z&&t.clone(u,c),v>O.z&&t.clone(u,O)}var U=t.magnitudeSquared(t.subtract(l,s,m)),D=t.magnitudeSquared(t.subtract(M,E,m)),P=t.magnitudeSquared(t.subtract(O,c,m)),w=s,B=l,x=U;D>x&&(x=D,w=E,B=M),P>x&&(x=P,w=c,B=O);var b=N;b.x=.5*(w.x+B.x),b.y=.5*(w.y+B.y),b.z=.5*(w.z+B.z);var G=t.magnitudeSquared(t.subtract(B,b,m)),z=Math.sqrt(G),H=C;H.x=s.x,H.y=E.y,H.z=c.z;var V=I;V.x=l.x,V.y=M.y,V.z=O.z;var q=t.multiplyByScalar(t.add(H,V,m),.5,p),W=0;for(y=0;y<g;y+=a){u.x=e[y]+o.x,u.y=e[y+1]+o.y,u.z=e[y+2]+o.z;var X=t.magnitude(t.subtract(u,q,m));X>W&&(W=X);var Y=t.magnitudeSquared(t.subtract(u,b,m));if(Y>G){var K=Math.sqrt(Y);z=.5*(z+K),G=z*z;var k=K-z;b.x=(z*b.x+k*u.x)/K,b.y=(z*b.y+k*u.y)/K,b.z=(z*b.z+k*u.z)/K}}return z<W?(t.clone(b,i.center),i.radius=z):(t.clone(q,i.center),i.radius=W),i},f.fromEncodedCartesianVertices=function(e,r,o){if(n(o)||(o=new f),!n(e)||!n(r)||e.length!==r.length||0===e.length)return o.center=t.clone(t.ZERO,o.center),o.radius=0,o;var a=S;a.x=e[0]+r[0],a.y=e[1]+r[1],a.z=e[2]+r[2];for(var i=t.clone(a,_),u=t.clone(a,R),s=t.clone(a,h),E=t.clone(a,T),c=t.clone(a,A),l=t.clone(a,d),M=e.length,O=0;O<M;O+=3){var g=e[O]+r[O],y=e[O+1]+r[O+1],F=e[O+2]+r[O+2];a.x=g,a.y=y,a.z=F,g<i.x&&t.clone(a,i),g>E.x&&t.clone(a,E),y<u.y&&t.clone(a,u),y>c.y&&t.clone(a,c),F<s.z&&t.clone(a,s),F>l.z&&t.clone(a,l)}var L=t.magnitudeSquared(t.subtract(E,i,m)),v=t.magnitudeSquared(t.subtract(c,u,m)),U=t.magnitudeSquared(t.subtract(l,s,m)),D=i,P=E,w=L;v>w&&(w=v,D=u,P=c),U>w&&(w=U,D=s,P=l);var B=N;B.x=.5*(D.x+P.x),B.y=.5*(D.y+P.y),B.z=.5*(D.z+P.z);var x=t.magnitudeSquared(t.subtract(P,B,m)),b=Math.sqrt(x),G=C;G.x=i.x,G.y=u.y,G.z=s.z;var z=I;z.x=E.x,z.y=c.y,z.z=l.z;var H=t.multiplyByScalar(t.add(G,z,m),.5,p),V=0;for(O=0;O<M;O+=3){a.x=e[O]+r[O],a.y=e[O+1]+r[O+1],a.z=e[O+2]+r[O+2];var q=t.magnitude(t.subtract(a,H,m));q>V&&(V=q);var W=t.magnitudeSquared(t.subtract(a,B,m));if(W>x){var X=Math.sqrt(W);b=.5*(b+X),x=b*b;var Y=X-b;B.x=(b*B.x+Y*a.x)/X,B.y=(b*B.y+Y*a.y)/X,B.z=(b*B.z+Y*a.z)/X}}return b<V?(t.clone(B,o.center),o.radius=b):(t.clone(H,o.center),o.radius=V),o},f.fromCornerPoints=function(e,r,o){n(o)||(o=new f);var a=o.center;return t.add(e,r,a),t.multiplyByScalar(a,.5,a),o.radius=t.distance(a,r),o},f.fromEllipsoid=function(e,r){return n(r)||(r=new f),t.clone(t.ZERO,r.center),r.radius=e.maximumRadius,r};var v=new t;f.fromBoundingSpheres=function(e,r){if(n(r)||(r=new f),!n(e)||0===e.length)return r.center=t.clone(t.ZERO,r.center),r.radius=0,r;var o=e.length;if(1===o)return f.clone(e[0],r);if(2===o)return f.union(e[0],e[1],r);for(var a=[],i=0;i<o;i++)a.push(e[i].center);r=f.fromPoints(a,r);var u=r.center,s=r.radius;for(i=0;i<o;i++){var E=e[i];s=Math.max(s,t.distance(u,E.center,v)+E.radius)}return r.radius=s,r};var U=new t,D=new t,P=new t;f.fromOrientedBoundingBox=function(e,r){n(r)||(r=new f);var o=e.halfAxes,a=E.getColumn(o,0,U),i=E.getColumn(o,1,D),u=E.getColumn(o,2,P),s=t.magnitude(a),c=t.magnitude(i),l=t.magnitude(u);return r.center=t.clone(e.center,r.center),r.radius=Math.max(s,c,l),r},f.clone=function(e,r){if(n(e))return n(r)?(r.center=t.clone(e.center,r.center),r.radius=e.radius,r):new f(e.center,e.radius)},f.packedLength=4,f.pack=function(t,e,n){n=r(n,0);var o=t.center;return e[n++]=o.x,e[n++]=o.y,e[n++]=o.z,e[n]=t.radius,e},f.unpack=function(t,e,o){e=r(e,0),n(o)||(o=new f);var a=o.center;return a.x=t[e++],a.y=t[e++],a.z=t[e++],o.radius=t[e],o};var w=new t,B=new t;f.union=function(e,r,o){n(o)||(o=new f);var a=e.center,i=e.radius,u=r.center,s=r.radius,E=t.subtract(u,a,w),c=t.magnitude(E);if(i>=c+s)return e.clone(o),o;if(s>=c+i)return r.clone(o),o;var l=.5*(i+c+s),_=t.multiplyByScalar(E,(-i+l)/c,B);return t.add(_,a,_),t.clone(_,o.center),o.radius=l,o};var x=new t;f.expand=function(e,r,n){n=f.clone(e,n);var o=t.magnitude(t.subtract(r,n.center,x));return o>n.radius&&(n.radius=o),n},f.intersectPlane=function(e,r){var n=e.center,o=e.radius,a=r.normal,i=t.dot(a,n)+r.distance;return i<-o?u.OUTSIDE:i<o?u.INTERSECTING:u.INSIDE},f.transform=function(t,e,r){return n(r)||(r=new f),r.center=c.multiplyByPoint(e,t.center,r.center),r.radius=c.getMaximumScale(e)*t.radius,r};var b=new t;f.distanceSquaredTo=function(e,r){var n=t.subtract(e.center,r,b);return t.magnitudeSquared(n)-e.radius*e.radius},f.transformWithoutScale=function(t,e,r){return n(r)||(r=new f),r.center=c.multiplyByPoint(e,t.center,r.center),r.radius=t.radius,r};var G=new t;f.computePlaneDistances=function(e,r,o,a){n(a)||(a=new s);var i=t.subtract(e.center,r,G),u=t.dot(o,i);return a.start=u-e.radius,a.stop=u+e.radius,a};for(var z=new t,H=new t,V=new t,q=new t,W=new t,X=new e,Y=new Array(8),K=0;K<8;++K)Y[K]=new t;var k=new i;return f.projectTo2D=function(e,n,o){n=r(n,k);var a=n.ellipsoid,i=e.center,u=e.radius,s=a.geodeticSurfaceNormal(i,z),E=t.cross(t.UNIT_Z,s,H);t.normalize(E,E);var c=t.cross(s,E,V);t.normalize(c,c),t.multiplyByScalar(s,u,s),t.multiplyByScalar(c,u,c),t.multiplyByScalar(E,u,E);var l=t.negate(c,W),_=t.negate(E,q),R=Y,h=R[0];t.add(s,c,h),t.add(h,E,h),h=R[1],t.add(s,c,h),t.add(h,_,h),h=R[2],t.add(s,l,h),t.add(h,_,h),h=R[3],t.add(s,l,h),t.add(h,E,h),t.negate(s,s),h=R[4],t.add(s,c,h),t.add(h,E,h),h=R[5],t.add(s,c,h),t.add(h,_,h),h=R[6],t.add(s,l,h),t.add(h,_,h),h=R[7],t.add(s,l,h),t.add(h,E,h);for(var T=R.length,A=0;A<T;++A){var d=R[A];t.add(i,d,d);var S=a.cartesianToCartographic(d,X);n.project(S,d)}o=f.fromPoints(R,o),i=o.center;var m=i.x,N=i.y,C=i.z;return i.x=C,i.y=m,i.z=N,o},f.isOccluded=function(t,e){return!e.isBoundingSphereVisible(t)},f.equals=function(e,r){return e===r||n(e)&&n(r)&&t.equals(e.center,r.center)&&e.radius===r.radius},f.prototype.intersectPlane=function(t){return f.intersectPlane(this,t)},f.prototype.distanceSquaredTo=function(t){return f.distanceSquaredTo(this,t)},f.prototype.computePlaneDistances=function(t,e,r){return f.computePlaneDistances(this,t,e,r)},f.prototype.isOccluded=function(t){return f.isOccluded(this,t)},f.prototype.equals=function(t){return f.equals(this,t)},f.prototype.clone=function(t){return f.clone(this,t)},f}),define("Core/Fullscreen",["./defined","./defineProperties"],function(t,e){"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 e(o,{element:{get:function(){if(o.supportsFullscreen())return document[n.fullscreenElement]}},changeEventName:{get:function(){if(o.supportsFullscreen())return n.fullscreenchange}},errorEventName:{get:function(){if(o.supportsFullscreen())return n.fullscreenerror}},enabled:{get:function(){if(o.supportsFullscreen())return document[n.fullscreenEnabled]}},fullscreen:{get:function(){if(o.supportsFullscreen())return null!==o.element}}}),o.supportsFullscreen=function(){if(t(r))return r;r=!1;var e=document.body;if("function"==typeof e.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;i<u;++i){var s=a[i];o=s+"RequestFullscreen","function"==typeof e[o]?(n.requestFullscreen=o,r=!0):(o=s+"RequestFullScreen","function"==typeof e[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",void 0!==document[o]?n.fullscreenEnabled=o:(o=s+"FullScreenEnabled",void 0!==document[o]&&(n.fullscreenEnabled=o)),o=s+"FullscreenElement",void 0!==document[o]?n.fullscreenElement=o:(o=s+"FullScreenElement",void 0!==document[o]&&(n.fullscreenElement=o)),o=s+"fullscreenchange",void 0!==document["on"+o]&&("ms"===s&&(o="MSFullscreenChange"),n.fullscreenchange=o),o=s+"fullscreenerror",void 0!==document["on"+o]&&("ms"===s&&(o="MSFullscreenError"),n.fullscreenerror=o)}return r},o.requestFullscreen=function(t,e){o.supportsFullscreen()&&t[n.requestFullscreen]({vrDisplay:e})},o.exitFullscreen=function(){o.supportsFullscreen()&&document[n.exitFullscreen]()},o}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(t,e,r){"use strict";function n(t){for(var e=t.split("."),r=0,n=e.length;r<n;++r)e[r]=parseInt(e[r],10);return e}function o(){if(!e(N)&&(N=!1,!f())){var t=/ Chrome\/([\.0-9]+)/.exec(m.userAgent);null!==t&&(N=!0,C=n(t[1]))}return N}function a(){return o()&&C}function i(){if(!e(I)&&(I=!1,!o()&&!f()&&/ Safari\/[\.0-9]+/.test(m.userAgent))){var t=/ Version\/([\.0-9]+)/.exec(m.userAgent);null!==t&&(I=!0,p=n(t[1]))}return I}function u(){return i()&&p}function s(){if(!e(M)){M=!1;var t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(m.userAgent);null!==t&&(M=!0,O=n(t[1]),O.isNightly=!!t[2])}return M}function E(){return s()&&O}function c(){if(!e(g)){g=!1;var t;"Microsoft Internet Explorer"===m.appName?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(m.userAgent),null!==t&&(g=!0,y=n(t[1]))):"Netscape"===m.appName&&(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(m.userAgent),null!==t&&(g=!0,y=n(t[1])))}return g}function l(){ -return c()&&y}function f(){if(!e(F)){F=!1;var t=/ Edge\/([\.0-9]+)/.exec(m.userAgent);null!==t&&(F=!0,L=n(t[1]))}return F}function _(){return f()&&L}function R(){if(!e(v)){v=!1;var t=/Firefox\/([\.0-9]+)/.exec(m.userAgent);null!==t&&(v=!0,U=n(t[1]))}return v}function h(){return e(D)||(D=/Windows/i.test(m.appVersion)),D}function T(){return R()&&U}function A(){return e(P)||(P="undefined"!=typeof PointerEvent&&(!e(m.pointerEnabled)||m.pointerEnabled)),P}function d(){if(!e(B)){var t=document.createElement("canvas");t.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var r=t.style.imageRendering;B=e(r)&&""!==r,B&&(w=r)}return B}function S(){return d()?w:void 0}var m;m="undefined"!=typeof navigator?navigator:{};var N,C,I,p,M,O,g,y,F,L,v,U,D,P,w,B,x={isChrome:o,chromeVersion:a,isSafari:i,safariVersion:u,isWebkit:s,webkitVersion:E,isInternetExplorer:c,internetExplorerVersion:l,isEdge:f,edgeVersion:_,isFirefox:R,firefoxVersion:T,isWindows:h,hardwareConcurrency:t(m.hardwareConcurrency,3),supportsPointerEvents:A,supportsImageRenderingPixelated:d,imageRenderingValue:S};return x.supportsFullscreen=function(){return r.supportsFullscreen()},x.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},x.supportsWebWorkers=function(){return"undefined"!=typeof Worker},x}),define("Core/Color",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math"],function(t,e,r,n,o,a){"use strict";function i(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),6*r<1?t+6*(e-t)*r:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}function u(e,r,n,o){this.red=t(e,1),this.green=t(r,1),this.blue=t(n,1),this.alpha=t(o,1)}u.fromCartesian4=function(t,r){return e(r)?(r.red=t.x,r.green=t.y,r.blue=t.z,r.alpha=t.w,r):new u(t.x,t.y,t.z,t.w)},u.fromBytes=function(r,n,o,a,i){return r=u.byteToFloat(t(r,255)),n=u.byteToFloat(t(n,255)),o=u.byteToFloat(t(o,255)),a=u.byteToFloat(t(a,255)),e(i)?(i.red=r,i.green=n,i.blue=o,i.alpha=a,i):new u(r,n,o,a)},u.fromAlpha=function(t,r,n){return e(n)?(n.red=t.red,n.green=t.green,n.blue=t.blue,n.alpha=r,n):new u(t.red,t.green,t.blue,r)};var s,E,c;n.supportsTypedArrays()&&(s=new ArrayBuffer(4),E=new Uint32Array(s),c=new Uint8Array(s)),u.fromRgba=function(t,e){return E[0]=t,u.fromBytes(c[0],c[1],c[2],c[3],e)},u.fromHsl=function(r,n,o,a,s){r=t(r,0)%1,n=t(n,0),o=t(o,0),a=t(a,1);var E=o,c=o,l=o;if(0!==n){var f;f=o<.5?o*(1+n):o+n-o*n;var _=2*o-f;E=i(_,f,r+1/3),c=i(_,f,r),l=i(_,f,r-1/3)}return e(s)?(s.red=E,s.green=c,s.blue=l,s.alpha=a,s):new u(E,c,l,a)},u.fromRandom=function(r,n){r=t(r,t.EMPTY_OBJECT);var o=r.red;if(!e(o)){var i=t(r.minimumRed,0),s=t(r.maximumRed,1);o=i+a.nextRandomNumber()*(s-i)}var E=r.green;if(!e(E)){var c=t(r.minimumGreen,0),l=t(r.maximumGreen,1);E=c+a.nextRandomNumber()*(l-c)}var f=r.blue;if(!e(f)){var _=t(r.minimumBlue,0),R=t(r.maximumBlue,1);f=_+a.nextRandomNumber()*(R-_)}var h=r.alpha;if(!e(h)){var T=t(r.minimumAlpha,0),A=t(r.maximumAlpha,1);h=T+a.nextRandomNumber()*(A-T)}return e(n)?(n.red=o,n.green=E,n.blue=f,n.alpha=h,n):new u(o,E,f,h)};var l=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i,f=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i,_=/^rgba?\(\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)(?:\s*,\s*([0-9.]+))?\s*\)$/i,R=/^hsla?\(\s*([0-9.]+)\s*,\s*([0-9.]+%)\s*,\s*([0-9.]+%)(?:\s*,\s*([0-9.]+))?\s*\)$/i;return u.fromCssColorString=function(r,n){e(n)||(n=new u);var o=u[r.toUpperCase()];if(e(o))return u.clone(o,n),n;var a=l.exec(r);return null!==a?(n.red=parseInt(a[1],16)/15,n.green=parseInt(a[2],16)/15,n.blue=parseInt(a[3],16)/15,n.alpha=1,n):(a=f.exec(r),null!==a?(n.red=parseInt(a[1],16)/255,n.green=parseInt(a[2],16)/255,n.blue=parseInt(a[3],16)/255,n.alpha=1,n):(a=_.exec(r),null!==a?(n.red=parseFloat(a[1])/("%"===a[1].substr(-1)?100:255),n.green=parseFloat(a[2])/("%"===a[2].substr(-1)?100:255),n.blue=parseFloat(a[3])/("%"===a[3].substr(-1)?100:255),n.alpha=parseFloat(t(a[4],"1.0")),n):(a=R.exec(r),null!==a?u.fromHsl(parseFloat(a[1])/360,parseFloat(a[2])/100,parseFloat(a[3])/100,parseFloat(t(a[4],"1.0")),n):n=void 0)))},u.packedLength=4,u.pack=function(e,r,n){return n=t(n,0),r[n++]=e.red,r[n++]=e.green,r[n++]=e.blue,r[n]=e.alpha,r},u.unpack=function(r,n,o){return n=t(n,0),e(o)||(o=new u),o.red=r[n++],o.green=r[n++],o.blue=r[n++],o.alpha=r[n],o},u.byteToFloat=function(t){return t/255},u.floatToByte=function(t){return 1===t?255:256*t|0},u.clone=function(t,r){if(e(t))return e(r)?(r.red=t.red,r.green=t.green,r.blue=t.blue,r.alpha=t.alpha,r):new u(t.red,t.green,t.blue,t.alpha)},u.equals=function(t,r){return t===r||e(t)&&e(r)&&t.red===r.red&&t.green===r.green&&t.blue===r.blue&&t.alpha===r.alpha},u.equalsArray=function(t,e,r){return t.red===e[r]&&t.green===e[r+1]&&t.blue===e[r+2]&&t.alpha===e[r+3]},u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.prototype.equalsEpsilon=function(t,r){return this===t||e(t)&&Math.abs(this.red-t.red)<=r&&Math.abs(this.green-t.green)<=r&&Math.abs(this.blue-t.blue)<=r&&Math.abs(this.alpha-t.alpha)<=r},u.prototype.toString=function(){return"("+this.red+", "+this.green+", "+this.blue+", "+this.alpha+")"},u.prototype.toCssColorString=function(){var t=u.floatToByte(this.red),e=u.floatToByte(this.green),r=u.floatToByte(this.blue);return 1===this.alpha?"rgb("+t+","+e+","+r+")":"rgba("+t+","+e+","+r+","+this.alpha+")"},u.prototype.toBytes=function(t){var r=u.floatToByte(this.red),n=u.floatToByte(this.green),o=u.floatToByte(this.blue),a=u.floatToByte(this.alpha);return e(t)?(t[0]=r,t[1]=n,t[2]=o,t[3]=a,t):[r,n,o,a]},u.prototype.toRgba=function(){return c[0]=u.floatToByte(this.red),c[1]=u.floatToByte(this.green),c[2]=u.floatToByte(this.blue),c[3]=u.floatToByte(this.alpha),E[0]},u.prototype.brighten=function(t,e){return t=1-t,e.red=1-(1-this.red)*t,e.green=1-(1-this.green)*t,e.blue=1-(1-this.blue)*t,e.alpha=this.alpha,e},u.prototype.darken=function(t,e){return t=1-t,e.red=this.red*t,e.green=this.green*t,e.blue=this.blue*t,e.alpha=this.alpha,e},u.prototype.withAlpha=function(t,e){return u.fromAlpha(this,t,e)},u.add=function(t,e,r){return r.red=t.red+e.red,r.green=t.green+e.green,r.blue=t.blue+e.blue,r.alpha=t.alpha+e.alpha,r},u.subtract=function(t,e,r){return r.red=t.red-e.red,r.green=t.green-e.green,r.blue=t.blue-e.blue,r.alpha=t.alpha-e.alpha,r},u.multiply=function(t,e,r){return r.red=t.red*e.red,r.green=t.green*e.green,r.blue=t.blue*e.blue,r.alpha=t.alpha*e.alpha,r},u.divide=function(t,e,r){return r.red=t.red/e.red,r.green=t.green/e.green,r.blue=t.blue/e.blue,r.alpha=t.alpha/e.alpha,r},u.mod=function(t,e,r){return r.red=t.red%e.red,r.green=t.green%e.green,r.blue=t.blue%e.blue,r.alpha=t.alpha%e.alpha,r},u.multiplyByScalar=function(t,e,r){return r.red=t.red*e,r.green=t.green*e,r.blue=t.blue*e,r.alpha=t.alpha*e,r},u.divideByScalar=function(t,e,r){return r.red=t.red/e,r.green=t.green/e,r.blue=t.blue/e,r.alpha=t.alpha/e,r},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.TRANSPARENT=o(new u(0,0,0,0)),u}),define("Core/WebGLConstants",["./freezeObject"],function(t){"use strict";var e={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503};return t(e)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(t,e,r,n,o,a){"use strict";if(!n.supportsTypedArrays())return{};var i={BYTE:a.BYTE,UNSIGNED_BYTE:a.UNSIGNED_BYTE,SHORT:a.SHORT,UNSIGNED_SHORT:a.UNSIGNED_SHORT,INT:a.INT,UNSIGNED_INT:a.UNSIGNED_INT,FLOAT:a.FLOAT,DOUBLE:a.DOUBLE};return i.getSizeInBytes=function(t){switch(t){case i.BYTE:return Int8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.SHORT:return Int16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.INT:return Int32Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case i.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case i.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},i.fromTypedArray=function(t){return t instanceof Int8Array?i.BYTE:t instanceof Uint8Array?i.UNSIGNED_BYTE:t instanceof Int16Array?i.SHORT:t instanceof Uint16Array?i.UNSIGNED_SHORT:t instanceof Int32Array?i.INT:t instanceof Uint32Array?i.UNSIGNED_INT:t instanceof Float32Array?i.FLOAT:t instanceof Float64Array?i.DOUBLE:void 0},i.validate=function(t){return e(t)&&(t===i.BYTE||t===i.UNSIGNED_BYTE||t===i.SHORT||t===i.UNSIGNED_SHORT||t===i.INT||t===i.UNSIGNED_INT||t===i.FLOAT||t===i.DOUBLE)},i.createTypedArray=function(t,e){switch(t){case i.BYTE:return new Int8Array(e);case i.UNSIGNED_BYTE:return new Uint8Array(e);case i.SHORT:return new Int16Array(e);case i.UNSIGNED_SHORT:return new Uint16Array(e);case i.INT:return new Int32Array(e);case i.UNSIGNED_INT:return new Uint32Array(e);case i.FLOAT:return new Float32Array(e);case i.DOUBLE:return new Float64Array(e)}},i.createArrayBufferView=function(e,r,n,o){switch(n=t(n,0),o=t(o,(r.byteLength-n)/i.getSizeInBytes(e)),e){case i.BYTE:return new Int8Array(r,n,o);case i.UNSIGNED_BYTE:return new Uint8Array(r,n,o);case i.SHORT:return new Int16Array(r,n,o);case i.UNSIGNED_SHORT:return new Uint16Array(r,n,o);case i.INT:return new Int32Array(r,n,o);case i.UNSIGNED_INT:return new Uint32Array(r,n,o);case i.FLOAT:return new Float32Array(r,n,o);case i.DOUBLE:return new Float64Array(r,n,o)}},i.fromName=function(t){switch(t){case"BYTE":return i.BYTE;case"UNSIGNED_BYTE":return i.UNSIGNED_BYTE;case"SHORT":return i.SHORT;case"UNSIGNED_SHORT":return i.UNSIGNED_SHORT;case"INT":return i.INT;case"UNSIGNED_INT":return i.UNSIGNED_INT;case"FLOAT":return i.FLOAT;case"DOUBLE":return i.DOUBLE}},o(i)}),define("Core/GeometryType",["./freezeObject"],function(t){"use strict";var e={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return t(e)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(t,e){"use strict";var r={POINTS:e.POINTS,LINES:e.LINES,LINE_LOOP:e.LINE_LOOP,LINE_STRIP:e.LINE_STRIP,TRIANGLES:e.TRIANGLES,TRIANGLE_STRIP:e.TRIANGLE_STRIP,TRIANGLE_FAN:e.TRIANGLE_FAN,validate:function(t){return t===r.POINTS||t===r.LINES||t===r.LINE_LOOP||t===r.LINE_STRIP||t===r.TRIANGLES||t===r.TRIANGLE_STRIP||t===r.TRIANGLE_FAN}};return t(r)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(t,e,r,n,o){"use strict";function a(e){e=t(e,t.EMPTY_OBJECT),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=t(e.primitiveType,o.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=t(e.geometryType,n.NONE),this.boundingSphereCV=e.boundingSphereCV}return a.computeNumberOfVertices=function(t){var r=-1;for(var n in t.attributes)if(t.attributes.hasOwnProperty(n)&&e(t.attributes[n])&&e(t.attributes[n].values)){var o=t.attributes[n],a=o.values.length/o.componentsPerAttribute;r=a}return r},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(t,e,r){"use strict";function n(e){e=t(e,t.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=t(e.normalize,!1),this.values=e.values}return n}),define("Core/GeometryAttributes",["./defaultValue"],function(t){"use strict";function e(e){e=t(e,t.EMPTY_OBJECT),this.position=e.position,this.normal=e.normal,this.st=e.st,this.binormal=e.binormal,this.tangent=e.tangent,this.color=e.color}return e}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(t,e,r,n,o){"use strict";var a={UNSIGNED_BYTE:o.UNSIGNED_BYTE,UNSIGNED_SHORT:o.UNSIGNED_SHORT,UNSIGNED_INT:o.UNSIGNED_INT};return a.getSizeInBytes=function(t){switch(t){case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},a.validate=function(e){return t(e)&&(e===a.UNSIGNED_BYTE||e===a.UNSIGNED_SHORT||e===a.UNSIGNED_INT)},a.createTypedArray=function(t,e){return t>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(e):new Uint16Array(e)},a.createTypedArrayFromArrayBuffer=function(t,e,r,o){return t>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(e,r,o):new Uint16Array(e,r,o)},r(a)}),define("Core/EllipsoidGeodesic",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(t,e,r,n,o,a,i,u){"use strict";function s(t){var e=t._uSquared,r=t._ellipsoid.maximumRadius,n=t._ellipsoid.minimumRadius,o=(r-n)/r,a=Math.cos(t._startHeading),i=Math.sin(t._startHeading),u=(1-o)*Math.tan(t._start.latitude),s=1/Math.sqrt(1+u*u),E=s*u,c=Math.atan2(u,a),l=s*i,f=l*l,_=1-f,R=Math.sqrt(_),h=e/4,T=h*h,A=T*h,d=T*T,S=1+h-3*T/4+5*A/4-175*d/64,m=1-h+15*T/8-35*A/8,N=1-3*h+35*T/4,C=1-5*h,I=S*c-m*Math.sin(2*c)*h/2-N*Math.sin(4*c)*T/16-C*Math.sin(6*c)*A/48-5*Math.sin(8*c)*d/512,p=t._constants; -p.a=r,p.b=n,p.f=o,p.cosineHeading=a,p.sineHeading=i,p.tanU=u,p.cosineU=s,p.sineU=E,p.sigma=c,p.sineAlpha=l,p.sineSquaredAlpha=f,p.cosineSquaredAlpha=_,p.cosineAlpha=R,p.u2Over4=h,p.u4Over16=T,p.u6Over64=A,p.u8Over256=d,p.a0=S,p.a1=m,p.a2=N,p.a3=C,p.distanceRatio=I}function E(t,e){return t*e*(4+t*(4-3*e))/16}function c(t,e,r,n,o,a,i){var u=E(t,r);return(1-u)*t*e*(n+u*o*(i+u*a*(2*i*i-1)))}function l(t,e,r,n,o,a,i){var s,E,l,f,_,R=(e-r)/e,h=a-n,T=Math.atan((1-R)*Math.tan(o)),A=Math.atan((1-R)*Math.tan(i)),d=Math.cos(T),S=Math.sin(T),m=Math.cos(A),N=Math.sin(A),C=d*m,I=d*N,p=S*N,M=S*m,O=h,g=u.TWO_PI,y=Math.cos(O),F=Math.sin(O);do{y=Math.cos(O),F=Math.sin(O);var L=I-M*y;l=Math.sqrt(m*m*F*F+L*L),E=p+C*y,s=Math.atan2(l,E);var v;0===l?(v=0,f=1):(v=C*F/l,f=1-v*v),g=O,_=E-2*p/f,isNaN(_)&&(_=0),O=h+c(R,v,f,s,l,E,_)}while(Math.abs(O-g)>u.EPSILON12);var U=f*(e*e-r*r)/(r*r),D=1+U*(4096+U*(U*(320-175*U)-768))/16384,P=U*(256+U*(U*(74-47*U)-128))/1024,w=_*_,B=P*l*(_+P*(E*(2*w-1)-P*_*(4*l*l-3)*(4*w-3)/6)/4),x=r*D*(s-B),b=Math.atan2(m*F,I-M*y),G=Math.atan2(d*F,I*y-M);t._distance=x,t._startHeading=b,t._endHeading=G,t._uSquared=U}function f(r,n,o,a){t.normalize(a.cartographicToCartesian(n,h),R),t.normalize(a.cartographicToCartesian(o,h),h);l(r,a.maximumRadius,a.minimumRadius,n.longitude,n.latitude,o.longitude,o.latitude),r._start=e.clone(n,r._start),r._end=e.clone(o,r._end),r._start.height=0,r._end.height=0,s(r)}function _(t,o,a){var u=r(a,i.WGS84);this._ellipsoid=u,this._start=new e,this._end=new e,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,n(t)&&n(o)&&f(this,t,o,u)}var R=new t,h=new t;return o(_.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return this._startHeading}},endHeading:{get:function(){return this._endHeading}}}),_.prototype.setEndPoints=function(t,e){f(this,t,e,this._ellipsoid)},_.prototype.interpolateUsingFraction=function(t,e){return this.interpolateUsingSurfaceDistance(this._distance*t,e)},_.prototype.interpolateUsingSurfaceDistance=function(t,r){var o=this._constants,a=o.distanceRatio+t/o.b,i=Math.cos(2*a),u=Math.cos(4*a),s=Math.cos(6*a),E=Math.sin(2*a),l=Math.sin(4*a),f=Math.sin(6*a),_=Math.sin(8*a),R=a*a,h=a*R,T=o.u8Over256,A=o.u2Over4,d=o.u6Over64,S=o.u4Over16,m=2*h*T*i/3+a*(1-A+7*S/4-15*d/4+579*T/64-(S-15*d/4+187*T/16)*i-(5*d/4-115*T/16)*u-29*T*s/16)+(A/2-S+71*d/32-85*T/16)*E+(5*S/16-5*d/4+383*T/96)*l-R*((d-11*T/2)*E+5*T*l/2)+(29*d/96-29*T/16)*f+539*T*_/1536,N=Math.asin(Math.sin(m)*o.cosineAlpha),C=Math.atan(o.a/o.b*Math.tan(N));m-=o.sigma;var I=Math.cos(2*o.sigma+m),p=Math.sin(m),M=Math.cos(m),O=o.cosineU*M,g=o.sineU*p,y=Math.atan2(p*o.sineHeading,O-g*o.cosineHeading),F=y-c(o.f,o.sineAlpha,o.cosineSquaredAlpha,m,p,M,I);return n(r)?(r.longitude=this._start.longitude+F,r.latitude=C,r.height=0,r):new e(this._start.longitude+F,C,0)},_}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(t,e){"use strict";function r(t,r,n){var o=t+r;return e.sign(t)!==e.sign(r)&&Math.abs(o/Math.max(Math.abs(t),Math.abs(r)))<n?0:o}var n={};return n.computeDiscriminant=function(t,e,r){var n=e*e-4*t*r;return n},n.computeRealRoots=function(t,n,o){var a;if(0===t)return 0===n?[]:[-o/n];if(0===n){if(0===o)return[0,0];var i=Math.abs(o),u=Math.abs(t);if(i<u&&i/u<e.EPSILON14)return[0,0];if(i>u&&u/i<e.EPSILON14)return[];if(a=-o/t,a<0)return[];var s=Math.sqrt(a);return[-s,s]}if(0===o)return a=-n/t,a<0?[a,0]:[0,a];var E=n*n,c=4*t*o,l=r(E,-c,e.EPSILON14);if(l<0)return[];var f=-.5*r(n,e.sign(n)*Math.sqrt(l),e.EPSILON14);return n>0?[f/t,o/f]:[o/f,f/t]},n}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(t,e){"use strict";function r(t,e,r,n){var o,a,i=t,u=e/3,s=r/3,E=n,c=i*s,l=u*E,f=u*u,_=s*s,R=i*s-f,h=i*E-u*s,T=u*E-_,A=4*R*T-h*h;if(A<0){var d,S,m;f*l>=c*_?(d=i,S=R,m=-2*u*R+i*h):(d=E,S=T,m=-E*h+2*s*T);var N=m<0?-1:1,C=-N*Math.abs(d)*Math.sqrt(-A);a=-m+C;var I=a/2,p=I<0?-Math.pow(-I,1/3):Math.pow(I,1/3),M=a===C?-p:-S/p;return o=S<=0?p+M:-m/(p*p+M*M+S),f*l>=c*_?[(o-u)/i]:[-E/(o+s)]}var O=R,g=-2*u*R+i*h,y=T,F=-E*h+2*s*T,L=Math.sqrt(A),v=Math.sqrt(3)/2,U=Math.abs(Math.atan2(i*L,-g)/3);o=2*Math.sqrt(-O);var D=Math.cos(U);a=o*D;var P=o*(-D/2-v*Math.sin(U)),w=a+P>2*u?a-u:P-u,B=i,x=w/B;U=Math.abs(Math.atan2(E*L,-F)/3),o=2*Math.sqrt(-y),D=Math.cos(U),a=o*D,P=o*(-D/2-v*Math.sin(U));var b=-E,G=a+P<2*s?a+s:P+s,z=b/G,H=B*G,V=-w*G-B*b,q=w*b,W=(s*V-u*q)/(-u*V+s*H);return x<=W?x<=z?W<=z?[x,W,z]:[x,z,W]:[z,x,W]:x<=z?[W,x,z]:W<=z?[W,z,x]:[z,W,x]}var n={};return n.computeDiscriminant=function(t,e,r,n){var o=t*t,a=e*e,i=r*r,u=n*n,s=18*t*e*r*n+a*i-27*o*u-4*(t*i*r+a*e*n);return s},n.computeRealRoots=function(t,n,o,a){var i,u;if(0===t)return e.computeRealRoots(n,o,a);if(0===n){if(0===o){if(0===a)return[0,0,0];u=-a/t;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===a?(i=e.computeRealRoots(t,0,o),0===i.Length?[0]:[i[0],0,i[1]]):r(t,0,o,a)}return 0===o?0===a?(u=-n/t,u<0?[u,0,0]:[0,0,u]):r(t,n,0,a):0===a?(i=e.computeRealRoots(t,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(t,n,o,a)},n}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(t,e,r,n){"use strict";function o(e,o,a,i){var u=e*e,s=o-3*u/8,E=a-o*e/2+u*e/8,c=i-a*e/4+o*u/16-3*u*u/256,l=t.computeRealRoots(1,2*s,s*s-4*c,-E*E);if(l.length>0){var f=-e/4,_=l[l.length-1];if(Math.abs(_)<r.EPSILON14){var R=n.computeRealRoots(1,s,c);if(2===R.length){var h,T=R[0],A=R[1];if(T>=0&&A>=0){var d=Math.sqrt(T),S=Math.sqrt(A);return[f-S,f-d,f+d,f+S]}if(T>=0&&A<0)return h=Math.sqrt(T),[f-h,f+h];if(T<0&&A>=0)return h=Math.sqrt(A),[f-h,f+h]}return[]}if(_>0){var m=Math.sqrt(_),N=(s+_-E/m)/2,C=(s+_+E/m)/2,I=n.computeRealRoots(1,m,N),p=n.computeRealRoots(1,-m,C);return 0!==I.length?(I[0]+=f,I[1]+=f,0!==p.length?(p[0]+=f,p[1]+=f,I[1]<=p[0]?[I[0],I[1],p[0],p[1]]:p[1]<=I[0]?[p[0],p[1],I[0],I[1]]:I[0]>=p[0]&&I[1]<=p[1]?[p[0],I[0],I[1],p[1]]:p[0]>=I[0]&&p[1]<=I[1]?[I[0],p[0],p[1],I[1]]:I[0]>p[0]&&I[0]<p[1]?[p[0],I[0],p[1],I[1]]:[I[0],p[0],I[1],p[1]]):I):0!==p.length?(p[0]+=f,p[1]+=f,p):[]}}return[]}function a(e,o,a,i){var u=a*a,s=o*o,E=e*e,c=-2*o,l=a*e+s-4*i,f=E*i-a*o*e+u,_=t.computeRealRoots(1,c,l,f);if(_.length>0){var R,h,T=_[0],A=o-T,d=A*A,S=e/2,m=A/2,N=d-4*i,C=d+4*Math.abs(i),I=E-4*T,p=E+4*Math.abs(T);if(T<0||N*p<I*C){var M=Math.sqrt(I);R=M/2,h=0===M?0:(e*m-a)/M}else{var O=Math.sqrt(N);R=0===O?0:(e*m-a)/O,h=O/2}var g,y;0===S&&0===R?(g=0,y=0):r.sign(S)===r.sign(R)?(g=S+R,y=T/g):(y=S-R,g=T/y);var F,L;0===m&&0===h?(F=0,L=0):r.sign(m)===r.sign(h)?(F=m+h,L=i/F):(L=m-h,F=i/L);var v=n.computeRealRoots(1,g,F),U=n.computeRealRoots(1,y,L);if(0!==v.length)return 0!==U.length?v[1]<=U[0]?[v[0],v[1],U[0],U[1]]:U[1]<=v[0]?[U[0],U[1],v[0],v[1]]:v[0]>=U[0]&&v[1]<=U[1]?[U[0],v[0],v[1],U[1]]:U[0]>=v[0]&&U[1]<=v[1]?[v[0],U[0],U[1],v[1]]:v[0]>U[0]&&v[0]<U[1]?[U[0],v[0],U[1],v[1]]:[v[0],U[0],v[1],U[1]]:v;if(0!==U.length)return U}return[]}var i={};return i.computeDiscriminant=function(t,e,r,n,o){var a=t*t,i=a*t,u=e*e,s=u*e,E=r*r,c=E*r,l=n*n,f=l*n,_=o*o,R=_*o,h=u*E*l-4*s*f-4*t*c*l+18*t*e*r*f-27*a*l*l+256*i*R+o*(18*s*r*n-4*u*c+16*t*E*E-80*t*e*E*n-6*t*u*l+144*a*r*l)+_*(144*t*u*r-27*u*u-128*a*E-192*a*e*n);return h},i.computeRealRoots=function(e,n,i,u,s){if(Math.abs(e)<r.EPSILON15)return t.computeRealRoots(n,i,u,s);var E=n/e,c=i/e,l=u/e,f=s/e,_=E<0?1:0;switch(_+=c<0?_+1:_,_+=l<0?_+1:_,_+=f<0?_+1:_){case 0:return o(E,c,l,f);case 1:return a(E,c,l,f);case 2:return a(E,c,l,f);case 3:return o(E,c,l,f);case 4:return o(E,c,l,f);case 5:return a(E,c,l,f);case 6:return o(E,c,l,f);case 7:return o(E,c,l,f);case 8:return a(E,c,l,f);case 9:return o(E,c,l,f);case 10:return o(E,c,l,f);case 11:return a(E,c,l,f);case 12:return o(E,c,l,f);case 13:return o(E,c,l,f);case 14:return o(E,c,l,f);case 15:return o(E,c,l,f);default:return}},i}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(t,e,r,n){"use strict";function o(r,n){n=t.clone(e(n,t.ZERO)),t.equals(n,t.ZERO)||t.normalize(n,n),this.origin=t.clone(e(r,t.ZERO)),this.direction=n}return o.getPoint=function(e,n,o){return r(o)||(o=new t),o=t.multiplyByScalar(e.direction,n,o),t.add(e.origin,o,o)},o}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(t,e,r,n,o,a,i,u,s,E){"use strict";function c(t,e,r,n){var o=e*e-4*t*r;if(!(o<0)){if(o>0){var a=1/(2*t),i=Math.sqrt(o),u=(-e+i)*a,s=(-e-i)*a;return u<s?(n.root0=u,n.root1=s):(n.root0=s,n.root1=u),n}var E=-e/(2*t);if(0!==E)return n.root0=n.root1=E,n}}function l(e,r,o){n(o)||(o={});var a=e.origin,i=e.direction,u=r.center,s=r.radius*r.radius,E=t.subtract(a,u,A),l=t.dot(i,i),f=2*t.dot(i,E),_=t.magnitudeSquared(E)-s,R=c(l,f,_,N);if(n(R))return o.start=R.root0,o.stop=R.root1,o}function f(t,e,r){var n=t+e;return a.sign(t)!==a.sign(e)&&Math.abs(n/Math.max(Math.abs(t),Math.abs(e)))<r?0:n}function _(e,r,n,o,E){var c,l=o*o,_=E*E,R=(e[i.COLUMN1ROW1]-e[i.COLUMN2ROW2])*_,h=E*(o*f(e[i.COLUMN1ROW0],e[i.COLUMN0ROW1],a.EPSILON15)+r.y),T=e[i.COLUMN0ROW0]*l+e[i.COLUMN2ROW2]*_+o*r.x+n,A=_*f(e[i.COLUMN2ROW1],e[i.COLUMN1ROW2],a.EPSILON15),d=E*(o*f(e[i.COLUMN2ROW0],e[i.COLUMN0ROW2])+r.z),S=[];if(0===d&&0===A){if(c=u.computeRealRoots(R,h,T),0===c.length)return S;var m=c[0],N=Math.sqrt(Math.max(1-m*m,0));if(S.push(new t(o,E*m,E*-N)),S.push(new t(o,E*m,E*N)),2===c.length){var C=c[1],I=Math.sqrt(Math.max(1-C*C,0));S.push(new t(o,E*C,E*-I)),S.push(new t(o,E*C,E*I))}return S}var p=d*d,M=A*A,O=R*R,g=d*A,y=O+M,F=2*(h*R+g),L=2*T*R+h*h-M+p,v=2*(T*h-g),U=T*T-p;if(0===y&&0===F&&0===L&&0===v)return S;c=s.computeRealRoots(y,F,L,v,U);var D=c.length;if(0===D)return S;for(var P=0;P<D;++P){var w,B=c[P],x=B*B,b=Math.max(1-x,0),G=Math.sqrt(b);w=a.sign(R)===a.sign(T)?f(R*x+T,h*B,a.EPSILON12):a.sign(T)===a.sign(h*B)?f(R*x,h*B+T,a.EPSILON12):f(R*x+h*B,T,a.EPSILON12);var z=f(A*B,d,a.EPSILON15),H=w*z;H<0?S.push(new t(o,E*B,E*G)):H>0?S.push(new t(o,E*B,E*-G)):0!==G?(S.push(new t(o,E*B,E*-G)),S.push(new t(o,E*B,E*G)),++P):S.push(new t(o,E*B,E*G))}return S}var R={};R.rayPlane=function(e,r,o){n(o)||(o=new t);var i=e.origin,u=e.direction,s=r.normal,E=t.dot(s,u);if(!(Math.abs(E)<a.EPSILON15)){var c=(-r.distance-t.dot(s,i))/E;if(!(c<0))return o=t.multiplyByScalar(u,c,o),t.add(i,o,o)}};var h=new t,T=new t,A=new t,d=new t,S=new t;R.rayTriangleParametric=function(e,n,o,i,u){u=r(u,!1);var s,E,c,l,f,_=e.origin,R=e.direction,m=t.subtract(o,n,h),N=t.subtract(i,n,T),C=t.cross(R,N,A),I=t.dot(m,C);if(u){if(I<a.EPSILON6)return;if(s=t.subtract(_,n,d),c=t.dot(s,C),c<0||c>I)return;if(E=t.cross(s,m,S),l=t.dot(R,E),l<0||c+l>I)return;f=t.dot(N,E)/I}else{if(Math.abs(I)<a.EPSILON6)return;var p=1/I;if(s=t.subtract(_,n,d),c=t.dot(s,C)*p,c<0||c>1)return;if(E=t.cross(s,m,S),l=t.dot(R,E)*p,l<0||c+l>1)return;f=t.dot(N,E)*p}return f},R.rayTriangle=function(e,r,o,a,i,u){var s=R.rayTriangleParametric(e,r,o,a,i);if(n(s)&&!(s<0))return n(u)||(u=new t),t.multiplyByScalar(e.direction,s,u),t.add(e.origin,u,u)};var m=new E;R.lineSegmentTriangle=function(e,r,o,a,i,u,s){var E=m;t.clone(e,E.origin),t.subtract(r,e,E.direction),t.normalize(E.direction,E.direction);var c=R.rayTriangleParametric(E,o,a,i,u);if(!(!n(c)||c<0||c>t.distance(e,r)))return n(s)||(s=new t),t.multiplyByScalar(E.direction,c,s),t.add(E.origin,s,s)};var N={root0:0,root1:0};R.raySphere=function(t,e,r){if(r=l(t,e,r),n(r)&&!(r.stop<0))return r.start=Math.max(r.start,0),r};var C=new E;R.lineSegmentSphere=function(e,r,o,a){var i=C;t.clone(e,i.origin);var u=t.subtract(r,e,i.direction),s=t.magnitude(u);if(t.normalize(u,u),a=l(i,o,a),!(!n(a)||a.stop<0||a.start>s))return a.start=Math.max(a.start,0),a.stop=Math.min(a.stop,s),a};var I=new t,p=new t;R.rayEllipsoid=function(e,r){var n,o,a,i,u,s=r.oneOverRadii,E=t.multiplyComponents(s,e.origin,I),c=t.multiplyComponents(s,e.direction,p),l=t.magnitudeSquared(E),f=t.dot(E,c);if(l>1){if(f>=0)return;var _=f*f;if(n=l-1,o=t.magnitudeSquared(c),a=o*n,_<a)return;if(_>a){i=f*f-a,u=-f+Math.sqrt(i);var R=u/o,h=n/u;return R<h?{start:R,stop:h}:{start:h,stop:R}}var T=Math.sqrt(n/o);return{start:T,stop:T}}return l<1?(n=l-1,o=t.magnitudeSquared(c),a=o*n,i=f*f-a,u=-f+Math.sqrt(i),{start:0,stop:u/o}):f<0?(o=t.magnitudeSquared(c),{start:0,stop:-f/o}):void 0};var M=new t,O=new t,g=new t,y=new t,F=new t,L=new i,v=new i,U=new i,D=new i,P=new i,w=new i,B=new i,x=new t,b=new t,G=new e;R.grazingAltitudeLocation=function(e,r){var o=e.origin,u=e.direction;if(!t.equals(o,t.ZERO)){var s=r.geodeticSurfaceNormal(o,M);if(t.dot(u,s)>=0)return o}var E=n(this.rayEllipsoid(e,r)),c=r.transformPositionToScaledSpace(u,M),l=t.normalize(c,c),f=t.mostOrthogonalAxis(c,y),R=t.normalize(t.cross(f,l,O),O),h=t.normalize(t.cross(l,R,g),g),T=L;T[0]=l.x,T[1]=l.y,T[2]=l.z,T[3]=R.x,T[4]=R.y,T[5]=R.z,T[6]=h.x,T[7]=h.y,T[8]=h.z;var A=i.transpose(T,v),d=i.fromScale(r.radii,U),S=i.fromScale(r.oneOverRadii,D),m=P;m[0]=0,m[1]=-u.z,m[2]=u.y,m[3]=u.z,m[4]=0,m[5]=-u.x,m[6]=-u.y,m[7]=u.x,m[8]=0;var N,C,I=i.multiply(i.multiply(A,S,w),m,w),p=i.multiply(i.multiply(I,d,B),T,B),z=i.multiplyByVector(I,o,F),H=_(p,t.negate(z,M),0,0,1),V=H.length;if(V>0){for(var q=t.clone(t.ZERO,b),W=Number.NEGATIVE_INFINITY,X=0;X<V;++X){N=i.multiplyByVector(d,i.multiplyByVector(T,H[X],x),x);var Y=t.normalize(t.subtract(N,o,y),y),K=t.dot(Y,u);K>W&&(W=K,q=t.clone(N,q))}var k=r.cartesianToCartographic(q,G);return W=a.clamp(W,0,1),C=t.magnitude(t.subtract(q,o,y))*Math.sqrt(1-W*W),C=E?-C:C,k.height=C,r.cartographicToCartesian(k,new t)}};var z=new t;return R.lineSegmentPlane=function(e,r,o,i){n(i)||(i=new t);var u=t.subtract(r,e,z),s=o.normal,E=t.dot(s,u);if(!(Math.abs(E)<a.EPSILON6)){var c=t.dot(s,e),l=-(o.distance+c)/E;if(!(l<0||l>1))return t.multiplyByScalar(u,l,i),t.add(e,i,i),i}},R.trianglePlaneIntersection=function(e,r,n,o){var a=o.normal,i=o.distance,u=t.dot(a,e)+i<0,s=t.dot(a,r)+i<0,E=t.dot(a,n)+i<0,c=0;c+=u?1:0,c+=s?1:0,c+=E?1:0;var l,f;if(1!==c&&2!==c||(l=new t,f=new t),1===c){if(u)return R.lineSegmentPlane(e,r,o,l),R.lineSegmentPlane(e,n,o,f),{positions:[e,r,n,l,f],indices:[0,3,4,1,2,4,1,4,3]};if(s)return R.lineSegmentPlane(r,n,o,l),R.lineSegmentPlane(r,e,o,f),{positions:[e,r,n,l,f],indices:[1,3,4,2,0,4,2,4,3]};if(E)return R.lineSegmentPlane(n,e,o,l),R.lineSegmentPlane(n,r,o,f),{positions:[e,r,n,l,f],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===c){if(!u)return R.lineSegmentPlane(r,e,o,l),R.lineSegmentPlane(n,e,o,f),{positions:[e,r,n,l,f],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return R.lineSegmentPlane(n,r,o,l),R.lineSegmentPlane(e,r,o,f),{positions:[e,r,n,l,f],indices:[2,0,4,2,4,3,1,3,4]};if(!E)return R.lineSegmentPlane(e,n,o,l),R.lineSegmentPlane(r,n,o,f),{positions:[e,r,n,l,f],indices:[0,1,4,0,4,3,2,3,4]}}},R}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(t,e,r,n){"use strict";function o(e,r){this.normal=t.clone(e),this.distance=r}o.fromPointNormal=function(r,n,a){var i=-t.dot(n,r);return e(a)?(t.clone(n,a.normal),a.distance=i,a):new o(n,i)};var a=new t;return o.fromCartesian4=function(r,n){var i=t.fromCartesian4(r,a),u=r.w;return e(n)?(t.clone(i,n.normal),n.distance=u,n):new o(i,u)},o.getPointDistance=function(e,r){return t.dot(e.normal,r)+e.distance},o.ORIGIN_XY_PLANE=n(new o(t.UNIT_Z,0)),o.ORIGIN_YZ_PLANE=n(new o(t.UNIT_X,0)),o.ORIGIN_ZX_PLANE=n(new o(t.UNIT_Y,0)),o}),define("Core/PolylinePipeline",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidGeodesic","./IntersectionTests","./isArray","./Math","./Matrix4","./Plane"],function(t,e,r,n,o,a,i,u,s,E,c,l){"use strict";function f(t,e,r){var n=p;n.length=t;var o;if(e===r){for(o=0;o<t;o++)n[o]=e;return n}var a=r-e,i=a/t;for(o=0;o<t;o++){var u=e+o*i;n[o]=u}return n}function _(e,r,n,o,a,i,u,s){var E=o.scaleToGeodeticSurface(e,y),c=o.scaleToGeodeticSurface(r,F),l=R.numberOfPoints(e,r,n),_=o.cartesianToCartographic(E,M),h=o.cartesianToCartographic(c,O),T=f(l,a,i);L.setEndPoints(_,h);var A=L.surfaceDistance/l,d=s;_.height=a;var S=o.cartographicToCartesian(_,g);t.pack(S,u,d),d+=3;for(var m=1;m<l;m++){var N=L.interpolateUsingSurfaceDistance(m*A,O);N.height=T[m],S=o.cartographicToCartesian(N,g),t.pack(S,u,d),d+=3}return d}var R={};R.numberOfPoints=function(e,r,n){var o=t.distance(e,r);return Math.ceil(o/n)};var h=new e;R.extractHeights=function(t,e){for(var r=t.length,n=new Array(r),o=0;o<r;o++){var a=t[o];n[o]=e.cartesianToCartographic(a,h).height}return n};var T=new c,A=new t,d=new t,S=new l(t.ZERO,0),m=new t,N=new l(t.ZERO,0),C=new t,I=new t,p=[],M=new e,O=new e,g=new t,y=new t,F=new t,L=new i;return R.wrapLongitude=function(e,o){var a=[],i=[];if(n(e)&&e.length>0){o=r(o,c.IDENTITY);var s=c.inverseTransformation(o,T),E=c.multiplyByPoint(s,t.ZERO,A),f=c.multiplyByPointAsVector(s,t.UNIT_Y,d),_=l.fromPointNormal(E,f,S),R=c.multiplyByPointAsVector(s,t.UNIT_X,m),h=l.fromPointNormal(E,R,N),p=1;a.push(t.clone(e[0]));for(var M=a[0],O=e.length,g=1;g<O;++g){var y=e[g];if(l.getPointDistance(h,M)<0||l.getPointDistance(h,y)<0){var F=u.lineSegmentPlane(M,y,_,C);if(n(F)){var L=t.multiplyByScalar(f,5e-9,I);l.getPointDistance(_,M)<0&&t.negate(L,L),a.push(t.add(F,L,new t)),i.push(p+1),t.negate(L,L),a.push(t.add(F,L,new t)),p=1}}a.push(t.clone(e[g])),p++,M=y}i.push(p)}return{positions:a,lengths:i}},R.generateArc=function(e){n(e)||(e={});var o=e.positions,i=o.length,u=r(e.ellipsoid,a.WGS84),c=r(e.height,0),l=s(c);if(i<1)return[];if(1===i){var f=u.scaleToGeodeticSurface(o[0],y);if(c=l?c[0]:c,0!==c){var h=u.geodeticSurfaceNormal(f,g);t.multiplyByScalar(h,c,h),t.add(f,h,f)}return[f.x,f.y,f.z]}var T=e.minDistance;if(!n(T)){var A=r(e.granularity,E.RADIANS_PER_DEGREE);T=E.chordLength(A,u.maximumRadius)}var d,S=0;for(d=0;d<i-1;d++)S+=R.numberOfPoints(o[d],o[d+1],T);var m=3*(S+1),N=new Array(m),C=0;for(d=0;d<i-1;d++){var I=o[d],O=o[d+1],F=l?c[d]:c,L=l?c[d+1]:c;C=_(I,O,T,u,F,L,N,C)}p.length=0;var v=o[i-1],U=u.cartesianToCartographic(v,M);U.height=l?c[i-1]:c;var D=u.cartographicToCartesian(U,g);return t.pack(D,N,m-3),N},R.generateCartesianArc=function(e){for(var r=R.generateArc(e),n=r.length/3,o=new Array(n),a=0;a<n;a++)o[a]=t.unpack(r,3*a);return o},R}),define("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(t,e,r,n){"use strict";function o(e){e=t(e,t.EMPTY_OBJECT),this.position=t(e.position,!1),this.normal=t(e.normal,!1),this.st=t(e.st,!1),this.binormal=t(e.binormal,!1),this.tangent=t(e.tangent,!1),this.color=t(e.color,!1)}return o.POSITION_ONLY=n(new o({position:!0})),o.POSITION_AND_NORMAL=n(new o({position:!0,normal:!0})),o.POSITION_NORMAL_AND_ST=n(new o({position:!0,normal:!0,st:!0})),o.POSITION_AND_ST=n(new o({position:!0,st:!0})),o.POSITION_AND_COLOR=n(new o({position:!0,color:!0})),o.ALL=n(new o({position:!0,normal:!0,st:!0,binormal:!0,tangent:!0})),o.DEFAULT=o.POSITION_NORMAL_AND_ST,o.packedLength=6,o.pack=function(e,r,n){return n=t(n,0),r[n++]=e.position?1:0,r[n++]=e.normal?1:0,r[n++]=e.st?1:0,r[n++]=e.binormal?1:0,r[n++]=e.tangent?1:0,r[n++]=e.color?1:0,r},o.unpack=function(r,n,a){return n=t(n,0),e(a)||(a=new o),a.position=1===r[n++],a.normal=1===r[n++],a.st=1===r[n++],a.binormal=1===r[n++],a.tangent=1===r[n++],a.color=1===r[n++],a},o.clone=function(t,r){if(e(t))return e(r)||(r=new o),r.position=t.position,r.normal=t.normal,r.st=t.st,r.binormal=t.binormal,r.tangent=t.tangent,r.color=t.color,r},o}),define("Core/PolylineGeometry",["./arrayRemoveDuplicates","./BoundingSphere","./Cartesian3","./Color","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryType","./IndexDatatype","./Math","./PolylinePipeline","./PrimitiveType","./VertexFormat"],function(t,e,r,n,o,a,i,u,s,E,c,l,f,_,R,h,T,A){"use strict";function d(t,e,r,o,a){var i=m;i.length=a;var u,s=r.red,E=r.green,c=r.blue,l=r.alpha,f=o.red,_=o.green,R=o.blue,h=o.alpha;if(n.equals(r,o)){for(u=0;u<a;u++)i[u]=n.clone(r);return i}var T=(f-s)/a,A=(_-E)/a,d=(R-c)/a,S=(h-l)/a;for(u=0;u<a;u++)i[u]=new n(s+u*T,E+u*A,c+u*d,l+u*S);return i}function S(t){t=a(t,a.EMPTY_OBJECT);var e=t.positions,o=t.colors,u=a(t.width,1),E=a(t.colorsPerVertex,!1);this._positions=e,this._colors=o,this._width=u,this._colorsPerVertex=E,this._vertexFormat=A.clone(a(t.vertexFormat,A.DEFAULT)),this._followSurface=a(t.followSurface,!0),this._granularity=a(t.granularity,R.RADIANS_PER_DEGREE),this._ellipsoid=s.clone(a(t.ellipsoid,s.WGS84)),this._workerName="createPolylineGeometry";var c=1+e.length*r.packedLength;c+=i(o)?1+o.length*n.packedLength:1,this.packedLength=c+s.packedLength+A.packedLength+4}var m=[];S.pack=function(t,e,o){o=a(o,0);var u,E=t._positions,c=E.length;for(e[o++]=c,u=0;u<c;++u,o+=r.packedLength)r.pack(E[u],e,o);var l=t._colors;for(c=i(l)?l.length:0,e[o++]=c,u=0;u<c;++u,o+=n.packedLength)n.pack(l[u],e,o);return s.pack(t._ellipsoid,e,o),o+=s.packedLength,A.pack(t._vertexFormat,e,o),o+=A.packedLength,e[o++]=t._width,e[o++]=t._colorsPerVertex?1:0,e[o++]=t._followSurface?1:0,e[o]=t._granularity,e};var N=s.clone(s.UNIT_SPHERE),C=new A,I={positions:void 0,colors:void 0,ellipsoid:N,vertexFormat:C,width:void 0,colorsPerVertex:void 0,followSurface:void 0,granularity:void 0};S.unpack=function(t,e,o){e=a(e,0);var u,E=t[e++],c=new Array(E);for(u=0;u<E;++u,e+=r.packedLength)c[u]=r.unpack(t,e);E=t[e++];var l=E>0?new Array(E):void 0;for(u=0;u<E;++u,e+=n.packedLength)l[u]=n.unpack(t,e);var f=s.unpack(t,e,N);e+=s.packedLength;var _=A.unpack(t,e,C);e+=A.packedLength;var R=t[e++],h=1===t[e++],T=1===t[e++],d=t[e];return i(o)?(o._positions=c,o._colors=l,o._ellipsoid=s.clone(f,o._ellipsoid),o._vertexFormat=A.clone(_,o._vertexFormat),o._width=R,o._colorsPerVertex=h,o._followSurface=T,o._granularity=d,o):(I.positions=c,I.colors=l,I.width=R,I.colorsPerVertex=h,I.followSurface=T,I.granularity=d,new S(I))};var p=new r,M=new r,O=new r,g=new r;return S.createGeometry=function(a){var u,s,A,S=a._width,N=a._vertexFormat,C=a._colors,I=a._colorsPerVertex,y=a._followSurface,F=a._granularity,L=a._ellipsoid,v=t(a._positions,r.equalsEpsilon),U=v.length;if(!(U<2||S<=0)){if(y){var D=h.extractHeights(v,L),P=R.chordLength(F,L.maximumRadius);if(i(C)){var w=1;for(u=0;u<U-1;++u)w+=h.numberOfPoints(v[u],v[u+1],P);var B=new Array(w),x=0;for(u=0;u<U-1;++u){var b=v[u],G=v[u+1],z=C[u],H=h.numberOfPoints(b,G,P);if(I&&u<w){var V=C[u+1],q=d(b,G,z,V,H),W=q.length;for(s=0;s<W;++s)B[x++]=q[s]}else for(s=0;s<H;++s)B[x++]=n.clone(z)}B[x]=n.clone(C[C.length-1]),C=B,m.length=0}v=h.generateCartesianArc({positions:v,minDistance:P,ellipsoid:L,height:D})}U=v.length;var X,Y=4*U-4,K=new Float64Array(3*Y),k=new Float64Array(3*Y),Z=new Float64Array(3*Y),j=new Float32Array(2*Y),Q=N.st?new Float32Array(2*Y):void 0,J=i(C)?new Uint8Array(4*Y):void 0,$=0,tt=0,et=0,rt=0;for(s=0;s<U;++s){0===s?(X=p,r.subtract(v[0],v[1],X),r.add(v[0],X,X)):X=v[s-1],r.clone(X,O),r.clone(v[s],M),s===U-1?(X=p,r.subtract(v[U-1],v[U-2],X),r.add(v[U-1],X,X)):X=v[s+1],r.clone(X,g);var nt,ot;i(J)&&(nt=0===s||I?C[s]:C[s-1],s!==U-1&&(ot=C[s]));var at=0===s?2:0,it=s===U-1?2:4;for(A=at;A<it;++A){r.pack(M,K,$),r.pack(O,k,$),r.pack(g,Z,$),$+=3;var ut=A-2<0?-1:1;if(j[tt++]=2*(A%2)-1,j[tt++]=ut*S,N.st&&(Q[et++]=s/(U-1),Q[et++]=Math.max(j[tt-2],0)),i(J)){var st=A<2?nt:ot;J[rt++]=n.floatToByte(st.red),J[rt++]=n.floatToByte(st.green),J[rt++]=n.floatToByte(st.blue),J[rt++]=n.floatToByte(st.alpha)}}}var Et=new l;Et.position=new c({componentDatatype:o.DOUBLE,componentsPerAttribute:3,values:K}),Et.prevPosition=new c({componentDatatype:o.DOUBLE,componentsPerAttribute:3,values:k}),Et.nextPosition=new c({componentDatatype:o.DOUBLE,componentsPerAttribute:3,values:Z}),Et.expandAndWidth=new c({componentDatatype:o.FLOAT,componentsPerAttribute:2,values:j}),N.st&&(Et.st=new c({componentDatatype:o.FLOAT,componentsPerAttribute:2,values:Q})),i(J)&&(Et.color=new c({componentDatatype:o.UNSIGNED_BYTE,componentsPerAttribute:4,values:J,normalize:!0}));var ct=_.createTypedArray(Y,6*U-6),lt=0,ft=0,_t=U-1;for(s=0;s<_t;++s)ct[ft++]=lt,ct[ft++]=lt+2,ct[ft++]=lt+1,ct[ft++]=lt+1,ct[ft++]=lt+2,ct[ft++]=lt+3,lt+=4;return new E({attributes:Et,indices:ct,primitiveType:T.TRIANGLES,boundingSphere:e.fromPoints(v),geometryType:f.POLYLINES})}},S}),define("Workers/createPolylineGeometry",["../Core/defined","../Core/Ellipsoid","../Core/PolylineGeometry"],function(t,e,r){"use strict";function n(n,o){return t(o)&&(n=r.unpack(n,o)),n._ellipsoid=e.clone(n._ellipsoid),r.createGeometry(n)}return n})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function t(t){return void 0!==t&&null!==t}return t}),define("Core/DeveloperError",["./defined"],function(t){"use strict";function e(t){this.name="DeveloperError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e.throwInstantiationError=function(){throw new e("This function defines an interface and should not be called directly.")},e}),define("Core/Check",["./defined","./DeveloperError"],function(t,e){"use strict";function r(t){return t+" is required, actual value was undefined"}function n(t,e,r){return"Expected "+r+" to be typeof "+e+", actual typeof was "+t}var a={};return a.typeOf={},a.defined=function(n,a){if(!t(a))throw new e(r(n))},a.typeOf.func=function(t,r){if("function"!=typeof r)throw new e(n(typeof r,"function",t))},a.typeOf.string=function(t,r){if("string"!=typeof r)throw new e(n(typeof r,"string",t))},a.typeOf.number=function(t,r){if("number"!=typeof r)throw new e(n(typeof r,"number",t))},a.typeOf.number.lessThan=function(t,r,n){if(a.typeOf.number(t,r),r>=n)throw new e("Expected "+t+" to be less than "+n+", actual value was "+r)},a.typeOf.number.lessThanOrEquals=function(t,r,n){if(a.typeOf.number(t,r),r>n)throw new e("Expected "+t+" to be less than or equal to "+n+", actual value was "+r)},a.typeOf.number.greaterThan=function(t,r,n){if(a.typeOf.number(t,r),r<=n)throw new e("Expected "+t+" to be greater than "+n+", actual value was "+r)},a.typeOf.number.greaterThanOrEquals=function(t,r,n){if(a.typeOf.number(t,r),r<n)throw new e("Expected "+t+" to be greater than or equal to"+n+", actual value was "+r)},a.typeOf.object=function(t,r){if("object"!=typeof r)throw new e(n(typeof r,"object",t))},a.typeOf.bool=function(t,r){if("boolean"!=typeof r)throw new e(n(typeof r,"boolean",t))},a}),define("Core/freezeObject",["./defined"],function(t){"use strict";var e=Object.freeze;return t(e)||(e=function(t){return t}),e}),define("Core/defaultValue",["./freezeObject"],function(t){"use strict";function e(t,e){return void 0!==t?t:e}return e.EMPTY_OBJECT=t({}),e}),define("ThirdParty/mersenne-twister",[],function(){var t=function(t){void 0==t&&(t=(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(t)};return t.prototype.init_genrand=function(t){for(this.mt[0]=t>>>0,this.mti=1;this.mti<this.N;this.mti++){var t=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&t)>>>16)<<16)+1812433253*(65535&t)+this.mti,this.mt[this.mti]>>>=0}},t.prototype.genrand_int32=function(){var t,e=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++)t=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+this.M]^t>>>1^e[1&t];for(;r<this.N-1;r++)t=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+(this.M-this.N)]^t>>>1^e[1&t];t=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^t>>>1^e[1&t],this.mti=0}return t=this.mt[this.mti++],t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,t^=t>>>18,t>>>0},t.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},t}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(t,e,r,n){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(t){return t>0?1:t<0?-1:0},a.signNotZero=function(t){return t<0?-1:1},a.toSNorm=function(t,r){return r=e(r,255),Math.round((.5*a.clamp(t,-1,1)+.5)*r)},a.fromSNorm=function(t,r){return r=e(r,255),a.clamp(t,0,r)/r*2-1},a.sinh=function(t){var e=Math.pow(Math.E,t),r=Math.pow(Math.E,-1*t);return.5*(e-r)},a.cosh=function(t){var e=Math.pow(Math.E,t),r=Math.pow(Math.E,-1*t);return.5*(e+r)},a.lerp=function(t,e,r){return(1-r)*t+r*e},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(t){return t*a.RADIANS_PER_DEGREE},a.toDegrees=function(t){return t*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(t){var e=a.TWO_PI,r=t-Math.floor(t/e)*e;return r<-Math.PI?r+e:r>=Math.PI?r-e:r},a.clampToLatitudeRange=function(t){return a.clamp(t,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(t){return a.zeroToTwoPi(t+a.PI)-a.PI},a.zeroToTwoPi=function(t){var e=a.mod(t,a.TWO_PI);return Math.abs(e)<a.EPSILON14&&Math.abs(t)>a.EPSILON14?a.TWO_PI:e},a.mod=function(t,e){return(t%e+e)%e},a.equalsEpsilon=function(t,r,n,a){a=e(a,n);var o=Math.abs(t-r);return o<=a||o<=n*Math.max(Math.abs(t),Math.abs(r))};var o=[1];a.factorial=function(t){var e=o.length;if(t>=e)for(var r=o[e-1],n=e;n<=t;n++)o.push(r*n);return o[t]},a.incrementWrap=function(t,r,n){return n=e(n,0),++t,t>r&&(t=n),t},a.isPowerOfTwo=function(t){return 0!==t&&0===(t&t-1)},a.nextPowerOfTwo=function(t){return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t,t},a.clamp=function(t,e,r){return t<e?e:t>r?r:t};var i=new t;return a.setRandomNumberSeed=function(e){i=new t(e)},a.nextRandomNumber=function(){return i.random()},a.acosClamped=function(t){return Math.acos(a.clamp(t,-1,1))},a.asinClamped=function(t){return Math.asin(a.clamp(t,-1,1))},a.chordLength=function(t,e){return 2*e*Math.sin(.5*t)},a.logBase=function(t,e){return Math.log(t)/Math.log(e)},a.fog=function(t,e){var r=t*e;return 1-Math.exp(-(r*r))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,r,n,a,o){"use strict";function i(t,r,n){this.x=e(t,0),this.y=e(r,0),this.z=e(n,0)}i.fromSpherical=function(t,n){r(n)||(n=new i);var a=t.clock,o=t.cone,u=e(t.magnitude,1),s=u*Math.sin(o);return n.x=s*Math.cos(a),n.y=s*Math.sin(a),n.z=u*Math.cos(o),n},i.fromElements=function(t,e,n,a){return r(a)?(a.x=t,a.y=e,a.z=n,a):new i(t,e,n)},i.clone=function(t,e){if(r(t))return r(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e):new i(t.x,t.y,t.z)},i.fromCartesian4=i.clone,i.packedLength=3,i.pack=function(t,r,n){return n=e(n,0),r[n++]=t.x,r[n++]=t.y,r[n]=t.z,r},i.unpack=function(t,n,a){return n=e(n,0),r(a)||(a=new i),a.x=t[n++],a.y=t[n++],a.z=t[n],a},i.packArray=function(t,e){var n=t.length;r(e)?e.length=3*n:e=new Array(3*n);for(var a=0;a<n;++a)i.pack(t[a],e,3*a);return e},i.unpackArray=function(t,e){var n=t.length;r(e)?e.length=n/3:e=new Array(n/3);for(var a=0;a<n;a+=3){var o=a/3;e[o]=i.unpack(t,a,e[o])}return e},i.fromArray=i.unpack,i.maximumComponent=function(t){return Math.max(t.x,t.y,t.z)},i.minimumComponent=function(t){return Math.min(t.x,t.y,t.z)},i.minimumByComponent=function(t,e,r){return r.x=Math.min(t.x,e.x),r.y=Math.min(t.y,e.y),r.z=Math.min(t.z,e.z),r},i.maximumByComponent=function(t,e,r){return r.x=Math.max(t.x,e.x),r.y=Math.max(t.y,e.y),r.z=Math.max(t.z,e.z),r},i.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z},i.magnitude=function(t){return Math.sqrt(i.magnitudeSquared(t))};var u=new i;i.distance=function(t,e){return i.subtract(t,e,u),i.magnitude(u)},i.distanceSquared=function(t,e){return i.subtract(t,e,u),i.magnitudeSquared(u)},i.normalize=function(t,e){var r=i.magnitude(t);return e.x=t.x/r,e.y=t.y/r,e.z=t.z/r,e},i.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},i.multiplyComponents=function(t,e,r){return r.x=t.x*e.x,r.y=t.y*e.y,r.z=t.z*e.z,r},i.divideComponents=function(t,e,r){return r.x=t.x/e.x,r.y=t.y/e.y,r.z=t.z/e.z,r},i.add=function(t,e,r){return r.x=t.x+e.x,r.y=t.y+e.y,r.z=t.z+e.z,r},i.subtract=function(t,e,r){return r.x=t.x-e.x,r.y=t.y-e.y,r.z=t.z-e.z,r},i.multiplyByScalar=function(t,e,r){return r.x=t.x*e,r.y=t.y*e,r.z=t.z*e,r},i.divideByScalar=function(t,e,r){return r.x=t.x/e,r.y=t.y/e,r.z=t.z/e,r},i.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e},i.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e};var s=new i;i.lerp=function(t,e,r,n){return i.multiplyByScalar(e,r,s),n=i.multiplyByScalar(t,1-r,n),i.add(s,n,n)};var E=new i,c=new i;i.angleBetween=function(t,e){i.normalize(t,E),i.normalize(e,c);var r=i.dot(E,c),n=i.magnitude(i.cross(E,c,E));return Math.atan2(n,r)};var l=new i;i.mostOrthogonalAxis=function(t,e){var r=i.normalize(t,l);return i.abs(r,r),e=r.x<=r.y?r.x<=r.z?i.clone(i.UNIT_X,e):i.clone(i.UNIT_Z,e):r.y<=r.z?i.clone(i.UNIT_Y,e):i.clone(i.UNIT_Z,e)},i.equals=function(t,e){return t===e||r(t)&&r(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z},i.equalsArray=function(t,e,r){return t.x===e[r]&&t.y===e[r+1]&&t.z===e[r+2]},i.equalsEpsilon=function(t,e,n,a){return t===e||r(t)&&r(e)&&o.equalsEpsilon(t.x,e.x,n,a)&&o.equalsEpsilon(t.y,e.y,n,a)&&o.equalsEpsilon(t.z,e.z,n,a)},i.cross=function(t,e,r){var n=t.x,a=t.y,o=t.z,i=e.x,u=e.y,s=e.z,E=a*s-o*u,c=o*i-n*s,l=n*u-a*i;return r.x=E,r.y=c,r.z=l,r},i.fromDegrees=function(t,e,r,n,a){return t=o.toRadians(t),e=o.toRadians(e),i.fromRadians(t,e,r,n,a)};var f=new i,_=new i,R=new i(40680631590769,40680631590769,40408299984661.445);return i.fromRadians=function(t,n,a,o,u){a=e(a,0);var s=r(o)?o.radiiSquared:R,E=Math.cos(n);f.x=E*Math.cos(t),f.y=E*Math.sin(t),f.z=Math.sin(n),f=i.normalize(f,f),i.multiplyComponents(s,f,_);var c=Math.sqrt(i.dot(f,_));return _=i.divideByScalar(_,c,_),f=i.multiplyByScalar(f,a,f),r(u)||(u=new i),i.add(_,f,u)},i.fromDegreesArray=function(t,e,n){var a=t.length;r(n)?n.length=a/2:n=new Array(a/2);for(var o=0;o<a;o+=2){var u=t[o],s=t[o+1],E=o/2;n[E]=i.fromDegrees(u,s,0,e,n[E])}return n},i.fromRadiansArray=function(t,e,n){var a=t.length;r(n)?n.length=a/2:n=new Array(a/2);for(var o=0;o<a;o+=2){var u=t[o],s=t[o+1],E=o/2;n[E]=i.fromRadians(u,s,0,e,n[E])}return n},i.fromDegreesArrayHeights=function(t,e,n){var a=t.length;r(n)?n.length=a/3:n=new Array(a/3);for(var o=0;o<a;o+=3){var u=t[o],s=t[o+1],E=t[o+2],c=o/3;n[c]=i.fromDegrees(u,s,E,e,n[c])}return n},i.fromRadiansArrayHeights=function(t,e,n){var a=t.length;r(n)?n.length=a/3:n=new Array(a/3);for(var o=0;o<a;o+=3){var u=t[o],s=t[o+1],E=t[o+2],c=o/3;n[c]=i.fromRadians(u,s,E,e,n[c])}return n},i.ZERO=a(new i(0,0,0)),i.UNIT_X=a(new i(1,0,0)),i.UNIT_Y=a(new i(0,1,0)),i.UNIT_Z=a(new i(0,0,1)),i.prototype.clone=function(t){return i.clone(this,t)},i.prototype.equals=function(t){return i.equals(this,t)},i.prototype.equalsEpsilon=function(t,e,r){return i.equalsEpsilon(this,t,e,r)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},i}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(t,e,r,n){"use strict";function a(r,a,u,s,E){var c=r.x,l=r.y,f=r.z,_=a.x,R=a.y,h=a.z,T=c*c*_*_,A=l*l*R*R,d=f*f*h*h,S=T+A+d,m=Math.sqrt(1/S),N=t.multiplyByScalar(r,m,o);if(S<s)return isFinite(m)?t.clone(N,E):void 0;var C=u.x,I=u.y,p=u.z,M=i;M.x=N.x*C*2,M.y=N.y*I*2,M.z=N.z*p*2;var O,g,y,F,L,v,U,D,P,w,B,x=(1-m)*t.magnitude(r)/(.5*t.magnitude(M)),b=0;do{x-=b,y=1/(1+x*C),F=1/(1+x*I),L=1/(1+x*p),v=y*y,U=F*F,D=L*L,P=v*y,w=U*F,B=D*L,O=T*v+A*U+d*D-1,g=T*P*C+A*w*I+d*B*p;var G=-2*g;b=O/G}while(Math.abs(O)>n.EPSILON12);return e(E)?(E.x=c*y,E.y=l*F,E.z=f*L,E):new t(c*y,l*F,f*L)}var o=new t,i=new t;return a}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,r,n,a,o,i){"use strict";function u(t,r,n){this.longitude=e(t,0),this.latitude=e(r,0),this.height=e(n,0)}u.fromRadians=function(t,n,a,o){return a=e(a,0),r(o)?(o.longitude=t,o.latitude=n,o.height=a,o):new u(t,n,a)},u.fromDegrees=function(t,e,r,n){return t=o.toRadians(t),e=o.toRadians(e),u.fromRadians(t,e,r,n)};var s=new t,E=new t,c=new t,l=new t(1/6378137,1/6378137,1/6356752.314245179),f=new t(1/40680631590769,1/40680631590769,1/40408299984661.445),_=o.EPSILON1;return u.fromCartesian=function(e,n,a){var R=r(n)?n.oneOverRadii:l,h=r(n)?n.oneOverRadiiSquared:f,T=r(n)?n._centerToleranceSquared:_,A=i(e,R,h,T,E);if(r(A)){var d=t.multiplyComponents(A,h,s);d=t.normalize(d,d);var S=t.subtract(e,A,c),m=Math.atan2(d.y,d.x),N=Math.asin(d.z),C=o.sign(t.dot(S,e))*t.magnitude(S);return r(a)?(a.longitude=m,a.latitude=N,a.height=C,a):new u(m,N,C)}},u.clone=function(t,e){if(r(t))return r(e)?(e.longitude=t.longitude,e.latitude=t.latitude,e.height=t.height,e):new u(t.longitude,t.latitude,t.height)},u.equals=function(t,e){return t===e||r(t)&&r(e)&&t.longitude===e.longitude&&t.latitude===e.latitude&&t.height===e.height},u.equalsEpsilon=function(t,e,n){return t===e||r(t)&&r(e)&&Math.abs(t.longitude-e.longitude)<=n&&Math.abs(t.latitude-e.latitude)<=n&&Math.abs(t.height-e.height)<=n},u.ZERO=a(new u(0,0,0)),u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.prototype.equalsEpsilon=function(t,e){return u.equalsEpsilon(this,t,e)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(t){"use strict";var e=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(t){return!1}}(),r=Object.defineProperties;return e&&t(r)||(r=function(t){return t}),r}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,r,n,a,o,i,u,s){"use strict";function E(e,n,a,o){n=r(n,0),a=r(a,0),o=r(o,0),e._radii=new t(n,a,o),e._radiiSquared=new t(n*n,a*a,o*o),e._radiiToTheFourth=new t(n*n*n*n,a*a*a*a,o*o*o*o),e._oneOverRadii=new t(0===n?0:1/n,0===a?0:1/a,0===o?0:1/o),e._oneOverRadiiSquared=new t(0===n?0:1/(n*n),0===a?0:1/(a*a),0===o?0:1/(o*o)),e._minimumRadius=Math.min(n,a,o),e._maximumRadius=Math.max(n,a,o),e._centerToleranceSquared=u.EPSILON1,0!==e._radiiSquared.z&&(e._sqauredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function c(t,e,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,this._sqauredXOverSquaredZ=void 0,E(this,t,e,r)}a(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(e,r){if(n(e)){var a=e._radii;return n(r)?(t.clone(a,r._radii),t.clone(e._radiiSquared,r._radiiSquared),t.clone(e._radiiToTheFourth,r._radiiToTheFourth),t.clone(e._oneOverRadii,r._oneOverRadii),t.clone(e._oneOverRadiiSquared,r._oneOverRadiiSquared),r._minimumRadius=e._minimumRadius,r._maximumRadius=e._maximumRadius,r._centerToleranceSquared=e._centerToleranceSquared,r):new c(a.x,a.y,a.z)}},c.fromCartesian3=function(t,e){return n(e)||(e=new c),n(t)?(E(e,t.x,t.y,t.z),e):e},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(t){return c.clone(this,t)},c.packedLength=t.packedLength,c.pack=function(e,n,a){return a=r(a,0),t.pack(e._radii,n,a),n},c.unpack=function(e,n,a){n=r(n,0);var o=t.unpack(e,n);return c.fromCartesian3(o,a)},c.prototype.geocentricSurfaceNormal=t.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(e,r){var a=e.longitude,o=e.latitude,i=Math.cos(o),u=i*Math.cos(a),s=i*Math.sin(a),E=Math.sin(o);return n(r)||(r=new t),r.x=u,r.y=s,r.z=E,t.normalize(r,r)},c.prototype.geodeticSurfaceNormal=function(e,r){return n(r)||(r=new t),r=t.multiplyComponents(e,this._oneOverRadiiSquared,r),t.normalize(r,r)};var l=new t,f=new t;c.prototype.cartographicToCartesian=function(e,r){var a=l,o=f;this.geodeticSurfaceNormalCartographic(e,a),t.multiplyComponents(this._radiiSquared,a,o);var i=Math.sqrt(t.dot(a,o));return t.divideByScalar(o,i,o),t.multiplyByScalar(a,e.height,a),n(r)||(r=new t),t.add(o,a,r)},c.prototype.cartographicArrayToCartesianArray=function(t,e){var r=t.length;n(e)?e.length=r:e=new Array(r);for(var a=0;a<r;a++)e[a]=this.cartographicToCartesian(t[a],e[a]);return e};var _=new t,R=new t,h=new t;return c.prototype.cartesianToCartographic=function(r,a){var o=this.scaleToGeodeticSurface(r,R);if(n(o)){var i=this.geodeticSurfaceNormal(o,_),s=t.subtract(r,o,h),E=Math.atan2(i.y,i.x),c=Math.asin(i.z),l=u.sign(t.dot(s,r))*t.magnitude(s);return n(a)?(a.longitude=E,a.latitude=c,a.height=l,a):new e(E,c,l)}},c.prototype.cartesianArrayToCartographicArray=function(t,e){var r=t.length;n(e)?e.length=r:e=new Array(r);for(var a=0;a<r;++a)e[a]=this.cartesianToCartographic(t[a],e[a]);return e},c.prototype.scaleToGeodeticSurface=function(t,e){return s(t,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,e)},c.prototype.scaleToGeocentricSurface=function(e,r){n(r)||(r=new t);var a=e.x,o=e.y,i=e.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+o*o*u.y+i*i*u.z);return t.multiplyByScalar(e,s,r)},c.prototype.transformPositionToScaledSpace=function(e,r){return n(r)||(r=new t),t.multiplyComponents(e,this._oneOverRadii,r)},c.prototype.transformPositionFromScaledSpace=function(e,r){return n(r)||(r=new t),t.multiplyComponents(e,this._radii,r)},c.prototype.equals=function(e){return this===e||n(e)&&t.equals(this._radii,e._radii)},c.prototype.toString=function(){return this._radii.toString()},c.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,a,o){a=r(a,0);var i=this._sqauredXOverSquaredZ;if(n(o)||(o=new t),o.x=0,o.y=0,o.z=e.z*(1-i),!(Math.abs(o.z)>=this._radii.z-a))return o},c}),define("Core/arrayRemoveDuplicates",["./defaultValue","./defined","./DeveloperError","./Math"],function(t,e,r,n){"use strict";function a(r,n,a){if(e(r)){a=t(a,!1);var i=r.length;if(i<2)return r;var u,s,E;for(u=1;u<i&&(s=r[u-1],E=r[u],!n(s,E,o));++u);if(u===i)return a&&n(r[0],r[r.length-1],o)?r.slice(1):r;for(var c=r.slice(0,u);u<i;++u)E=r[u],n(s,E,o)||(c.push(E),s=E);return a&&c.length>1&&n(c[0],c[c.length-1],o)&&c.shift(),c}}var o=n.EPSILON10;return a}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(t,e,r,n,a,o,i){"use strict";function u(t){this._ellipsoid=r(t,i.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(e,r){var a=this._semimajorAxis,o=e.longitude*a,i=e.latitude*a,u=e.height;return n(r)?(r.x=o,r.y=i,r.z=u,r):new t(o,i,u)},u.prototype.unproject=function(t,r){var a=this._oneOverSemimajorAxis,o=t.x*a,i=t.y*a,u=t.z;return n(r)?(r.longitude=o,r.latitude=i,r.height=u,r):new e(o,i,u)},u}),define("Core/Intersect",["./freezeObject"],function(t){"use strict";var e={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return t(e)}),define("Core/Interval",["./defaultValue"],function(t){"use strict";function e(e,r){this.start=t(e,0),this.stop=t(r,0)}return e}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(t,e,r,n,a,o,i,u){"use strict";function s(t,e,n,a,o,i,u,s,E){this[0]=r(t,0),this[1]=r(a,0),this[2]=r(u,0),this[3]=r(e,0),this[4]=r(o,0),this[5]=r(s,0),this[6]=r(n,0),this[7]=r(i,0),this[8]=r(E,0)}function E(t){for(var e=0,r=0;r<9;++r){var n=t[r];e+=n*n}return Math.sqrt(e)}function c(t){for(var e=0,r=0;r<3;++r){var n=t[s.getElementIndex(h[r],R[r])];e+=2*n*n}return Math.sqrt(e)}function l(t,e){for(var r=u.EPSILON15,n=0,a=1,o=0;o<3;++o){var i=Math.abs(t[s.getElementIndex(h[o],R[o])]);i>n&&(a=o,n=i)}var E=1,c=0,l=R[a],f=h[a];if(Math.abs(t[s.getElementIndex(f,l)])>r){var _,T=t[s.getElementIndex(f,f)],A=t[s.getElementIndex(l,l)],d=t[s.getElementIndex(f,l)],S=(T-A)/2/d;_=S<0?-1/(-S+Math.sqrt(1+S*S)):1/(S+Math.sqrt(1+S*S)),E=1/Math.sqrt(1+_*_),c=_*E}return e=s.clone(s.IDENTITY,e),e[s.getElementIndex(l,l)]=e[s.getElementIndex(f,f)]=E,e[s.getElementIndex(f,l)]=c,e[s.getElementIndex(l,f)]=-c,e}s.packedLength=9,s.pack=function(t,e,n){return n=r(n,0),e[n++]=t[0],e[n++]=t[1],e[n++]=t[2],e[n++]=t[3],e[n++]=t[4],e[n++]=t[5],e[n++]=t[6],e[n++]=t[7],e[n++]=t[8],e},s.unpack=function(t,e,a){return e=r(e,0),n(a)||(a=new s),a[0]=t[e++],a[1]=t[e++],a[2]=t[e++],a[3]=t[e++],a[4]=t[e++],a[5]=t[e++],a[6]=t[e++],a[7]=t[e++],a[8]=t[e++],a},s.clone=function(t,e){if(n(t))return n(e)?(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):new s(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8])},s.fromArray=function(t,e,a){return e=r(e,0),n(a)||(a=new s),a[0]=t[e],a[1]=t[e+1],a[2]=t[e+2],a[3]=t[e+3],a[4]=t[e+4],a[5]=t[e+5],a[6]=t[e+6],a[7]=t[e+7],a[8]=t[e+8],a},s.fromColumnMajorArray=function(t,e){return s.clone(t,e)},s.fromRowMajorArray=function(t,e){return n(e)?(e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],e):new s(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},s.fromQuaternion=function(t,e){var r=t.x*t.x,a=t.x*t.y,o=t.x*t.z,i=t.x*t.w,u=t.y*t.y,E=t.y*t.z,c=t.y*t.w,l=t.z*t.z,f=t.z*t.w,_=t.w*t.w,R=r-u-l+_,h=2*(a-f),T=2*(o+c),A=2*(a+f),d=-r+u-l+_,S=2*(E-i),m=2*(o-c),N=2*(E+i),C=-r-u+l+_;return n(e)?(e[0]=R,e[1]=A,e[2]=m,e[3]=h,e[4]=d,e[5]=N,e[6]=T,e[7]=S,e[8]=C,e):new s(R,h,T,A,d,S,m,N,C)},s.fromHeadingPitchRoll=function(t,e){var r=Math.cos(-t.pitch),a=Math.cos(-t.heading),o=Math.cos(t.roll),i=Math.sin(-t.pitch),u=Math.sin(-t.heading),E=Math.sin(t.roll),c=r*a,l=-o*u+E*i*a,f=E*u+o*i*a,_=r*u,R=o*a+E*i*u,h=-i*o+o*i*u,T=-i,A=E*r,d=o*r;return n(e)?(e[0]=c,e[1]=_,e[2]=T,e[3]=l,e[4]=R,e[5]=A,e[6]=f,e[7]=h,e[8]=d,e):new s(c,l,f,_,R,h,T,A,d)},s.fromScale=function(t,e){return n(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=t.y,e[5]=0,e[6]=0,e[7]=0,e[8]=t.z,e):new s(t.x,0,0,0,t.y,0,0,0,t.z)},s.fromUniformScale=function(t,e){return n(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=t,e[5]=0,e[6]=0,e[7]=0,e[8]=t,e):new s(t,0,0,0,t,0,0,0,t)},s.fromCrossProduct=function(t,e){return n(e)?(e[0]=0,e[1]=t.z,e[2]=-t.y,e[3]=-t.z,e[4]=0,e[5]=t.x,e[6]=t.y,e[7]=-t.x,e[8]=0,e):new s(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},s.fromRotationX=function(t,e){var r=Math.cos(t),a=Math.sin(t);return n(e)?(e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=r,e[5]=a,e[6]=0,e[7]=-a,e[8]=r,e):new s(1,0,0,0,r,-a,0,a,r)},s.fromRotationY=function(t,e){var r=Math.cos(t),a=Math.sin(t);return n(e)?(e[0]=r,e[1]=0,e[2]=-a,e[3]=0,e[4]=1,e[5]=0,e[6]=a,e[7]=0,e[8]=r,e):new s(r,0,a,0,1,0,-a,0,r)},s.fromRotationZ=function(t,e){var r=Math.cos(t),a=Math.sin(t);return n(e)?(e[0]=r,e[1]=a,e[2]=0,e[3]=-a,e[4]=r,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e):new s(r,-a,0,a,r,0,0,0,1)},s.toArray=function(t,e){return n(e)?(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):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},s.getElementIndex=function(t,e){return 3*t+e},s.getColumn=function(t,e,r){var n=3*e,a=t[n],o=t[n+1],i=t[n+2];return r.x=a,r.y=o,r.z=i,r},s.setColumn=function(t,e,r,n){n=s.clone(t,n);var a=3*e;return n[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n},s.getRow=function(t,e,r){var n=t[e],a=t[e+3],o=t[e+6];return r.x=n,r.y=a,r.z=o,r},s.setRow=function(t,e,r,n){return n=s.clone(t,n),n[e]=r.x,n[e+3]=r.y,n[e+6]=r.z,n};var f=new t;s.getScale=function(e,r){return r.x=t.magnitude(t.fromElements(e[0],e[1],e[2],f)),r.y=t.magnitude(t.fromElements(e[3],e[4],e[5],f)),r.z=t.magnitude(t.fromElements(e[6],e[7],e[8],f)),r};var _=new t;s.getMaximumScale=function(e){return s.getScale(e,_),t.maximumComponent(_)},s.multiply=function(t,e,r){var n=t[0]*e[0]+t[3]*e[1]+t[6]*e[2],a=t[1]*e[0]+t[4]*e[1]+t[7]*e[2],o=t[2]*e[0]+t[5]*e[1]+t[8]*e[2],i=t[0]*e[3]+t[3]*e[4]+t[6]*e[5],u=t[1]*e[3]+t[4]*e[4]+t[7]*e[5],s=t[2]*e[3]+t[5]*e[4]+t[8]*e[5],E=t[0]*e[6]+t[3]*e[7]+t[6]*e[8],c=t[1]*e[6]+t[4]*e[7]+t[7]*e[8],l=t[2]*e[6]+t[5]*e[7]+t[8]*e[8];return r[0]=n,r[1]=a,r[2]=o,r[3]=i,r[4]=u,r[5]=s,r[6]=E,r[7]=c,r[8]=l,r},s.add=function(t,e,r){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r[2]=t[2]+e[2],r[3]=t[3]+e[3],r[4]=t[4]+e[4],r[5]=t[5]+e[5],r[6]=t[6]+e[6],r[7]=t[7]+e[7],r[8]=t[8]+e[8],r},s.subtract=function(t,e,r){return r[0]=t[0]-e[0],r[1]=t[1]-e[1],r[2]=t[2]-e[2],r[3]=t[3]-e[3],r[4]=t[4]-e[4],r[5]=t[5]-e[5],r[6]=t[6]-e[6],r[7]=t[7]-e[7],r[8]=t[8]-e[8],r},s.multiplyByVector=function(t,e,r){var n=e.x,a=e.y,o=e.z,i=t[0]*n+t[3]*a+t[6]*o,u=t[1]*n+t[4]*a+t[7]*o,s=t[2]*n+t[5]*a+t[8]*o;return r.x=i,r.y=u,r.z=s,r},s.multiplyByScalar=function(t,e,r){return r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e,r[3]=t[3]*e,r[4]=t[4]*e,r[5]=t[5]*e,r[6]=t[6]*e,r[7]=t[7]*e,r[8]=t[8]*e,r},s.multiplyByScale=function(t,e,r){return r[0]=t[0]*e.x,r[1]=t[1]*e.x,r[2]=t[2]*e.x,r[3]=t[3]*e.y,r[4]=t[4]*e.y,r[5]=t[5]*e.y,r[6]=t[6]*e.z,r[7]=t[7]*e.z,r[8]=t[8]*e.z,r},s.negate=function(t,e){return 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},s.transpose=function(t,e){var r=t[0],n=t[3],a=t[6],o=t[1],i=t[4],u=t[7],s=t[2],E=t[5],c=t[8];return e[0]=r,e[1]=n,e[2]=a,e[3]=o,e[4]=i,e[5]=u,e[6]=s,e[7]=E,e[8]=c,e};var R=[1,0,0],h=[2,2,1],T=new s,A=new s;return s.computeEigenDecomposition=function(t,e){var r=u.EPSILON20,a=10,o=0,i=0;n(e)||(e={});for(var f=e.unitary=s.clone(s.IDENTITY,e.unitary),_=e.diagonal=s.clone(t,e.diagonal),R=r*E(_);i<a&&c(_)>R;)l(_,T),s.transpose(T,A),s.multiply(_,T,_),s.multiply(A,_,_),s.multiply(f,T,f),++o>2&&(++i,o=0);return e},s.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e},s.determinant=function(t){var e=t[0],r=t[3],n=t[6],a=t[1],o=t[4],i=t[7],u=t[2],s=t[5],E=t[8];return e*(o*E-s*i)+a*(s*n-r*E)+u*(r*i-o*n)},s.inverse=function(t,e){var r=t[0],n=t[1],a=t[2],o=t[3],i=t[4],u=t[5],E=t[6],c=t[7],l=t[8],f=s.determinant(t);e[0]=i*l-c*u,e[1]=c*a-n*l,e[2]=n*u-i*a,e[3]=E*u-o*l,e[4]=r*l-E*a,e[5]=o*a-r*u,e[6]=o*c-E*i,e[7]=E*n-r*c,e[8]=r*i-o*n;var _=1/f;return s.multiplyByScalar(e,_,e)},s.equals=function(t,e){return t===e||n(t)&&n(e)&&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]},s.equalsEpsilon=function(t,e,r){return t===e||n(t)&&n(e)&&Math.abs(t[0]-e[0])<=r&&Math.abs(t[1]-e[1])<=r&&Math.abs(t[2]-e[2])<=r&&Math.abs(t[3]-e[3])<=r&&Math.abs(t[4]-e[4])<=r&&Math.abs(t[5]-e[5])<=r&&Math.abs(t[6]-e[6])<=r&&Math.abs(t[7]-e[7])<=r&&Math.abs(t[8]-e[8])<=r},s.IDENTITY=i(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=i(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,a(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(t){return s.clone(this,t)},s.prototype.equals=function(t){return s.equals(this,t)},s.equalsArray=function(t,e,r){return t[0]===e[r]&&t[1]===e[r+1]&&t[2]===e[r+2]&&t[3]===e[r+3]&&t[4]===e[r+4]&&t[5]===e[r+5]&&t[6]===e[r+6]&&t[7]===e[r+7]&&t[8]===e[r+8]},s.prototype.equalsEpsilon=function(t,e){return s.equalsEpsilon(this,t,e)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,r,n,a,o){"use strict";function i(t,r,n,a){this.x=e(t,0),this.y=e(r,0),this.z=e(n,0),this.w=e(a,0)}i.fromElements=function(t,e,n,a,o){return r(o)?(o.x=t,o.y=e,o.z=n,o.w=a,o):new i(t,e,n,a)},i.fromColor=function(t,e){return r(e)?(e.x=t.red,e.y=t.green,e.z=t.blue,e.w=t.alpha,e):new i(t.red,t.green,t.blue,t.alpha)},i.clone=function(t,e){if(r(t))return r(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e):new i(t.x,t.y,t.z,t.w)},i.packedLength=4,i.pack=function(t,r,n){return n=e(n,0),r[n++]=t.x,r[n++]=t.y,r[n++]=t.z,r[n]=t.w,r},i.unpack=function(t,n,a){return n=e(n,0),r(a)||(a=new i),a.x=t[n++],a.y=t[n++],a.z=t[n++],a.w=t[n],a},i.packArray=function(t,e){var n=t.length;r(e)?e.length=4*n:e=new Array(4*n);for(var a=0;a<n;++a)i.pack(t[a],e,4*a);return e},i.unpackArray=function(t,e){var n=t.length;r(e)?e.length=n/4:e=new Array(n/4);for(var a=0;a<n;a+=4){var o=a/4;e[o]=i.unpack(t,a,e[o])}return e},i.fromArray=i.unpack,i.maximumComponent=function(t){return Math.max(t.x,t.y,t.z,t.w)},i.minimumComponent=function(t){return Math.min(t.x,t.y,t.z,t.w)},i.minimumByComponent=function(t,e,r){return r.x=Math.min(t.x,e.x),r.y=Math.min(t.y,e.y),r.z=Math.min(t.z,e.z),r.w=Math.min(t.w,e.w),r},i.maximumByComponent=function(t,e,r){return r.x=Math.max(t.x,e.x),r.y=Math.max(t.y,e.y),r.z=Math.max(t.z,e.z),r.w=Math.max(t.w,e.w),r},i.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w},i.magnitude=function(t){return Math.sqrt(i.magnitudeSquared(t))};var u=new i;i.distance=function(t,e){return i.subtract(t,e,u),i.magnitude(u)},i.distanceSquared=function(t,e){return i.subtract(t,e,u),i.magnitudeSquared(u)},i.normalize=function(t,e){var r=i.magnitude(t);return e.x=t.x/r,e.y=t.y/r,e.z=t.z/r,e.w=t.w/r,e},i.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z+t.w*e.w},i.multiplyComponents=function(t,e,r){return r.x=t.x*e.x,r.y=t.y*e.y,r.z=t.z*e.z,r.w=t.w*e.w,r},i.divideComponents=function(t,e,r){return r.x=t.x/e.x,r.y=t.y/e.y,r.z=t.z/e.z,r.w=t.w/e.w,r},i.add=function(t,e,r){return r.x=t.x+e.x,r.y=t.y+e.y,r.z=t.z+e.z,r.w=t.w+e.w,r},i.subtract=function(t,e,r){return r.x=t.x-e.x,r.y=t.y-e.y,r.z=t.z-e.z,r.w=t.w-e.w,r},i.multiplyByScalar=function(t,e,r){return r.x=t.x*e,r.y=t.y*e,r.z=t.z*e,r.w=t.w*e,r},i.divideByScalar=function(t,e,r){return r.x=t.x/e,r.y=t.y/e,r.z=t.z/e,r.w=t.w/e,r},i.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e.w=-t.w,e},i.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e.w=Math.abs(t.w),e};var s=new i;i.lerp=function(t,e,r,n){return i.multiplyByScalar(e,r,s),n=i.multiplyByScalar(t,1-r,n),i.add(s,n,n)};var E=new i;return i.mostOrthogonalAxis=function(t,e){var r=i.normalize(t,E);return i.abs(r,r),e=r.x<=r.y?r.x<=r.z?r.x<=r.w?i.clone(i.UNIT_X,e):i.clone(i.UNIT_W,e):r.z<=r.w?i.clone(i.UNIT_Z,e):i.clone(i.UNIT_W,e):r.y<=r.z?r.y<=r.w?i.clone(i.UNIT_Y,e):i.clone(i.UNIT_W,e):r.z<=r.w?i.clone(i.UNIT_Z,e):i.clone(i.UNIT_W,e)},i.equals=function(t,e){return t===e||r(t)&&r(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z&&t.w===e.w},i.equalsArray=function(t,e,r){return t.x===e[r]&&t.y===e[r+1]&&t.z===e[r+2]&&t.w===e[r+3]},i.equalsEpsilon=function(t,e,n,a){return t===e||r(t)&&r(e)&&o.equalsEpsilon(t.x,e.x,n,a)&&o.equalsEpsilon(t.y,e.y,n,a)&&o.equalsEpsilon(t.z,e.z,n,a)&&o.equalsEpsilon(t.w,e.w,n,a)},i.ZERO=a(new i(0,0,0,0)),i.UNIT_X=a(new i(1,0,0,0)),i.UNIT_Y=a(new i(0,1,0,0)),i.UNIT_Z=a(new i(0,0,1,0)),i.UNIT_W=a(new i(0,0,0,1)),i.prototype.clone=function(t){return i.clone(this,t)},i.prototype.equals=function(t){return i.equals(this,t)},i.prototype.equalsEpsilon=function(t,e,r){return i.equalsEpsilon(this,t,e,r)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},i}),define("Core/RuntimeError",["./defined"],function(t){"use strict";function e(t){ +this.name="RuntimeError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(t,e,r,n,a,o,i,u,s,E,c){"use strict";function l(t,e,r,a,o,i,u,s,E,c,l,f,_,R,h,T){this[0]=n(t,0),this[1]=n(o,0),this[2]=n(E,0),this[3]=n(_,0),this[4]=n(e,0),this[5]=n(i,0),this[6]=n(c,0),this[7]=n(R,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(l,0),this[11]=n(h,0),this[12]=n(a,0),this[13]=n(s,0),this[14]=n(f,0),this[15]=n(T,0)}l.packedLength=16,l.pack=function(t,e,r){return r=n(r,0),e[r++]=t[0],e[r++]=t[1],e[r++]=t[2],e[r++]=t[3],e[r++]=t[4],e[r++]=t[5],e[r++]=t[6],e[r++]=t[7],e[r++]=t[8],e[r++]=t[9],e[r++]=t[10],e[r++]=t[11],e[r++]=t[12],e[r++]=t[13],e[r++]=t[14],e[r]=t[15],e},l.unpack=function(t,e,r){return e=n(e,0),a(r)||(r=new l),r[0]=t[e++],r[1]=t[e++],r[2]=t[e++],r[3]=t[e++],r[4]=t[e++],r[5]=t[e++],r[6]=t[e++],r[7]=t[e++],r[8]=t[e++],r[9]=t[e++],r[10]=t[e++],r[11]=t[e++],r[12]=t[e++],r[13]=t[e++],r[14]=t[e++],r[15]=t[e],r},l.clone=function(t,e){if(a(t))return a(e)?(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],e):new l(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15])},l.fromArray=l.unpack,l.fromColumnMajorArray=function(t,e){return l.clone(t,e)},l.fromRowMajorArray=function(t,e){return a(e)?(e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15],e):new l(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},l.fromRotationTranslation=function(e,r,o){return r=n(r,t.ZERO),a(o)?(o[0]=e[0],o[1]=e[1],o[2]=e[2],o[3]=0,o[4]=e[3],o[5]=e[4],o[6]=e[5],o[7]=0,o[8]=e[6],o[9]=e[7],o[10]=e[8],o[11]=0,o[12]=r.x,o[13]=r.y,o[14]=r.z,o[15]=1,o):new l(e[0],e[3],e[6],r.x,e[1],e[4],e[7],r.y,e[2],e[5],e[8],r.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(t,e,r,n){a(n)||(n=new l);var o=r.x,i=r.y,u=r.z,s=e.x*e.x,E=e.x*e.y,c=e.x*e.z,f=e.x*e.w,_=e.y*e.y,R=e.y*e.z,h=e.y*e.w,T=e.z*e.z,A=e.z*e.w,d=e.w*e.w,S=s-_-T+d,m=2*(E-A),N=2*(c+h),C=2*(E+A),I=-s+_-T+d,p=2*(R-f),M=2*(c-h),O=2*(R+f),g=-s-_+T+d;return n[0]=S*o,n[1]=C*o,n[2]=M*o,n[3]=0,n[4]=m*i,n[5]=I*i,n[6]=O*i,n[7]=0,n[8]=N*u,n[9]=p*u,n[10]=g*u,n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,n},l.fromTranslationRotationScale=function(t,e){return l.fromTranslationQuaternionRotationScale(t.translation,t.rotation,t.scale,e)},l.fromTranslation=function(t,e){return l.fromRotationTranslation(E.IDENTITY,t,e)},l.fromScale=function(t,e){return a(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t.y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t.z,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new l(t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1)},l.fromUniformScale=function(t,e){return a(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new l(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1)};var f=new t,_=new t,R=new t;l.fromCamera=function(e,r){var n=e.position,o=e.direction,i=e.up;t.normalize(o,f),t.normalize(t.cross(f,i,_),_),t.normalize(t.cross(_,f,R),R);var u=_.x,s=_.y,E=_.z,c=f.x,h=f.y,T=f.z,A=R.x,d=R.y,S=R.z,m=n.x,N=n.y,C=n.z,I=u*-m+s*-N+E*-C,p=A*-m+d*-N+S*-C,M=c*m+h*N+T*C;return a(r)?(r[0]=u,r[1]=A,r[2]=-c,r[3]=0,r[4]=s,r[5]=d,r[6]=-h,r[7]=0,r[8]=E,r[9]=S,r[10]=-T,r[11]=0,r[12]=I,r[13]=p,r[14]=M,r[15]=1,r):new l(u,s,E,I,A,d,S,p,-c,-h,-T,M,0,0,0,1)},l.computePerspectiveFieldOfView=function(t,e,r,n,a){var o=Math.tan(.5*t),i=1/o,u=i/e,s=(n+r)/(r-n),E=2*n*r/(r-n);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=i,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=E,a[15]=0,a},l.computeOrthographicOffCenter=function(t,e,r,n,a,o,i){var u=1/(e-t),s=1/(n-r),E=1/(o-a),c=-(e+t)*u,l=-(n+r)*s,f=-(o+a)*E;return u*=2,s*=2,E*=-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]=E,i[11]=0,i[12]=c,i[13]=l,i[14]=f,i[15]=1,i},l.computePerspectiveOffCenter=function(t,e,r,n,a,o,i){var u=2*a/(e-t),s=2*a/(n-r),E=(e+t)/(e-t),c=(n+r)/(n-r),l=-(o+a)/(o-a),f=-1,_=-2*o*a/(o-a);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]=E,i[9]=c,i[10]=l,i[11]=f,i[12]=0,i[13]=0,i[14]=_,i[15]=0,i},l.computeInfinitePerspectiveOffCenter=function(t,e,r,n,a,o){var i=2*a/(e-t),u=2*a/(n-r),s=(e+t)/(e-t),E=(n+r)/(n-r),c=-1,l=-1,f=-2*a;return o[0]=i,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=u,o[6]=0,o[7]=0,o[8]=s,o[9]=E,o[10]=c,o[11]=l,o[12]=0,o[13]=0,o[14]=f,o[15]=0,o},l.computeViewportTransformation=function(t,e,r,a){t=n(t,n.EMPTY_OBJECT);var o=n(t.x,0),i=n(t.y,0),u=n(t.width,0),s=n(t.height,0);e=n(e,0),r=n(r,1);var E=.5*u,c=.5*s,l=.5*(r-e),f=E,_=c,R=l,h=o+E,T=i+c,A=e+l,d=1;return a[0]=f,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=_,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=R,a[11]=0,a[12]=h,a[13]=T,a[14]=A,a[15]=d,a},l.computeView=function(e,r,n,a,o){return o[0]=a.x,o[1]=n.x,o[2]=-r.x,o[3]=0,o[4]=a.y,o[5]=n.y,o[6]=-r.y,o[7]=0,o[8]=a.z,o[9]=n.z,o[10]=-r.z,o[11]=0,o[12]=-t.dot(a,e),o[13]=-t.dot(n,e),o[14]=t.dot(r,e),o[15]=1,o},l.toArray=function(t,e){return a(e)?(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],e):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]},l.getElementIndex=function(t,e){return 4*t+e},l.getColumn=function(t,e,r){var n=4*e,a=t[n],o=t[n+1],i=t[n+2],u=t[n+3];return r.x=a,r.y=o,r.z=i,r.w=u,r},l.setColumn=function(t,e,r,n){n=l.clone(t,n);var a=4*e;return n[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n[a+3]=r.w,n},l.setTranslation=function(t,e,r){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[8]=t[8],r[9]=t[9],r[10]=t[10],r[11]=t[11],r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=t[15],r},l.getRow=function(t,e,r){var n=t[e],a=t[e+4],o=t[e+8],i=t[e+12];return r.x=n,r.y=a,r.z=o,r.w=i,r},l.setRow=function(t,e,r,n){return n=l.clone(t,n),n[e]=r.x,n[e+4]=r.y,n[e+8]=r.z,n[e+12]=r.w,n};var h=new t;l.getScale=function(e,r){return r.x=t.magnitude(t.fromElements(e[0],e[1],e[2],h)),r.y=t.magnitude(t.fromElements(e[4],e[5],e[6],h)),r.z=t.magnitude(t.fromElements(e[8],e[9],e[10],h)),r};var T=new t;l.getMaximumScale=function(e){return l.getScale(e,T),t.maximumComponent(T)},l.multiply=function(t,e,r){var n=t[0],a=t[1],o=t[2],i=t[3],u=t[4],s=t[5],E=t[6],c=t[7],l=t[8],f=t[9],_=t[10],R=t[11],h=t[12],T=t[13],A=t[14],d=t[15],S=e[0],m=e[1],N=e[2],C=e[3],I=e[4],p=e[5],M=e[6],O=e[7],g=e[8],y=e[9],F=e[10],L=e[11],v=e[12],U=e[13],D=e[14],P=e[15],w=n*S+u*m+l*N+h*C,B=a*S+s*m+f*N+T*C,x=o*S+E*m+_*N+A*C,b=i*S+c*m+R*N+d*C,G=n*I+u*p+l*M+h*O,z=a*I+s*p+f*M+T*O,H=o*I+E*p+_*M+A*O,V=i*I+c*p+R*M+d*O,q=n*g+u*y+l*F+h*L,X=a*g+s*y+f*F+T*L,W=o*g+E*y+_*F+A*L,Y=i*g+c*y+R*F+d*L,K=n*v+u*U+l*D+h*P,k=a*v+s*U+f*D+T*P,Z=o*v+E*U+_*D+A*P,j=i*v+c*U+R*D+d*P;return r[0]=w,r[1]=B,r[2]=x,r[3]=b,r[4]=G,r[5]=z,r[6]=H,r[7]=V,r[8]=q,r[9]=X,r[10]=W,r[11]=Y,r[12]=K,r[13]=k,r[14]=Z,r[15]=j,r},l.add=function(t,e,r){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r[2]=t[2]+e[2],r[3]=t[3]+e[3],r[4]=t[4]+e[4],r[5]=t[5]+e[5],r[6]=t[6]+e[6],r[7]=t[7]+e[7],r[8]=t[8]+e[8],r[9]=t[9]+e[9],r[10]=t[10]+e[10],r[11]=t[11]+e[11],r[12]=t[12]+e[12],r[13]=t[13]+e[13],r[14]=t[14]+e[14],r[15]=t[15]+e[15],r},l.subtract=function(t,e,r){return r[0]=t[0]-e[0],r[1]=t[1]-e[1],r[2]=t[2]-e[2],r[3]=t[3]-e[3],r[4]=t[4]-e[4],r[5]=t[5]-e[5],r[6]=t[6]-e[6],r[7]=t[7]-e[7],r[8]=t[8]-e[8],r[9]=t[9]-e[9],r[10]=t[10]-e[10],r[11]=t[11]-e[11],r[12]=t[12]-e[12],r[13]=t[13]-e[13],r[14]=t[14]-e[14],r[15]=t[15]-e[15],r},l.multiplyTransformation=function(t,e,r){var n=t[0],a=t[1],o=t[2],i=t[4],u=t[5],s=t[6],E=t[8],c=t[9],l=t[10],f=t[12],_=t[13],R=t[14],h=e[0],T=e[1],A=e[2],d=e[4],S=e[5],m=e[6],N=e[8],C=e[9],I=e[10],p=e[12],M=e[13],O=e[14],g=n*h+i*T+E*A,y=a*h+u*T+c*A,F=o*h+s*T+l*A,L=n*d+i*S+E*m,v=a*d+u*S+c*m,U=o*d+s*S+l*m,D=n*N+i*C+E*I,P=a*N+u*C+c*I,w=o*N+s*C+l*I,B=n*p+i*M+E*O+f,x=a*p+u*M+c*O+_,b=o*p+s*M+l*O+R;return r[0]=g,r[1]=y,r[2]=F,r[3]=0,r[4]=L,r[5]=v,r[6]=U,r[7]=0,r[8]=D,r[9]=P,r[10]=w,r[11]=0,r[12]=B,r[13]=x,r[14]=b,r[15]=1,r},l.multiplyByMatrix3=function(t,e,r){var n=t[0],a=t[1],o=t[2],i=t[4],u=t[5],s=t[6],E=t[8],c=t[9],l=t[10],f=e[0],_=e[1],R=e[2],h=e[3],T=e[4],A=e[5],d=e[6],S=e[7],m=e[8],N=n*f+i*_+E*R,C=a*f+u*_+c*R,I=o*f+s*_+l*R,p=n*h+i*T+E*A,M=a*h+u*T+c*A,O=o*h+s*T+l*A,g=n*d+i*S+E*m,y=a*d+u*S+c*m,F=o*d+s*S+l*m;return r[0]=N,r[1]=C,r[2]=I,r[3]=0,r[4]=p,r[5]=M,r[6]=O,r[7]=0,r[8]=g,r[9]=y,r[10]=F,r[11]=0,r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15],r},l.multiplyByTranslation=function(t,e,r){var n=e.x,a=e.y,o=e.z,i=n*t[0]+a*t[4]+o*t[8]+t[12],u=n*t[1]+a*t[5]+o*t[9]+t[13],s=n*t[2]+a*t[6]+o*t[10]+t[14];return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[8]=t[8],r[9]=t[9],r[10]=t[10],r[11]=t[11],r[12]=i,r[13]=u,r[14]=s,r[15]=t[15],r};var A=new t;l.multiplyByUniformScale=function(t,e,r){return A.x=e,A.y=e,A.z=e,l.multiplyByScale(t,A,r)},l.multiplyByScale=function(t,e,r){var n=e.x,a=e.y,o=e.z;return 1===n&&1===a&&1===o?l.clone(t,r):(r[0]=n*t[0],r[1]=n*t[1],r[2]=n*t[2],r[3]=0,r[4]=a*t[4],r[5]=a*t[5],r[6]=a*t[6],r[7]=0,r[8]=o*t[8],r[9]=o*t[9],r[10]=o*t[10],r[11]=0,r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=1,r)},l.multiplyByVector=function(t,e,r){var n=e.x,a=e.y,o=e.z,i=e.w,u=t[0]*n+t[4]*a+t[8]*o+t[12]*i,s=t[1]*n+t[5]*a+t[9]*o+t[13]*i,E=t[2]*n+t[6]*a+t[10]*o+t[14]*i,c=t[3]*n+t[7]*a+t[11]*o+t[15]*i;return r.x=u,r.y=s,r.z=E,r.w=c,r},l.multiplyByPointAsVector=function(t,e,r){var n=e.x,a=e.y,o=e.z,i=t[0]*n+t[4]*a+t[8]*o,u=t[1]*n+t[5]*a+t[9]*o,s=t[2]*n+t[6]*a+t[10]*o;return r.x=i,r.y=u,r.z=s,r},l.multiplyByPoint=function(t,e,r){var n=e.x,a=e.y,o=e.z,i=t[0]*n+t[4]*a+t[8]*o+t[12],u=t[1]*n+t[5]*a+t[9]*o+t[13],s=t[2]*n+t[6]*a+t[10]*o+t[14];return r.x=i,r.y=u,r.z=s,r},l.multiplyByScalar=function(t,e,r){return r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e,r[3]=t[3]*e,r[4]=t[4]*e,r[5]=t[5]*e,r[6]=t[6]*e,r[7]=t[7]*e,r[8]=t[8]*e,r[9]=t[9]*e,r[10]=t[10]*e,r[11]=t[11]*e,r[12]=t[12]*e,r[13]=t[13]*e,r[14]=t[14]*e,r[15]=t[15]*e,r},l.negate=function(t,e){return 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],e},l.transpose=function(t,e){var r=t[1],n=t[2],a=t[3],o=t[6],i=t[7],u=t[11];return e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=o,e[10]=t[10],e[11]=t[14],e[12]=a,e[13]=i,e[14]=u,e[15]=t[15],e},l.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e[9]=Math.abs(t[9]),e[10]=Math.abs(t[10]),e[11]=Math.abs(t[11]),e[12]=Math.abs(t[12]),e[13]=Math.abs(t[13]),e[14]=Math.abs(t[14]),e[15]=Math.abs(t[15]),e},l.equals=function(t,e){return t===e||a(t)&&a(e)&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[3]===e[3]&&t[7]===e[7]&&t[11]===e[11]&&t[15]===e[15]},l.equalsEpsilon=function(t,e,r){return t===e||a(t)&&a(e)&&Math.abs(t[0]-e[0])<=r&&Math.abs(t[1]-e[1])<=r&&Math.abs(t[2]-e[2])<=r&&Math.abs(t[3]-e[3])<=r&&Math.abs(t[4]-e[4])<=r&&Math.abs(t[5]-e[5])<=r&&Math.abs(t[6]-e[6])<=r&&Math.abs(t[7]-e[7])<=r&&Math.abs(t[8]-e[8])<=r&&Math.abs(t[9]-e[9])<=r&&Math.abs(t[10]-e[10])<=r&&Math.abs(t[11]-e[11])<=r&&Math.abs(t[12]-e[12])<=r&&Math.abs(t[13]-e[13])<=r&&Math.abs(t[14]-e[14])<=r&&Math.abs(t[15]-e[15])<=r},l.getTranslation=function(t,e){return e.x=t[12],e.y=t[13],e.z=t[14],e},l.getRotation=function(t,e){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e};var d=new E,S=new E,m=new e,N=new e(0,0,0,1);return l.inverse=function(t,r){if(E.equalsEpsilon(l.getRotation(t,d),S,s.EPSILON7)&&e.equals(l.getRow(t,3,m),N))return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=0,r[11]=0,r[12]=-t[12],r[13]=-t[13],r[14]=-t[14],r[15]=1,r;var n=t[0],a=t[4],o=t[8],i=t[12],u=t[1],f=t[5],_=t[9],R=t[13],h=t[2],T=t[6],A=t[10],C=t[14],I=t[3],p=t[7],M=t[11],O=t[15],g=A*O,y=C*M,F=T*O,L=C*p,v=T*M,U=A*p,D=h*O,P=C*I,w=h*M,B=A*I,x=h*p,b=T*I,G=g*f+L*_+v*R-(y*f+F*_+U*R),z=y*u+D*_+B*R-(g*u+P*_+w*R),H=F*u+P*f+x*R-(L*u+D*f+b*R),V=U*u+w*f+b*_-(v*u+B*f+x*_),q=y*a+F*o+U*i-(g*a+L*o+v*i),X=g*n+P*o+w*i-(y*n+D*o+B*i),W=L*n+D*a+b*i-(F*n+P*a+x*i),Y=v*n+B*a+x*o-(U*n+w*a+b*o);g=o*R,y=i*_,F=a*R,L=i*f,v=a*_,U=o*f,D=n*R,P=i*u,w=n*_,B=o*u,x=n*f,b=a*u;var K=g*p+L*M+v*O-(y*p+F*M+U*O),k=y*I+D*M+B*O-(g*I+P*M+w*O),Z=F*I+P*p+x*O-(L*I+D*p+b*O),j=U*I+w*p+b*M-(v*I+B*p+x*M),Q=F*A+U*C+y*T-(v*C+g*T+L*A),J=w*C+g*h+P*A-(D*A+B*C+y*h),$=D*T+b*C+L*h-(x*C+F*h+P*T),tt=x*A+v*h+B*T-(w*T+b*A+U*h),et=n*G+a*z+o*H+i*V;if(Math.abs(et)<s.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return et=1/et,r[0]=G*et,r[1]=z*et,r[2]=H*et,r[3]=V*et,r[4]=q*et,r[5]=X*et,r[6]=W*et,r[7]=Y*et,r[8]=K*et,r[9]=k*et,r[10]=Z*et,r[11]=j*et,r[12]=Q*et,r[13]=J*et,r[14]=$*et,r[15]=tt*et,r},l.inverseTransformation=function(t,e){var r=t[0],n=t[1],a=t[2],o=t[4],i=t[5],u=t[6],s=t[8],E=t[9],c=t[10],l=t[12],f=t[13],_=t[14],R=-r*l-n*f-a*_,h=-o*l-i*f-u*_,T=-s*l-E*f-c*_;return e[0]=r,e[1]=o,e[2]=s,e[3]=0,e[4]=n,e[5]=i,e[6]=E,e[7]=0,e[8]=a,e[9]=u,e[10]=c,e[11]=0,e[12]=R,e[13]=h,e[14]=T,e[15]=1,e},l.IDENTITY=u(new l(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),l.ZERO=u(new l(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN0ROW3=3,l.COLUMN1ROW0=4,l.COLUMN1ROW1=5,l.COLUMN1ROW2=6,l.COLUMN1ROW3=7,l.COLUMN2ROW0=8,l.COLUMN2ROW1=9,l.COLUMN2ROW2=10,l.COLUMN2ROW3=11,l.COLUMN3ROW0=12,l.COLUMN3ROW1=13,l.COLUMN3ROW2=14,l.COLUMN3ROW3=15,o(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(t){return l.clone(this,t)},l.prototype.equals=function(t){return l.equals(this,t)},l.equalsArray=function(t,e,r){return t[0]===e[r]&&t[1]===e[r+1]&&t[2]===e[r+2]&&t[3]===e[r+3]&&t[4]===e[r+4]&&t[5]===e[r+5]&&t[6]===e[r+6]&&t[7]===e[r+7]&&t[8]===e[r+8]&&t[9]===e[r+9]&&t[10]===e[r+10]&&t[11]===e[r+11]&&t[12]===e[r+12]&&t[13]===e[r+13]&&t[14]===e[r+14]&&t[15]===e[r+15]},l.prototype.equalsEpsilon=function(t,e){return l.equalsEpsilon(this,t,e)},l.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]+")"},l}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(t,e,r,n,a,o,i,u,s){"use strict";function E(t,e,n,a){this.west=r(t,0),this.south=r(e,0),this.east=r(n,0),this.north=r(a,0)}a(E.prototype,{width:{get:function(){return E.computeWidth(this)}},height:{get:function(){return E.computeHeight(this)}}}),E.packedLength=4,E.pack=function(t,e,n){return n=r(n,0),e[n++]=t.west,e[n++]=t.south,e[n++]=t.east,e[n]=t.north,e},E.unpack=function(t,e,a){return e=r(e,0),n(a)||(a=new E),a.west=t[e++],a.south=t[e++],a.east=t[e++],a.north=t[e],a},E.computeWidth=function(t){var e=t.east,r=t.west;return e<r&&(e+=s.TWO_PI),e-r},E.computeHeight=function(t){return t.north-t.south},E.fromDegrees=function(t,e,a,o,i){return t=s.toRadians(r(t,0)),e=s.toRadians(r(e,0)),a=s.toRadians(r(a,0)),o=s.toRadians(r(o,0)),n(i)?(i.west=t,i.south=e,i.east=a,i.north=o,i):new E(t,e,a,o)},E.fromRadians=function(t,e,a,o,i){return n(i)?(i.west=r(t,0),i.south=r(e,0),i.east=r(a,0),i.north=r(o,0),i):new E(t,e,a,o)},E.fromCartographicArray=function(t,e){for(var r=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,i=-Number.MAX_VALUE,u=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=0,f=t.length;l<f;l++){var _=t[l];r=Math.min(r,_.longitude),a=Math.max(a,_.longitude),u=Math.min(u,_.latitude),c=Math.max(c,_.latitude);var R=_.longitude>=0?_.longitude:_.longitude+s.TWO_PI;o=Math.min(o,R),i=Math.max(i,R)}return a-r>i-o&&(r=o,a=i,a>s.PI&&(a-=s.TWO_PI),r>s.PI&&(r-=s.TWO_PI)),n(e)?(e.west=r,e.south=u,e.east=a,e.north=c,e):new E(r,u,a,c)},E.fromCartesianArray=function(t,e,r){for(var a=Number.MAX_VALUE,o=-Number.MAX_VALUE,i=Number.MAX_VALUE,u=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE,f=0,_=t.length;f<_;f++){var R=e.cartesianToCartographic(t[f]);a=Math.min(a,R.longitude),o=Math.max(o,R.longitude),c=Math.min(c,R.latitude),l=Math.max(l,R.latitude);var h=R.longitude>=0?R.longitude:R.longitude+s.TWO_PI;i=Math.min(i,h),u=Math.max(u,h)}return o-a>u-i&&(a=i,o=u,o>s.PI&&(o-=s.TWO_PI),a>s.PI&&(a-=s.TWO_PI)),n(r)?(r.west=a,r.south=c,r.east=o,r.north=l,r):new E(a,c,o,l)},E.clone=function(t,e){if(n(t))return n(e)?(e.west=t.west,e.south=t.south,e.east=t.east,e.north=t.north,e):new E(t.west,t.south,t.east,t.north)},E.prototype.clone=function(t){return E.clone(this,t)},E.prototype.equals=function(t){return E.equals(this,t)},E.equals=function(t,e){return t===e||n(t)&&n(e)&&t.west===e.west&&t.south===e.south&&t.east===e.east&&t.north===e.north},E.prototype.equalsEpsilon=function(t,e){return n(t)&&Math.abs(this.west-t.west)<=e&&Math.abs(this.south-t.south)<=e&&Math.abs(this.east-t.east)<=e&&Math.abs(this.north-t.north)<=e},E.validate=function(t){},E.southwest=function(e,r){return n(r)?(r.longitude=e.west,r.latitude=e.south,r.height=0,r):new t(e.west,e.south)},E.northwest=function(e,r){return n(r)?(r.longitude=e.west,r.latitude=e.north,r.height=0,r):new t(e.west,e.north)},E.northeast=function(e,r){return n(r)?(r.longitude=e.east,r.latitude=e.north,r.height=0,r):new t(e.east,e.north)},E.southeast=function(e,r){return n(r)?(r.longitude=e.east,r.latitude=e.south,r.height=0,r):new t(e.east,e.south)},E.center=function(e,r){var a=e.east,o=e.west;a<o&&(a+=s.TWO_PI);var i=s.negativePiToPi(.5*(o+a)),u=.5*(e.south+e.north);return n(r)?(r.longitude=i,r.latitude=u,r.height=0,r):new t(i,u)},E.intersection=function(t,e,r){var a=t.east,o=t.west,i=e.east,u=e.west;a<o&&i>0?a+=s.TWO_PI:i<u&&a>0&&(i+=s.TWO_PI),a<o&&u<0?u+=s.TWO_PI:i<u&&o<0&&(o+=s.TWO_PI);var c=s.negativePiToPi(Math.max(o,u)),l=s.negativePiToPi(Math.min(a,i));if(!((t.west<t.east||e.west<e.east)&&l<=c)){var f=Math.max(t.south,e.south),_=Math.min(t.north,e.north);if(!(f>=_))return n(r)?(r.west=c,r.south=f,r.east=l,r.north=_,r):new E(c,f,l,_)}},E.simpleIntersection=function(t,e,r){var a=Math.max(t.west,e.west),o=Math.max(t.south,e.south),i=Math.min(t.east,e.east),u=Math.min(t.north,e.north);if(!(o>=u||a>=i))return n(r)?(r.west=a,r.south=o,r.east=i,r.north=u,r):new E(a,o,i,u)},E.union=function(t,e,r){n(r)||(r=new E);var a=t.east,o=t.west,i=e.east,u=e.west;a<o&&i>0?a+=s.TWO_PI:i<u&&a>0&&(i+=s.TWO_PI),a<o&&u<0?u+=s.TWO_PI:i<u&&o<0&&(o+=s.TWO_PI);var c=s.convertLongitudeRange(Math.min(o,u)),l=s.convertLongitudeRange(Math.max(a,i));return r.west=c,r.south=Math.min(t.south,e.south),r.east=l,r.north=Math.max(t.north,e.north),r},E.expand=function(t,e,r){return n(r)||(r=new E),r.west=Math.min(t.west,e.longitude),r.south=Math.min(t.south,e.latitude),r.east=Math.max(t.east,e.longitude),r.north=Math.max(t.north,e.latitude),r},E.contains=function(t,e){var r=e.longitude,n=e.latitude,a=t.west,o=t.east;return o<a&&(o+=s.TWO_PI,r<0&&(r+=s.TWO_PI)),(r>a||s.equalsEpsilon(r,a,s.EPSILON14))&&(r<o||s.equalsEpsilon(r,o,s.EPSILON14))&&n>=t.south&&n<=t.north};var c=new t;return E.subsample=function(t,e,a,o){e=r(e,i.WGS84),a=r(a,0),n(o)||(o=[]);var u=0,l=t.north,f=t.south,_=t.east,R=t.west,h=c;h.height=a,h.longitude=R,h.latitude=l,o[u]=e.cartographicToCartesian(h,o[u]),u++,h.longitude=_,o[u]=e.cartographicToCartesian(h,o[u]),u++,h.latitude=f,o[u]=e.cartographicToCartesian(h,o[u]),u++,h.longitude=R,o[u]=e.cartographicToCartesian(h,o[u]),u++,l<0?h.latitude=l:f>0?h.latitude=f:h.latitude=0;for(var T=1;T<8;++T)h.longitude=-Math.PI+T*s.PI_OVER_TWO,E.contains(t,h)&&(o[u]=e.cartographicToCartesian(h,o[u]),u++);return 0===h.latitude&&(h.longitude=R,o[u]=e.cartographicToCartesian(h,o[u]),u++,h.longitude=_,o[u]=e.cartographicToCartesian(h,o[u]),u++),o.length=u,o},E.MAX_VALUE=u(new E(-Math.PI,-s.PI_OVER_TWO,Math.PI,s.PI_OVER_TWO)),E}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(t,e,r,n,a,o,i,u,s,E,c,l){"use strict";function f(e,r){this.center=t.clone(n(e,t.ZERO)),this.radius=n(r,0)}var _=new t,R=new t,h=new t,T=new t,A=new t,d=new t,S=new t,m=new t,N=new t,C=new t,I=new t,p=new t;f.fromPoints=function(e,r){if(a(r)||(r=new f),!a(e)||0===e.length)return r.center=t.clone(t.ZERO,r.center),r.radius=0,r;for(var n=t.clone(e[0],S),o=t.clone(n,_),i=t.clone(n,R),u=t.clone(n,h),s=t.clone(n,T),E=t.clone(n,A),c=t.clone(n,d),l=e.length,M=1;M<l;M++){t.clone(e[M],n);var O=n.x,g=n.y,y=n.z;O<o.x&&t.clone(n,o),O>s.x&&t.clone(n,s),g<i.y&&t.clone(n,i),g>E.y&&t.clone(n,E),y<u.z&&t.clone(n,u),y>c.z&&t.clone(n,c)}var F=t.magnitudeSquared(t.subtract(s,o,m)),L=t.magnitudeSquared(t.subtract(E,i,m)),v=t.magnitudeSquared(t.subtract(c,u,m)),U=o,D=s,P=F;L>P&&(P=L,U=i,D=E),v>P&&(P=v,U=u,D=c);var w=N;w.x=.5*(U.x+D.x),w.y=.5*(U.y+D.y),w.z=.5*(U.z+D.z);var B=t.magnitudeSquared(t.subtract(D,w,m)),x=Math.sqrt(B),b=C;b.x=o.x,b.y=i.y,b.z=u.z;var G=I;G.x=s.x,G.y=E.y,G.z=c.z;var z=t.multiplyByScalar(t.add(b,G,m),.5,p),H=0;for(M=0;M<l;M++){t.clone(e[M],n);var V=t.magnitude(t.subtract(n,z,m));V>H&&(H=V);var q=t.magnitudeSquared(t.subtract(n,w,m));if(q>B){var X=Math.sqrt(q);x=.5*(x+X),B=x*x;var W=X-x;w.x=(x*w.x+W*n.x)/X,w.y=(x*w.y+W*n.y)/X,w.z=(x*w.z+W*n.z)/X}}return x<H?(t.clone(w,r.center),r.radius=x):(t.clone(z,r.center),r.radius=H),r};var M=new i,O=new t,g=new t,y=new e,F=new e;f.fromRectangle2D=function(t,e,r){return f.fromRectangleWithHeights2D(t,e,0,0,r)},f.fromRectangleWithHeights2D=function(e,r,o,i,u){if(a(u)||(u=new f),!a(e))return u.center=t.clone(t.ZERO,u.center),u.radius=0,u;r=n(r,M),l.southwest(e,y),y.height=o,l.northeast(e,F),F.height=i;var s=r.project(y,O),E=r.project(F,g),c=E.x-s.x,_=E.y-s.y,R=E.z-s.z;u.radius=.5*Math.sqrt(c*c+_*_+R*R);var h=u.center;return h.x=s.x+.5*c,h.y=s.y+.5*_,h.z=s.z+.5*R,u};var L=[];f.fromRectangle3D=function(t,e,r,i){e=n(e,o.WGS84),r=n(r,0);var u;return a(t)&&(u=l.subsample(t,e,r,L)),f.fromPoints(u,i)},f.fromVertices=function(e,r,o,i){if(a(i)||(i=new f),!a(e)||0===e.length)return i.center=t.clone(t.ZERO,i.center),i.radius=0,i;r=n(r,t.ZERO),o=n(o,3);var u=S;u.x=e[0]+r.x,u.y=e[1]+r.y,u.z=e[2]+r.z;for(var s=t.clone(u,_),E=t.clone(u,R),c=t.clone(u,h),l=t.clone(u,T),M=t.clone(u,A),O=t.clone(u,d),g=e.length,y=0;y<g;y+=o){var F=e[y]+r.x,L=e[y+1]+r.y,v=e[y+2]+r.z;u.x=F,u.y=L,u.z=v,F<s.x&&t.clone(u,s),F>l.x&&t.clone(u,l),L<E.y&&t.clone(u,E),L>M.y&&t.clone(u,M),v<c.z&&t.clone(u,c),v>O.z&&t.clone(u,O)}var U=t.magnitudeSquared(t.subtract(l,s,m)),D=t.magnitudeSquared(t.subtract(M,E,m)),P=t.magnitudeSquared(t.subtract(O,c,m)),w=s,B=l,x=U;D>x&&(x=D,w=E,B=M),P>x&&(x=P,w=c,B=O);var b=N;b.x=.5*(w.x+B.x),b.y=.5*(w.y+B.y),b.z=.5*(w.z+B.z);var G=t.magnitudeSquared(t.subtract(B,b,m)),z=Math.sqrt(G),H=C;H.x=s.x,H.y=E.y,H.z=c.z;var V=I;V.x=l.x,V.y=M.y,V.z=O.z;var q=t.multiplyByScalar(t.add(H,V,m),.5,p),X=0;for(y=0;y<g;y+=o){u.x=e[y]+r.x,u.y=e[y+1]+r.y,u.z=e[y+2]+r.z;var W=t.magnitude(t.subtract(u,q,m));W>X&&(X=W);var Y=t.magnitudeSquared(t.subtract(u,b,m));if(Y>G){var K=Math.sqrt(Y);z=.5*(z+K),G=z*z;var k=K-z;b.x=(z*b.x+k*u.x)/K,b.y=(z*b.y+k*u.y)/K,b.z=(z*b.z+k*u.z)/K}}return z<X?(t.clone(b,i.center),i.radius=z):(t.clone(q,i.center),i.radius=X),i},f.fromEncodedCartesianVertices=function(e,r,n){if(a(n)||(n=new f),!a(e)||!a(r)||e.length!==r.length||0===e.length)return n.center=t.clone(t.ZERO,n.center),n.radius=0,n;var o=S;o.x=e[0]+r[0],o.y=e[1]+r[1],o.z=e[2]+r[2];for(var i=t.clone(o,_),u=t.clone(o,R),s=t.clone(o,h),E=t.clone(o,T),c=t.clone(o,A),l=t.clone(o,d),M=e.length,O=0;O<M;O+=3){var g=e[O]+r[O],y=e[O+1]+r[O+1],F=e[O+2]+r[O+2];o.x=g,o.y=y,o.z=F,g<i.x&&t.clone(o,i),g>E.x&&t.clone(o,E),y<u.y&&t.clone(o,u),y>c.y&&t.clone(o,c),F<s.z&&t.clone(o,s),F>l.z&&t.clone(o,l)}var L=t.magnitudeSquared(t.subtract(E,i,m)),v=t.magnitudeSquared(t.subtract(c,u,m)),U=t.magnitudeSquared(t.subtract(l,s,m)),D=i,P=E,w=L;v>w&&(w=v,D=u,P=c),U>w&&(w=U,D=s,P=l);var B=N;B.x=.5*(D.x+P.x),B.y=.5*(D.y+P.y),B.z=.5*(D.z+P.z);var x=t.magnitudeSquared(t.subtract(P,B,m)),b=Math.sqrt(x),G=C;G.x=i.x,G.y=u.y,G.z=s.z;var z=I;z.x=E.x,z.y=c.y,z.z=l.z;var H=t.multiplyByScalar(t.add(G,z,m),.5,p),V=0;for(O=0;O<M;O+=3){o.x=e[O]+r[O],o.y=e[O+1]+r[O+1],o.z=e[O+2]+r[O+2];var q=t.magnitude(t.subtract(o,H,m));q>V&&(V=q);var X=t.magnitudeSquared(t.subtract(o,B,m));if(X>x){var W=Math.sqrt(X);b=.5*(b+W),x=b*b;var Y=W-b;B.x=(b*B.x+Y*o.x)/W,B.y=(b*B.y+Y*o.y)/W,B.z=(b*B.z+Y*o.z)/W}}return b<V?(t.clone(B,n.center),n.radius=b):(t.clone(H,n.center),n.radius=V),n},f.fromCornerPoints=function(e,r,n){a(n)||(n=new f);var o=n.center;return t.add(e,r,o),t.multiplyByScalar(o,.5,o),n.radius=t.distance(o,r),n},f.fromEllipsoid=function(e,r){return a(r)||(r=new f),t.clone(t.ZERO,r.center),r.radius=e.maximumRadius,r};var v=new t;f.fromBoundingSpheres=function(e,r){if(a(r)||(r=new f),!a(e)||0===e.length)return r.center=t.clone(t.ZERO,r.center),r.radius=0,r;var n=e.length;if(1===n)return f.clone(e[0],r);if(2===n)return f.union(e[0],e[1],r);for(var o=[],i=0;i<n;i++)o.push(e[i].center);r=f.fromPoints(o,r);var u=r.center,s=r.radius;for(i=0;i<n;i++){var E=e[i];s=Math.max(s,t.distance(u,E.center,v)+E.radius)}return r.radius=s,r};var U=new t,D=new t,P=new t;f.fromOrientedBoundingBox=function(e,r){a(r)||(r=new f);var n=e.halfAxes,o=E.getColumn(n,0,U),i=E.getColumn(n,1,D),u=E.getColumn(n,2,P),s=t.magnitude(o),c=t.magnitude(i),l=t.magnitude(u);return r.center=t.clone(e.center,r.center),r.radius=Math.max(s,c,l),r},f.clone=function(e,r){if(a(e))return a(r)?(r.center=t.clone(e.center,r.center),r.radius=e.radius,r):new f(e.center,e.radius)},f.packedLength=4,f.pack=function(t,e,r){r=n(r,0);var a=t.center;return e[r++]=a.x,e[r++]=a.y,e[r++]=a.z,e[r]=t.radius,e},f.unpack=function(t,e,r){e=n(e,0),a(r)||(r=new f);var o=r.center;return o.x=t[e++],o.y=t[e++],o.z=t[e++],r.radius=t[e],r};var w=new t,B=new t;f.union=function(e,r,n){a(n)||(n=new f);var o=e.center,i=e.radius,u=r.center,s=r.radius,E=t.subtract(u,o,w),c=t.magnitude(E);if(i>=c+s)return e.clone(n),n;if(s>=c+i)return r.clone(n),n;var l=.5*(i+c+s),_=t.multiplyByScalar(E,(-i+l)/c,B);return t.add(_,o,_),t.clone(_,n.center),n.radius=l,n};var x=new t;f.expand=function(e,r,n){n=f.clone(e,n);var a=t.magnitude(t.subtract(r,n.center,x));return a>n.radius&&(n.radius=a),n},f.intersectPlane=function(e,r){var n=e.center,a=e.radius,o=r.normal,i=t.dot(o,n)+r.distance;return i<-a?u.OUTSIDE:i<a?u.INTERSECTING:u.INSIDE},f.transform=function(t,e,r){return a(r)||(r=new f),r.center=c.multiplyByPoint(e,t.center,r.center),r.radius=c.getMaximumScale(e)*t.radius,r};var b=new t;f.distanceSquaredTo=function(e,r){var n=t.subtract(e.center,r,b);return t.magnitudeSquared(n)-e.radius*e.radius},f.transformWithoutScale=function(t,e,r){return a(r)||(r=new f),r.center=c.multiplyByPoint(e,t.center,r.center),r.radius=t.radius,r};var G=new t;f.computePlaneDistances=function(e,r,n,o){a(o)||(o=new s);var i=t.subtract(e.center,r,G),u=t.dot(n,i);return o.start=u-e.radius,o.stop=u+e.radius,o};for(var z=new t,H=new t,V=new t,q=new t,X=new t,W=new e,Y=new Array(8),K=0;K<8;++K)Y[K]=new t;var k=new i;return f.projectTo2D=function(e,r,a){r=n(r,k);var o=r.ellipsoid,i=e.center,u=e.radius,s=o.geodeticSurfaceNormal(i,z),E=t.cross(t.UNIT_Z,s,H);t.normalize(E,E);var c=t.cross(s,E,V);t.normalize(c,c),t.multiplyByScalar(s,u,s),t.multiplyByScalar(c,u,c),t.multiplyByScalar(E,u,E);var l=t.negate(c,X),_=t.negate(E,q),R=Y,h=R[0];t.add(s,c,h),t.add(h,E,h),h=R[1],t.add(s,c,h),t.add(h,_,h),h=R[2],t.add(s,l,h),t.add(h,_,h),h=R[3],t.add(s,l,h),t.add(h,E,h),t.negate(s,s),h=R[4],t.add(s,c,h),t.add(h,E,h),h=R[5],t.add(s,c,h),t.add(h,_,h),h=R[6],t.add(s,l,h),t.add(h,_,h),h=R[7],t.add(s,l,h),t.add(h,E,h);for(var T=R.length,A=0;A<T;++A){var d=R[A];t.add(i,d,d);var S=o.cartesianToCartographic(d,W);r.project(S,d)}a=f.fromPoints(R,a),i=a.center;var m=i.x,N=i.y,C=i.z;return i.x=C,i.y=m,i.z=N,a},f.isOccluded=function(t,e){return!e.isBoundingSphereVisible(t)},f.equals=function(e,r){return e===r||a(e)&&a(r)&&t.equals(e.center,r.center)&&e.radius===r.radius},f.prototype.intersectPlane=function(t){return f.intersectPlane(this,t)},f.prototype.distanceSquaredTo=function(t){return f.distanceSquaredTo(this,t)},f.prototype.computePlaneDistances=function(t,e,r){return f.computePlaneDistances(this,t,e,r)},f.prototype.isOccluded=function(t){return f.isOccluded(this,t)},f.prototype.equals=function(t){return f.equals(this,t)},f.prototype.clone=function(t){return f.clone(this,t)},f}),define("Core/Fullscreen",["./defined","./defineProperties"],function(t,e){"use strict";var r,n={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return e(a,{element:{get:function(){if(a.supportsFullscreen())return document[n.fullscreenElement]}},changeEventName:{get:function(){if(a.supportsFullscreen())return n.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return n.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[n.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(t(r))return r;r=!1;var e=document.body;if("function"==typeof e.requestFullscreen)return n.requestFullscreen="requestFullscreen",n.exitFullscreen="exitFullscreen",n.fullscreenEnabled="fullscreenEnabled",n.fullscreenElement="fullscreenElement",n.fullscreenchange="fullscreenchange",n.fullscreenerror="fullscreenerror",r=!0;for(var a,o=["webkit","moz","o","ms","khtml"],i=0,u=o.length;i<u;++i){var s=o[i];a=s+"RequestFullscreen","function"==typeof e[a]?(n.requestFullscreen=a,r=!0):(a=s+"RequestFullScreen","function"==typeof e[a]&&(n.requestFullscreen=a,r=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?n.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(n.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?n.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(n.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?n.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(n.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),n.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),n.fullscreenerror=a)}return r},a.requestFullscreen=function(t,e){a.supportsFullscreen()&&t[n.requestFullscreen]({vrDisplay:e})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[n.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(t,e,r){"use strict";function n(t){for(var e=t.split("."),r=0,n=e.length;r<n;++r)e[r]=parseInt(e[r],10);return e}function a(){if(!e(N)&&(N=!1,!f())){var t=/ Chrome\/([\.0-9]+)/.exec(m.userAgent);null!==t&&(N=!0,C=n(t[1]))}return N}function o(){return a()&&C}function i(){if(!e(I)&&(I=!1,!a()&&!f()&&/ Safari\/[\.0-9]+/.test(m.userAgent))){var t=/ Version\/([\.0-9]+)/.exec(m.userAgent);null!==t&&(I=!0,p=n(t[1]))}return I}function u(){return i()&&p}function s(){if(!e(M)){M=!1;var t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(m.userAgent);null!==t&&(M=!0,O=n(t[1]),O.isNightly=!!t[2]); +}return M}function E(){return s()&&O}function c(){if(!e(g)){g=!1;var t;"Microsoft Internet Explorer"===m.appName?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(m.userAgent),null!==t&&(g=!0,y=n(t[1]))):"Netscape"===m.appName&&(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(m.userAgent),null!==t&&(g=!0,y=n(t[1])))}return g}function l(){return c()&&y}function f(){if(!e(F)){F=!1;var t=/ Edge\/([\.0-9]+)/.exec(m.userAgent);null!==t&&(F=!0,L=n(t[1]))}return F}function _(){return f()&&L}function R(){if(!e(v)){v=!1;var t=/Firefox\/([\.0-9]+)/.exec(m.userAgent);null!==t&&(v=!0,U=n(t[1]))}return v}function h(){return e(D)||(D=/Windows/i.test(m.appVersion)),D}function T(){return R()&&U}function A(){return e(P)||(P="undefined"!=typeof PointerEvent&&(!e(m.pointerEnabled)||m.pointerEnabled)),P}function d(){if(!e(B)){var t=document.createElement("canvas");t.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var r=t.style.imageRendering;B=e(r)&&""!==r,B&&(w=r)}return B}function S(){return d()?w:void 0}var m;m="undefined"!=typeof navigator?navigator:{};var N,C,I,p,M,O,g,y,F,L,v,U,D,P,w,B,x={isChrome:a,chromeVersion:o,isSafari:i,safariVersion:u,isWebkit:s,webkitVersion:E,isInternetExplorer:c,internetExplorerVersion:l,isEdge:f,edgeVersion:_,isFirefox:R,firefoxVersion:T,isWindows:h,hardwareConcurrency:t(m.hardwareConcurrency,3),supportsPointerEvents:A,supportsImageRenderingPixelated:d,imageRenderingValue:S};return x.supportsFullscreen=function(){return r.supportsFullscreen()},x.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},x.supportsWebWorkers=function(){return"undefined"!=typeof Worker},x}),define("Core/Color",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math"],function(t,e,r,n,a,o){"use strict";function i(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),6*r<1?t+6*(e-t)*r:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}function u(e,r,n,a){this.red=t(e,1),this.green=t(r,1),this.blue=t(n,1),this.alpha=t(a,1)}u.fromCartesian4=function(t,r){return e(r)?(r.red=t.x,r.green=t.y,r.blue=t.z,r.alpha=t.w,r):new u(t.x,t.y,t.z,t.w)},u.fromBytes=function(r,n,a,o,i){return r=u.byteToFloat(t(r,255)),n=u.byteToFloat(t(n,255)),a=u.byteToFloat(t(a,255)),o=u.byteToFloat(t(o,255)),e(i)?(i.red=r,i.green=n,i.blue=a,i.alpha=o,i):new u(r,n,a,o)},u.fromAlpha=function(t,r,n){return e(n)?(n.red=t.red,n.green=t.green,n.blue=t.blue,n.alpha=r,n):new u(t.red,t.green,t.blue,r)};var s,E,c;n.supportsTypedArrays()&&(s=new ArrayBuffer(4),E=new Uint32Array(s),c=new Uint8Array(s)),u.fromRgba=function(t,e){return E[0]=t,u.fromBytes(c[0],c[1],c[2],c[3],e)},u.fromHsl=function(r,n,a,o,s){r=t(r,0)%1,n=t(n,0),a=t(a,0),o=t(o,1);var E=a,c=a,l=a;if(0!==n){var f;f=a<.5?a*(1+n):a+n-a*n;var _=2*a-f;E=i(_,f,r+1/3),c=i(_,f,r),l=i(_,f,r-1/3)}return e(s)?(s.red=E,s.green=c,s.blue=l,s.alpha=o,s):new u(E,c,l,o)},u.fromRandom=function(r,n){r=t(r,t.EMPTY_OBJECT);var a=r.red;if(!e(a)){var i=t(r.minimumRed,0),s=t(r.maximumRed,1);a=i+o.nextRandomNumber()*(s-i)}var E=r.green;if(!e(E)){var c=t(r.minimumGreen,0),l=t(r.maximumGreen,1);E=c+o.nextRandomNumber()*(l-c)}var f=r.blue;if(!e(f)){var _=t(r.minimumBlue,0),R=t(r.maximumBlue,1);f=_+o.nextRandomNumber()*(R-_)}var h=r.alpha;if(!e(h)){var T=t(r.minimumAlpha,0),A=t(r.maximumAlpha,1);h=T+o.nextRandomNumber()*(A-T)}return e(n)?(n.red=a,n.green=E,n.blue=f,n.alpha=h,n):new u(a,E,f,h)};var l=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i,f=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i,_=/^rgba?\(\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)(?:\s*,\s*([0-9.]+))?\s*\)$/i,R=/^hsla?\(\s*([0-9.]+)\s*,\s*([0-9.]+%)\s*,\s*([0-9.]+%)(?:\s*,\s*([0-9.]+))?\s*\)$/i;return u.fromCssColorString=function(r,n){e(n)||(n=new u);var a=u[r.toUpperCase()];if(e(a))return u.clone(a,n),n;var o=l.exec(r);return null!==o?(n.red=parseInt(o[1],16)/15,n.green=parseInt(o[2],16)/15,n.blue=parseInt(o[3],16)/15,n.alpha=1,n):(o=f.exec(r),null!==o?(n.red=parseInt(o[1],16)/255,n.green=parseInt(o[2],16)/255,n.blue=parseInt(o[3],16)/255,n.alpha=1,n):(o=_.exec(r),null!==o?(n.red=parseFloat(o[1])/("%"===o[1].substr(-1)?100:255),n.green=parseFloat(o[2])/("%"===o[2].substr(-1)?100:255),n.blue=parseFloat(o[3])/("%"===o[3].substr(-1)?100:255),n.alpha=parseFloat(t(o[4],"1.0")),n):(o=R.exec(r),null!==o?u.fromHsl(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,parseFloat(t(o[4],"1.0")),n):n=void 0)))},u.packedLength=4,u.pack=function(e,r,n){return n=t(n,0),r[n++]=e.red,r[n++]=e.green,r[n++]=e.blue,r[n]=e.alpha,r},u.unpack=function(r,n,a){return n=t(n,0),e(a)||(a=new u),a.red=r[n++],a.green=r[n++],a.blue=r[n++],a.alpha=r[n],a},u.byteToFloat=function(t){return t/255},u.floatToByte=function(t){return 1===t?255:256*t|0},u.clone=function(t,r){if(e(t))return e(r)?(r.red=t.red,r.green=t.green,r.blue=t.blue,r.alpha=t.alpha,r):new u(t.red,t.green,t.blue,t.alpha)},u.equals=function(t,r){return t===r||e(t)&&e(r)&&t.red===r.red&&t.green===r.green&&t.blue===r.blue&&t.alpha===r.alpha},u.equalsArray=function(t,e,r){return t.red===e[r]&&t.green===e[r+1]&&t.blue===e[r+2]&&t.alpha===e[r+3]},u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.prototype.equalsEpsilon=function(t,r){return this===t||e(t)&&Math.abs(this.red-t.red)<=r&&Math.abs(this.green-t.green)<=r&&Math.abs(this.blue-t.blue)<=r&&Math.abs(this.alpha-t.alpha)<=r},u.prototype.toString=function(){return"("+this.red+", "+this.green+", "+this.blue+", "+this.alpha+")"},u.prototype.toCssColorString=function(){var t=u.floatToByte(this.red),e=u.floatToByte(this.green),r=u.floatToByte(this.blue);return 1===this.alpha?"rgb("+t+","+e+","+r+")":"rgba("+t+","+e+","+r+","+this.alpha+")"},u.prototype.toBytes=function(t){var r=u.floatToByte(this.red),n=u.floatToByte(this.green),a=u.floatToByte(this.blue),o=u.floatToByte(this.alpha);return e(t)?(t[0]=r,t[1]=n,t[2]=a,t[3]=o,t):[r,n,a,o]},u.prototype.toRgba=function(){return c[0]=u.floatToByte(this.red),c[1]=u.floatToByte(this.green),c[2]=u.floatToByte(this.blue),c[3]=u.floatToByte(this.alpha),E[0]},u.prototype.brighten=function(t,e){return t=1-t,e.red=1-(1-this.red)*t,e.green=1-(1-this.green)*t,e.blue=1-(1-this.blue)*t,e.alpha=this.alpha,e},u.prototype.darken=function(t,e){return t=1-t,e.red=this.red*t,e.green=this.green*t,e.blue=this.blue*t,e.alpha=this.alpha,e},u.prototype.withAlpha=function(t,e){return u.fromAlpha(this,t,e)},u.add=function(t,e,r){return r.red=t.red+e.red,r.green=t.green+e.green,r.blue=t.blue+e.blue,r.alpha=t.alpha+e.alpha,r},u.subtract=function(t,e,r){return r.red=t.red-e.red,r.green=t.green-e.green,r.blue=t.blue-e.blue,r.alpha=t.alpha-e.alpha,r},u.multiply=function(t,e,r){return r.red=t.red*e.red,r.green=t.green*e.green,r.blue=t.blue*e.blue,r.alpha=t.alpha*e.alpha,r},u.divide=function(t,e,r){return r.red=t.red/e.red,r.green=t.green/e.green,r.blue=t.blue/e.blue,r.alpha=t.alpha/e.alpha,r},u.mod=function(t,e,r){return r.red=t.red%e.red,r.green=t.green%e.green,r.blue=t.blue%e.blue,r.alpha=t.alpha%e.alpha,r},u.multiplyByScalar=function(t,e,r){return r.red=t.red*e,r.green=t.green*e,r.blue=t.blue*e,r.alpha=t.alpha*e,r},u.divideByScalar=function(t,e,r){return r.red=t.red/e,r.green=t.green/e,r.blue=t.blue/e,r.alpha=t.alpha/e,r},u.ALICEBLUE=a(u.fromCssColorString("#F0F8FF")),u.ANTIQUEWHITE=a(u.fromCssColorString("#FAEBD7")),u.AQUA=a(u.fromCssColorString("#00FFFF")),u.AQUAMARINE=a(u.fromCssColorString("#7FFFD4")),u.AZURE=a(u.fromCssColorString("#F0FFFF")),u.BEIGE=a(u.fromCssColorString("#F5F5DC")),u.BISQUE=a(u.fromCssColorString("#FFE4C4")),u.BLACK=a(u.fromCssColorString("#000000")),u.BLANCHEDALMOND=a(u.fromCssColorString("#FFEBCD")),u.BLUE=a(u.fromCssColorString("#0000FF")),u.BLUEVIOLET=a(u.fromCssColorString("#8A2BE2")),u.BROWN=a(u.fromCssColorString("#A52A2A")),u.BURLYWOOD=a(u.fromCssColorString("#DEB887")),u.CADETBLUE=a(u.fromCssColorString("#5F9EA0")),u.CHARTREUSE=a(u.fromCssColorString("#7FFF00")),u.CHOCOLATE=a(u.fromCssColorString("#D2691E")),u.CORAL=a(u.fromCssColorString("#FF7F50")),u.CORNFLOWERBLUE=a(u.fromCssColorString("#6495ED")),u.CORNSILK=a(u.fromCssColorString("#FFF8DC")),u.CRIMSON=a(u.fromCssColorString("#DC143C")),u.CYAN=a(u.fromCssColorString("#00FFFF")),u.DARKBLUE=a(u.fromCssColorString("#00008B")),u.DARKCYAN=a(u.fromCssColorString("#008B8B")),u.DARKGOLDENROD=a(u.fromCssColorString("#B8860B")),u.DARKGRAY=a(u.fromCssColorString("#A9A9A9")),u.DARKGREEN=a(u.fromCssColorString("#006400")),u.DARKGREY=u.DARKGRAY,u.DARKKHAKI=a(u.fromCssColorString("#BDB76B")),u.DARKMAGENTA=a(u.fromCssColorString("#8B008B")),u.DARKOLIVEGREEN=a(u.fromCssColorString("#556B2F")),u.DARKORANGE=a(u.fromCssColorString("#FF8C00")),u.DARKORCHID=a(u.fromCssColorString("#9932CC")),u.DARKRED=a(u.fromCssColorString("#8B0000")),u.DARKSALMON=a(u.fromCssColorString("#E9967A")),u.DARKSEAGREEN=a(u.fromCssColorString("#8FBC8F")),u.DARKSLATEBLUE=a(u.fromCssColorString("#483D8B")),u.DARKSLATEGRAY=a(u.fromCssColorString("#2F4F4F")),u.DARKSLATEGREY=u.DARKSLATEGRAY,u.DARKTURQUOISE=a(u.fromCssColorString("#00CED1")),u.DARKVIOLET=a(u.fromCssColorString("#9400D3")),u.DEEPPINK=a(u.fromCssColorString("#FF1493")),u.DEEPSKYBLUE=a(u.fromCssColorString("#00BFFF")),u.DIMGRAY=a(u.fromCssColorString("#696969")),u.DIMGREY=u.DIMGRAY,u.DODGERBLUE=a(u.fromCssColorString("#1E90FF")),u.FIREBRICK=a(u.fromCssColorString("#B22222")),u.FLORALWHITE=a(u.fromCssColorString("#FFFAF0")),u.FORESTGREEN=a(u.fromCssColorString("#228B22")),u.FUSCHIA=a(u.fromCssColorString("#FF00FF")),u.GAINSBORO=a(u.fromCssColorString("#DCDCDC")),u.GHOSTWHITE=a(u.fromCssColorString("#F8F8FF")),u.GOLD=a(u.fromCssColorString("#FFD700")),u.GOLDENROD=a(u.fromCssColorString("#DAA520")),u.GRAY=a(u.fromCssColorString("#808080")),u.GREEN=a(u.fromCssColorString("#008000")),u.GREENYELLOW=a(u.fromCssColorString("#ADFF2F")),u.GREY=u.GRAY,u.HONEYDEW=a(u.fromCssColorString("#F0FFF0")),u.HOTPINK=a(u.fromCssColorString("#FF69B4")),u.INDIANRED=a(u.fromCssColorString("#CD5C5C")),u.INDIGO=a(u.fromCssColorString("#4B0082")),u.IVORY=a(u.fromCssColorString("#FFFFF0")),u.KHAKI=a(u.fromCssColorString("#F0E68C")),u.LAVENDER=a(u.fromCssColorString("#E6E6FA")),u.LAVENDAR_BLUSH=a(u.fromCssColorString("#FFF0F5")),u.LAWNGREEN=a(u.fromCssColorString("#7CFC00")),u.LEMONCHIFFON=a(u.fromCssColorString("#FFFACD")),u.LIGHTBLUE=a(u.fromCssColorString("#ADD8E6")),u.LIGHTCORAL=a(u.fromCssColorString("#F08080")),u.LIGHTCYAN=a(u.fromCssColorString("#E0FFFF")),u.LIGHTGOLDENRODYELLOW=a(u.fromCssColorString("#FAFAD2")),u.LIGHTGRAY=a(u.fromCssColorString("#D3D3D3")),u.LIGHTGREEN=a(u.fromCssColorString("#90EE90")),u.LIGHTGREY=u.LIGHTGRAY,u.LIGHTPINK=a(u.fromCssColorString("#FFB6C1")),u.LIGHTSEAGREEN=a(u.fromCssColorString("#20B2AA")),u.LIGHTSKYBLUE=a(u.fromCssColorString("#87CEFA")),u.LIGHTSLATEGRAY=a(u.fromCssColorString("#778899")),u.LIGHTSLATEGREY=u.LIGHTSLATEGRAY,u.LIGHTSTEELBLUE=a(u.fromCssColorString("#B0C4DE")),u.LIGHTYELLOW=a(u.fromCssColorString("#FFFFE0")),u.LIME=a(u.fromCssColorString("#00FF00")),u.LIMEGREEN=a(u.fromCssColorString("#32CD32")),u.LINEN=a(u.fromCssColorString("#FAF0E6")),u.MAGENTA=a(u.fromCssColorString("#FF00FF")),u.MAROON=a(u.fromCssColorString("#800000")),u.MEDIUMAQUAMARINE=a(u.fromCssColorString("#66CDAA")),u.MEDIUMBLUE=a(u.fromCssColorString("#0000CD")),u.MEDIUMORCHID=a(u.fromCssColorString("#BA55D3")),u.MEDIUMPURPLE=a(u.fromCssColorString("#9370DB")),u.MEDIUMSEAGREEN=a(u.fromCssColorString("#3CB371")),u.MEDIUMSLATEBLUE=a(u.fromCssColorString("#7B68EE")),u.MEDIUMSPRINGGREEN=a(u.fromCssColorString("#00FA9A")),u.MEDIUMTURQUOISE=a(u.fromCssColorString("#48D1CC")),u.MEDIUMVIOLETRED=a(u.fromCssColorString("#C71585")),u.MIDNIGHTBLUE=a(u.fromCssColorString("#191970")),u.MINTCREAM=a(u.fromCssColorString("#F5FFFA")),u.MISTYROSE=a(u.fromCssColorString("#FFE4E1")),u.MOCCASIN=a(u.fromCssColorString("#FFE4B5")),u.NAVAJOWHITE=a(u.fromCssColorString("#FFDEAD")),u.NAVY=a(u.fromCssColorString("#000080")),u.OLDLACE=a(u.fromCssColorString("#FDF5E6")),u.OLIVE=a(u.fromCssColorString("#808000")),u.OLIVEDRAB=a(u.fromCssColorString("#6B8E23")),u.ORANGE=a(u.fromCssColorString("#FFA500")),u.ORANGERED=a(u.fromCssColorString("#FF4500")),u.ORCHID=a(u.fromCssColorString("#DA70D6")),u.PALEGOLDENROD=a(u.fromCssColorString("#EEE8AA")),u.PALEGREEN=a(u.fromCssColorString("#98FB98")),u.PALETURQUOISE=a(u.fromCssColorString("#AFEEEE")),u.PALEVIOLETRED=a(u.fromCssColorString("#DB7093")),u.PAPAYAWHIP=a(u.fromCssColorString("#FFEFD5")),u.PEACHPUFF=a(u.fromCssColorString("#FFDAB9")),u.PERU=a(u.fromCssColorString("#CD853F")),u.PINK=a(u.fromCssColorString("#FFC0CB")),u.PLUM=a(u.fromCssColorString("#DDA0DD")),u.POWDERBLUE=a(u.fromCssColorString("#B0E0E6")),u.PURPLE=a(u.fromCssColorString("#800080")),u.RED=a(u.fromCssColorString("#FF0000")),u.ROSYBROWN=a(u.fromCssColorString("#BC8F8F")),u.ROYALBLUE=a(u.fromCssColorString("#4169E1")),u.SADDLEBROWN=a(u.fromCssColorString("#8B4513")),u.SALMON=a(u.fromCssColorString("#FA8072")),u.SANDYBROWN=a(u.fromCssColorString("#F4A460")),u.SEAGREEN=a(u.fromCssColorString("#2E8B57")),u.SEASHELL=a(u.fromCssColorString("#FFF5EE")),u.SIENNA=a(u.fromCssColorString("#A0522D")),u.SILVER=a(u.fromCssColorString("#C0C0C0")),u.SKYBLUE=a(u.fromCssColorString("#87CEEB")),u.SLATEBLUE=a(u.fromCssColorString("#6A5ACD")),u.SLATEGRAY=a(u.fromCssColorString("#708090")),u.SLATEGREY=u.SLATEGRAY,u.SNOW=a(u.fromCssColorString("#FFFAFA")),u.SPRINGGREEN=a(u.fromCssColorString("#00FF7F")),u.STEELBLUE=a(u.fromCssColorString("#4682B4")),u.TAN=a(u.fromCssColorString("#D2B48C")),u.TEAL=a(u.fromCssColorString("#008080")),u.THISTLE=a(u.fromCssColorString("#D8BFD8")),u.TOMATO=a(u.fromCssColorString("#FF6347")),u.TURQUOISE=a(u.fromCssColorString("#40E0D0")),u.VIOLET=a(u.fromCssColorString("#EE82EE")),u.WHEAT=a(u.fromCssColorString("#F5DEB3")),u.WHITE=a(u.fromCssColorString("#FFFFFF")),u.WHITESMOKE=a(u.fromCssColorString("#F5F5F5")),u.YELLOW=a(u.fromCssColorString("#FFFF00")),u.YELLOWGREEN=a(u.fromCssColorString("#9ACD32")),u.TRANSPARENT=a(new u(0,0,0,0)),u}),define("Core/WebGLConstants",["./freezeObject"],function(t){"use strict";var e={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047};return t(e)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(t,e,r,n,a,o){"use strict";if(!n.supportsTypedArrays())return{};var i={BYTE:o.BYTE,UNSIGNED_BYTE:o.UNSIGNED_BYTE,SHORT:o.SHORT,UNSIGNED_SHORT:o.UNSIGNED_SHORT,INT:o.INT,UNSIGNED_INT:o.UNSIGNED_INT,FLOAT:o.FLOAT,DOUBLE:o.DOUBLE};return i.getSizeInBytes=function(t){switch(t){case i.BYTE:return Int8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.SHORT:return Int16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.INT:return Int32Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case i.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case i.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},i.fromTypedArray=function(t){return t instanceof Int8Array?i.BYTE:t instanceof Uint8Array?i.UNSIGNED_BYTE:t instanceof Int16Array?i.SHORT:t instanceof Uint16Array?i.UNSIGNED_SHORT:t instanceof Int32Array?i.INT:t instanceof Uint32Array?i.UNSIGNED_INT:t instanceof Float32Array?i.FLOAT:t instanceof Float64Array?i.DOUBLE:void 0},i.validate=function(t){return e(t)&&(t===i.BYTE||t===i.UNSIGNED_BYTE||t===i.SHORT||t===i.UNSIGNED_SHORT||t===i.INT||t===i.UNSIGNED_INT||t===i.FLOAT||t===i.DOUBLE)},i.createTypedArray=function(t,e){switch(t){case i.BYTE:return new Int8Array(e);case i.UNSIGNED_BYTE:return new Uint8Array(e);case i.SHORT:return new Int16Array(e);case i.UNSIGNED_SHORT:return new Uint16Array(e);case i.INT:return new Int32Array(e);case i.UNSIGNED_INT:return new Uint32Array(e);case i.FLOAT:return new Float32Array(e);case i.DOUBLE:return new Float64Array(e)}},i.createArrayBufferView=function(e,r,n,a){switch(n=t(n,0),a=t(a,(r.byteLength-n)/i.getSizeInBytes(e)),e){case i.BYTE:return new Int8Array(r,n,a);case i.UNSIGNED_BYTE:return new Uint8Array(r,n,a);case i.SHORT:return new Int16Array(r,n,a);case i.UNSIGNED_SHORT:return new Uint16Array(r,n,a);case i.INT:return new Int32Array(r,n,a);case i.UNSIGNED_INT:return new Uint32Array(r,n,a);case i.FLOAT:return new Float32Array(r,n,a);case i.DOUBLE:return new Float64Array(r,n,a)}},i.fromName=function(t){switch(t){case"BYTE":return i.BYTE;case"UNSIGNED_BYTE":return i.UNSIGNED_BYTE;case"SHORT":return i.SHORT;case"UNSIGNED_SHORT":return i.UNSIGNED_SHORT;case"INT":return i.INT;case"UNSIGNED_INT":return i.UNSIGNED_INT;case"FLOAT":return i.FLOAT;case"DOUBLE":return i.DOUBLE}},a(i)}),define("Core/GeometryType",["./freezeObject"],function(t){"use strict";var e={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return t(e)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(t,e){"use strict";var r={POINTS:e.POINTS,LINES:e.LINES,LINE_LOOP:e.LINE_LOOP,LINE_STRIP:e.LINE_STRIP,TRIANGLES:e.TRIANGLES,TRIANGLE_STRIP:e.TRIANGLE_STRIP,TRIANGLE_FAN:e.TRIANGLE_FAN,validate:function(t){return t===r.POINTS||t===r.LINES||t===r.LINE_LOOP||t===r.LINE_STRIP||t===r.TRIANGLES||t===r.TRIANGLE_STRIP||t===r.TRIANGLE_FAN}};return t(r)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(t,e,r,n,a){"use strict";function o(e){e=t(e,t.EMPTY_OBJECT),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=t(e.primitiveType,a.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=t(e.geometryType,n.NONE),this.boundingSphereCV=e.boundingSphereCV}return o.computeNumberOfVertices=function(t){var r=-1;for(var n in t.attributes)if(t.attributes.hasOwnProperty(n)&&e(t.attributes[n])&&e(t.attributes[n].values)){var a=t.attributes[n],o=a.values.length/a.componentsPerAttribute;r=o}return r},o}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(t,e,r){"use strict";function n(e){e=t(e,t.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=t(e.normalize,!1),this.values=e.values}return n}),define("Core/GeometryAttributes",["./defaultValue"],function(t){"use strict";function e(e){e=t(e,t.EMPTY_OBJECT),this.position=e.position,this.normal=e.normal,this.st=e.st,this.bitangent=e.bitangent,this.tangent=e.tangent,this.color=e.color}return e}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(t,e,r,n,a){"use strict";var o={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return o.getSizeInBytes=function(t){switch(t){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(e){return t(e)&&(e===o.UNSIGNED_BYTE||e===o.UNSIGNED_SHORT||e===o.UNSIGNED_INT)},o.createTypedArray=function(t,e){return t>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(e):new Uint16Array(e)},o.createTypedArrayFromArrayBuffer=function(t,e,r,a){return t>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(e,r,a):new Uint16Array(e,r,a); +},r(o)}),define("Core/EllipsoidGeodesic",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(t,e,r,n,a,o,i,u){"use strict";function s(t){var e=t._uSquared,r=t._ellipsoid.maximumRadius,n=t._ellipsoid.minimumRadius,a=(r-n)/r,o=Math.cos(t._startHeading),i=Math.sin(t._startHeading),u=(1-a)*Math.tan(t._start.latitude),s=1/Math.sqrt(1+u*u),E=s*u,c=Math.atan2(u,o),l=s*i,f=l*l,_=1-f,R=Math.sqrt(_),h=e/4,T=h*h,A=T*h,d=T*T,S=1+h-3*T/4+5*A/4-175*d/64,m=1-h+15*T/8-35*A/8,N=1-3*h+35*T/4,C=1-5*h,I=S*c-m*Math.sin(2*c)*h/2-N*Math.sin(4*c)*T/16-C*Math.sin(6*c)*A/48-5*Math.sin(8*c)*d/512,p=t._constants;p.a=r,p.b=n,p.f=a,p.cosineHeading=o,p.sineHeading=i,p.tanU=u,p.cosineU=s,p.sineU=E,p.sigma=c,p.sineAlpha=l,p.sineSquaredAlpha=f,p.cosineSquaredAlpha=_,p.cosineAlpha=R,p.u2Over4=h,p.u4Over16=T,p.u6Over64=A,p.u8Over256=d,p.a0=S,p.a1=m,p.a2=N,p.a3=C,p.distanceRatio=I}function E(t,e){return t*e*(4+t*(4-3*e))/16}function c(t,e,r,n,a,o,i){var u=E(t,r);return(1-u)*t*e*(n+u*a*(i+u*o*(2*i*i-1)))}function l(t,e,r,n,a,o,i){var s,E,l,f,_,R=(e-r)/e,h=o-n,T=Math.atan((1-R)*Math.tan(a)),A=Math.atan((1-R)*Math.tan(i)),d=Math.cos(T),S=Math.sin(T),m=Math.cos(A),N=Math.sin(A),C=d*m,I=d*N,p=S*N,M=S*m,O=h,g=u.TWO_PI,y=Math.cos(O),F=Math.sin(O);do{y=Math.cos(O),F=Math.sin(O);var L=I-M*y;l=Math.sqrt(m*m*F*F+L*L),E=p+C*y,s=Math.atan2(l,E);var v;0===l?(v=0,f=1):(v=C*F/l,f=1-v*v),g=O,_=E-2*p/f,isNaN(_)&&(_=0),O=h+c(R,v,f,s,l,E,_)}while(Math.abs(O-g)>u.EPSILON12);var U=f*(e*e-r*r)/(r*r),D=1+U*(4096+U*(U*(320-175*U)-768))/16384,P=U*(256+U*(U*(74-47*U)-128))/1024,w=_*_,B=P*l*(_+P*(E*(2*w-1)-P*_*(4*l*l-3)*(4*w-3)/6)/4),x=r*D*(s-B),b=Math.atan2(m*F,I-M*y),G=Math.atan2(d*F,I*y-M);t._distance=x,t._startHeading=b,t._endHeading=G,t._uSquared=U}function f(r,n,a,o){t.normalize(o.cartographicToCartesian(n,h),R),t.normalize(o.cartographicToCartesian(a,h),h);l(r,o.maximumRadius,o.minimumRadius,n.longitude,n.latitude,a.longitude,a.latitude),r._start=e.clone(n,r._start),r._end=e.clone(a,r._end),r._start.height=0,r._end.height=0,s(r)}function _(t,a,o){var u=r(o,i.WGS84);this._ellipsoid=u,this._start=new e,this._end=new e,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,n(t)&&n(a)&&f(this,t,a,u)}var R=new t,h=new t;return a(_.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return this._startHeading}},endHeading:{get:function(){return this._endHeading}}}),_.prototype.setEndPoints=function(t,e){f(this,t,e,this._ellipsoid)},_.prototype.interpolateUsingFraction=function(t,e){return this.interpolateUsingSurfaceDistance(this._distance*t,e)},_.prototype.interpolateUsingSurfaceDistance=function(t,r){var a=this._constants,o=a.distanceRatio+t/a.b,i=Math.cos(2*o),u=Math.cos(4*o),s=Math.cos(6*o),E=Math.sin(2*o),l=Math.sin(4*o),f=Math.sin(6*o),_=Math.sin(8*o),R=o*o,h=o*R,T=a.u8Over256,A=a.u2Over4,d=a.u6Over64,S=a.u4Over16,m=2*h*T*i/3+o*(1-A+7*S/4-15*d/4+579*T/64-(S-15*d/4+187*T/16)*i-(5*d/4-115*T/16)*u-29*T*s/16)+(A/2-S+71*d/32-85*T/16)*E+(5*S/16-5*d/4+383*T/96)*l-R*((d-11*T/2)*E+5*T*l/2)+(29*d/96-29*T/16)*f+539*T*_/1536,N=Math.asin(Math.sin(m)*a.cosineAlpha),C=Math.atan(a.a/a.b*Math.tan(N));m-=a.sigma;var I=Math.cos(2*a.sigma+m),p=Math.sin(m),M=Math.cos(m),O=a.cosineU*M,g=a.sineU*p,y=Math.atan2(p*a.sineHeading,O-g*a.cosineHeading),F=y-c(a.f,a.sineAlpha,a.cosineSquaredAlpha,m,p,M,I);return n(r)?(r.longitude=this._start.longitude+F,r.latitude=C,r.height=0,r):new e(this._start.longitude+F,C,0)},_}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(t,e){"use strict";function r(t,r,n){var a=t+r;return e.sign(t)!==e.sign(r)&&Math.abs(a/Math.max(Math.abs(t),Math.abs(r)))<n?0:a}var n={};return n.computeDiscriminant=function(t,e,r){var n=e*e-4*t*r;return n},n.computeRealRoots=function(t,n,a){var o;if(0===t)return 0===n?[]:[-a/n];if(0===n){if(0===a)return[0,0];var i=Math.abs(a),u=Math.abs(t);if(i<u&&i/u<e.EPSILON14)return[0,0];if(i>u&&u/i<e.EPSILON14)return[];if(o=-a/t,o<0)return[];var s=Math.sqrt(o);return[-s,s]}if(0===a)return o=-n/t,o<0?[o,0]:[0,o];var E=n*n,c=4*t*a,l=r(E,-c,e.EPSILON14);if(l<0)return[];var f=-.5*r(n,e.sign(n)*Math.sqrt(l),e.EPSILON14);return n>0?[f/t,a/f]:[a/f,f/t]},n}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(t,e){"use strict";function r(t,e,r,n){var a,o,i=t,u=e/3,s=r/3,E=n,c=i*s,l=u*E,f=u*u,_=s*s,R=i*s-f,h=i*E-u*s,T=u*E-_,A=4*R*T-h*h;if(A<0){var d,S,m;f*l>=c*_?(d=i,S=R,m=-2*u*R+i*h):(d=E,S=T,m=-E*h+2*s*T);var N=m<0?-1:1,C=-N*Math.abs(d)*Math.sqrt(-A);o=-m+C;var I=o/2,p=I<0?-Math.pow(-I,1/3):Math.pow(I,1/3),M=o===C?-p:-S/p;return a=S<=0?p+M:-m/(p*p+M*M+S),f*l>=c*_?[(a-u)/i]:[-E/(a+s)]}var O=R,g=-2*u*R+i*h,y=T,F=-E*h+2*s*T,L=Math.sqrt(A),v=Math.sqrt(3)/2,U=Math.abs(Math.atan2(i*L,-g)/3);a=2*Math.sqrt(-O);var D=Math.cos(U);o=a*D;var P=a*(-D/2-v*Math.sin(U)),w=o+P>2*u?o-u:P-u,B=i,x=w/B;U=Math.abs(Math.atan2(E*L,-F)/3),a=2*Math.sqrt(-y),D=Math.cos(U),o=a*D,P=a*(-D/2-v*Math.sin(U));var b=-E,G=o+P<2*s?o+s:P+s,z=b/G,H=B*G,V=-w*G-B*b,q=w*b,X=(s*V-u*q)/(-u*V+s*H);return x<=X?x<=z?X<=z?[x,X,z]:[x,z,X]:[z,x,X]:x<=z?[X,x,z]:X<=z?[X,z,x]:[z,X,x]}var n={};return n.computeDiscriminant=function(t,e,r,n){var a=t*t,o=e*e,i=r*r,u=n*n,s=18*t*e*r*n+o*i-27*a*u-4*(t*i*r+o*e*n);return s},n.computeRealRoots=function(t,n,a,o){var i,u;if(0===t)return e.computeRealRoots(n,a,o);if(0===n){if(0===a){if(0===o)return[0,0,0];u=-o/t;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===o?(i=e.computeRealRoots(t,0,a),0===i.Length?[0]:[i[0],0,i[1]]):r(t,0,a,o)}return 0===a?0===o?(u=-n/t,u<0?[u,0,0]:[0,0,u]):r(t,n,0,o):0===o?(i=e.computeRealRoots(t,n,a),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(t,n,a,o)},n}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(t,e,r,n){"use strict";function a(e,a,o,i){var u=e*e,s=a-3*u/8,E=o-a*e/2+u*e/8,c=i-o*e/4+a*u/16-3*u*u/256,l=t.computeRealRoots(1,2*s,s*s-4*c,-E*E);if(l.length>0){var f=-e/4,_=l[l.length-1];if(Math.abs(_)<r.EPSILON14){var R=n.computeRealRoots(1,s,c);if(2===R.length){var h,T=R[0],A=R[1];if(T>=0&&A>=0){var d=Math.sqrt(T),S=Math.sqrt(A);return[f-S,f-d,f+d,f+S]}if(T>=0&&A<0)return h=Math.sqrt(T),[f-h,f+h];if(T<0&&A>=0)return h=Math.sqrt(A),[f-h,f+h]}return[]}if(_>0){var m=Math.sqrt(_),N=(s+_-E/m)/2,C=(s+_+E/m)/2,I=n.computeRealRoots(1,m,N),p=n.computeRealRoots(1,-m,C);return 0!==I.length?(I[0]+=f,I[1]+=f,0!==p.length?(p[0]+=f,p[1]+=f,I[1]<=p[0]?[I[0],I[1],p[0],p[1]]:p[1]<=I[0]?[p[0],p[1],I[0],I[1]]:I[0]>=p[0]&&I[1]<=p[1]?[p[0],I[0],I[1],p[1]]:p[0]>=I[0]&&p[1]<=I[1]?[I[0],p[0],p[1],I[1]]:I[0]>p[0]&&I[0]<p[1]?[p[0],I[0],p[1],I[1]]:[I[0],p[0],I[1],p[1]]):I):0!==p.length?(p[0]+=f,p[1]+=f,p):[]}}return[]}function o(e,a,o,i){var u=o*o,s=a*a,E=e*e,c=-2*a,l=o*e+s-4*i,f=E*i-o*a*e+u,_=t.computeRealRoots(1,c,l,f);if(_.length>0){var R,h,T=_[0],A=a-T,d=A*A,S=e/2,m=A/2,N=d-4*i,C=d+4*Math.abs(i),I=E-4*T,p=E+4*Math.abs(T);if(T<0||N*p<I*C){var M=Math.sqrt(I);R=M/2,h=0===M?0:(e*m-o)/M}else{var O=Math.sqrt(N);R=0===O?0:(e*m-o)/O,h=O/2}var g,y;0===S&&0===R?(g=0,y=0):r.sign(S)===r.sign(R)?(g=S+R,y=T/g):(y=S-R,g=T/y);var F,L;0===m&&0===h?(F=0,L=0):r.sign(m)===r.sign(h)?(F=m+h,L=i/F):(L=m-h,F=i/L);var v=n.computeRealRoots(1,g,F),U=n.computeRealRoots(1,y,L);if(0!==v.length)return 0!==U.length?v[1]<=U[0]?[v[0],v[1],U[0],U[1]]:U[1]<=v[0]?[U[0],U[1],v[0],v[1]]:v[0]>=U[0]&&v[1]<=U[1]?[U[0],v[0],v[1],U[1]]:U[0]>=v[0]&&U[1]<=v[1]?[v[0],U[0],U[1],v[1]]:v[0]>U[0]&&v[0]<U[1]?[U[0],v[0],U[1],v[1]]:[v[0],U[0],v[1],U[1]]:v;if(0!==U.length)return U}return[]}var i={};return i.computeDiscriminant=function(t,e,r,n,a){var o=t*t,i=o*t,u=e*e,s=u*e,E=r*r,c=E*r,l=n*n,f=l*n,_=a*a,R=_*a,h=u*E*l-4*s*f-4*t*c*l+18*t*e*r*f-27*o*l*l+256*i*R+a*(18*s*r*n-4*u*c+16*t*E*E-80*t*e*E*n-6*t*u*l+144*o*r*l)+_*(144*t*u*r-27*u*u-128*o*E-192*o*e*n);return h},i.computeRealRoots=function(e,n,i,u,s){if(Math.abs(e)<r.EPSILON15)return t.computeRealRoots(n,i,u,s);var E=n/e,c=i/e,l=u/e,f=s/e,_=E<0?1:0;switch(_+=c<0?_+1:_,_+=l<0?_+1:_,_+=f<0?_+1:_){case 0:return a(E,c,l,f);case 1:return o(E,c,l,f);case 2:return o(E,c,l,f);case 3:return a(E,c,l,f);case 4:return a(E,c,l,f);case 5:return o(E,c,l,f);case 6:return a(E,c,l,f);case 7:return a(E,c,l,f);case 8:return o(E,c,l,f);case 9:return a(E,c,l,f);case 10:return a(E,c,l,f);case 11:return o(E,c,l,f);case 12:return a(E,c,l,f);case 13:return a(E,c,l,f);case 14:return a(E,c,l,f);case 15:return a(E,c,l,f);default:return}},i}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(t,e,r,n){"use strict";function a(r,n){n=t.clone(e(n,t.ZERO)),t.equals(n,t.ZERO)||t.normalize(n,n),this.origin=t.clone(e(r,t.ZERO)),this.direction=n}return a.getPoint=function(e,n,a){return r(a)||(a=new t),a=t.multiplyByScalar(e.direction,n,a),t.add(e.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(t,e,r,n,a,o,i,u,s,E,c){"use strict";function l(t,e,r,n){var a=e*e-4*t*r;if(!(a<0)){if(a>0){var o=1/(2*t),i=Math.sqrt(a),u=(-e+i)*o,s=(-e-i)*o;return u<s?(n.root0=u,n.root1=s):(n.root0=s,n.root1=u),n}var E=-e/(2*t);if(0!==E)return n.root0=n.root1=E,n}}function f(e,r,a){n(a)||(a=new o);var i=e.origin,u=e.direction,s=r.center,E=r.radius*r.radius,c=t.subtract(i,s,d),f=t.dot(u,u),_=2*t.dot(u,c),R=t.magnitudeSquared(c)-E,h=l(f,_,R,C);if(n(h))return a.start=h.root0,a.stop=h.root1,a}function _(t,e,r){var n=t+e;return i.sign(t)!==i.sign(e)&&Math.abs(n/Math.max(Math.abs(t),Math.abs(e)))<r?0:n}function R(e,r,n,a,o){var c,l=a*a,f=o*o,R=(e[u.COLUMN1ROW1]-e[u.COLUMN2ROW2])*f,h=o*(a*_(e[u.COLUMN1ROW0],e[u.COLUMN0ROW1],i.EPSILON15)+r.y),T=e[u.COLUMN0ROW0]*l+e[u.COLUMN2ROW2]*f+a*r.x+n,A=f*_(e[u.COLUMN2ROW1],e[u.COLUMN1ROW2],i.EPSILON15),d=o*(a*_(e[u.COLUMN2ROW0],e[u.COLUMN0ROW2])+r.z),S=[];if(0===d&&0===A){if(c=s.computeRealRoots(R,h,T),0===c.length)return S;var m=c[0],N=Math.sqrt(Math.max(1-m*m,0));if(S.push(new t(a,o*m,o*-N)),S.push(new t(a,o*m,o*N)),2===c.length){var C=c[1],I=Math.sqrt(Math.max(1-C*C,0));S.push(new t(a,o*C,o*-I)),S.push(new t(a,o*C,o*I))}return S}var p=d*d,M=A*A,O=R*R,g=d*A,y=O+M,F=2*(h*R+g),L=2*T*R+h*h-M+p,v=2*(T*h-g),U=T*T-p;if(0===y&&0===F&&0===L&&0===v)return S;c=E.computeRealRoots(y,F,L,v,U);var D=c.length;if(0===D)return S;for(var P=0;P<D;++P){var w,B=c[P],x=B*B,b=Math.max(1-x,0),G=Math.sqrt(b);w=i.sign(R)===i.sign(T)?_(R*x+T,h*B,i.EPSILON12):i.sign(T)===i.sign(h*B)?_(R*x,h*B+T,i.EPSILON12):_(R*x+h*B,T,i.EPSILON12);var z=_(A*B,d,i.EPSILON15),H=w*z;H<0?S.push(new t(a,o*B,o*G)):H>0?S.push(new t(a,o*B,o*-G)):0!==G?(S.push(new t(a,o*B,o*-G)),S.push(new t(a,o*B,o*G)),++P):S.push(new t(a,o*B,o*G))}return S}var h={};h.rayPlane=function(e,r,a){n(a)||(a=new t);var o=e.origin,u=e.direction,s=r.normal,E=t.dot(s,u);if(!(Math.abs(E)<i.EPSILON15)){var c=(-r.distance-t.dot(s,o))/E;if(!(c<0))return a=t.multiplyByScalar(u,c,a),t.add(o,a,a)}};var T=new t,A=new t,d=new t,S=new t,m=new t;h.rayTriangleParametric=function(e,n,a,o,u){u=r(u,!1);var s,E,c,l,f,_=e.origin,R=e.direction,h=t.subtract(a,n,T),N=t.subtract(o,n,A),C=t.cross(R,N,d),I=t.dot(h,C);if(u){if(I<i.EPSILON6)return;if(s=t.subtract(_,n,S),c=t.dot(s,C),c<0||c>I)return;if(E=t.cross(s,h,m),l=t.dot(R,E),l<0||c+l>I)return;f=t.dot(N,E)/I}else{if(Math.abs(I)<i.EPSILON6)return;var p=1/I;if(s=t.subtract(_,n,S),c=t.dot(s,C)*p,c<0||c>1)return;if(E=t.cross(s,h,m),l=t.dot(R,E)*p,l<0||c+l>1)return;f=t.dot(N,E)*p}return f},h.rayTriangle=function(e,r,a,o,i,u){var s=h.rayTriangleParametric(e,r,a,o,i);if(n(s)&&!(s<0))return n(u)||(u=new t),t.multiplyByScalar(e.direction,s,u),t.add(e.origin,u,u)};var N=new c;h.lineSegmentTriangle=function(e,r,a,o,i,u,s){var E=N;t.clone(e,E.origin),t.subtract(r,e,E.direction),t.normalize(E.direction,E.direction);var c=h.rayTriangleParametric(E,a,o,i,u);if(!(!n(c)||c<0||c>t.distance(e,r)))return n(s)||(s=new t),t.multiplyByScalar(E.direction,c,s),t.add(E.origin,s,s)};var C={root0:0,root1:0};h.raySphere=function(t,e,r){if(r=f(t,e,r),n(r)&&!(r.stop<0))return r.start=Math.max(r.start,0),r};var I=new c;h.lineSegmentSphere=function(e,r,a,o){var i=I;t.clone(e,i.origin);var u=t.subtract(r,e,i.direction),s=t.magnitude(u);if(t.normalize(u,u),o=f(i,a,o),!(!n(o)||o.stop<0||o.start>s))return o.start=Math.max(o.start,0),o.stop=Math.min(o.stop,s),o};var p=new t,M=new t;h.rayEllipsoid=function(e,r){var n,a,i,u,s,E=r.oneOverRadii,c=t.multiplyComponents(E,e.origin,p),l=t.multiplyComponents(E,e.direction,M),f=t.magnitudeSquared(c),_=t.dot(c,l);if(f>1){if(_>=0)return;var R=_*_;if(n=f-1,a=t.magnitudeSquared(l),i=a*n,R<i)return;if(R>i){u=_*_-i,s=-_+Math.sqrt(u);var h=s/a,T=n/s;return h<T?new o(h,T):{start:T,stop:h}}var A=Math.sqrt(n/a);return new o(A,A)}return f<1?(n=f-1,a=t.magnitudeSquared(l),i=a*n,u=_*_-i,s=-_+Math.sqrt(u),new o(0,s/a)):_<0?(a=t.magnitudeSquared(l),new o(0,-_/a)):void 0};var O=new t,g=new t,y=new t,F=new t,L=new t,v=new u,U=new u,D=new u,P=new u,w=new u,B=new u,x=new u,b=new t,G=new t,z=new e;h.grazingAltitudeLocation=function(e,r){var a=e.origin,o=e.direction;if(!t.equals(a,t.ZERO)){var s=r.geodeticSurfaceNormal(a,O);if(t.dot(o,s)>=0)return a}var E=n(this.rayEllipsoid(e,r)),c=r.transformPositionToScaledSpace(o,O),l=t.normalize(c,c),f=t.mostOrthogonalAxis(c,F),_=t.normalize(t.cross(f,l,g),g),h=t.normalize(t.cross(l,_,y),y),T=v;T[0]=l.x,T[1]=l.y,T[2]=l.z,T[3]=_.x,T[4]=_.y,T[5]=_.z,T[6]=h.x,T[7]=h.y,T[8]=h.z;var A=u.transpose(T,U),d=u.fromScale(r.radii,D),S=u.fromScale(r.oneOverRadii,P),m=w;m[0]=0,m[1]=-o.z,m[2]=o.y,m[3]=o.z,m[4]=0,m[5]=-o.x,m[6]=-o.y,m[7]=o.x,m[8]=0;var N,C,I=u.multiply(u.multiply(A,S,B),m,B),p=u.multiply(u.multiply(I,d,x),T,x),M=u.multiplyByVector(I,a,L),H=R(p,t.negate(M,O),0,0,1),V=H.length;if(V>0){for(var q=t.clone(t.ZERO,G),X=Number.NEGATIVE_INFINITY,W=0;W<V;++W){N=u.multiplyByVector(d,u.multiplyByVector(T,H[W],b),b);var Y=t.normalize(t.subtract(N,a,F),F),K=t.dot(Y,o);K>X&&(X=K,q=t.clone(N,q))}var k=r.cartesianToCartographic(q,z);return X=i.clamp(X,0,1),C=t.magnitude(t.subtract(q,a,F))*Math.sqrt(1-X*X),C=E?-C:C,k.height=C,r.cartographicToCartesian(k,new t)}};var H=new t;return h.lineSegmentPlane=function(e,r,a,o){n(o)||(o=new t);var u=t.subtract(r,e,H),s=a.normal,E=t.dot(s,u);if(!(Math.abs(E)<i.EPSILON6)){var c=t.dot(s,e),l=-(a.distance+c)/E;if(!(l<0||l>1))return t.multiplyByScalar(u,l,o),t.add(e,o,o),o}},h.trianglePlaneIntersection=function(e,r,n,a){var o=a.normal,i=a.distance,u=t.dot(o,e)+i<0,s=t.dot(o,r)+i<0,E=t.dot(o,n)+i<0,c=0;c+=u?1:0,c+=s?1:0,c+=E?1:0;var l,f;if(1!==c&&2!==c||(l=new t,f=new t),1===c){if(u)return h.lineSegmentPlane(e,r,a,l),h.lineSegmentPlane(e,n,a,f),{positions:[e,r,n,l,f],indices:[0,3,4,1,2,4,1,4,3]};if(s)return h.lineSegmentPlane(r,n,a,l),h.lineSegmentPlane(r,e,a,f),{positions:[e,r,n,l,f],indices:[1,3,4,2,0,4,2,4,3]};if(E)return h.lineSegmentPlane(n,e,a,l),h.lineSegmentPlane(n,r,a,f),{positions:[e,r,n,l,f],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===c){if(!u)return h.lineSegmentPlane(r,e,a,l),h.lineSegmentPlane(n,e,a,f),{positions:[e,r,n,l,f],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return h.lineSegmentPlane(n,r,a,l),h.lineSegmentPlane(e,r,a,f),{positions:[e,r,n,l,f],indices:[2,0,4,2,4,3,1,3,4]};if(!E)return h.lineSegmentPlane(e,n,a,l),h.lineSegmentPlane(r,n,a,f),{positions:[e,r,n,l,f],indices:[0,1,4,0,4,3,2,3,4]}}},h}),define("Core/isArray",["./defined"],function(t){"use strict";var e=Array.isArray;return t(e)||(e=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),e}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(t,e,r,n){"use strict";function a(e,r){this.normal=t.clone(e),this.distance=r}a.fromPointNormal=function(r,n,o){var i=-t.dot(n,r);return e(o)?(t.clone(n,o.normal),o.distance=i,o):new a(n,i)};var o=new t;return a.fromCartesian4=function(r,n){var i=t.fromCartesian4(r,o),u=r.w;return e(n)?(t.clone(i,n.normal),n.distance=u,n):new a(i,u)},a.getPointDistance=function(e,r){return t.dot(e.normal,r)+e.distance},a.ORIGIN_XY_PLANE=n(new a(t.UNIT_Z,0)),a.ORIGIN_YZ_PLANE=n(new a(t.UNIT_X,0)),a.ORIGIN_ZX_PLANE=n(new a(t.UNIT_Y,0)),a}),define("Core/PolylinePipeline",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidGeodesic","./IntersectionTests","./isArray","./Math","./Matrix4","./Plane"],function(t,e,r,n,a,o,i,u,s,E,c,l){"use strict";function f(t,e,r){var n=p;n.length=t;var a;if(e===r){for(a=0;a<t;a++)n[a]=e;return n}var o=r-e,i=o/t;for(a=0;a<t;a++){var u=e+a*i;n[a]=u}return n}function _(e,r,n,a,o,i,u,s){var E=a.scaleToGeodeticSurface(e,y),c=a.scaleToGeodeticSurface(r,F),l=R.numberOfPoints(e,r,n),_=a.cartesianToCartographic(E,M),h=a.cartesianToCartographic(c,O),T=f(l,o,i);L.setEndPoints(_,h);var A=L.surfaceDistance/l,d=s;_.height=o;var S=a.cartographicToCartesian(_,g);t.pack(S,u,d),d+=3;for(var m=1;m<l;m++){var N=L.interpolateUsingSurfaceDistance(m*A,O);N.height=T[m],S=a.cartographicToCartesian(N,g),t.pack(S,u,d),d+=3}return d}var R={};R.numberOfPoints=function(e,r,n){var a=t.distance(e,r);return Math.ceil(a/n)};var h=new e;R.extractHeights=function(t,e){for(var r=t.length,n=new Array(r),a=0;a<r;a++){var o=t[a];n[a]=e.cartesianToCartographic(o,h).height}return n};var T=new c,A=new t,d=new t,S=new l(t.ZERO,0),m=new t,N=new l(t.ZERO,0),C=new t,I=new t,p=[],M=new e,O=new e,g=new t,y=new t,F=new t,L=new i;return R.wrapLongitude=function(e,a){var o=[],i=[];if(n(e)&&e.length>0){a=r(a,c.IDENTITY);var s=c.inverseTransformation(a,T),E=c.multiplyByPoint(s,t.ZERO,A),f=c.multiplyByPointAsVector(s,t.UNIT_Y,d),_=l.fromPointNormal(E,f,S),R=c.multiplyByPointAsVector(s,t.UNIT_X,m),h=l.fromPointNormal(E,R,N),p=1;o.push(t.clone(e[0]));for(var M=o[0],O=e.length,g=1;g<O;++g){var y=e[g];if(l.getPointDistance(h,M)<0||l.getPointDistance(h,y)<0){var F=u.lineSegmentPlane(M,y,_,C);if(n(F)){var L=t.multiplyByScalar(f,5e-9,I);l.getPointDistance(_,M)<0&&t.negate(L,L),o.push(t.add(F,L,new t)),i.push(p+1),t.negate(L,L),o.push(t.add(F,L,new t)),p=1}}o.push(t.clone(e[g])),p++,M=y}i.push(p)}return{positions:o,lengths:i}},R.generateArc=function(e){n(e)||(e={});var a=e.positions,i=a.length,u=r(e.ellipsoid,o.WGS84),c=r(e.height,0),l=s(c);if(i<1)return[];if(1===i){var f=u.scaleToGeodeticSurface(a[0],y);if(c=l?c[0]:c,0!==c){var h=u.geodeticSurfaceNormal(f,g);t.multiplyByScalar(h,c,h),t.add(f,h,f)}return[f.x,f.y,f.z]}var T=e.minDistance;if(!n(T)){var A=r(e.granularity,E.RADIANS_PER_DEGREE);T=E.chordLength(A,u.maximumRadius)}var d,S=0;for(d=0;d<i-1;d++)S+=R.numberOfPoints(a[d],a[d+1],T);var m=3*(S+1),N=new Array(m),C=0;for(d=0;d<i-1;d++){var I=a[d],O=a[d+1],F=l?c[d]:c,L=l?c[d+1]:c;C=_(I,O,T,u,F,L,N,C)}p.length=0;var v=a[i-1],U=u.cartesianToCartographic(v,M);U.height=l?c[i-1]:c;var D=u.cartographicToCartesian(U,g);return t.pack(D,N,m-3),N},R.generateCartesianArc=function(e){for(var r=R.generateArc(e),n=r.length/3,a=new Array(n),o=0;o<n;o++)a[o]=t.unpack(r,3*o);return a},R}),define("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(t,e,r,n){"use strict";function a(e){e=t(e,t.EMPTY_OBJECT),this.position=t(e.position,!1),this.normal=t(e.normal,!1),this.st=t(e.st,!1),this.bitangent=t(e.bitangent,!1),this.tangent=t(e.tangent,!1),this.color=t(e.color,!1)}return a.POSITION_ONLY=n(new a({position:!0})),a.POSITION_AND_NORMAL=n(new a({position:!0,normal:!0})),a.POSITION_NORMAL_AND_ST=n(new a({position:!0,normal:!0,st:!0})),a.POSITION_AND_ST=n(new a({position:!0,st:!0})),a.POSITION_AND_COLOR=n(new a({position:!0,color:!0})),a.ALL=n(new a({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0})),a.DEFAULT=a.POSITION_NORMAL_AND_ST,a.packedLength=6,a.pack=function(e,r,n){return n=t(n,0),r[n++]=e.position?1:0,r[n++]=e.normal?1:0,r[n++]=e.st?1:0,r[n++]=e.tangent?1:0,r[n++]=e.bitangent?1:0,r[n++]=e.color?1:0,r},a.unpack=function(r,n,o){return n=t(n,0),e(o)||(o=new a),o.position=1===r[n++],o.normal=1===r[n++],o.st=1===r[n++],o.tangent=1===r[n++],o.bitangent=1===r[n++],o.color=1===r[n++],o},a.clone=function(t,r){if(e(t))return e(r)||(r=new a),r.position=t.position,r.normal=t.normal,r.st=t.st,r.tangent=t.tangent,r.bitangent=t.bitangent,r.color=t.color,r},a}),define("Core/PolylineGeometry",["./arrayRemoveDuplicates","./BoundingSphere","./Cartesian3","./Color","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryType","./IndexDatatype","./Math","./PolylinePipeline","./PrimitiveType","./VertexFormat"],function(t,e,r,n,a,o,i,u,s,E,c,l,f,_,R,h,T,A){"use strict";function d(t,e,r,a,o){var i=m;i.length=o;var u,s=r.red,E=r.green,c=r.blue,l=r.alpha,f=a.red,_=a.green,R=a.blue,h=a.alpha;if(n.equals(r,a)){for(u=0;u<o;u++)i[u]=n.clone(r);return i}var T=(f-s)/o,A=(_-E)/o,d=(R-c)/o,S=(h-l)/o;for(u=0;u<o;u++)i[u]=new n(s+u*T,E+u*A,c+u*d,l+u*S);return i}function S(t){t=o(t,o.EMPTY_OBJECT);var e=t.positions,a=t.colors,u=o(t.width,1),E=o(t.colorsPerVertex,!1);this._positions=e,this._colors=a,this._width=u,this._colorsPerVertex=E,this._vertexFormat=A.clone(o(t.vertexFormat,A.DEFAULT)),this._followSurface=o(t.followSurface,!0),this._granularity=o(t.granularity,R.RADIANS_PER_DEGREE),this._ellipsoid=s.clone(o(t.ellipsoid,s.WGS84)),this._workerName="createPolylineGeometry";var c=1+e.length*r.packedLength;c+=i(a)?1+a.length*n.packedLength:1,this.packedLength=c+s.packedLength+A.packedLength+4}var m=[];S.pack=function(t,e,a){a=o(a,0);var u,E=t._positions,c=E.length;for(e[a++]=c,u=0;u<c;++u,a+=r.packedLength)r.pack(E[u],e,a);var l=t._colors;for(c=i(l)?l.length:0,e[a++]=c,u=0;u<c;++u,a+=n.packedLength)n.pack(l[u],e,a);return s.pack(t._ellipsoid,e,a),a+=s.packedLength,A.pack(t._vertexFormat,e,a),a+=A.packedLength,e[a++]=t._width,e[a++]=t._colorsPerVertex?1:0,e[a++]=t._followSurface?1:0,e[a]=t._granularity,e};var N=s.clone(s.UNIT_SPHERE),C=new A,I={positions:void 0,colors:void 0,ellipsoid:N,vertexFormat:C,width:void 0,colorsPerVertex:void 0,followSurface:void 0,granularity:void 0};S.unpack=function(t,e,a){e=o(e,0);var u,E=t[e++],c=new Array(E);for(u=0;u<E;++u,e+=r.packedLength)c[u]=r.unpack(t,e);E=t[e++];var l=E>0?new Array(E):void 0;for(u=0;u<E;++u,e+=n.packedLength)l[u]=n.unpack(t,e);var f=s.unpack(t,e,N);e+=s.packedLength;var _=A.unpack(t,e,C);e+=A.packedLength;var R=t[e++],h=1===t[e++],T=1===t[e++],d=t[e];return i(a)?(a._positions=c,a._colors=l,a._ellipsoid=s.clone(f,a._ellipsoid),a._vertexFormat=A.clone(_,a._vertexFormat),a._width=R,a._colorsPerVertex=h,a._followSurface=T,a._granularity=d,a):(I.positions=c,I.colors=l,I.width=R,I.colorsPerVertex=h,I.followSurface=T,I.granularity=d,new S(I))};var p=new r,M=new r,O=new r,g=new r;return S.createGeometry=function(o){var u,s,A,S=o._width,N=o._vertexFormat,C=o._colors,I=o._colorsPerVertex,y=o._followSurface,F=o._granularity,L=o._ellipsoid,v=t(o._positions,r.equalsEpsilon),U=v.length;if(!(U<2||S<=0)){if(y){var D=h.extractHeights(v,L),P=R.chordLength(F,L.maximumRadius);if(i(C)){var w=1;for(u=0;u<U-1;++u)w+=h.numberOfPoints(v[u],v[u+1],P);var B=new Array(w),x=0;for(u=0;u<U-1;++u){var b=v[u],G=v[u+1],z=C[u],H=h.numberOfPoints(b,G,P);if(I&&u<w){var V=C[u+1],q=d(b,G,z,V,H),X=q.length;for(s=0;s<X;++s)B[x++]=q[s]}else for(s=0;s<H;++s)B[x++]=n.clone(z)}B[x]=n.clone(C[C.length-1]),C=B,m.length=0}v=h.generateCartesianArc({positions:v,minDistance:P,ellipsoid:L,height:D})}U=v.length;var W,Y=4*U-4,K=new Float64Array(3*Y),k=new Float64Array(3*Y),Z=new Float64Array(3*Y),j=new Float32Array(2*Y),Q=N.st?new Float32Array(2*Y):void 0,J=i(C)?new Uint8Array(4*Y):void 0,$=0,tt=0,et=0,rt=0;for(s=0;s<U;++s){0===s?(W=p,r.subtract(v[0],v[1],W),r.add(v[0],W,W)):W=v[s-1],r.clone(W,O),r.clone(v[s],M),s===U-1?(W=p,r.subtract(v[U-1],v[U-2],W),r.add(v[U-1],W,W)):W=v[s+1],r.clone(W,g);var nt,at;i(J)&&(nt=0===s||I?C[s]:C[s-1],s!==U-1&&(at=C[s]));var ot=0===s?2:0,it=s===U-1?2:4;for(A=ot;A<it;++A){r.pack(M,K,$),r.pack(O,k,$),r.pack(g,Z,$),$+=3;var ut=A-2<0?-1:1;if(j[tt++]=2*(A%2)-1,j[tt++]=ut*S,N.st&&(Q[et++]=s/(U-1),Q[et++]=Math.max(j[tt-2],0)),i(J)){var st=A<2?nt:at;J[rt++]=n.floatToByte(st.red),J[rt++]=n.floatToByte(st.green),J[rt++]=n.floatToByte(st.blue),J[rt++]=n.floatToByte(st.alpha)}}}var Et=new l;Et.position=new c({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:K}),Et.prevPosition=new c({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:k}),Et.nextPosition=new c({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:Z}),Et.expandAndWidth=new c({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:j}),N.st&&(Et.st=new c({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:Q})),i(J)&&(Et.color=new c({componentDatatype:a.UNSIGNED_BYTE,componentsPerAttribute:4,values:J,normalize:!0}));var ct=_.createTypedArray(Y,6*U-6),lt=0,ft=0,_t=U-1;for(s=0;s<_t;++s)ct[ft++]=lt,ct[ft++]=lt+2,ct[ft++]=lt+1,ct[ft++]=lt+1,ct[ft++]=lt+2,ct[ft++]=lt+3,lt+=4;return new E({attributes:Et,indices:ct,primitiveType:T.TRIANGLES,boundingSphere:e.fromPoints(v),geometryType:f.POLYLINES})}},S}),define("Workers/createPolylineGeometry",["../Core/defined","../Core/Ellipsoid","../Core/PolylineGeometry"],function(t,e,r){"use strict";function n(n,a){return t(a)&&(n=r.unpack(n,a)),n._ellipsoid=e.clone(n._ellipsoid),r.createGeometry(n)}return n})}(); \ No newline at end of file diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createPolylineVolumeGeometry.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createPolylineVolumeGeometry.js index 6a94a57f..c22f776f 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createPolylineVolumeGeometry.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createPolylineVolumeGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -222,10 +222,10 @@ OTHER DEALINGS IN THE SOFTWARE. * */ -!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==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";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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("Core/isArray",["./defined"],function(e){"use strict";var t=Array.isArray;return e(t)||(t=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),t}),define("Core/Check",["./defaultValue","./defined","./DeveloperError","./isArray"],function(e,t,n,r){"use strict";function a(e){return e+" was required but undefined."}function i(e,t,n){return"Expected "+n+" to be typeof "+t+", got "+e}var o={};return o.typeOf={},o.numeric={},o.defined=function(e,r){if(!t(e))throw new n(a(r))},o.numeric.maximum=function(e,t){if(o.typeOf.number(e),o.typeOf.number(t),e>t)throw new n("Expected "+e+" to be at most "+t)},o.numeric.minimum=function(e,t){if(o.typeOf.number(e),o.typeOf.number(t),e<t)throw new n("Expected "+e+" to be at least "+t)},o.typeOf.function=function(e,t){if("function"!=typeof e)throw new n(i(typeof e,"function",t))},o.typeOf.string=function(e,t){if("string"!=typeof e)throw new n(i(typeof e,"string",t))},o.typeOf.number=function(e,t){if("number"!=typeof e)throw new n(i(typeof e,"number",t))},o.typeOf.object=function(e,t){if("object"!=typeof e)throw new n(i(typeof e,"object",t))},o.typeOf.boolean=function(e,t){if("boolean"!=typeof e)throw new n(i(typeof e,"boolean",t))},o}),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 n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(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^=e<<7&2636928640,e^=e<<15&4022730752,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,n,r){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:e<0?-1:0},a.signNotZero=function(e){return e<0?-1:1},a.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*a.clamp(e,-1,1)+.5)*n)},a.fromSNorm=function(e,n){return n=t(n,255),a.clamp(e,0,n)/n*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},a.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},a.lerp=function(e,t,n){return(1-n)*e+n*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){var t=a.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},a.clampToLatitudeRange=function(e){return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){return(e%t+t)%t},a.equalsEpsilon=function(e,n,r,a){a=t(a,r);var i=Math.abs(e-n);return i<=a||i<=r*Math.max(Math.abs(e),Math.abs(n))};var i=[1];a.factorial=function(e){var t=i.length;if(e>=t)for(var n=i[t-1],r=t;r<=e;r++)i.push(n*r);return i[e]},a.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},a.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return a.setRandomNumberSeed=function(t){o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(e){return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){return Math.log(e)/Math.log(t)},a.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var a=e.clock,i=e.cone,u=t(e.magnitude,1),s=u*Math.sin(i);return r.x=s*Math.cos(a),r.y=s*Math.sin(a),r.z=u*Math.cos(i),r},o.fromElements=function(e,t,r,a){return n(a)?(a.x=e,a.y=t,a.z=r,a):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var a=0;a<r;++a)o.pack(e[a],t,3*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var a=0;a<r;a+=3){var i=a/3;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,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};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var n=o.dot(c,l),r=o.magnitude(o.cross(c,l,c));return Math.atan2(r,n)};var f=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)},o.cross=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=t.x,u=t.y,s=t.z,c=a*s-i*u,l=i*o-r*s,f=r*u-a*o;return n.x=c,n.y=l,n.z=f,n},o.fromDegrees=function(e,t,n,r,a){return e=i.toRadians(e),t=i.toRadians(t),o.fromRadians(e,t,n,r,a)};var h=new o,d=new o,p=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,a,i,u){a=t(a,0);var s=n(i)?i.radiiSquared:p,c=Math.cos(r);h.x=c*Math.cos(e),h.y=c*Math.sin(e),h.z=Math.sin(r),h=o.normalize(h,h),o.multiplyComponents(s,h,d);var l=Math.sqrt(o.dot(h,d));return d=o.divideByScalar(d,l,d),h=o.multiplyByScalar(h,a,h),n(u)||(u=new o),o.add(d,h,u)},o.fromDegreesArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromDegrees(u,s,0,t,r[c])}return r},o.fromRadiansArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromRadians(u,s,0,t,r[c])}return r},o.fromDegreesArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromDegrees(u,s,c,t,r[l])}return r},o.fromRadiansArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromRadians(u,s,c,t,r[l])}return r},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(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,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(n,a,u,s,c){var l=n.x,f=n.y,h=n.z,d=a.x,p=a.y,E=a.z,y=l*l*d*d,m=f*f*p*p,_=h*h*E*E,v=y+m+_,T=Math.sqrt(1/v),R=e.multiplyByScalar(n,T,i);if(v<s)return isFinite(T)?e.clone(R,c):void 0;var A=u.x,S=u.y,g=u.z,N=o;N.x=R.x*A*2,N.y=R.y*S*2,N.z=R.z*g*2;var x,I,O,w,M,C,P,D,U,L,b,F=(1-T)*e.magnitude(n)/(.5*e.magnitude(N)),z=0;do{F-=z,O=1/(1+F*A),w=1/(1+F*S),M=1/(1+F*g),C=O*O,P=w*w,D=M*M,U=C*O,L=P*w,b=D*M,x=y*C+m*P+_*D-1,I=y*U*A+m*L*S+_*b*g;var B=-2*I;z=x/B}while(Math.abs(x)>r.EPSILON12);return t(c)?(c.x=l*O,c.y=f*w,c.z=h*M,c):new e(l*O,f*w,h*M)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o){"use strict";function u(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)}u.fromRadians=function(e,r,a,i){return a=t(a,0),n(i)?(i.longitude=e,i.latitude=r,i.height=a,i):new u(e,r,a)},u.fromDegrees=function(e,t,n,r){return e=i.toRadians(e),t=i.toRadians(t),u.fromRadians(e,t,n,r)};var s=new e,c=new e,l=new e,f=new e(1/6378137,1/6378137,1/6356752.314245179),h=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),d=i.EPSILON1;return u.fromCartesian=function(t,r,a){var p=n(r)?r.oneOverRadii:f,E=n(r)?r.oneOverRadiiSquared:h,y=n(r)?r._centerToleranceSquared:d,m=o(t,p,E,y,c);if(n(m)){var _=e.multiplyComponents(m,E,s);_=e.normalize(_,_);var v=e.subtract(t,m,l),T=Math.atan2(_.y,_.x),R=Math.asin(_.z),A=i.sign(e.dot(v,t))*e.magnitude(v);return n(a)?(a.longitude=T,a.latitude=R,a.height=A,a):new u(T,R,A)}},u.clone=function(e,t){if(n(e))return n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},u.ZERO=a(new u(0,0,0)),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,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(t,r,a,i){r=n(r,0),a=n(a,0),i=n(i,0),t._radii=new e(r,a,i),t._radiiSquared=new e(r*r,a*a,i*i),t._radiiToTheFourth=new e(r*r*r*r,a*a*a*a,i*i*i*i),t._oneOverRadii=new e(0===r?0:1/r,0===a?0:1/a,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===a?0:1/(a*a),0===i?0:1/(i*i)),t._minimumRadius=Math.min(r,a,i),t._maximumRadius=Math.max(r,a,i),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,c(this,e,t,n)}a(l.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}}}),l.clone=function(t,n){if(r(t)){var a=t._radii;return r(n)?(e.clone(a,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new l(a.x,a.y,a.z)}},l.fromCartesian3=function(e,t){return r(t)||(t=new l),r(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,r,a){return a=n(a,0),e.pack(t._radii,r,a),r},l.unpack=function(t,r,a){r=n(r,0);var i=e.unpack(t,r);return l.fromCartesian3(i,a)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,n){var a=t.longitude,i=t.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return r(n)||(n=new e),n.x=u,n.y=s,n.z=c,e.normalize(n,n)},l.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var f=new e,h=new e;l.prototype.cartographicToCartesian=function(t,n){var a=f,i=h;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(e.dot(a,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(a,t.height,a),r(n)||(n=new e),e.add(i,a,n)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var d=new e,p=new e,E=new e;return l.prototype.cartesianToCartographic=function(n,a){var i=this.scaleToGeodeticSurface(n,p);if(r(i)){var o=this.geodeticSurfaceNormal(i,d),s=e.subtract(n,i,E),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),f=u.sign(e.dot(s,n))*e.magnitude(s);return r(a)?(a.longitude=c,a.latitude=l,a.height=f,a):new t(c,l,f)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var a=t.x,i=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return e.multiplyByScalar(t,s,n)},l.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},l.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},l.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,a,i){a=n(a,0);var o=this._sqauredXOverSquaredZ;if(r(i)||(i=new e),i.x=0,i.y=0,i.z=t.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},l}),define("Core/arrayRemoveDuplicates",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(n,r,a){if(t(n)){a=e(a,!1);var o=n.length;if(o<2)return n;var u,s,c;for(u=1;u<o&&(s=n[u-1],c=n[u],!r(s,c,i));++u);if(u===o)return a&&r(n[0],n[n.length-1],i)?n.slice(1):n;for(var l=n.slice(0,u);u<o;++u)c=n[u],r(s,c,i)||(l.push(c),s=c);return a&&l.length>1&&r(l[0],l[l.length-1],i)&&l.shift(),l}}var i=r.EPSILON10;return a}),define("Core/Cartesian2",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a){"use strict";function i(t,n){this.x=e(t,0),this.y=e(n,0)}i.fromElements=function(e,n,r){return t(r)?(r.x=e,r.y=n,r):new i(e,n)},i.clone=function(e,n){if(t(e))return t(n)?(n.x=e.x,n.y=e.y,n):new i(e.x,e.y)},i.fromCartesian3=i.clone,i.fromCartesian4=i.clone,i.packedLength=2,i.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r]=t.y,n},i.unpack=function(n,r,a){return r=e(r,0),t(a)||(a=new i),a.x=n[r++],a.y=n[r],a},i.packArray=function(e,n){var r=e.length;t(n)?n.length=2*r:n=new Array(2*r);for(var a=0;a<r;++a)i.pack(e[a],n,2*a);return n},i.unpackArray=function(e,n){var r=e.length;t(n)?n.length=r/2:n=new Array(r/2);for(var a=0;a<r;a+=2){var o=a/2;n[o]=i.unpack(e,a,n[o])}return n},i.fromArray=i.unpack,i.maximumComponent=function(e){return Math.max(e.x,e.y)},i.minimumComponent=function(e){return Math.min(e.x,e.y)},i.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},i.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},i.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},i.magnitude=function(e){return Math.sqrt(i.magnitudeSquared(e))};var o=new i;i.distance=function(e,t){return i.subtract(e,t,o),i.magnitude(o)},i.distanceSquared=function(e,t){return i.subtract(e,t,o),i.magnitudeSquared(o)},i.normalize=function(e,t){var n=i.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t},i.dot=function(e,t){return e.x*t.x+e.y*t.y},i.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n},i.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n},i.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n},i.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n},i.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n},i.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n},i.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},i.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var u=new i;i.lerp=function(e,t,n,r){return i.multiplyByScalar(t,n,u),r=i.multiplyByScalar(e,1-n,r),i.add(u,r,r)};var s=new i,c=new i;i.angleBetween=function(e,t){return i.normalize(e,s),i.normalize(t,c),a.acosClamped(i.dot(s,c))};var l=new i;return i.mostOrthogonalAxis=function(e,t){var n=i.normalize(e,l);return i.abs(n,n),t=n.x<=n.y?i.clone(i.UNIT_X,t):i.clone(i.UNIT_Y,t)},i.equals=function(e,n){return e===n||t(e)&&t(n)&&e.x===n.x&&e.y===n.y},i.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},i.equalsEpsilon=function(e,n,r,i){return e===n||t(e)&&t(n)&&a.equalsEpsilon(e.x,n.x,r,i)&&a.equalsEpsilon(e.y,n.y,r,i)},i.ZERO=r(new i(0,0)),i.UNIT_X=r(new i(1,0)),i.UNIT_Y=r(new i(0,1)),i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i.prototype.equalsEpsilon=function(e,t,n){return i.equalsEpsilon(this,e,t,n)},i.prototype.toString=function(){return"("+this.x+", "+this.y+")"},i}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,a,i,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return r(n)?(n.x=i,n.y=o,n.z=u,n):new e(i,o,u)},u.prototype.unproject=function(e,n){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,u=e.z;return r(n)?(n.longitude=i,n.latitude=o,n.height=u,n):new t(i,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/Rectangle",["./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,n,r,a){this.west=t(e,0),this.south=t(n,0),this.east=t(r,0),this.north=t(a,0)}r(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,n,r){return r=t(r,0),n[r++]=e.west,n[r++]=e.south,n[r++]=e.east,n[r]=e.north,n},s.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new s),a.west=e[r++],a.south=e[r++],a.east=e[r++],a.north=e[r],a},s.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=u.TWO_PI),t-n},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,r,a,i,o){return e=u.toRadians(t(e,0)),r=u.toRadians(t(r,0)),a=u.toRadians(t(a,0)),i=u.toRadians(t(i,0)),n(o)?(o.west=e,o.south=r,o.east=a,o.north=i,o):new s(e,r,a,i)},s.fromCartographicArray=function(e,t){for(var r=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE,f=0,h=e.length;f<h;f++){var d=e[f];r=Math.min(r,d.longitude),a=Math.max(a,d.longitude),c=Math.min(c,d.latitude),l=Math.max(l,d.latitude);var p=d.longitude>=0?d.longitude:d.longitude+u.TWO_PI;i=Math.min(i,p),o=Math.max(o,p)}return a-r>o-i&&(r=i,a=o,a>u.PI&&(a-=u.TWO_PI),r>u.PI&&(r-=u.TWO_PI)),n(t)?(t.west=r,t.south=c,t.east=a,t.north=l,t):new s(r,c,a,l)},s.fromCartesianArray=function(e,t,r){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=Number.MAX_VALUE,f=-Number.MAX_VALUE,h=0,d=e.length;h<d;h++){var p=t.cartesianToCartographic(e[h]);a=Math.min(a,p.longitude),i=Math.max(i,p.longitude),l=Math.min(l,p.latitude),f=Math.max(f,p.latitude);var E=p.longitude>=0?p.longitude:p.longitude+u.TWO_PI;o=Math.min(o,E),c=Math.max(c,E)}return i-a>c-o&&(a=o,i=c,i>u.PI&&(i-=u.TWO_PI),a>u.PI&&(a-=u.TWO_PI)),n(r)?(r.west=a,r.south=l,r.east=i,r.north=f,r):new s(a,l,i,f)},s.clone=function(e,t){if(n(e))return n(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,t){return e===t||n(e)&&n(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},s.prototype.equalsEpsilon=function(e,t){return n(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},s.validate=function(e){},s.southwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.south,r.height=0,r):new e(t.west,t.south)},s.northwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.north,r.height=0,r):new e(t.west,t.north)},s.northeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.north,r.height=0,r):new e(t.east,t.north)},s.southeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.south,r.height=0,r):new e(t.east,t.south)},s.center=function(t,r){var a=t.east,i=t.west;a<i&&(a+=u.TWO_PI);var o=u.negativePiToPi(.5*(i+a)),s=.5*(t.south+t.north);return n(r)?(r.longitude=o,r.latitude=s,r.height=0,r):new e(o,s)},s.intersection=function(e,t,r){var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.negativePiToPi(Math.max(i,c)),f=u.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&f<=l)){var h=Math.max(e.south,t.south),d=Math.min(e.north,t.north);if(!(h>=d))return n(r)?(r.west=l,r.south=h,r.east=f,r.north=d,r):new s(l,h,f,d)}},s.simpleIntersection=function(e,t,r){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(i>=u||a>=o))return n(r)?(r.west=a,r.south=i,r.east=o,r.north=u,r):new s(a,i,o,u)},s.union=function(e,t,r){n(r)||(r=new s);var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.convertLongitudeRange(Math.min(i,c)),f=u.convertLongitudeRange(Math.max(a,o));return r.west=l,r.south=Math.min(e.south,t.south),r.east=f,r.north=Math.max(e.north,t.north),r},s.expand=function(e,t,r){return n(r)||(r=new s),r.west=Math.min(e.west,t.longitude),r.south=Math.min(e.south,t.latitude),r.east=Math.max(e.east,t.longitude),r.north=Math.max(e.north,t.latitude),r},s.contains=function(e,t){var n=t.longitude,r=t.latitude,a=e.west,i=e.east;return i<a&&(i+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>a||u.equalsEpsilon(n,a,u.EPSILON14))&&(n<i||u.equalsEpsilon(n,i,u.EPSILON14))&&r>=e.south&&r<=e.north};var c=new e;return s.subsample=function(e,r,a,o){r=t(r,i.WGS84),a=t(a,0),n(o)||(o=[]);var l=0,f=e.north,h=e.south,d=e.east,p=e.west,E=c;E.height=a,E.longitude=p,E.latitude=f,o[l]=r.cartographicToCartesian(E,o[l]),l++,E.longitude=d,o[l]=r.cartographicToCartesian(E,o[l]),l++,E.latitude=h,o[l]=r.cartographicToCartesian(E,o[l]),l++,E.longitude=p,o[l]=r.cartographicToCartesian(E,o[l]),l++,f<0?E.latitude=f:h>0?E.latitude=h:E.latitude=0;for(var y=1;y<8;++y)E.longitude=-Math.PI+y*u.PI_OVER_TWO,s.contains(e,E)&&(o[l]=r.cartographicToCartesian(E,o[l]),l++);return 0===E.latitude&&(E.longitude=p,o[l]=r.cartographicToCartesian(E,o[l]),l++,E.longitude=d,o[l]=r.cartographicToCartesian(E,o[l]),l++),o.length=l,o},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingRectangle",["./Cartesian2","./Cartographic","./defaultValue","./defined","./DeveloperError","./GeographicProjection","./Intersect","./Rectangle"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a){this.x=n(e,0),this.y=n(t,0),this.width=n(r,0),this.height=n(a,0)}s.packedLength=4,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e.x,t[r++]=e.y,t[r++]=e.width,t[r]=e.height,t},s.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a.x=e[t++],a.y=e[t++],a.width=e[t++],a.height=e[t],a},s.fromPoints=function(e,t){if(r(t)||(t=new s),!r(e)||0===e.length)return t.x=0,t.y=0,t.width=0,t.height=0,t;for(var n=e.length,a=e[0].x,i=e[0].y,o=e[0].x,u=e[0].y,c=1;c<n;c++){var l=e[c],f=l.x,h=l.y;a=Math.min(f,a),o=Math.max(f,o),i=Math.min(h,i),u=Math.max(h,u)}return t.x=a,t.y=i,t.width=o-a,t.height=u-i,t};var c=new i,l=new t,f=new t;return s.fromRectangle=function(t,a,i){if(r(i)||(i=new s),!r(t))return i.x=0,i.y=0,i.width=0,i.height=0,i;a=n(a,c);var o=a.project(u.southwest(t,l)),h=a.project(u.northeast(t,f));return e.subtract(h,o,h),i.x=o.x,i.y=o.y,i.width=h.x,i.height=h.y,i},s.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t):new s(e.x,e.y,e.width,e.height)},s.union=function(e,t,n){r(n)||(n=new s);var a=Math.min(e.x,t.x),i=Math.min(e.y,t.y),o=Math.max(e.x+e.width,t.x+t.width),u=Math.max(e.y+e.height,t.y+t.height);return n.x=a,n.y=i,n.width=o-a,n.height=u-i,n},s.expand=function(e,t,n){n=s.clone(e,n);var r=t.x-n.x,a=t.y-n.y;return r>n.width?n.width=r:r<0&&(n.width-=r,n.x=t.x),a>n.height?n.height=a:a<0&&(n.height-=a,n.y=t.y),n},s.intersect=function(e,t){var n=e.x,r=e.y,a=t.x,i=t.y;return n>a+t.width||n+e.width<a||r+e.height<i||r>i+t.height?o.OUTSIDE:o.INTERSECTING},s.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.intersect=function(e){return s.intersect(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i,o){"use strict";function u(e,n,r,a,i,o,u,s,c){this[0]=t(e,0),this[1]=t(a,0),this[2]=t(u,0),this[3]=t(n,0),this[4]=t(i,0),this[5]=t(s,0),this[6]=t(r,0),this[7]=t(o,0),this[8]=t(c,0)}function s(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function c(e){for(var t=0,n=0;n<3;++n){var r=e[u.getElementIndex(p[n],d[n])];t+=2*r*r}return Math.sqrt(t)}function l(e,t){for(var n=o.EPSILON15,r=0,a=1,i=0;i<3;++i){var s=Math.abs(e[u.getElementIndex(p[i],d[i])]);s>r&&(a=i,r=s)}var c=1,l=0,f=d[a],h=p[a];if(Math.abs(e[u.getElementIndex(h,f)])>n){var E,y=e[u.getElementIndex(h,h)],m=e[u.getElementIndex(f,f)],_=e[u.getElementIndex(h,f)],v=(y-m)/2/_;E=v<0?-1/(-v+Math.sqrt(1+v*v)):1/(v+Math.sqrt(1+v*v)),c=1/Math.sqrt(1+E*E),l=E*c}return t=u.clone(u.IDENTITY,t),t[u.getElementIndex(f,f)]=t[u.getElementIndex(h,h)]=c,t[u.getElementIndex(h,f)]=l,t[u.getElementIndex(f,h)]=-l,t}u.packedLength=9,u.pack=function(e,n,r){return r=t(r,0),n[r++]=e[0],n[r++]=e[1],n[r++]=e[2],n[r++]=e[3],n[r++]=e[4],n[r++]=e[5],n[r++]=e[6],n[r++]=e[7],n[r++]=e[8],n},u.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new u),a[0]=e[r++],a[1]=e[r++],a[2]=e[r++],a[3]=e[r++],a[4]=e[r++],a[5]=e[r++],a[6]=e[r++],a[7]=e[r++],a[8]=e[r++],a},u.clone=function(e,t){if(n(e))return n(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 u(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},u.fromArray=function(e,r,a){return r=t(r,0),n(a)||(a=new u),a[0]=e[r],a[1]=e[r+1],a[2]=e[r+2],a[3]=e[r+3],a[4]=e[r+4],a[5]=e[r+5],a[6]=e[r+6],a[7]=e[r+7],a[8]=e[r+8],a},u.fromColumnMajorArray=function(e,t){return u.clone(e,t); -},u.fromRowMajorArray=function(e,t){return n(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 u(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},u.fromQuaternion=function(e,t){var r=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,s=e.y*e.y,c=e.y*e.z,l=e.y*e.w,f=e.z*e.z,h=e.z*e.w,d=e.w*e.w,p=r-s-f+d,E=2*(a-h),y=2*(i+l),m=2*(a+h),_=-r+s-f+d,v=2*(c-o),T=2*(i-l),R=2*(c+o),A=-r-s+f+d;return n(t)?(t[0]=p,t[1]=m,t[2]=T,t[3]=E,t[4]=_,t[5]=R,t[6]=y,t[7]=v,t[8]=A,t):new u(p,E,y,m,_,v,T,R,A)},u.fromHeadingPitchRoll=function(e,t){var r=Math.cos(-e.pitch),a=Math.cos(-e.heading),i=Math.cos(e.roll),o=Math.sin(-e.pitch),s=Math.sin(-e.heading),c=Math.sin(e.roll),l=r*a,f=-i*s+c*o*a,h=c*s+i*o*a,d=r*s,p=i*a+c*o*s,E=-o*i+i*o*s,y=-o,m=c*r,_=i*r;return n(t)?(t[0]=l,t[1]=d,t[2]=y,t[3]=f,t[4]=p,t[5]=m,t[6]=h,t[7]=E,t[8]=_,t):new u(l,f,h,d,p,E,y,m,_)},u.fromScale=function(e,t){return n(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 u(e.x,0,0,0,e.y,0,0,0,e.z)},u.fromUniformScale=function(e,t){return n(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 u(e,0,0,0,e,0,0,0,e)},u.fromCrossProduct=function(e,t){return n(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 u(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},u.fromRotationX=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=r,t[5]=a,t[6]=0,t[7]=-a,t[8]=r,t):new u(1,0,0,0,r,-a,0,a,r)},u.fromRotationY=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=r,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=r,t):new u(r,0,a,0,1,0,-a,0,r)},u.fromRotationZ=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=r,t[1]=a,t[2]=0,t[3]=-a,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new u(r,-a,0,a,r,0,0,0,1)},u.toArray=function(e,t){return n(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]]},u.getElementIndex=function(e,t){return 3*e+t},u.getColumn=function(e,t,n){var r=3*t,a=e[r],i=e[r+1],o=e[r+2];return n.x=a,n.y=i,n.z=o,n},u.setColumn=function(e,t,n,r){r=u.clone(e,r);var a=3*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},u.getRow=function(e,t,n){var r=e[t],a=e[t+3],i=e[t+6];return n.x=r,n.y=a,n.z=i,n},u.setRow=function(e,t,n,r){return r=u.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var f=new e;u.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],f)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],f)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],f)),n};var h=new e;u.getMaximumScale=function(t){return u.getScale(t,h),e.maximumComponent(h)},u.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=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 n[0]=r,n[1]=a,n[2]=i,n[3]=o,n[4]=u,n[5]=s,n[6]=c,n[7]=l,n[8]=f,n},u.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},u.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},u.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[3]*a+e[6]*i,u=e[1]*r+e[4]*a+e[7]*i,s=e[2]*r+e[5]*a+e[8]*i;return n.x=o,n.y=u,n.z=s,n},u.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},u.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},u.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},u.transpose=function(e,t){var n=e[0],r=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=n,t[1]=r,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var d=[1,0,0],p=[2,2,1],E=new u,y=new u;return u.computeEigenDecomposition=function(e,t){var r=o.EPSILON20,a=10,i=0,f=0;n(t)||(t={});for(var h=t.unitary=u.clone(u.IDENTITY,t.unitary),d=t.diagonal=u.clone(e,t.diagonal),p=r*s(d);f<a&&c(d)>p;)l(d,E),u.transpose(E,y),u.multiply(d,E,d),u.multiply(y,d,d),u.multiply(h,E,h),++i>2&&(++f,i=0);return t},u.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},u.determinant=function(e){var t=e[0],n=e[3],r=e[6],a=e[1],i=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*o)+a*(s*r-n*c)+u*(n*o-i*r)},u.inverse=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[3],o=e[4],s=e[5],c=e[6],l=e[7],f=e[8],h=u.determinant(e);t[0]=o*f-l*s,t[1]=l*a-r*f,t[2]=r*s-o*a,t[3]=c*s-i*f,t[4]=n*f-c*a,t[5]=i*a-n*s,t[6]=i*l-c*o,t[7]=c*r-n*l,t[8]=n*o-i*r;var d=1/h;return u.multiplyByScalar(t,d,t)},u.equals=function(e,t){return e===t||n(e)&&n(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]},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r},u.IDENTITY=i(new u(1,0,0,0,1,0,0,0,1)),u.ZERO=i(new u(0,0,0,0,0,0,0,0,0)),u.COLUMN0ROW0=0,u.COLUMN0ROW1=1,u.COLUMN0ROW2=2,u.COLUMN1ROW0=3,u.COLUMN1ROW1=4,u.COLUMN1ROW2=5,u.COLUMN2ROW0=6,u.COLUMN2ROW1=7,u.COLUMN2ROW2=8,r(u.prototype,{length:{get:function(){return u.packedLength}}}),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},u}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a){"use strict";function i(t,n,r,a){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0),this.w=e(a,0)}i.fromElements=function(e,n,r,a,o){return t(o)?(o.x=e,o.y=n,o.z=r,o.w=a,o):new i(e,n,r,a)},i.fromColor=function(e,n){return t(n)?(n.x=e.red,n.y=e.green,n.z=e.blue,n.w=e.alpha,n):new i(e.red,e.green,e.blue,e.alpha)},i.clone=function(e,n){if(t(e))return t(n)?(n.x=e.x,n.y=e.y,n.z=e.z,n.w=e.w,n):new i(e.x,e.y,e.z,e.w)},i.packedLength=4,i.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w,n},i.unpack=function(n,r,a){return r=e(r,0),t(a)||(a=new i),a.x=n[r++],a.y=n[r++],a.z=n[r++],a.w=n[r],a},i.packArray=function(e,n){var r=e.length;t(n)?n.length=4*r:n=new Array(4*r);for(var a=0;a<r;++a)i.pack(e[a],n,4*a);return n},i.unpackArray=function(e,n){var r=e.length;t(n)?n.length=r/4:n=new Array(r/4);for(var a=0;a<r;a+=4){var o=a/4;n[o]=i.unpack(e,a,n[o])}return n},i.fromArray=i.unpack,i.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},i.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},i.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},i.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},i.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},i.magnitude=function(e){return Math.sqrt(i.magnitudeSquared(e))};var o=new i;i.distance=function(e,t){return i.subtract(e,t,o),i.magnitude(o)},i.distanceSquared=function(e,t){return i.subtract(e,t,o),i.magnitudeSquared(o)},i.normalize=function(e,t){var n=i.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t},i.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},i.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},i.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},i.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},i.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},i.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},i.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},i.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},i.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 u=new i;i.lerp=function(e,t,n,r){return i.multiplyByScalar(t,n,u),r=i.multiplyByScalar(e,1-n,r),i.add(u,r,r)};var s=new i;return i.mostOrthogonalAxis=function(e,t){var n=i.normalize(e,s);return i.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?i.clone(i.UNIT_X,t):i.clone(i.UNIT_W,t):n.z<=n.w?i.clone(i.UNIT_Z,t):i.clone(i.UNIT_W,t):n.y<=n.z?n.y<=n.w?i.clone(i.UNIT_Y,t):i.clone(i.UNIT_W,t):n.z<=n.w?i.clone(i.UNIT_Z,t):i.clone(i.UNIT_W,t)},i.equals=function(e,n){return e===n||t(e)&&t(n)&&e.x===n.x&&e.y===n.y&&e.z===n.z&&e.w===n.w},i.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},i.equalsEpsilon=function(e,n,r,i){return e===n||t(e)&&t(n)&&a.equalsEpsilon(e.x,n.x,r,i)&&a.equalsEpsilon(e.y,n.y,r,i)&&a.equalsEpsilon(e.z,n.z,r,i)&&a.equalsEpsilon(e.w,n.w,r,i)},i.ZERO=r(new i(0,0,0,0)),i.UNIT_X=r(new i(1,0,0,0)),i.UNIT_Y=r(new i(0,1,0,0)),i.UNIT_Z=r(new i(0,0,1,0)),i.UNIT_W=r(new i(0,0,0,1)),i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i.prototype.equalsEpsilon=function(e,t,n){return i.equalsEpsilon(this,e,t,n)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},i}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t,r,a,i,o,u,s,c,l,f,h,d,p,E,y){this[0]=n(e,0),this[1]=n(i,0),this[2]=n(c,0),this[3]=n(d,0),this[4]=n(t,0),this[5]=n(o,0),this[6]=n(l,0),this[7]=n(p,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(f,0),this[11]=n(E,0),this[12]=n(a,0),this[13]=n(s,0),this[14]=n(h,0),this[15]=n(y,0)}l.packedLength=16,l.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t[r++]=e[9],t[r++]=e[10],t[r++]=e[11],t[r++]=e[12],t[r++]=e[13],t[r++]=e[14],t[r]=e[15],t},l.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new l),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a[9]=e[t++],a[10]=e[t++],a[11]=e[t++],a[12]=e[t++],a[13]=e[t++],a[14]=e[t++],a[15]=e[t],a},l.clone=function(e,t){if(r(e))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):new l(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])},l.fromArray=l.unpack,l.fromColumnMajorArray=function(e,t){return l.clone(e,t)},l.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 l(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])},l.fromRotationTranslation=function(t,a,i){return a=n(a,e.ZERO),r(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=a.x,i[13]=a.y,i[14]=a.z,i[15]=1,i):new l(t[0],t[3],t[6],a.x,t[1],t[4],t[7],a.y,t[2],t[5],t[8],a.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(e,t,n,a){r(a)||(a=new l);var i=n.x,o=n.y,u=n.z,s=t.x*t.x,c=t.x*t.y,f=t.x*t.z,h=t.x*t.w,d=t.y*t.y,p=t.y*t.z,E=t.y*t.w,y=t.z*t.z,m=t.z*t.w,_=t.w*t.w,v=s-d-y+_,T=2*(c-m),R=2*(f+E),A=2*(c+m),S=-s+d-y+_,g=2*(p-h),N=2*(f-E),x=2*(p+h),I=-s-d+y+_;return a[0]=v*i,a[1]=A*i,a[2]=N*i,a[3]=0,a[4]=T*o,a[5]=S*o,a[6]=x*o,a[7]=0,a[8]=R*u,a[9]=g*u,a[10]=I*u,a[11]=0,a[12]=e.x,a[13]=e.y,a[14]=e.z,a[15]=1,a},l.fromTranslationRotationScale=function(e,t){return l.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},l.fromTranslation=function(e,t){return l.fromRotationTranslation(s.IDENTITY,e,t)},l.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 l(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},l.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 l(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var f=new e,h=new e,d=new e;l.fromCamera=function(t,n){var a=t.position,i=t.direction,o=t.up;e.normalize(i,f),e.normalize(e.cross(f,o,h),h),e.normalize(e.cross(h,f,d),d);var u=h.x,s=h.y,c=h.z,p=f.x,E=f.y,y=f.z,m=d.x,_=d.y,v=d.z,T=a.x,R=a.y,A=a.z,S=u*-T+s*-R+c*-A,g=m*-T+_*-R+v*-A,N=p*T+E*R+y*A;return r(n)?(n[0]=u,n[1]=m,n[2]=-p,n[3]=0,n[4]=s,n[5]=_,n[6]=-E,n[7]=0,n[8]=c,n[9]=v,n[10]=-y,n[11]=0,n[12]=S,n[13]=g,n[14]=N,n[15]=1,n):new l(u,s,c,S,m,_,v,g,-p,-E,-y,N,0,0,0,1)},l.computePerspectiveFieldOfView=function(e,t,n,r,a){var i=Math.tan(.5*e),o=1/i,u=o/t,s=(r+n)/(n-r),c=2*r*n/(n-r);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=c,a[15]=0,a},l.computeOrthographicOffCenter=function(e,t,n,r,a,i,o){var u=1/(t-e),s=1/(r-n),c=1/(i-a),l=-(t+e)*u,f=-(r+n)*s,h=-(i+a)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=f,o[14]=h,o[15]=1,o},l.computePerspectiveOffCenter=function(e,t,n,r,a,i,o){var u=2*a/(t-e),s=2*a/(r-n),c=(t+e)/(t-e),l=(r+n)/(r-n),f=-(i+a)/(i-a),h=-1,d=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=f,o[11]=h,o[12]=0,o[13]=0,o[14]=d,o[15]=0,o},l.computeInfinitePerspectiveOffCenter=function(e,t,n,r,a,i){var o=2*a/(t-e),u=2*a/(r-n),s=(t+e)/(t-e),c=(r+n)/(r-n),l=-1,f=-1,h=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=s,i[9]=c,i[10]=l,i[11]=f,i[12]=0,i[13]=0,i[14]=h,i[15]=0,i},l.computeViewportTransformation=function(e,t,r,a){e=n(e,n.EMPTY_OBJECT);var i=n(e.x,0),o=n(e.y,0),u=n(e.width,0),s=n(e.height,0);t=n(t,0),r=n(r,1);var c=.5*u,l=.5*s,f=.5*(r-t),h=c,d=l,p=f,E=i+c,y=o+l,m=t+f,_=1;return a[0]=h,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=d,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=p,a[11]=0,a[12]=E,a[13]=y,a[14]=m,a[15]=_,a},l.computeView=function(t,n,r,a,i){return i[0]=a.x,i[1]=r.x,i[2]=-n.x,i[3]=0,i[4]=a.y,i[5]=r.y,i[6]=-n.y,i[7]=0,i[8]=a.z,i[9]=r.z,i[10]=-n.z,i[11]=0,i[12]=-e.dot(a,t),i[13]=-e.dot(r,t),i[14]=e.dot(n,t),i[15]=1,i},l.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]]},l.getElementIndex=function(e,t){return 4*e+t},l.getColumn=function(e,t,n){var r=4*t,a=e[r],i=e[r+1],o=e[r+2],u=e[r+3];return n.x=a,n.y=i,n.z=o,n.w=u,n},l.setColumn=function(e,t,n,r){r=l.clone(e,r);var a=4*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r[a+3]=n.w,r},l.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},l.getRow=function(e,t,n){var r=e[t],a=e[t+4],i=e[t+8],o=e[t+12];return n.x=r,n.y=a,n.z=i,n.w=o,n},l.setRow=function(e,t,n,r){return r=l.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var p=new e;l.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],p)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],p)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],p)),n};var E=new e;l.getMaximumScale=function(t){return l.getScale(t,E),e.maximumComponent(E)},l.multiply=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],f=e[8],h=e[9],d=e[10],p=e[11],E=e[12],y=e[13],m=e[14],_=e[15],v=t[0],T=t[1],R=t[2],A=t[3],S=t[4],g=t[5],N=t[6],x=t[7],I=t[8],O=t[9],w=t[10],M=t[11],C=t[12],P=t[13],D=t[14],U=t[15],L=r*v+u*T+f*R+E*A,b=a*v+s*T+h*R+y*A,F=i*v+c*T+d*R+m*A,z=o*v+l*T+p*R+_*A,B=r*S+u*g+f*N+E*x,G=a*S+s*g+h*N+y*x,q=i*S+c*g+d*N+m*x,W=o*S+l*g+p*N+_*x,V=r*I+u*O+f*w+E*M,X=a*I+s*O+h*w+y*M,H=i*I+c*O+d*w+m*M,Y=o*I+l*O+p*w+_*M,k=r*C+u*P+f*D+E*U,Z=a*C+s*P+h*D+y*U,j=i*C+c*P+d*D+m*U,K=o*C+l*P+p*D+_*U;return n[0]=L,n[1]=b,n[2]=F,n[3]=z,n[4]=B,n[5]=G,n[6]=q,n[7]=W,n[8]=V,n[9]=X,n[10]=H,n[11]=Y,n[12]=k,n[13]=Z,n[14]=j,n[15]=K,n},l.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},l.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},l.multiplyTransformation=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=e[12],d=e[13],p=e[14],E=t[0],y=t[1],m=t[2],_=t[4],v=t[5],T=t[6],R=t[8],A=t[9],S=t[10],g=t[12],N=t[13],x=t[14],I=r*E+o*y+c*m,O=a*E+u*y+l*m,w=i*E+s*y+f*m,M=r*_+o*v+c*T,C=a*_+u*v+l*T,P=i*_+s*v+f*T,D=r*R+o*A+c*S,U=a*R+u*A+l*S,L=i*R+s*A+f*S,b=r*g+o*N+c*x+h,F=a*g+u*N+l*x+d,z=i*g+s*N+f*x+p;return n[0]=I,n[1]=O,n[2]=w,n[3]=0,n[4]=M,n[5]=C,n[6]=P,n[7]=0,n[8]=D,n[9]=U,n[10]=L,n[11]=0,n[12]=b,n[13]=F,n[14]=z,n[15]=1,n},l.multiplyByMatrix3=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=t[0],d=t[1],p=t[2],E=t[3],y=t[4],m=t[5],_=t[6],v=t[7],T=t[8],R=r*h+o*d+c*p,A=a*h+u*d+l*p,S=i*h+s*d+f*p,g=r*E+o*y+c*m,N=a*E+u*y+l*m,x=i*E+s*y+f*m,I=r*_+o*v+c*T,O=a*_+u*v+l*T,w=i*_+s*v+f*T;return n[0]=R,n[1]=A,n[2]=S,n[3]=0,n[4]=g,n[5]=N,n[6]=x,n[7]=0,n[8]=I,n[9]=O,n[10]=w,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},l.multiplyByTranslation=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=r*e[0]+a*e[4]+i*e[8]+e[12],u=r*e[1]+a*e[5]+i*e[9]+e[13],s=r*e[2]+a*e[6]+i*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=s,n[15]=e[15],n};var y=new e;l.multiplyByUniformScale=function(e,t,n){return y.x=t,y.y=t,y.z=t,l.multiplyByScale(e,y,n)},l.multiplyByScale=function(e,t,n){var r=t.x,a=t.y,i=t.z;return 1===r&&1===a&&1===i?l.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=a*e[4],n[5]=a*e[5],n[6]=a*e[6],n[7]=0,n[8]=i*e[8],n[9]=i*e[9],n[10]=i*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},l.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=t.w,u=e[0]*r+e[4]*a+e[8]*i+e[12]*o,s=e[1]*r+e[5]*a+e[9]*i+e[13]*o,c=e[2]*r+e[6]*a+e[10]*i+e[14]*o,l=e[3]*r+e[7]*a+e[11]*i+e[15]*o;return n.x=u,n.y=s,n.z=c,n.w=l,n},l.multiplyByPointAsVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i,u=e[1]*r+e[5]*a+e[9]*i,s=e[2]*r+e[6]*a+e[10]*i;return n.x=o,n.y=u,n.z=s,n},l.multiplyByPoint=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i+e[12],u=e[1]*r+e[5]*a+e[9]*i+e[13],s=e[2]*r+e[6]*a+e[10]*i+e[14];return n.x=o,n.y=u,n.z=s,n},l.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},l.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},l.transpose=function(e,t){var n=e[1],r=e[2],a=e[3],i=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=o,t[14]=u,t[15]=e[15],t},l.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},l.equals=function(e,t){return e===t||r(e)&&r(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},l.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},l.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},l.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};var m=new s,_=new s,v=new t,T=new t(0,0,0,1);return l.inverse=function(e,n){if(s.equalsEpsilon(l.getRotation(e,m),_,u.EPSILON7)&&t.equals(l.getRow(e,3,v),T))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],a=e[4],i=e[8],o=e[12],f=e[1],h=e[5],d=e[9],p=e[13],E=e[2],y=e[6],R=e[10],A=e[14],S=e[3],g=e[7],N=e[11],x=e[15],I=R*x,O=A*N,w=y*x,M=A*g,C=y*N,P=R*g,D=E*x,U=A*S,L=E*N,b=R*S,F=E*g,z=y*S,B=I*h+M*d+C*p-(O*h+w*d+P*p),G=O*f+D*d+b*p-(I*f+U*d+L*p),q=w*f+U*h+F*p-(M*f+D*h+z*p),W=P*f+L*h+z*d-(C*f+b*h+F*d),V=O*a+w*i+P*o-(I*a+M*i+C*o),X=I*r+U*i+L*o-(O*r+D*i+b*o),H=M*r+D*a+z*o-(w*r+U*a+F*o),Y=C*r+b*a+F*i-(P*r+L*a+z*i);I=i*p,O=o*d,w=a*p,M=o*h,C=a*d,P=i*h,D=r*p,U=o*f,L=r*d,b=i*f,F=r*h,z=a*f;var k=I*g+M*N+C*x-(O*g+w*N+P*x),Z=O*S+D*N+b*x-(I*S+U*N+L*x),j=w*S+U*g+F*x-(M*S+D*g+z*x),K=P*S+L*g+z*N-(C*S+b*g+F*N),J=w*R+P*A+O*y-(C*A+I*y+M*R),Q=L*A+I*E+U*R-(D*R+b*A+O*E),$=D*y+z*A+M*E-(F*A+w*E+U*y),ee=F*R+C*E+b*y-(L*y+z*R+P*E),te=r*B+a*G+i*q+o*W;if(Math.abs(te)<u.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=B*te,n[1]=G*te,n[2]=q*te,n[3]=W*te,n[4]=V*te,n[5]=X*te,n[6]=H*te,n[7]=Y*te,n[8]=k*te,n[9]=Z*te,n[10]=j*te,n[11]=K*te,n[12]=J*te,n[13]=Q*te,n[14]=$*te,n[15]=ee*te,n},l.inverseTransformation=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],f=e[12],h=e[13],d=e[14],p=-n*f-r*h-a*d,E=-i*f-o*h-u*d,y=-s*f-c*h-l*d;return t[0]=n,t[1]=i,t[2]=s,t[3]=0,t[4]=r,t[5]=o,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=l,t[11]=0,t[12]=p,t[13]=E,t[14]=y,t[15]=1,t},l.IDENTITY=o(new l(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),l.ZERO=o(new l(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN0ROW3=3,l.COLUMN1ROW0=4,l.COLUMN1ROW1=5,l.COLUMN1ROW2=6,l.COLUMN1ROW3=7,l.COLUMN2ROW0=8,l.COLUMN2ROW1=9,l.COLUMN2ROW2=10,l.COLUMN2ROW3=11,l.COLUMN3ROW0=12,l.COLUMN3ROW1=13,l.COLUMN3ROW2=14,l.COLUMN3ROW3=15,a(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.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]+")"},l}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(t,r){this.center=e.clone(n(t,e.ZERO)),this.radius=n(r,0)}var d=new e,p=new e,E=new e,y=new e,m=new e,_=new e,v=new e,T=new e,R=new e,A=new e,S=new e,g=new e;h.fromPoints=function(t,n){if(r(n)||(n=new h),!r(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var a=e.clone(t[0],v),i=e.clone(a,d),o=e.clone(a,p),u=e.clone(a,E),s=e.clone(a,y),c=e.clone(a,m),l=e.clone(a,_),f=t.length,N=1;N<f;N++){e.clone(t[N],a);var x=a.x,I=a.y,O=a.z;x<i.x&&e.clone(a,i),x>s.x&&e.clone(a,s),I<o.y&&e.clone(a,o),I>c.y&&e.clone(a,c),O<u.z&&e.clone(a,u),O>l.z&&e.clone(a,l)}var w=e.magnitudeSquared(e.subtract(s,i,T)),M=e.magnitudeSquared(e.subtract(c,o,T)),C=e.magnitudeSquared(e.subtract(l,u,T)),P=i,D=s,U=w;M>U&&(U=M,P=o,D=c),C>U&&(U=C,P=u,D=l);var L=R;L.x=.5*(P.x+D.x),L.y=.5*(P.y+D.y),L.z=.5*(P.z+D.z);var b=e.magnitudeSquared(e.subtract(D,L,T)),F=Math.sqrt(b),z=A;z.x=i.x,z.y=o.y,z.z=u.z;var B=S;B.x=s.x,B.y=c.y,B.z=l.z;var G=e.multiplyByScalar(e.add(z,B,T),.5,g),q=0;for(N=0;N<f;N++){e.clone(t[N],a);var W=e.magnitude(e.subtract(a,G,T));W>q&&(q=W);var V=e.magnitudeSquared(e.subtract(a,L,T));if(V>b){var X=Math.sqrt(V);F=.5*(F+X),b=F*F;var H=X-F;L.x=(F*L.x+H*a.x)/X,L.y=(F*L.y+H*a.y)/X,L.z=(F*L.z+H*a.z)/X}}return F<q?(e.clone(L,n.center),n.radius=F):(e.clone(G,n.center),n.radius=q),n};var N=new o,x=new e,I=new e,O=new t,w=new t;h.fromRectangle2D=function(e,t,n){return h.fromRectangleWithHeights2D(e,t,0,0,n)},h.fromRectangleWithHeights2D=function(t,a,i,o,u){if(r(u)||(u=new h),!r(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;a=n(a,N),f.southwest(t,O),O.height=i,f.northeast(t,w),w.height=o;var s=a.project(O,x),c=a.project(w,I),l=c.x-s.x,d=c.y-s.y,p=c.z-s.z;u.radius=.5*Math.sqrt(l*l+d*d+p*p);var E=u.center;return E.x=s.x+.5*l,E.y=s.y+.5*d,E.z=s.z+.5*p,u};var M=[];h.fromRectangle3D=function(e,t,a,o){t=n(t,i.WGS84),a=n(a,0);var u;return r(e)&&(u=f.subsample(e,t,a,M)),h.fromPoints(u,o)},h.fromVertices=function(t,a,i,o){if(r(o)||(o=new h),!r(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;a=n(a,e.ZERO),i=n(i,3);var u=v;u.x=t[0]+a.x,u.y=t[1]+a.y,u.z=t[2]+a.z;for(var s=e.clone(u,d),c=e.clone(u,p),l=e.clone(u,E),f=e.clone(u,y),N=e.clone(u,m),x=e.clone(u,_),I=t.length,O=0;O<I;O+=i){var w=t[O]+a.x,M=t[O+1]+a.y,C=t[O+2]+a.z;u.x=w,u.y=M,u.z=C,w<s.x&&e.clone(u,s),w>f.x&&e.clone(u,f),M<c.y&&e.clone(u,c),M>N.y&&e.clone(u,N),C<l.z&&e.clone(u,l),C>x.z&&e.clone(u,x)}var P=e.magnitudeSquared(e.subtract(f,s,T)),D=e.magnitudeSquared(e.subtract(N,c,T)),U=e.magnitudeSquared(e.subtract(x,l,T)),L=s,b=f,F=P;D>F&&(F=D,L=c,b=N),U>F&&(F=U,L=l,b=x);var z=R;z.x=.5*(L.x+b.x),z.y=.5*(L.y+b.y),z.z=.5*(L.z+b.z);var B=e.magnitudeSquared(e.subtract(b,z,T)),G=Math.sqrt(B),q=A;q.x=s.x,q.y=c.y,q.z=l.z;var W=S;W.x=f.x,W.y=N.y,W.z=x.z;var V=e.multiplyByScalar(e.add(q,W,T),.5,g),X=0;for(O=0;O<I;O+=i){u.x=t[O]+a.x,u.y=t[O+1]+a.y,u.z=t[O+2]+a.z;var H=e.magnitude(e.subtract(u,V,T));H>X&&(X=H);var Y=e.magnitudeSquared(e.subtract(u,z,T));if(Y>B){var k=Math.sqrt(Y);G=.5*(G+k),B=G*G;var Z=k-G;z.x=(G*z.x+Z*u.x)/k,z.y=(G*z.y+Z*u.y)/k,z.z=(G*z.z+Z*u.z)/k}}return G<X?(e.clone(z,o.center),o.radius=G):(e.clone(V,o.center),o.radius=X),o},h.fromEncodedCartesianVertices=function(t,n,a){if(r(a)||(a=new h),!r(t)||!r(n)||t.length!==n.length||0===t.length)return a.center=e.clone(e.ZERO,a.center),a.radius=0,a;var i=v;i.x=t[0]+n[0],i.y=t[1]+n[1],i.z=t[2]+n[2];for(var o=e.clone(i,d),u=e.clone(i,p),s=e.clone(i,E),c=e.clone(i,y),l=e.clone(i,m),f=e.clone(i,_),N=t.length,x=0;x<N;x+=3){var I=t[x]+n[x],O=t[x+1]+n[x+1],w=t[x+2]+n[x+2];i.x=I,i.y=O,i.z=w,I<o.x&&e.clone(i,o),I>c.x&&e.clone(i,c),O<u.y&&e.clone(i,u),O>l.y&&e.clone(i,l),w<s.z&&e.clone(i,s),w>f.z&&e.clone(i,f)}var M=e.magnitudeSquared(e.subtract(c,o,T)),C=e.magnitudeSquared(e.subtract(l,u,T)),P=e.magnitudeSquared(e.subtract(f,s,T)),D=o,U=c,L=M;C>L&&(L=C,D=u,U=l),P>L&&(L=P,D=s,U=f);var b=R;b.x=.5*(D.x+U.x),b.y=.5*(D.y+U.y),b.z=.5*(D.z+U.z);var F=e.magnitudeSquared(e.subtract(U,b,T)),z=Math.sqrt(F),B=A;B.x=o.x,B.y=u.y,B.z=s.z;var G=S;G.x=c.x,G.y=l.y,G.z=f.z;var q=e.multiplyByScalar(e.add(B,G,T),.5,g),W=0;for(x=0;x<N;x+=3){i.x=t[x]+n[x],i.y=t[x+1]+n[x+1],i.z=t[x+2]+n[x+2];var V=e.magnitude(e.subtract(i,q,T));V>W&&(W=V);var X=e.magnitudeSquared(e.subtract(i,b,T));if(X>F){var H=Math.sqrt(X);z=.5*(z+H),F=z*z;var Y=H-z;b.x=(z*b.x+Y*i.x)/H,b.y=(z*b.y+Y*i.y)/H,b.z=(z*b.z+Y*i.z)/H}}return z<W?(e.clone(b,a.center),a.radius=z):(e.clone(q,a.center),a.radius=W),a},h.fromCornerPoints=function(t,n,a){r(a)||(a=new h);var i=a.center;return e.add(t,n,i),e.multiplyByScalar(i,.5,i),a.radius=e.distance(i,n),a},h.fromEllipsoid=function(t,n){return r(n)||(n=new h),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var C=new e;h.fromBoundingSpheres=function(t,n){if(r(n)||(n=new h),!r(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var a=t.length;if(1===a)return h.clone(t[0],n);if(2===a)return h.union(t[0],t[1],n);for(var i=[],o=0;o<a;o++)i.push(t[o].center);n=h.fromPoints(i,n);var u=n.center,s=n.radius;for(o=0;o<a;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,C)+c.radius)}return n.radius=s,n};var P=new e,D=new e,U=new e;h.fromOrientedBoundingBox=function(t,n){r(n)||(n=new h);var a=t.halfAxes,i=c.getColumn(a,0,P),o=c.getColumn(a,1,D),u=c.getColumn(a,2,U),s=e.magnitude(i),l=e.magnitude(o),f=e.magnitude(u);return n.center=e.clone(t.center,n.center),n.radius=Math.max(s,l,f),n},h.clone=function(t,n){if(r(t))return r(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new h(t.center,t.radius)},h.packedLength=4,h.pack=function(e,t,r){r=n(r,0);var a=e.center;return t[r++]=a.x,t[r++]=a.y,t[r++]=a.z,t[r]=e.radius,t},h.unpack=function(e,t,a){t=n(t,0),r(a)||(a=new h);var i=a.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],a.radius=e[t],a};var L=new e,b=new e;h.union=function(t,n,a){r(a)||(a=new h);var i=t.center,o=t.radius,u=n.center,s=n.radius,c=e.subtract(u,i,L),l=e.magnitude(c);if(o>=l+s)return t.clone(a),a;if(s>=l+o)return n.clone(a),a;var f=.5*(o+l+s),d=e.multiplyByScalar(c,(-o+f)/l,b);return e.add(d,i,d),e.clone(d,a.center),a.radius=f,a};var F=new e;h.expand=function(t,n,r){r=h.clone(t,r);var a=e.magnitude(e.subtract(n,r.center,F));return a>r.radius&&(r.radius=a),r},h.intersectPlane=function(t,n){var r=t.center,a=t.radius,i=n.normal,o=e.dot(i,r)+n.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},h.transform=function(e,t,n){return r(n)||(n=new h),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=l.getMaximumScale(t)*e.radius, -n};var z=new e;h.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,z);return e.magnitudeSquared(r)-t.radius*t.radius},h.transformWithoutScale=function(e,t,n){return r(n)||(n=new h),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var B=new e;h.computePlaneDistances=function(t,n,a,i){r(i)||(i=new s);var o=e.subtract(t.center,n,B),u=e.dot(a,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var G=new e,q=new e,W=new e,V=new e,X=new e,H=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var Z=new o;return h.projectTo2D=function(t,r,a){r=n(r,Z);var i=r.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,G),c=e.cross(e.UNIT_Z,s,q);e.normalize(c,c);var l=e.cross(s,c,W);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var f=e.negate(l,X),d=e.negate(c,V),p=Y,E=p[0];e.add(s,l,E),e.add(E,c,E),E=p[1],e.add(s,l,E),e.add(E,d,E),E=p[2],e.add(s,f,E),e.add(E,d,E),E=p[3],e.add(s,f,E),e.add(E,c,E),e.negate(s,s),E=p[4],e.add(s,l,E),e.add(E,c,E),E=p[5],e.add(s,l,E),e.add(E,d,E),E=p[6],e.add(s,f,E),e.add(E,d,E),E=p[7],e.add(s,f,E),e.add(E,c,E);for(var y=p.length,m=0;m<y;++m){var _=p[m];e.add(o,_,_);var v=i.cartesianToCartographic(_,H);r.project(v,_)}a=h.fromPoints(p,a),o=a.center;var T=o.x,R=o.y,A=o.z;return o.x=A,o.y=T,o.z=R,a},h.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},h.equals=function(t,n){return t===n||r(t)&&r(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},h.prototype.intersectPlane=function(e){return h.intersectPlane(this,e)},h.prototype.distanceSquaredTo=function(e){return h.distanceSquaredTo(this,e)},h.prototype.computePlaneDistances=function(e,t,n){return h.computePlaneDistances(this,e,t,n)},h.prototype.isOccluded=function(e){return h.isOccluded(this,e)},h.prototype.equals=function(e){return h.equals(this,e)},h.prototype.clone=function(e){return h.clone(this,e)},h}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return t(a,{element:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(r.requestFullscreen=a,n=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(r.requestFullscreen=a,n=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?r.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(r.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?r.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(r.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?r.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(r.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),r.fullscreenerror=a)}return n},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[r.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function a(){if(!t(R)&&(R=!1,!h())){var e=/ Chrome\/([\.0-9]+)/.exec(T.userAgent);null!==e&&(R=!0,A=r(e[1]))}return R}function i(){return a()&&A}function o(){if(!t(S)&&(S=!1,!a()&&!h()&&/ Safari\/[\.0-9]+/.test(T.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(T.userAgent);null!==e&&(S=!0,g=r(e[1]))}return S}function u(){return o()&&g}function s(){if(!t(N)){N=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(T.userAgent);null!==e&&(N=!0,x=r(e[1]),x.isNightly=!!e[2])}return N}function c(){return s()&&x}function l(){if(!t(I)){I=!1;var e;"Microsoft Internet Explorer"===T.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(T.userAgent),null!==e&&(I=!0,O=r(e[1]))):"Netscape"===T.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(T.userAgent),null!==e&&(I=!0,O=r(e[1])))}return I}function f(){return l()&&O}function h(){if(!t(w)){w=!1;var e=/ Edge\/([\.0-9]+)/.exec(T.userAgent);null!==e&&(w=!0,M=r(e[1]))}return w}function d(){return h()&&M}function p(){if(!t(C)){C=!1;var e=/Firefox\/([\.0-9]+)/.exec(T.userAgent);null!==e&&(C=!0,P=r(e[1]))}return C}function E(){return t(D)||(D=/Windows/i.test(T.appVersion)),D}function y(){return p()&&P}function m(){return t(U)||(U="undefined"!=typeof PointerEvent&&(!t(T.pointerEnabled)||T.pointerEnabled)),U}function _(){if(!t(b)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;b=t(n)&&""!==n,b&&(L=n)}return b}function v(){return _()?L:void 0}var T;T="undefined"!=typeof navigator?navigator:{};var R,A,S,g,N,x,I,O,w,M,C,P,D,U,L,b,F={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isEdge:h,edgeVersion:d,isFirefox:p,firefoxVersion:y,isWindows:E,hardwareConcurrency:e(T.hardwareConcurrency,3),supportsPointerEvents:m,supportsImageRenderingPixelated:_,imageRenderingValue:v};return F.supportsFullscreen=function(){return n.supportsFullscreen()},F.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},F.supportsWebWorkers=function(){return"undefined"!=typeof Worker},F}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,a,i){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){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.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},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 Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,a){switch(r=e(r,0),a=e(a,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,a);case o.SHORT:return new Int16Array(n,r,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,a);case o.INT:return new Int32Array(n,r,a);case o.UNSIGNED_INT:return new Uint32Array(n,r,a);case o.FLOAT:return new Float32Array(n,r,a);case o.DOUBLE:return new Float64Array(n,r,a)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/CornerType",["./freezeObject"],function(e){"use strict";var t={ROUNDED:0,MITERED:1,BEVELED:2};return e(t)}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===n.POINTS||e===n.LINES||e===n.LINE_LOOP||e===n.LINE_STRIP||e===n.TRIANGLES||e===n.TRIANGLE_STRIP||e===n.TRIANGLE_FAN}};return e(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,a){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,a.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return i.computeNumberOfVertices=function(e){var n=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var a=e.attributes[r],i=a.values.length/a.componentsPerAttribute;n=i}return n},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(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 r}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.binormal=t.binormal,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r,a){"use strict";var i={};i.octEncodeInRange=function(e,t,n){if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var r=n.x,i=n.y;n.x=(1-Math.abs(i))*a.signNotZero(r),n.y=(1-Math.abs(r))*a.signNotZero(i)}return n.x=a.toSNorm(n.x,t),n.y=a.toSNorm(n.y,t),n},i.octEncode=function(e,t){return i.octEncodeInRange(e,255,t)},i.octDecodeInRange=function(e,n,r,i){if(i.x=a.fromSNorm(e,r),i.y=a.fromSNorm(n,r),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){var o=i.x;i.x=(1-Math.abs(i.y))*a.signNotZero(o),i.y=(1-Math.abs(o))*a.signNotZero(i.y)}return t.normalize(i,i)},i.octDecode=function(e,t,n){return i.octDecodeInRange(e,t,255,n)},i.octPackFloat=function(e){return 256*e.x+e.y};var o=new e;return i.octEncodeFloat=function(e){return i.octEncode(e,o),i.octPackFloat(o)},i.octDecodeFloat=function(e,t){var n=e/256,r=Math.floor(n),a=256*(n-r);return i.octDecode(r,a,t)},i.octPack=function(e,t,n,r){var a=i.octEncodeFloat(e),u=i.octEncodeFloat(t),s=i.octEncode(n,o);return r.x=65536*s.x+a,r.y=65536*s.y+u,r},i.octUnpack=function(e,t,n,r){var a=e.x/65536,o=Math.floor(a),u=65536*(a-o);a=e.y/65536;var s=Math.floor(a),c=65536*(a-s);i.octDecodeFloat(u,t),i.octDecodeFloat(c,n),i.octDecode(o,s,r)},i.compressTextureCoordinates=function(e){var t=4095*e.x|0,n=4095*e.y|0;return 4096*t+n},i.decompressTextureCoordinates=function(e,t){var n=e/4096,r=Math.floor(n);return t.x=r/4095,t.y=(e-4096*r)/4095,t},i}),define("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(r,a,s,c,l){n(l)||(l=new t);var f,h,d,p,E,y,m,_;n(a.z)?(f=t.subtract(s,a,i),h=t.subtract(c,a,o),d=t.subtract(r,a,u),p=t.dot(f,f),E=t.dot(f,h),y=t.dot(f,d),m=t.dot(h,h),_=t.dot(h,d)):(f=e.subtract(s,a,i),h=e.subtract(c,a,o),d=e.subtract(r,a,u),p=e.dot(f,f),E=e.dot(f,h),y=e.dot(f,d),m=e.dot(h,h),_=e.dot(h,d));var v=1/(p*m-E*E);return l.y=(m*y-E*_)*v,l.z=(p*_-E*y)*v,l.x=1-l.y-l.z,l}var i=new t,o=new t,u=new t;return a}),define("Core/EncodedCartesian3",["./Cartesian3","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(){this.high=e.clone(e.ZERO),this.low=e.clone(e.ZERO)}r.encode=function(e,n){t(n)||(n={high:0,low:0});var r;return e>=0?(r=65536*Math.floor(e/65536),n.high=r,n.low=e-r):(r=65536*Math.floor(-e/65536),n.high=-r,n.low=e+r),n};var a={high:0,low:0};r.fromCartesian=function(e,n){t(n)||(n=new r);var i=n.high,o=n.low;return r.encode(e.x,a),i.x=a.high,o.x=a.low,r.encode(e.y,a),i.y=a.high,o.y=a.low,r.encode(e.z,a),i.z=a.high,o.z=a.low,n};var i=new r;return r.writeElements=function(e,t,n){r.fromCartesian(e,i);var a=i.high,o=i.low;t[n]=a.x,t[n+1]=a.y,t[n+2]=a.z,t[n+3]=o.x,t[n+4]=o.y,t[n+5]=o.z},r}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,n,r,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(e){switch(e){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(t){return e(t)&&(t===i.UNSIGNED_BYTE||t===i.UNSIGNED_SHORT||t===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,n,a){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,a):new Uint16Array(t,n,a)},n(i)}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function n(e,n,r){var a=e+n;return t.sign(e)!==t.sign(n)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(n)))<r?0:a}var r={};return r.computeDiscriminant=function(e,t,n){var r=t*t-4*e*n;return r},r.computeRealRoots=function(e,r,a){var i;if(0===e)return 0===r?[]:[-a/r];if(0===r){if(0===a)return[0,0];var o=Math.abs(a),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,i<0)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-r/e,i<0?[i,0]:[0,i];var c=r*r,l=4*e*a,f=n(c,-l,t.EPSILON14);if(f<0)return[];var h=-.5*n(r,t.sign(r)*Math.sqrt(f),t.EPSILON14);return r>0?[h/e,a/h]:[a/h,h/e]},r}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function n(e,t,n,r){var a,i,o=e,u=t/3,s=n/3,c=r,l=o*s,f=u*c,h=u*u,d=s*s,p=o*s-h,E=o*c-u*s,y=u*c-d,m=4*p*y-E*E;if(m<0){var _,v,T;h*f>=l*d?(_=o,v=p,T=-2*u*p+o*E):(_=c,v=y,T=-c*E+2*s*y);var R=T<0?-1:1,A=-R*Math.abs(_)*Math.sqrt(-m);i=-T+A;var S=i/2,g=S<0?-Math.pow(-S,1/3):Math.pow(S,1/3),N=i===A?-g:-v/g;return a=v<=0?g+N:-T/(g*g+N*N+v),h*f>=l*d?[(a-u)/o]:[-c/(a+s)]}var x=p,I=-2*u*p+o*E,O=y,w=-c*E+2*s*y,M=Math.sqrt(m),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*M,-I)/3);a=2*Math.sqrt(-x);var D=Math.cos(P);i=a*D;var U=a*(-D/2-C*Math.sin(P)),L=i+U>2*u?i-u:U-u,b=o,F=L/b;P=Math.abs(Math.atan2(c*M,-w)/3),a=2*Math.sqrt(-O),D=Math.cos(P),i=a*D,U=a*(-D/2-C*Math.sin(P));var z=-c,B=i+U<2*s?i+s:U+s,G=z/B,q=b*B,W=-L*B-b*z,V=L*z,X=(s*W-u*V)/(-u*W+s*q);return F<=X?F<=G?X<=G?[F,X,G]:[F,G,X]:[G,F,X]:F<=G?[X,F,G]:X<=G?[X,G,F]:[G,X,F]}var r={};return r.computeDiscriminant=function(e,t,n,r){var a=e*e,i=t*t,o=n*n,u=r*r,s=18*e*t*n*r+i*o-27*a*u-4*(e*o*n+i*t*r);return s},r.computeRealRoots=function(e,r,a,i){var o,u;if(0===e)return t.computeRealRoots(r,a,i);if(0===r){if(0===a){if(0===i)return[0,0,0];u=-i/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===i?(o=t.computeRealRoots(e,0,a),0===o.Length?[0]:[o[0],0,o[1]]):n(e,0,a,i)}return 0===a?0===i?(u=-r/e,u<0?[u,0,0]:[0,0,u]):n(e,r,0,i):0===i?(o=t.computeRealRoots(e,r,a),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):n(e,r,a,i)},r}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,n,r){"use strict";function a(t,a,i,o){var u=t*t,s=a-3*u/8,c=i-a*t/2+u*t/8,l=o-i*t/4+a*u/16-3*u*u/256,f=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(f.length>0){var h=-t/4,d=f[f.length-1];if(Math.abs(d)<n.EPSILON14){var p=r.computeRealRoots(1,s,l);if(2===p.length){var E,y=p[0],m=p[1];if(y>=0&&m>=0){var _=Math.sqrt(y),v=Math.sqrt(m);return[h-v,h-_,h+_,h+v]}if(y>=0&&m<0)return E=Math.sqrt(y),[h-E,h+E];if(y<0&&m>=0)return E=Math.sqrt(m),[h-E,h+E]}return[]}if(d>0){var T=Math.sqrt(d),R=(s+d-c/T)/2,A=(s+d+c/T)/2,S=r.computeRealRoots(1,T,R),g=r.computeRealRoots(1,-T,A);return 0!==S.length?(S[0]+=h,S[1]+=h,0!==g.length?(g[0]+=h,g[1]+=h,S[1]<=g[0]?[S[0],S[1],g[0],g[1]]:g[1]<=S[0]?[g[0],g[1],S[0],S[1]]:S[0]>=g[0]&&S[1]<=g[1]?[g[0],S[0],S[1],g[1]]:g[0]>=S[0]&&g[1]<=S[1]?[S[0],g[0],g[1],S[1]]:S[0]>g[0]&&S[0]<g[1]?[g[0],S[0],g[1],S[1]]:[S[0],g[0],S[1],g[1]]):S):0!==g.length?(g[0]+=h,g[1]+=h,g):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,f=i*t+s-4*o,h=c*o-i*a*t+u,d=e.computeRealRoots(1,l,f,h);if(d.length>0){var p,E,y=d[0],m=a-y,_=m*m,v=t/2,T=m/2,R=_-4*o,A=_+4*Math.abs(o),S=c-4*y,g=c+4*Math.abs(y);if(y<0||R*g<S*A){var N=Math.sqrt(S);p=N/2,E=0===N?0:(t*T-i)/N}else{var x=Math.sqrt(R);p=0===x?0:(t*T-i)/x,E=x/2}var I,O;0===v&&0===p?(I=0,O=0):n.sign(v)===n.sign(p)?(I=v+p,O=y/I):(O=v-p,I=y/O);var w,M;0===T&&0===E?(w=0,M=0):n.sign(T)===n.sign(E)?(w=T+E,M=o/w):(M=T-E,w=o/M);var C=r.computeRealRoots(1,I,w),P=r.computeRealRoots(1,O,M);if(0!==C.length)return 0!==P.length?C[1]<=P[0]?[C[0],C[1],P[0],P[1]]:P[1]<=C[0]?[P[0],P[1],C[0],C[1]]:C[0]>=P[0]&&C[1]<=P[1]?[P[0],C[0],C[1],P[1]]:P[0]>=C[0]&&P[1]<=C[1]?[C[0],P[0],P[1],C[1]]:C[0]>P[0]&&C[0]<P[1]?[P[0],C[0],P[1],C[1]]:[C[0],P[0],C[1],P[1]]:C;if(0!==P.length)return P}return[]}var o={};return o.computeDiscriminant=function(e,t,n,r,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=n*n,l=c*n,f=r*r,h=f*r,d=a*a,p=d*a,E=u*c*f-4*s*h-4*e*l*f+18*e*t*n*h-27*i*f*f+256*o*p+a*(18*s*n*r-4*u*l+16*e*c*c-80*e*t*c*r-6*e*u*f+144*i*n*f)+d*(144*e*u*n-27*u*u-128*i*c-192*i*t*r);return E},o.computeRealRoots=function(t,r,o,u,s){if(Math.abs(t)<n.EPSILON15)return e.computeRealRoots(r,o,u,s);var c=r/t,l=o/t,f=u/t,h=s/t,d=c<0?1:0;switch(d+=l<0?d+1:d,d+=f<0?d+1:d,d+=h<0?d+1:d){case 0:return a(c,l,f,h);case 1:return i(c,l,f,h);case 2:return i(c,l,f,h);case 3: -return a(c,l,f,h);case 4:return a(c,l,f,h);case 5:return i(c,l,f,h);case 6:return a(c,l,f,h);case 7:return a(c,l,f,h);case 8:return i(c,l,f,h);case 9:return a(c,l,f,h);case 10:return a(c,l,f,h);case 11:return i(c,l,f,h);case 12:return a(c,l,f,h);case 13:return a(c,l,f,h);case 14:return a(c,l,f,h);case 15:return a(c,l,f,h);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=e.clone(t(r,e.ZERO)),e.equals(r,e.ZERO)||e.normalize(r,r),this.origin=e.clone(t(n,e.ZERO)),this.direction=r}return a.getPoint=function(t,r,a){return n(a)||(a=new e),a=e.multiplyByScalar(t.direction,r,a),e.add(t.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t,n,r){var a=t*t-4*e*n;if(!(a<0)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return u<s?(r.root0=u,r.root1=s):(r.root0=s,r.root1=u),r}var c=-t/(2*e);if(0!==c)return r.root0=r.root1=c,r}}function f(t,n,a){r(a)||(a={});var i=t.origin,o=t.direction,u=n.center,s=n.radius*n.radius,c=e.subtract(i,u,m),f=e.dot(o,o),h=2*e.dot(o,c),d=e.magnitudeSquared(c)-s,p=l(f,h,d,R);if(r(p))return a.start=p.root0,a.stop=p.root1,a}function h(e,t,n){var r=e+t;return i.sign(e)!==i.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))<n?0:r}function d(t,n,r,a,c){var l,f=a*a,d=c*c,p=(t[o.COLUMN1ROW1]-t[o.COLUMN2ROW2])*d,E=c*(a*h(t[o.COLUMN1ROW0],t[o.COLUMN0ROW1],i.EPSILON15)+n.y),y=t[o.COLUMN0ROW0]*f+t[o.COLUMN2ROW2]*d+a*n.x+r,m=d*h(t[o.COLUMN2ROW1],t[o.COLUMN1ROW2],i.EPSILON15),_=c*(a*h(t[o.COLUMN2ROW0],t[o.COLUMN0ROW2])+n.z),v=[];if(0===_&&0===m){if(l=u.computeRealRoots(p,E,y),0===l.length)return v;var T=l[0],R=Math.sqrt(Math.max(1-T*T,0));if(v.push(new e(a,c*T,c*-R)),v.push(new e(a,c*T,c*R)),2===l.length){var A=l[1],S=Math.sqrt(Math.max(1-A*A,0));v.push(new e(a,c*A,c*-S)),v.push(new e(a,c*A,c*S))}return v}var g=_*_,N=m*m,x=p*p,I=_*m,O=x+N,w=2*(E*p+I),M=2*y*p+E*E-N+g,C=2*(y*E-I),P=y*y-g;if(0===O&&0===w&&0===M&&0===C)return v;l=s.computeRealRoots(O,w,M,C,P);var D=l.length;if(0===D)return v;for(var U=0;U<D;++U){var L,b=l[U],F=b*b,z=Math.max(1-F,0),B=Math.sqrt(z);L=i.sign(p)===i.sign(y)?h(p*F+y,E*b,i.EPSILON12):i.sign(y)===i.sign(E*b)?h(p*F,E*b+y,i.EPSILON12):h(p*F+E*b,y,i.EPSILON12);var G=h(m*b,_,i.EPSILON15),q=L*G;q<0?v.push(new e(a,c*b,c*B)):q>0?v.push(new e(a,c*b,c*-B)):0!==B?(v.push(new e(a,c*b,c*-B)),v.push(new e(a,c*b,c*B)),++U):v.push(new e(a,c*b,c*B))}return v}var p={};p.rayPlane=function(t,n,a){r(a)||(a=new e);var o=t.origin,u=t.direction,s=n.normal,c=e.dot(s,u);if(!(Math.abs(c)<i.EPSILON15)){var l=(-n.distance-e.dot(s,o))/c;if(!(l<0))return a=e.multiplyByScalar(u,l,a),e.add(o,a,a)}};var E=new e,y=new e,m=new e,_=new e,v=new e;p.rayTriangleParametric=function(t,r,a,o,u){u=n(u,!1);var s,c,l,f,h,d=t.origin,p=t.direction,T=e.subtract(a,r,E),R=e.subtract(o,r,y),A=e.cross(p,R,m),S=e.dot(T,A);if(u){if(S<i.EPSILON6)return;if(s=e.subtract(d,r,_),l=e.dot(s,A),l<0||l>S)return;if(c=e.cross(s,T,v),f=e.dot(p,c),f<0||l+f>S)return;h=e.dot(R,c)/S}else{if(Math.abs(S)<i.EPSILON6)return;var g=1/S;if(s=e.subtract(d,r,_),l=e.dot(s,A)*g,l<0||l>1)return;if(c=e.cross(s,T,v),f=e.dot(p,c)*g,f<0||l+f>1)return;h=e.dot(R,c)*g}return h},p.rayTriangle=function(t,n,a,i,o,u){var s=p.rayTriangleParametric(t,n,a,i,o);if(r(s)&&!(s<0))return r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var T=new c;p.lineSegmentTriangle=function(t,n,a,i,o,u,s){var c=T;e.clone(t,c.origin),e.subtract(n,t,c.direction),e.normalize(c.direction,c.direction);var l=p.rayTriangleParametric(c,a,i,o,u);if(!(!r(l)||l<0||l>e.distance(t,n)))return r(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var R={root0:0,root1:0};p.raySphere=function(e,t,n){if(n=f(e,t,n),r(n)&&!(n.stop<0))return n.start=Math.max(n.start,0),n};var A=new c;p.lineSegmentSphere=function(t,n,a,i){var o=A;e.clone(t,o.origin);var u=e.subtract(n,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),i=f(o,a,i),!(!r(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var S=new e,g=new e;p.rayEllipsoid=function(t,n){var r,a,i,o,u,s=n.oneOverRadii,c=e.multiplyComponents(s,t.origin,S),l=e.multiplyComponents(s,t.direction,g),f=e.magnitudeSquared(c),h=e.dot(c,l);if(f>1){if(h>=0)return;var d=h*h;if(r=f-1,a=e.magnitudeSquared(l),i=a*r,d<i)return;if(d>i){o=h*h-i,u=-h+Math.sqrt(o);var p=u/a,E=r/u;return p<E?{start:p,stop:E}:{start:E,stop:p}}var y=Math.sqrt(r/a);return{start:y,stop:y}}return f<1?(r=f-1,a=e.magnitudeSquared(l),i=a*r,o=h*h-i,u=-h+Math.sqrt(o),{start:0,stop:u/a}):h<0?(a=e.magnitudeSquared(l),{start:0,stop:-h/a}):void 0};var N=new e,x=new e,I=new e,O=new e,w=new e,M=new o,C=new o,P=new o,D=new o,U=new o,L=new o,b=new o,F=new e,z=new e,B=new t;p.grazingAltitudeLocation=function(t,n){var a=t.origin,u=t.direction;if(!e.equals(a,e.ZERO)){var s=n.geodeticSurfaceNormal(a,N);if(e.dot(u,s)>=0)return a}var c=r(this.rayEllipsoid(t,n)),l=n.transformPositionToScaledSpace(u,N),f=e.normalize(l,l),h=e.mostOrthogonalAxis(l,O),p=e.normalize(e.cross(h,f,x),x),E=e.normalize(e.cross(f,p,I),I),y=M;y[0]=f.x,y[1]=f.y,y[2]=f.z,y[3]=p.x,y[4]=p.y,y[5]=p.z,y[6]=E.x,y[7]=E.y,y[8]=E.z;var m=o.transpose(y,C),_=o.fromScale(n.radii,P),v=o.fromScale(n.oneOverRadii,D),T=U;T[0]=0,T[1]=-u.z,T[2]=u.y,T[3]=u.z,T[4]=0,T[5]=-u.x,T[6]=-u.y,T[7]=u.x,T[8]=0;var R,A,S=o.multiply(o.multiply(m,v,L),T,L),g=o.multiply(o.multiply(S,_,b),y,b),G=o.multiplyByVector(S,a,w),q=d(g,e.negate(G,N),0,0,1),W=q.length;if(W>0){for(var V=e.clone(e.ZERO,z),X=Number.NEGATIVE_INFINITY,H=0;H<W;++H){R=o.multiplyByVector(_,o.multiplyByVector(y,q[H],F),F);var Y=e.normalize(e.subtract(R,a,O),O),k=e.dot(Y,u);k>X&&(X=k,V=e.clone(R,V))}var Z=n.cartesianToCartographic(V,B);return X=i.clamp(X,0,1),A=e.magnitude(e.subtract(V,a,O))*Math.sqrt(1-X*X),A=c?-A:A,Z.height=A,n.cartographicToCartesian(Z,new e)}};var G=new e;return p.lineSegmentPlane=function(t,n,a,o){r(o)||(o=new e);var u=e.subtract(n,t,G),s=a.normal,c=e.dot(s,u);if(!(Math.abs(c)<i.EPSILON6)){var l=e.dot(s,t),f=-(a.distance+l)/c;if(!(f<0||f>1))return e.multiplyByScalar(u,f,o),e.add(t,o,o),o}},p.trianglePlaneIntersection=function(t,n,r,a){var i=a.normal,o=a.distance,u=e.dot(i,t)+o<0,s=e.dot(i,n)+o<0,c=e.dot(i,r)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var f,h;if(1!==l&&2!==l||(f=new e,h=new e),1===l){if(u)return p.lineSegmentPlane(t,n,a,f),p.lineSegmentPlane(t,r,a,h),{positions:[t,n,r,f,h],indices:[0,3,4,1,2,4,1,4,3]};if(s)return p.lineSegmentPlane(n,r,a,f),p.lineSegmentPlane(n,t,a,h),{positions:[t,n,r,f,h],indices:[1,3,4,2,0,4,2,4,3]};if(c)return p.lineSegmentPlane(r,t,a,f),p.lineSegmentPlane(r,n,a,h),{positions:[t,n,r,f,h],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return p.lineSegmentPlane(n,t,a,f),p.lineSegmentPlane(r,t,a,h),{positions:[t,n,r,f,h],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return p.lineSegmentPlane(r,n,a,f),p.lineSegmentPlane(t,n,a,h),{positions:[t,n,r,f,h],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return p.lineSegmentPlane(t,r,a,f),p.lineSegmentPlane(n,r,a,h),{positions:[t,n,r,f,h],indices:[0,1,4,0,4,3,2,3,4]}}},p}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";function a(t,n){this.normal=e.clone(t),this.distance=n}a.fromPointNormal=function(n,r,i){var o=-e.dot(r,n);return t(i)?(e.clone(r,i.normal),i.distance=o,i):new a(r,o)};var i=new e;return a.fromCartesian4=function(n,r){var o=e.fromCartesian4(n,i),u=n.w;return t(r)?(e.clone(o,r.normal),r.distance=u,r):new a(o,u)},a.getPointDistance=function(t,n){return e.dot(t.normal,n)+t.distance},a.ORIGIN_XY_PLANE=r(new a(e.UNIT_Z,0)),a.ORIGIN_YZ_PLANE=r(new a(e.UNIT_X,0)),a.ORIGIN_ZX_PLANE=r(new a(e.UNIT_Y,0)),a}),define("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";var r={};return r.calculateACMR=function(n){n=e(n,e.EMPTY_OBJECT);var r=n.indices,a=n.maximumIndex,i=e(n.cacheSize,24),o=r.length;if(!t(a)){a=0;for(var u=0,s=r[u];u<o;)s>a&&(a=s),++u,s=r[u]}for(var c=[],l=0;l<a+1;l++)c[l]=0;for(var f=i+1,h=0;h<o;++h)f-c[r[h]]>i&&(c[r[h]]=f,++f);return(f-i+1)/(o/3)},r.tipsify=function(n){function r(e,t,n,r){for(;t.length>=1;){var a=t[t.length-1];if(t.splice(t.length-1,1),e[a].numLiveTriangles>0)return a}for(;i<r;){if(e[i].numLiveTriangles>0)return++i,i-1;++i}return-1}function a(e,t,n,a,i,o,u){for(var s,c=-1,l=-1,f=0;f<n.length;){var h=n[f];a[h].numLiveTriangles&&(s=0,i-a[h].timeStamp+2*a[h].numLiveTriangles<=t&&(s=i-a[h].timeStamp),(s>l||l===-1)&&(l=s,c=h)),++f}return c===-1?r(a,o,e,u):c}n=e(n,e.EMPTY_OBJECT);var i,o=n.indices,u=n.maximumIndex,s=e(n.cacheSize,24),c=o.length,l=0,f=0,h=o[f],d=c;if(t(u))l=u+1;else{for(;f<d;)h>l&&(l=h),++f,h=o[f];if(l===-1)return 0;++l}for(var p=[],E=0;E<l;E++)p[E]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};f=0;for(var y=0;f<d;)p[o[f]].vertexTriangles.push(y),++p[o[f]].numLiveTriangles,p[o[f+1]].vertexTriangles.push(y),++p[o[f+1]].numLiveTriangles,p[o[f+2]].vertexTriangles.push(y),++p[o[f+2]].numLiveTriangles,++y,f+=3;var m=0,_=s+1;i=1;var v,T,R=[],A=[],S=0,g=[],N=c/3,x=[];for(E=0;E<N;E++)x[E]=!1;for(var I,O;m!==-1;){R=[],T=p[m],O=T.vertexTriangles.length;for(var w=0;w<O;++w)if(y=T.vertexTriangles[w],!x[y]){x[y]=!0,f=y+y+y;for(var M=0;M<3;++M)I=o[f],R.push(I),A.push(I),g[S]=I,++S,v=p[I],--v.numLiveTriangles,_-v.timeStamp>s&&(v.timeStamp=_,++_),++f}m=a(o,s,R,p,_,A,l)}return g},r}),define("Core/GeometryPipeline",["./AttributeCompression","./barycentricCoordinates","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EncodedCartesian3","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryType","./IndexDatatype","./Intersect","./IntersectionTests","./Math","./Matrix3","./Matrix4","./Plane","./PrimitiveType","./Tipsify"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,p,E,y,m,_,v,T,R,A,S,g){"use strict";function N(e,t,n,r,a){e[t++]=n,e[t++]=r,e[t++]=r,e[t++]=a,e[t++]=a,e[t]=n}function x(e){for(var t=e.length,n=t/3*6,r=y.createTypedArray(t,n),a=0,i=0;i<t;i+=3,a+=6)N(r,a,e[i],e[i+1],e[i+2]);return r}function I(e){var t=e.length;if(t>=3){var n=6*(t-2),r=y.createTypedArray(t,n);N(r,0,e[0],e[1],e[2]);for(var a=6,i=3;i<t;++i,a+=6)N(r,a,e[i-1],e[i],e[i-2]);return r}return new Uint16Array}function O(e){if(e.length>0){for(var t=e.length-1,n=6*(t-1),r=y.createTypedArray(t,n),a=e[0],i=0,o=1;o<t;++o,i+=6)N(r,i,a,e[o],e[o+1]);return r}return new Uint16Array}function w(e){var t={};for(var n in e)if(e.hasOwnProperty(n)&&c(e[n])&&c(e[n].values)){var r=e[n];t[n]=new p({componentDatatype:r.componentDatatype,componentsPerAttribute:r.componentsPerAttribute,normalize:r.normalize,values:[]})}return t}function M(e,t,n){for(var r in t)if(t.hasOwnProperty(r)&&c(t[r])&&c(t[r].values))for(var a=t[r],i=0;i<a.componentsPerAttribute;++i)e[r].values.push(a.values[n*a.componentsPerAttribute+i])}function C(e,t){if(c(t))for(var n=t.values,r=n.length,i=0;i<r;i+=3)a.unpack(n,i,ie),R.multiplyByPoint(e,ie,ie),a.pack(ie,n,i)}function P(e,t){if(c(t))for(var n=t.values,r=n.length,i=0;i<r;i+=3)a.unpack(n,i,ie),T.multiplyByVector(e,ie,ie),ie=a.normalize(ie,ie),a.pack(ie,n,i)}function D(e,t){var n,r=e.length,a={},i=e[0][t].attributes;for(n in i)if(i.hasOwnProperty(n)&&c(i[n])&&c(i[n].values)){for(var o=i[n],s=o.values.length,l=!0,f=1;f<r;++f){var h=e[f][t].attributes[n];if(!c(h)||o.componentDatatype!==h.componentDatatype||o.componentsPerAttribute!==h.componentsPerAttribute||o.normalize!==h.normalize){l=!1;break}s+=h.values.length}l&&(a[n]=new p({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:u.createTypedArray(o.componentDatatype,s)}))}return a}function U(e,t){var r,i,o,u,s,l,f,h=e.length,p=(e[0].modelMatrix,c(e[0][t].indices)),E=e[0][t].primitiveType,m=D(e,t);for(r in m)if(m.hasOwnProperty(r))for(s=m[r].values,u=0,i=0;i<h;++i)for(l=e[i][t].attributes[r].values,f=l.length,o=0;o<f;++o)s[u++]=l[o];var _;if(p){var v=0;for(i=0;i<h;++i)v+=e[i][t].indices.length;var T=d.computeNumberOfVertices(new d({attributes:m,primitiveType:S.POINTS})),R=y.createTypedArray(T,v),A=0,g=0;for(i=0;i<h;++i){var N=e[i][t].indices,x=N.length;for(u=0;u<x;++u)R[A++]=g+N[u];g+=d.computeNumberOfVertices(e[i][t])}_=R}var I,O=new a,w=0;for(i=0;i<h;++i){if(I=e[i][t].boundingSphere,!c(I)){O=void 0;break}a.add(I.center,O,O)}if(c(O))for(a.divideByScalar(O,h,O),i=0;i<h;++i){I=e[i][t].boundingSphere;var M=a.magnitude(a.subtract(I.center,O,se))+I.radius;M>w&&(w=M)}return new d({attributes:m,indices:_,primitiveType:E,boundingSphere:c(O)?new n(O,w):void 0})}function L(e){if(c(e.indices))return e;for(var t=d.computeNumberOfVertices(e),n=y.createTypedArray(t,t),r=0;r<t;++r)n[r]=r;return e.indices=n,e}function b(e){var t=d.computeNumberOfVertices(e),n=y.createTypedArray(t,3*(t-2));n[0]=1,n[1]=0,n[2]=2;for(var r=3,a=3;a<t;++a)n[r++]=a-1,n[r++]=0,n[r++]=a;return e.indices=n,e.primitiveType=S.TRIANGLES,e}function F(e){var t=d.computeNumberOfVertices(e),n=y.createTypedArray(t,3*(t-2));n[0]=0,n[1]=1,n[2]=2,t>3&&(n[3]=0,n[4]=2,n[5]=3);for(var r=6,a=3;a<t-1;a+=2)n[r++]=a,n[r++]=a-1,n[r++]=a+1,a+2<t&&(n[r++]=a,n[r++]=a+1,n[r++]=a+2);return e.indices=n,e.primitiveType=S.TRIANGLES,e}function z(e){if(c(e.indices))return e;for(var t=d.computeNumberOfVertices(e),n=y.createTypedArray(t,t),r=0;r<t;++r)n[r]=r;return e.indices=n,e}function B(e){var t=d.computeNumberOfVertices(e),n=y.createTypedArray(t,2*(t-1));n[0]=0,n[1]=1;for(var r=2,a=2;a<t;++a)n[r++]=a-1,n[r++]=a;return e.indices=n,e.primitiveType=S.LINES,e}function G(e){var t=d.computeNumberOfVertices(e),n=y.createTypedArray(t,2*t);n[0]=0,n[1]=1;for(var r=2,a=2;a<t;++a)n[r++]=a-1,n[r++]=a;return n[r++]=t-1,n[r]=0,e.indices=n,e.primitiveType=S.LINES,e}function q(e){switch(e.primitiveType){case S.TRIANGLE_FAN:return b(e);case S.TRIANGLE_STRIP:return F(e);case S.TRIANGLES:return L(e);case S.LINE_STRIP:return B(e);case S.LINE_LOOP:return G(e);case S.LINES:return z(e)}return e}function W(e,t){Math.abs(e.y)<v.EPSILON6&&(t?e.y=-v.EPSILON6:e.y=v.EPSILON6)}function V(e,t,n){if(0!==e.y&&0!==t.y&&0!==n.y)return W(e,e.y<0),W(t,t.y<0),void W(n,n.y<0);var r,a=Math.abs(e.y),i=Math.abs(t.y),o=Math.abs(n.y);r=a>i?a>o?v.sign(e.y):v.sign(n.y):i>o?v.sign(t.y):v.sign(n.y);var u=r<0;W(e,u),W(t,u),W(n,u)}function X(e,t,n,r){a.add(e,a.multiplyByScalar(a.subtract(t,e,Te),e.y/(e.y-t.y),Te),n),a.clone(n,r),W(n,!0),W(r,!1)}function H(e,t,n){if(!(e.x>=0||t.x>=0||n.x>=0)){V(e,t,n);var r=e.y<0,a=t.y<0,i=n.y<0,o=0;o+=r?1:0,o+=a?1:0,o+=i?1:0;var u=Ne.indices;1===o?(u[1]=3,u[2]=4,u[5]=6,u[7]=6,u[8]=5,r?(X(e,t,Re,Se),X(e,n,Ae,ge),u[0]=0,u[3]=1,u[4]=2,u[6]=1):a?(X(t,n,Re,Se),X(t,e,Ae,ge),u[0]=1,u[3]=2,u[4]=0,u[6]=2):i&&(X(n,e,Re,Se),X(n,t,Ae,ge),u[0]=2,u[3]=0,u[4]=1,u[6]=0)):2===o&&(u[2]=4,u[4]=4,u[5]=3,u[7]=5,u[8]=6,r?a?i||(X(n,e,Re,Se),X(n,t,Ae,ge),u[0]=0,u[1]=1,u[3]=0,u[6]=2):(X(t,n,Re,Se),X(t,e,Ae,ge),u[0]=2,u[1]=0,u[3]=2,u[6]=1):(X(e,t,Re,Se),X(e,n,Ae,ge),u[0]=1,u[1]=2,u[3]=1,u[6]=0));var s=Ne.positions;return s[0]=e,s[1]=t,s[2]=n,s.length=3,1!==o&&2!==o||(s[3]=Re,s[4]=Ae,s[5]=Se,s[6]=ge,s.length=7),Ne}}function Y(e,t){var r=e.attributes;if(0!==r.position.values.length){for(var a in r)if(r.hasOwnProperty(a)&&c(r[a])&&c(r[a].values)){var i=r[a];i.values=u.createTypedArray(i.componentDatatype,i.values)}var o=d.computeNumberOfVertices(e);return e.indices=y.createTypedArray(o,e.indices),t&&(e.boundingSphere=n.fromVertices(r.position.values)),e}}function k(e){var t=e.attributes,n={};for(var r in t)if(t.hasOwnProperty(r)&&c(t[r])&&c(t[r].values)){var a=t[r];n[r]=new p({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:[]})}return new d({attributes:n,indices:[],primitiveType:e.primitiveType})}function Z(e,t,n){var r=c(e.geometry.boundingSphere);t=Y(t,r),n=Y(n,r),c(n)&&!c(t)?e.geometry=n:!c(n)&&c(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=n,e.geometry=void 0)}function j(e,n,i,o,u,s,l,f,h,d,p){if(c(s)||c(l)||c(f)||c(h)){var E=a.fromArray(u,3*e,xe),y=a.fromArray(u,3*n,Ie),m=a.fromArray(u,3*i,Oe),_=t(o,E,y,m,we);if(c(s)){var v=a.fromArray(s,3*e,xe),T=a.fromArray(s,3*n,Ie),R=a.fromArray(s,3*i,Oe);a.multiplyByScalar(v,_.x,v),a.multiplyByScalar(T,_.y,T),a.multiplyByScalar(R,_.z,R);var A=a.add(v,T,v);a.add(A,R,A),a.normalize(A,A),a.pack(A,d.normal.values,3*p)}if(c(l)){var S=a.fromArray(l,3*e,xe),g=a.fromArray(l,3*n,Ie),N=a.fromArray(l,3*i,Oe);a.multiplyByScalar(S,_.x,S),a.multiplyByScalar(g,_.y,g),a.multiplyByScalar(N,_.z,N);var x=a.add(S,g,S);a.add(x,N,x),a.normalize(x,x),a.pack(x,d.binormal.values,3*p)}if(c(f)){var I=a.fromArray(f,3*e,xe),O=a.fromArray(f,3*n,Ie),w=a.fromArray(f,3*i,Oe);a.multiplyByScalar(I,_.x,I),a.multiplyByScalar(O,_.y,O),a.multiplyByScalar(w,_.z,w);var M=a.add(I,O,I);a.add(M,w,M),a.normalize(M,M),a.pack(M,d.tangent.values,3*p)}if(c(h)){var C=r.fromArray(h,2*e,Me),P=r.fromArray(h,2*n,Ce),D=r.fromArray(h,2*i,Pe);r.multiplyByScalar(C,_.x,C),r.multiplyByScalar(P,_.y,P),r.multiplyByScalar(D,_.z,D);var U=r.add(C,P,C);r.add(U,D,U),r.pack(U,d.st.values,2*p)}}}function K(e,t,n,r,a,i){var o=e.position.values.length/3;if(a!==-1){var u=r[a],s=n[u];return s===-1?(n[u]=o,e.position.values.push(i.x,i.y,i.z),t.push(o),o):(t.push(s),s)}return e.position.values.push(i.x,i.y,i.z),t.push(o),o}function J(e){var t,n,r,i,o,u=e.geometry,s=u.attributes,l=s.position.values,f=c(s.normal)?s.normal.values:void 0,h=c(s.binormal)?s.binormal.values:void 0,d=c(s.tangent)?s.tangent.values:void 0,p=c(s.st)?s.st.values:void 0,E=u.indices,y=k(u),m=k(u),_=[];_.length=l.length/3;var v=[];for(v.length=l.length/3,o=0;o<_.length;++o)_[o]=-1,v[o]=-1;var T=E.length;for(o=0;o<T;o+=3){var R=E[o],A=E[o+1],S=E[o+2],g=a.fromArray(l,3*R),N=a.fromArray(l,3*A),x=a.fromArray(l,3*S),I=H(g,N,x);if(c(I)&&I.positions.length>3)for(var O=I.positions,w=I.indices,M=w.length,C=0;C<M;++C){var P=w[C],D=O[P];D.y<0?(t=m.attributes,n=m.indices,r=_):(t=y.attributes,n=y.indices,r=v),i=K(t,n,r,E,P<3?o+P:-1,D),j(R,A,S,D,l,f,h,d,p,t,i)}else c(I)&&(g=I.positions[0],N=I.positions[1],x=I.positions[2]),g.y<0?(t=m.attributes,n=m.indices,r=_):(t=y.attributes,n=y.indices,r=v),i=K(t,n,r,E,o,g),j(R,A,S,g,l,f,h,d,p,t,i),i=K(t,n,r,E,o+1,N),j(R,A,S,N,l,f,h,d,p,t,i),i=K(t,n,r,E,o+2,x),j(R,A,S,x,l,f,h,d,p,t,i)}Z(e,m,y)}function Q(e){var t,n=e.geometry,r=n.attributes,i=r.position.values,o=n.indices,u=k(n),s=k(n),l=o.length,f=[];f.length=i.length/3;var h=[];for(h.length=i.length/3,t=0;t<f.length;++t)f[t]=-1,h[t]=-1;for(t=0;t<l;t+=2){var d=o[t],p=o[t+1],E=a.fromArray(i,3*d,xe),y=a.fromArray(i,3*p,Ie);Math.abs(E.y)<v.EPSILON6&&(E.y<0?E.y=-v.EPSILON6:E.y=v.EPSILON6),Math.abs(y.y)<v.EPSILON6&&(y.y<0?y.y=-v.EPSILON6:y.y=v.EPSILON6);var m=u.attributes,T=u.indices,R=h,A=s.attributes,S=s.indices,g=f,N=_.lineSegmentPlane(E,y,De,Oe);if(c(N)){var x=a.multiplyByScalar(a.UNIT_Y,5*v.EPSILON9,Ue);E.y<0&&(a.negate(x,x),m=s.attributes,T=s.indices,R=f,A=u.attributes,S=u.indices,g=h);var I=a.add(N,x,Le);K(m,T,R,o,t,E),K(m,T,R,o,-1,I),a.negate(x,x),a.add(N,x,I),K(A,S,g,o,-1,I),K(A,S,g,o,t+1,y)}else{var O,w,M;E.y<0?(O=s.attributes,w=s.indices,M=f):(O=u.attributes,w=u.indices,M=h),K(O,w,M,o,t,E),K(O,w,M,o,t+1,y)}}Z(e,s,u)}function $(e){for(var t=e.attributes,n=t.position.values,r=t.prevPosition.values,i=t.nextPosition.values,o=n.length,u=0;u<o;u+=3){var s=a.unpack(n,u,ze);if(!(s.x>0)){var c=a.unpack(r,u,Be);(s.y<0&&c.y>0||s.y>0&&c.y<0)&&(u-3>0?(r[u]=n[u-3],r[u+1]=n[u-2],r[u+2]=n[u-1]):a.pack(s,r,u));var l=a.unpack(i,u,Ge);(s.y<0&&l.y>0||s.y>0&&l.y<0)&&(u+3<o?(i[u]=n[u+3],i[u+1]=n[u+4],i[u+2]=n[u+5]):a.pack(s,i,u))}}}function ee(e){var t,n,o,u=e.geometry,s=u.attributes,l=s.position.values,f=s.prevPosition.values,h=s.nextPosition.values,d=s.expandAndWidth.values,p=c(s.st)?s.st.values:void 0,E=c(s.color)?s.color.values:void 0,y=k(u),m=k(u),T=!1,R=l.length/3;for(t=0;t<R;t+=4){var A=t,S=t+2,g=a.fromArray(l,3*A,ze),N=a.fromArray(l,3*S,Be);if(Math.abs(g.y)<Ye)for(g.y=Ye*(N.y<0?-1:1),l[3*t+1]=g.y,l[3*(t+1)+1]=g.y,n=3*A;n<3*A+12;n+=3)f[n]=l[3*t],f[n+1]=l[3*t+1],f[n+2]=l[3*t+2];if(Math.abs(N.y)<Ye)for(N.y=Ye*(g.y<0?-1:1),l[3*(t+2)+1]=N.y,l[3*(t+3)+1]=N.y,n=3*A;n<3*A+12;n+=3)h[n]=l[3*(t+2)],h[n+1]=l[3*(t+2)+1],h[n+2]=l[3*(t+2)+2];var x=y.attributes,I=y.indices,O=m.attributes,w=m.indices,M=_.lineSegmentPlane(g,N,De,qe);if(c(M)){T=!0;var C=a.multiplyByScalar(a.UNIT_Y,He,We);g.y<0&&(a.negate(C,C),x=m.attributes,I=m.indices,O=y.attributes,w=y.indices);var P=a.add(M,C,Ve);x.position.values.push(g.x,g.y,g.z,g.x,g.y,g.z),x.position.values.push(P.x,P.y,P.z),x.position.values.push(P.x,P.y,P.z),x.prevPosition.values.push(f[3*A],f[3*A+1],f[3*A+2]),x.prevPosition.values.push(f[3*A+3],f[3*A+4],f[3*A+5]),x.prevPosition.values.push(g.x,g.y,g.z,g.x,g.y,g.z),x.nextPosition.values.push(P.x,P.y,P.z),x.nextPosition.values.push(P.x,P.y,P.z),x.nextPosition.values.push(P.x,P.y,P.z),x.nextPosition.values.push(P.x,P.y,P.z),a.negate(C,C),a.add(M,C,P),O.position.values.push(P.x,P.y,P.z),O.position.values.push(P.x,P.y,P.z),O.position.values.push(N.x,N.y,N.z,N.x,N.y,N.z),O.prevPosition.values.push(P.x,P.y,P.z),O.prevPosition.values.push(P.x,P.y,P.z),O.prevPosition.values.push(P.x,P.y,P.z),O.prevPosition.values.push(P.x,P.y,P.z),O.nextPosition.values.push(N.x,N.y,N.z,N.x,N.y,N.z),O.nextPosition.values.push(h[3*S],h[3*S+1],h[3*S+2]),O.nextPosition.values.push(h[3*S+3],h[3*S+4],h[3*S+5]);var D=r.fromArray(d,2*A,be),U=Math.abs(D.y);x.expandAndWidth.values.push(-1,U,1,U),x.expandAndWidth.values.push(-1,-U,1,-U),O.expandAndWidth.values.push(-1,U,1,U),O.expandAndWidth.values.push(-1,-U,1,-U);var L=a.magnitudeSquared(a.subtract(M,g,Ge));if(L/=a.magnitudeSquared(a.subtract(N,g,Ge)),c(E)){var b=i.fromArray(E,4*A,Xe),F=i.fromArray(E,4*S,Xe),z=v.lerp(b.x,F.x,L),B=v.lerp(b.y,F.y,L),G=v.lerp(b.z,F.z,L),q=v.lerp(b.w,F.w,L);for(n=4*A;n<4*A+8;++n)x.color.values.push(E[n]);for(x.color.values.push(z,B,G,q),x.color.values.push(z,B,G,q),O.color.values.push(z,B,G,q),O.color.values.push(z,B,G,q),n=4*S;n<4*S+8;++n)O.color.values.push(E[n])}if(c(p)){var W=r.fromArray(p,2*A,be),V=r.fromArray(p,2*(t+3),Fe),X=v.lerp(W.x,V.x,L);for(n=2*A;n<2*A+4;++n)x.st.values.push(p[n]);for(x.st.values.push(X,W.y),x.st.values.push(X,V.y),O.st.values.push(X,W.y),O.st.values.push(X,V.y),n=2*S;n<2*S+4;++n)O.st.values.push(p[n])}o=x.position.values.length/3-4,I.push(o,o+2,o+1),I.push(o+1,o+2,o+3),o=O.position.values.length/3-4,w.push(o,o+2,o+1),w.push(o+1,o+2,o+3)}else{var H,Y;for(g.y<0?(H=m.attributes,Y=m.indices):(H=y.attributes,Y=y.indices),H.position.values.push(g.x,g.y,g.z),H.position.values.push(g.x,g.y,g.z),H.position.values.push(N.x,N.y,N.z),H.position.values.push(N.x,N.y,N.z),n=3*t;n<3*t+12;++n)H.prevPosition.values.push(f[n]),H.nextPosition.values.push(h[n]);for(n=2*t;n<2*t+8;++n)H.expandAndWidth.values.push(d[n]),c(p)&&H.st.values.push(p[n]);if(c(E))for(n=4*t;n<4*t+16;++n)H.color.values.push(E[n]);o=H.position.values.length/3-4,Y.push(o,o+2,o+1),Y.push(o+1,o+2,o+3)}}T&&($(m),$(y)),Z(e,m,y)}var te={};te.toWireframe=function(e){var t=e.indices;if(c(t)){switch(e.primitiveType){case S.TRIANGLES:e.indices=x(t);break;case S.TRIANGLE_STRIP:e.indices=I(t);break;case S.TRIANGLE_FAN:e.indices=O(t)}e.primitiveType=S.LINES}return e},te.createLineSegmentsForVectors=function(e,t,r){t=s(t,"normal"),r=s(r,1e4);for(var a=e.attributes.position.values,i=e.attributes[t].values,o=a.length,l=new Float64Array(2*o),f=0,h=0;h<o;h+=3)l[f++]=a[h],l[f++]=a[h+1],l[f++]=a[h+2],l[f++]=a[h]+i[h]*r,l[f++]=a[h+1]+i[h+1]*r,l[f++]=a[h+2]+i[h+2]*r;var E,y=e.boundingSphere;return c(y)&&(E=new n(y.center,y.radius+r)),new d({attributes:{position:new p({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:S.LINES,boundingSphere:E})},te.createAttributeLocations=function(e){var t,n=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","binormal","tangent","compressedAttributes"],r=e.attributes,a={},i=0,o=n.length;for(t=0;t<o;++t){var u=n[t];c(r[u])&&(a[u]=i++)}for(var s in r)r.hasOwnProperty(s)&&!c(a[s])&&(a[s]=i++);return a},te.reorderForPreVertexCache=function(e){var t=d.computeNumberOfVertices(e),n=e.indices;if(c(n)){for(var r=new Int32Array(t),a=0;a<t;a++)r[a]=-1;for(var i,o=n,s=o.length,l=y.createTypedArray(t,s),f=0,h=0,p=0;f<s;)i=r[o[f]],i!==-1?l[h]=i:(i=o[f],r[i]=p,l[h]=p,++p),++f,++h;e.indices=l;var E=e.attributes;for(var m in E)if(E.hasOwnProperty(m)&&c(E[m])&&c(E[m].values)){for(var _=E[m],v=_.values,T=0,R=_.componentsPerAttribute,A=u.createTypedArray(_.componentDatatype,p*R);T<t;){var S=r[T];if(S!==-1)for(a=0;a<R;a++)A[R*S+a]=v[R*T+a];++T}_.values=A}}return e},te.reorderForPostVertexCache=function(e,t){var n=e.indices;if(e.primitiveType===S.TRIANGLES&&c(n)){for(var r=n.length,a=0,i=0;i<r;i++)n[i]>a&&(a=n[i]);e.indices=g.tipsify({indices:n,maximumIndex:a,cacheSize:t})}return e},te.fitToUnsignedShortIndices=function(e){var t=[],n=d.computeNumberOfVertices(e);if(c(e.indices)&&n>=v.SIXTY_FOUR_KILOBYTES){var r,a=[],i=[],o=0,u=w(e.attributes),s=e.indices,l=s.length;e.primitiveType===S.TRIANGLES?r=3:e.primitiveType===S.LINES?r=2:e.primitiveType===S.POINTS&&(r=1);for(var f=0;f<l;f+=r){for(var h=0;h<r;++h){var p=s[f+h],E=a[p];c(E)||(E=o++,a[p]=E,M(u,e.attributes,p)),i.push(E)}o+r>=v.SIXTY_FOUR_KILOBYTES&&(t.push(new d({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),a=[],i=[],o=0,u=w(e.attributes))}0!==i.length&&t.push(new d({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var ne=new a,re=new o;te.projectTo2D=function(e,t,n,r,i){var o=e.attributes[t];i=c(i)?i:new h;for(var s=i.ellipsoid,l=o.values,f=new Float64Array(l.length),d=0,E=0;E<l.length;E+=3){var y=a.fromArray(l,E,ne),m=s.cartesianToCartographic(y,re),_=i.project(m,ne);f[d++]=_.x,f[d++]=_.y,f[d++]=_.z}return e.attributes[n]=o,e.attributes[r]=new p({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:f}),delete e.attributes[t],e};var ae={high:0,low:0};te.encodeAttribute=function(e,t,n,r){for(var a=e.attributes[t],i=a.values,o=i.length,s=new Float32Array(o),c=new Float32Array(o),l=0;l<o;++l)f.encode(i[l],ae),s[l]=ae.high,c[l]=ae.low;var h=a.componentsPerAttribute;return e.attributes[n]=new p({componentDatatype:u.FLOAT,componentsPerAttribute:h,values:s}),e.attributes[r]=new p({componentDatatype:u.FLOAT,componentsPerAttribute:h,values:c}),delete e.attributes[t],e};var ie=new a,oe=new R,ue=new T;te.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(R.equals(t,R.IDENTITY))return e;var r=e.geometry.attributes;C(t,r.position),C(t,r.prevPosition),C(t,r.nextPosition),(c(r.normal)||c(r.binormal)||c(r.tangent))&&(R.inverse(t,oe),R.transpose(oe,oe),R.getRotation(oe,ue),P(ue,r.normal),P(ue,r.binormal),P(ue,r.tangent));var a=e.geometry.boundingSphere;return c(a)&&(e.geometry.boundingSphere=n.transform(a,t,a)),e.modelMatrix=R.clone(R.IDENTITY),e};var se=new a;te.combineInstances=function(e){for(var t=[],n=[],r=e.length,a=0;a<r;++a){var i=e[a];c(i.geometry)?t.push(i):c(i.westHemisphereGeometry)&&c(i.eastHemisphereGeometry)&&n.push(i)}var o=[];return t.length>0&&o.push(U(t,"geometry")),n.length>0&&(o.push(U(n,"westHemisphereGeometry")),o.push(U(n,"eastHemisphereGeometry"))),o};var ce=new a,le=new a,fe=new a,he=new a;te.computeNormal=function(e){for(var t=e.indices,n=e.attributes,r=n.position.values,i=n.position.values.length/3,o=t.length,s=new Array(i),c=new Array(o/3),l=new Array(o),f=0;f<i;f++)s[f]={indexOffset:0,count:0,currentCount:0};var h=0;for(f=0;f<o;f+=3){var d=t[f],E=t[f+1],y=t[f+2],m=3*d,_=3*E,v=3*y;le.x=r[m],le.y=r[m+1],le.z=r[m+2],fe.x=r[_],fe.y=r[_+1],fe.z=r[_+2],he.x=r[v],he.y=r[v+1],he.z=r[v+2],s[d].count++,s[E].count++,s[y].count++,a.subtract(fe,le,fe),a.subtract(he,le,he),c[h]=a.cross(fe,he,new a),h++}var T=0;for(f=0;f<i;f++)s[f].indexOffset+=T,T+=s[f].count;h=0;var R;for(f=0;f<o;f+=3){R=s[t[f]];var A=R.indexOffset+R.currentCount;l[A]=h,R.currentCount++,R=s[t[f+1]],A=R.indexOffset+R.currentCount,l[A]=h,R.currentCount++,R=s[t[f+2]],A=R.indexOffset+R.currentCount,l[A]=h,R.currentCount++,h++}var S=new Float32Array(3*i);for(f=0;f<i;f++){var g=3*f;if(R=s[f],R.count>0){for(a.clone(a.ZERO,ce),h=0;h<R.count;h++)a.add(ce,c[l[R.indexOffset+h]],ce);a.normalize(ce,ce),S[g]=ce.x,S[g+1]=ce.y,S[g+2]=ce.z}else S[g]=0,S[g+1]=0,S[g+2]=1}return e.attributes.normal=new p({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:S}),e};var de=new a,pe=new a,Ee=new a;te.computeBinormalAndTangent=function(e){for(var t=(e.attributes,e.indices),n=e.attributes.position.values,r=e.attributes.normal.values,i=e.attributes.st.values,o=e.attributes.position.values.length/3,s=t.length,c=new Array(3*o),l=0;l<c.length;l++)c[l]=0;var f,h,d;for(l=0;l<s;l+=3){var E=t[l],y=t[l+1],m=t[l+2];f=3*E,h=3*y,d=3*m;var _=2*E,v=2*y,T=2*m,R=n[f],A=n[f+1],S=n[f+2],g=i[_],N=i[_+1],x=i[v+1]-N,I=i[T+1]-N,O=1/((i[v]-g)*I-(i[T]-g)*x),w=(I*(n[h]-R)-x*(n[d]-R))*O,M=(I*(n[h+1]-A)-x*(n[d+1]-A))*O,C=(I*(n[h+2]-S)-x*(n[d+2]-S))*O;c[f]+=w,c[f+1]+=M,c[f+2]+=C,c[h]+=w,c[h+1]+=M,c[h+2]+=C,c[d]+=w,c[d+1]+=M,c[d+2]+=C}var P=new Float32Array(3*o),D=new Float32Array(3*o);for(l=0;l<o;l++){f=3*l,h=f+1,d=f+2;var U=a.fromArray(r,f,de),L=a.fromArray(c,f,Ee),b=a.dot(U,L);a.multiplyByScalar(U,b,pe),a.normalize(a.subtract(L,pe,L),L),D[f]=L.x,D[h]=L.y,D[d]=L.z,a.normalize(a.cross(U,L,L),L),P[f]=L.x,P[h]=L.y,P[d]=L.z}return e.attributes.tangent=new p({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:D}),e.attributes.binormal=new p({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:P}),e};var ye=new r,me=new a,_e=new a,ve=new a;te.compressVertices=function(t){var n=t.attributes.normal,i=t.attributes.st;if(!c(n)&&!c(i))return t;var o,s,l,f,h=t.attributes.tangent,d=t.attributes.binormal;c(n)&&(o=n.values),c(i)&&(s=i.values),c(h)&&(l=h.values),d&&(f=d.values);var E=c(o)?o.length:s.length,y=c(o)?3:2,m=E/y,_=m,v=c(s)&&c(o)?2:1;v+=c(l)||c(f)?1:0,_*=v;for(var T=new Float32Array(_),R=0,A=0;A<m;++A){c(s)&&(r.fromArray(s,2*A,ye),T[R++]=e.compressTextureCoordinates(ye));var S=3*A;c(o)&&c(l)&&c(f)?(a.fromArray(o,S,me),a.fromArray(l,S,_e),a.fromArray(f,S,ve),e.octPack(me,_e,ve,ye),T[R++]=ye.x,T[R++]=ye.y):(c(o)&&(a.fromArray(o,S,me),T[R++]=e.octEncodeFloat(me)),c(l)&&(a.fromArray(l,S,me),T[R++]=e.octEncodeFloat(me)),c(f)&&(a.fromArray(f,S,me),T[R++]=e.octEncodeFloat(me)))}return t.attributes.compressedAttributes=new p({componentDatatype:u.FLOAT,componentsPerAttribute:v,values:T}),c(o)&&delete t.attributes.normal,c(s)&&delete t.attributes.st,c(l)&&delete t.attributes.tangent,c(f)&&delete t.attributes.binormal,t};var Te=new a,Re=new a,Ae=new a,Se=new a,ge=new a,Ne={positions:new Array(7),indices:new Array(9)},xe=new a,Ie=new a,Oe=new a,we=new a,Me=new r,Ce=new r,Pe=new r,De=A.fromPointNormal(a.ZERO,a.UNIT_Y),Ue=new a,Le=new a,be=new r,Fe=new r,ze=new a,Be=new a,Ge=new a,qe=new a,We=new a,Ve=new a,Xe=new i,He=5*v.EPSILON9,Ye=v.EPSILON6;return te.splitLongitude=function(e){var t=e.geometry,r=t.boundingSphere;if(c(r)){var a=r.center.x-r.radius;if(a>0||n.intersectPlane(r,A.ORIGIN_ZX_PLANE)!==m.INTERSECTING)return e}if(t.geometryType!==E.NONE)switch(t.geometryType){case E.POLYLINES:ee(e);break;case E.TRIANGLES:J(e);break;case E.LINES:Q(e)}else q(t),t.primitiveType===S.TRIANGLES?J(e):t.primitiveType===S.LINES&&Q(e);return e},te}),define("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n,r){t(a[n])||(a[n]=!0,console.log(e(r,n)))}var a={};return r.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.",r}),define("ThirdParty/earcut-2.1.1",[],function(){"use strict"; -function e(e,n,a){a=a||2;var i=n&&n.length,o=i?n[0]*a:e.length,u=t(e,0,o,a,!0),c=[];if(!u)return c;var l,f,h,d,p,E,y;if(i&&(u=s(e,n,u,a)),e.length>80*a){l=h=e[0],f=d=e[1];for(var m=a;m<o;m+=a)p=e[m],E=e[m+1],p<l&&(l=p),E<f&&(f=E),p>h&&(h=p),E>d&&(d=E);y=Math.max(h-l,d-f)}return r(u,c,a,l,f,y),c}function t(e,t,n,r,a){var i,o;if(a===O(e,t,n,r)>0)for(i=t;i<n;i+=r)o=N(i,e[i],e[i+1],o);else for(i=n-r;i>=t;i-=r)o=N(i,e[i],e[i+1],o);return o&&v(o,o.next)&&(x(o),o=o.next),o}function n(e,t){if(!e)return e;t||(t=e);var n,r=e;do if(n=!1,r.steiner||!v(r,r.next)&&0!==_(r.prev,r,r.next))r=r.next;else{if(x(r),r=t=r.prev,r===r.next)return null;n=!0}while(n||r!==t);return t}function r(e,t,s,c,l,f,d){if(e){!d&&f&&h(e,c,l,f);for(var p,E,y=e;e.prev!==e.next;)if(p=e.prev,E=e.next,f?i(e,c,l,f):a(e))t.push(p.i/s),t.push(e.i/s),t.push(E.i/s),x(e),e=E.next,y=E.next;else if(e=E,e===y){d?1===d?(e=o(e,t,s),r(e,t,s,c,l,f,2)):2===d&&u(e,t,s,c,l,f):r(n(e),t,s,c,l,f,1);break}}}function a(e){var t=e.prev,n=e,r=e.next;if(_(t,n,r)>=0)return!1;for(var a=e.next.next;a!==e.prev;){if(y(t.x,t.y,n.x,n.y,r.x,r.y,a.x,a.y)&&_(a.prev,a,a.next)>=0)return!1;a=a.next}return!0}function i(e,t,n,r){var a=e.prev,i=e,o=e.next;if(_(a,i,o)>=0)return!1;for(var u=a.x<i.x?a.x<o.x?a.x:o.x:i.x<o.x?i.x:o.x,s=a.y<i.y?a.y<o.y?a.y:o.y:i.y<o.y?i.y:o.y,c=a.x>i.x?a.x>o.x?a.x:o.x:i.x>o.x?i.x:o.x,l=a.y>i.y?a.y>o.y?a.y:o.y:i.y>o.y?i.y:o.y,f=p(u,s,t,n,r),h=p(c,l,t,n,r),d=e.nextZ;d&&d.z<=h;){if(d!==e.prev&&d!==e.next&&y(a.x,a.y,i.x,i.y,o.x,o.y,d.x,d.y)&&_(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(d=e.prevZ;d&&d.z>=f;){if(d!==e.prev&&d!==e.next&&y(a.x,a.y,i.x,i.y,o.x,o.y,d.x,d.y)&&_(d.prev,d,d.next)>=0)return!1;d=d.prevZ}return!0}function o(e,t,n){var r=e;do{var a=r.prev,i=r.next.next;!v(a,i)&&T(a,r,r.next,i)&&A(a,i)&&A(i,a)&&(t.push(a.i/n),t.push(r.i/n),t.push(i.i/n),x(r),x(r.next),r=e=i),r=r.next}while(r!==e);return r}function u(e,t,a,i,o,u){var s=e;do{for(var c=s.next.next;c!==s.prev;){if(s.i!==c.i&&m(s,c)){var l=g(s,c);return s=n(s,s.next),l=n(l,l.next),r(s,t,a,i,o,u),void r(l,t,a,i,o,u)}c=c.next}s=s.next}while(s!==e)}function s(e,r,a,i){var o,u,s,f,h,d=[];for(o=0,u=r.length;o<u;o++)s=r[o]*i,f=o<u-1?r[o+1]*i:e.length,h=t(e,s,f,i,!1),h===h.next&&(h.steiner=!0),d.push(E(h));for(d.sort(c),o=0;o<d.length;o++)l(d[o],a),a=n(a,a.next);return a}function c(e,t){return e.x-t.x}function l(e,t){if(t=f(e,t)){var r=g(t,e);n(r,r.next)}}function f(e,t){var n,r=t,a=e.x,i=e.y,o=-(1/0);do{if(i<=r.y&&i>=r.next.y){var u=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(u<=a&&u>o){if(o=u,u===a){if(i===r.y)return r;if(i===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(a===o)return n.prev;var s,c=n,l=n.x,f=n.y,h=1/0;for(r=n.next;r!==c;)a>=r.x&&r.x>=l&&y(i<f?a:o,i,l,f,i<f?o:a,i,r.x,r.y)&&(s=Math.abs(i-r.y)/(a-r.x),(s<h||s===h&&r.x>n.x)&&A(r,e)&&(n=r,h=s)),r=r.next;return n}function h(e,t,n,r){var a=e;do null===a.z&&(a.z=p(a.x,a.y,t,n,r)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next;while(a!==e);a.prevZ.nextZ=null,a.prevZ=null,d(a)}function d(e){var t,n,r,a,i,o,u,s,c=1;do{for(n=e,e=null,i=null,o=0;n;){for(o++,r=n,u=0,t=0;t<c&&(u++,r=r.nextZ,r);t++);for(s=c;u>0||s>0&&r;)0===u?(a=r,r=r.nextZ,s--):0!==s&&r?n.z<=r.z?(a=n,n=n.nextZ,u--):(a=r,r=r.nextZ,s--):(a=n,n=n.nextZ,u--),i?i.nextZ=a:e=a,a.prevZ=i,i=a;n=r}i.nextZ=null,c*=2}while(o>1);return e}function p(e,t,n,r,a){return e=32767*(e-n)/a,t=32767*(t-r)/a,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function E(e){var t=e,n=e;do t.x<n.x&&(n=t),t=t.next;while(t!==e);return n}function y(e,t,n,r,a,i,o,u){return(a-o)*(t-u)-(e-o)*(i-u)>=0&&(e-o)*(r-u)-(n-o)*(t-u)>=0&&(n-o)*(i-u)-(a-o)*(r-u)>=0}function m(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!R(e,t)&&A(e,t)&&A(t,e)&&S(e,t)}function _(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function v(e,t){return e.x===t.x&&e.y===t.y}function T(e,t,n,r){return!!(v(e,t)&&v(n,r)||v(e,r)&&v(n,t))||_(e,t,n)>0!=_(e,t,r)>0&&_(n,r,e)>0!=_(n,r,t)>0}function R(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&T(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function A(e,t){return _(e.prev,e,e.next)<0?_(e,t,e.next)>=0&&_(e,e.prev,t)>=0:_(e,t,e.prev)<0||_(e,e.next,t)<0}function S(e,t){var n=e,r=!1,a=(e.x+t.x)/2,i=(e.y+t.y)/2;do n.y>i!=n.next.y>i&&a<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function g(e,t){var n=new I(e.i,e.x,e.y),r=new I(t.i,t.x,t.y),a=e.next,i=t.prev;return e.next=t,t.prev=e,n.next=a,a.prev=n,r.next=n,n.prev=r,i.next=r,r.prev=i,r}function N(e,t,n,r){var a=new I(e,t,n);return r?(a.next=r.next,a.prev=r,r.next.prev=a,r.next=a):(a.prev=a,a.next=a),a}function x(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function I(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function O(e,t,n,r){for(var a=0,i=t,o=n-r;i<n;i+=r)a+=(e[o]-e[i])*(e[i+1]+e[o+1]),o=i;return a}return e.deviation=function(e,t,n,r){var a=t&&t.length,i=a?t[0]*n:e.length,o=Math.abs(O(e,0,i,n));if(a)for(var u=0,s=t.length;u<s;u++){var c=t[u]*n,l=u<s-1?t[u+1]*n:e.length;o-=Math.abs(O(e,c,l,n))}var f=0;for(u=0;u<r.length;u+=3){var h=r[u]*n,d=r[u+1]*n,p=r[u+2]*n;f+=Math.abs((e[h]-e[p])*(e[d+1]-e[h+1])-(e[h]-e[d])*(e[p+1]-e[h+1]))}return 0===o&&0===f?0:Math.abs((f-o)/o)},e.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,a=0;a<e.length;a++){for(var i=0;i<e[a].length;i++)for(var o=0;o<t;o++)n.vertices.push(e[a][i][o]);a>0&&(r+=e[a-1].length,n.holes.push(r))}return n},e}),define("Core/WindingOrder",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={CLOCKWISE:t.CW,COUNTER_CLOCKWISE:t.CCW,validate:function(e){return e===n.CLOCKWISE||e===n.COUNTER_CLOCKWISE}};return e(n)}),define("Core/PolygonPipeline",["../ThirdParty/earcut-2.1.1","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./Math","./PrimitiveType","./WindingOrder"],function(e,t,n,r,a,i,o,u,s,c,l,f,h){"use strict";var d=new n,p=new n,E={};E.computeArea2D=function(e){for(var t=e.length,n=0,r=t-1,a=0;a<t;r=a++){var i=e[r],o=e[a];n+=i.x*o.y-o.x*i.y}return.5*n},E.computeWindingOrder2D=function(e){var t=E.computeArea2D(e);return t>0?h.COUNTER_CLOCKWISE:h.CLOCKWISE},E.triangulate=function(n,r){var a=t.packArray(n);return e(a,r,2)};var y=new n,m=new n,_=new n,v=new n,T=new n,R=new n,A=new n;return E.computeSubdivision=function(e,t,o,u){u=a(u,l.RADIANS_PER_DEGREE);var h,d=o.slice(0),p=t.length,E=new Array(3*p),S=0;for(h=0;h<p;h++){var g=t[h];E[S++]=g.x,E[S++]=g.y,E[S++]=g.z}for(var N=[],x={},I=e.maximumRadius,O=l.chordLength(u,I),w=O*O;d.length>0;){var M,C,P=d.pop(),D=d.pop(),U=d.pop(),L=n.fromArray(E,3*U,y),b=n.fromArray(E,3*D,m),F=n.fromArray(E,3*P,_),z=n.multiplyByScalar(n.normalize(L,v),I,v),B=n.multiplyByScalar(n.normalize(b,T),I,T),G=n.multiplyByScalar(n.normalize(F,R),I,R),q=n.magnitudeSquared(n.subtract(z,B,A)),W=n.magnitudeSquared(n.subtract(B,G,A)),V=n.magnitudeSquared(n.subtract(G,z,A)),X=Math.max(q,W,V);X>w?q===X?(M=Math.min(U,D)+" "+Math.max(U,D),h=x[M],i(h)||(C=n.add(L,b,A),n.multiplyByScalar(C,.5,C),E.push(C.x,C.y,C.z),h=E.length/3-1,x[M]=h),d.push(U,h,P),d.push(h,D,P)):W===X?(M=Math.min(D,P)+" "+Math.max(D,P),h=x[M],i(h)||(C=n.add(b,F,A),n.multiplyByScalar(C,.5,C),E.push(C.x,C.y,C.z),h=E.length/3-1,x[M]=h),d.push(D,h,U),d.push(h,P,U)):V===X&&(M=Math.min(P,U)+" "+Math.max(P,U),h=x[M],i(h)||(C=n.add(F,L,A),n.multiplyByScalar(C,.5,C),E.push(C.x,C.y,C.z),h=E.length/3-1,x[M]=h),d.push(P,h,D),d.push(h,U,D)):(N.push(U),N.push(D),N.push(P))}return new s({attributes:{position:new c({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:E})},indices:N,primitiveType:f.TRIANGLES})},E.scaleToGeodeticHeight=function(e,t,r,o){r=a(r,u.WGS84);var s=d,c=p;if(t=a(t,0),o=a(o,!0),i(e))for(var l=e.length,f=0;f<l;f+=3)n.fromArray(e,f,c),o&&(c=r.scaleToGeodeticSurface(c,c)),0!==t&&(s=r.geodeticSurfaceNormal(c,s),n.multiplyByScalar(s,t,s),n.add(c,s,c)),e[f]=c.x,e[f+1]=c.y,e[f+2]=c.z;return e},E}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Intersect"],function(e,t,n,r,a){"use strict";function i(r,a,i){this.minimum=e.clone(t(r,e.ZERO)),this.maximum=e.clone(t(a,e.ZERO)),n(i)?i=e.clone(i):(i=e.add(this.minimum,this.maximum,new e),e.multiplyByScalar(i,.5,i)),this.center=i}i.fromPoints=function(t,r){if(n(r)||(r=new i),!n(t)||0===t.length)return r.minimum=e.clone(e.ZERO,r.minimum),r.maximum=e.clone(e.ZERO,r.maximum),r.center=e.clone(e.ZERO,r.center),r;for(var a=t[0].x,o=t[0].y,u=t[0].z,s=t[0].x,c=t[0].y,l=t[0].z,f=t.length,h=1;h<f;h++){var d=t[h],p=d.x,E=d.y,y=d.z;a=Math.min(p,a),s=Math.max(p,s),o=Math.min(E,o),c=Math.max(E,c),u=Math.min(y,u),l=Math.max(y,l)}var m=r.minimum;m.x=a,m.y=o,m.z=u;var _=r.maximum;_.x=s,_.y=c,_.z=l;var v=e.add(m,_,r.center);return e.multiplyByScalar(v,.5,v),r},i.clone=function(t,r){if(n(t))return n(r)?(r.minimum=e.clone(t.minimum,r.minimum),r.maximum=e.clone(t.maximum,r.maximum),r.center=e.clone(t.center,r.center),r):new i(t.minimum,t.maximum)},i.equals=function(t,r){return t===r||n(t)&&n(r)&&e.equals(t.center,r.center)&&e.equals(t.minimum,r.minimum)&&e.equals(t.maximum,r.maximum)};var o=new e;return i.intersectPlane=function(t,n){o=e.subtract(t.maximum,t.minimum,o);var r=e.multiplyByScalar(o,.5,o),i=n.normal,u=r.x*Math.abs(i.x)+r.y*Math.abs(i.y)+r.z*Math.abs(i.z),s=e.dot(t.center,i)+n.distance;return s-u>0?a.INSIDE:s+u<0?a.OUTSIDE:a.INTERSECTING},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.intersectPlane=function(e){return i.intersectPlane(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,n,r,a){return t(e).then(n,r,a)}function t(e){var t,n;return e instanceof r?t=e:u(e)?(n=o(),e.then(function(e){n.resolve(e)},function(e){n.reject(e)},function(e){n.progress(e)}),t=n.promise):t=a(e),t}function n(t){return e(t,i)}function r(e){this.then=e}function a(e){var n=new r(function(n){try{return t(n?n(e):e)}catch(e){return i(e)}});return n}function i(e){var n=new r(function(n,r){try{return r?t(r(e)):i(e)}catch(e){return i(e)}});return n}function o(){function e(e,t,n){return h(e,t,n)}function n(e){return p(e)}function a(e){return p(i(e))}function u(e){return d(e)}var s,c,l,f,h,d,p;return c=new r(e),s={then:e,resolve:n,reject:a,progress:u,promise:c,resolver:{resolve:n,reject:a,progress:u}},l=[],f=[],h=function(e,t,n){var r,a;return r=o(),a="function"==typeof n?function(e){try{r.progress(n(e))}catch(e){r.progress(e)}}:function(e){r.progress(e)},l.push(function(n){n.then(e,t).then(r.resolve,r.reject,a)}),f.push(a),r.promise},d=function(e){return E(f,e),e},p=function(e){return e=t(e),h=e.then,p=t,d=m,E(l,e),f=l=R,e},s}function u(e){return e&&"function"==typeof e.then}function s(t,n,r,a,i){return y(2,arguments),e(t,function(t){function u(e){E(e)}function s(e){p(e)}var c,l,f,h,d,p,E,y,_,v;if(_=t.length>>>0,c=Math.max(0,Math.min(n,_)),f=[],l=_-c+1,h=[],d=o(),c)for(y=d.progress,E=function(e){h.push(e),--l||(p=E=m,d.reject(h))},p=function(e){f.push(e),--c||(p=E=m,d.resolve(f))},v=0;v<_;++v)v in t&&e(t[v],s,u,y);else d.resolve(f);return d.then(r,a,i)})}function c(e,t,n,r){function a(e){return t?t(e[0]):e[0]}return s(e,1,a,n,r)}function l(e,t,n,r){return y(1,arguments),h(e,_).then(t,n,r)}function f(){return h(arguments,_)}function h(t,n){return e(t,function(t){var r,a,i,u,s,c;if(i=a=t.length>>>0,r=[],c=o(),i)for(u=function(t,a){e(t,n).then(function(e){r[a]=e,--i||c.resolve(r)},c.reject)},s=0;s<a;s++)s in t?u(t[s],s):--i;else c.resolve(r);return c.promise})}function d(t,n){var r=T.call(arguments,1);return e(t,function(t){var a;return a=t.length,r[0]=function(t,r,i){return e(t,function(t){return e(r,function(e){return n(t,e,i,a)})})},v.apply(t,r)})}function p(t,n,r){var a=arguments.length>2;return e(t,function(e){return e=a?r:e,n.resolve(e),e},function(e){return n.reject(e),i(e)},n.progress)}function E(e,t){for(var n,r=0;n=e[r++];)n(t)}function y(e,t){for(var n,r=t.length;r>e;)if(n=t[--r],null!=n&&"function"!=typeof n)throw new Error("arg "+r+" must be a function")}function m(){}function _(e){return e}var v,T,R;return e.defer=o,e.resolve=t,e.reject=n,e.join=f,e.all=l,e.map=h,e.reduce=d,e.any=c,e.some=s,e.chain=p,e.isPromise=u,r.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(R,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return l(t,function(t){return e.apply(R,t)})})}},T=[].slice,v=[].reduce||function(e){var t,n,r,a,i;if(i=0,t=Object(this),a=t.length>>>0,n=arguments,n.length<=1)for(;;){if(i in t){r=t[i++];break}if(++i>=a)throw new TypeError}else r=n[1];for(;i<a;++i)i in t&&(r=e(r,t[i],i,t));return r},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,n){"use strict";function r(e,t){n(e,t)}return r}),define("Core/binarySearch",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e,t,n){for(var r,a,i=0,o=e.length-1;i<=o;)if(r=~~((i+o)/2),a=n(e[r],t),a<0)i=r+1;else{if(!(a>0))return r;o=r-1}return~(o+1)}return n}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,n,r,a){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=r,this.ut1MinusUtc=a}return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,n=0,r=t[n++],a=function(e,t,n,r){n||(n=" ");var a=e.length>=t?"":Array(1+t-e.length>>>0).join(n);return r?e+a:a+e},i=function(e,t,n,r,i,o){var u=r-e.length;return u>0&&(e=n||!i?a(e,r,o,n):e.slice(0,t.length)+a("",u,"0",!0)+e.slice(t.length)),e},o=function(e,t,n,r,o,u,s){var c=e>>>0;return n=n&&c&&{2:"0b",8:"0",16:"0x"}[t]||"",e=n+a(c.toString(t),u||0,"0",!1),i(e,n,r,o,s)},u=function(e,t,n,r,a,o){return null!=r&&(e=e.slice(0,r)),i(e,"",t,n,a,o)},s=function(e,r,s,c,l,f,h){var d,p,E,y,m;if("%%"==e)return"%";for(var _=!1,v="",T=!1,R=!1,A=" ",S=s.length,g=0;s&&g<S;g++)switch(s.charAt(g)){case" ":v=" ";break;case"+":v="+";break;case"-":_=!0;break;case"'":A=s.charAt(g+1);break;case"0":T=!0;break;case"#":R=!0}if(c=c?"*"==c?+t[n++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,c<0&&(c=-c,_=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(f=f?"*"==f?+t[n++]:"*"==f.charAt(0)?+t[f.slice(1,-1)]:+f:"fFeE".indexOf(h)>-1?6:"d"==h?0:void 0,m=r?t[r.slice(0,-1)]:t[n++],h){case"s":return u(String(m),_,c,f,T,A);case"c":return u(String.fromCharCode(+m),_,c,f,T);case"b":return o(m,2,R,_,c,f,T);case"o":return o(m,8,R,_,c,f,T);case"x":return o(m,16,R,_,c,f,T);case"X":return o(m,16,R,_,c,f,T).toUpperCase();case"u":return o(m,10,R,_,c,f,T);case"i":case"d":return d=+m||0,d=Math.round(d-d%1),p=d<0?"-":v,m=p+a(String(Math.abs(d)),f,"0",!1),i(m,p,_,c,T);case"e":case"E":case"f":case"F":case"g":case"G":return d=+m,p=d<0?"-":v,E=["toExponential","toFixed","toPrecision"]["efg".indexOf(h.toLowerCase())],y=["toString","toUpperCase"]["eEfFgG".indexOf(h)%2],m=p+Math.abs(d)[E](f),i(m,p,_,c,T)[y]();default:return e}};return r.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,n,r,a,i,o,u){this.year=e,this.month=t,this.day=n,this.hour=r,this.minute=a,this.second=i,this.millisecond=o,this.isLeapSecond=u}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e(t)}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t){return E.compare(e.julianDate,t.julianDate)}function f(e){v.julianDate=e;var n=E.leapSeconds,r=t(n,v,l);r<0&&(r=~r),r>=n.length&&(r=n.length-1);var a=n[r].offset;if(r>0){var i=E.secondsDifference(n[r].julianDate,e);i>a&&(r--,a=n[r].offset)}E.addSeconds(e,a,e)}function h(e,n){v.julianDate=e;var r=E.leapSeconds,a=t(r,v,l);if(a<0&&(a=~a),0===a)return E.addSeconds(e,-r[0].offset,n);if(a>=r.length)return E.addSeconds(e,-r[a-1].offset,n);var i=E.secondsDifference(r[a].julianDate,e);return 0===i?E.addSeconds(e,-r[a].offset,n):i<=1?void 0:E.addSeconds(e,-r[--a].offset,n)}function d(e,t,n){var r=t/s.SECONDS_PER_DAY|0;return e+=r,t-=s.SECONDS_PER_DAY*r,t<0&&(e--,t+=s.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function p(e,t,n,r,a,i,o){var u=(t-14)/12|0,c=e+4800+u,l=(1461*c/4|0)+(367*(t-2-12*u)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;r-=12,r<0&&(r+=24);var f=i+(r*s.SECONDS_PER_HOUR+a*s.SECONDS_PER_MINUTE+o*s.SECONDS_PER_MILLISECOND);return f>=43200&&(l-=1),[l,f]}function E(e,t,r){this.dayNumber=void 0,this.secondsOfDay=void 0,e=n(e,0),t=n(t,0),r=n(r,c.UTC);var a=0|e;t+=(e-a)*s.SECONDS_PER_DAY,d(a,t,this),r===c.UTC&&f(this)}var y=new i,m=[31,28,31,30,31,30,31,31,30,31,30,31],_=29,v=new u,T=/^(\d{4})$/,R=/^(\d{4})-(\d{2})$/,A=/^(\d{4})-?(\d{3})$/,S=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,g=/^(\d{4})-?(\d{2})-?(\d{2})$/,N=/([Z+\-])?(\d{2})?:?(\d{2})?$/,x=/^(\d{2})(\.\d+)?/.source+N.source,I=/^(\d{2}):?(\d{2})(\.\d+)?/.source+N.source,O=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+N.source;E.fromDate=function(e,t){var n=p(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r(t)?(d(n[0],n[1],t),f(t),t):new E(n[0],n[1],c.UTC)},E.fromIso8601=function(e,t){e=e.replace(",",".");var n,a,i,u=e.split("T"),s=1,l=1,h=0,y=0,v=0,N=0,w=u[0],M=u[1];if(u=w.match(g),null!==u)n=+u[1],s=+u[2],l=+u[3];else if(u=w.match(R),null!==u)n=+u[1],s=+u[2];else if(u=w.match(T),null!==u)n=+u[1];else{var C;if(u=w.match(A),null!==u)n=+u[1],C=+u[2],i=o(n);else if(u=w.match(S),null!==u){n=+u[1];var P=+u[2],D=+u[3]||0,U=new Date(Date.UTC(n,0,4));C=7*P+D-U.getUTCDay()-3}a=new Date(Date.UTC(n,0,1)),a.setUTCDate(C),s=a.getUTCMonth()+1,l=a.getUTCDate()}i=o(n);var L;if(r(M)){u=M.match(O),null!==u?(h=+u[1],y=+u[2],v=+u[3],N=1e3*+(u[4]||0),L=5):(u=M.match(I),null!==u?(h=+u[1],y=+u[2],v=60*+(u[3]||0),L=4):(u=M.match(x),null!==u&&(h=+u[1],y=60*+(u[2]||0),L=3)));var b=u[L],F=+u[L+1],z=+(u[L+2]||0);switch(b){case"+":h-=F,y-=z;break;case"-":h+=F,y+=z;break;case"Z":break;default:y+=new Date(Date.UTC(n,s-1,l,h,y)).getTimezoneOffset()}}else y+=new Date(n,s-1,l).getTimezoneOffset();var B=60===v;for(B&&v--;y>=60;)y-=60,h++;for(;h>=24;)h-=24,l++;for(a=i&&2===s?_:m[s-1];l>a;)l-=a,s++,s>12&&(s-=12,n++),a=i&&2===s?_:m[s-1];for(;y<0;)y+=60,h--;for(;h<0;)h+=24,l--;for(;l<1;)s--,s<1&&(s+=12,n--),a=i&&2===s?_:m[s-1],l+=a;var G=p(n,s,l,h,y,v,N);return r(t)?(d(G[0],G[1],t),f(t)):t=new E(G[0],G[1],c.UTC),B&&E.addSeconds(t,1,t),t},E.now=function(e){return E.fromDate(new Date,e)};var w=new E(0,0,c.TAI);return E.toGregorianDate=function(e,t){var n=!1,a=h(e,w);r(a)||(E.addSeconds(e,-1,w),a=h(w,w),n=!0);var o=a.dayNumber,u=a.secondsOfDay;u>=43200&&(o+=1);var c=o+68569|0,l=4*c/146097|0;c=c-((146097*l+3)/4|0)|0;var f=4e3*(c+1)/1461001|0;c=c-(1461*f/4|0)+31|0;var d=80*c/2447|0,p=c-(2447*d/80|0)|0;c=d/11|0;var y=d+2-12*c|0,m=100*(l-49)+f+c|0,_=u/s.SECONDS_PER_HOUR|0,v=u-_*s.SECONDS_PER_HOUR,T=v/s.SECONDS_PER_MINUTE|0;v-=T*s.SECONDS_PER_MINUTE;var R=0|v,A=(v-R)/s.SECONDS_PER_MILLISECOND;return _+=12,_>23&&(_-=24),n&&(R+=1),r(t)?(t.year=m,t.month=y,t.day=p,t.hour=_,t.minute=T,t.second=R,t.millisecond=A,t.isLeapSecond=n,t):new i(m,y,p,_,T,R,A,n)},E.toDate=function(e){var t=E.toGregorianDate(e,y),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))},E.toIso8601=function(t,n){var a,i=E.toGregorianDate(t,i);return r(n)||0===i.millisecond?r(n)&&0!==n?(a=(.01*i.millisecond).toFixed(n).replace(".","").slice(0,n),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",i.year,i.month,i.day,i.hour,i.minute,i.second):(a=(.01*i.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a))},E.clone=function(e,t){if(r(e))return r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new E(e.dayNumber,e.secondsOfDay,c.TAI)},E.compare=function(e,t){var n=e.dayNumber-t.dayNumber;return 0!==n?n:e.secondsOfDay-t.secondsOfDay},E.equals=function(e,t){return e===t||r(e)&&r(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},E.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(E.secondsDifference(e,t))<=n},E.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},E.secondsDifference=function(e,t){var n=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return n+(e.secondsOfDay-t.secondsOfDay)},E.daysDifference=function(e,t){var n=e.dayNumber-t.dayNumber,r=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return n+r},E.computeTaiMinusUtc=function(e){v.julianDate=e;var n=E.leapSeconds,r=t(n,v,l);return r<0&&(r=~r,--r,r<0&&(r=0)),n[r].offset},E.addSeconds=function(e,t,n){return d(e.dayNumber,e.secondsOfDay+t,n)},E.addMinutes=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return d(e.dayNumber,r,n)},E.addHours=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return d(e.dayNumber,r,n)},E.addDays=function(e,t,n){var r=e.dayNumber+t;return d(r,e.secondsOfDay,n)},E.lessThan=function(e,t){return E.compare(e,t)<0},E.lessThanOrEquals=function(e,t){return E.compare(e,t)<=0},E.greaterThan=function(e,t){return E.compare(e,t)>0},E.greaterThanOrEquals=function(e,t){return E.compare(e,t)>=0},E.prototype.clone=function(e){return E.clone(this,e)},E.prototype.equals=function(e){return E.equals(this,e)},E.prototype.equalsEpsilon=function(e,t){return E.equalsEpsilon(this,e,t)},E.prototype.toString=function(){return E.toIso8601(this)},E.leapSeconds=[new u(new E(2441317,43210,c.TAI),10),new u(new E(2441499,43211,c.TAI),11),new u(new E(2441683,43212,c.TAI),12),new u(new E(2442048,43213,c.TAI),13),new u(new E(2442413,43214,c.TAI),14),new u(new E(2442778,43215,c.TAI),15),new u(new E(2443144,43216,c.TAI),16),new u(new E(2443509,43217,c.TAI),17),new u(new E(2443874,43218,c.TAI),18),new u(new E(2444239,43219,c.TAI),19),new u(new E(2444786,43220,c.TAI),20),new u(new E(2445151,43221,c.TAI),21),new u(new E(2445516,43222,c.TAI),22),new u(new E(2446247,43223,c.TAI),23),new u(new E(2447161,43224,c.TAI),24),new u(new E(2447892,43225,c.TAI),25),new u(new E(2448257,43226,c.TAI),26),new u(new E(2448804,43227,c.TAI),27),new u(new E(2449169,43228,c.TAI),28),new u(new E(2449534,43229,c.TAI),29),new u(new E(2450083,43230,c.TAI),30),new u(new E(2450630,43231,c.TAI),31),new u(new E(2451179,43232,c.TAI),32),new u(new E(2453736,43233,c.TAI),33),new u(new E(2454832,43234,c.TAI),34),new u(new E(2456109,43235,c.TAI),35),new u(new E(2457204,43236,c.TAI),36),new u(new E(2457754,43237,c.TAI),37)],E}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(n,r){if(null===n||"object"!=typeof n)return n;r=e(r,!1);var a=new n.constructor;for(var i in n)if(n.hasOwnProperty(i)){var o=n[i];r&&(o=t(o,r)),a[i]=o}return a}return t}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var n=e.split("\r\n"),r=0;r<n.length;++r){var a=n[r],i=a.indexOf(": ");if(i>0){var o=a.substring(0,i),u=a.substring(i+2);t[o]=u}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function n(e,n,r){this.statusCode=e,this.response=n,this.responseHeaders=r,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return n.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},n}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var n=r.exec(t);this.scheme=n[1],this.authority=n[2],this.path=n[3],this.query=n[4],this.fragment=n[5]}}function t(e){var t=unescape(e);return i.test(t)?t:e.toUpperCase()}function n(e,t,n,r){return(t||"")+n.toLowerCase()+(r||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var r=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(o,n).replace(a,t)),this.path&&(this.path=this.path.replace(a,t)),this.query&&(this.query=this.query.replace(a,t)),this.fragment&&(this.fragment=this.fragment.replace(a,t))};var a=/%[0-9a-z]{2}/gi,i=/[a-zA-Z0-9\-\._~]/,o=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var n=new e;return this.scheme?(n.scheme=this.scheme,n.authority=this.authority,n.path=this.path,n.query=this.query):(n.scheme=t.scheme,this.authority?(n.authority=this.authority,n.path=this.path,n.query=this.query):(n.authority=t.authority,""==this.path?(n.path=t.path,n.query=this.query||t.query):("/"==this.path.charAt(0)?(n.path=this.path,n.removeDotSegments()):(t.authority&&""==t.path?n.path="/"+this.path:n.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,n.removeDotSegments()),n.query=this.query))),n.fragment=this.fragment,n},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),n=[],r=""==t[0];r&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?n.pop():"."!=e&&n.push(e);"."!=e&&".."!=e||n.push(""),r&&n.unshift(""),this.path=n.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n){var r=new e(n);r.normalize();var a=r.getAuthority();if(t(a)){if(a.indexOf("@")!==-1){var i=a.split("@");a=i[1]}if(a.indexOf(":")===-1){var o=r.getScheme();if(t(o)||(o=window.location.protocol,o=o.substring(0,o.length-1)),"http"===o)a+=":80";else{if("https"!==o)return;a+=":443"}}return a}}var a={},i={};return a.add=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])||(i[r]=!0)},a.remove=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])&&delete i[r]},a.contains=function(e){var n=r(e);return!(!t(n)||!t(i[n]))},a.clear=function(){i={}},a}),define("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,n,r,a,i,o){"use strict";function u(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,a=t(n.method,"GET"),i=n.data,o=n.headers,s=n.overrideMimeType;return e(n.url,function(t){var n=e.defer();return u.load(t,r,a,i,o,n,s),n.promise})}function s(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function c(e,t){for(var n=s(e,t),r=new ArrayBuffer(n.length),a=new Uint8Array(r),i=0;i<n.length;i++)a[i]=n.charCodeAt(i);return r}function l(e,n){n=t(n,"");var r=e[1],a=!!e[2],i=e[3];switch(n){case"":case"text":return s(a,i);case"arraybuffer":return c(a,i);case"blob":var o=c(a,i);return new Blob([o],{type:r});case"document":var u=new DOMParser;return u.parseFromString(s(a,i),r);case"json":return JSON.parse(s(a,i))}}var f=/^data:(.*?)(;base64)?,(.*)$/;return u.load=function(e,t,r,u,s,c,h){var d=f.exec(e);if(null!==d)return void c.resolve(l(d,t));var p=new XMLHttpRequest;if(o.contains(e)&&(p.withCredentials=!0),n(h)&&n(p.overrideMimeType)&&p.overrideMimeType(h),p.open(r,e,!0),n(s))for(var E in s)s.hasOwnProperty(E)&&p.setRequestHeader(E,s[E]);n(t)&&(p.responseType=t),p.onload=function(){if(p.status<200||p.status>=300)return void c.reject(new a(p.status,p.response,p.getAllResponseHeaders()));var e=p.response,r=p.responseType;if(!n(e)||n(t)&&r!==t)if("json"===t&&"string"==typeof e)try{c.resolve(JSON.parse(e))}catch(e){c.reject(e)}else(""===r||"document"===r)&&n(p.responseXML)&&p.responseXML.hasChildNodes()?c.resolve(p.responseXML):""!==r&&"text"!==r||!n(p.responseText)?c.reject(new i("Invalid XMLHttpRequest response type.")):c.resolve(p.responseText);else c.resolve(e)},p.onerror=function(e){c.reject(new a)},p.send(u)},u.defaultLoad=u.load,u}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,n){return e({url:t,headers:n})}return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";function a(n,a){return t(a)?t(a.Accept)||(a=e(a),a.Accept=i.Accept):a=i,r(n,a).then(function(e){return JSON.parse(e)})}var i={Accept:"application/json,*/*;q=0.01"};return a}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(t){if(t=n(t,n.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=n(t.addNewLeapSeconds,!0),r(t.data))p(this,t.data);else if(r(t.url)){var a=this;this._downloadPromise=e(s(t.url),function(e){p(a,e)},function(){a._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else p(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function d(e,t){return o.compare(e.julianDate,t)}function p(e,n){if(!r(n.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!r(n.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var a=n.columnNames.indexOf("modifiedJulianDateUtc"),i=n.columnNames.indexOf("xPoleWanderRadians"),s=n.columnNames.indexOf("yPoleWanderRadians"),c=n.columnNames.indexOf("ut1MinusUtcSeconds"),h=n.columnNames.indexOf("xCelestialPoleOffsetRadians"),p=n.columnNames.indexOf("yCelestialPoleOffsetRadians"),E=n.columnNames.indexOf("taiMinusUtcSeconds"); -if(a<0||i<0||s<0||c<0||h<0||p<0||E<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var y=e._samples=n.samples,m=e._dates=[];e._dateColumn=a,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=h,e._yCelestialPoleOffsetRadiansColumn=p,e._taiMinusUtcSecondsColumn=E,e._columnCount=n.columnNames.length,e._lastIndex=void 0;for(var _,v=e._addNewLeapSeconds,T=0,R=y.length;T<R;T+=e._columnCount){var A=y[T+a],S=y[T+E],g=A+l.MODIFIED_JULIAN_DATE_DIFFERENCE,N=new o(g,S,f.TAI);if(m.push(N),v){if(S!==_&&r(_)){var x=o.leapSeconds,I=t(x,N,d);if(I<0){var O=new u(N,S);x.splice(~I,0,O)}}_=S}}}function E(e,t,n,r,a){var i=n*r;a.xPoleWander=t[i+e._xPoleWanderRadiansColumn],a.yPoleWander=t[i+e._yPoleWanderRadiansColumn],a.xPoleOffset=t[i+e._xCelestialPoleOffsetRadiansColumn],a.yPoleOffset=t[i+e._yCelestialPoleOffsetRadiansColumn],a.ut1MinusUtc=t[i+e._ut1MinusUtcSecondsColumn]}function y(e,t,n){return t+e*(n-t)}function m(e,t,n,r,a,i,u){var s=e._columnCount;if(i>t.length-1)return u.xPoleWander=0,u.yPoleWander=0,u.xPoleOffset=0,u.yPoleOffset=0,u.ut1MinusUtc=0,u;var c=t[a],l=t[i];if(c.equals(l)||r.equals(c))return E(e,n,a,s,u),u;if(r.equals(l))return E(e,n,i,s,u),u;var f=o.secondsDifference(r,c)/o.secondsDifference(l,c),h=a*s,d=i*s,p=n[h+e._ut1MinusUtcSecondsColumn],m=n[d+e._ut1MinusUtcSecondsColumn],_=m-p;if(_>.5||_<-.5){var v=n[h+e._taiMinusUtcSecondsColumn],T=n[d+e._taiMinusUtcSecondsColumn];v!==T&&(l.equals(r)?p=m:m-=T-v)}return u.xPoleWander=y(f,n[h+e._xPoleWanderRadiansColumn],n[d+e._xPoleWanderRadiansColumn]),u.yPoleWander=y(f,n[h+e._yPoleWanderRadiansColumn],n[d+e._yPoleWanderRadiansColumn]),u.xPoleOffset=y(f,n[h+e._xCelestialPoleOffsetRadiansColumn],n[d+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=y(f,n[h+e._yCelestialPoleOffsetRadiansColumn],n[d+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=y(f,p,m),u}return h.NONE=i({getPromiseToLoad:function(){return e()},compute:function(e,t){return r(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new a(0,0,0,0,0),t}}),h.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},h.prototype.compute=function(e,n){if(r(this._samples)){if(r(n)||(n=new a(0,0,0,0,0)),0===this._samples.length)return n.xPoleWander=0,n.yPoleWander=0,n.xPoleOffset=0,n.yPoleOffset=0,n.ut1MinusUtc=0,n;var i=this._dates,u=this._lastIndex,s=0,l=0;if(r(u)){var f=i[u],h=i[u+1],d=o.lessThanOrEquals(f,e),p=!r(h),E=p||o.greaterThanOrEquals(h,e);if(d&&E)return s=u,!p&&h.equals(e)&&++s,l=s+1,m(this,i,this._samples,e,s,l,n),n}var y=t(i,e,o.compare,this._dateColumn);return y>=0?(y<i.length-1&&i[y+1].equals(e)&&++y,s=y,l=y):(l=~y,s=l-1,s<0&&(s=0)),this._lastIndex=s,m(this,i,this._samples,e,s,l,n),n}if(r(this._dataError))throw new c(this._dataError)},h}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(t,n,r){this.heading=e(t,0),this.pitch=e(n,0),this.roll=e(r,0)}return a.fromQuaternion=function(e,n){t(n)||(n=new a);var r=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return n.heading=-Math.atan2(s,u),n.roll=Math.atan2(o,i),n.pitch=-Math.asin(r),n},a.fromDegrees=function(e,n,i,o){return t(o)||(o=new a),o.heading=e*r.RADIANS_PER_DEGREE,o.pitch=n*r.RADIANS_PER_DEGREE,o.roll=i*r.RADIANS_PER_DEGREE,o},a.clone=function(e,n){if(t(e))return t(n)?(n.heading=e.heading,n.pitch=e.pitch,n.roll=e.roll,n):new a(e.heading,e.pitch,e.roll)},a.equals=function(e,n){return e===n||t(e)&&t(n)&&e.heading===n.heading&&e.pitch===n.pitch&&e.roll===n.roll},a.equalsEpsilon=function(e,n,a,i){return e===n||t(e)&&t(n)&&r.equalsEpsilon(e.heading,n.heading,a,i)&&r.equalsEpsilon(e.pitch,n.pitch,a,i)&&r.equalsEpsilon(e.roll,n.roll,a,i)},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,n){return a.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},a}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=t(r,document.location.href);var a=new e(r),i=new e(n);return i.resolve(a).toString()}return a}),define("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(r,a,i){i=t(i,!0),r instanceof e||(r=new e(r)),a instanceof e||(a=new e(a)),n(a.authority)&&!n(a.scheme)&&("undefined"!=typeof document&&n(document.location)&&n(document.location.href)?a.scheme=new e(document.location.href).scheme:a.scheme=r.scheme);var o=r;a.isAbsolute()&&(o=a);var u="";n(o.scheme)&&(u+=o.scheme+":"),n(o.authority)&&(u+="//"+o.authority,""!==o.path&&"/"!==o.path&&(u=u.replace(/\/?$/,"/"),o.path=o.path.replace(/^\/?/g,""))),u+=o===r?i?r.path.replace(/\/?$/,"/")+a.path.replace(/^\/?/g,""):r.path+a.path:a.path;var s=n(r.query),c=n(a.query);s&&c?u+="?"+r.query+"&"+a.query:s&&!c?u+="?"+r.query:!s&&c&&(u+="?"+a.query);var l=n(a.fragment);return n(r.fragment)&&!l?u+="#"+r.fragment:l&&(u+="#"+a.fragment),u}return a}),define("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","./joinUrls","require"],function(e,t,n,r,a,i){"use strict";function o(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;t<n;++t){var r=e[t].getAttribute("src"),a=p.exec(r);if(null!==a)return a[1]}}function u(){if(t(f))return f;var n;return n="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:o(),f=new e(r(n))}function s(e){return i.toUrl("../"+e)}function c(e){return a(u(),e)}function l(e){t(h)||(h=t(i.toUrl)?s:c),t(d)||(d=document.createElement("a"));var n=h(e);return d.href=n,d.href=d.href,d.href}var f,h,d,p=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return l._cesiumScriptRegex=p,l.setBaseUrl=function(t){f=new e(t).resolve(new e(document.location.href))},l}),define("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,n){this.x=e,this.y=t,this.s=n}return e}),define("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){e=n(e,n.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=n(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=n(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new i(this._sampleZeroJulianEphemerisDate,0,u.TAI),this._stepSizeDays=n(e.stepSizeDays,1),this._samplesPerXysFile=n(e.samplesPerXysFile,1e3),this._totalSamples=n(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,r=this._denominators=new Array(t+1),a=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t),s=0;s<=t;++s){r[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;c<=t;++c)c!==s&&(r[s]*=s-c);r[s]=1/r[s]}this._work=new Array(t+1),this._coef=new Array(t+1)}function c(e,t,n){var r=f;return r.dayNumber=t,r.secondsOfDay=n,i.daysDifference(r,e._sampleZeroDateTT)}function l(n,a){if(n._chunkDownloadsInProgress[a])return n._chunkDownloadsInProgress[a];var i=e.defer();n._chunkDownloadsInProgress[a]=i;var u,s=n._xysFileUrlTemplate;return u=r(s)?s.replace("{0}",a):t("Assets/IAU2006_XYS/IAU2006_XYS_"+a+".json"),e(o(u),function(e){n._chunkDownloadsInProgress[a]=!1;for(var t=n._samples,r=e.samples,o=a*n._samplesPerXysFile*3,u=0,s=r.length;u<s;++u)t[o+u]=r[u];i.resolve()}),i.promise}var f=new i(0,0,u.TAI);return s.prototype.preload=function(t,n,r,a){var i=c(this,t,n),o=c(this,r,a),u=i/this._stepSizeDays-this._interpolationOrder/2|0;u<0&&(u=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var f=u/this._samplesPerXysFile|0,h=s/this._samplesPerXysFile|0,d=[],p=f;p<=h;++p)d.push(l(this,p));return e.all(d)},s.prototype.computeXysRadians=function(e,t,n){var i=c(this,e,t);if(!(i<0)){var o=i/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);s<0&&(s=0);var f=s+u;f>=this._totalSamples&&(f=this._totalSamples-1,s=f-u,s<0&&(s=0));var h=!1,d=this._samples;if(r(d[3*s])||(l(this,s/this._samplesPerXysFile|0),h=!0),r(d[3*f])||(l(this,f/this._samplesPerXysFile|0),h=!0),!h){r(n)?(n.x=0,n.y=0,n.s=0):n=new a(0,0,0);var p,E,y=i-s*this._stepSizeDays,m=this._work,_=this._denominators,v=this._coef,T=this._xTable;for(p=0;p<=u;++p)m[p]=y-T[p];for(p=0;p<=u;++p){for(v[p]=1,E=0;E<=u;++E)E!==p&&(v[p]*=m[E]);v[p]*=_[p];var R=3*(s+p);n.x+=v[p]*d[R++],n.y+=v[p]*d[R++],n.s+=v[p]*d[R]}return n}}}},s}),define("Core/Quaternion",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math","./Matrix3"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,n,r,a){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(a,0)}var c=new e;s.fromAxisAngle=function(t,r,a){var i=r/2,o=Math.sin(i);c=e.normalize(t,c);var u=c.x*o,l=c.y*o,f=c.z*o,h=Math.cos(i);return n(a)?(a.x=u,a.y=l,a.z=f,a.w=h,a):new s(u,l,f,h)};var l=[1,2,0],f=new Array(3);s.fromRotationMatrix=function(e,t){var r,a,i,o,c,h=e[u.COLUMN0ROW0],d=e[u.COLUMN1ROW1],p=e[u.COLUMN2ROW2],E=h+d+p;if(E>0)r=Math.sqrt(E+1),c=.5*r,r=.5/r,a=(e[u.COLUMN1ROW2]-e[u.COLUMN2ROW1])*r,i=(e[u.COLUMN2ROW0]-e[u.COLUMN0ROW2])*r,o=(e[u.COLUMN0ROW1]-e[u.COLUMN1ROW0])*r;else{var y=l,m=0;d>h&&(m=1),p>h&&p>d&&(m=2);var _=y[m],v=y[_];r=Math.sqrt(e[u.getElementIndex(m,m)]-e[u.getElementIndex(_,_)]-e[u.getElementIndex(v,v)]+1);var T=f;T[m]=.5*r,r=.5/r,c=(e[u.getElementIndex(v,_)]-e[u.getElementIndex(_,v)])*r,T[_]=(e[u.getElementIndex(_,m)]+e[u.getElementIndex(m,_)])*r,T[v]=(e[u.getElementIndex(v,m)]+e[u.getElementIndex(m,v)])*r,a=-T[0],i=-T[1],o=-T[2]}return n(t)?(t.x=a,t.y=i,t.z=o,t.w=c,t):new s(a,i,o,c)};var h=new s;s.fromHeadingPitchRoll=function(t,n,r,a){var i=s.fromAxisAngle(e.UNIT_X,r,h),o=s.fromAxisAngle(e.UNIT_Y,-n,a);a=s.multiply(o,i,o);var u=s.fromAxisAngle(e.UNIT_Z,-t,h);return s.multiply(u,a,a)};var d=new e,p=new e,E=new s,y=new s,m=new s;s.packedLength=4,s.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},s.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new s),a.x=e[r],a.y=e[r+1],a.z=e[r+2],a.w=e[r+3],a},s.packedInterpolationLength=3,s.convertPackedArrayForInterpolation=function(e,t,n,r){s.unpack(e,4*n,m),s.conjugate(m,m);for(var a=0,i=n-t+1;a<i;a++){var o=3*a;s.unpack(e,4*(t+a),E),s.multiply(E,m,E),E.w<0&&s.negate(E,E),s.computeAxis(E,d);var u=s.computeAngle(E);r[o]=d.x*u,r[o+1]=d.y*u,r[o+2]=d.z*u}},s.unpackInterpolationResult=function(t,r,a,i,o){n(o)||(o=new s),e.fromArray(t,0,p);var u=e.magnitude(p);return s.unpack(r,4*i,y),0===u?s.clone(s.IDENTITY,E):s.fromAxisAngle(p,u,E),s.multiply(E,y,o)},s.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new s(e.x,e.y,e.z,e.w)},s.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},s.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},s.magnitude=function(e){return Math.sqrt(s.magnitudeSquared(e))},s.normalize=function(e,t){var n=1/s.magnitude(e),r=e.x*n,a=e.y*n,i=e.z*n,o=e.w*n;return t.x=r,t.y=a,t.z=i,t.w=o,t},s.inverse=function(e,t){var n=s.magnitudeSquared(e);return t=s.conjugate(e,t),s.multiplyByScalar(t,1/n,t)},s.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},s.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},s.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},s.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},s.multiply=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=e.w,u=t.x,s=t.y,c=t.z,l=t.w,f=o*u+r*l+a*c-i*s,h=o*s-r*c+a*l+i*u,d=o*c+r*s-a*u+i*l,p=o*l-r*u-a*s-i*c;return n.x=f,n.y=h,n.z=d,n.w=p,n},s.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},s.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},s.computeAxis=function(e,t){var n=e.w;if(Math.abs(n-1)<o.EPSILON6)return t.x=t.y=t.z=0,t;var r=1/Math.sqrt(1-n*n);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},s.computeAngle=function(e){return Math.abs(e.w-1)<o.EPSILON6?0:2*Math.acos(e.w)};var _=new s;s.lerp=function(e,t,n,r){return _=s.multiplyByScalar(t,n,_),r=s.multiplyByScalar(e,1-n,r),s.add(_,r,r)};var v=new s,T=new s,R=new s;s.slerp=function(e,t,n,r){var a=s.dot(e,t),i=t;if(a<0&&(a=-a,i=v=s.negate(t,v)),1-a<o.EPSILON6)return s.lerp(e,i,n,r);var u=Math.acos(a);return T=s.multiplyByScalar(e,Math.sin((1-n)*u),T),R=s.multiplyByScalar(i,Math.sin(n*u),R),r=s.add(T,R,r),s.multiplyByScalar(r,1/Math.sin(u),r)},s.log=function(t,n){var r=o.acosClamped(t.w),a=0;return 0!==r&&(a=r/Math.sin(r)),e.multiplyByScalar(t,a,n)},s.exp=function(t,n){var r=e.magnitude(t),a=0;return 0!==r&&(a=Math.sin(r)/r),n.x=t.x*a,n.y=t.y*a,n.z=t.z*a,n.w=Math.cos(r),n};var A=new e,S=new e,g=new s,N=new s;s.computeInnerQuadrangle=function(t,n,r,a){var i=s.conjugate(n,g);s.multiply(i,r,N);var o=s.log(N,A);s.multiply(i,t,N);var u=s.log(N,S);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),s.exp(o,g),s.multiply(n,g,a)},s.squad=function(e,t,n,r,a,i){var o=s.slerp(e,t,a,g),u=s.slerp(n,r,a,N);return s.slerp(o,u,2*a*(1-a),i)};for(var x=new s,I=1.9011074535173003,O=a.supportsTypedArrays()?new Float32Array(8):[],w=a.supportsTypedArrays()?new Float32Array(8):[],M=a.supportsTypedArrays()?new Float32Array(8):[],C=a.supportsTypedArrays()?new Float32Array(8):[],P=0;P<7;++P){var D=P+1,U=2*D+1;O[P]=1/(D*U),w[P]=D/U}return O[7]=I/136,w[7]=8*I/17,s.fastSlerp=function(e,t,n,r){var a,i=s.dot(e,t);i>=0?a=1:(a=-1,i=-i);for(var o=i-1,u=1-n,c=n*n,l=u*u,f=7;f>=0;--f)M[f]=(O[f]*c-w[f])*o,C[f]=(O[f]*l-w[f])*o;var h=a*n*(1+M[0]*(1+M[1]*(1+M[2]*(1+M[3]*(1+M[4]*(1+M[5]*(1+M[6]*(1+M[7])))))))),d=u*(1+C[0]*(1+C[1]*(1+C[2]*(1+C[3]*(1+C[4]*(1+C[5]*(1+C[6]*(1+C[7])))))))),p=s.multiplyByScalar(e,d,x);return s.multiplyByScalar(t,h,r),s.add(p,r,r)},s.fastSquad=function(e,t,n,r,a,i){var o=s.fastSlerp(e,t,a,g),u=s.fastSlerp(n,r,a,N);return s.fastSlerp(o,u,2*a*(1-a),i)},s.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},s.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.x-t.x)<=r&&Math.abs(e.y-t.y)<=r&&Math.abs(e.z-t.z)<=r&&Math.abs(e.w-t.w)<=r},s.ZERO=i(new s(0,0,0,0)),s.IDENTITY=i(new s(0,0,0,1)),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.x+", "+this.y+", "+this.z+", "+this.w+")"},s}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./defaultValue","./defined","./deprecationWarning","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./HeadingPitchRoll","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,p,E,y,m,_,v,T){"use strict";var R={},A=new n,S=new n,g=new n;R.eastNorthUpToFixedFrame=function(e,t,r){if(y.equalsEpsilon(e.x,0,y.EPSILON14)&&y.equalsEpsilon(e.y,0,y.EPSILON14)){var a=y.sign(e.z);return o(r)?(r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=-a,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=a,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(0,-a,0,e.x,1,0,0,e.y,0,0,a,e.z,0,0,0,1)}var u=A,s=S,c=g;return t=i(t,f.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,c),o(r)?(r[0]=s.x,r[1]=s.y,r[2]=s.z,r[3]=0,r[4]=c.x,r[5]=c.y,r[6]=c.z,r[7]=0,r[8]=u.x,r[9]=u.y,r[10]=u.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(s.x,c.x,u.x,e.x,s.y,c.y,u.y,e.y,s.z,c.z,u.z,e.z,0,0,0,1)};var N=new n,x=new n,I=new n;R.northEastDownToFixedFrame=function(e,t,r){if(y.equalsEpsilon(e.x,0,y.EPSILON14)&&y.equalsEpsilon(e.y,0,y.EPSILON14)){var a=y.sign(e.z);return o(r)?(r[0]=-a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=-a,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(-a,0,0,e.x,0,1,0,e.y,0,0,-a,e.z,0,0,0,1)}var u=N,s=x,c=I;return t=i(t,f.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,c),o(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=s.x,r[5]=s.y,r[6]=s.z,r[7]=0,r[8]=-u.x,r[9]=-u.y,r[10]=-u.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(c.x,s.x,-u.x,e.x,c.y,s.y,-u.y,e.y,c.z,s.z,-u.z,e.z,0,0,0,1)},R.northUpEastToFixedFrame=function(e,t,r){if(y.equalsEpsilon(e.x,0,y.EPSILON14)&&y.equalsEpsilon(e.y,0,y.EPSILON14)){var a=y.sign(e.z);return o(r)?(r[0]=-a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=a,r[7]=0,r[8]=0,r[9]=1,r[10]=0,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(-a,0,0,e.x,0,0,1,e.y,0,a,0,e.z,0,0,0,1)}var u=A,s=S,c=g;return t=i(t,f.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,c),o(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=u.x,r[5]=u.y,r[6]=u.z,r[7]=0,r[8]=s.x,r[9]=s.y,r[10]=s.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(c.x,u.x,s.x,e.x,c.y,u.y,s.y,e.y,c.z,u.z,s.z,e.z,0,0,0,1)},R.northWestUpToFixedFrame=function(e,t,r){if(y.equalsEpsilon(e.x,0,y.EPSILON14)&&y.equalsEpsilon(e.y,0,y.EPSILON14)){var a=y.sign(e.z);return o(r)?(r[0]=-a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=a,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(-a,0,0,e.x,0,-1,0,e.y,0,0,a,e.z,0,0,0,1)}var u=A,s=S,c=g;return t=i(t,f.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,c),o(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=-s.x,r[5]=-s.y,r[6]=-s.z,r[7]=0,r[8]=u.x,r[9]=u.y,r[10]=u.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(c.x,-s.x,u.x,e.x,c.y,-s.y,u.y,e.y,c.z,-s.z,u.z,e.z,0,0,0,1)};var O=new v,w=new n(1,1,1),M=new _;R.headingPitchRollToFixedFrame=function(e,t,r,a,i,o){var s;"object"==typeof t?(i=r,o=a,s=t.heading,r=t.pitch,a=t.roll):(u("headingPitchRollToFixedFrame","headingPitchRollToFixedFrame with separate heading, pitch, and roll arguments was deprecated in 1.27. It will be removed in 1.30. Use a HeadingPitchRoll object."),s=t);var c=v.fromHeadingPitchRoll(s,r,a,O),l=_.fromTranslationQuaternionRotationScale(n.ZERO,c,w,M);return o=R.eastNorthUpToFixedFrame(e,i,o),_.multiply(o,l,o)};var C=new h,P=new _,D=new m;R.headingPitchRollQuaternion=function(e,t,n,r,a,i){var o;"object"==typeof t?(o=t,a=n,i=r):(u("headingPitchRollQuaternion","headingPitchRollQuaternion with separate heading, pitch, and roll arguments was deprecated in 1.27. It will be removed in 1.30. Use a HeadingPitchRoll object."),C.heading=t,C.pitch=n,C.roll=r,o=C);var s=R.headingPitchRollToFixedFrame(e,o,a,P),c=_.getRotation(s,D);return v.fromRotationMatrix(c,i)};var U=24110.54841,L=8640184.812866,b=.093104,F=-62e-7,z=1.1772758384668e-19,B=72921158553e-15,G=y.TWO_PI/86400,q=new E;R.computeTemeToPseudoFixedMatrix=function(e,t){q=E.addSeconds(e,-E.computeTaiMinusUtc(e),q);var n,r=q.dayNumber,a=q.secondsOfDay,i=r-2451545;n=a>=43200?(i+.5)/T.DAYS_PER_JULIAN_CENTURY:(i-.5)/T.DAYS_PER_JULIAN_CENTURY;var u=U+n*(L+n*(b+n*F)),s=u*G%y.TWO_PI,c=B+z*(r-2451545.5),l=(a+.5*T.SECONDS_PER_DAY)%T.SECONDS_PER_DAY,f=s+c*l,h=Math.cos(f),d=Math.sin(f);return o(t)?(t[0]=h,t[1]=-d,t[2]=0,t[3]=d,t[4]=h,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new m(h,d,0,-d,h,0,0,0,1)},R.iau2006XysData=new d,R.earthOrientationParameters=c.NONE;var W=32.184,V=2451545;R.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+W,a=t.stop.dayNumber,i=t.stop.secondsOfDay+W,o=R.iau2006XysData.preload(n,r,a,i),u=R.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},R.computeIcrfToFixedMatrix=function(e,t){o(t)||(t=new m);var n=R.computeFixedToIcrfMatrix(e,t);if(o(n))return m.transpose(n,t)};var X=new p(0,0,0),H=new l(0,0,0,0,0,0),Y=new m,k=new m;R.computeFixedToIcrfMatrix=function(e,t){o(t)||(t=new m);var n=R.earthOrientationParameters.compute(e,H);if(o(n)){var r=e.dayNumber,a=e.secondsOfDay+W,i=R.iau2006XysData.computeXysRadians(r,a,X);if(o(i)){var u=i.x+n.xPoleOffset,s=i.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-u*u-s*s)),l=Y;l[0]=1-c*u*u,l[3]=-c*u*s,l[6]=u,l[1]=-c*u*s,l[4]=1-c*s*s,l[7]=s,l[2]=-u,l[5]=-s,l[8]=1-c*(u*u+s*s);var f=m.fromRotationZ(-i.s,k),h=m.multiply(l,f,Y),d=e.dayNumber,p=e.secondsOfDay-E.computeTaiMinusUtc(e)+n.ut1MinusUtc,_=d-2451545,v=p/T.SECONDS_PER_DAY,A=.779057273264+v+.00273781191135448*(_+v);A=A%1*y.TWO_PI;var S=m.fromRotationZ(A,k),g=m.multiply(h,S,Y),N=Math.cos(n.xPoleWander),x=Math.cos(n.yPoleWander),I=Math.sin(n.xPoleWander),O=Math.sin(n.yPoleWander),w=r-V+a/T.SECONDS_PER_DAY;w/=36525;var M=-47e-6*w*y.RADIANS_PER_DEGREE/3600,C=Math.cos(M),P=Math.sin(M),D=k;return D[0]=N*C,D[1]=N*P,D[2]=I,D[3]=-x*P+O*I*C,D[4]=x*C+O*I*P,D[5]=-O*N,D[6]=-O*P-x*I*C,D[7]=O*C-x*I*P,D[8]=x*N,m.multiply(g,D,t)}}};var Z=new r;R.pointToWindowCoordinates=function(e,t,n,r){return r=R.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},R.pointToGLWindowCoordinates=function(e,n,a,i){o(i)||(i=new t);var u=Z;return _.multiplyByVector(e,r.fromElements(a.x,a.y,a.z,1,u),u),r.multiplyByScalar(u,1/u.w,u),_.multiplyByVector(n,u,u),t.fromCartesian4(u,i)};var j=new n,K=new n,J=new n;R.rotationMatrixFromPositionVelocity=function(e,t,r,a){var u=i(r,f.WGS84).geodeticSurfaceNormal(e,j),s=n.cross(t,u,K);n.equalsEpsilon(s,n.ZERO,y.EPSILON6)&&(s=n.clone(n.UNIT_X,s));var c=n.cross(s,t,J);return n.cross(t,c,s),n.negate(s,s),o(a)||(a=new m),a[0]=t.x,a[1]=t.y,a[2]=t.z,a[3]=s.x,a[4]=s.y,a[5]=s.z,a[6]=c.x,a[7]=c.y,a[8]=c.z,a};var Q=new a,$=new n,ee=new n,te=new r,ne=new r,re=new r,ae=new r,ie=new r,oe=new _,ue=new _;return R.basisTo2D=function(e,t,a){var i=e.ellipsoid,o=_.getColumn(t,3,te),u=i.cartesianToCartographic(o,Q),s=R.eastNorthUpToFixedFrame(o,i,oe),c=_.inverseTransformation(s,ue),l=e.project(u,$),f=ne;f.x=l.z,f.y=l.x,f.z=l.y,f.w=1;var h=_.getColumn(t,0,ee),d=n.magnitude(h),p=_.multiplyByVector(c,h,re);r.fromElements(p.z,p.x,p.y,0,p);var E=_.getColumn(t,1,ee),y=n.magnitude(E),m=_.multiplyByVector(c,E,ae);r.fromElements(m.z,m.x,m.y,0,m);var v=_.getColumn(t,2,ee),T=n.magnitude(v),A=ie;return n.cross(p,m,A),n.normalize(A,A),n.cross(m,A,p),n.normalize(p,p),n.cross(A,p,m),n.normalize(m,m),n.multiplyByScalar(p,d,p),n.multiplyByScalar(m,y,m),n.multiplyByScalar(A,T,A),_.setColumn(a,0,p,a),_.setColumn(a,1,m,a),_.setColumn(a,2,A,a),_.setColumn(a,3,f,a),a},R}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d){"use strict";function p(e,t){t=a(t,s.WGS84),e=t.scaleToGeodeticSurface(e);var r=d.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=n.fromCartesian4(l.getColumn(r,0,E)),this._yAxis=n.fromCartesian4(l.getColumn(r,1,E));var i=n.fromCartesian4(l.getColumn(r,2,E));this._plane=f.fromPointNormal(e,i)}var E=new r;o(p.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var y=new e;p.fromPoints=function(t,n){var r=e.fromPoints(t,y);return new p(r.center,n)};var m=new h,_=new n;p.prototype.projectPointOntoPlane=function(e,r){var a=m;a.origin=e,n.normalize(e,a.direction);var o=c.rayPlane(a,this._plane,_);if(i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,_)),i(o)){var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return i(r)?(r.x=s,r.y=l,r):new t(s,l)}},p.prototype.projectPointsOntoPlane=function(e,t){i(t)||(t=[]);for(var n=0,r=e.length,a=0;a<r;a++){var o=this.projectPointOntoPlane(e[a],t[n]);i(o)&&(t[n]=o,n++)}return t.length=n,t},p.prototype.projectPointToNearestOnPlane=function(e,r){i(r)||(r=new t);var a=m;a.origin=e,n.clone(this._plane.normal,a.direction);var o=c.rayPlane(a,this._plane,_);i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,_));var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return r.x=s,r.y=l,r},p.prototype.projectPointsToNearestOnPlane=function(e,t){i(t)||(t=[]);var n=e.length;t.length=n;for(var r=0;r<n;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var v=new n;return p.prototype.projectPointsOntoEllipsoid=function(e,t){var r=e.length;i(t)?t.length=r:t=new Array(r);for(var a=this._ellipsoid,o=this._origin,u=this._xAxis,s=this._yAxis,c=v,l=0;l<r;++l){var f=e[l];n.multiplyByScalar(u,f.x,c),i(t[l])||(t[l]=new n);var h=n.add(o,c,t[l]);n.multiplyByScalar(s,f.y,c),n.add(h,c,h),a.scaleToGeocentricSurface(h,h)}return t},p}),define("Core/EllipsoidGeodesic",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){var t=e._uSquared,n=e._ellipsoid.maximumRadius,r=e._ellipsoid.minimumRadius,a=(n-r)/n,i=Math.cos(e._startHeading),o=Math.sin(e._startHeading),u=(1-a)*Math.tan(e._start.latitude),s=1/Math.sqrt(1+u*u),c=s*u,l=Math.atan2(u,i),f=s*o,h=f*f,d=1-h,p=Math.sqrt(d),E=t/4,y=E*E,m=y*E,_=y*y,v=1+E-3*y/4+5*m/4-175*_/64,T=1-E+15*y/8-35*m/8,R=1-3*E+35*y/4,A=1-5*E,S=v*l-T*Math.sin(2*l)*E/2-R*Math.sin(4*l)*y/16-A*Math.sin(6*l)*m/48-5*Math.sin(8*l)*_/512,g=e._constants;g.a=n,g.b=r,g.f=a,g.cosineHeading=i,g.sineHeading=o,g.tanU=u,g.cosineU=s,g.sineU=c,g.sigma=l,g.sineAlpha=f,g.sineSquaredAlpha=h,g.cosineSquaredAlpha=d,g.cosineAlpha=p,g.u2Over4=E,g.u4Over16=y,g.u6Over64=m,g.u8Over256=_,g.a0=v,g.a1=T,g.a2=R,g.a3=A,g.distanceRatio=S}function c(e,t){return e*t*(4+e*(4-3*t))/16}function l(e,t,n,r,a,i,o){var u=c(e,n);return(1-u)*e*t*(r+u*a*(o+u*i*(2*o*o-1)))}function f(e,t,n,r,a,i,o){var s,c,f,h,d,p=(t-n)/t,E=i-r,y=Math.atan((1-p)*Math.tan(a)),m=Math.atan((1-p)*Math.tan(o)),_=Math.cos(y),v=Math.sin(y),T=Math.cos(m),R=Math.sin(m),A=_*T,S=_*R,g=v*R,N=v*T,x=E,I=u.TWO_PI,O=Math.cos(x),w=Math.sin(x);do{O=Math.cos(x),w=Math.sin(x);var M=S-N*O;f=Math.sqrt(T*T*w*w+M*M),c=g+A*O,s=Math.atan2(f,c);var C;0===f?(C=0,h=1):(C=A*w/f,h=1-C*C),I=x,d=c-2*g/h,isNaN(d)&&(d=0),x=E+l(p,C,h,s,f,c,d)}while(Math.abs(x-I)>u.EPSILON12);var P=h*(t*t-n*n)/(n*n),D=1+P*(4096+P*(P*(320-175*P)-768))/16384,U=P*(256+P*(P*(74-47*P)-128))/1024,L=d*d,b=U*f*(d+U*(c*(2*L-1)-U*d*(4*f*f-3)*(4*L-3)/6)/4),F=n*D*(s-b),z=Math.atan2(T*w,S-N*O),B=Math.atan2(_*w,S*O-N);e._distance=F,e._startHeading=z,e._endHeading=B,e._uSquared=P}function h(n,r,a,i){e.normalize(i.cartographicToCartesian(r,E),p),e.normalize(i.cartographicToCartesian(a,E),E);f(n,i.maximumRadius,i.minimumRadius,r.longitude,r.latitude,a.longitude,a.latitude),n._start=t.clone(r,n._start),n._end=t.clone(a,n._end),n._start.height=0,n._end.height=0,s(n)}function d(e,a,i){var u=n(i,o.WGS84);this._ellipsoid=u,this._start=new t,this._end=new t,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,r(e)&&r(a)&&h(this,e,a,u)}var p=new e,E=new e;return a(d.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return this._startHeading}},endHeading:{get:function(){return this._endHeading}}}),d.prototype.setEndPoints=function(e,t){h(this,e,t,this._ellipsoid)},d.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},d.prototype.interpolateUsingSurfaceDistance=function(e,n){var a=this._constants,i=a.distanceRatio+e/a.b,o=Math.cos(2*i),u=Math.cos(4*i),s=Math.cos(6*i),c=Math.sin(2*i),f=Math.sin(4*i),h=Math.sin(6*i),d=Math.sin(8*i),p=i*i,E=i*p,y=a.u8Over256,m=a.u2Over4,_=a.u6Over64,v=a.u4Over16,T=2*E*y*o/3+i*(1-m+7*v/4-15*_/4+579*y/64-(v-15*_/4+187*y/16)*o-(5*_/4-115*y/16)*u-29*y*s/16)+(m/2-v+71*_/32-85*y/16)*c+(5*v/16-5*_/4+383*y/96)*f-p*((_-11*y/2)*c+5*y*f/2)+(29*_/96-29*y/16)*h+539*y*d/1536,R=Math.asin(Math.sin(T)*a.cosineAlpha),A=Math.atan(a.a/a.b*Math.tan(R));T-=a.sigma;var S=Math.cos(2*a.sigma+T),g=Math.sin(T),N=Math.cos(T),x=a.cosineU*N,I=a.sineU*g,O=Math.atan2(g*a.sineHeading,x-I*a.cosineHeading),w=O-l(a.f,a.sineAlpha,a.cosineSquaredAlpha,T,g,N,S);return r(n)?(n.longitude=this._start.longitude+w,n.latitude=A,n.height=0,n):new t(this._start.longitude+w,A,0)},d}),define("Core/PolylinePipeline",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidGeodesic","./IntersectionTests","./isArray","./Math","./Matrix4","./Plane"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(e,t,n){var r=g;r.length=e;var a;if(t===n){for(a=0;a<e;a++)r[a]=t;return r}var i=n-t,o=i/e;for(a=0;a<e;a++){var u=t+a*o;r[a]=u}return r}function d(t,n,r,a,i,o,u,s){var c=a.scaleToGeodeticSurface(t,O),l=a.scaleToGeodeticSurface(n,w),f=p.numberOfPoints(t,n,r),d=a.cartesianToCartographic(c,N),E=a.cartesianToCartographic(l,x),y=h(f,i,o);M.setEndPoints(d,E);var m=M.surfaceDistance/f,_=s;d.height=i;var v=a.cartographicToCartesian(d,I);e.pack(v,u,_),_+=3;for(var T=1;T<f;T++){var R=M.interpolateUsingSurfaceDistance(T*m,x);R.height=y[T],v=a.cartographicToCartesian(R,I),e.pack(v,u,_),_+=3}return _}var p={};p.numberOfPoints=function(t,n,r){var a=e.distance(t,n);return Math.ceil(a/r)};var E=new t;p.extractHeights=function(e,t){for(var n=e.length,r=new Array(n),a=0;a<n;a++){var i=e[a];r[a]=t.cartesianToCartographic(i,E).height}return r};var y=new l,m=new e,_=new e,v=new f(e.ZERO,0),T=new e,R=new f(e.ZERO,0),A=new e,S=new e,g=[],N=new t,x=new t,I=new e,O=new e,w=new e,M=new o;return p.wrapLongitude=function(t,a){var i=[],o=[];if(r(t)&&t.length>0){a=n(a,l.IDENTITY);var s=l.inverseTransformation(a,y),c=l.multiplyByPoint(s,e.ZERO,m),h=l.multiplyByPointAsVector(s,e.UNIT_Y,_),d=f.fromPointNormal(c,h,v),p=l.multiplyByPointAsVector(s,e.UNIT_X,T),E=f.fromPointNormal(c,p,R),g=1;i.push(e.clone(t[0]));for(var N=i[0],x=t.length,I=1;I<x;++I){var O=t[I];if(f.getPointDistance(E,N)<0||f.getPointDistance(E,O)<0){var w=u.lineSegmentPlane(N,O,d,A);if(r(w)){var M=e.multiplyByScalar(h,5e-9,S);f.getPointDistance(d,N)<0&&e.negate(M,M),i.push(e.add(w,M,new e)),o.push(g+1),e.negate(M,M),i.push(e.add(w,M,new e)),g=1}}i.push(e.clone(t[I])),g++,N=O}o.push(g)}return{positions:i,lengths:o}},p.generateArc=function(t){r(t)||(t={});var a=t.positions,o=a.length,u=n(t.ellipsoid,i.WGS84),l=n(t.height,0),f=s(l);if(o<1)return[];if(1===o){var h=u.scaleToGeodeticSurface(a[0],O);if(l=f?l[0]:l,0!==l){var E=u.geodeticSurfaceNormal(h,I);e.multiplyByScalar(E,l,E),e.add(h,E,h)}return[h.x,h.y,h.z]}var y=t.minDistance;if(!r(y)){var m=n(t.granularity,c.RADIANS_PER_DEGREE);y=c.chordLength(m,u.maximumRadius)}var _,v=0;for(_=0;_<o-1;_++)v+=p.numberOfPoints(a[_],a[_+1],y);var T=3*(v+1),R=new Array(T),A=0;for(_=0;_<o-1;_++){var S=a[_],x=a[_+1],w=f?l[_]:l,M=f?l[_+1]:l;A=d(S,x,y,u,w,M,R,A)}g.length=0;var C=a[o-1],P=u.cartesianToCartographic(C,N);P.height=f?l[o-1]:l;var D=u.cartographicToCartesian(P,I);return e.pack(D,R,T-3),R},p.generateCartesianArc=function(t){for(var n=p.generateArc(t),r=n.length/3,a=new Array(r),i=0;i<r;i++)a[i]=e.unpack(n,3*i);return a},p}),define("Core/PolylineVolumeGeometryLibrary",["./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./CornerType","./EllipsoidTangentPlane","./Math","./Matrix3","./Matrix4","./PolylinePipeline","./Quaternion","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(e,t){for(var n=new Array(e.length),r=0;r<e.length;r++){ -var a=e[r];D=t.cartesianToCartographic(a,D),n[r]=D.height,e[r]=t.scaleToGeodeticSurface(a,a)}return n}function d(e,n,r,a){var i,o=e[0],u=e[1],s=t.angleBetween(o,u),c=Math.ceil(s/a),l=new Array(c);if(n===r){for(i=0;i<c;i++)l[i]=n;return l.push(r),l}var f=r-n,h=f/c;for(i=1;i<c;i++){var d=n+i*h;l[i]=d}return l[0]=n,l.push(r),l}function p(n,r,a,o){var u=new i(a,o),s=u.projectPointOntoPlane(t.add(a,n,Y),Y),c=u.projectPointOntoPlane(t.add(a,r,k),k),l=e.angleBetween(s,c);return c.x*s.y-c.y*s.x>=0?-l:l}function E(e,n,r,a,i,o,c,l){var h=B,d=G;L=f.eastNorthUpToFixedFrame(e,i,L),h=s.multiplyByPointAsVector(L,U,h),h=t.normalize(h,h);var E=p(h,n,e,i);F=u.fromRotationZ(E,F),q.z=o,L=s.multiplyTransformation(L,s.fromRotationTranslation(F,q,b),L);var y=z;y[0]=c;for(var m=0;m<l;m++)for(var _=0;_<r.length;_+=3)d=t.fromArray(r,_,d),d=u.multiplyByVector(y,d,d),d=s.multiplyByPoint(L,d,d),a.push(d.x,d.y,d.z);return a}function y(e,n,r,a,i,o,u){for(var s=0;s<e.length;s+=3){var c=t.fromArray(e,s,W);a=E(c,n,r,a,i,o[s/3],u,1)}return a}function m(e,t){var n=e.length,r=new Array(6*n),a=0,i=t.x+t.width/2,o=t.y+t.height/2,u=e[0];r[a++]=u.x-i,r[a++]=0,r[a++]=u.y-o;for(var s=1;s<n;s++){u=e[s];var c=u.x-i,l=u.y-o;r[a++]=c,r[a++]=0,r[a++]=l,r[a++]=c,r[a++]=0,r[a++]=l}return u=e[0],r[a++]=u.x-i,r[a++]=0,r[a++]=u.y-o,r}function _(e,t){for(var n=e.length,r=new Array(3*n),a=0,i=t.x+t.width/2,o=t.y+t.height/2,u=0;u<n;u++)r[a++]=e[u].x-i,r[a++]=0,r[a++]=e[u].y-o;return r}function v(e,n,r,i,s,c,f,h,d,p){var y,m=t.angleBetween(t.subtract(n,e,M),t.subtract(r,e,C)),_=i===a.BEVELED?0:Math.ceil(m/o.toRadians(5));y=s?u.fromQuaternion(l.fromAxisAngle(t.negate(e,M),m/(_+1),V),H):u.fromQuaternion(l.fromAxisAngle(e,m/(_+1),V),H);var v,T;if(n=t.clone(n,X),_>0)for(var R=p?2:1,A=0;A<_;A++)n=u.multiplyByVector(y,n,n),v=t.subtract(n,e,M),v=t.normalize(v,v),s||(v=t.negate(v,v)),T=c.scaleToGeodeticSurface(n,C),f=E(T,v,h,f,c,d,1,R);else v=t.subtract(n,e,M),v=t.normalize(v,v),s||(v=t.negate(v,v)),T=c.scaleToGeodeticSurface(n,C),f=E(T,v,h,f,c,d,1,1),r=t.clone(r,X),v=t.subtract(r,e,M),v=t.normalize(v,v),s||(v=t.negate(v,v)),T=c.scaleToGeodeticSurface(r,C),f=E(T,v,h,f,c,d,1,1);return f}var T=[new t,new t],R=new t,A=new t,S=new t,g=new t,N=new t,x=new t,I=new t,O=new t,w=new t,M=new t,C=new t,P={},D=new r,U=new t(-1,0,0),L=new s,b=new s,F=new u,z=u.IDENTITY.clone(),B=new t,G=new n,q=new t,W=new t,V=new l,X=new t,H=new u;P.removeDuplicatesFromShape=function(t){for(var n=t.length,r=[],a=n-1,i=0;i<n;a=i++){var o=t[a],u=t[i];e.equals(o,u)||r.push(u)}return r};var Y=new t,k=new t;P.angleIsGreaterThanPi=function(e,n,r,a){var o=new i(r,a),u=o.projectPointOntoPlane(t.add(r,e,Y),Y),s=o.projectPointOntoPlane(t.add(r,n,k),k);return s.x*u.y-s.y*u.x>=0};var Z=new t,j=new t;return P.computePositions=function(e,n,r,i,u){var s=i._ellipsoid,l=h(e,s),f=i._granularity,p=i._cornerType,C=u?m(n,r):_(n,r),D=u?_(n,r):void 0,U=r.height/2,L=r.width/2,b=e.length,F=[],z=u?[]:void 0,B=R,G=A,q=S,W=g,V=N,X=x,H=I,Y=O,k=w,K=e[0],J=e[1];W=s.geodeticSurfaceNormal(K,W),B=t.subtract(J,K,B),B=t.normalize(B,B),Y=t.cross(W,B,Y),Y=t.normalize(Y,Y);var Q=l[0],$=l[1];u&&(z=E(K,Y,D,z,s,Q+U,1,1)),k=t.clone(K,k),K=J,G=t.negate(B,G);for(var ee,te,ne=1;ne<b-1;ne++){var re=u?2:1;J=e[ne+1],B=t.subtract(J,K,B),B=t.normalize(B,B),q=t.add(B,G,q),q=t.normalize(q,q),W=s.geodeticSurfaceNormal(K,W);var ae=t.multiplyByScalar(W,t.dot(B,W),Z);t.subtract(B,ae,ae),t.normalize(ae,ae);var ie=t.multiplyByScalar(W,t.dot(G,W),j);t.subtract(G,ie,ie),t.normalize(ie,ie);var oe=!o.equalsEpsilon(Math.abs(t.dot(ae,ie)),1,o.EPSILON7);if(oe){q=t.cross(q,W,q),q=t.cross(W,q,q),q=t.normalize(q,q);var ue=1/Math.max(.25,t.magnitude(t.cross(q,G,M))),se=P.angleIsGreaterThanPi(B,G,K,s);se?(V=t.add(K,t.multiplyByScalar(q,ue*L,q),V),X=t.add(V,t.multiplyByScalar(Y,L,X),X),T[0]=t.clone(k,T[0]),T[1]=t.clone(X,T[1]),ee=d(T,Q+U,$+U,f),te=c.generateArc({positions:T,granularity:f,ellipsoid:s}),F=y(te,Y,C,F,s,ee,1),Y=t.cross(W,B,Y),Y=t.normalize(Y,Y),H=t.add(V,t.multiplyByScalar(Y,L,H),H),p===a.ROUNDED||p===a.BEVELED?v(V,X,H,p,se,s,F,C,$+U,u):(q=t.negate(q,q),F=E(K,q,C,F,s,$+U,ue,re)),k=t.clone(H,k)):(V=t.add(K,t.multiplyByScalar(q,ue*L,q),V),X=t.add(V,t.multiplyByScalar(Y,-L,X),X),T[0]=t.clone(k,T[0]),T[1]=t.clone(X,T[1]),ee=d(T,Q+U,$+U,f),te=c.generateArc({positions:T,granularity:f,ellipsoid:s}),F=y(te,Y,C,F,s,ee,1),Y=t.cross(W,B,Y),Y=t.normalize(Y,Y),H=t.add(V,t.multiplyByScalar(Y,-L,H),H),p===a.ROUNDED||p===a.BEVELED?v(V,X,H,p,se,s,F,C,$+U,u):F=E(K,q,C,F,s,$+U,ue,re),k=t.clone(H,k)),G=t.negate(B,G)}else F=E(k,Y,C,F,s,Q+U,1,1),k=K;Q=$,$=l[ne+1],K=J}T[0]=t.clone(k,T[0]),T[1]=t.clone(K,T[1]),ee=d(T,Q+U,$+U,f),te=c.generateArc({positions:T,granularity:f,ellipsoid:s}),F=y(te,Y,C,F,s,ee,1),u&&(z=E(K,Y,D,z,s,$+U,1,1)),b=F.length;var ce=u?b+z.length:b,le=new Float64Array(ce);return le.set(F),u&&le.set(z,b),le},P}),define("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.position=e(t.position,!1),this.normal=e(t.normal,!1),this.st=e(t.st,!1),this.binormal=e(t.binormal,!1),this.tangent=e(t.tangent,!1),this.color=e(t.color,!1)}return a.POSITION_ONLY=r(new a({position:!0})),a.POSITION_AND_NORMAL=r(new a({position:!0,normal:!0})),a.POSITION_NORMAL_AND_ST=r(new a({position:!0,normal:!0,st:!0})),a.POSITION_AND_ST=r(new a({position:!0,st:!0})),a.POSITION_AND_COLOR=r(new a({position:!0,color:!0})),a.ALL=r(new a({position:!0,normal:!0,st:!0,binormal:!0,tangent:!0})),a.DEFAULT=a.POSITION_NORMAL_AND_ST,a.packedLength=6,a.pack=function(t,n,r){return r=e(r,0),n[r++]=t.position?1:0,n[r++]=t.normal?1:0,n[r++]=t.st?1:0,n[r++]=t.binormal?1:0,n[r++]=t.tangent?1:0,n[r++]=t.color?1:0,n},a.unpack=function(n,r,i){return r=e(r,0),t(i)||(i=new a),i.position=1===n[r++],i.normal=1===n[r++],i.st=1===n[r++],i.binormal=1===n[r++],i.tangent=1===n[r++],i.color=1===n[r++],i},a.clone=function(e,n){if(t(e))return t(n)||(n=new a),n.position=e.position,n.normal=e.normal,n.st=e.st,n.binormal=e.binormal,n.tangent=e.tangent,n.color=e.color,n},a}),define("Core/PolylineVolumeGeometry",["./arrayRemoveDuplicates","./BoundingRectangle","./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./CornerType","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryPipeline","./IndexDatatype","./Math","./oneTimeWarning","./PolygonPipeline","./PolylineVolumeGeometryLibrary","./PrimitiveType","./VertexFormat","./WindingOrder"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,p,E,y,m,_,v,T,R,A){"use strict";function S(e,t,r,a){var o=new d;a.position&&(o.position=new h({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:e}));var u,s,c,l,y,v,R=t.length,A=e.length/3,S=(A-2*R)/(2*R),g=_.triangulate(t),N=(S-1)*R*6+2*g.length,x=E.createTypedArray(A,N),I=2*R,O=0;for(u=0;u<S-1;u++){for(s=0;s<R-1;s++)c=2*s+u*R*2,v=c+I,l=c+1,y=l+I,x[O++]=l,x[O++]=c,x[O++]=y,x[O++]=y,x[O++]=c,x[O++]=v;c=2*R-2+u*R*2,l=c+1,y=l+I,v=c+I,x[O++]=l,x[O++]=c,x[O++]=y,x[O++]=y,x[O++]=c,x[O++]=v}if(a.st||a.tangent||a.binormal){var w,M,C=new Float32Array(2*A),P=1/(S-1),D=1/r.height,U=r.height/2,L=0;for(u=0;u<S;u++){for(w=u*P,M=D*(t[0].y+U),C[L++]=w,C[L++]=M,s=1;s<R;s++)M=D*(t[s].y+U),C[L++]=w,C[L++]=M,C[L++]=w,C[L++]=M;M=D*(t[0].y+U),C[L++]=w,C[L++]=M}for(s=0;s<R;s++)w=0,M=D*(t[s].y+U),C[L++]=w,C[L++]=M;for(s=0;s<R;s++)w=(S-1)*P,M=D*(t[s].y+U),C[L++]=w,C[L++]=M;o.st=new h({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:new Float32Array(C)})}var b=A-2*R;for(u=0;u<g.length;u+=3){var F=g[u]+b,z=g[u+1]+b,B=g[u+2]+b;x[O++]=F,x[O++]=z,x[O++]=B,x[O++]=B+R,x[O++]=z+R,x[O++]=F+R}var G=new f({attributes:o,indices:x,boundingSphere:n.fromVertices(e),primitiveType:T.TRIANGLES});if(a.normal&&(G=p.computeNormal(G)),a.tangent||a.binormal){try{G=p.computeBinormalAndTangent(G)}catch(e){m("polyline-volume-tangent-binormal","Unable to compute tangents and binormals for polyline volume geometry")}a.tangent||(G.attributes.tangent=void 0),a.binormal||(G.attributes.binormal=void 0),a.st||(G.attributes.st=void 0)}return G}function g(e){e=u(e,u.EMPTY_OBJECT);var t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=l.clone(u(e.ellipsoid,l.WGS84)),this._cornerType=u(e.cornerType,o.ROUNDED),this._vertexFormat=R.clone(u(e.vertexFormat,R.DEFAULT)),this._granularity=u(e.granularity,y.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeGeometry";var i=1+t.length*a.packedLength;i+=1+n.length*r.packedLength,this.packedLength=i+l.packedLength+R.packedLength+2}g.pack=function(e,t,n){n=u(n,0);var i,o=e._positions,s=o.length;for(t[n++]=s,i=0;i<s;++i,n+=a.packedLength)a.pack(o[i],t,n);var c=e._shape;for(s=c.length,t[n++]=s,i=0;i<s;++i,n+=r.packedLength)r.pack(c[i],t,n);return l.pack(e._ellipsoid,t,n),n+=l.packedLength,R.pack(e._vertexFormat,t,n),n+=R.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var N=l.clone(l.UNIT_SPHERE),x=new R,I={polylinePositions:void 0,shapePositions:void 0,ellipsoid:N,vertexFormat:x,cornerType:void 0,granularity:void 0};g.unpack=function(e,t,n){t=u(t,0);var i,o=e[t++],c=new Array(o);for(i=0;i<o;++i,t+=a.packedLength)c[i]=a.unpack(e,t);o=e[t++];var f=new Array(o);for(i=0;i<o;++i,t+=r.packedLength)f[i]=r.unpack(e,t);var h=l.unpack(e,t,N);t+=l.packedLength;var d=R.unpack(e,t,x);t+=R.packedLength;var p=e[t++],E=e[t];return s(n)?(n._positions=c,n._shape=f,n._ellipsoid=l.clone(h,n._ellipsoid),n._vertexFormat=R.clone(d,n._vertexFormat),n._cornerType=p,n._granularity=E,n):(I.polylinePositions=c,I.shapePositions=f,I.cornerType=p,I.granularity=E,new g(I))};var O=new t;return g.createGeometry=function(n){var r=n._positions,i=e(r,a.equalsEpsilon),o=n._shape;if(o=v.removeDuplicatesFromShape(o),!(i.length<2||o.length<3)){_.computeWindingOrder2D(o)===A.CLOCKWISE&&o.reverse();var u=t.fromPoints(o,O),s=v.computePositions(i,o,u,n,!0);return S(s,o,u,n._vertexFormat)}},g}),define("Workers/createPolylineVolumeGeometry",["../Core/defined","../Core/Ellipsoid","../Core/PolylineVolumeGeometry"],function(e,t,n){"use strict";function r(r,a){return e(a)&&(r=n.unpack(r,a)),r._ellipsoid=t.clone(r._ellipsoid),n.createGeometry(r)}return r})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e){return e+" is required, actual value was undefined"}function r(e,t,n){return"Expected "+n+" to be typeof "+t+", actual typeof was "+e}var a={};return a.typeOf={},a.defined=function(r,a){if(!e(a))throw new t(n(r))},a.typeOf.func=function(e,n){if("function"!=typeof n)throw new t(r(typeof n,"function",e))},a.typeOf.string=function(e,n){if("string"!=typeof n)throw new t(r(typeof n,"string",e))},a.typeOf.number=function(e,n){if("number"!=typeof n)throw new t(r(typeof n,"number",e))},a.typeOf.number.lessThan=function(e,n,r){if(a.typeOf.number(e,n),n>=r)throw new t("Expected "+e+" to be less than "+r+", actual value was "+n)},a.typeOf.number.lessThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n>r)throw new t("Expected "+e+" to be less than or equal to "+r+", actual value was "+n)},a.typeOf.number.greaterThan=function(e,n,r){if(a.typeOf.number(e,n),n<=r)throw new t("Expected "+e+" to be greater than "+r+", actual value was "+n)},a.typeOf.number.greaterThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n<r)throw new t("Expected "+e+" to be greater than or equal to"+r+", actual value was "+n)},a.typeOf.object=function(e,n){if("object"!=typeof n)throw new t(r(typeof n,"object",e))},a.typeOf.bool=function(e,n){if("boolean"!=typeof n)throw new t(r(typeof n,"boolean",e))},a}),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";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),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 n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(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^=e<<7&2636928640,e^=e<<15&4022730752,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,n,r){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:e<0?-1:0},a.signNotZero=function(e){return e<0?-1:1},a.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*a.clamp(e,-1,1)+.5)*n)},a.fromSNorm=function(e,n){return n=t(n,255),a.clamp(e,0,n)/n*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},a.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},a.lerp=function(e,t,n){return(1-n)*e+n*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){var t=a.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},a.clampToLatitudeRange=function(e){return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){return(e%t+t)%t},a.equalsEpsilon=function(e,n,r,a){a=t(a,r);var i=Math.abs(e-n);return i<=a||i<=r*Math.max(Math.abs(e),Math.abs(n))};var i=[1];a.factorial=function(e){var t=i.length;if(e>=t)for(var n=i[t-1],r=t;r<=e;r++)i.push(n*r);return i[e]},a.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},a.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return a.setRandomNumberSeed=function(t){o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(e){return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){return Math.log(e)/Math.log(t)},a.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var a=e.clock,i=e.cone,u=t(e.magnitude,1),s=u*Math.sin(i);return r.x=s*Math.cos(a),r.y=s*Math.sin(a),r.z=u*Math.cos(i),r},o.fromElements=function(e,t,r,a){return n(a)?(a.x=e,a.y=t,a.z=r,a):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var a=0;a<r;++a)o.pack(e[a],t,3*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var a=0;a<r;a+=3){var i=a/3;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,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};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var n=o.dot(c,l),r=o.magnitude(o.cross(c,l,c));return Math.atan2(r,n)};var f=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)},o.cross=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=t.x,u=t.y,s=t.z,c=a*s-i*u,l=i*o-r*s,f=r*u-a*o;return n.x=c,n.y=l,n.z=f,n},o.fromDegrees=function(e,t,n,r,a){return e=i.toRadians(e),t=i.toRadians(t),o.fromRadians(e,t,n,r,a)};var h=new o,d=new o,p=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,a,i,u){a=t(a,0);var s=n(i)?i.radiiSquared:p,c=Math.cos(r);h.x=c*Math.cos(e),h.y=c*Math.sin(e),h.z=Math.sin(r),h=o.normalize(h,h),o.multiplyComponents(s,h,d);var l=Math.sqrt(o.dot(h,d));return d=o.divideByScalar(d,l,d),h=o.multiplyByScalar(h,a,h),n(u)||(u=new o),o.add(d,h,u)},o.fromDegreesArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromDegrees(u,s,0,t,r[c])}return r},o.fromRadiansArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromRadians(u,s,0,t,r[c])}return r},o.fromDegreesArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromDegrees(u,s,c,t,r[l])}return r},o.fromRadiansArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromRadians(u,s,c,t,r[l])}return r},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(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,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(n,a,u,s,c){var l=n.x,f=n.y,h=n.z,d=a.x,p=a.y,E=a.z,y=l*l*d*d,m=f*f*p*p,_=h*h*E*E,v=y+m+_,T=Math.sqrt(1/v),R=e.multiplyByScalar(n,T,i);if(v<s)return isFinite(T)?e.clone(R,c):void 0;var A=u.x,g=u.y,S=u.z,N=o;N.x=R.x*A*2,N.y=R.y*g*2,N.z=R.z*S*2;var x,O,w,I,M,C,P,D,U,L,b,F=(1-T)*e.magnitude(n)/(.5*e.magnitude(N)),z=0;do{F-=z,w=1/(1+F*A),I=1/(1+F*g),M=1/(1+F*S),C=w*w,P=I*I,D=M*M,U=C*w,L=P*I,b=D*M,x=y*C+m*P+_*D-1,O=y*U*A+m*L*g+_*b*S;var B=-2*O;z=x/B}while(Math.abs(x)>r.EPSILON12);return t(c)?(c.x=l*w,c.y=f*I,c.z=h*M,c):new e(l*w,f*I,h*M)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o){"use strict";function u(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)}u.fromRadians=function(e,r,a,i){return a=t(a,0),n(i)?(i.longitude=e,i.latitude=r,i.height=a,i):new u(e,r,a)},u.fromDegrees=function(e,t,n,r){return e=i.toRadians(e),t=i.toRadians(t),u.fromRadians(e,t,n,r)};var s=new e,c=new e,l=new e,f=new e(1/6378137,1/6378137,1/6356752.314245179),h=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),d=i.EPSILON1;return u.fromCartesian=function(t,r,a){var p=n(r)?r.oneOverRadii:f,E=n(r)?r.oneOverRadiiSquared:h,y=n(r)?r._centerToleranceSquared:d,m=o(t,p,E,y,c);if(n(m)){var _=e.multiplyComponents(m,E,s);_=e.normalize(_,_);var v=e.subtract(t,m,l),T=Math.atan2(_.y,_.x),R=Math.asin(_.z),A=i.sign(e.dot(v,t))*e.magnitude(v);return n(a)?(a.longitude=T,a.latitude=R,a.height=A,a):new u(T,R,A)}},u.clone=function(e,t){if(n(e))return n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},u.ZERO=a(new u(0,0,0)),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,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(t,r,a,i){r=n(r,0),a=n(a,0),i=n(i,0),t._radii=new e(r,a,i),t._radiiSquared=new e(r*r,a*a,i*i),t._radiiToTheFourth=new e(r*r*r*r,a*a*a*a,i*i*i*i),t._oneOverRadii=new e(0===r?0:1/r,0===a?0:1/a,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===a?0:1/(a*a),0===i?0:1/(i*i)),t._minimumRadius=Math.min(r,a,i),t._maximumRadius=Math.max(r,a,i),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,c(this,e,t,n)}a(l.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}}}),l.clone=function(t,n){if(r(t)){var a=t._radii;return r(n)?(e.clone(a,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new l(a.x,a.y,a.z)}},l.fromCartesian3=function(e,t){return r(t)||(t=new l),r(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,r,a){return a=n(a,0),e.pack(t._radii,r,a),r},l.unpack=function(t,r,a){r=n(r,0);var i=e.unpack(t,r);return l.fromCartesian3(i,a)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,n){var a=t.longitude,i=t.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return r(n)||(n=new e),n.x=u,n.y=s,n.z=c,e.normalize(n,n)},l.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var f=new e,h=new e;l.prototype.cartographicToCartesian=function(t,n){var a=f,i=h;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(e.dot(a,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(a,t.height,a),r(n)||(n=new e),e.add(i,a,n)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var d=new e,p=new e,E=new e;return l.prototype.cartesianToCartographic=function(n,a){var i=this.scaleToGeodeticSurface(n,p);if(r(i)){var o=this.geodeticSurfaceNormal(i,d),s=e.subtract(n,i,E),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),f=u.sign(e.dot(s,n))*e.magnitude(s);return r(a)?(a.longitude=c,a.latitude=l,a.height=f,a):new t(c,l,f)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var a=t.x,i=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return e.multiplyByScalar(t,s,n)},l.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},l.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},l.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,a,i){a=n(a,0);var o=this._sqauredXOverSquaredZ;if(r(i)||(i=new e),i.x=0,i.y=0,i.z=t.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},l}),define("Core/arrayRemoveDuplicates",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(n,r,a){if(t(n)){a=e(a,!1);var o=n.length;if(o<2)return n;var u,s,c;for(u=1;u<o&&(s=n[u-1],c=n[u],!r(s,c,i));++u);if(u===o)return a&&r(n[0],n[n.length-1],i)?n.slice(1):n;for(var l=n.slice(0,u);u<o;++u)c=n[u],r(s,c,i)||(l.push(c),s=c);return a&&l.length>1&&r(l[0],l[l.length-1],i)&&l.shift(),l}}var i=r.EPSILON10;return a}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n){this.x=t(e,0),this.y=t(n,0)}o.fromElements=function(e,t,r){return n(r)?(r.x=e,r.y=t,r):new o(e,t)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t):new o(e.x,e.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r]=e.y,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=2*r:t=new Array(2*r);for(var a=0;a<r;++a)o.pack(e[a],t,2*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/2:t=new Array(r/2);for(var a=0;a<r;a+=2){var i=a/2;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y)},o.minimumComponent=function(e){return Math.min(e.x,e.y)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){return o.normalize(e,c),o.normalize(t,l),i.acosClamped(o.dot(c,l))};var f=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)},o.ZERO=a(new o(0,0)),o.UNIT_X=a(new o(1,0)),o.UNIT_Y=a(new o(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,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,a,i,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return r(n)?(n.x=i,n.y=o,n.z=u,n):new e(i,o,u)},u.prototype.unproject=function(e,n){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,u=e.z;return r(n)?(n.longitude=i,n.latitude=o,n.height=u,n):new t(i,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(e,t,r,a){this.west=n(e,0),this.south=n(t,0),this.east=n(r,0),this.north=n(a,0)}a(c.prototype,{width:{get:function(){return c.computeWidth(this)}},height:{get:function(){return c.computeHeight(this)}}}),c.packedLength=4,c.pack=function(e,t,r){return r=n(r,0),t[r++]=e.west,t[r++]=e.south,t[r++]=e.east,t[r]=e.north,t},c.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new c),a.west=e[t++],a.south=e[t++],a.east=e[t++],a.north=e[t],a},c.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=s.TWO_PI),t-n},c.computeHeight=function(e){return e.north-e.south},c.fromDegrees=function(e,t,a,i,o){return e=s.toRadians(n(e,0)),t=s.toRadians(n(t,0)),a=s.toRadians(n(a,0)),i=s.toRadians(n(i,0)),r(o)?(o.west=e,o.south=t,o.east=a,o.north=i,o):new c(e,t,a,i)},c.fromRadians=function(e,t,a,i,o){return r(o)?(o.west=n(e,0),o.south=n(t,0),o.east=n(a,0),o.north=n(i,0),o):new c(e,t,a,i)},c.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,u=Number.MAX_VALUE,l=-Number.MAX_VALUE,f=0,h=e.length;f<h;f++){var d=e[f];n=Math.min(n,d.longitude),a=Math.max(a,d.longitude),u=Math.min(u,d.latitude),l=Math.max(l,d.latitude);var p=d.longitude>=0?d.longitude:d.longitude+s.TWO_PI;i=Math.min(i,p),o=Math.max(o,p)}return a-n>o-i&&(n=i,a=o,a>s.PI&&(a-=s.TWO_PI),n>s.PI&&(n-=s.TWO_PI)),r(t)?(t.west=n,t.south=u,t.east=a,t.north=l,t):new c(n,u,a,l)},c.fromCartesianArray=function(e,t,n){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,u=-Number.MAX_VALUE,l=Number.MAX_VALUE,f=-Number.MAX_VALUE,h=0,d=e.length;h<d;h++){var p=t.cartesianToCartographic(e[h]);a=Math.min(a,p.longitude),i=Math.max(i,p.longitude),l=Math.min(l,p.latitude),f=Math.max(f,p.latitude);var E=p.longitude>=0?p.longitude:p.longitude+s.TWO_PI;o=Math.min(o,E),u=Math.max(u,E)}return i-a>u-o&&(a=o,i=u,i>s.PI&&(i-=s.TWO_PI),a>s.PI&&(a-=s.TWO_PI)),r(n)?(n.west=a,n.south=l,n.east=i,n.north=f,n):new c(a,l,i,f)},c.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new c(e.west,e.south,e.east,e.north)},c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.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},c.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},c.validate=function(e){},c.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)},c.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)},c.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)},c.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)},c.center=function(t,n){var a=t.east,i=t.west;a<i&&(a+=s.TWO_PI);var o=s.negativePiToPi(.5*(i+a)),u=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=u,n.height=0,n):new e(o,u)},c.intersection=function(e,t,n){var a=e.east,i=e.west,o=t.east,u=t.west;a<i&&o>0?a+=s.TWO_PI:o<u&&a>0&&(o+=s.TWO_PI),a<i&&u<0?u+=s.TWO_PI:o<u&&i<0&&(i+=s.TWO_PI);var l=s.negativePiToPi(Math.max(i,u)),f=s.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&f<=l)){var h=Math.max(e.south,t.south),d=Math.min(e.north,t.north);if(!(h>=d))return r(n)?(n.west=l,n.south=h,n.east=f,n.north=d,n):new c(l,h,f,d)}},c.simpleIntersection=function(e,t,n){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(i>=u||a>=o))return r(n)?(n.west=a,n.south=i,n.east=o,n.north=u,n):new c(a,i,o,u)},c.union=function(e,t,n){r(n)||(n=new c);var a=e.east,i=e.west,o=t.east,u=t.west;a<i&&o>0?a+=s.TWO_PI:o<u&&a>0&&(o+=s.TWO_PI),a<i&&u<0?u+=s.TWO_PI:o<u&&i<0&&(i+=s.TWO_PI);var l=s.convertLongitudeRange(Math.min(i,u)),f=s.convertLongitudeRange(Math.max(a,o));return n.west=l,n.south=Math.min(e.south,t.south),n.east=f,n.north=Math.max(e.north,t.north),n},c.expand=function(e,t,n){return r(n)||(n=new c),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},c.contains=function(e,t){var n=t.longitude,r=t.latitude,a=e.west,i=e.east;return i<a&&(i+=s.TWO_PI,n<0&&(n+=s.TWO_PI)),(n>a||s.equalsEpsilon(n,a,s.EPSILON14))&&(n<i||s.equalsEpsilon(n,i,s.EPSILON14))&&r>=e.south&&r<=e.north};var l=new e;return c.subsample=function(e,t,a,i){t=n(t,o.WGS84),a=n(a,0),r(i)||(i=[]);var u=0,f=e.north,h=e.south,d=e.east,p=e.west,E=l;E.height=a,E.longitude=p,E.latitude=f,i[u]=t.cartographicToCartesian(E,i[u]),u++,E.longitude=d,i[u]=t.cartographicToCartesian(E,i[u]),u++,E.latitude=h,i[u]=t.cartographicToCartesian(E,i[u]),u++,E.longitude=p,i[u]=t.cartographicToCartesian(E,i[u]),u++,f<0?E.latitude=f:h>0?E.latitude=h:E.latitude=0;for(var y=1;y<8;++y)E.longitude=-Math.PI+y*s.PI_OVER_TWO,c.contains(e,E)&&(i[u]=t.cartographicToCartesian(E,i[u]),u++);return 0===E.latitude&&(E.longitude=p,i[u]=t.cartographicToCartesian(E,i[u]),u++,E.longitude=d,i[u]=t.cartographicToCartesian(E,i[u]),u++),i.length=u,i},c.MAX_VALUE=u(new c(-Math.PI,-s.PI_OVER_TWO,Math.PI,s.PI_OVER_TWO)),c}),define("Core/BoundingRectangle",["./Cartesian2","./Cartographic","./Check","./defaultValue","./defined","./GeographicProjection","./Intersect","./Rectangle"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,n,a){this.x=r(e,0),this.y=r(t,0),this.width=r(n,0),this.height=r(a,0)}s.packedLength=4,s.pack=function(e,t,n){return n=r(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.width,t[n]=e.height,t},s.unpack=function(e,t,n){return t=r(t,0),a(n)||(n=new s),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n},s.fromPoints=function(e,t){if(a(t)||(t=new s),!a(e)||0===e.length)return t.x=0,t.y=0,t.width=0,t.height=0,t;for(var n=e.length,r=e[0].x,i=e[0].y,o=e[0].x,u=e[0].y,c=1;c<n;c++){var l=e[c],f=l.x,h=l.y;r=Math.min(f,r),o=Math.max(f,o),i=Math.min(h,i),u=Math.max(h,u)}return t.x=r,t.y=i,t.width=o-r,t.height=u-i,t};var c=new i,l=new t,f=new t;return s.fromRectangle=function(t,n,i){if(a(i)||(i=new s),!a(t))return i.x=0,i.y=0,i.width=0,i.height=0,i;n=r(n,c);var o=n.project(u.southwest(t,l)),h=n.project(u.northeast(t,f));return e.subtract(h,o,h),i.x=o.x,i.y=o.y,i.width=h.x,i.height=h.y,i},s.clone=function(e,t){if(a(e))return a(t)?(t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t):new s(e.x,e.y,e.width,e.height)},s.union=function(e,t,n){a(n)||(n=new s);var r=Math.min(e.x,t.x),i=Math.min(e.y,t.y),o=Math.max(e.x+e.width,t.x+t.width),u=Math.max(e.y+e.height,t.y+t.height);return n.x=r,n.y=i,n.width=o-r,n.height=u-i,n},s.expand=function(e,t,n){n=s.clone(e,n);var r=t.x-n.x,a=t.y-n.y;return r>n.width?n.width=r:r<0&&(n.width-=r,n.x=t.x),a>n.height?n.height=a:a<0&&(n.height-=a,n.y=t.y),n},s.intersect=function(e,t){var n=e.x,r=e.y,a=t.x,i=t.y;return n>a+t.width||n+e.width<a||r+e.height<i||r>i+t.height?o.OUTSIDE:o.INTERSECTING},s.equals=function(e,t){return e===t||a(e)&&a(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.intersect=function(e){return s.intersect(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a,i,o,u,s,c){this[0]=n(e,0),this[1]=n(a,0),this[2]=n(u,0),this[3]=n(t,0),this[4]=n(i,0),this[5]=n(s,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(c,0)}function c(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function l(e){for(var t=0,n=0;n<3;++n){var r=e[s.getElementIndex(E[n],p[n])];t+=2*r*r}return Math.sqrt(t)}function f(e,t){for(var n=u.EPSILON15,r=0,a=1,i=0;i<3;++i){var o=Math.abs(e[s.getElementIndex(E[i],p[i])]);o>r&&(a=i,r=o)}var c=1,l=0,f=p[a],h=E[a];if(Math.abs(e[s.getElementIndex(h,f)])>n){var d,y=e[s.getElementIndex(h,h)],m=e[s.getElementIndex(f,f)],_=e[s.getElementIndex(h,f)],v=(y-m)/2/_;d=v<0?-1/(-v+Math.sqrt(1+v*v)):1/(v+Math.sqrt(1+v*v)),c=1/Math.sqrt(1+d*d),l=d*c}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(f,f)]=t[s.getElementIndex(h,h)]=c,t[s.getElementIndex(h,f)]=l,t[s.getElementIndex(f,h)]=-l,t}s.packedLength=9,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t},s.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a},s.clone=function(e,t){if(r(e))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):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t],a[1]=e[t+1],a[2]=e[t+2],a[3]=e[t+3],a[4]=e[t+4],a[5]=e[t+5],a[6]=e[t+6],a[7]=e[t+7],a[8]=e[t+8],a},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[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 s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var n=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,u=e.y*e.y,c=e.y*e.z,l=e.y*e.w,f=e.z*e.z,h=e.z*e.w,d=e.w*e.w,p=n-u-f+d,E=2*(a-h),y=2*(i+l),m=2*(a+h),_=-n+u-f+d,v=2*(c-o),T=2*(i-l),R=2*(c+o),A=-n-u+f+d;return r(t)?(t[0]=p,t[1]=m,t[2]=T,t[3]=E,t[4]=_,t[5]=R,t[6]=y,t[7]=v,t[8]=A,t):new s(p,E,y,m,_,v,T,R,A)},s.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),a=Math.cos(-e.heading),i=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),c=Math.sin(e.roll),l=n*a,f=-i*u+c*o*a,h=c*u+i*o*a,d=n*u,p=i*a+c*o*u,E=-o*i+i*o*u,y=-o,m=c*n,_=i*n;return r(t)?(t[0]=l,t[1]=d,t[2]=y,t[3]=f,t[4]=p,t[5]=m,t[6]=h,t[7]=E,t[8]=_,t):new s(l,f,h,d,p,E,y,m,_)},s.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 s(e.x,0,0,0,e.y,0,0,0,e.z)},s.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 s(e,0,0,0,e,0,0,0,e)},s.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 s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=a,t[6]=0,t[7]=-a,t[8]=n,t):new s(1,0,0,0,n,-a,0,a,n)},s.fromRotationY=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=n,t):new s(n,0,a,0,1,0,-a,0,n)},s.fromRotationZ=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=a,t[2]=0,t[3]=-a,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(n,-a,0,a,n,0,0,0,1)},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):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,n){var r=3*t,a=e[r],i=e[r+1],o=e[r+2];return n.x=a,n.y=i,n.z=o,n},s.setColumn=function(e,t,n,r){r=s.clone(e,r);var a=3*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},s.getRow=function(e,t,n){var r=e[t],a=e[t+3],i=e[t+6];return n.x=r,n.y=a,n.z=i,n},s.setRow=function(e,t,n,r){return r=s.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var h=new e;s.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],h)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],h)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],h)),n};var d=new e;s.getMaximumScale=function(t){return s.getScale(t,d),e.maximumComponent(d)},s.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=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 n[0]=r,n[1]=a,n[2]=i,n[3]=o,n[4]=u,n[5]=s,n[6]=c,n[7]=l,n[8]=f,n},s.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},s.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},s.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[3]*a+e[6]*i,u=e[1]*r+e[4]*a+e[7]*i,s=e[2]*r+e[5]*a+e[8]*i;return n.x=o,n.y=u,n.z=s,n},s.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},s.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},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},s.transpose=function(e,t){var n=e[0],r=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=n,t[1]=r,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var p=[1,0,0],E=[2,2,1],y=new s,m=new s;return s.computeEigenDecomposition=function(e,t){var n=u.EPSILON20,a=10,i=0,o=0;r(t)||(t={});for(var h=t.unitary=s.clone(s.IDENTITY,t.unitary),d=t.diagonal=s.clone(e,t.diagonal),p=n*c(d);o<a&&l(d)>p;)f(d,y),s.transpose(y,m),s.multiply(d,y,d),s.multiply(m,d,d),s.multiply(h,y,h),++i>2&&(++o,i=0);return 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},s.determinant=function(e){var t=e[0],n=e[3],r=e[6],a=e[1],i=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*o)+a*(s*r-n*c)+u*(n*o-i*r)},s.inverse=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[3],o=e[4],u=e[5],c=e[6],l=e[7],f=e[8],h=s.determinant(e);t[0]=o*f-l*u,t[1]=l*a-r*f,t[2]=r*u-o*a,t[3]=c*u-i*f,t[4]=n*f-c*a,t[5]=i*a-n*u,t[6]=i*l-c*o,t[7]=c*r-n*l,t[8]=n*o-i*r;var d=1/h;return s.multiplyByScalar(t,d,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]},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},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,a(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r,a){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(a,0)}o.fromElements=function(e,t,r,a,i){return n(i)?(i.x=e,i.y=t,i.z=r,i.w=a,i):new o(e,t,r,a)},o.fromColor=function(e,t){return n(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(n(e))return n(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)},o.packedLength=4,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r++],a.w=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=4*r:t=new Array(4*r);for(var a=0;a<r;++a)o.pack(e[a],t,4*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/4:t=new Array(r/4);for(var a=0;a<r;a+=4){var i=a/4;t[i]=o.unpack(e,a,t[i])}return t},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,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},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 u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,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,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},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 s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,c);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)&&i.equalsEpsilon(e.w,t.w,r,a)},o.ZERO=a(new o(0,0,0,0)),o.UNIT_X=a(new o(1,0,0,0)),o.UNIT_Y=a(new o(0,1,0,0)),o.UNIT_Z=a(new o(0,0,1,0)),o.UNIT_W=a(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,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,a,i,o,u,s,c,l){"use strict";function f(e,t,n,a,i,o,u,s,c,l,f,h,d,p,E,y){this[0]=r(e,0),this[1]=r(i,0),this[2]=r(c,0),this[3]=r(d,0),this[4]=r(t,0),this[5]=r(o,0),this[6]=r(l,0),this[7]=r(p,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(f,0),this[11]=r(E,0),this[12]=r(a,0),this[13]=r(s,0),this[14]=r(h,0),this[15]=r(y,0)}f.packedLength=16,f.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},f.unpack=function(e,t,n){return t=r(t,0),a(n)||(n=new f),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},f.clone=function(e,t){if(a(e))return a(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 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])},f.fromArray=f.unpack,f.fromColumnMajorArray=function(e,t){return f.clone(e,t)},f.fromRowMajorArray=function(e,t){return a(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 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(t,n,i){return n=r(n,e.ZERO),a(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=1,i):new f(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},f.fromTranslationQuaternionRotationScale=function(e,t,n,r){a(r)||(r=new f);var i=n.x,o=n.y,u=n.z,s=t.x*t.x,c=t.x*t.y,l=t.x*t.z,h=t.x*t.w,d=t.y*t.y,p=t.y*t.z,E=t.y*t.w,y=t.z*t.z,m=t.z*t.w,_=t.w*t.w,v=s-d-y+_,T=2*(c-m),R=2*(l+E),A=2*(c+m),g=-s+d-y+_,S=2*(p-h),N=2*(l-E),x=2*(p+h),O=-s-d+y+_;return r[0]=v*i,r[1]=A*i,r[2]=N*i,r[3]=0,r[4]=T*o,r[5]=g*o,r[6]=x*o,r[7]=0,r[8]=R*u,r[9]=S*u,r[10]=O*u,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},f.fromTranslationRotationScale=function(e,t){return f.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},f.fromTranslation=function(e,t){return f.fromRotationTranslation(c.IDENTITY,e,t)},f.fromScale=function(e,t){return a(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 f(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},f.fromUniformScale=function(e,t){return a(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 f(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var h=new e,d=new e,p=new e;f.fromCamera=function(t,n){var r=t.position,i=t.direction,o=t.up;e.normalize(i,h),e.normalize(e.cross(h,o,d),d),e.normalize(e.cross(d,h,p),p);var u=d.x,s=d.y,c=d.z,l=h.x,E=h.y,y=h.z,m=p.x,_=p.y,v=p.z,T=r.x,R=r.y,A=r.z,g=u*-T+s*-R+c*-A,S=m*-T+_*-R+v*-A,N=l*T+E*R+y*A;return a(n)?(n[0]=u,n[1]=m,n[2]=-l,n[3]=0,n[4]=s,n[5]=_,n[6]=-E,n[7]=0,n[8]=c,n[9]=v,n[10]=-y,n[11]=0,n[12]=g,n[13]=S,n[14]=N,n[15]=1,n):new f(u,s,c,g,m,_,v,S,-l,-E,-y,N,0,0,0,1)},f.computePerspectiveFieldOfView=function(e,t,n,r,a){var i=Math.tan(.5*e),o=1/i,u=o/t,s=(r+n)/(n-r),c=2*r*n/(n-r);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=c,a[15]=0,a},f.computeOrthographicOffCenter=function(e,t,n,r,a,i,o){var u=1/(t-e),s=1/(r-n),c=1/(i-a),l=-(t+e)*u,f=-(r+n)*s,h=-(i+a)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=f,o[14]=h,o[15]=1,o},f.computePerspectiveOffCenter=function(e,t,n,r,a,i,o){var u=2*a/(t-e),s=2*a/(r-n),c=(t+e)/(t-e),l=(r+n)/(r-n),f=-(i+a)/(i-a),h=-1,d=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=f,o[11]=h,o[12]=0,o[13]=0,o[14]=d,o[15]=0,o},f.computeInfinitePerspectiveOffCenter=function(e,t,n,r,a,i){var o=2*a/(t-e),u=2*a/(r-n),s=(t+e)/(t-e),c=(r+n)/(r-n),l=-1,f=-1,h=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=s,i[9]=c,i[10]=l,i[11]=f,i[12]=0,i[13]=0,i[14]=h,i[15]=0,i},f.computeViewportTransformation=function(e,t,n,a){e=r(e,r.EMPTY_OBJECT);var i=r(e.x,0),o=r(e.y,0),u=r(e.width,0),s=r(e.height,0);t=r(t,0),n=r(n,1);var c=.5*u,l=.5*s,f=.5*(n-t),h=c,d=l,p=f,E=i+c,y=o+l,m=t+f,_=1;return a[0]=h,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=d,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=p,a[11]=0,a[12]=E,a[13]=y,a[14]=m,a[15]=_,a},f.computeView=function(t,n,r,a,i){return i[0]=a.x,i[1]=r.x,i[2]=-n.x,i[3]=0,i[4]=a.y,i[5]=r.y,i[6]=-n.y,i[7]=0,i[8]=a.z,i[9]=r.z,i[10]=-n.z,i[11]=0,i[12]=-e.dot(a,t),i[13]=-e.dot(r,t),i[14]=e.dot(n,t),i[15]=1,i},f.toArray=function(e,t){return a(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]]},f.getElementIndex=function(e,t){return 4*e+t},f.getColumn=function(e,t,n){var r=4*t,a=e[r],i=e[r+1],o=e[r+2],u=e[r+3];return n.x=a,n.y=i,n.z=o,n.w=u,n},f.setColumn=function(e,t,n,r){r=f.clone(e,r);var a=4*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r[a+3]=n.w,r},f.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},f.getRow=function(e,t,n){var r=e[t],a=e[t+4],i=e[t+8],o=e[t+12];return n.x=r,n.y=a,n.z=i,n.w=o,n},f.setRow=function(e,t,n,r){return r=f.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var E=new e;f.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],E)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],E)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],E)),n};var y=new e;f.getMaximumScale=function(t){return f.getScale(t,y),e.maximumComponent(y)},f.multiply=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],f=e[8],h=e[9],d=e[10],p=e[11],E=e[12],y=e[13],m=e[14],_=e[15],v=t[0],T=t[1],R=t[2],A=t[3],g=t[4],S=t[5],N=t[6],x=t[7],O=t[8],w=t[9],I=t[10],M=t[11],C=t[12],P=t[13],D=t[14],U=t[15],L=r*v+u*T+f*R+E*A,b=a*v+s*T+h*R+y*A,F=i*v+c*T+d*R+m*A,z=o*v+l*T+p*R+_*A,B=r*g+u*S+f*N+E*x,G=a*g+s*S+h*N+y*x,q=i*g+c*S+d*N+m*x,W=o*g+l*S+p*N+_*x,V=r*O+u*w+f*I+E*M,X=a*O+s*w+h*I+y*M,H=i*O+c*w+d*I+m*M,Y=o*O+l*w+p*I+_*M,k=r*C+u*P+f*D+E*U,Z=a*C+s*P+h*D+y*U,j=i*C+c*P+d*D+m*U,K=o*C+l*P+p*D+_*U;return n[0]=L,n[1]=b,n[2]=F,n[3]=z,n[4]=B,n[5]=G,n[6]=q,n[7]=W,n[8]=V,n[9]=X,n[10]=H,n[11]=Y,n[12]=k,n[13]=Z,n[14]=j,n[15]=K,n},f.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},f.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},f.multiplyTransformation=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=e[12],d=e[13],p=e[14],E=t[0],y=t[1],m=t[2],_=t[4],v=t[5],T=t[6],R=t[8],A=t[9],g=t[10],S=t[12],N=t[13],x=t[14],O=r*E+o*y+c*m,w=a*E+u*y+l*m,I=i*E+s*y+f*m,M=r*_+o*v+c*T,C=a*_+u*v+l*T,P=i*_+s*v+f*T,D=r*R+o*A+c*g,U=a*R+u*A+l*g,L=i*R+s*A+f*g,b=r*S+o*N+c*x+h,F=a*S+u*N+l*x+d,z=i*S+s*N+f*x+p;return n[0]=O,n[1]=w,n[2]=I,n[3]=0,n[4]=M,n[5]=C,n[6]=P,n[7]=0,n[8]=D,n[9]=U,n[10]=L,n[11]=0,n[12]=b,n[13]=F,n[14]=z,n[15]=1,n},f.multiplyByMatrix3=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=t[0],d=t[1],p=t[2],E=t[3],y=t[4],m=t[5],_=t[6],v=t[7],T=t[8],R=r*h+o*d+c*p,A=a*h+u*d+l*p,g=i*h+s*d+f*p,S=r*E+o*y+c*m,N=a*E+u*y+l*m,x=i*E+s*y+f*m,O=r*_+o*v+c*T,w=a*_+u*v+l*T,I=i*_+s*v+f*T;return n[0]=R,n[1]=A,n[2]=g,n[3]=0,n[4]=S,n[5]=N,n[6]=x,n[7]=0,n[8]=O,n[9]=w,n[10]=I,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},f.multiplyByTranslation=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=r*e[0]+a*e[4]+i*e[8]+e[12],u=r*e[1]+a*e[5]+i*e[9]+e[13],s=r*e[2]+a*e[6]+i*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=s,n[15]=e[15],n};var m=new e;f.multiplyByUniformScale=function(e,t,n){return m.x=t,m.y=t,m.z=t,f.multiplyByScale(e,m,n)},f.multiplyByScale=function(e,t,n){var r=t.x,a=t.y,i=t.z;return 1===r&&1===a&&1===i?f.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=a*e[4],n[5]=a*e[5],n[6]=a*e[6],n[7]=0,n[8]=i*e[8],n[9]=i*e[9],n[10]=i*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},f.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=t.w,u=e[0]*r+e[4]*a+e[8]*i+e[12]*o,s=e[1]*r+e[5]*a+e[9]*i+e[13]*o,c=e[2]*r+e[6]*a+e[10]*i+e[14]*o,l=e[3]*r+e[7]*a+e[11]*i+e[15]*o;return n.x=u,n.y=s,n.z=c,n.w=l,n},f.multiplyByPointAsVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i,u=e[1]*r+e[5]*a+e[9]*i,s=e[2]*r+e[6]*a+e[10]*i;return n.x=o,n.y=u,n.z=s,n},f.multiplyByPoint=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i+e[12],u=e[1]*r+e[5]*a+e[9]*i+e[13],s=e[2]*r+e[6]*a+e[10]*i+e[14];return n.x=o,n.y=u,n.z=s,n},f.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},f.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},f.transpose=function(e,t){var n=e[1],r=e[2],a=e[3],i=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=o,t[14]=u,t[15]=e[15],t},f.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},f.equals=function(e,t){return e===t||a(e)&&a(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},f.equalsEpsilon=function(e,t,n){return e===t||a(e)&&a(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},f.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},f.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};var _=new c,v=new c,T=new t,R=new t(0,0,0,1);return f.inverse=function(e,n){if(c.equalsEpsilon(f.getRotation(e,_),v,s.EPSILON7)&&t.equals(f.getRow(e,3,T),R))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],a=e[4],i=e[8],o=e[12],u=e[1],h=e[5],d=e[9],p=e[13],E=e[2],y=e[6],m=e[10],A=e[14],g=e[3],S=e[7],N=e[11],x=e[15],O=m*x,w=A*N,I=y*x,M=A*S,C=y*N,P=m*S,D=E*x,U=A*g,L=E*N,b=m*g,F=E*S,z=y*g,B=O*h+M*d+C*p-(w*h+I*d+P*p),G=w*u+D*d+b*p-(O*u+U*d+L*p),q=I*u+U*h+F*p-(M*u+D*h+z*p),W=P*u+L*h+z*d-(C*u+b*h+F*d),V=w*a+I*i+P*o-(O*a+M*i+C*o),X=O*r+U*i+L*o-(w*r+D*i+b*o),H=M*r+D*a+z*o-(I*r+U*a+F*o),Y=C*r+b*a+F*i-(P*r+L*a+z*i);O=i*p,w=o*d,I=a*p,M=o*h,C=a*d,P=i*h,D=r*p,U=o*u,L=r*d,b=i*u,F=r*h,z=a*u;var k=O*S+M*N+C*x-(w*S+I*N+P*x),Z=w*g+D*N+b*x-(O*g+U*N+L*x),j=I*g+U*S+F*x-(M*g+D*S+z*x),K=P*g+L*S+z*N-(C*g+b*S+F*N),J=I*m+P*A+w*y-(C*A+O*y+M*m),Q=L*A+O*E+U*m-(D*m+b*A+w*E),$=D*y+z*A+M*E-(F*A+I*E+U*y),ee=F*m+C*E+b*y-(L*y+z*m+P*E),te=r*B+a*G+i*q+o*W;if(Math.abs(te)<s.EPSILON20)throw new l("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=B*te,n[1]=G*te,n[2]=q*te,n[3]=W*te,n[4]=V*te,n[5]=X*te,n[6]=H*te,n[7]=Y*te,n[8]=k*te,n[9]=Z*te,n[10]=j*te,n[11]=K*te,n[12]=J*te,n[13]=Q*te,n[14]=$*te,n[15]=ee*te,n},f.inverseTransformation=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],f=e[12],h=e[13],d=e[14],p=-n*f-r*h-a*d,E=-i*f-o*h-u*d,y=-s*f-c*h-l*d;return t[0]=n,t[1]=i,t[2]=s,t[3]=0,t[4]=r,t[5]=o,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=l,t[11]=0,t[12]=p,t[13]=E,t[14]=y,t[15]=1,t},f.IDENTITY=u(new f(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),f.ZERO=u(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,i(f.prototype,{length:{get:function(){return f.packedLength}}}),f.prototype.clone=function(e){return f.clone(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},f.prototype.equalsEpsilon=function(e,t){return f.equalsEpsilon(this,e,t)},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/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var d=new e,p=new e,E=new e,y=new e,m=new e,_=new e,v=new e,T=new e,R=new e,A=new e,g=new e,S=new e;h.fromPoints=function(t,n){if(a(n)||(n=new h),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var r=e.clone(t[0],v),i=e.clone(r,d),o=e.clone(r,p),u=e.clone(r,E),s=e.clone(r,y),c=e.clone(r,m),l=e.clone(r,_),f=t.length,N=1;N<f;N++){e.clone(t[N],r);var x=r.x,O=r.y,w=r.z;x<i.x&&e.clone(r,i),x>s.x&&e.clone(r,s),O<o.y&&e.clone(r,o),O>c.y&&e.clone(r,c),w<u.z&&e.clone(r,u),w>l.z&&e.clone(r,l)}var I=e.magnitudeSquared(e.subtract(s,i,T)),M=e.magnitudeSquared(e.subtract(c,o,T)),C=e.magnitudeSquared(e.subtract(l,u,T)),P=i,D=s,U=I;M>U&&(U=M,P=o,D=c),C>U&&(U=C,P=u,D=l);var L=R;L.x=.5*(P.x+D.x),L.y=.5*(P.y+D.y),L.z=.5*(P.z+D.z);var b=e.magnitudeSquared(e.subtract(D,L,T)),F=Math.sqrt(b),z=A;z.x=i.x,z.y=o.y,z.z=u.z;var B=g;B.x=s.x,B.y=c.y,B.z=l.z;var G=e.multiplyByScalar(e.add(z,B,T),.5,S),q=0;for(N=0;N<f;N++){e.clone(t[N],r);var W=e.magnitude(e.subtract(r,G,T));W>q&&(q=W);var V=e.magnitudeSquared(e.subtract(r,L,T));if(V>b){var X=Math.sqrt(V);F=.5*(F+X),b=F*F;var H=X-F;L.x=(F*L.x+H*r.x)/X,L.y=(F*L.y+H*r.y)/X,L.z=(F*L.z+H*r.z)/X}}return F<q?(e.clone(L,n.center),n.radius=F):(e.clone(G,n.center),n.radius=q),n};var N=new o,x=new e,O=new e,w=new t,I=new t;h.fromRectangle2D=function(e,t,n){return h.fromRectangleWithHeights2D(e,t,0,0,n)},h.fromRectangleWithHeights2D=function(t,n,i,o,u){if(a(u)||(u=new h),!a(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;n=r(n,N),f.southwest(t,w),w.height=i,f.northeast(t,I),I.height=o;var s=n.project(w,x),c=n.project(I,O),l=c.x-s.x,d=c.y-s.y,p=c.z-s.z;u.radius=.5*Math.sqrt(l*l+d*d+p*p);var E=u.center;return E.x=s.x+.5*l,E.y=s.y+.5*d,E.z=s.z+.5*p,u};var M=[];h.fromRectangle3D=function(e,t,n,o){t=r(t,i.WGS84),n=r(n,0);var u;return a(e)&&(u=f.subsample(e,t,n,M)),h.fromPoints(u,o)},h.fromVertices=function(t,n,i,o){if(a(o)||(o=new h),!a(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;n=r(n,e.ZERO),i=r(i,3);var u=v;u.x=t[0]+n.x,u.y=t[1]+n.y,u.z=t[2]+n.z;for(var s=e.clone(u,d),c=e.clone(u,p),l=e.clone(u,E),f=e.clone(u,y),N=e.clone(u,m),x=e.clone(u,_),O=t.length,w=0;w<O;w+=i){var I=t[w]+n.x,M=t[w+1]+n.y,C=t[w+2]+n.z;u.x=I,u.y=M,u.z=C,I<s.x&&e.clone(u,s),I>f.x&&e.clone(u,f),M<c.y&&e.clone(u,c),M>N.y&&e.clone(u,N),C<l.z&&e.clone(u,l),C>x.z&&e.clone(u,x)}var P=e.magnitudeSquared(e.subtract(f,s,T)),D=e.magnitudeSquared(e.subtract(N,c,T)),U=e.magnitudeSquared(e.subtract(x,l,T)),L=s,b=f,F=P;D>F&&(F=D,L=c,b=N),U>F&&(F=U,L=l,b=x);var z=R;z.x=.5*(L.x+b.x),z.y=.5*(L.y+b.y),z.z=.5*(L.z+b.z);var B=e.magnitudeSquared(e.subtract(b,z,T)),G=Math.sqrt(B),q=A;q.x=s.x,q.y=c.y,q.z=l.z;var W=g;W.x=f.x,W.y=N.y,W.z=x.z;var V=e.multiplyByScalar(e.add(q,W,T),.5,S),X=0;for(w=0;w<O;w+=i){u.x=t[w]+n.x,u.y=t[w+1]+n.y,u.z=t[w+2]+n.z;var H=e.magnitude(e.subtract(u,V,T));H>X&&(X=H);var Y=e.magnitudeSquared(e.subtract(u,z,T));if(Y>B){var k=Math.sqrt(Y);G=.5*(G+k),B=G*G;var Z=k-G;z.x=(G*z.x+Z*u.x)/k,z.y=(G*z.y+Z*u.y)/k,z.z=(G*z.z+Z*u.z)/k}}return G<X?(e.clone(z,o.center),o.radius=G):(e.clone(V,o.center),o.radius=X),o},h.fromEncodedCartesianVertices=function(t,n,r){if(a(r)||(r=new h),!a(t)||!a(n)||t.length!==n.length||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var i=v;i.x=t[0]+n[0],i.y=t[1]+n[1],i.z=t[2]+n[2];for(var o=e.clone(i,d),u=e.clone(i,p),s=e.clone(i,E),c=e.clone(i,y),l=e.clone(i,m),f=e.clone(i,_),N=t.length,x=0;x<N;x+=3){var O=t[x]+n[x],w=t[x+1]+n[x+1],I=t[x+2]+n[x+2];i.x=O,i.y=w,i.z=I,O<o.x&&e.clone(i,o),O>c.x&&e.clone(i,c),w<u.y&&e.clone(i,u),w>l.y&&e.clone(i,l),I<s.z&&e.clone(i,s),I>f.z&&e.clone(i,f)}var M=e.magnitudeSquared(e.subtract(c,o,T)),C=e.magnitudeSquared(e.subtract(l,u,T)),P=e.magnitudeSquared(e.subtract(f,s,T)),D=o,U=c,L=M;C>L&&(L=C,D=u,U=l),P>L&&(L=P,D=s,U=f);var b=R;b.x=.5*(D.x+U.x),b.y=.5*(D.y+U.y),b.z=.5*(D.z+U.z);var F=e.magnitudeSquared(e.subtract(U,b,T)),z=Math.sqrt(F),B=A;B.x=o.x,B.y=u.y,B.z=s.z;var G=g;G.x=c.x,G.y=l.y,G.z=f.z;var q=e.multiplyByScalar(e.add(B,G,T),.5,S),W=0;for(x=0;x<N;x+=3){i.x=t[x]+n[x],i.y=t[x+1]+n[x+1],i.z=t[x+2]+n[x+2];var V=e.magnitude(e.subtract(i,q,T));V>W&&(W=V);var X=e.magnitudeSquared(e.subtract(i,b,T));if(X>F){var H=Math.sqrt(X);z=.5*(z+H),F=z*z;var Y=H-z;b.x=(z*b.x+Y*i.x)/H,b.y=(z*b.y+Y*i.y)/H,b.z=(z*b.z+Y*i.z)/H}}return z<W?(e.clone(b,r.center),r.radius=z):(e.clone(q,r.center),r.radius=W),r},h.fromCornerPoints=function(t,n,r){a(r)||(r=new h);var i=r.center;return e.add(t,n,i),e.multiplyByScalar(i,.5,i),r.radius=e.distance(i,n),r},h.fromEllipsoid=function(t,n){return a(n)||(n=new h),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var C=new e;h.fromBoundingSpheres=function(t,n){if(a(n)||(n=new h),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var r=t.length;if(1===r)return h.clone(t[0],n);if(2===r)return h.union(t[0],t[1],n);for(var i=[],o=0;o<r;o++)i.push(t[o].center);n=h.fromPoints(i,n);var u=n.center,s=n.radius;for(o=0;o<r;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,C)+c.radius)}return n.radius=s,n};var P=new e,D=new e,U=new e;h.fromOrientedBoundingBox=function(t,n){a(n)||(n=new h);var r=t.halfAxes,i=c.getColumn(r,0,P),o=c.getColumn(r,1,D),u=c.getColumn(r,2,U),s=e.magnitude(i),l=e.magnitude(o),f=e.magnitude(u);return n.center=e.clone(t.center,n.center),n.radius=Math.max(s,l,f),n},h.clone=function(t,n){if(a(t))return a(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new h(t.center,t.radius)},h.packedLength=4,h.pack=function(e,t,n){n=r(n,0);var a=e.center;return t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n]=e.radius,t},h.unpack=function(e,t,n){t=r(t,0),a(n)||(n=new h);var i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};var L=new e,b=new e;h.union=function(t,n,r){a(r)||(r=new h);var i=t.center,o=t.radius,u=n.center,s=n.radius,c=e.subtract(u,i,L),l=e.magnitude(c);if(o>=l+s)return t.clone(r),r;if(s>=l+o)return n.clone(r),r;var f=.5*(o+l+s),d=e.multiplyByScalar(c,(-o+f)/l,b);return e.add(d,i,d),e.clone(d,r.center),r.radius=f,r};var F=new e;h.expand=function(t,n,r){r=h.clone(t,r);var a=e.magnitude(e.subtract(n,r.center,F)); +return a>r.radius&&(r.radius=a),r},h.intersectPlane=function(t,n){var r=t.center,a=t.radius,i=n.normal,o=e.dot(i,r)+n.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},h.transform=function(e,t,n){return a(n)||(n=new h),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=l.getMaximumScale(t)*e.radius,n};var z=new e;h.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,z);return e.magnitudeSquared(r)-t.radius*t.radius},h.transformWithoutScale=function(e,t,n){return a(n)||(n=new h),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var B=new e;h.computePlaneDistances=function(t,n,r,i){a(i)||(i=new s);var o=e.subtract(t.center,n,B),u=e.dot(r,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var G=new e,q=new e,W=new e,V=new e,X=new e,H=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var Z=new o;return h.projectTo2D=function(t,n,a){n=r(n,Z);var i=n.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,G),c=e.cross(e.UNIT_Z,s,q);e.normalize(c,c);var l=e.cross(s,c,W);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var f=e.negate(l,X),d=e.negate(c,V),p=Y,E=p[0];e.add(s,l,E),e.add(E,c,E),E=p[1],e.add(s,l,E),e.add(E,d,E),E=p[2],e.add(s,f,E),e.add(E,d,E),E=p[3],e.add(s,f,E),e.add(E,c,E),e.negate(s,s),E=p[4],e.add(s,l,E),e.add(E,c,E),E=p[5],e.add(s,l,E),e.add(E,d,E),E=p[6],e.add(s,f,E),e.add(E,d,E),E=p[7],e.add(s,f,E),e.add(E,c,E);for(var y=p.length,m=0;m<y;++m){var _=p[m];e.add(o,_,_);var v=i.cartesianToCartographic(_,H);n.project(v,_)}a=h.fromPoints(p,a),o=a.center;var T=o.x,R=o.y,A=o.z;return o.x=A,o.y=T,o.z=R,a},h.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},h.equals=function(t,n){return t===n||a(t)&&a(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},h.prototype.intersectPlane=function(e){return h.intersectPlane(this,e)},h.prototype.distanceSquaredTo=function(e){return h.distanceSquaredTo(this,e)},h.prototype.computePlaneDistances=function(e,t,n){return h.computePlaneDistances(this,e,t,n)},h.prototype.isOccluded=function(e){return h.isOccluded(this,e)},h.prototype.equals=function(e){return h.equals(this,e)},h.prototype.clone=function(e){return h.clone(this,e)},h}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return t(a,{element:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(r.requestFullscreen=a,n=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(r.requestFullscreen=a,n=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?r.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(r.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?r.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(r.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?r.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(r.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),r.fullscreenerror=a)}return n},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[r.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function a(){if(!t(R)&&(R=!1,!h())){var e=/ Chrome\/([\.0-9]+)/.exec(T.userAgent);null!==e&&(R=!0,A=r(e[1]))}return R}function i(){return a()&&A}function o(){if(!t(g)&&(g=!1,!a()&&!h()&&/ Safari\/[\.0-9]+/.test(T.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(T.userAgent);null!==e&&(g=!0,S=r(e[1]))}return g}function u(){return o()&&S}function s(){if(!t(N)){N=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(T.userAgent);null!==e&&(N=!0,x=r(e[1]),x.isNightly=!!e[2])}return N}function c(){return s()&&x}function l(){if(!t(O)){O=!1;var e;"Microsoft Internet Explorer"===T.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(T.userAgent),null!==e&&(O=!0,w=r(e[1]))):"Netscape"===T.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(T.userAgent),null!==e&&(O=!0,w=r(e[1])))}return O}function f(){return l()&&w}function h(){if(!t(I)){I=!1;var e=/ Edge\/([\.0-9]+)/.exec(T.userAgent);null!==e&&(I=!0,M=r(e[1]))}return I}function d(){return h()&&M}function p(){if(!t(C)){C=!1;var e=/Firefox\/([\.0-9]+)/.exec(T.userAgent);null!==e&&(C=!0,P=r(e[1]))}return C}function E(){return t(D)||(D=/Windows/i.test(T.appVersion)),D}function y(){return p()&&P}function m(){return t(U)||(U="undefined"!=typeof PointerEvent&&(!t(T.pointerEnabled)||T.pointerEnabled)),U}function _(){if(!t(b)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;b=t(n)&&""!==n,b&&(L=n)}return b}function v(){return _()?L:void 0}var T;T="undefined"!=typeof navigator?navigator:{};var R,A,g,S,N,x,O,w,I,M,C,P,D,U,L,b,F={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isEdge:h,edgeVersion:d,isFirefox:p,firefoxVersion:y,isWindows:E,hardwareConcurrency:e(T.hardwareConcurrency,3),supportsPointerEvents:m,supportsImageRenderingPixelated:_,imageRenderingValue:v};return F.supportsFullscreen=function(){return n.supportsFullscreen()},F.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},F.supportsWebWorkers=function(){return"undefined"!=typeof Worker},F}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,a,i){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){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.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},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 Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,a){switch(r=e(r,0),a=e(a,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,a);case o.SHORT:return new Int16Array(n,r,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,a);case o.INT:return new Int32Array(n,r,a);case o.UNSIGNED_INT:return new Uint32Array(n,r,a);case o.FLOAT:return new Float32Array(n,r,a);case o.DOUBLE:return new Float64Array(n,r,a)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/CornerType",["./freezeObject"],function(e){"use strict";var t={ROUNDED:0,MITERED:1,BEVELED:2};return e(t)}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===n.POINTS||e===n.LINES||e===n.LINE_LOOP||e===n.LINE_STRIP||e===n.TRIANGLES||e===n.TRIANGLE_STRIP||e===n.TRIANGLE_FAN}};return e(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,a){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,a.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return i.computeNumberOfVertices=function(e){var n=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var a=e.attributes[r],i=a.values.length/a.componentsPerAttribute;n=i}return n},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(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 r}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r,a){"use strict";var i={};i.octEncodeInRange=function(e,t,n){if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var r=n.x,i=n.y;n.x=(1-Math.abs(i))*a.signNotZero(r),n.y=(1-Math.abs(r))*a.signNotZero(i)}return n.x=a.toSNorm(n.x,t),n.y=a.toSNorm(n.y,t),n},i.octEncode=function(e,t){return i.octEncodeInRange(e,255,t)},i.octDecodeInRange=function(e,n,r,i){if(i.x=a.fromSNorm(e,r),i.y=a.fromSNorm(n,r),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){var o=i.x;i.x=(1-Math.abs(i.y))*a.signNotZero(o),i.y=(1-Math.abs(o))*a.signNotZero(i.y)}return t.normalize(i,i)},i.octDecode=function(e,t,n){return i.octDecodeInRange(e,t,255,n)},i.octPackFloat=function(e){return 256*e.x+e.y};var o=new e;return i.octEncodeFloat=function(e){return i.octEncode(e,o),i.octPackFloat(o)},i.octDecodeFloat=function(e,t){var n=e/256,r=Math.floor(n),a=256*(n-r);return i.octDecode(r,a,t)},i.octPack=function(e,t,n,r){var a=i.octEncodeFloat(e),u=i.octEncodeFloat(t),s=i.octEncode(n,o);return r.x=65536*s.x+a,r.y=65536*s.y+u,r},i.octUnpack=function(e,t,n,r){var a=e.x/65536,o=Math.floor(a),u=65536*(a-o);a=e.y/65536;var s=Math.floor(a),c=65536*(a-s);i.octDecodeFloat(u,t),i.octDecodeFloat(c,n),i.octDecode(o,s,r)},i.compressTextureCoordinates=function(e){var t=4095*e.x|0,n=4095*e.y|0;return 4096*t+n},i.decompressTextureCoordinates=function(e,t){var n=e/4096,r=Math.floor(n);return t.x=r/4095,t.y=(e-4096*r)/4095,t},i}),define("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(r,a,s,c,l){n(l)||(l=new t);var f,h,d,p,E,y,m,_;n(a.z)?(f=t.subtract(s,a,i),h=t.subtract(c,a,o),d=t.subtract(r,a,u),p=t.dot(f,f),E=t.dot(f,h),y=t.dot(f,d),m=t.dot(h,h),_=t.dot(h,d)):(f=e.subtract(s,a,i),h=e.subtract(c,a,o),d=e.subtract(r,a,u),p=e.dot(f,f),E=e.dot(f,h),y=e.dot(f,d),m=e.dot(h,h),_=e.dot(h,d));var v=1/(p*m-E*E);return l.y=(m*y-E*_)*v,l.z=(p*_-E*y)*v,l.x=1-l.y-l.z,l}var i=new t,o=new t,u=new t;return a}),define("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n,r){t(a[n])||(a[n]=!0,console.warn(e(r,n)))}var a={};return r.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.",r}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,n){"use strict";function r(e,t){n(e,t)}return r}),define("Core/EncodedCartesian3",["./Cartesian3","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(){this.high=e.clone(e.ZERO),this.low=e.clone(e.ZERO)}r.encode=function(e,n){t(n)||(n={high:0,low:0});var r;return e>=0?(r=65536*Math.floor(e/65536),n.high=r,n.low=e-r):(r=65536*Math.floor(-e/65536),n.high=-r,n.low=e+r),n};var a={high:0,low:0};r.fromCartesian=function(e,n){t(n)||(n=new r);var i=n.high,o=n.low;return r.encode(e.x,a),i.x=a.high,o.x=a.low,r.encode(e.y,a),i.y=a.high,o.y=a.low,r.encode(e.z,a),i.z=a.high,o.z=a.low,n};var i=new r;return r.writeElements=function(e,t,n){r.fromCartesian(e,i);var a=i.high,o=i.low;t[n]=a.x,t[n+1]=a.y,t[n+2]=a.z,t[n+3]=o.x,t[n+4]=o.y,t[n+5]=o.z},r}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,n,r,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(e){switch(e){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(t){return e(t)&&(t===i.UNSIGNED_BYTE||t===i.UNSIGNED_SHORT||t===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,n,a){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,a):new Uint16Array(t,n,a)},n(i)}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function n(e,n,r){var a=e+n;return t.sign(e)!==t.sign(n)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(n)))<r?0:a}var r={};return r.computeDiscriminant=function(e,t,n){var r=t*t-4*e*n;return r},r.computeRealRoots=function(e,r,a){var i;if(0===e)return 0===r?[]:[-a/r];if(0===r){if(0===a)return[0,0];var o=Math.abs(a),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,i<0)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-r/e,i<0?[i,0]:[0,i];var c=r*r,l=4*e*a,f=n(c,-l,t.EPSILON14);if(f<0)return[];var h=-.5*n(r,t.sign(r)*Math.sqrt(f),t.EPSILON14);return r>0?[h/e,a/h]:[a/h,h/e]},r}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function n(e,t,n,r){var a,i,o=e,u=t/3,s=n/3,c=r,l=o*s,f=u*c,h=u*u,d=s*s,p=o*s-h,E=o*c-u*s,y=u*c-d,m=4*p*y-E*E;if(m<0){var _,v,T;h*f>=l*d?(_=o,v=p,T=-2*u*p+o*E):(_=c,v=y,T=-c*E+2*s*y);var R=T<0?-1:1,A=-R*Math.abs(_)*Math.sqrt(-m);i=-T+A;var g=i/2,S=g<0?-Math.pow(-g,1/3):Math.pow(g,1/3),N=i===A?-S:-v/S;return a=v<=0?S+N:-T/(S*S+N*N+v),h*f>=l*d?[(a-u)/o]:[-c/(a+s)]}var x=p,O=-2*u*p+o*E,w=y,I=-c*E+2*s*y,M=Math.sqrt(m),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*M,-O)/3);a=2*Math.sqrt(-x);var D=Math.cos(P);i=a*D;var U=a*(-D/2-C*Math.sin(P)),L=i+U>2*u?i-u:U-u,b=o,F=L/b;P=Math.abs(Math.atan2(c*M,-I)/3),a=2*Math.sqrt(-w),D=Math.cos(P),i=a*D,U=a*(-D/2-C*Math.sin(P));var z=-c,B=i+U<2*s?i+s:U+s,G=z/B,q=b*B,W=-L*B-b*z,V=L*z,X=(s*W-u*V)/(-u*W+s*q);return F<=X?F<=G?X<=G?[F,X,G]:[F,G,X]:[G,F,X]:F<=G?[X,F,G]:X<=G?[X,G,F]:[G,X,F]}var r={};return r.computeDiscriminant=function(e,t,n,r){var a=e*e,i=t*t,o=n*n,u=r*r,s=18*e*t*n*r+i*o-27*a*u-4*(e*o*n+i*t*r);return s},r.computeRealRoots=function(e,r,a,i){var o,u;if(0===e)return t.computeRealRoots(r,a,i);if(0===r){if(0===a){if(0===i)return[0,0,0];u=-i/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===i?(o=t.computeRealRoots(e,0,a),0===o.Length?[0]:[o[0],0,o[1]]):n(e,0,a,i)}return 0===a?0===i?(u=-r/e,u<0?[u,0,0]:[0,0,u]):n(e,r,0,i):0===i?(o=t.computeRealRoots(e,r,a),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):n(e,r,a,i)},r}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,n,r){"use strict";function a(t,a,i,o){var u=t*t,s=a-3*u/8,c=i-a*t/2+u*t/8,l=o-i*t/4+a*u/16-3*u*u/256,f=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(f.length>0){var h=-t/4,d=f[f.length-1];if(Math.abs(d)<n.EPSILON14){var p=r.computeRealRoots(1,s,l);if(2===p.length){var E,y=p[0],m=p[1];if(y>=0&&m>=0){var _=Math.sqrt(y),v=Math.sqrt(m);return[h-v,h-_,h+_,h+v]}if(y>=0&&m<0)return E=Math.sqrt(y),[h-E,h+E];if(y<0&&m>=0)return E=Math.sqrt(m),[h-E,h+E]}return[]}if(d>0){var T=Math.sqrt(d),R=(s+d-c/T)/2,A=(s+d+c/T)/2,g=r.computeRealRoots(1,T,R),S=r.computeRealRoots(1,-T,A);return 0!==g.length?(g[0]+=h,g[1]+=h,0!==S.length?(S[0]+=h,S[1]+=h,g[1]<=S[0]?[g[0],g[1],S[0],S[1]]:S[1]<=g[0]?[S[0],S[1],g[0],g[1]]:g[0]>=S[0]&&g[1]<=S[1]?[S[0],g[0],g[1],S[1]]:S[0]>=g[0]&&S[1]<=g[1]?[g[0],S[0],S[1],g[1]]:g[0]>S[0]&&g[0]<S[1]?[S[0],g[0],S[1],g[1]]:[g[0],S[0],g[1],S[1]]):g):0!==S.length?(S[0]+=h,S[1]+=h,S):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,f=i*t+s-4*o,h=c*o-i*a*t+u,d=e.computeRealRoots(1,l,f,h);if(d.length>0){var p,E,y=d[0],m=a-y,_=m*m,v=t/2,T=m/2,R=_-4*o,A=_+4*Math.abs(o),g=c-4*y,S=c+4*Math.abs(y);if(y<0||R*S<g*A){var N=Math.sqrt(g);p=N/2,E=0===N?0:(t*T-i)/N}else{var x=Math.sqrt(R);p=0===x?0:(t*T-i)/x,E=x/2}var O,w;0===v&&0===p?(O=0,w=0):n.sign(v)===n.sign(p)?(O=v+p,w=y/O):(w=v-p,O=y/w);var I,M;0===T&&0===E?(I=0,M=0):n.sign(T)===n.sign(E)?(I=T+E,M=o/I):(M=T-E,I=o/M);var C=r.computeRealRoots(1,O,I),P=r.computeRealRoots(1,w,M); +if(0!==C.length)return 0!==P.length?C[1]<=P[0]?[C[0],C[1],P[0],P[1]]:P[1]<=C[0]?[P[0],P[1],C[0],C[1]]:C[0]>=P[0]&&C[1]<=P[1]?[P[0],C[0],C[1],P[1]]:P[0]>=C[0]&&P[1]<=C[1]?[C[0],P[0],P[1],C[1]]:C[0]>P[0]&&C[0]<P[1]?[P[0],C[0],P[1],C[1]]:[C[0],P[0],C[1],P[1]]:C;if(0!==P.length)return P}return[]}var o={};return o.computeDiscriminant=function(e,t,n,r,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=n*n,l=c*n,f=r*r,h=f*r,d=a*a,p=d*a,E=u*c*f-4*s*h-4*e*l*f+18*e*t*n*h-27*i*f*f+256*o*p+a*(18*s*n*r-4*u*l+16*e*c*c-80*e*t*c*r-6*e*u*f+144*i*n*f)+d*(144*e*u*n-27*u*u-128*i*c-192*i*t*r);return E},o.computeRealRoots=function(t,r,o,u,s){if(Math.abs(t)<n.EPSILON15)return e.computeRealRoots(r,o,u,s);var c=r/t,l=o/t,f=u/t,h=s/t,d=c<0?1:0;switch(d+=l<0?d+1:d,d+=f<0?d+1:d,d+=h<0?d+1:d){case 0:return a(c,l,f,h);case 1:return i(c,l,f,h);case 2:return i(c,l,f,h);case 3:return a(c,l,f,h);case 4:return a(c,l,f,h);case 5:return i(c,l,f,h);case 6:return a(c,l,f,h);case 7:return a(c,l,f,h);case 8:return i(c,l,f,h);case 9:return a(c,l,f,h);case 10:return a(c,l,f,h);case 11:return i(c,l,f,h);case 12:return a(c,l,f,h);case 13:return a(c,l,f,h);case 14:return a(c,l,f,h);case 15:return a(c,l,f,h);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=e.clone(t(r,e.ZERO)),e.equals(r,e.ZERO)||e.normalize(r,r),this.origin=e.clone(t(n,e.ZERO)),this.direction=r}return a.getPoint=function(t,r,a){return n(a)||(a=new e),a=e.multiplyByScalar(t.direction,r,a),e.add(t.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,n,r,a,i,o,u,s,c,l){"use strict";function f(e,t,n,r){var a=t*t-4*e*n;if(!(a<0)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return u<s?(r.root0=u,r.root1=s):(r.root0=s,r.root1=u),r}var c=-t/(2*e);if(0!==c)return r.root0=r.root1=c,r}}function h(t,n,a){r(a)||(a=new i);var o=t.origin,u=t.direction,s=n.center,c=n.radius*n.radius,l=e.subtract(o,s,_),h=e.dot(u,u),d=2*e.dot(u,l),p=e.magnitudeSquared(l)-c,E=f(h,d,p,A);if(r(E))return a.start=E.root0,a.stop=E.root1,a}function d(e,t,n){var r=e+t;return o.sign(e)!==o.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))<n?0:r}function p(t,n,r,a,i){var l,f=a*a,h=i*i,p=(t[u.COLUMN1ROW1]-t[u.COLUMN2ROW2])*h,E=i*(a*d(t[u.COLUMN1ROW0],t[u.COLUMN0ROW1],o.EPSILON15)+n.y),y=t[u.COLUMN0ROW0]*f+t[u.COLUMN2ROW2]*h+a*n.x+r,m=h*d(t[u.COLUMN2ROW1],t[u.COLUMN1ROW2],o.EPSILON15),_=i*(a*d(t[u.COLUMN2ROW0],t[u.COLUMN0ROW2])+n.z),v=[];if(0===_&&0===m){if(l=s.computeRealRoots(p,E,y),0===l.length)return v;var T=l[0],R=Math.sqrt(Math.max(1-T*T,0));if(v.push(new e(a,i*T,i*-R)),v.push(new e(a,i*T,i*R)),2===l.length){var A=l[1],g=Math.sqrt(Math.max(1-A*A,0));v.push(new e(a,i*A,i*-g)),v.push(new e(a,i*A,i*g))}return v}var S=_*_,N=m*m,x=p*p,O=_*m,w=x+N,I=2*(E*p+O),M=2*y*p+E*E-N+S,C=2*(y*E-O),P=y*y-S;if(0===w&&0===I&&0===M&&0===C)return v;l=c.computeRealRoots(w,I,M,C,P);var D=l.length;if(0===D)return v;for(var U=0;U<D;++U){var L,b=l[U],F=b*b,z=Math.max(1-F,0),B=Math.sqrt(z);L=o.sign(p)===o.sign(y)?d(p*F+y,E*b,o.EPSILON12):o.sign(y)===o.sign(E*b)?d(p*F,E*b+y,o.EPSILON12):d(p*F+E*b,y,o.EPSILON12);var G=d(m*b,_,o.EPSILON15),q=L*G;q<0?v.push(new e(a,i*b,i*B)):q>0?v.push(new e(a,i*b,i*-B)):0!==B?(v.push(new e(a,i*b,i*-B)),v.push(new e(a,i*b,i*B)),++U):v.push(new e(a,i*b,i*B))}return v}var E={};E.rayPlane=function(t,n,a){r(a)||(a=new e);var i=t.origin,u=t.direction,s=n.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON15)){var l=(-n.distance-e.dot(s,i))/c;if(!(l<0))return a=e.multiplyByScalar(u,l,a),e.add(i,a,a)}};var y=new e,m=new e,_=new e,v=new e,T=new e;E.rayTriangleParametric=function(t,r,a,i,u){u=n(u,!1);var s,c,l,f,h,d=t.origin,p=t.direction,E=e.subtract(a,r,y),R=e.subtract(i,r,m),A=e.cross(p,R,_),g=e.dot(E,A);if(u){if(g<o.EPSILON6)return;if(s=e.subtract(d,r,v),l=e.dot(s,A),l<0||l>g)return;if(c=e.cross(s,E,T),f=e.dot(p,c),f<0||l+f>g)return;h=e.dot(R,c)/g}else{if(Math.abs(g)<o.EPSILON6)return;var S=1/g;if(s=e.subtract(d,r,v),l=e.dot(s,A)*S,l<0||l>1)return;if(c=e.cross(s,E,T),f=e.dot(p,c)*S,f<0||l+f>1)return;h=e.dot(R,c)*S}return h},E.rayTriangle=function(t,n,a,i,o,u){var s=E.rayTriangleParametric(t,n,a,i,o);if(r(s)&&!(s<0))return r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var R=new l;E.lineSegmentTriangle=function(t,n,a,i,o,u,s){var c=R;e.clone(t,c.origin),e.subtract(n,t,c.direction),e.normalize(c.direction,c.direction);var l=E.rayTriangleParametric(c,a,i,o,u);if(!(!r(l)||l<0||l>e.distance(t,n)))return r(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var A={root0:0,root1:0};E.raySphere=function(e,t,n){if(n=h(e,t,n),r(n)&&!(n.stop<0))return n.start=Math.max(n.start,0),n};var g=new l;E.lineSegmentSphere=function(t,n,a,i){var o=g;e.clone(t,o.origin);var u=e.subtract(n,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),i=h(o,a,i),!(!r(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var S=new e,N=new e;E.rayEllipsoid=function(t,n){var r,a,o,u,s,c=n.oneOverRadii,l=e.multiplyComponents(c,t.origin,S),f=e.multiplyComponents(c,t.direction,N),h=e.magnitudeSquared(l),d=e.dot(l,f);if(h>1){if(d>=0)return;var p=d*d;if(r=h-1,a=e.magnitudeSquared(f),o=a*r,p<o)return;if(p>o){u=d*d-o,s=-d+Math.sqrt(u);var E=s/a,y=r/s;return E<y?new i(E,y):{start:y,stop:E}}var m=Math.sqrt(r/a);return new i(m,m)}return h<1?(r=h-1,a=e.magnitudeSquared(f),o=a*r,u=d*d-o,s=-d+Math.sqrt(u),new i(0,s/a)):d<0?(a=e.magnitudeSquared(f),new i(0,-d/a)):void 0};var x=new e,O=new e,w=new e,I=new e,M=new e,C=new u,P=new u,D=new u,U=new u,L=new u,b=new u,F=new u,z=new e,B=new e,G=new t;E.grazingAltitudeLocation=function(t,n){var a=t.origin,i=t.direction;if(!e.equals(a,e.ZERO)){var s=n.geodeticSurfaceNormal(a,x);if(e.dot(i,s)>=0)return a}var c=r(this.rayEllipsoid(t,n)),l=n.transformPositionToScaledSpace(i,x),f=e.normalize(l,l),h=e.mostOrthogonalAxis(l,I),d=e.normalize(e.cross(h,f,O),O),E=e.normalize(e.cross(f,d,w),w),y=C;y[0]=f.x,y[1]=f.y,y[2]=f.z,y[3]=d.x,y[4]=d.y,y[5]=d.z,y[6]=E.x,y[7]=E.y,y[8]=E.z;var m=u.transpose(y,P),_=u.fromScale(n.radii,D),v=u.fromScale(n.oneOverRadii,U),T=L;T[0]=0,T[1]=-i.z,T[2]=i.y,T[3]=i.z,T[4]=0,T[5]=-i.x,T[6]=-i.y,T[7]=i.x,T[8]=0;var R,A,g=u.multiply(u.multiply(m,v,b),T,b),S=u.multiply(u.multiply(g,_,F),y,F),N=u.multiplyByVector(g,a,M),q=p(S,e.negate(N,x),0,0,1),W=q.length;if(W>0){for(var V=e.clone(e.ZERO,B),X=Number.NEGATIVE_INFINITY,H=0;H<W;++H){R=u.multiplyByVector(_,u.multiplyByVector(y,q[H],z),z);var Y=e.normalize(e.subtract(R,a,I),I),k=e.dot(Y,i);k>X&&(X=k,V=e.clone(R,V))}var Z=n.cartesianToCartographic(V,G);return X=o.clamp(X,0,1),A=e.magnitude(e.subtract(V,a,I))*Math.sqrt(1-X*X),A=c?-A:A,Z.height=A,n.cartographicToCartesian(Z,new e)}};var q=new e;return E.lineSegmentPlane=function(t,n,a,i){r(i)||(i=new e);var u=e.subtract(n,t,q),s=a.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON6)){var l=e.dot(s,t),f=-(a.distance+l)/c;if(!(f<0||f>1))return e.multiplyByScalar(u,f,i),e.add(t,i,i),i}},E.trianglePlaneIntersection=function(t,n,r,a){var i=a.normal,o=a.distance,u=e.dot(i,t)+o<0,s=e.dot(i,n)+o<0,c=e.dot(i,r)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var f,h;if(1!==l&&2!==l||(f=new e,h=new e),1===l){if(u)return E.lineSegmentPlane(t,n,a,f),E.lineSegmentPlane(t,r,a,h),{positions:[t,n,r,f,h],indices:[0,3,4,1,2,4,1,4,3]};if(s)return E.lineSegmentPlane(n,r,a,f),E.lineSegmentPlane(n,t,a,h),{positions:[t,n,r,f,h],indices:[1,3,4,2,0,4,2,4,3]};if(c)return E.lineSegmentPlane(r,t,a,f),E.lineSegmentPlane(r,n,a,h),{positions:[t,n,r,f,h],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return E.lineSegmentPlane(n,t,a,f),E.lineSegmentPlane(r,t,a,h),{positions:[t,n,r,f,h],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return E.lineSegmentPlane(r,n,a,f),E.lineSegmentPlane(t,n,a,h),{positions:[t,n,r,f,h],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return E.lineSegmentPlane(t,r,a,f),E.lineSegmentPlane(n,r,a,h),{positions:[t,n,r,f,h],indices:[0,1,4,0,4,3,2,3,4]}}},E}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";function a(t,n){this.normal=e.clone(t),this.distance=n}a.fromPointNormal=function(n,r,i){var o=-e.dot(r,n);return t(i)?(e.clone(r,i.normal),i.distance=o,i):new a(r,o)};var i=new e;return a.fromCartesian4=function(n,r){var o=e.fromCartesian4(n,i),u=n.w;return t(r)?(e.clone(o,r.normal),r.distance=u,r):new a(o,u)},a.getPointDistance=function(t,n){return e.dot(t.normal,n)+t.distance},a.ORIGIN_XY_PLANE=r(new a(e.UNIT_Z,0)),a.ORIGIN_YZ_PLANE=r(new a(e.UNIT_X,0)),a.ORIGIN_ZX_PLANE=r(new a(e.UNIT_Y,0)),a}),define("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";var r={};return r.calculateACMR=function(n){n=e(n,e.EMPTY_OBJECT);var r=n.indices,a=n.maximumIndex,i=e(n.cacheSize,24),o=r.length;if(!t(a)){a=0;for(var u=0,s=r[u];u<o;)s>a&&(a=s),++u,s=r[u]}for(var c=[],l=0;l<a+1;l++)c[l]=0;for(var f=i+1,h=0;h<o;++h)f-c[r[h]]>i&&(c[r[h]]=f,++f);return(f-i+1)/(o/3)},r.tipsify=function(n){function r(e,t,n,r){for(;t.length>=1;){var a=t[t.length-1];if(t.splice(t.length-1,1),e[a].numLiveTriangles>0)return a}for(;i<r;){if(e[i].numLiveTriangles>0)return++i,i-1;++i}return-1}function a(e,t,n,a,i,o,u){for(var s,c=-1,l=-1,f=0;f<n.length;){var h=n[f];a[h].numLiveTriangles&&(s=0,i-a[h].timeStamp+2*a[h].numLiveTriangles<=t&&(s=i-a[h].timeStamp),(s>l||l===-1)&&(l=s,c=h)),++f}return c===-1?r(a,o,e,u):c}n=e(n,e.EMPTY_OBJECT);var i,o=n.indices,u=n.maximumIndex,s=e(n.cacheSize,24),c=o.length,l=0,f=0,h=o[f],d=c;if(t(u))l=u+1;else{for(;f<d;)h>l&&(l=h),++f,h=o[f];if(l===-1)return 0;++l}for(var p=[],E=0;E<l;E++)p[E]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};f=0;for(var y=0;f<d;)p[o[f]].vertexTriangles.push(y),++p[o[f]].numLiveTriangles,p[o[f+1]].vertexTriangles.push(y),++p[o[f+1]].numLiveTriangles,p[o[f+2]].vertexTriangles.push(y),++p[o[f+2]].numLiveTriangles,++y,f+=3;var m=0,_=s+1;i=1;var v,T,R=[],A=[],g=0,S=[],N=c/3,x=[];for(E=0;E<N;E++)x[E]=!1;for(var O,w;m!==-1;){R=[],T=p[m],w=T.vertexTriangles.length;for(var I=0;I<w;++I)if(y=T.vertexTriangles[I],!x[y]){x[y]=!0,f=y+y+y;for(var M=0;M<3;++M)O=o[f],R.push(O),A.push(O),S[g]=O,++g,v=p[O],--v.numLiveTriangles,_-v.timeStamp>s&&(v.timeStamp=_,++_),++f}m=a(o,s,R,p,_,A,l)}return S},r}),define("Core/GeometryPipeline",["./AttributeCompression","./barycentricCoordinates","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./deprecationWarning","./DeveloperError","./EncodedCartesian3","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryType","./IndexDatatype","./Intersect","./IntersectionTests","./Math","./Matrix3","./Matrix4","./Plane","./PrimitiveType","./Tipsify"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,p,E,y,m,_,v,T,R,A,g,S,N){"use strict";function x(e,t,n,r,a){e[t++]=n,e[t++]=r,e[t++]=r,e[t++]=a,e[t++]=a,e[t]=n}function O(e){for(var t=e.length,n=t/3*6,r=m.createTypedArray(t,n),a=0,i=0;i<t;i+=3,a+=6)x(r,a,e[i],e[i+1],e[i+2]);return r}function w(e){var t=e.length;if(t>=3){var n=6*(t-2),r=m.createTypedArray(t,n);x(r,0,e[0],e[1],e[2]);for(var a=6,i=3;i<t;++i,a+=6)x(r,a,e[i-1],e[i],e[i-2]);return r}return new Uint16Array}function I(e){if(e.length>0){for(var t=e.length-1,n=6*(t-1),r=m.createTypedArray(t,n),a=e[0],i=0,o=1;o<t;++o,i+=6)x(r,i,a,e[o],e[o+1]);return r}return new Uint16Array}function M(e){var t={};for(var n in e)if(e.hasOwnProperty(n)&&c(e[n])&&c(e[n].values)){var r=e[n];t[n]=new E({componentDatatype:r.componentDatatype,componentsPerAttribute:r.componentsPerAttribute,normalize:r.normalize,values:[]})}return t}function C(e,t,n){for(var r in t)if(t.hasOwnProperty(r)&&c(t[r])&&c(t[r].values))for(var a=t[r],i=0;i<a.componentsPerAttribute;++i)e[r].values.push(a.values[n*a.componentsPerAttribute+i])}function P(e,t){if(c(t))for(var n=t.values,r=n.length,i=0;i<r;i+=3)a.unpack(n,i,oe),A.multiplyByPoint(e,oe,oe),a.pack(oe,n,i)}function D(e,t){if(c(t))for(var n=t.values,r=n.length,i=0;i<r;i+=3)a.unpack(n,i,oe),R.multiplyByVector(e,oe,oe),oe=a.normalize(oe,oe),a.pack(oe,n,i)}function U(e,t){var n,r=e.length,a={},i=e[0][t].attributes;for(n in i)if(i.hasOwnProperty(n)&&c(i[n])&&c(i[n].values)){for(var o=i[n],s=o.values.length,l=!0,f=1;f<r;++f){var h=e[f][t].attributes[n];if(!c(h)||o.componentDatatype!==h.componentDatatype||o.componentsPerAttribute!==h.componentsPerAttribute||o.normalize!==h.normalize){l=!1;break}s+=h.values.length}l&&(a[n]=new E({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:u.createTypedArray(o.componentDatatype,s)}))}return a}function L(e,t){var r,i,o,u,s,l,f,h=e.length,d=(e[0].modelMatrix,c(e[0][t].indices)),E=e[0][t].primitiveType,y=U(e,t);for(r in y)if(y.hasOwnProperty(r))for(s=y[r].values,u=0,i=0;i<h;++i)for(l=e[i][t].attributes[r].values,f=l.length,o=0;o<f;++o)s[u++]=l[o];var _;if(d){var v=0;for(i=0;i<h;++i)v+=e[i][t].indices.length;var T=p.computeNumberOfVertices(new p({attributes:y,primitiveType:S.POINTS})),R=m.createTypedArray(T,v),A=0,g=0;for(i=0;i<h;++i){var N=e[i][t].indices,x=N.length;for(u=0;u<x;++u)R[A++]=g+N[u];g+=p.computeNumberOfVertices(e[i][t])}_=R}var O,w=new a,I=0;for(i=0;i<h;++i){if(O=e[i][t].boundingSphere,!c(O)){w=void 0;break}a.add(O.center,w,w)}if(c(w))for(a.divideByScalar(w,h,w),i=0;i<h;++i){O=e[i][t].boundingSphere;var M=a.magnitude(a.subtract(O.center,w,ce))+O.radius;M>I&&(I=M)}return new p({attributes:y,indices:_,primitiveType:E,boundingSphere:c(w)?new n(w,I):void 0})}function b(e){if(c(e.indices))return e;for(var t=p.computeNumberOfVertices(e),n=m.createTypedArray(t,t),r=0;r<t;++r)n[r]=r;return e.indices=n,e}function F(e){var t=p.computeNumberOfVertices(e),n=m.createTypedArray(t,3*(t-2));n[0]=1,n[1]=0,n[2]=2;for(var r=3,a=3;a<t;++a)n[r++]=a-1,n[r++]=0,n[r++]=a;return e.indices=n,e.primitiveType=S.TRIANGLES,e}function z(e){var t=p.computeNumberOfVertices(e),n=m.createTypedArray(t,3*(t-2));n[0]=0,n[1]=1,n[2]=2,t>3&&(n[3]=0,n[4]=2,n[5]=3);for(var r=6,a=3;a<t-1;a+=2)n[r++]=a,n[r++]=a-1,n[r++]=a+1,a+2<t&&(n[r++]=a,n[r++]=a+1,n[r++]=a+2);return e.indices=n,e.primitiveType=S.TRIANGLES,e}function B(e){if(c(e.indices))return e;for(var t=p.computeNumberOfVertices(e),n=m.createTypedArray(t,t),r=0;r<t;++r)n[r]=r;return e.indices=n,e}function G(e){var t=p.computeNumberOfVertices(e),n=m.createTypedArray(t,2*(t-1));n[0]=0,n[1]=1;for(var r=2,a=2;a<t;++a)n[r++]=a-1,n[r++]=a;return e.indices=n,e.primitiveType=S.LINES,e}function q(e){var t=p.computeNumberOfVertices(e),n=m.createTypedArray(t,2*t);n[0]=0,n[1]=1;for(var r=2,a=2;a<t;++a)n[r++]=a-1,n[r++]=a;return n[r++]=t-1,n[r]=0,e.indices=n,e.primitiveType=S.LINES,e}function W(e){switch(e.primitiveType){case S.TRIANGLE_FAN:return F(e);case S.TRIANGLE_STRIP:return z(e);case S.TRIANGLES:return b(e);case S.LINE_STRIP:return G(e);case S.LINE_LOOP:return q(e);case S.LINES:return B(e)}return e}function V(e,t){Math.abs(e.y)<T.EPSILON6&&(t?e.y=-T.EPSILON6:e.y=T.EPSILON6)}function X(e,t,n){if(0!==e.y&&0!==t.y&&0!==n.y)return V(e,e.y<0),V(t,t.y<0),void V(n,n.y<0);var r,a=Math.abs(e.y),i=Math.abs(t.y),o=Math.abs(n.y);r=a>i?a>o?T.sign(e.y):T.sign(n.y):i>o?T.sign(t.y):T.sign(n.y);var u=r<0;V(e,u),V(t,u),V(n,u)}function H(e,t,n,r){a.add(e,a.multiplyByScalar(a.subtract(t,e,Ae),e.y/(e.y-t.y),Ae),n),a.clone(n,r),V(n,!0),V(r,!1)}function Y(e,t,n){if(!(e.x>=0||t.x>=0||n.x>=0)){X(e,t,n);var r=e.y<0,a=t.y<0,i=n.y<0,o=0;o+=r?1:0,o+=a?1:0,o+=i?1:0;var u=Oe.indices;1===o?(u[1]=3,u[2]=4,u[5]=6,u[7]=6,u[8]=5,r?(H(e,t,ge,Ne),H(e,n,Se,xe),u[0]=0,u[3]=1,u[4]=2,u[6]=1):a?(H(t,n,ge,Ne),H(t,e,Se,xe),u[0]=1,u[3]=2,u[4]=0,u[6]=2):i&&(H(n,e,ge,Ne),H(n,t,Se,xe),u[0]=2,u[3]=0,u[4]=1,u[6]=0)):2===o&&(u[2]=4,u[4]=4,u[5]=3,u[7]=5,u[8]=6,r?a?i||(H(n,e,ge,Ne),H(n,t,Se,xe),u[0]=0,u[1]=1,u[3]=0,u[6]=2):(H(t,n,ge,Ne),H(t,e,Se,xe),u[0]=2,u[1]=0,u[3]=2,u[6]=1):(H(e,t,ge,Ne),H(e,n,Se,xe),u[0]=1,u[1]=2,u[3]=1,u[6]=0));var s=Oe.positions;return s[0]=e,s[1]=t,s[2]=n,s.length=3,1!==o&&2!==o||(s[3]=ge,s[4]=Se,s[5]=Ne,s[6]=xe,s.length=7),Oe}}function k(e,t){var r=e.attributes;if(0!==r.position.values.length){for(var a in r)if(r.hasOwnProperty(a)&&c(r[a])&&c(r[a].values)){var i=r[a];i.values=u.createTypedArray(i.componentDatatype,i.values)}var o=p.computeNumberOfVertices(e);return e.indices=m.createTypedArray(o,e.indices),t&&(e.boundingSphere=n.fromVertices(r.position.values)),e}}function Z(e){var t=e.attributes,n={};for(var r in t)if(t.hasOwnProperty(r)&&c(t[r])&&c(t[r].values)){var a=t[r];n[r]=new E({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:[]})}return new p({attributes:n,indices:[],primitiveType:e.primitiveType})}function j(e,t,n){var r=c(e.geometry.boundingSphere);t=k(t,r),n=k(n,r),c(n)&&!c(t)?e.geometry=n:!c(n)&&c(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=n,e.geometry=void 0)}function K(e,n,i,o,u,s,l,f,h,d,p,E){if(c(s)||c(l)||c(f)||c(h)||c(d)){var y=a.fromArray(u,3*e,we),m=a.fromArray(u,3*n,Ie),_=a.fromArray(u,3*i,Me),v=t(o,y,m,_,Ce);if(c(s)){var T=a.fromArray(s,3*e,we),R=a.fromArray(s,3*n,Ie),A=a.fromArray(s,3*i,Me);a.multiplyByScalar(T,v.x,T),a.multiplyByScalar(R,v.y,R),a.multiplyByScalar(A,v.z,A);var g=a.add(T,R,T);a.add(g,A,g),a.normalize(g,g),a.pack(g,p.normal.values,3*E)}if(c(d)){var S=a.fromArray(d,3*e,we),N=a.fromArray(d,3*n,Ie),x=a.fromArray(d,3*i,Me);a.multiplyByScalar(S,v.x,S),a.multiplyByScalar(N,v.y,N),a.multiplyByScalar(x,v.z,x);var O;a.equals(S,a.ZERO)&&a.equals(N,a.ZERO)&&a.equals(x,a.ZERO)?(O=we,O.x=0,O.y=0,O.z=0):(O=a.add(S,N,S),a.add(O,x,O),a.normalize(O,O)),a.pack(O,p.extrudeDirection.values,3*E)}if(c(l)){var w=a.fromArray(l,3*e,we),I=a.fromArray(l,3*n,Ie),M=a.fromArray(l,3*i,Me);a.multiplyByScalar(w,v.x,w),a.multiplyByScalar(I,v.y,I),a.multiplyByScalar(M,v.z,M);var C=a.add(w,I,w);a.add(C,M,C),a.normalize(C,C),a.pack(C,p.tangent.values,3*E)}if(c(f)){var P=a.fromArray(f,3*e,we),D=a.fromArray(f,3*n,Ie),U=a.fromArray(f,3*i,Me);a.multiplyByScalar(P,v.x,P),a.multiplyByScalar(D,v.y,D),a.multiplyByScalar(U,v.z,U);var L=a.add(P,D,P);a.add(L,U,L),a.normalize(L,L),a.pack(L,p.bitangent.values,3*E)}if(c(h)){var b=r.fromArray(h,2*e,Pe),F=r.fromArray(h,2*n,De),z=r.fromArray(h,2*i,Ue);r.multiplyByScalar(b,v.x,b),r.multiplyByScalar(F,v.y,F),r.multiplyByScalar(z,v.z,z);var B=r.add(b,F,b);r.add(B,z,B),r.pack(B,p.st.values,2*E)}}}function J(e,t,n,r,a,i){var o=e.position.values.length/3;if(a!==-1){var u=r[a],s=n[u];return s===-1?(n[u]=o,e.position.values.push(i.x,i.y,i.z),t.push(o),o):(t.push(s),s)}return e.position.values.push(i.x,i.y,i.z),t.push(o),o}function Q(e){var t,n,r,i,o,u=e.geometry,s=u.attributes,l=s.position.values,f=c(s.normal)?s.normal.values:void 0,h=c(s.bitangent)?s.bitangent.values:void 0,d=c(s.tangent)?s.tangent.values:void 0,p=c(s.st)?s.st.values:void 0,E=c(s.extrudeDirection)?s.extrudeDirection.values:void 0,y=u.indices,m=Z(u),_=Z(u),v=[];v.length=l.length/3;var T=[];for(T.length=l.length/3,o=0;o<v.length;++o)v[o]=-1,T[o]=-1;var R=y.length;for(o=0;o<R;o+=3){var A=y[o],g=y[o+1],S=y[o+2],N=a.fromArray(l,3*A),x=a.fromArray(l,3*g),O=a.fromArray(l,3*S),w=Y(N,x,O);if(c(w)&&w.positions.length>3)for(var I=w.positions,M=w.indices,C=M.length,P=0;P<C;++P){var D=M[P],U=I[D];U.y<0?(t=_.attributes,n=_.indices,r=v):(t=m.attributes,n=m.indices,r=T),i=J(t,n,r,y,D<3?o+D:-1,U),K(A,g,S,U,l,f,d,h,p,E,t,i)}else c(w)&&(N=w.positions[0],x=w.positions[1],O=w.positions[2]),N.y<0?(t=_.attributes,n=_.indices,r=v):(t=m.attributes,n=m.indices,r=T),i=J(t,n,r,y,o,N),K(A,g,S,N,l,f,d,h,p,E,t,i),i=J(t,n,r,y,o+1,x),K(A,g,S,x,l,f,d,h,p,E,t,i),i=J(t,n,r,y,o+2,O),K(A,g,S,O,l,f,d,h,p,E,t,i)}j(e,_,m)}function $(e){var t,n=e.geometry,r=n.attributes,i=r.position.values,o=n.indices,u=Z(n),s=Z(n),l=o.length,f=[];f.length=i.length/3;var h=[];for(h.length=i.length/3,t=0;t<f.length;++t)f[t]=-1,h[t]=-1;for(t=0;t<l;t+=2){var d=o[t],p=o[t+1],E=a.fromArray(i,3*d,we),y=a.fromArray(i,3*p,Ie);Math.abs(E.y)<T.EPSILON6&&(E.y<0?E.y=-T.EPSILON6:E.y=T.EPSILON6),Math.abs(y.y)<T.EPSILON6&&(y.y<0?y.y=-T.EPSILON6:y.y=T.EPSILON6);var m=u.attributes,_=u.indices,R=h,A=s.attributes,g=s.indices,S=f,N=v.lineSegmentPlane(E,y,Le,Me);if(c(N)){var x=a.multiplyByScalar(a.UNIT_Y,5*T.EPSILON9,be);E.y<0&&(a.negate(x,x),m=s.attributes,_=s.indices,R=f,A=u.attributes,g=u.indices,S=h);var O=a.add(N,x,Fe);J(m,_,R,o,t,E),J(m,_,R,o,-1,O),a.negate(x,x),a.add(N,x,O),J(A,g,S,o,-1,O),J(A,g,S,o,t+1,y)}else{var w,I,M;E.y<0?(w=s.attributes,I=s.indices,M=f):(w=u.attributes,I=u.indices,M=h),J(w,I,M,o,t,E),J(w,I,M,o,t+1,y)}}j(e,s,u)}function ee(e){for(var t=e.attributes,n=t.position.values,r=t.prevPosition.values,i=t.nextPosition.values,o=n.length,u=0;u<o;u+=3){var s=a.unpack(n,u,Ge);if(!(s.x>0)){var c=a.unpack(r,u,qe);(s.y<0&&c.y>0||s.y>0&&c.y<0)&&(u-3>0?(r[u]=n[u-3],r[u+1]=n[u-2],r[u+2]=n[u-1]):a.pack(s,r,u));var l=a.unpack(i,u,We);(s.y<0&&l.y>0||s.y>0&&l.y<0)&&(u+3<o?(i[u]=n[u+3],i[u+1]=n[u+4],i[u+2]=n[u+5]):a.pack(s,i,u))}}}function te(e){var t,n,o,u=e.geometry,s=u.attributes,l=s.position.values,f=s.prevPosition.values,h=s.nextPosition.values,d=s.expandAndWidth.values,p=c(s.st)?s.st.values:void 0,E=c(s.color)?s.color.values:void 0,y=Z(u),m=Z(u),_=!1,R=l.length/3;for(t=0;t<R;t+=4){var A=t,g=t+2,S=a.fromArray(l,3*A,Ge),N=a.fromArray(l,3*g,qe);if(Math.abs(S.y)<Ze)for(S.y=Ze*(N.y<0?-1:1),l[3*t+1]=S.y,l[3*(t+1)+1]=S.y,n=3*A;n<3*A+12;n+=3)f[n]=l[3*t],f[n+1]=l[3*t+1],f[n+2]=l[3*t+2];if(Math.abs(N.y)<Ze)for(N.y=Ze*(S.y<0?-1:1),l[3*(t+2)+1]=N.y,l[3*(t+3)+1]=N.y,n=3*A;n<3*A+12;n+=3)h[n]=l[3*(t+2)],h[n+1]=l[3*(t+2)+1],h[n+2]=l[3*(t+2)+2];var x=y.attributes,O=y.indices,w=m.attributes,I=m.indices,M=v.lineSegmentPlane(S,N,Le,Ve);if(c(M)){_=!0;var C=a.multiplyByScalar(a.UNIT_Y,ke,Xe);S.y<0&&(a.negate(C,C),x=m.attributes,O=m.indices,w=y.attributes,I=y.indices);var P=a.add(M,C,He);x.position.values.push(S.x,S.y,S.z,S.x,S.y,S.z),x.position.values.push(P.x,P.y,P.z),x.position.values.push(P.x,P.y,P.z),x.prevPosition.values.push(f[3*A],f[3*A+1],f[3*A+2]),x.prevPosition.values.push(f[3*A+3],f[3*A+4],f[3*A+5]),x.prevPosition.values.push(S.x,S.y,S.z,S.x,S.y,S.z),x.nextPosition.values.push(P.x,P.y,P.z),x.nextPosition.values.push(P.x,P.y,P.z),x.nextPosition.values.push(P.x,P.y,P.z),x.nextPosition.values.push(P.x,P.y,P.z),a.negate(C,C),a.add(M,C,P),w.position.values.push(P.x,P.y,P.z),w.position.values.push(P.x,P.y,P.z),w.position.values.push(N.x,N.y,N.z,N.x,N.y,N.z),w.prevPosition.values.push(P.x,P.y,P.z),w.prevPosition.values.push(P.x,P.y,P.z),w.prevPosition.values.push(P.x,P.y,P.z),w.prevPosition.values.push(P.x,P.y,P.z),w.nextPosition.values.push(N.x,N.y,N.z,N.x,N.y,N.z),w.nextPosition.values.push(h[3*g],h[3*g+1],h[3*g+2]),w.nextPosition.values.push(h[3*g+3],h[3*g+4],h[3*g+5]);var D=r.fromArray(d,2*A,ze),U=Math.abs(D.y);x.expandAndWidth.values.push(-1,U,1,U),x.expandAndWidth.values.push(-1,-U,1,-U),w.expandAndWidth.values.push(-1,U,1,U),w.expandAndWidth.values.push(-1,-U,1,-U);var L=a.magnitudeSquared(a.subtract(M,S,We));if(L/=a.magnitudeSquared(a.subtract(N,S,We)),c(E)){var b=i.fromArray(E,4*A,Ye),F=i.fromArray(E,4*g,Ye),z=T.lerp(b.x,F.x,L),B=T.lerp(b.y,F.y,L),G=T.lerp(b.z,F.z,L),q=T.lerp(b.w,F.w,L);for(n=4*A;n<4*A+8;++n)x.color.values.push(E[n]);for(x.color.values.push(z,B,G,q),x.color.values.push(z,B,G,q),w.color.values.push(z,B,G,q),w.color.values.push(z,B,G,q),n=4*g;n<4*g+8;++n)w.color.values.push(E[n])}if(c(p)){var W=r.fromArray(p,2*A,ze),V=r.fromArray(p,2*(t+3),Be),X=T.lerp(W.x,V.x,L);for(n=2*A;n<2*A+4;++n)x.st.values.push(p[n]);for(x.st.values.push(X,W.y),x.st.values.push(X,V.y),w.st.values.push(X,W.y),w.st.values.push(X,V.y),n=2*g;n<2*g+4;++n)w.st.values.push(p[n])}o=x.position.values.length/3-4,O.push(o,o+2,o+1),O.push(o+1,o+2,o+3),o=w.position.values.length/3-4,I.push(o,o+2,o+1),I.push(o+1,o+2,o+3)}else{var H,Y;for(S.y<0?(H=m.attributes,Y=m.indices):(H=y.attributes,Y=y.indices),H.position.values.push(S.x,S.y,S.z),H.position.values.push(S.x,S.y,S.z),H.position.values.push(N.x,N.y,N.z),H.position.values.push(N.x,N.y,N.z),n=3*t;n<3*t+12;++n)H.prevPosition.values.push(f[n]),H.nextPosition.values.push(h[n]);for(n=2*t;n<2*t+8;++n)H.expandAndWidth.values.push(d[n]),c(p)&&H.st.values.push(p[n]);if(c(E))for(n=4*t;n<4*t+16;++n)H.color.values.push(E[n]);o=H.position.values.length/3-4,Y.push(o,o+2,o+1),Y.push(o+1,o+2,o+3)}}_&&(ee(m),ee(y)),j(e,m,y)}var ne={};ne.toWireframe=function(e){var t=e.indices;if(c(t)){switch(e.primitiveType){case S.TRIANGLES:e.indices=O(t);break;case S.TRIANGLE_STRIP:e.indices=w(t);break;case S.TRIANGLE_FAN:e.indices=I(t)}e.primitiveType=S.LINES}return e},ne.createLineSegmentsForVectors=function(e,t,r){t=s(t,"normal"),r=s(r,1e4);for(var a=e.attributes.position.values,i=e.attributes[t].values,o=a.length,l=new Float64Array(2*o),f=0,h=0;h<o;h+=3)l[f++]=a[h],l[f++]=a[h+1],l[f++]=a[h+2],l[f++]=a[h]+i[h]*r,l[f++]=a[h+1]+i[h+1]*r,l[f++]=a[h+2]+i[h+2]*r;var d,y=e.boundingSphere;return c(y)&&(d=new n(y.center,y.radius+r)),new p({attributes:{position:new E({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:S.LINES,boundingSphere:d})},ne.createAttributeLocations=function(e){var t,n=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],r=e.attributes,a={},i=0,o=n.length;for(t=0;t<o;++t){var u=n[t];c(r[u])&&(a[u]=i++)}for(var s in r)r.hasOwnProperty(s)&&!c(a[s])&&(a[s]=i++);return a},ne.reorderForPreVertexCache=function(e){var t=p.computeNumberOfVertices(e),n=e.indices;if(c(n)){for(var r=new Int32Array(t),a=0;a<t;a++)r[a]=-1;for(var i,o=n,s=o.length,l=m.createTypedArray(t,s),f=0,h=0,d=0;f<s;)i=r[o[f]],i!==-1?l[h]=i:(i=o[f],r[i]=d,l[h]=d,++d),++f,++h;e.indices=l;var E=e.attributes;for(var y in E)if(E.hasOwnProperty(y)&&c(E[y])&&c(E[y].values)){for(var _=E[y],v=_.values,T=0,R=_.componentsPerAttribute,A=u.createTypedArray(_.componentDatatype,d*R);T<t;){var g=r[T];if(g!==-1)for(a=0;a<R;a++)A[R*g+a]=v[R*T+a];++T}_.values=A}}return e},ne.reorderForPostVertexCache=function(e,t){var n=e.indices;if(e.primitiveType===S.TRIANGLES&&c(n)){for(var r=n.length,a=0,i=0;i<r;i++)n[i]>a&&(a=n[i]);e.indices=N.tipsify({indices:n,maximumIndex:a,cacheSize:t})}return e},ne.fitToUnsignedShortIndices=function(e){var t=[],n=p.computeNumberOfVertices(e);if(c(e.indices)&&n>=T.SIXTY_FOUR_KILOBYTES){var r,a=[],i=[],o=0,u=M(e.attributes),s=e.indices,l=s.length;e.primitiveType===S.TRIANGLES?r=3:e.primitiveType===S.LINES?r=2:e.primitiveType===S.POINTS&&(r=1);for(var f=0;f<l;f+=r){for(var h=0;h<r;++h){var d=s[f+h],E=a[d];c(E)||(E=o++,a[d]=E,C(u,e.attributes,d)),i.push(E)}o+r>=T.SIXTY_FOUR_KILOBYTES&&(t.push(new p({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),a=[],i=[],o=0,u=M(e.attributes))}0!==i.length&&t.push(new p({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var re=new a,ae=new o;ne.projectTo2D=function(e,t,n,r,i){var o=e.attributes[t];i=c(i)?i:new d;for(var s=i.ellipsoid,l=o.values,f=new Float64Array(l.length),h=0,p=0;p<l.length;p+=3){var y=a.fromArray(l,p,re),m=s.cartesianToCartographic(y,ae),_=i.project(m,re);f[h++]=_.x,f[h++]=_.y,f[h++]=_.z}return e.attributes[n]=o,e.attributes[r]=new E({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:f}),delete e.attributes[t],e};var ie={high:0,low:0};ne.encodeAttribute=function(e,t,n,r){for(var a=e.attributes[t],i=a.values,o=i.length,s=new Float32Array(o),c=new Float32Array(o),l=0;l<o;++l)h.encode(i[l],ie),s[l]=ie.high,c[l]=ie.low;var f=a.componentsPerAttribute;return e.attributes[n]=new E({componentDatatype:u.FLOAT,componentsPerAttribute:f,values:s}),e.attributes[r]=new E({componentDatatype:u.FLOAT,componentsPerAttribute:f,values:c}),delete e.attributes[t],e};var oe=new a,ue=new A,se=new R;ne.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(A.equals(t,A.IDENTITY))return e;var r=e.geometry.attributes;P(t,r.position),P(t,r.prevPosition),P(t,r.nextPosition),(c(r.normal)||c(r.tangent)||c(r.bitangent))&&(A.inverse(t,ue),A.transpose(ue,ue),A.getRotation(ue,se),D(se,r.normal),D(se,r.tangent),D(se,r.bitangent));var a=e.geometry.boundingSphere;return c(a)&&(e.geometry.boundingSphere=n.transform(a,t,a)),e.modelMatrix=A.clone(A.IDENTITY),e};var ce=new a;ne.combineInstances=function(e){for(var t=[],n=[],r=e.length,a=0;a<r;++a){var i=e[a];c(i.geometry)?t.push(i):c(i.westHemisphereGeometry)&&c(i.eastHemisphereGeometry)&&n.push(i)}var o=[];return t.length>0&&o.push(L(t,"geometry")),n.length>0&&(o.push(L(n,"westHemisphereGeometry")),o.push(L(n,"eastHemisphereGeometry"))),o};var le=new a,fe=new a,he=new a,de=new a;ne.computeNormal=function(e){for(var t=e.indices,n=e.attributes,r=n.position.values,i=n.position.values.length/3,o=t.length,s=new Array(i),c=new Array(o/3),l=new Array(o),f=0;f<i;f++)s[f]={indexOffset:0,count:0,currentCount:0};var h=0;for(f=0;f<o;f+=3){var d=t[f],p=t[f+1],y=t[f+2],m=3*d,_=3*p,v=3*y;fe.x=r[m],fe.y=r[m+1],fe.z=r[m+2],he.x=r[_],he.y=r[_+1],he.z=r[_+2],de.x=r[v],de.y=r[v+1],de.z=r[v+2],s[d].count++,s[p].count++,s[y].count++,a.subtract(he,fe,he),a.subtract(de,fe,de),c[h]=a.cross(he,de,new a),h++}var T=0;for(f=0;f<i;f++)s[f].indexOffset+=T,T+=s[f].count;h=0;var R;for(f=0;f<o;f+=3){R=s[t[f]];var A=R.indexOffset+R.currentCount;l[A]=h,R.currentCount++,R=s[t[f+1]],A=R.indexOffset+R.currentCount,l[A]=h,R.currentCount++,R=s[t[f+2]],A=R.indexOffset+R.currentCount,l[A]=h,R.currentCount++,h++}var g=new Float32Array(3*i);for(f=0;f<i;f++){var S=3*f;if(R=s[f],R.count>0){for(a.clone(a.ZERO,le),h=0;h<R.count;h++)a.add(le,c[l[R.indexOffset+h]],le);a.normalize(le,le),g[S]=le.x,g[S+1]=le.y,g[S+2]=le.z}else g[S]=0,g[S+1]=0,g[S+2]=1}return e.attributes.normal=new E({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:g}),e};var pe=new a,Ee=new a,ye=new a;ne.computeTangentAndBitangent=function(e){for(var t=(e.attributes,e.indices),n=e.attributes.position.values,r=e.attributes.normal.values,i=e.attributes.st.values,o=e.attributes.position.values.length/3,s=t.length,c=new Array(3*o),l=0;l<c.length;l++)c[l]=0;var f,h,d;for(l=0;l<s;l+=3){var p=t[l],y=t[l+1],m=t[l+2];f=3*p,h=3*y,d=3*m;var _=2*p,v=2*y,T=2*m,R=n[f],A=n[f+1],g=n[f+2],S=i[_],N=i[_+1],x=i[v+1]-N,O=i[T+1]-N,w=1/((i[v]-S)*O-(i[T]-S)*x),I=(O*(n[h]-R)-x*(n[d]-R))*w,M=(O*(n[h+1]-A)-x*(n[d+1]-A))*w,C=(O*(n[h+2]-g)-x*(n[d+2]-g))*w;c[f]+=I,c[f+1]+=M,c[f+2]+=C,c[h]+=I,c[h+1]+=M,c[h+2]+=C,c[d]+=I,c[d+1]+=M,c[d+2]+=C}var P=new Float32Array(3*o),D=new Float32Array(3*o);for(l=0;l<o;l++){f=3*l,h=f+1,d=f+2;var U=a.fromArray(r,f,pe),L=a.fromArray(c,f,ye),b=a.dot(U,L);a.multiplyByScalar(U,b,Ee),a.normalize(a.subtract(L,Ee,L),L),P[f]=L.x,P[h]=L.y,P[d]=L.z,a.normalize(a.cross(U,L,L),L),D[f]=L.x,D[h]=L.y,D[d]=L.z}return e.attributes.tangent=new E({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:P}),e.attributes.bitangent=new E({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:D}),e},ne.computeBinormalAndTangent=function(e){return l("computeBinormalAndTangent","computeBinormalAndTangent was deprecated in 1.30. It will be removed in 1.31. Use a computeTangentAndBitangent."),ne.computeTangentAndBitangent(e),e.attributes.binormal=e.attributes.bitangent,e};var me=new r,_e=new a,ve=new a,Te=new a,Re=new r;ne.compressVertices=function(t){var n,i,o=t.attributes.extrudeDirection;if(c(o)){var s=o.values;i=s.length/3;var l=new Float32Array(2*i),f=0;for(n=0;n<i;++n)a.fromArray(s,3*n,_e),a.equals(_e,a.ZERO)?f+=2:(Re=e.octEncodeInRange(_e,65535,Re),l[f++]=Re.x,l[f++]=Re.y);return t.attributes.compressedAttributes=new E({componentDatatype:u.FLOAT,componentsPerAttribute:2,values:l}),delete t.attributes.extrudeDirection,t}var h=t.attributes.normal,d=t.attributes.st,p=c(h),y=c(d);if(!p&&!y)return t;var m,_,v,T,R=t.attributes.tangent,A=t.attributes.bitangent,g=c(R),S=c(A); +p&&(m=h.values),y&&(_=d.values),g&&(v=R.values),S&&(T=A.values);var N=p?m.length:_.length,x=p?3:2;i=N/x;var O=i,w=y&&p?2:1;w+=g||S?1:0,O*=w;var I=new Float32Array(O),M=0;for(n=0;n<i;++n){y&&(r.fromArray(_,2*n,me),I[M++]=e.compressTextureCoordinates(me));var C=3*n;p&&c(v)&&c(T)?(a.fromArray(m,C,_e),a.fromArray(v,C,ve),a.fromArray(T,C,Te),e.octPack(_e,ve,Te,me),I[M++]=me.x,I[M++]=me.y):(p&&(a.fromArray(m,C,_e),I[M++]=e.octEncodeFloat(_e)),g&&(a.fromArray(v,C,_e),I[M++]=e.octEncodeFloat(_e)),S&&(a.fromArray(T,C,_e),I[M++]=e.octEncodeFloat(_e)))}return t.attributes.compressedAttributes=new E({componentDatatype:u.FLOAT,componentsPerAttribute:w,values:I}),p&&delete t.attributes.normal,y&&delete t.attributes.st,S&&delete t.attributes.bitangent,g&&delete t.attributes.tangent,t};var Ae=new a,ge=new a,Se=new a,Ne=new a,xe=new a,Oe={positions:new Array(7),indices:new Array(9)},we=new a,Ie=new a,Me=new a,Ce=new a,Pe=new r,De=new r,Ue=new r,Le=g.fromPointNormal(a.ZERO,a.UNIT_Y),be=new a,Fe=new a,ze=new r,Be=new r,Ge=new a,qe=new a,We=new a,Ve=new a,Xe=new a,He=new a,Ye=new i,ke=5*T.EPSILON9,Ze=T.EPSILON6;return ne.splitLongitude=function(e){var t=e.geometry,r=t.boundingSphere;if(c(r)){var a=r.center.x-r.radius;if(a>0||n.intersectPlane(r,g.ORIGIN_ZX_PLANE)!==_.INTERSECTING)return e}if(t.geometryType!==y.NONE)switch(t.geometryType){case y.POLYLINES:te(e);break;case y.TRIANGLES:Q(e);break;case y.LINES:$(e)}else W(t),t.primitiveType===S.TRIANGLES?Q(e):t.primitiveType===S.LINES&&$(e);return e},ne}),define("ThirdParty/earcut-2.1.1",[],function(){"use strict";function e(e,n,a){a=a||2;var i=n&&n.length,o=i?n[0]*a:e.length,u=t(e,0,o,a,!0),c=[];if(!u)return c;var l,f,h,d,p,E,y;if(i&&(u=s(e,n,u,a)),e.length>80*a){l=h=e[0],f=d=e[1];for(var m=a;m<o;m+=a)p=e[m],E=e[m+1],p<l&&(l=p),E<f&&(f=E),p>h&&(h=p),E>d&&(d=E);y=Math.max(h-l,d-f)}return r(u,c,a,l,f,y),c}function t(e,t,n,r,a){var i,o;if(a===w(e,t,n,r)>0)for(i=t;i<n;i+=r)o=N(i,e[i],e[i+1],o);else for(i=n-r;i>=t;i-=r)o=N(i,e[i],e[i+1],o);return o&&v(o,o.next)&&(x(o),o=o.next),o}function n(e,t){if(!e)return e;t||(t=e);var n,r=e;do if(n=!1,r.steiner||!v(r,r.next)&&0!==_(r.prev,r,r.next))r=r.next;else{if(x(r),r=t=r.prev,r===r.next)return null;n=!0}while(n||r!==t);return t}function r(e,t,s,c,l,f,d){if(e){!d&&f&&h(e,c,l,f);for(var p,E,y=e;e.prev!==e.next;)if(p=e.prev,E=e.next,f?i(e,c,l,f):a(e))t.push(p.i/s),t.push(e.i/s),t.push(E.i/s),x(e),e=E.next,y=E.next;else if(e=E,e===y){d?1===d?(e=o(e,t,s),r(e,t,s,c,l,f,2)):2===d&&u(e,t,s,c,l,f):r(n(e),t,s,c,l,f,1);break}}}function a(e){var t=e.prev,n=e,r=e.next;if(_(t,n,r)>=0)return!1;for(var a=e.next.next;a!==e.prev;){if(y(t.x,t.y,n.x,n.y,r.x,r.y,a.x,a.y)&&_(a.prev,a,a.next)>=0)return!1;a=a.next}return!0}function i(e,t,n,r){var a=e.prev,i=e,o=e.next;if(_(a,i,o)>=0)return!1;for(var u=a.x<i.x?a.x<o.x?a.x:o.x:i.x<o.x?i.x:o.x,s=a.y<i.y?a.y<o.y?a.y:o.y:i.y<o.y?i.y:o.y,c=a.x>i.x?a.x>o.x?a.x:o.x:i.x>o.x?i.x:o.x,l=a.y>i.y?a.y>o.y?a.y:o.y:i.y>o.y?i.y:o.y,f=p(u,s,t,n,r),h=p(c,l,t,n,r),d=e.nextZ;d&&d.z<=h;){if(d!==e.prev&&d!==e.next&&y(a.x,a.y,i.x,i.y,o.x,o.y,d.x,d.y)&&_(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(d=e.prevZ;d&&d.z>=f;){if(d!==e.prev&&d!==e.next&&y(a.x,a.y,i.x,i.y,o.x,o.y,d.x,d.y)&&_(d.prev,d,d.next)>=0)return!1;d=d.prevZ}return!0}function o(e,t,n){var r=e;do{var a=r.prev,i=r.next.next;!v(a,i)&&T(a,r,r.next,i)&&A(a,i)&&A(i,a)&&(t.push(a.i/n),t.push(r.i/n),t.push(i.i/n),x(r),x(r.next),r=e=i),r=r.next}while(r!==e);return r}function u(e,t,a,i,o,u){var s=e;do{for(var c=s.next.next;c!==s.prev;){if(s.i!==c.i&&m(s,c)){var l=S(s,c);return s=n(s,s.next),l=n(l,l.next),r(s,t,a,i,o,u),void r(l,t,a,i,o,u)}c=c.next}s=s.next}while(s!==e)}function s(e,r,a,i){var o,u,s,f,h,d=[];for(o=0,u=r.length;o<u;o++)s=r[o]*i,f=o<u-1?r[o+1]*i:e.length,h=t(e,s,f,i,!1),h===h.next&&(h.steiner=!0),d.push(E(h));for(d.sort(c),o=0;o<d.length;o++)l(d[o],a),a=n(a,a.next);return a}function c(e,t){return e.x-t.x}function l(e,t){if(t=f(e,t)){var r=S(t,e);n(r,r.next)}}function f(e,t){var n,r=t,a=e.x,i=e.y,o=-(1/0);do{if(i<=r.y&&i>=r.next.y){var u=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(u<=a&&u>o){if(o=u,u===a){if(i===r.y)return r;if(i===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(a===o)return n.prev;var s,c=n,l=n.x,f=n.y,h=1/0;for(r=n.next;r!==c;)a>=r.x&&r.x>=l&&y(i<f?a:o,i,l,f,i<f?o:a,i,r.x,r.y)&&(s=Math.abs(i-r.y)/(a-r.x),(s<h||s===h&&r.x>n.x)&&A(r,e)&&(n=r,h=s)),r=r.next;return n}function h(e,t,n,r){var a=e;do null===a.z&&(a.z=p(a.x,a.y,t,n,r)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next;while(a!==e);a.prevZ.nextZ=null,a.prevZ=null,d(a)}function d(e){var t,n,r,a,i,o,u,s,c=1;do{for(n=e,e=null,i=null,o=0;n;){for(o++,r=n,u=0,t=0;t<c&&(u++,r=r.nextZ,r);t++);for(s=c;u>0||s>0&&r;)0===u?(a=r,r=r.nextZ,s--):0!==s&&r?n.z<=r.z?(a=n,n=n.nextZ,u--):(a=r,r=r.nextZ,s--):(a=n,n=n.nextZ,u--),i?i.nextZ=a:e=a,a.prevZ=i,i=a;n=r}i.nextZ=null,c*=2}while(o>1);return e}function p(e,t,n,r,a){return e=32767*(e-n)/a,t=32767*(t-r)/a,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function E(e){var t=e,n=e;do t.x<n.x&&(n=t),t=t.next;while(t!==e);return n}function y(e,t,n,r,a,i,o,u){return(a-o)*(t-u)-(e-o)*(i-u)>=0&&(e-o)*(r-u)-(n-o)*(t-u)>=0&&(n-o)*(i-u)-(a-o)*(r-u)>=0}function m(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!R(e,t)&&A(e,t)&&A(t,e)&&g(e,t)}function _(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function v(e,t){return e.x===t.x&&e.y===t.y}function T(e,t,n,r){return!!(v(e,t)&&v(n,r)||v(e,r)&&v(n,t))||_(e,t,n)>0!=_(e,t,r)>0&&_(n,r,e)>0!=_(n,r,t)>0}function R(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&T(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function A(e,t){return _(e.prev,e,e.next)<0?_(e,t,e.next)>=0&&_(e,e.prev,t)>=0:_(e,t,e.prev)<0||_(e,e.next,t)<0}function g(e,t){var n=e,r=!1,a=(e.x+t.x)/2,i=(e.y+t.y)/2;do n.y>i!=n.next.y>i&&a<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function S(e,t){var n=new O(e.i,e.x,e.y),r=new O(t.i,t.x,t.y),a=e.next,i=t.prev;return e.next=t,t.prev=e,n.next=a,a.prev=n,r.next=n,n.prev=r,i.next=r,r.prev=i,r}function N(e,t,n,r){var a=new O(e,t,n);return r?(a.next=r.next,a.prev=r,r.next.prev=a,r.next=a):(a.prev=a,a.next=a),a}function x(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function O(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function w(e,t,n,r){for(var a=0,i=t,o=n-r;i<n;i+=r)a+=(e[o]-e[i])*(e[i+1]+e[o+1]),o=i;return a}return e.deviation=function(e,t,n,r){var a=t&&t.length,i=a?t[0]*n:e.length,o=Math.abs(w(e,0,i,n));if(a)for(var u=0,s=t.length;u<s;u++){var c=t[u]*n,l=u<s-1?t[u+1]*n:e.length;o-=Math.abs(w(e,c,l,n))}var f=0;for(u=0;u<r.length;u+=3){var h=r[u]*n,d=r[u+1]*n,p=r[u+2]*n;f+=Math.abs((e[h]-e[p])*(e[d+1]-e[h+1])-(e[h]-e[d])*(e[p+1]-e[h+1]))}return 0===o&&0===f?0:Math.abs((f-o)/o)},e.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,a=0;a<e.length;a++){for(var i=0;i<e[a].length;i++)for(var o=0;o<t;o++)n.vertices.push(e[a][i][o]);a>0&&(r+=e[a-1].length,n.holes.push(r))}return n},e}),define("Core/WindingOrder",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={CLOCKWISE:t.CW,COUNTER_CLOCKWISE:t.CCW,validate:function(e){return e===n.CLOCKWISE||e===n.COUNTER_CLOCKWISE}};return e(n)}),define("Core/PolygonPipeline",["../ThirdParty/earcut-2.1.1","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./Math","./PrimitiveType","./WindingOrder"],function(e,t,n,r,a,i,o,u,s,c,l,f,h){"use strict";var d=new n,p=new n,E={};E.computeArea2D=function(e){for(var t=e.length,n=0,r=t-1,a=0;a<t;r=a++){var i=e[r],o=e[a];n+=i.x*o.y-o.x*i.y}return.5*n},E.computeWindingOrder2D=function(e){var t=E.computeArea2D(e);return t>0?h.COUNTER_CLOCKWISE:h.CLOCKWISE},E.triangulate=function(n,r){var a=t.packArray(n);return e(a,r,2)};var y=new n,m=new n,_=new n,v=new n,T=new n,R=new n,A=new n;return E.computeSubdivision=function(e,t,o,u){u=a(u,l.RADIANS_PER_DEGREE);var h,d=o.slice(0),p=t.length,E=new Array(3*p),g=0;for(h=0;h<p;h++){var S=t[h];E[g++]=S.x,E[g++]=S.y,E[g++]=S.z}for(var N=[],x={},O=e.maximumRadius,w=l.chordLength(u,O),I=w*w;d.length>0;){var M,C,P=d.pop(),D=d.pop(),U=d.pop(),L=n.fromArray(E,3*U,y),b=n.fromArray(E,3*D,m),F=n.fromArray(E,3*P,_),z=n.multiplyByScalar(n.normalize(L,v),O,v),B=n.multiplyByScalar(n.normalize(b,T),O,T),G=n.multiplyByScalar(n.normalize(F,R),O,R),q=n.magnitudeSquared(n.subtract(z,B,A)),W=n.magnitudeSquared(n.subtract(B,G,A)),V=n.magnitudeSquared(n.subtract(G,z,A)),X=Math.max(q,W,V);X>I?q===X?(M=Math.min(U,D)+" "+Math.max(U,D),h=x[M],i(h)||(C=n.add(L,b,A),n.multiplyByScalar(C,.5,C),E.push(C.x,C.y,C.z),h=E.length/3-1,x[M]=h),d.push(U,h,P),d.push(h,D,P)):W===X?(M=Math.min(D,P)+" "+Math.max(D,P),h=x[M],i(h)||(C=n.add(b,F,A),n.multiplyByScalar(C,.5,C),E.push(C.x,C.y,C.z),h=E.length/3-1,x[M]=h),d.push(D,h,U),d.push(h,P,U)):V===X&&(M=Math.min(P,U)+" "+Math.max(P,U),h=x[M],i(h)||(C=n.add(F,L,A),n.multiplyByScalar(C,.5,C),E.push(C.x,C.y,C.z),h=E.length/3-1,x[M]=h),d.push(P,h,D),d.push(h,U,D)):(N.push(U),N.push(D),N.push(P))}return new s({attributes:{position:new c({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:E})},indices:N,primitiveType:f.TRIANGLES})},E.scaleToGeodeticHeight=function(e,t,r,o){r=a(r,u.WGS84);var s=d,c=p;if(t=a(t,0),o=a(o,!0),i(e))for(var l=e.length,f=0;f<l;f+=3)n.fromArray(e,f,c),o&&(c=r.scaleToGeodeticSurface(c,c)),0!==t&&(s=r.geodeticSurfaceNormal(c,s),n.multiplyByScalar(s,t,s),n.add(c,s,c)),e[f]=c.x,e[f+1]=c.y,e[f+2]=c.z;return e},E}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Intersect"],function(e,t,n,r,a){"use strict";function i(r,a,i){this.minimum=e.clone(t(r,e.ZERO)),this.maximum=e.clone(t(a,e.ZERO)),n(i)?i=e.clone(i):(i=e.add(this.minimum,this.maximum,new e),e.multiplyByScalar(i,.5,i)),this.center=i}i.fromPoints=function(t,r){if(n(r)||(r=new i),!n(t)||0===t.length)return r.minimum=e.clone(e.ZERO,r.minimum),r.maximum=e.clone(e.ZERO,r.maximum),r.center=e.clone(e.ZERO,r.center),r;for(var a=t[0].x,o=t[0].y,u=t[0].z,s=t[0].x,c=t[0].y,l=t[0].z,f=t.length,h=1;h<f;h++){var d=t[h],p=d.x,E=d.y,y=d.z;a=Math.min(p,a),s=Math.max(p,s),o=Math.min(E,o),c=Math.max(E,c),u=Math.min(y,u),l=Math.max(y,l)}var m=r.minimum;m.x=a,m.y=o,m.z=u;var _=r.maximum;_.x=s,_.y=c,_.z=l;var v=e.add(m,_,r.center);return e.multiplyByScalar(v,.5,v),r},i.clone=function(t,r){if(n(t))return n(r)?(r.minimum=e.clone(t.minimum,r.minimum),r.maximum=e.clone(t.maximum,r.maximum),r.center=e.clone(t.center,r.center),r):new i(t.minimum,t.maximum)},i.equals=function(t,r){return t===r||n(t)&&n(r)&&e.equals(t.center,r.center)&&e.equals(t.minimum,r.minimum)&&e.equals(t.maximum,r.maximum)};var o=new e;return i.intersectPlane=function(t,n){o=e.subtract(t.maximum,t.minimum,o);var r=e.multiplyByScalar(o,.5,o),i=n.normal,u=r.x*Math.abs(i.x)+r.y*Math.abs(i.y)+r.z*Math.abs(i.z),s=e.dot(t.center,i)+n.distance;return s-u>0?a.INSIDE:s+u<0?a.OUTSIDE:a.INTERSECTING},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.intersectPlane=function(e){return i.intersectPlane(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,n,r,a){return t(e).then(n,r,a)}function t(e){var t,n;return e instanceof r?t=e:u(e)?(n=o(),e.then(function(e){n.resolve(e)},function(e){n.reject(e)},function(e){n.progress(e)}),t=n.promise):t=a(e),t}function n(t){return e(t,i)}function r(e){this.then=e}function a(e){var n=new r(function(n){try{return t(n?n(e):e)}catch(e){return i(e)}});return n}function i(e){var n=new r(function(n,r){try{return r?t(r(e)):i(e)}catch(e){return i(e)}});return n}function o(){function e(e,t,n){return h(e,t,n)}function n(e){return p(e)}function a(e){return p(i(e))}function u(e){return d(e)}var s,c,l,f,h,d,p;return c=new r(e),s={then:e,resolve:n,reject:a,progress:u,promise:c,resolver:{resolve:n,reject:a,progress:u}},l=[],f=[],h=function(e,t,n){var r,a;return r=o(),a="function"==typeof n?function(e){try{r.progress(n(e))}catch(e){r.progress(e)}}:function(e){r.progress(e)},l.push(function(n){n.then(e,t).then(r.resolve,r.reject,a)}),f.push(a),r.promise},d=function(e){return E(f,e),e},p=function(e){return e=t(e),h=e.then,p=t,d=m,E(l,e),f=l=R,e},s}function u(e){return e&&"function"==typeof e.then}function s(t,n,r,a,i){return y(2,arguments),e(t,function(t){function u(e){E(e)}function s(e){p(e)}var c,l,f,h,d,p,E,y,_,v;if(_=t.length>>>0,c=Math.max(0,Math.min(n,_)),f=[],l=_-c+1,h=[],d=o(),c)for(y=d.progress,E=function(e){h.push(e),--l||(p=E=m,d.reject(h))},p=function(e){f.push(e),--c||(p=E=m,d.resolve(f))},v=0;v<_;++v)v in t&&e(t[v],s,u,y);else d.resolve(f);return d.then(r,a,i)})}function c(e,t,n,r){function a(e){return t?t(e[0]):e[0]}return s(e,1,a,n,r)}function l(e,t,n,r){return y(1,arguments),h(e,_).then(t,n,r)}function f(){return h(arguments,_)}function h(t,n){return e(t,function(t){var r,a,i,u,s,c;if(i=a=t.length>>>0,r=[],c=o(),i)for(u=function(t,a){e(t,n).then(function(e){r[a]=e,--i||c.resolve(r)},c.reject)},s=0;s<a;s++)s in t?u(t[s],s):--i;else c.resolve(r);return c.promise})}function d(t,n){var r=T.call(arguments,1);return e(t,function(t){var a;return a=t.length,r[0]=function(t,r,i){return e(t,function(t){return e(r,function(e){return n(t,e,i,a)})})},v.apply(t,r)})}function p(t,n,r){var a=arguments.length>2;return e(t,function(e){return e=a?r:e,n.resolve(e),e},function(e){return n.reject(e),i(e)},n.progress)}function E(e,t){for(var n,r=0;n=e[r++];)n(t)}function y(e,t){for(var n,r=t.length;r>e;)if(n=t[--r],null!=n&&"function"!=typeof n)throw new Error("arg "+r+" must be a function")}function m(){}function _(e){return e}var v,T,R;return e.defer=o,e.resolve=t,e.reject=n,e.join=f,e.all=l,e.map=h,e.reduce=d,e.any=c,e.some=s,e.chain=p,e.isPromise=u,r.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(R,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return l(t,function(t){return e.apply(R,t)})})}},T=[].slice,v=[].reduce||function(e){var t,n,r,a,i;if(i=0,t=Object(this),a=t.length>>>0,n=arguments,n.length<=1)for(;;){if(i in t){r=t[i++];break}if(++i>=a)throw new TypeError}else r=n[1];for(;i<a;++i)i in t&&(r=e(r,t[i],i,t));return r},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/binarySearch",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e,t,n){for(var r,a,i=0,o=e.length-1;i<=o;)if(r=~~((i+o)/2),a=n(e[r],t),a<0)i=r+1;else{if(!(a>0))return r;o=r-1}return~(o+1)}return n}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,n,r,a){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=r,this.ut1MinusUtc=a}return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,n=0,r=t[n++],a=function(e,t,n,r){n||(n=" ");var a=e.length>=t?"":Array(1+t-e.length>>>0).join(n);return r?e+a:a+e},i=function(e,t,n,r,i,o){var u=r-e.length;return u>0&&(e=n||!i?a(e,r,o,n):e.slice(0,t.length)+a("",u,"0",!0)+e.slice(t.length)),e},o=function(e,t,n,r,o,u,s){var c=e>>>0;return n=n&&c&&{2:"0b",8:"0",16:"0x"}[t]||"",e=n+a(c.toString(t),u||0,"0",!1),i(e,n,r,o,s)},u=function(e,t,n,r,a,o){return null!=r&&(e=e.slice(0,r)),i(e,"",t,n,a,o)},s=function(e,r,s,c,l,f,h){var d,p,E,y,m;if("%%"==e)return"%";for(var _=!1,v="",T=!1,R=!1,A=" ",g=s.length,S=0;s&&S<g;S++)switch(s.charAt(S)){case" ":v=" ";break;case"+":v="+";break;case"-":_=!0;break;case"'":A=s.charAt(S+1);break;case"0":T=!0;break;case"#":R=!0}if(c=c?"*"==c?+t[n++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,c<0&&(c=-c,_=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(f=f?"*"==f?+t[n++]:"*"==f.charAt(0)?+t[f.slice(1,-1)]:+f:"fFeE".indexOf(h)>-1?6:"d"==h?0:void 0,m=r?t[r.slice(0,-1)]:t[n++],h){case"s":return u(String(m),_,c,f,T,A);case"c":return u(String.fromCharCode(+m),_,c,f,T);case"b":return o(m,2,R,_,c,f,T);case"o":return o(m,8,R,_,c,f,T);case"x":return o(m,16,R,_,c,f,T);case"X":return o(m,16,R,_,c,f,T).toUpperCase();case"u":return o(m,10,R,_,c,f,T);case"i":case"d":return d=+m||0,d=Math.round(d-d%1),p=d<0?"-":v,m=p+a(String(Math.abs(d)),f,"0",!1),i(m,p,_,c,T);case"e":case"E":case"f":case"F":case"g":case"G":return d=+m,p=d<0?"-":v,E=["toExponential","toFixed","toPrecision"]["efg".indexOf(h.toLowerCase())],y=["toString","toUpperCase"]["eEfFgG".indexOf(h)%2],m=p+Math.abs(d)[E](f),i(m,p,_,c,T)[y]();default:return e}};return r.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,n,r,a,i,o,u){this.year=e,this.month=t,this.day=n,this.hour=r,this.minute=a,this.second=i,this.millisecond=o,this.isLeapSecond=u}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e(t)}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t){return E.compare(e.julianDate,t.julianDate)}function f(e){v.julianDate=e;var n=E.leapSeconds,r=t(n,v,l);r<0&&(r=~r),r>=n.length&&(r=n.length-1);var a=n[r].offset;if(r>0){var i=E.secondsDifference(n[r].julianDate,e);i>a&&(r--,a=n[r].offset)}E.addSeconds(e,a,e)}function h(e,n){v.julianDate=e;var r=E.leapSeconds,a=t(r,v,l);if(a<0&&(a=~a),0===a)return E.addSeconds(e,-r[0].offset,n);if(a>=r.length)return E.addSeconds(e,-r[a-1].offset,n);var i=E.secondsDifference(r[a].julianDate,e);return 0===i?E.addSeconds(e,-r[a].offset,n):i<=1?void 0:E.addSeconds(e,-r[--a].offset,n)}function d(e,t,n){var r=t/s.SECONDS_PER_DAY|0;return e+=r,t-=s.SECONDS_PER_DAY*r,t<0&&(e--,t+=s.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function p(e,t,n,r,a,i,o){var u=(t-14)/12|0,c=e+4800+u,l=(1461*c/4|0)+(367*(t-2-12*u)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;r-=12,r<0&&(r+=24);var f=i+(r*s.SECONDS_PER_HOUR+a*s.SECONDS_PER_MINUTE+o*s.SECONDS_PER_MILLISECOND);return f>=43200&&(l-=1),[l,f]}function E(e,t,r){this.dayNumber=void 0,this.secondsOfDay=void 0,e=n(e,0),t=n(t,0),r=n(r,c.UTC);var a=0|e;t+=(e-a)*s.SECONDS_PER_DAY,d(a,t,this),r===c.UTC&&f(this)}var y=new i,m=[31,28,31,30,31,30,31,31,30,31,30,31],_=29,v=new u,T=/^(\d{4})$/,R=/^(\d{4})-(\d{2})$/,A=/^(\d{4})-?(\d{3})$/,g=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,S=/^(\d{4})-?(\d{2})-?(\d{2})$/,N=/([Z+\-])?(\d{2})?:?(\d{2})?$/,x=/^(\d{2})(\.\d+)?/.source+N.source,O=/^(\d{2}):?(\d{2})(\.\d+)?/.source+N.source,w=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+N.source;E.fromDate=function(e,t){var n=p(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r(t)?(d(n[0],n[1],t),f(t),t):new E(n[0],n[1],c.UTC)},E.fromIso8601=function(e,t){e=e.replace(",",".");var n,a,i,u=e.split("T"),s=1,l=1,h=0,y=0,v=0,N=0,I=u[0],M=u[1];if(u=I.match(S),null!==u)n=+u[1],s=+u[2],l=+u[3];else if(u=I.match(R),null!==u)n=+u[1],s=+u[2];else if(u=I.match(T),null!==u)n=+u[1];else{var C;if(u=I.match(A),null!==u)n=+u[1],C=+u[2],i=o(n);else if(u=I.match(g),null!==u){n=+u[1];var P=+u[2],D=+u[3]||0,U=new Date(Date.UTC(n,0,4));C=7*P+D-U.getUTCDay()-3}a=new Date(Date.UTC(n,0,1)),a.setUTCDate(C),s=a.getUTCMonth()+1,l=a.getUTCDate()}i=o(n);var L;if(r(M)){u=M.match(w),null!==u?(h=+u[1],y=+u[2],v=+u[3],N=1e3*+(u[4]||0),L=5):(u=M.match(O),null!==u?(h=+u[1],y=+u[2],v=60*+(u[3]||0),L=4):(u=M.match(x),null!==u&&(h=+u[1],y=60*+(u[2]||0),L=3)));var b=u[L],F=+u[L+1],z=+(u[L+2]||0);switch(b){case"+":h-=F,y-=z;break;case"-":h+=F,y+=z;break;case"Z":break;default:y+=new Date(Date.UTC(n,s-1,l,h,y)).getTimezoneOffset()}}else y+=new Date(n,s-1,l).getTimezoneOffset();var B=60===v;for(B&&v--;y>=60;)y-=60,h++;for(;h>=24;)h-=24,l++;for(a=i&&2===s?_:m[s-1];l>a;)l-=a,s++,s>12&&(s-=12,n++),a=i&&2===s?_:m[s-1];for(;y<0;)y+=60,h--;for(;h<0;)h+=24,l--;for(;l<1;)s--,s<1&&(s+=12,n--),a=i&&2===s?_:m[s-1],l+=a;var G=p(n,s,l,h,y,v,N);return r(t)?(d(G[0],G[1],t),f(t)):t=new E(G[0],G[1],c.UTC),B&&E.addSeconds(t,1,t),t},E.now=function(e){return E.fromDate(new Date,e)};var I=new E(0,0,c.TAI);return E.toGregorianDate=function(e,t){var n=!1,a=h(e,I);r(a)||(E.addSeconds(e,-1,I),a=h(I,I),n=!0);var o=a.dayNumber,u=a.secondsOfDay;u>=43200&&(o+=1);var c=o+68569|0,l=4*c/146097|0;c=c-((146097*l+3)/4|0)|0;var f=4e3*(c+1)/1461001|0;c=c-(1461*f/4|0)+31|0;var d=80*c/2447|0,p=c-(2447*d/80|0)|0;c=d/11|0;var y=d+2-12*c|0,m=100*(l-49)+f+c|0,_=u/s.SECONDS_PER_HOUR|0,v=u-_*s.SECONDS_PER_HOUR,T=v/s.SECONDS_PER_MINUTE|0;v-=T*s.SECONDS_PER_MINUTE;var R=0|v,A=(v-R)/s.SECONDS_PER_MILLISECOND;return _+=12,_>23&&(_-=24),n&&(R+=1),r(t)?(t.year=m,t.month=y,t.day=p,t.hour=_,t.minute=T,t.second=R,t.millisecond=A,t.isLeapSecond=n,t):new i(m,y,p,_,T,R,A,n)},E.toDate=function(e){var t=E.toGregorianDate(e,y),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))},E.toIso8601=function(t,n){var a,i=E.toGregorianDate(t,i);return r(n)||0===i.millisecond?r(n)&&0!==n?(a=(.01*i.millisecond).toFixed(n).replace(".","").slice(0,n),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",i.year,i.month,i.day,i.hour,i.minute,i.second):(a=(.01*i.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a))},E.clone=function(e,t){if(r(e))return r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new E(e.dayNumber,e.secondsOfDay,c.TAI)},E.compare=function(e,t){var n=e.dayNumber-t.dayNumber;return 0!==n?n:e.secondsOfDay-t.secondsOfDay},E.equals=function(e,t){return e===t||r(e)&&r(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},E.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(E.secondsDifference(e,t))<=n},E.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},E.secondsDifference=function(e,t){var n=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return n+(e.secondsOfDay-t.secondsOfDay)},E.daysDifference=function(e,t){var n=e.dayNumber-t.dayNumber,r=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return n+r},E.computeTaiMinusUtc=function(e){v.julianDate=e;var n=E.leapSeconds,r=t(n,v,l);return r<0&&(r=~r,--r,r<0&&(r=0)),n[r].offset},E.addSeconds=function(e,t,n){return d(e.dayNumber,e.secondsOfDay+t,n)},E.addMinutes=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return d(e.dayNumber,r,n)},E.addHours=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return d(e.dayNumber,r,n)},E.addDays=function(e,t,n){var r=e.dayNumber+t;return d(r,e.secondsOfDay,n)},E.lessThan=function(e,t){return E.compare(e,t)<0},E.lessThanOrEquals=function(e,t){return E.compare(e,t)<=0},E.greaterThan=function(e,t){return E.compare(e,t)>0},E.greaterThanOrEquals=function(e,t){return E.compare(e,t)>=0},E.prototype.clone=function(e){return E.clone(this,e)},E.prototype.equals=function(e){return E.equals(this,e)},E.prototype.equalsEpsilon=function(e,t){return E.equalsEpsilon(this,e,t)},E.prototype.toString=function(){return E.toIso8601(this)},E.leapSeconds=[new u(new E(2441317,43210,c.TAI),10),new u(new E(2441499,43211,c.TAI),11),new u(new E(2441683,43212,c.TAI),12),new u(new E(2442048,43213,c.TAI),13),new u(new E(2442413,43214,c.TAI),14),new u(new E(2442778,43215,c.TAI),15),new u(new E(2443144,43216,c.TAI),16),new u(new E(2443509,43217,c.TAI),17),new u(new E(2443874,43218,c.TAI),18),new u(new E(2444239,43219,c.TAI),19),new u(new E(2444786,43220,c.TAI),20),new u(new E(2445151,43221,c.TAI),21),new u(new E(2445516,43222,c.TAI),22),new u(new E(2446247,43223,c.TAI),23),new u(new E(2447161,43224,c.TAI),24),new u(new E(2447892,43225,c.TAI),25),new u(new E(2448257,43226,c.TAI),26),new u(new E(2448804,43227,c.TAI),27),new u(new E(2449169,43228,c.TAI),28),new u(new E(2449534,43229,c.TAI),29),new u(new E(2450083,43230,c.TAI),30),new u(new E(2450630,43231,c.TAI),31),new u(new E(2451179,43232,c.TAI),32),new u(new E(2453736,43233,c.TAI),33),new u(new E(2454832,43234,c.TAI),34),new u(new E(2456109,43235,c.TAI),35),new u(new E(2457204,43236,c.TAI),36),new u(new E(2457754,43237,c.TAI),37)],E}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(n,r){if(null===n||"object"!=typeof n)return n;r=e(r,!1);var a=new n.constructor;for(var i in n)if(n.hasOwnProperty(i)){var o=n[i];r&&(o=t(o,r)),a[i]=o}return a}return t}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var n=e.split("\r\n"),r=0;r<n.length;++r){var a=n[r],i=a.indexOf(": ");if(i>0){var o=a.substring(0,i),u=a.substring(i+2);t[o]=u}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function n(e,n,r){this.statusCode=e,this.response=n,this.responseHeaders=r,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return n.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},n}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var n=r.exec(t);this.scheme=n[1],this.authority=n[2],this.path=n[3],this.query=n[4],this.fragment=n[5]}}function t(e){var t=unescape(e);return i.test(t)?t:e.toUpperCase()}function n(e,t,n,r){return(t||"")+n.toLowerCase()+(r||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var r=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(o,n).replace(a,t)),this.path&&(this.path=this.path.replace(a,t)),this.query&&(this.query=this.query.replace(a,t)),this.fragment&&(this.fragment=this.fragment.replace(a,t))};var a=/%[0-9a-z]{2}/gi,i=/[a-zA-Z0-9\-\._~]/,o=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var n=new e;return this.scheme?(n.scheme=this.scheme,n.authority=this.authority,n.path=this.path,n.query=this.query):(n.scheme=t.scheme,this.authority?(n.authority=this.authority,n.path=this.path,n.query=this.query):(n.authority=t.authority,""==this.path?(n.path=t.path,n.query=this.query||t.query):("/"==this.path.charAt(0)?(n.path=this.path,n.removeDotSegments()):(t.authority&&""==t.path?n.path="/"+this.path:n.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,n.removeDotSegments()),n.query=this.query))),n.fragment=this.fragment,n},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),n=[],r=""==t[0];r&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?n.pop():"."!=e&&n.push(e);"."!=e&&".."!=e||n.push(""),r&&n.unshift(""),this.path=n.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n){var r=new e(n);r.normalize();var a=r.getAuthority();if(t(a)){if(a.indexOf("@")!==-1){var i=a.split("@");a=i[1]}if(a.indexOf(":")===-1){var o=r.getScheme();if(t(o)||(o=window.location.protocol,o=o.substring(0,o.length-1)),"http"===o)a+=":80";else{if("https"!==o)return;a+=":443"}}return a}}var a={},i={};return a.add=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])||(i[r]=!0)},a.remove=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])&&delete i[r]},a.contains=function(e){var n=r(e);return!(!t(n)||!t(i[n]))},a.clear=function(){i={}},a}),define("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,n,r,a,i,o){"use strict";function u(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,a=t(n.method,"GET"),i=n.data,o=n.headers,s=n.overrideMimeType;return e(n.url,function(t){var n=e.defer();return u.load(t,r,a,i,o,n,s),n.promise})}function s(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function c(e,t){for(var n=s(e,t),r=new ArrayBuffer(n.length),a=new Uint8Array(r),i=0;i<n.length;i++)a[i]=n.charCodeAt(i);return r}function l(e,n){n=t(n,"");var r=e[1],a=!!e[2],i=e[3];switch(n){case"":case"text":return s(a,i);case"arraybuffer":return c(a,i);case"blob":var o=c(a,i);return new Blob([o],{type:r});case"document":var u=new DOMParser;return u.parseFromString(s(a,i),r);case"json":return JSON.parse(s(a,i))}}var f=/^data:(.*?)(;base64)?,(.*)$/;return u.load=function(e,t,r,u,s,c,h){var d=f.exec(e);if(null!==d)return void c.resolve(l(d,t));var p=new XMLHttpRequest;if(o.contains(e)&&(p.withCredentials=!0),n(h)&&n(p.overrideMimeType)&&p.overrideMimeType(h),p.open(r,e,!0),n(s))for(var E in s)s.hasOwnProperty(E)&&p.setRequestHeader(E,s[E]);n(t)&&(p.responseType=t),p.onload=function(){if(p.status<200||p.status>=300)return void c.reject(new a(p.status,p.response,p.getAllResponseHeaders()));var e=p.response,r=p.responseType;if(!n(e)||n(t)&&r!==t)if("json"===t&&"string"==typeof e)try{c.resolve(JSON.parse(e))}catch(e){c.reject(e)}else(""===r||"document"===r)&&n(p.responseXML)&&p.responseXML.hasChildNodes()?c.resolve(p.responseXML):""!==r&&"text"!==r||!n(p.responseText)?c.reject(new i("Invalid XMLHttpRequest response type.")):c.resolve(p.responseText);else c.resolve(e)},p.onerror=function(e){c.reject(new a)},p.send(u)},u.defaultLoad=u.load,u}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,n){return e({url:t,headers:n})}return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";function a(n,a){return t(a)?t(a.Accept)||(a=e(a),a.Accept=i.Accept):a=i,r(n,a).then(function(e){return JSON.parse(e)})}var i={Accept:"application/json,*/*;q=0.01"};return a}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(t){ +if(t=n(t,n.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=n(t.addNewLeapSeconds,!0),r(t.data))p(this,t.data);else if(r(t.url)){var a=this;this._downloadPromise=e(s(t.url),function(e){p(a,e)},function(){a._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else p(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function d(e,t){return o.compare(e.julianDate,t)}function p(e,n){if(!r(n.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!r(n.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var a=n.columnNames.indexOf("modifiedJulianDateUtc"),i=n.columnNames.indexOf("xPoleWanderRadians"),s=n.columnNames.indexOf("yPoleWanderRadians"),c=n.columnNames.indexOf("ut1MinusUtcSeconds"),h=n.columnNames.indexOf("xCelestialPoleOffsetRadians"),p=n.columnNames.indexOf("yCelestialPoleOffsetRadians"),E=n.columnNames.indexOf("taiMinusUtcSeconds");if(a<0||i<0||s<0||c<0||h<0||p<0||E<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var y=e._samples=n.samples,m=e._dates=[];e._dateColumn=a,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=h,e._yCelestialPoleOffsetRadiansColumn=p,e._taiMinusUtcSecondsColumn=E,e._columnCount=n.columnNames.length,e._lastIndex=void 0;for(var _,v=e._addNewLeapSeconds,T=0,R=y.length;T<R;T+=e._columnCount){var A=y[T+a],g=y[T+E],S=A+l.MODIFIED_JULIAN_DATE_DIFFERENCE,N=new o(S,g,f.TAI);if(m.push(N),v){if(g!==_&&r(_)){var x=o.leapSeconds,O=t(x,N,d);if(O<0){var w=new u(N,g);x.splice(~O,0,w)}}_=g}}}function E(e,t,n,r,a){var i=n*r;a.xPoleWander=t[i+e._xPoleWanderRadiansColumn],a.yPoleWander=t[i+e._yPoleWanderRadiansColumn],a.xPoleOffset=t[i+e._xCelestialPoleOffsetRadiansColumn],a.yPoleOffset=t[i+e._yCelestialPoleOffsetRadiansColumn],a.ut1MinusUtc=t[i+e._ut1MinusUtcSecondsColumn]}function y(e,t,n){return t+e*(n-t)}function m(e,t,n,r,a,i,u){var s=e._columnCount;if(i>t.length-1)return u.xPoleWander=0,u.yPoleWander=0,u.xPoleOffset=0,u.yPoleOffset=0,u.ut1MinusUtc=0,u;var c=t[a],l=t[i];if(c.equals(l)||r.equals(c))return E(e,n,a,s,u),u;if(r.equals(l))return E(e,n,i,s,u),u;var f=o.secondsDifference(r,c)/o.secondsDifference(l,c),h=a*s,d=i*s,p=n[h+e._ut1MinusUtcSecondsColumn],m=n[d+e._ut1MinusUtcSecondsColumn],_=m-p;if(_>.5||_<-.5){var v=n[h+e._taiMinusUtcSecondsColumn],T=n[d+e._taiMinusUtcSecondsColumn];v!==T&&(l.equals(r)?p=m:m-=T-v)}return u.xPoleWander=y(f,n[h+e._xPoleWanderRadiansColumn],n[d+e._xPoleWanderRadiansColumn]),u.yPoleWander=y(f,n[h+e._yPoleWanderRadiansColumn],n[d+e._yPoleWanderRadiansColumn]),u.xPoleOffset=y(f,n[h+e._xCelestialPoleOffsetRadiansColumn],n[d+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=y(f,n[h+e._yCelestialPoleOffsetRadiansColumn],n[d+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=y(f,p,m),u}return h.NONE=i({getPromiseToLoad:function(){return e()},compute:function(e,t){return r(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new a(0,0,0,0,0),t}}),h.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},h.prototype.compute=function(e,n){if(r(this._samples)){if(r(n)||(n=new a(0,0,0,0,0)),0===this._samples.length)return n.xPoleWander=0,n.yPoleWander=0,n.xPoleOffset=0,n.yPoleOffset=0,n.ut1MinusUtc=0,n;var i=this._dates,u=this._lastIndex,s=0,l=0;if(r(u)){var f=i[u],h=i[u+1],d=o.lessThanOrEquals(f,e),p=!r(h),E=p||o.greaterThanOrEquals(h,e);if(d&&E)return s=u,!p&&h.equals(e)&&++s,l=s+1,m(this,i,this._samples,e,s,l,n),n}var y=t(i,e,o.compare,this._dateColumn);return y>=0?(y<i.length-1&&i[y+1].equals(e)&&++y,s=y,l=y):(l=~y,s=l-1,s<0&&(s=0)),this._lastIndex=s,m(this,i,this._samples,e,s,l,n),n}if(r(this._dataError))throw new c(this._dataError)},h}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(t,n,r){this.heading=e(t,0),this.pitch=e(n,0),this.roll=e(r,0)}return a.fromQuaternion=function(e,n){t(n)||(n=new a);var r=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return n.heading=-Math.atan2(s,u),n.roll=Math.atan2(o,i),n.pitch=-Math.asin(r),n},a.fromDegrees=function(e,n,i,o){return t(o)||(o=new a),o.heading=e*r.RADIANS_PER_DEGREE,o.pitch=n*r.RADIANS_PER_DEGREE,o.roll=i*r.RADIANS_PER_DEGREE,o},a.clone=function(e,n){if(t(e))return t(n)?(n.heading=e.heading,n.pitch=e.pitch,n.roll=e.roll,n):new a(e.heading,e.pitch,e.roll)},a.equals=function(e,n){return e===n||t(e)&&t(n)&&e.heading===n.heading&&e.pitch===n.pitch&&e.roll===n.roll},a.equalsEpsilon=function(e,n,a,i){return e===n||t(e)&&t(n)&&r.equalsEpsilon(e.heading,n.heading,a,i)&&r.equalsEpsilon(e.pitch,n.pitch,a,i)&&r.equalsEpsilon(e.roll,n.roll,a,i)},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,n){return a.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},a}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=t(r,document.location.href);var a=new e(r),i=new e(n);return i.resolve(a).toString()}return a}),define("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(r,a,i){i=t(i,!0),r instanceof e||(r=new e(r)),a instanceof e||(a=new e(a)),n(a.authority)&&!n(a.scheme)&&("undefined"!=typeof document&&n(document.location)&&n(document.location.href)?a.scheme=new e(document.location.href).scheme:a.scheme=r.scheme);var o=r;a.isAbsolute()&&(o=a);var u="";n(o.scheme)&&(u+=o.scheme+":"),n(o.authority)&&(u+="//"+o.authority,""!==o.path&&"/"!==o.path&&(u=u.replace(/\/?$/,"/"),o.path=o.path.replace(/^\/?/g,""))),u+=o===r?i?r.path.replace(/\/?$/,"/")+a.path.replace(/^\/?/g,""):r.path+a.path:a.path;var s=n(r.query),c=n(a.query);s&&c?u+="?"+r.query+"&"+a.query:s&&!c?u+="?"+r.query:!s&&c&&(u+="?"+a.query);var l=n(a.fragment);return n(r.fragment)&&!l?u+="#"+r.fragment:l&&(u+="#"+a.fragment),u}return a}),define("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","./joinUrls","require"],function(e,t,n,r,a,i){"use strict";function o(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;t<n;++t){var r=e[t].getAttribute("src"),a=p.exec(r);if(null!==a)return a[1]}}function u(){if(t(f))return f;var n;return n="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:o(),f=new e(r(n))}function s(e){return i.toUrl("../"+e)}function c(e){return a(u(),e)}function l(e){t(h)||(h=t(i.toUrl)?s:c),t(d)||(d=document.createElement("a"));var n=h(e);return d.href=n,d.href=d.href,d.href}var f,h,d,p=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return l._cesiumScriptRegex=p,l.setBaseUrl=function(t){f=new e(t).resolve(new e(document.location.href))},l}),define("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,n){this.x=e,this.y=t,this.s=n}return e}),define("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){e=n(e,n.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=n(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=n(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new i(this._sampleZeroJulianEphemerisDate,0,u.TAI),this._stepSizeDays=n(e.stepSizeDays,1),this._samplesPerXysFile=n(e.samplesPerXysFile,1e3),this._totalSamples=n(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,r=this._denominators=new Array(t+1),a=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t),s=0;s<=t;++s){r[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;c<=t;++c)c!==s&&(r[s]*=s-c);r[s]=1/r[s]}this._work=new Array(t+1),this._coef=new Array(t+1)}function c(e,t,n){var r=f;return r.dayNumber=t,r.secondsOfDay=n,i.daysDifference(r,e._sampleZeroDateTT)}function l(n,a){if(n._chunkDownloadsInProgress[a])return n._chunkDownloadsInProgress[a];var i=e.defer();n._chunkDownloadsInProgress[a]=i;var u,s=n._xysFileUrlTemplate;return u=r(s)?s.replace("{0}",a):t("Assets/IAU2006_XYS/IAU2006_XYS_"+a+".json"),e(o(u),function(e){n._chunkDownloadsInProgress[a]=!1;for(var t=n._samples,r=e.samples,o=a*n._samplesPerXysFile*3,u=0,s=r.length;u<s;++u)t[o+u]=r[u];i.resolve()}),i.promise}var f=new i(0,0,u.TAI);return s.prototype.preload=function(t,n,r,a){var i=c(this,t,n),o=c(this,r,a),u=i/this._stepSizeDays-this._interpolationOrder/2|0;u<0&&(u=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var f=u/this._samplesPerXysFile|0,h=s/this._samplesPerXysFile|0,d=[],p=f;p<=h;++p)d.push(l(this,p));return e.all(d)},s.prototype.computeXysRadians=function(e,t,n){var i=c(this,e,t);if(!(i<0)){var o=i/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);s<0&&(s=0);var f=s+u;f>=this._totalSamples&&(f=this._totalSamples-1,s=f-u,s<0&&(s=0));var h=!1,d=this._samples;if(r(d[3*s])||(l(this,s/this._samplesPerXysFile|0),h=!0),r(d[3*f])||(l(this,f/this._samplesPerXysFile|0),h=!0),!h){r(n)?(n.x=0,n.y=0,n.s=0):n=new a(0,0,0);var p,E,y=i-s*this._stepSizeDays,m=this._work,_=this._denominators,v=this._coef,T=this._xTable;for(p=0;p<=u;++p)m[p]=y-T[p];for(p=0;p<=u;++p){for(v[p]=1,E=0;E<=u;++E)E!==p&&(v[p]*=m[E]);v[p]*=_[p];var R=3*(s+p);n.x+=v[p]*d[R++],n.y+=v[p]*d[R++],n.s+=v[p]*d[R]}return n}}}},s}),define("Core/Quaternion",["./Cartesian3","./Check","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math","./Matrix3"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(e,t,r,a){this.x=n(e,0),this.y=n(t,0),this.z=n(r,0),this.w=n(a,0)}var l=new e;c.fromAxisAngle=function(t,n,a){var i=n/2,o=Math.sin(i);l=e.normalize(t,l);var u=l.x*o,s=l.y*o,f=l.z*o,h=Math.cos(i);return r(a)?(a.x=u,a.y=s,a.z=f,a.w=h,a):new c(u,s,f,h)};var f=[1,2,0],h=new Array(3);c.fromRotationMatrix=function(e,t){var n,a,i,o,u,l=e[s.COLUMN0ROW0],d=e[s.COLUMN1ROW1],p=e[s.COLUMN2ROW2],E=l+d+p;if(E>0)n=Math.sqrt(E+1),u=.5*n,n=.5/n,a=(e[s.COLUMN1ROW2]-e[s.COLUMN2ROW1])*n,i=(e[s.COLUMN2ROW0]-e[s.COLUMN0ROW2])*n,o=(e[s.COLUMN0ROW1]-e[s.COLUMN1ROW0])*n;else{var y=f,m=0;d>l&&(m=1),p>l&&p>d&&(m=2);var _=y[m],v=y[_];n=Math.sqrt(e[s.getElementIndex(m,m)]-e[s.getElementIndex(_,_)]-e[s.getElementIndex(v,v)]+1);var T=h;T[m]=.5*n,n=.5/n,u=(e[s.getElementIndex(v,_)]-e[s.getElementIndex(_,v)])*n,T[_]=(e[s.getElementIndex(_,m)]+e[s.getElementIndex(m,_)])*n,T[v]=(e[s.getElementIndex(v,m)]+e[s.getElementIndex(m,v)])*n,a=-T[0],i=-T[1],o=-T[2]}return r(t)?(t.x=a,t.y=i,t.z=o,t.w=u,t):new c(a,i,o,u)};var d=new c;c.fromHeadingPitchRoll=function(t,n,r,a){var i=c.fromAxisAngle(e.UNIT_X,r,d),o=c.fromAxisAngle(e.UNIT_Y,-n,a);a=c.multiply(o,i,o);var u=c.fromAxisAngle(e.UNIT_Z,-t,d);return c.multiply(u,a,a)};var p=new e,E=new e,y=new c,m=new c,_=new c;c.packedLength=4,c.pack=function(e,t,r){return r=n(r,0),t[r++]=e.x,t[r++]=e.y,t[r++]=e.z,t[r]=e.w,t},c.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new c),a.x=e[t],a.y=e[t+1],a.z=e[t+2],a.w=e[t+3],a},c.packedInterpolationLength=3,c.convertPackedArrayForInterpolation=function(e,t,n,r){c.unpack(e,4*n,_),c.conjugate(_,_);for(var a=0,i=n-t+1;a<i;a++){var o=3*a;c.unpack(e,4*(t+a),y),c.multiply(y,_,y),y.w<0&&c.negate(y,y),c.computeAxis(y,p);var u=c.computeAngle(y);r[o]=p.x*u,r[o+1]=p.y*u,r[o+2]=p.z*u}},c.unpackInterpolationResult=function(t,n,a,i,o){r(o)||(o=new c),e.fromArray(t,0,E);var u=e.magnitude(E);return c.unpack(n,4*i,m),0===u?c.clone(c.IDENTITY,y):c.fromAxisAngle(E,u,y),c.multiply(y,m,o)},c.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new c(e.x,e.y,e.z,e.w)},c.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},c.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},c.magnitude=function(e){return Math.sqrt(c.magnitudeSquared(e))},c.normalize=function(e,t){var n=1/c.magnitude(e),r=e.x*n,a=e.y*n,i=e.z*n,o=e.w*n;return t.x=r,t.y=a,t.z=i,t.w=o,t},c.inverse=function(e,t){var n=c.magnitudeSquared(e);return t=c.conjugate(e,t),c.multiplyByScalar(t,1/n,t)},c.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},c.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},c.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},c.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},c.multiply=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=e.w,u=t.x,s=t.y,c=t.z,l=t.w,f=o*u+r*l+a*c-i*s,h=o*s-r*c+a*l+i*u,d=o*c+r*s-a*u+i*l,p=o*l-r*u-a*s-i*c;return n.x=f,n.y=h,n.z=d,n.w=p,n},c.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},c.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},c.computeAxis=function(e,t){var n=e.w;if(Math.abs(n-1)<u.EPSILON6)return t.x=t.y=t.z=0,t;var r=1/Math.sqrt(1-n*n);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},c.computeAngle=function(e){return Math.abs(e.w-1)<u.EPSILON6?0:2*Math.acos(e.w)};var v=new c;c.lerp=function(e,t,n,r){return v=c.multiplyByScalar(t,n,v),r=c.multiplyByScalar(e,1-n,r),c.add(v,r,r)};var T=new c,R=new c,A=new c;c.slerp=function(e,t,n,r){var a=c.dot(e,t),i=t;if(a<0&&(a=-a,i=T=c.negate(t,T)),1-a<u.EPSILON6)return c.lerp(e,i,n,r);var o=Math.acos(a);return R=c.multiplyByScalar(e,Math.sin((1-n)*o),R),A=c.multiplyByScalar(i,Math.sin(n*o),A),r=c.add(R,A,r),c.multiplyByScalar(r,1/Math.sin(o),r)},c.log=function(t,n){var r=u.acosClamped(t.w),a=0;return 0!==r&&(a=r/Math.sin(r)),e.multiplyByScalar(t,a,n)},c.exp=function(t,n){var r=e.magnitude(t),a=0;return 0!==r&&(a=Math.sin(r)/r),n.x=t.x*a,n.y=t.y*a,n.z=t.z*a,n.w=Math.cos(r),n};var g=new e,S=new e,N=new c,x=new c;c.computeInnerQuadrangle=function(t,n,r,a){var i=c.conjugate(n,N);c.multiply(i,r,x);var o=c.log(x,g);c.multiply(i,t,x);var u=c.log(x,S);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),c.exp(o,N),c.multiply(n,N,a)},c.squad=function(e,t,n,r,a,i){var o=c.slerp(e,t,a,N),u=c.slerp(n,r,a,x);return c.slerp(o,u,2*a*(1-a),i)};for(var O=new c,w=1.9011074535173003,I=i.supportsTypedArrays()?new Float32Array(8):[],M=i.supportsTypedArrays()?new Float32Array(8):[],C=i.supportsTypedArrays()?new Float32Array(8):[],P=i.supportsTypedArrays()?new Float32Array(8):[],D=0;D<7;++D){var U=D+1,L=2*U+1;I[D]=1/(U*L),M[D]=U/L}return I[7]=w/136,M[7]=8*w/17,c.fastSlerp=function(e,t,n,r){var a,i=c.dot(e,t);i>=0?a=1:(a=-1,i=-i);for(var o=i-1,u=1-n,s=n*n,l=u*u,f=7;f>=0;--f)C[f]=(I[f]*s-M[f])*o,P[f]=(I[f]*l-M[f])*o;var h=a*n*(1+C[0]*(1+C[1]*(1+C[2]*(1+C[3]*(1+C[4]*(1+C[5]*(1+C[6]*(1+C[7])))))))),d=u*(1+P[0]*(1+P[1]*(1+P[2]*(1+P[3]*(1+P[4]*(1+P[5]*(1+P[6]*(1+P[7])))))))),p=c.multiplyByScalar(e,d,O);return c.multiplyByScalar(t,h,r),c.add(p,r,r)},c.fastSquad=function(e,t,n,r,a,i){var o=c.fastSlerp(e,t,a,N),u=c.fastSlerp(n,r,a,x);return c.fastSlerp(o,u,2*a*(1-a),i)},c.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},c.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n},c.ZERO=o(new c(0,0,0,0)),c.IDENTITY=o(new c(0,0,0,1)),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.x+", "+this.y+", "+this.z+", "+this.w+")"},c}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./Check","./defaultValue","./defined","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./HeadingPitchRoll","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,p,E,y,m,_,v,T){"use strict";var R={},A=new n,g=new n,S=new n;R.eastNorthUpToFixedFrame=function(e,t,r){if(y.equalsEpsilon(e.x,0,y.EPSILON14)&&y.equalsEpsilon(e.y,0,y.EPSILON14)){var a=y.sign(e.z);return u(r)?(r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=-a,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=a,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(0,-a,0,e.x,1,0,0,e.y,0,0,a,e.z,0,0,0,1)}var i=A,s=g,c=S;return t=o(t,f.WGS84),t.geodeticSurfaceNormal(e,i),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(i,s,c),u(r)?(r[0]=s.x,r[1]=s.y,r[2]=s.z,r[3]=0,r[4]=c.x,r[5]=c.y,r[6]=c.z,r[7]=0,r[8]=i.x,r[9]=i.y,r[10]=i.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(s.x,c.x,i.x,e.x,s.y,c.y,i.y,e.y,s.z,c.z,i.z,e.z,0,0,0,1)};var N=new n,x=new n,O=new n;R.northEastDownToFixedFrame=function(e,t,r){if(y.equalsEpsilon(e.x,0,y.EPSILON14)&&y.equalsEpsilon(e.y,0,y.EPSILON14)){var a=y.sign(e.z);return u(r)?(r[0]=-a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=-a,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(-a,0,0,e.x,0,1,0,e.y,0,0,-a,e.z,0,0,0,1)}var i=N,s=x,c=O;return t=o(t,f.WGS84),t.geodeticSurfaceNormal(e,i),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(i,s,c),u(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=s.x,r[5]=s.y,r[6]=s.z,r[7]=0,r[8]=-i.x,r[9]=-i.y,r[10]=-i.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(c.x,s.x,-i.x,e.x,c.y,s.y,-i.y,e.y,c.z,s.z,-i.z,e.z,0,0,0,1)},R.northUpEastToFixedFrame=function(e,t,r){if(y.equalsEpsilon(e.x,0,y.EPSILON14)&&y.equalsEpsilon(e.y,0,y.EPSILON14)){var a=y.sign(e.z);return u(r)?(r[0]=-a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=a,r[7]=0,r[8]=0,r[9]=1,r[10]=0,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(-a,0,0,e.x,0,0,1,e.y,0,a,0,e.z,0,0,0,1)}var i=A,s=g,c=S;return t=o(t,f.WGS84),t.geodeticSurfaceNormal(e,i),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(i,s,c),u(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=i.x,r[5]=i.y,r[6]=i.z,r[7]=0,r[8]=s.x,r[9]=s.y,r[10]=s.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(c.x,i.x,s.x,e.x,c.y,i.y,s.y,e.y,c.z,i.z,s.z,e.z,0,0,0,1)},R.northWestUpToFixedFrame=function(e,t,r){if(y.equalsEpsilon(e.x,0,y.EPSILON14)&&y.equalsEpsilon(e.y,0,y.EPSILON14)){var a=y.sign(e.z);return u(r)?(r[0]=-a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=a,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(-a,0,0,e.x,0,-1,0,e.y,0,0,a,e.z,0,0,0,1)}var i=A,s=g,c=S;return t=o(t,f.WGS84),t.geodeticSurfaceNormal(e,i),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(i,s,c),u(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=-s.x,r[5]=-s.y,r[6]=-s.z,r[7]=0,r[8]=i.x,r[9]=i.y,r[10]=i.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new _(c.x,-s.x,i.x,e.x,c.y,-s.y,i.y,e.y,c.z,-s.z,i.z,e.z,0,0,0,1)};var w=new v,I=new n(1,1,1),M=new _;R.headingPitchRollToFixedFrame=function(e,t,r,a){i.typeOf.object("headingPitchRoll",t);var o=t.heading,u=t.pitch,s=t.roll,c=v.fromHeadingPitchRoll(o,u,s,w),l=_.fromTranslationQuaternionRotationScale(n.ZERO,c,I,M);return a=R.eastNorthUpToFixedFrame(e,r,a),_.multiply(a,l,a)};var C=new _,P=new m;R.headingPitchRollQuaternion=function(e,t,n,r){i.typeOf.object("headingPitchRoll",t);var a=R.headingPitchRollToFixedFrame(e,t,n,C),o=_.getRotation(a,P);return v.fromRotationMatrix(o,r)};var D=24110.54841,U=8640184.812866,L=.093104,b=-62e-7,F=1.1772758384668e-19,z=72921158553e-15,B=y.TWO_PI/86400,G=new E;R.computeTemeToPseudoFixedMatrix=function(e,t){G=E.addSeconds(e,-E.computeTaiMinusUtc(e),G);var n,r=G.dayNumber,a=G.secondsOfDay,i=r-2451545;n=a>=43200?(i+.5)/T.DAYS_PER_JULIAN_CENTURY:(i-.5)/T.DAYS_PER_JULIAN_CENTURY;var o=D+n*(U+n*(L+n*b)),s=o*B%y.TWO_PI,c=z+F*(r-2451545.5),l=(a+.5*T.SECONDS_PER_DAY)%T.SECONDS_PER_DAY,f=s+c*l,h=Math.cos(f),d=Math.sin(f);return u(t)?(t[0]=h,t[1]=-d,t[2]=0,t[3]=d,t[4]=h,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new m(h,d,0,-d,h,0,0,0,1)},R.iau2006XysData=new d,R.earthOrientationParameters=c.NONE;var q=32.184,W=2451545;R.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+q,a=t.stop.dayNumber,i=t.stop.secondsOfDay+q,o=R.iau2006XysData.preload(n,r,a,i),u=R.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},R.computeIcrfToFixedMatrix=function(e,t){u(t)||(t=new m);var n=R.computeFixedToIcrfMatrix(e,t);if(u(n))return m.transpose(n,t)};var V=new p(0,0,0),X=new l(0,0,0,0,0,0),H=new m,Y=new m;R.computeFixedToIcrfMatrix=function(e,t){u(t)||(t=new m);var n=R.earthOrientationParameters.compute(e,X);if(u(n)){var r=e.dayNumber,a=e.secondsOfDay+q,i=R.iau2006XysData.computeXysRadians(r,a,V);if(u(i)){var o=i.x+n.xPoleOffset,s=i.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-o*o-s*s)),l=H;l[0]=1-c*o*o,l[3]=-c*o*s,l[6]=o,l[1]=-c*o*s,l[4]=1-c*s*s,l[7]=s,l[2]=-o,l[5]=-s,l[8]=1-c*(o*o+s*s);var f=m.fromRotationZ(-i.s,Y),h=m.multiply(l,f,H),d=e.dayNumber,p=e.secondsOfDay-E.computeTaiMinusUtc(e)+n.ut1MinusUtc,_=d-2451545,v=p/T.SECONDS_PER_DAY,A=.779057273264+v+.00273781191135448*(_+v);A=A%1*y.TWO_PI;var g=m.fromRotationZ(A,Y),S=m.multiply(h,g,H),N=Math.cos(n.xPoleWander),x=Math.cos(n.yPoleWander),O=Math.sin(n.xPoleWander),w=Math.sin(n.yPoleWander),I=r-W+a/T.SECONDS_PER_DAY;I/=36525;var M=-47e-6*I*y.RADIANS_PER_DEGREE/3600,C=Math.cos(M),P=Math.sin(M),D=Y;return D[0]=N*C,D[1]=N*P,D[2]=O,D[3]=-x*P+w*O*C,D[4]=x*C+w*O*P,D[5]=-w*N,D[6]=-w*P-x*O*C,D[7]=w*C-x*O*P,D[8]=x*N,m.multiply(S,D,t)}}};var k=new r;R.pointToWindowCoordinates=function(e,t,n,r){return r=R.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},R.pointToGLWindowCoordinates=function(e,n,a,i){u(i)||(i=new t);var o=k;return _.multiplyByVector(e,r.fromElements(a.x,a.y,a.z,1,o),o),r.multiplyByScalar(o,1/o.w,o),_.multiplyByVector(n,o,o),t.fromCartesian4(o,i)};var Z=new n,j=new n,K=new n;R.rotationMatrixFromPositionVelocity=function(e,t,r,a){var i=o(r,f.WGS84).geodeticSurfaceNormal(e,Z),s=n.cross(t,i,j);n.equalsEpsilon(s,n.ZERO,y.EPSILON6)&&(s=n.clone(n.UNIT_X,s));var c=n.cross(s,t,K);return n.cross(t,c,s),n.negate(s,s),u(a)||(a=new m),a[0]=t.x,a[1]=t.y,a[2]=t.z,a[3]=s.x,a[4]=s.y,a[5]=s.z,a[6]=c.x,a[7]=c.y,a[8]=c.z,a};var J=new a,Q=new n,$=new n,ee=new r,te=new r,ne=new r,re=new r,ae=new r,ie=new _,oe=new _;R.basisTo2D=function(e,t,a){var i=e.ellipsoid,o=_.getColumn(t,3,ee),u=i.cartesianToCartographic(o,J),s=R.eastNorthUpToFixedFrame(o,i,ie),c=_.inverseTransformation(s,oe),l=e.project(u,Q),f=te;f.x=l.z,f.y=l.x,f.z=l.y,f.w=1;var h=_.getColumn(t,0,$),d=n.magnitude(h),p=_.multiplyByVector(c,h,ne);r.fromElements(p.z,p.x,p.y,0,p);var E=_.getColumn(t,1,$),y=n.magnitude(E),m=_.multiplyByVector(c,E,re);r.fromElements(m.z,m.x,m.y,0,m);var v=_.getColumn(t,2,$),T=n.magnitude(v),A=ae;return n.cross(p,m,A),n.normalize(A,A),n.cross(m,A,p),n.normalize(p,p),n.cross(A,p,m),n.normalize(m,m),n.multiplyByScalar(p,d,p),n.multiplyByScalar(m,y,m),n.multiplyByScalar(A,T,A),_.setColumn(a,0,p,a),_.setColumn(a,1,m,a),_.setColumn(a,2,A,a),_.setColumn(a,3,f,a),a};var ue=new _(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);return R.wgs84To2DModelMatrix=function(e,t,n){var r=e.ellipsoid,a=R.eastNorthUpToFixedFrame(t,r,ie),i=_.inverseTransformation(a,oe),o=r.cartesianToCartographic(t,J),u=e.project(o,Q),s=te;s.x=u.z,s.y=u.x,s.z=u.y,s.w=1;var c=_.fromTranslation(s,ie);return _.multiply(ue,i,n),_.multiply(c,n,n),n},R}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d){"use strict";function p(e,t){t=a(t,s.WGS84),e=t.scaleToGeodeticSurface(e);var r=d.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=n.fromCartesian4(l.getColumn(r,0,E)),this._yAxis=n.fromCartesian4(l.getColumn(r,1,E));var i=n.fromCartesian4(l.getColumn(r,2,E));this._plane=f.fromPointNormal(e,i)}var E=new r;o(p.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var y=new e;p.fromPoints=function(t,n){var r=e.fromPoints(t,y);return new p(r.center,n)};var m=new h,_=new n;p.prototype.projectPointOntoPlane=function(e,r){var a=m;a.origin=e,n.normalize(e,a.direction);var o=c.rayPlane(a,this._plane,_);if(i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,_)),i(o)){var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return i(r)?(r.x=s,r.y=l,r):new t(s,l)}},p.prototype.projectPointsOntoPlane=function(e,t){i(t)||(t=[]);for(var n=0,r=e.length,a=0;a<r;a++){var o=this.projectPointOntoPlane(e[a],t[n]);i(o)&&(t[n]=o,n++)}return t.length=n,t},p.prototype.projectPointToNearestOnPlane=function(e,r){i(r)||(r=new t);var a=m;a.origin=e,n.clone(this._plane.normal,a.direction);var o=c.rayPlane(a,this._plane,_);i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,_));var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return r.x=s,r.y=l,r},p.prototype.projectPointsToNearestOnPlane=function(e,t){i(t)||(t=[]);var n=e.length;t.length=n;for(var r=0;r<n;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var v=new n;return p.prototype.projectPointsOntoEllipsoid=function(e,t){var r=e.length;i(t)?t.length=r:t=new Array(r);for(var a=this._ellipsoid,o=this._origin,u=this._xAxis,s=this._yAxis,c=v,l=0;l<r;++l){var f=e[l];n.multiplyByScalar(u,f.x,c),i(t[l])||(t[l]=new n);var h=n.add(o,c,t[l]);n.multiplyByScalar(s,f.y,c),n.add(h,c,h),a.scaleToGeocentricSurface(h,h)}return t},p}),define("Core/EllipsoidGeodesic",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){var t=e._uSquared,n=e._ellipsoid.maximumRadius,r=e._ellipsoid.minimumRadius,a=(n-r)/n,i=Math.cos(e._startHeading),o=Math.sin(e._startHeading),u=(1-a)*Math.tan(e._start.latitude),s=1/Math.sqrt(1+u*u),c=s*u,l=Math.atan2(u,i),f=s*o,h=f*f,d=1-h,p=Math.sqrt(d),E=t/4,y=E*E,m=y*E,_=y*y,v=1+E-3*y/4+5*m/4-175*_/64,T=1-E+15*y/8-35*m/8,R=1-3*E+35*y/4,A=1-5*E,g=v*l-T*Math.sin(2*l)*E/2-R*Math.sin(4*l)*y/16-A*Math.sin(6*l)*m/48-5*Math.sin(8*l)*_/512,S=e._constants;S.a=n,S.b=r,S.f=a,S.cosineHeading=i,S.sineHeading=o,S.tanU=u,S.cosineU=s,S.sineU=c,S.sigma=l,S.sineAlpha=f,S.sineSquaredAlpha=h,S.cosineSquaredAlpha=d,S.cosineAlpha=p,S.u2Over4=E,S.u4Over16=y,S.u6Over64=m,S.u8Over256=_,S.a0=v,S.a1=T,S.a2=R,S.a3=A,S.distanceRatio=g}function c(e,t){return e*t*(4+e*(4-3*t))/16}function l(e,t,n,r,a,i,o){var u=c(e,n);return(1-u)*e*t*(r+u*a*(o+u*i*(2*o*o-1)))}function f(e,t,n,r,a,i,o){var s,c,f,h,d,p=(t-n)/t,E=i-r,y=Math.atan((1-p)*Math.tan(a)),m=Math.atan((1-p)*Math.tan(o)),_=Math.cos(y),v=Math.sin(y),T=Math.cos(m),R=Math.sin(m),A=_*T,g=_*R,S=v*R,N=v*T,x=E,O=u.TWO_PI,w=Math.cos(x),I=Math.sin(x);do{w=Math.cos(x),I=Math.sin(x);var M=g-N*w;f=Math.sqrt(T*T*I*I+M*M),c=S+A*w,s=Math.atan2(f,c);var C;0===f?(C=0,h=1):(C=A*I/f,h=1-C*C),O=x,d=c-2*S/h,isNaN(d)&&(d=0),x=E+l(p,C,h,s,f,c,d)}while(Math.abs(x-O)>u.EPSILON12);var P=h*(t*t-n*n)/(n*n),D=1+P*(4096+P*(P*(320-175*P)-768))/16384,U=P*(256+P*(P*(74-47*P)-128))/1024,L=d*d,b=U*f*(d+U*(c*(2*L-1)-U*d*(4*f*f-3)*(4*L-3)/6)/4),F=n*D*(s-b),z=Math.atan2(T*I,g-N*w),B=Math.atan2(_*I,g*w-N);e._distance=F,e._startHeading=z,e._endHeading=B,e._uSquared=P}function h(n,r,a,i){e.normalize(i.cartographicToCartesian(r,E),p),e.normalize(i.cartographicToCartesian(a,E),E);f(n,i.maximumRadius,i.minimumRadius,r.longitude,r.latitude,a.longitude,a.latitude),n._start=t.clone(r,n._start),n._end=t.clone(a,n._end),n._start.height=0,n._end.height=0,s(n)}function d(e,a,i){var u=n(i,o.WGS84);this._ellipsoid=u,this._start=new t,this._end=new t,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,r(e)&&r(a)&&h(this,e,a,u)}var p=new e,E=new e;return a(d.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return this._startHeading}},endHeading:{get:function(){return this._endHeading}}}),d.prototype.setEndPoints=function(e,t){h(this,e,t,this._ellipsoid)},d.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},d.prototype.interpolateUsingSurfaceDistance=function(e,n){var a=this._constants,i=a.distanceRatio+e/a.b,o=Math.cos(2*i),u=Math.cos(4*i),s=Math.cos(6*i),c=Math.sin(2*i),f=Math.sin(4*i),h=Math.sin(6*i),d=Math.sin(8*i),p=i*i,E=i*p,y=a.u8Over256,m=a.u2Over4,_=a.u6Over64,v=a.u4Over16,T=2*E*y*o/3+i*(1-m+7*v/4-15*_/4+579*y/64-(v-15*_/4+187*y/16)*o-(5*_/4-115*y/16)*u-29*y*s/16)+(m/2-v+71*_/32-85*y/16)*c+(5*v/16-5*_/4+383*y/96)*f-p*((_-11*y/2)*c+5*y*f/2)+(29*_/96-29*y/16)*h+539*y*d/1536,R=Math.asin(Math.sin(T)*a.cosineAlpha),A=Math.atan(a.a/a.b*Math.tan(R));T-=a.sigma;var g=Math.cos(2*a.sigma+T),S=Math.sin(T),N=Math.cos(T),x=a.cosineU*N,O=a.sineU*S,w=Math.atan2(S*a.sineHeading,x-O*a.cosineHeading),I=w-l(a.f,a.sineAlpha,a.cosineSquaredAlpha,T,S,N,g);return r(n)?(n.longitude=this._start.longitude+I,n.latitude=A,n.height=0,n):new t(this._start.longitude+I,A,0)},d}),define("Core/isArray",["./defined"],function(e){"use strict";var t=Array.isArray;return e(t)||(t=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),t}),define("Core/PolylinePipeline",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidGeodesic","./IntersectionTests","./isArray","./Math","./Matrix4","./Plane"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(e,t,n){var r=S;r.length=e;var a;if(t===n){for(a=0;a<e;a++)r[a]=t;return r}var i=n-t,o=i/e;for(a=0;a<e;a++){var u=t+a*o;r[a]=u}return r}function d(t,n,r,a,i,o,u,s){var c=a.scaleToGeodeticSurface(t,w),l=a.scaleToGeodeticSurface(n,I),f=p.numberOfPoints(t,n,r),d=a.cartesianToCartographic(c,N),E=a.cartesianToCartographic(l,x),y=h(f,i,o);M.setEndPoints(d,E);var m=M.surfaceDistance/f,_=s;d.height=i;var v=a.cartographicToCartesian(d,O);e.pack(v,u,_),_+=3;for(var T=1;T<f;T++){var R=M.interpolateUsingSurfaceDistance(T*m,x);R.height=y[T],v=a.cartographicToCartesian(R,O),e.pack(v,u,_),_+=3}return _}var p={};p.numberOfPoints=function(t,n,r){var a=e.distance(t,n);return Math.ceil(a/r)};var E=new t;p.extractHeights=function(e,t){for(var n=e.length,r=new Array(n),a=0;a<n;a++){var i=e[a];r[a]=t.cartesianToCartographic(i,E).height}return r};var y=new l,m=new e,_=new e,v=new f(e.ZERO,0),T=new e,R=new f(e.ZERO,0),A=new e,g=new e,S=[],N=new t,x=new t,O=new e,w=new e,I=new e,M=new o;return p.wrapLongitude=function(t,a){var i=[],o=[];if(r(t)&&t.length>0){a=n(a,l.IDENTITY);var s=l.inverseTransformation(a,y),c=l.multiplyByPoint(s,e.ZERO,m),h=l.multiplyByPointAsVector(s,e.UNIT_Y,_),d=f.fromPointNormal(c,h,v),p=l.multiplyByPointAsVector(s,e.UNIT_X,T),E=f.fromPointNormal(c,p,R),S=1; +i.push(e.clone(t[0]));for(var N=i[0],x=t.length,O=1;O<x;++O){var w=t[O];if(f.getPointDistance(E,N)<0||f.getPointDistance(E,w)<0){var I=u.lineSegmentPlane(N,w,d,A);if(r(I)){var M=e.multiplyByScalar(h,5e-9,g);f.getPointDistance(d,N)<0&&e.negate(M,M),i.push(e.add(I,M,new e)),o.push(S+1),e.negate(M,M),i.push(e.add(I,M,new e)),S=1}}i.push(e.clone(t[O])),S++,N=w}o.push(S)}return{positions:i,lengths:o}},p.generateArc=function(t){r(t)||(t={});var a=t.positions,o=a.length,u=n(t.ellipsoid,i.WGS84),l=n(t.height,0),f=s(l);if(o<1)return[];if(1===o){var h=u.scaleToGeodeticSurface(a[0],w);if(l=f?l[0]:l,0!==l){var E=u.geodeticSurfaceNormal(h,O);e.multiplyByScalar(E,l,E),e.add(h,E,h)}return[h.x,h.y,h.z]}var y=t.minDistance;if(!r(y)){var m=n(t.granularity,c.RADIANS_PER_DEGREE);y=c.chordLength(m,u.maximumRadius)}var _,v=0;for(_=0;_<o-1;_++)v+=p.numberOfPoints(a[_],a[_+1],y);var T=3*(v+1),R=new Array(T),A=0;for(_=0;_<o-1;_++){var g=a[_],x=a[_+1],I=f?l[_]:l,M=f?l[_+1]:l;A=d(g,x,y,u,I,M,R,A)}S.length=0;var C=a[o-1],P=u.cartesianToCartographic(C,N);P.height=f?l[o-1]:l;var D=u.cartographicToCartesian(P,O);return e.pack(D,R,T-3),R},p.generateCartesianArc=function(t){for(var n=p.generateArc(t),r=n.length/3,a=new Array(r),i=0;i<r;i++)a[i]=e.unpack(n,3*i);return a},p}),define("Core/PolylineVolumeGeometryLibrary",["./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./CornerType","./EllipsoidTangentPlane","./Math","./Matrix3","./Matrix4","./PolylinePipeline","./Quaternion","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(e,t){for(var n=new Array(e.length),r=0;r<e.length;r++){var a=e[r];D=t.cartesianToCartographic(a,D),n[r]=D.height,e[r]=t.scaleToGeodeticSurface(a,a)}return n}function d(e,n,r,a){var i,o=e[0],u=e[1],s=t.angleBetween(o,u),c=Math.ceil(s/a),l=new Array(c);if(n===r){for(i=0;i<c;i++)l[i]=n;return l.push(r),l}var f=r-n,h=f/c;for(i=1;i<c;i++){var d=n+i*h;l[i]=d}return l[0]=n,l.push(r),l}function p(n,r,a,o){var u=new i(a,o),s=u.projectPointOntoPlane(t.add(a,n,Y),Y),c=u.projectPointOntoPlane(t.add(a,r,k),k),l=e.angleBetween(s,c);return c.x*s.y-c.y*s.x>=0?-l:l}function E(e,n,r,a,i,o,c,l){var h=B,d=G;L=f.eastNorthUpToFixedFrame(e,i,L),h=s.multiplyByPointAsVector(L,U,h),h=t.normalize(h,h);var E=p(h,n,e,i);F=u.fromRotationZ(E,F),q.z=o,L=s.multiplyTransformation(L,s.fromRotationTranslation(F,q,b),L);var y=z;y[0]=c;for(var m=0;m<l;m++)for(var _=0;_<r.length;_+=3)d=t.fromArray(r,_,d),d=u.multiplyByVector(y,d,d),d=s.multiplyByPoint(L,d,d),a.push(d.x,d.y,d.z);return a}function y(e,n,r,a,i,o,u){for(var s=0;s<e.length;s+=3){var c=t.fromArray(e,s,W);a=E(c,n,r,a,i,o[s/3],u,1)}return a}function m(e,t){var n=e.length,r=new Array(6*n),a=0,i=t.x+t.width/2,o=t.y+t.height/2,u=e[0];r[a++]=u.x-i,r[a++]=0,r[a++]=u.y-o;for(var s=1;s<n;s++){u=e[s];var c=u.x-i,l=u.y-o;r[a++]=c,r[a++]=0,r[a++]=l,r[a++]=c,r[a++]=0,r[a++]=l}return u=e[0],r[a++]=u.x-i,r[a++]=0,r[a++]=u.y-o,r}function _(e,t){for(var n=e.length,r=new Array(3*n),a=0,i=t.x+t.width/2,o=t.y+t.height/2,u=0;u<n;u++)r[a++]=e[u].x-i,r[a++]=0,r[a++]=e[u].y-o;return r}function v(e,n,r,i,s,c,f,h,d,p){var y,m=t.angleBetween(t.subtract(n,e,M),t.subtract(r,e,C)),_=i===a.BEVELED?0:Math.ceil(m/o.toRadians(5));y=s?u.fromQuaternion(l.fromAxisAngle(t.negate(e,M),m/(_+1),V),H):u.fromQuaternion(l.fromAxisAngle(e,m/(_+1),V),H);var v,T;if(n=t.clone(n,X),_>0)for(var R=p?2:1,A=0;A<_;A++)n=u.multiplyByVector(y,n,n),v=t.subtract(n,e,M),v=t.normalize(v,v),s||(v=t.negate(v,v)),T=c.scaleToGeodeticSurface(n,C),f=E(T,v,h,f,c,d,1,R);else v=t.subtract(n,e,M),v=t.normalize(v,v),s||(v=t.negate(v,v)),T=c.scaleToGeodeticSurface(n,C),f=E(T,v,h,f,c,d,1,1),r=t.clone(r,X),v=t.subtract(r,e,M),v=t.normalize(v,v),s||(v=t.negate(v,v)),T=c.scaleToGeodeticSurface(r,C),f=E(T,v,h,f,c,d,1,1);return f}var T=[new t,new t],R=new t,A=new t,g=new t,S=new t,N=new t,x=new t,O=new t,w=new t,I=new t,M=new t,C=new t,P={},D=new r,U=new t(-1,0,0),L=new s,b=new s,F=new u,z=u.IDENTITY.clone(),B=new t,G=new n,q=new t,W=new t,V=new l,X=new t,H=new u;P.removeDuplicatesFromShape=function(t){for(var n=t.length,r=[],a=n-1,i=0;i<n;a=i++){var o=t[a],u=t[i];e.equals(o,u)||r.push(u)}return r};var Y=new t,k=new t;P.angleIsGreaterThanPi=function(e,n,r,a){var o=new i(r,a),u=o.projectPointOntoPlane(t.add(r,e,Y),Y),s=o.projectPointOntoPlane(t.add(r,n,k),k);return s.x*u.y-s.y*u.x>=0};var Z=new t,j=new t;return P.computePositions=function(e,n,r,i,u){var s=i._ellipsoid,l=h(e,s),f=i._granularity,p=i._cornerType,C=u?m(n,r):_(n,r),D=u?_(n,r):void 0,U=r.height/2,L=r.width/2,b=e.length,F=[],z=u?[]:void 0,B=R,G=A,q=g,W=S,V=N,X=x,H=O,Y=w,k=I,K=e[0],J=e[1];W=s.geodeticSurfaceNormal(K,W),B=t.subtract(J,K,B),B=t.normalize(B,B),Y=t.cross(W,B,Y),Y=t.normalize(Y,Y);var Q=l[0],$=l[1];u&&(z=E(K,Y,D,z,s,Q+U,1,1)),k=t.clone(K,k),K=J,G=t.negate(B,G);for(var ee,te,ne=1;ne<b-1;ne++){var re=u?2:1;J=e[ne+1],B=t.subtract(J,K,B),B=t.normalize(B,B),q=t.add(B,G,q),q=t.normalize(q,q),W=s.geodeticSurfaceNormal(K,W);var ae=t.multiplyByScalar(W,t.dot(B,W),Z);t.subtract(B,ae,ae),t.normalize(ae,ae);var ie=t.multiplyByScalar(W,t.dot(G,W),j);t.subtract(G,ie,ie),t.normalize(ie,ie);var oe=!o.equalsEpsilon(Math.abs(t.dot(ae,ie)),1,o.EPSILON7);if(oe){q=t.cross(q,W,q),q=t.cross(W,q,q),q=t.normalize(q,q);var ue=1/Math.max(.25,t.magnitude(t.cross(q,G,M))),se=P.angleIsGreaterThanPi(B,G,K,s);se?(V=t.add(K,t.multiplyByScalar(q,ue*L,q),V),X=t.add(V,t.multiplyByScalar(Y,L,X),X),T[0]=t.clone(k,T[0]),T[1]=t.clone(X,T[1]),ee=d(T,Q+U,$+U,f),te=c.generateArc({positions:T,granularity:f,ellipsoid:s}),F=y(te,Y,C,F,s,ee,1),Y=t.cross(W,B,Y),Y=t.normalize(Y,Y),H=t.add(V,t.multiplyByScalar(Y,L,H),H),p===a.ROUNDED||p===a.BEVELED?v(V,X,H,p,se,s,F,C,$+U,u):(q=t.negate(q,q),F=E(K,q,C,F,s,$+U,ue,re)),k=t.clone(H,k)):(V=t.add(K,t.multiplyByScalar(q,ue*L,q),V),X=t.add(V,t.multiplyByScalar(Y,-L,X),X),T[0]=t.clone(k,T[0]),T[1]=t.clone(X,T[1]),ee=d(T,Q+U,$+U,f),te=c.generateArc({positions:T,granularity:f,ellipsoid:s}),F=y(te,Y,C,F,s,ee,1),Y=t.cross(W,B,Y),Y=t.normalize(Y,Y),H=t.add(V,t.multiplyByScalar(Y,-L,H),H),p===a.ROUNDED||p===a.BEVELED?v(V,X,H,p,se,s,F,C,$+U,u):F=E(K,q,C,F,s,$+U,ue,re),k=t.clone(H,k)),G=t.negate(B,G)}else F=E(k,Y,C,F,s,Q+U,1,1),k=K;Q=$,$=l[ne+1],K=J}T[0]=t.clone(k,T[0]),T[1]=t.clone(K,T[1]),ee=d(T,Q+U,$+U,f),te=c.generateArc({positions:T,granularity:f,ellipsoid:s}),F=y(te,Y,C,F,s,ee,1),u&&(z=E(K,Y,D,z,s,$+U,1,1)),b=F.length;var ce=u?b+z.length:b,le=new Float64Array(ce);return le.set(F),u&&le.set(z,b),le},P}),define("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.position=e(t.position,!1),this.normal=e(t.normal,!1),this.st=e(t.st,!1),this.bitangent=e(t.bitangent,!1),this.tangent=e(t.tangent,!1),this.color=e(t.color,!1)}return a.POSITION_ONLY=r(new a({position:!0})),a.POSITION_AND_NORMAL=r(new a({position:!0,normal:!0})),a.POSITION_NORMAL_AND_ST=r(new a({position:!0,normal:!0,st:!0})),a.POSITION_AND_ST=r(new a({position:!0,st:!0})),a.POSITION_AND_COLOR=r(new a({position:!0,color:!0})),a.ALL=r(new a({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0})),a.DEFAULT=a.POSITION_NORMAL_AND_ST,a.packedLength=6,a.pack=function(t,n,r){return r=e(r,0),n[r++]=t.position?1:0,n[r++]=t.normal?1:0,n[r++]=t.st?1:0,n[r++]=t.tangent?1:0,n[r++]=t.bitangent?1:0,n[r++]=t.color?1:0,n},a.unpack=function(n,r,i){return r=e(r,0),t(i)||(i=new a),i.position=1===n[r++],i.normal=1===n[r++],i.st=1===n[r++],i.tangent=1===n[r++],i.bitangent=1===n[r++],i.color=1===n[r++],i},a.clone=function(e,n){if(t(e))return t(n)||(n=new a),n.position=e.position,n.normal=e.normal,n.st=e.st,n.tangent=e.tangent,n.bitangent=e.bitangent,n.color=e.color,n},a}),define("Core/PolylineVolumeGeometry",["./arrayRemoveDuplicates","./BoundingRectangle","./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./CornerType","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryPipeline","./IndexDatatype","./Math","./oneTimeWarning","./PolygonPipeline","./PolylineVolumeGeometryLibrary","./PrimitiveType","./VertexFormat","./WindingOrder"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,p,E,y,m,_,v,T,R,A){"use strict";function g(e,t,r,a){var o=new d;a.position&&(o.position=new h({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:e}));var u,s,c,l,y,v,R=t.length,A=e.length/3,g=(A-2*R)/(2*R),S=_.triangulate(t),N=(g-1)*R*6+2*S.length,x=E.createTypedArray(A,N),O=2*R,w=0;for(u=0;u<g-1;u++){for(s=0;s<R-1;s++)c=2*s+u*R*2,v=c+O,l=c+1,y=l+O,x[w++]=l,x[w++]=c,x[w++]=y,x[w++]=y,x[w++]=c,x[w++]=v;c=2*R-2+u*R*2,l=c+1,y=l+O,v=c+O,x[w++]=l,x[w++]=c,x[w++]=y,x[w++]=y,x[w++]=c,x[w++]=v}if(a.st||a.tangent||a.bitangent){var I,M,C=new Float32Array(2*A),P=1/(g-1),D=1/r.height,U=r.height/2,L=0;for(u=0;u<g;u++){for(I=u*P,M=D*(t[0].y+U),C[L++]=I,C[L++]=M,s=1;s<R;s++)M=D*(t[s].y+U),C[L++]=I,C[L++]=M,C[L++]=I,C[L++]=M;M=D*(t[0].y+U),C[L++]=I,C[L++]=M}for(s=0;s<R;s++)I=0,M=D*(t[s].y+U),C[L++]=I,C[L++]=M;for(s=0;s<R;s++)I=(g-1)*P,M=D*(t[s].y+U),C[L++]=I,C[L++]=M;o.st=new h({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:new Float32Array(C)})}var b=A-2*R;for(u=0;u<S.length;u+=3){var F=S[u]+b,z=S[u+1]+b,B=S[u+2]+b;x[w++]=F,x[w++]=z,x[w++]=B,x[w++]=B+R,x[w++]=z+R,x[w++]=F+R}var G=new f({attributes:o,indices:x,boundingSphere:n.fromVertices(e),primitiveType:T.TRIANGLES});if(a.normal&&(G=p.computeNormal(G)),a.tangent||a.bitangent){try{G=p.computeTangentAndBitangent(G)}catch(e){m("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}a.tangent||(G.attributes.tangent=void 0),a.bitangent||(G.attributes.bitangent=void 0),a.st||(G.attributes.st=void 0)}return G}function S(e){e=u(e,u.EMPTY_OBJECT);var t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=l.clone(u(e.ellipsoid,l.WGS84)),this._cornerType=u(e.cornerType,o.ROUNDED),this._vertexFormat=R.clone(u(e.vertexFormat,R.DEFAULT)),this._granularity=u(e.granularity,y.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeGeometry";var i=1+t.length*a.packedLength;i+=1+n.length*r.packedLength,this.packedLength=i+l.packedLength+R.packedLength+2}S.pack=function(e,t,n){n=u(n,0);var i,o=e._positions,s=o.length;for(t[n++]=s,i=0;i<s;++i,n+=a.packedLength)a.pack(o[i],t,n);var c=e._shape;for(s=c.length,t[n++]=s,i=0;i<s;++i,n+=r.packedLength)r.pack(c[i],t,n);return l.pack(e._ellipsoid,t,n),n+=l.packedLength,R.pack(e._vertexFormat,t,n),n+=R.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var N=l.clone(l.UNIT_SPHERE),x=new R,O={polylinePositions:void 0,shapePositions:void 0,ellipsoid:N,vertexFormat:x,cornerType:void 0,granularity:void 0};S.unpack=function(e,t,n){t=u(t,0);var i,o=e[t++],c=new Array(o);for(i=0;i<o;++i,t+=a.packedLength)c[i]=a.unpack(e,t);o=e[t++];var f=new Array(o);for(i=0;i<o;++i,t+=r.packedLength)f[i]=r.unpack(e,t);var h=l.unpack(e,t,N);t+=l.packedLength;var d=R.unpack(e,t,x);t+=R.packedLength;var p=e[t++],E=e[t];return s(n)?(n._positions=c,n._shape=f,n._ellipsoid=l.clone(h,n._ellipsoid),n._vertexFormat=R.clone(d,n._vertexFormat),n._cornerType=p,n._granularity=E,n):(O.polylinePositions=c,O.shapePositions=f,O.cornerType=p,O.granularity=E,new S(O))};var w=new t;return S.createGeometry=function(n){var r=n._positions,i=e(r,a.equalsEpsilon),o=n._shape;if(o=v.removeDuplicatesFromShape(o),!(i.length<2||o.length<3)){_.computeWindingOrder2D(o)===A.CLOCKWISE&&o.reverse();var u=t.fromPoints(o,w),s=v.computePositions(i,o,u,n,!0);return g(s,o,u,n._vertexFormat)}},S}),define("Workers/createPolylineVolumeGeometry",["../Core/defined","../Core/Ellipsoid","../Core/PolylineVolumeGeometry"],function(e,t,n){"use strict";function r(r,a){return e(a)&&(r=n.unpack(r,a)),r._ellipsoid=t.clone(r._ellipsoid),n.createGeometry(r)}return r})}(); \ No newline at end of file diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createPolylineVolumeOutlineGeometry.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createPolylineVolumeOutlineGeometry.js index e77e6544..eee2aa65 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createPolylineVolumeOutlineGeometry.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createPolylineVolumeOutlineGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -222,9 +222,9 @@ OTHER DEALINGS IN THE SOFTWARE. * */ -!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==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";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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("Core/isArray",["./defined"],function(e){"use strict";var t=Array.isArray;return e(t)||(t=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),t}),define("Core/Check",["./defaultValue","./defined","./DeveloperError","./isArray"],function(e,t,n,r){"use strict";function a(e){return e+" was required but undefined."}function i(e,t,n){return"Expected "+n+" to be typeof "+t+", got "+e}var o={};return o.typeOf={},o.numeric={},o.defined=function(e,r){if(!t(e))throw new n(a(r))},o.numeric.maximum=function(e,t){if(o.typeOf.number(e),o.typeOf.number(t),e>t)throw new n("Expected "+e+" to be at most "+t)},o.numeric.minimum=function(e,t){if(o.typeOf.number(e),o.typeOf.number(t),e<t)throw new n("Expected "+e+" to be at least "+t)},o.typeOf.function=function(e,t){if("function"!=typeof e)throw new n(i(typeof e,"function",t))},o.typeOf.string=function(e,t){if("string"!=typeof e)throw new n(i(typeof e,"string",t))},o.typeOf.number=function(e,t){if("number"!=typeof e)throw new n(i(typeof e,"number",t))},o.typeOf.object=function(e,t){if("object"!=typeof e)throw new n(i(typeof e,"object",t))},o.typeOf.boolean=function(e,t){if("boolean"!=typeof e)throw new n(i(typeof e,"boolean",t))},o}),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 n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(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^=e<<7&2636928640,e^=e<<15&4022730752,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,n,r){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:e<0?-1:0},a.signNotZero=function(e){return e<0?-1:1},a.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*a.clamp(e,-1,1)+.5)*n)},a.fromSNorm=function(e,n){return n=t(n,255),a.clamp(e,0,n)/n*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},a.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},a.lerp=function(e,t,n){return(1-n)*e+n*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){var t=a.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},a.clampToLatitudeRange=function(e){return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){return(e%t+t)%t},a.equalsEpsilon=function(e,n,r,a){a=t(a,r);var i=Math.abs(e-n);return i<=a||i<=r*Math.max(Math.abs(e),Math.abs(n))};var i=[1];a.factorial=function(e){var t=i.length;if(e>=t)for(var n=i[t-1],r=t;r<=e;r++)i.push(n*r);return i[e]},a.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},a.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return a.setRandomNumberSeed=function(t){o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(e){return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){return Math.log(e)/Math.log(t)},a.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var a=e.clock,i=e.cone,u=t(e.magnitude,1),s=u*Math.sin(i);return r.x=s*Math.cos(a),r.y=s*Math.sin(a),r.z=u*Math.cos(i),r},o.fromElements=function(e,t,r,a){return n(a)?(a.x=e,a.y=t,a.z=r,a):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var a=0;a<r;++a)o.pack(e[a],t,3*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var a=0;a<r;a+=3){var i=a/3;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,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};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var n=o.dot(c,l),r=o.magnitude(o.cross(c,l,c));return Math.atan2(r,n)};var f=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)},o.cross=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=t.x,u=t.y,s=t.z,c=a*s-i*u,l=i*o-r*s,f=r*u-a*o;return n.x=c,n.y=l,n.z=f,n},o.fromDegrees=function(e,t,n,r,a){return e=i.toRadians(e),t=i.toRadians(t),o.fromRadians(e,t,n,r,a)};var h=new o,d=new o,E=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,a,i,u){a=t(a,0);var s=n(i)?i.radiiSquared:E,c=Math.cos(r);h.x=c*Math.cos(e),h.y=c*Math.sin(e),h.z=Math.sin(r),h=o.normalize(h,h),o.multiplyComponents(s,h,d);var l=Math.sqrt(o.dot(h,d));return d=o.divideByScalar(d,l,d),h=o.multiplyByScalar(h,a,h),n(u)||(u=new o),o.add(d,h,u)},o.fromDegreesArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromDegrees(u,s,0,t,r[c])}return r},o.fromRadiansArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromRadians(u,s,0,t,r[c])}return r},o.fromDegreesArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromDegrees(u,s,c,t,r[l])}return r},o.fromRadiansArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromRadians(u,s,c,t,r[l])}return r},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(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,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(n,a,u,s,c){var l=n.x,f=n.y,h=n.z,d=a.x,E=a.y,p=a.z,_=l*l*d*d,m=f*f*E*E,y=h*h*p*p,T=_+m+y,R=Math.sqrt(1/T),A=e.multiplyByScalar(n,R,i);if(T<s)return isFinite(R)?e.clone(A,c):void 0;var S=u.x,v=u.y,N=u.z,g=o;g.x=A.x*S*2,g.y=A.y*v*2,g.z=A.z*N*2;var I,M,O,x,w,C,P,U,D,L,F,z=(1-R)*e.magnitude(n)/(.5*e.magnitude(g)),B=0;do{z-=B,O=1/(1+z*S),x=1/(1+z*v),w=1/(1+z*N),C=O*O,P=x*x,U=w*w,D=C*O,L=P*x,F=U*w,I=_*C+m*P+y*U-1,M=_*D*S+m*L*v+y*F*N;var b=-2*M;B=I/b}while(Math.abs(I)>r.EPSILON12);return t(c)?(c.x=l*O,c.y=f*x,c.z=h*w,c):new e(l*O,f*x,h*w)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o){"use strict";function u(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)}u.fromRadians=function(e,r,a,i){return a=t(a,0),n(i)?(i.longitude=e,i.latitude=r,i.height=a,i):new u(e,r,a)},u.fromDegrees=function(e,t,n,r){return e=i.toRadians(e),t=i.toRadians(t),u.fromRadians(e,t,n,r)};var s=new e,c=new e,l=new e,f=new e(1/6378137,1/6378137,1/6356752.314245179),h=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),d=i.EPSILON1;return u.fromCartesian=function(t,r,a){var E=n(r)?r.oneOverRadii:f,p=n(r)?r.oneOverRadiiSquared:h,_=n(r)?r._centerToleranceSquared:d,m=o(t,E,p,_,c);if(n(m)){var y=e.multiplyComponents(m,p,s);y=e.normalize(y,y);var T=e.subtract(t,m,l),R=Math.atan2(y.y,y.x),A=Math.asin(y.z),S=i.sign(e.dot(T,t))*e.magnitude(T);return n(a)?(a.longitude=R,a.latitude=A,a.height=S,a):new u(R,A,S)}},u.clone=function(e,t){if(n(e))return n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},u.ZERO=a(new u(0,0,0)),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,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(t,r,a,i){r=n(r,0),a=n(a,0),i=n(i,0),t._radii=new e(r,a,i),t._radiiSquared=new e(r*r,a*a,i*i),t._radiiToTheFourth=new e(r*r*r*r,a*a*a*a,i*i*i*i),t._oneOverRadii=new e(0===r?0:1/r,0===a?0:1/a,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===a?0:1/(a*a),0===i?0:1/(i*i)),t._minimumRadius=Math.min(r,a,i),t._maximumRadius=Math.max(r,a,i),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,c(this,e,t,n)}a(l.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}}}),l.clone=function(t,n){if(r(t)){var a=t._radii;return r(n)?(e.clone(a,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new l(a.x,a.y,a.z)}},l.fromCartesian3=function(e,t){return r(t)||(t=new l),r(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,r,a){return a=n(a,0),e.pack(t._radii,r,a),r},l.unpack=function(t,r,a){r=n(r,0);var i=e.unpack(t,r);return l.fromCartesian3(i,a)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,n){var a=t.longitude,i=t.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return r(n)||(n=new e),n.x=u,n.y=s,n.z=c,e.normalize(n,n)},l.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var f=new e,h=new e;l.prototype.cartographicToCartesian=function(t,n){var a=f,i=h;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(e.dot(a,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(a,t.height,a),r(n)||(n=new e),e.add(i,a,n)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var d=new e,E=new e,p=new e;return l.prototype.cartesianToCartographic=function(n,a){var i=this.scaleToGeodeticSurface(n,E);if(r(i)){var o=this.geodeticSurfaceNormal(i,d),s=e.subtract(n,i,p),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),f=u.sign(e.dot(s,n))*e.magnitude(s);return r(a)?(a.longitude=c,a.latitude=l,a.height=f,a):new t(c,l,f)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var a=t.x,i=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return e.multiplyByScalar(t,s,n)},l.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},l.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},l.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,a,i){a=n(a,0);var o=this._sqauredXOverSquaredZ;if(r(i)||(i=new e),i.x=0,i.y=0,i.z=t.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},l}),define("Core/arrayRemoveDuplicates",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(n,r,a){if(t(n)){a=e(a,!1);var o=n.length;if(o<2)return n;var u,s,c;for(u=1;u<o&&(s=n[u-1],c=n[u],!r(s,c,i));++u);if(u===o)return a&&r(n[0],n[n.length-1],i)?n.slice(1):n;for(var l=n.slice(0,u);u<o;++u)c=n[u],r(s,c,i)||(l.push(c),s=c);return a&&l.length>1&&r(l[0],l[l.length-1],i)&&l.shift(),l}}var i=r.EPSILON10;return a}),define("Core/Cartesian2",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a){"use strict";function i(t,n){this.x=e(t,0),this.y=e(n,0)}i.fromElements=function(e,n,r){return t(r)?(r.x=e,r.y=n,r):new i(e,n)},i.clone=function(e,n){if(t(e))return t(n)?(n.x=e.x,n.y=e.y,n):new i(e.x,e.y)},i.fromCartesian3=i.clone,i.fromCartesian4=i.clone,i.packedLength=2,i.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r]=t.y,n},i.unpack=function(n,r,a){return r=e(r,0),t(a)||(a=new i),a.x=n[r++],a.y=n[r],a},i.packArray=function(e,n){var r=e.length;t(n)?n.length=2*r:n=new Array(2*r);for(var a=0;a<r;++a)i.pack(e[a],n,2*a);return n},i.unpackArray=function(e,n){var r=e.length;t(n)?n.length=r/2:n=new Array(r/2);for(var a=0;a<r;a+=2){var o=a/2;n[o]=i.unpack(e,a,n[o])}return n},i.fromArray=i.unpack,i.maximumComponent=function(e){return Math.max(e.x,e.y)},i.minimumComponent=function(e){return Math.min(e.x,e.y)},i.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},i.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},i.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},i.magnitude=function(e){return Math.sqrt(i.magnitudeSquared(e))};var o=new i;i.distance=function(e,t){return i.subtract(e,t,o),i.magnitude(o)},i.distanceSquared=function(e,t){return i.subtract(e,t,o),i.magnitudeSquared(o)},i.normalize=function(e,t){var n=i.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t},i.dot=function(e,t){return e.x*t.x+e.y*t.y},i.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n},i.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n},i.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n},i.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n},i.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n},i.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n},i.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},i.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var u=new i;i.lerp=function(e,t,n,r){return i.multiplyByScalar(t,n,u),r=i.multiplyByScalar(e,1-n,r),i.add(u,r,r)};var s=new i,c=new i;i.angleBetween=function(e,t){return i.normalize(e,s),i.normalize(t,c),a.acosClamped(i.dot(s,c))};var l=new i;return i.mostOrthogonalAxis=function(e,t){var n=i.normalize(e,l);return i.abs(n,n),t=n.x<=n.y?i.clone(i.UNIT_X,t):i.clone(i.UNIT_Y,t)},i.equals=function(e,n){return e===n||t(e)&&t(n)&&e.x===n.x&&e.y===n.y},i.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},i.equalsEpsilon=function(e,n,r,i){return e===n||t(e)&&t(n)&&a.equalsEpsilon(e.x,n.x,r,i)&&a.equalsEpsilon(e.y,n.y,r,i)},i.ZERO=r(new i(0,0)),i.UNIT_X=r(new i(1,0)),i.UNIT_Y=r(new i(0,1)),i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i.prototype.equalsEpsilon=function(e,t,n){return i.equalsEpsilon(this,e,t,n)},i.prototype.toString=function(){return"("+this.x+", "+this.y+")"},i}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,a,i,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return r(n)?(n.x=i,n.y=o,n.z=u,n):new e(i,o,u)},u.prototype.unproject=function(e,n){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,u=e.z;return r(n)?(n.longitude=i,n.latitude=o,n.height=u,n):new t(i,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/Rectangle",["./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,n,r,a){this.west=t(e,0),this.south=t(n,0),this.east=t(r,0),this.north=t(a,0)}r(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,n,r){return r=t(r,0),n[r++]=e.west,n[r++]=e.south,n[r++]=e.east,n[r]=e.north,n},s.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new s),a.west=e[r++],a.south=e[r++],a.east=e[r++],a.north=e[r],a},s.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=u.TWO_PI),t-n},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,r,a,i,o){return e=u.toRadians(t(e,0)),r=u.toRadians(t(r,0)),a=u.toRadians(t(a,0)),i=u.toRadians(t(i,0)),n(o)?(o.west=e,o.south=r,o.east=a,o.north=i,o):new s(e,r,a,i)},s.fromCartographicArray=function(e,t){for(var r=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE,f=0,h=e.length;f<h;f++){var d=e[f];r=Math.min(r,d.longitude),a=Math.max(a,d.longitude),c=Math.min(c,d.latitude),l=Math.max(l,d.latitude);var E=d.longitude>=0?d.longitude:d.longitude+u.TWO_PI;i=Math.min(i,E),o=Math.max(o,E)}return a-r>o-i&&(r=i,a=o,a>u.PI&&(a-=u.TWO_PI),r>u.PI&&(r-=u.TWO_PI)),n(t)?(t.west=r,t.south=c,t.east=a,t.north=l,t):new s(r,c,a,l)},s.fromCartesianArray=function(e,t,r){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=Number.MAX_VALUE,f=-Number.MAX_VALUE,h=0,d=e.length;h<d;h++){var E=t.cartesianToCartographic(e[h]);a=Math.min(a,E.longitude),i=Math.max(i,E.longitude),l=Math.min(l,E.latitude),f=Math.max(f,E.latitude);var p=E.longitude>=0?E.longitude:E.longitude+u.TWO_PI;o=Math.min(o,p),c=Math.max(c,p)}return i-a>c-o&&(a=o,i=c,i>u.PI&&(i-=u.TWO_PI),a>u.PI&&(a-=u.TWO_PI)),n(r)?(r.west=a,r.south=l,r.east=i,r.north=f,r):new s(a,l,i,f)},s.clone=function(e,t){if(n(e))return n(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,t){return e===t||n(e)&&n(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},s.prototype.equalsEpsilon=function(e,t){return n(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},s.validate=function(e){},s.southwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.south,r.height=0,r):new e(t.west,t.south)},s.northwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.north,r.height=0,r):new e(t.west,t.north)},s.northeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.north,r.height=0,r):new e(t.east,t.north)},s.southeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.south,r.height=0,r):new e(t.east,t.south)},s.center=function(t,r){var a=t.east,i=t.west;a<i&&(a+=u.TWO_PI);var o=u.negativePiToPi(.5*(i+a)),s=.5*(t.south+t.north);return n(r)?(r.longitude=o,r.latitude=s,r.height=0,r):new e(o,s)},s.intersection=function(e,t,r){var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.negativePiToPi(Math.max(i,c)),f=u.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&f<=l)){var h=Math.max(e.south,t.south),d=Math.min(e.north,t.north);if(!(h>=d))return n(r)?(r.west=l,r.south=h,r.east=f,r.north=d,r):new s(l,h,f,d)}},s.simpleIntersection=function(e,t,r){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(i>=u||a>=o))return n(r)?(r.west=a,r.south=i,r.east=o,r.north=u,r):new s(a,i,o,u)},s.union=function(e,t,r){n(r)||(r=new s);var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.convertLongitudeRange(Math.min(i,c)),f=u.convertLongitudeRange(Math.max(a,o));return r.west=l,r.south=Math.min(e.south,t.south),r.east=f,r.north=Math.max(e.north,t.north),r},s.expand=function(e,t,r){return n(r)||(r=new s),r.west=Math.min(e.west,t.longitude),r.south=Math.min(e.south,t.latitude),r.east=Math.max(e.east,t.longitude),r.north=Math.max(e.north,t.latitude),r},s.contains=function(e,t){var n=t.longitude,r=t.latitude,a=e.west,i=e.east;return i<a&&(i+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>a||u.equalsEpsilon(n,a,u.EPSILON14))&&(n<i||u.equalsEpsilon(n,i,u.EPSILON14))&&r>=e.south&&r<=e.north};var c=new e;return s.subsample=function(e,r,a,o){r=t(r,i.WGS84),a=t(a,0),n(o)||(o=[]);var l=0,f=e.north,h=e.south,d=e.east,E=e.west,p=c;p.height=a,p.longitude=E,p.latitude=f,o[l]=r.cartographicToCartesian(p,o[l]),l++,p.longitude=d,o[l]=r.cartographicToCartesian(p,o[l]),l++,p.latitude=h,o[l]=r.cartographicToCartesian(p,o[l]),l++,p.longitude=E,o[l]=r.cartographicToCartesian(p,o[l]),l++,f<0?p.latitude=f:h>0?p.latitude=h:p.latitude=0;for(var _=1;_<8;++_)p.longitude=-Math.PI+_*u.PI_OVER_TWO,s.contains(e,p)&&(o[l]=r.cartographicToCartesian(p,o[l]),l++);return 0===p.latitude&&(p.longitude=E,o[l]=r.cartographicToCartesian(p,o[l]),l++,p.longitude=d,o[l]=r.cartographicToCartesian(p,o[l]),l++),o.length=l,o},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingRectangle",["./Cartesian2","./Cartographic","./defaultValue","./defined","./DeveloperError","./GeographicProjection","./Intersect","./Rectangle"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a){this.x=n(e,0),this.y=n(t,0),this.width=n(r,0),this.height=n(a,0)}s.packedLength=4,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e.x,t[r++]=e.y,t[r++]=e.width,t[r]=e.height,t},s.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a.x=e[t++],a.y=e[t++],a.width=e[t++],a.height=e[t],a},s.fromPoints=function(e,t){if(r(t)||(t=new s),!r(e)||0===e.length)return t.x=0,t.y=0,t.width=0,t.height=0,t;for(var n=e.length,a=e[0].x,i=e[0].y,o=e[0].x,u=e[0].y,c=1;c<n;c++){var l=e[c],f=l.x,h=l.y;a=Math.min(f,a),o=Math.max(f,o),i=Math.min(h,i),u=Math.max(h,u)}return t.x=a,t.y=i,t.width=o-a,t.height=u-i,t};var c=new i,l=new t,f=new t;return s.fromRectangle=function(t,a,i){if(r(i)||(i=new s),!r(t))return i.x=0,i.y=0,i.width=0,i.height=0,i;a=n(a,c);var o=a.project(u.southwest(t,l)),h=a.project(u.northeast(t,f));return e.subtract(h,o,h),i.x=o.x,i.y=o.y,i.width=h.x,i.height=h.y,i},s.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t):new s(e.x,e.y,e.width,e.height)},s.union=function(e,t,n){r(n)||(n=new s);var a=Math.min(e.x,t.x),i=Math.min(e.y,t.y),o=Math.max(e.x+e.width,t.x+t.width),u=Math.max(e.y+e.height,t.y+t.height);return n.x=a,n.y=i,n.width=o-a,n.height=u-i,n},s.expand=function(e,t,n){n=s.clone(e,n);var r=t.x-n.x,a=t.y-n.y;return r>n.width?n.width=r:r<0&&(n.width-=r,n.x=t.x),a>n.height?n.height=a:a<0&&(n.height-=a,n.y=t.y),n},s.intersect=function(e,t){var n=e.x,r=e.y,a=t.x,i=t.y;return n>a+t.width||n+e.width<a||r+e.height<i||r>i+t.height?o.OUTSIDE:o.INTERSECTING},s.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.intersect=function(e){return s.intersect(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i,o){"use strict";function u(e,n,r,a,i,o,u,s,c){this[0]=t(e,0),this[1]=t(a,0),this[2]=t(u,0),this[3]=t(n,0),this[4]=t(i,0),this[5]=t(s,0),this[6]=t(r,0),this[7]=t(o,0),this[8]=t(c,0)}function s(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function c(e){for(var t=0,n=0;n<3;++n){var r=e[u.getElementIndex(E[n],d[n])];t+=2*r*r}return Math.sqrt(t)}function l(e,t){for(var n=o.EPSILON15,r=0,a=1,i=0;i<3;++i){var s=Math.abs(e[u.getElementIndex(E[i],d[i])]);s>r&&(a=i,r=s)}var c=1,l=0,f=d[a],h=E[a];if(Math.abs(e[u.getElementIndex(h,f)])>n){var p,_=e[u.getElementIndex(h,h)],m=e[u.getElementIndex(f,f)],y=e[u.getElementIndex(h,f)],T=(_-m)/2/y;p=T<0?-1/(-T+Math.sqrt(1+T*T)):1/(T+Math.sqrt(1+T*T)),c=1/Math.sqrt(1+p*p),l=p*c}return t=u.clone(u.IDENTITY,t),t[u.getElementIndex(f,f)]=t[u.getElementIndex(h,h)]=c,t[u.getElementIndex(h,f)]=l,t[u.getElementIndex(f,h)]=-l,t}u.packedLength=9,u.pack=function(e,n,r){return r=t(r,0),n[r++]=e[0],n[r++]=e[1],n[r++]=e[2],n[r++]=e[3],n[r++]=e[4],n[r++]=e[5],n[r++]=e[6],n[r++]=e[7],n[r++]=e[8],n},u.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new u),a[0]=e[r++],a[1]=e[r++],a[2]=e[r++],a[3]=e[r++],a[4]=e[r++],a[5]=e[r++],a[6]=e[r++],a[7]=e[r++],a[8]=e[r++],a},u.clone=function(e,t){if(n(e))return n(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 u(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},u.fromArray=function(e,r,a){return r=t(r,0),n(a)||(a=new u),a[0]=e[r],a[1]=e[r+1],a[2]=e[r+2],a[3]=e[r+3],a[4]=e[r+4],a[5]=e[r+5],a[6]=e[r+6],a[7]=e[r+7],a[8]=e[r+8],a},u.fromColumnMajorArray=function(e,t){return u.clone(e,t); -},u.fromRowMajorArray=function(e,t){return n(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 u(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},u.fromQuaternion=function(e,t){var r=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,s=e.y*e.y,c=e.y*e.z,l=e.y*e.w,f=e.z*e.z,h=e.z*e.w,d=e.w*e.w,E=r-s-f+d,p=2*(a-h),_=2*(i+l),m=2*(a+h),y=-r+s-f+d,T=2*(c-o),R=2*(i-l),A=2*(c+o),S=-r-s+f+d;return n(t)?(t[0]=E,t[1]=m,t[2]=R,t[3]=p,t[4]=y,t[5]=A,t[6]=_,t[7]=T,t[8]=S,t):new u(E,p,_,m,y,T,R,A,S)},u.fromHeadingPitchRoll=function(e,t){var r=Math.cos(-e.pitch),a=Math.cos(-e.heading),i=Math.cos(e.roll),o=Math.sin(-e.pitch),s=Math.sin(-e.heading),c=Math.sin(e.roll),l=r*a,f=-i*s+c*o*a,h=c*s+i*o*a,d=r*s,E=i*a+c*o*s,p=-o*i+i*o*s,_=-o,m=c*r,y=i*r;return n(t)?(t[0]=l,t[1]=d,t[2]=_,t[3]=f,t[4]=E,t[5]=m,t[6]=h,t[7]=p,t[8]=y,t):new u(l,f,h,d,E,p,_,m,y)},u.fromScale=function(e,t){return n(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 u(e.x,0,0,0,e.y,0,0,0,e.z)},u.fromUniformScale=function(e,t){return n(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 u(e,0,0,0,e,0,0,0,e)},u.fromCrossProduct=function(e,t){return n(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 u(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},u.fromRotationX=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=r,t[5]=a,t[6]=0,t[7]=-a,t[8]=r,t):new u(1,0,0,0,r,-a,0,a,r)},u.fromRotationY=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=r,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=r,t):new u(r,0,a,0,1,0,-a,0,r)},u.fromRotationZ=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=r,t[1]=a,t[2]=0,t[3]=-a,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new u(r,-a,0,a,r,0,0,0,1)},u.toArray=function(e,t){return n(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]]},u.getElementIndex=function(e,t){return 3*e+t},u.getColumn=function(e,t,n){var r=3*t,a=e[r],i=e[r+1],o=e[r+2];return n.x=a,n.y=i,n.z=o,n},u.setColumn=function(e,t,n,r){r=u.clone(e,r);var a=3*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},u.getRow=function(e,t,n){var r=e[t],a=e[t+3],i=e[t+6];return n.x=r,n.y=a,n.z=i,n},u.setRow=function(e,t,n,r){return r=u.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var f=new e;u.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],f)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],f)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],f)),n};var h=new e;u.getMaximumScale=function(t){return u.getScale(t,h),e.maximumComponent(h)},u.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=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 n[0]=r,n[1]=a,n[2]=i,n[3]=o,n[4]=u,n[5]=s,n[6]=c,n[7]=l,n[8]=f,n},u.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},u.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},u.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[3]*a+e[6]*i,u=e[1]*r+e[4]*a+e[7]*i,s=e[2]*r+e[5]*a+e[8]*i;return n.x=o,n.y=u,n.z=s,n},u.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},u.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},u.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},u.transpose=function(e,t){var n=e[0],r=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=n,t[1]=r,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var d=[1,0,0],E=[2,2,1],p=new u,_=new u;return u.computeEigenDecomposition=function(e,t){var r=o.EPSILON20,a=10,i=0,f=0;n(t)||(t={});for(var h=t.unitary=u.clone(u.IDENTITY,t.unitary),d=t.diagonal=u.clone(e,t.diagonal),E=r*s(d);f<a&&c(d)>E;)l(d,p),u.transpose(p,_),u.multiply(d,p,d),u.multiply(_,d,d),u.multiply(h,p,h),++i>2&&(++f,i=0);return t},u.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},u.determinant=function(e){var t=e[0],n=e[3],r=e[6],a=e[1],i=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*o)+a*(s*r-n*c)+u*(n*o-i*r)},u.inverse=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[3],o=e[4],s=e[5],c=e[6],l=e[7],f=e[8],h=u.determinant(e);t[0]=o*f-l*s,t[1]=l*a-r*f,t[2]=r*s-o*a,t[3]=c*s-i*f,t[4]=n*f-c*a,t[5]=i*a-n*s,t[6]=i*l-c*o,t[7]=c*r-n*l,t[8]=n*o-i*r;var d=1/h;return u.multiplyByScalar(t,d,t)},u.equals=function(e,t){return e===t||n(e)&&n(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]},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r},u.IDENTITY=i(new u(1,0,0,0,1,0,0,0,1)),u.ZERO=i(new u(0,0,0,0,0,0,0,0,0)),u.COLUMN0ROW0=0,u.COLUMN0ROW1=1,u.COLUMN0ROW2=2,u.COLUMN1ROW0=3,u.COLUMN1ROW1=4,u.COLUMN1ROW2=5,u.COLUMN2ROW0=6,u.COLUMN2ROW1=7,u.COLUMN2ROW2=8,r(u.prototype,{length:{get:function(){return u.packedLength}}}),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},u}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a){"use strict";function i(t,n,r,a){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0),this.w=e(a,0)}i.fromElements=function(e,n,r,a,o){return t(o)?(o.x=e,o.y=n,o.z=r,o.w=a,o):new i(e,n,r,a)},i.fromColor=function(e,n){return t(n)?(n.x=e.red,n.y=e.green,n.z=e.blue,n.w=e.alpha,n):new i(e.red,e.green,e.blue,e.alpha)},i.clone=function(e,n){if(t(e))return t(n)?(n.x=e.x,n.y=e.y,n.z=e.z,n.w=e.w,n):new i(e.x,e.y,e.z,e.w)},i.packedLength=4,i.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w,n},i.unpack=function(n,r,a){return r=e(r,0),t(a)||(a=new i),a.x=n[r++],a.y=n[r++],a.z=n[r++],a.w=n[r],a},i.packArray=function(e,n){var r=e.length;t(n)?n.length=4*r:n=new Array(4*r);for(var a=0;a<r;++a)i.pack(e[a],n,4*a);return n},i.unpackArray=function(e,n){var r=e.length;t(n)?n.length=r/4:n=new Array(r/4);for(var a=0;a<r;a+=4){var o=a/4;n[o]=i.unpack(e,a,n[o])}return n},i.fromArray=i.unpack,i.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},i.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},i.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},i.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},i.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},i.magnitude=function(e){return Math.sqrt(i.magnitudeSquared(e))};var o=new i;i.distance=function(e,t){return i.subtract(e,t,o),i.magnitude(o)},i.distanceSquared=function(e,t){return i.subtract(e,t,o),i.magnitudeSquared(o)},i.normalize=function(e,t){var n=i.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t},i.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},i.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},i.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},i.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},i.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},i.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},i.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},i.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},i.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 u=new i;i.lerp=function(e,t,n,r){return i.multiplyByScalar(t,n,u),r=i.multiplyByScalar(e,1-n,r),i.add(u,r,r)};var s=new i;return i.mostOrthogonalAxis=function(e,t){var n=i.normalize(e,s);return i.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?i.clone(i.UNIT_X,t):i.clone(i.UNIT_W,t):n.z<=n.w?i.clone(i.UNIT_Z,t):i.clone(i.UNIT_W,t):n.y<=n.z?n.y<=n.w?i.clone(i.UNIT_Y,t):i.clone(i.UNIT_W,t):n.z<=n.w?i.clone(i.UNIT_Z,t):i.clone(i.UNIT_W,t)},i.equals=function(e,n){return e===n||t(e)&&t(n)&&e.x===n.x&&e.y===n.y&&e.z===n.z&&e.w===n.w},i.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},i.equalsEpsilon=function(e,n,r,i){return e===n||t(e)&&t(n)&&a.equalsEpsilon(e.x,n.x,r,i)&&a.equalsEpsilon(e.y,n.y,r,i)&&a.equalsEpsilon(e.z,n.z,r,i)&&a.equalsEpsilon(e.w,n.w,r,i)},i.ZERO=r(new i(0,0,0,0)),i.UNIT_X=r(new i(1,0,0,0)),i.UNIT_Y=r(new i(0,1,0,0)),i.UNIT_Z=r(new i(0,0,1,0)),i.UNIT_W=r(new i(0,0,0,1)),i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i.prototype.equalsEpsilon=function(e,t,n){return i.equalsEpsilon(this,e,t,n)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},i}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t,r,a,i,o,u,s,c,l,f,h,d,E,p,_){this[0]=n(e,0),this[1]=n(i,0),this[2]=n(c,0),this[3]=n(d,0),this[4]=n(t,0),this[5]=n(o,0),this[6]=n(l,0),this[7]=n(E,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(f,0),this[11]=n(p,0),this[12]=n(a,0),this[13]=n(s,0),this[14]=n(h,0),this[15]=n(_,0)}l.packedLength=16,l.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t[r++]=e[9],t[r++]=e[10],t[r++]=e[11],t[r++]=e[12],t[r++]=e[13],t[r++]=e[14],t[r]=e[15],t},l.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new l),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a[9]=e[t++],a[10]=e[t++],a[11]=e[t++],a[12]=e[t++],a[13]=e[t++],a[14]=e[t++],a[15]=e[t],a},l.clone=function(e,t){if(r(e))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):new l(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])},l.fromArray=l.unpack,l.fromColumnMajorArray=function(e,t){return l.clone(e,t)},l.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 l(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])},l.fromRotationTranslation=function(t,a,i){return a=n(a,e.ZERO),r(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=a.x,i[13]=a.y,i[14]=a.z,i[15]=1,i):new l(t[0],t[3],t[6],a.x,t[1],t[4],t[7],a.y,t[2],t[5],t[8],a.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(e,t,n,a){r(a)||(a=new l);var i=n.x,o=n.y,u=n.z,s=t.x*t.x,c=t.x*t.y,f=t.x*t.z,h=t.x*t.w,d=t.y*t.y,E=t.y*t.z,p=t.y*t.w,_=t.z*t.z,m=t.z*t.w,y=t.w*t.w,T=s-d-_+y,R=2*(c-m),A=2*(f+p),S=2*(c+m),v=-s+d-_+y,N=2*(E-h),g=2*(f-p),I=2*(E+h),M=-s-d+_+y;return a[0]=T*i,a[1]=S*i,a[2]=g*i,a[3]=0,a[4]=R*o,a[5]=v*o,a[6]=I*o,a[7]=0,a[8]=A*u,a[9]=N*u,a[10]=M*u,a[11]=0,a[12]=e.x,a[13]=e.y,a[14]=e.z,a[15]=1,a},l.fromTranslationRotationScale=function(e,t){return l.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},l.fromTranslation=function(e,t){return l.fromRotationTranslation(s.IDENTITY,e,t)},l.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 l(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},l.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 l(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var f=new e,h=new e,d=new e;l.fromCamera=function(t,n){var a=t.position,i=t.direction,o=t.up;e.normalize(i,f),e.normalize(e.cross(f,o,h),h),e.normalize(e.cross(h,f,d),d);var u=h.x,s=h.y,c=h.z,E=f.x,p=f.y,_=f.z,m=d.x,y=d.y,T=d.z,R=a.x,A=a.y,S=a.z,v=u*-R+s*-A+c*-S,N=m*-R+y*-A+T*-S,g=E*R+p*A+_*S;return r(n)?(n[0]=u,n[1]=m,n[2]=-E,n[3]=0,n[4]=s,n[5]=y,n[6]=-p,n[7]=0,n[8]=c,n[9]=T,n[10]=-_,n[11]=0,n[12]=v,n[13]=N,n[14]=g,n[15]=1,n):new l(u,s,c,v,m,y,T,N,-E,-p,-_,g,0,0,0,1)},l.computePerspectiveFieldOfView=function(e,t,n,r,a){var i=Math.tan(.5*e),o=1/i,u=o/t,s=(r+n)/(n-r),c=2*r*n/(n-r);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=c,a[15]=0,a},l.computeOrthographicOffCenter=function(e,t,n,r,a,i,o){var u=1/(t-e),s=1/(r-n),c=1/(i-a),l=-(t+e)*u,f=-(r+n)*s,h=-(i+a)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=f,o[14]=h,o[15]=1,o},l.computePerspectiveOffCenter=function(e,t,n,r,a,i,o){var u=2*a/(t-e),s=2*a/(r-n),c=(t+e)/(t-e),l=(r+n)/(r-n),f=-(i+a)/(i-a),h=-1,d=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=f,o[11]=h,o[12]=0,o[13]=0,o[14]=d,o[15]=0,o},l.computeInfinitePerspectiveOffCenter=function(e,t,n,r,a,i){var o=2*a/(t-e),u=2*a/(r-n),s=(t+e)/(t-e),c=(r+n)/(r-n),l=-1,f=-1,h=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=s,i[9]=c,i[10]=l,i[11]=f,i[12]=0,i[13]=0,i[14]=h,i[15]=0,i},l.computeViewportTransformation=function(e,t,r,a){e=n(e,n.EMPTY_OBJECT);var i=n(e.x,0),o=n(e.y,0),u=n(e.width,0),s=n(e.height,0);t=n(t,0),r=n(r,1);var c=.5*u,l=.5*s,f=.5*(r-t),h=c,d=l,E=f,p=i+c,_=o+l,m=t+f,y=1;return a[0]=h,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=d,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=E,a[11]=0,a[12]=p,a[13]=_,a[14]=m,a[15]=y,a},l.computeView=function(t,n,r,a,i){return i[0]=a.x,i[1]=r.x,i[2]=-n.x,i[3]=0,i[4]=a.y,i[5]=r.y,i[6]=-n.y,i[7]=0,i[8]=a.z,i[9]=r.z,i[10]=-n.z,i[11]=0,i[12]=-e.dot(a,t),i[13]=-e.dot(r,t),i[14]=e.dot(n,t),i[15]=1,i},l.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]]},l.getElementIndex=function(e,t){return 4*e+t},l.getColumn=function(e,t,n){var r=4*t,a=e[r],i=e[r+1],o=e[r+2],u=e[r+3];return n.x=a,n.y=i,n.z=o,n.w=u,n},l.setColumn=function(e,t,n,r){r=l.clone(e,r);var a=4*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r[a+3]=n.w,r},l.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},l.getRow=function(e,t,n){var r=e[t],a=e[t+4],i=e[t+8],o=e[t+12];return n.x=r,n.y=a,n.z=i,n.w=o,n},l.setRow=function(e,t,n,r){return r=l.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var E=new e;l.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],E)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],E)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],E)),n};var p=new e;l.getMaximumScale=function(t){return l.getScale(t,p),e.maximumComponent(p)},l.multiply=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],f=e[8],h=e[9],d=e[10],E=e[11],p=e[12],_=e[13],m=e[14],y=e[15],T=t[0],R=t[1],A=t[2],S=t[3],v=t[4],N=t[5],g=t[6],I=t[7],M=t[8],O=t[9],x=t[10],w=t[11],C=t[12],P=t[13],U=t[14],D=t[15],L=r*T+u*R+f*A+p*S,F=a*T+s*R+h*A+_*S,z=i*T+c*R+d*A+m*S,B=o*T+l*R+E*A+y*S,b=r*v+u*N+f*g+p*I,G=a*v+s*N+h*g+_*I,q=i*v+c*N+d*g+m*I,W=o*v+l*N+E*g+y*I,X=r*M+u*O+f*x+p*w,V=a*M+s*O+h*x+_*w,H=i*M+c*O+d*x+m*w,Y=o*M+l*O+E*x+y*w,Z=r*C+u*P+f*U+p*D,k=a*C+s*P+h*U+_*D,j=i*C+c*P+d*U+m*D,K=o*C+l*P+E*U+y*D;return n[0]=L,n[1]=F,n[2]=z,n[3]=B,n[4]=b,n[5]=G,n[6]=q,n[7]=W,n[8]=X,n[9]=V,n[10]=H,n[11]=Y,n[12]=Z,n[13]=k,n[14]=j,n[15]=K,n},l.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},l.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},l.multiplyTransformation=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=e[12],d=e[13],E=e[14],p=t[0],_=t[1],m=t[2],y=t[4],T=t[5],R=t[6],A=t[8],S=t[9],v=t[10],N=t[12],g=t[13],I=t[14],M=r*p+o*_+c*m,O=a*p+u*_+l*m,x=i*p+s*_+f*m,w=r*y+o*T+c*R,C=a*y+u*T+l*R,P=i*y+s*T+f*R,U=r*A+o*S+c*v,D=a*A+u*S+l*v,L=i*A+s*S+f*v,F=r*N+o*g+c*I+h,z=a*N+u*g+l*I+d,B=i*N+s*g+f*I+E;return n[0]=M,n[1]=O,n[2]=x,n[3]=0,n[4]=w,n[5]=C,n[6]=P,n[7]=0,n[8]=U,n[9]=D,n[10]=L,n[11]=0,n[12]=F,n[13]=z,n[14]=B,n[15]=1,n},l.multiplyByMatrix3=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=t[0],d=t[1],E=t[2],p=t[3],_=t[4],m=t[5],y=t[6],T=t[7],R=t[8],A=r*h+o*d+c*E,S=a*h+u*d+l*E,v=i*h+s*d+f*E,N=r*p+o*_+c*m,g=a*p+u*_+l*m,I=i*p+s*_+f*m,M=r*y+o*T+c*R,O=a*y+u*T+l*R,x=i*y+s*T+f*R;return n[0]=A,n[1]=S,n[2]=v,n[3]=0,n[4]=N,n[5]=g,n[6]=I,n[7]=0,n[8]=M,n[9]=O,n[10]=x,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},l.multiplyByTranslation=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=r*e[0]+a*e[4]+i*e[8]+e[12],u=r*e[1]+a*e[5]+i*e[9]+e[13],s=r*e[2]+a*e[6]+i*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=s,n[15]=e[15],n};var _=new e;l.multiplyByUniformScale=function(e,t,n){return _.x=t,_.y=t,_.z=t,l.multiplyByScale(e,_,n)},l.multiplyByScale=function(e,t,n){var r=t.x,a=t.y,i=t.z;return 1===r&&1===a&&1===i?l.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=a*e[4],n[5]=a*e[5],n[6]=a*e[6],n[7]=0,n[8]=i*e[8],n[9]=i*e[9],n[10]=i*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},l.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=t.w,u=e[0]*r+e[4]*a+e[8]*i+e[12]*o,s=e[1]*r+e[5]*a+e[9]*i+e[13]*o,c=e[2]*r+e[6]*a+e[10]*i+e[14]*o,l=e[3]*r+e[7]*a+e[11]*i+e[15]*o;return n.x=u,n.y=s,n.z=c,n.w=l,n},l.multiplyByPointAsVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i,u=e[1]*r+e[5]*a+e[9]*i,s=e[2]*r+e[6]*a+e[10]*i;return n.x=o,n.y=u,n.z=s,n},l.multiplyByPoint=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i+e[12],u=e[1]*r+e[5]*a+e[9]*i+e[13],s=e[2]*r+e[6]*a+e[10]*i+e[14];return n.x=o,n.y=u,n.z=s,n},l.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},l.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},l.transpose=function(e,t){var n=e[1],r=e[2],a=e[3],i=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=o,t[14]=u,t[15]=e[15],t},l.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},l.equals=function(e,t){return e===t||r(e)&&r(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},l.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},l.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},l.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};var m=new s,y=new s,T=new t,R=new t(0,0,0,1);return l.inverse=function(e,n){if(s.equalsEpsilon(l.getRotation(e,m),y,u.EPSILON7)&&t.equals(l.getRow(e,3,T),R))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],a=e[4],i=e[8],o=e[12],f=e[1],h=e[5],d=e[9],E=e[13],p=e[2],_=e[6],A=e[10],S=e[14],v=e[3],N=e[7],g=e[11],I=e[15],M=A*I,O=S*g,x=_*I,w=S*N,C=_*g,P=A*N,U=p*I,D=S*v,L=p*g,F=A*v,z=p*N,B=_*v,b=M*h+w*d+C*E-(O*h+x*d+P*E),G=O*f+U*d+F*E-(M*f+D*d+L*E),q=x*f+D*h+z*E-(w*f+U*h+B*E),W=P*f+L*h+B*d-(C*f+F*h+z*d),X=O*a+x*i+P*o-(M*a+w*i+C*o),V=M*r+D*i+L*o-(O*r+U*i+F*o),H=w*r+U*a+B*o-(x*r+D*a+z*o),Y=C*r+F*a+z*i-(P*r+L*a+B*i);M=i*E,O=o*d,x=a*E,w=o*h,C=a*d,P=i*h,U=r*E,D=o*f,L=r*d,F=i*f,z=r*h,B=a*f;var Z=M*N+w*g+C*I-(O*N+x*g+P*I),k=O*v+U*g+F*I-(M*v+D*g+L*I),j=x*v+D*N+z*I-(w*v+U*N+B*I),K=P*v+L*N+B*g-(C*v+F*N+z*g),J=x*A+P*S+O*_-(C*S+M*_+w*A),Q=L*S+M*p+D*A-(U*A+F*S+O*p),$=U*_+B*S+w*p-(z*S+x*p+D*_),ee=z*A+C*p+F*_-(L*_+B*A+P*p),te=r*b+a*G+i*q+o*W;if(Math.abs(te)<u.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=b*te,n[1]=G*te,n[2]=q*te,n[3]=W*te,n[4]=X*te,n[5]=V*te,n[6]=H*te,n[7]=Y*te,n[8]=Z*te,n[9]=k*te,n[10]=j*te,n[11]=K*te,n[12]=J*te,n[13]=Q*te,n[14]=$*te,n[15]=ee*te,n},l.inverseTransformation=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],f=e[12],h=e[13],d=e[14],E=-n*f-r*h-a*d,p=-i*f-o*h-u*d,_=-s*f-c*h-l*d;return t[0]=n,t[1]=i,t[2]=s,t[3]=0,t[4]=r,t[5]=o,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=l,t[11]=0,t[12]=E,t[13]=p,t[14]=_,t[15]=1,t},l.IDENTITY=o(new l(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),l.ZERO=o(new l(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN0ROW3=3,l.COLUMN1ROW0=4,l.COLUMN1ROW1=5,l.COLUMN1ROW2=6,l.COLUMN1ROW3=7,l.COLUMN2ROW0=8,l.COLUMN2ROW1=9,l.COLUMN2ROW2=10,l.COLUMN2ROW3=11,l.COLUMN3ROW0=12,l.COLUMN3ROW1=13,l.COLUMN3ROW2=14,l.COLUMN3ROW3=15,a(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.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]+")"},l}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(t,r){this.center=e.clone(n(t,e.ZERO)),this.radius=n(r,0)}var d=new e,E=new e,p=new e,_=new e,m=new e,y=new e,T=new e,R=new e,A=new e,S=new e,v=new e,N=new e;h.fromPoints=function(t,n){if(r(n)||(n=new h),!r(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var a=e.clone(t[0],T),i=e.clone(a,d),o=e.clone(a,E),u=e.clone(a,p),s=e.clone(a,_),c=e.clone(a,m),l=e.clone(a,y),f=t.length,g=1;g<f;g++){e.clone(t[g],a);var I=a.x,M=a.y,O=a.z;I<i.x&&e.clone(a,i),I>s.x&&e.clone(a,s),M<o.y&&e.clone(a,o),M>c.y&&e.clone(a,c),O<u.z&&e.clone(a,u),O>l.z&&e.clone(a,l)}var x=e.magnitudeSquared(e.subtract(s,i,R)),w=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=i,U=s,D=x;w>D&&(D=w,P=o,U=c),C>D&&(D=C,P=u,U=l);var L=A;L.x=.5*(P.x+U.x),L.y=.5*(P.y+U.y),L.z=.5*(P.z+U.z);var F=e.magnitudeSquared(e.subtract(U,L,R)),z=Math.sqrt(F),B=S;B.x=i.x,B.y=o.y,B.z=u.z;var b=v;b.x=s.x,b.y=c.y,b.z=l.z;var G=e.multiplyByScalar(e.add(B,b,R),.5,N),q=0;for(g=0;g<f;g++){e.clone(t[g],a);var W=e.magnitude(e.subtract(a,G,R));W>q&&(q=W);var X=e.magnitudeSquared(e.subtract(a,L,R));if(X>F){var V=Math.sqrt(X);z=.5*(z+V),F=z*z;var H=V-z;L.x=(z*L.x+H*a.x)/V,L.y=(z*L.y+H*a.y)/V,L.z=(z*L.z+H*a.z)/V}}return z<q?(e.clone(L,n.center),n.radius=z):(e.clone(G,n.center),n.radius=q),n};var g=new o,I=new e,M=new e,O=new t,x=new t;h.fromRectangle2D=function(e,t,n){return h.fromRectangleWithHeights2D(e,t,0,0,n)},h.fromRectangleWithHeights2D=function(t,a,i,o,u){if(r(u)||(u=new h),!r(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;a=n(a,g),f.southwest(t,O),O.height=i,f.northeast(t,x),x.height=o;var s=a.project(O,I),c=a.project(x,M),l=c.x-s.x,d=c.y-s.y,E=c.z-s.z;u.radius=.5*Math.sqrt(l*l+d*d+E*E);var p=u.center;return p.x=s.x+.5*l,p.y=s.y+.5*d,p.z=s.z+.5*E,u};var w=[];h.fromRectangle3D=function(e,t,a,o){t=n(t,i.WGS84),a=n(a,0);var u;return r(e)&&(u=f.subsample(e,t,a,w)),h.fromPoints(u,o)},h.fromVertices=function(t,a,i,o){if(r(o)||(o=new h),!r(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;a=n(a,e.ZERO),i=n(i,3);var u=T;u.x=t[0]+a.x,u.y=t[1]+a.y,u.z=t[2]+a.z;for(var s=e.clone(u,d),c=e.clone(u,E),l=e.clone(u,p),f=e.clone(u,_),g=e.clone(u,m),I=e.clone(u,y),M=t.length,O=0;O<M;O+=i){var x=t[O]+a.x,w=t[O+1]+a.y,C=t[O+2]+a.z;u.x=x,u.y=w,u.z=C,x<s.x&&e.clone(u,s),x>f.x&&e.clone(u,f),w<c.y&&e.clone(u,c),w>g.y&&e.clone(u,g),C<l.z&&e.clone(u,l),C>I.z&&e.clone(u,I)}var P=e.magnitudeSquared(e.subtract(f,s,R)),U=e.magnitudeSquared(e.subtract(g,c,R)),D=e.magnitudeSquared(e.subtract(I,l,R)),L=s,F=f,z=P;U>z&&(z=U,L=c,F=g),D>z&&(z=D,L=l,F=I);var B=A;B.x=.5*(L.x+F.x),B.y=.5*(L.y+F.y),B.z=.5*(L.z+F.z);var b=e.magnitudeSquared(e.subtract(F,B,R)),G=Math.sqrt(b),q=S;q.x=s.x,q.y=c.y,q.z=l.z;var W=v;W.x=f.x,W.y=g.y,W.z=I.z;var X=e.multiplyByScalar(e.add(q,W,R),.5,N),V=0;for(O=0;O<M;O+=i){u.x=t[O]+a.x,u.y=t[O+1]+a.y,u.z=t[O+2]+a.z;var H=e.magnitude(e.subtract(u,X,R));H>V&&(V=H);var Y=e.magnitudeSquared(e.subtract(u,B,R));if(Y>b){var Z=Math.sqrt(Y);G=.5*(G+Z),b=G*G;var k=Z-G;B.x=(G*B.x+k*u.x)/Z,B.y=(G*B.y+k*u.y)/Z,B.z=(G*B.z+k*u.z)/Z}}return G<V?(e.clone(B,o.center),o.radius=G):(e.clone(X,o.center),o.radius=V),o},h.fromEncodedCartesianVertices=function(t,n,a){if(r(a)||(a=new h),!r(t)||!r(n)||t.length!==n.length||0===t.length)return a.center=e.clone(e.ZERO,a.center),a.radius=0,a;var i=T;i.x=t[0]+n[0],i.y=t[1]+n[1],i.z=t[2]+n[2];for(var o=e.clone(i,d),u=e.clone(i,E),s=e.clone(i,p),c=e.clone(i,_),l=e.clone(i,m),f=e.clone(i,y),g=t.length,I=0;I<g;I+=3){var M=t[I]+n[I],O=t[I+1]+n[I+1],x=t[I+2]+n[I+2];i.x=M,i.y=O,i.z=x,M<o.x&&e.clone(i,o),M>c.x&&e.clone(i,c),O<u.y&&e.clone(i,u),O>l.y&&e.clone(i,l),x<s.z&&e.clone(i,s),x>f.z&&e.clone(i,f)}var w=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=e.magnitudeSquared(e.subtract(f,s,R)),U=o,D=c,L=w;C>L&&(L=C,U=u,D=l),P>L&&(L=P,U=s,D=f);var F=A;F.x=.5*(U.x+D.x),F.y=.5*(U.y+D.y),F.z=.5*(U.z+D.z);var z=e.magnitudeSquared(e.subtract(D,F,R)),B=Math.sqrt(z),b=S;b.x=o.x,b.y=u.y,b.z=s.z;var G=v;G.x=c.x,G.y=l.y,G.z=f.z;var q=e.multiplyByScalar(e.add(b,G,R),.5,N),W=0;for(I=0;I<g;I+=3){i.x=t[I]+n[I],i.y=t[I+1]+n[I+1],i.z=t[I+2]+n[I+2];var X=e.magnitude(e.subtract(i,q,R));X>W&&(W=X);var V=e.magnitudeSquared(e.subtract(i,F,R));if(V>z){var H=Math.sqrt(V);B=.5*(B+H),z=B*B;var Y=H-B;F.x=(B*F.x+Y*i.x)/H,F.y=(B*F.y+Y*i.y)/H,F.z=(B*F.z+Y*i.z)/H}}return B<W?(e.clone(F,a.center),a.radius=B):(e.clone(q,a.center),a.radius=W),a},h.fromCornerPoints=function(t,n,a){r(a)||(a=new h);var i=a.center;return e.add(t,n,i),e.multiplyByScalar(i,.5,i),a.radius=e.distance(i,n),a},h.fromEllipsoid=function(t,n){return r(n)||(n=new h),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var C=new e;h.fromBoundingSpheres=function(t,n){if(r(n)||(n=new h),!r(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var a=t.length;if(1===a)return h.clone(t[0],n);if(2===a)return h.union(t[0],t[1],n);for(var i=[],o=0;o<a;o++)i.push(t[o].center);n=h.fromPoints(i,n);var u=n.center,s=n.radius;for(o=0;o<a;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,C)+c.radius)}return n.radius=s,n};var P=new e,U=new e,D=new e;h.fromOrientedBoundingBox=function(t,n){r(n)||(n=new h);var a=t.halfAxes,i=c.getColumn(a,0,P),o=c.getColumn(a,1,U),u=c.getColumn(a,2,D),s=e.magnitude(i),l=e.magnitude(o),f=e.magnitude(u);return n.center=e.clone(t.center,n.center),n.radius=Math.max(s,l,f),n},h.clone=function(t,n){if(r(t))return r(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new h(t.center,t.radius)},h.packedLength=4,h.pack=function(e,t,r){r=n(r,0);var a=e.center;return t[r++]=a.x,t[r++]=a.y,t[r++]=a.z,t[r]=e.radius,t},h.unpack=function(e,t,a){t=n(t,0),r(a)||(a=new h);var i=a.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],a.radius=e[t],a};var L=new e,F=new e;h.union=function(t,n,a){r(a)||(a=new h);var i=t.center,o=t.radius,u=n.center,s=n.radius,c=e.subtract(u,i,L),l=e.magnitude(c);if(o>=l+s)return t.clone(a),a;if(s>=l+o)return n.clone(a),a;var f=.5*(o+l+s),d=e.multiplyByScalar(c,(-o+f)/l,F);return e.add(d,i,d),e.clone(d,a.center),a.radius=f,a};var z=new e;h.expand=function(t,n,r){r=h.clone(t,r);var a=e.magnitude(e.subtract(n,r.center,z));return a>r.radius&&(r.radius=a),r},h.intersectPlane=function(t,n){var r=t.center,a=t.radius,i=n.normal,o=e.dot(i,r)+n.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},h.transform=function(e,t,n){return r(n)||(n=new h),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=l.getMaximumScale(t)*e.radius, -n};var B=new e;h.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,B);return e.magnitudeSquared(r)-t.radius*t.radius},h.transformWithoutScale=function(e,t,n){return r(n)||(n=new h),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var b=new e;h.computePlaneDistances=function(t,n,a,i){r(i)||(i=new s);var o=e.subtract(t.center,n,b),u=e.dot(a,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var G=new e,q=new e,W=new e,X=new e,V=new e,H=new t,Y=new Array(8),Z=0;Z<8;++Z)Y[Z]=new e;var k=new o;return h.projectTo2D=function(t,r,a){r=n(r,k);var i=r.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,G),c=e.cross(e.UNIT_Z,s,q);e.normalize(c,c);var l=e.cross(s,c,W);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var f=e.negate(l,V),d=e.negate(c,X),E=Y,p=E[0];e.add(s,l,p),e.add(p,c,p),p=E[1],e.add(s,l,p),e.add(p,d,p),p=E[2],e.add(s,f,p),e.add(p,d,p),p=E[3],e.add(s,f,p),e.add(p,c,p),e.negate(s,s),p=E[4],e.add(s,l,p),e.add(p,c,p),p=E[5],e.add(s,l,p),e.add(p,d,p),p=E[6],e.add(s,f,p),e.add(p,d,p),p=E[7],e.add(s,f,p),e.add(p,c,p);for(var _=E.length,m=0;m<_;++m){var y=E[m];e.add(o,y,y);var T=i.cartesianToCartographic(y,H);r.project(T,y)}a=h.fromPoints(E,a),o=a.center;var R=o.x,A=o.y,S=o.z;return o.x=S,o.y=R,o.z=A,a},h.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},h.equals=function(t,n){return t===n||r(t)&&r(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},h.prototype.intersectPlane=function(e){return h.intersectPlane(this,e)},h.prototype.distanceSquaredTo=function(e){return h.distanceSquaredTo(this,e)},h.prototype.computePlaneDistances=function(e,t,n){return h.computePlaneDistances(this,e,t,n)},h.prototype.isOccluded=function(e){return h.isOccluded(this,e)},h.prototype.equals=function(e){return h.equals(this,e)},h.prototype.clone=function(e){return h.clone(this,e)},h}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return t(a,{element:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(r.requestFullscreen=a,n=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(r.requestFullscreen=a,n=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?r.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(r.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?r.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(r.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?r.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(r.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),r.fullscreenerror=a)}return n},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[r.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function a(){if(!t(A)&&(A=!1,!h())){var e=/ Chrome\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(A=!0,S=r(e[1]))}return A}function i(){return a()&&S}function o(){if(!t(v)&&(v=!1,!a()&&!h()&&/ Safari\/[\.0-9]+/.test(R.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(v=!0,N=r(e[1]))}return v}function u(){return o()&&N}function s(){if(!t(g)){g=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(R.userAgent);null!==e&&(g=!0,I=r(e[1]),I.isNightly=!!e[2])}return g}function c(){return s()&&I}function l(){if(!t(M)){M=!1;var e;"Microsoft Internet Explorer"===R.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(M=!0,O=r(e[1]))):"Netscape"===R.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(M=!0,O=r(e[1])))}return M}function f(){return l()&&O}function h(){if(!t(x)){x=!1;var e=/ Edge\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(x=!0,w=r(e[1]))}return x}function d(){return h()&&w}function E(){if(!t(C)){C=!1;var e=/Firefox\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(C=!0,P=r(e[1]))}return C}function p(){return t(U)||(U=/Windows/i.test(R.appVersion)),U}function _(){return E()&&P}function m(){return t(D)||(D="undefined"!=typeof PointerEvent&&(!t(R.pointerEnabled)||R.pointerEnabled)),D}function y(){if(!t(F)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;F=t(n)&&""!==n,F&&(L=n)}return F}function T(){return y()?L:void 0}var R;R="undefined"!=typeof navigator?navigator:{};var A,S,v,N,g,I,M,O,x,w,C,P,U,D,L,F,z={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isEdge:h,edgeVersion:d,isFirefox:E,firefoxVersion:_,isWindows:p,hardwareConcurrency:e(R.hardwareConcurrency,3),supportsPointerEvents:m,supportsImageRenderingPixelated:y,imageRenderingValue:T};return z.supportsFullscreen=function(){return n.supportsFullscreen()},z.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},z.supportsWebWorkers=function(){return"undefined"!=typeof Worker},z}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,a,i){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){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.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},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 Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,a){switch(r=e(r,0),a=e(a,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,a);case o.SHORT:return new Int16Array(n,r,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,a);case o.INT:return new Int32Array(n,r,a);case o.UNSIGNED_INT:return new Uint32Array(n,r,a);case o.FLOAT:return new Float32Array(n,r,a);case o.DOUBLE:return new Float64Array(n,r,a)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/CornerType",["./freezeObject"],function(e){"use strict";var t={ROUNDED:0,MITERED:1,BEVELED:2};return e(t)}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===n.POINTS||e===n.LINES||e===n.LINE_LOOP||e===n.LINE_STRIP||e===n.TRIANGLES||e===n.TRIANGLE_STRIP||e===n.TRIANGLE_FAN}};return e(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,a){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,a.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return i.computeNumberOfVertices=function(e){var n=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var a=e.attributes[r],i=a.values.length/a.componentsPerAttribute;n=i}return n},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(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 r}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.binormal=t.binormal,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,n,r,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(e){switch(e){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(t){return e(t)&&(t===i.UNSIGNED_BYTE||t===i.UNSIGNED_SHORT||t===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,n,a){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,a):new Uint16Array(t,n,a)},n(i)}),define("ThirdParty/earcut-2.1.1",[],function(){"use strict";function e(e,n,a){a=a||2;var i=n&&n.length,o=i?n[0]*a:e.length,u=t(e,0,o,a,!0),c=[];if(!u)return c;var l,f,h,d,E,p,_;if(i&&(u=s(e,n,u,a)),e.length>80*a){l=h=e[0],f=d=e[1];for(var m=a;m<o;m+=a)E=e[m],p=e[m+1],E<l&&(l=E),p<f&&(f=p),E>h&&(h=E),p>d&&(d=p);_=Math.max(h-l,d-f)}return r(u,c,a,l,f,_),c}function t(e,t,n,r,a){var i,o;if(a===O(e,t,n,r)>0)for(i=t;i<n;i+=r)o=g(i,e[i],e[i+1],o);else for(i=n-r;i>=t;i-=r)o=g(i,e[i],e[i+1],o);return o&&T(o,o.next)&&(I(o),o=o.next),o}function n(e,t){if(!e)return e;t||(t=e);var n,r=e;do if(n=!1,r.steiner||!T(r,r.next)&&0!==y(r.prev,r,r.next))r=r.next;else{if(I(r),r=t=r.prev,r===r.next)return null;n=!0}while(n||r!==t);return t}function r(e,t,s,c,l,f,d){if(e){!d&&f&&h(e,c,l,f);for(var E,p,_=e;e.prev!==e.next;)if(E=e.prev,p=e.next,f?i(e,c,l,f):a(e))t.push(E.i/s),t.push(e.i/s),t.push(p.i/s),I(e),e=p.next,_=p.next;else if(e=p,e===_){d?1===d?(e=o(e,t,s),r(e,t,s,c,l,f,2)):2===d&&u(e,t,s,c,l,f):r(n(e),t,s,c,l,f,1);break}}}function a(e){var t=e.prev,n=e,r=e.next;if(y(t,n,r)>=0)return!1;for(var a=e.next.next;a!==e.prev;){if(_(t.x,t.y,n.x,n.y,r.x,r.y,a.x,a.y)&&y(a.prev,a,a.next)>=0)return!1;a=a.next}return!0}function i(e,t,n,r){var a=e.prev,i=e,o=e.next;if(y(a,i,o)>=0)return!1;for(var u=a.x<i.x?a.x<o.x?a.x:o.x:i.x<o.x?i.x:o.x,s=a.y<i.y?a.y<o.y?a.y:o.y:i.y<o.y?i.y:o.y,c=a.x>i.x?a.x>o.x?a.x:o.x:i.x>o.x?i.x:o.x,l=a.y>i.y?a.y>o.y?a.y:o.y:i.y>o.y?i.y:o.y,f=E(u,s,t,n,r),h=E(c,l,t,n,r),d=e.nextZ;d&&d.z<=h;){if(d!==e.prev&&d!==e.next&&_(a.x,a.y,i.x,i.y,o.x,o.y,d.x,d.y)&&y(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(d=e.prevZ;d&&d.z>=f;){if(d!==e.prev&&d!==e.next&&_(a.x,a.y,i.x,i.y,o.x,o.y,d.x,d.y)&&y(d.prev,d,d.next)>=0)return!1;d=d.prevZ}return!0}function o(e,t,n){var r=e;do{var a=r.prev,i=r.next.next;!T(a,i)&&R(a,r,r.next,i)&&S(a,i)&&S(i,a)&&(t.push(a.i/n),t.push(r.i/n),t.push(i.i/n),I(r),I(r.next),r=e=i),r=r.next}while(r!==e);return r}function u(e,t,a,i,o,u){var s=e;do{for(var c=s.next.next;c!==s.prev;){if(s.i!==c.i&&m(s,c)){var l=N(s,c);return s=n(s,s.next),l=n(l,l.next),r(s,t,a,i,o,u),void r(l,t,a,i,o,u)}c=c.next}s=s.next}while(s!==e)}function s(e,r,a,i){var o,u,s,f,h,d=[];for(o=0,u=r.length;o<u;o++)s=r[o]*i,f=o<u-1?r[o+1]*i:e.length,h=t(e,s,f,i,!1),h===h.next&&(h.steiner=!0),d.push(p(h));for(d.sort(c),o=0;o<d.length;o++)l(d[o],a),a=n(a,a.next);return a}function c(e,t){return e.x-t.x}function l(e,t){if(t=f(e,t)){var r=N(t,e);n(r,r.next)}}function f(e,t){var n,r=t,a=e.x,i=e.y,o=-(1/0);do{if(i<=r.y&&i>=r.next.y){var u=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(u<=a&&u>o){if(o=u,u===a){if(i===r.y)return r;if(i===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(a===o)return n.prev;var s,c=n,l=n.x,f=n.y,h=1/0;for(r=n.next;r!==c;)a>=r.x&&r.x>=l&&_(i<f?a:o,i,l,f,i<f?o:a,i,r.x,r.y)&&(s=Math.abs(i-r.y)/(a-r.x),(s<h||s===h&&r.x>n.x)&&S(r,e)&&(n=r,h=s)),r=r.next;return n}function h(e,t,n,r){var a=e;do null===a.z&&(a.z=E(a.x,a.y,t,n,r)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next;while(a!==e);a.prevZ.nextZ=null,a.prevZ=null,d(a)}function d(e){var t,n,r,a,i,o,u,s,c=1;do{for(n=e,e=null,i=null,o=0;n;){for(o++,r=n,u=0,t=0;t<c&&(u++,r=r.nextZ,r);t++);for(s=c;u>0||s>0&&r;)0===u?(a=r,r=r.nextZ,s--):0!==s&&r?n.z<=r.z?(a=n,n=n.nextZ,u--):(a=r,r=r.nextZ,s--):(a=n,n=n.nextZ,u--),i?i.nextZ=a:e=a,a.prevZ=i,i=a;n=r}i.nextZ=null,c*=2}while(o>1);return e}function E(e,t,n,r,a){return e=32767*(e-n)/a,t=32767*(t-r)/a,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function p(e){var t=e,n=e;do t.x<n.x&&(n=t),t=t.next;while(t!==e);return n}function _(e,t,n,r,a,i,o,u){return(a-o)*(t-u)-(e-o)*(i-u)>=0&&(e-o)*(r-u)-(n-o)*(t-u)>=0&&(n-o)*(i-u)-(a-o)*(r-u)>=0}function m(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!A(e,t)&&S(e,t)&&S(t,e)&&v(e,t)}function y(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function T(e,t){return e.x===t.x&&e.y===t.y}function R(e,t,n,r){return!!(T(e,t)&&T(n,r)||T(e,r)&&T(n,t))||y(e,t,n)>0!=y(e,t,r)>0&&y(n,r,e)>0!=y(n,r,t)>0}function A(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&R(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function S(e,t){return y(e.prev,e,e.next)<0?y(e,t,e.next)>=0&&y(e,e.prev,t)>=0:y(e,t,e.prev)<0||y(e,e.next,t)<0}function v(e,t){var n=e,r=!1,a=(e.x+t.x)/2,i=(e.y+t.y)/2;do n.y>i!=n.next.y>i&&a<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function N(e,t){var n=new M(e.i,e.x,e.y),r=new M(t.i,t.x,t.y),a=e.next,i=t.prev;return e.next=t,t.prev=e,n.next=a,a.prev=n,r.next=n,n.prev=r,i.next=r,r.prev=i,r}function g(e,t,n,r){var a=new M(e,t,n);return r?(a.next=r.next,a.prev=r,r.next.prev=a,r.next=a):(a.prev=a,a.next=a),a}function I(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function M(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function O(e,t,n,r){for(var a=0,i=t,o=n-r;i<n;i+=r)a+=(e[o]-e[i])*(e[i+1]+e[o+1]),o=i;return a}return e.deviation=function(e,t,n,r){var a=t&&t.length,i=a?t[0]*n:e.length,o=Math.abs(O(e,0,i,n));if(a)for(var u=0,s=t.length;u<s;u++){var c=t[u]*n,l=u<s-1?t[u+1]*n:e.length;o-=Math.abs(O(e,c,l,n))}var f=0;for(u=0;u<r.length;u+=3){var h=r[u]*n,d=r[u+1]*n,E=r[u+2]*n;f+=Math.abs((e[h]-e[E])*(e[d+1]-e[h+1])-(e[h]-e[d])*(e[E+1]-e[h+1]))}return 0===o&&0===f?0:Math.abs((f-o)/o)},e.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,a=0;a<e.length;a++){for(var i=0;i<e[a].length;i++)for(var o=0;o<t;o++)n.vertices.push(e[a][i][o]);a>0&&(r+=e[a-1].length,n.holes.push(r))}return n},e}),define("Core/WindingOrder",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={CLOCKWISE:t.CW,COUNTER_CLOCKWISE:t.CCW,validate:function(e){return e===n.CLOCKWISE||e===n.COUNTER_CLOCKWISE}};return e(n)}),define("Core/PolygonPipeline",["../ThirdParty/earcut-2.1.1","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./Math","./PrimitiveType","./WindingOrder"],function(e,t,n,r,a,i,o,u,s,c,l,f,h){"use strict";var d=new n,E=new n,p={};p.computeArea2D=function(e){for(var t=e.length,n=0,r=t-1,a=0;a<t;r=a++){var i=e[r],o=e[a];n+=i.x*o.y-o.x*i.y}return.5*n},p.computeWindingOrder2D=function(e){var t=p.computeArea2D(e);return t>0?h.COUNTER_CLOCKWISE:h.CLOCKWISE},p.triangulate=function(n,r){var a=t.packArray(n);return e(a,r,2)};var _=new n,m=new n,y=new n,T=new n,R=new n,A=new n,S=new n;return p.computeSubdivision=function(e,t,o,u){u=a(u,l.RADIANS_PER_DEGREE);var h,d=o.slice(0),E=t.length,p=new Array(3*E),v=0;for(h=0;h<E;h++){var N=t[h];p[v++]=N.x,p[v++]=N.y,p[v++]=N.z}for(var g=[],I={},M=e.maximumRadius,O=l.chordLength(u,M),x=O*O;d.length>0;){var w,C,P=d.pop(),U=d.pop(),D=d.pop(),L=n.fromArray(p,3*D,_),F=n.fromArray(p,3*U,m),z=n.fromArray(p,3*P,y),B=n.multiplyByScalar(n.normalize(L,T),M,T),b=n.multiplyByScalar(n.normalize(F,R),M,R),G=n.multiplyByScalar(n.normalize(z,A),M,A),q=n.magnitudeSquared(n.subtract(B,b,S)),W=n.magnitudeSquared(n.subtract(b,G,S)),X=n.magnitudeSquared(n.subtract(G,B,S)),V=Math.max(q,W,X);V>x?q===V?(w=Math.min(D,U)+" "+Math.max(D,U),h=I[w],i(h)||(C=n.add(L,F,S),n.multiplyByScalar(C,.5,C),p.push(C.x,C.y,C.z),h=p.length/3-1,I[w]=h),d.push(D,h,P),d.push(h,U,P)):W===V?(w=Math.min(U,P)+" "+Math.max(U,P), -h=I[w],i(h)||(C=n.add(F,z,S),n.multiplyByScalar(C,.5,C),p.push(C.x,C.y,C.z),h=p.length/3-1,I[w]=h),d.push(U,h,D),d.push(h,P,D)):X===V&&(w=Math.min(P,D)+" "+Math.max(P,D),h=I[w],i(h)||(C=n.add(z,L,S),n.multiplyByScalar(C,.5,C),p.push(C.x,C.y,C.z),h=p.length/3-1,I[w]=h),d.push(P,h,U),d.push(h,D,U)):(g.push(D),g.push(U),g.push(P))}return new s({attributes:{position:new c({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:p})},indices:g,primitiveType:f.TRIANGLES})},p.scaleToGeodeticHeight=function(e,t,r,o){r=a(r,u.WGS84);var s=d,c=E;if(t=a(t,0),o=a(o,!0),i(e))for(var l=e.length,f=0;f<l;f+=3)n.fromArray(e,f,c),o&&(c=r.scaleToGeodeticSurface(c,c)),0!==t&&(s=r.geodeticSurfaceNormal(c,s),n.multiplyByScalar(s,t,s),n.add(c,s,c)),e[f]=c.x,e[f+1]=c.y,e[f+2]=c.z;return e},p}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Intersect"],function(e,t,n,r,a){"use strict";function i(r,a,i){this.minimum=e.clone(t(r,e.ZERO)),this.maximum=e.clone(t(a,e.ZERO)),n(i)?i=e.clone(i):(i=e.add(this.minimum,this.maximum,new e),e.multiplyByScalar(i,.5,i)),this.center=i}i.fromPoints=function(t,r){if(n(r)||(r=new i),!n(t)||0===t.length)return r.minimum=e.clone(e.ZERO,r.minimum),r.maximum=e.clone(e.ZERO,r.maximum),r.center=e.clone(e.ZERO,r.center),r;for(var a=t[0].x,o=t[0].y,u=t[0].z,s=t[0].x,c=t[0].y,l=t[0].z,f=t.length,h=1;h<f;h++){var d=t[h],E=d.x,p=d.y,_=d.z;a=Math.min(E,a),s=Math.max(E,s),o=Math.min(p,o),c=Math.max(p,c),u=Math.min(_,u),l=Math.max(_,l)}var m=r.minimum;m.x=a,m.y=o,m.z=u;var y=r.maximum;y.x=s,y.y=c,y.z=l;var T=e.add(m,y,r.center);return e.multiplyByScalar(T,.5,T),r},i.clone=function(t,r){if(n(t))return n(r)?(r.minimum=e.clone(t.minimum,r.minimum),r.maximum=e.clone(t.maximum,r.maximum),r.center=e.clone(t.center,r.center),r):new i(t.minimum,t.maximum)},i.equals=function(t,r){return t===r||n(t)&&n(r)&&e.equals(t.center,r.center)&&e.equals(t.minimum,r.minimum)&&e.equals(t.maximum,r.maximum)};var o=new e;return i.intersectPlane=function(t,n){o=e.subtract(t.maximum,t.minimum,o);var r=e.multiplyByScalar(o,.5,o),i=n.normal,u=r.x*Math.abs(i.x)+r.y*Math.abs(i.y)+r.z*Math.abs(i.z),s=e.dot(t.center,i)+n.distance;return s-u>0?a.INSIDE:s+u<0?a.OUTSIDE:a.INTERSECTING},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.intersectPlane=function(e){return i.intersectPlane(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function n(e,n,r){var a=e+n;return t.sign(e)!==t.sign(n)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(n)))<r?0:a}var r={};return r.computeDiscriminant=function(e,t,n){var r=t*t-4*e*n;return r},r.computeRealRoots=function(e,r,a){var i;if(0===e)return 0===r?[]:[-a/r];if(0===r){if(0===a)return[0,0];var o=Math.abs(a),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,i<0)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-r/e,i<0?[i,0]:[0,i];var c=r*r,l=4*e*a,f=n(c,-l,t.EPSILON14);if(f<0)return[];var h=-.5*n(r,t.sign(r)*Math.sqrt(f),t.EPSILON14);return r>0?[h/e,a/h]:[a/h,h/e]},r}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function n(e,t,n,r){var a,i,o=e,u=t/3,s=n/3,c=r,l=o*s,f=u*c,h=u*u,d=s*s,E=o*s-h,p=o*c-u*s,_=u*c-d,m=4*E*_-p*p;if(m<0){var y,T,R;h*f>=l*d?(y=o,T=E,R=-2*u*E+o*p):(y=c,T=_,R=-c*p+2*s*_);var A=R<0?-1:1,S=-A*Math.abs(y)*Math.sqrt(-m);i=-R+S;var v=i/2,N=v<0?-Math.pow(-v,1/3):Math.pow(v,1/3),g=i===S?-N:-T/N;return a=T<=0?N+g:-R/(N*N+g*g+T),h*f>=l*d?[(a-u)/o]:[-c/(a+s)]}var I=E,M=-2*u*E+o*p,O=_,x=-c*p+2*s*_,w=Math.sqrt(m),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*w,-M)/3);a=2*Math.sqrt(-I);var U=Math.cos(P);i=a*U;var D=a*(-U/2-C*Math.sin(P)),L=i+D>2*u?i-u:D-u,F=o,z=L/F;P=Math.abs(Math.atan2(c*w,-x)/3),a=2*Math.sqrt(-O),U=Math.cos(P),i=a*U,D=a*(-U/2-C*Math.sin(P));var B=-c,b=i+D<2*s?i+s:D+s,G=B/b,q=F*b,W=-L*b-F*B,X=L*B,V=(s*W-u*X)/(-u*W+s*q);return z<=V?z<=G?V<=G?[z,V,G]:[z,G,V]:[G,z,V]:z<=G?[V,z,G]:V<=G?[V,G,z]:[G,V,z]}var r={};return r.computeDiscriminant=function(e,t,n,r){var a=e*e,i=t*t,o=n*n,u=r*r,s=18*e*t*n*r+i*o-27*a*u-4*(e*o*n+i*t*r);return s},r.computeRealRoots=function(e,r,a,i){var o,u;if(0===e)return t.computeRealRoots(r,a,i);if(0===r){if(0===a){if(0===i)return[0,0,0];u=-i/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===i?(o=t.computeRealRoots(e,0,a),0===o.Length?[0]:[o[0],0,o[1]]):n(e,0,a,i)}return 0===a?0===i?(u=-r/e,u<0?[u,0,0]:[0,0,u]):n(e,r,0,i):0===i?(o=t.computeRealRoots(e,r,a),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):n(e,r,a,i)},r}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,n,r){"use strict";function a(t,a,i,o){var u=t*t,s=a-3*u/8,c=i-a*t/2+u*t/8,l=o-i*t/4+a*u/16-3*u*u/256,f=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(f.length>0){var h=-t/4,d=f[f.length-1];if(Math.abs(d)<n.EPSILON14){var E=r.computeRealRoots(1,s,l);if(2===E.length){var p,_=E[0],m=E[1];if(_>=0&&m>=0){var y=Math.sqrt(_),T=Math.sqrt(m);return[h-T,h-y,h+y,h+T]}if(_>=0&&m<0)return p=Math.sqrt(_),[h-p,h+p];if(_<0&&m>=0)return p=Math.sqrt(m),[h-p,h+p]}return[]}if(d>0){var R=Math.sqrt(d),A=(s+d-c/R)/2,S=(s+d+c/R)/2,v=r.computeRealRoots(1,R,A),N=r.computeRealRoots(1,-R,S);return 0!==v.length?(v[0]+=h,v[1]+=h,0!==N.length?(N[0]+=h,N[1]+=h,v[1]<=N[0]?[v[0],v[1],N[0],N[1]]:N[1]<=v[0]?[N[0],N[1],v[0],v[1]]:v[0]>=N[0]&&v[1]<=N[1]?[N[0],v[0],v[1],N[1]]:N[0]>=v[0]&&N[1]<=v[1]?[v[0],N[0],N[1],v[1]]:v[0]>N[0]&&v[0]<N[1]?[N[0],v[0],N[1],v[1]]:[v[0],N[0],v[1],N[1]]):v):0!==N.length?(N[0]+=h,N[1]+=h,N):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,f=i*t+s-4*o,h=c*o-i*a*t+u,d=e.computeRealRoots(1,l,f,h);if(d.length>0){var E,p,_=d[0],m=a-_,y=m*m,T=t/2,R=m/2,A=y-4*o,S=y+4*Math.abs(o),v=c-4*_,N=c+4*Math.abs(_);if(_<0||A*N<v*S){var g=Math.sqrt(v);E=g/2,p=0===g?0:(t*R-i)/g}else{var I=Math.sqrt(A);E=0===I?0:(t*R-i)/I,p=I/2}var M,O;0===T&&0===E?(M=0,O=0):n.sign(T)===n.sign(E)?(M=T+E,O=_/M):(O=T-E,M=_/O);var x,w;0===R&&0===p?(x=0,w=0):n.sign(R)===n.sign(p)?(x=R+p,w=o/x):(w=R-p,x=o/w);var C=r.computeRealRoots(1,M,x),P=r.computeRealRoots(1,O,w);if(0!==C.length)return 0!==P.length?C[1]<=P[0]?[C[0],C[1],P[0],P[1]]:P[1]<=C[0]?[P[0],P[1],C[0],C[1]]:C[0]>=P[0]&&C[1]<=P[1]?[P[0],C[0],C[1],P[1]]:P[0]>=C[0]&&P[1]<=C[1]?[C[0],P[0],P[1],C[1]]:C[0]>P[0]&&C[0]<P[1]?[P[0],C[0],P[1],C[1]]:[C[0],P[0],C[1],P[1]]:C;if(0!==P.length)return P}return[]}var o={};return o.computeDiscriminant=function(e,t,n,r,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=n*n,l=c*n,f=r*r,h=f*r,d=a*a,E=d*a,p=u*c*f-4*s*h-4*e*l*f+18*e*t*n*h-27*i*f*f+256*o*E+a*(18*s*n*r-4*u*l+16*e*c*c-80*e*t*c*r-6*e*u*f+144*i*n*f)+d*(144*e*u*n-27*u*u-128*i*c-192*i*t*r);return p},o.computeRealRoots=function(t,r,o,u,s){if(Math.abs(t)<n.EPSILON15)return e.computeRealRoots(r,o,u,s);var c=r/t,l=o/t,f=u/t,h=s/t,d=c<0?1:0;switch(d+=l<0?d+1:d,d+=f<0?d+1:d,d+=h<0?d+1:d){case 0:return a(c,l,f,h);case 1:return i(c,l,f,h);case 2:return i(c,l,f,h);case 3:return a(c,l,f,h);case 4:return a(c,l,f,h);case 5:return i(c,l,f,h);case 6:return a(c,l,f,h);case 7:return a(c,l,f,h);case 8:return i(c,l,f,h);case 9:return a(c,l,f,h);case 10:return a(c,l,f,h);case 11:return i(c,l,f,h);case 12:return a(c,l,f,h);case 13:return a(c,l,f,h);case 14:return a(c,l,f,h);case 15:return a(c,l,f,h);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=e.clone(t(r,e.ZERO)),e.equals(r,e.ZERO)||e.normalize(r,r),this.origin=e.clone(t(n,e.ZERO)),this.direction=r}return a.getPoint=function(t,r,a){return n(a)||(a=new e),a=e.multiplyByScalar(t.direction,r,a),e.add(t.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t,n,r){var a=t*t-4*e*n;if(!(a<0)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return u<s?(r.root0=u,r.root1=s):(r.root0=s,r.root1=u),r}var c=-t/(2*e);if(0!==c)return r.root0=r.root1=c,r}}function f(t,n,a){r(a)||(a={});var i=t.origin,o=t.direction,u=n.center,s=n.radius*n.radius,c=e.subtract(i,u,m),f=e.dot(o,o),h=2*e.dot(o,c),d=e.magnitudeSquared(c)-s,E=l(f,h,d,A);if(r(E))return a.start=E.root0,a.stop=E.root1,a}function h(e,t,n){var r=e+t;return i.sign(e)!==i.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))<n?0:r}function d(t,n,r,a,c){var l,f=a*a,d=c*c,E=(t[o.COLUMN1ROW1]-t[o.COLUMN2ROW2])*d,p=c*(a*h(t[o.COLUMN1ROW0],t[o.COLUMN0ROW1],i.EPSILON15)+n.y),_=t[o.COLUMN0ROW0]*f+t[o.COLUMN2ROW2]*d+a*n.x+r,m=d*h(t[o.COLUMN2ROW1],t[o.COLUMN1ROW2],i.EPSILON15),y=c*(a*h(t[o.COLUMN2ROW0],t[o.COLUMN0ROW2])+n.z),T=[];if(0===y&&0===m){if(l=u.computeRealRoots(E,p,_),0===l.length)return T;var R=l[0],A=Math.sqrt(Math.max(1-R*R,0));if(T.push(new e(a,c*R,c*-A)),T.push(new e(a,c*R,c*A)),2===l.length){var S=l[1],v=Math.sqrt(Math.max(1-S*S,0));T.push(new e(a,c*S,c*-v)),T.push(new e(a,c*S,c*v))}return T}var N=y*y,g=m*m,I=E*E,M=y*m,O=I+g,x=2*(p*E+M),w=2*_*E+p*p-g+N,C=2*(_*p-M),P=_*_-N;if(0===O&&0===x&&0===w&&0===C)return T;l=s.computeRealRoots(O,x,w,C,P);var U=l.length;if(0===U)return T;for(var D=0;D<U;++D){var L,F=l[D],z=F*F,B=Math.max(1-z,0),b=Math.sqrt(B);L=i.sign(E)===i.sign(_)?h(E*z+_,p*F,i.EPSILON12):i.sign(_)===i.sign(p*F)?h(E*z,p*F+_,i.EPSILON12):h(E*z+p*F,_,i.EPSILON12);var G=h(m*F,y,i.EPSILON15),q=L*G;q<0?T.push(new e(a,c*F,c*b)):q>0?T.push(new e(a,c*F,c*-b)):0!==b?(T.push(new e(a,c*F,c*-b)),T.push(new e(a,c*F,c*b)),++D):T.push(new e(a,c*F,c*b))}return T}var E={};E.rayPlane=function(t,n,a){r(a)||(a=new e);var o=t.origin,u=t.direction,s=n.normal,c=e.dot(s,u);if(!(Math.abs(c)<i.EPSILON15)){var l=(-n.distance-e.dot(s,o))/c;if(!(l<0))return a=e.multiplyByScalar(u,l,a),e.add(o,a,a)}};var p=new e,_=new e,m=new e,y=new e,T=new e;E.rayTriangleParametric=function(t,r,a,o,u){u=n(u,!1);var s,c,l,f,h,d=t.origin,E=t.direction,R=e.subtract(a,r,p),A=e.subtract(o,r,_),S=e.cross(E,A,m),v=e.dot(R,S);if(u){if(v<i.EPSILON6)return;if(s=e.subtract(d,r,y),l=e.dot(s,S),l<0||l>v)return;if(c=e.cross(s,R,T),f=e.dot(E,c),f<0||l+f>v)return;h=e.dot(A,c)/v}else{if(Math.abs(v)<i.EPSILON6)return;var N=1/v;if(s=e.subtract(d,r,y),l=e.dot(s,S)*N,l<0||l>1)return;if(c=e.cross(s,R,T),f=e.dot(E,c)*N,f<0||l+f>1)return;h=e.dot(A,c)*N}return h},E.rayTriangle=function(t,n,a,i,o,u){var s=E.rayTriangleParametric(t,n,a,i,o);if(r(s)&&!(s<0))return r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var R=new c;E.lineSegmentTriangle=function(t,n,a,i,o,u,s){var c=R;e.clone(t,c.origin),e.subtract(n,t,c.direction),e.normalize(c.direction,c.direction);var l=E.rayTriangleParametric(c,a,i,o,u);if(!(!r(l)||l<0||l>e.distance(t,n)))return r(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var A={root0:0,root1:0};E.raySphere=function(e,t,n){if(n=f(e,t,n),r(n)&&!(n.stop<0))return n.start=Math.max(n.start,0),n};var S=new c;E.lineSegmentSphere=function(t,n,a,i){var o=S;e.clone(t,o.origin);var u=e.subtract(n,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),i=f(o,a,i),!(!r(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var v=new e,N=new e;E.rayEllipsoid=function(t,n){var r,a,i,o,u,s=n.oneOverRadii,c=e.multiplyComponents(s,t.origin,v),l=e.multiplyComponents(s,t.direction,N),f=e.magnitudeSquared(c),h=e.dot(c,l);if(f>1){if(h>=0)return;var d=h*h;if(r=f-1,a=e.magnitudeSquared(l),i=a*r,d<i)return;if(d>i){o=h*h-i,u=-h+Math.sqrt(o);var E=u/a,p=r/u;return E<p?{start:E,stop:p}:{start:p,stop:E}}var _=Math.sqrt(r/a);return{start:_,stop:_}}return f<1?(r=f-1,a=e.magnitudeSquared(l),i=a*r,o=h*h-i,u=-h+Math.sqrt(o),{start:0,stop:u/a}):h<0?(a=e.magnitudeSquared(l),{start:0,stop:-h/a}):void 0};var g=new e,I=new e,M=new e,O=new e,x=new e,w=new o,C=new o,P=new o,U=new o,D=new o,L=new o,F=new o,z=new e,B=new e,b=new t;E.grazingAltitudeLocation=function(t,n){var a=t.origin,u=t.direction;if(!e.equals(a,e.ZERO)){var s=n.geodeticSurfaceNormal(a,g);if(e.dot(u,s)>=0)return a}var c=r(this.rayEllipsoid(t,n)),l=n.transformPositionToScaledSpace(u,g),f=e.normalize(l,l),h=e.mostOrthogonalAxis(l,O),E=e.normalize(e.cross(h,f,I),I),p=e.normalize(e.cross(f,E,M),M),_=w;_[0]=f.x,_[1]=f.y,_[2]=f.z,_[3]=E.x,_[4]=E.y,_[5]=E.z,_[6]=p.x,_[7]=p.y,_[8]=p.z;var m=o.transpose(_,C),y=o.fromScale(n.radii,P),T=o.fromScale(n.oneOverRadii,U),R=D;R[0]=0,R[1]=-u.z,R[2]=u.y,R[3]=u.z,R[4]=0,R[5]=-u.x,R[6]=-u.y,R[7]=u.x,R[8]=0;var A,S,v=o.multiply(o.multiply(m,T,L),R,L),N=o.multiply(o.multiply(v,y,F),_,F),G=o.multiplyByVector(v,a,x),q=d(N,e.negate(G,g),0,0,1),W=q.length;if(W>0){for(var X=e.clone(e.ZERO,B),V=Number.NEGATIVE_INFINITY,H=0;H<W;++H){A=o.multiplyByVector(y,o.multiplyByVector(_,q[H],z),z);var Y=e.normalize(e.subtract(A,a,O),O),Z=e.dot(Y,u);Z>V&&(V=Z,X=e.clone(A,X))}var k=n.cartesianToCartographic(X,b);return V=i.clamp(V,0,1),S=e.magnitude(e.subtract(X,a,O))*Math.sqrt(1-V*V),S=c?-S:S,k.height=S,n.cartographicToCartesian(k,new e)}};var G=new e;return E.lineSegmentPlane=function(t,n,a,o){r(o)||(o=new e);var u=e.subtract(n,t,G),s=a.normal,c=e.dot(s,u);if(!(Math.abs(c)<i.EPSILON6)){var l=e.dot(s,t),f=-(a.distance+l)/c;if(!(f<0||f>1))return e.multiplyByScalar(u,f,o),e.add(t,o,o),o}},E.trianglePlaneIntersection=function(t,n,r,a){var i=a.normal,o=a.distance,u=e.dot(i,t)+o<0,s=e.dot(i,n)+o<0,c=e.dot(i,r)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var f,h;if(1!==l&&2!==l||(f=new e,h=new e),1===l){if(u)return E.lineSegmentPlane(t,n,a,f),E.lineSegmentPlane(t,r,a,h),{positions:[t,n,r,f,h],indices:[0,3,4,1,2,4,1,4,3]};if(s)return E.lineSegmentPlane(n,r,a,f),E.lineSegmentPlane(n,t,a,h),{positions:[t,n,r,f,h],indices:[1,3,4,2,0,4,2,4,3]};if(c)return E.lineSegmentPlane(r,t,a,f),E.lineSegmentPlane(r,n,a,h),{positions:[t,n,r,f,h],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return E.lineSegmentPlane(n,t,a,f),E.lineSegmentPlane(r,t,a,h),{positions:[t,n,r,f,h],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return E.lineSegmentPlane(r,n,a,f),E.lineSegmentPlane(t,n,a,h),{positions:[t,n,r,f,h],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return E.lineSegmentPlane(t,r,a,f),E.lineSegmentPlane(n,r,a,h),{positions:[t,n,r,f,h],indices:[0,1,4,0,4,3,2,3,4]}}},E}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";function a(t,n){this.normal=e.clone(t),this.distance=n}a.fromPointNormal=function(n,r,i){var o=-e.dot(r,n);return t(i)?(e.clone(r,i.normal),i.distance=o,i):new a(r,o)};var i=new e;return a.fromCartesian4=function(n,r){var o=e.fromCartesian4(n,i),u=n.w;return t(r)?(e.clone(o,r.normal),r.distance=u,r):new a(o,u)},a.getPointDistance=function(t,n){return e.dot(t.normal,n)+t.distance},a.ORIGIN_XY_PLANE=r(new a(e.UNIT_Z,0)),a.ORIGIN_YZ_PLANE=r(new a(e.UNIT_X,0)),a.ORIGIN_ZX_PLANE=r(new a(e.UNIT_Y,0)),a}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,n,r,a){return t(e).then(n,r,a)}function t(e){var t,n;return e instanceof r?t=e:u(e)?(n=o(),e.then(function(e){n.resolve(e)},function(e){n.reject(e)},function(e){n.progress(e)}),t=n.promise):t=a(e),t}function n(t){return e(t,i)}function r(e){this.then=e}function a(e){var n=new r(function(n){try{return t(n?n(e):e)}catch(e){return i(e)}});return n}function i(e){var n=new r(function(n,r){try{return r?t(r(e)):i(e)}catch(e){return i(e)}});return n}function o(){function e(e,t,n){return h(e,t,n)}function n(e){return E(e)}function a(e){return E(i(e))}function u(e){return d(e)}var s,c,l,f,h,d,E;return c=new r(e),s={then:e,resolve:n,reject:a,progress:u,promise:c,resolver:{resolve:n,reject:a,progress:u}},l=[],f=[],h=function(e,t,n){var r,a;return r=o(),a="function"==typeof n?function(e){try{r.progress(n(e))}catch(e){r.progress(e)}}:function(e){r.progress(e)},l.push(function(n){n.then(e,t).then(r.resolve,r.reject,a)}),f.push(a),r.promise},d=function(e){return p(f,e),e},E=function(e){return e=t(e),h=e.then,E=t,d=m,p(l,e),f=l=A,e},s}function u(e){return e&&"function"==typeof e.then}function s(t,n,r,a,i){return _(2,arguments),e(t,function(t){function u(e){p(e)}function s(e){E(e)}var c,l,f,h,d,E,p,_,y,T;if(y=t.length>>>0,c=Math.max(0,Math.min(n,y)),f=[],l=y-c+1,h=[],d=o(),c)for(_=d.progress,p=function(e){h.push(e),--l||(E=p=m,d.reject(h))},E=function(e){f.push(e),--c||(E=p=m,d.resolve(f))},T=0;T<y;++T)T in t&&e(t[T],s,u,_);else d.resolve(f);return d.then(r,a,i)})}function c(e,t,n,r){function a(e){return t?t(e[0]):e[0]}return s(e,1,a,n,r)}function l(e,t,n,r){return _(1,arguments),h(e,y).then(t,n,r)}function f(){return h(arguments,y)}function h(t,n){return e(t,function(t){var r,a,i,u,s,c;if(i=a=t.length>>>0,r=[],c=o(),i)for(u=function(t,a){e(t,n).then(function(e){r[a]=e,--i||c.resolve(r)},c.reject)},s=0;s<a;s++)s in t?u(t[s],s):--i;else c.resolve(r);return c.promise})}function d(t,n){var r=R.call(arguments,1);return e(t,function(t){var a;return a=t.length,r[0]=function(t,r,i){return e(t,function(t){return e(r,function(e){return n(t,e,i,a)})})},T.apply(t,r)})}function E(t,n,r){var a=arguments.length>2;return e(t,function(e){return e=a?r:e,n.resolve(e),e},function(e){return n.reject(e),i(e)},n.progress)}function p(e,t){for(var n,r=0;n=e[r++];)n(t)}function _(e,t){for(var n,r=t.length;r>e;)if(n=t[--r],null!=n&&"function"!=typeof n)throw new Error("arg "+r+" must be a function")}function m(){}function y(e){return e}var T,R,A;return e.defer=o,e.resolve=t,e.reject=n,e.join=f,e.all=l,e.map=h,e.reduce=d,e.any=c,e.some=s,e.chain=E,e.isPromise=u,r.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(A,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return l(t,function(t){return e.apply(A,t)})})}},R=[].slice,T=[].reduce||function(e){var t,n,r,a,i;if(i=0,t=Object(this),a=t.length>>>0,n=arguments,n.length<=1)for(;;){if(i in t){r=t[i++];break}if(++i>=a)throw new TypeError}else r=n[1];for(;i<a;++i)i in t&&(r=e(r,t[i],i,t));return r},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n,r){t(a[n])||(a[n]=!0,console.log(e(r,n)))}var a={};return r.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.",r}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,n){"use strict";function r(e,t){n(e,t)}return r}),define("Core/binarySearch",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e,t,n){for(var r,a,i=0,o=e.length-1;i<=o;)if(r=~~((i+o)/2),a=n(e[r],t),a<0)i=r+1;else{if(!(a>0))return r;o=r-1}return~(o+1)}return n}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,n,r,a){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=r,this.ut1MinusUtc=a}return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,n=0,r=t[n++],a=function(e,t,n,r){n||(n=" ");var a=e.length>=t?"":Array(1+t-e.length>>>0).join(n);return r?e+a:a+e},i=function(e,t,n,r,i,o){var u=r-e.length;return u>0&&(e=n||!i?a(e,r,o,n):e.slice(0,t.length)+a("",u,"0",!0)+e.slice(t.length)),e},o=function(e,t,n,r,o,u,s){var c=e>>>0;return n=n&&c&&{2:"0b",8:"0",16:"0x"}[t]||"",e=n+a(c.toString(t),u||0,"0",!1),i(e,n,r,o,s)},u=function(e,t,n,r,a,o){return null!=r&&(e=e.slice(0,r)),i(e,"",t,n,a,o)},s=function(e,r,s,c,l,f,h){var d,E,p,_,m;if("%%"==e)return"%";for(var y=!1,T="",R=!1,A=!1,S=" ",v=s.length,N=0;s&&N<v;N++)switch(s.charAt(N)){case" ":T=" ";break;case"+":T="+";break;case"-":y=!0;break;case"'":S=s.charAt(N+1);break;case"0":R=!0;break;case"#":A=!0}if(c=c?"*"==c?+t[n++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,c<0&&(c=-c,y=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(f=f?"*"==f?+t[n++]:"*"==f.charAt(0)?+t[f.slice(1,-1)]:+f:"fFeE".indexOf(h)>-1?6:"d"==h?0:void 0,m=r?t[r.slice(0,-1)]:t[n++],h){case"s":return u(String(m),y,c,f,R,S);case"c":return u(String.fromCharCode(+m),y,c,f,R);case"b":return o(m,2,A,y,c,f,R);case"o":return o(m,8,A,y,c,f,R);case"x":return o(m,16,A,y,c,f,R);case"X":return o(m,16,A,y,c,f,R).toUpperCase();case"u":return o(m,10,A,y,c,f,R);case"i":case"d":return d=+m||0,d=Math.round(d-d%1),E=d<0?"-":T,m=E+a(String(Math.abs(d)),f,"0",!1),i(m,E,y,c,R);case"e":case"E":case"f":case"F":case"g":case"G":return d=+m,E=d<0?"-":T,p=["toExponential","toFixed","toPrecision"]["efg".indexOf(h.toLowerCase())],_=["toString","toUpperCase"]["eEfFgG".indexOf(h)%2],m=E+Math.abs(d)[p](f),i(m,E,y,c,R)[_]();default:return e}};return r.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,n,r,a,i,o,u){this.year=e,this.month=t,this.day=n,this.hour=r,this.minute=a,this.second=i,this.millisecond=o,this.isLeapSecond=u}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e(t)}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t){return p.compare(e.julianDate,t.julianDate)}function f(e){T.julianDate=e;var n=p.leapSeconds,r=t(n,T,l);r<0&&(r=~r),r>=n.length&&(r=n.length-1);var a=n[r].offset;if(r>0){var i=p.secondsDifference(n[r].julianDate,e);i>a&&(r--,a=n[r].offset)}p.addSeconds(e,a,e)}function h(e,n){T.julianDate=e;var r=p.leapSeconds,a=t(r,T,l);if(a<0&&(a=~a),0===a)return p.addSeconds(e,-r[0].offset,n);if(a>=r.length)return p.addSeconds(e,-r[a-1].offset,n);var i=p.secondsDifference(r[a].julianDate,e);return 0===i?p.addSeconds(e,-r[a].offset,n):i<=1?void 0:p.addSeconds(e,-r[--a].offset,n)}function d(e,t,n){var r=t/s.SECONDS_PER_DAY|0;return e+=r,t-=s.SECONDS_PER_DAY*r,t<0&&(e--,t+=s.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function E(e,t,n,r,a,i,o){var u=(t-14)/12|0,c=e+4800+u,l=(1461*c/4|0)+(367*(t-2-12*u)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;r-=12,r<0&&(r+=24);var f=i+(r*s.SECONDS_PER_HOUR+a*s.SECONDS_PER_MINUTE+o*s.SECONDS_PER_MILLISECOND);return f>=43200&&(l-=1),[l,f]}function p(e,t,r){this.dayNumber=void 0,this.secondsOfDay=void 0,e=n(e,0),t=n(t,0),r=n(r,c.UTC);var a=0|e;t+=(e-a)*s.SECONDS_PER_DAY,d(a,t,this),r===c.UTC&&f(this)}var _=new i,m=[31,28,31,30,31,30,31,31,30,31,30,31],y=29,T=new u,R=/^(\d{4})$/,A=/^(\d{4})-(\d{2})$/,S=/^(\d{4})-?(\d{3})$/,v=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,N=/^(\d{4})-?(\d{2})-?(\d{2})$/,g=/([Z+\-])?(\d{2})?:?(\d{2})?$/,I=/^(\d{2})(\.\d+)?/.source+g.source,M=/^(\d{2}):?(\d{2})(\.\d+)?/.source+g.source,O=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+g.source;p.fromDate=function(e,t){var n=E(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r(t)?(d(n[0],n[1],t),f(t),t):new p(n[0],n[1],c.UTC)},p.fromIso8601=function(e,t){e=e.replace(",",".");var n,a,i,u=e.split("T"),s=1,l=1,h=0,_=0,T=0,g=0,x=u[0],w=u[1];if(u=x.match(N),null!==u)n=+u[1],s=+u[2],l=+u[3];else if(u=x.match(A),null!==u)n=+u[1],s=+u[2];else if(u=x.match(R),null!==u)n=+u[1];else{var C;if(u=x.match(S),null!==u)n=+u[1],C=+u[2],i=o(n);else if(u=x.match(v),null!==u){n=+u[1];var P=+u[2],U=+u[3]||0,D=new Date(Date.UTC(n,0,4));C=7*P+U-D.getUTCDay()-3}a=new Date(Date.UTC(n,0,1)),a.setUTCDate(C),s=a.getUTCMonth()+1,l=a.getUTCDate()}i=o(n);var L;if(r(w)){u=w.match(O),null!==u?(h=+u[1],_=+u[2],T=+u[3],g=1e3*+(u[4]||0),L=5):(u=w.match(M),null!==u?(h=+u[1],_=+u[2],T=60*+(u[3]||0),L=4):(u=w.match(I),null!==u&&(h=+u[1],_=60*+(u[2]||0),L=3)));var F=u[L],z=+u[L+1],B=+(u[L+2]||0);switch(F){case"+":h-=z,_-=B;break;case"-":h+=z,_+=B;break;case"Z":break;default:_+=new Date(Date.UTC(n,s-1,l,h,_)).getTimezoneOffset()}}else _+=new Date(n,s-1,l).getTimezoneOffset();var b=60===T;for(b&&T--;_>=60;)_-=60,h++;for(;h>=24;)h-=24,l++;for(a=i&&2===s?y:m[s-1];l>a;)l-=a,s++,s>12&&(s-=12,n++),a=i&&2===s?y:m[s-1];for(;_<0;)_+=60,h--;for(;h<0;)h+=24,l--;for(;l<1;)s--,s<1&&(s+=12,n--),a=i&&2===s?y:m[s-1],l+=a;var G=E(n,s,l,h,_,T,g);return r(t)?(d(G[0],G[1],t),f(t)):t=new p(G[0],G[1],c.UTC),b&&p.addSeconds(t,1,t),t},p.now=function(e){return p.fromDate(new Date,e)};var x=new p(0,0,c.TAI);return p.toGregorianDate=function(e,t){var n=!1,a=h(e,x);r(a)||(p.addSeconds(e,-1,x),a=h(x,x),n=!0);var o=a.dayNumber,u=a.secondsOfDay;u>=43200&&(o+=1);var c=o+68569|0,l=4*c/146097|0;c=c-((146097*l+3)/4|0)|0;var f=4e3*(c+1)/1461001|0;c=c-(1461*f/4|0)+31|0;var d=80*c/2447|0,E=c-(2447*d/80|0)|0;c=d/11|0;var _=d+2-12*c|0,m=100*(l-49)+f+c|0,y=u/s.SECONDS_PER_HOUR|0,T=u-y*s.SECONDS_PER_HOUR,R=T/s.SECONDS_PER_MINUTE|0;T-=R*s.SECONDS_PER_MINUTE;var A=0|T,S=(T-A)/s.SECONDS_PER_MILLISECOND;return y+=12,y>23&&(y-=24),n&&(A+=1),r(t)?(t.year=m,t.month=_,t.day=E,t.hour=y,t.minute=R,t.second=A,t.millisecond=S,t.isLeapSecond=n,t):new i(m,_,E,y,R,A,S,n)},p.toDate=function(e){var t=p.toGregorianDate(e,_),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))},p.toIso8601=function(t,n){var a,i=p.toGregorianDate(t,i);return r(n)||0===i.millisecond?r(n)&&0!==n?(a=(.01*i.millisecond).toFixed(n).replace(".","").slice(0,n),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",i.year,i.month,i.day,i.hour,i.minute,i.second):(a=(.01*i.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a))},p.clone=function(e,t){if(r(e))return r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new p(e.dayNumber,e.secondsOfDay,c.TAI)},p.compare=function(e,t){var n=e.dayNumber-t.dayNumber;return 0!==n?n:e.secondsOfDay-t.secondsOfDay},p.equals=function(e,t){return e===t||r(e)&&r(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},p.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(p.secondsDifference(e,t))<=n},p.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},p.secondsDifference=function(e,t){var n=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return n+(e.secondsOfDay-t.secondsOfDay)},p.daysDifference=function(e,t){var n=e.dayNumber-t.dayNumber,r=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return n+r},p.computeTaiMinusUtc=function(e){T.julianDate=e;var n=p.leapSeconds,r=t(n,T,l);return r<0&&(r=~r,--r,r<0&&(r=0)),n[r].offset},p.addSeconds=function(e,t,n){return d(e.dayNumber,e.secondsOfDay+t,n)},p.addMinutes=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return d(e.dayNumber,r,n)},p.addHours=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return d(e.dayNumber,r,n)},p.addDays=function(e,t,n){var r=e.dayNumber+t;return d(r,e.secondsOfDay,n)},p.lessThan=function(e,t){return p.compare(e,t)<0},p.lessThanOrEquals=function(e,t){return p.compare(e,t)<=0},p.greaterThan=function(e,t){return p.compare(e,t)>0},p.greaterThanOrEquals=function(e,t){return p.compare(e,t)>=0},p.prototype.clone=function(e){return p.clone(this,e)},p.prototype.equals=function(e){return p.equals(this,e)},p.prototype.equalsEpsilon=function(e,t){return p.equalsEpsilon(this,e,t)},p.prototype.toString=function(){return p.toIso8601(this)},p.leapSeconds=[new u(new p(2441317,43210,c.TAI),10),new u(new p(2441499,43211,c.TAI),11),new u(new p(2441683,43212,c.TAI),12),new u(new p(2442048,43213,c.TAI),13),new u(new p(2442413,43214,c.TAI),14),new u(new p(2442778,43215,c.TAI),15),new u(new p(2443144,43216,c.TAI),16),new u(new p(2443509,43217,c.TAI),17),new u(new p(2443874,43218,c.TAI),18),new u(new p(2444239,43219,c.TAI),19),new u(new p(2444786,43220,c.TAI),20),new u(new p(2445151,43221,c.TAI),21),new u(new p(2445516,43222,c.TAI),22),new u(new p(2446247,43223,c.TAI),23),new u(new p(2447161,43224,c.TAI),24),new u(new p(2447892,43225,c.TAI),25),new u(new p(2448257,43226,c.TAI),26),new u(new p(2448804,43227,c.TAI),27),new u(new p(2449169,43228,c.TAI),28),new u(new p(2449534,43229,c.TAI),29),new u(new p(2450083,43230,c.TAI),30),new u(new p(2450630,43231,c.TAI),31),new u(new p(2451179,43232,c.TAI),32),new u(new p(2453736,43233,c.TAI),33),new u(new p(2454832,43234,c.TAI),34),new u(new p(2456109,43235,c.TAI),35),new u(new p(2457204,43236,c.TAI),36),new u(new p(2457754,43237,c.TAI),37)],p}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(n,r){if(null===n||"object"!=typeof n)return n;r=e(r,!1);var a=new n.constructor;for(var i in n)if(n.hasOwnProperty(i)){var o=n[i];r&&(o=t(o,r)),a[i]=o}return a}return t}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var n=e.split("\r\n"),r=0;r<n.length;++r){var a=n[r],i=a.indexOf(": ");if(i>0){var o=a.substring(0,i),u=a.substring(i+2);t[o]=u}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function n(e,n,r){this.statusCode=e,this.response=n,this.responseHeaders=r,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return n.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},n}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var n=r.exec(t);this.scheme=n[1],this.authority=n[2],this.path=n[3],this.query=n[4],this.fragment=n[5]}}function t(e){var t=unescape(e);return i.test(t)?t:e.toUpperCase()}function n(e,t,n,r){return(t||"")+n.toLowerCase()+(r||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var r=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(o,n).replace(a,t)),this.path&&(this.path=this.path.replace(a,t)),this.query&&(this.query=this.query.replace(a,t)),this.fragment&&(this.fragment=this.fragment.replace(a,t))};var a=/%[0-9a-z]{2}/gi,i=/[a-zA-Z0-9\-\._~]/,o=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var n=new e;return this.scheme?(n.scheme=this.scheme,n.authority=this.authority,n.path=this.path,n.query=this.query):(n.scheme=t.scheme,this.authority?(n.authority=this.authority, -n.path=this.path,n.query=this.query):(n.authority=t.authority,""==this.path?(n.path=t.path,n.query=this.query||t.query):("/"==this.path.charAt(0)?(n.path=this.path,n.removeDotSegments()):(t.authority&&""==t.path?n.path="/"+this.path:n.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,n.removeDotSegments()),n.query=this.query))),n.fragment=this.fragment,n},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),n=[],r=""==t[0];r&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?n.pop():"."!=e&&n.push(e);"."!=e&&".."!=e||n.push(""),r&&n.unshift(""),this.path=n.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n){var r=new e(n);r.normalize();var a=r.getAuthority();if(t(a)){if(a.indexOf("@")!==-1){var i=a.split("@");a=i[1]}if(a.indexOf(":")===-1){var o=r.getScheme();if(t(o)||(o=window.location.protocol,o=o.substring(0,o.length-1)),"http"===o)a+=":80";else{if("https"!==o)return;a+=":443"}}return a}}var a={},i={};return a.add=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])||(i[r]=!0)},a.remove=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])&&delete i[r]},a.contains=function(e){var n=r(e);return!(!t(n)||!t(i[n]))},a.clear=function(){i={}},a}),define("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,n,r,a,i,o){"use strict";function u(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,a=t(n.method,"GET"),i=n.data,o=n.headers,s=n.overrideMimeType;return e(n.url,function(t){var n=e.defer();return u.load(t,r,a,i,o,n,s),n.promise})}function s(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function c(e,t){for(var n=s(e,t),r=new ArrayBuffer(n.length),a=new Uint8Array(r),i=0;i<n.length;i++)a[i]=n.charCodeAt(i);return r}function l(e,n){n=t(n,"");var r=e[1],a=!!e[2],i=e[3];switch(n){case"":case"text":return s(a,i);case"arraybuffer":return c(a,i);case"blob":var o=c(a,i);return new Blob([o],{type:r});case"document":var u=new DOMParser;return u.parseFromString(s(a,i),r);case"json":return JSON.parse(s(a,i))}}var f=/^data:(.*?)(;base64)?,(.*)$/;return u.load=function(e,t,r,u,s,c,h){var d=f.exec(e);if(null!==d)return void c.resolve(l(d,t));var E=new XMLHttpRequest;if(o.contains(e)&&(E.withCredentials=!0),n(h)&&n(E.overrideMimeType)&&E.overrideMimeType(h),E.open(r,e,!0),n(s))for(var p in s)s.hasOwnProperty(p)&&E.setRequestHeader(p,s[p]);n(t)&&(E.responseType=t),E.onload=function(){if(E.status<200||E.status>=300)return void c.reject(new a(E.status,E.response,E.getAllResponseHeaders()));var e=E.response,r=E.responseType;if(!n(e)||n(t)&&r!==t)if("json"===t&&"string"==typeof e)try{c.resolve(JSON.parse(e))}catch(e){c.reject(e)}else(""===r||"document"===r)&&n(E.responseXML)&&E.responseXML.hasChildNodes()?c.resolve(E.responseXML):""!==r&&"text"!==r||!n(E.responseText)?c.reject(new i("Invalid XMLHttpRequest response type.")):c.resolve(E.responseText);else c.resolve(e)},E.onerror=function(e){c.reject(new a)},E.send(u)},u.defaultLoad=u.load,u}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,n){return e({url:t,headers:n})}return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";function a(n,a){return t(a)?t(a.Accept)||(a=e(a),a.Accept=i.Accept):a=i,r(n,a).then(function(e){return JSON.parse(e)})}var i={Accept:"application/json,*/*;q=0.01"};return a}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(t){if(t=n(t,n.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=n(t.addNewLeapSeconds,!0),r(t.data))E(this,t.data);else if(r(t.url)){var a=this;this._downloadPromise=e(s(t.url),function(e){E(a,e)},function(){a._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else E(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function d(e,t){return o.compare(e.julianDate,t)}function E(e,n){if(!r(n.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!r(n.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var a=n.columnNames.indexOf("modifiedJulianDateUtc"),i=n.columnNames.indexOf("xPoleWanderRadians"),s=n.columnNames.indexOf("yPoleWanderRadians"),c=n.columnNames.indexOf("ut1MinusUtcSeconds"),h=n.columnNames.indexOf("xCelestialPoleOffsetRadians"),E=n.columnNames.indexOf("yCelestialPoleOffsetRadians"),p=n.columnNames.indexOf("taiMinusUtcSeconds");if(a<0||i<0||s<0||c<0||h<0||E<0||p<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var _=e._samples=n.samples,m=e._dates=[];e._dateColumn=a,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=h,e._yCelestialPoleOffsetRadiansColumn=E,e._taiMinusUtcSecondsColumn=p,e._columnCount=n.columnNames.length,e._lastIndex=void 0;for(var y,T=e._addNewLeapSeconds,R=0,A=_.length;R<A;R+=e._columnCount){var S=_[R+a],v=_[R+p],N=S+l.MODIFIED_JULIAN_DATE_DIFFERENCE,g=new o(N,v,f.TAI);if(m.push(g),T){if(v!==y&&r(y)){var I=o.leapSeconds,M=t(I,g,d);if(M<0){var O=new u(g,v);I.splice(~M,0,O)}}y=v}}}function p(e,t,n,r,a){var i=n*r;a.xPoleWander=t[i+e._xPoleWanderRadiansColumn],a.yPoleWander=t[i+e._yPoleWanderRadiansColumn],a.xPoleOffset=t[i+e._xCelestialPoleOffsetRadiansColumn],a.yPoleOffset=t[i+e._yCelestialPoleOffsetRadiansColumn],a.ut1MinusUtc=t[i+e._ut1MinusUtcSecondsColumn]}function _(e,t,n){return t+e*(n-t)}function m(e,t,n,r,a,i,u){var s=e._columnCount;if(i>t.length-1)return u.xPoleWander=0,u.yPoleWander=0,u.xPoleOffset=0,u.yPoleOffset=0,u.ut1MinusUtc=0,u;var c=t[a],l=t[i];if(c.equals(l)||r.equals(c))return p(e,n,a,s,u),u;if(r.equals(l))return p(e,n,i,s,u),u;var f=o.secondsDifference(r,c)/o.secondsDifference(l,c),h=a*s,d=i*s,E=n[h+e._ut1MinusUtcSecondsColumn],m=n[d+e._ut1MinusUtcSecondsColumn],y=m-E;if(y>.5||y<-.5){var T=n[h+e._taiMinusUtcSecondsColumn],R=n[d+e._taiMinusUtcSecondsColumn];T!==R&&(l.equals(r)?E=m:m-=R-T)}return u.xPoleWander=_(f,n[h+e._xPoleWanderRadiansColumn],n[d+e._xPoleWanderRadiansColumn]),u.yPoleWander=_(f,n[h+e._yPoleWanderRadiansColumn],n[d+e._yPoleWanderRadiansColumn]),u.xPoleOffset=_(f,n[h+e._xCelestialPoleOffsetRadiansColumn],n[d+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=_(f,n[h+e._yCelestialPoleOffsetRadiansColumn],n[d+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=_(f,E,m),u}return h.NONE=i({getPromiseToLoad:function(){return e()},compute:function(e,t){return r(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new a(0,0,0,0,0),t}}),h.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},h.prototype.compute=function(e,n){if(r(this._samples)){if(r(n)||(n=new a(0,0,0,0,0)),0===this._samples.length)return n.xPoleWander=0,n.yPoleWander=0,n.xPoleOffset=0,n.yPoleOffset=0,n.ut1MinusUtc=0,n;var i=this._dates,u=this._lastIndex,s=0,l=0;if(r(u)){var f=i[u],h=i[u+1],d=o.lessThanOrEquals(f,e),E=!r(h),p=E||o.greaterThanOrEquals(h,e);if(d&&p)return s=u,!E&&h.equals(e)&&++s,l=s+1,m(this,i,this._samples,e,s,l,n),n}var _=t(i,e,o.compare,this._dateColumn);return _>=0?(_<i.length-1&&i[_+1].equals(e)&&++_,s=_,l=_):(l=~_,s=l-1,s<0&&(s=0)),this._lastIndex=s,m(this,i,this._samples,e,s,l,n),n}if(r(this._dataError))throw new c(this._dataError)},h}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(t,n,r){this.heading=e(t,0),this.pitch=e(n,0),this.roll=e(r,0)}return a.fromQuaternion=function(e,n){t(n)||(n=new a);var r=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return n.heading=-Math.atan2(s,u),n.roll=Math.atan2(o,i),n.pitch=-Math.asin(r),n},a.fromDegrees=function(e,n,i,o){return t(o)||(o=new a),o.heading=e*r.RADIANS_PER_DEGREE,o.pitch=n*r.RADIANS_PER_DEGREE,o.roll=i*r.RADIANS_PER_DEGREE,o},a.clone=function(e,n){if(t(e))return t(n)?(n.heading=e.heading,n.pitch=e.pitch,n.roll=e.roll,n):new a(e.heading,e.pitch,e.roll)},a.equals=function(e,n){return e===n||t(e)&&t(n)&&e.heading===n.heading&&e.pitch===n.pitch&&e.roll===n.roll},a.equalsEpsilon=function(e,n,a,i){return e===n||t(e)&&t(n)&&r.equalsEpsilon(e.heading,n.heading,a,i)&&r.equalsEpsilon(e.pitch,n.pitch,a,i)&&r.equalsEpsilon(e.roll,n.roll,a,i)},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,n){return a.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},a}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=t(r,document.location.href);var a=new e(r),i=new e(n);return i.resolve(a).toString()}return a}),define("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(r,a,i){i=t(i,!0),r instanceof e||(r=new e(r)),a instanceof e||(a=new e(a)),n(a.authority)&&!n(a.scheme)&&("undefined"!=typeof document&&n(document.location)&&n(document.location.href)?a.scheme=new e(document.location.href).scheme:a.scheme=r.scheme);var o=r;a.isAbsolute()&&(o=a);var u="";n(o.scheme)&&(u+=o.scheme+":"),n(o.authority)&&(u+="//"+o.authority,""!==o.path&&"/"!==o.path&&(u=u.replace(/\/?$/,"/"),o.path=o.path.replace(/^\/?/g,""))),u+=o===r?i?r.path.replace(/\/?$/,"/")+a.path.replace(/^\/?/g,""):r.path+a.path:a.path;var s=n(r.query),c=n(a.query);s&&c?u+="?"+r.query+"&"+a.query:s&&!c?u+="?"+r.query:!s&&c&&(u+="?"+a.query);var l=n(a.fragment);return n(r.fragment)&&!l?u+="#"+r.fragment:l&&(u+="#"+a.fragment),u}return a}),define("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","./joinUrls","require"],function(e,t,n,r,a,i){"use strict";function o(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;t<n;++t){var r=e[t].getAttribute("src"),a=E.exec(r);if(null!==a)return a[1]}}function u(){if(t(f))return f;var n;return n="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:o(),f=new e(r(n))}function s(e){return i.toUrl("../"+e)}function c(e){return a(u(),e)}function l(e){t(h)||(h=t(i.toUrl)?s:c),t(d)||(d=document.createElement("a"));var n=h(e);return d.href=n,d.href=d.href,d.href}var f,h,d,E=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return l._cesiumScriptRegex=E,l.setBaseUrl=function(t){f=new e(t).resolve(new e(document.location.href))},l}),define("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,n){this.x=e,this.y=t,this.s=n}return e}),define("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){e=n(e,n.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=n(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=n(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new i(this._sampleZeroJulianEphemerisDate,0,u.TAI),this._stepSizeDays=n(e.stepSizeDays,1),this._samplesPerXysFile=n(e.samplesPerXysFile,1e3),this._totalSamples=n(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,r=this._denominators=new Array(t+1),a=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t),s=0;s<=t;++s){r[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;c<=t;++c)c!==s&&(r[s]*=s-c);r[s]=1/r[s]}this._work=new Array(t+1),this._coef=new Array(t+1)}function c(e,t,n){var r=f;return r.dayNumber=t,r.secondsOfDay=n,i.daysDifference(r,e._sampleZeroDateTT)}function l(n,a){if(n._chunkDownloadsInProgress[a])return n._chunkDownloadsInProgress[a];var i=e.defer();n._chunkDownloadsInProgress[a]=i;var u,s=n._xysFileUrlTemplate;return u=r(s)?s.replace("{0}",a):t("Assets/IAU2006_XYS/IAU2006_XYS_"+a+".json"),e(o(u),function(e){n._chunkDownloadsInProgress[a]=!1;for(var t=n._samples,r=e.samples,o=a*n._samplesPerXysFile*3,u=0,s=r.length;u<s;++u)t[o+u]=r[u];i.resolve()}),i.promise}var f=new i(0,0,u.TAI);return s.prototype.preload=function(t,n,r,a){var i=c(this,t,n),o=c(this,r,a),u=i/this._stepSizeDays-this._interpolationOrder/2|0;u<0&&(u=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var f=u/this._samplesPerXysFile|0,h=s/this._samplesPerXysFile|0,d=[],E=f;E<=h;++E)d.push(l(this,E));return e.all(d)},s.prototype.computeXysRadians=function(e,t,n){var i=c(this,e,t);if(!(i<0)){var o=i/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);s<0&&(s=0);var f=s+u;f>=this._totalSamples&&(f=this._totalSamples-1,s=f-u,s<0&&(s=0));var h=!1,d=this._samples;if(r(d[3*s])||(l(this,s/this._samplesPerXysFile|0),h=!0),r(d[3*f])||(l(this,f/this._samplesPerXysFile|0),h=!0),!h){r(n)?(n.x=0,n.y=0,n.s=0):n=new a(0,0,0);var E,p,_=i-s*this._stepSizeDays,m=this._work,y=this._denominators,T=this._coef,R=this._xTable;for(E=0;E<=u;++E)m[E]=_-R[E];for(E=0;E<=u;++E){for(T[E]=1,p=0;p<=u;++p)p!==E&&(T[E]*=m[p]);T[E]*=y[E];var A=3*(s+E);n.x+=T[E]*d[A++],n.y+=T[E]*d[A++],n.s+=T[E]*d[A]}return n}}}},s}),define("Core/Quaternion",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math","./Matrix3"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,n,r,a){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(a,0)}var c=new e;s.fromAxisAngle=function(t,r,a){var i=r/2,o=Math.sin(i);c=e.normalize(t,c);var u=c.x*o,l=c.y*o,f=c.z*o,h=Math.cos(i);return n(a)?(a.x=u,a.y=l,a.z=f,a.w=h,a):new s(u,l,f,h)};var l=[1,2,0],f=new Array(3);s.fromRotationMatrix=function(e,t){var r,a,i,o,c,h=e[u.COLUMN0ROW0],d=e[u.COLUMN1ROW1],E=e[u.COLUMN2ROW2],p=h+d+E;if(p>0)r=Math.sqrt(p+1),c=.5*r,r=.5/r,a=(e[u.COLUMN1ROW2]-e[u.COLUMN2ROW1])*r,i=(e[u.COLUMN2ROW0]-e[u.COLUMN0ROW2])*r,o=(e[u.COLUMN0ROW1]-e[u.COLUMN1ROW0])*r;else{var _=l,m=0;d>h&&(m=1),E>h&&E>d&&(m=2);var y=_[m],T=_[y];r=Math.sqrt(e[u.getElementIndex(m,m)]-e[u.getElementIndex(y,y)]-e[u.getElementIndex(T,T)]+1);var R=f;R[m]=.5*r,r=.5/r,c=(e[u.getElementIndex(T,y)]-e[u.getElementIndex(y,T)])*r,R[y]=(e[u.getElementIndex(y,m)]+e[u.getElementIndex(m,y)])*r,R[T]=(e[u.getElementIndex(T,m)]+e[u.getElementIndex(m,T)])*r,a=-R[0],i=-R[1],o=-R[2]}return n(t)?(t.x=a,t.y=i,t.z=o,t.w=c,t):new s(a,i,o,c)};var h=new s;s.fromHeadingPitchRoll=function(t,n,r,a){var i=s.fromAxisAngle(e.UNIT_X,r,h),o=s.fromAxisAngle(e.UNIT_Y,-n,a);a=s.multiply(o,i,o);var u=s.fromAxisAngle(e.UNIT_Z,-t,h);return s.multiply(u,a,a)};var d=new e,E=new e,p=new s,_=new s,m=new s;s.packedLength=4,s.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},s.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new s),a.x=e[r],a.y=e[r+1],a.z=e[r+2],a.w=e[r+3],a},s.packedInterpolationLength=3,s.convertPackedArrayForInterpolation=function(e,t,n,r){s.unpack(e,4*n,m),s.conjugate(m,m);for(var a=0,i=n-t+1;a<i;a++){var o=3*a;s.unpack(e,4*(t+a),p),s.multiply(p,m,p),p.w<0&&s.negate(p,p),s.computeAxis(p,d);var u=s.computeAngle(p);r[o]=d.x*u,r[o+1]=d.y*u,r[o+2]=d.z*u}},s.unpackInterpolationResult=function(t,r,a,i,o){n(o)||(o=new s),e.fromArray(t,0,E);var u=e.magnitude(E);return s.unpack(r,4*i,_),0===u?s.clone(s.IDENTITY,p):s.fromAxisAngle(E,u,p),s.multiply(p,_,o)},s.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new s(e.x,e.y,e.z,e.w)},s.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},s.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},s.magnitude=function(e){return Math.sqrt(s.magnitudeSquared(e))},s.normalize=function(e,t){var n=1/s.magnitude(e),r=e.x*n,a=e.y*n,i=e.z*n,o=e.w*n;return t.x=r,t.y=a,t.z=i,t.w=o,t},s.inverse=function(e,t){var n=s.magnitudeSquared(e);return t=s.conjugate(e,t),s.multiplyByScalar(t,1/n,t)},s.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},s.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},s.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},s.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},s.multiply=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=e.w,u=t.x,s=t.y,c=t.z,l=t.w,f=o*u+r*l+a*c-i*s,h=o*s-r*c+a*l+i*u,d=o*c+r*s-a*u+i*l,E=o*l-r*u-a*s-i*c;return n.x=f,n.y=h,n.z=d,n.w=E,n},s.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},s.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},s.computeAxis=function(e,t){var n=e.w;if(Math.abs(n-1)<o.EPSILON6)return t.x=t.y=t.z=0,t;var r=1/Math.sqrt(1-n*n);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},s.computeAngle=function(e){return Math.abs(e.w-1)<o.EPSILON6?0:2*Math.acos(e.w)};var y=new s;s.lerp=function(e,t,n,r){return y=s.multiplyByScalar(t,n,y),r=s.multiplyByScalar(e,1-n,r),s.add(y,r,r)};var T=new s,R=new s,A=new s;s.slerp=function(e,t,n,r){var a=s.dot(e,t),i=t;if(a<0&&(a=-a,i=T=s.negate(t,T)),1-a<o.EPSILON6)return s.lerp(e,i,n,r);var u=Math.acos(a);return R=s.multiplyByScalar(e,Math.sin((1-n)*u),R),A=s.multiplyByScalar(i,Math.sin(n*u),A),r=s.add(R,A,r),s.multiplyByScalar(r,1/Math.sin(u),r)},s.log=function(t,n){var r=o.acosClamped(t.w),a=0;return 0!==r&&(a=r/Math.sin(r)),e.multiplyByScalar(t,a,n)},s.exp=function(t,n){var r=e.magnitude(t),a=0;return 0!==r&&(a=Math.sin(r)/r),n.x=t.x*a,n.y=t.y*a,n.z=t.z*a,n.w=Math.cos(r),n};var S=new e,v=new e,N=new s,g=new s;s.computeInnerQuadrangle=function(t,n,r,a){var i=s.conjugate(n,N);s.multiply(i,r,g);var o=s.log(g,S);s.multiply(i,t,g);var u=s.log(g,v);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),s.exp(o,N),s.multiply(n,N,a)},s.squad=function(e,t,n,r,a,i){var o=s.slerp(e,t,a,N),u=s.slerp(n,r,a,g);return s.slerp(o,u,2*a*(1-a),i)};for(var I=new s,M=1.9011074535173003,O=a.supportsTypedArrays()?new Float32Array(8):[],x=a.supportsTypedArrays()?new Float32Array(8):[],w=a.supportsTypedArrays()?new Float32Array(8):[],C=a.supportsTypedArrays()?new Float32Array(8):[],P=0;P<7;++P){var U=P+1,D=2*U+1;O[P]=1/(U*D),x[P]=U/D}return O[7]=M/136,x[7]=8*M/17,s.fastSlerp=function(e,t,n,r){var a,i=s.dot(e,t);i>=0?a=1:(a=-1,i=-i);for(var o=i-1,u=1-n,c=n*n,l=u*u,f=7;f>=0;--f)w[f]=(O[f]*c-x[f])*o,C[f]=(O[f]*l-x[f])*o;var h=a*n*(1+w[0]*(1+w[1]*(1+w[2]*(1+w[3]*(1+w[4]*(1+w[5]*(1+w[6]*(1+w[7])))))))),d=u*(1+C[0]*(1+C[1]*(1+C[2]*(1+C[3]*(1+C[4]*(1+C[5]*(1+C[6]*(1+C[7])))))))),E=s.multiplyByScalar(e,d,I);return s.multiplyByScalar(t,h,r),s.add(E,r,r)},s.fastSquad=function(e,t,n,r,a,i){var o=s.fastSlerp(e,t,a,N),u=s.fastSlerp(n,r,a,g);return s.fastSlerp(o,u,2*a*(1-a),i)},s.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},s.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.x-t.x)<=r&&Math.abs(e.y-t.y)<=r&&Math.abs(e.z-t.z)<=r&&Math.abs(e.w-t.w)<=r},s.ZERO=i(new s(0,0,0,0)),s.IDENTITY=i(new s(0,0,0,1)),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.x+", "+this.y+", "+this.z+", "+this.w+")"},s}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./defaultValue","./defined","./deprecationWarning","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./HeadingPitchRoll","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,E,p,_,m,y,T,R){"use strict";var A={},S=new n,v=new n,N=new n;A.eastNorthUpToFixedFrame=function(e,t,r){if(_.equalsEpsilon(e.x,0,_.EPSILON14)&&_.equalsEpsilon(e.y,0,_.EPSILON14)){var a=_.sign(e.z);return o(r)?(r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=-a,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=a,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(0,-a,0,e.x,1,0,0,e.y,0,0,a,e.z,0,0,0,1)}var u=S,s=v,c=N;return t=i(t,f.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,c),o(r)?(r[0]=s.x,r[1]=s.y,r[2]=s.z,r[3]=0,r[4]=c.x,r[5]=c.y,r[6]=c.z,r[7]=0,r[8]=u.x,r[9]=u.y,r[10]=u.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(s.x,c.x,u.x,e.x,s.y,c.y,u.y,e.y,s.z,c.z,u.z,e.z,0,0,0,1)};var g=new n,I=new n,M=new n;A.northEastDownToFixedFrame=function(e,t,r){if(_.equalsEpsilon(e.x,0,_.EPSILON14)&&_.equalsEpsilon(e.y,0,_.EPSILON14)){var a=_.sign(e.z);return o(r)?(r[0]=-a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=-a,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(-a,0,0,e.x,0,1,0,e.y,0,0,-a,e.z,0,0,0,1)}var u=g,s=I,c=M;return t=i(t,f.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,c),o(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=s.x,r[5]=s.y,r[6]=s.z,r[7]=0,r[8]=-u.x,r[9]=-u.y,r[10]=-u.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(c.x,s.x,-u.x,e.x,c.y,s.y,-u.y,e.y,c.z,s.z,-u.z,e.z,0,0,0,1)},A.northUpEastToFixedFrame=function(e,t,r){if(_.equalsEpsilon(e.x,0,_.EPSILON14)&&_.equalsEpsilon(e.y,0,_.EPSILON14)){var a=_.sign(e.z);return o(r)?(r[0]=-a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=a,r[7]=0,r[8]=0,r[9]=1,r[10]=0,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(-a,0,0,e.x,0,0,1,e.y,0,a,0,e.z,0,0,0,1)}var u=S,s=v,c=N;return t=i(t,f.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,c),o(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=u.x,r[5]=u.y,r[6]=u.z,r[7]=0,r[8]=s.x,r[9]=s.y,r[10]=s.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(c.x,u.x,s.x,e.x,c.y,u.y,s.y,e.y,c.z,u.z,s.z,e.z,0,0,0,1)},A.northWestUpToFixedFrame=function(e,t,r){if(_.equalsEpsilon(e.x,0,_.EPSILON14)&&_.equalsEpsilon(e.y,0,_.EPSILON14)){var a=_.sign(e.z);return o(r)?(r[0]=-a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=a,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(-a,0,0,e.x,0,-1,0,e.y,0,0,a,e.z,0,0,0,1)}var u=S,s=v,c=N;return t=i(t,f.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,c),o(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=-s.x,r[5]=-s.y,r[6]=-s.z,r[7]=0,r[8]=u.x,r[9]=u.y,r[10]=u.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(c.x,-s.x,u.x,e.x,c.y,-s.y,u.y,e.y,c.z,-s.z,u.z,e.z,0,0,0,1)};var O=new T,x=new n(1,1,1),w=new y;A.headingPitchRollToFixedFrame=function(e,t,r,a,i,o){var s;"object"==typeof t?(i=r,o=a,s=t.heading,r=t.pitch,a=t.roll):(u("headingPitchRollToFixedFrame","headingPitchRollToFixedFrame with separate heading, pitch, and roll arguments was deprecated in 1.27. It will be removed in 1.30. Use a HeadingPitchRoll object."),s=t);var c=T.fromHeadingPitchRoll(s,r,a,O),l=y.fromTranslationQuaternionRotationScale(n.ZERO,c,x,w);return o=A.eastNorthUpToFixedFrame(e,i,o),y.multiply(o,l,o)};var C=new h,P=new y,U=new m;A.headingPitchRollQuaternion=function(e,t,n,r,a,i){var o;"object"==typeof t?(o=t,a=n,i=r):(u("headingPitchRollQuaternion","headingPitchRollQuaternion with separate heading, pitch, and roll arguments was deprecated in 1.27. It will be removed in 1.30. Use a HeadingPitchRoll object."),C.heading=t,C.pitch=n,C.roll=r,o=C);var s=A.headingPitchRollToFixedFrame(e,o,a,P),c=y.getRotation(s,U);return T.fromRotationMatrix(c,i)};var D=24110.54841,L=8640184.812866,F=.093104,z=-62e-7,B=1.1772758384668e-19,b=72921158553e-15,G=_.TWO_PI/86400,q=new p;A.computeTemeToPseudoFixedMatrix=function(e,t){q=p.addSeconds(e,-p.computeTaiMinusUtc(e),q);var n,r=q.dayNumber,a=q.secondsOfDay,i=r-2451545;n=a>=43200?(i+.5)/R.DAYS_PER_JULIAN_CENTURY:(i-.5)/R.DAYS_PER_JULIAN_CENTURY;var u=D+n*(L+n*(F+n*z)),s=u*G%_.TWO_PI,c=b+B*(r-2451545.5),l=(a+.5*R.SECONDS_PER_DAY)%R.SECONDS_PER_DAY,f=s+c*l,h=Math.cos(f),d=Math.sin(f);return o(t)?(t[0]=h,t[1]=-d,t[2]=0,t[3]=d,t[4]=h,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new m(h,d,0,-d,h,0,0,0,1)},A.iau2006XysData=new d,A.earthOrientationParameters=c.NONE;var W=32.184,X=2451545;A.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+W,a=t.stop.dayNumber,i=t.stop.secondsOfDay+W,o=A.iau2006XysData.preload(n,r,a,i),u=A.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},A.computeIcrfToFixedMatrix=function(e,t){o(t)||(t=new m);var n=A.computeFixedToIcrfMatrix(e,t);if(o(n))return m.transpose(n,t)};var V=new E(0,0,0),H=new l(0,0,0,0,0,0),Y=new m,Z=new m;A.computeFixedToIcrfMatrix=function(e,t){o(t)||(t=new m);var n=A.earthOrientationParameters.compute(e,H);if(o(n)){var r=e.dayNumber,a=e.secondsOfDay+W,i=A.iau2006XysData.computeXysRadians(r,a,V);if(o(i)){var u=i.x+n.xPoleOffset,s=i.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-u*u-s*s)),l=Y;l[0]=1-c*u*u,l[3]=-c*u*s,l[6]=u,l[1]=-c*u*s,l[4]=1-c*s*s,l[7]=s,l[2]=-u,l[5]=-s,l[8]=1-c*(u*u+s*s);var f=m.fromRotationZ(-i.s,Z),h=m.multiply(l,f,Y),d=e.dayNumber,E=e.secondsOfDay-p.computeTaiMinusUtc(e)+n.ut1MinusUtc,y=d-2451545,T=E/R.SECONDS_PER_DAY,S=.779057273264+T+.00273781191135448*(y+T);S=S%1*_.TWO_PI;var v=m.fromRotationZ(S,Z),N=m.multiply(h,v,Y),g=Math.cos(n.xPoleWander),I=Math.cos(n.yPoleWander),M=Math.sin(n.xPoleWander),O=Math.sin(n.yPoleWander),x=r-X+a/R.SECONDS_PER_DAY;x/=36525;var w=-47e-6*x*_.RADIANS_PER_DEGREE/3600,C=Math.cos(w),P=Math.sin(w),U=Z;return U[0]=g*C,U[1]=g*P,U[2]=M,U[3]=-I*P+O*M*C,U[4]=I*C+O*M*P,U[5]=-O*g,U[6]=-O*P-I*M*C,U[7]=O*C-I*M*P,U[8]=I*g,m.multiply(N,U,t)}}};var k=new r;A.pointToWindowCoordinates=function(e,t,n,r){return r=A.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},A.pointToGLWindowCoordinates=function(e,n,a,i){o(i)||(i=new t);var u=k;return y.multiplyByVector(e,r.fromElements(a.x,a.y,a.z,1,u),u),r.multiplyByScalar(u,1/u.w,u),y.multiplyByVector(n,u,u),t.fromCartesian4(u,i)};var j=new n,K=new n,J=new n;A.rotationMatrixFromPositionVelocity=function(e,t,r,a){var u=i(r,f.WGS84).geodeticSurfaceNormal(e,j),s=n.cross(t,u,K);n.equalsEpsilon(s,n.ZERO,_.EPSILON6)&&(s=n.clone(n.UNIT_X,s));var c=n.cross(s,t,J);return n.cross(t,c,s),n.negate(s,s),o(a)||(a=new m),a[0]=t.x,a[1]=t.y,a[2]=t.z,a[3]=s.x,a[4]=s.y,a[5]=s.z,a[6]=c.x,a[7]=c.y,a[8]=c.z,a};var Q=new a,$=new n,ee=new n,te=new r,ne=new r,re=new r,ae=new r,ie=new r,oe=new y,ue=new y;return A.basisTo2D=function(e,t,a){var i=e.ellipsoid,o=y.getColumn(t,3,te),u=i.cartesianToCartographic(o,Q),s=A.eastNorthUpToFixedFrame(o,i,oe),c=y.inverseTransformation(s,ue),l=e.project(u,$),f=ne;f.x=l.z,f.y=l.x,f.z=l.y,f.w=1;var h=y.getColumn(t,0,ee),d=n.magnitude(h),E=y.multiplyByVector(c,h,re);r.fromElements(E.z,E.x,E.y,0,E);var p=y.getColumn(t,1,ee),_=n.magnitude(p),m=y.multiplyByVector(c,p,ae);r.fromElements(m.z,m.x,m.y,0,m);var T=y.getColumn(t,2,ee),R=n.magnitude(T),S=ie;return n.cross(E,m,S),n.normalize(S,S),n.cross(m,S,E),n.normalize(E,E),n.cross(S,E,m),n.normalize(m,m),n.multiplyByScalar(E,d,E),n.multiplyByScalar(m,_,m),n.multiplyByScalar(S,R,S),y.setColumn(a,0,E,a),y.setColumn(a,1,m,a),y.setColumn(a,2,S,a),y.setColumn(a,3,f,a),a},A}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d){"use strict";function E(e,t){t=a(t,s.WGS84),e=t.scaleToGeodeticSurface(e);var r=d.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=n.fromCartesian4(l.getColumn(r,0,p)),this._yAxis=n.fromCartesian4(l.getColumn(r,1,p));var i=n.fromCartesian4(l.getColumn(r,2,p));this._plane=f.fromPointNormal(e,i)}var p=new r;o(E.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var _=new e;E.fromPoints=function(t,n){var r=e.fromPoints(t,_);return new E(r.center,n)};var m=new h,y=new n;E.prototype.projectPointOntoPlane=function(e,r){var a=m;a.origin=e,n.normalize(e,a.direction);var o=c.rayPlane(a,this._plane,y);if(i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,y)),i(o)){var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return i(r)?(r.x=s,r.y=l,r):new t(s,l)}},E.prototype.projectPointsOntoPlane=function(e,t){i(t)||(t=[]);for(var n=0,r=e.length,a=0;a<r;a++){var o=this.projectPointOntoPlane(e[a],t[n]);i(o)&&(t[n]=o,n++)}return t.length=n,t},E.prototype.projectPointToNearestOnPlane=function(e,r){i(r)||(r=new t);var a=m;a.origin=e,n.clone(this._plane.normal,a.direction);var o=c.rayPlane(a,this._plane,y);i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,y));var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return r.x=s,r.y=l,r},E.prototype.projectPointsToNearestOnPlane=function(e,t){i(t)||(t=[]);var n=e.length;t.length=n;for(var r=0;r<n;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var T=new n;return E.prototype.projectPointsOntoEllipsoid=function(e,t){var r=e.length;i(t)?t.length=r:t=new Array(r);for(var a=this._ellipsoid,o=this._origin,u=this._xAxis,s=this._yAxis,c=T,l=0;l<r;++l){var f=e[l];n.multiplyByScalar(u,f.x,c),i(t[l])||(t[l]=new n);var h=n.add(o,c,t[l]);n.multiplyByScalar(s,f.y,c),n.add(h,c,h),a.scaleToGeocentricSurface(h,h)}return t},E}),define("Core/EllipsoidGeodesic",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){var t=e._uSquared,n=e._ellipsoid.maximumRadius,r=e._ellipsoid.minimumRadius,a=(n-r)/n,i=Math.cos(e._startHeading),o=Math.sin(e._startHeading),u=(1-a)*Math.tan(e._start.latitude),s=1/Math.sqrt(1+u*u),c=s*u,l=Math.atan2(u,i),f=s*o,h=f*f,d=1-h,E=Math.sqrt(d),p=t/4,_=p*p,m=_*p,y=_*_,T=1+p-3*_/4+5*m/4-175*y/64,R=1-p+15*_/8-35*m/8,A=1-3*p+35*_/4,S=1-5*p,v=T*l-R*Math.sin(2*l)*p/2-A*Math.sin(4*l)*_/16-S*Math.sin(6*l)*m/48-5*Math.sin(8*l)*y/512,N=e._constants;N.a=n,N.b=r,N.f=a,N.cosineHeading=i,N.sineHeading=o,N.tanU=u,N.cosineU=s,N.sineU=c,N.sigma=l,N.sineAlpha=f,N.sineSquaredAlpha=h,N.cosineSquaredAlpha=d,N.cosineAlpha=E,N.u2Over4=p,N.u4Over16=_,N.u6Over64=m,N.u8Over256=y,N.a0=T,N.a1=R,N.a2=A,N.a3=S,N.distanceRatio=v}function c(e,t){return e*t*(4+e*(4-3*t))/16}function l(e,t,n,r,a,i,o){var u=c(e,n);return(1-u)*e*t*(r+u*a*(o+u*i*(2*o*o-1)))}function f(e,t,n,r,a,i,o){var s,c,f,h,d,E=(t-n)/t,p=i-r,_=Math.atan((1-E)*Math.tan(a)),m=Math.atan((1-E)*Math.tan(o)),y=Math.cos(_),T=Math.sin(_),R=Math.cos(m),A=Math.sin(m),S=y*R,v=y*A,N=T*A,g=T*R,I=p,M=u.TWO_PI,O=Math.cos(I),x=Math.sin(I); -do{O=Math.cos(I),x=Math.sin(I);var w=v-g*O;f=Math.sqrt(R*R*x*x+w*w),c=N+S*O,s=Math.atan2(f,c);var C;0===f?(C=0,h=1):(C=S*x/f,h=1-C*C),M=I,d=c-2*N/h,isNaN(d)&&(d=0),I=p+l(E,C,h,s,f,c,d)}while(Math.abs(I-M)>u.EPSILON12);var P=h*(t*t-n*n)/(n*n),U=1+P*(4096+P*(P*(320-175*P)-768))/16384,D=P*(256+P*(P*(74-47*P)-128))/1024,L=d*d,F=D*f*(d+D*(c*(2*L-1)-D*d*(4*f*f-3)*(4*L-3)/6)/4),z=n*U*(s-F),B=Math.atan2(R*x,v-g*O),b=Math.atan2(y*x,v*O-g);e._distance=z,e._startHeading=B,e._endHeading=b,e._uSquared=P}function h(n,r,a,i){e.normalize(i.cartographicToCartesian(r,p),E),e.normalize(i.cartographicToCartesian(a,p),p);f(n,i.maximumRadius,i.minimumRadius,r.longitude,r.latitude,a.longitude,a.latitude),n._start=t.clone(r,n._start),n._end=t.clone(a,n._end),n._start.height=0,n._end.height=0,s(n)}function d(e,a,i){var u=n(i,o.WGS84);this._ellipsoid=u,this._start=new t,this._end=new t,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,r(e)&&r(a)&&h(this,e,a,u)}var E=new e,p=new e;return a(d.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return this._startHeading}},endHeading:{get:function(){return this._endHeading}}}),d.prototype.setEndPoints=function(e,t){h(this,e,t,this._ellipsoid)},d.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},d.prototype.interpolateUsingSurfaceDistance=function(e,n){var a=this._constants,i=a.distanceRatio+e/a.b,o=Math.cos(2*i),u=Math.cos(4*i),s=Math.cos(6*i),c=Math.sin(2*i),f=Math.sin(4*i),h=Math.sin(6*i),d=Math.sin(8*i),E=i*i,p=i*E,_=a.u8Over256,m=a.u2Over4,y=a.u6Over64,T=a.u4Over16,R=2*p*_*o/3+i*(1-m+7*T/4-15*y/4+579*_/64-(T-15*y/4+187*_/16)*o-(5*y/4-115*_/16)*u-29*_*s/16)+(m/2-T+71*y/32-85*_/16)*c+(5*T/16-5*y/4+383*_/96)*f-E*((y-11*_/2)*c+5*_*f/2)+(29*y/96-29*_/16)*h+539*_*d/1536,A=Math.asin(Math.sin(R)*a.cosineAlpha),S=Math.atan(a.a/a.b*Math.tan(A));R-=a.sigma;var v=Math.cos(2*a.sigma+R),N=Math.sin(R),g=Math.cos(R),I=a.cosineU*g,M=a.sineU*N,O=Math.atan2(N*a.sineHeading,I-M*a.cosineHeading),x=O-l(a.f,a.sineAlpha,a.cosineSquaredAlpha,R,N,g,v);return r(n)?(n.longitude=this._start.longitude+x,n.latitude=S,n.height=0,n):new t(this._start.longitude+x,S,0)},d}),define("Core/PolylinePipeline",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidGeodesic","./IntersectionTests","./isArray","./Math","./Matrix4","./Plane"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(e,t,n){var r=N;r.length=e;var a;if(t===n){for(a=0;a<e;a++)r[a]=t;return r}var i=n-t,o=i/e;for(a=0;a<e;a++){var u=t+a*o;r[a]=u}return r}function d(t,n,r,a,i,o,u,s){var c=a.scaleToGeodeticSurface(t,O),l=a.scaleToGeodeticSurface(n,x),f=E.numberOfPoints(t,n,r),d=a.cartesianToCartographic(c,g),p=a.cartesianToCartographic(l,I),_=h(f,i,o);w.setEndPoints(d,p);var m=w.surfaceDistance/f,y=s;d.height=i;var T=a.cartographicToCartesian(d,M);e.pack(T,u,y),y+=3;for(var R=1;R<f;R++){var A=w.interpolateUsingSurfaceDistance(R*m,I);A.height=_[R],T=a.cartographicToCartesian(A,M),e.pack(T,u,y),y+=3}return y}var E={};E.numberOfPoints=function(t,n,r){var a=e.distance(t,n);return Math.ceil(a/r)};var p=new t;E.extractHeights=function(e,t){for(var n=e.length,r=new Array(n),a=0;a<n;a++){var i=e[a];r[a]=t.cartesianToCartographic(i,p).height}return r};var _=new l,m=new e,y=new e,T=new f(e.ZERO,0),R=new e,A=new f(e.ZERO,0),S=new e,v=new e,N=[],g=new t,I=new t,M=new e,O=new e,x=new e,w=new o;return E.wrapLongitude=function(t,a){var i=[],o=[];if(r(t)&&t.length>0){a=n(a,l.IDENTITY);var s=l.inverseTransformation(a,_),c=l.multiplyByPoint(s,e.ZERO,m),h=l.multiplyByPointAsVector(s,e.UNIT_Y,y),d=f.fromPointNormal(c,h,T),E=l.multiplyByPointAsVector(s,e.UNIT_X,R),p=f.fromPointNormal(c,E,A),N=1;i.push(e.clone(t[0]));for(var g=i[0],I=t.length,M=1;M<I;++M){var O=t[M];if(f.getPointDistance(p,g)<0||f.getPointDistance(p,O)<0){var x=u.lineSegmentPlane(g,O,d,S);if(r(x)){var w=e.multiplyByScalar(h,5e-9,v);f.getPointDistance(d,g)<0&&e.negate(w,w),i.push(e.add(x,w,new e)),o.push(N+1),e.negate(w,w),i.push(e.add(x,w,new e)),N=1}}i.push(e.clone(t[M])),N++,g=O}o.push(N)}return{positions:i,lengths:o}},E.generateArc=function(t){r(t)||(t={});var a=t.positions,o=a.length,u=n(t.ellipsoid,i.WGS84),l=n(t.height,0),f=s(l);if(o<1)return[];if(1===o){var h=u.scaleToGeodeticSurface(a[0],O);if(l=f?l[0]:l,0!==l){var p=u.geodeticSurfaceNormal(h,M);e.multiplyByScalar(p,l,p),e.add(h,p,h)}return[h.x,h.y,h.z]}var _=t.minDistance;if(!r(_)){var m=n(t.granularity,c.RADIANS_PER_DEGREE);_=c.chordLength(m,u.maximumRadius)}var y,T=0;for(y=0;y<o-1;y++)T+=E.numberOfPoints(a[y],a[y+1],_);var R=3*(T+1),A=new Array(R),S=0;for(y=0;y<o-1;y++){var v=a[y],I=a[y+1],x=f?l[y]:l,w=f?l[y+1]:l;S=d(v,I,_,u,x,w,A,S)}N.length=0;var C=a[o-1],P=u.cartesianToCartographic(C,g);P.height=f?l[o-1]:l;var U=u.cartographicToCartesian(P,M);return e.pack(U,A,R-3),A},E.generateCartesianArc=function(t){for(var n=E.generateArc(t),r=n.length/3,a=new Array(r),i=0;i<r;i++)a[i]=e.unpack(n,3*i);return a},E}),define("Core/PolylineVolumeGeometryLibrary",["./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./CornerType","./EllipsoidTangentPlane","./Math","./Matrix3","./Matrix4","./PolylinePipeline","./Quaternion","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(e,t){for(var n=new Array(e.length),r=0;r<e.length;r++){var a=e[r];U=t.cartesianToCartographic(a,U),n[r]=U.height,e[r]=t.scaleToGeodeticSurface(a,a)}return n}function d(e,n,r,a){var i,o=e[0],u=e[1],s=t.angleBetween(o,u),c=Math.ceil(s/a),l=new Array(c);if(n===r){for(i=0;i<c;i++)l[i]=n;return l.push(r),l}var f=r-n,h=f/c;for(i=1;i<c;i++){var d=n+i*h;l[i]=d}return l[0]=n,l.push(r),l}function E(n,r,a,o){var u=new i(a,o),s=u.projectPointOntoPlane(t.add(a,n,Y),Y),c=u.projectPointOntoPlane(t.add(a,r,Z),Z),l=e.angleBetween(s,c);return c.x*s.y-c.y*s.x>=0?-l:l}function p(e,n,r,a,i,o,c,l){var h=b,d=G;L=f.eastNorthUpToFixedFrame(e,i,L),h=s.multiplyByPointAsVector(L,D,h),h=t.normalize(h,h);var p=E(h,n,e,i);z=u.fromRotationZ(p,z),q.z=o,L=s.multiplyTransformation(L,s.fromRotationTranslation(z,q,F),L);var _=B;_[0]=c;for(var m=0;m<l;m++)for(var y=0;y<r.length;y+=3)d=t.fromArray(r,y,d),d=u.multiplyByVector(_,d,d),d=s.multiplyByPoint(L,d,d),a.push(d.x,d.y,d.z);return a}function _(e,n,r,a,i,o,u){for(var s=0;s<e.length;s+=3){var c=t.fromArray(e,s,W);a=p(c,n,r,a,i,o[s/3],u,1)}return a}function m(e,t){var n=e.length,r=new Array(6*n),a=0,i=t.x+t.width/2,o=t.y+t.height/2,u=e[0];r[a++]=u.x-i,r[a++]=0,r[a++]=u.y-o;for(var s=1;s<n;s++){u=e[s];var c=u.x-i,l=u.y-o;r[a++]=c,r[a++]=0,r[a++]=l,r[a++]=c,r[a++]=0,r[a++]=l}return u=e[0],r[a++]=u.x-i,r[a++]=0,r[a++]=u.y-o,r}function y(e,t){for(var n=e.length,r=new Array(3*n),a=0,i=t.x+t.width/2,o=t.y+t.height/2,u=0;u<n;u++)r[a++]=e[u].x-i,r[a++]=0,r[a++]=e[u].y-o;return r}function T(e,n,r,i,s,c,f,h,d,E){var _,m=t.angleBetween(t.subtract(n,e,w),t.subtract(r,e,C)),y=i===a.BEVELED?0:Math.ceil(m/o.toRadians(5));_=s?u.fromQuaternion(l.fromAxisAngle(t.negate(e,w),m/(y+1),X),H):u.fromQuaternion(l.fromAxisAngle(e,m/(y+1),X),H);var T,R;if(n=t.clone(n,V),y>0)for(var A=E?2:1,S=0;S<y;S++)n=u.multiplyByVector(_,n,n),T=t.subtract(n,e,w),T=t.normalize(T,T),s||(T=t.negate(T,T)),R=c.scaleToGeodeticSurface(n,C),f=p(R,T,h,f,c,d,1,A);else T=t.subtract(n,e,w),T=t.normalize(T,T),s||(T=t.negate(T,T)),R=c.scaleToGeodeticSurface(n,C),f=p(R,T,h,f,c,d,1,1),r=t.clone(r,V),T=t.subtract(r,e,w),T=t.normalize(T,T),s||(T=t.negate(T,T)),R=c.scaleToGeodeticSurface(r,C),f=p(R,T,h,f,c,d,1,1);return f}var R=[new t,new t],A=new t,S=new t,v=new t,N=new t,g=new t,I=new t,M=new t,O=new t,x=new t,w=new t,C=new t,P={},U=new r,D=new t(-1,0,0),L=new s,F=new s,z=new u,B=u.IDENTITY.clone(),b=new t,G=new n,q=new t,W=new t,X=new l,V=new t,H=new u;P.removeDuplicatesFromShape=function(t){for(var n=t.length,r=[],a=n-1,i=0;i<n;a=i++){var o=t[a],u=t[i];e.equals(o,u)||r.push(u)}return r};var Y=new t,Z=new t;P.angleIsGreaterThanPi=function(e,n,r,a){var o=new i(r,a),u=o.projectPointOntoPlane(t.add(r,e,Y),Y),s=o.projectPointOntoPlane(t.add(r,n,Z),Z);return s.x*u.y-s.y*u.x>=0};var k=new t,j=new t;return P.computePositions=function(e,n,r,i,u){var s=i._ellipsoid,l=h(e,s),f=i._granularity,E=i._cornerType,C=u?m(n,r):y(n,r),U=u?y(n,r):void 0,D=r.height/2,L=r.width/2,F=e.length,z=[],B=u?[]:void 0,b=A,G=S,q=v,W=N,X=g,V=I,H=M,Y=O,Z=x,K=e[0],J=e[1];W=s.geodeticSurfaceNormal(K,W),b=t.subtract(J,K,b),b=t.normalize(b,b),Y=t.cross(W,b,Y),Y=t.normalize(Y,Y);var Q=l[0],$=l[1];u&&(B=p(K,Y,U,B,s,Q+D,1,1)),Z=t.clone(K,Z),K=J,G=t.negate(b,G);for(var ee,te,ne=1;ne<F-1;ne++){var re=u?2:1;J=e[ne+1],b=t.subtract(J,K,b),b=t.normalize(b,b),q=t.add(b,G,q),q=t.normalize(q,q),W=s.geodeticSurfaceNormal(K,W);var ae=t.multiplyByScalar(W,t.dot(b,W),k);t.subtract(b,ae,ae),t.normalize(ae,ae);var ie=t.multiplyByScalar(W,t.dot(G,W),j);t.subtract(G,ie,ie),t.normalize(ie,ie);var oe=!o.equalsEpsilon(Math.abs(t.dot(ae,ie)),1,o.EPSILON7);if(oe){q=t.cross(q,W,q),q=t.cross(W,q,q),q=t.normalize(q,q);var ue=1/Math.max(.25,t.magnitude(t.cross(q,G,w))),se=P.angleIsGreaterThanPi(b,G,K,s);se?(X=t.add(K,t.multiplyByScalar(q,ue*L,q),X),V=t.add(X,t.multiplyByScalar(Y,L,V),V),R[0]=t.clone(Z,R[0]),R[1]=t.clone(V,R[1]),ee=d(R,Q+D,$+D,f),te=c.generateArc({positions:R,granularity:f,ellipsoid:s}),z=_(te,Y,C,z,s,ee,1),Y=t.cross(W,b,Y),Y=t.normalize(Y,Y),H=t.add(X,t.multiplyByScalar(Y,L,H),H),E===a.ROUNDED||E===a.BEVELED?T(X,V,H,E,se,s,z,C,$+D,u):(q=t.negate(q,q),z=p(K,q,C,z,s,$+D,ue,re)),Z=t.clone(H,Z)):(X=t.add(K,t.multiplyByScalar(q,ue*L,q),X),V=t.add(X,t.multiplyByScalar(Y,-L,V),V),R[0]=t.clone(Z,R[0]),R[1]=t.clone(V,R[1]),ee=d(R,Q+D,$+D,f),te=c.generateArc({positions:R,granularity:f,ellipsoid:s}),z=_(te,Y,C,z,s,ee,1),Y=t.cross(W,b,Y),Y=t.normalize(Y,Y),H=t.add(X,t.multiplyByScalar(Y,-L,H),H),E===a.ROUNDED||E===a.BEVELED?T(X,V,H,E,se,s,z,C,$+D,u):z=p(K,q,C,z,s,$+D,ue,re),Z=t.clone(H,Z)),G=t.negate(b,G)}else z=p(Z,Y,C,z,s,Q+D,1,1),Z=K;Q=$,$=l[ne+1],K=J}R[0]=t.clone(Z,R[0]),R[1]=t.clone(K,R[1]),ee=d(R,Q+D,$+D,f),te=c.generateArc({positions:R,granularity:f,ellipsoid:s}),z=_(te,Y,C,z,s,ee,1),u&&(B=p(K,Y,U,B,s,$+D,1,1)),F=z.length;var ce=u?F+B.length:F,le=new Float64Array(ce);return le.set(z),u&&le.set(B,F),le},P}),define("Core/PolylineVolumeOutlineGeometry",["./arrayRemoveDuplicates","./BoundingRectangle","./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./CornerType","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolygonPipeline","./PolylineVolumeGeometryLibrary","./PrimitiveType","./WindingOrder"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,E,p,_,m,y,T){"use strict";function R(e,t){var r=new d;r.position=new h({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:e});var a,o,u=t.length,s=r.position.values.length/3,c=e.length/3,l=c/u,p=E.createTypedArray(s,2*u*(l+1)),_=0;a=0;var m=a*u;for(o=0;o<u-1;o++)p[_++]=o+m,p[_++]=o+m+1;for(p[_++]=u-1+m,p[_++]=m,a=l-1,m=a*u,o=0;o<u-1;o++)p[_++]=o+m,p[_++]=o+m+1;for(p[_++]=u-1+m,p[_++]=m,a=0;a<l-1;a++){var T=u*a,R=T+u;for(o=0;o<u;o++)p[_++]=o+T,p[_++]=o+R}var A=new f({attributes:r,indices:E.createTypedArray(s,p),boundingSphere:n.fromVertices(e),primitiveType:y.LINES});return A}function A(e){e=u(e,u.EMPTY_OBJECT);var t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=l.clone(u(e.ellipsoid,l.WGS84)),this._cornerType=u(e.cornerType,o.ROUNDED),this._granularity=u(e.granularity,p.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeOutlineGeometry";var i=1+t.length*a.packedLength;i+=1+n.length*r.packedLength,this.packedLength=i+l.packedLength+2}A.pack=function(e,t,n){n=u(n,0);var i,o=e._positions,s=o.length;for(t[n++]=s,i=0;i<s;++i,n+=a.packedLength)a.pack(o[i],t,n);var c=e._shape;for(s=c.length,t[n++]=s,i=0;i<s;++i,n+=r.packedLength)r.pack(c[i],t,n);return l.pack(e._ellipsoid,t,n),n+=l.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var S=l.clone(l.UNIT_SPHERE),v={polylinePositions:void 0,shapePositions:void 0,ellipsoid:S,height:void 0,cornerType:void 0,granularity:void 0};A.unpack=function(e,t,n){t=u(t,0);var i,o=e[t++],c=new Array(o);for(i=0;i<o;++i,t+=a.packedLength)c[i]=a.unpack(e,t);o=e[t++];var f=new Array(o);for(i=0;i<o;++i,t+=r.packedLength)f[i]=r.unpack(e,t);var h=l.unpack(e,t,S);t+=l.packedLength;var d=e[t++],E=e[t];return s(n)?(n._positions=c,n._shape=f,n._ellipsoid=l.clone(h,n._ellipsoid),n._cornerType=d,n._granularity=E,n):(v.polylinePositions=c,v.shapePositions=f,v.cornerType=d,v.granularity=E,new A(v))};var N=new t;return A.createGeometry=function(n){var r=n._positions,i=e(r,a.equalsEpsilon),o=n._shape;if(o=m.removeDuplicatesFromShape(o),!(i.length<2||o.length<3)){_.computeWindingOrder2D(o)===T.CLOCKWISE&&o.reverse();var u=t.fromPoints(o,N),s=m.computePositions(i,o,u,n,!1);return R(s,o)}},A}),define("Workers/createPolylineVolumeOutlineGeometry",["../Core/defined","../Core/Ellipsoid","../Core/PolylineVolumeOutlineGeometry"],function(e,t,n){"use strict";function r(r,a){return e(a)&&(r=n.unpack(r,a)),r._ellipsoid=t.clone(r._ellipsoid),n.createGeometry(r)}return r})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e){return e+" is required, actual value was undefined"}function r(e,t,n){return"Expected "+n+" to be typeof "+t+", actual typeof was "+e}var a={};return a.typeOf={},a.defined=function(r,a){if(!e(a))throw new t(n(r))},a.typeOf.func=function(e,n){if("function"!=typeof n)throw new t(r(typeof n,"function",e))},a.typeOf.string=function(e,n){if("string"!=typeof n)throw new t(r(typeof n,"string",e))},a.typeOf.number=function(e,n){if("number"!=typeof n)throw new t(r(typeof n,"number",e))},a.typeOf.number.lessThan=function(e,n,r){if(a.typeOf.number(e,n),n>=r)throw new t("Expected "+e+" to be less than "+r+", actual value was "+n)},a.typeOf.number.lessThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n>r)throw new t("Expected "+e+" to be less than or equal to "+r+", actual value was "+n)},a.typeOf.number.greaterThan=function(e,n,r){if(a.typeOf.number(e,n),n<=r)throw new t("Expected "+e+" to be greater than "+r+", actual value was "+n)},a.typeOf.number.greaterThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n<r)throw new t("Expected "+e+" to be greater than or equal to"+r+", actual value was "+n)},a.typeOf.object=function(e,n){if("object"!=typeof n)throw new t(r(typeof n,"object",e))},a.typeOf.bool=function(e,n){if("boolean"!=typeof n)throw new t(r(typeof n,"boolean",e))},a}),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";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),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 n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(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^=e<<7&2636928640,e^=e<<15&4022730752,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,n,r){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:e<0?-1:0},a.signNotZero=function(e){return e<0?-1:1},a.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*a.clamp(e,-1,1)+.5)*n)},a.fromSNorm=function(e,n){return n=t(n,255),a.clamp(e,0,n)/n*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},a.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},a.lerp=function(e,t,n){return(1-n)*e+n*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){var t=a.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},a.clampToLatitudeRange=function(e){return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){return(e%t+t)%t},a.equalsEpsilon=function(e,n,r,a){a=t(a,r);var i=Math.abs(e-n);return i<=a||i<=r*Math.max(Math.abs(e),Math.abs(n))};var i=[1];a.factorial=function(e){var t=i.length;if(e>=t)for(var n=i[t-1],r=t;r<=e;r++)i.push(n*r);return i[e]},a.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},a.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return a.setRandomNumberSeed=function(t){o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(e){return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){return Math.log(e)/Math.log(t)},a.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var a=e.clock,i=e.cone,u=t(e.magnitude,1),s=u*Math.sin(i);return r.x=s*Math.cos(a),r.y=s*Math.sin(a),r.z=u*Math.cos(i),r},o.fromElements=function(e,t,r,a){return n(a)?(a.x=e,a.y=t,a.z=r,a):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var a=0;a<r;++a)o.pack(e[a],t,3*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var a=0;a<r;a+=3){var i=a/3;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,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};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var n=o.dot(c,l),r=o.magnitude(o.cross(c,l,c));return Math.atan2(r,n)};var f=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)},o.cross=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=t.x,u=t.y,s=t.z,c=a*s-i*u,l=i*o-r*s,f=r*u-a*o;return n.x=c,n.y=l,n.z=f,n},o.fromDegrees=function(e,t,n,r,a){return e=i.toRadians(e),t=i.toRadians(t),o.fromRadians(e,t,n,r,a)};var h=new o,d=new o,E=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,a,i,u){a=t(a,0);var s=n(i)?i.radiiSquared:E,c=Math.cos(r);h.x=c*Math.cos(e),h.y=c*Math.sin(e),h.z=Math.sin(r),h=o.normalize(h,h),o.multiplyComponents(s,h,d);var l=Math.sqrt(o.dot(h,d));return d=o.divideByScalar(d,l,d),h=o.multiplyByScalar(h,a,h),n(u)||(u=new o),o.add(d,h,u)},o.fromDegreesArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromDegrees(u,s,0,t,r[c])}return r},o.fromRadiansArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromRadians(u,s,0,t,r[c])}return r},o.fromDegreesArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromDegrees(u,s,c,t,r[l])}return r},o.fromRadiansArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromRadians(u,s,c,t,r[l])}return r},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(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,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(n,a,u,s,c){var l=n.x,f=n.y,h=n.z,d=a.x,E=a.y,_=a.z,p=l*l*d*d,y=f*f*E*E,m=h*h*_*_,T=p+y+m,R=Math.sqrt(1/T),A=e.multiplyByScalar(n,R,i);if(T<s)return isFinite(R)?e.clone(A,c):void 0;var S=u.x,v=u.y,N=u.z,O=o;O.x=A.x*S*2,O.y=A.y*v*2,O.z=A.z*N*2;var I,M,g,x,w,C,P,U,D,L,F,z=(1-R)*e.magnitude(n)/(.5*e.magnitude(O)),B=0;do{z-=B,g=1/(1+z*S),x=1/(1+z*v),w=1/(1+z*N),C=g*g,P=x*x,U=w*w,D=C*g,L=P*x,F=U*w,I=p*C+y*P+m*U-1,M=p*D*S+y*L*v+m*F*N;var b=-2*M;B=I/b}while(Math.abs(I)>r.EPSILON12);return t(c)?(c.x=l*g,c.y=f*x,c.z=h*w,c):new e(l*g,f*x,h*w)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o){"use strict";function u(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)}u.fromRadians=function(e,r,a,i){return a=t(a,0),n(i)?(i.longitude=e,i.latitude=r,i.height=a,i):new u(e,r,a)},u.fromDegrees=function(e,t,n,r){return e=i.toRadians(e),t=i.toRadians(t),u.fromRadians(e,t,n,r)};var s=new e,c=new e,l=new e,f=new e(1/6378137,1/6378137,1/6356752.314245179),h=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),d=i.EPSILON1;return u.fromCartesian=function(t,r,a){var E=n(r)?r.oneOverRadii:f,_=n(r)?r.oneOverRadiiSquared:h,p=n(r)?r._centerToleranceSquared:d,y=o(t,E,_,p,c);if(n(y)){var m=e.multiplyComponents(y,_,s);m=e.normalize(m,m);var T=e.subtract(t,y,l),R=Math.atan2(m.y,m.x),A=Math.asin(m.z),S=i.sign(e.dot(T,t))*e.magnitude(T);return n(a)?(a.longitude=R,a.latitude=A,a.height=S,a):new u(R,A,S)}},u.clone=function(e,t){if(n(e))return n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},u.ZERO=a(new u(0,0,0)),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,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(t,r,a,i){r=n(r,0),a=n(a,0),i=n(i,0),t._radii=new e(r,a,i),t._radiiSquared=new e(r*r,a*a,i*i),t._radiiToTheFourth=new e(r*r*r*r,a*a*a*a,i*i*i*i),t._oneOverRadii=new e(0===r?0:1/r,0===a?0:1/a,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===a?0:1/(a*a),0===i?0:1/(i*i)),t._minimumRadius=Math.min(r,a,i),t._maximumRadius=Math.max(r,a,i),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,c(this,e,t,n)}a(l.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}}}),l.clone=function(t,n){if(r(t)){var a=t._radii;return r(n)?(e.clone(a,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new l(a.x,a.y,a.z)}},l.fromCartesian3=function(e,t){return r(t)||(t=new l),r(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,r,a){return a=n(a,0),e.pack(t._radii,r,a),r},l.unpack=function(t,r,a){r=n(r,0);var i=e.unpack(t,r);return l.fromCartesian3(i,a)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,n){var a=t.longitude,i=t.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return r(n)||(n=new e),n.x=u,n.y=s,n.z=c,e.normalize(n,n)},l.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var f=new e,h=new e;l.prototype.cartographicToCartesian=function(t,n){var a=f,i=h;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(e.dot(a,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(a,t.height,a),r(n)||(n=new e),e.add(i,a,n)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var d=new e,E=new e,_=new e;return l.prototype.cartesianToCartographic=function(n,a){var i=this.scaleToGeodeticSurface(n,E);if(r(i)){var o=this.geodeticSurfaceNormal(i,d),s=e.subtract(n,i,_),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),f=u.sign(e.dot(s,n))*e.magnitude(s);return r(a)?(a.longitude=c,a.latitude=l,a.height=f,a):new t(c,l,f)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var a=t.x,i=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return e.multiplyByScalar(t,s,n)},l.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},l.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},l.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,a,i){a=n(a,0);var o=this._sqauredXOverSquaredZ;if(r(i)||(i=new e),i.x=0,i.y=0,i.z=t.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},l}),define("Core/arrayRemoveDuplicates",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(n,r,a){if(t(n)){a=e(a,!1);var o=n.length;if(o<2)return n;var u,s,c;for(u=1;u<o&&(s=n[u-1],c=n[u],!r(s,c,i));++u);if(u===o)return a&&r(n[0],n[n.length-1],i)?n.slice(1):n;for(var l=n.slice(0,u);u<o;++u)c=n[u],r(s,c,i)||(l.push(c),s=c);return a&&l.length>1&&r(l[0],l[l.length-1],i)&&l.shift(),l}}var i=r.EPSILON10;return a}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n){this.x=t(e,0),this.y=t(n,0)}o.fromElements=function(e,t,r){return n(r)?(r.x=e,r.y=t,r):new o(e,t)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t):new o(e.x,e.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r]=e.y,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=2*r:t=new Array(2*r);for(var a=0;a<r;++a)o.pack(e[a],t,2*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/2:t=new Array(r/2);for(var a=0;a<r;a+=2){var i=a/2;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y)},o.minimumComponent=function(e){return Math.min(e.x,e.y)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){return o.normalize(e,c),o.normalize(t,l),i.acosClamped(o.dot(c,l))};var f=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)},o.ZERO=a(new o(0,0)),o.UNIT_X=a(new o(1,0)),o.UNIT_Y=a(new o(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,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,a,i,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return r(n)?(n.x=i,n.y=o,n.z=u,n):new e(i,o,u)},u.prototype.unproject=function(e,n){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,u=e.z;return r(n)?(n.longitude=i,n.latitude=o,n.height=u,n):new t(i,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(e,t,r,a){this.west=n(e,0),this.south=n(t,0),this.east=n(r,0),this.north=n(a,0)}a(c.prototype,{width:{get:function(){return c.computeWidth(this)}},height:{get:function(){return c.computeHeight(this)}}}),c.packedLength=4,c.pack=function(e,t,r){return r=n(r,0),t[r++]=e.west,t[r++]=e.south,t[r++]=e.east,t[r]=e.north,t},c.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new c),a.west=e[t++],a.south=e[t++],a.east=e[t++],a.north=e[t],a},c.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=s.TWO_PI),t-n},c.computeHeight=function(e){return e.north-e.south},c.fromDegrees=function(e,t,a,i,o){return e=s.toRadians(n(e,0)),t=s.toRadians(n(t,0)),a=s.toRadians(n(a,0)),i=s.toRadians(n(i,0)),r(o)?(o.west=e,o.south=t,o.east=a,o.north=i,o):new c(e,t,a,i)},c.fromRadians=function(e,t,a,i,o){return r(o)?(o.west=n(e,0),o.south=n(t,0),o.east=n(a,0),o.north=n(i,0),o):new c(e,t,a,i)},c.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,u=Number.MAX_VALUE,l=-Number.MAX_VALUE,f=0,h=e.length;f<h;f++){var d=e[f];n=Math.min(n,d.longitude),a=Math.max(a,d.longitude),u=Math.min(u,d.latitude),l=Math.max(l,d.latitude);var E=d.longitude>=0?d.longitude:d.longitude+s.TWO_PI;i=Math.min(i,E),o=Math.max(o,E)}return a-n>o-i&&(n=i,a=o,a>s.PI&&(a-=s.TWO_PI),n>s.PI&&(n-=s.TWO_PI)),r(t)?(t.west=n,t.south=u,t.east=a,t.north=l,t):new c(n,u,a,l)},c.fromCartesianArray=function(e,t,n){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,u=-Number.MAX_VALUE,l=Number.MAX_VALUE,f=-Number.MAX_VALUE,h=0,d=e.length;h<d;h++){var E=t.cartesianToCartographic(e[h]);a=Math.min(a,E.longitude),i=Math.max(i,E.longitude),l=Math.min(l,E.latitude),f=Math.max(f,E.latitude);var _=E.longitude>=0?E.longitude:E.longitude+s.TWO_PI;o=Math.min(o,_),u=Math.max(u,_)}return i-a>u-o&&(a=o,i=u,i>s.PI&&(i-=s.TWO_PI),a>s.PI&&(a-=s.TWO_PI)),r(n)?(n.west=a,n.south=l,n.east=i,n.north=f,n):new c(a,l,i,f)},c.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new c(e.west,e.south,e.east,e.north)},c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.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},c.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},c.validate=function(e){},c.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)},c.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)},c.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)},c.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)},c.center=function(t,n){var a=t.east,i=t.west;a<i&&(a+=s.TWO_PI);var o=s.negativePiToPi(.5*(i+a)),u=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=u,n.height=0,n):new e(o,u)},c.intersection=function(e,t,n){var a=e.east,i=e.west,o=t.east,u=t.west;a<i&&o>0?a+=s.TWO_PI:o<u&&a>0&&(o+=s.TWO_PI),a<i&&u<0?u+=s.TWO_PI:o<u&&i<0&&(i+=s.TWO_PI);var l=s.negativePiToPi(Math.max(i,u)),f=s.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&f<=l)){var h=Math.max(e.south,t.south),d=Math.min(e.north,t.north);if(!(h>=d))return r(n)?(n.west=l,n.south=h,n.east=f,n.north=d,n):new c(l,h,f,d)}},c.simpleIntersection=function(e,t,n){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(i>=u||a>=o))return r(n)?(n.west=a,n.south=i,n.east=o,n.north=u,n):new c(a,i,o,u)},c.union=function(e,t,n){r(n)||(n=new c);var a=e.east,i=e.west,o=t.east,u=t.west;a<i&&o>0?a+=s.TWO_PI:o<u&&a>0&&(o+=s.TWO_PI),a<i&&u<0?u+=s.TWO_PI:o<u&&i<0&&(i+=s.TWO_PI);var l=s.convertLongitudeRange(Math.min(i,u)),f=s.convertLongitudeRange(Math.max(a,o));return n.west=l,n.south=Math.min(e.south,t.south),n.east=f,n.north=Math.max(e.north,t.north),n},c.expand=function(e,t,n){return r(n)||(n=new c),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},c.contains=function(e,t){var n=t.longitude,r=t.latitude,a=e.west,i=e.east;return i<a&&(i+=s.TWO_PI,n<0&&(n+=s.TWO_PI)),(n>a||s.equalsEpsilon(n,a,s.EPSILON14))&&(n<i||s.equalsEpsilon(n,i,s.EPSILON14))&&r>=e.south&&r<=e.north};var l=new e;return c.subsample=function(e,t,a,i){t=n(t,o.WGS84),a=n(a,0),r(i)||(i=[]);var u=0,f=e.north,h=e.south,d=e.east,E=e.west,_=l;_.height=a,_.longitude=E,_.latitude=f,i[u]=t.cartographicToCartesian(_,i[u]),u++,_.longitude=d,i[u]=t.cartographicToCartesian(_,i[u]),u++,_.latitude=h,i[u]=t.cartographicToCartesian(_,i[u]),u++,_.longitude=E,i[u]=t.cartographicToCartesian(_,i[u]),u++,f<0?_.latitude=f:h>0?_.latitude=h:_.latitude=0;for(var p=1;p<8;++p)_.longitude=-Math.PI+p*s.PI_OVER_TWO,c.contains(e,_)&&(i[u]=t.cartographicToCartesian(_,i[u]),u++);return 0===_.latitude&&(_.longitude=E,i[u]=t.cartographicToCartesian(_,i[u]),u++,_.longitude=d,i[u]=t.cartographicToCartesian(_,i[u]),u++),i.length=u,i},c.MAX_VALUE=u(new c(-Math.PI,-s.PI_OVER_TWO,Math.PI,s.PI_OVER_TWO)),c}),define("Core/BoundingRectangle",["./Cartesian2","./Cartographic","./Check","./defaultValue","./defined","./GeographicProjection","./Intersect","./Rectangle"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,n,a){this.x=r(e,0),this.y=r(t,0),this.width=r(n,0),this.height=r(a,0)}s.packedLength=4,s.pack=function(e,t,n){return n=r(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.width,t[n]=e.height,t},s.unpack=function(e,t,n){return t=r(t,0),a(n)||(n=new s),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n},s.fromPoints=function(e,t){if(a(t)||(t=new s),!a(e)||0===e.length)return t.x=0,t.y=0,t.width=0,t.height=0,t;for(var n=e.length,r=e[0].x,i=e[0].y,o=e[0].x,u=e[0].y,c=1;c<n;c++){var l=e[c],f=l.x,h=l.y;r=Math.min(f,r),o=Math.max(f,o),i=Math.min(h,i),u=Math.max(h,u)}return t.x=r,t.y=i,t.width=o-r,t.height=u-i,t};var c=new i,l=new t,f=new t;return s.fromRectangle=function(t,n,i){if(a(i)||(i=new s),!a(t))return i.x=0,i.y=0,i.width=0,i.height=0,i;n=r(n,c);var o=n.project(u.southwest(t,l)),h=n.project(u.northeast(t,f));return e.subtract(h,o,h),i.x=o.x,i.y=o.y,i.width=h.x,i.height=h.y,i},s.clone=function(e,t){if(a(e))return a(t)?(t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t):new s(e.x,e.y,e.width,e.height)},s.union=function(e,t,n){a(n)||(n=new s);var r=Math.min(e.x,t.x),i=Math.min(e.y,t.y),o=Math.max(e.x+e.width,t.x+t.width),u=Math.max(e.y+e.height,t.y+t.height);return n.x=r,n.y=i,n.width=o-r,n.height=u-i,n},s.expand=function(e,t,n){n=s.clone(e,n);var r=t.x-n.x,a=t.y-n.y;return r>n.width?n.width=r:r<0&&(n.width-=r,n.x=t.x),a>n.height?n.height=a:a<0&&(n.height-=a,n.y=t.y),n},s.intersect=function(e,t){var n=e.x,r=e.y,a=t.x,i=t.y;return n>a+t.width||n+e.width<a||r+e.height<i||r>i+t.height?o.OUTSIDE:o.INTERSECTING},s.equals=function(e,t){return e===t||a(e)&&a(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.intersect=function(e){return s.intersect(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a,i,o,u,s,c){this[0]=n(e,0),this[1]=n(a,0),this[2]=n(u,0),this[3]=n(t,0),this[4]=n(i,0),this[5]=n(s,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(c,0)}function c(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function l(e){for(var t=0,n=0;n<3;++n){var r=e[s.getElementIndex(_[n],E[n])];t+=2*r*r}return Math.sqrt(t)}function f(e,t){for(var n=u.EPSILON15,r=0,a=1,i=0;i<3;++i){var o=Math.abs(e[s.getElementIndex(_[i],E[i])]);o>r&&(a=i,r=o)}var c=1,l=0,f=E[a],h=_[a];if(Math.abs(e[s.getElementIndex(h,f)])>n){var d,p=e[s.getElementIndex(h,h)],y=e[s.getElementIndex(f,f)],m=e[s.getElementIndex(h,f)],T=(p-y)/2/m;d=T<0?-1/(-T+Math.sqrt(1+T*T)):1/(T+Math.sqrt(1+T*T)),c=1/Math.sqrt(1+d*d),l=d*c}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(f,f)]=t[s.getElementIndex(h,h)]=c,t[s.getElementIndex(h,f)]=l,t[s.getElementIndex(f,h)]=-l,t}s.packedLength=9,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t},s.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a},s.clone=function(e,t){if(r(e))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):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t],a[1]=e[t+1],a[2]=e[t+2],a[3]=e[t+3],a[4]=e[t+4],a[5]=e[t+5],a[6]=e[t+6],a[7]=e[t+7],a[8]=e[t+8],a},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[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 s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var n=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,u=e.y*e.y,c=e.y*e.z,l=e.y*e.w,f=e.z*e.z,h=e.z*e.w,d=e.w*e.w,E=n-u-f+d,_=2*(a-h),p=2*(i+l),y=2*(a+h),m=-n+u-f+d,T=2*(c-o),R=2*(i-l),A=2*(c+o),S=-n-u+f+d;return r(t)?(t[0]=E,t[1]=y,t[2]=R,t[3]=_,t[4]=m,t[5]=A,t[6]=p,t[7]=T,t[8]=S,t):new s(E,_,p,y,m,T,R,A,S)},s.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),a=Math.cos(-e.heading),i=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),c=Math.sin(e.roll),l=n*a,f=-i*u+c*o*a,h=c*u+i*o*a,d=n*u,E=i*a+c*o*u,_=-o*i+i*o*u,p=-o,y=c*n,m=i*n;return r(t)?(t[0]=l,t[1]=d,t[2]=p,t[3]=f,t[4]=E,t[5]=y,t[6]=h,t[7]=_,t[8]=m,t):new s(l,f,h,d,E,_,p,y,m)},s.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 s(e.x,0,0,0,e.y,0,0,0,e.z)},s.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 s(e,0,0,0,e,0,0,0,e)},s.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 s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=a,t[6]=0,t[7]=-a,t[8]=n,t):new s(1,0,0,0,n,-a,0,a,n)},s.fromRotationY=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=n,t):new s(n,0,a,0,1,0,-a,0,n)},s.fromRotationZ=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=a,t[2]=0,t[3]=-a,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(n,-a,0,a,n,0,0,0,1)},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):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,n){var r=3*t,a=e[r],i=e[r+1],o=e[r+2];return n.x=a,n.y=i,n.z=o,n},s.setColumn=function(e,t,n,r){r=s.clone(e,r);var a=3*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},s.getRow=function(e,t,n){var r=e[t],a=e[t+3],i=e[t+6];return n.x=r,n.y=a,n.z=i,n},s.setRow=function(e,t,n,r){return r=s.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var h=new e;s.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],h)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],h)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],h)),n};var d=new e;s.getMaximumScale=function(t){return s.getScale(t,d),e.maximumComponent(d)},s.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=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 n[0]=r,n[1]=a,n[2]=i,n[3]=o,n[4]=u,n[5]=s,n[6]=c,n[7]=l,n[8]=f,n},s.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},s.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},s.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[3]*a+e[6]*i,u=e[1]*r+e[4]*a+e[7]*i,s=e[2]*r+e[5]*a+e[8]*i;return n.x=o,n.y=u,n.z=s,n},s.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},s.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},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},s.transpose=function(e,t){var n=e[0],r=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=n,t[1]=r,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var E=[1,0,0],_=[2,2,1],p=new s,y=new s;return s.computeEigenDecomposition=function(e,t){var n=u.EPSILON20,a=10,i=0,o=0;r(t)||(t={});for(var h=t.unitary=s.clone(s.IDENTITY,t.unitary),d=t.diagonal=s.clone(e,t.diagonal),E=n*c(d);o<a&&l(d)>E;)f(d,p),s.transpose(p,y),s.multiply(d,p,d),s.multiply(y,d,d),s.multiply(h,p,h),++i>2&&(++o,i=0);return 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},s.determinant=function(e){var t=e[0],n=e[3],r=e[6],a=e[1],i=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*o)+a*(s*r-n*c)+u*(n*o-i*r)},s.inverse=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[3],o=e[4],u=e[5],c=e[6],l=e[7],f=e[8],h=s.determinant(e);t[0]=o*f-l*u,t[1]=l*a-r*f,t[2]=r*u-o*a,t[3]=c*u-i*f,t[4]=n*f-c*a,t[5]=i*a-n*u,t[6]=i*l-c*o,t[7]=c*r-n*l,t[8]=n*o-i*r;var d=1/h;return s.multiplyByScalar(t,d,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]},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},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,a(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r,a){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(a,0)}o.fromElements=function(e,t,r,a,i){return n(i)?(i.x=e,i.y=t,i.z=r,i.w=a,i):new o(e,t,r,a)},o.fromColor=function(e,t){return n(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(n(e))return n(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)},o.packedLength=4,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r++],a.w=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=4*r:t=new Array(4*r);for(var a=0;a<r;++a)o.pack(e[a],t,4*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/4:t=new Array(r/4);for(var a=0;a<r;a+=4){var i=a/4;t[i]=o.unpack(e,a,t[i])}return t},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,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},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 u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,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,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},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 s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,c);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)&&i.equalsEpsilon(e.w,t.w,r,a)},o.ZERO=a(new o(0,0,0,0)),o.UNIT_X=a(new o(1,0,0,0)),o.UNIT_Y=a(new o(0,1,0,0)),o.UNIT_Z=a(new o(0,0,1,0)),o.UNIT_W=a(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,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,a,i,o,u,s,c,l){"use strict";function f(e,t,n,a,i,o,u,s,c,l,f,h,d,E,_,p){this[0]=r(e,0),this[1]=r(i,0),this[2]=r(c,0),this[3]=r(d,0),this[4]=r(t,0),this[5]=r(o,0),this[6]=r(l,0),this[7]=r(E,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(f,0),this[11]=r(_,0),this[12]=r(a,0),this[13]=r(s,0),this[14]=r(h,0),this[15]=r(p,0)}f.packedLength=16,f.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},f.unpack=function(e,t,n){return t=r(t,0),a(n)||(n=new f),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},f.clone=function(e,t){if(a(e))return a(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 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])},f.fromArray=f.unpack,f.fromColumnMajorArray=function(e,t){return f.clone(e,t)},f.fromRowMajorArray=function(e,t){return a(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 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(t,n,i){return n=r(n,e.ZERO),a(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=1,i):new f(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},f.fromTranslationQuaternionRotationScale=function(e,t,n,r){a(r)||(r=new f);var i=n.x,o=n.y,u=n.z,s=t.x*t.x,c=t.x*t.y,l=t.x*t.z,h=t.x*t.w,d=t.y*t.y,E=t.y*t.z,_=t.y*t.w,p=t.z*t.z,y=t.z*t.w,m=t.w*t.w,T=s-d-p+m,R=2*(c-y),A=2*(l+_),S=2*(c+y),v=-s+d-p+m,N=2*(E-h),O=2*(l-_),I=2*(E+h),M=-s-d+p+m;return r[0]=T*i,r[1]=S*i,r[2]=O*i,r[3]=0,r[4]=R*o,r[5]=v*o,r[6]=I*o,r[7]=0,r[8]=A*u,r[9]=N*u,r[10]=M*u,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},f.fromTranslationRotationScale=function(e,t){return f.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},f.fromTranslation=function(e,t){return f.fromRotationTranslation(c.IDENTITY,e,t)},f.fromScale=function(e,t){return a(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 f(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},f.fromUniformScale=function(e,t){return a(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 f(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var h=new e,d=new e,E=new e;f.fromCamera=function(t,n){var r=t.position,i=t.direction,o=t.up;e.normalize(i,h),e.normalize(e.cross(h,o,d),d),e.normalize(e.cross(d,h,E),E);var u=d.x,s=d.y,c=d.z,l=h.x,_=h.y,p=h.z,y=E.x,m=E.y,T=E.z,R=r.x,A=r.y,S=r.z,v=u*-R+s*-A+c*-S,N=y*-R+m*-A+T*-S,O=l*R+_*A+p*S;return a(n)?(n[0]=u,n[1]=y,n[2]=-l,n[3]=0,n[4]=s,n[5]=m,n[6]=-_,n[7]=0,n[8]=c,n[9]=T,n[10]=-p,n[11]=0,n[12]=v,n[13]=N,n[14]=O,n[15]=1,n):new f(u,s,c,v,y,m,T,N,-l,-_,-p,O,0,0,0,1)},f.computePerspectiveFieldOfView=function(e,t,n,r,a){var i=Math.tan(.5*e),o=1/i,u=o/t,s=(r+n)/(n-r),c=2*r*n/(n-r);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=c,a[15]=0,a},f.computeOrthographicOffCenter=function(e,t,n,r,a,i,o){var u=1/(t-e),s=1/(r-n),c=1/(i-a),l=-(t+e)*u,f=-(r+n)*s,h=-(i+a)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=f,o[14]=h,o[15]=1,o},f.computePerspectiveOffCenter=function(e,t,n,r,a,i,o){var u=2*a/(t-e),s=2*a/(r-n),c=(t+e)/(t-e),l=(r+n)/(r-n),f=-(i+a)/(i-a),h=-1,d=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=f,o[11]=h,o[12]=0,o[13]=0,o[14]=d,o[15]=0,o},f.computeInfinitePerspectiveOffCenter=function(e,t,n,r,a,i){var o=2*a/(t-e),u=2*a/(r-n),s=(t+e)/(t-e),c=(r+n)/(r-n),l=-1,f=-1,h=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=s,i[9]=c,i[10]=l,i[11]=f,i[12]=0,i[13]=0,i[14]=h,i[15]=0,i},f.computeViewportTransformation=function(e,t,n,a){e=r(e,r.EMPTY_OBJECT);var i=r(e.x,0),o=r(e.y,0),u=r(e.width,0),s=r(e.height,0);t=r(t,0),n=r(n,1);var c=.5*u,l=.5*s,f=.5*(n-t),h=c,d=l,E=f,_=i+c,p=o+l,y=t+f,m=1;return a[0]=h,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=d,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=E,a[11]=0,a[12]=_,a[13]=p,a[14]=y,a[15]=m,a},f.computeView=function(t,n,r,a,i){return i[0]=a.x,i[1]=r.x,i[2]=-n.x,i[3]=0,i[4]=a.y,i[5]=r.y,i[6]=-n.y,i[7]=0,i[8]=a.z,i[9]=r.z,i[10]=-n.z,i[11]=0,i[12]=-e.dot(a,t),i[13]=-e.dot(r,t),i[14]=e.dot(n,t),i[15]=1,i},f.toArray=function(e,t){return a(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]]},f.getElementIndex=function(e,t){return 4*e+t},f.getColumn=function(e,t,n){var r=4*t,a=e[r],i=e[r+1],o=e[r+2],u=e[r+3];return n.x=a,n.y=i,n.z=o,n.w=u,n},f.setColumn=function(e,t,n,r){r=f.clone(e,r);var a=4*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r[a+3]=n.w,r},f.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},f.getRow=function(e,t,n){var r=e[t],a=e[t+4],i=e[t+8],o=e[t+12];return n.x=r,n.y=a,n.z=i,n.w=o,n},f.setRow=function(e,t,n,r){return r=f.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var _=new e;f.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],_)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],_)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],_)),n};var p=new e;f.getMaximumScale=function(t){return f.getScale(t,p),e.maximumComponent(p)},f.multiply=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],f=e[8],h=e[9],d=e[10],E=e[11],_=e[12],p=e[13],y=e[14],m=e[15],T=t[0],R=t[1],A=t[2],S=t[3],v=t[4],N=t[5],O=t[6],I=t[7],M=t[8],g=t[9],x=t[10],w=t[11],C=t[12],P=t[13],U=t[14],D=t[15],L=r*T+u*R+f*A+_*S,F=a*T+s*R+h*A+p*S,z=i*T+c*R+d*A+y*S,B=o*T+l*R+E*A+m*S,b=r*v+u*N+f*O+_*I,G=a*v+s*N+h*O+p*I,q=i*v+c*N+d*O+y*I,W=o*v+l*N+E*O+m*I,X=r*M+u*g+f*x+_*w,V=a*M+s*g+h*x+p*w,H=i*M+c*g+d*x+y*w,Y=o*M+l*g+E*x+m*w,k=r*C+u*P+f*U+_*D,Z=a*C+s*P+h*U+p*D,j=i*C+c*P+d*U+y*D,K=o*C+l*P+E*U+m*D;return n[0]=L,n[1]=F,n[2]=z,n[3]=B,n[4]=b,n[5]=G,n[6]=q,n[7]=W,n[8]=X,n[9]=V,n[10]=H,n[11]=Y,n[12]=k,n[13]=Z,n[14]=j,n[15]=K,n},f.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},f.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},f.multiplyTransformation=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=e[12],d=e[13],E=e[14],_=t[0],p=t[1],y=t[2],m=t[4],T=t[5],R=t[6],A=t[8],S=t[9],v=t[10],N=t[12],O=t[13],I=t[14],M=r*_+o*p+c*y,g=a*_+u*p+l*y,x=i*_+s*p+f*y,w=r*m+o*T+c*R,C=a*m+u*T+l*R,P=i*m+s*T+f*R,U=r*A+o*S+c*v,D=a*A+u*S+l*v,L=i*A+s*S+f*v,F=r*N+o*O+c*I+h,z=a*N+u*O+l*I+d,B=i*N+s*O+f*I+E;return n[0]=M,n[1]=g,n[2]=x,n[3]=0,n[4]=w,n[5]=C,n[6]=P,n[7]=0,n[8]=U,n[9]=D,n[10]=L,n[11]=0,n[12]=F,n[13]=z,n[14]=B,n[15]=1,n},f.multiplyByMatrix3=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=t[0],d=t[1],E=t[2],_=t[3],p=t[4],y=t[5],m=t[6],T=t[7],R=t[8],A=r*h+o*d+c*E,S=a*h+u*d+l*E,v=i*h+s*d+f*E,N=r*_+o*p+c*y,O=a*_+u*p+l*y,I=i*_+s*p+f*y,M=r*m+o*T+c*R,g=a*m+u*T+l*R,x=i*m+s*T+f*R;return n[0]=A,n[1]=S,n[2]=v,n[3]=0,n[4]=N,n[5]=O,n[6]=I,n[7]=0,n[8]=M,n[9]=g,n[10]=x,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},f.multiplyByTranslation=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=r*e[0]+a*e[4]+i*e[8]+e[12],u=r*e[1]+a*e[5]+i*e[9]+e[13],s=r*e[2]+a*e[6]+i*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=s,n[15]=e[15],n};var y=new e;f.multiplyByUniformScale=function(e,t,n){return y.x=t,y.y=t,y.z=t,f.multiplyByScale(e,y,n)},f.multiplyByScale=function(e,t,n){var r=t.x,a=t.y,i=t.z;return 1===r&&1===a&&1===i?f.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=a*e[4],n[5]=a*e[5],n[6]=a*e[6],n[7]=0,n[8]=i*e[8],n[9]=i*e[9],n[10]=i*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},f.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=t.w,u=e[0]*r+e[4]*a+e[8]*i+e[12]*o,s=e[1]*r+e[5]*a+e[9]*i+e[13]*o,c=e[2]*r+e[6]*a+e[10]*i+e[14]*o,l=e[3]*r+e[7]*a+e[11]*i+e[15]*o;return n.x=u,n.y=s,n.z=c,n.w=l,n},f.multiplyByPointAsVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i,u=e[1]*r+e[5]*a+e[9]*i,s=e[2]*r+e[6]*a+e[10]*i;return n.x=o,n.y=u,n.z=s,n},f.multiplyByPoint=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i+e[12],u=e[1]*r+e[5]*a+e[9]*i+e[13],s=e[2]*r+e[6]*a+e[10]*i+e[14];return n.x=o,n.y=u,n.z=s,n},f.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},f.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},f.transpose=function(e,t){var n=e[1],r=e[2],a=e[3],i=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=o,t[14]=u,t[15]=e[15],t},f.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},f.equals=function(e,t){return e===t||a(e)&&a(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},f.equalsEpsilon=function(e,t,n){return e===t||a(e)&&a(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},f.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},f.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};var m=new c,T=new c,R=new t,A=new t(0,0,0,1);return f.inverse=function(e,n){if(c.equalsEpsilon(f.getRotation(e,m),T,s.EPSILON7)&&t.equals(f.getRow(e,3,R),A))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],a=e[4],i=e[8],o=e[12],u=e[1],h=e[5],d=e[9],E=e[13],_=e[2],p=e[6],y=e[10],S=e[14],v=e[3],N=e[7],O=e[11],I=e[15],M=y*I,g=S*O,x=p*I,w=S*N,C=p*O,P=y*N,U=_*I,D=S*v,L=_*O,F=y*v,z=_*N,B=p*v,b=M*h+w*d+C*E-(g*h+x*d+P*E),G=g*u+U*d+F*E-(M*u+D*d+L*E),q=x*u+D*h+z*E-(w*u+U*h+B*E),W=P*u+L*h+B*d-(C*u+F*h+z*d),X=g*a+x*i+P*o-(M*a+w*i+C*o),V=M*r+D*i+L*o-(g*r+U*i+F*o),H=w*r+U*a+B*o-(x*r+D*a+z*o),Y=C*r+F*a+z*i-(P*r+L*a+B*i);M=i*E,g=o*d,x=a*E,w=o*h,C=a*d,P=i*h,U=r*E,D=o*u,L=r*d,F=i*u,z=r*h,B=a*u;var k=M*N+w*O+C*I-(g*N+x*O+P*I),Z=g*v+U*O+F*I-(M*v+D*O+L*I),j=x*v+D*N+z*I-(w*v+U*N+B*I),K=P*v+L*N+B*O-(C*v+F*N+z*O),J=x*y+P*S+g*p-(C*S+M*p+w*y),Q=L*S+M*_+D*y-(U*y+F*S+g*_),$=U*p+B*S+w*_-(z*S+x*_+D*p),ee=z*y+C*_+F*p-(L*p+B*y+P*_),te=r*b+a*G+i*q+o*W;if(Math.abs(te)<s.EPSILON20)throw new l("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=b*te,n[1]=G*te,n[2]=q*te,n[3]=W*te,n[4]=X*te,n[5]=V*te,n[6]=H*te,n[7]=Y*te,n[8]=k*te,n[9]=Z*te,n[10]=j*te,n[11]=K*te,n[12]=J*te,n[13]=Q*te,n[14]=$*te,n[15]=ee*te,n},f.inverseTransformation=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],f=e[12],h=e[13],d=e[14],E=-n*f-r*h-a*d,_=-i*f-o*h-u*d,p=-s*f-c*h-l*d;return t[0]=n,t[1]=i,t[2]=s,t[3]=0,t[4]=r,t[5]=o,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=l,t[11]=0,t[12]=E,t[13]=_,t[14]=p,t[15]=1,t},f.IDENTITY=u(new f(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),f.ZERO=u(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,i(f.prototype,{length:{get:function(){return f.packedLength}}}),f.prototype.clone=function(e){return f.clone(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},f.prototype.equalsEpsilon=function(e,t){return f.equalsEpsilon(this,e,t)},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/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var d=new e,E=new e,_=new e,p=new e,y=new e,m=new e,T=new e,R=new e,A=new e,S=new e,v=new e,N=new e;h.fromPoints=function(t,n){if(a(n)||(n=new h),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var r=e.clone(t[0],T),i=e.clone(r,d),o=e.clone(r,E),u=e.clone(r,_),s=e.clone(r,p),c=e.clone(r,y),l=e.clone(r,m),f=t.length,O=1;O<f;O++){e.clone(t[O],r);var I=r.x,M=r.y,g=r.z;I<i.x&&e.clone(r,i),I>s.x&&e.clone(r,s),M<o.y&&e.clone(r,o),M>c.y&&e.clone(r,c),g<u.z&&e.clone(r,u),g>l.z&&e.clone(r,l)}var x=e.magnitudeSquared(e.subtract(s,i,R)),w=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=i,U=s,D=x;w>D&&(D=w,P=o,U=c),C>D&&(D=C,P=u,U=l);var L=A;L.x=.5*(P.x+U.x),L.y=.5*(P.y+U.y),L.z=.5*(P.z+U.z);var F=e.magnitudeSquared(e.subtract(U,L,R)),z=Math.sqrt(F),B=S;B.x=i.x,B.y=o.y,B.z=u.z;var b=v;b.x=s.x,b.y=c.y,b.z=l.z;var G=e.multiplyByScalar(e.add(B,b,R),.5,N),q=0;for(O=0;O<f;O++){e.clone(t[O],r);var W=e.magnitude(e.subtract(r,G,R));W>q&&(q=W);var X=e.magnitudeSquared(e.subtract(r,L,R));if(X>F){var V=Math.sqrt(X);z=.5*(z+V),F=z*z;var H=V-z;L.x=(z*L.x+H*r.x)/V,L.y=(z*L.y+H*r.y)/V,L.z=(z*L.z+H*r.z)/V}}return z<q?(e.clone(L,n.center),n.radius=z):(e.clone(G,n.center),n.radius=q),n};var O=new o,I=new e,M=new e,g=new t,x=new t;h.fromRectangle2D=function(e,t,n){return h.fromRectangleWithHeights2D(e,t,0,0,n)},h.fromRectangleWithHeights2D=function(t,n,i,o,u){if(a(u)||(u=new h),!a(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;n=r(n,O),f.southwest(t,g),g.height=i,f.northeast(t,x),x.height=o;var s=n.project(g,I),c=n.project(x,M),l=c.x-s.x,d=c.y-s.y,E=c.z-s.z;u.radius=.5*Math.sqrt(l*l+d*d+E*E);var _=u.center;return _.x=s.x+.5*l,_.y=s.y+.5*d,_.z=s.z+.5*E,u};var w=[];h.fromRectangle3D=function(e,t,n,o){t=r(t,i.WGS84),n=r(n,0);var u;return a(e)&&(u=f.subsample(e,t,n,w)),h.fromPoints(u,o)},h.fromVertices=function(t,n,i,o){if(a(o)||(o=new h),!a(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;n=r(n,e.ZERO),i=r(i,3);var u=T;u.x=t[0]+n.x,u.y=t[1]+n.y,u.z=t[2]+n.z;for(var s=e.clone(u,d),c=e.clone(u,E),l=e.clone(u,_),f=e.clone(u,p),O=e.clone(u,y),I=e.clone(u,m),M=t.length,g=0;g<M;g+=i){var x=t[g]+n.x,w=t[g+1]+n.y,C=t[g+2]+n.z;u.x=x,u.y=w,u.z=C,x<s.x&&e.clone(u,s),x>f.x&&e.clone(u,f),w<c.y&&e.clone(u,c),w>O.y&&e.clone(u,O),C<l.z&&e.clone(u,l),C>I.z&&e.clone(u,I)}var P=e.magnitudeSquared(e.subtract(f,s,R)),U=e.magnitudeSquared(e.subtract(O,c,R)),D=e.magnitudeSquared(e.subtract(I,l,R)),L=s,F=f,z=P;U>z&&(z=U,L=c,F=O),D>z&&(z=D,L=l,F=I);var B=A;B.x=.5*(L.x+F.x),B.y=.5*(L.y+F.y),B.z=.5*(L.z+F.z);var b=e.magnitudeSquared(e.subtract(F,B,R)),G=Math.sqrt(b),q=S;q.x=s.x,q.y=c.y,q.z=l.z;var W=v;W.x=f.x,W.y=O.y,W.z=I.z;var X=e.multiplyByScalar(e.add(q,W,R),.5,N),V=0;for(g=0;g<M;g+=i){u.x=t[g]+n.x,u.y=t[g+1]+n.y,u.z=t[g+2]+n.z;var H=e.magnitude(e.subtract(u,X,R));H>V&&(V=H);var Y=e.magnitudeSquared(e.subtract(u,B,R));if(Y>b){var k=Math.sqrt(Y);G=.5*(G+k),b=G*G;var Z=k-G;B.x=(G*B.x+Z*u.x)/k,B.y=(G*B.y+Z*u.y)/k,B.z=(G*B.z+Z*u.z)/k}}return G<V?(e.clone(B,o.center),o.radius=G):(e.clone(X,o.center),o.radius=V),o},h.fromEncodedCartesianVertices=function(t,n,r){if(a(r)||(r=new h),!a(t)||!a(n)||t.length!==n.length||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var i=T;i.x=t[0]+n[0],i.y=t[1]+n[1],i.z=t[2]+n[2];for(var o=e.clone(i,d),u=e.clone(i,E),s=e.clone(i,_),c=e.clone(i,p),l=e.clone(i,y),f=e.clone(i,m),O=t.length,I=0;I<O;I+=3){var M=t[I]+n[I],g=t[I+1]+n[I+1],x=t[I+2]+n[I+2];i.x=M,i.y=g,i.z=x,M<o.x&&e.clone(i,o),M>c.x&&e.clone(i,c),g<u.y&&e.clone(i,u),g>l.y&&e.clone(i,l),x<s.z&&e.clone(i,s),x>f.z&&e.clone(i,f)}var w=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=e.magnitudeSquared(e.subtract(f,s,R)),U=o,D=c,L=w;C>L&&(L=C,U=u,D=l),P>L&&(L=P,U=s,D=f);var F=A;F.x=.5*(U.x+D.x),F.y=.5*(U.y+D.y),F.z=.5*(U.z+D.z);var z=e.magnitudeSquared(e.subtract(D,F,R)),B=Math.sqrt(z),b=S;b.x=o.x,b.y=u.y,b.z=s.z;var G=v;G.x=c.x,G.y=l.y,G.z=f.z;var q=e.multiplyByScalar(e.add(b,G,R),.5,N),W=0;for(I=0;I<O;I+=3){i.x=t[I]+n[I],i.y=t[I+1]+n[I+1],i.z=t[I+2]+n[I+2];var X=e.magnitude(e.subtract(i,q,R));X>W&&(W=X);var V=e.magnitudeSquared(e.subtract(i,F,R));if(V>z){var H=Math.sqrt(V);B=.5*(B+H),z=B*B;var Y=H-B;F.x=(B*F.x+Y*i.x)/H,F.y=(B*F.y+Y*i.y)/H,F.z=(B*F.z+Y*i.z)/H}}return B<W?(e.clone(F,r.center),r.radius=B):(e.clone(q,r.center),r.radius=W),r},h.fromCornerPoints=function(t,n,r){a(r)||(r=new h);var i=r.center;return e.add(t,n,i),e.multiplyByScalar(i,.5,i),r.radius=e.distance(i,n),r},h.fromEllipsoid=function(t,n){return a(n)||(n=new h),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var C=new e;h.fromBoundingSpheres=function(t,n){if(a(n)||(n=new h),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var r=t.length;if(1===r)return h.clone(t[0],n);if(2===r)return h.union(t[0],t[1],n);for(var i=[],o=0;o<r;o++)i.push(t[o].center);n=h.fromPoints(i,n);var u=n.center,s=n.radius;for(o=0;o<r;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,C)+c.radius)}return n.radius=s,n};var P=new e,U=new e,D=new e;h.fromOrientedBoundingBox=function(t,n){a(n)||(n=new h);var r=t.halfAxes,i=c.getColumn(r,0,P),o=c.getColumn(r,1,U),u=c.getColumn(r,2,D),s=e.magnitude(i),l=e.magnitude(o),f=e.magnitude(u);return n.center=e.clone(t.center,n.center),n.radius=Math.max(s,l,f),n},h.clone=function(t,n){if(a(t))return a(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new h(t.center,t.radius)},h.packedLength=4,h.pack=function(e,t,n){n=r(n,0);var a=e.center;return t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n]=e.radius,t},h.unpack=function(e,t,n){t=r(t,0),a(n)||(n=new h);var i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};var L=new e,F=new e;h.union=function(t,n,r){a(r)||(r=new h);var i=t.center,o=t.radius,u=n.center,s=n.radius,c=e.subtract(u,i,L),l=e.magnitude(c);if(o>=l+s)return t.clone(r),r;if(s>=l+o)return n.clone(r),r;var f=.5*(o+l+s),d=e.multiplyByScalar(c,(-o+f)/l,F);return e.add(d,i,d),e.clone(d,r.center),r.radius=f,r};var z=new e;h.expand=function(t,n,r){r=h.clone(t,r);var a=e.magnitude(e.subtract(n,r.center,z)); +return a>r.radius&&(r.radius=a),r},h.intersectPlane=function(t,n){var r=t.center,a=t.radius,i=n.normal,o=e.dot(i,r)+n.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},h.transform=function(e,t,n){return a(n)||(n=new h),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=l.getMaximumScale(t)*e.radius,n};var B=new e;h.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,B);return e.magnitudeSquared(r)-t.radius*t.radius},h.transformWithoutScale=function(e,t,n){return a(n)||(n=new h),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var b=new e;h.computePlaneDistances=function(t,n,r,i){a(i)||(i=new s);var o=e.subtract(t.center,n,b),u=e.dot(r,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var G=new e,q=new e,W=new e,X=new e,V=new e,H=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var Z=new o;return h.projectTo2D=function(t,n,a){n=r(n,Z);var i=n.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,G),c=e.cross(e.UNIT_Z,s,q);e.normalize(c,c);var l=e.cross(s,c,W);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var f=e.negate(l,V),d=e.negate(c,X),E=Y,_=E[0];e.add(s,l,_),e.add(_,c,_),_=E[1],e.add(s,l,_),e.add(_,d,_),_=E[2],e.add(s,f,_),e.add(_,d,_),_=E[3],e.add(s,f,_),e.add(_,c,_),e.negate(s,s),_=E[4],e.add(s,l,_),e.add(_,c,_),_=E[5],e.add(s,l,_),e.add(_,d,_),_=E[6],e.add(s,f,_),e.add(_,d,_),_=E[7],e.add(s,f,_),e.add(_,c,_);for(var p=E.length,y=0;y<p;++y){var m=E[y];e.add(o,m,m);var T=i.cartesianToCartographic(m,H);n.project(T,m)}a=h.fromPoints(E,a),o=a.center;var R=o.x,A=o.y,S=o.z;return o.x=S,o.y=R,o.z=A,a},h.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},h.equals=function(t,n){return t===n||a(t)&&a(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},h.prototype.intersectPlane=function(e){return h.intersectPlane(this,e)},h.prototype.distanceSquaredTo=function(e){return h.distanceSquaredTo(this,e)},h.prototype.computePlaneDistances=function(e,t,n){return h.computePlaneDistances(this,e,t,n)},h.prototype.isOccluded=function(e){return h.isOccluded(this,e)},h.prototype.equals=function(e){return h.equals(this,e)},h.prototype.clone=function(e){return h.clone(this,e)},h}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return t(a,{element:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(r.requestFullscreen=a,n=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(r.requestFullscreen=a,n=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?r.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(r.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?r.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(r.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?r.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(r.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),r.fullscreenerror=a)}return n},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[r.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function a(){if(!t(A)&&(A=!1,!h())){var e=/ Chrome\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(A=!0,S=r(e[1]))}return A}function i(){return a()&&S}function o(){if(!t(v)&&(v=!1,!a()&&!h()&&/ Safari\/[\.0-9]+/.test(R.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(v=!0,N=r(e[1]))}return v}function u(){return o()&&N}function s(){if(!t(O)){O=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(R.userAgent);null!==e&&(O=!0,I=r(e[1]),I.isNightly=!!e[2])}return O}function c(){return s()&&I}function l(){if(!t(M)){M=!1;var e;"Microsoft Internet Explorer"===R.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(M=!0,g=r(e[1]))):"Netscape"===R.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(M=!0,g=r(e[1])))}return M}function f(){return l()&&g}function h(){if(!t(x)){x=!1;var e=/ Edge\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(x=!0,w=r(e[1]))}return x}function d(){return h()&&w}function E(){if(!t(C)){C=!1;var e=/Firefox\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(C=!0,P=r(e[1]))}return C}function _(){return t(U)||(U=/Windows/i.test(R.appVersion)),U}function p(){return E()&&P}function y(){return t(D)||(D="undefined"!=typeof PointerEvent&&(!t(R.pointerEnabled)||R.pointerEnabled)),D}function m(){if(!t(F)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;F=t(n)&&""!==n,F&&(L=n)}return F}function T(){return m()?L:void 0}var R;R="undefined"!=typeof navigator?navigator:{};var A,S,v,N,O,I,M,g,x,w,C,P,U,D,L,F,z={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isEdge:h,edgeVersion:d,isFirefox:E,firefoxVersion:p,isWindows:_,hardwareConcurrency:e(R.hardwareConcurrency,3),supportsPointerEvents:y,supportsImageRenderingPixelated:m,imageRenderingValue:T};return z.supportsFullscreen=function(){return n.supportsFullscreen()},z.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},z.supportsWebWorkers=function(){return"undefined"!=typeof Worker},z}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,a,i){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){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.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},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 Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,a){switch(r=e(r,0),a=e(a,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,a);case o.SHORT:return new Int16Array(n,r,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,a);case o.INT:return new Int32Array(n,r,a);case o.UNSIGNED_INT:return new Uint32Array(n,r,a);case o.FLOAT:return new Float32Array(n,r,a);case o.DOUBLE:return new Float64Array(n,r,a)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/CornerType",["./freezeObject"],function(e){"use strict";var t={ROUNDED:0,MITERED:1,BEVELED:2};return e(t)}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===n.POINTS||e===n.LINES||e===n.LINE_LOOP||e===n.LINE_STRIP||e===n.TRIANGLES||e===n.TRIANGLE_STRIP||e===n.TRIANGLE_FAN}};return e(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,a){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,a.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return i.computeNumberOfVertices=function(e){var n=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var a=e.attributes[r],i=a.values.length/a.componentsPerAttribute;n=i}return n},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(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 r}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,n,r,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(e){switch(e){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(t){return e(t)&&(t===i.UNSIGNED_BYTE||t===i.UNSIGNED_SHORT||t===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,n,a){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,a):new Uint16Array(t,n,a)},n(i)}),define("ThirdParty/earcut-2.1.1",[],function(){"use strict";function e(e,n,a){a=a||2;var i=n&&n.length,o=i?n[0]*a:e.length,u=t(e,0,o,a,!0),c=[];if(!u)return c;var l,f,h,d,E,_,p;if(i&&(u=s(e,n,u,a)),e.length>80*a){l=h=e[0],f=d=e[1];for(var y=a;y<o;y+=a)E=e[y],_=e[y+1],E<l&&(l=E),_<f&&(f=_),E>h&&(h=E),_>d&&(d=_);p=Math.max(h-l,d-f)}return r(u,c,a,l,f,p),c}function t(e,t,n,r,a){var i,o;if(a===g(e,t,n,r)>0)for(i=t;i<n;i+=r)o=O(i,e[i],e[i+1],o);else for(i=n-r;i>=t;i-=r)o=O(i,e[i],e[i+1],o);return o&&T(o,o.next)&&(I(o),o=o.next),o}function n(e,t){if(!e)return e;t||(t=e);var n,r=e;do if(n=!1,r.steiner||!T(r,r.next)&&0!==m(r.prev,r,r.next))r=r.next;else{if(I(r),r=t=r.prev,r===r.next)return null;n=!0}while(n||r!==t);return t}function r(e,t,s,c,l,f,d){if(e){!d&&f&&h(e,c,l,f);for(var E,_,p=e;e.prev!==e.next;)if(E=e.prev,_=e.next,f?i(e,c,l,f):a(e))t.push(E.i/s),t.push(e.i/s),t.push(_.i/s),I(e),e=_.next,p=_.next;else if(e=_,e===p){d?1===d?(e=o(e,t,s),r(e,t,s,c,l,f,2)):2===d&&u(e,t,s,c,l,f):r(n(e),t,s,c,l,f,1);break}}}function a(e){var t=e.prev,n=e,r=e.next;if(m(t,n,r)>=0)return!1;for(var a=e.next.next;a!==e.prev;){if(p(t.x,t.y,n.x,n.y,r.x,r.y,a.x,a.y)&&m(a.prev,a,a.next)>=0)return!1;a=a.next}return!0}function i(e,t,n,r){var a=e.prev,i=e,o=e.next;if(m(a,i,o)>=0)return!1;for(var u=a.x<i.x?a.x<o.x?a.x:o.x:i.x<o.x?i.x:o.x,s=a.y<i.y?a.y<o.y?a.y:o.y:i.y<o.y?i.y:o.y,c=a.x>i.x?a.x>o.x?a.x:o.x:i.x>o.x?i.x:o.x,l=a.y>i.y?a.y>o.y?a.y:o.y:i.y>o.y?i.y:o.y,f=E(u,s,t,n,r),h=E(c,l,t,n,r),d=e.nextZ;d&&d.z<=h;){if(d!==e.prev&&d!==e.next&&p(a.x,a.y,i.x,i.y,o.x,o.y,d.x,d.y)&&m(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(d=e.prevZ;d&&d.z>=f;){if(d!==e.prev&&d!==e.next&&p(a.x,a.y,i.x,i.y,o.x,o.y,d.x,d.y)&&m(d.prev,d,d.next)>=0)return!1;d=d.prevZ}return!0}function o(e,t,n){var r=e;do{var a=r.prev,i=r.next.next;!T(a,i)&&R(a,r,r.next,i)&&S(a,i)&&S(i,a)&&(t.push(a.i/n),t.push(r.i/n),t.push(i.i/n),I(r),I(r.next),r=e=i),r=r.next}while(r!==e);return r}function u(e,t,a,i,o,u){var s=e;do{for(var c=s.next.next;c!==s.prev;){if(s.i!==c.i&&y(s,c)){var l=N(s,c);return s=n(s,s.next),l=n(l,l.next),r(s,t,a,i,o,u),void r(l,t,a,i,o,u)}c=c.next}s=s.next}while(s!==e)}function s(e,r,a,i){var o,u,s,f,h,d=[];for(o=0,u=r.length;o<u;o++)s=r[o]*i,f=o<u-1?r[o+1]*i:e.length,h=t(e,s,f,i,!1),h===h.next&&(h.steiner=!0),d.push(_(h));for(d.sort(c),o=0;o<d.length;o++)l(d[o],a),a=n(a,a.next);return a}function c(e,t){return e.x-t.x}function l(e,t){if(t=f(e,t)){var r=N(t,e);n(r,r.next)}}function f(e,t){var n,r=t,a=e.x,i=e.y,o=-(1/0);do{if(i<=r.y&&i>=r.next.y){var u=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(u<=a&&u>o){if(o=u,u===a){if(i===r.y)return r;if(i===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(a===o)return n.prev;var s,c=n,l=n.x,f=n.y,h=1/0;for(r=n.next;r!==c;)a>=r.x&&r.x>=l&&p(i<f?a:o,i,l,f,i<f?o:a,i,r.x,r.y)&&(s=Math.abs(i-r.y)/(a-r.x),(s<h||s===h&&r.x>n.x)&&S(r,e)&&(n=r,h=s)),r=r.next;return n}function h(e,t,n,r){var a=e;do null===a.z&&(a.z=E(a.x,a.y,t,n,r)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next;while(a!==e);a.prevZ.nextZ=null,a.prevZ=null,d(a)}function d(e){var t,n,r,a,i,o,u,s,c=1;do{for(n=e,e=null,i=null,o=0;n;){for(o++,r=n,u=0,t=0;t<c&&(u++,r=r.nextZ,r);t++);for(s=c;u>0||s>0&&r;)0===u?(a=r,r=r.nextZ,s--):0!==s&&r?n.z<=r.z?(a=n,n=n.nextZ,u--):(a=r,r=r.nextZ,s--):(a=n,n=n.nextZ,u--),i?i.nextZ=a:e=a,a.prevZ=i,i=a;n=r}i.nextZ=null,c*=2}while(o>1);return e}function E(e,t,n,r,a){return e=32767*(e-n)/a,t=32767*(t-r)/a,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function _(e){var t=e,n=e;do t.x<n.x&&(n=t),t=t.next;while(t!==e);return n}function p(e,t,n,r,a,i,o,u){return(a-o)*(t-u)-(e-o)*(i-u)>=0&&(e-o)*(r-u)-(n-o)*(t-u)>=0&&(n-o)*(i-u)-(a-o)*(r-u)>=0}function y(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!A(e,t)&&S(e,t)&&S(t,e)&&v(e,t)}function m(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function T(e,t){return e.x===t.x&&e.y===t.y}function R(e,t,n,r){return!!(T(e,t)&&T(n,r)||T(e,r)&&T(n,t))||m(e,t,n)>0!=m(e,t,r)>0&&m(n,r,e)>0!=m(n,r,t)>0}function A(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&R(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function S(e,t){return m(e.prev,e,e.next)<0?m(e,t,e.next)>=0&&m(e,e.prev,t)>=0:m(e,t,e.prev)<0||m(e,e.next,t)<0}function v(e,t){var n=e,r=!1,a=(e.x+t.x)/2,i=(e.y+t.y)/2;do n.y>i!=n.next.y>i&&a<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function N(e,t){var n=new M(e.i,e.x,e.y),r=new M(t.i,t.x,t.y),a=e.next,i=t.prev;return e.next=t,t.prev=e,n.next=a,a.prev=n,r.next=n,n.prev=r,i.next=r,r.prev=i,r}function O(e,t,n,r){var a=new M(e,t,n);return r?(a.next=r.next,a.prev=r,r.next.prev=a,r.next=a):(a.prev=a,a.next=a),a}function I(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function M(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function g(e,t,n,r){for(var a=0,i=t,o=n-r;i<n;i+=r)a+=(e[o]-e[i])*(e[i+1]+e[o+1]),o=i;return a}return e.deviation=function(e,t,n,r){var a=t&&t.length,i=a?t[0]*n:e.length,o=Math.abs(g(e,0,i,n));if(a)for(var u=0,s=t.length;u<s;u++){var c=t[u]*n,l=u<s-1?t[u+1]*n:e.length;o-=Math.abs(g(e,c,l,n))}var f=0;for(u=0;u<r.length;u+=3){var h=r[u]*n,d=r[u+1]*n,E=r[u+2]*n;f+=Math.abs((e[h]-e[E])*(e[d+1]-e[h+1])-(e[h]-e[d])*(e[E+1]-e[h+1]))}return 0===o&&0===f?0:Math.abs((f-o)/o)},e.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,a=0;a<e.length;a++){for(var i=0;i<e[a].length;i++)for(var o=0;o<t;o++)n.vertices.push(e[a][i][o]);a>0&&(r+=e[a-1].length,n.holes.push(r))}return n},e}),define("Core/WindingOrder",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={CLOCKWISE:t.CW,COUNTER_CLOCKWISE:t.CCW,validate:function(e){return e===n.CLOCKWISE||e===n.COUNTER_CLOCKWISE}};return e(n)}),define("Core/PolygonPipeline",["../ThirdParty/earcut-2.1.1","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./Math","./PrimitiveType","./WindingOrder"],function(e,t,n,r,a,i,o,u,s,c,l,f,h){"use strict";var d=new n,E=new n,_={};_.computeArea2D=function(e){for(var t=e.length,n=0,r=t-1,a=0;a<t;r=a++){var i=e[r],o=e[a];n+=i.x*o.y-o.x*i.y}return.5*n},_.computeWindingOrder2D=function(e){var t=_.computeArea2D(e);return t>0?h.COUNTER_CLOCKWISE:h.CLOCKWISE},_.triangulate=function(n,r){var a=t.packArray(n);return e(a,r,2)};var p=new n,y=new n,m=new n,T=new n,R=new n,A=new n,S=new n;return _.computeSubdivision=function(e,t,o,u){u=a(u,l.RADIANS_PER_DEGREE);var h,d=o.slice(0),E=t.length,_=new Array(3*E),v=0;for(h=0;h<E;h++){var N=t[h];_[v++]=N.x,_[v++]=N.y,_[v++]=N.z}for(var O=[],I={},M=e.maximumRadius,g=l.chordLength(u,M),x=g*g;d.length>0;){var w,C,P=d.pop(),U=d.pop(),D=d.pop(),L=n.fromArray(_,3*D,p),F=n.fromArray(_,3*U,y),z=n.fromArray(_,3*P,m),B=n.multiplyByScalar(n.normalize(L,T),M,T),b=n.multiplyByScalar(n.normalize(F,R),M,R),G=n.multiplyByScalar(n.normalize(z,A),M,A),q=n.magnitudeSquared(n.subtract(B,b,S)),W=n.magnitudeSquared(n.subtract(b,G,S)),X=n.magnitudeSquared(n.subtract(G,B,S)),V=Math.max(q,W,X); +V>x?q===V?(w=Math.min(D,U)+" "+Math.max(D,U),h=I[w],i(h)||(C=n.add(L,F,S),n.multiplyByScalar(C,.5,C),_.push(C.x,C.y,C.z),h=_.length/3-1,I[w]=h),d.push(D,h,P),d.push(h,U,P)):W===V?(w=Math.min(U,P)+" "+Math.max(U,P),h=I[w],i(h)||(C=n.add(F,z,S),n.multiplyByScalar(C,.5,C),_.push(C.x,C.y,C.z),h=_.length/3-1,I[w]=h),d.push(U,h,D),d.push(h,P,D)):X===V&&(w=Math.min(P,D)+" "+Math.max(P,D),h=I[w],i(h)||(C=n.add(z,L,S),n.multiplyByScalar(C,.5,C),_.push(C.x,C.y,C.z),h=_.length/3-1,I[w]=h),d.push(P,h,U),d.push(h,D,U)):(O.push(D),O.push(U),O.push(P))}return new s({attributes:{position:new c({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:_})},indices:O,primitiveType:f.TRIANGLES})},_.scaleToGeodeticHeight=function(e,t,r,o){r=a(r,u.WGS84);var s=d,c=E;if(t=a(t,0),o=a(o,!0),i(e))for(var l=e.length,f=0;f<l;f+=3)n.fromArray(e,f,c),o&&(c=r.scaleToGeodeticSurface(c,c)),0!==t&&(s=r.geodeticSurfaceNormal(c,s),n.multiplyByScalar(s,t,s),n.add(c,s,c)),e[f]=c.x,e[f+1]=c.y,e[f+2]=c.z;return e},_}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Intersect"],function(e,t,n,r,a){"use strict";function i(r,a,i){this.minimum=e.clone(t(r,e.ZERO)),this.maximum=e.clone(t(a,e.ZERO)),n(i)?i=e.clone(i):(i=e.add(this.minimum,this.maximum,new e),e.multiplyByScalar(i,.5,i)),this.center=i}i.fromPoints=function(t,r){if(n(r)||(r=new i),!n(t)||0===t.length)return r.minimum=e.clone(e.ZERO,r.minimum),r.maximum=e.clone(e.ZERO,r.maximum),r.center=e.clone(e.ZERO,r.center),r;for(var a=t[0].x,o=t[0].y,u=t[0].z,s=t[0].x,c=t[0].y,l=t[0].z,f=t.length,h=1;h<f;h++){var d=t[h],E=d.x,_=d.y,p=d.z;a=Math.min(E,a),s=Math.max(E,s),o=Math.min(_,o),c=Math.max(_,c),u=Math.min(p,u),l=Math.max(p,l)}var y=r.minimum;y.x=a,y.y=o,y.z=u;var m=r.maximum;m.x=s,m.y=c,m.z=l;var T=e.add(y,m,r.center);return e.multiplyByScalar(T,.5,T),r},i.clone=function(t,r){if(n(t))return n(r)?(r.minimum=e.clone(t.minimum,r.minimum),r.maximum=e.clone(t.maximum,r.maximum),r.center=e.clone(t.center,r.center),r):new i(t.minimum,t.maximum)},i.equals=function(t,r){return t===r||n(t)&&n(r)&&e.equals(t.center,r.center)&&e.equals(t.minimum,r.minimum)&&e.equals(t.maximum,r.maximum)};var o=new e;return i.intersectPlane=function(t,n){o=e.subtract(t.maximum,t.minimum,o);var r=e.multiplyByScalar(o,.5,o),i=n.normal,u=r.x*Math.abs(i.x)+r.y*Math.abs(i.y)+r.z*Math.abs(i.z),s=e.dot(t.center,i)+n.distance;return s-u>0?a.INSIDE:s+u<0?a.OUTSIDE:a.INTERSECTING},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.intersectPlane=function(e){return i.intersectPlane(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function n(e,n,r){var a=e+n;return t.sign(e)!==t.sign(n)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(n)))<r?0:a}var r={};return r.computeDiscriminant=function(e,t,n){var r=t*t-4*e*n;return r},r.computeRealRoots=function(e,r,a){var i;if(0===e)return 0===r?[]:[-a/r];if(0===r){if(0===a)return[0,0];var o=Math.abs(a),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,i<0)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-r/e,i<0?[i,0]:[0,i];var c=r*r,l=4*e*a,f=n(c,-l,t.EPSILON14);if(f<0)return[];var h=-.5*n(r,t.sign(r)*Math.sqrt(f),t.EPSILON14);return r>0?[h/e,a/h]:[a/h,h/e]},r}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function n(e,t,n,r){var a,i,o=e,u=t/3,s=n/3,c=r,l=o*s,f=u*c,h=u*u,d=s*s,E=o*s-h,_=o*c-u*s,p=u*c-d,y=4*E*p-_*_;if(y<0){var m,T,R;h*f>=l*d?(m=o,T=E,R=-2*u*E+o*_):(m=c,T=p,R=-c*_+2*s*p);var A=R<0?-1:1,S=-A*Math.abs(m)*Math.sqrt(-y);i=-R+S;var v=i/2,N=v<0?-Math.pow(-v,1/3):Math.pow(v,1/3),O=i===S?-N:-T/N;return a=T<=0?N+O:-R/(N*N+O*O+T),h*f>=l*d?[(a-u)/o]:[-c/(a+s)]}var I=E,M=-2*u*E+o*_,g=p,x=-c*_+2*s*p,w=Math.sqrt(y),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*w,-M)/3);a=2*Math.sqrt(-I);var U=Math.cos(P);i=a*U;var D=a*(-U/2-C*Math.sin(P)),L=i+D>2*u?i-u:D-u,F=o,z=L/F;P=Math.abs(Math.atan2(c*w,-x)/3),a=2*Math.sqrt(-g),U=Math.cos(P),i=a*U,D=a*(-U/2-C*Math.sin(P));var B=-c,b=i+D<2*s?i+s:D+s,G=B/b,q=F*b,W=-L*b-F*B,X=L*B,V=(s*W-u*X)/(-u*W+s*q);return z<=V?z<=G?V<=G?[z,V,G]:[z,G,V]:[G,z,V]:z<=G?[V,z,G]:V<=G?[V,G,z]:[G,V,z]}var r={};return r.computeDiscriminant=function(e,t,n,r){var a=e*e,i=t*t,o=n*n,u=r*r,s=18*e*t*n*r+i*o-27*a*u-4*(e*o*n+i*t*r);return s},r.computeRealRoots=function(e,r,a,i){var o,u;if(0===e)return t.computeRealRoots(r,a,i);if(0===r){if(0===a){if(0===i)return[0,0,0];u=-i/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===i?(o=t.computeRealRoots(e,0,a),0===o.Length?[0]:[o[0],0,o[1]]):n(e,0,a,i)}return 0===a?0===i?(u=-r/e,u<0?[u,0,0]:[0,0,u]):n(e,r,0,i):0===i?(o=t.computeRealRoots(e,r,a),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):n(e,r,a,i)},r}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,n,r){"use strict";function a(t,a,i,o){var u=t*t,s=a-3*u/8,c=i-a*t/2+u*t/8,l=o-i*t/4+a*u/16-3*u*u/256,f=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(f.length>0){var h=-t/4,d=f[f.length-1];if(Math.abs(d)<n.EPSILON14){var E=r.computeRealRoots(1,s,l);if(2===E.length){var _,p=E[0],y=E[1];if(p>=0&&y>=0){var m=Math.sqrt(p),T=Math.sqrt(y);return[h-T,h-m,h+m,h+T]}if(p>=0&&y<0)return _=Math.sqrt(p),[h-_,h+_];if(p<0&&y>=0)return _=Math.sqrt(y),[h-_,h+_]}return[]}if(d>0){var R=Math.sqrt(d),A=(s+d-c/R)/2,S=(s+d+c/R)/2,v=r.computeRealRoots(1,R,A),N=r.computeRealRoots(1,-R,S);return 0!==v.length?(v[0]+=h,v[1]+=h,0!==N.length?(N[0]+=h,N[1]+=h,v[1]<=N[0]?[v[0],v[1],N[0],N[1]]:N[1]<=v[0]?[N[0],N[1],v[0],v[1]]:v[0]>=N[0]&&v[1]<=N[1]?[N[0],v[0],v[1],N[1]]:N[0]>=v[0]&&N[1]<=v[1]?[v[0],N[0],N[1],v[1]]:v[0]>N[0]&&v[0]<N[1]?[N[0],v[0],N[1],v[1]]:[v[0],N[0],v[1],N[1]]):v):0!==N.length?(N[0]+=h,N[1]+=h,N):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,f=i*t+s-4*o,h=c*o-i*a*t+u,d=e.computeRealRoots(1,l,f,h);if(d.length>0){var E,_,p=d[0],y=a-p,m=y*y,T=t/2,R=y/2,A=m-4*o,S=m+4*Math.abs(o),v=c-4*p,N=c+4*Math.abs(p);if(p<0||A*N<v*S){var O=Math.sqrt(v);E=O/2,_=0===O?0:(t*R-i)/O}else{var I=Math.sqrt(A);E=0===I?0:(t*R-i)/I,_=I/2}var M,g;0===T&&0===E?(M=0,g=0):n.sign(T)===n.sign(E)?(M=T+E,g=p/M):(g=T-E,M=p/g);var x,w;0===R&&0===_?(x=0,w=0):n.sign(R)===n.sign(_)?(x=R+_,w=o/x):(w=R-_,x=o/w);var C=r.computeRealRoots(1,M,x),P=r.computeRealRoots(1,g,w);if(0!==C.length)return 0!==P.length?C[1]<=P[0]?[C[0],C[1],P[0],P[1]]:P[1]<=C[0]?[P[0],P[1],C[0],C[1]]:C[0]>=P[0]&&C[1]<=P[1]?[P[0],C[0],C[1],P[1]]:P[0]>=C[0]&&P[1]<=C[1]?[C[0],P[0],P[1],C[1]]:C[0]>P[0]&&C[0]<P[1]?[P[0],C[0],P[1],C[1]]:[C[0],P[0],C[1],P[1]]:C;if(0!==P.length)return P}return[]}var o={};return o.computeDiscriminant=function(e,t,n,r,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=n*n,l=c*n,f=r*r,h=f*r,d=a*a,E=d*a,_=u*c*f-4*s*h-4*e*l*f+18*e*t*n*h-27*i*f*f+256*o*E+a*(18*s*n*r-4*u*l+16*e*c*c-80*e*t*c*r-6*e*u*f+144*i*n*f)+d*(144*e*u*n-27*u*u-128*i*c-192*i*t*r);return _},o.computeRealRoots=function(t,r,o,u,s){if(Math.abs(t)<n.EPSILON15)return e.computeRealRoots(r,o,u,s);var c=r/t,l=o/t,f=u/t,h=s/t,d=c<0?1:0;switch(d+=l<0?d+1:d,d+=f<0?d+1:d,d+=h<0?d+1:d){case 0:return a(c,l,f,h);case 1:return i(c,l,f,h);case 2:return i(c,l,f,h);case 3:return a(c,l,f,h);case 4:return a(c,l,f,h);case 5:return i(c,l,f,h);case 6:return a(c,l,f,h);case 7:return a(c,l,f,h);case 8:return i(c,l,f,h);case 9:return a(c,l,f,h);case 10:return a(c,l,f,h);case 11:return i(c,l,f,h);case 12:return a(c,l,f,h);case 13:return a(c,l,f,h);case 14:return a(c,l,f,h);case 15:return a(c,l,f,h);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=e.clone(t(r,e.ZERO)),e.equals(r,e.ZERO)||e.normalize(r,r),this.origin=e.clone(t(n,e.ZERO)),this.direction=r}return a.getPoint=function(t,r,a){return n(a)||(a=new e),a=e.multiplyByScalar(t.direction,r,a),e.add(t.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,n,r,a,i,o,u,s,c,l){"use strict";function f(e,t,n,r){var a=t*t-4*e*n;if(!(a<0)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return u<s?(r.root0=u,r.root1=s):(r.root0=s,r.root1=u),r}var c=-t/(2*e);if(0!==c)return r.root0=r.root1=c,r}}function h(t,n,a){r(a)||(a=new i);var o=t.origin,u=t.direction,s=n.center,c=n.radius*n.radius,l=e.subtract(o,s,m),h=e.dot(u,u),d=2*e.dot(u,l),E=e.magnitudeSquared(l)-c,_=f(h,d,E,S);if(r(_))return a.start=_.root0,a.stop=_.root1,a}function d(e,t,n){var r=e+t;return o.sign(e)!==o.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))<n?0:r}function E(t,n,r,a,i){var l,f=a*a,h=i*i,E=(t[u.COLUMN1ROW1]-t[u.COLUMN2ROW2])*h,_=i*(a*d(t[u.COLUMN1ROW0],t[u.COLUMN0ROW1],o.EPSILON15)+n.y),p=t[u.COLUMN0ROW0]*f+t[u.COLUMN2ROW2]*h+a*n.x+r,y=h*d(t[u.COLUMN2ROW1],t[u.COLUMN1ROW2],o.EPSILON15),m=i*(a*d(t[u.COLUMN2ROW0],t[u.COLUMN0ROW2])+n.z),T=[];if(0===m&&0===y){if(l=s.computeRealRoots(E,_,p),0===l.length)return T;var R=l[0],A=Math.sqrt(Math.max(1-R*R,0));if(T.push(new e(a,i*R,i*-A)),T.push(new e(a,i*R,i*A)),2===l.length){var S=l[1],v=Math.sqrt(Math.max(1-S*S,0));T.push(new e(a,i*S,i*-v)),T.push(new e(a,i*S,i*v))}return T}var N=m*m,O=y*y,I=E*E,M=m*y,g=I+O,x=2*(_*E+M),w=2*p*E+_*_-O+N,C=2*(p*_-M),P=p*p-N;if(0===g&&0===x&&0===w&&0===C)return T;l=c.computeRealRoots(g,x,w,C,P);var U=l.length;if(0===U)return T;for(var D=0;D<U;++D){var L,F=l[D],z=F*F,B=Math.max(1-z,0),b=Math.sqrt(B);L=o.sign(E)===o.sign(p)?d(E*z+p,_*F,o.EPSILON12):o.sign(p)===o.sign(_*F)?d(E*z,_*F+p,o.EPSILON12):d(E*z+_*F,p,o.EPSILON12);var G=d(y*F,m,o.EPSILON15),q=L*G;q<0?T.push(new e(a,i*F,i*b)):q>0?T.push(new e(a,i*F,i*-b)):0!==b?(T.push(new e(a,i*F,i*-b)),T.push(new e(a,i*F,i*b)),++D):T.push(new e(a,i*F,i*b))}return T}var _={};_.rayPlane=function(t,n,a){r(a)||(a=new e);var i=t.origin,u=t.direction,s=n.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON15)){var l=(-n.distance-e.dot(s,i))/c;if(!(l<0))return a=e.multiplyByScalar(u,l,a),e.add(i,a,a)}};var p=new e,y=new e,m=new e,T=new e,R=new e;_.rayTriangleParametric=function(t,r,a,i,u){u=n(u,!1);var s,c,l,f,h,d=t.origin,E=t.direction,_=e.subtract(a,r,p),A=e.subtract(i,r,y),S=e.cross(E,A,m),v=e.dot(_,S);if(u){if(v<o.EPSILON6)return;if(s=e.subtract(d,r,T),l=e.dot(s,S),l<0||l>v)return;if(c=e.cross(s,_,R),f=e.dot(E,c),f<0||l+f>v)return;h=e.dot(A,c)/v}else{if(Math.abs(v)<o.EPSILON6)return;var N=1/v;if(s=e.subtract(d,r,T),l=e.dot(s,S)*N,l<0||l>1)return;if(c=e.cross(s,_,R),f=e.dot(E,c)*N,f<0||l+f>1)return;h=e.dot(A,c)*N}return h},_.rayTriangle=function(t,n,a,i,o,u){var s=_.rayTriangleParametric(t,n,a,i,o);if(r(s)&&!(s<0))return r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var A=new l;_.lineSegmentTriangle=function(t,n,a,i,o,u,s){var c=A;e.clone(t,c.origin),e.subtract(n,t,c.direction),e.normalize(c.direction,c.direction);var l=_.rayTriangleParametric(c,a,i,o,u);if(!(!r(l)||l<0||l>e.distance(t,n)))return r(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var S={root0:0,root1:0};_.raySphere=function(e,t,n){if(n=h(e,t,n),r(n)&&!(n.stop<0))return n.start=Math.max(n.start,0),n};var v=new l;_.lineSegmentSphere=function(t,n,a,i){var o=v;e.clone(t,o.origin);var u=e.subtract(n,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),i=h(o,a,i),!(!r(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var N=new e,O=new e;_.rayEllipsoid=function(t,n){var r,a,o,u,s,c=n.oneOverRadii,l=e.multiplyComponents(c,t.origin,N),f=e.multiplyComponents(c,t.direction,O),h=e.magnitudeSquared(l),d=e.dot(l,f);if(h>1){if(d>=0)return;var E=d*d;if(r=h-1,a=e.magnitudeSquared(f),o=a*r,E<o)return;if(E>o){u=d*d-o,s=-d+Math.sqrt(u);var _=s/a,p=r/s;return _<p?new i(_,p):{start:p,stop:_}}var y=Math.sqrt(r/a);return new i(y,y)}return h<1?(r=h-1,a=e.magnitudeSquared(f),o=a*r,u=d*d-o,s=-d+Math.sqrt(u),new i(0,s/a)):d<0?(a=e.magnitudeSquared(f),new i(0,-d/a)):void 0};var I=new e,M=new e,g=new e,x=new e,w=new e,C=new u,P=new u,U=new u,D=new u,L=new u,F=new u,z=new u,B=new e,b=new e,G=new t;_.grazingAltitudeLocation=function(t,n){var a=t.origin,i=t.direction;if(!e.equals(a,e.ZERO)){var s=n.geodeticSurfaceNormal(a,I);if(e.dot(i,s)>=0)return a}var c=r(this.rayEllipsoid(t,n)),l=n.transformPositionToScaledSpace(i,I),f=e.normalize(l,l),h=e.mostOrthogonalAxis(l,x),d=e.normalize(e.cross(h,f,M),M),_=e.normalize(e.cross(f,d,g),g),p=C;p[0]=f.x,p[1]=f.y,p[2]=f.z,p[3]=d.x,p[4]=d.y,p[5]=d.z,p[6]=_.x,p[7]=_.y,p[8]=_.z;var y=u.transpose(p,P),m=u.fromScale(n.radii,U),T=u.fromScale(n.oneOverRadii,D),R=L;R[0]=0,R[1]=-i.z,R[2]=i.y,R[3]=i.z,R[4]=0,R[5]=-i.x,R[6]=-i.y,R[7]=i.x,R[8]=0;var A,S,v=u.multiply(u.multiply(y,T,F),R,F),N=u.multiply(u.multiply(v,m,z),p,z),O=u.multiplyByVector(v,a,w),q=E(N,e.negate(O,I),0,0,1),W=q.length;if(W>0){for(var X=e.clone(e.ZERO,b),V=Number.NEGATIVE_INFINITY,H=0;H<W;++H){A=u.multiplyByVector(m,u.multiplyByVector(p,q[H],B),B);var Y=e.normalize(e.subtract(A,a,x),x),k=e.dot(Y,i);k>V&&(V=k,X=e.clone(A,X))}var Z=n.cartesianToCartographic(X,G);return V=o.clamp(V,0,1),S=e.magnitude(e.subtract(X,a,x))*Math.sqrt(1-V*V),S=c?-S:S,Z.height=S,n.cartographicToCartesian(Z,new e)}};var q=new e;return _.lineSegmentPlane=function(t,n,a,i){r(i)||(i=new e);var u=e.subtract(n,t,q),s=a.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON6)){var l=e.dot(s,t),f=-(a.distance+l)/c;if(!(f<0||f>1))return e.multiplyByScalar(u,f,i),e.add(t,i,i),i}},_.trianglePlaneIntersection=function(t,n,r,a){var i=a.normal,o=a.distance,u=e.dot(i,t)+o<0,s=e.dot(i,n)+o<0,c=e.dot(i,r)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var f,h;if(1!==l&&2!==l||(f=new e,h=new e),1===l){if(u)return _.lineSegmentPlane(t,n,a,f),_.lineSegmentPlane(t,r,a,h),{positions:[t,n,r,f,h],indices:[0,3,4,1,2,4,1,4,3]};if(s)return _.lineSegmentPlane(n,r,a,f),_.lineSegmentPlane(n,t,a,h),{positions:[t,n,r,f,h],indices:[1,3,4,2,0,4,2,4,3]};if(c)return _.lineSegmentPlane(r,t,a,f),_.lineSegmentPlane(r,n,a,h),{positions:[t,n,r,f,h],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return _.lineSegmentPlane(n,t,a,f),_.lineSegmentPlane(r,t,a,h),{positions:[t,n,r,f,h],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return _.lineSegmentPlane(r,n,a,f),_.lineSegmentPlane(t,n,a,h),{positions:[t,n,r,f,h],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return _.lineSegmentPlane(t,r,a,f),_.lineSegmentPlane(n,r,a,h),{positions:[t,n,r,f,h],indices:[0,1,4,0,4,3,2,3,4]}}},_}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";function a(t,n){this.normal=e.clone(t),this.distance=n}a.fromPointNormal=function(n,r,i){var o=-e.dot(r,n);return t(i)?(e.clone(r,i.normal),i.distance=o,i):new a(r,o)};var i=new e;return a.fromCartesian4=function(n,r){var o=e.fromCartesian4(n,i),u=n.w;return t(r)?(e.clone(o,r.normal),r.distance=u,r):new a(o,u)},a.getPointDistance=function(t,n){return e.dot(t.normal,n)+t.distance},a.ORIGIN_XY_PLANE=r(new a(e.UNIT_Z,0)),a.ORIGIN_YZ_PLANE=r(new a(e.UNIT_X,0)),a.ORIGIN_ZX_PLANE=r(new a(e.UNIT_Y,0)),a}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,n,r,a){return t(e).then(n,r,a)}function t(e){var t,n;return e instanceof r?t=e:u(e)?(n=o(),e.then(function(e){n.resolve(e)},function(e){n.reject(e)},function(e){n.progress(e)}),t=n.promise):t=a(e),t}function n(t){return e(t,i)}function r(e){this.then=e}function a(e){var n=new r(function(n){try{return t(n?n(e):e)}catch(e){return i(e)}});return n}function i(e){var n=new r(function(n,r){try{return r?t(r(e)):i(e)}catch(e){return i(e)}});return n}function o(){function e(e,t,n){return h(e,t,n)}function n(e){return E(e)}function a(e){return E(i(e))}function u(e){return d(e)}var s,c,l,f,h,d,E;return c=new r(e),s={then:e,resolve:n,reject:a,progress:u,promise:c,resolver:{resolve:n,reject:a,progress:u}},l=[],f=[],h=function(e,t,n){var r,a;return r=o(),a="function"==typeof n?function(e){try{r.progress(n(e))}catch(e){r.progress(e)}}:function(e){r.progress(e)},l.push(function(n){n.then(e,t).then(r.resolve,r.reject,a)}),f.push(a),r.promise},d=function(e){return _(f,e),e},E=function(e){return e=t(e),h=e.then,E=t,d=y,_(l,e),f=l=A,e},s}function u(e){return e&&"function"==typeof e.then}function s(t,n,r,a,i){return p(2,arguments),e(t,function(t){function u(e){_(e)}function s(e){E(e)}var c,l,f,h,d,E,_,p,m,T;if(m=t.length>>>0,c=Math.max(0,Math.min(n,m)),f=[],l=m-c+1,h=[],d=o(),c)for(p=d.progress,_=function(e){h.push(e),--l||(E=_=y,d.reject(h))},E=function(e){f.push(e),--c||(E=_=y,d.resolve(f))},T=0;T<m;++T)T in t&&e(t[T],s,u,p);else d.resolve(f);return d.then(r,a,i)})}function c(e,t,n,r){function a(e){return t?t(e[0]):e[0]}return s(e,1,a,n,r)}function l(e,t,n,r){return p(1,arguments),h(e,m).then(t,n,r)}function f(){return h(arguments,m)}function h(t,n){return e(t,function(t){var r,a,i,u,s,c;if(i=a=t.length>>>0,r=[],c=o(),i)for(u=function(t,a){e(t,n).then(function(e){r[a]=e,--i||c.resolve(r)},c.reject)},s=0;s<a;s++)s in t?u(t[s],s):--i;else c.resolve(r);return c.promise})}function d(t,n){var r=R.call(arguments,1);return e(t,function(t){var a;return a=t.length,r[0]=function(t,r,i){return e(t,function(t){return e(r,function(e){return n(t,e,i,a)})})},T.apply(t,r)})}function E(t,n,r){var a=arguments.length>2;return e(t,function(e){return e=a?r:e,n.resolve(e),e},function(e){return n.reject(e),i(e)},n.progress)}function _(e,t){for(var n,r=0;n=e[r++];)n(t)}function p(e,t){for(var n,r=t.length;r>e;)if(n=t[--r],null!=n&&"function"!=typeof n)throw new Error("arg "+r+" must be a function")}function y(){}function m(e){return e}var T,R,A;return e.defer=o,e.resolve=t,e.reject=n,e.join=f,e.all=l,e.map=h,e.reduce=d,e.any=c,e.some=s,e.chain=E,e.isPromise=u,r.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(A,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return l(t,function(t){return e.apply(A,t)})})}},R=[].slice,T=[].reduce||function(e){var t,n,r,a,i;if(i=0,t=Object(this),a=t.length>>>0,n=arguments,n.length<=1)for(;;){if(i in t){r=t[i++];break}if(++i>=a)throw new TypeError}else r=n[1];for(;i<a;++i)i in t&&(r=e(r,t[i],i,t));return r},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/binarySearch",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e,t,n){for(var r,a,i=0,o=e.length-1;i<=o;)if(r=~~((i+o)/2),a=n(e[r],t),a<0)i=r+1;else{if(!(a>0))return r;o=r-1}return~(o+1)}return n}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,n,r,a){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=r,this.ut1MinusUtc=a}return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,n=0,r=t[n++],a=function(e,t,n,r){n||(n=" ");var a=e.length>=t?"":Array(1+t-e.length>>>0).join(n);return r?e+a:a+e},i=function(e,t,n,r,i,o){var u=r-e.length;return u>0&&(e=n||!i?a(e,r,o,n):e.slice(0,t.length)+a("",u,"0",!0)+e.slice(t.length)),e},o=function(e,t,n,r,o,u,s){var c=e>>>0;return n=n&&c&&{2:"0b",8:"0",16:"0x"}[t]||"",e=n+a(c.toString(t),u||0,"0",!1),i(e,n,r,o,s)},u=function(e,t,n,r,a,o){return null!=r&&(e=e.slice(0,r)),i(e,"",t,n,a,o)},s=function(e,r,s,c,l,f,h){var d,E,_,p,y;if("%%"==e)return"%";for(var m=!1,T="",R=!1,A=!1,S=" ",v=s.length,N=0;s&&N<v;N++)switch(s.charAt(N)){case" ":T=" ";break;case"+":T="+";break;case"-":m=!0;break;case"'":S=s.charAt(N+1);break;case"0":R=!0;break;case"#":A=!0}if(c=c?"*"==c?+t[n++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,c<0&&(c=-c,m=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(f=f?"*"==f?+t[n++]:"*"==f.charAt(0)?+t[f.slice(1,-1)]:+f:"fFeE".indexOf(h)>-1?6:"d"==h?0:void 0,y=r?t[r.slice(0,-1)]:t[n++],h){case"s":return u(String(y),m,c,f,R,S);case"c":return u(String.fromCharCode(+y),m,c,f,R);case"b":return o(y,2,A,m,c,f,R);case"o":return o(y,8,A,m,c,f,R);case"x":return o(y,16,A,m,c,f,R);case"X":return o(y,16,A,m,c,f,R).toUpperCase();case"u":return o(y,10,A,m,c,f,R);case"i":case"d":return d=+y||0,d=Math.round(d-d%1),E=d<0?"-":T,y=E+a(String(Math.abs(d)),f,"0",!1),i(y,E,m,c,R);case"e":case"E":case"f":case"F":case"g":case"G":return d=+y,E=d<0?"-":T,_=["toExponential","toFixed","toPrecision"]["efg".indexOf(h.toLowerCase())],p=["toString","toUpperCase"]["eEfFgG".indexOf(h)%2],y=E+Math.abs(d)[_](f),i(y,E,m,c,R)[p]();default:return e}};return r.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,n,r,a,i,o,u){this.year=e,this.month=t,this.day=n,this.hour=r,this.minute=a,this.second=i,this.millisecond=o,this.isLeapSecond=u}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e(t)}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t){return _.compare(e.julianDate,t.julianDate)}function f(e){T.julianDate=e;var n=_.leapSeconds,r=t(n,T,l);r<0&&(r=~r),r>=n.length&&(r=n.length-1);var a=n[r].offset;if(r>0){var i=_.secondsDifference(n[r].julianDate,e);i>a&&(r--,a=n[r].offset)}_.addSeconds(e,a,e)}function h(e,n){T.julianDate=e;var r=_.leapSeconds,a=t(r,T,l);if(a<0&&(a=~a),0===a)return _.addSeconds(e,-r[0].offset,n);if(a>=r.length)return _.addSeconds(e,-r[a-1].offset,n);var i=_.secondsDifference(r[a].julianDate,e);return 0===i?_.addSeconds(e,-r[a].offset,n):i<=1?void 0:_.addSeconds(e,-r[--a].offset,n)}function d(e,t,n){var r=t/s.SECONDS_PER_DAY|0;return e+=r,t-=s.SECONDS_PER_DAY*r,t<0&&(e--,t+=s.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function E(e,t,n,r,a,i,o){var u=(t-14)/12|0,c=e+4800+u,l=(1461*c/4|0)+(367*(t-2-12*u)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;r-=12,r<0&&(r+=24);var f=i+(r*s.SECONDS_PER_HOUR+a*s.SECONDS_PER_MINUTE+o*s.SECONDS_PER_MILLISECOND);return f>=43200&&(l-=1),[l,f]}function _(e,t,r){this.dayNumber=void 0,this.secondsOfDay=void 0,e=n(e,0),t=n(t,0),r=n(r,c.UTC);var a=0|e;t+=(e-a)*s.SECONDS_PER_DAY,d(a,t,this),r===c.UTC&&f(this)}var p=new i,y=[31,28,31,30,31,30,31,31,30,31,30,31],m=29,T=new u,R=/^(\d{4})$/,A=/^(\d{4})-(\d{2})$/,S=/^(\d{4})-?(\d{3})$/,v=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,N=/^(\d{4})-?(\d{2})-?(\d{2})$/,O=/([Z+\-])?(\d{2})?:?(\d{2})?$/,I=/^(\d{2})(\.\d+)?/.source+O.source,M=/^(\d{2}):?(\d{2})(\.\d+)?/.source+O.source,g=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+O.source;_.fromDate=function(e,t){var n=E(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r(t)?(d(n[0],n[1],t),f(t),t):new _(n[0],n[1],c.UTC)},_.fromIso8601=function(e,t){e=e.replace(",",".");var n,a,i,u=e.split("T"),s=1,l=1,h=0,p=0,T=0,O=0,x=u[0],w=u[1];if(u=x.match(N),null!==u)n=+u[1],s=+u[2],l=+u[3];else if(u=x.match(A),null!==u)n=+u[1],s=+u[2];else if(u=x.match(R),null!==u)n=+u[1];else{var C;if(u=x.match(S),null!==u)n=+u[1],C=+u[2],i=o(n);else if(u=x.match(v),null!==u){n=+u[1];var P=+u[2],U=+u[3]||0,D=new Date(Date.UTC(n,0,4));C=7*P+U-D.getUTCDay()-3}a=new Date(Date.UTC(n,0,1)),a.setUTCDate(C),s=a.getUTCMonth()+1,l=a.getUTCDate()}i=o(n);var L;if(r(w)){u=w.match(g),null!==u?(h=+u[1],p=+u[2],T=+u[3],O=1e3*+(u[4]||0),L=5):(u=w.match(M),null!==u?(h=+u[1],p=+u[2],T=60*+(u[3]||0),L=4):(u=w.match(I),null!==u&&(h=+u[1],p=60*+(u[2]||0),L=3)));var F=u[L],z=+u[L+1],B=+(u[L+2]||0);switch(F){case"+":h-=z,p-=B;break;case"-":h+=z,p+=B;break;case"Z":break;default:p+=new Date(Date.UTC(n,s-1,l,h,p)).getTimezoneOffset()}}else p+=new Date(n,s-1,l).getTimezoneOffset();var b=60===T;for(b&&T--;p>=60;)p-=60,h++;for(;h>=24;)h-=24,l++;for(a=i&&2===s?m:y[s-1];l>a;)l-=a,s++,s>12&&(s-=12,n++),a=i&&2===s?m:y[s-1];for(;p<0;)p+=60,h--;for(;h<0;)h+=24,l--;for(;l<1;)s--,s<1&&(s+=12,n--),a=i&&2===s?m:y[s-1],l+=a;var G=E(n,s,l,h,p,T,O);return r(t)?(d(G[0],G[1],t),f(t)):t=new _(G[0],G[1],c.UTC),b&&_.addSeconds(t,1,t),t},_.now=function(e){return _.fromDate(new Date,e)};var x=new _(0,0,c.TAI);return _.toGregorianDate=function(e,t){var n=!1,a=h(e,x);r(a)||(_.addSeconds(e,-1,x),a=h(x,x),n=!0);var o=a.dayNumber,u=a.secondsOfDay;u>=43200&&(o+=1);var c=o+68569|0,l=4*c/146097|0;c=c-((146097*l+3)/4|0)|0;var f=4e3*(c+1)/1461001|0;c=c-(1461*f/4|0)+31|0;var d=80*c/2447|0,E=c-(2447*d/80|0)|0;c=d/11|0;var p=d+2-12*c|0,y=100*(l-49)+f+c|0,m=u/s.SECONDS_PER_HOUR|0,T=u-m*s.SECONDS_PER_HOUR,R=T/s.SECONDS_PER_MINUTE|0;T-=R*s.SECONDS_PER_MINUTE;var A=0|T,S=(T-A)/s.SECONDS_PER_MILLISECOND;return m+=12,m>23&&(m-=24),n&&(A+=1),r(t)?(t.year=y,t.month=p,t.day=E,t.hour=m,t.minute=R,t.second=A,t.millisecond=S,t.isLeapSecond=n,t):new i(y,p,E,m,R,A,S,n)},_.toDate=function(e){var t=_.toGregorianDate(e,p),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))},_.toIso8601=function(t,n){var a,i=_.toGregorianDate(t,i);return r(n)||0===i.millisecond?r(n)&&0!==n?(a=(.01*i.millisecond).toFixed(n).replace(".","").slice(0,n),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",i.year,i.month,i.day,i.hour,i.minute,i.second):(a=(.01*i.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a))},_.clone=function(e,t){if(r(e))return r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new _(e.dayNumber,e.secondsOfDay,c.TAI)},_.compare=function(e,t){var n=e.dayNumber-t.dayNumber;return 0!==n?n:e.secondsOfDay-t.secondsOfDay},_.equals=function(e,t){return e===t||r(e)&&r(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},_.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(_.secondsDifference(e,t))<=n},_.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},_.secondsDifference=function(e,t){var n=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return n+(e.secondsOfDay-t.secondsOfDay)},_.daysDifference=function(e,t){var n=e.dayNumber-t.dayNumber,r=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return n+r},_.computeTaiMinusUtc=function(e){T.julianDate=e;var n=_.leapSeconds,r=t(n,T,l);return r<0&&(r=~r,--r,r<0&&(r=0)),n[r].offset},_.addSeconds=function(e,t,n){return d(e.dayNumber,e.secondsOfDay+t,n)},_.addMinutes=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return d(e.dayNumber,r,n)},_.addHours=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return d(e.dayNumber,r,n)},_.addDays=function(e,t,n){var r=e.dayNumber+t;return d(r,e.secondsOfDay,n)},_.lessThan=function(e,t){return _.compare(e,t)<0},_.lessThanOrEquals=function(e,t){return _.compare(e,t)<=0},_.greaterThan=function(e,t){return _.compare(e,t)>0},_.greaterThanOrEquals=function(e,t){return _.compare(e,t)>=0},_.prototype.clone=function(e){return _.clone(this,e)},_.prototype.equals=function(e){return _.equals(this,e)},_.prototype.equalsEpsilon=function(e,t){return _.equalsEpsilon(this,e,t)},_.prototype.toString=function(){return _.toIso8601(this)},_.leapSeconds=[new u(new _(2441317,43210,c.TAI),10),new u(new _(2441499,43211,c.TAI),11),new u(new _(2441683,43212,c.TAI),12),new u(new _(2442048,43213,c.TAI),13),new u(new _(2442413,43214,c.TAI),14),new u(new _(2442778,43215,c.TAI),15),new u(new _(2443144,43216,c.TAI),16),new u(new _(2443509,43217,c.TAI),17),new u(new _(2443874,43218,c.TAI),18),new u(new _(2444239,43219,c.TAI),19),new u(new _(2444786,43220,c.TAI),20),new u(new _(2445151,43221,c.TAI),21),new u(new _(2445516,43222,c.TAI),22),new u(new _(2446247,43223,c.TAI),23),new u(new _(2447161,43224,c.TAI),24),new u(new _(2447892,43225,c.TAI),25),new u(new _(2448257,43226,c.TAI),26),new u(new _(2448804,43227,c.TAI),27),new u(new _(2449169,43228,c.TAI),28),new u(new _(2449534,43229,c.TAI),29),new u(new _(2450083,43230,c.TAI),30),new u(new _(2450630,43231,c.TAI),31),new u(new _(2451179,43232,c.TAI),32),new u(new _(2453736,43233,c.TAI),33),new u(new _(2454832,43234,c.TAI),34),new u(new _(2456109,43235,c.TAI),35),new u(new _(2457204,43236,c.TAI),36),new u(new _(2457754,43237,c.TAI),37)],_}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(n,r){if(null===n||"object"!=typeof n)return n;r=e(r,!1);var a=new n.constructor;for(var i in n)if(n.hasOwnProperty(i)){var o=n[i];r&&(o=t(o,r)),a[i]=o}return a}return t}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var n=e.split("\r\n"),r=0;r<n.length;++r){var a=n[r],i=a.indexOf(": ");if(i>0){var o=a.substring(0,i),u=a.substring(i+2);t[o]=u}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function n(e,n,r){this.statusCode=e,this.response=n,this.responseHeaders=r,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return n.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},n}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var n=r.exec(t);this.scheme=n[1],this.authority=n[2],this.path=n[3],this.query=n[4],this.fragment=n[5]}}function t(e){var t=unescape(e);return i.test(t)?t:e.toUpperCase()}function n(e,t,n,r){return(t||"")+n.toLowerCase()+(r||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var r=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(o,n).replace(a,t)),this.path&&(this.path=this.path.replace(a,t)),this.query&&(this.query=this.query.replace(a,t)),this.fragment&&(this.fragment=this.fragment.replace(a,t))};var a=/%[0-9a-z]{2}/gi,i=/[a-zA-Z0-9\-\._~]/,o=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var n=new e;return this.scheme?(n.scheme=this.scheme,n.authority=this.authority,n.path=this.path,n.query=this.query):(n.scheme=t.scheme,this.authority?(n.authority=this.authority,n.path=this.path,n.query=this.query):(n.authority=t.authority,""==this.path?(n.path=t.path,n.query=this.query||t.query):("/"==this.path.charAt(0)?(n.path=this.path,n.removeDotSegments()):(t.authority&&""==t.path?n.path="/"+this.path:n.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,n.removeDotSegments()), +n.query=this.query))),n.fragment=this.fragment,n},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),n=[],r=""==t[0];r&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?n.pop():"."!=e&&n.push(e);"."!=e&&".."!=e||n.push(""),r&&n.unshift(""),this.path=n.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n){var r=new e(n);r.normalize();var a=r.getAuthority();if(t(a)){if(a.indexOf("@")!==-1){var i=a.split("@");a=i[1]}if(a.indexOf(":")===-1){var o=r.getScheme();if(t(o)||(o=window.location.protocol,o=o.substring(0,o.length-1)),"http"===o)a+=":80";else{if("https"!==o)return;a+=":443"}}return a}}var a={},i={};return a.add=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])||(i[r]=!0)},a.remove=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])&&delete i[r]},a.contains=function(e){var n=r(e);return!(!t(n)||!t(i[n]))},a.clear=function(){i={}},a}),define("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,n,r,a,i,o){"use strict";function u(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,a=t(n.method,"GET"),i=n.data,o=n.headers,s=n.overrideMimeType;return e(n.url,function(t){var n=e.defer();return u.load(t,r,a,i,o,n,s),n.promise})}function s(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function c(e,t){for(var n=s(e,t),r=new ArrayBuffer(n.length),a=new Uint8Array(r),i=0;i<n.length;i++)a[i]=n.charCodeAt(i);return r}function l(e,n){n=t(n,"");var r=e[1],a=!!e[2],i=e[3];switch(n){case"":case"text":return s(a,i);case"arraybuffer":return c(a,i);case"blob":var o=c(a,i);return new Blob([o],{type:r});case"document":var u=new DOMParser;return u.parseFromString(s(a,i),r);case"json":return JSON.parse(s(a,i))}}var f=/^data:(.*?)(;base64)?,(.*)$/;return u.load=function(e,t,r,u,s,c,h){var d=f.exec(e);if(null!==d)return void c.resolve(l(d,t));var E=new XMLHttpRequest;if(o.contains(e)&&(E.withCredentials=!0),n(h)&&n(E.overrideMimeType)&&E.overrideMimeType(h),E.open(r,e,!0),n(s))for(var _ in s)s.hasOwnProperty(_)&&E.setRequestHeader(_,s[_]);n(t)&&(E.responseType=t),E.onload=function(){if(E.status<200||E.status>=300)return void c.reject(new a(E.status,E.response,E.getAllResponseHeaders()));var e=E.response,r=E.responseType;if(!n(e)||n(t)&&r!==t)if("json"===t&&"string"==typeof e)try{c.resolve(JSON.parse(e))}catch(e){c.reject(e)}else(""===r||"document"===r)&&n(E.responseXML)&&E.responseXML.hasChildNodes()?c.resolve(E.responseXML):""!==r&&"text"!==r||!n(E.responseText)?c.reject(new i("Invalid XMLHttpRequest response type.")):c.resolve(E.responseText);else c.resolve(e)},E.onerror=function(e){c.reject(new a)},E.send(u)},u.defaultLoad=u.load,u}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,n){return e({url:t,headers:n})}return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";function a(n,a){return t(a)?t(a.Accept)||(a=e(a),a.Accept=i.Accept):a=i,r(n,a).then(function(e){return JSON.parse(e)})}var i={Accept:"application/json,*/*;q=0.01"};return a}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(t){if(t=n(t,n.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=n(t.addNewLeapSeconds,!0),r(t.data))E(this,t.data);else if(r(t.url)){var a=this;this._downloadPromise=e(s(t.url),function(e){E(a,e)},function(){a._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else E(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function d(e,t){return o.compare(e.julianDate,t)}function E(e,n){if(!r(n.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!r(n.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var a=n.columnNames.indexOf("modifiedJulianDateUtc"),i=n.columnNames.indexOf("xPoleWanderRadians"),s=n.columnNames.indexOf("yPoleWanderRadians"),c=n.columnNames.indexOf("ut1MinusUtcSeconds"),h=n.columnNames.indexOf("xCelestialPoleOffsetRadians"),E=n.columnNames.indexOf("yCelestialPoleOffsetRadians"),_=n.columnNames.indexOf("taiMinusUtcSeconds");if(a<0||i<0||s<0||c<0||h<0||E<0||_<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var p=e._samples=n.samples,y=e._dates=[];e._dateColumn=a,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=h,e._yCelestialPoleOffsetRadiansColumn=E,e._taiMinusUtcSecondsColumn=_,e._columnCount=n.columnNames.length,e._lastIndex=void 0;for(var m,T=e._addNewLeapSeconds,R=0,A=p.length;R<A;R+=e._columnCount){var S=p[R+a],v=p[R+_],N=S+l.MODIFIED_JULIAN_DATE_DIFFERENCE,O=new o(N,v,f.TAI);if(y.push(O),T){if(v!==m&&r(m)){var I=o.leapSeconds,M=t(I,O,d);if(M<0){var g=new u(O,v);I.splice(~M,0,g)}}m=v}}}function _(e,t,n,r,a){var i=n*r;a.xPoleWander=t[i+e._xPoleWanderRadiansColumn],a.yPoleWander=t[i+e._yPoleWanderRadiansColumn],a.xPoleOffset=t[i+e._xCelestialPoleOffsetRadiansColumn],a.yPoleOffset=t[i+e._yCelestialPoleOffsetRadiansColumn],a.ut1MinusUtc=t[i+e._ut1MinusUtcSecondsColumn]}function p(e,t,n){return t+e*(n-t)}function y(e,t,n,r,a,i,u){var s=e._columnCount;if(i>t.length-1)return u.xPoleWander=0,u.yPoleWander=0,u.xPoleOffset=0,u.yPoleOffset=0,u.ut1MinusUtc=0,u;var c=t[a],l=t[i];if(c.equals(l)||r.equals(c))return _(e,n,a,s,u),u;if(r.equals(l))return _(e,n,i,s,u),u;var f=o.secondsDifference(r,c)/o.secondsDifference(l,c),h=a*s,d=i*s,E=n[h+e._ut1MinusUtcSecondsColumn],y=n[d+e._ut1MinusUtcSecondsColumn],m=y-E;if(m>.5||m<-.5){var T=n[h+e._taiMinusUtcSecondsColumn],R=n[d+e._taiMinusUtcSecondsColumn];T!==R&&(l.equals(r)?E=y:y-=R-T)}return u.xPoleWander=p(f,n[h+e._xPoleWanderRadiansColumn],n[d+e._xPoleWanderRadiansColumn]),u.yPoleWander=p(f,n[h+e._yPoleWanderRadiansColumn],n[d+e._yPoleWanderRadiansColumn]),u.xPoleOffset=p(f,n[h+e._xCelestialPoleOffsetRadiansColumn],n[d+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=p(f,n[h+e._yCelestialPoleOffsetRadiansColumn],n[d+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=p(f,E,y),u}return h.NONE=i({getPromiseToLoad:function(){return e()},compute:function(e,t){return r(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new a(0,0,0,0,0),t}}),h.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},h.prototype.compute=function(e,n){if(r(this._samples)){if(r(n)||(n=new a(0,0,0,0,0)),0===this._samples.length)return n.xPoleWander=0,n.yPoleWander=0,n.xPoleOffset=0,n.yPoleOffset=0,n.ut1MinusUtc=0,n;var i=this._dates,u=this._lastIndex,s=0,l=0;if(r(u)){var f=i[u],h=i[u+1],d=o.lessThanOrEquals(f,e),E=!r(h),_=E||o.greaterThanOrEquals(h,e);if(d&&_)return s=u,!E&&h.equals(e)&&++s,l=s+1,y(this,i,this._samples,e,s,l,n),n}var p=t(i,e,o.compare,this._dateColumn);return p>=0?(p<i.length-1&&i[p+1].equals(e)&&++p,s=p,l=p):(l=~p,s=l-1,s<0&&(s=0)),this._lastIndex=s,y(this,i,this._samples,e,s,l,n),n}if(r(this._dataError))throw new c(this._dataError)},h}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(t,n,r){this.heading=e(t,0),this.pitch=e(n,0),this.roll=e(r,0)}return a.fromQuaternion=function(e,n){t(n)||(n=new a);var r=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return n.heading=-Math.atan2(s,u),n.roll=Math.atan2(o,i),n.pitch=-Math.asin(r),n},a.fromDegrees=function(e,n,i,o){return t(o)||(o=new a),o.heading=e*r.RADIANS_PER_DEGREE,o.pitch=n*r.RADIANS_PER_DEGREE,o.roll=i*r.RADIANS_PER_DEGREE,o},a.clone=function(e,n){if(t(e))return t(n)?(n.heading=e.heading,n.pitch=e.pitch,n.roll=e.roll,n):new a(e.heading,e.pitch,e.roll)},a.equals=function(e,n){return e===n||t(e)&&t(n)&&e.heading===n.heading&&e.pitch===n.pitch&&e.roll===n.roll},a.equalsEpsilon=function(e,n,a,i){return e===n||t(e)&&t(n)&&r.equalsEpsilon(e.heading,n.heading,a,i)&&r.equalsEpsilon(e.pitch,n.pitch,a,i)&&r.equalsEpsilon(e.roll,n.roll,a,i)},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,n){return a.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},a}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=t(r,document.location.href);var a=new e(r),i=new e(n);return i.resolve(a).toString()}return a}),define("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(r,a,i){i=t(i,!0),r instanceof e||(r=new e(r)),a instanceof e||(a=new e(a)),n(a.authority)&&!n(a.scheme)&&("undefined"!=typeof document&&n(document.location)&&n(document.location.href)?a.scheme=new e(document.location.href).scheme:a.scheme=r.scheme);var o=r;a.isAbsolute()&&(o=a);var u="";n(o.scheme)&&(u+=o.scheme+":"),n(o.authority)&&(u+="//"+o.authority,""!==o.path&&"/"!==o.path&&(u=u.replace(/\/?$/,"/"),o.path=o.path.replace(/^\/?/g,""))),u+=o===r?i?r.path.replace(/\/?$/,"/")+a.path.replace(/^\/?/g,""):r.path+a.path:a.path;var s=n(r.query),c=n(a.query);s&&c?u+="?"+r.query+"&"+a.query:s&&!c?u+="?"+r.query:!s&&c&&(u+="?"+a.query);var l=n(a.fragment);return n(r.fragment)&&!l?u+="#"+r.fragment:l&&(u+="#"+a.fragment),u}return a}),define("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","./joinUrls","require"],function(e,t,n,r,a,i){"use strict";function o(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;t<n;++t){var r=e[t].getAttribute("src"),a=E.exec(r);if(null!==a)return a[1]}}function u(){if(t(f))return f;var n;return n="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:o(),f=new e(r(n))}function s(e){return i.toUrl("../"+e)}function c(e){return a(u(),e)}function l(e){t(h)||(h=t(i.toUrl)?s:c),t(d)||(d=document.createElement("a"));var n=h(e);return d.href=n,d.href=d.href,d.href}var f,h,d,E=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return l._cesiumScriptRegex=E,l.setBaseUrl=function(t){f=new e(t).resolve(new e(document.location.href))},l}),define("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,n){this.x=e,this.y=t,this.s=n}return e}),define("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){e=n(e,n.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=n(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=n(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new i(this._sampleZeroJulianEphemerisDate,0,u.TAI),this._stepSizeDays=n(e.stepSizeDays,1),this._samplesPerXysFile=n(e.samplesPerXysFile,1e3),this._totalSamples=n(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,r=this._denominators=new Array(t+1),a=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t),s=0;s<=t;++s){r[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;c<=t;++c)c!==s&&(r[s]*=s-c);r[s]=1/r[s]}this._work=new Array(t+1),this._coef=new Array(t+1)}function c(e,t,n){var r=f;return r.dayNumber=t,r.secondsOfDay=n,i.daysDifference(r,e._sampleZeroDateTT)}function l(n,a){if(n._chunkDownloadsInProgress[a])return n._chunkDownloadsInProgress[a];var i=e.defer();n._chunkDownloadsInProgress[a]=i;var u,s=n._xysFileUrlTemplate;return u=r(s)?s.replace("{0}",a):t("Assets/IAU2006_XYS/IAU2006_XYS_"+a+".json"),e(o(u),function(e){n._chunkDownloadsInProgress[a]=!1;for(var t=n._samples,r=e.samples,o=a*n._samplesPerXysFile*3,u=0,s=r.length;u<s;++u)t[o+u]=r[u];i.resolve()}),i.promise}var f=new i(0,0,u.TAI);return s.prototype.preload=function(t,n,r,a){var i=c(this,t,n),o=c(this,r,a),u=i/this._stepSizeDays-this._interpolationOrder/2|0;u<0&&(u=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var f=u/this._samplesPerXysFile|0,h=s/this._samplesPerXysFile|0,d=[],E=f;E<=h;++E)d.push(l(this,E));return e.all(d)},s.prototype.computeXysRadians=function(e,t,n){var i=c(this,e,t);if(!(i<0)){var o=i/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);s<0&&(s=0);var f=s+u;f>=this._totalSamples&&(f=this._totalSamples-1,s=f-u,s<0&&(s=0));var h=!1,d=this._samples;if(r(d[3*s])||(l(this,s/this._samplesPerXysFile|0),h=!0),r(d[3*f])||(l(this,f/this._samplesPerXysFile|0),h=!0),!h){r(n)?(n.x=0,n.y=0,n.s=0):n=new a(0,0,0);var E,_,p=i-s*this._stepSizeDays,y=this._work,m=this._denominators,T=this._coef,R=this._xTable;for(E=0;E<=u;++E)y[E]=p-R[E];for(E=0;E<=u;++E){for(T[E]=1,_=0;_<=u;++_)_!==E&&(T[E]*=y[_]);T[E]*=m[E];var A=3*(s+E);n.x+=T[E]*d[A++],n.y+=T[E]*d[A++],n.s+=T[E]*d[A]}return n}}}},s}),define("Core/Quaternion",["./Cartesian3","./Check","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math","./Matrix3"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(e,t,r,a){this.x=n(e,0),this.y=n(t,0),this.z=n(r,0),this.w=n(a,0)}var l=new e;c.fromAxisAngle=function(t,n,a){var i=n/2,o=Math.sin(i);l=e.normalize(t,l);var u=l.x*o,s=l.y*o,f=l.z*o,h=Math.cos(i);return r(a)?(a.x=u,a.y=s,a.z=f,a.w=h,a):new c(u,s,f,h)};var f=[1,2,0],h=new Array(3);c.fromRotationMatrix=function(e,t){var n,a,i,o,u,l=e[s.COLUMN0ROW0],d=e[s.COLUMN1ROW1],E=e[s.COLUMN2ROW2],_=l+d+E;if(_>0)n=Math.sqrt(_+1),u=.5*n,n=.5/n,a=(e[s.COLUMN1ROW2]-e[s.COLUMN2ROW1])*n,i=(e[s.COLUMN2ROW0]-e[s.COLUMN0ROW2])*n,o=(e[s.COLUMN0ROW1]-e[s.COLUMN1ROW0])*n;else{var p=f,y=0;d>l&&(y=1),E>l&&E>d&&(y=2);var m=p[y],T=p[m];n=Math.sqrt(e[s.getElementIndex(y,y)]-e[s.getElementIndex(m,m)]-e[s.getElementIndex(T,T)]+1);var R=h;R[y]=.5*n,n=.5/n,u=(e[s.getElementIndex(T,m)]-e[s.getElementIndex(m,T)])*n,R[m]=(e[s.getElementIndex(m,y)]+e[s.getElementIndex(y,m)])*n,R[T]=(e[s.getElementIndex(T,y)]+e[s.getElementIndex(y,T)])*n,a=-R[0],i=-R[1],o=-R[2]}return r(t)?(t.x=a,t.y=i,t.z=o,t.w=u,t):new c(a,i,o,u)};var d=new c;c.fromHeadingPitchRoll=function(t,n,r,a){var i=c.fromAxisAngle(e.UNIT_X,r,d),o=c.fromAxisAngle(e.UNIT_Y,-n,a);a=c.multiply(o,i,o);var u=c.fromAxisAngle(e.UNIT_Z,-t,d);return c.multiply(u,a,a)};var E=new e,_=new e,p=new c,y=new c,m=new c;c.packedLength=4,c.pack=function(e,t,r){return r=n(r,0),t[r++]=e.x,t[r++]=e.y,t[r++]=e.z,t[r]=e.w,t},c.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new c),a.x=e[t],a.y=e[t+1],a.z=e[t+2],a.w=e[t+3],a},c.packedInterpolationLength=3,c.convertPackedArrayForInterpolation=function(e,t,n,r){c.unpack(e,4*n,m),c.conjugate(m,m);for(var a=0,i=n-t+1;a<i;a++){var o=3*a;c.unpack(e,4*(t+a),p),c.multiply(p,m,p),p.w<0&&c.negate(p,p),c.computeAxis(p,E);var u=c.computeAngle(p);r[o]=E.x*u,r[o+1]=E.y*u,r[o+2]=E.z*u}},c.unpackInterpolationResult=function(t,n,a,i,o){r(o)||(o=new c),e.fromArray(t,0,_);var u=e.magnitude(_);return c.unpack(n,4*i,y),0===u?c.clone(c.IDENTITY,p):c.fromAxisAngle(_,u,p),c.multiply(p,y,o)},c.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new c(e.x,e.y,e.z,e.w)},c.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},c.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},c.magnitude=function(e){return Math.sqrt(c.magnitudeSquared(e))},c.normalize=function(e,t){var n=1/c.magnitude(e),r=e.x*n,a=e.y*n,i=e.z*n,o=e.w*n;return t.x=r,t.y=a,t.z=i,t.w=o,t},c.inverse=function(e,t){var n=c.magnitudeSquared(e);return t=c.conjugate(e,t),c.multiplyByScalar(t,1/n,t)},c.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},c.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},c.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},c.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},c.multiply=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=e.w,u=t.x,s=t.y,c=t.z,l=t.w,f=o*u+r*l+a*c-i*s,h=o*s-r*c+a*l+i*u,d=o*c+r*s-a*u+i*l,E=o*l-r*u-a*s-i*c;return n.x=f,n.y=h,n.z=d,n.w=E,n},c.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},c.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},c.computeAxis=function(e,t){var n=e.w;if(Math.abs(n-1)<u.EPSILON6)return t.x=t.y=t.z=0,t;var r=1/Math.sqrt(1-n*n);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},c.computeAngle=function(e){return Math.abs(e.w-1)<u.EPSILON6?0:2*Math.acos(e.w)};var T=new c;c.lerp=function(e,t,n,r){return T=c.multiplyByScalar(t,n,T),r=c.multiplyByScalar(e,1-n,r),c.add(T,r,r)};var R=new c,A=new c,S=new c;c.slerp=function(e,t,n,r){var a=c.dot(e,t),i=t;if(a<0&&(a=-a,i=R=c.negate(t,R)),1-a<u.EPSILON6)return c.lerp(e,i,n,r);var o=Math.acos(a);return A=c.multiplyByScalar(e,Math.sin((1-n)*o),A),S=c.multiplyByScalar(i,Math.sin(n*o),S),r=c.add(A,S,r),c.multiplyByScalar(r,1/Math.sin(o),r)},c.log=function(t,n){var r=u.acosClamped(t.w),a=0;return 0!==r&&(a=r/Math.sin(r)),e.multiplyByScalar(t,a,n)},c.exp=function(t,n){var r=e.magnitude(t),a=0;return 0!==r&&(a=Math.sin(r)/r),n.x=t.x*a,n.y=t.y*a,n.z=t.z*a,n.w=Math.cos(r),n};var v=new e,N=new e,O=new c,I=new c;c.computeInnerQuadrangle=function(t,n,r,a){var i=c.conjugate(n,O);c.multiply(i,r,I);var o=c.log(I,v);c.multiply(i,t,I);var u=c.log(I,N);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),c.exp(o,O),c.multiply(n,O,a)},c.squad=function(e,t,n,r,a,i){var o=c.slerp(e,t,a,O),u=c.slerp(n,r,a,I);return c.slerp(o,u,2*a*(1-a),i)};for(var M=new c,g=1.9011074535173003,x=i.supportsTypedArrays()?new Float32Array(8):[],w=i.supportsTypedArrays()?new Float32Array(8):[],C=i.supportsTypedArrays()?new Float32Array(8):[],P=i.supportsTypedArrays()?new Float32Array(8):[],U=0;U<7;++U){var D=U+1,L=2*D+1;x[U]=1/(D*L),w[U]=D/L}return x[7]=g/136,w[7]=8*g/17,c.fastSlerp=function(e,t,n,r){var a,i=c.dot(e,t);i>=0?a=1:(a=-1,i=-i);for(var o=i-1,u=1-n,s=n*n,l=u*u,f=7;f>=0;--f)C[f]=(x[f]*s-w[f])*o,P[f]=(x[f]*l-w[f])*o;var h=a*n*(1+C[0]*(1+C[1]*(1+C[2]*(1+C[3]*(1+C[4]*(1+C[5]*(1+C[6]*(1+C[7])))))))),d=u*(1+P[0]*(1+P[1]*(1+P[2]*(1+P[3]*(1+P[4]*(1+P[5]*(1+P[6]*(1+P[7])))))))),E=c.multiplyByScalar(e,d,M);return c.multiplyByScalar(t,h,r),c.add(E,r,r)},c.fastSquad=function(e,t,n,r,a,i){var o=c.fastSlerp(e,t,a,O),u=c.fastSlerp(n,r,a,I);return c.fastSlerp(o,u,2*a*(1-a),i)},c.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},c.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n},c.ZERO=o(new c(0,0,0,0)),c.IDENTITY=o(new c(0,0,0,1)),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.x+", "+this.y+", "+this.z+", "+this.w+")"},c}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./Check","./defaultValue","./defined","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./HeadingPitchRoll","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,E,_,p,y,m,T,R){"use strict";var A={},S=new n,v=new n,N=new n;A.eastNorthUpToFixedFrame=function(e,t,r){if(p.equalsEpsilon(e.x,0,p.EPSILON14)&&p.equalsEpsilon(e.y,0,p.EPSILON14)){var a=p.sign(e.z);return u(r)?(r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=-a,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=a,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new m(0,-a,0,e.x,1,0,0,e.y,0,0,a,e.z,0,0,0,1)}var i=S,s=v,c=N;return t=o(t,f.WGS84),t.geodeticSurfaceNormal(e,i),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(i,s,c),u(r)?(r[0]=s.x,r[1]=s.y,r[2]=s.z,r[3]=0,r[4]=c.x,r[5]=c.y,r[6]=c.z,r[7]=0,r[8]=i.x,r[9]=i.y,r[10]=i.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new m(s.x,c.x,i.x,e.x,s.y,c.y,i.y,e.y,s.z,c.z,i.z,e.z,0,0,0,1)};var O=new n,I=new n,M=new n;A.northEastDownToFixedFrame=function(e,t,r){if(p.equalsEpsilon(e.x,0,p.EPSILON14)&&p.equalsEpsilon(e.y,0,p.EPSILON14)){var a=p.sign(e.z);return u(r)?(r[0]=-a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=-a,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new m(-a,0,0,e.x,0,1,0,e.y,0,0,-a,e.z,0,0,0,1)}var i=O,s=I,c=M;return t=o(t,f.WGS84),t.geodeticSurfaceNormal(e,i),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(i,s,c),u(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=s.x,r[5]=s.y,r[6]=s.z,r[7]=0,r[8]=-i.x,r[9]=-i.y,r[10]=-i.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new m(c.x,s.x,-i.x,e.x,c.y,s.y,-i.y,e.y,c.z,s.z,-i.z,e.z,0,0,0,1)},A.northUpEastToFixedFrame=function(e,t,r){if(p.equalsEpsilon(e.x,0,p.EPSILON14)&&p.equalsEpsilon(e.y,0,p.EPSILON14)){var a=p.sign(e.z);return u(r)?(r[0]=-a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=a,r[7]=0,r[8]=0,r[9]=1,r[10]=0,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new m(-a,0,0,e.x,0,0,1,e.y,0,a,0,e.z,0,0,0,1)}var i=S,s=v,c=N;return t=o(t,f.WGS84),t.geodeticSurfaceNormal(e,i),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(i,s,c),u(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=i.x,r[5]=i.y,r[6]=i.z,r[7]=0,r[8]=s.x,r[9]=s.y,r[10]=s.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new m(c.x,i.x,s.x,e.x,c.y,i.y,s.y,e.y,c.z,i.z,s.z,e.z,0,0,0,1)},A.northWestUpToFixedFrame=function(e,t,r){if(p.equalsEpsilon(e.x,0,p.EPSILON14)&&p.equalsEpsilon(e.y,0,p.EPSILON14)){var a=p.sign(e.z);return u(r)?(r[0]=-a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=a,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new m(-a,0,0,e.x,0,-1,0,e.y,0,0,a,e.z,0,0,0,1)}var i=S,s=v,c=N;return t=o(t,f.WGS84),t.geodeticSurfaceNormal(e,i),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(i,s,c),u(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=-s.x,r[5]=-s.y,r[6]=-s.z,r[7]=0,r[8]=i.x,r[9]=i.y,r[10]=i.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new m(c.x,-s.x,i.x,e.x,c.y,-s.y,i.y,e.y,c.z,-s.z,i.z,e.z,0,0,0,1)};var g=new T,x=new n(1,1,1),w=new m;A.headingPitchRollToFixedFrame=function(e,t,r,a){i.typeOf.object("headingPitchRoll",t);var o=t.heading,u=t.pitch,s=t.roll,c=T.fromHeadingPitchRoll(o,u,s,g),l=m.fromTranslationQuaternionRotationScale(n.ZERO,c,x,w);return a=A.eastNorthUpToFixedFrame(e,r,a),m.multiply(a,l,a)};var C=new m,P=new y;A.headingPitchRollQuaternion=function(e,t,n,r){i.typeOf.object("headingPitchRoll",t);var a=A.headingPitchRollToFixedFrame(e,t,n,C),o=m.getRotation(a,P);return T.fromRotationMatrix(o,r)};var U=24110.54841,D=8640184.812866,L=.093104,F=-62e-7,z=1.1772758384668e-19,B=72921158553e-15,b=p.TWO_PI/86400,G=new _;A.computeTemeToPseudoFixedMatrix=function(e,t){G=_.addSeconds(e,-_.computeTaiMinusUtc(e),G);var n,r=G.dayNumber,a=G.secondsOfDay,i=r-2451545;n=a>=43200?(i+.5)/R.DAYS_PER_JULIAN_CENTURY:(i-.5)/R.DAYS_PER_JULIAN_CENTURY;var o=U+n*(D+n*(L+n*F)),s=o*b%p.TWO_PI,c=B+z*(r-2451545.5),l=(a+.5*R.SECONDS_PER_DAY)%R.SECONDS_PER_DAY,f=s+c*l,h=Math.cos(f),d=Math.sin(f);return u(t)?(t[0]=h,t[1]=-d,t[2]=0,t[3]=d,t[4]=h,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new y(h,d,0,-d,h,0,0,0,1)},A.iau2006XysData=new d,A.earthOrientationParameters=c.NONE;var q=32.184,W=2451545;A.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+q,a=t.stop.dayNumber,i=t.stop.secondsOfDay+q,o=A.iau2006XysData.preload(n,r,a,i),u=A.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},A.computeIcrfToFixedMatrix=function(e,t){u(t)||(t=new y);var n=A.computeFixedToIcrfMatrix(e,t);if(u(n))return y.transpose(n,t)};var X=new E(0,0,0),V=new l(0,0,0,0,0,0),H=new y,Y=new y;A.computeFixedToIcrfMatrix=function(e,t){u(t)||(t=new y);var n=A.earthOrientationParameters.compute(e,V);if(u(n)){var r=e.dayNumber,a=e.secondsOfDay+q,i=A.iau2006XysData.computeXysRadians(r,a,X);if(u(i)){var o=i.x+n.xPoleOffset,s=i.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-o*o-s*s)),l=H;l[0]=1-c*o*o,l[3]=-c*o*s,l[6]=o,l[1]=-c*o*s,l[4]=1-c*s*s,l[7]=s,l[2]=-o,l[5]=-s,l[8]=1-c*(o*o+s*s);var f=y.fromRotationZ(-i.s,Y),h=y.multiply(l,f,H),d=e.dayNumber,E=e.secondsOfDay-_.computeTaiMinusUtc(e)+n.ut1MinusUtc,m=d-2451545,T=E/R.SECONDS_PER_DAY,S=.779057273264+T+.00273781191135448*(m+T);S=S%1*p.TWO_PI;var v=y.fromRotationZ(S,Y),N=y.multiply(h,v,H),O=Math.cos(n.xPoleWander),I=Math.cos(n.yPoleWander),M=Math.sin(n.xPoleWander),g=Math.sin(n.yPoleWander),x=r-W+a/R.SECONDS_PER_DAY;x/=36525;var w=-47e-6*x*p.RADIANS_PER_DEGREE/3600,C=Math.cos(w),P=Math.sin(w),U=Y;return U[0]=O*C,U[1]=O*P,U[2]=M,U[3]=-I*P+g*M*C,U[4]=I*C+g*M*P,U[5]=-g*O,U[6]=-g*P-I*M*C,U[7]=g*C-I*M*P,U[8]=I*O,y.multiply(N,U,t)}}};var k=new r;A.pointToWindowCoordinates=function(e,t,n,r){return r=A.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},A.pointToGLWindowCoordinates=function(e,n,a,i){u(i)||(i=new t);var o=k;return m.multiplyByVector(e,r.fromElements(a.x,a.y,a.z,1,o),o),r.multiplyByScalar(o,1/o.w,o),m.multiplyByVector(n,o,o),t.fromCartesian4(o,i)};var Z=new n,j=new n,K=new n;A.rotationMatrixFromPositionVelocity=function(e,t,r,a){var i=o(r,f.WGS84).geodeticSurfaceNormal(e,Z),s=n.cross(t,i,j);n.equalsEpsilon(s,n.ZERO,p.EPSILON6)&&(s=n.clone(n.UNIT_X,s));var c=n.cross(s,t,K);return n.cross(t,c,s),n.negate(s,s),u(a)||(a=new y),a[0]=t.x,a[1]=t.y,a[2]=t.z,a[3]=s.x,a[4]=s.y,a[5]=s.z,a[6]=c.x,a[7]=c.y,a[8]=c.z,a};var J=new a,Q=new n,$=new n,ee=new r,te=new r,ne=new r,re=new r,ae=new r,ie=new m,oe=new m;A.basisTo2D=function(e,t,a){var i=e.ellipsoid,o=m.getColumn(t,3,ee),u=i.cartesianToCartographic(o,J),s=A.eastNorthUpToFixedFrame(o,i,ie),c=m.inverseTransformation(s,oe),l=e.project(u,Q),f=te;f.x=l.z,f.y=l.x,f.z=l.y,f.w=1;var h=m.getColumn(t,0,$),d=n.magnitude(h),E=m.multiplyByVector(c,h,ne);r.fromElements(E.z,E.x,E.y,0,E);var _=m.getColumn(t,1,$),p=n.magnitude(_),y=m.multiplyByVector(c,_,re);r.fromElements(y.z,y.x,y.y,0,y);var T=m.getColumn(t,2,$),R=n.magnitude(T),S=ae;return n.cross(E,y,S),n.normalize(S,S),n.cross(y,S,E),n.normalize(E,E),n.cross(S,E,y),n.normalize(y,y),n.multiplyByScalar(E,d,E),n.multiplyByScalar(y,p,y),n.multiplyByScalar(S,R,S),m.setColumn(a,0,E,a),m.setColumn(a,1,y,a),m.setColumn(a,2,S,a),m.setColumn(a,3,f,a),a};var ue=new m(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);return A.wgs84To2DModelMatrix=function(e,t,n){var r=e.ellipsoid,a=A.eastNorthUpToFixedFrame(t,r,ie),i=m.inverseTransformation(a,oe),o=r.cartesianToCartographic(t,J),u=e.project(o,Q),s=te;s.x=u.z,s.y=u.x,s.z=u.y,s.w=1;var c=m.fromTranslation(s,ie);return m.multiply(ue,i,n),m.multiply(c,n,n),n},A}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d){"use strict";function E(e,t){t=a(t,s.WGS84),e=t.scaleToGeodeticSurface(e);var r=d.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=n.fromCartesian4(l.getColumn(r,0,_)),this._yAxis=n.fromCartesian4(l.getColumn(r,1,_));var i=n.fromCartesian4(l.getColumn(r,2,_));this._plane=f.fromPointNormal(e,i)}var _=new r;o(E.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var p=new e;E.fromPoints=function(t,n){var r=e.fromPoints(t,p);return new E(r.center,n)};var y=new h,m=new n;E.prototype.projectPointOntoPlane=function(e,r){var a=y;a.origin=e,n.normalize(e,a.direction);var o=c.rayPlane(a,this._plane,m);if(i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,m)),i(o)){var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return i(r)?(r.x=s,r.y=l,r):new t(s,l)}},E.prototype.projectPointsOntoPlane=function(e,t){i(t)||(t=[]);for(var n=0,r=e.length,a=0;a<r;a++){var o=this.projectPointOntoPlane(e[a],t[n]);i(o)&&(t[n]=o,n++)}return t.length=n,t},E.prototype.projectPointToNearestOnPlane=function(e,r){i(r)||(r=new t);var a=y;a.origin=e,n.clone(this._plane.normal,a.direction);var o=c.rayPlane(a,this._plane,m);i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,m));var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return r.x=s,r.y=l,r},E.prototype.projectPointsToNearestOnPlane=function(e,t){i(t)||(t=[]);var n=e.length;t.length=n;for(var r=0;r<n;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var T=new n;return E.prototype.projectPointsOntoEllipsoid=function(e,t){var r=e.length;i(t)?t.length=r:t=new Array(r);for(var a=this._ellipsoid,o=this._origin,u=this._xAxis,s=this._yAxis,c=T,l=0;l<r;++l){var f=e[l];n.multiplyByScalar(u,f.x,c),i(t[l])||(t[l]=new n);var h=n.add(o,c,t[l]);n.multiplyByScalar(s,f.y,c),n.add(h,c,h),a.scaleToGeocentricSurface(h,h)}return t},E}),define("Core/EllipsoidGeodesic",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){var t=e._uSquared,n=e._ellipsoid.maximumRadius,r=e._ellipsoid.minimumRadius,a=(n-r)/n,i=Math.cos(e._startHeading),o=Math.sin(e._startHeading),u=(1-a)*Math.tan(e._start.latitude),s=1/Math.sqrt(1+u*u),c=s*u,l=Math.atan2(u,i),f=s*o,h=f*f,d=1-h,E=Math.sqrt(d),_=t/4,p=_*_,y=p*_,m=p*p,T=1+_-3*p/4+5*y/4-175*m/64,R=1-_+15*p/8-35*y/8,A=1-3*_+35*p/4,S=1-5*_,v=T*l-R*Math.sin(2*l)*_/2-A*Math.sin(4*l)*p/16-S*Math.sin(6*l)*y/48-5*Math.sin(8*l)*m/512,N=e._constants;N.a=n,N.b=r,N.f=a,N.cosineHeading=i,N.sineHeading=o,N.tanU=u,N.cosineU=s,N.sineU=c,N.sigma=l,N.sineAlpha=f,N.sineSquaredAlpha=h,N.cosineSquaredAlpha=d,N.cosineAlpha=E,N.u2Over4=_,N.u4Over16=p,N.u6Over64=y,N.u8Over256=m,N.a0=T,N.a1=R,N.a2=A,N.a3=S,N.distanceRatio=v}function c(e,t){return e*t*(4+e*(4-3*t))/16}function l(e,t,n,r,a,i,o){var u=c(e,n);return(1-u)*e*t*(r+u*a*(o+u*i*(2*o*o-1)))}function f(e,t,n,r,a,i,o){var s,c,f,h,d,E=(t-n)/t,_=i-r,p=Math.atan((1-E)*Math.tan(a)),y=Math.atan((1-E)*Math.tan(o)),m=Math.cos(p),T=Math.sin(p),R=Math.cos(y),A=Math.sin(y),S=m*R,v=m*A,N=T*A,O=T*R,I=_,M=u.TWO_PI,g=Math.cos(I),x=Math.sin(I);do{g=Math.cos(I),x=Math.sin(I);var w=v-O*g;f=Math.sqrt(R*R*x*x+w*w),c=N+S*g,s=Math.atan2(f,c);var C;0===f?(C=0,h=1):(C=S*x/f,h=1-C*C),M=I,d=c-2*N/h,isNaN(d)&&(d=0),I=_+l(E,C,h,s,f,c,d)}while(Math.abs(I-M)>u.EPSILON12);var P=h*(t*t-n*n)/(n*n),U=1+P*(4096+P*(P*(320-175*P)-768))/16384,D=P*(256+P*(P*(74-47*P)-128))/1024,L=d*d,F=D*f*(d+D*(c*(2*L-1)-D*d*(4*f*f-3)*(4*L-3)/6)/4),z=n*U*(s-F),B=Math.atan2(R*x,v-O*g),b=Math.atan2(m*x,v*g-O); +e._distance=z,e._startHeading=B,e._endHeading=b,e._uSquared=P}function h(n,r,a,i){e.normalize(i.cartographicToCartesian(r,_),E),e.normalize(i.cartographicToCartesian(a,_),_);f(n,i.maximumRadius,i.minimumRadius,r.longitude,r.latitude,a.longitude,a.latitude),n._start=t.clone(r,n._start),n._end=t.clone(a,n._end),n._start.height=0,n._end.height=0,s(n)}function d(e,a,i){var u=n(i,o.WGS84);this._ellipsoid=u,this._start=new t,this._end=new t,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,r(e)&&r(a)&&h(this,e,a,u)}var E=new e,_=new e;return a(d.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return this._startHeading}},endHeading:{get:function(){return this._endHeading}}}),d.prototype.setEndPoints=function(e,t){h(this,e,t,this._ellipsoid)},d.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},d.prototype.interpolateUsingSurfaceDistance=function(e,n){var a=this._constants,i=a.distanceRatio+e/a.b,o=Math.cos(2*i),u=Math.cos(4*i),s=Math.cos(6*i),c=Math.sin(2*i),f=Math.sin(4*i),h=Math.sin(6*i),d=Math.sin(8*i),E=i*i,_=i*E,p=a.u8Over256,y=a.u2Over4,m=a.u6Over64,T=a.u4Over16,R=2*_*p*o/3+i*(1-y+7*T/4-15*m/4+579*p/64-(T-15*m/4+187*p/16)*o-(5*m/4-115*p/16)*u-29*p*s/16)+(y/2-T+71*m/32-85*p/16)*c+(5*T/16-5*m/4+383*p/96)*f-E*((m-11*p/2)*c+5*p*f/2)+(29*m/96-29*p/16)*h+539*p*d/1536,A=Math.asin(Math.sin(R)*a.cosineAlpha),S=Math.atan(a.a/a.b*Math.tan(A));R-=a.sigma;var v=Math.cos(2*a.sigma+R),N=Math.sin(R),O=Math.cos(R),I=a.cosineU*O,M=a.sineU*N,g=Math.atan2(N*a.sineHeading,I-M*a.cosineHeading),x=g-l(a.f,a.sineAlpha,a.cosineSquaredAlpha,R,N,O,v);return r(n)?(n.longitude=this._start.longitude+x,n.latitude=S,n.height=0,n):new t(this._start.longitude+x,S,0)},d}),define("Core/isArray",["./defined"],function(e){"use strict";var t=Array.isArray;return e(t)||(t=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),t}),define("Core/PolylinePipeline",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidGeodesic","./IntersectionTests","./isArray","./Math","./Matrix4","./Plane"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(e,t,n){var r=N;r.length=e;var a;if(t===n){for(a=0;a<e;a++)r[a]=t;return r}var i=n-t,o=i/e;for(a=0;a<e;a++){var u=t+a*o;r[a]=u}return r}function d(t,n,r,a,i,o,u,s){var c=a.scaleToGeodeticSurface(t,g),l=a.scaleToGeodeticSurface(n,x),f=E.numberOfPoints(t,n,r),d=a.cartesianToCartographic(c,O),_=a.cartesianToCartographic(l,I),p=h(f,i,o);w.setEndPoints(d,_);var y=w.surfaceDistance/f,m=s;d.height=i;var T=a.cartographicToCartesian(d,M);e.pack(T,u,m),m+=3;for(var R=1;R<f;R++){var A=w.interpolateUsingSurfaceDistance(R*y,I);A.height=p[R],T=a.cartographicToCartesian(A,M),e.pack(T,u,m),m+=3}return m}var E={};E.numberOfPoints=function(t,n,r){var a=e.distance(t,n);return Math.ceil(a/r)};var _=new t;E.extractHeights=function(e,t){for(var n=e.length,r=new Array(n),a=0;a<n;a++){var i=e[a];r[a]=t.cartesianToCartographic(i,_).height}return r};var p=new l,y=new e,m=new e,T=new f(e.ZERO,0),R=new e,A=new f(e.ZERO,0),S=new e,v=new e,N=[],O=new t,I=new t,M=new e,g=new e,x=new e,w=new o;return E.wrapLongitude=function(t,a){var i=[],o=[];if(r(t)&&t.length>0){a=n(a,l.IDENTITY);var s=l.inverseTransformation(a,p),c=l.multiplyByPoint(s,e.ZERO,y),h=l.multiplyByPointAsVector(s,e.UNIT_Y,m),d=f.fromPointNormal(c,h,T),E=l.multiplyByPointAsVector(s,e.UNIT_X,R),_=f.fromPointNormal(c,E,A),N=1;i.push(e.clone(t[0]));for(var O=i[0],I=t.length,M=1;M<I;++M){var g=t[M];if(f.getPointDistance(_,O)<0||f.getPointDistance(_,g)<0){var x=u.lineSegmentPlane(O,g,d,S);if(r(x)){var w=e.multiplyByScalar(h,5e-9,v);f.getPointDistance(d,O)<0&&e.negate(w,w),i.push(e.add(x,w,new e)),o.push(N+1),e.negate(w,w),i.push(e.add(x,w,new e)),N=1}}i.push(e.clone(t[M])),N++,O=g}o.push(N)}return{positions:i,lengths:o}},E.generateArc=function(t){r(t)||(t={});var a=t.positions,o=a.length,u=n(t.ellipsoid,i.WGS84),l=n(t.height,0),f=s(l);if(o<1)return[];if(1===o){var h=u.scaleToGeodeticSurface(a[0],g);if(l=f?l[0]:l,0!==l){var _=u.geodeticSurfaceNormal(h,M);e.multiplyByScalar(_,l,_),e.add(h,_,h)}return[h.x,h.y,h.z]}var p=t.minDistance;if(!r(p)){var y=n(t.granularity,c.RADIANS_PER_DEGREE);p=c.chordLength(y,u.maximumRadius)}var m,T=0;for(m=0;m<o-1;m++)T+=E.numberOfPoints(a[m],a[m+1],p);var R=3*(T+1),A=new Array(R),S=0;for(m=0;m<o-1;m++){var v=a[m],I=a[m+1],x=f?l[m]:l,w=f?l[m+1]:l;S=d(v,I,p,u,x,w,A,S)}N.length=0;var C=a[o-1],P=u.cartesianToCartographic(C,O);P.height=f?l[o-1]:l;var U=u.cartographicToCartesian(P,M);return e.pack(U,A,R-3),A},E.generateCartesianArc=function(t){for(var n=E.generateArc(t),r=n.length/3,a=new Array(r),i=0;i<r;i++)a[i]=e.unpack(n,3*i);return a},E}),define("Core/PolylineVolumeGeometryLibrary",["./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./CornerType","./EllipsoidTangentPlane","./Math","./Matrix3","./Matrix4","./PolylinePipeline","./Quaternion","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(e,t){for(var n=new Array(e.length),r=0;r<e.length;r++){var a=e[r];U=t.cartesianToCartographic(a,U),n[r]=U.height,e[r]=t.scaleToGeodeticSurface(a,a)}return n}function d(e,n,r,a){var i,o=e[0],u=e[1],s=t.angleBetween(o,u),c=Math.ceil(s/a),l=new Array(c);if(n===r){for(i=0;i<c;i++)l[i]=n;return l.push(r),l}var f=r-n,h=f/c;for(i=1;i<c;i++){var d=n+i*h;l[i]=d}return l[0]=n,l.push(r),l}function E(n,r,a,o){var u=new i(a,o),s=u.projectPointOntoPlane(t.add(a,n,Y),Y),c=u.projectPointOntoPlane(t.add(a,r,k),k),l=e.angleBetween(s,c);return c.x*s.y-c.y*s.x>=0?-l:l}function _(e,n,r,a,i,o,c,l){var h=b,d=G;L=f.eastNorthUpToFixedFrame(e,i,L),h=s.multiplyByPointAsVector(L,D,h),h=t.normalize(h,h);var _=E(h,n,e,i);z=u.fromRotationZ(_,z),q.z=o,L=s.multiplyTransformation(L,s.fromRotationTranslation(z,q,F),L);var p=B;p[0]=c;for(var y=0;y<l;y++)for(var m=0;m<r.length;m+=3)d=t.fromArray(r,m,d),d=u.multiplyByVector(p,d,d),d=s.multiplyByPoint(L,d,d),a.push(d.x,d.y,d.z);return a}function p(e,n,r,a,i,o,u){for(var s=0;s<e.length;s+=3){var c=t.fromArray(e,s,W);a=_(c,n,r,a,i,o[s/3],u,1)}return a}function y(e,t){var n=e.length,r=new Array(6*n),a=0,i=t.x+t.width/2,o=t.y+t.height/2,u=e[0];r[a++]=u.x-i,r[a++]=0,r[a++]=u.y-o;for(var s=1;s<n;s++){u=e[s];var c=u.x-i,l=u.y-o;r[a++]=c,r[a++]=0,r[a++]=l,r[a++]=c,r[a++]=0,r[a++]=l}return u=e[0],r[a++]=u.x-i,r[a++]=0,r[a++]=u.y-o,r}function m(e,t){for(var n=e.length,r=new Array(3*n),a=0,i=t.x+t.width/2,o=t.y+t.height/2,u=0;u<n;u++)r[a++]=e[u].x-i,r[a++]=0,r[a++]=e[u].y-o;return r}function T(e,n,r,i,s,c,f,h,d,E){var p,y=t.angleBetween(t.subtract(n,e,w),t.subtract(r,e,C)),m=i===a.BEVELED?0:Math.ceil(y/o.toRadians(5));p=s?u.fromQuaternion(l.fromAxisAngle(t.negate(e,w),y/(m+1),X),H):u.fromQuaternion(l.fromAxisAngle(e,y/(m+1),X),H);var T,R;if(n=t.clone(n,V),m>0)for(var A=E?2:1,S=0;S<m;S++)n=u.multiplyByVector(p,n,n),T=t.subtract(n,e,w),T=t.normalize(T,T),s||(T=t.negate(T,T)),R=c.scaleToGeodeticSurface(n,C),f=_(R,T,h,f,c,d,1,A);else T=t.subtract(n,e,w),T=t.normalize(T,T),s||(T=t.negate(T,T)),R=c.scaleToGeodeticSurface(n,C),f=_(R,T,h,f,c,d,1,1),r=t.clone(r,V),T=t.subtract(r,e,w),T=t.normalize(T,T),s||(T=t.negate(T,T)),R=c.scaleToGeodeticSurface(r,C),f=_(R,T,h,f,c,d,1,1);return f}var R=[new t,new t],A=new t,S=new t,v=new t,N=new t,O=new t,I=new t,M=new t,g=new t,x=new t,w=new t,C=new t,P={},U=new r,D=new t(-1,0,0),L=new s,F=new s,z=new u,B=u.IDENTITY.clone(),b=new t,G=new n,q=new t,W=new t,X=new l,V=new t,H=new u;P.removeDuplicatesFromShape=function(t){for(var n=t.length,r=[],a=n-1,i=0;i<n;a=i++){var o=t[a],u=t[i];e.equals(o,u)||r.push(u)}return r};var Y=new t,k=new t;P.angleIsGreaterThanPi=function(e,n,r,a){var o=new i(r,a),u=o.projectPointOntoPlane(t.add(r,e,Y),Y),s=o.projectPointOntoPlane(t.add(r,n,k),k);return s.x*u.y-s.y*u.x>=0};var Z=new t,j=new t;return P.computePositions=function(e,n,r,i,u){var s=i._ellipsoid,l=h(e,s),f=i._granularity,E=i._cornerType,C=u?y(n,r):m(n,r),U=u?m(n,r):void 0,D=r.height/2,L=r.width/2,F=e.length,z=[],B=u?[]:void 0,b=A,G=S,q=v,W=N,X=O,V=I,H=M,Y=g,k=x,K=e[0],J=e[1];W=s.geodeticSurfaceNormal(K,W),b=t.subtract(J,K,b),b=t.normalize(b,b),Y=t.cross(W,b,Y),Y=t.normalize(Y,Y);var Q=l[0],$=l[1];u&&(B=_(K,Y,U,B,s,Q+D,1,1)),k=t.clone(K,k),K=J,G=t.negate(b,G);for(var ee,te,ne=1;ne<F-1;ne++){var re=u?2:1;J=e[ne+1],b=t.subtract(J,K,b),b=t.normalize(b,b),q=t.add(b,G,q),q=t.normalize(q,q),W=s.geodeticSurfaceNormal(K,W);var ae=t.multiplyByScalar(W,t.dot(b,W),Z);t.subtract(b,ae,ae),t.normalize(ae,ae);var ie=t.multiplyByScalar(W,t.dot(G,W),j);t.subtract(G,ie,ie),t.normalize(ie,ie);var oe=!o.equalsEpsilon(Math.abs(t.dot(ae,ie)),1,o.EPSILON7);if(oe){q=t.cross(q,W,q),q=t.cross(W,q,q),q=t.normalize(q,q);var ue=1/Math.max(.25,t.magnitude(t.cross(q,G,w))),se=P.angleIsGreaterThanPi(b,G,K,s);se?(X=t.add(K,t.multiplyByScalar(q,ue*L,q),X),V=t.add(X,t.multiplyByScalar(Y,L,V),V),R[0]=t.clone(k,R[0]),R[1]=t.clone(V,R[1]),ee=d(R,Q+D,$+D,f),te=c.generateArc({positions:R,granularity:f,ellipsoid:s}),z=p(te,Y,C,z,s,ee,1),Y=t.cross(W,b,Y),Y=t.normalize(Y,Y),H=t.add(X,t.multiplyByScalar(Y,L,H),H),E===a.ROUNDED||E===a.BEVELED?T(X,V,H,E,se,s,z,C,$+D,u):(q=t.negate(q,q),z=_(K,q,C,z,s,$+D,ue,re)),k=t.clone(H,k)):(X=t.add(K,t.multiplyByScalar(q,ue*L,q),X),V=t.add(X,t.multiplyByScalar(Y,-L,V),V),R[0]=t.clone(k,R[0]),R[1]=t.clone(V,R[1]),ee=d(R,Q+D,$+D,f),te=c.generateArc({positions:R,granularity:f,ellipsoid:s}),z=p(te,Y,C,z,s,ee,1),Y=t.cross(W,b,Y),Y=t.normalize(Y,Y),H=t.add(X,t.multiplyByScalar(Y,-L,H),H),E===a.ROUNDED||E===a.BEVELED?T(X,V,H,E,se,s,z,C,$+D,u):z=_(K,q,C,z,s,$+D,ue,re),k=t.clone(H,k)),G=t.negate(b,G)}else z=_(k,Y,C,z,s,Q+D,1,1),k=K;Q=$,$=l[ne+1],K=J}R[0]=t.clone(k,R[0]),R[1]=t.clone(K,R[1]),ee=d(R,Q+D,$+D,f),te=c.generateArc({positions:R,granularity:f,ellipsoid:s}),z=p(te,Y,C,z,s,ee,1),u&&(B=_(K,Y,U,B,s,$+D,1,1)),F=z.length;var ce=u?F+B.length:F,le=new Float64Array(ce);return le.set(z),u&&le.set(B,F),le},P}),define("Core/PolylineVolumeOutlineGeometry",["./arrayRemoveDuplicates","./BoundingRectangle","./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./CornerType","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolygonPipeline","./PolylineVolumeGeometryLibrary","./PrimitiveType","./WindingOrder"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,E,_,p,y,m,T){"use strict";function R(e,t){var r=new d;r.position=new h({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:e});var a,o,u=t.length,s=r.position.values.length/3,c=e.length/3,l=c/u,_=E.createTypedArray(s,2*u*(l+1)),p=0;a=0;var y=a*u;for(o=0;o<u-1;o++)_[p++]=o+y,_[p++]=o+y+1;for(_[p++]=u-1+y,_[p++]=y,a=l-1,y=a*u,o=0;o<u-1;o++)_[p++]=o+y,_[p++]=o+y+1;for(_[p++]=u-1+y,_[p++]=y,a=0;a<l-1;a++){var T=u*a,R=T+u;for(o=0;o<u;o++)_[p++]=o+T,_[p++]=o+R}var A=new f({attributes:r,indices:E.createTypedArray(s,_),boundingSphere:n.fromVertices(e),primitiveType:m.LINES});return A}function A(e){e=u(e,u.EMPTY_OBJECT);var t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=l.clone(u(e.ellipsoid,l.WGS84)),this._cornerType=u(e.cornerType,o.ROUNDED),this._granularity=u(e.granularity,_.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeOutlineGeometry";var i=1+t.length*a.packedLength;i+=1+n.length*r.packedLength,this.packedLength=i+l.packedLength+2}A.pack=function(e,t,n){n=u(n,0);var i,o=e._positions,s=o.length;for(t[n++]=s,i=0;i<s;++i,n+=a.packedLength)a.pack(o[i],t,n);var c=e._shape;for(s=c.length,t[n++]=s,i=0;i<s;++i,n+=r.packedLength)r.pack(c[i],t,n);return l.pack(e._ellipsoid,t,n),n+=l.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var S=l.clone(l.UNIT_SPHERE),v={polylinePositions:void 0,shapePositions:void 0,ellipsoid:S,height:void 0,cornerType:void 0,granularity:void 0};A.unpack=function(e,t,n){t=u(t,0);var i,o=e[t++],c=new Array(o);for(i=0;i<o;++i,t+=a.packedLength)c[i]=a.unpack(e,t);o=e[t++];var f=new Array(o);for(i=0;i<o;++i,t+=r.packedLength)f[i]=r.unpack(e,t);var h=l.unpack(e,t,S);t+=l.packedLength;var d=e[t++],E=e[t];return s(n)?(n._positions=c,n._shape=f,n._ellipsoid=l.clone(h,n._ellipsoid),n._cornerType=d,n._granularity=E,n):(v.polylinePositions=c,v.shapePositions=f,v.cornerType=d,v.granularity=E,new A(v))};var N=new t;return A.createGeometry=function(n){var r=n._positions,i=e(r,a.equalsEpsilon),o=n._shape;if(o=y.removeDuplicatesFromShape(o),!(i.length<2||o.length<3)){p.computeWindingOrder2D(o)===T.CLOCKWISE&&o.reverse();var u=t.fromPoints(o,N),s=y.computePositions(i,o,u,n,!1);return R(s,o)}},A}),define("Workers/createPolylineVolumeOutlineGeometry",["../Core/defined","../Core/Ellipsoid","../Core/PolylineVolumeOutlineGeometry"],function(e,t,n){"use strict";function r(r,a){return e(a)&&(r=n.unpack(r,a)),r._ellipsoid=t.clone(r._ellipsoid),n.createGeometry(r)}return r})}(); \ No newline at end of file diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createRectangleGeometry.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createRectangleGeometry.js index c11c29be..1311b9df 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createRectangleGeometry.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createRectangleGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,8 +55,8 @@ mersenne-twister.js - https://gist.github.com/banksean/300494 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==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";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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("Core/isArray",["./defined"],function(e){"use strict";var t=Array.isArray;return e(t)||(t=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),t}),define("Core/Check",["./defaultValue","./defined","./DeveloperError","./isArray"],function(e,t,r,n){"use strict";function a(e){return e+" was required but undefined."}function i(e,t,r){return"Expected "+r+" to be typeof "+t+", got "+e}var o={};return o.typeOf={},o.numeric={},o.defined=function(e,n){if(!t(e))throw new r(a(n))},o.numeric.maximum=function(e,t){if(o.typeOf.number(e),o.typeOf.number(t),e>t)throw new r("Expected "+e+" to be at most "+t)},o.numeric.minimum=function(e,t){if(o.typeOf.number(e),o.typeOf.number(t),e<t)throw new r("Expected "+e+" to be at least "+t)},o.typeOf.function=function(e,t){if("function"!=typeof e)throw new r(i(typeof e,"function",t))},o.typeOf.string=function(e,t){if("string"!=typeof e)throw new r(i(typeof e,"string",t))},o.typeOf.number=function(e,t){if("number"!=typeof e)throw new r(i(typeof e,"number",t))},o.typeOf.object=function(e,t){if("object"!=typeof e)throw new r(i(typeof e,"object",t))},o.typeOf.boolean=function(e,t){if("boolean"!=typeof e)throw new r(i(typeof e,"boolean",t))},o}),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^=e<<7&2636928640,e^=e<<15&4022730752,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,r,n){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:e<0?-1:0},a.signNotZero=function(e){return e<0?-1:1},a.toSNorm=function(e,r){return r=t(r,255),Math.round((.5*a.clamp(e,-1,1)+.5)*r)},a.fromSNorm=function(e,r){return r=t(r,255),a.clamp(e,0,r)/r*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t-r)},a.cosh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t+r)},a.lerp=function(e,t,r){return(1-r)*e+r*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){var t=a.TWO_PI,r=e-Math.floor(e/t)*t;return r<-Math.PI?r+t:r>=Math.PI?r-t:r},a.clampToLatitudeRange=function(e){return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){return(e%t+t)%t},a.equalsEpsilon=function(e,r,n,a){a=t(a,n);var i=Math.abs(e-r);return i<=a||i<=n*Math.max(Math.abs(e),Math.abs(r))};var i=[1];a.factorial=function(e){var t=i.length;if(e>=t)for(var r=i[t-1],n=t;n<=e;n++)i.push(r*n);return i[e]},a.incrementWrap=function(e,r,n){return n=t(n,0),++e,e>r&&(e=n),e},a.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,r){return e<t?t:e>r?r:e};var o=new e;return a.setRandomNumberSeed=function(t){o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(e){return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){return Math.log(e)/Math.log(t)},a.fog=function(e,t){var r=e*t;return 1-Math.exp(-(r*r))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i){"use strict";function o(e,r,n){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0)}o.fromSpherical=function(e,n){r(n)||(n=new o);var a=e.clock,i=e.cone,u=t(e.magnitude,1),s=u*Math.sin(i);return n.x=s*Math.cos(a),n.y=s*Math.sin(a),n.z=u*Math.cos(i),n},o.fromElements=function(e,t,n,a){return r(a)?(a.x=e,a.y=t,a.z=n,a):new o(e,t,n)},o.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n]=e.z,r},o.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new o),a.x=e[n++],a.y=e[n++],a.z=e[n],a},o.packArray=function(e,t){var n=e.length;r(t)?t.length=3*n:t=new Array(3*n);for(var a=0;a<n;++a)o.pack(e[a],t,3*a);return t},o.unpackArray=function(e,t){var n=e.length;r(t)?t.length=n/3:t=new Array(n/3);for(var a=0;a<n;a+=3){var i=a/3;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},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},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},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},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},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},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},o.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r.z=e.z/t.z,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},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},o.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*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},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,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};var s=new o;o.lerp=function(e,t,r,n){return o.multiplyByScalar(t,r,s),n=o.multiplyByScalar(e,1-r,n),o.add(s,n,n)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var r=o.dot(c,l),n=o.magnitude(o.cross(c,l,c));return Math.atan2(n,r)};var E=new o;o.mostOrthogonalAxis=function(e,t){var r=o.normalize(e,E);return o.abs(r,r),t=r.x<=r.y?r.x<=r.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):r.y<=r.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},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,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]},o.equalsEpsilon=function(e,t,n,a){return e===t||r(e)&&r(t)&&i.equalsEpsilon(e.x,t.x,n,a)&&i.equalsEpsilon(e.y,t.y,n,a)&&i.equalsEpsilon(e.z,t.z,n,a)},o.cross=function(e,t,r){var n=e.x,a=e.y,i=e.z,o=t.x,u=t.y,s=t.z,c=a*s-i*u,l=i*o-n*s,E=n*u-a*o;return r.x=c,r.y=l,r.z=E,r},o.fromDegrees=function(e,t,r,n,a){return e=i.toRadians(e),t=i.toRadians(t),o.fromRadians(e,t,r,n,a)};var f=new o,h=new o,d=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,n,a,i,u){a=t(a,0);var s=r(i)?i.radiiSquared:d,c=Math.cos(n);f.x=c*Math.cos(e),f.y=c*Math.sin(e),f.z=Math.sin(n),f=o.normalize(f,f),o.multiplyComponents(s,f,h);var l=Math.sqrt(o.dot(f,h));return h=o.divideByScalar(h,l,h),f=o.multiplyByScalar(f,a,f),r(u)||(u=new o),o.add(h,f,u)},o.fromDegreesArray=function(e,t,n){var a=e.length;r(n)?n.length=a/2:n=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;n[c]=o.fromDegrees(u,s,0,t,n[c])}return n},o.fromRadiansArray=function(e,t,n){var a=e.length;r(n)?n.length=a/2:n=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;n[c]=o.fromRadians(u,s,0,t,n[c])}return n},o.fromDegreesArrayHeights=function(e,t,n){var a=e.length;r(n)?n.length=a/3:n=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;n[l]=o.fromDegrees(u,s,c,t,n[l])}return n},o.fromRadiansArrayHeights=function(e,t,n){var a=e.length;r(n)?n.length=a/3:n=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;n[l]=o.fromRadians(u,s,c,t,n[l])}return n},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(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,t,r){return o.equalsEpsilon(this,e,t,r)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,r,n){"use strict";function a(r,a,u,s,c){var l=r.x,E=r.y,f=r.z,h=a.x,d=a.y,p=a.z,y=l*l*h*h,m=E*E*d*d,_=f*f*p*p,T=y+m+_,R=Math.sqrt(1/T),v=e.multiplyByScalar(r,R,i);if(T<s)return isFinite(R)?e.clone(v,c):void 0;var A=u.x,N=u.y,S=u.z,I=o;I.x=v.x*A*2,I.y=v.y*N*2,I.z=v.z*S*2;var g,M,x,O,w,C,L,P,U,b,F,D=(1-R)*e.magnitude(r)/(.5*e.magnitude(I)),B=0;do{D-=B,x=1/(1+D*A),O=1/(1+D*N),w=1/(1+D*S),C=x*x,L=O*O,P=w*w,U=C*x,b=L*O,F=P*w,g=y*C+m*L+_*P-1,M=y*U*A+m*b*N+_*F*S;var z=-2*M;B=g/z}while(Math.abs(g)>n.EPSILON12);return t(c)?(c.x=l*x,c.y=E*O,c.z=f*w,c):new e(l*x,E*O,f*w)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,r,n,a,i,o){"use strict";function u(e,r,n){this.longitude=t(e,0),this.latitude=t(r,0),this.height=t(n,0)}u.fromRadians=function(e,n,a,i){return a=t(a,0),r(i)?(i.longitude=e,i.latitude=n,i.height=a,i):new u(e,n,a)},u.fromDegrees=function(e,t,r,n){return e=i.toRadians(e),t=i.toRadians(t),u.fromRadians(e,t,r,n)};var s=new e,c=new e,l=new e,E=new e(1/6378137,1/6378137,1/6356752.314245179),f=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),h=i.EPSILON1;return u.fromCartesian=function(t,n,a){var d=r(n)?n.oneOverRadii:E,p=r(n)?n.oneOverRadiiSquared:f,y=r(n)?n._centerToleranceSquared:h,m=o(t,d,p,y,c);if(r(m)){var _=e.multiplyComponents(m,p,s);_=e.normalize(_,_);var T=e.subtract(t,m,l),R=Math.atan2(_.y,_.x),v=Math.asin(_.z),A=i.sign(e.dot(T,t))*e.magnitude(T);return r(a)?(a.longitude=R,a.latitude=v,a.height=A,a):new u(R,v,A)}},u.clone=function(e,t){if(r(e))return r(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||r(e)&&r(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n},u.ZERO=a(new u(0,0,0)),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,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),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","./scaleToGeodeticSurface"],function(e,t,r,n,a,i,o,u,s){"use strict";function c(t,n,a,i){n=r(n,0),a=r(a,0),i=r(i,0),t._radii=new e(n,a,i),t._radiiSquared=new e(n*n,a*a,i*i),t._radiiToTheFourth=new e(n*n*n*n,a*a*a*a,i*i*i*i),t._oneOverRadii=new e(0===n?0:1/n,0===a?0:1/a,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===n?0:1/(n*n),0===a?0:1/(a*a),0===i?0:1/(i*i)),t._minimumRadius=Math.min(n,a,i),t._maximumRadius=Math.max(n,a,i),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(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,this._sqauredXOverSquaredZ=void 0,c(this,e,t,r)}a(l.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}}}),l.clone=function(t,r){if(n(t)){var a=t._radii;return n(r)?(e.clone(a,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 l(a.x,a.y,a.z)}},l.fromCartesian3=function(e,t){return n(t)||(t=new l),n(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,n,a){return a=r(a,0),e.pack(t._radii,n,a),n},l.unpack=function(t,n,a){n=r(n,0);var i=e.unpack(t,n);return l.fromCartesian3(i,a)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,r){var a=t.longitude,i=t.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return n(r)||(r=new e),r.x=u,r.y=s,r.z=c,e.normalize(r,r)},l.prototype.geodeticSurfaceNormal=function(t,r){return n(r)||(r=new e),r=e.multiplyComponents(t,this._oneOverRadiiSquared,r),e.normalize(r,r)};var E=new e,f=new e;l.prototype.cartographicToCartesian=function(t,r){var a=E,i=f;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(e.dot(a,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(a,t.height,a),n(r)||(r=new e),e.add(i,a,r)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var a=0;a<r;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var h=new e,d=new e,p=new e;return l.prototype.cartesianToCartographic=function(r,a){var i=this.scaleToGeodeticSurface(r,d);if(n(i)){var o=this.geodeticSurfaceNormal(i,h),s=e.subtract(r,i,p),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),E=u.sign(e.dot(s,r))*e.magnitude(s);return n(a)?(a.longitude=c,a.latitude=l,a.height=E,a):new t(c,l,E)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var a=0;a<r;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,r){n(r)||(r=new e);var a=t.x,i=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return e.multiplyByScalar(t,s,r)},l.prototype.transformPositionToScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._oneOverRadii,r)},l.prototype.transformPositionFromScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._radii,r)},l.prototype.equals=function(t){return this===t||n(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,a,i){a=r(a,0);var o=this._sqauredXOverSquaredZ;if(n(i)||(i=new e),i.x=0,i.y=0,i.z=t.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},l}),define("Core/Rectangle",["./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,r,n,a,i,o,u){"use strict";function s(e,r,n,a){this.west=t(e,0),this.south=t(r,0),this.east=t(n,0),this.north=t(a,0)}n(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,r,n){return n=t(n,0),r[n++]=e.west,r[n++]=e.south,r[n++]=e.east,r[n]=e.north,r},s.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new s),a.west=e[n++],a.south=e[n++],a.east=e[n++],a.north=e[n],a},s.computeWidth=function(e){var t=e.east,r=e.west;return t<r&&(t+=u.TWO_PI),t-r},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,n,a,i,o){return e=u.toRadians(t(e,0)),n=u.toRadians(t(n,0)),a=u.toRadians(t(a,0)),i=u.toRadians(t(i,0)),r(o)?(o.west=e,o.south=n,o.east=a,o.north=i,o):new s(e,n,a,i)},s.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE,E=0,f=e.length;E<f;E++){var h=e[E];n=Math.min(n,h.longitude),a=Math.max(a,h.longitude),c=Math.min(c,h.latitude),l=Math.max(l,h.latitude);var d=h.longitude>=0?h.longitude:h.longitude+u.TWO_PI;i=Math.min(i,d),o=Math.max(o,d)}return a-n>o-i&&(n=i,a=o,a>u.PI&&(a-=u.TWO_PI),n>u.PI&&(n-=u.TWO_PI)),r(t)?(t.west=n,t.south=c,t.east=a,t.north=l,t):new s(n,c,a,l)},s.fromCartesianArray=function(e,t,n){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=Number.MAX_VALUE,E=-Number.MAX_VALUE,f=0,h=e.length;f<h;f++){var d=t.cartesianToCartographic(e[f]);a=Math.min(a,d.longitude),i=Math.max(i,d.longitude),l=Math.min(l,d.latitude),E=Math.max(E,d.latitude);var p=d.longitude>=0?d.longitude:d.longitude+u.TWO_PI;o=Math.min(o,p),c=Math.max(c,p)}return i-a>c-o&&(a=o,i=c,i>u.PI&&(i-=u.TWO_PI),a>u.PI&&(a-=u.TWO_PI)),r(n)?(n.west=a,n.south=l,n.east=i,n.north=E,n):new s(a,l,i,E)},s.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.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},s.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},s.validate=function(e){},s.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)},s.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)},s.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)},s.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)},s.center=function(t,n){var a=t.east,i=t.west;a<i&&(a+=u.TWO_PI);var o=u.negativePiToPi(.5*(i+a)),s=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=s,n.height=0,n):new e(o,s)},s.intersection=function(e,t,n){var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.negativePiToPi(Math.max(i,c)),E=u.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&E<=l)){var f=Math.max(e.south,t.south),h=Math.min(e.north,t.north);if(!(f>=h))return r(n)?(n.west=l,n.south=f,n.east=E,n.north=h,n):new s(l,f,E,h)}},s.simpleIntersection=function(e,t,n){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(i>=u||a>=o))return r(n)?(n.west=a,n.south=i,n.east=o,n.north=u,n):new s(a,i,o,u)},s.union=function(e,t,n){r(n)||(n=new s);var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.convertLongitudeRange(Math.min(i,c)),E=u.convertLongitudeRange(Math.max(a,o));return n.west=l,n.south=Math.min(e.south,t.south),n.east=E,n.north=Math.max(e.north,t.north),n},s.expand=function(e,t,n){return r(n)||(n=new s),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},s.contains=function(e,t){var r=t.longitude,n=t.latitude,a=e.west,i=e.east;return i<a&&(i+=u.TWO_PI,r<0&&(r+=u.TWO_PI)),(r>a||u.equalsEpsilon(r,a,u.EPSILON14))&&(r<i||u.equalsEpsilon(r,i,u.EPSILON14))&&n>=e.south&&n<=e.north};var c=new e;return s.subsample=function(e,n,a,o){n=t(n,i.WGS84),a=t(a,0),r(o)||(o=[]);var l=0,E=e.north,f=e.south,h=e.east,d=e.west,p=c;p.height=a,p.longitude=d,p.latitude=E,o[l]=n.cartographicToCartesian(p,o[l]),l++,p.longitude=h,o[l]=n.cartographicToCartesian(p,o[l]),l++,p.latitude=f,o[l]=n.cartographicToCartesian(p,o[l]),l++,p.longitude=d,o[l]=n.cartographicToCartesian(p,o[l]),l++,E<0?p.latitude=E:f>0?p.latitude=f:p.latitude=0;for(var y=1;y<8;++y)p.longitude=-Math.PI+y*u.PI_OVER_TWO,s.contains(e,p)&&(o[l]=n.cartographicToCartesian(p,o[l]),l++);return 0===p.latitude&&(p.longitude=d,o[l]=n.cartographicToCartesian(p,o[l]),l++,p.longitude=h,o[l]=n.cartographicToCartesian(p,o[l]),l++),o.length=l,o},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,r,n,a,i,o){"use strict";function u(e){this._ellipsoid=r(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,r){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return n(r)?(r.x=i,r.y=o,r.z=u,r):new e(i,o,u)},u.prototype.unproject=function(e,r){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,u=e.z;return n(r)?(r.longitude=i,r.latitude=o,r.height=u,r):new t(i,o,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";function t(t,r){this.start=e(t,0),this.stop=e(r,0)}return t}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i,o){"use strict";function u(e,r,n,a,i,o,u,s,c){this[0]=t(e,0),this[1]=t(a,0),this[2]=t(u,0),this[3]=t(r,0),this[4]=t(i,0),this[5]=t(s,0),this[6]=t(n,0),this[7]=t(o,0),this[8]=t(c,0)}function s(e){for(var t=0,r=0;r<9;++r){var n=e[r];t+=n*n}return Math.sqrt(t)}function c(e){for(var t=0,r=0;r<3;++r){var n=e[u.getElementIndex(d[r],h[r])];t+=2*n*n}return Math.sqrt(t)}function l(e,t){for(var r=o.EPSILON15,n=0,a=1,i=0;i<3;++i){var s=Math.abs(e[u.getElementIndex(d[i],h[i])]);s>n&&(a=i,n=s)}var c=1,l=0,E=h[a],f=d[a];if(Math.abs(e[u.getElementIndex(f,E)])>r){var p,y=e[u.getElementIndex(f,f)],m=e[u.getElementIndex(E,E)],_=e[u.getElementIndex(f,E)],T=(y-m)/2/_;p=T<0?-1/(-T+Math.sqrt(1+T*T)):1/(T+Math.sqrt(1+T*T)),c=1/Math.sqrt(1+p*p),l=p*c}return t=u.clone(u.IDENTITY,t),t[u.getElementIndex(E,E)]=t[u.getElementIndex(f,f)]=c,t[u.getElementIndex(f,E)]=l,t[u.getElementIndex(E,f)]=-l,t}u.packedLength=9,u.pack=function(e,r,n){return 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},u.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new u),a[0]=e[n++],a[1]=e[n++],a[2]=e[n++],a[3]=e[n++],a[4]=e[n++],a[5]=e[n++],a[6]=e[n++],a[7]=e[n++],a[8]=e[n++],a},u.clone=function(e,t){if(r(e))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):new u(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},u.fromArray=function(e,n,a){return n=t(n,0),r(a)||(a=new u),a[0]=e[n],a[1]=e[n+1],a[2]=e[n+2],a[3]=e[n+3],a[4]=e[n+4],a[5]=e[n+5],a[6]=e[n+6],a[7]=e[n+7],a[8]=e[n+8],a},u.fromColumnMajorArray=function(e,t){return u.clone(e,t)},u.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 u(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},u.fromQuaternion=function(e,t){var n=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,s=e.y*e.y,c=e.y*e.z,l=e.y*e.w,E=e.z*e.z,f=e.z*e.w,h=e.w*e.w,d=n-s-E+h,p=2*(a-f),y=2*(i+l),m=2*(a+f),_=-n+s-E+h,T=2*(c-o),R=2*(i-l),v=2*(c+o),A=-n-s+E+h;return r(t)?(t[0]=d,t[1]=m,t[2]=R,t[3]=p,t[4]=_,t[5]=v,t[6]=y,t[7]=T,t[8]=A,t):new u(d,p,y,m,_,T,R,v,A)},u.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),a=Math.cos(-e.heading),i=Math.cos(e.roll),o=Math.sin(-e.pitch),s=Math.sin(-e.heading),c=Math.sin(e.roll),l=n*a,E=-i*s+c*o*a,f=c*s+i*o*a,h=n*s,d=i*a+c*o*s,p=-o*i+i*o*s,y=-o,m=c*n,_=i*n;return r(t)?(t[0]=l,t[1]=h,t[2]=y,t[3]=E,t[4]=d,t[5]=m,t[6]=f,t[7]=p,t[8]=_,t):new u(l,E,f,h,d,p,y,m,_)},u.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 u(e.x,0,0,0,e.y,0,0,0,e.z)},u.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 u(e,0,0,0,e,0,0,0,e)},u.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 u(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},u.fromRotationX=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=a,t[6]=0,t[7]=-a,t[8]=n,t):new u(1,0,0,0,n,-a,0,a,n)},u.fromRotationY=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=n,t):new u(n,0,a,0,1,0,-a,0,n)},u.fromRotationZ=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=a,t[2]=0,t[3]=-a,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new u(n,-a,0,a,n,0,0,0,1)},u.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]]},u.getElementIndex=function(e,t){return 3*e+t},u.getColumn=function(e,t,r){var n=3*t,a=e[n],i=e[n+1],o=e[n+2];return r.x=a,r.y=i,r.z=o,r},u.setColumn=function(e,t,r,n){n=u.clone(e,n);var a=3*t;return n[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n},u.getRow=function(e,t,r){var n=e[t],a=e[t+3],i=e[t+6];return r.x=n,r.y=a,r.z=i,r},u.setRow=function(e,t,r,n){return n=u.clone(e,n),n[t]=r.x,n[t+3]=r.y,n[t+6]=r.z,n};var E=new e;u.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],E)),r.y=e.magnitude(e.fromElements(t[3],t[4],t[5],E)),r.z=e.magnitude(e.fromElements(t[6],t[7],t[8],E)),r};var f=new e;u.getMaximumScale=function(t){return u.getScale(t,f),e.maximumComponent(f)},u.multiply=function(e,t,r){var n=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=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],E=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return r[0]=n,r[1]=a,r[2]=i,r[3]=o,r[4]=u,r[5]=s,r[6]=c,r[7]=l,r[8]=E,r},u.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},u.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},u.multiplyByVector=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=e[0]*n+e[3]*a+e[6]*i,u=e[1]*n+e[4]*a+e[7]*i,s=e[2]*n+e[5]*a+e[8]*i;return r.x=o,r.y=u,r.z=s,r},u.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},u.multiplyByScale=function(e,t,r){return r[0]=e[0]*t.x,r[1]=e[1]*t.x,r[2]=e[2]*t.x,r[3]=e[3]*t.y,r[4]=e[4]*t.y,r[5]=e[5]*t.y,r[6]=e[6]*t.z,r[7]=e[7]*t.z,r[8]=e[8]*t.z,r},u.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},u.transpose=function(e,t){var r=e[0],n=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=r,t[1]=n,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var h=[1,0,0],d=[2,2,1],p=new u,y=new u;return u.computeEigenDecomposition=function(e,t){var n=o.EPSILON20,a=10,i=0,E=0;r(t)||(t={});for(var f=t.unitary=u.clone(u.IDENTITY,t.unitary),h=t.diagonal=u.clone(e,t.diagonal),d=n*s(h);E<a&&c(h)>d;)l(h,p),u.transpose(p,y),u.multiply(h,p,h),u.multiply(y,h,h),u.multiply(f,p,f),++i>2&&(++E,i=0);return t},u.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},u.determinant=function(e){var t=e[0],r=e[3],n=e[6],a=e[1],i=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*o)+a*(s*n-r*c)+u*(r*o-i*n)},u.inverse=function(e,t){var r=e[0],n=e[1],a=e[2],i=e[3],o=e[4],s=e[5],c=e[6],l=e[7],E=e[8],f=u.determinant(e);t[0]=o*E-l*s,t[1]=l*a-n*E,t[2]=n*s-o*a,t[3]=c*s-i*E,t[4]=r*E-c*a,t[5]=i*a-r*s,t[6]=i*l-c*o,t[7]=c*n-r*l,t[8]=r*o-i*n;var h=1/f;return u.multiplyByScalar(t,h,t)},u.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]},u.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; -},u.IDENTITY=i(new u(1,0,0,0,1,0,0,0,1)),u.ZERO=i(new u(0,0,0,0,0,0,0,0,0)),u.COLUMN0ROW0=0,u.COLUMN0ROW1=1,u.COLUMN0ROW2=2,u.COLUMN1ROW0=3,u.COLUMN1ROW1=4,u.COLUMN1ROW2=5,u.COLUMN2ROW0=6,u.COLUMN2ROW1=7,u.COLUMN2ROW2=8,n(u.prototype,{length:{get:function(){return u.packedLength}}}),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},u}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a){"use strict";function i(t,r,n,a){this.x=e(t,0),this.y=e(r,0),this.z=e(n,0),this.w=e(a,0)}i.fromElements=function(e,r,n,a,o){return t(o)?(o.x=e,o.y=r,o.z=n,o.w=a,o):new i(e,r,n,a)},i.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 i(e.red,e.green,e.blue,e.alpha)},i.clone=function(e,r){if(t(e))return t(r)?(r.x=e.x,r.y=e.y,r.z=e.z,r.w=e.w,r):new i(e.x,e.y,e.z,e.w)},i.packedLength=4,i.pack=function(t,r,n){return n=e(n,0),r[n++]=t.x,r[n++]=t.y,r[n++]=t.z,r[n]=t.w,r},i.unpack=function(r,n,a){return n=e(n,0),t(a)||(a=new i),a.x=r[n++],a.y=r[n++],a.z=r[n++],a.w=r[n],a},i.packArray=function(e,r){var n=e.length;t(r)?r.length=4*n:r=new Array(4*n);for(var a=0;a<n;++a)i.pack(e[a],r,4*a);return r},i.unpackArray=function(e,r){var n=e.length;t(r)?r.length=n/4:r=new Array(n/4);for(var a=0;a<n;a+=4){var o=a/4;r[o]=i.unpack(e,a,r[o])}return r},i.fromArray=i.unpack,i.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},i.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},i.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},i.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},i.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},i.magnitude=function(e){return Math.sqrt(i.magnitudeSquared(e))};var o=new i;i.distance=function(e,t){return i.subtract(e,t,o),i.magnitude(o)},i.distanceSquared=function(e,t){return i.subtract(e,t,o),i.magnitudeSquared(o)},i.normalize=function(e,t){var r=i.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t.z=e.z/r,t.w=e.w/r,t},i.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},i.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},i.divideComponents=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},i.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},i.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},i.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},i.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},i.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},i.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 u=new i;i.lerp=function(e,t,r,n){return i.multiplyByScalar(t,r,u),n=i.multiplyByScalar(e,1-r,n),i.add(u,n,n)};var s=new i;return i.mostOrthogonalAxis=function(e,t){var r=i.normalize(e,s);return i.abs(r,r),t=r.x<=r.y?r.x<=r.z?r.x<=r.w?i.clone(i.UNIT_X,t):i.clone(i.UNIT_W,t):r.z<=r.w?i.clone(i.UNIT_Z,t):i.clone(i.UNIT_W,t):r.y<=r.z?r.y<=r.w?i.clone(i.UNIT_Y,t):i.clone(i.UNIT_W,t):r.z<=r.w?i.clone(i.UNIT_Z,t):i.clone(i.UNIT_W,t)},i.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},i.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]&&e.w===t[r+3]},i.equalsEpsilon=function(e,r,n,i){return e===r||t(e)&&t(r)&&a.equalsEpsilon(e.x,r.x,n,i)&&a.equalsEpsilon(e.y,r.y,n,i)&&a.equalsEpsilon(e.z,r.z,n,i)&&a.equalsEpsilon(e.w,r.w,n,i)},i.ZERO=n(new i(0,0,0,0)),i.UNIT_X=n(new i(1,0,0,0)),i.UNIT_Y=n(new i(0,1,0,0)),i.UNIT_Z=n(new i(0,0,1,0)),i.UNIT_W=n(new i(0,0,0,1)),i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i.prototype.equalsEpsilon=function(e,t,r){return i.equalsEpsilon(this,e,t,r)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},i}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,r,n,a,i,o,u,s,c){"use strict";function l(e,t,n,a,i,o,u,s,c,l,E,f,h,d,p,y){this[0]=r(e,0),this[1]=r(i,0),this[2]=r(c,0),this[3]=r(h,0),this[4]=r(t,0),this[5]=r(o,0),this[6]=r(l,0),this[7]=r(d,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(E,0),this[11]=r(p,0),this[12]=r(a,0),this[13]=r(s,0),this[14]=r(f,0),this[15]=r(y,0)}l.packedLength=16,l.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},l.unpack=function(e,t,a){return t=r(t,0),n(a)||(a=new l),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a[9]=e[t++],a[10]=e[t++],a[11]=e[t++],a[12]=e[t++],a[13]=e[t++],a[14]=e[t++],a[15]=e[t],a},l.clone=function(e,t){if(n(e))return n(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 l(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])},l.fromArray=l.unpack,l.fromColumnMajorArray=function(e,t){return l.clone(e,t)},l.fromRowMajorArray=function(e,t){return n(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 l(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])},l.fromRotationTranslation=function(t,a,i){return a=r(a,e.ZERO),n(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=a.x,i[13]=a.y,i[14]=a.z,i[15]=1,i):new l(t[0],t[3],t[6],a.x,t[1],t[4],t[7],a.y,t[2],t[5],t[8],a.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(e,t,r,a){n(a)||(a=new l);var i=r.x,o=r.y,u=r.z,s=t.x*t.x,c=t.x*t.y,E=t.x*t.z,f=t.x*t.w,h=t.y*t.y,d=t.y*t.z,p=t.y*t.w,y=t.z*t.z,m=t.z*t.w,_=t.w*t.w,T=s-h-y+_,R=2*(c-m),v=2*(E+p),A=2*(c+m),N=-s+h-y+_,S=2*(d-f),I=2*(E-p),g=2*(d+f),M=-s-h+y+_;return a[0]=T*i,a[1]=A*i,a[2]=I*i,a[3]=0,a[4]=R*o,a[5]=N*o,a[6]=g*o,a[7]=0,a[8]=v*u,a[9]=S*u,a[10]=M*u,a[11]=0,a[12]=e.x,a[13]=e.y,a[14]=e.z,a[15]=1,a},l.fromTranslationRotationScale=function(e,t){return l.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},l.fromTranslation=function(e,t){return l.fromRotationTranslation(s.IDENTITY,e,t)},l.fromScale=function(e,t){return n(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 l(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},l.fromUniformScale=function(e,t){return n(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 l(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var E=new e,f=new e,h=new e;l.fromCamera=function(t,r){var a=t.position,i=t.direction,o=t.up;e.normalize(i,E),e.normalize(e.cross(E,o,f),f),e.normalize(e.cross(f,E,h),h);var u=f.x,s=f.y,c=f.z,d=E.x,p=E.y,y=E.z,m=h.x,_=h.y,T=h.z,R=a.x,v=a.y,A=a.z,N=u*-R+s*-v+c*-A,S=m*-R+_*-v+T*-A,I=d*R+p*v+y*A;return n(r)?(r[0]=u,r[1]=m,r[2]=-d,r[3]=0,r[4]=s,r[5]=_,r[6]=-p,r[7]=0,r[8]=c,r[9]=T,r[10]=-y,r[11]=0,r[12]=N,r[13]=S,r[14]=I,r[15]=1,r):new l(u,s,c,N,m,_,T,S,-d,-p,-y,I,0,0,0,1)},l.computePerspectiveFieldOfView=function(e,t,r,n,a){var i=Math.tan(.5*e),o=1/i,u=o/t,s=(n+r)/(r-n),c=2*n*r/(r-n);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=c,a[15]=0,a},l.computeOrthographicOffCenter=function(e,t,r,n,a,i,o){var u=1/(t-e),s=1/(n-r),c=1/(i-a),l=-(t+e)*u,E=-(n+r)*s,f=-(i+a)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=E,o[14]=f,o[15]=1,o},l.computePerspectiveOffCenter=function(e,t,r,n,a,i,o){var u=2*a/(t-e),s=2*a/(n-r),c=(t+e)/(t-e),l=(n+r)/(n-r),E=-(i+a)/(i-a),f=-1,h=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=E,o[11]=f,o[12]=0,o[13]=0,o[14]=h,o[15]=0,o},l.computeInfinitePerspectiveOffCenter=function(e,t,r,n,a,i){var o=2*a/(t-e),u=2*a/(n-r),s=(t+e)/(t-e),c=(n+r)/(n-r),l=-1,E=-1,f=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=s,i[9]=c,i[10]=l,i[11]=E,i[12]=0,i[13]=0,i[14]=f,i[15]=0,i},l.computeViewportTransformation=function(e,t,n,a){e=r(e,r.EMPTY_OBJECT);var i=r(e.x,0),o=r(e.y,0),u=r(e.width,0),s=r(e.height,0);t=r(t,0),n=r(n,1);var c=.5*u,l=.5*s,E=.5*(n-t),f=c,h=l,d=E,p=i+c,y=o+l,m=t+E,_=1;return a[0]=f,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=h,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=d,a[11]=0,a[12]=p,a[13]=y,a[14]=m,a[15]=_,a},l.computeView=function(t,r,n,a,i){return i[0]=a.x,i[1]=n.x,i[2]=-r.x,i[3]=0,i[4]=a.y,i[5]=n.y,i[6]=-r.y,i[7]=0,i[8]=a.z,i[9]=n.z,i[10]=-r.z,i[11]=0,i[12]=-e.dot(a,t),i[13]=-e.dot(n,t),i[14]=e.dot(r,t),i[15]=1,i},l.toArray=function(e,t){return n(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]]},l.getElementIndex=function(e,t){return 4*e+t},l.getColumn=function(e,t,r){var n=4*t,a=e[n],i=e[n+1],o=e[n+2],u=e[n+3];return r.x=a,r.y=i,r.z=o,r.w=u,r},l.setColumn=function(e,t,r,n){n=l.clone(e,n);var a=4*t;return n[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n[a+3]=r.w,n},l.setTranslation=function(e,t,r){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]=t.x,r[13]=t.y,r[14]=t.z,r[15]=e[15],r},l.getRow=function(e,t,r){var n=e[t],a=e[t+4],i=e[t+8],o=e[t+12];return r.x=n,r.y=a,r.z=i,r.w=o,r},l.setRow=function(e,t,r,n){return n=l.clone(e,n),n[t]=r.x,n[t+4]=r.y,n[t+8]=r.z,n[t+12]=r.w,n};var d=new e;l.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],d)),r.y=e.magnitude(e.fromElements(t[4],t[5],t[6],d)),r.z=e.magnitude(e.fromElements(t[8],t[9],t[10],d)),r};var p=new e;l.getMaximumScale=function(t){return l.getScale(t,p),e.maximumComponent(p)},l.multiply=function(e,t,r){var n=e[0],a=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],E=e[8],f=e[9],h=e[10],d=e[11],p=e[12],y=e[13],m=e[14],_=e[15],T=t[0],R=t[1],v=t[2],A=t[3],N=t[4],S=t[5],I=t[6],g=t[7],M=t[8],x=t[9],O=t[10],w=t[11],C=t[12],L=t[13],P=t[14],U=t[15],b=n*T+u*R+E*v+p*A,F=a*T+s*R+f*v+y*A,D=i*T+c*R+h*v+m*A,B=o*T+l*R+d*v+_*A,z=n*N+u*S+E*I+p*g,G=a*N+s*S+f*I+y*g,q=i*N+c*S+h*I+m*g,V=o*N+l*S+d*I+_*g,X=n*M+u*x+E*O+p*w,W=a*M+s*x+f*O+y*w,H=i*M+c*x+h*O+m*w,Y=o*M+l*x+d*O+_*w,k=n*C+u*L+E*P+p*U,Z=a*C+s*L+f*P+y*U,K=i*C+c*L+h*P+m*U,j=o*C+l*L+d*P+_*U;return r[0]=b,r[1]=F,r[2]=D,r[3]=B,r[4]=z,r[5]=G,r[6]=q,r[7]=V,r[8]=X,r[9]=W,r[10]=H,r[11]=Y,r[12]=k,r[13]=Z,r[14]=K,r[15]=j,r},l.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},l.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},l.multiplyTransformation=function(e,t,r){var n=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],E=e[10],f=e[12],h=e[13],d=e[14],p=t[0],y=t[1],m=t[2],_=t[4],T=t[5],R=t[6],v=t[8],A=t[9],N=t[10],S=t[12],I=t[13],g=t[14],M=n*p+o*y+c*m,x=a*p+u*y+l*m,O=i*p+s*y+E*m,w=n*_+o*T+c*R,C=a*_+u*T+l*R,L=i*_+s*T+E*R,P=n*v+o*A+c*N,U=a*v+u*A+l*N,b=i*v+s*A+E*N,F=n*S+o*I+c*g+f,D=a*S+u*I+l*g+h,B=i*S+s*I+E*g+d;return r[0]=M,r[1]=x,r[2]=O,r[3]=0,r[4]=w,r[5]=C,r[6]=L,r[7]=0,r[8]=P,r[9]=U,r[10]=b,r[11]=0,r[12]=F,r[13]=D,r[14]=B,r[15]=1,r},l.multiplyByMatrix3=function(e,t,r){var n=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],E=e[10],f=t[0],h=t[1],d=t[2],p=t[3],y=t[4],m=t[5],_=t[6],T=t[7],R=t[8],v=n*f+o*h+c*d,A=a*f+u*h+l*d,N=i*f+s*h+E*d,S=n*p+o*y+c*m,I=a*p+u*y+l*m,g=i*p+s*y+E*m,M=n*_+o*T+c*R,x=a*_+u*T+l*R,O=i*_+s*T+E*R;return r[0]=v,r[1]=A,r[2]=N,r[3]=0,r[4]=S,r[5]=I,r[6]=g,r[7]=0,r[8]=M,r[9]=x,r[10]=O,r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r},l.multiplyByTranslation=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=n*e[0]+a*e[4]+i*e[8]+e[12],u=n*e[1]+a*e[5]+i*e[9]+e[13],s=n*e[2]+a*e[6]+i*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]=o,r[13]=u,r[14]=s,r[15]=e[15],r};var y=new e;l.multiplyByUniformScale=function(e,t,r){return y.x=t,y.y=t,y.z=t,l.multiplyByScale(e,y,r)},l.multiplyByScale=function(e,t,r){var n=t.x,a=t.y,i=t.z;return 1===n&&1===a&&1===i?l.clone(e,r):(r[0]=n*e[0],r[1]=n*e[1],r[2]=n*e[2],r[3]=0,r[4]=a*e[4],r[5]=a*e[5],r[6]=a*e[6],r[7]=0,r[8]=i*e[8],r[9]=i*e[9],r[10]=i*e[10],r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=1,r)},l.multiplyByVector=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=t.w,u=e[0]*n+e[4]*a+e[8]*i+e[12]*o,s=e[1]*n+e[5]*a+e[9]*i+e[13]*o,c=e[2]*n+e[6]*a+e[10]*i+e[14]*o,l=e[3]*n+e[7]*a+e[11]*i+e[15]*o;return r.x=u,r.y=s,r.z=c,r.w=l,r},l.multiplyByPointAsVector=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=e[0]*n+e[4]*a+e[8]*i,u=e[1]*n+e[5]*a+e[9]*i,s=e[2]*n+e[6]*a+e[10]*i;return r.x=o,r.y=u,r.z=s,r},l.multiplyByPoint=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=e[0]*n+e[4]*a+e[8]*i+e[12],u=e[1]*n+e[5]*a+e[9]*i+e[13],s=e[2]*n+e[6]*a+e[10]*i+e[14];return r.x=o,r.y=u,r.z=s,r},l.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},l.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},l.transpose=function(e,t){var r=e[1],n=e[2],a=e[3],i=e[6],o=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]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=o,t[14]=u,t[15]=e[15],t},l.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},l.equals=function(e,t){return e===t||n(e)&&n(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},l.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r&&Math.abs(e[9]-t[9])<=r&&Math.abs(e[10]-t[10])<=r&&Math.abs(e[11]-t[11])<=r&&Math.abs(e[12]-t[12])<=r&&Math.abs(e[13]-t[13])<=r&&Math.abs(e[14]-t[14])<=r&&Math.abs(e[15]-t[15])<=r},l.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},l.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};var m=new s,_=new s,T=new t,R=new t(0,0,0,1);return l.inverse=function(e,r){if(s.equalsEpsilon(l.getRotation(e,m),_,u.EPSILON7)&&t.equals(l.getRow(e,3,T),R))return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=0,r[11]=0,r[12]=-e[12],r[13]=-e[13],r[14]=-e[14],r[15]=1,r;var n=e[0],a=e[4],i=e[8],o=e[12],E=e[1],f=e[5],h=e[9],d=e[13],p=e[2],y=e[6],v=e[10],A=e[14],N=e[3],S=e[7],I=e[11],g=e[15],M=v*g,x=A*I,O=y*g,w=A*S,C=y*I,L=v*S,P=p*g,U=A*N,b=p*I,F=v*N,D=p*S,B=y*N,z=M*f+w*h+C*d-(x*f+O*h+L*d),G=x*E+P*h+F*d-(M*E+U*h+b*d),q=O*E+U*f+D*d-(w*E+P*f+B*d),V=L*E+b*f+B*h-(C*E+F*f+D*h),X=x*a+O*i+L*o-(M*a+w*i+C*o),W=M*n+U*i+b*o-(x*n+P*i+F*o),H=w*n+P*a+B*o-(O*n+U*a+D*o),Y=C*n+F*a+D*i-(L*n+b*a+B*i);M=i*d,x=o*h,O=a*d,w=o*f,C=a*h,L=i*f,P=n*d,U=o*E,b=n*h,F=i*E,D=n*f,B=a*E;var k=M*S+w*I+C*g-(x*S+O*I+L*g),Z=x*N+P*I+F*g-(M*N+U*I+b*g),K=O*N+U*S+D*g-(w*N+P*S+B*g),j=L*N+b*S+B*I-(C*N+F*S+D*I),Q=O*v+L*A+x*y-(C*A+M*y+w*v),J=b*A+M*p+U*v-(P*v+F*A+x*p),$=P*y+B*A+w*p-(D*A+O*p+U*y),ee=D*v+C*p+F*y-(b*y+B*v+L*p),te=n*z+a*G+i*q+o*V;if(Math.abs(te)<u.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return te=1/te,r[0]=z*te,r[1]=G*te,r[2]=q*te,r[3]=V*te,r[4]=X*te,r[5]=W*te,r[6]=H*te,r[7]=Y*te,r[8]=k*te,r[9]=Z*te,r[10]=K*te,r[11]=j*te,r[12]=Q*te,r[13]=J*te,r[14]=$*te,r[15]=ee*te,r},l.inverseTransformation=function(e,t){var r=e[0],n=e[1],a=e[2],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],E=e[12],f=e[13],h=e[14],d=-r*E-n*f-a*h,p=-i*E-o*f-u*h,y=-s*E-c*f-l*h;return t[0]=r,t[1]=i,t[2]=s,t[3]=0,t[4]=n,t[5]=o,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=l,t[11]=0,t[12]=d,t[13]=p,t[14]=y,t[15]=1,t},l.IDENTITY=o(new l(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),l.ZERO=o(new l(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN0ROW3=3,l.COLUMN1ROW0=4,l.COLUMN1ROW1=5,l.COLUMN1ROW2=6,l.COLUMN1ROW3=7,l.COLUMN2ROW0=8,l.COLUMN2ROW1=9,l.COLUMN2ROW2=10,l.COLUMN2ROW3=11,l.COLUMN3ROW0=12,l.COLUMN3ROW1=13,l.COLUMN3ROW2=14,l.COLUMN3ROW3=15,a(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]&&e[9]===t[r+9]&&e[10]===t[r+10]&&e[11]===t[r+11]&&e[12]===t[r+12]&&e[13]===t[r+13]&&e[14]===t[r+14]&&e[15]===t[r+15]},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.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]+")"},l}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,r,n,a,i,o,u,s,c,l,E){"use strict";function f(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var h=new e,d=new e,p=new e,y=new e,m=new e,_=new e,T=new e,R=new e,v=new e,A=new e,N=new e,S=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 a=e.clone(t[0],T),i=e.clone(a,h),o=e.clone(a,d),u=e.clone(a,p),s=e.clone(a,y),c=e.clone(a,m),l=e.clone(a,_),E=t.length,I=1;I<E;I++){e.clone(t[I],a);var g=a.x,M=a.y,x=a.z;g<i.x&&e.clone(a,i),g>s.x&&e.clone(a,s),M<o.y&&e.clone(a,o),M>c.y&&e.clone(a,c),x<u.z&&e.clone(a,u),x>l.z&&e.clone(a,l)}var O=e.magnitudeSquared(e.subtract(s,i,R)),w=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),L=i,P=s,U=O;w>U&&(U=w,L=o,P=c),C>U&&(U=C,L=u,P=l);var b=v;b.x=.5*(L.x+P.x),b.y=.5*(L.y+P.y),b.z=.5*(L.z+P.z);var F=e.magnitudeSquared(e.subtract(P,b,R)),D=Math.sqrt(F),B=A;B.x=i.x,B.y=o.y,B.z=u.z;var z=N;z.x=s.x,z.y=c.y,z.z=l.z;var G=e.multiplyByScalar(e.add(B,z,R),.5,S),q=0;for(I=0;I<E;I++){e.clone(t[I],a);var V=e.magnitude(e.subtract(a,G,R));V>q&&(q=V);var X=e.magnitudeSquared(e.subtract(a,b,R));if(X>F){var W=Math.sqrt(X);D=.5*(D+W),F=D*D;var H=W-D;b.x=(D*b.x+H*a.x)/W,b.y=(D*b.y+H*a.y)/W,b.z=(D*b.z+H*a.z)/W}}return D<q?(e.clone(b,r.center),r.radius=D):(e.clone(G,r.center),r.radius=q),r};var I=new o,g=new e,M=new e,x=new t,O=new t;f.fromRectangle2D=function(e,t,r){return f.fromRectangleWithHeights2D(e,t,0,0,r)},f.fromRectangleWithHeights2D=function(t,a,i,o,u){if(n(u)||(u=new f),!n(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;a=r(a,I),E.southwest(t,x),x.height=i,E.northeast(t,O),O.height=o;var s=a.project(x,g),c=a.project(O,M),l=c.x-s.x,h=c.y-s.y,d=c.z-s.z;u.radius=.5*Math.sqrt(l*l+h*h+d*d);var p=u.center;return p.x=s.x+.5*l,p.y=s.y+.5*h,p.z=s.z+.5*d,u};var w=[];f.fromRectangle3D=function(e,t,a,o){t=r(t,i.WGS84),a=r(a,0);var u;return n(e)&&(u=E.subsample(e,t,a,w)),f.fromPoints(u,o)},f.fromVertices=function(t,a,i,o){if(n(o)||(o=new f),!n(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;a=r(a,e.ZERO),i=r(i,3);var u=T;u.x=t[0]+a.x,u.y=t[1]+a.y,u.z=t[2]+a.z;for(var s=e.clone(u,h),c=e.clone(u,d),l=e.clone(u,p),E=e.clone(u,y),I=e.clone(u,m),g=e.clone(u,_),M=t.length,x=0;x<M;x+=i){var O=t[x]+a.x,w=t[x+1]+a.y,C=t[x+2]+a.z;u.x=O,u.y=w,u.z=C,O<s.x&&e.clone(u,s),O>E.x&&e.clone(u,E),w<c.y&&e.clone(u,c),w>I.y&&e.clone(u,I),C<l.z&&e.clone(u,l),C>g.z&&e.clone(u,g)}var L=e.magnitudeSquared(e.subtract(E,s,R)),P=e.magnitudeSquared(e.subtract(I,c,R)),U=e.magnitudeSquared(e.subtract(g,l,R)),b=s,F=E,D=L;P>D&&(D=P,b=c,F=I),U>D&&(D=U,b=l,F=g);var B=v;B.x=.5*(b.x+F.x),B.y=.5*(b.y+F.y),B.z=.5*(b.z+F.z);var z=e.magnitudeSquared(e.subtract(F,B,R)),G=Math.sqrt(z),q=A;q.x=s.x,q.y=c.y,q.z=l.z;var V=N;V.x=E.x,V.y=I.y,V.z=g.z;var X=e.multiplyByScalar(e.add(q,V,R),.5,S),W=0;for(x=0;x<M;x+=i){u.x=t[x]+a.x,u.y=t[x+1]+a.y,u.z=t[x+2]+a.z;var H=e.magnitude(e.subtract(u,X,R));H>W&&(W=H);var Y=e.magnitudeSquared(e.subtract(u,B,R));if(Y>z){var k=Math.sqrt(Y);G=.5*(G+k),z=G*G;var Z=k-G;B.x=(G*B.x+Z*u.x)/k,B.y=(G*B.y+Z*u.y)/k,B.z=(G*B.z+Z*u.z)/k}}return G<W?(e.clone(B,o.center),o.radius=G):(e.clone(X,o.center),o.radius=W),o},f.fromEncodedCartesianVertices=function(t,r,a){if(n(a)||(a=new f),!n(t)||!n(r)||t.length!==r.length||0===t.length)return a.center=e.clone(e.ZERO,a.center),a.radius=0,a;var i=T;i.x=t[0]+r[0],i.y=t[1]+r[1],i.z=t[2]+r[2];for(var o=e.clone(i,h),u=e.clone(i,d),s=e.clone(i,p),c=e.clone(i,y),l=e.clone(i,m),E=e.clone(i,_),I=t.length,g=0;g<I;g+=3){var M=t[g]+r[g],x=t[g+1]+r[g+1],O=t[g+2]+r[g+2];i.x=M,i.y=x,i.z=O,M<o.x&&e.clone(i,o),M>c.x&&e.clone(i,c),x<u.y&&e.clone(i,u),x>l.y&&e.clone(i,l),O<s.z&&e.clone(i,s),O>E.z&&e.clone(i,E)}var w=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),L=e.magnitudeSquared(e.subtract(E,s,R)),P=o,U=c,b=w;C>b&&(b=C,P=u,U=l),L>b&&(b=L,P=s,U=E);var F=v;F.x=.5*(P.x+U.x),F.y=.5*(P.y+U.y),F.z=.5*(P.z+U.z);var D=e.magnitudeSquared(e.subtract(U,F,R)),B=Math.sqrt(D),z=A;z.x=o.x,z.y=u.y,z.z=s.z;var G=N;G.x=c.x,G.y=l.y,G.z=E.z;var q=e.multiplyByScalar(e.add(z,G,R),.5,S),V=0;for(g=0;g<I;g+=3){i.x=t[g]+r[g],i.y=t[g+1]+r[g+1],i.z=t[g+2]+r[g+2];var X=e.magnitude(e.subtract(i,q,R));X>V&&(V=X);var W=e.magnitudeSquared(e.subtract(i,F,R));if(W>D){var H=Math.sqrt(W);B=.5*(B+H),D=B*B;var Y=H-B;F.x=(B*F.x+Y*i.x)/H,F.y=(B*F.y+Y*i.y)/H,F.z=(B*F.z+Y*i.z)/H}}return B<V?(e.clone(F,a.center),a.radius=B):(e.clone(q,a.center),a.radius=V),a},f.fromCornerPoints=function(t,r,a){n(a)||(a=new f);var i=a.center;return e.add(t,r,i),e.multiplyByScalar(i,.5,i),a.radius=e.distance(i,r),a},f.fromEllipsoid=function(t,r){return n(r)||(r=new f),e.clone(e.ZERO,r.center),r.radius=t.maximumRadius,r};var C=new e;f.fromBoundingSpheres=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;var a=t.length;if(1===a)return f.clone(t[0],r);if(2===a)return f.union(t[0],t[1],r);for(var i=[],o=0;o<a;o++)i.push(t[o].center);r=f.fromPoints(i,r);var u=r.center,s=r.radius;for(o=0;o<a;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,C)+c.radius)}return r.radius=s,r};var L=new e,P=new e,U=new e;f.fromOrientedBoundingBox=function(t,r){n(r)||(r=new f);var a=t.halfAxes,i=c.getColumn(a,0,L),o=c.getColumn(a,1,P),u=c.getColumn(a,2,U),s=e.magnitude(i),l=e.magnitude(o),E=e.magnitude(u);return r.center=e.clone(t.center,r.center),r.radius=Math.max(s,l,E),r},f.clone=function(t,r){if(n(t))return n(r)?(r.center=e.clone(t.center,r.center),r.radius=t.radius,r):new f(t.center,t.radius)},f.packedLength=4,f.pack=function(e,t,n){n=r(n,0);var a=e.center;return t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n]=e.radius,t},f.unpack=function(e,t,a){t=r(t,0),n(a)||(a=new f);var i=a.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],a.radius=e[t],a};var b=new e,F=new e;f.union=function(t,r,a){n(a)||(a=new f);var i=t.center,o=t.radius,u=r.center,s=r.radius,c=e.subtract(u,i,b),l=e.magnitude(c);if(o>=l+s)return t.clone(a),a;if(s>=l+o)return r.clone(a),a;var E=.5*(o+l+s),h=e.multiplyByScalar(c,(-o+E)/l,F);return e.add(h,i,h),e.clone(h,a.center),a.radius=E,a};var D=new e;f.expand=function(t,r,n){n=f.clone(t,n);var a=e.magnitude(e.subtract(r,n.center,D));return a>n.radius&&(n.radius=a),n},f.intersectPlane=function(t,r){var n=t.center,a=t.radius,i=r.normal,o=e.dot(i,n)+r.distance;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=l.multiplyByPoint(t,e.center,r.center),r.radius=l.getMaximumScale(t)*e.radius,r};var B=new e;f.distanceSquaredTo=function(t,r){var n=e.subtract(t.center,r,B);return e.magnitudeSquared(n)-t.radius*t.radius},f.transformWithoutScale=function(e,t,r){return n(r)||(r=new f),r.center=l.multiplyByPoint(t,e.center,r.center),r.radius=e.radius,r};var z=new e;f.computePlaneDistances=function(t,r,a,i){n(i)||(i=new s);var o=e.subtract(t.center,r,z),u=e.dot(a,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var G=new e,q=new e,V=new e,X=new e,W=new e,H=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var Z=new o;return f.projectTo2D=function(t,n,a){n=r(n,Z);var i=n.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,G),c=e.cross(e.UNIT_Z,s,q);e.normalize(c,c);var l=e.cross(s,c,V);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var E=e.negate(l,W),h=e.negate(c,X),d=Y,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,E,p),e.add(p,h,p),p=d[3],e.add(s,E,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,E,p),e.add(p,h,p),p=d[7],e.add(s,E,p),e.add(p,c,p);for(var y=d.length,m=0;m<y;++m){var _=d[m];e.add(o,_,_);var T=i.cartesianToCartographic(_,H);n.project(T,_)}a=f.fromPoints(d,a),o=a.center;var R=o.x,v=o.y,A=o.z;return o.x=A,o.y=R,o.z=v,a},f.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},f.equals=function(t,r){return t===r||n(t)&&n(r)&&e.equals(t.center,r.center)&&t.radius===r.radius},f.prototype.intersectPlane=function(e){return f.intersectPlane(this,e)},f.prototype.distanceSquaredTo=function(e){return f.distanceSquaredTo(this,e)},f.prototype.computePlaneDistances=function(e,t,r){return f.computePlaneDistances(this,e,t,r)},f.prototype.isOccluded=function(e){return f.isOccluded(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/Cartesian2",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a){"use strict";function i(t,r){this.x=e(t,0),this.y=e(r,0)}i.fromElements=function(e,r,n){return t(n)?(n.x=e,n.y=r,n):new i(e,r)},i.clone=function(e,r){if(t(e))return t(r)?(r.x=e.x,r.y=e.y,r):new i(e.x,e.y)},i.fromCartesian3=i.clone,i.fromCartesian4=i.clone,i.packedLength=2,i.pack=function(t,r,n){return n=e(n,0),r[n++]=t.x,r[n]=t.y,r},i.unpack=function(r,n,a){return n=e(n,0),t(a)||(a=new i),a.x=r[n++],a.y=r[n],a},i.packArray=function(e,r){var n=e.length;t(r)?r.length=2*n:r=new Array(2*n);for(var a=0;a<n;++a)i.pack(e[a],r,2*a);return r},i.unpackArray=function(e,r){var n=e.length;t(r)?r.length=n/2:r=new Array(n/2);for(var a=0;a<n;a+=2){var o=a/2;r[o]=i.unpack(e,a,r[o])}return r},i.fromArray=i.unpack,i.maximumComponent=function(e){return Math.max(e.x,e.y)},i.minimumComponent=function(e){return Math.min(e.x,e.y)},i.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r},i.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r},i.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},i.magnitude=function(e){return Math.sqrt(i.magnitudeSquared(e))};var o=new i;i.distance=function(e,t){return i.subtract(e,t,o),i.magnitude(o)},i.distanceSquared=function(e,t){return i.subtract(e,t,o),i.magnitudeSquared(o)},i.normalize=function(e,t){var r=i.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t},i.dot=function(e,t){return e.x*t.x+e.y*t.y},i.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r},i.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r},i.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r},i.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r},i.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r},i.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r},i.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},i.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var u=new i;i.lerp=function(e,t,r,n){return i.multiplyByScalar(t,r,u),n=i.multiplyByScalar(e,1-r,n),i.add(u,n,n)};var s=new i,c=new i;i.angleBetween=function(e,t){return i.normalize(e,s),i.normalize(t,c),a.acosClamped(i.dot(s,c))};var l=new i;return i.mostOrthogonalAxis=function(e,t){var r=i.normalize(e,l);return i.abs(r,r),t=r.x<=r.y?i.clone(i.UNIT_X,t):i.clone(i.UNIT_Y,t)},i.equals=function(e,r){return e===r||t(e)&&t(r)&&e.x===r.x&&e.y===r.y},i.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]},i.equalsEpsilon=function(e,r,n,i){return e===r||t(e)&&t(r)&&a.equalsEpsilon(e.x,r.x,n,i)&&a.equalsEpsilon(e.y,r.y,n,i)},i.ZERO=n(new i(0,0)),i.UNIT_X=n(new i(1,0)),i.UNIT_Y=n(new i(0,1)),i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i.prototype.equalsEpsilon=function(e,t,r){return i.equalsEpsilon(this,e,t,r)},i.prototype.toString=function(){return"("+this.x+", "+this.y+")"},i}),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},a={};return t(a,{element:{get:function(){if(a.supportsFullscreen())return document[n.fullscreenElement]}},changeEventName:{get:function(){if(a.supportsFullscreen())return n.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return n.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[n.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.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 a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(n.requestFullscreen=a,r=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(n.requestFullscreen=a,r=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?n.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(n.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?n.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(n.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?n.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(n.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),n.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),n.fullscreenerror=a)}return r},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[n.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[n.exitFullscreen]()},a}),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;r<n;++r)t[r]=parseInt(t[r],10);return t}function a(){if(!t(v)&&(v=!1,!f())){var e=/ Chrome\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(v=!0,A=n(e[1]))}return v}function i(){return a()&&A}function o(){if(!t(N)&&(N=!1,!a()&&!f()&&/ Safari\/[\.0-9]+/.test(R.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(N=!0,S=n(e[1]))}return N}function u(){return o()&&S}function s(){if(!t(I)){I=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(R.userAgent);null!==e&&(I=!0,g=n(e[1]),g.isNightly=!!e[2])}return I}function c(){return s()&&g}function l(){if(!t(M)){M=!1;var e;"Microsoft Internet Explorer"===R.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(M=!0,x=n(e[1]))):"Netscape"===R.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(M=!0,x=n(e[1])))}return M}function E(){return l()&&x}function f(){if(!t(O)){O=!1;var e=/ Edge\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(O=!0,w=n(e[1]))}return O}function h(){return f()&&w}function d(){if(!t(C)){C=!1;var e=/Firefox\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(C=!0,L=n(e[1]))}return C}function p(){return t(P)||(P=/Windows/i.test(R.appVersion)),P}function y(){return d()&&L}function m(){return t(U)||(U="undefined"!=typeof PointerEvent&&(!t(R.pointerEnabled)||R.pointerEnabled)),U}function _(){if(!t(F)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var r=e.style.imageRendering;F=t(r)&&""!==r,F&&(b=r)}return F}function T(){return _()?b:void 0}var R;R="undefined"!=typeof navigator?navigator:{};var v,A,N,S,I,g,M,x,O,w,C,L,P,U,b,F,D={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:E,isEdge:f,edgeVersion:h,isFirefox:d,firefoxVersion:y,isWindows:p,hardwareConcurrency:e(R.hardwareConcurrency,3),supportsPointerEvents:m,supportsImageRenderingPixelated:_,imageRenderingValue:T};return D.supportsFullscreen=function(){return r.supportsFullscreen()},D.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},D.supportsWebWorkers=function(){return"undefined"!=typeof Worker},D}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,r,n,a,i){"use strict";if(!n.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){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.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},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 Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,r,n,a){switch(n=e(n,0),a=e(a,(r.byteLength-n)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(r,n,a);case o.UNSIGNED_BYTE:return new Uint8Array(r,n,a);case o.SHORT:return new Int16Array(r,n,a);case o.UNSIGNED_SHORT:return new Uint16Array(r,n,a);case o.INT:return new Int32Array(r,n,a);case o.UNSIGNED_INT:return new Uint32Array(r,n,a);case o.FLOAT:return new Float32Array(r,n,a);case o.DOUBLE:return new Float64Array(r,n,a)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var r={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,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,t,r,n,a){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,a.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,n.NONE),this.boundingSphereCV=t.boundingSphereCV}return i.computeNumberOfVertices=function(e){var r=-1;for(var n in e.attributes)if(e.attributes.hasOwnProperty(n)&&t(e.attributes[n])&&t(e.attributes[n].values)){var a=e.attributes[n],i=a.values.length/a.componentsPerAttribute;r=i}return r},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(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 n}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.binormal=t.binormal,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/GeometryInstance",["./defaultValue","./defined","./DeveloperError","./Matrix4"],function(e,t,r,n){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.geometry=t.geometry,this.modelMatrix=n.clone(e(t.modelMatrix,n.IDENTITY)),this.id=t.id,this.pickPrimitive=t.pickPrimitive,this.attributes=e(t.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}return a}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,r,n,a){"use strict";var i={};i.octEncodeInRange=function(e,t,r){if(r.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),r.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var n=r.x,i=r.y;r.x=(1-Math.abs(i))*a.signNotZero(n),r.y=(1-Math.abs(n))*a.signNotZero(i)}return r.x=a.toSNorm(r.x,t),r.y=a.toSNorm(r.y,t),r},i.octEncode=function(e,t){return i.octEncodeInRange(e,255,t)},i.octDecodeInRange=function(e,r,n,i){if(i.x=a.fromSNorm(e,n),i.y=a.fromSNorm(r,n),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){var o=i.x;i.x=(1-Math.abs(i.y))*a.signNotZero(o),i.y=(1-Math.abs(o))*a.signNotZero(i.y)}return t.normalize(i,i)},i.octDecode=function(e,t,r){return i.octDecodeInRange(e,t,255,r)},i.octPackFloat=function(e){return 256*e.x+e.y};var o=new e;return i.octEncodeFloat=function(e){return i.octEncode(e,o),i.octPackFloat(o)},i.octDecodeFloat=function(e,t){var r=e/256,n=Math.floor(r),a=256*(r-n);return i.octDecode(n,a,t)},i.octPack=function(e,t,r,n){var a=i.octEncodeFloat(e),u=i.octEncodeFloat(t),s=i.octEncode(r,o);return n.x=65536*s.x+a,n.y=65536*s.y+u,n},i.octUnpack=function(e,t,r,n){var a=e.x/65536,o=Math.floor(a),u=65536*(a-o);a=e.y/65536;var s=Math.floor(a),c=65536*(a-s);i.octDecodeFloat(u,t),i.octDecodeFloat(c,r),i.octDecode(o,s,n)},i.compressTextureCoordinates=function(e){var t=4095*e.x|0,r=4095*e.y|0;return 4096*t+r},i.decompressTextureCoordinates=function(e,t){var r=e/4096,n=Math.floor(r);return t.x=n/4095,t.y=(e-4096*n)/4095,t},i}),define("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function a(n,a,s,c,l){r(l)||(l=new t);var E,f,h,d,p,y,m,_;r(a.z)?(E=t.subtract(s,a,i),f=t.subtract(c,a,o),h=t.subtract(n,a,u),d=t.dot(E,E),p=t.dot(E,f),y=t.dot(E,h),m=t.dot(f,f),_=t.dot(f,h)):(E=e.subtract(s,a,i),f=e.subtract(c,a,o),h=e.subtract(n,a,u),d=e.dot(E,E),p=e.dot(E,f),y=e.dot(E,h),m=e.dot(f,f),_=e.dot(f,h));var T=1/(d*m-p*p);return l.y=(m*y-p*_)*T,l.z=(d*_-p*y)*T,l.x=1-l.y-l.z,l}var i=new t,o=new t,u=new t;return a}),define("Core/EncodedCartesian3",["./Cartesian3","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(){this.high=e.clone(e.ZERO),this.low=e.clone(e.ZERO)}n.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 a={high:0,low:0};n.fromCartesian=function(e,r){t(r)||(r=new n);var i=r.high,o=r.low;return n.encode(e.x,a),i.x=a.high,o.x=a.low,n.encode(e.y,a),i.y=a.high,o.y=a.low,n.encode(e.z,a),i.z=a.high,o.z=a.low,r};var i=new n;return n.writeElements=function(e,t,r){n.fromCartesian(e,i);var a=i.high,o=i.low;t[r]=a.x,t[r+1]=a.y,t[r+2]=a.z,t[r+3]=o.x,t[r+4]=o.y,t[r+5]=o.z},n}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,r,n,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(e){switch(e){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(t){return e(t)&&(t===i.UNSIGNED_BYTE||t===i.UNSIGNED_SHORT||t===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,r,a){return e>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,r,a):new Uint16Array(t,r,a)},r(i)}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function r(e,r,n){var a=e+r;return t.sign(e)!==t.sign(r)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(r)))<n?0:a}var n={};return n.computeDiscriminant=function(e,t,r){var n=t*t-4*e*r;return n},n.computeRealRoots=function(e,n,a){var i;if(0===e)return 0===n?[]:[-a/n];if(0===n){if(0===a)return[0,0];var o=Math.abs(a),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,i<0)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-n/e,i<0?[i,0]:[0,i];var c=n*n,l=4*e*a,E=r(c,-l,t.EPSILON14);if(E<0)return[];var f=-.5*r(n,t.sign(n)*Math.sqrt(E),t.EPSILON14);return n>0?[f/e,a/f]:[a/f,f/e]},n}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function r(e,t,r,n){var a,i,o=e,u=t/3,s=r/3,c=n,l=o*s,E=u*c,f=u*u,h=s*s,d=o*s-f,p=o*c-u*s,y=u*c-h,m=4*d*y-p*p;if(m<0){var _,T,R;f*E>=l*h?(_=o,T=d,R=-2*u*d+o*p):(_=c,T=y,R=-c*p+2*s*y);var v=R<0?-1:1,A=-v*Math.abs(_)*Math.sqrt(-m);i=-R+A;var N=i/2,S=N<0?-Math.pow(-N,1/3):Math.pow(N,1/3),I=i===A?-S:-T/S;return a=T<=0?S+I:-R/(S*S+I*I+T),f*E>=l*h?[(a-u)/o]:[-c/(a+s)]}var g=d,M=-2*u*d+o*p,x=y,O=-c*p+2*s*y,w=Math.sqrt(m),C=Math.sqrt(3)/2,L=Math.abs(Math.atan2(o*w,-M)/3);a=2*Math.sqrt(-g);var P=Math.cos(L);i=a*P;var U=a*(-P/2-C*Math.sin(L)),b=i+U>2*u?i-u:U-u,F=o,D=b/F;L=Math.abs(Math.atan2(c*w,-O)/3),a=2*Math.sqrt(-x),P=Math.cos(L),i=a*P,U=a*(-P/2-C*Math.sin(L));var B=-c,z=i+U<2*s?i+s:U+s,G=B/z,q=F*z,V=-b*z-F*B,X=b*B,W=(s*V-u*X)/(-u*V+s*q);return D<=W?D<=G?W<=G?[D,W,G]:[D,G,W]:[G,D,W]:D<=G?[W,D,G]:W<=G?[W,G,D]:[G,W,D]}var n={};return n.computeDiscriminant=function(e,t,r,n){var a=e*e,i=t*t,o=r*r,u=n*n,s=18*e*t*r*n+i*o-27*a*u-4*(e*o*r+i*t*n);return s},n.computeRealRoots=function(e,n,a,i){var o,u;if(0===e)return t.computeRealRoots(n,a,i);if(0===n){if(0===a){if(0===i)return[0,0,0];u=-i/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===i?(o=t.computeRealRoots(e,0,a),0===o.Length?[0]:[o[0],0,o[1]]):r(e,0,a,i)}return 0===a?0===i?(u=-n/e,u<0?[u,0,0]:[0,0,u]):r(e,n,0,i):0===i?(o=t.computeRealRoots(e,n,a),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):r(e,n,a,i)},n}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,r,n){"use strict";function a(t,a,i,o){var u=t*t,s=a-3*u/8,c=i-a*t/2+u*t/8,l=o-i*t/4+a*u/16-3*u*u/256,E=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(E.length>0){var f=-t/4,h=E[E.length-1];if(Math.abs(h)<r.EPSILON14){var d=n.computeRealRoots(1,s,l);if(2===d.length){var p,y=d[0],m=d[1];if(y>=0&&m>=0){var _=Math.sqrt(y),T=Math.sqrt(m);return[f-T,f-_,f+_,f+T]}if(y>=0&&m<0)return p=Math.sqrt(y),[f-p,f+p];if(y<0&&m>=0)return p=Math.sqrt(m),[f-p,f+p]}return[]}if(h>0){var R=Math.sqrt(h),v=(s+h-c/R)/2,A=(s+h+c/R)/2,N=n.computeRealRoots(1,R,v),S=n.computeRealRoots(1,-R,A);return 0!==N.length?(N[0]+=f,N[1]+=f,0!==S.length?(S[0]+=f,S[1]+=f,N[1]<=S[0]?[N[0],N[1],S[0],S[1]]:S[1]<=N[0]?[S[0],S[1],N[0],N[1]]:N[0]>=S[0]&&N[1]<=S[1]?[S[0],N[0],N[1],S[1]]:S[0]>=N[0]&&S[1]<=N[1]?[N[0],S[0],S[1],N[1]]:N[0]>S[0]&&N[0]<S[1]?[S[0],N[0],S[1],N[1]]:[N[0],S[0],N[1],S[1]]):N):0!==S.length?(S[0]+=f,S[1]+=f,S):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,E=i*t+s-4*o,f=c*o-i*a*t+u,h=e.computeRealRoots(1,l,E,f);if(h.length>0){var d,p,y=h[0],m=a-y,_=m*m,T=t/2,R=m/2,v=_-4*o,A=_+4*Math.abs(o),N=c-4*y,S=c+4*Math.abs(y);if(y<0||v*S<N*A){var I=Math.sqrt(N);d=I/2,p=0===I?0:(t*R-i)/I}else{var g=Math.sqrt(v);d=0===g?0:(t*R-i)/g,p=g/2}var M,x;0===T&&0===d?(M=0,x=0):r.sign(T)===r.sign(d)?(M=T+d,x=y/M):(x=T-d,M=y/x);var O,w;0===R&&0===p?(O=0,w=0):r.sign(R)===r.sign(p)?(O=R+p,w=o/O):(w=R-p,O=o/w);var C=n.computeRealRoots(1,M,O),L=n.computeRealRoots(1,x,w);if(0!==C.length)return 0!==L.length?C[1]<=L[0]?[C[0],C[1],L[0],L[1]]:L[1]<=C[0]?[L[0],L[1],C[0],C[1]]:C[0]>=L[0]&&C[1]<=L[1]?[L[0],C[0],C[1],L[1]]:L[0]>=C[0]&&L[1]<=C[1]?[C[0],L[0],L[1],C[1]]:C[0]>L[0]&&C[0]<L[1]?[L[0],C[0],L[1],C[1]]:[C[0],L[0],C[1],L[1]]:C;if(0!==L.length)return L}return[]}var o={};return o.computeDiscriminant=function(e,t,r,n,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=r*r,l=c*r,E=n*n,f=E*n,h=a*a,d=h*a,p=u*c*E-4*s*f-4*e*l*E+18*e*t*r*f-27*i*E*E+256*o*d+a*(18*s*r*n-4*u*l+16*e*c*c-80*e*t*c*n-6*e*u*E+144*i*r*E)+h*(144*e*u*r-27*u*u-128*i*c-192*i*t*n);return p},o.computeRealRoots=function(t,n,o,u,s){if(Math.abs(t)<r.EPSILON15)return e.computeRealRoots(n,o,u,s);var c=n/t,l=o/t,E=u/t,f=s/t,h=c<0?1:0;switch(h+=l<0?h+1:h,h+=E<0?h+1:h,h+=f<0?h+1:h){case 0:return a(c,l,E,f);case 1:return i(c,l,E,f);case 2:return i(c,l,E,f);case 3:return a(c,l,E,f);case 4:return a(c,l,E,f);case 5:return i(c,l,E,f);case 6:return a(c,l,E,f);case 7:return a(c,l,E,f);case 8:return i(c,l,E,f);case 9:return a(c,l,E,f);case 10:return a(c,l,E,f);case 11:return i(c,l,E,f);case 12:return a(c,l,E,f);case 13:return a(c,l,E,f);case 14:return a(c,l,E,f);case 15:return a(c,l,E,f);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function a(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 a.getPoint=function(t,n,a){return r(a)||(a=new e),a=e.multiplyByScalar(t.direction,n,a),e.add(t.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,r,n,a,i,o,u,s,c){"use strict";function l(e,t,r,n){var a=t*t-4*e*r;if(!(a<0)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return u<s?(n.root0=u,n.root1=s):(n.root0=s,n.root1=u),n}var c=-t/(2*e);if(0!==c)return n.root0=n.root1=c,n}}function E(t,r,a){n(a)||(a={});var i=t.origin,o=t.direction,u=r.center,s=r.radius*r.radius,c=e.subtract(i,u,m),E=e.dot(o,o),f=2*e.dot(o,c),h=e.magnitudeSquared(c)-s,d=l(E,f,h,v);if(n(d))return a.start=d.root0,a.stop=d.root1,a}function f(e,t,r){var n=e+t;return i.sign(e)!==i.sign(t)&&Math.abs(n/Math.max(Math.abs(e),Math.abs(t)))<r?0:n}function h(t,r,n,a,c){var l,E=a*a,h=c*c,d=(t[o.COLUMN1ROW1]-t[o.COLUMN2ROW2])*h,p=c*(a*f(t[o.COLUMN1ROW0],t[o.COLUMN0ROW1],i.EPSILON15)+r.y),y=t[o.COLUMN0ROW0]*E+t[o.COLUMN2ROW2]*h+a*r.x+n,m=h*f(t[o.COLUMN2ROW1],t[o.COLUMN1ROW2],i.EPSILON15),_=c*(a*f(t[o.COLUMN2ROW0],t[o.COLUMN0ROW2])+r.z),T=[];if(0===_&&0===m){if(l=u.computeRealRoots(d,p,y),0===l.length)return T;var R=l[0],v=Math.sqrt(Math.max(1-R*R,0));if(T.push(new e(a,c*R,c*-v)),T.push(new e(a,c*R,c*v)),2===l.length){var A=l[1],N=Math.sqrt(Math.max(1-A*A,0));T.push(new e(a,c*A,c*-N)),T.push(new e(a,c*A,c*N))}return T}var S=_*_,I=m*m,g=d*d,M=_*m,x=g+I,O=2*(p*d+M),w=2*y*d+p*p-I+S,C=2*(y*p-M),L=y*y-S;if(0===x&&0===O&&0===w&&0===C)return T;l=s.computeRealRoots(x,O,w,C,L);var P=l.length;if(0===P)return T;for(var U=0;U<P;++U){var b,F=l[U],D=F*F,B=Math.max(1-D,0),z=Math.sqrt(B); -b=i.sign(d)===i.sign(y)?f(d*D+y,p*F,i.EPSILON12):i.sign(y)===i.sign(p*F)?f(d*D,p*F+y,i.EPSILON12):f(d*D+p*F,y,i.EPSILON12);var G=f(m*F,_,i.EPSILON15),q=b*G;q<0?T.push(new e(a,c*F,c*z)):q>0?T.push(new e(a,c*F,c*-z)):0!==z?(T.push(new e(a,c*F,c*-z)),T.push(new e(a,c*F,c*z)),++U):T.push(new e(a,c*F,c*z))}return T}var d={};d.rayPlane=function(t,r,a){n(a)||(a=new e);var o=t.origin,u=t.direction,s=r.normal,c=e.dot(s,u);if(!(Math.abs(c)<i.EPSILON15)){var l=(-r.distance-e.dot(s,o))/c;if(!(l<0))return a=e.multiplyByScalar(u,l,a),e.add(o,a,a)}};var p=new e,y=new e,m=new e,_=new e,T=new e;d.rayTriangleParametric=function(t,n,a,o,u){u=r(u,!1);var s,c,l,E,f,h=t.origin,d=t.direction,R=e.subtract(a,n,p),v=e.subtract(o,n,y),A=e.cross(d,v,m),N=e.dot(R,A);if(u){if(N<i.EPSILON6)return;if(s=e.subtract(h,n,_),l=e.dot(s,A),l<0||l>N)return;if(c=e.cross(s,R,T),E=e.dot(d,c),E<0||l+E>N)return;f=e.dot(v,c)/N}else{if(Math.abs(N)<i.EPSILON6)return;var S=1/N;if(s=e.subtract(h,n,_),l=e.dot(s,A)*S,l<0||l>1)return;if(c=e.cross(s,R,T),E=e.dot(d,c)*S,E<0||l+E>1)return;f=e.dot(v,c)*S}return f},d.rayTriangle=function(t,r,a,i,o,u){var s=d.rayTriangleParametric(t,r,a,i,o);if(n(s)&&!(s<0))return n(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var R=new c;d.lineSegmentTriangle=function(t,r,a,i,o,u,s){var c=R;e.clone(t,c.origin),e.subtract(r,t,c.direction),e.normalize(c.direction,c.direction);var l=d.rayTriangleParametric(c,a,i,o,u);if(!(!n(l)||l<0||l>e.distance(t,r)))return n(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var v={root0:0,root1:0};d.raySphere=function(e,t,r){if(r=E(e,t,r),n(r)&&!(r.stop<0))return r.start=Math.max(r.start,0),r};var A=new c;d.lineSegmentSphere=function(t,r,a,i){var o=A;e.clone(t,o.origin);var u=e.subtract(r,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),i=E(o,a,i),!(!n(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var N=new e,S=new e;d.rayEllipsoid=function(t,r){var n,a,i,o,u,s=r.oneOverRadii,c=e.multiplyComponents(s,t.origin,N),l=e.multiplyComponents(s,t.direction,S),E=e.magnitudeSquared(c),f=e.dot(c,l);if(E>1){if(f>=0)return;var h=f*f;if(n=E-1,a=e.magnitudeSquared(l),i=a*n,h<i)return;if(h>i){o=f*f-i,u=-f+Math.sqrt(o);var d=u/a,p=n/u;return d<p?{start:d,stop:p}:{start:p,stop:d}}var y=Math.sqrt(n/a);return{start:y,stop:y}}return E<1?(n=E-1,a=e.magnitudeSquared(l),i=a*n,o=f*f-i,u=-f+Math.sqrt(o),{start:0,stop:u/a}):f<0?(a=e.magnitudeSquared(l),{start:0,stop:-f/a}):void 0};var I=new e,g=new e,M=new e,x=new e,O=new e,w=new o,C=new o,L=new o,P=new o,U=new o,b=new o,F=new o,D=new e,B=new e,z=new t;d.grazingAltitudeLocation=function(t,r){var a=t.origin,u=t.direction;if(!e.equals(a,e.ZERO)){var s=r.geodeticSurfaceNormal(a,I);if(e.dot(u,s)>=0)return a}var c=n(this.rayEllipsoid(t,r)),l=r.transformPositionToScaledSpace(u,I),E=e.normalize(l,l),f=e.mostOrthogonalAxis(l,x),d=e.normalize(e.cross(f,E,g),g),p=e.normalize(e.cross(E,d,M),M),y=w;y[0]=E.x,y[1]=E.y,y[2]=E.z,y[3]=d.x,y[4]=d.y,y[5]=d.z,y[6]=p.x,y[7]=p.y,y[8]=p.z;var m=o.transpose(y,C),_=o.fromScale(r.radii,L),T=o.fromScale(r.oneOverRadii,P),R=U;R[0]=0,R[1]=-u.z,R[2]=u.y,R[3]=u.z,R[4]=0,R[5]=-u.x,R[6]=-u.y,R[7]=u.x,R[8]=0;var v,A,N=o.multiply(o.multiply(m,T,b),R,b),S=o.multiply(o.multiply(N,_,F),y,F),G=o.multiplyByVector(N,a,O),q=h(S,e.negate(G,I),0,0,1),V=q.length;if(V>0){for(var X=e.clone(e.ZERO,B),W=Number.NEGATIVE_INFINITY,H=0;H<V;++H){v=o.multiplyByVector(_,o.multiplyByVector(y,q[H],D),D);var Y=e.normalize(e.subtract(v,a,x),x),k=e.dot(Y,u);k>W&&(W=k,X=e.clone(v,X))}var Z=r.cartesianToCartographic(X,z);return W=i.clamp(W,0,1),A=e.magnitude(e.subtract(X,a,x))*Math.sqrt(1-W*W),A=c?-A:A,Z.height=A,r.cartographicToCartesian(Z,new e)}};var G=new e;return d.lineSegmentPlane=function(t,r,a,o){n(o)||(o=new e);var u=e.subtract(r,t,G),s=a.normal,c=e.dot(s,u);if(!(Math.abs(c)<i.EPSILON6)){var l=e.dot(s,t),E=-(a.distance+l)/c;if(!(E<0||E>1))return e.multiplyByScalar(u,E,o),e.add(t,o,o),o}},d.trianglePlaneIntersection=function(t,r,n,a){var i=a.normal,o=a.distance,u=e.dot(i,t)+o<0,s=e.dot(i,r)+o<0,c=e.dot(i,n)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var E,f;if(1!==l&&2!==l||(E=new e,f=new e),1===l){if(u)return d.lineSegmentPlane(t,r,a,E),d.lineSegmentPlane(t,n,a,f),{positions:[t,r,n,E,f],indices:[0,3,4,1,2,4,1,4,3]};if(s)return d.lineSegmentPlane(r,n,a,E),d.lineSegmentPlane(r,t,a,f),{positions:[t,r,n,E,f],indices:[1,3,4,2,0,4,2,4,3]};if(c)return d.lineSegmentPlane(n,t,a,E),d.lineSegmentPlane(n,r,a,f),{positions:[t,r,n,E,f],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return d.lineSegmentPlane(r,t,a,E),d.lineSegmentPlane(n,t,a,f),{positions:[t,r,n,E,f],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return d.lineSegmentPlane(n,r,a,E),d.lineSegmentPlane(t,r,a,f),{positions:[t,r,n,E,f],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return d.lineSegmentPlane(t,n,a,E),d.lineSegmentPlane(r,n,a,f),{positions:[t,r,n,E,f],indices:[0,1,4,0,4,3,2,3,4]}}},d}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,r,n){"use strict";function a(t,r){this.normal=e.clone(t),this.distance=r}a.fromPointNormal=function(r,n,i){var o=-e.dot(n,r);return t(i)?(e.clone(n,i.normal),i.distance=o,i):new a(n,o)};var i=new e;return a.fromCartesian4=function(r,n){var o=e.fromCartesian4(r,i),u=r.w;return t(n)?(e.clone(o,n.normal),n.distance=u,n):new a(o,u)},a.getPointDistance=function(t,r){return e.dot(t.normal,r)+t.distance},a.ORIGIN_XY_PLANE=n(new a(e.UNIT_Z,0)),a.ORIGIN_YZ_PLANE=n(new a(e.UNIT_X,0)),a.ORIGIN_ZX_PLANE=n(new a(e.UNIT_Y,0)),a}),define("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";var n={};return n.calculateACMR=function(r){r=e(r,e.EMPTY_OBJECT);var n=r.indices,a=r.maximumIndex,i=e(r.cacheSize,24),o=n.length;if(!t(a)){a=0;for(var u=0,s=n[u];u<o;)s>a&&(a=s),++u,s=n[u]}for(var c=[],l=0;l<a+1;l++)c[l]=0;for(var E=i+1,f=0;f<o;++f)E-c[n[f]]>i&&(c[n[f]]=E,++E);return(E-i+1)/(o/3)},n.tipsify=function(r){function n(e,t,r,n){for(;t.length>=1;){var a=t[t.length-1];if(t.splice(t.length-1,1),e[a].numLiveTriangles>0)return a}for(;i<n;){if(e[i].numLiveTriangles>0)return++i,i-1;++i}return-1}function a(e,t,r,a,i,o,u){for(var s,c=-1,l=-1,E=0;E<r.length;){var f=r[E];a[f].numLiveTriangles&&(s=0,i-a[f].timeStamp+2*a[f].numLiveTriangles<=t&&(s=i-a[f].timeStamp),(s>l||l===-1)&&(l=s,c=f)),++E}return c===-1?n(a,o,e,u):c}r=e(r,e.EMPTY_OBJECT);var i,o=r.indices,u=r.maximumIndex,s=e(r.cacheSize,24),c=o.length,l=0,E=0,f=o[E],h=c;if(t(u))l=u+1;else{for(;E<h;)f>l&&(l=f),++E,f=o[E];if(l===-1)return 0;++l}for(var d=[],p=0;p<l;p++)d[p]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};E=0;for(var y=0;E<h;)d[o[E]].vertexTriangles.push(y),++d[o[E]].numLiveTriangles,d[o[E+1]].vertexTriangles.push(y),++d[o[E+1]].numLiveTriangles,d[o[E+2]].vertexTriangles.push(y),++d[o[E+2]].numLiveTriangles,++y,E+=3;var m=0,_=s+1;i=1;var T,R,v=[],A=[],N=0,S=[],I=c/3,g=[];for(p=0;p<I;p++)g[p]=!1;for(var M,x;m!==-1;){v=[],R=d[m],x=R.vertexTriangles.length;for(var O=0;O<x;++O)if(y=R.vertexTriangles[O],!g[y]){g[y]=!0,E=y+y+y;for(var w=0;w<3;++w)M=o[E],v.push(M),A.push(M),S[N]=M,++N,T=d[M],--T.numLiveTriangles,_-T.timeStamp>s&&(T.timeStamp=_,++_),++E}m=a(o,s,v,d,_,A,l)}return S},n}),define("Core/GeometryPipeline",["./AttributeCompression","./barycentricCoordinates","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EncodedCartesian3","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryType","./IndexDatatype","./Intersect","./IntersectionTests","./Math","./Matrix3","./Matrix4","./Plane","./PrimitiveType","./Tipsify"],function(e,t,r,n,a,i,o,u,s,c,l,E,f,h,d,p,y,m,_,T,R,v,A,N,S){"use strict";function I(e,t,r,n,a){e[t++]=r,e[t++]=n,e[t++]=n,e[t++]=a,e[t++]=a,e[t]=r}function g(e){for(var t=e.length,r=t/3*6,n=y.createTypedArray(t,r),a=0,i=0;i<t;i+=3,a+=6)I(n,a,e[i],e[i+1],e[i+2]);return n}function M(e){var t=e.length;if(t>=3){var r=6*(t-2),n=y.createTypedArray(t,r);I(n,0,e[0],e[1],e[2]);for(var a=6,i=3;i<t;++i,a+=6)I(n,a,e[i-1],e[i],e[i-2]);return n}return new Uint16Array}function x(e){if(e.length>0){for(var t=e.length-1,r=6*(t-1),n=y.createTypedArray(t,r),a=e[0],i=0,o=1;o<t;++o,i+=6)I(n,i,a,e[o],e[o+1]);return n}return new Uint16Array}function O(e){var t={};for(var r in e)if(e.hasOwnProperty(r)&&c(e[r])&&c(e[r].values)){var n=e[r];t[r]=new d({componentDatatype:n.componentDatatype,componentsPerAttribute:n.componentsPerAttribute,normalize:n.normalize,values:[]})}return t}function w(e,t,r){for(var n in t)if(t.hasOwnProperty(n)&&c(t[n])&&c(t[n].values))for(var a=t[n],i=0;i<a.componentsPerAttribute;++i)e[n].values.push(a.values[r*a.componentsPerAttribute+i])}function C(e,t){if(c(t))for(var r=t.values,n=r.length,i=0;i<n;i+=3)a.unpack(r,i,ie),v.multiplyByPoint(e,ie,ie),a.pack(ie,r,i)}function L(e,t){if(c(t))for(var r=t.values,n=r.length,i=0;i<n;i+=3)a.unpack(r,i,ie),R.multiplyByVector(e,ie,ie),ie=a.normalize(ie,ie),a.pack(ie,r,i)}function P(e,t){var r,n=e.length,a={},i=e[0][t].attributes;for(r in i)if(i.hasOwnProperty(r)&&c(i[r])&&c(i[r].values)){for(var o=i[r],s=o.values.length,l=!0,E=1;E<n;++E){var f=e[E][t].attributes[r];if(!c(f)||o.componentDatatype!==f.componentDatatype||o.componentsPerAttribute!==f.componentsPerAttribute||o.normalize!==f.normalize){l=!1;break}s+=f.values.length}l&&(a[r]=new d({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:u.createTypedArray(o.componentDatatype,s)}))}return a}function U(e,t){var n,i,o,u,s,l,E,f=e.length,d=(e[0].modelMatrix,c(e[0][t].indices)),p=e[0][t].primitiveType,m=P(e,t);for(n in m)if(m.hasOwnProperty(n))for(s=m[n].values,u=0,i=0;i<f;++i)for(l=e[i][t].attributes[n].values,E=l.length,o=0;o<E;++o)s[u++]=l[o];var _;if(d){var T=0;for(i=0;i<f;++i)T+=e[i][t].indices.length;var R=h.computeNumberOfVertices(new h({attributes:m,primitiveType:N.POINTS})),v=y.createTypedArray(R,T),A=0,S=0;for(i=0;i<f;++i){var I=e[i][t].indices,g=I.length;for(u=0;u<g;++u)v[A++]=S+I[u];S+=h.computeNumberOfVertices(e[i][t])}_=v}var M,x=new a,O=0;for(i=0;i<f;++i){if(M=e[i][t].boundingSphere,!c(M)){x=void 0;break}a.add(M.center,x,x)}if(c(x))for(a.divideByScalar(x,f,x),i=0;i<f;++i){M=e[i][t].boundingSphere;var w=a.magnitude(a.subtract(M.center,x,se))+M.radius;w>O&&(O=w)}return new h({attributes:m,indices:_,primitiveType:p,boundingSphere:c(x)?new r(x,O):void 0})}function b(e){if(c(e.indices))return e;for(var t=h.computeNumberOfVertices(e),r=y.createTypedArray(t,t),n=0;n<t;++n)r[n]=n;return e.indices=r,e}function F(e){var t=h.computeNumberOfVertices(e),r=y.createTypedArray(t,3*(t-2));r[0]=1,r[1]=0,r[2]=2;for(var n=3,a=3;a<t;++a)r[n++]=a-1,r[n++]=0,r[n++]=a;return e.indices=r,e.primitiveType=N.TRIANGLES,e}function D(e){var t=h.computeNumberOfVertices(e),r=y.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,a=3;a<t-1;a+=2)r[n++]=a,r[n++]=a-1,r[n++]=a+1,a+2<t&&(r[n++]=a,r[n++]=a+1,r[n++]=a+2);return e.indices=r,e.primitiveType=N.TRIANGLES,e}function B(e){if(c(e.indices))return e;for(var t=h.computeNumberOfVertices(e),r=y.createTypedArray(t,t),n=0;n<t;++n)r[n]=n;return e.indices=r,e}function z(e){var t=h.computeNumberOfVertices(e),r=y.createTypedArray(t,2*(t-1));r[0]=0,r[1]=1;for(var n=2,a=2;a<t;++a)r[n++]=a-1,r[n++]=a;return e.indices=r,e.primitiveType=N.LINES,e}function G(e){var t=h.computeNumberOfVertices(e),r=y.createTypedArray(t,2*t);r[0]=0,r[1]=1;for(var n=2,a=2;a<t;++a)r[n++]=a-1,r[n++]=a;return r[n++]=t-1,r[n]=0,e.indices=r,e.primitiveType=N.LINES,e}function q(e){switch(e.primitiveType){case N.TRIANGLE_FAN:return F(e);case N.TRIANGLE_STRIP:return D(e);case N.TRIANGLES:return b(e);case N.LINE_STRIP:return z(e);case N.LINE_LOOP:return G(e);case N.LINES:return B(e)}return e}function V(e,t){Math.abs(e.y)<T.EPSILON6&&(t?e.y=-T.EPSILON6:e.y=T.EPSILON6)}function X(e,t,r){if(0!==e.y&&0!==t.y&&0!==r.y)return V(e,e.y<0),V(t,t.y<0),void V(r,r.y<0);var n,a=Math.abs(e.y),i=Math.abs(t.y),o=Math.abs(r.y);n=a>i?a>o?T.sign(e.y):T.sign(r.y):i>o?T.sign(t.y):T.sign(r.y);var u=n<0;V(e,u),V(t,u),V(r,u)}function W(e,t,r,n){a.add(e,a.multiplyByScalar(a.subtract(t,e,Re),e.y/(e.y-t.y),Re),r),a.clone(r,n),V(r,!0),V(n,!1)}function H(e,t,r){if(!(e.x>=0||t.x>=0||r.x>=0)){X(e,t,r);var n=e.y<0,a=t.y<0,i=r.y<0,o=0;o+=n?1:0,o+=a?1:0,o+=i?1:0;var u=Ie.indices;1===o?(u[1]=3,u[2]=4,u[5]=6,u[7]=6,u[8]=5,n?(W(e,t,ve,Ne),W(e,r,Ae,Se),u[0]=0,u[3]=1,u[4]=2,u[6]=1):a?(W(t,r,ve,Ne),W(t,e,Ae,Se),u[0]=1,u[3]=2,u[4]=0,u[6]=2):i&&(W(r,e,ve,Ne),W(r,t,Ae,Se),u[0]=2,u[3]=0,u[4]=1,u[6]=0)):2===o&&(u[2]=4,u[4]=4,u[5]=3,u[7]=5,u[8]=6,n?a?i||(W(r,e,ve,Ne),W(r,t,Ae,Se),u[0]=0,u[1]=1,u[3]=0,u[6]=2):(W(t,r,ve,Ne),W(t,e,Ae,Se),u[0]=2,u[1]=0,u[3]=2,u[6]=1):(W(e,t,ve,Ne),W(e,r,Ae,Se),u[0]=1,u[1]=2,u[3]=1,u[6]=0));var s=Ie.positions;return s[0]=e,s[1]=t,s[2]=r,s.length=3,1!==o&&2!==o||(s[3]=ve,s[4]=Ae,s[5]=Ne,s[6]=Se,s.length=7),Ie}}function Y(e,t){var n=e.attributes;if(0!==n.position.values.length){for(var a in n)if(n.hasOwnProperty(a)&&c(n[a])&&c(n[a].values)){var i=n[a];i.values=u.createTypedArray(i.componentDatatype,i.values)}var o=h.computeNumberOfVertices(e);return e.indices=y.createTypedArray(o,e.indices),t&&(e.boundingSphere=r.fromVertices(n.position.values)),e}}function k(e){var t=e.attributes,r={};for(var n in t)if(t.hasOwnProperty(n)&&c(t[n])&&c(t[n].values)){var a=t[n];r[n]=new d({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:[]})}return new h({attributes:r,indices:[],primitiveType:e.primitiveType})}function Z(e,t,r){var n=c(e.geometry.boundingSphere);t=Y(t,n),r=Y(r,n),c(r)&&!c(t)?e.geometry=r:!c(r)&&c(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=r,e.geometry=void 0)}function K(e,r,i,o,u,s,l,E,f,h,d){if(c(s)||c(l)||c(E)||c(f)){var p=a.fromArray(u,3*e,ge),y=a.fromArray(u,3*r,Me),m=a.fromArray(u,3*i,xe),_=t(o,p,y,m,Oe);if(c(s)){var T=a.fromArray(s,3*e,ge),R=a.fromArray(s,3*r,Me),v=a.fromArray(s,3*i,xe);a.multiplyByScalar(T,_.x,T),a.multiplyByScalar(R,_.y,R),a.multiplyByScalar(v,_.z,v);var A=a.add(T,R,T);a.add(A,v,A),a.normalize(A,A),a.pack(A,h.normal.values,3*d)}if(c(l)){var N=a.fromArray(l,3*e,ge),S=a.fromArray(l,3*r,Me),I=a.fromArray(l,3*i,xe);a.multiplyByScalar(N,_.x,N),a.multiplyByScalar(S,_.y,S),a.multiplyByScalar(I,_.z,I);var g=a.add(N,S,N);a.add(g,I,g),a.normalize(g,g),a.pack(g,h.binormal.values,3*d)}if(c(E)){var M=a.fromArray(E,3*e,ge),x=a.fromArray(E,3*r,Me),O=a.fromArray(E,3*i,xe);a.multiplyByScalar(M,_.x,M),a.multiplyByScalar(x,_.y,x),a.multiplyByScalar(O,_.z,O);var w=a.add(M,x,M);a.add(w,O,w),a.normalize(w,w),a.pack(w,h.tangent.values,3*d)}if(c(f)){var C=n.fromArray(f,2*e,we),L=n.fromArray(f,2*r,Ce),P=n.fromArray(f,2*i,Le);n.multiplyByScalar(C,_.x,C),n.multiplyByScalar(L,_.y,L),n.multiplyByScalar(P,_.z,P);var U=n.add(C,L,C);n.add(U,P,U),n.pack(U,h.st.values,2*d)}}}function j(e,t,r,n,a,i){var o=e.position.values.length/3;if(a!==-1){var u=n[a],s=r[u];return s===-1?(r[u]=o,e.position.values.push(i.x,i.y,i.z),t.push(o),o):(t.push(s),s)}return e.position.values.push(i.x,i.y,i.z),t.push(o),o}function Q(e){var t,r,n,i,o,u=e.geometry,s=u.attributes,l=s.position.values,E=c(s.normal)?s.normal.values:void 0,f=c(s.binormal)?s.binormal.values:void 0,h=c(s.tangent)?s.tangent.values:void 0,d=c(s.st)?s.st.values:void 0,p=u.indices,y=k(u),m=k(u),_=[];_.length=l.length/3;var T=[];for(T.length=l.length/3,o=0;o<_.length;++o)_[o]=-1,T[o]=-1;var R=p.length;for(o=0;o<R;o+=3){var v=p[o],A=p[o+1],N=p[o+2],S=a.fromArray(l,3*v),I=a.fromArray(l,3*A),g=a.fromArray(l,3*N),M=H(S,I,g);if(c(M)&&M.positions.length>3)for(var x=M.positions,O=M.indices,w=O.length,C=0;C<w;++C){var L=O[C],P=x[L];P.y<0?(t=m.attributes,r=m.indices,n=_):(t=y.attributes,r=y.indices,n=T),i=j(t,r,n,p,L<3?o+L:-1,P),K(v,A,N,P,l,E,f,h,d,t,i)}else c(M)&&(S=M.positions[0],I=M.positions[1],g=M.positions[2]),S.y<0?(t=m.attributes,r=m.indices,n=_):(t=y.attributes,r=y.indices,n=T),i=j(t,r,n,p,o,S),K(v,A,N,S,l,E,f,h,d,t,i),i=j(t,r,n,p,o+1,I),K(v,A,N,I,l,E,f,h,d,t,i),i=j(t,r,n,p,o+2,g),K(v,A,N,g,l,E,f,h,d,t,i)}Z(e,m,y)}function J(e){var t,r=e.geometry,n=r.attributes,i=n.position.values,o=r.indices,u=k(r),s=k(r),l=o.length,E=[];E.length=i.length/3;var f=[];for(f.length=i.length/3,t=0;t<E.length;++t)E[t]=-1,f[t]=-1;for(t=0;t<l;t+=2){var h=o[t],d=o[t+1],p=a.fromArray(i,3*h,ge),y=a.fromArray(i,3*d,Me);Math.abs(p.y)<T.EPSILON6&&(p.y<0?p.y=-T.EPSILON6:p.y=T.EPSILON6),Math.abs(y.y)<T.EPSILON6&&(y.y<0?y.y=-T.EPSILON6:y.y=T.EPSILON6);var m=u.attributes,R=u.indices,v=f,A=s.attributes,N=s.indices,S=E,I=_.lineSegmentPlane(p,y,Pe,xe);if(c(I)){var g=a.multiplyByScalar(a.UNIT_Y,5*T.EPSILON9,Ue);p.y<0&&(a.negate(g,g),m=s.attributes,R=s.indices,v=E,A=u.attributes,N=u.indices,S=f);var M=a.add(I,g,be);j(m,R,v,o,t,p),j(m,R,v,o,-1,M),a.negate(g,g),a.add(I,g,M),j(A,N,S,o,-1,M),j(A,N,S,o,t+1,y)}else{var x,O,w;p.y<0?(x=s.attributes,O=s.indices,w=E):(x=u.attributes,O=u.indices,w=f),j(x,O,w,o,t,p),j(x,O,w,o,t+1,y)}}Z(e,s,u)}function $(e){for(var t=e.attributes,r=t.position.values,n=t.prevPosition.values,i=t.nextPosition.values,o=r.length,u=0;u<o;u+=3){var s=a.unpack(r,u,Be);if(!(s.x>0)){var c=a.unpack(n,u,ze);(s.y<0&&c.y>0||s.y>0&&c.y<0)&&(u-3>0?(n[u]=r[u-3],n[u+1]=r[u-2],n[u+2]=r[u-1]):a.pack(s,n,u));var l=a.unpack(i,u,Ge);(s.y<0&&l.y>0||s.y>0&&l.y<0)&&(u+3<o?(i[u]=r[u+3],i[u+1]=r[u+4],i[u+2]=r[u+5]):a.pack(s,i,u))}}}function ee(e){var t,r,o,u=e.geometry,s=u.attributes,l=s.position.values,E=s.prevPosition.values,f=s.nextPosition.values,h=s.expandAndWidth.values,d=c(s.st)?s.st.values:void 0,p=c(s.color)?s.color.values:void 0,y=k(u),m=k(u),R=!1,v=l.length/3;for(t=0;t<v;t+=4){var A=t,N=t+2,S=a.fromArray(l,3*A,Be),I=a.fromArray(l,3*N,ze);if(Math.abs(S.y)<Ye)for(S.y=Ye*(I.y<0?-1:1),l[3*t+1]=S.y,l[3*(t+1)+1]=S.y,r=3*A;r<3*A+12;r+=3)E[r]=l[3*t],E[r+1]=l[3*t+1],E[r+2]=l[3*t+2];if(Math.abs(I.y)<Ye)for(I.y=Ye*(S.y<0?-1:1),l[3*(t+2)+1]=I.y,l[3*(t+3)+1]=I.y,r=3*A;r<3*A+12;r+=3)f[r]=l[3*(t+2)],f[r+1]=l[3*(t+2)+1],f[r+2]=l[3*(t+2)+2];var g=y.attributes,M=y.indices,x=m.attributes,O=m.indices,w=_.lineSegmentPlane(S,I,Pe,qe);if(c(w)){R=!0;var C=a.multiplyByScalar(a.UNIT_Y,He,Ve);S.y<0&&(a.negate(C,C),g=m.attributes,M=m.indices,x=y.attributes,O=y.indices);var L=a.add(w,C,Xe);g.position.values.push(S.x,S.y,S.z,S.x,S.y,S.z),g.position.values.push(L.x,L.y,L.z),g.position.values.push(L.x,L.y,L.z),g.prevPosition.values.push(E[3*A],E[3*A+1],E[3*A+2]),g.prevPosition.values.push(E[3*A+3],E[3*A+4],E[3*A+5]),g.prevPosition.values.push(S.x,S.y,S.z,S.x,S.y,S.z),g.nextPosition.values.push(L.x,L.y,L.z),g.nextPosition.values.push(L.x,L.y,L.z),g.nextPosition.values.push(L.x,L.y,L.z),g.nextPosition.values.push(L.x,L.y,L.z),a.negate(C,C),a.add(w,C,L),x.position.values.push(L.x,L.y,L.z),x.position.values.push(L.x,L.y,L.z),x.position.values.push(I.x,I.y,I.z,I.x,I.y,I.z),x.prevPosition.values.push(L.x,L.y,L.z),x.prevPosition.values.push(L.x,L.y,L.z),x.prevPosition.values.push(L.x,L.y,L.z),x.prevPosition.values.push(L.x,L.y,L.z),x.nextPosition.values.push(I.x,I.y,I.z,I.x,I.y,I.z),x.nextPosition.values.push(f[3*N],f[3*N+1],f[3*N+2]),x.nextPosition.values.push(f[3*N+3],f[3*N+4],f[3*N+5]);var P=n.fromArray(h,2*A,Fe),U=Math.abs(P.y);g.expandAndWidth.values.push(-1,U,1,U),g.expandAndWidth.values.push(-1,-U,1,-U),x.expandAndWidth.values.push(-1,U,1,U),x.expandAndWidth.values.push(-1,-U,1,-U);var b=a.magnitudeSquared(a.subtract(w,S,Ge));if(b/=a.magnitudeSquared(a.subtract(I,S,Ge)),c(p)){var F=i.fromArray(p,4*A,We),D=i.fromArray(p,4*N,We),B=T.lerp(F.x,D.x,b),z=T.lerp(F.y,D.y,b),G=T.lerp(F.z,D.z,b),q=T.lerp(F.w,D.w,b);for(r=4*A;r<4*A+8;++r)g.color.values.push(p[r]);for(g.color.values.push(B,z,G,q),g.color.values.push(B,z,G,q),x.color.values.push(B,z,G,q),x.color.values.push(B,z,G,q),r=4*N;r<4*N+8;++r)x.color.values.push(p[r])}if(c(d)){var V=n.fromArray(d,2*A,Fe),X=n.fromArray(d,2*(t+3),De),W=T.lerp(V.x,X.x,b);for(r=2*A;r<2*A+4;++r)g.st.values.push(d[r]);for(g.st.values.push(W,V.y),g.st.values.push(W,X.y),x.st.values.push(W,V.y),x.st.values.push(W,X.y),r=2*N;r<2*N+4;++r)x.st.values.push(d[r])}o=g.position.values.length/3-4,M.push(o,o+2,o+1),M.push(o+1,o+2,o+3),o=x.position.values.length/3-4,O.push(o,o+2,o+1),O.push(o+1,o+2,o+3)}else{var H,Y;for(S.y<0?(H=m.attributes,Y=m.indices):(H=y.attributes,Y=y.indices),H.position.values.push(S.x,S.y,S.z),H.position.values.push(S.x,S.y,S.z),H.position.values.push(I.x,I.y,I.z),H.position.values.push(I.x,I.y,I.z),r=3*t;r<3*t+12;++r)H.prevPosition.values.push(E[r]),H.nextPosition.values.push(f[r]);for(r=2*t;r<2*t+8;++r)H.expandAndWidth.values.push(h[r]),c(d)&&H.st.values.push(d[r]);if(c(p))for(r=4*t;r<4*t+16;++r)H.color.values.push(p[r]);o=H.position.values.length/3-4,Y.push(o,o+2,o+1),Y.push(o+1,o+2,o+3)}}R&&($(m),$(y)),Z(e,m,y)}var te={};te.toWireframe=function(e){var t=e.indices;if(c(t)){switch(e.primitiveType){case N.TRIANGLES:e.indices=g(t);break;case N.TRIANGLE_STRIP:e.indices=M(t);break;case N.TRIANGLE_FAN:e.indices=x(t)}e.primitiveType=N.LINES}return e},te.createLineSegmentsForVectors=function(e,t,n){t=s(t,"normal"),n=s(n,1e4);for(var a=e.attributes.position.values,i=e.attributes[t].values,o=a.length,l=new Float64Array(2*o),E=0,f=0;f<o;f+=3)l[E++]=a[f],l[E++]=a[f+1],l[E++]=a[f+2],l[E++]=a[f]+i[f]*n,l[E++]=a[f+1]+i[f+1]*n,l[E++]=a[f+2]+i[f+2]*n;var p,y=e.boundingSphere;return c(y)&&(p=new r(y.center,y.radius+n)),new h({attributes:{position:new d({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:N.LINES,boundingSphere:p})},te.createAttributeLocations=function(e){var t,r=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","binormal","tangent","compressedAttributes"],n=e.attributes,a={},i=0,o=r.length;for(t=0;t<o;++t){var u=r[t];c(n[u])&&(a[u]=i++)}for(var s in n)n.hasOwnProperty(s)&&!c(a[s])&&(a[s]=i++);return a},te.reorderForPreVertexCache=function(e){var t=h.computeNumberOfVertices(e),r=e.indices;if(c(r)){for(var n=new Int32Array(t),a=0;a<t;a++)n[a]=-1;for(var i,o=r,s=o.length,l=y.createTypedArray(t,s),E=0,f=0,d=0;E<s;)i=n[o[E]],i!==-1?l[f]=i:(i=o[E],n[i]=d,l[f]=d,++d),++E,++f;e.indices=l;var p=e.attributes;for(var m in p)if(p.hasOwnProperty(m)&&c(p[m])&&c(p[m].values)){for(var _=p[m],T=_.values,R=0,v=_.componentsPerAttribute,A=u.createTypedArray(_.componentDatatype,d*v);R<t;){var N=n[R];if(N!==-1)for(a=0;a<v;a++)A[v*N+a]=T[v*R+a];++R}_.values=A}}return e},te.reorderForPostVertexCache=function(e,t){var r=e.indices;if(e.primitiveType===N.TRIANGLES&&c(r)){for(var n=r.length,a=0,i=0;i<n;i++)r[i]>a&&(a=r[i]);e.indices=S.tipsify({indices:r,maximumIndex:a,cacheSize:t})}return e},te.fitToUnsignedShortIndices=function(e){var t=[],r=h.computeNumberOfVertices(e);if(c(e.indices)&&r>=T.SIXTY_FOUR_KILOBYTES){var n,a=[],i=[],o=0,u=O(e.attributes),s=e.indices,l=s.length;e.primitiveType===N.TRIANGLES?n=3:e.primitiveType===N.LINES?n=2:e.primitiveType===N.POINTS&&(n=1);for(var E=0;E<l;E+=n){for(var f=0;f<n;++f){var d=s[E+f],p=a[d];c(p)||(p=o++,a[d]=p,w(u,e.attributes,d)),i.push(p)}o+n>=T.SIXTY_FOUR_KILOBYTES&&(t.push(new h({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),a=[],i=[],o=0,u=O(e.attributes))}0!==i.length&&t.push(new h({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var re=new a,ne=new o;te.projectTo2D=function(e,t,r,n,i){var o=e.attributes[t];i=c(i)?i:new f;for(var s=i.ellipsoid,l=o.values,E=new Float64Array(l.length),h=0,p=0;p<l.length;p+=3){var y=a.fromArray(l,p,re),m=s.cartesianToCartographic(y,ne),_=i.project(m,re);E[h++]=_.x,E[h++]=_.y,E[h++]=_.z}return e.attributes[r]=o,e.attributes[n]=new d({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:E}),delete e.attributes[t],e};var ae={high:0,low:0};te.encodeAttribute=function(e,t,r,n){for(var a=e.attributes[t],i=a.values,o=i.length,s=new Float32Array(o),c=new Float32Array(o),l=0;l<o;++l)E.encode(i[l],ae),s[l]=ae.high,c[l]=ae.low;var f=a.componentsPerAttribute;return e.attributes[r]=new d({componentDatatype:u.FLOAT,componentsPerAttribute:f,values:s}),e.attributes[n]=new d({componentDatatype:u.FLOAT,componentsPerAttribute:f,values:c}),delete e.attributes[t],e};var ie=new a,oe=new v,ue=new R;te.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(v.equals(t,v.IDENTITY))return e;var n=e.geometry.attributes;C(t,n.position),C(t,n.prevPosition),C(t,n.nextPosition),(c(n.normal)||c(n.binormal)||c(n.tangent))&&(v.inverse(t,oe),v.transpose(oe,oe),v.getRotation(oe,ue),L(ue,n.normal),L(ue,n.binormal),L(ue,n.tangent));var a=e.geometry.boundingSphere;return c(a)&&(e.geometry.boundingSphere=r.transform(a,t,a)),e.modelMatrix=v.clone(v.IDENTITY),e};var se=new a;te.combineInstances=function(e){for(var t=[],r=[],n=e.length,a=0;a<n;++a){var i=e[a];c(i.geometry)?t.push(i):c(i.westHemisphereGeometry)&&c(i.eastHemisphereGeometry)&&r.push(i)}var o=[];return t.length>0&&o.push(U(t,"geometry")),r.length>0&&(o.push(U(r,"westHemisphereGeometry")),o.push(U(r,"eastHemisphereGeometry"))),o};var ce=new a,le=new a,Ee=new a,fe=new a;te.computeNormal=function(e){for(var t=e.indices,r=e.attributes,n=r.position.values,i=r.position.values.length/3,o=t.length,s=new Array(i),c=new Array(o/3),l=new Array(o),E=0;E<i;E++)s[E]={indexOffset:0,count:0,currentCount:0};var f=0;for(E=0;E<o;E+=3){var h=t[E],p=t[E+1],y=t[E+2],m=3*h,_=3*p,T=3*y;le.x=n[m],le.y=n[m+1],le.z=n[m+2],Ee.x=n[_],Ee.y=n[_+1],Ee.z=n[_+2],fe.x=n[T],fe.y=n[T+1],fe.z=n[T+2],s[h].count++,s[p].count++,s[y].count++,a.subtract(Ee,le,Ee),a.subtract(fe,le,fe),c[f]=a.cross(Ee,fe,new a),f++}var R=0;for(E=0;E<i;E++)s[E].indexOffset+=R,R+=s[E].count;f=0;var v;for(E=0;E<o;E+=3){v=s[t[E]];var A=v.indexOffset+v.currentCount;l[A]=f,v.currentCount++,v=s[t[E+1]],A=v.indexOffset+v.currentCount,l[A]=f,v.currentCount++,v=s[t[E+2]],A=v.indexOffset+v.currentCount,l[A]=f,v.currentCount++,f++}var N=new Float32Array(3*i);for(E=0;E<i;E++){var S=3*E;if(v=s[E],v.count>0){for(a.clone(a.ZERO,ce),f=0;f<v.count;f++)a.add(ce,c[l[v.indexOffset+f]],ce);a.normalize(ce,ce),N[S]=ce.x,N[S+1]=ce.y,N[S+2]=ce.z}else N[S]=0,N[S+1]=0,N[S+2]=1}return e.attributes.normal=new d({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:N}),e};var he=new a,de=new a,pe=new a;te.computeBinormalAndTangent=function(e){for(var t=(e.attributes,e.indices),r=e.attributes.position.values,n=e.attributes.normal.values,i=e.attributes.st.values,o=e.attributes.position.values.length/3,s=t.length,c=new Array(3*o),l=0;l<c.length;l++)c[l]=0;var E,f,h;for(l=0;l<s;l+=3){var p=t[l],y=t[l+1],m=t[l+2];E=3*p,f=3*y,h=3*m;var _=2*p,T=2*y,R=2*m,v=r[E],A=r[E+1],N=r[E+2],S=i[_],I=i[_+1],g=i[T+1]-I,M=i[R+1]-I,x=1/((i[T]-S)*M-(i[R]-S)*g),O=(M*(r[f]-v)-g*(r[h]-v))*x,w=(M*(r[f+1]-A)-g*(r[h+1]-A))*x,C=(M*(r[f+2]-N)-g*(r[h+2]-N))*x;c[E]+=O,c[E+1]+=w,c[E+2]+=C,c[f]+=O,c[f+1]+=w,c[f+2]+=C,c[h]+=O,c[h+1]+=w,c[h+2]+=C}var L=new Float32Array(3*o),P=new Float32Array(3*o);for(l=0;l<o;l++){E=3*l,f=E+1,h=E+2;var U=a.fromArray(n,E,he),b=a.fromArray(c,E,pe),F=a.dot(U,b);a.multiplyByScalar(U,F,de),a.normalize(a.subtract(b,de,b),b),P[E]=b.x,P[f]=b.y,P[h]=b.z,a.normalize(a.cross(U,b,b),b),L[E]=b.x,L[f]=b.y,L[h]=b.z}return e.attributes.tangent=new d({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:P}),e.attributes.binormal=new d({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:L}),e};var ye=new n,me=new a,_e=new a,Te=new a;te.compressVertices=function(t){var r=t.attributes.normal,i=t.attributes.st;if(!c(r)&&!c(i))return t;var o,s,l,E,f=t.attributes.tangent,h=t.attributes.binormal;c(r)&&(o=r.values),c(i)&&(s=i.values),c(f)&&(l=f.values),h&&(E=h.values);var p=c(o)?o.length:s.length,y=c(o)?3:2,m=p/y,_=m,T=c(s)&&c(o)?2:1;T+=c(l)||c(E)?1:0,_*=T;for(var R=new Float32Array(_),v=0,A=0;A<m;++A){c(s)&&(n.fromArray(s,2*A,ye),R[v++]=e.compressTextureCoordinates(ye));var N=3*A;c(o)&&c(l)&&c(E)?(a.fromArray(o,N,me),a.fromArray(l,N,_e),a.fromArray(E,N,Te),e.octPack(me,_e,Te,ye),R[v++]=ye.x,R[v++]=ye.y):(c(o)&&(a.fromArray(o,N,me),R[v++]=e.octEncodeFloat(me)),c(l)&&(a.fromArray(l,N,me),R[v++]=e.octEncodeFloat(me)),c(E)&&(a.fromArray(E,N,me),R[v++]=e.octEncodeFloat(me)))}return t.attributes.compressedAttributes=new d({componentDatatype:u.FLOAT,componentsPerAttribute:T,values:R}),c(o)&&delete t.attributes.normal,c(s)&&delete t.attributes.st,c(l)&&delete t.attributes.tangent,c(E)&&delete t.attributes.binormal,t};var Re=new a,ve=new a,Ae=new a,Ne=new a,Se=new a,Ie={positions:new Array(7),indices:new Array(9)},ge=new a,Me=new a,xe=new a,Oe=new a,we=new n,Ce=new n,Le=new n,Pe=A.fromPointNormal(a.ZERO,a.UNIT_Y),Ue=new a,be=new a,Fe=new n,De=new n,Be=new a,ze=new a,Ge=new a,qe=new a,Ve=new a,Xe=new a,We=new i,He=5*T.EPSILON9,Ye=T.EPSILON6;return te.splitLongitude=function(e){var t=e.geometry,n=t.boundingSphere;if(c(n)){var a=n.center.x-n.radius;if(a>0||r.intersectPlane(n,A.ORIGIN_ZX_PLANE)!==m.INTERSECTING)return e}if(t.geometryType!==p.NONE)switch(t.geometryType){case p.POLYLINES:ee(e);break;case p.TRIANGLES:Q(e);break;case p.LINES:J(e)}else q(t),t.primitiveType===N.TRIANGLES?Q(e):t.primitiveType===N.LINES&&J(e);return e},te}),define("Core/Matrix2",["./Cartesian2","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject"],function(e,t,r,n,a,i){"use strict";function o(e,r,n,a){this[0]=t(e,0),this[1]=t(n,0),this[2]=t(r,0),this[3]=t(a,0)}o.packedLength=4,o.pack=function(e,r,n){return n=t(n,0),r[n++]=e[0],r[n++]=e[1],r[n++]=e[2],r[n++]=e[3],r},o.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new o),a[0]=e[n++],a[1]=e[n++],a[2]=e[n++],a[3]=e[n++],a},o.clone=function(e,t){if(r(e))return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new o(e[0],e[2],e[1],e[3])},o.fromArray=function(e,n,a){return n=t(n,0),r(a)||(a=new o),a[0]=e[n],a[1]=e[n+1],a[2]=e[n+2],a[3]=e[n+3],a},o.fromColumnMajorArray=function(e,t){return o.clone(e,t)},o.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new o(e[0],e[1],e[2],e[3])},o.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new o(e.x,0,0,e.y)},o.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new o(e,0,0,e)},o.fromRotation=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=a,t[2]=-a,t[3]=n,t):new o(n,-a,a,n)},o.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):[e[0],e[1],e[2],e[3]]},o.getElementIndex=function(e,t){return 2*e+t},o.getColumn=function(e,t,r){var n=2*t,a=e[n],i=e[n+1];return r.x=a,r.y=i,r},o.setColumn=function(e,t,r,n){n=o.clone(e,n);var a=2*t;return n[a]=r.x,n[a+1]=r.y,n},o.getRow=function(e,t,r){var n=e[t],a=e[t+2];return r.x=n,r.y=a,r},o.setRow=function(e,t,r,n){return n=o.clone(e,n),n[t]=r.x,n[t+2]=r.y,n};var u=new e;o.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],u)),r.y=e.magnitude(e.fromElements(t[2],t[3],u)),r};var s=new e;return o.getMaximumScale=function(t){return o.getScale(t,s),e.maximumComponent(s)},o.multiply=function(e,t,r){var n=e[0]*t[0]+e[2]*t[1],a=e[0]*t[2]+e[2]*t[3],i=e[1]*t[0]+e[3]*t[1],o=e[1]*t[2]+e[3]*t[3];return r[0]=n,r[1]=i,r[2]=a,r[3]=o,r},o.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},o.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},o.multiplyByVector=function(e,t,r){var n=e[0]*t.x+e[2]*t.y,a=e[1]*t.x+e[3]*t.y;return r.x=n,r.y=a,r},o.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},o.multiplyByScale=function(e,t,r){return r[0]=e[0]*t.x,r[1]=e[1]*t.x,r[2]=e[2]*t.y,r[3]=e[3]*t.y,r},o.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},o.transpose=function(e,t){var r=e[0],n=e[2],a=e[1],i=e[3];return t[0]=r,t[1]=n,t[2]=a,t[3]=i,t},o.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},o.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]},o.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]},o.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},o.IDENTITY=i(new o(1,0,0,1)),o.ZERO=i(new o(0,0,0,0)),o.COLUMN0ROW0=0,o.COLUMN0ROW1=1,o.COLUMN1ROW0=2,o.COLUMN1ROW1=3,n(o.prototype,{length:{get:function(){return o.packedLength}}}),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[0]+", "+this[2]+")\n("+this[1]+", "+this[3]+")"},o}),define("ThirdParty/earcut-2.1.1",[],function(){"use strict";function e(e,r,a){a=a||2;var i=r&&r.length,o=i?r[0]*a:e.length,u=t(e,0,o,a,!0),c=[];if(!u)return c;var l,E,f,h,d,p,y;if(i&&(u=s(e,r,u,a)),e.length>80*a){l=f=e[0],E=h=e[1];for(var m=a;m<o;m+=a)d=e[m],p=e[m+1],d<l&&(l=d),p<E&&(E=p),d>f&&(f=d),p>h&&(h=p);y=Math.max(f-l,h-E)}return n(u,c,a,l,E,y),c}function t(e,t,r,n,a){var i,o;if(a===x(e,t,r,n)>0)for(i=t;i<r;i+=n)o=I(i,e[i],e[i+1],o);else for(i=r-n;i>=t;i-=n)o=I(i,e[i],e[i+1],o);return o&&T(o,o.next)&&(g(o),o=o.next),o}function r(e,t){if(!e)return e;t||(t=e);var r,n=e;do if(r=!1,n.steiner||!T(n,n.next)&&0!==_(n.prev,n,n.next))n=n.next;else{if(g(n),n=t=n.prev,n===n.next)return null;r=!0}while(r||n!==t);return t}function n(e,t,s,c,l,E,h){if(e){!h&&E&&f(e,c,l,E);for(var d,p,y=e;e.prev!==e.next;)if(d=e.prev,p=e.next,E?i(e,c,l,E):a(e))t.push(d.i/s),t.push(e.i/s),t.push(p.i/s),g(e),e=p.next,y=p.next;else if(e=p,e===y){h?1===h?(e=o(e,t,s),n(e,t,s,c,l,E,2)):2===h&&u(e,t,s,c,l,E):n(r(e),t,s,c,l,E,1);break}}}function a(e){var t=e.prev,r=e,n=e.next;if(_(t,r,n)>=0)return!1;for(var a=e.next.next;a!==e.prev;){if(y(t.x,t.y,r.x,r.y,n.x,n.y,a.x,a.y)&&_(a.prev,a,a.next)>=0)return!1;a=a.next}return!0}function i(e,t,r,n){var a=e.prev,i=e,o=e.next;if(_(a,i,o)>=0)return!1;for(var u=a.x<i.x?a.x<o.x?a.x:o.x:i.x<o.x?i.x:o.x,s=a.y<i.y?a.y<o.y?a.y:o.y:i.y<o.y?i.y:o.y,c=a.x>i.x?a.x>o.x?a.x:o.x:i.x>o.x?i.x:o.x,l=a.y>i.y?a.y>o.y?a.y:o.y:i.y>o.y?i.y:o.y,E=d(u,s,t,r,n),f=d(c,l,t,r,n),h=e.nextZ;h&&h.z<=f;){if(h!==e.prev&&h!==e.next&&y(a.x,a.y,i.x,i.y,o.x,o.y,h.x,h.y)&&_(h.prev,h,h.next)>=0)return!1;h=h.nextZ}for(h=e.prevZ;h&&h.z>=E;){if(h!==e.prev&&h!==e.next&&y(a.x,a.y,i.x,i.y,o.x,o.y,h.x,h.y)&&_(h.prev,h,h.next)>=0)return!1;h=h.prevZ}return!0}function o(e,t,r){var n=e;do{var a=n.prev,i=n.next.next;!T(a,i)&&R(a,n,n.next,i)&&A(a,i)&&A(i,a)&&(t.push(a.i/r),t.push(n.i/r),t.push(i.i/r),g(n),g(n.next),n=e=i),n=n.next}while(n!==e);return n}function u(e,t,a,i,o,u){var s=e;do{for(var c=s.next.next;c!==s.prev;){if(s.i!==c.i&&m(s,c)){var l=S(s,c);return s=r(s,s.next),l=r(l,l.next),n(s,t,a,i,o,u),void n(l,t,a,i,o,u)}c=c.next}s=s.next}while(s!==e)}function s(e,n,a,i){var o,u,s,E,f,h=[];for(o=0,u=n.length;o<u;o++)s=n[o]*i,E=o<u-1?n[o+1]*i:e.length,f=t(e,s,E,i,!1),f===f.next&&(f.steiner=!0),h.push(p(f));for(h.sort(c),o=0;o<h.length;o++)l(h[o],a),a=r(a,a.next);return a}function c(e,t){return e.x-t.x}function l(e,t){if(t=E(e,t)){var n=S(t,e);r(n,n.next)}}function E(e,t){var r,n=t,a=e.x,i=e.y,o=-(1/0);do{if(i<=n.y&&i>=n.next.y){var u=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(u<=a&&u>o){if(o=u,u===a){if(i===n.y)return n;if(i===n.next.y)return n.next}r=n.x<n.next.x?n:n.next}}n=n.next}while(n!==t);if(!r)return null;if(a===o)return r.prev;var s,c=r,l=r.x,E=r.y,f=1/0;for(n=r.next;n!==c;)a>=n.x&&n.x>=l&&y(i<E?a:o,i,l,E,i<E?o:a,i,n.x,n.y)&&(s=Math.abs(i-n.y)/(a-n.x),(s<f||s===f&&n.x>r.x)&&A(n,e)&&(r=n,f=s)),n=n.next;return r}function f(e,t,r,n){var a=e;do null===a.z&&(a.z=d(a.x,a.y,t,r,n)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next;while(a!==e);a.prevZ.nextZ=null,a.prevZ=null,h(a)}function h(e){var t,r,n,a,i,o,u,s,c=1;do{for(r=e,e=null,i=null,o=0;r;){for(o++,n=r,u=0,t=0;t<c&&(u++,n=n.nextZ,n);t++);for(s=c;u>0||s>0&&n;)0===u?(a=n,n=n.nextZ,s--):0!==s&&n?r.z<=n.z?(a=r,r=r.nextZ,u--):(a=n,n=n.nextZ,s--):(a=r,r=r.nextZ,u--),i?i.nextZ=a:e=a,a.prevZ=i,i=a;r=n}i.nextZ=null,c*=2}while(o>1);return e}function d(e,t,r,n,a){return e=32767*(e-r)/a,t=32767*(t-n)/a,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function p(e){var t=e,r=e;do t.x<r.x&&(r=t),t=t.next;while(t!==e);return r}function y(e,t,r,n,a,i,o,u){return(a-o)*(t-u)-(e-o)*(i-u)>=0&&(e-o)*(n-u)-(r-o)*(t-u)>=0&&(r-o)*(i-u)-(a-o)*(n-u)>=0}function m(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!v(e,t)&&A(e,t)&&A(t,e)&&N(e,t)}function _(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function T(e,t){return e.x===t.x&&e.y===t.y}function R(e,t,r,n){return!!(T(e,t)&&T(r,n)||T(e,n)&&T(r,t))||_(e,t,r)>0!=_(e,t,n)>0&&_(r,n,e)>0!=_(r,n,t)>0}function v(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&R(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}function A(e,t){return _(e.prev,e,e.next)<0?_(e,t,e.next)>=0&&_(e,e.prev,t)>=0:_(e,t,e.prev)<0||_(e,e.next,t)<0}function N(e,t){var r=e,n=!1,a=(e.x+t.x)/2,i=(e.y+t.y)/2;do r.y>i!=r.next.y>i&&a<(r.next.x-r.x)*(i-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next;while(r!==e);return n}function S(e,t){var r=new M(e.i,e.x,e.y),n=new M(t.i,t.x,t.y),a=e.next,i=t.prev;return e.next=t,t.prev=e,r.next=a,a.prev=r,n.next=r,r.prev=n,i.next=n,n.prev=i,n}function I(e,t,r,n){var a=new M(e,t,r);return n?(a.next=n.next,a.prev=n,n.next.prev=a,n.next=a):(a.prev=a,a.next=a),a}function g(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function M(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function x(e,t,r,n){for(var a=0,i=t,o=r-n;i<r;i+=n)a+=(e[o]-e[i])*(e[i+1]+e[o+1]),o=i;return a}return e.deviation=function(e,t,r,n){var a=t&&t.length,i=a?t[0]*r:e.length,o=Math.abs(x(e,0,i,r));if(a)for(var u=0,s=t.length;u<s;u++){var c=t[u]*r,l=u<s-1?t[u+1]*r:e.length;o-=Math.abs(x(e,c,l,r))}var E=0;for(u=0;u<n.length;u+=3){var f=n[u]*r,h=n[u+1]*r,d=n[u+2]*r;E+=Math.abs((e[f]-e[d])*(e[h+1]-e[f+1])-(e[f]-e[h])*(e[d+1]-e[f+1]))}return 0===o&&0===E?0:Math.abs((E-o)/o)},e.flatten=function(e){for(var t=e[0][0].length,r={vertices:[],holes:[],dimensions:t},n=0,a=0;a<e.length;a++){for(var i=0;i<e[a].length;i++)for(var o=0;o<t;o++)r.vertices.push(e[a][i][o]);a>0&&(n+=e[a-1].length,r.holes.push(n))}return r},e}),define("Core/WindingOrder",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var r={CLOCKWISE:t.CW,COUNTER_CLOCKWISE:t.CCW,validate:function(e){return e===r.CLOCKWISE||e===r.COUNTER_CLOCKWISE}};return e(r)}),define("Core/PolygonPipeline",["../ThirdParty/earcut-2.1.1","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./Math","./PrimitiveType","./WindingOrder"],function(e,t,r,n,a,i,o,u,s,c,l,E,f){"use strict";var h=new r,d=new r,p={};p.computeArea2D=function(e){for(var t=e.length,r=0,n=t-1,a=0;a<t;n=a++){var i=e[n],o=e[a];r+=i.x*o.y-o.x*i.y}return.5*r},p.computeWindingOrder2D=function(e){var t=p.computeArea2D(e);return t>0?f.COUNTER_CLOCKWISE:f.CLOCKWISE},p.triangulate=function(r,n){var a=t.packArray(r);return e(a,n,2)};var y=new r,m=new r,_=new r,T=new r,R=new r,v=new r,A=new r;return p.computeSubdivision=function(e,t,o,u){u=a(u,l.RADIANS_PER_DEGREE);var f,h=o.slice(0),d=t.length,p=new Array(3*d),N=0;for(f=0;f<d;f++){var S=t[f];p[N++]=S.x,p[N++]=S.y,p[N++]=S.z}for(var I=[],g={},M=e.maximumRadius,x=l.chordLength(u,M),O=x*x;h.length>0;){var w,C,L=h.pop(),P=h.pop(),U=h.pop(),b=r.fromArray(p,3*U,y),F=r.fromArray(p,3*P,m),D=r.fromArray(p,3*L,_),B=r.multiplyByScalar(r.normalize(b,T),M,T),z=r.multiplyByScalar(r.normalize(F,R),M,R),G=r.multiplyByScalar(r.normalize(D,v),M,v),q=r.magnitudeSquared(r.subtract(B,z,A)),V=r.magnitudeSquared(r.subtract(z,G,A)),X=r.magnitudeSquared(r.subtract(G,B,A)),W=Math.max(q,V,X);W>O?q===W?(w=Math.min(U,P)+" "+Math.max(U,P),f=g[w],i(f)||(C=r.add(b,F,A),r.multiplyByScalar(C,.5,C),p.push(C.x,C.y,C.z),f=p.length/3-1,g[w]=f),h.push(U,f,L),h.push(f,P,L)):V===W?(w=Math.min(P,L)+" "+Math.max(P,L),f=g[w],i(f)||(C=r.add(F,D,A),r.multiplyByScalar(C,.5,C),p.push(C.x,C.y,C.z),f=p.length/3-1,g[w]=f),h.push(P,f,U),h.push(f,L,U)):X===W&&(w=Math.min(L,U)+" "+Math.max(L,U),f=g[w],i(f)||(C=r.add(D,b,A),r.multiplyByScalar(C,.5,C),p.push(C.x,C.y,C.z),f=p.length/3-1,g[w]=f),h.push(L,f,P),h.push(f,U,P)):(I.push(U),I.push(P),I.push(L))}return new s({attributes:{position:new c({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:p})},indices:I,primitiveType:E.TRIANGLES})},p.scaleToGeodeticHeight=function(e,t,n,o){n=a(n,u.WGS84);var s=h,c=d;if(t=a(t,0),o=a(o,!0),i(e))for(var l=e.length,E=0;E<l;E+=3)r.fromArray(e,E,c),o&&(c=n.scaleToGeodeticSurface(c,c)),0!==t&&(s=n.geodeticSurfaceNormal(c,s),r.multiplyByScalar(s,t,s),r.add(c,s,c)),e[E]=c.x,e[E+1]=c.y,e[E+2]=c.z;return e},p}),define("Core/Quaternion",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math","./Matrix3"],function(e,t,r,n,a,i,o,u){"use strict";function s(e,r,n,a){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0),this.w=t(a,0)}var c=new e;s.fromAxisAngle=function(t,n,a){var i=n/2,o=Math.sin(i);c=e.normalize(t,c);var u=c.x*o,l=c.y*o,E=c.z*o,f=Math.cos(i);return r(a)?(a.x=u,a.y=l,a.z=E,a.w=f,a):new s(u,l,E,f)};var l=[1,2,0],E=new Array(3);s.fromRotationMatrix=function(e,t){var n,a,i,o,c,f=e[u.COLUMN0ROW0],h=e[u.COLUMN1ROW1],d=e[u.COLUMN2ROW2],p=f+h+d;if(p>0)n=Math.sqrt(p+1),c=.5*n,n=.5/n,a=(e[u.COLUMN1ROW2]-e[u.COLUMN2ROW1])*n,i=(e[u.COLUMN2ROW0]-e[u.COLUMN0ROW2])*n,o=(e[u.COLUMN0ROW1]-e[u.COLUMN1ROW0])*n;else{var y=l,m=0;h>f&&(m=1),d>f&&d>h&&(m=2);var _=y[m],T=y[_];n=Math.sqrt(e[u.getElementIndex(m,m)]-e[u.getElementIndex(_,_)]-e[u.getElementIndex(T,T)]+1);var R=E;R[m]=.5*n,n=.5/n,c=(e[u.getElementIndex(T,_)]-e[u.getElementIndex(_,T)])*n,R[_]=(e[u.getElementIndex(_,m)]+e[u.getElementIndex(m,_)])*n,R[T]=(e[u.getElementIndex(T,m)]+e[u.getElementIndex(m,T)])*n,a=-R[0],i=-R[1],o=-R[2]}return r(t)?(t.x=a,t.y=i,t.z=o,t.w=c,t):new s(a,i,o,c)};var f=new s;s.fromHeadingPitchRoll=function(t,r,n,a){var i=s.fromAxisAngle(e.UNIT_X,n,f),o=s.fromAxisAngle(e.UNIT_Y,-r,a);a=s.multiply(o,i,o);var u=s.fromAxisAngle(e.UNIT_Z,-t,f);return s.multiply(u,a,a)};var h=new e,d=new e,p=new s,y=new s,m=new s;s.packedLength=4,s.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n++]=e.z,r[n]=e.w,r},s.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new s),a.x=e[n],a.y=e[n+1],a.z=e[n+2],a.w=e[n+3],a},s.packedInterpolationLength=3,s.convertPackedArrayForInterpolation=function(e,t,r,n){s.unpack(e,4*r,m),s.conjugate(m,m);for(var a=0,i=r-t+1;a<i;a++){var o=3*a;s.unpack(e,4*(t+a),p),s.multiply(p,m,p),p.w<0&&s.negate(p,p),s.computeAxis(p,h);var u=s.computeAngle(p);n[o]=h.x*u,n[o+1]=h.y*u,n[o+2]=h.z*u}},s.unpackInterpolationResult=function(t,n,a,i,o){r(o)||(o=new s),e.fromArray(t,0,d);var u=e.magnitude(d);return s.unpack(n,4*i,y),0===u?s.clone(s.IDENTITY,p):s.fromAxisAngle(d,u,p),s.multiply(p,y,o)},s.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new s(e.x,e.y,e.z,e.w)},s.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},s.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},s.magnitude=function(e){return Math.sqrt(s.magnitudeSquared(e))},s.normalize=function(e,t){var r=1/s.magnitude(e),n=e.x*r,a=e.y*r,i=e.z*r,o=e.w*r;return t.x=n,t.y=a,t.z=i,t.w=o,t},s.inverse=function(e,t){var r=s.magnitudeSquared(e);return t=s.conjugate(e,t),s.multiplyByScalar(t,1/r,t)},s.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},s.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},s.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},s.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},s.multiply=function(e,t,r){var n=e.x,a=e.y,i=e.z,o=e.w,u=t.x,s=t.y,c=t.z,l=t.w,E=o*u+n*l+a*c-i*s,f=o*s-n*c+a*l+i*u,h=o*c+n*s-a*u+i*l,d=o*l-n*u-a*s-i*c;return r.x=E,r.y=f,r.z=h,r.w=d,r},s.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},s.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},s.computeAxis=function(e,t){var r=e.w;if(Math.abs(r-1)<o.EPSILON6)return t.x=t.y=t.z=0,t;var n=1/Math.sqrt(1-r*r);return t.x=e.x*n,t.y=e.y*n,t.z=e.z*n,t},s.computeAngle=function(e){return Math.abs(e.w-1)<o.EPSILON6?0:2*Math.acos(e.w)};var _=new s;s.lerp=function(e,t,r,n){return _=s.multiplyByScalar(t,r,_),n=s.multiplyByScalar(e,1-r,n),s.add(_,n,n)};var T=new s,R=new s,v=new s;s.slerp=function(e,t,r,n){var a=s.dot(e,t),i=t;if(a<0&&(a=-a,i=T=s.negate(t,T)),1-a<o.EPSILON6)return s.lerp(e,i,r,n);var u=Math.acos(a);return R=s.multiplyByScalar(e,Math.sin((1-r)*u),R),v=s.multiplyByScalar(i,Math.sin(r*u),v),n=s.add(R,v,n),s.multiplyByScalar(n,1/Math.sin(u),n)},s.log=function(t,r){var n=o.acosClamped(t.w),a=0;return 0!==n&&(a=n/Math.sin(n)),e.multiplyByScalar(t,a,r)},s.exp=function(t,r){var n=e.magnitude(t),a=0;return 0!==n&&(a=Math.sin(n)/n),r.x=t.x*a,r.y=t.y*a,r.z=t.z*a,r.w=Math.cos(n),r};var A=new e,N=new e,S=new s,I=new s;s.computeInnerQuadrangle=function(t,r,n,a){var i=s.conjugate(r,S);s.multiply(i,n,I);var o=s.log(I,A);s.multiply(i,t,I);var u=s.log(I,N);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),s.exp(o,S),s.multiply(r,S,a)},s.squad=function(e,t,r,n,a,i){var o=s.slerp(e,t,a,S),u=s.slerp(r,n,a,I);return s.slerp(o,u,2*a*(1-a),i)};for(var g=new s,M=1.9011074535173003,x=a.supportsTypedArrays()?new Float32Array(8):[],O=a.supportsTypedArrays()?new Float32Array(8):[],w=a.supportsTypedArrays()?new Float32Array(8):[],C=a.supportsTypedArrays()?new Float32Array(8):[],L=0;L<7;++L){var P=L+1,U=2*P+1;x[L]=1/(P*U),O[L]=P/U}return x[7]=M/136,O[7]=8*M/17,s.fastSlerp=function(e,t,r,n){var a,i=s.dot(e,t);i>=0?a=1:(a=-1,i=-i);for(var o=i-1,u=1-r,c=r*r,l=u*u,E=7;E>=0;--E)w[E]=(x[E]*c-O[E])*o,C[E]=(x[E]*l-O[E])*o;var f=a*r*(1+w[0]*(1+w[1]*(1+w[2]*(1+w[3]*(1+w[4]*(1+w[5]*(1+w[6]*(1+w[7])))))))),h=u*(1+C[0]*(1+C[1]*(1+C[2]*(1+C[3]*(1+C[4]*(1+C[5]*(1+C[6]*(1+C[7])))))))),d=s.multiplyByScalar(e,h,g);return s.multiplyByScalar(t,f,n),s.add(d,n,n)},s.fastSquad=function(e,t,r,n,a,i){var o=s.fastSlerp(e,t,a,S),u=s.fastSlerp(r,n,a,I);return s.fastSlerp(o,u,2*a*(1-a),i)},s.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},s.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n},s.ZERO=i(new s(0,0,0,0)),s.IDENTITY=i(new s(0,0,0,1)),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.x+", "+this.y+", "+this.z+", "+this.w+")"},s}),define("Core/RectangleGeometryLibrary",["./Cartesian3","./Cartographic","./defined","./DeveloperError","./GeographicProjection","./Math","./Matrix2","./Rectangle"],function(e,t,r,n,a,i,o,u){"use strict";function s(t,r,n,a,i,u,s){var c=Math.cos(r),l=a*c,E=n*c,f=Math.sin(r),p=a*f,_=n*f;d=m.project(t,d),d=e.subtract(d,y,d);var T=o.fromRotation(r,h);d=o.multiplyByVector(T,d,d),d=e.add(d,y,d),t=m.unproject(d,t),u-=1,s-=1;var R=t.latitude,v=R+u*_,A=R-l*s,N=R-l*s+u*_,S=Math.max(R,v,A,N),I=Math.min(R,v,A,N),g=t.longitude,M=g+u*E,x=g+s*p,O=g+s*p+u*E,w=Math.max(g,M,x,O),C=Math.min(g,M,x,O);return{north:S,south:I,east:w,west:C,granYCos:l,granYSin:p,granXCos:E,granXSin:_,nwCorner:t}}var c=Math.cos,l=Math.sin,E=Math.sqrt,f={};f.computePosition=function(e,t,n,a,i){var o=e.ellipsoid.radiiSquared,u=e.nwCorner,s=e.rectangle,f=u.latitude-e.granYCos*t+n*e.granXSin,h=c(f),d=l(f),p=o.z*d,y=u.longitude+t*e.granYSin+n*e.granXCos,m=h*c(y),_=h*l(y),T=o.x*m,R=o.y*_,v=E(T*m+R*_+p*d);if(a.x=T/v,a.y=R/v,a.z=p/v,r(e.vertexFormat)&&e.vertexFormat.st){var A=e.stNwCorner;r(A)?(f=A.latitude-e.stGranYCos*t+n*e.stGranXSin,y=A.longitude+t*e.stGranYSin+n*e.stGranXCos,i.x=(y-e.stWest)*e.lonScalar,i.y=(f-e.stSouth)*e.latScalar):(i.x=(y-s.west)*e.lonScalar,i.y=(f-s.south)*e.latScalar)}};var h=new o,d=new e,p=new t,y=new e,m=new a;return f.computeOptions=function(e,t,r,n){var a,o,c,l,E,f=e._granularity,h=e._ellipsoid,d=e._surfaceHeight,_=e._rotation,T=e._stRotation,R=e._extrudedHeight,v=t.east,A=t.west,N=t.north,S=t.south,I=N-S;A>v?(E=i.TWO_PI-A+v,a=Math.ceil(E/f)+1,o=Math.ceil(I/f)+1,c=E/(a-1),l=I/(o-1)):(E=v-A,a=Math.ceil(E/f)+1,o=Math.ceil(I/f)+1,c=E/(a-1),l=I/(o-1)),r=u.northwest(t,r);var g=u.center(t,p);0===_&&0===T||(g.longitude<r.longitude&&(g.longitude+=i.TWO_PI),y=m.project(g,y));var M=l,x=c,O=0,w=0,C={granYCos:M,granYSin:O,granXCos:x,granXSin:w,ellipsoid:h,surfaceHeight:d,extrudedHeight:R,nwCorner:r,rectangle:t,width:a,height:o};if(0!==_){var L=s(r,_,c,l,g,a,o);N=L.north,S=L.south,v=L.east,A=L.west,C.granYCos=L.granYCos,C.granYSin=L.granYSin,C.granXCos=L.granXCos,C.granXSin=L.granXSin,t.north=N,t.south=S,t.east=v,t.west=A}if(0!==T){_-=T,n=u.northwest(t,n);var P=s(n,_,c,l,g,a,o);C.stGranYCos=P.granYCos,C.stGranXCos=P.granXCos,C.stGranYSin=P.granYSin,C.stGranXSin=P.granXSin,C.stNwCorner=n,C.stWest=P.west,C.stSouth=P.south}return C},f}),define("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,r,n){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.position=e(t.position,!1),this.normal=e(t.normal,!1),this.st=e(t.st,!1),this.binormal=e(t.binormal,!1),this.tangent=e(t.tangent,!1),this.color=e(t.color,!1)}return a.POSITION_ONLY=n(new a({position:!0})),a.POSITION_AND_NORMAL=n(new a({position:!0,normal:!0})),a.POSITION_NORMAL_AND_ST=n(new a({position:!0,normal:!0,st:!0})),a.POSITION_AND_ST=n(new a({position:!0,st:!0})),a.POSITION_AND_COLOR=n(new a({position:!0,color:!0})),a.ALL=n(new a({position:!0,normal:!0,st:!0,binormal:!0,tangent:!0})),a.DEFAULT=a.POSITION_NORMAL_AND_ST,a.packedLength=6,a.pack=function(t,r,n){return n=e(n,0),r[n++]=t.position?1:0,r[n++]=t.normal?1:0,r[n++]=t.st?1:0,r[n++]=t.binormal?1:0,r[n++]=t.tangent?1:0,r[n++]=t.color?1:0,r},a.unpack=function(r,n,i){return n=e(n,0),t(i)||(i=new a),i.position=1===r[n++],i.normal=1===r[n++],i.st=1===r[n++],i.binormal=1===r[n++],i.tangent=1===r[n++],i.color=1===r[n++],i},a.clone=function(e,r){if(t(e))return t(r)||(r=new a),r.position=e.position,r.normal=e.normal,r.st=e.st,r.binormal=e.binormal,r.tangent=e.tangent,r.color=e.color,r},a}),define("Core/RectangleGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix2","./Matrix3","./PolygonPipeline","./PrimitiveType","./Quaternion","./Rectangle","./RectangleGeometryLibrary","./VertexFormat"],function(e,t,r,n,a,i,o,u,s,c,l,E,f,h,d,p,y,m,_,T,R,v,A,N,S){"use strict";function I(e,t){var r=new l({attributes:new f,primitiveType:R.TRIANGLES});return r.attributes.position=new E({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:t.positions}),e.normal&&(r.attributes.normal=new E({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(r.attributes.tangent=new E({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.binormal&&(r.attributes.binormal=new E({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:t.binormals})),r}function g(e,t,n,a){for(var i=e.length,o=t.normal?new Float32Array(i):void 0,u=t.tangent?new Float32Array(i):void 0,s=t.binormal?new Float32Array(i):void 0,c=0,l=D,E=F,f=b,h=0;h<i;h+=3){var d=r.fromArray(e,h,U),p=c+1,y=c+2;(t.normal||t.tangent||t.binormal)&&(f=n.geodeticSurfaceNormal(d,f),(t.tangent||t.binormal)&&(r.cross(r.UNIT_Z,f,E),_.multiplyByVector(a,E,E),r.normalize(E,E),t.binormal&&r.normalize(r.cross(f,E,l),l)),t.normal&&(o[c]=f.x,o[p]=f.y,o[y]=f.z),t.tangent&&(u[c]=E.x,u[p]=E.y,u[y]=E.z),t.binormal&&(s[c]=l.x,s[p]=l.y,s[y]=l.z)),c+=3}return I(t,{positions:e,normals:o,tangents:u,binormals:s})}function M(e,t,n){for(var a=e.length,i=t.normal?new Float32Array(a):void 0,o=t.tangent?new Float32Array(a):void 0,u=t.binormal?new Float32Array(a):void 0,s=0,c=0,l=0,E=!0,f=D,h=F,d=b,p=0;p<a;p+=6){var m=r.fromArray(e,p,U);if(t.normal||t.tangent||t.binormal){var _=r.fromArray(e,(p+6)%a,V);if(E){var T=r.fromArray(e,(p+3)%a,X);r.subtract(_,m,_),r.subtract(T,m,T),d=r.normalize(r.cross(T,_,d),d),E=!1}r.equalsEpsilon(_,m,y.EPSILON10)&&(E=!0),(t.tangent||t.binormal)&&(f=n.geodeticSurfaceNormal(m,f),t.tangent&&(h=r.normalize(r.cross(f,d,h),h))),t.normal&&(i[s++]=d.x,i[s++]=d.y,i[s++]=d.z,i[s++]=d.x,i[s++]=d.y,i[s++]=d.z),t.tangent&&(o[c++]=h.x,o[c++]=h.y,o[c++]=h.z,o[c++]=h.x,o[c++]=h.y,o[c++]=h.z),t.binormal&&(u[l++]=f.x,u[l++]=f.y,u[l++]=f.z,u[l++]=f.x,u[l++]=f.y,u[l++]=f.z)}}return I(t,{positions:e,normals:i,tangents:o,binormals:u})}function x(e){for(var t=e.vertexFormat,r=e.ellipsoid,n=e.size,i=e.height,o=e.width,u=t.position?new Float64Array(3*n):void 0,s=t.st?new Float32Array(2*n):void 0,c=0,l=0,f=U,h=z,d=Number.MAX_VALUE,y=Number.MAX_VALUE,m=-Number.MAX_VALUE,_=-Number.MAX_VALUE,T=0;T<i;++T)for(var R=0;R<o;++R)N.computePosition(e,T,R,f,h),u[c++]=f.x,u[c++]=f.y,u[c++]=f.z,t.st&&(s[l++]=h.x,s[l++]=h.y,d=Math.min(d,h.x),y=Math.min(y,h.y),m=Math.max(m,h.x),_=Math.max(_,h.y));if(t.st&&(d<0||y<0||m>1||_>1))for(var v=0;v<s.length;v+=2)s[v]=(s[v]-d)/(m-d),s[v+1]=(s[v+1]-y)/(_-y);for(var A=g(u,t,r,e.tangentRotationMatrix),S=6*(o-1)*(i-1),I=p.createTypedArray(n,S),M=0,x=0,O=0;O<i-1;++O){for(var w=0;w<o-1;++w){var C=M,L=C+o,P=L+1,b=C+1;I[x++]=C,I[x++]=L,I[x++]=b,I[x++]=b,I[x++]=L,I[x++]=P,++M}++M}return A.indices=I,t.st&&(A.attributes.st=new E({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:s})),A}function O(e,t,r,n,a){return e[t++]=n[r],e[t++]=n[r+1],e[t++]=n[r+2],e[t++]=a[r],e[t++]=a[r+1],e[t++]=a[r+2],e}function w(e,t,r,n){return e[t++]=n[r],e[t++]=n[r+1],e[t++]=n[r],e[t++]=n[r+1],e}function C(e){var t,n=e.vertexFormat,i=e.surfaceHeight,o=e.extrudedHeight,u=Math.min(o,i),s=Math.max(o,i),c=e.height,l=e.width,f=e.ellipsoid,m=x(e);if(y.equalsEpsilon(u,s,y.EPSILON10))return m;var _=T.scaleToGeodeticHeight(m.attributes.position.values,s,f,!1);_=new Float64Array(_);var R=_.length,v=2*R,A=new Float64Array(v);A.set(_);var N=T.scaleToGeodeticHeight(m.attributes.position.values,u,f);A.set(N,R),m.attributes.position.values=A;var S,I=n.normal?new Float32Array(v):void 0,g=n.tangent?new Float32Array(v):void 0,C=n.binormal?new Float32Array(v):void 0,L=n.st?new Float32Array(v/3*2):void 0;if(n.normal){var P=m.attributes.normal.values;for(I.set(P),t=0;t<R;t++)P[t]=-P[t];I.set(P,R),m.attributes.normal.values=I}if(n.tangent){var U=m.attributes.tangent.values;for(g.set(U),t=0;t<R;t++)U[t]=-U[t];g.set(U,R),m.attributes.tangent.values=g}if(n.binormal){var b=m.attributes.binormal.values;C.set(b),C.set(b,R),m.attributes.binormal.values=C}n.st&&(S=m.attributes.st.values,L.set(S),L.set(S,R/3*2),m.attributes.st.values=L);var F=m.indices,D=F.length,B=R/3,z=p.createTypedArray(v/3,2*D);for(z.set(F),t=0;t<D;t+=3)z[t+D]=F[t+2]+B,z[t+1+D]=F[t+1]+B,z[t+2+D]=F[t]+B;m.indices=z;var G=2*l+2*c-4,q=2*(G+4),W=new Float64Array(3*q),H=n.st?new Float32Array(2*q):void 0,Y=0,k=0,Z=l*c;for(t=0;t<Z;t+=l)W=O(W,Y,3*t,_,N),Y+=6,n.st&&(H=w(H,k,2*t,S),k+=4);for(t=Z-l;t<Z;t++)W=O(W,Y,3*t,_,N),Y+=6,n.st&&(H=w(H,k,2*t,S),k+=4);for(t=Z-1;t>0;t-=l)W=O(W,Y,3*t,_,N),Y+=6,n.st&&(H=w(H,k,2*t,S),k+=4);for(t=l-1;t>=0;t--)W=O(W,Y,3*t,_,N),Y+=6,n.st&&(H=w(H,k,2*t,S),k+=4);var K=M(W,n,f);n.st&&(K.attributes.st=new E({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:H}));var j,Q,J,$,ee=p.createTypedArray(q,6*G);R=W.length/3;var te=0;for(t=0;t<R-1;t+=2){j=t,$=(j+2)%R;var re=r.fromArray(W,3*j,V),ne=r.fromArray(W,3*$,X);r.equalsEpsilon(re,ne,y.EPSILON10)||(Q=(j+1)%R,J=(Q+2)%R,ee[te++]=j,ee[te++]=Q,ee[te++]=$,ee[te++]=$,ee[te++]=Q,ee[te++]=J)}return K.indices=ee,K=d.combineInstances([new h({geometry:m}),new h({geometry:K})]),K[0]}function L(e,t,r){if(0===r)return A.clone(e);A.northeast(e,Z[0]),A.northwest(e,Z[1]),A.southeast(e,Z[2]),A.southwest(e,Z[3]),t.cartographicArrayToCartesianArray(Z,k);var n=t.geodeticSurfaceNormalCartographic(A.center(e,H));v.fromAxisAngle(n,r,Y),_.fromQuaternion(Y,W);for(var a=0;a<4;++a)_.multiplyByVector(W,k[a],k[a]);return t.cartesianArrayToCartographicArray(k,Z),A.fromCartographicArray(Z)}function P(e){e=i(e,i.EMPTY_OBJECT);var t=e.rectangle,r=i(e.granularity,y.RADIANS_PER_DEGREE),n=i(e.ellipsoid,c.WGS84),a=i(e.height,0),u=i(e.rotation,0),s=i(e.stRotation,0),l=i(e.vertexFormat,S.DEFAULT),E=e.extrudedHeight,f=o(E),h=i(e.closeTop,!0),d=i(e.closeBottom,!0);this._rectangle=t,this._granularity=r,this._ellipsoid=c.clone(n),this._surfaceHeight=a,this._rotation=u,this._stRotation=s,this._vertexFormat=S.clone(l),this._extrudedHeight=i(E,0),this._extrude=f,this._closeTop=h,this._closeBottom=d,this._workerName="createRectangleGeometry",this._rotatedRectangle=L(this._rectangle,this._ellipsoid,u)}var U=new r,b=new r,F=new r,D=new r,B=new A,z=new t,G=new e,q=new e,V=new r,X=new r,W=new _,H=new r,Y=new v,k=[new r,new r,new r,new r],Z=[new n,new n,new n,new n];P.packedLength=A.packedLength+c.packedLength+S.packedLength+A.packedLength+8,P.pack=function(e,t,r){return r=i(r,0),A.pack(e._rectangle,t,r),r+=A.packedLength,c.pack(e._ellipsoid,t,r),r+=c.packedLength,S.pack(e._vertexFormat,t,r),r+=S.packedLength,A.pack(e._rotatedRectangle,t,r),r+=A.packedLength,t[r++]=e._granularity,t[r++]=e._surfaceHeight,t[r++]=e._rotation,t[r++]=e._stRotation,t[r++]=e._extrudedHeight,t[r++]=e._extrude?1:0,t[r++]=e._closeTop?1:0,t[r]=e._closeBottom?1:0,t};var K=new A,j=new A,Q=c.clone(c.UNIT_SPHERE),J=new S,$={rectangle:K,ellipsoid:Q,vertexFormat:J,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,closeTop:void 0,closeBottom:void 0};P.unpack=function(e,t,r){t=i(t,0);var n=A.unpack(e,t,K);t+=A.packedLength;var a=c.unpack(e,t,Q);t+=c.packedLength;var u=S.unpack(e,t,J);t+=S.packedLength;var s=A.unpack(e,t,j);t+=A.packedLength;var l=e[t++],E=e[t++],f=e[t++],h=e[t++],d=e[t++],p=1===e[t++],y=1===e[t++],m=1===e[t];return o(r)?(r._rectangle=A.clone(n,r._rectangle),r._ellipsoid=c.clone(a,r._ellipsoid),r._vertexFormat=S.clone(u,r._vertexFormat),r._granularity=l,r._surfaceHeight=E,r._rotation=f,r._stRotation=h,r._extrudedHeight=p?d:void 0,r._extrude=p,r._closeTop=y,r._closeBottom=m,r._rotatedRectangle=s,r):($.granularity=l,$.height=E,$.rotation=f,$.stRotation=h,$.extrudedHeight=p?d:void 0,$.closeTop=y,$.closeBottom=m,new P($))};var ee=new _,te=new n,re=new n,ne=new v,ae=new n;return P.createGeometry=function(t){if(!y.equalsEpsilon(t._rectangle.north,t._rectangle.south,y.EPSILON10)&&!y.equalsEpsilon(t._rectangle.east,t._rectangle.west,y.EPSILON10)){var r=A.clone(t._rectangle,B),n=t._ellipsoid,a=t._surfaceHeight,i=t._extrude,o=t._extrudedHeight,u=t._rotation,s=t._stRotation,c=t._vertexFormat,E=N.computeOptions(t,r,te,re),h=ee;if(0!==s||0!==u){var d=A.center(r,ae),p=n.geodeticSurfaceNormalCartographic(d,V);v.fromAxisAngle(p,-s,ne),_.fromQuaternion(ne,h)}else _.clone(_.IDENTITY,h);E.lonScalar=1/t._rectangle.width,E.latScalar=1/t._rectangle.height,E.vertexFormat=c,E.rotation=u,E.stRotation=s,E.tangentRotationMatrix=h,E.size=E.width*E.height;var m,R;if(r=t._rectangle,i){m=C(E);var S=e.fromRectangle3D(r,n,a,q),I=e.fromRectangle3D(r,n,o,G);R=e.union(S,I)}else m=x(E),m.attributes.position.values=T.scaleToGeodeticHeight(m.attributes.position.values,a,n,!1),R=e.fromRectangle3D(r,n,a);return c.position||delete m.attributes.position,new l({attributes:new f(m.attributes),indices:m.indices,primitiveType:m.primitiveType,boundingSphere:R})}},P.createShadowVolume=function(e,t,r){var n=e._granularity,a=e._ellipsoid,i=t(n,a),o=r(n,a);return new P({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:a,stRotation:e._stRotation,granularity:n,extrudedHeight:o,height:i,closeTop:!0,closeBottom:!0,vertexFormat:S.POSITION_ONLY})},u(P.prototype,{rectangle:{get:function(){return this._rotatedRectangle}}}),P}),define("Workers/createRectangleGeometry",["../Core/defined","../Core/Ellipsoid","../Core/Rectangle","../Core/RectangleGeometry"],function(e,t,r,n){"use strict";function a(a,i){return e(i)&&(a=n.unpack(a,i)),a._ellipsoid=t.clone(a._ellipsoid),a._rectangle=r.clone(a._rectangle),n.createGeometry(a)}return a})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e){return e+" is required, actual value was undefined"}function r(e,t,n){return"Expected "+n+" to be typeof "+t+", actual typeof was "+e}var a={};return a.typeOf={},a.defined=function(r,a){if(!e(a))throw new t(n(r))},a.typeOf.func=function(e,n){if("function"!=typeof n)throw new t(r(typeof n,"function",e))},a.typeOf.string=function(e,n){if("string"!=typeof n)throw new t(r(typeof n,"string",e))},a.typeOf.number=function(e,n){if("number"!=typeof n)throw new t(r(typeof n,"number",e))},a.typeOf.number.lessThan=function(e,n,r){if(a.typeOf.number(e,n),n>=r)throw new t("Expected "+e+" to be less than "+r+", actual value was "+n)},a.typeOf.number.lessThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n>r)throw new t("Expected "+e+" to be less than or equal to "+r+", actual value was "+n)},a.typeOf.number.greaterThan=function(e,n,r){if(a.typeOf.number(e,n),n<=r)throw new t("Expected "+e+" to be greater than "+r+", actual value was "+n)},a.typeOf.number.greaterThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n<r)throw new t("Expected "+e+" to be greater than or equal to"+r+", actual value was "+n)},a.typeOf.object=function(e,n){if("object"!=typeof n)throw new t(r(typeof n,"object",e))},a.typeOf.bool=function(e,n){if("boolean"!=typeof n)throw new t(r(typeof n,"boolean",e))},a}),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";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),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 n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(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^=e<<7&2636928640,e^=e<<15&4022730752,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,n,r){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:e<0?-1:0},a.signNotZero=function(e){return e<0?-1:1},a.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*a.clamp(e,-1,1)+.5)*n)},a.fromSNorm=function(e,n){return n=t(n,255),a.clamp(e,0,n)/n*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},a.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},a.lerp=function(e,t,n){return(1-n)*e+n*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){var t=a.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},a.clampToLatitudeRange=function(e){return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){return(e%t+t)%t},a.equalsEpsilon=function(e,n,r,a){a=t(a,r);var i=Math.abs(e-n);return i<=a||i<=r*Math.max(Math.abs(e),Math.abs(n))};var i=[1];a.factorial=function(e){var t=i.length;if(e>=t)for(var n=i[t-1],r=t;r<=e;r++)i.push(n*r);return i[e]},a.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},a.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return a.setRandomNumberSeed=function(t){o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(e){return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){return Math.log(e)/Math.log(t)},a.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var a=e.clock,i=e.cone,u=t(e.magnitude,1),s=u*Math.sin(i);return r.x=s*Math.cos(a),r.y=s*Math.sin(a),r.z=u*Math.cos(i),r},o.fromElements=function(e,t,r,a){return n(a)?(a.x=e,a.y=t,a.z=r,a):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var a=0;a<r;++a)o.pack(e[a],t,3*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var a=0;a<r;a+=3){var i=a/3;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,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};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var n=o.dot(c,l),r=o.magnitude(o.cross(c,l,c));return Math.atan2(r,n)};var E=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,E);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)},o.cross=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=t.x,u=t.y,s=t.z,c=a*s-i*u,l=i*o-r*s,E=r*u-a*o;return n.x=c,n.y=l,n.z=E,n},o.fromDegrees=function(e,t,n,r,a){return e=i.toRadians(e),t=i.toRadians(t),o.fromRadians(e,t,n,r,a)};var f=new o,h=new o,d=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,a,i,u){a=t(a,0);var s=n(i)?i.radiiSquared:d,c=Math.cos(r);f.x=c*Math.cos(e),f.y=c*Math.sin(e),f.z=Math.sin(r),f=o.normalize(f,f),o.multiplyComponents(s,f,h);var l=Math.sqrt(o.dot(f,h));return h=o.divideByScalar(h,l,h),f=o.multiplyByScalar(f,a,f),n(u)||(u=new o),o.add(h,f,u)},o.fromDegreesArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromDegrees(u,s,0,t,r[c])}return r},o.fromRadiansArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromRadians(u,s,0,t,r[c])}return r},o.fromDegreesArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromDegrees(u,s,c,t,r[l])}return r},o.fromRadiansArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromRadians(u,s,c,t,r[l])}return r},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(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,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(n,a,u,s,c){var l=n.x,E=n.y,f=n.z,h=a.x,d=a.y,p=a.z,y=l*l*h*h,m=E*E*d*d,_=f*f*p*p,T=y+m+_,v=Math.sqrt(1/T),R=e.multiplyByScalar(n,v,i);if(T<s)return isFinite(v)?e.clone(R,c):void 0;var A=u.x,N=u.y,g=u.z,S=o;S.x=R.x*A*2,S.y=R.y*N*2,S.z=R.z*g*2;var I,M,x,O,w,C,L,P,b,U,F,D=(1-v)*e.magnitude(n)/(.5*e.magnitude(S)),B=0;do{D-=B,x=1/(1+D*A),O=1/(1+D*N),w=1/(1+D*g),C=x*x,L=O*O,P=w*w,b=C*x,U=L*O,F=P*w,I=y*C+m*L+_*P-1,M=y*b*A+m*U*N+_*F*g;var z=-2*M;B=I/z}while(Math.abs(I)>r.EPSILON12);return t(c)?(c.x=l*x,c.y=E*O,c.z=f*w,c):new e(l*x,E*O,f*w)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o){"use strict";function u(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)}u.fromRadians=function(e,r,a,i){return a=t(a,0),n(i)?(i.longitude=e,i.latitude=r,i.height=a,i):new u(e,r,a)},u.fromDegrees=function(e,t,n,r){return e=i.toRadians(e),t=i.toRadians(t),u.fromRadians(e,t,n,r)};var s=new e,c=new e,l=new e,E=new e(1/6378137,1/6378137,1/6356752.314245179),f=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),h=i.EPSILON1;return u.fromCartesian=function(t,r,a){var d=n(r)?r.oneOverRadii:E,p=n(r)?r.oneOverRadiiSquared:f,y=n(r)?r._centerToleranceSquared:h,m=o(t,d,p,y,c);if(n(m)){var _=e.multiplyComponents(m,p,s);_=e.normalize(_,_);var T=e.subtract(t,m,l),v=Math.atan2(_.y,_.x),R=Math.asin(_.z),A=i.sign(e.dot(T,t))*e.magnitude(T);return n(a)?(a.longitude=v,a.latitude=R,a.height=A,a):new u(v,R,A)}},u.clone=function(e,t){if(n(e))return n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},u.ZERO=a(new u(0,0,0)),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,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(t,r,a,i){r=n(r,0),a=n(a,0),i=n(i,0),t._radii=new e(r,a,i),t._radiiSquared=new e(r*r,a*a,i*i),t._radiiToTheFourth=new e(r*r*r*r,a*a*a*a,i*i*i*i),t._oneOverRadii=new e(0===r?0:1/r,0===a?0:1/a,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===a?0:1/(a*a),0===i?0:1/(i*i)),t._minimumRadius=Math.min(r,a,i),t._maximumRadius=Math.max(r,a,i),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,c(this,e,t,n)}a(l.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}}}),l.clone=function(t,n){if(r(t)){var a=t._radii;return r(n)?(e.clone(a,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new l(a.x,a.y,a.z)}},l.fromCartesian3=function(e,t){return r(t)||(t=new l),r(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,r,a){return a=n(a,0),e.pack(t._radii,r,a),r},l.unpack=function(t,r,a){r=n(r,0);var i=e.unpack(t,r);return l.fromCartesian3(i,a)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,n){var a=t.longitude,i=t.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return r(n)||(n=new e),n.x=u,n.y=s,n.z=c,e.normalize(n,n)},l.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var E=new e,f=new e;l.prototype.cartographicToCartesian=function(t,n){var a=E,i=f;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(e.dot(a,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(a,t.height,a),r(n)||(n=new e),e.add(i,a,n)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var h=new e,d=new e,p=new e;return l.prototype.cartesianToCartographic=function(n,a){var i=this.scaleToGeodeticSurface(n,d);if(r(i)){var o=this.geodeticSurfaceNormal(i,h),s=e.subtract(n,i,p),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),E=u.sign(e.dot(s,n))*e.magnitude(s);return r(a)?(a.longitude=c,a.latitude=l,a.height=E,a):new t(c,l,E)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var a=t.x,i=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return e.multiplyByScalar(t,s,n)},l.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},l.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},l.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,a,i){a=n(a,0);var o=this._sqauredXOverSquaredZ;if(r(i)||(i=new e),i.x=0,i.y=0,i.z=t.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},l}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(e,t,r,a){this.west=n(e,0),this.south=n(t,0),this.east=n(r,0),this.north=n(a,0)}a(c.prototype,{width:{get:function(){return c.computeWidth(this)}},height:{get:function(){return c.computeHeight(this)}}}),c.packedLength=4,c.pack=function(e,t,r){return r=n(r,0),t[r++]=e.west,t[r++]=e.south,t[r++]=e.east,t[r]=e.north,t},c.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new c),a.west=e[t++],a.south=e[t++],a.east=e[t++],a.north=e[t],a},c.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=s.TWO_PI),t-n},c.computeHeight=function(e){return e.north-e.south},c.fromDegrees=function(e,t,a,i,o){return e=s.toRadians(n(e,0)),t=s.toRadians(n(t,0)),a=s.toRadians(n(a,0)),i=s.toRadians(n(i,0)),r(o)?(o.west=e,o.south=t,o.east=a,o.north=i,o):new c(e,t,a,i)},c.fromRadians=function(e,t,a,i,o){return r(o)?(o.west=n(e,0),o.south=n(t,0),o.east=n(a,0),o.north=n(i,0),o):new c(e,t,a,i)},c.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,u=Number.MAX_VALUE,l=-Number.MAX_VALUE,E=0,f=e.length;E<f;E++){var h=e[E];n=Math.min(n,h.longitude),a=Math.max(a,h.longitude),u=Math.min(u,h.latitude),l=Math.max(l,h.latitude);var d=h.longitude>=0?h.longitude:h.longitude+s.TWO_PI;i=Math.min(i,d),o=Math.max(o,d)}return a-n>o-i&&(n=i,a=o,a>s.PI&&(a-=s.TWO_PI),n>s.PI&&(n-=s.TWO_PI)),r(t)?(t.west=n,t.south=u,t.east=a,t.north=l,t):new c(n,u,a,l)},c.fromCartesianArray=function(e,t,n){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,u=-Number.MAX_VALUE,l=Number.MAX_VALUE,E=-Number.MAX_VALUE,f=0,h=e.length;f<h;f++){var d=t.cartesianToCartographic(e[f]);a=Math.min(a,d.longitude),i=Math.max(i,d.longitude),l=Math.min(l,d.latitude),E=Math.max(E,d.latitude);var p=d.longitude>=0?d.longitude:d.longitude+s.TWO_PI;o=Math.min(o,p),u=Math.max(u,p)}return i-a>u-o&&(a=o,i=u,i>s.PI&&(i-=s.TWO_PI),a>s.PI&&(a-=s.TWO_PI)),r(n)?(n.west=a,n.south=l,n.east=i,n.north=E,n):new c(a,l,i,E)},c.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new c(e.west,e.south,e.east,e.north)},c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.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},c.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},c.validate=function(e){},c.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)},c.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)},c.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)},c.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)},c.center=function(t,n){var a=t.east,i=t.west;a<i&&(a+=s.TWO_PI);var o=s.negativePiToPi(.5*(i+a)),u=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=u,n.height=0,n):new e(o,u)},c.intersection=function(e,t,n){var a=e.east,i=e.west,o=t.east,u=t.west;a<i&&o>0?a+=s.TWO_PI:o<u&&a>0&&(o+=s.TWO_PI),a<i&&u<0?u+=s.TWO_PI:o<u&&i<0&&(i+=s.TWO_PI);var l=s.negativePiToPi(Math.max(i,u)),E=s.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&E<=l)){var f=Math.max(e.south,t.south),h=Math.min(e.north,t.north);if(!(f>=h))return r(n)?(n.west=l,n.south=f,n.east=E,n.north=h,n):new c(l,f,E,h)}},c.simpleIntersection=function(e,t,n){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(i>=u||a>=o))return r(n)?(n.west=a,n.south=i,n.east=o,n.north=u,n):new c(a,i,o,u)},c.union=function(e,t,n){r(n)||(n=new c);var a=e.east,i=e.west,o=t.east,u=t.west;a<i&&o>0?a+=s.TWO_PI:o<u&&a>0&&(o+=s.TWO_PI),a<i&&u<0?u+=s.TWO_PI:o<u&&i<0&&(i+=s.TWO_PI);var l=s.convertLongitudeRange(Math.min(i,u)),E=s.convertLongitudeRange(Math.max(a,o));return n.west=l,n.south=Math.min(e.south,t.south),n.east=E,n.north=Math.max(e.north,t.north),n},c.expand=function(e,t,n){return r(n)||(n=new c),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},c.contains=function(e,t){var n=t.longitude,r=t.latitude,a=e.west,i=e.east;return i<a&&(i+=s.TWO_PI,n<0&&(n+=s.TWO_PI)),(n>a||s.equalsEpsilon(n,a,s.EPSILON14))&&(n<i||s.equalsEpsilon(n,i,s.EPSILON14))&&r>=e.south&&r<=e.north};var l=new e;return c.subsample=function(e,t,a,i){t=n(t,o.WGS84),a=n(a,0),r(i)||(i=[]);var u=0,E=e.north,f=e.south,h=e.east,d=e.west,p=l;p.height=a,p.longitude=d,p.latitude=E,i[u]=t.cartographicToCartesian(p,i[u]),u++,p.longitude=h,i[u]=t.cartographicToCartesian(p,i[u]),u++,p.latitude=f,i[u]=t.cartographicToCartesian(p,i[u]),u++,p.longitude=d,i[u]=t.cartographicToCartesian(p,i[u]),u++,E<0?p.latitude=E:f>0?p.latitude=f:p.latitude=0;for(var y=1;y<8;++y)p.longitude=-Math.PI+y*s.PI_OVER_TWO,c.contains(e,p)&&(i[u]=t.cartographicToCartesian(p,i[u]),u++);return 0===p.latitude&&(p.longitude=d,i[u]=t.cartographicToCartesian(p,i[u]),u++,p.longitude=h,i[u]=t.cartographicToCartesian(p,i[u]),u++),i.length=u,i},c.MAX_VALUE=u(new c(-Math.PI,-s.PI_OVER_TWO,Math.PI,s.PI_OVER_TWO)),c}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,a,i,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return r(n)?(n.x=i,n.y=o,n.z=u,n):new e(i,o,u)},u.prototype.unproject=function(e,n){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,u=e.z;return r(n)?(n.longitude=i,n.latitude=o,n.height=u,n):new t(i,o,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";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a,i,o,u,s,c){this[0]=n(e,0),this[1]=n(a,0),this[2]=n(u,0),this[3]=n(t,0),this[4]=n(i,0),this[5]=n(s,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(c,0)}function c(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function l(e){for(var t=0,n=0;n<3;++n){var r=e[s.getElementIndex(p[n],d[n])];t+=2*r*r}return Math.sqrt(t)}function E(e,t){for(var n=u.EPSILON15,r=0,a=1,i=0;i<3;++i){var o=Math.abs(e[s.getElementIndex(p[i],d[i])]);o>r&&(a=i,r=o)}var c=1,l=0,E=d[a],f=p[a];if(Math.abs(e[s.getElementIndex(f,E)])>n){var h,y=e[s.getElementIndex(f,f)],m=e[s.getElementIndex(E,E)],_=e[s.getElementIndex(f,E)],T=(y-m)/2/_;h=T<0?-1/(-T+Math.sqrt(1+T*T)):1/(T+Math.sqrt(1+T*T)),c=1/Math.sqrt(1+h*h),l=h*c}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(E,E)]=t[s.getElementIndex(f,f)]=c,t[s.getElementIndex(f,E)]=l,t[s.getElementIndex(E,f)]=-l,t}s.packedLength=9,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t},s.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a},s.clone=function(e,t){if(r(e))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):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t],a[1]=e[t+1],a[2]=e[t+2],a[3]=e[t+3],a[4]=e[t+4],a[5]=e[t+5],a[6]=e[t+6],a[7]=e[t+7],a[8]=e[t+8],a},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[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 s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var n=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,u=e.y*e.y,c=e.y*e.z,l=e.y*e.w,E=e.z*e.z,f=e.z*e.w,h=e.w*e.w,d=n-u-E+h,p=2*(a-f),y=2*(i+l),m=2*(a+f),_=-n+u-E+h,T=2*(c-o),v=2*(i-l),R=2*(c+o),A=-n-u+E+h;return r(t)?(t[0]=d,t[1]=m,t[2]=v,t[3]=p,t[4]=_,t[5]=R,t[6]=y,t[7]=T,t[8]=A,t):new s(d,p,y,m,_,T,v,R,A)},s.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),a=Math.cos(-e.heading),i=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),c=Math.sin(e.roll),l=n*a,E=-i*u+c*o*a,f=c*u+i*o*a,h=n*u,d=i*a+c*o*u,p=-o*i+i*o*u,y=-o,m=c*n,_=i*n;return r(t)?(t[0]=l,t[1]=h,t[2]=y,t[3]=E,t[4]=d,t[5]=m,t[6]=f,t[7]=p,t[8]=_,t):new s(l,E,f,h,d,p,y,m,_)},s.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 s(e.x,0,0,0,e.y,0,0,0,e.z)},s.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 s(e,0,0,0,e,0,0,0,e)},s.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 s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=a,t[6]=0,t[7]=-a,t[8]=n,t):new s(1,0,0,0,n,-a,0,a,n)},s.fromRotationY=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=n,t):new s(n,0,a,0,1,0,-a,0,n)},s.fromRotationZ=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=a,t[2]=0,t[3]=-a,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(n,-a,0,a,n,0,0,0,1)},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):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,n){var r=3*t,a=e[r],i=e[r+1],o=e[r+2];return n.x=a,n.y=i,n.z=o,n},s.setColumn=function(e,t,n,r){r=s.clone(e,r);var a=3*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},s.getRow=function(e,t,n){var r=e[t],a=e[t+3],i=e[t+6];return n.x=r,n.y=a,n.z=i,n},s.setRow=function(e,t,n,r){return r=s.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var f=new e;s.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],f)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],f)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],f)),n};var h=new e;s.getMaximumScale=function(t){return s.getScale(t,h),e.maximumComponent(h)},s.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=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],E=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=r,n[1]=a,n[2]=i,n[3]=o,n[4]=u,n[5]=s,n[6]=c,n[7]=l,n[8]=E,n},s.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},s.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},s.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[3]*a+e[6]*i,u=e[1]*r+e[4]*a+e[7]*i,s=e[2]*r+e[5]*a+e[8]*i;return n.x=o,n.y=u,n.z=s,n},s.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},s.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},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},s.transpose=function(e,t){var n=e[0],r=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=n,t[1]=r,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var d=[1,0,0],p=[2,2,1],y=new s,m=new s;return s.computeEigenDecomposition=function(e,t){var n=u.EPSILON20,a=10,i=0,o=0;r(t)||(t={});for(var f=t.unitary=s.clone(s.IDENTITY,t.unitary),h=t.diagonal=s.clone(e,t.diagonal),d=n*c(h);o<a&&l(h)>d;)E(h,y),s.transpose(y,m),s.multiply(h,y,h),s.multiply(m,h,h),s.multiply(f,y,f),++i>2&&(++o,i=0);return 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},s.determinant=function(e){var t=e[0],n=e[3],r=e[6],a=e[1],i=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*o)+a*(s*r-n*c)+u*(n*o-i*r)},s.inverse=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[3],o=e[4],u=e[5],c=e[6],l=e[7],E=e[8],f=s.determinant(e);t[0]=o*E-l*u,t[1]=l*a-r*E,t[2]=r*u-o*a,t[3]=c*u-i*E,t[4]=n*E-c*a,t[5]=i*a-n*u,t[6]=i*l-c*o,t[7]=c*r-n*l,t[8]=n*o-i*r;var h=1/f;return s.multiplyByScalar(t,h,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]},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},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,a(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r,a){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(a,0)}o.fromElements=function(e,t,r,a,i){return n(i)?(i.x=e,i.y=t,i.z=r,i.w=a,i):new o(e,t,r,a)},o.fromColor=function(e,t){return n(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(n(e))return n(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)},o.packedLength=4,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r++],a.w=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=4*r:t=new Array(4*r);for(var a=0;a<r;++a)o.pack(e[a],t,4*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/4:t=new Array(r/4);for(var a=0;a<r;a+=4){var i=a/4;t[i]=o.unpack(e,a,t[i])}return t},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,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},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 u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,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,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},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 s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,c);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)&&i.equalsEpsilon(e.w,t.w,r,a)},o.ZERO=a(new o(0,0,0,0)),o.UNIT_X=a(new o(1,0,0,0)),o.UNIT_Y=a(new o(0,1,0,0)),o.UNIT_Z=a(new o(0,0,1,0)),o.UNIT_W=a(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,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,a,i,o,u,s,c,l){"use strict";function E(e,t,n,a,i,o,u,s,c,l,E,f,h,d,p,y){this[0]=r(e,0),this[1]=r(i,0),this[2]=r(c,0),this[3]=r(h,0),this[4]=r(t,0),this[5]=r(o,0),this[6]=r(l,0),this[7]=r(d,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(E,0),this[11]=r(p,0),this[12]=r(a,0),this[13]=r(s,0),this[14]=r(f,0),this[15]=r(y,0)}E.packedLength=16,E.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},E.unpack=function(e,t,n){return t=r(t,0),a(n)||(n=new E),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},E.clone=function(e,t){if(a(e))return a(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 E(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])},E.fromArray=E.unpack,E.fromColumnMajorArray=function(e,t){return E.clone(e,t)},E.fromRowMajorArray=function(e,t){return a(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 E(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])},E.fromRotationTranslation=function(t,n,i){return n=r(n,e.ZERO),a(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=1,i):new E(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},E.fromTranslationQuaternionRotationScale=function(e,t,n,r){a(r)||(r=new E);var i=n.x,o=n.y,u=n.z,s=t.x*t.x,c=t.x*t.y,l=t.x*t.z,f=t.x*t.w,h=t.y*t.y,d=t.y*t.z,p=t.y*t.w,y=t.z*t.z,m=t.z*t.w,_=t.w*t.w,T=s-h-y+_,v=2*(c-m),R=2*(l+p),A=2*(c+m),N=-s+h-y+_,g=2*(d-f),S=2*(l-p),I=2*(d+f),M=-s-h+y+_;return r[0]=T*i,r[1]=A*i,r[2]=S*i,r[3]=0,r[4]=v*o,r[5]=N*o,r[6]=I*o,r[7]=0,r[8]=R*u,r[9]=g*u,r[10]=M*u,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},E.fromTranslationRotationScale=function(e,t){return E.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},E.fromTranslation=function(e,t){return E.fromRotationTranslation(c.IDENTITY,e,t)},E.fromScale=function(e,t){return a(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 E(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},E.fromUniformScale=function(e,t){return a(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 E(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var f=new e,h=new e,d=new e;E.fromCamera=function(t,n){var r=t.position,i=t.direction,o=t.up;e.normalize(i,f),e.normalize(e.cross(f,o,h),h),e.normalize(e.cross(h,f,d),d);var u=h.x,s=h.y,c=h.z,l=f.x,p=f.y,y=f.z,m=d.x,_=d.y,T=d.z,v=r.x,R=r.y,A=r.z,N=u*-v+s*-R+c*-A,g=m*-v+_*-R+T*-A,S=l*v+p*R+y*A;return a(n)?(n[0]=u,n[1]=m,n[2]=-l,n[3]=0,n[4]=s,n[5]=_,n[6]=-p,n[7]=0,n[8]=c,n[9]=T,n[10]=-y,n[11]=0,n[12]=N,n[13]=g,n[14]=S,n[15]=1,n):new E(u,s,c,N,m,_,T,g,-l,-p,-y,S,0,0,0,1)},E.computePerspectiveFieldOfView=function(e,t,n,r,a){var i=Math.tan(.5*e),o=1/i,u=o/t,s=(r+n)/(n-r),c=2*r*n/(n-r);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=c,a[15]=0,a},E.computeOrthographicOffCenter=function(e,t,n,r,a,i,o){var u=1/(t-e),s=1/(r-n),c=1/(i-a),l=-(t+e)*u,E=-(r+n)*s,f=-(i+a)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=E,o[14]=f,o[15]=1,o},E.computePerspectiveOffCenter=function(e,t,n,r,a,i,o){var u=2*a/(t-e),s=2*a/(r-n),c=(t+e)/(t-e),l=(r+n)/(r-n),E=-(i+a)/(i-a),f=-1,h=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=E,o[11]=f,o[12]=0,o[13]=0,o[14]=h,o[15]=0,o},E.computeInfinitePerspectiveOffCenter=function(e,t,n,r,a,i){var o=2*a/(t-e),u=2*a/(r-n),s=(t+e)/(t-e),c=(r+n)/(r-n),l=-1,E=-1,f=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=s,i[9]=c,i[10]=l,i[11]=E,i[12]=0,i[13]=0,i[14]=f,i[15]=0,i},E.computeViewportTransformation=function(e,t,n,a){e=r(e,r.EMPTY_OBJECT);var i=r(e.x,0),o=r(e.y,0),u=r(e.width,0),s=r(e.height,0);t=r(t,0),n=r(n,1);var c=.5*u,l=.5*s,E=.5*(n-t),f=c,h=l,d=E,p=i+c,y=o+l,m=t+E,_=1;return a[0]=f,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=h,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=d,a[11]=0,a[12]=p,a[13]=y,a[14]=m,a[15]=_,a},E.computeView=function(t,n,r,a,i){return i[0]=a.x,i[1]=r.x,i[2]=-n.x,i[3]=0,i[4]=a.y,i[5]=r.y,i[6]=-n.y,i[7]=0,i[8]=a.z,i[9]=r.z,i[10]=-n.z,i[11]=0,i[12]=-e.dot(a,t),i[13]=-e.dot(r,t),i[14]=e.dot(n,t),i[15]=1,i},E.toArray=function(e,t){return a(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]]},E.getElementIndex=function(e,t){return 4*e+t},E.getColumn=function(e,t,n){var r=4*t,a=e[r],i=e[r+1],o=e[r+2],u=e[r+3];return n.x=a,n.y=i,n.z=o,n.w=u,n},E.setColumn=function(e,t,n,r){r=E.clone(e,r);var a=4*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r[a+3]=n.w,r},E.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},E.getRow=function(e,t,n){var r=e[t],a=e[t+4],i=e[t+8],o=e[t+12];return n.x=r,n.y=a,n.z=i,n.w=o,n},E.setRow=function(e,t,n,r){return r=E.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var p=new e;E.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],p)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],p)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],p)),n};var y=new e;E.getMaximumScale=function(t){return E.getScale(t,y),e.maximumComponent(y)},E.multiply=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],E=e[8],f=e[9],h=e[10],d=e[11],p=e[12],y=e[13],m=e[14],_=e[15],T=t[0],v=t[1],R=t[2],A=t[3],N=t[4],g=t[5],S=t[6],I=t[7],M=t[8],x=t[9],O=t[10],w=t[11],C=t[12],L=t[13],P=t[14],b=t[15],U=r*T+u*v+E*R+p*A,F=a*T+s*v+f*R+y*A,D=i*T+c*v+h*R+m*A,B=o*T+l*v+d*R+_*A,z=r*N+u*g+E*S+p*I,G=a*N+s*g+f*S+y*I,q=i*N+c*g+h*S+m*I,V=o*N+l*g+d*S+_*I,X=r*M+u*x+E*O+p*w,W=a*M+s*x+f*O+y*w,H=i*M+c*x+h*O+m*w,Y=o*M+l*x+d*O+_*w,k=r*C+u*L+E*P+p*b,Z=a*C+s*L+f*P+y*b,K=i*C+c*L+h*P+m*b,j=o*C+l*L+d*P+_*b;return n[0]=U,n[1]=F,n[2]=D,n[3]=B,n[4]=z,n[5]=G,n[6]=q,n[7]=V,n[8]=X,n[9]=W,n[10]=H,n[11]=Y,n[12]=k,n[13]=Z,n[14]=K,n[15]=j,n},E.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},E.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},E.multiplyTransformation=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],E=e[10],f=e[12],h=e[13],d=e[14],p=t[0],y=t[1],m=t[2],_=t[4],T=t[5],v=t[6],R=t[8],A=t[9],N=t[10],g=t[12],S=t[13],I=t[14],M=r*p+o*y+c*m,x=a*p+u*y+l*m,O=i*p+s*y+E*m,w=r*_+o*T+c*v,C=a*_+u*T+l*v,L=i*_+s*T+E*v,P=r*R+o*A+c*N,b=a*R+u*A+l*N,U=i*R+s*A+E*N,F=r*g+o*S+c*I+f,D=a*g+u*S+l*I+h,B=i*g+s*S+E*I+d;return n[0]=M,n[1]=x,n[2]=O,n[3]=0,n[4]=w,n[5]=C,n[6]=L,n[7]=0,n[8]=P,n[9]=b,n[10]=U,n[11]=0,n[12]=F,n[13]=D,n[14]=B,n[15]=1,n},E.multiplyByMatrix3=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],E=e[10],f=t[0],h=t[1],d=t[2],p=t[3],y=t[4],m=t[5],_=t[6],T=t[7],v=t[8],R=r*f+o*h+c*d,A=a*f+u*h+l*d,N=i*f+s*h+E*d,g=r*p+o*y+c*m,S=a*p+u*y+l*m,I=i*p+s*y+E*m,M=r*_+o*T+c*v,x=a*_+u*T+l*v,O=i*_+s*T+E*v;return n[0]=R,n[1]=A,n[2]=N,n[3]=0,n[4]=g,n[5]=S,n[6]=I,n[7]=0,n[8]=M,n[9]=x,n[10]=O,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},E.multiplyByTranslation=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=r*e[0]+a*e[4]+i*e[8]+e[12],u=r*e[1]+a*e[5]+i*e[9]+e[13],s=r*e[2]+a*e[6]+i*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=s,n[15]=e[15],n};var m=new e;E.multiplyByUniformScale=function(e,t,n){return m.x=t,m.y=t,m.z=t,E.multiplyByScale(e,m,n)},E.multiplyByScale=function(e,t,n){var r=t.x,a=t.y,i=t.z;return 1===r&&1===a&&1===i?E.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=a*e[4],n[5]=a*e[5],n[6]=a*e[6],n[7]=0,n[8]=i*e[8],n[9]=i*e[9],n[10]=i*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},E.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=t.w,u=e[0]*r+e[4]*a+e[8]*i+e[12]*o,s=e[1]*r+e[5]*a+e[9]*i+e[13]*o,c=e[2]*r+e[6]*a+e[10]*i+e[14]*o,l=e[3]*r+e[7]*a+e[11]*i+e[15]*o;return n.x=u,n.y=s,n.z=c,n.w=l,n},E.multiplyByPointAsVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i,u=e[1]*r+e[5]*a+e[9]*i,s=e[2]*r+e[6]*a+e[10]*i;return n.x=o,n.y=u,n.z=s,n},E.multiplyByPoint=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i+e[12],u=e[1]*r+e[5]*a+e[9]*i+e[13],s=e[2]*r+e[6]*a+e[10]*i+e[14];return n.x=o,n.y=u,n.z=s,n},E.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},E.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},E.transpose=function(e,t){var n=e[1],r=e[2],a=e[3],i=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=o,t[14]=u,t[15]=e[15],t},E.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},E.equals=function(e,t){return e===t||a(e)&&a(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},E.equalsEpsilon=function(e,t,n){return e===t||a(e)&&a(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},E.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},E.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};var _=new c,T=new c,v=new t,R=new t(0,0,0,1);return E.inverse=function(e,n){if(c.equalsEpsilon(E.getRotation(e,_),T,s.EPSILON7)&&t.equals(E.getRow(e,3,v),R))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],a=e[4],i=e[8],o=e[12],u=e[1],f=e[5],h=e[9],d=e[13],p=e[2],y=e[6],m=e[10],A=e[14],N=e[3],g=e[7],S=e[11],I=e[15],M=m*I,x=A*S,O=y*I,w=A*g,C=y*S,L=m*g,P=p*I,b=A*N,U=p*S,F=m*N,D=p*g,B=y*N,z=M*f+w*h+C*d-(x*f+O*h+L*d),G=x*u+P*h+F*d-(M*u+b*h+U*d),q=O*u+b*f+D*d-(w*u+P*f+B*d),V=L*u+U*f+B*h-(C*u+F*f+D*h),X=x*a+O*i+L*o-(M*a+w*i+C*o),W=M*r+b*i+U*o-(x*r+P*i+F*o),H=w*r+P*a+B*o-(O*r+b*a+D*o),Y=C*r+F*a+D*i-(L*r+U*a+B*i);M=i*d,x=o*h,O=a*d,w=o*f,C=a*h,L=i*f,P=r*d,b=o*u,U=r*h,F=i*u,D=r*f,B=a*u;var k=M*g+w*S+C*I-(x*g+O*S+L*I),Z=x*N+P*S+F*I-(M*N+b*S+U*I),K=O*N+b*g+D*I-(w*N+P*g+B*I),j=L*N+U*g+B*S-(C*N+F*g+D*S),Q=O*m+L*A+x*y-(C*A+M*y+w*m),J=U*A+M*p+b*m-(P*m+F*A+x*p),$=P*y+B*A+w*p-(D*A+O*p+b*y),ee=D*m+C*p+F*y-(U*y+B*m+L*p),te=r*z+a*G+i*q+o*V;if(Math.abs(te)<s.EPSILON20)throw new l("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=z*te,n[1]=G*te,n[2]=q*te,n[3]=V*te,n[4]=X*te,n[5]=W*te,n[6]=H*te,n[7]=Y*te,n[8]=k*te,n[9]=Z*te,n[10]=K*te,n[11]=j*te,n[12]=Q*te,n[13]=J*te,n[14]=$*te,n[15]=ee*te,n},E.inverseTransformation=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],E=e[12],f=e[13],h=e[14],d=-n*E-r*f-a*h,p=-i*E-o*f-u*h,y=-s*E-c*f-l*h;return t[0]=n,t[1]=i,t[2]=s,t[3]=0,t[4]=r,t[5]=o,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=l,t[11]=0,t[12]=d,t[13]=p,t[14]=y,t[15]=1,t},E.IDENTITY=u(new E(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),E.ZERO=u(new E(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),E.COLUMN0ROW0=0,E.COLUMN0ROW1=1,E.COLUMN0ROW2=2,E.COLUMN0ROW3=3,E.COLUMN1ROW0=4,E.COLUMN1ROW1=5,E.COLUMN1ROW2=6,E.COLUMN1ROW3=7,E.COLUMN2ROW0=8,E.COLUMN2ROW1=9,E.COLUMN2ROW2=10,E.COLUMN2ROW3=11,E.COLUMN3ROW0=12,E.COLUMN3ROW1=13,E.COLUMN3ROW2=14,E.COLUMN3ROW3=15,i(E.prototype,{length:{get:function(){return E.packedLength}}}),E.prototype.clone=function(e){return E.clone(this,e)},E.prototype.equals=function(e){return E.equals(this,e)},E.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},E.prototype.equalsEpsilon=function(e,t){return E.equalsEpsilon(this,e,t)},E.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]+")"},E}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,E){"use strict";function f(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var h=new e,d=new e,p=new e,y=new e,m=new e,_=new e,T=new e,v=new e,R=new e,A=new e,N=new e,g=new e;f.fromPoints=function(t,n){if(a(n)||(n=new f),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var r=e.clone(t[0],T),i=e.clone(r,h),o=e.clone(r,d),u=e.clone(r,p),s=e.clone(r,y),c=e.clone(r,m),l=e.clone(r,_),E=t.length,S=1;S<E;S++){e.clone(t[S],r);var I=r.x,M=r.y,x=r.z;I<i.x&&e.clone(r,i),I>s.x&&e.clone(r,s),M<o.y&&e.clone(r,o),M>c.y&&e.clone(r,c),x<u.z&&e.clone(r,u),x>l.z&&e.clone(r,l)}var O=e.magnitudeSquared(e.subtract(s,i,v)),w=e.magnitudeSquared(e.subtract(c,o,v)),C=e.magnitudeSquared(e.subtract(l,u,v)),L=i,P=s,b=O;w>b&&(b=w,L=o,P=c),C>b&&(b=C,L=u,P=l);var U=R;U.x=.5*(L.x+P.x),U.y=.5*(L.y+P.y),U.z=.5*(L.z+P.z);var F=e.magnitudeSquared(e.subtract(P,U,v)),D=Math.sqrt(F),B=A;B.x=i.x,B.y=o.y,B.z=u.z;var z=N;z.x=s.x,z.y=c.y,z.z=l.z;var G=e.multiplyByScalar(e.add(B,z,v),.5,g),q=0;for(S=0;S<E;S++){e.clone(t[S],r);var V=e.magnitude(e.subtract(r,G,v));V>q&&(q=V);var X=e.magnitudeSquared(e.subtract(r,U,v));if(X>F){var W=Math.sqrt(X);D=.5*(D+W),F=D*D;var H=W-D;U.x=(D*U.x+H*r.x)/W,U.y=(D*U.y+H*r.y)/W,U.z=(D*U.z+H*r.z)/W}}return D<q?(e.clone(U,n.center),n.radius=D):(e.clone(G,n.center),n.radius=q),n};var S=new o,I=new e,M=new e,x=new t,O=new t;f.fromRectangle2D=function(e,t,n){return f.fromRectangleWithHeights2D(e,t,0,0,n)},f.fromRectangleWithHeights2D=function(t,n,i,o,u){if(a(u)||(u=new f),!a(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;n=r(n,S),E.southwest(t,x),x.height=i,E.northeast(t,O),O.height=o;var s=n.project(x,I),c=n.project(O,M),l=c.x-s.x,h=c.y-s.y,d=c.z-s.z;u.radius=.5*Math.sqrt(l*l+h*h+d*d);var p=u.center;return p.x=s.x+.5*l,p.y=s.y+.5*h,p.z=s.z+.5*d,u};var w=[];f.fromRectangle3D=function(e,t,n,o){t=r(t,i.WGS84),n=r(n,0);var u;return a(e)&&(u=E.subsample(e,t,n,w)),f.fromPoints(u,o)},f.fromVertices=function(t,n,i,o){if(a(o)||(o=new f),!a(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;n=r(n,e.ZERO),i=r(i,3);var u=T;u.x=t[0]+n.x,u.y=t[1]+n.y,u.z=t[2]+n.z;for(var s=e.clone(u,h),c=e.clone(u,d),l=e.clone(u,p),E=e.clone(u,y),S=e.clone(u,m),I=e.clone(u,_),M=t.length,x=0;x<M;x+=i){var O=t[x]+n.x,w=t[x+1]+n.y,C=t[x+2]+n.z;u.x=O,u.y=w,u.z=C,O<s.x&&e.clone(u,s),O>E.x&&e.clone(u,E),w<c.y&&e.clone(u,c),w>S.y&&e.clone(u,S),C<l.z&&e.clone(u,l),C>I.z&&e.clone(u,I)}var L=e.magnitudeSquared(e.subtract(E,s,v)),P=e.magnitudeSquared(e.subtract(S,c,v)),b=e.magnitudeSquared(e.subtract(I,l,v)),U=s,F=E,D=L;P>D&&(D=P,U=c,F=S),b>D&&(D=b,U=l,F=I);var B=R;B.x=.5*(U.x+F.x),B.y=.5*(U.y+F.y),B.z=.5*(U.z+F.z);var z=e.magnitudeSquared(e.subtract(F,B,v)),G=Math.sqrt(z),q=A;q.x=s.x,q.y=c.y,q.z=l.z;var V=N;V.x=E.x,V.y=S.y,V.z=I.z;var X=e.multiplyByScalar(e.add(q,V,v),.5,g),W=0;for(x=0;x<M;x+=i){u.x=t[x]+n.x,u.y=t[x+1]+n.y,u.z=t[x+2]+n.z;var H=e.magnitude(e.subtract(u,X,v));H>W&&(W=H);var Y=e.magnitudeSquared(e.subtract(u,B,v));if(Y>z){var k=Math.sqrt(Y);G=.5*(G+k),z=G*G;var Z=k-G;B.x=(G*B.x+Z*u.x)/k,B.y=(G*B.y+Z*u.y)/k,B.z=(G*B.z+Z*u.z)/k}}return G<W?(e.clone(B,o.center),o.radius=G):(e.clone(X,o.center),o.radius=W),o},f.fromEncodedCartesianVertices=function(t,n,r){if(a(r)||(r=new f),!a(t)||!a(n)||t.length!==n.length||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var i=T;i.x=t[0]+n[0],i.y=t[1]+n[1],i.z=t[2]+n[2];for(var o=e.clone(i,h),u=e.clone(i,d),s=e.clone(i,p),c=e.clone(i,y),l=e.clone(i,m),E=e.clone(i,_),S=t.length,I=0;I<S;I+=3){var M=t[I]+n[I],x=t[I+1]+n[I+1],O=t[I+2]+n[I+2];i.x=M,i.y=x,i.z=O,M<o.x&&e.clone(i,o),M>c.x&&e.clone(i,c),x<u.y&&e.clone(i,u),x>l.y&&e.clone(i,l),O<s.z&&e.clone(i,s),O>E.z&&e.clone(i,E)}var w=e.magnitudeSquared(e.subtract(c,o,v)),C=e.magnitudeSquared(e.subtract(l,u,v)),L=e.magnitudeSquared(e.subtract(E,s,v)),P=o,b=c,U=w;C>U&&(U=C,P=u,b=l),L>U&&(U=L,P=s,b=E);var F=R;F.x=.5*(P.x+b.x),F.y=.5*(P.y+b.y),F.z=.5*(P.z+b.z);var D=e.magnitudeSquared(e.subtract(b,F,v)),B=Math.sqrt(D),z=A;z.x=o.x,z.y=u.y,z.z=s.z;var G=N;G.x=c.x,G.y=l.y,G.z=E.z;var q=e.multiplyByScalar(e.add(z,G,v),.5,g),V=0;for(I=0;I<S;I+=3){i.x=t[I]+n[I],i.y=t[I+1]+n[I+1],i.z=t[I+2]+n[I+2];var X=e.magnitude(e.subtract(i,q,v));X>V&&(V=X);var W=e.magnitudeSquared(e.subtract(i,F,v));if(W>D){var H=Math.sqrt(W);B=.5*(B+H),D=B*B;var Y=H-B;F.x=(B*F.x+Y*i.x)/H,F.y=(B*F.y+Y*i.y)/H,F.z=(B*F.z+Y*i.z)/H}}return B<V?(e.clone(F,r.center),r.radius=B):(e.clone(q,r.center),r.radius=V),r},f.fromCornerPoints=function(t,n,r){a(r)||(r=new f);var i=r.center;return e.add(t,n,i),e.multiplyByScalar(i,.5,i),r.radius=e.distance(i,n),r},f.fromEllipsoid=function(t,n){return a(n)||(n=new f),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var C=new e;f.fromBoundingSpheres=function(t,n){if(a(n)||(n=new f),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var r=t.length;if(1===r)return f.clone(t[0],n);if(2===r)return f.union(t[0],t[1],n);for(var i=[],o=0;o<r;o++)i.push(t[o].center);n=f.fromPoints(i,n);var u=n.center,s=n.radius;for(o=0;o<r;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,C)+c.radius)}return n.radius=s,n};var L=new e,P=new e,b=new e;f.fromOrientedBoundingBox=function(t,n){a(n)||(n=new f);var r=t.halfAxes,i=c.getColumn(r,0,L),o=c.getColumn(r,1,P),u=c.getColumn(r,2,b),s=e.magnitude(i),l=e.magnitude(o),E=e.magnitude(u);return n.center=e.clone(t.center,n.center),n.radius=Math.max(s,l,E),n},f.clone=function(t,n){if(a(t))return a(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new f(t.center,t.radius)},f.packedLength=4,f.pack=function(e,t,n){n=r(n,0);var a=e.center;return t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n]=e.radius,t},f.unpack=function(e,t,n){t=r(t,0),a(n)||(n=new f);var i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};var U=new e,F=new e;f.union=function(t,n,r){a(r)||(r=new f);var i=t.center,o=t.radius,u=n.center,s=n.radius,c=e.subtract(u,i,U),l=e.magnitude(c);if(o>=l+s)return t.clone(r),r;if(s>=l+o)return n.clone(r),r;var E=.5*(o+l+s),h=e.multiplyByScalar(c,(-o+E)/l,F);return e.add(h,i,h),e.clone(h,r.center),r.radius=E,r};var D=new e;f.expand=function(t,n,r){r=f.clone(t,r);var a=e.magnitude(e.subtract(n,r.center,D));return a>r.radius&&(r.radius=a),r},f.intersectPlane=function(t,n){var r=t.center,a=t.radius,i=n.normal,o=e.dot(i,r)+n.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},f.transform=function(e,t,n){return a(n)||(n=new f),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=l.getMaximumScale(t)*e.radius,n};var B=new e;f.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,B);return e.magnitudeSquared(r)-t.radius*t.radius},f.transformWithoutScale=function(e,t,n){return a(n)||(n=new f),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var z=new e;f.computePlaneDistances=function(t,n,r,i){a(i)||(i=new s);var o=e.subtract(t.center,n,z),u=e.dot(r,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var G=new e,q=new e,V=new e,X=new e,W=new e,H=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var Z=new o;return f.projectTo2D=function(t,n,a){n=r(n,Z);var i=n.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,G),c=e.cross(e.UNIT_Z,s,q);e.normalize(c,c);var l=e.cross(s,c,V);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var E=e.negate(l,W),h=e.negate(c,X),d=Y,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,E,p),e.add(p,h,p),p=d[3],e.add(s,E,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,E,p),e.add(p,h,p),p=d[7],e.add(s,E,p),e.add(p,c,p);for(var y=d.length,m=0;m<y;++m){var _=d[m];e.add(o,_,_);var T=i.cartesianToCartographic(_,H);n.project(T,_)}a=f.fromPoints(d,a),o=a.center;var v=o.x,R=o.y,A=o.z;return o.x=A,o.y=v,o.z=R,a},f.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},f.equals=function(t,n){return t===n||a(t)&&a(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},f.prototype.intersectPlane=function(e){return f.intersectPlane(this,e)},f.prototype.distanceSquaredTo=function(e){return f.distanceSquaredTo(this,e)},f.prototype.computePlaneDistances=function(e,t,n){return f.computePlaneDistances(this,e,t,n)},f.prototype.isOccluded=function(e){return f.isOccluded(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/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n){this.x=t(e,0),this.y=t(n,0)}o.fromElements=function(e,t,r){return n(r)?(r.x=e,r.y=t,r):new o(e,t)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t):new o(e.x,e.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r]=e.y,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=2*r:t=new Array(2*r);for(var a=0;a<r;++a)o.pack(e[a],t,2*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/2:t=new Array(r/2);for(var a=0;a<r;a+=2){var i=a/2;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y)},o.minimumComponent=function(e){return Math.min(e.x,e.y)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){return o.normalize(e,c),o.normalize(t,l),i.acosClamped(o.dot(c,l))};var E=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,E);return o.abs(n,n),t=n.x<=n.y?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)},o.ZERO=a(new o(0,0)),o.UNIT_X=a(new o(1,0)),o.UNIT_Y=a(new o(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,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return t(a,{ +element:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(r.requestFullscreen=a,n=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(r.requestFullscreen=a,n=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?r.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(r.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?r.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(r.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?r.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(r.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),r.fullscreenerror=a)}return n},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[r.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function a(){if(!t(R)&&(R=!1,!f())){var e=/ Chrome\/([\.0-9]+)/.exec(v.userAgent);null!==e&&(R=!0,A=r(e[1]))}return R}function i(){return a()&&A}function o(){if(!t(N)&&(N=!1,!a()&&!f()&&/ Safari\/[\.0-9]+/.test(v.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(v.userAgent);null!==e&&(N=!0,g=r(e[1]))}return N}function u(){return o()&&g}function s(){if(!t(S)){S=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(v.userAgent);null!==e&&(S=!0,I=r(e[1]),I.isNightly=!!e[2])}return S}function c(){return s()&&I}function l(){if(!t(M)){M=!1;var e;"Microsoft Internet Explorer"===v.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(v.userAgent),null!==e&&(M=!0,x=r(e[1]))):"Netscape"===v.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(v.userAgent),null!==e&&(M=!0,x=r(e[1])))}return M}function E(){return l()&&x}function f(){if(!t(O)){O=!1;var e=/ Edge\/([\.0-9]+)/.exec(v.userAgent);null!==e&&(O=!0,w=r(e[1]))}return O}function h(){return f()&&w}function d(){if(!t(C)){C=!1;var e=/Firefox\/([\.0-9]+)/.exec(v.userAgent);null!==e&&(C=!0,L=r(e[1]))}return C}function p(){return t(P)||(P=/Windows/i.test(v.appVersion)),P}function y(){return d()&&L}function m(){return t(b)||(b="undefined"!=typeof PointerEvent&&(!t(v.pointerEnabled)||v.pointerEnabled)),b}function _(){if(!t(F)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;F=t(n)&&""!==n,F&&(U=n)}return F}function T(){return _()?U:void 0}var v;v="undefined"!=typeof navigator?navigator:{};var R,A,N,g,S,I,M,x,O,w,C,L,P,b,U,F,D={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:E,isEdge:f,edgeVersion:h,isFirefox:d,firefoxVersion:y,isWindows:p,hardwareConcurrency:e(v.hardwareConcurrency,3),supportsPointerEvents:m,supportsImageRenderingPixelated:_,imageRenderingValue:T};return D.supportsFullscreen=function(){return n.supportsFullscreen()},D.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},D.supportsWebWorkers=function(){return"undefined"!=typeof Worker},D}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,a,i){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){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.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},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 Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,a){switch(r=e(r,0),a=e(a,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,a);case o.SHORT:return new Int16Array(n,r,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,a);case o.INT:return new Int32Array(n,r,a);case o.UNSIGNED_INT:return new Uint32Array(n,r,a);case o.FLOAT:return new Float32Array(n,r,a);case o.DOUBLE:return new Float64Array(n,r,a)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===n.POINTS||e===n.LINES||e===n.LINE_LOOP||e===n.LINE_STRIP||e===n.TRIANGLES||e===n.TRIANGLE_STRIP||e===n.TRIANGLE_FAN}};return e(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,a){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,a.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return i.computeNumberOfVertices=function(e){var n=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var a=e.attributes[r],i=a.values.length/a.componentsPerAttribute;n=i}return n},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(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 r}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/GeometryInstance",["./defaultValue","./defined","./DeveloperError","./Matrix4"],function(e,t,n,r){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.geometry=t.geometry,this.modelMatrix=r.clone(e(t.modelMatrix,r.IDENTITY)),this.id=t.id,this.pickPrimitive=t.pickPrimitive,this.attributes=e(t.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}return a}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r,a){"use strict";var i={};i.octEncodeInRange=function(e,t,n){if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var r=n.x,i=n.y;n.x=(1-Math.abs(i))*a.signNotZero(r),n.y=(1-Math.abs(r))*a.signNotZero(i)}return n.x=a.toSNorm(n.x,t),n.y=a.toSNorm(n.y,t),n},i.octEncode=function(e,t){return i.octEncodeInRange(e,255,t)},i.octDecodeInRange=function(e,n,r,i){if(i.x=a.fromSNorm(e,r),i.y=a.fromSNorm(n,r),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){var o=i.x;i.x=(1-Math.abs(i.y))*a.signNotZero(o),i.y=(1-Math.abs(o))*a.signNotZero(i.y)}return t.normalize(i,i)},i.octDecode=function(e,t,n){return i.octDecodeInRange(e,t,255,n)},i.octPackFloat=function(e){return 256*e.x+e.y};var o=new e;return i.octEncodeFloat=function(e){return i.octEncode(e,o),i.octPackFloat(o)},i.octDecodeFloat=function(e,t){var n=e/256,r=Math.floor(n),a=256*(n-r);return i.octDecode(r,a,t)},i.octPack=function(e,t,n,r){var a=i.octEncodeFloat(e),u=i.octEncodeFloat(t),s=i.octEncode(n,o);return r.x=65536*s.x+a,r.y=65536*s.y+u,r},i.octUnpack=function(e,t,n,r){var a=e.x/65536,o=Math.floor(a),u=65536*(a-o);a=e.y/65536;var s=Math.floor(a),c=65536*(a-s);i.octDecodeFloat(u,t),i.octDecodeFloat(c,n),i.octDecode(o,s,r)},i.compressTextureCoordinates=function(e){var t=4095*e.x|0,n=4095*e.y|0;return 4096*t+n},i.decompressTextureCoordinates=function(e,t){var n=e/4096,r=Math.floor(n);return t.x=r/4095,t.y=(e-4096*r)/4095,t},i}),define("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(r,a,s,c,l){n(l)||(l=new t);var E,f,h,d,p,y,m,_;n(a.z)?(E=t.subtract(s,a,i),f=t.subtract(c,a,o),h=t.subtract(r,a,u),d=t.dot(E,E),p=t.dot(E,f),y=t.dot(E,h),m=t.dot(f,f),_=t.dot(f,h)):(E=e.subtract(s,a,i),f=e.subtract(c,a,o),h=e.subtract(r,a,u),d=e.dot(E,E),p=e.dot(E,f),y=e.dot(E,h),m=e.dot(f,f),_=e.dot(f,h));var T=1/(d*m-p*p);return l.y=(m*y-p*_)*T,l.z=(d*_-p*y)*T,l.x=1-l.y-l.z,l}var i=new t,o=new t,u=new t;return a}),define("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n,r){t(a[n])||(a[n]=!0,console.warn(e(r,n)))}var a={};return r.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.",r}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,n){"use strict";function r(e,t){n(e,t)}return r}),define("Core/EncodedCartesian3",["./Cartesian3","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(){this.high=e.clone(e.ZERO),this.low=e.clone(e.ZERO)}r.encode=function(e,n){t(n)||(n={high:0,low:0});var r;return e>=0?(r=65536*Math.floor(e/65536),n.high=r,n.low=e-r):(r=65536*Math.floor(-e/65536),n.high=-r,n.low=e+r),n};var a={high:0,low:0};r.fromCartesian=function(e,n){t(n)||(n=new r);var i=n.high,o=n.low;return r.encode(e.x,a),i.x=a.high,o.x=a.low,r.encode(e.y,a),i.y=a.high,o.y=a.low,r.encode(e.z,a),i.z=a.high,o.z=a.low,n};var i=new r;return r.writeElements=function(e,t,n){r.fromCartesian(e,i);var a=i.high,o=i.low;t[n]=a.x,t[n+1]=a.y,t[n+2]=a.z,t[n+3]=o.x,t[n+4]=o.y,t[n+5]=o.z},r}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,n,r,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(e){switch(e){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(t){return e(t)&&(t===i.UNSIGNED_BYTE||t===i.UNSIGNED_SHORT||t===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,n,a){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,a):new Uint16Array(t,n,a)},n(i)}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function n(e,n,r){var a=e+n;return t.sign(e)!==t.sign(n)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(n)))<r?0:a}var r={};return r.computeDiscriminant=function(e,t,n){var r=t*t-4*e*n;return r},r.computeRealRoots=function(e,r,a){var i;if(0===e)return 0===r?[]:[-a/r];if(0===r){if(0===a)return[0,0];var o=Math.abs(a),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,i<0)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-r/e,i<0?[i,0]:[0,i];var c=r*r,l=4*e*a,E=n(c,-l,t.EPSILON14);if(E<0)return[];var f=-.5*n(r,t.sign(r)*Math.sqrt(E),t.EPSILON14);return r>0?[f/e,a/f]:[a/f,f/e]},r}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function n(e,t,n,r){var a,i,o=e,u=t/3,s=n/3,c=r,l=o*s,E=u*c,f=u*u,h=s*s,d=o*s-f,p=o*c-u*s,y=u*c-h,m=4*d*y-p*p;if(m<0){var _,T,v;f*E>=l*h?(_=o,T=d,v=-2*u*d+o*p):(_=c,T=y,v=-c*p+2*s*y);var R=v<0?-1:1,A=-R*Math.abs(_)*Math.sqrt(-m);i=-v+A;var N=i/2,g=N<0?-Math.pow(-N,1/3):Math.pow(N,1/3),S=i===A?-g:-T/g;return a=T<=0?g+S:-v/(g*g+S*S+T),f*E>=l*h?[(a-u)/o]:[-c/(a+s)]}var I=d,M=-2*u*d+o*p,x=y,O=-c*p+2*s*y,w=Math.sqrt(m),C=Math.sqrt(3)/2,L=Math.abs(Math.atan2(o*w,-M)/3);a=2*Math.sqrt(-I);var P=Math.cos(L);i=a*P;var b=a*(-P/2-C*Math.sin(L)),U=i+b>2*u?i-u:b-u,F=o,D=U/F;L=Math.abs(Math.atan2(c*w,-O)/3),a=2*Math.sqrt(-x),P=Math.cos(L),i=a*P,b=a*(-P/2-C*Math.sin(L));var B=-c,z=i+b<2*s?i+s:b+s,G=B/z,q=F*z,V=-U*z-F*B,X=U*B,W=(s*V-u*X)/(-u*V+s*q);return D<=W?D<=G?W<=G?[D,W,G]:[D,G,W]:[G,D,W]:D<=G?[W,D,G]:W<=G?[W,G,D]:[G,W,D]}var r={};return r.computeDiscriminant=function(e,t,n,r){var a=e*e,i=t*t,o=n*n,u=r*r,s=18*e*t*n*r+i*o-27*a*u-4*(e*o*n+i*t*r);return s},r.computeRealRoots=function(e,r,a,i){var o,u;if(0===e)return t.computeRealRoots(r,a,i);if(0===r){if(0===a){if(0===i)return[0,0,0];u=-i/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===i?(o=t.computeRealRoots(e,0,a),0===o.Length?[0]:[o[0],0,o[1]]):n(e,0,a,i)}return 0===a?0===i?(u=-r/e,u<0?[u,0,0]:[0,0,u]):n(e,r,0,i):0===i?(o=t.computeRealRoots(e,r,a),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):n(e,r,a,i)},r}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,n,r){"use strict";function a(t,a,i,o){var u=t*t,s=a-3*u/8,c=i-a*t/2+u*t/8,l=o-i*t/4+a*u/16-3*u*u/256,E=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(E.length>0){var f=-t/4,h=E[E.length-1];if(Math.abs(h)<n.EPSILON14){var d=r.computeRealRoots(1,s,l);if(2===d.length){var p,y=d[0],m=d[1];if(y>=0&&m>=0){var _=Math.sqrt(y),T=Math.sqrt(m);return[f-T,f-_,f+_,f+T]}if(y>=0&&m<0)return p=Math.sqrt(y),[f-p,f+p];if(y<0&&m>=0)return p=Math.sqrt(m),[f-p,f+p]}return[]}if(h>0){var v=Math.sqrt(h),R=(s+h-c/v)/2,A=(s+h+c/v)/2,N=r.computeRealRoots(1,v,R),g=r.computeRealRoots(1,-v,A);return 0!==N.length?(N[0]+=f,N[1]+=f,0!==g.length?(g[0]+=f,g[1]+=f,N[1]<=g[0]?[N[0],N[1],g[0],g[1]]:g[1]<=N[0]?[g[0],g[1],N[0],N[1]]:N[0]>=g[0]&&N[1]<=g[1]?[g[0],N[0],N[1],g[1]]:g[0]>=N[0]&&g[1]<=N[1]?[N[0],g[0],g[1],N[1]]:N[0]>g[0]&&N[0]<g[1]?[g[0],N[0],g[1],N[1]]:[N[0],g[0],N[1],g[1]]):N):0!==g.length?(g[0]+=f,g[1]+=f,g):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,E=i*t+s-4*o,f=c*o-i*a*t+u,h=e.computeRealRoots(1,l,E,f);if(h.length>0){var d,p,y=h[0],m=a-y,_=m*m,T=t/2,v=m/2,R=_-4*o,A=_+4*Math.abs(o),N=c-4*y,g=c+4*Math.abs(y);if(y<0||R*g<N*A){var S=Math.sqrt(N);d=S/2,p=0===S?0:(t*v-i)/S}else{var I=Math.sqrt(R);d=0===I?0:(t*v-i)/I,p=I/2}var M,x;0===T&&0===d?(M=0,x=0):n.sign(T)===n.sign(d)?(M=T+d,x=y/M):(x=T-d,M=y/x);var O,w;0===v&&0===p?(O=0,w=0):n.sign(v)===n.sign(p)?(O=v+p,w=o/O):(w=v-p,O=o/w);var C=r.computeRealRoots(1,M,O),L=r.computeRealRoots(1,x,w);if(0!==C.length)return 0!==L.length?C[1]<=L[0]?[C[0],C[1],L[0],L[1]]:L[1]<=C[0]?[L[0],L[1],C[0],C[1]]:C[0]>=L[0]&&C[1]<=L[1]?[L[0],C[0],C[1],L[1]]:L[0]>=C[0]&&L[1]<=C[1]?[C[0],L[0],L[1],C[1]]:C[0]>L[0]&&C[0]<L[1]?[L[0],C[0],L[1],C[1]]:[C[0],L[0],C[1],L[1]]:C;if(0!==L.length)return L}return[]}var o={};return o.computeDiscriminant=function(e,t,n,r,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=n*n,l=c*n,E=r*r,f=E*r,h=a*a,d=h*a,p=u*c*E-4*s*f-4*e*l*E+18*e*t*n*f-27*i*E*E+256*o*d+a*(18*s*n*r-4*u*l+16*e*c*c-80*e*t*c*r-6*e*u*E+144*i*n*E)+h*(144*e*u*n-27*u*u-128*i*c-192*i*t*r);return p},o.computeRealRoots=function(t,r,o,u,s){if(Math.abs(t)<n.EPSILON15)return e.computeRealRoots(r,o,u,s);var c=r/t,l=o/t,E=u/t,f=s/t,h=c<0?1:0;switch(h+=l<0?h+1:h,h+=E<0?h+1:h,h+=f<0?h+1:h){case 0:return a(c,l,E,f);case 1:return i(c,l,E,f);case 2:return i(c,l,E,f);case 3:return a(c,l,E,f);case 4:return a(c,l,E,f);case 5:return i(c,l,E,f);case 6:return a(c,l,E,f);case 7:return a(c,l,E,f);case 8:return i(c,l,E,f);case 9:return a(c,l,E,f);case 10:return a(c,l,E,f);case 11:return i(c,l,E,f);case 12:return a(c,l,E,f);case 13:return a(c,l,E,f);case 14:return a(c,l,E,f);case 15:return a(c,l,E,f);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=e.clone(t(r,e.ZERO)),e.equals(r,e.ZERO)||e.normalize(r,r),this.origin=e.clone(t(n,e.ZERO)),this.direction=r}return a.getPoint=function(t,r,a){return n(a)||(a=new e),a=e.multiplyByScalar(t.direction,r,a),e.add(t.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,n,r,a,i,o,u,s,c,l){"use strict";function E(e,t,n,r){var a=t*t-4*e*n;if(!(a<0)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return u<s?(r.root0=u,r.root1=s):(r.root0=s,r.root1=u),r}var c=-t/(2*e);if(0!==c)return r.root0=r.root1=c,r}}function f(t,n,a){r(a)||(a=new i);var o=t.origin,u=t.direction,s=n.center,c=n.radius*n.radius,l=e.subtract(o,s,_),f=e.dot(u,u),h=2*e.dot(u,l),d=e.magnitudeSquared(l)-c,p=E(f,h,d,A); +if(r(p))return a.start=p.root0,a.stop=p.root1,a}function h(e,t,n){var r=e+t;return o.sign(e)!==o.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))<n?0:r}function d(t,n,r,a,i){var l,E=a*a,f=i*i,d=(t[u.COLUMN1ROW1]-t[u.COLUMN2ROW2])*f,p=i*(a*h(t[u.COLUMN1ROW0],t[u.COLUMN0ROW1],o.EPSILON15)+n.y),y=t[u.COLUMN0ROW0]*E+t[u.COLUMN2ROW2]*f+a*n.x+r,m=f*h(t[u.COLUMN2ROW1],t[u.COLUMN1ROW2],o.EPSILON15),_=i*(a*h(t[u.COLUMN2ROW0],t[u.COLUMN0ROW2])+n.z),T=[];if(0===_&&0===m){if(l=s.computeRealRoots(d,p,y),0===l.length)return T;var v=l[0],R=Math.sqrt(Math.max(1-v*v,0));if(T.push(new e(a,i*v,i*-R)),T.push(new e(a,i*v,i*R)),2===l.length){var A=l[1],N=Math.sqrt(Math.max(1-A*A,0));T.push(new e(a,i*A,i*-N)),T.push(new e(a,i*A,i*N))}return T}var g=_*_,S=m*m,I=d*d,M=_*m,x=I+S,O=2*(p*d+M),w=2*y*d+p*p-S+g,C=2*(y*p-M),L=y*y-g;if(0===x&&0===O&&0===w&&0===C)return T;l=c.computeRealRoots(x,O,w,C,L);var P=l.length;if(0===P)return T;for(var b=0;b<P;++b){var U,F=l[b],D=F*F,B=Math.max(1-D,0),z=Math.sqrt(B);U=o.sign(d)===o.sign(y)?h(d*D+y,p*F,o.EPSILON12):o.sign(y)===o.sign(p*F)?h(d*D,p*F+y,o.EPSILON12):h(d*D+p*F,y,o.EPSILON12);var G=h(m*F,_,o.EPSILON15),q=U*G;q<0?T.push(new e(a,i*F,i*z)):q>0?T.push(new e(a,i*F,i*-z)):0!==z?(T.push(new e(a,i*F,i*-z)),T.push(new e(a,i*F,i*z)),++b):T.push(new e(a,i*F,i*z))}return T}var p={};p.rayPlane=function(t,n,a){r(a)||(a=new e);var i=t.origin,u=t.direction,s=n.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON15)){var l=(-n.distance-e.dot(s,i))/c;if(!(l<0))return a=e.multiplyByScalar(u,l,a),e.add(i,a,a)}};var y=new e,m=new e,_=new e,T=new e,v=new e;p.rayTriangleParametric=function(t,r,a,i,u){u=n(u,!1);var s,c,l,E,f,h=t.origin,d=t.direction,p=e.subtract(a,r,y),R=e.subtract(i,r,m),A=e.cross(d,R,_),N=e.dot(p,A);if(u){if(N<o.EPSILON6)return;if(s=e.subtract(h,r,T),l=e.dot(s,A),l<0||l>N)return;if(c=e.cross(s,p,v),E=e.dot(d,c),E<0||l+E>N)return;f=e.dot(R,c)/N}else{if(Math.abs(N)<o.EPSILON6)return;var g=1/N;if(s=e.subtract(h,r,T),l=e.dot(s,A)*g,l<0||l>1)return;if(c=e.cross(s,p,v),E=e.dot(d,c)*g,E<0||l+E>1)return;f=e.dot(R,c)*g}return f},p.rayTriangle=function(t,n,a,i,o,u){var s=p.rayTriangleParametric(t,n,a,i,o);if(r(s)&&!(s<0))return r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var R=new l;p.lineSegmentTriangle=function(t,n,a,i,o,u,s){var c=R;e.clone(t,c.origin),e.subtract(n,t,c.direction),e.normalize(c.direction,c.direction);var l=p.rayTriangleParametric(c,a,i,o,u);if(!(!r(l)||l<0||l>e.distance(t,n)))return r(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var A={root0:0,root1:0};p.raySphere=function(e,t,n){if(n=f(e,t,n),r(n)&&!(n.stop<0))return n.start=Math.max(n.start,0),n};var N=new l;p.lineSegmentSphere=function(t,n,a,i){var o=N;e.clone(t,o.origin);var u=e.subtract(n,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),i=f(o,a,i),!(!r(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var g=new e,S=new e;p.rayEllipsoid=function(t,n){var r,a,o,u,s,c=n.oneOverRadii,l=e.multiplyComponents(c,t.origin,g),E=e.multiplyComponents(c,t.direction,S),f=e.magnitudeSquared(l),h=e.dot(l,E);if(f>1){if(h>=0)return;var d=h*h;if(r=f-1,a=e.magnitudeSquared(E),o=a*r,d<o)return;if(d>o){u=h*h-o,s=-h+Math.sqrt(u);var p=s/a,y=r/s;return p<y?new i(p,y):{start:y,stop:p}}var m=Math.sqrt(r/a);return new i(m,m)}return f<1?(r=f-1,a=e.magnitudeSquared(E),o=a*r,u=h*h-o,s=-h+Math.sqrt(u),new i(0,s/a)):h<0?(a=e.magnitudeSquared(E),new i(0,-h/a)):void 0};var I=new e,M=new e,x=new e,O=new e,w=new e,C=new u,L=new u,P=new u,b=new u,U=new u,F=new u,D=new u,B=new e,z=new e,G=new t;p.grazingAltitudeLocation=function(t,n){var a=t.origin,i=t.direction;if(!e.equals(a,e.ZERO)){var s=n.geodeticSurfaceNormal(a,I);if(e.dot(i,s)>=0)return a}var c=r(this.rayEllipsoid(t,n)),l=n.transformPositionToScaledSpace(i,I),E=e.normalize(l,l),f=e.mostOrthogonalAxis(l,O),h=e.normalize(e.cross(f,E,M),M),p=e.normalize(e.cross(E,h,x),x),y=C;y[0]=E.x,y[1]=E.y,y[2]=E.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 m=u.transpose(y,L),_=u.fromScale(n.radii,P),T=u.fromScale(n.oneOverRadii,b),v=U;v[0]=0,v[1]=-i.z,v[2]=i.y,v[3]=i.z,v[4]=0,v[5]=-i.x,v[6]=-i.y,v[7]=i.x,v[8]=0;var R,A,N=u.multiply(u.multiply(m,T,F),v,F),g=u.multiply(u.multiply(N,_,D),y,D),S=u.multiplyByVector(N,a,w),q=d(g,e.negate(S,I),0,0,1),V=q.length;if(V>0){for(var X=e.clone(e.ZERO,z),W=Number.NEGATIVE_INFINITY,H=0;H<V;++H){R=u.multiplyByVector(_,u.multiplyByVector(y,q[H],B),B);var Y=e.normalize(e.subtract(R,a,O),O),k=e.dot(Y,i);k>W&&(W=k,X=e.clone(R,X))}var Z=n.cartesianToCartographic(X,G);return W=o.clamp(W,0,1),A=e.magnitude(e.subtract(X,a,O))*Math.sqrt(1-W*W),A=c?-A:A,Z.height=A,n.cartographicToCartesian(Z,new e)}};var q=new e;return p.lineSegmentPlane=function(t,n,a,i){r(i)||(i=new e);var u=e.subtract(n,t,q),s=a.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON6)){var l=e.dot(s,t),E=-(a.distance+l)/c;if(!(E<0||E>1))return e.multiplyByScalar(u,E,i),e.add(t,i,i),i}},p.trianglePlaneIntersection=function(t,n,r,a){var i=a.normal,o=a.distance,u=e.dot(i,t)+o<0,s=e.dot(i,n)+o<0,c=e.dot(i,r)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var E,f;if(1!==l&&2!==l||(E=new e,f=new e),1===l){if(u)return p.lineSegmentPlane(t,n,a,E),p.lineSegmentPlane(t,r,a,f),{positions:[t,n,r,E,f],indices:[0,3,4,1,2,4,1,4,3]};if(s)return p.lineSegmentPlane(n,r,a,E),p.lineSegmentPlane(n,t,a,f),{positions:[t,n,r,E,f],indices:[1,3,4,2,0,4,2,4,3]};if(c)return p.lineSegmentPlane(r,t,a,E),p.lineSegmentPlane(r,n,a,f),{positions:[t,n,r,E,f],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return p.lineSegmentPlane(n,t,a,E),p.lineSegmentPlane(r,t,a,f),{positions:[t,n,r,E,f],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return p.lineSegmentPlane(r,n,a,E),p.lineSegmentPlane(t,n,a,f),{positions:[t,n,r,E,f],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return p.lineSegmentPlane(t,r,a,E),p.lineSegmentPlane(n,r,a,f),{positions:[t,n,r,E,f],indices:[0,1,4,0,4,3,2,3,4]}}},p}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";function a(t,n){this.normal=e.clone(t),this.distance=n}a.fromPointNormal=function(n,r,i){var o=-e.dot(r,n);return t(i)?(e.clone(r,i.normal),i.distance=o,i):new a(r,o)};var i=new e;return a.fromCartesian4=function(n,r){var o=e.fromCartesian4(n,i),u=n.w;return t(r)?(e.clone(o,r.normal),r.distance=u,r):new a(o,u)},a.getPointDistance=function(t,n){return e.dot(t.normal,n)+t.distance},a.ORIGIN_XY_PLANE=r(new a(e.UNIT_Z,0)),a.ORIGIN_YZ_PLANE=r(new a(e.UNIT_X,0)),a.ORIGIN_ZX_PLANE=r(new a(e.UNIT_Y,0)),a}),define("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";var r={};return r.calculateACMR=function(n){n=e(n,e.EMPTY_OBJECT);var r=n.indices,a=n.maximumIndex,i=e(n.cacheSize,24),o=r.length;if(!t(a)){a=0;for(var u=0,s=r[u];u<o;)s>a&&(a=s),++u,s=r[u]}for(var c=[],l=0;l<a+1;l++)c[l]=0;for(var E=i+1,f=0;f<o;++f)E-c[r[f]]>i&&(c[r[f]]=E,++E);return(E-i+1)/(o/3)},r.tipsify=function(n){function r(e,t,n,r){for(;t.length>=1;){var a=t[t.length-1];if(t.splice(t.length-1,1),e[a].numLiveTriangles>0)return a}for(;i<r;){if(e[i].numLiveTriangles>0)return++i,i-1;++i}return-1}function a(e,t,n,a,i,o,u){for(var s,c=-1,l=-1,E=0;E<n.length;){var f=n[E];a[f].numLiveTriangles&&(s=0,i-a[f].timeStamp+2*a[f].numLiveTriangles<=t&&(s=i-a[f].timeStamp),(s>l||l===-1)&&(l=s,c=f)),++E}return c===-1?r(a,o,e,u):c}n=e(n,e.EMPTY_OBJECT);var i,o=n.indices,u=n.maximumIndex,s=e(n.cacheSize,24),c=o.length,l=0,E=0,f=o[E],h=c;if(t(u))l=u+1;else{for(;E<h;)f>l&&(l=f),++E,f=o[E];if(l===-1)return 0;++l}for(var d=[],p=0;p<l;p++)d[p]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};E=0;for(var y=0;E<h;)d[o[E]].vertexTriangles.push(y),++d[o[E]].numLiveTriangles,d[o[E+1]].vertexTriangles.push(y),++d[o[E+1]].numLiveTriangles,d[o[E+2]].vertexTriangles.push(y),++d[o[E+2]].numLiveTriangles,++y,E+=3;var m=0,_=s+1;i=1;var T,v,R=[],A=[],N=0,g=[],S=c/3,I=[];for(p=0;p<S;p++)I[p]=!1;for(var M,x;m!==-1;){R=[],v=d[m],x=v.vertexTriangles.length;for(var O=0;O<x;++O)if(y=v.vertexTriangles[O],!I[y]){I[y]=!0,E=y+y+y;for(var w=0;w<3;++w)M=o[E],R.push(M),A.push(M),g[N]=M,++N,T=d[M],--T.numLiveTriangles,_-T.timeStamp>s&&(T.timeStamp=_,++_),++E}m=a(o,s,R,d,_,A,l)}return g},r}),define("Core/GeometryPipeline",["./AttributeCompression","./barycentricCoordinates","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./deprecationWarning","./DeveloperError","./EncodedCartesian3","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryType","./IndexDatatype","./Intersect","./IntersectionTests","./Math","./Matrix3","./Matrix4","./Plane","./PrimitiveType","./Tipsify"],function(e,t,n,r,a,i,o,u,s,c,l,E,f,h,d,p,y,m,_,T,v,R,A,N,g,S){"use strict";function I(e,t,n,r,a){e[t++]=n,e[t++]=r,e[t++]=r,e[t++]=a,e[t++]=a,e[t]=n}function M(e){for(var t=e.length,n=t/3*6,r=m.createTypedArray(t,n),a=0,i=0;i<t;i+=3,a+=6)I(r,a,e[i],e[i+1],e[i+2]);return r}function x(e){var t=e.length;if(t>=3){var n=6*(t-2),r=m.createTypedArray(t,n);I(r,0,e[0],e[1],e[2]);for(var a=6,i=3;i<t;++i,a+=6)I(r,a,e[i-1],e[i],e[i-2]);return r}return new Uint16Array}function O(e){if(e.length>0){for(var t=e.length-1,n=6*(t-1),r=m.createTypedArray(t,n),a=e[0],i=0,o=1;o<t;++o,i+=6)I(r,i,a,e[o],e[o+1]);return r}return new Uint16Array}function w(e){var t={};for(var n in e)if(e.hasOwnProperty(n)&&c(e[n])&&c(e[n].values)){var r=e[n];t[n]=new p({componentDatatype:r.componentDatatype,componentsPerAttribute:r.componentsPerAttribute,normalize:r.normalize,values:[]})}return t}function C(e,t,n){for(var r in t)if(t.hasOwnProperty(r)&&c(t[r])&&c(t[r].values))for(var a=t[r],i=0;i<a.componentsPerAttribute;++i)e[r].values.push(a.values[n*a.componentsPerAttribute+i])}function L(e,t){if(c(t))for(var n=t.values,r=n.length,i=0;i<r;i+=3)a.unpack(n,i,oe),A.multiplyByPoint(e,oe,oe),a.pack(oe,n,i)}function P(e,t){if(c(t))for(var n=t.values,r=n.length,i=0;i<r;i+=3)a.unpack(n,i,oe),R.multiplyByVector(e,oe,oe),oe=a.normalize(oe,oe),a.pack(oe,n,i)}function b(e,t){var n,r=e.length,a={},i=e[0][t].attributes;for(n in i)if(i.hasOwnProperty(n)&&c(i[n])&&c(i[n].values)){for(var o=i[n],s=o.values.length,l=!0,E=1;E<r;++E){var f=e[E][t].attributes[n];if(!c(f)||o.componentDatatype!==f.componentDatatype||o.componentsPerAttribute!==f.componentsPerAttribute||o.normalize!==f.normalize){l=!1;break}s+=f.values.length}l&&(a[n]=new p({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:u.createTypedArray(o.componentDatatype,s)}))}return a}function U(e,t){var r,i,o,u,s,l,E,f=e.length,h=(e[0].modelMatrix,c(e[0][t].indices)),p=e[0][t].primitiveType,y=b(e,t);for(r in y)if(y.hasOwnProperty(r))for(s=y[r].values,u=0,i=0;i<f;++i)for(l=e[i][t].attributes[r].values,E=l.length,o=0;o<E;++o)s[u++]=l[o];var _;if(h){var T=0;for(i=0;i<f;++i)T+=e[i][t].indices.length;var v=d.computeNumberOfVertices(new d({attributes:y,primitiveType:g.POINTS})),R=m.createTypedArray(v,T),A=0,N=0;for(i=0;i<f;++i){var S=e[i][t].indices,I=S.length;for(u=0;u<I;++u)R[A++]=N+S[u];N+=d.computeNumberOfVertices(e[i][t])}_=R}var M,x=new a,O=0;for(i=0;i<f;++i){if(M=e[i][t].boundingSphere,!c(M)){x=void 0;break}a.add(M.center,x,x)}if(c(x))for(a.divideByScalar(x,f,x),i=0;i<f;++i){M=e[i][t].boundingSphere;var w=a.magnitude(a.subtract(M.center,x,ce))+M.radius;w>O&&(O=w)}return new d({attributes:y,indices:_,primitiveType:p,boundingSphere:c(x)?new n(x,O):void 0})}function F(e){if(c(e.indices))return e;for(var t=d.computeNumberOfVertices(e),n=m.createTypedArray(t,t),r=0;r<t;++r)n[r]=r;return e.indices=n,e}function D(e){var t=d.computeNumberOfVertices(e),n=m.createTypedArray(t,3*(t-2));n[0]=1,n[1]=0,n[2]=2;for(var r=3,a=3;a<t;++a)n[r++]=a-1,n[r++]=0,n[r++]=a;return e.indices=n,e.primitiveType=g.TRIANGLES,e}function B(e){var t=d.computeNumberOfVertices(e),n=m.createTypedArray(t,3*(t-2));n[0]=0,n[1]=1,n[2]=2,t>3&&(n[3]=0,n[4]=2,n[5]=3);for(var r=6,a=3;a<t-1;a+=2)n[r++]=a,n[r++]=a-1,n[r++]=a+1,a+2<t&&(n[r++]=a,n[r++]=a+1,n[r++]=a+2);return e.indices=n,e.primitiveType=g.TRIANGLES,e}function z(e){if(c(e.indices))return e;for(var t=d.computeNumberOfVertices(e),n=m.createTypedArray(t,t),r=0;r<t;++r)n[r]=r;return e.indices=n,e}function G(e){var t=d.computeNumberOfVertices(e),n=m.createTypedArray(t,2*(t-1));n[0]=0,n[1]=1;for(var r=2,a=2;a<t;++a)n[r++]=a-1,n[r++]=a;return e.indices=n,e.primitiveType=g.LINES,e}function q(e){var t=d.computeNumberOfVertices(e),n=m.createTypedArray(t,2*t);n[0]=0,n[1]=1;for(var r=2,a=2;a<t;++a)n[r++]=a-1,n[r++]=a;return n[r++]=t-1,n[r]=0,e.indices=n,e.primitiveType=g.LINES,e}function V(e){switch(e.primitiveType){case g.TRIANGLE_FAN:return D(e);case g.TRIANGLE_STRIP:return B(e);case g.TRIANGLES:return F(e);case g.LINE_STRIP:return G(e);case g.LINE_LOOP:return q(e);case g.LINES:return z(e)}return e}function X(e,t){Math.abs(e.y)<v.EPSILON6&&(t?e.y=-v.EPSILON6:e.y=v.EPSILON6)}function W(e,t,n){if(0!==e.y&&0!==t.y&&0!==n.y)return X(e,e.y<0),X(t,t.y<0),void X(n,n.y<0);var r,a=Math.abs(e.y),i=Math.abs(t.y),o=Math.abs(n.y);r=a>i?a>o?v.sign(e.y):v.sign(n.y):i>o?v.sign(t.y):v.sign(n.y);var u=r<0;X(e,u),X(t,u),X(n,u)}function H(e,t,n,r){a.add(e,a.multiplyByScalar(a.subtract(t,e,Ae),e.y/(e.y-t.y),Ae),n),a.clone(n,r),X(n,!0),X(r,!1)}function Y(e,t,n){if(!(e.x>=0||t.x>=0||n.x>=0)){W(e,t,n);var r=e.y<0,a=t.y<0,i=n.y<0,o=0;o+=r?1:0,o+=a?1:0,o+=i?1:0;var u=Me.indices;1===o?(u[1]=3,u[2]=4,u[5]=6,u[7]=6,u[8]=5,r?(H(e,t,Ne,Se),H(e,n,ge,Ie),u[0]=0,u[3]=1,u[4]=2,u[6]=1):a?(H(t,n,Ne,Se),H(t,e,ge,Ie),u[0]=1,u[3]=2,u[4]=0,u[6]=2):i&&(H(n,e,Ne,Se),H(n,t,ge,Ie),u[0]=2,u[3]=0,u[4]=1,u[6]=0)):2===o&&(u[2]=4,u[4]=4,u[5]=3,u[7]=5,u[8]=6,r?a?i||(H(n,e,Ne,Se),H(n,t,ge,Ie),u[0]=0,u[1]=1,u[3]=0,u[6]=2):(H(t,n,Ne,Se),H(t,e,ge,Ie),u[0]=2,u[1]=0,u[3]=2,u[6]=1):(H(e,t,Ne,Se),H(e,n,ge,Ie),u[0]=1,u[1]=2,u[3]=1,u[6]=0));var s=Me.positions;return s[0]=e,s[1]=t,s[2]=n,s.length=3,1!==o&&2!==o||(s[3]=Ne,s[4]=ge,s[5]=Se,s[6]=Ie,s.length=7),Me}}function k(e,t){var r=e.attributes;if(0!==r.position.values.length){for(var a in r)if(r.hasOwnProperty(a)&&c(r[a])&&c(r[a].values)){var i=r[a];i.values=u.createTypedArray(i.componentDatatype,i.values)}var o=d.computeNumberOfVertices(e);return e.indices=m.createTypedArray(o,e.indices),t&&(e.boundingSphere=n.fromVertices(r.position.values)),e}}function Z(e){var t=e.attributes,n={};for(var r in t)if(t.hasOwnProperty(r)&&c(t[r])&&c(t[r].values)){var a=t[r];n[r]=new p({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:[]})}return new d({attributes:n,indices:[],primitiveType:e.primitiveType})}function K(e,t,n){var r=c(e.geometry.boundingSphere);t=k(t,r),n=k(n,r),c(n)&&!c(t)?e.geometry=n:!c(n)&&c(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=n,e.geometry=void 0)}function j(e,n,i,o,u,s,l,E,f,h,d,p){if(c(s)||c(l)||c(E)||c(f)||c(h)){var y=a.fromArray(u,3*e,xe),m=a.fromArray(u,3*n,Oe),_=a.fromArray(u,3*i,we),T=t(o,y,m,_,Ce);if(c(s)){var v=a.fromArray(s,3*e,xe),R=a.fromArray(s,3*n,Oe),A=a.fromArray(s,3*i,we);a.multiplyByScalar(v,T.x,v),a.multiplyByScalar(R,T.y,R),a.multiplyByScalar(A,T.z,A);var N=a.add(v,R,v);a.add(N,A,N),a.normalize(N,N),a.pack(N,d.normal.values,3*p)}if(c(h)){var g=a.fromArray(h,3*e,xe),S=a.fromArray(h,3*n,Oe),I=a.fromArray(h,3*i,we);a.multiplyByScalar(g,T.x,g),a.multiplyByScalar(S,T.y,S),a.multiplyByScalar(I,T.z,I);var M;a.equals(g,a.ZERO)&&a.equals(S,a.ZERO)&&a.equals(I,a.ZERO)?(M=xe,M.x=0,M.y=0,M.z=0):(M=a.add(g,S,g),a.add(M,I,M),a.normalize(M,M)),a.pack(M,d.extrudeDirection.values,3*p)}if(c(l)){var x=a.fromArray(l,3*e,xe),O=a.fromArray(l,3*n,Oe),w=a.fromArray(l,3*i,we);a.multiplyByScalar(x,T.x,x),a.multiplyByScalar(O,T.y,O),a.multiplyByScalar(w,T.z,w);var C=a.add(x,O,x);a.add(C,w,C),a.normalize(C,C),a.pack(C,d.tangent.values,3*p)}if(c(E)){var L=a.fromArray(E,3*e,xe),P=a.fromArray(E,3*n,Oe),b=a.fromArray(E,3*i,we);a.multiplyByScalar(L,T.x,L),a.multiplyByScalar(P,T.y,P),a.multiplyByScalar(b,T.z,b);var U=a.add(L,P,L);a.add(U,b,U),a.normalize(U,U),a.pack(U,d.bitangent.values,3*p)}if(c(f)){var F=r.fromArray(f,2*e,Le),D=r.fromArray(f,2*n,Pe),B=r.fromArray(f,2*i,be);r.multiplyByScalar(F,T.x,F),r.multiplyByScalar(D,T.y,D),r.multiplyByScalar(B,T.z,B);var z=r.add(F,D,F);r.add(z,B,z),r.pack(z,d.st.values,2*p)}}}function Q(e,t,n,r,a,i){var o=e.position.values.length/3;if(a!==-1){var u=r[a],s=n[u];return s===-1?(n[u]=o,e.position.values.push(i.x,i.y,i.z),t.push(o),o):(t.push(s),s)}return e.position.values.push(i.x,i.y,i.z),t.push(o),o}function J(e){var t,n,r,i,o,u=e.geometry,s=u.attributes,l=s.position.values,E=c(s.normal)?s.normal.values:void 0,f=c(s.bitangent)?s.bitangent.values:void 0,h=c(s.tangent)?s.tangent.values:void 0,d=c(s.st)?s.st.values:void 0,p=c(s.extrudeDirection)?s.extrudeDirection.values:void 0,y=u.indices,m=Z(u),_=Z(u),T=[];T.length=l.length/3;var v=[];for(v.length=l.length/3,o=0;o<T.length;++o)T[o]=-1,v[o]=-1;var R=y.length;for(o=0;o<R;o+=3){var A=y[o],N=y[o+1],g=y[o+2],S=a.fromArray(l,3*A),I=a.fromArray(l,3*N),M=a.fromArray(l,3*g),x=Y(S,I,M);if(c(x)&&x.positions.length>3)for(var O=x.positions,w=x.indices,C=w.length,L=0;L<C;++L){var P=w[L],b=O[P];b.y<0?(t=_.attributes,n=_.indices,r=T):(t=m.attributes,n=m.indices,r=v),i=Q(t,n,r,y,P<3?o+P:-1,b),j(A,N,g,b,l,E,h,f,d,p,t,i)}else c(x)&&(S=x.positions[0],I=x.positions[1],M=x.positions[2]),S.y<0?(t=_.attributes,n=_.indices,r=T):(t=m.attributes,n=m.indices,r=v),i=Q(t,n,r,y,o,S),j(A,N,g,S,l,E,h,f,d,p,t,i),i=Q(t,n,r,y,o+1,I),j(A,N,g,I,l,E,h,f,d,p,t,i),i=Q(t,n,r,y,o+2,M),j(A,N,g,M,l,E,h,f,d,p,t,i)}K(e,_,m)}function $(e){var t,n=e.geometry,r=n.attributes,i=r.position.values,o=n.indices,u=Z(n),s=Z(n),l=o.length,E=[];E.length=i.length/3;var f=[];for(f.length=i.length/3,t=0;t<E.length;++t)E[t]=-1,f[t]=-1;for(t=0;t<l;t+=2){var h=o[t],d=o[t+1],p=a.fromArray(i,3*h,xe),y=a.fromArray(i,3*d,Oe);Math.abs(p.y)<v.EPSILON6&&(p.y<0?p.y=-v.EPSILON6:p.y=v.EPSILON6),Math.abs(y.y)<v.EPSILON6&&(y.y<0?y.y=-v.EPSILON6:y.y=v.EPSILON6);var m=u.attributes,_=u.indices,R=f,A=s.attributes,N=s.indices,g=E,S=T.lineSegmentPlane(p,y,Ue,we);if(c(S)){var I=a.multiplyByScalar(a.UNIT_Y,5*v.EPSILON9,Fe);p.y<0&&(a.negate(I,I),m=s.attributes,_=s.indices,R=E,A=u.attributes,N=u.indices,g=f);var M=a.add(S,I,De);Q(m,_,R,o,t,p),Q(m,_,R,o,-1,M),a.negate(I,I),a.add(S,I,M),Q(A,N,g,o,-1,M),Q(A,N,g,o,t+1,y)}else{var x,O,w;p.y<0?(x=s.attributes,O=s.indices,w=E):(x=u.attributes,O=u.indices,w=f),Q(x,O,w,o,t,p),Q(x,O,w,o,t+1,y)}}K(e,s,u)}function ee(e){for(var t=e.attributes,n=t.position.values,r=t.prevPosition.values,i=t.nextPosition.values,o=n.length,u=0;u<o;u+=3){var s=a.unpack(n,u,Ge);if(!(s.x>0)){var c=a.unpack(r,u,qe);(s.y<0&&c.y>0||s.y>0&&c.y<0)&&(u-3>0?(r[u]=n[u-3],r[u+1]=n[u-2],r[u+2]=n[u-1]):a.pack(s,r,u));var l=a.unpack(i,u,Ve);(s.y<0&&l.y>0||s.y>0&&l.y<0)&&(u+3<o?(i[u]=n[u+3],i[u+1]=n[u+4],i[u+2]=n[u+5]):a.pack(s,i,u))}}}function te(e){var t,n,o,u=e.geometry,s=u.attributes,l=s.position.values,E=s.prevPosition.values,f=s.nextPosition.values,h=s.expandAndWidth.values,d=c(s.st)?s.st.values:void 0,p=c(s.color)?s.color.values:void 0,y=Z(u),m=Z(u),_=!1,R=l.length/3;for(t=0;t<R;t+=4){var A=t,N=t+2,g=a.fromArray(l,3*A,Ge),S=a.fromArray(l,3*N,qe);if(Math.abs(g.y)<Ze)for(g.y=Ze*(S.y<0?-1:1),l[3*t+1]=g.y,l[3*(t+1)+1]=g.y,n=3*A;n<3*A+12;n+=3)E[n]=l[3*t],E[n+1]=l[3*t+1],E[n+2]=l[3*t+2];if(Math.abs(S.y)<Ze)for(S.y=Ze*(g.y<0?-1:1),l[3*(t+2)+1]=S.y,l[3*(t+3)+1]=S.y,n=3*A;n<3*A+12;n+=3)f[n]=l[3*(t+2)],f[n+1]=l[3*(t+2)+1],f[n+2]=l[3*(t+2)+2];var I=y.attributes,M=y.indices,x=m.attributes,O=m.indices,w=T.lineSegmentPlane(g,S,Ue,Xe);if(c(w)){_=!0;var C=a.multiplyByScalar(a.UNIT_Y,ke,We);g.y<0&&(a.negate(C,C),I=m.attributes,M=m.indices,x=y.attributes,O=y.indices);var L=a.add(w,C,He);I.position.values.push(g.x,g.y,g.z,g.x,g.y,g.z),I.position.values.push(L.x,L.y,L.z),I.position.values.push(L.x,L.y,L.z),I.prevPosition.values.push(E[3*A],E[3*A+1],E[3*A+2]),I.prevPosition.values.push(E[3*A+3],E[3*A+4],E[3*A+5]),I.prevPosition.values.push(g.x,g.y,g.z,g.x,g.y,g.z),I.nextPosition.values.push(L.x,L.y,L.z),I.nextPosition.values.push(L.x,L.y,L.z),I.nextPosition.values.push(L.x,L.y,L.z),I.nextPosition.values.push(L.x,L.y,L.z),a.negate(C,C),a.add(w,C,L),x.position.values.push(L.x,L.y,L.z),x.position.values.push(L.x,L.y,L.z),x.position.values.push(S.x,S.y,S.z,S.x,S.y,S.z),x.prevPosition.values.push(L.x,L.y,L.z),x.prevPosition.values.push(L.x,L.y,L.z),x.prevPosition.values.push(L.x,L.y,L.z),x.prevPosition.values.push(L.x,L.y,L.z),x.nextPosition.values.push(S.x,S.y,S.z,S.x,S.y,S.z),x.nextPosition.values.push(f[3*N],f[3*N+1],f[3*N+2]),x.nextPosition.values.push(f[3*N+3],f[3*N+4],f[3*N+5]);var P=r.fromArray(h,2*A,Be),b=Math.abs(P.y);I.expandAndWidth.values.push(-1,b,1,b),I.expandAndWidth.values.push(-1,-b,1,-b),x.expandAndWidth.values.push(-1,b,1,b),x.expandAndWidth.values.push(-1,-b,1,-b);var U=a.magnitudeSquared(a.subtract(w,g,Ve));if(U/=a.magnitudeSquared(a.subtract(S,g,Ve)),c(p)){var F=i.fromArray(p,4*A,Ye),D=i.fromArray(p,4*N,Ye),B=v.lerp(F.x,D.x,U),z=v.lerp(F.y,D.y,U),G=v.lerp(F.z,D.z,U),q=v.lerp(F.w,D.w,U);for(n=4*A;n<4*A+8;++n)I.color.values.push(p[n]);for(I.color.values.push(B,z,G,q),I.color.values.push(B,z,G,q),x.color.values.push(B,z,G,q),x.color.values.push(B,z,G,q),n=4*N;n<4*N+8;++n)x.color.values.push(p[n])}if(c(d)){var V=r.fromArray(d,2*A,Be),X=r.fromArray(d,2*(t+3),ze),W=v.lerp(V.x,X.x,U);for(n=2*A;n<2*A+4;++n)I.st.values.push(d[n]);for(I.st.values.push(W,V.y),I.st.values.push(W,X.y),x.st.values.push(W,V.y),x.st.values.push(W,X.y),n=2*N;n<2*N+4;++n)x.st.values.push(d[n])}o=I.position.values.length/3-4,M.push(o,o+2,o+1),M.push(o+1,o+2,o+3),o=x.position.values.length/3-4,O.push(o,o+2,o+1),O.push(o+1,o+2,o+3)}else{var H,Y;for(g.y<0?(H=m.attributes,Y=m.indices):(H=y.attributes,Y=y.indices),H.position.values.push(g.x,g.y,g.z),H.position.values.push(g.x,g.y,g.z),H.position.values.push(S.x,S.y,S.z),H.position.values.push(S.x,S.y,S.z),n=3*t;n<3*t+12;++n)H.prevPosition.values.push(E[n]),H.nextPosition.values.push(f[n]);for(n=2*t;n<2*t+8;++n)H.expandAndWidth.values.push(h[n]),c(d)&&H.st.values.push(d[n]);if(c(p))for(n=4*t;n<4*t+16;++n)H.color.values.push(p[n]);o=H.position.values.length/3-4,Y.push(o,o+2,o+1),Y.push(o+1,o+2,o+3)}}_&&(ee(m),ee(y)),K(e,m,y)}var ne={};ne.toWireframe=function(e){var t=e.indices;if(c(t)){switch(e.primitiveType){case g.TRIANGLES:e.indices=M(t);break;case g.TRIANGLE_STRIP:e.indices=x(t);break;case g.TRIANGLE_FAN:e.indices=O(t)}e.primitiveType=g.LINES}return e},ne.createLineSegmentsForVectors=function(e,t,r){t=s(t,"normal"),r=s(r,1e4);for(var a=e.attributes.position.values,i=e.attributes[t].values,o=a.length,l=new Float64Array(2*o),E=0,f=0;f<o;f+=3)l[E++]=a[f],l[E++]=a[f+1],l[E++]=a[f+2],l[E++]=a[f]+i[f]*r,l[E++]=a[f+1]+i[f+1]*r,l[E++]=a[f+2]+i[f+2]*r;var h,y=e.boundingSphere;return c(y)&&(h=new n(y.center,y.radius+r)),new d({attributes:{position:new p({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:g.LINES,boundingSphere:h})},ne.createAttributeLocations=function(e){var t,n=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],r=e.attributes,a={},i=0,o=n.length;for(t=0;t<o;++t){var u=n[t];c(r[u])&&(a[u]=i++)}for(var s in r)r.hasOwnProperty(s)&&!c(a[s])&&(a[s]=i++);return a},ne.reorderForPreVertexCache=function(e){var t=d.computeNumberOfVertices(e),n=e.indices;if(c(n)){for(var r=new Int32Array(t),a=0;a<t;a++)r[a]=-1;for(var i,o=n,s=o.length,l=m.createTypedArray(t,s),E=0,f=0,h=0;E<s;)i=r[o[E]],i!==-1?l[f]=i:(i=o[E],r[i]=h,l[f]=h,++h),++E,++f;e.indices=l;var p=e.attributes;for(var y in p)if(p.hasOwnProperty(y)&&c(p[y])&&c(p[y].values)){for(var _=p[y],T=_.values,v=0,R=_.componentsPerAttribute,A=u.createTypedArray(_.componentDatatype,h*R);v<t;){var N=r[v];if(N!==-1)for(a=0;a<R;a++)A[R*N+a]=T[R*v+a];++v}_.values=A}}return e},ne.reorderForPostVertexCache=function(e,t){var n=e.indices;if(e.primitiveType===g.TRIANGLES&&c(n)){for(var r=n.length,a=0,i=0;i<r;i++)n[i]>a&&(a=n[i]);e.indices=S.tipsify({indices:n,maximumIndex:a,cacheSize:t})}return e},ne.fitToUnsignedShortIndices=function(e){var t=[],n=d.computeNumberOfVertices(e);if(c(e.indices)&&n>=v.SIXTY_FOUR_KILOBYTES){var r,a=[],i=[],o=0,u=w(e.attributes),s=e.indices,l=s.length;e.primitiveType===g.TRIANGLES?r=3:e.primitiveType===g.LINES?r=2:e.primitiveType===g.POINTS&&(r=1);for(var E=0;E<l;E+=r){for(var f=0;f<r;++f){var h=s[E+f],p=a[h];c(p)||(p=o++,a[h]=p,C(u,e.attributes,h)),i.push(p)}o+r>=v.SIXTY_FOUR_KILOBYTES&&(t.push(new d({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),a=[],i=[],o=0,u=w(e.attributes))}0!==i.length&&t.push(new d({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var re=new a,ae=new o;ne.projectTo2D=function(e,t,n,r,i){var o=e.attributes[t];i=c(i)?i:new h;for(var s=i.ellipsoid,l=o.values,E=new Float64Array(l.length),f=0,d=0;d<l.length;d+=3){var y=a.fromArray(l,d,re),m=s.cartesianToCartographic(y,ae),_=i.project(m,re);E[f++]=_.x,E[f++]=_.y,E[f++]=_.z}return e.attributes[n]=o,e.attributes[r]=new p({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:E}),delete e.attributes[t],e};var ie={high:0,low:0};ne.encodeAttribute=function(e,t,n,r){for(var a=e.attributes[t],i=a.values,o=i.length,s=new Float32Array(o),c=new Float32Array(o),l=0;l<o;++l)f.encode(i[l],ie),s[l]=ie.high,c[l]=ie.low;var E=a.componentsPerAttribute;return e.attributes[n]=new p({componentDatatype:u.FLOAT,componentsPerAttribute:E,values:s}),e.attributes[r]=new p({componentDatatype:u.FLOAT,componentsPerAttribute:E,values:c}),delete e.attributes[t],e};var oe=new a,ue=new A,se=new R;ne.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(A.equals(t,A.IDENTITY))return e;var r=e.geometry.attributes;L(t,r.position),L(t,r.prevPosition),L(t,r.nextPosition),(c(r.normal)||c(r.tangent)||c(r.bitangent))&&(A.inverse(t,ue),A.transpose(ue,ue),A.getRotation(ue,se),P(se,r.normal),P(se,r.tangent),P(se,r.bitangent));var a=e.geometry.boundingSphere;return c(a)&&(e.geometry.boundingSphere=n.transform(a,t,a)),e.modelMatrix=A.clone(A.IDENTITY),e};var ce=new a;ne.combineInstances=function(e){for(var t=[],n=[],r=e.length,a=0;a<r;++a){var i=e[a];c(i.geometry)?t.push(i):c(i.westHemisphereGeometry)&&c(i.eastHemisphereGeometry)&&n.push(i)}var o=[];return t.length>0&&o.push(U(t,"geometry")),n.length>0&&(o.push(U(n,"westHemisphereGeometry")),o.push(U(n,"eastHemisphereGeometry"))),o};var le=new a,Ee=new a,fe=new a,he=new a;ne.computeNormal=function(e){for(var t=e.indices,n=e.attributes,r=n.position.values,i=n.position.values.length/3,o=t.length,s=new Array(i),c=new Array(o/3),l=new Array(o),E=0;E<i;E++)s[E]={indexOffset:0,count:0,currentCount:0};var f=0;for(E=0;E<o;E+=3){var h=t[E],d=t[E+1],y=t[E+2],m=3*h,_=3*d,T=3*y;Ee.x=r[m],Ee.y=r[m+1],Ee.z=r[m+2],fe.x=r[_],fe.y=r[_+1],fe.z=r[_+2],he.x=r[T],he.y=r[T+1],he.z=r[T+2],s[h].count++,s[d].count++,s[y].count++,a.subtract(fe,Ee,fe),a.subtract(he,Ee,he),c[f]=a.cross(fe,he,new a),f++}var v=0;for(E=0;E<i;E++)s[E].indexOffset+=v,v+=s[E].count;f=0;var R;for(E=0;E<o;E+=3){R=s[t[E]];var A=R.indexOffset+R.currentCount;l[A]=f,R.currentCount++,R=s[t[E+1]],A=R.indexOffset+R.currentCount,l[A]=f,R.currentCount++,R=s[t[E+2]],A=R.indexOffset+R.currentCount,l[A]=f,R.currentCount++,f++}var N=new Float32Array(3*i);for(E=0;E<i;E++){var g=3*E;if(R=s[E],R.count>0){for(a.clone(a.ZERO,le),f=0;f<R.count;f++)a.add(le,c[l[R.indexOffset+f]],le);a.normalize(le,le),N[g]=le.x,N[g+1]=le.y,N[g+2]=le.z}else N[g]=0,N[g+1]=0,N[g+2]=1}return e.attributes.normal=new p({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:N}),e};var de=new a,pe=new a,ye=new a;ne.computeTangentAndBitangent=function(e){for(var t=(e.attributes,e.indices),n=e.attributes.position.values,r=e.attributes.normal.values,i=e.attributes.st.values,o=e.attributes.position.values.length/3,s=t.length,c=new Array(3*o),l=0;l<c.length;l++)c[l]=0;var E,f,h;for(l=0;l<s;l+=3){var d=t[l],y=t[l+1],m=t[l+2];E=3*d,f=3*y,h=3*m;var _=2*d,T=2*y,v=2*m,R=n[E],A=n[E+1],N=n[E+2],g=i[_],S=i[_+1],I=i[T+1]-S,M=i[v+1]-S,x=1/((i[T]-g)*M-(i[v]-g)*I),O=(M*(n[f]-R)-I*(n[h]-R))*x,w=(M*(n[f+1]-A)-I*(n[h+1]-A))*x,C=(M*(n[f+2]-N)-I*(n[h+2]-N))*x;c[E]+=O,c[E+1]+=w,c[E+2]+=C,c[f]+=O,c[f+1]+=w,c[f+2]+=C,c[h]+=O,c[h+1]+=w,c[h+2]+=C}var L=new Float32Array(3*o),P=new Float32Array(3*o);for(l=0;l<o;l++){E=3*l,f=E+1,h=E+2;var b=a.fromArray(r,E,de),U=a.fromArray(c,E,ye),F=a.dot(b,U);a.multiplyByScalar(b,F,pe),a.normalize(a.subtract(U,pe,U),U),L[E]=U.x,L[f]=U.y,L[h]=U.z,a.normalize(a.cross(b,U,U),U),P[E]=U.x,P[f]=U.y,P[h]=U.z}return e.attributes.tangent=new p({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:L}),e.attributes.bitangent=new p({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:P}),e},ne.computeBinormalAndTangent=function(e){return l("computeBinormalAndTangent","computeBinormalAndTangent was deprecated in 1.30. It will be removed in 1.31. Use a computeTangentAndBitangent."),ne.computeTangentAndBitangent(e),e.attributes.binormal=e.attributes.bitangent,e};var me=new r,_e=new a,Te=new a,ve=new a,Re=new r;ne.compressVertices=function(t){var n,i,o=t.attributes.extrudeDirection;if(c(o)){var s=o.values;i=s.length/3;var l=new Float32Array(2*i),E=0;for(n=0;n<i;++n)a.fromArray(s,3*n,_e),a.equals(_e,a.ZERO)?E+=2:(Re=e.octEncodeInRange(_e,65535,Re),l[E++]=Re.x,l[E++]=Re.y);return t.attributes.compressedAttributes=new p({componentDatatype:u.FLOAT,componentsPerAttribute:2,values:l}),delete t.attributes.extrudeDirection,t}var f=t.attributes.normal,h=t.attributes.st,d=c(f),y=c(h);if(!d&&!y)return t;var m,_,T,v,R=t.attributes.tangent,A=t.attributes.bitangent,N=c(R),g=c(A);d&&(m=f.values),y&&(_=h.values),N&&(T=R.values),g&&(v=A.values);var S=d?m.length:_.length,I=d?3:2;i=S/I;var M=i,x=y&&d?2:1;x+=N||g?1:0,M*=x;var O=new Float32Array(M),w=0;for(n=0;n<i;++n){y&&(r.fromArray(_,2*n,me),O[w++]=e.compressTextureCoordinates(me));var C=3*n;d&&c(T)&&c(v)?(a.fromArray(m,C,_e),a.fromArray(T,C,Te),a.fromArray(v,C,ve),e.octPack(_e,Te,ve,me),O[w++]=me.x,O[w++]=me.y):(d&&(a.fromArray(m,C,_e),O[w++]=e.octEncodeFloat(_e)),N&&(a.fromArray(T,C,_e),O[w++]=e.octEncodeFloat(_e)),g&&(a.fromArray(v,C,_e),O[w++]=e.octEncodeFloat(_e)))}return t.attributes.compressedAttributes=new p({componentDatatype:u.FLOAT,componentsPerAttribute:x,values:O}),d&&delete t.attributes.normal,y&&delete t.attributes.st,g&&delete t.attributes.bitangent,N&&delete t.attributes.tangent,t};var Ae=new a,Ne=new a,ge=new a,Se=new a,Ie=new a,Me={positions:new Array(7),indices:new Array(9)},xe=new a,Oe=new a,we=new a,Ce=new a,Le=new r,Pe=new r,be=new r,Ue=N.fromPointNormal(a.ZERO,a.UNIT_Y),Fe=new a,De=new a,Be=new r,ze=new r,Ge=new a,qe=new a,Ve=new a,Xe=new a,We=new a,He=new a,Ye=new i,ke=5*v.EPSILON9,Ze=v.EPSILON6;return ne.splitLongitude=function(e){var t=e.geometry,r=t.boundingSphere;if(c(r)){var a=r.center.x-r.radius;if(a>0||n.intersectPlane(r,N.ORIGIN_ZX_PLANE)!==_.INTERSECTING)return e}if(t.geometryType!==y.NONE)switch(t.geometryType){case y.POLYLINES:te(e);break;case y.TRIANGLES:J(e);break;case y.LINES:$(e)}else V(t),t.primitiveType===g.TRIANGLES?J(e):t.primitiveType===g.LINES&&$(e);return e},ne}),define("Core/Matrix2",["./Cartesian2","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject"],function(e,t,n,r,a,i,o){"use strict";function u(e,t,r,a){this[0]=n(e,0),this[1]=n(r,0),this[2]=n(t,0),this[3]=n(a,0)}u.packedLength=4,u.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t},u.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new u),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a},u.clone=function(e,t){if(r(e))return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new u(e[0],e[2],e[1],e[3])},u.fromArray=function(e,t,a){return t=n(t,0),r(a)||(a=new u),a[0]=e[t],a[1]=e[t+1],a[2]=e[t+2], +a[3]=e[t+3],a},u.fromColumnMajorArray=function(e,t){return u.clone(e,t)},u.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new u(e[0],e[1],e[2],e[3])},u.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new u(e.x,0,0,e.y)},u.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new u(e,0,0,e)},u.fromRotation=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=a,t[2]=-a,t[3]=n,t):new u(n,-a,a,n)},u.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):[e[0],e[1],e[2],e[3]]},u.getElementIndex=function(e,t){return 2*e+t},u.getColumn=function(e,t,n){var r=2*t,a=e[r],i=e[r+1];return n.x=a,n.y=i,n},u.setColumn=function(e,t,n,r){r=u.clone(e,r);var a=2*t;return r[a]=n.x,r[a+1]=n.y,r},u.getRow=function(e,t,n){var r=e[t],a=e[t+2];return n.x=r,n.y=a,n},u.setRow=function(e,t,n,r){return r=u.clone(e,r),r[t]=n.x,r[t+2]=n.y,r};var s=new e;u.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],s)),n.y=e.magnitude(e.fromElements(t[2],t[3],s)),n};var c=new e;return u.getMaximumScale=function(t){return u.getScale(t,c),e.maximumComponent(c)},u.multiply=function(e,t,n){var r=e[0]*t[0]+e[2]*t[1],a=e[0]*t[2]+e[2]*t[3],i=e[1]*t[0]+e[3]*t[1],o=e[1]*t[2]+e[3]*t[3];return n[0]=r,n[1]=i,n[2]=a,n[3]=o,n},u.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n},u.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n},u.multiplyByVector=function(e,t,n){var r=e[0]*t.x+e[2]*t.y,a=e[1]*t.x+e[3]*t.y;return n.x=r,n.y=a,n},u.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n},u.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.y,n[3]=e[3]*t.y,n},u.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},u.transpose=function(e,t){var n=e[0],r=e[2],a=e[1],i=e[3];return t[0]=n,t[1]=r,t[2]=a,t[3]=i,t},u.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},u.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]},u.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]},u.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},u.IDENTITY=o(new u(1,0,0,1)),u.ZERO=o(new u(0,0,0,0)),u.COLUMN0ROW0=0,u.COLUMN0ROW1=1,u.COLUMN1ROW0=2,u.COLUMN1ROW1=3,a(u.prototype,{length:{get:function(){return u.packedLength}}}),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,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this[0]+", "+this[2]+")\n("+this[1]+", "+this[3]+")"},u}),define("ThirdParty/earcut-2.1.1",[],function(){"use strict";function e(e,n,a){a=a||2;var i=n&&n.length,o=i?n[0]*a:e.length,u=t(e,0,o,a,!0),c=[];if(!u)return c;var l,E,f,h,d,p,y;if(i&&(u=s(e,n,u,a)),e.length>80*a){l=f=e[0],E=h=e[1];for(var m=a;m<o;m+=a)d=e[m],p=e[m+1],d<l&&(l=d),p<E&&(E=p),d>f&&(f=d),p>h&&(h=p);y=Math.max(f-l,h-E)}return r(u,c,a,l,E,y),c}function t(e,t,n,r,a){var i,o;if(a===x(e,t,n,r)>0)for(i=t;i<n;i+=r)o=S(i,e[i],e[i+1],o);else for(i=n-r;i>=t;i-=r)o=S(i,e[i],e[i+1],o);return o&&T(o,o.next)&&(I(o),o=o.next),o}function n(e,t){if(!e)return e;t||(t=e);var n,r=e;do if(n=!1,r.steiner||!T(r,r.next)&&0!==_(r.prev,r,r.next))r=r.next;else{if(I(r),r=t=r.prev,r===r.next)return null;n=!0}while(n||r!==t);return t}function r(e,t,s,c,l,E,h){if(e){!h&&E&&f(e,c,l,E);for(var d,p,y=e;e.prev!==e.next;)if(d=e.prev,p=e.next,E?i(e,c,l,E):a(e))t.push(d.i/s),t.push(e.i/s),t.push(p.i/s),I(e),e=p.next,y=p.next;else if(e=p,e===y){h?1===h?(e=o(e,t,s),r(e,t,s,c,l,E,2)):2===h&&u(e,t,s,c,l,E):r(n(e),t,s,c,l,E,1);break}}}function a(e){var t=e.prev,n=e,r=e.next;if(_(t,n,r)>=0)return!1;for(var a=e.next.next;a!==e.prev;){if(y(t.x,t.y,n.x,n.y,r.x,r.y,a.x,a.y)&&_(a.prev,a,a.next)>=0)return!1;a=a.next}return!0}function i(e,t,n,r){var a=e.prev,i=e,o=e.next;if(_(a,i,o)>=0)return!1;for(var u=a.x<i.x?a.x<o.x?a.x:o.x:i.x<o.x?i.x:o.x,s=a.y<i.y?a.y<o.y?a.y:o.y:i.y<o.y?i.y:o.y,c=a.x>i.x?a.x>o.x?a.x:o.x:i.x>o.x?i.x:o.x,l=a.y>i.y?a.y>o.y?a.y:o.y:i.y>o.y?i.y:o.y,E=d(u,s,t,n,r),f=d(c,l,t,n,r),h=e.nextZ;h&&h.z<=f;){if(h!==e.prev&&h!==e.next&&y(a.x,a.y,i.x,i.y,o.x,o.y,h.x,h.y)&&_(h.prev,h,h.next)>=0)return!1;h=h.nextZ}for(h=e.prevZ;h&&h.z>=E;){if(h!==e.prev&&h!==e.next&&y(a.x,a.y,i.x,i.y,o.x,o.y,h.x,h.y)&&_(h.prev,h,h.next)>=0)return!1;h=h.prevZ}return!0}function o(e,t,n){var r=e;do{var a=r.prev,i=r.next.next;!T(a,i)&&v(a,r,r.next,i)&&A(a,i)&&A(i,a)&&(t.push(a.i/n),t.push(r.i/n),t.push(i.i/n),I(r),I(r.next),r=e=i),r=r.next}while(r!==e);return r}function u(e,t,a,i,o,u){var s=e;do{for(var c=s.next.next;c!==s.prev;){if(s.i!==c.i&&m(s,c)){var l=g(s,c);return s=n(s,s.next),l=n(l,l.next),r(s,t,a,i,o,u),void r(l,t,a,i,o,u)}c=c.next}s=s.next}while(s!==e)}function s(e,r,a,i){var o,u,s,E,f,h=[];for(o=0,u=r.length;o<u;o++)s=r[o]*i,E=o<u-1?r[o+1]*i:e.length,f=t(e,s,E,i,!1),f===f.next&&(f.steiner=!0),h.push(p(f));for(h.sort(c),o=0;o<h.length;o++)l(h[o],a),a=n(a,a.next);return a}function c(e,t){return e.x-t.x}function l(e,t){if(t=E(e,t)){var r=g(t,e);n(r,r.next)}}function E(e,t){var n,r=t,a=e.x,i=e.y,o=-(1/0);do{if(i<=r.y&&i>=r.next.y){var u=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(u<=a&&u>o){if(o=u,u===a){if(i===r.y)return r;if(i===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(a===o)return n.prev;var s,c=n,l=n.x,E=n.y,f=1/0;for(r=n.next;r!==c;)a>=r.x&&r.x>=l&&y(i<E?a:o,i,l,E,i<E?o:a,i,r.x,r.y)&&(s=Math.abs(i-r.y)/(a-r.x),(s<f||s===f&&r.x>n.x)&&A(r,e)&&(n=r,f=s)),r=r.next;return n}function f(e,t,n,r){var a=e;do null===a.z&&(a.z=d(a.x,a.y,t,n,r)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next;while(a!==e);a.prevZ.nextZ=null,a.prevZ=null,h(a)}function h(e){var t,n,r,a,i,o,u,s,c=1;do{for(n=e,e=null,i=null,o=0;n;){for(o++,r=n,u=0,t=0;t<c&&(u++,r=r.nextZ,r);t++);for(s=c;u>0||s>0&&r;)0===u?(a=r,r=r.nextZ,s--):0!==s&&r?n.z<=r.z?(a=n,n=n.nextZ,u--):(a=r,r=r.nextZ,s--):(a=n,n=n.nextZ,u--),i?i.nextZ=a:e=a,a.prevZ=i,i=a;n=r}i.nextZ=null,c*=2}while(o>1);return e}function d(e,t,n,r,a){return e=32767*(e-n)/a,t=32767*(t-r)/a,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function p(e){var t=e,n=e;do t.x<n.x&&(n=t),t=t.next;while(t!==e);return n}function y(e,t,n,r,a,i,o,u){return(a-o)*(t-u)-(e-o)*(i-u)>=0&&(e-o)*(r-u)-(n-o)*(t-u)>=0&&(n-o)*(i-u)-(a-o)*(r-u)>=0}function m(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!R(e,t)&&A(e,t)&&A(t,e)&&N(e,t)}function _(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function T(e,t){return e.x===t.x&&e.y===t.y}function v(e,t,n,r){return!!(T(e,t)&&T(n,r)||T(e,r)&&T(n,t))||_(e,t,n)>0!=_(e,t,r)>0&&_(n,r,e)>0!=_(n,r,t)>0}function R(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&v(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function A(e,t){return _(e.prev,e,e.next)<0?_(e,t,e.next)>=0&&_(e,e.prev,t)>=0:_(e,t,e.prev)<0||_(e,e.next,t)<0}function N(e,t){var n=e,r=!1,a=(e.x+t.x)/2,i=(e.y+t.y)/2;do n.y>i!=n.next.y>i&&a<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function g(e,t){var n=new M(e.i,e.x,e.y),r=new M(t.i,t.x,t.y),a=e.next,i=t.prev;return e.next=t,t.prev=e,n.next=a,a.prev=n,r.next=n,n.prev=r,i.next=r,r.prev=i,r}function S(e,t,n,r){var a=new M(e,t,n);return r?(a.next=r.next,a.prev=r,r.next.prev=a,r.next=a):(a.prev=a,a.next=a),a}function I(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function M(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function x(e,t,n,r){for(var a=0,i=t,o=n-r;i<n;i+=r)a+=(e[o]-e[i])*(e[i+1]+e[o+1]),o=i;return a}return e.deviation=function(e,t,n,r){var a=t&&t.length,i=a?t[0]*n:e.length,o=Math.abs(x(e,0,i,n));if(a)for(var u=0,s=t.length;u<s;u++){var c=t[u]*n,l=u<s-1?t[u+1]*n:e.length;o-=Math.abs(x(e,c,l,n))}var E=0;for(u=0;u<r.length;u+=3){var f=r[u]*n,h=r[u+1]*n,d=r[u+2]*n;E+=Math.abs((e[f]-e[d])*(e[h+1]-e[f+1])-(e[f]-e[h])*(e[d+1]-e[f+1]))}return 0===o&&0===E?0:Math.abs((E-o)/o)},e.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,a=0;a<e.length;a++){for(var i=0;i<e[a].length;i++)for(var o=0;o<t;o++)n.vertices.push(e[a][i][o]);a>0&&(r+=e[a-1].length,n.holes.push(r))}return n},e}),define("Core/WindingOrder",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={CLOCKWISE:t.CW,COUNTER_CLOCKWISE:t.CCW,validate:function(e){return e===n.CLOCKWISE||e===n.COUNTER_CLOCKWISE}};return e(n)}),define("Core/PolygonPipeline",["../ThirdParty/earcut-2.1.1","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./Math","./PrimitiveType","./WindingOrder"],function(e,t,n,r,a,i,o,u,s,c,l,E,f){"use strict";var h=new n,d=new n,p={};p.computeArea2D=function(e){for(var t=e.length,n=0,r=t-1,a=0;a<t;r=a++){var i=e[r],o=e[a];n+=i.x*o.y-o.x*i.y}return.5*n},p.computeWindingOrder2D=function(e){var t=p.computeArea2D(e);return t>0?f.COUNTER_CLOCKWISE:f.CLOCKWISE},p.triangulate=function(n,r){var a=t.packArray(n);return e(a,r,2)};var y=new n,m=new n,_=new n,T=new n,v=new n,R=new n,A=new n;return p.computeSubdivision=function(e,t,o,u){u=a(u,l.RADIANS_PER_DEGREE);var f,h=o.slice(0),d=t.length,p=new Array(3*d),N=0;for(f=0;f<d;f++){var g=t[f];p[N++]=g.x,p[N++]=g.y,p[N++]=g.z}for(var S=[],I={},M=e.maximumRadius,x=l.chordLength(u,M),O=x*x;h.length>0;){var w,C,L=h.pop(),P=h.pop(),b=h.pop(),U=n.fromArray(p,3*b,y),F=n.fromArray(p,3*P,m),D=n.fromArray(p,3*L,_),B=n.multiplyByScalar(n.normalize(U,T),M,T),z=n.multiplyByScalar(n.normalize(F,v),M,v),G=n.multiplyByScalar(n.normalize(D,R),M,R),q=n.magnitudeSquared(n.subtract(B,z,A)),V=n.magnitudeSquared(n.subtract(z,G,A)),X=n.magnitudeSquared(n.subtract(G,B,A)),W=Math.max(q,V,X);W>O?q===W?(w=Math.min(b,P)+" "+Math.max(b,P),f=I[w],i(f)||(C=n.add(U,F,A),n.multiplyByScalar(C,.5,C),p.push(C.x,C.y,C.z),f=p.length/3-1,I[w]=f),h.push(b,f,L),h.push(f,P,L)):V===W?(w=Math.min(P,L)+" "+Math.max(P,L),f=I[w],i(f)||(C=n.add(F,D,A),n.multiplyByScalar(C,.5,C),p.push(C.x,C.y,C.z),f=p.length/3-1,I[w]=f),h.push(P,f,b),h.push(f,L,b)):X===W&&(w=Math.min(L,b)+" "+Math.max(L,b),f=I[w],i(f)||(C=n.add(D,U,A),n.multiplyByScalar(C,.5,C),p.push(C.x,C.y,C.z),f=p.length/3-1,I[w]=f),h.push(L,f,P),h.push(f,b,P)):(S.push(b),S.push(P),S.push(L))}return new s({attributes:{position:new c({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:p})},indices:S,primitiveType:E.TRIANGLES})},p.scaleToGeodeticHeight=function(e,t,r,o){r=a(r,u.WGS84);var s=h,c=d;if(t=a(t,0),o=a(o,!0),i(e))for(var l=e.length,E=0;E<l;E+=3)n.fromArray(e,E,c),o&&(c=r.scaleToGeodeticSurface(c,c)),0!==t&&(s=r.geodeticSurfaceNormal(c,s),n.multiplyByScalar(s,t,s),n.add(c,s,c)),e[E]=c.x,e[E+1]=c.y,e[E+2]=c.z;return e},p}),define("Core/Quaternion",["./Cartesian3","./Check","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math","./Matrix3"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(e,t,r,a){this.x=n(e,0),this.y=n(t,0),this.z=n(r,0),this.w=n(a,0)}var l=new e;c.fromAxisAngle=function(t,n,a){var i=n/2,o=Math.sin(i);l=e.normalize(t,l);var u=l.x*o,s=l.y*o,E=l.z*o,f=Math.cos(i);return r(a)?(a.x=u,a.y=s,a.z=E,a.w=f,a):new c(u,s,E,f)};var E=[1,2,0],f=new Array(3);c.fromRotationMatrix=function(e,t){var n,a,i,o,u,l=e[s.COLUMN0ROW0],h=e[s.COLUMN1ROW1],d=e[s.COLUMN2ROW2],p=l+h+d;if(p>0)n=Math.sqrt(p+1),u=.5*n,n=.5/n,a=(e[s.COLUMN1ROW2]-e[s.COLUMN2ROW1])*n,i=(e[s.COLUMN2ROW0]-e[s.COLUMN0ROW2])*n,o=(e[s.COLUMN0ROW1]-e[s.COLUMN1ROW0])*n;else{var y=E,m=0;h>l&&(m=1),d>l&&d>h&&(m=2);var _=y[m],T=y[_];n=Math.sqrt(e[s.getElementIndex(m,m)]-e[s.getElementIndex(_,_)]-e[s.getElementIndex(T,T)]+1);var v=f;v[m]=.5*n,n=.5/n,u=(e[s.getElementIndex(T,_)]-e[s.getElementIndex(_,T)])*n,v[_]=(e[s.getElementIndex(_,m)]+e[s.getElementIndex(m,_)])*n,v[T]=(e[s.getElementIndex(T,m)]+e[s.getElementIndex(m,T)])*n,a=-v[0],i=-v[1],o=-v[2]}return r(t)?(t.x=a,t.y=i,t.z=o,t.w=u,t):new c(a,i,o,u)};var h=new c;c.fromHeadingPitchRoll=function(t,n,r,a){var i=c.fromAxisAngle(e.UNIT_X,r,h),o=c.fromAxisAngle(e.UNIT_Y,-n,a);a=c.multiply(o,i,o);var u=c.fromAxisAngle(e.UNIT_Z,-t,h);return c.multiply(u,a,a)};var d=new e,p=new e,y=new c,m=new c,_=new c;c.packedLength=4,c.pack=function(e,t,r){return r=n(r,0),t[r++]=e.x,t[r++]=e.y,t[r++]=e.z,t[r]=e.w,t},c.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new c),a.x=e[t],a.y=e[t+1],a.z=e[t+2],a.w=e[t+3],a},c.packedInterpolationLength=3,c.convertPackedArrayForInterpolation=function(e,t,n,r){c.unpack(e,4*n,_),c.conjugate(_,_);for(var a=0,i=n-t+1;a<i;a++){var o=3*a;c.unpack(e,4*(t+a),y),c.multiply(y,_,y),y.w<0&&c.negate(y,y),c.computeAxis(y,d);var u=c.computeAngle(y);r[o]=d.x*u,r[o+1]=d.y*u,r[o+2]=d.z*u}},c.unpackInterpolationResult=function(t,n,a,i,o){r(o)||(o=new c),e.fromArray(t,0,p);var u=e.magnitude(p);return c.unpack(n,4*i,m),0===u?c.clone(c.IDENTITY,y):c.fromAxisAngle(p,u,y),c.multiply(y,m,o)},c.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new c(e.x,e.y,e.z,e.w)},c.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},c.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},c.magnitude=function(e){return Math.sqrt(c.magnitudeSquared(e))},c.normalize=function(e,t){var n=1/c.magnitude(e),r=e.x*n,a=e.y*n,i=e.z*n,o=e.w*n;return t.x=r,t.y=a,t.z=i,t.w=o,t},c.inverse=function(e,t){var n=c.magnitudeSquared(e);return t=c.conjugate(e,t),c.multiplyByScalar(t,1/n,t)},c.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},c.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},c.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},c.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},c.multiply=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=e.w,u=t.x,s=t.y,c=t.z,l=t.w,E=o*u+r*l+a*c-i*s,f=o*s-r*c+a*l+i*u,h=o*c+r*s-a*u+i*l,d=o*l-r*u-a*s-i*c;return n.x=E,n.y=f,n.z=h,n.w=d,n},c.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},c.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},c.computeAxis=function(e,t){var n=e.w;if(Math.abs(n-1)<u.EPSILON6)return t.x=t.y=t.z=0,t;var r=1/Math.sqrt(1-n*n);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},c.computeAngle=function(e){return Math.abs(e.w-1)<u.EPSILON6?0:2*Math.acos(e.w)};var T=new c;c.lerp=function(e,t,n,r){return T=c.multiplyByScalar(t,n,T),r=c.multiplyByScalar(e,1-n,r),c.add(T,r,r)};var v=new c,R=new c,A=new c;c.slerp=function(e,t,n,r){var a=c.dot(e,t),i=t;if(a<0&&(a=-a,i=v=c.negate(t,v)),1-a<u.EPSILON6)return c.lerp(e,i,n,r);var o=Math.acos(a);return R=c.multiplyByScalar(e,Math.sin((1-n)*o),R),A=c.multiplyByScalar(i,Math.sin(n*o),A),r=c.add(R,A,r),c.multiplyByScalar(r,1/Math.sin(o),r)},c.log=function(t,n){var r=u.acosClamped(t.w),a=0;return 0!==r&&(a=r/Math.sin(r)),e.multiplyByScalar(t,a,n)},c.exp=function(t,n){var r=e.magnitude(t),a=0;return 0!==r&&(a=Math.sin(r)/r),n.x=t.x*a,n.y=t.y*a,n.z=t.z*a,n.w=Math.cos(r),n};var N=new e,g=new e,S=new c,I=new c;c.computeInnerQuadrangle=function(t,n,r,a){var i=c.conjugate(n,S);c.multiply(i,r,I);var o=c.log(I,N);c.multiply(i,t,I);var u=c.log(I,g);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),c.exp(o,S),c.multiply(n,S,a)},c.squad=function(e,t,n,r,a,i){var o=c.slerp(e,t,a,S),u=c.slerp(n,r,a,I);return c.slerp(o,u,2*a*(1-a),i)};for(var M=new c,x=1.9011074535173003,O=i.supportsTypedArrays()?new Float32Array(8):[],w=i.supportsTypedArrays()?new Float32Array(8):[],C=i.supportsTypedArrays()?new Float32Array(8):[],L=i.supportsTypedArrays()?new Float32Array(8):[],P=0;P<7;++P){var b=P+1,U=2*b+1;O[P]=1/(b*U),w[P]=b/U}return O[7]=x/136,w[7]=8*x/17,c.fastSlerp=function(e,t,n,r){var a,i=c.dot(e,t);i>=0?a=1:(a=-1,i=-i);for(var o=i-1,u=1-n,s=n*n,l=u*u,E=7;E>=0;--E)C[E]=(O[E]*s-w[E])*o,L[E]=(O[E]*l-w[E])*o;var f=a*n*(1+C[0]*(1+C[1]*(1+C[2]*(1+C[3]*(1+C[4]*(1+C[5]*(1+C[6]*(1+C[7])))))))),h=u*(1+L[0]*(1+L[1]*(1+L[2]*(1+L[3]*(1+L[4]*(1+L[5]*(1+L[6]*(1+L[7])))))))),d=c.multiplyByScalar(e,h,M);return c.multiplyByScalar(t,f,r),c.add(d,r,r)},c.fastSquad=function(e,t,n,r,a,i){var o=c.fastSlerp(e,t,a,S),u=c.fastSlerp(n,r,a,I);return c.fastSlerp(o,u,2*a*(1-a),i)},c.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},c.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n},c.ZERO=o(new c(0,0,0,0)),c.IDENTITY=o(new c(0,0,0,1)),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.x+", "+this.y+", "+this.z+", "+this.w+")"},c}),define("Core/RectangleGeometryLibrary",["./Cartesian3","./Cartographic","./defined","./DeveloperError","./GeographicProjection","./Math","./Matrix2","./Rectangle"],function(e,t,n,r,a,i,o,u){"use strict";function s(t,n,r,a,i,u,s){var c=Math.cos(n),l=a*c,E=r*c,f=Math.sin(n),p=a*f,_=r*f;d=m.project(t,d),d=e.subtract(d,y,d);var T=o.fromRotation(n,h);d=o.multiplyByVector(T,d,d),d=e.add(d,y,d),t=m.unproject(d,t),u-=1,s-=1;var v=t.latitude,R=v+u*_,A=v-l*s,N=v-l*s+u*_,g=Math.max(v,R,A,N),S=Math.min(v,R,A,N),I=t.longitude,M=I+u*E,x=I+s*p,O=I+s*p+u*E,w=Math.max(I,M,x,O),C=Math.min(I,M,x,O);return{north:g,south:S,east:w,west:C,granYCos:l,granYSin:p,granXCos:E,granXSin:_,nwCorner:t}}var c=Math.cos,l=Math.sin,E=Math.sqrt,f={};f.computePosition=function(e,t,r,a,i){var o=e.ellipsoid.radiiSquared,u=e.nwCorner,s=e.rectangle,f=u.latitude-e.granYCos*t+r*e.granXSin,h=c(f),d=l(f),p=o.z*d,y=u.longitude+t*e.granYSin+r*e.granXCos,m=h*c(y),_=h*l(y),T=o.x*m,v=o.y*_,R=E(T*m+v*_+p*d);if(a.x=T/R,a.y=v/R,a.z=p/R,n(e.vertexFormat)&&e.vertexFormat.st){var A=e.stNwCorner;n(A)?(f=A.latitude-e.stGranYCos*t+r*e.stGranXSin,y=A.longitude+t*e.stGranYSin+r*e.stGranXCos,i.x=(y-e.stWest)*e.lonScalar,i.y=(f-e.stSouth)*e.latScalar):(i.x=(y-s.west)*e.lonScalar,i.y=(f-s.south)*e.latScalar)}};var h=new o,d=new e,p=new t,y=new e,m=new a;return f.computeOptions=function(e,t,n,r){var a,o,c,l,E,f=e._granularity,h=e._ellipsoid,d=e._surfaceHeight,_=e._rotation,T=e._stRotation,v=e._extrudedHeight,R=t.east,A=t.west,N=t.north,g=t.south,S=N-g;A>R?(E=i.TWO_PI-A+R,a=Math.ceil(E/f)+1,o=Math.ceil(S/f)+1,c=E/(a-1),l=S/(o-1)):(E=R-A,a=Math.ceil(E/f)+1,o=Math.ceil(S/f)+1,c=E/(a-1),l=S/(o-1)),n=u.northwest(t,n);var I=u.center(t,p);0===_&&0===T||(I.longitude<n.longitude&&(I.longitude+=i.TWO_PI),y=m.project(I,y));var M=l,x=c,O=0,w=0,C={granYCos:M,granYSin:O,granXCos:x,granXSin:w,ellipsoid:h,surfaceHeight:d,extrudedHeight:v,nwCorner:n,rectangle:t,width:a,height:o};if(0!==_){var L=s(n,_,c,l,I,a,o);N=L.north,g=L.south,R=L.east,A=L.west,C.granYCos=L.granYCos,C.granYSin=L.granYSin,C.granXCos=L.granXCos,C.granXSin=L.granXSin,t.north=N,t.south=g,t.east=R,t.west=A}if(0!==T){_-=T,r=u.northwest(t,r);var P=s(r,_,c,l,I,a,o);C.stGranYCos=P.granYCos,C.stGranXCos=P.granXCos,C.stGranYSin=P.granYSin,C.stGranXSin=P.granXSin,C.stNwCorner=r,C.stWest=P.west,C.stSouth=P.south}return C},f}),define("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.position=e(t.position,!1),this.normal=e(t.normal,!1),this.st=e(t.st,!1),this.bitangent=e(t.bitangent,!1),this.tangent=e(t.tangent,!1),this.color=e(t.color,!1)}return a.POSITION_ONLY=r(new a({position:!0})),a.POSITION_AND_NORMAL=r(new a({position:!0,normal:!0})),a.POSITION_NORMAL_AND_ST=r(new a({position:!0,normal:!0,st:!0})),a.POSITION_AND_ST=r(new a({position:!0,st:!0})),a.POSITION_AND_COLOR=r(new a({position:!0,color:!0})),a.ALL=r(new a({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0})),a.DEFAULT=a.POSITION_NORMAL_AND_ST,a.packedLength=6,a.pack=function(t,n,r){return r=e(r,0),n[r++]=t.position?1:0,n[r++]=t.normal?1:0,n[r++]=t.st?1:0,n[r++]=t.tangent?1:0,n[r++]=t.bitangent?1:0,n[r++]=t.color?1:0,n},a.unpack=function(n,r,i){return r=e(r,0),t(i)||(i=new a),i.position=1===n[r++],i.normal=1===n[r++],i.st=1===n[r++],i.tangent=1===n[r++],i.bitangent=1===n[r++],i.color=1===n[r++],i},a.clone=function(e,n){if(t(e))return t(n)||(n=new a),n.position=e.position,n.normal=e.normal,n.st=e.st,n.tangent=e.tangent,n.bitangent=e.bitangent,n.color=e.color,n},a}),define("Core/RectangleGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./Check","./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix2","./Matrix3","./PolygonPipeline","./PrimitiveType","./Quaternion","./Rectangle","./RectangleGeometryLibrary","./VertexFormat"],function(e,t,n,r,a,i,o,u,s,c,l,E,f,h,d,p,y,m,_,T,v,R,A,N,g,S){"use strict";function I(e,t){var n=new E({attributes:new h,primitiveType:R.TRIANGLES});return n.attributes.position=new f({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:t.positions}),e.normal&&(n.attributes.normal=new f({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(n.attributes.tangent=new f({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.bitangent&&(n.attributes.bitangent=new f({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:t.bitangents})),n}function M(e,t,r,a){for(var i=e.length,o=t.normal?new Float32Array(i):void 0,u=t.tangent?new Float32Array(i):void 0,s=t.bitangent?new Float32Array(i):void 0,c=0,l=B,E=D,f=F,h=0;h<i;h+=3){var d=n.fromArray(e,h,U),p=c+1,y=c+2;(t.normal||t.tangent||t.bitangent)&&(f=r.geodeticSurfaceNormal(d,f),(t.tangent||t.bitangent)&&(n.cross(n.UNIT_Z,f,E),T.multiplyByVector(a,E,E),n.normalize(E,E),t.bitangent&&n.normalize(n.cross(f,E,l),l)),t.normal&&(o[c]=f.x,o[p]=f.y,o[y]=f.z),t.tangent&&(u[c]=E.x,u[p]=E.y,u[y]=E.z),t.bitangent&&(s[c]=l.x,s[p]=l.y,s[y]=l.z)),c+=3}return I(t,{positions:e,normals:o,tangents:u,bitangents:s})}function x(e,t,r){for(var a=e.length,i=t.normal?new Float32Array(a):void 0,o=t.tangent?new Float32Array(a):void 0,u=t.bitangent?new Float32Array(a):void 0,s=0,c=0,l=0,E=!0,f=B,h=D,d=F,p=0;p<a;p+=6){var y=n.fromArray(e,p,U);if(t.normal||t.tangent||t.bitangent){var _=n.fromArray(e,(p+6)%a,X);if(E){var T=n.fromArray(e,(p+3)%a,W);n.subtract(_,y,_),n.subtract(T,y,T),d=n.normalize(n.cross(T,_,d),d),E=!1}n.equalsEpsilon(_,y,m.EPSILON10)&&(E=!0),(t.tangent||t.bitangent)&&(f=r.geodeticSurfaceNormal(y,f),t.tangent&&(h=n.normalize(n.cross(f,d,h),h))),t.normal&&(i[s++]=d.x,i[s++]=d.y,i[s++]=d.z,i[s++]=d.x,i[s++]=d.y,i[s++]=d.z),t.tangent&&(o[c++]=h.x,o[c++]=h.y,o[c++]=h.z,o[c++]=h.x,o[c++]=h.y,o[c++]=h.z),t.bitangent&&(u[l++]=f.x,u[l++]=f.y,u[l++]=f.z,u[l++]=f.x,u[l++]=f.y,u[l++]=f.z)}}return I(t,{positions:e,normals:i,tangents:o,bitangents:u})}function O(e){for(var t=e.vertexFormat,n=e.ellipsoid,r=e.size,a=e.height,o=e.width,u=t.position?new Float64Array(3*r):void 0,s=t.st?new Float32Array(2*r):void 0,c=0,l=0,E=U,h=G,d=Number.MAX_VALUE,p=Number.MAX_VALUE,m=-Number.MAX_VALUE,_=-Number.MAX_VALUE,T=0;T<a;++T)for(var v=0;v<o;++v)g.computePosition(e,T,v,E,h),u[c++]=E.x,u[c++]=E.y,u[c++]=E.z,t.st&&(s[l++]=h.x,s[l++]=h.y,d=Math.min(d,h.x),p=Math.min(p,h.y),m=Math.max(m,h.x),_=Math.max(_,h.y));if(t.st&&(d<0||p<0||m>1||_>1))for(var R=0;R<s.length;R+=2)s[R]=(s[R]-d)/(m-d),s[R+1]=(s[R+1]-p)/(_-p);for(var A=M(u,t,n,e.tangentRotationMatrix),N=6*(o-1)*(a-1),S=y.createTypedArray(r,N),I=0,x=0,O=0;O<a-1;++O){for(var w=0;w<o-1;++w){var C=I,L=C+o,P=L+1,b=C+1;S[x++]=C,S[x++]=L,S[x++]=b,S[x++]=b,S[x++]=L,S[x++]=P,++I}++I}return A.indices=S,t.st&&(A.attributes.st=new f({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:s})),A}function w(e,t,n,r,a){return e[t++]=r[n],e[t++]=r[n+1],e[t++]=r[n+2],e[t++]=a[n],e[t++]=a[n+1],e[t++]=a[n+2],e}function C(e,t,n,r){return e[t++]=r[n],e[t++]=r[n+1],e[t++]=r[n],e[t++]=r[n+1],e}function L(e){var t,r=e.shadowVolume,a=e.vertexFormat,o=e.surfaceHeight,u=e.extrudedHeight,s=Math.min(u,o),c=Math.max(u,o),l=e.height,E=e.width,h=e.ellipsoid;r&&(e.vertexFormat=S.clone(a,H),e.vertexFormat.normal=!0);var _=O(e);if(m.equalsEpsilon(s,c,m.EPSILON10))return _;var T=v.scaleToGeodeticHeight(_.attributes.position.values,c,h,!1);T=new Float64Array(T);var R=T.length,A=2*R,N=new Float64Array(A);N.set(T);var g=v.scaleToGeodeticHeight(_.attributes.position.values,s,h);N.set(g,R),_.attributes.position.values=N;var I,M,L=a.normal?new Float32Array(A):void 0,P=a.tangent?new Float32Array(A):void 0,b=a.bitangent?new Float32Array(A):void 0,U=a.st?new Float32Array(A/3*2):void 0;if(a.normal){for(M=_.attributes.normal.values,L.set(M),t=0;t<R;t++)M[t]=-M[t];L.set(M,R),_.attributes.normal.values=L}if(r){M=_.attributes.normal.values,a.normal||(_.attributes.normal=void 0);var F=new Float32Array(A);for(t=0;t<R;t++)M[t]=-M[t];F.set(M,R),_.attributes.extrudeDirection=new f({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:F})}if(a.tangent){var D=_.attributes.tangent.values;for(P.set(D),t=0;t<R;t++)D[t]=-D[t];P.set(D,R),_.attributes.tangent.values=P}if(a.bitangent){var B=_.attributes.bitangent.values;b.set(B),b.set(B,R),_.attributes.bitangent.values=b}a.st&&(I=_.attributes.st.values,U.set(I),U.set(I,R/3*2),_.attributes.st.values=U);var z=_.indices,G=z.length,q=R/3,V=y.createTypedArray(A/3,2*G);for(V.set(z),t=0;t<G;t+=3)V[t+G]=z[t+2]+q,V[t+1+G]=z[t+1]+q,V[t+2+G]=z[t]+q;_.indices=V;var Y,k=2*E+2*l-4,Z=2*(k+4),K=new Float64Array(3*Z),j=r?new Float32Array(3*Z):void 0,Q=a.st?new Float32Array(2*Z):void 0,J=0,$=0,ee=0,te=E*l;for(t=0;t<te;t+=E)Y=3*t,K=w(K,J,Y,T,g),J+=6,a.st&&(Q=C(Q,$,2*t,I),$+=4),r&&(ee+=3,j[ee++]=M[Y],j[ee++]=M[Y+1],j[ee++]=M[Y+2]);for(t=te-E;t<te;t++)Y=3*t,K=w(K,J,Y,T,g),J+=6,a.st&&(Q=C(Q,$,2*t,I),$+=4),r&&(ee+=3,j[ee++]=M[Y],j[ee++]=M[Y+1],j[ee++]=M[Y+2]);for(t=te-1;t>0;t-=E)Y=3*t,K=w(K,J,Y,T,g),J+=6,a.st&&(Q=C(Q,$,2*t,I),$+=4),r&&(ee+=3,j[ee++]=M[Y],j[ee++]=M[Y+1],j[ee++]=M[Y+2]);for(t=E-1;t>=0;t--)Y=3*t,K=w(K,J,Y,T,g),J+=6,a.st&&(Q=C(Q,$,2*t,I),$+=4),r&&(ee+=3,j[ee++]=M[Y],j[ee++]=M[Y+1],j[ee++]=M[Y+2]);var ne=x(K,a,h);a.st&&(ne.attributes.st=new f({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:Q})),r&&(ne.attributes.extrudeDirection=new f({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:j}));var re,ae,ie,oe,ue=y.createTypedArray(Z,6*k);R=K.length/3;var se=0;for(t=0;t<R-1;t+=2){re=t,oe=(re+2)%R;var ce=n.fromArray(K,3*re,X),le=n.fromArray(K,3*oe,W);n.equalsEpsilon(ce,le,m.EPSILON10)||(ae=(re+1)%R,ie=(ae+2)%R,ue[se++]=re,ue[se++]=ae,ue[se++]=oe,ue[se++]=oe,ue[se++]=ae,ue[se++]=ie)}return ne.indices=ue,ne=p.combineInstances([new d({geometry:_}),new d({geometry:ne})]),ne[0]}function P(e,t,n){if(0===n)return N.clone(e);N.northeast(e,j[0]),N.northwest(e,j[1]),N.southeast(e,j[2]),N.southwest(e,j[3]),t.cartographicArrayToCartesianArray(j,K);var r=t.geodeticSurfaceNormalCartographic(N.center(e,k));A.fromAxisAngle(r,n,Z),T.fromQuaternion(Z,Y);for(var a=0;a<4;++a)T.multiplyByVector(Y,K[a],K[a]);return t.cartesianArrayToCartographicArray(K,j),N.fromCartographicArray(j)}function b(e){e=o(e,o.EMPTY_OBJECT);var t=e.rectangle,n=o(e.rotation,0);this._rectangle=t,this._granularity=o(e.granularity,m.RADIANS_PER_DEGREE),this._ellipsoid=l.clone(o(e.ellipsoid,l.WGS84)),this._surfaceHeight=o(e.height,0),this._rotation=n,this._stRotation=o(e.stRotation,0),this._vertexFormat=S.clone(o(e.vertexFormat,S.DEFAULT)),this._extrudedHeight=o(e.extrudedHeight,0),this._extrude=u(e.extrudedHeight),this._closeTop=o(e.closeTop,!0),this._closeBottom=o(e.closeBottom,!0),this._shadowVolume=o(e.shadowVolume,!1),this._workerName="createRectangleGeometry",this._rotatedRectangle=P(this._rectangle,this._ellipsoid,n)}var U=new n,F=new n,D=new n,B=new n,z=new N,G=new t,q=new e,V=new e,X=new n,W=new n,H=new S,Y=new T,k=new n,Z=new A,K=[new n,new n,new n,new n],j=[new r,new r,new r,new r];b.packedLength=N.packedLength+l.packedLength+S.packedLength+N.packedLength+9,b.pack=function(e,t,n){return n=o(n,0),N.pack(e._rectangle,t,n),n+=N.packedLength,l.pack(e._ellipsoid,t,n),n+=l.packedLength,S.pack(e._vertexFormat,t,n),n+=S.packedLength,N.pack(e._rotatedRectangle,t,n),n+=N.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._extrudedHeight,t[n++]=e._extrude?1:0,t[n++]=e._closeTop?1:0,t[n++]=e._closeBottom?1:0,t[n]=e._shadowVolume?1:0,t};var Q=new N,J=new N,$=l.clone(l.UNIT_SPHERE),ee={rectangle:Q,ellipsoid:$,vertexFormat:H,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,closeTop:void 0,closeBottom:void 0,shadowVolume:void 0};b.unpack=function(e,t,n){t=o(t,0);var r=N.unpack(e,t,Q);t+=N.packedLength;var a=l.unpack(e,t,$);t+=l.packedLength;var i=S.unpack(e,t,H);t+=S.packedLength;var s=N.unpack(e,t,J);t+=N.packedLength;var c=e[t++],E=e[t++],f=e[t++],h=e[t++],d=e[t++],p=1===e[t++],y=1===e[t++],m=1===e[t++],_=1===e[t];return u(n)?(n._rectangle=N.clone(r,n._rectangle),n._ellipsoid=l.clone(a,n._ellipsoid),n._vertexFormat=S.clone(i,n._vertexFormat),n._granularity=c,n._surfaceHeight=E,n._rotation=f,n._stRotation=h,n._extrudedHeight=p?d:void 0,n._extrude=p,n._closeTop=y,n._closeBottom=m,n._rotatedRectangle=s,n._shadowVolume=_,n):(ee.granularity=c,ee.height=E,ee.rotation=f,ee.stRotation=h,ee.extrudedHeight=p?d:void 0,ee.closeTop=y,ee.closeBottom=m,ee.shadowVolume=_,new b(ee))};var te=new T,ne=new r,re=new r,ae=new A,ie=new r;return b.createGeometry=function(t){if(!m.equalsEpsilon(t._rectangle.north,t._rectangle.south,m.EPSILON10)&&!m.equalsEpsilon(t._rectangle.east,t._rectangle.west,m.EPSILON10)){var n=N.clone(t._rectangle,z),r=t._ellipsoid,a=t._surfaceHeight,i=t._extrude,o=t._extrudedHeight,u=t._rotation,s=t._stRotation,c=t._vertexFormat,l=g.computeOptions(t,n,ne,re),f=te;if(0!==s||0!==u){var h=N.center(n,ie),d=r.geodeticSurfaceNormalCartographic(h,X);A.fromAxisAngle(d,-s,ae),T.fromQuaternion(ae,f)}else T.clone(T.IDENTITY,f);l.lonScalar=1/t._rectangle.width,l.latScalar=1/t._rectangle.height,l.vertexFormat=c,l.rotation=u,l.stRotation=s,l.tangentRotationMatrix=f,l.size=l.width*l.height;var p,y;if(n=t._rectangle,i){l.shadowVolume=t._shadowVolume,p=L(l);var _=e.fromRectangle3D(n,r,a,V),R=e.fromRectangle3D(n,r,o,q);y=e.union(_,R)}else p=O(l),p.attributes.position.values=v.scaleToGeodeticHeight(p.attributes.position.values,a,r,!1),y=e.fromRectangle3D(n,r,a);return c.position||delete p.attributes.position,new E({attributes:p.attributes,indices:p.indices,primitiveType:p.primitiveType,boundingSphere:y})}},b.createShadowVolume=function(e,t,n){var r=e._granularity,a=e._ellipsoid,i=t(r,a),o=n(r,a);return new b({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:a,stRotation:e._stRotation,granularity:r,extrudedHeight:o,height:i,closeTop:!0,closeBottom:!0,vertexFormat:S.POSITION_ONLY,shadowVolume:!0})},s(b.prototype,{rectangle:{get:function(){return this._rotatedRectangle}}}),b}),define("Workers/createRectangleGeometry",["../Core/defined","../Core/Ellipsoid","../Core/Rectangle","../Core/RectangleGeometry"],function(e,t,n,r){"use strict";function a(a,i){return e(i)&&(a=r.unpack(a,i)),a._ellipsoid=t.clone(a._ellipsoid),a._rectangle=n.clone(a._rectangle),r.createGeometry(a)}return a})}(); \ No newline at end of file diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createRectangleOutlineGeometry.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createRectangleOutlineGeometry.js index 24d214a6..d28371a1 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createRectangleOutlineGeometry.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createRectangleOutlineGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,7 +55,7 @@ mersenne-twister.js - https://gist.github.com/banksean/300494 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==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";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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("Core/isArray",["./defined"],function(e){"use strict";var t=Array.isArray;return e(t)||(t=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),t}),define("Core/Check",["./defaultValue","./defined","./DeveloperError","./isArray"],function(e,t,n,r){"use strict";function i(e){return e+" was required but undefined."}function a(e,t,n){return"Expected "+n+" to be typeof "+t+", got "+e}var o={};return o.typeOf={},o.numeric={},o.defined=function(e,r){if(!t(e))throw new n(i(r))},o.numeric.maximum=function(e,t){if(o.typeOf.number(e),o.typeOf.number(t),e>t)throw new n("Expected "+e+" to be at most "+t)},o.numeric.minimum=function(e,t){if(o.typeOf.number(e),o.typeOf.number(t),e<t)throw new n("Expected "+e+" to be at least "+t)},o.typeOf.function=function(e,t){if("function"!=typeof e)throw new n(a(typeof e,"function",t))},o.typeOf.string=function(e,t){if("string"!=typeof e)throw new n(a(typeof e,"string",t))},o.typeOf.number=function(e,t){if("number"!=typeof e)throw new n(a(typeof e,"number",t))},o.typeOf.object=function(e,t){if("object"!=typeof e)throw new n(a(typeof e,"object",t))},o.typeOf.boolean=function(e,t){if("boolean"!=typeof e)throw new n(a(typeof e,"boolean",t))},o}),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 n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(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^=e<<7&2636928640,e^=e<<15&4022730752,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,n,r){"use strict";var i={};i.EPSILON1=.1,i.EPSILON2=.01,i.EPSILON3=.001,i.EPSILON4=1e-4,i.EPSILON5=1e-5,i.EPSILON6=1e-6,i.EPSILON7=1e-7,i.EPSILON8=1e-8,i.EPSILON9=1e-9,i.EPSILON10=1e-10,i.EPSILON11=1e-11,i.EPSILON12=1e-12,i.EPSILON13=1e-13,i.EPSILON14=1e-14,i.EPSILON15=1e-15,i.EPSILON16=1e-16,i.EPSILON17=1e-17,i.EPSILON18=1e-18,i.EPSILON19=1e-19,i.EPSILON20=1e-20,i.GRAVITATIONALPARAMETER=3986004418e5,i.SOLAR_RADIUS=6955e5,i.LUNAR_RADIUS=1737400,i.SIXTY_FOUR_KILOBYTES=65536,i.sign=function(e){return e>0?1:e<0?-1:0},i.signNotZero=function(e){return e<0?-1:1},i.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*i.clamp(e,-1,1)+.5)*n)},i.fromSNorm=function(e,n){return n=t(n,255),i.clamp(e,0,n)/n*2-1},i.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},i.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},i.lerp=function(e,t,n){return(1-n)*e+n*t},i.PI=Math.PI,i.ONE_OVER_PI=1/Math.PI,i.PI_OVER_TWO=.5*Math.PI,i.PI_OVER_THREE=Math.PI/3,i.PI_OVER_FOUR=Math.PI/4,i.PI_OVER_SIX=Math.PI/6,i.THREE_PI_OVER_TWO=3*Math.PI*.5,i.TWO_PI=2*Math.PI,i.ONE_OVER_TWO_PI=1/(2*Math.PI),i.RADIANS_PER_DEGREE=Math.PI/180,i.DEGREES_PER_RADIAN=180/Math.PI,i.RADIANS_PER_ARCSECOND=i.RADIANS_PER_DEGREE/3600,i.toRadians=function(e){return e*i.RADIANS_PER_DEGREE},i.toDegrees=function(e){return e*i.DEGREES_PER_RADIAN},i.convertLongitudeRange=function(e){var t=i.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},i.clampToLatitudeRange=function(e){return i.clamp(e,-1*i.PI_OVER_TWO,i.PI_OVER_TWO)},i.negativePiToPi=function(e){return i.zeroToTwoPi(e+i.PI)-i.PI},i.zeroToTwoPi=function(e){var t=i.mod(e,i.TWO_PI);return Math.abs(t)<i.EPSILON14&&Math.abs(e)>i.EPSILON14?i.TWO_PI:t},i.mod=function(e,t){return(e%t+t)%t},i.equalsEpsilon=function(e,n,r,i){i=t(i,r);var a=Math.abs(e-n);return a<=i||a<=r*Math.max(Math.abs(e),Math.abs(n))};var a=[1];i.factorial=function(e){var t=a.length;if(e>=t)for(var n=a[t-1],r=t;r<=e;r++)a.push(n*r);return a[e]},i.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},i.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},i.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},i.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return i.setRandomNumberSeed=function(t){o=new e(t)},i.nextRandomNumber=function(){return o.random()},i.acosClamped=function(e){return Math.acos(i.clamp(e,-1,1))},i.asinClamped=function(e){return Math.asin(i.clamp(e,-1,1))},i.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},i.logBase=function(e,t){return Math.log(e)/Math.log(t)},i.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},i}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var i=e.clock,a=e.cone,u=t(e.magnitude,1),s=u*Math.sin(a);return r.x=s*Math.cos(i),r.y=s*Math.sin(i),r.z=u*Math.cos(a),r},o.fromElements=function(e,t,r,i){return n(i)?(i.x=e,i.y=t,i.z=r,i):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new o),i.x=e[r++],i.y=e[r++],i.z=e[r],i},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var i=0;i<r;++i)o.pack(e[i],t,3*i);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var i=0;i<r;i+=3){var a=i/3;t[a]=o.unpack(e,i,t[a])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,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};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,E=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,E);var n=o.dot(c,E),r=o.magnitude(o.cross(c,E,c));return Math.atan2(r,n)};var l=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,l);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,i){return e===t||n(e)&&n(t)&&a.equalsEpsilon(e.x,t.x,r,i)&&a.equalsEpsilon(e.y,t.y,r,i)&&a.equalsEpsilon(e.z,t.z,r,i)},o.cross=function(e,t,n){var r=e.x,i=e.y,a=e.z,o=t.x,u=t.y,s=t.z,c=i*s-a*u,E=a*o-r*s,l=r*u-i*o;return n.x=c,n.y=E,n.z=l,n},o.fromDegrees=function(e,t,n,r,i){return e=a.toRadians(e),t=a.toRadians(t),o.fromRadians(e,t,n,r,i)};var _=new o,f=new o,T=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,i,a,u){i=t(i,0);var s=n(a)?a.radiiSquared:T,c=Math.cos(r);_.x=c*Math.cos(e),_.y=c*Math.sin(e),_.z=Math.sin(r),_=o.normalize(_,_),o.multiplyComponents(s,_,f);var E=Math.sqrt(o.dot(_,f));return f=o.divideByScalar(f,E,f),_=o.multiplyByScalar(_,i,_),n(u)||(u=new o),o.add(f,_,u)},o.fromDegreesArray=function(e,t,r){var i=e.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],s=e[a+1],c=a/2;r[c]=o.fromDegrees(u,s,0,t,r[c])}return r},o.fromRadiansArray=function(e,t,r){var i=e.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],s=e[a+1],c=a/2;r[c]=o.fromRadians(u,s,0,t,r[c])}return r},o.fromDegreesArrayHeights=function(e,t,r){var i=e.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],s=e[a+1],c=e[a+2],E=a/3;r[E]=o.fromDegrees(u,s,c,t,r[E])}return r},o.fromRadiansArrayHeights=function(e,t,r){var i=e.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],s=e[a+1],c=e[a+2],E=a/3;r[E]=o.fromRadians(u,s,c,t,r[E])}return r},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,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function i(n,i,u,s,c){var E=n.x,l=n.y,_=n.z,f=i.x,T=i.y,R=i.z,h=E*E*f*f,d=l*l*T*T,A=_*_*R*R,N=h+d+A,y=Math.sqrt(1/N),S=e.multiplyByScalar(n,y,a);if(N<s)return isFinite(y)?e.clone(S,c):void 0;var I=u.x,m=u.y,p=u.z,M=o;M.x=S.x*I*2,M.y=S.y*m*2,M.z=S.z*p*2;var O,x,C,g,v,U,L,w,F,P,D,B=(1-y)*e.magnitude(n)/(.5*e.magnitude(M)),z=0;do{B-=z,C=1/(1+B*I),g=1/(1+B*m),v=1/(1+B*p),U=C*C,L=g*g,w=v*v,F=U*C,P=L*g,D=w*v,O=h*U+d*L+A*w-1,x=h*F*I+d*P*m+A*D*p;var G=-2*x;z=O/G}while(Math.abs(O)>r.EPSILON12);return t(c)?(c.x=E*C,c.y=l*g,c.z=_*v,c):new e(E*C,l*g,_*v)}var a=new e,o=new e;return i}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,i,a,o){"use strict";function u(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)}u.fromRadians=function(e,r,i,a){return i=t(i,0),n(a)?(a.longitude=e,a.latitude=r,a.height=i,a):new u(e,r,i)},u.fromDegrees=function(e,t,n,r){return e=a.toRadians(e),t=a.toRadians(t),u.fromRadians(e,t,n,r)};var s=new e,c=new e,E=new e,l=new e(1/6378137,1/6378137,1/6356752.314245179),_=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),f=a.EPSILON1;return u.fromCartesian=function(t,r,i){var T=n(r)?r.oneOverRadii:l,R=n(r)?r.oneOverRadiiSquared:_,h=n(r)?r._centerToleranceSquared:f,d=o(t,T,R,h,c);if(n(d)){var A=e.multiplyComponents(d,R,s);A=e.normalize(A,A);var N=e.subtract(t,d,E),y=Math.atan2(A.y,A.x),S=Math.asin(A.z),I=a.sign(e.dot(N,t))*e.magnitude(N);return n(i)?(i.longitude=y,i.latitude=S,i.height=I,i):new u(y,S,I)}},u.clone=function(e,t){if(n(e))return n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},u.ZERO=i(new u(0,0,0)),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,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,i,a,o,u,s){"use strict";function c(t,r,i,a){r=n(r,0),i=n(i,0),a=n(a,0),t._radii=new e(r,i,a),t._radiiSquared=new e(r*r,i*i,a*a),t._radiiToTheFourth=new e(r*r*r*r,i*i*i*i,a*a*a*a),t._oneOverRadii=new e(0===r?0:1/r,0===i?0:1/i,0===a?0:1/a),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===i?0:1/(i*i),0===a?0:1/(a*a)),t._minimumRadius=Math.min(r,i,a),t._maximumRadius=Math.max(r,i,a),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function E(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,c(this,e,t,n)}i(E.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}}}),E.clone=function(t,n){if(r(t)){var i=t._radii;return r(n)?(e.clone(i,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new E(i.x,i.y,i.z)}},E.fromCartesian3=function(e,t){return r(t)||(t=new E),r(e)?(c(t,e.x,e.y,e.z),t):t},E.WGS84=o(new E(6378137,6378137,6356752.314245179)),E.UNIT_SPHERE=o(new E(1,1,1)),E.MOON=o(new E(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),E.prototype.clone=function(e){return E.clone(this,e)},E.packedLength=e.packedLength,E.pack=function(t,r,i){return i=n(i,0),e.pack(t._radii,r,i),r},E.unpack=function(t,r,i){r=n(r,0);var a=e.unpack(t,r);return E.fromCartesian3(a,i)},E.prototype.geocentricSurfaceNormal=e.normalize,E.prototype.geodeticSurfaceNormalCartographic=function(t,n){var i=t.longitude,a=t.latitude,o=Math.cos(a),u=o*Math.cos(i),s=o*Math.sin(i),c=Math.sin(a);return r(n)||(n=new e),n.x=u,n.y=s,n.z=c,e.normalize(n,n)},E.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var l=new e,_=new e;E.prototype.cartographicToCartesian=function(t,n){var i=l,a=_;this.geodeticSurfaceNormalCartographic(t,i),e.multiplyComponents(this._radiiSquared,i,a);var o=Math.sqrt(e.dot(i,a));return e.divideByScalar(a,o,a),e.multiplyByScalar(i,t.height,i),r(n)||(n=new e),e.add(a,i,n)},E.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;i<n;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var f=new e,T=new e,R=new e;return E.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,T);if(r(a)){var o=this.geodeticSurfaceNormal(a,f),s=e.subtract(n,a,R),c=Math.atan2(o.y,o.x),E=Math.asin(o.z),l=u.sign(e.dot(s,n))*e.magnitude(s);return r(i)?(i.longitude=c,i.latitude=E,i.height=l,i):new t(c,E,l)}},E.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;i<n;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t},E.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},E.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var i=t.x,a=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*u.z);return e.multiplyByScalar(t,s,n)},E.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},E.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},E.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},E.prototype.toString=function(){return this._radii.toString()},E.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,i,a){i=n(i,0);var o=this._sqauredXOverSquaredZ;if(r(a)||(a=new e),a.x=0,a.y=0,a.z=t.z*(1-o),!(Math.abs(a.z)>=this._radii.z-i))return a},E}),define("Core/Rectangle",["./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,i,a,o,u){"use strict";function s(e,n,r,i){this.west=t(e,0),this.south=t(n,0),this.east=t(r,0),this.north=t(i,0)}r(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,n,r){return r=t(r,0),n[r++]=e.west,n[r++]=e.south,n[r++]=e.east,n[r]=e.north,n},s.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new s),i.west=e[r++],i.south=e[r++],i.east=e[r++],i.north=e[r],i},s.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=u.TWO_PI),t-n},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,r,i,a,o){return e=u.toRadians(t(e,0)),r=u.toRadians(t(r,0)),i=u.toRadians(t(i,0)),a=u.toRadians(t(a,0)),n(o)?(o.west=e,o.south=r,o.east=i,o.north=a,o):new s(e,r,i,a)},s.fromCartographicArray=function(e,t){for(var r=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,c=Number.MAX_VALUE,E=-Number.MAX_VALUE,l=0,_=e.length;l<_;l++){var f=e[l];r=Math.min(r,f.longitude),i=Math.max(i,f.longitude),c=Math.min(c,f.latitude),E=Math.max(E,f.latitude);var T=f.longitude>=0?f.longitude:f.longitude+u.TWO_PI;a=Math.min(a,T),o=Math.max(o,T)}return i-r>o-a&&(r=a,i=o,i>u.PI&&(i-=u.TWO_PI),r>u.PI&&(r-=u.TWO_PI)),n(t)?(t.west=r,t.south=c,t.east=i,t.north=E,t):new s(r,c,i,E)},s.fromCartesianArray=function(e,t,r){for(var i=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,c=-Number.MAX_VALUE,E=Number.MAX_VALUE,l=-Number.MAX_VALUE,_=0,f=e.length;_<f;_++){var T=t.cartesianToCartographic(e[_]);i=Math.min(i,T.longitude),a=Math.max(a,T.longitude),E=Math.min(E,T.latitude),l=Math.max(l,T.latitude);var R=T.longitude>=0?T.longitude:T.longitude+u.TWO_PI;o=Math.min(o,R),c=Math.max(c,R)}return a-i>c-o&&(i=o,a=c,a>u.PI&&(a-=u.TWO_PI),i>u.PI&&(i-=u.TWO_PI)),n(r)?(r.west=i,r.south=E,r.east=a,r.north=l,r):new s(i,E,a,l)},s.clone=function(e,t){if(n(e))return n(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,t){return e===t||n(e)&&n(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},s.prototype.equalsEpsilon=function(e,t){return n(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},s.validate=function(e){},s.southwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.south,r.height=0,r):new e(t.west,t.south)},s.northwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.north,r.height=0,r):new e(t.west,t.north)},s.northeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.north,r.height=0,r):new e(t.east,t.north)},s.southeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.south,r.height=0,r):new e(t.east,t.south)},s.center=function(t,r){var i=t.east,a=t.west;i<a&&(i+=u.TWO_PI);var o=u.negativePiToPi(.5*(a+i)),s=.5*(t.south+t.north);return n(r)?(r.longitude=o,r.latitude=s,r.height=0,r):new e(o,s)},s.intersection=function(e,t,r){var i=e.east,a=e.west,o=t.east,c=t.west;i<a&&o>0?i+=u.TWO_PI:o<c&&i>0&&(o+=u.TWO_PI),i<a&&c<0?c+=u.TWO_PI:o<c&&a<0&&(a+=u.TWO_PI);var E=u.negativePiToPi(Math.max(a,c)),l=u.negativePiToPi(Math.min(i,o));if(!((e.west<e.east||t.west<t.east)&&l<=E)){var _=Math.max(e.south,t.south),f=Math.min(e.north,t.north);if(!(_>=f))return n(r)?(r.west=E,r.south=_,r.east=l,r.north=f,r):new s(E,_,l,f)}},s.simpleIntersection=function(e,t,r){var i=Math.max(e.west,t.west),a=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(a>=u||i>=o))return n(r)?(r.west=i,r.south=a,r.east=o,r.north=u,r):new s(i,a,o,u)},s.union=function(e,t,r){n(r)||(r=new s);var i=e.east,a=e.west,o=t.east,c=t.west;i<a&&o>0?i+=u.TWO_PI:o<c&&i>0&&(o+=u.TWO_PI),i<a&&c<0?c+=u.TWO_PI:o<c&&a<0&&(a+=u.TWO_PI);var E=u.convertLongitudeRange(Math.min(a,c)),l=u.convertLongitudeRange(Math.max(i,o));return r.west=E,r.south=Math.min(e.south,t.south),r.east=l,r.north=Math.max(e.north,t.north),r},s.expand=function(e,t,r){return n(r)||(r=new s),r.west=Math.min(e.west,t.longitude),r.south=Math.min(e.south,t.latitude),r.east=Math.max(e.east,t.longitude),r.north=Math.max(e.north,t.latitude),r},s.contains=function(e,t){var n=t.longitude,r=t.latitude,i=e.west,a=e.east;return a<i&&(a+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>i||u.equalsEpsilon(n,i,u.EPSILON14))&&(n<a||u.equalsEpsilon(n,a,u.EPSILON14))&&r>=e.south&&r<=e.north};var c=new e;return s.subsample=function(e,r,i,o){r=t(r,a.WGS84),i=t(i,0),n(o)||(o=[]);var E=0,l=e.north,_=e.south,f=e.east,T=e.west,R=c;R.height=i,R.longitude=T,R.latitude=l,o[E]=r.cartographicToCartesian(R,o[E]),E++,R.longitude=f,o[E]=r.cartographicToCartesian(R,o[E]),E++,R.latitude=_,o[E]=r.cartographicToCartesian(R,o[E]),E++,R.longitude=T,o[E]=r.cartographicToCartesian(R,o[E]),E++,l<0?R.latitude=l:_>0?R.latitude=_:R.latitude=0;for(var h=1;h<8;++h)R.longitude=-Math.PI+h*u.PI_OVER_TWO,s.contains(e,R)&&(o[E]=r.cartographicToCartesian(R,o[E]),E++);return 0===R.latitude&&(R.longitude=T,o[E]=r.cartographicToCartesian(R,o[E]),E++,R.longitude=f,o[E]=r.cartographicToCartesian(R,o[E]),E++),o.length=E,o},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,i,a,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return i(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var i=this._semimajorAxis,a=t.longitude*i,o=t.latitude*i,u=t.height;return r(n)?(n.x=a,n.y=o,n.z=u,n):new e(a,o,u)},u.prototype.unproject=function(e,n){var i=this._oneOverSemimajorAxis,a=e.x*i,o=e.y*i,u=e.z;return r(n)?(n.longitude=a,n.latitude=o,n.height=u,n):new t(a,o,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";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a,o){"use strict";function u(e,n,r,i,a,o,u,s,c){this[0]=t(e,0),this[1]=t(i,0),this[2]=t(u,0),this[3]=t(n,0),this[4]=t(a,0),this[5]=t(s,0),this[6]=t(r,0),this[7]=t(o,0),this[8]=t(c,0)}function s(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function c(e){for(var t=0,n=0;n<3;++n){var r=e[u.getElementIndex(T[n],f[n])];t+=2*r*r}return Math.sqrt(t)}function E(e,t){for(var n=o.EPSILON15,r=0,i=1,a=0;a<3;++a){var s=Math.abs(e[u.getElementIndex(T[a],f[a])]);s>r&&(i=a,r=s)}var c=1,E=0,l=f[i],_=T[i];if(Math.abs(e[u.getElementIndex(_,l)])>n){var R,h=e[u.getElementIndex(_,_)],d=e[u.getElementIndex(l,l)],A=e[u.getElementIndex(_,l)],N=(h-d)/2/A;R=N<0?-1/(-N+Math.sqrt(1+N*N)):1/(N+Math.sqrt(1+N*N)),c=1/Math.sqrt(1+R*R),E=R*c}return t=u.clone(u.IDENTITY,t),t[u.getElementIndex(l,l)]=t[u.getElementIndex(_,_)]=c,t[u.getElementIndex(_,l)]=E,t[u.getElementIndex(l,_)]=-E,t}u.packedLength=9,u.pack=function(e,n,r){return r=t(r,0),n[r++]=e[0],n[r++]=e[1],n[r++]=e[2],n[r++]=e[3],n[r++]=e[4],n[r++]=e[5],n[r++]=e[6],n[r++]=e[7],n[r++]=e[8],n},u.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new u),i[0]=e[r++],i[1]=e[r++],i[2]=e[r++],i[3]=e[r++],i[4]=e[r++],i[5]=e[r++],i[6]=e[r++],i[7]=e[r++],i[8]=e[r++],i},u.clone=function(e,t){if(n(e))return n(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 u(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},u.fromArray=function(e,r,i){return r=t(r,0),n(i)||(i=new u),i[0]=e[r],i[1]=e[r+1],i[2]=e[r+2],i[3]=e[r+3],i[4]=e[r+4],i[5]=e[r+5],i[6]=e[r+6],i[7]=e[r+7],i[8]=e[r+8],i},u.fromColumnMajorArray=function(e,t){return u.clone(e,t)},u.fromRowMajorArray=function(e,t){return n(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 u(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},u.fromQuaternion=function(e,t){var r=e.x*e.x,i=e.x*e.y,a=e.x*e.z,o=e.x*e.w,s=e.y*e.y,c=e.y*e.z,E=e.y*e.w,l=e.z*e.z,_=e.z*e.w,f=e.w*e.w,T=r-s-l+f,R=2*(i-_),h=2*(a+E),d=2*(i+_),A=-r+s-l+f,N=2*(c-o),y=2*(a-E),S=2*(c+o),I=-r-s+l+f;return n(t)?(t[0]=T,t[1]=d,t[2]=y,t[3]=R,t[4]=A,t[5]=S,t[6]=h,t[7]=N,t[8]=I,t):new u(T,R,h,d,A,N,y,S,I)},u.fromHeadingPitchRoll=function(e,t){var r=Math.cos(-e.pitch),i=Math.cos(-e.heading),a=Math.cos(e.roll),o=Math.sin(-e.pitch),s=Math.sin(-e.heading),c=Math.sin(e.roll),E=r*i,l=-a*s+c*o*i,_=c*s+a*o*i,f=r*s,T=a*i+c*o*s,R=-o*a+a*o*s,h=-o,d=c*r,A=a*r;return n(t)?(t[0]=E,t[1]=f,t[2]=h,t[3]=l,t[4]=T,t[5]=d,t[6]=_,t[7]=R,t[8]=A,t):new u(E,l,_,f,T,R,h,d,A)},u.fromScale=function(e,t){return n(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 u(e.x,0,0,0,e.y,0,0,0,e.z)},u.fromUniformScale=function(e,t){return n(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 u(e,0,0,0,e,0,0,0,e)},u.fromCrossProduct=function(e,t){return n(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 u(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},u.fromRotationX=function(e,t){var r=Math.cos(e),i=Math.sin(e);return n(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=r,t[5]=i,t[6]=0,t[7]=-i,t[8]=r,t):new u(1,0,0,0,r,-i,0,i,r)},u.fromRotationY=function(e,t){var r=Math.cos(e),i=Math.sin(e);return n(t)?(t[0]=r,t[1]=0,t[2]=-i,t[3]=0,t[4]=1,t[5]=0,t[6]=i,t[7]=0,t[8]=r,t):new u(r,0,i,0,1,0,-i,0,r)},u.fromRotationZ=function(e,t){var r=Math.cos(e),i=Math.sin(e);return n(t)?(t[0]=r,t[1]=i,t[2]=0,t[3]=-i,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new u(r,-i,0,i,r,0,0,0,1)},u.toArray=function(e,t){return n(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]]},u.getElementIndex=function(e,t){return 3*e+t},u.getColumn=function(e,t,n){var r=3*t,i=e[r],a=e[r+1],o=e[r+2];return n.x=i,n.y=a,n.z=o,n},u.setColumn=function(e,t,n,r){r=u.clone(e,r);var i=3*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},u.getRow=function(e,t,n){var r=e[t],i=e[t+3],a=e[t+6];return n.x=r,n.y=i,n.z=a,n},u.setRow=function(e,t,n,r){return r=u.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var l=new e;u.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],l)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],l)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],l)),n};var _=new e;u.getMaximumScale=function(t){return u.getScale(t,_),e.maximumComponent(_)},u.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],i=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],o=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],E=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],l=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=r,n[1]=i,n[2]=a,n[3]=o,n[4]=u,n[5]=s,n[6]=c,n[7]=E,n[8]=l,n},u.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},u.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},u.multiplyByVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[3]*i+e[6]*a,u=e[1]*r+e[4]*i+e[7]*a,s=e[2]*r+e[5]*i+e[8]*a;return n.x=o,n.y=u,n.z=s,n},u.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},u.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},u.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},u.transpose=function(e,t){var n=e[0],r=e[3],i=e[6],a=e[1],o=e[4],u=e[7],s=e[2],c=e[5],E=e[8];return t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=E,t};var f=[1,0,0],T=[2,2,1],R=new u,h=new u;return u.computeEigenDecomposition=function(e,t){var r=o.EPSILON20,i=10,a=0,l=0;n(t)||(t={});for(var _=t.unitary=u.clone(u.IDENTITY,t.unitary),f=t.diagonal=u.clone(e,t.diagonal),T=r*s(f);l<i&&c(f)>T;)E(f,R),u.transpose(R,h),u.multiply(f,R,f),u.multiply(h,f,f),u.multiply(_,R,_),++a>2&&(++l,a=0);return t},u.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},u.determinant=function(e){var t=e[0],n=e[3],r=e[6],i=e[1],a=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(a*c-s*o)+i*(s*r-n*c)+u*(n*o-a*r)},u.inverse=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],E=e[7],l=e[8],_=u.determinant(e);t[0]=o*l-E*s,t[1]=E*i-r*l,t[2]=r*s-o*i,t[3]=c*s-a*l,t[4]=n*l-c*i,t[5]=a*i-n*s,t[6]=a*E-c*o,t[7]=c*r-n*E,t[8]=n*o-a*r;var f=1/_;return u.multiplyByScalar(t,f,t)},u.equals=function(e,t){return e===t||n(e)&&n(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]},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r; -},u.IDENTITY=a(new u(1,0,0,0,1,0,0,0,1)),u.ZERO=a(new u(0,0,0,0,0,0,0,0,0)),u.COLUMN0ROW0=0,u.COLUMN0ROW1=1,u.COLUMN0ROW2=2,u.COLUMN1ROW0=3,u.COLUMN1ROW1=4,u.COLUMN1ROW2=5,u.COLUMN2ROW0=6,u.COLUMN2ROW1=7,u.COLUMN2ROW2=8,r(u.prototype,{length:{get:function(){return u.packedLength}}}),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},u}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i){"use strict";function a(t,n,r,i){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0),this.w=e(i,0)}a.fromElements=function(e,n,r,i,o){return t(o)?(o.x=e,o.y=n,o.z=r,o.w=i,o):new a(e,n,r,i)},a.fromColor=function(e,n){return t(n)?(n.x=e.red,n.y=e.green,n.z=e.blue,n.w=e.alpha,n):new a(e.red,e.green,e.blue,e.alpha)},a.clone=function(e,n){if(t(e))return t(n)?(n.x=e.x,n.y=e.y,n.z=e.z,n.w=e.w,n):new a(e.x,e.y,e.z,e.w)},a.packedLength=4,a.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w,n},a.unpack=function(n,r,i){return r=e(r,0),t(i)||(i=new a),i.x=n[r++],i.y=n[r++],i.z=n[r++],i.w=n[r],i},a.packArray=function(e,n){var r=e.length;t(n)?n.length=4*r:n=new Array(4*r);for(var i=0;i<r;++i)a.pack(e[i],n,4*i);return n},a.unpackArray=function(e,n){var r=e.length;t(n)?n.length=r/4:n=new Array(r/4);for(var i=0;i<r;i+=4){var o=i/4;n[o]=a.unpack(e,i,n[o])}return n},a.fromArray=a.unpack,a.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},a.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},a.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},a.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},a.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},a.magnitude=function(e){return Math.sqrt(a.magnitudeSquared(e))};var o=new a;a.distance=function(e,t){return a.subtract(e,t,o),a.magnitude(o)},a.distanceSquared=function(e,t){return a.subtract(e,t,o),a.magnitudeSquared(o)},a.normalize=function(e,t){var n=a.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t},a.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},a.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},a.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},a.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},a.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},a.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},a.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},a.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,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.w=Math.abs(e.w),t};var u=new a;a.lerp=function(e,t,n,r){return a.multiplyByScalar(t,n,u),r=a.multiplyByScalar(e,1-n,r),a.add(u,r,r)};var s=new a;return a.mostOrthogonalAxis=function(e,t){var n=a.normalize(e,s);return a.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?a.clone(a.UNIT_X,t):a.clone(a.UNIT_W,t):n.z<=n.w?a.clone(a.UNIT_Z,t):a.clone(a.UNIT_W,t):n.y<=n.z?n.y<=n.w?a.clone(a.UNIT_Y,t):a.clone(a.UNIT_W,t):n.z<=n.w?a.clone(a.UNIT_Z,t):a.clone(a.UNIT_W,t)},a.equals=function(e,n){return e===n||t(e)&&t(n)&&e.x===n.x&&e.y===n.y&&e.z===n.z&&e.w===n.w},a.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},a.equalsEpsilon=function(e,n,r,a){return e===n||t(e)&&t(n)&&i.equalsEpsilon(e.x,n.x,r,a)&&i.equalsEpsilon(e.y,n.y,r,a)&&i.equalsEpsilon(e.z,n.z,r,a)&&i.equalsEpsilon(e.w,n.w,r,a)},a.ZERO=r(new a(0,0,0,0)),a.UNIT_X=r(new a(1,0,0,0)),a.UNIT_Y=r(new a(0,1,0,0)),a.UNIT_Z=r(new a(0,0,1,0)),a.UNIT_W=r(new a(0,0,0,1)),a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,n){return a.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},a}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,i,a,o,u,s,c){"use strict";function E(e,t,r,i,a,o,u,s,c,E,l,_,f,T,R,h){this[0]=n(e,0),this[1]=n(a,0),this[2]=n(c,0),this[3]=n(f,0),this[4]=n(t,0),this[5]=n(o,0),this[6]=n(E,0),this[7]=n(T,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(l,0),this[11]=n(R,0),this[12]=n(i,0),this[13]=n(s,0),this[14]=n(_,0),this[15]=n(h,0)}E.packedLength=16,E.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t[r++]=e[9],t[r++]=e[10],t[r++]=e[11],t[r++]=e[12],t[r++]=e[13],t[r++]=e[14],t[r]=e[15],t},E.unpack=function(e,t,i){return t=n(t,0),r(i)||(i=new E),i[0]=e[t++],i[1]=e[t++],i[2]=e[t++],i[3]=e[t++],i[4]=e[t++],i[5]=e[t++],i[6]=e[t++],i[7]=e[t++],i[8]=e[t++],i[9]=e[t++],i[10]=e[t++],i[11]=e[t++],i[12]=e[t++],i[13]=e[t++],i[14]=e[t++],i[15]=e[t],i},E.clone=function(e,t){if(r(e))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):new E(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])},E.fromArray=E.unpack,E.fromColumnMajorArray=function(e,t){return E.clone(e,t)},E.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 E(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])},E.fromRotationTranslation=function(t,i,a){return i=n(i,e.ZERO),r(a)?(a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=0,a[4]=t[3],a[5]=t[4],a[6]=t[5],a[7]=0,a[8]=t[6],a[9]=t[7],a[10]=t[8],a[11]=0,a[12]=i.x,a[13]=i.y,a[14]=i.z,a[15]=1,a):new E(t[0],t[3],t[6],i.x,t[1],t[4],t[7],i.y,t[2],t[5],t[8],i.z,0,0,0,1)},E.fromTranslationQuaternionRotationScale=function(e,t,n,i){r(i)||(i=new E);var a=n.x,o=n.y,u=n.z,s=t.x*t.x,c=t.x*t.y,l=t.x*t.z,_=t.x*t.w,f=t.y*t.y,T=t.y*t.z,R=t.y*t.w,h=t.z*t.z,d=t.z*t.w,A=t.w*t.w,N=s-f-h+A,y=2*(c-d),S=2*(l+R),I=2*(c+d),m=-s+f-h+A,p=2*(T-_),M=2*(l-R),O=2*(T+_),x=-s-f+h+A;return i[0]=N*a,i[1]=I*a,i[2]=M*a,i[3]=0,i[4]=y*o,i[5]=m*o,i[6]=O*o,i[7]=0,i[8]=S*u,i[9]=p*u,i[10]=x*u,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i},E.fromTranslationRotationScale=function(e,t){return E.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},E.fromTranslation=function(e,t){return E.fromRotationTranslation(s.IDENTITY,e,t)},E.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 E(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},E.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 E(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var l=new e,_=new e,f=new e;E.fromCamera=function(t,n){var i=t.position,a=t.direction,o=t.up;e.normalize(a,l),e.normalize(e.cross(l,o,_),_),e.normalize(e.cross(_,l,f),f);var u=_.x,s=_.y,c=_.z,T=l.x,R=l.y,h=l.z,d=f.x,A=f.y,N=f.z,y=i.x,S=i.y,I=i.z,m=u*-y+s*-S+c*-I,p=d*-y+A*-S+N*-I,M=T*y+R*S+h*I;return r(n)?(n[0]=u,n[1]=d,n[2]=-T,n[3]=0,n[4]=s,n[5]=A,n[6]=-R,n[7]=0,n[8]=c,n[9]=N,n[10]=-h,n[11]=0,n[12]=m,n[13]=p,n[14]=M,n[15]=1,n):new E(u,s,c,m,d,A,N,p,-T,-R,-h,M,0,0,0,1)},E.computePerspectiveFieldOfView=function(e,t,n,r,i){var a=Math.tan(.5*e),o=1/a,u=o/t,s=(r+n)/(n-r),c=2*r*n/(n-r);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=o,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=s,i[11]=-1,i[12]=0,i[13]=0,i[14]=c,i[15]=0,i},E.computeOrthographicOffCenter=function(e,t,n,r,i,a,o){var u=1/(t-e),s=1/(r-n),c=1/(a-i),E=-(t+e)*u,l=-(r+n)*s,_=-(a+i)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=E,o[13]=l,o[14]=_,o[15]=1,o},E.computePerspectiveOffCenter=function(e,t,n,r,i,a,o){var u=2*i/(t-e),s=2*i/(r-n),c=(t+e)/(t-e),E=(r+n)/(r-n),l=-(a+i)/(a-i),_=-1,f=-2*a*i/(a-i);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=E,o[10]=l,o[11]=_,o[12]=0,o[13]=0,o[14]=f,o[15]=0,o},E.computeInfinitePerspectiveOffCenter=function(e,t,n,r,i,a){var o=2*i/(t-e),u=2*i/(r-n),s=(t+e)/(t-e),c=(r+n)/(r-n),E=-1,l=-1,_=-2*i;return a[0]=o,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]=E,a[11]=l,a[12]=0,a[13]=0,a[14]=_,a[15]=0,a},E.computeViewportTransformation=function(e,t,r,i){e=n(e,n.EMPTY_OBJECT);var a=n(e.x,0),o=n(e.y,0),u=n(e.width,0),s=n(e.height,0);t=n(t,0),r=n(r,1);var c=.5*u,E=.5*s,l=.5*(r-t),_=c,f=E,T=l,R=a+c,h=o+E,d=t+l,A=1;return i[0]=_,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=f,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=T,i[11]=0,i[12]=R,i[13]=h,i[14]=d,i[15]=A,i},E.computeView=function(t,n,r,i,a){return a[0]=i.x,a[1]=r.x,a[2]=-n.x,a[3]=0,a[4]=i.y,a[5]=r.y,a[6]=-n.y,a[7]=0,a[8]=i.z,a[9]=r.z,a[10]=-n.z,a[11]=0,a[12]=-e.dot(i,t),a[13]=-e.dot(r,t),a[14]=e.dot(n,t),a[15]=1,a},E.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]]},E.getElementIndex=function(e,t){return 4*e+t},E.getColumn=function(e,t,n){var r=4*t,i=e[r],a=e[r+1],o=e[r+2],u=e[r+3];return n.x=i,n.y=a,n.z=o,n.w=u,n},E.setColumn=function(e,t,n,r){r=E.clone(e,r);var i=4*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r[i+3]=n.w,r},E.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},E.getRow=function(e,t,n){var r=e[t],i=e[t+4],a=e[t+8],o=e[t+12];return n.x=r,n.y=i,n.z=a,n.w=o,n},E.setRow=function(e,t,n,r){return r=E.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var T=new e;E.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],T)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],T)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],T)),n};var R=new e;E.getMaximumScale=function(t){return E.getScale(t,R),e.maximumComponent(R)},E.multiply=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[3],u=e[4],s=e[5],c=e[6],E=e[7],l=e[8],_=e[9],f=e[10],T=e[11],R=e[12],h=e[13],d=e[14],A=e[15],N=t[0],y=t[1],S=t[2],I=t[3],m=t[4],p=t[5],M=t[6],O=t[7],x=t[8],C=t[9],g=t[10],v=t[11],U=t[12],L=t[13],w=t[14],F=t[15],P=r*N+u*y+l*S+R*I,D=i*N+s*y+_*S+h*I,B=a*N+c*y+f*S+d*I,z=o*N+E*y+T*S+A*I,G=r*m+u*p+l*M+R*O,b=i*m+s*p+_*M+h*O,X=a*m+c*p+f*M+d*O,H=o*m+E*p+T*M+A*O,q=r*x+u*C+l*g+R*v,V=i*x+s*C+_*g+h*v,W=a*x+c*C+f*g+d*v,Y=o*x+E*C+T*g+A*v,Z=r*U+u*L+l*w+R*F,k=i*U+s*L+_*w+h*F,K=a*U+c*L+f*w+d*F,j=o*U+E*L+T*w+A*F;return n[0]=P,n[1]=D,n[2]=B,n[3]=z,n[4]=G,n[5]=b,n[6]=X,n[7]=H,n[8]=q,n[9]=V,n[10]=W,n[11]=Y,n[12]=Z,n[13]=k,n[14]=K,n[15]=j,n},E.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},E.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},E.multiplyTransformation=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[4],u=e[5],s=e[6],c=e[8],E=e[9],l=e[10],_=e[12],f=e[13],T=e[14],R=t[0],h=t[1],d=t[2],A=t[4],N=t[5],y=t[6],S=t[8],I=t[9],m=t[10],p=t[12],M=t[13],O=t[14],x=r*R+o*h+c*d,C=i*R+u*h+E*d,g=a*R+s*h+l*d,v=r*A+o*N+c*y,U=i*A+u*N+E*y,L=a*A+s*N+l*y,w=r*S+o*I+c*m,F=i*S+u*I+E*m,P=a*S+s*I+l*m,D=r*p+o*M+c*O+_,B=i*p+u*M+E*O+f,z=a*p+s*M+l*O+T;return n[0]=x,n[1]=C,n[2]=g,n[3]=0,n[4]=v,n[5]=U,n[6]=L,n[7]=0,n[8]=w,n[9]=F,n[10]=P,n[11]=0,n[12]=D,n[13]=B,n[14]=z,n[15]=1,n},E.multiplyByMatrix3=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[4],u=e[5],s=e[6],c=e[8],E=e[9],l=e[10],_=t[0],f=t[1],T=t[2],R=t[3],h=t[4],d=t[5],A=t[6],N=t[7],y=t[8],S=r*_+o*f+c*T,I=i*_+u*f+E*T,m=a*_+s*f+l*T,p=r*R+o*h+c*d,M=i*R+u*h+E*d,O=a*R+s*h+l*d,x=r*A+o*N+c*y,C=i*A+u*N+E*y,g=a*A+s*N+l*y;return n[0]=S,n[1]=I,n[2]=m,n[3]=0,n[4]=p,n[5]=M,n[6]=O,n[7]=0,n[8]=x,n[9]=C,n[10]=g,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},E.multiplyByTranslation=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=r*e[0]+i*e[4]+a*e[8]+e[12],u=r*e[1]+i*e[5]+a*e[9]+e[13],s=r*e[2]+i*e[6]+a*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=s,n[15]=e[15],n};var h=new e;E.multiplyByUniformScale=function(e,t,n){return h.x=t,h.y=t,h.z=t,E.multiplyByScale(e,h,n)},E.multiplyByScale=function(e,t,n){var r=t.x,i=t.y,a=t.z;return 1===r&&1===i&&1===a?E.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=i*e[4],n[5]=i*e[5],n[6]=i*e[6],n[7]=0,n[8]=a*e[8],n[9]=a*e[9],n[10]=a*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},E.multiplyByVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=t.w,u=e[0]*r+e[4]*i+e[8]*a+e[12]*o,s=e[1]*r+e[5]*i+e[9]*a+e[13]*o,c=e[2]*r+e[6]*i+e[10]*a+e[14]*o,E=e[3]*r+e[7]*i+e[11]*a+e[15]*o;return n.x=u,n.y=s,n.z=c,n.w=E,n},E.multiplyByPointAsVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[4]*i+e[8]*a,u=e[1]*r+e[5]*i+e[9]*a,s=e[2]*r+e[6]*i+e[10]*a;return n.x=o,n.y=u,n.z=s,n},E.multiplyByPoint=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[4]*i+e[8]*a+e[12],u=e[1]*r+e[5]*i+e[9]*a+e[13],s=e[2]*r+e[6]*i+e[10]*a+e[14];return n.x=o,n.y=u,n.z=s,n},E.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},E.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},E.transpose=function(e,t){var n=e[1],r=e[2],i=e[3],a=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=a,t[10]=e[10],t[11]=e[14],t[12]=i,t[13]=o,t[14]=u,t[15]=e[15],t},E.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},E.equals=function(e,t){return e===t||r(e)&&r(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},E.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},E.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},E.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};var d=new s,A=new s,N=new t,y=new t(0,0,0,1);return E.inverse=function(e,n){if(s.equalsEpsilon(E.getRotation(e,d),A,u.EPSILON7)&&t.equals(E.getRow(e,3,N),y))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],i=e[4],a=e[8],o=e[12],l=e[1],_=e[5],f=e[9],T=e[13],R=e[2],h=e[6],S=e[10],I=e[14],m=e[3],p=e[7],M=e[11],O=e[15],x=S*O,C=I*M,g=h*O,v=I*p,U=h*M,L=S*p,w=R*O,F=I*m,P=R*M,D=S*m,B=R*p,z=h*m,G=x*_+v*f+U*T-(C*_+g*f+L*T),b=C*l+w*f+D*T-(x*l+F*f+P*T),X=g*l+F*_+B*T-(v*l+w*_+z*T),H=L*l+P*_+z*f-(U*l+D*_+B*f),q=C*i+g*a+L*o-(x*i+v*a+U*o),V=x*r+F*a+P*o-(C*r+w*a+D*o),W=v*r+w*i+z*o-(g*r+F*i+B*o),Y=U*r+D*i+B*a-(L*r+P*i+z*a);x=a*T,C=o*f,g=i*T,v=o*_,U=i*f,L=a*_,w=r*T,F=o*l,P=r*f,D=a*l,B=r*_,z=i*l;var Z=x*p+v*M+U*O-(C*p+g*M+L*O),k=C*m+w*M+D*O-(x*m+F*M+P*O),K=g*m+F*p+B*O-(v*m+w*p+z*O),j=L*m+P*p+z*M-(U*m+D*p+B*M),Q=g*S+L*I+C*h-(U*I+x*h+v*S),J=P*I+x*R+F*S-(w*S+D*I+C*R),$=w*h+z*I+v*R-(B*I+g*R+F*h),ee=B*S+U*R+D*h-(P*h+z*S+L*R),te=r*G+i*b+a*X+o*H;if(Math.abs(te)<u.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=G*te,n[1]=b*te,n[2]=X*te,n[3]=H*te,n[4]=q*te,n[5]=V*te,n[6]=W*te,n[7]=Y*te,n[8]=Z*te,n[9]=k*te,n[10]=K*te,n[11]=j*te,n[12]=Q*te,n[13]=J*te,n[14]=$*te,n[15]=ee*te,n},E.inverseTransformation=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[4],o=e[5],u=e[6],s=e[8],c=e[9],E=e[10],l=e[12],_=e[13],f=e[14],T=-n*l-r*_-i*f,R=-a*l-o*_-u*f,h=-s*l-c*_-E*f;return t[0]=n,t[1]=a,t[2]=s,t[3]=0,t[4]=r,t[5]=o,t[6]=c,t[7]=0,t[8]=i,t[9]=u,t[10]=E,t[11]=0,t[12]=T,t[13]=R,t[14]=h,t[15]=1,t},E.IDENTITY=o(new E(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),E.ZERO=o(new E(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),E.COLUMN0ROW0=0,E.COLUMN0ROW1=1,E.COLUMN0ROW2=2,E.COLUMN0ROW3=3,E.COLUMN1ROW0=4,E.COLUMN1ROW1=5,E.COLUMN1ROW2=6,E.COLUMN1ROW3=7,E.COLUMN2ROW0=8,E.COLUMN2ROW1=9,E.COLUMN2ROW2=10,E.COLUMN2ROW3=11,E.COLUMN3ROW0=12,E.COLUMN3ROW1=13,E.COLUMN3ROW2=14,E.COLUMN3ROW3=15,i(E.prototype,{length:{get:function(){return E.packedLength}}}),E.prototype.clone=function(e){return E.clone(this,e)},E.prototype.equals=function(e){return E.equals(this,e)},E.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},E.prototype.equalsEpsilon=function(e,t){return E.equalsEpsilon(this,e,t)},E.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]+")"},E}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,i,a,o,u,s,c,E,l){"use strict";function _(t,r){this.center=e.clone(n(t,e.ZERO)),this.radius=n(r,0)}var f=new e,T=new e,R=new e,h=new e,d=new e,A=new e,N=new e,y=new e,S=new e,I=new e,m=new e,p=new e;_.fromPoints=function(t,n){if(r(n)||(n=new _),!r(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var i=e.clone(t[0],N),a=e.clone(i,f),o=e.clone(i,T),u=e.clone(i,R),s=e.clone(i,h),c=e.clone(i,d),E=e.clone(i,A),l=t.length,M=1;M<l;M++){e.clone(t[M],i);var O=i.x,x=i.y,C=i.z;O<a.x&&e.clone(i,a),O>s.x&&e.clone(i,s),x<o.y&&e.clone(i,o),x>c.y&&e.clone(i,c),C<u.z&&e.clone(i,u),C>E.z&&e.clone(i,E)}var g=e.magnitudeSquared(e.subtract(s,a,y)),v=e.magnitudeSquared(e.subtract(c,o,y)),U=e.magnitudeSquared(e.subtract(E,u,y)),L=a,w=s,F=g;v>F&&(F=v,L=o,w=c),U>F&&(F=U,L=u,w=E);var P=S;P.x=.5*(L.x+w.x),P.y=.5*(L.y+w.y),P.z=.5*(L.z+w.z);var D=e.magnitudeSquared(e.subtract(w,P,y)),B=Math.sqrt(D),z=I;z.x=a.x,z.y=o.y,z.z=u.z;var G=m;G.x=s.x,G.y=c.y,G.z=E.z;var b=e.multiplyByScalar(e.add(z,G,y),.5,p),X=0;for(M=0;M<l;M++){e.clone(t[M],i);var H=e.magnitude(e.subtract(i,b,y));H>X&&(X=H);var q=e.magnitudeSquared(e.subtract(i,P,y));if(q>D){var V=Math.sqrt(q);B=.5*(B+V),D=B*B;var W=V-B;P.x=(B*P.x+W*i.x)/V,P.y=(B*P.y+W*i.y)/V,P.z=(B*P.z+W*i.z)/V}}return B<X?(e.clone(P,n.center),n.radius=B):(e.clone(b,n.center),n.radius=X),n};var M=new o,O=new e,x=new e,C=new t,g=new t;_.fromRectangle2D=function(e,t,n){return _.fromRectangleWithHeights2D(e,t,0,0,n)},_.fromRectangleWithHeights2D=function(t,i,a,o,u){if(r(u)||(u=new _),!r(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;i=n(i,M),l.southwest(t,C),C.height=a,l.northeast(t,g),g.height=o;var s=i.project(C,O),c=i.project(g,x),E=c.x-s.x,f=c.y-s.y,T=c.z-s.z;u.radius=.5*Math.sqrt(E*E+f*f+T*T);var R=u.center;return R.x=s.x+.5*E,R.y=s.y+.5*f,R.z=s.z+.5*T,u};var v=[];_.fromRectangle3D=function(e,t,i,o){t=n(t,a.WGS84),i=n(i,0);var u;return r(e)&&(u=l.subsample(e,t,i,v)),_.fromPoints(u,o)},_.fromVertices=function(t,i,a,o){if(r(o)||(o=new _),!r(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;i=n(i,e.ZERO),a=n(a,3);var u=N;u.x=t[0]+i.x,u.y=t[1]+i.y,u.z=t[2]+i.z;for(var s=e.clone(u,f),c=e.clone(u,T),E=e.clone(u,R),l=e.clone(u,h),M=e.clone(u,d),O=e.clone(u,A),x=t.length,C=0;C<x;C+=a){var g=t[C]+i.x,v=t[C+1]+i.y,U=t[C+2]+i.z;u.x=g,u.y=v,u.z=U,g<s.x&&e.clone(u,s),g>l.x&&e.clone(u,l),v<c.y&&e.clone(u,c),v>M.y&&e.clone(u,M),U<E.z&&e.clone(u,E),U>O.z&&e.clone(u,O)}var L=e.magnitudeSquared(e.subtract(l,s,y)),w=e.magnitudeSquared(e.subtract(M,c,y)),F=e.magnitudeSquared(e.subtract(O,E,y)),P=s,D=l,B=L;w>B&&(B=w,P=c,D=M),F>B&&(B=F,P=E,D=O);var z=S;z.x=.5*(P.x+D.x),z.y=.5*(P.y+D.y),z.z=.5*(P.z+D.z);var G=e.magnitudeSquared(e.subtract(D,z,y)),b=Math.sqrt(G),X=I;X.x=s.x,X.y=c.y,X.z=E.z;var H=m;H.x=l.x,H.y=M.y,H.z=O.z;var q=e.multiplyByScalar(e.add(X,H,y),.5,p),V=0;for(C=0;C<x;C+=a){u.x=t[C]+i.x,u.y=t[C+1]+i.y,u.z=t[C+2]+i.z;var W=e.magnitude(e.subtract(u,q,y));W>V&&(V=W);var Y=e.magnitudeSquared(e.subtract(u,z,y));if(Y>G){var Z=Math.sqrt(Y);b=.5*(b+Z),G=b*b;var k=Z-b;z.x=(b*z.x+k*u.x)/Z,z.y=(b*z.y+k*u.y)/Z,z.z=(b*z.z+k*u.z)/Z}}return b<V?(e.clone(z,o.center),o.radius=b):(e.clone(q,o.center),o.radius=V),o},_.fromEncodedCartesianVertices=function(t,n,i){if(r(i)||(i=new _),!r(t)||!r(n)||t.length!==n.length||0===t.length)return i.center=e.clone(e.ZERO,i.center),i.radius=0,i;var a=N;a.x=t[0]+n[0],a.y=t[1]+n[1],a.z=t[2]+n[2];for(var o=e.clone(a,f),u=e.clone(a,T),s=e.clone(a,R),c=e.clone(a,h),E=e.clone(a,d),l=e.clone(a,A),M=t.length,O=0;O<M;O+=3){var x=t[O]+n[O],C=t[O+1]+n[O+1],g=t[O+2]+n[O+2];a.x=x,a.y=C,a.z=g,x<o.x&&e.clone(a,o),x>c.x&&e.clone(a,c),C<u.y&&e.clone(a,u),C>E.y&&e.clone(a,E),g<s.z&&e.clone(a,s),g>l.z&&e.clone(a,l)}var v=e.magnitudeSquared(e.subtract(c,o,y)),U=e.magnitudeSquared(e.subtract(E,u,y)),L=e.magnitudeSquared(e.subtract(l,s,y)),w=o,F=c,P=v;U>P&&(P=U,w=u,F=E),L>P&&(P=L,w=s,F=l);var D=S;D.x=.5*(w.x+F.x),D.y=.5*(w.y+F.y),D.z=.5*(w.z+F.z);var B=e.magnitudeSquared(e.subtract(F,D,y)),z=Math.sqrt(B),G=I;G.x=o.x,G.y=u.y,G.z=s.z;var b=m;b.x=c.x,b.y=E.y,b.z=l.z;var X=e.multiplyByScalar(e.add(G,b,y),.5,p),H=0;for(O=0;O<M;O+=3){a.x=t[O]+n[O],a.y=t[O+1]+n[O+1],a.z=t[O+2]+n[O+2];var q=e.magnitude(e.subtract(a,X,y));q>H&&(H=q);var V=e.magnitudeSquared(e.subtract(a,D,y));if(V>B){var W=Math.sqrt(V);z=.5*(z+W),B=z*z;var Y=W-z;D.x=(z*D.x+Y*a.x)/W,D.y=(z*D.y+Y*a.y)/W,D.z=(z*D.z+Y*a.z)/W}}return z<H?(e.clone(D,i.center),i.radius=z):(e.clone(X,i.center),i.radius=H),i},_.fromCornerPoints=function(t,n,i){r(i)||(i=new _);var a=i.center;return e.add(t,n,a),e.multiplyByScalar(a,.5,a),i.radius=e.distance(a,n),i},_.fromEllipsoid=function(t,n){return r(n)||(n=new _),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var U=new e;_.fromBoundingSpheres=function(t,n){if(r(n)||(n=new _),!r(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var i=t.length;if(1===i)return _.clone(t[0],n);if(2===i)return _.union(t[0],t[1],n);for(var a=[],o=0;o<i;o++)a.push(t[o].center);n=_.fromPoints(a,n);var u=n.center,s=n.radius;for(o=0;o<i;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,U)+c.radius)}return n.radius=s,n};var L=new e,w=new e,F=new e;_.fromOrientedBoundingBox=function(t,n){r(n)||(n=new _);var i=t.halfAxes,a=c.getColumn(i,0,L),o=c.getColumn(i,1,w),u=c.getColumn(i,2,F),s=e.magnitude(a),E=e.magnitude(o),l=e.magnitude(u);return n.center=e.clone(t.center,n.center),n.radius=Math.max(s,E,l),n},_.clone=function(t,n){if(r(t))return r(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new _(t.center,t.radius)},_.packedLength=4,_.pack=function(e,t,r){r=n(r,0);var i=e.center;return t[r++]=i.x,t[r++]=i.y,t[r++]=i.z,t[r]=e.radius,t},_.unpack=function(e,t,i){t=n(t,0),r(i)||(i=new _);var a=i.center;return a.x=e[t++],a.y=e[t++],a.z=e[t++],i.radius=e[t],i};var P=new e,D=new e;_.union=function(t,n,i){r(i)||(i=new _);var a=t.center,o=t.radius,u=n.center,s=n.radius,c=e.subtract(u,a,P),E=e.magnitude(c);if(o>=E+s)return t.clone(i),i;if(s>=E+o)return n.clone(i),i;var l=.5*(o+E+s),f=e.multiplyByScalar(c,(-o+l)/E,D);return e.add(f,a,f),e.clone(f,i.center),i.radius=l,i};var B=new e;_.expand=function(t,n,r){r=_.clone(t,r);var i=e.magnitude(e.subtract(n,r.center,B));return i>r.radius&&(r.radius=i),r},_.intersectPlane=function(t,n){var r=t.center,i=t.radius,a=n.normal,o=e.dot(a,r)+n.distance;return o<-i?u.OUTSIDE:o<i?u.INTERSECTING:u.INSIDE},_.transform=function(e,t,n){return r(n)||(n=new _),n.center=E.multiplyByPoint(t,e.center,n.center),n.radius=E.getMaximumScale(t)*e.radius,n};var z=new e;_.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,z);return e.magnitudeSquared(r)-t.radius*t.radius},_.transformWithoutScale=function(e,t,n){return r(n)||(n=new _),n.center=E.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var G=new e;_.computePlaneDistances=function(t,n,i,a){r(a)||(a=new s);var o=e.subtract(t.center,n,G),u=e.dot(i,o);return a.start=u-t.radius,a.stop=u+t.radius,a};for(var b=new e,X=new e,H=new e,q=new e,V=new e,W=new t,Y=new Array(8),Z=0;Z<8;++Z)Y[Z]=new e;var k=new o;return _.projectTo2D=function(t,r,i){r=n(r,k);var a=r.ellipsoid,o=t.center,u=t.radius,s=a.geodeticSurfaceNormal(o,b),c=e.cross(e.UNIT_Z,s,X);e.normalize(c,c);var E=e.cross(s,c,H);e.normalize(E,E),e.multiplyByScalar(s,u,s),e.multiplyByScalar(E,u,E),e.multiplyByScalar(c,u,c);var l=e.negate(E,V),f=e.negate(c,q),T=Y,R=T[0];e.add(s,E,R),e.add(R,c,R),R=T[1],e.add(s,E,R),e.add(R,f,R),R=T[2],e.add(s,l,R),e.add(R,f,R),R=T[3],e.add(s,l,R),e.add(R,c,R),e.negate(s,s),R=T[4],e.add(s,E,R),e.add(R,c,R),R=T[5],e.add(s,E,R),e.add(R,f,R),R=T[6],e.add(s,l,R),e.add(R,f,R),R=T[7],e.add(s,l,R),e.add(R,c,R);for(var h=T.length,d=0;d<h;++d){var A=T[d];e.add(o,A,A);var N=a.cartesianToCartographic(A,W);r.project(N,A)}i=_.fromPoints(T,i),o=i.center;var y=o.x,S=o.y,I=o.z;return o.x=I,o.y=y,o.z=S,i},_.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},_.equals=function(t,n){return t===n||r(t)&&r(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},_.prototype.intersectPlane=function(e){return _.intersectPlane(this,e)},_.prototype.distanceSquaredTo=function(e){return _.distanceSquaredTo(this,e)},_.prototype.computePlaneDistances=function(e,t,n){return _.computePlaneDistances(this,e,t,n)},_.prototype.isOccluded=function(e){return _.isOccluded(this,e)},_.prototype.equals=function(e){return _.equals(this,e)},_.prototype.clone=function(e){return _.clone(this,e)},_}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},i={};return t(i,{element:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(i.supportsFullscreen())return null!==i.element}}}),i.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var i,a=["webkit","moz","o","ms","khtml"],o=0,u=a.length;o<u;++o){var s=a[o];i=s+"RequestFullscreen","function"==typeof t[i]?(r.requestFullscreen=i,n=!0):(i=s+"RequestFullScreen","function"==typeof t[i]&&(r.requestFullscreen=i,n=!0)),i=s+"ExitFullscreen","function"==typeof document[i]?r.exitFullscreen=i:(i=s+"CancelFullScreen","function"==typeof document[i]&&(r.exitFullscreen=i)),i=s+"FullscreenEnabled",void 0!==document[i]?r.fullscreenEnabled=i:(i=s+"FullScreenEnabled",void 0!==document[i]&&(r.fullscreenEnabled=i)),i=s+"FullscreenElement",void 0!==document[i]?r.fullscreenElement=i:(i=s+"FullScreenElement",void 0!==document[i]&&(r.fullscreenElement=i)),i=s+"fullscreenchange",void 0!==document["on"+i]&&("ms"===s&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=s+"fullscreenerror",void 0!==document["on"+i]&&("ms"===s&&(i="MSFullscreenError"),r.fullscreenerror=i)}return n},i.requestFullscreen=function(e,t){i.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},i.exitFullscreen=function(){i.supportsFullscreen()&&document[r.exitFullscreen]()},i}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function i(){if(!t(S)&&(S=!1,!_())){var e=/ Chrome\/([\.0-9]+)/.exec(y.userAgent);null!==e&&(S=!0,I=r(e[1]))}return S}function a(){return i()&&I}function o(){if(!t(m)&&(m=!1,!i()&&!_()&&/ Safari\/[\.0-9]+/.test(y.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(y.userAgent);null!==e&&(m=!0,p=r(e[1]))}return m}function u(){return o()&&p}function s(){if(!t(M)){M=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(y.userAgent);null!==e&&(M=!0,O=r(e[1]),O.isNightly=!!e[2])}return M}function c(){return s()&&O}function E(){if(!t(x)){x=!1;var e;"Microsoft Internet Explorer"===y.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(y.userAgent),null!==e&&(x=!0,C=r(e[1]))):"Netscape"===y.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(y.userAgent),null!==e&&(x=!0,C=r(e[1])))}return x}function l(){return E()&&C}function _(){if(!t(g)){g=!1;var e=/ Edge\/([\.0-9]+)/.exec(y.userAgent);null!==e&&(g=!0,v=r(e[1]))}return g}function f(){return _()&&v}function T(){if(!t(U)){U=!1;var e=/Firefox\/([\.0-9]+)/.exec(y.userAgent);null!==e&&(U=!0,L=r(e[1]))}return U}function R(){return t(w)||(w=/Windows/i.test(y.appVersion)),w}function h(){return T()&&L}function d(){return t(F)||(F="undefined"!=typeof PointerEvent&&(!t(y.pointerEnabled)||y.pointerEnabled)),F}function A(){if(!t(D)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;"); -var n=e.style.imageRendering;D=t(n)&&""!==n,D&&(P=n)}return D}function N(){return A()?P:void 0}var y;y="undefined"!=typeof navigator?navigator:{};var S,I,m,p,M,O,x,C,g,v,U,L,w,F,P,D,B={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:E,internetExplorerVersion:l,isEdge:_,edgeVersion:f,isFirefox:T,firefoxVersion:h,isWindows:R,hardwareConcurrency:e(y.hardwareConcurrency,3),supportsPointerEvents:d,supportsImageRenderingPixelated:A,imageRenderingValue:N};return B.supportsFullscreen=function(){return n.supportsFullscreen()},B.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},B.supportsWebWorkers=function(){return"undefined"!=typeof Worker},B}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,i,a){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:a.BYTE,UNSIGNED_BYTE:a.UNSIGNED_BYTE,SHORT:a.SHORT,UNSIGNED_SHORT:a.UNSIGNED_SHORT,INT:a.INT,UNSIGNED_INT:a.UNSIGNED_INT,FLOAT:a.FLOAT,DOUBLE:a.DOUBLE};return o.getSizeInBytes=function(e){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.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},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 Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,i){switch(r=e(r,0),i=e(i,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,i);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,i);case o.SHORT:return new Int16Array(n,r,i);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,i);case o.INT:return new Int32Array(n,r,i);case o.UNSIGNED_INT:return new Uint32Array(n,r,i);case o.FLOAT:return new Float32Array(n,r,i);case o.DOUBLE:return new Float64Array(n,r,i)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},i(o)}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===n.POINTS||e===n.LINES||e===n.LINE_LOOP||e===n.LINE_STRIP||e===n.TRIANGLES||e===n.TRIANGLE_STRIP||e===n.TRIANGLE_FAN}};return e(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,i){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,i.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return a.computeNumberOfVertices=function(e){var n=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var i=e.attributes[r],a=i.values.length/i.componentsPerAttribute;n=a}return n},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(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 r}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.binormal=t.binormal,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,n,r,i){"use strict";var a={UNSIGNED_BYTE:i.UNSIGNED_BYTE,UNSIGNED_SHORT:i.UNSIGNED_SHORT,UNSIGNED_INT:i.UNSIGNED_INT};return a.getSizeInBytes=function(e){switch(e){case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},a.validate=function(t){return e(t)&&(t===a.UNSIGNED_BYTE||t===a.UNSIGNED_SHORT||t===a.UNSIGNED_INT)},a.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},a.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)},n(a)}),define("ThirdParty/earcut-2.1.1",[],function(){"use strict";function e(e,n,i){i=i||2;var a=n&&n.length,o=a?n[0]*i:e.length,u=t(e,0,o,i,!0),c=[];if(!u)return c;var E,l,_,f,T,R,h;if(a&&(u=s(e,n,u,i)),e.length>80*i){E=_=e[0],l=f=e[1];for(var d=i;d<o;d+=i)T=e[d],R=e[d+1],T<E&&(E=T),R<l&&(l=R),T>_&&(_=T),R>f&&(f=R);h=Math.max(_-E,f-l)}return r(u,c,i,E,l,h),c}function t(e,t,n,r,i){var a,o;if(i===C(e,t,n,r)>0)for(a=t;a<n;a+=r)o=M(a,e[a],e[a+1],o);else for(a=n-r;a>=t;a-=r)o=M(a,e[a],e[a+1],o);return o&&N(o,o.next)&&(O(o),o=o.next),o}function n(e,t){if(!e)return e;t||(t=e);var n,r=e;do if(n=!1,r.steiner||!N(r,r.next)&&0!==A(r.prev,r,r.next))r=r.next;else{if(O(r),r=t=r.prev,r===r.next)return null;n=!0}while(n||r!==t);return t}function r(e,t,s,c,E,l,f){if(e){!f&&l&&_(e,c,E,l);for(var T,R,h=e;e.prev!==e.next;)if(T=e.prev,R=e.next,l?a(e,c,E,l):i(e))t.push(T.i/s),t.push(e.i/s),t.push(R.i/s),O(e),e=R.next,h=R.next;else if(e=R,e===h){f?1===f?(e=o(e,t,s),r(e,t,s,c,E,l,2)):2===f&&u(e,t,s,c,E,l):r(n(e),t,s,c,E,l,1);break}}}function i(e){var t=e.prev,n=e,r=e.next;if(A(t,n,r)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(h(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&A(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function a(e,t,n,r){var i=e.prev,a=e,o=e.next;if(A(i,a,o)>=0)return!1;for(var u=i.x<a.x?i.x<o.x?i.x:o.x:a.x<o.x?a.x:o.x,s=i.y<a.y?i.y<o.y?i.y:o.y:a.y<o.y?a.y:o.y,c=i.x>a.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,E=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,l=T(u,s,t,n,r),_=T(c,E,t,n,r),f=e.nextZ;f&&f.z<=_;){if(f!==e.prev&&f!==e.next&&h(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&A(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(f=e.prevZ;f&&f.z>=l;){if(f!==e.prev&&f!==e.next&&h(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&A(f.prev,f,f.next)>=0)return!1;f=f.prevZ}return!0}function o(e,t,n){var r=e;do{var i=r.prev,a=r.next.next;!N(i,a)&&y(i,r,r.next,a)&&I(i,a)&&I(a,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(a.i/n),O(r),O(r.next),r=e=a),r=r.next}while(r!==e);return r}function u(e,t,i,a,o,u){var s=e;do{for(var c=s.next.next;c!==s.prev;){if(s.i!==c.i&&d(s,c)){var E=p(s,c);return s=n(s,s.next),E=n(E,E.next),r(s,t,i,a,o,u),void r(E,t,i,a,o,u)}c=c.next}s=s.next}while(s!==e)}function s(e,r,i,a){var o,u,s,l,_,f=[];for(o=0,u=r.length;o<u;o++)s=r[o]*a,l=o<u-1?r[o+1]*a:e.length,_=t(e,s,l,a,!1),_===_.next&&(_.steiner=!0),f.push(R(_));for(f.sort(c),o=0;o<f.length;o++)E(f[o],i),i=n(i,i.next);return i}function c(e,t){return e.x-t.x}function E(e,t){if(t=l(e,t)){var r=p(t,e);n(r,r.next)}}function l(e,t){var n,r=t,i=e.x,a=e.y,o=-(1/0);do{if(a<=r.y&&a>=r.next.y){var u=r.x+(a-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(u<=i&&u>o){if(o=u,u===i){if(a===r.y)return r;if(a===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(i===o)return n.prev;var s,c=n,E=n.x,l=n.y,_=1/0;for(r=n.next;r!==c;)i>=r.x&&r.x>=E&&h(a<l?i:o,a,E,l,a<l?o:i,a,r.x,r.y)&&(s=Math.abs(a-r.y)/(i-r.x),(s<_||s===_&&r.x>n.x)&&I(r,e)&&(n=r,_=s)),r=r.next;return n}function _(e,t,n,r){var i=e;do null===i.z&&(i.z=T(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,f(i)}function f(e){var t,n,r,i,a,o,u,s,c=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,r=n,u=0,t=0;t<c&&(u++,r=r.nextZ,r);t++);for(s=c;u>0||s>0&&r;)0===u?(i=r,r=r.nextZ,s--):0!==s&&r?n.z<=r.z?(i=n,n=n.nextZ,u--):(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,u--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;n=r}a.nextZ=null,c*=2}while(o>1);return e}function T(e,t,n,r,i){return e=32767*(e-n)/i,t=32767*(t-r)/i,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function R(e){var t=e,n=e;do t.x<n.x&&(n=t),t=t.next;while(t!==e);return n}function h(e,t,n,r,i,a,o,u){return(i-o)*(t-u)-(e-o)*(a-u)>=0&&(e-o)*(r-u)-(n-o)*(t-u)>=0&&(n-o)*(a-u)-(i-o)*(r-u)>=0}function d(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!S(e,t)&&I(e,t)&&I(t,e)&&m(e,t)}function A(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function N(e,t){return e.x===t.x&&e.y===t.y}function y(e,t,n,r){return!!(N(e,t)&&N(n,r)||N(e,r)&&N(n,t))||A(e,t,n)>0!=A(e,t,r)>0&&A(n,r,e)>0!=A(n,r,t)>0}function S(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&y(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function I(e,t){return A(e.prev,e,e.next)<0?A(e,t,e.next)>=0&&A(e,e.prev,t)>=0:A(e,t,e.prev)<0||A(e,e.next,t)<0}function m(e,t){var n=e,r=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do n.y>a!=n.next.y>a&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function p(e,t){var n=new x(e.i,e.x,e.y),r=new x(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function M(e,t,n,r){var i=new x(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function O(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function x(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function C(e,t,n,r){for(var i=0,a=t,o=n-r;a<n;a+=r)i+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return i}return e.deviation=function(e,t,n,r){var i=t&&t.length,a=i?t[0]*n:e.length,o=Math.abs(C(e,0,a,n));if(i)for(var u=0,s=t.length;u<s;u++){var c=t[u]*n,E=u<s-1?t[u+1]*n:e.length;o-=Math.abs(C(e,c,E,n))}var l=0;for(u=0;u<r.length;u+=3){var _=r[u]*n,f=r[u+1]*n,T=r[u+2]*n;l+=Math.abs((e[_]-e[T])*(e[f+1]-e[_+1])-(e[_]-e[f])*(e[T+1]-e[_+1]))}return 0===o&&0===l?0:Math.abs((l-o)/o)},e.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,i=0;i<e.length;i++){for(var a=0;a<e[i].length;a++)for(var o=0;o<t;o++)n.vertices.push(e[i][a][o]);i>0&&(r+=e[i-1].length,n.holes.push(r))}return n},e}),define("Core/Cartesian2",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i){"use strict";function a(t,n){this.x=e(t,0),this.y=e(n,0)}a.fromElements=function(e,n,r){return t(r)?(r.x=e,r.y=n,r):new a(e,n)},a.clone=function(e,n){if(t(e))return t(n)?(n.x=e.x,n.y=e.y,n):new a(e.x,e.y)},a.fromCartesian3=a.clone,a.fromCartesian4=a.clone,a.packedLength=2,a.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r]=t.y,n},a.unpack=function(n,r,i){return r=e(r,0),t(i)||(i=new a),i.x=n[r++],i.y=n[r],i},a.packArray=function(e,n){var r=e.length;t(n)?n.length=2*r:n=new Array(2*r);for(var i=0;i<r;++i)a.pack(e[i],n,2*i);return n},a.unpackArray=function(e,n){var r=e.length;t(n)?n.length=r/2:n=new Array(r/2);for(var i=0;i<r;i+=2){var o=i/2;n[o]=a.unpack(e,i,n[o])}return n},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,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},a.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},a.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},a.magnitude=function(e){return Math.sqrt(a.magnitudeSquared(e))};var o=new a;a.distance=function(e,t){return a.subtract(e,t,o),a.magnitude(o)},a.distanceSquared=function(e,t){return a.subtract(e,t,o),a.magnitudeSquared(o)},a.normalize=function(e,t){var n=a.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t},a.dot=function(e,t){return e.x*t.x+e.y*t.y},a.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n},a.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n},a.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n},a.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n},a.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n},a.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n},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,n,r){return a.multiplyByScalar(t,n,u),r=a.multiplyByScalar(e,1-n,r),a.add(u,r,r)};var s=new a,c=new a;a.angleBetween=function(e,t){return a.normalize(e,s),a.normalize(t,c),i.acosClamped(a.dot(s,c))};var E=new a;return a.mostOrthogonalAxis=function(e,t){var n=a.normalize(e,E);return a.abs(n,n),t=n.x<=n.y?a.clone(a.UNIT_X,t):a.clone(a.UNIT_Y,t)},a.equals=function(e,n){return e===n||t(e)&&t(n)&&e.x===n.x&&e.y===n.y},a.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},a.equalsEpsilon=function(e,n,r,a){return e===n||t(e)&&t(n)&&i.equalsEpsilon(e.x,n.x,r,a)&&i.equalsEpsilon(e.y,n.y,r,a)},a.ZERO=r(new a(0,0)),a.UNIT_X=r(new a(1,0)),a.UNIT_Y=r(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,n){return a.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return"("+this.x+", "+this.y+")"},a}),define("Core/WindingOrder",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={CLOCKWISE:t.CW,COUNTER_CLOCKWISE:t.CCW,validate:function(e){return e===n.CLOCKWISE||e===n.COUNTER_CLOCKWISE}};return e(n)}),define("Core/PolygonPipeline",["../ThirdParty/earcut-2.1.1","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./Math","./PrimitiveType","./WindingOrder"],function(e,t,n,r,i,a,o,u,s,c,E,l,_){"use strict";var f=new n,T=new n,R={};R.computeArea2D=function(e){for(var t=e.length,n=0,r=t-1,i=0;i<t;r=i++){var a=e[r],o=e[i];n+=a.x*o.y-o.x*a.y}return.5*n},R.computeWindingOrder2D=function(e){var t=R.computeArea2D(e);return t>0?_.COUNTER_CLOCKWISE:_.CLOCKWISE},R.triangulate=function(n,r){var i=t.packArray(n);return e(i,r,2)};var h=new n,d=new n,A=new n,N=new n,y=new n,S=new n,I=new n;return R.computeSubdivision=function(e,t,o,u){u=i(u,E.RADIANS_PER_DEGREE);var _,f=o.slice(0),T=t.length,R=new Array(3*T),m=0;for(_=0;_<T;_++){var p=t[_];R[m++]=p.x,R[m++]=p.y,R[m++]=p.z}for(var M=[],O={},x=e.maximumRadius,C=E.chordLength(u,x),g=C*C;f.length>0;){var v,U,L=f.pop(),w=f.pop(),F=f.pop(),P=n.fromArray(R,3*F,h),D=n.fromArray(R,3*w,d),B=n.fromArray(R,3*L,A),z=n.multiplyByScalar(n.normalize(P,N),x,N),G=n.multiplyByScalar(n.normalize(D,y),x,y),b=n.multiplyByScalar(n.normalize(B,S),x,S),X=n.magnitudeSquared(n.subtract(z,G,I)),H=n.magnitudeSquared(n.subtract(G,b,I)),q=n.magnitudeSquared(n.subtract(b,z,I)),V=Math.max(X,H,q);V>g?X===V?(v=Math.min(F,w)+" "+Math.max(F,w),_=O[v],a(_)||(U=n.add(P,D,I),n.multiplyByScalar(U,.5,U),R.push(U.x,U.y,U.z),_=R.length/3-1,O[v]=_),f.push(F,_,L),f.push(_,w,L)):H===V?(v=Math.min(w,L)+" "+Math.max(w,L),_=O[v],a(_)||(U=n.add(D,B,I),n.multiplyByScalar(U,.5,U),R.push(U.x,U.y,U.z),_=R.length/3-1,O[v]=_),f.push(w,_,F),f.push(_,L,F)):q===V&&(v=Math.min(L,F)+" "+Math.max(L,F),_=O[v],a(_)||(U=n.add(B,P,I),n.multiplyByScalar(U,.5,U),R.push(U.x,U.y,U.z),_=R.length/3-1,O[v]=_),f.push(L,_,w),f.push(_,F,w)):(M.push(F),M.push(w),M.push(L))}return new s({attributes:{position:new c({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:R})},indices:M,primitiveType:l.TRIANGLES})},R.scaleToGeodeticHeight=function(e,t,r,o){r=i(r,u.WGS84);var s=f,c=T;if(t=i(t,0),o=i(o,!0),a(e))for(var E=e.length,l=0;l<E;l+=3)n.fromArray(e,l,c),o&&(c=r.scaleToGeodeticSurface(c,c)),0!==t&&(s=r.geodeticSurfaceNormal(c,s),n.multiplyByScalar(s,t,s),n.add(c,s,c)),e[l]=c.x,e[l+1]=c.y,e[l+2]=c.z;return e},R}),define("Core/Matrix2",["./Cartesian2","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject"],function(e,t,n,r,i,a){"use strict";function o(e,n,r,i){this[0]=t(e,0),this[1]=t(r,0),this[2]=t(n,0),this[3]=t(i,0)}o.packedLength=4,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e[0],n[r++]=e[1],n[r++]=e[2],n[r++]=e[3],n},o.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new o),i[0]=e[r++],i[1]=e[r++],i[2]=e[r++],i[3]=e[r++],i},o.clone=function(e,t){if(n(e))return n(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new o(e[0],e[2],e[1],e[3])},o.fromArray=function(e,r,i){return r=t(r,0),n(i)||(i=new o),i[0]=e[r],i[1]=e[r+1],i[2]=e[r+2],i[3]=e[r+3],i},o.fromColumnMajorArray=function(e,t){return o.clone(e,t)},o.fromRowMajorArray=function(e,t){return n(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new o(e[0],e[1],e[2],e[3])},o.fromScale=function(e,t){return n(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new o(e.x,0,0,e.y)},o.fromUniformScale=function(e,t){return n(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new o(e,0,0,e)},o.fromRotation=function(e,t){var r=Math.cos(e),i=Math.sin(e);return n(t)?(t[0]=r,t[1]=i,t[2]=-i,t[3]=r,t):new o(r,-i,i,r)},o.toArray=function(e,t){return n(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):[e[0],e[1],e[2],e[3]]},o.getElementIndex=function(e,t){return 2*e+t},o.getColumn=function(e,t,n){var r=2*t,i=e[r],a=e[r+1];return n.x=i,n.y=a,n},o.setColumn=function(e,t,n,r){r=o.clone(e,r);var i=2*t;return r[i]=n.x,r[i+1]=n.y,r},o.getRow=function(e,t,n){var r=e[t],i=e[t+2];return n.x=r,n.y=i,n},o.setRow=function(e,t,n,r){return r=o.clone(e,r),r[t]=n.x,r[t+2]=n.y,r};var u=new e;o.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],u)),n.y=e.magnitude(e.fromElements(t[2],t[3],u)),n};var s=new e;return o.getMaximumScale=function(t){return o.getScale(t,s),e.maximumComponent(s)},o.multiply=function(e,t,n){var r=e[0]*t[0]+e[2]*t[1],i=e[0]*t[2]+e[2]*t[3],a=e[1]*t[0]+e[3]*t[1],o=e[1]*t[2]+e[3]*t[3]; -return n[0]=r,n[1]=a,n[2]=i,n[3]=o,n},o.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n},o.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n},o.multiplyByVector=function(e,t,n){var r=e[0]*t.x+e[2]*t.y,i=e[1]*t.x+e[3]*t.y;return n.x=r,n.y=i,n},o.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n},o.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.y,n[3]=e[3]*t.y,n},o.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},o.transpose=function(e,t){var n=e[0],r=e[2],i=e[1],a=e[3];return t[0]=n,t[1]=r,t[2]=i,t[3]=a,t},o.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},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},o.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]},o.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r},o.IDENTITY=a(new o(1,0,0,1)),o.ZERO=a(new o(0,0,0,0)),o.COLUMN0ROW0=0,o.COLUMN0ROW1=1,o.COLUMN1ROW0=2,o.COLUMN1ROW1=3,r(o.prototype,{length:{get:function(){return o.packedLength}}}),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[0]+", "+this[2]+")\n("+this[1]+", "+this[3]+")"},o}),define("Core/RectangleGeometryLibrary",["./Cartesian3","./Cartographic","./defined","./DeveloperError","./GeographicProjection","./Math","./Matrix2","./Rectangle"],function(e,t,n,r,i,a,o,u){"use strict";function s(t,n,r,i,a,u,s){var c=Math.cos(n),E=i*c,l=r*c,_=Math.sin(n),R=i*_,A=r*_;T=d.project(t,T),T=e.subtract(T,h,T);var N=o.fromRotation(n,f);T=o.multiplyByVector(N,T,T),T=e.add(T,h,T),t=d.unproject(T,t),u-=1,s-=1;var y=t.latitude,S=y+u*A,I=y-E*s,m=y-E*s+u*A,p=Math.max(y,S,I,m),M=Math.min(y,S,I,m),O=t.longitude,x=O+u*l,C=O+s*R,g=O+s*R+u*l,v=Math.max(O,x,C,g),U=Math.min(O,x,C,g);return{north:p,south:M,east:v,west:U,granYCos:E,granYSin:R,granXCos:l,granXSin:A,nwCorner:t}}var c=Math.cos,E=Math.sin,l=Math.sqrt,_={};_.computePosition=function(e,t,r,i,a){var o=e.ellipsoid.radiiSquared,u=e.nwCorner,s=e.rectangle,_=u.latitude-e.granYCos*t+r*e.granXSin,f=c(_),T=E(_),R=o.z*T,h=u.longitude+t*e.granYSin+r*e.granXCos,d=f*c(h),A=f*E(h),N=o.x*d,y=o.y*A,S=l(N*d+y*A+R*T);if(i.x=N/S,i.y=y/S,i.z=R/S,n(e.vertexFormat)&&e.vertexFormat.st){var I=e.stNwCorner;n(I)?(_=I.latitude-e.stGranYCos*t+r*e.stGranXSin,h=I.longitude+t*e.stGranYSin+r*e.stGranXCos,a.x=(h-e.stWest)*e.lonScalar,a.y=(_-e.stSouth)*e.latScalar):(a.x=(h-s.west)*e.lonScalar,a.y=(_-s.south)*e.latScalar)}};var f=new o,T=new e,R=new t,h=new e,d=new i;return _.computeOptions=function(e,t,n,r){var i,o,c,E,l,_=e._granularity,f=e._ellipsoid,T=e._surfaceHeight,A=e._rotation,N=e._stRotation,y=e._extrudedHeight,S=t.east,I=t.west,m=t.north,p=t.south,M=m-p;I>S?(l=a.TWO_PI-I+S,i=Math.ceil(l/_)+1,o=Math.ceil(M/_)+1,c=l/(i-1),E=M/(o-1)):(l=S-I,i=Math.ceil(l/_)+1,o=Math.ceil(M/_)+1,c=l/(i-1),E=M/(o-1)),n=u.northwest(t,n);var O=u.center(t,R);0===A&&0===N||(O.longitude<n.longitude&&(O.longitude+=a.TWO_PI),h=d.project(O,h));var x=E,C=c,g=0,v=0,U={granYCos:x,granYSin:g,granXCos:C,granXSin:v,ellipsoid:f,surfaceHeight:T,extrudedHeight:y,nwCorner:n,rectangle:t,width:i,height:o};if(0!==A){var L=s(n,A,c,E,O,i,o);m=L.north,p=L.south,S=L.east,I=L.west,U.granYCos=L.granYCos,U.granYSin=L.granYSin,U.granXCos=L.granXCos,U.granXSin=L.granXSin,t.north=m,t.south=p,t.east=S,t.west=I}if(0!==N){A-=N,r=u.northwest(t,r);var w=s(r,A,c,E,O,i,o);U.stGranYCos=w.granYCos,U.stGranXCos=w.granXCos,U.stGranYSin=w.granYSin,U.stGranXSin=w.granXSin,U.stNwCorner=r,U.stWest=w.west,U.stSouth=w.south}return U},_}),define("Core/RectangleOutlineGeometry",["./BoundingSphere","./Cartesian3","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolygonPipeline","./PrimitiveType","./Rectangle","./RectangleGeometryLibrary"],function(e,t,n,r,i,a,o,u,s,c,E,l,_,f,T,R,h){"use strict";function d(e){var t,n=e.size,i=e.height,a=e.width,o=new Float64Array(3*n),u=0,_=0,f=I;for(t=0;t<a;t++)h.computePosition(e,_,t,f),o[u++]=f.x,o[u++]=f.y,o[u++]=f.z;for(t=a-1,_=1;_<i;_++)h.computePosition(e,_,t,f),o[u++]=f.x,o[u++]=f.y,o[u++]=f.z;for(_=i-1,t=a-2;t>=0;t--)h.computePosition(e,_,t,f),o[u++]=f.x,o[u++]=f.y,o[u++]=f.z;for(t=0,_=i-2;_>0;_--)h.computePosition(e,_,t,f),o[u++]=f.x,o[u++]=f.y,o[u++]=f.z;for(var R=o.length/3*2,d=l.createTypedArray(o.length/3,R),A=0,N=0;N<o.length/3-1;N++)d[A++]=N,d[A++]=N+1;d[A++]=o.length/3-1,d[A++]=0;var y=new s({attributes:new E,primitiveType:T.LINES});return y.attributes.position=new c({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:o}),y.indices=d,y}function A(e){var t=e.surfaceHeight,n=e.extrudedHeight,r=e.ellipsoid,i=Math.min(n,t),a=Math.max(n,t),o=d(e);if(_.equalsEpsilon(i,a,_.EPSILON10))return o;var u=e.height,s=e.width,c=f.scaleToGeodeticHeight(o.attributes.position.values,a,r,!1),E=c.length,T=new Float64Array(2*E);T.set(c);var R=f.scaleToGeodeticHeight(o.attributes.position.values,i,r);T.set(R,E),o.attributes.position.values=T;var h=T.length/3*2+8,A=l.createTypedArray(T.length/3,h);E=T.length/6;for(var N=0,y=0;y<E-1;y++)A[N++]=y,A[N++]=y+1,A[N++]=y+E,A[N++]=y+E+1;return A[N++]=E-1,A[N++]=0,A[N++]=E+E-1,A[N++]=E,A[N++]=0,A[N++]=E,A[N++]=s-1,A[N++]=E+s-1,A[N++]=s+u-2,A[N++]=s+u-2+E,A[N++]=2*s+u-3,A[N++]=2*s+u-3+E,o.indices=A,o}function N(e){e=i(e,i.EMPTY_OBJECT);var t=e.rectangle,n=i(e.granularity,_.RADIANS_PER_DEGREE),r=i(e.ellipsoid,u.WGS84),a=i(e.height,0),o=i(e.rotation,0),s=e.extrudedHeight;this._rectangle=t,this._granularity=n,this._ellipsoid=r,this._surfaceHeight=a,this._rotation=o,this._extrudedHeight=s,this._workerName="createRectangleOutlineGeometry"}var y=new e,S=new e,I=new t,m=new R;N.packedLength=R.packedLength+u.packedLength+5,N.pack=function(e,t,n){return n=i(n,0),R.pack(e._rectangle,t,n),n+=R.packedLength,u.pack(e._ellipsoid,t,n),n+=u.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=a(e._extrudedHeight)?1:0,t[n]=i(e._extrudedHeight,0),t};var p=new R,M=u.clone(u.UNIT_SPHERE),O={rectangle:p,ellipsoid:M,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0};N.unpack=function(e,t,n){t=i(t,0);var r=R.unpack(e,t,p);t+=R.packedLength;var o=u.unpack(e,t,M);t+=u.packedLength;var s=e[t++],c=e[t++],E=e[t++],l=e[t++],_=e[t];return a(n)?(n._rectangle=R.clone(r,n._rectangle),n._ellipsoid=u.clone(o,n._ellipsoid),n._surfaceHeight=c,n._rotation=E,n._extrudedHeight=l?_:void 0,n):(O.granularity=s,O.height=c,O.rotation=E,O.extrudedHeight=l?_:void 0,new N(O))};var x=new n;return N.createGeometry=function(t){var n=R.clone(t._rectangle,m),r=t._ellipsoid,i=t._surfaceHeight,o=t._extrudedHeight,u=h.computeOptions(t,n,x);u.size=2*u.width+2*u.height-4;var c,E;if(n=t._rectangle,!_.equalsEpsilon(n.north,n.south,_.EPSILON10)&&!_.equalsEpsilon(n.east,n.west,_.EPSILON10)){if(a(o)){c=A(u);var l=e.fromRectangle3D(n,r,i,S),N=e.fromRectangle3D(n,r,o,y);E=e.union(l,N)}else c=d(u),c.attributes.position.values=f.scaleToGeodeticHeight(c.attributes.position.values,i,r,!1),E=e.fromRectangle3D(n,r,i);return new s({attributes:c.attributes,indices:c.indices,primitiveType:T.LINES,boundingSphere:E})}},N}),define("Workers/createRectangleOutlineGeometry",["../Core/defined","../Core/Ellipsoid","../Core/Rectangle","../Core/RectangleOutlineGeometry"],function(e,t,n,r){"use strict";function i(i,a){return e(a)&&(i=r.unpack(i,a)),i._ellipsoid=t.clone(i._ellipsoid),i._rectangle=n.clone(i._rectangle),r.createGeometry(i)}return i})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e){return e+" is required, actual value was undefined"}function r(e,t,n){return"Expected "+n+" to be typeof "+t+", actual typeof was "+e}var i={};return i.typeOf={},i.defined=function(r,i){if(!e(i))throw new t(n(r))},i.typeOf.func=function(e,n){if("function"!=typeof n)throw new t(r(typeof n,"function",e))},i.typeOf.string=function(e,n){if("string"!=typeof n)throw new t(r(typeof n,"string",e))},i.typeOf.number=function(e,n){if("number"!=typeof n)throw new t(r(typeof n,"number",e))},i.typeOf.number.lessThan=function(e,n,r){if(i.typeOf.number(e,n),n>=r)throw new t("Expected "+e+" to be less than "+r+", actual value was "+n)},i.typeOf.number.lessThanOrEquals=function(e,n,r){if(i.typeOf.number(e,n),n>r)throw new t("Expected "+e+" to be less than or equal to "+r+", actual value was "+n)},i.typeOf.number.greaterThan=function(e,n,r){if(i.typeOf.number(e,n),n<=r)throw new t("Expected "+e+" to be greater than "+r+", actual value was "+n)},i.typeOf.number.greaterThanOrEquals=function(e,n,r){if(i.typeOf.number(e,n),n<r)throw new t("Expected "+e+" to be greater than or equal to"+r+", actual value was "+n)},i.typeOf.object=function(e,n){if("object"!=typeof n)throw new t(r(typeof n,"object",e))},i.typeOf.bool=function(e,n){if("boolean"!=typeof n)throw new t(r(typeof n,"boolean",e))},i}),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";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),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 n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(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^=e<<7&2636928640,e^=e<<15&4022730752,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,n,r){"use strict";var i={};i.EPSILON1=.1,i.EPSILON2=.01,i.EPSILON3=.001,i.EPSILON4=1e-4,i.EPSILON5=1e-5,i.EPSILON6=1e-6,i.EPSILON7=1e-7,i.EPSILON8=1e-8,i.EPSILON9=1e-9,i.EPSILON10=1e-10,i.EPSILON11=1e-11,i.EPSILON12=1e-12,i.EPSILON13=1e-13,i.EPSILON14=1e-14,i.EPSILON15=1e-15,i.EPSILON16=1e-16,i.EPSILON17=1e-17,i.EPSILON18=1e-18,i.EPSILON19=1e-19,i.EPSILON20=1e-20,i.GRAVITATIONALPARAMETER=3986004418e5,i.SOLAR_RADIUS=6955e5,i.LUNAR_RADIUS=1737400,i.SIXTY_FOUR_KILOBYTES=65536,i.sign=function(e){return e>0?1:e<0?-1:0},i.signNotZero=function(e){return e<0?-1:1},i.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*i.clamp(e,-1,1)+.5)*n)},i.fromSNorm=function(e,n){return n=t(n,255),i.clamp(e,0,n)/n*2-1},i.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},i.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},i.lerp=function(e,t,n){return(1-n)*e+n*t},i.PI=Math.PI,i.ONE_OVER_PI=1/Math.PI,i.PI_OVER_TWO=.5*Math.PI,i.PI_OVER_THREE=Math.PI/3,i.PI_OVER_FOUR=Math.PI/4,i.PI_OVER_SIX=Math.PI/6,i.THREE_PI_OVER_TWO=3*Math.PI*.5,i.TWO_PI=2*Math.PI,i.ONE_OVER_TWO_PI=1/(2*Math.PI),i.RADIANS_PER_DEGREE=Math.PI/180,i.DEGREES_PER_RADIAN=180/Math.PI,i.RADIANS_PER_ARCSECOND=i.RADIANS_PER_DEGREE/3600,i.toRadians=function(e){return e*i.RADIANS_PER_DEGREE},i.toDegrees=function(e){return e*i.DEGREES_PER_RADIAN},i.convertLongitudeRange=function(e){var t=i.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},i.clampToLatitudeRange=function(e){return i.clamp(e,-1*i.PI_OVER_TWO,i.PI_OVER_TWO)},i.negativePiToPi=function(e){return i.zeroToTwoPi(e+i.PI)-i.PI},i.zeroToTwoPi=function(e){var t=i.mod(e,i.TWO_PI);return Math.abs(t)<i.EPSILON14&&Math.abs(e)>i.EPSILON14?i.TWO_PI:t},i.mod=function(e,t){return(e%t+t)%t},i.equalsEpsilon=function(e,n,r,i){i=t(i,r);var a=Math.abs(e-n);return a<=i||a<=r*Math.max(Math.abs(e),Math.abs(n))};var a=[1];i.factorial=function(e){var t=a.length;if(e>=t)for(var n=a[t-1],r=t;r<=e;r++)a.push(n*r);return a[e]},i.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},i.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},i.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},i.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return i.setRandomNumberSeed=function(t){o=new e(t)},i.nextRandomNumber=function(){return o.random()},i.acosClamped=function(e){return Math.acos(i.clamp(e,-1,1))},i.asinClamped=function(e){return Math.asin(i.clamp(e,-1,1))},i.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},i.logBase=function(e,t){return Math.log(e)/Math.log(t)},i.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},i}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var i=e.clock,a=e.cone,u=t(e.magnitude,1),s=u*Math.sin(a);return r.x=s*Math.cos(i),r.y=s*Math.sin(i),r.z=u*Math.cos(a),r},o.fromElements=function(e,t,r,i){return n(i)?(i.x=e,i.y=t,i.z=r,i):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new o),i.x=e[r++],i.y=e[r++],i.z=e[r],i},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var i=0;i<r;++i)o.pack(e[i],t,3*i);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var i=0;i<r;i+=3){var a=i/3;t[a]=o.unpack(e,i,t[a])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,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};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,E=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,E);var n=o.dot(c,E),r=o.magnitude(o.cross(c,E,c));return Math.atan2(r,n)};var l=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,l);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,i){return e===t||n(e)&&n(t)&&a.equalsEpsilon(e.x,t.x,r,i)&&a.equalsEpsilon(e.y,t.y,r,i)&&a.equalsEpsilon(e.z,t.z,r,i)},o.cross=function(e,t,n){var r=e.x,i=e.y,a=e.z,o=t.x,u=t.y,s=t.z,c=i*s-a*u,E=a*o-r*s,l=r*u-i*o;return n.x=c,n.y=E,n.z=l,n},o.fromDegrees=function(e,t,n,r,i){return e=a.toRadians(e),t=a.toRadians(t),o.fromRadians(e,t,n,r,i)};var _=new o,f=new o,T=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,i,a,u){i=t(i,0);var s=n(a)?a.radiiSquared:T,c=Math.cos(r);_.x=c*Math.cos(e),_.y=c*Math.sin(e),_.z=Math.sin(r),_=o.normalize(_,_),o.multiplyComponents(s,_,f);var E=Math.sqrt(o.dot(_,f));return f=o.divideByScalar(f,E,f),_=o.multiplyByScalar(_,i,_),n(u)||(u=new o),o.add(f,_,u)},o.fromDegreesArray=function(e,t,r){var i=e.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],s=e[a+1],c=a/2;r[c]=o.fromDegrees(u,s,0,t,r[c])}return r},o.fromRadiansArray=function(e,t,r){var i=e.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],s=e[a+1],c=a/2;r[c]=o.fromRadians(u,s,0,t,r[c])}return r},o.fromDegreesArrayHeights=function(e,t,r){var i=e.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],s=e[a+1],c=e[a+2],E=a/3;r[E]=o.fromDegrees(u,s,c,t,r[E])}return r},o.fromRadiansArrayHeights=function(e,t,r){var i=e.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],s=e[a+1],c=e[a+2],E=a/3;r[E]=o.fromRadians(u,s,c,t,r[E])}return r},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,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function i(n,i,u,s,c){var E=n.x,l=n.y,_=n.z,f=i.x,T=i.y,R=i.z,h=E*E*f*f,d=l*l*T*T,A=_*_*R*R,N=h+d+A,y=Math.sqrt(1/N),S=e.multiplyByScalar(n,y,a);if(N<s)return isFinite(y)?e.clone(S,c):void 0;var I=u.x,p=u.y,m=u.z,M=o;M.x=S.x*I*2,M.y=S.y*p*2,M.z=S.z*m*2;var O,x,C,g,v,U,L,w,F,P,D,B=(1-y)*e.magnitude(n)/(.5*e.magnitude(M)),z=0;do{B-=z,C=1/(1+B*I),g=1/(1+B*p),v=1/(1+B*m),U=C*C,L=g*g,w=v*v,F=U*C,P=L*g,D=w*v,O=h*U+d*L+A*w-1,x=h*F*I+d*P*p+A*D*m;var G=-2*x;z=O/G}while(Math.abs(O)>r.EPSILON12);return t(c)?(c.x=E*C,c.y=l*g,c.z=_*v,c):new e(E*C,l*g,_*v)}var a=new e,o=new e;return i}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,i,a,o){"use strict";function u(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)}u.fromRadians=function(e,r,i,a){return i=t(i,0),n(a)?(a.longitude=e,a.latitude=r,a.height=i,a):new u(e,r,i)},u.fromDegrees=function(e,t,n,r){return e=a.toRadians(e),t=a.toRadians(t),u.fromRadians(e,t,n,r)};var s=new e,c=new e,E=new e,l=new e(1/6378137,1/6378137,1/6356752.314245179),_=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),f=a.EPSILON1;return u.fromCartesian=function(t,r,i){var T=n(r)?r.oneOverRadii:l,R=n(r)?r.oneOverRadiiSquared:_,h=n(r)?r._centerToleranceSquared:f,d=o(t,T,R,h,c);if(n(d)){var A=e.multiplyComponents(d,R,s);A=e.normalize(A,A);var N=e.subtract(t,d,E),y=Math.atan2(A.y,A.x),S=Math.asin(A.z),I=a.sign(e.dot(N,t))*e.magnitude(N);return n(i)?(i.longitude=y,i.latitude=S,i.height=I,i):new u(y,S,I)}},u.clone=function(e,t){if(n(e))return n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},u.ZERO=i(new u(0,0,0)),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,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,i,a,o,u,s){"use strict";function c(t,r,i,a){r=n(r,0),i=n(i,0),a=n(a,0),t._radii=new e(r,i,a),t._radiiSquared=new e(r*r,i*i,a*a),t._radiiToTheFourth=new e(r*r*r*r,i*i*i*i,a*a*a*a),t._oneOverRadii=new e(0===r?0:1/r,0===i?0:1/i,0===a?0:1/a),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===i?0:1/(i*i),0===a?0:1/(a*a)),t._minimumRadius=Math.min(r,i,a),t._maximumRadius=Math.max(r,i,a),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function E(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,c(this,e,t,n)}i(E.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}}}),E.clone=function(t,n){if(r(t)){var i=t._radii;return r(n)?(e.clone(i,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new E(i.x,i.y,i.z)}},E.fromCartesian3=function(e,t){return r(t)||(t=new E),r(e)?(c(t,e.x,e.y,e.z),t):t},E.WGS84=o(new E(6378137,6378137,6356752.314245179)),E.UNIT_SPHERE=o(new E(1,1,1)),E.MOON=o(new E(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),E.prototype.clone=function(e){return E.clone(this,e)},E.packedLength=e.packedLength,E.pack=function(t,r,i){return i=n(i,0),e.pack(t._radii,r,i),r},E.unpack=function(t,r,i){r=n(r,0);var a=e.unpack(t,r);return E.fromCartesian3(a,i)},E.prototype.geocentricSurfaceNormal=e.normalize,E.prototype.geodeticSurfaceNormalCartographic=function(t,n){var i=t.longitude,a=t.latitude,o=Math.cos(a),u=o*Math.cos(i),s=o*Math.sin(i),c=Math.sin(a);return r(n)||(n=new e),n.x=u,n.y=s,n.z=c,e.normalize(n,n)},E.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var l=new e,_=new e;E.prototype.cartographicToCartesian=function(t,n){var i=l,a=_;this.geodeticSurfaceNormalCartographic(t,i),e.multiplyComponents(this._radiiSquared,i,a);var o=Math.sqrt(e.dot(i,a));return e.divideByScalar(a,o,a),e.multiplyByScalar(i,t.height,i),r(n)||(n=new e),e.add(a,i,n)},E.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;i<n;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var f=new e,T=new e,R=new e;return E.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,T);if(r(a)){var o=this.geodeticSurfaceNormal(a,f),s=e.subtract(n,a,R),c=Math.atan2(o.y,o.x),E=Math.asin(o.z),l=u.sign(e.dot(s,n))*e.magnitude(s);return r(i)?(i.longitude=c,i.latitude=E,i.height=l,i):new t(c,E,l)}},E.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;i<n;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t},E.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},E.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var i=t.x,a=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*u.z);return e.multiplyByScalar(t,s,n)},E.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},E.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},E.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},E.prototype.toString=function(){return this._radii.toString()},E.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,i,a){i=n(i,0);var o=this._sqauredXOverSquaredZ;if(r(a)||(a=new e),a.x=0,a.y=0,a.z=t.z*(1-o),!(Math.abs(a.z)>=this._radii.z-i))return a},E}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,i,a,o,u,s){"use strict";function c(e,t,r,i){this.west=n(e,0),this.south=n(t,0),this.east=n(r,0),this.north=n(i,0)}i(c.prototype,{width:{get:function(){return c.computeWidth(this)}},height:{get:function(){return c.computeHeight(this)}}}),c.packedLength=4,c.pack=function(e,t,r){return r=n(r,0),t[r++]=e.west,t[r++]=e.south,t[r++]=e.east,t[r]=e.north,t},c.unpack=function(e,t,i){return t=n(t,0),r(i)||(i=new c),i.west=e[t++],i.south=e[t++],i.east=e[t++],i.north=e[t],i},c.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=s.TWO_PI),t-n},c.computeHeight=function(e){return e.north-e.south},c.fromDegrees=function(e,t,i,a,o){return e=s.toRadians(n(e,0)),t=s.toRadians(n(t,0)),i=s.toRadians(n(i,0)),a=s.toRadians(n(a,0)),r(o)?(o.west=e,o.south=t,o.east=i,o.north=a,o):new c(e,t,i,a)},c.fromRadians=function(e,t,i,a,o){return r(o)?(o.west=n(e,0),o.south=n(t,0),o.east=n(i,0),o.north=n(a,0),o):new c(e,t,i,a)},c.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,u=Number.MAX_VALUE,E=-Number.MAX_VALUE,l=0,_=e.length;l<_;l++){var f=e[l];n=Math.min(n,f.longitude),i=Math.max(i,f.longitude),u=Math.min(u,f.latitude),E=Math.max(E,f.latitude);var T=f.longitude>=0?f.longitude:f.longitude+s.TWO_PI;a=Math.min(a,T),o=Math.max(o,T)}return i-n>o-a&&(n=a,i=o,i>s.PI&&(i-=s.TWO_PI),n>s.PI&&(n-=s.TWO_PI)),r(t)?(t.west=n,t.south=u,t.east=i,t.north=E,t):new c(n,u,i,E)},c.fromCartesianArray=function(e,t,n){for(var i=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,u=-Number.MAX_VALUE,E=Number.MAX_VALUE,l=-Number.MAX_VALUE,_=0,f=e.length;_<f;_++){var T=t.cartesianToCartographic(e[_]);i=Math.min(i,T.longitude),a=Math.max(a,T.longitude),E=Math.min(E,T.latitude),l=Math.max(l,T.latitude);var R=T.longitude>=0?T.longitude:T.longitude+s.TWO_PI;o=Math.min(o,R),u=Math.max(u,R)}return a-i>u-o&&(i=o,a=u,a>s.PI&&(a-=s.TWO_PI),i>s.PI&&(i-=s.TWO_PI)),r(n)?(n.west=i,n.south=E,n.east=a,n.north=l,n):new c(i,E,a,l)},c.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new c(e.west,e.south,e.east,e.north)},c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.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},c.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},c.validate=function(e){},c.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)},c.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)},c.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)},c.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)},c.center=function(t,n){var i=t.east,a=t.west;i<a&&(i+=s.TWO_PI);var o=s.negativePiToPi(.5*(a+i)),u=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=u,n.height=0,n):new e(o,u)},c.intersection=function(e,t,n){var i=e.east,a=e.west,o=t.east,u=t.west;i<a&&o>0?i+=s.TWO_PI:o<u&&i>0&&(o+=s.TWO_PI),i<a&&u<0?u+=s.TWO_PI:o<u&&a<0&&(a+=s.TWO_PI);var E=s.negativePiToPi(Math.max(a,u)),l=s.negativePiToPi(Math.min(i,o));if(!((e.west<e.east||t.west<t.east)&&l<=E)){var _=Math.max(e.south,t.south),f=Math.min(e.north,t.north);if(!(_>=f))return r(n)?(n.west=E,n.south=_,n.east=l,n.north=f,n):new c(E,_,l,f)}},c.simpleIntersection=function(e,t,n){var i=Math.max(e.west,t.west),a=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(a>=u||i>=o))return r(n)?(n.west=i,n.south=a,n.east=o,n.north=u,n):new c(i,a,o,u)},c.union=function(e,t,n){r(n)||(n=new c);var i=e.east,a=e.west,o=t.east,u=t.west;i<a&&o>0?i+=s.TWO_PI:o<u&&i>0&&(o+=s.TWO_PI),i<a&&u<0?u+=s.TWO_PI:o<u&&a<0&&(a+=s.TWO_PI);var E=s.convertLongitudeRange(Math.min(a,u)),l=s.convertLongitudeRange(Math.max(i,o));return n.west=E,n.south=Math.min(e.south,t.south),n.east=l,n.north=Math.max(e.north,t.north),n},c.expand=function(e,t,n){return r(n)||(n=new c),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},c.contains=function(e,t){var n=t.longitude,r=t.latitude,i=e.west,a=e.east;return a<i&&(a+=s.TWO_PI,n<0&&(n+=s.TWO_PI)),(n>i||s.equalsEpsilon(n,i,s.EPSILON14))&&(n<a||s.equalsEpsilon(n,a,s.EPSILON14))&&r>=e.south&&r<=e.north};var E=new e;return c.subsample=function(e,t,i,a){t=n(t,o.WGS84),i=n(i,0),r(a)||(a=[]);var u=0,l=e.north,_=e.south,f=e.east,T=e.west,R=E;R.height=i,R.longitude=T,R.latitude=l,a[u]=t.cartographicToCartesian(R,a[u]),u++,R.longitude=f,a[u]=t.cartographicToCartesian(R,a[u]),u++,R.latitude=_,a[u]=t.cartographicToCartesian(R,a[u]),u++,R.longitude=T,a[u]=t.cartographicToCartesian(R,a[u]),u++,l<0?R.latitude=l:_>0?R.latitude=_:R.latitude=0;for(var h=1;h<8;++h)R.longitude=-Math.PI+h*s.PI_OVER_TWO,c.contains(e,R)&&(a[u]=t.cartographicToCartesian(R,a[u]),u++);return 0===R.latitude&&(R.longitude=T,a[u]=t.cartographicToCartesian(R,a[u]),u++,R.longitude=f,a[u]=t.cartographicToCartesian(R,a[u]),u++),a.length=u,a},c.MAX_VALUE=u(new c(-Math.PI,-s.PI_OVER_TWO,Math.PI,s.PI_OVER_TWO)),c}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,i,a,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return i(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var i=this._semimajorAxis,a=t.longitude*i,o=t.latitude*i,u=t.height;return r(n)?(n.x=a,n.y=o,n.z=u,n):new e(a,o,u)},u.prototype.unproject=function(e,n){var i=this._oneOverSemimajorAxis,a=e.x*i,o=e.y*i,u=e.z;return r(n)?(n.longitude=a,n.latitude=o,n.height=u,n):new t(a,o,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";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a,o,u){"use strict";function s(e,t,r,i,a,o,u,s,c){this[0]=n(e,0),this[1]=n(i,0),this[2]=n(u,0),this[3]=n(t,0),this[4]=n(a,0),this[5]=n(s,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(c,0)}function c(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function E(e){for(var t=0,n=0;n<3;++n){var r=e[s.getElementIndex(R[n],T[n])];t+=2*r*r}return Math.sqrt(t)}function l(e,t){for(var n=u.EPSILON15,r=0,i=1,a=0;a<3;++a){var o=Math.abs(e[s.getElementIndex(R[a],T[a])]);o>r&&(i=a,r=o)}var c=1,E=0,l=T[i],_=R[i];if(Math.abs(e[s.getElementIndex(_,l)])>n){var f,h=e[s.getElementIndex(_,_)],d=e[s.getElementIndex(l,l)],A=e[s.getElementIndex(_,l)],N=(h-d)/2/A;f=N<0?-1/(-N+Math.sqrt(1+N*N)):1/(N+Math.sqrt(1+N*N)),c=1/Math.sqrt(1+f*f),E=f*c}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(l,l)]=t[s.getElementIndex(_,_)]=c,t[s.getElementIndex(_,l)]=E,t[s.getElementIndex(l,_)]=-E,t}s.packedLength=9,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t},s.unpack=function(e,t,i){return t=n(t,0),r(i)||(i=new s),i[0]=e[t++],i[1]=e[t++],i[2]=e[t++],i[3]=e[t++],i[4]=e[t++],i[5]=e[t++],i[6]=e[t++],i[7]=e[t++],i[8]=e[t++],i},s.clone=function(e,t){if(r(e))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):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,i){return t=n(t,0),r(i)||(i=new s),i[0]=e[t],i[1]=e[t+1],i[2]=e[t+2],i[3]=e[t+3],i[4]=e[t+4],i[5]=e[t+5],i[6]=e[t+6],i[7]=e[t+7],i[8]=e[t+8],i},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[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 s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var n=e.x*e.x,i=e.x*e.y,a=e.x*e.z,o=e.x*e.w,u=e.y*e.y,c=e.y*e.z,E=e.y*e.w,l=e.z*e.z,_=e.z*e.w,f=e.w*e.w,T=n-u-l+f,R=2*(i-_),h=2*(a+E),d=2*(i+_),A=-n+u-l+f,N=2*(c-o),y=2*(a-E),S=2*(c+o),I=-n-u+l+f;return r(t)?(t[0]=T,t[1]=d,t[2]=y,t[3]=R,t[4]=A,t[5]=S,t[6]=h,t[7]=N,t[8]=I,t):new s(T,R,h,d,A,N,y,S,I)},s.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),i=Math.cos(-e.heading),a=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),c=Math.sin(e.roll),E=n*i,l=-a*u+c*o*i,_=c*u+a*o*i,f=n*u,T=a*i+c*o*u,R=-o*a+a*o*u,h=-o,d=c*n,A=a*n;return r(t)?(t[0]=E,t[1]=f,t[2]=h,t[3]=l,t[4]=T,t[5]=d,t[6]=_,t[7]=R,t[8]=A,t):new s(E,l,_,f,T,R,h,d,A)},s.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 s(e.x,0,0,0,e.y,0,0,0,e.z)},s.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 s(e,0,0,0,e,0,0,0,e)},s.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 s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=i,t[6]=0,t[7]=-i,t[8]=n,t):new s(1,0,0,0,n,-i,0,i,n)},s.fromRotationY=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-i,t[3]=0,t[4]=1,t[5]=0,t[6]=i,t[7]=0,t[8]=n,t):new s(n,0,i,0,1,0,-i,0,n)},s.fromRotationZ=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=n,t[1]=i,t[2]=0,t[3]=-i,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(n,-i,0,i,n,0,0,0,1)},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):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,n){var r=3*t,i=e[r],a=e[r+1],o=e[r+2];return n.x=i,n.y=a,n.z=o,n},s.setColumn=function(e,t,n,r){r=s.clone(e,r);var i=3*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},s.getRow=function(e,t,n){var r=e[t],i=e[t+3],a=e[t+6];return n.x=r,n.y=i,n.z=a,n},s.setRow=function(e,t,n,r){return r=s.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var _=new e;s.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],_)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],_)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],_)),n};var f=new e;s.getMaximumScale=function(t){return s.getScale(t,f),e.maximumComponent(f)},s.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],i=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],o=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],E=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],l=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=r,n[1]=i,n[2]=a,n[3]=o,n[4]=u,n[5]=s,n[6]=c,n[7]=E,n[8]=l,n},s.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},s.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},s.multiplyByVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[3]*i+e[6]*a,u=e[1]*r+e[4]*i+e[7]*a,s=e[2]*r+e[5]*i+e[8]*a;return n.x=o,n.y=u,n.z=s,n},s.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},s.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},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},s.transpose=function(e,t){var n=e[0],r=e[3],i=e[6],a=e[1],o=e[4],u=e[7],s=e[2],c=e[5],E=e[8];return t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=E,t};var T=[1,0,0],R=[2,2,1],h=new s,d=new s;return s.computeEigenDecomposition=function(e,t){var n=u.EPSILON20,i=10,a=0,o=0;r(t)||(t={});for(var _=t.unitary=s.clone(s.IDENTITY,t.unitary),f=t.diagonal=s.clone(e,t.diagonal),T=n*c(f);o<i&&E(f)>T;)l(f,h),s.transpose(h,d),s.multiply(f,h,f),s.multiply(d,f,f),s.multiply(_,h,_),++a>2&&(++o,a=0);return 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},s.determinant=function(e){var t=e[0],n=e[3],r=e[6],i=e[1],a=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(a*c-s*o)+i*(s*r-n*c)+u*(n*o-a*r)},s.inverse=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],u=e[5],c=e[6],E=e[7],l=e[8],_=s.determinant(e);t[0]=o*l-E*u,t[1]=E*i-r*l,t[2]=r*u-o*i,t[3]=c*u-a*l,t[4]=n*l-c*i,t[5]=a*i-n*u,t[6]=a*E-c*o,t[7]=c*r-n*E,t[8]=n*o-a*r;var f=1/_;return s.multiplyByScalar(t,f,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]},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},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,i(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(e,n,r,i){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(i,0)}o.fromElements=function(e,t,r,i,a){return n(a)?(a.x=e,a.y=t,a.z=r,a.w=i,a):new o(e,t,r,i)},o.fromColor=function(e,t){return n(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(n(e))return n(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)},o.packedLength=4,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},o.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new o),i.x=e[r++],i.y=e[r++],i.z=e[r++],i.w=e[r],i},o.packArray=function(e,t){var r=e.length;n(t)?t.length=4*r:t=new Array(4*r);for(var i=0;i<r;++i)o.pack(e[i],t,4*i);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/4:t=new Array(r/4);for(var i=0;i<r;i+=4){var a=i/4;t[a]=o.unpack(e,i,t[a])}return t},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,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},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 u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,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,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},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 s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,c);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},o.equalsEpsilon=function(e,t,r,i){return e===t||n(e)&&n(t)&&a.equalsEpsilon(e.x,t.x,r,i)&&a.equalsEpsilon(e.y,t.y,r,i)&&a.equalsEpsilon(e.z,t.z,r,i)&&a.equalsEpsilon(e.w,t.w,r,i)},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,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,i,a,o,u,s,c,E){"use strict";function l(e,t,n,i,a,o,u,s,c,E,l,_,f,T,R,h){this[0]=r(e,0),this[1]=r(a,0),this[2]=r(c,0),this[3]=r(f,0),this[4]=r(t,0),this[5]=r(o,0),this[6]=r(E,0),this[7]=r(T,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(l,0),this[11]=r(R,0),this[12]=r(i,0),this[13]=r(s,0),this[14]=r(_,0),this[15]=r(h,0)}l.packedLength=16,l.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},l.unpack=function(e,t,n){return t=r(t,0),i(n)||(n=new l),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},l.clone=function(e,t){if(i(e))return i(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 l(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])},l.fromArray=l.unpack,l.fromColumnMajorArray=function(e,t){return l.clone(e,t)},l.fromRowMajorArray=function(e,t){return i(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 l(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])},l.fromRotationTranslation=function(t,n,a){return n=r(n,e.ZERO),i(a)?(a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=0,a[4]=t[3],a[5]=t[4],a[6]=t[5],a[7]=0,a[8]=t[6],a[9]=t[7],a[10]=t[8],a[11]=0,a[12]=n.x,a[13]=n.y,a[14]=n.z,a[15]=1,a):new l(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(e,t,n,r){i(r)||(r=new l);var a=n.x,o=n.y,u=n.z,s=t.x*t.x,c=t.x*t.y,E=t.x*t.z,_=t.x*t.w,f=t.y*t.y,T=t.y*t.z,R=t.y*t.w,h=t.z*t.z,d=t.z*t.w,A=t.w*t.w,N=s-f-h+A,y=2*(c-d),S=2*(E+R),I=2*(c+d),p=-s+f-h+A,m=2*(T-_),M=2*(E-R),O=2*(T+_),x=-s-f+h+A;return r[0]=N*a,r[1]=I*a,r[2]=M*a,r[3]=0,r[4]=y*o,r[5]=p*o,r[6]=O*o,r[7]=0,r[8]=S*u,r[9]=m*u,r[10]=x*u,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},l.fromTranslationRotationScale=function(e,t){return l.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},l.fromTranslation=function(e,t){return l.fromRotationTranslation(c.IDENTITY,e,t)},l.fromScale=function(e,t){return i(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 l(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},l.fromUniformScale=function(e,t){return i(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 l(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var _=new e,f=new e,T=new e;l.fromCamera=function(t,n){var r=t.position,a=t.direction,o=t.up;e.normalize(a,_),e.normalize(e.cross(_,o,f),f),e.normalize(e.cross(f,_,T),T);var u=f.x,s=f.y,c=f.z,E=_.x,R=_.y,h=_.z,d=T.x,A=T.y,N=T.z,y=r.x,S=r.y,I=r.z,p=u*-y+s*-S+c*-I,m=d*-y+A*-S+N*-I,M=E*y+R*S+h*I;return i(n)?(n[0]=u,n[1]=d,n[2]=-E,n[3]=0,n[4]=s,n[5]=A,n[6]=-R,n[7]=0,n[8]=c,n[9]=N,n[10]=-h,n[11]=0,n[12]=p,n[13]=m,n[14]=M,n[15]=1,n):new l(u,s,c,p,d,A,N,m,-E,-R,-h,M,0,0,0,1)},l.computePerspectiveFieldOfView=function(e,t,n,r,i){var a=Math.tan(.5*e),o=1/a,u=o/t,s=(r+n)/(n-r),c=2*r*n/(n-r);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=o,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=s,i[11]=-1,i[12]=0,i[13]=0,i[14]=c,i[15]=0,i},l.computeOrthographicOffCenter=function(e,t,n,r,i,a,o){var u=1/(t-e),s=1/(r-n),c=1/(a-i),E=-(t+e)*u,l=-(r+n)*s,_=-(a+i)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=E,o[13]=l,o[14]=_,o[15]=1,o},l.computePerspectiveOffCenter=function(e,t,n,r,i,a,o){var u=2*i/(t-e),s=2*i/(r-n),c=(t+e)/(t-e),E=(r+n)/(r-n),l=-(a+i)/(a-i),_=-1,f=-2*a*i/(a-i);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=E,o[10]=l,o[11]=_,o[12]=0,o[13]=0,o[14]=f,o[15]=0,o},l.computeInfinitePerspectiveOffCenter=function(e,t,n,r,i,a){var o=2*i/(t-e),u=2*i/(r-n),s=(t+e)/(t-e),c=(r+n)/(r-n),E=-1,l=-1,_=-2*i;return a[0]=o,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]=E,a[11]=l,a[12]=0,a[13]=0,a[14]=_,a[15]=0,a},l.computeViewportTransformation=function(e,t,n,i){e=r(e,r.EMPTY_OBJECT);var a=r(e.x,0),o=r(e.y,0),u=r(e.width,0),s=r(e.height,0);t=r(t,0),n=r(n,1);var c=.5*u,E=.5*s,l=.5*(n-t),_=c,f=E,T=l,R=a+c,h=o+E,d=t+l,A=1;return i[0]=_,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=f,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=T,i[11]=0,i[12]=R,i[13]=h,i[14]=d,i[15]=A,i},l.computeView=function(t,n,r,i,a){return a[0]=i.x,a[1]=r.x,a[2]=-n.x,a[3]=0,a[4]=i.y,a[5]=r.y,a[6]=-n.y,a[7]=0,a[8]=i.z,a[9]=r.z,a[10]=-n.z,a[11]=0,a[12]=-e.dot(i,t),a[13]=-e.dot(r,t),a[14]=e.dot(n,t),a[15]=1,a},l.toArray=function(e,t){return i(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]]},l.getElementIndex=function(e,t){return 4*e+t},l.getColumn=function(e,t,n){var r=4*t,i=e[r],a=e[r+1],o=e[r+2],u=e[r+3];return n.x=i,n.y=a,n.z=o,n.w=u,n},l.setColumn=function(e,t,n,r){r=l.clone(e,r);var i=4*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r[i+3]=n.w,r},l.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},l.getRow=function(e,t,n){var r=e[t],i=e[t+4],a=e[t+8],o=e[t+12];return n.x=r,n.y=i,n.z=a,n.w=o,n},l.setRow=function(e,t,n,r){return r=l.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var R=new e;l.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],R)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],R)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],R)),n};var h=new e;l.getMaximumScale=function(t){return l.getScale(t,h),e.maximumComponent(h)},l.multiply=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[3],u=e[4],s=e[5],c=e[6],E=e[7],l=e[8],_=e[9],f=e[10],T=e[11],R=e[12],h=e[13],d=e[14],A=e[15],N=t[0],y=t[1],S=t[2],I=t[3],p=t[4],m=t[5],M=t[6],O=t[7],x=t[8],C=t[9],g=t[10],v=t[11],U=t[12],L=t[13],w=t[14],F=t[15],P=r*N+u*y+l*S+R*I,D=i*N+s*y+_*S+h*I,B=a*N+c*y+f*S+d*I,z=o*N+E*y+T*S+A*I,G=r*p+u*m+l*M+R*O,b=i*p+s*m+_*M+h*O,X=a*p+c*m+f*M+d*O,q=o*p+E*m+T*M+A*O,H=r*x+u*C+l*g+R*v,V=i*x+s*C+_*g+h*v,W=a*x+c*C+f*g+d*v,Y=o*x+E*C+T*g+A*v,k=r*U+u*L+l*w+R*F,Z=i*U+s*L+_*w+h*F,K=a*U+c*L+f*w+d*F,j=o*U+E*L+T*w+A*F;return n[0]=P,n[1]=D,n[2]=B,n[3]=z,n[4]=G,n[5]=b,n[6]=X,n[7]=q,n[8]=H,n[9]=V,n[10]=W,n[11]=Y,n[12]=k,n[13]=Z,n[14]=K,n[15]=j,n},l.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},l.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},l.multiplyTransformation=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[4],u=e[5],s=e[6],c=e[8],E=e[9],l=e[10],_=e[12],f=e[13],T=e[14],R=t[0],h=t[1],d=t[2],A=t[4],N=t[5],y=t[6],S=t[8],I=t[9],p=t[10],m=t[12],M=t[13],O=t[14],x=r*R+o*h+c*d,C=i*R+u*h+E*d,g=a*R+s*h+l*d,v=r*A+o*N+c*y,U=i*A+u*N+E*y,L=a*A+s*N+l*y,w=r*S+o*I+c*p,F=i*S+u*I+E*p,P=a*S+s*I+l*p,D=r*m+o*M+c*O+_,B=i*m+u*M+E*O+f,z=a*m+s*M+l*O+T;return n[0]=x,n[1]=C,n[2]=g,n[3]=0,n[4]=v,n[5]=U,n[6]=L,n[7]=0,n[8]=w,n[9]=F,n[10]=P,n[11]=0,n[12]=D,n[13]=B,n[14]=z,n[15]=1,n},l.multiplyByMatrix3=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[4],u=e[5],s=e[6],c=e[8],E=e[9],l=e[10],_=t[0],f=t[1],T=t[2],R=t[3],h=t[4],d=t[5],A=t[6],N=t[7],y=t[8],S=r*_+o*f+c*T,I=i*_+u*f+E*T,p=a*_+s*f+l*T,m=r*R+o*h+c*d,M=i*R+u*h+E*d,O=a*R+s*h+l*d,x=r*A+o*N+c*y,C=i*A+u*N+E*y,g=a*A+s*N+l*y;return n[0]=S,n[1]=I,n[2]=p,n[3]=0,n[4]=m,n[5]=M,n[6]=O,n[7]=0,n[8]=x,n[9]=C,n[10]=g,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},l.multiplyByTranslation=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=r*e[0]+i*e[4]+a*e[8]+e[12],u=r*e[1]+i*e[5]+a*e[9]+e[13],s=r*e[2]+i*e[6]+a*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=s,n[15]=e[15],n};var d=new e;l.multiplyByUniformScale=function(e,t,n){return d.x=t,d.y=t,d.z=t,l.multiplyByScale(e,d,n)},l.multiplyByScale=function(e,t,n){var r=t.x,i=t.y,a=t.z;return 1===r&&1===i&&1===a?l.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=i*e[4],n[5]=i*e[5],n[6]=i*e[6],n[7]=0,n[8]=a*e[8],n[9]=a*e[9],n[10]=a*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},l.multiplyByVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=t.w,u=e[0]*r+e[4]*i+e[8]*a+e[12]*o,s=e[1]*r+e[5]*i+e[9]*a+e[13]*o,c=e[2]*r+e[6]*i+e[10]*a+e[14]*o,E=e[3]*r+e[7]*i+e[11]*a+e[15]*o;return n.x=u,n.y=s,n.z=c,n.w=E,n},l.multiplyByPointAsVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[4]*i+e[8]*a,u=e[1]*r+e[5]*i+e[9]*a,s=e[2]*r+e[6]*i+e[10]*a;return n.x=o,n.y=u,n.z=s,n},l.multiplyByPoint=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[4]*i+e[8]*a+e[12],u=e[1]*r+e[5]*i+e[9]*a+e[13],s=e[2]*r+e[6]*i+e[10]*a+e[14];return n.x=o,n.y=u,n.z=s,n},l.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},l.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},l.transpose=function(e,t){var n=e[1],r=e[2],i=e[3],a=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=a,t[10]=e[10],t[11]=e[14],t[12]=i,t[13]=o,t[14]=u,t[15]=e[15],t},l.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},l.equals=function(e,t){return e===t||i(e)&&i(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},l.equalsEpsilon=function(e,t,n){return e===t||i(e)&&i(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},l.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},l.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};var A=new c,N=new c,y=new t,S=new t(0,0,0,1);return l.inverse=function(e,n){if(c.equalsEpsilon(l.getRotation(e,A),N,s.EPSILON7)&&t.equals(l.getRow(e,3,y),S))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],i=e[4],a=e[8],o=e[12],u=e[1],_=e[5],f=e[9],T=e[13],R=e[2],h=e[6],d=e[10],I=e[14],p=e[3],m=e[7],M=e[11],O=e[15],x=d*O,C=I*M,g=h*O,v=I*m,U=h*M,L=d*m,w=R*O,F=I*p,P=R*M,D=d*p,B=R*m,z=h*p,G=x*_+v*f+U*T-(C*_+g*f+L*T),b=C*u+w*f+D*T-(x*u+F*f+P*T),X=g*u+F*_+B*T-(v*u+w*_+z*T),q=L*u+P*_+z*f-(U*u+D*_+B*f),H=C*i+g*a+L*o-(x*i+v*a+U*o),V=x*r+F*a+P*o-(C*r+w*a+D*o),W=v*r+w*i+z*o-(g*r+F*i+B*o),Y=U*r+D*i+B*a-(L*r+P*i+z*a);x=a*T,C=o*f,g=i*T,v=o*_,U=i*f,L=a*_,w=r*T,F=o*u,P=r*f,D=a*u,B=r*_,z=i*u;var k=x*m+v*M+U*O-(C*m+g*M+L*O),Z=C*p+w*M+D*O-(x*p+F*M+P*O),K=g*p+F*m+B*O-(v*p+w*m+z*O),j=L*p+P*m+z*M-(U*p+D*m+B*M),Q=g*d+L*I+C*h-(U*I+x*h+v*d),J=P*I+x*R+F*d-(w*d+D*I+C*R),$=w*h+z*I+v*R-(B*I+g*R+F*h),ee=B*d+U*R+D*h-(P*h+z*d+L*R),te=r*G+i*b+a*X+o*q;if(Math.abs(te)<s.EPSILON20)throw new E("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=G*te,n[1]=b*te,n[2]=X*te,n[3]=q*te,n[4]=H*te,n[5]=V*te,n[6]=W*te,n[7]=Y*te,n[8]=k*te,n[9]=Z*te,n[10]=K*te,n[11]=j*te,n[12]=Q*te,n[13]=J*te,n[14]=$*te,n[15]=ee*te,n},l.inverseTransformation=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[4],o=e[5],u=e[6],s=e[8],c=e[9],E=e[10],l=e[12],_=e[13],f=e[14],T=-n*l-r*_-i*f,R=-a*l-o*_-u*f,h=-s*l-c*_-E*f;return t[0]=n,t[1]=a,t[2]=s,t[3]=0,t[4]=r,t[5]=o,t[6]=c,t[7]=0,t[8]=i,t[9]=u,t[10]=E,t[11]=0,t[12]=T,t[13]=R,t[14]=h,t[15]=1,t},l.IDENTITY=u(new l(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),l.ZERO=u(new l(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN0ROW3=3,l.COLUMN1ROW0=4,l.COLUMN1ROW1=5,l.COLUMN1ROW2=6,l.COLUMN1ROW3=7,l.COLUMN2ROW0=8,l.COLUMN2ROW1=9,l.COLUMN2ROW2=10,l.COLUMN2ROW3=11,l.COLUMN3ROW0=12,l.COLUMN3ROW1=13,l.COLUMN3ROW2=14,l.COLUMN3ROW3=15,a(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.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]+")"},l}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,i,a,o,u,s,c,E,l){"use strict";function _(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var f=new e,T=new e,R=new e,h=new e,d=new e,A=new e,N=new e,y=new e,S=new e,I=new e,p=new e,m=new e;_.fromPoints=function(t,n){if(i(n)||(n=new _),!i(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var r=e.clone(t[0],N),a=e.clone(r,f),o=e.clone(r,T),u=e.clone(r,R),s=e.clone(r,h),c=e.clone(r,d),E=e.clone(r,A),l=t.length,M=1;M<l;M++){e.clone(t[M],r);var O=r.x,x=r.y,C=r.z;O<a.x&&e.clone(r,a),O>s.x&&e.clone(r,s),x<o.y&&e.clone(r,o),x>c.y&&e.clone(r,c),C<u.z&&e.clone(r,u),C>E.z&&e.clone(r,E)}var g=e.magnitudeSquared(e.subtract(s,a,y)),v=e.magnitudeSquared(e.subtract(c,o,y)),U=e.magnitudeSquared(e.subtract(E,u,y)),L=a,w=s,F=g;v>F&&(F=v,L=o,w=c),U>F&&(F=U,L=u,w=E);var P=S;P.x=.5*(L.x+w.x),P.y=.5*(L.y+w.y),P.z=.5*(L.z+w.z);var D=e.magnitudeSquared(e.subtract(w,P,y)),B=Math.sqrt(D),z=I;z.x=a.x,z.y=o.y,z.z=u.z;var G=p;G.x=s.x,G.y=c.y,G.z=E.z;var b=e.multiplyByScalar(e.add(z,G,y),.5,m),X=0;for(M=0;M<l;M++){e.clone(t[M],r);var q=e.magnitude(e.subtract(r,b,y));q>X&&(X=q);var H=e.magnitudeSquared(e.subtract(r,P,y));if(H>D){var V=Math.sqrt(H);B=.5*(B+V),D=B*B;var W=V-B;P.x=(B*P.x+W*r.x)/V,P.y=(B*P.y+W*r.y)/V,P.z=(B*P.z+W*r.z)/V}}return B<X?(e.clone(P,n.center),n.radius=B):(e.clone(b,n.center),n.radius=X),n};var M=new o,O=new e,x=new e,C=new t,g=new t;_.fromRectangle2D=function(e,t,n){return _.fromRectangleWithHeights2D(e,t,0,0,n)},_.fromRectangleWithHeights2D=function(t,n,a,o,u){if(i(u)||(u=new _),!i(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;n=r(n,M),l.southwest(t,C),C.height=a,l.northeast(t,g),g.height=o;var s=n.project(C,O),c=n.project(g,x),E=c.x-s.x,f=c.y-s.y,T=c.z-s.z;u.radius=.5*Math.sqrt(E*E+f*f+T*T);var R=u.center;return R.x=s.x+.5*E,R.y=s.y+.5*f,R.z=s.z+.5*T,u};var v=[];_.fromRectangle3D=function(e,t,n,o){t=r(t,a.WGS84),n=r(n,0);var u;return i(e)&&(u=l.subsample(e,t,n,v)),_.fromPoints(u,o)},_.fromVertices=function(t,n,a,o){if(i(o)||(o=new _),!i(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;n=r(n,e.ZERO),a=r(a,3);var u=N;u.x=t[0]+n.x,u.y=t[1]+n.y,u.z=t[2]+n.z;for(var s=e.clone(u,f),c=e.clone(u,T),E=e.clone(u,R),l=e.clone(u,h),M=e.clone(u,d),O=e.clone(u,A),x=t.length,C=0;C<x;C+=a){var g=t[C]+n.x,v=t[C+1]+n.y,U=t[C+2]+n.z;u.x=g,u.y=v,u.z=U,g<s.x&&e.clone(u,s),g>l.x&&e.clone(u,l),v<c.y&&e.clone(u,c),v>M.y&&e.clone(u,M),U<E.z&&e.clone(u,E),U>O.z&&e.clone(u,O)}var L=e.magnitudeSquared(e.subtract(l,s,y)),w=e.magnitudeSquared(e.subtract(M,c,y)),F=e.magnitudeSquared(e.subtract(O,E,y)),P=s,D=l,B=L;w>B&&(B=w,P=c,D=M),F>B&&(B=F,P=E,D=O);var z=S;z.x=.5*(P.x+D.x),z.y=.5*(P.y+D.y),z.z=.5*(P.z+D.z);var G=e.magnitudeSquared(e.subtract(D,z,y)),b=Math.sqrt(G),X=I;X.x=s.x,X.y=c.y,X.z=E.z;var q=p;q.x=l.x,q.y=M.y,q.z=O.z;var H=e.multiplyByScalar(e.add(X,q,y),.5,m),V=0;for(C=0;C<x;C+=a){u.x=t[C]+n.x,u.y=t[C+1]+n.y,u.z=t[C+2]+n.z;var W=e.magnitude(e.subtract(u,H,y));W>V&&(V=W);var Y=e.magnitudeSquared(e.subtract(u,z,y));if(Y>G){var k=Math.sqrt(Y);b=.5*(b+k),G=b*b;var Z=k-b;z.x=(b*z.x+Z*u.x)/k,z.y=(b*z.y+Z*u.y)/k,z.z=(b*z.z+Z*u.z)/k}}return b<V?(e.clone(z,o.center),o.radius=b):(e.clone(H,o.center),o.radius=V),o},_.fromEncodedCartesianVertices=function(t,n,r){if(i(r)||(r=new _),!i(t)||!i(n)||t.length!==n.length||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var a=N;a.x=t[0]+n[0],a.y=t[1]+n[1],a.z=t[2]+n[2];for(var o=e.clone(a,f),u=e.clone(a,T),s=e.clone(a,R),c=e.clone(a,h),E=e.clone(a,d),l=e.clone(a,A),M=t.length,O=0;O<M;O+=3){var x=t[O]+n[O],C=t[O+1]+n[O+1],g=t[O+2]+n[O+2];a.x=x,a.y=C,a.z=g,x<o.x&&e.clone(a,o),x>c.x&&e.clone(a,c),C<u.y&&e.clone(a,u),C>E.y&&e.clone(a,E),g<s.z&&e.clone(a,s),g>l.z&&e.clone(a,l)}var v=e.magnitudeSquared(e.subtract(c,o,y)),U=e.magnitudeSquared(e.subtract(E,u,y)),L=e.magnitudeSquared(e.subtract(l,s,y)),w=o,F=c,P=v;U>P&&(P=U,w=u,F=E),L>P&&(P=L,w=s,F=l);var D=S;D.x=.5*(w.x+F.x),D.y=.5*(w.y+F.y),D.z=.5*(w.z+F.z);var B=e.magnitudeSquared(e.subtract(F,D,y)),z=Math.sqrt(B),G=I;G.x=o.x,G.y=u.y,G.z=s.z;var b=p;b.x=c.x,b.y=E.y,b.z=l.z;var X=e.multiplyByScalar(e.add(G,b,y),.5,m),q=0;for(O=0;O<M;O+=3){a.x=t[O]+n[O],a.y=t[O+1]+n[O+1],a.z=t[O+2]+n[O+2];var H=e.magnitude(e.subtract(a,X,y));H>q&&(q=H);var V=e.magnitudeSquared(e.subtract(a,D,y));if(V>B){var W=Math.sqrt(V);z=.5*(z+W),B=z*z;var Y=W-z;D.x=(z*D.x+Y*a.x)/W,D.y=(z*D.y+Y*a.y)/W,D.z=(z*D.z+Y*a.z)/W}}return z<q?(e.clone(D,r.center),r.radius=z):(e.clone(X,r.center),r.radius=q),r},_.fromCornerPoints=function(t,n,r){i(r)||(r=new _);var a=r.center;return e.add(t,n,a),e.multiplyByScalar(a,.5,a),r.radius=e.distance(a,n),r},_.fromEllipsoid=function(t,n){return i(n)||(n=new _),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var U=new e;_.fromBoundingSpheres=function(t,n){if(i(n)||(n=new _),!i(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var r=t.length;if(1===r)return _.clone(t[0],n);if(2===r)return _.union(t[0],t[1],n);for(var a=[],o=0;o<r;o++)a.push(t[o].center);n=_.fromPoints(a,n);var u=n.center,s=n.radius;for(o=0;o<r;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,U)+c.radius)}return n.radius=s,n};var L=new e,w=new e,F=new e;_.fromOrientedBoundingBox=function(t,n){i(n)||(n=new _);var r=t.halfAxes,a=c.getColumn(r,0,L),o=c.getColumn(r,1,w),u=c.getColumn(r,2,F),s=e.magnitude(a),E=e.magnitude(o),l=e.magnitude(u);return n.center=e.clone(t.center,n.center),n.radius=Math.max(s,E,l),n},_.clone=function(t,n){if(i(t))return i(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new _(t.center,t.radius)},_.packedLength=4,_.pack=function(e,t,n){n=r(n,0);var i=e.center;return t[n++]=i.x,t[n++]=i.y,t[n++]=i.z,t[n]=e.radius,t},_.unpack=function(e,t,n){t=r(t,0),i(n)||(n=new _);var a=n.center;return a.x=e[t++],a.y=e[t++],a.z=e[t++],n.radius=e[t],n};var P=new e,D=new e;_.union=function(t,n,r){i(r)||(r=new _);var a=t.center,o=t.radius,u=n.center,s=n.radius,c=e.subtract(u,a,P),E=e.magnitude(c);if(o>=E+s)return t.clone(r),r;if(s>=E+o)return n.clone(r),r;var l=.5*(o+E+s),f=e.multiplyByScalar(c,(-o+l)/E,D);return e.add(f,a,f),e.clone(f,r.center),r.radius=l,r};var B=new e;_.expand=function(t,n,r){r=_.clone(t,r);var i=e.magnitude(e.subtract(n,r.center,B));return i>r.radius&&(r.radius=i),r},_.intersectPlane=function(t,n){var r=t.center,i=t.radius,a=n.normal,o=e.dot(a,r)+n.distance;return o<-i?u.OUTSIDE:o<i?u.INTERSECTING:u.INSIDE},_.transform=function(e,t,n){return i(n)||(n=new _),n.center=E.multiplyByPoint(t,e.center,n.center),n.radius=E.getMaximumScale(t)*e.radius,n};var z=new e;_.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,z);return e.magnitudeSquared(r)-t.radius*t.radius},_.transformWithoutScale=function(e,t,n){return i(n)||(n=new _),n.center=E.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var G=new e;_.computePlaneDistances=function(t,n,r,a){i(a)||(a=new s);var o=e.subtract(t.center,n,G),u=e.dot(r,o);return a.start=u-t.radius,a.stop=u+t.radius,a};for(var b=new e,X=new e,q=new e,H=new e,V=new e,W=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var Z=new o;return _.projectTo2D=function(t,n,i){n=r(n,Z);var a=n.ellipsoid,o=t.center,u=t.radius,s=a.geodeticSurfaceNormal(o,b),c=e.cross(e.UNIT_Z,s,X);e.normalize(c,c);var E=e.cross(s,c,q);e.normalize(E,E),e.multiplyByScalar(s,u,s),e.multiplyByScalar(E,u,E),e.multiplyByScalar(c,u,c);var l=e.negate(E,V),f=e.negate(c,H),T=Y,R=T[0];e.add(s,E,R),e.add(R,c,R),R=T[1],e.add(s,E,R),e.add(R,f,R),R=T[2],e.add(s,l,R),e.add(R,f,R),R=T[3],e.add(s,l,R),e.add(R,c,R),e.negate(s,s),R=T[4],e.add(s,E,R),e.add(R,c,R),R=T[5],e.add(s,E,R),e.add(R,f,R),R=T[6],e.add(s,l,R),e.add(R,f,R),R=T[7],e.add(s,l,R),e.add(R,c,R);for(var h=T.length,d=0;d<h;++d){var A=T[d];e.add(o,A,A);var N=a.cartesianToCartographic(A,W);n.project(N,A)}i=_.fromPoints(T,i),o=i.center;var y=o.x,S=o.y,I=o.z;return o.x=I,o.y=y,o.z=S,i},_.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},_.equals=function(t,n){return t===n||i(t)&&i(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},_.prototype.intersectPlane=function(e){return _.intersectPlane(this,e)},_.prototype.distanceSquaredTo=function(e){return _.distanceSquaredTo(this,e)},_.prototype.computePlaneDistances=function(e,t,n){return _.computePlaneDistances(this,e,t,n)},_.prototype.isOccluded=function(e){return _.isOccluded(this,e)},_.prototype.equals=function(e){return _.equals(this,e)},_.prototype.clone=function(e){return _.clone(this,e)},_}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},i={};return t(i,{element:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(i.supportsFullscreen())return null!==i.element}}}),i.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var i,a=["webkit","moz","o","ms","khtml"],o=0,u=a.length;o<u;++o){var s=a[o];i=s+"RequestFullscreen","function"==typeof t[i]?(r.requestFullscreen=i,n=!0):(i=s+"RequestFullScreen","function"==typeof t[i]&&(r.requestFullscreen=i,n=!0)),i=s+"ExitFullscreen","function"==typeof document[i]?r.exitFullscreen=i:(i=s+"CancelFullScreen","function"==typeof document[i]&&(r.exitFullscreen=i)),i=s+"FullscreenEnabled",void 0!==document[i]?r.fullscreenEnabled=i:(i=s+"FullScreenEnabled",void 0!==document[i]&&(r.fullscreenEnabled=i)),i=s+"FullscreenElement",void 0!==document[i]?r.fullscreenElement=i:(i=s+"FullScreenElement",void 0!==document[i]&&(r.fullscreenElement=i)),i=s+"fullscreenchange",void 0!==document["on"+i]&&("ms"===s&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=s+"fullscreenerror",void 0!==document["on"+i]&&("ms"===s&&(i="MSFullscreenError"),r.fullscreenerror=i)}return n},i.requestFullscreen=function(e,t){i.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},i.exitFullscreen=function(){i.supportsFullscreen()&&document[r.exitFullscreen]()},i}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function i(){if(!t(S)&&(S=!1,!_())){var e=/ Chrome\/([\.0-9]+)/.exec(y.userAgent);null!==e&&(S=!0,I=r(e[1]))}return S}function a(){return i()&&I}function o(){if(!t(p)&&(p=!1,!i()&&!_()&&/ Safari\/[\.0-9]+/.test(y.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(y.userAgent);null!==e&&(p=!0,m=r(e[1]))}return p}function u(){return o()&&m}function s(){if(!t(M)){M=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(y.userAgent);null!==e&&(M=!0,O=r(e[1]),O.isNightly=!!e[2])}return M}function c(){return s()&&O}function E(){if(!t(x)){x=!1;var e;"Microsoft Internet Explorer"===y.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(y.userAgent),null!==e&&(x=!0,C=r(e[1]))):"Netscape"===y.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(y.userAgent),null!==e&&(x=!0,C=r(e[1])))}return x}function l(){return E()&&C}function _(){if(!t(g)){g=!1;var e=/ Edge\/([\.0-9]+)/.exec(y.userAgent);null!==e&&(g=!0,v=r(e[1]))}return g}function f(){ +return _()&&v}function T(){if(!t(U)){U=!1;var e=/Firefox\/([\.0-9]+)/.exec(y.userAgent);null!==e&&(U=!0,L=r(e[1]))}return U}function R(){return t(w)||(w=/Windows/i.test(y.appVersion)),w}function h(){return T()&&L}function d(){return t(F)||(F="undefined"!=typeof PointerEvent&&(!t(y.pointerEnabled)||y.pointerEnabled)),F}function A(){if(!t(D)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;D=t(n)&&""!==n,D&&(P=n)}return D}function N(){return A()?P:void 0}var y;y="undefined"!=typeof navigator?navigator:{};var S,I,p,m,M,O,x,C,g,v,U,L,w,F,P,D,B={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:E,internetExplorerVersion:l,isEdge:_,edgeVersion:f,isFirefox:T,firefoxVersion:h,isWindows:R,hardwareConcurrency:e(y.hardwareConcurrency,3),supportsPointerEvents:d,supportsImageRenderingPixelated:A,imageRenderingValue:N};return B.supportsFullscreen=function(){return n.supportsFullscreen()},B.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},B.supportsWebWorkers=function(){return"undefined"!=typeof Worker},B}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,i,a){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:a.BYTE,UNSIGNED_BYTE:a.UNSIGNED_BYTE,SHORT:a.SHORT,UNSIGNED_SHORT:a.UNSIGNED_SHORT,INT:a.INT,UNSIGNED_INT:a.UNSIGNED_INT,FLOAT:a.FLOAT,DOUBLE:a.DOUBLE};return o.getSizeInBytes=function(e){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.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},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 Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,i){switch(r=e(r,0),i=e(i,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,i);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,i);case o.SHORT:return new Int16Array(n,r,i);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,i);case o.INT:return new Int32Array(n,r,i);case o.UNSIGNED_INT:return new Uint32Array(n,r,i);case o.FLOAT:return new Float32Array(n,r,i);case o.DOUBLE:return new Float64Array(n,r,i)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},i(o)}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===n.POINTS||e===n.LINES||e===n.LINE_LOOP||e===n.LINE_STRIP||e===n.TRIANGLES||e===n.TRIANGLE_STRIP||e===n.TRIANGLE_FAN}};return e(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,i){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,i.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return a.computeNumberOfVertices=function(e){var n=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var i=e.attributes[r],a=i.values.length/i.componentsPerAttribute;n=a}return n},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(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 r}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,n,r,i){"use strict";var a={UNSIGNED_BYTE:i.UNSIGNED_BYTE,UNSIGNED_SHORT:i.UNSIGNED_SHORT,UNSIGNED_INT:i.UNSIGNED_INT};return a.getSizeInBytes=function(e){switch(e){case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},a.validate=function(t){return e(t)&&(t===a.UNSIGNED_BYTE||t===a.UNSIGNED_SHORT||t===a.UNSIGNED_INT)},a.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},a.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)},n(a)}),define("ThirdParty/earcut-2.1.1",[],function(){"use strict";function e(e,n,i){i=i||2;var a=n&&n.length,o=a?n[0]*i:e.length,u=t(e,0,o,i,!0),c=[];if(!u)return c;var E,l,_,f,T,R,h;if(a&&(u=s(e,n,u,i)),e.length>80*i){E=_=e[0],l=f=e[1];for(var d=i;d<o;d+=i)T=e[d],R=e[d+1],T<E&&(E=T),R<l&&(l=R),T>_&&(_=T),R>f&&(f=R);h=Math.max(_-E,f-l)}return r(u,c,i,E,l,h),c}function t(e,t,n,r,i){var a,o;if(i===C(e,t,n,r)>0)for(a=t;a<n;a+=r)o=M(a,e[a],e[a+1],o);else for(a=n-r;a>=t;a-=r)o=M(a,e[a],e[a+1],o);return o&&N(o,o.next)&&(O(o),o=o.next),o}function n(e,t){if(!e)return e;t||(t=e);var n,r=e;do if(n=!1,r.steiner||!N(r,r.next)&&0!==A(r.prev,r,r.next))r=r.next;else{if(O(r),r=t=r.prev,r===r.next)return null;n=!0}while(n||r!==t);return t}function r(e,t,s,c,E,l,f){if(e){!f&&l&&_(e,c,E,l);for(var T,R,h=e;e.prev!==e.next;)if(T=e.prev,R=e.next,l?a(e,c,E,l):i(e))t.push(T.i/s),t.push(e.i/s),t.push(R.i/s),O(e),e=R.next,h=R.next;else if(e=R,e===h){f?1===f?(e=o(e,t,s),r(e,t,s,c,E,l,2)):2===f&&u(e,t,s,c,E,l):r(n(e),t,s,c,E,l,1);break}}}function i(e){var t=e.prev,n=e,r=e.next;if(A(t,n,r)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(h(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&A(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function a(e,t,n,r){var i=e.prev,a=e,o=e.next;if(A(i,a,o)>=0)return!1;for(var u=i.x<a.x?i.x<o.x?i.x:o.x:a.x<o.x?a.x:o.x,s=i.y<a.y?i.y<o.y?i.y:o.y:a.y<o.y?a.y:o.y,c=i.x>a.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,E=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,l=T(u,s,t,n,r),_=T(c,E,t,n,r),f=e.nextZ;f&&f.z<=_;){if(f!==e.prev&&f!==e.next&&h(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&A(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(f=e.prevZ;f&&f.z>=l;){if(f!==e.prev&&f!==e.next&&h(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&A(f.prev,f,f.next)>=0)return!1;f=f.prevZ}return!0}function o(e,t,n){var r=e;do{var i=r.prev,a=r.next.next;!N(i,a)&&y(i,r,r.next,a)&&I(i,a)&&I(a,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(a.i/n),O(r),O(r.next),r=e=a),r=r.next}while(r!==e);return r}function u(e,t,i,a,o,u){var s=e;do{for(var c=s.next.next;c!==s.prev;){if(s.i!==c.i&&d(s,c)){var E=m(s,c);return s=n(s,s.next),E=n(E,E.next),r(s,t,i,a,o,u),void r(E,t,i,a,o,u)}c=c.next}s=s.next}while(s!==e)}function s(e,r,i,a){var o,u,s,l,_,f=[];for(o=0,u=r.length;o<u;o++)s=r[o]*a,l=o<u-1?r[o+1]*a:e.length,_=t(e,s,l,a,!1),_===_.next&&(_.steiner=!0),f.push(R(_));for(f.sort(c),o=0;o<f.length;o++)E(f[o],i),i=n(i,i.next);return i}function c(e,t){return e.x-t.x}function E(e,t){if(t=l(e,t)){var r=m(t,e);n(r,r.next)}}function l(e,t){var n,r=t,i=e.x,a=e.y,o=-(1/0);do{if(a<=r.y&&a>=r.next.y){var u=r.x+(a-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(u<=i&&u>o){if(o=u,u===i){if(a===r.y)return r;if(a===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(i===o)return n.prev;var s,c=n,E=n.x,l=n.y,_=1/0;for(r=n.next;r!==c;)i>=r.x&&r.x>=E&&h(a<l?i:o,a,E,l,a<l?o:i,a,r.x,r.y)&&(s=Math.abs(a-r.y)/(i-r.x),(s<_||s===_&&r.x>n.x)&&I(r,e)&&(n=r,_=s)),r=r.next;return n}function _(e,t,n,r){var i=e;do null===i.z&&(i.z=T(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,f(i)}function f(e){var t,n,r,i,a,o,u,s,c=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,r=n,u=0,t=0;t<c&&(u++,r=r.nextZ,r);t++);for(s=c;u>0||s>0&&r;)0===u?(i=r,r=r.nextZ,s--):0!==s&&r?n.z<=r.z?(i=n,n=n.nextZ,u--):(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,u--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;n=r}a.nextZ=null,c*=2}while(o>1);return e}function T(e,t,n,r,i){return e=32767*(e-n)/i,t=32767*(t-r)/i,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function R(e){var t=e,n=e;do t.x<n.x&&(n=t),t=t.next;while(t!==e);return n}function h(e,t,n,r,i,a,o,u){return(i-o)*(t-u)-(e-o)*(a-u)>=0&&(e-o)*(r-u)-(n-o)*(t-u)>=0&&(n-o)*(a-u)-(i-o)*(r-u)>=0}function d(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!S(e,t)&&I(e,t)&&I(t,e)&&p(e,t)}function A(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function N(e,t){return e.x===t.x&&e.y===t.y}function y(e,t,n,r){return!!(N(e,t)&&N(n,r)||N(e,r)&&N(n,t))||A(e,t,n)>0!=A(e,t,r)>0&&A(n,r,e)>0!=A(n,r,t)>0}function S(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&y(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function I(e,t){return A(e.prev,e,e.next)<0?A(e,t,e.next)>=0&&A(e,e.prev,t)>=0:A(e,t,e.prev)<0||A(e,e.next,t)<0}function p(e,t){var n=e,r=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do n.y>a!=n.next.y>a&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function m(e,t){var n=new x(e.i,e.x,e.y),r=new x(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function M(e,t,n,r){var i=new x(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function O(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function x(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function C(e,t,n,r){for(var i=0,a=t,o=n-r;a<n;a+=r)i+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return i}return e.deviation=function(e,t,n,r){var i=t&&t.length,a=i?t[0]*n:e.length,o=Math.abs(C(e,0,a,n));if(i)for(var u=0,s=t.length;u<s;u++){var c=t[u]*n,E=u<s-1?t[u+1]*n:e.length;o-=Math.abs(C(e,c,E,n))}var l=0;for(u=0;u<r.length;u+=3){var _=r[u]*n,f=r[u+1]*n,T=r[u+2]*n;l+=Math.abs((e[_]-e[T])*(e[f+1]-e[_+1])-(e[_]-e[f])*(e[T+1]-e[_+1]))}return 0===o&&0===l?0:Math.abs((l-o)/o)},e.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,i=0;i<e.length;i++){for(var a=0;a<e[i].length;a++)for(var o=0;o<t;o++)n.vertices.push(e[i][a][o]);i>0&&(r+=e[i-1].length,n.holes.push(r))}return n},e}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(e,n){this.x=t(e,0),this.y=t(n,0)}o.fromElements=function(e,t,r){return n(r)?(r.x=e,r.y=t,r):new o(e,t)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t):new o(e.x,e.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r]=e.y,n},o.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new o),i.x=e[r++],i.y=e[r],i},o.packArray=function(e,t){var r=e.length;n(t)?t.length=2*r:t=new Array(2*r);for(var i=0;i<r;++i)o.pack(e[i],t,2*i);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/2:t=new Array(r/2);for(var i=0;i<r;i+=2){var a=i/2;t[a]=o.unpack(e,i,t[a])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y)},o.minimumComponent=function(e){return Math.min(e.x,e.y)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,E=new o;o.angleBetween=function(e,t){return o.normalize(e,c),o.normalize(t,E),a.acosClamped(o.dot(c,E))};var l=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,l);return o.abs(n,n),t=n.x<=n.y?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},o.equalsEpsilon=function(e,t,r,i){return e===t||n(e)&&n(t)&&a.equalsEpsilon(e.x,t.x,r,i)&&a.equalsEpsilon(e.y,t.y,r,i)},o.ZERO=i(new o(0,0)),o.UNIT_X=i(new o(1,0)),o.UNIT_Y=i(new o(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,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/WindingOrder",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={CLOCKWISE:t.CW,COUNTER_CLOCKWISE:t.CCW,validate:function(e){return e===n.CLOCKWISE||e===n.COUNTER_CLOCKWISE}};return e(n)}),define("Core/PolygonPipeline",["../ThirdParty/earcut-2.1.1","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./Math","./PrimitiveType","./WindingOrder"],function(e,t,n,r,i,a,o,u,s,c,E,l,_){"use strict";var f=new n,T=new n,R={};R.computeArea2D=function(e){for(var t=e.length,n=0,r=t-1,i=0;i<t;r=i++){var a=e[r],o=e[i];n+=a.x*o.y-o.x*a.y}return.5*n},R.computeWindingOrder2D=function(e){var t=R.computeArea2D(e);return t>0?_.COUNTER_CLOCKWISE:_.CLOCKWISE},R.triangulate=function(n,r){var i=t.packArray(n);return e(i,r,2)};var h=new n,d=new n,A=new n,N=new n,y=new n,S=new n,I=new n;return R.computeSubdivision=function(e,t,o,u){u=i(u,E.RADIANS_PER_DEGREE);var _,f=o.slice(0),T=t.length,R=new Array(3*T),p=0;for(_=0;_<T;_++){var m=t[_];R[p++]=m.x,R[p++]=m.y,R[p++]=m.z}for(var M=[],O={},x=e.maximumRadius,C=E.chordLength(u,x),g=C*C;f.length>0;){var v,U,L=f.pop(),w=f.pop(),F=f.pop(),P=n.fromArray(R,3*F,h),D=n.fromArray(R,3*w,d),B=n.fromArray(R,3*L,A),z=n.multiplyByScalar(n.normalize(P,N),x,N),G=n.multiplyByScalar(n.normalize(D,y),x,y),b=n.multiplyByScalar(n.normalize(B,S),x,S),X=n.magnitudeSquared(n.subtract(z,G,I)),q=n.magnitudeSquared(n.subtract(G,b,I)),H=n.magnitudeSquared(n.subtract(b,z,I)),V=Math.max(X,q,H);V>g?X===V?(v=Math.min(F,w)+" "+Math.max(F,w),_=O[v],a(_)||(U=n.add(P,D,I),n.multiplyByScalar(U,.5,U),R.push(U.x,U.y,U.z),_=R.length/3-1,O[v]=_),f.push(F,_,L),f.push(_,w,L)):q===V?(v=Math.min(w,L)+" "+Math.max(w,L),_=O[v],a(_)||(U=n.add(D,B,I),n.multiplyByScalar(U,.5,U),R.push(U.x,U.y,U.z),_=R.length/3-1,O[v]=_),f.push(w,_,F),f.push(_,L,F)):H===V&&(v=Math.min(L,F)+" "+Math.max(L,F),_=O[v],a(_)||(U=n.add(B,P,I),n.multiplyByScalar(U,.5,U),R.push(U.x,U.y,U.z),_=R.length/3-1,O[v]=_),f.push(L,_,w),f.push(_,F,w)):(M.push(F),M.push(w),M.push(L))}return new s({attributes:{position:new c({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:R})},indices:M,primitiveType:l.TRIANGLES})},R.scaleToGeodeticHeight=function(e,t,r,o){r=i(r,u.WGS84);var s=f,c=T;if(t=i(t,0),o=i(o,!0),a(e))for(var E=e.length,l=0;l<E;l+=3)n.fromArray(e,l,c),o&&(c=r.scaleToGeodeticSurface(c,c)),0!==t&&(s=r.geodeticSurfaceNormal(c,s),n.multiplyByScalar(s,t,s),n.add(c,s,c)),e[l]=c.x,e[l+1]=c.y,e[l+2]=c.z;return e},R}),define("Core/Matrix2",["./Cartesian2","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject"],function(e,t,n,r,i,a,o){"use strict";function u(e,t,r,i){this[0]=n(e,0),this[1]=n(r,0),this[2]=n(t,0),this[3]=n(i,0)}u.packedLength=4,u.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t},u.unpack=function(e,t,i){return t=n(t,0),r(i)||(i=new u),i[0]=e[t++],i[1]=e[t++],i[2]=e[t++],i[3]=e[t++],i},u.clone=function(e,t){if(r(e))return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new u(e[0],e[2],e[1],e[3])},u.fromArray=function(e,t,i){return t=n(t,0),r(i)||(i=new u),i[0]=e[t],i[1]=e[t+1],i[2]=e[t+2],i[3]=e[t+3],i},u.fromColumnMajorArray=function(e,t){return u.clone(e,t)},u.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new u(e[0],e[1],e[2],e[3])},u.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new u(e.x,0,0,e.y)},u.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new u(e,0,0,e)},u.fromRotation=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=n,t[1]=i,t[2]=-i,t[3]=n,t):new u(n,-i,i,n)},u.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):[e[0],e[1],e[2],e[3]]},u.getElementIndex=function(e,t){return 2*e+t},u.getColumn=function(e,t,n){var r=2*t,i=e[r],a=e[r+1];return n.x=i,n.y=a,n},u.setColumn=function(e,t,n,r){ +r=u.clone(e,r);var i=2*t;return r[i]=n.x,r[i+1]=n.y,r},u.getRow=function(e,t,n){var r=e[t],i=e[t+2];return n.x=r,n.y=i,n},u.setRow=function(e,t,n,r){return r=u.clone(e,r),r[t]=n.x,r[t+2]=n.y,r};var s=new e;u.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],s)),n.y=e.magnitude(e.fromElements(t[2],t[3],s)),n};var c=new e;return u.getMaximumScale=function(t){return u.getScale(t,c),e.maximumComponent(c)},u.multiply=function(e,t,n){var r=e[0]*t[0]+e[2]*t[1],i=e[0]*t[2]+e[2]*t[3],a=e[1]*t[0]+e[3]*t[1],o=e[1]*t[2]+e[3]*t[3];return n[0]=r,n[1]=a,n[2]=i,n[3]=o,n},u.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n},u.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n},u.multiplyByVector=function(e,t,n){var r=e[0]*t.x+e[2]*t.y,i=e[1]*t.x+e[3]*t.y;return n.x=r,n.y=i,n},u.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n},u.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.y,n[3]=e[3]*t.y,n},u.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},u.transpose=function(e,t){var n=e[0],r=e[2],i=e[1],a=e[3];return t[0]=n,t[1]=r,t[2]=i,t[3]=a,t},u.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},u.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]},u.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]},u.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},u.IDENTITY=o(new u(1,0,0,1)),u.ZERO=o(new u(0,0,0,0)),u.COLUMN0ROW0=0,u.COLUMN0ROW1=1,u.COLUMN1ROW0=2,u.COLUMN1ROW1=3,i(u.prototype,{length:{get:function(){return u.packedLength}}}),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,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this[0]+", "+this[2]+")\n("+this[1]+", "+this[3]+")"},u}),define("Core/RectangleGeometryLibrary",["./Cartesian3","./Cartographic","./defined","./DeveloperError","./GeographicProjection","./Math","./Matrix2","./Rectangle"],function(e,t,n,r,i,a,o,u){"use strict";function s(t,n,r,i,a,u,s){var c=Math.cos(n),E=i*c,l=r*c,_=Math.sin(n),R=i*_,A=r*_;T=d.project(t,T),T=e.subtract(T,h,T);var N=o.fromRotation(n,f);T=o.multiplyByVector(N,T,T),T=e.add(T,h,T),t=d.unproject(T,t),u-=1,s-=1;var y=t.latitude,S=y+u*A,I=y-E*s,p=y-E*s+u*A,m=Math.max(y,S,I,p),M=Math.min(y,S,I,p),O=t.longitude,x=O+u*l,C=O+s*R,g=O+s*R+u*l,v=Math.max(O,x,C,g),U=Math.min(O,x,C,g);return{north:m,south:M,east:v,west:U,granYCos:E,granYSin:R,granXCos:l,granXSin:A,nwCorner:t}}var c=Math.cos,E=Math.sin,l=Math.sqrt,_={};_.computePosition=function(e,t,r,i,a){var o=e.ellipsoid.radiiSquared,u=e.nwCorner,s=e.rectangle,_=u.latitude-e.granYCos*t+r*e.granXSin,f=c(_),T=E(_),R=o.z*T,h=u.longitude+t*e.granYSin+r*e.granXCos,d=f*c(h),A=f*E(h),N=o.x*d,y=o.y*A,S=l(N*d+y*A+R*T);if(i.x=N/S,i.y=y/S,i.z=R/S,n(e.vertexFormat)&&e.vertexFormat.st){var I=e.stNwCorner;n(I)?(_=I.latitude-e.stGranYCos*t+r*e.stGranXSin,h=I.longitude+t*e.stGranYSin+r*e.stGranXCos,a.x=(h-e.stWest)*e.lonScalar,a.y=(_-e.stSouth)*e.latScalar):(a.x=(h-s.west)*e.lonScalar,a.y=(_-s.south)*e.latScalar)}};var f=new o,T=new e,R=new t,h=new e,d=new i;return _.computeOptions=function(e,t,n,r){var i,o,c,E,l,_=e._granularity,f=e._ellipsoid,T=e._surfaceHeight,A=e._rotation,N=e._stRotation,y=e._extrudedHeight,S=t.east,I=t.west,p=t.north,m=t.south,M=p-m;I>S?(l=a.TWO_PI-I+S,i=Math.ceil(l/_)+1,o=Math.ceil(M/_)+1,c=l/(i-1),E=M/(o-1)):(l=S-I,i=Math.ceil(l/_)+1,o=Math.ceil(M/_)+1,c=l/(i-1),E=M/(o-1)),n=u.northwest(t,n);var O=u.center(t,R);0===A&&0===N||(O.longitude<n.longitude&&(O.longitude+=a.TWO_PI),h=d.project(O,h));var x=E,C=c,g=0,v=0,U={granYCos:x,granYSin:g,granXCos:C,granXSin:v,ellipsoid:f,surfaceHeight:T,extrudedHeight:y,nwCorner:n,rectangle:t,width:i,height:o};if(0!==A){var L=s(n,A,c,E,O,i,o);p=L.north,m=L.south,S=L.east,I=L.west,U.granYCos=L.granYCos,U.granYSin=L.granYSin,U.granXCos=L.granXCos,U.granXSin=L.granXSin,t.north=p,t.south=m,t.east=S,t.west=I}if(0!==N){A-=N,r=u.northwest(t,r);var w=s(r,A,c,E,O,i,o);U.stGranYCos=w.granYCos,U.stGranXCos=w.granXCos,U.stGranYSin=w.granYSin,U.stGranXSin=w.granXSin,U.stNwCorner=r,U.stWest=w.west,U.stSouth=w.south}return U},_}),define("Core/RectangleOutlineGeometry",["./BoundingSphere","./Cartesian3","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolygonPipeline","./PrimitiveType","./Rectangle","./RectangleGeometryLibrary"],function(e,t,n,r,i,a,o,u,s,c,E,l,_,f,T,R,h){"use strict";function d(e){var t,n=e.size,i=e.height,a=e.width,o=new Float64Array(3*n),u=0,_=0,f=I;for(t=0;t<a;t++)h.computePosition(e,_,t,f),o[u++]=f.x,o[u++]=f.y,o[u++]=f.z;for(t=a-1,_=1;_<i;_++)h.computePosition(e,_,t,f),o[u++]=f.x,o[u++]=f.y,o[u++]=f.z;for(_=i-1,t=a-2;t>=0;t--)h.computePosition(e,_,t,f),o[u++]=f.x,o[u++]=f.y,o[u++]=f.z;for(t=0,_=i-2;_>0;_--)h.computePosition(e,_,t,f),o[u++]=f.x,o[u++]=f.y,o[u++]=f.z;for(var R=o.length/3*2,d=l.createTypedArray(o.length/3,R),A=0,N=0;N<o.length/3-1;N++)d[A++]=N,d[A++]=N+1;d[A++]=o.length/3-1,d[A++]=0;var y=new s({attributes:new E,primitiveType:T.LINES});return y.attributes.position=new c({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:o}),y.indices=d,y}function A(e){var t=e.surfaceHeight,n=e.extrudedHeight,r=e.ellipsoid,i=Math.min(n,t),a=Math.max(n,t),o=d(e);if(_.equalsEpsilon(i,a,_.EPSILON10))return o;var u=e.height,s=e.width,c=f.scaleToGeodeticHeight(o.attributes.position.values,a,r,!1),E=c.length,T=new Float64Array(2*E);T.set(c);var R=f.scaleToGeodeticHeight(o.attributes.position.values,i,r);T.set(R,E),o.attributes.position.values=T;var h=T.length/3*2+8,A=l.createTypedArray(T.length/3,h);E=T.length/6;for(var N=0,y=0;y<E-1;y++)A[N++]=y,A[N++]=y+1,A[N++]=y+E,A[N++]=y+E+1;return A[N++]=E-1,A[N++]=0,A[N++]=E+E-1,A[N++]=E,A[N++]=0,A[N++]=E,A[N++]=s-1,A[N++]=E+s-1,A[N++]=s+u-2,A[N++]=s+u-2+E,A[N++]=2*s+u-3,A[N++]=2*s+u-3+E,o.indices=A,o}function N(e){e=i(e,i.EMPTY_OBJECT);var t=e.rectangle,n=i(e.granularity,_.RADIANS_PER_DEGREE),r=i(e.ellipsoid,u.WGS84),a=i(e.height,0),o=i(e.rotation,0),s=e.extrudedHeight;this._rectangle=t,this._granularity=n,this._ellipsoid=r,this._surfaceHeight=a,this._rotation=o,this._extrudedHeight=s,this._workerName="createRectangleOutlineGeometry"}var y=new e,S=new e,I=new t,p=new R;N.packedLength=R.packedLength+u.packedLength+5,N.pack=function(e,t,n){return n=i(n,0),R.pack(e._rectangle,t,n),n+=R.packedLength,u.pack(e._ellipsoid,t,n),n+=u.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=a(e._extrudedHeight)?1:0,t[n]=i(e._extrudedHeight,0),t};var m=new R,M=u.clone(u.UNIT_SPHERE),O={rectangle:m,ellipsoid:M,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0};N.unpack=function(e,t,n){t=i(t,0);var r=R.unpack(e,t,m);t+=R.packedLength;var o=u.unpack(e,t,M);t+=u.packedLength;var s=e[t++],c=e[t++],E=e[t++],l=e[t++],_=e[t];return a(n)?(n._rectangle=R.clone(r,n._rectangle),n._ellipsoid=u.clone(o,n._ellipsoid),n._surfaceHeight=c,n._rotation=E,n._extrudedHeight=l?_:void 0,n):(O.granularity=s,O.height=c,O.rotation=E,O.extrudedHeight=l?_:void 0,new N(O))};var x=new n;return N.createGeometry=function(t){var n=R.clone(t._rectangle,p),r=t._ellipsoid,i=t._surfaceHeight,o=t._extrudedHeight,u=h.computeOptions(t,n,x);u.size=2*u.width+2*u.height-4;var c,E;if(n=t._rectangle,!_.equalsEpsilon(n.north,n.south,_.EPSILON10)&&!_.equalsEpsilon(n.east,n.west,_.EPSILON10)){if(a(o)){c=A(u);var l=e.fromRectangle3D(n,r,i,S),N=e.fromRectangle3D(n,r,o,y);E=e.union(l,N)}else c=d(u),c.attributes.position.values=f.scaleToGeodeticHeight(c.attributes.position.values,i,r,!1),E=e.fromRectangle3D(n,r,i);return new s({attributes:c.attributes,indices:c.indices,primitiveType:T.LINES,boundingSphere:E})}},N}),define("Workers/createRectangleOutlineGeometry",["../Core/defined","../Core/Ellipsoid","../Core/Rectangle","../Core/RectangleOutlineGeometry"],function(e,t,n,r){"use strict";function i(i,a){return e(a)&&(i=r.unpack(i,a)),i._ellipsoid=t.clone(i._ellipsoid),i._rectangle=n.clone(i._rectangle),r.createGeometry(i)}return i})}(); \ No newline at end of file diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createSimplePolylineGeometry.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createSimplePolylineGeometry.js index 33f7a3d5..d0d48a03 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createSimplePolylineGeometry.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createSimplePolylineGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,7 +55,7 @@ mersenne-twister.js - https://gist.github.com/banksean/300494 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -!function(){define("Core/defined",[],function(){"use strict";function t(t){return void 0!==t&&null!==t}return t}),define("Core/freezeObject",["./defined"],function(t){"use strict";var e=Object.freeze;return t(e)||(e=function(t){return t}),e}),define("Core/defaultValue",["./freezeObject"],function(t){"use strict";function e(t,e){return void 0!==t?t:e}return e.EMPTY_OBJECT=t({}),e}),define("Core/DeveloperError",["./defined"],function(t){"use strict";function e(t){this.name="DeveloperError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e.throwInstantiationError=function(){throw new e("This function defines an interface and should not be called directly.")},e}),define("Core/isArray",["./defined"],function(t){"use strict";var e=Array.isArray;return t(e)||(e=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),e}),define("Core/Check",["./defaultValue","./defined","./DeveloperError","./isArray"],function(t,e,r,n){"use strict";function a(t){return t+" was required but undefined."}function o(t,e,r){return"Expected "+r+" to be typeof "+e+", got "+t}var i={};return i.typeOf={},i.numeric={},i.defined=function(t,n){if(!e(t))throw new r(a(n))},i.numeric.maximum=function(t,e){if(i.typeOf.number(t),i.typeOf.number(e),t>e)throw new r("Expected "+t+" to be at most "+e)},i.numeric.minimum=function(t,e){if(i.typeOf.number(t),i.typeOf.number(e),t<e)throw new r("Expected "+t+" to be at least "+e)},i.typeOf.function=function(t,e){if("function"!=typeof t)throw new r(o(typeof t,"function",e))},i.typeOf.string=function(t,e){if("string"!=typeof t)throw new r(o(typeof t,"string",e))},i.typeOf.number=function(t,e){if("number"!=typeof t)throw new r(o(typeof t,"number",e))},i.typeOf.object=function(t,e){if("object"!=typeof t)throw new r(o(typeof t,"object",e))},i.typeOf.boolean=function(t,e){if("boolean"!=typeof t)throw new r(o(typeof t,"boolean",e))},i}),define("ThirdParty/mersenne-twister",[],function(){var t=function(t){void 0==t&&(t=(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(t)};return t.prototype.init_genrand=function(t){for(this.mt[0]=t>>>0,this.mti=1;this.mti<this.N;this.mti++){var t=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&t)>>>16)<<16)+1812433253*(65535&t)+this.mti,this.mt[this.mti]>>>=0}},t.prototype.genrand_int32=function(){var t,e=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++)t=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+this.M]^t>>>1^e[1&t];for(;r<this.N-1;r++)t=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+(this.M-this.N)]^t>>>1^e[1&t];t=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^t>>>1^e[1&t],this.mti=0}return t=this.mt[this.mti++],t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,t^=t>>>18,t>>>0},t.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},t}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(t,e,r,n){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(t){return t>0?1:t<0?-1:0},a.signNotZero=function(t){return t<0?-1:1},a.toSNorm=function(t,r){return r=e(r,255),Math.round((.5*a.clamp(t,-1,1)+.5)*r)},a.fromSNorm=function(t,r){return r=e(r,255),a.clamp(t,0,r)/r*2-1},a.sinh=function(t){var e=Math.pow(Math.E,t),r=Math.pow(Math.E,-1*t);return.5*(e-r)},a.cosh=function(t){var e=Math.pow(Math.E,t),r=Math.pow(Math.E,-1*t);return.5*(e+r)},a.lerp=function(t,e,r){return(1-r)*t+r*e},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(t){return t*a.RADIANS_PER_DEGREE},a.toDegrees=function(t){return t*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(t){var e=a.TWO_PI,r=t-Math.floor(t/e)*e;return r<-Math.PI?r+e:r>=Math.PI?r-e:r},a.clampToLatitudeRange=function(t){return a.clamp(t,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(t){return a.zeroToTwoPi(t+a.PI)-a.PI},a.zeroToTwoPi=function(t){var e=a.mod(t,a.TWO_PI);return Math.abs(e)<a.EPSILON14&&Math.abs(t)>a.EPSILON14?a.TWO_PI:e},a.mod=function(t,e){return(t%e+e)%e},a.equalsEpsilon=function(t,r,n,a){a=e(a,n);var o=Math.abs(t-r);return o<=a||o<=n*Math.max(Math.abs(t),Math.abs(r))};var o=[1];a.factorial=function(t){var e=o.length;if(t>=e)for(var r=o[e-1],n=e;n<=t;n++)o.push(r*n);return o[t]},a.incrementWrap=function(t,r,n){return n=e(n,0),++t,t>r&&(t=n),t},a.isPowerOfTwo=function(t){return 0!==t&&0===(t&t-1)},a.nextPowerOfTwo=function(t){return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t,t},a.clamp=function(t,e,r){return t<e?e:t>r?r:t};var i=new t;return a.setRandomNumberSeed=function(e){i=new t(e)},a.nextRandomNumber=function(){return i.random()},a.acosClamped=function(t){return Math.acos(a.clamp(t,-1,1))},a.asinClamped=function(t){return Math.asin(a.clamp(t,-1,1))},a.chordLength=function(t,e){return 2*e*Math.sin(.5*t)},a.logBase=function(t,e){return Math.log(t)/Math.log(e)},a.fog=function(t,e){var r=t*e;return 1-Math.exp(-(r*r))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,r,n,a,o){"use strict";function i(t,r,n){this.x=e(t,0),this.y=e(r,0),this.z=e(n,0)}i.fromSpherical=function(t,n){r(n)||(n=new i);var a=t.clock,o=t.cone,u=e(t.magnitude,1),s=u*Math.sin(o);return n.x=s*Math.cos(a),n.y=s*Math.sin(a),n.z=u*Math.cos(o),n},i.fromElements=function(t,e,n,a){return r(a)?(a.x=t,a.y=e,a.z=n,a):new i(t,e,n)},i.clone=function(t,e){if(r(t))return r(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e):new i(t.x,t.y,t.z)},i.fromCartesian4=i.clone,i.packedLength=3,i.pack=function(t,r,n){return n=e(n,0),r[n++]=t.x,r[n++]=t.y,r[n]=t.z,r},i.unpack=function(t,n,a){return n=e(n,0),r(a)||(a=new i),a.x=t[n++],a.y=t[n++],a.z=t[n],a},i.packArray=function(t,e){var n=t.length;r(e)?e.length=3*n:e=new Array(3*n);for(var a=0;a<n;++a)i.pack(t[a],e,3*a);return e},i.unpackArray=function(t,e){var n=t.length;r(e)?e.length=n/3:e=new Array(n/3);for(var a=0;a<n;a+=3){var o=a/3;e[o]=i.unpack(t,a,e[o])}return e},i.fromArray=i.unpack,i.maximumComponent=function(t){return Math.max(t.x,t.y,t.z)},i.minimumComponent=function(t){return Math.min(t.x,t.y,t.z)},i.minimumByComponent=function(t,e,r){return r.x=Math.min(t.x,e.x),r.y=Math.min(t.y,e.y),r.z=Math.min(t.z,e.z),r},i.maximumByComponent=function(t,e,r){return r.x=Math.max(t.x,e.x),r.y=Math.max(t.y,e.y),r.z=Math.max(t.z,e.z),r},i.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z},i.magnitude=function(t){return Math.sqrt(i.magnitudeSquared(t))};var u=new i;i.distance=function(t,e){return i.subtract(t,e,u),i.magnitude(u)},i.distanceSquared=function(t,e){return i.subtract(t,e,u),i.magnitudeSquared(u)},i.normalize=function(t,e){var r=i.magnitude(t);return e.x=t.x/r,e.y=t.y/r,e.z=t.z/r,e},i.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},i.multiplyComponents=function(t,e,r){return r.x=t.x*e.x,r.y=t.y*e.y,r.z=t.z*e.z,r},i.divideComponents=function(t,e,r){return r.x=t.x/e.x,r.y=t.y/e.y,r.z=t.z/e.z,r},i.add=function(t,e,r){return r.x=t.x+e.x,r.y=t.y+e.y,r.z=t.z+e.z,r},i.subtract=function(t,e,r){return r.x=t.x-e.x,r.y=t.y-e.y,r.z=t.z-e.z,r},i.multiplyByScalar=function(t,e,r){return r.x=t.x*e,r.y=t.y*e,r.z=t.z*e,r},i.divideByScalar=function(t,e,r){return r.x=t.x/e,r.y=t.y/e,r.z=t.z/e,r},i.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e},i.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e};var s=new i;i.lerp=function(t,e,r,n){return i.multiplyByScalar(e,r,s),n=i.multiplyByScalar(t,1-r,n),i.add(s,n,n)};var E=new i,l=new i;i.angleBetween=function(t,e){i.normalize(t,E),i.normalize(e,l);var r=i.dot(E,l),n=i.magnitude(i.cross(E,l,E));return Math.atan2(n,r)};var c=new i;i.mostOrthogonalAxis=function(t,e){var r=i.normalize(t,c);return i.abs(r,r),e=r.x<=r.y?r.x<=r.z?i.clone(i.UNIT_X,e):i.clone(i.UNIT_Z,e):r.y<=r.z?i.clone(i.UNIT_Y,e):i.clone(i.UNIT_Z,e)},i.equals=function(t,e){return t===e||r(t)&&r(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z},i.equalsArray=function(t,e,r){return t.x===e[r]&&t.y===e[r+1]&&t.z===e[r+2]},i.equalsEpsilon=function(t,e,n,a){return t===e||r(t)&&r(e)&&o.equalsEpsilon(t.x,e.x,n,a)&&o.equalsEpsilon(t.y,e.y,n,a)&&o.equalsEpsilon(t.z,e.z,n,a)},i.cross=function(t,e,r){var n=t.x,a=t.y,o=t.z,i=e.x,u=e.y,s=e.z,E=a*s-o*u,l=o*i-n*s,c=n*u-a*i;return r.x=E,r.y=l,r.z=c,r},i.fromDegrees=function(t,e,r,n,a){return t=o.toRadians(t),e=o.toRadians(e),i.fromRadians(t,e,r,n,a)};var f=new i,_=new i,R=new i(40680631590769,40680631590769,40408299984661.445);return i.fromRadians=function(t,n,a,o,u){a=e(a,0);var s=r(o)?o.radiiSquared:R,E=Math.cos(n);f.x=E*Math.cos(t),f.y=E*Math.sin(t),f.z=Math.sin(n),f=i.normalize(f,f),i.multiplyComponents(s,f,_);var l=Math.sqrt(i.dot(f,_));return _=i.divideByScalar(_,l,_),f=i.multiplyByScalar(f,a,f),r(u)||(u=new i),i.add(_,f,u)},i.fromDegreesArray=function(t,e,n){var a=t.length;r(n)?n.length=a/2:n=new Array(a/2);for(var o=0;o<a;o+=2){var u=t[o],s=t[o+1],E=o/2;n[E]=i.fromDegrees(u,s,0,e,n[E])}return n},i.fromRadiansArray=function(t,e,n){var a=t.length;r(n)?n.length=a/2:n=new Array(a/2);for(var o=0;o<a;o+=2){var u=t[o],s=t[o+1],E=o/2;n[E]=i.fromRadians(u,s,0,e,n[E])}return n},i.fromDegreesArrayHeights=function(t,e,n){var a=t.length;r(n)?n.length=a/3:n=new Array(a/3);for(var o=0;o<a;o+=3){var u=t[o],s=t[o+1],E=t[o+2],l=o/3;n[l]=i.fromDegrees(u,s,E,e,n[l])}return n},i.fromRadiansArrayHeights=function(t,e,n){var a=t.length;r(n)?n.length=a/3:n=new Array(a/3);for(var o=0;o<a;o+=3){var u=t[o],s=t[o+1],E=t[o+2],l=o/3;n[l]=i.fromRadians(u,s,E,e,n[l])}return n},i.ZERO=a(new i(0,0,0)),i.UNIT_X=a(new i(1,0,0)),i.UNIT_Y=a(new i(0,1,0)),i.UNIT_Z=a(new i(0,0,1)),i.prototype.clone=function(t){return i.clone(this,t)},i.prototype.equals=function(t){return i.equals(this,t)},i.prototype.equalsEpsilon=function(t,e,r){return i.equalsEpsilon(this,t,e,r)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},i}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(t,e,r,n){"use strict";function a(r,a,u,s,E){var l=r.x,c=r.y,f=r.z,_=a.x,R=a.y,T=a.z,h=l*l*_*_,A=c*c*R*R,d=f*f*T*T,S=h+A+d,m=Math.sqrt(1/S),N=t.multiplyByScalar(r,m,o);if(S<s)return isFinite(m)?t.clone(N,E):void 0;var C=u.x,I=u.y,p=u.z,M=i;M.x=N.x*C*2,M.y=N.y*I*2,M.z=N.z*p*2;var O,g,y,F,L,v,U,D,P,B,w,x=(1-m)*t.magnitude(r)/(.5*t.magnitude(M)),G=0;do{x-=G,y=1/(1+x*C),F=1/(1+x*I),L=1/(1+x*p),v=y*y,U=F*F,D=L*L,P=v*y,B=U*F,w=D*L,O=h*v+A*U+d*D-1,g=h*P*C+A*B*I+d*w*p;var b=-2*g;G=O/b}while(Math.abs(O)>n.EPSILON12);return e(E)?(E.x=l*y,E.y=c*F,E.z=f*L,E):new t(l*y,c*F,f*L)}var o=new t,i=new t;return a}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,r,n,a,o,i){"use strict";function u(t,r,n){this.longitude=e(t,0),this.latitude=e(r,0),this.height=e(n,0)}u.fromRadians=function(t,n,a,o){return a=e(a,0),r(o)?(o.longitude=t,o.latitude=n,o.height=a,o):new u(t,n,a)},u.fromDegrees=function(t,e,r,n){return t=o.toRadians(t),e=o.toRadians(e),u.fromRadians(t,e,r,n)};var s=new t,E=new t,l=new t,c=new t(1/6378137,1/6378137,1/6356752.314245179),f=new t(1/40680631590769,1/40680631590769,1/40408299984661.445),_=o.EPSILON1;return u.fromCartesian=function(e,n,a){var R=r(n)?n.oneOverRadii:c,T=r(n)?n.oneOverRadiiSquared:f,h=r(n)?n._centerToleranceSquared:_,A=i(e,R,T,h,E);if(r(A)){var d=t.multiplyComponents(A,T,s);d=t.normalize(d,d);var S=t.subtract(e,A,l),m=Math.atan2(d.y,d.x),N=Math.asin(d.z),C=o.sign(t.dot(S,e))*t.magnitude(S);return r(a)?(a.longitude=m,a.latitude=N,a.height=C,a):new u(m,N,C)}},u.clone=function(t,e){if(r(t))return r(e)?(e.longitude=t.longitude,e.latitude=t.latitude,e.height=t.height,e):new u(t.longitude,t.latitude,t.height)},u.equals=function(t,e){return t===e||r(t)&&r(e)&&t.longitude===e.longitude&&t.latitude===e.latitude&&t.height===e.height},u.equalsEpsilon=function(t,e,n){return t===e||r(t)&&r(e)&&Math.abs(t.longitude-e.longitude)<=n&&Math.abs(t.latitude-e.latitude)<=n&&Math.abs(t.height-e.height)<=n},u.ZERO=a(new u(0,0,0)),u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.prototype.equalsEpsilon=function(t,e){return u.equalsEpsilon(this,t,e)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(t){"use strict";var e=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(t){return!1}}(),r=Object.defineProperties;return e&&t(r)||(r=function(t){return t}),r}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,r,n,a,o,i,u,s){"use strict";function E(e,n,a,o){n=r(n,0),a=r(a,0),o=r(o,0),e._radii=new t(n,a,o),e._radiiSquared=new t(n*n,a*a,o*o),e._radiiToTheFourth=new t(n*n*n*n,a*a*a*a,o*o*o*o),e._oneOverRadii=new t(0===n?0:1/n,0===a?0:1/a,0===o?0:1/o),e._oneOverRadiiSquared=new t(0===n?0:1/(n*n),0===a?0:1/(a*a),0===o?0:1/(o*o)),e._minimumRadius=Math.min(n,a,o),e._maximumRadius=Math.max(n,a,o),e._centerToleranceSquared=u.EPSILON1,0!==e._radiiSquared.z&&(e._sqauredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function l(t,e,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,this._sqauredXOverSquaredZ=void 0,E(this,t,e,r)}a(l.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}}}),l.clone=function(e,r){if(n(e)){var a=e._radii;return n(r)?(t.clone(a,r._radii),t.clone(e._radiiSquared,r._radiiSquared),t.clone(e._radiiToTheFourth,r._radiiToTheFourth),t.clone(e._oneOverRadii,r._oneOverRadii),t.clone(e._oneOverRadiiSquared,r._oneOverRadiiSquared),r._minimumRadius=e._minimumRadius,r._maximumRadius=e._maximumRadius,r._centerToleranceSquared=e._centerToleranceSquared,r):new l(a.x,a.y,a.z)}},l.fromCartesian3=function(t,e){return n(e)||(e=new l),n(t)?(E(e,t.x,t.y,t.z),e):e},l.WGS84=i(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=i(new l(1,1,1)),l.MOON=i(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(t){return l.clone(this,t)},l.packedLength=t.packedLength,l.pack=function(e,n,a){return a=r(a,0),t.pack(e._radii,n,a),n},l.unpack=function(e,n,a){n=r(n,0);var o=t.unpack(e,n);return l.fromCartesian3(o,a)},l.prototype.geocentricSurfaceNormal=t.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(e,r){var a=e.longitude,o=e.latitude,i=Math.cos(o),u=i*Math.cos(a),s=i*Math.sin(a),E=Math.sin(o);return n(r)||(r=new t),r.x=u,r.y=s,r.z=E,t.normalize(r,r)},l.prototype.geodeticSurfaceNormal=function(e,r){return n(r)||(r=new t),r=t.multiplyComponents(e,this._oneOverRadiiSquared,r),t.normalize(r,r)};var c=new t,f=new t;l.prototype.cartographicToCartesian=function(e,r){var a=c,o=f;this.geodeticSurfaceNormalCartographic(e,a),t.multiplyComponents(this._radiiSquared,a,o);var i=Math.sqrt(t.dot(a,o));return t.divideByScalar(o,i,o),t.multiplyByScalar(a,e.height,a),n(r)||(r=new t),t.add(o,a,r)},l.prototype.cartographicArrayToCartesianArray=function(t,e){var r=t.length;n(e)?e.length=r:e=new Array(r);for(var a=0;a<r;a++)e[a]=this.cartographicToCartesian(t[a],e[a]);return e};var _=new t,R=new t,T=new t;return l.prototype.cartesianToCartographic=function(r,a){var o=this.scaleToGeodeticSurface(r,R);if(n(o)){var i=this.geodeticSurfaceNormal(o,_),s=t.subtract(r,o,T),E=Math.atan2(i.y,i.x),l=Math.asin(i.z),c=u.sign(t.dot(s,r))*t.magnitude(s);return n(a)?(a.longitude=E,a.latitude=l,a.height=c,a):new e(E,l,c)}},l.prototype.cartesianArrayToCartographicArray=function(t,e){var r=t.length;n(e)?e.length=r:e=new Array(r);for(var a=0;a<r;++a)e[a]=this.cartesianToCartographic(t[a],e[a]);return e},l.prototype.scaleToGeodeticSurface=function(t,e){return s(t,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,e)},l.prototype.scaleToGeocentricSurface=function(e,r){n(r)||(r=new t);var a=e.x,o=e.y,i=e.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+o*o*u.y+i*i*u.z);return t.multiplyByScalar(e,s,r)},l.prototype.transformPositionToScaledSpace=function(e,r){return n(r)||(r=new t),t.multiplyComponents(e,this._oneOverRadii,r)},l.prototype.transformPositionFromScaledSpace=function(e,r){return n(r)||(r=new t),t.multiplyComponents(e,this._radii,r)},l.prototype.equals=function(e){return this===e||n(e)&&t.equals(this._radii,e._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,a,o){a=r(a,0);var i=this._sqauredXOverSquaredZ;if(n(o)||(o=new t),o.x=0,o.y=0,o.z=e.z*(1-i),!(Math.abs(o.z)>=this._radii.z-a))return o},l}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(t,e,r,n,a,o,i){"use strict";function u(t){this._ellipsoid=r(t,i.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(e,r){var a=this._semimajorAxis,o=e.longitude*a,i=e.latitude*a,u=e.height;return n(r)?(r.x=o,r.y=i,r.z=u,r):new t(o,i,u)},u.prototype.unproject=function(t,r){var a=this._oneOverSemimajorAxis,o=t.x*a,i=t.y*a,u=t.z;return n(r)?(r.longitude=o,r.latitude=i,r.height=u,r):new e(o,i,u)},u}),define("Core/Intersect",["./freezeObject"],function(t){"use strict";var e={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return t(e)}),define("Core/Interval",["./defaultValue"],function(t){"use strict";function e(e,r){this.start=t(e,0),this.stop=t(r,0)}return e}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(t,e,r,n,a,o,i){"use strict";function u(t,r,n,a,o,i,u,s,E){this[0]=e(t,0),this[1]=e(a,0),this[2]=e(u,0),this[3]=e(r,0),this[4]=e(o,0),this[5]=e(s,0),this[6]=e(n,0),this[7]=e(i,0),this[8]=e(E,0)}function s(t){for(var e=0,r=0;r<9;++r){var n=t[r];e+=n*n}return Math.sqrt(e)}function E(t){for(var e=0,r=0;r<3;++r){var n=t[u.getElementIndex(R[r],_[r])];e+=2*n*n}return Math.sqrt(e)}function l(t,e){for(var r=i.EPSILON15,n=0,a=1,o=0;o<3;++o){var s=Math.abs(t[u.getElementIndex(R[o],_[o])]);s>n&&(a=o,n=s)}var E=1,l=0,c=_[a],f=R[a];if(Math.abs(t[u.getElementIndex(f,c)])>r){var T,h=t[u.getElementIndex(f,f)],A=t[u.getElementIndex(c,c)],d=t[u.getElementIndex(f,c)],S=(h-A)/2/d;T=S<0?-1/(-S+Math.sqrt(1+S*S)):1/(S+Math.sqrt(1+S*S)),E=1/Math.sqrt(1+T*T),l=T*E}return e=u.clone(u.IDENTITY,e),e[u.getElementIndex(c,c)]=e[u.getElementIndex(f,f)]=E,e[u.getElementIndex(f,c)]=l,e[u.getElementIndex(c,f)]=-l,e}u.packedLength=9,u.pack=function(t,r,n){return n=e(n,0),r[n++]=t[0],r[n++]=t[1],r[n++]=t[2],r[n++]=t[3],r[n++]=t[4],r[n++]=t[5],r[n++]=t[6],r[n++]=t[7],r[n++]=t[8],r},u.unpack=function(t,n,a){return n=e(n,0),r(a)||(a=new u),a[0]=t[n++],a[1]=t[n++],a[2]=t[n++],a[3]=t[n++],a[4]=t[n++],a[5]=t[n++],a[6]=t[n++],a[7]=t[n++],a[8]=t[n++],a},u.clone=function(t,e){if(r(t))return r(e)?(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):new u(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8])},u.fromArray=function(t,n,a){return n=e(n,0),r(a)||(a=new u),a[0]=t[n],a[1]=t[n+1],a[2]=t[n+2],a[3]=t[n+3],a[4]=t[n+4],a[5]=t[n+5],a[6]=t[n+6],a[7]=t[n+7],a[8]=t[n+8],a},u.fromColumnMajorArray=function(t,e){return u.clone(t,e)},u.fromRowMajorArray=function(t,e){return r(e)?(e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],e):new u(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},u.fromQuaternion=function(t,e){var n=t.x*t.x,a=t.x*t.y,o=t.x*t.z,i=t.x*t.w,s=t.y*t.y,E=t.y*t.z,l=t.y*t.w,c=t.z*t.z,f=t.z*t.w,_=t.w*t.w,R=n-s-c+_,T=2*(a-f),h=2*(o+l),A=2*(a+f),d=-n+s-c+_,S=2*(E-i),m=2*(o-l),N=2*(E+i),C=-n-s+c+_;return r(e)?(e[0]=R,e[1]=A,e[2]=m,e[3]=T,e[4]=d,e[5]=N,e[6]=h,e[7]=S,e[8]=C,e):new u(R,T,h,A,d,S,m,N,C)},u.fromHeadingPitchRoll=function(t,e){var n=Math.cos(-t.pitch),a=Math.cos(-t.heading),o=Math.cos(t.roll),i=Math.sin(-t.pitch),s=Math.sin(-t.heading),E=Math.sin(t.roll),l=n*a,c=-o*s+E*i*a,f=E*s+o*i*a,_=n*s,R=o*a+E*i*s,T=-i*o+o*i*s,h=-i,A=E*n,d=o*n;return r(e)?(e[0]=l,e[1]=_,e[2]=h,e[3]=c,e[4]=R,e[5]=A,e[6]=f,e[7]=T,e[8]=d,e):new u(l,c,f,_,R,T,h,A,d)},u.fromScale=function(t,e){return r(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=t.y,e[5]=0,e[6]=0,e[7]=0,e[8]=t.z,e):new u(t.x,0,0,0,t.y,0,0,0,t.z)},u.fromUniformScale=function(t,e){return r(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=t,e[5]=0,e[6]=0,e[7]=0,e[8]=t,e):new u(t,0,0,0,t,0,0,0,t)},u.fromCrossProduct=function(t,e){return r(e)?(e[0]=0,e[1]=t.z,e[2]=-t.y,e[3]=-t.z,e[4]=0,e[5]=t.x,e[6]=t.y,e[7]=-t.x,e[8]=0,e):new u(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},u.fromRotationX=function(t,e){var n=Math.cos(t),a=Math.sin(t);return r(e)?(e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=n,e[5]=a,e[6]=0,e[7]=-a,e[8]=n,e):new u(1,0,0,0,n,-a,0,a,n)},u.fromRotationY=function(t,e){var n=Math.cos(t),a=Math.sin(t);return r(e)?(e[0]=n,e[1]=0,e[2]=-a,e[3]=0,e[4]=1,e[5]=0,e[6]=a,e[7]=0,e[8]=n,e):new u(n,0,a,0,1,0,-a,0,n)},u.fromRotationZ=function(t,e){var n=Math.cos(t),a=Math.sin(t);return r(e)?(e[0]=n,e[1]=a,e[2]=0,e[3]=-a,e[4]=n,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e):new u(n,-a,0,a,n,0,0,0,1)},u.toArray=function(t,e){return r(e)?(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):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},u.getElementIndex=function(t,e){return 3*t+e},u.getColumn=function(t,e,r){var n=3*e,a=t[n],o=t[n+1],i=t[n+2];return r.x=a,r.y=o,r.z=i,r},u.setColumn=function(t,e,r,n){n=u.clone(t,n);var a=3*e;return n[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n},u.getRow=function(t,e,r){var n=t[e],a=t[e+3],o=t[e+6];return r.x=n,r.y=a,r.z=o,r},u.setRow=function(t,e,r,n){return n=u.clone(t,n),n[e]=r.x,n[e+3]=r.y,n[e+6]=r.z,n};var c=new t;u.getScale=function(e,r){return r.x=t.magnitude(t.fromElements(e[0],e[1],e[2],c)),r.y=t.magnitude(t.fromElements(e[3],e[4],e[5],c)),r.z=t.magnitude(t.fromElements(e[6],e[7],e[8],c)),r};var f=new t;u.getMaximumScale=function(e){return u.getScale(e,f),t.maximumComponent(f)},u.multiply=function(t,e,r){var n=t[0]*e[0]+t[3]*e[1]+t[6]*e[2],a=t[1]*e[0]+t[4]*e[1]+t[7]*e[2],o=t[2]*e[0]+t[5]*e[1]+t[8]*e[2],i=t[0]*e[3]+t[3]*e[4]+t[6]*e[5],u=t[1]*e[3]+t[4]*e[4]+t[7]*e[5],s=t[2]*e[3]+t[5]*e[4]+t[8]*e[5],E=t[0]*e[6]+t[3]*e[7]+t[6]*e[8],l=t[1]*e[6]+t[4]*e[7]+t[7]*e[8],c=t[2]*e[6]+t[5]*e[7]+t[8]*e[8];return r[0]=n,r[1]=a,r[2]=o,r[3]=i,r[4]=u,r[5]=s,r[6]=E,r[7]=l,r[8]=c,r},u.add=function(t,e,r){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r[2]=t[2]+e[2],r[3]=t[3]+e[3],r[4]=t[4]+e[4],r[5]=t[5]+e[5],r[6]=t[6]+e[6],r[7]=t[7]+e[7],r[8]=t[8]+e[8],r},u.subtract=function(t,e,r){return r[0]=t[0]-e[0],r[1]=t[1]-e[1],r[2]=t[2]-e[2],r[3]=t[3]-e[3],r[4]=t[4]-e[4],r[5]=t[5]-e[5],r[6]=t[6]-e[6],r[7]=t[7]-e[7],r[8]=t[8]-e[8],r},u.multiplyByVector=function(t,e,r){var n=e.x,a=e.y,o=e.z,i=t[0]*n+t[3]*a+t[6]*o,u=t[1]*n+t[4]*a+t[7]*o,s=t[2]*n+t[5]*a+t[8]*o;return r.x=i,r.y=u,r.z=s,r},u.multiplyByScalar=function(t,e,r){return r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e,r[3]=t[3]*e,r[4]=t[4]*e,r[5]=t[5]*e,r[6]=t[6]*e,r[7]=t[7]*e,r[8]=t[8]*e,r},u.multiplyByScale=function(t,e,r){return r[0]=t[0]*e.x,r[1]=t[1]*e.x,r[2]=t[2]*e.x,r[3]=t[3]*e.y,r[4]=t[4]*e.y,r[5]=t[5]*e.y,r[6]=t[6]*e.z,r[7]=t[7]*e.z,r[8]=t[8]*e.z,r},u.negate=function(t,e){return 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},u.transpose=function(t,e){var r=t[0],n=t[3],a=t[6],o=t[1],i=t[4],u=t[7],s=t[2],E=t[5],l=t[8];return e[0]=r,e[1]=n,e[2]=a,e[3]=o,e[4]=i,e[5]=u,e[6]=s,e[7]=E,e[8]=l,e};var _=[1,0,0],R=[2,2,1],T=new u,h=new u;return u.computeEigenDecomposition=function(t,e){var n=i.EPSILON20,a=10,o=0,c=0;r(e)||(e={});for(var f=e.unitary=u.clone(u.IDENTITY,e.unitary),_=e.diagonal=u.clone(t,e.diagonal),R=n*s(_);c<a&&E(_)>R;)l(_,T),u.transpose(T,h),u.multiply(_,T,_),u.multiply(h,_,_),u.multiply(f,T,f),++o>2&&(++c,o=0);return e},u.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e},u.determinant=function(t){var e=t[0],r=t[3],n=t[6],a=t[1],o=t[4],i=t[7],u=t[2],s=t[5],E=t[8];return e*(o*E-s*i)+a*(s*n-r*E)+u*(r*i-o*n)},u.inverse=function(t,e){var r=t[0],n=t[1],a=t[2],o=t[3],i=t[4],s=t[5],E=t[6],l=t[7],c=t[8],f=u.determinant(t);e[0]=i*c-l*s,e[1]=l*a-n*c,e[2]=n*s-i*a,e[3]=E*s-o*c,e[4]=r*c-E*a,e[5]=o*a-r*s,e[6]=o*l-E*i,e[7]=E*n-r*l,e[8]=r*i-o*n;var _=1/f;return u.multiplyByScalar(e,_,e)},u.equals=function(t,e){return t===e||r(t)&&r(e)&&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]},u.equalsEpsilon=function(t,e,n){return t===e||r(t)&&r(e)&&Math.abs(t[0]-e[0])<=n&&Math.abs(t[1]-e[1])<=n&&Math.abs(t[2]-e[2])<=n&&Math.abs(t[3]-e[3])<=n&&Math.abs(t[4]-e[4])<=n&&Math.abs(t[5]-e[5])<=n&&Math.abs(t[6]-e[6])<=n&&Math.abs(t[7]-e[7])<=n&&Math.abs(t[8]-e[8])<=n},u.IDENTITY=o(new u(1,0,0,0,1,0,0,0,1)),u.ZERO=o(new u(0,0,0,0,0,0,0,0,0)),u.COLUMN0ROW0=0,u.COLUMN0ROW1=1,u.COLUMN0ROW2=2,u.COLUMN1ROW0=3,u.COLUMN1ROW1=4,u.COLUMN1ROW2=5,u.COLUMN2ROW0=6,u.COLUMN2ROW1=7,u.COLUMN2ROW2=8,n(u.prototype,{length:{get:function(){return u.packedLength}}}),u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.equalsArray=function(t,e,r){return t[0]===e[r]&&t[1]===e[r+1]&&t[2]===e[r+2]&&t[3]===e[r+3]&&t[4]===e[r+4]&&t[5]===e[r+5]&&t[6]===e[r+6]&&t[7]===e[r+7]&&t[8]===e[r+8]},u.prototype.equalsEpsilon=function(t,e){return u.equalsEpsilon(this,t,e)},u.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},u}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,r,n,a){"use strict";function o(e,r,n,a){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0),this.w=t(a,0)}o.fromElements=function(t,r,n,a,i){return e(i)?(i.x=t,i.y=r,i.z=n,i.w=a,i):new o(t,r,n,a)},o.fromColor=function(t,r){return e(r)?(r.x=t.red,r.y=t.green,r.z=t.blue,r.w=t.alpha,r):new o(t.red,t.green,t.blue,t.alpha)},o.clone=function(t,r){if(e(t))return e(r)?(r.x=t.x,r.y=t.y,r.z=t.z,r.w=t.w,r):new o(t.x,t.y,t.z,t.w)},o.packedLength=4,o.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n++]=e.z,r[n]=e.w,r},o.unpack=function(r,n,a){return n=t(n,0),e(a)||(a=new o),a.x=r[n++],a.y=r[n++],a.z=r[n++],a.w=r[n],a},o.packArray=function(t,r){var n=t.length;e(r)?r.length=4*n:r=new Array(4*n);for(var a=0;a<n;++a)o.pack(t[a],r,4*a);return r},o.unpackArray=function(t,r){var n=t.length;e(r)?r.length=n/4:r=new Array(n/4);for(var a=0;a<n;a+=4){var i=a/4;r[i]=o.unpack(t,a,r[i])}return r},o.fromArray=o.unpack,o.maximumComponent=function(t){return Math.max(t.x,t.y,t.z,t.w)},o.minimumComponent=function(t){return Math.min(t.x,t.y,t.z,t.w)},o.minimumByComponent=function(t,e,r){return r.x=Math.min(t.x,e.x),r.y=Math.min(t.y,e.y),r.z=Math.min(t.z,e.z),r.w=Math.min(t.w,e.w),r},o.maximumByComponent=function(t,e,r){return r.x=Math.max(t.x,e.x),r.y=Math.max(t.y,e.y),r.z=Math.max(t.z,e.z),r.w=Math.max(t.w,e.w),r},o.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w},o.magnitude=function(t){return Math.sqrt(o.magnitudeSquared(t))};var i=new o;o.distance=function(t,e){return o.subtract(t,e,i),o.magnitude(i)},o.distanceSquared=function(t,e){return o.subtract(t,e,i),o.magnitudeSquared(i)},o.normalize=function(t,e){var r=o.magnitude(t);return e.x=t.x/r,e.y=t.y/r,e.z=t.z/r,e.w=t.w/r,e},o.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z+t.w*e.w},o.multiplyComponents=function(t,e,r){return r.x=t.x*e.x,r.y=t.y*e.y,r.z=t.z*e.z,r.w=t.w*e.w,r},o.divideComponents=function(t,e,r){return r.x=t.x/e.x,r.y=t.y/e.y,r.z=t.z/e.z,r.w=t.w/e.w,r},o.add=function(t,e,r){return r.x=t.x+e.x,r.y=t.y+e.y,r.z=t.z+e.z,r.w=t.w+e.w,r},o.subtract=function(t,e,r){return r.x=t.x-e.x,r.y=t.y-e.y,r.z=t.z-e.z,r.w=t.w-e.w,r},o.multiplyByScalar=function(t,e,r){return r.x=t.x*e,r.y=t.y*e,r.z=t.z*e,r.w=t.w*e,r},o.divideByScalar=function(t,e,r){return r.x=t.x/e,r.y=t.y/e,r.z=t.z/e,r.w=t.w/e,r},o.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e.w=-t.w,e},o.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e.w=Math.abs(t.w),e};var u=new o;o.lerp=function(t,e,r,n){return o.multiplyByScalar(e,r,u),n=o.multiplyByScalar(t,1-r,n),o.add(u,n,n)};var s=new o;return o.mostOrthogonalAxis=function(t,e){var r=o.normalize(t,s);return o.abs(r,r),e=r.x<=r.y?r.x<=r.z?r.x<=r.w?o.clone(o.UNIT_X,e):o.clone(o.UNIT_W,e):r.z<=r.w?o.clone(o.UNIT_Z,e):o.clone(o.UNIT_W,e):r.y<=r.z?r.y<=r.w?o.clone(o.UNIT_Y,e):o.clone(o.UNIT_W,e):r.z<=r.w?o.clone(o.UNIT_Z,e):o.clone(o.UNIT_W,e)},o.equals=function(t,r){return t===r||e(t)&&e(r)&&t.x===r.x&&t.y===r.y&&t.z===r.z&&t.w===r.w},o.equalsArray=function(t,e,r){return t.x===e[r]&&t.y===e[r+1]&&t.z===e[r+2]&&t.w===e[r+3]},o.equalsEpsilon=function(t,r,n,o){return t===r||e(t)&&e(r)&&a.equalsEpsilon(t.x,r.x,n,o)&&a.equalsEpsilon(t.y,r.y,n,o)&&a.equalsEpsilon(t.z,r.z,n,o)&&a.equalsEpsilon(t.w,r.w,n,o)},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(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.prototype.equalsEpsilon=function(t,e,r){return o.equalsEpsilon(this,t,e,r)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(t){"use strict";function e(t){this.name="RuntimeError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(t,e,r,n,a,o,i,u,s,E){"use strict";function l(t,e,n,a,o,i,u,s,E,l,c,f,_,R,T,h){this[0]=r(t,0),this[1]=r(o,0),this[2]=r(E,0),this[3]=r(_,0),this[4]=r(e,0), -this[5]=r(i,0),this[6]=r(l,0),this[7]=r(R,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(c,0),this[11]=r(T,0),this[12]=r(a,0),this[13]=r(s,0),this[14]=r(f,0),this[15]=r(h,0)}l.packedLength=16,l.pack=function(t,e,n){return n=r(n,0),e[n++]=t[0],e[n++]=t[1],e[n++]=t[2],e[n++]=t[3],e[n++]=t[4],e[n++]=t[5],e[n++]=t[6],e[n++]=t[7],e[n++]=t[8],e[n++]=t[9],e[n++]=t[10],e[n++]=t[11],e[n++]=t[12],e[n++]=t[13],e[n++]=t[14],e[n]=t[15],e},l.unpack=function(t,e,a){return e=r(e,0),n(a)||(a=new l),a[0]=t[e++],a[1]=t[e++],a[2]=t[e++],a[3]=t[e++],a[4]=t[e++],a[5]=t[e++],a[6]=t[e++],a[7]=t[e++],a[8]=t[e++],a[9]=t[e++],a[10]=t[e++],a[11]=t[e++],a[12]=t[e++],a[13]=t[e++],a[14]=t[e++],a[15]=t[e],a},l.clone=function(t,e){if(n(t))return n(e)?(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],e):new l(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15])},l.fromArray=l.unpack,l.fromColumnMajorArray=function(t,e){return l.clone(t,e)},l.fromRowMajorArray=function(t,e){return n(e)?(e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15],e):new l(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},l.fromRotationTranslation=function(e,a,o){return a=r(a,t.ZERO),n(o)?(o[0]=e[0],o[1]=e[1],o[2]=e[2],o[3]=0,o[4]=e[3],o[5]=e[4],o[6]=e[5],o[7]=0,o[8]=e[6],o[9]=e[7],o[10]=e[8],o[11]=0,o[12]=a.x,o[13]=a.y,o[14]=a.z,o[15]=1,o):new l(e[0],e[3],e[6],a.x,e[1],e[4],e[7],a.y,e[2],e[5],e[8],a.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(t,e,r,a){n(a)||(a=new l);var o=r.x,i=r.y,u=r.z,s=e.x*e.x,E=e.x*e.y,c=e.x*e.z,f=e.x*e.w,_=e.y*e.y,R=e.y*e.z,T=e.y*e.w,h=e.z*e.z,A=e.z*e.w,d=e.w*e.w,S=s-_-h+d,m=2*(E-A),N=2*(c+T),C=2*(E+A),I=-s+_-h+d,p=2*(R-f),M=2*(c-T),O=2*(R+f),g=-s-_+h+d;return a[0]=S*o,a[1]=C*o,a[2]=M*o,a[3]=0,a[4]=m*i,a[5]=I*i,a[6]=O*i,a[7]=0,a[8]=N*u,a[9]=p*u,a[10]=g*u,a[11]=0,a[12]=t.x,a[13]=t.y,a[14]=t.z,a[15]=1,a},l.fromTranslationRotationScale=function(t,e){return l.fromTranslationQuaternionRotationScale(t.translation,t.rotation,t.scale,e)},l.fromTranslation=function(t,e){return l.fromRotationTranslation(s.IDENTITY,t,e)},l.fromScale=function(t,e){return n(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t.y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t.z,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new l(t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1)},l.fromUniformScale=function(t,e){return n(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new l(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1)};var c=new t,f=new t,_=new t;l.fromCamera=function(e,r){var a=e.position,o=e.direction,i=e.up;t.normalize(o,c),t.normalize(t.cross(c,i,f),f),t.normalize(t.cross(f,c,_),_);var u=f.x,s=f.y,E=f.z,R=c.x,T=c.y,h=c.z,A=_.x,d=_.y,S=_.z,m=a.x,N=a.y,C=a.z,I=u*-m+s*-N+E*-C,p=A*-m+d*-N+S*-C,M=R*m+T*N+h*C;return n(r)?(r[0]=u,r[1]=A,r[2]=-R,r[3]=0,r[4]=s,r[5]=d,r[6]=-T,r[7]=0,r[8]=E,r[9]=S,r[10]=-h,r[11]=0,r[12]=I,r[13]=p,r[14]=M,r[15]=1,r):new l(u,s,E,I,A,d,S,p,-R,-T,-h,M,0,0,0,1)},l.computePerspectiveFieldOfView=function(t,e,r,n,a){var o=Math.tan(.5*t),i=1/o,u=i/e,s=(n+r)/(r-n),E=2*n*r/(r-n);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=i,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=E,a[15]=0,a},l.computeOrthographicOffCenter=function(t,e,r,n,a,o,i){var u=1/(e-t),s=1/(n-r),E=1/(o-a),l=-(e+t)*u,c=-(n+r)*s,f=-(o+a)*E;return u*=2,s*=2,E*=-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]=E,i[11]=0,i[12]=l,i[13]=c,i[14]=f,i[15]=1,i},l.computePerspectiveOffCenter=function(t,e,r,n,a,o,i){var u=2*a/(e-t),s=2*a/(n-r),E=(e+t)/(e-t),l=(n+r)/(n-r),c=-(o+a)/(o-a),f=-1,_=-2*o*a/(o-a);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]=E,i[9]=l,i[10]=c,i[11]=f,i[12]=0,i[13]=0,i[14]=_,i[15]=0,i},l.computeInfinitePerspectiveOffCenter=function(t,e,r,n,a,o){var i=2*a/(e-t),u=2*a/(n-r),s=(e+t)/(e-t),E=(n+r)/(n-r),l=-1,c=-1,f=-2*a;return o[0]=i,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=u,o[6]=0,o[7]=0,o[8]=s,o[9]=E,o[10]=l,o[11]=c,o[12]=0,o[13]=0,o[14]=f,o[15]=0,o},l.computeViewportTransformation=function(t,e,n,a){t=r(t,r.EMPTY_OBJECT);var o=r(t.x,0),i=r(t.y,0),u=r(t.width,0),s=r(t.height,0);e=r(e,0),n=r(n,1);var E=.5*u,l=.5*s,c=.5*(n-e),f=E,_=l,R=c,T=o+E,h=i+l,A=e+c,d=1;return a[0]=f,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=_,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=R,a[11]=0,a[12]=T,a[13]=h,a[14]=A,a[15]=d,a},l.computeView=function(e,r,n,a,o){return o[0]=a.x,o[1]=n.x,o[2]=-r.x,o[3]=0,o[4]=a.y,o[5]=n.y,o[6]=-r.y,o[7]=0,o[8]=a.z,o[9]=n.z,o[10]=-r.z,o[11]=0,o[12]=-t.dot(a,e),o[13]=-t.dot(n,e),o[14]=t.dot(r,e),o[15]=1,o},l.toArray=function(t,e){return n(e)?(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],e):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]},l.getElementIndex=function(t,e){return 4*t+e},l.getColumn=function(t,e,r){var n=4*e,a=t[n],o=t[n+1],i=t[n+2],u=t[n+3];return r.x=a,r.y=o,r.z=i,r.w=u,r},l.setColumn=function(t,e,r,n){n=l.clone(t,n);var a=4*e;return n[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n[a+3]=r.w,n},l.setTranslation=function(t,e,r){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[8]=t[8],r[9]=t[9],r[10]=t[10],r[11]=t[11],r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=t[15],r},l.getRow=function(t,e,r){var n=t[e],a=t[e+4],o=t[e+8],i=t[e+12];return r.x=n,r.y=a,r.z=o,r.w=i,r},l.setRow=function(t,e,r,n){return n=l.clone(t,n),n[e]=r.x,n[e+4]=r.y,n[e+8]=r.z,n[e+12]=r.w,n};var R=new t;l.getScale=function(e,r){return r.x=t.magnitude(t.fromElements(e[0],e[1],e[2],R)),r.y=t.magnitude(t.fromElements(e[4],e[5],e[6],R)),r.z=t.magnitude(t.fromElements(e[8],e[9],e[10],R)),r};var T=new t;l.getMaximumScale=function(e){return l.getScale(e,T),t.maximumComponent(T)},l.multiply=function(t,e,r){var n=t[0],a=t[1],o=t[2],i=t[3],u=t[4],s=t[5],E=t[6],l=t[7],c=t[8],f=t[9],_=t[10],R=t[11],T=t[12],h=t[13],A=t[14],d=t[15],S=e[0],m=e[1],N=e[2],C=e[3],I=e[4],p=e[5],M=e[6],O=e[7],g=e[8],y=e[9],F=e[10],L=e[11],v=e[12],U=e[13],D=e[14],P=e[15],B=n*S+u*m+c*N+T*C,w=a*S+s*m+f*N+h*C,x=o*S+E*m+_*N+A*C,G=i*S+l*m+R*N+d*C,b=n*I+u*p+c*M+T*O,z=a*I+s*p+f*M+h*O,H=o*I+E*p+_*M+A*O,V=i*I+l*p+R*M+d*O,q=n*g+u*y+c*F+T*L,X=a*g+s*y+f*F+h*L,W=o*g+E*y+_*F+A*L,Y=i*g+l*y+R*F+d*L,K=n*v+u*U+c*D+T*P,k=a*v+s*U+f*D+h*P,Z=o*v+E*U+_*D+A*P,j=i*v+l*U+R*D+d*P;return r[0]=B,r[1]=w,r[2]=x,r[3]=G,r[4]=b,r[5]=z,r[6]=H,r[7]=V,r[8]=q,r[9]=X,r[10]=W,r[11]=Y,r[12]=K,r[13]=k,r[14]=Z,r[15]=j,r},l.add=function(t,e,r){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r[2]=t[2]+e[2],r[3]=t[3]+e[3],r[4]=t[4]+e[4],r[5]=t[5]+e[5],r[6]=t[6]+e[6],r[7]=t[7]+e[7],r[8]=t[8]+e[8],r[9]=t[9]+e[9],r[10]=t[10]+e[10],r[11]=t[11]+e[11],r[12]=t[12]+e[12],r[13]=t[13]+e[13],r[14]=t[14]+e[14],r[15]=t[15]+e[15],r},l.subtract=function(t,e,r){return r[0]=t[0]-e[0],r[1]=t[1]-e[1],r[2]=t[2]-e[2],r[3]=t[3]-e[3],r[4]=t[4]-e[4],r[5]=t[5]-e[5],r[6]=t[6]-e[6],r[7]=t[7]-e[7],r[8]=t[8]-e[8],r[9]=t[9]-e[9],r[10]=t[10]-e[10],r[11]=t[11]-e[11],r[12]=t[12]-e[12],r[13]=t[13]-e[13],r[14]=t[14]-e[14],r[15]=t[15]-e[15],r},l.multiplyTransformation=function(t,e,r){var n=t[0],a=t[1],o=t[2],i=t[4],u=t[5],s=t[6],E=t[8],l=t[9],c=t[10],f=t[12],_=t[13],R=t[14],T=e[0],h=e[1],A=e[2],d=e[4],S=e[5],m=e[6],N=e[8],C=e[9],I=e[10],p=e[12],M=e[13],O=e[14],g=n*T+i*h+E*A,y=a*T+u*h+l*A,F=o*T+s*h+c*A,L=n*d+i*S+E*m,v=a*d+u*S+l*m,U=o*d+s*S+c*m,D=n*N+i*C+E*I,P=a*N+u*C+l*I,B=o*N+s*C+c*I,w=n*p+i*M+E*O+f,x=a*p+u*M+l*O+_,G=o*p+s*M+c*O+R;return r[0]=g,r[1]=y,r[2]=F,r[3]=0,r[4]=L,r[5]=v,r[6]=U,r[7]=0,r[8]=D,r[9]=P,r[10]=B,r[11]=0,r[12]=w,r[13]=x,r[14]=G,r[15]=1,r},l.multiplyByMatrix3=function(t,e,r){var n=t[0],a=t[1],o=t[2],i=t[4],u=t[5],s=t[6],E=t[8],l=t[9],c=t[10],f=e[0],_=e[1],R=e[2],T=e[3],h=e[4],A=e[5],d=e[6],S=e[7],m=e[8],N=n*f+i*_+E*R,C=a*f+u*_+l*R,I=o*f+s*_+c*R,p=n*T+i*h+E*A,M=a*T+u*h+l*A,O=o*T+s*h+c*A,g=n*d+i*S+E*m,y=a*d+u*S+l*m,F=o*d+s*S+c*m;return r[0]=N,r[1]=C,r[2]=I,r[3]=0,r[4]=p,r[5]=M,r[6]=O,r[7]=0,r[8]=g,r[9]=y,r[10]=F,r[11]=0,r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15],r},l.multiplyByTranslation=function(t,e,r){var n=e.x,a=e.y,o=e.z,i=n*t[0]+a*t[4]+o*t[8]+t[12],u=n*t[1]+a*t[5]+o*t[9]+t[13],s=n*t[2]+a*t[6]+o*t[10]+t[14];return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[8]=t[8],r[9]=t[9],r[10]=t[10],r[11]=t[11],r[12]=i,r[13]=u,r[14]=s,r[15]=t[15],r};var h=new t;l.multiplyByUniformScale=function(t,e,r){return h.x=e,h.y=e,h.z=e,l.multiplyByScale(t,h,r)},l.multiplyByScale=function(t,e,r){var n=e.x,a=e.y,o=e.z;return 1===n&&1===a&&1===o?l.clone(t,r):(r[0]=n*t[0],r[1]=n*t[1],r[2]=n*t[2],r[3]=0,r[4]=a*t[4],r[5]=a*t[5],r[6]=a*t[6],r[7]=0,r[8]=o*t[8],r[9]=o*t[9],r[10]=o*t[10],r[11]=0,r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=1,r)},l.multiplyByVector=function(t,e,r){var n=e.x,a=e.y,o=e.z,i=e.w,u=t[0]*n+t[4]*a+t[8]*o+t[12]*i,s=t[1]*n+t[5]*a+t[9]*o+t[13]*i,E=t[2]*n+t[6]*a+t[10]*o+t[14]*i,l=t[3]*n+t[7]*a+t[11]*o+t[15]*i;return r.x=u,r.y=s,r.z=E,r.w=l,r},l.multiplyByPointAsVector=function(t,e,r){var n=e.x,a=e.y,o=e.z,i=t[0]*n+t[4]*a+t[8]*o,u=t[1]*n+t[5]*a+t[9]*o,s=t[2]*n+t[6]*a+t[10]*o;return r.x=i,r.y=u,r.z=s,r},l.multiplyByPoint=function(t,e,r){var n=e.x,a=e.y,o=e.z,i=t[0]*n+t[4]*a+t[8]*o+t[12],u=t[1]*n+t[5]*a+t[9]*o+t[13],s=t[2]*n+t[6]*a+t[10]*o+t[14];return r.x=i,r.y=u,r.z=s,r},l.multiplyByScalar=function(t,e,r){return r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e,r[3]=t[3]*e,r[4]=t[4]*e,r[5]=t[5]*e,r[6]=t[6]*e,r[7]=t[7]*e,r[8]=t[8]*e,r[9]=t[9]*e,r[10]=t[10]*e,r[11]=t[11]*e,r[12]=t[12]*e,r[13]=t[13]*e,r[14]=t[14]*e,r[15]=t[15]*e,r},l.negate=function(t,e){return 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],e},l.transpose=function(t,e){var r=t[1],n=t[2],a=t[3],o=t[6],i=t[7],u=t[11];return e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=o,e[10]=t[10],e[11]=t[14],e[12]=a,e[13]=i,e[14]=u,e[15]=t[15],e},l.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e[9]=Math.abs(t[9]),e[10]=Math.abs(t[10]),e[11]=Math.abs(t[11]),e[12]=Math.abs(t[12]),e[13]=Math.abs(t[13]),e[14]=Math.abs(t[14]),e[15]=Math.abs(t[15]),e},l.equals=function(t,e){return t===e||n(t)&&n(e)&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[3]===e[3]&&t[7]===e[7]&&t[11]===e[11]&&t[15]===e[15]},l.equalsEpsilon=function(t,e,r){return t===e||n(t)&&n(e)&&Math.abs(t[0]-e[0])<=r&&Math.abs(t[1]-e[1])<=r&&Math.abs(t[2]-e[2])<=r&&Math.abs(t[3]-e[3])<=r&&Math.abs(t[4]-e[4])<=r&&Math.abs(t[5]-e[5])<=r&&Math.abs(t[6]-e[6])<=r&&Math.abs(t[7]-e[7])<=r&&Math.abs(t[8]-e[8])<=r&&Math.abs(t[9]-e[9])<=r&&Math.abs(t[10]-e[10])<=r&&Math.abs(t[11]-e[11])<=r&&Math.abs(t[12]-e[12])<=r&&Math.abs(t[13]-e[13])<=r&&Math.abs(t[14]-e[14])<=r&&Math.abs(t[15]-e[15])<=r},l.getTranslation=function(t,e){return e.x=t[12],e.y=t[13],e.z=t[14],e},l.getRotation=function(t,e){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e};var A=new s,d=new s,S=new e,m=new e(0,0,0,1);return l.inverse=function(t,r){if(s.equalsEpsilon(l.getRotation(t,A),d,u.EPSILON7)&&e.equals(l.getRow(t,3,S),m))return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=0,r[11]=0,r[12]=-t[12],r[13]=-t[13],r[14]=-t[14],r[15]=1,r;var n=t[0],a=t[4],o=t[8],i=t[12],c=t[1],f=t[5],_=t[9],R=t[13],T=t[2],h=t[6],N=t[10],C=t[14],I=t[3],p=t[7],M=t[11],O=t[15],g=N*O,y=C*M,F=h*O,L=C*p,v=h*M,U=N*p,D=T*O,P=C*I,B=T*M,w=N*I,x=T*p,G=h*I,b=g*f+L*_+v*R-(y*f+F*_+U*R),z=y*c+D*_+w*R-(g*c+P*_+B*R),H=F*c+P*f+x*R-(L*c+D*f+G*R),V=U*c+B*f+G*_-(v*c+w*f+x*_),q=y*a+F*o+U*i-(g*a+L*o+v*i),X=g*n+P*o+B*i-(y*n+D*o+w*i),W=L*n+D*a+G*i-(F*n+P*a+x*i),Y=v*n+w*a+x*o-(U*n+B*a+G*o);g=o*R,y=i*_,F=a*R,L=i*f,v=a*_,U=o*f,D=n*R,P=i*c,B=n*_,w=o*c,x=n*f,G=a*c;var K=g*p+L*M+v*O-(y*p+F*M+U*O),k=y*I+D*M+w*O-(g*I+P*M+B*O),Z=F*I+P*p+x*O-(L*I+D*p+G*O),j=U*I+B*p+G*M-(v*I+w*p+x*M),Q=F*N+U*C+y*h-(v*C+g*h+L*N),J=B*C+g*T+P*N-(D*N+w*C+y*T),$=D*h+G*C+L*T-(x*C+F*T+P*h),tt=x*N+v*T+w*h-(B*h+G*N+U*T),et=n*b+a*z+o*H+i*V;if(Math.abs(et)<u.EPSILON20)throw new E("matrix is not invertible because its determinate is zero.");return et=1/et,r[0]=b*et,r[1]=z*et,r[2]=H*et,r[3]=V*et,r[4]=q*et,r[5]=X*et,r[6]=W*et,r[7]=Y*et,r[8]=K*et,r[9]=k*et,r[10]=Z*et,r[11]=j*et,r[12]=Q*et,r[13]=J*et,r[14]=$*et,r[15]=tt*et,r},l.inverseTransformation=function(t,e){var r=t[0],n=t[1],a=t[2],o=t[4],i=t[5],u=t[6],s=t[8],E=t[9],l=t[10],c=t[12],f=t[13],_=t[14],R=-r*c-n*f-a*_,T=-o*c-i*f-u*_,h=-s*c-E*f-l*_;return e[0]=r,e[1]=o,e[2]=s,e[3]=0,e[4]=n,e[5]=i,e[6]=E,e[7]=0,e[8]=a,e[9]=u,e[10]=l,e[11]=0,e[12]=R,e[13]=T,e[14]=h,e[15]=1,e},l.IDENTITY=i(new l(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),l.ZERO=i(new l(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN0ROW3=3,l.COLUMN1ROW0=4,l.COLUMN1ROW1=5,l.COLUMN1ROW2=6,l.COLUMN1ROW3=7,l.COLUMN2ROW0=8,l.COLUMN2ROW1=9,l.COLUMN2ROW2=10,l.COLUMN2ROW3=11,l.COLUMN3ROW0=12,l.COLUMN3ROW1=13,l.COLUMN3ROW2=14,l.COLUMN3ROW3=15,a(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(t){return l.clone(this,t)},l.prototype.equals=function(t){return l.equals(this,t)},l.equalsArray=function(t,e,r){return t[0]===e[r]&&t[1]===e[r+1]&&t[2]===e[r+2]&&t[3]===e[r+3]&&t[4]===e[r+4]&&t[5]===e[r+5]&&t[6]===e[r+6]&&t[7]===e[r+7]&&t[8]===e[r+8]&&t[9]===e[r+9]&&t[10]===e[r+10]&&t[11]===e[r+11]&&t[12]===e[r+12]&&t[13]===e[r+13]&&t[14]===e[r+14]&&t[15]===e[r+15]},l.prototype.equalsEpsilon=function(t,e){return l.equalsEpsilon(this,t,e)},l.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]+")"},l}),define("Core/Rectangle",["./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(t,e,r,n,a,o,i,u){"use strict";function s(t,r,n,a){this.west=e(t,0),this.south=e(r,0),this.east=e(n,0),this.north=e(a,0)}n(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(t,r,n){return n=e(n,0),r[n++]=t.west,r[n++]=t.south,r[n++]=t.east,r[n]=t.north,r},s.unpack=function(t,n,a){return n=e(n,0),r(a)||(a=new s),a.west=t[n++],a.south=t[n++],a.east=t[n++],a.north=t[n],a},s.computeWidth=function(t){var e=t.east,r=t.west;return e<r&&(e+=u.TWO_PI),e-r},s.computeHeight=function(t){return t.north-t.south},s.fromDegrees=function(t,n,a,o,i){return t=u.toRadians(e(t,0)),n=u.toRadians(e(n,0)),a=u.toRadians(e(a,0)),o=u.toRadians(e(o,0)),r(i)?(i.west=t,i.south=n,i.east=a,i.north=o,i):new s(t,n,a,o)},s.fromCartographicArray=function(t,e){for(var n=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,i=-Number.MAX_VALUE,E=Number.MAX_VALUE,l=-Number.MAX_VALUE,c=0,f=t.length;c<f;c++){var _=t[c];n=Math.min(n,_.longitude),a=Math.max(a,_.longitude),E=Math.min(E,_.latitude),l=Math.max(l,_.latitude);var R=_.longitude>=0?_.longitude:_.longitude+u.TWO_PI;o=Math.min(o,R),i=Math.max(i,R)}return a-n>i-o&&(n=o,a=i,a>u.PI&&(a-=u.TWO_PI),n>u.PI&&(n-=u.TWO_PI)),r(e)?(e.west=n,e.south=E,e.east=a,e.north=l,e):new s(n,E,a,l)},s.fromCartesianArray=function(t,e,n){for(var a=Number.MAX_VALUE,o=-Number.MAX_VALUE,i=Number.MAX_VALUE,E=-Number.MAX_VALUE,l=Number.MAX_VALUE,c=-Number.MAX_VALUE,f=0,_=t.length;f<_;f++){var R=e.cartesianToCartographic(t[f]);a=Math.min(a,R.longitude),o=Math.max(o,R.longitude),l=Math.min(l,R.latitude),c=Math.max(c,R.latitude);var T=R.longitude>=0?R.longitude:R.longitude+u.TWO_PI;i=Math.min(i,T),E=Math.max(E,T)}return o-a>E-i&&(a=i,o=E,o>u.PI&&(o-=u.TWO_PI),a>u.PI&&(a-=u.TWO_PI)),r(n)?(n.west=a,n.south=l,n.east=o,n.north=c,n):new s(a,l,o,c)},s.clone=function(t,e){if(r(t))return r(e)?(e.west=t.west,e.south=t.south,e.east=t.east,e.north=t.north,e):new s(t.west,t.south,t.east,t.north)},s.prototype.clone=function(t){return s.clone(this,t)},s.prototype.equals=function(t){return s.equals(this,t)},s.equals=function(t,e){return t===e||r(t)&&r(e)&&t.west===e.west&&t.south===e.south&&t.east===e.east&&t.north===e.north},s.prototype.equalsEpsilon=function(t,e){return r(t)&&Math.abs(this.west-t.west)<=e&&Math.abs(this.south-t.south)<=e&&Math.abs(this.east-t.east)<=e&&Math.abs(this.north-t.north)<=e},s.validate=function(t){},s.southwest=function(e,n){return r(n)?(n.longitude=e.west,n.latitude=e.south,n.height=0,n):new t(e.west,e.south)},s.northwest=function(e,n){return r(n)?(n.longitude=e.west,n.latitude=e.north,n.height=0,n):new t(e.west,e.north)},s.northeast=function(e,n){return r(n)?(n.longitude=e.east,n.latitude=e.north,n.height=0,n):new t(e.east,e.north)},s.southeast=function(e,n){return r(n)?(n.longitude=e.east,n.latitude=e.south,n.height=0,n):new t(e.east,e.south)},s.center=function(e,n){var a=e.east,o=e.west;a<o&&(a+=u.TWO_PI);var i=u.negativePiToPi(.5*(o+a)),s=.5*(e.south+e.north);return r(n)?(n.longitude=i,n.latitude=s,n.height=0,n):new t(i,s)},s.intersection=function(t,e,n){var a=t.east,o=t.west,i=e.east,E=e.west;a<o&&i>0?a+=u.TWO_PI:i<E&&a>0&&(i+=u.TWO_PI),a<o&&E<0?E+=u.TWO_PI:i<E&&o<0&&(o+=u.TWO_PI);var l=u.negativePiToPi(Math.max(o,E)),c=u.negativePiToPi(Math.min(a,i));if(!((t.west<t.east||e.west<e.east)&&c<=l)){var f=Math.max(t.south,e.south),_=Math.min(t.north,e.north);if(!(f>=_))return r(n)?(n.west=l,n.south=f,n.east=c,n.north=_,n):new s(l,f,c,_)}},s.simpleIntersection=function(t,e,n){var a=Math.max(t.west,e.west),o=Math.max(t.south,e.south),i=Math.min(t.east,e.east),u=Math.min(t.north,e.north);if(!(o>=u||a>=i))return r(n)?(n.west=a,n.south=o,n.east=i,n.north=u,n):new s(a,o,i,u)},s.union=function(t,e,n){r(n)||(n=new s);var a=t.east,o=t.west,i=e.east,E=e.west;a<o&&i>0?a+=u.TWO_PI:i<E&&a>0&&(i+=u.TWO_PI),a<o&&E<0?E+=u.TWO_PI:i<E&&o<0&&(o+=u.TWO_PI);var l=u.convertLongitudeRange(Math.min(o,E)),c=u.convertLongitudeRange(Math.max(a,i));return n.west=l,n.south=Math.min(t.south,e.south),n.east=c,n.north=Math.max(t.north,e.north),n},s.expand=function(t,e,n){return r(n)||(n=new s),n.west=Math.min(t.west,e.longitude),n.south=Math.min(t.south,e.latitude),n.east=Math.max(t.east,e.longitude),n.north=Math.max(t.north,e.latitude),n},s.contains=function(t,e){var r=e.longitude,n=e.latitude,a=t.west,o=t.east;return o<a&&(o+=u.TWO_PI,r<0&&(r+=u.TWO_PI)),(r>a||u.equalsEpsilon(r,a,u.EPSILON14))&&(r<o||u.equalsEpsilon(r,o,u.EPSILON14))&&n>=t.south&&n<=t.north};var E=new t;return s.subsample=function(t,n,a,i){n=e(n,o.WGS84),a=e(a,0),r(i)||(i=[]);var l=0,c=t.north,f=t.south,_=t.east,R=t.west,T=E;T.height=a,T.longitude=R,T.latitude=c,i[l]=n.cartographicToCartesian(T,i[l]),l++,T.longitude=_,i[l]=n.cartographicToCartesian(T,i[l]),l++,T.latitude=f,i[l]=n.cartographicToCartesian(T,i[l]),l++,T.longitude=R,i[l]=n.cartographicToCartesian(T,i[l]),l++,c<0?T.latitude=c:f>0?T.latitude=f:T.latitude=0;for(var h=1;h<8;++h)T.longitude=-Math.PI+h*u.PI_OVER_TWO,s.contains(t,T)&&(i[l]=n.cartographicToCartesian(T,i[l]),l++);return 0===T.latitude&&(T.longitude=R,i[l]=n.cartographicToCartesian(T,i[l]),l++,T.longitude=_,i[l]=n.cartographicToCartesian(T,i[l]),l++),i.length=l,i},s.MAX_VALUE=i(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(t,e,r,n,a,o,i,u,s,E,l,c){"use strict";function f(e,n){this.center=t.clone(r(e,t.ZERO)),this.radius=r(n,0)}var _=new t,R=new t,T=new t,h=new t,A=new t,d=new t,S=new t,m=new t,N=new t,C=new t,I=new t,p=new t;f.fromPoints=function(e,r){if(n(r)||(r=new f),!n(e)||0===e.length)return r.center=t.clone(t.ZERO,r.center),r.radius=0,r;for(var a=t.clone(e[0],S),o=t.clone(a,_),i=t.clone(a,R),u=t.clone(a,T),s=t.clone(a,h),E=t.clone(a,A),l=t.clone(a,d),c=e.length,M=1;M<c;M++){t.clone(e[M],a);var O=a.x,g=a.y,y=a.z;O<o.x&&t.clone(a,o),O>s.x&&t.clone(a,s),g<i.y&&t.clone(a,i),g>E.y&&t.clone(a,E),y<u.z&&t.clone(a,u),y>l.z&&t.clone(a,l)}var F=t.magnitudeSquared(t.subtract(s,o,m)),L=t.magnitudeSquared(t.subtract(E,i,m)),v=t.magnitudeSquared(t.subtract(l,u,m)),U=o,D=s,P=F;L>P&&(P=L,U=i,D=E),v>P&&(P=v,U=u,D=l);var B=N;B.x=.5*(U.x+D.x),B.y=.5*(U.y+D.y),B.z=.5*(U.z+D.z);var w=t.magnitudeSquared(t.subtract(D,B,m)),x=Math.sqrt(w),G=C;G.x=o.x,G.y=i.y,G.z=u.z;var b=I;b.x=s.x,b.y=E.y,b.z=l.z;var z=t.multiplyByScalar(t.add(G,b,m),.5,p),H=0;for(M=0;M<c;M++){t.clone(e[M],a);var V=t.magnitude(t.subtract(a,z,m));V>H&&(H=V);var q=t.magnitudeSquared(t.subtract(a,B,m));if(q>w){var X=Math.sqrt(q);x=.5*(x+X),w=x*x;var W=X-x;B.x=(x*B.x+W*a.x)/X,B.y=(x*B.y+W*a.y)/X,B.z=(x*B.z+W*a.z)/X}}return x<H?(t.clone(B,r.center),r.radius=x):(t.clone(z,r.center),r.radius=H),r};var M=new i,O=new t,g=new t,y=new e,F=new e;f.fromRectangle2D=function(t,e,r){return f.fromRectangleWithHeights2D(t,e,0,0,r)},f.fromRectangleWithHeights2D=function(e,a,o,i,u){if(n(u)||(u=new f),!n(e))return u.center=t.clone(t.ZERO,u.center),u.radius=0,u;a=r(a,M),c.southwest(e,y),y.height=o,c.northeast(e,F),F.height=i;var s=a.project(y,O),E=a.project(F,g),l=E.x-s.x,_=E.y-s.y,R=E.z-s.z;u.radius=.5*Math.sqrt(l*l+_*_+R*R);var T=u.center;return T.x=s.x+.5*l,T.y=s.y+.5*_,T.z=s.z+.5*R,u};var L=[];f.fromRectangle3D=function(t,e,a,i){e=r(e,o.WGS84),a=r(a,0);var u;return n(t)&&(u=c.subsample(t,e,a,L)),f.fromPoints(u,i)},f.fromVertices=function(e,a,o,i){if(n(i)||(i=new f),!n(e)||0===e.length)return i.center=t.clone(t.ZERO,i.center),i.radius=0,i;a=r(a,t.ZERO),o=r(o,3);var u=S;u.x=e[0]+a.x,u.y=e[1]+a.y,u.z=e[2]+a.z;for(var s=t.clone(u,_),E=t.clone(u,R),l=t.clone(u,T),c=t.clone(u,h),M=t.clone(u,A),O=t.clone(u,d),g=e.length,y=0;y<g;y+=o){var F=e[y]+a.x,L=e[y+1]+a.y,v=e[y+2]+a.z;u.x=F,u.y=L,u.z=v,F<s.x&&t.clone(u,s),F>c.x&&t.clone(u,c),L<E.y&&t.clone(u,E),L>M.y&&t.clone(u,M),v<l.z&&t.clone(u,l),v>O.z&&t.clone(u,O)}var U=t.magnitudeSquared(t.subtract(c,s,m)),D=t.magnitudeSquared(t.subtract(M,E,m)),P=t.magnitudeSquared(t.subtract(O,l,m)),B=s,w=c,x=U;D>x&&(x=D,B=E,w=M),P>x&&(x=P,B=l,w=O);var G=N;G.x=.5*(B.x+w.x),G.y=.5*(B.y+w.y),G.z=.5*(B.z+w.z);var b=t.magnitudeSquared(t.subtract(w,G,m)),z=Math.sqrt(b),H=C;H.x=s.x,H.y=E.y,H.z=l.z;var V=I;V.x=c.x,V.y=M.y,V.z=O.z;var q=t.multiplyByScalar(t.add(H,V,m),.5,p),X=0;for(y=0;y<g;y+=o){u.x=e[y]+a.x,u.y=e[y+1]+a.y,u.z=e[y+2]+a.z;var W=t.magnitude(t.subtract(u,q,m));W>X&&(X=W);var Y=t.magnitudeSquared(t.subtract(u,G,m));if(Y>b){var K=Math.sqrt(Y);z=.5*(z+K),b=z*z;var k=K-z;G.x=(z*G.x+k*u.x)/K,G.y=(z*G.y+k*u.y)/K,G.z=(z*G.z+k*u.z)/K}}return z<X?(t.clone(G,i.center),i.radius=z):(t.clone(q,i.center),i.radius=X),i},f.fromEncodedCartesianVertices=function(e,r,a){if(n(a)||(a=new f),!n(e)||!n(r)||e.length!==r.length||0===e.length)return a.center=t.clone(t.ZERO,a.center),a.radius=0,a;var o=S;o.x=e[0]+r[0],o.y=e[1]+r[1],o.z=e[2]+r[2];for(var i=t.clone(o,_),u=t.clone(o,R),s=t.clone(o,T),E=t.clone(o,h),l=t.clone(o,A),c=t.clone(o,d),M=e.length,O=0;O<M;O+=3){var g=e[O]+r[O],y=e[O+1]+r[O+1],F=e[O+2]+r[O+2];o.x=g,o.y=y,o.z=F,g<i.x&&t.clone(o,i),g>E.x&&t.clone(o,E),y<u.y&&t.clone(o,u),y>l.y&&t.clone(o,l),F<s.z&&t.clone(o,s),F>c.z&&t.clone(o,c)}var L=t.magnitudeSquared(t.subtract(E,i,m)),v=t.magnitudeSquared(t.subtract(l,u,m)),U=t.magnitudeSquared(t.subtract(c,s,m)),D=i,P=E,B=L;v>B&&(B=v,D=u,P=l),U>B&&(B=U,D=s,P=c);var w=N;w.x=.5*(D.x+P.x),w.y=.5*(D.y+P.y),w.z=.5*(D.z+P.z);var x=t.magnitudeSquared(t.subtract(P,w,m)),G=Math.sqrt(x),b=C;b.x=i.x,b.y=u.y,b.z=s.z;var z=I;z.x=E.x,z.y=l.y,z.z=c.z;var H=t.multiplyByScalar(t.add(b,z,m),.5,p),V=0;for(O=0;O<M;O+=3){o.x=e[O]+r[O],o.y=e[O+1]+r[O+1],o.z=e[O+2]+r[O+2];var q=t.magnitude(t.subtract(o,H,m));q>V&&(V=q);var X=t.magnitudeSquared(t.subtract(o,w,m));if(X>x){var W=Math.sqrt(X);G=.5*(G+W),x=G*G;var Y=W-G;w.x=(G*w.x+Y*o.x)/W,w.y=(G*w.y+Y*o.y)/W,w.z=(G*w.z+Y*o.z)/W}}return G<V?(t.clone(w,a.center),a.radius=G):(t.clone(H,a.center),a.radius=V),a},f.fromCornerPoints=function(e,r,a){n(a)||(a=new f);var o=a.center;return t.add(e,r,o),t.multiplyByScalar(o,.5,o),a.radius=t.distance(o,r),a},f.fromEllipsoid=function(e,r){return n(r)||(r=new f),t.clone(t.ZERO,r.center),r.radius=e.maximumRadius,r};var v=new t;f.fromBoundingSpheres=function(e,r){if(n(r)||(r=new f),!n(e)||0===e.length)return r.center=t.clone(t.ZERO,r.center),r.radius=0,r;var a=e.length;if(1===a)return f.clone(e[0],r);if(2===a)return f.union(e[0],e[1],r);for(var o=[],i=0;i<a;i++)o.push(e[i].center);r=f.fromPoints(o,r);var u=r.center,s=r.radius;for(i=0;i<a;i++){var E=e[i];s=Math.max(s,t.distance(u,E.center,v)+E.radius)}return r.radius=s,r};var U=new t,D=new t,P=new t;f.fromOrientedBoundingBox=function(e,r){n(r)||(r=new f);var a=e.halfAxes,o=E.getColumn(a,0,U),i=E.getColumn(a,1,D),u=E.getColumn(a,2,P),s=t.magnitude(o),l=t.magnitude(i),c=t.magnitude(u);return r.center=t.clone(e.center,r.center),r.radius=Math.max(s,l,c),r},f.clone=function(e,r){if(n(e))return n(r)?(r.center=t.clone(e.center,r.center),r.radius=e.radius,r):new f(e.center,e.radius)},f.packedLength=4,f.pack=function(t,e,n){n=r(n,0);var a=t.center;return e[n++]=a.x,e[n++]=a.y,e[n++]=a.z,e[n]=t.radius,e},f.unpack=function(t,e,a){e=r(e,0),n(a)||(a=new f);var o=a.center;return o.x=t[e++],o.y=t[e++],o.z=t[e++],a.radius=t[e],a};var B=new t,w=new t;f.union=function(e,r,a){n(a)||(a=new f);var o=e.center,i=e.radius,u=r.center,s=r.radius,E=t.subtract(u,o,B),l=t.magnitude(E);if(i>=l+s)return e.clone(a),a;if(s>=l+i)return r.clone(a),a;var c=.5*(i+l+s),_=t.multiplyByScalar(E,(-i+c)/l,w);return t.add(_,o,_),t.clone(_,a.center),a.radius=c,a};var x=new t;f.expand=function(e,r,n){n=f.clone(e,n);var a=t.magnitude(t.subtract(r,n.center,x));return a>n.radius&&(n.radius=a),n},f.intersectPlane=function(e,r){var n=e.center,a=e.radius,o=r.normal,i=t.dot(o,n)+r.distance;return i<-a?u.OUTSIDE:i<a?u.INTERSECTING:u.INSIDE},f.transform=function(t,e,r){return n(r)||(r=new f),r.center=l.multiplyByPoint(e,t.center,r.center),r.radius=l.getMaximumScale(e)*t.radius,r};var G=new t;f.distanceSquaredTo=function(e,r){var n=t.subtract(e.center,r,G);return t.magnitudeSquared(n)-e.radius*e.radius},f.transformWithoutScale=function(t,e,r){return n(r)||(r=new f),r.center=l.multiplyByPoint(e,t.center,r.center),r.radius=t.radius,r};var b=new t;f.computePlaneDistances=function(e,r,a,o){n(o)||(o=new s);var i=t.subtract(e.center,r,b),u=t.dot(a,i);return o.start=u-e.radius,o.stop=u+e.radius,o};for(var z=new t,H=new t,V=new t,q=new t,X=new t,W=new e,Y=new Array(8),K=0;K<8;++K)Y[K]=new t;var k=new i;return f.projectTo2D=function(e,n,a){n=r(n,k);var o=n.ellipsoid,i=e.center,u=e.radius,s=o.geodeticSurfaceNormal(i,z),E=t.cross(t.UNIT_Z,s,H);t.normalize(E,E);var l=t.cross(s,E,V);t.normalize(l,l),t.multiplyByScalar(s,u,s),t.multiplyByScalar(l,u,l),t.multiplyByScalar(E,u,E);var c=t.negate(l,X),_=t.negate(E,q),R=Y,T=R[0];t.add(s,l,T),t.add(T,E,T),T=R[1],t.add(s,l,T),t.add(T,_,T),T=R[2],t.add(s,c,T),t.add(T,_,T),T=R[3],t.add(s,c,T),t.add(T,E,T),t.negate(s,s),T=R[4],t.add(s,l,T),t.add(T,E,T),T=R[5],t.add(s,l,T),t.add(T,_,T),T=R[6],t.add(s,c,T),t.add(T,_,T),T=R[7],t.add(s,c,T),t.add(T,E,T);for(var h=R.length,A=0;A<h;++A){var d=R[A];t.add(i,d,d);var S=o.cartesianToCartographic(d,W);n.project(S,d)}a=f.fromPoints(R,a),i=a.center;var m=i.x,N=i.y,C=i.z;return i.x=C,i.y=m,i.z=N,a},f.isOccluded=function(t,e){return!e.isBoundingSphereVisible(t)},f.equals=function(e,r){return e===r||n(e)&&n(r)&&t.equals(e.center,r.center)&&e.radius===r.radius},f.prototype.intersectPlane=function(t){return f.intersectPlane(this,t)},f.prototype.distanceSquaredTo=function(t){return f.distanceSquaredTo(this,t)},f.prototype.computePlaneDistances=function(t,e,r){return f.computePlaneDistances(this,t,e,r)},f.prototype.isOccluded=function(t){return f.isOccluded(this,t)},f.prototype.equals=function(t){return f.equals(this,t)},f.prototype.clone=function(t){return f.clone(this,t)},f}),define("Core/Fullscreen",["./defined","./defineProperties"],function(t,e){"use strict";var r,n={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return e(a,{element:{get:function(){if(a.supportsFullscreen())return document[n.fullscreenElement]}},changeEventName:{get:function(){if(a.supportsFullscreen())return n.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return n.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[n.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(t(r))return r;r=!1;var e=document.body;if("function"==typeof e.requestFullscreen)return n.requestFullscreen="requestFullscreen",n.exitFullscreen="exitFullscreen",n.fullscreenEnabled="fullscreenEnabled",n.fullscreenElement="fullscreenElement",n.fullscreenchange="fullscreenchange",n.fullscreenerror="fullscreenerror",r=!0;for(var a,o=["webkit","moz","o","ms","khtml"],i=0,u=o.length;i<u;++i){var s=o[i];a=s+"RequestFullscreen","function"==typeof e[a]?(n.requestFullscreen=a,r=!0):(a=s+"RequestFullScreen","function"==typeof e[a]&&(n.requestFullscreen=a,r=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?n.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(n.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?n.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(n.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?n.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(n.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),n.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),n.fullscreenerror=a)}return r},a.requestFullscreen=function(t,e){a.supportsFullscreen()&&t[n.requestFullscreen]({vrDisplay:e})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[n.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(t,e,r){"use strict";function n(t){for(var e=t.split("."),r=0,n=e.length;r<n;++r)e[r]=parseInt(e[r],10);return e}function a(){if(!e(N)&&(N=!1,!f())){var t=/ Chrome\/([\.0-9]+)/.exec(m.userAgent);null!==t&&(N=!0,C=n(t[1]))}return N}function o(){return a()&&C}function i(){if(!e(I)&&(I=!1,!a()&&!f()&&/ Safari\/[\.0-9]+/.test(m.userAgent))){var t=/ Version\/([\.0-9]+)/.exec(m.userAgent);null!==t&&(I=!0,p=n(t[1]))}return I}function u(){return i()&&p}function s(){if(!e(M)){M=!1;var t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(m.userAgent);null!==t&&(M=!0,O=n(t[1]),O.isNightly=!!t[2])}return M}function E(){return s()&&O}function l(){if(!e(g)){g=!1;var t;"Microsoft Internet Explorer"===m.appName?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(m.userAgent),null!==t&&(g=!0,y=n(t[1]))):"Netscape"===m.appName&&(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(m.userAgent),null!==t&&(g=!0,y=n(t[1])))}return g}function c(){return l()&&y}function f(){if(!e(F)){F=!1;var t=/ Edge\/([\.0-9]+)/.exec(m.userAgent);null!==t&&(F=!0,L=n(t[1]))}return F}function _(){return f()&&L}function R(){if(!e(v)){v=!1;var t=/Firefox\/([\.0-9]+)/.exec(m.userAgent);null!==t&&(v=!0,U=n(t[1]))}return v}function T(){return e(D)||(D=/Windows/i.test(m.appVersion)),D}function h(){return R()&&U}function A(){return e(P)||(P="undefined"!=typeof PointerEvent&&(!e(m.pointerEnabled)||m.pointerEnabled)),P}function d(){ -if(!e(w)){var t=document.createElement("canvas");t.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var r=t.style.imageRendering;w=e(r)&&""!==r,w&&(B=r)}return w}function S(){return d()?B:void 0}var m;m="undefined"!=typeof navigator?navigator:{};var N,C,I,p,M,O,g,y,F,L,v,U,D,P,B,w,x={isChrome:a,chromeVersion:o,isSafari:i,safariVersion:u,isWebkit:s,webkitVersion:E,isInternetExplorer:l,internetExplorerVersion:c,isEdge:f,edgeVersion:_,isFirefox:R,firefoxVersion:h,isWindows:T,hardwareConcurrency:t(m.hardwareConcurrency,3),supportsPointerEvents:A,supportsImageRenderingPixelated:d,imageRenderingValue:S};return x.supportsFullscreen=function(){return r.supportsFullscreen()},x.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},x.supportsWebWorkers=function(){return"undefined"!=typeof Worker},x}),define("Core/Color",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math"],function(t,e,r,n,a,o){"use strict";function i(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),6*r<1?t+6*(e-t)*r:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}function u(e,r,n,a){this.red=t(e,1),this.green=t(r,1),this.blue=t(n,1),this.alpha=t(a,1)}u.fromCartesian4=function(t,r){return e(r)?(r.red=t.x,r.green=t.y,r.blue=t.z,r.alpha=t.w,r):new u(t.x,t.y,t.z,t.w)},u.fromBytes=function(r,n,a,o,i){return r=u.byteToFloat(t(r,255)),n=u.byteToFloat(t(n,255)),a=u.byteToFloat(t(a,255)),o=u.byteToFloat(t(o,255)),e(i)?(i.red=r,i.green=n,i.blue=a,i.alpha=o,i):new u(r,n,a,o)},u.fromAlpha=function(t,r,n){return e(n)?(n.red=t.red,n.green=t.green,n.blue=t.blue,n.alpha=r,n):new u(t.red,t.green,t.blue,r)};var s,E,l;n.supportsTypedArrays()&&(s=new ArrayBuffer(4),E=new Uint32Array(s),l=new Uint8Array(s)),u.fromRgba=function(t,e){return E[0]=t,u.fromBytes(l[0],l[1],l[2],l[3],e)},u.fromHsl=function(r,n,a,o,s){r=t(r,0)%1,n=t(n,0),a=t(a,0),o=t(o,1);var E=a,l=a,c=a;if(0!==n){var f;f=a<.5?a*(1+n):a+n-a*n;var _=2*a-f;E=i(_,f,r+1/3),l=i(_,f,r),c=i(_,f,r-1/3)}return e(s)?(s.red=E,s.green=l,s.blue=c,s.alpha=o,s):new u(E,l,c,o)},u.fromRandom=function(r,n){r=t(r,t.EMPTY_OBJECT);var a=r.red;if(!e(a)){var i=t(r.minimumRed,0),s=t(r.maximumRed,1);a=i+o.nextRandomNumber()*(s-i)}var E=r.green;if(!e(E)){var l=t(r.minimumGreen,0),c=t(r.maximumGreen,1);E=l+o.nextRandomNumber()*(c-l)}var f=r.blue;if(!e(f)){var _=t(r.minimumBlue,0),R=t(r.maximumBlue,1);f=_+o.nextRandomNumber()*(R-_)}var T=r.alpha;if(!e(T)){var h=t(r.minimumAlpha,0),A=t(r.maximumAlpha,1);T=h+o.nextRandomNumber()*(A-h)}return e(n)?(n.red=a,n.green=E,n.blue=f,n.alpha=T,n):new u(a,E,f,T)};var c=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i,f=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i,_=/^rgba?\(\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)(?:\s*,\s*([0-9.]+))?\s*\)$/i,R=/^hsla?\(\s*([0-9.]+)\s*,\s*([0-9.]+%)\s*,\s*([0-9.]+%)(?:\s*,\s*([0-9.]+))?\s*\)$/i;return u.fromCssColorString=function(r,n){e(n)||(n=new u);var a=u[r.toUpperCase()];if(e(a))return u.clone(a,n),n;var o=c.exec(r);return null!==o?(n.red=parseInt(o[1],16)/15,n.green=parseInt(o[2],16)/15,n.blue=parseInt(o[3],16)/15,n.alpha=1,n):(o=f.exec(r),null!==o?(n.red=parseInt(o[1],16)/255,n.green=parseInt(o[2],16)/255,n.blue=parseInt(o[3],16)/255,n.alpha=1,n):(o=_.exec(r),null!==o?(n.red=parseFloat(o[1])/("%"===o[1].substr(-1)?100:255),n.green=parseFloat(o[2])/("%"===o[2].substr(-1)?100:255),n.blue=parseFloat(o[3])/("%"===o[3].substr(-1)?100:255),n.alpha=parseFloat(t(o[4],"1.0")),n):(o=R.exec(r),null!==o?u.fromHsl(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,parseFloat(t(o[4],"1.0")),n):n=void 0)))},u.packedLength=4,u.pack=function(e,r,n){return n=t(n,0),r[n++]=e.red,r[n++]=e.green,r[n++]=e.blue,r[n]=e.alpha,r},u.unpack=function(r,n,a){return n=t(n,0),e(a)||(a=new u),a.red=r[n++],a.green=r[n++],a.blue=r[n++],a.alpha=r[n],a},u.byteToFloat=function(t){return t/255},u.floatToByte=function(t){return 1===t?255:256*t|0},u.clone=function(t,r){if(e(t))return e(r)?(r.red=t.red,r.green=t.green,r.blue=t.blue,r.alpha=t.alpha,r):new u(t.red,t.green,t.blue,t.alpha)},u.equals=function(t,r){return t===r||e(t)&&e(r)&&t.red===r.red&&t.green===r.green&&t.blue===r.blue&&t.alpha===r.alpha},u.equalsArray=function(t,e,r){return t.red===e[r]&&t.green===e[r+1]&&t.blue===e[r+2]&&t.alpha===e[r+3]},u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.prototype.equalsEpsilon=function(t,r){return this===t||e(t)&&Math.abs(this.red-t.red)<=r&&Math.abs(this.green-t.green)<=r&&Math.abs(this.blue-t.blue)<=r&&Math.abs(this.alpha-t.alpha)<=r},u.prototype.toString=function(){return"("+this.red+", "+this.green+", "+this.blue+", "+this.alpha+")"},u.prototype.toCssColorString=function(){var t=u.floatToByte(this.red),e=u.floatToByte(this.green),r=u.floatToByte(this.blue);return 1===this.alpha?"rgb("+t+","+e+","+r+")":"rgba("+t+","+e+","+r+","+this.alpha+")"},u.prototype.toBytes=function(t){var r=u.floatToByte(this.red),n=u.floatToByte(this.green),a=u.floatToByte(this.blue),o=u.floatToByte(this.alpha);return e(t)?(t[0]=r,t[1]=n,t[2]=a,t[3]=o,t):[r,n,a,o]},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),E[0]},u.prototype.brighten=function(t,e){return t=1-t,e.red=1-(1-this.red)*t,e.green=1-(1-this.green)*t,e.blue=1-(1-this.blue)*t,e.alpha=this.alpha,e},u.prototype.darken=function(t,e){return t=1-t,e.red=this.red*t,e.green=this.green*t,e.blue=this.blue*t,e.alpha=this.alpha,e},u.prototype.withAlpha=function(t,e){return u.fromAlpha(this,t,e)},u.add=function(t,e,r){return r.red=t.red+e.red,r.green=t.green+e.green,r.blue=t.blue+e.blue,r.alpha=t.alpha+e.alpha,r},u.subtract=function(t,e,r){return r.red=t.red-e.red,r.green=t.green-e.green,r.blue=t.blue-e.blue,r.alpha=t.alpha-e.alpha,r},u.multiply=function(t,e,r){return r.red=t.red*e.red,r.green=t.green*e.green,r.blue=t.blue*e.blue,r.alpha=t.alpha*e.alpha,r},u.divide=function(t,e,r){return r.red=t.red/e.red,r.green=t.green/e.green,r.blue=t.blue/e.blue,r.alpha=t.alpha/e.alpha,r},u.mod=function(t,e,r){return r.red=t.red%e.red,r.green=t.green%e.green,r.blue=t.blue%e.blue,r.alpha=t.alpha%e.alpha,r},u.multiplyByScalar=function(t,e,r){return r.red=t.red*e,r.green=t.green*e,r.blue=t.blue*e,r.alpha=t.alpha*e,r},u.divideByScalar=function(t,e,r){return r.red=t.red/e,r.green=t.green/e,r.blue=t.blue/e,r.alpha=t.alpha/e,r},u.ALICEBLUE=a(u.fromCssColorString("#F0F8FF")),u.ANTIQUEWHITE=a(u.fromCssColorString("#FAEBD7")),u.AQUA=a(u.fromCssColorString("#00FFFF")),u.AQUAMARINE=a(u.fromCssColorString("#7FFFD4")),u.AZURE=a(u.fromCssColorString("#F0FFFF")),u.BEIGE=a(u.fromCssColorString("#F5F5DC")),u.BISQUE=a(u.fromCssColorString("#FFE4C4")),u.BLACK=a(u.fromCssColorString("#000000")),u.BLANCHEDALMOND=a(u.fromCssColorString("#FFEBCD")),u.BLUE=a(u.fromCssColorString("#0000FF")),u.BLUEVIOLET=a(u.fromCssColorString("#8A2BE2")),u.BROWN=a(u.fromCssColorString("#A52A2A")),u.BURLYWOOD=a(u.fromCssColorString("#DEB887")),u.CADETBLUE=a(u.fromCssColorString("#5F9EA0")),u.CHARTREUSE=a(u.fromCssColorString("#7FFF00")),u.CHOCOLATE=a(u.fromCssColorString("#D2691E")),u.CORAL=a(u.fromCssColorString("#FF7F50")),u.CORNFLOWERBLUE=a(u.fromCssColorString("#6495ED")),u.CORNSILK=a(u.fromCssColorString("#FFF8DC")),u.CRIMSON=a(u.fromCssColorString("#DC143C")),u.CYAN=a(u.fromCssColorString("#00FFFF")),u.DARKBLUE=a(u.fromCssColorString("#00008B")),u.DARKCYAN=a(u.fromCssColorString("#008B8B")),u.DARKGOLDENROD=a(u.fromCssColorString("#B8860B")),u.DARKGRAY=a(u.fromCssColorString("#A9A9A9")),u.DARKGREEN=a(u.fromCssColorString("#006400")),u.DARKGREY=u.DARKGRAY,u.DARKKHAKI=a(u.fromCssColorString("#BDB76B")),u.DARKMAGENTA=a(u.fromCssColorString("#8B008B")),u.DARKOLIVEGREEN=a(u.fromCssColorString("#556B2F")),u.DARKORANGE=a(u.fromCssColorString("#FF8C00")),u.DARKORCHID=a(u.fromCssColorString("#9932CC")),u.DARKRED=a(u.fromCssColorString("#8B0000")),u.DARKSALMON=a(u.fromCssColorString("#E9967A")),u.DARKSEAGREEN=a(u.fromCssColorString("#8FBC8F")),u.DARKSLATEBLUE=a(u.fromCssColorString("#483D8B")),u.DARKSLATEGRAY=a(u.fromCssColorString("#2F4F4F")),u.DARKSLATEGREY=u.DARKSLATEGRAY,u.DARKTURQUOISE=a(u.fromCssColorString("#00CED1")),u.DARKVIOLET=a(u.fromCssColorString("#9400D3")),u.DEEPPINK=a(u.fromCssColorString("#FF1493")),u.DEEPSKYBLUE=a(u.fromCssColorString("#00BFFF")),u.DIMGRAY=a(u.fromCssColorString("#696969")),u.DIMGREY=u.DIMGRAY,u.DODGERBLUE=a(u.fromCssColorString("#1E90FF")),u.FIREBRICK=a(u.fromCssColorString("#B22222")),u.FLORALWHITE=a(u.fromCssColorString("#FFFAF0")),u.FORESTGREEN=a(u.fromCssColorString("#228B22")),u.FUSCHIA=a(u.fromCssColorString("#FF00FF")),u.GAINSBORO=a(u.fromCssColorString("#DCDCDC")),u.GHOSTWHITE=a(u.fromCssColorString("#F8F8FF")),u.GOLD=a(u.fromCssColorString("#FFD700")),u.GOLDENROD=a(u.fromCssColorString("#DAA520")),u.GRAY=a(u.fromCssColorString("#808080")),u.GREEN=a(u.fromCssColorString("#008000")),u.GREENYELLOW=a(u.fromCssColorString("#ADFF2F")),u.GREY=u.GRAY,u.HONEYDEW=a(u.fromCssColorString("#F0FFF0")),u.HOTPINK=a(u.fromCssColorString("#FF69B4")),u.INDIANRED=a(u.fromCssColorString("#CD5C5C")),u.INDIGO=a(u.fromCssColorString("#4B0082")),u.IVORY=a(u.fromCssColorString("#FFFFF0")),u.KHAKI=a(u.fromCssColorString("#F0E68C")),u.LAVENDER=a(u.fromCssColorString("#E6E6FA")),u.LAVENDAR_BLUSH=a(u.fromCssColorString("#FFF0F5")),u.LAWNGREEN=a(u.fromCssColorString("#7CFC00")),u.LEMONCHIFFON=a(u.fromCssColorString("#FFFACD")),u.LIGHTBLUE=a(u.fromCssColorString("#ADD8E6")),u.LIGHTCORAL=a(u.fromCssColorString("#F08080")),u.LIGHTCYAN=a(u.fromCssColorString("#E0FFFF")),u.LIGHTGOLDENRODYELLOW=a(u.fromCssColorString("#FAFAD2")),u.LIGHTGRAY=a(u.fromCssColorString("#D3D3D3")),u.LIGHTGREEN=a(u.fromCssColorString("#90EE90")),u.LIGHTGREY=u.LIGHTGRAY,u.LIGHTPINK=a(u.fromCssColorString("#FFB6C1")),u.LIGHTSEAGREEN=a(u.fromCssColorString("#20B2AA")),u.LIGHTSKYBLUE=a(u.fromCssColorString("#87CEFA")),u.LIGHTSLATEGRAY=a(u.fromCssColorString("#778899")),u.LIGHTSLATEGREY=u.LIGHTSLATEGRAY,u.LIGHTSTEELBLUE=a(u.fromCssColorString("#B0C4DE")),u.LIGHTYELLOW=a(u.fromCssColorString("#FFFFE0")),u.LIME=a(u.fromCssColorString("#00FF00")),u.LIMEGREEN=a(u.fromCssColorString("#32CD32")),u.LINEN=a(u.fromCssColorString("#FAF0E6")),u.MAGENTA=a(u.fromCssColorString("#FF00FF")),u.MAROON=a(u.fromCssColorString("#800000")),u.MEDIUMAQUAMARINE=a(u.fromCssColorString("#66CDAA")),u.MEDIUMBLUE=a(u.fromCssColorString("#0000CD")),u.MEDIUMORCHID=a(u.fromCssColorString("#BA55D3")),u.MEDIUMPURPLE=a(u.fromCssColorString("#9370DB")),u.MEDIUMSEAGREEN=a(u.fromCssColorString("#3CB371")),u.MEDIUMSLATEBLUE=a(u.fromCssColorString("#7B68EE")),u.MEDIUMSPRINGGREEN=a(u.fromCssColorString("#00FA9A")),u.MEDIUMTURQUOISE=a(u.fromCssColorString("#48D1CC")),u.MEDIUMVIOLETRED=a(u.fromCssColorString("#C71585")),u.MIDNIGHTBLUE=a(u.fromCssColorString("#191970")),u.MINTCREAM=a(u.fromCssColorString("#F5FFFA")),u.MISTYROSE=a(u.fromCssColorString("#FFE4E1")),u.MOCCASIN=a(u.fromCssColorString("#FFE4B5")),u.NAVAJOWHITE=a(u.fromCssColorString("#FFDEAD")),u.NAVY=a(u.fromCssColorString("#000080")),u.OLDLACE=a(u.fromCssColorString("#FDF5E6")),u.OLIVE=a(u.fromCssColorString("#808000")),u.OLIVEDRAB=a(u.fromCssColorString("#6B8E23")),u.ORANGE=a(u.fromCssColorString("#FFA500")),u.ORANGERED=a(u.fromCssColorString("#FF4500")),u.ORCHID=a(u.fromCssColorString("#DA70D6")),u.PALEGOLDENROD=a(u.fromCssColorString("#EEE8AA")),u.PALEGREEN=a(u.fromCssColorString("#98FB98")),u.PALETURQUOISE=a(u.fromCssColorString("#AFEEEE")),u.PALEVIOLETRED=a(u.fromCssColorString("#DB7093")),u.PAPAYAWHIP=a(u.fromCssColorString("#FFEFD5")),u.PEACHPUFF=a(u.fromCssColorString("#FFDAB9")),u.PERU=a(u.fromCssColorString("#CD853F")),u.PINK=a(u.fromCssColorString("#FFC0CB")),u.PLUM=a(u.fromCssColorString("#DDA0DD")),u.POWDERBLUE=a(u.fromCssColorString("#B0E0E6")),u.PURPLE=a(u.fromCssColorString("#800080")),u.RED=a(u.fromCssColorString("#FF0000")),u.ROSYBROWN=a(u.fromCssColorString("#BC8F8F")),u.ROYALBLUE=a(u.fromCssColorString("#4169E1")),u.SADDLEBROWN=a(u.fromCssColorString("#8B4513")),u.SALMON=a(u.fromCssColorString("#FA8072")),u.SANDYBROWN=a(u.fromCssColorString("#F4A460")),u.SEAGREEN=a(u.fromCssColorString("#2E8B57")),u.SEASHELL=a(u.fromCssColorString("#FFF5EE")),u.SIENNA=a(u.fromCssColorString("#A0522D")),u.SILVER=a(u.fromCssColorString("#C0C0C0")),u.SKYBLUE=a(u.fromCssColorString("#87CEEB")),u.SLATEBLUE=a(u.fromCssColorString("#6A5ACD")),u.SLATEGRAY=a(u.fromCssColorString("#708090")),u.SLATEGREY=u.SLATEGRAY,u.SNOW=a(u.fromCssColorString("#FFFAFA")),u.SPRINGGREEN=a(u.fromCssColorString("#00FF7F")),u.STEELBLUE=a(u.fromCssColorString("#4682B4")),u.TAN=a(u.fromCssColorString("#D2B48C")),u.TEAL=a(u.fromCssColorString("#008080")),u.THISTLE=a(u.fromCssColorString("#D8BFD8")),u.TOMATO=a(u.fromCssColorString("#FF6347")),u.TURQUOISE=a(u.fromCssColorString("#40E0D0")),u.VIOLET=a(u.fromCssColorString("#EE82EE")),u.WHEAT=a(u.fromCssColorString("#F5DEB3")),u.WHITE=a(u.fromCssColorString("#FFFFFF")),u.WHITESMOKE=a(u.fromCssColorString("#F5F5F5")),u.YELLOW=a(u.fromCssColorString("#FFFF00")),u.YELLOWGREEN=a(u.fromCssColorString("#9ACD32")),u.TRANSPARENT=a(new u(0,0,0,0)),u}),define("Core/WebGLConstants",["./freezeObject"],function(t){"use strict";var e={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503};return t(e)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(t,e,r,n,a,o){"use strict";if(!n.supportsTypedArrays())return{};var i={BYTE:o.BYTE,UNSIGNED_BYTE:o.UNSIGNED_BYTE,SHORT:o.SHORT,UNSIGNED_SHORT:o.UNSIGNED_SHORT,INT:o.INT,UNSIGNED_INT:o.UNSIGNED_INT,FLOAT:o.FLOAT,DOUBLE:o.DOUBLE};return i.getSizeInBytes=function(t){switch(t){case i.BYTE:return Int8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.SHORT:return Int16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.INT:return Int32Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case i.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case i.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},i.fromTypedArray=function(t){return t instanceof Int8Array?i.BYTE:t instanceof Uint8Array?i.UNSIGNED_BYTE:t instanceof Int16Array?i.SHORT:t instanceof Uint16Array?i.UNSIGNED_SHORT:t instanceof Int32Array?i.INT:t instanceof Uint32Array?i.UNSIGNED_INT:t instanceof Float32Array?i.FLOAT:t instanceof Float64Array?i.DOUBLE:void 0},i.validate=function(t){return e(t)&&(t===i.BYTE||t===i.UNSIGNED_BYTE||t===i.SHORT||t===i.UNSIGNED_SHORT||t===i.INT||t===i.UNSIGNED_INT||t===i.FLOAT||t===i.DOUBLE)},i.createTypedArray=function(t,e){switch(t){case i.BYTE:return new Int8Array(e);case i.UNSIGNED_BYTE:return new Uint8Array(e);case i.SHORT:return new Int16Array(e);case i.UNSIGNED_SHORT:return new Uint16Array(e);case i.INT:return new Int32Array(e);case i.UNSIGNED_INT:return new Uint32Array(e);case i.FLOAT:return new Float32Array(e);case i.DOUBLE:return new Float64Array(e)}},i.createArrayBufferView=function(e,r,n,a){switch(n=t(n,0),a=t(a,(r.byteLength-n)/i.getSizeInBytes(e)),e){case i.BYTE:return new Int8Array(r,n,a);case i.UNSIGNED_BYTE:return new Uint8Array(r,n,a);case i.SHORT:return new Int16Array(r,n,a);case i.UNSIGNED_SHORT:return new Uint16Array(r,n,a);case i.INT:return new Int32Array(r,n,a);case i.UNSIGNED_INT:return new Uint32Array(r,n,a);case i.FLOAT:return new Float32Array(r,n,a);case i.DOUBLE:return new Float64Array(r,n,a)}},i.fromName=function(t){switch(t){case"BYTE":return i.BYTE;case"UNSIGNED_BYTE":return i.UNSIGNED_BYTE;case"SHORT":return i.SHORT;case"UNSIGNED_SHORT":return i.UNSIGNED_SHORT;case"INT":return i.INT;case"UNSIGNED_INT":return i.UNSIGNED_INT;case"FLOAT":return i.FLOAT;case"DOUBLE":return i.DOUBLE}},a(i)}),define("Core/GeometryType",["./freezeObject"],function(t){"use strict";var e={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return t(e)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(t,e){"use strict";var r={POINTS:e.POINTS,LINES:e.LINES,LINE_LOOP:e.LINE_LOOP,LINE_STRIP:e.LINE_STRIP,TRIANGLES:e.TRIANGLES,TRIANGLE_STRIP:e.TRIANGLE_STRIP,TRIANGLE_FAN:e.TRIANGLE_FAN,validate:function(t){return t===r.POINTS||t===r.LINES||t===r.LINE_LOOP||t===r.LINE_STRIP||t===r.TRIANGLES||t===r.TRIANGLE_STRIP||t===r.TRIANGLE_FAN}};return t(r)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(t,e,r,n,a){"use strict";function o(e){e=t(e,t.EMPTY_OBJECT),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=t(e.primitiveType,a.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=t(e.geometryType,n.NONE),this.boundingSphereCV=e.boundingSphereCV}return o.computeNumberOfVertices=function(t){var r=-1;for(var n in t.attributes)if(t.attributes.hasOwnProperty(n)&&e(t.attributes[n])&&e(t.attributes[n].values)){var a=t.attributes[n],o=a.values.length/a.componentsPerAttribute;r=o}return r},o}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(t,e,r){"use strict";function n(e){e=t(e,t.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=t(e.normalize,!1),this.values=e.values}return n}),define("Core/GeometryAttributes",["./defaultValue"],function(t){"use strict";function e(e){e=t(e,t.EMPTY_OBJECT),this.position=e.position,this.normal=e.normal,this.st=e.st,this.binormal=e.binormal,this.tangent=e.tangent,this.color=e.color}return e}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(t,e,r,n,a){"use strict";var o={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return o.getSizeInBytes=function(t){switch(t){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(e){return t(e)&&(e===o.UNSIGNED_BYTE||e===o.UNSIGNED_SHORT||e===o.UNSIGNED_INT)},o.createTypedArray=function(t,e){return t>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(e):new Uint16Array(e)},o.createTypedArrayFromArrayBuffer=function(t,e,r,a){return t>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(e,r,a):new Uint16Array(e,r,a)},r(o)}),define("Core/EllipsoidGeodesic",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(t,e,r,n,a,o,i,u){"use strict";function s(t){var e=t._uSquared,r=t._ellipsoid.maximumRadius,n=t._ellipsoid.minimumRadius,a=(r-n)/r,o=Math.cos(t._startHeading),i=Math.sin(t._startHeading),u=(1-a)*Math.tan(t._start.latitude),s=1/Math.sqrt(1+u*u),E=s*u,l=Math.atan2(u,o),c=s*i,f=c*c,_=1-f,R=Math.sqrt(_),T=e/4,h=T*T,A=h*T,d=h*h,S=1+T-3*h/4+5*A/4-175*d/64,m=1-T+15*h/8-35*A/8,N=1-3*T+35*h/4,C=1-5*T,I=S*l-m*Math.sin(2*l)*T/2-N*Math.sin(4*l)*h/16-C*Math.sin(6*l)*A/48-5*Math.sin(8*l)*d/512,p=t._constants;p.a=r,p.b=n,p.f=a,p.cosineHeading=o,p.sineHeading=i,p.tanU=u,p.cosineU=s,p.sineU=E,p.sigma=l,p.sineAlpha=c,p.sineSquaredAlpha=f,p.cosineSquaredAlpha=_,p.cosineAlpha=R, -p.u2Over4=T,p.u4Over16=h,p.u6Over64=A,p.u8Over256=d,p.a0=S,p.a1=m,p.a2=N,p.a3=C,p.distanceRatio=I}function E(t,e){return t*e*(4+t*(4-3*e))/16}function l(t,e,r,n,a,o,i){var u=E(t,r);return(1-u)*t*e*(n+u*a*(i+u*o*(2*i*i-1)))}function c(t,e,r,n,a,o,i){var s,E,c,f,_,R=(e-r)/e,T=o-n,h=Math.atan((1-R)*Math.tan(a)),A=Math.atan((1-R)*Math.tan(i)),d=Math.cos(h),S=Math.sin(h),m=Math.cos(A),N=Math.sin(A),C=d*m,I=d*N,p=S*N,M=S*m,O=T,g=u.TWO_PI,y=Math.cos(O),F=Math.sin(O);do{y=Math.cos(O),F=Math.sin(O);var L=I-M*y;c=Math.sqrt(m*m*F*F+L*L),E=p+C*y,s=Math.atan2(c,E);var v;0===c?(v=0,f=1):(v=C*F/c,f=1-v*v),g=O,_=E-2*p/f,isNaN(_)&&(_=0),O=T+l(R,v,f,s,c,E,_)}while(Math.abs(O-g)>u.EPSILON12);var U=f*(e*e-r*r)/(r*r),D=1+U*(4096+U*(U*(320-175*U)-768))/16384,P=U*(256+U*(U*(74-47*U)-128))/1024,B=_*_,w=P*c*(_+P*(E*(2*B-1)-P*_*(4*c*c-3)*(4*B-3)/6)/4),x=r*D*(s-w),G=Math.atan2(m*F,I-M*y),b=Math.atan2(d*F,I*y-M);t._distance=x,t._startHeading=G,t._endHeading=b,t._uSquared=U}function f(r,n,a,o){t.normalize(o.cartographicToCartesian(n,T),R),t.normalize(o.cartographicToCartesian(a,T),T);c(r,o.maximumRadius,o.minimumRadius,n.longitude,n.latitude,a.longitude,a.latitude),r._start=e.clone(n,r._start),r._end=e.clone(a,r._end),r._start.height=0,r._end.height=0,s(r)}function _(t,a,o){var u=r(o,i.WGS84);this._ellipsoid=u,this._start=new e,this._end=new e,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,n(t)&&n(a)&&f(this,t,a,u)}var R=new t,T=new t;return a(_.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return this._startHeading}},endHeading:{get:function(){return this._endHeading}}}),_.prototype.setEndPoints=function(t,e){f(this,t,e,this._ellipsoid)},_.prototype.interpolateUsingFraction=function(t,e){return this.interpolateUsingSurfaceDistance(this._distance*t,e)},_.prototype.interpolateUsingSurfaceDistance=function(t,r){var a=this._constants,o=a.distanceRatio+t/a.b,i=Math.cos(2*o),u=Math.cos(4*o),s=Math.cos(6*o),E=Math.sin(2*o),c=Math.sin(4*o),f=Math.sin(6*o),_=Math.sin(8*o),R=o*o,T=o*R,h=a.u8Over256,A=a.u2Over4,d=a.u6Over64,S=a.u4Over16,m=2*T*h*i/3+o*(1-A+7*S/4-15*d/4+579*h/64-(S-15*d/4+187*h/16)*i-(5*d/4-115*h/16)*u-29*h*s/16)+(A/2-S+71*d/32-85*h/16)*E+(5*S/16-5*d/4+383*h/96)*c-R*((d-11*h/2)*E+5*h*c/2)+(29*d/96-29*h/16)*f+539*h*_/1536,N=Math.asin(Math.sin(m)*a.cosineAlpha),C=Math.atan(a.a/a.b*Math.tan(N));m-=a.sigma;var I=Math.cos(2*a.sigma+m),p=Math.sin(m),M=Math.cos(m),O=a.cosineU*M,g=a.sineU*p,y=Math.atan2(p*a.sineHeading,O-g*a.cosineHeading),F=y-l(a.f,a.sineAlpha,a.cosineSquaredAlpha,m,p,M,I);return n(r)?(r.longitude=this._start.longitude+F,r.latitude=C,r.height=0,r):new e(this._start.longitude+F,C,0)},_}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(t,e){"use strict";function r(t,r,n){var a=t+r;return e.sign(t)!==e.sign(r)&&Math.abs(a/Math.max(Math.abs(t),Math.abs(r)))<n?0:a}var n={};return n.computeDiscriminant=function(t,e,r){var n=e*e-4*t*r;return n},n.computeRealRoots=function(t,n,a){var o;if(0===t)return 0===n?[]:[-a/n];if(0===n){if(0===a)return[0,0];var i=Math.abs(a),u=Math.abs(t);if(i<u&&i/u<e.EPSILON14)return[0,0];if(i>u&&u/i<e.EPSILON14)return[];if(o=-a/t,o<0)return[];var s=Math.sqrt(o);return[-s,s]}if(0===a)return o=-n/t,o<0?[o,0]:[0,o];var E=n*n,l=4*t*a,c=r(E,-l,e.EPSILON14);if(c<0)return[];var f=-.5*r(n,e.sign(n)*Math.sqrt(c),e.EPSILON14);return n>0?[f/t,a/f]:[a/f,f/t]},n}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(t,e){"use strict";function r(t,e,r,n){var a,o,i=t,u=e/3,s=r/3,E=n,l=i*s,c=u*E,f=u*u,_=s*s,R=i*s-f,T=i*E-u*s,h=u*E-_,A=4*R*h-T*T;if(A<0){var d,S,m;f*c>=l*_?(d=i,S=R,m=-2*u*R+i*T):(d=E,S=h,m=-E*T+2*s*h);var N=m<0?-1:1,C=-N*Math.abs(d)*Math.sqrt(-A);o=-m+C;var I=o/2,p=I<0?-Math.pow(-I,1/3):Math.pow(I,1/3),M=o===C?-p:-S/p;return a=S<=0?p+M:-m/(p*p+M*M+S),f*c>=l*_?[(a-u)/i]:[-E/(a+s)]}var O=R,g=-2*u*R+i*T,y=h,F=-E*T+2*s*h,L=Math.sqrt(A),v=Math.sqrt(3)/2,U=Math.abs(Math.atan2(i*L,-g)/3);a=2*Math.sqrt(-O);var D=Math.cos(U);o=a*D;var P=a*(-D/2-v*Math.sin(U)),B=o+P>2*u?o-u:P-u,w=i,x=B/w;U=Math.abs(Math.atan2(E*L,-F)/3),a=2*Math.sqrt(-y),D=Math.cos(U),o=a*D,P=a*(-D/2-v*Math.sin(U));var G=-E,b=o+P<2*s?o+s:P+s,z=G/b,H=w*b,V=-B*b-w*G,q=B*G,X=(s*V-u*q)/(-u*V+s*H);return x<=X?x<=z?X<=z?[x,X,z]:[x,z,X]:[z,x,X]:x<=z?[X,x,z]:X<=z?[X,z,x]:[z,X,x]}var n={};return n.computeDiscriminant=function(t,e,r,n){var a=t*t,o=e*e,i=r*r,u=n*n,s=18*t*e*r*n+o*i-27*a*u-4*(t*i*r+o*e*n);return s},n.computeRealRoots=function(t,n,a,o){var i,u;if(0===t)return e.computeRealRoots(n,a,o);if(0===n){if(0===a){if(0===o)return[0,0,0];u=-o/t;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===o?(i=e.computeRealRoots(t,0,a),0===i.Length?[0]:[i[0],0,i[1]]):r(t,0,a,o)}return 0===a?0===o?(u=-n/t,u<0?[u,0,0]:[0,0,u]):r(t,n,0,o):0===o?(i=e.computeRealRoots(t,n,a),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(t,n,a,o)},n}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(t,e,r,n){"use strict";function a(e,a,o,i){var u=e*e,s=a-3*u/8,E=o-a*e/2+u*e/8,l=i-o*e/4+a*u/16-3*u*u/256,c=t.computeRealRoots(1,2*s,s*s-4*l,-E*E);if(c.length>0){var f=-e/4,_=c[c.length-1];if(Math.abs(_)<r.EPSILON14){var R=n.computeRealRoots(1,s,l);if(2===R.length){var T,h=R[0],A=R[1];if(h>=0&&A>=0){var d=Math.sqrt(h),S=Math.sqrt(A);return[f-S,f-d,f+d,f+S]}if(h>=0&&A<0)return T=Math.sqrt(h),[f-T,f+T];if(h<0&&A>=0)return T=Math.sqrt(A),[f-T,f+T]}return[]}if(_>0){var m=Math.sqrt(_),N=(s+_-E/m)/2,C=(s+_+E/m)/2,I=n.computeRealRoots(1,m,N),p=n.computeRealRoots(1,-m,C);return 0!==I.length?(I[0]+=f,I[1]+=f,0!==p.length?(p[0]+=f,p[1]+=f,I[1]<=p[0]?[I[0],I[1],p[0],p[1]]:p[1]<=I[0]?[p[0],p[1],I[0],I[1]]:I[0]>=p[0]&&I[1]<=p[1]?[p[0],I[0],I[1],p[1]]:p[0]>=I[0]&&p[1]<=I[1]?[I[0],p[0],p[1],I[1]]:I[0]>p[0]&&I[0]<p[1]?[p[0],I[0],p[1],I[1]]:[I[0],p[0],I[1],p[1]]):I):0!==p.length?(p[0]+=f,p[1]+=f,p):[]}}return[]}function o(e,a,o,i){var u=o*o,s=a*a,E=e*e,l=-2*a,c=o*e+s-4*i,f=E*i-o*a*e+u,_=t.computeRealRoots(1,l,c,f);if(_.length>0){var R,T,h=_[0],A=a-h,d=A*A,S=e/2,m=A/2,N=d-4*i,C=d+4*Math.abs(i),I=E-4*h,p=E+4*Math.abs(h);if(h<0||N*p<I*C){var M=Math.sqrt(I);R=M/2,T=0===M?0:(e*m-o)/M}else{var O=Math.sqrt(N);R=0===O?0:(e*m-o)/O,T=O/2}var g,y;0===S&&0===R?(g=0,y=0):r.sign(S)===r.sign(R)?(g=S+R,y=h/g):(y=S-R,g=h/y);var F,L;0===m&&0===T?(F=0,L=0):r.sign(m)===r.sign(T)?(F=m+T,L=i/F):(L=m-T,F=i/L);var v=n.computeRealRoots(1,g,F),U=n.computeRealRoots(1,y,L);if(0!==v.length)return 0!==U.length?v[1]<=U[0]?[v[0],v[1],U[0],U[1]]:U[1]<=v[0]?[U[0],U[1],v[0],v[1]]:v[0]>=U[0]&&v[1]<=U[1]?[U[0],v[0],v[1],U[1]]:U[0]>=v[0]&&U[1]<=v[1]?[v[0],U[0],U[1],v[1]]:v[0]>U[0]&&v[0]<U[1]?[U[0],v[0],U[1],v[1]]:[v[0],U[0],v[1],U[1]]:v;if(0!==U.length)return U}return[]}var i={};return i.computeDiscriminant=function(t,e,r,n,a){var o=t*t,i=o*t,u=e*e,s=u*e,E=r*r,l=E*r,c=n*n,f=c*n,_=a*a,R=_*a,T=u*E*c-4*s*f-4*t*l*c+18*t*e*r*f-27*o*c*c+256*i*R+a*(18*s*r*n-4*u*l+16*t*E*E-80*t*e*E*n-6*t*u*c+144*o*r*c)+_*(144*t*u*r-27*u*u-128*o*E-192*o*e*n);return T},i.computeRealRoots=function(e,n,i,u,s){if(Math.abs(e)<r.EPSILON15)return t.computeRealRoots(n,i,u,s);var E=n/e,l=i/e,c=u/e,f=s/e,_=E<0?1:0;switch(_+=l<0?_+1:_,_+=c<0?_+1:_,_+=f<0?_+1:_){case 0:return a(E,l,c,f);case 1:return o(E,l,c,f);case 2:return o(E,l,c,f);case 3:return a(E,l,c,f);case 4:return a(E,l,c,f);case 5:return o(E,l,c,f);case 6:return a(E,l,c,f);case 7:return a(E,l,c,f);case 8:return o(E,l,c,f);case 9:return a(E,l,c,f);case 10:return a(E,l,c,f);case 11:return o(E,l,c,f);case 12:return a(E,l,c,f);case 13:return a(E,l,c,f);case 14:return a(E,l,c,f);case 15:return a(E,l,c,f);default:return}},i}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(t,e,r,n){"use strict";function a(r,n){n=t.clone(e(n,t.ZERO)),t.equals(n,t.ZERO)||t.normalize(n,n),this.origin=t.clone(e(r,t.ZERO)),this.direction=n}return a.getPoint=function(e,n,a){return r(a)||(a=new t),a=t.multiplyByScalar(e.direction,n,a),t.add(e.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(t,e,r,n,a,o,i,u,s,E){"use strict";function l(t,e,r,n){var a=e*e-4*t*r;if(!(a<0)){if(a>0){var o=1/(2*t),i=Math.sqrt(a),u=(-e+i)*o,s=(-e-i)*o;return u<s?(n.root0=u,n.root1=s):(n.root0=s,n.root1=u),n}var E=-e/(2*t);if(0!==E)return n.root0=n.root1=E,n}}function c(e,r,a){n(a)||(a={});var o=e.origin,i=e.direction,u=r.center,s=r.radius*r.radius,E=t.subtract(o,u,A),c=t.dot(i,i),f=2*t.dot(i,E),_=t.magnitudeSquared(E)-s,R=l(c,f,_,N);if(n(R))return a.start=R.root0,a.stop=R.root1,a}function f(t,e,r){var n=t+e;return o.sign(t)!==o.sign(e)&&Math.abs(n/Math.max(Math.abs(t),Math.abs(e)))<r?0:n}function _(e,r,n,a,E){var l,c=a*a,_=E*E,R=(e[i.COLUMN1ROW1]-e[i.COLUMN2ROW2])*_,T=E*(a*f(e[i.COLUMN1ROW0],e[i.COLUMN0ROW1],o.EPSILON15)+r.y),h=e[i.COLUMN0ROW0]*c+e[i.COLUMN2ROW2]*_+a*r.x+n,A=_*f(e[i.COLUMN2ROW1],e[i.COLUMN1ROW2],o.EPSILON15),d=E*(a*f(e[i.COLUMN2ROW0],e[i.COLUMN0ROW2])+r.z),S=[];if(0===d&&0===A){if(l=u.computeRealRoots(R,T,h),0===l.length)return S;var m=l[0],N=Math.sqrt(Math.max(1-m*m,0));if(S.push(new t(a,E*m,E*-N)),S.push(new t(a,E*m,E*N)),2===l.length){var C=l[1],I=Math.sqrt(Math.max(1-C*C,0));S.push(new t(a,E*C,E*-I)),S.push(new t(a,E*C,E*I))}return S}var p=d*d,M=A*A,O=R*R,g=d*A,y=O+M,F=2*(T*R+g),L=2*h*R+T*T-M+p,v=2*(h*T-g),U=h*h-p;if(0===y&&0===F&&0===L&&0===v)return S;l=s.computeRealRoots(y,F,L,v,U);var D=l.length;if(0===D)return S;for(var P=0;P<D;++P){var B,w=l[P],x=w*w,G=Math.max(1-x,0),b=Math.sqrt(G);B=o.sign(R)===o.sign(h)?f(R*x+h,T*w,o.EPSILON12):o.sign(h)===o.sign(T*w)?f(R*x,T*w+h,o.EPSILON12):f(R*x+T*w,h,o.EPSILON12);var z=f(A*w,d,o.EPSILON15),H=B*z;H<0?S.push(new t(a,E*w,E*b)):H>0?S.push(new t(a,E*w,E*-b)):0!==b?(S.push(new t(a,E*w,E*-b)),S.push(new t(a,E*w,E*b)),++P):S.push(new t(a,E*w,E*b))}return S}var R={};R.rayPlane=function(e,r,a){n(a)||(a=new t);var i=e.origin,u=e.direction,s=r.normal,E=t.dot(s,u);if(!(Math.abs(E)<o.EPSILON15)){var l=(-r.distance-t.dot(s,i))/E;if(!(l<0))return a=t.multiplyByScalar(u,l,a),t.add(i,a,a)}};var T=new t,h=new t,A=new t,d=new t,S=new t;R.rayTriangleParametric=function(e,n,a,i,u){u=r(u,!1);var s,E,l,c,f,_=e.origin,R=e.direction,m=t.subtract(a,n,T),N=t.subtract(i,n,h),C=t.cross(R,N,A),I=t.dot(m,C);if(u){if(I<o.EPSILON6)return;if(s=t.subtract(_,n,d),l=t.dot(s,C),l<0||l>I)return;if(E=t.cross(s,m,S),c=t.dot(R,E),c<0||l+c>I)return;f=t.dot(N,E)/I}else{if(Math.abs(I)<o.EPSILON6)return;var p=1/I;if(s=t.subtract(_,n,d),l=t.dot(s,C)*p,l<0||l>1)return;if(E=t.cross(s,m,S),c=t.dot(R,E)*p,c<0||l+c>1)return;f=t.dot(N,E)*p}return f},R.rayTriangle=function(e,r,a,o,i,u){var s=R.rayTriangleParametric(e,r,a,o,i);if(n(s)&&!(s<0))return n(u)||(u=new t),t.multiplyByScalar(e.direction,s,u),t.add(e.origin,u,u)};var m=new E;R.lineSegmentTriangle=function(e,r,a,o,i,u,s){var E=m;t.clone(e,E.origin),t.subtract(r,e,E.direction),t.normalize(E.direction,E.direction);var l=R.rayTriangleParametric(E,a,o,i,u);if(!(!n(l)||l<0||l>t.distance(e,r)))return n(s)||(s=new t),t.multiplyByScalar(E.direction,l,s),t.add(E.origin,s,s)};var N={root0:0,root1:0};R.raySphere=function(t,e,r){if(r=c(t,e,r),n(r)&&!(r.stop<0))return r.start=Math.max(r.start,0),r};var C=new E;R.lineSegmentSphere=function(e,r,a,o){var i=C;t.clone(e,i.origin);var u=t.subtract(r,e,i.direction),s=t.magnitude(u);if(t.normalize(u,u),o=c(i,a,o),!(!n(o)||o.stop<0||o.start>s))return o.start=Math.max(o.start,0),o.stop=Math.min(o.stop,s),o};var I=new t,p=new t;R.rayEllipsoid=function(e,r){var n,a,o,i,u,s=r.oneOverRadii,E=t.multiplyComponents(s,e.origin,I),l=t.multiplyComponents(s,e.direction,p),c=t.magnitudeSquared(E),f=t.dot(E,l);if(c>1){if(f>=0)return;var _=f*f;if(n=c-1,a=t.magnitudeSquared(l),o=a*n,_<o)return;if(_>o){i=f*f-o,u=-f+Math.sqrt(i);var R=u/a,T=n/u;return R<T?{start:R,stop:T}:{start:T,stop:R}}var h=Math.sqrt(n/a);return{start:h,stop:h}}return c<1?(n=c-1,a=t.magnitudeSquared(l),o=a*n,i=f*f-o,u=-f+Math.sqrt(i),{start:0,stop:u/a}):f<0?(a=t.magnitudeSquared(l),{start:0,stop:-f/a}):void 0};var M=new t,O=new t,g=new t,y=new t,F=new t,L=new i,v=new i,U=new i,D=new i,P=new i,B=new i,w=new i,x=new t,G=new t,b=new e;R.grazingAltitudeLocation=function(e,r){var a=e.origin,u=e.direction;if(!t.equals(a,t.ZERO)){var s=r.geodeticSurfaceNormal(a,M);if(t.dot(u,s)>=0)return a}var E=n(this.rayEllipsoid(e,r)),l=r.transformPositionToScaledSpace(u,M),c=t.normalize(l,l),f=t.mostOrthogonalAxis(l,y),R=t.normalize(t.cross(f,c,O),O),T=t.normalize(t.cross(c,R,g),g),h=L;h[0]=c.x,h[1]=c.y,h[2]=c.z,h[3]=R.x,h[4]=R.y,h[5]=R.z,h[6]=T.x,h[7]=T.y,h[8]=T.z;var A=i.transpose(h,v),d=i.fromScale(r.radii,U),S=i.fromScale(r.oneOverRadii,D),m=P;m[0]=0,m[1]=-u.z,m[2]=u.y,m[3]=u.z,m[4]=0,m[5]=-u.x,m[6]=-u.y,m[7]=u.x,m[8]=0;var N,C,I=i.multiply(i.multiply(A,S,B),m,B),p=i.multiply(i.multiply(I,d,w),h,w),z=i.multiplyByVector(I,a,F),H=_(p,t.negate(z,M),0,0,1),V=H.length;if(V>0){for(var q=t.clone(t.ZERO,G),X=Number.NEGATIVE_INFINITY,W=0;W<V;++W){N=i.multiplyByVector(d,i.multiplyByVector(h,H[W],x),x);var Y=t.normalize(t.subtract(N,a,y),y),K=t.dot(Y,u);K>X&&(X=K,q=t.clone(N,q))}var k=r.cartesianToCartographic(q,b);return X=o.clamp(X,0,1),C=t.magnitude(t.subtract(q,a,y))*Math.sqrt(1-X*X),C=E?-C:C,k.height=C,r.cartographicToCartesian(k,new t)}};var z=new t;return R.lineSegmentPlane=function(e,r,a,i){n(i)||(i=new t);var u=t.subtract(r,e,z),s=a.normal,E=t.dot(s,u);if(!(Math.abs(E)<o.EPSILON6)){var l=t.dot(s,e),c=-(a.distance+l)/E;if(!(c<0||c>1))return t.multiplyByScalar(u,c,i),t.add(e,i,i),i}},R.trianglePlaneIntersection=function(e,r,n,a){var o=a.normal,i=a.distance,u=t.dot(o,e)+i<0,s=t.dot(o,r)+i<0,E=t.dot(o,n)+i<0,l=0;l+=u?1:0,l+=s?1:0,l+=E?1:0;var c,f;if(1!==l&&2!==l||(c=new t,f=new t),1===l){if(u)return R.lineSegmentPlane(e,r,a,c),R.lineSegmentPlane(e,n,a,f),{positions:[e,r,n,c,f],indices:[0,3,4,1,2,4,1,4,3]};if(s)return R.lineSegmentPlane(r,n,a,c),R.lineSegmentPlane(r,e,a,f),{positions:[e,r,n,c,f],indices:[1,3,4,2,0,4,2,4,3]};if(E)return R.lineSegmentPlane(n,e,a,c),R.lineSegmentPlane(n,r,a,f),{positions:[e,r,n,c,f],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return R.lineSegmentPlane(r,e,a,c),R.lineSegmentPlane(n,e,a,f),{positions:[e,r,n,c,f],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return R.lineSegmentPlane(n,r,a,c),R.lineSegmentPlane(e,r,a,f),{positions:[e,r,n,c,f],indices:[2,0,4,2,4,3,1,3,4]};if(!E)return R.lineSegmentPlane(e,n,a,c),R.lineSegmentPlane(r,n,a,f),{positions:[e,r,n,c,f],indices:[0,1,4,0,4,3,2,3,4]}}},R}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(t,e,r,n){"use strict";function a(e,r){this.normal=t.clone(e),this.distance=r}a.fromPointNormal=function(r,n,o){var i=-t.dot(n,r);return e(o)?(t.clone(n,o.normal),o.distance=i,o):new a(n,i)};var o=new t;return a.fromCartesian4=function(r,n){var i=t.fromCartesian4(r,o),u=r.w;return e(n)?(t.clone(i,n.normal),n.distance=u,n):new a(i,u)},a.getPointDistance=function(e,r){return t.dot(e.normal,r)+e.distance},a.ORIGIN_XY_PLANE=n(new a(t.UNIT_Z,0)),a.ORIGIN_YZ_PLANE=n(new a(t.UNIT_X,0)),a.ORIGIN_ZX_PLANE=n(new a(t.UNIT_Y,0)),a}),define("Core/PolylinePipeline",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidGeodesic","./IntersectionTests","./isArray","./Math","./Matrix4","./Plane"],function(t,e,r,n,a,o,i,u,s,E,l,c){"use strict";function f(t,e,r){var n=p;n.length=t;var a;if(e===r){for(a=0;a<t;a++)n[a]=e;return n}var o=r-e,i=o/t;for(a=0;a<t;a++){var u=e+a*i;n[a]=u}return n}function _(e,r,n,a,o,i,u,s){var E=a.scaleToGeodeticSurface(e,y),l=a.scaleToGeodeticSurface(r,F),c=R.numberOfPoints(e,r,n),_=a.cartesianToCartographic(E,M),T=a.cartesianToCartographic(l,O),h=f(c,o,i);L.setEndPoints(_,T);var A=L.surfaceDistance/c,d=s;_.height=o;var S=a.cartographicToCartesian(_,g);t.pack(S,u,d),d+=3;for(var m=1;m<c;m++){var N=L.interpolateUsingSurfaceDistance(m*A,O);N.height=h[m],S=a.cartographicToCartesian(N,g),t.pack(S,u,d),d+=3}return d}var R={};R.numberOfPoints=function(e,r,n){var a=t.distance(e,r);return Math.ceil(a/n)};var T=new e;R.extractHeights=function(t,e){for(var r=t.length,n=new Array(r),a=0;a<r;a++){var o=t[a];n[a]=e.cartesianToCartographic(o,T).height}return n};var h=new l,A=new t,d=new t,S=new c(t.ZERO,0),m=new t,N=new c(t.ZERO,0),C=new t,I=new t,p=[],M=new e,O=new e,g=new t,y=new t,F=new t,L=new i;return R.wrapLongitude=function(e,a){var o=[],i=[];if(n(e)&&e.length>0){a=r(a,l.IDENTITY);var s=l.inverseTransformation(a,h),E=l.multiplyByPoint(s,t.ZERO,A),f=l.multiplyByPointAsVector(s,t.UNIT_Y,d),_=c.fromPointNormal(E,f,S),R=l.multiplyByPointAsVector(s,t.UNIT_X,m),T=c.fromPointNormal(E,R,N),p=1;o.push(t.clone(e[0]));for(var M=o[0],O=e.length,g=1;g<O;++g){var y=e[g];if(c.getPointDistance(T,M)<0||c.getPointDistance(T,y)<0){var F=u.lineSegmentPlane(M,y,_,C);if(n(F)){var L=t.multiplyByScalar(f,5e-9,I);c.getPointDistance(_,M)<0&&t.negate(L,L),o.push(t.add(F,L,new t)),i.push(p+1),t.negate(L,L),o.push(t.add(F,L,new t)),p=1}}o.push(t.clone(e[g])),p++,M=y}i.push(p)}return{positions:o,lengths:i}},R.generateArc=function(e){n(e)||(e={});var a=e.positions,i=a.length,u=r(e.ellipsoid,o.WGS84),l=r(e.height,0),c=s(l);if(i<1)return[];if(1===i){var f=u.scaleToGeodeticSurface(a[0],y);if(l=c?l[0]:l,0!==l){var T=u.geodeticSurfaceNormal(f,g);t.multiplyByScalar(T,l,T),t.add(f,T,f)}return[f.x,f.y,f.z]}var h=e.minDistance;if(!n(h)){var A=r(e.granularity,E.RADIANS_PER_DEGREE);h=E.chordLength(A,u.maximumRadius)}var d,S=0;for(d=0;d<i-1;d++)S+=R.numberOfPoints(a[d],a[d+1],h);var m=3*(S+1),N=new Array(m),C=0;for(d=0;d<i-1;d++){var I=a[d],O=a[d+1],F=c?l[d]:l,L=c?l[d+1]:l;C=_(I,O,h,u,F,L,N,C)}p.length=0;var v=a[i-1],U=u.cartesianToCartographic(v,M);U.height=c?l[i-1]:l;var D=u.cartographicToCartesian(U,g);return t.pack(D,N,m-3),N},R.generateCartesianArc=function(e){for(var r=R.generateArc(e),n=r.length/3,a=new Array(n),o=0;o<n;o++)a[o]=t.unpack(r,3*o);return a},R}),define("Core/SimplePolylineGeometry",["./BoundingSphere","./Cartesian3","./Color","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolylinePipeline","./PrimitiveType"],function(t,e,r,n,a,o,i,u,s,E,l,c,f,_,R){"use strict";function T(t,e,n,a,o,i,u){var s,E=_.numberOfPoints(t,e,o),l=n.red,c=n.green,f=n.blue,R=n.alpha,T=a.red,h=a.green,A=a.blue,d=a.alpha;if(r.equals(n,a)){for(s=0;s<E;s++)i[u++]=r.floatToByte(l),i[u++]=r.floatToByte(c),i[u++]=r.floatToByte(f),i[u++]=r.floatToByte(R);return u}var S=(T-l)/E,m=(h-c)/E,N=(A-f)/E,C=(d-R)/E,I=u;for(s=0;s<E;s++)i[I++]=r.floatToByte(l+s*S),i[I++]=r.floatToByte(c+s*m),i[I++]=r.floatToByte(f+s*N),i[I++]=r.floatToByte(R+s*C);return I}function h(t){t=a(t,a.EMPTY_OBJECT);var n=t.positions,i=t.colors,s=a(t.colorsPerVertex,!1);this._positions=n,this._colors=i,this._colorsPerVertex=s,this._followSurface=a(t.followSurface,!0),this._granularity=a(t.granularity,f.RADIANS_PER_DEGREE),this._ellipsoid=a(t.ellipsoid,u.WGS84),this._workerName="createSimplePolylineGeometry";var E=1+n.length*e.packedLength;E+=o(i)?1+i.length*r.packedLength:1,this.packedLength=E+u.packedLength+3}h.pack=function(t,n,i){i=a(i,0);var s,E=t._positions,l=E.length;for(n[i++]=l,s=0;s<l;++s,i+=e.packedLength)e.pack(E[s],n,i);var c=t._colors;for(l=o(c)?c.length:0,n[i++]=l,s=0;s<l;++s,i+=r.packedLength)r.pack(c[s],n,i);return u.pack(t._ellipsoid,n,i),i+=u.packedLength,n[i++]=t._colorsPerVertex?1:0,n[i++]=t._followSurface?1:0,n[i]=t._granularity,n},h.unpack=function(t,n,i){n=a(n,0);var s,E=t[n++],l=new Array(E);for(s=0;s<E;++s,n+=e.packedLength)l[s]=e.unpack(t,n);E=t[n++];var c=E>0?new Array(E):void 0;for(s=0;s<E;++s,n+=r.packedLength)c[s]=r.unpack(t,n);var f=u.unpack(t,n);n+=u.packedLength;var _=1===t[n++],R=1===t[n++],T=t[n];return o(i)?(i._positions=l,i._colors=c,i._ellipsoid=f,i._colorsPerVertex=_,i._followSurface=R,i._granularity=T,i):new h({positions:l,colors:c,ellipsoid:f,colorsPerVertex:_,followSurface:R,granularity:T})};var A=new Array(2),d=new Array(2),S={positions:A,height:d,ellipsoid:void 0,minDistance:void 0};return h.createGeometry=function(a){var i,u,h,m,N,C=a._positions,I=a._colors,p=a._colorsPerVertex,M=a._followSurface,O=a._granularity,g=a._ellipsoid,y=f.chordLength(O,g.maximumRadius),F=o(I)&&!p,L=C.length,v=0;if(M){var U=_.extractHeights(C,g),D=S;if(D.minDistance=y,D.ellipsoid=g,F){var P=0;for(i=0;i<L-1;i++)P+=_.numberOfPoints(C[i],C[i+1],y)+1;u=new Float64Array(3*P),m=new Uint8Array(4*P),D.positions=A,D.height=d;var B=0;for(i=0;i<L-1;++i){A[0]=C[i],A[1]=C[i+1],d[0]=U[i],d[1]=U[i+1];var w=_.generateArc(D);if(o(I)){var x=w.length/3;N=I[i];for(var G=0;G<x;++G)m[B++]=r.floatToByte(N.red),m[B++]=r.floatToByte(N.green),m[B++]=r.floatToByte(N.blue),m[B++]=r.floatToByte(N.alpha)}u.set(w,v),v+=w.length}}else if(D.positions=C,D.height=U,u=new Float64Array(_.generateArc(D)),o(I)){for(m=new Uint8Array(u.length/3*4),i=0;i<L-1;++i){var b=C[i],z=C[i+1],H=I[i],V=I[i+1];v=T(b,z,H,V,y,m,v)}var q=I[L-1];m[v++]=r.floatToByte(q.red),m[v++]=r.floatToByte(q.green),m[v++]=r.floatToByte(q.blue),m[v++]=r.floatToByte(q.alpha)}}else{h=F?2*L-2:L,u=new Float64Array(3*h),m=o(I)?new Uint8Array(4*h):void 0;var X=0,W=0;for(i=0;i<L;++i){var Y=C[i];if(F&&i>0&&(e.pack(Y,u,X),X+=3,N=I[i-1],m[W++]=r.floatToByte(N.red),m[W++]=r.floatToByte(N.green),m[W++]=r.floatToByte(N.blue),m[W++]=r.floatToByte(N.alpha)),F&&i===L-1)break;e.pack(Y,u,X),X+=3,o(I)&&(N=I[i],m[W++]=r.floatToByte(N.red),m[W++]=r.floatToByte(N.green),m[W++]=r.floatToByte(N.blue),m[W++]=r.floatToByte(N.alpha))}}var K=new l;K.position=new E({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:u}),o(I)&&(K.color=new E({componentDatatype:n.UNSIGNED_BYTE,componentsPerAttribute:4,values:m,normalize:!0})),h=u.length/3;var k=2*(h-1),Z=c.createTypedArray(h,k),j=0;for(i=0;i<h-1;++i)Z[j++]=i,Z[j++]=i+1;return new s({attributes:K,indices:Z,primitiveType:R.LINES,boundingSphere:t.fromPoints(C)})},h}),define("Workers/createSimplePolylineGeometry",["../Core/defined","../Core/Ellipsoid","../Core/SimplePolylineGeometry"],function(t,e,r){"use strict";function n(n,a){return t(a)&&(n=r.unpack(n,a)),n._ellipsoid=e.clone(n._ellipsoid),r.createGeometry(n)}return n})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function r(e){return e+" is required, actual value was undefined"}function n(e,t,r){return"Expected "+r+" to be typeof "+t+", actual typeof was "+e}var a={};return a.typeOf={},a.defined=function(n,a){if(!e(a))throw new t(r(n))},a.typeOf.func=function(e,r){if("function"!=typeof r)throw new t(n(typeof r,"function",e))},a.typeOf.string=function(e,r){if("string"!=typeof r)throw new t(n(typeof r,"string",e))},a.typeOf.number=function(e,r){if("number"!=typeof r)throw new t(n(typeof r,"number",e))},a.typeOf.number.lessThan=function(e,r,n){if(a.typeOf.number(e,r),r>=n)throw new t("Expected "+e+" to be less than "+n+", actual value was "+r)},a.typeOf.number.lessThanOrEquals=function(e,r,n){if(a.typeOf.number(e,r),r>n)throw new t("Expected "+e+" to be less than or equal to "+n+", actual value was "+r)},a.typeOf.number.greaterThan=function(e,r,n){if(a.typeOf.number(e,r),r<=n)throw new t("Expected "+e+" to be greater than "+n+", actual value was "+r)},a.typeOf.number.greaterThanOrEquals=function(e,r,n){if(a.typeOf.number(e,r),r<n)throw new t("Expected "+e+" to be greater than or equal to"+n+", actual value was "+r)},a.typeOf.object=function(e,r){if("object"!=typeof r)throw new t(n(typeof r,"object",e))},a.typeOf.bool=function(e,r){if("boolean"!=typeof r)throw new t(n(typeof r,"boolean",e))},a}),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";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),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^=e<<7&2636928640,e^=e<<15&4022730752,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,r,n){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:e<0?-1:0},a.signNotZero=function(e){return e<0?-1:1},a.toSNorm=function(e,r){return r=t(r,255),Math.round((.5*a.clamp(e,-1,1)+.5)*r)},a.fromSNorm=function(e,r){return r=t(r,255),a.clamp(e,0,r)/r*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t-r)},a.cosh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t+r)},a.lerp=function(e,t,r){return(1-r)*e+r*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){var t=a.TWO_PI,r=e-Math.floor(e/t)*t;return r<-Math.PI?r+t:r>=Math.PI?r-t:r},a.clampToLatitudeRange=function(e){return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){return(e%t+t)%t},a.equalsEpsilon=function(e,r,n,a){a=t(a,n);var o=Math.abs(e-r);return o<=a||o<=n*Math.max(Math.abs(e),Math.abs(r))};var o=[1];a.factorial=function(e){var t=o.length;if(e>=t)for(var r=o[t-1],n=t;n<=e;n++)o.push(r*n);return o[e]},a.incrementWrap=function(e,r,n){return n=t(n,0),++e,e>r&&(e=n),e},a.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,r){return e<t?t:e>r?r:e};var i=new e;return a.setRandomNumberSeed=function(t){i=new e(t)},a.nextRandomNumber=function(){return i.random()},a.acosClamped=function(e){return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){return Math.log(e)/Math.log(t)},a.fog=function(e,t){var r=e*t;return 1-Math.exp(-(r*r))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,o){"use strict";function i(e,r,n){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0)}i.fromSpherical=function(e,n){r(n)||(n=new i);var a=e.clock,o=e.cone,u=t(e.magnitude,1),s=u*Math.sin(o);return n.x=s*Math.cos(a),n.y=s*Math.sin(a),n.z=u*Math.cos(o),n},i.fromElements=function(e,t,n,a){return r(a)?(a.x=e,a.y=t,a.z=n,a):new i(e,t,n)},i.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new i(e.x,e.y,e.z)},i.fromCartesian4=i.clone,i.packedLength=3,i.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n]=e.z,r},i.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new i),a.x=e[n++],a.y=e[n++],a.z=e[n],a},i.packArray=function(e,t){var n=e.length;r(t)?t.length=3*n:t=new Array(3*n);for(var a=0;a<n;++a)i.pack(e[a],t,3*a);return t},i.unpackArray=function(e,t){var n=e.length;r(t)?t.length=n/3:t=new Array(n/3);for(var a=0;a<n;a+=3){var o=a/3;t[o]=i.unpack(e,a,t[o])}return t},i.fromArray=i.unpack,i.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},i.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},i.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},i.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},i.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},i.magnitude=function(e){return Math.sqrt(i.magnitudeSquared(e))};var u=new i;i.distance=function(e,t){return i.subtract(e,t,u),i.magnitude(u)},i.distanceSquared=function(e,t){return i.subtract(e,t,u),i.magnitudeSquared(u)},i.normalize=function(e,t){var r=i.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t.z=e.z/r,t},i.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},i.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},i.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r.z=e.z/t.z,r},i.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},i.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},i.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*t,r},i.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r.z=e.z/t,r},i.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},i.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 s=new i;i.lerp=function(e,t,r,n){return i.multiplyByScalar(t,r,s),n=i.multiplyByScalar(e,1-r,n),i.add(s,n,n)};var E=new i,l=new i;i.angleBetween=function(e,t){i.normalize(e,E),i.normalize(t,l);var r=i.dot(E,l),n=i.magnitude(i.cross(E,l,E));return Math.atan2(n,r)};var c=new i;i.mostOrthogonalAxis=function(e,t){var r=i.normalize(e,c);return i.abs(r,r),t=r.x<=r.y?r.x<=r.z?i.clone(i.UNIT_X,t):i.clone(i.UNIT_Z,t):r.y<=r.z?i.clone(i.UNIT_Y,t):i.clone(i.UNIT_Z,t)},i.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},i.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]},i.equalsEpsilon=function(e,t,n,a){return e===t||r(e)&&r(t)&&o.equalsEpsilon(e.x,t.x,n,a)&&o.equalsEpsilon(e.y,t.y,n,a)&&o.equalsEpsilon(e.z,t.z,n,a)},i.cross=function(e,t,r){var n=e.x,a=e.y,o=e.z,i=t.x,u=t.y,s=t.z,E=a*s-o*u,l=o*i-n*s,c=n*u-a*i;return r.x=E,r.y=l,r.z=c,r},i.fromDegrees=function(e,t,r,n,a){return e=o.toRadians(e),t=o.toRadians(t),i.fromRadians(e,t,r,n,a)};var f=new i,_=new i,R=new i(40680631590769,40680631590769,40408299984661.445);return i.fromRadians=function(e,n,a,o,u){a=t(a,0);var s=r(o)?o.radiiSquared:R,E=Math.cos(n);f.x=E*Math.cos(e),f.y=E*Math.sin(e),f.z=Math.sin(n),f=i.normalize(f,f),i.multiplyComponents(s,f,_);var l=Math.sqrt(i.dot(f,_));return _=i.divideByScalar(_,l,_),f=i.multiplyByScalar(f,a,f),r(u)||(u=new i),i.add(_,f,u)},i.fromDegreesArray=function(e,t,n){var a=e.length;r(n)?n.length=a/2:n=new Array(a/2);for(var o=0;o<a;o+=2){var u=e[o],s=e[o+1],E=o/2;n[E]=i.fromDegrees(u,s,0,t,n[E])}return n},i.fromRadiansArray=function(e,t,n){var a=e.length;r(n)?n.length=a/2:n=new Array(a/2);for(var o=0;o<a;o+=2){var u=e[o],s=e[o+1],E=o/2;n[E]=i.fromRadians(u,s,0,t,n[E])}return n},i.fromDegreesArrayHeights=function(e,t,n){var a=e.length;r(n)?n.length=a/3:n=new Array(a/3);for(var o=0;o<a;o+=3){var u=e[o],s=e[o+1],E=e[o+2],l=o/3;n[l]=i.fromDegrees(u,s,E,t,n[l])}return n},i.fromRadiansArrayHeights=function(e,t,n){var a=e.length;r(n)?n.length=a/3:n=new Array(a/3);for(var o=0;o<a;o+=3){var u=e[o],s=e[o+1],E=e[o+2],l=o/3;n[l]=i.fromRadians(u,s,E,t,n[l])}return n},i.ZERO=a(new i(0,0,0)),i.UNIT_X=a(new i(1,0,0)),i.UNIT_Y=a(new i(0,1,0)),i.UNIT_Z=a(new i(0,0,1)),i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i.prototype.equalsEpsilon=function(e,t,r){return i.equalsEpsilon(this,e,t,r)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},i}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,r,n){"use strict";function a(r,a,u,s,E){var l=r.x,c=r.y,f=r.z,_=a.x,R=a.y,T=a.z,h=l*l*_*_,A=c*c*R*R,d=f*f*T*T,S=h+A+d,m=Math.sqrt(1/S),N=e.multiplyByScalar(r,m,o);if(S<s)return isFinite(m)?e.clone(N,E):void 0;var C=u.x,I=u.y,p=u.z,M=i;M.x=N.x*C*2,M.y=N.y*I*2,M.z=N.z*p*2;var O,g,y,F,L,v,U,D,P,B,w,x=(1-m)*e.magnitude(r)/(.5*e.magnitude(M)),G=0;do{x-=G,y=1/(1+x*C),F=1/(1+x*I),L=1/(1+x*p),v=y*y,U=F*F,D=L*L,P=v*y,B=U*F,w=D*L,O=h*v+A*U+d*D-1,g=h*P*C+A*B*I+d*w*p;var b=-2*g;G=O/b}while(Math.abs(O)>n.EPSILON12);return t(E)?(E.x=l*y,E.y=c*F,E.z=f*L,E):new e(l*y,c*F,f*L)}var o=new e,i=new e;return a}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,r,n,a,o,i){"use strict";function u(e,r,n){this.longitude=t(e,0),this.latitude=t(r,0),this.height=t(n,0)}u.fromRadians=function(e,n,a,o){return a=t(a,0),r(o)?(o.longitude=e,o.latitude=n,o.height=a,o):new u(e,n,a)},u.fromDegrees=function(e,t,r,n){return e=o.toRadians(e),t=o.toRadians(t),u.fromRadians(e,t,r,n)};var s=new e,E=new e,l=new e,c=new e(1/6378137,1/6378137,1/6356752.314245179),f=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),_=o.EPSILON1;return u.fromCartesian=function(t,n,a){var R=r(n)?n.oneOverRadii:c,T=r(n)?n.oneOverRadiiSquared:f,h=r(n)?n._centerToleranceSquared:_,A=i(t,R,T,h,E);if(r(A)){var d=e.multiplyComponents(A,T,s);d=e.normalize(d,d);var S=e.subtract(t,A,l),m=Math.atan2(d.y,d.x),N=Math.asin(d.z),C=o.sign(e.dot(S,t))*e.magnitude(S);return r(a)?(a.longitude=m,a.latitude=N,a.height=C,a):new u(m,N,C)}},u.clone=function(e,t){if(r(e))return r(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||r(e)&&r(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n},u.ZERO=a(new u(0,0,0)),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,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),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","./scaleToGeodeticSurface"],function(e,t,r,n,a,o,i,u,s){"use strict";function E(t,n,a,o){n=r(n,0),a=r(a,0),o=r(o,0),t._radii=new e(n,a,o),t._radiiSquared=new e(n*n,a*a,o*o),t._radiiToTheFourth=new e(n*n*n*n,a*a*a*a,o*o*o*o),t._oneOverRadii=new e(0===n?0:1/n,0===a?0:1/a,0===o?0:1/o),t._oneOverRadiiSquared=new e(0===n?0:1/(n*n),0===a?0:1/(a*a),0===o?0:1/(o*o)),t._minimumRadius=Math.min(n,a,o),t._maximumRadius=Math.max(n,a,o),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(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,this._sqauredXOverSquaredZ=void 0,E(this,e,t,r)}a(l.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}}}),l.clone=function(t,r){if(n(t)){var a=t._radii;return n(r)?(e.clone(a,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 l(a.x,a.y,a.z)}},l.fromCartesian3=function(e,t){return n(t)||(t=new l),n(e)?(E(t,e.x,e.y,e.z),t):t},l.WGS84=i(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=i(new l(1,1,1)),l.MOON=i(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,n,a){return a=r(a,0),e.pack(t._radii,n,a),n},l.unpack=function(t,n,a){n=r(n,0);var o=e.unpack(t,n);return l.fromCartesian3(o,a)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,r){var a=t.longitude,o=t.latitude,i=Math.cos(o),u=i*Math.cos(a),s=i*Math.sin(a),E=Math.sin(o);return n(r)||(r=new e),r.x=u,r.y=s,r.z=E,e.normalize(r,r)},l.prototype.geodeticSurfaceNormal=function(t,r){return n(r)||(r=new e),r=e.multiplyComponents(t,this._oneOverRadiiSquared,r),e.normalize(r,r)};var c=new e,f=new e;l.prototype.cartographicToCartesian=function(t,r){var a=c,o=f;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,o);var i=Math.sqrt(e.dot(a,o));return e.divideByScalar(o,i,o),e.multiplyByScalar(a,t.height,a),n(r)||(r=new e),e.add(o,a,r)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var a=0;a<r;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var _=new e,R=new e,T=new e;return l.prototype.cartesianToCartographic=function(r,a){var o=this.scaleToGeodeticSurface(r,R);if(n(o)){var i=this.geodeticSurfaceNormal(o,_),s=e.subtract(r,o,T),E=Math.atan2(i.y,i.x),l=Math.asin(i.z),c=u.sign(e.dot(s,r))*e.magnitude(s);return n(a)?(a.longitude=E,a.latitude=l,a.height=c,a):new t(E,l,c)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var a=0;a<r;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,r){n(r)||(r=new e);var a=t.x,o=t.y,i=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+o*o*u.y+i*i*u.z);return e.multiplyByScalar(t,s,r)},l.prototype.transformPositionToScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._oneOverRadii,r)},l.prototype.transformPositionFromScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._radii,r)},l.prototype.equals=function(t){return this===t||n(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,a,o){a=r(a,0);var i=this._sqauredXOverSquaredZ;if(n(o)||(o=new e),o.x=0,o.y=0,o.z=t.z*(1-i),!(Math.abs(o.z)>=this._radii.z-a))return o},l}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,r,n,a,o,i){"use strict";function u(e){this._ellipsoid=r(e,i.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,r){var a=this._semimajorAxis,o=t.longitude*a,i=t.latitude*a,u=t.height;return n(r)?(r.x=o,r.y=i,r.z=u,r):new e(o,i,u)},u.prototype.unproject=function(e,r){var a=this._oneOverSemimajorAxis,o=e.x*a,i=e.y*a,u=e.z;return n(r)?(r.longitude=o,r.latitude=i,r.height=u,r):new t(o,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";function t(t,r){this.start=e(t,0),this.stop=e(r,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,o,i,u){"use strict";function s(e,t,n,a,o,i,u,s,E){this[0]=r(e,0),this[1]=r(a,0),this[2]=r(u,0),this[3]=r(t,0),this[4]=r(o,0),this[5]=r(s,0),this[6]=r(n,0),this[7]=r(i,0),this[8]=r(E,0)}function E(e){for(var t=0,r=0;r<9;++r){var n=e[r];t+=n*n}return Math.sqrt(t)}function l(e){for(var t=0,r=0;r<3;++r){var n=e[s.getElementIndex(T[r],R[r])];t+=2*n*n}return Math.sqrt(t)}function c(e,t){for(var r=u.EPSILON15,n=0,a=1,o=0;o<3;++o){var i=Math.abs(e[s.getElementIndex(T[o],R[o])]);i>n&&(a=o,n=i)}var E=1,l=0,c=R[a],f=T[a];if(Math.abs(e[s.getElementIndex(f,c)])>r){var _,h=e[s.getElementIndex(f,f)],A=e[s.getElementIndex(c,c)],d=e[s.getElementIndex(f,c)],S=(h-A)/2/d;_=S<0?-1/(-S+Math.sqrt(1+S*S)):1/(S+Math.sqrt(1+S*S)),E=1/Math.sqrt(1+_*_),l=_*E}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(c,c)]=t[s.getElementIndex(f,f)]=E,t[s.getElementIndex(f,c)]=l,t[s.getElementIndex(c,f)]=-l,t}s.packedLength=9,s.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t},s.unpack=function(e,t,a){return t=r(t,0),n(a)||(a=new s),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a},s.clone=function(e,t){if(n(e))return n(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 s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,a){return t=r(t,0),n(a)||(a=new s),a[0]=e[t],a[1]=e[t+1],a[2]=e[t+2],a[3]=e[t+3],a[4]=e[t+4],a[5]=e[t+5],a[6]=e[t+6],a[7]=e[t+7],a[8]=e[t+8],a},s.fromColumnMajorArray=function(e,t){return s.clone(e,t)},s.fromRowMajorArray=function(e,t){return n(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 s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var r=e.x*e.x,a=e.x*e.y,o=e.x*e.z,i=e.x*e.w,u=e.y*e.y,E=e.y*e.z,l=e.y*e.w,c=e.z*e.z,f=e.z*e.w,_=e.w*e.w,R=r-u-c+_,T=2*(a-f),h=2*(o+l),A=2*(a+f),d=-r+u-c+_,S=2*(E-i),m=2*(o-l),N=2*(E+i),C=-r-u+c+_;return n(t)?(t[0]=R,t[1]=A,t[2]=m,t[3]=T,t[4]=d,t[5]=N,t[6]=h,t[7]=S,t[8]=C,t):new s(R,T,h,A,d,S,m,N,C)},s.fromHeadingPitchRoll=function(e,t){var r=Math.cos(-e.pitch),a=Math.cos(-e.heading),o=Math.cos(e.roll),i=Math.sin(-e.pitch),u=Math.sin(-e.heading),E=Math.sin(e.roll),l=r*a,c=-o*u+E*i*a,f=E*u+o*i*a,_=r*u,R=o*a+E*i*u,T=-i*o+o*i*u,h=-i,A=E*r,d=o*r;return n(t)?(t[0]=l,t[1]=_,t[2]=h,t[3]=c,t[4]=R,t[5]=A,t[6]=f,t[7]=T,t[8]=d,t):new s(l,c,f,_,R,T,h,A,d)},s.fromScale=function(e,t){return n(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 s(e.x,0,0,0,e.y,0,0,0,e.z)},s.fromUniformScale=function(e,t){return n(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 s(e,0,0,0,e,0,0,0,e)},s.fromCrossProduct=function(e,t){return n(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 s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=r,t[5]=a,t[6]=0,t[7]=-a,t[8]=r,t):new s(1,0,0,0,r,-a,0,a,r)},s.fromRotationY=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=r,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=r,t):new s(r,0,a,0,1,0,-a,0,r)},s.fromRotationZ=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=r,t[1]=a,t[2]=0,t[3]=-a,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(r,-a,0,a,r,0,0,0,1)},s.toArray=function(e,t){return n(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]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,r){var n=3*t,a=e[n],o=e[n+1],i=e[n+2];return r.x=a,r.y=o,r.z=i,r},s.setColumn=function(e,t,r,n){n=s.clone(e,n);var a=3*t;return n[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n},s.getRow=function(e,t,r){var n=e[t],a=e[t+3],o=e[t+6];return r.x=n,r.y=a,r.z=o,r},s.setRow=function(e,t,r,n){return n=s.clone(e,n),n[t]=r.x,n[t+3]=r.y,n[t+6]=r.z,n};var f=new e;s.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],f)),r.y=e.magnitude(e.fromElements(t[3],t[4],t[5],f)),r.z=e.magnitude(e.fromElements(t[6],t[7],t[8],f)),r};var _=new e;s.getMaximumScale=function(t){return s.getScale(t,_),e.maximumComponent(_)},s.multiply=function(e,t,r){var n=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],o=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],E=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],c=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return r[0]=n,r[1]=a,r[2]=o,r[3]=i,r[4]=u,r[5]=s,r[6]=E,r[7]=l,r[8]=c,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},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},s.multiplyByVector=function(e,t,r){var n=t.x,a=t.y,o=t.z,i=e[0]*n+e[3]*a+e[6]*o,u=e[1]*n+e[4]*a+e[7]*o,s=e[2]*n+e[5]*a+e[8]*o;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},s.multiplyByScale=function(e,t,r){return r[0]=e[0]*t.x,r[1]=e[1]*t.x,r[2]=e[2]*t.x,r[3]=e[3]*t.y,r[4]=e[4]*t.y,r[5]=e[5]*t.y,r[6]=e[6]*t.z,r[7]=e[7]*t.z,r[8]=e[8]*t.z,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},s.transpose=function(e,t){var r=e[0],n=e[3],a=e[6],o=e[1],i=e[4],u=e[7],s=e[2],E=e[5],l=e[8];return t[0]=r,t[1]=n,t[2]=a,t[3]=o,t[4]=i,t[5]=u,t[6]=s,t[7]=E,t[8]=l,t};var R=[1,0,0],T=[2,2,1],h=new s,A=new s;return s.computeEigenDecomposition=function(e,t){var r=u.EPSILON20,a=10,o=0,i=0;n(t)||(t={});for(var f=t.unitary=s.clone(s.IDENTITY,t.unitary),_=t.diagonal=s.clone(e,t.diagonal),R=r*E(_);i<a&&l(_)>R;)c(_,h),s.transpose(h,A),s.multiply(_,h,_),s.multiply(A,_,_),s.multiply(f,h,f),++o>2&&(++i,o=0);return 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},s.determinant=function(e){var t=e[0],r=e[3],n=e[6],a=e[1],o=e[4],i=e[7],u=e[2],s=e[5],E=e[8];return t*(o*E-s*i)+a*(s*n-r*E)+u*(r*i-o*n)},s.inverse=function(e,t){var r=e[0],n=e[1],a=e[2],o=e[3],i=e[4],u=e[5],E=e[6],l=e[7],c=e[8],f=s.determinant(e);t[0]=i*c-l*u,t[1]=l*a-n*c,t[2]=n*u-i*a,t[3]=E*u-o*c,t[4]=r*c-E*a,t[5]=o*a-r*u,t[6]=o*l-E*i,t[7]=E*n-r*l,t[8]=r*i-o*n;var _=1/f;return s.multiplyByScalar(t,_,t)},s.equals=function(e,t){return e===t||n(e)&&n(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]},s.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r},s.IDENTITY=i(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=i(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,a(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,o){"use strict";function i(e,r,n,a){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0),this.w=t(a,0)}i.fromElements=function(e,t,n,a,o){return r(o)?(o.x=e,o.y=t,o.z=n,o.w=a,o):new i(e,t,n,a)},i.fromColor=function(e,t){return r(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new i(e.red,e.green,e.blue,e.alpha)},i.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new i(e.x,e.y,e.z,e.w)},i.packedLength=4,i.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n++]=e.z,r[n]=e.w,r},i.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new i),a.x=e[n++],a.y=e[n++],a.z=e[n++],a.w=e[n],a},i.packArray=function(e,t){var n=e.length;r(t)?t.length=4*n:t=new Array(4*n);for(var a=0;a<n;++a)i.pack(e[a],t,4*a);return t},i.unpackArray=function(e,t){var n=e.length;r(t)?t.length=n/4:t=new Array(n/4);for(var a=0;a<n;a+=4){var o=a/4;t[o]=i.unpack(e,a,t[o])}return t},i.fromArray=i.unpack,i.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},i.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},i.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},i.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},i.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},i.magnitude=function(e){return Math.sqrt(i.magnitudeSquared(e))};var u=new i;i.distance=function(e,t){return i.subtract(e,t,u),i.magnitude(u)},i.distanceSquared=function(e,t){return i.subtract(e,t,u),i.magnitudeSquared(u)},i.normalize=function(e,t){var r=i.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t.z=e.z/r,t.w=e.w/r,t},i.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},i.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},i.divideComponents=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},i.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},i.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},i.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},i.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},i.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},i.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 s=new i;i.lerp=function(e,t,r,n){return i.multiplyByScalar(t,r,s),n=i.multiplyByScalar(e,1-r,n),i.add(s,n,n)};var E=new i;return i.mostOrthogonalAxis=function(e,t){var r=i.normalize(e,E);return i.abs(r,r),t=r.x<=r.y?r.x<=r.z?r.x<=r.w?i.clone(i.UNIT_X,t):i.clone(i.UNIT_W,t):r.z<=r.w?i.clone(i.UNIT_Z,t):i.clone(i.UNIT_W,t):r.y<=r.z?r.y<=r.w?i.clone(i.UNIT_Y,t):i.clone(i.UNIT_W,t):r.z<=r.w?i.clone(i.UNIT_Z,t):i.clone(i.UNIT_W,t)},i.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},i.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]&&e.w===t[r+3]},i.equalsEpsilon=function(e,t,n,a){return e===t||r(e)&&r(t)&&o.equalsEpsilon(e.x,t.x,n,a)&&o.equalsEpsilon(e.y,t.y,n,a)&&o.equalsEpsilon(e.z,t.z,n,a)&&o.equalsEpsilon(e.w,t.w,n,a)},i.ZERO=a(new i(0,0,0,0)),i.UNIT_X=a(new i(1,0,0,0)),i.UNIT_Y=a(new i(0,1,0,0)),i.UNIT_Z=a(new i(0,0,1,0)),i.UNIT_W=a(new i(0,0,0,1)),i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i.prototype.equalsEpsilon=function(e,t,r){return i.equalsEpsilon(this,e,t,r)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},i}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,r,n,a,o,i,u,s,E,l){ +"use strict";function c(e,t,r,a,o,i,u,s,E,l,c,f,_,R,T,h){this[0]=n(e,0),this[1]=n(o,0),this[2]=n(E,0),this[3]=n(_,0),this[4]=n(t,0),this[5]=n(i,0),this[6]=n(l,0),this[7]=n(R,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(c,0),this[11]=n(T,0),this[12]=n(a,0),this[13]=n(s,0),this[14]=n(f,0),this[15]=n(h,0)}c.packedLength=16,c.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t[r++]=e[9],t[r++]=e[10],t[r++]=e[11],t[r++]=e[12],t[r++]=e[13],t[r++]=e[14],t[r]=e[15],t},c.unpack=function(e,t,r){return t=n(t,0),a(r)||(r=new c),r[0]=e[t++],r[1]=e[t++],r[2]=e[t++],r[3]=e[t++],r[4]=e[t++],r[5]=e[t++],r[6]=e[t++],r[7]=e[t++],r[8]=e[t++],r[9]=e[t++],r[10]=e[t++],r[11]=e[t++],r[12]=e[t++],r[13]=e[t++],r[14]=e[t++],r[15]=e[t],r},c.clone=function(e,t){if(a(e))return a(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 c(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])},c.fromArray=c.unpack,c.fromColumnMajorArray=function(e,t){return c.clone(e,t)},c.fromRowMajorArray=function(e,t){return a(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 c(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])},c.fromRotationTranslation=function(t,r,o){return r=n(r,e.ZERO),a(o)?(o[0]=t[0],o[1]=t[1],o[2]=t[2],o[3]=0,o[4]=t[3],o[5]=t[4],o[6]=t[5],o[7]=0,o[8]=t[6],o[9]=t[7],o[10]=t[8],o[11]=0,o[12]=r.x,o[13]=r.y,o[14]=r.z,o[15]=1,o):new c(t[0],t[3],t[6],r.x,t[1],t[4],t[7],r.y,t[2],t[5],t[8],r.z,0,0,0,1)},c.fromTranslationQuaternionRotationScale=function(e,t,r,n){a(n)||(n=new c);var o=r.x,i=r.y,u=r.z,s=t.x*t.x,E=t.x*t.y,l=t.x*t.z,f=t.x*t.w,_=t.y*t.y,R=t.y*t.z,T=t.y*t.w,h=t.z*t.z,A=t.z*t.w,d=t.w*t.w,S=s-_-h+d,m=2*(E-A),N=2*(l+T),C=2*(E+A),I=-s+_-h+d,p=2*(R-f),M=2*(l-T),O=2*(R+f),g=-s-_+h+d;return n[0]=S*o,n[1]=C*o,n[2]=M*o,n[3]=0,n[4]=m*i,n[5]=I*i,n[6]=O*i,n[7]=0,n[8]=N*u,n[9]=p*u,n[10]=g*u,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n},c.fromTranslationRotationScale=function(e,t){return c.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},c.fromTranslation=function(e,t){return c.fromRotationTranslation(E.IDENTITY,e,t)},c.fromScale=function(e,t){return a(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 c(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},c.fromUniformScale=function(e,t){return a(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 c(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var f=new e,_=new e,R=new e;c.fromCamera=function(t,r){var n=t.position,o=t.direction,i=t.up;e.normalize(o,f),e.normalize(e.cross(f,i,_),_),e.normalize(e.cross(_,f,R),R);var u=_.x,s=_.y,E=_.z,l=f.x,T=f.y,h=f.z,A=R.x,d=R.y,S=R.z,m=n.x,N=n.y,C=n.z,I=u*-m+s*-N+E*-C,p=A*-m+d*-N+S*-C,M=l*m+T*N+h*C;return a(r)?(r[0]=u,r[1]=A,r[2]=-l,r[3]=0,r[4]=s,r[5]=d,r[6]=-T,r[7]=0,r[8]=E,r[9]=S,r[10]=-h,r[11]=0,r[12]=I,r[13]=p,r[14]=M,r[15]=1,r):new c(u,s,E,I,A,d,S,p,-l,-T,-h,M,0,0,0,1)},c.computePerspectiveFieldOfView=function(e,t,r,n,a){var o=Math.tan(.5*e),i=1/o,u=i/t,s=(n+r)/(r-n),E=2*n*r/(r-n);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=i,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=E,a[15]=0,a},c.computeOrthographicOffCenter=function(e,t,r,n,a,o,i){var u=1/(t-e),s=1/(n-r),E=1/(o-a),l=-(t+e)*u,c=-(n+r)*s,f=-(o+a)*E;return u*=2,s*=2,E*=-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]=E,i[11]=0,i[12]=l,i[13]=c,i[14]=f,i[15]=1,i},c.computePerspectiveOffCenter=function(e,t,r,n,a,o,i){var u=2*a/(t-e),s=2*a/(n-r),E=(t+e)/(t-e),l=(n+r)/(n-r),c=-(o+a)/(o-a),f=-1,_=-2*o*a/(o-a);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]=E,i[9]=l,i[10]=c,i[11]=f,i[12]=0,i[13]=0,i[14]=_,i[15]=0,i},c.computeInfinitePerspectiveOffCenter=function(e,t,r,n,a,o){var i=2*a/(t-e),u=2*a/(n-r),s=(t+e)/(t-e),E=(n+r)/(n-r),l=-1,c=-1,f=-2*a;return o[0]=i,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=u,o[6]=0,o[7]=0,o[8]=s,o[9]=E,o[10]=l,o[11]=c,o[12]=0,o[13]=0,o[14]=f,o[15]=0,o},c.computeViewportTransformation=function(e,t,r,a){e=n(e,n.EMPTY_OBJECT);var o=n(e.x,0),i=n(e.y,0),u=n(e.width,0),s=n(e.height,0);t=n(t,0),r=n(r,1);var E=.5*u,l=.5*s,c=.5*(r-t),f=E,_=l,R=c,T=o+E,h=i+l,A=t+c,d=1;return a[0]=f,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=_,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=R,a[11]=0,a[12]=T,a[13]=h,a[14]=A,a[15]=d,a},c.computeView=function(t,r,n,a,o){return o[0]=a.x,o[1]=n.x,o[2]=-r.x,o[3]=0,o[4]=a.y,o[5]=n.y,o[6]=-r.y,o[7]=0,o[8]=a.z,o[9]=n.z,o[10]=-r.z,o[11]=0,o[12]=-e.dot(a,t),o[13]=-e.dot(n,t),o[14]=e.dot(r,t),o[15]=1,o},c.toArray=function(e,t){return a(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]]},c.getElementIndex=function(e,t){return 4*e+t},c.getColumn=function(e,t,r){var n=4*t,a=e[n],o=e[n+1],i=e[n+2],u=e[n+3];return r.x=a,r.y=o,r.z=i,r.w=u,r},c.setColumn=function(e,t,r,n){n=c.clone(e,n);var a=4*t;return n[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n[a+3]=r.w,n},c.setTranslation=function(e,t,r){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]=t.x,r[13]=t.y,r[14]=t.z,r[15]=e[15],r},c.getRow=function(e,t,r){var n=e[t],a=e[t+4],o=e[t+8],i=e[t+12];return r.x=n,r.y=a,r.z=o,r.w=i,r},c.setRow=function(e,t,r,n){return n=c.clone(e,n),n[t]=r.x,n[t+4]=r.y,n[t+8]=r.z,n[t+12]=r.w,n};var T=new e;c.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],T)),r.y=e.magnitude(e.fromElements(t[4],t[5],t[6],T)),r.z=e.magnitude(e.fromElements(t[8],t[9],t[10],T)),r};var h=new e;c.getMaximumScale=function(t){return c.getScale(t,h),e.maximumComponent(h)},c.multiply=function(e,t,r){var n=e[0],a=e[1],o=e[2],i=e[3],u=e[4],s=e[5],E=e[6],l=e[7],c=e[8],f=e[9],_=e[10],R=e[11],T=e[12],h=e[13],A=e[14],d=e[15],S=t[0],m=t[1],N=t[2],C=t[3],I=t[4],p=t[5],M=t[6],O=t[7],g=t[8],y=t[9],F=t[10],L=t[11],v=t[12],U=t[13],D=t[14],P=t[15],B=n*S+u*m+c*N+T*C,w=a*S+s*m+f*N+h*C,x=o*S+E*m+_*N+A*C,G=i*S+l*m+R*N+d*C,b=n*I+u*p+c*M+T*O,z=a*I+s*p+f*M+h*O,H=o*I+E*p+_*M+A*O,V=i*I+l*p+R*M+d*O,q=n*g+u*y+c*F+T*L,X=a*g+s*y+f*F+h*L,W=o*g+E*y+_*F+A*L,Y=i*g+l*y+R*F+d*L,K=n*v+u*U+c*D+T*P,k=a*v+s*U+f*D+h*P,Z=o*v+E*U+_*D+A*P,j=i*v+l*U+R*D+d*P;return r[0]=B,r[1]=w,r[2]=x,r[3]=G,r[4]=b,r[5]=z,r[6]=H,r[7]=V,r[8]=q,r[9]=X,r[10]=W,r[11]=Y,r[12]=K,r[13]=k,r[14]=Z,r[15]=j,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[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},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[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},c.multiplyTransformation=function(e,t,r){var n=e[0],a=e[1],o=e[2],i=e[4],u=e[5],s=e[6],E=e[8],l=e[9],c=e[10],f=e[12],_=e[13],R=e[14],T=t[0],h=t[1],A=t[2],d=t[4],S=t[5],m=t[6],N=t[8],C=t[9],I=t[10],p=t[12],M=t[13],O=t[14],g=n*T+i*h+E*A,y=a*T+u*h+l*A,F=o*T+s*h+c*A,L=n*d+i*S+E*m,v=a*d+u*S+l*m,U=o*d+s*S+c*m,D=n*N+i*C+E*I,P=a*N+u*C+l*I,B=o*N+s*C+c*I,w=n*p+i*M+E*O+f,x=a*p+u*M+l*O+_,G=o*p+s*M+c*O+R;return r[0]=g,r[1]=y,r[2]=F,r[3]=0,r[4]=L,r[5]=v,r[6]=U,r[7]=0,r[8]=D,r[9]=P,r[10]=B,r[11]=0,r[12]=w,r[13]=x,r[14]=G,r[15]=1,r},c.multiplyByMatrix3=function(e,t,r){var n=e[0],a=e[1],o=e[2],i=e[4],u=e[5],s=e[6],E=e[8],l=e[9],c=e[10],f=t[0],_=t[1],R=t[2],T=t[3],h=t[4],A=t[5],d=t[6],S=t[7],m=t[8],N=n*f+i*_+E*R,C=a*f+u*_+l*R,I=o*f+s*_+c*R,p=n*T+i*h+E*A,M=a*T+u*h+l*A,O=o*T+s*h+c*A,g=n*d+i*S+E*m,y=a*d+u*S+l*m,F=o*d+s*S+c*m;return r[0]=N,r[1]=C,r[2]=I,r[3]=0,r[4]=p,r[5]=M,r[6]=O,r[7]=0,r[8]=g,r[9]=y,r[10]=F,r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r},c.multiplyByTranslation=function(e,t,r){var n=t.x,a=t.y,o=t.z,i=n*e[0]+a*e[4]+o*e[8]+e[12],u=n*e[1]+a*e[5]+o*e[9]+e[13],s=n*e[2]+a*e[6]+o*e[10]+e[14];return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=i,r[13]=u,r[14]=s,r[15]=e[15],r};var A=new e;c.multiplyByUniformScale=function(e,t,r){return A.x=t,A.y=t,A.z=t,c.multiplyByScale(e,A,r)},c.multiplyByScale=function(e,t,r){var n=t.x,a=t.y,o=t.z;return 1===n&&1===a&&1===o?c.clone(e,r):(r[0]=n*e[0],r[1]=n*e[1],r[2]=n*e[2],r[3]=0,r[4]=a*e[4],r[5]=a*e[5],r[6]=a*e[6],r[7]=0,r[8]=o*e[8],r[9]=o*e[9],r[10]=o*e[10],r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=1,r)},c.multiplyByVector=function(e,t,r){var n=t.x,a=t.y,o=t.z,i=t.w,u=e[0]*n+e[4]*a+e[8]*o+e[12]*i,s=e[1]*n+e[5]*a+e[9]*o+e[13]*i,E=e[2]*n+e[6]*a+e[10]*o+e[14]*i,l=e[3]*n+e[7]*a+e[11]*o+e[15]*i;return r.x=u,r.y=s,r.z=E,r.w=l,r},c.multiplyByPointAsVector=function(e,t,r){var n=t.x,a=t.y,o=t.z,i=e[0]*n+e[4]*a+e[8]*o,u=e[1]*n+e[5]*a+e[9]*o,s=e[2]*n+e[6]*a+e[10]*o;return r.x=i,r.y=u,r.z=s,r},c.multiplyByPoint=function(e,t,r){var n=t.x,a=t.y,o=t.z,i=e[0]*n+e[4]*a+e[8]*o+e[12],u=e[1]*n+e[5]*a+e[9]*o+e[13],s=e[2]*n+e[6]*a+e[10]*o+e[14];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[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},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[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},c.transpose=function(e,t){var r=e[1],n=e[2],a=e[3],o=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]=o,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=i,t[14]=u,t[15]=e[15],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[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},c.equals=function(e,t){return e===t||a(e)&&a(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},c.equalsEpsilon=function(e,t,r){return e===t||a(e)&&a(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r&&Math.abs(e[9]-t[9])<=r&&Math.abs(e[10]-t[10])<=r&&Math.abs(e[11]-t[11])<=r&&Math.abs(e[12]-t[12])<=r&&Math.abs(e[13]-t[13])<=r&&Math.abs(e[14]-t[14])<=r&&Math.abs(e[15]-t[15])<=r},c.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},c.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};var d=new E,S=new E,m=new t,N=new t(0,0,0,1);return c.inverse=function(e,r){if(E.equalsEpsilon(c.getRotation(e,d),S,s.EPSILON7)&&t.equals(c.getRow(e,3,m),N))return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=0,r[11]=0,r[12]=-e[12],r[13]=-e[13],r[14]=-e[14],r[15]=1,r;var n=e[0],a=e[4],o=e[8],i=e[12],u=e[1],f=e[5],_=e[9],R=e[13],T=e[2],h=e[6],A=e[10],C=e[14],I=e[3],p=e[7],M=e[11],O=e[15],g=A*O,y=C*M,F=h*O,L=C*p,v=h*M,U=A*p,D=T*O,P=C*I,B=T*M,w=A*I,x=T*p,G=h*I,b=g*f+L*_+v*R-(y*f+F*_+U*R),z=y*u+D*_+w*R-(g*u+P*_+B*R),H=F*u+P*f+x*R-(L*u+D*f+G*R),V=U*u+B*f+G*_-(v*u+w*f+x*_),q=y*a+F*o+U*i-(g*a+L*o+v*i),X=g*n+P*o+B*i-(y*n+D*o+w*i),W=L*n+D*a+G*i-(F*n+P*a+x*i),Y=v*n+w*a+x*o-(U*n+B*a+G*o);g=o*R,y=i*_,F=a*R,L=i*f,v=a*_,U=o*f,D=n*R,P=i*u,B=n*_,w=o*u,x=n*f,G=a*u;var K=g*p+L*M+v*O-(y*p+F*M+U*O),k=y*I+D*M+w*O-(g*I+P*M+B*O),Z=F*I+P*p+x*O-(L*I+D*p+G*O),j=U*I+B*p+G*M-(v*I+w*p+x*M),Q=F*A+U*C+y*h-(v*C+g*h+L*A),J=B*C+g*T+P*A-(D*A+w*C+y*T),$=D*h+G*C+L*T-(x*C+F*T+P*h),ee=x*A+v*T+w*h-(B*h+G*A+U*T),te=n*b+a*z+o*H+i*V;if(Math.abs(te)<s.EPSILON20)throw new l("matrix is not invertible because its determinate is zero.");return te=1/te,r[0]=b*te,r[1]=z*te,r[2]=H*te,r[3]=V*te,r[4]=q*te,r[5]=X*te,r[6]=W*te,r[7]=Y*te,r[8]=K*te,r[9]=k*te,r[10]=Z*te,r[11]=j*te,r[12]=Q*te,r[13]=J*te,r[14]=$*te,r[15]=ee*te,r},c.inverseTransformation=function(e,t){var r=e[0],n=e[1],a=e[2],o=e[4],i=e[5],u=e[6],s=e[8],E=e[9],l=e[10],c=e[12],f=e[13],_=e[14],R=-r*c-n*f-a*_,T=-o*c-i*f-u*_,h=-s*c-E*f-l*_;return t[0]=r,t[1]=o,t[2]=s,t[3]=0,t[4]=n,t[5]=i,t[6]=E,t[7]=0,t[8]=a,t[9]=u,t[10]=l,t[11]=0,t[12]=R,t[13]=T,t[14]=h,t[15]=1,t},c.IDENTITY=u(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),c.ZERO=u(new c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN0ROW3=3,c.COLUMN1ROW0=4,c.COLUMN1ROW1=5,c.COLUMN1ROW2=6,c.COLUMN1ROW3=7,c.COLUMN2ROW0=8,c.COLUMN2ROW1=9,c.COLUMN2ROW2=10,c.COLUMN2ROW3=11,c.COLUMN3ROW0=12,c.COLUMN3ROW1=13,c.COLUMN3ROW2=14,c.COLUMN3ROW3=15,o(c.prototype,{length:{get:function(){return c.packedLength}}}),c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]&&e[9]===t[r+9]&&e[10]===t[r+10]&&e[11]===t[r+11]&&e[12]===t[r+12]&&e[13]===t[r+13]&&e[14]===t[r+14]&&e[15]===t[r+15]},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.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]+")"},c}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,r,n,a,o,i,u,s){"use strict";function E(e,t,n,a){this.west=r(e,0),this.south=r(t,0),this.east=r(n,0),this.north=r(a,0)}a(E.prototype,{width:{get:function(){return E.computeWidth(this)}},height:{get:function(){return E.computeHeight(this)}}}),E.packedLength=4,E.pack=function(e,t,n){return n=r(n,0),t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t},E.unpack=function(e,t,a){return t=r(t,0),n(a)||(a=new E),a.west=e[t++],a.south=e[t++],a.east=e[t++],a.north=e[t],a},E.computeWidth=function(e){var t=e.east,r=e.west;return t<r&&(t+=s.TWO_PI),t-r},E.computeHeight=function(e){return e.north-e.south},E.fromDegrees=function(e,t,a,o,i){return e=s.toRadians(r(e,0)),t=s.toRadians(r(t,0)),a=s.toRadians(r(a,0)),o=s.toRadians(r(o,0)),n(i)?(i.west=e,i.south=t,i.east=a,i.north=o,i):new E(e,t,a,o)},E.fromRadians=function(e,t,a,o,i){return n(i)?(i.west=r(e,0),i.south=r(t,0),i.east=r(a,0),i.north=r(o,0),i):new E(e,t,a,o)},E.fromCartographicArray=function(e,t){for(var r=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,i=-Number.MAX_VALUE,u=Number.MAX_VALUE,l=-Number.MAX_VALUE,c=0,f=e.length;c<f;c++){var _=e[c];r=Math.min(r,_.longitude),a=Math.max(a,_.longitude),u=Math.min(u,_.latitude),l=Math.max(l,_.latitude);var R=_.longitude>=0?_.longitude:_.longitude+s.TWO_PI;o=Math.min(o,R),i=Math.max(i,R)}return a-r>i-o&&(r=o,a=i,a>s.PI&&(a-=s.TWO_PI),r>s.PI&&(r-=s.TWO_PI)),n(t)?(t.west=r,t.south=u,t.east=a,t.north=l,t):new E(r,u,a,l)},E.fromCartesianArray=function(e,t,r){for(var a=Number.MAX_VALUE,o=-Number.MAX_VALUE,i=Number.MAX_VALUE,u=-Number.MAX_VALUE,l=Number.MAX_VALUE,c=-Number.MAX_VALUE,f=0,_=e.length;f<_;f++){var R=t.cartesianToCartographic(e[f]);a=Math.min(a,R.longitude),o=Math.max(o,R.longitude),l=Math.min(l,R.latitude),c=Math.max(c,R.latitude);var T=R.longitude>=0?R.longitude:R.longitude+s.TWO_PI;i=Math.min(i,T),u=Math.max(u,T)}return o-a>u-i&&(a=i,o=u,o>s.PI&&(o-=s.TWO_PI),a>s.PI&&(a-=s.TWO_PI)),n(r)?(r.west=a,r.south=l,r.east=o,r.north=c,r):new E(a,l,o,c)},E.clone=function(e,t){if(n(e))return n(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new E(e.west,e.south,e.east,e.north)},E.prototype.clone=function(e){return E.clone(this,e)},E.prototype.equals=function(e){return E.equals(this,e)},E.equals=function(e,t){return e===t||n(e)&&n(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},E.prototype.equalsEpsilon=function(e,t){return n(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},E.validate=function(e){},E.southwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.south,r.height=0,r):new e(t.west,t.south)},E.northwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.north,r.height=0,r):new e(t.west,t.north)},E.northeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.north,r.height=0,r):new e(t.east,t.north)},E.southeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.south,r.height=0,r):new e(t.east,t.south)},E.center=function(t,r){var a=t.east,o=t.west;a<o&&(a+=s.TWO_PI);var i=s.negativePiToPi(.5*(o+a)),u=.5*(t.south+t.north);return n(r)?(r.longitude=i,r.latitude=u,r.height=0,r):new e(i,u)},E.intersection=function(e,t,r){var a=e.east,o=e.west,i=t.east,u=t.west;a<o&&i>0?a+=s.TWO_PI:i<u&&a>0&&(i+=s.TWO_PI),a<o&&u<0?u+=s.TWO_PI:i<u&&o<0&&(o+=s.TWO_PI);var l=s.negativePiToPi(Math.max(o,u)),c=s.negativePiToPi(Math.min(a,i));if(!((e.west<e.east||t.west<t.east)&&c<=l)){var f=Math.max(e.south,t.south),_=Math.min(e.north,t.north);if(!(f>=_))return n(r)?(r.west=l,r.south=f,r.east=c,r.north=_,r):new E(l,f,c,_)}},E.simpleIntersection=function(e,t,r){var a=Math.max(e.west,t.west),o=Math.max(e.south,t.south),i=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(o>=u||a>=i))return n(r)?(r.west=a,r.south=o,r.east=i,r.north=u,r):new E(a,o,i,u)},E.union=function(e,t,r){n(r)||(r=new E);var a=e.east,o=e.west,i=t.east,u=t.west;a<o&&i>0?a+=s.TWO_PI:i<u&&a>0&&(i+=s.TWO_PI),a<o&&u<0?u+=s.TWO_PI:i<u&&o<0&&(o+=s.TWO_PI);var l=s.convertLongitudeRange(Math.min(o,u)),c=s.convertLongitudeRange(Math.max(a,i));return r.west=l,r.south=Math.min(e.south,t.south),r.east=c,r.north=Math.max(e.north,t.north),r},E.expand=function(e,t,r){return n(r)||(r=new E),r.west=Math.min(e.west,t.longitude),r.south=Math.min(e.south,t.latitude),r.east=Math.max(e.east,t.longitude),r.north=Math.max(e.north,t.latitude),r},E.contains=function(e,t){var r=t.longitude,n=t.latitude,a=e.west,o=e.east;return o<a&&(o+=s.TWO_PI,r<0&&(r+=s.TWO_PI)),(r>a||s.equalsEpsilon(r,a,s.EPSILON14))&&(r<o||s.equalsEpsilon(r,o,s.EPSILON14))&&n>=e.south&&n<=e.north};var l=new e;return E.subsample=function(e,t,a,o){t=r(t,i.WGS84),a=r(a,0),n(o)||(o=[]);var u=0,c=e.north,f=e.south,_=e.east,R=e.west,T=l;T.height=a,T.longitude=R,T.latitude=c,o[u]=t.cartographicToCartesian(T,o[u]),u++,T.longitude=_,o[u]=t.cartographicToCartesian(T,o[u]),u++,T.latitude=f,o[u]=t.cartographicToCartesian(T,o[u]),u++,T.longitude=R,o[u]=t.cartographicToCartesian(T,o[u]),u++,c<0?T.latitude=c:f>0?T.latitude=f:T.latitude=0;for(var h=1;h<8;++h)T.longitude=-Math.PI+h*s.PI_OVER_TWO,E.contains(e,T)&&(o[u]=t.cartographicToCartesian(T,o[u]),u++);return 0===T.latitude&&(T.longitude=R,o[u]=t.cartographicToCartesian(T,o[u]),u++,T.longitude=_,o[u]=t.cartographicToCartesian(T,o[u]),u++),o.length=u,o},E.MAX_VALUE=u(new E(-Math.PI,-s.PI_OVER_TWO,Math.PI,s.PI_OVER_TWO)),E}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,r,n,a,o,i,u,s,E,l,c){"use strict";function f(t,r){this.center=e.clone(n(t,e.ZERO)),this.radius=n(r,0)}var _=new e,R=new e,T=new e,h=new e,A=new e,d=new e,S=new e,m=new e,N=new e,C=new e,I=new e,p=new e;f.fromPoints=function(t,r){if(a(r)||(r=new f),!a(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;for(var n=e.clone(t[0],S),o=e.clone(n,_),i=e.clone(n,R),u=e.clone(n,T),s=e.clone(n,h),E=e.clone(n,A),l=e.clone(n,d),c=t.length,M=1;M<c;M++){e.clone(t[M],n);var O=n.x,g=n.y,y=n.z;O<o.x&&e.clone(n,o),O>s.x&&e.clone(n,s),g<i.y&&e.clone(n,i),g>E.y&&e.clone(n,E),y<u.z&&e.clone(n,u),y>l.z&&e.clone(n,l)}var F=e.magnitudeSquared(e.subtract(s,o,m)),L=e.magnitudeSquared(e.subtract(E,i,m)),v=e.magnitudeSquared(e.subtract(l,u,m)),U=o,D=s,P=F;L>P&&(P=L,U=i,D=E),v>P&&(P=v,U=u,D=l);var B=N;B.x=.5*(U.x+D.x),B.y=.5*(U.y+D.y),B.z=.5*(U.z+D.z);var w=e.magnitudeSquared(e.subtract(D,B,m)),x=Math.sqrt(w),G=C;G.x=o.x,G.y=i.y,G.z=u.z;var b=I;b.x=s.x,b.y=E.y,b.z=l.z;var z=e.multiplyByScalar(e.add(G,b,m),.5,p),H=0;for(M=0;M<c;M++){e.clone(t[M],n);var V=e.magnitude(e.subtract(n,z,m));V>H&&(H=V);var q=e.magnitudeSquared(e.subtract(n,B,m));if(q>w){var X=Math.sqrt(q);x=.5*(x+X),w=x*x;var W=X-x;B.x=(x*B.x+W*n.x)/X,B.y=(x*B.y+W*n.y)/X,B.z=(x*B.z+W*n.z)/X}}return x<H?(e.clone(B,r.center),r.radius=x):(e.clone(z,r.center),r.radius=H),r};var M=new i,O=new e,g=new e,y=new t,F=new t;f.fromRectangle2D=function(e,t,r){return f.fromRectangleWithHeights2D(e,t,0,0,r)},f.fromRectangleWithHeights2D=function(t,r,o,i,u){if(a(u)||(u=new f),!a(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;r=n(r,M),c.southwest(t,y),y.height=o,c.northeast(t,F),F.height=i;var s=r.project(y,O),E=r.project(F,g),l=E.x-s.x,_=E.y-s.y,R=E.z-s.z;u.radius=.5*Math.sqrt(l*l+_*_+R*R);var T=u.center;return T.x=s.x+.5*l,T.y=s.y+.5*_,T.z=s.z+.5*R,u};var L=[];f.fromRectangle3D=function(e,t,r,i){t=n(t,o.WGS84),r=n(r,0);var u;return a(e)&&(u=c.subsample(e,t,r,L)),f.fromPoints(u,i)},f.fromVertices=function(t,r,o,i){if(a(i)||(i=new f),!a(t)||0===t.length)return i.center=e.clone(e.ZERO,i.center),i.radius=0,i;r=n(r,e.ZERO),o=n(o,3);var u=S;u.x=t[0]+r.x,u.y=t[1]+r.y,u.z=t[2]+r.z;for(var s=e.clone(u,_),E=e.clone(u,R),l=e.clone(u,T),c=e.clone(u,h),M=e.clone(u,A),O=e.clone(u,d),g=t.length,y=0;y<g;y+=o){var F=t[y]+r.x,L=t[y+1]+r.y,v=t[y+2]+r.z;u.x=F,u.y=L,u.z=v,F<s.x&&e.clone(u,s),F>c.x&&e.clone(u,c),L<E.y&&e.clone(u,E),L>M.y&&e.clone(u,M),v<l.z&&e.clone(u,l),v>O.z&&e.clone(u,O)}var U=e.magnitudeSquared(e.subtract(c,s,m)),D=e.magnitudeSquared(e.subtract(M,E,m)),P=e.magnitudeSquared(e.subtract(O,l,m)),B=s,w=c,x=U;D>x&&(x=D,B=E,w=M),P>x&&(x=P,B=l,w=O);var G=N;G.x=.5*(B.x+w.x),G.y=.5*(B.y+w.y),G.z=.5*(B.z+w.z);var b=e.magnitudeSquared(e.subtract(w,G,m)),z=Math.sqrt(b),H=C;H.x=s.x,H.y=E.y,H.z=l.z;var V=I;V.x=c.x,V.y=M.y,V.z=O.z;var q=e.multiplyByScalar(e.add(H,V,m),.5,p),X=0;for(y=0;y<g;y+=o){u.x=t[y]+r.x,u.y=t[y+1]+r.y,u.z=t[y+2]+r.z;var W=e.magnitude(e.subtract(u,q,m));W>X&&(X=W);var Y=e.magnitudeSquared(e.subtract(u,G,m));if(Y>b){var K=Math.sqrt(Y);z=.5*(z+K),b=z*z;var k=K-z;G.x=(z*G.x+k*u.x)/K,G.y=(z*G.y+k*u.y)/K,G.z=(z*G.z+k*u.z)/K}}return z<X?(e.clone(G,i.center),i.radius=z):(e.clone(q,i.center),i.radius=X),i},f.fromEncodedCartesianVertices=function(t,r,n){if(a(n)||(n=new f),!a(t)||!a(r)||t.length!==r.length||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var o=S;o.x=t[0]+r[0],o.y=t[1]+r[1],o.z=t[2]+r[2];for(var i=e.clone(o,_),u=e.clone(o,R),s=e.clone(o,T),E=e.clone(o,h),l=e.clone(o,A),c=e.clone(o,d),M=t.length,O=0;O<M;O+=3){var g=t[O]+r[O],y=t[O+1]+r[O+1],F=t[O+2]+r[O+2];o.x=g,o.y=y,o.z=F,g<i.x&&e.clone(o,i),g>E.x&&e.clone(o,E),y<u.y&&e.clone(o,u),y>l.y&&e.clone(o,l),F<s.z&&e.clone(o,s),F>c.z&&e.clone(o,c)}var L=e.magnitudeSquared(e.subtract(E,i,m)),v=e.magnitudeSquared(e.subtract(l,u,m)),U=e.magnitudeSquared(e.subtract(c,s,m)),D=i,P=E,B=L;v>B&&(B=v,D=u,P=l),U>B&&(B=U,D=s,P=c);var w=N;w.x=.5*(D.x+P.x),w.y=.5*(D.y+P.y),w.z=.5*(D.z+P.z);var x=e.magnitudeSquared(e.subtract(P,w,m)),G=Math.sqrt(x),b=C;b.x=i.x,b.y=u.y,b.z=s.z;var z=I;z.x=E.x,z.y=l.y,z.z=c.z;var H=e.multiplyByScalar(e.add(b,z,m),.5,p),V=0;for(O=0;O<M;O+=3){o.x=t[O]+r[O],o.y=t[O+1]+r[O+1],o.z=t[O+2]+r[O+2];var q=e.magnitude(e.subtract(o,H,m));q>V&&(V=q);var X=e.magnitudeSquared(e.subtract(o,w,m));if(X>x){var W=Math.sqrt(X);G=.5*(G+W),x=G*G;var Y=W-G;w.x=(G*w.x+Y*o.x)/W,w.y=(G*w.y+Y*o.y)/W,w.z=(G*w.z+Y*o.z)/W}}return G<V?(e.clone(w,n.center),n.radius=G):(e.clone(H,n.center),n.radius=V),n},f.fromCornerPoints=function(t,r,n){a(n)||(n=new f);var o=n.center;return e.add(t,r,o),e.multiplyByScalar(o,.5,o),n.radius=e.distance(o,r),n},f.fromEllipsoid=function(t,r){return a(r)||(r=new f),e.clone(e.ZERO,r.center),r.radius=t.maximumRadius,r};var v=new e;f.fromBoundingSpheres=function(t,r){if(a(r)||(r=new f),!a(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var n=t.length;if(1===n)return f.clone(t[0],r);if(2===n)return f.union(t[0],t[1],r);for(var o=[],i=0;i<n;i++)o.push(t[i].center);r=f.fromPoints(o,r);var u=r.center,s=r.radius;for(i=0;i<n;i++){var E=t[i];s=Math.max(s,e.distance(u,E.center,v)+E.radius)}return r.radius=s,r};var U=new e,D=new e,P=new e;f.fromOrientedBoundingBox=function(t,r){a(r)||(r=new f);var n=t.halfAxes,o=E.getColumn(n,0,U),i=E.getColumn(n,1,D),u=E.getColumn(n,2,P),s=e.magnitude(o),l=e.magnitude(i),c=e.magnitude(u);return r.center=e.clone(t.center,r.center),r.radius=Math.max(s,l,c),r},f.clone=function(t,r){if(a(t))return a(r)?(r.center=e.clone(t.center,r.center),r.radius=t.radius,r):new f(t.center,t.radius)},f.packedLength=4,f.pack=function(e,t,r){r=n(r,0);var a=e.center;return t[r++]=a.x,t[r++]=a.y,t[r++]=a.z,t[r]=e.radius,t},f.unpack=function(e,t,r){t=n(t,0),a(r)||(r=new f);var o=r.center;return o.x=e[t++],o.y=e[t++],o.z=e[t++],r.radius=e[t],r};var B=new e,w=new e;f.union=function(t,r,n){a(n)||(n=new f);var o=t.center,i=t.radius,u=r.center,s=r.radius,E=e.subtract(u,o,B),l=e.magnitude(E);if(i>=l+s)return t.clone(n),n;if(s>=l+i)return r.clone(n),n;var c=.5*(i+l+s),_=e.multiplyByScalar(E,(-i+c)/l,w);return e.add(_,o,_),e.clone(_,n.center),n.radius=c,n};var x=new e;f.expand=function(t,r,n){n=f.clone(t,n);var a=e.magnitude(e.subtract(r,n.center,x));return a>n.radius&&(n.radius=a),n},f.intersectPlane=function(t,r){var n=t.center,a=t.radius,o=r.normal,i=e.dot(o,n)+r.distance;return i<-a?u.OUTSIDE:i<a?u.INTERSECTING:u.INSIDE},f.transform=function(e,t,r){return a(r)||(r=new f),r.center=l.multiplyByPoint(t,e.center,r.center),r.radius=l.getMaximumScale(t)*e.radius,r};var G=new e;f.distanceSquaredTo=function(t,r){var n=e.subtract(t.center,r,G);return e.magnitudeSquared(n)-t.radius*t.radius},f.transformWithoutScale=function(e,t,r){return a(r)||(r=new f),r.center=l.multiplyByPoint(t,e.center,r.center),r.radius=e.radius,r};var b=new e;f.computePlaneDistances=function(t,r,n,o){a(o)||(o=new s);var i=e.subtract(t.center,r,b),u=e.dot(n,i);return o.start=u-t.radius,o.stop=u+t.radius,o};for(var z=new e,H=new e,V=new e,q=new e,X=new e,W=new t,Y=new Array(8),K=0;K<8;++K)Y[K]=new e;var k=new i;return f.projectTo2D=function(t,r,a){r=n(r,k);var o=r.ellipsoid,i=t.center,u=t.radius,s=o.geodeticSurfaceNormal(i,z),E=e.cross(e.UNIT_Z,s,H);e.normalize(E,E);var l=e.cross(s,E,V);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(E,u,E);var c=e.negate(l,X),_=e.negate(E,q),R=Y,T=R[0];e.add(s,l,T),e.add(T,E,T),T=R[1],e.add(s,l,T),e.add(T,_,T),T=R[2],e.add(s,c,T),e.add(T,_,T),T=R[3],e.add(s,c,T),e.add(T,E,T),e.negate(s,s),T=R[4],e.add(s,l,T),e.add(T,E,T),T=R[5],e.add(s,l,T),e.add(T,_,T),T=R[6],e.add(s,c,T),e.add(T,_,T),T=R[7],e.add(s,c,T),e.add(T,E,T);for(var h=R.length,A=0;A<h;++A){var d=R[A];e.add(i,d,d);var S=o.cartesianToCartographic(d,W);r.project(S,d)}a=f.fromPoints(R,a),i=a.center;var m=i.x,N=i.y,C=i.z;return i.x=C,i.y=m,i.z=N,a},f.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},f.equals=function(t,r){return t===r||a(t)&&a(r)&&e.equals(t.center,r.center)&&t.radius===r.radius},f.prototype.intersectPlane=function(e){return f.intersectPlane(this,e)},f.prototype.distanceSquaredTo=function(e){return f.distanceSquaredTo(this,e)},f.prototype.computePlaneDistances=function(e,t,r){return f.computePlaneDistances(this,e,t,r)},f.prototype.isOccluded=function(e){return f.isOccluded(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},a={};return t(a,{element:{get:function(){if(a.supportsFullscreen())return document[n.fullscreenElement]}},changeEventName:{get:function(){if(a.supportsFullscreen())return n.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return n.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[n.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.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 a,o=["webkit","moz","o","ms","khtml"],i=0,u=o.length;i<u;++i){var s=o[i];a=s+"RequestFullscreen","function"==typeof t[a]?(n.requestFullscreen=a,r=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(n.requestFullscreen=a,r=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?n.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(n.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?n.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(n.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?n.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(n.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),n.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),n.fullscreenerror=a)}return r},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[n.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[n.exitFullscreen]()},a}),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;r<n;++r)t[r]=parseInt(t[r],10);return t}function a(){if(!t(N)&&(N=!1,!f())){var e=/ Chrome\/([\.0-9]+)/.exec(m.userAgent);null!==e&&(N=!0,C=n(e[1]))}return N}function o(){return a()&&C}function i(){if(!t(I)&&(I=!1,!a()&&!f()&&/ Safari\/[\.0-9]+/.test(m.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(m.userAgent);null!==e&&(I=!0,p=n(e[1]))}return I}function u(){return i()&&p}function s(){if(!t(M)){M=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(m.userAgent);null!==e&&(M=!0,O=n(e[1]),O.isNightly=!!e[2])}return M}function E(){return s()&&O}function l(){if(!t(g)){g=!1;var e;"Microsoft Internet Explorer"===m.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(m.userAgent),null!==e&&(g=!0,y=n(e[1]))):"Netscape"===m.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(m.userAgent),null!==e&&(g=!0,y=n(e[1])))}return g}function c(){return l()&&y}function f(){if(!t(F)){F=!1;var e=/ Edge\/([\.0-9]+)/.exec(m.userAgent);null!==e&&(F=!0,L=n(e[1]))}return F}function _(){return f()&&L}function R(){if(!t(v)){v=!1;var e=/Firefox\/([\.0-9]+)/.exec(m.userAgent); +null!==e&&(v=!0,U=n(e[1]))}return v}function T(){return t(D)||(D=/Windows/i.test(m.appVersion)),D}function h(){return R()&&U}function A(){return t(P)||(P="undefined"!=typeof PointerEvent&&(!t(m.pointerEnabled)||m.pointerEnabled)),P}function d(){if(!t(w)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var r=e.style.imageRendering;w=t(r)&&""!==r,w&&(B=r)}return w}function S(){return d()?B:void 0}var m;m="undefined"!=typeof navigator?navigator:{};var N,C,I,p,M,O,g,y,F,L,v,U,D,P,B,w,x={isChrome:a,chromeVersion:o,isSafari:i,safariVersion:u,isWebkit:s,webkitVersion:E,isInternetExplorer:l,internetExplorerVersion:c,isEdge:f,edgeVersion:_,isFirefox:R,firefoxVersion:h,isWindows:T,hardwareConcurrency:e(m.hardwareConcurrency,3),supportsPointerEvents:A,supportsImageRenderingPixelated:d,imageRenderingValue:S};return x.supportsFullscreen=function(){return r.supportsFullscreen()},x.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},x.supportsWebWorkers=function(){return"undefined"!=typeof Worker},x}),define("Core/Color",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math"],function(e,t,r,n,a,o){"use strict";function i(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),6*r<1?e+6*(t-e)*r:2*r<1?t:3*r<2?e+(t-e)*(2/3-r)*6:e}function u(t,r,n,a){this.red=e(t,1),this.green=e(r,1),this.blue=e(n,1),this.alpha=e(a,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(r,n,a,o,i){return r=u.byteToFloat(e(r,255)),n=u.byteToFloat(e(n,255)),a=u.byteToFloat(e(a,255)),o=u.byteToFloat(e(o,255)),t(i)?(i.red=r,i.green=n,i.blue=a,i.alpha=o,i):new u(r,n,a,o)},u.fromAlpha=function(e,r,n){return t(n)?(n.red=e.red,n.green=e.green,n.blue=e.blue,n.alpha=r,n):new u(e.red,e.green,e.blue,r)};var s,E,l;n.supportsTypedArrays()&&(s=new ArrayBuffer(4),E=new Uint32Array(s),l=new Uint8Array(s)),u.fromRgba=function(e,t){return E[0]=e,u.fromBytes(l[0],l[1],l[2],l[3],t)},u.fromHsl=function(r,n,a,o,s){r=e(r,0)%1,n=e(n,0),a=e(a,0),o=e(o,1);var E=a,l=a,c=a;if(0!==n){var f;f=a<.5?a*(1+n):a+n-a*n;var _=2*a-f;E=i(_,f,r+1/3),l=i(_,f,r),c=i(_,f,r-1/3)}return t(s)?(s.red=E,s.green=l,s.blue=c,s.alpha=o,s):new u(E,l,c,o)},u.fromRandom=function(r,n){r=e(r,e.EMPTY_OBJECT);var a=r.red;if(!t(a)){var i=e(r.minimumRed,0),s=e(r.maximumRed,1);a=i+o.nextRandomNumber()*(s-i)}var E=r.green;if(!t(E)){var l=e(r.minimumGreen,0),c=e(r.maximumGreen,1);E=l+o.nextRandomNumber()*(c-l)}var f=r.blue;if(!t(f)){var _=e(r.minimumBlue,0),R=e(r.maximumBlue,1);f=_+o.nextRandomNumber()*(R-_)}var T=r.alpha;if(!t(T)){var h=e(r.minimumAlpha,0),A=e(r.maximumAlpha,1);T=h+o.nextRandomNumber()*(A-h)}return t(n)?(n.red=a,n.green=E,n.blue=f,n.alpha=T,n):new u(a,E,f,T)};var c=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i,f=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i,_=/^rgba?\(\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)(?:\s*,\s*([0-9.]+))?\s*\)$/i,R=/^hsla?\(\s*([0-9.]+)\s*,\s*([0-9.]+%)\s*,\s*([0-9.]+%)(?:\s*,\s*([0-9.]+))?\s*\)$/i;return u.fromCssColorString=function(r,n){t(n)||(n=new u);var a=u[r.toUpperCase()];if(t(a))return u.clone(a,n),n;var o=c.exec(r);return null!==o?(n.red=parseInt(o[1],16)/15,n.green=parseInt(o[2],16)/15,n.blue=parseInt(o[3],16)/15,n.alpha=1,n):(o=f.exec(r),null!==o?(n.red=parseInt(o[1],16)/255,n.green=parseInt(o[2],16)/255,n.blue=parseInt(o[3],16)/255,n.alpha=1,n):(o=_.exec(r),null!==o?(n.red=parseFloat(o[1])/("%"===o[1].substr(-1)?100:255),n.green=parseFloat(o[2])/("%"===o[2].substr(-1)?100:255),n.blue=parseFloat(o[3])/("%"===o[3].substr(-1)?100:255),n.alpha=parseFloat(e(o[4],"1.0")),n):(o=R.exec(r),null!==o?u.fromHsl(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,parseFloat(e(o[4],"1.0")),n):n=void 0)))},u.packedLength=4,u.pack=function(t,r,n){return n=e(n,0),r[n++]=t.red,r[n++]=t.green,r[n++]=t.blue,r[n]=t.alpha,r},u.unpack=function(r,n,a){return n=e(n,0),t(a)||(a=new u),a.red=r[n++],a.green=r[n++],a.blue=r[n++],a.alpha=r[n],a},u.byteToFloat=function(e){return e/255},u.floatToByte=function(e){return 1===e?255:256*e|0},u.clone=function(e,r){if(t(e))return 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)},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.equalsArray=function(e,t,r){return e.red===t[r]&&e.green===t[r+1]&&e.blue===t[r+2]&&e.alpha===t[r+3]},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),a=u.floatToByte(this.blue),o=u.floatToByte(this.alpha);return t(e)?(e[0]=r,e[1]=n,e[2]=a,e[3]=o,e):[r,n,a,o]},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),E[0]},u.prototype.brighten=function(e,t){return e=1-e,t.red=1-(1-this.red)*e,t.green=1-(1-this.green)*e,t.blue=1-(1-this.blue)*e,t.alpha=this.alpha,t},u.prototype.darken=function(e,t){return e=1-e,t.red=this.red*e,t.green=this.green*e,t.blue=this.blue*e,t.alpha=this.alpha,t},u.prototype.withAlpha=function(e,t){return u.fromAlpha(this,e,t)},u.add=function(e,t,r){return r.red=e.red+t.red,r.green=e.green+t.green,r.blue=e.blue+t.blue,r.alpha=e.alpha+t.alpha,r},u.subtract=function(e,t,r){return r.red=e.red-t.red,r.green=e.green-t.green,r.blue=e.blue-t.blue,r.alpha=e.alpha-t.alpha,r},u.multiply=function(e,t,r){return r.red=e.red*t.red,r.green=e.green*t.green,r.blue=e.blue*t.blue,r.alpha=e.alpha*t.alpha,r},u.divide=function(e,t,r){return r.red=e.red/t.red,r.green=e.green/t.green,r.blue=e.blue/t.blue,r.alpha=e.alpha/t.alpha,r},u.mod=function(e,t,r){return r.red=e.red%t.red,r.green=e.green%t.green,r.blue=e.blue%t.blue,r.alpha=e.alpha%t.alpha,r},u.multiplyByScalar=function(e,t,r){return r.red=e.red*t,r.green=e.green*t,r.blue=e.blue*t,r.alpha=e.alpha*t,r},u.divideByScalar=function(e,t,r){return r.red=e.red/t,r.green=e.green/t,r.blue=e.blue/t,r.alpha=e.alpha/t,r},u.ALICEBLUE=a(u.fromCssColorString("#F0F8FF")),u.ANTIQUEWHITE=a(u.fromCssColorString("#FAEBD7")),u.AQUA=a(u.fromCssColorString("#00FFFF")),u.AQUAMARINE=a(u.fromCssColorString("#7FFFD4")),u.AZURE=a(u.fromCssColorString("#F0FFFF")),u.BEIGE=a(u.fromCssColorString("#F5F5DC")),u.BISQUE=a(u.fromCssColorString("#FFE4C4")),u.BLACK=a(u.fromCssColorString("#000000")),u.BLANCHEDALMOND=a(u.fromCssColorString("#FFEBCD")),u.BLUE=a(u.fromCssColorString("#0000FF")),u.BLUEVIOLET=a(u.fromCssColorString("#8A2BE2")),u.BROWN=a(u.fromCssColorString("#A52A2A")),u.BURLYWOOD=a(u.fromCssColorString("#DEB887")),u.CADETBLUE=a(u.fromCssColorString("#5F9EA0")),u.CHARTREUSE=a(u.fromCssColorString("#7FFF00")),u.CHOCOLATE=a(u.fromCssColorString("#D2691E")),u.CORAL=a(u.fromCssColorString("#FF7F50")),u.CORNFLOWERBLUE=a(u.fromCssColorString("#6495ED")),u.CORNSILK=a(u.fromCssColorString("#FFF8DC")),u.CRIMSON=a(u.fromCssColorString("#DC143C")),u.CYAN=a(u.fromCssColorString("#00FFFF")),u.DARKBLUE=a(u.fromCssColorString("#00008B")),u.DARKCYAN=a(u.fromCssColorString("#008B8B")),u.DARKGOLDENROD=a(u.fromCssColorString("#B8860B")),u.DARKGRAY=a(u.fromCssColorString("#A9A9A9")),u.DARKGREEN=a(u.fromCssColorString("#006400")),u.DARKGREY=u.DARKGRAY,u.DARKKHAKI=a(u.fromCssColorString("#BDB76B")),u.DARKMAGENTA=a(u.fromCssColorString("#8B008B")),u.DARKOLIVEGREEN=a(u.fromCssColorString("#556B2F")),u.DARKORANGE=a(u.fromCssColorString("#FF8C00")),u.DARKORCHID=a(u.fromCssColorString("#9932CC")),u.DARKRED=a(u.fromCssColorString("#8B0000")),u.DARKSALMON=a(u.fromCssColorString("#E9967A")),u.DARKSEAGREEN=a(u.fromCssColorString("#8FBC8F")),u.DARKSLATEBLUE=a(u.fromCssColorString("#483D8B")),u.DARKSLATEGRAY=a(u.fromCssColorString("#2F4F4F")),u.DARKSLATEGREY=u.DARKSLATEGRAY,u.DARKTURQUOISE=a(u.fromCssColorString("#00CED1")),u.DARKVIOLET=a(u.fromCssColorString("#9400D3")),u.DEEPPINK=a(u.fromCssColorString("#FF1493")),u.DEEPSKYBLUE=a(u.fromCssColorString("#00BFFF")),u.DIMGRAY=a(u.fromCssColorString("#696969")),u.DIMGREY=u.DIMGRAY,u.DODGERBLUE=a(u.fromCssColorString("#1E90FF")),u.FIREBRICK=a(u.fromCssColorString("#B22222")),u.FLORALWHITE=a(u.fromCssColorString("#FFFAF0")),u.FORESTGREEN=a(u.fromCssColorString("#228B22")),u.FUSCHIA=a(u.fromCssColorString("#FF00FF")),u.GAINSBORO=a(u.fromCssColorString("#DCDCDC")),u.GHOSTWHITE=a(u.fromCssColorString("#F8F8FF")),u.GOLD=a(u.fromCssColorString("#FFD700")),u.GOLDENROD=a(u.fromCssColorString("#DAA520")),u.GRAY=a(u.fromCssColorString("#808080")),u.GREEN=a(u.fromCssColorString("#008000")),u.GREENYELLOW=a(u.fromCssColorString("#ADFF2F")),u.GREY=u.GRAY,u.HONEYDEW=a(u.fromCssColorString("#F0FFF0")),u.HOTPINK=a(u.fromCssColorString("#FF69B4")),u.INDIANRED=a(u.fromCssColorString("#CD5C5C")),u.INDIGO=a(u.fromCssColorString("#4B0082")),u.IVORY=a(u.fromCssColorString("#FFFFF0")),u.KHAKI=a(u.fromCssColorString("#F0E68C")),u.LAVENDER=a(u.fromCssColorString("#E6E6FA")),u.LAVENDAR_BLUSH=a(u.fromCssColorString("#FFF0F5")),u.LAWNGREEN=a(u.fromCssColorString("#7CFC00")),u.LEMONCHIFFON=a(u.fromCssColorString("#FFFACD")),u.LIGHTBLUE=a(u.fromCssColorString("#ADD8E6")),u.LIGHTCORAL=a(u.fromCssColorString("#F08080")),u.LIGHTCYAN=a(u.fromCssColorString("#E0FFFF")),u.LIGHTGOLDENRODYELLOW=a(u.fromCssColorString("#FAFAD2")),u.LIGHTGRAY=a(u.fromCssColorString("#D3D3D3")),u.LIGHTGREEN=a(u.fromCssColorString("#90EE90")),u.LIGHTGREY=u.LIGHTGRAY,u.LIGHTPINK=a(u.fromCssColorString("#FFB6C1")),u.LIGHTSEAGREEN=a(u.fromCssColorString("#20B2AA")),u.LIGHTSKYBLUE=a(u.fromCssColorString("#87CEFA")),u.LIGHTSLATEGRAY=a(u.fromCssColorString("#778899")),u.LIGHTSLATEGREY=u.LIGHTSLATEGRAY,u.LIGHTSTEELBLUE=a(u.fromCssColorString("#B0C4DE")),u.LIGHTYELLOW=a(u.fromCssColorString("#FFFFE0")),u.LIME=a(u.fromCssColorString("#00FF00")),u.LIMEGREEN=a(u.fromCssColorString("#32CD32")),u.LINEN=a(u.fromCssColorString("#FAF0E6")),u.MAGENTA=a(u.fromCssColorString("#FF00FF")),u.MAROON=a(u.fromCssColorString("#800000")),u.MEDIUMAQUAMARINE=a(u.fromCssColorString("#66CDAA")),u.MEDIUMBLUE=a(u.fromCssColorString("#0000CD")),u.MEDIUMORCHID=a(u.fromCssColorString("#BA55D3")),u.MEDIUMPURPLE=a(u.fromCssColorString("#9370DB")),u.MEDIUMSEAGREEN=a(u.fromCssColorString("#3CB371")),u.MEDIUMSLATEBLUE=a(u.fromCssColorString("#7B68EE")),u.MEDIUMSPRINGGREEN=a(u.fromCssColorString("#00FA9A")),u.MEDIUMTURQUOISE=a(u.fromCssColorString("#48D1CC")),u.MEDIUMVIOLETRED=a(u.fromCssColorString("#C71585")),u.MIDNIGHTBLUE=a(u.fromCssColorString("#191970")),u.MINTCREAM=a(u.fromCssColorString("#F5FFFA")),u.MISTYROSE=a(u.fromCssColorString("#FFE4E1")),u.MOCCASIN=a(u.fromCssColorString("#FFE4B5")),u.NAVAJOWHITE=a(u.fromCssColorString("#FFDEAD")),u.NAVY=a(u.fromCssColorString("#000080")),u.OLDLACE=a(u.fromCssColorString("#FDF5E6")),u.OLIVE=a(u.fromCssColorString("#808000")),u.OLIVEDRAB=a(u.fromCssColorString("#6B8E23")),u.ORANGE=a(u.fromCssColorString("#FFA500")),u.ORANGERED=a(u.fromCssColorString("#FF4500")),u.ORCHID=a(u.fromCssColorString("#DA70D6")),u.PALEGOLDENROD=a(u.fromCssColorString("#EEE8AA")),u.PALEGREEN=a(u.fromCssColorString("#98FB98")),u.PALETURQUOISE=a(u.fromCssColorString("#AFEEEE")),u.PALEVIOLETRED=a(u.fromCssColorString("#DB7093")),u.PAPAYAWHIP=a(u.fromCssColorString("#FFEFD5")),u.PEACHPUFF=a(u.fromCssColorString("#FFDAB9")),u.PERU=a(u.fromCssColorString("#CD853F")),u.PINK=a(u.fromCssColorString("#FFC0CB")),u.PLUM=a(u.fromCssColorString("#DDA0DD")),u.POWDERBLUE=a(u.fromCssColorString("#B0E0E6")),u.PURPLE=a(u.fromCssColorString("#800080")),u.RED=a(u.fromCssColorString("#FF0000")),u.ROSYBROWN=a(u.fromCssColorString("#BC8F8F")),u.ROYALBLUE=a(u.fromCssColorString("#4169E1")),u.SADDLEBROWN=a(u.fromCssColorString("#8B4513")),u.SALMON=a(u.fromCssColorString("#FA8072")),u.SANDYBROWN=a(u.fromCssColorString("#F4A460")),u.SEAGREEN=a(u.fromCssColorString("#2E8B57")),u.SEASHELL=a(u.fromCssColorString("#FFF5EE")),u.SIENNA=a(u.fromCssColorString("#A0522D")),u.SILVER=a(u.fromCssColorString("#C0C0C0")),u.SKYBLUE=a(u.fromCssColorString("#87CEEB")),u.SLATEBLUE=a(u.fromCssColorString("#6A5ACD")),u.SLATEGRAY=a(u.fromCssColorString("#708090")),u.SLATEGREY=u.SLATEGRAY,u.SNOW=a(u.fromCssColorString("#FFFAFA")),u.SPRINGGREEN=a(u.fromCssColorString("#00FF7F")),u.STEELBLUE=a(u.fromCssColorString("#4682B4")),u.TAN=a(u.fromCssColorString("#D2B48C")),u.TEAL=a(u.fromCssColorString("#008080")),u.THISTLE=a(u.fromCssColorString("#D8BFD8")),u.TOMATO=a(u.fromCssColorString("#FF6347")),u.TURQUOISE=a(u.fromCssColorString("#40E0D0")),u.VIOLET=a(u.fromCssColorString("#EE82EE")),u.WHEAT=a(u.fromCssColorString("#F5DEB3")),u.WHITE=a(u.fromCssColorString("#FFFFFF")),u.WHITESMOKE=a(u.fromCssColorString("#F5F5F5")),u.YELLOW=a(u.fromCssColorString("#FFFF00")),u.YELLOWGREEN=a(u.fromCssColorString("#9ACD32")),u.TRANSPARENT=a(new u(0,0,0,0)),u}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,r,n,a,o){"use strict";if(!n.supportsTypedArrays())return{};var i={BYTE:o.BYTE,UNSIGNED_BYTE:o.UNSIGNED_BYTE,SHORT:o.SHORT,UNSIGNED_SHORT:o.UNSIGNED_SHORT,INT:o.INT,UNSIGNED_INT:o.UNSIGNED_INT,FLOAT:o.FLOAT,DOUBLE:o.DOUBLE};return i.getSizeInBytes=function(e){switch(e){case i.BYTE:return Int8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.SHORT:return Int16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.INT:return Int32Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case i.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case i.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},i.fromTypedArray=function(e){return e instanceof Int8Array?i.BYTE:e instanceof Uint8Array?i.UNSIGNED_BYTE:e instanceof Int16Array?i.SHORT:e instanceof Uint16Array?i.UNSIGNED_SHORT:e instanceof Int32Array?i.INT:e instanceof Uint32Array?i.UNSIGNED_INT:e instanceof Float32Array?i.FLOAT:e instanceof Float64Array?i.DOUBLE:void 0},i.validate=function(e){return t(e)&&(e===i.BYTE||e===i.UNSIGNED_BYTE||e===i.SHORT||e===i.UNSIGNED_SHORT||e===i.INT||e===i.UNSIGNED_INT||e===i.FLOAT||e===i.DOUBLE)},i.createTypedArray=function(e,t){switch(e){case i.BYTE:return new Int8Array(t);case i.UNSIGNED_BYTE:return new Uint8Array(t);case i.SHORT:return new Int16Array(t);case i.UNSIGNED_SHORT:return new Uint16Array(t);case i.INT:return new Int32Array(t);case i.UNSIGNED_INT:return new Uint32Array(t);case i.FLOAT:return new Float32Array(t);case i.DOUBLE:return new Float64Array(t)}},i.createArrayBufferView=function(t,r,n,a){switch(n=e(n,0),a=e(a,(r.byteLength-n)/i.getSizeInBytes(t)),t){case i.BYTE:return new Int8Array(r,n,a);case i.UNSIGNED_BYTE:return new Uint8Array(r,n,a);case i.SHORT:return new Int16Array(r,n,a);case i.UNSIGNED_SHORT:return new Uint16Array(r,n,a);case i.INT:return new Int32Array(r,n,a);case i.UNSIGNED_INT:return new Uint32Array(r,n,a);case i.FLOAT:return new Float32Array(r,n,a);case i.DOUBLE:return new Float64Array(r,n,a)}},i.fromName=function(e){switch(e){case"BYTE":return i.BYTE;case"UNSIGNED_BYTE":return i.UNSIGNED_BYTE;case"SHORT":return i.SHORT;case"UNSIGNED_SHORT":return i.UNSIGNED_SHORT;case"INT":return i.INT;case"UNSIGNED_INT":return i.UNSIGNED_INT;case"FLOAT":return i.FLOAT;case"DOUBLE":return i.DOUBLE}},a(i)}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var r={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,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,t,r,n,a){"use strict";function o(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,a.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,n.NONE),this.boundingSphereCV=t.boundingSphereCV}return o.computeNumberOfVertices=function(e){var r=-1;for(var n in e.attributes)if(e.attributes.hasOwnProperty(n)&&t(e.attributes[n])&&t(e.attributes[n].values)){var a=e.attributes[n],o=a.values.length/a.componentsPerAttribute;r=o}return r},o}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(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 n}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,r,n,a){"use strict";var o={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};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)},o.createTypedArrayFromArrayBuffer=function(e,t,r,a){return e>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,r,a):new Uint16Array(t,r,a)},r(o)}),define("Core/EllipsoidGeodesic",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,r,n,a,o,i,u){"use strict";function s(e){var t=e._uSquared,r=e._ellipsoid.maximumRadius,n=e._ellipsoid.minimumRadius,a=(r-n)/r,o=Math.cos(e._startHeading),i=Math.sin(e._startHeading),u=(1-a)*Math.tan(e._start.latitude),s=1/Math.sqrt(1+u*u),E=s*u,l=Math.atan2(u,o),c=s*i,f=c*c,_=1-f,R=Math.sqrt(_),T=t/4,h=T*T,A=h*T,d=h*h,S=1+T-3*h/4+5*A/4-175*d/64,m=1-T+15*h/8-35*A/8,N=1-3*T+35*h/4,C=1-5*T,I=S*l-m*Math.sin(2*l)*T/2-N*Math.sin(4*l)*h/16-C*Math.sin(6*l)*A/48-5*Math.sin(8*l)*d/512,p=e._constants; +p.a=r,p.b=n,p.f=a,p.cosineHeading=o,p.sineHeading=i,p.tanU=u,p.cosineU=s,p.sineU=E,p.sigma=l,p.sineAlpha=c,p.sineSquaredAlpha=f,p.cosineSquaredAlpha=_,p.cosineAlpha=R,p.u2Over4=T,p.u4Over16=h,p.u6Over64=A,p.u8Over256=d,p.a0=S,p.a1=m,p.a2=N,p.a3=C,p.distanceRatio=I}function E(e,t){return e*t*(4+e*(4-3*t))/16}function l(e,t,r,n,a,o,i){var u=E(e,r);return(1-u)*e*t*(n+u*a*(i+u*o*(2*i*i-1)))}function c(e,t,r,n,a,o,i){var s,E,c,f,_,R=(t-r)/t,T=o-n,h=Math.atan((1-R)*Math.tan(a)),A=Math.atan((1-R)*Math.tan(i)),d=Math.cos(h),S=Math.sin(h),m=Math.cos(A),N=Math.sin(A),C=d*m,I=d*N,p=S*N,M=S*m,O=T,g=u.TWO_PI,y=Math.cos(O),F=Math.sin(O);do{y=Math.cos(O),F=Math.sin(O);var L=I-M*y;c=Math.sqrt(m*m*F*F+L*L),E=p+C*y,s=Math.atan2(c,E);var v;0===c?(v=0,f=1):(v=C*F/c,f=1-v*v),g=O,_=E-2*p/f,isNaN(_)&&(_=0),O=T+l(R,v,f,s,c,E,_)}while(Math.abs(O-g)>u.EPSILON12);var U=f*(t*t-r*r)/(r*r),D=1+U*(4096+U*(U*(320-175*U)-768))/16384,P=U*(256+U*(U*(74-47*U)-128))/1024,B=_*_,w=P*c*(_+P*(E*(2*B-1)-P*_*(4*c*c-3)*(4*B-3)/6)/4),x=r*D*(s-w),G=Math.atan2(m*F,I-M*y),b=Math.atan2(d*F,I*y-M);e._distance=x,e._startHeading=G,e._endHeading=b,e._uSquared=U}function f(r,n,a,o){e.normalize(o.cartographicToCartesian(n,T),R),e.normalize(o.cartographicToCartesian(a,T),T);c(r,o.maximumRadius,o.minimumRadius,n.longitude,n.latitude,a.longitude,a.latitude),r._start=t.clone(n,r._start),r._end=t.clone(a,r._end),r._start.height=0,r._end.height=0,s(r)}function _(e,a,o){var u=r(o,i.WGS84);this._ellipsoid=u,this._start=new t,this._end=new t,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,n(e)&&n(a)&&f(this,e,a,u)}var R=new e,T=new e;return a(_.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return this._startHeading}},endHeading:{get:function(){return this._endHeading}}}),_.prototype.setEndPoints=function(e,t){f(this,e,t,this._ellipsoid)},_.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},_.prototype.interpolateUsingSurfaceDistance=function(e,r){var a=this._constants,o=a.distanceRatio+e/a.b,i=Math.cos(2*o),u=Math.cos(4*o),s=Math.cos(6*o),E=Math.sin(2*o),c=Math.sin(4*o),f=Math.sin(6*o),_=Math.sin(8*o),R=o*o,T=o*R,h=a.u8Over256,A=a.u2Over4,d=a.u6Over64,S=a.u4Over16,m=2*T*h*i/3+o*(1-A+7*S/4-15*d/4+579*h/64-(S-15*d/4+187*h/16)*i-(5*d/4-115*h/16)*u-29*h*s/16)+(A/2-S+71*d/32-85*h/16)*E+(5*S/16-5*d/4+383*h/96)*c-R*((d-11*h/2)*E+5*h*c/2)+(29*d/96-29*h/16)*f+539*h*_/1536,N=Math.asin(Math.sin(m)*a.cosineAlpha),C=Math.atan(a.a/a.b*Math.tan(N));m-=a.sigma;var I=Math.cos(2*a.sigma+m),p=Math.sin(m),M=Math.cos(m),O=a.cosineU*M,g=a.sineU*p,y=Math.atan2(p*a.sineHeading,O-g*a.cosineHeading),F=y-l(a.f,a.sineAlpha,a.cosineSquaredAlpha,m,p,M,I);return n(r)?(r.longitude=this._start.longitude+F,r.latitude=C,r.height=0,r):new t(this._start.longitude+F,C,0)},_}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function r(e,r,n){var a=e+r;return t.sign(e)!==t.sign(r)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(r)))<n?0:a}var n={};return n.computeDiscriminant=function(e,t,r){var n=t*t-4*e*r;return n},n.computeRealRoots=function(e,n,a){var o;if(0===e)return 0===n?[]:[-a/n];if(0===n){if(0===a)return[0,0];var i=Math.abs(a),u=Math.abs(e);if(i<u&&i/u<t.EPSILON14)return[0,0];if(i>u&&u/i<t.EPSILON14)return[];if(o=-a/e,o<0)return[];var s=Math.sqrt(o);return[-s,s]}if(0===a)return o=-n/e,o<0?[o,0]:[0,o];var E=n*n,l=4*e*a,c=r(E,-l,t.EPSILON14);if(c<0)return[];var f=-.5*r(n,t.sign(n)*Math.sqrt(c),t.EPSILON14);return n>0?[f/e,a/f]:[a/f,f/e]},n}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function r(e,t,r,n){var a,o,i=e,u=t/3,s=r/3,E=n,l=i*s,c=u*E,f=u*u,_=s*s,R=i*s-f,T=i*E-u*s,h=u*E-_,A=4*R*h-T*T;if(A<0){var d,S,m;f*c>=l*_?(d=i,S=R,m=-2*u*R+i*T):(d=E,S=h,m=-E*T+2*s*h);var N=m<0?-1:1,C=-N*Math.abs(d)*Math.sqrt(-A);o=-m+C;var I=o/2,p=I<0?-Math.pow(-I,1/3):Math.pow(I,1/3),M=o===C?-p:-S/p;return a=S<=0?p+M:-m/(p*p+M*M+S),f*c>=l*_?[(a-u)/i]:[-E/(a+s)]}var O=R,g=-2*u*R+i*T,y=h,F=-E*T+2*s*h,L=Math.sqrt(A),v=Math.sqrt(3)/2,U=Math.abs(Math.atan2(i*L,-g)/3);a=2*Math.sqrt(-O);var D=Math.cos(U);o=a*D;var P=a*(-D/2-v*Math.sin(U)),B=o+P>2*u?o-u:P-u,w=i,x=B/w;U=Math.abs(Math.atan2(E*L,-F)/3),a=2*Math.sqrt(-y),D=Math.cos(U),o=a*D,P=a*(-D/2-v*Math.sin(U));var G=-E,b=o+P<2*s?o+s:P+s,z=G/b,H=w*b,V=-B*b-w*G,q=B*G,X=(s*V-u*q)/(-u*V+s*H);return x<=X?x<=z?X<=z?[x,X,z]:[x,z,X]:[z,x,X]:x<=z?[X,x,z]:X<=z?[X,z,x]:[z,X,x]}var n={};return n.computeDiscriminant=function(e,t,r,n){var a=e*e,o=t*t,i=r*r,u=n*n,s=18*e*t*r*n+o*i-27*a*u-4*(e*i*r+o*t*n);return s},n.computeRealRoots=function(e,n,a,o){var i,u;if(0===e)return t.computeRealRoots(n,a,o);if(0===n){if(0===a){if(0===o)return[0,0,0];u=-o/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===o?(i=t.computeRealRoots(e,0,a),0===i.Length?[0]:[i[0],0,i[1]]):r(e,0,a,o)}return 0===a?0===o?(u=-n/e,u<0?[u,0,0]:[0,0,u]):r(e,n,0,o):0===o?(i=t.computeRealRoots(e,n,a),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,a,o)},n}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,r,n){"use strict";function a(t,a,o,i){var u=t*t,s=a-3*u/8,E=o-a*t/2+u*t/8,l=i-o*t/4+a*u/16-3*u*u/256,c=e.computeRealRoots(1,2*s,s*s-4*l,-E*E);if(c.length>0){var f=-t/4,_=c[c.length-1];if(Math.abs(_)<r.EPSILON14){var R=n.computeRealRoots(1,s,l);if(2===R.length){var T,h=R[0],A=R[1];if(h>=0&&A>=0){var d=Math.sqrt(h),S=Math.sqrt(A);return[f-S,f-d,f+d,f+S]}if(h>=0&&A<0)return T=Math.sqrt(h),[f-T,f+T];if(h<0&&A>=0)return T=Math.sqrt(A),[f-T,f+T]}return[]}if(_>0){var m=Math.sqrt(_),N=(s+_-E/m)/2,C=(s+_+E/m)/2,I=n.computeRealRoots(1,m,N),p=n.computeRealRoots(1,-m,C);return 0!==I.length?(I[0]+=f,I[1]+=f,0!==p.length?(p[0]+=f,p[1]+=f,I[1]<=p[0]?[I[0],I[1],p[0],p[1]]:p[1]<=I[0]?[p[0],p[1],I[0],I[1]]:I[0]>=p[0]&&I[1]<=p[1]?[p[0],I[0],I[1],p[1]]:p[0]>=I[0]&&p[1]<=I[1]?[I[0],p[0],p[1],I[1]]:I[0]>p[0]&&I[0]<p[1]?[p[0],I[0],p[1],I[1]]:[I[0],p[0],I[1],p[1]]):I):0!==p.length?(p[0]+=f,p[1]+=f,p):[]}}return[]}function o(t,a,o,i){var u=o*o,s=a*a,E=t*t,l=-2*a,c=o*t+s-4*i,f=E*i-o*a*t+u,_=e.computeRealRoots(1,l,c,f);if(_.length>0){var R,T,h=_[0],A=a-h,d=A*A,S=t/2,m=A/2,N=d-4*i,C=d+4*Math.abs(i),I=E-4*h,p=E+4*Math.abs(h);if(h<0||N*p<I*C){var M=Math.sqrt(I);R=M/2,T=0===M?0:(t*m-o)/M}else{var O=Math.sqrt(N);R=0===O?0:(t*m-o)/O,T=O/2}var g,y;0===S&&0===R?(g=0,y=0):r.sign(S)===r.sign(R)?(g=S+R,y=h/g):(y=S-R,g=h/y);var F,L;0===m&&0===T?(F=0,L=0):r.sign(m)===r.sign(T)?(F=m+T,L=i/F):(L=m-T,F=i/L);var v=n.computeRealRoots(1,g,F),U=n.computeRealRoots(1,y,L);if(0!==v.length)return 0!==U.length?v[1]<=U[0]?[v[0],v[1],U[0],U[1]]:U[1]<=v[0]?[U[0],U[1],v[0],v[1]]:v[0]>=U[0]&&v[1]<=U[1]?[U[0],v[0],v[1],U[1]]:U[0]>=v[0]&&U[1]<=v[1]?[v[0],U[0],U[1],v[1]]:v[0]>U[0]&&v[0]<U[1]?[U[0],v[0],U[1],v[1]]:[v[0],U[0],v[1],U[1]]:v;if(0!==U.length)return U}return[]}var i={};return i.computeDiscriminant=function(e,t,r,n,a){var o=e*e,i=o*e,u=t*t,s=u*t,E=r*r,l=E*r,c=n*n,f=c*n,_=a*a,R=_*a,T=u*E*c-4*s*f-4*e*l*c+18*e*t*r*f-27*o*c*c+256*i*R+a*(18*s*r*n-4*u*l+16*e*E*E-80*e*t*E*n-6*e*u*c+144*o*r*c)+_*(144*e*u*r-27*u*u-128*o*E-192*o*t*n);return T},i.computeRealRoots=function(t,n,i,u,s){if(Math.abs(t)<r.EPSILON15)return e.computeRealRoots(n,i,u,s);var E=n/t,l=i/t,c=u/t,f=s/t,_=E<0?1:0;switch(_+=l<0?_+1:_,_+=c<0?_+1:_,_+=f<0?_+1:_){case 0:return a(E,l,c,f);case 1:return o(E,l,c,f);case 2:return o(E,l,c,f);case 3:return a(E,l,c,f);case 4:return a(E,l,c,f);case 5:return o(E,l,c,f);case 6:return a(E,l,c,f);case 7:return a(E,l,c,f);case 8:return o(E,l,c,f);case 9:return a(E,l,c,f);case 10:return a(E,l,c,f);case 11:return o(E,l,c,f);case 12:return a(E,l,c,f);case 13:return a(E,l,c,f);case 14:return a(E,l,c,f);case 15:return a(E,l,c,f);default:return}},i}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function a(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 a.getPoint=function(t,n,a){return r(a)||(a=new e),a=e.multiplyByScalar(t.direction,n,a),e.add(t.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,r,n,a,o,i,u,s,E,l){"use strict";function c(e,t,r,n){var a=t*t-4*e*r;if(!(a<0)){if(a>0){var o=1/(2*e),i=Math.sqrt(a),u=(-t+i)*o,s=(-t-i)*o;return u<s?(n.root0=u,n.root1=s):(n.root0=s,n.root1=u),n}var E=-t/(2*e);if(0!==E)return n.root0=n.root1=E,n}}function f(t,r,a){n(a)||(a=new o);var i=t.origin,u=t.direction,s=r.center,E=r.radius*r.radius,l=e.subtract(i,s,d),f=e.dot(u,u),_=2*e.dot(u,l),R=e.magnitudeSquared(l)-E,T=c(f,_,R,C);if(n(T))return a.start=T.root0,a.stop=T.root1,a}function _(e,t,r){var n=e+t;return i.sign(e)!==i.sign(t)&&Math.abs(n/Math.max(Math.abs(e),Math.abs(t)))<r?0:n}function R(t,r,n,a,o){var l,c=a*a,f=o*o,R=(t[u.COLUMN1ROW1]-t[u.COLUMN2ROW2])*f,T=o*(a*_(t[u.COLUMN1ROW0],t[u.COLUMN0ROW1],i.EPSILON15)+r.y),h=t[u.COLUMN0ROW0]*c+t[u.COLUMN2ROW2]*f+a*r.x+n,A=f*_(t[u.COLUMN2ROW1],t[u.COLUMN1ROW2],i.EPSILON15),d=o*(a*_(t[u.COLUMN2ROW0],t[u.COLUMN0ROW2])+r.z),S=[];if(0===d&&0===A){if(l=s.computeRealRoots(R,T,h),0===l.length)return S;var m=l[0],N=Math.sqrt(Math.max(1-m*m,0));if(S.push(new e(a,o*m,o*-N)),S.push(new e(a,o*m,o*N)),2===l.length){var C=l[1],I=Math.sqrt(Math.max(1-C*C,0));S.push(new e(a,o*C,o*-I)),S.push(new e(a,o*C,o*I))}return S}var p=d*d,M=A*A,O=R*R,g=d*A,y=O+M,F=2*(T*R+g),L=2*h*R+T*T-M+p,v=2*(h*T-g),U=h*h-p;if(0===y&&0===F&&0===L&&0===v)return S;l=E.computeRealRoots(y,F,L,v,U);var D=l.length;if(0===D)return S;for(var P=0;P<D;++P){var B,w=l[P],x=w*w,G=Math.max(1-x,0),b=Math.sqrt(G);B=i.sign(R)===i.sign(h)?_(R*x+h,T*w,i.EPSILON12):i.sign(h)===i.sign(T*w)?_(R*x,T*w+h,i.EPSILON12):_(R*x+T*w,h,i.EPSILON12);var z=_(A*w,d,i.EPSILON15),H=B*z;H<0?S.push(new e(a,o*w,o*b)):H>0?S.push(new e(a,o*w,o*-b)):0!==b?(S.push(new e(a,o*w,o*-b)),S.push(new e(a,o*w,o*b)),++P):S.push(new e(a,o*w,o*b))}return S}var T={};T.rayPlane=function(t,r,a){n(a)||(a=new e);var o=t.origin,u=t.direction,s=r.normal,E=e.dot(s,u);if(!(Math.abs(E)<i.EPSILON15)){var l=(-r.distance-e.dot(s,o))/E;if(!(l<0))return a=e.multiplyByScalar(u,l,a),e.add(o,a,a)}};var h=new e,A=new e,d=new e,S=new e,m=new e;T.rayTriangleParametric=function(t,n,a,o,u){u=r(u,!1);var s,E,l,c,f,_=t.origin,R=t.direction,T=e.subtract(a,n,h),N=e.subtract(o,n,A),C=e.cross(R,N,d),I=e.dot(T,C);if(u){if(I<i.EPSILON6)return;if(s=e.subtract(_,n,S),l=e.dot(s,C),l<0||l>I)return;if(E=e.cross(s,T,m),c=e.dot(R,E),c<0||l+c>I)return;f=e.dot(N,E)/I}else{if(Math.abs(I)<i.EPSILON6)return;var p=1/I;if(s=e.subtract(_,n,S),l=e.dot(s,C)*p,l<0||l>1)return;if(E=e.cross(s,T,m),c=e.dot(R,E)*p,c<0||l+c>1)return;f=e.dot(N,E)*p}return f},T.rayTriangle=function(t,r,a,o,i,u){var s=T.rayTriangleParametric(t,r,a,o,i);if(n(s)&&!(s<0))return n(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var N=new l;T.lineSegmentTriangle=function(t,r,a,o,i,u,s){var E=N;e.clone(t,E.origin),e.subtract(r,t,E.direction),e.normalize(E.direction,E.direction);var l=T.rayTriangleParametric(E,a,o,i,u);if(!(!n(l)||l<0||l>e.distance(t,r)))return n(s)||(s=new e),e.multiplyByScalar(E.direction,l,s),e.add(E.origin,s,s)};var C={root0:0,root1:0};T.raySphere=function(e,t,r){if(r=f(e,t,r),n(r)&&!(r.stop<0))return r.start=Math.max(r.start,0),r};var I=new l;T.lineSegmentSphere=function(t,r,a,o){var i=I;e.clone(t,i.origin);var u=e.subtract(r,t,i.direction),s=e.magnitude(u);if(e.normalize(u,u),o=f(i,a,o),!(!n(o)||o.stop<0||o.start>s))return o.start=Math.max(o.start,0),o.stop=Math.min(o.stop,s),o};var p=new e,M=new e;T.rayEllipsoid=function(t,r){var n,a,i,u,s,E=r.oneOverRadii,l=e.multiplyComponents(E,t.origin,p),c=e.multiplyComponents(E,t.direction,M),f=e.magnitudeSquared(l),_=e.dot(l,c);if(f>1){if(_>=0)return;var R=_*_;if(n=f-1,a=e.magnitudeSquared(c),i=a*n,R<i)return;if(R>i){u=_*_-i,s=-_+Math.sqrt(u);var T=s/a,h=n/s;return T<h?new o(T,h):{start:h,stop:T}}var A=Math.sqrt(n/a);return new o(A,A)}return f<1?(n=f-1,a=e.magnitudeSquared(c),i=a*n,u=_*_-i,s=-_+Math.sqrt(u),new o(0,s/a)):_<0?(a=e.magnitudeSquared(c),new o(0,-_/a)):void 0};var O=new e,g=new e,y=new e,F=new e,L=new e,v=new u,U=new u,D=new u,P=new u,B=new u,w=new u,x=new u,G=new e,b=new e,z=new t;T.grazingAltitudeLocation=function(t,r){var a=t.origin,o=t.direction;if(!e.equals(a,e.ZERO)){var s=r.geodeticSurfaceNormal(a,O);if(e.dot(o,s)>=0)return a}var E=n(this.rayEllipsoid(t,r)),l=r.transformPositionToScaledSpace(o,O),c=e.normalize(l,l),f=e.mostOrthogonalAxis(l,F),_=e.normalize(e.cross(f,c,g),g),T=e.normalize(e.cross(c,_,y),y),h=v;h[0]=c.x,h[1]=c.y,h[2]=c.z,h[3]=_.x,h[4]=_.y,h[5]=_.z,h[6]=T.x,h[7]=T.y,h[8]=T.z;var A=u.transpose(h,U),d=u.fromScale(r.radii,D),S=u.fromScale(r.oneOverRadii,P),m=B;m[0]=0,m[1]=-o.z,m[2]=o.y,m[3]=o.z,m[4]=0,m[5]=-o.x,m[6]=-o.y,m[7]=o.x,m[8]=0;var N,C,I=u.multiply(u.multiply(A,S,w),m,w),p=u.multiply(u.multiply(I,d,x),h,x),M=u.multiplyByVector(I,a,L),H=R(p,e.negate(M,O),0,0,1),V=H.length;if(V>0){for(var q=e.clone(e.ZERO,b),X=Number.NEGATIVE_INFINITY,W=0;W<V;++W){N=u.multiplyByVector(d,u.multiplyByVector(h,H[W],G),G);var Y=e.normalize(e.subtract(N,a,F),F),K=e.dot(Y,o);K>X&&(X=K,q=e.clone(N,q))}var k=r.cartesianToCartographic(q,z);return X=i.clamp(X,0,1),C=e.magnitude(e.subtract(q,a,F))*Math.sqrt(1-X*X),C=E?-C:C,k.height=C,r.cartographicToCartesian(k,new e)}};var H=new e;return T.lineSegmentPlane=function(t,r,a,o){n(o)||(o=new e);var u=e.subtract(r,t,H),s=a.normal,E=e.dot(s,u);if(!(Math.abs(E)<i.EPSILON6)){var l=e.dot(s,t),c=-(a.distance+l)/E;if(!(c<0||c>1))return e.multiplyByScalar(u,c,o),e.add(t,o,o),o}},T.trianglePlaneIntersection=function(t,r,n,a){var o=a.normal,i=a.distance,u=e.dot(o,t)+i<0,s=e.dot(o,r)+i<0,E=e.dot(o,n)+i<0,l=0;l+=u?1:0,l+=s?1:0,l+=E?1:0;var c,f;if(1!==l&&2!==l||(c=new e,f=new e),1===l){if(u)return T.lineSegmentPlane(t,r,a,c),T.lineSegmentPlane(t,n,a,f),{positions:[t,r,n,c,f],indices:[0,3,4,1,2,4,1,4,3]};if(s)return T.lineSegmentPlane(r,n,a,c),T.lineSegmentPlane(r,t,a,f),{positions:[t,r,n,c,f],indices:[1,3,4,2,0,4,2,4,3]};if(E)return T.lineSegmentPlane(n,t,a,c),T.lineSegmentPlane(n,r,a,f),{positions:[t,r,n,c,f],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return T.lineSegmentPlane(r,t,a,c),T.lineSegmentPlane(n,t,a,f),{positions:[t,r,n,c,f],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return T.lineSegmentPlane(n,r,a,c),T.lineSegmentPlane(t,r,a,f),{positions:[t,r,n,c,f],indices:[2,0,4,2,4,3,1,3,4]};if(!E)return T.lineSegmentPlane(t,n,a,c),T.lineSegmentPlane(r,n,a,f),{positions:[t,r,n,c,f],indices:[0,1,4,0,4,3,2,3,4]}}},T}),define("Core/isArray",["./defined"],function(e){"use strict";var t=Array.isArray;return e(t)||(t=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),t}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,r,n){"use strict";function a(t,r){this.normal=e.clone(t),this.distance=r}a.fromPointNormal=function(r,n,o){var i=-e.dot(n,r);return t(o)?(e.clone(n,o.normal),o.distance=i,o):new a(n,i)};var o=new e;return a.fromCartesian4=function(r,n){var i=e.fromCartesian4(r,o),u=r.w;return t(n)?(e.clone(i,n.normal),n.distance=u,n):new a(i,u)},a.getPointDistance=function(t,r){return e.dot(t.normal,r)+t.distance},a.ORIGIN_XY_PLANE=n(new a(e.UNIT_Z,0)),a.ORIGIN_YZ_PLANE=n(new a(e.UNIT_X,0)),a.ORIGIN_ZX_PLANE=n(new a(e.UNIT_Y,0)),a}),define("Core/PolylinePipeline",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidGeodesic","./IntersectionTests","./isArray","./Math","./Matrix4","./Plane"],function(e,t,r,n,a,o,i,u,s,E,l,c){"use strict";function f(e,t,r){var n=p;n.length=e;var a;if(t===r){for(a=0;a<e;a++)n[a]=t;return n}var o=r-t,i=o/e;for(a=0;a<e;a++){var u=t+a*i;n[a]=u}return n}function _(t,r,n,a,o,i,u,s){var E=a.scaleToGeodeticSurface(t,y),l=a.scaleToGeodeticSurface(r,F),c=R.numberOfPoints(t,r,n),_=a.cartesianToCartographic(E,M),T=a.cartesianToCartographic(l,O),h=f(c,o,i);L.setEndPoints(_,T);var A=L.surfaceDistance/c,d=s;_.height=o;var S=a.cartographicToCartesian(_,g);e.pack(S,u,d),d+=3;for(var m=1;m<c;m++){var N=L.interpolateUsingSurfaceDistance(m*A,O);N.height=h[m],S=a.cartographicToCartesian(N,g),e.pack(S,u,d),d+=3}return d}var R={};R.numberOfPoints=function(t,r,n){var a=e.distance(t,r);return Math.ceil(a/n)};var T=new t;R.extractHeights=function(e,t){for(var r=e.length,n=new Array(r),a=0;a<r;a++){var o=e[a];n[a]=t.cartesianToCartographic(o,T).height}return n};var h=new l,A=new e,d=new e,S=new c(e.ZERO,0),m=new e,N=new c(e.ZERO,0),C=new e,I=new e,p=[],M=new t,O=new t,g=new e,y=new e,F=new e,L=new i;return R.wrapLongitude=function(t,a){var o=[],i=[];if(n(t)&&t.length>0){a=r(a,l.IDENTITY);var s=l.inverseTransformation(a,h),E=l.multiplyByPoint(s,e.ZERO,A),f=l.multiplyByPointAsVector(s,e.UNIT_Y,d),_=c.fromPointNormal(E,f,S),R=l.multiplyByPointAsVector(s,e.UNIT_X,m),T=c.fromPointNormal(E,R,N),p=1;o.push(e.clone(t[0]));for(var M=o[0],O=t.length,g=1;g<O;++g){var y=t[g];if(c.getPointDistance(T,M)<0||c.getPointDistance(T,y)<0){var F=u.lineSegmentPlane(M,y,_,C);if(n(F)){var L=e.multiplyByScalar(f,5e-9,I);c.getPointDistance(_,M)<0&&e.negate(L,L),o.push(e.add(F,L,new e)),i.push(p+1),e.negate(L,L),o.push(e.add(F,L,new e)),p=1}}o.push(e.clone(t[g])),p++,M=y}i.push(p)}return{positions:o,lengths:i}},R.generateArc=function(t){n(t)||(t={});var a=t.positions,i=a.length,u=r(t.ellipsoid,o.WGS84),l=r(t.height,0),c=s(l);if(i<1)return[];if(1===i){var f=u.scaleToGeodeticSurface(a[0],y);if(l=c?l[0]:l,0!==l){var T=u.geodeticSurfaceNormal(f,g);e.multiplyByScalar(T,l,T),e.add(f,T,f)}return[f.x,f.y,f.z]}var h=t.minDistance;if(!n(h)){var A=r(t.granularity,E.RADIANS_PER_DEGREE);h=E.chordLength(A,u.maximumRadius)}var d,S=0;for(d=0;d<i-1;d++)S+=R.numberOfPoints(a[d],a[d+1],h);var m=3*(S+1),N=new Array(m),C=0;for(d=0;d<i-1;d++){var I=a[d],O=a[d+1],F=c?l[d]:l,L=c?l[d+1]:l;C=_(I,O,h,u,F,L,N,C)}p.length=0;var v=a[i-1],U=u.cartesianToCartographic(v,M);U.height=c?l[i-1]:l;var D=u.cartographicToCartesian(U,g);return e.pack(D,N,m-3),N},R.generateCartesianArc=function(t){for(var r=R.generateArc(t),n=r.length/3,a=new Array(n),o=0;o<n;o++)a[o]=e.unpack(r,3*o);return a},R}),define("Core/SimplePolylineGeometry",["./BoundingSphere","./Cartesian3","./Color","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolylinePipeline","./PrimitiveType"],function(e,t,r,n,a,o,i,u,s,E,l,c,f,_,R){"use strict";function T(e,t,n,a,o,i,u){var s,E=_.numberOfPoints(e,t,o),l=n.red,c=n.green,f=n.blue,R=n.alpha,T=a.red,h=a.green,A=a.blue,d=a.alpha;if(r.equals(n,a)){for(s=0;s<E;s++)i[u++]=r.floatToByte(l),i[u++]=r.floatToByte(c),i[u++]=r.floatToByte(f),i[u++]=r.floatToByte(R);return u}var S=(T-l)/E,m=(h-c)/E,N=(A-f)/E,C=(d-R)/E,I=u;for(s=0;s<E;s++)i[I++]=r.floatToByte(l+s*S),i[I++]=r.floatToByte(c+s*m),i[I++]=r.floatToByte(f+s*N),i[I++]=r.floatToByte(R+s*C);return I}function h(e){e=a(e,a.EMPTY_OBJECT);var n=e.positions,i=e.colors,s=a(e.colorsPerVertex,!1);this._positions=n,this._colors=i,this._colorsPerVertex=s,this._followSurface=a(e.followSurface,!0),this._granularity=a(e.granularity,f.RADIANS_PER_DEGREE),this._ellipsoid=a(e.ellipsoid,u.WGS84),this._workerName="createSimplePolylineGeometry";var E=1+n.length*t.packedLength;E+=o(i)?1+i.length*r.packedLength:1,this.packedLength=E+u.packedLength+3}h.pack=function(e,n,i){i=a(i,0);var s,E=e._positions,l=E.length;for(n[i++]=l,s=0;s<l;++s,i+=t.packedLength)t.pack(E[s],n,i);var c=e._colors;for(l=o(c)?c.length:0,n[i++]=l,s=0;s<l;++s,i+=r.packedLength)r.pack(c[s],n,i);return u.pack(e._ellipsoid,n,i),i+=u.packedLength,n[i++]=e._colorsPerVertex?1:0,n[i++]=e._followSurface?1:0,n[i]=e._granularity,n},h.unpack=function(e,n,i){n=a(n,0);var s,E=e[n++],l=new Array(E);for(s=0;s<E;++s,n+=t.packedLength)l[s]=t.unpack(e,n);E=e[n++];var c=E>0?new Array(E):void 0;for(s=0;s<E;++s,n+=r.packedLength)c[s]=r.unpack(e,n);var f=u.unpack(e,n);n+=u.packedLength;var _=1===e[n++],R=1===e[n++],T=e[n];return o(i)?(i._positions=l,i._colors=c,i._ellipsoid=f,i._colorsPerVertex=_,i._followSurface=R,i._granularity=T,i):new h({positions:l,colors:c,ellipsoid:f,colorsPerVertex:_,followSurface:R,granularity:T})};var A=new Array(2),d=new Array(2),S={positions:A,height:d,ellipsoid:void 0,minDistance:void 0};return h.createGeometry=function(a){var i,u,h,m,N,C=a._positions,I=a._colors,p=a._colorsPerVertex,M=a._followSurface,O=a._granularity,g=a._ellipsoid,y=f.chordLength(O,g.maximumRadius),F=o(I)&&!p,L=C.length,v=0;if(M){var U=_.extractHeights(C,g),D=S;if(D.minDistance=y,D.ellipsoid=g,F){var P=0;for(i=0;i<L-1;i++)P+=_.numberOfPoints(C[i],C[i+1],y)+1;u=new Float64Array(3*P),m=new Uint8Array(4*P),D.positions=A,D.height=d;var B=0;for(i=0;i<L-1;++i){A[0]=C[i],A[1]=C[i+1],d[0]=U[i],d[1]=U[i+1];var w=_.generateArc(D);if(o(I)){var x=w.length/3;N=I[i];for(var G=0;G<x;++G)m[B++]=r.floatToByte(N.red),m[B++]=r.floatToByte(N.green),m[B++]=r.floatToByte(N.blue),m[B++]=r.floatToByte(N.alpha)}u.set(w,v),v+=w.length}}else if(D.positions=C,D.height=U,u=new Float64Array(_.generateArc(D)),o(I)){for(m=new Uint8Array(u.length/3*4),i=0;i<L-1;++i){var b=C[i],z=C[i+1],H=I[i],V=I[i+1];v=T(b,z,H,V,y,m,v)}var q=I[L-1];m[v++]=r.floatToByte(q.red),m[v++]=r.floatToByte(q.green),m[v++]=r.floatToByte(q.blue),m[v++]=r.floatToByte(q.alpha)}}else{h=F?2*L-2:L,u=new Float64Array(3*h),m=o(I)?new Uint8Array(4*h):void 0;var X=0,W=0;for(i=0;i<L;++i){var Y=C[i];if(F&&i>0&&(t.pack(Y,u,X),X+=3,N=I[i-1],m[W++]=r.floatToByte(N.red),m[W++]=r.floatToByte(N.green),m[W++]=r.floatToByte(N.blue),m[W++]=r.floatToByte(N.alpha)),F&&i===L-1)break;t.pack(Y,u,X),X+=3,o(I)&&(N=I[i],m[W++]=r.floatToByte(N.red),m[W++]=r.floatToByte(N.green),m[W++]=r.floatToByte(N.blue),m[W++]=r.floatToByte(N.alpha))}}var K=new l;K.position=new E({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:u}),o(I)&&(K.color=new E({componentDatatype:n.UNSIGNED_BYTE,componentsPerAttribute:4,values:m,normalize:!0})),h=u.length/3;var k=2*(h-1),Z=c.createTypedArray(h,k),j=0;for(i=0;i<h-1;++i)Z[j++]=i,Z[j++]=i+1;return new s({attributes:K,indices:Z,primitiveType:R.LINES,boundingSphere:e.fromPoints(C)})},h}),define("Workers/createSimplePolylineGeometry",["../Core/defined","../Core/Ellipsoid","../Core/SimplePolylineGeometry"],function(e,t,r){"use strict";function n(n,a){return e(a)&&(n=r.unpack(n,a)),n._ellipsoid=t.clone(n._ellipsoid),r.createGeometry(n)}return n})}(); \ No newline at end of file diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createSphereGeometry.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createSphereGeometry.js index 1d706823..f76f321a 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createSphereGeometry.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createSphereGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,6 +55,6 @@ mersenne-twister.js - https://gist.github.com/banksean/300494 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -!function(){define("Core/defined",[],function(){"use strict";function t(t){return void 0!==t&&null!==t}return t}),define("Core/freezeObject",["./defined"],function(t){"use strict";var e=Object.freeze;return t(e)||(e=function(t){return t}),e}),define("Core/defaultValue",["./freezeObject"],function(t){"use strict";function e(t,e){return void 0!==t?t:e}return e.EMPTY_OBJECT=t({}),e}),define("Core/DeveloperError",["./defined"],function(t){"use strict";function e(t){this.name="DeveloperError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e.throwInstantiationError=function(){throw new e("This function defines an interface and should not be called directly.")},e}),define("Core/isArray",["./defined"],function(t){"use strict";var e=Array.isArray;return t(e)||(e=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),e}),define("Core/Check",["./defaultValue","./defined","./DeveloperError","./isArray"],function(t,e,n,r){"use strict";function i(t){return t+" was required but undefined."}function a(t,e,n){return"Expected "+n+" to be typeof "+e+", got "+t}var o={};return o.typeOf={},o.numeric={},o.defined=function(t,r){if(!e(t))throw new n(i(r))},o.numeric.maximum=function(t,e){if(o.typeOf.number(t),o.typeOf.number(e),t>e)throw new n("Expected "+t+" to be at most "+e)},o.numeric.minimum=function(t,e){if(o.typeOf.number(t),o.typeOf.number(e),t<e)throw new n("Expected "+t+" to be at least "+e)},o.typeOf.function=function(t,e){if("function"!=typeof t)throw new n(a(typeof t,"function",e))},o.typeOf.string=function(t,e){if("string"!=typeof t)throw new n(a(typeof t,"string",e))},o.typeOf.number=function(t,e){if("number"!=typeof t)throw new n(a(typeof t,"number",e))},o.typeOf.object=function(t,e){if("object"!=typeof t)throw new n(a(typeof t,"object",e))},o.typeOf.boolean=function(t,e){if("boolean"!=typeof t)throw new n(a(typeof t,"boolean",e))},o}),define("ThirdParty/mersenne-twister",[],function(){var t=function(t){void 0==t&&(t=(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(t)};return t.prototype.init_genrand=function(t){for(this.mt[0]=t>>>0,this.mti=1;this.mti<this.N;this.mti++){var t=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&t)>>>16)<<16)+1812433253*(65535&t)+this.mti,this.mt[this.mti]>>>=0}},t.prototype.genrand_int32=function(){var t,e=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)t=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^t>>>1^e[1&t];for(;n<this.N-1;n++)t=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^t>>>1^e[1&t];t=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^t>>>1^e[1&t],this.mti=0}return t=this.mt[this.mti++],t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,t^=t>>>18,t>>>0},t.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},t}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(t,e,n,r){"use strict";var i={};i.EPSILON1=.1,i.EPSILON2=.01,i.EPSILON3=.001,i.EPSILON4=1e-4,i.EPSILON5=1e-5,i.EPSILON6=1e-6,i.EPSILON7=1e-7,i.EPSILON8=1e-8,i.EPSILON9=1e-9,i.EPSILON10=1e-10,i.EPSILON11=1e-11,i.EPSILON12=1e-12,i.EPSILON13=1e-13,i.EPSILON14=1e-14,i.EPSILON15=1e-15,i.EPSILON16=1e-16,i.EPSILON17=1e-17,i.EPSILON18=1e-18,i.EPSILON19=1e-19,i.EPSILON20=1e-20,i.GRAVITATIONALPARAMETER=3986004418e5,i.SOLAR_RADIUS=6955e5,i.LUNAR_RADIUS=1737400,i.SIXTY_FOUR_KILOBYTES=65536,i.sign=function(t){return t>0?1:t<0?-1:0},i.signNotZero=function(t){return t<0?-1:1},i.toSNorm=function(t,n){return n=e(n,255),Math.round((.5*i.clamp(t,-1,1)+.5)*n)},i.fromSNorm=function(t,n){return n=e(n,255),i.clamp(t,0,n)/n*2-1},i.sinh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e-n)},i.cosh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e+n)},i.lerp=function(t,e,n){return(1-n)*t+n*e},i.PI=Math.PI,i.ONE_OVER_PI=1/Math.PI,i.PI_OVER_TWO=.5*Math.PI,i.PI_OVER_THREE=Math.PI/3,i.PI_OVER_FOUR=Math.PI/4,i.PI_OVER_SIX=Math.PI/6,i.THREE_PI_OVER_TWO=3*Math.PI*.5,i.TWO_PI=2*Math.PI,i.ONE_OVER_TWO_PI=1/(2*Math.PI),i.RADIANS_PER_DEGREE=Math.PI/180,i.DEGREES_PER_RADIAN=180/Math.PI,i.RADIANS_PER_ARCSECOND=i.RADIANS_PER_DEGREE/3600,i.toRadians=function(t){return t*i.RADIANS_PER_DEGREE},i.toDegrees=function(t){return t*i.DEGREES_PER_RADIAN},i.convertLongitudeRange=function(t){var e=i.TWO_PI,n=t-Math.floor(t/e)*e;return n<-Math.PI?n+e:n>=Math.PI?n-e:n},i.clampToLatitudeRange=function(t){return i.clamp(t,-1*i.PI_OVER_TWO,i.PI_OVER_TWO)},i.negativePiToPi=function(t){return i.zeroToTwoPi(t+i.PI)-i.PI},i.zeroToTwoPi=function(t){var e=i.mod(t,i.TWO_PI);return Math.abs(e)<i.EPSILON14&&Math.abs(t)>i.EPSILON14?i.TWO_PI:e},i.mod=function(t,e){return(t%e+e)%e},i.equalsEpsilon=function(t,n,r,i){i=e(i,r);var a=Math.abs(t-n);return a<=i||a<=r*Math.max(Math.abs(t),Math.abs(n))};var a=[1];i.factorial=function(t){var e=a.length;if(t>=e)for(var n=a[e-1],r=e;r<=t;r++)a.push(n*r);return a[t]},i.incrementWrap=function(t,n,r){return r=e(r,0),++t,t>n&&(t=r),t},i.isPowerOfTwo=function(t){return 0!==t&&0===(t&t-1)},i.nextPowerOfTwo=function(t){return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t,t},i.clamp=function(t,e,n){return t<e?e:t>n?n:t};var o=new t;return i.setRandomNumberSeed=function(e){o=new t(e)},i.nextRandomNumber=function(){return o.random()},i.acosClamped=function(t){return Math.acos(i.clamp(t,-1,1))},i.asinClamped=function(t){return Math.asin(i.clamp(t,-1,1))},i.chordLength=function(t,e){return 2*e*Math.sin(.5*t)},i.logBase=function(t,e){return Math.log(t)/Math.log(e)},i.fog=function(t,e){var n=t*e;return 1-Math.exp(-(n*n))},i}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a){"use strict";function o(t,n,r){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0)}o.fromSpherical=function(t,r){n(r)||(r=new o);var i=t.clock,a=t.cone,u=e(t.magnitude,1),E=u*Math.sin(a);return r.x=E*Math.cos(i),r.y=E*Math.sin(i),r.z=u*Math.cos(a),r},o.fromElements=function(t,e,r,i){return n(i)?(i.x=t,i.y=e,i.z=r,i):new o(t,e,r)},o.clone=function(t,e){if(n(t))return n(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e):new o(t.x,t.y,t.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r]=t.z,n},o.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new o),i.x=t[r++],i.y=t[r++],i.z=t[r],i},o.packArray=function(t,e){var r=t.length;n(e)?e.length=3*r:e=new Array(3*r);for(var i=0;i<r;++i)o.pack(t[i],e,3*i);return e},o.unpackArray=function(t,e){var r=t.length;n(e)?e.length=r/3:e=new Array(r/3);for(var i=0;i<r;i+=3){var a=i/3;e[a]=o.unpack(t,i,e[a])}return e},o.fromArray=o.unpack,o.maximumComponent=function(t){return Math.max(t.x,t.y,t.z)},o.minimumComponent=function(t){return Math.min(t.x,t.y,t.z)},o.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n.z=Math.min(t.z,e.z),n},o.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n.z=Math.max(t.z,e.z),n},o.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z},o.magnitude=function(t){return Math.sqrt(o.magnitudeSquared(t))};var u=new o;o.distance=function(t,e){return o.subtract(t,e,u),o.magnitude(u)},o.distanceSquared=function(t,e){return o.subtract(t,e,u),o.magnitudeSquared(u)},o.normalize=function(t,e){var n=o.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e},o.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},o.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n.z=t.z*e.z,n},o.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n.z=t.z/e.z,n},o.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n},o.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n},o.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*e,n},o.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n},o.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e},o.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e};var E=new o;o.lerp=function(t,e,n,r){return o.multiplyByScalar(e,n,E),r=o.multiplyByScalar(t,1-n,r),o.add(E,r,r)};var s=new o,c=new o;o.angleBetween=function(t,e){o.normalize(t,s),o.normalize(e,c);var n=o.dot(s,c),r=o.magnitude(o.cross(s,c,s));return Math.atan2(r,n)};var _=new o;o.mostOrthogonalAxis=function(t,e){var n=o.normalize(t,_);return o.abs(n,n),e=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,e):o.clone(o.UNIT_Z,e):n.y<=n.z?o.clone(o.UNIT_Y,e):o.clone(o.UNIT_Z,e)},o.equals=function(t,e){return t===e||n(t)&&n(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z},o.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]},o.equalsEpsilon=function(t,e,r,i){return t===e||n(t)&&n(e)&&a.equalsEpsilon(t.x,e.x,r,i)&&a.equalsEpsilon(t.y,e.y,r,i)&&a.equalsEpsilon(t.z,e.z,r,i)},o.cross=function(t,e,n){var r=t.x,i=t.y,a=t.z,o=e.x,u=e.y,E=e.z,s=i*E-a*u,c=a*o-r*E,_=r*u-i*o;return n.x=s,n.y=c,n.z=_,n},o.fromDegrees=function(t,e,n,r,i){return t=a.toRadians(t),e=a.toRadians(e),o.fromRadians(t,e,n,r,i)};var l=new o,T=new o,R=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(t,r,i,a,u){i=e(i,0);var E=n(a)?a.radiiSquared:R,s=Math.cos(r);l.x=s*Math.cos(t),l.y=s*Math.sin(t),l.z=Math.sin(r),l=o.normalize(l,l),o.multiplyComponents(E,l,T);var c=Math.sqrt(o.dot(l,T));return T=o.divideByScalar(T,c,T),l=o.multiplyByScalar(l,i,l),n(u)||(u=new o),o.add(T,l,u)},o.fromDegreesArray=function(t,e,r){var i=t.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=t[a],E=t[a+1],s=a/2;r[s]=o.fromDegrees(u,E,0,e,r[s])}return r},o.fromRadiansArray=function(t,e,r){var i=t.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=t[a],E=t[a+1],s=a/2;r[s]=o.fromRadians(u,E,0,e,r[s])}return r},o.fromDegreesArrayHeights=function(t,e,r){var i=t.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=t[a],E=t[a+1],s=t[a+2],c=a/3;r[c]=o.fromDegrees(u,E,s,e,r[c])}return r},o.fromRadiansArrayHeights=function(t,e,r){var i=t.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=t[a],E=t[a+1],s=t[a+2],c=a/3;r[c]=o.fromRadians(u,E,s,e,r[c])}return r},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(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.prototype.equalsEpsilon=function(t,e,n){return o.equalsEpsilon(this,t,e,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(t,e,n,r){"use strict";function i(n,i,u,E,s){var c=n.x,_=n.y,l=n.z,T=i.x,R=i.y,f=i.z,A=c*c*T*T,h=_*_*R*R,N=l*l*f*f,d=A+h+N,I=Math.sqrt(1/d),S=t.multiplyByScalar(n,I,a);if(d<E)return isFinite(I)?t.clone(S,s):void 0;var m=u.x,M=u.y,y=u.z,O=o;O.x=S.x*m*2,O.y=S.y*M*2,O.z=S.z*y*2;var p,C,U,L,F,P,v,w,x,g,D,B=(1-I)*t.magnitude(n)/(.5*t.magnitude(O)),z=0;do{B-=z,U=1/(1+B*m),L=1/(1+B*M),F=1/(1+B*y),P=U*U,v=L*L,w=F*F,x=P*U,g=v*L,D=w*F,p=A*P+h*v+N*w-1,C=A*x*m+h*g*M+N*D*y;var G=-2*C;z=p/G}while(Math.abs(p)>r.EPSILON12);return e(s)?(s.x=c*U,s.y=_*L,s.z=l*F,s):new t(c*U,_*L,l*F)}var a=new t,o=new t;return i}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,n,r,i,a,o){"use strict";function u(t,n,r){this.longitude=e(t,0),this.latitude=e(n,0),this.height=e(r,0)}u.fromRadians=function(t,r,i,a){return i=e(i,0),n(a)?(a.longitude=t,a.latitude=r,a.height=i,a):new u(t,r,i)},u.fromDegrees=function(t,e,n,r){return t=a.toRadians(t),e=a.toRadians(e),u.fromRadians(t,e,n,r)};var E=new t,s=new t,c=new t,_=new t(1/6378137,1/6378137,1/6356752.314245179),l=new t(1/40680631590769,1/40680631590769,1/40408299984661.445),T=a.EPSILON1;return u.fromCartesian=function(e,r,i){var R=n(r)?r.oneOverRadii:_,f=n(r)?r.oneOverRadiiSquared:l,A=n(r)?r._centerToleranceSquared:T,h=o(e,R,f,A,s);if(n(h)){var N=t.multiplyComponents(h,f,E);N=t.normalize(N,N);var d=t.subtract(e,h,c),I=Math.atan2(N.y,N.x),S=Math.asin(N.z),m=a.sign(t.dot(d,e))*t.magnitude(d);return n(i)?(i.longitude=I,i.latitude=S,i.height=m,i):new u(I,S,m)}},u.clone=function(t,e){if(n(t))return n(e)?(e.longitude=t.longitude,e.latitude=t.latitude,e.height=t.height,e):new u(t.longitude,t.latitude,t.height)},u.equals=function(t,e){return t===e||n(t)&&n(e)&&t.longitude===e.longitude&&t.latitude===e.latitude&&t.height===e.height},u.equalsEpsilon=function(t,e,r){return t===e||n(t)&&n(e)&&Math.abs(t.longitude-e.longitude)<=r&&Math.abs(t.latitude-e.latitude)<=r&&Math.abs(t.height-e.height)<=r},u.ZERO=i(new u(0,0,0)),u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.prototype.equalsEpsilon=function(t,e){return u.equalsEpsilon(this,t,e)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(t){"use strict";var e=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(t){return!1}}(),n=Object.defineProperties;return e&&t(n)||(n=function(t){return t}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,n,r,i,a,o,u,E){"use strict";function s(e,r,i,a){r=n(r,0),i=n(i,0),a=n(a,0),e._radii=new t(r,i,a),e._radiiSquared=new t(r*r,i*i,a*a),e._radiiToTheFourth=new t(r*r*r*r,i*i*i*i,a*a*a*a),e._oneOverRadii=new t(0===r?0:1/r,0===i?0:1/i,0===a?0:1/a),e._oneOverRadiiSquared=new t(0===r?0:1/(r*r),0===i?0:1/(i*i),0===a?0:1/(a*a)),e._minimumRadius=Math.min(r,i,a),e._maximumRadius=Math.max(r,i,a),e._centerToleranceSquared=u.EPSILON1,0!==e._radiiSquared.z&&(e._sqauredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function c(t,e,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,s(this,t,e,n)}i(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(e,n){if(r(e)){var i=e._radii;return r(n)?(t.clone(i,n._radii),t.clone(e._radiiSquared,n._radiiSquared),t.clone(e._radiiToTheFourth,n._radiiToTheFourth),t.clone(e._oneOverRadii,n._oneOverRadii),t.clone(e._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=e._minimumRadius,n._maximumRadius=e._maximumRadius,n._centerToleranceSquared=e._centerToleranceSquared,n):new c(i.x,i.y,i.z)}},c.fromCartesian3=function(t,e){return r(e)||(e=new c),r(t)?(s(e,t.x,t.y,t.z),e):e},c.WGS84=o(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=o(new c(1,1,1)),c.MOON=o(new c(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),c.prototype.clone=function(t){return c.clone(this,t)},c.packedLength=t.packedLength,c.pack=function(e,r,i){return i=n(i,0),t.pack(e._radii,r,i),r},c.unpack=function(e,r,i){r=n(r,0);var a=t.unpack(e,r);return c.fromCartesian3(a,i)},c.prototype.geocentricSurfaceNormal=t.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(e,n){var i=e.longitude,a=e.latitude,o=Math.cos(a),u=o*Math.cos(i),E=o*Math.sin(i),s=Math.sin(a);return r(n)||(n=new t),n.x=u,n.y=E,n.z=s,t.normalize(n,n)},c.prototype.geodeticSurfaceNormal=function(e,n){return r(n)||(n=new t),n=t.multiplyComponents(e,this._oneOverRadiiSquared,n),t.normalize(n,n)};var _=new t,l=new t;c.prototype.cartographicToCartesian=function(e,n){var i=_,a=l;this.geodeticSurfaceNormalCartographic(e,i),t.multiplyComponents(this._radiiSquared,i,a);var o=Math.sqrt(t.dot(i,a));return t.divideByScalar(a,o,a),t.multiplyByScalar(i,e.height,i),r(n)||(n=new t),t.add(a,i,n)},c.prototype.cartographicArrayToCartesianArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var i=0;i<n;i++)e[i]=this.cartographicToCartesian(t[i],e[i]);return e};var T=new t,R=new t,f=new t;return c.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,R);if(r(a)){var o=this.geodeticSurfaceNormal(a,T),E=t.subtract(n,a,f),s=Math.atan2(o.y,o.x),c=Math.asin(o.z),_=u.sign(t.dot(E,n))*t.magnitude(E);return r(i)?(i.longitude=s,i.latitude=c,i.height=_,i):new e(s,c,_)}},c.prototype.cartesianArrayToCartographicArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var i=0;i<n;++i)e[i]=this.cartesianToCartographic(t[i],e[i]);return e},c.prototype.scaleToGeodeticSurface=function(t,e){return E(t,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,e)},c.prototype.scaleToGeocentricSurface=function(e,n){r(n)||(n=new t);var i=e.x,a=e.y,o=e.z,u=this._oneOverRadiiSquared,E=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*u.z);return t.multiplyByScalar(e,E,n)},c.prototype.transformPositionToScaledSpace=function(e,n){return r(n)||(n=new t),t.multiplyComponents(e,this._oneOverRadii,n)},c.prototype.transformPositionFromScaledSpace=function(e,n){return r(n)||(n=new t),t.multiplyComponents(e,this._radii,n)},c.prototype.equals=function(e){return this===e||r(e)&&t.equals(this._radii,e._radii)},c.prototype.toString=function(){return this._radii.toString()},c.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,i,a){i=n(i,0);var o=this._sqauredXOverSquaredZ;if(r(a)||(a=new t),a.x=0,a.y=0,a.z=e.z*(1-o),!(Math.abs(a.z)>=this._radii.z-i))return a},c}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(t,e,n,r,i,a,o){"use strict";function u(t){this._ellipsoid=n(t,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return i(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(e,n){var i=this._semimajorAxis,a=e.longitude*i,o=e.latitude*i,u=e.height;return r(n)?(n.x=a,n.y=o,n.z=u,n):new t(a,o,u)},u.prototype.unproject=function(t,n){var i=this._oneOverSemimajorAxis,a=t.x*i,o=t.y*i,u=t.z;return r(n)?(n.longitude=a,n.latitude=o,n.height=u,n):new e(a,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(t){"use strict";var e={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return t(e)}),define("Core/Interval",["./defaultValue"],function(t){"use strict";function e(e,n){this.start=t(e,0),this.stop=t(n,0)}return e}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a,o){"use strict";function u(t,n,r,i,a,o,u,E,s){this[0]=e(t,0),this[1]=e(i,0),this[2]=e(u,0),this[3]=e(n,0),this[4]=e(a,0),this[5]=e(E,0),this[6]=e(r,0),this[7]=e(o,0),this[8]=e(s,0)}function E(t){for(var e=0,n=0;n<9;++n){var r=t[n];e+=r*r}return Math.sqrt(e)}function s(t){for(var e=0,n=0;n<3;++n){var r=t[u.getElementIndex(R[n],T[n])];e+=2*r*r}return Math.sqrt(e)}function c(t,e){for(var n=o.EPSILON15,r=0,i=1,a=0;a<3;++a){var E=Math.abs(t[u.getElementIndex(R[a],T[a])]);E>r&&(i=a,r=E)}var s=1,c=0,_=T[i],l=R[i];if(Math.abs(t[u.getElementIndex(l,_)])>n){var f,A=t[u.getElementIndex(l,l)],h=t[u.getElementIndex(_,_)],N=t[u.getElementIndex(l,_)],d=(A-h)/2/N;f=d<0?-1/(-d+Math.sqrt(1+d*d)):1/(d+Math.sqrt(1+d*d)),s=1/Math.sqrt(1+f*f),c=f*s}return e=u.clone(u.IDENTITY,e),e[u.getElementIndex(_,_)]=e[u.getElementIndex(l,l)]=s,e[u.getElementIndex(l,_)]=c,e[u.getElementIndex(_,l)]=-c,e}u.packedLength=9,u.pack=function(t,n,r){return r=e(r,0),n[r++]=t[0],n[r++]=t[1],n[r++]=t[2],n[r++]=t[3],n[r++]=t[4],n[r++]=t[5],n[r++]=t[6],n[r++]=t[7],n[r++]=t[8],n},u.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new u),i[0]=t[r++],i[1]=t[r++],i[2]=t[r++],i[3]=t[r++],i[4]=t[r++],i[5]=t[r++],i[6]=t[r++],i[7]=t[r++],i[8]=t[r++],i},u.clone=function(t,e){if(n(t))return n(e)?(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):new u(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8])},u.fromArray=function(t,r,i){return r=e(r,0),n(i)||(i=new u),i[0]=t[r],i[1]=t[r+1],i[2]=t[r+2],i[3]=t[r+3],i[4]=t[r+4],i[5]=t[r+5],i[6]=t[r+6],i[7]=t[r+7],i[8]=t[r+8],i},u.fromColumnMajorArray=function(t,e){return u.clone(t,e)},u.fromRowMajorArray=function(t,e){return n(e)?(e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],e):new u(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},u.fromQuaternion=function(t,e){var r=t.x*t.x,i=t.x*t.y,a=t.x*t.z,o=t.x*t.w,E=t.y*t.y,s=t.y*t.z,c=t.y*t.w,_=t.z*t.z,l=t.z*t.w,T=t.w*t.w,R=r-E-_+T,f=2*(i-l),A=2*(a+c),h=2*(i+l),N=-r+E-_+T,d=2*(s-o),I=2*(a-c),S=2*(s+o),m=-r-E+_+T;return n(e)?(e[0]=R,e[1]=h,e[2]=I,e[3]=f,e[4]=N,e[5]=S,e[6]=A,e[7]=d,e[8]=m,e):new u(R,f,A,h,N,d,I,S,m)},u.fromHeadingPitchRoll=function(t,e){var r=Math.cos(-t.pitch),i=Math.cos(-t.heading),a=Math.cos(t.roll),o=Math.sin(-t.pitch),E=Math.sin(-t.heading),s=Math.sin(t.roll),c=r*i,_=-a*E+s*o*i,l=s*E+a*o*i,T=r*E,R=a*i+s*o*E,f=-o*a+a*o*E,A=-o,h=s*r,N=a*r;return n(e)?(e[0]=c,e[1]=T,e[2]=A,e[3]=_,e[4]=R,e[5]=h,e[6]=l,e[7]=f,e[8]=N,e):new u(c,_,l,T,R,f,A,h,N)},u.fromScale=function(t,e){return n(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=t.y,e[5]=0,e[6]=0,e[7]=0,e[8]=t.z,e):new u(t.x,0,0,0,t.y,0,0,0,t.z)},u.fromUniformScale=function(t,e){return n(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=t,e[5]=0,e[6]=0,e[7]=0,e[8]=t,e):new u(t,0,0,0,t,0,0,0,t)},u.fromCrossProduct=function(t,e){return n(e)?(e[0]=0,e[1]=t.z,e[2]=-t.y,e[3]=-t.z,e[4]=0,e[5]=t.x,e[6]=t.y,e[7]=-t.x,e[8]=0,e):new u(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},u.fromRotationX=function(t,e){var r=Math.cos(t),i=Math.sin(t);return n(e)?(e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=r,e[5]=i,e[6]=0,e[7]=-i,e[8]=r,e):new u(1,0,0,0,r,-i,0,i,r)},u.fromRotationY=function(t,e){var r=Math.cos(t),i=Math.sin(t);return n(e)?(e[0]=r,e[1]=0,e[2]=-i,e[3]=0,e[4]=1,e[5]=0,e[6]=i,e[7]=0,e[8]=r,e):new u(r,0,i,0,1,0,-i,0,r)},u.fromRotationZ=function(t,e){var r=Math.cos(t),i=Math.sin(t);return n(e)?(e[0]=r,e[1]=i,e[2]=0,e[3]=-i,e[4]=r,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e):new u(r,-i,0,i,r,0,0,0,1)},u.toArray=function(t,e){return n(e)?(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):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},u.getElementIndex=function(t,e){return 3*t+e},u.getColumn=function(t,e,n){var r=3*e,i=t[r],a=t[r+1],o=t[r+2];return n.x=i,n.y=a,n.z=o,n},u.setColumn=function(t,e,n,r){r=u.clone(t,r);var i=3*e;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},u.getRow=function(t,e,n){var r=t[e],i=t[e+3],a=t[e+6];return n.x=r,n.y=i,n.z=a,n},u.setRow=function(t,e,n,r){return r=u.clone(t,r),r[e]=n.x,r[e+3]=n.y,r[e+6]=n.z,r};var _=new t;u.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],_)),n.y=t.magnitude(t.fromElements(e[3],e[4],e[5],_)),n.z=t.magnitude(t.fromElements(e[6],e[7],e[8],_)),n};var l=new t;u.getMaximumScale=function(e){return u.getScale(e,l),t.maximumComponent(l)},u.multiply=function(t,e,n){var r=t[0]*e[0]+t[3]*e[1]+t[6]*e[2],i=t[1]*e[0]+t[4]*e[1]+t[7]*e[2],a=t[2]*e[0]+t[5]*e[1]+t[8]*e[2],o=t[0]*e[3]+t[3]*e[4]+t[6]*e[5],u=t[1]*e[3]+t[4]*e[4]+t[7]*e[5],E=t[2]*e[3]+t[5]*e[4]+t[8]*e[5],s=t[0]*e[6]+t[3]*e[7]+t[6]*e[8],c=t[1]*e[6]+t[4]*e[7]+t[7]*e[8],_=t[2]*e[6]+t[5]*e[7]+t[8]*e[8];return n[0]=r,n[1]=i,n[2]=a,n[3]=o,n[4]=u,n[5]=E,n[6]=s,n[7]=c,n[8]=_,n},u.add=function(t,e,n){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n[4]=t[4]+e[4],n[5]=t[5]+e[5],n[6]=t[6]+e[6],n[7]=t[7]+e[7],n[8]=t[8]+e[8],n},u.subtract=function(t,e,n){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n[4]=t[4]-e[4],n[5]=t[5]-e[5],n[6]=t[6]-e[6],n[7]=t[7]-e[7],n[8]=t[8]-e[8],n},u.multiplyByVector=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=t[0]*r+t[3]*i+t[6]*a,u=t[1]*r+t[4]*i+t[7]*a,E=t[2]*r+t[5]*i+t[8]*a;return n.x=o,n.y=u,n.z=E,n},u.multiplyByScalar=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n[4]=t[4]*e,n[5]=t[5]*e,n[6]=t[6]*e,n[7]=t[7]*e,n[8]=t[8]*e,n},u.multiplyByScale=function(t,e,n){return n[0]=t[0]*e.x,n[1]=t[1]*e.x,n[2]=t[2]*e.x,n[3]=t[3]*e.y,n[4]=t[4]*e.y,n[5]=t[5]*e.y,n[6]=t[6]*e.z,n[7]=t[7]*e.z,n[8]=t[8]*e.z,n},u.negate=function(t,e){return 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},u.transpose=function(t,e){var n=t[0],r=t[3],i=t[6],a=t[1],o=t[4],u=t[7],E=t[2],s=t[5],c=t[8];return e[0]=n,e[1]=r,e[2]=i,e[3]=a,e[4]=o,e[5]=u,e[6]=E,e[7]=s,e[8]=c,e};var T=[1,0,0],R=[2,2,1],f=new u,A=new u;return u.computeEigenDecomposition=function(t,e){var r=o.EPSILON20,i=10,a=0,_=0;n(e)||(e={});for(var l=e.unitary=u.clone(u.IDENTITY,e.unitary),T=e.diagonal=u.clone(t,e.diagonal),R=r*E(T);_<i&&s(T)>R;)c(T,f),u.transpose(f,A),u.multiply(T,f,T),u.multiply(A,T,T),u.multiply(l,f,l),++a>2&&(++_,a=0);return e},u.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e},u.determinant=function(t){var e=t[0],n=t[3],r=t[6],i=t[1],a=t[4],o=t[7],u=t[2],E=t[5],s=t[8];return e*(a*s-E*o)+i*(E*r-n*s)+u*(n*o-a*r)},u.inverse=function(t,e){var n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],E=t[5],s=t[6],c=t[7],_=t[8],l=u.determinant(t);e[0]=o*_-c*E,e[1]=c*i-r*_,e[2]=r*E-o*i,e[3]=s*E-a*_,e[4]=n*_-s*i,e[5]=a*i-n*E,e[6]=a*c-s*o,e[7]=s*r-n*c,e[8]=n*o-a*r;var T=1/l;return u.multiplyByScalar(e,T,e)},u.equals=function(t,e){return t===e||n(t)&&n(e)&&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]},u.equalsEpsilon=function(t,e,r){return t===e||n(t)&&n(e)&&Math.abs(t[0]-e[0])<=r&&Math.abs(t[1]-e[1])<=r&&Math.abs(t[2]-e[2])<=r&&Math.abs(t[3]-e[3])<=r&&Math.abs(t[4]-e[4])<=r&&Math.abs(t[5]-e[5])<=r&&Math.abs(t[6]-e[6])<=r&&Math.abs(t[7]-e[7])<=r&&Math.abs(t[8]-e[8])<=r},u.IDENTITY=a(new u(1,0,0,0,1,0,0,0,1)),u.ZERO=a(new u(0,0,0,0,0,0,0,0,0)),u.COLUMN0ROW0=0,u.COLUMN0ROW1=1,u.COLUMN0ROW2=2,u.COLUMN1ROW0=3,u.COLUMN1ROW1=4,u.COLUMN1ROW2=5,u.COLUMN2ROW0=6,u.COLUMN2ROW1=7,u.COLUMN2ROW2=8,r(u.prototype,{length:{get:function(){return u.packedLength}}}),u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]&&t[4]===e[n+4]&&t[5]===e[n+5]&&t[6]===e[n+6]&&t[7]===e[n+7]&&t[8]===e[n+8]},u.prototype.equalsEpsilon=function(t,e){return u.equalsEpsilon(this,t,e)},u.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},u}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i){"use strict";function a(e,n,r,i){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(i,0)}a.fromElements=function(t,n,r,i,o){return e(o)?(o.x=t,o.y=n,o.z=r,o.w=i,o):new a(t,n,r,i)},a.fromColor=function(t,n){return e(n)?(n.x=t.red,n.y=t.green,n.z=t.blue,n.w=t.alpha,n):new a(t.red,t.green,t.blue,t.alpha)},a.clone=function(t,n){if(e(t))return e(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n.w=t.w,n):new a(t.x,t.y,t.z,t.w)},a.packedLength=4,a.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},a.unpack=function(n,r,i){return r=t(r,0),e(i)||(i=new a),i.x=n[r++],i.y=n[r++],i.z=n[r++],i.w=n[r],i},a.packArray=function(t,n){var r=t.length;e(n)?n.length=4*r:n=new Array(4*r);for(var i=0;i<r;++i)a.pack(t[i],n,4*i);return n},a.unpackArray=function(t,n){var r=t.length;e(n)?n.length=r/4:n=new Array(r/4);for(var i=0;i<r;i+=4){var o=i/4;n[o]=a.unpack(t,i,n[o])}return n},a.fromArray=a.unpack,a.maximumComponent=function(t){return Math.max(t.x,t.y,t.z,t.w)},a.minimumComponent=function(t){return Math.min(t.x,t.y,t.z,t.w)},a.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n.z=Math.min(t.z,e.z),n.w=Math.min(t.w,e.w),n},a.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n.z=Math.max(t.z,e.z),n.w=Math.max(t.w,e.w),n},a.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w},a.magnitude=function(t){return Math.sqrt(a.magnitudeSquared(t))};var o=new a;a.distance=function(t,e){return a.subtract(t,e,o),a.magnitude(o)},a.distanceSquared=function(t,e){return a.subtract(t,e,o),a.magnitudeSquared(o)},a.normalize=function(t,e){var n=a.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e.w=t.w/n,e},a.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z+t.w*e.w},a.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n.z=t.z*e.z,n.w=t.w*e.w,n},a.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n.z=t.z/e.z,n.w=t.w/e.w,n},a.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n.w=t.w+e.w,n},a.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n.w=t.w-e.w,n},a.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*e,n.w=t.w*e,n},a.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n.w=t.w/e,n},a.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e.w=-t.w,e},a.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e.w=Math.abs(t.w),e};var u=new a;a.lerp=function(t,e,n,r){return a.multiplyByScalar(e,n,u),r=a.multiplyByScalar(t,1-n,r),a.add(u,r,r)};var E=new a;return a.mostOrthogonalAxis=function(t,e){var n=a.normalize(t,E);return a.abs(n,n),e=n.x<=n.y?n.x<=n.z?n.x<=n.w?a.clone(a.UNIT_X,e):a.clone(a.UNIT_W,e):n.z<=n.w?a.clone(a.UNIT_Z,e):a.clone(a.UNIT_W,e):n.y<=n.z?n.y<=n.w?a.clone(a.UNIT_Y,e):a.clone(a.UNIT_W,e):n.z<=n.w?a.clone(a.UNIT_Z,e):a.clone(a.UNIT_W,e)},a.equals=function(t,n){return t===n||e(t)&&e(n)&&t.x===n.x&&t.y===n.y&&t.z===n.z&&t.w===n.w},a.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]&&t.w===e[n+3]},a.equalsEpsilon=function(t,n,r,a){return t===n||e(t)&&e(n)&&i.equalsEpsilon(t.x,n.x,r,a)&&i.equalsEpsilon(t.y,n.y,r,a)&&i.equalsEpsilon(t.z,n.z,r,a)&&i.equalsEpsilon(t.w,n.w,r,a)},a.ZERO=r(new a(0,0,0,0)),a.UNIT_X=r(new a(1,0,0,0)),a.UNIT_Y=r(new a(0,1,0,0)),a.UNIT_Z=r(new a(0,0,1,0)),a.UNIT_W=r(new a(0,0,0,1)),a.prototype.clone=function(t){return a.clone(this,t)},a.prototype.equals=function(t){return a.equals(this,t)},a.prototype.equalsEpsilon=function(t,e,n){return a.equalsEpsilon(this,t,e,n)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},a}),define("Core/RuntimeError",["./defined"],function(t){"use strict";function e(t){this.name="RuntimeError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(t,e,n,r,i,a,o,u,E,s){"use strict";function c(t,e,r,i,a,o,u,E,s,c,_,l,T,R,f,A){this[0]=n(t,0),this[1]=n(a,0),this[2]=n(s,0),this[3]=n(T,0),this[4]=n(e,0), -this[5]=n(o,0),this[6]=n(c,0),this[7]=n(R,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(_,0),this[11]=n(f,0),this[12]=n(i,0),this[13]=n(E,0),this[14]=n(l,0),this[15]=n(A,0)}c.packedLength=16,c.pack=function(t,e,r){return r=n(r,0),e[r++]=t[0],e[r++]=t[1],e[r++]=t[2],e[r++]=t[3],e[r++]=t[4],e[r++]=t[5],e[r++]=t[6],e[r++]=t[7],e[r++]=t[8],e[r++]=t[9],e[r++]=t[10],e[r++]=t[11],e[r++]=t[12],e[r++]=t[13],e[r++]=t[14],e[r]=t[15],e},c.unpack=function(t,e,i){return e=n(e,0),r(i)||(i=new c),i[0]=t[e++],i[1]=t[e++],i[2]=t[e++],i[3]=t[e++],i[4]=t[e++],i[5]=t[e++],i[6]=t[e++],i[7]=t[e++],i[8]=t[e++],i[9]=t[e++],i[10]=t[e++],i[11]=t[e++],i[12]=t[e++],i[13]=t[e++],i[14]=t[e++],i[15]=t[e],i},c.clone=function(t,e){if(r(t))return r(e)?(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],e):new c(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15])},c.fromArray=c.unpack,c.fromColumnMajorArray=function(t,e){return c.clone(t,e)},c.fromRowMajorArray=function(t,e){return r(e)?(e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15],e):new c(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},c.fromRotationTranslation=function(e,i,a){return i=n(i,t.ZERO),r(a)?(a[0]=e[0],a[1]=e[1],a[2]=e[2],a[3]=0,a[4]=e[3],a[5]=e[4],a[6]=e[5],a[7]=0,a[8]=e[6],a[9]=e[7],a[10]=e[8],a[11]=0,a[12]=i.x,a[13]=i.y,a[14]=i.z,a[15]=1,a):new c(e[0],e[3],e[6],i.x,e[1],e[4],e[7],i.y,e[2],e[5],e[8],i.z,0,0,0,1)},c.fromTranslationQuaternionRotationScale=function(t,e,n,i){r(i)||(i=new c);var a=n.x,o=n.y,u=n.z,E=e.x*e.x,s=e.x*e.y,_=e.x*e.z,l=e.x*e.w,T=e.y*e.y,R=e.y*e.z,f=e.y*e.w,A=e.z*e.z,h=e.z*e.w,N=e.w*e.w,d=E-T-A+N,I=2*(s-h),S=2*(_+f),m=2*(s+h),M=-E+T-A+N,y=2*(R-l),O=2*(_-f),p=2*(R+l),C=-E-T+A+N;return i[0]=d*a,i[1]=m*a,i[2]=O*a,i[3]=0,i[4]=I*o,i[5]=M*o,i[6]=p*o,i[7]=0,i[8]=S*u,i[9]=y*u,i[10]=C*u,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,i},c.fromTranslationRotationScale=function(t,e){return c.fromTranslationQuaternionRotationScale(t.translation,t.rotation,t.scale,e)},c.fromTranslation=function(t,e){return c.fromRotationTranslation(E.IDENTITY,t,e)},c.fromScale=function(t,e){return r(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t.y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t.z,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new c(t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1)},c.fromUniformScale=function(t,e){return r(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new c(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1)};var _=new t,l=new t,T=new t;c.fromCamera=function(e,n){var i=e.position,a=e.direction,o=e.up;t.normalize(a,_),t.normalize(t.cross(_,o,l),l),t.normalize(t.cross(l,_,T),T);var u=l.x,E=l.y,s=l.z,R=_.x,f=_.y,A=_.z,h=T.x,N=T.y,d=T.z,I=i.x,S=i.y,m=i.z,M=u*-I+E*-S+s*-m,y=h*-I+N*-S+d*-m,O=R*I+f*S+A*m;return r(n)?(n[0]=u,n[1]=h,n[2]=-R,n[3]=0,n[4]=E,n[5]=N,n[6]=-f,n[7]=0,n[8]=s,n[9]=d,n[10]=-A,n[11]=0,n[12]=M,n[13]=y,n[14]=O,n[15]=1,n):new c(u,E,s,M,h,N,d,y,-R,-f,-A,O,0,0,0,1)},c.computePerspectiveFieldOfView=function(t,e,n,r,i){var a=Math.tan(.5*t),o=1/a,u=o/e,E=(r+n)/(n-r),s=2*r*n/(n-r);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=o,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=E,i[11]=-1,i[12]=0,i[13]=0,i[14]=s,i[15]=0,i},c.computeOrthographicOffCenter=function(t,e,n,r,i,a,o){var u=1/(e-t),E=1/(r-n),s=1/(a-i),c=-(e+t)*u,_=-(r+n)*E,l=-(a+i)*s;return u*=2,E*=2,s*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=s,o[11]=0,o[12]=c,o[13]=_,o[14]=l,o[15]=1,o},c.computePerspectiveOffCenter=function(t,e,n,r,i,a,o){var u=2*i/(e-t),E=2*i/(r-n),s=(e+t)/(e-t),c=(r+n)/(r-n),_=-(a+i)/(a-i),l=-1,T=-2*a*i/(a-i);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=s,o[9]=c,o[10]=_,o[11]=l,o[12]=0,o[13]=0,o[14]=T,o[15]=0,o},c.computeInfinitePerspectiveOffCenter=function(t,e,n,r,i,a){var o=2*i/(e-t),u=2*i/(r-n),E=(e+t)/(e-t),s=(r+n)/(r-n),c=-1,_=-1,l=-2*i;return a[0]=o,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=E,a[9]=s,a[10]=c,a[11]=_,a[12]=0,a[13]=0,a[14]=l,a[15]=0,a},c.computeViewportTransformation=function(t,e,r,i){t=n(t,n.EMPTY_OBJECT);var a=n(t.x,0),o=n(t.y,0),u=n(t.width,0),E=n(t.height,0);e=n(e,0),r=n(r,1);var s=.5*u,c=.5*E,_=.5*(r-e),l=s,T=c,R=_,f=a+s,A=o+c,h=e+_,N=1;return i[0]=l,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=T,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=R,i[11]=0,i[12]=f,i[13]=A,i[14]=h,i[15]=N,i},c.computeView=function(e,n,r,i,a){return a[0]=i.x,a[1]=r.x,a[2]=-n.x,a[3]=0,a[4]=i.y,a[5]=r.y,a[6]=-n.y,a[7]=0,a[8]=i.z,a[9]=r.z,a[10]=-n.z,a[11]=0,a[12]=-t.dot(i,e),a[13]=-t.dot(r,e),a[14]=t.dot(n,e),a[15]=1,a},c.toArray=function(t,e){return r(e)?(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],e):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]},c.getElementIndex=function(t,e){return 4*t+e},c.getColumn=function(t,e,n){var r=4*e,i=t[r],a=t[r+1],o=t[r+2],u=t[r+3];return n.x=i,n.y=a,n.z=o,n.w=u,n},c.setColumn=function(t,e,n,r){r=c.clone(t,r);var i=4*e;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r[i+3]=n.w,r},c.setTranslation=function(t,e,n){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=t[15],n},c.getRow=function(t,e,n){var r=t[e],i=t[e+4],a=t[e+8],o=t[e+12];return n.x=r,n.y=i,n.z=a,n.w=o,n},c.setRow=function(t,e,n,r){return r=c.clone(t,r),r[e]=n.x,r[e+4]=n.y,r[e+8]=n.z,r[e+12]=n.w,r};var R=new t;c.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],R)),n.y=t.magnitude(t.fromElements(e[4],e[5],e[6],R)),n.z=t.magnitude(t.fromElements(e[8],e[9],e[10],R)),n};var f=new t;c.getMaximumScale=function(e){return c.getScale(e,f),t.maximumComponent(f)},c.multiply=function(t,e,n){var r=t[0],i=t[1],a=t[2],o=t[3],u=t[4],E=t[5],s=t[6],c=t[7],_=t[8],l=t[9],T=t[10],R=t[11],f=t[12],A=t[13],h=t[14],N=t[15],d=e[0],I=e[1],S=e[2],m=e[3],M=e[4],y=e[5],O=e[6],p=e[7],C=e[8],U=e[9],L=e[10],F=e[11],P=e[12],v=e[13],w=e[14],x=e[15],g=r*d+u*I+_*S+f*m,D=i*d+E*I+l*S+A*m,B=a*d+s*I+T*S+h*m,z=o*d+c*I+R*S+N*m,G=r*M+u*y+_*O+f*p,b=i*M+E*y+l*O+A*p,X=a*M+s*y+T*O+h*p,V=o*M+c*y+R*O+N*p,q=r*C+u*U+_*L+f*F,H=i*C+E*U+l*L+A*F,W=a*C+s*U+T*L+h*F,Y=o*C+c*U+R*L+N*F,k=r*P+u*v+_*w+f*x,K=i*P+E*v+l*w+A*x,Z=a*P+s*v+T*w+h*x,j=o*P+c*v+R*w+N*x;return n[0]=g,n[1]=D,n[2]=B,n[3]=z,n[4]=G,n[5]=b,n[6]=X,n[7]=V,n[8]=q,n[9]=H,n[10]=W,n[11]=Y,n[12]=k,n[13]=K,n[14]=Z,n[15]=j,n},c.add=function(t,e,n){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n[4]=t[4]+e[4],n[5]=t[5]+e[5],n[6]=t[6]+e[6],n[7]=t[7]+e[7],n[8]=t[8]+e[8],n[9]=t[9]+e[9],n[10]=t[10]+e[10],n[11]=t[11]+e[11],n[12]=t[12]+e[12],n[13]=t[13]+e[13],n[14]=t[14]+e[14],n[15]=t[15]+e[15],n},c.subtract=function(t,e,n){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n[4]=t[4]-e[4],n[5]=t[5]-e[5],n[6]=t[6]-e[6],n[7]=t[7]-e[7],n[8]=t[8]-e[8],n[9]=t[9]-e[9],n[10]=t[10]-e[10],n[11]=t[11]-e[11],n[12]=t[12]-e[12],n[13]=t[13]-e[13],n[14]=t[14]-e[14],n[15]=t[15]-e[15],n},c.multiplyTransformation=function(t,e,n){var r=t[0],i=t[1],a=t[2],o=t[4],u=t[5],E=t[6],s=t[8],c=t[9],_=t[10],l=t[12],T=t[13],R=t[14],f=e[0],A=e[1],h=e[2],N=e[4],d=e[5],I=e[6],S=e[8],m=e[9],M=e[10],y=e[12],O=e[13],p=e[14],C=r*f+o*A+s*h,U=i*f+u*A+c*h,L=a*f+E*A+_*h,F=r*N+o*d+s*I,P=i*N+u*d+c*I,v=a*N+E*d+_*I,w=r*S+o*m+s*M,x=i*S+u*m+c*M,g=a*S+E*m+_*M,D=r*y+o*O+s*p+l,B=i*y+u*O+c*p+T,z=a*y+E*O+_*p+R;return n[0]=C,n[1]=U,n[2]=L,n[3]=0,n[4]=F,n[5]=P,n[6]=v,n[7]=0,n[8]=w,n[9]=x,n[10]=g,n[11]=0,n[12]=D,n[13]=B,n[14]=z,n[15]=1,n},c.multiplyByMatrix3=function(t,e,n){var r=t[0],i=t[1],a=t[2],o=t[4],u=t[5],E=t[6],s=t[8],c=t[9],_=t[10],l=e[0],T=e[1],R=e[2],f=e[3],A=e[4],h=e[5],N=e[6],d=e[7],I=e[8],S=r*l+o*T+s*R,m=i*l+u*T+c*R,M=a*l+E*T+_*R,y=r*f+o*A+s*h,O=i*f+u*A+c*h,p=a*f+E*A+_*h,C=r*N+o*d+s*I,U=i*N+u*d+c*I,L=a*N+E*d+_*I;return n[0]=S,n[1]=m,n[2]=M,n[3]=0,n[4]=y,n[5]=O,n[6]=p,n[7]=0,n[8]=C,n[9]=U,n[10]=L,n[11]=0,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n},c.multiplyByTranslation=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=r*t[0]+i*t[4]+a*t[8]+t[12],u=r*t[1]+i*t[5]+a*t[9]+t[13],E=r*t[2]+i*t[6]+a*t[10]+t[14];return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=o,n[13]=u,n[14]=E,n[15]=t[15],n};var A=new t;c.multiplyByUniformScale=function(t,e,n){return A.x=e,A.y=e,A.z=e,c.multiplyByScale(t,A,n)},c.multiplyByScale=function(t,e,n){var r=e.x,i=e.y,a=e.z;return 1===r&&1===i&&1===a?c.clone(t,n):(n[0]=r*t[0],n[1]=r*t[1],n[2]=r*t[2],n[3]=0,n[4]=i*t[4],n[5]=i*t[5],n[6]=i*t[6],n[7]=0,n[8]=a*t[8],n[9]=a*t[9],n[10]=a*t[10],n[11]=0,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=1,n)},c.multiplyByVector=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=e.w,u=t[0]*r+t[4]*i+t[8]*a+t[12]*o,E=t[1]*r+t[5]*i+t[9]*a+t[13]*o,s=t[2]*r+t[6]*i+t[10]*a+t[14]*o,c=t[3]*r+t[7]*i+t[11]*a+t[15]*o;return n.x=u,n.y=E,n.z=s,n.w=c,n},c.multiplyByPointAsVector=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=t[0]*r+t[4]*i+t[8]*a,u=t[1]*r+t[5]*i+t[9]*a,E=t[2]*r+t[6]*i+t[10]*a;return n.x=o,n.y=u,n.z=E,n},c.multiplyByPoint=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=t[0]*r+t[4]*i+t[8]*a+t[12],u=t[1]*r+t[5]*i+t[9]*a+t[13],E=t[2]*r+t[6]*i+t[10]*a+t[14];return n.x=o,n.y=u,n.z=E,n},c.multiplyByScalar=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n[4]=t[4]*e,n[5]=t[5]*e,n[6]=t[6]*e,n[7]=t[7]*e,n[8]=t[8]*e,n[9]=t[9]*e,n[10]=t[10]*e,n[11]=t[11]*e,n[12]=t[12]*e,n[13]=t[13]*e,n[14]=t[14]*e,n[15]=t[15]*e,n},c.negate=function(t,e){return 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],e},c.transpose=function(t,e){var n=t[1],r=t[2],i=t[3],a=t[6],o=t[7],u=t[11];return e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=r,e[9]=a,e[10]=t[10],e[11]=t[14],e[12]=i,e[13]=o,e[14]=u,e[15]=t[15],e},c.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e[9]=Math.abs(t[9]),e[10]=Math.abs(t[10]),e[11]=Math.abs(t[11]),e[12]=Math.abs(t[12]),e[13]=Math.abs(t[13]),e[14]=Math.abs(t[14]),e[15]=Math.abs(t[15]),e},c.equals=function(t,e){return t===e||r(t)&&r(e)&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[3]===e[3]&&t[7]===e[7]&&t[11]===e[11]&&t[15]===e[15]},c.equalsEpsilon=function(t,e,n){return t===e||r(t)&&r(e)&&Math.abs(t[0]-e[0])<=n&&Math.abs(t[1]-e[1])<=n&&Math.abs(t[2]-e[2])<=n&&Math.abs(t[3]-e[3])<=n&&Math.abs(t[4]-e[4])<=n&&Math.abs(t[5]-e[5])<=n&&Math.abs(t[6]-e[6])<=n&&Math.abs(t[7]-e[7])<=n&&Math.abs(t[8]-e[8])<=n&&Math.abs(t[9]-e[9])<=n&&Math.abs(t[10]-e[10])<=n&&Math.abs(t[11]-e[11])<=n&&Math.abs(t[12]-e[12])<=n&&Math.abs(t[13]-e[13])<=n&&Math.abs(t[14]-e[14])<=n&&Math.abs(t[15]-e[15])<=n},c.getTranslation=function(t,e){return e.x=t[12],e.y=t[13],e.z=t[14],e},c.getRotation=function(t,e){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e};var h=new E,N=new E,d=new e,I=new e(0,0,0,1);return c.inverse=function(t,n){if(E.equalsEpsilon(c.getRotation(t,h),N,u.EPSILON7)&&e.equals(c.getRow(t,3,d),I))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-t[12],n[13]=-t[13],n[14]=-t[14],n[15]=1,n;var r=t[0],i=t[4],a=t[8],o=t[12],_=t[1],l=t[5],T=t[9],R=t[13],f=t[2],A=t[6],S=t[10],m=t[14],M=t[3],y=t[7],O=t[11],p=t[15],C=S*p,U=m*O,L=A*p,F=m*y,P=A*O,v=S*y,w=f*p,x=m*M,g=f*O,D=S*M,B=f*y,z=A*M,G=C*l+F*T+P*R-(U*l+L*T+v*R),b=U*_+w*T+D*R-(C*_+x*T+g*R),X=L*_+x*l+B*R-(F*_+w*l+z*R),V=v*_+g*l+z*T-(P*_+D*l+B*T),q=U*i+L*a+v*o-(C*i+F*a+P*o),H=C*r+x*a+g*o-(U*r+w*a+D*o),W=F*r+w*i+z*o-(L*r+x*i+B*o),Y=P*r+D*i+B*a-(v*r+g*i+z*a);C=a*R,U=o*T,L=i*R,F=o*l,P=i*T,v=a*l,w=r*R,x=o*_,g=r*T,D=a*_,B=r*l,z=i*_;var k=C*y+F*O+P*p-(U*y+L*O+v*p),K=U*M+w*O+D*p-(C*M+x*O+g*p),Z=L*M+x*y+B*p-(F*M+w*y+z*p),j=v*M+g*y+z*O-(P*M+D*y+B*O),Q=L*S+v*m+U*A-(P*m+C*A+F*S),J=g*m+C*f+x*S-(w*S+D*m+U*f),$=w*A+z*m+F*f-(B*m+L*f+x*A),tt=B*S+P*f+D*A-(g*A+z*S+v*f),et=r*G+i*b+a*X+o*V;if(Math.abs(et)<u.EPSILON20)throw new s("matrix is not invertible because its determinate is zero.");return et=1/et,n[0]=G*et,n[1]=b*et,n[2]=X*et,n[3]=V*et,n[4]=q*et,n[5]=H*et,n[6]=W*et,n[7]=Y*et,n[8]=k*et,n[9]=K*et,n[10]=Z*et,n[11]=j*et,n[12]=Q*et,n[13]=J*et,n[14]=$*et,n[15]=tt*et,n},c.inverseTransformation=function(t,e){var n=t[0],r=t[1],i=t[2],a=t[4],o=t[5],u=t[6],E=t[8],s=t[9],c=t[10],_=t[12],l=t[13],T=t[14],R=-n*_-r*l-i*T,f=-a*_-o*l-u*T,A=-E*_-s*l-c*T;return e[0]=n,e[1]=a,e[2]=E,e[3]=0,e[4]=r,e[5]=o,e[6]=s,e[7]=0,e[8]=i,e[9]=u,e[10]=c,e[11]=0,e[12]=R,e[13]=f,e[14]=A,e[15]=1,e},c.IDENTITY=o(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),c.ZERO=o(new c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN0ROW3=3,c.COLUMN1ROW0=4,c.COLUMN1ROW1=5,c.COLUMN1ROW2=6,c.COLUMN1ROW3=7,c.COLUMN2ROW0=8,c.COLUMN2ROW1=9,c.COLUMN2ROW2=10,c.COLUMN2ROW3=11,c.COLUMN3ROW0=12,c.COLUMN3ROW1=13,c.COLUMN3ROW2=14,c.COLUMN3ROW3=15,i(c.prototype,{length:{get:function(){return c.packedLength}}}),c.prototype.clone=function(t){return c.clone(this,t)},c.prototype.equals=function(t){return c.equals(this,t)},c.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]&&t[4]===e[n+4]&&t[5]===e[n+5]&&t[6]===e[n+6]&&t[7]===e[n+7]&&t[8]===e[n+8]&&t[9]===e[n+9]&&t[10]===e[n+10]&&t[11]===e[n+11]&&t[12]===e[n+12]&&t[13]===e[n+13]&&t[14]===e[n+14]&&t[15]===e[n+15]},c.prototype.equalsEpsilon=function(t,e){return c.equalsEpsilon(this,t,e)},c.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]+")"},c}),define("Core/Rectangle",["./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(t,e,n,r,i,a,o,u){"use strict";function E(t,n,r,i){this.west=e(t,0),this.south=e(n,0),this.east=e(r,0),this.north=e(i,0)}r(E.prototype,{width:{get:function(){return E.computeWidth(this)}},height:{get:function(){return E.computeHeight(this)}}}),E.packedLength=4,E.pack=function(t,n,r){return r=e(r,0),n[r++]=t.west,n[r++]=t.south,n[r++]=t.east,n[r]=t.north,n},E.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new E),i.west=t[r++],i.south=t[r++],i.east=t[r++],i.north=t[r],i},E.computeWidth=function(t){var e=t.east,n=t.west;return e<n&&(e+=u.TWO_PI),e-n},E.computeHeight=function(t){return t.north-t.south},E.fromDegrees=function(t,r,i,a,o){return t=u.toRadians(e(t,0)),r=u.toRadians(e(r,0)),i=u.toRadians(e(i,0)),a=u.toRadians(e(a,0)),n(o)?(o.west=t,o.south=r,o.east=i,o.north=a,o):new E(t,r,i,a)},E.fromCartographicArray=function(t,e){for(var r=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=Number.MAX_VALUE,c=-Number.MAX_VALUE,_=0,l=t.length;_<l;_++){var T=t[_];r=Math.min(r,T.longitude),i=Math.max(i,T.longitude),s=Math.min(s,T.latitude),c=Math.max(c,T.latitude);var R=T.longitude>=0?T.longitude:T.longitude+u.TWO_PI;a=Math.min(a,R),o=Math.max(o,R)}return i-r>o-a&&(r=a,i=o,i>u.PI&&(i-=u.TWO_PI),r>u.PI&&(r-=u.TWO_PI)),n(e)?(e.west=r,e.south=s,e.east=i,e.north=c,e):new E(r,s,i,c)},E.fromCartesianArray=function(t,e,r){for(var i=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,s=-Number.MAX_VALUE,c=Number.MAX_VALUE,_=-Number.MAX_VALUE,l=0,T=t.length;l<T;l++){var R=e.cartesianToCartographic(t[l]);i=Math.min(i,R.longitude),a=Math.max(a,R.longitude),c=Math.min(c,R.latitude),_=Math.max(_,R.latitude);var f=R.longitude>=0?R.longitude:R.longitude+u.TWO_PI;o=Math.min(o,f),s=Math.max(s,f)}return a-i>s-o&&(i=o,a=s,a>u.PI&&(a-=u.TWO_PI),i>u.PI&&(i-=u.TWO_PI)),n(r)?(r.west=i,r.south=c,r.east=a,r.north=_,r):new E(i,c,a,_)},E.clone=function(t,e){if(n(t))return n(e)?(e.west=t.west,e.south=t.south,e.east=t.east,e.north=t.north,e):new E(t.west,t.south,t.east,t.north)},E.prototype.clone=function(t){return E.clone(this,t)},E.prototype.equals=function(t){return E.equals(this,t)},E.equals=function(t,e){return t===e||n(t)&&n(e)&&t.west===e.west&&t.south===e.south&&t.east===e.east&&t.north===e.north},E.prototype.equalsEpsilon=function(t,e){return n(t)&&Math.abs(this.west-t.west)<=e&&Math.abs(this.south-t.south)<=e&&Math.abs(this.east-t.east)<=e&&Math.abs(this.north-t.north)<=e},E.validate=function(t){},E.southwest=function(e,r){return n(r)?(r.longitude=e.west,r.latitude=e.south,r.height=0,r):new t(e.west,e.south)},E.northwest=function(e,r){return n(r)?(r.longitude=e.west,r.latitude=e.north,r.height=0,r):new t(e.west,e.north)},E.northeast=function(e,r){return n(r)?(r.longitude=e.east,r.latitude=e.north,r.height=0,r):new t(e.east,e.north)},E.southeast=function(e,r){return n(r)?(r.longitude=e.east,r.latitude=e.south,r.height=0,r):new t(e.east,e.south)},E.center=function(e,r){var i=e.east,a=e.west;i<a&&(i+=u.TWO_PI);var o=u.negativePiToPi(.5*(a+i)),E=.5*(e.south+e.north);return n(r)?(r.longitude=o,r.latitude=E,r.height=0,r):new t(o,E)},E.intersection=function(t,e,r){var i=t.east,a=t.west,o=e.east,s=e.west;i<a&&o>0?i+=u.TWO_PI:o<s&&i>0&&(o+=u.TWO_PI),i<a&&s<0?s+=u.TWO_PI:o<s&&a<0&&(a+=u.TWO_PI);var c=u.negativePiToPi(Math.max(a,s)),_=u.negativePiToPi(Math.min(i,o));if(!((t.west<t.east||e.west<e.east)&&_<=c)){var l=Math.max(t.south,e.south),T=Math.min(t.north,e.north);if(!(l>=T))return n(r)?(r.west=c,r.south=l,r.east=_,r.north=T,r):new E(c,l,_,T)}},E.simpleIntersection=function(t,e,r){var i=Math.max(t.west,e.west),a=Math.max(t.south,e.south),o=Math.min(t.east,e.east),u=Math.min(t.north,e.north);if(!(a>=u||i>=o))return n(r)?(r.west=i,r.south=a,r.east=o,r.north=u,r):new E(i,a,o,u)},E.union=function(t,e,r){n(r)||(r=new E);var i=t.east,a=t.west,o=e.east,s=e.west;i<a&&o>0?i+=u.TWO_PI:o<s&&i>0&&(o+=u.TWO_PI),i<a&&s<0?s+=u.TWO_PI:o<s&&a<0&&(a+=u.TWO_PI);var c=u.convertLongitudeRange(Math.min(a,s)),_=u.convertLongitudeRange(Math.max(i,o));return r.west=c,r.south=Math.min(t.south,e.south),r.east=_,r.north=Math.max(t.north,e.north),r},E.expand=function(t,e,r){return n(r)||(r=new E),r.west=Math.min(t.west,e.longitude),r.south=Math.min(t.south,e.latitude),r.east=Math.max(t.east,e.longitude),r.north=Math.max(t.north,e.latitude),r},E.contains=function(t,e){var n=e.longitude,r=e.latitude,i=t.west,a=t.east;return a<i&&(a+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>i||u.equalsEpsilon(n,i,u.EPSILON14))&&(n<a||u.equalsEpsilon(n,a,u.EPSILON14))&&r>=t.south&&r<=t.north};var s=new t;return E.subsample=function(t,r,i,o){r=e(r,a.WGS84),i=e(i,0),n(o)||(o=[]);var c=0,_=t.north,l=t.south,T=t.east,R=t.west,f=s;f.height=i,f.longitude=R,f.latitude=_,o[c]=r.cartographicToCartesian(f,o[c]),c++,f.longitude=T,o[c]=r.cartographicToCartesian(f,o[c]),c++,f.latitude=l,o[c]=r.cartographicToCartesian(f,o[c]),c++,f.longitude=R,o[c]=r.cartographicToCartesian(f,o[c]),c++,_<0?f.latitude=_:l>0?f.latitude=l:f.latitude=0;for(var A=1;A<8;++A)f.longitude=-Math.PI+A*u.PI_OVER_TWO,E.contains(t,f)&&(o[c]=r.cartographicToCartesian(f,o[c]),c++);return 0===f.latitude&&(f.longitude=R,o[c]=r.cartographicToCartesian(f,o[c]),c++,f.longitude=T,o[c]=r.cartographicToCartesian(f,o[c]),c++),o.length=c,o},E.MAX_VALUE=o(new E(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),E}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(t,e,n,r,i,a,o,u,E,s,c,_){"use strict";function l(e,r){this.center=t.clone(n(e,t.ZERO)),this.radius=n(r,0)}var T=new t,R=new t,f=new t,A=new t,h=new t,N=new t,d=new t,I=new t,S=new t,m=new t,M=new t,y=new t;l.fromPoints=function(e,n){if(r(n)||(n=new l),!r(e)||0===e.length)return n.center=t.clone(t.ZERO,n.center),n.radius=0,n;for(var i=t.clone(e[0],d),a=t.clone(i,T),o=t.clone(i,R),u=t.clone(i,f),E=t.clone(i,A),s=t.clone(i,h),c=t.clone(i,N),_=e.length,O=1;O<_;O++){t.clone(e[O],i);var p=i.x,C=i.y,U=i.z;p<a.x&&t.clone(i,a),p>E.x&&t.clone(i,E),C<o.y&&t.clone(i,o),C>s.y&&t.clone(i,s),U<u.z&&t.clone(i,u),U>c.z&&t.clone(i,c)}var L=t.magnitudeSquared(t.subtract(E,a,I)),F=t.magnitudeSquared(t.subtract(s,o,I)),P=t.magnitudeSquared(t.subtract(c,u,I)),v=a,w=E,x=L;F>x&&(x=F,v=o,w=s),P>x&&(x=P,v=u,w=c);var g=S;g.x=.5*(v.x+w.x),g.y=.5*(v.y+w.y),g.z=.5*(v.z+w.z);var D=t.magnitudeSquared(t.subtract(w,g,I)),B=Math.sqrt(D),z=m;z.x=a.x,z.y=o.y,z.z=u.z;var G=M;G.x=E.x,G.y=s.y,G.z=c.z;var b=t.multiplyByScalar(t.add(z,G,I),.5,y),X=0;for(O=0;O<_;O++){t.clone(e[O],i);var V=t.magnitude(t.subtract(i,b,I));V>X&&(X=V);var q=t.magnitudeSquared(t.subtract(i,g,I));if(q>D){var H=Math.sqrt(q);B=.5*(B+H),D=B*B;var W=H-B;g.x=(B*g.x+W*i.x)/H,g.y=(B*g.y+W*i.y)/H,g.z=(B*g.z+W*i.z)/H}}return B<X?(t.clone(g,n.center),n.radius=B):(t.clone(b,n.center),n.radius=X),n};var O=new o,p=new t,C=new t,U=new e,L=new e;l.fromRectangle2D=function(t,e,n){return l.fromRectangleWithHeights2D(t,e,0,0,n)},l.fromRectangleWithHeights2D=function(e,i,a,o,u){if(r(u)||(u=new l),!r(e))return u.center=t.clone(t.ZERO,u.center),u.radius=0,u;i=n(i,O),_.southwest(e,U),U.height=a,_.northeast(e,L),L.height=o;var E=i.project(U,p),s=i.project(L,C),c=s.x-E.x,T=s.y-E.y,R=s.z-E.z;u.radius=.5*Math.sqrt(c*c+T*T+R*R);var f=u.center;return f.x=E.x+.5*c,f.y=E.y+.5*T,f.z=E.z+.5*R,u};var F=[];l.fromRectangle3D=function(t,e,i,o){e=n(e,a.WGS84),i=n(i,0);var u;return r(t)&&(u=_.subsample(t,e,i,F)),l.fromPoints(u,o)},l.fromVertices=function(e,i,a,o){if(r(o)||(o=new l),!r(e)||0===e.length)return o.center=t.clone(t.ZERO,o.center),o.radius=0,o;i=n(i,t.ZERO),a=n(a,3);var u=d;u.x=e[0]+i.x,u.y=e[1]+i.y,u.z=e[2]+i.z;for(var E=t.clone(u,T),s=t.clone(u,R),c=t.clone(u,f),_=t.clone(u,A),O=t.clone(u,h),p=t.clone(u,N),C=e.length,U=0;U<C;U+=a){var L=e[U]+i.x,F=e[U+1]+i.y,P=e[U+2]+i.z;u.x=L,u.y=F,u.z=P,L<E.x&&t.clone(u,E),L>_.x&&t.clone(u,_),F<s.y&&t.clone(u,s),F>O.y&&t.clone(u,O),P<c.z&&t.clone(u,c),P>p.z&&t.clone(u,p)}var v=t.magnitudeSquared(t.subtract(_,E,I)),w=t.magnitudeSquared(t.subtract(O,s,I)),x=t.magnitudeSquared(t.subtract(p,c,I)),g=E,D=_,B=v;w>B&&(B=w,g=s,D=O),x>B&&(B=x,g=c,D=p);var z=S;z.x=.5*(g.x+D.x),z.y=.5*(g.y+D.y),z.z=.5*(g.z+D.z);var G=t.magnitudeSquared(t.subtract(D,z,I)),b=Math.sqrt(G),X=m;X.x=E.x,X.y=s.y,X.z=c.z;var V=M;V.x=_.x,V.y=O.y,V.z=p.z;var q=t.multiplyByScalar(t.add(X,V,I),.5,y),H=0;for(U=0;U<C;U+=a){u.x=e[U]+i.x,u.y=e[U+1]+i.y,u.z=e[U+2]+i.z;var W=t.magnitude(t.subtract(u,q,I));W>H&&(H=W);var Y=t.magnitudeSquared(t.subtract(u,z,I));if(Y>G){var k=Math.sqrt(Y);b=.5*(b+k),G=b*b;var K=k-b;z.x=(b*z.x+K*u.x)/k,z.y=(b*z.y+K*u.y)/k,z.z=(b*z.z+K*u.z)/k}}return b<H?(t.clone(z,o.center),o.radius=b):(t.clone(q,o.center),o.radius=H),o},l.fromEncodedCartesianVertices=function(e,n,i){if(r(i)||(i=new l),!r(e)||!r(n)||e.length!==n.length||0===e.length)return i.center=t.clone(t.ZERO,i.center),i.radius=0,i;var a=d;a.x=e[0]+n[0],a.y=e[1]+n[1],a.z=e[2]+n[2];for(var o=t.clone(a,T),u=t.clone(a,R),E=t.clone(a,f),s=t.clone(a,A),c=t.clone(a,h),_=t.clone(a,N),O=e.length,p=0;p<O;p+=3){var C=e[p]+n[p],U=e[p+1]+n[p+1],L=e[p+2]+n[p+2];a.x=C,a.y=U,a.z=L,C<o.x&&t.clone(a,o),C>s.x&&t.clone(a,s),U<u.y&&t.clone(a,u),U>c.y&&t.clone(a,c),L<E.z&&t.clone(a,E),L>_.z&&t.clone(a,_)}var F=t.magnitudeSquared(t.subtract(s,o,I)),P=t.magnitudeSquared(t.subtract(c,u,I)),v=t.magnitudeSquared(t.subtract(_,E,I)),w=o,x=s,g=F;P>g&&(g=P,w=u,x=c),v>g&&(g=v,w=E,x=_);var D=S;D.x=.5*(w.x+x.x),D.y=.5*(w.y+x.y),D.z=.5*(w.z+x.z);var B=t.magnitudeSquared(t.subtract(x,D,I)),z=Math.sqrt(B),G=m;G.x=o.x,G.y=u.y,G.z=E.z;var b=M;b.x=s.x,b.y=c.y,b.z=_.z;var X=t.multiplyByScalar(t.add(G,b,I),.5,y),V=0;for(p=0;p<O;p+=3){a.x=e[p]+n[p],a.y=e[p+1]+n[p+1],a.z=e[p+2]+n[p+2];var q=t.magnitude(t.subtract(a,X,I));q>V&&(V=q);var H=t.magnitudeSquared(t.subtract(a,D,I));if(H>B){var W=Math.sqrt(H);z=.5*(z+W),B=z*z;var Y=W-z;D.x=(z*D.x+Y*a.x)/W,D.y=(z*D.y+Y*a.y)/W,D.z=(z*D.z+Y*a.z)/W}}return z<V?(t.clone(D,i.center),i.radius=z):(t.clone(X,i.center),i.radius=V),i},l.fromCornerPoints=function(e,n,i){r(i)||(i=new l);var a=i.center;return t.add(e,n,a),t.multiplyByScalar(a,.5,a),i.radius=t.distance(a,n),i},l.fromEllipsoid=function(e,n){return r(n)||(n=new l),t.clone(t.ZERO,n.center),n.radius=e.maximumRadius,n};var P=new t;l.fromBoundingSpheres=function(e,n){if(r(n)||(n=new l),!r(e)||0===e.length)return n.center=t.clone(t.ZERO,n.center),n.radius=0,n;var i=e.length;if(1===i)return l.clone(e[0],n);if(2===i)return l.union(e[0],e[1],n);for(var a=[],o=0;o<i;o++)a.push(e[o].center);n=l.fromPoints(a,n);var u=n.center,E=n.radius;for(o=0;o<i;o++){var s=e[o];E=Math.max(E,t.distance(u,s.center,P)+s.radius)}return n.radius=E,n};var v=new t,w=new t,x=new t;l.fromOrientedBoundingBox=function(e,n){r(n)||(n=new l);var i=e.halfAxes,a=s.getColumn(i,0,v),o=s.getColumn(i,1,w),u=s.getColumn(i,2,x),E=t.magnitude(a),c=t.magnitude(o),_=t.magnitude(u);return n.center=t.clone(e.center,n.center),n.radius=Math.max(E,c,_),n},l.clone=function(e,n){if(r(e))return r(n)?(n.center=t.clone(e.center,n.center),n.radius=e.radius,n):new l(e.center,e.radius)},l.packedLength=4,l.pack=function(t,e,r){r=n(r,0);var i=t.center;return e[r++]=i.x,e[r++]=i.y,e[r++]=i.z,e[r]=t.radius,e},l.unpack=function(t,e,i){e=n(e,0),r(i)||(i=new l);var a=i.center;return a.x=t[e++],a.y=t[e++],a.z=t[e++],i.radius=t[e],i};var g=new t,D=new t;l.union=function(e,n,i){r(i)||(i=new l);var a=e.center,o=e.radius,u=n.center,E=n.radius,s=t.subtract(u,a,g),c=t.magnitude(s);if(o>=c+E)return e.clone(i),i;if(E>=c+o)return n.clone(i),i;var _=.5*(o+c+E),T=t.multiplyByScalar(s,(-o+_)/c,D);return t.add(T,a,T),t.clone(T,i.center),i.radius=_,i};var B=new t;l.expand=function(e,n,r){r=l.clone(e,r);var i=t.magnitude(t.subtract(n,r.center,B));return i>r.radius&&(r.radius=i),r},l.intersectPlane=function(e,n){var r=e.center,i=e.radius,a=n.normal,o=t.dot(a,r)+n.distance;return o<-i?u.OUTSIDE:o<i?u.INTERSECTING:u.INSIDE},l.transform=function(t,e,n){return r(n)||(n=new l),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=c.getMaximumScale(e)*t.radius,n};var z=new t;l.distanceSquaredTo=function(e,n){var r=t.subtract(e.center,n,z);return t.magnitudeSquared(r)-e.radius*e.radius},l.transformWithoutScale=function(t,e,n){return r(n)||(n=new l),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=t.radius,n};var G=new t;l.computePlaneDistances=function(e,n,i,a){r(a)||(a=new E);var o=t.subtract(e.center,n,G),u=t.dot(i,o);return a.start=u-e.radius,a.stop=u+e.radius,a};for(var b=new t,X=new t,V=new t,q=new t,H=new t,W=new e,Y=new Array(8),k=0;k<8;++k)Y[k]=new t;var K=new o;return l.projectTo2D=function(e,r,i){r=n(r,K);var a=r.ellipsoid,o=e.center,u=e.radius,E=a.geodeticSurfaceNormal(o,b),s=t.cross(t.UNIT_Z,E,X);t.normalize(s,s);var c=t.cross(E,s,V);t.normalize(c,c),t.multiplyByScalar(E,u,E),t.multiplyByScalar(c,u,c),t.multiplyByScalar(s,u,s);var _=t.negate(c,H),T=t.negate(s,q),R=Y,f=R[0];t.add(E,c,f),t.add(f,s,f),f=R[1],t.add(E,c,f),t.add(f,T,f),f=R[2],t.add(E,_,f),t.add(f,T,f),f=R[3],t.add(E,_,f),t.add(f,s,f),t.negate(E,E),f=R[4],t.add(E,c,f),t.add(f,s,f),f=R[5],t.add(E,c,f),t.add(f,T,f),f=R[6],t.add(E,_,f),t.add(f,T,f),f=R[7],t.add(E,_,f),t.add(f,s,f);for(var A=R.length,h=0;h<A;++h){var N=R[h];t.add(o,N,N);var d=a.cartesianToCartographic(N,W);r.project(d,N)}i=l.fromPoints(R,i),o=i.center;var I=o.x,S=o.y,m=o.z;return o.x=m,o.y=I,o.z=S,i},l.isOccluded=function(t,e){return!e.isBoundingSphereVisible(t)},l.equals=function(e,n){return e===n||r(e)&&r(n)&&t.equals(e.center,n.center)&&e.radius===n.radius},l.prototype.intersectPlane=function(t){return l.intersectPlane(this,t)},l.prototype.distanceSquaredTo=function(t){return l.distanceSquaredTo(this,t)},l.prototype.computePlaneDistances=function(t,e,n){return l.computePlaneDistances(this,t,e,n)},l.prototype.isOccluded=function(t){return l.isOccluded(this,t)},l.prototype.equals=function(t){return l.equals(this,t)},l.prototype.clone=function(t){return l.clone(this,t)},l}),define("Core/Cartesian2",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i){"use strict";function a(e,n){this.x=t(e,0),this.y=t(n,0)}a.fromElements=function(t,n,r){return e(r)?(r.x=t,r.y=n,r):new a(t,n)},a.clone=function(t,n){if(e(t))return e(n)?(n.x=t.x,n.y=t.y,n):new a(t.x,t.y)},a.fromCartesian3=a.clone,a.fromCartesian4=a.clone,a.packedLength=2,a.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r]=e.y,n},a.unpack=function(n,r,i){return r=t(r,0),e(i)||(i=new a),i.x=n[r++],i.y=n[r],i},a.packArray=function(t,n){var r=t.length;e(n)?n.length=2*r:n=new Array(2*r);for(var i=0;i<r;++i)a.pack(t[i],n,2*i);return n},a.unpackArray=function(t,n){var r=t.length;e(n)?n.length=r/2:n=new Array(r/2);for(var i=0;i<r;i+=2){var o=i/2;n[o]=a.unpack(t,i,n[o])}return n},a.fromArray=a.unpack,a.maximumComponent=function(t){return Math.max(t.x,t.y)},a.minimumComponent=function(t){return Math.min(t.x,t.y)},a.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n},a.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n},a.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y},a.magnitude=function(t){return Math.sqrt(a.magnitudeSquared(t))};var o=new a;a.distance=function(t,e){return a.subtract(t,e,o),a.magnitude(o)},a.distanceSquared=function(t,e){return a.subtract(t,e,o),a.magnitudeSquared(o)},a.normalize=function(t,e){var n=a.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e},a.dot=function(t,e){return t.x*e.x+t.y*e.y},a.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n},a.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n},a.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n},a.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n},a.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n},a.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n},a.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e},a.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e};var u=new a;a.lerp=function(t,e,n,r){return a.multiplyByScalar(e,n,u),r=a.multiplyByScalar(t,1-n,r),a.add(u,r,r)};var E=new a,s=new a;a.angleBetween=function(t,e){return a.normalize(t,E),a.normalize(e,s),i.acosClamped(a.dot(E,s))};var c=new a;return a.mostOrthogonalAxis=function(t,e){var n=a.normalize(t,c);return a.abs(n,n),e=n.x<=n.y?a.clone(a.UNIT_X,e):a.clone(a.UNIT_Y,e)},a.equals=function(t,n){return t===n||e(t)&&e(n)&&t.x===n.x&&t.y===n.y},a.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]},a.equalsEpsilon=function(t,n,r,a){return t===n||e(t)&&e(n)&&i.equalsEpsilon(t.x,n.x,r,a)&&i.equalsEpsilon(t.y,n.y,r,a)},a.ZERO=r(new a(0,0)),a.UNIT_X=r(new a(1,0)),a.UNIT_Y=r(new a(0,1)),a.prototype.clone=function(t){return a.clone(this,t)},a.prototype.equals=function(t){return a.equals(this,t)},a.prototype.equalsEpsilon=function(t,e,n){return a.equalsEpsilon(this,t,e,n)},a.prototype.toString=function(){return"("+this.x+", "+this.y+")"},a}),define("Core/Fullscreen",["./defined","./defineProperties"],function(t,e){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},i={};return e(i,{element:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenEnabled]; -}},fullscreen:{get:function(){if(i.supportsFullscreen())return null!==i.element}}}),i.supportsFullscreen=function(){if(t(n))return n;n=!1;var e=document.body;if("function"==typeof e.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var i,a=["webkit","moz","o","ms","khtml"],o=0,u=a.length;o<u;++o){var E=a[o];i=E+"RequestFullscreen","function"==typeof e[i]?(r.requestFullscreen=i,n=!0):(i=E+"RequestFullScreen","function"==typeof e[i]&&(r.requestFullscreen=i,n=!0)),i=E+"ExitFullscreen","function"==typeof document[i]?r.exitFullscreen=i:(i=E+"CancelFullScreen","function"==typeof document[i]&&(r.exitFullscreen=i)),i=E+"FullscreenEnabled",void 0!==document[i]?r.fullscreenEnabled=i:(i=E+"FullScreenEnabled",void 0!==document[i]&&(r.fullscreenEnabled=i)),i=E+"FullscreenElement",void 0!==document[i]?r.fullscreenElement=i:(i=E+"FullScreenElement",void 0!==document[i]&&(r.fullscreenElement=i)),i=E+"fullscreenchange",void 0!==document["on"+i]&&("ms"===E&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=E+"fullscreenerror",void 0!==document["on"+i]&&("ms"===E&&(i="MSFullscreenError"),r.fullscreenerror=i)}return n},i.requestFullscreen=function(t,e){i.supportsFullscreen()&&t[r.requestFullscreen]({vrDisplay:e})},i.exitFullscreen=function(){i.supportsFullscreen()&&document[r.exitFullscreen]()},i}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(t,e,n){"use strict";function r(t){for(var e=t.split("."),n=0,r=e.length;n<r;++n)e[n]=parseInt(e[n],10);return e}function i(){if(!e(S)&&(S=!1,!l())){var t=/ Chrome\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(S=!0,m=r(t[1]))}return S}function a(){return i()&&m}function o(){if(!e(M)&&(M=!1,!i()&&!l()&&/ Safari\/[\.0-9]+/.test(I.userAgent))){var t=/ Version\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(M=!0,y=r(t[1]))}return M}function u(){return o()&&y}function E(){if(!e(O)){O=!1;var t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(I.userAgent);null!==t&&(O=!0,p=r(t[1]),p.isNightly=!!t[2])}return O}function s(){return E()&&p}function c(){if(!e(C)){C=!1;var t;"Microsoft Internet Explorer"===I.appName?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==t&&(C=!0,U=r(t[1]))):"Netscape"===I.appName&&(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==t&&(C=!0,U=r(t[1])))}return C}function _(){return c()&&U}function l(){if(!e(L)){L=!1;var t=/ Edge\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(L=!0,F=r(t[1]))}return L}function T(){return l()&&F}function R(){if(!e(P)){P=!1;var t=/Firefox\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(P=!0,v=r(t[1]))}return P}function f(){return e(w)||(w=/Windows/i.test(I.appVersion)),w}function A(){return R()&&v}function h(){return e(x)||(x="undefined"!=typeof PointerEvent&&(!e(I.pointerEnabled)||I.pointerEnabled)),x}function N(){if(!e(D)){var t=document.createElement("canvas");t.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=t.style.imageRendering;D=e(n)&&""!==n,D&&(g=n)}return D}function d(){return N()?g:void 0}var I;I="undefined"!=typeof navigator?navigator:{};var S,m,M,y,O,p,C,U,L,F,P,v,w,x,g,D,B={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:E,webkitVersion:s,isInternetExplorer:c,internetExplorerVersion:_,isEdge:l,edgeVersion:T,isFirefox:R,firefoxVersion:A,isWindows:f,hardwareConcurrency:t(I.hardwareConcurrency,3),supportsPointerEvents:h,supportsImageRenderingPixelated:N,imageRenderingValue:d};return B.supportsFullscreen=function(){return n.supportsFullscreen()},B.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},B.supportsWebWorkers=function(){return"undefined"!=typeof Worker},B}),define("Core/WebGLConstants",["./freezeObject"],function(t){"use strict";var e={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503};return t(e)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(t,e,n,r,i,a){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:a.BYTE,UNSIGNED_BYTE:a.UNSIGNED_BYTE,SHORT:a.SHORT,UNSIGNED_SHORT:a.UNSIGNED_SHORT,INT:a.INT,UNSIGNED_INT:a.UNSIGNED_INT,FLOAT:a.FLOAT,DOUBLE:a.DOUBLE};return o.getSizeInBytes=function(t){switch(t){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.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(t){return t instanceof Int8Array?o.BYTE:t instanceof Uint8Array?o.UNSIGNED_BYTE:t instanceof Int16Array?o.SHORT:t instanceof Uint16Array?o.UNSIGNED_SHORT:t instanceof Int32Array?o.INT:t instanceof Uint32Array?o.UNSIGNED_INT:t instanceof Float32Array?o.FLOAT:t instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(t){return e(t)&&(t===o.BYTE||t===o.UNSIGNED_BYTE||t===o.SHORT||t===o.UNSIGNED_SHORT||t===o.INT||t===o.UNSIGNED_INT||t===o.FLOAT||t===o.DOUBLE)},o.createTypedArray=function(t,e){switch(t){case o.BYTE:return new Int8Array(e);case o.UNSIGNED_BYTE:return new Uint8Array(e);case o.SHORT:return new Int16Array(e);case o.UNSIGNED_SHORT:return new Uint16Array(e);case o.INT:return new Int32Array(e);case o.UNSIGNED_INT:return new Uint32Array(e);case o.FLOAT:return new Float32Array(e);case o.DOUBLE:return new Float64Array(e)}},o.createArrayBufferView=function(e,n,r,i){switch(r=t(r,0),i=t(i,(n.byteLength-r)/o.getSizeInBytes(e)),e){case o.BYTE:return new Int8Array(n,r,i);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,i);case o.SHORT:return new Int16Array(n,r,i);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,i);case o.INT:return new Int32Array(n,r,i);case o.UNSIGNED_INT:return new Uint32Array(n,r,i);case o.FLOAT:return new Float32Array(n,r,i);case o.DOUBLE:return new Float64Array(n,r,i)}},o.fromName=function(t){switch(t){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},i(o)}),define("Core/GeometryType",["./freezeObject"],function(t){"use strict";var e={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return t(e)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(t,e){"use strict";var n={POINTS:e.POINTS,LINES:e.LINES,LINE_LOOP:e.LINE_LOOP,LINE_STRIP:e.LINE_STRIP,TRIANGLES:e.TRIANGLES,TRIANGLE_STRIP:e.TRIANGLE_STRIP,TRIANGLE_FAN:e.TRIANGLE_FAN,validate:function(t){return t===n.POINTS||t===n.LINES||t===n.LINE_LOOP||t===n.LINE_STRIP||t===n.TRIANGLES||t===n.TRIANGLE_STRIP||t===n.TRIANGLE_FAN}};return t(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(t,e,n,r,i){"use strict";function a(e){e=t(e,t.EMPTY_OBJECT),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=t(e.primitiveType,i.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=t(e.geometryType,r.NONE),this.boundingSphereCV=e.boundingSphereCV}return a.computeNumberOfVertices=function(t){var n=-1;for(var r in t.attributes)if(t.attributes.hasOwnProperty(r)&&e(t.attributes[r])&&e(t.attributes[r].values)){var i=t.attributes[r],a=i.values.length/i.componentsPerAttribute;n=a}return n},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(t,e,n){"use strict";function r(e){e=t(e,t.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=t(e.normalize,!1),this.values=e.values}return r}),define("Core/GeometryAttributes",["./defaultValue"],function(t){"use strict";function e(e){e=t(e,t.EMPTY_OBJECT),this.position=e.position,this.normal=e.normal,this.st=e.st,this.binormal=e.binormal,this.tangent=e.tangent,this.color=e.color}return e}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(t,e,n,r,i){"use strict";var a={UNSIGNED_BYTE:i.UNSIGNED_BYTE,UNSIGNED_SHORT:i.UNSIGNED_SHORT,UNSIGNED_INT:i.UNSIGNED_INT};return a.getSizeInBytes=function(t){switch(t){case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},a.validate=function(e){return t(e)&&(e===a.UNSIGNED_BYTE||e===a.UNSIGNED_SHORT||e===a.UNSIGNED_INT)},a.createTypedArray=function(t,e){return t>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(e):new Uint16Array(e)},a.createTypedArrayFromArrayBuffer=function(t,e,n,i){return t>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(e,n,i):new Uint16Array(e,n,i)},n(a)}),define("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(t,e,n,r){"use strict";function i(e){e=t(e,t.EMPTY_OBJECT),this.position=t(e.position,!1),this.normal=t(e.normal,!1),this.st=t(e.st,!1),this.binormal=t(e.binormal,!1),this.tangent=t(e.tangent,!1),this.color=t(e.color,!1)}return i.POSITION_ONLY=r(new i({position:!0})),i.POSITION_AND_NORMAL=r(new i({position:!0,normal:!0})),i.POSITION_NORMAL_AND_ST=r(new i({position:!0,normal:!0,st:!0})),i.POSITION_AND_ST=r(new i({position:!0,st:!0})),i.POSITION_AND_COLOR=r(new i({position:!0,color:!0})),i.ALL=r(new i({position:!0,normal:!0,st:!0,binormal:!0,tangent:!0})),i.DEFAULT=i.POSITION_NORMAL_AND_ST,i.packedLength=6,i.pack=function(e,n,r){return r=t(r,0),n[r++]=e.position?1:0,n[r++]=e.normal?1:0,n[r++]=e.st?1:0,n[r++]=e.binormal?1:0,n[r++]=e.tangent?1:0,n[r++]=e.color?1:0,n},i.unpack=function(n,r,a){return r=t(r,0),e(a)||(a=new i),a.position=1===n[r++],a.normal=1===n[r++],a.st=1===n[r++],a.binormal=1===n[r++],a.tangent=1===n[r++],a.color=1===n[r++],a},i.clone=function(t,n){if(e(t))return e(n)||(n=new i),n.position=t.position,n.normal=t.normal,n.st=t.st,n.binormal=t.binormal,n.tangent=t.tangent,n.color=t.color,n},i}),define("Core/EllipsoidGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./VertexFormat"],function(t,e,n,r,i,a,o,u,E,s,c,_,l,T,R){"use strict";function f(t){t=i(t,i.EMPTY_OBJECT);var e=i(t.radii,S),r=i(t.stackPartitions,64),a=i(t.slicePartitions,64),o=i(t.vertexFormat,R.DEFAULT);this._radii=n.clone(e),this._stackPartitions=r,this._slicePartitions=a,this._vertexFormat=R.clone(o),this._workerName="createEllipsoidGeometry"}var A=new n,h=new n,N=new n,d=new n,I=new n,S=new n(1,1,1),m=Math.cos,M=Math.sin;f.packedLength=n.packedLength+R.packedLength+2,f.pack=function(t,e,r){return r=i(r,0),n.pack(t._radii,e,r),r+=n.packedLength,R.pack(t._vertexFormat,e,r),r+=R.packedLength,e[r++]=t._stackPartitions,e[r]=t._slicePartitions,e};var y=new n,O=new R,p={radii:y,vertexFormat:O,stackPartitions:void 0,slicePartitions:void 0};return f.unpack=function(t,e,r){e=i(e,0);var o=n.unpack(t,e,y);e+=n.packedLength;var u=R.unpack(t,e,O);e+=R.packedLength;var E=t[e++],s=t[e];return a(r)?(r._radii=n.clone(o,r._radii),r._vertexFormat=R.clone(u,r._vertexFormat),r._stackPartitions=E,r._slicePartitions=s,r):(p.stackPartitions=E,p.slicePartitions=s,new f(p))},f.createGeometry=function(i){var a=i._radii;if(!(a.x<=0||a.y<=0||a.z<=0)){var o,R,f=u.fromCartesian3(a),S=i._vertexFormat,y=i._slicePartitions+1,O=i._stackPartitions+1,p=O*y,C=new Float64Array(3*p),U=6*(y-1)*(O-2),L=_.createTypedArray(p,U),F=S.normal?new Float32Array(3*p):void 0,P=S.tangent?new Float32Array(3*p):void 0,v=S.binormal?new Float32Array(3*p):void 0,w=S.st?new Float32Array(2*p):void 0,x=new Array(y),g=new Array(y),D=0;for(o=0;o<y;o++){var B=l.TWO_PI*o/(y-1);x[o]=m(B),g[o]=M(B),C[D++]=0,C[D++]=0,C[D++]=a.z}for(o=1;o<O-1;o++){var z=Math.PI*o/(O-1),G=M(z),b=a.x*G,X=a.y*G,V=a.z*m(z);for(R=0;R<y;R++)C[D++]=x[R]*b,C[D++]=g[R]*X,C[D++]=V}for(o=0;o<y;o++)C[D++]=0,C[D++]=0,C[D++]=-a.z;var q=new c;S.position&&(q.position=new s({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:C}));var H=0,W=0,Y=0,k=0;if(S.st||S.normal||S.tangent||S.binormal){for(o=0;o<p;o++){var K=n.fromArray(C,3*o,A),Z=f.geodeticSurfaceNormal(K,h);if(S.st){var j=e.negate(Z,I);e.magnitude(j)<l.EPSILON6&&(D=3*(o+y*Math.floor(.5*O)),D>C.length&&(D=3*(o-y*Math.floor(.5*O))),n.fromArray(C,D,j),f.geodeticSurfaceNormal(j,j),e.negate(j,j)),w[H++]=Math.atan2(j.y,j.x)/l.TWO_PI+.5,w[H++]=Math.asin(Z.z)/Math.PI+.5}if(S.normal&&(F[W++]=Z.x,F[W++]=Z.y,F[W++]=Z.z),S.tangent||S.binormal){var Q=N;if(o<y||o>p-y-1?(n.cross(n.UNIT_X,Z,Q),n.normalize(Q,Q)):(n.cross(n.UNIT_Z,Z,Q),n.normalize(Q,Q)),S.tangent&&(P[Y++]=Q.x,P[Y++]=Q.y,P[Y++]=Q.z),S.binormal){var J=n.cross(Z,Q,d);n.normalize(J,J),v[k++]=J.x,v[k++]=J.y,v[k++]=J.z}}}S.st&&(q.st=new s({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:w})),S.normal&&(q.normal=new s({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:F})),S.tangent&&(q.tangent=new s({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:P})),S.binormal&&(q.binormal=new s({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:v}))}for(D=0,R=0;R<y-1;R++)L[D++]=y+R,L[D++]=y+R+1,L[D++]=R+1;var $,tt;for(o=1;o<O-2;o++)for($=o*y,tt=(o+1)*y,R=0;R<y-1;R++)L[D++]=tt+R,L[D++]=tt+R+1,L[D++]=$+R+1,L[D++]=tt+R,L[D++]=$+R+1,L[D++]=$+R;for(o=O-2,$=o*y,tt=(o+1)*y,R=0;R<y-1;R++)L[D++]=tt+R,L[D++]=$+R+1,L[D++]=$+R;return new E({attributes:q,indices:L,primitiveType:T.TRIANGLES,boundingSphere:t.fromEllipsoid(f)})}},f}),define("Core/SphereGeometry",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./EllipsoidGeometry","./VertexFormat"],function(t,e,n,r,i,a){"use strict";function o(n){var r=e(n.radius,1),a=new t(r,r,r),o={radii:a,stackPartitions:n.stackPartitions,slicePartitions:n.slicePartitions,vertexFormat:n.vertexFormat};this._ellipsoidGeometry=new i(o),this._workerName="createSphereGeometry"}o.packedLength=i.packedLength,o.pack=function(t,e,n){return i.pack(t._ellipsoidGeometry,e,n)};var u=new i,E={radius:void 0,radii:new t,vertexFormat:new a,stackPartitions:void 0,slicePartitions:void 0};return o.unpack=function(e,r,s){var c=i.unpack(e,r,u);return E.vertexFormat=a.clone(c._vertexFormat,E.vertexFormat),E.stackPartitions=c._stackPartitions,E.slicePartitions=c._slicePartitions,n(s)?(t.clone(c._radii,E.radii),s._ellipsoidGeometry=new i(E),s):(E.radius=c._radii.x,new o(E))},o.createGeometry=function(t){return i.createGeometry(t._ellipsoidGeometry)},o}),define("Workers/createSphereGeometry",["../Core/defined","../Core/SphereGeometry"],function(t,e){"use strict";return function(n,r){return t(r)&&(n=e.unpack(n,r)),e.createGeometry(n)}})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function t(t){return void 0!==t&&null!==t}return t}),define("Core/DeveloperError",["./defined"],function(t){"use strict";function e(t){this.name="DeveloperError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e.throwInstantiationError=function(){throw new e("This function defines an interface and should not be called directly.")},e}),define("Core/Check",["./defined","./DeveloperError"],function(t,e){"use strict";function n(t){return t+" is required, actual value was undefined"}function r(t,e,n){return"Expected "+n+" to be typeof "+e+", actual typeof was "+t}var a={};return a.typeOf={},a.defined=function(r,a){if(!t(a))throw new e(n(r))},a.typeOf.func=function(t,n){if("function"!=typeof n)throw new e(r(typeof n,"function",t))},a.typeOf.string=function(t,n){if("string"!=typeof n)throw new e(r(typeof n,"string",t))},a.typeOf.number=function(t,n){if("number"!=typeof n)throw new e(r(typeof n,"number",t))},a.typeOf.number.lessThan=function(t,n,r){if(a.typeOf.number(t,n),n>=r)throw new e("Expected "+t+" to be less than "+r+", actual value was "+n)},a.typeOf.number.lessThanOrEquals=function(t,n,r){if(a.typeOf.number(t,n),n>r)throw new e("Expected "+t+" to be less than or equal to "+r+", actual value was "+n)},a.typeOf.number.greaterThan=function(t,n,r){if(a.typeOf.number(t,n),n<=r)throw new e("Expected "+t+" to be greater than "+r+", actual value was "+n)},a.typeOf.number.greaterThanOrEquals=function(t,n,r){if(a.typeOf.number(t,n),n<r)throw new e("Expected "+t+" to be greater than or equal to"+r+", actual value was "+n)},a.typeOf.object=function(t,n){if("object"!=typeof n)throw new e(r(typeof n,"object",t))},a.typeOf.bool=function(t,n){if("boolean"!=typeof n)throw new e(r(typeof n,"boolean",t))},a}),define("Core/freezeObject",["./defined"],function(t){"use strict";var e=Object.freeze;return t(e)||(e=function(t){return t}),e}),define("Core/defaultValue",["./freezeObject"],function(t){"use strict";function e(t,e){return void 0!==t?t:e}return e.EMPTY_OBJECT=t({}),e}),define("ThirdParty/mersenne-twister",[],function(){var t=function(t){void 0==t&&(t=(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(t)};return t.prototype.init_genrand=function(t){for(this.mt[0]=t>>>0,this.mti=1;this.mti<this.N;this.mti++){var t=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&t)>>>16)<<16)+1812433253*(65535&t)+this.mti,this.mt[this.mti]>>>=0}},t.prototype.genrand_int32=function(){var t,e=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)t=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^t>>>1^e[1&t];for(;n<this.N-1;n++)t=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^t>>>1^e[1&t];t=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^t>>>1^e[1&t],this.mti=0}return t=this.mt[this.mti++],t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,t^=t>>>18,t>>>0},t.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},t}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(t,e,n,r){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(t){return t>0?1:t<0?-1:0},a.signNotZero=function(t){return t<0?-1:1},a.toSNorm=function(t,n){return n=e(n,255),Math.round((.5*a.clamp(t,-1,1)+.5)*n)},a.fromSNorm=function(t,n){return n=e(n,255),a.clamp(t,0,n)/n*2-1},a.sinh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e-n)},a.cosh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e+n)},a.lerp=function(t,e,n){return(1-n)*t+n*e},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(t){return t*a.RADIANS_PER_DEGREE},a.toDegrees=function(t){return t*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(t){var e=a.TWO_PI,n=t-Math.floor(t/e)*e;return n<-Math.PI?n+e:n>=Math.PI?n-e:n},a.clampToLatitudeRange=function(t){return a.clamp(t,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(t){return a.zeroToTwoPi(t+a.PI)-a.PI},a.zeroToTwoPi=function(t){var e=a.mod(t,a.TWO_PI);return Math.abs(e)<a.EPSILON14&&Math.abs(t)>a.EPSILON14?a.TWO_PI:e},a.mod=function(t,e){return(t%e+e)%e},a.equalsEpsilon=function(t,n,r,a){a=e(a,r);var i=Math.abs(t-n);return i<=a||i<=r*Math.max(Math.abs(t),Math.abs(n))};var i=[1];a.factorial=function(t){var e=i.length;if(t>=e)for(var n=i[e-1],r=e;r<=t;r++)i.push(n*r);return i[t]},a.incrementWrap=function(t,n,r){return r=e(r,0),++t,t>n&&(t=r),t},a.isPowerOfTwo=function(t){return 0!==t&&0===(t&t-1)},a.nextPowerOfTwo=function(t){return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t,t},a.clamp=function(t,e,n){return t<e?e:t>n?n:t};var o=new t;return a.setRandomNumberSeed=function(e){o=new t(e)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(t){return Math.acos(a.clamp(t,-1,1))},a.asinClamped=function(t){return Math.asin(a.clamp(t,-1,1))},a.chordLength=function(t,e){return 2*e*Math.sin(.5*t)},a.logBase=function(t,e){return Math.log(t)/Math.log(e)},a.fog=function(t,e){var n=t*e;return 1-Math.exp(-(n*n))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,a,i){"use strict";function o(t,n,r){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0)}o.fromSpherical=function(t,r){n(r)||(r=new o);var a=t.clock,i=t.cone,u=e(t.magnitude,1),E=u*Math.sin(i);return r.x=E*Math.cos(a),r.y=E*Math.sin(a),r.z=u*Math.cos(i),r},o.fromElements=function(t,e,r,a){return n(a)?(a.x=t,a.y=e,a.z=r,a):new o(t,e,r)},o.clone=function(t,e){if(n(t))return n(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e):new o(t.x,t.y,t.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r]=t.z,n},o.unpack=function(t,r,a){return r=e(r,0),n(a)||(a=new o),a.x=t[r++],a.y=t[r++],a.z=t[r],a},o.packArray=function(t,e){var r=t.length;n(e)?e.length=3*r:e=new Array(3*r);for(var a=0;a<r;++a)o.pack(t[a],e,3*a);return e},o.unpackArray=function(t,e){var r=t.length;n(e)?e.length=r/3:e=new Array(r/3);for(var a=0;a<r;a+=3){var i=a/3;e[i]=o.unpack(t,a,e[i])}return e},o.fromArray=o.unpack,o.maximumComponent=function(t){return Math.max(t.x,t.y,t.z)},o.minimumComponent=function(t){return Math.min(t.x,t.y,t.z)},o.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n.z=Math.min(t.z,e.z),n},o.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n.z=Math.max(t.z,e.z),n},o.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z},o.magnitude=function(t){return Math.sqrt(o.magnitudeSquared(t))};var u=new o;o.distance=function(t,e){return o.subtract(t,e,u),o.magnitude(u)},o.distanceSquared=function(t,e){return o.subtract(t,e,u),o.magnitudeSquared(u)},o.normalize=function(t,e){var n=o.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e},o.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},o.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n.z=t.z*e.z,n},o.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n.z=t.z/e.z,n},o.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n},o.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n},o.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*e,n},o.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n},o.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e},o.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e};var E=new o;o.lerp=function(t,e,n,r){return o.multiplyByScalar(e,n,E),r=o.multiplyByScalar(t,1-n,r),o.add(E,r,r)};var s=new o,c=new o;o.angleBetween=function(t,e){o.normalize(t,s),o.normalize(e,c);var n=o.dot(s,c),r=o.magnitude(o.cross(s,c,s));return Math.atan2(r,n)};var _=new o;o.mostOrthogonalAxis=function(t,e){var n=o.normalize(t,_);return o.abs(n,n),e=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,e):o.clone(o.UNIT_Z,e):n.y<=n.z?o.clone(o.UNIT_Y,e):o.clone(o.UNIT_Z,e)},o.equals=function(t,e){return t===e||n(t)&&n(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z},o.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]},o.equalsEpsilon=function(t,e,r,a){return t===e||n(t)&&n(e)&&i.equalsEpsilon(t.x,e.x,r,a)&&i.equalsEpsilon(t.y,e.y,r,a)&&i.equalsEpsilon(t.z,e.z,r,a)},o.cross=function(t,e,n){var r=t.x,a=t.y,i=t.z,o=e.x,u=e.y,E=e.z,s=a*E-i*u,c=i*o-r*E,_=r*u-a*o;return n.x=s,n.y=c,n.z=_,n},o.fromDegrees=function(t,e,n,r,a){return t=i.toRadians(t),e=i.toRadians(e),o.fromRadians(t,e,n,r,a)};var T=new o,l=new o,R=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(t,r,a,i,u){a=e(a,0);var E=n(i)?i.radiiSquared:R,s=Math.cos(r);T.x=s*Math.cos(t),T.y=s*Math.sin(t),T.z=Math.sin(r),T=o.normalize(T,T),o.multiplyComponents(E,T,l);var c=Math.sqrt(o.dot(T,l));return l=o.divideByScalar(l,c,l),T=o.multiplyByScalar(T,a,T),n(u)||(u=new o),o.add(l,T,u)},o.fromDegreesArray=function(t,e,r){var a=t.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=t[i],E=t[i+1],s=i/2;r[s]=o.fromDegrees(u,E,0,e,r[s])}return r},o.fromRadiansArray=function(t,e,r){var a=t.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=t[i],E=t[i+1],s=i/2;r[s]=o.fromRadians(u,E,0,e,r[s])}return r},o.fromDegreesArrayHeights=function(t,e,r){var a=t.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=t[i],E=t[i+1],s=t[i+2],c=i/3;r[c]=o.fromDegrees(u,E,s,e,r[c])}return r},o.fromRadiansArrayHeights=function(t,e,r){var a=t.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=t[i],E=t[i+1],s=t[i+2],c=i/3;r[c]=o.fromRadians(u,E,s,e,r[c])}return r},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(new o(0,0,1)),o.prototype.clone=function(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.prototype.equalsEpsilon=function(t,e,n){return o.equalsEpsilon(this,t,e,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(t,e,n,r){"use strict";function a(n,a,u,E,s){var c=n.x,_=n.y,T=n.z,l=a.x,R=a.y,f=a.z,A=c*c*l*l,h=_*_*R*R,N=T*T*f*f,d=A+h+N,I=Math.sqrt(1/d),S=t.multiplyByScalar(n,I,i);if(d<E)return isFinite(I)?t.clone(S,s):void 0;var m=u.x,M=u.y,O=u.z,y=o;y.x=S.x*m*2,y.y=S.y*M*2,y.z=S.z*O*2;var p,C,U,L,F,P,w,g,v,x,D,B=(1-I)*t.magnitude(n)/(.5*t.magnitude(y)),z=0;do{B-=z,U=1/(1+B*m),L=1/(1+B*M),F=1/(1+B*O),P=U*U,w=L*L,g=F*F,v=P*U,x=w*L,D=g*F,p=A*P+h*w+N*g-1,C=A*v*m+h*x*M+N*D*O;var G=-2*C;z=p/G}while(Math.abs(p)>r.EPSILON12);return e(s)?(s.x=c*U,s.y=_*L,s.z=T*F,s):new t(c*U,_*L,T*F)}var i=new t,o=new t;return a}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,n,r,a,i,o){"use strict";function u(t,n,r){this.longitude=e(t,0),this.latitude=e(n,0),this.height=e(r,0)}u.fromRadians=function(t,r,a,i){return a=e(a,0),n(i)?(i.longitude=t,i.latitude=r,i.height=a,i):new u(t,r,a)},u.fromDegrees=function(t,e,n,r){return t=i.toRadians(t),e=i.toRadians(e),u.fromRadians(t,e,n,r)};var E=new t,s=new t,c=new t,_=new t(1/6378137,1/6378137,1/6356752.314245179),T=new t(1/40680631590769,1/40680631590769,1/40408299984661.445),l=i.EPSILON1;return u.fromCartesian=function(e,r,a){var R=n(r)?r.oneOverRadii:_,f=n(r)?r.oneOverRadiiSquared:T,A=n(r)?r._centerToleranceSquared:l,h=o(e,R,f,A,s);if(n(h)){var N=t.multiplyComponents(h,f,E);N=t.normalize(N,N);var d=t.subtract(e,h,c),I=Math.atan2(N.y,N.x),S=Math.asin(N.z),m=i.sign(t.dot(d,e))*t.magnitude(d);return n(a)?(a.longitude=I,a.latitude=S,a.height=m,a):new u(I,S,m)}},u.clone=function(t,e){if(n(t))return n(e)?(e.longitude=t.longitude,e.latitude=t.latitude,e.height=t.height,e):new u(t.longitude,t.latitude,t.height)},u.equals=function(t,e){return t===e||n(t)&&n(e)&&t.longitude===e.longitude&&t.latitude===e.latitude&&t.height===e.height},u.equalsEpsilon=function(t,e,r){return t===e||n(t)&&n(e)&&Math.abs(t.longitude-e.longitude)<=r&&Math.abs(t.latitude-e.latitude)<=r&&Math.abs(t.height-e.height)<=r},u.ZERO=a(new u(0,0,0)),u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.prototype.equalsEpsilon=function(t,e){return u.equalsEpsilon(this,t,e)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(t){"use strict";var e=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(t){return!1}}(),n=Object.defineProperties;return e&&t(n)||(n=function(t){return t}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,n,r,a,i,o,u,E){"use strict";function s(e,r,a,i){r=n(r,0),a=n(a,0),i=n(i,0),e._radii=new t(r,a,i),e._radiiSquared=new t(r*r,a*a,i*i),e._radiiToTheFourth=new t(r*r*r*r,a*a*a*a,i*i*i*i),e._oneOverRadii=new t(0===r?0:1/r,0===a?0:1/a,0===i?0:1/i),e._oneOverRadiiSquared=new t(0===r?0:1/(r*r),0===a?0:1/(a*a),0===i?0:1/(i*i)),e._minimumRadius=Math.min(r,a,i),e._maximumRadius=Math.max(r,a,i),e._centerToleranceSquared=u.EPSILON1,0!==e._radiiSquared.z&&(e._sqauredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function c(t,e,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,s(this,t,e,n)}a(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(e,n){if(r(e)){var a=e._radii;return r(n)?(t.clone(a,n._radii),t.clone(e._radiiSquared,n._radiiSquared),t.clone(e._radiiToTheFourth,n._radiiToTheFourth),t.clone(e._oneOverRadii,n._oneOverRadii),t.clone(e._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=e._minimumRadius,n._maximumRadius=e._maximumRadius,n._centerToleranceSquared=e._centerToleranceSquared,n):new c(a.x,a.y,a.z)}},c.fromCartesian3=function(t,e){return r(e)||(e=new c),r(t)?(s(e,t.x,t.y,t.z),e):e},c.WGS84=o(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=o(new c(1,1,1)),c.MOON=o(new c(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),c.prototype.clone=function(t){return c.clone(this,t)},c.packedLength=t.packedLength,c.pack=function(e,r,a){return a=n(a,0),t.pack(e._radii,r,a),r},c.unpack=function(e,r,a){r=n(r,0);var i=t.unpack(e,r);return c.fromCartesian3(i,a)},c.prototype.geocentricSurfaceNormal=t.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(e,n){var a=e.longitude,i=e.latitude,o=Math.cos(i),u=o*Math.cos(a),E=o*Math.sin(a),s=Math.sin(i);return r(n)||(n=new t),n.x=u,n.y=E,n.z=s,t.normalize(n,n)},c.prototype.geodeticSurfaceNormal=function(e,n){return r(n)||(n=new t),n=t.multiplyComponents(e,this._oneOverRadiiSquared,n),t.normalize(n,n)};var _=new t,T=new t;c.prototype.cartographicToCartesian=function(e,n){var a=_,i=T;this.geodeticSurfaceNormalCartographic(e,a),t.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(t.dot(a,i));return t.divideByScalar(i,o,i),t.multiplyByScalar(a,e.height,a),r(n)||(n=new t),t.add(i,a,n)},c.prototype.cartographicArrayToCartesianArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var a=0;a<n;a++)e[a]=this.cartographicToCartesian(t[a],e[a]);return e};var l=new t,R=new t,f=new t;return c.prototype.cartesianToCartographic=function(n,a){var i=this.scaleToGeodeticSurface(n,R);if(r(i)){var o=this.geodeticSurfaceNormal(i,l),E=t.subtract(n,i,f),s=Math.atan2(o.y,o.x),c=Math.asin(o.z),_=u.sign(t.dot(E,n))*t.magnitude(E);return r(a)?(a.longitude=s,a.latitude=c,a.height=_,a):new e(s,c,_)}},c.prototype.cartesianArrayToCartographicArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var a=0;a<n;++a)e[a]=this.cartesianToCartographic(t[a],e[a]);return e},c.prototype.scaleToGeodeticSurface=function(t,e){return E(t,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,e)},c.prototype.scaleToGeocentricSurface=function(e,n){r(n)||(n=new t);var a=e.x,i=e.y,o=e.z,u=this._oneOverRadiiSquared,E=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return t.multiplyByScalar(e,E,n)},c.prototype.transformPositionToScaledSpace=function(e,n){return r(n)||(n=new t),t.multiplyComponents(e,this._oneOverRadii,n)},c.prototype.transformPositionFromScaledSpace=function(e,n){return r(n)||(n=new t),t.multiplyComponents(e,this._radii,n)},c.prototype.equals=function(e){return this===e||r(e)&&t.equals(this._radii,e._radii)},c.prototype.toString=function(){return this._radii.toString()},c.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,a,i){a=n(a,0);var o=this._sqauredXOverSquaredZ;if(r(i)||(i=new t),i.x=0,i.y=0,i.z=e.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},c}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(t,e,n,r,a,i,o){"use strict";function u(t){this._ellipsoid=n(t,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(e,n){var a=this._semimajorAxis,i=e.longitude*a,o=e.latitude*a,u=e.height;return r(n)?(n.x=i,n.y=o,n.z=u,n):new t(i,o,u)},u.prototype.unproject=function(t,n){var a=this._oneOverSemimajorAxis,i=t.x*a,o=t.y*a,u=t.z;return r(n)?(n.longitude=i,n.latitude=o,n.height=u,n):new e(i,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(t){"use strict";var e={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return t(e)}),define("Core/Interval",["./defaultValue"],function(t){"use strict";function e(e,n){this.start=t(e,0),this.stop=t(n,0)}return e}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,a,i,o,u){"use strict";function E(t,e,r,a,i,o,u,E,s){this[0]=n(t,0),this[1]=n(a,0),this[2]=n(u,0),this[3]=n(e,0),this[4]=n(i,0),this[5]=n(E,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(s,0)}function s(t){for(var e=0,n=0;n<9;++n){var r=t[n];e+=r*r}return Math.sqrt(e)}function c(t){for(var e=0,n=0;n<3;++n){var r=t[E.getElementIndex(f[n],R[n])];e+=2*r*r}return Math.sqrt(e)}function _(t,e){for(var n=u.EPSILON15,r=0,a=1,i=0;i<3;++i){var o=Math.abs(t[E.getElementIndex(f[i],R[i])]);o>r&&(a=i,r=o)}var s=1,c=0,_=R[a],T=f[a];if(Math.abs(t[E.getElementIndex(T,_)])>n){var l,A=t[E.getElementIndex(T,T)],h=t[E.getElementIndex(_,_)],N=t[E.getElementIndex(T,_)],d=(A-h)/2/N;l=d<0?-1/(-d+Math.sqrt(1+d*d)):1/(d+Math.sqrt(1+d*d)),s=1/Math.sqrt(1+l*l),c=l*s}return e=E.clone(E.IDENTITY,e),e[E.getElementIndex(_,_)]=e[E.getElementIndex(T,T)]=s,e[E.getElementIndex(T,_)]=c,e[E.getElementIndex(_,T)]=-c,e}E.packedLength=9,E.pack=function(t,e,r){return r=n(r,0),e[r++]=t[0],e[r++]=t[1],e[r++]=t[2],e[r++]=t[3],e[r++]=t[4],e[r++]=t[5],e[r++]=t[6],e[r++]=t[7],e[r++]=t[8],e},E.unpack=function(t,e,a){return e=n(e,0),r(a)||(a=new E),a[0]=t[e++],a[1]=t[e++],a[2]=t[e++],a[3]=t[e++],a[4]=t[e++],a[5]=t[e++],a[6]=t[e++],a[7]=t[e++],a[8]=t[e++],a},E.clone=function(t,e){if(r(t))return r(e)?(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):new E(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8])},E.fromArray=function(t,e,a){return e=n(e,0),r(a)||(a=new E),a[0]=t[e],a[1]=t[e+1],a[2]=t[e+2],a[3]=t[e+3],a[4]=t[e+4],a[5]=t[e+5],a[6]=t[e+6],a[7]=t[e+7],a[8]=t[e+8],a},E.fromColumnMajorArray=function(t,e){return E.clone(t,e)},E.fromRowMajorArray=function(t,e){return r(e)?(e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],e):new E(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},E.fromQuaternion=function(t,e){var n=t.x*t.x,a=t.x*t.y,i=t.x*t.z,o=t.x*t.w,u=t.y*t.y,s=t.y*t.z,c=t.y*t.w,_=t.z*t.z,T=t.z*t.w,l=t.w*t.w,R=n-u-_+l,f=2*(a-T),A=2*(i+c),h=2*(a+T),N=-n+u-_+l,d=2*(s-o),I=2*(i-c),S=2*(s+o),m=-n-u+_+l;return r(e)?(e[0]=R,e[1]=h,e[2]=I,e[3]=f,e[4]=N,e[5]=S,e[6]=A,e[7]=d,e[8]=m,e):new E(R,f,A,h,N,d,I,S,m)},E.fromHeadingPitchRoll=function(t,e){var n=Math.cos(-t.pitch),a=Math.cos(-t.heading),i=Math.cos(t.roll),o=Math.sin(-t.pitch),u=Math.sin(-t.heading),s=Math.sin(t.roll),c=n*a,_=-i*u+s*o*a,T=s*u+i*o*a,l=n*u,R=i*a+s*o*u,f=-o*i+i*o*u,A=-o,h=s*n,N=i*n;return r(e)?(e[0]=c,e[1]=l,e[2]=A,e[3]=_,e[4]=R,e[5]=h,e[6]=T,e[7]=f,e[8]=N,e):new E(c,_,T,l,R,f,A,h,N)},E.fromScale=function(t,e){return r(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=t.y,e[5]=0,e[6]=0,e[7]=0,e[8]=t.z,e):new E(t.x,0,0,0,t.y,0,0,0,t.z)},E.fromUniformScale=function(t,e){return r(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=t,e[5]=0,e[6]=0,e[7]=0,e[8]=t,e):new E(t,0,0,0,t,0,0,0,t)},E.fromCrossProduct=function(t,e){return r(e)?(e[0]=0,e[1]=t.z,e[2]=-t.y,e[3]=-t.z,e[4]=0,e[5]=t.x,e[6]=t.y,e[7]=-t.x,e[8]=0,e):new E(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},E.fromRotationX=function(t,e){var n=Math.cos(t),a=Math.sin(t);return r(e)?(e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=n,e[5]=a,e[6]=0,e[7]=-a,e[8]=n,e):new E(1,0,0,0,n,-a,0,a,n)},E.fromRotationY=function(t,e){var n=Math.cos(t),a=Math.sin(t);return r(e)?(e[0]=n,e[1]=0,e[2]=-a,e[3]=0,e[4]=1,e[5]=0,e[6]=a,e[7]=0,e[8]=n,e):new E(n,0,a,0,1,0,-a,0,n)},E.fromRotationZ=function(t,e){var n=Math.cos(t),a=Math.sin(t);return r(e)?(e[0]=n,e[1]=a,e[2]=0,e[3]=-a,e[4]=n,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e):new E(n,-a,0,a,n,0,0,0,1)},E.toArray=function(t,e){return r(e)?(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):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},E.getElementIndex=function(t,e){return 3*t+e},E.getColumn=function(t,e,n){var r=3*e,a=t[r],i=t[r+1],o=t[r+2];return n.x=a,n.y=i,n.z=o,n},E.setColumn=function(t,e,n,r){r=E.clone(t,r);var a=3*e;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},E.getRow=function(t,e,n){var r=t[e],a=t[e+3],i=t[e+6];return n.x=r,n.y=a,n.z=i,n},E.setRow=function(t,e,n,r){return r=E.clone(t,r),r[e]=n.x,r[e+3]=n.y,r[e+6]=n.z,r};var T=new t;E.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],T)),n.y=t.magnitude(t.fromElements(e[3],e[4],e[5],T)),n.z=t.magnitude(t.fromElements(e[6],e[7],e[8],T)),n};var l=new t;E.getMaximumScale=function(e){return E.getScale(e,l),t.maximumComponent(l)},E.multiply=function(t,e,n){var r=t[0]*e[0]+t[3]*e[1]+t[6]*e[2],a=t[1]*e[0]+t[4]*e[1]+t[7]*e[2],i=t[2]*e[0]+t[5]*e[1]+t[8]*e[2],o=t[0]*e[3]+t[3]*e[4]+t[6]*e[5],u=t[1]*e[3]+t[4]*e[4]+t[7]*e[5],E=t[2]*e[3]+t[5]*e[4]+t[8]*e[5],s=t[0]*e[6]+t[3]*e[7]+t[6]*e[8],c=t[1]*e[6]+t[4]*e[7]+t[7]*e[8],_=t[2]*e[6]+t[5]*e[7]+t[8]*e[8];return n[0]=r,n[1]=a,n[2]=i,n[3]=o,n[4]=u,n[5]=E,n[6]=s,n[7]=c,n[8]=_,n},E.add=function(t,e,n){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n[4]=t[4]+e[4],n[5]=t[5]+e[5],n[6]=t[6]+e[6],n[7]=t[7]+e[7],n[8]=t[8]+e[8],n},E.subtract=function(t,e,n){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n[4]=t[4]-e[4],n[5]=t[5]-e[5],n[6]=t[6]-e[6],n[7]=t[7]-e[7],n[8]=t[8]-e[8],n},E.multiplyByVector=function(t,e,n){var r=e.x,a=e.y,i=e.z,o=t[0]*r+t[3]*a+t[6]*i,u=t[1]*r+t[4]*a+t[7]*i,E=t[2]*r+t[5]*a+t[8]*i;return n.x=o,n.y=u,n.z=E,n},E.multiplyByScalar=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n[4]=t[4]*e,n[5]=t[5]*e,n[6]=t[6]*e,n[7]=t[7]*e,n[8]=t[8]*e,n},E.multiplyByScale=function(t,e,n){return n[0]=t[0]*e.x,n[1]=t[1]*e.x,n[2]=t[2]*e.x,n[3]=t[3]*e.y,n[4]=t[4]*e.y,n[5]=t[5]*e.y,n[6]=t[6]*e.z,n[7]=t[7]*e.z,n[8]=t[8]*e.z,n},E.negate=function(t,e){return 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},E.transpose=function(t,e){var n=t[0],r=t[3],a=t[6],i=t[1],o=t[4],u=t[7],E=t[2],s=t[5],c=t[8];return e[0]=n,e[1]=r,e[2]=a,e[3]=i,e[4]=o,e[5]=u,e[6]=E,e[7]=s,e[8]=c,e};var R=[1,0,0],f=[2,2,1],A=new E,h=new E;return E.computeEigenDecomposition=function(t,e){var n=u.EPSILON20,a=10,i=0,o=0;r(e)||(e={});for(var T=e.unitary=E.clone(E.IDENTITY,e.unitary),l=e.diagonal=E.clone(t,e.diagonal),R=n*s(l);o<a&&c(l)>R;)_(l,A),E.transpose(A,h),E.multiply(l,A,l),E.multiply(h,l,l),E.multiply(T,A,T),++i>2&&(++o,i=0);return e},E.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e},E.determinant=function(t){var e=t[0],n=t[3],r=t[6],a=t[1],i=t[4],o=t[7],u=t[2],E=t[5],s=t[8];return e*(i*s-E*o)+a*(E*r-n*s)+u*(n*o-i*r)},E.inverse=function(t,e){var n=t[0],r=t[1],a=t[2],i=t[3],o=t[4],u=t[5],s=t[6],c=t[7],_=t[8],T=E.determinant(t);e[0]=o*_-c*u,e[1]=c*a-r*_,e[2]=r*u-o*a,e[3]=s*u-i*_,e[4]=n*_-s*a,e[5]=i*a-n*u,e[6]=i*c-s*o,e[7]=s*r-n*c,e[8]=n*o-i*r;var l=1/T;return E.multiplyByScalar(e,l,e)},E.equals=function(t,e){return t===e||r(t)&&r(e)&&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]},E.equalsEpsilon=function(t,e,n){return t===e||r(t)&&r(e)&&Math.abs(t[0]-e[0])<=n&&Math.abs(t[1]-e[1])<=n&&Math.abs(t[2]-e[2])<=n&&Math.abs(t[3]-e[3])<=n&&Math.abs(t[4]-e[4])<=n&&Math.abs(t[5]-e[5])<=n&&Math.abs(t[6]-e[6])<=n&&Math.abs(t[7]-e[7])<=n&&Math.abs(t[8]-e[8])<=n},E.IDENTITY=o(new E(1,0,0,0,1,0,0,0,1)),E.ZERO=o(new E(0,0,0,0,0,0,0,0,0)),E.COLUMN0ROW0=0,E.COLUMN0ROW1=1,E.COLUMN0ROW2=2,E.COLUMN1ROW0=3,E.COLUMN1ROW1=4,E.COLUMN1ROW2=5,E.COLUMN2ROW0=6,E.COLUMN2ROW1=7,E.COLUMN2ROW2=8,a(E.prototype,{length:{get:function(){return E.packedLength}}}),E.prototype.clone=function(t){return E.clone(this,t)},E.prototype.equals=function(t){return E.equals(this,t)},E.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]&&t[4]===e[n+4]&&t[5]===e[n+5]&&t[6]===e[n+6]&&t[7]===e[n+7]&&t[8]===e[n+8]},E.prototype.equalsEpsilon=function(t,e){return E.equalsEpsilon(this,t,e)},E.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},E}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,a,i){"use strict";function o(t,n,r,a){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0),this.w=e(a,0)}o.fromElements=function(t,e,r,a,i){return n(i)?(i.x=t,i.y=e,i.z=r,i.w=a,i):new o(t,e,r,a)},o.fromColor=function(t,e){return n(e)?(e.x=t.red,e.y=t.green,e.z=t.blue,e.w=t.alpha,e):new o(t.red,t.green,t.blue,t.alpha)},o.clone=function(t,e){if(n(t))return n(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e):new o(t.x,t.y,t.z,t.w)},o.packedLength=4,o.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w,n},o.unpack=function(t,r,a){return r=e(r,0),n(a)||(a=new o),a.x=t[r++],a.y=t[r++],a.z=t[r++],a.w=t[r],a},o.packArray=function(t,e){var r=t.length;n(e)?e.length=4*r:e=new Array(4*r);for(var a=0;a<r;++a)o.pack(t[a],e,4*a);return e},o.unpackArray=function(t,e){var r=t.length;n(e)?e.length=r/4:e=new Array(r/4);for(var a=0;a<r;a+=4){var i=a/4;e[i]=o.unpack(t,a,e[i])}return e},o.fromArray=o.unpack,o.maximumComponent=function(t){return Math.max(t.x,t.y,t.z,t.w)},o.minimumComponent=function(t){return Math.min(t.x,t.y,t.z,t.w)},o.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n.z=Math.min(t.z,e.z),n.w=Math.min(t.w,e.w),n},o.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n.z=Math.max(t.z,e.z),n.w=Math.max(t.w,e.w),n},o.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w},o.magnitude=function(t){return Math.sqrt(o.magnitudeSquared(t))};var u=new o;o.distance=function(t,e){return o.subtract(t,e,u),o.magnitude(u)},o.distanceSquared=function(t,e){return o.subtract(t,e,u),o.magnitudeSquared(u)},o.normalize=function(t,e){var n=o.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e.w=t.w/n,e},o.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z+t.w*e.w},o.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n.z=t.z*e.z,n.w=t.w*e.w,n},o.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n.z=t.z/e.z,n.w=t.w/e.w,n},o.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n.w=t.w+e.w,n},o.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n.w=t.w-e.w,n},o.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*e,n.w=t.w*e,n},o.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n.w=t.w/e,n},o.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e.w=-t.w,e},o.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e.w=Math.abs(t.w),e};var E=new o;o.lerp=function(t,e,n,r){return o.multiplyByScalar(e,n,E),r=o.multiplyByScalar(t,1-n,r),o.add(E,r,r)};var s=new o;return o.mostOrthogonalAxis=function(t,e){var n=o.normalize(t,s);return o.abs(n,n),e=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,e):o.clone(o.UNIT_W,e):n.z<=n.w?o.clone(o.UNIT_Z,e):o.clone(o.UNIT_W,e):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,e):o.clone(o.UNIT_W,e):n.z<=n.w?o.clone(o.UNIT_Z,e):o.clone(o.UNIT_W,e)},o.equals=function(t,e){return t===e||n(t)&&n(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z&&t.w===e.w},o.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]&&t.w===e[n+3]},o.equalsEpsilon=function(t,e,r,a){return t===e||n(t)&&n(e)&&i.equalsEpsilon(t.x,e.x,r,a)&&i.equalsEpsilon(t.y,e.y,r,a)&&i.equalsEpsilon(t.z,e.z,r,a)&&i.equalsEpsilon(t.w,e.w,r,a)},o.ZERO=a(new o(0,0,0,0)),o.UNIT_X=a(new o(1,0,0,0)),o.UNIT_Y=a(new o(0,1,0,0)),o.UNIT_Z=a(new o(0,0,1,0)),o.UNIT_W=a(new o(0,0,0,1)),o.prototype.clone=function(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.prototype.equalsEpsilon=function(t,e,n){return o.equalsEpsilon(this,t,e,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(t){"use strict";function e(t){this.name="RuntimeError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(t,e,n,r,a,i,o,u,E,s,c){ +"use strict";function _(t,e,n,a,i,o,u,E,s,c,_,T,l,R,f,A){this[0]=r(t,0),this[1]=r(i,0),this[2]=r(s,0),this[3]=r(l,0),this[4]=r(e,0),this[5]=r(o,0),this[6]=r(c,0),this[7]=r(R,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(_,0),this[11]=r(f,0),this[12]=r(a,0),this[13]=r(E,0),this[14]=r(T,0),this[15]=r(A,0)}_.packedLength=16,_.pack=function(t,e,n){return n=r(n,0),e[n++]=t[0],e[n++]=t[1],e[n++]=t[2],e[n++]=t[3],e[n++]=t[4],e[n++]=t[5],e[n++]=t[6],e[n++]=t[7],e[n++]=t[8],e[n++]=t[9],e[n++]=t[10],e[n++]=t[11],e[n++]=t[12],e[n++]=t[13],e[n++]=t[14],e[n]=t[15],e},_.unpack=function(t,e,n){return e=r(e,0),a(n)||(n=new _),n[0]=t[e++],n[1]=t[e++],n[2]=t[e++],n[3]=t[e++],n[4]=t[e++],n[5]=t[e++],n[6]=t[e++],n[7]=t[e++],n[8]=t[e++],n[9]=t[e++],n[10]=t[e++],n[11]=t[e++],n[12]=t[e++],n[13]=t[e++],n[14]=t[e++],n[15]=t[e],n},_.clone=function(t,e){if(a(t))return a(e)?(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],e):new _(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15])},_.fromArray=_.unpack,_.fromColumnMajorArray=function(t,e){return _.clone(t,e)},_.fromRowMajorArray=function(t,e){return a(e)?(e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15],e):new _(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},_.fromRotationTranslation=function(e,n,i){return n=r(n,t.ZERO),a(i)?(i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=0,i[4]=e[3],i[5]=e[4],i[6]=e[5],i[7]=0,i[8]=e[6],i[9]=e[7],i[10]=e[8],i[11]=0,i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=1,i):new _(e[0],e[3],e[6],n.x,e[1],e[4],e[7],n.y,e[2],e[5],e[8],n.z,0,0,0,1)},_.fromTranslationQuaternionRotationScale=function(t,e,n,r){a(r)||(r=new _);var i=n.x,o=n.y,u=n.z,E=e.x*e.x,s=e.x*e.y,c=e.x*e.z,T=e.x*e.w,l=e.y*e.y,R=e.y*e.z,f=e.y*e.w,A=e.z*e.z,h=e.z*e.w,N=e.w*e.w,d=E-l-A+N,I=2*(s-h),S=2*(c+f),m=2*(s+h),M=-E+l-A+N,O=2*(R-T),y=2*(c-f),p=2*(R+T),C=-E-l+A+N;return r[0]=d*i,r[1]=m*i,r[2]=y*i,r[3]=0,r[4]=I*o,r[5]=M*o,r[6]=p*o,r[7]=0,r[8]=S*u,r[9]=O*u,r[10]=C*u,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,r},_.fromTranslationRotationScale=function(t,e){return _.fromTranslationQuaternionRotationScale(t.translation,t.rotation,t.scale,e)},_.fromTranslation=function(t,e){return _.fromRotationTranslation(s.IDENTITY,t,e)},_.fromScale=function(t,e){return a(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t.y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t.z,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new _(t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1)},_.fromUniformScale=function(t,e){return a(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new _(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1)};var T=new t,l=new t,R=new t;_.fromCamera=function(e,n){var r=e.position,i=e.direction,o=e.up;t.normalize(i,T),t.normalize(t.cross(T,o,l),l),t.normalize(t.cross(l,T,R),R);var u=l.x,E=l.y,s=l.z,c=T.x,f=T.y,A=T.z,h=R.x,N=R.y,d=R.z,I=r.x,S=r.y,m=r.z,M=u*-I+E*-S+s*-m,O=h*-I+N*-S+d*-m,y=c*I+f*S+A*m;return a(n)?(n[0]=u,n[1]=h,n[2]=-c,n[3]=0,n[4]=E,n[5]=N,n[6]=-f,n[7]=0,n[8]=s,n[9]=d,n[10]=-A,n[11]=0,n[12]=M,n[13]=O,n[14]=y,n[15]=1,n):new _(u,E,s,M,h,N,d,O,-c,-f,-A,y,0,0,0,1)},_.computePerspectiveFieldOfView=function(t,e,n,r,a){var i=Math.tan(.5*t),o=1/i,u=o/e,E=(r+n)/(n-r),s=2*r*n/(n-r);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=E,a[11]=-1,a[12]=0,a[13]=0,a[14]=s,a[15]=0,a},_.computeOrthographicOffCenter=function(t,e,n,r,a,i,o){var u=1/(e-t),E=1/(r-n),s=1/(i-a),c=-(e+t)*u,_=-(r+n)*E,T=-(i+a)*s;return u*=2,E*=2,s*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=s,o[11]=0,o[12]=c,o[13]=_,o[14]=T,o[15]=1,o},_.computePerspectiveOffCenter=function(t,e,n,r,a,i,o){var u=2*a/(e-t),E=2*a/(r-n),s=(e+t)/(e-t),c=(r+n)/(r-n),_=-(i+a)/(i-a),T=-1,l=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=s,o[9]=c,o[10]=_,o[11]=T,o[12]=0,o[13]=0,o[14]=l,o[15]=0,o},_.computeInfinitePerspectiveOffCenter=function(t,e,n,r,a,i){var o=2*a/(e-t),u=2*a/(r-n),E=(e+t)/(e-t),s=(r+n)/(r-n),c=-1,_=-1,T=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=E,i[9]=s,i[10]=c,i[11]=_,i[12]=0,i[13]=0,i[14]=T,i[15]=0,i},_.computeViewportTransformation=function(t,e,n,a){t=r(t,r.EMPTY_OBJECT);var i=r(t.x,0),o=r(t.y,0),u=r(t.width,0),E=r(t.height,0);e=r(e,0),n=r(n,1);var s=.5*u,c=.5*E,_=.5*(n-e),T=s,l=c,R=_,f=i+s,A=o+c,h=e+_,N=1;return a[0]=T,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=l,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=R,a[11]=0,a[12]=f,a[13]=A,a[14]=h,a[15]=N,a},_.computeView=function(e,n,r,a,i){return i[0]=a.x,i[1]=r.x,i[2]=-n.x,i[3]=0,i[4]=a.y,i[5]=r.y,i[6]=-n.y,i[7]=0,i[8]=a.z,i[9]=r.z,i[10]=-n.z,i[11]=0,i[12]=-t.dot(a,e),i[13]=-t.dot(r,e),i[14]=t.dot(n,e),i[15]=1,i},_.toArray=function(t,e){return a(e)?(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],e):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]},_.getElementIndex=function(t,e){return 4*t+e},_.getColumn=function(t,e,n){var r=4*e,a=t[r],i=t[r+1],o=t[r+2],u=t[r+3];return n.x=a,n.y=i,n.z=o,n.w=u,n},_.setColumn=function(t,e,n,r){r=_.clone(t,r);var a=4*e;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r[a+3]=n.w,r},_.setTranslation=function(t,e,n){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=t[15],n},_.getRow=function(t,e,n){var r=t[e],a=t[e+4],i=t[e+8],o=t[e+12];return n.x=r,n.y=a,n.z=i,n.w=o,n},_.setRow=function(t,e,n,r){return r=_.clone(t,r),r[e]=n.x,r[e+4]=n.y,r[e+8]=n.z,r[e+12]=n.w,r};var f=new t;_.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],f)),n.y=t.magnitude(t.fromElements(e[4],e[5],e[6],f)),n.z=t.magnitude(t.fromElements(e[8],e[9],e[10],f)),n};var A=new t;_.getMaximumScale=function(e){return _.getScale(e,A),t.maximumComponent(A)},_.multiply=function(t,e,n){var r=t[0],a=t[1],i=t[2],o=t[3],u=t[4],E=t[5],s=t[6],c=t[7],_=t[8],T=t[9],l=t[10],R=t[11],f=t[12],A=t[13],h=t[14],N=t[15],d=e[0],I=e[1],S=e[2],m=e[3],M=e[4],O=e[5],y=e[6],p=e[7],C=e[8],U=e[9],L=e[10],F=e[11],P=e[12],w=e[13],g=e[14],v=e[15],x=r*d+u*I+_*S+f*m,D=a*d+E*I+T*S+A*m,B=i*d+s*I+l*S+h*m,z=o*d+c*I+R*S+N*m,G=r*M+u*O+_*y+f*p,b=a*M+E*O+T*y+A*p,X=i*M+s*O+l*y+h*p,V=o*M+c*O+R*y+N*p,q=r*C+u*U+_*L+f*F,H=a*C+E*U+T*L+A*F,W=i*C+s*U+l*L+h*F,Y=o*C+c*U+R*L+N*F,k=r*P+u*w+_*g+f*v,K=a*P+E*w+T*g+A*v,Z=i*P+s*w+l*g+h*v,j=o*P+c*w+R*g+N*v;return n[0]=x,n[1]=D,n[2]=B,n[3]=z,n[4]=G,n[5]=b,n[6]=X,n[7]=V,n[8]=q,n[9]=H,n[10]=W,n[11]=Y,n[12]=k,n[13]=K,n[14]=Z,n[15]=j,n},_.add=function(t,e,n){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n[4]=t[4]+e[4],n[5]=t[5]+e[5],n[6]=t[6]+e[6],n[7]=t[7]+e[7],n[8]=t[8]+e[8],n[9]=t[9]+e[9],n[10]=t[10]+e[10],n[11]=t[11]+e[11],n[12]=t[12]+e[12],n[13]=t[13]+e[13],n[14]=t[14]+e[14],n[15]=t[15]+e[15],n},_.subtract=function(t,e,n){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n[4]=t[4]-e[4],n[5]=t[5]-e[5],n[6]=t[6]-e[6],n[7]=t[7]-e[7],n[8]=t[8]-e[8],n[9]=t[9]-e[9],n[10]=t[10]-e[10],n[11]=t[11]-e[11],n[12]=t[12]-e[12],n[13]=t[13]-e[13],n[14]=t[14]-e[14],n[15]=t[15]-e[15],n},_.multiplyTransformation=function(t,e,n){var r=t[0],a=t[1],i=t[2],o=t[4],u=t[5],E=t[6],s=t[8],c=t[9],_=t[10],T=t[12],l=t[13],R=t[14],f=e[0],A=e[1],h=e[2],N=e[4],d=e[5],I=e[6],S=e[8],m=e[9],M=e[10],O=e[12],y=e[13],p=e[14],C=r*f+o*A+s*h,U=a*f+u*A+c*h,L=i*f+E*A+_*h,F=r*N+o*d+s*I,P=a*N+u*d+c*I,w=i*N+E*d+_*I,g=r*S+o*m+s*M,v=a*S+u*m+c*M,x=i*S+E*m+_*M,D=r*O+o*y+s*p+T,B=a*O+u*y+c*p+l,z=i*O+E*y+_*p+R;return n[0]=C,n[1]=U,n[2]=L,n[3]=0,n[4]=F,n[5]=P,n[6]=w,n[7]=0,n[8]=g,n[9]=v,n[10]=x,n[11]=0,n[12]=D,n[13]=B,n[14]=z,n[15]=1,n},_.multiplyByMatrix3=function(t,e,n){var r=t[0],a=t[1],i=t[2],o=t[4],u=t[5],E=t[6],s=t[8],c=t[9],_=t[10],T=e[0],l=e[1],R=e[2],f=e[3],A=e[4],h=e[5],N=e[6],d=e[7],I=e[8],S=r*T+o*l+s*R,m=a*T+u*l+c*R,M=i*T+E*l+_*R,O=r*f+o*A+s*h,y=a*f+u*A+c*h,p=i*f+E*A+_*h,C=r*N+o*d+s*I,U=a*N+u*d+c*I,L=i*N+E*d+_*I;return n[0]=S,n[1]=m,n[2]=M,n[3]=0,n[4]=O,n[5]=y,n[6]=p,n[7]=0,n[8]=C,n[9]=U,n[10]=L,n[11]=0,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n},_.multiplyByTranslation=function(t,e,n){var r=e.x,a=e.y,i=e.z,o=r*t[0]+a*t[4]+i*t[8]+t[12],u=r*t[1]+a*t[5]+i*t[9]+t[13],E=r*t[2]+a*t[6]+i*t[10]+t[14];return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=o,n[13]=u,n[14]=E,n[15]=t[15],n};var h=new t;_.multiplyByUniformScale=function(t,e,n){return h.x=e,h.y=e,h.z=e,_.multiplyByScale(t,h,n)},_.multiplyByScale=function(t,e,n){var r=e.x,a=e.y,i=e.z;return 1===r&&1===a&&1===i?_.clone(t,n):(n[0]=r*t[0],n[1]=r*t[1],n[2]=r*t[2],n[3]=0,n[4]=a*t[4],n[5]=a*t[5],n[6]=a*t[6],n[7]=0,n[8]=i*t[8],n[9]=i*t[9],n[10]=i*t[10],n[11]=0,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=1,n)},_.multiplyByVector=function(t,e,n){var r=e.x,a=e.y,i=e.z,o=e.w,u=t[0]*r+t[4]*a+t[8]*i+t[12]*o,E=t[1]*r+t[5]*a+t[9]*i+t[13]*o,s=t[2]*r+t[6]*a+t[10]*i+t[14]*o,c=t[3]*r+t[7]*a+t[11]*i+t[15]*o;return n.x=u,n.y=E,n.z=s,n.w=c,n},_.multiplyByPointAsVector=function(t,e,n){var r=e.x,a=e.y,i=e.z,o=t[0]*r+t[4]*a+t[8]*i,u=t[1]*r+t[5]*a+t[9]*i,E=t[2]*r+t[6]*a+t[10]*i;return n.x=o,n.y=u,n.z=E,n},_.multiplyByPoint=function(t,e,n){var r=e.x,a=e.y,i=e.z,o=t[0]*r+t[4]*a+t[8]*i+t[12],u=t[1]*r+t[5]*a+t[9]*i+t[13],E=t[2]*r+t[6]*a+t[10]*i+t[14];return n.x=o,n.y=u,n.z=E,n},_.multiplyByScalar=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n[4]=t[4]*e,n[5]=t[5]*e,n[6]=t[6]*e,n[7]=t[7]*e,n[8]=t[8]*e,n[9]=t[9]*e,n[10]=t[10]*e,n[11]=t[11]*e,n[12]=t[12]*e,n[13]=t[13]*e,n[14]=t[14]*e,n[15]=t[15]*e,n},_.negate=function(t,e){return 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],e},_.transpose=function(t,e){var n=t[1],r=t[2],a=t[3],i=t[6],o=t[7],u=t[11];return e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=r,e[9]=i,e[10]=t[10],e[11]=t[14],e[12]=a,e[13]=o,e[14]=u,e[15]=t[15],e},_.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e[9]=Math.abs(t[9]),e[10]=Math.abs(t[10]),e[11]=Math.abs(t[11]),e[12]=Math.abs(t[12]),e[13]=Math.abs(t[13]),e[14]=Math.abs(t[14]),e[15]=Math.abs(t[15]),e},_.equals=function(t,e){return t===e||a(t)&&a(e)&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[3]===e[3]&&t[7]===e[7]&&t[11]===e[11]&&t[15]===e[15]},_.equalsEpsilon=function(t,e,n){return t===e||a(t)&&a(e)&&Math.abs(t[0]-e[0])<=n&&Math.abs(t[1]-e[1])<=n&&Math.abs(t[2]-e[2])<=n&&Math.abs(t[3]-e[3])<=n&&Math.abs(t[4]-e[4])<=n&&Math.abs(t[5]-e[5])<=n&&Math.abs(t[6]-e[6])<=n&&Math.abs(t[7]-e[7])<=n&&Math.abs(t[8]-e[8])<=n&&Math.abs(t[9]-e[9])<=n&&Math.abs(t[10]-e[10])<=n&&Math.abs(t[11]-e[11])<=n&&Math.abs(t[12]-e[12])<=n&&Math.abs(t[13]-e[13])<=n&&Math.abs(t[14]-e[14])<=n&&Math.abs(t[15]-e[15])<=n},_.getTranslation=function(t,e){return e.x=t[12],e.y=t[13],e.z=t[14],e},_.getRotation=function(t,e){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e};var N=new s,d=new s,I=new e,S=new e(0,0,0,1);return _.inverse=function(t,n){if(s.equalsEpsilon(_.getRotation(t,N),d,E.EPSILON7)&&e.equals(_.getRow(t,3,I),S))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-t[12],n[13]=-t[13],n[14]=-t[14],n[15]=1,n;var r=t[0],a=t[4],i=t[8],o=t[12],u=t[1],T=t[5],l=t[9],R=t[13],f=t[2],A=t[6],h=t[10],m=t[14],M=t[3],O=t[7],y=t[11],p=t[15],C=h*p,U=m*y,L=A*p,F=m*O,P=A*y,w=h*O,g=f*p,v=m*M,x=f*y,D=h*M,B=f*O,z=A*M,G=C*T+F*l+P*R-(U*T+L*l+w*R),b=U*u+g*l+D*R-(C*u+v*l+x*R),X=L*u+v*T+B*R-(F*u+g*T+z*R),V=w*u+x*T+z*l-(P*u+D*T+B*l),q=U*a+L*i+w*o-(C*a+F*i+P*o),H=C*r+v*i+x*o-(U*r+g*i+D*o),W=F*r+g*a+z*o-(L*r+v*a+B*o),Y=P*r+D*a+B*i-(w*r+x*a+z*i);C=i*R,U=o*l,L=a*R,F=o*T,P=a*l,w=i*T,g=r*R,v=o*u,x=r*l,D=i*u,B=r*T,z=a*u;var k=C*O+F*y+P*p-(U*O+L*y+w*p),K=U*M+g*y+D*p-(C*M+v*y+x*p),Z=L*M+v*O+B*p-(F*M+g*O+z*p),j=w*M+x*O+z*y-(P*M+D*O+B*y),Q=L*h+w*m+U*A-(P*m+C*A+F*h),J=x*m+C*f+v*h-(g*h+D*m+U*f),$=g*A+z*m+F*f-(B*m+L*f+v*A),tt=B*h+P*f+D*A-(x*A+z*h+w*f),et=r*G+a*b+i*X+o*V;if(Math.abs(et)<E.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return et=1/et,n[0]=G*et,n[1]=b*et,n[2]=X*et,n[3]=V*et,n[4]=q*et,n[5]=H*et,n[6]=W*et,n[7]=Y*et,n[8]=k*et,n[9]=K*et,n[10]=Z*et,n[11]=j*et,n[12]=Q*et,n[13]=J*et,n[14]=$*et,n[15]=tt*et,n},_.inverseTransformation=function(t,e){var n=t[0],r=t[1],a=t[2],i=t[4],o=t[5],u=t[6],E=t[8],s=t[9],c=t[10],_=t[12],T=t[13],l=t[14],R=-n*_-r*T-a*l,f=-i*_-o*T-u*l,A=-E*_-s*T-c*l;return e[0]=n,e[1]=i,e[2]=E,e[3]=0,e[4]=r,e[5]=o,e[6]=s,e[7]=0,e[8]=a,e[9]=u,e[10]=c,e[11]=0,e[12]=R,e[13]=f,e[14]=A,e[15]=1,e},_.IDENTITY=u(new _(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),_.ZERO=u(new _(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),_.COLUMN0ROW0=0,_.COLUMN0ROW1=1,_.COLUMN0ROW2=2,_.COLUMN0ROW3=3,_.COLUMN1ROW0=4,_.COLUMN1ROW1=5,_.COLUMN1ROW2=6,_.COLUMN1ROW3=7,_.COLUMN2ROW0=8,_.COLUMN2ROW1=9,_.COLUMN2ROW2=10,_.COLUMN2ROW3=11,_.COLUMN3ROW0=12,_.COLUMN3ROW1=13,_.COLUMN3ROW2=14,_.COLUMN3ROW3=15,i(_.prototype,{length:{get:function(){return _.packedLength}}}),_.prototype.clone=function(t){return _.clone(this,t)},_.prototype.equals=function(t){return _.equals(this,t)},_.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]&&t[4]===e[n+4]&&t[5]===e[n+5]&&t[6]===e[n+6]&&t[7]===e[n+7]&&t[8]===e[n+8]&&t[9]===e[n+9]&&t[10]===e[n+10]&&t[11]===e[n+11]&&t[12]===e[n+12]&&t[13]===e[n+13]&&t[14]===e[n+14]&&t[15]===e[n+15]},_.prototype.equalsEpsilon=function(t,e){return _.equalsEpsilon(this,t,e)},_.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]+")"},_}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(t,e,n,r,a,i,o,u,E){"use strict";function s(t,e,r,a){this.west=n(t,0),this.south=n(e,0),this.east=n(r,0),this.north=n(a,0)}a(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(t,e,r){return r=n(r,0),e[r++]=t.west,e[r++]=t.south,e[r++]=t.east,e[r]=t.north,e},s.unpack=function(t,e,a){return e=n(e,0),r(a)||(a=new s),a.west=t[e++],a.south=t[e++],a.east=t[e++],a.north=t[e],a},s.computeWidth=function(t){var e=t.east,n=t.west;return e<n&&(e+=E.TWO_PI),e-n},s.computeHeight=function(t){return t.north-t.south},s.fromDegrees=function(t,e,a,i,o){return t=E.toRadians(n(t,0)),e=E.toRadians(n(e,0)),a=E.toRadians(n(a,0)),i=E.toRadians(n(i,0)),r(o)?(o.west=t,o.south=e,o.east=a,o.north=i,o):new s(t,e,a,i)},s.fromRadians=function(t,e,a,i,o){return r(o)?(o.west=n(t,0),o.south=n(e,0),o.east=n(a,0),o.north=n(i,0),o):new s(t,e,a,i)},s.fromCartographicArray=function(t,e){for(var n=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,u=Number.MAX_VALUE,c=-Number.MAX_VALUE,_=0,T=t.length;_<T;_++){var l=t[_];n=Math.min(n,l.longitude),a=Math.max(a,l.longitude),u=Math.min(u,l.latitude),c=Math.max(c,l.latitude);var R=l.longitude>=0?l.longitude:l.longitude+E.TWO_PI;i=Math.min(i,R),o=Math.max(o,R)}return a-n>o-i&&(n=i,a=o,a>E.PI&&(a-=E.TWO_PI),n>E.PI&&(n-=E.TWO_PI)),r(e)?(e.west=n,e.south=u,e.east=a,e.north=c,e):new s(n,u,a,c)},s.fromCartesianArray=function(t,e,n){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,u=-Number.MAX_VALUE,c=Number.MAX_VALUE,_=-Number.MAX_VALUE,T=0,l=t.length;T<l;T++){var R=e.cartesianToCartographic(t[T]);a=Math.min(a,R.longitude),i=Math.max(i,R.longitude),c=Math.min(c,R.latitude),_=Math.max(_,R.latitude);var f=R.longitude>=0?R.longitude:R.longitude+E.TWO_PI;o=Math.min(o,f),u=Math.max(u,f)}return i-a>u-o&&(a=o,i=u,i>E.PI&&(i-=E.TWO_PI),a>E.PI&&(a-=E.TWO_PI)),r(n)?(n.west=a,n.south=c,n.east=i,n.north=_,n):new s(a,c,i,_)},s.clone=function(t,e){if(r(t))return r(e)?(e.west=t.west,e.south=t.south,e.east=t.east,e.north=t.north,e):new s(t.west,t.south,t.east,t.north)},s.prototype.clone=function(t){return s.clone(this,t)},s.prototype.equals=function(t){return s.equals(this,t)},s.equals=function(t,e){return t===e||r(t)&&r(e)&&t.west===e.west&&t.south===e.south&&t.east===e.east&&t.north===e.north},s.prototype.equalsEpsilon=function(t,e){return r(t)&&Math.abs(this.west-t.west)<=e&&Math.abs(this.south-t.south)<=e&&Math.abs(this.east-t.east)<=e&&Math.abs(this.north-t.north)<=e},s.validate=function(t){},s.southwest=function(e,n){return r(n)?(n.longitude=e.west,n.latitude=e.south,n.height=0,n):new t(e.west,e.south)},s.northwest=function(e,n){return r(n)?(n.longitude=e.west,n.latitude=e.north,n.height=0,n):new t(e.west,e.north)},s.northeast=function(e,n){return r(n)?(n.longitude=e.east,n.latitude=e.north,n.height=0,n):new t(e.east,e.north)},s.southeast=function(e,n){return r(n)?(n.longitude=e.east,n.latitude=e.south,n.height=0,n):new t(e.east,e.south)},s.center=function(e,n){var a=e.east,i=e.west;a<i&&(a+=E.TWO_PI);var o=E.negativePiToPi(.5*(i+a)),u=.5*(e.south+e.north);return r(n)?(n.longitude=o,n.latitude=u,n.height=0,n):new t(o,u)},s.intersection=function(t,e,n){var a=t.east,i=t.west,o=e.east,u=e.west;a<i&&o>0?a+=E.TWO_PI:o<u&&a>0&&(o+=E.TWO_PI),a<i&&u<0?u+=E.TWO_PI:o<u&&i<0&&(i+=E.TWO_PI);var c=E.negativePiToPi(Math.max(i,u)),_=E.negativePiToPi(Math.min(a,o));if(!((t.west<t.east||e.west<e.east)&&_<=c)){var T=Math.max(t.south,e.south),l=Math.min(t.north,e.north);if(!(T>=l))return r(n)?(n.west=c,n.south=T,n.east=_,n.north=l,n):new s(c,T,_,l)}},s.simpleIntersection=function(t,e,n){var a=Math.max(t.west,e.west),i=Math.max(t.south,e.south),o=Math.min(t.east,e.east),u=Math.min(t.north,e.north);if(!(i>=u||a>=o))return r(n)?(n.west=a,n.south=i,n.east=o,n.north=u,n):new s(a,i,o,u)},s.union=function(t,e,n){r(n)||(n=new s);var a=t.east,i=t.west,o=e.east,u=e.west;a<i&&o>0?a+=E.TWO_PI:o<u&&a>0&&(o+=E.TWO_PI),a<i&&u<0?u+=E.TWO_PI:o<u&&i<0&&(i+=E.TWO_PI);var c=E.convertLongitudeRange(Math.min(i,u)),_=E.convertLongitudeRange(Math.max(a,o));return n.west=c,n.south=Math.min(t.south,e.south),n.east=_,n.north=Math.max(t.north,e.north),n},s.expand=function(t,e,n){return r(n)||(n=new s),n.west=Math.min(t.west,e.longitude),n.south=Math.min(t.south,e.latitude),n.east=Math.max(t.east,e.longitude),n.north=Math.max(t.north,e.latitude),n},s.contains=function(t,e){var n=e.longitude,r=e.latitude,a=t.west,i=t.east;return i<a&&(i+=E.TWO_PI,n<0&&(n+=E.TWO_PI)),(n>a||E.equalsEpsilon(n,a,E.EPSILON14))&&(n<i||E.equalsEpsilon(n,i,E.EPSILON14))&&r>=t.south&&r<=t.north};var c=new t;return s.subsample=function(t,e,a,i){e=n(e,o.WGS84),a=n(a,0),r(i)||(i=[]);var u=0,_=t.north,T=t.south,l=t.east,R=t.west,f=c;f.height=a,f.longitude=R,f.latitude=_,i[u]=e.cartographicToCartesian(f,i[u]),u++,f.longitude=l,i[u]=e.cartographicToCartesian(f,i[u]),u++,f.latitude=T,i[u]=e.cartographicToCartesian(f,i[u]),u++,f.longitude=R,i[u]=e.cartographicToCartesian(f,i[u]),u++,_<0?f.latitude=_:T>0?f.latitude=T:f.latitude=0;for(var A=1;A<8;++A)f.longitude=-Math.PI+A*E.PI_OVER_TWO,s.contains(t,f)&&(i[u]=e.cartographicToCartesian(f,i[u]),u++);return 0===f.latitude&&(f.longitude=R,i[u]=e.cartographicToCartesian(f,i[u]),u++,f.longitude=l,i[u]=e.cartographicToCartesian(f,i[u]),u++),i.length=u,i},s.MAX_VALUE=u(new s(-Math.PI,-E.PI_OVER_TWO,Math.PI,E.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(t,e,n,r,a,i,o,u,E,s,c,_){"use strict";function T(e,n){this.center=t.clone(r(e,t.ZERO)),this.radius=r(n,0)}var l=new t,R=new t,f=new t,A=new t,h=new t,N=new t,d=new t,I=new t,S=new t,m=new t,M=new t,O=new t;T.fromPoints=function(e,n){if(a(n)||(n=new T),!a(e)||0===e.length)return n.center=t.clone(t.ZERO,n.center),n.radius=0,n;for(var r=t.clone(e[0],d),i=t.clone(r,l),o=t.clone(r,R),u=t.clone(r,f),E=t.clone(r,A),s=t.clone(r,h),c=t.clone(r,N),_=e.length,y=1;y<_;y++){t.clone(e[y],r);var p=r.x,C=r.y,U=r.z;p<i.x&&t.clone(r,i),p>E.x&&t.clone(r,E),C<o.y&&t.clone(r,o),C>s.y&&t.clone(r,s),U<u.z&&t.clone(r,u),U>c.z&&t.clone(r,c)}var L=t.magnitudeSquared(t.subtract(E,i,I)),F=t.magnitudeSquared(t.subtract(s,o,I)),P=t.magnitudeSquared(t.subtract(c,u,I)),w=i,g=E,v=L;F>v&&(v=F,w=o,g=s),P>v&&(v=P,w=u,g=c);var x=S;x.x=.5*(w.x+g.x),x.y=.5*(w.y+g.y),x.z=.5*(w.z+g.z);var D=t.magnitudeSquared(t.subtract(g,x,I)),B=Math.sqrt(D),z=m;z.x=i.x,z.y=o.y,z.z=u.z;var G=M;G.x=E.x,G.y=s.y,G.z=c.z;var b=t.multiplyByScalar(t.add(z,G,I),.5,O),X=0;for(y=0;y<_;y++){t.clone(e[y],r);var V=t.magnitude(t.subtract(r,b,I));V>X&&(X=V);var q=t.magnitudeSquared(t.subtract(r,x,I));if(q>D){var H=Math.sqrt(q);B=.5*(B+H),D=B*B;var W=H-B;x.x=(B*x.x+W*r.x)/H,x.y=(B*x.y+W*r.y)/H,x.z=(B*x.z+W*r.z)/H}}return B<X?(t.clone(x,n.center),n.radius=B):(t.clone(b,n.center),n.radius=X),n};var y=new o,p=new t,C=new t,U=new e,L=new e;T.fromRectangle2D=function(t,e,n){return T.fromRectangleWithHeights2D(t,e,0,0,n)},T.fromRectangleWithHeights2D=function(e,n,i,o,u){if(a(u)||(u=new T),!a(e))return u.center=t.clone(t.ZERO,u.center),u.radius=0,u;n=r(n,y),_.southwest(e,U),U.height=i,_.northeast(e,L),L.height=o;var E=n.project(U,p),s=n.project(L,C),c=s.x-E.x,l=s.y-E.y,R=s.z-E.z;u.radius=.5*Math.sqrt(c*c+l*l+R*R);var f=u.center;return f.x=E.x+.5*c,f.y=E.y+.5*l,f.z=E.z+.5*R,u};var F=[];T.fromRectangle3D=function(t,e,n,o){e=r(e,i.WGS84),n=r(n,0);var u;return a(t)&&(u=_.subsample(t,e,n,F)),T.fromPoints(u,o)},T.fromVertices=function(e,n,i,o){if(a(o)||(o=new T),!a(e)||0===e.length)return o.center=t.clone(t.ZERO,o.center),o.radius=0,o;n=r(n,t.ZERO),i=r(i,3);var u=d;u.x=e[0]+n.x,u.y=e[1]+n.y,u.z=e[2]+n.z;for(var E=t.clone(u,l),s=t.clone(u,R),c=t.clone(u,f),_=t.clone(u,A),y=t.clone(u,h),p=t.clone(u,N),C=e.length,U=0;U<C;U+=i){var L=e[U]+n.x,F=e[U+1]+n.y,P=e[U+2]+n.z;u.x=L,u.y=F,u.z=P,L<E.x&&t.clone(u,E),L>_.x&&t.clone(u,_),F<s.y&&t.clone(u,s),F>y.y&&t.clone(u,y),P<c.z&&t.clone(u,c),P>p.z&&t.clone(u,p)}var w=t.magnitudeSquared(t.subtract(_,E,I)),g=t.magnitudeSquared(t.subtract(y,s,I)),v=t.magnitudeSquared(t.subtract(p,c,I)),x=E,D=_,B=w;g>B&&(B=g,x=s,D=y),v>B&&(B=v,x=c,D=p);var z=S;z.x=.5*(x.x+D.x),z.y=.5*(x.y+D.y),z.z=.5*(x.z+D.z);var G=t.magnitudeSquared(t.subtract(D,z,I)),b=Math.sqrt(G),X=m;X.x=E.x,X.y=s.y,X.z=c.z;var V=M;V.x=_.x,V.y=y.y,V.z=p.z;var q=t.multiplyByScalar(t.add(X,V,I),.5,O),H=0;for(U=0;U<C;U+=i){u.x=e[U]+n.x,u.y=e[U+1]+n.y,u.z=e[U+2]+n.z;var W=t.magnitude(t.subtract(u,q,I));W>H&&(H=W);var Y=t.magnitudeSquared(t.subtract(u,z,I));if(Y>G){var k=Math.sqrt(Y);b=.5*(b+k),G=b*b;var K=k-b;z.x=(b*z.x+K*u.x)/k,z.y=(b*z.y+K*u.y)/k,z.z=(b*z.z+K*u.z)/k}}return b<H?(t.clone(z,o.center),o.radius=b):(t.clone(q,o.center),o.radius=H),o},T.fromEncodedCartesianVertices=function(e,n,r){if(a(r)||(r=new T),!a(e)||!a(n)||e.length!==n.length||0===e.length)return r.center=t.clone(t.ZERO,r.center),r.radius=0,r;var i=d;i.x=e[0]+n[0],i.y=e[1]+n[1],i.z=e[2]+n[2];for(var o=t.clone(i,l),u=t.clone(i,R),E=t.clone(i,f),s=t.clone(i,A),c=t.clone(i,h),_=t.clone(i,N),y=e.length,p=0;p<y;p+=3){var C=e[p]+n[p],U=e[p+1]+n[p+1],L=e[p+2]+n[p+2];i.x=C,i.y=U,i.z=L,C<o.x&&t.clone(i,o),C>s.x&&t.clone(i,s),U<u.y&&t.clone(i,u),U>c.y&&t.clone(i,c),L<E.z&&t.clone(i,E),L>_.z&&t.clone(i,_)}var F=t.magnitudeSquared(t.subtract(s,o,I)),P=t.magnitudeSquared(t.subtract(c,u,I)),w=t.magnitudeSquared(t.subtract(_,E,I)),g=o,v=s,x=F;P>x&&(x=P,g=u,v=c),w>x&&(x=w,g=E,v=_);var D=S;D.x=.5*(g.x+v.x),D.y=.5*(g.y+v.y),D.z=.5*(g.z+v.z);var B=t.magnitudeSquared(t.subtract(v,D,I)),z=Math.sqrt(B),G=m;G.x=o.x,G.y=u.y,G.z=E.z;var b=M;b.x=s.x,b.y=c.y,b.z=_.z;var X=t.multiplyByScalar(t.add(G,b,I),.5,O),V=0;for(p=0;p<y;p+=3){i.x=e[p]+n[p],i.y=e[p+1]+n[p+1],i.z=e[p+2]+n[p+2];var q=t.magnitude(t.subtract(i,X,I));q>V&&(V=q);var H=t.magnitudeSquared(t.subtract(i,D,I));if(H>B){var W=Math.sqrt(H);z=.5*(z+W),B=z*z;var Y=W-z;D.x=(z*D.x+Y*i.x)/W,D.y=(z*D.y+Y*i.y)/W,D.z=(z*D.z+Y*i.z)/W}}return z<V?(t.clone(D,r.center),r.radius=z):(t.clone(X,r.center),r.radius=V),r},T.fromCornerPoints=function(e,n,r){a(r)||(r=new T);var i=r.center;return t.add(e,n,i),t.multiplyByScalar(i,.5,i),r.radius=t.distance(i,n),r},T.fromEllipsoid=function(e,n){return a(n)||(n=new T),t.clone(t.ZERO,n.center),n.radius=e.maximumRadius,n};var P=new t;T.fromBoundingSpheres=function(e,n){if(a(n)||(n=new T),!a(e)||0===e.length)return n.center=t.clone(t.ZERO,n.center),n.radius=0,n;var r=e.length;if(1===r)return T.clone(e[0],n);if(2===r)return T.union(e[0],e[1],n);for(var i=[],o=0;o<r;o++)i.push(e[o].center);n=T.fromPoints(i,n);var u=n.center,E=n.radius;for(o=0;o<r;o++){var s=e[o];E=Math.max(E,t.distance(u,s.center,P)+s.radius)}return n.radius=E,n};var w=new t,g=new t,v=new t;T.fromOrientedBoundingBox=function(e,n){a(n)||(n=new T);var r=e.halfAxes,i=s.getColumn(r,0,w),o=s.getColumn(r,1,g),u=s.getColumn(r,2,v),E=t.magnitude(i),c=t.magnitude(o),_=t.magnitude(u);return n.center=t.clone(e.center,n.center),n.radius=Math.max(E,c,_),n},T.clone=function(e,n){if(a(e))return a(n)?(n.center=t.clone(e.center,n.center),n.radius=e.radius,n):new T(e.center,e.radius)},T.packedLength=4,T.pack=function(t,e,n){n=r(n,0);var a=t.center;return e[n++]=a.x,e[n++]=a.y,e[n++]=a.z,e[n]=t.radius,e},T.unpack=function(t,e,n){e=r(e,0),a(n)||(n=new T);var i=n.center;return i.x=t[e++],i.y=t[e++],i.z=t[e++],n.radius=t[e],n};var x=new t,D=new t;T.union=function(e,n,r){a(r)||(r=new T);var i=e.center,o=e.radius,u=n.center,E=n.radius,s=t.subtract(u,i,x),c=t.magnitude(s);if(o>=c+E)return e.clone(r),r;if(E>=c+o)return n.clone(r),r;var _=.5*(o+c+E),l=t.multiplyByScalar(s,(-o+_)/c,D);return t.add(l,i,l),t.clone(l,r.center),r.radius=_,r};var B=new t;T.expand=function(e,n,r){r=T.clone(e,r);var a=t.magnitude(t.subtract(n,r.center,B));return a>r.radius&&(r.radius=a),r},T.intersectPlane=function(e,n){var r=e.center,a=e.radius,i=n.normal,o=t.dot(i,r)+n.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},T.transform=function(t,e,n){return a(n)||(n=new T),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=c.getMaximumScale(e)*t.radius,n};var z=new t;T.distanceSquaredTo=function(e,n){var r=t.subtract(e.center,n,z);return t.magnitudeSquared(r)-e.radius*e.radius},T.transformWithoutScale=function(t,e,n){return a(n)||(n=new T),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=t.radius,n};var G=new t;T.computePlaneDistances=function(e,n,r,i){a(i)||(i=new E);var o=t.subtract(e.center,n,G),u=t.dot(r,o);return i.start=u-e.radius,i.stop=u+e.radius,i};for(var b=new t,X=new t,V=new t,q=new t,H=new t,W=new e,Y=new Array(8),k=0;k<8;++k)Y[k]=new t;var K=new o;return T.projectTo2D=function(e,n,a){n=r(n,K);var i=n.ellipsoid,o=e.center,u=e.radius,E=i.geodeticSurfaceNormal(o,b),s=t.cross(t.UNIT_Z,E,X);t.normalize(s,s);var c=t.cross(E,s,V);t.normalize(c,c),t.multiplyByScalar(E,u,E),t.multiplyByScalar(c,u,c),t.multiplyByScalar(s,u,s);var _=t.negate(c,H),l=t.negate(s,q),R=Y,f=R[0];t.add(E,c,f),t.add(f,s,f),f=R[1],t.add(E,c,f),t.add(f,l,f),f=R[2],t.add(E,_,f),t.add(f,l,f),f=R[3],t.add(E,_,f),t.add(f,s,f),t.negate(E,E),f=R[4],t.add(E,c,f),t.add(f,s,f),f=R[5],t.add(E,c,f),t.add(f,l,f),f=R[6],t.add(E,_,f),t.add(f,l,f),f=R[7],t.add(E,_,f),t.add(f,s,f);for(var A=R.length,h=0;h<A;++h){var N=R[h];t.add(o,N,N);var d=i.cartesianToCartographic(N,W);n.project(d,N)}a=T.fromPoints(R,a),o=a.center;var I=o.x,S=o.y,m=o.z;return o.x=m,o.y=I,o.z=S,a},T.isOccluded=function(t,e){return!e.isBoundingSphereVisible(t)},T.equals=function(e,n){return e===n||a(e)&&a(n)&&t.equals(e.center,n.center)&&e.radius===n.radius},T.prototype.intersectPlane=function(t){return T.intersectPlane(this,t)},T.prototype.distanceSquaredTo=function(t){return T.distanceSquaredTo(this,t)},T.prototype.computePlaneDistances=function(t,e,n){return T.computePlaneDistances(this,t,e,n)},T.prototype.isOccluded=function(t){return T.isOccluded(this,t)},T.prototype.equals=function(t){return T.equals(this,t)},T.prototype.clone=function(t){return T.clone(this,t)},T}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,a,i){"use strict";function o(t,n){this.x=e(t,0),this.y=e(n,0)}o.fromElements=function(t,e,r){return n(r)?(r.x=t,r.y=e,r):new o(t,e)},o.clone=function(t,e){if(n(t))return n(e)?(e.x=t.x,e.y=t.y,e):new o(t.x,t.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r]=t.y,n},o.unpack=function(t,r,a){return r=e(r,0),n(a)||(a=new o),a.x=t[r++],a.y=t[r],a},o.packArray=function(t,e){var r=t.length;n(e)?e.length=2*r:e=new Array(2*r);for(var a=0;a<r;++a)o.pack(t[a],e,2*a);return e},o.unpackArray=function(t,e){var r=t.length;n(e)?e.length=r/2:e=new Array(r/2);for(var a=0;a<r;a+=2){var i=a/2;e[i]=o.unpack(t,a,e[i])}return e},o.fromArray=o.unpack,o.maximumComponent=function(t){return Math.max(t.x,t.y)},o.minimumComponent=function(t){return Math.min(t.x,t.y)},o.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n},o.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n},o.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y},o.magnitude=function(t){return Math.sqrt(o.magnitudeSquared(t))};var u=new o;o.distance=function(t,e){return o.subtract(t,e,u),o.magnitude(u)},o.distanceSquared=function(t,e){return o.subtract(t,e,u),o.magnitudeSquared(u)},o.normalize=function(t,e){var n=o.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e},o.dot=function(t,e){return t.x*e.x+t.y*e.y},o.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n},o.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n},o.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n},o.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n},o.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n},o.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n},o.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e},o.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e};var E=new o;o.lerp=function(t,e,n,r){return o.multiplyByScalar(e,n,E),r=o.multiplyByScalar(t,1-n,r),o.add(E,r,r)};var s=new o,c=new o;o.angleBetween=function(t,e){return o.normalize(t,s),o.normalize(e,c),i.acosClamped(o.dot(s,c))};var _=new o;return o.mostOrthogonalAxis=function(t,e){var n=o.normalize(t,_);return o.abs(n,n),e=n.x<=n.y?o.clone(o.UNIT_X,e):o.clone(o.UNIT_Y,e)},o.equals=function(t,e){return t===e||n(t)&&n(e)&&t.x===e.x&&t.y===e.y},o.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]},o.equalsEpsilon=function(t,e,r,a){return t===e||n(t)&&n(e)&&i.equalsEpsilon(t.x,e.x,r,a)&&i.equalsEpsilon(t.y,e.y,r,a)},o.ZERO=a(new o(0,0)),o.UNIT_X=a(new o(1,0)),o.UNIT_Y=a(new o(0,1)),o.prototype.clone=function(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.prototype.equalsEpsilon=function(t,e,n){return o.equalsEpsilon(this,t,e,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/Fullscreen",["./defined","./defineProperties"],function(t,e){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return e(a,{element:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenElement]; +}},changeEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(t(n))return n;n=!1;var e=document.body;if("function"==typeof e.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var E=i[o];a=E+"RequestFullscreen","function"==typeof e[a]?(r.requestFullscreen=a,n=!0):(a=E+"RequestFullScreen","function"==typeof e[a]&&(r.requestFullscreen=a,n=!0)),a=E+"ExitFullscreen","function"==typeof document[a]?r.exitFullscreen=a:(a=E+"CancelFullScreen","function"==typeof document[a]&&(r.exitFullscreen=a)),a=E+"FullscreenEnabled",void 0!==document[a]?r.fullscreenEnabled=a:(a=E+"FullScreenEnabled",void 0!==document[a]&&(r.fullscreenEnabled=a)),a=E+"FullscreenElement",void 0!==document[a]?r.fullscreenElement=a:(a=E+"FullScreenElement",void 0!==document[a]&&(r.fullscreenElement=a)),a=E+"fullscreenchange",void 0!==document["on"+a]&&("ms"===E&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=E+"fullscreenerror",void 0!==document["on"+a]&&("ms"===E&&(a="MSFullscreenError"),r.fullscreenerror=a)}return n},a.requestFullscreen=function(t,e){a.supportsFullscreen()&&t[r.requestFullscreen]({vrDisplay:e})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[r.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(t,e,n){"use strict";function r(t){for(var e=t.split("."),n=0,r=e.length;n<r;++n)e[n]=parseInt(e[n],10);return e}function a(){if(!e(S)&&(S=!1,!T())){var t=/ Chrome\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(S=!0,m=r(t[1]))}return S}function i(){return a()&&m}function o(){if(!e(M)&&(M=!1,!a()&&!T()&&/ Safari\/[\.0-9]+/.test(I.userAgent))){var t=/ Version\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(M=!0,O=r(t[1]))}return M}function u(){return o()&&O}function E(){if(!e(y)){y=!1;var t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(I.userAgent);null!==t&&(y=!0,p=r(t[1]),p.isNightly=!!t[2])}return y}function s(){return E()&&p}function c(){if(!e(C)){C=!1;var t;"Microsoft Internet Explorer"===I.appName?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==t&&(C=!0,U=r(t[1]))):"Netscape"===I.appName&&(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==t&&(C=!0,U=r(t[1])))}return C}function _(){return c()&&U}function T(){if(!e(L)){L=!1;var t=/ Edge\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(L=!0,F=r(t[1]))}return L}function l(){return T()&&F}function R(){if(!e(P)){P=!1;var t=/Firefox\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(P=!0,w=r(t[1]))}return P}function f(){return e(g)||(g=/Windows/i.test(I.appVersion)),g}function A(){return R()&&w}function h(){return e(v)||(v="undefined"!=typeof PointerEvent&&(!e(I.pointerEnabled)||I.pointerEnabled)),v}function N(){if(!e(D)){var t=document.createElement("canvas");t.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=t.style.imageRendering;D=e(n)&&""!==n,D&&(x=n)}return D}function d(){return N()?x:void 0}var I;I="undefined"!=typeof navigator?navigator:{};var S,m,M,O,y,p,C,U,L,F,P,w,g,v,x,D,B={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:E,webkitVersion:s,isInternetExplorer:c,internetExplorerVersion:_,isEdge:T,edgeVersion:l,isFirefox:R,firefoxVersion:A,isWindows:f,hardwareConcurrency:t(I.hardwareConcurrency,3),supportsPointerEvents:h,supportsImageRenderingPixelated:N,imageRenderingValue:d};return B.supportsFullscreen=function(){return n.supportsFullscreen()},B.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},B.supportsWebWorkers=function(){return"undefined"!=typeof Worker},B}),define("Core/WebGLConstants",["./freezeObject"],function(t){"use strict";var e={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047};return t(e)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(t,e,n,r,a,i){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(t){switch(t){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.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(t){return t instanceof Int8Array?o.BYTE:t instanceof Uint8Array?o.UNSIGNED_BYTE:t instanceof Int16Array?o.SHORT:t instanceof Uint16Array?o.UNSIGNED_SHORT:t instanceof Int32Array?o.INT:t instanceof Uint32Array?o.UNSIGNED_INT:t instanceof Float32Array?o.FLOAT:t instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(t){return e(t)&&(t===o.BYTE||t===o.UNSIGNED_BYTE||t===o.SHORT||t===o.UNSIGNED_SHORT||t===o.INT||t===o.UNSIGNED_INT||t===o.FLOAT||t===o.DOUBLE)},o.createTypedArray=function(t,e){switch(t){case o.BYTE:return new Int8Array(e);case o.UNSIGNED_BYTE:return new Uint8Array(e);case o.SHORT:return new Int16Array(e);case o.UNSIGNED_SHORT:return new Uint16Array(e);case o.INT:return new Int32Array(e);case o.UNSIGNED_INT:return new Uint32Array(e);case o.FLOAT:return new Float32Array(e);case o.DOUBLE:return new Float64Array(e)}},o.createArrayBufferView=function(e,n,r,a){switch(r=t(r,0),a=t(a,(n.byteLength-r)/o.getSizeInBytes(e)),e){case o.BYTE:return new Int8Array(n,r,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,a);case o.SHORT:return new Int16Array(n,r,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,a);case o.INT:return new Int32Array(n,r,a);case o.UNSIGNED_INT:return new Uint32Array(n,r,a);case o.FLOAT:return new Float32Array(n,r,a);case o.DOUBLE:return new Float64Array(n,r,a)}},o.fromName=function(t){switch(t){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/GeometryType",["./freezeObject"],function(t){"use strict";var e={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return t(e)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(t,e){"use strict";var n={POINTS:e.POINTS,LINES:e.LINES,LINE_LOOP:e.LINE_LOOP,LINE_STRIP:e.LINE_STRIP,TRIANGLES:e.TRIANGLES,TRIANGLE_STRIP:e.TRIANGLE_STRIP,TRIANGLE_FAN:e.TRIANGLE_FAN,validate:function(t){return t===n.POINTS||t===n.LINES||t===n.LINE_LOOP||t===n.LINE_STRIP||t===n.TRIANGLES||t===n.TRIANGLE_STRIP||t===n.TRIANGLE_FAN}};return t(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(t,e,n,r,a){"use strict";function i(e){e=t(e,t.EMPTY_OBJECT),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=t(e.primitiveType,a.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=t(e.geometryType,r.NONE),this.boundingSphereCV=e.boundingSphereCV}return i.computeNumberOfVertices=function(t){var n=-1;for(var r in t.attributes)if(t.attributes.hasOwnProperty(r)&&e(t.attributes[r])&&e(t.attributes[r].values)){var a=t.attributes[r],i=a.values.length/a.componentsPerAttribute;n=i}return n},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(t,e,n){"use strict";function r(e){e=t(e,t.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=t(e.normalize,!1),this.values=e.values}return r}),define("Core/GeometryAttributes",["./defaultValue"],function(t){"use strict";function e(e){e=t(e,t.EMPTY_OBJECT),this.position=e.position,this.normal=e.normal,this.st=e.st,this.bitangent=e.bitangent,this.tangent=e.tangent,this.color=e.color}return e}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(t,e,n,r,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(t){switch(t){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(e){return t(e)&&(e===i.UNSIGNED_BYTE||e===i.UNSIGNED_SHORT||e===i.UNSIGNED_INT)},i.createTypedArray=function(t,e){return t>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(e):new Uint16Array(e)},i.createTypedArrayFromArrayBuffer=function(t,e,n,a){return t>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(e,n,a):new Uint16Array(e,n,a)},n(i)}),define("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(t,e,n,r){"use strict";function a(e){e=t(e,t.EMPTY_OBJECT),this.position=t(e.position,!1),this.normal=t(e.normal,!1),this.st=t(e.st,!1),this.bitangent=t(e.bitangent,!1),this.tangent=t(e.tangent,!1),this.color=t(e.color,!1)}return a.POSITION_ONLY=r(new a({position:!0})),a.POSITION_AND_NORMAL=r(new a({position:!0,normal:!0})),a.POSITION_NORMAL_AND_ST=r(new a({position:!0,normal:!0,st:!0})),a.POSITION_AND_ST=r(new a({position:!0,st:!0})),a.POSITION_AND_COLOR=r(new a({position:!0,color:!0})),a.ALL=r(new a({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0})),a.DEFAULT=a.POSITION_NORMAL_AND_ST,a.packedLength=6,a.pack=function(e,n,r){return r=t(r,0),n[r++]=e.position?1:0,n[r++]=e.normal?1:0,n[r++]=e.st?1:0,n[r++]=e.tangent?1:0,n[r++]=e.bitangent?1:0,n[r++]=e.color?1:0,n},a.unpack=function(n,r,i){return r=t(r,0),e(i)||(i=new a),i.position=1===n[r++],i.normal=1===n[r++],i.st=1===n[r++],i.tangent=1===n[r++],i.bitangent=1===n[r++],i.color=1===n[r++],i},a.clone=function(t,n){if(e(t))return e(n)||(n=new a),n.position=t.position,n.normal=t.normal,n.st=t.st,n.tangent=t.tangent,n.bitangent=t.bitangent,n.color=t.color,n},a}),define("Core/EllipsoidGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./VertexFormat"],function(t,e,n,r,a,i,o,u,E,s,c,_,T,l,R){"use strict";function f(t){t=a(t,a.EMPTY_OBJECT);var e=a(t.radii,S),r=a(t.stackPartitions,64),i=a(t.slicePartitions,64),o=a(t.vertexFormat,R.DEFAULT);this._radii=n.clone(e),this._stackPartitions=r,this._slicePartitions=i,this._vertexFormat=R.clone(o),this._workerName="createEllipsoidGeometry"}var A=new n,h=new n,N=new n,d=new n,I=new n,S=new n(1,1,1),m=Math.cos,M=Math.sin;f.packedLength=n.packedLength+R.packedLength+2,f.pack=function(t,e,r){return r=a(r,0),n.pack(t._radii,e,r),r+=n.packedLength,R.pack(t._vertexFormat,e,r),r+=R.packedLength,e[r++]=t._stackPartitions,e[r]=t._slicePartitions,e};var O=new n,y=new R,p={radii:O,vertexFormat:y,stackPartitions:void 0,slicePartitions:void 0};return f.unpack=function(t,e,r){e=a(e,0);var o=n.unpack(t,e,O);e+=n.packedLength;var u=R.unpack(t,e,y);e+=R.packedLength;var E=t[e++],s=t[e];return i(r)?(r._radii=n.clone(o,r._radii),r._vertexFormat=R.clone(u,r._vertexFormat),r._stackPartitions=E,r._slicePartitions=s,r):(p.stackPartitions=E,p.slicePartitions=s,new f(p))},f.createGeometry=function(a){var i=a._radii;if(!(i.x<=0||i.y<=0||i.z<=0)){var o,R,f=u.fromCartesian3(i),S=a._vertexFormat,O=a._slicePartitions+1,y=a._stackPartitions+1,p=y*O,C=new Float64Array(3*p),U=6*(O-1)*(y-2),L=_.createTypedArray(p,U),F=S.normal?new Float32Array(3*p):void 0,P=S.tangent?new Float32Array(3*p):void 0,w=S.bitangent?new Float32Array(3*p):void 0,g=S.st?new Float32Array(2*p):void 0,v=new Array(O),x=new Array(O),D=0;for(o=0;o<O;o++){var B=T.TWO_PI*o/(O-1);v[o]=m(B),x[o]=M(B),C[D++]=0,C[D++]=0,C[D++]=i.z}for(o=1;o<y-1;o++){var z=Math.PI*o/(y-1),G=M(z),b=i.x*G,X=i.y*G,V=i.z*m(z);for(R=0;R<O;R++)C[D++]=v[R]*b,C[D++]=x[R]*X,C[D++]=V}for(o=0;o<O;o++)C[D++]=0,C[D++]=0,C[D++]=-i.z;var q=new c;S.position&&(q.position=new s({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:C}));var H=0,W=0,Y=0,k=0;if(S.st||S.normal||S.tangent||S.bitangent){for(o=0;o<p;o++){var K=n.fromArray(C,3*o,A),Z=f.geodeticSurfaceNormal(K,h);if(S.st){var j=e.negate(Z,I);e.magnitude(j)<T.EPSILON6&&(D=3*(o+O*Math.floor(.5*y)),D>C.length&&(D=3*(o-O*Math.floor(.5*y))),n.fromArray(C,D,j),f.geodeticSurfaceNormal(j,j),e.negate(j,j)),g[H++]=Math.atan2(j.y,j.x)/T.TWO_PI+.5,g[H++]=Math.asin(Z.z)/Math.PI+.5}if(S.normal&&(F[W++]=Z.x,F[W++]=Z.y,F[W++]=Z.z),S.tangent||S.bitangent){var Q=N;if(o<O||o>p-O-1?(n.cross(n.UNIT_X,Z,Q),n.normalize(Q,Q)):(n.cross(n.UNIT_Z,Z,Q),n.normalize(Q,Q)),S.tangent&&(P[Y++]=Q.x,P[Y++]=Q.y,P[Y++]=Q.z),S.bitangent){var J=n.cross(Z,Q,d);n.normalize(J,J),w[k++]=J.x,w[k++]=J.y,w[k++]=J.z}}}S.st&&(q.st=new s({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:g})),S.normal&&(q.normal=new s({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:F})),S.tangent&&(q.tangent=new s({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:P})),S.bitangent&&(q.bitangent=new s({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:w}))}for(D=0,R=0;R<O-1;R++)L[D++]=O+R,L[D++]=O+R+1,L[D++]=R+1;var $,tt;for(o=1;o<y-2;o++)for($=o*O,tt=(o+1)*O,R=0;R<O-1;R++)L[D++]=tt+R,L[D++]=tt+R+1,L[D++]=$+R+1,L[D++]=tt+R,L[D++]=$+R+1,L[D++]=$+R;for(o=y-2,$=o*O,tt=(o+1)*O,R=0;R<O-1;R++)L[D++]=tt+R,L[D++]=$+R+1,L[D++]=$+R;return new E({attributes:q,indices:L,primitiveType:l.TRIANGLES,boundingSphere:t.fromEllipsoid(f)})}},f}),define("Core/SphereGeometry",["./Cartesian3","./Check","./defaultValue","./defined","./DeveloperError","./EllipsoidGeometry","./VertexFormat"],function(t,e,n,r,a,i,o){"use strict";function u(e){var r=n(e.radius,1),a=new t(r,r,r),o={radii:a,stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,vertexFormat:e.vertexFormat};this._ellipsoidGeometry=new i(o),this._workerName="createSphereGeometry"}u.packedLength=i.packedLength,u.pack=function(t,e,n){return i.pack(t._ellipsoidGeometry,e,n)};var E=new i,s={radius:void 0,radii:new t,vertexFormat:new o,stackPartitions:void 0,slicePartitions:void 0};return u.unpack=function(e,n,a){var c=i.unpack(e,n,E);return s.vertexFormat=o.clone(c._vertexFormat,s.vertexFormat),s.stackPartitions=c._stackPartitions,s.slicePartitions=c._slicePartitions,r(a)?(t.clone(c._radii,s.radii),a._ellipsoidGeometry=new i(s),a):(s.radius=c._radii.x,new u(s))},u.createGeometry=function(t){return i.createGeometry(t._ellipsoidGeometry)},u}),define("Workers/createSphereGeometry",["../Core/defined","../Core/SphereGeometry"],function(t,e){"use strict";return function(n,r){return t(r)&&(n=e.unpack(n,r)),e.createGeometry(n)}})}(); \ No newline at end of file diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createSphereOutlineGeometry.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createSphereOutlineGeometry.js index 073f925a..2ab65dea 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createSphereOutlineGeometry.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createSphereOutlineGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,6 +55,6 @@ mersenne-twister.js - https://gist.github.com/banksean/300494 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==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";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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("Core/isArray",["./defined"],function(e){"use strict";var t=Array.isArray;return e(t)||(t=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),t}),define("Core/Check",["./defaultValue","./defined","./DeveloperError","./isArray"],function(e,t,n,r){"use strict";function i(e){return e+" was required but undefined."}function a(e,t,n){return"Expected "+n+" to be typeof "+t+", got "+e}var o={};return o.typeOf={},o.numeric={},o.defined=function(e,r){if(!t(e))throw new n(i(r))},o.numeric.maximum=function(e,t){if(o.typeOf.number(e),o.typeOf.number(t),e>t)throw new n("Expected "+e+" to be at most "+t)},o.numeric.minimum=function(e,t){if(o.typeOf.number(e),o.typeOf.number(t),e<t)throw new n("Expected "+e+" to be at least "+t)},o.typeOf.function=function(e,t){if("function"!=typeof e)throw new n(a(typeof e,"function",t))},o.typeOf.string=function(e,t){if("string"!=typeof e)throw new n(a(typeof e,"string",t))},o.typeOf.number=function(e,t){if("number"!=typeof e)throw new n(a(typeof e,"number",t))},o.typeOf.object=function(e,t){if("object"!=typeof e)throw new n(a(typeof e,"object",t))},o.typeOf.boolean=function(e,t){if("boolean"!=typeof e)throw new n(a(typeof e,"boolean",t))},o}),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 n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(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^=e<<7&2636928640,e^=e<<15&4022730752,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,n,r){"use strict";var i={};i.EPSILON1=.1,i.EPSILON2=.01,i.EPSILON3=.001,i.EPSILON4=1e-4,i.EPSILON5=1e-5,i.EPSILON6=1e-6,i.EPSILON7=1e-7,i.EPSILON8=1e-8,i.EPSILON9=1e-9,i.EPSILON10=1e-10,i.EPSILON11=1e-11,i.EPSILON12=1e-12,i.EPSILON13=1e-13,i.EPSILON14=1e-14,i.EPSILON15=1e-15,i.EPSILON16=1e-16,i.EPSILON17=1e-17,i.EPSILON18=1e-18,i.EPSILON19=1e-19,i.EPSILON20=1e-20,i.GRAVITATIONALPARAMETER=3986004418e5,i.SOLAR_RADIUS=6955e5,i.LUNAR_RADIUS=1737400,i.SIXTY_FOUR_KILOBYTES=65536,i.sign=function(e){return e>0?1:e<0?-1:0},i.signNotZero=function(e){return e<0?-1:1},i.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*i.clamp(e,-1,1)+.5)*n)},i.fromSNorm=function(e,n){return n=t(n,255),i.clamp(e,0,n)/n*2-1},i.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},i.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},i.lerp=function(e,t,n){return(1-n)*e+n*t},i.PI=Math.PI,i.ONE_OVER_PI=1/Math.PI,i.PI_OVER_TWO=.5*Math.PI,i.PI_OVER_THREE=Math.PI/3,i.PI_OVER_FOUR=Math.PI/4,i.PI_OVER_SIX=Math.PI/6,i.THREE_PI_OVER_TWO=3*Math.PI*.5,i.TWO_PI=2*Math.PI,i.ONE_OVER_TWO_PI=1/(2*Math.PI),i.RADIANS_PER_DEGREE=Math.PI/180,i.DEGREES_PER_RADIAN=180/Math.PI,i.RADIANS_PER_ARCSECOND=i.RADIANS_PER_DEGREE/3600,i.toRadians=function(e){return e*i.RADIANS_PER_DEGREE},i.toDegrees=function(e){return e*i.DEGREES_PER_RADIAN},i.convertLongitudeRange=function(e){var t=i.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},i.clampToLatitudeRange=function(e){return i.clamp(e,-1*i.PI_OVER_TWO,i.PI_OVER_TWO)},i.negativePiToPi=function(e){return i.zeroToTwoPi(e+i.PI)-i.PI},i.zeroToTwoPi=function(e){var t=i.mod(e,i.TWO_PI);return Math.abs(t)<i.EPSILON14&&Math.abs(e)>i.EPSILON14?i.TWO_PI:t},i.mod=function(e,t){return(e%t+t)%t},i.equalsEpsilon=function(e,n,r,i){i=t(i,r);var a=Math.abs(e-n);return a<=i||a<=r*Math.max(Math.abs(e),Math.abs(n))};var a=[1];i.factorial=function(e){var t=a.length;if(e>=t)for(var n=a[t-1],r=t;r<=e;r++)a.push(n*r);return a[e]},i.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},i.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},i.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},i.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return i.setRandomNumberSeed=function(t){o=new e(t)},i.nextRandomNumber=function(){return o.random()},i.acosClamped=function(e){return Math.acos(i.clamp(e,-1,1))},i.asinClamped=function(e){return Math.asin(i.clamp(e,-1,1))},i.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},i.logBase=function(e,t){return Math.log(e)/Math.log(t)},i.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},i}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var i=e.clock,a=e.cone,u=t(e.magnitude,1),E=u*Math.sin(a);return r.x=E*Math.cos(i),r.y=E*Math.sin(i),r.z=u*Math.cos(a),r},o.fromElements=function(e,t,r,i){return n(i)?(i.x=e,i.y=t,i.z=r,i):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new o),i.x=e[r++],i.y=e[r++],i.z=e[r],i},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var i=0;i<r;++i)o.pack(e[i],t,3*i);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var i=0;i<r;i+=3){var a=i/3;t[a]=o.unpack(e,i,t[a])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,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};var E=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,E),r=o.multiplyByScalar(e,1-n,r),o.add(E,r,r)};var s=new o,c=new o;o.angleBetween=function(e,t){o.normalize(e,s),o.normalize(t,c);var n=o.dot(s,c),r=o.magnitude(o.cross(s,c,s));return Math.atan2(r,n)};var _=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,_);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,i){return e===t||n(e)&&n(t)&&a.equalsEpsilon(e.x,t.x,r,i)&&a.equalsEpsilon(e.y,t.y,r,i)&&a.equalsEpsilon(e.z,t.z,r,i)},o.cross=function(e,t,n){var r=e.x,i=e.y,a=e.z,o=t.x,u=t.y,E=t.z,s=i*E-a*u,c=a*o-r*E,_=r*u-i*o;return n.x=s,n.y=c,n.z=_,n},o.fromDegrees=function(e,t,n,r,i){return e=a.toRadians(e),t=a.toRadians(t),o.fromRadians(e,t,n,r,i)};var T=new o,R=new o,l=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,i,a,u){i=t(i,0);var E=n(a)?a.radiiSquared:l,s=Math.cos(r);T.x=s*Math.cos(e),T.y=s*Math.sin(e),T.z=Math.sin(r),T=o.normalize(T,T),o.multiplyComponents(E,T,R);var c=Math.sqrt(o.dot(T,R));return R=o.divideByScalar(R,c,R),T=o.multiplyByScalar(T,i,T),n(u)||(u=new o),o.add(R,T,u)},o.fromDegreesArray=function(e,t,r){var i=e.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],E=e[a+1],s=a/2;r[s]=o.fromDegrees(u,E,0,t,r[s])}return r},o.fromRadiansArray=function(e,t,r){var i=e.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],E=e[a+1],s=a/2;r[s]=o.fromRadians(u,E,0,t,r[s])}return r},o.fromDegreesArrayHeights=function(e,t,r){var i=e.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],E=e[a+1],s=e[a+2],c=a/3;r[c]=o.fromDegrees(u,E,s,t,r[c])}return r},o.fromRadiansArrayHeights=function(e,t,r){var i=e.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],E=e[a+1],s=e[a+2],c=a/3;r[c]=o.fromRadians(u,E,s,t,r[c])}return r},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,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function i(n,i,u,E,s){var c=n.x,_=n.y,T=n.z,R=i.x,l=i.y,A=i.z,f=c*c*R*R,N=_*_*l*l,h=T*T*A*A,d=f+N+h,I=Math.sqrt(1/d),S=e.multiplyByScalar(n,I,a);if(d<E)return isFinite(I)?e.clone(S,s):void 0;var M=u.x,O=u.y,m=u.z,y=o;y.x=S.x*M*2,y.y=S.y*O*2,y.z=S.z*m*2;var p,C,U,L,P,F,v,D,w,g,B,x=(1-I)*e.magnitude(n)/(.5*e.magnitude(y)),z=0;do{x-=z,U=1/(1+x*M),L=1/(1+x*O),P=1/(1+x*m),F=U*U,v=L*L,D=P*P,w=F*U,g=v*L,B=D*P,p=f*F+N*v+h*D-1,C=f*w*M+N*g*O+h*B*m;var G=-2*C;z=p/G}while(Math.abs(p)>r.EPSILON12);return t(s)?(s.x=c*U,s.y=_*L,s.z=T*P,s):new e(c*U,_*L,T*P)}var a=new e,o=new e;return i}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,i,a,o){"use strict";function u(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)}u.fromRadians=function(e,r,i,a){return i=t(i,0),n(a)?(a.longitude=e,a.latitude=r,a.height=i,a):new u(e,r,i)},u.fromDegrees=function(e,t,n,r){return e=a.toRadians(e),t=a.toRadians(t),u.fromRadians(e,t,n,r)};var E=new e,s=new e,c=new e,_=new e(1/6378137,1/6378137,1/6356752.314245179),T=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),R=a.EPSILON1;return u.fromCartesian=function(t,r,i){var l=n(r)?r.oneOverRadii:_,A=n(r)?r.oneOverRadiiSquared:T,f=n(r)?r._centerToleranceSquared:R,N=o(t,l,A,f,s);if(n(N)){var h=e.multiplyComponents(N,A,E);h=e.normalize(h,h);var d=e.subtract(t,N,c),I=Math.atan2(h.y,h.x),S=Math.asin(h.z),M=a.sign(e.dot(d,t))*e.magnitude(d);return n(i)?(i.longitude=I,i.latitude=S,i.height=M,i):new u(I,S,M)}},u.clone=function(e,t){if(n(e))return n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},u.ZERO=i(new u(0,0,0)),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,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,i,a,o,u,E){"use strict";function s(t,r,i,a){r=n(r,0),i=n(i,0),a=n(a,0),t._radii=new e(r,i,a),t._radiiSquared=new e(r*r,i*i,a*a),t._radiiToTheFourth=new e(r*r*r*r,i*i*i*i,a*a*a*a),t._oneOverRadii=new e(0===r?0:1/r,0===i?0:1/i,0===a?0:1/a),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===i?0:1/(i*i),0===a?0:1/(a*a)),t._minimumRadius=Math.min(r,i,a),t._maximumRadius=Math.max(r,i,a),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function c(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,s(this,e,t,n)}i(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,n){if(r(t)){var i=t._radii;return r(n)?(e.clone(i,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new c(i.x,i.y,i.z)}},c.fromCartesian3=function(e,t){return r(t)||(t=new c),r(e)?(s(t,e.x,e.y,e.z),t):t},c.WGS84=o(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=o(new c(1,1,1)),c.MOON=o(new c(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),c.prototype.clone=function(e){return c.clone(this,e)},c.packedLength=e.packedLength,c.pack=function(t,r,i){return i=n(i,0),e.pack(t._radii,r,i),r},c.unpack=function(t,r,i){r=n(r,0);var a=e.unpack(t,r);return c.fromCartesian3(a,i)},c.prototype.geocentricSurfaceNormal=e.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(t,n){var i=t.longitude,a=t.latitude,o=Math.cos(a),u=o*Math.cos(i),E=o*Math.sin(i),s=Math.sin(a);return r(n)||(n=new e),n.x=u,n.y=E,n.z=s,e.normalize(n,n)},c.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var _=new e,T=new e;c.prototype.cartographicToCartesian=function(t,n){var i=_,a=T;this.geodeticSurfaceNormalCartographic(t,i),e.multiplyComponents(this._radiiSquared,i,a);var o=Math.sqrt(e.dot(i,a));return e.divideByScalar(a,o,a),e.multiplyByScalar(i,t.height,i),r(n)||(n=new e),e.add(a,i,n)},c.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;i<n;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var R=new e,l=new e,A=new e;return c.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,l);if(r(a)){var o=this.geodeticSurfaceNormal(a,R),E=e.subtract(n,a,A),s=Math.atan2(o.y,o.x),c=Math.asin(o.z),_=u.sign(e.dot(E,n))*e.magnitude(E);return r(i)?(i.longitude=s,i.latitude=c,i.height=_,i):new t(s,c,_)}},c.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;i<n;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t},c.prototype.scaleToGeodeticSurface=function(e,t){return E(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},c.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var i=t.x,a=t.y,o=t.z,u=this._oneOverRadiiSquared,E=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*u.z);return e.multiplyByScalar(t,E,n)},c.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},c.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},c.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},c.prototype.toString=function(){return this._radii.toString()},c.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,i,a){i=n(i,0);var o=this._sqauredXOverSquaredZ;if(r(a)||(a=new e),a.x=0,a.y=0,a.z=t.z*(1-o),!(Math.abs(a.z)>=this._radii.z-i))return a},c}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,i,a,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return i(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var i=this._semimajorAxis,a=t.longitude*i,o=t.latitude*i,u=t.height;return r(n)?(n.x=a,n.y=o,n.z=u,n):new e(a,o,u)},u.prototype.unproject=function(e,n){var i=this._oneOverSemimajorAxis,a=e.x*i,o=e.y*i,u=e.z;return r(n)?(n.longitude=a,n.latitude=o,n.height=u,n):new t(a,o,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";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a,o){"use strict";function u(e,n,r,i,a,o,u,E,s){this[0]=t(e,0),this[1]=t(i,0),this[2]=t(u,0),this[3]=t(n,0),this[4]=t(a,0),this[5]=t(E,0),this[6]=t(r,0),this[7]=t(o,0),this[8]=t(s,0)}function E(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function s(e){for(var t=0,n=0;n<3;++n){var r=e[u.getElementIndex(l[n],R[n])];t+=2*r*r}return Math.sqrt(t)}function c(e,t){for(var n=o.EPSILON15,r=0,i=1,a=0;a<3;++a){var E=Math.abs(e[u.getElementIndex(l[a],R[a])]);E>r&&(i=a,r=E)}var s=1,c=0,_=R[i],T=l[i];if(Math.abs(e[u.getElementIndex(T,_)])>n){var A,f=e[u.getElementIndex(T,T)],N=e[u.getElementIndex(_,_)],h=e[u.getElementIndex(T,_)],d=(f-N)/2/h;A=d<0?-1/(-d+Math.sqrt(1+d*d)):1/(d+Math.sqrt(1+d*d)),s=1/Math.sqrt(1+A*A),c=A*s}return t=u.clone(u.IDENTITY,t),t[u.getElementIndex(_,_)]=t[u.getElementIndex(T,T)]=s,t[u.getElementIndex(T,_)]=c,t[u.getElementIndex(_,T)]=-c,t}u.packedLength=9,u.pack=function(e,n,r){return r=t(r,0),n[r++]=e[0],n[r++]=e[1],n[r++]=e[2],n[r++]=e[3],n[r++]=e[4],n[r++]=e[5],n[r++]=e[6],n[r++]=e[7],n[r++]=e[8],n},u.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new u),i[0]=e[r++],i[1]=e[r++],i[2]=e[r++],i[3]=e[r++],i[4]=e[r++],i[5]=e[r++],i[6]=e[r++],i[7]=e[r++],i[8]=e[r++],i},u.clone=function(e,t){if(n(e))return n(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 u(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},u.fromArray=function(e,r,i){return r=t(r,0),n(i)||(i=new u),i[0]=e[r],i[1]=e[r+1],i[2]=e[r+2],i[3]=e[r+3],i[4]=e[r+4],i[5]=e[r+5],i[6]=e[r+6],i[7]=e[r+7],i[8]=e[r+8],i},u.fromColumnMajorArray=function(e,t){return u.clone(e,t)},u.fromRowMajorArray=function(e,t){return n(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 u(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},u.fromQuaternion=function(e,t){var r=e.x*e.x,i=e.x*e.y,a=e.x*e.z,o=e.x*e.w,E=e.y*e.y,s=e.y*e.z,c=e.y*e.w,_=e.z*e.z,T=e.z*e.w,R=e.w*e.w,l=r-E-_+R,A=2*(i-T),f=2*(a+c),N=2*(i+T),h=-r+E-_+R,d=2*(s-o),I=2*(a-c),S=2*(s+o),M=-r-E+_+R;return n(t)?(t[0]=l,t[1]=N,t[2]=I,t[3]=A,t[4]=h,t[5]=S,t[6]=f,t[7]=d,t[8]=M,t):new u(l,A,f,N,h,d,I,S,M)},u.fromHeadingPitchRoll=function(e,t){var r=Math.cos(-e.pitch),i=Math.cos(-e.heading),a=Math.cos(e.roll),o=Math.sin(-e.pitch),E=Math.sin(-e.heading),s=Math.sin(e.roll),c=r*i,_=-a*E+s*o*i,T=s*E+a*o*i,R=r*E,l=a*i+s*o*E,A=-o*a+a*o*E,f=-o,N=s*r,h=a*r;return n(t)?(t[0]=c,t[1]=R,t[2]=f,t[3]=_,t[4]=l,t[5]=N,t[6]=T,t[7]=A,t[8]=h,t):new u(c,_,T,R,l,A,f,N,h)},u.fromScale=function(e,t){return n(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 u(e.x,0,0,0,e.y,0,0,0,e.z)},u.fromUniformScale=function(e,t){return n(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 u(e,0,0,0,e,0,0,0,e)},u.fromCrossProduct=function(e,t){return n(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 u(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},u.fromRotationX=function(e,t){var r=Math.cos(e),i=Math.sin(e);return n(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=r,t[5]=i,t[6]=0,t[7]=-i,t[8]=r,t):new u(1,0,0,0,r,-i,0,i,r)},u.fromRotationY=function(e,t){var r=Math.cos(e),i=Math.sin(e);return n(t)?(t[0]=r,t[1]=0,t[2]=-i,t[3]=0,t[4]=1,t[5]=0,t[6]=i,t[7]=0,t[8]=r,t):new u(r,0,i,0,1,0,-i,0,r)},u.fromRotationZ=function(e,t){var r=Math.cos(e),i=Math.sin(e);return n(t)?(t[0]=r,t[1]=i,t[2]=0,t[3]=-i,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new u(r,-i,0,i,r,0,0,0,1)},u.toArray=function(e,t){return n(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]]},u.getElementIndex=function(e,t){return 3*e+t},u.getColumn=function(e,t,n){var r=3*t,i=e[r],a=e[r+1],o=e[r+2];return n.x=i,n.y=a,n.z=o,n},u.setColumn=function(e,t,n,r){r=u.clone(e,r);var i=3*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},u.getRow=function(e,t,n){var r=e[t],i=e[t+3],a=e[t+6];return n.x=r,n.y=i,n.z=a,n},u.setRow=function(e,t,n,r){return r=u.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var _=new e;u.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],_)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],_)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],_)),n};var T=new e;u.getMaximumScale=function(t){return u.getScale(t,T),e.maximumComponent(T)},u.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],i=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],o=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],E=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],s=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],c=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],_=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=r,n[1]=i,n[2]=a,n[3]=o,n[4]=u,n[5]=E,n[6]=s,n[7]=c,n[8]=_,n},u.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},u.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},u.multiplyByVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[3]*i+e[6]*a,u=e[1]*r+e[4]*i+e[7]*a,E=e[2]*r+e[5]*i+e[8]*a;return n.x=o,n.y=u,n.z=E,n},u.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},u.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},u.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},u.transpose=function(e,t){var n=e[0],r=e[3],i=e[6],a=e[1],o=e[4],u=e[7],E=e[2],s=e[5],c=e[8];return t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=u,t[6]=E,t[7]=s,t[8]=c,t};var R=[1,0,0],l=[2,2,1],A=new u,f=new u;return u.computeEigenDecomposition=function(e,t){var r=o.EPSILON20,i=10,a=0,_=0;n(t)||(t={});for(var T=t.unitary=u.clone(u.IDENTITY,t.unitary),R=t.diagonal=u.clone(e,t.diagonal),l=r*E(R);_<i&&s(R)>l;)c(R,A),u.transpose(A,f),u.multiply(R,A,R),u.multiply(f,R,R),u.multiply(T,A,T),++a>2&&(++_,a=0);return t},u.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},u.determinant=function(e){var t=e[0],n=e[3],r=e[6],i=e[1],a=e[4],o=e[7],u=e[2],E=e[5],s=e[8];return t*(a*s-E*o)+i*(E*r-n*s)+u*(n*o-a*r)},u.inverse=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],E=e[5],s=e[6],c=e[7],_=e[8],T=u.determinant(e);t[0]=o*_-c*E,t[1]=c*i-r*_,t[2]=r*E-o*i,t[3]=s*E-a*_,t[4]=n*_-s*i,t[5]=a*i-n*E,t[6]=a*c-s*o,t[7]=s*r-n*c,t[8]=n*o-a*r;var R=1/T;return u.multiplyByScalar(t,R,t)},u.equals=function(e,t){return e===t||n(e)&&n(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]},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r},u.IDENTITY=a(new u(1,0,0,0,1,0,0,0,1)),u.ZERO=a(new u(0,0,0,0,0,0,0,0,0)),u.COLUMN0ROW0=0,u.COLUMN0ROW1=1,u.COLUMN0ROW2=2,u.COLUMN1ROW0=3,u.COLUMN1ROW1=4,u.COLUMN1ROW2=5,u.COLUMN2ROW0=6,u.COLUMN2ROW1=7,u.COLUMN2ROW2=8,r(u.prototype,{length:{get:function(){return u.packedLength}}}),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},u}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i){"use strict";function a(t,n,r,i){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0),this.w=e(i,0)}a.fromElements=function(e,n,r,i,o){return t(o)?(o.x=e,o.y=n,o.z=r,o.w=i,o):new a(e,n,r,i)},a.fromColor=function(e,n){return t(n)?(n.x=e.red,n.y=e.green,n.z=e.blue,n.w=e.alpha,n):new a(e.red,e.green,e.blue,e.alpha)},a.clone=function(e,n){if(t(e))return t(n)?(n.x=e.x,n.y=e.y,n.z=e.z,n.w=e.w,n):new a(e.x,e.y,e.z,e.w)},a.packedLength=4,a.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w,n},a.unpack=function(n,r,i){return r=e(r,0),t(i)||(i=new a),i.x=n[r++],i.y=n[r++],i.z=n[r++],i.w=n[r],i},a.packArray=function(e,n){var r=e.length;t(n)?n.length=4*r:n=new Array(4*r);for(var i=0;i<r;++i)a.pack(e[i],n,4*i);return n},a.unpackArray=function(e,n){var r=e.length;t(n)?n.length=r/4:n=new Array(r/4);for(var i=0;i<r;i+=4){var o=i/4;n[o]=a.unpack(e,i,n[o])}return n},a.fromArray=a.unpack,a.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},a.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},a.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},a.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},a.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},a.magnitude=function(e){return Math.sqrt(a.magnitudeSquared(e))};var o=new a;a.distance=function(e,t){return a.subtract(e,t,o),a.magnitude(o)},a.distanceSquared=function(e,t){return a.subtract(e,t,o),a.magnitudeSquared(o)},a.normalize=function(e,t){var n=a.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t},a.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},a.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},a.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},a.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},a.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},a.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},a.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},a.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,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.w=Math.abs(e.w),t};var u=new a;a.lerp=function(e,t,n,r){return a.multiplyByScalar(t,n,u),r=a.multiplyByScalar(e,1-n,r),a.add(u,r,r)};var E=new a;return a.mostOrthogonalAxis=function(e,t){var n=a.normalize(e,E);return a.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?a.clone(a.UNIT_X,t):a.clone(a.UNIT_W,t):n.z<=n.w?a.clone(a.UNIT_Z,t):a.clone(a.UNIT_W,t):n.y<=n.z?n.y<=n.w?a.clone(a.UNIT_Y,t):a.clone(a.UNIT_W,t):n.z<=n.w?a.clone(a.UNIT_Z,t):a.clone(a.UNIT_W,t)},a.equals=function(e,n){return e===n||t(e)&&t(n)&&e.x===n.x&&e.y===n.y&&e.z===n.z&&e.w===n.w},a.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},a.equalsEpsilon=function(e,n,r,a){return e===n||t(e)&&t(n)&&i.equalsEpsilon(e.x,n.x,r,a)&&i.equalsEpsilon(e.y,n.y,r,a)&&i.equalsEpsilon(e.z,n.z,r,a)&&i.equalsEpsilon(e.w,n.w,r,a)},a.ZERO=r(new a(0,0,0,0)),a.UNIT_X=r(new a(1,0,0,0)),a.UNIT_Y=r(new a(0,1,0,0)),a.UNIT_Z=r(new a(0,0,1,0)),a.UNIT_W=r(new a(0,0,0,1)),a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,n){return a.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},a}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,i,a,o,u,E,s){"use strict";function c(e,t,r,i,a,o,u,E,s,c,_,T,R,l,A,f){this[0]=n(e,0),this[1]=n(a,0),this[2]=n(s,0),this[3]=n(R,0),this[4]=n(t,0), -this[5]=n(o,0),this[6]=n(c,0),this[7]=n(l,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(_,0),this[11]=n(A,0),this[12]=n(i,0),this[13]=n(E,0),this[14]=n(T,0),this[15]=n(f,0)}c.packedLength=16,c.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t[r++]=e[9],t[r++]=e[10],t[r++]=e[11],t[r++]=e[12],t[r++]=e[13],t[r++]=e[14],t[r]=e[15],t},c.unpack=function(e,t,i){return t=n(t,0),r(i)||(i=new c),i[0]=e[t++],i[1]=e[t++],i[2]=e[t++],i[3]=e[t++],i[4]=e[t++],i[5]=e[t++],i[6]=e[t++],i[7]=e[t++],i[8]=e[t++],i[9]=e[t++],i[10]=e[t++],i[11]=e[t++],i[12]=e[t++],i[13]=e[t++],i[14]=e[t++],i[15]=e[t],i},c.clone=function(e,t){if(r(e))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):new c(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])},c.fromArray=c.unpack,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[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 c(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])},c.fromRotationTranslation=function(t,i,a){return i=n(i,e.ZERO),r(a)?(a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=0,a[4]=t[3],a[5]=t[4],a[6]=t[5],a[7]=0,a[8]=t[6],a[9]=t[7],a[10]=t[8],a[11]=0,a[12]=i.x,a[13]=i.y,a[14]=i.z,a[15]=1,a):new c(t[0],t[3],t[6],i.x,t[1],t[4],t[7],i.y,t[2],t[5],t[8],i.z,0,0,0,1)},c.fromTranslationQuaternionRotationScale=function(e,t,n,i){r(i)||(i=new c);var a=n.x,o=n.y,u=n.z,E=t.x*t.x,s=t.x*t.y,_=t.x*t.z,T=t.x*t.w,R=t.y*t.y,l=t.y*t.z,A=t.y*t.w,f=t.z*t.z,N=t.z*t.w,h=t.w*t.w,d=E-R-f+h,I=2*(s-N),S=2*(_+A),M=2*(s+N),O=-E+R-f+h,m=2*(l-T),y=2*(_-A),p=2*(l+T),C=-E-R+f+h;return i[0]=d*a,i[1]=M*a,i[2]=y*a,i[3]=0,i[4]=I*o,i[5]=O*o,i[6]=p*o,i[7]=0,i[8]=S*u,i[9]=m*u,i[10]=C*u,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i},c.fromTranslationRotationScale=function(e,t){return c.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},c.fromTranslation=function(e,t){return c.fromRotationTranslation(E.IDENTITY,e,t)},c.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 c(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},c.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 c(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var _=new e,T=new e,R=new e;c.fromCamera=function(t,n){var i=t.position,a=t.direction,o=t.up;e.normalize(a,_),e.normalize(e.cross(_,o,T),T),e.normalize(e.cross(T,_,R),R);var u=T.x,E=T.y,s=T.z,l=_.x,A=_.y,f=_.z,N=R.x,h=R.y,d=R.z,I=i.x,S=i.y,M=i.z,O=u*-I+E*-S+s*-M,m=N*-I+h*-S+d*-M,y=l*I+A*S+f*M;return r(n)?(n[0]=u,n[1]=N,n[2]=-l,n[3]=0,n[4]=E,n[5]=h,n[6]=-A,n[7]=0,n[8]=s,n[9]=d,n[10]=-f,n[11]=0,n[12]=O,n[13]=m,n[14]=y,n[15]=1,n):new c(u,E,s,O,N,h,d,m,-l,-A,-f,y,0,0,0,1)},c.computePerspectiveFieldOfView=function(e,t,n,r,i){var a=Math.tan(.5*e),o=1/a,u=o/t,E=(r+n)/(n-r),s=2*r*n/(n-r);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=o,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=E,i[11]=-1,i[12]=0,i[13]=0,i[14]=s,i[15]=0,i},c.computeOrthographicOffCenter=function(e,t,n,r,i,a,o){var u=1/(t-e),E=1/(r-n),s=1/(a-i),c=-(t+e)*u,_=-(r+n)*E,T=-(a+i)*s;return u*=2,E*=2,s*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=s,o[11]=0,o[12]=c,o[13]=_,o[14]=T,o[15]=1,o},c.computePerspectiveOffCenter=function(e,t,n,r,i,a,o){var u=2*i/(t-e),E=2*i/(r-n),s=(t+e)/(t-e),c=(r+n)/(r-n),_=-(a+i)/(a-i),T=-1,R=-2*a*i/(a-i);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=s,o[9]=c,o[10]=_,o[11]=T,o[12]=0,o[13]=0,o[14]=R,o[15]=0,o},c.computeInfinitePerspectiveOffCenter=function(e,t,n,r,i,a){var o=2*i/(t-e),u=2*i/(r-n),E=(t+e)/(t-e),s=(r+n)/(r-n),c=-1,_=-1,T=-2*i;return a[0]=o,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=E,a[9]=s,a[10]=c,a[11]=_,a[12]=0,a[13]=0,a[14]=T,a[15]=0,a},c.computeViewportTransformation=function(e,t,r,i){e=n(e,n.EMPTY_OBJECT);var a=n(e.x,0),o=n(e.y,0),u=n(e.width,0),E=n(e.height,0);t=n(t,0),r=n(r,1);var s=.5*u,c=.5*E,_=.5*(r-t),T=s,R=c,l=_,A=a+s,f=o+c,N=t+_,h=1;return i[0]=T,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=R,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=l,i[11]=0,i[12]=A,i[13]=f,i[14]=N,i[15]=h,i},c.computeView=function(t,n,r,i,a){return a[0]=i.x,a[1]=r.x,a[2]=-n.x,a[3]=0,a[4]=i.y,a[5]=r.y,a[6]=-n.y,a[7]=0,a[8]=i.z,a[9]=r.z,a[10]=-n.z,a[11]=0,a[12]=-e.dot(i,t),a[13]=-e.dot(r,t),a[14]=e.dot(n,t),a[15]=1,a},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[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]]},c.getElementIndex=function(e,t){return 4*e+t},c.getColumn=function(e,t,n){var r=4*t,i=e[r],a=e[r+1],o=e[r+2],u=e[r+3];return n.x=i,n.y=a,n.z=o,n.w=u,n},c.setColumn=function(e,t,n,r){r=c.clone(e,r);var i=4*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r[i+3]=n.w,r},c.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},c.getRow=function(e,t,n){var r=e[t],i=e[t+4],a=e[t+8],o=e[t+12];return n.x=r,n.y=i,n.z=a,n.w=o,n},c.setRow=function(e,t,n,r){return r=c.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var l=new e;c.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],l)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],l)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],l)),n};var A=new e;c.getMaximumScale=function(t){return c.getScale(t,A),e.maximumComponent(A)},c.multiply=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[3],u=e[4],E=e[5],s=e[6],c=e[7],_=e[8],T=e[9],R=e[10],l=e[11],A=e[12],f=e[13],N=e[14],h=e[15],d=t[0],I=t[1],S=t[2],M=t[3],O=t[4],m=t[5],y=t[6],p=t[7],C=t[8],U=t[9],L=t[10],P=t[11],F=t[12],v=t[13],D=t[14],w=t[15],g=r*d+u*I+_*S+A*M,B=i*d+E*I+T*S+f*M,x=a*d+s*I+R*S+N*M,z=o*d+c*I+l*S+h*M,G=r*O+u*m+_*y+A*p,b=i*O+E*m+T*y+f*p,X=a*O+s*m+R*y+N*p,V=o*O+c*m+l*y+h*p,H=r*C+u*U+_*L+A*P,W=i*C+E*U+T*L+f*P,q=a*C+s*U+R*L+N*P,Y=o*C+c*U+l*L+h*P,k=r*F+u*v+_*D+A*w,K=i*F+E*v+T*D+f*w,Z=a*F+s*v+R*D+N*w,j=o*F+c*v+l*D+h*w;return n[0]=g,n[1]=B,n[2]=x,n[3]=z,n[4]=G,n[5]=b,n[6]=X,n[7]=V,n[8]=H,n[9]=W,n[10]=q,n[11]=Y,n[12]=k,n[13]=K,n[14]=Z,n[15]=j,n},c.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},c.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},c.multiplyTransformation=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[4],u=e[5],E=e[6],s=e[8],c=e[9],_=e[10],T=e[12],R=e[13],l=e[14],A=t[0],f=t[1],N=t[2],h=t[4],d=t[5],I=t[6],S=t[8],M=t[9],O=t[10],m=t[12],y=t[13],p=t[14],C=r*A+o*f+s*N,U=i*A+u*f+c*N,L=a*A+E*f+_*N,P=r*h+o*d+s*I,F=i*h+u*d+c*I,v=a*h+E*d+_*I,D=r*S+o*M+s*O,w=i*S+u*M+c*O,g=a*S+E*M+_*O,B=r*m+o*y+s*p+T,x=i*m+u*y+c*p+R,z=a*m+E*y+_*p+l;return n[0]=C,n[1]=U,n[2]=L,n[3]=0,n[4]=P,n[5]=F,n[6]=v,n[7]=0,n[8]=D,n[9]=w,n[10]=g,n[11]=0,n[12]=B,n[13]=x,n[14]=z,n[15]=1,n},c.multiplyByMatrix3=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[4],u=e[5],E=e[6],s=e[8],c=e[9],_=e[10],T=t[0],R=t[1],l=t[2],A=t[3],f=t[4],N=t[5],h=t[6],d=t[7],I=t[8],S=r*T+o*R+s*l,M=i*T+u*R+c*l,O=a*T+E*R+_*l,m=r*A+o*f+s*N,y=i*A+u*f+c*N,p=a*A+E*f+_*N,C=r*h+o*d+s*I,U=i*h+u*d+c*I,L=a*h+E*d+_*I;return n[0]=S,n[1]=M,n[2]=O,n[3]=0,n[4]=m,n[5]=y,n[6]=p,n[7]=0,n[8]=C,n[9]=U,n[10]=L,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},c.multiplyByTranslation=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=r*e[0]+i*e[4]+a*e[8]+e[12],u=r*e[1]+i*e[5]+a*e[9]+e[13],E=r*e[2]+i*e[6]+a*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=E,n[15]=e[15],n};var f=new e;c.multiplyByUniformScale=function(e,t,n){return f.x=t,f.y=t,f.z=t,c.multiplyByScale(e,f,n)},c.multiplyByScale=function(e,t,n){var r=t.x,i=t.y,a=t.z;return 1===r&&1===i&&1===a?c.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=i*e[4],n[5]=i*e[5],n[6]=i*e[6],n[7]=0,n[8]=a*e[8],n[9]=a*e[9],n[10]=a*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},c.multiplyByVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=t.w,u=e[0]*r+e[4]*i+e[8]*a+e[12]*o,E=e[1]*r+e[5]*i+e[9]*a+e[13]*o,s=e[2]*r+e[6]*i+e[10]*a+e[14]*o,c=e[3]*r+e[7]*i+e[11]*a+e[15]*o;return n.x=u,n.y=E,n.z=s,n.w=c,n},c.multiplyByPointAsVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[4]*i+e[8]*a,u=e[1]*r+e[5]*i+e[9]*a,E=e[2]*r+e[6]*i+e[10]*a;return n.x=o,n.y=u,n.z=E,n},c.multiplyByPoint=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[4]*i+e[8]*a+e[12],u=e[1]*r+e[5]*i+e[9]*a+e[13],E=e[2]*r+e[6]*i+e[10]*a+e[14];return n.x=o,n.y=u,n.z=E,n},c.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},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[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},c.transpose=function(e,t){var n=e[1],r=e[2],i=e[3],a=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=a,t[10]=e[10],t[11]=e[14],t[12]=i,t[13]=o,t[14]=u,t[15]=e[15],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[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},c.equals=function(e,t){return e===t||r(e)&&r(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},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&&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},c.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},c.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};var N=new E,h=new E,d=new t,I=new t(0,0,0,1);return c.inverse=function(e,n){if(E.equalsEpsilon(c.getRotation(e,N),h,u.EPSILON7)&&t.equals(c.getRow(e,3,d),I))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],i=e[4],a=e[8],o=e[12],_=e[1],T=e[5],R=e[9],l=e[13],A=e[2],f=e[6],S=e[10],M=e[14],O=e[3],m=e[7],y=e[11],p=e[15],C=S*p,U=M*y,L=f*p,P=M*m,F=f*y,v=S*m,D=A*p,w=M*O,g=A*y,B=S*O,x=A*m,z=f*O,G=C*T+P*R+F*l-(U*T+L*R+v*l),b=U*_+D*R+B*l-(C*_+w*R+g*l),X=L*_+w*T+x*l-(P*_+D*T+z*l),V=v*_+g*T+z*R-(F*_+B*T+x*R),H=U*i+L*a+v*o-(C*i+P*a+F*o),W=C*r+w*a+g*o-(U*r+D*a+B*o),q=P*r+D*i+z*o-(L*r+w*i+x*o),Y=F*r+B*i+x*a-(v*r+g*i+z*a);C=a*l,U=o*R,L=i*l,P=o*T,F=i*R,v=a*T,D=r*l,w=o*_,g=r*R,B=a*_,x=r*T,z=i*_;var k=C*m+P*y+F*p-(U*m+L*y+v*p),K=U*O+D*y+B*p-(C*O+w*y+g*p),Z=L*O+w*m+x*p-(P*O+D*m+z*p),j=v*O+g*m+z*y-(F*O+B*m+x*y),Q=L*S+v*M+U*f-(F*M+C*f+P*S),J=g*M+C*A+w*S-(D*S+B*M+U*A),$=D*f+z*M+P*A-(x*M+L*A+w*f),ee=x*S+F*A+B*f-(g*f+z*S+v*A),te=r*G+i*b+a*X+o*V;if(Math.abs(te)<u.EPSILON20)throw new s("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=G*te,n[1]=b*te,n[2]=X*te,n[3]=V*te,n[4]=H*te,n[5]=W*te,n[6]=q*te,n[7]=Y*te,n[8]=k*te,n[9]=K*te,n[10]=Z*te,n[11]=j*te,n[12]=Q*te,n[13]=J*te,n[14]=$*te,n[15]=ee*te,n},c.inverseTransformation=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[4],o=e[5],u=e[6],E=e[8],s=e[9],c=e[10],_=e[12],T=e[13],R=e[14],l=-n*_-r*T-i*R,A=-a*_-o*T-u*R,f=-E*_-s*T-c*R;return t[0]=n,t[1]=a,t[2]=E,t[3]=0,t[4]=r,t[5]=o,t[6]=s,t[7]=0,t[8]=i,t[9]=u,t[10]=c,t[11]=0,t[12]=l,t[13]=A,t[14]=f,t[15]=1,t},c.IDENTITY=o(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),c.ZERO=o(new c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN0ROW3=3,c.COLUMN1ROW0=4,c.COLUMN1ROW1=5,c.COLUMN1ROW2=6,c.COLUMN1ROW3=7,c.COLUMN2ROW0=8,c.COLUMN2ROW1=9,c.COLUMN2ROW2=10,c.COLUMN2ROW3=11,c.COLUMN3ROW0=12,c.COLUMN3ROW1=13,c.COLUMN3ROW2=14,c.COLUMN3ROW3=15,i(c.prototype,{length:{get:function(){return c.packedLength}}}),c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.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]+")"},c}),define("Core/Rectangle",["./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,i,a,o,u){"use strict";function E(e,n,r,i){this.west=t(e,0),this.south=t(n,0),this.east=t(r,0),this.north=t(i,0)}r(E.prototype,{width:{get:function(){return E.computeWidth(this)}},height:{get:function(){return E.computeHeight(this)}}}),E.packedLength=4,E.pack=function(e,n,r){return r=t(r,0),n[r++]=e.west,n[r++]=e.south,n[r++]=e.east,n[r]=e.north,n},E.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new E),i.west=e[r++],i.south=e[r++],i.east=e[r++],i.north=e[r],i},E.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=u.TWO_PI),t-n},E.computeHeight=function(e){return e.north-e.south},E.fromDegrees=function(e,r,i,a,o){return e=u.toRadians(t(e,0)),r=u.toRadians(t(r,0)),i=u.toRadians(t(i,0)),a=u.toRadians(t(a,0)),n(o)?(o.west=e,o.south=r,o.east=i,o.north=a,o):new E(e,r,i,a)},E.fromCartographicArray=function(e,t){for(var r=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=Number.MAX_VALUE,c=-Number.MAX_VALUE,_=0,T=e.length;_<T;_++){var R=e[_];r=Math.min(r,R.longitude),i=Math.max(i,R.longitude),s=Math.min(s,R.latitude),c=Math.max(c,R.latitude);var l=R.longitude>=0?R.longitude:R.longitude+u.TWO_PI;a=Math.min(a,l),o=Math.max(o,l)}return i-r>o-a&&(r=a,i=o,i>u.PI&&(i-=u.TWO_PI),r>u.PI&&(r-=u.TWO_PI)),n(t)?(t.west=r,t.south=s,t.east=i,t.north=c,t):new E(r,s,i,c)},E.fromCartesianArray=function(e,t,r){for(var i=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,s=-Number.MAX_VALUE,c=Number.MAX_VALUE,_=-Number.MAX_VALUE,T=0,R=e.length;T<R;T++){var l=t.cartesianToCartographic(e[T]);i=Math.min(i,l.longitude),a=Math.max(a,l.longitude),c=Math.min(c,l.latitude),_=Math.max(_,l.latitude);var A=l.longitude>=0?l.longitude:l.longitude+u.TWO_PI;o=Math.min(o,A),s=Math.max(s,A)}return a-i>s-o&&(i=o,a=s,a>u.PI&&(a-=u.TWO_PI),i>u.PI&&(i-=u.TWO_PI)),n(r)?(r.west=i,r.south=c,r.east=a,r.north=_,r):new E(i,c,a,_)},E.clone=function(e,t){if(n(e))return n(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new E(e.west,e.south,e.east,e.north)},E.prototype.clone=function(e){return E.clone(this,e)},E.prototype.equals=function(e){return E.equals(this,e)},E.equals=function(e,t){return e===t||n(e)&&n(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},E.prototype.equalsEpsilon=function(e,t){return n(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},E.validate=function(e){},E.southwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.south,r.height=0,r):new e(t.west,t.south)},E.northwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.north,r.height=0,r):new e(t.west,t.north)},E.northeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.north,r.height=0,r):new e(t.east,t.north)},E.southeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.south,r.height=0,r):new e(t.east,t.south)},E.center=function(t,r){var i=t.east,a=t.west;i<a&&(i+=u.TWO_PI);var o=u.negativePiToPi(.5*(a+i)),E=.5*(t.south+t.north);return n(r)?(r.longitude=o,r.latitude=E,r.height=0,r):new e(o,E)},E.intersection=function(e,t,r){var i=e.east,a=e.west,o=t.east,s=t.west;i<a&&o>0?i+=u.TWO_PI:o<s&&i>0&&(o+=u.TWO_PI),i<a&&s<0?s+=u.TWO_PI:o<s&&a<0&&(a+=u.TWO_PI);var c=u.negativePiToPi(Math.max(a,s)),_=u.negativePiToPi(Math.min(i,o));if(!((e.west<e.east||t.west<t.east)&&_<=c)){var T=Math.max(e.south,t.south),R=Math.min(e.north,t.north);if(!(T>=R))return n(r)?(r.west=c,r.south=T,r.east=_,r.north=R,r):new E(c,T,_,R)}},E.simpleIntersection=function(e,t,r){var i=Math.max(e.west,t.west),a=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(a>=u||i>=o))return n(r)?(r.west=i,r.south=a,r.east=o,r.north=u,r):new E(i,a,o,u)},E.union=function(e,t,r){n(r)||(r=new E);var i=e.east,a=e.west,o=t.east,s=t.west;i<a&&o>0?i+=u.TWO_PI:o<s&&i>0&&(o+=u.TWO_PI),i<a&&s<0?s+=u.TWO_PI:o<s&&a<0&&(a+=u.TWO_PI);var c=u.convertLongitudeRange(Math.min(a,s)),_=u.convertLongitudeRange(Math.max(i,o));return r.west=c,r.south=Math.min(e.south,t.south),r.east=_,r.north=Math.max(e.north,t.north),r},E.expand=function(e,t,r){return n(r)||(r=new E),r.west=Math.min(e.west,t.longitude),r.south=Math.min(e.south,t.latitude),r.east=Math.max(e.east,t.longitude),r.north=Math.max(e.north,t.latitude),r},E.contains=function(e,t){var n=t.longitude,r=t.latitude,i=e.west,a=e.east;return a<i&&(a+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>i||u.equalsEpsilon(n,i,u.EPSILON14))&&(n<a||u.equalsEpsilon(n,a,u.EPSILON14))&&r>=e.south&&r<=e.north};var s=new e;return E.subsample=function(e,r,i,o){r=t(r,a.WGS84),i=t(i,0),n(o)||(o=[]);var c=0,_=e.north,T=e.south,R=e.east,l=e.west,A=s;A.height=i,A.longitude=l,A.latitude=_,o[c]=r.cartographicToCartesian(A,o[c]),c++,A.longitude=R,o[c]=r.cartographicToCartesian(A,o[c]),c++,A.latitude=T,o[c]=r.cartographicToCartesian(A,o[c]),c++,A.longitude=l,o[c]=r.cartographicToCartesian(A,o[c]),c++,_<0?A.latitude=_:T>0?A.latitude=T:A.latitude=0;for(var f=1;f<8;++f)A.longitude=-Math.PI+f*u.PI_OVER_TWO,E.contains(e,A)&&(o[c]=r.cartographicToCartesian(A,o[c]),c++);return 0===A.latitude&&(A.longitude=l,o[c]=r.cartographicToCartesian(A,o[c]),c++,A.longitude=R,o[c]=r.cartographicToCartesian(A,o[c]),c++),o.length=c,o},E.MAX_VALUE=o(new E(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),E}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,i,a,o,u,E,s,c,_){"use strict";function T(t,r){this.center=e.clone(n(t,e.ZERO)),this.radius=n(r,0)}var R=new e,l=new e,A=new e,f=new e,N=new e,h=new e,d=new e,I=new e,S=new e,M=new e,O=new e,m=new e;T.fromPoints=function(t,n){if(r(n)||(n=new T),!r(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var i=e.clone(t[0],d),a=e.clone(i,R),o=e.clone(i,l),u=e.clone(i,A),E=e.clone(i,f),s=e.clone(i,N),c=e.clone(i,h),_=t.length,y=1;y<_;y++){e.clone(t[y],i);var p=i.x,C=i.y,U=i.z;p<a.x&&e.clone(i,a),p>E.x&&e.clone(i,E),C<o.y&&e.clone(i,o),C>s.y&&e.clone(i,s),U<u.z&&e.clone(i,u),U>c.z&&e.clone(i,c)}var L=e.magnitudeSquared(e.subtract(E,a,I)),P=e.magnitudeSquared(e.subtract(s,o,I)),F=e.magnitudeSquared(e.subtract(c,u,I)),v=a,D=E,w=L;P>w&&(w=P,v=o,D=s),F>w&&(w=F,v=u,D=c);var g=S;g.x=.5*(v.x+D.x),g.y=.5*(v.y+D.y),g.z=.5*(v.z+D.z);var B=e.magnitudeSquared(e.subtract(D,g,I)),x=Math.sqrt(B),z=M;z.x=a.x,z.y=o.y,z.z=u.z;var G=O;G.x=E.x,G.y=s.y,G.z=c.z;var b=e.multiplyByScalar(e.add(z,G,I),.5,m),X=0;for(y=0;y<_;y++){e.clone(t[y],i);var V=e.magnitude(e.subtract(i,b,I));V>X&&(X=V);var H=e.magnitudeSquared(e.subtract(i,g,I));if(H>B){var W=Math.sqrt(H);x=.5*(x+W),B=x*x;var q=W-x;g.x=(x*g.x+q*i.x)/W,g.y=(x*g.y+q*i.y)/W,g.z=(x*g.z+q*i.z)/W}}return x<X?(e.clone(g,n.center),n.radius=x):(e.clone(b,n.center),n.radius=X),n};var y=new o,p=new e,C=new e,U=new t,L=new t;T.fromRectangle2D=function(e,t,n){return T.fromRectangleWithHeights2D(e,t,0,0,n)},T.fromRectangleWithHeights2D=function(t,i,a,o,u){if(r(u)||(u=new T),!r(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;i=n(i,y),_.southwest(t,U),U.height=a,_.northeast(t,L),L.height=o;var E=i.project(U,p),s=i.project(L,C),c=s.x-E.x,R=s.y-E.y,l=s.z-E.z;u.radius=.5*Math.sqrt(c*c+R*R+l*l);var A=u.center;return A.x=E.x+.5*c,A.y=E.y+.5*R,A.z=E.z+.5*l,u};var P=[];T.fromRectangle3D=function(e,t,i,o){t=n(t,a.WGS84),i=n(i,0);var u;return r(e)&&(u=_.subsample(e,t,i,P)),T.fromPoints(u,o)},T.fromVertices=function(t,i,a,o){if(r(o)||(o=new T),!r(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;i=n(i,e.ZERO),a=n(a,3);var u=d;u.x=t[0]+i.x,u.y=t[1]+i.y,u.z=t[2]+i.z;for(var E=e.clone(u,R),s=e.clone(u,l),c=e.clone(u,A),_=e.clone(u,f),y=e.clone(u,N),p=e.clone(u,h),C=t.length,U=0;U<C;U+=a){var L=t[U]+i.x,P=t[U+1]+i.y,F=t[U+2]+i.z;u.x=L,u.y=P,u.z=F,L<E.x&&e.clone(u,E),L>_.x&&e.clone(u,_),P<s.y&&e.clone(u,s),P>y.y&&e.clone(u,y),F<c.z&&e.clone(u,c),F>p.z&&e.clone(u,p)}var v=e.magnitudeSquared(e.subtract(_,E,I)),D=e.magnitudeSquared(e.subtract(y,s,I)),w=e.magnitudeSquared(e.subtract(p,c,I)),g=E,B=_,x=v;D>x&&(x=D,g=s,B=y),w>x&&(x=w,g=c,B=p);var z=S;z.x=.5*(g.x+B.x),z.y=.5*(g.y+B.y),z.z=.5*(g.z+B.z);var G=e.magnitudeSquared(e.subtract(B,z,I)),b=Math.sqrt(G),X=M;X.x=E.x,X.y=s.y,X.z=c.z;var V=O;V.x=_.x,V.y=y.y,V.z=p.z;var H=e.multiplyByScalar(e.add(X,V,I),.5,m),W=0;for(U=0;U<C;U+=a){u.x=t[U]+i.x,u.y=t[U+1]+i.y,u.z=t[U+2]+i.z;var q=e.magnitude(e.subtract(u,H,I));q>W&&(W=q);var Y=e.magnitudeSquared(e.subtract(u,z,I));if(Y>G){var k=Math.sqrt(Y);b=.5*(b+k),G=b*b;var K=k-b;z.x=(b*z.x+K*u.x)/k,z.y=(b*z.y+K*u.y)/k,z.z=(b*z.z+K*u.z)/k}}return b<W?(e.clone(z,o.center),o.radius=b):(e.clone(H,o.center),o.radius=W),o},T.fromEncodedCartesianVertices=function(t,n,i){if(r(i)||(i=new T),!r(t)||!r(n)||t.length!==n.length||0===t.length)return i.center=e.clone(e.ZERO,i.center),i.radius=0,i;var a=d;a.x=t[0]+n[0],a.y=t[1]+n[1],a.z=t[2]+n[2];for(var o=e.clone(a,R),u=e.clone(a,l),E=e.clone(a,A),s=e.clone(a,f),c=e.clone(a,N),_=e.clone(a,h),y=t.length,p=0;p<y;p+=3){var C=t[p]+n[p],U=t[p+1]+n[p+1],L=t[p+2]+n[p+2];a.x=C,a.y=U,a.z=L,C<o.x&&e.clone(a,o),C>s.x&&e.clone(a,s),U<u.y&&e.clone(a,u),U>c.y&&e.clone(a,c),L<E.z&&e.clone(a,E),L>_.z&&e.clone(a,_)}var P=e.magnitudeSquared(e.subtract(s,o,I)),F=e.magnitudeSquared(e.subtract(c,u,I)),v=e.magnitudeSquared(e.subtract(_,E,I)),D=o,w=s,g=P;F>g&&(g=F,D=u,w=c),v>g&&(g=v,D=E,w=_);var B=S;B.x=.5*(D.x+w.x),B.y=.5*(D.y+w.y),B.z=.5*(D.z+w.z);var x=e.magnitudeSquared(e.subtract(w,B,I)),z=Math.sqrt(x),G=M;G.x=o.x,G.y=u.y,G.z=E.z;var b=O;b.x=s.x,b.y=c.y,b.z=_.z;var X=e.multiplyByScalar(e.add(G,b,I),.5,m),V=0;for(p=0;p<y;p+=3){a.x=t[p]+n[p],a.y=t[p+1]+n[p+1],a.z=t[p+2]+n[p+2];var H=e.magnitude(e.subtract(a,X,I));H>V&&(V=H);var W=e.magnitudeSquared(e.subtract(a,B,I));if(W>x){var q=Math.sqrt(W);z=.5*(z+q),x=z*z;var Y=q-z;B.x=(z*B.x+Y*a.x)/q,B.y=(z*B.y+Y*a.y)/q,B.z=(z*B.z+Y*a.z)/q}}return z<V?(e.clone(B,i.center),i.radius=z):(e.clone(X,i.center),i.radius=V),i},T.fromCornerPoints=function(t,n,i){r(i)||(i=new T);var a=i.center;return e.add(t,n,a),e.multiplyByScalar(a,.5,a),i.radius=e.distance(a,n),i},T.fromEllipsoid=function(t,n){return r(n)||(n=new T),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var F=new e;T.fromBoundingSpheres=function(t,n){if(r(n)||(n=new T),!r(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var i=t.length;if(1===i)return T.clone(t[0],n);if(2===i)return T.union(t[0],t[1],n);for(var a=[],o=0;o<i;o++)a.push(t[o].center);n=T.fromPoints(a,n);var u=n.center,E=n.radius;for(o=0;o<i;o++){var s=t[o];E=Math.max(E,e.distance(u,s.center,F)+s.radius)}return n.radius=E,n};var v=new e,D=new e,w=new e;T.fromOrientedBoundingBox=function(t,n){r(n)||(n=new T);var i=t.halfAxes,a=s.getColumn(i,0,v),o=s.getColumn(i,1,D),u=s.getColumn(i,2,w),E=e.magnitude(a),c=e.magnitude(o),_=e.magnitude(u);return n.center=e.clone(t.center,n.center),n.radius=Math.max(E,c,_),n},T.clone=function(t,n){if(r(t))return r(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new T(t.center,t.radius)},T.packedLength=4,T.pack=function(e,t,r){r=n(r,0);var i=e.center;return t[r++]=i.x,t[r++]=i.y,t[r++]=i.z,t[r]=e.radius,t},T.unpack=function(e,t,i){t=n(t,0),r(i)||(i=new T);var a=i.center;return a.x=e[t++],a.y=e[t++],a.z=e[t++],i.radius=e[t],i};var g=new e,B=new e;T.union=function(t,n,i){r(i)||(i=new T);var a=t.center,o=t.radius,u=n.center,E=n.radius,s=e.subtract(u,a,g),c=e.magnitude(s);if(o>=c+E)return t.clone(i),i;if(E>=c+o)return n.clone(i),i;var _=.5*(o+c+E),R=e.multiplyByScalar(s,(-o+_)/c,B);return e.add(R,a,R),e.clone(R,i.center),i.radius=_,i};var x=new e;T.expand=function(t,n,r){r=T.clone(t,r);var i=e.magnitude(e.subtract(n,r.center,x));return i>r.radius&&(r.radius=i),r},T.intersectPlane=function(t,n){var r=t.center,i=t.radius,a=n.normal,o=e.dot(a,r)+n.distance;return o<-i?u.OUTSIDE:o<i?u.INTERSECTING:u.INSIDE},T.transform=function(e,t,n){return r(n)||(n=new T),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=c.getMaximumScale(t)*e.radius,n};var z=new e;T.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,z);return e.magnitudeSquared(r)-t.radius*t.radius},T.transformWithoutScale=function(e,t,n){return r(n)||(n=new T),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var G=new e;T.computePlaneDistances=function(t,n,i,a){r(a)||(a=new E);var o=e.subtract(t.center,n,G),u=e.dot(i,o);return a.start=u-t.radius,a.stop=u+t.radius,a};for(var b=new e,X=new e,V=new e,H=new e,W=new e,q=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var K=new o;return T.projectTo2D=function(t,r,i){r=n(r,K);var a=r.ellipsoid,o=t.center,u=t.radius,E=a.geodeticSurfaceNormal(o,b),s=e.cross(e.UNIT_Z,E,X);e.normalize(s,s);var c=e.cross(E,s,V);e.normalize(c,c),e.multiplyByScalar(E,u,E),e.multiplyByScalar(c,u,c),e.multiplyByScalar(s,u,s);var _=e.negate(c,W),R=e.negate(s,H),l=Y,A=l[0];e.add(E,c,A),e.add(A,s,A),A=l[1],e.add(E,c,A),e.add(A,R,A),A=l[2],e.add(E,_,A),e.add(A,R,A),A=l[3],e.add(E,_,A),e.add(A,s,A),e.negate(E,E),A=l[4],e.add(E,c,A),e.add(A,s,A),A=l[5],e.add(E,c,A),e.add(A,R,A),A=l[6],e.add(E,_,A),e.add(A,R,A),A=l[7],e.add(E,_,A),e.add(A,s,A);for(var f=l.length,N=0;N<f;++N){var h=l[N];e.add(o,h,h);var d=a.cartesianToCartographic(h,q);r.project(d,h)}i=T.fromPoints(l,i),o=i.center;var I=o.x,S=o.y,M=o.z;return o.x=M,o.y=I,o.z=S,i},T.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},T.equals=function(t,n){return t===n||r(t)&&r(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},T.prototype.intersectPlane=function(e){return T.intersectPlane(this,e)},T.prototype.distanceSquaredTo=function(e){return T.distanceSquaredTo(this,e)},T.prototype.computePlaneDistances=function(e,t,n){return T.computePlaneDistances(this,e,t,n)},T.prototype.isOccluded=function(e){return T.isOccluded(this,e)},T.prototype.equals=function(e){return T.equals(this,e)},T.prototype.clone=function(e){return T.clone(this,e)},T}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},i={};return t(i,{element:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(i.supportsFullscreen())return null!==i.element}}}),i.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var i,a=["webkit","moz","o","ms","khtml"],o=0,u=a.length;o<u;++o){var E=a[o];i=E+"RequestFullscreen","function"==typeof t[i]?(r.requestFullscreen=i,n=!0):(i=E+"RequestFullScreen","function"==typeof t[i]&&(r.requestFullscreen=i,n=!0)),i=E+"ExitFullscreen","function"==typeof document[i]?r.exitFullscreen=i:(i=E+"CancelFullScreen","function"==typeof document[i]&&(r.exitFullscreen=i)),i=E+"FullscreenEnabled",void 0!==document[i]?r.fullscreenEnabled=i:(i=E+"FullScreenEnabled",void 0!==document[i]&&(r.fullscreenEnabled=i)),i=E+"FullscreenElement",void 0!==document[i]?r.fullscreenElement=i:(i=E+"FullScreenElement",void 0!==document[i]&&(r.fullscreenElement=i)),i=E+"fullscreenchange",void 0!==document["on"+i]&&("ms"===E&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=E+"fullscreenerror",void 0!==document["on"+i]&&("ms"===E&&(i="MSFullscreenError"),r.fullscreenerror=i)}return n},i.requestFullscreen=function(e,t){i.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},i.exitFullscreen=function(){i.supportsFullscreen()&&document[r.exitFullscreen]()},i}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function i(){if(!t(S)&&(S=!1,!T())){var e=/ Chrome\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(S=!0,M=r(e[1]))}return S}function a(){return i()&&M}function o(){if(!t(O)&&(O=!1,!i()&&!T()&&/ Safari\/[\.0-9]+/.test(I.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(O=!0,m=r(e[1]))}return O}function u(){return o()&&m}function E(){if(!t(y)){y=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(I.userAgent);null!==e&&(y=!0,p=r(e[1]),p.isNightly=!!e[2])}return y}function s(){return E()&&p}function c(){if(!t(C)){C=!1;var e;"Microsoft Internet Explorer"===I.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==e&&(C=!0,U=r(e[1]))):"Netscape"===I.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==e&&(C=!0,U=r(e[1])))}return C}function _(){return c()&&U}function T(){if(!t(L)){L=!1;var e=/ Edge\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(L=!0,P=r(e[1]))}return L}function R(){return T()&&P}function l(){if(!t(F)){F=!1;var e=/Firefox\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(F=!0,v=r(e[1]))}return F}function A(){return t(D)||(D=/Windows/i.test(I.appVersion)),D}function f(){return l()&&v}function N(){return t(w)||(w="undefined"!=typeof PointerEvent&&(!t(I.pointerEnabled)||I.pointerEnabled)),w}function h(){ -if(!t(B)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;B=t(n)&&""!==n,B&&(g=n)}return B}function d(){return h()?g:void 0}var I;I="undefined"!=typeof navigator?navigator:{};var S,M,O,m,y,p,C,U,L,P,F,v,D,w,g,B,x={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:E,webkitVersion:s,isInternetExplorer:c,internetExplorerVersion:_,isEdge:T,edgeVersion:R,isFirefox:l,firefoxVersion:f,isWindows:A,hardwareConcurrency:e(I.hardwareConcurrency,3),supportsPointerEvents:N,supportsImageRenderingPixelated:h,imageRenderingValue:d};return x.supportsFullscreen=function(){return n.supportsFullscreen()},x.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},x.supportsWebWorkers=function(){return"undefined"!=typeof Worker},x}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,i,a){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:a.BYTE,UNSIGNED_BYTE:a.UNSIGNED_BYTE,SHORT:a.SHORT,UNSIGNED_SHORT:a.UNSIGNED_SHORT,INT:a.INT,UNSIGNED_INT:a.UNSIGNED_INT,FLOAT:a.FLOAT,DOUBLE:a.DOUBLE};return o.getSizeInBytes=function(e){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.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},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 Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,i){switch(r=e(r,0),i=e(i,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,i);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,i);case o.SHORT:return new Int16Array(n,r,i);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,i);case o.INT:return new Int32Array(n,r,i);case o.UNSIGNED_INT:return new Uint32Array(n,r,i);case o.FLOAT:return new Float32Array(n,r,i);case o.DOUBLE:return new Float64Array(n,r,i)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},i(o)}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===n.POINTS||e===n.LINES||e===n.LINE_LOOP||e===n.LINE_STRIP||e===n.TRIANGLES||e===n.TRIANGLE_STRIP||e===n.TRIANGLE_FAN}};return e(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,i){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,i.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return a.computeNumberOfVertices=function(e){var n=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var i=e.attributes[r],a=i.values.length/i.componentsPerAttribute;n=a}return n},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(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 r}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.binormal=t.binormal,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,n,r,i){"use strict";var a={UNSIGNED_BYTE:i.UNSIGNED_BYTE,UNSIGNED_SHORT:i.UNSIGNED_SHORT,UNSIGNED_INT:i.UNSIGNED_INT};return a.getSizeInBytes=function(e){switch(e){case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},a.validate=function(t){return e(t)&&(t===a.UNSIGNED_BYTE||t===a.UNSIGNED_SHORT||t===a.UNSIGNED_INT)},a.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},a.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)},n(a)}),define("Core/EllipsoidOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType"],function(e,t,n,r,i,a,o,u,E,s,c,_,T){"use strict";function R(e){e=r(e,r.EMPTY_OBJECT);var n=r(e.radii,l),i=r(e.stackPartitions,10),a=r(e.slicePartitions,8),o=r(e.subdivisions,128);this._radii=t.clone(n),this._stackPartitions=i,this._slicePartitions=a,this._subdivisions=o,this._workerName="createEllipsoidOutlineGeometry"}var l=new t(1,1,1),A=Math.cos,f=Math.sin;R.packedLength=t.packedLength+3,R.pack=function(e,n,i){return i=r(i,0),t.pack(e._radii,n,i),i+=t.packedLength,n[i++]=e._stackPartitions,n[i++]=e._slicePartitions,n[i]=e._subdivisions,n};var N=new t,h={radii:N,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};return R.unpack=function(e,n,a){n=r(n,0);var o=t.unpack(e,n,N);n+=t.packedLength;var u=e[n++],E=e[n++],s=e[n++];return i(a)?(a._radii=t.clone(o,a._radii),a._stackPartitions=u,a._slicePartitions=E,a._subdivisions=s,a):(h.stackPartitions=u,h.slicePartitions=E,h.subdivisions=s,new R(h))},R.createGeometry=function(t){var r=t._radii;if(!(r.x<=0||r.y<=0||r.z<=0)){var i,a,R,l,N,h,d=o.fromCartesian3(r),I=t._stackPartitions,S=t._slicePartitions,M=t._subdivisions,O=M*(I+S-1),m=O-S+2,y=new Float64Array(3*m),p=c.createTypedArray(m,2*O),C=0,U=new Array(M),L=new Array(M);for(i=0;i<M;i++)R=_.TWO_PI*i/M,U[i]=A(R),L[i]=f(R);for(i=1;i<I;i++)for(l=Math.PI*i/I,N=A(l),h=f(l),a=0;a<M;a++)y[C++]=r.x*U[a]*h,y[C++]=r.y*L[a]*h,y[C++]=r.z*N;for(U.length=S,L.length=S,i=0;i<S;i++)R=_.TWO_PI*i/S,U[i]=A(R),L[i]=f(R);for(y[C++]=0,y[C++]=0,y[C++]=r.z,i=1;i<M;i++)for(l=Math.PI*i/M,N=A(l),h=f(l),a=0;a<S;a++)y[C++]=r.x*U[a]*h,y[C++]=r.y*L[a]*h,y[C++]=r.z*N;for(y[C++]=0,y[C++]=0,y[C++]=-r.z,C=0,i=0;i<I-1;++i){var P=i*M;for(a=0;a<M-1;++a)p[C++]=P+a,p[C++]=P+a+1;p[C++]=P+M-1,p[C++]=P}var F=M*(I-1);for(a=1;a<S+1;++a)p[C++]=F,p[C++]=F+a;for(i=0;i<M-2;++i){var v=i*S+1+F,D=(i+1)*S+1+F;for(a=0;a<S-1;++a)p[C++]=D+a,p[C++]=v+a;p[C++]=D+S-1,p[C++]=v+S-1}var w=y.length/3-1;for(a=w-1;a>w-S-1;--a)p[C++]=w,p[C++]=a;var g=new s({position:new E({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:y})});return new u({attributes:g,indices:p,primitiveType:T.LINES,boundingSphere:e.fromEllipsoid(d)})}},R}),define("Core/SphereOutlineGeometry",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./EllipsoidOutlineGeometry"],function(e,t,n,r,i){"use strict";function a(n){var r=t(n.radius,1),a=new e(r,r,r),o={radii:a,stackPartitions:n.stackPartitions,slicePartitions:n.slicePartitions,subdivisions:n.subdivisions};this._ellipsoidGeometry=new i(o),this._workerName="createSphereOutlineGeometry"}a.packedLength=i.packedLength,a.pack=function(e,t,n){return i.pack(e._ellipsoidGeometry,t,n)};var o=new i,u={radius:void 0,radii:new e,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};return a.unpack=function(t,r,E){var s=i.unpack(t,r,o);return u.stackPartitions=s._stackPartitions,u.slicePartitions=s._slicePartitions,u.subdivisions=s._subdivisions,n(E)?(e.clone(s._radii,u.radii),E._ellipsoidGeometry=new i(u),E):(u.radius=s._radii.x,new a(u))},a.createGeometry=function(e){return i.createGeometry(e._ellipsoidGeometry)},a}),define("Workers/createSphereOutlineGeometry",["../Core/defined","../Core/SphereOutlineGeometry"],function(e,t){"use strict";return function(n,r){return e(r)&&(n=t.unpack(n,r)),t.createGeometry(n)}})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e){return e+" is required, actual value was undefined"}function r(e,t,n){return"Expected "+n+" to be typeof "+t+", actual typeof was "+e}var i={};return i.typeOf={},i.defined=function(r,i){if(!e(i))throw new t(n(r))},i.typeOf.func=function(e,n){if("function"!=typeof n)throw new t(r(typeof n,"function",e))},i.typeOf.string=function(e,n){if("string"!=typeof n)throw new t(r(typeof n,"string",e))},i.typeOf.number=function(e,n){if("number"!=typeof n)throw new t(r(typeof n,"number",e))},i.typeOf.number.lessThan=function(e,n,r){if(i.typeOf.number(e,n),n>=r)throw new t("Expected "+e+" to be less than "+r+", actual value was "+n)},i.typeOf.number.lessThanOrEquals=function(e,n,r){if(i.typeOf.number(e,n),n>r)throw new t("Expected "+e+" to be less than or equal to "+r+", actual value was "+n)},i.typeOf.number.greaterThan=function(e,n,r){if(i.typeOf.number(e,n),n<=r)throw new t("Expected "+e+" to be greater than "+r+", actual value was "+n)},i.typeOf.number.greaterThanOrEquals=function(e,n,r){if(i.typeOf.number(e,n),n<r)throw new t("Expected "+e+" to be greater than or equal to"+r+", actual value was "+n)},i.typeOf.object=function(e,n){if("object"!=typeof n)throw new t(r(typeof n,"object",e))},i.typeOf.bool=function(e,n){if("boolean"!=typeof n)throw new t(r(typeof n,"boolean",e))},i}),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";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),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 n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(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^=e<<7&2636928640,e^=e<<15&4022730752,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,n,r){"use strict";var i={};i.EPSILON1=.1,i.EPSILON2=.01,i.EPSILON3=.001,i.EPSILON4=1e-4,i.EPSILON5=1e-5,i.EPSILON6=1e-6,i.EPSILON7=1e-7,i.EPSILON8=1e-8,i.EPSILON9=1e-9,i.EPSILON10=1e-10,i.EPSILON11=1e-11,i.EPSILON12=1e-12,i.EPSILON13=1e-13,i.EPSILON14=1e-14,i.EPSILON15=1e-15,i.EPSILON16=1e-16,i.EPSILON17=1e-17,i.EPSILON18=1e-18,i.EPSILON19=1e-19,i.EPSILON20=1e-20,i.GRAVITATIONALPARAMETER=3986004418e5,i.SOLAR_RADIUS=6955e5,i.LUNAR_RADIUS=1737400,i.SIXTY_FOUR_KILOBYTES=65536,i.sign=function(e){return e>0?1:e<0?-1:0},i.signNotZero=function(e){return e<0?-1:1},i.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*i.clamp(e,-1,1)+.5)*n)},i.fromSNorm=function(e,n){return n=t(n,255),i.clamp(e,0,n)/n*2-1},i.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},i.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},i.lerp=function(e,t,n){return(1-n)*e+n*t},i.PI=Math.PI,i.ONE_OVER_PI=1/Math.PI,i.PI_OVER_TWO=.5*Math.PI,i.PI_OVER_THREE=Math.PI/3,i.PI_OVER_FOUR=Math.PI/4,i.PI_OVER_SIX=Math.PI/6,i.THREE_PI_OVER_TWO=3*Math.PI*.5,i.TWO_PI=2*Math.PI,i.ONE_OVER_TWO_PI=1/(2*Math.PI),i.RADIANS_PER_DEGREE=Math.PI/180,i.DEGREES_PER_RADIAN=180/Math.PI,i.RADIANS_PER_ARCSECOND=i.RADIANS_PER_DEGREE/3600,i.toRadians=function(e){return e*i.RADIANS_PER_DEGREE},i.toDegrees=function(e){return e*i.DEGREES_PER_RADIAN},i.convertLongitudeRange=function(e){var t=i.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},i.clampToLatitudeRange=function(e){return i.clamp(e,-1*i.PI_OVER_TWO,i.PI_OVER_TWO)},i.negativePiToPi=function(e){return i.zeroToTwoPi(e+i.PI)-i.PI},i.zeroToTwoPi=function(e){var t=i.mod(e,i.TWO_PI);return Math.abs(t)<i.EPSILON14&&Math.abs(e)>i.EPSILON14?i.TWO_PI:t},i.mod=function(e,t){return(e%t+t)%t},i.equalsEpsilon=function(e,n,r,i){i=t(i,r);var a=Math.abs(e-n);return a<=i||a<=r*Math.max(Math.abs(e),Math.abs(n))};var a=[1];i.factorial=function(e){var t=a.length;if(e>=t)for(var n=a[t-1],r=t;r<=e;r++)a.push(n*r);return a[e]},i.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},i.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},i.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},i.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return i.setRandomNumberSeed=function(t){o=new e(t)},i.nextRandomNumber=function(){return o.random()},i.acosClamped=function(e){return Math.acos(i.clamp(e,-1,1))},i.asinClamped=function(e){return Math.asin(i.clamp(e,-1,1))},i.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},i.logBase=function(e,t){return Math.log(e)/Math.log(t)},i.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},i}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var i=e.clock,a=e.cone,u=t(e.magnitude,1),E=u*Math.sin(a);return r.x=E*Math.cos(i),r.y=E*Math.sin(i),r.z=u*Math.cos(a),r},o.fromElements=function(e,t,r,i){return n(i)?(i.x=e,i.y=t,i.z=r,i):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new o),i.x=e[r++],i.y=e[r++],i.z=e[r],i},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var i=0;i<r;++i)o.pack(e[i],t,3*i);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var i=0;i<r;i+=3){var a=i/3;t[a]=o.unpack(e,i,t[a])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,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};var E=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,E),r=o.multiplyByScalar(e,1-n,r),o.add(E,r,r)};var s=new o,c=new o;o.angleBetween=function(e,t){o.normalize(e,s),o.normalize(t,c);var n=o.dot(s,c),r=o.magnitude(o.cross(s,c,s));return Math.atan2(r,n)};var _=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,_);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,i){return e===t||n(e)&&n(t)&&a.equalsEpsilon(e.x,t.x,r,i)&&a.equalsEpsilon(e.y,t.y,r,i)&&a.equalsEpsilon(e.z,t.z,r,i)},o.cross=function(e,t,n){var r=e.x,i=e.y,a=e.z,o=t.x,u=t.y,E=t.z,s=i*E-a*u,c=a*o-r*E,_=r*u-i*o;return n.x=s,n.y=c,n.z=_,n},o.fromDegrees=function(e,t,n,r,i){return e=a.toRadians(e),t=a.toRadians(t),o.fromRadians(e,t,n,r,i)};var T=new o,R=new o,l=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,i,a,u){i=t(i,0);var E=n(a)?a.radiiSquared:l,s=Math.cos(r);T.x=s*Math.cos(e),T.y=s*Math.sin(e),T.z=Math.sin(r),T=o.normalize(T,T),o.multiplyComponents(E,T,R);var c=Math.sqrt(o.dot(T,R));return R=o.divideByScalar(R,c,R),T=o.multiplyByScalar(T,i,T),n(u)||(u=new o),o.add(R,T,u)},o.fromDegreesArray=function(e,t,r){var i=e.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],E=e[a+1],s=a/2;r[s]=o.fromDegrees(u,E,0,t,r[s])}return r},o.fromRadiansArray=function(e,t,r){var i=e.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],E=e[a+1],s=a/2;r[s]=o.fromRadians(u,E,0,t,r[s])}return r},o.fromDegreesArrayHeights=function(e,t,r){var i=e.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],E=e[a+1],s=e[a+2],c=a/3;r[c]=o.fromDegrees(u,E,s,t,r[c])}return r},o.fromRadiansArrayHeights=function(e,t,r){var i=e.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],E=e[a+1],s=e[a+2],c=a/3;r[c]=o.fromRadians(u,E,s,t,r[c])}return r},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,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function i(n,i,u,E,s){var c=n.x,_=n.y,T=n.z,R=i.x,l=i.y,A=i.z,f=c*c*R*R,h=_*_*l*l,N=T*T*A*A,d=f+h+N,I=Math.sqrt(1/d),S=e.multiplyByScalar(n,I,a);if(d<E)return isFinite(I)?e.clone(S,s):void 0;var M=u.x,O=u.y,m=u.z,y=o;y.x=S.x*M*2,y.y=S.y*O*2,y.z=S.z*m*2;var p,C,U,L,P,F,v,w,D,g,B,x=(1-I)*e.magnitude(n)/(.5*e.magnitude(y)),z=0;do{x-=z,U=1/(1+x*M),L=1/(1+x*O),P=1/(1+x*m),F=U*U,v=L*L,w=P*P,D=F*U,g=v*L,B=w*P,p=f*F+h*v+N*w-1,C=f*D*M+h*g*O+N*B*m;var G=-2*C;z=p/G}while(Math.abs(p)>r.EPSILON12);return t(s)?(s.x=c*U,s.y=_*L,s.z=T*P,s):new e(c*U,_*L,T*P)}var a=new e,o=new e;return i}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,i,a,o){"use strict";function u(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)}u.fromRadians=function(e,r,i,a){return i=t(i,0),n(a)?(a.longitude=e,a.latitude=r,a.height=i,a):new u(e,r,i)},u.fromDegrees=function(e,t,n,r){return e=a.toRadians(e),t=a.toRadians(t),u.fromRadians(e,t,n,r)};var E=new e,s=new e,c=new e,_=new e(1/6378137,1/6378137,1/6356752.314245179),T=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),R=a.EPSILON1;return u.fromCartesian=function(t,r,i){var l=n(r)?r.oneOverRadii:_,A=n(r)?r.oneOverRadiiSquared:T,f=n(r)?r._centerToleranceSquared:R,h=o(t,l,A,f,s);if(n(h)){var N=e.multiplyComponents(h,A,E);N=e.normalize(N,N);var d=e.subtract(t,h,c),I=Math.atan2(N.y,N.x),S=Math.asin(N.z),M=a.sign(e.dot(d,t))*e.magnitude(d);return n(i)?(i.longitude=I,i.latitude=S,i.height=M,i):new u(I,S,M)}},u.clone=function(e,t){if(n(e))return n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},u.ZERO=i(new u(0,0,0)),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,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,i,a,o,u,E){"use strict";function s(t,r,i,a){r=n(r,0),i=n(i,0),a=n(a,0),t._radii=new e(r,i,a),t._radiiSquared=new e(r*r,i*i,a*a),t._radiiToTheFourth=new e(r*r*r*r,i*i*i*i,a*a*a*a),t._oneOverRadii=new e(0===r?0:1/r,0===i?0:1/i,0===a?0:1/a),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===i?0:1/(i*i),0===a?0:1/(a*a)),t._minimumRadius=Math.min(r,i,a),t._maximumRadius=Math.max(r,i,a),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function c(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,s(this,e,t,n)}i(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,n){if(r(t)){var i=t._radii;return r(n)?(e.clone(i,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new c(i.x,i.y,i.z)}},c.fromCartesian3=function(e,t){return r(t)||(t=new c),r(e)?(s(t,e.x,e.y,e.z),t):t},c.WGS84=o(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=o(new c(1,1,1)),c.MOON=o(new c(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),c.prototype.clone=function(e){return c.clone(this,e)},c.packedLength=e.packedLength,c.pack=function(t,r,i){return i=n(i,0),e.pack(t._radii,r,i),r},c.unpack=function(t,r,i){r=n(r,0);var a=e.unpack(t,r);return c.fromCartesian3(a,i)},c.prototype.geocentricSurfaceNormal=e.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(t,n){var i=t.longitude,a=t.latitude,o=Math.cos(a),u=o*Math.cos(i),E=o*Math.sin(i),s=Math.sin(a);return r(n)||(n=new e),n.x=u,n.y=E,n.z=s,e.normalize(n,n)},c.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var _=new e,T=new e;c.prototype.cartographicToCartesian=function(t,n){var i=_,a=T;this.geodeticSurfaceNormalCartographic(t,i),e.multiplyComponents(this._radiiSquared,i,a);var o=Math.sqrt(e.dot(i,a));return e.divideByScalar(a,o,a),e.multiplyByScalar(i,t.height,i),r(n)||(n=new e),e.add(a,i,n)},c.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;i<n;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var R=new e,l=new e,A=new e;return c.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,l);if(r(a)){var o=this.geodeticSurfaceNormal(a,R),E=e.subtract(n,a,A),s=Math.atan2(o.y,o.x),c=Math.asin(o.z),_=u.sign(e.dot(E,n))*e.magnitude(E);return r(i)?(i.longitude=s,i.latitude=c,i.height=_,i):new t(s,c,_)}},c.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;i<n;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t},c.prototype.scaleToGeodeticSurface=function(e,t){return E(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},c.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var i=t.x,a=t.y,o=t.z,u=this._oneOverRadiiSquared,E=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*u.z);return e.multiplyByScalar(t,E,n)},c.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},c.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},c.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},c.prototype.toString=function(){return this._radii.toString()},c.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,i,a){i=n(i,0);var o=this._sqauredXOverSquaredZ;if(r(a)||(a=new e),a.x=0,a.y=0,a.z=t.z*(1-o),!(Math.abs(a.z)>=this._radii.z-i))return a},c}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,i,a,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return i(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var i=this._semimajorAxis,a=t.longitude*i,o=t.latitude*i,u=t.height;return r(n)?(n.x=a,n.y=o,n.z=u,n):new e(a,o,u)},u.prototype.unproject=function(e,n){var i=this._oneOverSemimajorAxis,a=e.x*i,o=e.y*i,u=e.z;return r(n)?(n.longitude=a,n.latitude=o,n.height=u,n):new t(a,o,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";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a,o,u){"use strict";function E(e,t,r,i,a,o,u,E,s){this[0]=n(e,0),this[1]=n(i,0),this[2]=n(u,0),this[3]=n(t,0),this[4]=n(a,0),this[5]=n(E,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(s,0)}function s(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function c(e){for(var t=0,n=0;n<3;++n){var r=e[E.getElementIndex(A[n],l[n])];t+=2*r*r}return Math.sqrt(t)}function _(e,t){for(var n=u.EPSILON15,r=0,i=1,a=0;a<3;++a){var o=Math.abs(e[E.getElementIndex(A[a],l[a])]);o>r&&(i=a,r=o)}var s=1,c=0,_=l[i],T=A[i];if(Math.abs(e[E.getElementIndex(T,_)])>n){var R,f=e[E.getElementIndex(T,T)],h=e[E.getElementIndex(_,_)],N=e[E.getElementIndex(T,_)],d=(f-h)/2/N;R=d<0?-1/(-d+Math.sqrt(1+d*d)):1/(d+Math.sqrt(1+d*d)),s=1/Math.sqrt(1+R*R),c=R*s}return t=E.clone(E.IDENTITY,t),t[E.getElementIndex(_,_)]=t[E.getElementIndex(T,T)]=s,t[E.getElementIndex(T,_)]=c,t[E.getElementIndex(_,T)]=-c,t}E.packedLength=9,E.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t},E.unpack=function(e,t,i){return t=n(t,0),r(i)||(i=new E),i[0]=e[t++],i[1]=e[t++],i[2]=e[t++],i[3]=e[t++],i[4]=e[t++],i[5]=e[t++],i[6]=e[t++],i[7]=e[t++],i[8]=e[t++],i},E.clone=function(e,t){if(r(e))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):new E(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},E.fromArray=function(e,t,i){return t=n(t,0),r(i)||(i=new E),i[0]=e[t],i[1]=e[t+1],i[2]=e[t+2],i[3]=e[t+3],i[4]=e[t+4],i[5]=e[t+5],i[6]=e[t+6],i[7]=e[t+7],i[8]=e[t+8],i},E.fromColumnMajorArray=function(e,t){return E.clone(e,t)},E.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 E(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},E.fromQuaternion=function(e,t){var n=e.x*e.x,i=e.x*e.y,a=e.x*e.z,o=e.x*e.w,u=e.y*e.y,s=e.y*e.z,c=e.y*e.w,_=e.z*e.z,T=e.z*e.w,R=e.w*e.w,l=n-u-_+R,A=2*(i-T),f=2*(a+c),h=2*(i+T),N=-n+u-_+R,d=2*(s-o),I=2*(a-c),S=2*(s+o),M=-n-u+_+R;return r(t)?(t[0]=l,t[1]=h,t[2]=I,t[3]=A,t[4]=N,t[5]=S,t[6]=f,t[7]=d,t[8]=M,t):new E(l,A,f,h,N,d,I,S,M)},E.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),i=Math.cos(-e.heading),a=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),s=Math.sin(e.roll),c=n*i,_=-a*u+s*o*i,T=s*u+a*o*i,R=n*u,l=a*i+s*o*u,A=-o*a+a*o*u,f=-o,h=s*n,N=a*n;return r(t)?(t[0]=c,t[1]=R,t[2]=f,t[3]=_,t[4]=l,t[5]=h,t[6]=T,t[7]=A,t[8]=N,t):new E(c,_,T,R,l,A,f,h,N)},E.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 E(e.x,0,0,0,e.y,0,0,0,e.z)},E.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 E(e,0,0,0,e,0,0,0,e)},E.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 E(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},E.fromRotationX=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=i,t[6]=0,t[7]=-i,t[8]=n,t):new E(1,0,0,0,n,-i,0,i,n)},E.fromRotationY=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-i,t[3]=0,t[4]=1,t[5]=0,t[6]=i,t[7]=0,t[8]=n,t):new E(n,0,i,0,1,0,-i,0,n)},E.fromRotationZ=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=n,t[1]=i,t[2]=0,t[3]=-i,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new E(n,-i,0,i,n,0,0,0,1)},E.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]]},E.getElementIndex=function(e,t){return 3*e+t},E.getColumn=function(e,t,n){var r=3*t,i=e[r],a=e[r+1],o=e[r+2];return n.x=i,n.y=a,n.z=o,n},E.setColumn=function(e,t,n,r){r=E.clone(e,r);var i=3*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},E.getRow=function(e,t,n){var r=e[t],i=e[t+3],a=e[t+6];return n.x=r,n.y=i,n.z=a,n},E.setRow=function(e,t,n,r){return r=E.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var T=new e;E.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],T)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],T)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],T)),n};var R=new e;E.getMaximumScale=function(t){return E.getScale(t,R),e.maximumComponent(R)},E.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],i=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],o=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],E=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],s=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],c=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],_=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=r,n[1]=i,n[2]=a,n[3]=o,n[4]=u,n[5]=E,n[6]=s,n[7]=c,n[8]=_,n},E.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},E.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},E.multiplyByVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[3]*i+e[6]*a,u=e[1]*r+e[4]*i+e[7]*a,E=e[2]*r+e[5]*i+e[8]*a;return n.x=o,n.y=u,n.z=E,n},E.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},E.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},E.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},E.transpose=function(e,t){var n=e[0],r=e[3],i=e[6],a=e[1],o=e[4],u=e[7],E=e[2],s=e[5],c=e[8];return t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=u,t[6]=E,t[7]=s,t[8]=c,t};var l=[1,0,0],A=[2,2,1],f=new E,h=new E;return E.computeEigenDecomposition=function(e,t){var n=u.EPSILON20,i=10,a=0,o=0;r(t)||(t={});for(var T=t.unitary=E.clone(E.IDENTITY,t.unitary),R=t.diagonal=E.clone(e,t.diagonal),l=n*s(R);o<i&&c(R)>l;)_(R,f),E.transpose(f,h),E.multiply(R,f,R),E.multiply(h,R,R),E.multiply(T,f,T),++a>2&&(++o,a=0);return t},E.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},E.determinant=function(e){var t=e[0],n=e[3],r=e[6],i=e[1],a=e[4],o=e[7],u=e[2],E=e[5],s=e[8];return t*(a*s-E*o)+i*(E*r-n*s)+u*(n*o-a*r)},E.inverse=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],u=e[5],s=e[6],c=e[7],_=e[8],T=E.determinant(e);t[0]=o*_-c*u,t[1]=c*i-r*_,t[2]=r*u-o*i,t[3]=s*u-a*_,t[4]=n*_-s*i,t[5]=a*i-n*u,t[6]=a*c-s*o,t[7]=s*r-n*c,t[8]=n*o-a*r;var R=1/T;return E.multiplyByScalar(t,R,t)},E.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.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},E.IDENTITY=o(new E(1,0,0,0,1,0,0,0,1)),E.ZERO=o(new E(0,0,0,0,0,0,0,0,0)),E.COLUMN0ROW0=0,E.COLUMN0ROW1=1,E.COLUMN0ROW2=2,E.COLUMN1ROW0=3,E.COLUMN1ROW1=4,E.COLUMN1ROW2=5,E.COLUMN2ROW0=6,E.COLUMN2ROW1=7,E.COLUMN2ROW2=8,i(E.prototype,{length:{get:function(){return E.packedLength}}}),E.prototype.clone=function(e){return E.clone(this,e)},E.prototype.equals=function(e){return E.equals(this,e)},E.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},E.prototype.equalsEpsilon=function(e,t){return E.equalsEpsilon(this,e,t)},E.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},E}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(e,n,r,i){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(i,0)}o.fromElements=function(e,t,r,i,a){return n(a)?(a.x=e,a.y=t,a.z=r,a.w=i,a):new o(e,t,r,i)},o.fromColor=function(e,t){return n(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(n(e))return n(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)},o.packedLength=4,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},o.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new o),i.x=e[r++],i.y=e[r++],i.z=e[r++],i.w=e[r],i},o.packArray=function(e,t){var r=e.length;n(t)?t.length=4*r:t=new Array(4*r);for(var i=0;i<r;++i)o.pack(e[i],t,4*i);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/4:t=new Array(r/4);for(var i=0;i<r;i+=4){var a=i/4;t[a]=o.unpack(e,i,t[a])}return t},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,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},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 u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,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,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},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 E=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,E),r=o.multiplyByScalar(e,1-n,r),o.add(E,r,r)};var s=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,s);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},o.equalsEpsilon=function(e,t,r,i){return e===t||n(e)&&n(t)&&a.equalsEpsilon(e.x,t.x,r,i)&&a.equalsEpsilon(e.y,t.y,r,i)&&a.equalsEpsilon(e.z,t.z,r,i)&&a.equalsEpsilon(e.w,t.w,r,i)},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,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,i,a,o,u,E,s,c){ +"use strict";function _(e,t,n,i,a,o,u,E,s,c,_,T,R,l,A,f){this[0]=r(e,0),this[1]=r(a,0),this[2]=r(s,0),this[3]=r(R,0),this[4]=r(t,0),this[5]=r(o,0),this[6]=r(c,0),this[7]=r(l,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(_,0),this[11]=r(A,0),this[12]=r(i,0),this[13]=r(E,0),this[14]=r(T,0),this[15]=r(f,0)}_.packedLength=16,_.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},_.unpack=function(e,t,n){return t=r(t,0),i(n)||(n=new _),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},_.clone=function(e,t){if(i(e))return i(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 _(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])},_.fromArray=_.unpack,_.fromColumnMajorArray=function(e,t){return _.clone(e,t)},_.fromRowMajorArray=function(e,t){return i(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 _(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])},_.fromRotationTranslation=function(t,n,a){return n=r(n,e.ZERO),i(a)?(a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=0,a[4]=t[3],a[5]=t[4],a[6]=t[5],a[7]=0,a[8]=t[6],a[9]=t[7],a[10]=t[8],a[11]=0,a[12]=n.x,a[13]=n.y,a[14]=n.z,a[15]=1,a):new _(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},_.fromTranslationQuaternionRotationScale=function(e,t,n,r){i(r)||(r=new _);var a=n.x,o=n.y,u=n.z,E=t.x*t.x,s=t.x*t.y,c=t.x*t.z,T=t.x*t.w,R=t.y*t.y,l=t.y*t.z,A=t.y*t.w,f=t.z*t.z,h=t.z*t.w,N=t.w*t.w,d=E-R-f+N,I=2*(s-h),S=2*(c+A),M=2*(s+h),O=-E+R-f+N,m=2*(l-T),y=2*(c-A),p=2*(l+T),C=-E-R+f+N;return r[0]=d*a,r[1]=M*a,r[2]=y*a,r[3]=0,r[4]=I*o,r[5]=O*o,r[6]=p*o,r[7]=0,r[8]=S*u,r[9]=m*u,r[10]=C*u,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},_.fromTranslationRotationScale=function(e,t){return _.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},_.fromTranslation=function(e,t){return _.fromRotationTranslation(s.IDENTITY,e,t)},_.fromScale=function(e,t){return i(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 _(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},_.fromUniformScale=function(e,t){return i(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 _(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var T=new e,R=new e,l=new e;_.fromCamera=function(t,n){var r=t.position,a=t.direction,o=t.up;e.normalize(a,T),e.normalize(e.cross(T,o,R),R),e.normalize(e.cross(R,T,l),l);var u=R.x,E=R.y,s=R.z,c=T.x,A=T.y,f=T.z,h=l.x,N=l.y,d=l.z,I=r.x,S=r.y,M=r.z,O=u*-I+E*-S+s*-M,m=h*-I+N*-S+d*-M,y=c*I+A*S+f*M;return i(n)?(n[0]=u,n[1]=h,n[2]=-c,n[3]=0,n[4]=E,n[5]=N,n[6]=-A,n[7]=0,n[8]=s,n[9]=d,n[10]=-f,n[11]=0,n[12]=O,n[13]=m,n[14]=y,n[15]=1,n):new _(u,E,s,O,h,N,d,m,-c,-A,-f,y,0,0,0,1)},_.computePerspectiveFieldOfView=function(e,t,n,r,i){var a=Math.tan(.5*e),o=1/a,u=o/t,E=(r+n)/(n-r),s=2*r*n/(n-r);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=o,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=E,i[11]=-1,i[12]=0,i[13]=0,i[14]=s,i[15]=0,i},_.computeOrthographicOffCenter=function(e,t,n,r,i,a,o){var u=1/(t-e),E=1/(r-n),s=1/(a-i),c=-(t+e)*u,_=-(r+n)*E,T=-(a+i)*s;return u*=2,E*=2,s*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=s,o[11]=0,o[12]=c,o[13]=_,o[14]=T,o[15]=1,o},_.computePerspectiveOffCenter=function(e,t,n,r,i,a,o){var u=2*i/(t-e),E=2*i/(r-n),s=(t+e)/(t-e),c=(r+n)/(r-n),_=-(a+i)/(a-i),T=-1,R=-2*a*i/(a-i);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=s,o[9]=c,o[10]=_,o[11]=T,o[12]=0,o[13]=0,o[14]=R,o[15]=0,o},_.computeInfinitePerspectiveOffCenter=function(e,t,n,r,i,a){var o=2*i/(t-e),u=2*i/(r-n),E=(t+e)/(t-e),s=(r+n)/(r-n),c=-1,_=-1,T=-2*i;return a[0]=o,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=E,a[9]=s,a[10]=c,a[11]=_,a[12]=0,a[13]=0,a[14]=T,a[15]=0,a},_.computeViewportTransformation=function(e,t,n,i){e=r(e,r.EMPTY_OBJECT);var a=r(e.x,0),o=r(e.y,0),u=r(e.width,0),E=r(e.height,0);t=r(t,0),n=r(n,1);var s=.5*u,c=.5*E,_=.5*(n-t),T=s,R=c,l=_,A=a+s,f=o+c,h=t+_,N=1;return i[0]=T,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=R,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=l,i[11]=0,i[12]=A,i[13]=f,i[14]=h,i[15]=N,i},_.computeView=function(t,n,r,i,a){return a[0]=i.x,a[1]=r.x,a[2]=-n.x,a[3]=0,a[4]=i.y,a[5]=r.y,a[6]=-n.y,a[7]=0,a[8]=i.z,a[9]=r.z,a[10]=-n.z,a[11]=0,a[12]=-e.dot(i,t),a[13]=-e.dot(r,t),a[14]=e.dot(n,t),a[15]=1,a},_.toArray=function(e,t){return i(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]]},_.getElementIndex=function(e,t){return 4*e+t},_.getColumn=function(e,t,n){var r=4*t,i=e[r],a=e[r+1],o=e[r+2],u=e[r+3];return n.x=i,n.y=a,n.z=o,n.w=u,n},_.setColumn=function(e,t,n,r){r=_.clone(e,r);var i=4*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r[i+3]=n.w,r},_.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},_.getRow=function(e,t,n){var r=e[t],i=e[t+4],a=e[t+8],o=e[t+12];return n.x=r,n.y=i,n.z=a,n.w=o,n},_.setRow=function(e,t,n,r){return r=_.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var A=new e;_.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],A)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],A)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],A)),n};var f=new e;_.getMaximumScale=function(t){return _.getScale(t,f),e.maximumComponent(f)},_.multiply=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[3],u=e[4],E=e[5],s=e[6],c=e[7],_=e[8],T=e[9],R=e[10],l=e[11],A=e[12],f=e[13],h=e[14],N=e[15],d=t[0],I=t[1],S=t[2],M=t[3],O=t[4],m=t[5],y=t[6],p=t[7],C=t[8],U=t[9],L=t[10],P=t[11],F=t[12],v=t[13],w=t[14],D=t[15],g=r*d+u*I+_*S+A*M,B=i*d+E*I+T*S+f*M,x=a*d+s*I+R*S+h*M,z=o*d+c*I+l*S+N*M,G=r*O+u*m+_*y+A*p,b=i*O+E*m+T*y+f*p,X=a*O+s*m+R*y+h*p,V=o*O+c*m+l*y+N*p,H=r*C+u*U+_*L+A*P,q=i*C+E*U+T*L+f*P,W=a*C+s*U+R*L+h*P,Y=o*C+c*U+l*L+N*P,k=r*F+u*v+_*w+A*D,K=i*F+E*v+T*w+f*D,Z=a*F+s*v+R*w+h*D,j=o*F+c*v+l*w+N*D;return n[0]=g,n[1]=B,n[2]=x,n[3]=z,n[4]=G,n[5]=b,n[6]=X,n[7]=V,n[8]=H,n[9]=q,n[10]=W,n[11]=Y,n[12]=k,n[13]=K,n[14]=Z,n[15]=j,n},_.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},_.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},_.multiplyTransformation=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[4],u=e[5],E=e[6],s=e[8],c=e[9],_=e[10],T=e[12],R=e[13],l=e[14],A=t[0],f=t[1],h=t[2],N=t[4],d=t[5],I=t[6],S=t[8],M=t[9],O=t[10],m=t[12],y=t[13],p=t[14],C=r*A+o*f+s*h,U=i*A+u*f+c*h,L=a*A+E*f+_*h,P=r*N+o*d+s*I,F=i*N+u*d+c*I,v=a*N+E*d+_*I,w=r*S+o*M+s*O,D=i*S+u*M+c*O,g=a*S+E*M+_*O,B=r*m+o*y+s*p+T,x=i*m+u*y+c*p+R,z=a*m+E*y+_*p+l;return n[0]=C,n[1]=U,n[2]=L,n[3]=0,n[4]=P,n[5]=F,n[6]=v,n[7]=0,n[8]=w,n[9]=D,n[10]=g,n[11]=0,n[12]=B,n[13]=x,n[14]=z,n[15]=1,n},_.multiplyByMatrix3=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[4],u=e[5],E=e[6],s=e[8],c=e[9],_=e[10],T=t[0],R=t[1],l=t[2],A=t[3],f=t[4],h=t[5],N=t[6],d=t[7],I=t[8],S=r*T+o*R+s*l,M=i*T+u*R+c*l,O=a*T+E*R+_*l,m=r*A+o*f+s*h,y=i*A+u*f+c*h,p=a*A+E*f+_*h,C=r*N+o*d+s*I,U=i*N+u*d+c*I,L=a*N+E*d+_*I;return n[0]=S,n[1]=M,n[2]=O,n[3]=0,n[4]=m,n[5]=y,n[6]=p,n[7]=0,n[8]=C,n[9]=U,n[10]=L,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},_.multiplyByTranslation=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=r*e[0]+i*e[4]+a*e[8]+e[12],u=r*e[1]+i*e[5]+a*e[9]+e[13],E=r*e[2]+i*e[6]+a*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=E,n[15]=e[15],n};var h=new e;_.multiplyByUniformScale=function(e,t,n){return h.x=t,h.y=t,h.z=t,_.multiplyByScale(e,h,n)},_.multiplyByScale=function(e,t,n){var r=t.x,i=t.y,a=t.z;return 1===r&&1===i&&1===a?_.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=i*e[4],n[5]=i*e[5],n[6]=i*e[6],n[7]=0,n[8]=a*e[8],n[9]=a*e[9],n[10]=a*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},_.multiplyByVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=t.w,u=e[0]*r+e[4]*i+e[8]*a+e[12]*o,E=e[1]*r+e[5]*i+e[9]*a+e[13]*o,s=e[2]*r+e[6]*i+e[10]*a+e[14]*o,c=e[3]*r+e[7]*i+e[11]*a+e[15]*o;return n.x=u,n.y=E,n.z=s,n.w=c,n},_.multiplyByPointAsVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[4]*i+e[8]*a,u=e[1]*r+e[5]*i+e[9]*a,E=e[2]*r+e[6]*i+e[10]*a;return n.x=o,n.y=u,n.z=E,n},_.multiplyByPoint=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[4]*i+e[8]*a+e[12],u=e[1]*r+e[5]*i+e[9]*a+e[13],E=e[2]*r+e[6]*i+e[10]*a+e[14];return n.x=o,n.y=u,n.z=E,n},_.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},_.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},_.transpose=function(e,t){var n=e[1],r=e[2],i=e[3],a=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=a,t[10]=e[10],t[11]=e[14],t[12]=i,t[13]=o,t[14]=u,t[15]=e[15],t},_.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},_.equals=function(e,t){return e===t||i(e)&&i(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},_.equalsEpsilon=function(e,t,n){return e===t||i(e)&&i(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},_.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},_.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};var N=new s,d=new s,I=new t,S=new t(0,0,0,1);return _.inverse=function(e,n){if(s.equalsEpsilon(_.getRotation(e,N),d,E.EPSILON7)&&t.equals(_.getRow(e,3,I),S))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],i=e[4],a=e[8],o=e[12],u=e[1],T=e[5],R=e[9],l=e[13],A=e[2],f=e[6],h=e[10],M=e[14],O=e[3],m=e[7],y=e[11],p=e[15],C=h*p,U=M*y,L=f*p,P=M*m,F=f*y,v=h*m,w=A*p,D=M*O,g=A*y,B=h*O,x=A*m,z=f*O,G=C*T+P*R+F*l-(U*T+L*R+v*l),b=U*u+w*R+B*l-(C*u+D*R+g*l),X=L*u+D*T+x*l-(P*u+w*T+z*l),V=v*u+g*T+z*R-(F*u+B*T+x*R),H=U*i+L*a+v*o-(C*i+P*a+F*o),q=C*r+D*a+g*o-(U*r+w*a+B*o),W=P*r+w*i+z*o-(L*r+D*i+x*o),Y=F*r+B*i+x*a-(v*r+g*i+z*a);C=a*l,U=o*R,L=i*l,P=o*T,F=i*R,v=a*T,w=r*l,D=o*u,g=r*R,B=a*u,x=r*T,z=i*u;var k=C*m+P*y+F*p-(U*m+L*y+v*p),K=U*O+w*y+B*p-(C*O+D*y+g*p),Z=L*O+D*m+x*p-(P*O+w*m+z*p),j=v*O+g*m+z*y-(F*O+B*m+x*y),Q=L*h+v*M+U*f-(F*M+C*f+P*h),J=g*M+C*A+D*h-(w*h+B*M+U*A),$=w*f+z*M+P*A-(x*M+L*A+D*f),ee=x*h+F*A+B*f-(g*f+z*h+v*A),te=r*G+i*b+a*X+o*V;if(Math.abs(te)<E.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=G*te,n[1]=b*te,n[2]=X*te,n[3]=V*te,n[4]=H*te,n[5]=q*te,n[6]=W*te,n[7]=Y*te,n[8]=k*te,n[9]=K*te,n[10]=Z*te,n[11]=j*te,n[12]=Q*te,n[13]=J*te,n[14]=$*te,n[15]=ee*te,n},_.inverseTransformation=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[4],o=e[5],u=e[6],E=e[8],s=e[9],c=e[10],_=e[12],T=e[13],R=e[14],l=-n*_-r*T-i*R,A=-a*_-o*T-u*R,f=-E*_-s*T-c*R;return t[0]=n,t[1]=a,t[2]=E,t[3]=0,t[4]=r,t[5]=o,t[6]=s,t[7]=0,t[8]=i,t[9]=u,t[10]=c,t[11]=0,t[12]=l,t[13]=A,t[14]=f,t[15]=1,t},_.IDENTITY=u(new _(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),_.ZERO=u(new _(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),_.COLUMN0ROW0=0,_.COLUMN0ROW1=1,_.COLUMN0ROW2=2,_.COLUMN0ROW3=3,_.COLUMN1ROW0=4,_.COLUMN1ROW1=5,_.COLUMN1ROW2=6,_.COLUMN1ROW3=7,_.COLUMN2ROW0=8,_.COLUMN2ROW1=9,_.COLUMN2ROW2=10,_.COLUMN2ROW3=11,_.COLUMN3ROW0=12,_.COLUMN3ROW1=13,_.COLUMN3ROW2=14,_.COLUMN3ROW3=15,a(_.prototype,{length:{get:function(){return _.packedLength}}}),_.prototype.clone=function(e){return _.clone(this,e)},_.prototype.equals=function(e){return _.equals(this,e)},_.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},_.prototype.equalsEpsilon=function(e,t){return _.equalsEpsilon(this,e,t)},_.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]+")"},_}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,i,a,o,u,E){"use strict";function s(e,t,r,i){this.west=n(e,0),this.south=n(t,0),this.east=n(r,0),this.north=n(i,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,t,r){return r=n(r,0),t[r++]=e.west,t[r++]=e.south,t[r++]=e.east,t[r]=e.north,t},s.unpack=function(e,t,i){return t=n(t,0),r(i)||(i=new s),i.west=e[t++],i.south=e[t++],i.east=e[t++],i.north=e[t],i},s.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=E.TWO_PI),t-n},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,t,i,a,o){return e=E.toRadians(n(e,0)),t=E.toRadians(n(t,0)),i=E.toRadians(n(i,0)),a=E.toRadians(n(a,0)),r(o)?(o.west=e,o.south=t,o.east=i,o.north=a,o):new s(e,t,i,a)},s.fromRadians=function(e,t,i,a,o){return r(o)?(o.west=n(e,0),o.south=n(t,0),o.east=n(i,0),o.north=n(a,0),o):new s(e,t,i,a)},s.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,u=Number.MAX_VALUE,c=-Number.MAX_VALUE,_=0,T=e.length;_<T;_++){var R=e[_];n=Math.min(n,R.longitude),i=Math.max(i,R.longitude),u=Math.min(u,R.latitude),c=Math.max(c,R.latitude);var l=R.longitude>=0?R.longitude:R.longitude+E.TWO_PI;a=Math.min(a,l),o=Math.max(o,l)}return i-n>o-a&&(n=a,i=o,i>E.PI&&(i-=E.TWO_PI),n>E.PI&&(n-=E.TWO_PI)),r(t)?(t.west=n,t.south=u,t.east=i,t.north=c,t):new s(n,u,i,c)},s.fromCartesianArray=function(e,t,n){for(var i=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,u=-Number.MAX_VALUE,c=Number.MAX_VALUE,_=-Number.MAX_VALUE,T=0,R=e.length;T<R;T++){var l=t.cartesianToCartographic(e[T]);i=Math.min(i,l.longitude),a=Math.max(a,l.longitude),c=Math.min(c,l.latitude),_=Math.max(_,l.latitude);var A=l.longitude>=0?l.longitude:l.longitude+E.TWO_PI;o=Math.min(o,A),u=Math.max(u,A)}return a-i>u-o&&(i=o,a=u,a>E.PI&&(a-=E.TWO_PI),i>E.PI&&(i-=E.TWO_PI)),r(n)?(n.west=i,n.south=c,n.east=a,n.north=_,n):new s(i,c,a,_)},s.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.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},s.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},s.validate=function(e){},s.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)},s.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)},s.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)},s.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)},s.center=function(t,n){var i=t.east,a=t.west;i<a&&(i+=E.TWO_PI);var o=E.negativePiToPi(.5*(a+i)),u=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=u,n.height=0,n):new e(o,u)},s.intersection=function(e,t,n){var i=e.east,a=e.west,o=t.east,u=t.west;i<a&&o>0?i+=E.TWO_PI:o<u&&i>0&&(o+=E.TWO_PI),i<a&&u<0?u+=E.TWO_PI:o<u&&a<0&&(a+=E.TWO_PI);var c=E.negativePiToPi(Math.max(a,u)),_=E.negativePiToPi(Math.min(i,o));if(!((e.west<e.east||t.west<t.east)&&_<=c)){var T=Math.max(e.south,t.south),R=Math.min(e.north,t.north);if(!(T>=R))return r(n)?(n.west=c,n.south=T,n.east=_,n.north=R,n):new s(c,T,_,R)}},s.simpleIntersection=function(e,t,n){var i=Math.max(e.west,t.west),a=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(a>=u||i>=o))return r(n)?(n.west=i,n.south=a,n.east=o,n.north=u,n):new s(i,a,o,u)},s.union=function(e,t,n){r(n)||(n=new s);var i=e.east,a=e.west,o=t.east,u=t.west;i<a&&o>0?i+=E.TWO_PI:o<u&&i>0&&(o+=E.TWO_PI),i<a&&u<0?u+=E.TWO_PI:o<u&&a<0&&(a+=E.TWO_PI);var c=E.convertLongitudeRange(Math.min(a,u)),_=E.convertLongitudeRange(Math.max(i,o));return n.west=c,n.south=Math.min(e.south,t.south),n.east=_,n.north=Math.max(e.north,t.north),n},s.expand=function(e,t,n){return r(n)||(n=new s),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},s.contains=function(e,t){var n=t.longitude,r=t.latitude,i=e.west,a=e.east;return a<i&&(a+=E.TWO_PI,n<0&&(n+=E.TWO_PI)),(n>i||E.equalsEpsilon(n,i,E.EPSILON14))&&(n<a||E.equalsEpsilon(n,a,E.EPSILON14))&&r>=e.south&&r<=e.north};var c=new e;return s.subsample=function(e,t,i,a){t=n(t,o.WGS84),i=n(i,0),r(a)||(a=[]);var u=0,_=e.north,T=e.south,R=e.east,l=e.west,A=c;A.height=i,A.longitude=l,A.latitude=_,a[u]=t.cartographicToCartesian(A,a[u]),u++,A.longitude=R,a[u]=t.cartographicToCartesian(A,a[u]),u++,A.latitude=T,a[u]=t.cartographicToCartesian(A,a[u]),u++,A.longitude=l,a[u]=t.cartographicToCartesian(A,a[u]),u++,_<0?A.latitude=_:T>0?A.latitude=T:A.latitude=0;for(var f=1;f<8;++f)A.longitude=-Math.PI+f*E.PI_OVER_TWO,s.contains(e,A)&&(a[u]=t.cartographicToCartesian(A,a[u]),u++);return 0===A.latitude&&(A.longitude=l,a[u]=t.cartographicToCartesian(A,a[u]),u++,A.longitude=R,a[u]=t.cartographicToCartesian(A,a[u]),u++),a.length=u,a},s.MAX_VALUE=u(new s(-Math.PI,-E.PI_OVER_TWO,Math.PI,E.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,i,a,o,u,E,s,c,_){"use strict";function T(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var R=new e,l=new e,A=new e,f=new e,h=new e,N=new e,d=new e,I=new e,S=new e,M=new e,O=new e,m=new e;T.fromPoints=function(t,n){if(i(n)||(n=new T),!i(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var r=e.clone(t[0],d),a=e.clone(r,R),o=e.clone(r,l),u=e.clone(r,A),E=e.clone(r,f),s=e.clone(r,h),c=e.clone(r,N),_=t.length,y=1;y<_;y++){e.clone(t[y],r);var p=r.x,C=r.y,U=r.z;p<a.x&&e.clone(r,a),p>E.x&&e.clone(r,E),C<o.y&&e.clone(r,o),C>s.y&&e.clone(r,s),U<u.z&&e.clone(r,u),U>c.z&&e.clone(r,c)}var L=e.magnitudeSquared(e.subtract(E,a,I)),P=e.magnitudeSquared(e.subtract(s,o,I)),F=e.magnitudeSquared(e.subtract(c,u,I)),v=a,w=E,D=L;P>D&&(D=P,v=o,w=s),F>D&&(D=F,v=u,w=c);var g=S;g.x=.5*(v.x+w.x),g.y=.5*(v.y+w.y),g.z=.5*(v.z+w.z);var B=e.magnitudeSquared(e.subtract(w,g,I)),x=Math.sqrt(B),z=M;z.x=a.x,z.y=o.y,z.z=u.z;var G=O;G.x=E.x,G.y=s.y,G.z=c.z;var b=e.multiplyByScalar(e.add(z,G,I),.5,m),X=0;for(y=0;y<_;y++){e.clone(t[y],r);var V=e.magnitude(e.subtract(r,b,I));V>X&&(X=V);var H=e.magnitudeSquared(e.subtract(r,g,I));if(H>B){var q=Math.sqrt(H);x=.5*(x+q),B=x*x;var W=q-x;g.x=(x*g.x+W*r.x)/q,g.y=(x*g.y+W*r.y)/q,g.z=(x*g.z+W*r.z)/q}}return x<X?(e.clone(g,n.center),n.radius=x):(e.clone(b,n.center),n.radius=X),n};var y=new o,p=new e,C=new e,U=new t,L=new t;T.fromRectangle2D=function(e,t,n){return T.fromRectangleWithHeights2D(e,t,0,0,n)},T.fromRectangleWithHeights2D=function(t,n,a,o,u){if(i(u)||(u=new T),!i(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;n=r(n,y),_.southwest(t,U),U.height=a,_.northeast(t,L),L.height=o;var E=n.project(U,p),s=n.project(L,C),c=s.x-E.x,R=s.y-E.y,l=s.z-E.z;u.radius=.5*Math.sqrt(c*c+R*R+l*l);var A=u.center;return A.x=E.x+.5*c,A.y=E.y+.5*R,A.z=E.z+.5*l,u};var P=[];T.fromRectangle3D=function(e,t,n,o){t=r(t,a.WGS84),n=r(n,0);var u;return i(e)&&(u=_.subsample(e,t,n,P)),T.fromPoints(u,o)},T.fromVertices=function(t,n,a,o){if(i(o)||(o=new T),!i(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;n=r(n,e.ZERO),a=r(a,3);var u=d;u.x=t[0]+n.x,u.y=t[1]+n.y,u.z=t[2]+n.z;for(var E=e.clone(u,R),s=e.clone(u,l),c=e.clone(u,A),_=e.clone(u,f),y=e.clone(u,h),p=e.clone(u,N),C=t.length,U=0;U<C;U+=a){var L=t[U]+n.x,P=t[U+1]+n.y,F=t[U+2]+n.z;u.x=L,u.y=P,u.z=F,L<E.x&&e.clone(u,E),L>_.x&&e.clone(u,_),P<s.y&&e.clone(u,s),P>y.y&&e.clone(u,y),F<c.z&&e.clone(u,c),F>p.z&&e.clone(u,p)}var v=e.magnitudeSquared(e.subtract(_,E,I)),w=e.magnitudeSquared(e.subtract(y,s,I)),D=e.magnitudeSquared(e.subtract(p,c,I)),g=E,B=_,x=v;w>x&&(x=w,g=s,B=y),D>x&&(x=D,g=c,B=p);var z=S;z.x=.5*(g.x+B.x),z.y=.5*(g.y+B.y),z.z=.5*(g.z+B.z);var G=e.magnitudeSquared(e.subtract(B,z,I)),b=Math.sqrt(G),X=M;X.x=E.x,X.y=s.y,X.z=c.z;var V=O;V.x=_.x,V.y=y.y,V.z=p.z;var H=e.multiplyByScalar(e.add(X,V,I),.5,m),q=0;for(U=0;U<C;U+=a){u.x=t[U]+n.x,u.y=t[U+1]+n.y,u.z=t[U+2]+n.z;var W=e.magnitude(e.subtract(u,H,I));W>q&&(q=W);var Y=e.magnitudeSquared(e.subtract(u,z,I));if(Y>G){var k=Math.sqrt(Y);b=.5*(b+k),G=b*b;var K=k-b;z.x=(b*z.x+K*u.x)/k,z.y=(b*z.y+K*u.y)/k,z.z=(b*z.z+K*u.z)/k}}return b<q?(e.clone(z,o.center),o.radius=b):(e.clone(H,o.center),o.radius=q),o},T.fromEncodedCartesianVertices=function(t,n,r){if(i(r)||(r=new T),!i(t)||!i(n)||t.length!==n.length||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var a=d;a.x=t[0]+n[0],a.y=t[1]+n[1],a.z=t[2]+n[2];for(var o=e.clone(a,R),u=e.clone(a,l),E=e.clone(a,A),s=e.clone(a,f),c=e.clone(a,h),_=e.clone(a,N),y=t.length,p=0;p<y;p+=3){var C=t[p]+n[p],U=t[p+1]+n[p+1],L=t[p+2]+n[p+2];a.x=C,a.y=U,a.z=L,C<o.x&&e.clone(a,o),C>s.x&&e.clone(a,s),U<u.y&&e.clone(a,u),U>c.y&&e.clone(a,c),L<E.z&&e.clone(a,E),L>_.z&&e.clone(a,_)}var P=e.magnitudeSquared(e.subtract(s,o,I)),F=e.magnitudeSquared(e.subtract(c,u,I)),v=e.magnitudeSquared(e.subtract(_,E,I)),w=o,D=s,g=P;F>g&&(g=F,w=u,D=c),v>g&&(g=v,w=E,D=_);var B=S;B.x=.5*(w.x+D.x),B.y=.5*(w.y+D.y),B.z=.5*(w.z+D.z);var x=e.magnitudeSquared(e.subtract(D,B,I)),z=Math.sqrt(x),G=M;G.x=o.x,G.y=u.y,G.z=E.z;var b=O;b.x=s.x,b.y=c.y,b.z=_.z;var X=e.multiplyByScalar(e.add(G,b,I),.5,m),V=0;for(p=0;p<y;p+=3){a.x=t[p]+n[p],a.y=t[p+1]+n[p+1],a.z=t[p+2]+n[p+2];var H=e.magnitude(e.subtract(a,X,I));H>V&&(V=H);var q=e.magnitudeSquared(e.subtract(a,B,I));if(q>x){var W=Math.sqrt(q);z=.5*(z+W),x=z*z;var Y=W-z;B.x=(z*B.x+Y*a.x)/W,B.y=(z*B.y+Y*a.y)/W,B.z=(z*B.z+Y*a.z)/W}}return z<V?(e.clone(B,r.center),r.radius=z):(e.clone(X,r.center),r.radius=V),r},T.fromCornerPoints=function(t,n,r){i(r)||(r=new T);var a=r.center;return e.add(t,n,a),e.multiplyByScalar(a,.5,a),r.radius=e.distance(a,n),r},T.fromEllipsoid=function(t,n){return i(n)||(n=new T),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var F=new e;T.fromBoundingSpheres=function(t,n){if(i(n)||(n=new T),!i(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var r=t.length;if(1===r)return T.clone(t[0],n);if(2===r)return T.union(t[0],t[1],n);for(var a=[],o=0;o<r;o++)a.push(t[o].center);n=T.fromPoints(a,n);var u=n.center,E=n.radius;for(o=0;o<r;o++){var s=t[o];E=Math.max(E,e.distance(u,s.center,F)+s.radius)}return n.radius=E,n};var v=new e,w=new e,D=new e;T.fromOrientedBoundingBox=function(t,n){i(n)||(n=new T);var r=t.halfAxes,a=s.getColumn(r,0,v),o=s.getColumn(r,1,w),u=s.getColumn(r,2,D),E=e.magnitude(a),c=e.magnitude(o),_=e.magnitude(u);return n.center=e.clone(t.center,n.center),n.radius=Math.max(E,c,_),n},T.clone=function(t,n){if(i(t))return i(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new T(t.center,t.radius)},T.packedLength=4,T.pack=function(e,t,n){n=r(n,0);var i=e.center;return t[n++]=i.x,t[n++]=i.y,t[n++]=i.z,t[n]=e.radius,t},T.unpack=function(e,t,n){t=r(t,0),i(n)||(n=new T);var a=n.center;return a.x=e[t++],a.y=e[t++],a.z=e[t++],n.radius=e[t],n};var g=new e,B=new e;T.union=function(t,n,r){i(r)||(r=new T);var a=t.center,o=t.radius,u=n.center,E=n.radius,s=e.subtract(u,a,g),c=e.magnitude(s);if(o>=c+E)return t.clone(r),r;if(E>=c+o)return n.clone(r),r;var _=.5*(o+c+E),R=e.multiplyByScalar(s,(-o+_)/c,B);return e.add(R,a,R),e.clone(R,r.center),r.radius=_,r};var x=new e;T.expand=function(t,n,r){r=T.clone(t,r);var i=e.magnitude(e.subtract(n,r.center,x));return i>r.radius&&(r.radius=i),r},T.intersectPlane=function(t,n){var r=t.center,i=t.radius,a=n.normal,o=e.dot(a,r)+n.distance;return o<-i?u.OUTSIDE:o<i?u.INTERSECTING:u.INSIDE},T.transform=function(e,t,n){return i(n)||(n=new T),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=c.getMaximumScale(t)*e.radius,n};var z=new e;T.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,z);return e.magnitudeSquared(r)-t.radius*t.radius},T.transformWithoutScale=function(e,t,n){return i(n)||(n=new T),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var G=new e;T.computePlaneDistances=function(t,n,r,a){i(a)||(a=new E);var o=e.subtract(t.center,n,G),u=e.dot(r,o);return a.start=u-t.radius,a.stop=u+t.radius,a};for(var b=new e,X=new e,V=new e,H=new e,q=new e,W=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var K=new o;return T.projectTo2D=function(t,n,i){n=r(n,K);var a=n.ellipsoid,o=t.center,u=t.radius,E=a.geodeticSurfaceNormal(o,b),s=e.cross(e.UNIT_Z,E,X);e.normalize(s,s);var c=e.cross(E,s,V);e.normalize(c,c),e.multiplyByScalar(E,u,E),e.multiplyByScalar(c,u,c),e.multiplyByScalar(s,u,s);var _=e.negate(c,q),R=e.negate(s,H),l=Y,A=l[0];e.add(E,c,A),e.add(A,s,A),A=l[1],e.add(E,c,A),e.add(A,R,A),A=l[2],e.add(E,_,A),e.add(A,R,A),A=l[3],e.add(E,_,A),e.add(A,s,A),e.negate(E,E),A=l[4],e.add(E,c,A),e.add(A,s,A),A=l[5],e.add(E,c,A),e.add(A,R,A),A=l[6],e.add(E,_,A),e.add(A,R,A),A=l[7],e.add(E,_,A),e.add(A,s,A);for(var f=l.length,h=0;h<f;++h){var N=l[h];e.add(o,N,N);var d=a.cartesianToCartographic(N,W);n.project(d,N)}i=T.fromPoints(l,i),o=i.center;var I=o.x,S=o.y,M=o.z;return o.x=M,o.y=I,o.z=S,i},T.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},T.equals=function(t,n){return t===n||i(t)&&i(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},T.prototype.intersectPlane=function(e){return T.intersectPlane(this,e)},T.prototype.distanceSquaredTo=function(e){return T.distanceSquaredTo(this,e)},T.prototype.computePlaneDistances=function(e,t,n){return T.computePlaneDistances(this,e,t,n)},T.prototype.isOccluded=function(e){return T.isOccluded(this,e)},T.prototype.equals=function(e){return T.equals(this,e)},T.prototype.clone=function(e){return T.clone(this,e)},T}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},i={};return t(i,{element:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(i.supportsFullscreen())return null!==i.element}}}),i.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var i,a=["webkit","moz","o","ms","khtml"],o=0,u=a.length;o<u;++o){var E=a[o];i=E+"RequestFullscreen","function"==typeof t[i]?(r.requestFullscreen=i,n=!0):(i=E+"RequestFullScreen","function"==typeof t[i]&&(r.requestFullscreen=i,n=!0)),i=E+"ExitFullscreen","function"==typeof document[i]?r.exitFullscreen=i:(i=E+"CancelFullScreen","function"==typeof document[i]&&(r.exitFullscreen=i)),i=E+"FullscreenEnabled",void 0!==document[i]?r.fullscreenEnabled=i:(i=E+"FullScreenEnabled",void 0!==document[i]&&(r.fullscreenEnabled=i)),i=E+"FullscreenElement",void 0!==document[i]?r.fullscreenElement=i:(i=E+"FullScreenElement",void 0!==document[i]&&(r.fullscreenElement=i)),i=E+"fullscreenchange",void 0!==document["on"+i]&&("ms"===E&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=E+"fullscreenerror",void 0!==document["on"+i]&&("ms"===E&&(i="MSFullscreenError"),r.fullscreenerror=i)}return n},i.requestFullscreen=function(e,t){i.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},i.exitFullscreen=function(){i.supportsFullscreen()&&document[r.exitFullscreen]()},i}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function i(){if(!t(S)&&(S=!1,!T())){var e=/ Chrome\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(S=!0,M=r(e[1]))}return S}function a(){return i()&&M}function o(){if(!t(O)&&(O=!1,!i()&&!T()&&/ Safari\/[\.0-9]+/.test(I.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(O=!0,m=r(e[1]))}return O}function u(){return o()&&m}function E(){if(!t(y)){y=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(I.userAgent);null!==e&&(y=!0,p=r(e[1]),p.isNightly=!!e[2])}return y}function s(){return E()&&p}function c(){if(!t(C)){C=!1;var e;"Microsoft Internet Explorer"===I.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==e&&(C=!0,U=r(e[1]))):"Netscape"===I.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==e&&(C=!0,U=r(e[1])))}return C}function _(){return c()&&U}function T(){if(!t(L)){L=!1;var e=/ Edge\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(L=!0,P=r(e[1]))}return L}function R(){return T()&&P}function l(){if(!t(F)){F=!1;var e=/Firefox\/([\.0-9]+)/.exec(I.userAgent); +null!==e&&(F=!0,v=r(e[1]))}return F}function A(){return t(w)||(w=/Windows/i.test(I.appVersion)),w}function f(){return l()&&v}function h(){return t(D)||(D="undefined"!=typeof PointerEvent&&(!t(I.pointerEnabled)||I.pointerEnabled)),D}function N(){if(!t(B)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;B=t(n)&&""!==n,B&&(g=n)}return B}function d(){return N()?g:void 0}var I;I="undefined"!=typeof navigator?navigator:{};var S,M,O,m,y,p,C,U,L,P,F,v,w,D,g,B,x={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:E,webkitVersion:s,isInternetExplorer:c,internetExplorerVersion:_,isEdge:T,edgeVersion:R,isFirefox:l,firefoxVersion:f,isWindows:A,hardwareConcurrency:e(I.hardwareConcurrency,3),supportsPointerEvents:h,supportsImageRenderingPixelated:N,imageRenderingValue:d};return x.supportsFullscreen=function(){return n.supportsFullscreen()},x.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},x.supportsWebWorkers=function(){return"undefined"!=typeof Worker},x}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,i,a){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:a.BYTE,UNSIGNED_BYTE:a.UNSIGNED_BYTE,SHORT:a.SHORT,UNSIGNED_SHORT:a.UNSIGNED_SHORT,INT:a.INT,UNSIGNED_INT:a.UNSIGNED_INT,FLOAT:a.FLOAT,DOUBLE:a.DOUBLE};return o.getSizeInBytes=function(e){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.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},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 Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,i){switch(r=e(r,0),i=e(i,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,i);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,i);case o.SHORT:return new Int16Array(n,r,i);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,i);case o.INT:return new Int32Array(n,r,i);case o.UNSIGNED_INT:return new Uint32Array(n,r,i);case o.FLOAT:return new Float32Array(n,r,i);case o.DOUBLE:return new Float64Array(n,r,i)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},i(o)}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===n.POINTS||e===n.LINES||e===n.LINE_LOOP||e===n.LINE_STRIP||e===n.TRIANGLES||e===n.TRIANGLE_STRIP||e===n.TRIANGLE_FAN}};return e(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,i){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,i.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return a.computeNumberOfVertices=function(e){var n=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var i=e.attributes[r],a=i.values.length/i.componentsPerAttribute;n=a}return n},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(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 r}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,n,r,i){"use strict";var a={UNSIGNED_BYTE:i.UNSIGNED_BYTE,UNSIGNED_SHORT:i.UNSIGNED_SHORT,UNSIGNED_INT:i.UNSIGNED_INT};return a.getSizeInBytes=function(e){switch(e){case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},a.validate=function(t){return e(t)&&(t===a.UNSIGNED_BYTE||t===a.UNSIGNED_SHORT||t===a.UNSIGNED_INT)},a.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},a.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)},n(a)}),define("Core/EllipsoidOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType"],function(e,t,n,r,i,a,o,u,E,s,c,_,T){"use strict";function R(e){e=r(e,r.EMPTY_OBJECT);var n=r(e.radii,l),i=r(e.stackPartitions,10),a=r(e.slicePartitions,8),o=r(e.subdivisions,128);this._radii=t.clone(n),this._stackPartitions=i,this._slicePartitions=a,this._subdivisions=o,this._workerName="createEllipsoidOutlineGeometry"}var l=new t(1,1,1),A=Math.cos,f=Math.sin;R.packedLength=t.packedLength+3,R.pack=function(e,n,i){return i=r(i,0),t.pack(e._radii,n,i),i+=t.packedLength,n[i++]=e._stackPartitions,n[i++]=e._slicePartitions,n[i]=e._subdivisions,n};var h=new t,N={radii:h,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};return R.unpack=function(e,n,a){n=r(n,0);var o=t.unpack(e,n,h);n+=t.packedLength;var u=e[n++],E=e[n++],s=e[n++];return i(a)?(a._radii=t.clone(o,a._radii),a._stackPartitions=u,a._slicePartitions=E,a._subdivisions=s,a):(N.stackPartitions=u,N.slicePartitions=E,N.subdivisions=s,new R(N))},R.createGeometry=function(t){var r=t._radii;if(!(r.x<=0||r.y<=0||r.z<=0)){var i,a,R,l,h,N,d=o.fromCartesian3(r),I=t._stackPartitions,S=t._slicePartitions,M=t._subdivisions,O=M*(I+S-1),m=O-S+2,y=new Float64Array(3*m),p=c.createTypedArray(m,2*O),C=0,U=new Array(M),L=new Array(M);for(i=0;i<M;i++)R=_.TWO_PI*i/M,U[i]=A(R),L[i]=f(R);for(i=1;i<I;i++)for(l=Math.PI*i/I,h=A(l),N=f(l),a=0;a<M;a++)y[C++]=r.x*U[a]*N,y[C++]=r.y*L[a]*N,y[C++]=r.z*h;for(U.length=S,L.length=S,i=0;i<S;i++)R=_.TWO_PI*i/S,U[i]=A(R),L[i]=f(R);for(y[C++]=0,y[C++]=0,y[C++]=r.z,i=1;i<M;i++)for(l=Math.PI*i/M,h=A(l),N=f(l),a=0;a<S;a++)y[C++]=r.x*U[a]*N,y[C++]=r.y*L[a]*N,y[C++]=r.z*h;for(y[C++]=0,y[C++]=0,y[C++]=-r.z,C=0,i=0;i<I-1;++i){var P=i*M;for(a=0;a<M-1;++a)p[C++]=P+a,p[C++]=P+a+1;p[C++]=P+M-1,p[C++]=P}var F=M*(I-1);for(a=1;a<S+1;++a)p[C++]=F,p[C++]=F+a;for(i=0;i<M-2;++i){var v=i*S+1+F,w=(i+1)*S+1+F;for(a=0;a<S-1;++a)p[C++]=w+a,p[C++]=v+a;p[C++]=w+S-1,p[C++]=v+S-1}var D=y.length/3-1;for(a=D-1;a>D-S-1;--a)p[C++]=D,p[C++]=a;var g=new s({position:new E({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:y})});return new u({attributes:g,indices:p,primitiveType:T.LINES,boundingSphere:e.fromEllipsoid(d)})}},R}),define("Core/SphereOutlineGeometry",["./Cartesian3","./Check","./defaultValue","./defined","./DeveloperError","./EllipsoidOutlineGeometry"],function(e,t,n,r,i,a){"use strict";function o(t){var r=n(t.radius,1),i=new e(r,r,r),o={radii:i,stackPartitions:t.stackPartitions,slicePartitions:t.slicePartitions,subdivisions:t.subdivisions};this._ellipsoidGeometry=new a(o),this._workerName="createSphereOutlineGeometry"}o.packedLength=a.packedLength,o.pack=function(e,t,n){return a.pack(e._ellipsoidGeometry,t,n)};var u=new a,E={radius:void 0,radii:new e,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};return o.unpack=function(t,n,i){var s=a.unpack(t,n,u);return E.stackPartitions=s._stackPartitions,E.slicePartitions=s._slicePartitions,E.subdivisions=s._subdivisions,r(i)?(e.clone(s._radii,E.radii),i._ellipsoidGeometry=new a(E),i):(E.radius=s._radii.x,new o(E))},o.createGeometry=function(e){return a.createGeometry(e._ellipsoidGeometry)},o}),define("Workers/createSphereOutlineGeometry",["../Core/defined","../Core/SphereOutlineGeometry"],function(e,t){"use strict";return function(n,r){return e(r)&&(n=t.unpack(n,r)),t.createGeometry(n)}})}(); \ No newline at end of file diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createVerticesFromHeightmap.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createVerticesFromHeightmap.js index 78f38e6d..33b860bb 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createVerticesFromHeightmap.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createVerticesFromHeightmap.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -222,9 +222,9 @@ OTHER DEALINGS IN THE SOFTWARE. * */ -!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==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";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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("Core/isArray",["./defined"],function(e){"use strict";var t=Array.isArray;return e(t)||(t=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),t}),define("Core/Check",["./defaultValue","./defined","./DeveloperError","./isArray"],function(e,t,n,r){"use strict";function a(e){return e+" was required but undefined."}function i(e,t,n){return"Expected "+n+" to be typeof "+t+", got "+e}var o={};return o.typeOf={},o.numeric={},o.defined=function(e,r){if(!t(e))throw new n(a(r))},o.numeric.maximum=function(e,t){if(o.typeOf.number(e),o.typeOf.number(t),e>t)throw new n("Expected "+e+" to be at most "+t)},o.numeric.minimum=function(e,t){if(o.typeOf.number(e),o.typeOf.number(t),e<t)throw new n("Expected "+e+" to be at least "+t)},o.typeOf.function=function(e,t){if("function"!=typeof e)throw new n(i(typeof e,"function",t))},o.typeOf.string=function(e,t){if("string"!=typeof e)throw new n(i(typeof e,"string",t))},o.typeOf.number=function(e,t){if("number"!=typeof e)throw new n(i(typeof e,"number",t))},o.typeOf.object=function(e,t){if("object"!=typeof e)throw new n(i(typeof e,"object",t))},o.typeOf.boolean=function(e,t){if("boolean"!=typeof e)throw new n(i(typeof e,"boolean",t))},o}),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 n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(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^=e<<7&2636928640,e^=e<<15&4022730752,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,n,r){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:e<0?-1:0},a.signNotZero=function(e){return e<0?-1:1},a.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*a.clamp(e,-1,1)+.5)*n)},a.fromSNorm=function(e,n){return n=t(n,255),a.clamp(e,0,n)/n*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},a.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},a.lerp=function(e,t,n){return(1-n)*e+n*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){var t=a.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},a.clampToLatitudeRange=function(e){return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){return(e%t+t)%t},a.equalsEpsilon=function(e,n,r,a){a=t(a,r);var i=Math.abs(e-n);return i<=a||i<=r*Math.max(Math.abs(e),Math.abs(n))};var i=[1];a.factorial=function(e){var t=i.length;if(e>=t)for(var n=i[t-1],r=t;r<=e;r++)i.push(n*r);return i[e]},a.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},a.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return a.setRandomNumberSeed=function(t){o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(e){return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){return Math.log(e)/Math.log(t)},a.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var a=e.clock,i=e.cone,u=t(e.magnitude,1),s=u*Math.sin(i);return r.x=s*Math.cos(a),r.y=s*Math.sin(a),r.z=u*Math.cos(i),r},o.fromElements=function(e,t,r,a){return n(a)?(a.x=e,a.y=t,a.z=r,a):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var a=0;a<r;++a)o.pack(e[a],t,3*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var a=0;a<r;a+=3){var i=a/3;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,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};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var n=o.dot(c,l),r=o.magnitude(o.cross(c,l,c));return Math.atan2(r,n)};var f=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)},o.cross=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=t.x,u=t.y,s=t.z,c=a*s-i*u,l=i*o-r*s,f=r*u-a*o;return n.x=c,n.y=l,n.z=f,n},o.fromDegrees=function(e,t,n,r,a){return e=i.toRadians(e),t=i.toRadians(t),o.fromRadians(e,t,n,r,a)};var d=new o,h=new o,E=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,a,i,u){a=t(a,0);var s=n(i)?i.radiiSquared:E,c=Math.cos(r);d.x=c*Math.cos(e),d.y=c*Math.sin(e),d.z=Math.sin(r),d=o.normalize(d,d),o.multiplyComponents(s,d,h);var l=Math.sqrt(o.dot(d,h));return h=o.divideByScalar(h,l,h),d=o.multiplyByScalar(d,a,d),n(u)||(u=new o),o.add(h,d,u)},o.fromDegreesArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromDegrees(u,s,0,t,r[c])}return r},o.fromRadiansArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromRadians(u,s,0,t,r[c])}return r},o.fromDegreesArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromDegrees(u,s,c,t,r[l])}return r},o.fromRadiansArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromRadians(u,s,c,t,r[l])}return r},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(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,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(n,a,u,s,c){var l=n.x,f=n.y,d=n.z,h=a.x,E=a.y,m=a.z,_=l*l*h*h,p=f*f*E*E,y=d*d*m*m,T=_+p+y,R=Math.sqrt(1/T),A=e.multiplyByScalar(n,R,i);if(T<s)return isFinite(R)?e.clone(A,c):void 0;var S=u.x,N=u.y,M=u.z,I=o;I.x=A.x*S*2,I.y=A.y*N*2,I.z=A.z*M*2;var g,O,v,x,w,C,P,U,D,L,F,z=(1-R)*e.magnitude(n)/(.5*e.magnitude(I)),B=0;do{z-=B,v=1/(1+z*S),x=1/(1+z*N),w=1/(1+z*M),C=v*v,P=x*x,U=w*w,D=C*v,L=P*x,F=U*w,g=_*C+p*P+y*U-1,O=_*D*S+p*L*N+y*F*M;var b=-2*O;B=g/b}while(Math.abs(g)>r.EPSILON12);return t(c)?(c.x=l*v,c.y=f*x,c.z=d*w,c):new e(l*v,f*x,d*w)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o){"use strict";function u(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)}u.fromRadians=function(e,r,a,i){return a=t(a,0),n(i)?(i.longitude=e,i.latitude=r,i.height=a,i):new u(e,r,a)},u.fromDegrees=function(e,t,n,r){return e=i.toRadians(e),t=i.toRadians(t),u.fromRadians(e,t,n,r)};var s=new e,c=new e,l=new e,f=new e(1/6378137,1/6378137,1/6356752.314245179),d=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),h=i.EPSILON1;return u.fromCartesian=function(t,r,a){var E=n(r)?r.oneOverRadii:f,m=n(r)?r.oneOverRadiiSquared:d,_=n(r)?r._centerToleranceSquared:h,p=o(t,E,m,_,c);if(n(p)){var y=e.multiplyComponents(p,m,s);y=e.normalize(y,y);var T=e.subtract(t,p,l),R=Math.atan2(y.y,y.x),A=Math.asin(y.z),S=i.sign(e.dot(T,t))*e.magnitude(T);return n(a)?(a.longitude=R,a.latitude=A,a.height=S,a):new u(R,A,S)}},u.clone=function(e,t){if(n(e))return n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},u.ZERO=a(new u(0,0,0)),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,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(t,r,a,i){r=n(r,0),a=n(a,0),i=n(i,0),t._radii=new e(r,a,i),t._radiiSquared=new e(r*r,a*a,i*i),t._radiiToTheFourth=new e(r*r*r*r,a*a*a*a,i*i*i*i),t._oneOverRadii=new e(0===r?0:1/r,0===a?0:1/a,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===a?0:1/(a*a),0===i?0:1/(i*i)),t._minimumRadius=Math.min(r,a,i),t._maximumRadius=Math.max(r,a,i),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,c(this,e,t,n)}a(l.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}}}),l.clone=function(t,n){if(r(t)){var a=t._radii;return r(n)?(e.clone(a,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new l(a.x,a.y,a.z)}},l.fromCartesian3=function(e,t){return r(t)||(t=new l),r(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,r,a){return a=n(a,0),e.pack(t._radii,r,a),r},l.unpack=function(t,r,a){r=n(r,0);var i=e.unpack(t,r);return l.fromCartesian3(i,a)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,n){var a=t.longitude,i=t.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return r(n)||(n=new e),n.x=u,n.y=s,n.z=c,e.normalize(n,n)},l.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var f=new e,d=new e;l.prototype.cartographicToCartesian=function(t,n){var a=f,i=d;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(e.dot(a,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(a,t.height,a),r(n)||(n=new e),e.add(i,a,n)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var h=new e,E=new e,m=new e;return l.prototype.cartesianToCartographic=function(n,a){var i=this.scaleToGeodeticSurface(n,E);if(r(i)){var o=this.geodeticSurfaceNormal(i,h),s=e.subtract(n,i,m),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),f=u.sign(e.dot(s,n))*e.magnitude(s);return r(a)?(a.longitude=c,a.latitude=l,a.height=f,a):new t(c,l,f)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var a=t.x,i=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return e.multiplyByScalar(t,s,n)},l.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},l.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},l.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,a,i){a=n(a,0);var o=this._sqauredXOverSquaredZ;if(r(i)||(i=new e),i.x=0,i.y=0,i.z=t.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},l}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Intersect"],function(e,t,n,r,a){"use strict";function i(r,a,i){this.minimum=e.clone(t(r,e.ZERO)),this.maximum=e.clone(t(a,e.ZERO)),n(i)?i=e.clone(i):(i=e.add(this.minimum,this.maximum,new e),e.multiplyByScalar(i,.5,i)),this.center=i}i.fromPoints=function(t,r){if(n(r)||(r=new i),!n(t)||0===t.length)return r.minimum=e.clone(e.ZERO,r.minimum),r.maximum=e.clone(e.ZERO,r.maximum),r.center=e.clone(e.ZERO,r.center),r;for(var a=t[0].x,o=t[0].y,u=t[0].z,s=t[0].x,c=t[0].y,l=t[0].z,f=t.length,d=1;d<f;d++){var h=t[d],E=h.x,m=h.y,_=h.z;a=Math.min(E,a),s=Math.max(E,s),o=Math.min(m,o),c=Math.max(m,c),u=Math.min(_,u),l=Math.max(_,l)}var p=r.minimum;p.x=a,p.y=o,p.z=u;var y=r.maximum;y.x=s,y.y=c,y.z=l;var T=e.add(p,y,r.center);return e.multiplyByScalar(T,.5,T),r},i.clone=function(t,r){if(n(t))return n(r)?(r.minimum=e.clone(t.minimum,r.minimum),r.maximum=e.clone(t.maximum,r.maximum),r.center=e.clone(t.center,r.center),r):new i(t.minimum,t.maximum)},i.equals=function(t,r){return t===r||n(t)&&n(r)&&e.equals(t.center,r.center)&&e.equals(t.minimum,r.minimum)&&e.equals(t.maximum,r.maximum)};var o=new e;return i.intersectPlane=function(t,n){o=e.subtract(t.maximum,t.minimum,o);var r=e.multiplyByScalar(o,.5,o),i=n.normal,u=r.x*Math.abs(i.x)+r.y*Math.abs(i.y)+r.z*Math.abs(i.z),s=e.dot(t.center,i)+n.distance;return s-u>0?a.INSIDE:s+u<0?a.OUTSIDE:a.INTERSECTING},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.intersectPlane=function(e){return i.intersectPlane(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,a,i,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return r(n)?(n.x=i,n.y=o,n.z=u,n):new e(i,o,u)},u.prototype.unproject=function(e,n){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,u=e.z;return r(n)?(n.longitude=i,n.latitude=o,n.height=u,n):new t(i,o,u)},u}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i,o){"use strict";function u(e,n,r,a,i,o,u,s,c){this[0]=t(e,0),this[1]=t(a,0),this[2]=t(u,0),this[3]=t(n,0),this[4]=t(i,0),this[5]=t(s,0),this[6]=t(r,0),this[7]=t(o,0),this[8]=t(c,0)}function s(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function c(e){for(var t=0,n=0;n<3;++n){var r=e[u.getElementIndex(E[n],h[n])];t+=2*r*r}return Math.sqrt(t)}function l(e,t){for(var n=o.EPSILON15,r=0,a=1,i=0;i<3;++i){var s=Math.abs(e[u.getElementIndex(E[i],h[i])]);s>r&&(a=i,r=s)}var c=1,l=0,f=h[a],d=E[a];if(Math.abs(e[u.getElementIndex(d,f)])>n){var m,_=e[u.getElementIndex(d,d)],p=e[u.getElementIndex(f,f)],y=e[u.getElementIndex(d,f)],T=(_-p)/2/y;m=T<0?-1/(-T+Math.sqrt(1+T*T)):1/(T+Math.sqrt(1+T*T)),c=1/Math.sqrt(1+m*m),l=m*c}return t=u.clone(u.IDENTITY,t),t[u.getElementIndex(f,f)]=t[u.getElementIndex(d,d)]=c,t[u.getElementIndex(d,f)]=l,t[u.getElementIndex(f,d)]=-l,t}u.packedLength=9,u.pack=function(e,n,r){return r=t(r,0),n[r++]=e[0],n[r++]=e[1],n[r++]=e[2],n[r++]=e[3],n[r++]=e[4],n[r++]=e[5],n[r++]=e[6],n[r++]=e[7],n[r++]=e[8],n},u.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new u),a[0]=e[r++],a[1]=e[r++],a[2]=e[r++],a[3]=e[r++],a[4]=e[r++],a[5]=e[r++],a[6]=e[r++],a[7]=e[r++],a[8]=e[r++],a},u.clone=function(e,t){if(n(e))return n(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 u(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},u.fromArray=function(e,r,a){return r=t(r,0),n(a)||(a=new u),a[0]=e[r],a[1]=e[r+1],a[2]=e[r+2],a[3]=e[r+3],a[4]=e[r+4],a[5]=e[r+5],a[6]=e[r+6],a[7]=e[r+7],a[8]=e[r+8],a},u.fromColumnMajorArray=function(e,t){return u.clone(e,t)},u.fromRowMajorArray=function(e,t){return n(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 u(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},u.fromQuaternion=function(e,t){var r=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,s=e.y*e.y,c=e.y*e.z,l=e.y*e.w,f=e.z*e.z,d=e.z*e.w,h=e.w*e.w,E=r-s-f+h,m=2*(a-d),_=2*(i+l),p=2*(a+d),y=-r+s-f+h,T=2*(c-o),R=2*(i-l),A=2*(c+o),S=-r-s+f+h;return n(t)?(t[0]=E,t[1]=p,t[2]=R,t[3]=m,t[4]=y,t[5]=A,t[6]=_,t[7]=T,t[8]=S,t):new u(E,m,_,p,y,T,R,A,S)},u.fromHeadingPitchRoll=function(e,t){var r=Math.cos(-e.pitch),a=Math.cos(-e.heading),i=Math.cos(e.roll),o=Math.sin(-e.pitch),s=Math.sin(-e.heading),c=Math.sin(e.roll),l=r*a,f=-i*s+c*o*a,d=c*s+i*o*a,h=r*s,E=i*a+c*o*s,m=-o*i+i*o*s,_=-o,p=c*r,y=i*r;return n(t)?(t[0]=l,t[1]=h,t[2]=_,t[3]=f,t[4]=E,t[5]=p,t[6]=d,t[7]=m,t[8]=y,t):new u(l,f,d,h,E,m,_,p,y)},u.fromScale=function(e,t){return n(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 u(e.x,0,0,0,e.y,0,0,0,e.z)},u.fromUniformScale=function(e,t){return n(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 u(e,0,0,0,e,0,0,0,e)},u.fromCrossProduct=function(e,t){return n(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 u(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},u.fromRotationX=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=r,t[5]=a,t[6]=0,t[7]=-a,t[8]=r,t):new u(1,0,0,0,r,-a,0,a,r)},u.fromRotationY=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=r,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=r,t):new u(r,0,a,0,1,0,-a,0,r)},u.fromRotationZ=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=r,t[1]=a,t[2]=0,t[3]=-a,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new u(r,-a,0,a,r,0,0,0,1)},u.toArray=function(e,t){return n(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]]},u.getElementIndex=function(e,t){return 3*e+t},u.getColumn=function(e,t,n){var r=3*t,a=e[r],i=e[r+1],o=e[r+2];return n.x=a,n.y=i,n.z=o,n},u.setColumn=function(e,t,n,r){r=u.clone(e,r);var a=3*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},u.getRow=function(e,t,n){var r=e[t],a=e[t+3],i=e[t+6];return n.x=r,n.y=a,n.z=i,n},u.setRow=function(e,t,n,r){return r=u.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var f=new e;u.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],f)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],f)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],f)),n};var d=new e;u.getMaximumScale=function(t){return u.getScale(t,d),e.maximumComponent(d)},u.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=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 n[0]=r,n[1]=a,n[2]=i,n[3]=o,n[4]=u,n[5]=s,n[6]=c,n[7]=l,n[8]=f,n},u.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},u.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},u.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[3]*a+e[6]*i,u=e[1]*r+e[4]*a+e[7]*i,s=e[2]*r+e[5]*a+e[8]*i;return n.x=o,n.y=u,n.z=s,n},u.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},u.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},u.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},u.transpose=function(e,t){var n=e[0],r=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=n,t[1]=r,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var h=[1,0,0],E=[2,2,1],m=new u,_=new u;return u.computeEigenDecomposition=function(e,t){var r=o.EPSILON20,a=10,i=0,f=0;n(t)||(t={});for(var d=t.unitary=u.clone(u.IDENTITY,t.unitary),h=t.diagonal=u.clone(e,t.diagonal),E=r*s(h);f<a&&c(h)>E;)l(h,m),u.transpose(m,_),u.multiply(h,m,h),u.multiply(_,h,h),u.multiply(d,m,d),++i>2&&(++f,i=0);return t},u.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},u.determinant=function(e){var t=e[0],n=e[3],r=e[6],a=e[1],i=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*o)+a*(s*r-n*c)+u*(n*o-i*r)},u.inverse=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[3],o=e[4],s=e[5],c=e[6],l=e[7],f=e[8],d=u.determinant(e);t[0]=o*f-l*s,t[1]=l*a-r*f,t[2]=r*s-o*a,t[3]=c*s-i*f,t[4]=n*f-c*a,t[5]=i*a-n*s,t[6]=i*l-c*o,t[7]=c*r-n*l,t[8]=n*o-i*r;var h=1/d;return u.multiplyByScalar(t,h,t)},u.equals=function(e,t){return e===t||n(e)&&n(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]},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r},u.IDENTITY=i(new u(1,0,0,0,1,0,0,0,1)),u.ZERO=i(new u(0,0,0,0,0,0,0,0,0)),u.COLUMN0ROW0=0,u.COLUMN0ROW1=1,u.COLUMN0ROW2=2,u.COLUMN1ROW0=3,u.COLUMN1ROW1=4,u.COLUMN1ROW2=5,u.COLUMN2ROW0=6,u.COLUMN2ROW1=7,u.COLUMN2ROW2=8,r(u.prototype,{length:{get:function(){return u.packedLength}}}),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},u}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a){"use strict";function i(t,n,r,a){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0),this.w=e(a,0)}i.fromElements=function(e,n,r,a,o){return t(o)?(o.x=e,o.y=n,o.z=r,o.w=a,o):new i(e,n,r,a)},i.fromColor=function(e,n){return t(n)?(n.x=e.red,n.y=e.green,n.z=e.blue,n.w=e.alpha,n):new i(e.red,e.green,e.blue,e.alpha)},i.clone=function(e,n){if(t(e))return t(n)?(n.x=e.x,n.y=e.y,n.z=e.z,n.w=e.w,n):new i(e.x,e.y,e.z,e.w)},i.packedLength=4,i.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w,n},i.unpack=function(n,r,a){return r=e(r,0),t(a)||(a=new i),a.x=n[r++],a.y=n[r++],a.z=n[r++],a.w=n[r],a},i.packArray=function(e,n){var r=e.length;t(n)?n.length=4*r:n=new Array(4*r);for(var a=0;a<r;++a)i.pack(e[a],n,4*a);return n},i.unpackArray=function(e,n){var r=e.length;t(n)?n.length=r/4:n=new Array(r/4);for(var a=0;a<r;a+=4){var o=a/4;n[o]=i.unpack(e,a,n[o])}return n},i.fromArray=i.unpack,i.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},i.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},i.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},i.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},i.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},i.magnitude=function(e){return Math.sqrt(i.magnitudeSquared(e))};var o=new i;i.distance=function(e,t){return i.subtract(e,t,o),i.magnitude(o)},i.distanceSquared=function(e,t){return i.subtract(e,t,o),i.magnitudeSquared(o)},i.normalize=function(e,t){var n=i.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t},i.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},i.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},i.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},i.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},i.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},i.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},i.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},i.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},i.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 u=new i;i.lerp=function(e,t,n,r){return i.multiplyByScalar(t,n,u),r=i.multiplyByScalar(e,1-n,r),i.add(u,r,r)};var s=new i;return i.mostOrthogonalAxis=function(e,t){var n=i.normalize(e,s);return i.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?i.clone(i.UNIT_X,t):i.clone(i.UNIT_W,t):n.z<=n.w?i.clone(i.UNIT_Z,t):i.clone(i.UNIT_W,t):n.y<=n.z?n.y<=n.w?i.clone(i.UNIT_Y,t):i.clone(i.UNIT_W,t):n.z<=n.w?i.clone(i.UNIT_Z,t):i.clone(i.UNIT_W,t); -},i.equals=function(e,n){return e===n||t(e)&&t(n)&&e.x===n.x&&e.y===n.y&&e.z===n.z&&e.w===n.w},i.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},i.equalsEpsilon=function(e,n,r,i){return e===n||t(e)&&t(n)&&a.equalsEpsilon(e.x,n.x,r,i)&&a.equalsEpsilon(e.y,n.y,r,i)&&a.equalsEpsilon(e.z,n.z,r,i)&&a.equalsEpsilon(e.w,n.w,r,i)},i.ZERO=r(new i(0,0,0,0)),i.UNIT_X=r(new i(1,0,0,0)),i.UNIT_Y=r(new i(0,1,0,0)),i.UNIT_Z=r(new i(0,0,1,0)),i.UNIT_W=r(new i(0,0,0,1)),i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i.prototype.equalsEpsilon=function(e,t,n){return i.equalsEpsilon(this,e,t,n)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},i}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t,r,a,i,o,u,s,c,l,f,d,h,E,m,_){this[0]=n(e,0),this[1]=n(i,0),this[2]=n(c,0),this[3]=n(h,0),this[4]=n(t,0),this[5]=n(o,0),this[6]=n(l,0),this[7]=n(E,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(f,0),this[11]=n(m,0),this[12]=n(a,0),this[13]=n(s,0),this[14]=n(d,0),this[15]=n(_,0)}l.packedLength=16,l.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t[r++]=e[9],t[r++]=e[10],t[r++]=e[11],t[r++]=e[12],t[r++]=e[13],t[r++]=e[14],t[r]=e[15],t},l.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new l),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a[9]=e[t++],a[10]=e[t++],a[11]=e[t++],a[12]=e[t++],a[13]=e[t++],a[14]=e[t++],a[15]=e[t],a},l.clone=function(e,t){if(r(e))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):new l(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])},l.fromArray=l.unpack,l.fromColumnMajorArray=function(e,t){return l.clone(e,t)},l.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 l(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])},l.fromRotationTranslation=function(t,a,i){return a=n(a,e.ZERO),r(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=a.x,i[13]=a.y,i[14]=a.z,i[15]=1,i):new l(t[0],t[3],t[6],a.x,t[1],t[4],t[7],a.y,t[2],t[5],t[8],a.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(e,t,n,a){r(a)||(a=new l);var i=n.x,o=n.y,u=n.z,s=t.x*t.x,c=t.x*t.y,f=t.x*t.z,d=t.x*t.w,h=t.y*t.y,E=t.y*t.z,m=t.y*t.w,_=t.z*t.z,p=t.z*t.w,y=t.w*t.w,T=s-h-_+y,R=2*(c-p),A=2*(f+m),S=2*(c+p),N=-s+h-_+y,M=2*(E-d),I=2*(f-m),g=2*(E+d),O=-s-h+_+y;return a[0]=T*i,a[1]=S*i,a[2]=I*i,a[3]=0,a[4]=R*o,a[5]=N*o,a[6]=g*o,a[7]=0,a[8]=A*u,a[9]=M*u,a[10]=O*u,a[11]=0,a[12]=e.x,a[13]=e.y,a[14]=e.z,a[15]=1,a},l.fromTranslationRotationScale=function(e,t){return l.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},l.fromTranslation=function(e,t){return l.fromRotationTranslation(s.IDENTITY,e,t)},l.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 l(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},l.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 l(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var f=new e,d=new e,h=new e;l.fromCamera=function(t,n){var a=t.position,i=t.direction,o=t.up;e.normalize(i,f),e.normalize(e.cross(f,o,d),d),e.normalize(e.cross(d,f,h),h);var u=d.x,s=d.y,c=d.z,E=f.x,m=f.y,_=f.z,p=h.x,y=h.y,T=h.z,R=a.x,A=a.y,S=a.z,N=u*-R+s*-A+c*-S,M=p*-R+y*-A+T*-S,I=E*R+m*A+_*S;return r(n)?(n[0]=u,n[1]=p,n[2]=-E,n[3]=0,n[4]=s,n[5]=y,n[6]=-m,n[7]=0,n[8]=c,n[9]=T,n[10]=-_,n[11]=0,n[12]=N,n[13]=M,n[14]=I,n[15]=1,n):new l(u,s,c,N,p,y,T,M,-E,-m,-_,I,0,0,0,1)},l.computePerspectiveFieldOfView=function(e,t,n,r,a){var i=Math.tan(.5*e),o=1/i,u=o/t,s=(r+n)/(n-r),c=2*r*n/(n-r);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=c,a[15]=0,a},l.computeOrthographicOffCenter=function(e,t,n,r,a,i,o){var u=1/(t-e),s=1/(r-n),c=1/(i-a),l=-(t+e)*u,f=-(r+n)*s,d=-(i+a)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=f,o[14]=d,o[15]=1,o},l.computePerspectiveOffCenter=function(e,t,n,r,a,i,o){var u=2*a/(t-e),s=2*a/(r-n),c=(t+e)/(t-e),l=(r+n)/(r-n),f=-(i+a)/(i-a),d=-1,h=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=f,o[11]=d,o[12]=0,o[13]=0,o[14]=h,o[15]=0,o},l.computeInfinitePerspectiveOffCenter=function(e,t,n,r,a,i){var o=2*a/(t-e),u=2*a/(r-n),s=(t+e)/(t-e),c=(r+n)/(r-n),l=-1,f=-1,d=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=s,i[9]=c,i[10]=l,i[11]=f,i[12]=0,i[13]=0,i[14]=d,i[15]=0,i},l.computeViewportTransformation=function(e,t,r,a){e=n(e,n.EMPTY_OBJECT);var i=n(e.x,0),o=n(e.y,0),u=n(e.width,0),s=n(e.height,0);t=n(t,0),r=n(r,1);var c=.5*u,l=.5*s,f=.5*(r-t),d=c,h=l,E=f,m=i+c,_=o+l,p=t+f,y=1;return a[0]=d,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=h,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=E,a[11]=0,a[12]=m,a[13]=_,a[14]=p,a[15]=y,a},l.computeView=function(t,n,r,a,i){return i[0]=a.x,i[1]=r.x,i[2]=-n.x,i[3]=0,i[4]=a.y,i[5]=r.y,i[6]=-n.y,i[7]=0,i[8]=a.z,i[9]=r.z,i[10]=-n.z,i[11]=0,i[12]=-e.dot(a,t),i[13]=-e.dot(r,t),i[14]=e.dot(n,t),i[15]=1,i},l.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]]},l.getElementIndex=function(e,t){return 4*e+t},l.getColumn=function(e,t,n){var r=4*t,a=e[r],i=e[r+1],o=e[r+2],u=e[r+3];return n.x=a,n.y=i,n.z=o,n.w=u,n},l.setColumn=function(e,t,n,r){r=l.clone(e,r);var a=4*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r[a+3]=n.w,r},l.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},l.getRow=function(e,t,n){var r=e[t],a=e[t+4],i=e[t+8],o=e[t+12];return n.x=r,n.y=a,n.z=i,n.w=o,n},l.setRow=function(e,t,n,r){return r=l.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var E=new e;l.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],E)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],E)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],E)),n};var m=new e;l.getMaximumScale=function(t){return l.getScale(t,m),e.maximumComponent(m)},l.multiply=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],f=e[8],d=e[9],h=e[10],E=e[11],m=e[12],_=e[13],p=e[14],y=e[15],T=t[0],R=t[1],A=t[2],S=t[3],N=t[4],M=t[5],I=t[6],g=t[7],O=t[8],v=t[9],x=t[10],w=t[11],C=t[12],P=t[13],U=t[14],D=t[15],L=r*T+u*R+f*A+m*S,F=a*T+s*R+d*A+_*S,z=i*T+c*R+h*A+p*S,B=o*T+l*R+E*A+y*S,b=r*N+u*M+f*I+m*g,q=a*N+s*M+d*I+_*g,G=i*N+c*M+h*I+p*g,W=o*N+l*M+E*I+y*g,V=r*O+u*v+f*x+m*w,X=a*O+s*v+d*x+_*w,H=i*O+c*v+h*x+p*w,Y=o*O+l*v+E*x+y*w,j=r*C+u*P+f*U+m*D,k=a*C+s*P+d*U+_*D,Z=i*C+c*P+h*U+p*D,K=o*C+l*P+E*U+y*D;return n[0]=L,n[1]=F,n[2]=z,n[3]=B,n[4]=b,n[5]=q,n[6]=G,n[7]=W,n[8]=V,n[9]=X,n[10]=H,n[11]=Y,n[12]=j,n[13]=k,n[14]=Z,n[15]=K,n},l.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},l.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},l.multiplyTransformation=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],d=e[12],h=e[13],E=e[14],m=t[0],_=t[1],p=t[2],y=t[4],T=t[5],R=t[6],A=t[8],S=t[9],N=t[10],M=t[12],I=t[13],g=t[14],O=r*m+o*_+c*p,v=a*m+u*_+l*p,x=i*m+s*_+f*p,w=r*y+o*T+c*R,C=a*y+u*T+l*R,P=i*y+s*T+f*R,U=r*A+o*S+c*N,D=a*A+u*S+l*N,L=i*A+s*S+f*N,F=r*M+o*I+c*g+d,z=a*M+u*I+l*g+h,B=i*M+s*I+f*g+E;return n[0]=O,n[1]=v,n[2]=x,n[3]=0,n[4]=w,n[5]=C,n[6]=P,n[7]=0,n[8]=U,n[9]=D,n[10]=L,n[11]=0,n[12]=F,n[13]=z,n[14]=B,n[15]=1,n},l.multiplyByMatrix3=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],d=t[0],h=t[1],E=t[2],m=t[3],_=t[4],p=t[5],y=t[6],T=t[7],R=t[8],A=r*d+o*h+c*E,S=a*d+u*h+l*E,N=i*d+s*h+f*E,M=r*m+o*_+c*p,I=a*m+u*_+l*p,g=i*m+s*_+f*p,O=r*y+o*T+c*R,v=a*y+u*T+l*R,x=i*y+s*T+f*R;return n[0]=A,n[1]=S,n[2]=N,n[3]=0,n[4]=M,n[5]=I,n[6]=g,n[7]=0,n[8]=O,n[9]=v,n[10]=x,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},l.multiplyByTranslation=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=r*e[0]+a*e[4]+i*e[8]+e[12],u=r*e[1]+a*e[5]+i*e[9]+e[13],s=r*e[2]+a*e[6]+i*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=s,n[15]=e[15],n};var _=new e;l.multiplyByUniformScale=function(e,t,n){return _.x=t,_.y=t,_.z=t,l.multiplyByScale(e,_,n)},l.multiplyByScale=function(e,t,n){var r=t.x,a=t.y,i=t.z;return 1===r&&1===a&&1===i?l.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=a*e[4],n[5]=a*e[5],n[6]=a*e[6],n[7]=0,n[8]=i*e[8],n[9]=i*e[9],n[10]=i*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},l.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=t.w,u=e[0]*r+e[4]*a+e[8]*i+e[12]*o,s=e[1]*r+e[5]*a+e[9]*i+e[13]*o,c=e[2]*r+e[6]*a+e[10]*i+e[14]*o,l=e[3]*r+e[7]*a+e[11]*i+e[15]*o;return n.x=u,n.y=s,n.z=c,n.w=l,n},l.multiplyByPointAsVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i,u=e[1]*r+e[5]*a+e[9]*i,s=e[2]*r+e[6]*a+e[10]*i;return n.x=o,n.y=u,n.z=s,n},l.multiplyByPoint=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i+e[12],u=e[1]*r+e[5]*a+e[9]*i+e[13],s=e[2]*r+e[6]*a+e[10]*i+e[14];return n.x=o,n.y=u,n.z=s,n},l.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},l.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},l.transpose=function(e,t){var n=e[1],r=e[2],a=e[3],i=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=o,t[14]=u,t[15]=e[15],t},l.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},l.equals=function(e,t){return e===t||r(e)&&r(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},l.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},l.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},l.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};var p=new s,y=new s,T=new t,R=new t(0,0,0,1);return l.inverse=function(e,n){if(s.equalsEpsilon(l.getRotation(e,p),y,u.EPSILON7)&&t.equals(l.getRow(e,3,T),R))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],a=e[4],i=e[8],o=e[12],f=e[1],d=e[5],h=e[9],E=e[13],m=e[2],_=e[6],A=e[10],S=e[14],N=e[3],M=e[7],I=e[11],g=e[15],O=A*g,v=S*I,x=_*g,w=S*M,C=_*I,P=A*M,U=m*g,D=S*N,L=m*I,F=A*N,z=m*M,B=_*N,b=O*d+w*h+C*E-(v*d+x*h+P*E),q=v*f+U*h+F*E-(O*f+D*h+L*E),G=x*f+D*d+z*E-(w*f+U*d+B*E),W=P*f+L*d+B*h-(C*f+F*d+z*h),V=v*a+x*i+P*o-(O*a+w*i+C*o),X=O*r+D*i+L*o-(v*r+U*i+F*o),H=w*r+U*a+B*o-(x*r+D*a+z*o),Y=C*r+F*a+z*i-(P*r+L*a+B*i);O=i*E,v=o*h,x=a*E,w=o*d,C=a*h,P=i*d,U=r*E,D=o*f,L=r*h,F=i*f,z=r*d,B=a*f;var j=O*M+w*I+C*g-(v*M+x*I+P*g),k=v*N+U*I+F*g-(O*N+D*I+L*g),Z=x*N+D*M+z*g-(w*N+U*M+B*g),K=P*N+L*M+B*I-(C*N+F*M+z*I),J=x*A+P*S+v*_-(C*S+O*_+w*A),Q=L*S+O*m+D*A-(U*A+F*S+v*m),$=U*_+B*S+w*m-(z*S+x*m+D*_),ee=z*A+C*m+F*_-(L*_+B*A+P*m),te=r*b+a*q+i*G+o*W;if(Math.abs(te)<u.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=b*te,n[1]=q*te,n[2]=G*te,n[3]=W*te,n[4]=V*te,n[5]=X*te,n[6]=H*te,n[7]=Y*te,n[8]=j*te,n[9]=k*te,n[10]=Z*te,n[11]=K*te,n[12]=J*te,n[13]=Q*te,n[14]=$*te,n[15]=ee*te,n},l.inverseTransformation=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],f=e[12],d=e[13],h=e[14],E=-n*f-r*d-a*h,m=-i*f-o*d-u*h,_=-s*f-c*d-l*h;return t[0]=n,t[1]=i,t[2]=s,t[3]=0,t[4]=r,t[5]=o,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=l,t[11]=0,t[12]=E,t[13]=m,t[14]=_,t[15]=1,t},l.IDENTITY=o(new l(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),l.ZERO=o(new l(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN0ROW3=3,l.COLUMN1ROW0=4,l.COLUMN1ROW1=5,l.COLUMN1ROW2=6,l.COLUMN1ROW3=7,l.COLUMN2ROW0=8,l.COLUMN2ROW1=9,l.COLUMN2ROW2=10,l.COLUMN2ROW3=11,l.COLUMN3ROW0=12,l.COLUMN3ROW1=13,l.COLUMN3ROW2=14,l.COLUMN3ROW3=15,a(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.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]+")"},l}),define("Core/Rectangle",["./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,n,r,a){this.west=t(e,0),this.south=t(n,0),this.east=t(r,0),this.north=t(a,0)}r(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,n,r){return r=t(r,0),n[r++]=e.west,n[r++]=e.south,n[r++]=e.east,n[r]=e.north,n},s.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new s),a.west=e[r++],a.south=e[r++],a.east=e[r++],a.north=e[r],a},s.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=u.TWO_PI),t-n},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,r,a,i,o){return e=u.toRadians(t(e,0)),r=u.toRadians(t(r,0)),a=u.toRadians(t(a,0)),i=u.toRadians(t(i,0)),n(o)?(o.west=e,o.south=r,o.east=a,o.north=i,o):new s(e,r,a,i)},s.fromCartographicArray=function(e,t){for(var r=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE,f=0,d=e.length;f<d;f++){var h=e[f];r=Math.min(r,h.longitude),a=Math.max(a,h.longitude),c=Math.min(c,h.latitude),l=Math.max(l,h.latitude);var E=h.longitude>=0?h.longitude:h.longitude+u.TWO_PI;i=Math.min(i,E),o=Math.max(o,E)}return a-r>o-i&&(r=i,a=o,a>u.PI&&(a-=u.TWO_PI),r>u.PI&&(r-=u.TWO_PI)),n(t)?(t.west=r,t.south=c,t.east=a,t.north=l,t):new s(r,c,a,l)},s.fromCartesianArray=function(e,t,r){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=Number.MAX_VALUE,f=-Number.MAX_VALUE,d=0,h=e.length;d<h;d++){var E=t.cartesianToCartographic(e[d]);a=Math.min(a,E.longitude),i=Math.max(i,E.longitude),l=Math.min(l,E.latitude),f=Math.max(f,E.latitude);var m=E.longitude>=0?E.longitude:E.longitude+u.TWO_PI;o=Math.min(o,m),c=Math.max(c,m)}return i-a>c-o&&(a=o,i=c,i>u.PI&&(i-=u.TWO_PI),a>u.PI&&(a-=u.TWO_PI)),n(r)?(r.west=a,r.south=l,r.east=i,r.north=f,r):new s(a,l,i,f)},s.clone=function(e,t){if(n(e))return n(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,t){return e===t||n(e)&&n(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},s.prototype.equalsEpsilon=function(e,t){return n(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},s.validate=function(e){},s.southwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.south,r.height=0,r):new e(t.west,t.south)},s.northwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.north,r.height=0,r):new e(t.west,t.north)},s.northeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.north,r.height=0,r):new e(t.east,t.north)},s.southeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.south,r.height=0,r):new e(t.east,t.south)},s.center=function(t,r){var a=t.east,i=t.west;a<i&&(a+=u.TWO_PI);var o=u.negativePiToPi(.5*(i+a)),s=.5*(t.south+t.north);return n(r)?(r.longitude=o,r.latitude=s,r.height=0,r):new e(o,s)},s.intersection=function(e,t,r){var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.negativePiToPi(Math.max(i,c)),f=u.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&f<=l)){var d=Math.max(e.south,t.south),h=Math.min(e.north,t.north);if(!(d>=h))return n(r)?(r.west=l,r.south=d,r.east=f,r.north=h,r):new s(l,d,f,h)}},s.simpleIntersection=function(e,t,r){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(i>=u||a>=o))return n(r)?(r.west=a,r.south=i,r.east=o,r.north=u,r):new s(a,i,o,u)},s.union=function(e,t,r){n(r)||(r=new s);var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.convertLongitudeRange(Math.min(i,c)),f=u.convertLongitudeRange(Math.max(a,o));return r.west=l,r.south=Math.min(e.south,t.south),r.east=f,r.north=Math.max(e.north,t.north),r},s.expand=function(e,t,r){return n(r)||(r=new s),r.west=Math.min(e.west,t.longitude),r.south=Math.min(e.south,t.latitude),r.east=Math.max(e.east,t.longitude),r.north=Math.max(e.north,t.latitude),r},s.contains=function(e,t){var n=t.longitude,r=t.latitude,a=e.west,i=e.east;return i<a&&(i+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>a||u.equalsEpsilon(n,a,u.EPSILON14))&&(n<i||u.equalsEpsilon(n,i,u.EPSILON14))&&r>=e.south&&r<=e.north};var c=new e;return s.subsample=function(e,r,a,o){r=t(r,i.WGS84),a=t(a,0),n(o)||(o=[]);var l=0,f=e.north,d=e.south,h=e.east,E=e.west,m=c;m.height=a,m.longitude=E,m.latitude=f,o[l]=r.cartographicToCartesian(m,o[l]),l++,m.longitude=h,o[l]=r.cartographicToCartesian(m,o[l]),l++,m.latitude=d,o[l]=r.cartographicToCartesian(m,o[l]),l++,m.longitude=E,o[l]=r.cartographicToCartesian(m,o[l]),l++,f<0?m.latitude=f:d>0?m.latitude=d:m.latitude=0;for(var _=1;_<8;++_)m.longitude=-Math.PI+_*u.PI_OVER_TWO,s.contains(e,m)&&(o[l]=r.cartographicToCartesian(m,o[l]),l++);return 0===m.latitude&&(m.longitude=E,o[l]=r.cartographicToCartesian(m,o[l]),l++,m.longitude=h,o[l]=r.cartographicToCartesian(m,o[l]),l++),o.length=l,o},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function d(t,r){this.center=e.clone(n(t,e.ZERO)),this.radius=n(r,0)}var h=new e,E=new e,m=new e,_=new e,p=new e,y=new e,T=new e,R=new e,A=new e,S=new e,N=new e,M=new e;d.fromPoints=function(t,n){if(r(n)||(n=new d),!r(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var a=e.clone(t[0],T),i=e.clone(a,h),o=e.clone(a,E),u=e.clone(a,m),s=e.clone(a,_),c=e.clone(a,p),l=e.clone(a,y),f=t.length,I=1;I<f;I++){e.clone(t[I],a);var g=a.x,O=a.y,v=a.z;g<i.x&&e.clone(a,i),g>s.x&&e.clone(a,s),O<o.y&&e.clone(a,o),O>c.y&&e.clone(a,c),v<u.z&&e.clone(a,u),v>l.z&&e.clone(a,l)}var x=e.magnitudeSquared(e.subtract(s,i,R)),w=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=i,U=s,D=x;w>D&&(D=w,P=o,U=c),C>D&&(D=C,P=u,U=l);var L=A;L.x=.5*(P.x+U.x),L.y=.5*(P.y+U.y),L.z=.5*(P.z+U.z);var F=e.magnitudeSquared(e.subtract(U,L,R)),z=Math.sqrt(F),B=S;B.x=i.x,B.y=o.y,B.z=u.z;var b=N;b.x=s.x,b.y=c.y,b.z=l.z;var q=e.multiplyByScalar(e.add(B,b,R),.5,M),G=0;for(I=0;I<f;I++){e.clone(t[I],a);var W=e.magnitude(e.subtract(a,q,R));W>G&&(G=W);var V=e.magnitudeSquared(e.subtract(a,L,R));if(V>F){var X=Math.sqrt(V);z=.5*(z+X),F=z*z;var H=X-z;L.x=(z*L.x+H*a.x)/X,L.y=(z*L.y+H*a.y)/X,L.z=(z*L.z+H*a.z)/X}}return z<G?(e.clone(L,n.center),n.radius=z):(e.clone(q,n.center),n.radius=G),n};var I=new o,g=new e,O=new e,v=new t,x=new t;d.fromRectangle2D=function(e,t,n){return d.fromRectangleWithHeights2D(e,t,0,0,n)},d.fromRectangleWithHeights2D=function(t,a,i,o,u){if(r(u)||(u=new d),!r(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;a=n(a,I),f.southwest(t,v),v.height=i,f.northeast(t,x),x.height=o;var s=a.project(v,g),c=a.project(x,O),l=c.x-s.x,h=c.y-s.y,E=c.z-s.z;u.radius=.5*Math.sqrt(l*l+h*h+E*E);var m=u.center;return m.x=s.x+.5*l,m.y=s.y+.5*h,m.z=s.z+.5*E,u};var w=[];d.fromRectangle3D=function(e,t,a,o){t=n(t,i.WGS84),a=n(a,0);var u;return r(e)&&(u=f.subsample(e,t,a,w)),d.fromPoints(u,o)},d.fromVertices=function(t,a,i,o){if(r(o)||(o=new d),!r(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;a=n(a,e.ZERO),i=n(i,3);var u=T;u.x=t[0]+a.x,u.y=t[1]+a.y,u.z=t[2]+a.z;for(var s=e.clone(u,h),c=e.clone(u,E),l=e.clone(u,m),f=e.clone(u,_),I=e.clone(u,p),g=e.clone(u,y),O=t.length,v=0;v<O;v+=i){var x=t[v]+a.x,w=t[v+1]+a.y,C=t[v+2]+a.z;u.x=x,u.y=w,u.z=C,x<s.x&&e.clone(u,s),x>f.x&&e.clone(u,f),w<c.y&&e.clone(u,c),w>I.y&&e.clone(u,I),C<l.z&&e.clone(u,l),C>g.z&&e.clone(u,g)}var P=e.magnitudeSquared(e.subtract(f,s,R)),U=e.magnitudeSquared(e.subtract(I,c,R)),D=e.magnitudeSquared(e.subtract(g,l,R)),L=s,F=f,z=P;U>z&&(z=U,L=c,F=I),D>z&&(z=D,L=l,F=g);var B=A;B.x=.5*(L.x+F.x),B.y=.5*(L.y+F.y),B.z=.5*(L.z+F.z);var b=e.magnitudeSquared(e.subtract(F,B,R)),q=Math.sqrt(b),G=S;G.x=s.x,G.y=c.y,G.z=l.z;var W=N;W.x=f.x,W.y=I.y,W.z=g.z;var V=e.multiplyByScalar(e.add(G,W,R),.5,M),X=0;for(v=0;v<O;v+=i){u.x=t[v]+a.x,u.y=t[v+1]+a.y,u.z=t[v+2]+a.z;var H=e.magnitude(e.subtract(u,V,R));H>X&&(X=H);var Y=e.magnitudeSquared(e.subtract(u,B,R));if(Y>b){var j=Math.sqrt(Y);q=.5*(q+j),b=q*q;var k=j-q;B.x=(q*B.x+k*u.x)/j,B.y=(q*B.y+k*u.y)/j,B.z=(q*B.z+k*u.z)/j}}return q<X?(e.clone(B,o.center),o.radius=q):(e.clone(V,o.center),o.radius=X),o},d.fromEncodedCartesianVertices=function(t,n,a){if(r(a)||(a=new d),!r(t)||!r(n)||t.length!==n.length||0===t.length)return a.center=e.clone(e.ZERO,a.center),a.radius=0,a;var i=T;i.x=t[0]+n[0],i.y=t[1]+n[1],i.z=t[2]+n[2];for(var o=e.clone(i,h),u=e.clone(i,E),s=e.clone(i,m),c=e.clone(i,_),l=e.clone(i,p),f=e.clone(i,y),I=t.length,g=0;g<I;g+=3){var O=t[g]+n[g],v=t[g+1]+n[g+1],x=t[g+2]+n[g+2];i.x=O,i.y=v,i.z=x,O<o.x&&e.clone(i,o),O>c.x&&e.clone(i,c),v<u.y&&e.clone(i,u),v>l.y&&e.clone(i,l),x<s.z&&e.clone(i,s),x>f.z&&e.clone(i,f)}var w=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=e.magnitudeSquared(e.subtract(f,s,R)),U=o,D=c,L=w;C>L&&(L=C,U=u,D=l),P>L&&(L=P,U=s,D=f);var F=A;F.x=.5*(U.x+D.x),F.y=.5*(U.y+D.y),F.z=.5*(U.z+D.z);var z=e.magnitudeSquared(e.subtract(D,F,R)),B=Math.sqrt(z),b=S;b.x=o.x,b.y=u.y,b.z=s.z;var q=N;q.x=c.x,q.y=l.y,q.z=f.z;var G=e.multiplyByScalar(e.add(b,q,R),.5,M),W=0;for(g=0;g<I;g+=3){i.x=t[g]+n[g],i.y=t[g+1]+n[g+1],i.z=t[g+2]+n[g+2];var V=e.magnitude(e.subtract(i,G,R));V>W&&(W=V);var X=e.magnitudeSquared(e.subtract(i,F,R));if(X>z){var H=Math.sqrt(X);B=.5*(B+H),z=B*B;var Y=H-B;F.x=(B*F.x+Y*i.x)/H,F.y=(B*F.y+Y*i.y)/H,F.z=(B*F.z+Y*i.z)/H}}return B<W?(e.clone(F,a.center),a.radius=B):(e.clone(G,a.center),a.radius=W),a},d.fromCornerPoints=function(t,n,a){r(a)||(a=new d);var i=a.center;return e.add(t,n,i),e.multiplyByScalar(i,.5,i),a.radius=e.distance(i,n),a},d.fromEllipsoid=function(t,n){return r(n)||(n=new d),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var C=new e;d.fromBoundingSpheres=function(t,n){if(r(n)||(n=new d),!r(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var a=t.length;if(1===a)return d.clone(t[0],n);if(2===a)return d.union(t[0],t[1],n);for(var i=[],o=0;o<a;o++)i.push(t[o].center);n=d.fromPoints(i,n);var u=n.center,s=n.radius;for(o=0;o<a;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,C)+c.radius)}return n.radius=s,n};var P=new e,U=new e,D=new e;d.fromOrientedBoundingBox=function(t,n){r(n)||(n=new d);var a=t.halfAxes,i=c.getColumn(a,0,P),o=c.getColumn(a,1,U),u=c.getColumn(a,2,D),s=e.magnitude(i),l=e.magnitude(o),f=e.magnitude(u);return n.center=e.clone(t.center,n.center),n.radius=Math.max(s,l,f),n},d.clone=function(t,n){if(r(t))return r(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new d(t.center,t.radius)},d.packedLength=4,d.pack=function(e,t,r){r=n(r,0);var a=e.center;return t[r++]=a.x,t[r++]=a.y,t[r++]=a.z,t[r]=e.radius,t},d.unpack=function(e,t,a){t=n(t,0),r(a)||(a=new d);var i=a.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],a.radius=e[t],a};var L=new e,F=new e;d.union=function(t,n,a){r(a)||(a=new d);var i=t.center,o=t.radius,u=n.center,s=n.radius,c=e.subtract(u,i,L),l=e.magnitude(c);if(o>=l+s)return t.clone(a),a;if(s>=l+o)return n.clone(a),a;var f=.5*(o+l+s),h=e.multiplyByScalar(c,(-o+f)/l,F);return e.add(h,i,h),e.clone(h,a.center),a.radius=f,a};var z=new e;d.expand=function(t,n,r){r=d.clone(t,r);var a=e.magnitude(e.subtract(n,r.center,z));return a>r.radius&&(r.radius=a),r},d.intersectPlane=function(t,n){var r=t.center,a=t.radius,i=n.normal,o=e.dot(i,r)+n.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},d.transform=function(e,t,n){return r(n)||(n=new d),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=l.getMaximumScale(t)*e.radius,n};var B=new e;d.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,B);return e.magnitudeSquared(r)-t.radius*t.radius},d.transformWithoutScale=function(e,t,n){return r(n)||(n=new d),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var b=new e;d.computePlaneDistances=function(t,n,a,i){r(i)||(i=new s);var o=e.subtract(t.center,n,b),u=e.dot(a,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var q=new e,G=new e,W=new e,V=new e,X=new e,H=new t,Y=new Array(8),j=0;j<8;++j)Y[j]=new e;var k=new o;return d.projectTo2D=function(t,r,a){r=n(r,k);var i=r.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,q),c=e.cross(e.UNIT_Z,s,G);e.normalize(c,c);var l=e.cross(s,c,W);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var f=e.negate(l,X),h=e.negate(c,V),E=Y,m=E[0];e.add(s,l,m),e.add(m,c,m),m=E[1],e.add(s,l,m),e.add(m,h,m),m=E[2],e.add(s,f,m),e.add(m,h,m),m=E[3],e.add(s,f,m),e.add(m,c,m),e.negate(s,s),m=E[4],e.add(s,l,m),e.add(m,c,m),m=E[5],e.add(s,l,m),e.add(m,h,m),m=E[6],e.add(s,f,m),e.add(m,h,m),m=E[7],e.add(s,f,m),e.add(m,c,m);for(var _=E.length,p=0;p<_;++p){var y=E[p];e.add(o,y,y);var T=i.cartesianToCartographic(y,H);r.project(T,y)}a=d.fromPoints(E,a),o=a.center;var R=o.x,A=o.y,S=o.z;return o.x=S,o.y=R,o.z=A,a},d.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},d.equals=function(t,n){return t===n||r(t)&&r(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},d.prototype.intersectPlane=function(e){return d.intersectPlane(this,e)},d.prototype.distanceSquaredTo=function(e){return d.distanceSquaredTo(this,e)},d.prototype.computePlaneDistances=function(e,t,n){return d.computePlaneDistances(this,e,t,n)},d.prototype.isOccluded=function(e){return d.isOccluded(this,e)},d.prototype.equals=function(e){return d.equals(this,e)},d.prototype.clone=function(e){return d.clone(this,e)},d}),define("Core/Cartesian2",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a){"use strict";function i(t,n){this.x=e(t,0),this.y=e(n,0)}i.fromElements=function(e,n,r){return t(r)?(r.x=e,r.y=n,r):new i(e,n)},i.clone=function(e,n){if(t(e))return t(n)?(n.x=e.x,n.y=e.y,n):new i(e.x,e.y)},i.fromCartesian3=i.clone,i.fromCartesian4=i.clone,i.packedLength=2,i.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r]=t.y,n},i.unpack=function(n,r,a){return r=e(r,0),t(a)||(a=new i),a.x=n[r++],a.y=n[r],a},i.packArray=function(e,n){var r=e.length;t(n)?n.length=2*r:n=new Array(2*r);for(var a=0;a<r;++a)i.pack(e[a],n,2*a);return n},i.unpackArray=function(e,n){var r=e.length;t(n)?n.length=r/2:n=new Array(r/2);for(var a=0;a<r;a+=2){var o=a/2;n[o]=i.unpack(e,a,n[o])}return n},i.fromArray=i.unpack,i.maximumComponent=function(e){return Math.max(e.x,e.y)},i.minimumComponent=function(e){return Math.min(e.x,e.y)},i.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},i.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},i.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},i.magnitude=function(e){return Math.sqrt(i.magnitudeSquared(e))};var o=new i;i.distance=function(e,t){return i.subtract(e,t,o),i.magnitude(o)},i.distanceSquared=function(e,t){return i.subtract(e,t,o),i.magnitudeSquared(o)},i.normalize=function(e,t){var n=i.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t},i.dot=function(e,t){return e.x*t.x+e.y*t.y},i.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n},i.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n},i.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n},i.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n},i.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n},i.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n},i.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},i.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var u=new i;i.lerp=function(e,t,n,r){ -return i.multiplyByScalar(t,n,u),r=i.multiplyByScalar(e,1-n,r),i.add(u,r,r)};var s=new i,c=new i;i.angleBetween=function(e,t){return i.normalize(e,s),i.normalize(t,c),a.acosClamped(i.dot(s,c))};var l=new i;return i.mostOrthogonalAxis=function(e,t){var n=i.normalize(e,l);return i.abs(n,n),t=n.x<=n.y?i.clone(i.UNIT_X,t):i.clone(i.UNIT_Y,t)},i.equals=function(e,n){return e===n||t(e)&&t(n)&&e.x===n.x&&e.y===n.y},i.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},i.equalsEpsilon=function(e,n,r,i){return e===n||t(e)&&t(n)&&a.equalsEpsilon(e.x,n.x,r,i)&&a.equalsEpsilon(e.y,n.y,r,i)},i.ZERO=r(new i(0,0)),i.UNIT_X=r(new i(1,0)),i.UNIT_Y=r(new i(0,1)),i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i.prototype.equalsEpsilon=function(e,t,n){return i.equalsEpsilon(this,e,t,n)},i.prototype.toString=function(){return"("+this.x+", "+this.y+")"},i}),define("Core/EllipsoidalOccluder",["./BoundingSphere","./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./Rectangle"],function(e,t,n,r,a,i,o){"use strict";function u(e,n){this._ellipsoid=e,this._cameraPosition=new t,this._cameraPositionInScaledSpace=new t,this._distanceToLimbInScaledSpaceSquared=0,r(n)&&(this.cameraPosition=n)}function s(e,n,r){var a=e.transformPositionToScaledSpace(n,E),i=t.magnitudeSquared(a),o=Math.sqrt(i),u=t.divideByScalar(a,o,m);i=Math.max(1,i),o=Math.max(1,o);var s=t.dot(u,r),c=t.magnitude(t.cross(u,r,u)),l=1/o,f=Math.sqrt(i-1)*l;return 1/(s*l-c*f)}function c(e,n,r){if(!(n<=0||n===1/0||n!==n))return t.multiplyByScalar(e,n,r)}function l(e,n){return t.equals(n,t.ZERO)?n:(e.transformPositionToScaledSpace(n,_),t.normalize(_,_))}a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(e){var n=this._ellipsoid,r=n.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),a=t.magnitudeSquared(r)-1;t.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=r,this._distanceToLimbInScaledSpaceSquared=a}}});var f=new t;u.prototype.isPointVisible=function(e){var t=this._ellipsoid,n=t.transformPositionToScaledSpace(e,f);return this.isScaledSpacePointVisible(n)},u.prototype.isScaledSpacePointVisible=function(e){var n=this._cameraPositionInScaledSpace,r=this._distanceToLimbInScaledSpaceSquared,a=t.subtract(e,n,f),i=-t.dot(a,n),o=r<0?i>0:i>r&&i*i/t.magnitudeSquared(a)>r;return!o},u.prototype.computeHorizonCullingPoint=function(e,n,a){r(a)||(a=new t);for(var i=this._ellipsoid,o=l(i,e),u=0,f=0,d=n.length;f<d;++f){var h=n[f],E=s(i,h,o);u=Math.max(u,E)}return c(o,u,a)};var d=new t;u.prototype.computeHorizonCullingPointFromVertices=function(e,a,i,o,u){r(u)||(u=new t),o=n(o,t.ZERO);for(var f=this._ellipsoid,h=l(f,e),E=0,m=0,_=a.length;m<_;m+=i){d.x=a[m]+o.x,d.y=a[m+1]+o.y,d.z=a[m+2]+o.z;var p=s(f,d,h);E=Math.max(E,p)}return c(h,E,u)};var h=[];u.prototype.computeHorizonCullingPointFromRectangle=function(n,r,a){var i=o.subsample(n,r,0,h),u=e.fromPoints(i);if(!(t.magnitude(u.center)<.1*r.minimumRadius))return this.computeHorizonCullingPoint(u.center,i,a)};var E=new t,m=new t,_=new t;return u}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function n(e,n,r){var a=e+n;return t.sign(e)!==t.sign(n)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(n)))<r?0:a}var r={};return r.computeDiscriminant=function(e,t,n){var r=t*t-4*e*n;return r},r.computeRealRoots=function(e,r,a){var i;if(0===e)return 0===r?[]:[-a/r];if(0===r){if(0===a)return[0,0];var o=Math.abs(a),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,i<0)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-r/e,i<0?[i,0]:[0,i];var c=r*r,l=4*e*a,f=n(c,-l,t.EPSILON14);if(f<0)return[];var d=-.5*n(r,t.sign(r)*Math.sqrt(f),t.EPSILON14);return r>0?[d/e,a/d]:[a/d,d/e]},r}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function n(e,t,n,r){var a,i,o=e,u=t/3,s=n/3,c=r,l=o*s,f=u*c,d=u*u,h=s*s,E=o*s-d,m=o*c-u*s,_=u*c-h,p=4*E*_-m*m;if(p<0){var y,T,R;d*f>=l*h?(y=o,T=E,R=-2*u*E+o*m):(y=c,T=_,R=-c*m+2*s*_);var A=R<0?-1:1,S=-A*Math.abs(y)*Math.sqrt(-p);i=-R+S;var N=i/2,M=N<0?-Math.pow(-N,1/3):Math.pow(N,1/3),I=i===S?-M:-T/M;return a=T<=0?M+I:-R/(M*M+I*I+T),d*f>=l*h?[(a-u)/o]:[-c/(a+s)]}var g=E,O=-2*u*E+o*m,v=_,x=-c*m+2*s*_,w=Math.sqrt(p),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*w,-O)/3);a=2*Math.sqrt(-g);var U=Math.cos(P);i=a*U;var D=a*(-U/2-C*Math.sin(P)),L=i+D>2*u?i-u:D-u,F=o,z=L/F;P=Math.abs(Math.atan2(c*w,-x)/3),a=2*Math.sqrt(-v),U=Math.cos(P),i=a*U,D=a*(-U/2-C*Math.sin(P));var B=-c,b=i+D<2*s?i+s:D+s,q=B/b,G=F*b,W=-L*b-F*B,V=L*B,X=(s*W-u*V)/(-u*W+s*G);return z<=X?z<=q?X<=q?[z,X,q]:[z,q,X]:[q,z,X]:z<=q?[X,z,q]:X<=q?[X,q,z]:[q,X,z]}var r={};return r.computeDiscriminant=function(e,t,n,r){var a=e*e,i=t*t,o=n*n,u=r*r,s=18*e*t*n*r+i*o-27*a*u-4*(e*o*n+i*t*r);return s},r.computeRealRoots=function(e,r,a,i){var o,u;if(0===e)return t.computeRealRoots(r,a,i);if(0===r){if(0===a){if(0===i)return[0,0,0];u=-i/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===i?(o=t.computeRealRoots(e,0,a),0===o.Length?[0]:[o[0],0,o[1]]):n(e,0,a,i)}return 0===a?0===i?(u=-r/e,u<0?[u,0,0]:[0,0,u]):n(e,r,0,i):0===i?(o=t.computeRealRoots(e,r,a),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):n(e,r,a,i)},r}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,n,r){"use strict";function a(t,a,i,o){var u=t*t,s=a-3*u/8,c=i-a*t/2+u*t/8,l=o-i*t/4+a*u/16-3*u*u/256,f=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(f.length>0){var d=-t/4,h=f[f.length-1];if(Math.abs(h)<n.EPSILON14){var E=r.computeRealRoots(1,s,l);if(2===E.length){var m,_=E[0],p=E[1];if(_>=0&&p>=0){var y=Math.sqrt(_),T=Math.sqrt(p);return[d-T,d-y,d+y,d+T]}if(_>=0&&p<0)return m=Math.sqrt(_),[d-m,d+m];if(_<0&&p>=0)return m=Math.sqrt(p),[d-m,d+m]}return[]}if(h>0){var R=Math.sqrt(h),A=(s+h-c/R)/2,S=(s+h+c/R)/2,N=r.computeRealRoots(1,R,A),M=r.computeRealRoots(1,-R,S);return 0!==N.length?(N[0]+=d,N[1]+=d,0!==M.length?(M[0]+=d,M[1]+=d,N[1]<=M[0]?[N[0],N[1],M[0],M[1]]:M[1]<=N[0]?[M[0],M[1],N[0],N[1]]:N[0]>=M[0]&&N[1]<=M[1]?[M[0],N[0],N[1],M[1]]:M[0]>=N[0]&&M[1]<=N[1]?[N[0],M[0],M[1],N[1]]:N[0]>M[0]&&N[0]<M[1]?[M[0],N[0],M[1],N[1]]:[N[0],M[0],N[1],M[1]]):N):0!==M.length?(M[0]+=d,M[1]+=d,M):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,f=i*t+s-4*o,d=c*o-i*a*t+u,h=e.computeRealRoots(1,l,f,d);if(h.length>0){var E,m,_=h[0],p=a-_,y=p*p,T=t/2,R=p/2,A=y-4*o,S=y+4*Math.abs(o),N=c-4*_,M=c+4*Math.abs(_);if(_<0||A*M<N*S){var I=Math.sqrt(N);E=I/2,m=0===I?0:(t*R-i)/I}else{var g=Math.sqrt(A);E=0===g?0:(t*R-i)/g,m=g/2}var O,v;0===T&&0===E?(O=0,v=0):n.sign(T)===n.sign(E)?(O=T+E,v=_/O):(v=T-E,O=_/v);var x,w;0===R&&0===m?(x=0,w=0):n.sign(R)===n.sign(m)?(x=R+m,w=o/x):(w=R-m,x=o/w);var C=r.computeRealRoots(1,O,x),P=r.computeRealRoots(1,v,w);if(0!==C.length)return 0!==P.length?C[1]<=P[0]?[C[0],C[1],P[0],P[1]]:P[1]<=C[0]?[P[0],P[1],C[0],C[1]]:C[0]>=P[0]&&C[1]<=P[1]?[P[0],C[0],C[1],P[1]]:P[0]>=C[0]&&P[1]<=C[1]?[C[0],P[0],P[1],C[1]]:C[0]>P[0]&&C[0]<P[1]?[P[0],C[0],P[1],C[1]]:[C[0],P[0],C[1],P[1]]:C;if(0!==P.length)return P}return[]}var o={};return o.computeDiscriminant=function(e,t,n,r,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=n*n,l=c*n,f=r*r,d=f*r,h=a*a,E=h*a,m=u*c*f-4*s*d-4*e*l*f+18*e*t*n*d-27*i*f*f+256*o*E+a*(18*s*n*r-4*u*l+16*e*c*c-80*e*t*c*r-6*e*u*f+144*i*n*f)+h*(144*e*u*n-27*u*u-128*i*c-192*i*t*r);return m},o.computeRealRoots=function(t,r,o,u,s){if(Math.abs(t)<n.EPSILON15)return e.computeRealRoots(r,o,u,s);var c=r/t,l=o/t,f=u/t,d=s/t,h=c<0?1:0;switch(h+=l<0?h+1:h,h+=f<0?h+1:h,h+=d<0?h+1:h){case 0:return a(c,l,f,d);case 1:return i(c,l,f,d);case 2:return i(c,l,f,d);case 3:return a(c,l,f,d);case 4:return a(c,l,f,d);case 5:return i(c,l,f,d);case 6:return a(c,l,f,d);case 7:return a(c,l,f,d);case 8:return i(c,l,f,d);case 9:return a(c,l,f,d);case 10:return a(c,l,f,d);case 11:return i(c,l,f,d);case 12:return a(c,l,f,d);case 13:return a(c,l,f,d);case 14:return a(c,l,f,d);case 15:return a(c,l,f,d);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=e.clone(t(r,e.ZERO)),e.equals(r,e.ZERO)||e.normalize(r,r),this.origin=e.clone(t(n,e.ZERO)),this.direction=r}return a.getPoint=function(t,r,a){return n(a)||(a=new e),a=e.multiplyByScalar(t.direction,r,a),e.add(t.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t,n,r){var a=t*t-4*e*n;if(!(a<0)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return u<s?(r.root0=u,r.root1=s):(r.root0=s,r.root1=u),r}var c=-t/(2*e);if(0!==c)return r.root0=r.root1=c,r}}function f(t,n,a){r(a)||(a={});var i=t.origin,o=t.direction,u=n.center,s=n.radius*n.radius,c=e.subtract(i,u,p),f=e.dot(o,o),d=2*e.dot(o,c),h=e.magnitudeSquared(c)-s,E=l(f,d,h,A);if(r(E))return a.start=E.root0,a.stop=E.root1,a}function d(e,t,n){var r=e+t;return i.sign(e)!==i.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))<n?0:r}function h(t,n,r,a,c){var l,f=a*a,h=c*c,E=(t[o.COLUMN1ROW1]-t[o.COLUMN2ROW2])*h,m=c*(a*d(t[o.COLUMN1ROW0],t[o.COLUMN0ROW1],i.EPSILON15)+n.y),_=t[o.COLUMN0ROW0]*f+t[o.COLUMN2ROW2]*h+a*n.x+r,p=h*d(t[o.COLUMN2ROW1],t[o.COLUMN1ROW2],i.EPSILON15),y=c*(a*d(t[o.COLUMN2ROW0],t[o.COLUMN0ROW2])+n.z),T=[];if(0===y&&0===p){if(l=u.computeRealRoots(E,m,_),0===l.length)return T;var R=l[0],A=Math.sqrt(Math.max(1-R*R,0));if(T.push(new e(a,c*R,c*-A)),T.push(new e(a,c*R,c*A)),2===l.length){var S=l[1],N=Math.sqrt(Math.max(1-S*S,0));T.push(new e(a,c*S,c*-N)),T.push(new e(a,c*S,c*N))}return T}var M=y*y,I=p*p,g=E*E,O=y*p,v=g+I,x=2*(m*E+O),w=2*_*E+m*m-I+M,C=2*(_*m-O),P=_*_-M;if(0===v&&0===x&&0===w&&0===C)return T;l=s.computeRealRoots(v,x,w,C,P);var U=l.length;if(0===U)return T;for(var D=0;D<U;++D){var L,F=l[D],z=F*F,B=Math.max(1-z,0),b=Math.sqrt(B);L=i.sign(E)===i.sign(_)?d(E*z+_,m*F,i.EPSILON12):i.sign(_)===i.sign(m*F)?d(E*z,m*F+_,i.EPSILON12):d(E*z+m*F,_,i.EPSILON12);var q=d(p*F,y,i.EPSILON15),G=L*q;G<0?T.push(new e(a,c*F,c*b)):G>0?T.push(new e(a,c*F,c*-b)):0!==b?(T.push(new e(a,c*F,c*-b)),T.push(new e(a,c*F,c*b)),++D):T.push(new e(a,c*F,c*b))}return T}var E={};E.rayPlane=function(t,n,a){r(a)||(a=new e);var o=t.origin,u=t.direction,s=n.normal,c=e.dot(s,u);if(!(Math.abs(c)<i.EPSILON15)){var l=(-n.distance-e.dot(s,o))/c;if(!(l<0))return a=e.multiplyByScalar(u,l,a),e.add(o,a,a)}};var m=new e,_=new e,p=new e,y=new e,T=new e;E.rayTriangleParametric=function(t,r,a,o,u){u=n(u,!1);var s,c,l,f,d,h=t.origin,E=t.direction,R=e.subtract(a,r,m),A=e.subtract(o,r,_),S=e.cross(E,A,p),N=e.dot(R,S);if(u){if(N<i.EPSILON6)return;if(s=e.subtract(h,r,y),l=e.dot(s,S),l<0||l>N)return;if(c=e.cross(s,R,T),f=e.dot(E,c),f<0||l+f>N)return;d=e.dot(A,c)/N}else{if(Math.abs(N)<i.EPSILON6)return;var M=1/N;if(s=e.subtract(h,r,y),l=e.dot(s,S)*M,l<0||l>1)return;if(c=e.cross(s,R,T),f=e.dot(E,c)*M,f<0||l+f>1)return;d=e.dot(A,c)*M}return d},E.rayTriangle=function(t,n,a,i,o,u){var s=E.rayTriangleParametric(t,n,a,i,o);if(r(s)&&!(s<0))return r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var R=new c;E.lineSegmentTriangle=function(t,n,a,i,o,u,s){var c=R;e.clone(t,c.origin),e.subtract(n,t,c.direction),e.normalize(c.direction,c.direction);var l=E.rayTriangleParametric(c,a,i,o,u);if(!(!r(l)||l<0||l>e.distance(t,n)))return r(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var A={root0:0,root1:0};E.raySphere=function(e,t,n){if(n=f(e,t,n),r(n)&&!(n.stop<0))return n.start=Math.max(n.start,0),n};var S=new c;E.lineSegmentSphere=function(t,n,a,i){var o=S;e.clone(t,o.origin);var u=e.subtract(n,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),i=f(o,a,i),!(!r(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var N=new e,M=new e;E.rayEllipsoid=function(t,n){var r,a,i,o,u,s=n.oneOverRadii,c=e.multiplyComponents(s,t.origin,N),l=e.multiplyComponents(s,t.direction,M),f=e.magnitudeSquared(c),d=e.dot(c,l);if(f>1){if(d>=0)return;var h=d*d;if(r=f-1,a=e.magnitudeSquared(l),i=a*r,h<i)return;if(h>i){o=d*d-i,u=-d+Math.sqrt(o);var E=u/a,m=r/u;return E<m?{start:E,stop:m}:{start:m,stop:E}}var _=Math.sqrt(r/a);return{start:_,stop:_}}return f<1?(r=f-1,a=e.magnitudeSquared(l),i=a*r,o=d*d-i,u=-d+Math.sqrt(o),{start:0,stop:u/a}):d<0?(a=e.magnitudeSquared(l),{start:0,stop:-d/a}):void 0};var I=new e,g=new e,O=new e,v=new e,x=new e,w=new o,C=new o,P=new o,U=new o,D=new o,L=new o,F=new o,z=new e,B=new e,b=new t;E.grazingAltitudeLocation=function(t,n){var a=t.origin,u=t.direction;if(!e.equals(a,e.ZERO)){var s=n.geodeticSurfaceNormal(a,I);if(e.dot(u,s)>=0)return a}var c=r(this.rayEllipsoid(t,n)),l=n.transformPositionToScaledSpace(u,I),f=e.normalize(l,l),d=e.mostOrthogonalAxis(l,v),E=e.normalize(e.cross(d,f,g),g),m=e.normalize(e.cross(f,E,O),O),_=w;_[0]=f.x,_[1]=f.y,_[2]=f.z,_[3]=E.x,_[4]=E.y,_[5]=E.z,_[6]=m.x,_[7]=m.y,_[8]=m.z;var p=o.transpose(_,C),y=o.fromScale(n.radii,P),T=o.fromScale(n.oneOverRadii,U),R=D;R[0]=0,R[1]=-u.z,R[2]=u.y,R[3]=u.z,R[4]=0,R[5]=-u.x,R[6]=-u.y,R[7]=u.x,R[8]=0;var A,S,N=o.multiply(o.multiply(p,T,L),R,L),M=o.multiply(o.multiply(N,y,F),_,F),q=o.multiplyByVector(N,a,x),G=h(M,e.negate(q,I),0,0,1),W=G.length;if(W>0){for(var V=e.clone(e.ZERO,B),X=Number.NEGATIVE_INFINITY,H=0;H<W;++H){A=o.multiplyByVector(y,o.multiplyByVector(_,G[H],z),z);var Y=e.normalize(e.subtract(A,a,v),v),j=e.dot(Y,u);j>X&&(X=j,V=e.clone(A,V))}var k=n.cartesianToCartographic(V,b);return X=i.clamp(X,0,1),S=e.magnitude(e.subtract(V,a,v))*Math.sqrt(1-X*X),S=c?-S:S,k.height=S,n.cartographicToCartesian(k,new e)}};var q=new e;return E.lineSegmentPlane=function(t,n,a,o){r(o)||(o=new e);var u=e.subtract(n,t,q),s=a.normal,c=e.dot(s,u);if(!(Math.abs(c)<i.EPSILON6)){var l=e.dot(s,t),f=-(a.distance+l)/c;if(!(f<0||f>1))return e.multiplyByScalar(u,f,o),e.add(t,o,o),o}},E.trianglePlaneIntersection=function(t,n,r,a){var i=a.normal,o=a.distance,u=e.dot(i,t)+o<0,s=e.dot(i,n)+o<0,c=e.dot(i,r)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var f,d;if(1!==l&&2!==l||(f=new e,d=new e),1===l){if(u)return E.lineSegmentPlane(t,n,a,f),E.lineSegmentPlane(t,r,a,d),{positions:[t,n,r,f,d],indices:[0,3,4,1,2,4,1,4,3]};if(s)return E.lineSegmentPlane(n,r,a,f),E.lineSegmentPlane(n,t,a,d),{positions:[t,n,r,f,d],indices:[1,3,4,2,0,4,2,4,3]};if(c)return E.lineSegmentPlane(r,t,a,f),E.lineSegmentPlane(r,n,a,d),{positions:[t,n,r,f,d],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return E.lineSegmentPlane(n,t,a,f),E.lineSegmentPlane(r,t,a,d),{positions:[t,n,r,f,d],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return E.lineSegmentPlane(r,n,a,f),E.lineSegmentPlane(t,n,a,d),{positions:[t,n,r,f,d],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return E.lineSegmentPlane(t,r,a,f),E.lineSegmentPlane(n,r,a,d),{positions:[t,n,r,f,d],indices:[0,1,4,0,4,3,2,3,4]}}},E}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";function a(t,n){this.normal=e.clone(t),this.distance=n}a.fromPointNormal=function(n,r,i){var o=-e.dot(r,n);return t(i)?(e.clone(r,i.normal),i.distance=o,i):new a(r,o)};var i=new e;return a.fromCartesian4=function(n,r){var o=e.fromCartesian4(n,i),u=n.w;return t(r)?(e.clone(o,r.normal),r.distance=u,r):new a(o,u)},a.getPointDistance=function(t,n){return e.dot(t.normal,n)+t.distance},a.ORIGIN_XY_PLANE=r(new a(e.UNIT_Z,0)),a.ORIGIN_YZ_PLANE=r(new a(e.UNIT_X,0)),a.ORIGIN_ZX_PLANE=r(new a(e.UNIT_Y,0)),a}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,n,r,a){return t(e).then(n,r,a)}function t(e){var t,n;return e instanceof r?t=e:u(e)?(n=o(),e.then(function(e){n.resolve(e)},function(e){n.reject(e)},function(e){n.progress(e)}),t=n.promise):t=a(e),t}function n(t){return e(t,i)}function r(e){this.then=e}function a(e){var n=new r(function(n){try{return t(n?n(e):e)}catch(e){return i(e)}});return n}function i(e){var n=new r(function(n,r){try{return r?t(r(e)):i(e)}catch(e){return i(e)}});return n}function o(){function e(e,t,n){return d(e,t,n)}function n(e){return E(e)}function a(e){return E(i(e))}function u(e){return h(e)}var s,c,l,f,d,h,E;return c=new r(e),s={then:e,resolve:n,reject:a,progress:u,promise:c,resolver:{resolve:n,reject:a,progress:u}},l=[],f=[],d=function(e,t,n){var r,a;return r=o(),a="function"==typeof n?function(e){try{r.progress(n(e))}catch(e){r.progress(e)}}:function(e){r.progress(e)},l.push(function(n){n.then(e,t).then(r.resolve,r.reject,a)}),f.push(a),r.promise},h=function(e){return m(f,e),e},E=function(e){return e=t(e),d=e.then,E=t,h=p,m(l,e),f=l=A,e},s}function u(e){return e&&"function"==typeof e.then}function s(t,n,r,a,i){return _(2,arguments),e(t,function(t){function u(e){m(e)}function s(e){E(e)}var c,l,f,d,h,E,m,_,y,T;if(y=t.length>>>0,c=Math.max(0,Math.min(n,y)),f=[],l=y-c+1,d=[],h=o(),c)for(_=h.progress,m=function(e){d.push(e),--l||(E=m=p,h.reject(d))},E=function(e){f.push(e),--c||(E=m=p,h.resolve(f))},T=0;T<y;++T)T in t&&e(t[T],s,u,_);else h.resolve(f);return h.then(r,a,i)})}function c(e,t,n,r){function a(e){return t?t(e[0]):e[0]}return s(e,1,a,n,r)}function l(e,t,n,r){return _(1,arguments),d(e,y).then(t,n,r)}function f(){return d(arguments,y)}function d(t,n){return e(t,function(t){var r,a,i,u,s,c;if(i=a=t.length>>>0,r=[],c=o(),i)for(u=function(t,a){e(t,n).then(function(e){r[a]=e,--i||c.resolve(r)},c.reject)},s=0;s<a;s++)s in t?u(t[s],s):--i;else c.resolve(r);return c.promise})}function h(t,n){var r=R.call(arguments,1);return e(t,function(t){var a;return a=t.length,r[0]=function(t,r,i){return e(t,function(t){return e(r,function(e){return n(t,e,i,a)})})},T.apply(t,r)})}function E(t,n,r){var a=arguments.length>2;return e(t,function(e){return e=a?r:e,n.resolve(e),e},function(e){return n.reject(e),i(e)},n.progress)}function m(e,t){for(var n,r=0;n=e[r++];)n(t)}function _(e,t){for(var n,r=t.length;r>e;)if(n=t[--r],null!=n&&"function"!=typeof n)throw new Error("arg "+r+" must be a function")}function p(){}function y(e){return e}var T,R,A;return e.defer=o,e.resolve=t,e.reject=n,e.join=f,e.all=l,e.map=d,e.reduce=h,e.any=c,e.some=s,e.chain=E,e.isPromise=u,r.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(A,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return l(t,function(t){return e.apply(A,t)})})}},R=[].slice,T=[].reduce||function(e){var t,n,r,a,i;if(i=0,t=Object(this),a=t.length>>>0,n=arguments,n.length<=1)for(;;){if(i in t){r=t[i++];break}if(++i>=a)throw new TypeError}else r=n[1];for(;i<a;++i)i in t&&(r=e(r,t[i],i,t));return r},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n,r){t(a[n])||(a[n]=!0,console.log(e(r,n)))}var a={};return r.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.",r}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,n){"use strict";function r(e,t){n(e,t)}return r}),define("Core/binarySearch",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e,t,n){for(var r,a,i=0,o=e.length-1;i<=o;)if(r=~~((i+o)/2),a=n(e[r],t),a<0)i=r+1;else{if(!(a>0))return r;o=r-1}return~(o+1)}return n}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,n,r,a){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=r,this.ut1MinusUtc=a}return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,n=0,r=t[n++],a=function(e,t,n,r){n||(n=" ");var a=e.length>=t?"":Array(1+t-e.length>>>0).join(n);return r?e+a:a+e},i=function(e,t,n,r,i,o){var u=r-e.length;return u>0&&(e=n||!i?a(e,r,o,n):e.slice(0,t.length)+a("",u,"0",!0)+e.slice(t.length)),e},o=function(e,t,n,r,o,u,s){var c=e>>>0;return n=n&&c&&{2:"0b",8:"0",16:"0x"}[t]||"",e=n+a(c.toString(t),u||0,"0",!1),i(e,n,r,o,s)},u=function(e,t,n,r,a,o){return null!=r&&(e=e.slice(0,r)),i(e,"",t,n,a,o)},s=function(e,r,s,c,l,f,d){var h,E,m,_,p;if("%%"==e)return"%";for(var y=!1,T="",R=!1,A=!1,S=" ",N=s.length,M=0;s&&M<N;M++)switch(s.charAt(M)){case" ":T=" ";break;case"+":T="+";break;case"-":y=!0;break;case"'":S=s.charAt(M+1);break;case"0":R=!0;break;case"#":A=!0}if(c=c?"*"==c?+t[n++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,c<0&&(c=-c,y=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(f=f?"*"==f?+t[n++]:"*"==f.charAt(0)?+t[f.slice(1,-1)]:+f:"fFeE".indexOf(d)>-1?6:"d"==d?0:void 0,p=r?t[r.slice(0,-1)]:t[n++],d){case"s":return u(String(p),y,c,f,R,S);case"c":return u(String.fromCharCode(+p),y,c,f,R);case"b":return o(p,2,A,y,c,f,R);case"o":return o(p,8,A,y,c,f,R);case"x":return o(p,16,A,y,c,f,R);case"X":return o(p,16,A,y,c,f,R).toUpperCase();case"u":return o(p,10,A,y,c,f,R);case"i":case"d":return h=+p||0,h=Math.round(h-h%1),E=h<0?"-":T,p=E+a(String(Math.abs(h)),f,"0",!1),i(p,E,y,c,R);case"e":case"E":case"f":case"F":case"g":case"G":return h=+p,E=h<0?"-":T,m=["toExponential","toFixed","toPrecision"]["efg".indexOf(d.toLowerCase())],_=["toString","toUpperCase"]["eEfFgG".indexOf(d)%2],p=E+Math.abs(h)[m](f),i(p,E,y,c,R)[_]();default:return e}};return r.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,n,r,a,i,o,u){this.year=e,this.month=t,this.day=n,this.hour=r,this.minute=a,this.second=i,this.millisecond=o,this.isLeapSecond=u}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e(t)}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t){return m.compare(e.julianDate,t.julianDate)}function f(e){T.julianDate=e;var n=m.leapSeconds,r=t(n,T,l);r<0&&(r=~r),r>=n.length&&(r=n.length-1);var a=n[r].offset;if(r>0){var i=m.secondsDifference(n[r].julianDate,e);i>a&&(r--,a=n[r].offset)}m.addSeconds(e,a,e)}function d(e,n){T.julianDate=e;var r=m.leapSeconds,a=t(r,T,l);if(a<0&&(a=~a),0===a)return m.addSeconds(e,-r[0].offset,n);if(a>=r.length)return m.addSeconds(e,-r[a-1].offset,n);var i=m.secondsDifference(r[a].julianDate,e);return 0===i?m.addSeconds(e,-r[a].offset,n):i<=1?void 0:m.addSeconds(e,-r[--a].offset,n)}function h(e,t,n){var r=t/s.SECONDS_PER_DAY|0;return e+=r,t-=s.SECONDS_PER_DAY*r,t<0&&(e--,t+=s.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function E(e,t,n,r,a,i,o){var u=(t-14)/12|0,c=e+4800+u,l=(1461*c/4|0)+(367*(t-2-12*u)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;r-=12,r<0&&(r+=24);var f=i+(r*s.SECONDS_PER_HOUR+a*s.SECONDS_PER_MINUTE+o*s.SECONDS_PER_MILLISECOND);return f>=43200&&(l-=1),[l,f]}function m(e,t,r){this.dayNumber=void 0,this.secondsOfDay=void 0,e=n(e,0),t=n(t,0),r=n(r,c.UTC);var a=0|e;t+=(e-a)*s.SECONDS_PER_DAY,h(a,t,this),r===c.UTC&&f(this)}var _=new i,p=[31,28,31,30,31,30,31,31,30,31,30,31],y=29,T=new u,R=/^(\d{4})$/,A=/^(\d{4})-(\d{2})$/,S=/^(\d{4})-?(\d{3})$/,N=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,M=/^(\d{4})-?(\d{2})-?(\d{2})$/,I=/([Z+\-])?(\d{2})?:?(\d{2})?$/,g=/^(\d{2})(\.\d+)?/.source+I.source,O=/^(\d{2}):?(\d{2})(\.\d+)?/.source+I.source,v=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+I.source;m.fromDate=function(e,t){var n=E(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r(t)?(h(n[0],n[1],t),f(t),t):new m(n[0],n[1],c.UTC)},m.fromIso8601=function(e,t){e=e.replace(",",".");var n,a,i,u=e.split("T"),s=1,l=1,d=0,_=0,T=0,I=0,x=u[0],w=u[1];if(u=x.match(M),null!==u)n=+u[1],s=+u[2],l=+u[3];else if(u=x.match(A),null!==u)n=+u[1],s=+u[2];else if(u=x.match(R),null!==u)n=+u[1];else{var C;if(u=x.match(S),null!==u)n=+u[1],C=+u[2],i=o(n);else if(u=x.match(N),null!==u){n=+u[1];var P=+u[2],U=+u[3]||0,D=new Date(Date.UTC(n,0,4));C=7*P+U-D.getUTCDay()-3}a=new Date(Date.UTC(n,0,1)),a.setUTCDate(C),s=a.getUTCMonth()+1,l=a.getUTCDate()}i=o(n);var L;if(r(w)){u=w.match(v),null!==u?(d=+u[1],_=+u[2],T=+u[3],I=1e3*+(u[4]||0),L=5):(u=w.match(O),null!==u?(d=+u[1],_=+u[2],T=60*+(u[3]||0),L=4):(u=w.match(g),null!==u&&(d=+u[1],_=60*+(u[2]||0),L=3)));var F=u[L],z=+u[L+1],B=+(u[L+2]||0);switch(F){case"+":d-=z,_-=B;break;case"-":d+=z,_+=B;break;case"Z":break;default:_+=new Date(Date.UTC(n,s-1,l,d,_)).getTimezoneOffset()}}else _+=new Date(n,s-1,l).getTimezoneOffset();var b=60===T;for(b&&T--;_>=60;)_-=60,d++;for(;d>=24;)d-=24,l++;for(a=i&&2===s?y:p[s-1];l>a;)l-=a,s++,s>12&&(s-=12,n++),a=i&&2===s?y:p[s-1];for(;_<0;)_+=60,d--;for(;d<0;)d+=24,l--;for(;l<1;)s--,s<1&&(s+=12,n--),a=i&&2===s?y:p[s-1],l+=a;var q=E(n,s,l,d,_,T,I);return r(t)?(h(q[0],q[1],t),f(t)):t=new m(q[0],q[1],c.UTC),b&&m.addSeconds(t,1,t),t},m.now=function(e){return m.fromDate(new Date,e)};var x=new m(0,0,c.TAI);return m.toGregorianDate=function(e,t){var n=!1,a=d(e,x);r(a)||(m.addSeconds(e,-1,x),a=d(x,x),n=!0);var o=a.dayNumber,u=a.secondsOfDay;u>=43200&&(o+=1);var c=o+68569|0,l=4*c/146097|0;c=c-((146097*l+3)/4|0)|0;var f=4e3*(c+1)/1461001|0;c=c-(1461*f/4|0)+31|0;var h=80*c/2447|0,E=c-(2447*h/80|0)|0;c=h/11|0;var _=h+2-12*c|0,p=100*(l-49)+f+c|0,y=u/s.SECONDS_PER_HOUR|0,T=u-y*s.SECONDS_PER_HOUR,R=T/s.SECONDS_PER_MINUTE|0;T-=R*s.SECONDS_PER_MINUTE;var A=0|T,S=(T-A)/s.SECONDS_PER_MILLISECOND;return y+=12,y>23&&(y-=24),n&&(A+=1),r(t)?(t.year=p,t.month=_,t.day=E,t.hour=y,t.minute=R,t.second=A,t.millisecond=S,t.isLeapSecond=n,t):new i(p,_,E,y,R,A,S,n)},m.toDate=function(e){var t=m.toGregorianDate(e,_),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))},m.toIso8601=function(t,n){var a,i=m.toGregorianDate(t,i);return r(n)||0===i.millisecond?r(n)&&0!==n?(a=(.01*i.millisecond).toFixed(n).replace(".","").slice(0,n),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",i.year,i.month,i.day,i.hour,i.minute,i.second):(a=(.01*i.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a))},m.clone=function(e,t){if(r(e))return r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new m(e.dayNumber,e.secondsOfDay,c.TAI)},m.compare=function(e,t){var n=e.dayNumber-t.dayNumber;return 0!==n?n:e.secondsOfDay-t.secondsOfDay},m.equals=function(e,t){return e===t||r(e)&&r(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},m.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(m.secondsDifference(e,t))<=n},m.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},m.secondsDifference=function(e,t){var n=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return n+(e.secondsOfDay-t.secondsOfDay)},m.daysDifference=function(e,t){var n=e.dayNumber-t.dayNumber,r=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return n+r},m.computeTaiMinusUtc=function(e){T.julianDate=e;var n=m.leapSeconds,r=t(n,T,l);return r<0&&(r=~r,--r,r<0&&(r=0)),n[r].offset},m.addSeconds=function(e,t,n){return h(e.dayNumber,e.secondsOfDay+t,n)},m.addMinutes=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return h(e.dayNumber,r,n)},m.addHours=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return h(e.dayNumber,r,n)},m.addDays=function(e,t,n){var r=e.dayNumber+t;return h(r,e.secondsOfDay,n)},m.lessThan=function(e,t){return m.compare(e,t)<0},m.lessThanOrEquals=function(e,t){return m.compare(e,t)<=0},m.greaterThan=function(e,t){return m.compare(e,t)>0},m.greaterThanOrEquals=function(e,t){return m.compare(e,t)>=0},m.prototype.clone=function(e){return m.clone(this,e)},m.prototype.equals=function(e){return m.equals(this,e)},m.prototype.equalsEpsilon=function(e,t){return m.equalsEpsilon(this,e,t)},m.prototype.toString=function(){return m.toIso8601(this)},m.leapSeconds=[new u(new m(2441317,43210,c.TAI),10),new u(new m(2441499,43211,c.TAI),11),new u(new m(2441683,43212,c.TAI),12),new u(new m(2442048,43213,c.TAI),13),new u(new m(2442413,43214,c.TAI),14),new u(new m(2442778,43215,c.TAI),15),new u(new m(2443144,43216,c.TAI),16),new u(new m(2443509,43217,c.TAI),17),new u(new m(2443874,43218,c.TAI),18),new u(new m(2444239,43219,c.TAI),19),new u(new m(2444786,43220,c.TAI),20),new u(new m(2445151,43221,c.TAI),21),new u(new m(2445516,43222,c.TAI),22),new u(new m(2446247,43223,c.TAI),23),new u(new m(2447161,43224,c.TAI),24),new u(new m(2447892,43225,c.TAI),25),new u(new m(2448257,43226,c.TAI),26),new u(new m(2448804,43227,c.TAI),27),new u(new m(2449169,43228,c.TAI),28),new u(new m(2449534,43229,c.TAI),29),new u(new m(2450083,43230,c.TAI),30),new u(new m(2450630,43231,c.TAI),31),new u(new m(2451179,43232,c.TAI),32),new u(new m(2453736,43233,c.TAI),33),new u(new m(2454832,43234,c.TAI),34),new u(new m(2456109,43235,c.TAI),35),new u(new m(2457204,43236,c.TAI),36),new u(new m(2457754,43237,c.TAI),37)],m}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(n,r){if(null===n||"object"!=typeof n)return n;r=e(r,!1);var a=new n.constructor;for(var i in n)if(n.hasOwnProperty(i)){var o=n[i];r&&(o=t(o,r)),a[i]=o}return a}return t}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var n=e.split("\r\n"),r=0;r<n.length;++r){var a=n[r],i=a.indexOf(": ");if(i>0){var o=a.substring(0,i),u=a.substring(i+2);t[o]=u}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function n(e,n,r){this.statusCode=e,this.response=n,this.responseHeaders=r,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return n.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},n}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var n=r.exec(t);this.scheme=n[1],this.authority=n[2],this.path=n[3],this.query=n[4],this.fragment=n[5]}}function t(e){var t=unescape(e);return i.test(t)?t:e.toUpperCase()}function n(e,t,n,r){return(t||"")+n.toLowerCase()+(r||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var r=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query; -},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(o,n).replace(a,t)),this.path&&(this.path=this.path.replace(a,t)),this.query&&(this.query=this.query.replace(a,t)),this.fragment&&(this.fragment=this.fragment.replace(a,t))};var a=/%[0-9a-z]{2}/gi,i=/[a-zA-Z0-9\-\._~]/,o=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var n=new e;return this.scheme?(n.scheme=this.scheme,n.authority=this.authority,n.path=this.path,n.query=this.query):(n.scheme=t.scheme,this.authority?(n.authority=this.authority,n.path=this.path,n.query=this.query):(n.authority=t.authority,""==this.path?(n.path=t.path,n.query=this.query||t.query):("/"==this.path.charAt(0)?(n.path=this.path,n.removeDotSegments()):(t.authority&&""==t.path?n.path="/"+this.path:n.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,n.removeDotSegments()),n.query=this.query))),n.fragment=this.fragment,n},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),n=[],r=""==t[0];r&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?n.pop():"."!=e&&n.push(e);"."!=e&&".."!=e||n.push(""),r&&n.unshift(""),this.path=n.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n){var r=new e(n);r.normalize();var a=r.getAuthority();if(t(a)){if(a.indexOf("@")!==-1){var i=a.split("@");a=i[1]}if(a.indexOf(":")===-1){var o=r.getScheme();if(t(o)||(o=window.location.protocol,o=o.substring(0,o.length-1)),"http"===o)a+=":80";else{if("https"!==o)return;a+=":443"}}return a}}var a={},i={};return a.add=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])||(i[r]=!0)},a.remove=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])&&delete i[r]},a.contains=function(e){var n=r(e);return!(!t(n)||!t(i[n]))},a.clear=function(){i={}},a}),define("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,n,r,a,i,o){"use strict";function u(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,a=t(n.method,"GET"),i=n.data,o=n.headers,s=n.overrideMimeType;return e(n.url,function(t){var n=e.defer();return u.load(t,r,a,i,o,n,s),n.promise})}function s(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function c(e,t){for(var n=s(e,t),r=new ArrayBuffer(n.length),a=new Uint8Array(r),i=0;i<n.length;i++)a[i]=n.charCodeAt(i);return r}function l(e,n){n=t(n,"");var r=e[1],a=!!e[2],i=e[3];switch(n){case"":case"text":return s(a,i);case"arraybuffer":return c(a,i);case"blob":var o=c(a,i);return new Blob([o],{type:r});case"document":var u=new DOMParser;return u.parseFromString(s(a,i),r);case"json":return JSON.parse(s(a,i))}}var f=/^data:(.*?)(;base64)?,(.*)$/;return u.load=function(e,t,r,u,s,c,d){var h=f.exec(e);if(null!==h)return void c.resolve(l(h,t));var E=new XMLHttpRequest;if(o.contains(e)&&(E.withCredentials=!0),n(d)&&n(E.overrideMimeType)&&E.overrideMimeType(d),E.open(r,e,!0),n(s))for(var m in s)s.hasOwnProperty(m)&&E.setRequestHeader(m,s[m]);n(t)&&(E.responseType=t),E.onload=function(){if(E.status<200||E.status>=300)return void c.reject(new a(E.status,E.response,E.getAllResponseHeaders()));var e=E.response,r=E.responseType;if(!n(e)||n(t)&&r!==t)if("json"===t&&"string"==typeof e)try{c.resolve(JSON.parse(e))}catch(e){c.reject(e)}else(""===r||"document"===r)&&n(E.responseXML)&&E.responseXML.hasChildNodes()?c.resolve(E.responseXML):""!==r&&"text"!==r||!n(E.responseText)?c.reject(new i("Invalid XMLHttpRequest response type.")):c.resolve(E.responseText);else c.resolve(e)},E.onerror=function(e){c.reject(new a)},E.send(u)},u.defaultLoad=u.load,u}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,n){return e({url:t,headers:n})}return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";function a(n,a){return t(a)?t(a.Accept)||(a=e(a),a.Accept=i.Accept):a=i,r(n,a).then(function(e){return JSON.parse(e)})}var i={Accept:"application/json,*/*;q=0.01"};return a}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function d(t){if(t=n(t,n.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=n(t.addNewLeapSeconds,!0),r(t.data))E(this,t.data);else if(r(t.url)){var a=this;this._downloadPromise=e(s(t.url),function(e){E(a,e)},function(){a._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else E(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function h(e,t){return o.compare(e.julianDate,t)}function E(e,n){if(!r(n.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!r(n.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var a=n.columnNames.indexOf("modifiedJulianDateUtc"),i=n.columnNames.indexOf("xPoleWanderRadians"),s=n.columnNames.indexOf("yPoleWanderRadians"),c=n.columnNames.indexOf("ut1MinusUtcSeconds"),d=n.columnNames.indexOf("xCelestialPoleOffsetRadians"),E=n.columnNames.indexOf("yCelestialPoleOffsetRadians"),m=n.columnNames.indexOf("taiMinusUtcSeconds");if(a<0||i<0||s<0||c<0||d<0||E<0||m<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var _=e._samples=n.samples,p=e._dates=[];e._dateColumn=a,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=d,e._yCelestialPoleOffsetRadiansColumn=E,e._taiMinusUtcSecondsColumn=m,e._columnCount=n.columnNames.length,e._lastIndex=void 0;for(var y,T=e._addNewLeapSeconds,R=0,A=_.length;R<A;R+=e._columnCount){var S=_[R+a],N=_[R+m],M=S+l.MODIFIED_JULIAN_DATE_DIFFERENCE,I=new o(M,N,f.TAI);if(p.push(I),T){if(N!==y&&r(y)){var g=o.leapSeconds,O=t(g,I,h);if(O<0){var v=new u(I,N);g.splice(~O,0,v)}}y=N}}}function m(e,t,n,r,a){var i=n*r;a.xPoleWander=t[i+e._xPoleWanderRadiansColumn],a.yPoleWander=t[i+e._yPoleWanderRadiansColumn],a.xPoleOffset=t[i+e._xCelestialPoleOffsetRadiansColumn],a.yPoleOffset=t[i+e._yCelestialPoleOffsetRadiansColumn],a.ut1MinusUtc=t[i+e._ut1MinusUtcSecondsColumn]}function _(e,t,n){return t+e*(n-t)}function p(e,t,n,r,a,i,u){var s=e._columnCount;if(i>t.length-1)return u.xPoleWander=0,u.yPoleWander=0,u.xPoleOffset=0,u.yPoleOffset=0,u.ut1MinusUtc=0,u;var c=t[a],l=t[i];if(c.equals(l)||r.equals(c))return m(e,n,a,s,u),u;if(r.equals(l))return m(e,n,i,s,u),u;var f=o.secondsDifference(r,c)/o.secondsDifference(l,c),d=a*s,h=i*s,E=n[d+e._ut1MinusUtcSecondsColumn],p=n[h+e._ut1MinusUtcSecondsColumn],y=p-E;if(y>.5||y<-.5){var T=n[d+e._taiMinusUtcSecondsColumn],R=n[h+e._taiMinusUtcSecondsColumn];T!==R&&(l.equals(r)?E=p:p-=R-T)}return u.xPoleWander=_(f,n[d+e._xPoleWanderRadiansColumn],n[h+e._xPoleWanderRadiansColumn]),u.yPoleWander=_(f,n[d+e._yPoleWanderRadiansColumn],n[h+e._yPoleWanderRadiansColumn]),u.xPoleOffset=_(f,n[d+e._xCelestialPoleOffsetRadiansColumn],n[h+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=_(f,n[d+e._yCelestialPoleOffsetRadiansColumn],n[h+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=_(f,E,p),u}return d.NONE=i({getPromiseToLoad:function(){return e()},compute:function(e,t){return r(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new a(0,0,0,0,0),t}}),d.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},d.prototype.compute=function(e,n){if(r(this._samples)){if(r(n)||(n=new a(0,0,0,0,0)),0===this._samples.length)return n.xPoleWander=0,n.yPoleWander=0,n.xPoleOffset=0,n.yPoleOffset=0,n.ut1MinusUtc=0,n;var i=this._dates,u=this._lastIndex,s=0,l=0;if(r(u)){var f=i[u],d=i[u+1],h=o.lessThanOrEquals(f,e),E=!r(d),m=E||o.greaterThanOrEquals(d,e);if(h&&m)return s=u,!E&&d.equals(e)&&++s,l=s+1,p(this,i,this._samples,e,s,l,n),n}var _=t(i,e,o.compare,this._dateColumn);return _>=0?(_<i.length-1&&i[_+1].equals(e)&&++_,s=_,l=_):(l=~_,s=l-1,s<0&&(s=0)),this._lastIndex=s,p(this,i,this._samples,e,s,l,n),n}if(r(this._dataError))throw new c(this._dataError)},d}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(t,n,r){this.heading=e(t,0),this.pitch=e(n,0),this.roll=e(r,0)}return a.fromQuaternion=function(e,n){t(n)||(n=new a);var r=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return n.heading=-Math.atan2(s,u),n.roll=Math.atan2(o,i),n.pitch=-Math.asin(r),n},a.fromDegrees=function(e,n,i,o){return t(o)||(o=new a),o.heading=e*r.RADIANS_PER_DEGREE,o.pitch=n*r.RADIANS_PER_DEGREE,o.roll=i*r.RADIANS_PER_DEGREE,o},a.clone=function(e,n){if(t(e))return t(n)?(n.heading=e.heading,n.pitch=e.pitch,n.roll=e.roll,n):new a(e.heading,e.pitch,e.roll)},a.equals=function(e,n){return e===n||t(e)&&t(n)&&e.heading===n.heading&&e.pitch===n.pitch&&e.roll===n.roll},a.equalsEpsilon=function(e,n,a,i){return e===n||t(e)&&t(n)&&r.equalsEpsilon(e.heading,n.heading,a,i)&&r.equalsEpsilon(e.pitch,n.pitch,a,i)&&r.equalsEpsilon(e.roll,n.roll,a,i)},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,n){return a.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},a}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=t(r,document.location.href);var a=new e(r),i=new e(n);return i.resolve(a).toString()}return a}),define("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(r,a,i){i=t(i,!0),r instanceof e||(r=new e(r)),a instanceof e||(a=new e(a)),n(a.authority)&&!n(a.scheme)&&("undefined"!=typeof document&&n(document.location)&&n(document.location.href)?a.scheme=new e(document.location.href).scheme:a.scheme=r.scheme);var o=r;a.isAbsolute()&&(o=a);var u="";n(o.scheme)&&(u+=o.scheme+":"),n(o.authority)&&(u+="//"+o.authority,""!==o.path&&"/"!==o.path&&(u=u.replace(/\/?$/,"/"),o.path=o.path.replace(/^\/?/g,""))),u+=o===r?i?r.path.replace(/\/?$/,"/")+a.path.replace(/^\/?/g,""):r.path+a.path:a.path;var s=n(r.query),c=n(a.query);s&&c?u+="?"+r.query+"&"+a.query:s&&!c?u+="?"+r.query:!s&&c&&(u+="?"+a.query);var l=n(a.fragment);return n(r.fragment)&&!l?u+="#"+r.fragment:l&&(u+="#"+a.fragment),u}return a}),define("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","./joinUrls","require"],function(e,t,n,r,a,i){"use strict";function o(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;t<n;++t){var r=e[t].getAttribute("src"),a=E.exec(r);if(null!==a)return a[1]}}function u(){if(t(f))return f;var n;return n="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:o(),f=new e(r(n))}function s(e){return i.toUrl("../"+e)}function c(e){return a(u(),e)}function l(e){t(d)||(d=t(i.toUrl)?s:c),t(h)||(h=document.createElement("a"));var n=d(e);return h.href=n,h.href=h.href,h.href}var f,d,h,E=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return l._cesiumScriptRegex=E,l.setBaseUrl=function(t){f=new e(t).resolve(new e(document.location.href))},l}),define("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,n){this.x=e,this.y=t,this.s=n}return e}),define("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){e=n(e,n.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=n(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=n(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new i(this._sampleZeroJulianEphemerisDate,0,u.TAI),this._stepSizeDays=n(e.stepSizeDays,1),this._samplesPerXysFile=n(e.samplesPerXysFile,1e3),this._totalSamples=n(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,r=this._denominators=new Array(t+1),a=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t),s=0;s<=t;++s){r[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;c<=t;++c)c!==s&&(r[s]*=s-c);r[s]=1/r[s]}this._work=new Array(t+1),this._coef=new Array(t+1)}function c(e,t,n){var r=f;return r.dayNumber=t,r.secondsOfDay=n,i.daysDifference(r,e._sampleZeroDateTT)}function l(n,a){if(n._chunkDownloadsInProgress[a])return n._chunkDownloadsInProgress[a];var i=e.defer();n._chunkDownloadsInProgress[a]=i;var u,s=n._xysFileUrlTemplate;return u=r(s)?s.replace("{0}",a):t("Assets/IAU2006_XYS/IAU2006_XYS_"+a+".json"),e(o(u),function(e){n._chunkDownloadsInProgress[a]=!1;for(var t=n._samples,r=e.samples,o=a*n._samplesPerXysFile*3,u=0,s=r.length;u<s;++u)t[o+u]=r[u];i.resolve()}),i.promise}var f=new i(0,0,u.TAI);return s.prototype.preload=function(t,n,r,a){var i=c(this,t,n),o=c(this,r,a),u=i/this._stepSizeDays-this._interpolationOrder/2|0;u<0&&(u=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var f=u/this._samplesPerXysFile|0,d=s/this._samplesPerXysFile|0,h=[],E=f;E<=d;++E)h.push(l(this,E));return e.all(h)},s.prototype.computeXysRadians=function(e,t,n){var i=c(this,e,t);if(!(i<0)){var o=i/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);s<0&&(s=0);var f=s+u;f>=this._totalSamples&&(f=this._totalSamples-1,s=f-u,s<0&&(s=0));var d=!1,h=this._samples;if(r(h[3*s])||(l(this,s/this._samplesPerXysFile|0),d=!0),r(h[3*f])||(l(this,f/this._samplesPerXysFile|0),d=!0),!d){r(n)?(n.x=0,n.y=0,n.s=0):n=new a(0,0,0);var E,m,_=i-s*this._stepSizeDays,p=this._work,y=this._denominators,T=this._coef,R=this._xTable;for(E=0;E<=u;++E)p[E]=_-R[E];for(E=0;E<=u;++E){for(T[E]=1,m=0;m<=u;++m)m!==E&&(T[E]*=p[m]);T[E]*=y[E];var A=3*(s+E);n.x+=T[E]*h[A++],n.y+=T[E]*h[A++],n.s+=T[E]*h[A]}return n}}}},s}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return t(a,{element:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(r.requestFullscreen=a,n=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(r.requestFullscreen=a,n=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?r.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(r.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?r.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(r.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?r.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(r.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),r.fullscreenerror=a)}return n},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[r.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function a(){if(!t(A)&&(A=!1,!d())){var e=/ Chrome\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(A=!0,S=r(e[1]))}return A}function i(){return a()&&S}function o(){if(!t(N)&&(N=!1,!a()&&!d()&&/ Safari\/[\.0-9]+/.test(R.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(N=!0,M=r(e[1]))}return N}function u(){return o()&&M}function s(){if(!t(I)){I=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(R.userAgent);null!==e&&(I=!0,g=r(e[1]),g.isNightly=!!e[2])}return I}function c(){return s()&&g}function l(){if(!t(O)){O=!1;var e;"Microsoft Internet Explorer"===R.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(O=!0,v=r(e[1]))):"Netscape"===R.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(O=!0,v=r(e[1])))}return O}function f(){return l()&&v}function d(){if(!t(x)){x=!1;var e=/ Edge\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(x=!0,w=r(e[1]))}return x}function h(){return d()&&w}function E(){if(!t(C)){C=!1;var e=/Firefox\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(C=!0,P=r(e[1]))}return C}function m(){return t(U)||(U=/Windows/i.test(R.appVersion)),U}function _(){return E()&&P}function p(){return t(D)||(D="undefined"!=typeof PointerEvent&&(!t(R.pointerEnabled)||R.pointerEnabled)),D}function y(){if(!t(F)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;F=t(n)&&""!==n,F&&(L=n)}return F}function T(){return y()?L:void 0}var R;R="undefined"!=typeof navigator?navigator:{};var A,S,N,M,I,g,O,v,x,w,C,P,U,D,L,F,z={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isEdge:d,edgeVersion:h,isFirefox:E,firefoxVersion:_,isWindows:m,hardwareConcurrency:e(R.hardwareConcurrency,3),supportsPointerEvents:p,supportsImageRenderingPixelated:y,imageRenderingValue:T};return z.supportsFullscreen=function(){return n.supportsFullscreen()},z.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},z.supportsWebWorkers=function(){return"undefined"!=typeof Worker},z}),define("Core/Quaternion",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math","./Matrix3"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,n,r,a){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(a,0)}var c=new e;s.fromAxisAngle=function(t,r,a){var i=r/2,o=Math.sin(i);c=e.normalize(t,c);var u=c.x*o,l=c.y*o,f=c.z*o,d=Math.cos(i);return n(a)?(a.x=u,a.y=l,a.z=f,a.w=d,a):new s(u,l,f,d)};var l=[1,2,0],f=new Array(3);s.fromRotationMatrix=function(e,t){var r,a,i,o,c,d=e[u.COLUMN0ROW0],h=e[u.COLUMN1ROW1],E=e[u.COLUMN2ROW2],m=d+h+E;if(m>0)r=Math.sqrt(m+1),c=.5*r,r=.5/r,a=(e[u.COLUMN1ROW2]-e[u.COLUMN2ROW1])*r,i=(e[u.COLUMN2ROW0]-e[u.COLUMN0ROW2])*r,o=(e[u.COLUMN0ROW1]-e[u.COLUMN1ROW0])*r;else{var _=l,p=0;h>d&&(p=1),E>d&&E>h&&(p=2);var y=_[p],T=_[y];r=Math.sqrt(e[u.getElementIndex(p,p)]-e[u.getElementIndex(y,y)]-e[u.getElementIndex(T,T)]+1);var R=f;R[p]=.5*r,r=.5/r,c=(e[u.getElementIndex(T,y)]-e[u.getElementIndex(y,T)])*r,R[y]=(e[u.getElementIndex(y,p)]+e[u.getElementIndex(p,y)])*r,R[T]=(e[u.getElementIndex(T,p)]+e[u.getElementIndex(p,T)])*r,a=-R[0],i=-R[1],o=-R[2]}return n(t)?(t.x=a,t.y=i,t.z=o,t.w=c,t):new s(a,i,o,c)};var d=new s;s.fromHeadingPitchRoll=function(t,n,r,a){var i=s.fromAxisAngle(e.UNIT_X,r,d),o=s.fromAxisAngle(e.UNIT_Y,-n,a);a=s.multiply(o,i,o);var u=s.fromAxisAngle(e.UNIT_Z,-t,d);return s.multiply(u,a,a)};var h=new e,E=new e,m=new s,_=new s,p=new s;s.packedLength=4,s.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},s.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new s),a.x=e[r],a.y=e[r+1],a.z=e[r+2],a.w=e[r+3],a},s.packedInterpolationLength=3,s.convertPackedArrayForInterpolation=function(e,t,n,r){s.unpack(e,4*n,p),s.conjugate(p,p);for(var a=0,i=n-t+1;a<i;a++){var o=3*a;s.unpack(e,4*(t+a),m),s.multiply(m,p,m),m.w<0&&s.negate(m,m),s.computeAxis(m,h);var u=s.computeAngle(m);r[o]=h.x*u,r[o+1]=h.y*u,r[o+2]=h.z*u}},s.unpackInterpolationResult=function(t,r,a,i,o){n(o)||(o=new s),e.fromArray(t,0,E);var u=e.magnitude(E);return s.unpack(r,4*i,_),0===u?s.clone(s.IDENTITY,m):s.fromAxisAngle(E,u,m),s.multiply(m,_,o)},s.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new s(e.x,e.y,e.z,e.w)},s.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},s.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},s.magnitude=function(e){return Math.sqrt(s.magnitudeSquared(e))},s.normalize=function(e,t){var n=1/s.magnitude(e),r=e.x*n,a=e.y*n,i=e.z*n,o=e.w*n;return t.x=r,t.y=a,t.z=i,t.w=o,t},s.inverse=function(e,t){var n=s.magnitudeSquared(e);return t=s.conjugate(e,t),s.multiplyByScalar(t,1/n,t)},s.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},s.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},s.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},s.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},s.multiply=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=e.w,u=t.x,s=t.y,c=t.z,l=t.w,f=o*u+r*l+a*c-i*s,d=o*s-r*c+a*l+i*u,h=o*c+r*s-a*u+i*l,E=o*l-r*u-a*s-i*c;return n.x=f,n.y=d,n.z=h,n.w=E,n},s.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},s.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},s.computeAxis=function(e,t){var n=e.w;if(Math.abs(n-1)<o.EPSILON6)return t.x=t.y=t.z=0,t;var r=1/Math.sqrt(1-n*n);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},s.computeAngle=function(e){return Math.abs(e.w-1)<o.EPSILON6?0:2*Math.acos(e.w)};var y=new s;s.lerp=function(e,t,n,r){return y=s.multiplyByScalar(t,n,y),r=s.multiplyByScalar(e,1-n,r),s.add(y,r,r)};var T=new s,R=new s,A=new s;s.slerp=function(e,t,n,r){var a=s.dot(e,t),i=t;if(a<0&&(a=-a,i=T=s.negate(t,T)),1-a<o.EPSILON6)return s.lerp(e,i,n,r);var u=Math.acos(a);return R=s.multiplyByScalar(e,Math.sin((1-n)*u),R),A=s.multiplyByScalar(i,Math.sin(n*u),A),r=s.add(R,A,r),s.multiplyByScalar(r,1/Math.sin(u),r)},s.log=function(t,n){var r=o.acosClamped(t.w),a=0;return 0!==r&&(a=r/Math.sin(r)),e.multiplyByScalar(t,a,n)},s.exp=function(t,n){var r=e.magnitude(t),a=0;return 0!==r&&(a=Math.sin(r)/r),n.x=t.x*a,n.y=t.y*a,n.z=t.z*a,n.w=Math.cos(r),n};var S=new e,N=new e,M=new s,I=new s;s.computeInnerQuadrangle=function(t,n,r,a){var i=s.conjugate(n,M);s.multiply(i,r,I);var o=s.log(I,S);s.multiply(i,t,I);var u=s.log(I,N);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),s.exp(o,M),s.multiply(n,M,a)},s.squad=function(e,t,n,r,a,i){var o=s.slerp(e,t,a,M),u=s.slerp(n,r,a,I);return s.slerp(o,u,2*a*(1-a),i)};for(var g=new s,O=1.9011074535173003,v=a.supportsTypedArrays()?new Float32Array(8):[],x=a.supportsTypedArrays()?new Float32Array(8):[],w=a.supportsTypedArrays()?new Float32Array(8):[],C=a.supportsTypedArrays()?new Float32Array(8):[],P=0;P<7;++P){var U=P+1,D=2*U+1;v[P]=1/(U*D),x[P]=U/D}return v[7]=O/136,x[7]=8*O/17,s.fastSlerp=function(e,t,n,r){var a,i=s.dot(e,t);i>=0?a=1:(a=-1,i=-i);for(var o=i-1,u=1-n,c=n*n,l=u*u,f=7;f>=0;--f)w[f]=(v[f]*c-x[f])*o,C[f]=(v[f]*l-x[f])*o;var d=a*n*(1+w[0]*(1+w[1]*(1+w[2]*(1+w[3]*(1+w[4]*(1+w[5]*(1+w[6]*(1+w[7])))))))),h=u*(1+C[0]*(1+C[1]*(1+C[2]*(1+C[3]*(1+C[4]*(1+C[5]*(1+C[6]*(1+C[7])))))))),E=s.multiplyByScalar(e,h,g);return s.multiplyByScalar(t,d,r),s.add(E,r,r)},s.fastSquad=function(e,t,n,r,a,i){var o=s.fastSlerp(e,t,a,M),u=s.fastSlerp(n,r,a,I);return s.fastSlerp(o,u,2*a*(1-a),i)},s.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},s.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.x-t.x)<=r&&Math.abs(e.y-t.y)<=r&&Math.abs(e.z-t.z)<=r&&Math.abs(e.w-t.w)<=r},s.ZERO=i(new s(0,0,0,0)),s.IDENTITY=i(new s(0,0,0,1)),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.x+", "+this.y+", "+this.z+", "+this.w+")"},s}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./defaultValue","./defined","./deprecationWarning","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./HeadingPitchRoll","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,n,r,a,i,o,u,s,c,l,f,d,h,E,m,_,p,y,T,R){"use strict";var A={},S=new n,N=new n,M=new n;A.eastNorthUpToFixedFrame=function(e,t,r){if(_.equalsEpsilon(e.x,0,_.EPSILON14)&&_.equalsEpsilon(e.y,0,_.EPSILON14)){var a=_.sign(e.z);return o(r)?(r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=-a,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=a,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(0,-a,0,e.x,1,0,0,e.y,0,0,a,e.z,0,0,0,1)}var u=S,s=N,c=M;return t=i(t,f.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,c),o(r)?(r[0]=s.x,r[1]=s.y,r[2]=s.z,r[3]=0,r[4]=c.x,r[5]=c.y,r[6]=c.z,r[7]=0,r[8]=u.x,r[9]=u.y,r[10]=u.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(s.x,c.x,u.x,e.x,s.y,c.y,u.y,e.y,s.z,c.z,u.z,e.z,0,0,0,1)};var I=new n,g=new n,O=new n;A.northEastDownToFixedFrame=function(e,t,r){if(_.equalsEpsilon(e.x,0,_.EPSILON14)&&_.equalsEpsilon(e.y,0,_.EPSILON14)){var a=_.sign(e.z);return o(r)?(r[0]=-a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=-a,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(-a,0,0,e.x,0,1,0,e.y,0,0,-a,e.z,0,0,0,1)}var u=I,s=g,c=O;return t=i(t,f.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,c),o(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=s.x,r[5]=s.y,r[6]=s.z,r[7]=0,r[8]=-u.x,r[9]=-u.y,r[10]=-u.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(c.x,s.x,-u.x,e.x,c.y,s.y,-u.y,e.y,c.z,s.z,-u.z,e.z,0,0,0,1)},A.northUpEastToFixedFrame=function(e,t,r){if(_.equalsEpsilon(e.x,0,_.EPSILON14)&&_.equalsEpsilon(e.y,0,_.EPSILON14)){var a=_.sign(e.z);return o(r)?(r[0]=-a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=a,r[7]=0,r[8]=0,r[9]=1,r[10]=0,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(-a,0,0,e.x,0,0,1,e.y,0,a,0,e.z,0,0,0,1)}var u=S,s=N,c=M;return t=i(t,f.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,c),o(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=u.x,r[5]=u.y,r[6]=u.z,r[7]=0,r[8]=s.x,r[9]=s.y,r[10]=s.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(c.x,u.x,s.x,e.x,c.y,u.y,s.y,e.y,c.z,u.z,s.z,e.z,0,0,0,1)},A.northWestUpToFixedFrame=function(e,t,r){if(_.equalsEpsilon(e.x,0,_.EPSILON14)&&_.equalsEpsilon(e.y,0,_.EPSILON14)){var a=_.sign(e.z);return o(r)?(r[0]=-a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=a,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(-a,0,0,e.x,0,-1,0,e.y,0,0,a,e.z,0,0,0,1)}var u=S,s=N,c=M;return t=i(t,f.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,c),o(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=-s.x,r[5]=-s.y,r[6]=-s.z,r[7]=0,r[8]=u.x,r[9]=u.y,r[10]=u.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(c.x,-s.x,u.x,e.x,c.y,-s.y,u.y,e.y,c.z,-s.z,u.z,e.z,0,0,0,1)};var v=new T,x=new n(1,1,1),w=new y;A.headingPitchRollToFixedFrame=function(e,t,r,a,i,o){var s;"object"==typeof t?(i=r,o=a,s=t.heading,r=t.pitch,a=t.roll):(u("headingPitchRollToFixedFrame","headingPitchRollToFixedFrame with separate heading, pitch, and roll arguments was deprecated in 1.27. It will be removed in 1.30. Use a HeadingPitchRoll object."),s=t);var c=T.fromHeadingPitchRoll(s,r,a,v),l=y.fromTranslationQuaternionRotationScale(n.ZERO,c,x,w);return o=A.eastNorthUpToFixedFrame(e,i,o),y.multiply(o,l,o)};var C=new d,P=new y,U=new p;A.headingPitchRollQuaternion=function(e,t,n,r,a,i){var o;"object"==typeof t?(o=t,a=n,i=r):(u("headingPitchRollQuaternion","headingPitchRollQuaternion with separate heading, pitch, and roll arguments was deprecated in 1.27. It will be removed in 1.30. Use a HeadingPitchRoll object."),C.heading=t,C.pitch=n,C.roll=r,o=C);var s=A.headingPitchRollToFixedFrame(e,o,a,P),c=y.getRotation(s,U);return T.fromRotationMatrix(c,i)};var D=24110.54841,L=8640184.812866,F=.093104,z=-62e-7,B=1.1772758384668e-19,b=72921158553e-15,q=_.TWO_PI/86400,G=new m;A.computeTemeToPseudoFixedMatrix=function(e,t){G=m.addSeconds(e,-m.computeTaiMinusUtc(e),G);var n,r=G.dayNumber,a=G.secondsOfDay,i=r-2451545;n=a>=43200?(i+.5)/R.DAYS_PER_JULIAN_CENTURY:(i-.5)/R.DAYS_PER_JULIAN_CENTURY;var u=D+n*(L+n*(F+n*z)),s=u*q%_.TWO_PI,c=b+B*(r-2451545.5),l=(a+.5*R.SECONDS_PER_DAY)%R.SECONDS_PER_DAY,f=s+c*l,d=Math.cos(f),h=Math.sin(f);return o(t)?(t[0]=d,t[1]=-h,t[2]=0,t[3]=h,t[4]=d,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new p(d,h,0,-h,d,0,0,0,1)},A.iau2006XysData=new h,A.earthOrientationParameters=c.NONE;var W=32.184,V=2451545;A.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+W,a=t.stop.dayNumber,i=t.stop.secondsOfDay+W,o=A.iau2006XysData.preload(n,r,a,i),u=A.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},A.computeIcrfToFixedMatrix=function(e,t){o(t)||(t=new p);var n=A.computeFixedToIcrfMatrix(e,t);if(o(n))return p.transpose(n,t)};var X=new E(0,0,0),H=new l(0,0,0,0,0,0),Y=new p,j=new p;A.computeFixedToIcrfMatrix=function(e,t){o(t)||(t=new p);var n=A.earthOrientationParameters.compute(e,H);if(o(n)){var r=e.dayNumber,a=e.secondsOfDay+W,i=A.iau2006XysData.computeXysRadians(r,a,X);if(o(i)){var u=i.x+n.xPoleOffset,s=i.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-u*u-s*s)),l=Y;l[0]=1-c*u*u,l[3]=-c*u*s,l[6]=u,l[1]=-c*u*s,l[4]=1-c*s*s,l[7]=s,l[2]=-u,l[5]=-s,l[8]=1-c*(u*u+s*s);var f=p.fromRotationZ(-i.s,j),d=p.multiply(l,f,Y),h=e.dayNumber,E=e.secondsOfDay-m.computeTaiMinusUtc(e)+n.ut1MinusUtc,y=h-2451545,T=E/R.SECONDS_PER_DAY,S=.779057273264+T+.00273781191135448*(y+T);S=S%1*_.TWO_PI;var N=p.fromRotationZ(S,j),M=p.multiply(d,N,Y),I=Math.cos(n.xPoleWander),g=Math.cos(n.yPoleWander),O=Math.sin(n.xPoleWander),v=Math.sin(n.yPoleWander),x=r-V+a/R.SECONDS_PER_DAY;x/=36525;var w=-47e-6*x*_.RADIANS_PER_DEGREE/3600,C=Math.cos(w),P=Math.sin(w),U=j;return U[0]=I*C,U[1]=I*P,U[2]=O,U[3]=-g*P+v*O*C,U[4]=g*C+v*O*P,U[5]=-v*I,U[6]=-v*P-g*O*C,U[7]=v*C-g*O*P,U[8]=g*I,p.multiply(M,U,t)}}};var k=new r;A.pointToWindowCoordinates=function(e,t,n,r){return r=A.pointToGLWindowCoordinates(e,t,n,r), -r.y=2*t[5]-r.y,r},A.pointToGLWindowCoordinates=function(e,n,a,i){o(i)||(i=new t);var u=k;return y.multiplyByVector(e,r.fromElements(a.x,a.y,a.z,1,u),u),r.multiplyByScalar(u,1/u.w,u),y.multiplyByVector(n,u,u),t.fromCartesian4(u,i)};var Z=new n,K=new n,J=new n;A.rotationMatrixFromPositionVelocity=function(e,t,r,a){var u=i(r,f.WGS84).geodeticSurfaceNormal(e,Z),s=n.cross(t,u,K);n.equalsEpsilon(s,n.ZERO,_.EPSILON6)&&(s=n.clone(n.UNIT_X,s));var c=n.cross(s,t,J);return n.cross(t,c,s),n.negate(s,s),o(a)||(a=new p),a[0]=t.x,a[1]=t.y,a[2]=t.z,a[3]=s.x,a[4]=s.y,a[5]=s.z,a[6]=c.x,a[7]=c.y,a[8]=c.z,a};var Q=new a,$=new n,ee=new n,te=new r,ne=new r,re=new r,ae=new r,ie=new r,oe=new y,ue=new y;return A.basisTo2D=function(e,t,a){var i=e.ellipsoid,o=y.getColumn(t,3,te),u=i.cartesianToCartographic(o,Q),s=A.eastNorthUpToFixedFrame(o,i,oe),c=y.inverseTransformation(s,ue),l=e.project(u,$),f=ne;f.x=l.z,f.y=l.x,f.z=l.y,f.w=1;var d=y.getColumn(t,0,ee),h=n.magnitude(d),E=y.multiplyByVector(c,d,re);r.fromElements(E.z,E.x,E.y,0,E);var m=y.getColumn(t,1,ee),_=n.magnitude(m),p=y.multiplyByVector(c,m,ae);r.fromElements(p.z,p.x,p.y,0,p);var T=y.getColumn(t,2,ee),R=n.magnitude(T),S=ie;return n.cross(E,p,S),n.normalize(S,S),n.cross(p,S,E),n.normalize(E,E),n.cross(S,E,p),n.normalize(p,p),n.multiplyByScalar(E,h,E),n.multiplyByScalar(p,_,p),n.multiplyByScalar(S,R,S),y.setColumn(a,0,E,a),y.setColumn(a,1,p,a),y.setColumn(a,2,S,a),y.setColumn(a,3,f,a),a},A}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,f,d,h){"use strict";function E(e,t){t=a(t,s.WGS84),e=t.scaleToGeodeticSurface(e);var r=h.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=n.fromCartesian4(l.getColumn(r,0,m)),this._yAxis=n.fromCartesian4(l.getColumn(r,1,m));var i=n.fromCartesian4(l.getColumn(r,2,m));this._plane=f.fromPointNormal(e,i)}var m=new r;o(E.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var _=new e;E.fromPoints=function(t,n){var r=e.fromPoints(t,_);return new E(r.center,n)};var p=new d,y=new n;E.prototype.projectPointOntoPlane=function(e,r){var a=p;a.origin=e,n.normalize(e,a.direction);var o=c.rayPlane(a,this._plane,y);if(i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,y)),i(o)){var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return i(r)?(r.x=s,r.y=l,r):new t(s,l)}},E.prototype.projectPointsOntoPlane=function(e,t){i(t)||(t=[]);for(var n=0,r=e.length,a=0;a<r;a++){var o=this.projectPointOntoPlane(e[a],t[n]);i(o)&&(t[n]=o,n++)}return t.length=n,t},E.prototype.projectPointToNearestOnPlane=function(e,r){i(r)||(r=new t);var a=p;a.origin=e,n.clone(this._plane.normal,a.direction);var o=c.rayPlane(a,this._plane,y);i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,y));var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return r.x=s,r.y=l,r},E.prototype.projectPointsToNearestOnPlane=function(e,t){i(t)||(t=[]);var n=e.length;t.length=n;for(var r=0;r<n;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var T=new n;return E.prototype.projectPointsOntoEllipsoid=function(e,t){var r=e.length;i(t)?t.length=r:t=new Array(r);for(var a=this._ellipsoid,o=this._origin,u=this._xAxis,s=this._yAxis,c=T,l=0;l<r;++l){var f=e[l];n.multiplyByScalar(u,f.x,c),i(t[l])||(t[l]=new n);var d=n.add(o,c,t[l]);n.multiplyByScalar(s,f.y,c),n.add(d,c,d),a.scaleToGeocentricSurface(d,d)}return t},E}),define("Core/OrientedBoundingBox",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Intersect","./Interval","./Math","./Matrix3","./Plane","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,f,d,h,E){"use strict";function m(e,t){this.center=n.clone(a(e,n.ZERO)),this.halfAxes=d.clone(a(t,d.ZERO))}function _(e,t,r,a,o,u,s,c){i(c)||(c=new m);var l=c.halfAxes;d.setColumn(l,0,e.xAxis,l),d.setColumn(l,1,e.yAxis,l),d.setColumn(l,2,e.zAxis,l);var f=I;f.x=(t+r)/2,f.y=(a+o)/2,f.z=(u+s)/2;var h=g;h.x=(r-t)/2,h.y=(o-a)/2,h.z=(s-u)/2;var E=c.center;return f=d.multiplyByVector(l,f,f),n.add(e.origin,f,E),d.multiplyByScale(l,h,l),c}var p=new n,y=new n,T=new n,R=new n,A=new n,S=new n,N=new d,M={unitary:new d,diagonal:new d};m.fromPoints=function(e,t){if(i(t)||(t=new m),!i(e)||0===e.length)return t.halfAxes=d.ZERO,t.center=n.ZERO,t;var r,a=e.length,o=n.clone(e[0],p);for(r=1;r<a;r++)n.add(o,e[r],o);var u=1/a;n.multiplyByScalar(o,u,o);var s,c=0,l=0,f=0,h=0,E=0,_=0;for(r=0;r<a;r++)s=n.subtract(e[r],o,y),c+=s.x*s.x,l+=s.x*s.y,f+=s.x*s.z,h+=s.y*s.y,E+=s.y*s.z,_+=s.z*s.z;c*=u,l*=u,f*=u,h*=u,E*=u,_*=u;var I=N;I[0]=c,I[1]=l,I[2]=f,I[3]=l,I[4]=h,I[5]=E,I[6]=f,I[7]=E,I[8]=_;var g=d.computeEigenDecomposition(I,M),O=d.clone(g.unitary,t.halfAxes),v=d.getColumn(O,0,R),x=d.getColumn(O,1,A),w=d.getColumn(O,2,S),C=-Number.MAX_VALUE,P=-Number.MAX_VALUE,U=-Number.MAX_VALUE,D=Number.MAX_VALUE,L=Number.MAX_VALUE,F=Number.MAX_VALUE;for(r=0;r<a;r++)s=e[r],C=Math.max(n.dot(v,s),C),P=Math.max(n.dot(x,s),P),U=Math.max(n.dot(w,s),U),D=Math.min(n.dot(v,s),D),L=Math.min(n.dot(x,s),L),F=Math.min(n.dot(w,s),F);v=n.multiplyByScalar(v,.5*(D+C),v),x=n.multiplyByScalar(x,.5*(L+P),x),w=n.multiplyByScalar(w,.5*(F+U),w);var z=n.add(v,x,t.center);z=n.add(z,w,z);var B=T;return B.x=C-D,B.y=P-L,B.z=U-F,n.multiplyByScalar(B,.5,B),d.multiplyByScale(t.halfAxes,B,t.halfAxes),t};var I=new n,g=new n,O=new r,v=new n,x=[new r,new r,new r,new r,new r,new r,new r,new r],w=[new n,new n,new n,new n,new n,new n,new n,new n],C=[new t,new t,new t,new t,new t,new t,new t,new t];m.fromRectangle=function(e,t,n,r,i){t=a(t,0),n=a(n,0),r=a(r,u.WGS84);var o=E.center(e,O),c=r.cartographicToCartesian(o,v),l=new s(c,r),f=l.plane,d=x[0],m=x[1],p=x[2],y=x[3],T=x[4],R=x[5],A=x[6],S=x[7],N=o.longitude,M=e.south<0&&e.north>0?0:o.latitude;A.latitude=R.latitude=T.latitude=e.south,S.latitude=y.latitude=M,d.latitude=m.latitude=p.latitude=e.north,A.longitude=S.longitude=d.longitude=e.west,R.longitude=m.longitude=N,T.longitude=y.longitude=p.longitude=e.east,p.height=m.height=d.height=S.height=A.height=R.height=T.height=y.height=n,r.cartographicArrayToCartesianArray(x,w),l.projectPointsToNearestOnPlane(w,C);var I=Math.min(C[6].x,C[7].x,C[0].x),g=Math.max(C[2].x,C[3].x,C[4].x),P=Math.min(C[4].y,C[5].y,C[6].y),U=Math.max(C[0].y,C[1].y,C[2].y);p.height=d.height=T.height=A.height=t,r.cartographicArrayToCartesianArray(x,w);var D=Math.min(h.getPointDistance(f,w[0]),h.getPointDistance(f,w[2]),h.getPointDistance(f,w[4]),h.getPointDistance(f,w[6])),L=n;return _(l,I,g,P,U,D,L,i)},m.clone=function(e,t){if(i(e))return i(t)?(n.clone(e.center,t.center),d.clone(e.halfAxes,t.halfAxes),t):new m(e.center,e.halfAxes)},m.intersectPlane=function(e,t){var r=e.center,a=t.normal,i=e.halfAxes,o=a.x,u=a.y,s=a.z,l=Math.abs(o*i[d.COLUMN0ROW0]+u*i[d.COLUMN0ROW1]+s*i[d.COLUMN0ROW2])+Math.abs(o*i[d.COLUMN1ROW0]+u*i[d.COLUMN1ROW1]+s*i[d.COLUMN1ROW2])+Math.abs(o*i[d.COLUMN2ROW0]+u*i[d.COLUMN2ROW1]+s*i[d.COLUMN2ROW2]),f=n.dot(a,r)+t.distance;return f<=-l?c.OUTSIDE:f>=l?c.INSIDE:c.INTERSECTING};var P=new n,U=new n,D=new n,L=new n;m.distanceSquaredTo=function(e,t){var r=n.subtract(t,e.center,I),a=e.halfAxes,i=d.getColumn(a,0,P),o=d.getColumn(a,1,U),u=d.getColumn(a,2,D),s=n.magnitude(i),c=n.magnitude(o),l=n.magnitude(u);n.normalize(i,i),n.normalize(o,o),n.normalize(u,u);var f=L;f.x=n.dot(r,i),f.y=n.dot(r,o),f.z=n.dot(r,u);var h,E=0;return f.x<-s?(h=f.x+s,E+=h*h):f.x>s&&(h=f.x-s,E+=h*h),f.y<-c?(h=f.y+c,E+=h*h):f.y>c&&(h=f.y-c,E+=h*h),f.z<-l?(h=f.z+l,E+=h*h):f.z>l&&(h=f.z-l,E+=h*h),E};var F=new n,z=new n;m.computePlaneDistances=function(e,t,r,a){i(a)||(a=new l);var o=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,s=e.center,c=e.halfAxes,f=d.getColumn(c,0,P),h=d.getColumn(c,1,U),E=d.getColumn(c,2,D),m=n.add(f,h,F);n.add(m,E,m),n.add(m,s,m);var _=n.subtract(m,t,z),p=n.dot(r,_);return o=Math.min(p,o),u=Math.max(p,u),n.add(s,f,m),n.add(m,h,m),n.subtract(m,E,m),n.subtract(m,t,_),p=n.dot(r,_),o=Math.min(p,o),u=Math.max(p,u),n.add(s,f,m),n.subtract(m,h,m),n.add(m,E,m),n.subtract(m,t,_),p=n.dot(r,_),o=Math.min(p,o),u=Math.max(p,u),n.add(s,f,m),n.subtract(m,h,m),n.subtract(m,E,m),n.subtract(m,t,_),p=n.dot(r,_),o=Math.min(p,o),u=Math.max(p,u),n.subtract(s,f,m),n.add(m,h,m),n.add(m,E,m),n.subtract(m,t,_),p=n.dot(r,_),o=Math.min(p,o),u=Math.max(p,u),n.subtract(s,f,m),n.add(m,h,m),n.subtract(m,E,m),n.subtract(m,t,_),p=n.dot(r,_),o=Math.min(p,o),u=Math.max(p,u),n.subtract(s,f,m),n.subtract(m,h,m),n.add(m,E,m),n.subtract(m,t,_),p=n.dot(r,_),o=Math.min(p,o),u=Math.max(p,u),n.subtract(s,f,m),n.subtract(m,h,m),n.subtract(m,E,m),n.subtract(m,t,_),p=n.dot(r,_),o=Math.min(p,o),u=Math.max(p,u),a.start=o,a.stop=u,a};var B=new e;return m.isOccluded=function(t,n){var r=e.fromOrientedBoundingBox(t,B);return!n.isBoundingSphereVisible(r)},m.prototype.intersectPlane=function(e){return m.intersectPlane(this,e)},m.prototype.distanceSquaredTo=function(e){return m.distanceSquaredTo(this,e)},m.prototype.computePlaneDistances=function(e,t,n){return m.computePlaneDistances(this,e,t,n)},m.prototype.isOccluded=function(e){return m.isOccluded(this,e)},m.equals=function(e,t){return e===t||i(e)&&i(t)&&n.equals(e.center,t.center)&&d.equals(e.halfAxes,t.halfAxes)},m.prototype.clone=function(e){return m.clone(this,e)},m.prototype.equals=function(e){return m.equals(this,e)},m}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r,a){"use strict";var i={};i.octEncodeInRange=function(e,t,n){if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var r=n.x,i=n.y;n.x=(1-Math.abs(i))*a.signNotZero(r),n.y=(1-Math.abs(r))*a.signNotZero(i)}return n.x=a.toSNorm(n.x,t),n.y=a.toSNorm(n.y,t),n},i.octEncode=function(e,t){return i.octEncodeInRange(e,255,t)},i.octDecodeInRange=function(e,n,r,i){if(i.x=a.fromSNorm(e,r),i.y=a.fromSNorm(n,r),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){var o=i.x;i.x=(1-Math.abs(i.y))*a.signNotZero(o),i.y=(1-Math.abs(o))*a.signNotZero(i.y)}return t.normalize(i,i)},i.octDecode=function(e,t,n){return i.octDecodeInRange(e,t,255,n)},i.octPackFloat=function(e){return 256*e.x+e.y};var o=new e;return i.octEncodeFloat=function(e){return i.octEncode(e,o),i.octPackFloat(o)},i.octDecodeFloat=function(e,t){var n=e/256,r=Math.floor(n),a=256*(n-r);return i.octDecode(r,a,t)},i.octPack=function(e,t,n,r){var a=i.octEncodeFloat(e),u=i.octEncodeFloat(t),s=i.octEncode(n,o);return r.x=65536*s.x+a,r.y=65536*s.y+u,r},i.octUnpack=function(e,t,n,r){var a=e.x/65536,o=Math.floor(a),u=65536*(a-o);a=e.y/65536;var s=Math.floor(a),c=65536*(a-s);i.octDecodeFloat(u,t),i.octDecodeFloat(c,n),i.octDecode(o,s,r)},i.compressTextureCoordinates=function(e){var t=4095*e.x|0,n=4095*e.y|0;return 4096*t+n},i.decompressTextureCoordinates=function(e,t){var n=e/4096,r=Math.floor(n);return t.x=r/4095,t.y=(e-4096*r)/4095,t},i}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,a,i){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){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.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},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 Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,a){switch(r=e(r,0),a=e(a,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,a);case o.SHORT:return new Int16Array(n,r,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,a);case o.INT:return new Int32Array(n,r,a);case o.UNSIGNED_INT:return new Uint32Array(n,r,a);case o.FLOAT:return new Float32Array(n,r,a);case o.DOUBLE:return new Float64Array(n,r,a)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/TerrainQuantization",["./freezeObject"],function(e){"use strict";var t={NONE:0,BITS12:1};return e(t)}),define("Core/TerrainEncoding",["./AttributeCompression","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./Math","./Matrix4","./TerrainQuantization"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(e,t,r,o,c,d){var _,p,y,T;if(i(e)&&i(t)&&i(r)&&i(o)){var R=e.minimum,A=e.maximum,S=n.subtract(A,R,f),N=r-t,M=Math.max(n.maximumComponent(S),N);_=M<m-1?s.BITS12:s.NONE,p=e.center,y=u.inverseTransformation(o,new u);var I=n.negate(R,l);u.multiply(u.fromTranslation(I,h),y,y);var g=l;g.x=1/S.x,g.y=1/S.y,g.z=1/S.z,u.multiply(u.fromScale(g,h),y,y),T=u.clone(o),u.setTranslation(T,n.ZERO,T),o=u.clone(o,new u);var O=u.fromTranslation(R,h),v=u.fromScale(S,E),x=u.multiply(O,v,h);u.multiply(o,x,o),u.multiply(T,x,T)}this.quantization=_,this.minimumHeight=t,this.maximumHeight=r,this.center=p,this.toScaledENU=y,this.fromScaledENU=o,this.matrix=T,this.hasVertexNormals=c,this.hasWebMercatorT=a(d,!1)}var l=new n,f=new n,d=new t,h=new u,E=new u,m=Math.pow(2,12);c.prototype.encode=function(r,a,i,c,f,h,E){var m=c.x,_=c.y;if(this.quantization===s.BITS12){i=u.multiplyByPoint(this.toScaledENU,i,l),i.x=o.clamp(i.x,0,1),i.y=o.clamp(i.y,0,1),i.z=o.clamp(i.z,0,1);var p=this.maximumHeight-this.minimumHeight,y=o.clamp((f-this.minimumHeight)/p,0,1);t.fromElements(i.x,i.y,d);var T=e.compressTextureCoordinates(d);t.fromElements(i.z,y,d);var R=e.compressTextureCoordinates(d);t.fromElements(m,_,d);var A=e.compressTextureCoordinates(d);if(r[a++]=T,r[a++]=R,r[a++]=A,this.hasWebMercatorT){t.fromElements(E,0,d);var S=e.compressTextureCoordinates(d);r[a++]=S}}else n.subtract(i,this.center,l),r[a++]=l.x,r[a++]=l.y,r[a++]=l.z,r[a++]=f,r[a++]=m,r[a++]=_,this.hasWebMercatorT&&(r[a++]=E);return this.hasVertexNormals&&(r[a++]=e.octPackFloat(h)),a},c.prototype.decodePosition=function(t,r,a){if(i(a)||(a=new n),r*=this.getStride(),this.quantization===s.BITS12){var o=e.decompressTextureCoordinates(t[r],d);a.x=o.x,a.y=o.y;var c=e.decompressTextureCoordinates(t[r+1],d);return a.z=c.x,u.multiplyByPoint(this.fromScaledENU,a,a)}return a.x=t[r],a.y=t[r+1],a.z=t[r+2],n.add(a,this.center,a)},c.prototype.decodeTextureCoordinates=function(n,r,a){return i(a)||(a=new t),r*=this.getStride(),this.quantization===s.BITS12?e.decompressTextureCoordinates(n[r+2],a):t.fromElements(n[r+4],n[r+5],a)},c.prototype.decodeHeight=function(t,n){if(n*=this.getStride(),this.quantization===s.BITS12){var r=e.decompressTextureCoordinates(t[n+1],d);return r.y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight}return t[n+3]},c.prototype.getOctEncodedNormal=function(e,n,r){var a=this.getStride();n=(n+1)*a-1;var i=e[n]/256,o=Math.floor(i),u=256*(i-o);return t.fromElements(o,u,r)},c.prototype.getStride=function(){var e;switch(this.quantization){case s.BITS12:e=3;break;default:e=6}return this.hasWebMercatorT&&++e,this.hasVertexNormals&&++e,e};var _={position3DAndHeight:0,textureCoordAndEncodedNormals:1},p={compressed0:0,compressed1:1};return c.prototype.getAttributes=function(e){var t,n=r.FLOAT,a=r.getSizeInBytes(n);if(this.quantization===s.NONE){var i=4,o=2;return this.hasWebMercatorT&&++o,this.hasVertexNormals&&++o,t=(i+o)*a,[{index:_.position3DAndHeight,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:i,offsetInBytes:0,strideInBytes:t},{index:_.textureCoordAndEncodedNormals,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:o,offsetInBytes:i*a,strideInBytes:t}]}var u=3,c=0;return(this.hasWebMercatorT||this.hasVertexNormals)&&++u,this.hasWebMercatorT&&this.hasVertexNormals?(++c,t=(u+c)*a,[{index:p.compressed0,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:u,offsetInBytes:0,strideInBytes:t},{index:p.compressed1,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:c,offsetInBytes:u*a,strideInBytes:t}]):[{index:p.compressed0,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:u}]},c.prototype.getAttributeLocations=function(){return this.quantization===s.NONE?_:p},c.clone=function(e,t){return i(t)||(t=new c),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=n.clone(e.center),t.toScaledENU=u.clone(e.toScaledENU),t.fromScaledENU=u.clone(e.fromScaledENU),t.matrix=u.clone(e.matrix),t.hasVertexNormals=e.hasVertexNormals,t.hasWebMercatorT=e.hasWebMercatorT,t},c}),define("Core/WebMercatorProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(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,n){ -var a=this._semimajorAxis,i=t.longitude*a,o=s.geodeticLatitudeToMercatorAngle(t.latitude)*a,u=t.height;return r(n)?(n.x=i,n.y=o,n.z=u,n):new e(i,o,u)},s.prototype.unproject=function(e,n){var a=this._oneOverSemimajorAxis,i=e.x*a,o=s.mercatorAngleToGeodeticLatitude(e.y*a),u=e.z;return r(n)?(n.longitude=i,n.latitude=o,n.height=u,n):new t(i,o,u)},s}),define("Core/HeightmapTessellator",["./AxisAlignedBoundingBox","./BoundingSphere","./Cartesian2","./Cartesian3","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidalOccluder","./freezeObject","./Math","./Matrix4","./OrientedBoundingBox","./Rectangle","./TerrainEncoding","./Transforms","./WebMercatorProjection"],function(e,t,n,r,a,i,o,u,s,c,l,f,d,h,E,m,_){"use strict";var p={};p.DEFAULT_STRUCTURE=c({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var y=new r,T=new f,R=new r,A=new r;return p.computeVertices=function(o){var c,S,N,M,I=Math.cos,g=Math.sin,O=Math.sqrt,v=Math.atan,x=Math.exp,w=l.PI_OVER_TWO,C=l.toRadians,P=o.heightmap,U=o.width,D=o.height,L=o.skirtHeight,F=a(o.isGeographic,!0),z=a(o.ellipsoid,u.WGS84),B=1/z.maximumRadius,b=o.nativeRectangle,q=o.rectangle;i(q)?(c=q.west,S=q.south,N=q.east,M=q.north):F?(c=C(b.west),S=C(b.south),N=C(b.east),M=C(b.north)):(c=b.west*B,S=w-2*v(x(-b.south*B)),N=b.east*B,M=w-2*v(x(-b.north*B)));var G=o.relativeToCenter,W=i(G);G=W?G:r.ZERO;var V,X,H=a(o.exaggeration,1),Y=a(o.includeWebMercatorT,!1),j=a(o.structure,p.DEFAULT_STRUCTURE),k=a(j.heightScale,p.DEFAULT_STRUCTURE.heightScale),Z=a(j.heightOffset,p.DEFAULT_STRUCTURE.heightOffset),K=a(j.elementsPerHeight,p.DEFAULT_STRUCTURE.elementsPerHeight),J=a(j.stride,p.DEFAULT_STRUCTURE.stride),Q=a(j.elementMultiplier,p.DEFAULT_STRUCTURE.elementMultiplier),$=a(j.isBigEndian,p.DEFAULT_STRUCTURE.isBigEndian),ee=h.computeWidth(b)/(U-1),te=h.computeHeight(b)/(D-1),ne=z.radiiSquared,re=ne.x,ae=ne.y,ie=ne.z,oe=65536,ue=-65536,se=m.eastNorthUpToFixedFrame(G,z),ce=f.inverseTransformation(se,T);Y&&(V=_.geodeticLatitudeToMercatorAngle(S),X=1/(_.geodeticLatitudeToMercatorAngle(M)-V));var le=R;le.x=Number.POSITIVE_INFINITY,le.y=Number.POSITIVE_INFINITY,le.z=Number.POSITIVE_INFINITY;var fe=A;fe.x=Number.NEGATIVE_INFINITY,fe.y=Number.NEGATIVE_INFINITY,fe.z=Number.NEGATIVE_INFINITY;var de=Number.POSITIVE_INFINITY,he=U+(L>0?2:0),Ee=D+(L>0?2:0),me=he*Ee,_e=new Array(me),pe=new Array(me),ye=new Array(me),Te=Y?new Array(me):[],Re=0,Ae=D,Se=0,Ne=U;L>0&&(--Re,++Ae,--Se,++Ne);for(var Me=0,Ie=Re;Ie<Ae;++Ie){var ge=Ie;ge<0&&(ge=0),ge>=D&&(ge=D-1);var Oe=b.north-te*ge;Oe=F?C(Oe):w-2*v(x(-Oe*B));var ve=I(Oe),xe=g(Oe),we=ie*xe,Ce=(Oe-S)/(M-S);Ce=l.clamp(Ce,0,1);var Pe;Y&&(Pe=(_.geodeticLatitudeToMercatorAngle(Oe)-V)*X);for(var Ue=Se;Ue<Ne;++Ue){var De=Ue;De<0&&(De=0),De>=U&&(De=U-1);var Le=b.west+ee*De;F?Le=C(Le):Le*=B;var Fe,ze=ge*(U*J)+De*J;if(1===K)Fe=P[ze];else{Fe=0;var Be;if($)for(Be=0;Be<K;++Be)Fe=Fe*Q+P[ze+Be];else for(Be=K-1;Be>=0;--Be)Fe=Fe*Q+P[ze+Be]}Fe=(Fe*k+Z)*H,ue=Math.max(ue,Fe),oe=Math.min(oe,Fe),Ue===De&&Ie===ge||(Fe-=L);var be=ve*I(Le),qe=ve*g(Le),Ge=re*be,We=ae*qe,Ve=O(Ge*be+We*qe+we*xe),Xe=1/Ve,He=Ge*Xe,Ye=We*Xe,je=we*Xe,ke=new r;ke.x=He+be*Fe,ke.y=Ye+qe*Fe,ke.z=je+xe*Fe,_e[Me]=ke,pe[Me]=Fe;var Ze=(Le-c)/(N-c);Ze=l.clamp(Ze,0,1),ye[Me]=new n(Ze,Ce),Y&&(Te[Me]=Pe),Me++,f.multiplyByPoint(ce,ke,y),r.minimumByComponent(y,le,le),r.maximumByComponent(y,fe,fe),de=Math.min(de,Fe)}}var Ke,Je=t.fromPoints(_e);i(q)&&q.width<l.PI_OVER_TWO+l.EPSILON5&&(Ke=d.fromRectangle(q,oe,ue,z));var Qe;if(W){var $e=new s(z);Qe=$e.computeHorizonCullingPoint(G,_e)}for(var et=new e(le,fe,G),tt=new E(et,de,ue,se,!1,Y),nt=new Float32Array(me*tt.getStride()),rt=0,at=0;at<me;++at)rt=tt.encode(nt,rt,_e[at],ye[at],pe[at],void 0,Te[at]);return{vertices:nt,maximumHeight:ue,minimumHeight:oe,encoding:tt,boundingSphere3D:Je,orientedBoundingBox:Ke,occludeePointInScaledSpace:Qe}},p}),define("Core/formatError",["./defined"],function(e){"use strict";function t(t){var n,r=t.name,a=t.message;n=e(r)&&e(a)?r+": "+a:t.toString();var i=t.stack;return e(i)&&(n+="\n"+i),n}return t}),define("Workers/createTaskProcessorWorker",["../Core/defaultValue","../Core/defined","../Core/formatError"],function(e,t,n){"use strict";function r(r){var a,i=[],o={id:void 0,result:void 0,error:void 0};return function(u){var s=u.data;i.length=0,o.id=s.id,o.error=void 0,o.result=void 0;try{o.result=r(s.parameters,i)}catch(e){e instanceof Error?o.error={name:e.name,message:e.message,stack:e.stack}:o.error=e}t(a)||(a=e(self.webkitPostMessage,self.postMessage)),s.canTransferArrayBuffer||(i.length=0);try{a(o,i)}catch(e){o.result=void 0,o.error="postMessage failed with error: "+n(e)+"\n with responseMessage: "+JSON.stringify(o),a(o)}}}return r}),define("Workers/createVerticesFromHeightmap",["../Core/Ellipsoid","../Core/HeightmapTessellator","../Core/Rectangle","./createTaskProcessorWorker"],function(e,t,n,r){"use strict";function a(r,a){var i=r.width,o=r.height;r.skirtHeight>0&&(i+=2,o+=2),r.ellipsoid=e.clone(r.ellipsoid),r.rectangle=n.clone(r.rectangle);var u=t.computeVertices(r),s=u.vertices;return a.push(s.buffer),{vertices:s.buffer,numberOfAttributes:u.encoding.getStride(),minimumHeight:u.minimumHeight,maximumHeight:u.maximumHeight,gridWidth:i,gridHeight:o,boundingSphere3D:u.boundingSphere3D,orientedBoundingBox:u.orientedBoundingBox,occludeePointInScaledSpace:u.occludeePointInScaledSpace,encoding:u.encoding}}return r(a)})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e){return e+" is required, actual value was undefined"}function r(e,t,n){return"Expected "+n+" to be typeof "+t+", actual typeof was "+e}var a={};return a.typeOf={},a.defined=function(r,a){if(!e(a))throw new t(n(r))},a.typeOf.func=function(e,n){if("function"!=typeof n)throw new t(r(typeof n,"function",e))},a.typeOf.string=function(e,n){if("string"!=typeof n)throw new t(r(typeof n,"string",e))},a.typeOf.number=function(e,n){if("number"!=typeof n)throw new t(r(typeof n,"number",e))},a.typeOf.number.lessThan=function(e,n,r){if(a.typeOf.number(e,n),n>=r)throw new t("Expected "+e+" to be less than "+r+", actual value was "+n)},a.typeOf.number.lessThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n>r)throw new t("Expected "+e+" to be less than or equal to "+r+", actual value was "+n)},a.typeOf.number.greaterThan=function(e,n,r){if(a.typeOf.number(e,n),n<=r)throw new t("Expected "+e+" to be greater than "+r+", actual value was "+n)},a.typeOf.number.greaterThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n<r)throw new t("Expected "+e+" to be greater than or equal to"+r+", actual value was "+n)},a.typeOf.object=function(e,n){if("object"!=typeof n)throw new t(r(typeof n,"object",e))},a.typeOf.bool=function(e,n){if("boolean"!=typeof n)throw new t(r(typeof n,"boolean",e))},a}),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";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),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 n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(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^=e<<7&2636928640,e^=e<<15&4022730752,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,n,r){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:e<0?-1:0},a.signNotZero=function(e){return e<0?-1:1},a.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*a.clamp(e,-1,1)+.5)*n)},a.fromSNorm=function(e,n){return n=t(n,255),a.clamp(e,0,n)/n*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},a.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},a.lerp=function(e,t,n){return(1-n)*e+n*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){var t=a.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},a.clampToLatitudeRange=function(e){return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){return(e%t+t)%t},a.equalsEpsilon=function(e,n,r,a){a=t(a,r);var i=Math.abs(e-n);return i<=a||i<=r*Math.max(Math.abs(e),Math.abs(n))};var i=[1];a.factorial=function(e){var t=i.length;if(e>=t)for(var n=i[t-1],r=t;r<=e;r++)i.push(n*r);return i[e]},a.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},a.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return a.setRandomNumberSeed=function(t){o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(e){return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){return Math.log(e)/Math.log(t)},a.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var a=e.clock,i=e.cone,u=t(e.magnitude,1),s=u*Math.sin(i);return r.x=s*Math.cos(a),r.y=s*Math.sin(a),r.z=u*Math.cos(i),r},o.fromElements=function(e,t,r,a){return n(a)?(a.x=e,a.y=t,a.z=r,a):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var a=0;a<r;++a)o.pack(e[a],t,3*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var a=0;a<r;a+=3){var i=a/3;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,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};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var n=o.dot(c,l),r=o.magnitude(o.cross(c,l,c));return Math.atan2(r,n)};var f=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)},o.cross=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=t.x,u=t.y,s=t.z,c=a*s-i*u,l=i*o-r*s,f=r*u-a*o;return n.x=c,n.y=l,n.z=f,n},o.fromDegrees=function(e,t,n,r,a){return e=i.toRadians(e),t=i.toRadians(t),o.fromRadians(e,t,n,r,a)};var d=new o,h=new o,E=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,a,i,u){a=t(a,0);var s=n(i)?i.radiiSquared:E,c=Math.cos(r);d.x=c*Math.cos(e),d.y=c*Math.sin(e),d.z=Math.sin(r),d=o.normalize(d,d),o.multiplyComponents(s,d,h);var l=Math.sqrt(o.dot(d,h));return h=o.divideByScalar(h,l,h),d=o.multiplyByScalar(d,a,d),n(u)||(u=new o),o.add(h,d,u)},o.fromDegreesArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromDegrees(u,s,0,t,r[c])}return r},o.fromRadiansArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromRadians(u,s,0,t,r[c])}return r},o.fromDegreesArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromDegrees(u,s,c,t,r[l])}return r},o.fromRadiansArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromRadians(u,s,c,t,r[l])}return r},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(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,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(n,a,u,s,c){var l=n.x,f=n.y,d=n.z,h=a.x,E=a.y,m=a.z,_=l*l*h*h,p=f*f*E*E,y=d*d*m*m,T=_+p+y,R=Math.sqrt(1/T),A=e.multiplyByScalar(n,R,i);if(T<s)return isFinite(R)?e.clone(A,c):void 0;var S=u.x,N=u.y,M=u.z,I=o;I.x=A.x*S*2,I.y=A.y*N*2,I.z=A.z*M*2;var O,v,g,x,w,C,P,U,D,L,F,z=(1-R)*e.magnitude(n)/(.5*e.magnitude(I)),B=0;do{z-=B,g=1/(1+z*S),x=1/(1+z*N),w=1/(1+z*M),C=g*g,P=x*x,U=w*w,D=C*g,L=P*x,F=U*w,O=_*C+p*P+y*U-1,v=_*D*S+p*L*N+y*F*M;var b=-2*v;B=O/b}while(Math.abs(O)>r.EPSILON12);return t(c)?(c.x=l*g,c.y=f*x,c.z=d*w,c):new e(l*g,f*x,d*w)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o){"use strict";function u(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)}u.fromRadians=function(e,r,a,i){return a=t(a,0),n(i)?(i.longitude=e,i.latitude=r,i.height=a,i):new u(e,r,a)},u.fromDegrees=function(e,t,n,r){return e=i.toRadians(e),t=i.toRadians(t),u.fromRadians(e,t,n,r)};var s=new e,c=new e,l=new e,f=new e(1/6378137,1/6378137,1/6356752.314245179),d=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),h=i.EPSILON1;return u.fromCartesian=function(t,r,a){var E=n(r)?r.oneOverRadii:f,m=n(r)?r.oneOverRadiiSquared:d,_=n(r)?r._centerToleranceSquared:h,p=o(t,E,m,_,c);if(n(p)){var y=e.multiplyComponents(p,m,s);y=e.normalize(y,y);var T=e.subtract(t,p,l),R=Math.atan2(y.y,y.x),A=Math.asin(y.z),S=i.sign(e.dot(T,t))*e.magnitude(T);return n(a)?(a.longitude=R,a.latitude=A,a.height=S,a):new u(R,A,S)}},u.clone=function(e,t){if(n(e))return n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},u.ZERO=a(new u(0,0,0)),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,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(t,r,a,i){r=n(r,0),a=n(a,0),i=n(i,0),t._radii=new e(r,a,i),t._radiiSquared=new e(r*r,a*a,i*i),t._radiiToTheFourth=new e(r*r*r*r,a*a*a*a,i*i*i*i),t._oneOverRadii=new e(0===r?0:1/r,0===a?0:1/a,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===a?0:1/(a*a),0===i?0:1/(i*i)),t._minimumRadius=Math.min(r,a,i),t._maximumRadius=Math.max(r,a,i),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,c(this,e,t,n)}a(l.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}}}),l.clone=function(t,n){if(r(t)){var a=t._radii;return r(n)?(e.clone(a,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new l(a.x,a.y,a.z)}},l.fromCartesian3=function(e,t){return r(t)||(t=new l),r(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,r,a){return a=n(a,0),e.pack(t._radii,r,a),r},l.unpack=function(t,r,a){r=n(r,0);var i=e.unpack(t,r);return l.fromCartesian3(i,a)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,n){var a=t.longitude,i=t.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return r(n)||(n=new e),n.x=u,n.y=s,n.z=c,e.normalize(n,n)},l.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var f=new e,d=new e;l.prototype.cartographicToCartesian=function(t,n){var a=f,i=d;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(e.dot(a,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(a,t.height,a),r(n)||(n=new e),e.add(i,a,n)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var h=new e,E=new e,m=new e;return l.prototype.cartesianToCartographic=function(n,a){var i=this.scaleToGeodeticSurface(n,E);if(r(i)){var o=this.geodeticSurfaceNormal(i,h),s=e.subtract(n,i,m),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),f=u.sign(e.dot(s,n))*e.magnitude(s);return r(a)?(a.longitude=c,a.latitude=l,a.height=f,a):new t(c,l,f)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var a=t.x,i=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return e.multiplyByScalar(t,s,n)},l.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},l.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},l.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,a,i){a=n(a,0);var o=this._sqauredXOverSquaredZ;if(r(i)||(i=new e),i.x=0,i.y=0,i.z=t.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},l}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Intersect"],function(e,t,n,r,a){"use strict";function i(r,a,i){this.minimum=e.clone(t(r,e.ZERO)),this.maximum=e.clone(t(a,e.ZERO)),n(i)?i=e.clone(i):(i=e.add(this.minimum,this.maximum,new e),e.multiplyByScalar(i,.5,i)),this.center=i}i.fromPoints=function(t,r){if(n(r)||(r=new i),!n(t)||0===t.length)return r.minimum=e.clone(e.ZERO,r.minimum),r.maximum=e.clone(e.ZERO,r.maximum),r.center=e.clone(e.ZERO,r.center),r;for(var a=t[0].x,o=t[0].y,u=t[0].z,s=t[0].x,c=t[0].y,l=t[0].z,f=t.length,d=1;d<f;d++){var h=t[d],E=h.x,m=h.y,_=h.z;a=Math.min(E,a),s=Math.max(E,s),o=Math.min(m,o),c=Math.max(m,c),u=Math.min(_,u),l=Math.max(_,l)}var p=r.minimum;p.x=a,p.y=o,p.z=u;var y=r.maximum;y.x=s,y.y=c,y.z=l;var T=e.add(p,y,r.center);return e.multiplyByScalar(T,.5,T),r},i.clone=function(t,r){if(n(t))return n(r)?(r.minimum=e.clone(t.minimum,r.minimum),r.maximum=e.clone(t.maximum,r.maximum),r.center=e.clone(t.center,r.center),r):new i(t.minimum,t.maximum)},i.equals=function(t,r){return t===r||n(t)&&n(r)&&e.equals(t.center,r.center)&&e.equals(t.minimum,r.minimum)&&e.equals(t.maximum,r.maximum)};var o=new e;return i.intersectPlane=function(t,n){o=e.subtract(t.maximum,t.minimum,o);var r=e.multiplyByScalar(o,.5,o),i=n.normal,u=r.x*Math.abs(i.x)+r.y*Math.abs(i.y)+r.z*Math.abs(i.z),s=e.dot(t.center,i)+n.distance;return s-u>0?a.INSIDE:s+u<0?a.OUTSIDE:a.INTERSECTING},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.intersectPlane=function(e){return i.intersectPlane(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,a,i,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return r(n)?(n.x=i,n.y=o,n.z=u,n):new e(i,o,u)},u.prototype.unproject=function(e,n){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,u=e.z;return r(n)?(n.longitude=i,n.latitude=o,n.height=u,n):new t(i,o,u)},u}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a,i,o,u,s,c){this[0]=n(e,0),this[1]=n(a,0),this[2]=n(u,0),this[3]=n(t,0),this[4]=n(i,0),this[5]=n(s,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(c,0)}function c(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function l(e){for(var t=0,n=0;n<3;++n){var r=e[s.getElementIndex(m[n],E[n])];t+=2*r*r}return Math.sqrt(t)}function f(e,t){for(var n=u.EPSILON15,r=0,a=1,i=0;i<3;++i){var o=Math.abs(e[s.getElementIndex(m[i],E[i])]);o>r&&(a=i,r=o)}var c=1,l=0,f=E[a],d=m[a];if(Math.abs(e[s.getElementIndex(d,f)])>n){var h,_=e[s.getElementIndex(d,d)],p=e[s.getElementIndex(f,f)],y=e[s.getElementIndex(d,f)],T=(_-p)/2/y;h=T<0?-1/(-T+Math.sqrt(1+T*T)):1/(T+Math.sqrt(1+T*T)),c=1/Math.sqrt(1+h*h),l=h*c}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(f,f)]=t[s.getElementIndex(d,d)]=c,t[s.getElementIndex(d,f)]=l,t[s.getElementIndex(f,d)]=-l,t}s.packedLength=9,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t},s.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a},s.clone=function(e,t){if(r(e))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):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t],a[1]=e[t+1],a[2]=e[t+2],a[3]=e[t+3],a[4]=e[t+4],a[5]=e[t+5],a[6]=e[t+6],a[7]=e[t+7],a[8]=e[t+8],a},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[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 s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var n=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,u=e.y*e.y,c=e.y*e.z,l=e.y*e.w,f=e.z*e.z,d=e.z*e.w,h=e.w*e.w,E=n-u-f+h,m=2*(a-d),_=2*(i+l),p=2*(a+d),y=-n+u-f+h,T=2*(c-o),R=2*(i-l),A=2*(c+o),S=-n-u+f+h;return r(t)?(t[0]=E,t[1]=p,t[2]=R,t[3]=m,t[4]=y,t[5]=A,t[6]=_,t[7]=T,t[8]=S,t):new s(E,m,_,p,y,T,R,A,S)},s.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),a=Math.cos(-e.heading),i=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),c=Math.sin(e.roll),l=n*a,f=-i*u+c*o*a,d=c*u+i*o*a,h=n*u,E=i*a+c*o*u,m=-o*i+i*o*u,_=-o,p=c*n,y=i*n;return r(t)?(t[0]=l,t[1]=h,t[2]=_,t[3]=f,t[4]=E,t[5]=p,t[6]=d,t[7]=m,t[8]=y,t):new s(l,f,d,h,E,m,_,p,y)},s.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 s(e.x,0,0,0,e.y,0,0,0,e.z)},s.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 s(e,0,0,0,e,0,0,0,e)},s.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 s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=a,t[6]=0,t[7]=-a,t[8]=n,t):new s(1,0,0,0,n,-a,0,a,n)},s.fromRotationY=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=n,t):new s(n,0,a,0,1,0,-a,0,n)},s.fromRotationZ=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=a,t[2]=0,t[3]=-a,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(n,-a,0,a,n,0,0,0,1)},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):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,n){var r=3*t,a=e[r],i=e[r+1],o=e[r+2];return n.x=a,n.y=i,n.z=o,n},s.setColumn=function(e,t,n,r){r=s.clone(e,r);var a=3*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},s.getRow=function(e,t,n){var r=e[t],a=e[t+3],i=e[t+6];return n.x=r,n.y=a,n.z=i,n},s.setRow=function(e,t,n,r){return r=s.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var d=new e;s.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],d)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],d)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],d)),n};var h=new e;s.getMaximumScale=function(t){return s.getScale(t,h),e.maximumComponent(h)},s.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=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 n[0]=r,n[1]=a,n[2]=i,n[3]=o,n[4]=u,n[5]=s,n[6]=c,n[7]=l,n[8]=f,n},s.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},s.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},s.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[3]*a+e[6]*i,u=e[1]*r+e[4]*a+e[7]*i,s=e[2]*r+e[5]*a+e[8]*i;return n.x=o,n.y=u,n.z=s,n},s.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},s.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},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},s.transpose=function(e,t){var n=e[0],r=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=n,t[1]=r,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var E=[1,0,0],m=[2,2,1],_=new s,p=new s;return s.computeEigenDecomposition=function(e,t){var n=u.EPSILON20,a=10,i=0,o=0;r(t)||(t={});for(var d=t.unitary=s.clone(s.IDENTITY,t.unitary),h=t.diagonal=s.clone(e,t.diagonal),E=n*c(h);o<a&&l(h)>E;)f(h,_),s.transpose(_,p),s.multiply(h,_,h),s.multiply(p,h,h),s.multiply(d,_,d),++i>2&&(++o,i=0);return 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},s.determinant=function(e){var t=e[0],n=e[3],r=e[6],a=e[1],i=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*o)+a*(s*r-n*c)+u*(n*o-i*r)},s.inverse=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[3],o=e[4],u=e[5],c=e[6],l=e[7],f=e[8],d=s.determinant(e);t[0]=o*f-l*u,t[1]=l*a-r*f,t[2]=r*u-o*a,t[3]=c*u-i*f,t[4]=n*f-c*a,t[5]=i*a-n*u,t[6]=i*l-c*o,t[7]=c*r-n*l,t[8]=n*o-i*r;var h=1/d;return s.multiplyByScalar(t,h,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]},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},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,a(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r,a){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(a,0)}o.fromElements=function(e,t,r,a,i){return n(i)?(i.x=e,i.y=t,i.z=r,i.w=a,i):new o(e,t,r,a)},o.fromColor=function(e,t){return n(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(n(e))return n(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)},o.packedLength=4,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r++],a.w=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=4*r:t=new Array(4*r);for(var a=0;a<r;++a)o.pack(e[a],t,4*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/4:t=new Array(r/4);for(var a=0;a<r;a+=4){var i=a/4;t[i]=o.unpack(e,a,t[i])}return t},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,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},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 u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,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,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},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 s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r); +};var c=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,c);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)&&i.equalsEpsilon(e.w,t.w,r,a)},o.ZERO=a(new o(0,0,0,0)),o.UNIT_X=a(new o(1,0,0,0)),o.UNIT_Y=a(new o(0,1,0,0)),o.UNIT_Z=a(new o(0,0,1,0)),o.UNIT_W=a(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,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,a,i,o,u,s,c,l){"use strict";function f(e,t,n,a,i,o,u,s,c,l,f,d,h,E,m,_){this[0]=r(e,0),this[1]=r(i,0),this[2]=r(c,0),this[3]=r(h,0),this[4]=r(t,0),this[5]=r(o,0),this[6]=r(l,0),this[7]=r(E,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(f,0),this[11]=r(m,0),this[12]=r(a,0),this[13]=r(s,0),this[14]=r(d,0),this[15]=r(_,0)}f.packedLength=16,f.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},f.unpack=function(e,t,n){return t=r(t,0),a(n)||(n=new f),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},f.clone=function(e,t){if(a(e))return a(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 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])},f.fromArray=f.unpack,f.fromColumnMajorArray=function(e,t){return f.clone(e,t)},f.fromRowMajorArray=function(e,t){return a(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 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(t,n,i){return n=r(n,e.ZERO),a(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=1,i):new f(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},f.fromTranslationQuaternionRotationScale=function(e,t,n,r){a(r)||(r=new f);var i=n.x,o=n.y,u=n.z,s=t.x*t.x,c=t.x*t.y,l=t.x*t.z,d=t.x*t.w,h=t.y*t.y,E=t.y*t.z,m=t.y*t.w,_=t.z*t.z,p=t.z*t.w,y=t.w*t.w,T=s-h-_+y,R=2*(c-p),A=2*(l+m),S=2*(c+p),N=-s+h-_+y,M=2*(E-d),I=2*(l-m),O=2*(E+d),v=-s-h+_+y;return r[0]=T*i,r[1]=S*i,r[2]=I*i,r[3]=0,r[4]=R*o,r[5]=N*o,r[6]=O*o,r[7]=0,r[8]=A*u,r[9]=M*u,r[10]=v*u,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},f.fromTranslationRotationScale=function(e,t){return f.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},f.fromTranslation=function(e,t){return f.fromRotationTranslation(c.IDENTITY,e,t)},f.fromScale=function(e,t){return a(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 f(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},f.fromUniformScale=function(e,t){return a(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 f(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var d=new e,h=new e,E=new e;f.fromCamera=function(t,n){var r=t.position,i=t.direction,o=t.up;e.normalize(i,d),e.normalize(e.cross(d,o,h),h),e.normalize(e.cross(h,d,E),E);var u=h.x,s=h.y,c=h.z,l=d.x,m=d.y,_=d.z,p=E.x,y=E.y,T=E.z,R=r.x,A=r.y,S=r.z,N=u*-R+s*-A+c*-S,M=p*-R+y*-A+T*-S,I=l*R+m*A+_*S;return a(n)?(n[0]=u,n[1]=p,n[2]=-l,n[3]=0,n[4]=s,n[5]=y,n[6]=-m,n[7]=0,n[8]=c,n[9]=T,n[10]=-_,n[11]=0,n[12]=N,n[13]=M,n[14]=I,n[15]=1,n):new f(u,s,c,N,p,y,T,M,-l,-m,-_,I,0,0,0,1)},f.computePerspectiveFieldOfView=function(e,t,n,r,a){var i=Math.tan(.5*e),o=1/i,u=o/t,s=(r+n)/(n-r),c=2*r*n/(n-r);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=c,a[15]=0,a},f.computeOrthographicOffCenter=function(e,t,n,r,a,i,o){var u=1/(t-e),s=1/(r-n),c=1/(i-a),l=-(t+e)*u,f=-(r+n)*s,d=-(i+a)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=f,o[14]=d,o[15]=1,o},f.computePerspectiveOffCenter=function(e,t,n,r,a,i,o){var u=2*a/(t-e),s=2*a/(r-n),c=(t+e)/(t-e),l=(r+n)/(r-n),f=-(i+a)/(i-a),d=-1,h=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=f,o[11]=d,o[12]=0,o[13]=0,o[14]=h,o[15]=0,o},f.computeInfinitePerspectiveOffCenter=function(e,t,n,r,a,i){var o=2*a/(t-e),u=2*a/(r-n),s=(t+e)/(t-e),c=(r+n)/(r-n),l=-1,f=-1,d=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=s,i[9]=c,i[10]=l,i[11]=f,i[12]=0,i[13]=0,i[14]=d,i[15]=0,i},f.computeViewportTransformation=function(e,t,n,a){e=r(e,r.EMPTY_OBJECT);var i=r(e.x,0),o=r(e.y,0),u=r(e.width,0),s=r(e.height,0);t=r(t,0),n=r(n,1);var c=.5*u,l=.5*s,f=.5*(n-t),d=c,h=l,E=f,m=i+c,_=o+l,p=t+f,y=1;return a[0]=d,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=h,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=E,a[11]=0,a[12]=m,a[13]=_,a[14]=p,a[15]=y,a},f.computeView=function(t,n,r,a,i){return i[0]=a.x,i[1]=r.x,i[2]=-n.x,i[3]=0,i[4]=a.y,i[5]=r.y,i[6]=-n.y,i[7]=0,i[8]=a.z,i[9]=r.z,i[10]=-n.z,i[11]=0,i[12]=-e.dot(a,t),i[13]=-e.dot(r,t),i[14]=e.dot(n,t),i[15]=1,i},f.toArray=function(e,t){return a(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]]},f.getElementIndex=function(e,t){return 4*e+t},f.getColumn=function(e,t,n){var r=4*t,a=e[r],i=e[r+1],o=e[r+2],u=e[r+3];return n.x=a,n.y=i,n.z=o,n.w=u,n},f.setColumn=function(e,t,n,r){r=f.clone(e,r);var a=4*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r[a+3]=n.w,r},f.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},f.getRow=function(e,t,n){var r=e[t],a=e[t+4],i=e[t+8],o=e[t+12];return n.x=r,n.y=a,n.z=i,n.w=o,n},f.setRow=function(e,t,n,r){return r=f.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var m=new e;f.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],m)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],m)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],m)),n};var _=new e;f.getMaximumScale=function(t){return f.getScale(t,_),e.maximumComponent(_)},f.multiply=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],f=e[8],d=e[9],h=e[10],E=e[11],m=e[12],_=e[13],p=e[14],y=e[15],T=t[0],R=t[1],A=t[2],S=t[3],N=t[4],M=t[5],I=t[6],O=t[7],v=t[8],g=t[9],x=t[10],w=t[11],C=t[12],P=t[13],U=t[14],D=t[15],L=r*T+u*R+f*A+m*S,F=a*T+s*R+d*A+_*S,z=i*T+c*R+h*A+p*S,B=o*T+l*R+E*A+y*S,b=r*N+u*M+f*I+m*O,q=a*N+s*M+d*I+_*O,G=i*N+c*M+h*I+p*O,W=o*N+l*M+E*I+y*O,X=r*v+u*g+f*x+m*w,V=a*v+s*g+d*x+_*w,H=i*v+c*g+h*x+p*w,Y=o*v+l*g+E*x+y*w,k=r*C+u*P+f*U+m*D,j=a*C+s*P+d*U+_*D,Z=i*C+c*P+h*U+p*D,K=o*C+l*P+E*U+y*D;return n[0]=L,n[1]=F,n[2]=z,n[3]=B,n[4]=b,n[5]=q,n[6]=G,n[7]=W,n[8]=X,n[9]=V,n[10]=H,n[11]=Y,n[12]=k,n[13]=j,n[14]=Z,n[15]=K,n},f.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},f.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},f.multiplyTransformation=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],d=e[12],h=e[13],E=e[14],m=t[0],_=t[1],p=t[2],y=t[4],T=t[5],R=t[6],A=t[8],S=t[9],N=t[10],M=t[12],I=t[13],O=t[14],v=r*m+o*_+c*p,g=a*m+u*_+l*p,x=i*m+s*_+f*p,w=r*y+o*T+c*R,C=a*y+u*T+l*R,P=i*y+s*T+f*R,U=r*A+o*S+c*N,D=a*A+u*S+l*N,L=i*A+s*S+f*N,F=r*M+o*I+c*O+d,z=a*M+u*I+l*O+h,B=i*M+s*I+f*O+E;return n[0]=v,n[1]=g,n[2]=x,n[3]=0,n[4]=w,n[5]=C,n[6]=P,n[7]=0,n[8]=U,n[9]=D,n[10]=L,n[11]=0,n[12]=F,n[13]=z,n[14]=B,n[15]=1,n},f.multiplyByMatrix3=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],d=t[0],h=t[1],E=t[2],m=t[3],_=t[4],p=t[5],y=t[6],T=t[7],R=t[8],A=r*d+o*h+c*E,S=a*d+u*h+l*E,N=i*d+s*h+f*E,M=r*m+o*_+c*p,I=a*m+u*_+l*p,O=i*m+s*_+f*p,v=r*y+o*T+c*R,g=a*y+u*T+l*R,x=i*y+s*T+f*R;return n[0]=A,n[1]=S,n[2]=N,n[3]=0,n[4]=M,n[5]=I,n[6]=O,n[7]=0,n[8]=v,n[9]=g,n[10]=x,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},f.multiplyByTranslation=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=r*e[0]+a*e[4]+i*e[8]+e[12],u=r*e[1]+a*e[5]+i*e[9]+e[13],s=r*e[2]+a*e[6]+i*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=s,n[15]=e[15],n};var p=new e;f.multiplyByUniformScale=function(e,t,n){return p.x=t,p.y=t,p.z=t,f.multiplyByScale(e,p,n)},f.multiplyByScale=function(e,t,n){var r=t.x,a=t.y,i=t.z;return 1===r&&1===a&&1===i?f.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=a*e[4],n[5]=a*e[5],n[6]=a*e[6],n[7]=0,n[8]=i*e[8],n[9]=i*e[9],n[10]=i*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},f.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=t.w,u=e[0]*r+e[4]*a+e[8]*i+e[12]*o,s=e[1]*r+e[5]*a+e[9]*i+e[13]*o,c=e[2]*r+e[6]*a+e[10]*i+e[14]*o,l=e[3]*r+e[7]*a+e[11]*i+e[15]*o;return n.x=u,n.y=s,n.z=c,n.w=l,n},f.multiplyByPointAsVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i,u=e[1]*r+e[5]*a+e[9]*i,s=e[2]*r+e[6]*a+e[10]*i;return n.x=o,n.y=u,n.z=s,n},f.multiplyByPoint=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i+e[12],u=e[1]*r+e[5]*a+e[9]*i+e[13],s=e[2]*r+e[6]*a+e[10]*i+e[14];return n.x=o,n.y=u,n.z=s,n},f.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},f.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},f.transpose=function(e,t){var n=e[1],r=e[2],a=e[3],i=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=o,t[14]=u,t[15]=e[15],t},f.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},f.equals=function(e,t){return e===t||a(e)&&a(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},f.equalsEpsilon=function(e,t,n){return e===t||a(e)&&a(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},f.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},f.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};var y=new c,T=new c,R=new t,A=new t(0,0,0,1);return f.inverse=function(e,n){if(c.equalsEpsilon(f.getRotation(e,y),T,s.EPSILON7)&&t.equals(f.getRow(e,3,R),A))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],a=e[4],i=e[8],o=e[12],u=e[1],d=e[5],h=e[9],E=e[13],m=e[2],_=e[6],p=e[10],S=e[14],N=e[3],M=e[7],I=e[11],O=e[15],v=p*O,g=S*I,x=_*O,w=S*M,C=_*I,P=p*M,U=m*O,D=S*N,L=m*I,F=p*N,z=m*M,B=_*N,b=v*d+w*h+C*E-(g*d+x*h+P*E),q=g*u+U*h+F*E-(v*u+D*h+L*E),G=x*u+D*d+z*E-(w*u+U*d+B*E),W=P*u+L*d+B*h-(C*u+F*d+z*h),X=g*a+x*i+P*o-(v*a+w*i+C*o),V=v*r+D*i+L*o-(g*r+U*i+F*o),H=w*r+U*a+B*o-(x*r+D*a+z*o),Y=C*r+F*a+z*i-(P*r+L*a+B*i);v=i*E,g=o*h,x=a*E,w=o*d,C=a*h,P=i*d,U=r*E,D=o*u,L=r*h,F=i*u,z=r*d,B=a*u;var k=v*M+w*I+C*O-(g*M+x*I+P*O),j=g*N+U*I+F*O-(v*N+D*I+L*O),Z=x*N+D*M+z*O-(w*N+U*M+B*O),K=P*N+L*M+B*I-(C*N+F*M+z*I),J=x*p+P*S+g*_-(C*S+v*_+w*p),Q=L*S+v*m+D*p-(U*p+F*S+g*m),$=U*_+B*S+w*m-(z*S+x*m+D*_),ee=z*p+C*m+F*_-(L*_+B*p+P*m),te=r*b+a*q+i*G+o*W;if(Math.abs(te)<s.EPSILON20)throw new l("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=b*te,n[1]=q*te,n[2]=G*te,n[3]=W*te,n[4]=X*te,n[5]=V*te,n[6]=H*te,n[7]=Y*te,n[8]=k*te,n[9]=j*te,n[10]=Z*te,n[11]=K*te,n[12]=J*te,n[13]=Q*te,n[14]=$*te,n[15]=ee*te,n},f.inverseTransformation=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],f=e[12],d=e[13],h=e[14],E=-n*f-r*d-a*h,m=-i*f-o*d-u*h,_=-s*f-c*d-l*h;return t[0]=n,t[1]=i,t[2]=s,t[3]=0,t[4]=r,t[5]=o,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=l,t[11]=0,t[12]=E,t[13]=m,t[14]=_,t[15]=1,t},f.IDENTITY=u(new f(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),f.ZERO=u(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,i(f.prototype,{length:{get:function(){return f.packedLength}}}),f.prototype.clone=function(e){return f.clone(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},f.prototype.equalsEpsilon=function(e,t){return f.equalsEpsilon(this,e,t)},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/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(e,t,r,a){this.west=n(e,0),this.south=n(t,0),this.east=n(r,0),this.north=n(a,0)}a(c.prototype,{width:{get:function(){return c.computeWidth(this)}},height:{get:function(){return c.computeHeight(this)}}}),c.packedLength=4,c.pack=function(e,t,r){return r=n(r,0),t[r++]=e.west,t[r++]=e.south,t[r++]=e.east,t[r]=e.north,t},c.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new c),a.west=e[t++],a.south=e[t++],a.east=e[t++],a.north=e[t],a},c.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=s.TWO_PI),t-n},c.computeHeight=function(e){return e.north-e.south},c.fromDegrees=function(e,t,a,i,o){return e=s.toRadians(n(e,0)),t=s.toRadians(n(t,0)),a=s.toRadians(n(a,0)),i=s.toRadians(n(i,0)),r(o)?(o.west=e,o.south=t,o.east=a,o.north=i,o):new c(e,t,a,i)},c.fromRadians=function(e,t,a,i,o){return r(o)?(o.west=n(e,0),o.south=n(t,0),o.east=n(a,0),o.north=n(i,0),o):new c(e,t,a,i)},c.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,u=Number.MAX_VALUE,l=-Number.MAX_VALUE,f=0,d=e.length;f<d;f++){var h=e[f];n=Math.min(n,h.longitude),a=Math.max(a,h.longitude),u=Math.min(u,h.latitude),l=Math.max(l,h.latitude);var E=h.longitude>=0?h.longitude:h.longitude+s.TWO_PI;i=Math.min(i,E),o=Math.max(o,E)}return a-n>o-i&&(n=i,a=o,a>s.PI&&(a-=s.TWO_PI),n>s.PI&&(n-=s.TWO_PI)),r(t)?(t.west=n,t.south=u,t.east=a,t.north=l,t):new c(n,u,a,l)},c.fromCartesianArray=function(e,t,n){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,u=-Number.MAX_VALUE,l=Number.MAX_VALUE,f=-Number.MAX_VALUE,d=0,h=e.length;d<h;d++){var E=t.cartesianToCartographic(e[d]);a=Math.min(a,E.longitude),i=Math.max(i,E.longitude),l=Math.min(l,E.latitude),f=Math.max(f,E.latitude);var m=E.longitude>=0?E.longitude:E.longitude+s.TWO_PI;o=Math.min(o,m),u=Math.max(u,m)}return i-a>u-o&&(a=o,i=u,i>s.PI&&(i-=s.TWO_PI),a>s.PI&&(a-=s.TWO_PI)),r(n)?(n.west=a,n.south=l,n.east=i,n.north=f,n):new c(a,l,i,f)},c.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new c(e.west,e.south,e.east,e.north)},c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.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},c.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},c.validate=function(e){},c.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)},c.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)},c.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)},c.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)},c.center=function(t,n){var a=t.east,i=t.west;a<i&&(a+=s.TWO_PI);var o=s.negativePiToPi(.5*(i+a)),u=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=u,n.height=0,n):new e(o,u)},c.intersection=function(e,t,n){var a=e.east,i=e.west,o=t.east,u=t.west;a<i&&o>0?a+=s.TWO_PI:o<u&&a>0&&(o+=s.TWO_PI),a<i&&u<0?u+=s.TWO_PI:o<u&&i<0&&(i+=s.TWO_PI);var l=s.negativePiToPi(Math.max(i,u)),f=s.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&f<=l)){var d=Math.max(e.south,t.south),h=Math.min(e.north,t.north);if(!(d>=h))return r(n)?(n.west=l,n.south=d,n.east=f,n.north=h,n):new c(l,d,f,h)}},c.simpleIntersection=function(e,t,n){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(i>=u||a>=o))return r(n)?(n.west=a,n.south=i,n.east=o,n.north=u,n):new c(a,i,o,u)},c.union=function(e,t,n){r(n)||(n=new c);var a=e.east,i=e.west,o=t.east,u=t.west;a<i&&o>0?a+=s.TWO_PI:o<u&&a>0&&(o+=s.TWO_PI),a<i&&u<0?u+=s.TWO_PI:o<u&&i<0&&(i+=s.TWO_PI);var l=s.convertLongitudeRange(Math.min(i,u)),f=s.convertLongitudeRange(Math.max(a,o));return n.west=l,n.south=Math.min(e.south,t.south),n.east=f,n.north=Math.max(e.north,t.north),n},c.expand=function(e,t,n){return r(n)||(n=new c),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},c.contains=function(e,t){var n=t.longitude,r=t.latitude,a=e.west,i=e.east;return i<a&&(i+=s.TWO_PI,n<0&&(n+=s.TWO_PI)),(n>a||s.equalsEpsilon(n,a,s.EPSILON14))&&(n<i||s.equalsEpsilon(n,i,s.EPSILON14))&&r>=e.south&&r<=e.north};var l=new e;return c.subsample=function(e,t,a,i){t=n(t,o.WGS84),a=n(a,0),r(i)||(i=[]);var u=0,f=e.north,d=e.south,h=e.east,E=e.west,m=l;m.height=a,m.longitude=E,m.latitude=f,i[u]=t.cartographicToCartesian(m,i[u]),u++,m.longitude=h,i[u]=t.cartographicToCartesian(m,i[u]),u++,m.latitude=d,i[u]=t.cartographicToCartesian(m,i[u]),u++,m.longitude=E,i[u]=t.cartographicToCartesian(m,i[u]),u++,f<0?m.latitude=f:d>0?m.latitude=d:m.latitude=0;for(var _=1;_<8;++_)m.longitude=-Math.PI+_*s.PI_OVER_TWO,c.contains(e,m)&&(i[u]=t.cartographicToCartesian(m,i[u]),u++);return 0===m.latitude&&(m.longitude=E,i[u]=t.cartographicToCartesian(m,i[u]),u++,m.longitude=h,i[u]=t.cartographicToCartesian(m,i[u]),u++),i.length=u,i},c.MAX_VALUE=u(new c(-Math.PI,-s.PI_OVER_TWO,Math.PI,s.PI_OVER_TWO)),c}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function d(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var h=new e,E=new e,m=new e,_=new e,p=new e,y=new e,T=new e,R=new e,A=new e,S=new e,N=new e,M=new e;d.fromPoints=function(t,n){if(a(n)||(n=new d),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var r=e.clone(t[0],T),i=e.clone(r,h),o=e.clone(r,E),u=e.clone(r,m),s=e.clone(r,_),c=e.clone(r,p),l=e.clone(r,y),f=t.length,I=1;I<f;I++){e.clone(t[I],r);var O=r.x,v=r.y,g=r.z;O<i.x&&e.clone(r,i),O>s.x&&e.clone(r,s),v<o.y&&e.clone(r,o),v>c.y&&e.clone(r,c),g<u.z&&e.clone(r,u),g>l.z&&e.clone(r,l)}var x=e.magnitudeSquared(e.subtract(s,i,R)),w=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=i,U=s,D=x;w>D&&(D=w,P=o,U=c),C>D&&(D=C,P=u,U=l);var L=A;L.x=.5*(P.x+U.x),L.y=.5*(P.y+U.y),L.z=.5*(P.z+U.z);var F=e.magnitudeSquared(e.subtract(U,L,R)),z=Math.sqrt(F),B=S;B.x=i.x,B.y=o.y,B.z=u.z;var b=N;b.x=s.x,b.y=c.y,b.z=l.z;var q=e.multiplyByScalar(e.add(B,b,R),.5,M),G=0;for(I=0;I<f;I++){e.clone(t[I],r);var W=e.magnitude(e.subtract(r,q,R));W>G&&(G=W);var X=e.magnitudeSquared(e.subtract(r,L,R));if(X>F){var V=Math.sqrt(X);z=.5*(z+V),F=z*z;var H=V-z;L.x=(z*L.x+H*r.x)/V,L.y=(z*L.y+H*r.y)/V,L.z=(z*L.z+H*r.z)/V}}return z<G?(e.clone(L,n.center),n.radius=z):(e.clone(q,n.center),n.radius=G),n};var I=new o,O=new e,v=new e,g=new t,x=new t;d.fromRectangle2D=function(e,t,n){return d.fromRectangleWithHeights2D(e,t,0,0,n)},d.fromRectangleWithHeights2D=function(t,n,i,o,u){if(a(u)||(u=new d),!a(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;n=r(n,I),f.southwest(t,g),g.height=i,f.northeast(t,x),x.height=o;var s=n.project(g,O),c=n.project(x,v),l=c.x-s.x,h=c.y-s.y,E=c.z-s.z;u.radius=.5*Math.sqrt(l*l+h*h+E*E);var m=u.center;return m.x=s.x+.5*l,m.y=s.y+.5*h,m.z=s.z+.5*E,u};var w=[];d.fromRectangle3D=function(e,t,n,o){t=r(t,i.WGS84),n=r(n,0);var u;return a(e)&&(u=f.subsample(e,t,n,w)),d.fromPoints(u,o)},d.fromVertices=function(t,n,i,o){if(a(o)||(o=new d),!a(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;n=r(n,e.ZERO),i=r(i,3);var u=T;u.x=t[0]+n.x,u.y=t[1]+n.y,u.z=t[2]+n.z;for(var s=e.clone(u,h),c=e.clone(u,E),l=e.clone(u,m),f=e.clone(u,_),I=e.clone(u,p),O=e.clone(u,y),v=t.length,g=0;g<v;g+=i){var x=t[g]+n.x,w=t[g+1]+n.y,C=t[g+2]+n.z;u.x=x,u.y=w,u.z=C,x<s.x&&e.clone(u,s),x>f.x&&e.clone(u,f),w<c.y&&e.clone(u,c),w>I.y&&e.clone(u,I),C<l.z&&e.clone(u,l),C>O.z&&e.clone(u,O)}var P=e.magnitudeSquared(e.subtract(f,s,R)),U=e.magnitudeSquared(e.subtract(I,c,R)),D=e.magnitudeSquared(e.subtract(O,l,R)),L=s,F=f,z=P;U>z&&(z=U,L=c,F=I),D>z&&(z=D,L=l,F=O);var B=A;B.x=.5*(L.x+F.x),B.y=.5*(L.y+F.y),B.z=.5*(L.z+F.z);var b=e.magnitudeSquared(e.subtract(F,B,R)),q=Math.sqrt(b),G=S;G.x=s.x,G.y=c.y,G.z=l.z;var W=N;W.x=f.x,W.y=I.y,W.z=O.z;var X=e.multiplyByScalar(e.add(G,W,R),.5,M),V=0;for(g=0;g<v;g+=i){u.x=t[g]+n.x,u.y=t[g+1]+n.y,u.z=t[g+2]+n.z;var H=e.magnitude(e.subtract(u,X,R));H>V&&(V=H);var Y=e.magnitudeSquared(e.subtract(u,B,R));if(Y>b){var k=Math.sqrt(Y);q=.5*(q+k),b=q*q;var j=k-q;B.x=(q*B.x+j*u.x)/k,B.y=(q*B.y+j*u.y)/k,B.z=(q*B.z+j*u.z)/k}}return q<V?(e.clone(B,o.center),o.radius=q):(e.clone(X,o.center),o.radius=V),o},d.fromEncodedCartesianVertices=function(t,n,r){if(a(r)||(r=new d),!a(t)||!a(n)||t.length!==n.length||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var i=T;i.x=t[0]+n[0],i.y=t[1]+n[1],i.z=t[2]+n[2];for(var o=e.clone(i,h),u=e.clone(i,E),s=e.clone(i,m),c=e.clone(i,_),l=e.clone(i,p),f=e.clone(i,y),I=t.length,O=0;O<I;O+=3){var v=t[O]+n[O],g=t[O+1]+n[O+1],x=t[O+2]+n[O+2];i.x=v,i.y=g,i.z=x,v<o.x&&e.clone(i,o),v>c.x&&e.clone(i,c),g<u.y&&e.clone(i,u),g>l.y&&e.clone(i,l),x<s.z&&e.clone(i,s),x>f.z&&e.clone(i,f)}var w=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=e.magnitudeSquared(e.subtract(f,s,R)),U=o,D=c,L=w;C>L&&(L=C,U=u,D=l),P>L&&(L=P,U=s,D=f);var F=A;F.x=.5*(U.x+D.x),F.y=.5*(U.y+D.y),F.z=.5*(U.z+D.z);var z=e.magnitudeSquared(e.subtract(D,F,R)),B=Math.sqrt(z),b=S;b.x=o.x,b.y=u.y,b.z=s.z;var q=N;q.x=c.x,q.y=l.y,q.z=f.z;var G=e.multiplyByScalar(e.add(b,q,R),.5,M),W=0;for(O=0;O<I;O+=3){i.x=t[O]+n[O],i.y=t[O+1]+n[O+1],i.z=t[O+2]+n[O+2];var X=e.magnitude(e.subtract(i,G,R));X>W&&(W=X);var V=e.magnitudeSquared(e.subtract(i,F,R));if(V>z){var H=Math.sqrt(V);B=.5*(B+H),z=B*B;var Y=H-B;F.x=(B*F.x+Y*i.x)/H,F.y=(B*F.y+Y*i.y)/H,F.z=(B*F.z+Y*i.z)/H}}return B<W?(e.clone(F,r.center),r.radius=B):(e.clone(G,r.center),r.radius=W),r},d.fromCornerPoints=function(t,n,r){a(r)||(r=new d);var i=r.center;return e.add(t,n,i),e.multiplyByScalar(i,.5,i),r.radius=e.distance(i,n),r},d.fromEllipsoid=function(t,n){return a(n)||(n=new d),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var C=new e;d.fromBoundingSpheres=function(t,n){if(a(n)||(n=new d),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var r=t.length;if(1===r)return d.clone(t[0],n);if(2===r)return d.union(t[0],t[1],n);for(var i=[],o=0;o<r;o++)i.push(t[o].center);n=d.fromPoints(i,n);var u=n.center,s=n.radius;for(o=0;o<r;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,C)+c.radius)}return n.radius=s,n};var P=new e,U=new e,D=new e;d.fromOrientedBoundingBox=function(t,n){a(n)||(n=new d);var r=t.halfAxes,i=c.getColumn(r,0,P),o=c.getColumn(r,1,U),u=c.getColumn(r,2,D),s=e.magnitude(i),l=e.magnitude(o),f=e.magnitude(u);return n.center=e.clone(t.center,n.center),n.radius=Math.max(s,l,f),n},d.clone=function(t,n){if(a(t))return a(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new d(t.center,t.radius)},d.packedLength=4,d.pack=function(e,t,n){n=r(n,0);var a=e.center;return t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n]=e.radius,t},d.unpack=function(e,t,n){t=r(t,0),a(n)||(n=new d);var i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};var L=new e,F=new e;d.union=function(t,n,r){a(r)||(r=new d);var i=t.center,o=t.radius,u=n.center,s=n.radius,c=e.subtract(u,i,L),l=e.magnitude(c);if(o>=l+s)return t.clone(r),r;if(s>=l+o)return n.clone(r),r;var f=.5*(o+l+s),h=e.multiplyByScalar(c,(-o+f)/l,F);return e.add(h,i,h),e.clone(h,r.center),r.radius=f,r};var z=new e;d.expand=function(t,n,r){r=d.clone(t,r);var a=e.magnitude(e.subtract(n,r.center,z));return a>r.radius&&(r.radius=a),r},d.intersectPlane=function(t,n){var r=t.center,a=t.radius,i=n.normal,o=e.dot(i,r)+n.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},d.transform=function(e,t,n){return a(n)||(n=new d),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=l.getMaximumScale(t)*e.radius,n};var B=new e;d.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,B);return e.magnitudeSquared(r)-t.radius*t.radius},d.transformWithoutScale=function(e,t,n){return a(n)||(n=new d),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var b=new e;d.computePlaneDistances=function(t,n,r,i){a(i)||(i=new s);var o=e.subtract(t.center,n,b),u=e.dot(r,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var q=new e,G=new e,W=new e,X=new e,V=new e,H=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var j=new o;return d.projectTo2D=function(t,n,a){n=r(n,j);var i=n.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,q),c=e.cross(e.UNIT_Z,s,G);e.normalize(c,c);var l=e.cross(s,c,W);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var f=e.negate(l,V),h=e.negate(c,X),E=Y,m=E[0];e.add(s,l,m),e.add(m,c,m),m=E[1],e.add(s,l,m),e.add(m,h,m),m=E[2],e.add(s,f,m),e.add(m,h,m),m=E[3],e.add(s,f,m),e.add(m,c,m),e.negate(s,s),m=E[4],e.add(s,l,m),e.add(m,c,m),m=E[5],e.add(s,l,m),e.add(m,h,m),m=E[6],e.add(s,f,m),e.add(m,h,m),m=E[7],e.add(s,f,m),e.add(m,c,m);for(var _=E.length,p=0;p<_;++p){var y=E[p];e.add(o,y,y);var T=i.cartesianToCartographic(y,H);n.project(T,y)}a=d.fromPoints(E,a),o=a.center;var R=o.x,A=o.y,S=o.z;return o.x=S,o.y=R,o.z=A,a},d.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},d.equals=function(t,n){return t===n||a(t)&&a(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},d.prototype.intersectPlane=function(e){return d.intersectPlane(this,e)},d.prototype.distanceSquaredTo=function(e){return d.distanceSquaredTo(this,e)},d.prototype.computePlaneDistances=function(e,t,n){return d.computePlaneDistances(this,e,t,n)},d.prototype.isOccluded=function(e){return d.isOccluded(this,e)},d.prototype.equals=function(e){return d.equals(this,e)},d.prototype.clone=function(e){return d.clone(this,e)},d}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n){this.x=t(e,0),this.y=t(n,0)}o.fromElements=function(e,t,r){return n(r)?(r.x=e,r.y=t,r):new o(e,t)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t):new o(e.x,e.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r]=e.y,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=2*r:t=new Array(2*r);for(var a=0;a<r;++a)o.pack(e[a],t,2*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/2:t=new Array(r/2);for(var a=0;a<r;a+=2){var i=a/2;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y)},o.minimumComponent=function(e){return Math.min(e.x,e.y)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x, +n.y=e.y*t.y,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){return o.normalize(e,c),o.normalize(t,l),i.acosClamped(o.dot(c,l))};var f=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)},o.ZERO=a(new o(0,0)),o.UNIT_X=a(new o(1,0)),o.UNIT_Y=a(new o(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,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/EllipsoidalOccluder",["./BoundingSphere","./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./Rectangle"],function(e,t,n,r,a,i,o){"use strict";function u(e,n){this._ellipsoid=e,this._cameraPosition=new t,this._cameraPositionInScaledSpace=new t,this._distanceToLimbInScaledSpaceSquared=0,r(n)&&(this.cameraPosition=n)}function s(e,n,r){var a=e.transformPositionToScaledSpace(n,E),i=t.magnitudeSquared(a),o=Math.sqrt(i),u=t.divideByScalar(a,o,m);i=Math.max(1,i),o=Math.max(1,o);var s=t.dot(u,r),c=t.magnitude(t.cross(u,r,u)),l=1/o,f=Math.sqrt(i-1)*l;return 1/(s*l-c*f)}function c(e,n,r){if(!(n<=0||n===1/0||n!==n))return t.multiplyByScalar(e,n,r)}function l(e,n){return t.equals(n,t.ZERO)?n:(e.transformPositionToScaledSpace(n,_),t.normalize(_,_))}a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(e){var n=this._ellipsoid,r=n.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),a=t.magnitudeSquared(r)-1;t.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=r,this._distanceToLimbInScaledSpaceSquared=a}}});var f=new t;u.prototype.isPointVisible=function(e){var t=this._ellipsoid,n=t.transformPositionToScaledSpace(e,f);return this.isScaledSpacePointVisible(n)},u.prototype.isScaledSpacePointVisible=function(e){var n=this._cameraPositionInScaledSpace,r=this._distanceToLimbInScaledSpaceSquared,a=t.subtract(e,n,f),i=-t.dot(a,n),o=r<0?i>0:i>r&&i*i/t.magnitudeSquared(a)>r;return!o},u.prototype.computeHorizonCullingPoint=function(e,n,a){r(a)||(a=new t);for(var i=this._ellipsoid,o=l(i,e),u=0,f=0,d=n.length;f<d;++f){var h=n[f],E=s(i,h,o);u=Math.max(u,E)}return c(o,u,a)};var d=new t;u.prototype.computeHorizonCullingPointFromVertices=function(e,a,i,o,u){r(u)||(u=new t),o=n(o,t.ZERO);for(var f=this._ellipsoid,h=l(f,e),E=0,m=0,_=a.length;m<_;m+=i){d.x=a[m]+o.x,d.y=a[m+1]+o.y,d.z=a[m+2]+o.z;var p=s(f,d,h);E=Math.max(E,p)}return c(h,E,u)};var h=[];u.prototype.computeHorizonCullingPointFromRectangle=function(n,r,a){var i=o.subsample(n,r,0,h),u=e.fromPoints(i);if(!(t.magnitude(u.center)<.1*r.minimumRadius))return this.computeHorizonCullingPoint(u.center,i,a)};var E=new t,m=new t,_=new t;return u}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function n(e,n,r){var a=e+n;return t.sign(e)!==t.sign(n)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(n)))<r?0:a}var r={};return r.computeDiscriminant=function(e,t,n){var r=t*t-4*e*n;return r},r.computeRealRoots=function(e,r,a){var i;if(0===e)return 0===r?[]:[-a/r];if(0===r){if(0===a)return[0,0];var o=Math.abs(a),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,i<0)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-r/e,i<0?[i,0]:[0,i];var c=r*r,l=4*e*a,f=n(c,-l,t.EPSILON14);if(f<0)return[];var d=-.5*n(r,t.sign(r)*Math.sqrt(f),t.EPSILON14);return r>0?[d/e,a/d]:[a/d,d/e]},r}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function n(e,t,n,r){var a,i,o=e,u=t/3,s=n/3,c=r,l=o*s,f=u*c,d=u*u,h=s*s,E=o*s-d,m=o*c-u*s,_=u*c-h,p=4*E*_-m*m;if(p<0){var y,T,R;d*f>=l*h?(y=o,T=E,R=-2*u*E+o*m):(y=c,T=_,R=-c*m+2*s*_);var A=R<0?-1:1,S=-A*Math.abs(y)*Math.sqrt(-p);i=-R+S;var N=i/2,M=N<0?-Math.pow(-N,1/3):Math.pow(N,1/3),I=i===S?-M:-T/M;return a=T<=0?M+I:-R/(M*M+I*I+T),d*f>=l*h?[(a-u)/o]:[-c/(a+s)]}var O=E,v=-2*u*E+o*m,g=_,x=-c*m+2*s*_,w=Math.sqrt(p),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*w,-v)/3);a=2*Math.sqrt(-O);var U=Math.cos(P);i=a*U;var D=a*(-U/2-C*Math.sin(P)),L=i+D>2*u?i-u:D-u,F=o,z=L/F;P=Math.abs(Math.atan2(c*w,-x)/3),a=2*Math.sqrt(-g),U=Math.cos(P),i=a*U,D=a*(-U/2-C*Math.sin(P));var B=-c,b=i+D<2*s?i+s:D+s,q=B/b,G=F*b,W=-L*b-F*B,X=L*B,V=(s*W-u*X)/(-u*W+s*G);return z<=V?z<=q?V<=q?[z,V,q]:[z,q,V]:[q,z,V]:z<=q?[V,z,q]:V<=q?[V,q,z]:[q,V,z]}var r={};return r.computeDiscriminant=function(e,t,n,r){var a=e*e,i=t*t,o=n*n,u=r*r,s=18*e*t*n*r+i*o-27*a*u-4*(e*o*n+i*t*r);return s},r.computeRealRoots=function(e,r,a,i){var o,u;if(0===e)return t.computeRealRoots(r,a,i);if(0===r){if(0===a){if(0===i)return[0,0,0];u=-i/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===i?(o=t.computeRealRoots(e,0,a),0===o.Length?[0]:[o[0],0,o[1]]):n(e,0,a,i)}return 0===a?0===i?(u=-r/e,u<0?[u,0,0]:[0,0,u]):n(e,r,0,i):0===i?(o=t.computeRealRoots(e,r,a),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):n(e,r,a,i)},r}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,n,r){"use strict";function a(t,a,i,o){var u=t*t,s=a-3*u/8,c=i-a*t/2+u*t/8,l=o-i*t/4+a*u/16-3*u*u/256,f=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(f.length>0){var d=-t/4,h=f[f.length-1];if(Math.abs(h)<n.EPSILON14){var E=r.computeRealRoots(1,s,l);if(2===E.length){var m,_=E[0],p=E[1];if(_>=0&&p>=0){var y=Math.sqrt(_),T=Math.sqrt(p);return[d-T,d-y,d+y,d+T]}if(_>=0&&p<0)return m=Math.sqrt(_),[d-m,d+m];if(_<0&&p>=0)return m=Math.sqrt(p),[d-m,d+m]}return[]}if(h>0){var R=Math.sqrt(h),A=(s+h-c/R)/2,S=(s+h+c/R)/2,N=r.computeRealRoots(1,R,A),M=r.computeRealRoots(1,-R,S);return 0!==N.length?(N[0]+=d,N[1]+=d,0!==M.length?(M[0]+=d,M[1]+=d,N[1]<=M[0]?[N[0],N[1],M[0],M[1]]:M[1]<=N[0]?[M[0],M[1],N[0],N[1]]:N[0]>=M[0]&&N[1]<=M[1]?[M[0],N[0],N[1],M[1]]:M[0]>=N[0]&&M[1]<=N[1]?[N[0],M[0],M[1],N[1]]:N[0]>M[0]&&N[0]<M[1]?[M[0],N[0],M[1],N[1]]:[N[0],M[0],N[1],M[1]]):N):0!==M.length?(M[0]+=d,M[1]+=d,M):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,f=i*t+s-4*o,d=c*o-i*a*t+u,h=e.computeRealRoots(1,l,f,d);if(h.length>0){var E,m,_=h[0],p=a-_,y=p*p,T=t/2,R=p/2,A=y-4*o,S=y+4*Math.abs(o),N=c-4*_,M=c+4*Math.abs(_);if(_<0||A*M<N*S){var I=Math.sqrt(N);E=I/2,m=0===I?0:(t*R-i)/I}else{var O=Math.sqrt(A);E=0===O?0:(t*R-i)/O,m=O/2}var v,g;0===T&&0===E?(v=0,g=0):n.sign(T)===n.sign(E)?(v=T+E,g=_/v):(g=T-E,v=_/g);var x,w;0===R&&0===m?(x=0,w=0):n.sign(R)===n.sign(m)?(x=R+m,w=o/x):(w=R-m,x=o/w);var C=r.computeRealRoots(1,v,x),P=r.computeRealRoots(1,g,w);if(0!==C.length)return 0!==P.length?C[1]<=P[0]?[C[0],C[1],P[0],P[1]]:P[1]<=C[0]?[P[0],P[1],C[0],C[1]]:C[0]>=P[0]&&C[1]<=P[1]?[P[0],C[0],C[1],P[1]]:P[0]>=C[0]&&P[1]<=C[1]?[C[0],P[0],P[1],C[1]]:C[0]>P[0]&&C[0]<P[1]?[P[0],C[0],P[1],C[1]]:[C[0],P[0],C[1],P[1]]:C;if(0!==P.length)return P}return[]}var o={};return o.computeDiscriminant=function(e,t,n,r,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=n*n,l=c*n,f=r*r,d=f*r,h=a*a,E=h*a,m=u*c*f-4*s*d-4*e*l*f+18*e*t*n*d-27*i*f*f+256*o*E+a*(18*s*n*r-4*u*l+16*e*c*c-80*e*t*c*r-6*e*u*f+144*i*n*f)+h*(144*e*u*n-27*u*u-128*i*c-192*i*t*r);return m},o.computeRealRoots=function(t,r,o,u,s){if(Math.abs(t)<n.EPSILON15)return e.computeRealRoots(r,o,u,s);var c=r/t,l=o/t,f=u/t,d=s/t,h=c<0?1:0;switch(h+=l<0?h+1:h,h+=f<0?h+1:h,h+=d<0?h+1:h){case 0:return a(c,l,f,d);case 1:return i(c,l,f,d);case 2:return i(c,l,f,d);case 3:return a(c,l,f,d);case 4:return a(c,l,f,d);case 5:return i(c,l,f,d);case 6:return a(c,l,f,d);case 7:return a(c,l,f,d);case 8:return i(c,l,f,d);case 9:return a(c,l,f,d);case 10:return a(c,l,f,d);case 11:return i(c,l,f,d);case 12:return a(c,l,f,d);case 13:return a(c,l,f,d);case 14:return a(c,l,f,d);case 15:return a(c,l,f,d);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=e.clone(t(r,e.ZERO)),e.equals(r,e.ZERO)||e.normalize(r,r),this.origin=e.clone(t(n,e.ZERO)),this.direction=r}return a.getPoint=function(t,r,a){return n(a)||(a=new e),a=e.multiplyByScalar(t.direction,r,a),e.add(t.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,n,r,a,i,o,u,s,c,l){"use strict";function f(e,t,n,r){var a=t*t-4*e*n;if(!(a<0)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return u<s?(r.root0=u,r.root1=s):(r.root0=s,r.root1=u),r}var c=-t/(2*e);if(0!==c)return r.root0=r.root1=c,r}}function d(t,n,a){r(a)||(a=new i);var o=t.origin,u=t.direction,s=n.center,c=n.radius*n.radius,l=e.subtract(o,s,y),d=e.dot(u,u),h=2*e.dot(u,l),E=e.magnitudeSquared(l)-c,m=f(d,h,E,S);if(r(m))return a.start=m.root0,a.stop=m.root1,a}function h(e,t,n){var r=e+t;return o.sign(e)!==o.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))<n?0:r}function E(t,n,r,a,i){var l,f=a*a,d=i*i,E=(t[u.COLUMN1ROW1]-t[u.COLUMN2ROW2])*d,m=i*(a*h(t[u.COLUMN1ROW0],t[u.COLUMN0ROW1],o.EPSILON15)+n.y),_=t[u.COLUMN0ROW0]*f+t[u.COLUMN2ROW2]*d+a*n.x+r,p=d*h(t[u.COLUMN2ROW1],t[u.COLUMN1ROW2],o.EPSILON15),y=i*(a*h(t[u.COLUMN2ROW0],t[u.COLUMN0ROW2])+n.z),T=[];if(0===y&&0===p){if(l=s.computeRealRoots(E,m,_),0===l.length)return T;var R=l[0],A=Math.sqrt(Math.max(1-R*R,0));if(T.push(new e(a,i*R,i*-A)),T.push(new e(a,i*R,i*A)),2===l.length){var S=l[1],N=Math.sqrt(Math.max(1-S*S,0));T.push(new e(a,i*S,i*-N)),T.push(new e(a,i*S,i*N))}return T}var M=y*y,I=p*p,O=E*E,v=y*p,g=O+I,x=2*(m*E+v),w=2*_*E+m*m-I+M,C=2*(_*m-v),P=_*_-M;if(0===g&&0===x&&0===w&&0===C)return T;l=c.computeRealRoots(g,x,w,C,P);var U=l.length;if(0===U)return T;for(var D=0;D<U;++D){var L,F=l[D],z=F*F,B=Math.max(1-z,0),b=Math.sqrt(B);L=o.sign(E)===o.sign(_)?h(E*z+_,m*F,o.EPSILON12):o.sign(_)===o.sign(m*F)?h(E*z,m*F+_,o.EPSILON12):h(E*z+m*F,_,o.EPSILON12);var q=h(p*F,y,o.EPSILON15),G=L*q;G<0?T.push(new e(a,i*F,i*b)):G>0?T.push(new e(a,i*F,i*-b)):0!==b?(T.push(new e(a,i*F,i*-b)),T.push(new e(a,i*F,i*b)),++D):T.push(new e(a,i*F,i*b))}return T}var m={};m.rayPlane=function(t,n,a){r(a)||(a=new e);var i=t.origin,u=t.direction,s=n.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON15)){var l=(-n.distance-e.dot(s,i))/c;if(!(l<0))return a=e.multiplyByScalar(u,l,a),e.add(i,a,a)}};var _=new e,p=new e,y=new e,T=new e,R=new e;m.rayTriangleParametric=function(t,r,a,i,u){u=n(u,!1);var s,c,l,f,d,h=t.origin,E=t.direction,m=e.subtract(a,r,_),A=e.subtract(i,r,p),S=e.cross(E,A,y),N=e.dot(m,S);if(u){if(N<o.EPSILON6)return;if(s=e.subtract(h,r,T),l=e.dot(s,S),l<0||l>N)return;if(c=e.cross(s,m,R),f=e.dot(E,c),f<0||l+f>N)return;d=e.dot(A,c)/N}else{if(Math.abs(N)<o.EPSILON6)return;var M=1/N;if(s=e.subtract(h,r,T),l=e.dot(s,S)*M,l<0||l>1)return;if(c=e.cross(s,m,R),f=e.dot(E,c)*M,f<0||l+f>1)return;d=e.dot(A,c)*M}return d},m.rayTriangle=function(t,n,a,i,o,u){var s=m.rayTriangleParametric(t,n,a,i,o);if(r(s)&&!(s<0))return r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var A=new l;m.lineSegmentTriangle=function(t,n,a,i,o,u,s){var c=A;e.clone(t,c.origin),e.subtract(n,t,c.direction),e.normalize(c.direction,c.direction);var l=m.rayTriangleParametric(c,a,i,o,u);if(!(!r(l)||l<0||l>e.distance(t,n)))return r(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var S={root0:0,root1:0};m.raySphere=function(e,t,n){if(n=d(e,t,n),r(n)&&!(n.stop<0))return n.start=Math.max(n.start,0),n};var N=new l;m.lineSegmentSphere=function(t,n,a,i){var o=N;e.clone(t,o.origin);var u=e.subtract(n,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),i=d(o,a,i),!(!r(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var M=new e,I=new e;m.rayEllipsoid=function(t,n){var r,a,o,u,s,c=n.oneOverRadii,l=e.multiplyComponents(c,t.origin,M),f=e.multiplyComponents(c,t.direction,I),d=e.magnitudeSquared(l),h=e.dot(l,f);if(d>1){if(h>=0)return;var E=h*h;if(r=d-1,a=e.magnitudeSquared(f),o=a*r,E<o)return;if(E>o){u=h*h-o,s=-h+Math.sqrt(u);var m=s/a,_=r/s;return m<_?new i(m,_):{start:_,stop:m}}var p=Math.sqrt(r/a);return new i(p,p)}return d<1?(r=d-1,a=e.magnitudeSquared(f),o=a*r,u=h*h-o,s=-h+Math.sqrt(u),new i(0,s/a)):h<0?(a=e.magnitudeSquared(f),new i(0,-h/a)):void 0};var O=new e,v=new e,g=new e,x=new e,w=new e,C=new u,P=new u,U=new u,D=new u,L=new u,F=new u,z=new u,B=new e,b=new e,q=new t;m.grazingAltitudeLocation=function(t,n){var a=t.origin,i=t.direction;if(!e.equals(a,e.ZERO)){var s=n.geodeticSurfaceNormal(a,O);if(e.dot(i,s)>=0)return a}var c=r(this.rayEllipsoid(t,n)),l=n.transformPositionToScaledSpace(i,O),f=e.normalize(l,l),d=e.mostOrthogonalAxis(l,x),h=e.normalize(e.cross(d,f,v),v),m=e.normalize(e.cross(f,h,g),g),_=C;_[0]=f.x,_[1]=f.y,_[2]=f.z,_[3]=h.x,_[4]=h.y,_[5]=h.z,_[6]=m.x,_[7]=m.y,_[8]=m.z;var p=u.transpose(_,P),y=u.fromScale(n.radii,U),T=u.fromScale(n.oneOverRadii,D),R=L;R[0]=0,R[1]=-i.z,R[2]=i.y,R[3]=i.z,R[4]=0,R[5]=-i.x,R[6]=-i.y,R[7]=i.x,R[8]=0;var A,S,N=u.multiply(u.multiply(p,T,F),R,F),M=u.multiply(u.multiply(N,y,z),_,z),I=u.multiplyByVector(N,a,w),G=E(M,e.negate(I,O),0,0,1),W=G.length;if(W>0){for(var X=e.clone(e.ZERO,b),V=Number.NEGATIVE_INFINITY,H=0;H<W;++H){A=u.multiplyByVector(y,u.multiplyByVector(_,G[H],B),B);var Y=e.normalize(e.subtract(A,a,x),x),k=e.dot(Y,i);k>V&&(V=k,X=e.clone(A,X))}var j=n.cartesianToCartographic(X,q);return V=o.clamp(V,0,1),S=e.magnitude(e.subtract(X,a,x))*Math.sqrt(1-V*V),S=c?-S:S,j.height=S,n.cartographicToCartesian(j,new e)}};var G=new e;return m.lineSegmentPlane=function(t,n,a,i){r(i)||(i=new e);var u=e.subtract(n,t,G),s=a.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON6)){var l=e.dot(s,t),f=-(a.distance+l)/c;if(!(f<0||f>1))return e.multiplyByScalar(u,f,i),e.add(t,i,i),i}},m.trianglePlaneIntersection=function(t,n,r,a){var i=a.normal,o=a.distance,u=e.dot(i,t)+o<0,s=e.dot(i,n)+o<0,c=e.dot(i,r)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var f,d;if(1!==l&&2!==l||(f=new e,d=new e),1===l){if(u)return m.lineSegmentPlane(t,n,a,f),m.lineSegmentPlane(t,r,a,d),{positions:[t,n,r,f,d],indices:[0,3,4,1,2,4,1,4,3]};if(s)return m.lineSegmentPlane(n,r,a,f),m.lineSegmentPlane(n,t,a,d),{positions:[t,n,r,f,d],indices:[1,3,4,2,0,4,2,4,3]};if(c)return m.lineSegmentPlane(r,t,a,f),m.lineSegmentPlane(r,n,a,d),{positions:[t,n,r,f,d],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return m.lineSegmentPlane(n,t,a,f),m.lineSegmentPlane(r,t,a,d),{positions:[t,n,r,f,d],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return m.lineSegmentPlane(r,n,a,f),m.lineSegmentPlane(t,n,a,d),{positions:[t,n,r,f,d],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return m.lineSegmentPlane(t,r,a,f),m.lineSegmentPlane(n,r,a,d),{positions:[t,n,r,f,d],indices:[0,1,4,0,4,3,2,3,4]}}},m}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";function a(t,n){this.normal=e.clone(t),this.distance=n}a.fromPointNormal=function(n,r,i){var o=-e.dot(r,n);return t(i)?(e.clone(r,i.normal),i.distance=o,i):new a(r,o)};var i=new e;return a.fromCartesian4=function(n,r){var o=e.fromCartesian4(n,i),u=n.w;return t(r)?(e.clone(o,r.normal),r.distance=u,r):new a(o,u)},a.getPointDistance=function(t,n){return e.dot(t.normal,n)+t.distance},a.ORIGIN_XY_PLANE=r(new a(e.UNIT_Z,0)),a.ORIGIN_YZ_PLANE=r(new a(e.UNIT_X,0)),a.ORIGIN_ZX_PLANE=r(new a(e.UNIT_Y,0)),a}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,n,r,a){return t(e).then(n,r,a)}function t(e){var t,n;return e instanceof r?t=e:u(e)?(n=o(),e.then(function(e){n.resolve(e)},function(e){n.reject(e)},function(e){n.progress(e)}),t=n.promise):t=a(e),t}function n(t){return e(t,i)}function r(e){this.then=e}function a(e){var n=new r(function(n){try{return t(n?n(e):e)}catch(e){return i(e)}});return n}function i(e){var n=new r(function(n,r){try{return r?t(r(e)):i(e)}catch(e){return i(e)}});return n}function o(){function e(e,t,n){return d(e,t,n)}function n(e){return E(e)}function a(e){return E(i(e))}function u(e){return h(e)}var s,c,l,f,d,h,E;return c=new r(e),s={then:e,resolve:n,reject:a,progress:u,promise:c,resolver:{resolve:n,reject:a,progress:u}},l=[],f=[],d=function(e,t,n){var r,a;return r=o(),a="function"==typeof n?function(e){try{r.progress(n(e))}catch(e){r.progress(e)}}:function(e){r.progress(e)},l.push(function(n){n.then(e,t).then(r.resolve,r.reject,a)}),f.push(a),r.promise},h=function(e){return m(f,e),e},E=function(e){return e=t(e),d=e.then,E=t,h=p,m(l,e),f=l=A,e},s}function u(e){return e&&"function"==typeof e.then}function s(t,n,r,a,i){return _(2,arguments),e(t,function(t){function u(e){m(e)}function s(e){E(e)}var c,l,f,d,h,E,m,_,y,T;if(y=t.length>>>0,c=Math.max(0,Math.min(n,y)),f=[],l=y-c+1,d=[],h=o(),c)for(_=h.progress,m=function(e){d.push(e),--l||(E=m=p,h.reject(d))},E=function(e){f.push(e),--c||(E=m=p,h.resolve(f))},T=0;T<y;++T)T in t&&e(t[T],s,u,_);else h.resolve(f);return h.then(r,a,i)})}function c(e,t,n,r){function a(e){return t?t(e[0]):e[0]}return s(e,1,a,n,r)}function l(e,t,n,r){return _(1,arguments),d(e,y).then(t,n,r)}function f(){return d(arguments,y)}function d(t,n){return e(t,function(t){var r,a,i,u,s,c;if(i=a=t.length>>>0,r=[],c=o(),i)for(u=function(t,a){e(t,n).then(function(e){r[a]=e,--i||c.resolve(r)},c.reject)},s=0;s<a;s++)s in t?u(t[s],s):--i;else c.resolve(r);return c.promise})}function h(t,n){var r=R.call(arguments,1);return e(t,function(t){var a;return a=t.length,r[0]=function(t,r,i){return e(t,function(t){return e(r,function(e){return n(t,e,i,a)})})},T.apply(t,r)})}function E(t,n,r){var a=arguments.length>2;return e(t,function(e){return e=a?r:e,n.resolve(e),e},function(e){return n.reject(e),i(e)},n.progress)}function m(e,t){for(var n,r=0;n=e[r++];)n(t)}function _(e,t){for(var n,r=t.length;r>e;)if(n=t[--r],null!=n&&"function"!=typeof n)throw new Error("arg "+r+" must be a function")}function p(){}function y(e){return e}var T,R,A;return e.defer=o,e.resolve=t,e.reject=n,e.join=f,e.all=l,e.map=d,e.reduce=h,e.any=c,e.some=s,e.chain=E,e.isPromise=u,r.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(A,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return l(t,function(t){return e.apply(A,t)})})}},R=[].slice,T=[].reduce||function(e){var t,n,r,a,i;if(i=0,t=Object(this),a=t.length>>>0,n=arguments,n.length<=1)for(;;){if(i in t){r=t[i++];break}if(++i>=a)throw new TypeError}else r=n[1];for(;i<a;++i)i in t&&(r=e(r,t[i],i,t));return r},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/binarySearch",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e,t,n){for(var r,a,i=0,o=e.length-1;i<=o;)if(r=~~((i+o)/2),a=n(e[r],t),a<0)i=r+1;else{if(!(a>0))return r;o=r-1}return~(o+1)}return n}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,n,r,a){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=r,this.ut1MinusUtc=a}return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,n=0,r=t[n++],a=function(e,t,n,r){n||(n=" ");var a=e.length>=t?"":Array(1+t-e.length>>>0).join(n);return r?e+a:a+e},i=function(e,t,n,r,i,o){var u=r-e.length;return u>0&&(e=n||!i?a(e,r,o,n):e.slice(0,t.length)+a("",u,"0",!0)+e.slice(t.length)),e},o=function(e,t,n,r,o,u,s){var c=e>>>0;return n=n&&c&&{2:"0b",8:"0",16:"0x"}[t]||"",e=n+a(c.toString(t),u||0,"0",!1),i(e,n,r,o,s)},u=function(e,t,n,r,a,o){return null!=r&&(e=e.slice(0,r)),i(e,"",t,n,a,o)},s=function(e,r,s,c,l,f,d){var h,E,m,_,p;if("%%"==e)return"%";for(var y=!1,T="",R=!1,A=!1,S=" ",N=s.length,M=0;s&&M<N;M++)switch(s.charAt(M)){case" ":T=" ";break;case"+":T="+";break;case"-":y=!0;break;case"'":S=s.charAt(M+1);break;case"0":R=!0;break;case"#":A=!0}if(c=c?"*"==c?+t[n++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,c<0&&(c=-c,y=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(f=f?"*"==f?+t[n++]:"*"==f.charAt(0)?+t[f.slice(1,-1)]:+f:"fFeE".indexOf(d)>-1?6:"d"==d?0:void 0,p=r?t[r.slice(0,-1)]:t[n++],d){case"s":return u(String(p),y,c,f,R,S);case"c":return u(String.fromCharCode(+p),y,c,f,R);case"b":return o(p,2,A,y,c,f,R);case"o":return o(p,8,A,y,c,f,R);case"x":return o(p,16,A,y,c,f,R);case"X":return o(p,16,A,y,c,f,R).toUpperCase();case"u":return o(p,10,A,y,c,f,R);case"i":case"d":return h=+p||0,h=Math.round(h-h%1),E=h<0?"-":T,p=E+a(String(Math.abs(h)),f,"0",!1),i(p,E,y,c,R);case"e":case"E":case"f":case"F":case"g":case"G":return h=+p,E=h<0?"-":T,m=["toExponential","toFixed","toPrecision"]["efg".indexOf(d.toLowerCase())],_=["toString","toUpperCase"]["eEfFgG".indexOf(d)%2],p=E+Math.abs(h)[m](f),i(p,E,y,c,R)[_]();default:return e}};return r.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,n,r,a,i,o,u){this.year=e,this.month=t,this.day=n,this.hour=r,this.minute=a,this.second=i,this.millisecond=o,this.isLeapSecond=u}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e(t)}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t){return m.compare(e.julianDate,t.julianDate)}function f(e){T.julianDate=e;var n=m.leapSeconds,r=t(n,T,l);r<0&&(r=~r),r>=n.length&&(r=n.length-1);var a=n[r].offset;if(r>0){var i=m.secondsDifference(n[r].julianDate,e);i>a&&(r--,a=n[r].offset)}m.addSeconds(e,a,e)}function d(e,n){T.julianDate=e;var r=m.leapSeconds,a=t(r,T,l);if(a<0&&(a=~a),0===a)return m.addSeconds(e,-r[0].offset,n);if(a>=r.length)return m.addSeconds(e,-r[a-1].offset,n);var i=m.secondsDifference(r[a].julianDate,e);return 0===i?m.addSeconds(e,-r[a].offset,n):i<=1?void 0:m.addSeconds(e,-r[--a].offset,n)}function h(e,t,n){var r=t/s.SECONDS_PER_DAY|0;return e+=r,t-=s.SECONDS_PER_DAY*r,t<0&&(e--,t+=s.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function E(e,t,n,r,a,i,o){var u=(t-14)/12|0,c=e+4800+u,l=(1461*c/4|0)+(367*(t-2-12*u)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;r-=12,r<0&&(r+=24);var f=i+(r*s.SECONDS_PER_HOUR+a*s.SECONDS_PER_MINUTE+o*s.SECONDS_PER_MILLISECOND);return f>=43200&&(l-=1),[l,f]}function m(e,t,r){this.dayNumber=void 0,this.secondsOfDay=void 0,e=n(e,0),t=n(t,0),r=n(r,c.UTC);var a=0|e;t+=(e-a)*s.SECONDS_PER_DAY,h(a,t,this),r===c.UTC&&f(this)}var _=new i,p=[31,28,31,30,31,30,31,31,30,31,30,31],y=29,T=new u,R=/^(\d{4})$/,A=/^(\d{4})-(\d{2})$/,S=/^(\d{4})-?(\d{3})$/,N=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,M=/^(\d{4})-?(\d{2})-?(\d{2})$/,I=/([Z+\-])?(\d{2})?:?(\d{2})?$/,O=/^(\d{2})(\.\d+)?/.source+I.source,v=/^(\d{2}):?(\d{2})(\.\d+)?/.source+I.source,g=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+I.source;m.fromDate=function(e,t){var n=E(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r(t)?(h(n[0],n[1],t),f(t),t):new m(n[0],n[1],c.UTC)},m.fromIso8601=function(e,t){e=e.replace(",",".");var n,a,i,u=e.split("T"),s=1,l=1,d=0,_=0,T=0,I=0,x=u[0],w=u[1];if(u=x.match(M),null!==u)n=+u[1],s=+u[2],l=+u[3];else if(u=x.match(A),null!==u)n=+u[1],s=+u[2];else if(u=x.match(R),null!==u)n=+u[1];else{var C;if(u=x.match(S),null!==u)n=+u[1],C=+u[2],i=o(n);else if(u=x.match(N),null!==u){n=+u[1];var P=+u[2],U=+u[3]||0,D=new Date(Date.UTC(n,0,4));C=7*P+U-D.getUTCDay()-3}a=new Date(Date.UTC(n,0,1)),a.setUTCDate(C),s=a.getUTCMonth()+1,l=a.getUTCDate()}i=o(n);var L;if(r(w)){u=w.match(g),null!==u?(d=+u[1],_=+u[2],T=+u[3],I=1e3*+(u[4]||0),L=5):(u=w.match(v),null!==u?(d=+u[1],_=+u[2],T=60*+(u[3]||0),L=4):(u=w.match(O),null!==u&&(d=+u[1],_=60*+(u[2]||0),L=3)));var F=u[L],z=+u[L+1],B=+(u[L+2]||0);switch(F){case"+":d-=z,_-=B;break;case"-":d+=z,_+=B;break;case"Z":break;default:_+=new Date(Date.UTC(n,s-1,l,d,_)).getTimezoneOffset()}}else _+=new Date(n,s-1,l).getTimezoneOffset();var b=60===T;for(b&&T--;_>=60;)_-=60,d++;for(;d>=24;)d-=24,l++;for(a=i&&2===s?y:p[s-1];l>a;)l-=a,s++,s>12&&(s-=12,n++),a=i&&2===s?y:p[s-1];for(;_<0;)_+=60,d--;for(;d<0;)d+=24,l--;for(;l<1;)s--,s<1&&(s+=12,n--),a=i&&2===s?y:p[s-1],l+=a;var q=E(n,s,l,d,_,T,I);return r(t)?(h(q[0],q[1],t),f(t)):t=new m(q[0],q[1],c.UTC),b&&m.addSeconds(t,1,t),t},m.now=function(e){return m.fromDate(new Date,e)};var x=new m(0,0,c.TAI);return m.toGregorianDate=function(e,t){var n=!1,a=d(e,x);r(a)||(m.addSeconds(e,-1,x),a=d(x,x),n=!0);var o=a.dayNumber,u=a.secondsOfDay;u>=43200&&(o+=1);var c=o+68569|0,l=4*c/146097|0;c=c-((146097*l+3)/4|0)|0;var f=4e3*(c+1)/1461001|0;c=c-(1461*f/4|0)+31|0;var h=80*c/2447|0,E=c-(2447*h/80|0)|0;c=h/11|0;var _=h+2-12*c|0,p=100*(l-49)+f+c|0,y=u/s.SECONDS_PER_HOUR|0,T=u-y*s.SECONDS_PER_HOUR,R=T/s.SECONDS_PER_MINUTE|0;T-=R*s.SECONDS_PER_MINUTE;var A=0|T,S=(T-A)/s.SECONDS_PER_MILLISECOND;return y+=12,y>23&&(y-=24),n&&(A+=1),r(t)?(t.year=p,t.month=_,t.day=E,t.hour=y,t.minute=R,t.second=A,t.millisecond=S,t.isLeapSecond=n,t):new i(p,_,E,y,R,A,S,n)},m.toDate=function(e){var t=m.toGregorianDate(e,_),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))},m.toIso8601=function(t,n){var a,i=m.toGregorianDate(t,i);return r(n)||0===i.millisecond?r(n)&&0!==n?(a=(.01*i.millisecond).toFixed(n).replace(".","").slice(0,n),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",i.year,i.month,i.day,i.hour,i.minute,i.second):(a=(.01*i.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a))},m.clone=function(e,t){if(r(e))return r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new m(e.dayNumber,e.secondsOfDay,c.TAI)},m.compare=function(e,t){var n=e.dayNumber-t.dayNumber;return 0!==n?n:e.secondsOfDay-t.secondsOfDay},m.equals=function(e,t){return e===t||r(e)&&r(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},m.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(m.secondsDifference(e,t))<=n},m.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},m.secondsDifference=function(e,t){var n=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return n+(e.secondsOfDay-t.secondsOfDay)},m.daysDifference=function(e,t){var n=e.dayNumber-t.dayNumber,r=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return n+r},m.computeTaiMinusUtc=function(e){T.julianDate=e;var n=m.leapSeconds,r=t(n,T,l);return r<0&&(r=~r,--r,r<0&&(r=0)),n[r].offset},m.addSeconds=function(e,t,n){return h(e.dayNumber,e.secondsOfDay+t,n)},m.addMinutes=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return h(e.dayNumber,r,n)},m.addHours=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return h(e.dayNumber,r,n)},m.addDays=function(e,t,n){var r=e.dayNumber+t;return h(r,e.secondsOfDay,n)},m.lessThan=function(e,t){return m.compare(e,t)<0},m.lessThanOrEquals=function(e,t){return m.compare(e,t)<=0},m.greaterThan=function(e,t){return m.compare(e,t)>0},m.greaterThanOrEquals=function(e,t){return m.compare(e,t)>=0},m.prototype.clone=function(e){return m.clone(this,e)},m.prototype.equals=function(e){return m.equals(this,e)},m.prototype.equalsEpsilon=function(e,t){return m.equalsEpsilon(this,e,t)},m.prototype.toString=function(){return m.toIso8601(this)},m.leapSeconds=[new u(new m(2441317,43210,c.TAI),10),new u(new m(2441499,43211,c.TAI),11),new u(new m(2441683,43212,c.TAI),12),new u(new m(2442048,43213,c.TAI),13),new u(new m(2442413,43214,c.TAI),14),new u(new m(2442778,43215,c.TAI),15),new u(new m(2443144,43216,c.TAI),16),new u(new m(2443509,43217,c.TAI),17),new u(new m(2443874,43218,c.TAI),18),new u(new m(2444239,43219,c.TAI),19),new u(new m(2444786,43220,c.TAI),20),new u(new m(2445151,43221,c.TAI),21),new u(new m(2445516,43222,c.TAI),22),new u(new m(2446247,43223,c.TAI),23),new u(new m(2447161,43224,c.TAI),24),new u(new m(2447892,43225,c.TAI),25),new u(new m(2448257,43226,c.TAI),26),new u(new m(2448804,43227,c.TAI),27),new u(new m(2449169,43228,c.TAI),28),new u(new m(2449534,43229,c.TAI),29),new u(new m(2450083,43230,c.TAI),30),new u(new m(2450630,43231,c.TAI),31),new u(new m(2451179,43232,c.TAI),32),new u(new m(2453736,43233,c.TAI),33),new u(new m(2454832,43234,c.TAI),34),new u(new m(2456109,43235,c.TAI),35),new u(new m(2457204,43236,c.TAI),36),new u(new m(2457754,43237,c.TAI),37)],m}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(n,r){if(null===n||"object"!=typeof n)return n;r=e(r,!1);var a=new n.constructor;for(var i in n)if(n.hasOwnProperty(i)){var o=n[i];r&&(o=t(o,r)),a[i]=o}return a}return t}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var n=e.split("\r\n"),r=0;r<n.length;++r){var a=n[r],i=a.indexOf(": ");if(i>0){var o=a.substring(0,i),u=a.substring(i+2);t[o]=u}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function n(e,n,r){this.statusCode=e,this.response=n,this.responseHeaders=r,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return n.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},n}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var n=r.exec(t);this.scheme=n[1],this.authority=n[2],this.path=n[3],this.query=n[4],this.fragment=n[5]}}function t(e){var t=unescape(e);return i.test(t)?t:e.toUpperCase()}function n(e,t,n,r){return(t||"")+n.toLowerCase()+(r||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var r=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){ +return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(o,n).replace(a,t)),this.path&&(this.path=this.path.replace(a,t)),this.query&&(this.query=this.query.replace(a,t)),this.fragment&&(this.fragment=this.fragment.replace(a,t))};var a=/%[0-9a-z]{2}/gi,i=/[a-zA-Z0-9\-\._~]/,o=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var n=new e;return this.scheme?(n.scheme=this.scheme,n.authority=this.authority,n.path=this.path,n.query=this.query):(n.scheme=t.scheme,this.authority?(n.authority=this.authority,n.path=this.path,n.query=this.query):(n.authority=t.authority,""==this.path?(n.path=t.path,n.query=this.query||t.query):("/"==this.path.charAt(0)?(n.path=this.path,n.removeDotSegments()):(t.authority&&""==t.path?n.path="/"+this.path:n.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,n.removeDotSegments()),n.query=this.query))),n.fragment=this.fragment,n},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),n=[],r=""==t[0];r&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?n.pop():"."!=e&&n.push(e);"."!=e&&".."!=e||n.push(""),r&&n.unshift(""),this.path=n.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n){var r=new e(n);r.normalize();var a=r.getAuthority();if(t(a)){if(a.indexOf("@")!==-1){var i=a.split("@");a=i[1]}if(a.indexOf(":")===-1){var o=r.getScheme();if(t(o)||(o=window.location.protocol,o=o.substring(0,o.length-1)),"http"===o)a+=":80";else{if("https"!==o)return;a+=":443"}}return a}}var a={},i={};return a.add=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])||(i[r]=!0)},a.remove=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])&&delete i[r]},a.contains=function(e){var n=r(e);return!(!t(n)||!t(i[n]))},a.clear=function(){i={}},a}),define("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,n,r,a,i,o){"use strict";function u(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,a=t(n.method,"GET"),i=n.data,o=n.headers,s=n.overrideMimeType;return e(n.url,function(t){var n=e.defer();return u.load(t,r,a,i,o,n,s),n.promise})}function s(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function c(e,t){for(var n=s(e,t),r=new ArrayBuffer(n.length),a=new Uint8Array(r),i=0;i<n.length;i++)a[i]=n.charCodeAt(i);return r}function l(e,n){n=t(n,"");var r=e[1],a=!!e[2],i=e[3];switch(n){case"":case"text":return s(a,i);case"arraybuffer":return c(a,i);case"blob":var o=c(a,i);return new Blob([o],{type:r});case"document":var u=new DOMParser;return u.parseFromString(s(a,i),r);case"json":return JSON.parse(s(a,i))}}var f=/^data:(.*?)(;base64)?,(.*)$/;return u.load=function(e,t,r,u,s,c,d){var h=f.exec(e);if(null!==h)return void c.resolve(l(h,t));var E=new XMLHttpRequest;if(o.contains(e)&&(E.withCredentials=!0),n(d)&&n(E.overrideMimeType)&&E.overrideMimeType(d),E.open(r,e,!0),n(s))for(var m in s)s.hasOwnProperty(m)&&E.setRequestHeader(m,s[m]);n(t)&&(E.responseType=t),E.onload=function(){if(E.status<200||E.status>=300)return void c.reject(new a(E.status,E.response,E.getAllResponseHeaders()));var e=E.response,r=E.responseType;if(!n(e)||n(t)&&r!==t)if("json"===t&&"string"==typeof e)try{c.resolve(JSON.parse(e))}catch(e){c.reject(e)}else(""===r||"document"===r)&&n(E.responseXML)&&E.responseXML.hasChildNodes()?c.resolve(E.responseXML):""!==r&&"text"!==r||!n(E.responseText)?c.reject(new i("Invalid XMLHttpRequest response type.")):c.resolve(E.responseText);else c.resolve(e)},E.onerror=function(e){c.reject(new a)},E.send(u)},u.defaultLoad=u.load,u}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,n){return e({url:t,headers:n})}return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";function a(n,a){return t(a)?t(a.Accept)||(a=e(a),a.Accept=i.Accept):a=i,r(n,a).then(function(e){return JSON.parse(e)})}var i={Accept:"application/json,*/*;q=0.01"};return a}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function d(t){if(t=n(t,n.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=n(t.addNewLeapSeconds,!0),r(t.data))E(this,t.data);else if(r(t.url)){var a=this;this._downloadPromise=e(s(t.url),function(e){E(a,e)},function(){a._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else E(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function h(e,t){return o.compare(e.julianDate,t)}function E(e,n){if(!r(n.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!r(n.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var a=n.columnNames.indexOf("modifiedJulianDateUtc"),i=n.columnNames.indexOf("xPoleWanderRadians"),s=n.columnNames.indexOf("yPoleWanderRadians"),c=n.columnNames.indexOf("ut1MinusUtcSeconds"),d=n.columnNames.indexOf("xCelestialPoleOffsetRadians"),E=n.columnNames.indexOf("yCelestialPoleOffsetRadians"),m=n.columnNames.indexOf("taiMinusUtcSeconds");if(a<0||i<0||s<0||c<0||d<0||E<0||m<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var _=e._samples=n.samples,p=e._dates=[];e._dateColumn=a,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=d,e._yCelestialPoleOffsetRadiansColumn=E,e._taiMinusUtcSecondsColumn=m,e._columnCount=n.columnNames.length,e._lastIndex=void 0;for(var y,T=e._addNewLeapSeconds,R=0,A=_.length;R<A;R+=e._columnCount){var S=_[R+a],N=_[R+m],M=S+l.MODIFIED_JULIAN_DATE_DIFFERENCE,I=new o(M,N,f.TAI);if(p.push(I),T){if(N!==y&&r(y)){var O=o.leapSeconds,v=t(O,I,h);if(v<0){var g=new u(I,N);O.splice(~v,0,g)}}y=N}}}function m(e,t,n,r,a){var i=n*r;a.xPoleWander=t[i+e._xPoleWanderRadiansColumn],a.yPoleWander=t[i+e._yPoleWanderRadiansColumn],a.xPoleOffset=t[i+e._xCelestialPoleOffsetRadiansColumn],a.yPoleOffset=t[i+e._yCelestialPoleOffsetRadiansColumn],a.ut1MinusUtc=t[i+e._ut1MinusUtcSecondsColumn]}function _(e,t,n){return t+e*(n-t)}function p(e,t,n,r,a,i,u){var s=e._columnCount;if(i>t.length-1)return u.xPoleWander=0,u.yPoleWander=0,u.xPoleOffset=0,u.yPoleOffset=0,u.ut1MinusUtc=0,u;var c=t[a],l=t[i];if(c.equals(l)||r.equals(c))return m(e,n,a,s,u),u;if(r.equals(l))return m(e,n,i,s,u),u;var f=o.secondsDifference(r,c)/o.secondsDifference(l,c),d=a*s,h=i*s,E=n[d+e._ut1MinusUtcSecondsColumn],p=n[h+e._ut1MinusUtcSecondsColumn],y=p-E;if(y>.5||y<-.5){var T=n[d+e._taiMinusUtcSecondsColumn],R=n[h+e._taiMinusUtcSecondsColumn];T!==R&&(l.equals(r)?E=p:p-=R-T)}return u.xPoleWander=_(f,n[d+e._xPoleWanderRadiansColumn],n[h+e._xPoleWanderRadiansColumn]),u.yPoleWander=_(f,n[d+e._yPoleWanderRadiansColumn],n[h+e._yPoleWanderRadiansColumn]),u.xPoleOffset=_(f,n[d+e._xCelestialPoleOffsetRadiansColumn],n[h+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=_(f,n[d+e._yCelestialPoleOffsetRadiansColumn],n[h+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=_(f,E,p),u}return d.NONE=i({getPromiseToLoad:function(){return e()},compute:function(e,t){return r(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new a(0,0,0,0,0),t}}),d.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},d.prototype.compute=function(e,n){if(r(this._samples)){if(r(n)||(n=new a(0,0,0,0,0)),0===this._samples.length)return n.xPoleWander=0,n.yPoleWander=0,n.xPoleOffset=0,n.yPoleOffset=0,n.ut1MinusUtc=0,n;var i=this._dates,u=this._lastIndex,s=0,l=0;if(r(u)){var f=i[u],d=i[u+1],h=o.lessThanOrEquals(f,e),E=!r(d),m=E||o.greaterThanOrEquals(d,e);if(h&&m)return s=u,!E&&d.equals(e)&&++s,l=s+1,p(this,i,this._samples,e,s,l,n),n}var _=t(i,e,o.compare,this._dateColumn);return _>=0?(_<i.length-1&&i[_+1].equals(e)&&++_,s=_,l=_):(l=~_,s=l-1,s<0&&(s=0)),this._lastIndex=s,p(this,i,this._samples,e,s,l,n),n}if(r(this._dataError))throw new c(this._dataError)},d}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(t,n,r){this.heading=e(t,0),this.pitch=e(n,0),this.roll=e(r,0)}return a.fromQuaternion=function(e,n){t(n)||(n=new a);var r=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return n.heading=-Math.atan2(s,u),n.roll=Math.atan2(o,i),n.pitch=-Math.asin(r),n},a.fromDegrees=function(e,n,i,o){return t(o)||(o=new a),o.heading=e*r.RADIANS_PER_DEGREE,o.pitch=n*r.RADIANS_PER_DEGREE,o.roll=i*r.RADIANS_PER_DEGREE,o},a.clone=function(e,n){if(t(e))return t(n)?(n.heading=e.heading,n.pitch=e.pitch,n.roll=e.roll,n):new a(e.heading,e.pitch,e.roll)},a.equals=function(e,n){return e===n||t(e)&&t(n)&&e.heading===n.heading&&e.pitch===n.pitch&&e.roll===n.roll},a.equalsEpsilon=function(e,n,a,i){return e===n||t(e)&&t(n)&&r.equalsEpsilon(e.heading,n.heading,a,i)&&r.equalsEpsilon(e.pitch,n.pitch,a,i)&&r.equalsEpsilon(e.roll,n.roll,a,i)},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,n){return a.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},a}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=t(r,document.location.href);var a=new e(r),i=new e(n);return i.resolve(a).toString()}return a}),define("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(r,a,i){i=t(i,!0),r instanceof e||(r=new e(r)),a instanceof e||(a=new e(a)),n(a.authority)&&!n(a.scheme)&&("undefined"!=typeof document&&n(document.location)&&n(document.location.href)?a.scheme=new e(document.location.href).scheme:a.scheme=r.scheme);var o=r;a.isAbsolute()&&(o=a);var u="";n(o.scheme)&&(u+=o.scheme+":"),n(o.authority)&&(u+="//"+o.authority,""!==o.path&&"/"!==o.path&&(u=u.replace(/\/?$/,"/"),o.path=o.path.replace(/^\/?/g,""))),u+=o===r?i?r.path.replace(/\/?$/,"/")+a.path.replace(/^\/?/g,""):r.path+a.path:a.path;var s=n(r.query),c=n(a.query);s&&c?u+="?"+r.query+"&"+a.query:s&&!c?u+="?"+r.query:!s&&c&&(u+="?"+a.query);var l=n(a.fragment);return n(r.fragment)&&!l?u+="#"+r.fragment:l&&(u+="#"+a.fragment),u}return a}),define("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","./joinUrls","require"],function(e,t,n,r,a,i){"use strict";function o(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;t<n;++t){var r=e[t].getAttribute("src"),a=E.exec(r);if(null!==a)return a[1]}}function u(){if(t(f))return f;var n;return n="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:o(),f=new e(r(n))}function s(e){return i.toUrl("../"+e)}function c(e){return a(u(),e)}function l(e){t(d)||(d=t(i.toUrl)?s:c),t(h)||(h=document.createElement("a"));var n=d(e);return h.href=n,h.href=h.href,h.href}var f,d,h,E=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return l._cesiumScriptRegex=E,l.setBaseUrl=function(t){f=new e(t).resolve(new e(document.location.href))},l}),define("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,n){this.x=e,this.y=t,this.s=n}return e}),define("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){e=n(e,n.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=n(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=n(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new i(this._sampleZeroJulianEphemerisDate,0,u.TAI),this._stepSizeDays=n(e.stepSizeDays,1),this._samplesPerXysFile=n(e.samplesPerXysFile,1e3),this._totalSamples=n(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,r=this._denominators=new Array(t+1),a=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t),s=0;s<=t;++s){r[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;c<=t;++c)c!==s&&(r[s]*=s-c);r[s]=1/r[s]}this._work=new Array(t+1),this._coef=new Array(t+1)}function c(e,t,n){var r=f;return r.dayNumber=t,r.secondsOfDay=n,i.daysDifference(r,e._sampleZeroDateTT)}function l(n,a){if(n._chunkDownloadsInProgress[a])return n._chunkDownloadsInProgress[a];var i=e.defer();n._chunkDownloadsInProgress[a]=i;var u,s=n._xysFileUrlTemplate;return u=r(s)?s.replace("{0}",a):t("Assets/IAU2006_XYS/IAU2006_XYS_"+a+".json"),e(o(u),function(e){n._chunkDownloadsInProgress[a]=!1;for(var t=n._samples,r=e.samples,o=a*n._samplesPerXysFile*3,u=0,s=r.length;u<s;++u)t[o+u]=r[u];i.resolve()}),i.promise}var f=new i(0,0,u.TAI);return s.prototype.preload=function(t,n,r,a){var i=c(this,t,n),o=c(this,r,a),u=i/this._stepSizeDays-this._interpolationOrder/2|0;u<0&&(u=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var f=u/this._samplesPerXysFile|0,d=s/this._samplesPerXysFile|0,h=[],E=f;E<=d;++E)h.push(l(this,E));return e.all(h)},s.prototype.computeXysRadians=function(e,t,n){var i=c(this,e,t);if(!(i<0)){var o=i/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);s<0&&(s=0);var f=s+u;f>=this._totalSamples&&(f=this._totalSamples-1,s=f-u,s<0&&(s=0));var d=!1,h=this._samples;if(r(h[3*s])||(l(this,s/this._samplesPerXysFile|0),d=!0),r(h[3*f])||(l(this,f/this._samplesPerXysFile|0),d=!0),!d){r(n)?(n.x=0,n.y=0,n.s=0):n=new a(0,0,0);var E,m,_=i-s*this._stepSizeDays,p=this._work,y=this._denominators,T=this._coef,R=this._xTable;for(E=0;E<=u;++E)p[E]=_-R[E];for(E=0;E<=u;++E){for(T[E]=1,m=0;m<=u;++m)m!==E&&(T[E]*=p[m]);T[E]*=y[E];var A=3*(s+E);n.x+=T[E]*h[A++],n.y+=T[E]*h[A++],n.s+=T[E]*h[A]}return n}}}},s}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return t(a,{element:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(r.requestFullscreen=a,n=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(r.requestFullscreen=a,n=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?r.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(r.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?r.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(r.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?r.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(r.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),r.fullscreenerror=a)}return n},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[r.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function a(){if(!t(A)&&(A=!1,!d())){var e=/ Chrome\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(A=!0,S=r(e[1]))}return A}function i(){return a()&&S}function o(){if(!t(N)&&(N=!1,!a()&&!d()&&/ Safari\/[\.0-9]+/.test(R.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(N=!0,M=r(e[1]))}return N}function u(){return o()&&M}function s(){if(!t(I)){I=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(R.userAgent);null!==e&&(I=!0,O=r(e[1]),O.isNightly=!!e[2])}return I}function c(){return s()&&O}function l(){if(!t(v)){v=!1;var e;"Microsoft Internet Explorer"===R.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(v=!0,g=r(e[1]))):"Netscape"===R.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(v=!0,g=r(e[1])))}return v}function f(){return l()&&g}function d(){if(!t(x)){x=!1;var e=/ Edge\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(x=!0,w=r(e[1]))}return x}function h(){return d()&&w}function E(){if(!t(C)){C=!1;var e=/Firefox\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(C=!0,P=r(e[1]))}return C}function m(){return t(U)||(U=/Windows/i.test(R.appVersion)),U}function _(){return E()&&P}function p(){return t(D)||(D="undefined"!=typeof PointerEvent&&(!t(R.pointerEnabled)||R.pointerEnabled)),D}function y(){if(!t(F)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;F=t(n)&&""!==n,F&&(L=n)}return F}function T(){return y()?L:void 0}var R;R="undefined"!=typeof navigator?navigator:{};var A,S,N,M,I,O,v,g,x,w,C,P,U,D,L,F,z={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isEdge:d,edgeVersion:h,isFirefox:E,firefoxVersion:_,isWindows:m,hardwareConcurrency:e(R.hardwareConcurrency,3),supportsPointerEvents:p,supportsImageRenderingPixelated:y,imageRenderingValue:T};return z.supportsFullscreen=function(){return n.supportsFullscreen()},z.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},z.supportsWebWorkers=function(){return"undefined"!=typeof Worker},z}),define("Core/Quaternion",["./Cartesian3","./Check","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math","./Matrix3"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(e,t,r,a){this.x=n(e,0),this.y=n(t,0),this.z=n(r,0),this.w=n(a,0)}var l=new e;c.fromAxisAngle=function(t,n,a){var i=n/2,o=Math.sin(i);l=e.normalize(t,l);var u=l.x*o,s=l.y*o,f=l.z*o,d=Math.cos(i);return r(a)?(a.x=u,a.y=s,a.z=f,a.w=d,a):new c(u,s,f,d)};var f=[1,2,0],d=new Array(3);c.fromRotationMatrix=function(e,t){var n,a,i,o,u,l=e[s.COLUMN0ROW0],h=e[s.COLUMN1ROW1],E=e[s.COLUMN2ROW2],m=l+h+E;if(m>0)n=Math.sqrt(m+1),u=.5*n,n=.5/n,a=(e[s.COLUMN1ROW2]-e[s.COLUMN2ROW1])*n,i=(e[s.COLUMN2ROW0]-e[s.COLUMN0ROW2])*n,o=(e[s.COLUMN0ROW1]-e[s.COLUMN1ROW0])*n;else{var _=f,p=0;h>l&&(p=1),E>l&&E>h&&(p=2);var y=_[p],T=_[y];n=Math.sqrt(e[s.getElementIndex(p,p)]-e[s.getElementIndex(y,y)]-e[s.getElementIndex(T,T)]+1);var R=d;R[p]=.5*n,n=.5/n,u=(e[s.getElementIndex(T,y)]-e[s.getElementIndex(y,T)])*n,R[y]=(e[s.getElementIndex(y,p)]+e[s.getElementIndex(p,y)])*n,R[T]=(e[s.getElementIndex(T,p)]+e[s.getElementIndex(p,T)])*n,a=-R[0],i=-R[1],o=-R[2]}return r(t)?(t.x=a,t.y=i,t.z=o,t.w=u,t):new c(a,i,o,u)};var h=new c;c.fromHeadingPitchRoll=function(t,n,r,a){var i=c.fromAxisAngle(e.UNIT_X,r,h),o=c.fromAxisAngle(e.UNIT_Y,-n,a);a=c.multiply(o,i,o);var u=c.fromAxisAngle(e.UNIT_Z,-t,h);return c.multiply(u,a,a)};var E=new e,m=new e,_=new c,p=new c,y=new c;c.packedLength=4,c.pack=function(e,t,r){return r=n(r,0),t[r++]=e.x,t[r++]=e.y,t[r++]=e.z,t[r]=e.w,t},c.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new c),a.x=e[t],a.y=e[t+1],a.z=e[t+2],a.w=e[t+3],a},c.packedInterpolationLength=3,c.convertPackedArrayForInterpolation=function(e,t,n,r){c.unpack(e,4*n,y),c.conjugate(y,y);for(var a=0,i=n-t+1;a<i;a++){var o=3*a;c.unpack(e,4*(t+a),_),c.multiply(_,y,_),_.w<0&&c.negate(_,_),c.computeAxis(_,E);var u=c.computeAngle(_);r[o]=E.x*u,r[o+1]=E.y*u,r[o+2]=E.z*u}},c.unpackInterpolationResult=function(t,n,a,i,o){r(o)||(o=new c),e.fromArray(t,0,m);var u=e.magnitude(m);return c.unpack(n,4*i,p),0===u?c.clone(c.IDENTITY,_):c.fromAxisAngle(m,u,_),c.multiply(_,p,o)},c.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new c(e.x,e.y,e.z,e.w)},c.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},c.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},c.magnitude=function(e){return Math.sqrt(c.magnitudeSquared(e))},c.normalize=function(e,t){var n=1/c.magnitude(e),r=e.x*n,a=e.y*n,i=e.z*n,o=e.w*n;return t.x=r,t.y=a,t.z=i,t.w=o,t},c.inverse=function(e,t){var n=c.magnitudeSquared(e);return t=c.conjugate(e,t),c.multiplyByScalar(t,1/n,t)},c.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},c.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},c.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},c.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},c.multiply=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=e.w,u=t.x,s=t.y,c=t.z,l=t.w,f=o*u+r*l+a*c-i*s,d=o*s-r*c+a*l+i*u,h=o*c+r*s-a*u+i*l,E=o*l-r*u-a*s-i*c;return n.x=f,n.y=d,n.z=h,n.w=E,n},c.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},c.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},c.computeAxis=function(e,t){var n=e.w;if(Math.abs(n-1)<u.EPSILON6)return t.x=t.y=t.z=0,t;var r=1/Math.sqrt(1-n*n);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},c.computeAngle=function(e){return Math.abs(e.w-1)<u.EPSILON6?0:2*Math.acos(e.w)};var T=new c;c.lerp=function(e,t,n,r){return T=c.multiplyByScalar(t,n,T),r=c.multiplyByScalar(e,1-n,r),c.add(T,r,r)};var R=new c,A=new c,S=new c;c.slerp=function(e,t,n,r){var a=c.dot(e,t),i=t;if(a<0&&(a=-a,i=R=c.negate(t,R)),1-a<u.EPSILON6)return c.lerp(e,i,n,r);var o=Math.acos(a);return A=c.multiplyByScalar(e,Math.sin((1-n)*o),A),S=c.multiplyByScalar(i,Math.sin(n*o),S),r=c.add(A,S,r),c.multiplyByScalar(r,1/Math.sin(o),r)},c.log=function(t,n){var r=u.acosClamped(t.w),a=0;return 0!==r&&(a=r/Math.sin(r)),e.multiplyByScalar(t,a,n)},c.exp=function(t,n){var r=e.magnitude(t),a=0;return 0!==r&&(a=Math.sin(r)/r),n.x=t.x*a,n.y=t.y*a,n.z=t.z*a,n.w=Math.cos(r),n};var N=new e,M=new e,I=new c,O=new c;c.computeInnerQuadrangle=function(t,n,r,a){var i=c.conjugate(n,I);c.multiply(i,r,O);var o=c.log(O,N);c.multiply(i,t,O);var u=c.log(O,M);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),c.exp(o,I),c.multiply(n,I,a)},c.squad=function(e,t,n,r,a,i){var o=c.slerp(e,t,a,I),u=c.slerp(n,r,a,O);return c.slerp(o,u,2*a*(1-a),i)};for(var v=new c,g=1.9011074535173003,x=i.supportsTypedArrays()?new Float32Array(8):[],w=i.supportsTypedArrays()?new Float32Array(8):[],C=i.supportsTypedArrays()?new Float32Array(8):[],P=i.supportsTypedArrays()?new Float32Array(8):[],U=0;U<7;++U){var D=U+1,L=2*D+1;x[U]=1/(D*L),w[U]=D/L}return x[7]=g/136,w[7]=8*g/17,c.fastSlerp=function(e,t,n,r){var a,i=c.dot(e,t);i>=0?a=1:(a=-1,i=-i);for(var o=i-1,u=1-n,s=n*n,l=u*u,f=7;f>=0;--f)C[f]=(x[f]*s-w[f])*o,P[f]=(x[f]*l-w[f])*o;var d=a*n*(1+C[0]*(1+C[1]*(1+C[2]*(1+C[3]*(1+C[4]*(1+C[5]*(1+C[6]*(1+C[7])))))))),h=u*(1+P[0]*(1+P[1]*(1+P[2]*(1+P[3]*(1+P[4]*(1+P[5]*(1+P[6]*(1+P[7])))))))),E=c.multiplyByScalar(e,h,v);return c.multiplyByScalar(t,d,r),c.add(E,r,r)},c.fastSquad=function(e,t,n,r,a,i){var o=c.fastSlerp(e,t,a,I),u=c.fastSlerp(n,r,a,O);return c.fastSlerp(o,u,2*a*(1-a),i)},c.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},c.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n},c.ZERO=o(new c(0,0,0,0)),c.IDENTITY=o(new c(0,0,0,1)),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.x+", "+this.y+", "+this.z+", "+this.w+")"},c}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./Check","./defaultValue","./defined","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./HeadingPitchRoll","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,n,r,a,i,o,u,s,c,l,f,d,h,E,m,_,p,y,T,R){"use strict";var A={},S=new n,N=new n,M=new n;A.eastNorthUpToFixedFrame=function(e,t,r){if(_.equalsEpsilon(e.x,0,_.EPSILON14)&&_.equalsEpsilon(e.y,0,_.EPSILON14)){var a=_.sign(e.z);return u(r)?(r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=-a,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=a,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(0,-a,0,e.x,1,0,0,e.y,0,0,a,e.z,0,0,0,1)}var i=S,s=N,c=M;return t=o(t,f.WGS84),t.geodeticSurfaceNormal(e,i),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(i,s,c),u(r)?(r[0]=s.x,r[1]=s.y,r[2]=s.z,r[3]=0,r[4]=c.x,r[5]=c.y,r[6]=c.z,r[7]=0,r[8]=i.x,r[9]=i.y,r[10]=i.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(s.x,c.x,i.x,e.x,s.y,c.y,i.y,e.y,s.z,c.z,i.z,e.z,0,0,0,1)};var I=new n,O=new n,v=new n;A.northEastDownToFixedFrame=function(e,t,r){if(_.equalsEpsilon(e.x,0,_.EPSILON14)&&_.equalsEpsilon(e.y,0,_.EPSILON14)){var a=_.sign(e.z);return u(r)?(r[0]=-a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=-a,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(-a,0,0,e.x,0,1,0,e.y,0,0,-a,e.z,0,0,0,1)}var i=I,s=O,c=v;return t=o(t,f.WGS84),t.geodeticSurfaceNormal(e,i),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(i,s,c),u(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=s.x,r[5]=s.y,r[6]=s.z,r[7]=0,r[8]=-i.x,r[9]=-i.y,r[10]=-i.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(c.x,s.x,-i.x,e.x,c.y,s.y,-i.y,e.y,c.z,s.z,-i.z,e.z,0,0,0,1)},A.northUpEastToFixedFrame=function(e,t,r){if(_.equalsEpsilon(e.x,0,_.EPSILON14)&&_.equalsEpsilon(e.y,0,_.EPSILON14)){var a=_.sign(e.z);return u(r)?(r[0]=-a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=a,r[7]=0,r[8]=0,r[9]=1,r[10]=0,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(-a,0,0,e.x,0,0,1,e.y,0,a,0,e.z,0,0,0,1)}var i=S,s=N,c=M;return t=o(t,f.WGS84),t.geodeticSurfaceNormal(e,i),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(i,s,c),u(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=i.x,r[5]=i.y,r[6]=i.z,r[7]=0,r[8]=s.x,r[9]=s.y,r[10]=s.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(c.x,i.x,s.x,e.x,c.y,i.y,s.y,e.y,c.z,i.z,s.z,e.z,0,0,0,1)},A.northWestUpToFixedFrame=function(e,t,r){if(_.equalsEpsilon(e.x,0,_.EPSILON14)&&_.equalsEpsilon(e.y,0,_.EPSILON14)){var a=_.sign(e.z);return u(r)?(r[0]=-a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=a,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(-a,0,0,e.x,0,-1,0,e.y,0,0,a,e.z,0,0,0,1)}var i=S,s=N,c=M;return t=o(t,f.WGS84),t.geodeticSurfaceNormal(e,i),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(i,s,c),u(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=-s.x,r[5]=-s.y,r[6]=-s.z,r[7]=0,r[8]=i.x,r[9]=i.y,r[10]=i.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(c.x,-s.x,i.x,e.x,c.y,-s.y,i.y,e.y,c.z,-s.z,i.z,e.z,0,0,0,1)};var g=new T,x=new n(1,1,1),w=new y;A.headingPitchRollToFixedFrame=function(e,t,r,a){i.typeOf.object("headingPitchRoll",t);var o=t.heading,u=t.pitch,s=t.roll,c=T.fromHeadingPitchRoll(o,u,s,g),l=y.fromTranslationQuaternionRotationScale(n.ZERO,c,x,w);return a=A.eastNorthUpToFixedFrame(e,r,a),y.multiply(a,l,a)};var C=new y,P=new p;A.headingPitchRollQuaternion=function(e,t,n,r){i.typeOf.object("headingPitchRoll",t);var a=A.headingPitchRollToFixedFrame(e,t,n,C),o=y.getRotation(a,P);return T.fromRotationMatrix(o,r)};var U=24110.54841,D=8640184.812866,L=.093104,F=-62e-7,z=1.1772758384668e-19,B=72921158553e-15,b=_.TWO_PI/86400,q=new m;A.computeTemeToPseudoFixedMatrix=function(e,t){q=m.addSeconds(e,-m.computeTaiMinusUtc(e),q);var n,r=q.dayNumber,a=q.secondsOfDay,i=r-2451545;n=a>=43200?(i+.5)/R.DAYS_PER_JULIAN_CENTURY:(i-.5)/R.DAYS_PER_JULIAN_CENTURY;var o=U+n*(D+n*(L+n*F)),s=o*b%_.TWO_PI,c=B+z*(r-2451545.5),l=(a+.5*R.SECONDS_PER_DAY)%R.SECONDS_PER_DAY,f=s+c*l,d=Math.cos(f),h=Math.sin(f);return u(t)?(t[0]=d,t[1]=-h,t[2]=0,t[3]=h,t[4]=d,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new p(d,h,0,-h,d,0,0,0,1)},A.iau2006XysData=new h,A.earthOrientationParameters=c.NONE;var G=32.184,W=2451545;A.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+G,a=t.stop.dayNumber,i=t.stop.secondsOfDay+G,o=A.iau2006XysData.preload(n,r,a,i),u=A.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},A.computeIcrfToFixedMatrix=function(e,t){u(t)||(t=new p);var n=A.computeFixedToIcrfMatrix(e,t);if(u(n))return p.transpose(n,t)};var X=new E(0,0,0),V=new l(0,0,0,0,0,0),H=new p,Y=new p;A.computeFixedToIcrfMatrix=function(e,t){u(t)||(t=new p);var n=A.earthOrientationParameters.compute(e,V);if(u(n)){var r=e.dayNumber,a=e.secondsOfDay+G,i=A.iau2006XysData.computeXysRadians(r,a,X);if(u(i)){var o=i.x+n.xPoleOffset,s=i.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-o*o-s*s)),l=H;l[0]=1-c*o*o,l[3]=-c*o*s,l[6]=o,l[1]=-c*o*s,l[4]=1-c*s*s,l[7]=s,l[2]=-o,l[5]=-s,l[8]=1-c*(o*o+s*s);var f=p.fromRotationZ(-i.s,Y),d=p.multiply(l,f,H),h=e.dayNumber,E=e.secondsOfDay-m.computeTaiMinusUtc(e)+n.ut1MinusUtc,y=h-2451545,T=E/R.SECONDS_PER_DAY,S=.779057273264+T+.00273781191135448*(y+T);S=S%1*_.TWO_PI;var N=p.fromRotationZ(S,Y),M=p.multiply(d,N,H),I=Math.cos(n.xPoleWander),O=Math.cos(n.yPoleWander),v=Math.sin(n.xPoleWander),g=Math.sin(n.yPoleWander),x=r-W+a/R.SECONDS_PER_DAY;x/=36525;var w=-47e-6*x*_.RADIANS_PER_DEGREE/3600,C=Math.cos(w),P=Math.sin(w),U=Y;return U[0]=I*C,U[1]=I*P,U[2]=v,U[3]=-O*P+g*v*C,U[4]=O*C+g*v*P,U[5]=-g*I,U[6]=-g*P-O*v*C,U[7]=g*C-O*v*P,U[8]=O*I,p.multiply(M,U,t)}}};var k=new r;A.pointToWindowCoordinates=function(e,t,n,r){return r=A.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},A.pointToGLWindowCoordinates=function(e,n,a,i){u(i)||(i=new t);var o=k;return y.multiplyByVector(e,r.fromElements(a.x,a.y,a.z,1,o),o),r.multiplyByScalar(o,1/o.w,o),y.multiplyByVector(n,o,o),t.fromCartesian4(o,i)};var j=new n,Z=new n,K=new n;A.rotationMatrixFromPositionVelocity=function(e,t,r,a){var i=o(r,f.WGS84).geodeticSurfaceNormal(e,j),s=n.cross(t,i,Z);n.equalsEpsilon(s,n.ZERO,_.EPSILON6)&&(s=n.clone(n.UNIT_X,s));var c=n.cross(s,t,K);return n.cross(t,c,s), +n.negate(s,s),u(a)||(a=new p),a[0]=t.x,a[1]=t.y,a[2]=t.z,a[3]=s.x,a[4]=s.y,a[5]=s.z,a[6]=c.x,a[7]=c.y,a[8]=c.z,a};var J=new a,Q=new n,$=new n,ee=new r,te=new r,ne=new r,re=new r,ae=new r,ie=new y,oe=new y;A.basisTo2D=function(e,t,a){var i=e.ellipsoid,o=y.getColumn(t,3,ee),u=i.cartesianToCartographic(o,J),s=A.eastNorthUpToFixedFrame(o,i,ie),c=y.inverseTransformation(s,oe),l=e.project(u,Q),f=te;f.x=l.z,f.y=l.x,f.z=l.y,f.w=1;var d=y.getColumn(t,0,$),h=n.magnitude(d),E=y.multiplyByVector(c,d,ne);r.fromElements(E.z,E.x,E.y,0,E);var m=y.getColumn(t,1,$),_=n.magnitude(m),p=y.multiplyByVector(c,m,re);r.fromElements(p.z,p.x,p.y,0,p);var T=y.getColumn(t,2,$),R=n.magnitude(T),S=ae;return n.cross(E,p,S),n.normalize(S,S),n.cross(p,S,E),n.normalize(E,E),n.cross(S,E,p),n.normalize(p,p),n.multiplyByScalar(E,h,E),n.multiplyByScalar(p,_,p),n.multiplyByScalar(S,R,S),y.setColumn(a,0,E,a),y.setColumn(a,1,p,a),y.setColumn(a,2,S,a),y.setColumn(a,3,f,a),a};var ue=new y(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);return A.wgs84To2DModelMatrix=function(e,t,n){var r=e.ellipsoid,a=A.eastNorthUpToFixedFrame(t,r,ie),i=y.inverseTransformation(a,oe),o=r.cartesianToCartographic(t,J),u=e.project(o,Q),s=te;s.x=u.z,s.y=u.x,s.z=u.y,s.w=1;var c=y.fromTranslation(s,ie);return y.multiply(ue,i,n),y.multiply(c,n,n),n},A}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,f,d,h){"use strict";function E(e,t){t=a(t,s.WGS84),e=t.scaleToGeodeticSurface(e);var r=h.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=n.fromCartesian4(l.getColumn(r,0,m)),this._yAxis=n.fromCartesian4(l.getColumn(r,1,m));var i=n.fromCartesian4(l.getColumn(r,2,m));this._plane=f.fromPointNormal(e,i)}var m=new r;o(E.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var _=new e;E.fromPoints=function(t,n){var r=e.fromPoints(t,_);return new E(r.center,n)};var p=new d,y=new n;E.prototype.projectPointOntoPlane=function(e,r){var a=p;a.origin=e,n.normalize(e,a.direction);var o=c.rayPlane(a,this._plane,y);if(i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,y)),i(o)){var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return i(r)?(r.x=s,r.y=l,r):new t(s,l)}},E.prototype.projectPointsOntoPlane=function(e,t){i(t)||(t=[]);for(var n=0,r=e.length,a=0;a<r;a++){var o=this.projectPointOntoPlane(e[a],t[n]);i(o)&&(t[n]=o,n++)}return t.length=n,t},E.prototype.projectPointToNearestOnPlane=function(e,r){i(r)||(r=new t);var a=p;a.origin=e,n.clone(this._plane.normal,a.direction);var o=c.rayPlane(a,this._plane,y);i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,y));var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return r.x=s,r.y=l,r},E.prototype.projectPointsToNearestOnPlane=function(e,t){i(t)||(t=[]);var n=e.length;t.length=n;for(var r=0;r<n;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var T=new n;return E.prototype.projectPointsOntoEllipsoid=function(e,t){var r=e.length;i(t)?t.length=r:t=new Array(r);for(var a=this._ellipsoid,o=this._origin,u=this._xAxis,s=this._yAxis,c=T,l=0;l<r;++l){var f=e[l];n.multiplyByScalar(u,f.x,c),i(t[l])||(t[l]=new n);var d=n.add(o,c,t[l]);n.multiplyByScalar(s,f.y,c),n.add(d,c,d),a.scaleToGeocentricSurface(d,d)}return t},E}),define("Core/OrientedBoundingBox",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Intersect","./Interval","./Math","./Matrix3","./Plane","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,f,d,h,E){"use strict";function m(e,t){this.center=n.clone(a(e,n.ZERO)),this.halfAxes=d.clone(a(t,d.ZERO))}function _(e,t,r,a,o,u,s,c){i(c)||(c=new m);var l=c.halfAxes;d.setColumn(l,0,e.xAxis,l),d.setColumn(l,1,e.yAxis,l),d.setColumn(l,2,e.zAxis,l);var f=I;f.x=(t+r)/2,f.y=(a+o)/2,f.z=(u+s)/2;var h=O;h.x=(r-t)/2,h.y=(o-a)/2,h.z=(s-u)/2;var E=c.center;return f=d.multiplyByVector(l,f,f),n.add(e.origin,f,E),d.multiplyByScale(l,h,l),c}var p=new n,y=new n,T=new n,R=new n,A=new n,S=new n,N=new d,M={unitary:new d,diagonal:new d};m.fromPoints=function(e,t){if(i(t)||(t=new m),!i(e)||0===e.length)return t.halfAxes=d.ZERO,t.center=n.ZERO,t;var r,a=e.length,o=n.clone(e[0],p);for(r=1;r<a;r++)n.add(o,e[r],o);var u=1/a;n.multiplyByScalar(o,u,o);var s,c=0,l=0,f=0,h=0,E=0,_=0;for(r=0;r<a;r++)s=n.subtract(e[r],o,y),c+=s.x*s.x,l+=s.x*s.y,f+=s.x*s.z,h+=s.y*s.y,E+=s.y*s.z,_+=s.z*s.z;c*=u,l*=u,f*=u,h*=u,E*=u,_*=u;var I=N;I[0]=c,I[1]=l,I[2]=f,I[3]=l,I[4]=h,I[5]=E,I[6]=f,I[7]=E,I[8]=_;var O=d.computeEigenDecomposition(I,M),v=d.clone(O.unitary,t.halfAxes),g=d.getColumn(v,0,R),x=d.getColumn(v,1,A),w=d.getColumn(v,2,S),C=-Number.MAX_VALUE,P=-Number.MAX_VALUE,U=-Number.MAX_VALUE,D=Number.MAX_VALUE,L=Number.MAX_VALUE,F=Number.MAX_VALUE;for(r=0;r<a;r++)s=e[r],C=Math.max(n.dot(g,s),C),P=Math.max(n.dot(x,s),P),U=Math.max(n.dot(w,s),U),D=Math.min(n.dot(g,s),D),L=Math.min(n.dot(x,s),L),F=Math.min(n.dot(w,s),F);g=n.multiplyByScalar(g,.5*(D+C),g),x=n.multiplyByScalar(x,.5*(L+P),x),w=n.multiplyByScalar(w,.5*(F+U),w);var z=n.add(g,x,t.center);z=n.add(z,w,z);var B=T;return B.x=C-D,B.y=P-L,B.z=U-F,n.multiplyByScalar(B,.5,B),d.multiplyByScale(t.halfAxes,B,t.halfAxes),t};var I=new n,O=new n,v=new r,g=new n,x=[new r,new r,new r,new r,new r,new r,new r,new r],w=[new n,new n,new n,new n,new n,new n,new n,new n],C=[new t,new t,new t,new t,new t,new t,new t,new t];m.fromRectangle=function(e,t,n,r,i){t=a(t,0),n=a(n,0),r=a(r,u.WGS84);var o=E.center(e,v),c=r.cartographicToCartesian(o,g),l=new s(c,r),f=l.plane,d=x[0],m=x[1],p=x[2],y=x[3],T=x[4],R=x[5],A=x[6],S=x[7],N=o.longitude,M=e.south<0&&e.north>0?0:o.latitude;A.latitude=R.latitude=T.latitude=e.south,S.latitude=y.latitude=M,d.latitude=m.latitude=p.latitude=e.north,A.longitude=S.longitude=d.longitude=e.west,R.longitude=m.longitude=N,T.longitude=y.longitude=p.longitude=e.east,p.height=m.height=d.height=S.height=A.height=R.height=T.height=y.height=n,r.cartographicArrayToCartesianArray(x,w),l.projectPointsToNearestOnPlane(w,C);var I=Math.min(C[6].x,C[7].x,C[0].x),O=Math.max(C[2].x,C[3].x,C[4].x),P=Math.min(C[4].y,C[5].y,C[6].y),U=Math.max(C[0].y,C[1].y,C[2].y);p.height=d.height=T.height=A.height=t,r.cartographicArrayToCartesianArray(x,w);var D=Math.min(h.getPointDistance(f,w[0]),h.getPointDistance(f,w[2]),h.getPointDistance(f,w[4]),h.getPointDistance(f,w[6])),L=n;return _(l,I,O,P,U,D,L,i)},m.clone=function(e,t){if(i(e))return i(t)?(n.clone(e.center,t.center),d.clone(e.halfAxes,t.halfAxes),t):new m(e.center,e.halfAxes)},m.intersectPlane=function(e,t){var r=e.center,a=t.normal,i=e.halfAxes,o=a.x,u=a.y,s=a.z,l=Math.abs(o*i[d.COLUMN0ROW0]+u*i[d.COLUMN0ROW1]+s*i[d.COLUMN0ROW2])+Math.abs(o*i[d.COLUMN1ROW0]+u*i[d.COLUMN1ROW1]+s*i[d.COLUMN1ROW2])+Math.abs(o*i[d.COLUMN2ROW0]+u*i[d.COLUMN2ROW1]+s*i[d.COLUMN2ROW2]),f=n.dot(a,r)+t.distance;return f<=-l?c.OUTSIDE:f>=l?c.INSIDE:c.INTERSECTING};var P=new n,U=new n,D=new n,L=new n;m.distanceSquaredTo=function(e,t){var r=n.subtract(t,e.center,I),a=e.halfAxes,i=d.getColumn(a,0,P),o=d.getColumn(a,1,U),u=d.getColumn(a,2,D),s=n.magnitude(i),c=n.magnitude(o),l=n.magnitude(u);n.normalize(i,i),n.normalize(o,o),n.normalize(u,u);var f=L;f.x=n.dot(r,i),f.y=n.dot(r,o),f.z=n.dot(r,u);var h,E=0;return f.x<-s?(h=f.x+s,E+=h*h):f.x>s&&(h=f.x-s,E+=h*h),f.y<-c?(h=f.y+c,E+=h*h):f.y>c&&(h=f.y-c,E+=h*h),f.z<-l?(h=f.z+l,E+=h*h):f.z>l&&(h=f.z-l,E+=h*h),E};var F=new n,z=new n;m.computePlaneDistances=function(e,t,r,a){i(a)||(a=new l);var o=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,s=e.center,c=e.halfAxes,f=d.getColumn(c,0,P),h=d.getColumn(c,1,U),E=d.getColumn(c,2,D),m=n.add(f,h,F);n.add(m,E,m),n.add(m,s,m);var _=n.subtract(m,t,z),p=n.dot(r,_);return o=Math.min(p,o),u=Math.max(p,u),n.add(s,f,m),n.add(m,h,m),n.subtract(m,E,m),n.subtract(m,t,_),p=n.dot(r,_),o=Math.min(p,o),u=Math.max(p,u),n.add(s,f,m),n.subtract(m,h,m),n.add(m,E,m),n.subtract(m,t,_),p=n.dot(r,_),o=Math.min(p,o),u=Math.max(p,u),n.add(s,f,m),n.subtract(m,h,m),n.subtract(m,E,m),n.subtract(m,t,_),p=n.dot(r,_),o=Math.min(p,o),u=Math.max(p,u),n.subtract(s,f,m),n.add(m,h,m),n.add(m,E,m),n.subtract(m,t,_),p=n.dot(r,_),o=Math.min(p,o),u=Math.max(p,u),n.subtract(s,f,m),n.add(m,h,m),n.subtract(m,E,m),n.subtract(m,t,_),p=n.dot(r,_),o=Math.min(p,o),u=Math.max(p,u),n.subtract(s,f,m),n.subtract(m,h,m),n.add(m,E,m),n.subtract(m,t,_),p=n.dot(r,_),o=Math.min(p,o),u=Math.max(p,u),n.subtract(s,f,m),n.subtract(m,h,m),n.subtract(m,E,m),n.subtract(m,t,_),p=n.dot(r,_),o=Math.min(p,o),u=Math.max(p,u),a.start=o,a.stop=u,a};var B=new e;return m.isOccluded=function(t,n){var r=e.fromOrientedBoundingBox(t,B);return!n.isBoundingSphereVisible(r)},m.prototype.intersectPlane=function(e){return m.intersectPlane(this,e)},m.prototype.distanceSquaredTo=function(e){return m.distanceSquaredTo(this,e)},m.prototype.computePlaneDistances=function(e,t,n){return m.computePlaneDistances(this,e,t,n)},m.prototype.isOccluded=function(e){return m.isOccluded(this,e)},m.equals=function(e,t){return e===t||i(e)&&i(t)&&n.equals(e.center,t.center)&&d.equals(e.halfAxes,t.halfAxes)},m.prototype.clone=function(e){return m.clone(this,e)},m.prototype.equals=function(e){return m.equals(this,e)},m}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r,a){"use strict";var i={};i.octEncodeInRange=function(e,t,n){if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var r=n.x,i=n.y;n.x=(1-Math.abs(i))*a.signNotZero(r),n.y=(1-Math.abs(r))*a.signNotZero(i)}return n.x=a.toSNorm(n.x,t),n.y=a.toSNorm(n.y,t),n},i.octEncode=function(e,t){return i.octEncodeInRange(e,255,t)},i.octDecodeInRange=function(e,n,r,i){if(i.x=a.fromSNorm(e,r),i.y=a.fromSNorm(n,r),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){var o=i.x;i.x=(1-Math.abs(i.y))*a.signNotZero(o),i.y=(1-Math.abs(o))*a.signNotZero(i.y)}return t.normalize(i,i)},i.octDecode=function(e,t,n){return i.octDecodeInRange(e,t,255,n)},i.octPackFloat=function(e){return 256*e.x+e.y};var o=new e;return i.octEncodeFloat=function(e){return i.octEncode(e,o),i.octPackFloat(o)},i.octDecodeFloat=function(e,t){var n=e/256,r=Math.floor(n),a=256*(n-r);return i.octDecode(r,a,t)},i.octPack=function(e,t,n,r){var a=i.octEncodeFloat(e),u=i.octEncodeFloat(t),s=i.octEncode(n,o);return r.x=65536*s.x+a,r.y=65536*s.y+u,r},i.octUnpack=function(e,t,n,r){var a=e.x/65536,o=Math.floor(a),u=65536*(a-o);a=e.y/65536;var s=Math.floor(a),c=65536*(a-s);i.octDecodeFloat(u,t),i.octDecodeFloat(c,n),i.octDecode(o,s,r)},i.compressTextureCoordinates=function(e){var t=4095*e.x|0,n=4095*e.y|0;return 4096*t+n},i.decompressTextureCoordinates=function(e,t){var n=e/4096,r=Math.floor(n);return t.x=r/4095,t.y=(e-4096*r)/4095,t},i}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,a,i){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){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.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},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 Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,a){switch(r=e(r,0),a=e(a,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,a);case o.SHORT:return new Int16Array(n,r,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,a);case o.INT:return new Int32Array(n,r,a);case o.UNSIGNED_INT:return new Uint32Array(n,r,a);case o.FLOAT:return new Float32Array(n,r,a);case o.DOUBLE:return new Float64Array(n,r,a)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/TerrainQuantization",["./freezeObject"],function(e){"use strict";var t={NONE:0,BITS12:1};return e(t)}),define("Core/TerrainEncoding",["./AttributeCompression","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./Math","./Matrix4","./TerrainQuantization"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(e,t,r,o,c,d){var _,p,y,T;if(i(e)&&i(t)&&i(r)&&i(o)){var R=e.minimum,A=e.maximum,S=n.subtract(A,R,f),N=r-t,M=Math.max(n.maximumComponent(S),N);_=M<m-1?s.BITS12:s.NONE,p=e.center,y=u.inverseTransformation(o,new u);var I=n.negate(R,l);u.multiply(u.fromTranslation(I,h),y,y);var O=l;O.x=1/S.x,O.y=1/S.y,O.z=1/S.z,u.multiply(u.fromScale(O,h),y,y),T=u.clone(o),u.setTranslation(T,n.ZERO,T),o=u.clone(o,new u);var v=u.fromTranslation(R,h),g=u.fromScale(S,E),x=u.multiply(v,g,h);u.multiply(o,x,o),u.multiply(T,x,T)}this.quantization=_,this.minimumHeight=t,this.maximumHeight=r,this.center=p,this.toScaledENU=y,this.fromScaledENU=o,this.matrix=T,this.hasVertexNormals=c,this.hasWebMercatorT=a(d,!1)}var l=new n,f=new n,d=new t,h=new u,E=new u,m=Math.pow(2,12);c.prototype.encode=function(r,a,i,c,f,h,E){var m=c.x,_=c.y;if(this.quantization===s.BITS12){i=u.multiplyByPoint(this.toScaledENU,i,l),i.x=o.clamp(i.x,0,1),i.y=o.clamp(i.y,0,1),i.z=o.clamp(i.z,0,1);var p=this.maximumHeight-this.minimumHeight,y=o.clamp((f-this.minimumHeight)/p,0,1);t.fromElements(i.x,i.y,d);var T=e.compressTextureCoordinates(d);t.fromElements(i.z,y,d);var R=e.compressTextureCoordinates(d);t.fromElements(m,_,d);var A=e.compressTextureCoordinates(d);if(r[a++]=T,r[a++]=R,r[a++]=A,this.hasWebMercatorT){t.fromElements(E,0,d);var S=e.compressTextureCoordinates(d);r[a++]=S}}else n.subtract(i,this.center,l),r[a++]=l.x,r[a++]=l.y,r[a++]=l.z,r[a++]=f,r[a++]=m,r[a++]=_,this.hasWebMercatorT&&(r[a++]=E);return this.hasVertexNormals&&(r[a++]=e.octPackFloat(h)),a},c.prototype.decodePosition=function(t,r,a){if(i(a)||(a=new n),r*=this.getStride(),this.quantization===s.BITS12){var o=e.decompressTextureCoordinates(t[r],d);a.x=o.x,a.y=o.y;var c=e.decompressTextureCoordinates(t[r+1],d);return a.z=c.x,u.multiplyByPoint(this.fromScaledENU,a,a)}return a.x=t[r],a.y=t[r+1],a.z=t[r+2],n.add(a,this.center,a)},c.prototype.decodeTextureCoordinates=function(n,r,a){return i(a)||(a=new t),r*=this.getStride(),this.quantization===s.BITS12?e.decompressTextureCoordinates(n[r+2],a):t.fromElements(n[r+4],n[r+5],a)},c.prototype.decodeHeight=function(t,n){if(n*=this.getStride(),this.quantization===s.BITS12){var r=e.decompressTextureCoordinates(t[n+1],d);return r.y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight}return t[n+3]},c.prototype.getOctEncodedNormal=function(e,n,r){var a=this.getStride();n=(n+1)*a-1;var i=e[n]/256,o=Math.floor(i),u=256*(i-o);return t.fromElements(o,u,r)},c.prototype.getStride=function(){var e;switch(this.quantization){case s.BITS12:e=3;break;default:e=6}return this.hasWebMercatorT&&++e,this.hasVertexNormals&&++e,e};var _={position3DAndHeight:0,textureCoordAndEncodedNormals:1},p={compressed0:0,compressed1:1};return c.prototype.getAttributes=function(e){var t,n=r.FLOAT,a=r.getSizeInBytes(n);if(this.quantization===s.NONE){var i=4,o=2;return this.hasWebMercatorT&&++o,this.hasVertexNormals&&++o,t=(i+o)*a,[{index:_.position3DAndHeight,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:i,offsetInBytes:0,strideInBytes:t},{index:_.textureCoordAndEncodedNormals,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:o,offsetInBytes:i*a,strideInBytes:t}]}var u=3,c=0;return(this.hasWebMercatorT||this.hasVertexNormals)&&++u,this.hasWebMercatorT&&this.hasVertexNormals?(++c,t=(u+c)*a,[{index:p.compressed0,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:u,offsetInBytes:0,strideInBytes:t},{index:p.compressed1,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:c,offsetInBytes:u*a,strideInBytes:t}]):[{index:p.compressed0,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:u}]},c.prototype.getAttributeLocations=function(){return this.quantization===s.NONE?_:p},c.clone=function(e,t){return i(t)||(t=new c),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=n.clone(e.center),t.toScaledENU=u.clone(e.toScaledENU),t.fromScaledENU=u.clone(e.fromScaledENU),t.matrix=u.clone(e.matrix),t.hasVertexNormals=e.hasVertexNormals,t.hasWebMercatorT=e.hasWebMercatorT,t},c}),define("Core/WebMercatorProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(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,n){var a=this._semimajorAxis,i=t.longitude*a,o=s.geodeticLatitudeToMercatorAngle(t.latitude)*a,u=t.height; +return r(n)?(n.x=i,n.y=o,n.z=u,n):new e(i,o,u)},s.prototype.unproject=function(e,n){var a=this._oneOverSemimajorAxis,i=e.x*a,o=s.mercatorAngleToGeodeticLatitude(e.y*a),u=e.z;return r(n)?(n.longitude=i,n.latitude=o,n.height=u,n):new t(i,o,u)},s}),define("Core/HeightmapTessellator",["./AxisAlignedBoundingBox","./BoundingSphere","./Cartesian2","./Cartesian3","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidalOccluder","./freezeObject","./Math","./Matrix4","./OrientedBoundingBox","./Rectangle","./TerrainEncoding","./Transforms","./WebMercatorProjection"],function(e,t,n,r,a,i,o,u,s,c,l,f,d,h,E,m,_){"use strict";var p={};p.DEFAULT_STRUCTURE=c({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var y=new r,T=new f,R=new r,A=new r;return p.computeVertices=function(o){var c,S,N,M,I=Math.cos,O=Math.sin,v=Math.sqrt,g=Math.atan,x=Math.exp,w=l.PI_OVER_TWO,C=l.toRadians,P=o.heightmap,U=o.width,D=o.height,L=o.skirtHeight,F=a(o.isGeographic,!0),z=a(o.ellipsoid,u.WGS84),B=1/z.maximumRadius,b=o.nativeRectangle,q=o.rectangle;i(q)?(c=q.west,S=q.south,N=q.east,M=q.north):F?(c=C(b.west),S=C(b.south),N=C(b.east),M=C(b.north)):(c=b.west*B,S=w-2*g(x(-b.south*B)),N=b.east*B,M=w-2*g(x(-b.north*B)));var G=o.relativeToCenter,W=i(G);G=W?G:r.ZERO;var X,V,H=a(o.exaggeration,1),Y=a(o.includeWebMercatorT,!1),k=a(o.structure,p.DEFAULT_STRUCTURE),j=a(k.heightScale,p.DEFAULT_STRUCTURE.heightScale),Z=a(k.heightOffset,p.DEFAULT_STRUCTURE.heightOffset),K=a(k.elementsPerHeight,p.DEFAULT_STRUCTURE.elementsPerHeight),J=a(k.stride,p.DEFAULT_STRUCTURE.stride),Q=a(k.elementMultiplier,p.DEFAULT_STRUCTURE.elementMultiplier),$=a(k.isBigEndian,p.DEFAULT_STRUCTURE.isBigEndian),ee=h.computeWidth(b)/(U-1),te=h.computeHeight(b)/(D-1),ne=z.radiiSquared,re=ne.x,ae=ne.y,ie=ne.z,oe=65536,ue=-65536,se=m.eastNorthUpToFixedFrame(G,z),ce=f.inverseTransformation(se,T);Y&&(X=_.geodeticLatitudeToMercatorAngle(S),V=1/(_.geodeticLatitudeToMercatorAngle(M)-X));var le=R;le.x=Number.POSITIVE_INFINITY,le.y=Number.POSITIVE_INFINITY,le.z=Number.POSITIVE_INFINITY;var fe=A;fe.x=Number.NEGATIVE_INFINITY,fe.y=Number.NEGATIVE_INFINITY,fe.z=Number.NEGATIVE_INFINITY;var de=Number.POSITIVE_INFINITY,he=U+(L>0?2:0),Ee=D+(L>0?2:0),me=he*Ee,_e=new Array(me),pe=new Array(me),ye=new Array(me),Te=Y?new Array(me):[],Re=0,Ae=D,Se=0,Ne=U;L>0&&(--Re,++Ae,--Se,++Ne);for(var Me=0,Ie=Re;Ie<Ae;++Ie){var Oe=Ie;Oe<0&&(Oe=0),Oe>=D&&(Oe=D-1);var ve=b.north-te*Oe;ve=F?C(ve):w-2*g(x(-ve*B));var ge=I(ve),xe=O(ve),we=ie*xe,Ce=(ve-S)/(M-S);Ce=l.clamp(Ce,0,1);var Pe;Y&&(Pe=(_.geodeticLatitudeToMercatorAngle(ve)-X)*V);for(var Ue=Se;Ue<Ne;++Ue){var De=Ue;De<0&&(De=0),De>=U&&(De=U-1);var Le=b.west+ee*De;F?Le=C(Le):Le*=B;var Fe,ze=Oe*(U*J)+De*J;if(1===K)Fe=P[ze];else{Fe=0;var Be;if($)for(Be=0;Be<K;++Be)Fe=Fe*Q+P[ze+Be];else for(Be=K-1;Be>=0;--Be)Fe=Fe*Q+P[ze+Be]}Fe=(Fe*j+Z)*H,ue=Math.max(ue,Fe),oe=Math.min(oe,Fe),Ue===De&&Ie===Oe||(Fe-=L);var be=ge*I(Le),qe=ge*O(Le),Ge=re*be,We=ae*qe,Xe=v(Ge*be+We*qe+we*xe),Ve=1/Xe,He=Ge*Ve,Ye=We*Ve,ke=we*Ve,je=new r;je.x=He+be*Fe,je.y=Ye+qe*Fe,je.z=ke+xe*Fe,_e[Me]=je,pe[Me]=Fe;var Ze=(Le-c)/(N-c);Ze=l.clamp(Ze,0,1),ye[Me]=new n(Ze,Ce),Y&&(Te[Me]=Pe),Me++,f.multiplyByPoint(ce,je,y),r.minimumByComponent(y,le,le),r.maximumByComponent(y,fe,fe),de=Math.min(de,Fe)}}var Ke,Je=t.fromPoints(_e);i(q)&&q.width<l.PI_OVER_TWO+l.EPSILON5&&(Ke=d.fromRectangle(q,oe,ue,z));var Qe;if(W){var $e=new s(z);Qe=$e.computeHorizonCullingPoint(G,_e)}for(var et=new e(le,fe,G),tt=new E(et,de,ue,se,!1,Y),nt=new Float32Array(me*tt.getStride()),rt=0,at=0;at<me;++at)rt=tt.encode(nt,rt,_e[at],ye[at],pe[at],void 0,Te[at]);return{vertices:nt,maximumHeight:ue,minimumHeight:oe,encoding:tt,boundingSphere3D:Je,orientedBoundingBox:Ke,occludeePointInScaledSpace:Qe}},p}),define("Core/formatError",["./defined"],function(e){"use strict";function t(t){var n,r=t.name,a=t.message;n=e(r)&&e(a)?r+": "+a:t.toString();var i=t.stack;return e(i)&&(n+="\n"+i),n}return t}),define("Workers/createTaskProcessorWorker",["../Core/defaultValue","../Core/defined","../Core/formatError"],function(e,t,n){"use strict";function r(r){var a,i=[],o={id:void 0,result:void 0,error:void 0};return function(u){var s=u.data;i.length=0,o.id=s.id,o.error=void 0,o.result=void 0;try{o.result=r(s.parameters,i)}catch(e){e instanceof Error?o.error={name:e.name,message:e.message,stack:e.stack}:o.error=e}t(a)||(a=e(self.webkitPostMessage,self.postMessage)),s.canTransferArrayBuffer||(i.length=0);try{a(o,i)}catch(e){o.result=void 0,o.error="postMessage failed with error: "+n(e)+"\n with responseMessage: "+JSON.stringify(o),a(o)}}}return r}),define("Workers/createVerticesFromHeightmap",["../Core/Ellipsoid","../Core/HeightmapTessellator","../Core/Rectangle","./createTaskProcessorWorker"],function(e,t,n,r){"use strict";function a(r,a){var i=r.width,o=r.height;r.skirtHeight>0&&(i+=2,o+=2),r.ellipsoid=e.clone(r.ellipsoid),r.rectangle=n.clone(r.rectangle);var u=t.computeVertices(r),s=u.vertices;return a.push(s.buffer),{vertices:s.buffer,numberOfAttributes:u.encoding.getStride(),minimumHeight:u.minimumHeight,maximumHeight:u.maximumHeight,gridWidth:i,gridHeight:o,boundingSphere3D:u.boundingSphere3D,orientedBoundingBox:u.orientedBoundingBox,occludeePointInScaledSpace:u.occludeePointInScaledSpace,encoding:u.encoding}}return r(a)})}(); \ No newline at end of file diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createVerticesFromQuantizedTerrainMesh.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createVerticesFromQuantizedTerrainMesh.js index d70d7612..735e8222 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createVerticesFromQuantizedTerrainMesh.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createVerticesFromQuantizedTerrainMesh.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -222,9 +222,9 @@ OTHER DEALINGS IN THE SOFTWARE. * */ -!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==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";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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 n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(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^=e<<7&2636928640,e^=e<<15&4022730752,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,n,r){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:e<0?-1:0},a.signNotZero=function(e){return e<0?-1:1},a.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*a.clamp(e,-1,1)+.5)*n)},a.fromSNorm=function(e,n){return n=t(n,255),a.clamp(e,0,n)/n*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},a.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},a.lerp=function(e,t,n){return(1-n)*e+n*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){var t=a.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},a.clampToLatitudeRange=function(e){return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){return(e%t+t)%t},a.equalsEpsilon=function(e,n,r,a){a=t(a,r);var i=Math.abs(e-n);return i<=a||i<=r*Math.max(Math.abs(e),Math.abs(n))};var i=[1];a.factorial=function(e){var t=i.length;if(e>=t)for(var n=i[t-1],r=t;r<=e;r++)i.push(n*r);return i[e]},a.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},a.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return a.setRandomNumberSeed=function(t){o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(e){return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){return Math.log(e)/Math.log(t)},a.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},a}),define("Core/Cartesian2",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a){"use strict";function i(t,n){this.x=e(t,0),this.y=e(n,0)}i.fromElements=function(e,n,r){return t(r)?(r.x=e,r.y=n,r):new i(e,n)},i.clone=function(e,n){if(t(e))return t(n)?(n.x=e.x,n.y=e.y,n):new i(e.x,e.y)},i.fromCartesian3=i.clone,i.fromCartesian4=i.clone,i.packedLength=2,i.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r]=t.y,n},i.unpack=function(n,r,a){return r=e(r,0),t(a)||(a=new i),a.x=n[r++],a.y=n[r],a},i.packArray=function(e,n){var r=e.length;t(n)?n.length=2*r:n=new Array(2*r);for(var a=0;a<r;++a)i.pack(e[a],n,2*a);return n},i.unpackArray=function(e,n){var r=e.length;t(n)?n.length=r/2:n=new Array(r/2);for(var a=0;a<r;a+=2){var o=a/2;n[o]=i.unpack(e,a,n[o])}return n},i.fromArray=i.unpack,i.maximumComponent=function(e){return Math.max(e.x,e.y)},i.minimumComponent=function(e){return Math.min(e.x,e.y)},i.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},i.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},i.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},i.magnitude=function(e){return Math.sqrt(i.magnitudeSquared(e))};var o=new i;i.distance=function(e,t){return i.subtract(e,t,o),i.magnitude(o)},i.distanceSquared=function(e,t){return i.subtract(e,t,o),i.magnitudeSquared(o)},i.normalize=function(e,t){var n=i.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t},i.dot=function(e,t){return e.x*t.x+e.y*t.y},i.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n},i.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n},i.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n},i.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n},i.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n},i.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n},i.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},i.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var u=new i;i.lerp=function(e,t,n,r){return i.multiplyByScalar(t,n,u),r=i.multiplyByScalar(e,1-n,r),i.add(u,r,r)};var s=new i,c=new i;i.angleBetween=function(e,t){return i.normalize(e,s),i.normalize(t,c),a.acosClamped(i.dot(s,c))};var l=new i;return i.mostOrthogonalAxis=function(e,t){var n=i.normalize(e,l);return i.abs(n,n),t=n.x<=n.y?i.clone(i.UNIT_X,t):i.clone(i.UNIT_Y,t)},i.equals=function(e,n){return e===n||t(e)&&t(n)&&e.x===n.x&&e.y===n.y},i.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},i.equalsEpsilon=function(e,n,r,i){return e===n||t(e)&&t(n)&&a.equalsEpsilon(e.x,n.x,r,i)&&a.equalsEpsilon(e.y,n.y,r,i)},i.ZERO=r(new i(0,0)),i.UNIT_X=r(new i(1,0)),i.UNIT_Y=r(new i(0,1)),i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i.prototype.equalsEpsilon=function(e,t,n){return i.equalsEpsilon(this,e,t,n)},i.prototype.toString=function(){return"("+this.x+", "+this.y+")"},i}),define("Core/isArray",["./defined"],function(e){"use strict";var t=Array.isArray;return e(t)||(t=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),t}),define("Core/Check",["./defaultValue","./defined","./DeveloperError","./isArray"],function(e,t,n,r){"use strict";function a(e){return e+" was required but undefined."}function i(e,t,n){return"Expected "+n+" to be typeof "+t+", got "+e}var o={};return o.typeOf={},o.numeric={},o.defined=function(e,r){if(!t(e))throw new n(a(r))},o.numeric.maximum=function(e,t){if(o.typeOf.number(e),o.typeOf.number(t),e>t)throw new n("Expected "+e+" to be at most "+t)},o.numeric.minimum=function(e,t){if(o.typeOf.number(e),o.typeOf.number(t),e<t)throw new n("Expected "+e+" to be at least "+t)},o.typeOf.function=function(e,t){if("function"!=typeof e)throw new n(i(typeof e,"function",t))},o.typeOf.string=function(e,t){if("string"!=typeof e)throw new n(i(typeof e,"string",t))},o.typeOf.number=function(e,t){if("number"!=typeof e)throw new n(i(typeof e,"number",t))},o.typeOf.object=function(e,t){if("object"!=typeof e)throw new n(i(typeof e,"object",t))},o.typeOf.boolean=function(e,t){if("boolean"!=typeof e)throw new n(i(typeof e,"boolean",t))},o}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var a=e.clock,i=e.cone,u=t(e.magnitude,1),s=u*Math.sin(i);return r.x=s*Math.cos(a),r.y=s*Math.sin(a),r.z=u*Math.cos(i),r},o.fromElements=function(e,t,r,a){return n(a)?(a.x=e,a.y=t,a.z=r,a):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var a=0;a<r;++a)o.pack(e[a],t,3*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var a=0;a<r;a+=3){var i=a/3;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,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};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var n=o.dot(c,l),r=o.magnitude(o.cross(c,l,c));return Math.atan2(r,n)};var f=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)},o.cross=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=t.x,u=t.y,s=t.z,c=a*s-i*u,l=i*o-r*s,f=r*u-a*o;return n.x=c,n.y=l,n.z=f,n},o.fromDegrees=function(e,t,n,r,a){return e=i.toRadians(e),t=i.toRadians(t),o.fromRadians(e,t,n,r,a)};var d=new o,h=new o,E=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,a,i,u){a=t(a,0);var s=n(i)?i.radiiSquared:E,c=Math.cos(r);d.x=c*Math.cos(e),d.y=c*Math.sin(e),d.z=Math.sin(r),d=o.normalize(d,d),o.multiplyComponents(s,d,h);var l=Math.sqrt(o.dot(d,h));return h=o.divideByScalar(h,l,h),d=o.multiplyByScalar(d,a,d),n(u)||(u=new o),o.add(h,d,u)},o.fromDegreesArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromDegrees(u,s,0,t,r[c])}return r},o.fromRadiansArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromRadians(u,s,0,t,r[c])}return r},o.fromDegreesArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromDegrees(u,s,c,t,r[l])}return r},o.fromRadiansArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromRadians(u,s,c,t,r[l])}return r},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(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,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r,a){"use strict";var i={};i.octEncodeInRange=function(e,t,n){if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var r=n.x,i=n.y;n.x=(1-Math.abs(i))*a.signNotZero(r),n.y=(1-Math.abs(r))*a.signNotZero(i)}return n.x=a.toSNorm(n.x,t),n.y=a.toSNorm(n.y,t),n},i.octEncode=function(e,t){return i.octEncodeInRange(e,255,t)},i.octDecodeInRange=function(e,n,r,i){if(i.x=a.fromSNorm(e,r),i.y=a.fromSNorm(n,r),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){var o=i.x;i.x=(1-Math.abs(i.y))*a.signNotZero(o),i.y=(1-Math.abs(o))*a.signNotZero(i.y)}return t.normalize(i,i)},i.octDecode=function(e,t,n){return i.octDecodeInRange(e,t,255,n)},i.octPackFloat=function(e){return 256*e.x+e.y};var o=new e;return i.octEncodeFloat=function(e){return i.octEncode(e,o),i.octPackFloat(o)},i.octDecodeFloat=function(e,t){var n=e/256,r=Math.floor(n),a=256*(n-r);return i.octDecode(r,a,t)},i.octPack=function(e,t,n,r){var a=i.octEncodeFloat(e),u=i.octEncodeFloat(t),s=i.octEncode(n,o);return r.x=65536*s.x+a,r.y=65536*s.y+u,r},i.octUnpack=function(e,t,n,r){var a=e.x/65536,o=Math.floor(a),u=65536*(a-o);a=e.y/65536;var s=Math.floor(a),c=65536*(a-s);i.octDecodeFloat(u,t),i.octDecodeFloat(c,n),i.octDecode(o,s,r)},i.compressTextureCoordinates=function(e){var t=4095*e.x|0,n=4095*e.y|0;return 4096*t+n},i.decompressTextureCoordinates=function(e,t){var n=e/4096,r=Math.floor(n);return t.x=r/4095,t.y=(e-4096*r)/4095,t},i}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Intersect"],function(e,t,n,r,a){"use strict";function i(r,a,i){this.minimum=e.clone(t(r,e.ZERO)),this.maximum=e.clone(t(a,e.ZERO)),n(i)?i=e.clone(i):(i=e.add(this.minimum,this.maximum,new e),e.multiplyByScalar(i,.5,i)),this.center=i}i.fromPoints=function(t,r){if(n(r)||(r=new i),!n(t)||0===t.length)return r.minimum=e.clone(e.ZERO,r.minimum),r.maximum=e.clone(e.ZERO,r.maximum),r.center=e.clone(e.ZERO,r.center),r;for(var a=t[0].x,o=t[0].y,u=t[0].z,s=t[0].x,c=t[0].y,l=t[0].z,f=t.length,d=1;d<f;d++){var h=t[d],E=h.x,m=h.y,_=h.z;a=Math.min(E,a),s=Math.max(E,s),o=Math.min(m,o),c=Math.max(m,c),u=Math.min(_,u),l=Math.max(_,l)}var y=r.minimum;y.x=a,y.y=o,y.z=u;var p=r.maximum;p.x=s,p.y=c,p.z=l;var T=e.add(y,p,r.center);return e.multiplyByScalar(T,.5,T),r},i.clone=function(t,r){if(n(t))return n(r)?(r.minimum=e.clone(t.minimum,r.minimum),r.maximum=e.clone(t.maximum,r.maximum),r.center=e.clone(t.center,r.center),r):new i(t.minimum,t.maximum)},i.equals=function(t,r){return t===r||n(t)&&n(r)&&e.equals(t.center,r.center)&&e.equals(t.minimum,r.minimum)&&e.equals(t.maximum,r.maximum)};var o=new e;return i.intersectPlane=function(t,n){o=e.subtract(t.maximum,t.minimum,o);var r=e.multiplyByScalar(o,.5,o),i=n.normal,u=r.x*Math.abs(i.x)+r.y*Math.abs(i.y)+r.z*Math.abs(i.z),s=e.dot(t.center,i)+n.distance;return s-u>0?a.INSIDE:s+u<0?a.OUTSIDE:a.INTERSECTING},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.intersectPlane=function(e){return i.intersectPlane(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(n,a,u,s,c){var l=n.x,f=n.y,d=n.z,h=a.x,E=a.y,m=a.z,_=l*l*h*h,y=f*f*E*E,p=d*d*m*m,T=_+y+p,R=Math.sqrt(1/T),A=e.multiplyByScalar(n,R,i);if(T<s)return isFinite(R)?e.clone(A,c):void 0;var N=u.x,S=u.y,I=u.z,M=o;M.x=A.x*N*2,M.y=A.y*S*2,M.z=A.z*I*2;var O,g,v,x,w,C,P,U,D,L,F,z=(1-R)*e.magnitude(n)/(.5*e.magnitude(M)),B=0;do{z-=B,v=1/(1+z*N),x=1/(1+z*S),w=1/(1+z*I),C=v*v,P=x*x,U=w*w,D=C*v,L=P*x,F=U*w,O=_*C+y*P+p*U-1,g=_*D*N+y*L*S+p*F*I;var b=-2*g;B=O/b}while(Math.abs(O)>r.EPSILON12);return t(c)?(c.x=l*v,c.y=f*x,c.z=d*w,c):new e(l*v,f*x,d*w)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o){"use strict";function u(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)}u.fromRadians=function(e,r,a,i){return a=t(a,0),n(i)?(i.longitude=e,i.latitude=r,i.height=a,i):new u(e,r,a)},u.fromDegrees=function(e,t,n,r){return e=i.toRadians(e),t=i.toRadians(t),u.fromRadians(e,t,n,r)};var s=new e,c=new e,l=new e,f=new e(1/6378137,1/6378137,1/6356752.314245179),d=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),h=i.EPSILON1;return u.fromCartesian=function(t,r,a){var E=n(r)?r.oneOverRadii:f,m=n(r)?r.oneOverRadiiSquared:d,_=n(r)?r._centerToleranceSquared:h,y=o(t,E,m,_,c);if(n(y)){var p=e.multiplyComponents(y,m,s);p=e.normalize(p,p);var T=e.subtract(t,y,l),R=Math.atan2(p.y,p.x),A=Math.asin(p.z),N=i.sign(e.dot(T,t))*e.magnitude(T);return n(a)?(a.longitude=R,a.latitude=A,a.height=N,a):new u(R,A,N)}},u.clone=function(e,t){if(n(e))return n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},u.ZERO=a(new u(0,0,0)),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,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(t,r,a,i){r=n(r,0),a=n(a,0),i=n(i,0),t._radii=new e(r,a,i),t._radiiSquared=new e(r*r,a*a,i*i),t._radiiToTheFourth=new e(r*r*r*r,a*a*a*a,i*i*i*i),t._oneOverRadii=new e(0===r?0:1/r,0===a?0:1/a,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===a?0:1/(a*a),0===i?0:1/(i*i)),t._minimumRadius=Math.min(r,a,i),t._maximumRadius=Math.max(r,a,i),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,c(this,e,t,n)}a(l.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}}}),l.clone=function(t,n){if(r(t)){var a=t._radii;return r(n)?(e.clone(a,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new l(a.x,a.y,a.z)}},l.fromCartesian3=function(e,t){return r(t)||(t=new l),r(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,r,a){return a=n(a,0),e.pack(t._radii,r,a),r},l.unpack=function(t,r,a){r=n(r,0);var i=e.unpack(t,r);return l.fromCartesian3(i,a)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,n){var a=t.longitude,i=t.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return r(n)||(n=new e),n.x=u,n.y=s,n.z=c,e.normalize(n,n)},l.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var f=new e,d=new e;l.prototype.cartographicToCartesian=function(t,n){var a=f,i=d;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(e.dot(a,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(a,t.height,a),r(n)||(n=new e),e.add(i,a,n)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var h=new e,E=new e,m=new e;return l.prototype.cartesianToCartographic=function(n,a){var i=this.scaleToGeodeticSurface(n,E);if(r(i)){var o=this.geodeticSurfaceNormal(i,h),s=e.subtract(n,i,m),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),f=u.sign(e.dot(s,n))*e.magnitude(s);return r(a)?(a.longitude=c,a.latitude=l,a.height=f,a):new t(c,l,f)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var a=t.x,i=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return e.multiplyByScalar(t,s,n)},l.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},l.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},l.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,a,i){a=n(a,0);var o=this._sqauredXOverSquaredZ;if(r(i)||(i=new e),i.x=0,i.y=0,i.z=t.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},l}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,a,i,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return r(n)?(n.x=i,n.y=o,n.z=u,n):new e(i,o,u)},u.prototype.unproject=function(e,n){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,u=e.z;return r(n)?(n.longitude=i,n.latitude=o,n.height=u,n):new t(i,o,u)},u}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i,o){"use strict";function u(e,n,r,a,i,o,u,s,c){this[0]=t(e,0),this[1]=t(a,0),this[2]=t(u,0),this[3]=t(n,0),this[4]=t(i,0),this[5]=t(s,0),this[6]=t(r,0),this[7]=t(o,0),this[8]=t(c,0)}function s(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function c(e){for(var t=0,n=0;n<3;++n){var r=e[u.getElementIndex(E[n],h[n])];t+=2*r*r}return Math.sqrt(t)}function l(e,t){for(var n=o.EPSILON15,r=0,a=1,i=0;i<3;++i){var s=Math.abs(e[u.getElementIndex(E[i],h[i])]);s>r&&(a=i,r=s)}var c=1,l=0,f=h[a],d=E[a];if(Math.abs(e[u.getElementIndex(d,f)])>n){var m,_=e[u.getElementIndex(d,d)],y=e[u.getElementIndex(f,f)],p=e[u.getElementIndex(d,f)],T=(_-y)/2/p;m=T<0?-1/(-T+Math.sqrt(1+T*T)):1/(T+Math.sqrt(1+T*T)),c=1/Math.sqrt(1+m*m),l=m*c}return t=u.clone(u.IDENTITY,t),t[u.getElementIndex(f,f)]=t[u.getElementIndex(d,d)]=c,t[u.getElementIndex(d,f)]=l,t[u.getElementIndex(f,d)]=-l,t}u.packedLength=9,u.pack=function(e,n,r){return r=t(r,0),n[r++]=e[0],n[r++]=e[1],n[r++]=e[2],n[r++]=e[3],n[r++]=e[4],n[r++]=e[5],n[r++]=e[6],n[r++]=e[7],n[r++]=e[8],n},u.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new u),a[0]=e[r++],a[1]=e[r++],a[2]=e[r++],a[3]=e[r++],a[4]=e[r++],a[5]=e[r++],a[6]=e[r++],a[7]=e[r++],a[8]=e[r++],a},u.clone=function(e,t){if(n(e))return n(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 u(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},u.fromArray=function(e,r,a){return r=t(r,0),n(a)||(a=new u),a[0]=e[r],a[1]=e[r+1],a[2]=e[r+2],a[3]=e[r+3],a[4]=e[r+4],a[5]=e[r+5],a[6]=e[r+6],a[7]=e[r+7],a[8]=e[r+8],a},u.fromColumnMajorArray=function(e,t){return u.clone(e,t)},u.fromRowMajorArray=function(e,t){return n(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 u(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},u.fromQuaternion=function(e,t){var r=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,s=e.y*e.y,c=e.y*e.z,l=e.y*e.w,f=e.z*e.z,d=e.z*e.w,h=e.w*e.w,E=r-s-f+h,m=2*(a-d),_=2*(i+l),y=2*(a+d),p=-r+s-f+h,T=2*(c-o),R=2*(i-l),A=2*(c+o),N=-r-s+f+h;return n(t)?(t[0]=E,t[1]=y,t[2]=R,t[3]=m,t[4]=p,t[5]=A,t[6]=_,t[7]=T,t[8]=N,t):new u(E,m,_,y,p,T,R,A,N)},u.fromHeadingPitchRoll=function(e,t){var r=Math.cos(-e.pitch),a=Math.cos(-e.heading),i=Math.cos(e.roll),o=Math.sin(-e.pitch),s=Math.sin(-e.heading),c=Math.sin(e.roll),l=r*a,f=-i*s+c*o*a,d=c*s+i*o*a,h=r*s,E=i*a+c*o*s,m=-o*i+i*o*s,_=-o,y=c*r,p=i*r;return n(t)?(t[0]=l,t[1]=h,t[2]=_,t[3]=f,t[4]=E,t[5]=y,t[6]=d,t[7]=m,t[8]=p,t):new u(l,f,d,h,E,m,_,y,p)},u.fromScale=function(e,t){return n(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 u(e.x,0,0,0,e.y,0,0,0,e.z)},u.fromUniformScale=function(e,t){return n(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 u(e,0,0,0,e,0,0,0,e)},u.fromCrossProduct=function(e,t){return n(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 u(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},u.fromRotationX=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=r,t[5]=a,t[6]=0,t[7]=-a,t[8]=r,t):new u(1,0,0,0,r,-a,0,a,r)},u.fromRotationY=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=r,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=r,t):new u(r,0,a,0,1,0,-a,0,r)},u.fromRotationZ=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=r,t[1]=a,t[2]=0,t[3]=-a,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new u(r,-a,0,a,r,0,0,0,1)},u.toArray=function(e,t){return n(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]]},u.getElementIndex=function(e,t){return 3*e+t},u.getColumn=function(e,t,n){var r=3*t,a=e[r],i=e[r+1],o=e[r+2];return n.x=a,n.y=i,n.z=o,n},u.setColumn=function(e,t,n,r){r=u.clone(e,r);var a=3*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},u.getRow=function(e,t,n){var r=e[t],a=e[t+3],i=e[t+6];return n.x=r,n.y=a,n.z=i,n},u.setRow=function(e,t,n,r){return r=u.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var f=new e;u.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],f)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],f)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],f)),n};var d=new e;u.getMaximumScale=function(t){return u.getScale(t,d),e.maximumComponent(d)},u.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=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 n[0]=r,n[1]=a,n[2]=i,n[3]=o,n[4]=u,n[5]=s,n[6]=c,n[7]=l,n[8]=f,n},u.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},u.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},u.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[3]*a+e[6]*i,u=e[1]*r+e[4]*a+e[7]*i,s=e[2]*r+e[5]*a+e[8]*i;return n.x=o,n.y=u,n.z=s,n},u.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},u.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},u.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},u.transpose=function(e,t){var n=e[0],r=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=n,t[1]=r,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var h=[1,0,0],E=[2,2,1],m=new u,_=new u;return u.computeEigenDecomposition=function(e,t){var r=o.EPSILON20,a=10,i=0,f=0;n(t)||(t={});for(var d=t.unitary=u.clone(u.IDENTITY,t.unitary),h=t.diagonal=u.clone(e,t.diagonal),E=r*s(h);f<a&&c(h)>E;)l(h,m),u.transpose(m,_),u.multiply(h,m,h),u.multiply(_,h,h),u.multiply(d,m,d),++i>2&&(++f,i=0);return t},u.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},u.determinant=function(e){var t=e[0],n=e[3],r=e[6],a=e[1],i=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*o)+a*(s*r-n*c)+u*(n*o-i*r)},u.inverse=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[3],o=e[4],s=e[5],c=e[6],l=e[7],f=e[8],d=u.determinant(e);t[0]=o*f-l*s,t[1]=l*a-r*f,t[2]=r*s-o*a,t[3]=c*s-i*f,t[4]=n*f-c*a,t[5]=i*a-n*s,t[6]=i*l-c*o,t[7]=c*r-n*l,t[8]=n*o-i*r;var h=1/d;return u.multiplyByScalar(t,h,t)},u.equals=function(e,t){return e===t||n(e)&&n(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]},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r},u.IDENTITY=i(new u(1,0,0,0,1,0,0,0,1)),u.ZERO=i(new u(0,0,0,0,0,0,0,0,0)),u.COLUMN0ROW0=0,u.COLUMN0ROW1=1,u.COLUMN0ROW2=2,u.COLUMN1ROW0=3,u.COLUMN1ROW1=4,u.COLUMN1ROW2=5,u.COLUMN2ROW0=6,u.COLUMN2ROW1=7,u.COLUMN2ROW2=8,r(u.prototype,{length:{get:function(){return u.packedLength}}}),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},u}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a){"use strict";function i(t,n,r,a){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0),this.w=e(a,0)}i.fromElements=function(e,n,r,a,o){return t(o)?(o.x=e,o.y=n,o.z=r,o.w=a,o):new i(e,n,r,a)},i.fromColor=function(e,n){return t(n)?(n.x=e.red,n.y=e.green,n.z=e.blue,n.w=e.alpha,n):new i(e.red,e.green,e.blue,e.alpha)},i.clone=function(e,n){if(t(e))return t(n)?(n.x=e.x,n.y=e.y,n.z=e.z,n.w=e.w,n):new i(e.x,e.y,e.z,e.w)},i.packedLength=4,i.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w,n},i.unpack=function(n,r,a){return r=e(r,0),t(a)||(a=new i),a.x=n[r++],a.y=n[r++],a.z=n[r++],a.w=n[r],a},i.packArray=function(e,n){var r=e.length;t(n)?n.length=4*r:n=new Array(4*r);for(var a=0;a<r;++a)i.pack(e[a],n,4*a);return n},i.unpackArray=function(e,n){var r=e.length;t(n)?n.length=r/4:n=new Array(r/4);for(var a=0;a<r;a+=4){var o=a/4;n[o]=i.unpack(e,a,n[o])}return n},i.fromArray=i.unpack,i.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},i.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},i.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},i.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},i.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},i.magnitude=function(e){return Math.sqrt(i.magnitudeSquared(e))};var o=new i;i.distance=function(e,t){return i.subtract(e,t,o),i.magnitude(o)},i.distanceSquared=function(e,t){return i.subtract(e,t,o),i.magnitudeSquared(o)},i.normalize=function(e,t){var n=i.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t},i.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},i.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},i.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},i.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},i.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},i.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},i.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},i.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},i.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 u=new i;i.lerp=function(e,t,n,r){return i.multiplyByScalar(t,n,u),r=i.multiplyByScalar(e,1-n,r),i.add(u,r,r)};var s=new i;return i.mostOrthogonalAxis=function(e,t){var n=i.normalize(e,s);return i.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?i.clone(i.UNIT_X,t):i.clone(i.UNIT_W,t):n.z<=n.w?i.clone(i.UNIT_Z,t):i.clone(i.UNIT_W,t):n.y<=n.z?n.y<=n.w?i.clone(i.UNIT_Y,t):i.clone(i.UNIT_W,t):n.z<=n.w?i.clone(i.UNIT_Z,t):i.clone(i.UNIT_W,t)},i.equals=function(e,n){return e===n||t(e)&&t(n)&&e.x===n.x&&e.y===n.y&&e.z===n.z&&e.w===n.w},i.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},i.equalsEpsilon=function(e,n,r,i){return e===n||t(e)&&t(n)&&a.equalsEpsilon(e.x,n.x,r,i)&&a.equalsEpsilon(e.y,n.y,r,i)&&a.equalsEpsilon(e.z,n.z,r,i)&&a.equalsEpsilon(e.w,n.w,r,i)},i.ZERO=r(new i(0,0,0,0)),i.UNIT_X=r(new i(1,0,0,0)),i.UNIT_Y=r(new i(0,1,0,0)),i.UNIT_Z=r(new i(0,0,1,0)),i.UNIT_W=r(new i(0,0,0,1)),i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i.prototype.equalsEpsilon=function(e,t,n){return i.equalsEpsilon(this,e,t,n)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},i}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t,r,a,i,o,u,s,c,l,f,d,h,E,m,_){this[0]=n(e,0),this[1]=n(i,0),this[2]=n(c,0),this[3]=n(h,0),this[4]=n(t,0),this[5]=n(o,0),this[6]=n(l,0),this[7]=n(E,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(f,0),this[11]=n(m,0),this[12]=n(a,0),this[13]=n(s,0),this[14]=n(d,0),this[15]=n(_,0)}l.packedLength=16,l.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t[r++]=e[9],t[r++]=e[10],t[r++]=e[11],t[r++]=e[12],t[r++]=e[13],t[r++]=e[14],t[r]=e[15],t},l.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new l),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a[9]=e[t++],a[10]=e[t++],a[11]=e[t++],a[12]=e[t++],a[13]=e[t++],a[14]=e[t++],a[15]=e[t],a},l.clone=function(e,t){if(r(e))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):new l(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])},l.fromArray=l.unpack,l.fromColumnMajorArray=function(e,t){return l.clone(e,t)},l.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 l(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])},l.fromRotationTranslation=function(t,a,i){return a=n(a,e.ZERO),r(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=a.x,i[13]=a.y,i[14]=a.z,i[15]=1,i):new l(t[0],t[3],t[6],a.x,t[1],t[4],t[7],a.y,t[2],t[5],t[8],a.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(e,t,n,a){r(a)||(a=new l);var i=n.x,o=n.y,u=n.z,s=t.x*t.x,c=t.x*t.y,f=t.x*t.z,d=t.x*t.w,h=t.y*t.y,E=t.y*t.z,m=t.y*t.w,_=t.z*t.z,y=t.z*t.w,p=t.w*t.w,T=s-h-_+p,R=2*(c-y),A=2*(f+m),N=2*(c+y),S=-s+h-_+p,I=2*(E-d),M=2*(f-m),O=2*(E+d),g=-s-h+_+p;return a[0]=T*i,a[1]=N*i,a[2]=M*i,a[3]=0,a[4]=R*o,a[5]=S*o,a[6]=O*o,a[7]=0,a[8]=A*u,a[9]=I*u,a[10]=g*u,a[11]=0,a[12]=e.x,a[13]=e.y,a[14]=e.z,a[15]=1,a},l.fromTranslationRotationScale=function(e,t){return l.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},l.fromTranslation=function(e,t){return l.fromRotationTranslation(s.IDENTITY,e,t)},l.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 l(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},l.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 l(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var f=new e,d=new e,h=new e;l.fromCamera=function(t,n){var a=t.position,i=t.direction,o=t.up;e.normalize(i,f),e.normalize(e.cross(f,o,d),d),e.normalize(e.cross(d,f,h),h);var u=d.x,s=d.y,c=d.z,E=f.x,m=f.y,_=f.z,y=h.x,p=h.y,T=h.z,R=a.x,A=a.y,N=a.z,S=u*-R+s*-A+c*-N,I=y*-R+p*-A+T*-N,M=E*R+m*A+_*N;return r(n)?(n[0]=u,n[1]=y,n[2]=-E,n[3]=0,n[4]=s,n[5]=p,n[6]=-m,n[7]=0,n[8]=c,n[9]=T,n[10]=-_,n[11]=0,n[12]=S,n[13]=I,n[14]=M,n[15]=1,n):new l(u,s,c,S,y,p,T,I,-E,-m,-_,M,0,0,0,1)},l.computePerspectiveFieldOfView=function(e,t,n,r,a){var i=Math.tan(.5*e),o=1/i,u=o/t,s=(r+n)/(n-r),c=2*r*n/(n-r);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=c,a[15]=0,a},l.computeOrthographicOffCenter=function(e,t,n,r,a,i,o){var u=1/(t-e),s=1/(r-n),c=1/(i-a),l=-(t+e)*u,f=-(r+n)*s,d=-(i+a)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=f,o[14]=d,o[15]=1,o},l.computePerspectiveOffCenter=function(e,t,n,r,a,i,o){var u=2*a/(t-e),s=2*a/(r-n),c=(t+e)/(t-e),l=(r+n)/(r-n),f=-(i+a)/(i-a),d=-1,h=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=f,o[11]=d,o[12]=0,o[13]=0,o[14]=h,o[15]=0,o},l.computeInfinitePerspectiveOffCenter=function(e,t,n,r,a,i){var o=2*a/(t-e),u=2*a/(r-n),s=(t+e)/(t-e),c=(r+n)/(r-n),l=-1,f=-1,d=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=s,i[9]=c,i[10]=l,i[11]=f,i[12]=0,i[13]=0,i[14]=d,i[15]=0,i},l.computeViewportTransformation=function(e,t,r,a){e=n(e,n.EMPTY_OBJECT);var i=n(e.x,0),o=n(e.y,0),u=n(e.width,0),s=n(e.height,0);t=n(t,0),r=n(r,1);var c=.5*u,l=.5*s,f=.5*(r-t),d=c,h=l,E=f,m=i+c,_=o+l,y=t+f,p=1;return a[0]=d,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=h,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=E,a[11]=0,a[12]=m,a[13]=_,a[14]=y,a[15]=p,a},l.computeView=function(t,n,r,a,i){return i[0]=a.x,i[1]=r.x,i[2]=-n.x,i[3]=0,i[4]=a.y,i[5]=r.y,i[6]=-n.y,i[7]=0,i[8]=a.z,i[9]=r.z,i[10]=-n.z,i[11]=0,i[12]=-e.dot(a,t),i[13]=-e.dot(r,t),i[14]=e.dot(n,t),i[15]=1,i},l.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]]},l.getElementIndex=function(e,t){return 4*e+t},l.getColumn=function(e,t,n){var r=4*t,a=e[r],i=e[r+1],o=e[r+2],u=e[r+3];return n.x=a,n.y=i,n.z=o,n.w=u,n},l.setColumn=function(e,t,n,r){r=l.clone(e,r);var a=4*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r[a+3]=n.w,r},l.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},l.getRow=function(e,t,n){var r=e[t],a=e[t+4],i=e[t+8],o=e[t+12];return n.x=r,n.y=a,n.z=i,n.w=o,n},l.setRow=function(e,t,n,r){return r=l.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var E=new e;l.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],E)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],E)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],E)),n};var m=new e;l.getMaximumScale=function(t){return l.getScale(t,m),e.maximumComponent(m)},l.multiply=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],f=e[8],d=e[9],h=e[10],E=e[11],m=e[12],_=e[13],y=e[14],p=e[15],T=t[0],R=t[1],A=t[2],N=t[3],S=t[4],I=t[5],M=t[6],O=t[7],g=t[8],v=t[9],x=t[10],w=t[11],C=t[12],P=t[13],U=t[14],D=t[15],L=r*T+u*R+f*A+m*N,F=a*T+s*R+d*A+_*N,z=i*T+c*R+h*A+y*N,B=o*T+l*R+E*A+p*N,b=r*S+u*I+f*M+m*O,q=a*S+s*I+d*M+_*O,G=i*S+c*I+h*M+y*O,W=o*S+l*I+E*M+p*O,X=r*g+u*v+f*x+m*w,V=a*g+s*v+d*x+_*w,H=i*g+c*v+h*x+y*w,Y=o*g+l*v+E*x+p*w,k=r*C+u*P+f*U+m*D,j=a*C+s*P+d*U+_*D,Z=i*C+c*P+h*U+y*D,K=o*C+l*P+E*U+p*D;return n[0]=L,n[1]=F,n[2]=z,n[3]=B,n[4]=b,n[5]=q,n[6]=G,n[7]=W,n[8]=X,n[9]=V,n[10]=H,n[11]=Y,n[12]=k,n[13]=j,n[14]=Z,n[15]=K,n},l.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},l.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},l.multiplyTransformation=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],d=e[12],h=e[13],E=e[14],m=t[0],_=t[1],y=t[2],p=t[4],T=t[5],R=t[6],A=t[8],N=t[9],S=t[10],I=t[12],M=t[13],O=t[14],g=r*m+o*_+c*y,v=a*m+u*_+l*y,x=i*m+s*_+f*y,w=r*p+o*T+c*R,C=a*p+u*T+l*R,P=i*p+s*T+f*R,U=r*A+o*N+c*S,D=a*A+u*N+l*S,L=i*A+s*N+f*S,F=r*I+o*M+c*O+d,z=a*I+u*M+l*O+h,B=i*I+s*M+f*O+E;return n[0]=g,n[1]=v,n[2]=x,n[3]=0,n[4]=w,n[5]=C,n[6]=P,n[7]=0,n[8]=U,n[9]=D,n[10]=L,n[11]=0,n[12]=F,n[13]=z,n[14]=B,n[15]=1,n},l.multiplyByMatrix3=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],d=t[0],h=t[1],E=t[2],m=t[3],_=t[4],y=t[5],p=t[6],T=t[7],R=t[8],A=r*d+o*h+c*E,N=a*d+u*h+l*E,S=i*d+s*h+f*E,I=r*m+o*_+c*y,M=a*m+u*_+l*y,O=i*m+s*_+f*y,g=r*p+o*T+c*R,v=a*p+u*T+l*R,x=i*p+s*T+f*R;return n[0]=A,n[1]=N,n[2]=S,n[3]=0,n[4]=I,n[5]=M,n[6]=O,n[7]=0,n[8]=g,n[9]=v,n[10]=x,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},l.multiplyByTranslation=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=r*e[0]+a*e[4]+i*e[8]+e[12],u=r*e[1]+a*e[5]+i*e[9]+e[13],s=r*e[2]+a*e[6]+i*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=s,n[15]=e[15],n};var _=new e;l.multiplyByUniformScale=function(e,t,n){return _.x=t,_.y=t,_.z=t,l.multiplyByScale(e,_,n)},l.multiplyByScale=function(e,t,n){var r=t.x,a=t.y,i=t.z;return 1===r&&1===a&&1===i?l.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=a*e[4],n[5]=a*e[5],n[6]=a*e[6],n[7]=0,n[8]=i*e[8],n[9]=i*e[9],n[10]=i*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},l.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=t.w,u=e[0]*r+e[4]*a+e[8]*i+e[12]*o,s=e[1]*r+e[5]*a+e[9]*i+e[13]*o,c=e[2]*r+e[6]*a+e[10]*i+e[14]*o,l=e[3]*r+e[7]*a+e[11]*i+e[15]*o;return n.x=u,n.y=s,n.z=c,n.w=l,n},l.multiplyByPointAsVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i,u=e[1]*r+e[5]*a+e[9]*i,s=e[2]*r+e[6]*a+e[10]*i;return n.x=o,n.y=u,n.z=s,n},l.multiplyByPoint=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i+e[12],u=e[1]*r+e[5]*a+e[9]*i+e[13],s=e[2]*r+e[6]*a+e[10]*i+e[14];return n.x=o,n.y=u,n.z=s,n},l.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},l.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},l.transpose=function(e,t){var n=e[1],r=e[2],a=e[3],i=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=o,t[14]=u,t[15]=e[15],t},l.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},l.equals=function(e,t){return e===t||r(e)&&r(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},l.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},l.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},l.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};var y=new s,p=new s,T=new t,R=new t(0,0,0,1);return l.inverse=function(e,n){if(s.equalsEpsilon(l.getRotation(e,y),p,u.EPSILON7)&&t.equals(l.getRow(e,3,T),R))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],a=e[4],i=e[8],o=e[12],f=e[1],d=e[5],h=e[9],E=e[13],m=e[2],_=e[6],A=e[10],N=e[14],S=e[3],I=e[7],M=e[11],O=e[15],g=A*O,v=N*M,x=_*O,w=N*I,C=_*M,P=A*I,U=m*O,D=N*S,L=m*M,F=A*S,z=m*I,B=_*S,b=g*d+w*h+C*E-(v*d+x*h+P*E),q=v*f+U*h+F*E-(g*f+D*h+L*E),G=x*f+D*d+z*E-(w*f+U*d+B*E),W=P*f+L*d+B*h-(C*f+F*d+z*h),X=v*a+x*i+P*o-(g*a+w*i+C*o),V=g*r+D*i+L*o-(v*r+U*i+F*o),H=w*r+U*a+B*o-(x*r+D*a+z*o),Y=C*r+F*a+z*i-(P*r+L*a+B*i);g=i*E,v=o*h,x=a*E,w=o*d,C=a*h,P=i*d,U=r*E,D=o*f,L=r*h,F=i*f,z=r*d,B=a*f;var k=g*I+w*M+C*O-(v*I+x*M+P*O),j=v*S+U*M+F*O-(g*S+D*M+L*O),Z=x*S+D*I+z*O-(w*S+U*I+B*O),K=P*S+L*I+B*M-(C*S+F*I+z*M),J=x*A+P*N+v*_-(C*N+g*_+w*A),Q=L*N+g*m+D*A-(U*A+F*N+v*m),$=U*_+B*N+w*m-(z*N+x*m+D*_),ee=z*A+C*m+F*_-(L*_+B*A+P*m),te=r*b+a*q+i*G+o*W;if(Math.abs(te)<u.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=b*te,n[1]=q*te,n[2]=G*te,n[3]=W*te,n[4]=X*te,n[5]=V*te,n[6]=H*te,n[7]=Y*te,n[8]=k*te,n[9]=j*te,n[10]=Z*te,n[11]=K*te,n[12]=J*te,n[13]=Q*te,n[14]=$*te,n[15]=ee*te,n},l.inverseTransformation=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],f=e[12],d=e[13],h=e[14],E=-n*f-r*d-a*h,m=-i*f-o*d-u*h,_=-s*f-c*d-l*h;return t[0]=n,t[1]=i,t[2]=s,t[3]=0,t[4]=r,t[5]=o,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=l,t[11]=0,t[12]=E,t[13]=m,t[14]=_,t[15]=1,t},l.IDENTITY=o(new l(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),l.ZERO=o(new l(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN0ROW3=3,l.COLUMN1ROW0=4,l.COLUMN1ROW1=5,l.COLUMN1ROW2=6,l.COLUMN1ROW3=7,l.COLUMN2ROW0=8,l.COLUMN2ROW1=9,l.COLUMN2ROW2=10,l.COLUMN2ROW3=11,l.COLUMN3ROW0=12,l.COLUMN3ROW1=13,l.COLUMN3ROW2=14,l.COLUMN3ROW3=15,a(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.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]+")"},l}),define("Core/Rectangle",["./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,n,r,a){this.west=t(e,0),this.south=t(n,0),this.east=t(r,0),this.north=t(a,0)}r(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,n,r){return r=t(r,0),n[r++]=e.west,n[r++]=e.south,n[r++]=e.east,n[r]=e.north,n},s.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new s),a.west=e[r++],a.south=e[r++],a.east=e[r++],a.north=e[r],a},s.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=u.TWO_PI),t-n},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,r,a,i,o){return e=u.toRadians(t(e,0)),r=u.toRadians(t(r,0)),a=u.toRadians(t(a,0)),i=u.toRadians(t(i,0)),n(o)?(o.west=e,o.south=r,o.east=a,o.north=i,o):new s(e,r,a,i)},s.fromCartographicArray=function(e,t){for(var r=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE,f=0,d=e.length;f<d;f++){var h=e[f];r=Math.min(r,h.longitude),a=Math.max(a,h.longitude),c=Math.min(c,h.latitude),l=Math.max(l,h.latitude);var E=h.longitude>=0?h.longitude:h.longitude+u.TWO_PI;i=Math.min(i,E),o=Math.max(o,E)}return a-r>o-i&&(r=i,a=o,a>u.PI&&(a-=u.TWO_PI),r>u.PI&&(r-=u.TWO_PI)),n(t)?(t.west=r,t.south=c,t.east=a,t.north=l,t):new s(r,c,a,l)},s.fromCartesianArray=function(e,t,r){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=Number.MAX_VALUE,f=-Number.MAX_VALUE,d=0,h=e.length;d<h;d++){var E=t.cartesianToCartographic(e[d]);a=Math.min(a,E.longitude),i=Math.max(i,E.longitude),l=Math.min(l,E.latitude),f=Math.max(f,E.latitude);var m=E.longitude>=0?E.longitude:E.longitude+u.TWO_PI;o=Math.min(o,m),c=Math.max(c,m)}return i-a>c-o&&(a=o,i=c,i>u.PI&&(i-=u.TWO_PI),a>u.PI&&(a-=u.TWO_PI)),n(r)?(r.west=a,r.south=l,r.east=i,r.north=f,r):new s(a,l,i,f)},s.clone=function(e,t){if(n(e))return n(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,t){return e===t||n(e)&&n(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},s.prototype.equalsEpsilon=function(e,t){return n(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},s.validate=function(e){},s.southwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.south,r.height=0,r):new e(t.west,t.south)},s.northwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.north,r.height=0,r):new e(t.west,t.north)},s.northeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.north,r.height=0,r):new e(t.east,t.north)},s.southeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.south,r.height=0,r):new e(t.east,t.south)},s.center=function(t,r){var a=t.east,i=t.west;a<i&&(a+=u.TWO_PI);var o=u.negativePiToPi(.5*(i+a)),s=.5*(t.south+t.north);return n(r)?(r.longitude=o,r.latitude=s,r.height=0,r):new e(o,s)},s.intersection=function(e,t,r){var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.negativePiToPi(Math.max(i,c)),f=u.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&f<=l)){var d=Math.max(e.south,t.south),h=Math.min(e.north,t.north);if(!(d>=h))return n(r)?(r.west=l,r.south=d,r.east=f,r.north=h,r):new s(l,d,f,h)}},s.simpleIntersection=function(e,t,r){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(i>=u||a>=o))return n(r)?(r.west=a,r.south=i,r.east=o,r.north=u,r):new s(a,i,o,u)},s.union=function(e,t,r){n(r)||(r=new s);var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.convertLongitudeRange(Math.min(i,c)),f=u.convertLongitudeRange(Math.max(a,o));return r.west=l,r.south=Math.min(e.south,t.south),r.east=f,r.north=Math.max(e.north,t.north),r},s.expand=function(e,t,r){return n(r)||(r=new s),r.west=Math.min(e.west,t.longitude),r.south=Math.min(e.south,t.latitude),r.east=Math.max(e.east,t.longitude),r.north=Math.max(e.north,t.latitude),r},s.contains=function(e,t){var n=t.longitude,r=t.latitude,a=e.west,i=e.east;return i<a&&(i+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>a||u.equalsEpsilon(n,a,u.EPSILON14))&&(n<i||u.equalsEpsilon(n,i,u.EPSILON14))&&r>=e.south&&r<=e.north};var c=new e;return s.subsample=function(e,r,a,o){r=t(r,i.WGS84),a=t(a,0),n(o)||(o=[]);var l=0,f=e.north,d=e.south,h=e.east,E=e.west,m=c;m.height=a,m.longitude=E,m.latitude=f,o[l]=r.cartographicToCartesian(m,o[l]),l++,m.longitude=h,o[l]=r.cartographicToCartesian(m,o[l]),l++,m.latitude=d,o[l]=r.cartographicToCartesian(m,o[l]),l++,m.longitude=E,o[l]=r.cartographicToCartesian(m,o[l]),l++,f<0?m.latitude=f:d>0?m.latitude=d:m.latitude=0;for(var _=1;_<8;++_)m.longitude=-Math.PI+_*u.PI_OVER_TWO,s.contains(e,m)&&(o[l]=r.cartographicToCartesian(m,o[l]),l++);return 0===m.latitude&&(m.longitude=E,o[l]=r.cartographicToCartesian(m,o[l]),l++,m.longitude=h,o[l]=r.cartographicToCartesian(m,o[l]),l++),o.length=l,o},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function d(t,r){this.center=e.clone(n(t,e.ZERO)),this.radius=n(r,0)}var h=new e,E=new e,m=new e,_=new e,y=new e,p=new e,T=new e,R=new e,A=new e,N=new e,S=new e,I=new e;d.fromPoints=function(t,n){if(r(n)||(n=new d),!r(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var a=e.clone(t[0],T),i=e.clone(a,h),o=e.clone(a,E),u=e.clone(a,m),s=e.clone(a,_),c=e.clone(a,y),l=e.clone(a,p),f=t.length,M=1;M<f;M++){e.clone(t[M],a);var O=a.x,g=a.y,v=a.z;O<i.x&&e.clone(a,i),O>s.x&&e.clone(a,s),g<o.y&&e.clone(a,o),g>c.y&&e.clone(a,c),v<u.z&&e.clone(a,u),v>l.z&&e.clone(a,l)}var x=e.magnitudeSquared(e.subtract(s,i,R)),w=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=i,U=s,D=x;w>D&&(D=w,P=o,U=c),C>D&&(D=C,P=u,U=l);var L=A;L.x=.5*(P.x+U.x),L.y=.5*(P.y+U.y),L.z=.5*(P.z+U.z);var F=e.magnitudeSquared(e.subtract(U,L,R)),z=Math.sqrt(F),B=N;B.x=i.x,B.y=o.y,B.z=u.z;var b=S;b.x=s.x,b.y=c.y,b.z=l.z;var q=e.multiplyByScalar(e.add(B,b,R),.5,I),G=0;for(M=0;M<f;M++){e.clone(t[M],a);var W=e.magnitude(e.subtract(a,q,R));W>G&&(G=W);var X=e.magnitudeSquared(e.subtract(a,L,R));if(X>F){var V=Math.sqrt(X);z=.5*(z+V),F=z*z;var H=V-z;L.x=(z*L.x+H*a.x)/V,L.y=(z*L.y+H*a.y)/V,L.z=(z*L.z+H*a.z)/V}}return z<G?(e.clone(L,n.center),n.radius=z):(e.clone(q,n.center),n.radius=G),n};var M=new o,O=new e,g=new e,v=new t,x=new t;d.fromRectangle2D=function(e,t,n){return d.fromRectangleWithHeights2D(e,t,0,0,n)},d.fromRectangleWithHeights2D=function(t,a,i,o,u){if(r(u)||(u=new d),!r(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;a=n(a,M),f.southwest(t,v),v.height=i,f.northeast(t,x),x.height=o;var s=a.project(v,O),c=a.project(x,g),l=c.x-s.x,h=c.y-s.y,E=c.z-s.z;u.radius=.5*Math.sqrt(l*l+h*h+E*E);var m=u.center;return m.x=s.x+.5*l,m.y=s.y+.5*h,m.z=s.z+.5*E,u};var w=[];d.fromRectangle3D=function(e,t,a,o){t=n(t,i.WGS84),a=n(a,0);var u;return r(e)&&(u=f.subsample(e,t,a,w)),d.fromPoints(u,o)},d.fromVertices=function(t,a,i,o){if(r(o)||(o=new d),!r(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;a=n(a,e.ZERO),i=n(i,3);var u=T;u.x=t[0]+a.x,u.y=t[1]+a.y,u.z=t[2]+a.z;for(var s=e.clone(u,h),c=e.clone(u,E),l=e.clone(u,m),f=e.clone(u,_),M=e.clone(u,y),O=e.clone(u,p),g=t.length,v=0;v<g;v+=i){var x=t[v]+a.x,w=t[v+1]+a.y,C=t[v+2]+a.z;u.x=x,u.y=w,u.z=C,x<s.x&&e.clone(u,s),x>f.x&&e.clone(u,f),w<c.y&&e.clone(u,c),w>M.y&&e.clone(u,M),C<l.z&&e.clone(u,l),C>O.z&&e.clone(u,O)}var P=e.magnitudeSquared(e.subtract(f,s,R)),U=e.magnitudeSquared(e.subtract(M,c,R)),D=e.magnitudeSquared(e.subtract(O,l,R)),L=s,F=f,z=P;U>z&&(z=U,L=c,F=M),D>z&&(z=D,L=l,F=O);var B=A;B.x=.5*(L.x+F.x),B.y=.5*(L.y+F.y),B.z=.5*(L.z+F.z);var b=e.magnitudeSquared(e.subtract(F,B,R)),q=Math.sqrt(b),G=N;G.x=s.x,G.y=c.y,G.z=l.z;var W=S;W.x=f.x,W.y=M.y,W.z=O.z;var X=e.multiplyByScalar(e.add(G,W,R),.5,I),V=0;for(v=0;v<g;v+=i){u.x=t[v]+a.x,u.y=t[v+1]+a.y,u.z=t[v+2]+a.z;var H=e.magnitude(e.subtract(u,X,R));H>V&&(V=H);var Y=e.magnitudeSquared(e.subtract(u,B,R));if(Y>b){var k=Math.sqrt(Y);q=.5*(q+k),b=q*q;var j=k-q;B.x=(q*B.x+j*u.x)/k,B.y=(q*B.y+j*u.y)/k,B.z=(q*B.z+j*u.z)/k}}return q<V?(e.clone(B,o.center),o.radius=q):(e.clone(X,o.center),o.radius=V),o},d.fromEncodedCartesianVertices=function(t,n,a){if(r(a)||(a=new d),!r(t)||!r(n)||t.length!==n.length||0===t.length)return a.center=e.clone(e.ZERO,a.center),a.radius=0,a;var i=T;i.x=t[0]+n[0],i.y=t[1]+n[1],i.z=t[2]+n[2];for(var o=e.clone(i,h),u=e.clone(i,E),s=e.clone(i,m),c=e.clone(i,_),l=e.clone(i,y),f=e.clone(i,p),M=t.length,O=0;O<M;O+=3){var g=t[O]+n[O],v=t[O+1]+n[O+1],x=t[O+2]+n[O+2];i.x=g,i.y=v,i.z=x,g<o.x&&e.clone(i,o),g>c.x&&e.clone(i,c),v<u.y&&e.clone(i,u),v>l.y&&e.clone(i,l),x<s.z&&e.clone(i,s),x>f.z&&e.clone(i,f)}var w=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=e.magnitudeSquared(e.subtract(f,s,R)),U=o,D=c,L=w;C>L&&(L=C,U=u,D=l),P>L&&(L=P,U=s,D=f);var F=A;F.x=.5*(U.x+D.x),F.y=.5*(U.y+D.y),F.z=.5*(U.z+D.z);var z=e.magnitudeSquared(e.subtract(D,F,R)),B=Math.sqrt(z),b=N;b.x=o.x,b.y=u.y,b.z=s.z;var q=S;q.x=c.x,q.y=l.y,q.z=f.z;var G=e.multiplyByScalar(e.add(b,q,R),.5,I),W=0;for(O=0;O<M;O+=3){i.x=t[O]+n[O],i.y=t[O+1]+n[O+1],i.z=t[O+2]+n[O+2];var X=e.magnitude(e.subtract(i,G,R));X>W&&(W=X);var V=e.magnitudeSquared(e.subtract(i,F,R));if(V>z){var H=Math.sqrt(V);B=.5*(B+H),z=B*B;var Y=H-B;F.x=(B*F.x+Y*i.x)/H,F.y=(B*F.y+Y*i.y)/H,F.z=(B*F.z+Y*i.z)/H}}return B<W?(e.clone(F,a.center),a.radius=B):(e.clone(G,a.center),a.radius=W),a},d.fromCornerPoints=function(t,n,a){r(a)||(a=new d);var i=a.center;return e.add(t,n,i),e.multiplyByScalar(i,.5,i),a.radius=e.distance(i,n),a},d.fromEllipsoid=function(t,n){return r(n)||(n=new d),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var C=new e;d.fromBoundingSpheres=function(t,n){if(r(n)||(n=new d),!r(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var a=t.length;if(1===a)return d.clone(t[0],n);if(2===a)return d.union(t[0],t[1],n);for(var i=[],o=0;o<a;o++)i.push(t[o].center);n=d.fromPoints(i,n);var u=n.center,s=n.radius;for(o=0;o<a;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,C)+c.radius)}return n.radius=s,n};var P=new e,U=new e,D=new e;d.fromOrientedBoundingBox=function(t,n){r(n)||(n=new d);var a=t.halfAxes,i=c.getColumn(a,0,P),o=c.getColumn(a,1,U),u=c.getColumn(a,2,D),s=e.magnitude(i),l=e.magnitude(o),f=e.magnitude(u);return n.center=e.clone(t.center,n.center),n.radius=Math.max(s,l,f),n},d.clone=function(t,n){if(r(t))return r(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new d(t.center,t.radius)},d.packedLength=4,d.pack=function(e,t,r){r=n(r,0);var a=e.center;return t[r++]=a.x,t[r++]=a.y,t[r++]=a.z,t[r]=e.radius,t},d.unpack=function(e,t,a){t=n(t,0),r(a)||(a=new d);var i=a.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],a.radius=e[t], -a};var L=new e,F=new e;d.union=function(t,n,a){r(a)||(a=new d);var i=t.center,o=t.radius,u=n.center,s=n.radius,c=e.subtract(u,i,L),l=e.magnitude(c);if(o>=l+s)return t.clone(a),a;if(s>=l+o)return n.clone(a),a;var f=.5*(o+l+s),h=e.multiplyByScalar(c,(-o+f)/l,F);return e.add(h,i,h),e.clone(h,a.center),a.radius=f,a};var z=new e;d.expand=function(t,n,r){r=d.clone(t,r);var a=e.magnitude(e.subtract(n,r.center,z));return a>r.radius&&(r.radius=a),r},d.intersectPlane=function(t,n){var r=t.center,a=t.radius,i=n.normal,o=e.dot(i,r)+n.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},d.transform=function(e,t,n){return r(n)||(n=new d),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=l.getMaximumScale(t)*e.radius,n};var B=new e;d.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,B);return e.magnitudeSquared(r)-t.radius*t.radius},d.transformWithoutScale=function(e,t,n){return r(n)||(n=new d),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var b=new e;d.computePlaneDistances=function(t,n,a,i){r(i)||(i=new s);var o=e.subtract(t.center,n,b),u=e.dot(a,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var q=new e,G=new e,W=new e,X=new e,V=new e,H=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var j=new o;return d.projectTo2D=function(t,r,a){r=n(r,j);var i=r.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,q),c=e.cross(e.UNIT_Z,s,G);e.normalize(c,c);var l=e.cross(s,c,W);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var f=e.negate(l,V),h=e.negate(c,X),E=Y,m=E[0];e.add(s,l,m),e.add(m,c,m),m=E[1],e.add(s,l,m),e.add(m,h,m),m=E[2],e.add(s,f,m),e.add(m,h,m),m=E[3],e.add(s,f,m),e.add(m,c,m),e.negate(s,s),m=E[4],e.add(s,l,m),e.add(m,c,m),m=E[5],e.add(s,l,m),e.add(m,h,m),m=E[6],e.add(s,f,m),e.add(m,h,m),m=E[7],e.add(s,f,m),e.add(m,c,m);for(var _=E.length,y=0;y<_;++y){var p=E[y];e.add(o,p,p);var T=i.cartesianToCartographic(p,H);r.project(T,p)}a=d.fromPoints(E,a),o=a.center;var R=o.x,A=o.y,N=o.z;return o.x=N,o.y=R,o.z=A,a},d.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},d.equals=function(t,n){return t===n||r(t)&&r(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},d.prototype.intersectPlane=function(e){return d.intersectPlane(this,e)},d.prototype.distanceSquaredTo=function(e){return d.distanceSquaredTo(this,e)},d.prototype.computePlaneDistances=function(e,t,n){return d.computePlaneDistances(this,e,t,n)},d.prototype.isOccluded=function(e){return d.isOccluded(this,e)},d.prototype.equals=function(e){return d.equals(this,e)},d.prototype.clone=function(e){return d.clone(this,e)},d}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503};return e(t)}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,n,r,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(e){switch(e){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(t){return e(t)&&(t===i.UNSIGNED_BYTE||t===i.UNSIGNED_SHORT||t===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,n,a){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,a):new Uint16Array(t,n,a)},n(i)}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function n(e,n,r){var a=e+n;return t.sign(e)!==t.sign(n)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(n)))<r?0:a}var r={};return r.computeDiscriminant=function(e,t,n){var r=t*t-4*e*n;return r},r.computeRealRoots=function(e,r,a){var i;if(0===e)return 0===r?[]:[-a/r];if(0===r){if(0===a)return[0,0];var o=Math.abs(a),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,i<0)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-r/e,i<0?[i,0]:[0,i];var c=r*r,l=4*e*a,f=n(c,-l,t.EPSILON14);if(f<0)return[];var d=-.5*n(r,t.sign(r)*Math.sqrt(f),t.EPSILON14);return r>0?[d/e,a/d]:[a/d,d/e]},r}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function n(e,t,n,r){var a,i,o=e,u=t/3,s=n/3,c=r,l=o*s,f=u*c,d=u*u,h=s*s,E=o*s-d,m=o*c-u*s,_=u*c-h,y=4*E*_-m*m;if(y<0){var p,T,R;d*f>=l*h?(p=o,T=E,R=-2*u*E+o*m):(p=c,T=_,R=-c*m+2*s*_);var A=R<0?-1:1,N=-A*Math.abs(p)*Math.sqrt(-y);i=-R+N;var S=i/2,I=S<0?-Math.pow(-S,1/3):Math.pow(S,1/3),M=i===N?-I:-T/I;return a=T<=0?I+M:-R/(I*I+M*M+T),d*f>=l*h?[(a-u)/o]:[-c/(a+s)]}var O=E,g=-2*u*E+o*m,v=_,x=-c*m+2*s*_,w=Math.sqrt(y),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*w,-g)/3);a=2*Math.sqrt(-O);var U=Math.cos(P);i=a*U;var D=a*(-U/2-C*Math.sin(P)),L=i+D>2*u?i-u:D-u,F=o,z=L/F;P=Math.abs(Math.atan2(c*w,-x)/3),a=2*Math.sqrt(-v),U=Math.cos(P),i=a*U,D=a*(-U/2-C*Math.sin(P));var B=-c,b=i+D<2*s?i+s:D+s,q=B/b,G=F*b,W=-L*b-F*B,X=L*B,V=(s*W-u*X)/(-u*W+s*G);return z<=V?z<=q?V<=q?[z,V,q]:[z,q,V]:[q,z,V]:z<=q?[V,z,q]:V<=q?[V,q,z]:[q,V,z]}var r={};return r.computeDiscriminant=function(e,t,n,r){var a=e*e,i=t*t,o=n*n,u=r*r,s=18*e*t*n*r+i*o-27*a*u-4*(e*o*n+i*t*r);return s},r.computeRealRoots=function(e,r,a,i){var o,u;if(0===e)return t.computeRealRoots(r,a,i);if(0===r){if(0===a){if(0===i)return[0,0,0];u=-i/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===i?(o=t.computeRealRoots(e,0,a),0===o.Length?[0]:[o[0],0,o[1]]):n(e,0,a,i)}return 0===a?0===i?(u=-r/e,u<0?[u,0,0]:[0,0,u]):n(e,r,0,i):0===i?(o=t.computeRealRoots(e,r,a),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):n(e,r,a,i)},r}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,n,r){"use strict";function a(t,a,i,o){var u=t*t,s=a-3*u/8,c=i-a*t/2+u*t/8,l=o-i*t/4+a*u/16-3*u*u/256,f=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(f.length>0){var d=-t/4,h=f[f.length-1];if(Math.abs(h)<n.EPSILON14){var E=r.computeRealRoots(1,s,l);if(2===E.length){var m,_=E[0],y=E[1];if(_>=0&&y>=0){var p=Math.sqrt(_),T=Math.sqrt(y);return[d-T,d-p,d+p,d+T]}if(_>=0&&y<0)return m=Math.sqrt(_),[d-m,d+m];if(_<0&&y>=0)return m=Math.sqrt(y),[d-m,d+m]}return[]}if(h>0){var R=Math.sqrt(h),A=(s+h-c/R)/2,N=(s+h+c/R)/2,S=r.computeRealRoots(1,R,A),I=r.computeRealRoots(1,-R,N);return 0!==S.length?(S[0]+=d,S[1]+=d,0!==I.length?(I[0]+=d,I[1]+=d,S[1]<=I[0]?[S[0],S[1],I[0],I[1]]:I[1]<=S[0]?[I[0],I[1],S[0],S[1]]:S[0]>=I[0]&&S[1]<=I[1]?[I[0],S[0],S[1],I[1]]:I[0]>=S[0]&&I[1]<=S[1]?[S[0],I[0],I[1],S[1]]:S[0]>I[0]&&S[0]<I[1]?[I[0],S[0],I[1],S[1]]:[S[0],I[0],S[1],I[1]]):S):0!==I.length?(I[0]+=d,I[1]+=d,I):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,f=i*t+s-4*o,d=c*o-i*a*t+u,h=e.computeRealRoots(1,l,f,d);if(h.length>0){var E,m,_=h[0],y=a-_,p=y*y,T=t/2,R=y/2,A=p-4*o,N=p+4*Math.abs(o),S=c-4*_,I=c+4*Math.abs(_);if(_<0||A*I<S*N){var M=Math.sqrt(S);E=M/2,m=0===M?0:(t*R-i)/M}else{var O=Math.sqrt(A);E=0===O?0:(t*R-i)/O,m=O/2}var g,v;0===T&&0===E?(g=0,v=0):n.sign(T)===n.sign(E)?(g=T+E,v=_/g):(v=T-E,g=_/v);var x,w;0===R&&0===m?(x=0,w=0):n.sign(R)===n.sign(m)?(x=R+m,w=o/x):(w=R-m,x=o/w);var C=r.computeRealRoots(1,g,x),P=r.computeRealRoots(1,v,w);if(0!==C.length)return 0!==P.length?C[1]<=P[0]?[C[0],C[1],P[0],P[1]]:P[1]<=C[0]?[P[0],P[1],C[0],C[1]]:C[0]>=P[0]&&C[1]<=P[1]?[P[0],C[0],C[1],P[1]]:P[0]>=C[0]&&P[1]<=C[1]?[C[0],P[0],P[1],C[1]]:C[0]>P[0]&&C[0]<P[1]?[P[0],C[0],P[1],C[1]]:[C[0],P[0],C[1],P[1]]:C;if(0!==P.length)return P}return[]}var o={};return o.computeDiscriminant=function(e,t,n,r,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=n*n,l=c*n,f=r*r,d=f*r,h=a*a,E=h*a,m=u*c*f-4*s*d-4*e*l*f+18*e*t*n*d-27*i*f*f+256*o*E+a*(18*s*n*r-4*u*l+16*e*c*c-80*e*t*c*r-6*e*u*f+144*i*n*f)+h*(144*e*u*n-27*u*u-128*i*c-192*i*t*r);return m},o.computeRealRoots=function(t,r,o,u,s){if(Math.abs(t)<n.EPSILON15)return e.computeRealRoots(r,o,u,s);var c=r/t,l=o/t,f=u/t,d=s/t,h=c<0?1:0;switch(h+=l<0?h+1:h,h+=f<0?h+1:h,h+=d<0?h+1:h){case 0:return a(c,l,f,d);case 1:return i(c,l,f,d);case 2:return i(c,l,f,d);case 3:return a(c,l,f,d);case 4:return a(c,l,f,d);case 5:return i(c,l,f,d);case 6:return a(c,l,f,d);case 7:return a(c,l,f,d);case 8:return i(c,l,f,d);case 9:return a(c,l,f,d);case 10:return a(c,l,f,d);case 11:return i(c,l,f,d);case 12:return a(c,l,f,d);case 13:return a(c,l,f,d);case 14:return a(c,l,f,d);case 15:return a(c,l,f,d);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=e.clone(t(r,e.ZERO)),e.equals(r,e.ZERO)||e.normalize(r,r),this.origin=e.clone(t(n,e.ZERO)),this.direction=r}return a.getPoint=function(t,r,a){return n(a)||(a=new e),a=e.multiplyByScalar(t.direction,r,a),e.add(t.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t,n,r){var a=t*t-4*e*n;if(!(a<0)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return u<s?(r.root0=u,r.root1=s):(r.root0=s,r.root1=u),r}var c=-t/(2*e);if(0!==c)return r.root0=r.root1=c,r}}function f(t,n,a){r(a)||(a={});var i=t.origin,o=t.direction,u=n.center,s=n.radius*n.radius,c=e.subtract(i,u,y),f=e.dot(o,o),d=2*e.dot(o,c),h=e.magnitudeSquared(c)-s,E=l(f,d,h,A);if(r(E))return a.start=E.root0,a.stop=E.root1,a}function d(e,t,n){var r=e+t;return i.sign(e)!==i.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))<n?0:r}function h(t,n,r,a,c){var l,f=a*a,h=c*c,E=(t[o.COLUMN1ROW1]-t[o.COLUMN2ROW2])*h,m=c*(a*d(t[o.COLUMN1ROW0],t[o.COLUMN0ROW1],i.EPSILON15)+n.y),_=t[o.COLUMN0ROW0]*f+t[o.COLUMN2ROW2]*h+a*n.x+r,y=h*d(t[o.COLUMN2ROW1],t[o.COLUMN1ROW2],i.EPSILON15),p=c*(a*d(t[o.COLUMN2ROW0],t[o.COLUMN0ROW2])+n.z),T=[];if(0===p&&0===y){if(l=u.computeRealRoots(E,m,_),0===l.length)return T;var R=l[0],A=Math.sqrt(Math.max(1-R*R,0));if(T.push(new e(a,c*R,c*-A)),T.push(new e(a,c*R,c*A)),2===l.length){var N=l[1],S=Math.sqrt(Math.max(1-N*N,0));T.push(new e(a,c*N,c*-S)),T.push(new e(a,c*N,c*S))}return T}var I=p*p,M=y*y,O=E*E,g=p*y,v=O+M,x=2*(m*E+g),w=2*_*E+m*m-M+I,C=2*(_*m-g),P=_*_-I;if(0===v&&0===x&&0===w&&0===C)return T;l=s.computeRealRoots(v,x,w,C,P);var U=l.length;if(0===U)return T;for(var D=0;D<U;++D){var L,F=l[D],z=F*F,B=Math.max(1-z,0),b=Math.sqrt(B);L=i.sign(E)===i.sign(_)?d(E*z+_,m*F,i.EPSILON12):i.sign(_)===i.sign(m*F)?d(E*z,m*F+_,i.EPSILON12):d(E*z+m*F,_,i.EPSILON12);var q=d(y*F,p,i.EPSILON15),G=L*q;G<0?T.push(new e(a,c*F,c*b)):G>0?T.push(new e(a,c*F,c*-b)):0!==b?(T.push(new e(a,c*F,c*-b)),T.push(new e(a,c*F,c*b)),++D):T.push(new e(a,c*F,c*b))}return T}var E={};E.rayPlane=function(t,n,a){r(a)||(a=new e);var o=t.origin,u=t.direction,s=n.normal,c=e.dot(s,u);if(!(Math.abs(c)<i.EPSILON15)){var l=(-n.distance-e.dot(s,o))/c;if(!(l<0))return a=e.multiplyByScalar(u,l,a),e.add(o,a,a)}};var m=new e,_=new e,y=new e,p=new e,T=new e;E.rayTriangleParametric=function(t,r,a,o,u){u=n(u,!1);var s,c,l,f,d,h=t.origin,E=t.direction,R=e.subtract(a,r,m),A=e.subtract(o,r,_),N=e.cross(E,A,y),S=e.dot(R,N);if(u){if(S<i.EPSILON6)return;if(s=e.subtract(h,r,p),l=e.dot(s,N),l<0||l>S)return;if(c=e.cross(s,R,T),f=e.dot(E,c),f<0||l+f>S)return;d=e.dot(A,c)/S}else{if(Math.abs(S)<i.EPSILON6)return;var I=1/S;if(s=e.subtract(h,r,p),l=e.dot(s,N)*I,l<0||l>1)return;if(c=e.cross(s,R,T),f=e.dot(E,c)*I,f<0||l+f>1)return;d=e.dot(A,c)*I}return d},E.rayTriangle=function(t,n,a,i,o,u){var s=E.rayTriangleParametric(t,n,a,i,o);if(r(s)&&!(s<0))return r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var R=new c;E.lineSegmentTriangle=function(t,n,a,i,o,u,s){var c=R;e.clone(t,c.origin),e.subtract(n,t,c.direction),e.normalize(c.direction,c.direction);var l=E.rayTriangleParametric(c,a,i,o,u);if(!(!r(l)||l<0||l>e.distance(t,n)))return r(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var A={root0:0,root1:0};E.raySphere=function(e,t,n){if(n=f(e,t,n),r(n)&&!(n.stop<0))return n.start=Math.max(n.start,0),n};var N=new c;E.lineSegmentSphere=function(t,n,a,i){var o=N;e.clone(t,o.origin);var u=e.subtract(n,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),i=f(o,a,i),!(!r(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var S=new e,I=new e;E.rayEllipsoid=function(t,n){var r,a,i,o,u,s=n.oneOverRadii,c=e.multiplyComponents(s,t.origin,S),l=e.multiplyComponents(s,t.direction,I),f=e.magnitudeSquared(c),d=e.dot(c,l);if(f>1){if(d>=0)return;var h=d*d;if(r=f-1,a=e.magnitudeSquared(l),i=a*r,h<i)return;if(h>i){o=d*d-i,u=-d+Math.sqrt(o);var E=u/a,m=r/u;return E<m?{start:E,stop:m}:{start:m,stop:E}}var _=Math.sqrt(r/a);return{start:_,stop:_}}return f<1?(r=f-1,a=e.magnitudeSquared(l),i=a*r,o=d*d-i,u=-d+Math.sqrt(o),{start:0,stop:u/a}):d<0?(a=e.magnitudeSquared(l),{start:0,stop:-d/a}):void 0};var M=new e,O=new e,g=new e,v=new e,x=new e,w=new o,C=new o,P=new o,U=new o,D=new o,L=new o,F=new o,z=new e,B=new e,b=new t;E.grazingAltitudeLocation=function(t,n){var a=t.origin,u=t.direction;if(!e.equals(a,e.ZERO)){var s=n.geodeticSurfaceNormal(a,M);if(e.dot(u,s)>=0)return a}var c=r(this.rayEllipsoid(t,n)),l=n.transformPositionToScaledSpace(u,M),f=e.normalize(l,l),d=e.mostOrthogonalAxis(l,v),E=e.normalize(e.cross(d,f,O),O),m=e.normalize(e.cross(f,E,g),g),_=w;_[0]=f.x,_[1]=f.y,_[2]=f.z,_[3]=E.x,_[4]=E.y,_[5]=E.z,_[6]=m.x,_[7]=m.y,_[8]=m.z;var y=o.transpose(_,C),p=o.fromScale(n.radii,P),T=o.fromScale(n.oneOverRadii,U),R=D;R[0]=0,R[1]=-u.z,R[2]=u.y,R[3]=u.z,R[4]=0,R[5]=-u.x,R[6]=-u.y,R[7]=u.x,R[8]=0;var A,N,S=o.multiply(o.multiply(y,T,L),R,L),I=o.multiply(o.multiply(S,p,F),_,F),q=o.multiplyByVector(S,a,x),G=h(I,e.negate(q,M),0,0,1),W=G.length;if(W>0){for(var X=e.clone(e.ZERO,B),V=Number.NEGATIVE_INFINITY,H=0;H<W;++H){A=o.multiplyByVector(p,o.multiplyByVector(_,G[H],z),z);var Y=e.normalize(e.subtract(A,a,v),v),k=e.dot(Y,u);k>V&&(V=k,X=e.clone(A,X))}var j=n.cartesianToCartographic(X,b);return V=i.clamp(V,0,1),N=e.magnitude(e.subtract(X,a,v))*Math.sqrt(1-V*V),N=c?-N:N,j.height=N,n.cartographicToCartesian(j,new e)}};var q=new e;return E.lineSegmentPlane=function(t,n,a,o){r(o)||(o=new e);var u=e.subtract(n,t,q),s=a.normal,c=e.dot(s,u);if(!(Math.abs(c)<i.EPSILON6)){var l=e.dot(s,t),f=-(a.distance+l)/c;if(!(f<0||f>1))return e.multiplyByScalar(u,f,o),e.add(t,o,o),o}},E.trianglePlaneIntersection=function(t,n,r,a){var i=a.normal,o=a.distance,u=e.dot(i,t)+o<0,s=e.dot(i,n)+o<0,c=e.dot(i,r)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var f,d;if(1!==l&&2!==l||(f=new e,d=new e),1===l){if(u)return E.lineSegmentPlane(t,n,a,f),E.lineSegmentPlane(t,r,a,d),{positions:[t,n,r,f,d],indices:[0,3,4,1,2,4,1,4,3]};if(s)return E.lineSegmentPlane(n,r,a,f),E.lineSegmentPlane(n,t,a,d),{positions:[t,n,r,f,d],indices:[1,3,4,2,0,4,2,4,3]};if(c)return E.lineSegmentPlane(r,t,a,f),E.lineSegmentPlane(r,n,a,d),{positions:[t,n,r,f,d],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return E.lineSegmentPlane(n,t,a,f),E.lineSegmentPlane(r,t,a,d),{positions:[t,n,r,f,d],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return E.lineSegmentPlane(r,n,a,f),E.lineSegmentPlane(t,n,a,d),{positions:[t,n,r,f,d],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return E.lineSegmentPlane(t,r,a,f),E.lineSegmentPlane(n,r,a,d),{positions:[t,n,r,f,d],indices:[0,1,4,0,4,3,2,3,4]}}},E}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";function a(t,n){this.normal=e.clone(t),this.distance=n}a.fromPointNormal=function(n,r,i){var o=-e.dot(r,n);return t(i)?(e.clone(r,i.normal),i.distance=o,i):new a(r,o)};var i=new e;return a.fromCartesian4=function(n,r){var o=e.fromCartesian4(n,i),u=n.w;return t(r)?(e.clone(o,r.normal),r.distance=u,r):new a(o,u)},a.getPointDistance=function(t,n){return e.dot(t.normal,n)+t.distance},a.ORIGIN_XY_PLANE=r(new a(e.UNIT_Z,0)),a.ORIGIN_YZ_PLANE=r(new a(e.UNIT_X,0)),a.ORIGIN_ZX_PLANE=r(new a(e.UNIT_Y,0)),a}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,n,r,a){return t(e).then(n,r,a)}function t(e){var t,n;return e instanceof r?t=e:u(e)?(n=o(),e.then(function(e){n.resolve(e)},function(e){n.reject(e)},function(e){n.progress(e)}),t=n.promise):t=a(e),t}function n(t){return e(t,i)}function r(e){this.then=e}function a(e){var n=new r(function(n){try{return t(n?n(e):e)}catch(e){return i(e)}});return n}function i(e){var n=new r(function(n,r){try{return r?t(r(e)):i(e)}catch(e){return i(e)}});return n}function o(){function e(e,t,n){return d(e,t,n)}function n(e){return E(e)}function a(e){return E(i(e))}function u(e){return h(e)}var s,c,l,f,d,h,E;return c=new r(e),s={then:e,resolve:n,reject:a,progress:u,promise:c,resolver:{resolve:n,reject:a,progress:u}},l=[],f=[],d=function(e,t,n){var r,a;return r=o(),a="function"==typeof n?function(e){try{r.progress(n(e))}catch(e){r.progress(e)}}:function(e){r.progress(e)},l.push(function(n){n.then(e,t).then(r.resolve,r.reject,a)}),f.push(a),r.promise},h=function(e){return m(f,e),e},E=function(e){return e=t(e),d=e.then,E=t,h=y,m(l,e),f=l=A,e},s}function u(e){return e&&"function"==typeof e.then}function s(t,n,r,a,i){return _(2,arguments),e(t,function(t){function u(e){m(e)}function s(e){E(e)}var c,l,f,d,h,E,m,_,p,T;if(p=t.length>>>0,c=Math.max(0,Math.min(n,p)),f=[],l=p-c+1,d=[],h=o(),c)for(_=h.progress,m=function(e){d.push(e),--l||(E=m=y,h.reject(d))},E=function(e){f.push(e),--c||(E=m=y,h.resolve(f))},T=0;T<p;++T)T in t&&e(t[T],s,u,_);else h.resolve(f);return h.then(r,a,i)})}function c(e,t,n,r){function a(e){return t?t(e[0]):e[0]}return s(e,1,a,n,r)}function l(e,t,n,r){return _(1,arguments),d(e,p).then(t,n,r)}function f(){return d(arguments,p)}function d(t,n){return e(t,function(t){var r,a,i,u,s,c;if(i=a=t.length>>>0,r=[],c=o(),i)for(u=function(t,a){e(t,n).then(function(e){r[a]=e,--i||c.resolve(r)},c.reject)},s=0;s<a;s++)s in t?u(t[s],s):--i;else c.resolve(r);return c.promise})}function h(t,n){var r=R.call(arguments,1);return e(t,function(t){var a;return a=t.length,r[0]=function(t,r,i){return e(t,function(t){return e(r,function(e){return n(t,e,i,a)})})},T.apply(t,r)})}function E(t,n,r){var a=arguments.length>2;return e(t,function(e){return e=a?r:e,n.resolve(e),e},function(e){return n.reject(e),i(e)},n.progress)}function m(e,t){for(var n,r=0;n=e[r++];)n(t)}function _(e,t){for(var n,r=t.length;r>e;)if(n=t[--r],null!=n&&"function"!=typeof n)throw new Error("arg "+r+" must be a function")}function y(){}function p(e){return e}var T,R,A;return e.defer=o,e.resolve=t,e.reject=n,e.join=f,e.all=l,e.map=d,e.reduce=h,e.any=c,e.some=s,e.chain=E,e.isPromise=u,r.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(A,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return l(t,function(t){return e.apply(A,t)})})}},R=[].slice,T=[].reduce||function(e){var t,n,r,a,i;if(i=0,t=Object(this),a=t.length>>>0,n=arguments,n.length<=1)for(;;){if(i in t){ -r=t[i++];break}if(++i>=a)throw new TypeError}else r=n[1];for(;i<a;++i)i in t&&(r=e(r,t[i],i,t));return r},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n,r){t(a[n])||(a[n]=!0,console.log(e(r,n)))}var a={};return r.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.",r}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,n){"use strict";function r(e,t){n(e,t)}return r}),define("Core/binarySearch",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e,t,n){for(var r,a,i=0,o=e.length-1;i<=o;)if(r=~~((i+o)/2),a=n(e[r],t),a<0)i=r+1;else{if(!(a>0))return r;o=r-1}return~(o+1)}return n}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,n,r,a){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=r,this.ut1MinusUtc=a}return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,n=0,r=t[n++],a=function(e,t,n,r){n||(n=" ");var a=e.length>=t?"":Array(1+t-e.length>>>0).join(n);return r?e+a:a+e},i=function(e,t,n,r,i,o){var u=r-e.length;return u>0&&(e=n||!i?a(e,r,o,n):e.slice(0,t.length)+a("",u,"0",!0)+e.slice(t.length)),e},o=function(e,t,n,r,o,u,s){var c=e>>>0;return n=n&&c&&{2:"0b",8:"0",16:"0x"}[t]||"",e=n+a(c.toString(t),u||0,"0",!1),i(e,n,r,o,s)},u=function(e,t,n,r,a,o){return null!=r&&(e=e.slice(0,r)),i(e,"",t,n,a,o)},s=function(e,r,s,c,l,f,d){var h,E,m,_,y;if("%%"==e)return"%";for(var p=!1,T="",R=!1,A=!1,N=" ",S=s.length,I=0;s&&I<S;I++)switch(s.charAt(I)){case" ":T=" ";break;case"+":T="+";break;case"-":p=!0;break;case"'":N=s.charAt(I+1);break;case"0":R=!0;break;case"#":A=!0}if(c=c?"*"==c?+t[n++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,c<0&&(c=-c,p=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(f=f?"*"==f?+t[n++]:"*"==f.charAt(0)?+t[f.slice(1,-1)]:+f:"fFeE".indexOf(d)>-1?6:"d"==d?0:void 0,y=r?t[r.slice(0,-1)]:t[n++],d){case"s":return u(String(y),p,c,f,R,N);case"c":return u(String.fromCharCode(+y),p,c,f,R);case"b":return o(y,2,A,p,c,f,R);case"o":return o(y,8,A,p,c,f,R);case"x":return o(y,16,A,p,c,f,R);case"X":return o(y,16,A,p,c,f,R).toUpperCase();case"u":return o(y,10,A,p,c,f,R);case"i":case"d":return h=+y||0,h=Math.round(h-h%1),E=h<0?"-":T,y=E+a(String(Math.abs(h)),f,"0",!1),i(y,E,p,c,R);case"e":case"E":case"f":case"F":case"g":case"G":return h=+y,E=h<0?"-":T,m=["toExponential","toFixed","toPrecision"]["efg".indexOf(d.toLowerCase())],_=["toString","toUpperCase"]["eEfFgG".indexOf(d)%2],y=E+Math.abs(h)[m](f),i(y,E,p,c,R)[_]();default:return e}};return r.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,n,r,a,i,o,u){this.year=e,this.month=t,this.day=n,this.hour=r,this.minute=a,this.second=i,this.millisecond=o,this.isLeapSecond=u}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e(t)}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t){return m.compare(e.julianDate,t.julianDate)}function f(e){T.julianDate=e;var n=m.leapSeconds,r=t(n,T,l);r<0&&(r=~r),r>=n.length&&(r=n.length-1);var a=n[r].offset;if(r>0){var i=m.secondsDifference(n[r].julianDate,e);i>a&&(r--,a=n[r].offset)}m.addSeconds(e,a,e)}function d(e,n){T.julianDate=e;var r=m.leapSeconds,a=t(r,T,l);if(a<0&&(a=~a),0===a)return m.addSeconds(e,-r[0].offset,n);if(a>=r.length)return m.addSeconds(e,-r[a-1].offset,n);var i=m.secondsDifference(r[a].julianDate,e);return 0===i?m.addSeconds(e,-r[a].offset,n):i<=1?void 0:m.addSeconds(e,-r[--a].offset,n)}function h(e,t,n){var r=t/s.SECONDS_PER_DAY|0;return e+=r,t-=s.SECONDS_PER_DAY*r,t<0&&(e--,t+=s.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function E(e,t,n,r,a,i,o){var u=(t-14)/12|0,c=e+4800+u,l=(1461*c/4|0)+(367*(t-2-12*u)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;r-=12,r<0&&(r+=24);var f=i+(r*s.SECONDS_PER_HOUR+a*s.SECONDS_PER_MINUTE+o*s.SECONDS_PER_MILLISECOND);return f>=43200&&(l-=1),[l,f]}function m(e,t,r){this.dayNumber=void 0,this.secondsOfDay=void 0,e=n(e,0),t=n(t,0),r=n(r,c.UTC);var a=0|e;t+=(e-a)*s.SECONDS_PER_DAY,h(a,t,this),r===c.UTC&&f(this)}var _=new i,y=[31,28,31,30,31,30,31,31,30,31,30,31],p=29,T=new u,R=/^(\d{4})$/,A=/^(\d{4})-(\d{2})$/,N=/^(\d{4})-?(\d{3})$/,S=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,I=/^(\d{4})-?(\d{2})-?(\d{2})$/,M=/([Z+\-])?(\d{2})?:?(\d{2})?$/,O=/^(\d{2})(\.\d+)?/.source+M.source,g=/^(\d{2}):?(\d{2})(\.\d+)?/.source+M.source,v=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+M.source;m.fromDate=function(e,t){var n=E(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r(t)?(h(n[0],n[1],t),f(t),t):new m(n[0],n[1],c.UTC)},m.fromIso8601=function(e,t){e=e.replace(",",".");var n,a,i,u=e.split("T"),s=1,l=1,d=0,_=0,T=0,M=0,x=u[0],w=u[1];if(u=x.match(I),null!==u)n=+u[1],s=+u[2],l=+u[3];else if(u=x.match(A),null!==u)n=+u[1],s=+u[2];else if(u=x.match(R),null!==u)n=+u[1];else{var C;if(u=x.match(N),null!==u)n=+u[1],C=+u[2],i=o(n);else if(u=x.match(S),null!==u){n=+u[1];var P=+u[2],U=+u[3]||0,D=new Date(Date.UTC(n,0,4));C=7*P+U-D.getUTCDay()-3}a=new Date(Date.UTC(n,0,1)),a.setUTCDate(C),s=a.getUTCMonth()+1,l=a.getUTCDate()}i=o(n);var L;if(r(w)){u=w.match(v),null!==u?(d=+u[1],_=+u[2],T=+u[3],M=1e3*+(u[4]||0),L=5):(u=w.match(g),null!==u?(d=+u[1],_=+u[2],T=60*+(u[3]||0),L=4):(u=w.match(O),null!==u&&(d=+u[1],_=60*+(u[2]||0),L=3)));var F=u[L],z=+u[L+1],B=+(u[L+2]||0);switch(F){case"+":d-=z,_-=B;break;case"-":d+=z,_+=B;break;case"Z":break;default:_+=new Date(Date.UTC(n,s-1,l,d,_)).getTimezoneOffset()}}else _+=new Date(n,s-1,l).getTimezoneOffset();var b=60===T;for(b&&T--;_>=60;)_-=60,d++;for(;d>=24;)d-=24,l++;for(a=i&&2===s?p:y[s-1];l>a;)l-=a,s++,s>12&&(s-=12,n++),a=i&&2===s?p:y[s-1];for(;_<0;)_+=60,d--;for(;d<0;)d+=24,l--;for(;l<1;)s--,s<1&&(s+=12,n--),a=i&&2===s?p:y[s-1],l+=a;var q=E(n,s,l,d,_,T,M);return r(t)?(h(q[0],q[1],t),f(t)):t=new m(q[0],q[1],c.UTC),b&&m.addSeconds(t,1,t),t},m.now=function(e){return m.fromDate(new Date,e)};var x=new m(0,0,c.TAI);return m.toGregorianDate=function(e,t){var n=!1,a=d(e,x);r(a)||(m.addSeconds(e,-1,x),a=d(x,x),n=!0);var o=a.dayNumber,u=a.secondsOfDay;u>=43200&&(o+=1);var c=o+68569|0,l=4*c/146097|0;c=c-((146097*l+3)/4|0)|0;var f=4e3*(c+1)/1461001|0;c=c-(1461*f/4|0)+31|0;var h=80*c/2447|0,E=c-(2447*h/80|0)|0;c=h/11|0;var _=h+2-12*c|0,y=100*(l-49)+f+c|0,p=u/s.SECONDS_PER_HOUR|0,T=u-p*s.SECONDS_PER_HOUR,R=T/s.SECONDS_PER_MINUTE|0;T-=R*s.SECONDS_PER_MINUTE;var A=0|T,N=(T-A)/s.SECONDS_PER_MILLISECOND;return p+=12,p>23&&(p-=24),n&&(A+=1),r(t)?(t.year=y,t.month=_,t.day=E,t.hour=p,t.minute=R,t.second=A,t.millisecond=N,t.isLeapSecond=n,t):new i(y,_,E,p,R,A,N,n)},m.toDate=function(e){var t=m.toGregorianDate(e,_),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))},m.toIso8601=function(t,n){var a,i=m.toGregorianDate(t,i);return r(n)||0===i.millisecond?r(n)&&0!==n?(a=(.01*i.millisecond).toFixed(n).replace(".","").slice(0,n),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",i.year,i.month,i.day,i.hour,i.minute,i.second):(a=(.01*i.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a))},m.clone=function(e,t){if(r(e))return r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new m(e.dayNumber,e.secondsOfDay,c.TAI)},m.compare=function(e,t){var n=e.dayNumber-t.dayNumber;return 0!==n?n:e.secondsOfDay-t.secondsOfDay},m.equals=function(e,t){return e===t||r(e)&&r(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},m.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(m.secondsDifference(e,t))<=n},m.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},m.secondsDifference=function(e,t){var n=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return n+(e.secondsOfDay-t.secondsOfDay)},m.daysDifference=function(e,t){var n=e.dayNumber-t.dayNumber,r=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return n+r},m.computeTaiMinusUtc=function(e){T.julianDate=e;var n=m.leapSeconds,r=t(n,T,l);return r<0&&(r=~r,--r,r<0&&(r=0)),n[r].offset},m.addSeconds=function(e,t,n){return h(e.dayNumber,e.secondsOfDay+t,n)},m.addMinutes=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return h(e.dayNumber,r,n)},m.addHours=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return h(e.dayNumber,r,n)},m.addDays=function(e,t,n){var r=e.dayNumber+t;return h(r,e.secondsOfDay,n)},m.lessThan=function(e,t){return m.compare(e,t)<0},m.lessThanOrEquals=function(e,t){return m.compare(e,t)<=0},m.greaterThan=function(e,t){return m.compare(e,t)>0},m.greaterThanOrEquals=function(e,t){return m.compare(e,t)>=0},m.prototype.clone=function(e){return m.clone(this,e)},m.prototype.equals=function(e){return m.equals(this,e)},m.prototype.equalsEpsilon=function(e,t){return m.equalsEpsilon(this,e,t)},m.prototype.toString=function(){return m.toIso8601(this)},m.leapSeconds=[new u(new m(2441317,43210,c.TAI),10),new u(new m(2441499,43211,c.TAI),11),new u(new m(2441683,43212,c.TAI),12),new u(new m(2442048,43213,c.TAI),13),new u(new m(2442413,43214,c.TAI),14),new u(new m(2442778,43215,c.TAI),15),new u(new m(2443144,43216,c.TAI),16),new u(new m(2443509,43217,c.TAI),17),new u(new m(2443874,43218,c.TAI),18),new u(new m(2444239,43219,c.TAI),19),new u(new m(2444786,43220,c.TAI),20),new u(new m(2445151,43221,c.TAI),21),new u(new m(2445516,43222,c.TAI),22),new u(new m(2446247,43223,c.TAI),23),new u(new m(2447161,43224,c.TAI),24),new u(new m(2447892,43225,c.TAI),25),new u(new m(2448257,43226,c.TAI),26),new u(new m(2448804,43227,c.TAI),27),new u(new m(2449169,43228,c.TAI),28),new u(new m(2449534,43229,c.TAI),29),new u(new m(2450083,43230,c.TAI),30),new u(new m(2450630,43231,c.TAI),31),new u(new m(2451179,43232,c.TAI),32),new u(new m(2453736,43233,c.TAI),33),new u(new m(2454832,43234,c.TAI),34),new u(new m(2456109,43235,c.TAI),35),new u(new m(2457204,43236,c.TAI),36),new u(new m(2457754,43237,c.TAI),37)],m}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(n,r){if(null===n||"object"!=typeof n)return n;r=e(r,!1);var a=new n.constructor;for(var i in n)if(n.hasOwnProperty(i)){var o=n[i];r&&(o=t(o,r)),a[i]=o}return a}return t}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var n=e.split("\r\n"),r=0;r<n.length;++r){var a=n[r],i=a.indexOf(": ");if(i>0){var o=a.substring(0,i),u=a.substring(i+2);t[o]=u}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function n(e,n,r){this.statusCode=e,this.response=n,this.responseHeaders=r,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return n.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},n}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var n=r.exec(t);this.scheme=n[1],this.authority=n[2],this.path=n[3],this.query=n[4],this.fragment=n[5]}}function t(e){var t=unescape(e);return i.test(t)?t:e.toUpperCase()}function n(e,t,n,r){return(t||"")+n.toLowerCase()+(r||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var r=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(o,n).replace(a,t)),this.path&&(this.path=this.path.replace(a,t)),this.query&&(this.query=this.query.replace(a,t)),this.fragment&&(this.fragment=this.fragment.replace(a,t))};var a=/%[0-9a-z]{2}/gi,i=/[a-zA-Z0-9\-\._~]/,o=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var n=new e;return this.scheme?(n.scheme=this.scheme,n.authority=this.authority,n.path=this.path,n.query=this.query):(n.scheme=t.scheme,this.authority?(n.authority=this.authority,n.path=this.path,n.query=this.query):(n.authority=t.authority,""==this.path?(n.path=t.path,n.query=this.query||t.query):("/"==this.path.charAt(0)?(n.path=this.path,n.removeDotSegments()):(t.authority&&""==t.path?n.path="/"+this.path:n.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,n.removeDotSegments()),n.query=this.query))),n.fragment=this.fragment,n},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),n=[],r=""==t[0];r&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?n.pop():"."!=e&&n.push(e);"."!=e&&".."!=e||n.push(""),r&&n.unshift(""),this.path=n.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n){var r=new e(n);r.normalize();var a=r.getAuthority();if(t(a)){if(a.indexOf("@")!==-1){var i=a.split("@");a=i[1]}if(a.indexOf(":")===-1){var o=r.getScheme();if(t(o)||(o=window.location.protocol,o=o.substring(0,o.length-1)),"http"===o)a+=":80";else{if("https"!==o)return;a+=":443"}}return a}}var a={},i={};return a.add=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])||(i[r]=!0)},a.remove=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])&&delete i[r]},a.contains=function(e){var n=r(e);return!(!t(n)||!t(i[n]))},a.clear=function(){i={}},a}),define("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,n,r,a,i,o){"use strict";function u(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,a=t(n.method,"GET"),i=n.data,o=n.headers,s=n.overrideMimeType;return e(n.url,function(t){var n=e.defer();return u.load(t,r,a,i,o,n,s),n.promise})}function s(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function c(e,t){for(var n=s(e,t),r=new ArrayBuffer(n.length),a=new Uint8Array(r),i=0;i<n.length;i++)a[i]=n.charCodeAt(i);return r}function l(e,n){n=t(n,"");var r=e[1],a=!!e[2],i=e[3];switch(n){case"":case"text":return s(a,i);case"arraybuffer":return c(a,i);case"blob":var o=c(a,i);return new Blob([o],{type:r});case"document":var u=new DOMParser;return u.parseFromString(s(a,i),r);case"json":return JSON.parse(s(a,i))}}var f=/^data:(.*?)(;base64)?,(.*)$/;return u.load=function(e,t,r,u,s,c,d){var h=f.exec(e);if(null!==h)return void c.resolve(l(h,t));var E=new XMLHttpRequest;if(o.contains(e)&&(E.withCredentials=!0),n(d)&&n(E.overrideMimeType)&&E.overrideMimeType(d),E.open(r,e,!0),n(s))for(var m in s)s.hasOwnProperty(m)&&E.setRequestHeader(m,s[m]);n(t)&&(E.responseType=t),E.onload=function(){if(E.status<200||E.status>=300)return void c.reject(new a(E.status,E.response,E.getAllResponseHeaders()));var e=E.response,r=E.responseType;if(!n(e)||n(t)&&r!==t)if("json"===t&&"string"==typeof e)try{c.resolve(JSON.parse(e))}catch(e){c.reject(e)}else(""===r||"document"===r)&&n(E.responseXML)&&E.responseXML.hasChildNodes()?c.resolve(E.responseXML):""!==r&&"text"!==r||!n(E.responseText)?c.reject(new i("Invalid XMLHttpRequest response type.")):c.resolve(E.responseText);else c.resolve(e)},E.onerror=function(e){c.reject(new a)},E.send(u)},u.defaultLoad=u.load,u}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,n){return e({url:t,headers:n})}return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";function a(n,a){return t(a)?t(a.Accept)||(a=e(a),a.Accept=i.Accept):a=i,r(n,a).then(function(e){return JSON.parse(e)})}var i={Accept:"application/json,*/*;q=0.01"};return a}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function d(t){if(t=n(t,n.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=n(t.addNewLeapSeconds,!0),r(t.data))E(this,t.data);else if(r(t.url)){var a=this;this._downloadPromise=e(s(t.url),function(e){E(a,e)},function(){a._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else E(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function h(e,t){return o.compare(e.julianDate,t)}function E(e,n){if(!r(n.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!r(n.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var a=n.columnNames.indexOf("modifiedJulianDateUtc"),i=n.columnNames.indexOf("xPoleWanderRadians"),s=n.columnNames.indexOf("yPoleWanderRadians"),c=n.columnNames.indexOf("ut1MinusUtcSeconds"),d=n.columnNames.indexOf("xCelestialPoleOffsetRadians"),E=n.columnNames.indexOf("yCelestialPoleOffsetRadians"),m=n.columnNames.indexOf("taiMinusUtcSeconds");if(a<0||i<0||s<0||c<0||d<0||E<0||m<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var _=e._samples=n.samples,y=e._dates=[];e._dateColumn=a,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=d,e._yCelestialPoleOffsetRadiansColumn=E,e._taiMinusUtcSecondsColumn=m,e._columnCount=n.columnNames.length,e._lastIndex=void 0;for(var p,T=e._addNewLeapSeconds,R=0,A=_.length;R<A;R+=e._columnCount){var N=_[R+a],S=_[R+m],I=N+l.MODIFIED_JULIAN_DATE_DIFFERENCE,M=new o(I,S,f.TAI);if(y.push(M),T){if(S!==p&&r(p)){var O=o.leapSeconds,g=t(O,M,h);if(g<0){var v=new u(M,S);O.splice(~g,0,v)}}p=S}}}function m(e,t,n,r,a){var i=n*r;a.xPoleWander=t[i+e._xPoleWanderRadiansColumn],a.yPoleWander=t[i+e._yPoleWanderRadiansColumn],a.xPoleOffset=t[i+e._xCelestialPoleOffsetRadiansColumn],a.yPoleOffset=t[i+e._yCelestialPoleOffsetRadiansColumn],a.ut1MinusUtc=t[i+e._ut1MinusUtcSecondsColumn]}function _(e,t,n){return t+e*(n-t)}function y(e,t,n,r,a,i,u){var s=e._columnCount;if(i>t.length-1)return u.xPoleWander=0,u.yPoleWander=0,u.xPoleOffset=0,u.yPoleOffset=0,u.ut1MinusUtc=0,u;var c=t[a],l=t[i];if(c.equals(l)||r.equals(c))return m(e,n,a,s,u),u;if(r.equals(l))return m(e,n,i,s,u),u;var f=o.secondsDifference(r,c)/o.secondsDifference(l,c),d=a*s,h=i*s,E=n[d+e._ut1MinusUtcSecondsColumn],y=n[h+e._ut1MinusUtcSecondsColumn],p=y-E;if(p>.5||p<-.5){var T=n[d+e._taiMinusUtcSecondsColumn],R=n[h+e._taiMinusUtcSecondsColumn];T!==R&&(l.equals(r)?E=y:y-=R-T)}return u.xPoleWander=_(f,n[d+e._xPoleWanderRadiansColumn],n[h+e._xPoleWanderRadiansColumn]),u.yPoleWander=_(f,n[d+e._yPoleWanderRadiansColumn],n[h+e._yPoleWanderRadiansColumn]),u.xPoleOffset=_(f,n[d+e._xCelestialPoleOffsetRadiansColumn],n[h+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=_(f,n[d+e._yCelestialPoleOffsetRadiansColumn],n[h+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=_(f,E,y),u}return d.NONE=i({getPromiseToLoad:function(){return e()},compute:function(e,t){return r(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new a(0,0,0,0,0),t}}),d.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},d.prototype.compute=function(e,n){if(r(this._samples)){if(r(n)||(n=new a(0,0,0,0,0)),0===this._samples.length)return n.xPoleWander=0,n.yPoleWander=0,n.xPoleOffset=0,n.yPoleOffset=0,n.ut1MinusUtc=0,n;var i=this._dates,u=this._lastIndex,s=0,l=0;if(r(u)){var f=i[u],d=i[u+1],h=o.lessThanOrEquals(f,e),E=!r(d),m=E||o.greaterThanOrEquals(d,e);if(h&&m)return s=u,!E&&d.equals(e)&&++s,l=s+1,y(this,i,this._samples,e,s,l,n),n}var _=t(i,e,o.compare,this._dateColumn);return _>=0?(_<i.length-1&&i[_+1].equals(e)&&++_,s=_,l=_):(l=~_,s=l-1,s<0&&(s=0)),this._lastIndex=s,y(this,i,this._samples,e,s,l,n),n}if(r(this._dataError))throw new c(this._dataError)},d}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(t,n,r){this.heading=e(t,0),this.pitch=e(n,0),this.roll=e(r,0)}return a.fromQuaternion=function(e,n){t(n)||(n=new a);var r=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return n.heading=-Math.atan2(s,u),n.roll=Math.atan2(o,i),n.pitch=-Math.asin(r),n},a.fromDegrees=function(e,n,i,o){return t(o)||(o=new a),o.heading=e*r.RADIANS_PER_DEGREE,o.pitch=n*r.RADIANS_PER_DEGREE,o.roll=i*r.RADIANS_PER_DEGREE,o},a.clone=function(e,n){if(t(e))return t(n)?(n.heading=e.heading,n.pitch=e.pitch,n.roll=e.roll,n):new a(e.heading,e.pitch,e.roll)},a.equals=function(e,n){return e===n||t(e)&&t(n)&&e.heading===n.heading&&e.pitch===n.pitch&&e.roll===n.roll},a.equalsEpsilon=function(e,n,a,i){return e===n||t(e)&&t(n)&&r.equalsEpsilon(e.heading,n.heading,a,i)&&r.equalsEpsilon(e.pitch,n.pitch,a,i)&&r.equalsEpsilon(e.roll,n.roll,a,i)},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,n){return a.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},a}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=t(r,document.location.href);var a=new e(r),i=new e(n);return i.resolve(a).toString()}return a}),define("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(r,a,i){i=t(i,!0),r instanceof e||(r=new e(r)),a instanceof e||(a=new e(a)),n(a.authority)&&!n(a.scheme)&&("undefined"!=typeof document&&n(document.location)&&n(document.location.href)?a.scheme=new e(document.location.href).scheme:a.scheme=r.scheme);var o=r;a.isAbsolute()&&(o=a);var u="";n(o.scheme)&&(u+=o.scheme+":"),n(o.authority)&&(u+="//"+o.authority,""!==o.path&&"/"!==o.path&&(u=u.replace(/\/?$/,"/"),o.path=o.path.replace(/^\/?/g,""))),u+=o===r?i?r.path.replace(/\/?$/,"/")+a.path.replace(/^\/?/g,""):r.path+a.path:a.path;var s=n(r.query),c=n(a.query);s&&c?u+="?"+r.query+"&"+a.query:s&&!c?u+="?"+r.query:!s&&c&&(u+="?"+a.query);var l=n(a.fragment);return n(r.fragment)&&!l?u+="#"+r.fragment:l&&(u+="#"+a.fragment),u}return a}),define("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","./joinUrls","require"],function(e,t,n,r,a,i){"use strict";function o(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;t<n;++t){var r=e[t].getAttribute("src"),a=E.exec(r);if(null!==a)return a[1]}}function u(){if(t(f))return f;var n;return n="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:o(),f=new e(r(n))}function s(e){return i.toUrl("../"+e)}function c(e){return a(u(),e)}function l(e){t(d)||(d=t(i.toUrl)?s:c),t(h)||(h=document.createElement("a"));var n=d(e);return h.href=n,h.href=h.href,h.href}var f,d,h,E=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return l._cesiumScriptRegex=E,l.setBaseUrl=function(t){f=new e(t).resolve(new e(document.location.href))},l}),define("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,n){this.x=e,this.y=t,this.s=n}return e}),define("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){e=n(e,n.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=n(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=n(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new i(this._sampleZeroJulianEphemerisDate,0,u.TAI),this._stepSizeDays=n(e.stepSizeDays,1),this._samplesPerXysFile=n(e.samplesPerXysFile,1e3),this._totalSamples=n(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,r=this._denominators=new Array(t+1),a=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t),s=0;s<=t;++s){r[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;c<=t;++c)c!==s&&(r[s]*=s-c);r[s]=1/r[s]}this._work=new Array(t+1),this._coef=new Array(t+1)}function c(e,t,n){var r=f;return r.dayNumber=t,r.secondsOfDay=n,i.daysDifference(r,e._sampleZeroDateTT)}function l(n,a){if(n._chunkDownloadsInProgress[a])return n._chunkDownloadsInProgress[a];var i=e.defer();n._chunkDownloadsInProgress[a]=i;var u,s=n._xysFileUrlTemplate;return u=r(s)?s.replace("{0}",a):t("Assets/IAU2006_XYS/IAU2006_XYS_"+a+".json"),e(o(u),function(e){n._chunkDownloadsInProgress[a]=!1;for(var t=n._samples,r=e.samples,o=a*n._samplesPerXysFile*3,u=0,s=r.length;u<s;++u)t[o+u]=r[u];i.resolve()}),i.promise}var f=new i(0,0,u.TAI);return s.prototype.preload=function(t,n,r,a){var i=c(this,t,n),o=c(this,r,a),u=i/this._stepSizeDays-this._interpolationOrder/2|0;u<0&&(u=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var f=u/this._samplesPerXysFile|0,d=s/this._samplesPerXysFile|0,h=[],E=f;E<=d;++E)h.push(l(this,E));return e.all(h)},s.prototype.computeXysRadians=function(e,t,n){var i=c(this,e,t);if(!(i<0)){var o=i/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);s<0&&(s=0);var f=s+u;f>=this._totalSamples&&(f=this._totalSamples-1,s=f-u,s<0&&(s=0));var d=!1,h=this._samples;if(r(h[3*s])||(l(this,s/this._samplesPerXysFile|0),d=!0),r(h[3*f])||(l(this,f/this._samplesPerXysFile|0),d=!0),!d){r(n)?(n.x=0,n.y=0,n.s=0):n=new a(0,0,0);var E,m,_=i-s*this._stepSizeDays,y=this._work,p=this._denominators,T=this._coef,R=this._xTable;for(E=0;E<=u;++E)y[E]=_-R[E];for(E=0;E<=u;++E){for(T[E]=1,m=0;m<=u;++m)m!==E&&(T[E]*=y[m]);T[E]*=p[E];var A=3*(s+E);n.x+=T[E]*h[A++],n.y+=T[E]*h[A++],n.s+=T[E]*h[A]}return n}}}},s}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return t(a,{element:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(r.requestFullscreen=a,n=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(r.requestFullscreen=a,n=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?r.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(r.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?r.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(r.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?r.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(r.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),r.fullscreenerror=a)}return n},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[r.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function a(){if(!t(A)&&(A=!1,!d())){var e=/ Chrome\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(A=!0,N=r(e[1]))}return A}function i(){return a()&&N}function o(){if(!t(S)&&(S=!1,!a()&&!d()&&/ Safari\/[\.0-9]+/.test(R.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(S=!0,I=r(e[1]))}return S}function u(){return o()&&I}function s(){if(!t(M)){M=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(R.userAgent);null!==e&&(M=!0,O=r(e[1]),O.isNightly=!!e[2])}return M}function c(){return s()&&O}function l(){if(!t(g)){g=!1;var e;"Microsoft Internet Explorer"===R.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(g=!0,v=r(e[1]))):"Netscape"===R.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(g=!0,v=r(e[1])))}return g}function f(){return l()&&v}function d(){if(!t(x)){x=!1;var e=/ Edge\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(x=!0,w=r(e[1]))}return x}function h(){return d()&&w}function E(){if(!t(C)){C=!1;var e=/Firefox\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(C=!0,P=r(e[1]))}return C}function m(){return t(U)||(U=/Windows/i.test(R.appVersion)),U}function _(){ -return E()&&P}function y(){return t(D)||(D="undefined"!=typeof PointerEvent&&(!t(R.pointerEnabled)||R.pointerEnabled)),D}function p(){if(!t(F)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;F=t(n)&&""!==n,F&&(L=n)}return F}function T(){return p()?L:void 0}var R;R="undefined"!=typeof navigator?navigator:{};var A,N,S,I,M,O,g,v,x,w,C,P,U,D,L,F,z={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isEdge:d,edgeVersion:h,isFirefox:E,firefoxVersion:_,isWindows:m,hardwareConcurrency:e(R.hardwareConcurrency,3),supportsPointerEvents:y,supportsImageRenderingPixelated:p,imageRenderingValue:T};return z.supportsFullscreen=function(){return n.supportsFullscreen()},z.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},z.supportsWebWorkers=function(){return"undefined"!=typeof Worker},z}),define("Core/Quaternion",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math","./Matrix3"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,n,r,a){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(a,0)}var c=new e;s.fromAxisAngle=function(t,r,a){var i=r/2,o=Math.sin(i);c=e.normalize(t,c);var u=c.x*o,l=c.y*o,f=c.z*o,d=Math.cos(i);return n(a)?(a.x=u,a.y=l,a.z=f,a.w=d,a):new s(u,l,f,d)};var l=[1,2,0],f=new Array(3);s.fromRotationMatrix=function(e,t){var r,a,i,o,c,d=e[u.COLUMN0ROW0],h=e[u.COLUMN1ROW1],E=e[u.COLUMN2ROW2],m=d+h+E;if(m>0)r=Math.sqrt(m+1),c=.5*r,r=.5/r,a=(e[u.COLUMN1ROW2]-e[u.COLUMN2ROW1])*r,i=(e[u.COLUMN2ROW0]-e[u.COLUMN0ROW2])*r,o=(e[u.COLUMN0ROW1]-e[u.COLUMN1ROW0])*r;else{var _=l,y=0;h>d&&(y=1),E>d&&E>h&&(y=2);var p=_[y],T=_[p];r=Math.sqrt(e[u.getElementIndex(y,y)]-e[u.getElementIndex(p,p)]-e[u.getElementIndex(T,T)]+1);var R=f;R[y]=.5*r,r=.5/r,c=(e[u.getElementIndex(T,p)]-e[u.getElementIndex(p,T)])*r,R[p]=(e[u.getElementIndex(p,y)]+e[u.getElementIndex(y,p)])*r,R[T]=(e[u.getElementIndex(T,y)]+e[u.getElementIndex(y,T)])*r,a=-R[0],i=-R[1],o=-R[2]}return n(t)?(t.x=a,t.y=i,t.z=o,t.w=c,t):new s(a,i,o,c)};var d=new s;s.fromHeadingPitchRoll=function(t,n,r,a){var i=s.fromAxisAngle(e.UNIT_X,r,d),o=s.fromAxisAngle(e.UNIT_Y,-n,a);a=s.multiply(o,i,o);var u=s.fromAxisAngle(e.UNIT_Z,-t,d);return s.multiply(u,a,a)};var h=new e,E=new e,m=new s,_=new s,y=new s;s.packedLength=4,s.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},s.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new s),a.x=e[r],a.y=e[r+1],a.z=e[r+2],a.w=e[r+3],a},s.packedInterpolationLength=3,s.convertPackedArrayForInterpolation=function(e,t,n,r){s.unpack(e,4*n,y),s.conjugate(y,y);for(var a=0,i=n-t+1;a<i;a++){var o=3*a;s.unpack(e,4*(t+a),m),s.multiply(m,y,m),m.w<0&&s.negate(m,m),s.computeAxis(m,h);var u=s.computeAngle(m);r[o]=h.x*u,r[o+1]=h.y*u,r[o+2]=h.z*u}},s.unpackInterpolationResult=function(t,r,a,i,o){n(o)||(o=new s),e.fromArray(t,0,E);var u=e.magnitude(E);return s.unpack(r,4*i,_),0===u?s.clone(s.IDENTITY,m):s.fromAxisAngle(E,u,m),s.multiply(m,_,o)},s.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new s(e.x,e.y,e.z,e.w)},s.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},s.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},s.magnitude=function(e){return Math.sqrt(s.magnitudeSquared(e))},s.normalize=function(e,t){var n=1/s.magnitude(e),r=e.x*n,a=e.y*n,i=e.z*n,o=e.w*n;return t.x=r,t.y=a,t.z=i,t.w=o,t},s.inverse=function(e,t){var n=s.magnitudeSquared(e);return t=s.conjugate(e,t),s.multiplyByScalar(t,1/n,t)},s.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},s.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},s.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},s.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},s.multiply=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=e.w,u=t.x,s=t.y,c=t.z,l=t.w,f=o*u+r*l+a*c-i*s,d=o*s-r*c+a*l+i*u,h=o*c+r*s-a*u+i*l,E=o*l-r*u-a*s-i*c;return n.x=f,n.y=d,n.z=h,n.w=E,n},s.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},s.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},s.computeAxis=function(e,t){var n=e.w;if(Math.abs(n-1)<o.EPSILON6)return t.x=t.y=t.z=0,t;var r=1/Math.sqrt(1-n*n);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},s.computeAngle=function(e){return Math.abs(e.w-1)<o.EPSILON6?0:2*Math.acos(e.w)};var p=new s;s.lerp=function(e,t,n,r){return p=s.multiplyByScalar(t,n,p),r=s.multiplyByScalar(e,1-n,r),s.add(p,r,r)};var T=new s,R=new s,A=new s;s.slerp=function(e,t,n,r){var a=s.dot(e,t),i=t;if(a<0&&(a=-a,i=T=s.negate(t,T)),1-a<o.EPSILON6)return s.lerp(e,i,n,r);var u=Math.acos(a);return R=s.multiplyByScalar(e,Math.sin((1-n)*u),R),A=s.multiplyByScalar(i,Math.sin(n*u),A),r=s.add(R,A,r),s.multiplyByScalar(r,1/Math.sin(u),r)},s.log=function(t,n){var r=o.acosClamped(t.w),a=0;return 0!==r&&(a=r/Math.sin(r)),e.multiplyByScalar(t,a,n)},s.exp=function(t,n){var r=e.magnitude(t),a=0;return 0!==r&&(a=Math.sin(r)/r),n.x=t.x*a,n.y=t.y*a,n.z=t.z*a,n.w=Math.cos(r),n};var N=new e,S=new e,I=new s,M=new s;s.computeInnerQuadrangle=function(t,n,r,a){var i=s.conjugate(n,I);s.multiply(i,r,M);var o=s.log(M,N);s.multiply(i,t,M);var u=s.log(M,S);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),s.exp(o,I),s.multiply(n,I,a)},s.squad=function(e,t,n,r,a,i){var o=s.slerp(e,t,a,I),u=s.slerp(n,r,a,M);return s.slerp(o,u,2*a*(1-a),i)};for(var O=new s,g=1.9011074535173003,v=a.supportsTypedArrays()?new Float32Array(8):[],x=a.supportsTypedArrays()?new Float32Array(8):[],w=a.supportsTypedArrays()?new Float32Array(8):[],C=a.supportsTypedArrays()?new Float32Array(8):[],P=0;P<7;++P){var U=P+1,D=2*U+1;v[P]=1/(U*D),x[P]=U/D}return v[7]=g/136,x[7]=8*g/17,s.fastSlerp=function(e,t,n,r){var a,i=s.dot(e,t);i>=0?a=1:(a=-1,i=-i);for(var o=i-1,u=1-n,c=n*n,l=u*u,f=7;f>=0;--f)w[f]=(v[f]*c-x[f])*o,C[f]=(v[f]*l-x[f])*o;var d=a*n*(1+w[0]*(1+w[1]*(1+w[2]*(1+w[3]*(1+w[4]*(1+w[5]*(1+w[6]*(1+w[7])))))))),h=u*(1+C[0]*(1+C[1]*(1+C[2]*(1+C[3]*(1+C[4]*(1+C[5]*(1+C[6]*(1+C[7])))))))),E=s.multiplyByScalar(e,h,O);return s.multiplyByScalar(t,d,r),s.add(E,r,r)},s.fastSquad=function(e,t,n,r,a,i){var o=s.fastSlerp(e,t,a,I),u=s.fastSlerp(n,r,a,M);return s.fastSlerp(o,u,2*a*(1-a),i)},s.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},s.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.x-t.x)<=r&&Math.abs(e.y-t.y)<=r&&Math.abs(e.z-t.z)<=r&&Math.abs(e.w-t.w)<=r},s.ZERO=i(new s(0,0,0,0)),s.IDENTITY=i(new s(0,0,0,1)),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.x+", "+this.y+", "+this.z+", "+this.w+")"},s}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./defaultValue","./defined","./deprecationWarning","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./HeadingPitchRoll","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,n,r,a,i,o,u,s,c,l,f,d,h,E,m,_,y,p,T,R){"use strict";var A={},N=new n,S=new n,I=new n;A.eastNorthUpToFixedFrame=function(e,t,r){if(_.equalsEpsilon(e.x,0,_.EPSILON14)&&_.equalsEpsilon(e.y,0,_.EPSILON14)){var a=_.sign(e.z);return o(r)?(r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=-a,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=a,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new p(0,-a,0,e.x,1,0,0,e.y,0,0,a,e.z,0,0,0,1)}var u=N,s=S,c=I;return t=i(t,f.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,c),o(r)?(r[0]=s.x,r[1]=s.y,r[2]=s.z,r[3]=0,r[4]=c.x,r[5]=c.y,r[6]=c.z,r[7]=0,r[8]=u.x,r[9]=u.y,r[10]=u.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new p(s.x,c.x,u.x,e.x,s.y,c.y,u.y,e.y,s.z,c.z,u.z,e.z,0,0,0,1)};var M=new n,O=new n,g=new n;A.northEastDownToFixedFrame=function(e,t,r){if(_.equalsEpsilon(e.x,0,_.EPSILON14)&&_.equalsEpsilon(e.y,0,_.EPSILON14)){var a=_.sign(e.z);return o(r)?(r[0]=-a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=-a,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new p(-a,0,0,e.x,0,1,0,e.y,0,0,-a,e.z,0,0,0,1)}var u=M,s=O,c=g;return t=i(t,f.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,c),o(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=s.x,r[5]=s.y,r[6]=s.z,r[7]=0,r[8]=-u.x,r[9]=-u.y,r[10]=-u.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new p(c.x,s.x,-u.x,e.x,c.y,s.y,-u.y,e.y,c.z,s.z,-u.z,e.z,0,0,0,1)},A.northUpEastToFixedFrame=function(e,t,r){if(_.equalsEpsilon(e.x,0,_.EPSILON14)&&_.equalsEpsilon(e.y,0,_.EPSILON14)){var a=_.sign(e.z);return o(r)?(r[0]=-a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=a,r[7]=0,r[8]=0,r[9]=1,r[10]=0,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new p(-a,0,0,e.x,0,0,1,e.y,0,a,0,e.z,0,0,0,1)}var u=N,s=S,c=I;return t=i(t,f.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,c),o(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=u.x,r[5]=u.y,r[6]=u.z,r[7]=0,r[8]=s.x,r[9]=s.y,r[10]=s.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new p(c.x,u.x,s.x,e.x,c.y,u.y,s.y,e.y,c.z,u.z,s.z,e.z,0,0,0,1)},A.northWestUpToFixedFrame=function(e,t,r){if(_.equalsEpsilon(e.x,0,_.EPSILON14)&&_.equalsEpsilon(e.y,0,_.EPSILON14)){var a=_.sign(e.z);return o(r)?(r[0]=-a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=a,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new p(-a,0,0,e.x,0,-1,0,e.y,0,0,a,e.z,0,0,0,1)}var u=N,s=S,c=I;return t=i(t,f.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,c),o(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=-s.x,r[5]=-s.y,r[6]=-s.z,r[7]=0,r[8]=u.x,r[9]=u.y,r[10]=u.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new p(c.x,-s.x,u.x,e.x,c.y,-s.y,u.y,e.y,c.z,-s.z,u.z,e.z,0,0,0,1)};var v=new T,x=new n(1,1,1),w=new p;A.headingPitchRollToFixedFrame=function(e,t,r,a,i,o){var s;"object"==typeof t?(i=r,o=a,s=t.heading,r=t.pitch,a=t.roll):(u("headingPitchRollToFixedFrame","headingPitchRollToFixedFrame with separate heading, pitch, and roll arguments was deprecated in 1.27. It will be removed in 1.30. Use a HeadingPitchRoll object."),s=t);var c=T.fromHeadingPitchRoll(s,r,a,v),l=p.fromTranslationQuaternionRotationScale(n.ZERO,c,x,w);return o=A.eastNorthUpToFixedFrame(e,i,o),p.multiply(o,l,o)};var C=new d,P=new p,U=new y;A.headingPitchRollQuaternion=function(e,t,n,r,a,i){var o;"object"==typeof t?(o=t,a=n,i=r):(u("headingPitchRollQuaternion","headingPitchRollQuaternion with separate heading, pitch, and roll arguments was deprecated in 1.27. It will be removed in 1.30. Use a HeadingPitchRoll object."),C.heading=t,C.pitch=n,C.roll=r,o=C);var s=A.headingPitchRollToFixedFrame(e,o,a,P),c=p.getRotation(s,U);return T.fromRotationMatrix(c,i)};var D=24110.54841,L=8640184.812866,F=.093104,z=-62e-7,B=1.1772758384668e-19,b=72921158553e-15,q=_.TWO_PI/86400,G=new m;A.computeTemeToPseudoFixedMatrix=function(e,t){G=m.addSeconds(e,-m.computeTaiMinusUtc(e),G);var n,r=G.dayNumber,a=G.secondsOfDay,i=r-2451545;n=a>=43200?(i+.5)/R.DAYS_PER_JULIAN_CENTURY:(i-.5)/R.DAYS_PER_JULIAN_CENTURY;var u=D+n*(L+n*(F+n*z)),s=u*q%_.TWO_PI,c=b+B*(r-2451545.5),l=(a+.5*R.SECONDS_PER_DAY)%R.SECONDS_PER_DAY,f=s+c*l,d=Math.cos(f),h=Math.sin(f);return o(t)?(t[0]=d,t[1]=-h,t[2]=0,t[3]=h,t[4]=d,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new y(d,h,0,-h,d,0,0,0,1)},A.iau2006XysData=new h,A.earthOrientationParameters=c.NONE;var W=32.184,X=2451545;A.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+W,a=t.stop.dayNumber,i=t.stop.secondsOfDay+W,o=A.iau2006XysData.preload(n,r,a,i),u=A.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},A.computeIcrfToFixedMatrix=function(e,t){o(t)||(t=new y);var n=A.computeFixedToIcrfMatrix(e,t);if(o(n))return y.transpose(n,t)};var V=new E(0,0,0),H=new l(0,0,0,0,0,0),Y=new y,k=new y;A.computeFixedToIcrfMatrix=function(e,t){o(t)||(t=new y);var n=A.earthOrientationParameters.compute(e,H);if(o(n)){var r=e.dayNumber,a=e.secondsOfDay+W,i=A.iau2006XysData.computeXysRadians(r,a,V);if(o(i)){var u=i.x+n.xPoleOffset,s=i.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-u*u-s*s)),l=Y;l[0]=1-c*u*u,l[3]=-c*u*s,l[6]=u,l[1]=-c*u*s,l[4]=1-c*s*s,l[7]=s,l[2]=-u,l[5]=-s,l[8]=1-c*(u*u+s*s);var f=y.fromRotationZ(-i.s,k),d=y.multiply(l,f,Y),h=e.dayNumber,E=e.secondsOfDay-m.computeTaiMinusUtc(e)+n.ut1MinusUtc,p=h-2451545,T=E/R.SECONDS_PER_DAY,N=.779057273264+T+.00273781191135448*(p+T);N=N%1*_.TWO_PI;var S=y.fromRotationZ(N,k),I=y.multiply(d,S,Y),M=Math.cos(n.xPoleWander),O=Math.cos(n.yPoleWander),g=Math.sin(n.xPoleWander),v=Math.sin(n.yPoleWander),x=r-X+a/R.SECONDS_PER_DAY;x/=36525;var w=-47e-6*x*_.RADIANS_PER_DEGREE/3600,C=Math.cos(w),P=Math.sin(w),U=k;return U[0]=M*C,U[1]=M*P,U[2]=g,U[3]=-O*P+v*g*C,U[4]=O*C+v*g*P,U[5]=-v*M,U[6]=-v*P-O*g*C,U[7]=v*C-O*g*P,U[8]=O*M,y.multiply(I,U,t)}}};var j=new r;A.pointToWindowCoordinates=function(e,t,n,r){return r=A.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},A.pointToGLWindowCoordinates=function(e,n,a,i){o(i)||(i=new t);var u=j;return p.multiplyByVector(e,r.fromElements(a.x,a.y,a.z,1,u),u),r.multiplyByScalar(u,1/u.w,u),p.multiplyByVector(n,u,u),t.fromCartesian4(u,i)};var Z=new n,K=new n,J=new n;A.rotationMatrixFromPositionVelocity=function(e,t,r,a){var u=i(r,f.WGS84).geodeticSurfaceNormal(e,Z),s=n.cross(t,u,K);n.equalsEpsilon(s,n.ZERO,_.EPSILON6)&&(s=n.clone(n.UNIT_X,s));var c=n.cross(s,t,J);return n.cross(t,c,s),n.negate(s,s),o(a)||(a=new y),a[0]=t.x,a[1]=t.y,a[2]=t.z,a[3]=s.x,a[4]=s.y,a[5]=s.z,a[6]=c.x,a[7]=c.y,a[8]=c.z,a};var Q=new a,$=new n,ee=new n,te=new r,ne=new r,re=new r,ae=new r,ie=new r,oe=new p,ue=new p;return A.basisTo2D=function(e,t,a){var i=e.ellipsoid,o=p.getColumn(t,3,te),u=i.cartesianToCartographic(o,Q),s=A.eastNorthUpToFixedFrame(o,i,oe),c=p.inverseTransformation(s,ue),l=e.project(u,$),f=ne;f.x=l.z,f.y=l.x,f.z=l.y,f.w=1;var d=p.getColumn(t,0,ee),h=n.magnitude(d),E=p.multiplyByVector(c,d,re);r.fromElements(E.z,E.x,E.y,0,E);var m=p.getColumn(t,1,ee),_=n.magnitude(m),y=p.multiplyByVector(c,m,ae);r.fromElements(y.z,y.x,y.y,0,y);var T=p.getColumn(t,2,ee),R=n.magnitude(T),N=ie;return n.cross(E,y,N),n.normalize(N,N),n.cross(y,N,E),n.normalize(E,E),n.cross(N,E,y),n.normalize(y,y),n.multiplyByScalar(E,h,E),n.multiplyByScalar(y,_,y),n.multiplyByScalar(N,R,N),p.setColumn(a,0,E,a),p.setColumn(a,1,y,a),p.setColumn(a,2,N,a),p.setColumn(a,3,f,a),a},A}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,f,d,h){"use strict";function E(e,t){t=a(t,s.WGS84),e=t.scaleToGeodeticSurface(e);var r=h.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=n.fromCartesian4(l.getColumn(r,0,m)),this._yAxis=n.fromCartesian4(l.getColumn(r,1,m));var i=n.fromCartesian4(l.getColumn(r,2,m));this._plane=f.fromPointNormal(e,i)}var m=new r;o(E.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var _=new e;E.fromPoints=function(t,n){var r=e.fromPoints(t,_);return new E(r.center,n)};var y=new d,p=new n;E.prototype.projectPointOntoPlane=function(e,r){var a=y;a.origin=e,n.normalize(e,a.direction);var o=c.rayPlane(a,this._plane,p);if(i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,p)),i(o)){var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return i(r)?(r.x=s,r.y=l,r):new t(s,l)}},E.prototype.projectPointsOntoPlane=function(e,t){i(t)||(t=[]);for(var n=0,r=e.length,a=0;a<r;a++){var o=this.projectPointOntoPlane(e[a],t[n]);i(o)&&(t[n]=o,n++)}return t.length=n,t},E.prototype.projectPointToNearestOnPlane=function(e,r){i(r)||(r=new t);var a=y;a.origin=e,n.clone(this._plane.normal,a.direction);var o=c.rayPlane(a,this._plane,p);i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,p));var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return r.x=s,r.y=l,r},E.prototype.projectPointsToNearestOnPlane=function(e,t){i(t)||(t=[]);var n=e.length;t.length=n;for(var r=0;r<n;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var T=new n;return E.prototype.projectPointsOntoEllipsoid=function(e,t){var r=e.length;i(t)?t.length=r:t=new Array(r);for(var a=this._ellipsoid,o=this._origin,u=this._xAxis,s=this._yAxis,c=T,l=0;l<r;++l){var f=e[l];n.multiplyByScalar(u,f.x,c),i(t[l])||(t[l]=new n);var d=n.add(o,c,t[l]);n.multiplyByScalar(s,f.y,c),n.add(d,c,d),a.scaleToGeocentricSurface(d,d)}return t},E}),define("Core/OrientedBoundingBox",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Intersect","./Interval","./Math","./Matrix3","./Plane","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,f,d,h,E){"use strict";function m(e,t){this.center=n.clone(a(e,n.ZERO)),this.halfAxes=d.clone(a(t,d.ZERO))}function _(e,t,r,a,o,u,s,c){i(c)||(c=new m);var l=c.halfAxes;d.setColumn(l,0,e.xAxis,l),d.setColumn(l,1,e.yAxis,l),d.setColumn(l,2,e.zAxis,l);var f=M;f.x=(t+r)/2,f.y=(a+o)/2,f.z=(u+s)/2;var h=O;h.x=(r-t)/2,h.y=(o-a)/2,h.z=(s-u)/2;var E=c.center;return f=d.multiplyByVector(l,f,f),n.add(e.origin,f,E),d.multiplyByScale(l,h,l),c}var y=new n,p=new n,T=new n,R=new n,A=new n,N=new n,S=new d,I={unitary:new d,diagonal:new d};m.fromPoints=function(e,t){if(i(t)||(t=new m),!i(e)||0===e.length)return t.halfAxes=d.ZERO,t.center=n.ZERO,t;var r,a=e.length,o=n.clone(e[0],y);for(r=1;r<a;r++)n.add(o,e[r],o);var u=1/a;n.multiplyByScalar(o,u,o);var s,c=0,l=0,f=0,h=0,E=0,_=0;for(r=0;r<a;r++)s=n.subtract(e[r],o,p),c+=s.x*s.x,l+=s.x*s.y,f+=s.x*s.z,h+=s.y*s.y,E+=s.y*s.z,_+=s.z*s.z;c*=u,l*=u,f*=u,h*=u,E*=u,_*=u;var M=S;M[0]=c,M[1]=l,M[2]=f,M[3]=l,M[4]=h,M[5]=E,M[6]=f,M[7]=E,M[8]=_;var O=d.computeEigenDecomposition(M,I),g=d.clone(O.unitary,t.halfAxes),v=d.getColumn(g,0,R),x=d.getColumn(g,1,A),w=d.getColumn(g,2,N),C=-Number.MAX_VALUE,P=-Number.MAX_VALUE,U=-Number.MAX_VALUE,D=Number.MAX_VALUE,L=Number.MAX_VALUE,F=Number.MAX_VALUE;for(r=0;r<a;r++)s=e[r],C=Math.max(n.dot(v,s),C),P=Math.max(n.dot(x,s),P),U=Math.max(n.dot(w,s),U),D=Math.min(n.dot(v,s),D),L=Math.min(n.dot(x,s),L),F=Math.min(n.dot(w,s),F);v=n.multiplyByScalar(v,.5*(D+C),v),x=n.multiplyByScalar(x,.5*(L+P),x),w=n.multiplyByScalar(w,.5*(F+U),w);var z=n.add(v,x,t.center);z=n.add(z,w,z);var B=T;return B.x=C-D,B.y=P-L,B.z=U-F,n.multiplyByScalar(B,.5,B),d.multiplyByScale(t.halfAxes,B,t.halfAxes),t};var M=new n,O=new n,g=new r,v=new n,x=[new r,new r,new r,new r,new r,new r,new r,new r],w=[new n,new n,new n,new n,new n,new n,new n,new n],C=[new t,new t,new t,new t,new t,new t,new t,new t];m.fromRectangle=function(e,t,n,r,i){t=a(t,0),n=a(n,0),r=a(r,u.WGS84);var o=E.center(e,g),c=r.cartographicToCartesian(o,v),l=new s(c,r),f=l.plane,d=x[0],m=x[1],y=x[2],p=x[3],T=x[4],R=x[5],A=x[6],N=x[7],S=o.longitude,I=e.south<0&&e.north>0?0:o.latitude;A.latitude=R.latitude=T.latitude=e.south,N.latitude=p.latitude=I,d.latitude=m.latitude=y.latitude=e.north,A.longitude=N.longitude=d.longitude=e.west,R.longitude=m.longitude=S,T.longitude=p.longitude=y.longitude=e.east,y.height=m.height=d.height=N.height=A.height=R.height=T.height=p.height=n,r.cartographicArrayToCartesianArray(x,w),l.projectPointsToNearestOnPlane(w,C);var M=Math.min(C[6].x,C[7].x,C[0].x),O=Math.max(C[2].x,C[3].x,C[4].x),P=Math.min(C[4].y,C[5].y,C[6].y),U=Math.max(C[0].y,C[1].y,C[2].y);y.height=d.height=T.height=A.height=t,r.cartographicArrayToCartesianArray(x,w);var D=Math.min(h.getPointDistance(f,w[0]),h.getPointDistance(f,w[2]),h.getPointDistance(f,w[4]),h.getPointDistance(f,w[6])),L=n;return _(l,M,O,P,U,D,L,i)},m.clone=function(e,t){if(i(e))return i(t)?(n.clone(e.center,t.center),d.clone(e.halfAxes,t.halfAxes),t):new m(e.center,e.halfAxes)},m.intersectPlane=function(e,t){var r=e.center,a=t.normal,i=e.halfAxes,o=a.x,u=a.y,s=a.z,l=Math.abs(o*i[d.COLUMN0ROW0]+u*i[d.COLUMN0ROW1]+s*i[d.COLUMN0ROW2])+Math.abs(o*i[d.COLUMN1ROW0]+u*i[d.COLUMN1ROW1]+s*i[d.COLUMN1ROW2])+Math.abs(o*i[d.COLUMN2ROW0]+u*i[d.COLUMN2ROW1]+s*i[d.COLUMN2ROW2]),f=n.dot(a,r)+t.distance;return f<=-l?c.OUTSIDE:f>=l?c.INSIDE:c.INTERSECTING};var P=new n,U=new n,D=new n,L=new n;m.distanceSquaredTo=function(e,t){var r=n.subtract(t,e.center,M),a=e.halfAxes,i=d.getColumn(a,0,P),o=d.getColumn(a,1,U),u=d.getColumn(a,2,D),s=n.magnitude(i),c=n.magnitude(o),l=n.magnitude(u);n.normalize(i,i),n.normalize(o,o),n.normalize(u,u);var f=L;f.x=n.dot(r,i),f.y=n.dot(r,o),f.z=n.dot(r,u);var h,E=0;return f.x<-s?(h=f.x+s,E+=h*h):f.x>s&&(h=f.x-s,E+=h*h),f.y<-c?(h=f.y+c,E+=h*h):f.y>c&&(h=f.y-c,E+=h*h),f.z<-l?(h=f.z+l,E+=h*h):f.z>l&&(h=f.z-l,E+=h*h),E};var F=new n,z=new n;m.computePlaneDistances=function(e,t,r,a){i(a)||(a=new l);var o=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,s=e.center,c=e.halfAxes,f=d.getColumn(c,0,P),h=d.getColumn(c,1,U),E=d.getColumn(c,2,D),m=n.add(f,h,F);n.add(m,E,m),n.add(m,s,m);var _=n.subtract(m,t,z),y=n.dot(r,_);return o=Math.min(y,o),u=Math.max(y,u),n.add(s,f,m),n.add(m,h,m),n.subtract(m,E,m),n.subtract(m,t,_),y=n.dot(r,_),o=Math.min(y,o),u=Math.max(y,u),n.add(s,f,m),n.subtract(m,h,m),n.add(m,E,m),n.subtract(m,t,_),y=n.dot(r,_),o=Math.min(y,o),u=Math.max(y,u),n.add(s,f,m),n.subtract(m,h,m),n.subtract(m,E,m),n.subtract(m,t,_),y=n.dot(r,_),o=Math.min(y,o),u=Math.max(y,u),n.subtract(s,f,m),n.add(m,h,m),n.add(m,E,m),n.subtract(m,t,_),y=n.dot(r,_),o=Math.min(y,o),u=Math.max(y,u),n.subtract(s,f,m),n.add(m,h,m),n.subtract(m,E,m),n.subtract(m,t,_),y=n.dot(r,_),o=Math.min(y,o),u=Math.max(y,u),n.subtract(s,f,m),n.subtract(m,h,m),n.add(m,E,m),n.subtract(m,t,_),y=n.dot(r,_),o=Math.min(y,o),u=Math.max(y,u),n.subtract(s,f,m),n.subtract(m,h,m),n.subtract(m,E,m),n.subtract(m,t,_),y=n.dot(r,_),o=Math.min(y,o),u=Math.max(y,u),a.start=o,a.stop=u,a};var B=new e;return m.isOccluded=function(t,n){var r=e.fromOrientedBoundingBox(t,B);return!n.isBoundingSphereVisible(r)},m.prototype.intersectPlane=function(e){return m.intersectPlane(this,e)},m.prototype.distanceSquaredTo=function(e){return m.distanceSquaredTo(this,e)},m.prototype.computePlaneDistances=function(e,t,n){return m.computePlaneDistances(this,e,t,n)},m.prototype.isOccluded=function(e){return m.isOccluded(this,e)},m.equals=function(e,t){return e===t||i(e)&&i(t)&&n.equals(e.center,t.center)&&d.equals(e.halfAxes,t.halfAxes)},m.prototype.clone=function(e){return m.clone(this,e)},m.prototype.equals=function(e){return m.equals(this,e)},m}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,a,i){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){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.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},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 Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,a){switch(r=e(r,0),a=e(a,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,a);case o.SHORT:return new Int16Array(n,r,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,a);case o.INT:return new Int32Array(n,r,a);case o.UNSIGNED_INT:return new Uint32Array(n,r,a);case o.FLOAT:return new Float32Array(n,r,a);case o.DOUBLE:return new Float64Array(n,r,a)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/TerrainQuantization",["./freezeObject"],function(e){"use strict";var t={NONE:0,BITS12:1};return e(t)}),define("Core/TerrainEncoding",["./AttributeCompression","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./Math","./Matrix4","./TerrainQuantization"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(e,t,r,o,c,d){var _,y,p,T;if(i(e)&&i(t)&&i(r)&&i(o)){var R=e.minimum,A=e.maximum,N=n.subtract(A,R,f),S=r-t,I=Math.max(n.maximumComponent(N),S);_=I<m-1?s.BITS12:s.NONE,y=e.center,p=u.inverseTransformation(o,new u);var M=n.negate(R,l);u.multiply(u.fromTranslation(M,h),p,p);var O=l;O.x=1/N.x,O.y=1/N.y,O.z=1/N.z,u.multiply(u.fromScale(O,h),p,p),T=u.clone(o),u.setTranslation(T,n.ZERO,T),o=u.clone(o,new u);var g=u.fromTranslation(R,h),v=u.fromScale(N,E),x=u.multiply(g,v,h);u.multiply(o,x,o),u.multiply(T,x,T)}this.quantization=_,this.minimumHeight=t,this.maximumHeight=r,this.center=y,this.toScaledENU=p,this.fromScaledENU=o,this.matrix=T,this.hasVertexNormals=c,this.hasWebMercatorT=a(d,!1)}var l=new n,f=new n,d=new t,h=new u,E=new u,m=Math.pow(2,12);c.prototype.encode=function(r,a,i,c,f,h,E){var m=c.x,_=c.y;if(this.quantization===s.BITS12){i=u.multiplyByPoint(this.toScaledENU,i,l),i.x=o.clamp(i.x,0,1),i.y=o.clamp(i.y,0,1),i.z=o.clamp(i.z,0,1);var y=this.maximumHeight-this.minimumHeight,p=o.clamp((f-this.minimumHeight)/y,0,1);t.fromElements(i.x,i.y,d);var T=e.compressTextureCoordinates(d);t.fromElements(i.z,p,d);var R=e.compressTextureCoordinates(d);t.fromElements(m,_,d);var A=e.compressTextureCoordinates(d);if(r[a++]=T,r[a++]=R,r[a++]=A,this.hasWebMercatorT){t.fromElements(E,0,d);var N=e.compressTextureCoordinates(d);r[a++]=N}}else n.subtract(i,this.center,l),r[a++]=l.x,r[a++]=l.y,r[a++]=l.z,r[a++]=f,r[a++]=m,r[a++]=_,this.hasWebMercatorT&&(r[a++]=E);return this.hasVertexNormals&&(r[a++]=e.octPackFloat(h)),a},c.prototype.decodePosition=function(t,r,a){if(i(a)||(a=new n),r*=this.getStride(),this.quantization===s.BITS12){var o=e.decompressTextureCoordinates(t[r],d);a.x=o.x,a.y=o.y;var c=e.decompressTextureCoordinates(t[r+1],d);return a.z=c.x,u.multiplyByPoint(this.fromScaledENU,a,a)}return a.x=t[r],a.y=t[r+1],a.z=t[r+2],n.add(a,this.center,a)},c.prototype.decodeTextureCoordinates=function(n,r,a){return i(a)||(a=new t),r*=this.getStride(),this.quantization===s.BITS12?e.decompressTextureCoordinates(n[r+2],a):t.fromElements(n[r+4],n[r+5],a)},c.prototype.decodeHeight=function(t,n){if(n*=this.getStride(),this.quantization===s.BITS12){var r=e.decompressTextureCoordinates(t[n+1],d);return r.y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight}return t[n+3]},c.prototype.getOctEncodedNormal=function(e,n,r){var a=this.getStride();n=(n+1)*a-1;var i=e[n]/256,o=Math.floor(i),u=256*(i-o);return t.fromElements(o,u,r)},c.prototype.getStride=function(){var e;switch(this.quantization){case s.BITS12:e=3;break;default:e=6}return this.hasWebMercatorT&&++e,this.hasVertexNormals&&++e,e};var _={position3DAndHeight:0,textureCoordAndEncodedNormals:1},y={compressed0:0,compressed1:1};return c.prototype.getAttributes=function(e){var t,n=r.FLOAT,a=r.getSizeInBytes(n);if(this.quantization===s.NONE){var i=4,o=2;return this.hasWebMercatorT&&++o,this.hasVertexNormals&&++o,t=(i+o)*a,[{index:_.position3DAndHeight,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:i,offsetInBytes:0,strideInBytes:t},{index:_.textureCoordAndEncodedNormals,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:o,offsetInBytes:i*a,strideInBytes:t}]}var u=3,c=0;return(this.hasWebMercatorT||this.hasVertexNormals)&&++u,this.hasWebMercatorT&&this.hasVertexNormals?(++c,t=(u+c)*a,[{index:y.compressed0,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:u,offsetInBytes:0,strideInBytes:t},{index:y.compressed1,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:c,offsetInBytes:u*a,strideInBytes:t}]):[{index:y.compressed0,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:u}]},c.prototype.getAttributeLocations=function(){return this.quantization===s.NONE?_:y},c.clone=function(e,t){return i(t)||(t=new c),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=n.clone(e.center),t.toScaledENU=u.clone(e.toScaledENU),t.fromScaledENU=u.clone(e.fromScaledENU),t.matrix=u.clone(e.matrix),t.hasVertexNormals=e.hasVertexNormals,t.hasWebMercatorT=e.hasWebMercatorT,t},c}),define("Core/WebMercatorProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(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,n){var a=this._semimajorAxis,i=t.longitude*a,o=s.geodeticLatitudeToMercatorAngle(t.latitude)*a,u=t.height;return r(n)?(n.x=i,n.y=o,n.z=u,n):new e(i,o,u)},s.prototype.unproject=function(e,n){var a=this._oneOverSemimajorAxis,i=e.x*a,o=s.mercatorAngleToGeodeticLatitude(e.y*a),u=e.z;return r(n)?(n.longitude=i,n.latitude=o,n.height=u,n):new t(i,o,u)},s}),define("Core/formatError",["./defined"],function(e){"use strict";function t(t){var n,r=t.name,a=t.message;n=e(r)&&e(a)?r+": "+a:t.toString();var i=t.stack;return e(i)&&(n+="\n"+i),n}return t}),define("Workers/createTaskProcessorWorker",["../Core/defaultValue","../Core/defined","../Core/formatError"],function(e,t,n){"use strict";function r(r){var a,i=[],o={id:void 0,result:void 0,error:void 0};return function(u){var s=u.data;i.length=0,o.id=s.id,o.error=void 0,o.result=void 0;try{o.result=r(s.parameters,i)}catch(e){e instanceof Error?o.error={name:e.name,message:e.message,stack:e.stack}:o.error=e}t(a)||(a=e(self.webkitPostMessage,self.postMessage)),s.canTransferArrayBuffer||(i.length=0);try{a(o,i)}catch(e){o.result=void 0,o.error="postMessage failed with error: "+n(e)+"\n with responseMessage: "+JSON.stringify(o),a(o)}}}return r}),define("Workers/createVerticesFromQuantizedTerrainMesh",["../Core/AttributeCompression","../Core/AxisAlignedBoundingBox","../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/defined","../Core/Ellipsoid","../Core/IndexDatatype","../Core/Math","../Core/Matrix4","../Core/OrientedBoundingBox","../Core/TerrainEncoding","../Core/Transforms","../Core/WebMercatorProjection","./createTaskProcessorWorker"],function(e,t,n,r,a,i,o,u,s,c,l,f,d,h,E,m){ -"use strict";function _(i,m){var _,v,x=i.quantizedVertices,w=x.length/3,C=i.octEncodedNormals,P=i.westIndices.length+i.eastIndices.length+i.southIndices.length+i.northIndices.length,U=i.includeWebMercatorT,D=i.rectangle,L=D.west,F=D.south,z=D.east,B=D.north,b=u.clone(i.ellipsoid),q=i.exaggeration,G=i.minimumHeight*q,W=i.maximumHeight*q,X=i.relativeToCenter,V=h.eastNorthUpToFixedFrame(X,b),H=l.inverseTransformation(V,new l);U&&(_=E.geodeticLatitudeToMercatorAngle(F),v=1/(E.geodeticLatitudeToMercatorAngle(B)-_));var Y=x.subarray(0,w),k=x.subarray(w,2*w),j=x.subarray(2*w,3*w),Z=o(C),K=new Array(w),J=new Array(w),Q=new Array(w),$=U?new Array(w):[],ee=A;ee.x=Number.POSITIVE_INFINITY,ee.y=Number.POSITIVE_INFINITY,ee.z=Number.POSITIVE_INFINITY;var te=N;te.x=Number.NEGATIVE_INFINITY,te.y=Number.NEGATIVE_INFINITY,te.z=Number.NEGATIVE_INFINITY;for(var ne=0;ne<w;++ne){var re=Y[ne]/T,ae=k[ne]/T,ie=c.lerp(G,W,j[ne]/T);S.longitude=c.lerp(L,z,re),S.latitude=c.lerp(F,B,ae),S.height=ie;var oe=b.cartographicToCartesian(S);K[ne]=new r(re,ae),J[ne]=ie,Q[ne]=oe,U&&($[ne]=(E.geodeticLatitudeToMercatorAngle(S.latitude)-_)*v),l.multiplyByPoint(H,oe,R),a.minimumByComponent(R,ee,ee),a.maximumByComponent(R,te,te)}var ue,se;1!==q&&(se=n.fromPoints(Q),ue=f.fromRectangle(D,G,W,b));var ce=G;ce=Math.min(ce,y(i.westIndices,i.westSkirtHeight,J,K,D,b,H,ee,te)),ce=Math.min(ce,y(i.southIndices,i.southSkirtHeight,J,K,D,b,H,ee,te)),ce=Math.min(ce,y(i.eastIndices,i.eastSkirtHeight,J,K,D,b,H,ee,te)),ce=Math.min(ce,y(i.northIndices,i.northSkirtHeight,J,K,D,b,H,ee,te));for(var le=new t(ee,te,X),fe=new d(le,ce,W,V,Z,U),de=fe.getStride(),he=w*de+P*de,Ee=new Float32Array(he),me=0,_e=0;_e<w;++_e){if(Z){var ye=2*_e;if(I.x=C[ye],I.y=C[ye+1],1!==q){var pe=e.octDecode(I.x,I.y,M),Te=h.eastNorthUpToFixedFrame(Q[_e],b,g),Re=l.inverseTransformation(Te,O);l.multiplyByPointAsVector(Re,pe,pe),pe.z*=q,a.normalize(pe,pe),l.multiplyByPointAsVector(Te,pe,pe),a.normalize(pe,pe),e.octEncode(pe,I)}}me=fe.encode(Ee,me,Q[_e],K[_e],J[_e],I,$[_e])}var Ae=Math.max(0,2*(P-4)),Ne=i.indices.length+3*Ae,Se=s.createTypedArray(w+P,Ne);Se.set(i.indices,0);var Ie=w*de,Me=i.indices.length;return Me=p(Ee,Ie,Se,Me,i.westIndices,fe,J,K,C,b,D,i.westSkirtHeight,!0,q,_,v),Ie+=i.westIndices.length*de,Me=p(Ee,Ie,Se,Me,i.southIndices,fe,J,K,C,b,D,i.southSkirtHeight,!1,q,_,v),Ie+=i.southIndices.length*de,Me=p(Ee,Ie,Se,Me,i.eastIndices,fe,J,K,C,b,D,i.eastSkirtHeight,!1,q,_,v),Ie+=i.eastIndices.length*de,p(Ee,Ie,Se,Me,i.northIndices,fe,J,K,C,b,D,i.northSkirtHeight,!0,q,_,v),m.push(Ee.buffer,Se.buffer),{vertices:Ee.buffer,indices:Se.buffer,vertexStride:de,center:X,minimumHeight:G,maximumHeight:W,boundingSphere:se,orientedBoundingBox:ue,encoding:fe,skirtIndex:i.indices.length}}function y(e,t,n,r,i,o,u,s,f){var d=Number.POSITIVE_INFINITY,h=i.north,E=i.south,m=i.east,_=i.west;m<_&&(m+=c.TWO_PI);for(var y=e.length,p=0;p<y;++p){var T=e[p],A=n[T],N=r[T];S.longitude=c.lerp(_,m,N.x),S.latitude=c.lerp(E,h,N.y),S.height=A-t;var I=o.cartographicToCartesian(S,R);l.multiplyByPoint(u,I,I),a.minimumByComponent(I,s,s),a.maximumByComponent(I,f,f),d=Math.min(d,S.height)}return d}function p(t,n,r,i,u,s,f,d,m,_,y,p,T,A,N,v){var x,w,C;T?(x=u.length-1,w=-1,C=-1):(x=0,w=u.length,C=1);var P=-1,U=o(m),D=s.getStride(),L=n/D,F=y.north,z=y.south,B=y.east,b=y.west;B<b&&(B+=c.TWO_PI);for(var q=x;q!==w;q+=C){var G=u[q],W=f[G],X=d[G];S.longitude=c.lerp(b,B,X.x),S.latitude=c.lerp(z,F,X.y),S.height=W-p;var V=_.cartographicToCartesian(S,R);if(U){var H=2*G;if(I.x=m[H],I.y=m[H+1],1!==A){var Y=e.octDecode(I.x,I.y,M),k=h.eastNorthUpToFixedFrame(R,_,g),j=l.inverseTransformation(k,O);l.multiplyByPointAsVector(j,Y,Y),Y.z*=A,a.normalize(Y,Y),l.multiplyByPointAsVector(k,Y,Y),a.normalize(Y,Y),e.octEncode(Y,I)}}var Z;s.hasWebMercatorT&&(Z=(E.geodeticLatitudeToMercatorAngle(S.latitude)-N)*v),n=s.encode(t,n,V,X,S.height,I,Z),P!==-1&&(r[i++]=P,r[i++]=L-1,r[i++]=G,r[i++]=L-1,r[i++]=L,r[i++]=G),P=G,++L}return i}var T=32767,R=new a,A=new a,N=new a,S=new i,I=new r,M=new a,O=new l,g=new l;return m(_)})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e){return e+" is required, actual value was undefined"}function r(e,t,n){return"Expected "+n+" to be typeof "+t+", actual typeof was "+e}var a={};return a.typeOf={},a.defined=function(r,a){if(!e(a))throw new t(n(r))},a.typeOf.func=function(e,n){if("function"!=typeof n)throw new t(r(typeof n,"function",e))},a.typeOf.string=function(e,n){if("string"!=typeof n)throw new t(r(typeof n,"string",e))},a.typeOf.number=function(e,n){if("number"!=typeof n)throw new t(r(typeof n,"number",e))},a.typeOf.number.lessThan=function(e,n,r){if(a.typeOf.number(e,n),n>=r)throw new t("Expected "+e+" to be less than "+r+", actual value was "+n)},a.typeOf.number.lessThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n>r)throw new t("Expected "+e+" to be less than or equal to "+r+", actual value was "+n)},a.typeOf.number.greaterThan=function(e,n,r){if(a.typeOf.number(e,n),n<=r)throw new t("Expected "+e+" to be greater than "+r+", actual value was "+n)},a.typeOf.number.greaterThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n<r)throw new t("Expected "+e+" to be greater than or equal to"+r+", actual value was "+n)},a.typeOf.object=function(e,n){if("object"!=typeof n)throw new t(r(typeof n,"object",e))},a.typeOf.bool=function(e,n){if("boolean"!=typeof n)throw new t(r(typeof n,"boolean",e))},a}),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";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),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 n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(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^=e<<7&2636928640,e^=e<<15&4022730752,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,n,r){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:e<0?-1:0},a.signNotZero=function(e){return e<0?-1:1},a.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*a.clamp(e,-1,1)+.5)*n)},a.fromSNorm=function(e,n){return n=t(n,255),a.clamp(e,0,n)/n*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},a.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},a.lerp=function(e,t,n){return(1-n)*e+n*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){var t=a.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},a.clampToLatitudeRange=function(e){return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){return(e%t+t)%t},a.equalsEpsilon=function(e,n,r,a){a=t(a,r);var i=Math.abs(e-n);return i<=a||i<=r*Math.max(Math.abs(e),Math.abs(n))};var i=[1];a.factorial=function(e){var t=i.length;if(e>=t)for(var n=i[t-1],r=t;r<=e;r++)i.push(n*r);return i[e]},a.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},a.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return a.setRandomNumberSeed=function(t){o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(e){return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){return Math.log(e)/Math.log(t)},a.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},a}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n){this.x=t(e,0),this.y=t(n,0)}o.fromElements=function(e,t,r){return n(r)?(r.x=e,r.y=t,r):new o(e,t)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t):new o(e.x,e.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r]=e.y,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=2*r:t=new Array(2*r);for(var a=0;a<r;++a)o.pack(e[a],t,2*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/2:t=new Array(r/2);for(var a=0;a<r;a+=2){var i=a/2;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y)},o.minimumComponent=function(e){return Math.min(e.x,e.y)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){return o.normalize(e,c),o.normalize(t,l),i.acosClamped(o.dot(c,l))};var f=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)},o.ZERO=a(new o(0,0)),o.UNIT_X=a(new o(1,0)),o.UNIT_Y=a(new o(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,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var a=e.clock,i=e.cone,u=t(e.magnitude,1),s=u*Math.sin(i);return r.x=s*Math.cos(a),r.y=s*Math.sin(a),r.z=u*Math.cos(i),r},o.fromElements=function(e,t,r,a){return n(a)?(a.x=e,a.y=t,a.z=r,a):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var a=0;a<r;++a)o.pack(e[a],t,3*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var a=0;a<r;a+=3){var i=a/3;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,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};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var n=o.dot(c,l),r=o.magnitude(o.cross(c,l,c));return Math.atan2(r,n)};var f=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)},o.cross=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=t.x,u=t.y,s=t.z,c=a*s-i*u,l=i*o-r*s,f=r*u-a*o;return n.x=c,n.y=l,n.z=f,n},o.fromDegrees=function(e,t,n,r,a){return e=i.toRadians(e),t=i.toRadians(t),o.fromRadians(e,t,n,r,a)};var d=new o,h=new o,E=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,a,i,u){a=t(a,0);var s=n(i)?i.radiiSquared:E,c=Math.cos(r);d.x=c*Math.cos(e),d.y=c*Math.sin(e),d.z=Math.sin(r),d=o.normalize(d,d),o.multiplyComponents(s,d,h);var l=Math.sqrt(o.dot(d,h));return h=o.divideByScalar(h,l,h),d=o.multiplyByScalar(d,a,d),n(u)||(u=new o),o.add(h,d,u)},o.fromDegreesArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromDegrees(u,s,0,t,r[c])}return r},o.fromRadiansArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromRadians(u,s,0,t,r[c])}return r},o.fromDegreesArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromDegrees(u,s,c,t,r[l])}return r},o.fromRadiansArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromRadians(u,s,c,t,r[l])}return r},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(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,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r,a){"use strict";var i={};i.octEncodeInRange=function(e,t,n){if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var r=n.x,i=n.y;n.x=(1-Math.abs(i))*a.signNotZero(r),n.y=(1-Math.abs(r))*a.signNotZero(i)}return n.x=a.toSNorm(n.x,t),n.y=a.toSNorm(n.y,t),n},i.octEncode=function(e,t){return i.octEncodeInRange(e,255,t)},i.octDecodeInRange=function(e,n,r,i){if(i.x=a.fromSNorm(e,r),i.y=a.fromSNorm(n,r),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){var o=i.x;i.x=(1-Math.abs(i.y))*a.signNotZero(o),i.y=(1-Math.abs(o))*a.signNotZero(i.y)}return t.normalize(i,i)},i.octDecode=function(e,t,n){return i.octDecodeInRange(e,t,255,n)},i.octPackFloat=function(e){return 256*e.x+e.y};var o=new e;return i.octEncodeFloat=function(e){return i.octEncode(e,o),i.octPackFloat(o)},i.octDecodeFloat=function(e,t){var n=e/256,r=Math.floor(n),a=256*(n-r);return i.octDecode(r,a,t)},i.octPack=function(e,t,n,r){var a=i.octEncodeFloat(e),u=i.octEncodeFloat(t),s=i.octEncode(n,o);return r.x=65536*s.x+a,r.y=65536*s.y+u,r},i.octUnpack=function(e,t,n,r){var a=e.x/65536,o=Math.floor(a),u=65536*(a-o);a=e.y/65536;var s=Math.floor(a),c=65536*(a-s);i.octDecodeFloat(u,t),i.octDecodeFloat(c,n),i.octDecode(o,s,r)},i.compressTextureCoordinates=function(e){var t=4095*e.x|0,n=4095*e.y|0;return 4096*t+n},i.decompressTextureCoordinates=function(e,t){var n=e/4096,r=Math.floor(n);return t.x=r/4095,t.y=(e-4096*r)/4095,t},i}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Intersect"],function(e,t,n,r,a){"use strict";function i(r,a,i){this.minimum=e.clone(t(r,e.ZERO)),this.maximum=e.clone(t(a,e.ZERO)),n(i)?i=e.clone(i):(i=e.add(this.minimum,this.maximum,new e),e.multiplyByScalar(i,.5,i)),this.center=i}i.fromPoints=function(t,r){if(n(r)||(r=new i),!n(t)||0===t.length)return r.minimum=e.clone(e.ZERO,r.minimum),r.maximum=e.clone(e.ZERO,r.maximum),r.center=e.clone(e.ZERO,r.center),r;for(var a=t[0].x,o=t[0].y,u=t[0].z,s=t[0].x,c=t[0].y,l=t[0].z,f=t.length,d=1;d<f;d++){var h=t[d],E=h.x,m=h.y,_=h.z;a=Math.min(E,a),s=Math.max(E,s),o=Math.min(m,o),c=Math.max(m,c),u=Math.min(_,u),l=Math.max(_,l)}var y=r.minimum;y.x=a,y.y=o,y.z=u;var p=r.maximum;p.x=s,p.y=c,p.z=l;var T=e.add(y,p,r.center);return e.multiplyByScalar(T,.5,T),r},i.clone=function(t,r){if(n(t))return n(r)?(r.minimum=e.clone(t.minimum,r.minimum),r.maximum=e.clone(t.maximum,r.maximum),r.center=e.clone(t.center,r.center),r):new i(t.minimum,t.maximum)},i.equals=function(t,r){return t===r||n(t)&&n(r)&&e.equals(t.center,r.center)&&e.equals(t.minimum,r.minimum)&&e.equals(t.maximum,r.maximum)};var o=new e;return i.intersectPlane=function(t,n){o=e.subtract(t.maximum,t.minimum,o);var r=e.multiplyByScalar(o,.5,o),i=n.normal,u=r.x*Math.abs(i.x)+r.y*Math.abs(i.y)+r.z*Math.abs(i.z),s=e.dot(t.center,i)+n.distance;return s-u>0?a.INSIDE:s+u<0?a.OUTSIDE:a.INTERSECTING},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.intersectPlane=function(e){return i.intersectPlane(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(n,a,u,s,c){var l=n.x,f=n.y,d=n.z,h=a.x,E=a.y,m=a.z,_=l*l*h*h,y=f*f*E*E,p=d*d*m*m,T=_+y+p,R=Math.sqrt(1/T),A=e.multiplyByScalar(n,R,i);if(T<s)return isFinite(R)?e.clone(A,c):void 0;var N=u.x,S=u.y,M=u.z,I=o;I.x=A.x*N*2,I.y=A.y*S*2,I.z=A.z*M*2;var O,v,g,x,w,C,P,U,D,L,F,z=(1-R)*e.magnitude(n)/(.5*e.magnitude(I)),B=0;do{z-=B,g=1/(1+z*N),x=1/(1+z*S),w=1/(1+z*M),C=g*g,P=x*x,U=w*w,D=C*g,L=P*x,F=U*w,O=_*C+y*P+p*U-1,v=_*D*N+y*L*S+p*F*M;var b=-2*v;B=O/b}while(Math.abs(O)>r.EPSILON12);return t(c)?(c.x=l*g,c.y=f*x,c.z=d*w,c):new e(l*g,f*x,d*w)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o){"use strict";function u(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)}u.fromRadians=function(e,r,a,i){return a=t(a,0),n(i)?(i.longitude=e,i.latitude=r,i.height=a,i):new u(e,r,a)},u.fromDegrees=function(e,t,n,r){return e=i.toRadians(e),t=i.toRadians(t),u.fromRadians(e,t,n,r)};var s=new e,c=new e,l=new e,f=new e(1/6378137,1/6378137,1/6356752.314245179),d=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),h=i.EPSILON1;return u.fromCartesian=function(t,r,a){var E=n(r)?r.oneOverRadii:f,m=n(r)?r.oneOverRadiiSquared:d,_=n(r)?r._centerToleranceSquared:h,y=o(t,E,m,_,c);if(n(y)){var p=e.multiplyComponents(y,m,s);p=e.normalize(p,p);var T=e.subtract(t,y,l),R=Math.atan2(p.y,p.x),A=Math.asin(p.z),N=i.sign(e.dot(T,t))*e.magnitude(T);return n(a)?(a.longitude=R,a.latitude=A,a.height=N,a):new u(R,A,N)}},u.clone=function(e,t){if(n(e))return n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},u.ZERO=a(new u(0,0,0)),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,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(t,r,a,i){r=n(r,0),a=n(a,0),i=n(i,0),t._radii=new e(r,a,i),t._radiiSquared=new e(r*r,a*a,i*i),t._radiiToTheFourth=new e(r*r*r*r,a*a*a*a,i*i*i*i),t._oneOverRadii=new e(0===r?0:1/r,0===a?0:1/a,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===a?0:1/(a*a),0===i?0:1/(i*i)),t._minimumRadius=Math.min(r,a,i),t._maximumRadius=Math.max(r,a,i),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,c(this,e,t,n)}a(l.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}}}),l.clone=function(t,n){if(r(t)){var a=t._radii;return r(n)?(e.clone(a,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new l(a.x,a.y,a.z)}},l.fromCartesian3=function(e,t){return r(t)||(t=new l),r(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,r,a){return a=n(a,0),e.pack(t._radii,r,a),r},l.unpack=function(t,r,a){r=n(r,0);var i=e.unpack(t,r);return l.fromCartesian3(i,a)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,n){var a=t.longitude,i=t.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return r(n)||(n=new e),n.x=u,n.y=s,n.z=c,e.normalize(n,n)},l.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var f=new e,d=new e;l.prototype.cartographicToCartesian=function(t,n){var a=f,i=d;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(e.dot(a,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(a,t.height,a),r(n)||(n=new e),e.add(i,a,n)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var h=new e,E=new e,m=new e;return l.prototype.cartesianToCartographic=function(n,a){var i=this.scaleToGeodeticSurface(n,E);if(r(i)){var o=this.geodeticSurfaceNormal(i,h),s=e.subtract(n,i,m),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),f=u.sign(e.dot(s,n))*e.magnitude(s);return r(a)?(a.longitude=c,a.latitude=l,a.height=f,a):new t(c,l,f)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var a=t.x,i=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return e.multiplyByScalar(t,s,n)},l.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},l.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},l.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,a,i){a=n(a,0);var o=this._sqauredXOverSquaredZ;if(r(i)||(i=new e),i.x=0,i.y=0,i.z=t.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},l}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,a,i,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return r(n)?(n.x=i,n.y=o,n.z=u,n):new e(i,o,u)},u.prototype.unproject=function(e,n){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,u=e.z;return r(n)?(n.longitude=i,n.latitude=o,n.height=u,n):new t(i,o,u)},u}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a,i,o,u,s,c){this[0]=n(e,0),this[1]=n(a,0),this[2]=n(u,0),this[3]=n(t,0),this[4]=n(i,0),this[5]=n(s,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(c,0)}function c(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function l(e){for(var t=0,n=0;n<3;++n){var r=e[s.getElementIndex(m[n],E[n])];t+=2*r*r}return Math.sqrt(t)}function f(e,t){for(var n=u.EPSILON15,r=0,a=1,i=0;i<3;++i){var o=Math.abs(e[s.getElementIndex(m[i],E[i])]);o>r&&(a=i,r=o)}var c=1,l=0,f=E[a],d=m[a];if(Math.abs(e[s.getElementIndex(d,f)])>n){var h,_=e[s.getElementIndex(d,d)],y=e[s.getElementIndex(f,f)],p=e[s.getElementIndex(d,f)],T=(_-y)/2/p;h=T<0?-1/(-T+Math.sqrt(1+T*T)):1/(T+Math.sqrt(1+T*T)),c=1/Math.sqrt(1+h*h),l=h*c}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(f,f)]=t[s.getElementIndex(d,d)]=c,t[s.getElementIndex(d,f)]=l,t[s.getElementIndex(f,d)]=-l,t}s.packedLength=9,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t},s.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a},s.clone=function(e,t){if(r(e))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):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t],a[1]=e[t+1],a[2]=e[t+2],a[3]=e[t+3],a[4]=e[t+4],a[5]=e[t+5],a[6]=e[t+6],a[7]=e[t+7],a[8]=e[t+8],a},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[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 s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var n=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,u=e.y*e.y,c=e.y*e.z,l=e.y*e.w,f=e.z*e.z,d=e.z*e.w,h=e.w*e.w,E=n-u-f+h,m=2*(a-d),_=2*(i+l),y=2*(a+d),p=-n+u-f+h,T=2*(c-o),R=2*(i-l),A=2*(c+o),N=-n-u+f+h;return r(t)?(t[0]=E,t[1]=y,t[2]=R,t[3]=m,t[4]=p,t[5]=A,t[6]=_,t[7]=T,t[8]=N,t):new s(E,m,_,y,p,T,R,A,N)},s.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),a=Math.cos(-e.heading),i=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),c=Math.sin(e.roll),l=n*a,f=-i*u+c*o*a,d=c*u+i*o*a,h=n*u,E=i*a+c*o*u,m=-o*i+i*o*u,_=-o,y=c*n,p=i*n;return r(t)?(t[0]=l,t[1]=h,t[2]=_,t[3]=f,t[4]=E,t[5]=y,t[6]=d,t[7]=m,t[8]=p,t):new s(l,f,d,h,E,m,_,y,p)},s.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 s(e.x,0,0,0,e.y,0,0,0,e.z)},s.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 s(e,0,0,0,e,0,0,0,e)},s.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 s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=a,t[6]=0,t[7]=-a,t[8]=n,t):new s(1,0,0,0,n,-a,0,a,n)},s.fromRotationY=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=n,t):new s(n,0,a,0,1,0,-a,0,n)},s.fromRotationZ=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=a,t[2]=0,t[3]=-a,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(n,-a,0,a,n,0,0,0,1)},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):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,n){var r=3*t,a=e[r],i=e[r+1],o=e[r+2];return n.x=a,n.y=i,n.z=o,n},s.setColumn=function(e,t,n,r){r=s.clone(e,r);var a=3*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},s.getRow=function(e,t,n){var r=e[t],a=e[t+3],i=e[t+6];return n.x=r,n.y=a,n.z=i,n},s.setRow=function(e,t,n,r){return r=s.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var d=new e;s.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],d)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],d)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],d)),n};var h=new e;s.getMaximumScale=function(t){return s.getScale(t,h),e.maximumComponent(h)},s.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=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 n[0]=r,n[1]=a,n[2]=i,n[3]=o,n[4]=u,n[5]=s,n[6]=c,n[7]=l,n[8]=f,n},s.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},s.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},s.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[3]*a+e[6]*i,u=e[1]*r+e[4]*a+e[7]*i,s=e[2]*r+e[5]*a+e[8]*i;return n.x=o,n.y=u,n.z=s,n},s.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},s.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},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},s.transpose=function(e,t){var n=e[0],r=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=n,t[1]=r,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var E=[1,0,0],m=[2,2,1],_=new s,y=new s;return s.computeEigenDecomposition=function(e,t){var n=u.EPSILON20,a=10,i=0,o=0;r(t)||(t={});for(var d=t.unitary=s.clone(s.IDENTITY,t.unitary),h=t.diagonal=s.clone(e,t.diagonal),E=n*c(h);o<a&&l(h)>E;)f(h,_),s.transpose(_,y),s.multiply(h,_,h),s.multiply(y,h,h),s.multiply(d,_,d),++i>2&&(++o, +i=0);return 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},s.determinant=function(e){var t=e[0],n=e[3],r=e[6],a=e[1],i=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*o)+a*(s*r-n*c)+u*(n*o-i*r)},s.inverse=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[3],o=e[4],u=e[5],c=e[6],l=e[7],f=e[8],d=s.determinant(e);t[0]=o*f-l*u,t[1]=l*a-r*f,t[2]=r*u-o*a,t[3]=c*u-i*f,t[4]=n*f-c*a,t[5]=i*a-n*u,t[6]=i*l-c*o,t[7]=c*r-n*l,t[8]=n*o-i*r;var h=1/d;return s.multiplyByScalar(t,h,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]},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},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,a(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r,a){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(a,0)}o.fromElements=function(e,t,r,a,i){return n(i)?(i.x=e,i.y=t,i.z=r,i.w=a,i):new o(e,t,r,a)},o.fromColor=function(e,t){return n(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(n(e))return n(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)},o.packedLength=4,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r++],a.w=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=4*r:t=new Array(4*r);for(var a=0;a<r;++a)o.pack(e[a],t,4*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/4:t=new Array(r/4);for(var a=0;a<r;a+=4){var i=a/4;t[i]=o.unpack(e,a,t[i])}return t},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,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},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 u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,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,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},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 s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,c);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)&&i.equalsEpsilon(e.w,t.w,r,a)},o.ZERO=a(new o(0,0,0,0)),o.UNIT_X=a(new o(1,0,0,0)),o.UNIT_Y=a(new o(0,1,0,0)),o.UNIT_Z=a(new o(0,0,1,0)),o.UNIT_W=a(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,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,a,i,o,u,s,c,l){"use strict";function f(e,t,n,a,i,o,u,s,c,l,f,d,h,E,m,_){this[0]=r(e,0),this[1]=r(i,0),this[2]=r(c,0),this[3]=r(h,0),this[4]=r(t,0),this[5]=r(o,0),this[6]=r(l,0),this[7]=r(E,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(f,0),this[11]=r(m,0),this[12]=r(a,0),this[13]=r(s,0),this[14]=r(d,0),this[15]=r(_,0)}f.packedLength=16,f.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},f.unpack=function(e,t,n){return t=r(t,0),a(n)||(n=new f),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},f.clone=function(e,t){if(a(e))return a(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 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])},f.fromArray=f.unpack,f.fromColumnMajorArray=function(e,t){return f.clone(e,t)},f.fromRowMajorArray=function(e,t){return a(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 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(t,n,i){return n=r(n,e.ZERO),a(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=1,i):new f(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},f.fromTranslationQuaternionRotationScale=function(e,t,n,r){a(r)||(r=new f);var i=n.x,o=n.y,u=n.z,s=t.x*t.x,c=t.x*t.y,l=t.x*t.z,d=t.x*t.w,h=t.y*t.y,E=t.y*t.z,m=t.y*t.w,_=t.z*t.z,y=t.z*t.w,p=t.w*t.w,T=s-h-_+p,R=2*(c-y),A=2*(l+m),N=2*(c+y),S=-s+h-_+p,M=2*(E-d),I=2*(l-m),O=2*(E+d),v=-s-h+_+p;return r[0]=T*i,r[1]=N*i,r[2]=I*i,r[3]=0,r[4]=R*o,r[5]=S*o,r[6]=O*o,r[7]=0,r[8]=A*u,r[9]=M*u,r[10]=v*u,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},f.fromTranslationRotationScale=function(e,t){return f.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},f.fromTranslation=function(e,t){return f.fromRotationTranslation(c.IDENTITY,e,t)},f.fromScale=function(e,t){return a(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 f(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},f.fromUniformScale=function(e,t){return a(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 f(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var d=new e,h=new e,E=new e;f.fromCamera=function(t,n){var r=t.position,i=t.direction,o=t.up;e.normalize(i,d),e.normalize(e.cross(d,o,h),h),e.normalize(e.cross(h,d,E),E);var u=h.x,s=h.y,c=h.z,l=d.x,m=d.y,_=d.z,y=E.x,p=E.y,T=E.z,R=r.x,A=r.y,N=r.z,S=u*-R+s*-A+c*-N,M=y*-R+p*-A+T*-N,I=l*R+m*A+_*N;return a(n)?(n[0]=u,n[1]=y,n[2]=-l,n[3]=0,n[4]=s,n[5]=p,n[6]=-m,n[7]=0,n[8]=c,n[9]=T,n[10]=-_,n[11]=0,n[12]=S,n[13]=M,n[14]=I,n[15]=1,n):new f(u,s,c,S,y,p,T,M,-l,-m,-_,I,0,0,0,1)},f.computePerspectiveFieldOfView=function(e,t,n,r,a){var i=Math.tan(.5*e),o=1/i,u=o/t,s=(r+n)/(n-r),c=2*r*n/(n-r);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=c,a[15]=0,a},f.computeOrthographicOffCenter=function(e,t,n,r,a,i,o){var u=1/(t-e),s=1/(r-n),c=1/(i-a),l=-(t+e)*u,f=-(r+n)*s,d=-(i+a)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=f,o[14]=d,o[15]=1,o},f.computePerspectiveOffCenter=function(e,t,n,r,a,i,o){var u=2*a/(t-e),s=2*a/(r-n),c=(t+e)/(t-e),l=(r+n)/(r-n),f=-(i+a)/(i-a),d=-1,h=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=f,o[11]=d,o[12]=0,o[13]=0,o[14]=h,o[15]=0,o},f.computeInfinitePerspectiveOffCenter=function(e,t,n,r,a,i){var o=2*a/(t-e),u=2*a/(r-n),s=(t+e)/(t-e),c=(r+n)/(r-n),l=-1,f=-1,d=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=s,i[9]=c,i[10]=l,i[11]=f,i[12]=0,i[13]=0,i[14]=d,i[15]=0,i},f.computeViewportTransformation=function(e,t,n,a){e=r(e,r.EMPTY_OBJECT);var i=r(e.x,0),o=r(e.y,0),u=r(e.width,0),s=r(e.height,0);t=r(t,0),n=r(n,1);var c=.5*u,l=.5*s,f=.5*(n-t),d=c,h=l,E=f,m=i+c,_=o+l,y=t+f,p=1;return a[0]=d,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=h,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=E,a[11]=0,a[12]=m,a[13]=_,a[14]=y,a[15]=p,a},f.computeView=function(t,n,r,a,i){return i[0]=a.x,i[1]=r.x,i[2]=-n.x,i[3]=0,i[4]=a.y,i[5]=r.y,i[6]=-n.y,i[7]=0,i[8]=a.z,i[9]=r.z,i[10]=-n.z,i[11]=0,i[12]=-e.dot(a,t),i[13]=-e.dot(r,t),i[14]=e.dot(n,t),i[15]=1,i},f.toArray=function(e,t){return a(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]]},f.getElementIndex=function(e,t){return 4*e+t},f.getColumn=function(e,t,n){var r=4*t,a=e[r],i=e[r+1],o=e[r+2],u=e[r+3];return n.x=a,n.y=i,n.z=o,n.w=u,n},f.setColumn=function(e,t,n,r){r=f.clone(e,r);var a=4*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r[a+3]=n.w,r},f.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},f.getRow=function(e,t,n){var r=e[t],a=e[t+4],i=e[t+8],o=e[t+12];return n.x=r,n.y=a,n.z=i,n.w=o,n},f.setRow=function(e,t,n,r){return r=f.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var m=new e;f.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],m)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],m)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],m)),n};var _=new e;f.getMaximumScale=function(t){return f.getScale(t,_),e.maximumComponent(_)},f.multiply=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],f=e[8],d=e[9],h=e[10],E=e[11],m=e[12],_=e[13],y=e[14],p=e[15],T=t[0],R=t[1],A=t[2],N=t[3],S=t[4],M=t[5],I=t[6],O=t[7],v=t[8],g=t[9],x=t[10],w=t[11],C=t[12],P=t[13],U=t[14],D=t[15],L=r*T+u*R+f*A+m*N,F=a*T+s*R+d*A+_*N,z=i*T+c*R+h*A+y*N,B=o*T+l*R+E*A+p*N,b=r*S+u*M+f*I+m*O,q=a*S+s*M+d*I+_*O,G=i*S+c*M+h*I+y*O,W=o*S+l*M+E*I+p*O,X=r*v+u*g+f*x+m*w,V=a*v+s*g+d*x+_*w,H=i*v+c*g+h*x+y*w,Y=o*v+l*g+E*x+p*w,k=r*C+u*P+f*U+m*D,j=a*C+s*P+d*U+_*D,Z=i*C+c*P+h*U+y*D,K=o*C+l*P+E*U+p*D;return n[0]=L,n[1]=F,n[2]=z,n[3]=B,n[4]=b,n[5]=q,n[6]=G,n[7]=W,n[8]=X,n[9]=V,n[10]=H,n[11]=Y,n[12]=k,n[13]=j,n[14]=Z,n[15]=K,n},f.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},f.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},f.multiplyTransformation=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],d=e[12],h=e[13],E=e[14],m=t[0],_=t[1],y=t[2],p=t[4],T=t[5],R=t[6],A=t[8],N=t[9],S=t[10],M=t[12],I=t[13],O=t[14],v=r*m+o*_+c*y,g=a*m+u*_+l*y,x=i*m+s*_+f*y,w=r*p+o*T+c*R,C=a*p+u*T+l*R,P=i*p+s*T+f*R,U=r*A+o*N+c*S,D=a*A+u*N+l*S,L=i*A+s*N+f*S,F=r*M+o*I+c*O+d,z=a*M+u*I+l*O+h,B=i*M+s*I+f*O+E;return n[0]=v,n[1]=g,n[2]=x,n[3]=0,n[4]=w,n[5]=C,n[6]=P,n[7]=0,n[8]=U,n[9]=D,n[10]=L,n[11]=0,n[12]=F,n[13]=z,n[14]=B,n[15]=1,n},f.multiplyByMatrix3=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],d=t[0],h=t[1],E=t[2],m=t[3],_=t[4],y=t[5],p=t[6],T=t[7],R=t[8],A=r*d+o*h+c*E,N=a*d+u*h+l*E,S=i*d+s*h+f*E,M=r*m+o*_+c*y,I=a*m+u*_+l*y,O=i*m+s*_+f*y,v=r*p+o*T+c*R,g=a*p+u*T+l*R,x=i*p+s*T+f*R;return n[0]=A,n[1]=N,n[2]=S,n[3]=0,n[4]=M,n[5]=I,n[6]=O,n[7]=0,n[8]=v,n[9]=g,n[10]=x,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},f.multiplyByTranslation=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=r*e[0]+a*e[4]+i*e[8]+e[12],u=r*e[1]+a*e[5]+i*e[9]+e[13],s=r*e[2]+a*e[6]+i*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=s,n[15]=e[15],n};var y=new e;f.multiplyByUniformScale=function(e,t,n){return y.x=t,y.y=t,y.z=t,f.multiplyByScale(e,y,n)},f.multiplyByScale=function(e,t,n){var r=t.x,a=t.y,i=t.z;return 1===r&&1===a&&1===i?f.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=a*e[4],n[5]=a*e[5],n[6]=a*e[6],n[7]=0,n[8]=i*e[8],n[9]=i*e[9],n[10]=i*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},f.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=t.w,u=e[0]*r+e[4]*a+e[8]*i+e[12]*o,s=e[1]*r+e[5]*a+e[9]*i+e[13]*o,c=e[2]*r+e[6]*a+e[10]*i+e[14]*o,l=e[3]*r+e[7]*a+e[11]*i+e[15]*o;return n.x=u,n.y=s,n.z=c,n.w=l,n},f.multiplyByPointAsVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i,u=e[1]*r+e[5]*a+e[9]*i,s=e[2]*r+e[6]*a+e[10]*i;return n.x=o,n.y=u,n.z=s,n},f.multiplyByPoint=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i+e[12],u=e[1]*r+e[5]*a+e[9]*i+e[13],s=e[2]*r+e[6]*a+e[10]*i+e[14];return n.x=o,n.y=u,n.z=s,n},f.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},f.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},f.transpose=function(e,t){var n=e[1],r=e[2],a=e[3],i=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=o,t[14]=u,t[15]=e[15],t},f.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},f.equals=function(e,t){return e===t||a(e)&&a(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},f.equalsEpsilon=function(e,t,n){return e===t||a(e)&&a(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},f.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},f.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};var p=new c,T=new c,R=new t,A=new t(0,0,0,1);return f.inverse=function(e,n){if(c.equalsEpsilon(f.getRotation(e,p),T,s.EPSILON7)&&t.equals(f.getRow(e,3,R),A))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],a=e[4],i=e[8],o=e[12],u=e[1],d=e[5],h=e[9],E=e[13],m=e[2],_=e[6],y=e[10],N=e[14],S=e[3],M=e[7],I=e[11],O=e[15],v=y*O,g=N*I,x=_*O,w=N*M,C=_*I,P=y*M,U=m*O,D=N*S,L=m*I,F=y*S,z=m*M,B=_*S,b=v*d+w*h+C*E-(g*d+x*h+P*E),q=g*u+U*h+F*E-(v*u+D*h+L*E),G=x*u+D*d+z*E-(w*u+U*d+B*E),W=P*u+L*d+B*h-(C*u+F*d+z*h),X=g*a+x*i+P*o-(v*a+w*i+C*o),V=v*r+D*i+L*o-(g*r+U*i+F*o),H=w*r+U*a+B*o-(x*r+D*a+z*o),Y=C*r+F*a+z*i-(P*r+L*a+B*i);v=i*E,g=o*h,x=a*E,w=o*d,C=a*h,P=i*d,U=r*E,D=o*u,L=r*h,F=i*u,z=r*d,B=a*u;var k=v*M+w*I+C*O-(g*M+x*I+P*O),j=g*S+U*I+F*O-(v*S+D*I+L*O),Z=x*S+D*M+z*O-(w*S+U*M+B*O),K=P*S+L*M+B*I-(C*S+F*M+z*I),J=x*y+P*N+g*_-(C*N+v*_+w*y),Q=L*N+v*m+D*y-(U*y+F*N+g*m),$=U*_+B*N+w*m-(z*N+x*m+D*_),ee=z*y+C*m+F*_-(L*_+B*y+P*m),te=r*b+a*q+i*G+o*W;if(Math.abs(te)<s.EPSILON20)throw new l("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=b*te,n[1]=q*te,n[2]=G*te,n[3]=W*te,n[4]=X*te,n[5]=V*te,n[6]=H*te,n[7]=Y*te,n[8]=k*te,n[9]=j*te,n[10]=Z*te,n[11]=K*te,n[12]=J*te,n[13]=Q*te,n[14]=$*te,n[15]=ee*te,n},f.inverseTransformation=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],f=e[12],d=e[13],h=e[14],E=-n*f-r*d-a*h,m=-i*f-o*d-u*h,_=-s*f-c*d-l*h;return t[0]=n,t[1]=i,t[2]=s,t[3]=0,t[4]=r,t[5]=o,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=l,t[11]=0,t[12]=E,t[13]=m,t[14]=_,t[15]=1,t},f.IDENTITY=u(new f(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),f.ZERO=u(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,i(f.prototype,{length:{get:function(){return f.packedLength}}}),f.prototype.clone=function(e){return f.clone(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},f.prototype.equalsEpsilon=function(e,t){return f.equalsEpsilon(this,e,t)},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/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(e,t,r,a){this.west=n(e,0),this.south=n(t,0),this.east=n(r,0),this.north=n(a,0)}a(c.prototype,{width:{get:function(){return c.computeWidth(this)}},height:{get:function(){return c.computeHeight(this)}}}),c.packedLength=4,c.pack=function(e,t,r){return r=n(r,0),t[r++]=e.west,t[r++]=e.south,t[r++]=e.east,t[r]=e.north,t},c.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new c),a.west=e[t++],a.south=e[t++],a.east=e[t++],a.north=e[t],a},c.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=s.TWO_PI),t-n},c.computeHeight=function(e){return e.north-e.south},c.fromDegrees=function(e,t,a,i,o){return e=s.toRadians(n(e,0)),t=s.toRadians(n(t,0)),a=s.toRadians(n(a,0)),i=s.toRadians(n(i,0)),r(o)?(o.west=e,o.south=t,o.east=a,o.north=i,o):new c(e,t,a,i)},c.fromRadians=function(e,t,a,i,o){return r(o)?(o.west=n(e,0),o.south=n(t,0),o.east=n(a,0),o.north=n(i,0),o):new c(e,t,a,i)},c.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,u=Number.MAX_VALUE,l=-Number.MAX_VALUE,f=0,d=e.length;f<d;f++){var h=e[f];n=Math.min(n,h.longitude),a=Math.max(a,h.longitude),u=Math.min(u,h.latitude),l=Math.max(l,h.latitude);var E=h.longitude>=0?h.longitude:h.longitude+s.TWO_PI;i=Math.min(i,E),o=Math.max(o,E)}return a-n>o-i&&(n=i,a=o,a>s.PI&&(a-=s.TWO_PI),n>s.PI&&(n-=s.TWO_PI)),r(t)?(t.west=n,t.south=u,t.east=a,t.north=l,t):new c(n,u,a,l)},c.fromCartesianArray=function(e,t,n){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,u=-Number.MAX_VALUE,l=Number.MAX_VALUE,f=-Number.MAX_VALUE,d=0,h=e.length;d<h;d++){var E=t.cartesianToCartographic(e[d]);a=Math.min(a,E.longitude),i=Math.max(i,E.longitude),l=Math.min(l,E.latitude),f=Math.max(f,E.latitude);var m=E.longitude>=0?E.longitude:E.longitude+s.TWO_PI;o=Math.min(o,m),u=Math.max(u,m)}return i-a>u-o&&(a=o,i=u,i>s.PI&&(i-=s.TWO_PI),a>s.PI&&(a-=s.TWO_PI)),r(n)?(n.west=a,n.south=l,n.east=i,n.north=f,n):new c(a,l,i,f)},c.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new c(e.west,e.south,e.east,e.north)},c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.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},c.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},c.validate=function(e){},c.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)},c.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)},c.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)},c.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)},c.center=function(t,n){var a=t.east,i=t.west;a<i&&(a+=s.TWO_PI);var o=s.negativePiToPi(.5*(i+a)),u=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=u,n.height=0,n):new e(o,u)},c.intersection=function(e,t,n){var a=e.east,i=e.west,o=t.east,u=t.west;a<i&&o>0?a+=s.TWO_PI:o<u&&a>0&&(o+=s.TWO_PI),a<i&&u<0?u+=s.TWO_PI:o<u&&i<0&&(i+=s.TWO_PI);var l=s.negativePiToPi(Math.max(i,u)),f=s.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&f<=l)){var d=Math.max(e.south,t.south),h=Math.min(e.north,t.north);if(!(d>=h))return r(n)?(n.west=l,n.south=d,n.east=f,n.north=h,n):new c(l,d,f,h)}},c.simpleIntersection=function(e,t,n){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(i>=u||a>=o))return r(n)?(n.west=a,n.south=i,n.east=o,n.north=u,n):new c(a,i,o,u)},c.union=function(e,t,n){r(n)||(n=new c);var a=e.east,i=e.west,o=t.east,u=t.west;a<i&&o>0?a+=s.TWO_PI:o<u&&a>0&&(o+=s.TWO_PI),a<i&&u<0?u+=s.TWO_PI:o<u&&i<0&&(i+=s.TWO_PI);var l=s.convertLongitudeRange(Math.min(i,u)),f=s.convertLongitudeRange(Math.max(a,o));return n.west=l,n.south=Math.min(e.south,t.south),n.east=f,n.north=Math.max(e.north,t.north),n},c.expand=function(e,t,n){return r(n)||(n=new c),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},c.contains=function(e,t){var n=t.longitude,r=t.latitude,a=e.west,i=e.east;return i<a&&(i+=s.TWO_PI,n<0&&(n+=s.TWO_PI)),(n>a||s.equalsEpsilon(n,a,s.EPSILON14))&&(n<i||s.equalsEpsilon(n,i,s.EPSILON14))&&r>=e.south&&r<=e.north};var l=new e;return c.subsample=function(e,t,a,i){t=n(t,o.WGS84),a=n(a,0),r(i)||(i=[]);var u=0,f=e.north,d=e.south,h=e.east,E=e.west,m=l;m.height=a,m.longitude=E,m.latitude=f,i[u]=t.cartographicToCartesian(m,i[u]),u++,m.longitude=h,i[u]=t.cartographicToCartesian(m,i[u]),u++,m.latitude=d,i[u]=t.cartographicToCartesian(m,i[u]),u++,m.longitude=E,i[u]=t.cartographicToCartesian(m,i[u]),u++,f<0?m.latitude=f:d>0?m.latitude=d:m.latitude=0;for(var _=1;_<8;++_)m.longitude=-Math.PI+_*s.PI_OVER_TWO,c.contains(e,m)&&(i[u]=t.cartographicToCartesian(m,i[u]),u++);return 0===m.latitude&&(m.longitude=E,i[u]=t.cartographicToCartesian(m,i[u]),u++,m.longitude=h,i[u]=t.cartographicToCartesian(m,i[u]),u++),i.length=u,i},c.MAX_VALUE=u(new c(-Math.PI,-s.PI_OVER_TWO,Math.PI,s.PI_OVER_TWO)),c}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function d(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var h=new e,E=new e,m=new e,_=new e,y=new e,p=new e,T=new e,R=new e,A=new e,N=new e,S=new e,M=new e;d.fromPoints=function(t,n){if(a(n)||(n=new d),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var r=e.clone(t[0],T),i=e.clone(r,h),o=e.clone(r,E),u=e.clone(r,m),s=e.clone(r,_),c=e.clone(r,y),l=e.clone(r,p),f=t.length,I=1;I<f;I++){e.clone(t[I],r);var O=r.x,v=r.y,g=r.z;O<i.x&&e.clone(r,i),O>s.x&&e.clone(r,s),v<o.y&&e.clone(r,o),v>c.y&&e.clone(r,c),g<u.z&&e.clone(r,u),g>l.z&&e.clone(r,l)}var x=e.magnitudeSquared(e.subtract(s,i,R)),w=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=i,U=s,D=x;w>D&&(D=w,P=o,U=c),C>D&&(D=C,P=u,U=l);var L=A;L.x=.5*(P.x+U.x),L.y=.5*(P.y+U.y),L.z=.5*(P.z+U.z);var F=e.magnitudeSquared(e.subtract(U,L,R)),z=Math.sqrt(F),B=N;B.x=i.x,B.y=o.y,B.z=u.z;var b=S;b.x=s.x,b.y=c.y,b.z=l.z;var q=e.multiplyByScalar(e.add(B,b,R),.5,M),G=0;for(I=0;I<f;I++){e.clone(t[I],r);var W=e.magnitude(e.subtract(r,q,R));W>G&&(G=W);var X=e.magnitudeSquared(e.subtract(r,L,R));if(X>F){var V=Math.sqrt(X);z=.5*(z+V),F=z*z;var H=V-z;L.x=(z*L.x+H*r.x)/V,L.y=(z*L.y+H*r.y)/V,L.z=(z*L.z+H*r.z)/V}}return z<G?(e.clone(L,n.center),n.radius=z):(e.clone(q,n.center),n.radius=G),n};var I=new o,O=new e,v=new e,g=new t,x=new t;d.fromRectangle2D=function(e,t,n){return d.fromRectangleWithHeights2D(e,t,0,0,n)},d.fromRectangleWithHeights2D=function(t,n,i,o,u){if(a(u)||(u=new d),!a(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;n=r(n,I),f.southwest(t,g),g.height=i,f.northeast(t,x),x.height=o;var s=n.project(g,O),c=n.project(x,v),l=c.x-s.x,h=c.y-s.y,E=c.z-s.z;u.radius=.5*Math.sqrt(l*l+h*h+E*E);var m=u.center;return m.x=s.x+.5*l,m.y=s.y+.5*h,m.z=s.z+.5*E,u};var w=[];d.fromRectangle3D=function(e,t,n,o){t=r(t,i.WGS84),n=r(n,0);var u;return a(e)&&(u=f.subsample(e,t,n,w)),d.fromPoints(u,o)},d.fromVertices=function(t,n,i,o){if(a(o)||(o=new d),!a(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;n=r(n,e.ZERO),i=r(i,3);var u=T;u.x=t[0]+n.x,u.y=t[1]+n.y,u.z=t[2]+n.z;for(var s=e.clone(u,h),c=e.clone(u,E),l=e.clone(u,m),f=e.clone(u,_),I=e.clone(u,y),O=e.clone(u,p),v=t.length,g=0;g<v;g+=i){var x=t[g]+n.x,w=t[g+1]+n.y,C=t[g+2]+n.z;u.x=x,u.y=w,u.z=C,x<s.x&&e.clone(u,s),x>f.x&&e.clone(u,f),w<c.y&&e.clone(u,c),w>I.y&&e.clone(u,I),C<l.z&&e.clone(u,l),C>O.z&&e.clone(u,O)}var P=e.magnitudeSquared(e.subtract(f,s,R)),U=e.magnitudeSquared(e.subtract(I,c,R)),D=e.magnitudeSquared(e.subtract(O,l,R)),L=s,F=f,z=P;U>z&&(z=U,L=c,F=I),D>z&&(z=D,L=l,F=O);var B=A;B.x=.5*(L.x+F.x),B.y=.5*(L.y+F.y),B.z=.5*(L.z+F.z);var b=e.magnitudeSquared(e.subtract(F,B,R)),q=Math.sqrt(b),G=N;G.x=s.x,G.y=c.y,G.z=l.z;var W=S;W.x=f.x,W.y=I.y,W.z=O.z;var X=e.multiplyByScalar(e.add(G,W,R),.5,M),V=0;for(g=0;g<v;g+=i){u.x=t[g]+n.x,u.y=t[g+1]+n.y,u.z=t[g+2]+n.z;var H=e.magnitude(e.subtract(u,X,R));H>V&&(V=H);var Y=e.magnitudeSquared(e.subtract(u,B,R));if(Y>b){var k=Math.sqrt(Y);q=.5*(q+k),b=q*q;var j=k-q;B.x=(q*B.x+j*u.x)/k,B.y=(q*B.y+j*u.y)/k,B.z=(q*B.z+j*u.z)/k}}return q<V?(e.clone(B,o.center),o.radius=q):(e.clone(X,o.center),o.radius=V),o},d.fromEncodedCartesianVertices=function(t,n,r){if(a(r)||(r=new d),!a(t)||!a(n)||t.length!==n.length||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var i=T;i.x=t[0]+n[0],i.y=t[1]+n[1],i.z=t[2]+n[2];for(var o=e.clone(i,h),u=e.clone(i,E),s=e.clone(i,m),c=e.clone(i,_),l=e.clone(i,y),f=e.clone(i,p),I=t.length,O=0;O<I;O+=3){var v=t[O]+n[O],g=t[O+1]+n[O+1],x=t[O+2]+n[O+2];i.x=v,i.y=g,i.z=x,v<o.x&&e.clone(i,o),v>c.x&&e.clone(i,c),g<u.y&&e.clone(i,u),g>l.y&&e.clone(i,l),x<s.z&&e.clone(i,s),x>f.z&&e.clone(i,f)}var w=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=e.magnitudeSquared(e.subtract(f,s,R)),U=o,D=c,L=w;C>L&&(L=C,U=u,D=l),P>L&&(L=P,U=s,D=f);var F=A;F.x=.5*(U.x+D.x),F.y=.5*(U.y+D.y),F.z=.5*(U.z+D.z);var z=e.magnitudeSquared(e.subtract(D,F,R)),B=Math.sqrt(z),b=N;b.x=o.x,b.y=u.y,b.z=s.z;var q=S;q.x=c.x,q.y=l.y,q.z=f.z;var G=e.multiplyByScalar(e.add(b,q,R),.5,M),W=0;for(O=0;O<I;O+=3){i.x=t[O]+n[O],i.y=t[O+1]+n[O+1],i.z=t[O+2]+n[O+2];var X=e.magnitude(e.subtract(i,G,R));X>W&&(W=X);var V=e.magnitudeSquared(e.subtract(i,F,R));if(V>z){var H=Math.sqrt(V);B=.5*(B+H),z=B*B;var Y=H-B;F.x=(B*F.x+Y*i.x)/H,F.y=(B*F.y+Y*i.y)/H,F.z=(B*F.z+Y*i.z)/H}}return B<W?(e.clone(F,r.center),r.radius=B):(e.clone(G,r.center),r.radius=W),r},d.fromCornerPoints=function(t,n,r){a(r)||(r=new d);var i=r.center;return e.add(t,n,i),e.multiplyByScalar(i,.5,i),r.radius=e.distance(i,n),r},d.fromEllipsoid=function(t,n){return a(n)||(n=new d),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var C=new e;d.fromBoundingSpheres=function(t,n){if(a(n)||(n=new d),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var r=t.length;if(1===r)return d.clone(t[0],n);if(2===r)return d.union(t[0],t[1],n);for(var i=[],o=0;o<r;o++)i.push(t[o].center);n=d.fromPoints(i,n);var u=n.center,s=n.radius;for(o=0;o<r;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,C)+c.radius)}return n.radius=s,n};var P=new e,U=new e,D=new e;d.fromOrientedBoundingBox=function(t,n){a(n)||(n=new d);var r=t.halfAxes,i=c.getColumn(r,0,P),o=c.getColumn(r,1,U),u=c.getColumn(r,2,D),s=e.magnitude(i),l=e.magnitude(o),f=e.magnitude(u);return n.center=e.clone(t.center,n.center),n.radius=Math.max(s,l,f),n},d.clone=function(t,n){ +if(a(t))return a(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new d(t.center,t.radius)},d.packedLength=4,d.pack=function(e,t,n){n=r(n,0);var a=e.center;return t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n]=e.radius,t},d.unpack=function(e,t,n){t=r(t,0),a(n)||(n=new d);var i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};var L=new e,F=new e;d.union=function(t,n,r){a(r)||(r=new d);var i=t.center,o=t.radius,u=n.center,s=n.radius,c=e.subtract(u,i,L),l=e.magnitude(c);if(o>=l+s)return t.clone(r),r;if(s>=l+o)return n.clone(r),r;var f=.5*(o+l+s),h=e.multiplyByScalar(c,(-o+f)/l,F);return e.add(h,i,h),e.clone(h,r.center),r.radius=f,r};var z=new e;d.expand=function(t,n,r){r=d.clone(t,r);var a=e.magnitude(e.subtract(n,r.center,z));return a>r.radius&&(r.radius=a),r},d.intersectPlane=function(t,n){var r=t.center,a=t.radius,i=n.normal,o=e.dot(i,r)+n.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},d.transform=function(e,t,n){return a(n)||(n=new d),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=l.getMaximumScale(t)*e.radius,n};var B=new e;d.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,B);return e.magnitudeSquared(r)-t.radius*t.radius},d.transformWithoutScale=function(e,t,n){return a(n)||(n=new d),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var b=new e;d.computePlaneDistances=function(t,n,r,i){a(i)||(i=new s);var o=e.subtract(t.center,n,b),u=e.dot(r,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var q=new e,G=new e,W=new e,X=new e,V=new e,H=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var j=new o;return d.projectTo2D=function(t,n,a){n=r(n,j);var i=n.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,q),c=e.cross(e.UNIT_Z,s,G);e.normalize(c,c);var l=e.cross(s,c,W);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var f=e.negate(l,V),h=e.negate(c,X),E=Y,m=E[0];e.add(s,l,m),e.add(m,c,m),m=E[1],e.add(s,l,m),e.add(m,h,m),m=E[2],e.add(s,f,m),e.add(m,h,m),m=E[3],e.add(s,f,m),e.add(m,c,m),e.negate(s,s),m=E[4],e.add(s,l,m),e.add(m,c,m),m=E[5],e.add(s,l,m),e.add(m,h,m),m=E[6],e.add(s,f,m),e.add(m,h,m),m=E[7],e.add(s,f,m),e.add(m,c,m);for(var _=E.length,y=0;y<_;++y){var p=E[y];e.add(o,p,p);var T=i.cartesianToCartographic(p,H);n.project(T,p)}a=d.fromPoints(E,a),o=a.center;var R=o.x,A=o.y,N=o.z;return o.x=N,o.y=R,o.z=A,a},d.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},d.equals=function(t,n){return t===n||a(t)&&a(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},d.prototype.intersectPlane=function(e){return d.intersectPlane(this,e)},d.prototype.distanceSquaredTo=function(e){return d.distanceSquaredTo(this,e)},d.prototype.computePlaneDistances=function(e,t,n){return d.computePlaneDistances(this,e,t,n)},d.prototype.isOccluded=function(e){return d.isOccluded(this,e)},d.prototype.equals=function(e){return d.equals(this,e)},d.prototype.clone=function(e){return d.clone(this,e)},d}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047};return e(t)}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,n,r,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(e){switch(e){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(t){return e(t)&&(t===i.UNSIGNED_BYTE||t===i.UNSIGNED_SHORT||t===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,n,a){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,a):new Uint16Array(t,n,a)},n(i)}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function n(e,n,r){var a=e+n;return t.sign(e)!==t.sign(n)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(n)))<r?0:a}var r={};return r.computeDiscriminant=function(e,t,n){var r=t*t-4*e*n;return r},r.computeRealRoots=function(e,r,a){var i;if(0===e)return 0===r?[]:[-a/r];if(0===r){if(0===a)return[0,0];var o=Math.abs(a),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,i<0)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-r/e,i<0?[i,0]:[0,i];var c=r*r,l=4*e*a,f=n(c,-l,t.EPSILON14);if(f<0)return[];var d=-.5*n(r,t.sign(r)*Math.sqrt(f),t.EPSILON14);return r>0?[d/e,a/d]:[a/d,d/e]},r}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function n(e,t,n,r){var a,i,o=e,u=t/3,s=n/3,c=r,l=o*s,f=u*c,d=u*u,h=s*s,E=o*s-d,m=o*c-u*s,_=u*c-h,y=4*E*_-m*m;if(y<0){var p,T,R;d*f>=l*h?(p=o,T=E,R=-2*u*E+o*m):(p=c,T=_,R=-c*m+2*s*_);var A=R<0?-1:1,N=-A*Math.abs(p)*Math.sqrt(-y);i=-R+N;var S=i/2,M=S<0?-Math.pow(-S,1/3):Math.pow(S,1/3),I=i===N?-M:-T/M;return a=T<=0?M+I:-R/(M*M+I*I+T),d*f>=l*h?[(a-u)/o]:[-c/(a+s)]}var O=E,v=-2*u*E+o*m,g=_,x=-c*m+2*s*_,w=Math.sqrt(y),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*w,-v)/3);a=2*Math.sqrt(-O);var U=Math.cos(P);i=a*U;var D=a*(-U/2-C*Math.sin(P)),L=i+D>2*u?i-u:D-u,F=o,z=L/F;P=Math.abs(Math.atan2(c*w,-x)/3),a=2*Math.sqrt(-g),U=Math.cos(P),i=a*U,D=a*(-U/2-C*Math.sin(P));var B=-c,b=i+D<2*s?i+s:D+s,q=B/b,G=F*b,W=-L*b-F*B,X=L*B,V=(s*W-u*X)/(-u*W+s*G);return z<=V?z<=q?V<=q?[z,V,q]:[z,q,V]:[q,z,V]:z<=q?[V,z,q]:V<=q?[V,q,z]:[q,V,z]}var r={};return r.computeDiscriminant=function(e,t,n,r){var a=e*e,i=t*t,o=n*n,u=r*r,s=18*e*t*n*r+i*o-27*a*u-4*(e*o*n+i*t*r);return s},r.computeRealRoots=function(e,r,a,i){var o,u;if(0===e)return t.computeRealRoots(r,a,i);if(0===r){if(0===a){if(0===i)return[0,0,0];u=-i/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===i?(o=t.computeRealRoots(e,0,a),0===o.Length?[0]:[o[0],0,o[1]]):n(e,0,a,i)}return 0===a?0===i?(u=-r/e,u<0?[u,0,0]:[0,0,u]):n(e,r,0,i):0===i?(o=t.computeRealRoots(e,r,a),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):n(e,r,a,i)},r}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,n,r){"use strict";function a(t,a,i,o){var u=t*t,s=a-3*u/8,c=i-a*t/2+u*t/8,l=o-i*t/4+a*u/16-3*u*u/256,f=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(f.length>0){var d=-t/4,h=f[f.length-1];if(Math.abs(h)<n.EPSILON14){var E=r.computeRealRoots(1,s,l);if(2===E.length){var m,_=E[0],y=E[1];if(_>=0&&y>=0){var p=Math.sqrt(_),T=Math.sqrt(y);return[d-T,d-p,d+p,d+T]}if(_>=0&&y<0)return m=Math.sqrt(_),[d-m,d+m];if(_<0&&y>=0)return m=Math.sqrt(y),[d-m,d+m]}return[]}if(h>0){var R=Math.sqrt(h),A=(s+h-c/R)/2,N=(s+h+c/R)/2,S=r.computeRealRoots(1,R,A),M=r.computeRealRoots(1,-R,N);return 0!==S.length?(S[0]+=d,S[1]+=d,0!==M.length?(M[0]+=d,M[1]+=d,S[1]<=M[0]?[S[0],S[1],M[0],M[1]]:M[1]<=S[0]?[M[0],M[1],S[0],S[1]]:S[0]>=M[0]&&S[1]<=M[1]?[M[0],S[0],S[1],M[1]]:M[0]>=S[0]&&M[1]<=S[1]?[S[0],M[0],M[1],S[1]]:S[0]>M[0]&&S[0]<M[1]?[M[0],S[0],M[1],S[1]]:[S[0],M[0],S[1],M[1]]):S):0!==M.length?(M[0]+=d,M[1]+=d,M):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,f=i*t+s-4*o,d=c*o-i*a*t+u,h=e.computeRealRoots(1,l,f,d);if(h.length>0){var E,m,_=h[0],y=a-_,p=y*y,T=t/2,R=y/2,A=p-4*o,N=p+4*Math.abs(o),S=c-4*_,M=c+4*Math.abs(_);if(_<0||A*M<S*N){var I=Math.sqrt(S);E=I/2,m=0===I?0:(t*R-i)/I}else{var O=Math.sqrt(A);E=0===O?0:(t*R-i)/O,m=O/2}var v,g;0===T&&0===E?(v=0,g=0):n.sign(T)===n.sign(E)?(v=T+E,g=_/v):(g=T-E,v=_/g);var x,w;0===R&&0===m?(x=0,w=0):n.sign(R)===n.sign(m)?(x=R+m,w=o/x):(w=R-m,x=o/w);var C=r.computeRealRoots(1,v,x),P=r.computeRealRoots(1,g,w);if(0!==C.length)return 0!==P.length?C[1]<=P[0]?[C[0],C[1],P[0],P[1]]:P[1]<=C[0]?[P[0],P[1],C[0],C[1]]:C[0]>=P[0]&&C[1]<=P[1]?[P[0],C[0],C[1],P[1]]:P[0]>=C[0]&&P[1]<=C[1]?[C[0],P[0],P[1],C[1]]:C[0]>P[0]&&C[0]<P[1]?[P[0],C[0],P[1],C[1]]:[C[0],P[0],C[1],P[1]]:C;if(0!==P.length)return P}return[]}var o={};return o.computeDiscriminant=function(e,t,n,r,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=n*n,l=c*n,f=r*r,d=f*r,h=a*a,E=h*a,m=u*c*f-4*s*d-4*e*l*f+18*e*t*n*d-27*i*f*f+256*o*E+a*(18*s*n*r-4*u*l+16*e*c*c-80*e*t*c*r-6*e*u*f+144*i*n*f)+h*(144*e*u*n-27*u*u-128*i*c-192*i*t*r);return m},o.computeRealRoots=function(t,r,o,u,s){if(Math.abs(t)<n.EPSILON15)return e.computeRealRoots(r,o,u,s);var c=r/t,l=o/t,f=u/t,d=s/t,h=c<0?1:0;switch(h+=l<0?h+1:h,h+=f<0?h+1:h,h+=d<0?h+1:h){case 0:return a(c,l,f,d);case 1:return i(c,l,f,d);case 2:return i(c,l,f,d);case 3:return a(c,l,f,d);case 4:return a(c,l,f,d);case 5:return i(c,l,f,d);case 6:return a(c,l,f,d);case 7:return a(c,l,f,d);case 8:return i(c,l,f,d);case 9:return a(c,l,f,d);case 10:return a(c,l,f,d);case 11:return i(c,l,f,d);case 12:return a(c,l,f,d);case 13:return a(c,l,f,d);case 14:return a(c,l,f,d);case 15:return a(c,l,f,d);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=e.clone(t(r,e.ZERO)),e.equals(r,e.ZERO)||e.normalize(r,r),this.origin=e.clone(t(n,e.ZERO)),this.direction=r}return a.getPoint=function(t,r,a){return n(a)||(a=new e),a=e.multiplyByScalar(t.direction,r,a),e.add(t.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,n,r,a,i,o,u,s,c,l){"use strict";function f(e,t,n,r){var a=t*t-4*e*n;if(!(a<0)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return u<s?(r.root0=u,r.root1=s):(r.root0=s,r.root1=u),r}var c=-t/(2*e);if(0!==c)return r.root0=r.root1=c,r}}function d(t,n,a){r(a)||(a=new i);var o=t.origin,u=t.direction,s=n.center,c=n.radius*n.radius,l=e.subtract(o,s,p),d=e.dot(u,u),h=2*e.dot(u,l),E=e.magnitudeSquared(l)-c,m=f(d,h,E,N);if(r(m))return a.start=m.root0,a.stop=m.root1,a}function h(e,t,n){var r=e+t;return o.sign(e)!==o.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))<n?0:r}function E(t,n,r,a,i){var l,f=a*a,d=i*i,E=(t[u.COLUMN1ROW1]-t[u.COLUMN2ROW2])*d,m=i*(a*h(t[u.COLUMN1ROW0],t[u.COLUMN0ROW1],o.EPSILON15)+n.y),_=t[u.COLUMN0ROW0]*f+t[u.COLUMN2ROW2]*d+a*n.x+r,y=d*h(t[u.COLUMN2ROW1],t[u.COLUMN1ROW2],o.EPSILON15),p=i*(a*h(t[u.COLUMN2ROW0],t[u.COLUMN0ROW2])+n.z),T=[];if(0===p&&0===y){if(l=s.computeRealRoots(E,m,_),0===l.length)return T;var R=l[0],A=Math.sqrt(Math.max(1-R*R,0));if(T.push(new e(a,i*R,i*-A)),T.push(new e(a,i*R,i*A)),2===l.length){var N=l[1],S=Math.sqrt(Math.max(1-N*N,0));T.push(new e(a,i*N,i*-S)),T.push(new e(a,i*N,i*S))}return T}var M=p*p,I=y*y,O=E*E,v=p*y,g=O+I,x=2*(m*E+v),w=2*_*E+m*m-I+M,C=2*(_*m-v),P=_*_-M;if(0===g&&0===x&&0===w&&0===C)return T;l=c.computeRealRoots(g,x,w,C,P);var U=l.length;if(0===U)return T;for(var D=0;D<U;++D){var L,F=l[D],z=F*F,B=Math.max(1-z,0),b=Math.sqrt(B);L=o.sign(E)===o.sign(_)?h(E*z+_,m*F,o.EPSILON12):o.sign(_)===o.sign(m*F)?h(E*z,m*F+_,o.EPSILON12):h(E*z+m*F,_,o.EPSILON12);var q=h(y*F,p,o.EPSILON15),G=L*q;G<0?T.push(new e(a,i*F,i*b)):G>0?T.push(new e(a,i*F,i*-b)):0!==b?(T.push(new e(a,i*F,i*-b)),T.push(new e(a,i*F,i*b)),++D):T.push(new e(a,i*F,i*b))}return T}var m={};m.rayPlane=function(t,n,a){r(a)||(a=new e);var i=t.origin,u=t.direction,s=n.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON15)){var l=(-n.distance-e.dot(s,i))/c;if(!(l<0))return a=e.multiplyByScalar(u,l,a),e.add(i,a,a)}};var _=new e,y=new e,p=new e,T=new e,R=new e;m.rayTriangleParametric=function(t,r,a,i,u){u=n(u,!1);var s,c,l,f,d,h=t.origin,E=t.direction,m=e.subtract(a,r,_),A=e.subtract(i,r,y),N=e.cross(E,A,p),S=e.dot(m,N);if(u){if(S<o.EPSILON6)return;if(s=e.subtract(h,r,T),l=e.dot(s,N),l<0||l>S)return;if(c=e.cross(s,m,R),f=e.dot(E,c),f<0||l+f>S)return;d=e.dot(A,c)/S}else{if(Math.abs(S)<o.EPSILON6)return;var M=1/S;if(s=e.subtract(h,r,T),l=e.dot(s,N)*M,l<0||l>1)return;if(c=e.cross(s,m,R),f=e.dot(E,c)*M,f<0||l+f>1)return;d=e.dot(A,c)*M}return d},m.rayTriangle=function(t,n,a,i,o,u){var s=m.rayTriangleParametric(t,n,a,i,o);if(r(s)&&!(s<0))return r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var A=new l;m.lineSegmentTriangle=function(t,n,a,i,o,u,s){var c=A;e.clone(t,c.origin),e.subtract(n,t,c.direction),e.normalize(c.direction,c.direction);var l=m.rayTriangleParametric(c,a,i,o,u);if(!(!r(l)||l<0||l>e.distance(t,n)))return r(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var N={root0:0,root1:0};m.raySphere=function(e,t,n){if(n=d(e,t,n),r(n)&&!(n.stop<0))return n.start=Math.max(n.start,0),n};var S=new l;m.lineSegmentSphere=function(t,n,a,i){var o=S;e.clone(t,o.origin);var u=e.subtract(n,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),i=d(o,a,i),!(!r(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var M=new e,I=new e;m.rayEllipsoid=function(t,n){var r,a,o,u,s,c=n.oneOverRadii,l=e.multiplyComponents(c,t.origin,M),f=e.multiplyComponents(c,t.direction,I),d=e.magnitudeSquared(l),h=e.dot(l,f);if(d>1){if(h>=0)return;var E=h*h;if(r=d-1,a=e.magnitudeSquared(f),o=a*r,E<o)return;if(E>o){u=h*h-o,s=-h+Math.sqrt(u);var m=s/a,_=r/s;return m<_?new i(m,_):{start:_,stop:m}}var y=Math.sqrt(r/a);return new i(y,y)}return d<1?(r=d-1,a=e.magnitudeSquared(f),o=a*r,u=h*h-o,s=-h+Math.sqrt(u),new i(0,s/a)):h<0?(a=e.magnitudeSquared(f),new i(0,-h/a)):void 0};var O=new e,v=new e,g=new e,x=new e,w=new e,C=new u,P=new u,U=new u,D=new u,L=new u,F=new u,z=new u,B=new e,b=new e,q=new t;m.grazingAltitudeLocation=function(t,n){var a=t.origin,i=t.direction;if(!e.equals(a,e.ZERO)){var s=n.geodeticSurfaceNormal(a,O);if(e.dot(i,s)>=0)return a}var c=r(this.rayEllipsoid(t,n)),l=n.transformPositionToScaledSpace(i,O),f=e.normalize(l,l),d=e.mostOrthogonalAxis(l,x),h=e.normalize(e.cross(d,f,v),v),m=e.normalize(e.cross(f,h,g),g),_=C;_[0]=f.x,_[1]=f.y,_[2]=f.z,_[3]=h.x,_[4]=h.y,_[5]=h.z,_[6]=m.x,_[7]=m.y,_[8]=m.z;var y=u.transpose(_,P),p=u.fromScale(n.radii,U),T=u.fromScale(n.oneOverRadii,D),R=L;R[0]=0,R[1]=-i.z,R[2]=i.y,R[3]=i.z,R[4]=0,R[5]=-i.x,R[6]=-i.y,R[7]=i.x,R[8]=0;var A,N,S=u.multiply(u.multiply(y,T,F),R,F),M=u.multiply(u.multiply(S,p,z),_,z),I=u.multiplyByVector(S,a,w),G=E(M,e.negate(I,O),0,0,1),W=G.length;if(W>0){for(var X=e.clone(e.ZERO,b),V=Number.NEGATIVE_INFINITY,H=0;H<W;++H){A=u.multiplyByVector(p,u.multiplyByVector(_,G[H],B),B);var Y=e.normalize(e.subtract(A,a,x),x),k=e.dot(Y,i);k>V&&(V=k,X=e.clone(A,X))}var j=n.cartesianToCartographic(X,q);return V=o.clamp(V,0,1),N=e.magnitude(e.subtract(X,a,x))*Math.sqrt(1-V*V),N=c?-N:N,j.height=N,n.cartographicToCartesian(j,new e)}};var G=new e;return m.lineSegmentPlane=function(t,n,a,i){r(i)||(i=new e);var u=e.subtract(n,t,G),s=a.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON6)){var l=e.dot(s,t),f=-(a.distance+l)/c;if(!(f<0||f>1))return e.multiplyByScalar(u,f,i),e.add(t,i,i),i}},m.trianglePlaneIntersection=function(t,n,r,a){var i=a.normal,o=a.distance,u=e.dot(i,t)+o<0,s=e.dot(i,n)+o<0,c=e.dot(i,r)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var f,d;if(1!==l&&2!==l||(f=new e,d=new e),1===l){if(u)return m.lineSegmentPlane(t,n,a,f),m.lineSegmentPlane(t,r,a,d),{positions:[t,n,r,f,d],indices:[0,3,4,1,2,4,1,4,3]};if(s)return m.lineSegmentPlane(n,r,a,f),m.lineSegmentPlane(n,t,a,d),{positions:[t,n,r,f,d],indices:[1,3,4,2,0,4,2,4,3]};if(c)return m.lineSegmentPlane(r,t,a,f),m.lineSegmentPlane(r,n,a,d),{positions:[t,n,r,f,d],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return m.lineSegmentPlane(n,t,a,f),m.lineSegmentPlane(r,t,a,d),{positions:[t,n,r,f,d],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return m.lineSegmentPlane(r,n,a,f),m.lineSegmentPlane(t,n,a,d),{positions:[t,n,r,f,d],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return m.lineSegmentPlane(t,r,a,f),m.lineSegmentPlane(n,r,a,d),{positions:[t,n,r,f,d],indices:[0,1,4,0,4,3,2,3,4]}}},m}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";function a(t,n){this.normal=e.clone(t),this.distance=n}a.fromPointNormal=function(n,r,i){var o=-e.dot(r,n);return t(i)?(e.clone(r,i.normal),i.distance=o,i):new a(r,o)};var i=new e;return a.fromCartesian4=function(n,r){var o=e.fromCartesian4(n,i),u=n.w;return t(r)?(e.clone(o,r.normal),r.distance=u,r):new a(o,u)},a.getPointDistance=function(t,n){return e.dot(t.normal,n)+t.distance},a.ORIGIN_XY_PLANE=r(new a(e.UNIT_Z,0)),a.ORIGIN_YZ_PLANE=r(new a(e.UNIT_X,0)),a.ORIGIN_ZX_PLANE=r(new a(e.UNIT_Y,0)),a}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,n,r,a){return t(e).then(n,r,a)}function t(e){var t,n;return e instanceof r?t=e:u(e)?(n=o(),e.then(function(e){n.resolve(e)},function(e){n.reject(e)},function(e){n.progress(e)}),t=n.promise):t=a(e),t}function n(t){return e(t,i)}function r(e){this.then=e}function a(e){var n=new r(function(n){try{return t(n?n(e):e)}catch(e){return i(e)}});return n}function i(e){var n=new r(function(n,r){try{return r?t(r(e)):i(e)}catch(e){return i(e)}});return n}function o(){function e(e,t,n){return d(e,t,n)}function n(e){return E(e)}function a(e){return E(i(e))}function u(e){return h(e)}var s,c,l,f,d,h,E;return c=new r(e),s={then:e,resolve:n,reject:a,progress:u,promise:c,resolver:{resolve:n,reject:a,progress:u}},l=[],f=[],d=function(e,t,n){var r,a;return r=o(),a="function"==typeof n?function(e){try{r.progress(n(e))}catch(e){r.progress(e)}}:function(e){r.progress(e)},l.push(function(n){n.then(e,t).then(r.resolve,r.reject,a)}),f.push(a),r.promise},h=function(e){return m(f,e),e},E=function(e){return e=t(e),d=e.then,E=t,h=y,m(l,e),f=l=A,e},s}function u(e){return e&&"function"==typeof e.then}function s(t,n,r,a,i){return _(2,arguments),e(t,function(t){function u(e){m(e)}function s(e){E(e)}var c,l,f,d,h,E,m,_,p,T;if(p=t.length>>>0,c=Math.max(0,Math.min(n,p)),f=[],l=p-c+1,d=[],h=o(),c)for(_=h.progress,m=function(e){d.push(e),--l||(E=m=y,h.reject(d))},E=function(e){f.push(e),--c||(E=m=y,h.resolve(f))},T=0;T<p;++T)T in t&&e(t[T],s,u,_);else h.resolve(f);return h.then(r,a,i)})}function c(e,t,n,r){function a(e){return t?t(e[0]):e[0]}return s(e,1,a,n,r)}function l(e,t,n,r){return _(1,arguments),d(e,p).then(t,n,r)}function f(){return d(arguments,p)}function d(t,n){return e(t,function(t){var r,a,i,u,s,c;if(i=a=t.length>>>0,r=[],c=o(),i)for(u=function(t,a){e(t,n).then(function(e){r[a]=e,--i||c.resolve(r)},c.reject)},s=0;s<a;s++)s in t?u(t[s],s):--i;else c.resolve(r);return c.promise})}function h(t,n){var r=R.call(arguments,1);return e(t,function(t){var a;return a=t.length,r[0]=function(t,r,i){return e(t,function(t){return e(r,function(e){return n(t,e,i,a)})})},T.apply(t,r)})}function E(t,n,r){var a=arguments.length>2;return e(t,function(e){return e=a?r:e,n.resolve(e),e},function(e){return n.reject(e),i(e)},n.progress)}function m(e,t){for(var n,r=0;n=e[r++];)n(t)}function _(e,t){for(var n,r=t.length;r>e;)if(n=t[--r],null!=n&&"function"!=typeof n)throw new Error("arg "+r+" must be a function")}function y(){}function p(e){return e}var T,R,A;return e.defer=o,e.resolve=t,e.reject=n,e.join=f,e.all=l,e.map=d,e.reduce=h,e.any=c,e.some=s,e.chain=E,e.isPromise=u,r.prototype={ +always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(A,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return l(t,function(t){return e.apply(A,t)})})}},R=[].slice,T=[].reduce||function(e){var t,n,r,a,i;if(i=0,t=Object(this),a=t.length>>>0,n=arguments,n.length<=1)for(;;){if(i in t){r=t[i++];break}if(++i>=a)throw new TypeError}else r=n[1];for(;i<a;++i)i in t&&(r=e(r,t[i],i,t));return r},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/binarySearch",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e,t,n){for(var r,a,i=0,o=e.length-1;i<=o;)if(r=~~((i+o)/2),a=n(e[r],t),a<0)i=r+1;else{if(!(a>0))return r;o=r-1}return~(o+1)}return n}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,n,r,a){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=r,this.ut1MinusUtc=a}return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,n=0,r=t[n++],a=function(e,t,n,r){n||(n=" ");var a=e.length>=t?"":Array(1+t-e.length>>>0).join(n);return r?e+a:a+e},i=function(e,t,n,r,i,o){var u=r-e.length;return u>0&&(e=n||!i?a(e,r,o,n):e.slice(0,t.length)+a("",u,"0",!0)+e.slice(t.length)),e},o=function(e,t,n,r,o,u,s){var c=e>>>0;return n=n&&c&&{2:"0b",8:"0",16:"0x"}[t]||"",e=n+a(c.toString(t),u||0,"0",!1),i(e,n,r,o,s)},u=function(e,t,n,r,a,o){return null!=r&&(e=e.slice(0,r)),i(e,"",t,n,a,o)},s=function(e,r,s,c,l,f,d){var h,E,m,_,y;if("%%"==e)return"%";for(var p=!1,T="",R=!1,A=!1,N=" ",S=s.length,M=0;s&&M<S;M++)switch(s.charAt(M)){case" ":T=" ";break;case"+":T="+";break;case"-":p=!0;break;case"'":N=s.charAt(M+1);break;case"0":R=!0;break;case"#":A=!0}if(c=c?"*"==c?+t[n++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,c<0&&(c=-c,p=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(f=f?"*"==f?+t[n++]:"*"==f.charAt(0)?+t[f.slice(1,-1)]:+f:"fFeE".indexOf(d)>-1?6:"d"==d?0:void 0,y=r?t[r.slice(0,-1)]:t[n++],d){case"s":return u(String(y),p,c,f,R,N);case"c":return u(String.fromCharCode(+y),p,c,f,R);case"b":return o(y,2,A,p,c,f,R);case"o":return o(y,8,A,p,c,f,R);case"x":return o(y,16,A,p,c,f,R);case"X":return o(y,16,A,p,c,f,R).toUpperCase();case"u":return o(y,10,A,p,c,f,R);case"i":case"d":return h=+y||0,h=Math.round(h-h%1),E=h<0?"-":T,y=E+a(String(Math.abs(h)),f,"0",!1),i(y,E,p,c,R);case"e":case"E":case"f":case"F":case"g":case"G":return h=+y,E=h<0?"-":T,m=["toExponential","toFixed","toPrecision"]["efg".indexOf(d.toLowerCase())],_=["toString","toUpperCase"]["eEfFgG".indexOf(d)%2],y=E+Math.abs(h)[m](f),i(y,E,p,c,R)[_]();default:return e}};return r.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,n,r,a,i,o,u){this.year=e,this.month=t,this.day=n,this.hour=r,this.minute=a,this.second=i,this.millisecond=o,this.isLeapSecond=u}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e(t)}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t){return m.compare(e.julianDate,t.julianDate)}function f(e){T.julianDate=e;var n=m.leapSeconds,r=t(n,T,l);r<0&&(r=~r),r>=n.length&&(r=n.length-1);var a=n[r].offset;if(r>0){var i=m.secondsDifference(n[r].julianDate,e);i>a&&(r--,a=n[r].offset)}m.addSeconds(e,a,e)}function d(e,n){T.julianDate=e;var r=m.leapSeconds,a=t(r,T,l);if(a<0&&(a=~a),0===a)return m.addSeconds(e,-r[0].offset,n);if(a>=r.length)return m.addSeconds(e,-r[a-1].offset,n);var i=m.secondsDifference(r[a].julianDate,e);return 0===i?m.addSeconds(e,-r[a].offset,n):i<=1?void 0:m.addSeconds(e,-r[--a].offset,n)}function h(e,t,n){var r=t/s.SECONDS_PER_DAY|0;return e+=r,t-=s.SECONDS_PER_DAY*r,t<0&&(e--,t+=s.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function E(e,t,n,r,a,i,o){var u=(t-14)/12|0,c=e+4800+u,l=(1461*c/4|0)+(367*(t-2-12*u)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;r-=12,r<0&&(r+=24);var f=i+(r*s.SECONDS_PER_HOUR+a*s.SECONDS_PER_MINUTE+o*s.SECONDS_PER_MILLISECOND);return f>=43200&&(l-=1),[l,f]}function m(e,t,r){this.dayNumber=void 0,this.secondsOfDay=void 0,e=n(e,0),t=n(t,0),r=n(r,c.UTC);var a=0|e;t+=(e-a)*s.SECONDS_PER_DAY,h(a,t,this),r===c.UTC&&f(this)}var _=new i,y=[31,28,31,30,31,30,31,31,30,31,30,31],p=29,T=new u,R=/^(\d{4})$/,A=/^(\d{4})-(\d{2})$/,N=/^(\d{4})-?(\d{3})$/,S=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,M=/^(\d{4})-?(\d{2})-?(\d{2})$/,I=/([Z+\-])?(\d{2})?:?(\d{2})?$/,O=/^(\d{2})(\.\d+)?/.source+I.source,v=/^(\d{2}):?(\d{2})(\.\d+)?/.source+I.source,g=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+I.source;m.fromDate=function(e,t){var n=E(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r(t)?(h(n[0],n[1],t),f(t),t):new m(n[0],n[1],c.UTC)},m.fromIso8601=function(e,t){e=e.replace(",",".");var n,a,i,u=e.split("T"),s=1,l=1,d=0,_=0,T=0,I=0,x=u[0],w=u[1];if(u=x.match(M),null!==u)n=+u[1],s=+u[2],l=+u[3];else if(u=x.match(A),null!==u)n=+u[1],s=+u[2];else if(u=x.match(R),null!==u)n=+u[1];else{var C;if(u=x.match(N),null!==u)n=+u[1],C=+u[2],i=o(n);else if(u=x.match(S),null!==u){n=+u[1];var P=+u[2],U=+u[3]||0,D=new Date(Date.UTC(n,0,4));C=7*P+U-D.getUTCDay()-3}a=new Date(Date.UTC(n,0,1)),a.setUTCDate(C),s=a.getUTCMonth()+1,l=a.getUTCDate()}i=o(n);var L;if(r(w)){u=w.match(g),null!==u?(d=+u[1],_=+u[2],T=+u[3],I=1e3*+(u[4]||0),L=5):(u=w.match(v),null!==u?(d=+u[1],_=+u[2],T=60*+(u[3]||0),L=4):(u=w.match(O),null!==u&&(d=+u[1],_=60*+(u[2]||0),L=3)));var F=u[L],z=+u[L+1],B=+(u[L+2]||0);switch(F){case"+":d-=z,_-=B;break;case"-":d+=z,_+=B;break;case"Z":break;default:_+=new Date(Date.UTC(n,s-1,l,d,_)).getTimezoneOffset()}}else _+=new Date(n,s-1,l).getTimezoneOffset();var b=60===T;for(b&&T--;_>=60;)_-=60,d++;for(;d>=24;)d-=24,l++;for(a=i&&2===s?p:y[s-1];l>a;)l-=a,s++,s>12&&(s-=12,n++),a=i&&2===s?p:y[s-1];for(;_<0;)_+=60,d--;for(;d<0;)d+=24,l--;for(;l<1;)s--,s<1&&(s+=12,n--),a=i&&2===s?p:y[s-1],l+=a;var q=E(n,s,l,d,_,T,I);return r(t)?(h(q[0],q[1],t),f(t)):t=new m(q[0],q[1],c.UTC),b&&m.addSeconds(t,1,t),t},m.now=function(e){return m.fromDate(new Date,e)};var x=new m(0,0,c.TAI);return m.toGregorianDate=function(e,t){var n=!1,a=d(e,x);r(a)||(m.addSeconds(e,-1,x),a=d(x,x),n=!0);var o=a.dayNumber,u=a.secondsOfDay;u>=43200&&(o+=1);var c=o+68569|0,l=4*c/146097|0;c=c-((146097*l+3)/4|0)|0;var f=4e3*(c+1)/1461001|0;c=c-(1461*f/4|0)+31|0;var h=80*c/2447|0,E=c-(2447*h/80|0)|0;c=h/11|0;var _=h+2-12*c|0,y=100*(l-49)+f+c|0,p=u/s.SECONDS_PER_HOUR|0,T=u-p*s.SECONDS_PER_HOUR,R=T/s.SECONDS_PER_MINUTE|0;T-=R*s.SECONDS_PER_MINUTE;var A=0|T,N=(T-A)/s.SECONDS_PER_MILLISECOND;return p+=12,p>23&&(p-=24),n&&(A+=1),r(t)?(t.year=y,t.month=_,t.day=E,t.hour=p,t.minute=R,t.second=A,t.millisecond=N,t.isLeapSecond=n,t):new i(y,_,E,p,R,A,N,n)},m.toDate=function(e){var t=m.toGregorianDate(e,_),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))},m.toIso8601=function(t,n){var a,i=m.toGregorianDate(t,i);return r(n)||0===i.millisecond?r(n)&&0!==n?(a=(.01*i.millisecond).toFixed(n).replace(".","").slice(0,n),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",i.year,i.month,i.day,i.hour,i.minute,i.second):(a=(.01*i.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a))},m.clone=function(e,t){if(r(e))return r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new m(e.dayNumber,e.secondsOfDay,c.TAI)},m.compare=function(e,t){var n=e.dayNumber-t.dayNumber;return 0!==n?n:e.secondsOfDay-t.secondsOfDay},m.equals=function(e,t){return e===t||r(e)&&r(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},m.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(m.secondsDifference(e,t))<=n},m.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},m.secondsDifference=function(e,t){var n=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return n+(e.secondsOfDay-t.secondsOfDay)},m.daysDifference=function(e,t){var n=e.dayNumber-t.dayNumber,r=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return n+r},m.computeTaiMinusUtc=function(e){T.julianDate=e;var n=m.leapSeconds,r=t(n,T,l);return r<0&&(r=~r,--r,r<0&&(r=0)),n[r].offset},m.addSeconds=function(e,t,n){return h(e.dayNumber,e.secondsOfDay+t,n)},m.addMinutes=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return h(e.dayNumber,r,n)},m.addHours=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return h(e.dayNumber,r,n)},m.addDays=function(e,t,n){var r=e.dayNumber+t;return h(r,e.secondsOfDay,n)},m.lessThan=function(e,t){return m.compare(e,t)<0},m.lessThanOrEquals=function(e,t){return m.compare(e,t)<=0},m.greaterThan=function(e,t){return m.compare(e,t)>0},m.greaterThanOrEquals=function(e,t){return m.compare(e,t)>=0},m.prototype.clone=function(e){return m.clone(this,e)},m.prototype.equals=function(e){return m.equals(this,e)},m.prototype.equalsEpsilon=function(e,t){return m.equalsEpsilon(this,e,t)},m.prototype.toString=function(){return m.toIso8601(this)},m.leapSeconds=[new u(new m(2441317,43210,c.TAI),10),new u(new m(2441499,43211,c.TAI),11),new u(new m(2441683,43212,c.TAI),12),new u(new m(2442048,43213,c.TAI),13),new u(new m(2442413,43214,c.TAI),14),new u(new m(2442778,43215,c.TAI),15),new u(new m(2443144,43216,c.TAI),16),new u(new m(2443509,43217,c.TAI),17),new u(new m(2443874,43218,c.TAI),18),new u(new m(2444239,43219,c.TAI),19),new u(new m(2444786,43220,c.TAI),20),new u(new m(2445151,43221,c.TAI),21),new u(new m(2445516,43222,c.TAI),22),new u(new m(2446247,43223,c.TAI),23),new u(new m(2447161,43224,c.TAI),24),new u(new m(2447892,43225,c.TAI),25),new u(new m(2448257,43226,c.TAI),26),new u(new m(2448804,43227,c.TAI),27),new u(new m(2449169,43228,c.TAI),28),new u(new m(2449534,43229,c.TAI),29),new u(new m(2450083,43230,c.TAI),30),new u(new m(2450630,43231,c.TAI),31),new u(new m(2451179,43232,c.TAI),32),new u(new m(2453736,43233,c.TAI),33),new u(new m(2454832,43234,c.TAI),34),new u(new m(2456109,43235,c.TAI),35),new u(new m(2457204,43236,c.TAI),36),new u(new m(2457754,43237,c.TAI),37)],m}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(n,r){if(null===n||"object"!=typeof n)return n;r=e(r,!1);var a=new n.constructor;for(var i in n)if(n.hasOwnProperty(i)){var o=n[i];r&&(o=t(o,r)),a[i]=o}return a}return t}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var n=e.split("\r\n"),r=0;r<n.length;++r){var a=n[r],i=a.indexOf(": ");if(i>0){var o=a.substring(0,i),u=a.substring(i+2);t[o]=u}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function n(e,n,r){this.statusCode=e,this.response=n,this.responseHeaders=r,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return n.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},n}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var n=r.exec(t);this.scheme=n[1],this.authority=n[2],this.path=n[3],this.query=n[4],this.fragment=n[5]}}function t(e){var t=unescape(e);return i.test(t)?t:e.toUpperCase()}function n(e,t,n,r){return(t||"")+n.toLowerCase()+(r||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var r=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(o,n).replace(a,t)),this.path&&(this.path=this.path.replace(a,t)),this.query&&(this.query=this.query.replace(a,t)),this.fragment&&(this.fragment=this.fragment.replace(a,t))};var a=/%[0-9a-z]{2}/gi,i=/[a-zA-Z0-9\-\._~]/,o=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var n=new e;return this.scheme?(n.scheme=this.scheme,n.authority=this.authority,n.path=this.path,n.query=this.query):(n.scheme=t.scheme,this.authority?(n.authority=this.authority,n.path=this.path,n.query=this.query):(n.authority=t.authority,""==this.path?(n.path=t.path,n.query=this.query||t.query):("/"==this.path.charAt(0)?(n.path=this.path,n.removeDotSegments()):(t.authority&&""==t.path?n.path="/"+this.path:n.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,n.removeDotSegments()),n.query=this.query))),n.fragment=this.fragment,n},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),n=[],r=""==t[0];r&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?n.pop():"."!=e&&n.push(e);"."!=e&&".."!=e||n.push(""),r&&n.unshift(""),this.path=n.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n){var r=new e(n);r.normalize();var a=r.getAuthority();if(t(a)){if(a.indexOf("@")!==-1){var i=a.split("@");a=i[1]}if(a.indexOf(":")===-1){var o=r.getScheme();if(t(o)||(o=window.location.protocol,o=o.substring(0,o.length-1)),"http"===o)a+=":80";else{if("https"!==o)return;a+=":443"}}return a}}var a={},i={};return a.add=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])||(i[r]=!0)},a.remove=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])&&delete i[r]},a.contains=function(e){var n=r(e);return!(!t(n)||!t(i[n]))},a.clear=function(){i={}},a}),define("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,n,r,a,i,o){"use strict";function u(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,a=t(n.method,"GET"),i=n.data,o=n.headers,s=n.overrideMimeType;return e(n.url,function(t){var n=e.defer();return u.load(t,r,a,i,o,n,s),n.promise})}function s(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function c(e,t){for(var n=s(e,t),r=new ArrayBuffer(n.length),a=new Uint8Array(r),i=0;i<n.length;i++)a[i]=n.charCodeAt(i);return r}function l(e,n){n=t(n,"");var r=e[1],a=!!e[2],i=e[3];switch(n){case"":case"text":return s(a,i);case"arraybuffer":return c(a,i);case"blob":var o=c(a,i);return new Blob([o],{type:r});case"document":var u=new DOMParser;return u.parseFromString(s(a,i),r);case"json":return JSON.parse(s(a,i))}}var f=/^data:(.*?)(;base64)?,(.*)$/;return u.load=function(e,t,r,u,s,c,d){var h=f.exec(e);if(null!==h)return void c.resolve(l(h,t));var E=new XMLHttpRequest;if(o.contains(e)&&(E.withCredentials=!0),n(d)&&n(E.overrideMimeType)&&E.overrideMimeType(d),E.open(r,e,!0),n(s))for(var m in s)s.hasOwnProperty(m)&&E.setRequestHeader(m,s[m]);n(t)&&(E.responseType=t),E.onload=function(){if(E.status<200||E.status>=300)return void c.reject(new a(E.status,E.response,E.getAllResponseHeaders()));var e=E.response,r=E.responseType;if(!n(e)||n(t)&&r!==t)if("json"===t&&"string"==typeof e)try{c.resolve(JSON.parse(e))}catch(e){c.reject(e)}else(""===r||"document"===r)&&n(E.responseXML)&&E.responseXML.hasChildNodes()?c.resolve(E.responseXML):""!==r&&"text"!==r||!n(E.responseText)?c.reject(new i("Invalid XMLHttpRequest response type.")):c.resolve(E.responseText);else c.resolve(e)},E.onerror=function(e){c.reject(new a)},E.send(u)},u.defaultLoad=u.load,u}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,n){return e({url:t,headers:n})}return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";function a(n,a){return t(a)?t(a.Accept)||(a=e(a),a.Accept=i.Accept):a=i,r(n,a).then(function(e){return JSON.parse(e)})}var i={Accept:"application/json,*/*;q=0.01"};return a}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function d(t){if(t=n(t,n.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=n(t.addNewLeapSeconds,!0),r(t.data))E(this,t.data);else if(r(t.url)){var a=this;this._downloadPromise=e(s(t.url),function(e){E(a,e)},function(){a._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else E(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function h(e,t){return o.compare(e.julianDate,t)}function E(e,n){if(!r(n.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!r(n.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var a=n.columnNames.indexOf("modifiedJulianDateUtc"),i=n.columnNames.indexOf("xPoleWanderRadians"),s=n.columnNames.indexOf("yPoleWanderRadians"),c=n.columnNames.indexOf("ut1MinusUtcSeconds"),d=n.columnNames.indexOf("xCelestialPoleOffsetRadians"),E=n.columnNames.indexOf("yCelestialPoleOffsetRadians"),m=n.columnNames.indexOf("taiMinusUtcSeconds");if(a<0||i<0||s<0||c<0||d<0||E<0||m<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var _=e._samples=n.samples,y=e._dates=[];e._dateColumn=a,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=d,e._yCelestialPoleOffsetRadiansColumn=E,e._taiMinusUtcSecondsColumn=m,e._columnCount=n.columnNames.length,e._lastIndex=void 0;for(var p,T=e._addNewLeapSeconds,R=0,A=_.length;R<A;R+=e._columnCount){var N=_[R+a],S=_[R+m],M=N+l.MODIFIED_JULIAN_DATE_DIFFERENCE,I=new o(M,S,f.TAI);if(y.push(I),T){if(S!==p&&r(p)){var O=o.leapSeconds,v=t(O,I,h);if(v<0){var g=new u(I,S);O.splice(~v,0,g)}}p=S}}}function m(e,t,n,r,a){var i=n*r;a.xPoleWander=t[i+e._xPoleWanderRadiansColumn],a.yPoleWander=t[i+e._yPoleWanderRadiansColumn],a.xPoleOffset=t[i+e._xCelestialPoleOffsetRadiansColumn],a.yPoleOffset=t[i+e._yCelestialPoleOffsetRadiansColumn],a.ut1MinusUtc=t[i+e._ut1MinusUtcSecondsColumn]}function _(e,t,n){return t+e*(n-t)}function y(e,t,n,r,a,i,u){var s=e._columnCount;if(i>t.length-1)return u.xPoleWander=0,u.yPoleWander=0,u.xPoleOffset=0,u.yPoleOffset=0,u.ut1MinusUtc=0,u;var c=t[a],l=t[i];if(c.equals(l)||r.equals(c))return m(e,n,a,s,u),u;if(r.equals(l))return m(e,n,i,s,u),u;var f=o.secondsDifference(r,c)/o.secondsDifference(l,c),d=a*s,h=i*s,E=n[d+e._ut1MinusUtcSecondsColumn],y=n[h+e._ut1MinusUtcSecondsColumn],p=y-E;if(p>.5||p<-.5){var T=n[d+e._taiMinusUtcSecondsColumn],R=n[h+e._taiMinusUtcSecondsColumn];T!==R&&(l.equals(r)?E=y:y-=R-T)}return u.xPoleWander=_(f,n[d+e._xPoleWanderRadiansColumn],n[h+e._xPoleWanderRadiansColumn]),u.yPoleWander=_(f,n[d+e._yPoleWanderRadiansColumn],n[h+e._yPoleWanderRadiansColumn]),u.xPoleOffset=_(f,n[d+e._xCelestialPoleOffsetRadiansColumn],n[h+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=_(f,n[d+e._yCelestialPoleOffsetRadiansColumn],n[h+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=_(f,E,y),u}return d.NONE=i({getPromiseToLoad:function(){return e()},compute:function(e,t){return r(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new a(0,0,0,0,0),t}}),d.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},d.prototype.compute=function(e,n){if(r(this._samples)){if(r(n)||(n=new a(0,0,0,0,0)),0===this._samples.length)return n.xPoleWander=0,n.yPoleWander=0,n.xPoleOffset=0,n.yPoleOffset=0,n.ut1MinusUtc=0,n;var i=this._dates,u=this._lastIndex,s=0,l=0;if(r(u)){var f=i[u],d=i[u+1],h=o.lessThanOrEquals(f,e),E=!r(d),m=E||o.greaterThanOrEquals(d,e);if(h&&m)return s=u,!E&&d.equals(e)&&++s,l=s+1,y(this,i,this._samples,e,s,l,n),n}var _=t(i,e,o.compare,this._dateColumn);return _>=0?(_<i.length-1&&i[_+1].equals(e)&&++_,s=_,l=_):(l=~_,s=l-1,s<0&&(s=0)),this._lastIndex=s,y(this,i,this._samples,e,s,l,n),n}if(r(this._dataError))throw new c(this._dataError)},d}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(t,n,r){this.heading=e(t,0),this.pitch=e(n,0),this.roll=e(r,0)}return a.fromQuaternion=function(e,n){t(n)||(n=new a);var r=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return n.heading=-Math.atan2(s,u),n.roll=Math.atan2(o,i),n.pitch=-Math.asin(r),n},a.fromDegrees=function(e,n,i,o){return t(o)||(o=new a),o.heading=e*r.RADIANS_PER_DEGREE,o.pitch=n*r.RADIANS_PER_DEGREE,o.roll=i*r.RADIANS_PER_DEGREE,o},a.clone=function(e,n){if(t(e))return t(n)?(n.heading=e.heading,n.pitch=e.pitch,n.roll=e.roll,n):new a(e.heading,e.pitch,e.roll)},a.equals=function(e,n){return e===n||t(e)&&t(n)&&e.heading===n.heading&&e.pitch===n.pitch&&e.roll===n.roll},a.equalsEpsilon=function(e,n,a,i){return e===n||t(e)&&t(n)&&r.equalsEpsilon(e.heading,n.heading,a,i)&&r.equalsEpsilon(e.pitch,n.pitch,a,i)&&r.equalsEpsilon(e.roll,n.roll,a,i)},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,n){return a.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},a}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=t(r,document.location.href);var a=new e(r),i=new e(n);return i.resolve(a).toString()}return a}),define("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(r,a,i){i=t(i,!0),r instanceof e||(r=new e(r)),a instanceof e||(a=new e(a)),n(a.authority)&&!n(a.scheme)&&("undefined"!=typeof document&&n(document.location)&&n(document.location.href)?a.scheme=new e(document.location.href).scheme:a.scheme=r.scheme);var o=r;a.isAbsolute()&&(o=a);var u="";n(o.scheme)&&(u+=o.scheme+":"),n(o.authority)&&(u+="//"+o.authority,""!==o.path&&"/"!==o.path&&(u=u.replace(/\/?$/,"/"),o.path=o.path.replace(/^\/?/g,""))),u+=o===r?i?r.path.replace(/\/?$/,"/")+a.path.replace(/^\/?/g,""):r.path+a.path:a.path;var s=n(r.query),c=n(a.query);s&&c?u+="?"+r.query+"&"+a.query:s&&!c?u+="?"+r.query:!s&&c&&(u+="?"+a.query);var l=n(a.fragment);return n(r.fragment)&&!l?u+="#"+r.fragment:l&&(u+="#"+a.fragment),u}return a}),define("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","./joinUrls","require"],function(e,t,n,r,a,i){"use strict";function o(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;t<n;++t){var r=e[t].getAttribute("src"),a=E.exec(r);if(null!==a)return a[1]}}function u(){if(t(f))return f;var n;return n="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:o(),f=new e(r(n))}function s(e){return i.toUrl("../"+e)}function c(e){return a(u(),e)}function l(e){t(d)||(d=t(i.toUrl)?s:c),t(h)||(h=document.createElement("a"));var n=d(e);return h.href=n,h.href=h.href,h.href}var f,d,h,E=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return l._cesiumScriptRegex=E,l.setBaseUrl=function(t){f=new e(t).resolve(new e(document.location.href))},l}),define("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,n){this.x=e,this.y=t,this.s=n}return e}),define("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){e=n(e,n.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=n(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=n(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new i(this._sampleZeroJulianEphemerisDate,0,u.TAI),this._stepSizeDays=n(e.stepSizeDays,1),this._samplesPerXysFile=n(e.samplesPerXysFile,1e3),this._totalSamples=n(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,r=this._denominators=new Array(t+1),a=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t),s=0;s<=t;++s){r[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;c<=t;++c)c!==s&&(r[s]*=s-c);r[s]=1/r[s]}this._work=new Array(t+1),this._coef=new Array(t+1)}function c(e,t,n){var r=f;return r.dayNumber=t,r.secondsOfDay=n,i.daysDifference(r,e._sampleZeroDateTT)}function l(n,a){if(n._chunkDownloadsInProgress[a])return n._chunkDownloadsInProgress[a];var i=e.defer();n._chunkDownloadsInProgress[a]=i;var u,s=n._xysFileUrlTemplate;return u=r(s)?s.replace("{0}",a):t("Assets/IAU2006_XYS/IAU2006_XYS_"+a+".json"),e(o(u),function(e){n._chunkDownloadsInProgress[a]=!1;for(var t=n._samples,r=e.samples,o=a*n._samplesPerXysFile*3,u=0,s=r.length;u<s;++u)t[o+u]=r[u];i.resolve()}),i.promise}var f=new i(0,0,u.TAI);return s.prototype.preload=function(t,n,r,a){var i=c(this,t,n),o=c(this,r,a),u=i/this._stepSizeDays-this._interpolationOrder/2|0;u<0&&(u=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var f=u/this._samplesPerXysFile|0,d=s/this._samplesPerXysFile|0,h=[],E=f;E<=d;++E)h.push(l(this,E));return e.all(h)},s.prototype.computeXysRadians=function(e,t,n){var i=c(this,e,t);if(!(i<0)){var o=i/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);s<0&&(s=0);var f=s+u;f>=this._totalSamples&&(f=this._totalSamples-1,s=f-u,s<0&&(s=0));var d=!1,h=this._samples;if(r(h[3*s])||(l(this,s/this._samplesPerXysFile|0),d=!0),r(h[3*f])||(l(this,f/this._samplesPerXysFile|0),d=!0),!d){r(n)?(n.x=0,n.y=0,n.s=0):n=new a(0,0,0);var E,m,_=i-s*this._stepSizeDays,y=this._work,p=this._denominators,T=this._coef,R=this._xTable;for(E=0;E<=u;++E)y[E]=_-R[E];for(E=0;E<=u;++E){for(T[E]=1,m=0;m<=u;++m)m!==E&&(T[E]*=y[m]);T[E]*=p[E];var A=3*(s+E);n.x+=T[E]*h[A++],n.y+=T[E]*h[A++],n.s+=T[E]*h[A]}return n}}}},s}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return t(a,{element:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(r.requestFullscreen=a,n=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(r.requestFullscreen=a,n=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?r.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(r.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?r.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(r.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?r.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(r.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),r.fullscreenerror=a)}return n},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[r.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function a(){if(!t(A)&&(A=!1,!d())){var e=/ Chrome\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(A=!0,N=r(e[1]))}return A}function i(){return a()&&N}function o(){if(!t(S)&&(S=!1,!a()&&!d()&&/ Safari\/[\.0-9]+/.test(R.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(S=!0,M=r(e[1]))}return S}function u(){return o()&&M}function s(){if(!t(I)){I=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(R.userAgent);null!==e&&(I=!0,O=r(e[1]),O.isNightly=!!e[2])}return I}function c(){return s()&&O}function l(){if(!t(v)){v=!1;var e;"Microsoft Internet Explorer"===R.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(v=!0,g=r(e[1]))):"Netscape"===R.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(v=!0,g=r(e[1])))}return v}function f(){return l()&&g}function d(){if(!t(x)){x=!1;var e=/ Edge\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(x=!0,w=r(e[1]))}return x}function h(){return d()&&w}function E(){if(!t(C)){C=!1;var e=/Firefox\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(C=!0,P=r(e[1]))}return C}function m(){return t(U)||(U=/Windows/i.test(R.appVersion)),U}function _(){return E()&&P}function y(){return t(D)||(D="undefined"!=typeof PointerEvent&&(!t(R.pointerEnabled)||R.pointerEnabled)),D}function p(){if(!t(F)){ +var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;F=t(n)&&""!==n,F&&(L=n)}return F}function T(){return p()?L:void 0}var R;R="undefined"!=typeof navigator?navigator:{};var A,N,S,M,I,O,v,g,x,w,C,P,U,D,L,F,z={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isEdge:d,edgeVersion:h,isFirefox:E,firefoxVersion:_,isWindows:m,hardwareConcurrency:e(R.hardwareConcurrency,3),supportsPointerEvents:y,supportsImageRenderingPixelated:p,imageRenderingValue:T};return z.supportsFullscreen=function(){return n.supportsFullscreen()},z.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},z.supportsWebWorkers=function(){return"undefined"!=typeof Worker},z}),define("Core/Quaternion",["./Cartesian3","./Check","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math","./Matrix3"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(e,t,r,a){this.x=n(e,0),this.y=n(t,0),this.z=n(r,0),this.w=n(a,0)}var l=new e;c.fromAxisAngle=function(t,n,a){var i=n/2,o=Math.sin(i);l=e.normalize(t,l);var u=l.x*o,s=l.y*o,f=l.z*o,d=Math.cos(i);return r(a)?(a.x=u,a.y=s,a.z=f,a.w=d,a):new c(u,s,f,d)};var f=[1,2,0],d=new Array(3);c.fromRotationMatrix=function(e,t){var n,a,i,o,u,l=e[s.COLUMN0ROW0],h=e[s.COLUMN1ROW1],E=e[s.COLUMN2ROW2],m=l+h+E;if(m>0)n=Math.sqrt(m+1),u=.5*n,n=.5/n,a=(e[s.COLUMN1ROW2]-e[s.COLUMN2ROW1])*n,i=(e[s.COLUMN2ROW0]-e[s.COLUMN0ROW2])*n,o=(e[s.COLUMN0ROW1]-e[s.COLUMN1ROW0])*n;else{var _=f,y=0;h>l&&(y=1),E>l&&E>h&&(y=2);var p=_[y],T=_[p];n=Math.sqrt(e[s.getElementIndex(y,y)]-e[s.getElementIndex(p,p)]-e[s.getElementIndex(T,T)]+1);var R=d;R[y]=.5*n,n=.5/n,u=(e[s.getElementIndex(T,p)]-e[s.getElementIndex(p,T)])*n,R[p]=(e[s.getElementIndex(p,y)]+e[s.getElementIndex(y,p)])*n,R[T]=(e[s.getElementIndex(T,y)]+e[s.getElementIndex(y,T)])*n,a=-R[0],i=-R[1],o=-R[2]}return r(t)?(t.x=a,t.y=i,t.z=o,t.w=u,t):new c(a,i,o,u)};var h=new c;c.fromHeadingPitchRoll=function(t,n,r,a){var i=c.fromAxisAngle(e.UNIT_X,r,h),o=c.fromAxisAngle(e.UNIT_Y,-n,a);a=c.multiply(o,i,o);var u=c.fromAxisAngle(e.UNIT_Z,-t,h);return c.multiply(u,a,a)};var E=new e,m=new e,_=new c,y=new c,p=new c;c.packedLength=4,c.pack=function(e,t,r){return r=n(r,0),t[r++]=e.x,t[r++]=e.y,t[r++]=e.z,t[r]=e.w,t},c.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new c),a.x=e[t],a.y=e[t+1],a.z=e[t+2],a.w=e[t+3],a},c.packedInterpolationLength=3,c.convertPackedArrayForInterpolation=function(e,t,n,r){c.unpack(e,4*n,p),c.conjugate(p,p);for(var a=0,i=n-t+1;a<i;a++){var o=3*a;c.unpack(e,4*(t+a),_),c.multiply(_,p,_),_.w<0&&c.negate(_,_),c.computeAxis(_,E);var u=c.computeAngle(_);r[o]=E.x*u,r[o+1]=E.y*u,r[o+2]=E.z*u}},c.unpackInterpolationResult=function(t,n,a,i,o){r(o)||(o=new c),e.fromArray(t,0,m);var u=e.magnitude(m);return c.unpack(n,4*i,y),0===u?c.clone(c.IDENTITY,_):c.fromAxisAngle(m,u,_),c.multiply(_,y,o)},c.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new c(e.x,e.y,e.z,e.w)},c.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},c.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},c.magnitude=function(e){return Math.sqrt(c.magnitudeSquared(e))},c.normalize=function(e,t){var n=1/c.magnitude(e),r=e.x*n,a=e.y*n,i=e.z*n,o=e.w*n;return t.x=r,t.y=a,t.z=i,t.w=o,t},c.inverse=function(e,t){var n=c.magnitudeSquared(e);return t=c.conjugate(e,t),c.multiplyByScalar(t,1/n,t)},c.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},c.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},c.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},c.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},c.multiply=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=e.w,u=t.x,s=t.y,c=t.z,l=t.w,f=o*u+r*l+a*c-i*s,d=o*s-r*c+a*l+i*u,h=o*c+r*s-a*u+i*l,E=o*l-r*u-a*s-i*c;return n.x=f,n.y=d,n.z=h,n.w=E,n},c.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},c.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},c.computeAxis=function(e,t){var n=e.w;if(Math.abs(n-1)<u.EPSILON6)return t.x=t.y=t.z=0,t;var r=1/Math.sqrt(1-n*n);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},c.computeAngle=function(e){return Math.abs(e.w-1)<u.EPSILON6?0:2*Math.acos(e.w)};var T=new c;c.lerp=function(e,t,n,r){return T=c.multiplyByScalar(t,n,T),r=c.multiplyByScalar(e,1-n,r),c.add(T,r,r)};var R=new c,A=new c,N=new c;c.slerp=function(e,t,n,r){var a=c.dot(e,t),i=t;if(a<0&&(a=-a,i=R=c.negate(t,R)),1-a<u.EPSILON6)return c.lerp(e,i,n,r);var o=Math.acos(a);return A=c.multiplyByScalar(e,Math.sin((1-n)*o),A),N=c.multiplyByScalar(i,Math.sin(n*o),N),r=c.add(A,N,r),c.multiplyByScalar(r,1/Math.sin(o),r)},c.log=function(t,n){var r=u.acosClamped(t.w),a=0;return 0!==r&&(a=r/Math.sin(r)),e.multiplyByScalar(t,a,n)},c.exp=function(t,n){var r=e.magnitude(t),a=0;return 0!==r&&(a=Math.sin(r)/r),n.x=t.x*a,n.y=t.y*a,n.z=t.z*a,n.w=Math.cos(r),n};var S=new e,M=new e,I=new c,O=new c;c.computeInnerQuadrangle=function(t,n,r,a){var i=c.conjugate(n,I);c.multiply(i,r,O);var o=c.log(O,S);c.multiply(i,t,O);var u=c.log(O,M);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),c.exp(o,I),c.multiply(n,I,a)},c.squad=function(e,t,n,r,a,i){var o=c.slerp(e,t,a,I),u=c.slerp(n,r,a,O);return c.slerp(o,u,2*a*(1-a),i)};for(var v=new c,g=1.9011074535173003,x=i.supportsTypedArrays()?new Float32Array(8):[],w=i.supportsTypedArrays()?new Float32Array(8):[],C=i.supportsTypedArrays()?new Float32Array(8):[],P=i.supportsTypedArrays()?new Float32Array(8):[],U=0;U<7;++U){var D=U+1,L=2*D+1;x[U]=1/(D*L),w[U]=D/L}return x[7]=g/136,w[7]=8*g/17,c.fastSlerp=function(e,t,n,r){var a,i=c.dot(e,t);i>=0?a=1:(a=-1,i=-i);for(var o=i-1,u=1-n,s=n*n,l=u*u,f=7;f>=0;--f)C[f]=(x[f]*s-w[f])*o,P[f]=(x[f]*l-w[f])*o;var d=a*n*(1+C[0]*(1+C[1]*(1+C[2]*(1+C[3]*(1+C[4]*(1+C[5]*(1+C[6]*(1+C[7])))))))),h=u*(1+P[0]*(1+P[1]*(1+P[2]*(1+P[3]*(1+P[4]*(1+P[5]*(1+P[6]*(1+P[7])))))))),E=c.multiplyByScalar(e,h,v);return c.multiplyByScalar(t,d,r),c.add(E,r,r)},c.fastSquad=function(e,t,n,r,a,i){var o=c.fastSlerp(e,t,a,I),u=c.fastSlerp(n,r,a,O);return c.fastSlerp(o,u,2*a*(1-a),i)},c.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},c.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n},c.ZERO=o(new c(0,0,0,0)),c.IDENTITY=o(new c(0,0,0,1)),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.x+", "+this.y+", "+this.z+", "+this.w+")"},c}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./Check","./defaultValue","./defined","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./HeadingPitchRoll","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,n,r,a,i,o,u,s,c,l,f,d,h,E,m,_,y,p,T,R){"use strict";var A={},N=new n,S=new n,M=new n;A.eastNorthUpToFixedFrame=function(e,t,r){if(_.equalsEpsilon(e.x,0,_.EPSILON14)&&_.equalsEpsilon(e.y,0,_.EPSILON14)){var a=_.sign(e.z);return u(r)?(r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=-a,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=a,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new p(0,-a,0,e.x,1,0,0,e.y,0,0,a,e.z,0,0,0,1)}var i=N,s=S,c=M;return t=o(t,f.WGS84),t.geodeticSurfaceNormal(e,i),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(i,s,c),u(r)?(r[0]=s.x,r[1]=s.y,r[2]=s.z,r[3]=0,r[4]=c.x,r[5]=c.y,r[6]=c.z,r[7]=0,r[8]=i.x,r[9]=i.y,r[10]=i.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new p(s.x,c.x,i.x,e.x,s.y,c.y,i.y,e.y,s.z,c.z,i.z,e.z,0,0,0,1)};var I=new n,O=new n,v=new n;A.northEastDownToFixedFrame=function(e,t,r){if(_.equalsEpsilon(e.x,0,_.EPSILON14)&&_.equalsEpsilon(e.y,0,_.EPSILON14)){var a=_.sign(e.z);return u(r)?(r[0]=-a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=-a,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new p(-a,0,0,e.x,0,1,0,e.y,0,0,-a,e.z,0,0,0,1)}var i=I,s=O,c=v;return t=o(t,f.WGS84),t.geodeticSurfaceNormal(e,i),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(i,s,c),u(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=s.x,r[5]=s.y,r[6]=s.z,r[7]=0,r[8]=-i.x,r[9]=-i.y,r[10]=-i.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new p(c.x,s.x,-i.x,e.x,c.y,s.y,-i.y,e.y,c.z,s.z,-i.z,e.z,0,0,0,1)},A.northUpEastToFixedFrame=function(e,t,r){if(_.equalsEpsilon(e.x,0,_.EPSILON14)&&_.equalsEpsilon(e.y,0,_.EPSILON14)){var a=_.sign(e.z);return u(r)?(r[0]=-a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=a,r[7]=0,r[8]=0,r[9]=1,r[10]=0,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new p(-a,0,0,e.x,0,0,1,e.y,0,a,0,e.z,0,0,0,1)}var i=N,s=S,c=M;return t=o(t,f.WGS84),t.geodeticSurfaceNormal(e,i),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(i,s,c),u(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=i.x,r[5]=i.y,r[6]=i.z,r[7]=0,r[8]=s.x,r[9]=s.y,r[10]=s.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new p(c.x,i.x,s.x,e.x,c.y,i.y,s.y,e.y,c.z,i.z,s.z,e.z,0,0,0,1)},A.northWestUpToFixedFrame=function(e,t,r){if(_.equalsEpsilon(e.x,0,_.EPSILON14)&&_.equalsEpsilon(e.y,0,_.EPSILON14)){var a=_.sign(e.z);return u(r)?(r[0]=-a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=a,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new p(-a,0,0,e.x,0,-1,0,e.y,0,0,a,e.z,0,0,0,1)}var i=N,s=S,c=M;return t=o(t,f.WGS84),t.geodeticSurfaceNormal(e,i),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(i,s,c),u(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=-s.x,r[5]=-s.y,r[6]=-s.z,r[7]=0,r[8]=i.x,r[9]=i.y,r[10]=i.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new p(c.x,-s.x,i.x,e.x,c.y,-s.y,i.y,e.y,c.z,-s.z,i.z,e.z,0,0,0,1)};var g=new T,x=new n(1,1,1),w=new p;A.headingPitchRollToFixedFrame=function(e,t,r,a){i.typeOf.object("headingPitchRoll",t);var o=t.heading,u=t.pitch,s=t.roll,c=T.fromHeadingPitchRoll(o,u,s,g),l=p.fromTranslationQuaternionRotationScale(n.ZERO,c,x,w);return a=A.eastNorthUpToFixedFrame(e,r,a),p.multiply(a,l,a)};var C=new p,P=new y;A.headingPitchRollQuaternion=function(e,t,n,r){i.typeOf.object("headingPitchRoll",t);var a=A.headingPitchRollToFixedFrame(e,t,n,C),o=p.getRotation(a,P);return T.fromRotationMatrix(o,r)};var U=24110.54841,D=8640184.812866,L=.093104,F=-62e-7,z=1.1772758384668e-19,B=72921158553e-15,b=_.TWO_PI/86400,q=new m;A.computeTemeToPseudoFixedMatrix=function(e,t){q=m.addSeconds(e,-m.computeTaiMinusUtc(e),q);var n,r=q.dayNumber,a=q.secondsOfDay,i=r-2451545;n=a>=43200?(i+.5)/R.DAYS_PER_JULIAN_CENTURY:(i-.5)/R.DAYS_PER_JULIAN_CENTURY;var o=U+n*(D+n*(L+n*F)),s=o*b%_.TWO_PI,c=B+z*(r-2451545.5),l=(a+.5*R.SECONDS_PER_DAY)%R.SECONDS_PER_DAY,f=s+c*l,d=Math.cos(f),h=Math.sin(f);return u(t)?(t[0]=d,t[1]=-h,t[2]=0,t[3]=h,t[4]=d,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new y(d,h,0,-h,d,0,0,0,1)},A.iau2006XysData=new h,A.earthOrientationParameters=c.NONE;var G=32.184,W=2451545;A.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+G,a=t.stop.dayNumber,i=t.stop.secondsOfDay+G,o=A.iau2006XysData.preload(n,r,a,i),u=A.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},A.computeIcrfToFixedMatrix=function(e,t){u(t)||(t=new y);var n=A.computeFixedToIcrfMatrix(e,t);if(u(n))return y.transpose(n,t)};var X=new E(0,0,0),V=new l(0,0,0,0,0,0),H=new y,Y=new y;A.computeFixedToIcrfMatrix=function(e,t){u(t)||(t=new y);var n=A.earthOrientationParameters.compute(e,V);if(u(n)){var r=e.dayNumber,a=e.secondsOfDay+G,i=A.iau2006XysData.computeXysRadians(r,a,X);if(u(i)){var o=i.x+n.xPoleOffset,s=i.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-o*o-s*s)),l=H;l[0]=1-c*o*o,l[3]=-c*o*s,l[6]=o,l[1]=-c*o*s,l[4]=1-c*s*s,l[7]=s,l[2]=-o,l[5]=-s,l[8]=1-c*(o*o+s*s);var f=y.fromRotationZ(-i.s,Y),d=y.multiply(l,f,H),h=e.dayNumber,E=e.secondsOfDay-m.computeTaiMinusUtc(e)+n.ut1MinusUtc,p=h-2451545,T=E/R.SECONDS_PER_DAY,N=.779057273264+T+.00273781191135448*(p+T);N=N%1*_.TWO_PI;var S=y.fromRotationZ(N,Y),M=y.multiply(d,S,H),I=Math.cos(n.xPoleWander),O=Math.cos(n.yPoleWander),v=Math.sin(n.xPoleWander),g=Math.sin(n.yPoleWander),x=r-W+a/R.SECONDS_PER_DAY;x/=36525;var w=-47e-6*x*_.RADIANS_PER_DEGREE/3600,C=Math.cos(w),P=Math.sin(w),U=Y;return U[0]=I*C,U[1]=I*P,U[2]=v,U[3]=-O*P+g*v*C,U[4]=O*C+g*v*P,U[5]=-g*I,U[6]=-g*P-O*v*C,U[7]=g*C-O*v*P,U[8]=O*I,y.multiply(M,U,t)}}};var k=new r;A.pointToWindowCoordinates=function(e,t,n,r){return r=A.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},A.pointToGLWindowCoordinates=function(e,n,a,i){u(i)||(i=new t);var o=k;return p.multiplyByVector(e,r.fromElements(a.x,a.y,a.z,1,o),o),r.multiplyByScalar(o,1/o.w,o),p.multiplyByVector(n,o,o),t.fromCartesian4(o,i)};var j=new n,Z=new n,K=new n;A.rotationMatrixFromPositionVelocity=function(e,t,r,a){var i=o(r,f.WGS84).geodeticSurfaceNormal(e,j),s=n.cross(t,i,Z);n.equalsEpsilon(s,n.ZERO,_.EPSILON6)&&(s=n.clone(n.UNIT_X,s));var c=n.cross(s,t,K);return n.cross(t,c,s),n.negate(s,s),u(a)||(a=new y),a[0]=t.x,a[1]=t.y,a[2]=t.z,a[3]=s.x,a[4]=s.y,a[5]=s.z,a[6]=c.x,a[7]=c.y,a[8]=c.z,a};var J=new a,Q=new n,$=new n,ee=new r,te=new r,ne=new r,re=new r,ae=new r,ie=new p,oe=new p;A.basisTo2D=function(e,t,a){var i=e.ellipsoid,o=p.getColumn(t,3,ee),u=i.cartesianToCartographic(o,J),s=A.eastNorthUpToFixedFrame(o,i,ie),c=p.inverseTransformation(s,oe),l=e.project(u,Q),f=te;f.x=l.z,f.y=l.x,f.z=l.y,f.w=1;var d=p.getColumn(t,0,$),h=n.magnitude(d),E=p.multiplyByVector(c,d,ne);r.fromElements(E.z,E.x,E.y,0,E);var m=p.getColumn(t,1,$),_=n.magnitude(m),y=p.multiplyByVector(c,m,re);r.fromElements(y.z,y.x,y.y,0,y);var T=p.getColumn(t,2,$),R=n.magnitude(T),N=ae;return n.cross(E,y,N),n.normalize(N,N),n.cross(y,N,E),n.normalize(E,E),n.cross(N,E,y),n.normalize(y,y),n.multiplyByScalar(E,h,E),n.multiplyByScalar(y,_,y),n.multiplyByScalar(N,R,N),p.setColumn(a,0,E,a),p.setColumn(a,1,y,a),p.setColumn(a,2,N,a),p.setColumn(a,3,f,a),a};var ue=new p(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);return A.wgs84To2DModelMatrix=function(e,t,n){var r=e.ellipsoid,a=A.eastNorthUpToFixedFrame(t,r,ie),i=p.inverseTransformation(a,oe),o=r.cartesianToCartographic(t,J),u=e.project(o,Q),s=te;s.x=u.z,s.y=u.x,s.z=u.y,s.w=1;var c=p.fromTranslation(s,ie);return p.multiply(ue,i,n),p.multiply(c,n,n),n},A}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,f,d,h){"use strict";function E(e,t){t=a(t,s.WGS84),e=t.scaleToGeodeticSurface(e);var r=h.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=n.fromCartesian4(l.getColumn(r,0,m)),this._yAxis=n.fromCartesian4(l.getColumn(r,1,m));var i=n.fromCartesian4(l.getColumn(r,2,m));this._plane=f.fromPointNormal(e,i)}var m=new r;o(E.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var _=new e;E.fromPoints=function(t,n){var r=e.fromPoints(t,_);return new E(r.center,n)};var y=new d,p=new n;E.prototype.projectPointOntoPlane=function(e,r){var a=y;a.origin=e,n.normalize(e,a.direction);var o=c.rayPlane(a,this._plane,p);if(i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,p)),i(o)){var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return i(r)?(r.x=s,r.y=l,r):new t(s,l)}},E.prototype.projectPointsOntoPlane=function(e,t){i(t)||(t=[]);for(var n=0,r=e.length,a=0;a<r;a++){var o=this.projectPointOntoPlane(e[a],t[n]);i(o)&&(t[n]=o,n++)}return t.length=n,t},E.prototype.projectPointToNearestOnPlane=function(e,r){i(r)||(r=new t);var a=y;a.origin=e,n.clone(this._plane.normal,a.direction);var o=c.rayPlane(a,this._plane,p);i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,p));var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return r.x=s,r.y=l,r},E.prototype.projectPointsToNearestOnPlane=function(e,t){i(t)||(t=[]);var n=e.length;t.length=n;for(var r=0;r<n;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var T=new n;return E.prototype.projectPointsOntoEllipsoid=function(e,t){var r=e.length;i(t)?t.length=r:t=new Array(r);for(var a=this._ellipsoid,o=this._origin,u=this._xAxis,s=this._yAxis,c=T,l=0;l<r;++l){var f=e[l];n.multiplyByScalar(u,f.x,c),i(t[l])||(t[l]=new n);var d=n.add(o,c,t[l]);n.multiplyByScalar(s,f.y,c),n.add(d,c,d),a.scaleToGeocentricSurface(d,d)}return t},E}),define("Core/OrientedBoundingBox",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Intersect","./Interval","./Math","./Matrix3","./Plane","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,f,d,h,E){"use strict";function m(e,t){this.center=n.clone(a(e,n.ZERO)),this.halfAxes=d.clone(a(t,d.ZERO))}function _(e,t,r,a,o,u,s,c){i(c)||(c=new m);var l=c.halfAxes;d.setColumn(l,0,e.xAxis,l),d.setColumn(l,1,e.yAxis,l),d.setColumn(l,2,e.zAxis,l);var f=I;f.x=(t+r)/2,f.y=(a+o)/2,f.z=(u+s)/2;var h=O;h.x=(r-t)/2,h.y=(o-a)/2,h.z=(s-u)/2;var E=c.center;return f=d.multiplyByVector(l,f,f),n.add(e.origin,f,E),d.multiplyByScale(l,h,l),c}var y=new n,p=new n,T=new n,R=new n,A=new n,N=new n,S=new d,M={unitary:new d,diagonal:new d};m.fromPoints=function(e,t){if(i(t)||(t=new m),!i(e)||0===e.length)return t.halfAxes=d.ZERO,t.center=n.ZERO,t;var r,a=e.length,o=n.clone(e[0],y);for(r=1;r<a;r++)n.add(o,e[r],o);var u=1/a;n.multiplyByScalar(o,u,o);var s,c=0,l=0,f=0,h=0,E=0,_=0;for(r=0;r<a;r++)s=n.subtract(e[r],o,p),c+=s.x*s.x,l+=s.x*s.y,f+=s.x*s.z,h+=s.y*s.y,E+=s.y*s.z,_+=s.z*s.z;c*=u,l*=u,f*=u,h*=u,E*=u,_*=u;var I=S;I[0]=c,I[1]=l,I[2]=f,I[3]=l,I[4]=h,I[5]=E,I[6]=f,I[7]=E,I[8]=_;var O=d.computeEigenDecomposition(I,M),v=d.clone(O.unitary,t.halfAxes),g=d.getColumn(v,0,R),x=d.getColumn(v,1,A),w=d.getColumn(v,2,N),C=-Number.MAX_VALUE,P=-Number.MAX_VALUE,U=-Number.MAX_VALUE,D=Number.MAX_VALUE,L=Number.MAX_VALUE,F=Number.MAX_VALUE;for(r=0;r<a;r++)s=e[r],C=Math.max(n.dot(g,s),C),P=Math.max(n.dot(x,s),P),U=Math.max(n.dot(w,s),U),D=Math.min(n.dot(g,s),D),L=Math.min(n.dot(x,s),L),F=Math.min(n.dot(w,s),F);g=n.multiplyByScalar(g,.5*(D+C),g),x=n.multiplyByScalar(x,.5*(L+P),x),w=n.multiplyByScalar(w,.5*(F+U),w);var z=n.add(g,x,t.center);z=n.add(z,w,z);var B=T;return B.x=C-D,B.y=P-L,B.z=U-F,n.multiplyByScalar(B,.5,B),d.multiplyByScale(t.halfAxes,B,t.halfAxes),t};var I=new n,O=new n,v=new r,g=new n,x=[new r,new r,new r,new r,new r,new r,new r,new r],w=[new n,new n,new n,new n,new n,new n,new n,new n],C=[new t,new t,new t,new t,new t,new t,new t,new t];m.fromRectangle=function(e,t,n,r,i){t=a(t,0),n=a(n,0),r=a(r,u.WGS84);var o=E.center(e,v),c=r.cartographicToCartesian(o,g),l=new s(c,r),f=l.plane,d=x[0],m=x[1],y=x[2],p=x[3],T=x[4],R=x[5],A=x[6],N=x[7],S=o.longitude,M=e.south<0&&e.north>0?0:o.latitude;A.latitude=R.latitude=T.latitude=e.south,N.latitude=p.latitude=M,d.latitude=m.latitude=y.latitude=e.north,A.longitude=N.longitude=d.longitude=e.west,R.longitude=m.longitude=S,T.longitude=p.longitude=y.longitude=e.east,y.height=m.height=d.height=N.height=A.height=R.height=T.height=p.height=n,r.cartographicArrayToCartesianArray(x,w),l.projectPointsToNearestOnPlane(w,C);var I=Math.min(C[6].x,C[7].x,C[0].x),O=Math.max(C[2].x,C[3].x,C[4].x),P=Math.min(C[4].y,C[5].y,C[6].y),U=Math.max(C[0].y,C[1].y,C[2].y);y.height=d.height=T.height=A.height=t,r.cartographicArrayToCartesianArray(x,w);var D=Math.min(h.getPointDistance(f,w[0]),h.getPointDistance(f,w[2]),h.getPointDistance(f,w[4]),h.getPointDistance(f,w[6])),L=n;return _(l,I,O,P,U,D,L,i)},m.clone=function(e,t){if(i(e))return i(t)?(n.clone(e.center,t.center),d.clone(e.halfAxes,t.halfAxes),t):new m(e.center,e.halfAxes)},m.intersectPlane=function(e,t){var r=e.center,a=t.normal,i=e.halfAxes,o=a.x,u=a.y,s=a.z,l=Math.abs(o*i[d.COLUMN0ROW0]+u*i[d.COLUMN0ROW1]+s*i[d.COLUMN0ROW2])+Math.abs(o*i[d.COLUMN1ROW0]+u*i[d.COLUMN1ROW1]+s*i[d.COLUMN1ROW2])+Math.abs(o*i[d.COLUMN2ROW0]+u*i[d.COLUMN2ROW1]+s*i[d.COLUMN2ROW2]),f=n.dot(a,r)+t.distance;return f<=-l?c.OUTSIDE:f>=l?c.INSIDE:c.INTERSECTING};var P=new n,U=new n,D=new n,L=new n;m.distanceSquaredTo=function(e,t){var r=n.subtract(t,e.center,I),a=e.halfAxes,i=d.getColumn(a,0,P),o=d.getColumn(a,1,U),u=d.getColumn(a,2,D),s=n.magnitude(i),c=n.magnitude(o),l=n.magnitude(u);n.normalize(i,i),n.normalize(o,o),n.normalize(u,u);var f=L;f.x=n.dot(r,i),f.y=n.dot(r,o),f.z=n.dot(r,u);var h,E=0;return f.x<-s?(h=f.x+s,E+=h*h):f.x>s&&(h=f.x-s,E+=h*h),f.y<-c?(h=f.y+c,E+=h*h):f.y>c&&(h=f.y-c,E+=h*h),f.z<-l?(h=f.z+l,E+=h*h):f.z>l&&(h=f.z-l,E+=h*h),E};var F=new n,z=new n;m.computePlaneDistances=function(e,t,r,a){i(a)||(a=new l);var o=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,s=e.center,c=e.halfAxes,f=d.getColumn(c,0,P),h=d.getColumn(c,1,U),E=d.getColumn(c,2,D),m=n.add(f,h,F);n.add(m,E,m),n.add(m,s,m);var _=n.subtract(m,t,z),y=n.dot(r,_);return o=Math.min(y,o),u=Math.max(y,u),n.add(s,f,m),n.add(m,h,m),n.subtract(m,E,m),n.subtract(m,t,_),y=n.dot(r,_),o=Math.min(y,o),u=Math.max(y,u),n.add(s,f,m),n.subtract(m,h,m),n.add(m,E,m),n.subtract(m,t,_),y=n.dot(r,_),o=Math.min(y,o),u=Math.max(y,u),n.add(s,f,m),n.subtract(m,h,m),n.subtract(m,E,m),n.subtract(m,t,_),y=n.dot(r,_),o=Math.min(y,o),u=Math.max(y,u),n.subtract(s,f,m),n.add(m,h,m),n.add(m,E,m),n.subtract(m,t,_),y=n.dot(r,_),o=Math.min(y,o),u=Math.max(y,u),n.subtract(s,f,m),n.add(m,h,m),n.subtract(m,E,m),n.subtract(m,t,_),y=n.dot(r,_),o=Math.min(y,o),u=Math.max(y,u),n.subtract(s,f,m),n.subtract(m,h,m),n.add(m,E,m),n.subtract(m,t,_),y=n.dot(r,_),o=Math.min(y,o),u=Math.max(y,u),n.subtract(s,f,m),n.subtract(m,h,m),n.subtract(m,E,m),n.subtract(m,t,_),y=n.dot(r,_),o=Math.min(y,o),u=Math.max(y,u),a.start=o,a.stop=u,a};var B=new e;return m.isOccluded=function(t,n){var r=e.fromOrientedBoundingBox(t,B);return!n.isBoundingSphereVisible(r)},m.prototype.intersectPlane=function(e){return m.intersectPlane(this,e)},m.prototype.distanceSquaredTo=function(e){return m.distanceSquaredTo(this,e)},m.prototype.computePlaneDistances=function(e,t,n){return m.computePlaneDistances(this,e,t,n)},m.prototype.isOccluded=function(e){return m.isOccluded(this,e)},m.equals=function(e,t){return e===t||i(e)&&i(t)&&n.equals(e.center,t.center)&&d.equals(e.halfAxes,t.halfAxes)},m.prototype.clone=function(e){return m.clone(this,e)},m.prototype.equals=function(e){return m.equals(this,e)},m}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,a,i){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){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.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},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 Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,a){switch(r=e(r,0),a=e(a,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,a);case o.SHORT:return new Int16Array(n,r,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,a);case o.INT:return new Int32Array(n,r,a);case o.UNSIGNED_INT:return new Uint32Array(n,r,a);case o.FLOAT:return new Float32Array(n,r,a);case o.DOUBLE:return new Float64Array(n,r,a)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/TerrainQuantization",["./freezeObject"],function(e){"use strict";var t={NONE:0,BITS12:1};return e(t)}),define("Core/TerrainEncoding",["./AttributeCompression","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./Math","./Matrix4","./TerrainQuantization"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(e,t,r,o,c,d){var _,y,p,T;if(i(e)&&i(t)&&i(r)&&i(o)){var R=e.minimum,A=e.maximum,N=n.subtract(A,R,f),S=r-t,M=Math.max(n.maximumComponent(N),S);_=M<m-1?s.BITS12:s.NONE,y=e.center,p=u.inverseTransformation(o,new u);var I=n.negate(R,l);u.multiply(u.fromTranslation(I,h),p,p);var O=l;O.x=1/N.x,O.y=1/N.y,O.z=1/N.z,u.multiply(u.fromScale(O,h),p,p),T=u.clone(o),u.setTranslation(T,n.ZERO,T),o=u.clone(o,new u);var v=u.fromTranslation(R,h),g=u.fromScale(N,E),x=u.multiply(v,g,h);u.multiply(o,x,o),u.multiply(T,x,T)}this.quantization=_,this.minimumHeight=t,this.maximumHeight=r,this.center=y,this.toScaledENU=p,this.fromScaledENU=o,this.matrix=T,this.hasVertexNormals=c,this.hasWebMercatorT=a(d,!1)}var l=new n,f=new n,d=new t,h=new u,E=new u,m=Math.pow(2,12);c.prototype.encode=function(r,a,i,c,f,h,E){var m=c.x,_=c.y;if(this.quantization===s.BITS12){i=u.multiplyByPoint(this.toScaledENU,i,l),i.x=o.clamp(i.x,0,1),i.y=o.clamp(i.y,0,1),i.z=o.clamp(i.z,0,1);var y=this.maximumHeight-this.minimumHeight,p=o.clamp((f-this.minimumHeight)/y,0,1);t.fromElements(i.x,i.y,d);var T=e.compressTextureCoordinates(d);t.fromElements(i.z,p,d);var R=e.compressTextureCoordinates(d);t.fromElements(m,_,d);var A=e.compressTextureCoordinates(d);if(r[a++]=T,r[a++]=R,r[a++]=A,this.hasWebMercatorT){t.fromElements(E,0,d);var N=e.compressTextureCoordinates(d);r[a++]=N}}else n.subtract(i,this.center,l),r[a++]=l.x,r[a++]=l.y,r[a++]=l.z,r[a++]=f,r[a++]=m,r[a++]=_,this.hasWebMercatorT&&(r[a++]=E);return this.hasVertexNormals&&(r[a++]=e.octPackFloat(h)),a},c.prototype.decodePosition=function(t,r,a){if(i(a)||(a=new n),r*=this.getStride(),this.quantization===s.BITS12){var o=e.decompressTextureCoordinates(t[r],d);a.x=o.x,a.y=o.y;var c=e.decompressTextureCoordinates(t[r+1],d);return a.z=c.x,u.multiplyByPoint(this.fromScaledENU,a,a)}return a.x=t[r],a.y=t[r+1],a.z=t[r+2],n.add(a,this.center,a)},c.prototype.decodeTextureCoordinates=function(n,r,a){return i(a)||(a=new t),r*=this.getStride(),this.quantization===s.BITS12?e.decompressTextureCoordinates(n[r+2],a):t.fromElements(n[r+4],n[r+5],a)},c.prototype.decodeHeight=function(t,n){if(n*=this.getStride(),this.quantization===s.BITS12){var r=e.decompressTextureCoordinates(t[n+1],d);return r.y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight}return t[n+3]},c.prototype.getOctEncodedNormal=function(e,n,r){var a=this.getStride();n=(n+1)*a-1;var i=e[n]/256,o=Math.floor(i),u=256*(i-o);return t.fromElements(o,u,r)},c.prototype.getStride=function(){var e;switch(this.quantization){case s.BITS12:e=3;break;default:e=6}return this.hasWebMercatorT&&++e,this.hasVertexNormals&&++e,e};var _={position3DAndHeight:0,textureCoordAndEncodedNormals:1},y={compressed0:0,compressed1:1};return c.prototype.getAttributes=function(e){var t,n=r.FLOAT,a=r.getSizeInBytes(n);if(this.quantization===s.NONE){var i=4,o=2;return this.hasWebMercatorT&&++o,this.hasVertexNormals&&++o,t=(i+o)*a,[{index:_.position3DAndHeight,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:i,offsetInBytes:0,strideInBytes:t},{index:_.textureCoordAndEncodedNormals,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:o,offsetInBytes:i*a,strideInBytes:t}]}var u=3,c=0;return(this.hasWebMercatorT||this.hasVertexNormals)&&++u,this.hasWebMercatorT&&this.hasVertexNormals?(++c,t=(u+c)*a,[{index:y.compressed0,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:u,offsetInBytes:0,strideInBytes:t},{index:y.compressed1,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:c,offsetInBytes:u*a,strideInBytes:t}]):[{index:y.compressed0,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:u}]},c.prototype.getAttributeLocations=function(){return this.quantization===s.NONE?_:y},c.clone=function(e,t){return i(t)||(t=new c),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=n.clone(e.center),t.toScaledENU=u.clone(e.toScaledENU),t.fromScaledENU=u.clone(e.fromScaledENU),t.matrix=u.clone(e.matrix),t.hasVertexNormals=e.hasVertexNormals,t.hasWebMercatorT=e.hasWebMercatorT,t},c}),define("Core/WebMercatorProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(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,n){var a=this._semimajorAxis,i=t.longitude*a,o=s.geodeticLatitudeToMercatorAngle(t.latitude)*a,u=t.height;return r(n)?(n.x=i,n.y=o,n.z=u,n):new e(i,o,u)},s.prototype.unproject=function(e,n){var a=this._oneOverSemimajorAxis,i=e.x*a,o=s.mercatorAngleToGeodeticLatitude(e.y*a),u=e.z;return r(n)?(n.longitude=i,n.latitude=o,n.height=u,n):new t(i,o,u)},s}),define("Core/formatError",["./defined"],function(e){"use strict";function t(t){var n,r=t.name,a=t.message;n=e(r)&&e(a)?r+": "+a:t.toString();var i=t.stack;return e(i)&&(n+="\n"+i),n}return t}),define("Workers/createTaskProcessorWorker",["../Core/defaultValue","../Core/defined","../Core/formatError"],function(e,t,n){"use strict";function r(r){var a,i=[],o={id:void 0,result:void 0,error:void 0};return function(u){var s=u.data;i.length=0,o.id=s.id,o.error=void 0,o.result=void 0;try{o.result=r(s.parameters,i)}catch(e){e instanceof Error?o.error={name:e.name,message:e.message,stack:e.stack}:o.error=e}t(a)||(a=e(self.webkitPostMessage,self.postMessage)),s.canTransferArrayBuffer||(i.length=0);try{a(o,i)}catch(e){o.result=void 0,o.error="postMessage failed with error: "+n(e)+"\n with responseMessage: "+JSON.stringify(o),a(o)}}}return r}),define("Workers/createVerticesFromQuantizedTerrainMesh",["../Core/AttributeCompression","../Core/AxisAlignedBoundingBox","../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/defined","../Core/Ellipsoid","../Core/IndexDatatype","../Core/Math","../Core/Matrix4","../Core/OrientedBoundingBox","../Core/TerrainEncoding","../Core/Transforms","../Core/WebMercatorProjection","./createTaskProcessorWorker"],function(e,t,n,r,a,i,o,u,s,c,l,f,d,h,E,m){ +"use strict";function _(i,m){var _,g,x=i.quantizedVertices,w=x.length/3,C=i.octEncodedNormals,P=i.westIndices.length+i.eastIndices.length+i.southIndices.length+i.northIndices.length,U=i.includeWebMercatorT,D=i.rectangle,L=D.west,F=D.south,z=D.east,B=D.north,b=u.clone(i.ellipsoid),q=i.exaggeration,G=i.minimumHeight*q,W=i.maximumHeight*q,X=i.relativeToCenter,V=h.eastNorthUpToFixedFrame(X,b),H=l.inverseTransformation(V,new l);U&&(_=E.geodeticLatitudeToMercatorAngle(F),g=1/(E.geodeticLatitudeToMercatorAngle(B)-_));var Y=x.subarray(0,w),k=x.subarray(w,2*w),j=x.subarray(2*w,3*w),Z=o(C),K=new Array(w),J=new Array(w),Q=new Array(w),$=U?new Array(w):[],ee=A;ee.x=Number.POSITIVE_INFINITY,ee.y=Number.POSITIVE_INFINITY,ee.z=Number.POSITIVE_INFINITY;var te=N;te.x=Number.NEGATIVE_INFINITY,te.y=Number.NEGATIVE_INFINITY,te.z=Number.NEGATIVE_INFINITY;for(var ne=0;ne<w;++ne){var re=Y[ne]/T,ae=k[ne]/T,ie=c.lerp(G,W,j[ne]/T);S.longitude=c.lerp(L,z,re),S.latitude=c.lerp(F,B,ae),S.height=ie;var oe=b.cartographicToCartesian(S);K[ne]=new r(re,ae),J[ne]=ie,Q[ne]=oe,U&&($[ne]=(E.geodeticLatitudeToMercatorAngle(S.latitude)-_)*g),l.multiplyByPoint(H,oe,R),a.minimumByComponent(R,ee,ee),a.maximumByComponent(R,te,te)}var ue,se;1!==q&&(se=n.fromPoints(Q),ue=f.fromRectangle(D,G,W,b));var ce=G;ce=Math.min(ce,y(i.westIndices,i.westSkirtHeight,J,K,D,b,H,ee,te)),ce=Math.min(ce,y(i.southIndices,i.southSkirtHeight,J,K,D,b,H,ee,te)),ce=Math.min(ce,y(i.eastIndices,i.eastSkirtHeight,J,K,D,b,H,ee,te)),ce=Math.min(ce,y(i.northIndices,i.northSkirtHeight,J,K,D,b,H,ee,te));for(var le=new t(ee,te,X),fe=new d(le,ce,W,V,Z,U),de=fe.getStride(),he=w*de+P*de,Ee=new Float32Array(he),me=0,_e=0;_e<w;++_e){if(Z){var ye=2*_e;if(M.x=C[ye],M.y=C[ye+1],1!==q){var pe=e.octDecode(M.x,M.y,I),Te=h.eastNorthUpToFixedFrame(Q[_e],b,v),Re=l.inverseTransformation(Te,O);l.multiplyByPointAsVector(Re,pe,pe),pe.z*=q,a.normalize(pe,pe),l.multiplyByPointAsVector(Te,pe,pe),a.normalize(pe,pe),e.octEncode(pe,M)}}me=fe.encode(Ee,me,Q[_e],K[_e],J[_e],M,$[_e])}var Ae=Math.max(0,2*(P-4)),Ne=i.indices.length+3*Ae,Se=s.createTypedArray(w+P,Ne);Se.set(i.indices,0);var Me=w*de,Ie=i.indices.length;return Ie=p(Ee,Me,Se,Ie,i.westIndices,fe,J,K,C,b,D,i.westSkirtHeight,!0,q,_,g),Me+=i.westIndices.length*de,Ie=p(Ee,Me,Se,Ie,i.southIndices,fe,J,K,C,b,D,i.southSkirtHeight,!1,q,_,g),Me+=i.southIndices.length*de,Ie=p(Ee,Me,Se,Ie,i.eastIndices,fe,J,K,C,b,D,i.eastSkirtHeight,!1,q,_,g),Me+=i.eastIndices.length*de,p(Ee,Me,Se,Ie,i.northIndices,fe,J,K,C,b,D,i.northSkirtHeight,!0,q,_,g),m.push(Ee.buffer,Se.buffer),{vertices:Ee.buffer,indices:Se.buffer,vertexStride:de,center:X,minimumHeight:G,maximumHeight:W,boundingSphere:se,orientedBoundingBox:ue,encoding:fe,skirtIndex:i.indices.length}}function y(e,t,n,r,i,o,u,s,f){var d=Number.POSITIVE_INFINITY,h=i.north,E=i.south,m=i.east,_=i.west;m<_&&(m+=c.TWO_PI);for(var y=e.length,p=0;p<y;++p){var T=e[p],A=n[T],N=r[T];S.longitude=c.lerp(_,m,N.x),S.latitude=c.lerp(E,h,N.y),S.height=A-t;var M=o.cartographicToCartesian(S,R);l.multiplyByPoint(u,M,M),a.minimumByComponent(M,s,s),a.maximumByComponent(M,f,f),d=Math.min(d,S.height)}return d}function p(t,n,r,i,u,s,f,d,m,_,y,p,T,A,N,g){var x,w,C;T?(x=u.length-1,w=-1,C=-1):(x=0,w=u.length,C=1);var P=-1,U=o(m),D=s.getStride(),L=n/D,F=y.north,z=y.south,B=y.east,b=y.west;B<b&&(B+=c.TWO_PI);for(var q=x;q!==w;q+=C){var G=u[q],W=f[G],X=d[G];S.longitude=c.lerp(b,B,X.x),S.latitude=c.lerp(z,F,X.y),S.height=W-p;var V=_.cartographicToCartesian(S,R);if(U){var H=2*G;if(M.x=m[H],M.y=m[H+1],1!==A){var Y=e.octDecode(M.x,M.y,I),k=h.eastNorthUpToFixedFrame(R,_,v),j=l.inverseTransformation(k,O);l.multiplyByPointAsVector(j,Y,Y),Y.z*=A,a.normalize(Y,Y),l.multiplyByPointAsVector(k,Y,Y),a.normalize(Y,Y),e.octEncode(Y,M)}}var Z;s.hasWebMercatorT&&(Z=(E.geodeticLatitudeToMercatorAngle(S.latitude)-N)*g),n=s.encode(t,n,V,X,S.height,M,Z),P!==-1&&(r[i++]=P,r[i++]=L-1,r[i++]=G,r[i++]=L-1,r[i++]=L,r[i++]=G),P=G,++L}return i}var T=32767,R=new a,A=new a,N=new a,S=new i,M=new r,I=new a,O=new l,v=new l;return m(_)})}(); \ No newline at end of file diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createWallGeometry.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createWallGeometry.js index ac22948c..e308992e 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createWallGeometry.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createWallGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -222,9 +222,9 @@ OTHER DEALINGS IN THE SOFTWARE. * */ -!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==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";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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("Core/isArray",["./defined"],function(e){"use strict";var t=Array.isArray;return e(t)||(t=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),t}),define("Core/Check",["./defaultValue","./defined","./DeveloperError","./isArray"],function(e,t,n,r){"use strict";function i(e){return e+" was required but undefined."}function a(e,t,n){return"Expected "+n+" to be typeof "+t+", got "+e}var o={};return o.typeOf={},o.numeric={},o.defined=function(e,r){if(!t(e))throw new n(i(r))},o.numeric.maximum=function(e,t){if(o.typeOf.number(e),o.typeOf.number(t),e>t)throw new n("Expected "+e+" to be at most "+t)},o.numeric.minimum=function(e,t){if(o.typeOf.number(e),o.typeOf.number(t),e<t)throw new n("Expected "+e+" to be at least "+t)},o.typeOf.function=function(e,t){if("function"!=typeof e)throw new n(a(typeof e,"function",t))},o.typeOf.string=function(e,t){if("string"!=typeof e)throw new n(a(typeof e,"string",t))},o.typeOf.number=function(e,t){if("number"!=typeof e)throw new n(a(typeof e,"number",t))},o.typeOf.object=function(e,t){if("object"!=typeof e)throw new n(a(typeof e,"object",t))},o.typeOf.boolean=function(e,t){if("boolean"!=typeof e)throw new n(a(typeof e,"boolean",t))},o}),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 n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(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^=e<<7&2636928640,e^=e<<15&4022730752,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,n,r){"use strict";var i={};i.EPSILON1=.1,i.EPSILON2=.01,i.EPSILON3=.001,i.EPSILON4=1e-4,i.EPSILON5=1e-5,i.EPSILON6=1e-6,i.EPSILON7=1e-7,i.EPSILON8=1e-8,i.EPSILON9=1e-9,i.EPSILON10=1e-10,i.EPSILON11=1e-11,i.EPSILON12=1e-12,i.EPSILON13=1e-13,i.EPSILON14=1e-14,i.EPSILON15=1e-15,i.EPSILON16=1e-16,i.EPSILON17=1e-17,i.EPSILON18=1e-18,i.EPSILON19=1e-19,i.EPSILON20=1e-20,i.GRAVITATIONALPARAMETER=3986004418e5,i.SOLAR_RADIUS=6955e5,i.LUNAR_RADIUS=1737400,i.SIXTY_FOUR_KILOBYTES=65536,i.sign=function(e){return e>0?1:e<0?-1:0},i.signNotZero=function(e){return e<0?-1:1},i.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*i.clamp(e,-1,1)+.5)*n)},i.fromSNorm=function(e,n){return n=t(n,255),i.clamp(e,0,n)/n*2-1},i.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},i.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},i.lerp=function(e,t,n){return(1-n)*e+n*t},i.PI=Math.PI,i.ONE_OVER_PI=1/Math.PI,i.PI_OVER_TWO=.5*Math.PI,i.PI_OVER_THREE=Math.PI/3,i.PI_OVER_FOUR=Math.PI/4,i.PI_OVER_SIX=Math.PI/6,i.THREE_PI_OVER_TWO=3*Math.PI*.5,i.TWO_PI=2*Math.PI,i.ONE_OVER_TWO_PI=1/(2*Math.PI),i.RADIANS_PER_DEGREE=Math.PI/180,i.DEGREES_PER_RADIAN=180/Math.PI,i.RADIANS_PER_ARCSECOND=i.RADIANS_PER_DEGREE/3600,i.toRadians=function(e){return e*i.RADIANS_PER_DEGREE},i.toDegrees=function(e){return e*i.DEGREES_PER_RADIAN},i.convertLongitudeRange=function(e){var t=i.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},i.clampToLatitudeRange=function(e){return i.clamp(e,-1*i.PI_OVER_TWO,i.PI_OVER_TWO)},i.negativePiToPi=function(e){return i.zeroToTwoPi(e+i.PI)-i.PI},i.zeroToTwoPi=function(e){var t=i.mod(e,i.TWO_PI);return Math.abs(t)<i.EPSILON14&&Math.abs(e)>i.EPSILON14?i.TWO_PI:t},i.mod=function(e,t){return(e%t+t)%t},i.equalsEpsilon=function(e,n,r,i){i=t(i,r);var a=Math.abs(e-n);return a<=i||a<=r*Math.max(Math.abs(e),Math.abs(n))};var a=[1];i.factorial=function(e){var t=a.length;if(e>=t)for(var n=a[t-1],r=t;r<=e;r++)a.push(n*r);return a[e]},i.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},i.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},i.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},i.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return i.setRandomNumberSeed=function(t){o=new e(t)},i.nextRandomNumber=function(){return o.random()},i.acosClamped=function(e){return Math.acos(i.clamp(e,-1,1))},i.asinClamped=function(e){return Math.asin(i.clamp(e,-1,1))},i.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},i.logBase=function(e,t){return Math.log(e)/Math.log(t)},i.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},i}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var i=e.clock,a=e.cone,u=t(e.magnitude,1),s=u*Math.sin(a);return r.x=s*Math.cos(i),r.y=s*Math.sin(i),r.z=u*Math.cos(a),r},o.fromElements=function(e,t,r,i){return n(i)?(i.x=e,i.y=t,i.z=r,i):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new o),i.x=e[r++],i.y=e[r++],i.z=e[r],i},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var i=0;i<r;++i)o.pack(e[i],t,3*i);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var i=0;i<r;i+=3){var a=i/3;t[a]=o.unpack(e,i,t[a])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,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};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var n=o.dot(c,l),r=o.magnitude(o.cross(c,l,c));return Math.atan2(r,n)};var f=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,i){return e===t||n(e)&&n(t)&&a.equalsEpsilon(e.x,t.x,r,i)&&a.equalsEpsilon(e.y,t.y,r,i)&&a.equalsEpsilon(e.z,t.z,r,i)},o.cross=function(e,t,n){var r=e.x,i=e.y,a=e.z,o=t.x,u=t.y,s=t.z,c=i*s-a*u,l=a*o-r*s,f=r*u-i*o;return n.x=c,n.y=l,n.z=f,n},o.fromDegrees=function(e,t,n,r,i){return e=a.toRadians(e),t=a.toRadians(t),o.fromRadians(e,t,n,r,i)};var h=new o,E=new o,d=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,i,a,u){i=t(i,0);var s=n(a)?a.radiiSquared:d,c=Math.cos(r);h.x=c*Math.cos(e),h.y=c*Math.sin(e),h.z=Math.sin(r),h=o.normalize(h,h),o.multiplyComponents(s,h,E);var l=Math.sqrt(o.dot(h,E));return E=o.divideByScalar(E,l,E),h=o.multiplyByScalar(h,i,h),n(u)||(u=new o),o.add(E,h,u)},o.fromDegreesArray=function(e,t,r){var i=e.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],s=e[a+1],c=a/2;r[c]=o.fromDegrees(u,s,0,t,r[c])}return r},o.fromRadiansArray=function(e,t,r){var i=e.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],s=e[a+1],c=a/2;r[c]=o.fromRadians(u,s,0,t,r[c])}return r},o.fromDegreesArrayHeights=function(e,t,r){var i=e.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],s=e[a+1],c=e[a+2],l=a/3;r[l]=o.fromDegrees(u,s,c,t,r[l])}return r},o.fromRadiansArrayHeights=function(e,t,r){var i=e.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],s=e[a+1],c=e[a+2],l=a/3;r[l]=o.fromRadians(u,s,c,t,r[l])}return r},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,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function i(n,i,u,s,c){var l=n.x,f=n.y,h=n.z,E=i.x,d=i.y,m=i.z,_=l*l*E*E,p=f*f*d*d,y=h*h*m*m,T=_+p+y,R=Math.sqrt(1/T),A=e.multiplyByScalar(n,R,a);if(T<s)return isFinite(R)?e.clone(A,c):void 0;var S=u.x,v=u.y,N=u.z,O=o;O.x=A.x*S*2,O.y=A.y*v*2,O.z=A.z*N*2;var I,g,M,x,w,C,P,U,D,L,F,z=(1-R)*e.magnitude(n)/(.5*e.magnitude(O)),B=0;do{z-=B,M=1/(1+z*S),x=1/(1+z*v),w=1/(1+z*N),C=M*M,P=x*x,U=w*w,D=C*M,L=P*x,F=U*w,I=_*C+p*P+y*U-1,g=_*D*S+p*L*v+y*F*N;var b=-2*g;B=I/b}while(Math.abs(I)>r.EPSILON12);return t(c)?(c.x=l*M,c.y=f*x,c.z=h*w,c):new e(l*M,f*x,h*w)}var a=new e,o=new e;return i}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,i,a,o){"use strict";function u(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)}u.fromRadians=function(e,r,i,a){return i=t(i,0),n(a)?(a.longitude=e,a.latitude=r,a.height=i,a):new u(e,r,i)},u.fromDegrees=function(e,t,n,r){return e=a.toRadians(e),t=a.toRadians(t),u.fromRadians(e,t,n,r)};var s=new e,c=new e,l=new e,f=new e(1/6378137,1/6378137,1/6356752.314245179),h=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),E=a.EPSILON1;return u.fromCartesian=function(t,r,i){var d=n(r)?r.oneOverRadii:f,m=n(r)?r.oneOverRadiiSquared:h,_=n(r)?r._centerToleranceSquared:E,p=o(t,d,m,_,c);if(n(p)){var y=e.multiplyComponents(p,m,s);y=e.normalize(y,y);var T=e.subtract(t,p,l),R=Math.atan2(y.y,y.x),A=Math.asin(y.z),S=a.sign(e.dot(T,t))*e.magnitude(T);return n(i)?(i.longitude=R,i.latitude=A,i.height=S,i):new u(R,A,S)}},u.clone=function(e,t){if(n(e))return n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},u.ZERO=i(new u(0,0,0)),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,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,i,a,o,u,s){"use strict";function c(t,r,i,a){r=n(r,0),i=n(i,0),a=n(a,0),t._radii=new e(r,i,a),t._radiiSquared=new e(r*r,i*i,a*a),t._radiiToTheFourth=new e(r*r*r*r,i*i*i*i,a*a*a*a),t._oneOverRadii=new e(0===r?0:1/r,0===i?0:1/i,0===a?0:1/a),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===i?0:1/(i*i),0===a?0:1/(a*a)),t._minimumRadius=Math.min(r,i,a),t._maximumRadius=Math.max(r,i,a),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,c(this,e,t,n)}i(l.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}}}),l.clone=function(t,n){if(r(t)){var i=t._radii;return r(n)?(e.clone(i,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new l(i.x,i.y,i.z)}},l.fromCartesian3=function(e,t){return r(t)||(t=new l),r(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,r,i){return i=n(i,0),e.pack(t._radii,r,i),r},l.unpack=function(t,r,i){r=n(r,0);var a=e.unpack(t,r);return l.fromCartesian3(a,i)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,n){var i=t.longitude,a=t.latitude,o=Math.cos(a),u=o*Math.cos(i),s=o*Math.sin(i),c=Math.sin(a);return r(n)||(n=new e),n.x=u,n.y=s,n.z=c,e.normalize(n,n)},l.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var f=new e,h=new e;l.prototype.cartographicToCartesian=function(t,n){var i=f,a=h;this.geodeticSurfaceNormalCartographic(t,i),e.multiplyComponents(this._radiiSquared,i,a);var o=Math.sqrt(e.dot(i,a));return e.divideByScalar(a,o,a),e.multiplyByScalar(i,t.height,i),r(n)||(n=new e),e.add(a,i,n)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;i<n;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var E=new e,d=new e,m=new e;return l.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,d);if(r(a)){var o=this.geodeticSurfaceNormal(a,E),s=e.subtract(n,a,m),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),f=u.sign(e.dot(s,n))*e.magnitude(s);return r(i)?(i.longitude=c,i.latitude=l,i.height=f,i):new t(c,l,f)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;i<n;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var i=t.x,a=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*u.z);return e.multiplyByScalar(t,s,n)},l.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},l.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},l.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,i,a){i=n(i,0);var o=this._sqauredXOverSquaredZ;if(r(a)||(a=new e),a.x=0,a.y=0,a.z=t.z*(1-o),!(Math.abs(a.z)>=this._radii.z-i))return a},l}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,i,a,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return i(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var i=this._semimajorAxis,a=t.longitude*i,o=t.latitude*i,u=t.height;return r(n)?(n.x=a,n.y=o,n.z=u,n):new e(a,o,u)},u.prototype.unproject=function(e,n){var i=this._oneOverSemimajorAxis,a=e.x*i,o=e.y*i,u=e.z;return r(n)?(n.longitude=a,n.latitude=o,n.height=u,n):new t(a,o,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";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a,o){"use strict";function u(e,n,r,i,a,o,u,s,c){this[0]=t(e,0),this[1]=t(i,0),this[2]=t(u,0),this[3]=t(n,0),this[4]=t(a,0),this[5]=t(s,0),this[6]=t(r,0),this[7]=t(o,0),this[8]=t(c,0)}function s(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function c(e){for(var t=0,n=0;n<3;++n){var r=e[u.getElementIndex(d[n],E[n])];t+=2*r*r}return Math.sqrt(t)}function l(e,t){for(var n=o.EPSILON15,r=0,i=1,a=0;a<3;++a){var s=Math.abs(e[u.getElementIndex(d[a],E[a])]);s>r&&(i=a,r=s)}var c=1,l=0,f=E[i],h=d[i];if(Math.abs(e[u.getElementIndex(h,f)])>n){var m,_=e[u.getElementIndex(h,h)],p=e[u.getElementIndex(f,f)],y=e[u.getElementIndex(h,f)],T=(_-p)/2/y;m=T<0?-1/(-T+Math.sqrt(1+T*T)):1/(T+Math.sqrt(1+T*T)),c=1/Math.sqrt(1+m*m),l=m*c}return t=u.clone(u.IDENTITY,t),t[u.getElementIndex(f,f)]=t[u.getElementIndex(h,h)]=c,t[u.getElementIndex(h,f)]=l,t[u.getElementIndex(f,h)]=-l,t}u.packedLength=9,u.pack=function(e,n,r){return r=t(r,0),n[r++]=e[0],n[r++]=e[1],n[r++]=e[2],n[r++]=e[3],n[r++]=e[4],n[r++]=e[5],n[r++]=e[6],n[r++]=e[7],n[r++]=e[8],n},u.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new u),i[0]=e[r++],i[1]=e[r++],i[2]=e[r++],i[3]=e[r++],i[4]=e[r++],i[5]=e[r++],i[6]=e[r++],i[7]=e[r++],i[8]=e[r++],i},u.clone=function(e,t){if(n(e))return n(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 u(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},u.fromArray=function(e,r,i){return r=t(r,0),n(i)||(i=new u),i[0]=e[r],i[1]=e[r+1],i[2]=e[r+2],i[3]=e[r+3],i[4]=e[r+4],i[5]=e[r+5],i[6]=e[r+6],i[7]=e[r+7],i[8]=e[r+8],i},u.fromColumnMajorArray=function(e,t){return u.clone(e,t)},u.fromRowMajorArray=function(e,t){return n(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 u(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},u.fromQuaternion=function(e,t){var r=e.x*e.x,i=e.x*e.y,a=e.x*e.z,o=e.x*e.w,s=e.y*e.y,c=e.y*e.z,l=e.y*e.w,f=e.z*e.z,h=e.z*e.w,E=e.w*e.w,d=r-s-f+E,m=2*(i-h),_=2*(a+l),p=2*(i+h),y=-r+s-f+E,T=2*(c-o),R=2*(a-l),A=2*(c+o),S=-r-s+f+E;return n(t)?(t[0]=d,t[1]=p,t[2]=R,t[3]=m,t[4]=y,t[5]=A,t[6]=_,t[7]=T,t[8]=S,t):new u(d,m,_,p,y,T,R,A,S)},u.fromHeadingPitchRoll=function(e,t){var r=Math.cos(-e.pitch),i=Math.cos(-e.heading),a=Math.cos(e.roll),o=Math.sin(-e.pitch),s=Math.sin(-e.heading),c=Math.sin(e.roll),l=r*i,f=-a*s+c*o*i,h=c*s+a*o*i,E=r*s,d=a*i+c*o*s,m=-o*a+a*o*s,_=-o,p=c*r,y=a*r;return n(t)?(t[0]=l,t[1]=E,t[2]=_,t[3]=f,t[4]=d,t[5]=p,t[6]=h,t[7]=m,t[8]=y,t):new u(l,f,h,E,d,m,_,p,y)},u.fromScale=function(e,t){return n(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 u(e.x,0,0,0,e.y,0,0,0,e.z)},u.fromUniformScale=function(e,t){return n(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 u(e,0,0,0,e,0,0,0,e)},u.fromCrossProduct=function(e,t){return n(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 u(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},u.fromRotationX=function(e,t){var r=Math.cos(e),i=Math.sin(e);return n(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=r,t[5]=i,t[6]=0,t[7]=-i,t[8]=r,t):new u(1,0,0,0,r,-i,0,i,r)},u.fromRotationY=function(e,t){var r=Math.cos(e),i=Math.sin(e);return n(t)?(t[0]=r,t[1]=0,t[2]=-i,t[3]=0,t[4]=1,t[5]=0,t[6]=i,t[7]=0,t[8]=r,t):new u(r,0,i,0,1,0,-i,0,r)},u.fromRotationZ=function(e,t){var r=Math.cos(e),i=Math.sin(e);return n(t)?(t[0]=r,t[1]=i,t[2]=0,t[3]=-i,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new u(r,-i,0,i,r,0,0,0,1)},u.toArray=function(e,t){return n(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]]},u.getElementIndex=function(e,t){return 3*e+t},u.getColumn=function(e,t,n){var r=3*t,i=e[r],a=e[r+1],o=e[r+2];return n.x=i,n.y=a,n.z=o,n},u.setColumn=function(e,t,n,r){r=u.clone(e,r);var i=3*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},u.getRow=function(e,t,n){var r=e[t],i=e[t+3],a=e[t+6];return n.x=r,n.y=i,n.z=a,n},u.setRow=function(e,t,n,r){return r=u.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var f=new e;u.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],f)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],f)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],f)),n};var h=new e;u.getMaximumScale=function(t){return u.getScale(t,h),e.maximumComponent(h)},u.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],i=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],o=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 n[0]=r,n[1]=i,n[2]=a,n[3]=o,n[4]=u,n[5]=s,n[6]=c,n[7]=l,n[8]=f,n},u.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},u.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},u.multiplyByVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[3]*i+e[6]*a,u=e[1]*r+e[4]*i+e[7]*a,s=e[2]*r+e[5]*i+e[8]*a;return n.x=o,n.y=u,n.z=s,n},u.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},u.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},u.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},u.transpose=function(e,t){var n=e[0],r=e[3],i=e[6],a=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var E=[1,0,0],d=[2,2,1],m=new u,_=new u;return u.computeEigenDecomposition=function(e,t){var r=o.EPSILON20,i=10,a=0,f=0;n(t)||(t={});for(var h=t.unitary=u.clone(u.IDENTITY,t.unitary),E=t.diagonal=u.clone(e,t.diagonal),d=r*s(E);f<i&&c(E)>d;)l(E,m),u.transpose(m,_),u.multiply(E,m,E),u.multiply(_,E,E),u.multiply(h,m,h),++a>2&&(++f,a=0);return t},u.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},u.determinant=function(e){var t=e[0],n=e[3],r=e[6],i=e[1],a=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(a*c-s*o)+i*(s*r-n*c)+u*(n*o-a*r)},u.inverse=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],l=e[7],f=e[8],h=u.determinant(e);t[0]=o*f-l*s,t[1]=l*i-r*f,t[2]=r*s-o*i,t[3]=c*s-a*f,t[4]=n*f-c*i,t[5]=a*i-n*s,t[6]=a*l-c*o,t[7]=c*r-n*l,t[8]=n*o-a*r;var E=1/h;return u.multiplyByScalar(t,E,t)},u.equals=function(e,t){return e===t||n(e)&&n(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]},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r},u.IDENTITY=a(new u(1,0,0,0,1,0,0,0,1)),u.ZERO=a(new u(0,0,0,0,0,0,0,0,0)),u.COLUMN0ROW0=0,u.COLUMN0ROW1=1,u.COLUMN0ROW2=2,u.COLUMN1ROW0=3,u.COLUMN1ROW1=4,u.COLUMN1ROW2=5,u.COLUMN2ROW0=6,u.COLUMN2ROW1=7,u.COLUMN2ROW2=8,r(u.prototype,{length:{get:function(){return u.packedLength}}}),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},u}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i){"use strict";function a(t,n,r,i){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0),this.w=e(i,0)}a.fromElements=function(e,n,r,i,o){return t(o)?(o.x=e,o.y=n,o.z=r,o.w=i,o):new a(e,n,r,i)},a.fromColor=function(e,n){return t(n)?(n.x=e.red,n.y=e.green,n.z=e.blue,n.w=e.alpha,n):new a(e.red,e.green,e.blue,e.alpha)},a.clone=function(e,n){if(t(e))return t(n)?(n.x=e.x,n.y=e.y,n.z=e.z,n.w=e.w,n):new a(e.x,e.y,e.z,e.w)},a.packedLength=4,a.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w,n},a.unpack=function(n,r,i){return r=e(r,0),t(i)||(i=new a),i.x=n[r++],i.y=n[r++],i.z=n[r++],i.w=n[r],i},a.packArray=function(e,n){var r=e.length;t(n)?n.length=4*r:n=new Array(4*r);for(var i=0;i<r;++i)a.pack(e[i],n,4*i);return n},a.unpackArray=function(e,n){var r=e.length;t(n)?n.length=r/4:n=new Array(r/4);for(var i=0;i<r;i+=4){var o=i/4;n[o]=a.unpack(e,i,n[o])}return n},a.fromArray=a.unpack,a.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},a.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},a.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},a.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},a.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},a.magnitude=function(e){return Math.sqrt(a.magnitudeSquared(e))};var o=new a;a.distance=function(e,t){return a.subtract(e,t,o),a.magnitude(o)},a.distanceSquared=function(e,t){return a.subtract(e,t,o),a.magnitudeSquared(o)},a.normalize=function(e,t){var n=a.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t},a.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},a.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},a.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},a.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},a.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},a.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},a.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},a.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,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.w=Math.abs(e.w),t};var u=new a;a.lerp=function(e,t,n,r){return a.multiplyByScalar(t,n,u),r=a.multiplyByScalar(e,1-n,r),a.add(u,r,r)};var s=new a;return a.mostOrthogonalAxis=function(e,t){var n=a.normalize(e,s);return a.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?a.clone(a.UNIT_X,t):a.clone(a.UNIT_W,t):n.z<=n.w?a.clone(a.UNIT_Z,t):a.clone(a.UNIT_W,t):n.y<=n.z?n.y<=n.w?a.clone(a.UNIT_Y,t):a.clone(a.UNIT_W,t):n.z<=n.w?a.clone(a.UNIT_Z,t):a.clone(a.UNIT_W,t)},a.equals=function(e,n){return e===n||t(e)&&t(n)&&e.x===n.x&&e.y===n.y&&e.z===n.z&&e.w===n.w},a.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},a.equalsEpsilon=function(e,n,r,a){return e===n||t(e)&&t(n)&&i.equalsEpsilon(e.x,n.x,r,a)&&i.equalsEpsilon(e.y,n.y,r,a)&&i.equalsEpsilon(e.z,n.z,r,a)&&i.equalsEpsilon(e.w,n.w,r,a)},a.ZERO=r(new a(0,0,0,0)),a.UNIT_X=r(new a(1,0,0,0)),a.UNIT_Y=r(new a(0,1,0,0)),a.UNIT_Z=r(new a(0,0,1,0)),a.UNIT_W=r(new a(0,0,0,1)),a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,n){return a.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},a}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,i,a,o,u,s,c){"use strict";function l(e,t,r,i,a,o,u,s,c,l,f,h,E,d,m,_){this[0]=n(e,0),this[1]=n(a,0),this[2]=n(c,0),this[3]=n(E,0),this[4]=n(t,0), -this[5]=n(o,0),this[6]=n(l,0),this[7]=n(d,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(f,0),this[11]=n(m,0),this[12]=n(i,0),this[13]=n(s,0),this[14]=n(h,0),this[15]=n(_,0)}l.packedLength=16,l.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t[r++]=e[9],t[r++]=e[10],t[r++]=e[11],t[r++]=e[12],t[r++]=e[13],t[r++]=e[14],t[r]=e[15],t},l.unpack=function(e,t,i){return t=n(t,0),r(i)||(i=new l),i[0]=e[t++],i[1]=e[t++],i[2]=e[t++],i[3]=e[t++],i[4]=e[t++],i[5]=e[t++],i[6]=e[t++],i[7]=e[t++],i[8]=e[t++],i[9]=e[t++],i[10]=e[t++],i[11]=e[t++],i[12]=e[t++],i[13]=e[t++],i[14]=e[t++],i[15]=e[t],i},l.clone=function(e,t){if(r(e))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):new l(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])},l.fromArray=l.unpack,l.fromColumnMajorArray=function(e,t){return l.clone(e,t)},l.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 l(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])},l.fromRotationTranslation=function(t,i,a){return i=n(i,e.ZERO),r(a)?(a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=0,a[4]=t[3],a[5]=t[4],a[6]=t[5],a[7]=0,a[8]=t[6],a[9]=t[7],a[10]=t[8],a[11]=0,a[12]=i.x,a[13]=i.y,a[14]=i.z,a[15]=1,a):new l(t[0],t[3],t[6],i.x,t[1],t[4],t[7],i.y,t[2],t[5],t[8],i.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(e,t,n,i){r(i)||(i=new l);var a=n.x,o=n.y,u=n.z,s=t.x*t.x,c=t.x*t.y,f=t.x*t.z,h=t.x*t.w,E=t.y*t.y,d=t.y*t.z,m=t.y*t.w,_=t.z*t.z,p=t.z*t.w,y=t.w*t.w,T=s-E-_+y,R=2*(c-p),A=2*(f+m),S=2*(c+p),v=-s+E-_+y,N=2*(d-h),O=2*(f-m),I=2*(d+h),g=-s-E+_+y;return i[0]=T*a,i[1]=S*a,i[2]=O*a,i[3]=0,i[4]=R*o,i[5]=v*o,i[6]=I*o,i[7]=0,i[8]=A*u,i[9]=N*u,i[10]=g*u,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i},l.fromTranslationRotationScale=function(e,t){return l.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},l.fromTranslation=function(e,t){return l.fromRotationTranslation(s.IDENTITY,e,t)},l.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 l(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},l.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 l(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var f=new e,h=new e,E=new e;l.fromCamera=function(t,n){var i=t.position,a=t.direction,o=t.up;e.normalize(a,f),e.normalize(e.cross(f,o,h),h),e.normalize(e.cross(h,f,E),E);var u=h.x,s=h.y,c=h.z,d=f.x,m=f.y,_=f.z,p=E.x,y=E.y,T=E.z,R=i.x,A=i.y,S=i.z,v=u*-R+s*-A+c*-S,N=p*-R+y*-A+T*-S,O=d*R+m*A+_*S;return r(n)?(n[0]=u,n[1]=p,n[2]=-d,n[3]=0,n[4]=s,n[5]=y,n[6]=-m,n[7]=0,n[8]=c,n[9]=T,n[10]=-_,n[11]=0,n[12]=v,n[13]=N,n[14]=O,n[15]=1,n):new l(u,s,c,v,p,y,T,N,-d,-m,-_,O,0,0,0,1)},l.computePerspectiveFieldOfView=function(e,t,n,r,i){var a=Math.tan(.5*e),o=1/a,u=o/t,s=(r+n)/(n-r),c=2*r*n/(n-r);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=o,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=s,i[11]=-1,i[12]=0,i[13]=0,i[14]=c,i[15]=0,i},l.computeOrthographicOffCenter=function(e,t,n,r,i,a,o){var u=1/(t-e),s=1/(r-n),c=1/(a-i),l=-(t+e)*u,f=-(r+n)*s,h=-(a+i)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=f,o[14]=h,o[15]=1,o},l.computePerspectiveOffCenter=function(e,t,n,r,i,a,o){var u=2*i/(t-e),s=2*i/(r-n),c=(t+e)/(t-e),l=(r+n)/(r-n),f=-(a+i)/(a-i),h=-1,E=-2*a*i/(a-i);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=f,o[11]=h,o[12]=0,o[13]=0,o[14]=E,o[15]=0,o},l.computeInfinitePerspectiveOffCenter=function(e,t,n,r,i,a){var o=2*i/(t-e),u=2*i/(r-n),s=(t+e)/(t-e),c=(r+n)/(r-n),l=-1,f=-1,h=-2*i;return a[0]=o,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]=h,a[15]=0,a},l.computeViewportTransformation=function(e,t,r,i){e=n(e,n.EMPTY_OBJECT);var a=n(e.x,0),o=n(e.y,0),u=n(e.width,0),s=n(e.height,0);t=n(t,0),r=n(r,1);var c=.5*u,l=.5*s,f=.5*(r-t),h=c,E=l,d=f,m=a+c,_=o+l,p=t+f,y=1;return i[0]=h,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=E,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=d,i[11]=0,i[12]=m,i[13]=_,i[14]=p,i[15]=y,i},l.computeView=function(t,n,r,i,a){return a[0]=i.x,a[1]=r.x,a[2]=-n.x,a[3]=0,a[4]=i.y,a[5]=r.y,a[6]=-n.y,a[7]=0,a[8]=i.z,a[9]=r.z,a[10]=-n.z,a[11]=0,a[12]=-e.dot(i,t),a[13]=-e.dot(r,t),a[14]=e.dot(n,t),a[15]=1,a},l.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]]},l.getElementIndex=function(e,t){return 4*e+t},l.getColumn=function(e,t,n){var r=4*t,i=e[r],a=e[r+1],o=e[r+2],u=e[r+3];return n.x=i,n.y=a,n.z=o,n.w=u,n},l.setColumn=function(e,t,n,r){r=l.clone(e,r);var i=4*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r[i+3]=n.w,r},l.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},l.getRow=function(e,t,n){var r=e[t],i=e[t+4],a=e[t+8],o=e[t+12];return n.x=r,n.y=i,n.z=a,n.w=o,n},l.setRow=function(e,t,n,r){return r=l.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var d=new e;l.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],d)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],d)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],d)),n};var m=new e;l.getMaximumScale=function(t){return l.getScale(t,m),e.maximumComponent(m)},l.multiply=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],f=e[8],h=e[9],E=e[10],d=e[11],m=e[12],_=e[13],p=e[14],y=e[15],T=t[0],R=t[1],A=t[2],S=t[3],v=t[4],N=t[5],O=t[6],I=t[7],g=t[8],M=t[9],x=t[10],w=t[11],C=t[12],P=t[13],U=t[14],D=t[15],L=r*T+u*R+f*A+m*S,F=i*T+s*R+h*A+_*S,z=a*T+c*R+E*A+p*S,B=o*T+l*R+d*A+y*S,b=r*v+u*N+f*O+m*I,G=i*v+s*N+h*O+_*I,q=a*v+c*N+E*O+p*I,W=o*v+l*N+d*O+y*I,H=r*g+u*M+f*x+m*w,X=i*g+s*M+h*x+_*w,V=a*g+c*M+E*x+p*w,Y=o*g+l*M+d*x+y*w,Z=r*C+u*P+f*U+m*D,k=i*C+s*P+h*U+_*D,j=a*C+c*P+E*U+p*D,K=o*C+l*P+d*U+y*D;return n[0]=L,n[1]=F,n[2]=z,n[3]=B,n[4]=b,n[5]=G,n[6]=q,n[7]=W,n[8]=H,n[9]=X,n[10]=V,n[11]=Y,n[12]=Z,n[13]=k,n[14]=j,n[15]=K,n},l.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},l.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},l.multiplyTransformation=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=e[12],E=e[13],d=e[14],m=t[0],_=t[1],p=t[2],y=t[4],T=t[5],R=t[6],A=t[8],S=t[9],v=t[10],N=t[12],O=t[13],I=t[14],g=r*m+o*_+c*p,M=i*m+u*_+l*p,x=a*m+s*_+f*p,w=r*y+o*T+c*R,C=i*y+u*T+l*R,P=a*y+s*T+f*R,U=r*A+o*S+c*v,D=i*A+u*S+l*v,L=a*A+s*S+f*v,F=r*N+o*O+c*I+h,z=i*N+u*O+l*I+E,B=a*N+s*O+f*I+d;return n[0]=g,n[1]=M,n[2]=x,n[3]=0,n[4]=w,n[5]=C,n[6]=P,n[7]=0,n[8]=U,n[9]=D,n[10]=L,n[11]=0,n[12]=F,n[13]=z,n[14]=B,n[15]=1,n},l.multiplyByMatrix3=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=t[0],E=t[1],d=t[2],m=t[3],_=t[4],p=t[5],y=t[6],T=t[7],R=t[8],A=r*h+o*E+c*d,S=i*h+u*E+l*d,v=a*h+s*E+f*d,N=r*m+o*_+c*p,O=i*m+u*_+l*p,I=a*m+s*_+f*p,g=r*y+o*T+c*R,M=i*y+u*T+l*R,x=a*y+s*T+f*R;return n[0]=A,n[1]=S,n[2]=v,n[3]=0,n[4]=N,n[5]=O,n[6]=I,n[7]=0,n[8]=g,n[9]=M,n[10]=x,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},l.multiplyByTranslation=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=r*e[0]+i*e[4]+a*e[8]+e[12],u=r*e[1]+i*e[5]+a*e[9]+e[13],s=r*e[2]+i*e[6]+a*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=s,n[15]=e[15],n};var _=new e;l.multiplyByUniformScale=function(e,t,n){return _.x=t,_.y=t,_.z=t,l.multiplyByScale(e,_,n)},l.multiplyByScale=function(e,t,n){var r=t.x,i=t.y,a=t.z;return 1===r&&1===i&&1===a?l.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=i*e[4],n[5]=i*e[5],n[6]=i*e[6],n[7]=0,n[8]=a*e[8],n[9]=a*e[9],n[10]=a*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},l.multiplyByVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=t.w,u=e[0]*r+e[4]*i+e[8]*a+e[12]*o,s=e[1]*r+e[5]*i+e[9]*a+e[13]*o,c=e[2]*r+e[6]*i+e[10]*a+e[14]*o,l=e[3]*r+e[7]*i+e[11]*a+e[15]*o;return n.x=u,n.y=s,n.z=c,n.w=l,n},l.multiplyByPointAsVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[4]*i+e[8]*a,u=e[1]*r+e[5]*i+e[9]*a,s=e[2]*r+e[6]*i+e[10]*a;return n.x=o,n.y=u,n.z=s,n},l.multiplyByPoint=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[4]*i+e[8]*a+e[12],u=e[1]*r+e[5]*i+e[9]*a+e[13],s=e[2]*r+e[6]*i+e[10]*a+e[14];return n.x=o,n.y=u,n.z=s,n},l.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},l.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},l.transpose=function(e,t){var n=e[1],r=e[2],i=e[3],a=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=a,t[10]=e[10],t[11]=e[14],t[12]=i,t[13]=o,t[14]=u,t[15]=e[15],t},l.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},l.equals=function(e,t){return e===t||r(e)&&r(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},l.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},l.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},l.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};var p=new s,y=new s,T=new t,R=new t(0,0,0,1);return l.inverse=function(e,n){if(s.equalsEpsilon(l.getRotation(e,p),y,u.EPSILON7)&&t.equals(l.getRow(e,3,T),R))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],i=e[4],a=e[8],o=e[12],f=e[1],h=e[5],E=e[9],d=e[13],m=e[2],_=e[6],A=e[10],S=e[14],v=e[3],N=e[7],O=e[11],I=e[15],g=A*I,M=S*O,x=_*I,w=S*N,C=_*O,P=A*N,U=m*I,D=S*v,L=m*O,F=A*v,z=m*N,B=_*v,b=g*h+w*E+C*d-(M*h+x*E+P*d),G=M*f+U*E+F*d-(g*f+D*E+L*d),q=x*f+D*h+z*d-(w*f+U*h+B*d),W=P*f+L*h+B*E-(C*f+F*h+z*E),H=M*i+x*a+P*o-(g*i+w*a+C*o),X=g*r+D*a+L*o-(M*r+U*a+F*o),V=w*r+U*i+B*o-(x*r+D*i+z*o),Y=C*r+F*i+z*a-(P*r+L*i+B*a);g=a*d,M=o*E,x=i*d,w=o*h,C=i*E,P=a*h,U=r*d,D=o*f,L=r*E,F=a*f,z=r*h,B=i*f;var Z=g*N+w*O+C*I-(M*N+x*O+P*I),k=M*v+U*O+F*I-(g*v+D*O+L*I),j=x*v+D*N+z*I-(w*v+U*N+B*I),K=P*v+L*N+B*O-(C*v+F*N+z*O),J=x*A+P*S+M*_-(C*S+g*_+w*A),Q=L*S+g*m+D*A-(U*A+F*S+M*m),$=U*_+B*S+w*m-(z*S+x*m+D*_),ee=z*A+C*m+F*_-(L*_+B*A+P*m),te=r*b+i*G+a*q+o*W;if(Math.abs(te)<u.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=b*te,n[1]=G*te,n[2]=q*te,n[3]=W*te,n[4]=H*te,n[5]=X*te,n[6]=V*te,n[7]=Y*te,n[8]=Z*te,n[9]=k*te,n[10]=j*te,n[11]=K*te,n[12]=J*te,n[13]=Q*te,n[14]=$*te,n[15]=ee*te,n},l.inverseTransformation=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],f=e[12],h=e[13],E=e[14],d=-n*f-r*h-i*E,m=-a*f-o*h-u*E,_=-s*f-c*h-l*E;return t[0]=n,t[1]=a,t[2]=s,t[3]=0,t[4]=r,t[5]=o,t[6]=c,t[7]=0,t[8]=i,t[9]=u,t[10]=l,t[11]=0,t[12]=d,t[13]=m,t[14]=_,t[15]=1,t},l.IDENTITY=o(new l(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),l.ZERO=o(new l(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN0ROW3=3,l.COLUMN1ROW0=4,l.COLUMN1ROW1=5,l.COLUMN1ROW2=6,l.COLUMN1ROW3=7,l.COLUMN2ROW0=8,l.COLUMN2ROW1=9,l.COLUMN2ROW2=10,l.COLUMN2ROW3=11,l.COLUMN3ROW0=12,l.COLUMN3ROW1=13,l.COLUMN3ROW2=14,l.COLUMN3ROW3=15,i(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.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]+")"},l}),define("Core/Rectangle",["./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,i,a,o,u){"use strict";function s(e,n,r,i){this.west=t(e,0),this.south=t(n,0),this.east=t(r,0),this.north=t(i,0)}r(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,n,r){return r=t(r,0),n[r++]=e.west,n[r++]=e.south,n[r++]=e.east,n[r]=e.north,n},s.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new s),i.west=e[r++],i.south=e[r++],i.east=e[r++],i.north=e[r],i},s.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=u.TWO_PI),t-n},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,r,i,a,o){return e=u.toRadians(t(e,0)),r=u.toRadians(t(r,0)),i=u.toRadians(t(i,0)),a=u.toRadians(t(a,0)),n(o)?(o.west=e,o.south=r,o.east=i,o.north=a,o):new s(e,r,i,a)},s.fromCartographicArray=function(e,t){for(var r=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE,f=0,h=e.length;f<h;f++){var E=e[f];r=Math.min(r,E.longitude),i=Math.max(i,E.longitude),c=Math.min(c,E.latitude),l=Math.max(l,E.latitude);var d=E.longitude>=0?E.longitude:E.longitude+u.TWO_PI;a=Math.min(a,d),o=Math.max(o,d)}return i-r>o-a&&(r=a,i=o,i>u.PI&&(i-=u.TWO_PI),r>u.PI&&(r-=u.TWO_PI)),n(t)?(t.west=r,t.south=c,t.east=i,t.north=l,t):new s(r,c,i,l)},s.fromCartesianArray=function(e,t,r){for(var i=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=Number.MAX_VALUE,f=-Number.MAX_VALUE,h=0,E=e.length;h<E;h++){var d=t.cartesianToCartographic(e[h]);i=Math.min(i,d.longitude),a=Math.max(a,d.longitude),l=Math.min(l,d.latitude),f=Math.max(f,d.latitude);var m=d.longitude>=0?d.longitude:d.longitude+u.TWO_PI;o=Math.min(o,m),c=Math.max(c,m)}return a-i>c-o&&(i=o,a=c,a>u.PI&&(a-=u.TWO_PI),i>u.PI&&(i-=u.TWO_PI)),n(r)?(r.west=i,r.south=l,r.east=a,r.north=f,r):new s(i,l,a,f)},s.clone=function(e,t){if(n(e))return n(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,t){return e===t||n(e)&&n(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},s.prototype.equalsEpsilon=function(e,t){return n(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},s.validate=function(e){},s.southwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.south,r.height=0,r):new e(t.west,t.south)},s.northwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.north,r.height=0,r):new e(t.west,t.north)},s.northeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.north,r.height=0,r):new e(t.east,t.north)},s.southeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.south,r.height=0,r):new e(t.east,t.south)},s.center=function(t,r){var i=t.east,a=t.west;i<a&&(i+=u.TWO_PI);var o=u.negativePiToPi(.5*(a+i)),s=.5*(t.south+t.north);return n(r)?(r.longitude=o,r.latitude=s,r.height=0,r):new e(o,s)},s.intersection=function(e,t,r){var i=e.east,a=e.west,o=t.east,c=t.west;i<a&&o>0?i+=u.TWO_PI:o<c&&i>0&&(o+=u.TWO_PI),i<a&&c<0?c+=u.TWO_PI:o<c&&a<0&&(a+=u.TWO_PI);var l=u.negativePiToPi(Math.max(a,c)),f=u.negativePiToPi(Math.min(i,o));if(!((e.west<e.east||t.west<t.east)&&f<=l)){var h=Math.max(e.south,t.south),E=Math.min(e.north,t.north);if(!(h>=E))return n(r)?(r.west=l,r.south=h,r.east=f,r.north=E,r):new s(l,h,f,E)}},s.simpleIntersection=function(e,t,r){var i=Math.max(e.west,t.west),a=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(a>=u||i>=o))return n(r)?(r.west=i,r.south=a,r.east=o,r.north=u,r):new s(i,a,o,u)},s.union=function(e,t,r){n(r)||(r=new s);var i=e.east,a=e.west,o=t.east,c=t.west;i<a&&o>0?i+=u.TWO_PI:o<c&&i>0&&(o+=u.TWO_PI),i<a&&c<0?c+=u.TWO_PI:o<c&&a<0&&(a+=u.TWO_PI);var l=u.convertLongitudeRange(Math.min(a,c)),f=u.convertLongitudeRange(Math.max(i,o));return r.west=l,r.south=Math.min(e.south,t.south),r.east=f,r.north=Math.max(e.north,t.north),r},s.expand=function(e,t,r){return n(r)||(r=new s),r.west=Math.min(e.west,t.longitude),r.south=Math.min(e.south,t.latitude),r.east=Math.max(e.east,t.longitude),r.north=Math.max(e.north,t.latitude),r},s.contains=function(e,t){var n=t.longitude,r=t.latitude,i=e.west,a=e.east;return a<i&&(a+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>i||u.equalsEpsilon(n,i,u.EPSILON14))&&(n<a||u.equalsEpsilon(n,a,u.EPSILON14))&&r>=e.south&&r<=e.north};var c=new e;return s.subsample=function(e,r,i,o){r=t(r,a.WGS84),i=t(i,0),n(o)||(o=[]);var l=0,f=e.north,h=e.south,E=e.east,d=e.west,m=c;m.height=i,m.longitude=d,m.latitude=f,o[l]=r.cartographicToCartesian(m,o[l]),l++,m.longitude=E,o[l]=r.cartographicToCartesian(m,o[l]),l++,m.latitude=h,o[l]=r.cartographicToCartesian(m,o[l]),l++,m.longitude=d,o[l]=r.cartographicToCartesian(m,o[l]),l++,f<0?m.latitude=f:h>0?m.latitude=h:m.latitude=0;for(var _=1;_<8;++_)m.longitude=-Math.PI+_*u.PI_OVER_TWO,s.contains(e,m)&&(o[l]=r.cartographicToCartesian(m,o[l]),l++);return 0===m.latitude&&(m.longitude=d,o[l]=r.cartographicToCartesian(m,o[l]),l++,m.longitude=E,o[l]=r.cartographicToCartesian(m,o[l]),l++),o.length=l,o},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,i,a,o,u,s,c,l,f){"use strict";function h(t,r){this.center=e.clone(n(t,e.ZERO)),this.radius=n(r,0)}var E=new e,d=new e,m=new e,_=new e,p=new e,y=new e,T=new e,R=new e,A=new e,S=new e,v=new e,N=new e;h.fromPoints=function(t,n){if(r(n)||(n=new h),!r(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var i=e.clone(t[0],T),a=e.clone(i,E),o=e.clone(i,d),u=e.clone(i,m),s=e.clone(i,_),c=e.clone(i,p),l=e.clone(i,y),f=t.length,O=1;O<f;O++){e.clone(t[O],i);var I=i.x,g=i.y,M=i.z;I<a.x&&e.clone(i,a),I>s.x&&e.clone(i,s),g<o.y&&e.clone(i,o),g>c.y&&e.clone(i,c),M<u.z&&e.clone(i,u),M>l.z&&e.clone(i,l)}var x=e.magnitudeSquared(e.subtract(s,a,R)),w=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=a,U=s,D=x;w>D&&(D=w,P=o,U=c),C>D&&(D=C,P=u,U=l);var L=A;L.x=.5*(P.x+U.x),L.y=.5*(P.y+U.y),L.z=.5*(P.z+U.z);var F=e.magnitudeSquared(e.subtract(U,L,R)),z=Math.sqrt(F),B=S;B.x=a.x,B.y=o.y,B.z=u.z;var b=v;b.x=s.x,b.y=c.y,b.z=l.z;var G=e.multiplyByScalar(e.add(B,b,R),.5,N),q=0;for(O=0;O<f;O++){e.clone(t[O],i);var W=e.magnitude(e.subtract(i,G,R));W>q&&(q=W);var H=e.magnitudeSquared(e.subtract(i,L,R));if(H>F){var X=Math.sqrt(H);z=.5*(z+X),F=z*z;var V=X-z;L.x=(z*L.x+V*i.x)/X,L.y=(z*L.y+V*i.y)/X,L.z=(z*L.z+V*i.z)/X}}return z<q?(e.clone(L,n.center),n.radius=z):(e.clone(G,n.center),n.radius=q),n};var O=new o,I=new e,g=new e,M=new t,x=new t;h.fromRectangle2D=function(e,t,n){return h.fromRectangleWithHeights2D(e,t,0,0,n)},h.fromRectangleWithHeights2D=function(t,i,a,o,u){if(r(u)||(u=new h),!r(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;i=n(i,O),f.southwest(t,M),M.height=a,f.northeast(t,x),x.height=o;var s=i.project(M,I),c=i.project(x,g),l=c.x-s.x,E=c.y-s.y,d=c.z-s.z;u.radius=.5*Math.sqrt(l*l+E*E+d*d);var m=u.center;return m.x=s.x+.5*l,m.y=s.y+.5*E,m.z=s.z+.5*d,u};var w=[];h.fromRectangle3D=function(e,t,i,o){t=n(t,a.WGS84),i=n(i,0);var u;return r(e)&&(u=f.subsample(e,t,i,w)),h.fromPoints(u,o)},h.fromVertices=function(t,i,a,o){if(r(o)||(o=new h),!r(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;i=n(i,e.ZERO),a=n(a,3);var u=T;u.x=t[0]+i.x,u.y=t[1]+i.y,u.z=t[2]+i.z;for(var s=e.clone(u,E),c=e.clone(u,d),l=e.clone(u,m),f=e.clone(u,_),O=e.clone(u,p),I=e.clone(u,y),g=t.length,M=0;M<g;M+=a){var x=t[M]+i.x,w=t[M+1]+i.y,C=t[M+2]+i.z;u.x=x,u.y=w,u.z=C,x<s.x&&e.clone(u,s),x>f.x&&e.clone(u,f),w<c.y&&e.clone(u,c),w>O.y&&e.clone(u,O),C<l.z&&e.clone(u,l),C>I.z&&e.clone(u,I)}var P=e.magnitudeSquared(e.subtract(f,s,R)),U=e.magnitudeSquared(e.subtract(O,c,R)),D=e.magnitudeSquared(e.subtract(I,l,R)),L=s,F=f,z=P;U>z&&(z=U,L=c,F=O),D>z&&(z=D,L=l,F=I);var B=A;B.x=.5*(L.x+F.x),B.y=.5*(L.y+F.y),B.z=.5*(L.z+F.z);var b=e.magnitudeSquared(e.subtract(F,B,R)),G=Math.sqrt(b),q=S;q.x=s.x,q.y=c.y,q.z=l.z;var W=v;W.x=f.x,W.y=O.y,W.z=I.z;var H=e.multiplyByScalar(e.add(q,W,R),.5,N),X=0;for(M=0;M<g;M+=a){u.x=t[M]+i.x,u.y=t[M+1]+i.y,u.z=t[M+2]+i.z;var V=e.magnitude(e.subtract(u,H,R));V>X&&(X=V);var Y=e.magnitudeSquared(e.subtract(u,B,R));if(Y>b){var Z=Math.sqrt(Y);G=.5*(G+Z),b=G*G;var k=Z-G;B.x=(G*B.x+k*u.x)/Z,B.y=(G*B.y+k*u.y)/Z,B.z=(G*B.z+k*u.z)/Z}}return G<X?(e.clone(B,o.center),o.radius=G):(e.clone(H,o.center),o.radius=X),o},h.fromEncodedCartesianVertices=function(t,n,i){if(r(i)||(i=new h),!r(t)||!r(n)||t.length!==n.length||0===t.length)return i.center=e.clone(e.ZERO,i.center),i.radius=0,i;var a=T;a.x=t[0]+n[0],a.y=t[1]+n[1],a.z=t[2]+n[2];for(var o=e.clone(a,E),u=e.clone(a,d),s=e.clone(a,m),c=e.clone(a,_),l=e.clone(a,p),f=e.clone(a,y),O=t.length,I=0;I<O;I+=3){var g=t[I]+n[I],M=t[I+1]+n[I+1],x=t[I+2]+n[I+2];a.x=g,a.y=M,a.z=x,g<o.x&&e.clone(a,o),g>c.x&&e.clone(a,c),M<u.y&&e.clone(a,u),M>l.y&&e.clone(a,l),x<s.z&&e.clone(a,s),x>f.z&&e.clone(a,f)}var w=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=e.magnitudeSquared(e.subtract(f,s,R)),U=o,D=c,L=w;C>L&&(L=C,U=u,D=l),P>L&&(L=P,U=s,D=f);var F=A;F.x=.5*(U.x+D.x),F.y=.5*(U.y+D.y),F.z=.5*(U.z+D.z);var z=e.magnitudeSquared(e.subtract(D,F,R)),B=Math.sqrt(z),b=S;b.x=o.x,b.y=u.y,b.z=s.z;var G=v;G.x=c.x,G.y=l.y,G.z=f.z;var q=e.multiplyByScalar(e.add(b,G,R),.5,N),W=0;for(I=0;I<O;I+=3){a.x=t[I]+n[I],a.y=t[I+1]+n[I+1],a.z=t[I+2]+n[I+2];var H=e.magnitude(e.subtract(a,q,R));H>W&&(W=H);var X=e.magnitudeSquared(e.subtract(a,F,R));if(X>z){var V=Math.sqrt(X);B=.5*(B+V),z=B*B;var Y=V-B;F.x=(B*F.x+Y*a.x)/V,F.y=(B*F.y+Y*a.y)/V,F.z=(B*F.z+Y*a.z)/V}}return B<W?(e.clone(F,i.center),i.radius=B):(e.clone(q,i.center),i.radius=W),i},h.fromCornerPoints=function(t,n,i){r(i)||(i=new h);var a=i.center;return e.add(t,n,a),e.multiplyByScalar(a,.5,a),i.radius=e.distance(a,n),i},h.fromEllipsoid=function(t,n){return r(n)||(n=new h),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var C=new e;h.fromBoundingSpheres=function(t,n){if(r(n)||(n=new h),!r(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var i=t.length;if(1===i)return h.clone(t[0],n);if(2===i)return h.union(t[0],t[1],n);for(var a=[],o=0;o<i;o++)a.push(t[o].center);n=h.fromPoints(a,n);var u=n.center,s=n.radius;for(o=0;o<i;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,C)+c.radius)}return n.radius=s,n};var P=new e,U=new e,D=new e;h.fromOrientedBoundingBox=function(t,n){r(n)||(n=new h);var i=t.halfAxes,a=c.getColumn(i,0,P),o=c.getColumn(i,1,U),u=c.getColumn(i,2,D),s=e.magnitude(a),l=e.magnitude(o),f=e.magnitude(u);return n.center=e.clone(t.center,n.center),n.radius=Math.max(s,l,f),n},h.clone=function(t,n){if(r(t))return r(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new h(t.center,t.radius)},h.packedLength=4,h.pack=function(e,t,r){r=n(r,0);var i=e.center;return t[r++]=i.x,t[r++]=i.y,t[r++]=i.z,t[r]=e.radius,t},h.unpack=function(e,t,i){t=n(t,0),r(i)||(i=new h);var a=i.center;return a.x=e[t++],a.y=e[t++],a.z=e[t++],i.radius=e[t],i};var L=new e,F=new e;h.union=function(t,n,i){r(i)||(i=new h);var a=t.center,o=t.radius,u=n.center,s=n.radius,c=e.subtract(u,a,L),l=e.magnitude(c);if(o>=l+s)return t.clone(i),i;if(s>=l+o)return n.clone(i),i;var f=.5*(o+l+s),E=e.multiplyByScalar(c,(-o+f)/l,F);return e.add(E,a,E),e.clone(E,i.center),i.radius=f,i};var z=new e;h.expand=function(t,n,r){r=h.clone(t,r);var i=e.magnitude(e.subtract(n,r.center,z));return i>r.radius&&(r.radius=i),r},h.intersectPlane=function(t,n){var r=t.center,i=t.radius,a=n.normal,o=e.dot(a,r)+n.distance;return o<-i?u.OUTSIDE:o<i?u.INTERSECTING:u.INSIDE},h.transform=function(e,t,n){return r(n)||(n=new h),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=l.getMaximumScale(t)*e.radius,n};var B=new e;h.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,B);return e.magnitudeSquared(r)-t.radius*t.radius},h.transformWithoutScale=function(e,t,n){return r(n)||(n=new h),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var b=new e;h.computePlaneDistances=function(t,n,i,a){r(a)||(a=new s);var o=e.subtract(t.center,n,b),u=e.dot(i,o);return a.start=u-t.radius,a.stop=u+t.radius,a};for(var G=new e,q=new e,W=new e,H=new e,X=new e,V=new t,Y=new Array(8),Z=0;Z<8;++Z)Y[Z]=new e;var k=new o;return h.projectTo2D=function(t,r,i){r=n(r,k);var a=r.ellipsoid,o=t.center,u=t.radius,s=a.geodeticSurfaceNormal(o,G),c=e.cross(e.UNIT_Z,s,q);e.normalize(c,c);var l=e.cross(s,c,W);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var f=e.negate(l,X),E=e.negate(c,H),d=Y,m=d[0];e.add(s,l,m),e.add(m,c,m),m=d[1],e.add(s,l,m),e.add(m,E,m),m=d[2],e.add(s,f,m),e.add(m,E,m),m=d[3],e.add(s,f,m),e.add(m,c,m),e.negate(s,s),m=d[4],e.add(s,l,m),e.add(m,c,m),m=d[5],e.add(s,l,m),e.add(m,E,m),m=d[6],e.add(s,f,m),e.add(m,E,m),m=d[7],e.add(s,f,m),e.add(m,c,m);for(var _=d.length,p=0;p<_;++p){var y=d[p];e.add(o,y,y);var T=a.cartesianToCartographic(y,V);r.project(T,y)}i=h.fromPoints(d,i),o=i.center;var R=o.x,A=o.y,S=o.z;return o.x=S,o.y=R,o.z=A,i},h.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},h.equals=function(t,n){return t===n||r(t)&&r(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},h.prototype.intersectPlane=function(e){return h.intersectPlane(this,e)},h.prototype.distanceSquaredTo=function(e){return h.distanceSquaredTo(this,e)},h.prototype.computePlaneDistances=function(e,t,n){return h.computePlaneDistances(this,e,t,n)},h.prototype.isOccluded=function(e){return h.isOccluded(this,e)},h.prototype.equals=function(e){return h.equals(this,e)},h.prototype.clone=function(e){return h.clone(this,e)},h}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},i={};return t(i,{element:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(i.supportsFullscreen())return null!==i.element}}}),i.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var i,a=["webkit","moz","o","ms","khtml"],o=0,u=a.length;o<u;++o){var s=a[o];i=s+"RequestFullscreen","function"==typeof t[i]?(r.requestFullscreen=i,n=!0):(i=s+"RequestFullScreen","function"==typeof t[i]&&(r.requestFullscreen=i,n=!0)),i=s+"ExitFullscreen","function"==typeof document[i]?r.exitFullscreen=i:(i=s+"CancelFullScreen","function"==typeof document[i]&&(r.exitFullscreen=i)),i=s+"FullscreenEnabled",void 0!==document[i]?r.fullscreenEnabled=i:(i=s+"FullScreenEnabled",void 0!==document[i]&&(r.fullscreenEnabled=i)),i=s+"FullscreenElement",void 0!==document[i]?r.fullscreenElement=i:(i=s+"FullScreenElement",void 0!==document[i]&&(r.fullscreenElement=i)),i=s+"fullscreenchange",void 0!==document["on"+i]&&("ms"===s&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=s+"fullscreenerror",void 0!==document["on"+i]&&("ms"===s&&(i="MSFullscreenError"),r.fullscreenerror=i)}return n},i.requestFullscreen=function(e,t){i.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},i.exitFullscreen=function(){i.supportsFullscreen()&&document[r.exitFullscreen]()},i}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function i(){if(!t(A)&&(A=!1,!h())){var e=/ Chrome\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(A=!0,S=r(e[1]))}return A}function a(){return i()&&S}function o(){if(!t(v)&&(v=!1,!i()&&!h()&&/ Safari\/[\.0-9]+/.test(R.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(v=!0,N=r(e[1]))}return v}function u(){return o()&&N}function s(){if(!t(O)){O=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(R.userAgent);null!==e&&(O=!0,I=r(e[1]),I.isNightly=!!e[2])}return O}function c(){return s()&&I}function l(){if(!t(g)){g=!1;var e;"Microsoft Internet Explorer"===R.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(g=!0,M=r(e[1]))):"Netscape"===R.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(g=!0,M=r(e[1])))}return g}function f(){return l()&&M}function h(){if(!t(x)){x=!1;var e=/ Edge\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(x=!0,w=r(e[1]))}return x}function E(){return h()&&w}function d(){if(!t(C)){C=!1;var e=/Firefox\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(C=!0,P=r(e[1]))}return C}function m(){return t(U)||(U=/Windows/i.test(R.appVersion)),U}function _(){return d()&&P}function p(){return t(D)||(D="undefined"!=typeof PointerEvent&&(!t(R.pointerEnabled)||R.pointerEnabled)),D}function y(){ -if(!t(F)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;F=t(n)&&""!==n,F&&(L=n)}return F}function T(){return y()?L:void 0}var R;R="undefined"!=typeof navigator?navigator:{};var A,S,v,N,O,I,g,M,x,w,C,P,U,D,L,F,z={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isEdge:h,edgeVersion:E,isFirefox:d,firefoxVersion:_,isWindows:m,hardwareConcurrency:e(R.hardwareConcurrency,3),supportsPointerEvents:p,supportsImageRenderingPixelated:y,imageRenderingValue:T};return z.supportsFullscreen=function(){return n.supportsFullscreen()},z.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},z.supportsWebWorkers=function(){return"undefined"!=typeof Worker},z}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,i,a){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:a.BYTE,UNSIGNED_BYTE:a.UNSIGNED_BYTE,SHORT:a.SHORT,UNSIGNED_SHORT:a.UNSIGNED_SHORT,INT:a.INT,UNSIGNED_INT:a.UNSIGNED_INT,FLOAT:a.FLOAT,DOUBLE:a.DOUBLE};return o.getSizeInBytes=function(e){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.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},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 Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,i){switch(r=e(r,0),i=e(i,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,i);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,i);case o.SHORT:return new Int16Array(n,r,i);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,i);case o.INT:return new Int32Array(n,r,i);case o.UNSIGNED_INT:return new Uint32Array(n,r,i);case o.FLOAT:return new Float32Array(n,r,i);case o.DOUBLE:return new Float64Array(n,r,i)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},i(o)}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===n.POINTS||e===n.LINES||e===n.LINE_LOOP||e===n.LINE_STRIP||e===n.TRIANGLES||e===n.TRIANGLE_STRIP||e===n.TRIANGLE_FAN}};return e(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,i){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,i.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return a.computeNumberOfVertices=function(e){var n=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var i=e.attributes[r],a=i.values.length/i.componentsPerAttribute;n=a}return n},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(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 r}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.binormal=t.binormal,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,n,r,i){"use strict";var a={UNSIGNED_BYTE:i.UNSIGNED_BYTE,UNSIGNED_SHORT:i.UNSIGNED_SHORT,UNSIGNED_INT:i.UNSIGNED_INT};return a.getSizeInBytes=function(e){switch(e){case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},a.validate=function(t){return e(t)&&(t===a.UNSIGNED_BYTE||t===a.UNSIGNED_SHORT||t===a.UNSIGNED_INT)},a.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},a.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)},n(a)}),define("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.position=e(t.position,!1),this.normal=e(t.normal,!1),this.st=e(t.st,!1),this.binormal=e(t.binormal,!1),this.tangent=e(t.tangent,!1),this.color=e(t.color,!1)}return i.POSITION_ONLY=r(new i({position:!0})),i.POSITION_AND_NORMAL=r(new i({position:!0,normal:!0})),i.POSITION_NORMAL_AND_ST=r(new i({position:!0,normal:!0,st:!0})),i.POSITION_AND_ST=r(new i({position:!0,st:!0})),i.POSITION_AND_COLOR=r(new i({position:!0,color:!0})),i.ALL=r(new i({position:!0,normal:!0,st:!0,binormal:!0,tangent:!0})),i.DEFAULT=i.POSITION_NORMAL_AND_ST,i.packedLength=6,i.pack=function(t,n,r){return r=e(r,0),n[r++]=t.position?1:0,n[r++]=t.normal?1:0,n[r++]=t.st?1:0,n[r++]=t.binormal?1:0,n[r++]=t.tangent?1:0,n[r++]=t.color?1:0,n},i.unpack=function(n,r,a){return r=e(r,0),t(a)||(a=new i),a.position=1===n[r++],a.normal=1===n[r++],a.st=1===n[r++],a.binormal=1===n[r++],a.tangent=1===n[r++],a.color=1===n[r++],a},i.clone=function(e,n){if(t(e))return t(n)||(n=new i),n.position=e.position,n.normal=e.normal,n.st=e.st,n.binormal=e.binormal,n.tangent=e.tangent,n.color=e.color,n},i}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Intersect"],function(e,t,n,r,i){"use strict";function a(r,i,a){this.minimum=e.clone(t(r,e.ZERO)),this.maximum=e.clone(t(i,e.ZERO)),n(a)?a=e.clone(a):(a=e.add(this.minimum,this.maximum,new e),e.multiplyByScalar(a,.5,a)),this.center=a}a.fromPoints=function(t,r){if(n(r)||(r=new a),!n(t)||0===t.length)return r.minimum=e.clone(e.ZERO,r.minimum),r.maximum=e.clone(e.ZERO,r.maximum),r.center=e.clone(e.ZERO,r.center),r;for(var i=t[0].x,o=t[0].y,u=t[0].z,s=t[0].x,c=t[0].y,l=t[0].z,f=t.length,h=1;h<f;h++){var E=t[h],d=E.x,m=E.y,_=E.z;i=Math.min(d,i),s=Math.max(d,s),o=Math.min(m,o),c=Math.max(m,c),u=Math.min(_,u),l=Math.max(_,l)}var p=r.minimum;p.x=i,p.y=o,p.z=u;var y=r.maximum;y.x=s,y.y=c,y.z=l;var T=e.add(p,y,r.center);return e.multiplyByScalar(T,.5,T),r},a.clone=function(t,r){if(n(t))return n(r)?(r.minimum=e.clone(t.minimum,r.minimum),r.maximum=e.clone(t.maximum,r.maximum),r.center=e.clone(t.center,r.center),r):new a(t.minimum,t.maximum)},a.equals=function(t,r){return t===r||n(t)&&n(r)&&e.equals(t.center,r.center)&&e.equals(t.minimum,r.minimum)&&e.equals(t.maximum,r.maximum)};var o=new e;return a.intersectPlane=function(t,n){o=e.subtract(t.maximum,t.minimum,o);var r=e.multiplyByScalar(o,.5,o),a=n.normal,u=r.x*Math.abs(a.x)+r.y*Math.abs(a.y)+r.z*Math.abs(a.z),s=e.dot(t.center,a)+n.distance;return s-u>0?i.INSIDE:s+u<0?i.OUTSIDE:i.INTERSECTING},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.intersectPlane=function(e){return a.intersectPlane(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a}),define("Core/Cartesian2",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i){"use strict";function a(t,n){this.x=e(t,0),this.y=e(n,0)}a.fromElements=function(e,n,r){return t(r)?(r.x=e,r.y=n,r):new a(e,n)},a.clone=function(e,n){if(t(e))return t(n)?(n.x=e.x,n.y=e.y,n):new a(e.x,e.y)},a.fromCartesian3=a.clone,a.fromCartesian4=a.clone,a.packedLength=2,a.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r]=t.y,n},a.unpack=function(n,r,i){return r=e(r,0),t(i)||(i=new a),i.x=n[r++],i.y=n[r],i},a.packArray=function(e,n){var r=e.length;t(n)?n.length=2*r:n=new Array(2*r);for(var i=0;i<r;++i)a.pack(e[i],n,2*i);return n},a.unpackArray=function(e,n){var r=e.length;t(n)?n.length=r/2:n=new Array(r/2);for(var i=0;i<r;i+=2){var o=i/2;n[o]=a.unpack(e,i,n[o])}return n},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,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},a.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},a.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},a.magnitude=function(e){return Math.sqrt(a.magnitudeSquared(e))};var o=new a;a.distance=function(e,t){return a.subtract(e,t,o),a.magnitude(o)},a.distanceSquared=function(e,t){return a.subtract(e,t,o),a.magnitudeSquared(o)},a.normalize=function(e,t){var n=a.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t},a.dot=function(e,t){return e.x*t.x+e.y*t.y},a.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n},a.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n},a.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n},a.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n},a.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n},a.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n},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,n,r){return a.multiplyByScalar(t,n,u),r=a.multiplyByScalar(e,1-n,r),a.add(u,r,r)};var s=new a,c=new a;a.angleBetween=function(e,t){return a.normalize(e,s),a.normalize(t,c),i.acosClamped(a.dot(s,c))};var l=new a;return a.mostOrthogonalAxis=function(e,t){var n=a.normalize(e,l);return a.abs(n,n),t=n.x<=n.y?a.clone(a.UNIT_X,t):a.clone(a.UNIT_Y,t)},a.equals=function(e,n){return e===n||t(e)&&t(n)&&e.x===n.x&&e.y===n.y},a.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},a.equalsEpsilon=function(e,n,r,a){return e===n||t(e)&&t(n)&&i.equalsEpsilon(e.x,n.x,r,a)&&i.equalsEpsilon(e.y,n.y,r,a)},a.ZERO=r(new a(0,0)),a.UNIT_X=r(new a(1,0)),a.UNIT_Y=r(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,n){return a.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return"("+this.x+", "+this.y+")"},a}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function n(e,n,r){var i=e+n;return t.sign(e)!==t.sign(n)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(n)))<r?0:i}var r={};return r.computeDiscriminant=function(e,t,n){var r=t*t-4*e*n;return r},r.computeRealRoots=function(e,r,i){var a;if(0===e)return 0===r?[]:[-i/r];if(0===r){if(0===i)return[0,0];var o=Math.abs(i),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(a=-i/e,a<0)return[];var s=Math.sqrt(a);return[-s,s]}if(0===i)return a=-r/e,a<0?[a,0]:[0,a];var c=r*r,l=4*e*i,f=n(c,-l,t.EPSILON14);if(f<0)return[];var h=-.5*n(r,t.sign(r)*Math.sqrt(f),t.EPSILON14);return r>0?[h/e,i/h]:[i/h,h/e]},r}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function n(e,t,n,r){var i,a,o=e,u=t/3,s=n/3,c=r,l=o*s,f=u*c,h=u*u,E=s*s,d=o*s-h,m=o*c-u*s,_=u*c-E,p=4*d*_-m*m;if(p<0){var y,T,R;h*f>=l*E?(y=o,T=d,R=-2*u*d+o*m):(y=c,T=_,R=-c*m+2*s*_);var A=R<0?-1:1,S=-A*Math.abs(y)*Math.sqrt(-p);a=-R+S;var v=a/2,N=v<0?-Math.pow(-v,1/3):Math.pow(v,1/3),O=a===S?-N:-T/N;return i=T<=0?N+O:-R/(N*N+O*O+T),h*f>=l*E?[(i-u)/o]:[-c/(i+s)]}var I=d,g=-2*u*d+o*m,M=_,x=-c*m+2*s*_,w=Math.sqrt(p),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*w,-g)/3);i=2*Math.sqrt(-I);var U=Math.cos(P);a=i*U;var D=i*(-U/2-C*Math.sin(P)),L=a+D>2*u?a-u:D-u,F=o,z=L/F;P=Math.abs(Math.atan2(c*w,-x)/3),i=2*Math.sqrt(-M),U=Math.cos(P),a=i*U,D=i*(-U/2-C*Math.sin(P));var B=-c,b=a+D<2*s?a+s:D+s,G=B/b,q=F*b,W=-L*b-F*B,H=L*B,X=(s*W-u*H)/(-u*W+s*q);return z<=X?z<=G?X<=G?[z,X,G]:[z,G,X]:[G,z,X]:z<=G?[X,z,G]:X<=G?[X,G,z]:[G,X,z]}var r={};return r.computeDiscriminant=function(e,t,n,r){var i=e*e,a=t*t,o=n*n,u=r*r,s=18*e*t*n*r+a*o-27*i*u-4*(e*o*n+a*t*r);return s},r.computeRealRoots=function(e,r,i,a){var o,u;if(0===e)return t.computeRealRoots(r,i,a);if(0===r){if(0===i){if(0===a)return[0,0,0];u=-a/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===a?(o=t.computeRealRoots(e,0,i),0===o.Length?[0]:[o[0],0,o[1]]):n(e,0,i,a)}return 0===i?0===a?(u=-r/e,u<0?[u,0,0]:[0,0,u]):n(e,r,0,a):0===a?(o=t.computeRealRoots(e,r,i),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):n(e,r,i,a)},r}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,n,r){"use strict";function i(t,i,a,o){var u=t*t,s=i-3*u/8,c=a-i*t/2+u*t/8,l=o-a*t/4+i*u/16-3*u*u/256,f=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(f.length>0){var h=-t/4,E=f[f.length-1];if(Math.abs(E)<n.EPSILON14){var d=r.computeRealRoots(1,s,l);if(2===d.length){var m,_=d[0],p=d[1];if(_>=0&&p>=0){var y=Math.sqrt(_),T=Math.sqrt(p);return[h-T,h-y,h+y,h+T]}if(_>=0&&p<0)return m=Math.sqrt(_),[h-m,h+m];if(_<0&&p>=0)return m=Math.sqrt(p),[h-m,h+m]}return[]}if(E>0){var R=Math.sqrt(E),A=(s+E-c/R)/2,S=(s+E+c/R)/2,v=r.computeRealRoots(1,R,A),N=r.computeRealRoots(1,-R,S);return 0!==v.length?(v[0]+=h,v[1]+=h,0!==N.length?(N[0]+=h,N[1]+=h,v[1]<=N[0]?[v[0],v[1],N[0],N[1]]:N[1]<=v[0]?[N[0],N[1],v[0],v[1]]:v[0]>=N[0]&&v[1]<=N[1]?[N[0],v[0],v[1],N[1]]:N[0]>=v[0]&&N[1]<=v[1]?[v[0],N[0],N[1],v[1]]:v[0]>N[0]&&v[0]<N[1]?[N[0],v[0],N[1],v[1]]:[v[0],N[0],v[1],N[1]]):v):0!==N.length?(N[0]+=h,N[1]+=h,N):[]}}return[]}function a(t,i,a,o){var u=a*a,s=i*i,c=t*t,l=-2*i,f=a*t+s-4*o,h=c*o-a*i*t+u,E=e.computeRealRoots(1,l,f,h);if(E.length>0){var d,m,_=E[0],p=i-_,y=p*p,T=t/2,R=p/2,A=y-4*o,S=y+4*Math.abs(o),v=c-4*_,N=c+4*Math.abs(_);if(_<0||A*N<v*S){var O=Math.sqrt(v);d=O/2,m=0===O?0:(t*R-a)/O}else{var I=Math.sqrt(A);d=0===I?0:(t*R-a)/I,m=I/2}var g,M;0===T&&0===d?(g=0,M=0):n.sign(T)===n.sign(d)?(g=T+d,M=_/g):(M=T-d,g=_/M);var x,w;0===R&&0===m?(x=0,w=0):n.sign(R)===n.sign(m)?(x=R+m,w=o/x):(w=R-m,x=o/w);var C=r.computeRealRoots(1,g,x),P=r.computeRealRoots(1,M,w);if(0!==C.length)return 0!==P.length?C[1]<=P[0]?[C[0],C[1],P[0],P[1]]:P[1]<=C[0]?[P[0],P[1],C[0],C[1]]:C[0]>=P[0]&&C[1]<=P[1]?[P[0],C[0],C[1],P[1]]:P[0]>=C[0]&&P[1]<=C[1]?[C[0],P[0],P[1],C[1]]:C[0]>P[0]&&C[0]<P[1]?[P[0],C[0],P[1],C[1]]:[C[0],P[0],C[1],P[1]]:C;if(0!==P.length)return P}return[]}var o={};return o.computeDiscriminant=function(e,t,n,r,i){var a=e*e,o=a*e,u=t*t,s=u*t,c=n*n,l=c*n,f=r*r,h=f*r,E=i*i,d=E*i,m=u*c*f-4*s*h-4*e*l*f+18*e*t*n*h-27*a*f*f+256*o*d+i*(18*s*n*r-4*u*l+16*e*c*c-80*e*t*c*r-6*e*u*f+144*a*n*f)+E*(144*e*u*n-27*u*u-128*a*c-192*a*t*r);return m},o.computeRealRoots=function(t,r,o,u,s){if(Math.abs(t)<n.EPSILON15)return e.computeRealRoots(r,o,u,s);var c=r/t,l=o/t,f=u/t,h=s/t,E=c<0?1:0;switch(E+=l<0?E+1:E,E+=f<0?E+1:E,E+=h<0?E+1:E){case 0:return i(c,l,f,h);case 1:return a(c,l,f,h);case 2:return a(c,l,f,h);case 3:return i(c,l,f,h);case 4:return i(c,l,f,h);case 5:return a(c,l,f,h);case 6:return i(c,l,f,h);case 7:return i(c,l,f,h);case 8:return a(c,l,f,h);case 9:return i(c,l,f,h);case 10:return i(c,l,f,h);case 11:return a(c,l,f,h);case 12:return i(c,l,f,h);case 13:return i(c,l,f,h);case 14:return i(c,l,f,h);case 15:return i(c,l,f,h);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function i(n,r){r=e.clone(t(r,e.ZERO)),e.equals(r,e.ZERO)||e.normalize(r,r),this.origin=e.clone(t(n,e.ZERO)),this.direction=r}return i.getPoint=function(t,r,i){return n(i)||(i=new e),i=e.multiplyByScalar(t.direction,r,i),e.add(t.origin,i,i)},i}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,n,r,i,a,o,u,s,c){"use strict";function l(e,t,n,r){var i=t*t-4*e*n;if(!(i<0)){if(i>0){var a=1/(2*e),o=Math.sqrt(i),u=(-t+o)*a,s=(-t-o)*a;return u<s?(r.root0=u,r.root1=s):(r.root0=s,r.root1=u),r}var c=-t/(2*e);if(0!==c)return r.root0=r.root1=c,r}}function f(t,n,i){r(i)||(i={});var a=t.origin,o=t.direction,u=n.center,s=n.radius*n.radius,c=e.subtract(a,u,p),f=e.dot(o,o),h=2*e.dot(o,c),E=e.magnitudeSquared(c)-s,d=l(f,h,E,A);if(r(d))return i.start=d.root0,i.stop=d.root1,i}function h(e,t,n){var r=e+t;return a.sign(e)!==a.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))<n?0:r}function E(t,n,r,i,c){var l,f=i*i,E=c*c,d=(t[o.COLUMN1ROW1]-t[o.COLUMN2ROW2])*E,m=c*(i*h(t[o.COLUMN1ROW0],t[o.COLUMN0ROW1],a.EPSILON15)+n.y),_=t[o.COLUMN0ROW0]*f+t[o.COLUMN2ROW2]*E+i*n.x+r,p=E*h(t[o.COLUMN2ROW1],t[o.COLUMN1ROW2],a.EPSILON15),y=c*(i*h(t[o.COLUMN2ROW0],t[o.COLUMN0ROW2])+n.z),T=[];if(0===y&&0===p){if(l=u.computeRealRoots(d,m,_),0===l.length)return T;var R=l[0],A=Math.sqrt(Math.max(1-R*R,0));if(T.push(new e(i,c*R,c*-A)),T.push(new e(i,c*R,c*A)),2===l.length){var S=l[1],v=Math.sqrt(Math.max(1-S*S,0));T.push(new e(i,c*S,c*-v)),T.push(new e(i,c*S,c*v))}return T}var N=y*y,O=p*p,I=d*d,g=y*p,M=I+O,x=2*(m*d+g),w=2*_*d+m*m-O+N,C=2*(_*m-g),P=_*_-N;if(0===M&&0===x&&0===w&&0===C)return T;l=s.computeRealRoots(M,x,w,C,P);var U=l.length;if(0===U)return T;for(var D=0;D<U;++D){var L,F=l[D],z=F*F,B=Math.max(1-z,0),b=Math.sqrt(B);L=a.sign(d)===a.sign(_)?h(d*z+_,m*F,a.EPSILON12):a.sign(_)===a.sign(m*F)?h(d*z,m*F+_,a.EPSILON12):h(d*z+m*F,_,a.EPSILON12);var G=h(p*F,y,a.EPSILON15),q=L*G;q<0?T.push(new e(i,c*F,c*b)):q>0?T.push(new e(i,c*F,c*-b)):0!==b?(T.push(new e(i,c*F,c*-b)), -T.push(new e(i,c*F,c*b)),++D):T.push(new e(i,c*F,c*b))}return T}var d={};d.rayPlane=function(t,n,i){r(i)||(i=new e);var o=t.origin,u=t.direction,s=n.normal,c=e.dot(s,u);if(!(Math.abs(c)<a.EPSILON15)){var l=(-n.distance-e.dot(s,o))/c;if(!(l<0))return i=e.multiplyByScalar(u,l,i),e.add(o,i,i)}};var m=new e,_=new e,p=new e,y=new e,T=new e;d.rayTriangleParametric=function(t,r,i,o,u){u=n(u,!1);var s,c,l,f,h,E=t.origin,d=t.direction,R=e.subtract(i,r,m),A=e.subtract(o,r,_),S=e.cross(d,A,p),v=e.dot(R,S);if(u){if(v<a.EPSILON6)return;if(s=e.subtract(E,r,y),l=e.dot(s,S),l<0||l>v)return;if(c=e.cross(s,R,T),f=e.dot(d,c),f<0||l+f>v)return;h=e.dot(A,c)/v}else{if(Math.abs(v)<a.EPSILON6)return;var N=1/v;if(s=e.subtract(E,r,y),l=e.dot(s,S)*N,l<0||l>1)return;if(c=e.cross(s,R,T),f=e.dot(d,c)*N,f<0||l+f>1)return;h=e.dot(A,c)*N}return h},d.rayTriangle=function(t,n,i,a,o,u){var s=d.rayTriangleParametric(t,n,i,a,o);if(r(s)&&!(s<0))return r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var R=new c;d.lineSegmentTriangle=function(t,n,i,a,o,u,s){var c=R;e.clone(t,c.origin),e.subtract(n,t,c.direction),e.normalize(c.direction,c.direction);var l=d.rayTriangleParametric(c,i,a,o,u);if(!(!r(l)||l<0||l>e.distance(t,n)))return r(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var A={root0:0,root1:0};d.raySphere=function(e,t,n){if(n=f(e,t,n),r(n)&&!(n.stop<0))return n.start=Math.max(n.start,0),n};var S=new c;d.lineSegmentSphere=function(t,n,i,a){var o=S;e.clone(t,o.origin);var u=e.subtract(n,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),a=f(o,i,a),!(!r(a)||a.stop<0||a.start>s))return a.start=Math.max(a.start,0),a.stop=Math.min(a.stop,s),a};var v=new e,N=new e;d.rayEllipsoid=function(t,n){var r,i,a,o,u,s=n.oneOverRadii,c=e.multiplyComponents(s,t.origin,v),l=e.multiplyComponents(s,t.direction,N),f=e.magnitudeSquared(c),h=e.dot(c,l);if(f>1){if(h>=0)return;var E=h*h;if(r=f-1,i=e.magnitudeSquared(l),a=i*r,E<a)return;if(E>a){o=h*h-a,u=-h+Math.sqrt(o);var d=u/i,m=r/u;return d<m?{start:d,stop:m}:{start:m,stop:d}}var _=Math.sqrt(r/i);return{start:_,stop:_}}return f<1?(r=f-1,i=e.magnitudeSquared(l),a=i*r,o=h*h-a,u=-h+Math.sqrt(o),{start:0,stop:u/i}):h<0?(i=e.magnitudeSquared(l),{start:0,stop:-h/i}):void 0};var O=new e,I=new e,g=new e,M=new e,x=new e,w=new o,C=new o,P=new o,U=new o,D=new o,L=new o,F=new o,z=new e,B=new e,b=new t;d.grazingAltitudeLocation=function(t,n){var i=t.origin,u=t.direction;if(!e.equals(i,e.ZERO)){var s=n.geodeticSurfaceNormal(i,O);if(e.dot(u,s)>=0)return i}var c=r(this.rayEllipsoid(t,n)),l=n.transformPositionToScaledSpace(u,O),f=e.normalize(l,l),h=e.mostOrthogonalAxis(l,M),d=e.normalize(e.cross(h,f,I),I),m=e.normalize(e.cross(f,d,g),g),_=w;_[0]=f.x,_[1]=f.y,_[2]=f.z,_[3]=d.x,_[4]=d.y,_[5]=d.z,_[6]=m.x,_[7]=m.y,_[8]=m.z;var p=o.transpose(_,C),y=o.fromScale(n.radii,P),T=o.fromScale(n.oneOverRadii,U),R=D;R[0]=0,R[1]=-u.z,R[2]=u.y,R[3]=u.z,R[4]=0,R[5]=-u.x,R[6]=-u.y,R[7]=u.x,R[8]=0;var A,S,v=o.multiply(o.multiply(p,T,L),R,L),N=o.multiply(o.multiply(v,y,F),_,F),G=o.multiplyByVector(v,i,x),q=E(N,e.negate(G,O),0,0,1),W=q.length;if(W>0){for(var H=e.clone(e.ZERO,B),X=Number.NEGATIVE_INFINITY,V=0;V<W;++V){A=o.multiplyByVector(y,o.multiplyByVector(_,q[V],z),z);var Y=e.normalize(e.subtract(A,i,M),M),Z=e.dot(Y,u);Z>X&&(X=Z,H=e.clone(A,H))}var k=n.cartesianToCartographic(H,b);return X=a.clamp(X,0,1),S=e.magnitude(e.subtract(H,i,M))*Math.sqrt(1-X*X),S=c?-S:S,k.height=S,n.cartographicToCartesian(k,new e)}};var G=new e;return d.lineSegmentPlane=function(t,n,i,o){r(o)||(o=new e);var u=e.subtract(n,t,G),s=i.normal,c=e.dot(s,u);if(!(Math.abs(c)<a.EPSILON6)){var l=e.dot(s,t),f=-(i.distance+l)/c;if(!(f<0||f>1))return e.multiplyByScalar(u,f,o),e.add(t,o,o),o}},d.trianglePlaneIntersection=function(t,n,r,i){var a=i.normal,o=i.distance,u=e.dot(a,t)+o<0,s=e.dot(a,n)+o<0,c=e.dot(a,r)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var f,h;if(1!==l&&2!==l||(f=new e,h=new e),1===l){if(u)return d.lineSegmentPlane(t,n,i,f),d.lineSegmentPlane(t,r,i,h),{positions:[t,n,r,f,h],indices:[0,3,4,1,2,4,1,4,3]};if(s)return d.lineSegmentPlane(n,r,i,f),d.lineSegmentPlane(n,t,i,h),{positions:[t,n,r,f,h],indices:[1,3,4,2,0,4,2,4,3]};if(c)return d.lineSegmentPlane(r,t,i,f),d.lineSegmentPlane(r,n,i,h),{positions:[t,n,r,f,h],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return d.lineSegmentPlane(n,t,i,f),d.lineSegmentPlane(r,t,i,h),{positions:[t,n,r,f,h],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return d.lineSegmentPlane(r,n,i,f),d.lineSegmentPlane(t,n,i,h),{positions:[t,n,r,f,h],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return d.lineSegmentPlane(t,r,i,f),d.lineSegmentPlane(n,r,i,h),{positions:[t,n,r,f,h],indices:[0,1,4,0,4,3,2,3,4]}}},d}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";function i(t,n){this.normal=e.clone(t),this.distance=n}i.fromPointNormal=function(n,r,a){var o=-e.dot(r,n);return t(a)?(e.clone(r,a.normal),a.distance=o,a):new i(r,o)};var a=new e;return i.fromCartesian4=function(n,r){var o=e.fromCartesian4(n,a),u=n.w;return t(r)?(e.clone(o,r.normal),r.distance=u,r):new i(o,u)},i.getPointDistance=function(t,n){return e.dot(t.normal,n)+t.distance},i.ORIGIN_XY_PLANE=r(new i(e.UNIT_Z,0)),i.ORIGIN_YZ_PLANE=r(new i(e.UNIT_X,0)),i.ORIGIN_ZX_PLANE=r(new i(e.UNIT_Y,0)),i}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,n,r,i){return t(e).then(n,r,i)}function t(e){var t,n;return e instanceof r?t=e:u(e)?(n=o(),e.then(function(e){n.resolve(e)},function(e){n.reject(e)},function(e){n.progress(e)}),t=n.promise):t=i(e),t}function n(t){return e(t,a)}function r(e){this.then=e}function i(e){var n=new r(function(n){try{return t(n?n(e):e)}catch(e){return a(e)}});return n}function a(e){var n=new r(function(n,r){try{return r?t(r(e)):a(e)}catch(e){return a(e)}});return n}function o(){function e(e,t,n){return h(e,t,n)}function n(e){return d(e)}function i(e){return d(a(e))}function u(e){return E(e)}var s,c,l,f,h,E,d;return c=new r(e),s={then:e,resolve:n,reject:i,progress:u,promise:c,resolver:{resolve:n,reject:i,progress:u}},l=[],f=[],h=function(e,t,n){var r,i;return r=o(),i="function"==typeof n?function(e){try{r.progress(n(e))}catch(e){r.progress(e)}}:function(e){r.progress(e)},l.push(function(n){n.then(e,t).then(r.resolve,r.reject,i)}),f.push(i),r.promise},E=function(e){return m(f,e),e},d=function(e){return e=t(e),h=e.then,d=t,E=p,m(l,e),f=l=A,e},s}function u(e){return e&&"function"==typeof e.then}function s(t,n,r,i,a){return _(2,arguments),e(t,function(t){function u(e){m(e)}function s(e){d(e)}var c,l,f,h,E,d,m,_,y,T;if(y=t.length>>>0,c=Math.max(0,Math.min(n,y)),f=[],l=y-c+1,h=[],E=o(),c)for(_=E.progress,m=function(e){h.push(e),--l||(d=m=p,E.reject(h))},d=function(e){f.push(e),--c||(d=m=p,E.resolve(f))},T=0;T<y;++T)T in t&&e(t[T],s,u,_);else E.resolve(f);return E.then(r,i,a)})}function c(e,t,n,r){function i(e){return t?t(e[0]):e[0]}return s(e,1,i,n,r)}function l(e,t,n,r){return _(1,arguments),h(e,y).then(t,n,r)}function f(){return h(arguments,y)}function h(t,n){return e(t,function(t){var r,i,a,u,s,c;if(a=i=t.length>>>0,r=[],c=o(),a)for(u=function(t,i){e(t,n).then(function(e){r[i]=e,--a||c.resolve(r)},c.reject)},s=0;s<i;s++)s in t?u(t[s],s):--a;else c.resolve(r);return c.promise})}function E(t,n){var r=R.call(arguments,1);return e(t,function(t){var i;return i=t.length,r[0]=function(t,r,a){return e(t,function(t){return e(r,function(e){return n(t,e,a,i)})})},T.apply(t,r)})}function d(t,n,r){var i=arguments.length>2;return e(t,function(e){return e=i?r:e,n.resolve(e),e},function(e){return n.reject(e),a(e)},n.progress)}function m(e,t){for(var n,r=0;n=e[r++];)n(t)}function _(e,t){for(var n,r=t.length;r>e;)if(n=t[--r],null!=n&&"function"!=typeof n)throw new Error("arg "+r+" must be a function")}function p(){}function y(e){return e}var T,R,A;return e.defer=o,e.resolve=t,e.reject=n,e.join=f,e.all=l,e.map=h,e.reduce=E,e.any=c,e.some=s,e.chain=d,e.isPromise=u,r.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(A,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return l(t,function(t){return e.apply(A,t)})})}},R=[].slice,T=[].reduce||function(e){var t,n,r,i,a;if(a=0,t=Object(this),i=t.length>>>0,n=arguments,n.length<=1)for(;;){if(a in t){r=t[a++];break}if(++a>=i)throw new TypeError}else r=n[1];for(;a<i;++a)a in t&&(r=e(r,t[a],a,t));return r},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n,r){t(i[n])||(i[n]=!0,console.log(e(r,n)))}var i={};return r.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.",r}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,n){"use strict";function r(e,t){n(e,t)}return r}),define("Core/binarySearch",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e,t,n){for(var r,i,a=0,o=e.length-1;a<=o;)if(r=~~((a+o)/2),i=n(e[r],t),i<0)a=r+1;else{if(!(i>0))return r;o=r-1}return~(o+1)}return n}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,n,r,i){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=r,this.ut1MinusUtc=i}return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,n=0,r=t[n++],i=function(e,t,n,r){n||(n=" ");var i=e.length>=t?"":Array(1+t-e.length>>>0).join(n);return r?e+i:i+e},a=function(e,t,n,r,a,o){var u=r-e.length;return u>0&&(e=n||!a?i(e,r,o,n):e.slice(0,t.length)+i("",u,"0",!0)+e.slice(t.length)),e},o=function(e,t,n,r,o,u,s){var c=e>>>0;return n=n&&c&&{2:"0b",8:"0",16:"0x"}[t]||"",e=n+i(c.toString(t),u||0,"0",!1),a(e,n,r,o,s)},u=function(e,t,n,r,i,o){return null!=r&&(e=e.slice(0,r)),a(e,"",t,n,i,o)},s=function(e,r,s,c,l,f,h){var E,d,m,_,p;if("%%"==e)return"%";for(var y=!1,T="",R=!1,A=!1,S=" ",v=s.length,N=0;s&&N<v;N++)switch(s.charAt(N)){case" ":T=" ";break;case"+":T="+";break;case"-":y=!0;break;case"'":S=s.charAt(N+1);break;case"0":R=!0;break;case"#":A=!0}if(c=c?"*"==c?+t[n++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,c<0&&(c=-c,y=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(f=f?"*"==f?+t[n++]:"*"==f.charAt(0)?+t[f.slice(1,-1)]:+f:"fFeE".indexOf(h)>-1?6:"d"==h?0:void 0,p=r?t[r.slice(0,-1)]:t[n++],h){case"s":return u(String(p),y,c,f,R,S);case"c":return u(String.fromCharCode(+p),y,c,f,R);case"b":return o(p,2,A,y,c,f,R);case"o":return o(p,8,A,y,c,f,R);case"x":return o(p,16,A,y,c,f,R);case"X":return o(p,16,A,y,c,f,R).toUpperCase();case"u":return o(p,10,A,y,c,f,R);case"i":case"d":return E=+p||0,E=Math.round(E-E%1),d=E<0?"-":T,p=d+i(String(Math.abs(E)),f,"0",!1),a(p,d,y,c,R);case"e":case"E":case"f":case"F":case"g":case"G":return E=+p,d=E<0?"-":T,m=["toExponential","toFixed","toPrecision"]["efg".indexOf(h.toLowerCase())],_=["toString","toUpperCase"]["eEfFgG".indexOf(h)%2],p=d+Math.abs(E)[m](f),a(p,d,y,c,R)[_]();default:return e}};return r.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,n,r,i,a,o,u){this.year=e,this.month=t,this.day=n,this.hour=r,this.minute=i,this.second=a,this.millisecond=o,this.isLeapSecond=u}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e(t)}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,n,r,i,a,o,u,s,c){"use strict";function l(e,t){return m.compare(e.julianDate,t.julianDate)}function f(e){T.julianDate=e;var n=m.leapSeconds,r=t(n,T,l);r<0&&(r=~r),r>=n.length&&(r=n.length-1);var i=n[r].offset;if(r>0){var a=m.secondsDifference(n[r].julianDate,e);a>i&&(r--,i=n[r].offset)}m.addSeconds(e,i,e)}function h(e,n){T.julianDate=e;var r=m.leapSeconds,i=t(r,T,l);if(i<0&&(i=~i),0===i)return m.addSeconds(e,-r[0].offset,n);if(i>=r.length)return m.addSeconds(e,-r[i-1].offset,n);var a=m.secondsDifference(r[i].julianDate,e);return 0===a?m.addSeconds(e,-r[i].offset,n):a<=1?void 0:m.addSeconds(e,-r[--i].offset,n)}function E(e,t,n){var r=t/s.SECONDS_PER_DAY|0;return e+=r,t-=s.SECONDS_PER_DAY*r,t<0&&(e--,t+=s.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function d(e,t,n,r,i,a,o){var u=(t-14)/12|0,c=e+4800+u,l=(1461*c/4|0)+(367*(t-2-12*u)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;r-=12,r<0&&(r+=24);var f=a+(r*s.SECONDS_PER_HOUR+i*s.SECONDS_PER_MINUTE+o*s.SECONDS_PER_MILLISECOND);return f>=43200&&(l-=1),[l,f]}function m(e,t,r){this.dayNumber=void 0,this.secondsOfDay=void 0,e=n(e,0),t=n(t,0),r=n(r,c.UTC);var i=0|e;t+=(e-i)*s.SECONDS_PER_DAY,E(i,t,this),r===c.UTC&&f(this)}var _=new a,p=[31,28,31,30,31,30,31,31,30,31,30,31],y=29,T=new u,R=/^(\d{4})$/,A=/^(\d{4})-(\d{2})$/,S=/^(\d{4})-?(\d{3})$/,v=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,N=/^(\d{4})-?(\d{2})-?(\d{2})$/,O=/([Z+\-])?(\d{2})?:?(\d{2})?$/,I=/^(\d{2})(\.\d+)?/.source+O.source,g=/^(\d{2}):?(\d{2})(\.\d+)?/.source+O.source,M=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+O.source;m.fromDate=function(e,t){var n=d(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r(t)?(E(n[0],n[1],t),f(t),t):new m(n[0],n[1],c.UTC)},m.fromIso8601=function(e,t){e=e.replace(",",".");var n,i,a,u=e.split("T"),s=1,l=1,h=0,_=0,T=0,O=0,x=u[0],w=u[1];if(u=x.match(N),null!==u)n=+u[1],s=+u[2],l=+u[3];else if(u=x.match(A),null!==u)n=+u[1],s=+u[2];else if(u=x.match(R),null!==u)n=+u[1];else{var C;if(u=x.match(S),null!==u)n=+u[1],C=+u[2],a=o(n);else if(u=x.match(v),null!==u){n=+u[1];var P=+u[2],U=+u[3]||0,D=new Date(Date.UTC(n,0,4));C=7*P+U-D.getUTCDay()-3}i=new Date(Date.UTC(n,0,1)),i.setUTCDate(C),s=i.getUTCMonth()+1,l=i.getUTCDate()}a=o(n);var L;if(r(w)){u=w.match(M),null!==u?(h=+u[1],_=+u[2],T=+u[3],O=1e3*+(u[4]||0),L=5):(u=w.match(g),null!==u?(h=+u[1],_=+u[2],T=60*+(u[3]||0),L=4):(u=w.match(I),null!==u&&(h=+u[1],_=60*+(u[2]||0),L=3)));var F=u[L],z=+u[L+1],B=+(u[L+2]||0);switch(F){case"+":h-=z,_-=B;break;case"-":h+=z,_+=B;break;case"Z":break;default:_+=new Date(Date.UTC(n,s-1,l,h,_)).getTimezoneOffset()}}else _+=new Date(n,s-1,l).getTimezoneOffset();var b=60===T;for(b&&T--;_>=60;)_-=60,h++;for(;h>=24;)h-=24,l++;for(i=a&&2===s?y:p[s-1];l>i;)l-=i,s++,s>12&&(s-=12,n++),i=a&&2===s?y:p[s-1];for(;_<0;)_+=60,h--;for(;h<0;)h+=24,l--;for(;l<1;)s--,s<1&&(s+=12,n--),i=a&&2===s?y:p[s-1],l+=i;var G=d(n,s,l,h,_,T,O);return r(t)?(E(G[0],G[1],t),f(t)):t=new m(G[0],G[1],c.UTC),b&&m.addSeconds(t,1,t),t},m.now=function(e){return m.fromDate(new Date,e)};var x=new m(0,0,c.TAI);return m.toGregorianDate=function(e,t){var n=!1,i=h(e,x);r(i)||(m.addSeconds(e,-1,x),i=h(x,x),n=!0);var o=i.dayNumber,u=i.secondsOfDay;u>=43200&&(o+=1);var c=o+68569|0,l=4*c/146097|0;c=c-((146097*l+3)/4|0)|0;var f=4e3*(c+1)/1461001|0;c=c-(1461*f/4|0)+31|0;var E=80*c/2447|0,d=c-(2447*E/80|0)|0;c=E/11|0;var _=E+2-12*c|0,p=100*(l-49)+f+c|0,y=u/s.SECONDS_PER_HOUR|0,T=u-y*s.SECONDS_PER_HOUR,R=T/s.SECONDS_PER_MINUTE|0;T-=R*s.SECONDS_PER_MINUTE;var A=0|T,S=(T-A)/s.SECONDS_PER_MILLISECOND;return y+=12,y>23&&(y-=24),n&&(A+=1),r(t)?(t.year=p,t.month=_,t.day=d,t.hour=y,t.minute=R,t.second=A,t.millisecond=S,t.isLeapSecond=n,t):new a(p,_,d,y,R,A,S,n)},m.toDate=function(e){var t=m.toGregorianDate(e,_),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))},m.toIso8601=function(t,n){var i,a=m.toGregorianDate(t,a);return r(n)||0===a.millisecond?r(n)&&0!==n?(i=(.01*a.millisecond).toFixed(n).replace(".","").slice(0,n),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",a.year,a.month,a.day,a.hour,a.minute,a.second,i)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",a.year,a.month,a.day,a.hour,a.minute,a.second):(i=(.01*a.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",a.year,a.month,a.day,a.hour,a.minute,a.second,i))},m.clone=function(e,t){if(r(e))return r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new m(e.dayNumber,e.secondsOfDay,c.TAI)},m.compare=function(e,t){var n=e.dayNumber-t.dayNumber;return 0!==n?n:e.secondsOfDay-t.secondsOfDay},m.equals=function(e,t){return e===t||r(e)&&r(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},m.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(m.secondsDifference(e,t))<=n},m.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},m.secondsDifference=function(e,t){var n=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return n+(e.secondsOfDay-t.secondsOfDay)},m.daysDifference=function(e,t){var n=e.dayNumber-t.dayNumber,r=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return n+r},m.computeTaiMinusUtc=function(e){T.julianDate=e;var n=m.leapSeconds,r=t(n,T,l);return r<0&&(r=~r,--r,r<0&&(r=0)),n[r].offset},m.addSeconds=function(e,t,n){return E(e.dayNumber,e.secondsOfDay+t,n)},m.addMinutes=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return E(e.dayNumber,r,n)},m.addHours=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return E(e.dayNumber,r,n)},m.addDays=function(e,t,n){var r=e.dayNumber+t;return E(r,e.secondsOfDay,n)},m.lessThan=function(e,t){return m.compare(e,t)<0},m.lessThanOrEquals=function(e,t){return m.compare(e,t)<=0},m.greaterThan=function(e,t){return m.compare(e,t)>0},m.greaterThanOrEquals=function(e,t){return m.compare(e,t)>=0},m.prototype.clone=function(e){return m.clone(this,e)},m.prototype.equals=function(e){return m.equals(this,e)},m.prototype.equalsEpsilon=function(e,t){return m.equalsEpsilon(this,e,t)},m.prototype.toString=function(){return m.toIso8601(this)},m.leapSeconds=[new u(new m(2441317,43210,c.TAI),10),new u(new m(2441499,43211,c.TAI),11),new u(new m(2441683,43212,c.TAI),12),new u(new m(2442048,43213,c.TAI),13),new u(new m(2442413,43214,c.TAI),14),new u(new m(2442778,43215,c.TAI),15),new u(new m(2443144,43216,c.TAI),16),new u(new m(2443509,43217,c.TAI),17),new u(new m(2443874,43218,c.TAI),18),new u(new m(2444239,43219,c.TAI),19),new u(new m(2444786,43220,c.TAI),20),new u(new m(2445151,43221,c.TAI),21),new u(new m(2445516,43222,c.TAI),22),new u(new m(2446247,43223,c.TAI),23),new u(new m(2447161,43224,c.TAI),24),new u(new m(2447892,43225,c.TAI),25),new u(new m(2448257,43226,c.TAI),26),new u(new m(2448804,43227,c.TAI),27),new u(new m(2449169,43228,c.TAI),28),new u(new m(2449534,43229,c.TAI),29),new u(new m(2450083,43230,c.TAI),30),new u(new m(2450630,43231,c.TAI),31),new u(new m(2451179,43232,c.TAI),32),new u(new m(2453736,43233,c.TAI),33),new u(new m(2454832,43234,c.TAI),34),new u(new m(2456109,43235,c.TAI),35),new u(new m(2457204,43236,c.TAI),36),new u(new m(2457754,43237,c.TAI),37)],m}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(n,r){if(null===n||"object"!=typeof n)return n;r=e(r,!1);var i=new n.constructor;for(var a in n)if(n.hasOwnProperty(a)){var o=n[a];r&&(o=t(o,r)),i[a]=o}return i}return t}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var n=e.split("\r\n"),r=0;r<n.length;++r){var i=n[r],a=i.indexOf(": ");if(a>0){var o=i.substring(0,a),u=i.substring(a+2);t[o]=u}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function n(e,n,r){this.statusCode=e,this.response=n,this.responseHeaders=r,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return n.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},n}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var n=r.exec(t);this.scheme=n[1],this.authority=n[2],this.path=n[3],this.query=n[4],this.fragment=n[5]}}function t(e){var t=unescape(e);return a.test(t)?t:e.toUpperCase()}function n(e,t,n,r){return(t||"")+n.toLowerCase()+(r||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var r=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(o,n).replace(i,t)),this.path&&(this.path=this.path.replace(i,t)),this.query&&(this.query=this.query.replace(i,t)),this.fragment&&(this.fragment=this.fragment.replace(i,t))};var i=/%[0-9a-z]{2}/gi,a=/[a-zA-Z0-9\-\._~]/,o=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var n=new e;return this.scheme?(n.scheme=this.scheme,n.authority=this.authority,n.path=this.path,n.query=this.query):(n.scheme=t.scheme,this.authority?(n.authority=this.authority,n.path=this.path,n.query=this.query):(n.authority=t.authority,""==this.path?(n.path=t.path,n.query=this.query||t.query):("/"==this.path.charAt(0)?(n.path=this.path,n.removeDotSegments()):(t.authority&&""==t.path?n.path="/"+this.path:n.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,n.removeDotSegments()),n.query=this.query))),n.fragment=this.fragment,n},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),n=[],r=""==t[0];r&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?n.pop():"."!=e&&n.push(e);"."!=e&&".."!=e||n.push(""),r&&n.unshift(""),this.path=n.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n){var r=new e(n);r.normalize();var i=r.getAuthority();if(t(i)){if(i.indexOf("@")!==-1){var a=i.split("@");i=a[1]}if(i.indexOf(":")===-1){var o=r.getScheme();if(t(o)||(o=window.location.protocol,o=o.substring(0,o.length-1)),"http"===o)i+=":80";else{if("https"!==o)return;i+=":443"}}return i}}var i={},a={};return i.add=function(e,n){var r=e.toLowerCase()+":"+n;t(a[r])||(a[r]=!0)},i.remove=function(e,n){var r=e.toLowerCase()+":"+n;t(a[r])&&delete a[r]},i.contains=function(e){var n=r(e);return!(!t(n)||!t(a[n]))},i.clear=function(){a={}},i}),define("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,n,r,i,a,o){"use strict";function u(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,i=t(n.method,"GET"),a=n.data,o=n.headers,s=n.overrideMimeType;return e(n.url,function(t){var n=e.defer();return u.load(t,r,i,a,o,n,s),n.promise})}function s(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function c(e,t){for(var n=s(e,t),r=new ArrayBuffer(n.length),i=new Uint8Array(r),a=0;a<n.length;a++)i[a]=n.charCodeAt(a);return r}function l(e,n){n=t(n,"");var r=e[1],i=!!e[2],a=e[3];switch(n){case"":case"text":return s(i,a);case"arraybuffer":return c(i,a);case"blob":var o=c(i,a);return new Blob([o],{type:r});case"document":var u=new DOMParser;return u.parseFromString(s(i,a),r);case"json":return JSON.parse(s(i,a))}}var f=/^data:(.*?)(;base64)?,(.*)$/;return u.load=function(e,t,r,u,s,c,h){var E=f.exec(e);if(null!==E)return void c.resolve(l(E,t));var d=new XMLHttpRequest;if(o.contains(e)&&(d.withCredentials=!0),n(h)&&n(d.overrideMimeType)&&d.overrideMimeType(h),d.open(r,e,!0),n(s))for(var m in s)s.hasOwnProperty(m)&&d.setRequestHeader(m,s[m]);n(t)&&(d.responseType=t),d.onload=function(){if(d.status<200||d.status>=300)return void c.reject(new i(d.status,d.response,d.getAllResponseHeaders()));var e=d.response,r=d.responseType;if(!n(e)||n(t)&&r!==t)if("json"===t&&"string"==typeof e)try{c.resolve(JSON.parse(e))}catch(e){c.reject(e)}else(""===r||"document"===r)&&n(d.responseXML)&&d.responseXML.hasChildNodes()?c.resolve(d.responseXML):""!==r&&"text"!==r||!n(d.responseText)?c.reject(new a("Invalid XMLHttpRequest response type.")):c.resolve(d.responseText);else c.resolve(e)},d.onerror=function(e){c.reject(new i)},d.send(u)},u.defaultLoad=u.load,u}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,n){return e({url:t,headers:n})}return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";function i(n,i){return t(i)?t(i.Accept)||(i=e(i),i.Accept=a.Accept):i=a,r(n,i).then(function(e){return JSON.parse(e)})}var a={Accept:"application/json,*/*;q=0.01"};return i}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,n,r,i,a,o,u,s,c,l,f){"use strict";function h(t){if(t=n(t,n.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=n(t.addNewLeapSeconds,!0),r(t.data))d(this,t.data);else if(r(t.url)){var i=this;this._downloadPromise=e(s(t.url),function(e){d(i,e)},function(){i._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else d(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function E(e,t){return o.compare(e.julianDate,t)}function d(e,n){if(!r(n.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!r(n.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var i=n.columnNames.indexOf("modifiedJulianDateUtc"),a=n.columnNames.indexOf("xPoleWanderRadians"),s=n.columnNames.indexOf("yPoleWanderRadians"),c=n.columnNames.indexOf("ut1MinusUtcSeconds"),h=n.columnNames.indexOf("xCelestialPoleOffsetRadians"),d=n.columnNames.indexOf("yCelestialPoleOffsetRadians"),m=n.columnNames.indexOf("taiMinusUtcSeconds");if(i<0||a<0||s<0||c<0||h<0||d<0||m<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var _=e._samples=n.samples,p=e._dates=[];e._dateColumn=i,e._xPoleWanderRadiansColumn=a,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=h,e._yCelestialPoleOffsetRadiansColumn=d,e._taiMinusUtcSecondsColumn=m,e._columnCount=n.columnNames.length,e._lastIndex=void 0;for(var y,T=e._addNewLeapSeconds,R=0,A=_.length;R<A;R+=e._columnCount){var S=_[R+i],v=_[R+m],N=S+l.MODIFIED_JULIAN_DATE_DIFFERENCE,O=new o(N,v,f.TAI);if(p.push(O),T){if(v!==y&&r(y)){var I=o.leapSeconds,g=t(I,O,E);if(g<0){var M=new u(O,v);I.splice(~g,0,M)}}y=v}}}function m(e,t,n,r,i){var a=n*r;i.xPoleWander=t[a+e._xPoleWanderRadiansColumn],i.yPoleWander=t[a+e._yPoleWanderRadiansColumn],i.xPoleOffset=t[a+e._xCelestialPoleOffsetRadiansColumn],i.yPoleOffset=t[a+e._yCelestialPoleOffsetRadiansColumn],i.ut1MinusUtc=t[a+e._ut1MinusUtcSecondsColumn]}function _(e,t,n){return t+e*(n-t)}function p(e,t,n,r,i,a,u){var s=e._columnCount;if(a>t.length-1)return u.xPoleWander=0,u.yPoleWander=0,u.xPoleOffset=0,u.yPoleOffset=0,u.ut1MinusUtc=0,u;var c=t[i],l=t[a];if(c.equals(l)||r.equals(c))return m(e,n,i,s,u),u;if(r.equals(l))return m(e,n,a,s,u),u;var f=o.secondsDifference(r,c)/o.secondsDifference(l,c),h=i*s,E=a*s,d=n[h+e._ut1MinusUtcSecondsColumn],p=n[E+e._ut1MinusUtcSecondsColumn],y=p-d;if(y>.5||y<-.5){var T=n[h+e._taiMinusUtcSecondsColumn],R=n[E+e._taiMinusUtcSecondsColumn];T!==R&&(l.equals(r)?d=p:p-=R-T)}return u.xPoleWander=_(f,n[h+e._xPoleWanderRadiansColumn],n[E+e._xPoleWanderRadiansColumn]),u.yPoleWander=_(f,n[h+e._yPoleWanderRadiansColumn],n[E+e._yPoleWanderRadiansColumn]),u.xPoleOffset=_(f,n[h+e._xCelestialPoleOffsetRadiansColumn],n[E+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=_(f,n[h+e._yCelestialPoleOffsetRadiansColumn],n[E+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=_(f,d,p),u}return h.NONE=a({getPromiseToLoad:function(){return e()},compute:function(e,t){return r(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new i(0,0,0,0,0),t}}),h.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},h.prototype.compute=function(e,n){if(r(this._samples)){if(r(n)||(n=new i(0,0,0,0,0)),0===this._samples.length)return n.xPoleWander=0,n.yPoleWander=0,n.xPoleOffset=0,n.yPoleOffset=0,n.ut1MinusUtc=0,n;var a=this._dates,u=this._lastIndex,s=0,l=0;if(r(u)){var f=a[u],h=a[u+1],E=o.lessThanOrEquals(f,e),d=!r(h),m=d||o.greaterThanOrEquals(h,e);if(E&&m)return s=u,!d&&h.equals(e)&&++s,l=s+1,p(this,a,this._samples,e,s,l,n),n}var _=t(a,e,o.compare,this._dateColumn);return _>=0?(_<a.length-1&&a[_+1].equals(e)&&++_,s=_,l=_):(l=~_,s=l-1,s<0&&(s=0)),this._lastIndex=s,p(this,a,this._samples,e,s,l,n),n}if(r(this._dataError))throw new c(this._dataError)},h}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function i(t,n,r){this.heading=e(t,0),this.pitch=e(n,0),this.roll=e(r,0)}return i.fromQuaternion=function(e,n){t(n)||(n=new i);var r=2*(e.w*e.y-e.z*e.x),a=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return n.heading=-Math.atan2(s,u),n.roll=Math.atan2(o,a),n.pitch=-Math.asin(r),n},i.fromDegrees=function(e,n,a,o){return t(o)||(o=new i),o.heading=e*r.RADIANS_PER_DEGREE,o.pitch=n*r.RADIANS_PER_DEGREE,o.roll=a*r.RADIANS_PER_DEGREE,o},i.clone=function(e,n){if(t(e))return t(n)?(n.heading=e.heading,n.pitch=e.pitch,n.roll=e.roll,n):new i(e.heading,e.pitch,e.roll)},i.equals=function(e,n){return e===n||t(e)&&t(n)&&e.heading===n.heading&&e.pitch===n.pitch&&e.roll===n.roll},i.equalsEpsilon=function(e,n,i,a){return e===n||t(e)&&t(n)&&r.equalsEpsilon(e.heading,n.heading,i,a)&&r.equalsEpsilon(e.pitch,n.pitch,i,a)&&r.equalsEpsilon(e.roll,n.roll,i,a)},i.prototype.clone=function(e){return i.clone(this,e); -},i.prototype.equals=function(e){return i.equals(this,e)},i.prototype.equalsEpsilon=function(e,t,n){return i.equalsEpsilon(this,e,t,n)},i.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},i}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function i(n,r){r=t(r,document.location.href);var i=new e(r),a=new e(n);return a.resolve(i).toString()}return i}),define("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function i(r,i,a){a=t(a,!0),r instanceof e||(r=new e(r)),i instanceof e||(i=new e(i)),n(i.authority)&&!n(i.scheme)&&("undefined"!=typeof document&&n(document.location)&&n(document.location.href)?i.scheme=new e(document.location.href).scheme:i.scheme=r.scheme);var o=r;i.isAbsolute()&&(o=i);var u="";n(o.scheme)&&(u+=o.scheme+":"),n(o.authority)&&(u+="//"+o.authority,""!==o.path&&"/"!==o.path&&(u=u.replace(/\/?$/,"/"),o.path=o.path.replace(/^\/?/g,""))),u+=o===r?a?r.path.replace(/\/?$/,"/")+i.path.replace(/^\/?/g,""):r.path+i.path:i.path;var s=n(r.query),c=n(i.query);s&&c?u+="?"+r.query+"&"+i.query:s&&!c?u+="?"+r.query:!s&&c&&(u+="?"+i.query);var l=n(i.fragment);return n(r.fragment)&&!l?u+="#"+r.fragment:l&&(u+="#"+i.fragment),u}return i}),define("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","./joinUrls","require"],function(e,t,n,r,i,a){"use strict";function o(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;t<n;++t){var r=e[t].getAttribute("src"),i=d.exec(r);if(null!==i)return i[1]}}function u(){if(t(f))return f;var n;return n="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:o(),f=new e(r(n))}function s(e){return a.toUrl("../"+e)}function c(e){return i(u(),e)}function l(e){t(h)||(h=t(a.toUrl)?s:c),t(E)||(E=document.createElement("a"));var n=h(e);return E.href=n,E.href=E.href,E.href}var f,h,E,d=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return l._cesiumScriptRegex=d,l.setBaseUrl=function(t){f=new e(t).resolve(new e(document.location.href))},l}),define("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,n){this.x=e,this.y=t,this.s=n}return e}),define("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,n,r,i,a,o,u){"use strict";function s(e){e=n(e,n.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=n(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=n(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new a(this._sampleZeroJulianEphemerisDate,0,u.TAI),this._stepSizeDays=n(e.stepSizeDays,1),this._samplesPerXysFile=n(e.samplesPerXysFile,1e3),this._totalSamples=n(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,r=this._denominators=new Array(t+1),i=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t),s=0;s<=t;++s){r[s]=o,i[s]=s*this._stepSizeDays;for(var c=0;c<=t;++c)c!==s&&(r[s]*=s-c);r[s]=1/r[s]}this._work=new Array(t+1),this._coef=new Array(t+1)}function c(e,t,n){var r=f;return r.dayNumber=t,r.secondsOfDay=n,a.daysDifference(r,e._sampleZeroDateTT)}function l(n,i){if(n._chunkDownloadsInProgress[i])return n._chunkDownloadsInProgress[i];var a=e.defer();n._chunkDownloadsInProgress[i]=a;var u,s=n._xysFileUrlTemplate;return u=r(s)?s.replace("{0}",i):t("Assets/IAU2006_XYS/IAU2006_XYS_"+i+".json"),e(o(u),function(e){n._chunkDownloadsInProgress[i]=!1;for(var t=n._samples,r=e.samples,o=i*n._samplesPerXysFile*3,u=0,s=r.length;u<s;++u)t[o+u]=r[u];a.resolve()}),a.promise}var f=new a(0,0,u.TAI);return s.prototype.preload=function(t,n,r,i){var a=c(this,t,n),o=c(this,r,i),u=a/this._stepSizeDays-this._interpolationOrder/2|0;u<0&&(u=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var f=u/this._samplesPerXysFile|0,h=s/this._samplesPerXysFile|0,E=[],d=f;d<=h;++d)E.push(l(this,d));return e.all(E)},s.prototype.computeXysRadians=function(e,t,n){var a=c(this,e,t);if(!(a<0)){var o=a/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);s<0&&(s=0);var f=s+u;f>=this._totalSamples&&(f=this._totalSamples-1,s=f-u,s<0&&(s=0));var h=!1,E=this._samples;if(r(E[3*s])||(l(this,s/this._samplesPerXysFile|0),h=!0),r(E[3*f])||(l(this,f/this._samplesPerXysFile|0),h=!0),!h){r(n)?(n.x=0,n.y=0,n.s=0):n=new i(0,0,0);var d,m,_=a-s*this._stepSizeDays,p=this._work,y=this._denominators,T=this._coef,R=this._xTable;for(d=0;d<=u;++d)p[d]=_-R[d];for(d=0;d<=u;++d){for(T[d]=1,m=0;m<=u;++m)m!==d&&(T[d]*=p[m]);T[d]*=y[d];var A=3*(s+d);n.x+=T[d]*E[A++],n.y+=T[d]*E[A++],n.s+=T[d]*E[A]}return n}}}},s}),define("Core/Quaternion",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math","./Matrix3"],function(e,t,n,r,i,a,o,u){"use strict";function s(e,n,r,i){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(i,0)}var c=new e;s.fromAxisAngle=function(t,r,i){var a=r/2,o=Math.sin(a);c=e.normalize(t,c);var u=c.x*o,l=c.y*o,f=c.z*o,h=Math.cos(a);return n(i)?(i.x=u,i.y=l,i.z=f,i.w=h,i):new s(u,l,f,h)};var l=[1,2,0],f=new Array(3);s.fromRotationMatrix=function(e,t){var r,i,a,o,c,h=e[u.COLUMN0ROW0],E=e[u.COLUMN1ROW1],d=e[u.COLUMN2ROW2],m=h+E+d;if(m>0)r=Math.sqrt(m+1),c=.5*r,r=.5/r,i=(e[u.COLUMN1ROW2]-e[u.COLUMN2ROW1])*r,a=(e[u.COLUMN2ROW0]-e[u.COLUMN0ROW2])*r,o=(e[u.COLUMN0ROW1]-e[u.COLUMN1ROW0])*r;else{var _=l,p=0;E>h&&(p=1),d>h&&d>E&&(p=2);var y=_[p],T=_[y];r=Math.sqrt(e[u.getElementIndex(p,p)]-e[u.getElementIndex(y,y)]-e[u.getElementIndex(T,T)]+1);var R=f;R[p]=.5*r,r=.5/r,c=(e[u.getElementIndex(T,y)]-e[u.getElementIndex(y,T)])*r,R[y]=(e[u.getElementIndex(y,p)]+e[u.getElementIndex(p,y)])*r,R[T]=(e[u.getElementIndex(T,p)]+e[u.getElementIndex(p,T)])*r,i=-R[0],a=-R[1],o=-R[2]}return n(t)?(t.x=i,t.y=a,t.z=o,t.w=c,t):new s(i,a,o,c)};var h=new s;s.fromHeadingPitchRoll=function(t,n,r,i){var a=s.fromAxisAngle(e.UNIT_X,r,h),o=s.fromAxisAngle(e.UNIT_Y,-n,i);i=s.multiply(o,a,o);var u=s.fromAxisAngle(e.UNIT_Z,-t,h);return s.multiply(u,i,i)};var E=new e,d=new e,m=new s,_=new s,p=new s;s.packedLength=4,s.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},s.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new s),i.x=e[r],i.y=e[r+1],i.z=e[r+2],i.w=e[r+3],i},s.packedInterpolationLength=3,s.convertPackedArrayForInterpolation=function(e,t,n,r){s.unpack(e,4*n,p),s.conjugate(p,p);for(var i=0,a=n-t+1;i<a;i++){var o=3*i;s.unpack(e,4*(t+i),m),s.multiply(m,p,m),m.w<0&&s.negate(m,m),s.computeAxis(m,E);var u=s.computeAngle(m);r[o]=E.x*u,r[o+1]=E.y*u,r[o+2]=E.z*u}},s.unpackInterpolationResult=function(t,r,i,a,o){n(o)||(o=new s),e.fromArray(t,0,d);var u=e.magnitude(d);return s.unpack(r,4*a,_),0===u?s.clone(s.IDENTITY,m):s.fromAxisAngle(d,u,m),s.multiply(m,_,o)},s.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new s(e.x,e.y,e.z,e.w)},s.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},s.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},s.magnitude=function(e){return Math.sqrt(s.magnitudeSquared(e))},s.normalize=function(e,t){var n=1/s.magnitude(e),r=e.x*n,i=e.y*n,a=e.z*n,o=e.w*n;return t.x=r,t.y=i,t.z=a,t.w=o,t},s.inverse=function(e,t){var n=s.magnitudeSquared(e);return t=s.conjugate(e,t),s.multiplyByScalar(t,1/n,t)},s.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},s.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},s.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},s.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},s.multiply=function(e,t,n){var r=e.x,i=e.y,a=e.z,o=e.w,u=t.x,s=t.y,c=t.z,l=t.w,f=o*u+r*l+i*c-a*s,h=o*s-r*c+i*l+a*u,E=o*c+r*s-i*u+a*l,d=o*l-r*u-i*s-a*c;return n.x=f,n.y=h,n.z=E,n.w=d,n},s.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},s.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},s.computeAxis=function(e,t){var n=e.w;if(Math.abs(n-1)<o.EPSILON6)return t.x=t.y=t.z=0,t;var r=1/Math.sqrt(1-n*n);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},s.computeAngle=function(e){return Math.abs(e.w-1)<o.EPSILON6?0:2*Math.acos(e.w)};var y=new s;s.lerp=function(e,t,n,r){return y=s.multiplyByScalar(t,n,y),r=s.multiplyByScalar(e,1-n,r),s.add(y,r,r)};var T=new s,R=new s,A=new s;s.slerp=function(e,t,n,r){var i=s.dot(e,t),a=t;if(i<0&&(i=-i,a=T=s.negate(t,T)),1-i<o.EPSILON6)return s.lerp(e,a,n,r);var u=Math.acos(i);return R=s.multiplyByScalar(e,Math.sin((1-n)*u),R),A=s.multiplyByScalar(a,Math.sin(n*u),A),r=s.add(R,A,r),s.multiplyByScalar(r,1/Math.sin(u),r)},s.log=function(t,n){var r=o.acosClamped(t.w),i=0;return 0!==r&&(i=r/Math.sin(r)),e.multiplyByScalar(t,i,n)},s.exp=function(t,n){var r=e.magnitude(t),i=0;return 0!==r&&(i=Math.sin(r)/r),n.x=t.x*i,n.y=t.y*i,n.z=t.z*i,n.w=Math.cos(r),n};var S=new e,v=new e,N=new s,O=new s;s.computeInnerQuadrangle=function(t,n,r,i){var a=s.conjugate(n,N);s.multiply(a,r,O);var o=s.log(O,S);s.multiply(a,t,O);var u=s.log(O,v);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),s.exp(o,N),s.multiply(n,N,i)},s.squad=function(e,t,n,r,i,a){var o=s.slerp(e,t,i,N),u=s.slerp(n,r,i,O);return s.slerp(o,u,2*i*(1-i),a)};for(var I=new s,g=1.9011074535173003,M=i.supportsTypedArrays()?new Float32Array(8):[],x=i.supportsTypedArrays()?new Float32Array(8):[],w=i.supportsTypedArrays()?new Float32Array(8):[],C=i.supportsTypedArrays()?new Float32Array(8):[],P=0;P<7;++P){var U=P+1,D=2*U+1;M[P]=1/(U*D),x[P]=U/D}return M[7]=g/136,x[7]=8*g/17,s.fastSlerp=function(e,t,n,r){var i,a=s.dot(e,t);a>=0?i=1:(i=-1,a=-a);for(var o=a-1,u=1-n,c=n*n,l=u*u,f=7;f>=0;--f)w[f]=(M[f]*c-x[f])*o,C[f]=(M[f]*l-x[f])*o;var h=i*n*(1+w[0]*(1+w[1]*(1+w[2]*(1+w[3]*(1+w[4]*(1+w[5]*(1+w[6]*(1+w[7])))))))),E=u*(1+C[0]*(1+C[1]*(1+C[2]*(1+C[3]*(1+C[4]*(1+C[5]*(1+C[6]*(1+C[7])))))))),d=s.multiplyByScalar(e,E,I);return s.multiplyByScalar(t,h,r),s.add(d,r,r)},s.fastSquad=function(e,t,n,r,i,a){var o=s.fastSlerp(e,t,i,N),u=s.fastSlerp(n,r,i,O);return s.fastSlerp(o,u,2*i*(1-i),a)},s.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},s.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.x-t.x)<=r&&Math.abs(e.y-t.y)<=r&&Math.abs(e.z-t.z)<=r&&Math.abs(e.w-t.w)<=r},s.ZERO=a(new s(0,0,0,0)),s.IDENTITY=a(new s(0,0,0,1)),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.x+", "+this.y+", "+this.z+", "+this.w+")"},s}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./defaultValue","./defined","./deprecationWarning","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./HeadingPitchRoll","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,n,r,i,a,o,u,s,c,l,f,h,E,d,m,_,p,y,T,R){"use strict";var A={},S=new n,v=new n,N=new n;A.eastNorthUpToFixedFrame=function(e,t,r){if(_.equalsEpsilon(e.x,0,_.EPSILON14)&&_.equalsEpsilon(e.y,0,_.EPSILON14)){var i=_.sign(e.z);return o(r)?(r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=-i,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=i,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(0,-i,0,e.x,1,0,0,e.y,0,0,i,e.z,0,0,0,1)}var u=S,s=v,c=N;return t=a(t,f.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,c),o(r)?(r[0]=s.x,r[1]=s.y,r[2]=s.z,r[3]=0,r[4]=c.x,r[5]=c.y,r[6]=c.z,r[7]=0,r[8]=u.x,r[9]=u.y,r[10]=u.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(s.x,c.x,u.x,e.x,s.y,c.y,u.y,e.y,s.z,c.z,u.z,e.z,0,0,0,1)};var O=new n,I=new n,g=new n;A.northEastDownToFixedFrame=function(e,t,r){if(_.equalsEpsilon(e.x,0,_.EPSILON14)&&_.equalsEpsilon(e.y,0,_.EPSILON14)){var i=_.sign(e.z);return o(r)?(r[0]=-i,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=-i,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(-i,0,0,e.x,0,1,0,e.y,0,0,-i,e.z,0,0,0,1)}var u=O,s=I,c=g;return t=a(t,f.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,c),o(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=s.x,r[5]=s.y,r[6]=s.z,r[7]=0,r[8]=-u.x,r[9]=-u.y,r[10]=-u.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(c.x,s.x,-u.x,e.x,c.y,s.y,-u.y,e.y,c.z,s.z,-u.z,e.z,0,0,0,1)},A.northUpEastToFixedFrame=function(e,t,r){if(_.equalsEpsilon(e.x,0,_.EPSILON14)&&_.equalsEpsilon(e.y,0,_.EPSILON14)){var i=_.sign(e.z);return o(r)?(r[0]=-i,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=i,r[7]=0,r[8]=0,r[9]=1,r[10]=0,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(-i,0,0,e.x,0,0,1,e.y,0,i,0,e.z,0,0,0,1)}var u=S,s=v,c=N;return t=a(t,f.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,c),o(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=u.x,r[5]=u.y,r[6]=u.z,r[7]=0,r[8]=s.x,r[9]=s.y,r[10]=s.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(c.x,u.x,s.x,e.x,c.y,u.y,s.y,e.y,c.z,u.z,s.z,e.z,0,0,0,1)},A.northWestUpToFixedFrame=function(e,t,r){if(_.equalsEpsilon(e.x,0,_.EPSILON14)&&_.equalsEpsilon(e.y,0,_.EPSILON14)){var i=_.sign(e.z);return o(r)?(r[0]=-i,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=i,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(-i,0,0,e.x,0,-1,0,e.y,0,0,i,e.z,0,0,0,1)}var u=S,s=v,c=N;return t=a(t,f.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,c),o(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=-s.x,r[5]=-s.y,r[6]=-s.z,r[7]=0,r[8]=u.x,r[9]=u.y,r[10]=u.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(c.x,-s.x,u.x,e.x,c.y,-s.y,u.y,e.y,c.z,-s.z,u.z,e.z,0,0,0,1)};var M=new T,x=new n(1,1,1),w=new y;A.headingPitchRollToFixedFrame=function(e,t,r,i,a,o){var s;"object"==typeof t?(a=r,o=i,s=t.heading,r=t.pitch,i=t.roll):(u("headingPitchRollToFixedFrame","headingPitchRollToFixedFrame with separate heading, pitch, and roll arguments was deprecated in 1.27. It will be removed in 1.30. Use a HeadingPitchRoll object."),s=t);var c=T.fromHeadingPitchRoll(s,r,i,M),l=y.fromTranslationQuaternionRotationScale(n.ZERO,c,x,w);return o=A.eastNorthUpToFixedFrame(e,a,o),y.multiply(o,l,o)};var C=new h,P=new y,U=new p;A.headingPitchRollQuaternion=function(e,t,n,r,i,a){var o;"object"==typeof t?(o=t,i=n,a=r):(u("headingPitchRollQuaternion","headingPitchRollQuaternion with separate heading, pitch, and roll arguments was deprecated in 1.27. It will be removed in 1.30. Use a HeadingPitchRoll object."),C.heading=t,C.pitch=n,C.roll=r,o=C);var s=A.headingPitchRollToFixedFrame(e,o,i,P),c=y.getRotation(s,U);return T.fromRotationMatrix(c,a)};var D=24110.54841,L=8640184.812866,F=.093104,z=-62e-7,B=1.1772758384668e-19,b=72921158553e-15,G=_.TWO_PI/86400,q=new m;A.computeTemeToPseudoFixedMatrix=function(e,t){q=m.addSeconds(e,-m.computeTaiMinusUtc(e),q);var n,r=q.dayNumber,i=q.secondsOfDay,a=r-2451545;n=i>=43200?(a+.5)/R.DAYS_PER_JULIAN_CENTURY:(a-.5)/R.DAYS_PER_JULIAN_CENTURY;var u=D+n*(L+n*(F+n*z)),s=u*G%_.TWO_PI,c=b+B*(r-2451545.5),l=(i+.5*R.SECONDS_PER_DAY)%R.SECONDS_PER_DAY,f=s+c*l,h=Math.cos(f),E=Math.sin(f);return o(t)?(t[0]=h,t[1]=-E,t[2]=0,t[3]=E,t[4]=h,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new p(h,E,0,-E,h,0,0,0,1)},A.iau2006XysData=new E,A.earthOrientationParameters=c.NONE;var W=32.184,H=2451545;A.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+W,i=t.stop.dayNumber,a=t.stop.secondsOfDay+W,o=A.iau2006XysData.preload(n,r,i,a),u=A.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},A.computeIcrfToFixedMatrix=function(e,t){o(t)||(t=new p);var n=A.computeFixedToIcrfMatrix(e,t);if(o(n))return p.transpose(n,t)};var X=new d(0,0,0),V=new l(0,0,0,0,0,0),Y=new p,Z=new p;A.computeFixedToIcrfMatrix=function(e,t){o(t)||(t=new p);var n=A.earthOrientationParameters.compute(e,V);if(o(n)){var r=e.dayNumber,i=e.secondsOfDay+W,a=A.iau2006XysData.computeXysRadians(r,i,X);if(o(a)){var u=a.x+n.xPoleOffset,s=a.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-u*u-s*s)),l=Y;l[0]=1-c*u*u,l[3]=-c*u*s,l[6]=u,l[1]=-c*u*s,l[4]=1-c*s*s,l[7]=s,l[2]=-u,l[5]=-s,l[8]=1-c*(u*u+s*s);var f=p.fromRotationZ(-a.s,Z),h=p.multiply(l,f,Y),E=e.dayNumber,d=e.secondsOfDay-m.computeTaiMinusUtc(e)+n.ut1MinusUtc,y=E-2451545,T=d/R.SECONDS_PER_DAY,S=.779057273264+T+.00273781191135448*(y+T);S=S%1*_.TWO_PI;var v=p.fromRotationZ(S,Z),N=p.multiply(h,v,Y),O=Math.cos(n.xPoleWander),I=Math.cos(n.yPoleWander),g=Math.sin(n.xPoleWander),M=Math.sin(n.yPoleWander),x=r-H+i/R.SECONDS_PER_DAY;x/=36525;var w=-47e-6*x*_.RADIANS_PER_DEGREE/3600,C=Math.cos(w),P=Math.sin(w),U=Z;return U[0]=O*C,U[1]=O*P,U[2]=g,U[3]=-I*P+M*g*C,U[4]=I*C+M*g*P,U[5]=-M*O,U[6]=-M*P-I*g*C,U[7]=M*C-I*g*P,U[8]=I*O,p.multiply(N,U,t)}}};var k=new r;A.pointToWindowCoordinates=function(e,t,n,r){return r=A.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},A.pointToGLWindowCoordinates=function(e,n,i,a){o(a)||(a=new t);var u=k;return y.multiplyByVector(e,r.fromElements(i.x,i.y,i.z,1,u),u),r.multiplyByScalar(u,1/u.w,u),y.multiplyByVector(n,u,u),t.fromCartesian4(u,a)};var j=new n,K=new n,J=new n;A.rotationMatrixFromPositionVelocity=function(e,t,r,i){var u=a(r,f.WGS84).geodeticSurfaceNormal(e,j),s=n.cross(t,u,K);n.equalsEpsilon(s,n.ZERO,_.EPSILON6)&&(s=n.clone(n.UNIT_X,s));var c=n.cross(s,t,J);return n.cross(t,c,s),n.negate(s,s),o(i)||(i=new p),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=s.x,i[4]=s.y,i[5]=s.z,i[6]=c.x,i[7]=c.y,i[8]=c.z,i};var Q=new i,$=new n,ee=new n,te=new r,ne=new r,re=new r,ie=new r,ae=new r,oe=new y,ue=new y;return A.basisTo2D=function(e,t,i){var a=e.ellipsoid,o=y.getColumn(t,3,te),u=a.cartesianToCartographic(o,Q),s=A.eastNorthUpToFixedFrame(o,a,oe),c=y.inverseTransformation(s,ue),l=e.project(u,$),f=ne;f.x=l.z,f.y=l.x,f.z=l.y,f.w=1;var h=y.getColumn(t,0,ee),E=n.magnitude(h),d=y.multiplyByVector(c,h,re);r.fromElements(d.z,d.x,d.y,0,d);var m=y.getColumn(t,1,ee),_=n.magnitude(m),p=y.multiplyByVector(c,m,ie);r.fromElements(p.z,p.x,p.y,0,p);var T=y.getColumn(t,2,ee),R=n.magnitude(T),S=ae;return n.cross(d,p,S),n.normalize(S,S),n.cross(p,S,d),n.normalize(d,d),n.cross(S,d,p),n.normalize(p,p),n.multiplyByScalar(d,E,d),n.multiplyByScalar(p,_,p),n.multiplyByScalar(S,R,S),y.setColumn(i,0,d,i),y.setColumn(i,1,p,i),y.setColumn(i,2,S,i),y.setColumn(i,3,f,i),i},A}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,n,r,i,a,o,u,s,c,l,f,h,E){"use strict";function d(e,t){t=i(t,s.WGS84),e=t.scaleToGeodeticSurface(e);var r=E.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=n.fromCartesian4(l.getColumn(r,0,m)),this._yAxis=n.fromCartesian4(l.getColumn(r,1,m));var a=n.fromCartesian4(l.getColumn(r,2,m));this._plane=f.fromPointNormal(e,a)}var m=new r;o(d.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var _=new e;d.fromPoints=function(t,n){var r=e.fromPoints(t,_);return new d(r.center,n)};var p=new h,y=new n;d.prototype.projectPointOntoPlane=function(e,r){var i=p;i.origin=e,n.normalize(e,i.direction);var o=c.rayPlane(i,this._plane,y);if(a(o)||(n.negate(i.direction,i.direction),o=c.rayPlane(i,this._plane,y)),a(o)){var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return a(r)?(r.x=s,r.y=l,r):new t(s,l)}},d.prototype.projectPointsOntoPlane=function(e,t){a(t)||(t=[]);for(var n=0,r=e.length,i=0;i<r;i++){var o=this.projectPointOntoPlane(e[i],t[n]);a(o)&&(t[n]=o,n++)}return t.length=n,t},d.prototype.projectPointToNearestOnPlane=function(e,r){a(r)||(r=new t);var i=p;i.origin=e,n.clone(this._plane.normal,i.direction);var o=c.rayPlane(i,this._plane,y);a(o)||(n.negate(i.direction,i.direction),o=c.rayPlane(i,this._plane,y));var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return r.x=s,r.y=l,r},d.prototype.projectPointsToNearestOnPlane=function(e,t){a(t)||(t=[]);var n=e.length;t.length=n;for(var r=0;r<n;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var T=new n;return d.prototype.projectPointsOntoEllipsoid=function(e,t){var r=e.length;a(t)?t.length=r:t=new Array(r);for(var i=this._ellipsoid,o=this._origin,u=this._xAxis,s=this._yAxis,c=T,l=0;l<r;++l){var f=e[l];n.multiplyByScalar(u,f.x,c),a(t[l])||(t[l]=new n);var h=n.add(o,c,t[l]);n.multiplyByScalar(s,f.y,c),n.add(h,c,h),i.scaleToGeocentricSurface(h,h)}return t},d}),define("ThirdParty/earcut-2.1.1",[],function(){"use strict";function e(e,n,i){i=i||2;var a=n&&n.length,o=a?n[0]*i:e.length,u=t(e,0,o,i,!0),c=[];if(!u)return c;var l,f,h,E,d,m,_;if(a&&(u=s(e,n,u,i)),e.length>80*i){l=h=e[0],f=E=e[1];for(var p=i;p<o;p+=i)d=e[p],m=e[p+1],d<l&&(l=d),m<f&&(f=m),d>h&&(h=d),m>E&&(E=m);_=Math.max(h-l,E-f)}return r(u,c,i,l,f,_),c}function t(e,t,n,r,i){var a,o;if(i===M(e,t,n,r)>0)for(a=t;a<n;a+=r)o=O(a,e[a],e[a+1],o);else for(a=n-r;a>=t;a-=r)o=O(a,e[a],e[a+1],o);return o&&T(o,o.next)&&(I(o),o=o.next),o}function n(e,t){if(!e)return e;t||(t=e);var n,r=e;do if(n=!1,r.steiner||!T(r,r.next)&&0!==y(r.prev,r,r.next))r=r.next;else{if(I(r),r=t=r.prev,r===r.next)return null;n=!0}while(n||r!==t);return t}function r(e,t,s,c,l,f,E){if(e){!E&&f&&h(e,c,l,f);for(var d,m,_=e;e.prev!==e.next;)if(d=e.prev,m=e.next,f?a(e,c,l,f):i(e))t.push(d.i/s),t.push(e.i/s),t.push(m.i/s),I(e),e=m.next,_=m.next;else if(e=m,e===_){E?1===E?(e=o(e,t,s),r(e,t,s,c,l,f,2)):2===E&&u(e,t,s,c,l,f):r(n(e),t,s,c,l,f,1);break}}}function i(e){var t=e.prev,n=e,r=e.next;if(y(t,n,r)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(_(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&y(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function a(e,t,n,r){var i=e.prev,a=e,o=e.next;if(y(i,a,o)>=0)return!1;for(var u=i.x<a.x?i.x<o.x?i.x:o.x:a.x<o.x?a.x:o.x,s=i.y<a.y?i.y<o.y?i.y:o.y:a.y<o.y?a.y:o.y,c=i.x>a.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,l=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,f=d(u,s,t,n,r),h=d(c,l,t,n,r),E=e.nextZ;E&&E.z<=h;){if(E!==e.prev&&E!==e.next&&_(i.x,i.y,a.x,a.y,o.x,o.y,E.x,E.y)&&y(E.prev,E,E.next)>=0)return!1;E=E.nextZ}for(E=e.prevZ;E&&E.z>=f;){if(E!==e.prev&&E!==e.next&&_(i.x,i.y,a.x,a.y,o.x,o.y,E.x,E.y)&&y(E.prev,E,E.next)>=0)return!1;E=E.prevZ}return!0}function o(e,t,n){var r=e;do{var i=r.prev,a=r.next.next;!T(i,a)&&R(i,r,r.next,a)&&S(i,a)&&S(a,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(a.i/n),I(r),I(r.next),r=e=a),r=r.next}while(r!==e);return r}function u(e,t,i,a,o,u){var s=e;do{for(var c=s.next.next;c!==s.prev;){if(s.i!==c.i&&p(s,c)){var l=N(s,c);return s=n(s,s.next),l=n(l,l.next),r(s,t,i,a,o,u),void r(l,t,i,a,o,u)}c=c.next}s=s.next}while(s!==e)}function s(e,r,i,a){var o,u,s,f,h,E=[];for(o=0,u=r.length;o<u;o++)s=r[o]*a,f=o<u-1?r[o+1]*a:e.length,h=t(e,s,f,a,!1),h===h.next&&(h.steiner=!0),E.push(m(h));for(E.sort(c),o=0;o<E.length;o++)l(E[o],i),i=n(i,i.next);return i}function c(e,t){return e.x-t.x}function l(e,t){if(t=f(e,t)){var r=N(t,e);n(r,r.next)}}function f(e,t){var n,r=t,i=e.x,a=e.y,o=-(1/0);do{if(a<=r.y&&a>=r.next.y){var u=r.x+(a-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(u<=i&&u>o){if(o=u,u===i){if(a===r.y)return r;if(a===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(i===o)return n.prev;var s,c=n,l=n.x,f=n.y,h=1/0;for(r=n.next;r!==c;)i>=r.x&&r.x>=l&&_(a<f?i:o,a,l,f,a<f?o:i,a,r.x,r.y)&&(s=Math.abs(a-r.y)/(i-r.x),(s<h||s===h&&r.x>n.x)&&S(r,e)&&(n=r,h=s)),r=r.next;return n}function h(e,t,n,r){var i=e;do null===i.z&&(i.z=d(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,E(i)}function E(e){var t,n,r,i,a,o,u,s,c=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,r=n,u=0,t=0;t<c&&(u++,r=r.nextZ,r);t++);for(s=c;u>0||s>0&&r;)0===u?(i=r,r=r.nextZ,s--):0!==s&&r?n.z<=r.z?(i=n,n=n.nextZ,u--):(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,u--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;n=r}a.nextZ=null,c*=2}while(o>1);return e}function d(e,t,n,r,i){return e=32767*(e-n)/i,t=32767*(t-r)/i,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function m(e){var t=e,n=e;do t.x<n.x&&(n=t),t=t.next;while(t!==e);return n}function _(e,t,n,r,i,a,o,u){return(i-o)*(t-u)-(e-o)*(a-u)>=0&&(e-o)*(r-u)-(n-o)*(t-u)>=0&&(n-o)*(a-u)-(i-o)*(r-u)>=0}function p(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!A(e,t)&&S(e,t)&&S(t,e)&&v(e,t)}function y(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function T(e,t){return e.x===t.x&&e.y===t.y}function R(e,t,n,r){return!!(T(e,t)&&T(n,r)||T(e,r)&&T(n,t))||y(e,t,n)>0!=y(e,t,r)>0&&y(n,r,e)>0!=y(n,r,t)>0}function A(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&R(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function S(e,t){return y(e.prev,e,e.next)<0?y(e,t,e.next)>=0&&y(e,e.prev,t)>=0:y(e,t,e.prev)<0||y(e,e.next,t)<0}function v(e,t){var n=e,r=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do n.y>a!=n.next.y>a&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function N(e,t){var n=new g(e.i,e.x,e.y),r=new g(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function O(e,t,n,r){var i=new g(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function I(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function g(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function M(e,t,n,r){for(var i=0,a=t,o=n-r;a<n;a+=r)i+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return i}return e.deviation=function(e,t,n,r){var i=t&&t.length,a=i?t[0]*n:e.length,o=Math.abs(M(e,0,a,n));if(i)for(var u=0,s=t.length;u<s;u++){var c=t[u]*n,l=u<s-1?t[u+1]*n:e.length;o-=Math.abs(M(e,c,l,n))}var f=0;for(u=0;u<r.length;u+=3){var h=r[u]*n,E=r[u+1]*n,d=r[u+2]*n;f+=Math.abs((e[h]-e[d])*(e[E+1]-e[h+1])-(e[h]-e[E])*(e[d+1]-e[h+1]))}return 0===o&&0===f?0:Math.abs((f-o)/o)},e.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,i=0;i<e.length;i++){for(var a=0;a<e[i].length;a++)for(var o=0;o<t;o++)n.vertices.push(e[i][a][o]);i>0&&(r+=e[i-1].length,n.holes.push(r))}return n},e}),define("Core/WindingOrder",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={CLOCKWISE:t.CW,COUNTER_CLOCKWISE:t.CCW,validate:function(e){return e===n.CLOCKWISE||e===n.COUNTER_CLOCKWISE}};return e(n)}),define("Core/PolygonPipeline",["../ThirdParty/earcut-2.1.1","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./Math","./PrimitiveType","./WindingOrder"],function(e,t,n,r,i,a,o,u,s,c,l,f,h){"use strict";var E=new n,d=new n,m={};m.computeArea2D=function(e){for(var t=e.length,n=0,r=t-1,i=0;i<t;r=i++){var a=e[r],o=e[i];n+=a.x*o.y-o.x*a.y}return.5*n},m.computeWindingOrder2D=function(e){var t=m.computeArea2D(e);return t>0?h.COUNTER_CLOCKWISE:h.CLOCKWISE},m.triangulate=function(n,r){var i=t.packArray(n);return e(i,r,2)};var _=new n,p=new n,y=new n,T=new n,R=new n,A=new n,S=new n;return m.computeSubdivision=function(e,t,o,u){u=i(u,l.RADIANS_PER_DEGREE);var h,E=o.slice(0),d=t.length,m=new Array(3*d),v=0;for(h=0;h<d;h++){var N=t[h];m[v++]=N.x,m[v++]=N.y,m[v++]=N.z}for(var O=[],I={},g=e.maximumRadius,M=l.chordLength(u,g),x=M*M;E.length>0;){var w,C,P=E.pop(),U=E.pop(),D=E.pop(),L=n.fromArray(m,3*D,_),F=n.fromArray(m,3*U,p),z=n.fromArray(m,3*P,y),B=n.multiplyByScalar(n.normalize(L,T),g,T),b=n.multiplyByScalar(n.normalize(F,R),g,R),G=n.multiplyByScalar(n.normalize(z,A),g,A),q=n.magnitudeSquared(n.subtract(B,b,S)),W=n.magnitudeSquared(n.subtract(b,G,S)),H=n.magnitudeSquared(n.subtract(G,B,S)),X=Math.max(q,W,H);X>x?q===X?(w=Math.min(D,U)+" "+Math.max(D,U),h=I[w],a(h)||(C=n.add(L,F,S),n.multiplyByScalar(C,.5,C),m.push(C.x,C.y,C.z),h=m.length/3-1,I[w]=h),E.push(D,h,P),E.push(h,U,P)):W===X?(w=Math.min(U,P)+" "+Math.max(U,P),h=I[w],a(h)||(C=n.add(F,z,S),n.multiplyByScalar(C,.5,C),m.push(C.x,C.y,C.z),h=m.length/3-1,I[w]=h),E.push(U,h,D),E.push(h,P,D)):H===X&&(w=Math.min(P,D)+" "+Math.max(P,D),h=I[w],a(h)||(C=n.add(z,L,S),n.multiplyByScalar(C,.5,C),m.push(C.x,C.y,C.z),h=m.length/3-1,I[w]=h),E.push(P,h,U),E.push(h,D,U)):(O.push(D),O.push(U),O.push(P))}return new s({attributes:{position:new c({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:m})},indices:O,primitiveType:f.TRIANGLES})},m.scaleToGeodeticHeight=function(e,t,r,o){r=i(r,u.WGS84);var s=E,c=d;if(t=i(t,0),o=i(o,!0),a(e))for(var l=e.length,f=0;f<l;f+=3)n.fromArray(e,f,c),o&&(c=r.scaleToGeodeticSurface(c,c)),0!==t&&(s=r.geodeticSurfaceNormal(c,s),n.multiplyByScalar(s,t,s),n.add(c,s,c)),e[f]=c.x,e[f+1]=c.y,e[f+2]=c.z;return e},m}),define("Core/EllipsoidGeodesic",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,n,r,i,a,o,u){"use strict";function s(e){var t=e._uSquared,n=e._ellipsoid.maximumRadius,r=e._ellipsoid.minimumRadius,i=(n-r)/n,a=Math.cos(e._startHeading),o=Math.sin(e._startHeading),u=(1-i)*Math.tan(e._start.latitude),s=1/Math.sqrt(1+u*u),c=s*u,l=Math.atan2(u,a),f=s*o,h=f*f,E=1-h,d=Math.sqrt(E),m=t/4,_=m*m,p=_*m,y=_*_,T=1+m-3*_/4+5*p/4-175*y/64,R=1-m+15*_/8-35*p/8,A=1-3*m+35*_/4,S=1-5*m,v=T*l-R*Math.sin(2*l)*m/2-A*Math.sin(4*l)*_/16-S*Math.sin(6*l)*p/48-5*Math.sin(8*l)*y/512,N=e._constants;N.a=n,N.b=r,N.f=i,N.cosineHeading=a,N.sineHeading=o,N.tanU=u,N.cosineU=s,N.sineU=c,N.sigma=l,N.sineAlpha=f,N.sineSquaredAlpha=h,N.cosineSquaredAlpha=E,N.cosineAlpha=d,N.u2Over4=m,N.u4Over16=_,N.u6Over64=p,N.u8Over256=y,N.a0=T,N.a1=R,N.a2=A,N.a3=S,N.distanceRatio=v}function c(e,t){return e*t*(4+e*(4-3*t))/16}function l(e,t,n,r,i,a,o){var u=c(e,n);return(1-u)*e*t*(r+u*i*(o+u*a*(2*o*o-1)))}function f(e,t,n,r,i,a,o){var s,c,f,h,E,d=(t-n)/t,m=a-r,_=Math.atan((1-d)*Math.tan(i)),p=Math.atan((1-d)*Math.tan(o)),y=Math.cos(_),T=Math.sin(_),R=Math.cos(p),A=Math.sin(p),S=y*R,v=y*A,N=T*A,O=T*R,I=m,g=u.TWO_PI,M=Math.cos(I),x=Math.sin(I);do{M=Math.cos(I),x=Math.sin(I);var w=v-O*M;f=Math.sqrt(R*R*x*x+w*w),c=N+S*M,s=Math.atan2(f,c);var C;0===f?(C=0,h=1):(C=S*x/f,h=1-C*C),g=I,E=c-2*N/h,isNaN(E)&&(E=0),I=m+l(d,C,h,s,f,c,E)}while(Math.abs(I-g)>u.EPSILON12);var P=h*(t*t-n*n)/(n*n),U=1+P*(4096+P*(P*(320-175*P)-768))/16384,D=P*(256+P*(P*(74-47*P)-128))/1024,L=E*E,F=D*f*(E+D*(c*(2*L-1)-D*E*(4*f*f-3)*(4*L-3)/6)/4),z=n*U*(s-F),B=Math.atan2(R*x,v-O*M),b=Math.atan2(y*x,v*M-O);e._distance=z,e._startHeading=B,e._endHeading=b,e._uSquared=P}function h(n,r,i,a){e.normalize(a.cartographicToCartesian(r,m),d),e.normalize(a.cartographicToCartesian(i,m),m);f(n,a.maximumRadius,a.minimumRadius,r.longitude,r.latitude,i.longitude,i.latitude),n._start=t.clone(r,n._start),n._end=t.clone(i,n._end),n._start.height=0,n._end.height=0,s(n)}function E(e,i,a){var u=n(a,o.WGS84);this._ellipsoid=u,this._start=new t,this._end=new t,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,r(e)&&r(i)&&h(this,e,i,u)}var d=new e,m=new e;return i(E.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return this._startHeading}},endHeading:{ -get:function(){return this._endHeading}}}),E.prototype.setEndPoints=function(e,t){h(this,e,t,this._ellipsoid)},E.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},E.prototype.interpolateUsingSurfaceDistance=function(e,n){var i=this._constants,a=i.distanceRatio+e/i.b,o=Math.cos(2*a),u=Math.cos(4*a),s=Math.cos(6*a),c=Math.sin(2*a),f=Math.sin(4*a),h=Math.sin(6*a),E=Math.sin(8*a),d=a*a,m=a*d,_=i.u8Over256,p=i.u2Over4,y=i.u6Over64,T=i.u4Over16,R=2*m*_*o/3+a*(1-p+7*T/4-15*y/4+579*_/64-(T-15*y/4+187*_/16)*o-(5*y/4-115*_/16)*u-29*_*s/16)+(p/2-T+71*y/32-85*_/16)*c+(5*T/16-5*y/4+383*_/96)*f-d*((y-11*_/2)*c+5*_*f/2)+(29*y/96-29*_/16)*h+539*_*E/1536,A=Math.asin(Math.sin(R)*i.cosineAlpha),S=Math.atan(i.a/i.b*Math.tan(A));R-=i.sigma;var v=Math.cos(2*i.sigma+R),N=Math.sin(R),O=Math.cos(R),I=i.cosineU*O,g=i.sineU*N,M=Math.atan2(N*i.sineHeading,I-g*i.cosineHeading),x=M-l(i.f,i.sineAlpha,i.cosineSquaredAlpha,R,N,O,v);return r(n)?(n.longitude=this._start.longitude+x,n.latitude=S,n.height=0,n):new t(this._start.longitude+x,S,0)},E}),define("Core/PolylinePipeline",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidGeodesic","./IntersectionTests","./isArray","./Math","./Matrix4","./Plane"],function(e,t,n,r,i,a,o,u,s,c,l,f){"use strict";function h(e,t,n){var r=N;r.length=e;var i;if(t===n){for(i=0;i<e;i++)r[i]=t;return r}var a=n-t,o=a/e;for(i=0;i<e;i++){var u=t+i*o;r[i]=u}return r}function E(t,n,r,i,a,o,u,s){var c=i.scaleToGeodeticSurface(t,M),l=i.scaleToGeodeticSurface(n,x),f=d.numberOfPoints(t,n,r),E=i.cartesianToCartographic(c,O),m=i.cartesianToCartographic(l,I),_=h(f,a,o);w.setEndPoints(E,m);var p=w.surfaceDistance/f,y=s;E.height=a;var T=i.cartographicToCartesian(E,g);e.pack(T,u,y),y+=3;for(var R=1;R<f;R++){var A=w.interpolateUsingSurfaceDistance(R*p,I);A.height=_[R],T=i.cartographicToCartesian(A,g),e.pack(T,u,y),y+=3}return y}var d={};d.numberOfPoints=function(t,n,r){var i=e.distance(t,n);return Math.ceil(i/r)};var m=new t;d.extractHeights=function(e,t){for(var n=e.length,r=new Array(n),i=0;i<n;i++){var a=e[i];r[i]=t.cartesianToCartographic(a,m).height}return r};var _=new l,p=new e,y=new e,T=new f(e.ZERO,0),R=new e,A=new f(e.ZERO,0),S=new e,v=new e,N=[],O=new t,I=new t,g=new e,M=new e,x=new e,w=new o;return d.wrapLongitude=function(t,i){var a=[],o=[];if(r(t)&&t.length>0){i=n(i,l.IDENTITY);var s=l.inverseTransformation(i,_),c=l.multiplyByPoint(s,e.ZERO,p),h=l.multiplyByPointAsVector(s,e.UNIT_Y,y),E=f.fromPointNormal(c,h,T),d=l.multiplyByPointAsVector(s,e.UNIT_X,R),m=f.fromPointNormal(c,d,A),N=1;a.push(e.clone(t[0]));for(var O=a[0],I=t.length,g=1;g<I;++g){var M=t[g];if(f.getPointDistance(m,O)<0||f.getPointDistance(m,M)<0){var x=u.lineSegmentPlane(O,M,E,S);if(r(x)){var w=e.multiplyByScalar(h,5e-9,v);f.getPointDistance(E,O)<0&&e.negate(w,w),a.push(e.add(x,w,new e)),o.push(N+1),e.negate(w,w),a.push(e.add(x,w,new e)),N=1}}a.push(e.clone(t[g])),N++,O=M}o.push(N)}return{positions:a,lengths:o}},d.generateArc=function(t){r(t)||(t={});var i=t.positions,o=i.length,u=n(t.ellipsoid,a.WGS84),l=n(t.height,0),f=s(l);if(o<1)return[];if(1===o){var h=u.scaleToGeodeticSurface(i[0],M);if(l=f?l[0]:l,0!==l){var m=u.geodeticSurfaceNormal(h,g);e.multiplyByScalar(m,l,m),e.add(h,m,h)}return[h.x,h.y,h.z]}var _=t.minDistance;if(!r(_)){var p=n(t.granularity,c.RADIANS_PER_DEGREE);_=c.chordLength(p,u.maximumRadius)}var y,T=0;for(y=0;y<o-1;y++)T+=d.numberOfPoints(i[y],i[y+1],_);var R=3*(T+1),A=new Array(R),S=0;for(y=0;y<o-1;y++){var v=i[y],I=i[y+1],x=f?l[y]:l,w=f?l[y+1]:l;S=E(v,I,_,u,x,w,A,S)}N.length=0;var C=i[o-1],P=u.cartesianToCartographic(C,O);P.height=f?l[o-1]:l;var U=u.cartographicToCartesian(P,g);return e.pack(U,A,R-3),A},d.generateCartesianArc=function(t){for(var n=d.generateArc(t),r=n.length/3,i=new Array(r),a=0;a<r;a++)i[a]=e.unpack(n,3*a);return i},d}),define("Core/WallGeometryLibrary",["./Cartographic","./defined","./EllipsoidTangentPlane","./Math","./PolygonPipeline","./PolylinePipeline","./WindingOrder"],function(e,t,n,r,i,a,o){"use strict";function u(e,t){return r.equalsEpsilon(e.latitude,t.latitude,r.EPSILON14)&&r.equalsEpsilon(e.longitude,t.longitude,r.EPSILON14)}function s(n,r,i,a){var o=r.length;if(!(o<2)){var s=t(a),c=t(i),h=!0,E=new Array(o),d=new Array(o),m=new Array(o),_=r[0];E[0]=_;var p=n.cartesianToCartographic(_,l);c&&(p.height=i[0]),h=h&&p.height<=0,d[0]=p.height,s?m[0]=a[0]:m[0]=0;for(var y=1,T=1;T<o;++T){var R=r[T],A=n.cartesianToCartographic(R,f);c&&(A.height=i[T]),h=h&&A.height<=0,u(p,A)?p.height<A.height&&(d[y-1]=A.height):(E[y]=R,d[y]=A.height,s?m[y]=a[T]:m[y]=0,e.clone(A,p),++y)}if(!(h||y<2))return E.length=y,d.length=y,m.length=y,{positions:E,topHeights:d,bottomHeights:m}}}var c={},l=new e,f=new e,h=new Array(2),E=new Array(2),d={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};return c.computePositions=function(e,u,c,l,f,m){var _=s(e,u,c,l);if(t(_)){if(u=_.positions,c=_.topHeights,l=_.bottomHeights,u.length>=3){var p=n.fromPoints(u,e),y=p.projectPointsOntoPlane(u);i.computeWindingOrder2D(y)===o.CLOCKWISE&&(u.reverse(),c.reverse(),l.reverse())}var T,R,A=u.length,S=A-2,v=r.chordLength(f,e.maximumRadius),N=d;if(N.minDistance=v,N.ellipsoid=e,m){var O,I=0;for(O=0;O<A-1;O++)I+=a.numberOfPoints(u[O],u[O+1],v)+1;T=new Float64Array(3*I),R=new Float64Array(3*I);var g=h,M=E;N.positions=g,N.height=M;var x=0;for(O=0;O<A-1;O++){g[0]=u[O],g[1]=u[O+1],M[0]=c[O],M[1]=c[O+1];var w=a.generateArc(N);T.set(w,x),M[0]=l[O],M[1]=l[O+1],R.set(a.generateArc(N),x),x+=w.length}}else N.positions=u,N.height=c,T=new Float64Array(a.generateArc(N)),N.height=l,R=new Float64Array(a.generateArc(N));return{bottomPositions:R,topPositions:T,numCorners:S}}},c}),define("Core/WallGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./VertexFormat","./WallGeometryLibrary"],function(e,t,n,r,i,a,o,u,s,c,l,f,h,E,d){"use strict";function m(e){e=r(e,r.EMPTY_OBJECT);var n=e.positions,a=e.maximumHeights,u=e.minimumHeights,s=r(e.vertexFormat,E.DEFAULT),c=r(e.granularity,f.RADIANS_PER_DEGREE),l=r(e.ellipsoid,o.WGS84);this._positions=n,this._minimumHeights=u,this._maximumHeights=a,this._vertexFormat=E.clone(s),this._granularity=c,this._ellipsoid=o.clone(l),this._workerName="createWallGeometry";var h=1+n.length*t.packedLength+2;i(u)&&(h+=u.length),i(a)&&(h+=a.length),this.packedLength=h+o.packedLength+E.packedLength+1}var _=new t,p=new t,y=new t,T=new t,R=new t,A=new t,S=new t,v=new t;m.pack=function(e,n,a){a=r(a,0);var u,s=e._positions,c=s.length;for(n[a++]=c,u=0;u<c;++u,a+=t.packedLength)t.pack(s[u],n,a);var l=e._minimumHeights;if(c=i(l)?l.length:0,n[a++]=c,i(l))for(u=0;u<c;++u)n[a++]=l[u];var f=e._maximumHeights;if(c=i(f)?f.length:0,n[a++]=c,i(f))for(u=0;u<c;++u)n[a++]=f[u];return o.pack(e._ellipsoid,n,a),a+=o.packedLength,E.pack(e._vertexFormat,n,a),a+=E.packedLength,n[a]=e._granularity,n};var N=o.clone(o.UNIT_SPHERE),O=new E,I={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:N,vertexFormat:O,granularity:void 0};return m.unpack=function(e,n,a){n=r(n,0);var u,s=e[n++],c=new Array(s);for(u=0;u<s;++u,n+=t.packedLength)c[u]=t.unpack(e,n);s=e[n++];var l;if(s>0)for(l=new Array(s),u=0;u<s;++u)l[u]=e[n++];s=e[n++];var f;if(s>0)for(f=new Array(s),u=0;u<s;++u)f[u]=e[n++];var h=o.unpack(e,n,N);n+=o.packedLength;var d=E.unpack(e,n,O);n+=E.packedLength;var _=e[n];return i(a)?(a._positions=c,a._minimumHeights=l,a._maximumHeights=f,a._ellipsoid=o.clone(h,a._ellipsoid),a._vertexFormat=E.clone(d,a._vertexFormat),a._granularity=_,a):(I.positions=c,I.minimumHeights=l,I.maximumHeights=f,I.granularity=_,new m(I))},m.fromConstantHeights=function(e){e=r(e,r.EMPTY_OBJECT);var t,n,a=e.positions,o=e.minimumHeight,u=e.maximumHeight,s=i(o),c=i(u);if(s||c){var l=a.length;t=s?new Array(l):void 0,n=c?new Array(l):void 0;for(var f=0;f<l;++f)s&&(t[f]=o),c&&(n[f]=u)}var h={positions:a,maximumHeights:n,minimumHeights:t,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat};return new m(h)},m.createGeometry=function(r){var a=r._positions,o=r._minimumHeights,E=r._maximumHeights,m=r._vertexFormat,N=r._granularity,O=r._ellipsoid,I=d.computePositions(O,a,E,o,N,!0);if(i(I)){var g=I.bottomPositions,M=I.topPositions,x=I.numCorners,w=M.length,C=2*w,P=m.position?new Float64Array(C):void 0,U=m.normal?new Float32Array(C):void 0,D=m.tangent?new Float32Array(C):void 0,L=m.binormal?new Float32Array(C):void 0,F=m.st?new Float32Array(C/3*2):void 0,z=0,B=0,b=0,G=0,q=0,W=v,H=S,X=A,V=!0;w/=3;var Y,Z=0,k=1/(w-a.length+1);for(Y=0;Y<w;++Y){var j=3*Y,K=t.fromArray(M,j,_),J=t.fromArray(g,j,p);if(m.position&&(P[z++]=J.x,P[z++]=J.y,P[z++]=J.z,P[z++]=K.x,P[z++]=K.y,P[z++]=K.z),m.st&&(F[q++]=Z,F[q++]=0,F[q++]=Z,F[q++]=1),m.normal||m.tangent||m.binormal){var Q,$=t.clone(t.ZERO,R),ee=O.scaleToGeodeticSurface(t.fromArray(M,j,p),p);if(Y+1<w&&(Q=O.scaleToGeodeticSurface(t.fromArray(M,j+3,y),y),$=t.fromArray(M,j+3,R)),V){var te=t.subtract($,K,T),ne=t.subtract(ee,K,_);W=t.normalize(t.cross(ne,te,W),W),V=!1}t.equalsEpsilon(Q,ee,f.EPSILON10)?V=!0:(Z+=k,m.tangent&&(H=t.normalize(t.subtract(Q,ee,H),H)),m.binormal&&(X=t.normalize(t.cross(W,H,X),X))),m.normal&&(U[B++]=W.x,U[B++]=W.y,U[B++]=W.z,U[B++]=W.x,U[B++]=W.y,U[B++]=W.z),m.tangent&&(D[G++]=H.x,D[G++]=H.y,D[G++]=H.z,D[G++]=H.x,D[G++]=H.y,D[G++]=H.z),m.binormal&&(L[b++]=X.x,L[b++]=X.y,L[b++]=X.z,L[b++]=X.x,L[b++]=X.y,L[b++]=X.z)}}var re=new c;m.position&&(re.position=new s({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:P})),m.normal&&(re.normal=new s({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:U})),m.tangent&&(re.tangent=new s({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:D})),m.binormal&&(re.binormal=new s({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:L})),m.st&&(re.st=new s({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:F}));var ie=C/3;C-=6*(x+1);var ae=l.createTypedArray(ie,C),oe=0;for(Y=0;Y<ie-2;Y+=2){var ue=Y,se=Y+2,ce=t.fromArray(P,3*ue,_),le=t.fromArray(P,3*se,p);if(!t.equalsEpsilon(ce,le,f.EPSILON10)){var fe=Y+1,he=Y+3;ae[oe++]=fe,ae[oe++]=ue,ae[oe++]=he,ae[oe++]=he,ae[oe++]=ue,ae[oe++]=se}}return new u({attributes:re,indices:ae,primitiveType:h.TRIANGLES,boundingSphere:new e.fromVertices(P)})}},m}),define("Workers/createWallGeometry",["../Core/defined","../Core/Ellipsoid","../Core/WallGeometry"],function(e,t,n){"use strict";function r(r,i){return e(i)&&(r=n.unpack(r,i)),r._ellipsoid=t.clone(r._ellipsoid),n.createGeometry(r)}return r})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e){return e+" is required, actual value was undefined"}function r(e,t,n){return"Expected "+n+" to be typeof "+t+", actual typeof was "+e}var a={};return a.typeOf={},a.defined=function(r,a){if(!e(a))throw new t(n(r))},a.typeOf.func=function(e,n){if("function"!=typeof n)throw new t(r(typeof n,"function",e))},a.typeOf.string=function(e,n){if("string"!=typeof n)throw new t(r(typeof n,"string",e))},a.typeOf.number=function(e,n){if("number"!=typeof n)throw new t(r(typeof n,"number",e))},a.typeOf.number.lessThan=function(e,n,r){if(a.typeOf.number(e,n),n>=r)throw new t("Expected "+e+" to be less than "+r+", actual value was "+n)},a.typeOf.number.lessThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n>r)throw new t("Expected "+e+" to be less than or equal to "+r+", actual value was "+n)},a.typeOf.number.greaterThan=function(e,n,r){if(a.typeOf.number(e,n),n<=r)throw new t("Expected "+e+" to be greater than "+r+", actual value was "+n)},a.typeOf.number.greaterThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n<r)throw new t("Expected "+e+" to be greater than or equal to"+r+", actual value was "+n)},a.typeOf.object=function(e,n){if("object"!=typeof n)throw new t(r(typeof n,"object",e))},a.typeOf.bool=function(e,n){if("boolean"!=typeof n)throw new t(r(typeof n,"boolean",e))},a}),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";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),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 n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(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^=e<<7&2636928640,e^=e<<15&4022730752,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,n,r){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:e<0?-1:0},a.signNotZero=function(e){return e<0?-1:1},a.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*a.clamp(e,-1,1)+.5)*n)},a.fromSNorm=function(e,n){return n=t(n,255),a.clamp(e,0,n)/n*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},a.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},a.lerp=function(e,t,n){return(1-n)*e+n*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){var t=a.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},a.clampToLatitudeRange=function(e){return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){return(e%t+t)%t},a.equalsEpsilon=function(e,n,r,a){a=t(a,r);var i=Math.abs(e-n);return i<=a||i<=r*Math.max(Math.abs(e),Math.abs(n))};var i=[1];a.factorial=function(e){var t=i.length;if(e>=t)for(var n=i[t-1],r=t;r<=e;r++)i.push(n*r);return i[e]},a.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},a.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return a.setRandomNumberSeed=function(t){o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(e){return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){return Math.log(e)/Math.log(t)},a.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var a=e.clock,i=e.cone,u=t(e.magnitude,1),s=u*Math.sin(i);return r.x=s*Math.cos(a),r.y=s*Math.sin(a),r.z=u*Math.cos(i),r},o.fromElements=function(e,t,r,a){return n(a)?(a.x=e,a.y=t,a.z=r,a):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var a=0;a<r;++a)o.pack(e[a],t,3*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var a=0;a<r;a+=3){var i=a/3;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,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};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var n=o.dot(c,l),r=o.magnitude(o.cross(c,l,c));return Math.atan2(r,n)};var f=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)},o.cross=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=t.x,u=t.y,s=t.z,c=a*s-i*u,l=i*o-r*s,f=r*u-a*o;return n.x=c,n.y=l,n.z=f,n},o.fromDegrees=function(e,t,n,r,a){return e=i.toRadians(e),t=i.toRadians(t),o.fromRadians(e,t,n,r,a)};var h=new o,E=new o,d=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,a,i,u){a=t(a,0);var s=n(i)?i.radiiSquared:d,c=Math.cos(r);h.x=c*Math.cos(e),h.y=c*Math.sin(e),h.z=Math.sin(r),h=o.normalize(h,h),o.multiplyComponents(s,h,E);var l=Math.sqrt(o.dot(h,E));return E=o.divideByScalar(E,l,E),h=o.multiplyByScalar(h,a,h),n(u)||(u=new o),o.add(E,h,u)},o.fromDegreesArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromDegrees(u,s,0,t,r[c])}return r},o.fromRadiansArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromRadians(u,s,0,t,r[c])}return r},o.fromDegreesArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromDegrees(u,s,c,t,r[l])}return r},o.fromRadiansArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromRadians(u,s,c,t,r[l])}return r},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(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,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(n,a,u,s,c){var l=n.x,f=n.y,h=n.z,E=a.x,d=a.y,m=a.z,_=l*l*E*E,p=f*f*d*d,y=h*h*m*m,T=_+p+y,R=Math.sqrt(1/T),A=e.multiplyByScalar(n,R,i);if(T<s)return isFinite(R)?e.clone(A,c):void 0;var S=u.x,v=u.y,N=u.z,O=o;O.x=A.x*S*2,O.y=A.y*v*2,O.z=A.z*N*2;var I,g,M,x,w,C,P,U,D,L,F,z=(1-R)*e.magnitude(n)/(.5*e.magnitude(O)),B=0;do{z-=B,M=1/(1+z*S),x=1/(1+z*v),w=1/(1+z*N),C=M*M,P=x*x,U=w*w,D=C*M,L=P*x,F=U*w,I=_*C+p*P+y*U-1,g=_*D*S+p*L*v+y*F*N;var b=-2*g;B=I/b}while(Math.abs(I)>r.EPSILON12);return t(c)?(c.x=l*M,c.y=f*x,c.z=h*w,c):new e(l*M,f*x,h*w)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o){"use strict";function u(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)}u.fromRadians=function(e,r,a,i){return a=t(a,0),n(i)?(i.longitude=e,i.latitude=r,i.height=a,i):new u(e,r,a)},u.fromDegrees=function(e,t,n,r){return e=i.toRadians(e),t=i.toRadians(t),u.fromRadians(e,t,n,r)};var s=new e,c=new e,l=new e,f=new e(1/6378137,1/6378137,1/6356752.314245179),h=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),E=i.EPSILON1;return u.fromCartesian=function(t,r,a){var d=n(r)?r.oneOverRadii:f,m=n(r)?r.oneOverRadiiSquared:h,_=n(r)?r._centerToleranceSquared:E,p=o(t,d,m,_,c);if(n(p)){var y=e.multiplyComponents(p,m,s);y=e.normalize(y,y);var T=e.subtract(t,p,l),R=Math.atan2(y.y,y.x),A=Math.asin(y.z),S=i.sign(e.dot(T,t))*e.magnitude(T);return n(a)?(a.longitude=R,a.latitude=A,a.height=S,a):new u(R,A,S)}},u.clone=function(e,t){if(n(e))return n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},u.ZERO=a(new u(0,0,0)),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,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(t,r,a,i){r=n(r,0),a=n(a,0),i=n(i,0),t._radii=new e(r,a,i),t._radiiSquared=new e(r*r,a*a,i*i),t._radiiToTheFourth=new e(r*r*r*r,a*a*a*a,i*i*i*i),t._oneOverRadii=new e(0===r?0:1/r,0===a?0:1/a,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===a?0:1/(a*a),0===i?0:1/(i*i)),t._minimumRadius=Math.min(r,a,i),t._maximumRadius=Math.max(r,a,i),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,c(this,e,t,n)}a(l.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}}}),l.clone=function(t,n){if(r(t)){var a=t._radii;return r(n)?(e.clone(a,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new l(a.x,a.y,a.z)}},l.fromCartesian3=function(e,t){return r(t)||(t=new l),r(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,r,a){return a=n(a,0),e.pack(t._radii,r,a),r},l.unpack=function(t,r,a){r=n(r,0);var i=e.unpack(t,r);return l.fromCartesian3(i,a)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,n){var a=t.longitude,i=t.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return r(n)||(n=new e),n.x=u,n.y=s,n.z=c,e.normalize(n,n)},l.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var f=new e,h=new e;l.prototype.cartographicToCartesian=function(t,n){var a=f,i=h;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(e.dot(a,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(a,t.height,a),r(n)||(n=new e),e.add(i,a,n)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var E=new e,d=new e,m=new e;return l.prototype.cartesianToCartographic=function(n,a){var i=this.scaleToGeodeticSurface(n,d);if(r(i)){var o=this.geodeticSurfaceNormal(i,E),s=e.subtract(n,i,m),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),f=u.sign(e.dot(s,n))*e.magnitude(s);return r(a)?(a.longitude=c,a.latitude=l,a.height=f,a):new t(c,l,f)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var a=t.x,i=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return e.multiplyByScalar(t,s,n)},l.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},l.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},l.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,a,i){a=n(a,0);var o=this._sqauredXOverSquaredZ;if(r(i)||(i=new e),i.x=0,i.y=0,i.z=t.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},l}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,a,i,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return r(n)?(n.x=i,n.y=o,n.z=u,n):new e(i,o,u)},u.prototype.unproject=function(e,n){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,u=e.z;return r(n)?(n.longitude=i,n.latitude=o,n.height=u,n):new t(i,o,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";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a,i,o,u,s,c){this[0]=n(e,0),this[1]=n(a,0),this[2]=n(u,0),this[3]=n(t,0),this[4]=n(i,0),this[5]=n(s,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(c,0)}function c(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function l(e){for(var t=0,n=0;n<3;++n){var r=e[s.getElementIndex(m[n],d[n])];t+=2*r*r}return Math.sqrt(t)}function f(e,t){for(var n=u.EPSILON15,r=0,a=1,i=0;i<3;++i){var o=Math.abs(e[s.getElementIndex(m[i],d[i])]);o>r&&(a=i,r=o)}var c=1,l=0,f=d[a],h=m[a];if(Math.abs(e[s.getElementIndex(h,f)])>n){var E,_=e[s.getElementIndex(h,h)],p=e[s.getElementIndex(f,f)],y=e[s.getElementIndex(h,f)],T=(_-p)/2/y;E=T<0?-1/(-T+Math.sqrt(1+T*T)):1/(T+Math.sqrt(1+T*T)),c=1/Math.sqrt(1+E*E),l=E*c}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(f,f)]=t[s.getElementIndex(h,h)]=c,t[s.getElementIndex(h,f)]=l,t[s.getElementIndex(f,h)]=-l,t}s.packedLength=9,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t},s.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a},s.clone=function(e,t){if(r(e))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):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t],a[1]=e[t+1],a[2]=e[t+2],a[3]=e[t+3],a[4]=e[t+4],a[5]=e[t+5],a[6]=e[t+6],a[7]=e[t+7],a[8]=e[t+8],a},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[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 s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var n=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,u=e.y*e.y,c=e.y*e.z,l=e.y*e.w,f=e.z*e.z,h=e.z*e.w,E=e.w*e.w,d=n-u-f+E,m=2*(a-h),_=2*(i+l),p=2*(a+h),y=-n+u-f+E,T=2*(c-o),R=2*(i-l),A=2*(c+o),S=-n-u+f+E;return r(t)?(t[0]=d,t[1]=p,t[2]=R,t[3]=m,t[4]=y,t[5]=A,t[6]=_,t[7]=T,t[8]=S,t):new s(d,m,_,p,y,T,R,A,S)},s.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),a=Math.cos(-e.heading),i=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),c=Math.sin(e.roll),l=n*a,f=-i*u+c*o*a,h=c*u+i*o*a,E=n*u,d=i*a+c*o*u,m=-o*i+i*o*u,_=-o,p=c*n,y=i*n;return r(t)?(t[0]=l,t[1]=E,t[2]=_,t[3]=f,t[4]=d,t[5]=p,t[6]=h,t[7]=m,t[8]=y,t):new s(l,f,h,E,d,m,_,p,y)},s.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 s(e.x,0,0,0,e.y,0,0,0,e.z)},s.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 s(e,0,0,0,e,0,0,0,e)},s.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 s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=a,t[6]=0,t[7]=-a,t[8]=n,t):new s(1,0,0,0,n,-a,0,a,n)},s.fromRotationY=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=n,t):new s(n,0,a,0,1,0,-a,0,n)},s.fromRotationZ=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=a,t[2]=0,t[3]=-a,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(n,-a,0,a,n,0,0,0,1)},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):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,n){var r=3*t,a=e[r],i=e[r+1],o=e[r+2];return n.x=a,n.y=i,n.z=o,n},s.setColumn=function(e,t,n,r){r=s.clone(e,r);var a=3*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},s.getRow=function(e,t,n){var r=e[t],a=e[t+3],i=e[t+6];return n.x=r,n.y=a,n.z=i,n},s.setRow=function(e,t,n,r){return r=s.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var h=new e;s.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],h)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],h)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],h)),n};var E=new e;s.getMaximumScale=function(t){return s.getScale(t,E),e.maximumComponent(E)},s.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=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 n[0]=r,n[1]=a,n[2]=i,n[3]=o,n[4]=u,n[5]=s,n[6]=c,n[7]=l,n[8]=f,n},s.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},s.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},s.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[3]*a+e[6]*i,u=e[1]*r+e[4]*a+e[7]*i,s=e[2]*r+e[5]*a+e[8]*i;return n.x=o,n.y=u,n.z=s,n},s.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},s.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},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},s.transpose=function(e,t){var n=e[0],r=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=n,t[1]=r,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var d=[1,0,0],m=[2,2,1],_=new s,p=new s;return s.computeEigenDecomposition=function(e,t){var n=u.EPSILON20,a=10,i=0,o=0;r(t)||(t={});for(var h=t.unitary=s.clone(s.IDENTITY,t.unitary),E=t.diagonal=s.clone(e,t.diagonal),d=n*c(E);o<a&&l(E)>d;)f(E,_),s.transpose(_,p),s.multiply(E,_,E),s.multiply(p,E,E),s.multiply(h,_,h),++i>2&&(++o,i=0);return 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},s.determinant=function(e){var t=e[0],n=e[3],r=e[6],a=e[1],i=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*o)+a*(s*r-n*c)+u*(n*o-i*r)},s.inverse=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[3],o=e[4],u=e[5],c=e[6],l=e[7],f=e[8],h=s.determinant(e);t[0]=o*f-l*u,t[1]=l*a-r*f,t[2]=r*u-o*a,t[3]=c*u-i*f,t[4]=n*f-c*a,t[5]=i*a-n*u,t[6]=i*l-c*o,t[7]=c*r-n*l,t[8]=n*o-i*r;var E=1/h;return s.multiplyByScalar(t,E,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]},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},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,a(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r,a){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(a,0)}o.fromElements=function(e,t,r,a,i){return n(i)?(i.x=e,i.y=t,i.z=r,i.w=a,i):new o(e,t,r,a)},o.fromColor=function(e,t){return n(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(n(e))return n(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)},o.packedLength=4,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r++],a.w=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=4*r:t=new Array(4*r);for(var a=0;a<r;++a)o.pack(e[a],t,4*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/4:t=new Array(r/4);for(var a=0;a<r;a+=4){var i=a/4;t[i]=o.unpack(e,a,t[i])}return t},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,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},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 u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,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,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},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 s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,c);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)&&i.equalsEpsilon(e.w,t.w,r,a)},o.ZERO=a(new o(0,0,0,0)),o.UNIT_X=a(new o(1,0,0,0)),o.UNIT_Y=a(new o(0,1,0,0)),o.UNIT_Z=a(new o(0,0,1,0)),o.UNIT_W=a(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,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,a,i,o,u,s,c,l){ +"use strict";function f(e,t,n,a,i,o,u,s,c,l,f,h,E,d,m,_){this[0]=r(e,0),this[1]=r(i,0),this[2]=r(c,0),this[3]=r(E,0),this[4]=r(t,0),this[5]=r(o,0),this[6]=r(l,0),this[7]=r(d,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(f,0),this[11]=r(m,0),this[12]=r(a,0),this[13]=r(s,0),this[14]=r(h,0),this[15]=r(_,0)}f.packedLength=16,f.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},f.unpack=function(e,t,n){return t=r(t,0),a(n)||(n=new f),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},f.clone=function(e,t){if(a(e))return a(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 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])},f.fromArray=f.unpack,f.fromColumnMajorArray=function(e,t){return f.clone(e,t)},f.fromRowMajorArray=function(e,t){return a(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 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(t,n,i){return n=r(n,e.ZERO),a(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=1,i):new f(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},f.fromTranslationQuaternionRotationScale=function(e,t,n,r){a(r)||(r=new f);var i=n.x,o=n.y,u=n.z,s=t.x*t.x,c=t.x*t.y,l=t.x*t.z,h=t.x*t.w,E=t.y*t.y,d=t.y*t.z,m=t.y*t.w,_=t.z*t.z,p=t.z*t.w,y=t.w*t.w,T=s-E-_+y,R=2*(c-p),A=2*(l+m),S=2*(c+p),v=-s+E-_+y,N=2*(d-h),O=2*(l-m),I=2*(d+h),g=-s-E+_+y;return r[0]=T*i,r[1]=S*i,r[2]=O*i,r[3]=0,r[4]=R*o,r[5]=v*o,r[6]=I*o,r[7]=0,r[8]=A*u,r[9]=N*u,r[10]=g*u,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},f.fromTranslationRotationScale=function(e,t){return f.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},f.fromTranslation=function(e,t){return f.fromRotationTranslation(c.IDENTITY,e,t)},f.fromScale=function(e,t){return a(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 f(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},f.fromUniformScale=function(e,t){return a(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 f(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var h=new e,E=new e,d=new e;f.fromCamera=function(t,n){var r=t.position,i=t.direction,o=t.up;e.normalize(i,h),e.normalize(e.cross(h,o,E),E),e.normalize(e.cross(E,h,d),d);var u=E.x,s=E.y,c=E.z,l=h.x,m=h.y,_=h.z,p=d.x,y=d.y,T=d.z,R=r.x,A=r.y,S=r.z,v=u*-R+s*-A+c*-S,N=p*-R+y*-A+T*-S,O=l*R+m*A+_*S;return a(n)?(n[0]=u,n[1]=p,n[2]=-l,n[3]=0,n[4]=s,n[5]=y,n[6]=-m,n[7]=0,n[8]=c,n[9]=T,n[10]=-_,n[11]=0,n[12]=v,n[13]=N,n[14]=O,n[15]=1,n):new f(u,s,c,v,p,y,T,N,-l,-m,-_,O,0,0,0,1)},f.computePerspectiveFieldOfView=function(e,t,n,r,a){var i=Math.tan(.5*e),o=1/i,u=o/t,s=(r+n)/(n-r),c=2*r*n/(n-r);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=c,a[15]=0,a},f.computeOrthographicOffCenter=function(e,t,n,r,a,i,o){var u=1/(t-e),s=1/(r-n),c=1/(i-a),l=-(t+e)*u,f=-(r+n)*s,h=-(i+a)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=f,o[14]=h,o[15]=1,o},f.computePerspectiveOffCenter=function(e,t,n,r,a,i,o){var u=2*a/(t-e),s=2*a/(r-n),c=(t+e)/(t-e),l=(r+n)/(r-n),f=-(i+a)/(i-a),h=-1,E=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=f,o[11]=h,o[12]=0,o[13]=0,o[14]=E,o[15]=0,o},f.computeInfinitePerspectiveOffCenter=function(e,t,n,r,a,i){var o=2*a/(t-e),u=2*a/(r-n),s=(t+e)/(t-e),c=(r+n)/(r-n),l=-1,f=-1,h=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=s,i[9]=c,i[10]=l,i[11]=f,i[12]=0,i[13]=0,i[14]=h,i[15]=0,i},f.computeViewportTransformation=function(e,t,n,a){e=r(e,r.EMPTY_OBJECT);var i=r(e.x,0),o=r(e.y,0),u=r(e.width,0),s=r(e.height,0);t=r(t,0),n=r(n,1);var c=.5*u,l=.5*s,f=.5*(n-t),h=c,E=l,d=f,m=i+c,_=o+l,p=t+f,y=1;return a[0]=h,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=E,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=d,a[11]=0,a[12]=m,a[13]=_,a[14]=p,a[15]=y,a},f.computeView=function(t,n,r,a,i){return i[0]=a.x,i[1]=r.x,i[2]=-n.x,i[3]=0,i[4]=a.y,i[5]=r.y,i[6]=-n.y,i[7]=0,i[8]=a.z,i[9]=r.z,i[10]=-n.z,i[11]=0,i[12]=-e.dot(a,t),i[13]=-e.dot(r,t),i[14]=e.dot(n,t),i[15]=1,i},f.toArray=function(e,t){return a(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]]},f.getElementIndex=function(e,t){return 4*e+t},f.getColumn=function(e,t,n){var r=4*t,a=e[r],i=e[r+1],o=e[r+2],u=e[r+3];return n.x=a,n.y=i,n.z=o,n.w=u,n},f.setColumn=function(e,t,n,r){r=f.clone(e,r);var a=4*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r[a+3]=n.w,r},f.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},f.getRow=function(e,t,n){var r=e[t],a=e[t+4],i=e[t+8],o=e[t+12];return n.x=r,n.y=a,n.z=i,n.w=o,n},f.setRow=function(e,t,n,r){return r=f.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var m=new e;f.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],m)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],m)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],m)),n};var _=new e;f.getMaximumScale=function(t){return f.getScale(t,_),e.maximumComponent(_)},f.multiply=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],f=e[8],h=e[9],E=e[10],d=e[11],m=e[12],_=e[13],p=e[14],y=e[15],T=t[0],R=t[1],A=t[2],S=t[3],v=t[4],N=t[5],O=t[6],I=t[7],g=t[8],M=t[9],x=t[10],w=t[11],C=t[12],P=t[13],U=t[14],D=t[15],L=r*T+u*R+f*A+m*S,F=a*T+s*R+h*A+_*S,z=i*T+c*R+E*A+p*S,B=o*T+l*R+d*A+y*S,b=r*v+u*N+f*O+m*I,G=a*v+s*N+h*O+_*I,q=i*v+c*N+E*O+p*I,W=o*v+l*N+d*O+y*I,X=r*g+u*M+f*x+m*w,H=a*g+s*M+h*x+_*w,V=i*g+c*M+E*x+p*w,Y=o*g+l*M+d*x+y*w,k=r*C+u*P+f*U+m*D,Z=a*C+s*P+h*U+_*D,j=i*C+c*P+E*U+p*D,K=o*C+l*P+d*U+y*D;return n[0]=L,n[1]=F,n[2]=z,n[3]=B,n[4]=b,n[5]=G,n[6]=q,n[7]=W,n[8]=X,n[9]=H,n[10]=V,n[11]=Y,n[12]=k,n[13]=Z,n[14]=j,n[15]=K,n},f.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},f.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},f.multiplyTransformation=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=e[12],E=e[13],d=e[14],m=t[0],_=t[1],p=t[2],y=t[4],T=t[5],R=t[6],A=t[8],S=t[9],v=t[10],N=t[12],O=t[13],I=t[14],g=r*m+o*_+c*p,M=a*m+u*_+l*p,x=i*m+s*_+f*p,w=r*y+o*T+c*R,C=a*y+u*T+l*R,P=i*y+s*T+f*R,U=r*A+o*S+c*v,D=a*A+u*S+l*v,L=i*A+s*S+f*v,F=r*N+o*O+c*I+h,z=a*N+u*O+l*I+E,B=i*N+s*O+f*I+d;return n[0]=g,n[1]=M,n[2]=x,n[3]=0,n[4]=w,n[5]=C,n[6]=P,n[7]=0,n[8]=U,n[9]=D,n[10]=L,n[11]=0,n[12]=F,n[13]=z,n[14]=B,n[15]=1,n},f.multiplyByMatrix3=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=t[0],E=t[1],d=t[2],m=t[3],_=t[4],p=t[5],y=t[6],T=t[7],R=t[8],A=r*h+o*E+c*d,S=a*h+u*E+l*d,v=i*h+s*E+f*d,N=r*m+o*_+c*p,O=a*m+u*_+l*p,I=i*m+s*_+f*p,g=r*y+o*T+c*R,M=a*y+u*T+l*R,x=i*y+s*T+f*R;return n[0]=A,n[1]=S,n[2]=v,n[3]=0,n[4]=N,n[5]=O,n[6]=I,n[7]=0,n[8]=g,n[9]=M,n[10]=x,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},f.multiplyByTranslation=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=r*e[0]+a*e[4]+i*e[8]+e[12],u=r*e[1]+a*e[5]+i*e[9]+e[13],s=r*e[2]+a*e[6]+i*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=s,n[15]=e[15],n};var p=new e;f.multiplyByUniformScale=function(e,t,n){return p.x=t,p.y=t,p.z=t,f.multiplyByScale(e,p,n)},f.multiplyByScale=function(e,t,n){var r=t.x,a=t.y,i=t.z;return 1===r&&1===a&&1===i?f.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=a*e[4],n[5]=a*e[5],n[6]=a*e[6],n[7]=0,n[8]=i*e[8],n[9]=i*e[9],n[10]=i*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},f.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=t.w,u=e[0]*r+e[4]*a+e[8]*i+e[12]*o,s=e[1]*r+e[5]*a+e[9]*i+e[13]*o,c=e[2]*r+e[6]*a+e[10]*i+e[14]*o,l=e[3]*r+e[7]*a+e[11]*i+e[15]*o;return n.x=u,n.y=s,n.z=c,n.w=l,n},f.multiplyByPointAsVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i,u=e[1]*r+e[5]*a+e[9]*i,s=e[2]*r+e[6]*a+e[10]*i;return n.x=o,n.y=u,n.z=s,n},f.multiplyByPoint=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i+e[12],u=e[1]*r+e[5]*a+e[9]*i+e[13],s=e[2]*r+e[6]*a+e[10]*i+e[14];return n.x=o,n.y=u,n.z=s,n},f.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},f.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},f.transpose=function(e,t){var n=e[1],r=e[2],a=e[3],i=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=o,t[14]=u,t[15]=e[15],t},f.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},f.equals=function(e,t){return e===t||a(e)&&a(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},f.equalsEpsilon=function(e,t,n){return e===t||a(e)&&a(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},f.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},f.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};var y=new c,T=new c,R=new t,A=new t(0,0,0,1);return f.inverse=function(e,n){if(c.equalsEpsilon(f.getRotation(e,y),T,s.EPSILON7)&&t.equals(f.getRow(e,3,R),A))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],a=e[4],i=e[8],o=e[12],u=e[1],h=e[5],E=e[9],d=e[13],m=e[2],_=e[6],p=e[10],S=e[14],v=e[3],N=e[7],O=e[11],I=e[15],g=p*I,M=S*O,x=_*I,w=S*N,C=_*O,P=p*N,U=m*I,D=S*v,L=m*O,F=p*v,z=m*N,B=_*v,b=g*h+w*E+C*d-(M*h+x*E+P*d),G=M*u+U*E+F*d-(g*u+D*E+L*d),q=x*u+D*h+z*d-(w*u+U*h+B*d),W=P*u+L*h+B*E-(C*u+F*h+z*E),X=M*a+x*i+P*o-(g*a+w*i+C*o),H=g*r+D*i+L*o-(M*r+U*i+F*o),V=w*r+U*a+B*o-(x*r+D*a+z*o),Y=C*r+F*a+z*i-(P*r+L*a+B*i);g=i*d,M=o*E,x=a*d,w=o*h,C=a*E,P=i*h,U=r*d,D=o*u,L=r*E,F=i*u,z=r*h,B=a*u;var k=g*N+w*O+C*I-(M*N+x*O+P*I),Z=M*v+U*O+F*I-(g*v+D*O+L*I),j=x*v+D*N+z*I-(w*v+U*N+B*I),K=P*v+L*N+B*O-(C*v+F*N+z*O),J=x*p+P*S+M*_-(C*S+g*_+w*p),Q=L*S+g*m+D*p-(U*p+F*S+M*m),$=U*_+B*S+w*m-(z*S+x*m+D*_),ee=z*p+C*m+F*_-(L*_+B*p+P*m),te=r*b+a*G+i*q+o*W;if(Math.abs(te)<s.EPSILON20)throw new l("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=b*te,n[1]=G*te,n[2]=q*te,n[3]=W*te,n[4]=X*te,n[5]=H*te,n[6]=V*te,n[7]=Y*te,n[8]=k*te,n[9]=Z*te,n[10]=j*te,n[11]=K*te,n[12]=J*te,n[13]=Q*te,n[14]=$*te,n[15]=ee*te,n},f.inverseTransformation=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],f=e[12],h=e[13],E=e[14],d=-n*f-r*h-a*E,m=-i*f-o*h-u*E,_=-s*f-c*h-l*E;return t[0]=n,t[1]=i,t[2]=s,t[3]=0,t[4]=r,t[5]=o,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=l,t[11]=0,t[12]=d,t[13]=m,t[14]=_,t[15]=1,t},f.IDENTITY=u(new f(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),f.ZERO=u(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,i(f.prototype,{length:{get:function(){return f.packedLength}}}),f.prototype.clone=function(e){return f.clone(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},f.prototype.equalsEpsilon=function(e,t){return f.equalsEpsilon(this,e,t)},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/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(e,t,r,a){this.west=n(e,0),this.south=n(t,0),this.east=n(r,0),this.north=n(a,0)}a(c.prototype,{width:{get:function(){return c.computeWidth(this)}},height:{get:function(){return c.computeHeight(this)}}}),c.packedLength=4,c.pack=function(e,t,r){return r=n(r,0),t[r++]=e.west,t[r++]=e.south,t[r++]=e.east,t[r]=e.north,t},c.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new c),a.west=e[t++],a.south=e[t++],a.east=e[t++],a.north=e[t],a},c.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=s.TWO_PI),t-n},c.computeHeight=function(e){return e.north-e.south},c.fromDegrees=function(e,t,a,i,o){return e=s.toRadians(n(e,0)),t=s.toRadians(n(t,0)),a=s.toRadians(n(a,0)),i=s.toRadians(n(i,0)),r(o)?(o.west=e,o.south=t,o.east=a,o.north=i,o):new c(e,t,a,i)},c.fromRadians=function(e,t,a,i,o){return r(o)?(o.west=n(e,0),o.south=n(t,0),o.east=n(a,0),o.north=n(i,0),o):new c(e,t,a,i)},c.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,u=Number.MAX_VALUE,l=-Number.MAX_VALUE,f=0,h=e.length;f<h;f++){var E=e[f];n=Math.min(n,E.longitude),a=Math.max(a,E.longitude),u=Math.min(u,E.latitude),l=Math.max(l,E.latitude);var d=E.longitude>=0?E.longitude:E.longitude+s.TWO_PI;i=Math.min(i,d),o=Math.max(o,d)}return a-n>o-i&&(n=i,a=o,a>s.PI&&(a-=s.TWO_PI),n>s.PI&&(n-=s.TWO_PI)),r(t)?(t.west=n,t.south=u,t.east=a,t.north=l,t):new c(n,u,a,l)},c.fromCartesianArray=function(e,t,n){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,u=-Number.MAX_VALUE,l=Number.MAX_VALUE,f=-Number.MAX_VALUE,h=0,E=e.length;h<E;h++){var d=t.cartesianToCartographic(e[h]);a=Math.min(a,d.longitude),i=Math.max(i,d.longitude),l=Math.min(l,d.latitude),f=Math.max(f,d.latitude);var m=d.longitude>=0?d.longitude:d.longitude+s.TWO_PI;o=Math.min(o,m),u=Math.max(u,m)}return i-a>u-o&&(a=o,i=u,i>s.PI&&(i-=s.TWO_PI),a>s.PI&&(a-=s.TWO_PI)),r(n)?(n.west=a,n.south=l,n.east=i,n.north=f,n):new c(a,l,i,f)},c.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new c(e.west,e.south,e.east,e.north)},c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.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},c.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},c.validate=function(e){},c.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)},c.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)},c.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)},c.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)},c.center=function(t,n){var a=t.east,i=t.west;a<i&&(a+=s.TWO_PI);var o=s.negativePiToPi(.5*(i+a)),u=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=u,n.height=0,n):new e(o,u)},c.intersection=function(e,t,n){var a=e.east,i=e.west,o=t.east,u=t.west;a<i&&o>0?a+=s.TWO_PI:o<u&&a>0&&(o+=s.TWO_PI),a<i&&u<0?u+=s.TWO_PI:o<u&&i<0&&(i+=s.TWO_PI);var l=s.negativePiToPi(Math.max(i,u)),f=s.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&f<=l)){var h=Math.max(e.south,t.south),E=Math.min(e.north,t.north);if(!(h>=E))return r(n)?(n.west=l,n.south=h,n.east=f,n.north=E,n):new c(l,h,f,E)}},c.simpleIntersection=function(e,t,n){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(i>=u||a>=o))return r(n)?(n.west=a,n.south=i,n.east=o,n.north=u,n):new c(a,i,o,u)},c.union=function(e,t,n){r(n)||(n=new c);var a=e.east,i=e.west,o=t.east,u=t.west;a<i&&o>0?a+=s.TWO_PI:o<u&&a>0&&(o+=s.TWO_PI),a<i&&u<0?u+=s.TWO_PI:o<u&&i<0&&(i+=s.TWO_PI);var l=s.convertLongitudeRange(Math.min(i,u)),f=s.convertLongitudeRange(Math.max(a,o));return n.west=l,n.south=Math.min(e.south,t.south),n.east=f,n.north=Math.max(e.north,t.north),n},c.expand=function(e,t,n){return r(n)||(n=new c),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},c.contains=function(e,t){var n=t.longitude,r=t.latitude,a=e.west,i=e.east;return i<a&&(i+=s.TWO_PI,n<0&&(n+=s.TWO_PI)),(n>a||s.equalsEpsilon(n,a,s.EPSILON14))&&(n<i||s.equalsEpsilon(n,i,s.EPSILON14))&&r>=e.south&&r<=e.north};var l=new e;return c.subsample=function(e,t,a,i){t=n(t,o.WGS84),a=n(a,0),r(i)||(i=[]);var u=0,f=e.north,h=e.south,E=e.east,d=e.west,m=l;m.height=a,m.longitude=d,m.latitude=f,i[u]=t.cartographicToCartesian(m,i[u]),u++,m.longitude=E,i[u]=t.cartographicToCartesian(m,i[u]),u++,m.latitude=h,i[u]=t.cartographicToCartesian(m,i[u]),u++,m.longitude=d,i[u]=t.cartographicToCartesian(m,i[u]),u++,f<0?m.latitude=f:h>0?m.latitude=h:m.latitude=0;for(var _=1;_<8;++_)m.longitude=-Math.PI+_*s.PI_OVER_TWO,c.contains(e,m)&&(i[u]=t.cartographicToCartesian(m,i[u]),u++);return 0===m.latitude&&(m.longitude=d,i[u]=t.cartographicToCartesian(m,i[u]),u++,m.longitude=E,i[u]=t.cartographicToCartesian(m,i[u]),u++),i.length=u,i},c.MAX_VALUE=u(new c(-Math.PI,-s.PI_OVER_TWO,Math.PI,s.PI_OVER_TWO)),c}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var E=new e,d=new e,m=new e,_=new e,p=new e,y=new e,T=new e,R=new e,A=new e,S=new e,v=new e,N=new e;h.fromPoints=function(t,n){if(a(n)||(n=new h),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var r=e.clone(t[0],T),i=e.clone(r,E),o=e.clone(r,d),u=e.clone(r,m),s=e.clone(r,_),c=e.clone(r,p),l=e.clone(r,y),f=t.length,O=1;O<f;O++){e.clone(t[O],r);var I=r.x,g=r.y,M=r.z;I<i.x&&e.clone(r,i),I>s.x&&e.clone(r,s),g<o.y&&e.clone(r,o),g>c.y&&e.clone(r,c),M<u.z&&e.clone(r,u),M>l.z&&e.clone(r,l)}var x=e.magnitudeSquared(e.subtract(s,i,R)),w=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=i,U=s,D=x;w>D&&(D=w,P=o,U=c),C>D&&(D=C,P=u,U=l);var L=A;L.x=.5*(P.x+U.x),L.y=.5*(P.y+U.y),L.z=.5*(P.z+U.z);var F=e.magnitudeSquared(e.subtract(U,L,R)),z=Math.sqrt(F),B=S;B.x=i.x,B.y=o.y,B.z=u.z;var b=v;b.x=s.x,b.y=c.y,b.z=l.z;var G=e.multiplyByScalar(e.add(B,b,R),.5,N),q=0;for(O=0;O<f;O++){e.clone(t[O],r);var W=e.magnitude(e.subtract(r,G,R));W>q&&(q=W);var X=e.magnitudeSquared(e.subtract(r,L,R));if(X>F){var H=Math.sqrt(X);z=.5*(z+H),F=z*z;var V=H-z;L.x=(z*L.x+V*r.x)/H,L.y=(z*L.y+V*r.y)/H,L.z=(z*L.z+V*r.z)/H}}return z<q?(e.clone(L,n.center),n.radius=z):(e.clone(G,n.center),n.radius=q),n};var O=new o,I=new e,g=new e,M=new t,x=new t;h.fromRectangle2D=function(e,t,n){return h.fromRectangleWithHeights2D(e,t,0,0,n)},h.fromRectangleWithHeights2D=function(t,n,i,o,u){if(a(u)||(u=new h),!a(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;n=r(n,O),f.southwest(t,M),M.height=i,f.northeast(t,x),x.height=o;var s=n.project(M,I),c=n.project(x,g),l=c.x-s.x,E=c.y-s.y,d=c.z-s.z;u.radius=.5*Math.sqrt(l*l+E*E+d*d);var m=u.center;return m.x=s.x+.5*l,m.y=s.y+.5*E,m.z=s.z+.5*d,u};var w=[];h.fromRectangle3D=function(e,t,n,o){t=r(t,i.WGS84),n=r(n,0);var u;return a(e)&&(u=f.subsample(e,t,n,w)),h.fromPoints(u,o)},h.fromVertices=function(t,n,i,o){if(a(o)||(o=new h),!a(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;n=r(n,e.ZERO),i=r(i,3);var u=T;u.x=t[0]+n.x,u.y=t[1]+n.y,u.z=t[2]+n.z;for(var s=e.clone(u,E),c=e.clone(u,d),l=e.clone(u,m),f=e.clone(u,_),O=e.clone(u,p),I=e.clone(u,y),g=t.length,M=0;M<g;M+=i){var x=t[M]+n.x,w=t[M+1]+n.y,C=t[M+2]+n.z;u.x=x,u.y=w,u.z=C,x<s.x&&e.clone(u,s),x>f.x&&e.clone(u,f),w<c.y&&e.clone(u,c),w>O.y&&e.clone(u,O),C<l.z&&e.clone(u,l),C>I.z&&e.clone(u,I)}var P=e.magnitudeSquared(e.subtract(f,s,R)),U=e.magnitudeSquared(e.subtract(O,c,R)),D=e.magnitudeSquared(e.subtract(I,l,R)),L=s,F=f,z=P;U>z&&(z=U,L=c,F=O),D>z&&(z=D,L=l,F=I);var B=A;B.x=.5*(L.x+F.x),B.y=.5*(L.y+F.y),B.z=.5*(L.z+F.z);var b=e.magnitudeSquared(e.subtract(F,B,R)),G=Math.sqrt(b),q=S;q.x=s.x,q.y=c.y,q.z=l.z;var W=v;W.x=f.x,W.y=O.y,W.z=I.z;var X=e.multiplyByScalar(e.add(q,W,R),.5,N),H=0;for(M=0;M<g;M+=i){u.x=t[M]+n.x,u.y=t[M+1]+n.y,u.z=t[M+2]+n.z;var V=e.magnitude(e.subtract(u,X,R));V>H&&(H=V);var Y=e.magnitudeSquared(e.subtract(u,B,R));if(Y>b){var k=Math.sqrt(Y);G=.5*(G+k),b=G*G;var Z=k-G;B.x=(G*B.x+Z*u.x)/k,B.y=(G*B.y+Z*u.y)/k,B.z=(G*B.z+Z*u.z)/k}}return G<H?(e.clone(B,o.center),o.radius=G):(e.clone(X,o.center),o.radius=H),o},h.fromEncodedCartesianVertices=function(t,n,r){if(a(r)||(r=new h),!a(t)||!a(n)||t.length!==n.length||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var i=T;i.x=t[0]+n[0],i.y=t[1]+n[1],i.z=t[2]+n[2];for(var o=e.clone(i,E),u=e.clone(i,d),s=e.clone(i,m),c=e.clone(i,_),l=e.clone(i,p),f=e.clone(i,y),O=t.length,I=0;I<O;I+=3){var g=t[I]+n[I],M=t[I+1]+n[I+1],x=t[I+2]+n[I+2];i.x=g,i.y=M,i.z=x,g<o.x&&e.clone(i,o),g>c.x&&e.clone(i,c),M<u.y&&e.clone(i,u),M>l.y&&e.clone(i,l),x<s.z&&e.clone(i,s),x>f.z&&e.clone(i,f)}var w=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=e.magnitudeSquared(e.subtract(f,s,R)),U=o,D=c,L=w;C>L&&(L=C,U=u,D=l),P>L&&(L=P,U=s,D=f);var F=A;F.x=.5*(U.x+D.x),F.y=.5*(U.y+D.y),F.z=.5*(U.z+D.z);var z=e.magnitudeSquared(e.subtract(D,F,R)),B=Math.sqrt(z),b=S;b.x=o.x,b.y=u.y,b.z=s.z;var G=v;G.x=c.x,G.y=l.y,G.z=f.z;var q=e.multiplyByScalar(e.add(b,G,R),.5,N),W=0;for(I=0;I<O;I+=3){i.x=t[I]+n[I],i.y=t[I+1]+n[I+1],i.z=t[I+2]+n[I+2];var X=e.magnitude(e.subtract(i,q,R));X>W&&(W=X);var H=e.magnitudeSquared(e.subtract(i,F,R));if(H>z){var V=Math.sqrt(H);B=.5*(B+V),z=B*B;var Y=V-B;F.x=(B*F.x+Y*i.x)/V,F.y=(B*F.y+Y*i.y)/V,F.z=(B*F.z+Y*i.z)/V}}return B<W?(e.clone(F,r.center),r.radius=B):(e.clone(q,r.center),r.radius=W),r},h.fromCornerPoints=function(t,n,r){a(r)||(r=new h);var i=r.center;return e.add(t,n,i),e.multiplyByScalar(i,.5,i),r.radius=e.distance(i,n),r},h.fromEllipsoid=function(t,n){return a(n)||(n=new h),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var C=new e;h.fromBoundingSpheres=function(t,n){if(a(n)||(n=new h),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var r=t.length;if(1===r)return h.clone(t[0],n);if(2===r)return h.union(t[0],t[1],n);for(var i=[],o=0;o<r;o++)i.push(t[o].center);n=h.fromPoints(i,n);var u=n.center,s=n.radius;for(o=0;o<r;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,C)+c.radius)}return n.radius=s,n};var P=new e,U=new e,D=new e;h.fromOrientedBoundingBox=function(t,n){a(n)||(n=new h);var r=t.halfAxes,i=c.getColumn(r,0,P),o=c.getColumn(r,1,U),u=c.getColumn(r,2,D),s=e.magnitude(i),l=e.magnitude(o),f=e.magnitude(u);return n.center=e.clone(t.center,n.center),n.radius=Math.max(s,l,f),n},h.clone=function(t,n){if(a(t))return a(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new h(t.center,t.radius)},h.packedLength=4,h.pack=function(e,t,n){n=r(n,0);var a=e.center;return t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n]=e.radius,t},h.unpack=function(e,t,n){t=r(t,0),a(n)||(n=new h);var i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};var L=new e,F=new e;h.union=function(t,n,r){a(r)||(r=new h);var i=t.center,o=t.radius,u=n.center,s=n.radius,c=e.subtract(u,i,L),l=e.magnitude(c);if(o>=l+s)return t.clone(r),r;if(s>=l+o)return n.clone(r),r;var f=.5*(o+l+s),E=e.multiplyByScalar(c,(-o+f)/l,F);return e.add(E,i,E),e.clone(E,r.center),r.radius=f,r};var z=new e;h.expand=function(t,n,r){r=h.clone(t,r);var a=e.magnitude(e.subtract(n,r.center,z));return a>r.radius&&(r.radius=a),r},h.intersectPlane=function(t,n){var r=t.center,a=t.radius,i=n.normal,o=e.dot(i,r)+n.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},h.transform=function(e,t,n){return a(n)||(n=new h),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=l.getMaximumScale(t)*e.radius,n};var B=new e;h.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,B);return e.magnitudeSquared(r)-t.radius*t.radius},h.transformWithoutScale=function(e,t,n){return a(n)||(n=new h),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var b=new e;h.computePlaneDistances=function(t,n,r,i){a(i)||(i=new s);var o=e.subtract(t.center,n,b),u=e.dot(r,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var G=new e,q=new e,W=new e,X=new e,H=new e,V=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var Z=new o;return h.projectTo2D=function(t,n,a){n=r(n,Z);var i=n.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,G),c=e.cross(e.UNIT_Z,s,q);e.normalize(c,c);var l=e.cross(s,c,W);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var f=e.negate(l,H),E=e.negate(c,X),d=Y,m=d[0];e.add(s,l,m),e.add(m,c,m),m=d[1],e.add(s,l,m),e.add(m,E,m),m=d[2],e.add(s,f,m),e.add(m,E,m),m=d[3],e.add(s,f,m),e.add(m,c,m),e.negate(s,s),m=d[4],e.add(s,l,m),e.add(m,c,m),m=d[5],e.add(s,l,m),e.add(m,E,m),m=d[6],e.add(s,f,m),e.add(m,E,m),m=d[7],e.add(s,f,m),e.add(m,c,m);for(var _=d.length,p=0;p<_;++p){var y=d[p];e.add(o,y,y);var T=i.cartesianToCartographic(y,V);n.project(T,y)}a=h.fromPoints(d,a),o=a.center;var R=o.x,A=o.y,S=o.z;return o.x=S,o.y=R,o.z=A,a},h.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},h.equals=function(t,n){return t===n||a(t)&&a(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},h.prototype.intersectPlane=function(e){return h.intersectPlane(this,e)},h.prototype.distanceSquaredTo=function(e){return h.distanceSquaredTo(this,e)},h.prototype.computePlaneDistances=function(e,t,n){return h.computePlaneDistances(this,e,t,n)},h.prototype.isOccluded=function(e){return h.isOccluded(this,e)},h.prototype.equals=function(e){return h.equals(this,e)},h.prototype.clone=function(e){return h.clone(this,e)},h}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return t(a,{element:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(r.requestFullscreen=a,n=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(r.requestFullscreen=a,n=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?r.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(r.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?r.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(r.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?r.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(r.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),r.fullscreenerror=a)}return n},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[r.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function a(){if(!t(A)&&(A=!1,!h())){var e=/ Chrome\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(A=!0,S=r(e[1]))}return A}function i(){return a()&&S}function o(){if(!t(v)&&(v=!1,!a()&&!h()&&/ Safari\/[\.0-9]+/.test(R.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(v=!0,N=r(e[1]))}return v}function u(){return o()&&N}function s(){if(!t(O)){O=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(R.userAgent);null!==e&&(O=!0,I=r(e[1]),I.isNightly=!!e[2])}return O}function c(){return s()&&I}function l(){if(!t(g)){g=!1;var e;"Microsoft Internet Explorer"===R.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(g=!0,M=r(e[1]))):"Netscape"===R.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(g=!0,M=r(e[1])))}return g}function f(){return l()&&M}function h(){if(!t(x)){x=!1;var e=/ Edge\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(x=!0,w=r(e[1]))}return x}function E(){return h()&&w}function d(){if(!t(C)){C=!1;var e=/Firefox\/([\.0-9]+)/.exec(R.userAgent); +null!==e&&(C=!0,P=r(e[1]))}return C}function m(){return t(U)||(U=/Windows/i.test(R.appVersion)),U}function _(){return d()&&P}function p(){return t(D)||(D="undefined"!=typeof PointerEvent&&(!t(R.pointerEnabled)||R.pointerEnabled)),D}function y(){if(!t(F)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;F=t(n)&&""!==n,F&&(L=n)}return F}function T(){return y()?L:void 0}var R;R="undefined"!=typeof navigator?navigator:{};var A,S,v,N,O,I,g,M,x,w,C,P,U,D,L,F,z={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isEdge:h,edgeVersion:E,isFirefox:d,firefoxVersion:_,isWindows:m,hardwareConcurrency:e(R.hardwareConcurrency,3),supportsPointerEvents:p,supportsImageRenderingPixelated:y,imageRenderingValue:T};return z.supportsFullscreen=function(){return n.supportsFullscreen()},z.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},z.supportsWebWorkers=function(){return"undefined"!=typeof Worker},z}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,a,i){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){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.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},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 Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,a){switch(r=e(r,0),a=e(a,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,a);case o.SHORT:return new Int16Array(n,r,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,a);case o.INT:return new Int32Array(n,r,a);case o.UNSIGNED_INT:return new Uint32Array(n,r,a);case o.FLOAT:return new Float32Array(n,r,a);case o.DOUBLE:return new Float64Array(n,r,a)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===n.POINTS||e===n.LINES||e===n.LINE_LOOP||e===n.LINE_STRIP||e===n.TRIANGLES||e===n.TRIANGLE_STRIP||e===n.TRIANGLE_FAN}};return e(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,a){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,a.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return i.computeNumberOfVertices=function(e){var n=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var a=e.attributes[r],i=a.values.length/a.componentsPerAttribute;n=i}return n},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(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 r}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,n,r,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(e){switch(e){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(t){return e(t)&&(t===i.UNSIGNED_BYTE||t===i.UNSIGNED_SHORT||t===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,n,a){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,a):new Uint16Array(t,n,a)},n(i)}),define("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.position=e(t.position,!1),this.normal=e(t.normal,!1),this.st=e(t.st,!1),this.bitangent=e(t.bitangent,!1),this.tangent=e(t.tangent,!1),this.color=e(t.color,!1)}return a.POSITION_ONLY=r(new a({position:!0})),a.POSITION_AND_NORMAL=r(new a({position:!0,normal:!0})),a.POSITION_NORMAL_AND_ST=r(new a({position:!0,normal:!0,st:!0})),a.POSITION_AND_ST=r(new a({position:!0,st:!0})),a.POSITION_AND_COLOR=r(new a({position:!0,color:!0})),a.ALL=r(new a({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0})),a.DEFAULT=a.POSITION_NORMAL_AND_ST,a.packedLength=6,a.pack=function(t,n,r){return r=e(r,0),n[r++]=t.position?1:0,n[r++]=t.normal?1:0,n[r++]=t.st?1:0,n[r++]=t.tangent?1:0,n[r++]=t.bitangent?1:0,n[r++]=t.color?1:0,n},a.unpack=function(n,r,i){return r=e(r,0),t(i)||(i=new a),i.position=1===n[r++],i.normal=1===n[r++],i.st=1===n[r++],i.tangent=1===n[r++],i.bitangent=1===n[r++],i.color=1===n[r++],i},a.clone=function(e,n){if(t(e))return t(n)||(n=new a),n.position=e.position,n.normal=e.normal,n.st=e.st,n.tangent=e.tangent,n.bitangent=e.bitangent,n.color=e.color,n},a}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Intersect"],function(e,t,n,r,a){"use strict";function i(r,a,i){this.minimum=e.clone(t(r,e.ZERO)),this.maximum=e.clone(t(a,e.ZERO)),n(i)?i=e.clone(i):(i=e.add(this.minimum,this.maximum,new e),e.multiplyByScalar(i,.5,i)),this.center=i}i.fromPoints=function(t,r){if(n(r)||(r=new i),!n(t)||0===t.length)return r.minimum=e.clone(e.ZERO,r.minimum),r.maximum=e.clone(e.ZERO,r.maximum),r.center=e.clone(e.ZERO,r.center),r;for(var a=t[0].x,o=t[0].y,u=t[0].z,s=t[0].x,c=t[0].y,l=t[0].z,f=t.length,h=1;h<f;h++){var E=t[h],d=E.x,m=E.y,_=E.z;a=Math.min(d,a),s=Math.max(d,s),o=Math.min(m,o),c=Math.max(m,c),u=Math.min(_,u),l=Math.max(_,l)}var p=r.minimum;p.x=a,p.y=o,p.z=u;var y=r.maximum;y.x=s,y.y=c,y.z=l;var T=e.add(p,y,r.center);return e.multiplyByScalar(T,.5,T),r},i.clone=function(t,r){if(n(t))return n(r)?(r.minimum=e.clone(t.minimum,r.minimum),r.maximum=e.clone(t.maximum,r.maximum),r.center=e.clone(t.center,r.center),r):new i(t.minimum,t.maximum)},i.equals=function(t,r){return t===r||n(t)&&n(r)&&e.equals(t.center,r.center)&&e.equals(t.minimum,r.minimum)&&e.equals(t.maximum,r.maximum)};var o=new e;return i.intersectPlane=function(t,n){o=e.subtract(t.maximum,t.minimum,o);var r=e.multiplyByScalar(o,.5,o),i=n.normal,u=r.x*Math.abs(i.x)+r.y*Math.abs(i.y)+r.z*Math.abs(i.z),s=e.dot(t.center,i)+n.distance;return s-u>0?a.INSIDE:s+u<0?a.OUTSIDE:a.INTERSECTING},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.intersectPlane=function(e){return i.intersectPlane(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n){this.x=t(e,0),this.y=t(n,0)}o.fromElements=function(e,t,r){return n(r)?(r.x=e,r.y=t,r):new o(e,t)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t):new o(e.x,e.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r]=e.y,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=2*r:t=new Array(2*r);for(var a=0;a<r;++a)o.pack(e[a],t,2*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/2:t=new Array(r/2);for(var a=0;a<r;a+=2){var i=a/2;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y)},o.minimumComponent=function(e){return Math.min(e.x,e.y)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){return o.normalize(e,c),o.normalize(t,l),i.acosClamped(o.dot(c,l))};var f=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)},o.ZERO=a(new o(0,0)),o.UNIT_X=a(new o(1,0)),o.UNIT_Y=a(new o(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,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function n(e,n,r){var a=e+n;return t.sign(e)!==t.sign(n)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(n)))<r?0:a}var r={};return r.computeDiscriminant=function(e,t,n){var r=t*t-4*e*n;return r},r.computeRealRoots=function(e,r,a){var i;if(0===e)return 0===r?[]:[-a/r];if(0===r){if(0===a)return[0,0];var o=Math.abs(a),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,i<0)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-r/e,i<0?[i,0]:[0,i];var c=r*r,l=4*e*a,f=n(c,-l,t.EPSILON14);if(f<0)return[];var h=-.5*n(r,t.sign(r)*Math.sqrt(f),t.EPSILON14);return r>0?[h/e,a/h]:[a/h,h/e]},r}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function n(e,t,n,r){var a,i,o=e,u=t/3,s=n/3,c=r,l=o*s,f=u*c,h=u*u,E=s*s,d=o*s-h,m=o*c-u*s,_=u*c-E,p=4*d*_-m*m;if(p<0){var y,T,R;h*f>=l*E?(y=o,T=d,R=-2*u*d+o*m):(y=c,T=_,R=-c*m+2*s*_);var A=R<0?-1:1,S=-A*Math.abs(y)*Math.sqrt(-p);i=-R+S;var v=i/2,N=v<0?-Math.pow(-v,1/3):Math.pow(v,1/3),O=i===S?-N:-T/N;return a=T<=0?N+O:-R/(N*N+O*O+T),h*f>=l*E?[(a-u)/o]:[-c/(a+s)]}var I=d,g=-2*u*d+o*m,M=_,x=-c*m+2*s*_,w=Math.sqrt(p),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*w,-g)/3);a=2*Math.sqrt(-I);var U=Math.cos(P);i=a*U;var D=a*(-U/2-C*Math.sin(P)),L=i+D>2*u?i-u:D-u,F=o,z=L/F;P=Math.abs(Math.atan2(c*w,-x)/3),a=2*Math.sqrt(-M),U=Math.cos(P),i=a*U,D=a*(-U/2-C*Math.sin(P));var B=-c,b=i+D<2*s?i+s:D+s,G=B/b,q=F*b,W=-L*b-F*B,X=L*B,H=(s*W-u*X)/(-u*W+s*q);return z<=H?z<=G?H<=G?[z,H,G]:[z,G,H]:[G,z,H]:z<=G?[H,z,G]:H<=G?[H,G,z]:[G,H,z]}var r={};return r.computeDiscriminant=function(e,t,n,r){var a=e*e,i=t*t,o=n*n,u=r*r,s=18*e*t*n*r+i*o-27*a*u-4*(e*o*n+i*t*r);return s},r.computeRealRoots=function(e,r,a,i){var o,u;if(0===e)return t.computeRealRoots(r,a,i);if(0===r){if(0===a){if(0===i)return[0,0,0];u=-i/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===i?(o=t.computeRealRoots(e,0,a),0===o.Length?[0]:[o[0],0,o[1]]):n(e,0,a,i)}return 0===a?0===i?(u=-r/e,u<0?[u,0,0]:[0,0,u]):n(e,r,0,i):0===i?(o=t.computeRealRoots(e,r,a),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):n(e,r,a,i)},r}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,n,r){"use strict";function a(t,a,i,o){var u=t*t,s=a-3*u/8,c=i-a*t/2+u*t/8,l=o-i*t/4+a*u/16-3*u*u/256,f=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(f.length>0){var h=-t/4,E=f[f.length-1];if(Math.abs(E)<n.EPSILON14){var d=r.computeRealRoots(1,s,l);if(2===d.length){var m,_=d[0],p=d[1];if(_>=0&&p>=0){var y=Math.sqrt(_),T=Math.sqrt(p);return[h-T,h-y,h+y,h+T]}if(_>=0&&p<0)return m=Math.sqrt(_),[h-m,h+m];if(_<0&&p>=0)return m=Math.sqrt(p),[h-m,h+m]}return[]}if(E>0){var R=Math.sqrt(E),A=(s+E-c/R)/2,S=(s+E+c/R)/2,v=r.computeRealRoots(1,R,A),N=r.computeRealRoots(1,-R,S);return 0!==v.length?(v[0]+=h,v[1]+=h,0!==N.length?(N[0]+=h,N[1]+=h,v[1]<=N[0]?[v[0],v[1],N[0],N[1]]:N[1]<=v[0]?[N[0],N[1],v[0],v[1]]:v[0]>=N[0]&&v[1]<=N[1]?[N[0],v[0],v[1],N[1]]:N[0]>=v[0]&&N[1]<=v[1]?[v[0],N[0],N[1],v[1]]:v[0]>N[0]&&v[0]<N[1]?[N[0],v[0],N[1],v[1]]:[v[0],N[0],v[1],N[1]]):v):0!==N.length?(N[0]+=h,N[1]+=h,N):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,f=i*t+s-4*o,h=c*o-i*a*t+u,E=e.computeRealRoots(1,l,f,h);if(E.length>0){var d,m,_=E[0],p=a-_,y=p*p,T=t/2,R=p/2,A=y-4*o,S=y+4*Math.abs(o),v=c-4*_,N=c+4*Math.abs(_);if(_<0||A*N<v*S){var O=Math.sqrt(v);d=O/2,m=0===O?0:(t*R-i)/O}else{var I=Math.sqrt(A);d=0===I?0:(t*R-i)/I,m=I/2}var g,M;0===T&&0===d?(g=0,M=0):n.sign(T)===n.sign(d)?(g=T+d,M=_/g):(M=T-d,g=_/M);var x,w;0===R&&0===m?(x=0,w=0):n.sign(R)===n.sign(m)?(x=R+m,w=o/x):(w=R-m,x=o/w);var C=r.computeRealRoots(1,g,x),P=r.computeRealRoots(1,M,w);if(0!==C.length)return 0!==P.length?C[1]<=P[0]?[C[0],C[1],P[0],P[1]]:P[1]<=C[0]?[P[0],P[1],C[0],C[1]]:C[0]>=P[0]&&C[1]<=P[1]?[P[0],C[0],C[1],P[1]]:P[0]>=C[0]&&P[1]<=C[1]?[C[0],P[0],P[1],C[1]]:C[0]>P[0]&&C[0]<P[1]?[P[0],C[0],P[1],C[1]]:[C[0],P[0],C[1],P[1]]:C;if(0!==P.length)return P}return[]}var o={};return o.computeDiscriminant=function(e,t,n,r,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=n*n,l=c*n,f=r*r,h=f*r,E=a*a,d=E*a,m=u*c*f-4*s*h-4*e*l*f+18*e*t*n*h-27*i*f*f+256*o*d+a*(18*s*n*r-4*u*l+16*e*c*c-80*e*t*c*r-6*e*u*f+144*i*n*f)+E*(144*e*u*n-27*u*u-128*i*c-192*i*t*r);return m},o.computeRealRoots=function(t,r,o,u,s){if(Math.abs(t)<n.EPSILON15)return e.computeRealRoots(r,o,u,s);var c=r/t,l=o/t,f=u/t,h=s/t,E=c<0?1:0;switch(E+=l<0?E+1:E,E+=f<0?E+1:E,E+=h<0?E+1:E){case 0:return a(c,l,f,h);case 1:return i(c,l,f,h);case 2:return i(c,l,f,h);case 3:return a(c,l,f,h);case 4:return a(c,l,f,h);case 5:return i(c,l,f,h);case 6:return a(c,l,f,h);case 7:return a(c,l,f,h);case 8:return i(c,l,f,h);case 9:return a(c,l,f,h);case 10:return a(c,l,f,h);case 11:return i(c,l,f,h);case 12:return a(c,l,f,h);case 13:return a(c,l,f,h);case 14:return a(c,l,f,h);case 15:return a(c,l,f,h);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=e.clone(t(r,e.ZERO)),e.equals(r,e.ZERO)||e.normalize(r,r),this.origin=e.clone(t(n,e.ZERO)),this.direction=r}return a.getPoint=function(t,r,a){return n(a)||(a=new e),a=e.multiplyByScalar(t.direction,r,a),e.add(t.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,n,r,a,i,o,u,s,c,l){"use strict";function f(e,t,n,r){var a=t*t-4*e*n;if(!(a<0)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return u<s?(r.root0=u,r.root1=s):(r.root0=s,r.root1=u),r}var c=-t/(2*e);if(0!==c)return r.root0=r.root1=c,r}}function h(t,n,a){r(a)||(a=new i);var o=t.origin,u=t.direction,s=n.center,c=n.radius*n.radius,l=e.subtract(o,s,y),h=e.dot(u,u),E=2*e.dot(u,l),d=e.magnitudeSquared(l)-c,m=f(h,E,d,S);if(r(m))return a.start=m.root0,a.stop=m.root1,a}function E(e,t,n){var r=e+t;return o.sign(e)!==o.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))<n?0:r}function d(t,n,r,a,i){var l,f=a*a,h=i*i,d=(t[u.COLUMN1ROW1]-t[u.COLUMN2ROW2])*h,m=i*(a*E(t[u.COLUMN1ROW0],t[u.COLUMN0ROW1],o.EPSILON15)+n.y),_=t[u.COLUMN0ROW0]*f+t[u.COLUMN2ROW2]*h+a*n.x+r,p=h*E(t[u.COLUMN2ROW1],t[u.COLUMN1ROW2],o.EPSILON15),y=i*(a*E(t[u.COLUMN2ROW0],t[u.COLUMN0ROW2])+n.z),T=[];if(0===y&&0===p){if(l=s.computeRealRoots(d,m,_),0===l.length)return T;var R=l[0],A=Math.sqrt(Math.max(1-R*R,0));if(T.push(new e(a,i*R,i*-A)),T.push(new e(a,i*R,i*A)),2===l.length){var S=l[1],v=Math.sqrt(Math.max(1-S*S,0));T.push(new e(a,i*S,i*-v)),T.push(new e(a,i*S,i*v))}return T}var N=y*y,O=p*p,I=d*d,g=y*p,M=I+O,x=2*(m*d+g),w=2*_*d+m*m-O+N,C=2*(_*m-g),P=_*_-N;if(0===M&&0===x&&0===w&&0===C)return T;l=c.computeRealRoots(M,x,w,C,P);var U=l.length;if(0===U)return T; +for(var D=0;D<U;++D){var L,F=l[D],z=F*F,B=Math.max(1-z,0),b=Math.sqrt(B);L=o.sign(d)===o.sign(_)?E(d*z+_,m*F,o.EPSILON12):o.sign(_)===o.sign(m*F)?E(d*z,m*F+_,o.EPSILON12):E(d*z+m*F,_,o.EPSILON12);var G=E(p*F,y,o.EPSILON15),q=L*G;q<0?T.push(new e(a,i*F,i*b)):q>0?T.push(new e(a,i*F,i*-b)):0!==b?(T.push(new e(a,i*F,i*-b)),T.push(new e(a,i*F,i*b)),++D):T.push(new e(a,i*F,i*b))}return T}var m={};m.rayPlane=function(t,n,a){r(a)||(a=new e);var i=t.origin,u=t.direction,s=n.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON15)){var l=(-n.distance-e.dot(s,i))/c;if(!(l<0))return a=e.multiplyByScalar(u,l,a),e.add(i,a,a)}};var _=new e,p=new e,y=new e,T=new e,R=new e;m.rayTriangleParametric=function(t,r,a,i,u){u=n(u,!1);var s,c,l,f,h,E=t.origin,d=t.direction,m=e.subtract(a,r,_),A=e.subtract(i,r,p),S=e.cross(d,A,y),v=e.dot(m,S);if(u){if(v<o.EPSILON6)return;if(s=e.subtract(E,r,T),l=e.dot(s,S),l<0||l>v)return;if(c=e.cross(s,m,R),f=e.dot(d,c),f<0||l+f>v)return;h=e.dot(A,c)/v}else{if(Math.abs(v)<o.EPSILON6)return;var N=1/v;if(s=e.subtract(E,r,T),l=e.dot(s,S)*N,l<0||l>1)return;if(c=e.cross(s,m,R),f=e.dot(d,c)*N,f<0||l+f>1)return;h=e.dot(A,c)*N}return h},m.rayTriangle=function(t,n,a,i,o,u){var s=m.rayTriangleParametric(t,n,a,i,o);if(r(s)&&!(s<0))return r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var A=new l;m.lineSegmentTriangle=function(t,n,a,i,o,u,s){var c=A;e.clone(t,c.origin),e.subtract(n,t,c.direction),e.normalize(c.direction,c.direction);var l=m.rayTriangleParametric(c,a,i,o,u);if(!(!r(l)||l<0||l>e.distance(t,n)))return r(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var S={root0:0,root1:0};m.raySphere=function(e,t,n){if(n=h(e,t,n),r(n)&&!(n.stop<0))return n.start=Math.max(n.start,0),n};var v=new l;m.lineSegmentSphere=function(t,n,a,i){var o=v;e.clone(t,o.origin);var u=e.subtract(n,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),i=h(o,a,i),!(!r(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var N=new e,O=new e;m.rayEllipsoid=function(t,n){var r,a,o,u,s,c=n.oneOverRadii,l=e.multiplyComponents(c,t.origin,N),f=e.multiplyComponents(c,t.direction,O),h=e.magnitudeSquared(l),E=e.dot(l,f);if(h>1){if(E>=0)return;var d=E*E;if(r=h-1,a=e.magnitudeSquared(f),o=a*r,d<o)return;if(d>o){u=E*E-o,s=-E+Math.sqrt(u);var m=s/a,_=r/s;return m<_?new i(m,_):{start:_,stop:m}}var p=Math.sqrt(r/a);return new i(p,p)}return h<1?(r=h-1,a=e.magnitudeSquared(f),o=a*r,u=E*E-o,s=-E+Math.sqrt(u),new i(0,s/a)):E<0?(a=e.magnitudeSquared(f),new i(0,-E/a)):void 0};var I=new e,g=new e,M=new e,x=new e,w=new e,C=new u,P=new u,U=new u,D=new u,L=new u,F=new u,z=new u,B=new e,b=new e,G=new t;m.grazingAltitudeLocation=function(t,n){var a=t.origin,i=t.direction;if(!e.equals(a,e.ZERO)){var s=n.geodeticSurfaceNormal(a,I);if(e.dot(i,s)>=0)return a}var c=r(this.rayEllipsoid(t,n)),l=n.transformPositionToScaledSpace(i,I),f=e.normalize(l,l),h=e.mostOrthogonalAxis(l,x),E=e.normalize(e.cross(h,f,g),g),m=e.normalize(e.cross(f,E,M),M),_=C;_[0]=f.x,_[1]=f.y,_[2]=f.z,_[3]=E.x,_[4]=E.y,_[5]=E.z,_[6]=m.x,_[7]=m.y,_[8]=m.z;var p=u.transpose(_,P),y=u.fromScale(n.radii,U),T=u.fromScale(n.oneOverRadii,D),R=L;R[0]=0,R[1]=-i.z,R[2]=i.y,R[3]=i.z,R[4]=0,R[5]=-i.x,R[6]=-i.y,R[7]=i.x,R[8]=0;var A,S,v=u.multiply(u.multiply(p,T,F),R,F),N=u.multiply(u.multiply(v,y,z),_,z),O=u.multiplyByVector(v,a,w),q=d(N,e.negate(O,I),0,0,1),W=q.length;if(W>0){for(var X=e.clone(e.ZERO,b),H=Number.NEGATIVE_INFINITY,V=0;V<W;++V){A=u.multiplyByVector(y,u.multiplyByVector(_,q[V],B),B);var Y=e.normalize(e.subtract(A,a,x),x),k=e.dot(Y,i);k>H&&(H=k,X=e.clone(A,X))}var Z=n.cartesianToCartographic(X,G);return H=o.clamp(H,0,1),S=e.magnitude(e.subtract(X,a,x))*Math.sqrt(1-H*H),S=c?-S:S,Z.height=S,n.cartographicToCartesian(Z,new e)}};var q=new e;return m.lineSegmentPlane=function(t,n,a,i){r(i)||(i=new e);var u=e.subtract(n,t,q),s=a.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON6)){var l=e.dot(s,t),f=-(a.distance+l)/c;if(!(f<0||f>1))return e.multiplyByScalar(u,f,i),e.add(t,i,i),i}},m.trianglePlaneIntersection=function(t,n,r,a){var i=a.normal,o=a.distance,u=e.dot(i,t)+o<0,s=e.dot(i,n)+o<0,c=e.dot(i,r)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var f,h;if(1!==l&&2!==l||(f=new e,h=new e),1===l){if(u)return m.lineSegmentPlane(t,n,a,f),m.lineSegmentPlane(t,r,a,h),{positions:[t,n,r,f,h],indices:[0,3,4,1,2,4,1,4,3]};if(s)return m.lineSegmentPlane(n,r,a,f),m.lineSegmentPlane(n,t,a,h),{positions:[t,n,r,f,h],indices:[1,3,4,2,0,4,2,4,3]};if(c)return m.lineSegmentPlane(r,t,a,f),m.lineSegmentPlane(r,n,a,h),{positions:[t,n,r,f,h],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return m.lineSegmentPlane(n,t,a,f),m.lineSegmentPlane(r,t,a,h),{positions:[t,n,r,f,h],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return m.lineSegmentPlane(r,n,a,f),m.lineSegmentPlane(t,n,a,h),{positions:[t,n,r,f,h],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return m.lineSegmentPlane(t,r,a,f),m.lineSegmentPlane(n,r,a,h),{positions:[t,n,r,f,h],indices:[0,1,4,0,4,3,2,3,4]}}},m}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";function a(t,n){this.normal=e.clone(t),this.distance=n}a.fromPointNormal=function(n,r,i){var o=-e.dot(r,n);return t(i)?(e.clone(r,i.normal),i.distance=o,i):new a(r,o)};var i=new e;return a.fromCartesian4=function(n,r){var o=e.fromCartesian4(n,i),u=n.w;return t(r)?(e.clone(o,r.normal),r.distance=u,r):new a(o,u)},a.getPointDistance=function(t,n){return e.dot(t.normal,n)+t.distance},a.ORIGIN_XY_PLANE=r(new a(e.UNIT_Z,0)),a.ORIGIN_YZ_PLANE=r(new a(e.UNIT_X,0)),a.ORIGIN_ZX_PLANE=r(new a(e.UNIT_Y,0)),a}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,n,r,a){return t(e).then(n,r,a)}function t(e){var t,n;return e instanceof r?t=e:u(e)?(n=o(),e.then(function(e){n.resolve(e)},function(e){n.reject(e)},function(e){n.progress(e)}),t=n.promise):t=a(e),t}function n(t){return e(t,i)}function r(e){this.then=e}function a(e){var n=new r(function(n){try{return t(n?n(e):e)}catch(e){return i(e)}});return n}function i(e){var n=new r(function(n,r){try{return r?t(r(e)):i(e)}catch(e){return i(e)}});return n}function o(){function e(e,t,n){return h(e,t,n)}function n(e){return d(e)}function a(e){return d(i(e))}function u(e){return E(e)}var s,c,l,f,h,E,d;return c=new r(e),s={then:e,resolve:n,reject:a,progress:u,promise:c,resolver:{resolve:n,reject:a,progress:u}},l=[],f=[],h=function(e,t,n){var r,a;return r=o(),a="function"==typeof n?function(e){try{r.progress(n(e))}catch(e){r.progress(e)}}:function(e){r.progress(e)},l.push(function(n){n.then(e,t).then(r.resolve,r.reject,a)}),f.push(a),r.promise},E=function(e){return m(f,e),e},d=function(e){return e=t(e),h=e.then,d=t,E=p,m(l,e),f=l=A,e},s}function u(e){return e&&"function"==typeof e.then}function s(t,n,r,a,i){return _(2,arguments),e(t,function(t){function u(e){m(e)}function s(e){d(e)}var c,l,f,h,E,d,m,_,y,T;if(y=t.length>>>0,c=Math.max(0,Math.min(n,y)),f=[],l=y-c+1,h=[],E=o(),c)for(_=E.progress,m=function(e){h.push(e),--l||(d=m=p,E.reject(h))},d=function(e){f.push(e),--c||(d=m=p,E.resolve(f))},T=0;T<y;++T)T in t&&e(t[T],s,u,_);else E.resolve(f);return E.then(r,a,i)})}function c(e,t,n,r){function a(e){return t?t(e[0]):e[0]}return s(e,1,a,n,r)}function l(e,t,n,r){return _(1,arguments),h(e,y).then(t,n,r)}function f(){return h(arguments,y)}function h(t,n){return e(t,function(t){var r,a,i,u,s,c;if(i=a=t.length>>>0,r=[],c=o(),i)for(u=function(t,a){e(t,n).then(function(e){r[a]=e,--i||c.resolve(r)},c.reject)},s=0;s<a;s++)s in t?u(t[s],s):--i;else c.resolve(r);return c.promise})}function E(t,n){var r=R.call(arguments,1);return e(t,function(t){var a;return a=t.length,r[0]=function(t,r,i){return e(t,function(t){return e(r,function(e){return n(t,e,i,a)})})},T.apply(t,r)})}function d(t,n,r){var a=arguments.length>2;return e(t,function(e){return e=a?r:e,n.resolve(e),e},function(e){return n.reject(e),i(e)},n.progress)}function m(e,t){for(var n,r=0;n=e[r++];)n(t)}function _(e,t){for(var n,r=t.length;r>e;)if(n=t[--r],null!=n&&"function"!=typeof n)throw new Error("arg "+r+" must be a function")}function p(){}function y(e){return e}var T,R,A;return e.defer=o,e.resolve=t,e.reject=n,e.join=f,e.all=l,e.map=h,e.reduce=E,e.any=c,e.some=s,e.chain=d,e.isPromise=u,r.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(A,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return l(t,function(t){return e.apply(A,t)})})}},R=[].slice,T=[].reduce||function(e){var t,n,r,a,i;if(i=0,t=Object(this),a=t.length>>>0,n=arguments,n.length<=1)for(;;){if(i in t){r=t[i++];break}if(++i>=a)throw new TypeError}else r=n[1];for(;i<a;++i)i in t&&(r=e(r,t[i],i,t));return r},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/binarySearch",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e,t,n){for(var r,a,i=0,o=e.length-1;i<=o;)if(r=~~((i+o)/2),a=n(e[r],t),a<0)i=r+1;else{if(!(a>0))return r;o=r-1}return~(o+1)}return n}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,n,r,a){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=r,this.ut1MinusUtc=a}return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,n=0,r=t[n++],a=function(e,t,n,r){n||(n=" ");var a=e.length>=t?"":Array(1+t-e.length>>>0).join(n);return r?e+a:a+e},i=function(e,t,n,r,i,o){var u=r-e.length;return u>0&&(e=n||!i?a(e,r,o,n):e.slice(0,t.length)+a("",u,"0",!0)+e.slice(t.length)),e},o=function(e,t,n,r,o,u,s){var c=e>>>0;return n=n&&c&&{2:"0b",8:"0",16:"0x"}[t]||"",e=n+a(c.toString(t),u||0,"0",!1),i(e,n,r,o,s)},u=function(e,t,n,r,a,o){return null!=r&&(e=e.slice(0,r)),i(e,"",t,n,a,o)},s=function(e,r,s,c,l,f,h){var E,d,m,_,p;if("%%"==e)return"%";for(var y=!1,T="",R=!1,A=!1,S=" ",v=s.length,N=0;s&&N<v;N++)switch(s.charAt(N)){case" ":T=" ";break;case"+":T="+";break;case"-":y=!0;break;case"'":S=s.charAt(N+1);break;case"0":R=!0;break;case"#":A=!0}if(c=c?"*"==c?+t[n++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,c<0&&(c=-c,y=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(f=f?"*"==f?+t[n++]:"*"==f.charAt(0)?+t[f.slice(1,-1)]:+f:"fFeE".indexOf(h)>-1?6:"d"==h?0:void 0,p=r?t[r.slice(0,-1)]:t[n++],h){case"s":return u(String(p),y,c,f,R,S);case"c":return u(String.fromCharCode(+p),y,c,f,R);case"b":return o(p,2,A,y,c,f,R);case"o":return o(p,8,A,y,c,f,R);case"x":return o(p,16,A,y,c,f,R);case"X":return o(p,16,A,y,c,f,R).toUpperCase();case"u":return o(p,10,A,y,c,f,R);case"i":case"d":return E=+p||0,E=Math.round(E-E%1),d=E<0?"-":T,p=d+a(String(Math.abs(E)),f,"0",!1),i(p,d,y,c,R);case"e":case"E":case"f":case"F":case"g":case"G":return E=+p,d=E<0?"-":T,m=["toExponential","toFixed","toPrecision"]["efg".indexOf(h.toLowerCase())],_=["toString","toUpperCase"]["eEfFgG".indexOf(h)%2],p=d+Math.abs(E)[m](f),i(p,d,y,c,R)[_]();default:return e}};return r.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,n,r,a,i,o,u){this.year=e,this.month=t,this.day=n,this.hour=r,this.minute=a,this.second=i,this.millisecond=o,this.isLeapSecond=u}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e(t)}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t){return m.compare(e.julianDate,t.julianDate)}function f(e){T.julianDate=e;var n=m.leapSeconds,r=t(n,T,l);r<0&&(r=~r),r>=n.length&&(r=n.length-1);var a=n[r].offset;if(r>0){var i=m.secondsDifference(n[r].julianDate,e);i>a&&(r--,a=n[r].offset)}m.addSeconds(e,a,e)}function h(e,n){T.julianDate=e;var r=m.leapSeconds,a=t(r,T,l);if(a<0&&(a=~a),0===a)return m.addSeconds(e,-r[0].offset,n);if(a>=r.length)return m.addSeconds(e,-r[a-1].offset,n);var i=m.secondsDifference(r[a].julianDate,e);return 0===i?m.addSeconds(e,-r[a].offset,n):i<=1?void 0:m.addSeconds(e,-r[--a].offset,n)}function E(e,t,n){var r=t/s.SECONDS_PER_DAY|0;return e+=r,t-=s.SECONDS_PER_DAY*r,t<0&&(e--,t+=s.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function d(e,t,n,r,a,i,o){var u=(t-14)/12|0,c=e+4800+u,l=(1461*c/4|0)+(367*(t-2-12*u)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;r-=12,r<0&&(r+=24);var f=i+(r*s.SECONDS_PER_HOUR+a*s.SECONDS_PER_MINUTE+o*s.SECONDS_PER_MILLISECOND);return f>=43200&&(l-=1),[l,f]}function m(e,t,r){this.dayNumber=void 0,this.secondsOfDay=void 0,e=n(e,0),t=n(t,0),r=n(r,c.UTC);var a=0|e;t+=(e-a)*s.SECONDS_PER_DAY,E(a,t,this),r===c.UTC&&f(this)}var _=new i,p=[31,28,31,30,31,30,31,31,30,31,30,31],y=29,T=new u,R=/^(\d{4})$/,A=/^(\d{4})-(\d{2})$/,S=/^(\d{4})-?(\d{3})$/,v=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,N=/^(\d{4})-?(\d{2})-?(\d{2})$/,O=/([Z+\-])?(\d{2})?:?(\d{2})?$/,I=/^(\d{2})(\.\d+)?/.source+O.source,g=/^(\d{2}):?(\d{2})(\.\d+)?/.source+O.source,M=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+O.source;m.fromDate=function(e,t){var n=d(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r(t)?(E(n[0],n[1],t),f(t),t):new m(n[0],n[1],c.UTC)},m.fromIso8601=function(e,t){e=e.replace(",",".");var n,a,i,u=e.split("T"),s=1,l=1,h=0,_=0,T=0,O=0,x=u[0],w=u[1];if(u=x.match(N),null!==u)n=+u[1],s=+u[2],l=+u[3];else if(u=x.match(A),null!==u)n=+u[1],s=+u[2];else if(u=x.match(R),null!==u)n=+u[1];else{var C;if(u=x.match(S),null!==u)n=+u[1],C=+u[2],i=o(n);else if(u=x.match(v),null!==u){n=+u[1];var P=+u[2],U=+u[3]||0,D=new Date(Date.UTC(n,0,4));C=7*P+U-D.getUTCDay()-3}a=new Date(Date.UTC(n,0,1)),a.setUTCDate(C),s=a.getUTCMonth()+1,l=a.getUTCDate()}i=o(n);var L;if(r(w)){u=w.match(M),null!==u?(h=+u[1],_=+u[2],T=+u[3],O=1e3*+(u[4]||0),L=5):(u=w.match(g),null!==u?(h=+u[1],_=+u[2],T=60*+(u[3]||0),L=4):(u=w.match(I),null!==u&&(h=+u[1],_=60*+(u[2]||0),L=3)));var F=u[L],z=+u[L+1],B=+(u[L+2]||0);switch(F){case"+":h-=z,_-=B;break;case"-":h+=z,_+=B;break;case"Z":break;default:_+=new Date(Date.UTC(n,s-1,l,h,_)).getTimezoneOffset()}}else _+=new Date(n,s-1,l).getTimezoneOffset();var b=60===T;for(b&&T--;_>=60;)_-=60,h++;for(;h>=24;)h-=24,l++;for(a=i&&2===s?y:p[s-1];l>a;)l-=a,s++,s>12&&(s-=12,n++),a=i&&2===s?y:p[s-1];for(;_<0;)_+=60,h--;for(;h<0;)h+=24,l--;for(;l<1;)s--,s<1&&(s+=12,n--),a=i&&2===s?y:p[s-1],l+=a;var G=d(n,s,l,h,_,T,O);return r(t)?(E(G[0],G[1],t),f(t)):t=new m(G[0],G[1],c.UTC),b&&m.addSeconds(t,1,t),t},m.now=function(e){return m.fromDate(new Date,e)};var x=new m(0,0,c.TAI);return m.toGregorianDate=function(e,t){var n=!1,a=h(e,x);r(a)||(m.addSeconds(e,-1,x),a=h(x,x),n=!0);var o=a.dayNumber,u=a.secondsOfDay;u>=43200&&(o+=1);var c=o+68569|0,l=4*c/146097|0;c=c-((146097*l+3)/4|0)|0;var f=4e3*(c+1)/1461001|0;c=c-(1461*f/4|0)+31|0;var E=80*c/2447|0,d=c-(2447*E/80|0)|0;c=E/11|0;var _=E+2-12*c|0,p=100*(l-49)+f+c|0,y=u/s.SECONDS_PER_HOUR|0,T=u-y*s.SECONDS_PER_HOUR,R=T/s.SECONDS_PER_MINUTE|0;T-=R*s.SECONDS_PER_MINUTE;var A=0|T,S=(T-A)/s.SECONDS_PER_MILLISECOND;return y+=12,y>23&&(y-=24),n&&(A+=1),r(t)?(t.year=p,t.month=_,t.day=d,t.hour=y,t.minute=R,t.second=A,t.millisecond=S,t.isLeapSecond=n,t):new i(p,_,d,y,R,A,S,n)},m.toDate=function(e){var t=m.toGregorianDate(e,_),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))},m.toIso8601=function(t,n){var a,i=m.toGregorianDate(t,i);return r(n)||0===i.millisecond?r(n)&&0!==n?(a=(.01*i.millisecond).toFixed(n).replace(".","").slice(0,n),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",i.year,i.month,i.day,i.hour,i.minute,i.second):(a=(.01*i.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a))},m.clone=function(e,t){if(r(e))return r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new m(e.dayNumber,e.secondsOfDay,c.TAI)},m.compare=function(e,t){var n=e.dayNumber-t.dayNumber;return 0!==n?n:e.secondsOfDay-t.secondsOfDay},m.equals=function(e,t){return e===t||r(e)&&r(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},m.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(m.secondsDifference(e,t))<=n},m.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},m.secondsDifference=function(e,t){var n=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return n+(e.secondsOfDay-t.secondsOfDay)},m.daysDifference=function(e,t){var n=e.dayNumber-t.dayNumber,r=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return n+r},m.computeTaiMinusUtc=function(e){T.julianDate=e;var n=m.leapSeconds,r=t(n,T,l);return r<0&&(r=~r,--r,r<0&&(r=0)),n[r].offset},m.addSeconds=function(e,t,n){return E(e.dayNumber,e.secondsOfDay+t,n)},m.addMinutes=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return E(e.dayNumber,r,n)},m.addHours=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return E(e.dayNumber,r,n)},m.addDays=function(e,t,n){var r=e.dayNumber+t;return E(r,e.secondsOfDay,n)},m.lessThan=function(e,t){return m.compare(e,t)<0},m.lessThanOrEquals=function(e,t){return m.compare(e,t)<=0},m.greaterThan=function(e,t){return m.compare(e,t)>0},m.greaterThanOrEquals=function(e,t){return m.compare(e,t)>=0},m.prototype.clone=function(e){return m.clone(this,e)},m.prototype.equals=function(e){return m.equals(this,e)},m.prototype.equalsEpsilon=function(e,t){return m.equalsEpsilon(this,e,t)},m.prototype.toString=function(){return m.toIso8601(this)},m.leapSeconds=[new u(new m(2441317,43210,c.TAI),10),new u(new m(2441499,43211,c.TAI),11),new u(new m(2441683,43212,c.TAI),12),new u(new m(2442048,43213,c.TAI),13),new u(new m(2442413,43214,c.TAI),14),new u(new m(2442778,43215,c.TAI),15),new u(new m(2443144,43216,c.TAI),16),new u(new m(2443509,43217,c.TAI),17),new u(new m(2443874,43218,c.TAI),18),new u(new m(2444239,43219,c.TAI),19),new u(new m(2444786,43220,c.TAI),20),new u(new m(2445151,43221,c.TAI),21),new u(new m(2445516,43222,c.TAI),22),new u(new m(2446247,43223,c.TAI),23),new u(new m(2447161,43224,c.TAI),24),new u(new m(2447892,43225,c.TAI),25),new u(new m(2448257,43226,c.TAI),26),new u(new m(2448804,43227,c.TAI),27),new u(new m(2449169,43228,c.TAI),28),new u(new m(2449534,43229,c.TAI),29),new u(new m(2450083,43230,c.TAI),30),new u(new m(2450630,43231,c.TAI),31),new u(new m(2451179,43232,c.TAI),32),new u(new m(2453736,43233,c.TAI),33),new u(new m(2454832,43234,c.TAI),34),new u(new m(2456109,43235,c.TAI),35),new u(new m(2457204,43236,c.TAI),36),new u(new m(2457754,43237,c.TAI),37)],m}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(n,r){if(null===n||"object"!=typeof n)return n;r=e(r,!1);var a=new n.constructor;for(var i in n)if(n.hasOwnProperty(i)){var o=n[i];r&&(o=t(o,r)),a[i]=o}return a}return t}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var n=e.split("\r\n"),r=0;r<n.length;++r){var a=n[r],i=a.indexOf(": ");if(i>0){var o=a.substring(0,i),u=a.substring(i+2);t[o]=u}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function n(e,n,r){this.statusCode=e,this.response=n,this.responseHeaders=r,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return n.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},n}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var n=r.exec(t);this.scheme=n[1],this.authority=n[2],this.path=n[3],this.query=n[4],this.fragment=n[5]}}function t(e){var t=unescape(e);return i.test(t)?t:e.toUpperCase()}function n(e,t,n,r){return(t||"")+n.toLowerCase()+(r||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var r=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(o,n).replace(a,t)),this.path&&(this.path=this.path.replace(a,t)),this.query&&(this.query=this.query.replace(a,t)),this.fragment&&(this.fragment=this.fragment.replace(a,t))};var a=/%[0-9a-z]{2}/gi,i=/[a-zA-Z0-9\-\._~]/,o=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var n=new e;return this.scheme?(n.scheme=this.scheme,n.authority=this.authority,n.path=this.path,n.query=this.query):(n.scheme=t.scheme,this.authority?(n.authority=this.authority,n.path=this.path,n.query=this.query):(n.authority=t.authority,""==this.path?(n.path=t.path,n.query=this.query||t.query):("/"==this.path.charAt(0)?(n.path=this.path,n.removeDotSegments()):(t.authority&&""==t.path?n.path="/"+this.path:n.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,n.removeDotSegments()),n.query=this.query))),n.fragment=this.fragment,n},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),n=[],r=""==t[0];r&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?n.pop():"."!=e&&n.push(e);"."!=e&&".."!=e||n.push(""),r&&n.unshift(""),this.path=n.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n){var r=new e(n);r.normalize();var a=r.getAuthority();if(t(a)){if(a.indexOf("@")!==-1){var i=a.split("@");a=i[1]}if(a.indexOf(":")===-1){var o=r.getScheme();if(t(o)||(o=window.location.protocol,o=o.substring(0,o.length-1)),"http"===o)a+=":80";else{if("https"!==o)return;a+=":443"}}return a}}var a={},i={};return a.add=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])||(i[r]=!0)},a.remove=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])&&delete i[r]},a.contains=function(e){var n=r(e);return!(!t(n)||!t(i[n]))},a.clear=function(){i={}},a}),define("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,n,r,a,i,o){"use strict";function u(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,a=t(n.method,"GET"),i=n.data,o=n.headers,s=n.overrideMimeType;return e(n.url,function(t){var n=e.defer();return u.load(t,r,a,i,o,n,s),n.promise})}function s(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function c(e,t){for(var n=s(e,t),r=new ArrayBuffer(n.length),a=new Uint8Array(r),i=0;i<n.length;i++)a[i]=n.charCodeAt(i);return r}function l(e,n){n=t(n,"");var r=e[1],a=!!e[2],i=e[3];switch(n){case"":case"text":return s(a,i);case"arraybuffer":return c(a,i);case"blob":var o=c(a,i);return new Blob([o],{type:r});case"document":var u=new DOMParser;return u.parseFromString(s(a,i),r);case"json":return JSON.parse(s(a,i))}}var f=/^data:(.*?)(;base64)?,(.*)$/;return u.load=function(e,t,r,u,s,c,h){var E=f.exec(e);if(null!==E)return void c.resolve(l(E,t));var d=new XMLHttpRequest;if(o.contains(e)&&(d.withCredentials=!0),n(h)&&n(d.overrideMimeType)&&d.overrideMimeType(h),d.open(r,e,!0),n(s))for(var m in s)s.hasOwnProperty(m)&&d.setRequestHeader(m,s[m]);n(t)&&(d.responseType=t),d.onload=function(){if(d.status<200||d.status>=300)return void c.reject(new a(d.status,d.response,d.getAllResponseHeaders()));var e=d.response,r=d.responseType;if(!n(e)||n(t)&&r!==t)if("json"===t&&"string"==typeof e)try{c.resolve(JSON.parse(e))}catch(e){c.reject(e)}else(""===r||"document"===r)&&n(d.responseXML)&&d.responseXML.hasChildNodes()?c.resolve(d.responseXML):""!==r&&"text"!==r||!n(d.responseText)?c.reject(new i("Invalid XMLHttpRequest response type.")):c.resolve(d.responseText);else c.resolve(e)},d.onerror=function(e){c.reject(new a)},d.send(u)},u.defaultLoad=u.load,u}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,n){return e({url:t,headers:n})}return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";function a(n,a){return t(a)?t(a.Accept)||(a=e(a),a.Accept=i.Accept):a=i,r(n,a).then(function(e){return JSON.parse(e)})}var i={Accept:"application/json,*/*;q=0.01"};return a}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(t){if(t=n(t,n.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=n(t.addNewLeapSeconds,!0),r(t.data))d(this,t.data);else if(r(t.url)){var a=this;this._downloadPromise=e(s(t.url),function(e){d(a,e)},function(){a._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else d(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function E(e,t){return o.compare(e.julianDate,t)}function d(e,n){if(!r(n.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!r(n.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var a=n.columnNames.indexOf("modifiedJulianDateUtc"),i=n.columnNames.indexOf("xPoleWanderRadians"),s=n.columnNames.indexOf("yPoleWanderRadians"),c=n.columnNames.indexOf("ut1MinusUtcSeconds"),h=n.columnNames.indexOf("xCelestialPoleOffsetRadians"),d=n.columnNames.indexOf("yCelestialPoleOffsetRadians"),m=n.columnNames.indexOf("taiMinusUtcSeconds");if(a<0||i<0||s<0||c<0||h<0||d<0||m<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var _=e._samples=n.samples,p=e._dates=[];e._dateColumn=a,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=h,e._yCelestialPoleOffsetRadiansColumn=d,e._taiMinusUtcSecondsColumn=m,e._columnCount=n.columnNames.length,e._lastIndex=void 0;for(var y,T=e._addNewLeapSeconds,R=0,A=_.length;R<A;R+=e._columnCount){var S=_[R+a],v=_[R+m],N=S+l.MODIFIED_JULIAN_DATE_DIFFERENCE,O=new o(N,v,f.TAI);if(p.push(O),T){if(v!==y&&r(y)){var I=o.leapSeconds,g=t(I,O,E);if(g<0){var M=new u(O,v);I.splice(~g,0,M)}}y=v}}}function m(e,t,n,r,a){var i=n*r;a.xPoleWander=t[i+e._xPoleWanderRadiansColumn],a.yPoleWander=t[i+e._yPoleWanderRadiansColumn],a.xPoleOffset=t[i+e._xCelestialPoleOffsetRadiansColumn],a.yPoleOffset=t[i+e._yCelestialPoleOffsetRadiansColumn],a.ut1MinusUtc=t[i+e._ut1MinusUtcSecondsColumn]}function _(e,t,n){return t+e*(n-t)}function p(e,t,n,r,a,i,u){var s=e._columnCount;if(i>t.length-1)return u.xPoleWander=0,u.yPoleWander=0,u.xPoleOffset=0,u.yPoleOffset=0,u.ut1MinusUtc=0,u;var c=t[a],l=t[i];if(c.equals(l)||r.equals(c))return m(e,n,a,s,u),u;if(r.equals(l))return m(e,n,i,s,u),u;var f=o.secondsDifference(r,c)/o.secondsDifference(l,c),h=a*s,E=i*s,d=n[h+e._ut1MinusUtcSecondsColumn],p=n[E+e._ut1MinusUtcSecondsColumn],y=p-d;if(y>.5||y<-.5){var T=n[h+e._taiMinusUtcSecondsColumn],R=n[E+e._taiMinusUtcSecondsColumn];T!==R&&(l.equals(r)?d=p:p-=R-T)}return u.xPoleWander=_(f,n[h+e._xPoleWanderRadiansColumn],n[E+e._xPoleWanderRadiansColumn]),u.yPoleWander=_(f,n[h+e._yPoleWanderRadiansColumn],n[E+e._yPoleWanderRadiansColumn]),u.xPoleOffset=_(f,n[h+e._xCelestialPoleOffsetRadiansColumn],n[E+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=_(f,n[h+e._yCelestialPoleOffsetRadiansColumn],n[E+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=_(f,d,p),u}return h.NONE=i({getPromiseToLoad:function(){return e()},compute:function(e,t){return r(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new a(0,0,0,0,0),t}}),h.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},h.prototype.compute=function(e,n){if(r(this._samples)){if(r(n)||(n=new a(0,0,0,0,0)),0===this._samples.length)return n.xPoleWander=0,n.yPoleWander=0,n.xPoleOffset=0,n.yPoleOffset=0,n.ut1MinusUtc=0,n;var i=this._dates,u=this._lastIndex,s=0,l=0;if(r(u)){var f=i[u],h=i[u+1],E=o.lessThanOrEquals(f,e),d=!r(h),m=d||o.greaterThanOrEquals(h,e);if(E&&m)return s=u,!d&&h.equals(e)&&++s,l=s+1,p(this,i,this._samples,e,s,l,n),n}var _=t(i,e,o.compare,this._dateColumn);return _>=0?(_<i.length-1&&i[_+1].equals(e)&&++_,s=_,l=_):(l=~_,s=l-1,s<0&&(s=0)),this._lastIndex=s,p(this,i,this._samples,e,s,l,n),n}if(r(this._dataError))throw new c(this._dataError)},h}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(t,n,r){this.heading=e(t,0),this.pitch=e(n,0),this.roll=e(r,0)}return a.fromQuaternion=function(e,n){t(n)||(n=new a);var r=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return n.heading=-Math.atan2(s,u),n.roll=Math.atan2(o,i),n.pitch=-Math.asin(r),n},a.fromDegrees=function(e,n,i,o){return t(o)||(o=new a),o.heading=e*r.RADIANS_PER_DEGREE,o.pitch=n*r.RADIANS_PER_DEGREE,o.roll=i*r.RADIANS_PER_DEGREE,o},a.clone=function(e,n){if(t(e))return t(n)?(n.heading=e.heading,n.pitch=e.pitch,n.roll=e.roll,n):new a(e.heading,e.pitch,e.roll)},a.equals=function(e,n){return e===n||t(e)&&t(n)&&e.heading===n.heading&&e.pitch===n.pitch&&e.roll===n.roll},a.equalsEpsilon=function(e,n,a,i){return e===n||t(e)&&t(n)&&r.equalsEpsilon(e.heading,n.heading,a,i)&&r.equalsEpsilon(e.pitch,n.pitch,a,i)&&r.equalsEpsilon(e.roll,n.roll,a,i)},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,n){return a.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"; +},a}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=t(r,document.location.href);var a=new e(r),i=new e(n);return i.resolve(a).toString()}return a}),define("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(r,a,i){i=t(i,!0),r instanceof e||(r=new e(r)),a instanceof e||(a=new e(a)),n(a.authority)&&!n(a.scheme)&&("undefined"!=typeof document&&n(document.location)&&n(document.location.href)?a.scheme=new e(document.location.href).scheme:a.scheme=r.scheme);var o=r;a.isAbsolute()&&(o=a);var u="";n(o.scheme)&&(u+=o.scheme+":"),n(o.authority)&&(u+="//"+o.authority,""!==o.path&&"/"!==o.path&&(u=u.replace(/\/?$/,"/"),o.path=o.path.replace(/^\/?/g,""))),u+=o===r?i?r.path.replace(/\/?$/,"/")+a.path.replace(/^\/?/g,""):r.path+a.path:a.path;var s=n(r.query),c=n(a.query);s&&c?u+="?"+r.query+"&"+a.query:s&&!c?u+="?"+r.query:!s&&c&&(u+="?"+a.query);var l=n(a.fragment);return n(r.fragment)&&!l?u+="#"+r.fragment:l&&(u+="#"+a.fragment),u}return a}),define("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","./joinUrls","require"],function(e,t,n,r,a,i){"use strict";function o(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;t<n;++t){var r=e[t].getAttribute("src"),a=d.exec(r);if(null!==a)return a[1]}}function u(){if(t(f))return f;var n;return n="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:o(),f=new e(r(n))}function s(e){return i.toUrl("../"+e)}function c(e){return a(u(),e)}function l(e){t(h)||(h=t(i.toUrl)?s:c),t(E)||(E=document.createElement("a"));var n=h(e);return E.href=n,E.href=E.href,E.href}var f,h,E,d=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return l._cesiumScriptRegex=d,l.setBaseUrl=function(t){f=new e(t).resolve(new e(document.location.href))},l}),define("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,n){this.x=e,this.y=t,this.s=n}return e}),define("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){e=n(e,n.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=n(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=n(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new i(this._sampleZeroJulianEphemerisDate,0,u.TAI),this._stepSizeDays=n(e.stepSizeDays,1),this._samplesPerXysFile=n(e.samplesPerXysFile,1e3),this._totalSamples=n(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,r=this._denominators=new Array(t+1),a=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t),s=0;s<=t;++s){r[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;c<=t;++c)c!==s&&(r[s]*=s-c);r[s]=1/r[s]}this._work=new Array(t+1),this._coef=new Array(t+1)}function c(e,t,n){var r=f;return r.dayNumber=t,r.secondsOfDay=n,i.daysDifference(r,e._sampleZeroDateTT)}function l(n,a){if(n._chunkDownloadsInProgress[a])return n._chunkDownloadsInProgress[a];var i=e.defer();n._chunkDownloadsInProgress[a]=i;var u,s=n._xysFileUrlTemplate;return u=r(s)?s.replace("{0}",a):t("Assets/IAU2006_XYS/IAU2006_XYS_"+a+".json"),e(o(u),function(e){n._chunkDownloadsInProgress[a]=!1;for(var t=n._samples,r=e.samples,o=a*n._samplesPerXysFile*3,u=0,s=r.length;u<s;++u)t[o+u]=r[u];i.resolve()}),i.promise}var f=new i(0,0,u.TAI);return s.prototype.preload=function(t,n,r,a){var i=c(this,t,n),o=c(this,r,a),u=i/this._stepSizeDays-this._interpolationOrder/2|0;u<0&&(u=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var f=u/this._samplesPerXysFile|0,h=s/this._samplesPerXysFile|0,E=[],d=f;d<=h;++d)E.push(l(this,d));return e.all(E)},s.prototype.computeXysRadians=function(e,t,n){var i=c(this,e,t);if(!(i<0)){var o=i/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);s<0&&(s=0);var f=s+u;f>=this._totalSamples&&(f=this._totalSamples-1,s=f-u,s<0&&(s=0));var h=!1,E=this._samples;if(r(E[3*s])||(l(this,s/this._samplesPerXysFile|0),h=!0),r(E[3*f])||(l(this,f/this._samplesPerXysFile|0),h=!0),!h){r(n)?(n.x=0,n.y=0,n.s=0):n=new a(0,0,0);var d,m,_=i-s*this._stepSizeDays,p=this._work,y=this._denominators,T=this._coef,R=this._xTable;for(d=0;d<=u;++d)p[d]=_-R[d];for(d=0;d<=u;++d){for(T[d]=1,m=0;m<=u;++m)m!==d&&(T[d]*=p[m]);T[d]*=y[d];var A=3*(s+d);n.x+=T[d]*E[A++],n.y+=T[d]*E[A++],n.s+=T[d]*E[A]}return n}}}},s}),define("Core/Quaternion",["./Cartesian3","./Check","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math","./Matrix3"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(e,t,r,a){this.x=n(e,0),this.y=n(t,0),this.z=n(r,0),this.w=n(a,0)}var l=new e;c.fromAxisAngle=function(t,n,a){var i=n/2,o=Math.sin(i);l=e.normalize(t,l);var u=l.x*o,s=l.y*o,f=l.z*o,h=Math.cos(i);return r(a)?(a.x=u,a.y=s,a.z=f,a.w=h,a):new c(u,s,f,h)};var f=[1,2,0],h=new Array(3);c.fromRotationMatrix=function(e,t){var n,a,i,o,u,l=e[s.COLUMN0ROW0],E=e[s.COLUMN1ROW1],d=e[s.COLUMN2ROW2],m=l+E+d;if(m>0)n=Math.sqrt(m+1),u=.5*n,n=.5/n,a=(e[s.COLUMN1ROW2]-e[s.COLUMN2ROW1])*n,i=(e[s.COLUMN2ROW0]-e[s.COLUMN0ROW2])*n,o=(e[s.COLUMN0ROW1]-e[s.COLUMN1ROW0])*n;else{var _=f,p=0;E>l&&(p=1),d>l&&d>E&&(p=2);var y=_[p],T=_[y];n=Math.sqrt(e[s.getElementIndex(p,p)]-e[s.getElementIndex(y,y)]-e[s.getElementIndex(T,T)]+1);var R=h;R[p]=.5*n,n=.5/n,u=(e[s.getElementIndex(T,y)]-e[s.getElementIndex(y,T)])*n,R[y]=(e[s.getElementIndex(y,p)]+e[s.getElementIndex(p,y)])*n,R[T]=(e[s.getElementIndex(T,p)]+e[s.getElementIndex(p,T)])*n,a=-R[0],i=-R[1],o=-R[2]}return r(t)?(t.x=a,t.y=i,t.z=o,t.w=u,t):new c(a,i,o,u)};var E=new c;c.fromHeadingPitchRoll=function(t,n,r,a){var i=c.fromAxisAngle(e.UNIT_X,r,E),o=c.fromAxisAngle(e.UNIT_Y,-n,a);a=c.multiply(o,i,o);var u=c.fromAxisAngle(e.UNIT_Z,-t,E);return c.multiply(u,a,a)};var d=new e,m=new e,_=new c,p=new c,y=new c;c.packedLength=4,c.pack=function(e,t,r){return r=n(r,0),t[r++]=e.x,t[r++]=e.y,t[r++]=e.z,t[r]=e.w,t},c.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new c),a.x=e[t],a.y=e[t+1],a.z=e[t+2],a.w=e[t+3],a},c.packedInterpolationLength=3,c.convertPackedArrayForInterpolation=function(e,t,n,r){c.unpack(e,4*n,y),c.conjugate(y,y);for(var a=0,i=n-t+1;a<i;a++){var o=3*a;c.unpack(e,4*(t+a),_),c.multiply(_,y,_),_.w<0&&c.negate(_,_),c.computeAxis(_,d);var u=c.computeAngle(_);r[o]=d.x*u,r[o+1]=d.y*u,r[o+2]=d.z*u}},c.unpackInterpolationResult=function(t,n,a,i,o){r(o)||(o=new c),e.fromArray(t,0,m);var u=e.magnitude(m);return c.unpack(n,4*i,p),0===u?c.clone(c.IDENTITY,_):c.fromAxisAngle(m,u,_),c.multiply(_,p,o)},c.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new c(e.x,e.y,e.z,e.w)},c.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},c.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},c.magnitude=function(e){return Math.sqrt(c.magnitudeSquared(e))},c.normalize=function(e,t){var n=1/c.magnitude(e),r=e.x*n,a=e.y*n,i=e.z*n,o=e.w*n;return t.x=r,t.y=a,t.z=i,t.w=o,t},c.inverse=function(e,t){var n=c.magnitudeSquared(e);return t=c.conjugate(e,t),c.multiplyByScalar(t,1/n,t)},c.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},c.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},c.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},c.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},c.multiply=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=e.w,u=t.x,s=t.y,c=t.z,l=t.w,f=o*u+r*l+a*c-i*s,h=o*s-r*c+a*l+i*u,E=o*c+r*s-a*u+i*l,d=o*l-r*u-a*s-i*c;return n.x=f,n.y=h,n.z=E,n.w=d,n},c.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},c.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},c.computeAxis=function(e,t){var n=e.w;if(Math.abs(n-1)<u.EPSILON6)return t.x=t.y=t.z=0,t;var r=1/Math.sqrt(1-n*n);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},c.computeAngle=function(e){return Math.abs(e.w-1)<u.EPSILON6?0:2*Math.acos(e.w)};var T=new c;c.lerp=function(e,t,n,r){return T=c.multiplyByScalar(t,n,T),r=c.multiplyByScalar(e,1-n,r),c.add(T,r,r)};var R=new c,A=new c,S=new c;c.slerp=function(e,t,n,r){var a=c.dot(e,t),i=t;if(a<0&&(a=-a,i=R=c.negate(t,R)),1-a<u.EPSILON6)return c.lerp(e,i,n,r);var o=Math.acos(a);return A=c.multiplyByScalar(e,Math.sin((1-n)*o),A),S=c.multiplyByScalar(i,Math.sin(n*o),S),r=c.add(A,S,r),c.multiplyByScalar(r,1/Math.sin(o),r)},c.log=function(t,n){var r=u.acosClamped(t.w),a=0;return 0!==r&&(a=r/Math.sin(r)),e.multiplyByScalar(t,a,n)},c.exp=function(t,n){var r=e.magnitude(t),a=0;return 0!==r&&(a=Math.sin(r)/r),n.x=t.x*a,n.y=t.y*a,n.z=t.z*a,n.w=Math.cos(r),n};var v=new e,N=new e,O=new c,I=new c;c.computeInnerQuadrangle=function(t,n,r,a){var i=c.conjugate(n,O);c.multiply(i,r,I);var o=c.log(I,v);c.multiply(i,t,I);var u=c.log(I,N);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),c.exp(o,O),c.multiply(n,O,a)},c.squad=function(e,t,n,r,a,i){var o=c.slerp(e,t,a,O),u=c.slerp(n,r,a,I);return c.slerp(o,u,2*a*(1-a),i)};for(var g=new c,M=1.9011074535173003,x=i.supportsTypedArrays()?new Float32Array(8):[],w=i.supportsTypedArrays()?new Float32Array(8):[],C=i.supportsTypedArrays()?new Float32Array(8):[],P=i.supportsTypedArrays()?new Float32Array(8):[],U=0;U<7;++U){var D=U+1,L=2*D+1;x[U]=1/(D*L),w[U]=D/L}return x[7]=M/136,w[7]=8*M/17,c.fastSlerp=function(e,t,n,r){var a,i=c.dot(e,t);i>=0?a=1:(a=-1,i=-i);for(var o=i-1,u=1-n,s=n*n,l=u*u,f=7;f>=0;--f)C[f]=(x[f]*s-w[f])*o,P[f]=(x[f]*l-w[f])*o;var h=a*n*(1+C[0]*(1+C[1]*(1+C[2]*(1+C[3]*(1+C[4]*(1+C[5]*(1+C[6]*(1+C[7])))))))),E=u*(1+P[0]*(1+P[1]*(1+P[2]*(1+P[3]*(1+P[4]*(1+P[5]*(1+P[6]*(1+P[7])))))))),d=c.multiplyByScalar(e,E,g);return c.multiplyByScalar(t,h,r),c.add(d,r,r)},c.fastSquad=function(e,t,n,r,a,i){var o=c.fastSlerp(e,t,a,O),u=c.fastSlerp(n,r,a,I);return c.fastSlerp(o,u,2*a*(1-a),i)},c.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},c.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n},c.ZERO=o(new c(0,0,0,0)),c.IDENTITY=o(new c(0,0,0,1)),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.x+", "+this.y+", "+this.z+", "+this.w+")"},c}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./Check","./defaultValue","./defined","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./HeadingPitchRoll","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,E,d,m,_,p,y,T,R){"use strict";var A={},S=new n,v=new n,N=new n;A.eastNorthUpToFixedFrame=function(e,t,r){if(_.equalsEpsilon(e.x,0,_.EPSILON14)&&_.equalsEpsilon(e.y,0,_.EPSILON14)){var a=_.sign(e.z);return u(r)?(r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=-a,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=a,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(0,-a,0,e.x,1,0,0,e.y,0,0,a,e.z,0,0,0,1)}var i=S,s=v,c=N;return t=o(t,f.WGS84),t.geodeticSurfaceNormal(e,i),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(i,s,c),u(r)?(r[0]=s.x,r[1]=s.y,r[2]=s.z,r[3]=0,r[4]=c.x,r[5]=c.y,r[6]=c.z,r[7]=0,r[8]=i.x,r[9]=i.y,r[10]=i.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(s.x,c.x,i.x,e.x,s.y,c.y,i.y,e.y,s.z,c.z,i.z,e.z,0,0,0,1)};var O=new n,I=new n,g=new n;A.northEastDownToFixedFrame=function(e,t,r){if(_.equalsEpsilon(e.x,0,_.EPSILON14)&&_.equalsEpsilon(e.y,0,_.EPSILON14)){var a=_.sign(e.z);return u(r)?(r[0]=-a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=-a,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(-a,0,0,e.x,0,1,0,e.y,0,0,-a,e.z,0,0,0,1)}var i=O,s=I,c=g;return t=o(t,f.WGS84),t.geodeticSurfaceNormal(e,i),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(i,s,c),u(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=s.x,r[5]=s.y,r[6]=s.z,r[7]=0,r[8]=-i.x,r[9]=-i.y,r[10]=-i.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(c.x,s.x,-i.x,e.x,c.y,s.y,-i.y,e.y,c.z,s.z,-i.z,e.z,0,0,0,1)},A.northUpEastToFixedFrame=function(e,t,r){if(_.equalsEpsilon(e.x,0,_.EPSILON14)&&_.equalsEpsilon(e.y,0,_.EPSILON14)){var a=_.sign(e.z);return u(r)?(r[0]=-a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=a,r[7]=0,r[8]=0,r[9]=1,r[10]=0,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(-a,0,0,e.x,0,0,1,e.y,0,a,0,e.z,0,0,0,1)}var i=S,s=v,c=N;return t=o(t,f.WGS84),t.geodeticSurfaceNormal(e,i),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(i,s,c),u(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=i.x,r[5]=i.y,r[6]=i.z,r[7]=0,r[8]=s.x,r[9]=s.y,r[10]=s.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(c.x,i.x,s.x,e.x,c.y,i.y,s.y,e.y,c.z,i.z,s.z,e.z,0,0,0,1)},A.northWestUpToFixedFrame=function(e,t,r){if(_.equalsEpsilon(e.x,0,_.EPSILON14)&&_.equalsEpsilon(e.y,0,_.EPSILON14)){var a=_.sign(e.z);return u(r)?(r[0]=-a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=a,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(-a,0,0,e.x,0,-1,0,e.y,0,0,a,e.z,0,0,0,1)}var i=S,s=v,c=N;return t=o(t,f.WGS84),t.geodeticSurfaceNormal(e,i),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(i,s,c),u(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=-s.x,r[5]=-s.y,r[6]=-s.z,r[7]=0,r[8]=i.x,r[9]=i.y,r[10]=i.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(c.x,-s.x,i.x,e.x,c.y,-s.y,i.y,e.y,c.z,-s.z,i.z,e.z,0,0,0,1)};var M=new T,x=new n(1,1,1),w=new y;A.headingPitchRollToFixedFrame=function(e,t,r,a){i.typeOf.object("headingPitchRoll",t);var o=t.heading,u=t.pitch,s=t.roll,c=T.fromHeadingPitchRoll(o,u,s,M),l=y.fromTranslationQuaternionRotationScale(n.ZERO,c,x,w);return a=A.eastNorthUpToFixedFrame(e,r,a),y.multiply(a,l,a)};var C=new y,P=new p;A.headingPitchRollQuaternion=function(e,t,n,r){i.typeOf.object("headingPitchRoll",t);var a=A.headingPitchRollToFixedFrame(e,t,n,C),o=y.getRotation(a,P);return T.fromRotationMatrix(o,r)};var U=24110.54841,D=8640184.812866,L=.093104,F=-62e-7,z=1.1772758384668e-19,B=72921158553e-15,b=_.TWO_PI/86400,G=new m;A.computeTemeToPseudoFixedMatrix=function(e,t){G=m.addSeconds(e,-m.computeTaiMinusUtc(e),G);var n,r=G.dayNumber,a=G.secondsOfDay,i=r-2451545;n=a>=43200?(i+.5)/R.DAYS_PER_JULIAN_CENTURY:(i-.5)/R.DAYS_PER_JULIAN_CENTURY;var o=U+n*(D+n*(L+n*F)),s=o*b%_.TWO_PI,c=B+z*(r-2451545.5),l=(a+.5*R.SECONDS_PER_DAY)%R.SECONDS_PER_DAY,f=s+c*l,h=Math.cos(f),E=Math.sin(f);return u(t)?(t[0]=h,t[1]=-E,t[2]=0,t[3]=E,t[4]=h,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new p(h,E,0,-E,h,0,0,0,1)},A.iau2006XysData=new E,A.earthOrientationParameters=c.NONE;var q=32.184,W=2451545;A.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+q,a=t.stop.dayNumber,i=t.stop.secondsOfDay+q,o=A.iau2006XysData.preload(n,r,a,i),u=A.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},A.computeIcrfToFixedMatrix=function(e,t){u(t)||(t=new p);var n=A.computeFixedToIcrfMatrix(e,t);if(u(n))return p.transpose(n,t)};var X=new d(0,0,0),H=new l(0,0,0,0,0,0),V=new p,Y=new p;A.computeFixedToIcrfMatrix=function(e,t){u(t)||(t=new p);var n=A.earthOrientationParameters.compute(e,H);if(u(n)){var r=e.dayNumber,a=e.secondsOfDay+q,i=A.iau2006XysData.computeXysRadians(r,a,X);if(u(i)){var o=i.x+n.xPoleOffset,s=i.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-o*o-s*s)),l=V;l[0]=1-c*o*o,l[3]=-c*o*s,l[6]=o,l[1]=-c*o*s,l[4]=1-c*s*s,l[7]=s,l[2]=-o,l[5]=-s,l[8]=1-c*(o*o+s*s);var f=p.fromRotationZ(-i.s,Y),h=p.multiply(l,f,V),E=e.dayNumber,d=e.secondsOfDay-m.computeTaiMinusUtc(e)+n.ut1MinusUtc,y=E-2451545,T=d/R.SECONDS_PER_DAY,S=.779057273264+T+.00273781191135448*(y+T);S=S%1*_.TWO_PI;var v=p.fromRotationZ(S,Y),N=p.multiply(h,v,V),O=Math.cos(n.xPoleWander),I=Math.cos(n.yPoleWander),g=Math.sin(n.xPoleWander),M=Math.sin(n.yPoleWander),x=r-W+a/R.SECONDS_PER_DAY;x/=36525;var w=-47e-6*x*_.RADIANS_PER_DEGREE/3600,C=Math.cos(w),P=Math.sin(w),U=Y;return U[0]=O*C,U[1]=O*P,U[2]=g,U[3]=-I*P+M*g*C,U[4]=I*C+M*g*P,U[5]=-M*O,U[6]=-M*P-I*g*C,U[7]=M*C-I*g*P,U[8]=I*O,p.multiply(N,U,t)}}};var k=new r;A.pointToWindowCoordinates=function(e,t,n,r){return r=A.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},A.pointToGLWindowCoordinates=function(e,n,a,i){u(i)||(i=new t);var o=k;return y.multiplyByVector(e,r.fromElements(a.x,a.y,a.z,1,o),o),r.multiplyByScalar(o,1/o.w,o),y.multiplyByVector(n,o,o),t.fromCartesian4(o,i)};var Z=new n,j=new n,K=new n;A.rotationMatrixFromPositionVelocity=function(e,t,r,a){var i=o(r,f.WGS84).geodeticSurfaceNormal(e,Z),s=n.cross(t,i,j);n.equalsEpsilon(s,n.ZERO,_.EPSILON6)&&(s=n.clone(n.UNIT_X,s));var c=n.cross(s,t,K);return n.cross(t,c,s),n.negate(s,s),u(a)||(a=new p),a[0]=t.x,a[1]=t.y,a[2]=t.z,a[3]=s.x,a[4]=s.y,a[5]=s.z,a[6]=c.x,a[7]=c.y,a[8]=c.z,a};var J=new a,Q=new n,$=new n,ee=new r,te=new r,ne=new r,re=new r,ae=new r,ie=new y,oe=new y;A.basisTo2D=function(e,t,a){var i=e.ellipsoid,o=y.getColumn(t,3,ee),u=i.cartesianToCartographic(o,J),s=A.eastNorthUpToFixedFrame(o,i,ie),c=y.inverseTransformation(s,oe),l=e.project(u,Q),f=te;f.x=l.z,f.y=l.x,f.z=l.y,f.w=1;var h=y.getColumn(t,0,$),E=n.magnitude(h),d=y.multiplyByVector(c,h,ne);r.fromElements(d.z,d.x,d.y,0,d);var m=y.getColumn(t,1,$),_=n.magnitude(m),p=y.multiplyByVector(c,m,re);r.fromElements(p.z,p.x,p.y,0,p);var T=y.getColumn(t,2,$),R=n.magnitude(T),S=ae;return n.cross(d,p,S),n.normalize(S,S),n.cross(p,S,d),n.normalize(d,d),n.cross(S,d,p),n.normalize(p,p),n.multiplyByScalar(d,E,d),n.multiplyByScalar(p,_,p),n.multiplyByScalar(S,R,S),y.setColumn(a,0,d,a),y.setColumn(a,1,p,a),y.setColumn(a,2,S,a),y.setColumn(a,3,f,a),a};var ue=new y(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);return A.wgs84To2DModelMatrix=function(e,t,n){var r=e.ellipsoid,a=A.eastNorthUpToFixedFrame(t,r,ie),i=y.inverseTransformation(a,oe),o=r.cartesianToCartographic(t,J),u=e.project(o,Q),s=te;s.x=u.z,s.y=u.x,s.z=u.y,s.w=1;var c=y.fromTranslation(s,ie);return y.multiply(ue,i,n),y.multiply(c,n,n),n},A}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,E){"use strict";function d(e,t){t=a(t,s.WGS84),e=t.scaleToGeodeticSurface(e);var r=E.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=n.fromCartesian4(l.getColumn(r,0,m)),this._yAxis=n.fromCartesian4(l.getColumn(r,1,m));var i=n.fromCartesian4(l.getColumn(r,2,m));this._plane=f.fromPointNormal(e,i)}var m=new r;o(d.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var _=new e;d.fromPoints=function(t,n){var r=e.fromPoints(t,_);return new d(r.center,n)};var p=new h,y=new n;d.prototype.projectPointOntoPlane=function(e,r){var a=p;a.origin=e,n.normalize(e,a.direction);var o=c.rayPlane(a,this._plane,y);if(i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,y)),i(o)){var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return i(r)?(r.x=s,r.y=l,r):new t(s,l)}},d.prototype.projectPointsOntoPlane=function(e,t){i(t)||(t=[]);for(var n=0,r=e.length,a=0;a<r;a++){var o=this.projectPointOntoPlane(e[a],t[n]);i(o)&&(t[n]=o,n++)}return t.length=n,t},d.prototype.projectPointToNearestOnPlane=function(e,r){i(r)||(r=new t);var a=p;a.origin=e,n.clone(this._plane.normal,a.direction);var o=c.rayPlane(a,this._plane,y);i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,y));var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return r.x=s,r.y=l,r},d.prototype.projectPointsToNearestOnPlane=function(e,t){i(t)||(t=[]);var n=e.length;t.length=n;for(var r=0;r<n;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var T=new n;return d.prototype.projectPointsOntoEllipsoid=function(e,t){var r=e.length;i(t)?t.length=r:t=new Array(r);for(var a=this._ellipsoid,o=this._origin,u=this._xAxis,s=this._yAxis,c=T,l=0;l<r;++l){var f=e[l];n.multiplyByScalar(u,f.x,c),i(t[l])||(t[l]=new n);var h=n.add(o,c,t[l]);n.multiplyByScalar(s,f.y,c),n.add(h,c,h),a.scaleToGeocentricSurface(h,h)}return t},d}),define("ThirdParty/earcut-2.1.1",[],function(){"use strict";function e(e,n,a){a=a||2;var i=n&&n.length,o=i?n[0]*a:e.length,u=t(e,0,o,a,!0),c=[];if(!u)return c;var l,f,h,E,d,m,_;if(i&&(u=s(e,n,u,a)),e.length>80*a){l=h=e[0],f=E=e[1];for(var p=a;p<o;p+=a)d=e[p],m=e[p+1],d<l&&(l=d),m<f&&(f=m),d>h&&(h=d),m>E&&(E=m);_=Math.max(h-l,E-f)}return r(u,c,a,l,f,_),c}function t(e,t,n,r,a){var i,o;if(a===M(e,t,n,r)>0)for(i=t;i<n;i+=r)o=O(i,e[i],e[i+1],o);else for(i=n-r;i>=t;i-=r)o=O(i,e[i],e[i+1],o);return o&&T(o,o.next)&&(I(o),o=o.next),o}function n(e,t){if(!e)return e;t||(t=e);var n,r=e;do if(n=!1,r.steiner||!T(r,r.next)&&0!==y(r.prev,r,r.next))r=r.next;else{if(I(r),r=t=r.prev,r===r.next)return null;n=!0}while(n||r!==t);return t}function r(e,t,s,c,l,f,E){if(e){!E&&f&&h(e,c,l,f);for(var d,m,_=e;e.prev!==e.next;)if(d=e.prev,m=e.next,f?i(e,c,l,f):a(e))t.push(d.i/s),t.push(e.i/s),t.push(m.i/s),I(e),e=m.next,_=m.next;else if(e=m,e===_){E?1===E?(e=o(e,t,s),r(e,t,s,c,l,f,2)):2===E&&u(e,t,s,c,l,f):r(n(e),t,s,c,l,f,1);break}}}function a(e){var t=e.prev,n=e,r=e.next;if(y(t,n,r)>=0)return!1;for(var a=e.next.next;a!==e.prev;){if(_(t.x,t.y,n.x,n.y,r.x,r.y,a.x,a.y)&&y(a.prev,a,a.next)>=0)return!1;a=a.next}return!0}function i(e,t,n,r){var a=e.prev,i=e,o=e.next;if(y(a,i,o)>=0)return!1;for(var u=a.x<i.x?a.x<o.x?a.x:o.x:i.x<o.x?i.x:o.x,s=a.y<i.y?a.y<o.y?a.y:o.y:i.y<o.y?i.y:o.y,c=a.x>i.x?a.x>o.x?a.x:o.x:i.x>o.x?i.x:o.x,l=a.y>i.y?a.y>o.y?a.y:o.y:i.y>o.y?i.y:o.y,f=d(u,s,t,n,r),h=d(c,l,t,n,r),E=e.nextZ;E&&E.z<=h;){if(E!==e.prev&&E!==e.next&&_(a.x,a.y,i.x,i.y,o.x,o.y,E.x,E.y)&&y(E.prev,E,E.next)>=0)return!1;E=E.nextZ}for(E=e.prevZ;E&&E.z>=f;){if(E!==e.prev&&E!==e.next&&_(a.x,a.y,i.x,i.y,o.x,o.y,E.x,E.y)&&y(E.prev,E,E.next)>=0)return!1;E=E.prevZ}return!0}function o(e,t,n){var r=e;do{var a=r.prev,i=r.next.next;!T(a,i)&&R(a,r,r.next,i)&&S(a,i)&&S(i,a)&&(t.push(a.i/n),t.push(r.i/n),t.push(i.i/n),I(r),I(r.next),r=e=i),r=r.next}while(r!==e);return r}function u(e,t,a,i,o,u){var s=e;do{for(var c=s.next.next;c!==s.prev;){if(s.i!==c.i&&p(s,c)){var l=N(s,c);return s=n(s,s.next),l=n(l,l.next),r(s,t,a,i,o,u),void r(l,t,a,i,o,u)}c=c.next}s=s.next}while(s!==e)}function s(e,r,a,i){var o,u,s,f,h,E=[];for(o=0,u=r.length;o<u;o++)s=r[o]*i,f=o<u-1?r[o+1]*i:e.length,h=t(e,s,f,i,!1),h===h.next&&(h.steiner=!0),E.push(m(h));for(E.sort(c),o=0;o<E.length;o++)l(E[o],a),a=n(a,a.next);return a}function c(e,t){return e.x-t.x}function l(e,t){if(t=f(e,t)){var r=N(t,e);n(r,r.next)}}function f(e,t){var n,r=t,a=e.x,i=e.y,o=-(1/0);do{if(i<=r.y&&i>=r.next.y){var u=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(u<=a&&u>o){if(o=u,u===a){if(i===r.y)return r;if(i===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(a===o)return n.prev;var s,c=n,l=n.x,f=n.y,h=1/0;for(r=n.next;r!==c;)a>=r.x&&r.x>=l&&_(i<f?a:o,i,l,f,i<f?o:a,i,r.x,r.y)&&(s=Math.abs(i-r.y)/(a-r.x),(s<h||s===h&&r.x>n.x)&&S(r,e)&&(n=r,h=s)),r=r.next;return n}function h(e,t,n,r){var a=e;do null===a.z&&(a.z=d(a.x,a.y,t,n,r)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next;while(a!==e);a.prevZ.nextZ=null,a.prevZ=null,E(a)}function E(e){var t,n,r,a,i,o,u,s,c=1;do{for(n=e,e=null,i=null,o=0;n;){for(o++,r=n,u=0,t=0;t<c&&(u++,r=r.nextZ,r);t++);for(s=c;u>0||s>0&&r;)0===u?(a=r,r=r.nextZ,s--):0!==s&&r?n.z<=r.z?(a=n,n=n.nextZ,u--):(a=r,r=r.nextZ,s--):(a=n,n=n.nextZ,u--),i?i.nextZ=a:e=a,a.prevZ=i,i=a;n=r}i.nextZ=null,c*=2}while(o>1);return e}function d(e,t,n,r,a){return e=32767*(e-n)/a,t=32767*(t-r)/a,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function m(e){var t=e,n=e;do t.x<n.x&&(n=t),t=t.next;while(t!==e);return n}function _(e,t,n,r,a,i,o,u){return(a-o)*(t-u)-(e-o)*(i-u)>=0&&(e-o)*(r-u)-(n-o)*(t-u)>=0&&(n-o)*(i-u)-(a-o)*(r-u)>=0}function p(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!A(e,t)&&S(e,t)&&S(t,e)&&v(e,t)}function y(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function T(e,t){return e.x===t.x&&e.y===t.y}function R(e,t,n,r){return!!(T(e,t)&&T(n,r)||T(e,r)&&T(n,t))||y(e,t,n)>0!=y(e,t,r)>0&&y(n,r,e)>0!=y(n,r,t)>0}function A(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&R(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function S(e,t){return y(e.prev,e,e.next)<0?y(e,t,e.next)>=0&&y(e,e.prev,t)>=0:y(e,t,e.prev)<0||y(e,e.next,t)<0}function v(e,t){var n=e,r=!1,a=(e.x+t.x)/2,i=(e.y+t.y)/2;do n.y>i!=n.next.y>i&&a<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function N(e,t){var n=new g(e.i,e.x,e.y),r=new g(t.i,t.x,t.y),a=e.next,i=t.prev;return e.next=t,t.prev=e,n.next=a,a.prev=n,r.next=n,n.prev=r,i.next=r,r.prev=i,r}function O(e,t,n,r){var a=new g(e,t,n);return r?(a.next=r.next,a.prev=r,r.next.prev=a,r.next=a):(a.prev=a,a.next=a),a}function I(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function g(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function M(e,t,n,r){for(var a=0,i=t,o=n-r;i<n;i+=r)a+=(e[o]-e[i])*(e[i+1]+e[o+1]),o=i;return a}return e.deviation=function(e,t,n,r){var a=t&&t.length,i=a?t[0]*n:e.length,o=Math.abs(M(e,0,i,n));if(a)for(var u=0,s=t.length;u<s;u++){var c=t[u]*n,l=u<s-1?t[u+1]*n:e.length;o-=Math.abs(M(e,c,l,n))}var f=0;for(u=0;u<r.length;u+=3){var h=r[u]*n,E=r[u+1]*n,d=r[u+2]*n;f+=Math.abs((e[h]-e[d])*(e[E+1]-e[h+1])-(e[h]-e[E])*(e[d+1]-e[h+1]))}return 0===o&&0===f?0:Math.abs((f-o)/o)},e.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,a=0;a<e.length;a++){for(var i=0;i<e[a].length;i++)for(var o=0;o<t;o++)n.vertices.push(e[a][i][o]);a>0&&(r+=e[a-1].length,n.holes.push(r))}return n},e}),define("Core/WindingOrder",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={CLOCKWISE:t.CW,COUNTER_CLOCKWISE:t.CCW,validate:function(e){return e===n.CLOCKWISE||e===n.COUNTER_CLOCKWISE}};return e(n)}),define("Core/PolygonPipeline",["../ThirdParty/earcut-2.1.1","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./Math","./PrimitiveType","./WindingOrder"],function(e,t,n,r,a,i,o,u,s,c,l,f,h){"use strict";var E=new n,d=new n,m={};m.computeArea2D=function(e){for(var t=e.length,n=0,r=t-1,a=0;a<t;r=a++){var i=e[r],o=e[a];n+=i.x*o.y-o.x*i.y}return.5*n},m.computeWindingOrder2D=function(e){var t=m.computeArea2D(e);return t>0?h.COUNTER_CLOCKWISE:h.CLOCKWISE},m.triangulate=function(n,r){var a=t.packArray(n);return e(a,r,2)};var _=new n,p=new n,y=new n,T=new n,R=new n,A=new n,S=new n;return m.computeSubdivision=function(e,t,o,u){u=a(u,l.RADIANS_PER_DEGREE);var h,E=o.slice(0),d=t.length,m=new Array(3*d),v=0;for(h=0;h<d;h++){var N=t[h];m[v++]=N.x,m[v++]=N.y,m[v++]=N.z}for(var O=[],I={},g=e.maximumRadius,M=l.chordLength(u,g),x=M*M;E.length>0;){var w,C,P=E.pop(),U=E.pop(),D=E.pop(),L=n.fromArray(m,3*D,_),F=n.fromArray(m,3*U,p),z=n.fromArray(m,3*P,y),B=n.multiplyByScalar(n.normalize(L,T),g,T),b=n.multiplyByScalar(n.normalize(F,R),g,R),G=n.multiplyByScalar(n.normalize(z,A),g,A),q=n.magnitudeSquared(n.subtract(B,b,S)),W=n.magnitudeSquared(n.subtract(b,G,S)),X=n.magnitudeSquared(n.subtract(G,B,S)),H=Math.max(q,W,X);H>x?q===H?(w=Math.min(D,U)+" "+Math.max(D,U),h=I[w],i(h)||(C=n.add(L,F,S),n.multiplyByScalar(C,.5,C),m.push(C.x,C.y,C.z),h=m.length/3-1,I[w]=h),E.push(D,h,P),E.push(h,U,P)):W===H?(w=Math.min(U,P)+" "+Math.max(U,P),h=I[w],i(h)||(C=n.add(F,z,S),n.multiplyByScalar(C,.5,C),m.push(C.x,C.y,C.z),h=m.length/3-1,I[w]=h),E.push(U,h,D),E.push(h,P,D)):X===H&&(w=Math.min(P,D)+" "+Math.max(P,D),h=I[w],i(h)||(C=n.add(z,L,S),n.multiplyByScalar(C,.5,C),m.push(C.x,C.y,C.z),h=m.length/3-1,I[w]=h),E.push(P,h,U),E.push(h,D,U)):(O.push(D),O.push(U),O.push(P))}return new s({attributes:{position:new c({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:m})},indices:O,primitiveType:f.TRIANGLES})},m.scaleToGeodeticHeight=function(e,t,r,o){r=a(r,u.WGS84);var s=E,c=d;if(t=a(t,0),o=a(o,!0),i(e))for(var l=e.length,f=0;f<l;f+=3)n.fromArray(e,f,c),o&&(c=r.scaleToGeodeticSurface(c,c)),0!==t&&(s=r.geodeticSurfaceNormal(c,s),n.multiplyByScalar(s,t,s),n.add(c,s,c)),e[f]=c.x,e[f+1]=c.y,e[f+2]=c.z;return e},m}),define("Core/EllipsoidGeodesic",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){var t=e._uSquared,n=e._ellipsoid.maximumRadius,r=e._ellipsoid.minimumRadius,a=(n-r)/n,i=Math.cos(e._startHeading),o=Math.sin(e._startHeading),u=(1-a)*Math.tan(e._start.latitude),s=1/Math.sqrt(1+u*u),c=s*u,l=Math.atan2(u,i),f=s*o,h=f*f,E=1-h,d=Math.sqrt(E),m=t/4,_=m*m,p=_*m,y=_*_,T=1+m-3*_/4+5*p/4-175*y/64,R=1-m+15*_/8-35*p/8,A=1-3*m+35*_/4,S=1-5*m,v=T*l-R*Math.sin(2*l)*m/2-A*Math.sin(4*l)*_/16-S*Math.sin(6*l)*p/48-5*Math.sin(8*l)*y/512,N=e._constants;N.a=n,N.b=r,N.f=a,N.cosineHeading=i,N.sineHeading=o,N.tanU=u,N.cosineU=s,N.sineU=c,N.sigma=l,N.sineAlpha=f,N.sineSquaredAlpha=h,N.cosineSquaredAlpha=E,N.cosineAlpha=d,N.u2Over4=m,N.u4Over16=_,N.u6Over64=p,N.u8Over256=y,N.a0=T,N.a1=R,N.a2=A,N.a3=S,N.distanceRatio=v}function c(e,t){return e*t*(4+e*(4-3*t))/16}function l(e,t,n,r,a,i,o){var u=c(e,n);return(1-u)*e*t*(r+u*a*(o+u*i*(2*o*o-1)))}function f(e,t,n,r,a,i,o){var s,c,f,h,E,d=(t-n)/t,m=i-r,_=Math.atan((1-d)*Math.tan(a)),p=Math.atan((1-d)*Math.tan(o)),y=Math.cos(_),T=Math.sin(_),R=Math.cos(p),A=Math.sin(p),S=y*R,v=y*A,N=T*A,O=T*R,I=m,g=u.TWO_PI,M=Math.cos(I),x=Math.sin(I);do{M=Math.cos(I),x=Math.sin(I);var w=v-O*M;f=Math.sqrt(R*R*x*x+w*w),c=N+S*M,s=Math.atan2(f,c);var C;0===f?(C=0,h=1):(C=S*x/f,h=1-C*C),g=I,E=c-2*N/h,isNaN(E)&&(E=0),I=m+l(d,C,h,s,f,c,E)}while(Math.abs(I-g)>u.EPSILON12);var P=h*(t*t-n*n)/(n*n),U=1+P*(4096+P*(P*(320-175*P)-768))/16384,D=P*(256+P*(P*(74-47*P)-128))/1024,L=E*E,F=D*f*(E+D*(c*(2*L-1)-D*E*(4*f*f-3)*(4*L-3)/6)/4),z=n*U*(s-F),B=Math.atan2(R*x,v-O*M),b=Math.atan2(y*x,v*M-O);e._distance=z,e._startHeading=B,e._endHeading=b,e._uSquared=P}function h(n,r,a,i){e.normalize(i.cartographicToCartesian(r,m),d),e.normalize(i.cartographicToCartesian(a,m),m);f(n,i.maximumRadius,i.minimumRadius,r.longitude,r.latitude,a.longitude,a.latitude),n._start=t.clone(r,n._start),n._end=t.clone(a,n._end),n._start.height=0,n._end.height=0,s(n)}function E(e,a,i){var u=n(i,o.WGS84);this._ellipsoid=u,this._start=new t,this._end=new t,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,r(e)&&r(a)&&h(this,e,a,u)}var d=new e,m=new e;return a(E.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return this._startHeading}},endHeading:{get:function(){return this._endHeading}}}),E.prototype.setEndPoints=function(e,t){h(this,e,t,this._ellipsoid)},E.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},E.prototype.interpolateUsingSurfaceDistance=function(e,n){var a=this._constants,i=a.distanceRatio+e/a.b,o=Math.cos(2*i),u=Math.cos(4*i),s=Math.cos(6*i),c=Math.sin(2*i),f=Math.sin(4*i),h=Math.sin(6*i),E=Math.sin(8*i),d=i*i,m=i*d,_=a.u8Over256,p=a.u2Over4,y=a.u6Over64,T=a.u4Over16,R=2*m*_*o/3+i*(1-p+7*T/4-15*y/4+579*_/64-(T-15*y/4+187*_/16)*o-(5*y/4-115*_/16)*u-29*_*s/16)+(p/2-T+71*y/32-85*_/16)*c+(5*T/16-5*y/4+383*_/96)*f-d*((y-11*_/2)*c+5*_*f/2)+(29*y/96-29*_/16)*h+539*_*E/1536,A=Math.asin(Math.sin(R)*a.cosineAlpha),S=Math.atan(a.a/a.b*Math.tan(A)); +R-=a.sigma;var v=Math.cos(2*a.sigma+R),N=Math.sin(R),O=Math.cos(R),I=a.cosineU*O,g=a.sineU*N,M=Math.atan2(N*a.sineHeading,I-g*a.cosineHeading),x=M-l(a.f,a.sineAlpha,a.cosineSquaredAlpha,R,N,O,v);return r(n)?(n.longitude=this._start.longitude+x,n.latitude=S,n.height=0,n):new t(this._start.longitude+x,S,0)},E}),define("Core/isArray",["./defined"],function(e){"use strict";var t=Array.isArray;return e(t)||(t=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),t}),define("Core/PolylinePipeline",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidGeodesic","./IntersectionTests","./isArray","./Math","./Matrix4","./Plane"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(e,t,n){var r=N;r.length=e;var a;if(t===n){for(a=0;a<e;a++)r[a]=t;return r}var i=n-t,o=i/e;for(a=0;a<e;a++){var u=t+a*o;r[a]=u}return r}function E(t,n,r,a,i,o,u,s){var c=a.scaleToGeodeticSurface(t,M),l=a.scaleToGeodeticSurface(n,x),f=d.numberOfPoints(t,n,r),E=a.cartesianToCartographic(c,O),m=a.cartesianToCartographic(l,I),_=h(f,i,o);w.setEndPoints(E,m);var p=w.surfaceDistance/f,y=s;E.height=i;var T=a.cartographicToCartesian(E,g);e.pack(T,u,y),y+=3;for(var R=1;R<f;R++){var A=w.interpolateUsingSurfaceDistance(R*p,I);A.height=_[R],T=a.cartographicToCartesian(A,g),e.pack(T,u,y),y+=3}return y}var d={};d.numberOfPoints=function(t,n,r){var a=e.distance(t,n);return Math.ceil(a/r)};var m=new t;d.extractHeights=function(e,t){for(var n=e.length,r=new Array(n),a=0;a<n;a++){var i=e[a];r[a]=t.cartesianToCartographic(i,m).height}return r};var _=new l,p=new e,y=new e,T=new f(e.ZERO,0),R=new e,A=new f(e.ZERO,0),S=new e,v=new e,N=[],O=new t,I=new t,g=new e,M=new e,x=new e,w=new o;return d.wrapLongitude=function(t,a){var i=[],o=[];if(r(t)&&t.length>0){a=n(a,l.IDENTITY);var s=l.inverseTransformation(a,_),c=l.multiplyByPoint(s,e.ZERO,p),h=l.multiplyByPointAsVector(s,e.UNIT_Y,y),E=f.fromPointNormal(c,h,T),d=l.multiplyByPointAsVector(s,e.UNIT_X,R),m=f.fromPointNormal(c,d,A),N=1;i.push(e.clone(t[0]));for(var O=i[0],I=t.length,g=1;g<I;++g){var M=t[g];if(f.getPointDistance(m,O)<0||f.getPointDistance(m,M)<0){var x=u.lineSegmentPlane(O,M,E,S);if(r(x)){var w=e.multiplyByScalar(h,5e-9,v);f.getPointDistance(E,O)<0&&e.negate(w,w),i.push(e.add(x,w,new e)),o.push(N+1),e.negate(w,w),i.push(e.add(x,w,new e)),N=1}}i.push(e.clone(t[g])),N++,O=M}o.push(N)}return{positions:i,lengths:o}},d.generateArc=function(t){r(t)||(t={});var a=t.positions,o=a.length,u=n(t.ellipsoid,i.WGS84),l=n(t.height,0),f=s(l);if(o<1)return[];if(1===o){var h=u.scaleToGeodeticSurface(a[0],M);if(l=f?l[0]:l,0!==l){var m=u.geodeticSurfaceNormal(h,g);e.multiplyByScalar(m,l,m),e.add(h,m,h)}return[h.x,h.y,h.z]}var _=t.minDistance;if(!r(_)){var p=n(t.granularity,c.RADIANS_PER_DEGREE);_=c.chordLength(p,u.maximumRadius)}var y,T=0;for(y=0;y<o-1;y++)T+=d.numberOfPoints(a[y],a[y+1],_);var R=3*(T+1),A=new Array(R),S=0;for(y=0;y<o-1;y++){var v=a[y],I=a[y+1],x=f?l[y]:l,w=f?l[y+1]:l;S=E(v,I,_,u,x,w,A,S)}N.length=0;var C=a[o-1],P=u.cartesianToCartographic(C,O);P.height=f?l[o-1]:l;var U=u.cartographicToCartesian(P,g);return e.pack(U,A,R-3),A},d.generateCartesianArc=function(t){for(var n=d.generateArc(t),r=n.length/3,a=new Array(r),i=0;i<r;i++)a[i]=e.unpack(n,3*i);return a},d}),define("Core/WallGeometryLibrary",["./Cartographic","./defined","./EllipsoidTangentPlane","./Math","./PolygonPipeline","./PolylinePipeline","./WindingOrder"],function(e,t,n,r,a,i,o){"use strict";function u(e,t){return r.equalsEpsilon(e.latitude,t.latitude,r.EPSILON14)&&r.equalsEpsilon(e.longitude,t.longitude,r.EPSILON14)}function s(n,r,a,i){var o=r.length;if(!(o<2)){var s=t(i),c=t(a),h=!0,E=new Array(o),d=new Array(o),m=new Array(o),_=r[0];E[0]=_;var p=n.cartesianToCartographic(_,l);c&&(p.height=a[0]),h=h&&p.height<=0,d[0]=p.height,s?m[0]=i[0]:m[0]=0;for(var y=1,T=1;T<o;++T){var R=r[T],A=n.cartesianToCartographic(R,f);c&&(A.height=a[T]),h=h&&A.height<=0,u(p,A)?p.height<A.height&&(d[y-1]=A.height):(E[y]=R,d[y]=A.height,s?m[y]=i[T]:m[y]=0,e.clone(A,p),++y)}if(!(h||y<2))return E.length=y,d.length=y,m.length=y,{positions:E,topHeights:d,bottomHeights:m}}}var c={},l=new e,f=new e,h=new Array(2),E=new Array(2),d={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};return c.computePositions=function(e,u,c,l,f,m){var _=s(e,u,c,l);if(t(_)){if(u=_.positions,c=_.topHeights,l=_.bottomHeights,u.length>=3){var p=n.fromPoints(u,e),y=p.projectPointsOntoPlane(u);a.computeWindingOrder2D(y)===o.CLOCKWISE&&(u.reverse(),c.reverse(),l.reverse())}var T,R,A=u.length,S=A-2,v=r.chordLength(f,e.maximumRadius),N=d;if(N.minDistance=v,N.ellipsoid=e,m){var O,I=0;for(O=0;O<A-1;O++)I+=i.numberOfPoints(u[O],u[O+1],v)+1;T=new Float64Array(3*I),R=new Float64Array(3*I);var g=h,M=E;N.positions=g,N.height=M;var x=0;for(O=0;O<A-1;O++){g[0]=u[O],g[1]=u[O+1],M[0]=c[O],M[1]=c[O+1];var w=i.generateArc(N);T.set(w,x),M[0]=l[O],M[1]=l[O+1],R.set(i.generateArc(N),x),x+=w.length}}else N.positions=u,N.height=c,T=new Float64Array(i.generateArc(N)),N.height=l,R=new Float64Array(i.generateArc(N));return{bottomPositions:R,topPositions:T,numCorners:S}}},c}),define("Core/WallGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./VertexFormat","./WallGeometryLibrary"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,E,d){"use strict";function m(e){e=r(e,r.EMPTY_OBJECT);var n=e.positions,i=e.maximumHeights,u=e.minimumHeights,s=r(e.vertexFormat,E.DEFAULT),c=r(e.granularity,f.RADIANS_PER_DEGREE),l=r(e.ellipsoid,o.WGS84);this._positions=n,this._minimumHeights=u,this._maximumHeights=i,this._vertexFormat=E.clone(s),this._granularity=c,this._ellipsoid=o.clone(l),this._workerName="createWallGeometry";var h=1+n.length*t.packedLength+2;a(u)&&(h+=u.length),a(i)&&(h+=i.length),this.packedLength=h+o.packedLength+E.packedLength+1}var _=new t,p=new t,y=new t,T=new t,R=new t,A=new t,S=new t,v=new t;m.pack=function(e,n,i){i=r(i,0);var u,s=e._positions,c=s.length;for(n[i++]=c,u=0;u<c;++u,i+=t.packedLength)t.pack(s[u],n,i);var l=e._minimumHeights;if(c=a(l)?l.length:0,n[i++]=c,a(l))for(u=0;u<c;++u)n[i++]=l[u];var f=e._maximumHeights;if(c=a(f)?f.length:0,n[i++]=c,a(f))for(u=0;u<c;++u)n[i++]=f[u];return o.pack(e._ellipsoid,n,i),i+=o.packedLength,E.pack(e._vertexFormat,n,i),i+=E.packedLength,n[i]=e._granularity,n};var N=o.clone(o.UNIT_SPHERE),O=new E,I={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:N,vertexFormat:O,granularity:void 0};return m.unpack=function(e,n,i){n=r(n,0);var u,s=e[n++],c=new Array(s);for(u=0;u<s;++u,n+=t.packedLength)c[u]=t.unpack(e,n);s=e[n++];var l;if(s>0)for(l=new Array(s),u=0;u<s;++u)l[u]=e[n++];s=e[n++];var f;if(s>0)for(f=new Array(s),u=0;u<s;++u)f[u]=e[n++];var h=o.unpack(e,n,N);n+=o.packedLength;var d=E.unpack(e,n,O);n+=E.packedLength;var _=e[n];return a(i)?(i._positions=c,i._minimumHeights=l,i._maximumHeights=f,i._ellipsoid=o.clone(h,i._ellipsoid),i._vertexFormat=E.clone(d,i._vertexFormat),i._granularity=_,i):(I.positions=c,I.minimumHeights=l,I.maximumHeights=f,I.granularity=_,new m(I))},m.fromConstantHeights=function(e){e=r(e,r.EMPTY_OBJECT);var t,n,i=e.positions,o=e.minimumHeight,u=e.maximumHeight,s=a(o),c=a(u);if(s||c){var l=i.length;t=s?new Array(l):void 0,n=c?new Array(l):void 0;for(var f=0;f<l;++f)s&&(t[f]=o),c&&(n[f]=u)}var h={positions:i,maximumHeights:n,minimumHeights:t,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat};return new m(h)},m.createGeometry=function(r){var i=r._positions,o=r._minimumHeights,E=r._maximumHeights,m=r._vertexFormat,N=r._granularity,O=r._ellipsoid,I=d.computePositions(O,i,E,o,N,!0);if(a(I)){var g=I.bottomPositions,M=I.topPositions,x=I.numCorners,w=M.length,C=2*w,P=m.position?new Float64Array(C):void 0,U=m.normal?new Float32Array(C):void 0,D=m.tangent?new Float32Array(C):void 0,L=m.bitangent?new Float32Array(C):void 0,F=m.st?new Float32Array(C/3*2):void 0,z=0,B=0,b=0,G=0,q=0,W=v,X=S,H=A,V=!0;w/=3;var Y,k=0,Z=1/(w-i.length+1);for(Y=0;Y<w;++Y){var j=3*Y,K=t.fromArray(M,j,_),J=t.fromArray(g,j,p);if(m.position&&(P[z++]=J.x,P[z++]=J.y,P[z++]=J.z,P[z++]=K.x,P[z++]=K.y,P[z++]=K.z),m.st&&(F[q++]=k,F[q++]=0,F[q++]=k,F[q++]=1),m.normal||m.tangent||m.bitangent){var Q,$=t.clone(t.ZERO,R),ee=O.scaleToGeodeticSurface(t.fromArray(M,j,p),p);if(Y+1<w&&(Q=O.scaleToGeodeticSurface(t.fromArray(M,j+3,y),y),$=t.fromArray(M,j+3,R)),V){var te=t.subtract($,K,T),ne=t.subtract(ee,K,_);W=t.normalize(t.cross(ne,te,W),W),V=!1}t.equalsEpsilon(Q,ee,f.EPSILON10)?V=!0:(k+=Z,m.tangent&&(X=t.normalize(t.subtract(Q,ee,X),X)),m.bitangent&&(H=t.normalize(t.cross(W,X,H),H))),m.normal&&(U[B++]=W.x,U[B++]=W.y,U[B++]=W.z,U[B++]=W.x,U[B++]=W.y,U[B++]=W.z),m.tangent&&(D[G++]=X.x,D[G++]=X.y,D[G++]=X.z,D[G++]=X.x,D[G++]=X.y,D[G++]=X.z),m.bitangent&&(L[b++]=H.x,L[b++]=H.y,L[b++]=H.z,L[b++]=H.x,L[b++]=H.y,L[b++]=H.z)}}var re=new c;m.position&&(re.position=new s({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:P})),m.normal&&(re.normal=new s({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:U})),m.tangent&&(re.tangent=new s({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:D})),m.bitangent&&(re.bitangent=new s({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:L})),m.st&&(re.st=new s({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:F}));var ae=C/3;C-=6*(x+1);var ie=l.createTypedArray(ae,C),oe=0;for(Y=0;Y<ae-2;Y+=2){var ue=Y,se=Y+2,ce=t.fromArray(P,3*ue,_),le=t.fromArray(P,3*se,p);if(!t.equalsEpsilon(ce,le,f.EPSILON10)){var fe=Y+1,he=Y+3;ie[oe++]=fe,ie[oe++]=ue,ie[oe++]=he,ie[oe++]=he,ie[oe++]=ue,ie[oe++]=se}}return new u({attributes:re,indices:ie,primitiveType:h.TRIANGLES,boundingSphere:new e.fromVertices(P)})}},m}),define("Workers/createWallGeometry",["../Core/defined","../Core/Ellipsoid","../Core/WallGeometry"],function(e,t,n){"use strict";function r(r,a){return e(a)&&(r=n.unpack(r,a)),r._ellipsoid=t.clone(r._ellipsoid),n.createGeometry(r)}return r})}(); \ No newline at end of file diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createWallOutlineGeometry.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createWallOutlineGeometry.js index 818a99c9..0cb2a1a2 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createWallOutlineGeometry.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/createWallOutlineGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -222,9 +222,9 @@ OTHER DEALINGS IN THE SOFTWARE. * */ -!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==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";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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("Core/isArray",["./defined"],function(e){"use strict";var t=Array.isArray;return e(t)||(t=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),t}),define("Core/Check",["./defaultValue","./defined","./DeveloperError","./isArray"],function(e,t,n,r){"use strict";function i(e){return e+" was required but undefined."}function a(e,t,n){return"Expected "+n+" to be typeof "+t+", got "+e}var o={};return o.typeOf={},o.numeric={},o.defined=function(e,r){if(!t(e))throw new n(i(r))},o.numeric.maximum=function(e,t){if(o.typeOf.number(e),o.typeOf.number(t),e>t)throw new n("Expected "+e+" to be at most "+t)},o.numeric.minimum=function(e,t){if(o.typeOf.number(e),o.typeOf.number(t),e<t)throw new n("Expected "+e+" to be at least "+t)},o.typeOf.function=function(e,t){if("function"!=typeof e)throw new n(a(typeof e,"function",t))},o.typeOf.string=function(e,t){if("string"!=typeof e)throw new n(a(typeof e,"string",t))},o.typeOf.number=function(e,t){if("number"!=typeof e)throw new n(a(typeof e,"number",t))},o.typeOf.object=function(e,t){if("object"!=typeof e)throw new n(a(typeof e,"object",t))},o.typeOf.boolean=function(e,t){if("boolean"!=typeof e)throw new n(a(typeof e,"boolean",t))},o}),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 n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(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^=e<<7&2636928640,e^=e<<15&4022730752,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,n,r){"use strict";var i={};i.EPSILON1=.1,i.EPSILON2=.01,i.EPSILON3=.001,i.EPSILON4=1e-4,i.EPSILON5=1e-5,i.EPSILON6=1e-6,i.EPSILON7=1e-7,i.EPSILON8=1e-8,i.EPSILON9=1e-9,i.EPSILON10=1e-10,i.EPSILON11=1e-11,i.EPSILON12=1e-12,i.EPSILON13=1e-13,i.EPSILON14=1e-14,i.EPSILON15=1e-15,i.EPSILON16=1e-16,i.EPSILON17=1e-17,i.EPSILON18=1e-18,i.EPSILON19=1e-19,i.EPSILON20=1e-20,i.GRAVITATIONALPARAMETER=3986004418e5,i.SOLAR_RADIUS=6955e5,i.LUNAR_RADIUS=1737400,i.SIXTY_FOUR_KILOBYTES=65536,i.sign=function(e){return e>0?1:e<0?-1:0},i.signNotZero=function(e){return e<0?-1:1},i.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*i.clamp(e,-1,1)+.5)*n)},i.fromSNorm=function(e,n){return n=t(n,255),i.clamp(e,0,n)/n*2-1},i.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},i.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},i.lerp=function(e,t,n){return(1-n)*e+n*t},i.PI=Math.PI,i.ONE_OVER_PI=1/Math.PI,i.PI_OVER_TWO=.5*Math.PI,i.PI_OVER_THREE=Math.PI/3,i.PI_OVER_FOUR=Math.PI/4,i.PI_OVER_SIX=Math.PI/6,i.THREE_PI_OVER_TWO=3*Math.PI*.5,i.TWO_PI=2*Math.PI,i.ONE_OVER_TWO_PI=1/(2*Math.PI),i.RADIANS_PER_DEGREE=Math.PI/180,i.DEGREES_PER_RADIAN=180/Math.PI,i.RADIANS_PER_ARCSECOND=i.RADIANS_PER_DEGREE/3600,i.toRadians=function(e){return e*i.RADIANS_PER_DEGREE},i.toDegrees=function(e){return e*i.DEGREES_PER_RADIAN},i.convertLongitudeRange=function(e){var t=i.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},i.clampToLatitudeRange=function(e){return i.clamp(e,-1*i.PI_OVER_TWO,i.PI_OVER_TWO)},i.negativePiToPi=function(e){return i.zeroToTwoPi(e+i.PI)-i.PI},i.zeroToTwoPi=function(e){var t=i.mod(e,i.TWO_PI);return Math.abs(t)<i.EPSILON14&&Math.abs(e)>i.EPSILON14?i.TWO_PI:t},i.mod=function(e,t){return(e%t+t)%t},i.equalsEpsilon=function(e,n,r,i){i=t(i,r);var a=Math.abs(e-n);return a<=i||a<=r*Math.max(Math.abs(e),Math.abs(n))};var a=[1];i.factorial=function(e){var t=a.length;if(e>=t)for(var n=a[t-1],r=t;r<=e;r++)a.push(n*r);return a[e]},i.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},i.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},i.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},i.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return i.setRandomNumberSeed=function(t){o=new e(t)},i.nextRandomNumber=function(){return o.random()},i.acosClamped=function(e){return Math.acos(i.clamp(e,-1,1))},i.asinClamped=function(e){return Math.asin(i.clamp(e,-1,1))},i.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},i.logBase=function(e,t){return Math.log(e)/Math.log(t)},i.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},i}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var i=e.clock,a=e.cone,u=t(e.magnitude,1),s=u*Math.sin(a);return r.x=s*Math.cos(i),r.y=s*Math.sin(i),r.z=u*Math.cos(a),r},o.fromElements=function(e,t,r,i){return n(i)?(i.x=e,i.y=t,i.z=r,i):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new o),i.x=e[r++],i.y=e[r++],i.z=e[r],i},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var i=0;i<r;++i)o.pack(e[i],t,3*i);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var i=0;i<r;i+=3){var a=i/3;t[a]=o.unpack(e,i,t[a])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,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};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var n=o.dot(c,l),r=o.magnitude(o.cross(c,l,c));return Math.atan2(r,n)};var f=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,i){return e===t||n(e)&&n(t)&&a.equalsEpsilon(e.x,t.x,r,i)&&a.equalsEpsilon(e.y,t.y,r,i)&&a.equalsEpsilon(e.z,t.z,r,i)},o.cross=function(e,t,n){var r=e.x,i=e.y,a=e.z,o=t.x,u=t.y,s=t.z,c=i*s-a*u,l=a*o-r*s,f=r*u-i*o;return n.x=c,n.y=l,n.z=f,n},o.fromDegrees=function(e,t,n,r,i){return e=a.toRadians(e),t=a.toRadians(t),o.fromRadians(e,t,n,r,i)};var h=new o,E=new o,d=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,i,a,u){i=t(i,0);var s=n(a)?a.radiiSquared:d,c=Math.cos(r);h.x=c*Math.cos(e),h.y=c*Math.sin(e),h.z=Math.sin(r),h=o.normalize(h,h),o.multiplyComponents(s,h,E);var l=Math.sqrt(o.dot(h,E));return E=o.divideByScalar(E,l,E),h=o.multiplyByScalar(h,i,h),n(u)||(u=new o),o.add(E,h,u)},o.fromDegreesArray=function(e,t,r){var i=e.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],s=e[a+1],c=a/2;r[c]=o.fromDegrees(u,s,0,t,r[c])}return r},o.fromRadiansArray=function(e,t,r){var i=e.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],s=e[a+1],c=a/2;r[c]=o.fromRadians(u,s,0,t,r[c])}return r},o.fromDegreesArrayHeights=function(e,t,r){var i=e.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],s=e[a+1],c=e[a+2],l=a/3;r[l]=o.fromDegrees(u,s,c,t,r[l])}return r},o.fromRadiansArrayHeights=function(e,t,r){var i=e.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],s=e[a+1],c=e[a+2],l=a/3;r[l]=o.fromRadians(u,s,c,t,r[l])}return r},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,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function i(n,i,u,s,c){var l=n.x,f=n.y,h=n.z,E=i.x,d=i.y,m=i.z,_=l*l*E*E,p=f*f*d*d,y=h*h*m*m,T=_+p+y,R=Math.sqrt(1/T),A=e.multiplyByScalar(n,R,a);if(T<s)return isFinite(R)?e.clone(A,c):void 0;var S=u.x,v=u.y,N=u.z,I=o;I.x=A.x*S*2,I.y=A.y*v*2,I.z=A.z*N*2;var O,g,M,x,w,C,P,U,D,L,F,z=(1-R)*e.magnitude(n)/(.5*e.magnitude(I)),B=0;do{z-=B,M=1/(1+z*S),x=1/(1+z*v),w=1/(1+z*N),C=M*M,P=x*x,U=w*w,D=C*M,L=P*x,F=U*w,O=_*C+p*P+y*U-1,g=_*D*S+p*L*v+y*F*N;var b=-2*g;B=O/b}while(Math.abs(O)>r.EPSILON12);return t(c)?(c.x=l*M,c.y=f*x,c.z=h*w,c):new e(l*M,f*x,h*w)}var a=new e,o=new e;return i}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,i,a,o){"use strict";function u(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)}u.fromRadians=function(e,r,i,a){return i=t(i,0),n(a)?(a.longitude=e,a.latitude=r,a.height=i,a):new u(e,r,i)},u.fromDegrees=function(e,t,n,r){return e=a.toRadians(e),t=a.toRadians(t),u.fromRadians(e,t,n,r)};var s=new e,c=new e,l=new e,f=new e(1/6378137,1/6378137,1/6356752.314245179),h=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),E=a.EPSILON1;return u.fromCartesian=function(t,r,i){var d=n(r)?r.oneOverRadii:f,m=n(r)?r.oneOverRadiiSquared:h,_=n(r)?r._centerToleranceSquared:E,p=o(t,d,m,_,c);if(n(p)){var y=e.multiplyComponents(p,m,s);y=e.normalize(y,y);var T=e.subtract(t,p,l),R=Math.atan2(y.y,y.x),A=Math.asin(y.z),S=a.sign(e.dot(T,t))*e.magnitude(T);return n(i)?(i.longitude=R,i.latitude=A,i.height=S,i):new u(R,A,S)}},u.clone=function(e,t){if(n(e))return n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},u.ZERO=i(new u(0,0,0)),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,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,i,a,o,u,s){"use strict";function c(t,r,i,a){r=n(r,0),i=n(i,0),a=n(a,0),t._radii=new e(r,i,a),t._radiiSquared=new e(r*r,i*i,a*a),t._radiiToTheFourth=new e(r*r*r*r,i*i*i*i,a*a*a*a),t._oneOverRadii=new e(0===r?0:1/r,0===i?0:1/i,0===a?0:1/a),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===i?0:1/(i*i),0===a?0:1/(a*a)),t._minimumRadius=Math.min(r,i,a),t._maximumRadius=Math.max(r,i,a),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,c(this,e,t,n)}i(l.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}}}),l.clone=function(t,n){if(r(t)){var i=t._radii;return r(n)?(e.clone(i,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new l(i.x,i.y,i.z)}},l.fromCartesian3=function(e,t){return r(t)||(t=new l),r(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,r,i){return i=n(i,0),e.pack(t._radii,r,i),r},l.unpack=function(t,r,i){r=n(r,0);var a=e.unpack(t,r);return l.fromCartesian3(a,i)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,n){var i=t.longitude,a=t.latitude,o=Math.cos(a),u=o*Math.cos(i),s=o*Math.sin(i),c=Math.sin(a);return r(n)||(n=new e),n.x=u,n.y=s,n.z=c,e.normalize(n,n)},l.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var f=new e,h=new e;l.prototype.cartographicToCartesian=function(t,n){var i=f,a=h;this.geodeticSurfaceNormalCartographic(t,i),e.multiplyComponents(this._radiiSquared,i,a);var o=Math.sqrt(e.dot(i,a));return e.divideByScalar(a,o,a),e.multiplyByScalar(i,t.height,i),r(n)||(n=new e),e.add(a,i,n)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;i<n;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var E=new e,d=new e,m=new e;return l.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,d);if(r(a)){var o=this.geodeticSurfaceNormal(a,E),s=e.subtract(n,a,m),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),f=u.sign(e.dot(s,n))*e.magnitude(s);return r(i)?(i.longitude=c,i.latitude=l,i.height=f,i):new t(c,l,f)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;i<n;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var i=t.x,a=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*u.z);return e.multiplyByScalar(t,s,n)},l.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},l.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},l.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,i,a){i=n(i,0);var o=this._sqauredXOverSquaredZ;if(r(a)||(a=new e),a.x=0,a.y=0,a.z=t.z*(1-o),!(Math.abs(a.z)>=this._radii.z-i))return a},l}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,i,a,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return i(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var i=this._semimajorAxis,a=t.longitude*i,o=t.latitude*i,u=t.height;return r(n)?(n.x=a,n.y=o,n.z=u,n):new e(a,o,u)},u.prototype.unproject=function(e,n){var i=this._oneOverSemimajorAxis,a=e.x*i,o=e.y*i,u=e.z;return r(n)?(n.longitude=a,n.latitude=o,n.height=u,n):new t(a,o,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";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a,o){"use strict";function u(e,n,r,i,a,o,u,s,c){this[0]=t(e,0),this[1]=t(i,0),this[2]=t(u,0),this[3]=t(n,0),this[4]=t(a,0),this[5]=t(s,0),this[6]=t(r,0),this[7]=t(o,0),this[8]=t(c,0)}function s(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function c(e){for(var t=0,n=0;n<3;++n){var r=e[u.getElementIndex(d[n],E[n])];t+=2*r*r}return Math.sqrt(t)}function l(e,t){for(var n=o.EPSILON15,r=0,i=1,a=0;a<3;++a){var s=Math.abs(e[u.getElementIndex(d[a],E[a])]);s>r&&(i=a,r=s)}var c=1,l=0,f=E[i],h=d[i];if(Math.abs(e[u.getElementIndex(h,f)])>n){var m,_=e[u.getElementIndex(h,h)],p=e[u.getElementIndex(f,f)],y=e[u.getElementIndex(h,f)],T=(_-p)/2/y;m=T<0?-1/(-T+Math.sqrt(1+T*T)):1/(T+Math.sqrt(1+T*T)),c=1/Math.sqrt(1+m*m),l=m*c}return t=u.clone(u.IDENTITY,t),t[u.getElementIndex(f,f)]=t[u.getElementIndex(h,h)]=c,t[u.getElementIndex(h,f)]=l,t[u.getElementIndex(f,h)]=-l,t}u.packedLength=9,u.pack=function(e,n,r){return r=t(r,0),n[r++]=e[0],n[r++]=e[1],n[r++]=e[2],n[r++]=e[3],n[r++]=e[4],n[r++]=e[5],n[r++]=e[6],n[r++]=e[7],n[r++]=e[8],n},u.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new u),i[0]=e[r++],i[1]=e[r++],i[2]=e[r++],i[3]=e[r++],i[4]=e[r++],i[5]=e[r++],i[6]=e[r++],i[7]=e[r++],i[8]=e[r++],i},u.clone=function(e,t){if(n(e))return n(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 u(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},u.fromArray=function(e,r,i){return r=t(r,0),n(i)||(i=new u),i[0]=e[r],i[1]=e[r+1],i[2]=e[r+2],i[3]=e[r+3],i[4]=e[r+4],i[5]=e[r+5],i[6]=e[r+6],i[7]=e[r+7],i[8]=e[r+8],i},u.fromColumnMajorArray=function(e,t){return u.clone(e,t)},u.fromRowMajorArray=function(e,t){return n(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 u(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},u.fromQuaternion=function(e,t){var r=e.x*e.x,i=e.x*e.y,a=e.x*e.z,o=e.x*e.w,s=e.y*e.y,c=e.y*e.z,l=e.y*e.w,f=e.z*e.z,h=e.z*e.w,E=e.w*e.w,d=r-s-f+E,m=2*(i-h),_=2*(a+l),p=2*(i+h),y=-r+s-f+E,T=2*(c-o),R=2*(a-l),A=2*(c+o),S=-r-s+f+E;return n(t)?(t[0]=d,t[1]=p,t[2]=R,t[3]=m,t[4]=y,t[5]=A,t[6]=_,t[7]=T,t[8]=S,t):new u(d,m,_,p,y,T,R,A,S)},u.fromHeadingPitchRoll=function(e,t){var r=Math.cos(-e.pitch),i=Math.cos(-e.heading),a=Math.cos(e.roll),o=Math.sin(-e.pitch),s=Math.sin(-e.heading),c=Math.sin(e.roll),l=r*i,f=-a*s+c*o*i,h=c*s+a*o*i,E=r*s,d=a*i+c*o*s,m=-o*a+a*o*s,_=-o,p=c*r,y=a*r;return n(t)?(t[0]=l,t[1]=E,t[2]=_,t[3]=f,t[4]=d,t[5]=p,t[6]=h,t[7]=m,t[8]=y,t):new u(l,f,h,E,d,m,_,p,y)},u.fromScale=function(e,t){return n(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 u(e.x,0,0,0,e.y,0,0,0,e.z)},u.fromUniformScale=function(e,t){return n(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 u(e,0,0,0,e,0,0,0,e)},u.fromCrossProduct=function(e,t){return n(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 u(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},u.fromRotationX=function(e,t){var r=Math.cos(e),i=Math.sin(e);return n(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=r,t[5]=i,t[6]=0,t[7]=-i,t[8]=r,t):new u(1,0,0,0,r,-i,0,i,r)},u.fromRotationY=function(e,t){var r=Math.cos(e),i=Math.sin(e);return n(t)?(t[0]=r,t[1]=0,t[2]=-i,t[3]=0,t[4]=1,t[5]=0,t[6]=i,t[7]=0,t[8]=r,t):new u(r,0,i,0,1,0,-i,0,r)},u.fromRotationZ=function(e,t){var r=Math.cos(e),i=Math.sin(e);return n(t)?(t[0]=r,t[1]=i,t[2]=0,t[3]=-i,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new u(r,-i,0,i,r,0,0,0,1)},u.toArray=function(e,t){return n(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]]},u.getElementIndex=function(e,t){return 3*e+t},u.getColumn=function(e,t,n){var r=3*t,i=e[r],a=e[r+1],o=e[r+2];return n.x=i,n.y=a,n.z=o,n},u.setColumn=function(e,t,n,r){r=u.clone(e,r);var i=3*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},u.getRow=function(e,t,n){var r=e[t],i=e[t+3],a=e[t+6];return n.x=r,n.y=i,n.z=a,n},u.setRow=function(e,t,n,r){return r=u.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var f=new e;u.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],f)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],f)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],f)),n};var h=new e;u.getMaximumScale=function(t){return u.getScale(t,h),e.maximumComponent(h)},u.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],i=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],o=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 n[0]=r,n[1]=i,n[2]=a,n[3]=o,n[4]=u,n[5]=s,n[6]=c,n[7]=l,n[8]=f,n},u.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},u.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},u.multiplyByVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[3]*i+e[6]*a,u=e[1]*r+e[4]*i+e[7]*a,s=e[2]*r+e[5]*i+e[8]*a;return n.x=o,n.y=u,n.z=s,n},u.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},u.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},u.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},u.transpose=function(e,t){var n=e[0],r=e[3],i=e[6],a=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var E=[1,0,0],d=[2,2,1],m=new u,_=new u;return u.computeEigenDecomposition=function(e,t){var r=o.EPSILON20,i=10,a=0,f=0;n(t)||(t={});for(var h=t.unitary=u.clone(u.IDENTITY,t.unitary),E=t.diagonal=u.clone(e,t.diagonal),d=r*s(E);f<i&&c(E)>d;)l(E,m),u.transpose(m,_),u.multiply(E,m,E),u.multiply(_,E,E),u.multiply(h,m,h),++a>2&&(++f,a=0);return t},u.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},u.determinant=function(e){var t=e[0],n=e[3],r=e[6],i=e[1],a=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(a*c-s*o)+i*(s*r-n*c)+u*(n*o-a*r)},u.inverse=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],l=e[7],f=e[8],h=u.determinant(e);t[0]=o*f-l*s,t[1]=l*i-r*f,t[2]=r*s-o*i,t[3]=c*s-a*f,t[4]=n*f-c*i,t[5]=a*i-n*s,t[6]=a*l-c*o,t[7]=c*r-n*l,t[8]=n*o-a*r;var E=1/h;return u.multiplyByScalar(t,E,t)},u.equals=function(e,t){return e===t||n(e)&&n(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]},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r},u.IDENTITY=a(new u(1,0,0,0,1,0,0,0,1)),u.ZERO=a(new u(0,0,0,0,0,0,0,0,0)),u.COLUMN0ROW0=0,u.COLUMN0ROW1=1,u.COLUMN0ROW2=2,u.COLUMN1ROW0=3,u.COLUMN1ROW1=4,u.COLUMN1ROW2=5,u.COLUMN2ROW0=6,u.COLUMN2ROW1=7,u.COLUMN2ROW2=8,r(u.prototype,{length:{get:function(){return u.packedLength}}}),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},u}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i){"use strict";function a(t,n,r,i){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0),this.w=e(i,0)}a.fromElements=function(e,n,r,i,o){return t(o)?(o.x=e,o.y=n,o.z=r,o.w=i,o):new a(e,n,r,i)},a.fromColor=function(e,n){return t(n)?(n.x=e.red,n.y=e.green,n.z=e.blue,n.w=e.alpha,n):new a(e.red,e.green,e.blue,e.alpha)},a.clone=function(e,n){if(t(e))return t(n)?(n.x=e.x,n.y=e.y,n.z=e.z,n.w=e.w,n):new a(e.x,e.y,e.z,e.w)},a.packedLength=4,a.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w,n},a.unpack=function(n,r,i){return r=e(r,0),t(i)||(i=new a),i.x=n[r++],i.y=n[r++],i.z=n[r++],i.w=n[r],i},a.packArray=function(e,n){var r=e.length;t(n)?n.length=4*r:n=new Array(4*r);for(var i=0;i<r;++i)a.pack(e[i],n,4*i);return n},a.unpackArray=function(e,n){var r=e.length;t(n)?n.length=r/4:n=new Array(r/4);for(var i=0;i<r;i+=4){var o=i/4;n[o]=a.unpack(e,i,n[o])}return n},a.fromArray=a.unpack,a.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},a.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},a.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},a.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},a.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},a.magnitude=function(e){return Math.sqrt(a.magnitudeSquared(e))};var o=new a;a.distance=function(e,t){return a.subtract(e,t,o),a.magnitude(o)},a.distanceSquared=function(e,t){return a.subtract(e,t,o),a.magnitudeSquared(o)},a.normalize=function(e,t){var n=a.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t},a.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},a.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},a.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},a.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},a.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},a.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},a.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},a.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,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.w=Math.abs(e.w),t};var u=new a;a.lerp=function(e,t,n,r){return a.multiplyByScalar(t,n,u),r=a.multiplyByScalar(e,1-n,r),a.add(u,r,r)};var s=new a;return a.mostOrthogonalAxis=function(e,t){var n=a.normalize(e,s);return a.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?a.clone(a.UNIT_X,t):a.clone(a.UNIT_W,t):n.z<=n.w?a.clone(a.UNIT_Z,t):a.clone(a.UNIT_W,t):n.y<=n.z?n.y<=n.w?a.clone(a.UNIT_Y,t):a.clone(a.UNIT_W,t):n.z<=n.w?a.clone(a.UNIT_Z,t):a.clone(a.UNIT_W,t)},a.equals=function(e,n){return e===n||t(e)&&t(n)&&e.x===n.x&&e.y===n.y&&e.z===n.z&&e.w===n.w},a.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},a.equalsEpsilon=function(e,n,r,a){return e===n||t(e)&&t(n)&&i.equalsEpsilon(e.x,n.x,r,a)&&i.equalsEpsilon(e.y,n.y,r,a)&&i.equalsEpsilon(e.z,n.z,r,a)&&i.equalsEpsilon(e.w,n.w,r,a)},a.ZERO=r(new a(0,0,0,0)),a.UNIT_X=r(new a(1,0,0,0)),a.UNIT_Y=r(new a(0,1,0,0)),a.UNIT_Z=r(new a(0,0,1,0)),a.UNIT_W=r(new a(0,0,0,1)),a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,n){return a.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},a}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,i,a,o,u,s,c){"use strict";function l(e,t,r,i,a,o,u,s,c,l,f,h,E,d,m,_){this[0]=n(e,0),this[1]=n(a,0),this[2]=n(c,0),this[3]=n(E,0),this[4]=n(t,0), -this[5]=n(o,0),this[6]=n(l,0),this[7]=n(d,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(f,0),this[11]=n(m,0),this[12]=n(i,0),this[13]=n(s,0),this[14]=n(h,0),this[15]=n(_,0)}l.packedLength=16,l.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t[r++]=e[9],t[r++]=e[10],t[r++]=e[11],t[r++]=e[12],t[r++]=e[13],t[r++]=e[14],t[r]=e[15],t},l.unpack=function(e,t,i){return t=n(t,0),r(i)||(i=new l),i[0]=e[t++],i[1]=e[t++],i[2]=e[t++],i[3]=e[t++],i[4]=e[t++],i[5]=e[t++],i[6]=e[t++],i[7]=e[t++],i[8]=e[t++],i[9]=e[t++],i[10]=e[t++],i[11]=e[t++],i[12]=e[t++],i[13]=e[t++],i[14]=e[t++],i[15]=e[t],i},l.clone=function(e,t){if(r(e))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):new l(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])},l.fromArray=l.unpack,l.fromColumnMajorArray=function(e,t){return l.clone(e,t)},l.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 l(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])},l.fromRotationTranslation=function(t,i,a){return i=n(i,e.ZERO),r(a)?(a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=0,a[4]=t[3],a[5]=t[4],a[6]=t[5],a[7]=0,a[8]=t[6],a[9]=t[7],a[10]=t[8],a[11]=0,a[12]=i.x,a[13]=i.y,a[14]=i.z,a[15]=1,a):new l(t[0],t[3],t[6],i.x,t[1],t[4],t[7],i.y,t[2],t[5],t[8],i.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(e,t,n,i){r(i)||(i=new l);var a=n.x,o=n.y,u=n.z,s=t.x*t.x,c=t.x*t.y,f=t.x*t.z,h=t.x*t.w,E=t.y*t.y,d=t.y*t.z,m=t.y*t.w,_=t.z*t.z,p=t.z*t.w,y=t.w*t.w,T=s-E-_+y,R=2*(c-p),A=2*(f+m),S=2*(c+p),v=-s+E-_+y,N=2*(d-h),I=2*(f-m),O=2*(d+h),g=-s-E+_+y;return i[0]=T*a,i[1]=S*a,i[2]=I*a,i[3]=0,i[4]=R*o,i[5]=v*o,i[6]=O*o,i[7]=0,i[8]=A*u,i[9]=N*u,i[10]=g*u,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i},l.fromTranslationRotationScale=function(e,t){return l.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},l.fromTranslation=function(e,t){return l.fromRotationTranslation(s.IDENTITY,e,t)},l.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 l(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},l.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 l(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var f=new e,h=new e,E=new e;l.fromCamera=function(t,n){var i=t.position,a=t.direction,o=t.up;e.normalize(a,f),e.normalize(e.cross(f,o,h),h),e.normalize(e.cross(h,f,E),E);var u=h.x,s=h.y,c=h.z,d=f.x,m=f.y,_=f.z,p=E.x,y=E.y,T=E.z,R=i.x,A=i.y,S=i.z,v=u*-R+s*-A+c*-S,N=p*-R+y*-A+T*-S,I=d*R+m*A+_*S;return r(n)?(n[0]=u,n[1]=p,n[2]=-d,n[3]=0,n[4]=s,n[5]=y,n[6]=-m,n[7]=0,n[8]=c,n[9]=T,n[10]=-_,n[11]=0,n[12]=v,n[13]=N,n[14]=I,n[15]=1,n):new l(u,s,c,v,p,y,T,N,-d,-m,-_,I,0,0,0,1)},l.computePerspectiveFieldOfView=function(e,t,n,r,i){var a=Math.tan(.5*e),o=1/a,u=o/t,s=(r+n)/(n-r),c=2*r*n/(n-r);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=o,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=s,i[11]=-1,i[12]=0,i[13]=0,i[14]=c,i[15]=0,i},l.computeOrthographicOffCenter=function(e,t,n,r,i,a,o){var u=1/(t-e),s=1/(r-n),c=1/(a-i),l=-(t+e)*u,f=-(r+n)*s,h=-(a+i)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=f,o[14]=h,o[15]=1,o},l.computePerspectiveOffCenter=function(e,t,n,r,i,a,o){var u=2*i/(t-e),s=2*i/(r-n),c=(t+e)/(t-e),l=(r+n)/(r-n),f=-(a+i)/(a-i),h=-1,E=-2*a*i/(a-i);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=f,o[11]=h,o[12]=0,o[13]=0,o[14]=E,o[15]=0,o},l.computeInfinitePerspectiveOffCenter=function(e,t,n,r,i,a){var o=2*i/(t-e),u=2*i/(r-n),s=(t+e)/(t-e),c=(r+n)/(r-n),l=-1,f=-1,h=-2*i;return a[0]=o,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]=h,a[15]=0,a},l.computeViewportTransformation=function(e,t,r,i){e=n(e,n.EMPTY_OBJECT);var a=n(e.x,0),o=n(e.y,0),u=n(e.width,0),s=n(e.height,0);t=n(t,0),r=n(r,1);var c=.5*u,l=.5*s,f=.5*(r-t),h=c,E=l,d=f,m=a+c,_=o+l,p=t+f,y=1;return i[0]=h,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=E,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=d,i[11]=0,i[12]=m,i[13]=_,i[14]=p,i[15]=y,i},l.computeView=function(t,n,r,i,a){return a[0]=i.x,a[1]=r.x,a[2]=-n.x,a[3]=0,a[4]=i.y,a[5]=r.y,a[6]=-n.y,a[7]=0,a[8]=i.z,a[9]=r.z,a[10]=-n.z,a[11]=0,a[12]=-e.dot(i,t),a[13]=-e.dot(r,t),a[14]=e.dot(n,t),a[15]=1,a},l.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]]},l.getElementIndex=function(e,t){return 4*e+t},l.getColumn=function(e,t,n){var r=4*t,i=e[r],a=e[r+1],o=e[r+2],u=e[r+3];return n.x=i,n.y=a,n.z=o,n.w=u,n},l.setColumn=function(e,t,n,r){r=l.clone(e,r);var i=4*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r[i+3]=n.w,r},l.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},l.getRow=function(e,t,n){var r=e[t],i=e[t+4],a=e[t+8],o=e[t+12];return n.x=r,n.y=i,n.z=a,n.w=o,n},l.setRow=function(e,t,n,r){return r=l.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var d=new e;l.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],d)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],d)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],d)),n};var m=new e;l.getMaximumScale=function(t){return l.getScale(t,m),e.maximumComponent(m)},l.multiply=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],f=e[8],h=e[9],E=e[10],d=e[11],m=e[12],_=e[13],p=e[14],y=e[15],T=t[0],R=t[1],A=t[2],S=t[3],v=t[4],N=t[5],I=t[6],O=t[7],g=t[8],M=t[9],x=t[10],w=t[11],C=t[12],P=t[13],U=t[14],D=t[15],L=r*T+u*R+f*A+m*S,F=i*T+s*R+h*A+_*S,z=a*T+c*R+E*A+p*S,B=o*T+l*R+d*A+y*S,b=r*v+u*N+f*I+m*O,G=i*v+s*N+h*I+_*O,q=a*v+c*N+E*I+p*O,W=o*v+l*N+d*I+y*O,H=r*g+u*M+f*x+m*w,X=i*g+s*M+h*x+_*w,V=a*g+c*M+E*x+p*w,Y=o*g+l*M+d*x+y*w,Z=r*C+u*P+f*U+m*D,k=i*C+s*P+h*U+_*D,j=a*C+c*P+E*U+p*D,K=o*C+l*P+d*U+y*D;return n[0]=L,n[1]=F,n[2]=z,n[3]=B,n[4]=b,n[5]=G,n[6]=q,n[7]=W,n[8]=H,n[9]=X,n[10]=V,n[11]=Y,n[12]=Z,n[13]=k,n[14]=j,n[15]=K,n},l.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},l.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},l.multiplyTransformation=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=e[12],E=e[13],d=e[14],m=t[0],_=t[1],p=t[2],y=t[4],T=t[5],R=t[6],A=t[8],S=t[9],v=t[10],N=t[12],I=t[13],O=t[14],g=r*m+o*_+c*p,M=i*m+u*_+l*p,x=a*m+s*_+f*p,w=r*y+o*T+c*R,C=i*y+u*T+l*R,P=a*y+s*T+f*R,U=r*A+o*S+c*v,D=i*A+u*S+l*v,L=a*A+s*S+f*v,F=r*N+o*I+c*O+h,z=i*N+u*I+l*O+E,B=a*N+s*I+f*O+d;return n[0]=g,n[1]=M,n[2]=x,n[3]=0,n[4]=w,n[5]=C,n[6]=P,n[7]=0,n[8]=U,n[9]=D,n[10]=L,n[11]=0,n[12]=F,n[13]=z,n[14]=B,n[15]=1,n},l.multiplyByMatrix3=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=t[0],E=t[1],d=t[2],m=t[3],_=t[4],p=t[5],y=t[6],T=t[7],R=t[8],A=r*h+o*E+c*d,S=i*h+u*E+l*d,v=a*h+s*E+f*d,N=r*m+o*_+c*p,I=i*m+u*_+l*p,O=a*m+s*_+f*p,g=r*y+o*T+c*R,M=i*y+u*T+l*R,x=a*y+s*T+f*R;return n[0]=A,n[1]=S,n[2]=v,n[3]=0,n[4]=N,n[5]=I,n[6]=O,n[7]=0,n[8]=g,n[9]=M,n[10]=x,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},l.multiplyByTranslation=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=r*e[0]+i*e[4]+a*e[8]+e[12],u=r*e[1]+i*e[5]+a*e[9]+e[13],s=r*e[2]+i*e[6]+a*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=s,n[15]=e[15],n};var _=new e;l.multiplyByUniformScale=function(e,t,n){return _.x=t,_.y=t,_.z=t,l.multiplyByScale(e,_,n)},l.multiplyByScale=function(e,t,n){var r=t.x,i=t.y,a=t.z;return 1===r&&1===i&&1===a?l.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=i*e[4],n[5]=i*e[5],n[6]=i*e[6],n[7]=0,n[8]=a*e[8],n[9]=a*e[9],n[10]=a*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},l.multiplyByVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=t.w,u=e[0]*r+e[4]*i+e[8]*a+e[12]*o,s=e[1]*r+e[5]*i+e[9]*a+e[13]*o,c=e[2]*r+e[6]*i+e[10]*a+e[14]*o,l=e[3]*r+e[7]*i+e[11]*a+e[15]*o;return n.x=u,n.y=s,n.z=c,n.w=l,n},l.multiplyByPointAsVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[4]*i+e[8]*a,u=e[1]*r+e[5]*i+e[9]*a,s=e[2]*r+e[6]*i+e[10]*a;return n.x=o,n.y=u,n.z=s,n},l.multiplyByPoint=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[4]*i+e[8]*a+e[12],u=e[1]*r+e[5]*i+e[9]*a+e[13],s=e[2]*r+e[6]*i+e[10]*a+e[14];return n.x=o,n.y=u,n.z=s,n},l.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},l.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},l.transpose=function(e,t){var n=e[1],r=e[2],i=e[3],a=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=a,t[10]=e[10],t[11]=e[14],t[12]=i,t[13]=o,t[14]=u,t[15]=e[15],t},l.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},l.equals=function(e,t){return e===t||r(e)&&r(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},l.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},l.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},l.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};var p=new s,y=new s,T=new t,R=new t(0,0,0,1);return l.inverse=function(e,n){if(s.equalsEpsilon(l.getRotation(e,p),y,u.EPSILON7)&&t.equals(l.getRow(e,3,T),R))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],i=e[4],a=e[8],o=e[12],f=e[1],h=e[5],E=e[9],d=e[13],m=e[2],_=e[6],A=e[10],S=e[14],v=e[3],N=e[7],I=e[11],O=e[15],g=A*O,M=S*I,x=_*O,w=S*N,C=_*I,P=A*N,U=m*O,D=S*v,L=m*I,F=A*v,z=m*N,B=_*v,b=g*h+w*E+C*d-(M*h+x*E+P*d),G=M*f+U*E+F*d-(g*f+D*E+L*d),q=x*f+D*h+z*d-(w*f+U*h+B*d),W=P*f+L*h+B*E-(C*f+F*h+z*E),H=M*i+x*a+P*o-(g*i+w*a+C*o),X=g*r+D*a+L*o-(M*r+U*a+F*o),V=w*r+U*i+B*o-(x*r+D*i+z*o),Y=C*r+F*i+z*a-(P*r+L*i+B*a);g=a*d,M=o*E,x=i*d,w=o*h,C=i*E,P=a*h,U=r*d,D=o*f,L=r*E,F=a*f,z=r*h,B=i*f;var Z=g*N+w*I+C*O-(M*N+x*I+P*O),k=M*v+U*I+F*O-(g*v+D*I+L*O),j=x*v+D*N+z*O-(w*v+U*N+B*O),K=P*v+L*N+B*I-(C*v+F*N+z*I),J=x*A+P*S+M*_-(C*S+g*_+w*A),Q=L*S+g*m+D*A-(U*A+F*S+M*m),$=U*_+B*S+w*m-(z*S+x*m+D*_),ee=z*A+C*m+F*_-(L*_+B*A+P*m),te=r*b+i*G+a*q+o*W;if(Math.abs(te)<u.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=b*te,n[1]=G*te,n[2]=q*te,n[3]=W*te,n[4]=H*te,n[5]=X*te,n[6]=V*te,n[7]=Y*te,n[8]=Z*te,n[9]=k*te,n[10]=j*te,n[11]=K*te,n[12]=J*te,n[13]=Q*te,n[14]=$*te,n[15]=ee*te,n},l.inverseTransformation=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],f=e[12],h=e[13],E=e[14],d=-n*f-r*h-i*E,m=-a*f-o*h-u*E,_=-s*f-c*h-l*E;return t[0]=n,t[1]=a,t[2]=s,t[3]=0,t[4]=r,t[5]=o,t[6]=c,t[7]=0,t[8]=i,t[9]=u,t[10]=l,t[11]=0,t[12]=d,t[13]=m,t[14]=_,t[15]=1,t},l.IDENTITY=o(new l(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),l.ZERO=o(new l(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN0ROW3=3,l.COLUMN1ROW0=4,l.COLUMN1ROW1=5,l.COLUMN1ROW2=6,l.COLUMN1ROW3=7,l.COLUMN2ROW0=8,l.COLUMN2ROW1=9,l.COLUMN2ROW2=10,l.COLUMN2ROW3=11,l.COLUMN3ROW0=12,l.COLUMN3ROW1=13,l.COLUMN3ROW2=14,l.COLUMN3ROW3=15,i(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.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]+")"},l}),define("Core/Rectangle",["./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,i,a,o,u){"use strict";function s(e,n,r,i){this.west=t(e,0),this.south=t(n,0),this.east=t(r,0),this.north=t(i,0)}r(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,n,r){return r=t(r,0),n[r++]=e.west,n[r++]=e.south,n[r++]=e.east,n[r]=e.north,n},s.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new s),i.west=e[r++],i.south=e[r++],i.east=e[r++],i.north=e[r],i},s.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=u.TWO_PI),t-n},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,r,i,a,o){return e=u.toRadians(t(e,0)),r=u.toRadians(t(r,0)),i=u.toRadians(t(i,0)),a=u.toRadians(t(a,0)),n(o)?(o.west=e,o.south=r,o.east=i,o.north=a,o):new s(e,r,i,a)},s.fromCartographicArray=function(e,t){for(var r=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE,f=0,h=e.length;f<h;f++){var E=e[f];r=Math.min(r,E.longitude),i=Math.max(i,E.longitude),c=Math.min(c,E.latitude),l=Math.max(l,E.latitude);var d=E.longitude>=0?E.longitude:E.longitude+u.TWO_PI;a=Math.min(a,d),o=Math.max(o,d)}return i-r>o-a&&(r=a,i=o,i>u.PI&&(i-=u.TWO_PI),r>u.PI&&(r-=u.TWO_PI)),n(t)?(t.west=r,t.south=c,t.east=i,t.north=l,t):new s(r,c,i,l)},s.fromCartesianArray=function(e,t,r){for(var i=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=Number.MAX_VALUE,f=-Number.MAX_VALUE,h=0,E=e.length;h<E;h++){var d=t.cartesianToCartographic(e[h]);i=Math.min(i,d.longitude),a=Math.max(a,d.longitude),l=Math.min(l,d.latitude),f=Math.max(f,d.latitude);var m=d.longitude>=0?d.longitude:d.longitude+u.TWO_PI;o=Math.min(o,m),c=Math.max(c,m)}return a-i>c-o&&(i=o,a=c,a>u.PI&&(a-=u.TWO_PI),i>u.PI&&(i-=u.TWO_PI)),n(r)?(r.west=i,r.south=l,r.east=a,r.north=f,r):new s(i,l,a,f)},s.clone=function(e,t){if(n(e))return n(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,t){return e===t||n(e)&&n(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},s.prototype.equalsEpsilon=function(e,t){return n(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},s.validate=function(e){},s.southwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.south,r.height=0,r):new e(t.west,t.south)},s.northwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.north,r.height=0,r):new e(t.west,t.north)},s.northeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.north,r.height=0,r):new e(t.east,t.north)},s.southeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.south,r.height=0,r):new e(t.east,t.south)},s.center=function(t,r){var i=t.east,a=t.west;i<a&&(i+=u.TWO_PI);var o=u.negativePiToPi(.5*(a+i)),s=.5*(t.south+t.north);return n(r)?(r.longitude=o,r.latitude=s,r.height=0,r):new e(o,s)},s.intersection=function(e,t,r){var i=e.east,a=e.west,o=t.east,c=t.west;i<a&&o>0?i+=u.TWO_PI:o<c&&i>0&&(o+=u.TWO_PI),i<a&&c<0?c+=u.TWO_PI:o<c&&a<0&&(a+=u.TWO_PI);var l=u.negativePiToPi(Math.max(a,c)),f=u.negativePiToPi(Math.min(i,o));if(!((e.west<e.east||t.west<t.east)&&f<=l)){var h=Math.max(e.south,t.south),E=Math.min(e.north,t.north);if(!(h>=E))return n(r)?(r.west=l,r.south=h,r.east=f,r.north=E,r):new s(l,h,f,E)}},s.simpleIntersection=function(e,t,r){var i=Math.max(e.west,t.west),a=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(a>=u||i>=o))return n(r)?(r.west=i,r.south=a,r.east=o,r.north=u,r):new s(i,a,o,u)},s.union=function(e,t,r){n(r)||(r=new s);var i=e.east,a=e.west,o=t.east,c=t.west;i<a&&o>0?i+=u.TWO_PI:o<c&&i>0&&(o+=u.TWO_PI),i<a&&c<0?c+=u.TWO_PI:o<c&&a<0&&(a+=u.TWO_PI);var l=u.convertLongitudeRange(Math.min(a,c)),f=u.convertLongitudeRange(Math.max(i,o));return r.west=l,r.south=Math.min(e.south,t.south),r.east=f,r.north=Math.max(e.north,t.north),r},s.expand=function(e,t,r){return n(r)||(r=new s),r.west=Math.min(e.west,t.longitude),r.south=Math.min(e.south,t.latitude),r.east=Math.max(e.east,t.longitude),r.north=Math.max(e.north,t.latitude),r},s.contains=function(e,t){var n=t.longitude,r=t.latitude,i=e.west,a=e.east;return a<i&&(a+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>i||u.equalsEpsilon(n,i,u.EPSILON14))&&(n<a||u.equalsEpsilon(n,a,u.EPSILON14))&&r>=e.south&&r<=e.north};var c=new e;return s.subsample=function(e,r,i,o){r=t(r,a.WGS84),i=t(i,0),n(o)||(o=[]);var l=0,f=e.north,h=e.south,E=e.east,d=e.west,m=c;m.height=i,m.longitude=d,m.latitude=f,o[l]=r.cartographicToCartesian(m,o[l]),l++,m.longitude=E,o[l]=r.cartographicToCartesian(m,o[l]),l++,m.latitude=h,o[l]=r.cartographicToCartesian(m,o[l]),l++,m.longitude=d,o[l]=r.cartographicToCartesian(m,o[l]),l++,f<0?m.latitude=f:h>0?m.latitude=h:m.latitude=0;for(var _=1;_<8;++_)m.longitude=-Math.PI+_*u.PI_OVER_TWO,s.contains(e,m)&&(o[l]=r.cartographicToCartesian(m,o[l]),l++);return 0===m.latitude&&(m.longitude=d,o[l]=r.cartographicToCartesian(m,o[l]),l++,m.longitude=E,o[l]=r.cartographicToCartesian(m,o[l]),l++),o.length=l,o},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,i,a,o,u,s,c,l,f){"use strict";function h(t,r){this.center=e.clone(n(t,e.ZERO)),this.radius=n(r,0)}var E=new e,d=new e,m=new e,_=new e,p=new e,y=new e,T=new e,R=new e,A=new e,S=new e,v=new e,N=new e;h.fromPoints=function(t,n){if(r(n)||(n=new h),!r(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var i=e.clone(t[0],T),a=e.clone(i,E),o=e.clone(i,d),u=e.clone(i,m),s=e.clone(i,_),c=e.clone(i,p),l=e.clone(i,y),f=t.length,I=1;I<f;I++){e.clone(t[I],i);var O=i.x,g=i.y,M=i.z;O<a.x&&e.clone(i,a),O>s.x&&e.clone(i,s),g<o.y&&e.clone(i,o),g>c.y&&e.clone(i,c),M<u.z&&e.clone(i,u),M>l.z&&e.clone(i,l)}var x=e.magnitudeSquared(e.subtract(s,a,R)),w=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=a,U=s,D=x;w>D&&(D=w,P=o,U=c),C>D&&(D=C,P=u,U=l);var L=A;L.x=.5*(P.x+U.x),L.y=.5*(P.y+U.y),L.z=.5*(P.z+U.z);var F=e.magnitudeSquared(e.subtract(U,L,R)),z=Math.sqrt(F),B=S;B.x=a.x,B.y=o.y,B.z=u.z;var b=v;b.x=s.x,b.y=c.y,b.z=l.z;var G=e.multiplyByScalar(e.add(B,b,R),.5,N),q=0;for(I=0;I<f;I++){e.clone(t[I],i);var W=e.magnitude(e.subtract(i,G,R));W>q&&(q=W);var H=e.magnitudeSquared(e.subtract(i,L,R));if(H>F){var X=Math.sqrt(H);z=.5*(z+X),F=z*z;var V=X-z;L.x=(z*L.x+V*i.x)/X,L.y=(z*L.y+V*i.y)/X,L.z=(z*L.z+V*i.z)/X}}return z<q?(e.clone(L,n.center),n.radius=z):(e.clone(G,n.center),n.radius=q),n};var I=new o,O=new e,g=new e,M=new t,x=new t;h.fromRectangle2D=function(e,t,n){return h.fromRectangleWithHeights2D(e,t,0,0,n)},h.fromRectangleWithHeights2D=function(t,i,a,o,u){if(r(u)||(u=new h),!r(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;i=n(i,I),f.southwest(t,M),M.height=a,f.northeast(t,x),x.height=o;var s=i.project(M,O),c=i.project(x,g),l=c.x-s.x,E=c.y-s.y,d=c.z-s.z;u.radius=.5*Math.sqrt(l*l+E*E+d*d);var m=u.center;return m.x=s.x+.5*l,m.y=s.y+.5*E,m.z=s.z+.5*d,u};var w=[];h.fromRectangle3D=function(e,t,i,o){t=n(t,a.WGS84),i=n(i,0);var u;return r(e)&&(u=f.subsample(e,t,i,w)),h.fromPoints(u,o)},h.fromVertices=function(t,i,a,o){if(r(o)||(o=new h),!r(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;i=n(i,e.ZERO),a=n(a,3);var u=T;u.x=t[0]+i.x,u.y=t[1]+i.y,u.z=t[2]+i.z;for(var s=e.clone(u,E),c=e.clone(u,d),l=e.clone(u,m),f=e.clone(u,_),I=e.clone(u,p),O=e.clone(u,y),g=t.length,M=0;M<g;M+=a){var x=t[M]+i.x,w=t[M+1]+i.y,C=t[M+2]+i.z;u.x=x,u.y=w,u.z=C,x<s.x&&e.clone(u,s),x>f.x&&e.clone(u,f),w<c.y&&e.clone(u,c),w>I.y&&e.clone(u,I),C<l.z&&e.clone(u,l),C>O.z&&e.clone(u,O)}var P=e.magnitudeSquared(e.subtract(f,s,R)),U=e.magnitudeSquared(e.subtract(I,c,R)),D=e.magnitudeSquared(e.subtract(O,l,R)),L=s,F=f,z=P;U>z&&(z=U,L=c,F=I),D>z&&(z=D,L=l,F=O);var B=A;B.x=.5*(L.x+F.x),B.y=.5*(L.y+F.y),B.z=.5*(L.z+F.z);var b=e.magnitudeSquared(e.subtract(F,B,R)),G=Math.sqrt(b),q=S;q.x=s.x,q.y=c.y,q.z=l.z;var W=v;W.x=f.x,W.y=I.y,W.z=O.z;var H=e.multiplyByScalar(e.add(q,W,R),.5,N),X=0;for(M=0;M<g;M+=a){u.x=t[M]+i.x,u.y=t[M+1]+i.y,u.z=t[M+2]+i.z;var V=e.magnitude(e.subtract(u,H,R));V>X&&(X=V);var Y=e.magnitudeSquared(e.subtract(u,B,R));if(Y>b){var Z=Math.sqrt(Y);G=.5*(G+Z),b=G*G;var k=Z-G;B.x=(G*B.x+k*u.x)/Z,B.y=(G*B.y+k*u.y)/Z,B.z=(G*B.z+k*u.z)/Z}}return G<X?(e.clone(B,o.center),o.radius=G):(e.clone(H,o.center),o.radius=X),o},h.fromEncodedCartesianVertices=function(t,n,i){if(r(i)||(i=new h),!r(t)||!r(n)||t.length!==n.length||0===t.length)return i.center=e.clone(e.ZERO,i.center),i.radius=0,i;var a=T;a.x=t[0]+n[0],a.y=t[1]+n[1],a.z=t[2]+n[2];for(var o=e.clone(a,E),u=e.clone(a,d),s=e.clone(a,m),c=e.clone(a,_),l=e.clone(a,p),f=e.clone(a,y),I=t.length,O=0;O<I;O+=3){var g=t[O]+n[O],M=t[O+1]+n[O+1],x=t[O+2]+n[O+2];a.x=g,a.y=M,a.z=x,g<o.x&&e.clone(a,o),g>c.x&&e.clone(a,c),M<u.y&&e.clone(a,u),M>l.y&&e.clone(a,l),x<s.z&&e.clone(a,s),x>f.z&&e.clone(a,f)}var w=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=e.magnitudeSquared(e.subtract(f,s,R)),U=o,D=c,L=w;C>L&&(L=C,U=u,D=l),P>L&&(L=P,U=s,D=f);var F=A;F.x=.5*(U.x+D.x),F.y=.5*(U.y+D.y),F.z=.5*(U.z+D.z);var z=e.magnitudeSquared(e.subtract(D,F,R)),B=Math.sqrt(z),b=S;b.x=o.x,b.y=u.y,b.z=s.z;var G=v;G.x=c.x,G.y=l.y,G.z=f.z;var q=e.multiplyByScalar(e.add(b,G,R),.5,N),W=0;for(O=0;O<I;O+=3){a.x=t[O]+n[O],a.y=t[O+1]+n[O+1],a.z=t[O+2]+n[O+2];var H=e.magnitude(e.subtract(a,q,R));H>W&&(W=H);var X=e.magnitudeSquared(e.subtract(a,F,R));if(X>z){var V=Math.sqrt(X);B=.5*(B+V),z=B*B;var Y=V-B;F.x=(B*F.x+Y*a.x)/V,F.y=(B*F.y+Y*a.y)/V,F.z=(B*F.z+Y*a.z)/V}}return B<W?(e.clone(F,i.center),i.radius=B):(e.clone(q,i.center),i.radius=W),i},h.fromCornerPoints=function(t,n,i){r(i)||(i=new h);var a=i.center;return e.add(t,n,a),e.multiplyByScalar(a,.5,a),i.radius=e.distance(a,n),i},h.fromEllipsoid=function(t,n){return r(n)||(n=new h),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var C=new e;h.fromBoundingSpheres=function(t,n){if(r(n)||(n=new h),!r(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var i=t.length;if(1===i)return h.clone(t[0],n);if(2===i)return h.union(t[0],t[1],n);for(var a=[],o=0;o<i;o++)a.push(t[o].center);n=h.fromPoints(a,n);var u=n.center,s=n.radius;for(o=0;o<i;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,C)+c.radius)}return n.radius=s,n};var P=new e,U=new e,D=new e;h.fromOrientedBoundingBox=function(t,n){r(n)||(n=new h);var i=t.halfAxes,a=c.getColumn(i,0,P),o=c.getColumn(i,1,U),u=c.getColumn(i,2,D),s=e.magnitude(a),l=e.magnitude(o),f=e.magnitude(u);return n.center=e.clone(t.center,n.center),n.radius=Math.max(s,l,f),n},h.clone=function(t,n){if(r(t))return r(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new h(t.center,t.radius)},h.packedLength=4,h.pack=function(e,t,r){r=n(r,0);var i=e.center;return t[r++]=i.x,t[r++]=i.y,t[r++]=i.z,t[r]=e.radius,t},h.unpack=function(e,t,i){t=n(t,0),r(i)||(i=new h);var a=i.center;return a.x=e[t++],a.y=e[t++],a.z=e[t++],i.radius=e[t],i};var L=new e,F=new e;h.union=function(t,n,i){r(i)||(i=new h);var a=t.center,o=t.radius,u=n.center,s=n.radius,c=e.subtract(u,a,L),l=e.magnitude(c);if(o>=l+s)return t.clone(i),i;if(s>=l+o)return n.clone(i),i;var f=.5*(o+l+s),E=e.multiplyByScalar(c,(-o+f)/l,F);return e.add(E,a,E),e.clone(E,i.center),i.radius=f,i};var z=new e;h.expand=function(t,n,r){r=h.clone(t,r);var i=e.magnitude(e.subtract(n,r.center,z));return i>r.radius&&(r.radius=i),r},h.intersectPlane=function(t,n){var r=t.center,i=t.radius,a=n.normal,o=e.dot(a,r)+n.distance;return o<-i?u.OUTSIDE:o<i?u.INTERSECTING:u.INSIDE},h.transform=function(e,t,n){return r(n)||(n=new h),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=l.getMaximumScale(t)*e.radius,n};var B=new e;h.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,B);return e.magnitudeSquared(r)-t.radius*t.radius},h.transformWithoutScale=function(e,t,n){return r(n)||(n=new h),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var b=new e;h.computePlaneDistances=function(t,n,i,a){r(a)||(a=new s);var o=e.subtract(t.center,n,b),u=e.dot(i,o);return a.start=u-t.radius,a.stop=u+t.radius,a};for(var G=new e,q=new e,W=new e,H=new e,X=new e,V=new t,Y=new Array(8),Z=0;Z<8;++Z)Y[Z]=new e;var k=new o;return h.projectTo2D=function(t,r,i){r=n(r,k);var a=r.ellipsoid,o=t.center,u=t.radius,s=a.geodeticSurfaceNormal(o,G),c=e.cross(e.UNIT_Z,s,q);e.normalize(c,c);var l=e.cross(s,c,W);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var f=e.negate(l,X),E=e.negate(c,H),d=Y,m=d[0];e.add(s,l,m),e.add(m,c,m),m=d[1],e.add(s,l,m),e.add(m,E,m),m=d[2],e.add(s,f,m),e.add(m,E,m),m=d[3],e.add(s,f,m),e.add(m,c,m),e.negate(s,s),m=d[4],e.add(s,l,m),e.add(m,c,m),m=d[5],e.add(s,l,m),e.add(m,E,m),m=d[6],e.add(s,f,m),e.add(m,E,m),m=d[7],e.add(s,f,m),e.add(m,c,m);for(var _=d.length,p=0;p<_;++p){var y=d[p];e.add(o,y,y);var T=a.cartesianToCartographic(y,V);r.project(T,y)}i=h.fromPoints(d,i),o=i.center;var R=o.x,A=o.y,S=o.z;return o.x=S,o.y=R,o.z=A,i},h.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},h.equals=function(t,n){return t===n||r(t)&&r(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},h.prototype.intersectPlane=function(e){return h.intersectPlane(this,e)},h.prototype.distanceSquaredTo=function(e){return h.distanceSquaredTo(this,e)},h.prototype.computePlaneDistances=function(e,t,n){return h.computePlaneDistances(this,e,t,n)},h.prototype.isOccluded=function(e){return h.isOccluded(this,e)},h.prototype.equals=function(e){return h.equals(this,e)},h.prototype.clone=function(e){return h.clone(this,e)},h}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},i={};return t(i,{element:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(i.supportsFullscreen())return null!==i.element}}}),i.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var i,a=["webkit","moz","o","ms","khtml"],o=0,u=a.length;o<u;++o){var s=a[o];i=s+"RequestFullscreen","function"==typeof t[i]?(r.requestFullscreen=i,n=!0):(i=s+"RequestFullScreen","function"==typeof t[i]&&(r.requestFullscreen=i,n=!0)),i=s+"ExitFullscreen","function"==typeof document[i]?r.exitFullscreen=i:(i=s+"CancelFullScreen","function"==typeof document[i]&&(r.exitFullscreen=i)),i=s+"FullscreenEnabled",void 0!==document[i]?r.fullscreenEnabled=i:(i=s+"FullScreenEnabled",void 0!==document[i]&&(r.fullscreenEnabled=i)),i=s+"FullscreenElement",void 0!==document[i]?r.fullscreenElement=i:(i=s+"FullScreenElement",void 0!==document[i]&&(r.fullscreenElement=i)),i=s+"fullscreenchange",void 0!==document["on"+i]&&("ms"===s&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=s+"fullscreenerror",void 0!==document["on"+i]&&("ms"===s&&(i="MSFullscreenError"),r.fullscreenerror=i)}return n},i.requestFullscreen=function(e,t){i.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},i.exitFullscreen=function(){i.supportsFullscreen()&&document[r.exitFullscreen]()},i}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function i(){if(!t(A)&&(A=!1,!h())){var e=/ Chrome\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(A=!0,S=r(e[1]))}return A}function a(){return i()&&S}function o(){if(!t(v)&&(v=!1,!i()&&!h()&&/ Safari\/[\.0-9]+/.test(R.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(v=!0,N=r(e[1]))}return v}function u(){return o()&&N}function s(){if(!t(I)){I=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(R.userAgent);null!==e&&(I=!0,O=r(e[1]),O.isNightly=!!e[2])}return I}function c(){return s()&&O}function l(){if(!t(g)){g=!1;var e;"Microsoft Internet Explorer"===R.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(g=!0,M=r(e[1]))):"Netscape"===R.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(g=!0,M=r(e[1])))}return g}function f(){return l()&&M}function h(){if(!t(x)){x=!1;var e=/ Edge\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(x=!0,w=r(e[1]))}return x}function E(){return h()&&w}function d(){if(!t(C)){C=!1;var e=/Firefox\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(C=!0,P=r(e[1]))}return C}function m(){return t(U)||(U=/Windows/i.test(R.appVersion)),U}function _(){return d()&&P}function p(){return t(D)||(D="undefined"!=typeof PointerEvent&&(!t(R.pointerEnabled)||R.pointerEnabled)),D}function y(){ -if(!t(F)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;F=t(n)&&""!==n,F&&(L=n)}return F}function T(){return y()?L:void 0}var R;R="undefined"!=typeof navigator?navigator:{};var A,S,v,N,I,O,g,M,x,w,C,P,U,D,L,F,z={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isEdge:h,edgeVersion:E,isFirefox:d,firefoxVersion:_,isWindows:m,hardwareConcurrency:e(R.hardwareConcurrency,3),supportsPointerEvents:p,supportsImageRenderingPixelated:y,imageRenderingValue:T};return z.supportsFullscreen=function(){return n.supportsFullscreen()},z.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},z.supportsWebWorkers=function(){return"undefined"!=typeof Worker},z}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,i,a){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:a.BYTE,UNSIGNED_BYTE:a.UNSIGNED_BYTE,SHORT:a.SHORT,UNSIGNED_SHORT:a.UNSIGNED_SHORT,INT:a.INT,UNSIGNED_INT:a.UNSIGNED_INT,FLOAT:a.FLOAT,DOUBLE:a.DOUBLE};return o.getSizeInBytes=function(e){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.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},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 Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,i){switch(r=e(r,0),i=e(i,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,i);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,i);case o.SHORT:return new Int16Array(n,r,i);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,i);case o.INT:return new Int32Array(n,r,i);case o.UNSIGNED_INT:return new Uint32Array(n,r,i);case o.FLOAT:return new Float32Array(n,r,i);case o.DOUBLE:return new Float64Array(n,r,i)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},i(o)}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===n.POINTS||e===n.LINES||e===n.LINE_LOOP||e===n.LINE_STRIP||e===n.TRIANGLES||e===n.TRIANGLE_STRIP||e===n.TRIANGLE_FAN}};return e(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,i){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,i.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return a.computeNumberOfVertices=function(e){var n=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var i=e.attributes[r],a=i.values.length/i.componentsPerAttribute;n=a}return n},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(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 r}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.binormal=t.binormal,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,n,r,i){"use strict";var a={UNSIGNED_BYTE:i.UNSIGNED_BYTE,UNSIGNED_SHORT:i.UNSIGNED_SHORT,UNSIGNED_INT:i.UNSIGNED_INT};return a.getSizeInBytes=function(e){switch(e){case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},a.validate=function(t){return e(t)&&(t===a.UNSIGNED_BYTE||t===a.UNSIGNED_SHORT||t===a.UNSIGNED_INT)},a.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},a.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)},n(a)}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Intersect"],function(e,t,n,r,i){"use strict";function a(r,i,a){this.minimum=e.clone(t(r,e.ZERO)),this.maximum=e.clone(t(i,e.ZERO)),n(a)?a=e.clone(a):(a=e.add(this.minimum,this.maximum,new e),e.multiplyByScalar(a,.5,a)),this.center=a}a.fromPoints=function(t,r){if(n(r)||(r=new a),!n(t)||0===t.length)return r.minimum=e.clone(e.ZERO,r.minimum),r.maximum=e.clone(e.ZERO,r.maximum),r.center=e.clone(e.ZERO,r.center),r;for(var i=t[0].x,o=t[0].y,u=t[0].z,s=t[0].x,c=t[0].y,l=t[0].z,f=t.length,h=1;h<f;h++){var E=t[h],d=E.x,m=E.y,_=E.z;i=Math.min(d,i),s=Math.max(d,s),o=Math.min(m,o),c=Math.max(m,c),u=Math.min(_,u),l=Math.max(_,l)}var p=r.minimum;p.x=i,p.y=o,p.z=u;var y=r.maximum;y.x=s,y.y=c,y.z=l;var T=e.add(p,y,r.center);return e.multiplyByScalar(T,.5,T),r},a.clone=function(t,r){if(n(t))return n(r)?(r.minimum=e.clone(t.minimum,r.minimum),r.maximum=e.clone(t.maximum,r.maximum),r.center=e.clone(t.center,r.center),r):new a(t.minimum,t.maximum)},a.equals=function(t,r){return t===r||n(t)&&n(r)&&e.equals(t.center,r.center)&&e.equals(t.minimum,r.minimum)&&e.equals(t.maximum,r.maximum)};var o=new e;return a.intersectPlane=function(t,n){o=e.subtract(t.maximum,t.minimum,o);var r=e.multiplyByScalar(o,.5,o),a=n.normal,u=r.x*Math.abs(a.x)+r.y*Math.abs(a.y)+r.z*Math.abs(a.z),s=e.dot(t.center,a)+n.distance;return s-u>0?i.INSIDE:s+u<0?i.OUTSIDE:i.INTERSECTING},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.intersectPlane=function(e){return a.intersectPlane(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a}),define("Core/Cartesian2",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i){"use strict";function a(t,n){this.x=e(t,0),this.y=e(n,0)}a.fromElements=function(e,n,r){return t(r)?(r.x=e,r.y=n,r):new a(e,n)},a.clone=function(e,n){if(t(e))return t(n)?(n.x=e.x,n.y=e.y,n):new a(e.x,e.y)},a.fromCartesian3=a.clone,a.fromCartesian4=a.clone,a.packedLength=2,a.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r]=t.y,n},a.unpack=function(n,r,i){return r=e(r,0),t(i)||(i=new a),i.x=n[r++],i.y=n[r],i},a.packArray=function(e,n){var r=e.length;t(n)?n.length=2*r:n=new Array(2*r);for(var i=0;i<r;++i)a.pack(e[i],n,2*i);return n},a.unpackArray=function(e,n){var r=e.length;t(n)?n.length=r/2:n=new Array(r/2);for(var i=0;i<r;i+=2){var o=i/2;n[o]=a.unpack(e,i,n[o])}return n},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,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},a.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},a.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},a.magnitude=function(e){return Math.sqrt(a.magnitudeSquared(e))};var o=new a;a.distance=function(e,t){return a.subtract(e,t,o),a.magnitude(o)},a.distanceSquared=function(e,t){return a.subtract(e,t,o),a.magnitudeSquared(o)},a.normalize=function(e,t){var n=a.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t},a.dot=function(e,t){return e.x*t.x+e.y*t.y},a.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n},a.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n},a.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n},a.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n},a.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n},a.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n},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,n,r){return a.multiplyByScalar(t,n,u),r=a.multiplyByScalar(e,1-n,r),a.add(u,r,r)};var s=new a,c=new a;a.angleBetween=function(e,t){return a.normalize(e,s),a.normalize(t,c),i.acosClamped(a.dot(s,c))};var l=new a;return a.mostOrthogonalAxis=function(e,t){var n=a.normalize(e,l);return a.abs(n,n),t=n.x<=n.y?a.clone(a.UNIT_X,t):a.clone(a.UNIT_Y,t)},a.equals=function(e,n){return e===n||t(e)&&t(n)&&e.x===n.x&&e.y===n.y},a.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},a.equalsEpsilon=function(e,n,r,a){return e===n||t(e)&&t(n)&&i.equalsEpsilon(e.x,n.x,r,a)&&i.equalsEpsilon(e.y,n.y,r,a)},a.ZERO=r(new a(0,0)),a.UNIT_X=r(new a(1,0)),a.UNIT_Y=r(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,n){return a.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return"("+this.x+", "+this.y+")"},a}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function n(e,n,r){var i=e+n;return t.sign(e)!==t.sign(n)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(n)))<r?0:i}var r={};return r.computeDiscriminant=function(e,t,n){var r=t*t-4*e*n;return r},r.computeRealRoots=function(e,r,i){var a;if(0===e)return 0===r?[]:[-i/r];if(0===r){if(0===i)return[0,0];var o=Math.abs(i),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(a=-i/e,a<0)return[];var s=Math.sqrt(a);return[-s,s]}if(0===i)return a=-r/e,a<0?[a,0]:[0,a];var c=r*r,l=4*e*i,f=n(c,-l,t.EPSILON14);if(f<0)return[];var h=-.5*n(r,t.sign(r)*Math.sqrt(f),t.EPSILON14);return r>0?[h/e,i/h]:[i/h,h/e]},r}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function n(e,t,n,r){var i,a,o=e,u=t/3,s=n/3,c=r,l=o*s,f=u*c,h=u*u,E=s*s,d=o*s-h,m=o*c-u*s,_=u*c-E,p=4*d*_-m*m;if(p<0){var y,T,R;h*f>=l*E?(y=o,T=d,R=-2*u*d+o*m):(y=c,T=_,R=-c*m+2*s*_);var A=R<0?-1:1,S=-A*Math.abs(y)*Math.sqrt(-p);a=-R+S;var v=a/2,N=v<0?-Math.pow(-v,1/3):Math.pow(v,1/3),I=a===S?-N:-T/N;return i=T<=0?N+I:-R/(N*N+I*I+T),h*f>=l*E?[(i-u)/o]:[-c/(i+s)]}var O=d,g=-2*u*d+o*m,M=_,x=-c*m+2*s*_,w=Math.sqrt(p),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*w,-g)/3);i=2*Math.sqrt(-O);var U=Math.cos(P);a=i*U;var D=i*(-U/2-C*Math.sin(P)),L=a+D>2*u?a-u:D-u,F=o,z=L/F;P=Math.abs(Math.atan2(c*w,-x)/3),i=2*Math.sqrt(-M),U=Math.cos(P),a=i*U,D=i*(-U/2-C*Math.sin(P));var B=-c,b=a+D<2*s?a+s:D+s,G=B/b,q=F*b,W=-L*b-F*B,H=L*B,X=(s*W-u*H)/(-u*W+s*q);return z<=X?z<=G?X<=G?[z,X,G]:[z,G,X]:[G,z,X]:z<=G?[X,z,G]:X<=G?[X,G,z]:[G,X,z]}var r={};return r.computeDiscriminant=function(e,t,n,r){var i=e*e,a=t*t,o=n*n,u=r*r,s=18*e*t*n*r+a*o-27*i*u-4*(e*o*n+a*t*r);return s},r.computeRealRoots=function(e,r,i,a){var o,u;if(0===e)return t.computeRealRoots(r,i,a);if(0===r){if(0===i){if(0===a)return[0,0,0];u=-a/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===a?(o=t.computeRealRoots(e,0,i),0===o.Length?[0]:[o[0],0,o[1]]):n(e,0,i,a)}return 0===i?0===a?(u=-r/e,u<0?[u,0,0]:[0,0,u]):n(e,r,0,a):0===a?(o=t.computeRealRoots(e,r,i),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):n(e,r,i,a)},r}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,n,r){"use strict";function i(t,i,a,o){var u=t*t,s=i-3*u/8,c=a-i*t/2+u*t/8,l=o-a*t/4+i*u/16-3*u*u/256,f=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(f.length>0){var h=-t/4,E=f[f.length-1];if(Math.abs(E)<n.EPSILON14){var d=r.computeRealRoots(1,s,l);if(2===d.length){var m,_=d[0],p=d[1];if(_>=0&&p>=0){var y=Math.sqrt(_),T=Math.sqrt(p);return[h-T,h-y,h+y,h+T]}if(_>=0&&p<0)return m=Math.sqrt(_),[h-m,h+m];if(_<0&&p>=0)return m=Math.sqrt(p),[h-m,h+m]}return[]}if(E>0){var R=Math.sqrt(E),A=(s+E-c/R)/2,S=(s+E+c/R)/2,v=r.computeRealRoots(1,R,A),N=r.computeRealRoots(1,-R,S);return 0!==v.length?(v[0]+=h,v[1]+=h,0!==N.length?(N[0]+=h,N[1]+=h,v[1]<=N[0]?[v[0],v[1],N[0],N[1]]:N[1]<=v[0]?[N[0],N[1],v[0],v[1]]:v[0]>=N[0]&&v[1]<=N[1]?[N[0],v[0],v[1],N[1]]:N[0]>=v[0]&&N[1]<=v[1]?[v[0],N[0],N[1],v[1]]:v[0]>N[0]&&v[0]<N[1]?[N[0],v[0],N[1],v[1]]:[v[0],N[0],v[1],N[1]]):v):0!==N.length?(N[0]+=h,N[1]+=h,N):[]}}return[]}function a(t,i,a,o){var u=a*a,s=i*i,c=t*t,l=-2*i,f=a*t+s-4*o,h=c*o-a*i*t+u,E=e.computeRealRoots(1,l,f,h);if(E.length>0){var d,m,_=E[0],p=i-_,y=p*p,T=t/2,R=p/2,A=y-4*o,S=y+4*Math.abs(o),v=c-4*_,N=c+4*Math.abs(_);if(_<0||A*N<v*S){var I=Math.sqrt(v);d=I/2,m=0===I?0:(t*R-a)/I}else{var O=Math.sqrt(A);d=0===O?0:(t*R-a)/O,m=O/2}var g,M;0===T&&0===d?(g=0,M=0):n.sign(T)===n.sign(d)?(g=T+d,M=_/g):(M=T-d,g=_/M);var x,w;0===R&&0===m?(x=0,w=0):n.sign(R)===n.sign(m)?(x=R+m,w=o/x):(w=R-m,x=o/w);var C=r.computeRealRoots(1,g,x),P=r.computeRealRoots(1,M,w);if(0!==C.length)return 0!==P.length?C[1]<=P[0]?[C[0],C[1],P[0],P[1]]:P[1]<=C[0]?[P[0],P[1],C[0],C[1]]:C[0]>=P[0]&&C[1]<=P[1]?[P[0],C[0],C[1],P[1]]:P[0]>=C[0]&&P[1]<=C[1]?[C[0],P[0],P[1],C[1]]:C[0]>P[0]&&C[0]<P[1]?[P[0],C[0],P[1],C[1]]:[C[0],P[0],C[1],P[1]]:C;if(0!==P.length)return P}return[]}var o={};return o.computeDiscriminant=function(e,t,n,r,i){var a=e*e,o=a*e,u=t*t,s=u*t,c=n*n,l=c*n,f=r*r,h=f*r,E=i*i,d=E*i,m=u*c*f-4*s*h-4*e*l*f+18*e*t*n*h-27*a*f*f+256*o*d+i*(18*s*n*r-4*u*l+16*e*c*c-80*e*t*c*r-6*e*u*f+144*a*n*f)+E*(144*e*u*n-27*u*u-128*a*c-192*a*t*r);return m},o.computeRealRoots=function(t,r,o,u,s){if(Math.abs(t)<n.EPSILON15)return e.computeRealRoots(r,o,u,s);var c=r/t,l=o/t,f=u/t,h=s/t,E=c<0?1:0;switch(E+=l<0?E+1:E,E+=f<0?E+1:E,E+=h<0?E+1:E){case 0:return i(c,l,f,h);case 1:return a(c,l,f,h);case 2:return a(c,l,f,h);case 3:return i(c,l,f,h);case 4:return i(c,l,f,h);case 5:return a(c,l,f,h);case 6:return i(c,l,f,h);case 7:return i(c,l,f,h);case 8:return a(c,l,f,h);case 9:return i(c,l,f,h);case 10:return i(c,l,f,h);case 11:return a(c,l,f,h);case 12:return i(c,l,f,h);case 13:return i(c,l,f,h);case 14:return i(c,l,f,h);case 15:return i(c,l,f,h);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function i(n,r){r=e.clone(t(r,e.ZERO)),e.equals(r,e.ZERO)||e.normalize(r,r),this.origin=e.clone(t(n,e.ZERO)),this.direction=r}return i.getPoint=function(t,r,i){return n(i)||(i=new e),i=e.multiplyByScalar(t.direction,r,i),e.add(t.origin,i,i)},i}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,n,r,i,a,o,u,s,c){"use strict";function l(e,t,n,r){var i=t*t-4*e*n;if(!(i<0)){if(i>0){var a=1/(2*e),o=Math.sqrt(i),u=(-t+o)*a,s=(-t-o)*a;return u<s?(r.root0=u,r.root1=s):(r.root0=s,r.root1=u),r}var c=-t/(2*e);if(0!==c)return r.root0=r.root1=c,r}}function f(t,n,i){r(i)||(i={});var a=t.origin,o=t.direction,u=n.center,s=n.radius*n.radius,c=e.subtract(a,u,p),f=e.dot(o,o),h=2*e.dot(o,c),E=e.magnitudeSquared(c)-s,d=l(f,h,E,A);if(r(d))return i.start=d.root0,i.stop=d.root1,i}function h(e,t,n){var r=e+t;return a.sign(e)!==a.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))<n?0:r}function E(t,n,r,i,c){var l,f=i*i,E=c*c,d=(t[o.COLUMN1ROW1]-t[o.COLUMN2ROW2])*E,m=c*(i*h(t[o.COLUMN1ROW0],t[o.COLUMN0ROW1],a.EPSILON15)+n.y),_=t[o.COLUMN0ROW0]*f+t[o.COLUMN2ROW2]*E+i*n.x+r,p=E*h(t[o.COLUMN2ROW1],t[o.COLUMN1ROW2],a.EPSILON15),y=c*(i*h(t[o.COLUMN2ROW0],t[o.COLUMN0ROW2])+n.z),T=[];if(0===y&&0===p){if(l=u.computeRealRoots(d,m,_),0===l.length)return T;var R=l[0],A=Math.sqrt(Math.max(1-R*R,0));if(T.push(new e(i,c*R,c*-A)),T.push(new e(i,c*R,c*A)),2===l.length){var S=l[1],v=Math.sqrt(Math.max(1-S*S,0));T.push(new e(i,c*S,c*-v)),T.push(new e(i,c*S,c*v))}return T}var N=y*y,I=p*p,O=d*d,g=y*p,M=O+I,x=2*(m*d+g),w=2*_*d+m*m-I+N,C=2*(_*m-g),P=_*_-N;if(0===M&&0===x&&0===w&&0===C)return T;l=s.computeRealRoots(M,x,w,C,P);var U=l.length;if(0===U)return T;for(var D=0;D<U;++D){var L,F=l[D],z=F*F,B=Math.max(1-z,0),b=Math.sqrt(B);L=a.sign(d)===a.sign(_)?h(d*z+_,m*F,a.EPSILON12):a.sign(_)===a.sign(m*F)?h(d*z,m*F+_,a.EPSILON12):h(d*z+m*F,_,a.EPSILON12);var G=h(p*F,y,a.EPSILON15),q=L*G;q<0?T.push(new e(i,c*F,c*b)):q>0?T.push(new e(i,c*F,c*-b)):0!==b?(T.push(new e(i,c*F,c*-b)),T.push(new e(i,c*F,c*b)),++D):T.push(new e(i,c*F,c*b))}return T}var d={};d.rayPlane=function(t,n,i){r(i)||(i=new e);var o=t.origin,u=t.direction,s=n.normal,c=e.dot(s,u);if(!(Math.abs(c)<a.EPSILON15)){var l=(-n.distance-e.dot(s,o))/c;if(!(l<0))return i=e.multiplyByScalar(u,l,i),e.add(o,i,i)}};var m=new e,_=new e,p=new e,y=new e,T=new e;d.rayTriangleParametric=function(t,r,i,o,u){u=n(u,!1);var s,c,l,f,h,E=t.origin,d=t.direction,R=e.subtract(i,r,m),A=e.subtract(o,r,_),S=e.cross(d,A,p),v=e.dot(R,S);if(u){if(v<a.EPSILON6)return;if(s=e.subtract(E,r,y),l=e.dot(s,S),l<0||l>v)return;if(c=e.cross(s,R,T),f=e.dot(d,c),f<0||l+f>v)return;h=e.dot(A,c)/v}else{if(Math.abs(v)<a.EPSILON6)return;var N=1/v;if(s=e.subtract(E,r,y),l=e.dot(s,S)*N,l<0||l>1)return;if(c=e.cross(s,R,T),f=e.dot(d,c)*N,f<0||l+f>1)return;h=e.dot(A,c)*N}return h},d.rayTriangle=function(t,n,i,a,o,u){var s=d.rayTriangleParametric(t,n,i,a,o);if(r(s)&&!(s<0))return r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var R=new c;d.lineSegmentTriangle=function(t,n,i,a,o,u,s){var c=R;e.clone(t,c.origin),e.subtract(n,t,c.direction),e.normalize(c.direction,c.direction);var l=d.rayTriangleParametric(c,i,a,o,u);if(!(!r(l)||l<0||l>e.distance(t,n)))return r(s)||(s=new e), -e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var A={root0:0,root1:0};d.raySphere=function(e,t,n){if(n=f(e,t,n),r(n)&&!(n.stop<0))return n.start=Math.max(n.start,0),n};var S=new c;d.lineSegmentSphere=function(t,n,i,a){var o=S;e.clone(t,o.origin);var u=e.subtract(n,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),a=f(o,i,a),!(!r(a)||a.stop<0||a.start>s))return a.start=Math.max(a.start,0),a.stop=Math.min(a.stop,s),a};var v=new e,N=new e;d.rayEllipsoid=function(t,n){var r,i,a,o,u,s=n.oneOverRadii,c=e.multiplyComponents(s,t.origin,v),l=e.multiplyComponents(s,t.direction,N),f=e.magnitudeSquared(c),h=e.dot(c,l);if(f>1){if(h>=0)return;var E=h*h;if(r=f-1,i=e.magnitudeSquared(l),a=i*r,E<a)return;if(E>a){o=h*h-a,u=-h+Math.sqrt(o);var d=u/i,m=r/u;return d<m?{start:d,stop:m}:{start:m,stop:d}}var _=Math.sqrt(r/i);return{start:_,stop:_}}return f<1?(r=f-1,i=e.magnitudeSquared(l),a=i*r,o=h*h-a,u=-h+Math.sqrt(o),{start:0,stop:u/i}):h<0?(i=e.magnitudeSquared(l),{start:0,stop:-h/i}):void 0};var I=new e,O=new e,g=new e,M=new e,x=new e,w=new o,C=new o,P=new o,U=new o,D=new o,L=new o,F=new o,z=new e,B=new e,b=new t;d.grazingAltitudeLocation=function(t,n){var i=t.origin,u=t.direction;if(!e.equals(i,e.ZERO)){var s=n.geodeticSurfaceNormal(i,I);if(e.dot(u,s)>=0)return i}var c=r(this.rayEllipsoid(t,n)),l=n.transformPositionToScaledSpace(u,I),f=e.normalize(l,l),h=e.mostOrthogonalAxis(l,M),d=e.normalize(e.cross(h,f,O),O),m=e.normalize(e.cross(f,d,g),g),_=w;_[0]=f.x,_[1]=f.y,_[2]=f.z,_[3]=d.x,_[4]=d.y,_[5]=d.z,_[6]=m.x,_[7]=m.y,_[8]=m.z;var p=o.transpose(_,C),y=o.fromScale(n.radii,P),T=o.fromScale(n.oneOverRadii,U),R=D;R[0]=0,R[1]=-u.z,R[2]=u.y,R[3]=u.z,R[4]=0,R[5]=-u.x,R[6]=-u.y,R[7]=u.x,R[8]=0;var A,S,v=o.multiply(o.multiply(p,T,L),R,L),N=o.multiply(o.multiply(v,y,F),_,F),G=o.multiplyByVector(v,i,x),q=E(N,e.negate(G,I),0,0,1),W=q.length;if(W>0){for(var H=e.clone(e.ZERO,B),X=Number.NEGATIVE_INFINITY,V=0;V<W;++V){A=o.multiplyByVector(y,o.multiplyByVector(_,q[V],z),z);var Y=e.normalize(e.subtract(A,i,M),M),Z=e.dot(Y,u);Z>X&&(X=Z,H=e.clone(A,H))}var k=n.cartesianToCartographic(H,b);return X=a.clamp(X,0,1),S=e.magnitude(e.subtract(H,i,M))*Math.sqrt(1-X*X),S=c?-S:S,k.height=S,n.cartographicToCartesian(k,new e)}};var G=new e;return d.lineSegmentPlane=function(t,n,i,o){r(o)||(o=new e);var u=e.subtract(n,t,G),s=i.normal,c=e.dot(s,u);if(!(Math.abs(c)<a.EPSILON6)){var l=e.dot(s,t),f=-(i.distance+l)/c;if(!(f<0||f>1))return e.multiplyByScalar(u,f,o),e.add(t,o,o),o}},d.trianglePlaneIntersection=function(t,n,r,i){var a=i.normal,o=i.distance,u=e.dot(a,t)+o<0,s=e.dot(a,n)+o<0,c=e.dot(a,r)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var f,h;if(1!==l&&2!==l||(f=new e,h=new e),1===l){if(u)return d.lineSegmentPlane(t,n,i,f),d.lineSegmentPlane(t,r,i,h),{positions:[t,n,r,f,h],indices:[0,3,4,1,2,4,1,4,3]};if(s)return d.lineSegmentPlane(n,r,i,f),d.lineSegmentPlane(n,t,i,h),{positions:[t,n,r,f,h],indices:[1,3,4,2,0,4,2,4,3]};if(c)return d.lineSegmentPlane(r,t,i,f),d.lineSegmentPlane(r,n,i,h),{positions:[t,n,r,f,h],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return d.lineSegmentPlane(n,t,i,f),d.lineSegmentPlane(r,t,i,h),{positions:[t,n,r,f,h],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return d.lineSegmentPlane(r,n,i,f),d.lineSegmentPlane(t,n,i,h),{positions:[t,n,r,f,h],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return d.lineSegmentPlane(t,r,i,f),d.lineSegmentPlane(n,r,i,h),{positions:[t,n,r,f,h],indices:[0,1,4,0,4,3,2,3,4]}}},d}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";function i(t,n){this.normal=e.clone(t),this.distance=n}i.fromPointNormal=function(n,r,a){var o=-e.dot(r,n);return t(a)?(e.clone(r,a.normal),a.distance=o,a):new i(r,o)};var a=new e;return i.fromCartesian4=function(n,r){var o=e.fromCartesian4(n,a),u=n.w;return t(r)?(e.clone(o,r.normal),r.distance=u,r):new i(o,u)},i.getPointDistance=function(t,n){return e.dot(t.normal,n)+t.distance},i.ORIGIN_XY_PLANE=r(new i(e.UNIT_Z,0)),i.ORIGIN_YZ_PLANE=r(new i(e.UNIT_X,0)),i.ORIGIN_ZX_PLANE=r(new i(e.UNIT_Y,0)),i}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,n,r,i){return t(e).then(n,r,i)}function t(e){var t,n;return e instanceof r?t=e:u(e)?(n=o(),e.then(function(e){n.resolve(e)},function(e){n.reject(e)},function(e){n.progress(e)}),t=n.promise):t=i(e),t}function n(t){return e(t,a)}function r(e){this.then=e}function i(e){var n=new r(function(n){try{return t(n?n(e):e)}catch(e){return a(e)}});return n}function a(e){var n=new r(function(n,r){try{return r?t(r(e)):a(e)}catch(e){return a(e)}});return n}function o(){function e(e,t,n){return h(e,t,n)}function n(e){return d(e)}function i(e){return d(a(e))}function u(e){return E(e)}var s,c,l,f,h,E,d;return c=new r(e),s={then:e,resolve:n,reject:i,progress:u,promise:c,resolver:{resolve:n,reject:i,progress:u}},l=[],f=[],h=function(e,t,n){var r,i;return r=o(),i="function"==typeof n?function(e){try{r.progress(n(e))}catch(e){r.progress(e)}}:function(e){r.progress(e)},l.push(function(n){n.then(e,t).then(r.resolve,r.reject,i)}),f.push(i),r.promise},E=function(e){return m(f,e),e},d=function(e){return e=t(e),h=e.then,d=t,E=p,m(l,e),f=l=A,e},s}function u(e){return e&&"function"==typeof e.then}function s(t,n,r,i,a){return _(2,arguments),e(t,function(t){function u(e){m(e)}function s(e){d(e)}var c,l,f,h,E,d,m,_,y,T;if(y=t.length>>>0,c=Math.max(0,Math.min(n,y)),f=[],l=y-c+1,h=[],E=o(),c)for(_=E.progress,m=function(e){h.push(e),--l||(d=m=p,E.reject(h))},d=function(e){f.push(e),--c||(d=m=p,E.resolve(f))},T=0;T<y;++T)T in t&&e(t[T],s,u,_);else E.resolve(f);return E.then(r,i,a)})}function c(e,t,n,r){function i(e){return t?t(e[0]):e[0]}return s(e,1,i,n,r)}function l(e,t,n,r){return _(1,arguments),h(e,y).then(t,n,r)}function f(){return h(arguments,y)}function h(t,n){return e(t,function(t){var r,i,a,u,s,c;if(a=i=t.length>>>0,r=[],c=o(),a)for(u=function(t,i){e(t,n).then(function(e){r[i]=e,--a||c.resolve(r)},c.reject)},s=0;s<i;s++)s in t?u(t[s],s):--a;else c.resolve(r);return c.promise})}function E(t,n){var r=R.call(arguments,1);return e(t,function(t){var i;return i=t.length,r[0]=function(t,r,a){return e(t,function(t){return e(r,function(e){return n(t,e,a,i)})})},T.apply(t,r)})}function d(t,n,r){var i=arguments.length>2;return e(t,function(e){return e=i?r:e,n.resolve(e),e},function(e){return n.reject(e),a(e)},n.progress)}function m(e,t){for(var n,r=0;n=e[r++];)n(t)}function _(e,t){for(var n,r=t.length;r>e;)if(n=t[--r],null!=n&&"function"!=typeof n)throw new Error("arg "+r+" must be a function")}function p(){}function y(e){return e}var T,R,A;return e.defer=o,e.resolve=t,e.reject=n,e.join=f,e.all=l,e.map=h,e.reduce=E,e.any=c,e.some=s,e.chain=d,e.isPromise=u,r.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(A,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return l(t,function(t){return e.apply(A,t)})})}},R=[].slice,T=[].reduce||function(e){var t,n,r,i,a;if(a=0,t=Object(this),i=t.length>>>0,n=arguments,n.length<=1)for(;;){if(a in t){r=t[a++];break}if(++a>=i)throw new TypeError}else r=n[1];for(;a<i;++a)a in t&&(r=e(r,t[a],a,t));return r},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n,r){t(i[n])||(i[n]=!0,console.log(e(r,n)))}var i={};return r.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.",r}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,n){"use strict";function r(e,t){n(e,t)}return r}),define("Core/binarySearch",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e,t,n){for(var r,i,a=0,o=e.length-1;a<=o;)if(r=~~((a+o)/2),i=n(e[r],t),i<0)a=r+1;else{if(!(i>0))return r;o=r-1}return~(o+1)}return n}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,n,r,i){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=r,this.ut1MinusUtc=i}return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,n=0,r=t[n++],i=function(e,t,n,r){n||(n=" ");var i=e.length>=t?"":Array(1+t-e.length>>>0).join(n);return r?e+i:i+e},a=function(e,t,n,r,a,o){var u=r-e.length;return u>0&&(e=n||!a?i(e,r,o,n):e.slice(0,t.length)+i("",u,"0",!0)+e.slice(t.length)),e},o=function(e,t,n,r,o,u,s){var c=e>>>0;return n=n&&c&&{2:"0b",8:"0",16:"0x"}[t]||"",e=n+i(c.toString(t),u||0,"0",!1),a(e,n,r,o,s)},u=function(e,t,n,r,i,o){return null!=r&&(e=e.slice(0,r)),a(e,"",t,n,i,o)},s=function(e,r,s,c,l,f,h){var E,d,m,_,p;if("%%"==e)return"%";for(var y=!1,T="",R=!1,A=!1,S=" ",v=s.length,N=0;s&&N<v;N++)switch(s.charAt(N)){case" ":T=" ";break;case"+":T="+";break;case"-":y=!0;break;case"'":S=s.charAt(N+1);break;case"0":R=!0;break;case"#":A=!0}if(c=c?"*"==c?+t[n++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,c<0&&(c=-c,y=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(f=f?"*"==f?+t[n++]:"*"==f.charAt(0)?+t[f.slice(1,-1)]:+f:"fFeE".indexOf(h)>-1?6:"d"==h?0:void 0,p=r?t[r.slice(0,-1)]:t[n++],h){case"s":return u(String(p),y,c,f,R,S);case"c":return u(String.fromCharCode(+p),y,c,f,R);case"b":return o(p,2,A,y,c,f,R);case"o":return o(p,8,A,y,c,f,R);case"x":return o(p,16,A,y,c,f,R);case"X":return o(p,16,A,y,c,f,R).toUpperCase();case"u":return o(p,10,A,y,c,f,R);case"i":case"d":return E=+p||0,E=Math.round(E-E%1),d=E<0?"-":T,p=d+i(String(Math.abs(E)),f,"0",!1),a(p,d,y,c,R);case"e":case"E":case"f":case"F":case"g":case"G":return E=+p,d=E<0?"-":T,m=["toExponential","toFixed","toPrecision"]["efg".indexOf(h.toLowerCase())],_=["toString","toUpperCase"]["eEfFgG".indexOf(h)%2],p=d+Math.abs(E)[m](f),a(p,d,y,c,R)[_]();default:return e}};return r.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,n,r,i,a,o,u){this.year=e,this.month=t,this.day=n,this.hour=r,this.minute=i,this.second=a,this.millisecond=o,this.isLeapSecond=u}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e(t)}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,n,r,i,a,o,u,s,c){"use strict";function l(e,t){return m.compare(e.julianDate,t.julianDate)}function f(e){T.julianDate=e;var n=m.leapSeconds,r=t(n,T,l);r<0&&(r=~r),r>=n.length&&(r=n.length-1);var i=n[r].offset;if(r>0){var a=m.secondsDifference(n[r].julianDate,e);a>i&&(r--,i=n[r].offset)}m.addSeconds(e,i,e)}function h(e,n){T.julianDate=e;var r=m.leapSeconds,i=t(r,T,l);if(i<0&&(i=~i),0===i)return m.addSeconds(e,-r[0].offset,n);if(i>=r.length)return m.addSeconds(e,-r[i-1].offset,n);var a=m.secondsDifference(r[i].julianDate,e);return 0===a?m.addSeconds(e,-r[i].offset,n):a<=1?void 0:m.addSeconds(e,-r[--i].offset,n)}function E(e,t,n){var r=t/s.SECONDS_PER_DAY|0;return e+=r,t-=s.SECONDS_PER_DAY*r,t<0&&(e--,t+=s.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function d(e,t,n,r,i,a,o){var u=(t-14)/12|0,c=e+4800+u,l=(1461*c/4|0)+(367*(t-2-12*u)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;r-=12,r<0&&(r+=24);var f=a+(r*s.SECONDS_PER_HOUR+i*s.SECONDS_PER_MINUTE+o*s.SECONDS_PER_MILLISECOND);return f>=43200&&(l-=1),[l,f]}function m(e,t,r){this.dayNumber=void 0,this.secondsOfDay=void 0,e=n(e,0),t=n(t,0),r=n(r,c.UTC);var i=0|e;t+=(e-i)*s.SECONDS_PER_DAY,E(i,t,this),r===c.UTC&&f(this)}var _=new a,p=[31,28,31,30,31,30,31,31,30,31,30,31],y=29,T=new u,R=/^(\d{4})$/,A=/^(\d{4})-(\d{2})$/,S=/^(\d{4})-?(\d{3})$/,v=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,N=/^(\d{4})-?(\d{2})-?(\d{2})$/,I=/([Z+\-])?(\d{2})?:?(\d{2})?$/,O=/^(\d{2})(\.\d+)?/.source+I.source,g=/^(\d{2}):?(\d{2})(\.\d+)?/.source+I.source,M=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+I.source;m.fromDate=function(e,t){var n=d(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r(t)?(E(n[0],n[1],t),f(t),t):new m(n[0],n[1],c.UTC)},m.fromIso8601=function(e,t){e=e.replace(",",".");var n,i,a,u=e.split("T"),s=1,l=1,h=0,_=0,T=0,I=0,x=u[0],w=u[1];if(u=x.match(N),null!==u)n=+u[1],s=+u[2],l=+u[3];else if(u=x.match(A),null!==u)n=+u[1],s=+u[2];else if(u=x.match(R),null!==u)n=+u[1];else{var C;if(u=x.match(S),null!==u)n=+u[1],C=+u[2],a=o(n);else if(u=x.match(v),null!==u){n=+u[1];var P=+u[2],U=+u[3]||0,D=new Date(Date.UTC(n,0,4));C=7*P+U-D.getUTCDay()-3}i=new Date(Date.UTC(n,0,1)),i.setUTCDate(C),s=i.getUTCMonth()+1,l=i.getUTCDate()}a=o(n);var L;if(r(w)){u=w.match(M),null!==u?(h=+u[1],_=+u[2],T=+u[3],I=1e3*+(u[4]||0),L=5):(u=w.match(g),null!==u?(h=+u[1],_=+u[2],T=60*+(u[3]||0),L=4):(u=w.match(O),null!==u&&(h=+u[1],_=60*+(u[2]||0),L=3)));var F=u[L],z=+u[L+1],B=+(u[L+2]||0);switch(F){case"+":h-=z,_-=B;break;case"-":h+=z,_+=B;break;case"Z":break;default:_+=new Date(Date.UTC(n,s-1,l,h,_)).getTimezoneOffset()}}else _+=new Date(n,s-1,l).getTimezoneOffset();var b=60===T;for(b&&T--;_>=60;)_-=60,h++;for(;h>=24;)h-=24,l++;for(i=a&&2===s?y:p[s-1];l>i;)l-=i,s++,s>12&&(s-=12,n++),i=a&&2===s?y:p[s-1];for(;_<0;)_+=60,h--;for(;h<0;)h+=24,l--;for(;l<1;)s--,s<1&&(s+=12,n--),i=a&&2===s?y:p[s-1],l+=i;var G=d(n,s,l,h,_,T,I);return r(t)?(E(G[0],G[1],t),f(t)):t=new m(G[0],G[1],c.UTC),b&&m.addSeconds(t,1,t),t},m.now=function(e){return m.fromDate(new Date,e)};var x=new m(0,0,c.TAI);return m.toGregorianDate=function(e,t){var n=!1,i=h(e,x);r(i)||(m.addSeconds(e,-1,x),i=h(x,x),n=!0);var o=i.dayNumber,u=i.secondsOfDay;u>=43200&&(o+=1);var c=o+68569|0,l=4*c/146097|0;c=c-((146097*l+3)/4|0)|0;var f=4e3*(c+1)/1461001|0;c=c-(1461*f/4|0)+31|0;var E=80*c/2447|0,d=c-(2447*E/80|0)|0;c=E/11|0;var _=E+2-12*c|0,p=100*(l-49)+f+c|0,y=u/s.SECONDS_PER_HOUR|0,T=u-y*s.SECONDS_PER_HOUR,R=T/s.SECONDS_PER_MINUTE|0;T-=R*s.SECONDS_PER_MINUTE;var A=0|T,S=(T-A)/s.SECONDS_PER_MILLISECOND;return y+=12,y>23&&(y-=24),n&&(A+=1),r(t)?(t.year=p,t.month=_,t.day=d,t.hour=y,t.minute=R,t.second=A,t.millisecond=S,t.isLeapSecond=n,t):new a(p,_,d,y,R,A,S,n)},m.toDate=function(e){var t=m.toGregorianDate(e,_),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))},m.toIso8601=function(t,n){var i,a=m.toGregorianDate(t,a);return r(n)||0===a.millisecond?r(n)&&0!==n?(i=(.01*a.millisecond).toFixed(n).replace(".","").slice(0,n),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",a.year,a.month,a.day,a.hour,a.minute,a.second,i)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",a.year,a.month,a.day,a.hour,a.minute,a.second):(i=(.01*a.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",a.year,a.month,a.day,a.hour,a.minute,a.second,i))},m.clone=function(e,t){if(r(e))return r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new m(e.dayNumber,e.secondsOfDay,c.TAI)},m.compare=function(e,t){var n=e.dayNumber-t.dayNumber;return 0!==n?n:e.secondsOfDay-t.secondsOfDay},m.equals=function(e,t){return e===t||r(e)&&r(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},m.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(m.secondsDifference(e,t))<=n},m.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},m.secondsDifference=function(e,t){var n=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return n+(e.secondsOfDay-t.secondsOfDay)},m.daysDifference=function(e,t){var n=e.dayNumber-t.dayNumber,r=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return n+r},m.computeTaiMinusUtc=function(e){T.julianDate=e;var n=m.leapSeconds,r=t(n,T,l);return r<0&&(r=~r,--r,r<0&&(r=0)),n[r].offset},m.addSeconds=function(e,t,n){return E(e.dayNumber,e.secondsOfDay+t,n)},m.addMinutes=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return E(e.dayNumber,r,n)},m.addHours=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return E(e.dayNumber,r,n)},m.addDays=function(e,t,n){var r=e.dayNumber+t;return E(r,e.secondsOfDay,n)},m.lessThan=function(e,t){return m.compare(e,t)<0},m.lessThanOrEquals=function(e,t){return m.compare(e,t)<=0},m.greaterThan=function(e,t){return m.compare(e,t)>0},m.greaterThanOrEquals=function(e,t){return m.compare(e,t)>=0},m.prototype.clone=function(e){return m.clone(this,e)},m.prototype.equals=function(e){return m.equals(this,e)},m.prototype.equalsEpsilon=function(e,t){return m.equalsEpsilon(this,e,t)},m.prototype.toString=function(){return m.toIso8601(this)},m.leapSeconds=[new u(new m(2441317,43210,c.TAI),10),new u(new m(2441499,43211,c.TAI),11),new u(new m(2441683,43212,c.TAI),12),new u(new m(2442048,43213,c.TAI),13),new u(new m(2442413,43214,c.TAI),14),new u(new m(2442778,43215,c.TAI),15),new u(new m(2443144,43216,c.TAI),16),new u(new m(2443509,43217,c.TAI),17),new u(new m(2443874,43218,c.TAI),18),new u(new m(2444239,43219,c.TAI),19),new u(new m(2444786,43220,c.TAI),20),new u(new m(2445151,43221,c.TAI),21),new u(new m(2445516,43222,c.TAI),22),new u(new m(2446247,43223,c.TAI),23),new u(new m(2447161,43224,c.TAI),24),new u(new m(2447892,43225,c.TAI),25),new u(new m(2448257,43226,c.TAI),26),new u(new m(2448804,43227,c.TAI),27),new u(new m(2449169,43228,c.TAI),28),new u(new m(2449534,43229,c.TAI),29),new u(new m(2450083,43230,c.TAI),30),new u(new m(2450630,43231,c.TAI),31),new u(new m(2451179,43232,c.TAI),32),new u(new m(2453736,43233,c.TAI),33),new u(new m(2454832,43234,c.TAI),34),new u(new m(2456109,43235,c.TAI),35),new u(new m(2457204,43236,c.TAI),36),new u(new m(2457754,43237,c.TAI),37)],m}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(n,r){if(null===n||"object"!=typeof n)return n;r=e(r,!1);var i=new n.constructor;for(var a in n)if(n.hasOwnProperty(a)){var o=n[a];r&&(o=t(o,r)),i[a]=o}return i}return t}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var n=e.split("\r\n"),r=0;r<n.length;++r){var i=n[r],a=i.indexOf(": ");if(a>0){var o=i.substring(0,a),u=i.substring(a+2);t[o]=u}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function n(e,n,r){this.statusCode=e,this.response=n,this.responseHeaders=r,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return n.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},n}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var n=r.exec(t);this.scheme=n[1],this.authority=n[2],this.path=n[3],this.query=n[4],this.fragment=n[5]}}function t(e){var t=unescape(e);return a.test(t)?t:e.toUpperCase()}function n(e,t,n,r){return(t||"")+n.toLowerCase()+(r||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var r=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(o,n).replace(i,t)),this.path&&(this.path=this.path.replace(i,t)),this.query&&(this.query=this.query.replace(i,t)),this.fragment&&(this.fragment=this.fragment.replace(i,t))};var i=/%[0-9a-z]{2}/gi,a=/[a-zA-Z0-9\-\._~]/,o=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var n=new e;return this.scheme?(n.scheme=this.scheme,n.authority=this.authority,n.path=this.path,n.query=this.query):(n.scheme=t.scheme,this.authority?(n.authority=this.authority,n.path=this.path,n.query=this.query):(n.authority=t.authority,""==this.path?(n.path=t.path,n.query=this.query||t.query):("/"==this.path.charAt(0)?(n.path=this.path,n.removeDotSegments()):(t.authority&&""==t.path?n.path="/"+this.path:n.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,n.removeDotSegments()),n.query=this.query))),n.fragment=this.fragment,n},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),n=[],r=""==t[0];r&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?n.pop():"."!=e&&n.push(e);"."!=e&&".."!=e||n.push(""),r&&n.unshift(""),this.path=n.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n){var r=new e(n);r.normalize();var i=r.getAuthority();if(t(i)){if(i.indexOf("@")!==-1){var a=i.split("@");i=a[1]}if(i.indexOf(":")===-1){var o=r.getScheme();if(t(o)||(o=window.location.protocol,o=o.substring(0,o.length-1)),"http"===o)i+=":80";else{if("https"!==o)return;i+=":443"}}return i}}var i={},a={};return i.add=function(e,n){var r=e.toLowerCase()+":"+n;t(a[r])||(a[r]=!0)},i.remove=function(e,n){var r=e.toLowerCase()+":"+n;t(a[r])&&delete a[r]},i.contains=function(e){var n=r(e);return!(!t(n)||!t(a[n]))},i.clear=function(){a={}},i}),define("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,n,r,i,a,o){"use strict";function u(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,i=t(n.method,"GET"),a=n.data,o=n.headers,s=n.overrideMimeType;return e(n.url,function(t){var n=e.defer();return u.load(t,r,i,a,o,n,s),n.promise})}function s(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function c(e,t){for(var n=s(e,t),r=new ArrayBuffer(n.length),i=new Uint8Array(r),a=0;a<n.length;a++)i[a]=n.charCodeAt(a);return r}function l(e,n){n=t(n,"");var r=e[1],i=!!e[2],a=e[3];switch(n){case"":case"text":return s(i,a);case"arraybuffer":return c(i,a);case"blob":var o=c(i,a);return new Blob([o],{type:r});case"document":var u=new DOMParser;return u.parseFromString(s(i,a),r);case"json":return JSON.parse(s(i,a))}}var f=/^data:(.*?)(;base64)?,(.*)$/;return u.load=function(e,t,r,u,s,c,h){var E=f.exec(e);if(null!==E)return void c.resolve(l(E,t));var d=new XMLHttpRequest;if(o.contains(e)&&(d.withCredentials=!0),n(h)&&n(d.overrideMimeType)&&d.overrideMimeType(h),d.open(r,e,!0),n(s))for(var m in s)s.hasOwnProperty(m)&&d.setRequestHeader(m,s[m]);n(t)&&(d.responseType=t),d.onload=function(){if(d.status<200||d.status>=300)return void c.reject(new i(d.status,d.response,d.getAllResponseHeaders()));var e=d.response,r=d.responseType;if(!n(e)||n(t)&&r!==t)if("json"===t&&"string"==typeof e)try{c.resolve(JSON.parse(e))}catch(e){c.reject(e)}else(""===r||"document"===r)&&n(d.responseXML)&&d.responseXML.hasChildNodes()?c.resolve(d.responseXML):""!==r&&"text"!==r||!n(d.responseText)?c.reject(new a("Invalid XMLHttpRequest response type.")):c.resolve(d.responseText);else c.resolve(e)},d.onerror=function(e){c.reject(new i)},d.send(u)},u.defaultLoad=u.load,u}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,n){return e({url:t,headers:n})}return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";function i(n,i){return t(i)?t(i.Accept)||(i=e(i),i.Accept=a.Accept):i=a,r(n,i).then(function(e){return JSON.parse(e)})}var a={Accept:"application/json,*/*;q=0.01"};return i}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,n,r,i,a,o,u,s,c,l,f){"use strict";function h(t){if(t=n(t,n.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=n(t.addNewLeapSeconds,!0),r(t.data))d(this,t.data);else if(r(t.url)){var i=this;this._downloadPromise=e(s(t.url),function(e){d(i,e)},function(){i._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else d(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function E(e,t){return o.compare(e.julianDate,t)}function d(e,n){if(!r(n.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!r(n.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var i=n.columnNames.indexOf("modifiedJulianDateUtc"),a=n.columnNames.indexOf("xPoleWanderRadians"),s=n.columnNames.indexOf("yPoleWanderRadians"),c=n.columnNames.indexOf("ut1MinusUtcSeconds"),h=n.columnNames.indexOf("xCelestialPoleOffsetRadians"),d=n.columnNames.indexOf("yCelestialPoleOffsetRadians"),m=n.columnNames.indexOf("taiMinusUtcSeconds");if(i<0||a<0||s<0||c<0||h<0||d<0||m<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var _=e._samples=n.samples,p=e._dates=[];e._dateColumn=i,e._xPoleWanderRadiansColumn=a,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=h,e._yCelestialPoleOffsetRadiansColumn=d,e._taiMinusUtcSecondsColumn=m,e._columnCount=n.columnNames.length,e._lastIndex=void 0;for(var y,T=e._addNewLeapSeconds,R=0,A=_.length;R<A;R+=e._columnCount){var S=_[R+i],v=_[R+m],N=S+l.MODIFIED_JULIAN_DATE_DIFFERENCE,I=new o(N,v,f.TAI);if(p.push(I),T){if(v!==y&&r(y)){var O=o.leapSeconds,g=t(O,I,E);if(g<0){var M=new u(I,v);O.splice(~g,0,M)}}y=v}}}function m(e,t,n,r,i){var a=n*r;i.xPoleWander=t[a+e._xPoleWanderRadiansColumn],i.yPoleWander=t[a+e._yPoleWanderRadiansColumn],i.xPoleOffset=t[a+e._xCelestialPoleOffsetRadiansColumn],i.yPoleOffset=t[a+e._yCelestialPoleOffsetRadiansColumn],i.ut1MinusUtc=t[a+e._ut1MinusUtcSecondsColumn]}function _(e,t,n){return t+e*(n-t)}function p(e,t,n,r,i,a,u){var s=e._columnCount;if(a>t.length-1)return u.xPoleWander=0,u.yPoleWander=0,u.xPoleOffset=0,u.yPoleOffset=0,u.ut1MinusUtc=0,u;var c=t[i],l=t[a];if(c.equals(l)||r.equals(c))return m(e,n,i,s,u),u;if(r.equals(l))return m(e,n,a,s,u),u;var f=o.secondsDifference(r,c)/o.secondsDifference(l,c),h=i*s,E=a*s,d=n[h+e._ut1MinusUtcSecondsColumn],p=n[E+e._ut1MinusUtcSecondsColumn],y=p-d;if(y>.5||y<-.5){var T=n[h+e._taiMinusUtcSecondsColumn],R=n[E+e._taiMinusUtcSecondsColumn];T!==R&&(l.equals(r)?d=p:p-=R-T)}return u.xPoleWander=_(f,n[h+e._xPoleWanderRadiansColumn],n[E+e._xPoleWanderRadiansColumn]),u.yPoleWander=_(f,n[h+e._yPoleWanderRadiansColumn],n[E+e._yPoleWanderRadiansColumn]),u.xPoleOffset=_(f,n[h+e._xCelestialPoleOffsetRadiansColumn],n[E+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=_(f,n[h+e._yCelestialPoleOffsetRadiansColumn],n[E+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=_(f,d,p),u}return h.NONE=a({getPromiseToLoad:function(){return e()},compute:function(e,t){return r(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new i(0,0,0,0,0),t}}),h.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},h.prototype.compute=function(e,n){if(r(this._samples)){if(r(n)||(n=new i(0,0,0,0,0)),0===this._samples.length)return n.xPoleWander=0,n.yPoleWander=0,n.xPoleOffset=0,n.yPoleOffset=0,n.ut1MinusUtc=0,n;var a=this._dates,u=this._lastIndex,s=0,l=0;if(r(u)){var f=a[u],h=a[u+1],E=o.lessThanOrEquals(f,e),d=!r(h),m=d||o.greaterThanOrEquals(h,e);if(E&&m)return s=u,!d&&h.equals(e)&&++s,l=s+1,p(this,a,this._samples,e,s,l,n),n}var _=t(a,e,o.compare,this._dateColumn);return _>=0?(_<a.length-1&&a[_+1].equals(e)&&++_,s=_,l=_):(l=~_,s=l-1,s<0&&(s=0)),this._lastIndex=s,p(this,a,this._samples,e,s,l,n),n}if(r(this._dataError))throw new c(this._dataError)},h}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function i(t,n,r){this.heading=e(t,0),this.pitch=e(n,0),this.roll=e(r,0)}return i.fromQuaternion=function(e,n){t(n)||(n=new i);var r=2*(e.w*e.y-e.z*e.x),a=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return n.heading=-Math.atan2(s,u),n.roll=Math.atan2(o,a),n.pitch=-Math.asin(r),n},i.fromDegrees=function(e,n,a,o){return t(o)||(o=new i),o.heading=e*r.RADIANS_PER_DEGREE,o.pitch=n*r.RADIANS_PER_DEGREE,o.roll=a*r.RADIANS_PER_DEGREE,o},i.clone=function(e,n){if(t(e))return t(n)?(n.heading=e.heading,n.pitch=e.pitch,n.roll=e.roll,n):new i(e.heading,e.pitch,e.roll)},i.equals=function(e,n){return e===n||t(e)&&t(n)&&e.heading===n.heading&&e.pitch===n.pitch&&e.roll===n.roll},i.equalsEpsilon=function(e,n,i,a){return e===n||t(e)&&t(n)&&r.equalsEpsilon(e.heading,n.heading,i,a)&&r.equalsEpsilon(e.pitch,n.pitch,i,a)&&r.equalsEpsilon(e.roll,n.roll,i,a)},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i.prototype.equalsEpsilon=function(e,t,n){return i.equalsEpsilon(this,e,t,n)},i.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},i}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function i(n,r){r=t(r,document.location.href);var i=new e(r),a=new e(n);return a.resolve(i).toString()}return i}),define("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function i(r,i,a){a=t(a,!0),r instanceof e||(r=new e(r)),i instanceof e||(i=new e(i)),n(i.authority)&&!n(i.scheme)&&("undefined"!=typeof document&&n(document.location)&&n(document.location.href)?i.scheme=new e(document.location.href).scheme:i.scheme=r.scheme);var o=r;i.isAbsolute()&&(o=i);var u="";n(o.scheme)&&(u+=o.scheme+":"),n(o.authority)&&(u+="//"+o.authority,""!==o.path&&"/"!==o.path&&(u=u.replace(/\/?$/,"/"),o.path=o.path.replace(/^\/?/g,""))),u+=o===r?a?r.path.replace(/\/?$/,"/")+i.path.replace(/^\/?/g,""):r.path+i.path:i.path;var s=n(r.query),c=n(i.query);s&&c?u+="?"+r.query+"&"+i.query:s&&!c?u+="?"+r.query:!s&&c&&(u+="?"+i.query);var l=n(i.fragment); -return n(r.fragment)&&!l?u+="#"+r.fragment:l&&(u+="#"+i.fragment),u}return i}),define("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","./joinUrls","require"],function(e,t,n,r,i,a){"use strict";function o(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;t<n;++t){var r=e[t].getAttribute("src"),i=d.exec(r);if(null!==i)return i[1]}}function u(){if(t(f))return f;var n;return n="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:o(),f=new e(r(n))}function s(e){return a.toUrl("../"+e)}function c(e){return i(u(),e)}function l(e){t(h)||(h=t(a.toUrl)?s:c),t(E)||(E=document.createElement("a"));var n=h(e);return E.href=n,E.href=E.href,E.href}var f,h,E,d=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return l._cesiumScriptRegex=d,l.setBaseUrl=function(t){f=new e(t).resolve(new e(document.location.href))},l}),define("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,n){this.x=e,this.y=t,this.s=n}return e}),define("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,n,r,i,a,o,u){"use strict";function s(e){e=n(e,n.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=n(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=n(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new a(this._sampleZeroJulianEphemerisDate,0,u.TAI),this._stepSizeDays=n(e.stepSizeDays,1),this._samplesPerXysFile=n(e.samplesPerXysFile,1e3),this._totalSamples=n(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,r=this._denominators=new Array(t+1),i=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t),s=0;s<=t;++s){r[s]=o,i[s]=s*this._stepSizeDays;for(var c=0;c<=t;++c)c!==s&&(r[s]*=s-c);r[s]=1/r[s]}this._work=new Array(t+1),this._coef=new Array(t+1)}function c(e,t,n){var r=f;return r.dayNumber=t,r.secondsOfDay=n,a.daysDifference(r,e._sampleZeroDateTT)}function l(n,i){if(n._chunkDownloadsInProgress[i])return n._chunkDownloadsInProgress[i];var a=e.defer();n._chunkDownloadsInProgress[i]=a;var u,s=n._xysFileUrlTemplate;return u=r(s)?s.replace("{0}",i):t("Assets/IAU2006_XYS/IAU2006_XYS_"+i+".json"),e(o(u),function(e){n._chunkDownloadsInProgress[i]=!1;for(var t=n._samples,r=e.samples,o=i*n._samplesPerXysFile*3,u=0,s=r.length;u<s;++u)t[o+u]=r[u];a.resolve()}),a.promise}var f=new a(0,0,u.TAI);return s.prototype.preload=function(t,n,r,i){var a=c(this,t,n),o=c(this,r,i),u=a/this._stepSizeDays-this._interpolationOrder/2|0;u<0&&(u=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var f=u/this._samplesPerXysFile|0,h=s/this._samplesPerXysFile|0,E=[],d=f;d<=h;++d)E.push(l(this,d));return e.all(E)},s.prototype.computeXysRadians=function(e,t,n){var a=c(this,e,t);if(!(a<0)){var o=a/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);s<0&&(s=0);var f=s+u;f>=this._totalSamples&&(f=this._totalSamples-1,s=f-u,s<0&&(s=0));var h=!1,E=this._samples;if(r(E[3*s])||(l(this,s/this._samplesPerXysFile|0),h=!0),r(E[3*f])||(l(this,f/this._samplesPerXysFile|0),h=!0),!h){r(n)?(n.x=0,n.y=0,n.s=0):n=new i(0,0,0);var d,m,_=a-s*this._stepSizeDays,p=this._work,y=this._denominators,T=this._coef,R=this._xTable;for(d=0;d<=u;++d)p[d]=_-R[d];for(d=0;d<=u;++d){for(T[d]=1,m=0;m<=u;++m)m!==d&&(T[d]*=p[m]);T[d]*=y[d];var A=3*(s+d);n.x+=T[d]*E[A++],n.y+=T[d]*E[A++],n.s+=T[d]*E[A]}return n}}}},s}),define("Core/Quaternion",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math","./Matrix3"],function(e,t,n,r,i,a,o,u){"use strict";function s(e,n,r,i){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(i,0)}var c=new e;s.fromAxisAngle=function(t,r,i){var a=r/2,o=Math.sin(a);c=e.normalize(t,c);var u=c.x*o,l=c.y*o,f=c.z*o,h=Math.cos(a);return n(i)?(i.x=u,i.y=l,i.z=f,i.w=h,i):new s(u,l,f,h)};var l=[1,2,0],f=new Array(3);s.fromRotationMatrix=function(e,t){var r,i,a,o,c,h=e[u.COLUMN0ROW0],E=e[u.COLUMN1ROW1],d=e[u.COLUMN2ROW2],m=h+E+d;if(m>0)r=Math.sqrt(m+1),c=.5*r,r=.5/r,i=(e[u.COLUMN1ROW2]-e[u.COLUMN2ROW1])*r,a=(e[u.COLUMN2ROW0]-e[u.COLUMN0ROW2])*r,o=(e[u.COLUMN0ROW1]-e[u.COLUMN1ROW0])*r;else{var _=l,p=0;E>h&&(p=1),d>h&&d>E&&(p=2);var y=_[p],T=_[y];r=Math.sqrt(e[u.getElementIndex(p,p)]-e[u.getElementIndex(y,y)]-e[u.getElementIndex(T,T)]+1);var R=f;R[p]=.5*r,r=.5/r,c=(e[u.getElementIndex(T,y)]-e[u.getElementIndex(y,T)])*r,R[y]=(e[u.getElementIndex(y,p)]+e[u.getElementIndex(p,y)])*r,R[T]=(e[u.getElementIndex(T,p)]+e[u.getElementIndex(p,T)])*r,i=-R[0],a=-R[1],o=-R[2]}return n(t)?(t.x=i,t.y=a,t.z=o,t.w=c,t):new s(i,a,o,c)};var h=new s;s.fromHeadingPitchRoll=function(t,n,r,i){var a=s.fromAxisAngle(e.UNIT_X,r,h),o=s.fromAxisAngle(e.UNIT_Y,-n,i);i=s.multiply(o,a,o);var u=s.fromAxisAngle(e.UNIT_Z,-t,h);return s.multiply(u,i,i)};var E=new e,d=new e,m=new s,_=new s,p=new s;s.packedLength=4,s.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},s.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new s),i.x=e[r],i.y=e[r+1],i.z=e[r+2],i.w=e[r+3],i},s.packedInterpolationLength=3,s.convertPackedArrayForInterpolation=function(e,t,n,r){s.unpack(e,4*n,p),s.conjugate(p,p);for(var i=0,a=n-t+1;i<a;i++){var o=3*i;s.unpack(e,4*(t+i),m),s.multiply(m,p,m),m.w<0&&s.negate(m,m),s.computeAxis(m,E);var u=s.computeAngle(m);r[o]=E.x*u,r[o+1]=E.y*u,r[o+2]=E.z*u}},s.unpackInterpolationResult=function(t,r,i,a,o){n(o)||(o=new s),e.fromArray(t,0,d);var u=e.magnitude(d);return s.unpack(r,4*a,_),0===u?s.clone(s.IDENTITY,m):s.fromAxisAngle(d,u,m),s.multiply(m,_,o)},s.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new s(e.x,e.y,e.z,e.w)},s.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},s.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},s.magnitude=function(e){return Math.sqrt(s.magnitudeSquared(e))},s.normalize=function(e,t){var n=1/s.magnitude(e),r=e.x*n,i=e.y*n,a=e.z*n,o=e.w*n;return t.x=r,t.y=i,t.z=a,t.w=o,t},s.inverse=function(e,t){var n=s.magnitudeSquared(e);return t=s.conjugate(e,t),s.multiplyByScalar(t,1/n,t)},s.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},s.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},s.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},s.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},s.multiply=function(e,t,n){var r=e.x,i=e.y,a=e.z,o=e.w,u=t.x,s=t.y,c=t.z,l=t.w,f=o*u+r*l+i*c-a*s,h=o*s-r*c+i*l+a*u,E=o*c+r*s-i*u+a*l,d=o*l-r*u-i*s-a*c;return n.x=f,n.y=h,n.z=E,n.w=d,n},s.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},s.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},s.computeAxis=function(e,t){var n=e.w;if(Math.abs(n-1)<o.EPSILON6)return t.x=t.y=t.z=0,t;var r=1/Math.sqrt(1-n*n);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},s.computeAngle=function(e){return Math.abs(e.w-1)<o.EPSILON6?0:2*Math.acos(e.w)};var y=new s;s.lerp=function(e,t,n,r){return y=s.multiplyByScalar(t,n,y),r=s.multiplyByScalar(e,1-n,r),s.add(y,r,r)};var T=new s,R=new s,A=new s;s.slerp=function(e,t,n,r){var i=s.dot(e,t),a=t;if(i<0&&(i=-i,a=T=s.negate(t,T)),1-i<o.EPSILON6)return s.lerp(e,a,n,r);var u=Math.acos(i);return R=s.multiplyByScalar(e,Math.sin((1-n)*u),R),A=s.multiplyByScalar(a,Math.sin(n*u),A),r=s.add(R,A,r),s.multiplyByScalar(r,1/Math.sin(u),r)},s.log=function(t,n){var r=o.acosClamped(t.w),i=0;return 0!==r&&(i=r/Math.sin(r)),e.multiplyByScalar(t,i,n)},s.exp=function(t,n){var r=e.magnitude(t),i=0;return 0!==r&&(i=Math.sin(r)/r),n.x=t.x*i,n.y=t.y*i,n.z=t.z*i,n.w=Math.cos(r),n};var S=new e,v=new e,N=new s,I=new s;s.computeInnerQuadrangle=function(t,n,r,i){var a=s.conjugate(n,N);s.multiply(a,r,I);var o=s.log(I,S);s.multiply(a,t,I);var u=s.log(I,v);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),s.exp(o,N),s.multiply(n,N,i)},s.squad=function(e,t,n,r,i,a){var o=s.slerp(e,t,i,N),u=s.slerp(n,r,i,I);return s.slerp(o,u,2*i*(1-i),a)};for(var O=new s,g=1.9011074535173003,M=i.supportsTypedArrays()?new Float32Array(8):[],x=i.supportsTypedArrays()?new Float32Array(8):[],w=i.supportsTypedArrays()?new Float32Array(8):[],C=i.supportsTypedArrays()?new Float32Array(8):[],P=0;P<7;++P){var U=P+1,D=2*U+1;M[P]=1/(U*D),x[P]=U/D}return M[7]=g/136,x[7]=8*g/17,s.fastSlerp=function(e,t,n,r){var i,a=s.dot(e,t);a>=0?i=1:(i=-1,a=-a);for(var o=a-1,u=1-n,c=n*n,l=u*u,f=7;f>=0;--f)w[f]=(M[f]*c-x[f])*o,C[f]=(M[f]*l-x[f])*o;var h=i*n*(1+w[0]*(1+w[1]*(1+w[2]*(1+w[3]*(1+w[4]*(1+w[5]*(1+w[6]*(1+w[7])))))))),E=u*(1+C[0]*(1+C[1]*(1+C[2]*(1+C[3]*(1+C[4]*(1+C[5]*(1+C[6]*(1+C[7])))))))),d=s.multiplyByScalar(e,E,O);return s.multiplyByScalar(t,h,r),s.add(d,r,r)},s.fastSquad=function(e,t,n,r,i,a){var o=s.fastSlerp(e,t,i,N),u=s.fastSlerp(n,r,i,I);return s.fastSlerp(o,u,2*i*(1-i),a)},s.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},s.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.x-t.x)<=r&&Math.abs(e.y-t.y)<=r&&Math.abs(e.z-t.z)<=r&&Math.abs(e.w-t.w)<=r},s.ZERO=a(new s(0,0,0,0)),s.IDENTITY=a(new s(0,0,0,1)),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.x+", "+this.y+", "+this.z+", "+this.w+")"},s}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./defaultValue","./defined","./deprecationWarning","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./HeadingPitchRoll","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,n,r,i,a,o,u,s,c,l,f,h,E,d,m,_,p,y,T,R){"use strict";var A={},S=new n,v=new n,N=new n;A.eastNorthUpToFixedFrame=function(e,t,r){if(_.equalsEpsilon(e.x,0,_.EPSILON14)&&_.equalsEpsilon(e.y,0,_.EPSILON14)){var i=_.sign(e.z);return o(r)?(r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=-i,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=i,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(0,-i,0,e.x,1,0,0,e.y,0,0,i,e.z,0,0,0,1)}var u=S,s=v,c=N;return t=a(t,f.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,c),o(r)?(r[0]=s.x,r[1]=s.y,r[2]=s.z,r[3]=0,r[4]=c.x,r[5]=c.y,r[6]=c.z,r[7]=0,r[8]=u.x,r[9]=u.y,r[10]=u.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(s.x,c.x,u.x,e.x,s.y,c.y,u.y,e.y,s.z,c.z,u.z,e.z,0,0,0,1)};var I=new n,O=new n,g=new n;A.northEastDownToFixedFrame=function(e,t,r){if(_.equalsEpsilon(e.x,0,_.EPSILON14)&&_.equalsEpsilon(e.y,0,_.EPSILON14)){var i=_.sign(e.z);return o(r)?(r[0]=-i,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=-i,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(-i,0,0,e.x,0,1,0,e.y,0,0,-i,e.z,0,0,0,1)}var u=I,s=O,c=g;return t=a(t,f.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,c),o(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=s.x,r[5]=s.y,r[6]=s.z,r[7]=0,r[8]=-u.x,r[9]=-u.y,r[10]=-u.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(c.x,s.x,-u.x,e.x,c.y,s.y,-u.y,e.y,c.z,s.z,-u.z,e.z,0,0,0,1)},A.northUpEastToFixedFrame=function(e,t,r){if(_.equalsEpsilon(e.x,0,_.EPSILON14)&&_.equalsEpsilon(e.y,0,_.EPSILON14)){var i=_.sign(e.z);return o(r)?(r[0]=-i,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=i,r[7]=0,r[8]=0,r[9]=1,r[10]=0,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(-i,0,0,e.x,0,0,1,e.y,0,i,0,e.z,0,0,0,1)}var u=S,s=v,c=N;return t=a(t,f.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,c),o(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=u.x,r[5]=u.y,r[6]=u.z,r[7]=0,r[8]=s.x,r[9]=s.y,r[10]=s.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(c.x,u.x,s.x,e.x,c.y,u.y,s.y,e.y,c.z,u.z,s.z,e.z,0,0,0,1)},A.northWestUpToFixedFrame=function(e,t,r){if(_.equalsEpsilon(e.x,0,_.EPSILON14)&&_.equalsEpsilon(e.y,0,_.EPSILON14)){var i=_.sign(e.z);return o(r)?(r[0]=-i,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=i,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(-i,0,0,e.x,0,-1,0,e.y,0,0,i,e.z,0,0,0,1)}var u=S,s=v,c=N;return t=a(t,f.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,c),o(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=-s.x,r[5]=-s.y,r[6]=-s.z,r[7]=0,r[8]=u.x,r[9]=u.y,r[10]=u.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(c.x,-s.x,u.x,e.x,c.y,-s.y,u.y,e.y,c.z,-s.z,u.z,e.z,0,0,0,1)};var M=new T,x=new n(1,1,1),w=new y;A.headingPitchRollToFixedFrame=function(e,t,r,i,a,o){var s;"object"==typeof t?(a=r,o=i,s=t.heading,r=t.pitch,i=t.roll):(u("headingPitchRollToFixedFrame","headingPitchRollToFixedFrame with separate heading, pitch, and roll arguments was deprecated in 1.27. It will be removed in 1.30. Use a HeadingPitchRoll object."),s=t);var c=T.fromHeadingPitchRoll(s,r,i,M),l=y.fromTranslationQuaternionRotationScale(n.ZERO,c,x,w);return o=A.eastNorthUpToFixedFrame(e,a,o),y.multiply(o,l,o)};var C=new h,P=new y,U=new p;A.headingPitchRollQuaternion=function(e,t,n,r,i,a){var o;"object"==typeof t?(o=t,i=n,a=r):(u("headingPitchRollQuaternion","headingPitchRollQuaternion with separate heading, pitch, and roll arguments was deprecated in 1.27. It will be removed in 1.30. Use a HeadingPitchRoll object."),C.heading=t,C.pitch=n,C.roll=r,o=C);var s=A.headingPitchRollToFixedFrame(e,o,i,P),c=y.getRotation(s,U);return T.fromRotationMatrix(c,a)};var D=24110.54841,L=8640184.812866,F=.093104,z=-62e-7,B=1.1772758384668e-19,b=72921158553e-15,G=_.TWO_PI/86400,q=new m;A.computeTemeToPseudoFixedMatrix=function(e,t){q=m.addSeconds(e,-m.computeTaiMinusUtc(e),q);var n,r=q.dayNumber,i=q.secondsOfDay,a=r-2451545;n=i>=43200?(a+.5)/R.DAYS_PER_JULIAN_CENTURY:(a-.5)/R.DAYS_PER_JULIAN_CENTURY;var u=D+n*(L+n*(F+n*z)),s=u*G%_.TWO_PI,c=b+B*(r-2451545.5),l=(i+.5*R.SECONDS_PER_DAY)%R.SECONDS_PER_DAY,f=s+c*l,h=Math.cos(f),E=Math.sin(f);return o(t)?(t[0]=h,t[1]=-E,t[2]=0,t[3]=E,t[4]=h,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new p(h,E,0,-E,h,0,0,0,1)},A.iau2006XysData=new E,A.earthOrientationParameters=c.NONE;var W=32.184,H=2451545;A.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+W,i=t.stop.dayNumber,a=t.stop.secondsOfDay+W,o=A.iau2006XysData.preload(n,r,i,a),u=A.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},A.computeIcrfToFixedMatrix=function(e,t){o(t)||(t=new p);var n=A.computeFixedToIcrfMatrix(e,t);if(o(n))return p.transpose(n,t)};var X=new d(0,0,0),V=new l(0,0,0,0,0,0),Y=new p,Z=new p;A.computeFixedToIcrfMatrix=function(e,t){o(t)||(t=new p);var n=A.earthOrientationParameters.compute(e,V);if(o(n)){var r=e.dayNumber,i=e.secondsOfDay+W,a=A.iau2006XysData.computeXysRadians(r,i,X);if(o(a)){var u=a.x+n.xPoleOffset,s=a.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-u*u-s*s)),l=Y;l[0]=1-c*u*u,l[3]=-c*u*s,l[6]=u,l[1]=-c*u*s,l[4]=1-c*s*s,l[7]=s,l[2]=-u,l[5]=-s,l[8]=1-c*(u*u+s*s);var f=p.fromRotationZ(-a.s,Z),h=p.multiply(l,f,Y),E=e.dayNumber,d=e.secondsOfDay-m.computeTaiMinusUtc(e)+n.ut1MinusUtc,y=E-2451545,T=d/R.SECONDS_PER_DAY,S=.779057273264+T+.00273781191135448*(y+T);S=S%1*_.TWO_PI;var v=p.fromRotationZ(S,Z),N=p.multiply(h,v,Y),I=Math.cos(n.xPoleWander),O=Math.cos(n.yPoleWander),g=Math.sin(n.xPoleWander),M=Math.sin(n.yPoleWander),x=r-H+i/R.SECONDS_PER_DAY;x/=36525;var w=-47e-6*x*_.RADIANS_PER_DEGREE/3600,C=Math.cos(w),P=Math.sin(w),U=Z;return U[0]=I*C,U[1]=I*P,U[2]=g,U[3]=-O*P+M*g*C,U[4]=O*C+M*g*P,U[5]=-M*I,U[6]=-M*P-O*g*C,U[7]=M*C-O*g*P,U[8]=O*I,p.multiply(N,U,t)}}};var k=new r;A.pointToWindowCoordinates=function(e,t,n,r){return r=A.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},A.pointToGLWindowCoordinates=function(e,n,i,a){o(a)||(a=new t);var u=k;return y.multiplyByVector(e,r.fromElements(i.x,i.y,i.z,1,u),u),r.multiplyByScalar(u,1/u.w,u),y.multiplyByVector(n,u,u),t.fromCartesian4(u,a)};var j=new n,K=new n,J=new n;A.rotationMatrixFromPositionVelocity=function(e,t,r,i){var u=a(r,f.WGS84).geodeticSurfaceNormal(e,j),s=n.cross(t,u,K);n.equalsEpsilon(s,n.ZERO,_.EPSILON6)&&(s=n.clone(n.UNIT_X,s));var c=n.cross(s,t,J);return n.cross(t,c,s),n.negate(s,s),o(i)||(i=new p),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=s.x,i[4]=s.y,i[5]=s.z,i[6]=c.x,i[7]=c.y,i[8]=c.z,i};var Q=new i,$=new n,ee=new n,te=new r,ne=new r,re=new r,ie=new r,ae=new r,oe=new y,ue=new y;return A.basisTo2D=function(e,t,i){var a=e.ellipsoid,o=y.getColumn(t,3,te),u=a.cartesianToCartographic(o,Q),s=A.eastNorthUpToFixedFrame(o,a,oe),c=y.inverseTransformation(s,ue),l=e.project(u,$),f=ne;f.x=l.z,f.y=l.x,f.z=l.y,f.w=1;var h=y.getColumn(t,0,ee),E=n.magnitude(h),d=y.multiplyByVector(c,h,re);r.fromElements(d.z,d.x,d.y,0,d);var m=y.getColumn(t,1,ee),_=n.magnitude(m),p=y.multiplyByVector(c,m,ie);r.fromElements(p.z,p.x,p.y,0,p);var T=y.getColumn(t,2,ee),R=n.magnitude(T),S=ae;return n.cross(d,p,S),n.normalize(S,S),n.cross(p,S,d),n.normalize(d,d),n.cross(S,d,p),n.normalize(p,p),n.multiplyByScalar(d,E,d),n.multiplyByScalar(p,_,p),n.multiplyByScalar(S,R,S),y.setColumn(i,0,d,i),y.setColumn(i,1,p,i),y.setColumn(i,2,S,i),y.setColumn(i,3,f,i),i},A}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,n,r,i,a,o,u,s,c,l,f,h,E){"use strict";function d(e,t){t=i(t,s.WGS84),e=t.scaleToGeodeticSurface(e);var r=E.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=n.fromCartesian4(l.getColumn(r,0,m)),this._yAxis=n.fromCartesian4(l.getColumn(r,1,m));var a=n.fromCartesian4(l.getColumn(r,2,m));this._plane=f.fromPointNormal(e,a)}var m=new r;o(d.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var _=new e;d.fromPoints=function(t,n){var r=e.fromPoints(t,_);return new d(r.center,n)};var p=new h,y=new n;d.prototype.projectPointOntoPlane=function(e,r){var i=p;i.origin=e,n.normalize(e,i.direction);var o=c.rayPlane(i,this._plane,y);if(a(o)||(n.negate(i.direction,i.direction),o=c.rayPlane(i,this._plane,y)),a(o)){var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return a(r)?(r.x=s,r.y=l,r):new t(s,l)}},d.prototype.projectPointsOntoPlane=function(e,t){a(t)||(t=[]);for(var n=0,r=e.length,i=0;i<r;i++){var o=this.projectPointOntoPlane(e[i],t[n]);a(o)&&(t[n]=o,n++)}return t.length=n,t},d.prototype.projectPointToNearestOnPlane=function(e,r){a(r)||(r=new t);var i=p;i.origin=e,n.clone(this._plane.normal,i.direction);var o=c.rayPlane(i,this._plane,y);a(o)||(n.negate(i.direction,i.direction),o=c.rayPlane(i,this._plane,y));var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return r.x=s,r.y=l,r},d.prototype.projectPointsToNearestOnPlane=function(e,t){a(t)||(t=[]);var n=e.length;t.length=n;for(var r=0;r<n;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var T=new n;return d.prototype.projectPointsOntoEllipsoid=function(e,t){var r=e.length;a(t)?t.length=r:t=new Array(r);for(var i=this._ellipsoid,o=this._origin,u=this._xAxis,s=this._yAxis,c=T,l=0;l<r;++l){var f=e[l];n.multiplyByScalar(u,f.x,c),a(t[l])||(t[l]=new n);var h=n.add(o,c,t[l]);n.multiplyByScalar(s,f.y,c),n.add(h,c,h),i.scaleToGeocentricSurface(h,h)}return t},d}),define("ThirdParty/earcut-2.1.1",[],function(){"use strict";function e(e,n,i){i=i||2;var a=n&&n.length,o=a?n[0]*i:e.length,u=t(e,0,o,i,!0),c=[];if(!u)return c;var l,f,h,E,d,m,_;if(a&&(u=s(e,n,u,i)),e.length>80*i){l=h=e[0],f=E=e[1];for(var p=i;p<o;p+=i)d=e[p],m=e[p+1],d<l&&(l=d),m<f&&(f=m),d>h&&(h=d),m>E&&(E=m);_=Math.max(h-l,E-f)}return r(u,c,i,l,f,_),c}function t(e,t,n,r,i){var a,o;if(i===M(e,t,n,r)>0)for(a=t;a<n;a+=r)o=I(a,e[a],e[a+1],o);else for(a=n-r;a>=t;a-=r)o=I(a,e[a],e[a+1],o);return o&&T(o,o.next)&&(O(o),o=o.next),o}function n(e,t){if(!e)return e;t||(t=e);var n,r=e;do if(n=!1,r.steiner||!T(r,r.next)&&0!==y(r.prev,r,r.next))r=r.next;else{if(O(r),r=t=r.prev,r===r.next)return null;n=!0}while(n||r!==t);return t}function r(e,t,s,c,l,f,E){if(e){!E&&f&&h(e,c,l,f);for(var d,m,_=e;e.prev!==e.next;)if(d=e.prev,m=e.next,f?a(e,c,l,f):i(e))t.push(d.i/s),t.push(e.i/s),t.push(m.i/s),O(e),e=m.next,_=m.next;else if(e=m,e===_){E?1===E?(e=o(e,t,s),r(e,t,s,c,l,f,2)):2===E&&u(e,t,s,c,l,f):r(n(e),t,s,c,l,f,1);break}}}function i(e){var t=e.prev,n=e,r=e.next;if(y(t,n,r)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(_(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&y(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function a(e,t,n,r){var i=e.prev,a=e,o=e.next;if(y(i,a,o)>=0)return!1;for(var u=i.x<a.x?i.x<o.x?i.x:o.x:a.x<o.x?a.x:o.x,s=i.y<a.y?i.y<o.y?i.y:o.y:a.y<o.y?a.y:o.y,c=i.x>a.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,l=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,f=d(u,s,t,n,r),h=d(c,l,t,n,r),E=e.nextZ;E&&E.z<=h;){if(E!==e.prev&&E!==e.next&&_(i.x,i.y,a.x,a.y,o.x,o.y,E.x,E.y)&&y(E.prev,E,E.next)>=0)return!1;E=E.nextZ}for(E=e.prevZ;E&&E.z>=f;){if(E!==e.prev&&E!==e.next&&_(i.x,i.y,a.x,a.y,o.x,o.y,E.x,E.y)&&y(E.prev,E,E.next)>=0)return!1;E=E.prevZ}return!0}function o(e,t,n){var r=e;do{var i=r.prev,a=r.next.next;!T(i,a)&&R(i,r,r.next,a)&&S(i,a)&&S(a,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(a.i/n),O(r),O(r.next),r=e=a),r=r.next}while(r!==e);return r}function u(e,t,i,a,o,u){var s=e;do{for(var c=s.next.next;c!==s.prev;){if(s.i!==c.i&&p(s,c)){var l=N(s,c);return s=n(s,s.next),l=n(l,l.next),r(s,t,i,a,o,u),void r(l,t,i,a,o,u)}c=c.next}s=s.next}while(s!==e)}function s(e,r,i,a){var o,u,s,f,h,E=[];for(o=0,u=r.length;o<u;o++)s=r[o]*a,f=o<u-1?r[o+1]*a:e.length,h=t(e,s,f,a,!1),h===h.next&&(h.steiner=!0),E.push(m(h));for(E.sort(c),o=0;o<E.length;o++)l(E[o],i),i=n(i,i.next);return i}function c(e,t){return e.x-t.x}function l(e,t){if(t=f(e,t)){var r=N(t,e);n(r,r.next)}}function f(e,t){var n,r=t,i=e.x,a=e.y,o=-(1/0);do{if(a<=r.y&&a>=r.next.y){var u=r.x+(a-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(u<=i&&u>o){if(o=u,u===i){if(a===r.y)return r;if(a===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(i===o)return n.prev;var s,c=n,l=n.x,f=n.y,h=1/0;for(r=n.next;r!==c;)i>=r.x&&r.x>=l&&_(a<f?i:o,a,l,f,a<f?o:i,a,r.x,r.y)&&(s=Math.abs(a-r.y)/(i-r.x),(s<h||s===h&&r.x>n.x)&&S(r,e)&&(n=r,h=s)),r=r.next;return n}function h(e,t,n,r){var i=e;do null===i.z&&(i.z=d(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,E(i)}function E(e){var t,n,r,i,a,o,u,s,c=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,r=n,u=0,t=0;t<c&&(u++,r=r.nextZ,r);t++);for(s=c;u>0||s>0&&r;)0===u?(i=r,r=r.nextZ,s--):0!==s&&r?n.z<=r.z?(i=n,n=n.nextZ,u--):(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,u--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;n=r}a.nextZ=null,c*=2}while(o>1);return e}function d(e,t,n,r,i){return e=32767*(e-n)/i,t=32767*(t-r)/i,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function m(e){var t=e,n=e;do t.x<n.x&&(n=t),t=t.next;while(t!==e);return n}function _(e,t,n,r,i,a,o,u){return(i-o)*(t-u)-(e-o)*(a-u)>=0&&(e-o)*(r-u)-(n-o)*(t-u)>=0&&(n-o)*(a-u)-(i-o)*(r-u)>=0}function p(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!A(e,t)&&S(e,t)&&S(t,e)&&v(e,t)}function y(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function T(e,t){return e.x===t.x&&e.y===t.y}function R(e,t,n,r){return!!(T(e,t)&&T(n,r)||T(e,r)&&T(n,t))||y(e,t,n)>0!=y(e,t,r)>0&&y(n,r,e)>0!=y(n,r,t)>0}function A(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&R(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function S(e,t){return y(e.prev,e,e.next)<0?y(e,t,e.next)>=0&&y(e,e.prev,t)>=0:y(e,t,e.prev)<0||y(e,e.next,t)<0}function v(e,t){var n=e,r=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do n.y>a!=n.next.y>a&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function N(e,t){var n=new g(e.i,e.x,e.y),r=new g(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function I(e,t,n,r){var i=new g(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function O(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function g(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function M(e,t,n,r){for(var i=0,a=t,o=n-r;a<n;a+=r)i+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return i}return e.deviation=function(e,t,n,r){var i=t&&t.length,a=i?t[0]*n:e.length,o=Math.abs(M(e,0,a,n));if(i)for(var u=0,s=t.length;u<s;u++){var c=t[u]*n,l=u<s-1?t[u+1]*n:e.length;o-=Math.abs(M(e,c,l,n))}var f=0;for(u=0;u<r.length;u+=3){var h=r[u]*n,E=r[u+1]*n,d=r[u+2]*n;f+=Math.abs((e[h]-e[d])*(e[E+1]-e[h+1])-(e[h]-e[E])*(e[d+1]-e[h+1]))}return 0===o&&0===f?0:Math.abs((f-o)/o)},e.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,i=0;i<e.length;i++){for(var a=0;a<e[i].length;a++)for(var o=0;o<t;o++)n.vertices.push(e[i][a][o]);i>0&&(r+=e[i-1].length,n.holes.push(r))}return n},e}),define("Core/WindingOrder",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={CLOCKWISE:t.CW,COUNTER_CLOCKWISE:t.CCW,validate:function(e){return e===n.CLOCKWISE||e===n.COUNTER_CLOCKWISE}};return e(n)}),define("Core/PolygonPipeline",["../ThirdParty/earcut-2.1.1","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./Math","./PrimitiveType","./WindingOrder"],function(e,t,n,r,i,a,o,u,s,c,l,f,h){"use strict";var E=new n,d=new n,m={};m.computeArea2D=function(e){for(var t=e.length,n=0,r=t-1,i=0;i<t;r=i++){var a=e[r],o=e[i];n+=a.x*o.y-o.x*a.y}return.5*n},m.computeWindingOrder2D=function(e){var t=m.computeArea2D(e);return t>0?h.COUNTER_CLOCKWISE:h.CLOCKWISE},m.triangulate=function(n,r){var i=t.packArray(n);return e(i,r,2)};var _=new n,p=new n,y=new n,T=new n,R=new n,A=new n,S=new n;return m.computeSubdivision=function(e,t,o,u){u=i(u,l.RADIANS_PER_DEGREE);var h,E=o.slice(0),d=t.length,m=new Array(3*d),v=0;for(h=0;h<d;h++){var N=t[h];m[v++]=N.x,m[v++]=N.y,m[v++]=N.z}for(var I=[],O={},g=e.maximumRadius,M=l.chordLength(u,g),x=M*M;E.length>0;){var w,C,P=E.pop(),U=E.pop(),D=E.pop(),L=n.fromArray(m,3*D,_),F=n.fromArray(m,3*U,p),z=n.fromArray(m,3*P,y),B=n.multiplyByScalar(n.normalize(L,T),g,T),b=n.multiplyByScalar(n.normalize(F,R),g,R),G=n.multiplyByScalar(n.normalize(z,A),g,A),q=n.magnitudeSquared(n.subtract(B,b,S)),W=n.magnitudeSquared(n.subtract(b,G,S)),H=n.magnitudeSquared(n.subtract(G,B,S)),X=Math.max(q,W,H);X>x?q===X?(w=Math.min(D,U)+" "+Math.max(D,U),h=O[w],a(h)||(C=n.add(L,F,S),n.multiplyByScalar(C,.5,C),m.push(C.x,C.y,C.z),h=m.length/3-1,O[w]=h),E.push(D,h,P),E.push(h,U,P)):W===X?(w=Math.min(U,P)+" "+Math.max(U,P),h=O[w],a(h)||(C=n.add(F,z,S),n.multiplyByScalar(C,.5,C),m.push(C.x,C.y,C.z),h=m.length/3-1,O[w]=h),E.push(U,h,D),E.push(h,P,D)):H===X&&(w=Math.min(P,D)+" "+Math.max(P,D),h=O[w],a(h)||(C=n.add(z,L,S),n.multiplyByScalar(C,.5,C),m.push(C.x,C.y,C.z),h=m.length/3-1,O[w]=h),E.push(P,h,U),E.push(h,D,U)):(I.push(D),I.push(U),I.push(P))}return new s({attributes:{position:new c({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:m})},indices:I,primitiveType:f.TRIANGLES})},m.scaleToGeodeticHeight=function(e,t,r,o){r=i(r,u.WGS84);var s=E,c=d;if(t=i(t,0),o=i(o,!0),a(e))for(var l=e.length,f=0;f<l;f+=3)n.fromArray(e,f,c),o&&(c=r.scaleToGeodeticSurface(c,c)),0!==t&&(s=r.geodeticSurfaceNormal(c,s),n.multiplyByScalar(s,t,s),n.add(c,s,c)),e[f]=c.x,e[f+1]=c.y,e[f+2]=c.z;return e},m}),define("Core/EllipsoidGeodesic",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,n,r,i,a,o,u){"use strict";function s(e){var t=e._uSquared,n=e._ellipsoid.maximumRadius,r=e._ellipsoid.minimumRadius,i=(n-r)/n,a=Math.cos(e._startHeading),o=Math.sin(e._startHeading),u=(1-i)*Math.tan(e._start.latitude),s=1/Math.sqrt(1+u*u),c=s*u,l=Math.atan2(u,a),f=s*o,h=f*f,E=1-h,d=Math.sqrt(E),m=t/4,_=m*m,p=_*m,y=_*_,T=1+m-3*_/4+5*p/4-175*y/64,R=1-m+15*_/8-35*p/8,A=1-3*m+35*_/4,S=1-5*m,v=T*l-R*Math.sin(2*l)*m/2-A*Math.sin(4*l)*_/16-S*Math.sin(6*l)*p/48-5*Math.sin(8*l)*y/512,N=e._constants;N.a=n,N.b=r,N.f=i,N.cosineHeading=a,N.sineHeading=o,N.tanU=u,N.cosineU=s,N.sineU=c,N.sigma=l,N.sineAlpha=f,N.sineSquaredAlpha=h,N.cosineSquaredAlpha=E,N.cosineAlpha=d,N.u2Over4=m,N.u4Over16=_,N.u6Over64=p,N.u8Over256=y,N.a0=T,N.a1=R,N.a2=A,N.a3=S,N.distanceRatio=v}function c(e,t){return e*t*(4+e*(4-3*t))/16}function l(e,t,n,r,i,a,o){var u=c(e,n);return(1-u)*e*t*(r+u*i*(o+u*a*(2*o*o-1)))}function f(e,t,n,r,i,a,o){var s,c,f,h,E,d=(t-n)/t,m=a-r,_=Math.atan((1-d)*Math.tan(i)),p=Math.atan((1-d)*Math.tan(o)),y=Math.cos(_),T=Math.sin(_),R=Math.cos(p),A=Math.sin(p),S=y*R,v=y*A,N=T*A,I=T*R,O=m,g=u.TWO_PI,M=Math.cos(O),x=Math.sin(O);do{M=Math.cos(O),x=Math.sin(O);var w=v-I*M;f=Math.sqrt(R*R*x*x+w*w),c=N+S*M,s=Math.atan2(f,c);var C;0===f?(C=0,h=1):(C=S*x/f,h=1-C*C),g=O,E=c-2*N/h,isNaN(E)&&(E=0),O=m+l(d,C,h,s,f,c,E)}while(Math.abs(O-g)>u.EPSILON12);var P=h*(t*t-n*n)/(n*n),U=1+P*(4096+P*(P*(320-175*P)-768))/16384,D=P*(256+P*(P*(74-47*P)-128))/1024,L=E*E,F=D*f*(E+D*(c*(2*L-1)-D*E*(4*f*f-3)*(4*L-3)/6)/4),z=n*U*(s-F),B=Math.atan2(R*x,v-I*M),b=Math.atan2(y*x,v*M-I);e._distance=z,e._startHeading=B,e._endHeading=b,e._uSquared=P}function h(n,r,i,a){e.normalize(a.cartographicToCartesian(r,m),d),e.normalize(a.cartographicToCartesian(i,m),m);f(n,a.maximumRadius,a.minimumRadius,r.longitude,r.latitude,i.longitude,i.latitude),n._start=t.clone(r,n._start),n._end=t.clone(i,n._end),n._start.height=0,n._end.height=0,s(n)}function E(e,i,a){var u=n(a,o.WGS84);this._ellipsoid=u,this._start=new t,this._end=new t,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,r(e)&&r(i)&&h(this,e,i,u)}var d=new e,m=new e;return i(E.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return this._startHeading}},endHeading:{get:function(){return this._endHeading}}}),E.prototype.setEndPoints=function(e,t){h(this,e,t,this._ellipsoid)},E.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},E.prototype.interpolateUsingSurfaceDistance=function(e,n){var i=this._constants,a=i.distanceRatio+e/i.b,o=Math.cos(2*a),u=Math.cos(4*a),s=Math.cos(6*a),c=Math.sin(2*a),f=Math.sin(4*a),h=Math.sin(6*a),E=Math.sin(8*a),d=a*a,m=a*d,_=i.u8Over256,p=i.u2Over4,y=i.u6Over64,T=i.u4Over16,R=2*m*_*o/3+a*(1-p+7*T/4-15*y/4+579*_/64-(T-15*y/4+187*_/16)*o-(5*y/4-115*_/16)*u-29*_*s/16)+(p/2-T+71*y/32-85*_/16)*c+(5*T/16-5*y/4+383*_/96)*f-d*((y-11*_/2)*c+5*_*f/2)+(29*y/96-29*_/16)*h+539*_*E/1536,A=Math.asin(Math.sin(R)*i.cosineAlpha),S=Math.atan(i.a/i.b*Math.tan(A));R-=i.sigma;var v=Math.cos(2*i.sigma+R),N=Math.sin(R),I=Math.cos(R),O=i.cosineU*I,g=i.sineU*N,M=Math.atan2(N*i.sineHeading,O-g*i.cosineHeading),x=M-l(i.f,i.sineAlpha,i.cosineSquaredAlpha,R,N,I,v);return r(n)?(n.longitude=this._start.longitude+x,n.latitude=S,n.height=0,n):new t(this._start.longitude+x,S,0)},E}),define("Core/PolylinePipeline",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidGeodesic","./IntersectionTests","./isArray","./Math","./Matrix4","./Plane"],function(e,t,n,r,i,a,o,u,s,c,l,f){ -"use strict";function h(e,t,n){var r=N;r.length=e;var i;if(t===n){for(i=0;i<e;i++)r[i]=t;return r}var a=n-t,o=a/e;for(i=0;i<e;i++){var u=t+i*o;r[i]=u}return r}function E(t,n,r,i,a,o,u,s){var c=i.scaleToGeodeticSurface(t,M),l=i.scaleToGeodeticSurface(n,x),f=d.numberOfPoints(t,n,r),E=i.cartesianToCartographic(c,I),m=i.cartesianToCartographic(l,O),_=h(f,a,o);w.setEndPoints(E,m);var p=w.surfaceDistance/f,y=s;E.height=a;var T=i.cartographicToCartesian(E,g);e.pack(T,u,y),y+=3;for(var R=1;R<f;R++){var A=w.interpolateUsingSurfaceDistance(R*p,O);A.height=_[R],T=i.cartographicToCartesian(A,g),e.pack(T,u,y),y+=3}return y}var d={};d.numberOfPoints=function(t,n,r){var i=e.distance(t,n);return Math.ceil(i/r)};var m=new t;d.extractHeights=function(e,t){for(var n=e.length,r=new Array(n),i=0;i<n;i++){var a=e[i];r[i]=t.cartesianToCartographic(a,m).height}return r};var _=new l,p=new e,y=new e,T=new f(e.ZERO,0),R=new e,A=new f(e.ZERO,0),S=new e,v=new e,N=[],I=new t,O=new t,g=new e,M=new e,x=new e,w=new o;return d.wrapLongitude=function(t,i){var a=[],o=[];if(r(t)&&t.length>0){i=n(i,l.IDENTITY);var s=l.inverseTransformation(i,_),c=l.multiplyByPoint(s,e.ZERO,p),h=l.multiplyByPointAsVector(s,e.UNIT_Y,y),E=f.fromPointNormal(c,h,T),d=l.multiplyByPointAsVector(s,e.UNIT_X,R),m=f.fromPointNormal(c,d,A),N=1;a.push(e.clone(t[0]));for(var I=a[0],O=t.length,g=1;g<O;++g){var M=t[g];if(f.getPointDistance(m,I)<0||f.getPointDistance(m,M)<0){var x=u.lineSegmentPlane(I,M,E,S);if(r(x)){var w=e.multiplyByScalar(h,5e-9,v);f.getPointDistance(E,I)<0&&e.negate(w,w),a.push(e.add(x,w,new e)),o.push(N+1),e.negate(w,w),a.push(e.add(x,w,new e)),N=1}}a.push(e.clone(t[g])),N++,I=M}o.push(N)}return{positions:a,lengths:o}},d.generateArc=function(t){r(t)||(t={});var i=t.positions,o=i.length,u=n(t.ellipsoid,a.WGS84),l=n(t.height,0),f=s(l);if(o<1)return[];if(1===o){var h=u.scaleToGeodeticSurface(i[0],M);if(l=f?l[0]:l,0!==l){var m=u.geodeticSurfaceNormal(h,g);e.multiplyByScalar(m,l,m),e.add(h,m,h)}return[h.x,h.y,h.z]}var _=t.minDistance;if(!r(_)){var p=n(t.granularity,c.RADIANS_PER_DEGREE);_=c.chordLength(p,u.maximumRadius)}var y,T=0;for(y=0;y<o-1;y++)T+=d.numberOfPoints(i[y],i[y+1],_);var R=3*(T+1),A=new Array(R),S=0;for(y=0;y<o-1;y++){var v=i[y],O=i[y+1],x=f?l[y]:l,w=f?l[y+1]:l;S=E(v,O,_,u,x,w,A,S)}N.length=0;var C=i[o-1],P=u.cartesianToCartographic(C,I);P.height=f?l[o-1]:l;var U=u.cartographicToCartesian(P,g);return e.pack(U,A,R-3),A},d.generateCartesianArc=function(t){for(var n=d.generateArc(t),r=n.length/3,i=new Array(r),a=0;a<r;a++)i[a]=e.unpack(n,3*a);return i},d}),define("Core/WallGeometryLibrary",["./Cartographic","./defined","./EllipsoidTangentPlane","./Math","./PolygonPipeline","./PolylinePipeline","./WindingOrder"],function(e,t,n,r,i,a,o){"use strict";function u(e,t){return r.equalsEpsilon(e.latitude,t.latitude,r.EPSILON14)&&r.equalsEpsilon(e.longitude,t.longitude,r.EPSILON14)}function s(n,r,i,a){var o=r.length;if(!(o<2)){var s=t(a),c=t(i),h=!0,E=new Array(o),d=new Array(o),m=new Array(o),_=r[0];E[0]=_;var p=n.cartesianToCartographic(_,l);c&&(p.height=i[0]),h=h&&p.height<=0,d[0]=p.height,s?m[0]=a[0]:m[0]=0;for(var y=1,T=1;T<o;++T){var R=r[T],A=n.cartesianToCartographic(R,f);c&&(A.height=i[T]),h=h&&A.height<=0,u(p,A)?p.height<A.height&&(d[y-1]=A.height):(E[y]=R,d[y]=A.height,s?m[y]=a[T]:m[y]=0,e.clone(A,p),++y)}if(!(h||y<2))return E.length=y,d.length=y,m.length=y,{positions:E,topHeights:d,bottomHeights:m}}}var c={},l=new e,f=new e,h=new Array(2),E=new Array(2),d={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};return c.computePositions=function(e,u,c,l,f,m){var _=s(e,u,c,l);if(t(_)){if(u=_.positions,c=_.topHeights,l=_.bottomHeights,u.length>=3){var p=n.fromPoints(u,e),y=p.projectPointsOntoPlane(u);i.computeWindingOrder2D(y)===o.CLOCKWISE&&(u.reverse(),c.reverse(),l.reverse())}var T,R,A=u.length,S=A-2,v=r.chordLength(f,e.maximumRadius),N=d;if(N.minDistance=v,N.ellipsoid=e,m){var I,O=0;for(I=0;I<A-1;I++)O+=a.numberOfPoints(u[I],u[I+1],v)+1;T=new Float64Array(3*O),R=new Float64Array(3*O);var g=h,M=E;N.positions=g,N.height=M;var x=0;for(I=0;I<A-1;I++){g[0]=u[I],g[1]=u[I+1],M[0]=c[I],M[1]=c[I+1];var w=a.generateArc(N);T.set(w,x),M[0]=l[I],M[1]=l[I+1],R.set(a.generateArc(N),x),x+=w.length}}else N.positions=u,N.height=c,T=new Float64Array(a.generateArc(N)),N.height=l,R=new Float64Array(a.generateArc(N));return{bottomPositions:R,topPositions:T,numCorners:S}}},c}),define("Core/WallOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./WallGeometryLibrary"],function(e,t,n,r,i,a,o,u,s,c,l,f,h,E){"use strict";function d(e){e=r(e,r.EMPTY_OBJECT);var n=e.positions,a=e.maximumHeights,u=e.minimumHeights,s=r(e.granularity,f.RADIANS_PER_DEGREE),c=r(e.ellipsoid,o.WGS84);this._positions=n,this._minimumHeights=u,this._maximumHeights=a,this._granularity=s,this._ellipsoid=o.clone(c),this._workerName="createWallOutlineGeometry";var l=1+n.length*t.packedLength+2;i(u)&&(l+=u.length),i(a)&&(l+=a.length),this.packedLength=l+o.packedLength+1}var m=new t,_=new t;d.pack=function(e,n,a){a=r(a,0);var u,s=e._positions,c=s.length;for(n[a++]=c,u=0;u<c;++u,a+=t.packedLength)t.pack(s[u],n,a);var l=e._minimumHeights;if(c=i(l)?l.length:0,n[a++]=c,i(l))for(u=0;u<c;++u)n[a++]=l[u];var f=e._maximumHeights;if(c=i(f)?f.length:0,n[a++]=c,i(f))for(u=0;u<c;++u)n[a++]=f[u];return o.pack(e._ellipsoid,n,a),a+=o.packedLength,n[a]=e._granularity,n};var p=o.clone(o.UNIT_SPHERE),y={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:p,granularity:void 0};return d.unpack=function(e,n,a){n=r(n,0);var u,s=e[n++],c=new Array(s);for(u=0;u<s;++u,n+=t.packedLength)c[u]=t.unpack(e,n);s=e[n++];var l;if(s>0)for(l=new Array(s),u=0;u<s;++u)l[u]=e[n++];s=e[n++];var f;if(s>0)for(f=new Array(s),u=0;u<s;++u)f[u]=e[n++];var h=o.unpack(e,n,p);n+=o.packedLength;var E=e[n];return i(a)?(a._positions=c,a._minimumHeights=l,a._maximumHeights=f,a._ellipsoid=o.clone(h,a._ellipsoid),a._granularity=E,a):(y.positions=c,y.minimumHeights=l,y.maximumHeights=f,y.granularity=E,new d(y))},d.fromConstantHeights=function(e){e=r(e,r.EMPTY_OBJECT);var t,n,a=e.positions,o=e.minimumHeight,u=e.maximumHeight,s=i(o),c=i(u);if(s||c){var l=a.length;t=s?new Array(l):void 0,n=c?new Array(l):void 0;for(var f=0;f<l;++f)s&&(t[f]=o),c&&(n[f]=u)}var h={positions:a,maximumHeights:n,minimumHeights:t,ellipsoid:e.ellipsoid};return new d(h)},d.createGeometry=function(r){var a=r._positions,o=r._minimumHeights,d=r._maximumHeights,p=r._granularity,y=r._ellipsoid,T=E.computePositions(y,a,d,o,p,!1);if(i(T)){var R=T.bottomPositions,A=T.topPositions,S=A.length,v=2*S,N=new Float64Array(v),I=0;S/=3;var O;for(O=0;O<S;++O){var g=3*O,M=t.fromArray(A,g,m),x=t.fromArray(R,g,_);N[I++]=x.x,N[I++]=x.y,N[I++]=x.z,N[I++]=M.x,N[I++]=M.y,N[I++]=M.z}var w=new c({position:new s({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:N})}),C=v/3;v=2*C-4+C;var P=l.createTypedArray(C,v),U=0;for(O=0;O<C-2;O+=2){var D=O,L=O+2,F=t.fromArray(N,3*D,m),z=t.fromArray(N,3*L,_);if(!t.equalsEpsilon(F,z,f.EPSILON10)){var B=O+1,b=O+3;P[U++]=B,P[U++]=D,P[U++]=B,P[U++]=b,P[U++]=D,P[U++]=L}}return P[U++]=C-2,P[U++]=C-1,new u({attributes:w,indices:P,primitiveType:h.LINES,boundingSphere:new e.fromVertices(N)})}},d}),define("Workers/createWallOutlineGeometry",["../Core/defined","../Core/Ellipsoid","../Core/WallOutlineGeometry"],function(e,t,n){"use strict";function r(r,i){return e(i)&&(r=n.unpack(r,i)),r._ellipsoid=t.clone(r._ellipsoid),n.createGeometry(r)}return r})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e){return e+" is required, actual value was undefined"}function r(e,t,n){return"Expected "+n+" to be typeof "+t+", actual typeof was "+e}var a={};return a.typeOf={},a.defined=function(r,a){if(!e(a))throw new t(n(r))},a.typeOf.func=function(e,n){if("function"!=typeof n)throw new t(r(typeof n,"function",e))},a.typeOf.string=function(e,n){if("string"!=typeof n)throw new t(r(typeof n,"string",e))},a.typeOf.number=function(e,n){if("number"!=typeof n)throw new t(r(typeof n,"number",e))},a.typeOf.number.lessThan=function(e,n,r){if(a.typeOf.number(e,n),n>=r)throw new t("Expected "+e+" to be less than "+r+", actual value was "+n)},a.typeOf.number.lessThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n>r)throw new t("Expected "+e+" to be less than or equal to "+r+", actual value was "+n)},a.typeOf.number.greaterThan=function(e,n,r){if(a.typeOf.number(e,n),n<=r)throw new t("Expected "+e+" to be greater than "+r+", actual value was "+n)},a.typeOf.number.greaterThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n<r)throw new t("Expected "+e+" to be greater than or equal to"+r+", actual value was "+n)},a.typeOf.object=function(e,n){if("object"!=typeof n)throw new t(r(typeof n,"object",e))},a.typeOf.bool=function(e,n){if("boolean"!=typeof n)throw new t(r(typeof n,"boolean",e))},a}),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";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),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 n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(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^=e<<7&2636928640,e^=e<<15&4022730752,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,n,r){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:e<0?-1:0},a.signNotZero=function(e){return e<0?-1:1},a.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*a.clamp(e,-1,1)+.5)*n)},a.fromSNorm=function(e,n){return n=t(n,255),a.clamp(e,0,n)/n*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},a.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},a.lerp=function(e,t,n){return(1-n)*e+n*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){var t=a.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},a.clampToLatitudeRange=function(e){return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){return(e%t+t)%t},a.equalsEpsilon=function(e,n,r,a){a=t(a,r);var i=Math.abs(e-n);return i<=a||i<=r*Math.max(Math.abs(e),Math.abs(n))};var i=[1];a.factorial=function(e){var t=i.length;if(e>=t)for(var n=i[t-1],r=t;r<=e;r++)i.push(n*r);return i[e]},a.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},a.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return a.setRandomNumberSeed=function(t){o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(e){return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){return Math.log(e)/Math.log(t)},a.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var a=e.clock,i=e.cone,u=t(e.magnitude,1),s=u*Math.sin(i);return r.x=s*Math.cos(a),r.y=s*Math.sin(a),r.z=u*Math.cos(i),r},o.fromElements=function(e,t,r,a){return n(a)?(a.x=e,a.y=t,a.z=r,a):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var a=0;a<r;++a)o.pack(e[a],t,3*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var a=0;a<r;a+=3){var i=a/3;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,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};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var n=o.dot(c,l),r=o.magnitude(o.cross(c,l,c));return Math.atan2(r,n)};var f=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)},o.cross=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=t.x,u=t.y,s=t.z,c=a*s-i*u,l=i*o-r*s,f=r*u-a*o;return n.x=c,n.y=l,n.z=f,n},o.fromDegrees=function(e,t,n,r,a){return e=i.toRadians(e),t=i.toRadians(t),o.fromRadians(e,t,n,r,a)};var h=new o,E=new o,d=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,a,i,u){a=t(a,0);var s=n(i)?i.radiiSquared:d,c=Math.cos(r);h.x=c*Math.cos(e),h.y=c*Math.sin(e),h.z=Math.sin(r),h=o.normalize(h,h),o.multiplyComponents(s,h,E);var l=Math.sqrt(o.dot(h,E));return E=o.divideByScalar(E,l,E),h=o.multiplyByScalar(h,a,h),n(u)||(u=new o),o.add(E,h,u)},o.fromDegreesArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromDegrees(u,s,0,t,r[c])}return r},o.fromRadiansArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromRadians(u,s,0,t,r[c])}return r},o.fromDegreesArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromDegrees(u,s,c,t,r[l])}return r},o.fromRadiansArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromRadians(u,s,c,t,r[l])}return r},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(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,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(n,a,u,s,c){var l=n.x,f=n.y,h=n.z,E=a.x,d=a.y,_=a.z,m=l*l*E*E,p=f*f*d*d,y=h*h*_*_,T=m+p+y,R=Math.sqrt(1/T),A=e.multiplyByScalar(n,R,i);if(T<s)return isFinite(R)?e.clone(A,c):void 0;var S=u.x,v=u.y,N=u.z,O=o;O.x=A.x*S*2,O.y=A.y*v*2,O.z=A.z*N*2;var I,M,g,x,w,C,P,U,D,L,F,z=(1-R)*e.magnitude(n)/(.5*e.magnitude(O)),B=0;do{z-=B,g=1/(1+z*S),x=1/(1+z*v),w=1/(1+z*N),C=g*g,P=x*x,U=w*w,D=C*g,L=P*x,F=U*w,I=m*C+p*P+y*U-1,M=m*D*S+p*L*v+y*F*N;var b=-2*M;B=I/b}while(Math.abs(I)>r.EPSILON12);return t(c)?(c.x=l*g,c.y=f*x,c.z=h*w,c):new e(l*g,f*x,h*w)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o){"use strict";function u(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)}u.fromRadians=function(e,r,a,i){return a=t(a,0),n(i)?(i.longitude=e,i.latitude=r,i.height=a,i):new u(e,r,a)},u.fromDegrees=function(e,t,n,r){return e=i.toRadians(e),t=i.toRadians(t),u.fromRadians(e,t,n,r)};var s=new e,c=new e,l=new e,f=new e(1/6378137,1/6378137,1/6356752.314245179),h=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),E=i.EPSILON1;return u.fromCartesian=function(t,r,a){var d=n(r)?r.oneOverRadii:f,_=n(r)?r.oneOverRadiiSquared:h,m=n(r)?r._centerToleranceSquared:E,p=o(t,d,_,m,c);if(n(p)){var y=e.multiplyComponents(p,_,s);y=e.normalize(y,y);var T=e.subtract(t,p,l),R=Math.atan2(y.y,y.x),A=Math.asin(y.z),S=i.sign(e.dot(T,t))*e.magnitude(T);return n(a)?(a.longitude=R,a.latitude=A,a.height=S,a):new u(R,A,S)}},u.clone=function(e,t){if(n(e))return n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},u.ZERO=a(new u(0,0,0)),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,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(t,r,a,i){r=n(r,0),a=n(a,0),i=n(i,0),t._radii=new e(r,a,i),t._radiiSquared=new e(r*r,a*a,i*i),t._radiiToTheFourth=new e(r*r*r*r,a*a*a*a,i*i*i*i),t._oneOverRadii=new e(0===r?0:1/r,0===a?0:1/a,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===a?0:1/(a*a),0===i?0:1/(i*i)),t._minimumRadius=Math.min(r,a,i),t._maximumRadius=Math.max(r,a,i),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,c(this,e,t,n)}a(l.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}}}),l.clone=function(t,n){if(r(t)){var a=t._radii;return r(n)?(e.clone(a,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new l(a.x,a.y,a.z)}},l.fromCartesian3=function(e,t){return r(t)||(t=new l),r(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,r,a){return a=n(a,0),e.pack(t._radii,r,a),r},l.unpack=function(t,r,a){r=n(r,0);var i=e.unpack(t,r);return l.fromCartesian3(i,a)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,n){var a=t.longitude,i=t.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return r(n)||(n=new e),n.x=u,n.y=s,n.z=c,e.normalize(n,n)},l.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var f=new e,h=new e;l.prototype.cartographicToCartesian=function(t,n){var a=f,i=h;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(e.dot(a,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(a,t.height,a),r(n)||(n=new e),e.add(i,a,n)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var E=new e,d=new e,_=new e;return l.prototype.cartesianToCartographic=function(n,a){var i=this.scaleToGeodeticSurface(n,d);if(r(i)){var o=this.geodeticSurfaceNormal(i,E),s=e.subtract(n,i,_),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),f=u.sign(e.dot(s,n))*e.magnitude(s);return r(a)?(a.longitude=c,a.latitude=l,a.height=f,a):new t(c,l,f)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var a=t.x,i=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return e.multiplyByScalar(t,s,n)},l.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},l.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},l.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,a,i){a=n(a,0);var o=this._sqauredXOverSquaredZ;if(r(i)||(i=new e),i.x=0,i.y=0,i.z=t.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},l}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,a,i,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return r(n)?(n.x=i,n.y=o,n.z=u,n):new e(i,o,u)},u.prototype.unproject=function(e,n){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,u=e.z;return r(n)?(n.longitude=i,n.latitude=o,n.height=u,n):new t(i,o,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";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a,i,o,u,s,c){this[0]=n(e,0),this[1]=n(a,0),this[2]=n(u,0),this[3]=n(t,0),this[4]=n(i,0),this[5]=n(s,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(c,0)}function c(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function l(e){for(var t=0,n=0;n<3;++n){var r=e[s.getElementIndex(_[n],d[n])];t+=2*r*r}return Math.sqrt(t)}function f(e,t){for(var n=u.EPSILON15,r=0,a=1,i=0;i<3;++i){var o=Math.abs(e[s.getElementIndex(_[i],d[i])]);o>r&&(a=i,r=o)}var c=1,l=0,f=d[a],h=_[a];if(Math.abs(e[s.getElementIndex(h,f)])>n){var E,m=e[s.getElementIndex(h,h)],p=e[s.getElementIndex(f,f)],y=e[s.getElementIndex(h,f)],T=(m-p)/2/y;E=T<0?-1/(-T+Math.sqrt(1+T*T)):1/(T+Math.sqrt(1+T*T)),c=1/Math.sqrt(1+E*E),l=E*c}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(f,f)]=t[s.getElementIndex(h,h)]=c,t[s.getElementIndex(h,f)]=l,t[s.getElementIndex(f,h)]=-l,t}s.packedLength=9,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t},s.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a},s.clone=function(e,t){if(r(e))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):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t],a[1]=e[t+1],a[2]=e[t+2],a[3]=e[t+3],a[4]=e[t+4],a[5]=e[t+5],a[6]=e[t+6],a[7]=e[t+7],a[8]=e[t+8],a},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[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 s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var n=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,u=e.y*e.y,c=e.y*e.z,l=e.y*e.w,f=e.z*e.z,h=e.z*e.w,E=e.w*e.w,d=n-u-f+E,_=2*(a-h),m=2*(i+l),p=2*(a+h),y=-n+u-f+E,T=2*(c-o),R=2*(i-l),A=2*(c+o),S=-n-u+f+E;return r(t)?(t[0]=d,t[1]=p,t[2]=R,t[3]=_,t[4]=y,t[5]=A,t[6]=m,t[7]=T,t[8]=S,t):new s(d,_,m,p,y,T,R,A,S)},s.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),a=Math.cos(-e.heading),i=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),c=Math.sin(e.roll),l=n*a,f=-i*u+c*o*a,h=c*u+i*o*a,E=n*u,d=i*a+c*o*u,_=-o*i+i*o*u,m=-o,p=c*n,y=i*n;return r(t)?(t[0]=l,t[1]=E,t[2]=m,t[3]=f,t[4]=d,t[5]=p,t[6]=h,t[7]=_,t[8]=y,t):new s(l,f,h,E,d,_,m,p,y)},s.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 s(e.x,0,0,0,e.y,0,0,0,e.z)},s.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 s(e,0,0,0,e,0,0,0,e)},s.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 s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=a,t[6]=0,t[7]=-a,t[8]=n,t):new s(1,0,0,0,n,-a,0,a,n)},s.fromRotationY=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=n,t):new s(n,0,a,0,1,0,-a,0,n)},s.fromRotationZ=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=a,t[2]=0,t[3]=-a,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(n,-a,0,a,n,0,0,0,1)},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):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,n){var r=3*t,a=e[r],i=e[r+1],o=e[r+2];return n.x=a,n.y=i,n.z=o,n},s.setColumn=function(e,t,n,r){r=s.clone(e,r);var a=3*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},s.getRow=function(e,t,n){var r=e[t],a=e[t+3],i=e[t+6];return n.x=r,n.y=a,n.z=i,n},s.setRow=function(e,t,n,r){return r=s.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var h=new e;s.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],h)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],h)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],h)),n};var E=new e;s.getMaximumScale=function(t){return s.getScale(t,E),e.maximumComponent(E)},s.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=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 n[0]=r,n[1]=a,n[2]=i,n[3]=o,n[4]=u,n[5]=s,n[6]=c,n[7]=l,n[8]=f,n},s.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},s.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},s.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[3]*a+e[6]*i,u=e[1]*r+e[4]*a+e[7]*i,s=e[2]*r+e[5]*a+e[8]*i;return n.x=o,n.y=u,n.z=s,n},s.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},s.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},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},s.transpose=function(e,t){var n=e[0],r=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=n,t[1]=r,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var d=[1,0,0],_=[2,2,1],m=new s,p=new s;return s.computeEigenDecomposition=function(e,t){var n=u.EPSILON20,a=10,i=0,o=0;r(t)||(t={});for(var h=t.unitary=s.clone(s.IDENTITY,t.unitary),E=t.diagonal=s.clone(e,t.diagonal),d=n*c(E);o<a&&l(E)>d;)f(E,m),s.transpose(m,p),s.multiply(E,m,E),s.multiply(p,E,E),s.multiply(h,m,h),++i>2&&(++o,i=0);return 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},s.determinant=function(e){var t=e[0],n=e[3],r=e[6],a=e[1],i=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*o)+a*(s*r-n*c)+u*(n*o-i*r)},s.inverse=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[3],o=e[4],u=e[5],c=e[6],l=e[7],f=e[8],h=s.determinant(e);t[0]=o*f-l*u,t[1]=l*a-r*f,t[2]=r*u-o*a,t[3]=c*u-i*f,t[4]=n*f-c*a,t[5]=i*a-n*u,t[6]=i*l-c*o,t[7]=c*r-n*l,t[8]=n*o-i*r;var E=1/h;return s.multiplyByScalar(t,E,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]},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},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,a(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r,a){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(a,0)}o.fromElements=function(e,t,r,a,i){return n(i)?(i.x=e,i.y=t,i.z=r,i.w=a,i):new o(e,t,r,a)},o.fromColor=function(e,t){return n(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(n(e))return n(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)},o.packedLength=4,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r++],a.w=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=4*r:t=new Array(4*r);for(var a=0;a<r;++a)o.pack(e[a],t,4*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/4:t=new Array(r/4);for(var a=0;a<r;a+=4){var i=a/4;t[i]=o.unpack(e,a,t[i])}return t},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,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},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 u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,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,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},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 s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,c);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)&&i.equalsEpsilon(e.w,t.w,r,a)},o.ZERO=a(new o(0,0,0,0)),o.UNIT_X=a(new o(1,0,0,0)),o.UNIT_Y=a(new o(0,1,0,0)),o.UNIT_Z=a(new o(0,0,1,0)),o.UNIT_W=a(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,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,a,i,o,u,s,c,l){ +"use strict";function f(e,t,n,a,i,o,u,s,c,l,f,h,E,d,_,m){this[0]=r(e,0),this[1]=r(i,0),this[2]=r(c,0),this[3]=r(E,0),this[4]=r(t,0),this[5]=r(o,0),this[6]=r(l,0),this[7]=r(d,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(f,0),this[11]=r(_,0),this[12]=r(a,0),this[13]=r(s,0),this[14]=r(h,0),this[15]=r(m,0)}f.packedLength=16,f.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},f.unpack=function(e,t,n){return t=r(t,0),a(n)||(n=new f),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},f.clone=function(e,t){if(a(e))return a(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 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])},f.fromArray=f.unpack,f.fromColumnMajorArray=function(e,t){return f.clone(e,t)},f.fromRowMajorArray=function(e,t){return a(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 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(t,n,i){return n=r(n,e.ZERO),a(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=1,i):new f(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},f.fromTranslationQuaternionRotationScale=function(e,t,n,r){a(r)||(r=new f);var i=n.x,o=n.y,u=n.z,s=t.x*t.x,c=t.x*t.y,l=t.x*t.z,h=t.x*t.w,E=t.y*t.y,d=t.y*t.z,_=t.y*t.w,m=t.z*t.z,p=t.z*t.w,y=t.w*t.w,T=s-E-m+y,R=2*(c-p),A=2*(l+_),S=2*(c+p),v=-s+E-m+y,N=2*(d-h),O=2*(l-_),I=2*(d+h),M=-s-E+m+y;return r[0]=T*i,r[1]=S*i,r[2]=O*i,r[3]=0,r[4]=R*o,r[5]=v*o,r[6]=I*o,r[7]=0,r[8]=A*u,r[9]=N*u,r[10]=M*u,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},f.fromTranslationRotationScale=function(e,t){return f.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},f.fromTranslation=function(e,t){return f.fromRotationTranslation(c.IDENTITY,e,t)},f.fromScale=function(e,t){return a(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 f(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},f.fromUniformScale=function(e,t){return a(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 f(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var h=new e,E=new e,d=new e;f.fromCamera=function(t,n){var r=t.position,i=t.direction,o=t.up;e.normalize(i,h),e.normalize(e.cross(h,o,E),E),e.normalize(e.cross(E,h,d),d);var u=E.x,s=E.y,c=E.z,l=h.x,_=h.y,m=h.z,p=d.x,y=d.y,T=d.z,R=r.x,A=r.y,S=r.z,v=u*-R+s*-A+c*-S,N=p*-R+y*-A+T*-S,O=l*R+_*A+m*S;return a(n)?(n[0]=u,n[1]=p,n[2]=-l,n[3]=0,n[4]=s,n[5]=y,n[6]=-_,n[7]=0,n[8]=c,n[9]=T,n[10]=-m,n[11]=0,n[12]=v,n[13]=N,n[14]=O,n[15]=1,n):new f(u,s,c,v,p,y,T,N,-l,-_,-m,O,0,0,0,1)},f.computePerspectiveFieldOfView=function(e,t,n,r,a){var i=Math.tan(.5*e),o=1/i,u=o/t,s=(r+n)/(n-r),c=2*r*n/(n-r);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=c,a[15]=0,a},f.computeOrthographicOffCenter=function(e,t,n,r,a,i,o){var u=1/(t-e),s=1/(r-n),c=1/(i-a),l=-(t+e)*u,f=-(r+n)*s,h=-(i+a)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=f,o[14]=h,o[15]=1,o},f.computePerspectiveOffCenter=function(e,t,n,r,a,i,o){var u=2*a/(t-e),s=2*a/(r-n),c=(t+e)/(t-e),l=(r+n)/(r-n),f=-(i+a)/(i-a),h=-1,E=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=f,o[11]=h,o[12]=0,o[13]=0,o[14]=E,o[15]=0,o},f.computeInfinitePerspectiveOffCenter=function(e,t,n,r,a,i){var o=2*a/(t-e),u=2*a/(r-n),s=(t+e)/(t-e),c=(r+n)/(r-n),l=-1,f=-1,h=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=s,i[9]=c,i[10]=l,i[11]=f,i[12]=0,i[13]=0,i[14]=h,i[15]=0,i},f.computeViewportTransformation=function(e,t,n,a){e=r(e,r.EMPTY_OBJECT);var i=r(e.x,0),o=r(e.y,0),u=r(e.width,0),s=r(e.height,0);t=r(t,0),n=r(n,1);var c=.5*u,l=.5*s,f=.5*(n-t),h=c,E=l,d=f,_=i+c,m=o+l,p=t+f,y=1;return a[0]=h,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=E,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=d,a[11]=0,a[12]=_,a[13]=m,a[14]=p,a[15]=y,a},f.computeView=function(t,n,r,a,i){return i[0]=a.x,i[1]=r.x,i[2]=-n.x,i[3]=0,i[4]=a.y,i[5]=r.y,i[6]=-n.y,i[7]=0,i[8]=a.z,i[9]=r.z,i[10]=-n.z,i[11]=0,i[12]=-e.dot(a,t),i[13]=-e.dot(r,t),i[14]=e.dot(n,t),i[15]=1,i},f.toArray=function(e,t){return a(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]]},f.getElementIndex=function(e,t){return 4*e+t},f.getColumn=function(e,t,n){var r=4*t,a=e[r],i=e[r+1],o=e[r+2],u=e[r+3];return n.x=a,n.y=i,n.z=o,n.w=u,n},f.setColumn=function(e,t,n,r){r=f.clone(e,r);var a=4*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r[a+3]=n.w,r},f.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},f.getRow=function(e,t,n){var r=e[t],a=e[t+4],i=e[t+8],o=e[t+12];return n.x=r,n.y=a,n.z=i,n.w=o,n},f.setRow=function(e,t,n,r){return r=f.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var _=new e;f.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],_)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],_)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],_)),n};var m=new e;f.getMaximumScale=function(t){return f.getScale(t,m),e.maximumComponent(m)},f.multiply=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],f=e[8],h=e[9],E=e[10],d=e[11],_=e[12],m=e[13],p=e[14],y=e[15],T=t[0],R=t[1],A=t[2],S=t[3],v=t[4],N=t[5],O=t[6],I=t[7],M=t[8],g=t[9],x=t[10],w=t[11],C=t[12],P=t[13],U=t[14],D=t[15],L=r*T+u*R+f*A+_*S,F=a*T+s*R+h*A+m*S,z=i*T+c*R+E*A+p*S,B=o*T+l*R+d*A+y*S,b=r*v+u*N+f*O+_*I,G=a*v+s*N+h*O+m*I,q=i*v+c*N+E*O+p*I,W=o*v+l*N+d*O+y*I,X=r*M+u*g+f*x+_*w,H=a*M+s*g+h*x+m*w,V=i*M+c*g+E*x+p*w,Y=o*M+l*g+d*x+y*w,Z=r*C+u*P+f*U+_*D,k=a*C+s*P+h*U+m*D,j=i*C+c*P+E*U+p*D,K=o*C+l*P+d*U+y*D;return n[0]=L,n[1]=F,n[2]=z,n[3]=B,n[4]=b,n[5]=G,n[6]=q,n[7]=W,n[8]=X,n[9]=H,n[10]=V,n[11]=Y,n[12]=Z,n[13]=k,n[14]=j,n[15]=K,n},f.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},f.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},f.multiplyTransformation=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=e[12],E=e[13],d=e[14],_=t[0],m=t[1],p=t[2],y=t[4],T=t[5],R=t[6],A=t[8],S=t[9],v=t[10],N=t[12],O=t[13],I=t[14],M=r*_+o*m+c*p,g=a*_+u*m+l*p,x=i*_+s*m+f*p,w=r*y+o*T+c*R,C=a*y+u*T+l*R,P=i*y+s*T+f*R,U=r*A+o*S+c*v,D=a*A+u*S+l*v,L=i*A+s*S+f*v,F=r*N+o*O+c*I+h,z=a*N+u*O+l*I+E,B=i*N+s*O+f*I+d;return n[0]=M,n[1]=g,n[2]=x,n[3]=0,n[4]=w,n[5]=C,n[6]=P,n[7]=0,n[8]=U,n[9]=D,n[10]=L,n[11]=0,n[12]=F,n[13]=z,n[14]=B,n[15]=1,n},f.multiplyByMatrix3=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=t[0],E=t[1],d=t[2],_=t[3],m=t[4],p=t[5],y=t[6],T=t[7],R=t[8],A=r*h+o*E+c*d,S=a*h+u*E+l*d,v=i*h+s*E+f*d,N=r*_+o*m+c*p,O=a*_+u*m+l*p,I=i*_+s*m+f*p,M=r*y+o*T+c*R,g=a*y+u*T+l*R,x=i*y+s*T+f*R;return n[0]=A,n[1]=S,n[2]=v,n[3]=0,n[4]=N,n[5]=O,n[6]=I,n[7]=0,n[8]=M,n[9]=g,n[10]=x,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},f.multiplyByTranslation=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=r*e[0]+a*e[4]+i*e[8]+e[12],u=r*e[1]+a*e[5]+i*e[9]+e[13],s=r*e[2]+a*e[6]+i*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=s,n[15]=e[15],n};var p=new e;f.multiplyByUniformScale=function(e,t,n){return p.x=t,p.y=t,p.z=t,f.multiplyByScale(e,p,n)},f.multiplyByScale=function(e,t,n){var r=t.x,a=t.y,i=t.z;return 1===r&&1===a&&1===i?f.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=a*e[4],n[5]=a*e[5],n[6]=a*e[6],n[7]=0,n[8]=i*e[8],n[9]=i*e[9],n[10]=i*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},f.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=t.w,u=e[0]*r+e[4]*a+e[8]*i+e[12]*o,s=e[1]*r+e[5]*a+e[9]*i+e[13]*o,c=e[2]*r+e[6]*a+e[10]*i+e[14]*o,l=e[3]*r+e[7]*a+e[11]*i+e[15]*o;return n.x=u,n.y=s,n.z=c,n.w=l,n},f.multiplyByPointAsVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i,u=e[1]*r+e[5]*a+e[9]*i,s=e[2]*r+e[6]*a+e[10]*i;return n.x=o,n.y=u,n.z=s,n},f.multiplyByPoint=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i+e[12],u=e[1]*r+e[5]*a+e[9]*i+e[13],s=e[2]*r+e[6]*a+e[10]*i+e[14];return n.x=o,n.y=u,n.z=s,n},f.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},f.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},f.transpose=function(e,t){var n=e[1],r=e[2],a=e[3],i=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=o,t[14]=u,t[15]=e[15],t},f.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},f.equals=function(e,t){return e===t||a(e)&&a(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},f.equalsEpsilon=function(e,t,n){return e===t||a(e)&&a(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},f.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},f.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};var y=new c,T=new c,R=new t,A=new t(0,0,0,1);return f.inverse=function(e,n){if(c.equalsEpsilon(f.getRotation(e,y),T,s.EPSILON7)&&t.equals(f.getRow(e,3,R),A))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],a=e[4],i=e[8],o=e[12],u=e[1],h=e[5],E=e[9],d=e[13],_=e[2],m=e[6],p=e[10],S=e[14],v=e[3],N=e[7],O=e[11],I=e[15],M=p*I,g=S*O,x=m*I,w=S*N,C=m*O,P=p*N,U=_*I,D=S*v,L=_*O,F=p*v,z=_*N,B=m*v,b=M*h+w*E+C*d-(g*h+x*E+P*d),G=g*u+U*E+F*d-(M*u+D*E+L*d),q=x*u+D*h+z*d-(w*u+U*h+B*d),W=P*u+L*h+B*E-(C*u+F*h+z*E),X=g*a+x*i+P*o-(M*a+w*i+C*o),H=M*r+D*i+L*o-(g*r+U*i+F*o),V=w*r+U*a+B*o-(x*r+D*a+z*o),Y=C*r+F*a+z*i-(P*r+L*a+B*i);M=i*d,g=o*E,x=a*d,w=o*h,C=a*E,P=i*h,U=r*d,D=o*u,L=r*E,F=i*u,z=r*h,B=a*u;var Z=M*N+w*O+C*I-(g*N+x*O+P*I),k=g*v+U*O+F*I-(M*v+D*O+L*I),j=x*v+D*N+z*I-(w*v+U*N+B*I),K=P*v+L*N+B*O-(C*v+F*N+z*O),J=x*p+P*S+g*m-(C*S+M*m+w*p),Q=L*S+M*_+D*p-(U*p+F*S+g*_),$=U*m+B*S+w*_-(z*S+x*_+D*m),ee=z*p+C*_+F*m-(L*m+B*p+P*_),te=r*b+a*G+i*q+o*W;if(Math.abs(te)<s.EPSILON20)throw new l("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=b*te,n[1]=G*te,n[2]=q*te,n[3]=W*te,n[4]=X*te,n[5]=H*te,n[6]=V*te,n[7]=Y*te,n[8]=Z*te,n[9]=k*te,n[10]=j*te,n[11]=K*te,n[12]=J*te,n[13]=Q*te,n[14]=$*te,n[15]=ee*te,n},f.inverseTransformation=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],f=e[12],h=e[13],E=e[14],d=-n*f-r*h-a*E,_=-i*f-o*h-u*E,m=-s*f-c*h-l*E;return t[0]=n,t[1]=i,t[2]=s,t[3]=0,t[4]=r,t[5]=o,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=l,t[11]=0,t[12]=d,t[13]=_,t[14]=m,t[15]=1,t},f.IDENTITY=u(new f(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),f.ZERO=u(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,i(f.prototype,{length:{get:function(){return f.packedLength}}}),f.prototype.clone=function(e){return f.clone(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},f.prototype.equalsEpsilon=function(e,t){return f.equalsEpsilon(this,e,t)},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/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(e,t,r,a){this.west=n(e,0),this.south=n(t,0),this.east=n(r,0),this.north=n(a,0)}a(c.prototype,{width:{get:function(){return c.computeWidth(this)}},height:{get:function(){return c.computeHeight(this)}}}),c.packedLength=4,c.pack=function(e,t,r){return r=n(r,0),t[r++]=e.west,t[r++]=e.south,t[r++]=e.east,t[r]=e.north,t},c.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new c),a.west=e[t++],a.south=e[t++],a.east=e[t++],a.north=e[t],a},c.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=s.TWO_PI),t-n},c.computeHeight=function(e){return e.north-e.south},c.fromDegrees=function(e,t,a,i,o){return e=s.toRadians(n(e,0)),t=s.toRadians(n(t,0)),a=s.toRadians(n(a,0)),i=s.toRadians(n(i,0)),r(o)?(o.west=e,o.south=t,o.east=a,o.north=i,o):new c(e,t,a,i)},c.fromRadians=function(e,t,a,i,o){return r(o)?(o.west=n(e,0),o.south=n(t,0),o.east=n(a,0),o.north=n(i,0),o):new c(e,t,a,i)},c.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,u=Number.MAX_VALUE,l=-Number.MAX_VALUE,f=0,h=e.length;f<h;f++){var E=e[f];n=Math.min(n,E.longitude),a=Math.max(a,E.longitude),u=Math.min(u,E.latitude),l=Math.max(l,E.latitude);var d=E.longitude>=0?E.longitude:E.longitude+s.TWO_PI;i=Math.min(i,d),o=Math.max(o,d)}return a-n>o-i&&(n=i,a=o,a>s.PI&&(a-=s.TWO_PI),n>s.PI&&(n-=s.TWO_PI)),r(t)?(t.west=n,t.south=u,t.east=a,t.north=l,t):new c(n,u,a,l)},c.fromCartesianArray=function(e,t,n){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,u=-Number.MAX_VALUE,l=Number.MAX_VALUE,f=-Number.MAX_VALUE,h=0,E=e.length;h<E;h++){var d=t.cartesianToCartographic(e[h]);a=Math.min(a,d.longitude),i=Math.max(i,d.longitude),l=Math.min(l,d.latitude),f=Math.max(f,d.latitude);var _=d.longitude>=0?d.longitude:d.longitude+s.TWO_PI;o=Math.min(o,_),u=Math.max(u,_)}return i-a>u-o&&(a=o,i=u,i>s.PI&&(i-=s.TWO_PI),a>s.PI&&(a-=s.TWO_PI)),r(n)?(n.west=a,n.south=l,n.east=i,n.north=f,n):new c(a,l,i,f)},c.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new c(e.west,e.south,e.east,e.north)},c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.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},c.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},c.validate=function(e){},c.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)},c.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)},c.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)},c.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)},c.center=function(t,n){var a=t.east,i=t.west;a<i&&(a+=s.TWO_PI);var o=s.negativePiToPi(.5*(i+a)),u=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=u,n.height=0,n):new e(o,u)},c.intersection=function(e,t,n){var a=e.east,i=e.west,o=t.east,u=t.west;a<i&&o>0?a+=s.TWO_PI:o<u&&a>0&&(o+=s.TWO_PI),a<i&&u<0?u+=s.TWO_PI:o<u&&i<0&&(i+=s.TWO_PI);var l=s.negativePiToPi(Math.max(i,u)),f=s.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&f<=l)){var h=Math.max(e.south,t.south),E=Math.min(e.north,t.north);if(!(h>=E))return r(n)?(n.west=l,n.south=h,n.east=f,n.north=E,n):new c(l,h,f,E)}},c.simpleIntersection=function(e,t,n){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(i>=u||a>=o))return r(n)?(n.west=a,n.south=i,n.east=o,n.north=u,n):new c(a,i,o,u)},c.union=function(e,t,n){r(n)||(n=new c);var a=e.east,i=e.west,o=t.east,u=t.west;a<i&&o>0?a+=s.TWO_PI:o<u&&a>0&&(o+=s.TWO_PI),a<i&&u<0?u+=s.TWO_PI:o<u&&i<0&&(i+=s.TWO_PI);var l=s.convertLongitudeRange(Math.min(i,u)),f=s.convertLongitudeRange(Math.max(a,o));return n.west=l,n.south=Math.min(e.south,t.south),n.east=f,n.north=Math.max(e.north,t.north),n},c.expand=function(e,t,n){return r(n)||(n=new c),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},c.contains=function(e,t){var n=t.longitude,r=t.latitude,a=e.west,i=e.east;return i<a&&(i+=s.TWO_PI,n<0&&(n+=s.TWO_PI)),(n>a||s.equalsEpsilon(n,a,s.EPSILON14))&&(n<i||s.equalsEpsilon(n,i,s.EPSILON14))&&r>=e.south&&r<=e.north};var l=new e;return c.subsample=function(e,t,a,i){t=n(t,o.WGS84),a=n(a,0),r(i)||(i=[]);var u=0,f=e.north,h=e.south,E=e.east,d=e.west,_=l;_.height=a,_.longitude=d,_.latitude=f,i[u]=t.cartographicToCartesian(_,i[u]),u++,_.longitude=E,i[u]=t.cartographicToCartesian(_,i[u]),u++,_.latitude=h,i[u]=t.cartographicToCartesian(_,i[u]),u++,_.longitude=d,i[u]=t.cartographicToCartesian(_,i[u]),u++,f<0?_.latitude=f:h>0?_.latitude=h:_.latitude=0;for(var m=1;m<8;++m)_.longitude=-Math.PI+m*s.PI_OVER_TWO,c.contains(e,_)&&(i[u]=t.cartographicToCartesian(_,i[u]),u++);return 0===_.latitude&&(_.longitude=d,i[u]=t.cartographicToCartesian(_,i[u]),u++,_.longitude=E,i[u]=t.cartographicToCartesian(_,i[u]),u++),i.length=u,i},c.MAX_VALUE=u(new c(-Math.PI,-s.PI_OVER_TWO,Math.PI,s.PI_OVER_TWO)),c}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var E=new e,d=new e,_=new e,m=new e,p=new e,y=new e,T=new e,R=new e,A=new e,S=new e,v=new e,N=new e;h.fromPoints=function(t,n){if(a(n)||(n=new h),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var r=e.clone(t[0],T),i=e.clone(r,E),o=e.clone(r,d),u=e.clone(r,_),s=e.clone(r,m),c=e.clone(r,p),l=e.clone(r,y),f=t.length,O=1;O<f;O++){e.clone(t[O],r);var I=r.x,M=r.y,g=r.z;I<i.x&&e.clone(r,i),I>s.x&&e.clone(r,s),M<o.y&&e.clone(r,o),M>c.y&&e.clone(r,c),g<u.z&&e.clone(r,u),g>l.z&&e.clone(r,l)}var x=e.magnitudeSquared(e.subtract(s,i,R)),w=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=i,U=s,D=x;w>D&&(D=w,P=o,U=c),C>D&&(D=C,P=u,U=l);var L=A;L.x=.5*(P.x+U.x),L.y=.5*(P.y+U.y),L.z=.5*(P.z+U.z);var F=e.magnitudeSquared(e.subtract(U,L,R)),z=Math.sqrt(F),B=S;B.x=i.x,B.y=o.y,B.z=u.z;var b=v;b.x=s.x,b.y=c.y,b.z=l.z;var G=e.multiplyByScalar(e.add(B,b,R),.5,N),q=0;for(O=0;O<f;O++){e.clone(t[O],r);var W=e.magnitude(e.subtract(r,G,R));W>q&&(q=W);var X=e.magnitudeSquared(e.subtract(r,L,R));if(X>F){var H=Math.sqrt(X);z=.5*(z+H),F=z*z;var V=H-z;L.x=(z*L.x+V*r.x)/H,L.y=(z*L.y+V*r.y)/H,L.z=(z*L.z+V*r.z)/H}}return z<q?(e.clone(L,n.center),n.radius=z):(e.clone(G,n.center),n.radius=q),n};var O=new o,I=new e,M=new e,g=new t,x=new t;h.fromRectangle2D=function(e,t,n){return h.fromRectangleWithHeights2D(e,t,0,0,n)},h.fromRectangleWithHeights2D=function(t,n,i,o,u){if(a(u)||(u=new h),!a(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;n=r(n,O),f.southwest(t,g),g.height=i,f.northeast(t,x),x.height=o;var s=n.project(g,I),c=n.project(x,M),l=c.x-s.x,E=c.y-s.y,d=c.z-s.z;u.radius=.5*Math.sqrt(l*l+E*E+d*d);var _=u.center;return _.x=s.x+.5*l,_.y=s.y+.5*E,_.z=s.z+.5*d,u};var w=[];h.fromRectangle3D=function(e,t,n,o){t=r(t,i.WGS84),n=r(n,0);var u;return a(e)&&(u=f.subsample(e,t,n,w)),h.fromPoints(u,o)},h.fromVertices=function(t,n,i,o){if(a(o)||(o=new h),!a(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;n=r(n,e.ZERO),i=r(i,3);var u=T;u.x=t[0]+n.x,u.y=t[1]+n.y,u.z=t[2]+n.z;for(var s=e.clone(u,E),c=e.clone(u,d),l=e.clone(u,_),f=e.clone(u,m),O=e.clone(u,p),I=e.clone(u,y),M=t.length,g=0;g<M;g+=i){var x=t[g]+n.x,w=t[g+1]+n.y,C=t[g+2]+n.z;u.x=x,u.y=w,u.z=C,x<s.x&&e.clone(u,s),x>f.x&&e.clone(u,f),w<c.y&&e.clone(u,c),w>O.y&&e.clone(u,O),C<l.z&&e.clone(u,l),C>I.z&&e.clone(u,I)}var P=e.magnitudeSquared(e.subtract(f,s,R)),U=e.magnitudeSquared(e.subtract(O,c,R)),D=e.magnitudeSquared(e.subtract(I,l,R)),L=s,F=f,z=P;U>z&&(z=U,L=c,F=O),D>z&&(z=D,L=l,F=I);var B=A;B.x=.5*(L.x+F.x),B.y=.5*(L.y+F.y),B.z=.5*(L.z+F.z);var b=e.magnitudeSquared(e.subtract(F,B,R)),G=Math.sqrt(b),q=S;q.x=s.x,q.y=c.y,q.z=l.z;var W=v;W.x=f.x,W.y=O.y,W.z=I.z;var X=e.multiplyByScalar(e.add(q,W,R),.5,N),H=0;for(g=0;g<M;g+=i){u.x=t[g]+n.x,u.y=t[g+1]+n.y,u.z=t[g+2]+n.z;var V=e.magnitude(e.subtract(u,X,R));V>H&&(H=V);var Y=e.magnitudeSquared(e.subtract(u,B,R));if(Y>b){var Z=Math.sqrt(Y);G=.5*(G+Z),b=G*G;var k=Z-G;B.x=(G*B.x+k*u.x)/Z,B.y=(G*B.y+k*u.y)/Z,B.z=(G*B.z+k*u.z)/Z}}return G<H?(e.clone(B,o.center),o.radius=G):(e.clone(X,o.center),o.radius=H),o},h.fromEncodedCartesianVertices=function(t,n,r){if(a(r)||(r=new h),!a(t)||!a(n)||t.length!==n.length||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var i=T;i.x=t[0]+n[0],i.y=t[1]+n[1],i.z=t[2]+n[2];for(var o=e.clone(i,E),u=e.clone(i,d),s=e.clone(i,_),c=e.clone(i,m),l=e.clone(i,p),f=e.clone(i,y),O=t.length,I=0;I<O;I+=3){var M=t[I]+n[I],g=t[I+1]+n[I+1],x=t[I+2]+n[I+2];i.x=M,i.y=g,i.z=x,M<o.x&&e.clone(i,o),M>c.x&&e.clone(i,c),g<u.y&&e.clone(i,u),g>l.y&&e.clone(i,l),x<s.z&&e.clone(i,s),x>f.z&&e.clone(i,f)}var w=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=e.magnitudeSquared(e.subtract(f,s,R)),U=o,D=c,L=w;C>L&&(L=C,U=u,D=l),P>L&&(L=P,U=s,D=f);var F=A;F.x=.5*(U.x+D.x),F.y=.5*(U.y+D.y),F.z=.5*(U.z+D.z);var z=e.magnitudeSquared(e.subtract(D,F,R)),B=Math.sqrt(z),b=S;b.x=o.x,b.y=u.y,b.z=s.z;var G=v;G.x=c.x,G.y=l.y,G.z=f.z;var q=e.multiplyByScalar(e.add(b,G,R),.5,N),W=0;for(I=0;I<O;I+=3){i.x=t[I]+n[I],i.y=t[I+1]+n[I+1],i.z=t[I+2]+n[I+2];var X=e.magnitude(e.subtract(i,q,R));X>W&&(W=X);var H=e.magnitudeSquared(e.subtract(i,F,R));if(H>z){var V=Math.sqrt(H);B=.5*(B+V),z=B*B;var Y=V-B;F.x=(B*F.x+Y*i.x)/V,F.y=(B*F.y+Y*i.y)/V,F.z=(B*F.z+Y*i.z)/V}}return B<W?(e.clone(F,r.center),r.radius=B):(e.clone(q,r.center),r.radius=W),r},h.fromCornerPoints=function(t,n,r){a(r)||(r=new h);var i=r.center;return e.add(t,n,i),e.multiplyByScalar(i,.5,i),r.radius=e.distance(i,n),r},h.fromEllipsoid=function(t,n){return a(n)||(n=new h),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var C=new e;h.fromBoundingSpheres=function(t,n){if(a(n)||(n=new h),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var r=t.length;if(1===r)return h.clone(t[0],n);if(2===r)return h.union(t[0],t[1],n);for(var i=[],o=0;o<r;o++)i.push(t[o].center);n=h.fromPoints(i,n);var u=n.center,s=n.radius;for(o=0;o<r;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,C)+c.radius)}return n.radius=s,n};var P=new e,U=new e,D=new e;h.fromOrientedBoundingBox=function(t,n){a(n)||(n=new h);var r=t.halfAxes,i=c.getColumn(r,0,P),o=c.getColumn(r,1,U),u=c.getColumn(r,2,D),s=e.magnitude(i),l=e.magnitude(o),f=e.magnitude(u);return n.center=e.clone(t.center,n.center),n.radius=Math.max(s,l,f),n},h.clone=function(t,n){if(a(t))return a(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new h(t.center,t.radius)},h.packedLength=4,h.pack=function(e,t,n){n=r(n,0);var a=e.center;return t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n]=e.radius,t},h.unpack=function(e,t,n){t=r(t,0),a(n)||(n=new h);var i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};var L=new e,F=new e;h.union=function(t,n,r){a(r)||(r=new h);var i=t.center,o=t.radius,u=n.center,s=n.radius,c=e.subtract(u,i,L),l=e.magnitude(c);if(o>=l+s)return t.clone(r),r;if(s>=l+o)return n.clone(r),r;var f=.5*(o+l+s),E=e.multiplyByScalar(c,(-o+f)/l,F);return e.add(E,i,E),e.clone(E,r.center),r.radius=f,r};var z=new e;h.expand=function(t,n,r){r=h.clone(t,r);var a=e.magnitude(e.subtract(n,r.center,z));return a>r.radius&&(r.radius=a),r},h.intersectPlane=function(t,n){var r=t.center,a=t.radius,i=n.normal,o=e.dot(i,r)+n.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},h.transform=function(e,t,n){return a(n)||(n=new h),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=l.getMaximumScale(t)*e.radius,n};var B=new e;h.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,B);return e.magnitudeSquared(r)-t.radius*t.radius},h.transformWithoutScale=function(e,t,n){return a(n)||(n=new h),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var b=new e;h.computePlaneDistances=function(t,n,r,i){a(i)||(i=new s);var o=e.subtract(t.center,n,b),u=e.dot(r,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var G=new e,q=new e,W=new e,X=new e,H=new e,V=new t,Y=new Array(8),Z=0;Z<8;++Z)Y[Z]=new e;var k=new o;return h.projectTo2D=function(t,n,a){n=r(n,k);var i=n.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,G),c=e.cross(e.UNIT_Z,s,q);e.normalize(c,c);var l=e.cross(s,c,W);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var f=e.negate(l,H),E=e.negate(c,X),d=Y,_=d[0];e.add(s,l,_),e.add(_,c,_),_=d[1],e.add(s,l,_),e.add(_,E,_),_=d[2],e.add(s,f,_),e.add(_,E,_),_=d[3],e.add(s,f,_),e.add(_,c,_),e.negate(s,s),_=d[4],e.add(s,l,_),e.add(_,c,_),_=d[5],e.add(s,l,_),e.add(_,E,_),_=d[6],e.add(s,f,_),e.add(_,E,_),_=d[7],e.add(s,f,_),e.add(_,c,_);for(var m=d.length,p=0;p<m;++p){var y=d[p];e.add(o,y,y);var T=i.cartesianToCartographic(y,V);n.project(T,y)}a=h.fromPoints(d,a),o=a.center;var R=o.x,A=o.y,S=o.z;return o.x=S,o.y=R,o.z=A,a},h.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},h.equals=function(t,n){return t===n||a(t)&&a(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},h.prototype.intersectPlane=function(e){return h.intersectPlane(this,e)},h.prototype.distanceSquaredTo=function(e){return h.distanceSquaredTo(this,e)},h.prototype.computePlaneDistances=function(e,t,n){return h.computePlaneDistances(this,e,t,n)},h.prototype.isOccluded=function(e){return h.isOccluded(this,e)},h.prototype.equals=function(e){return h.equals(this,e)},h.prototype.clone=function(e){return h.clone(this,e)},h}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return t(a,{element:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(r.requestFullscreen=a,n=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(r.requestFullscreen=a,n=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?r.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(r.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?r.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(r.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?r.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(r.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),r.fullscreenerror=a)}return n},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[r.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function a(){if(!t(A)&&(A=!1,!h())){var e=/ Chrome\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(A=!0,S=r(e[1]))}return A}function i(){return a()&&S}function o(){if(!t(v)&&(v=!1,!a()&&!h()&&/ Safari\/[\.0-9]+/.test(R.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(v=!0,N=r(e[1]))}return v}function u(){return o()&&N}function s(){if(!t(O)){O=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(R.userAgent);null!==e&&(O=!0,I=r(e[1]),I.isNightly=!!e[2])}return O}function c(){return s()&&I}function l(){if(!t(M)){M=!1;var e;"Microsoft Internet Explorer"===R.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(M=!0,g=r(e[1]))):"Netscape"===R.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(M=!0,g=r(e[1])))}return M}function f(){return l()&&g}function h(){if(!t(x)){x=!1;var e=/ Edge\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(x=!0,w=r(e[1]))}return x}function E(){return h()&&w}function d(){if(!t(C)){C=!1;var e=/Firefox\/([\.0-9]+)/.exec(R.userAgent); +null!==e&&(C=!0,P=r(e[1]))}return C}function _(){return t(U)||(U=/Windows/i.test(R.appVersion)),U}function m(){return d()&&P}function p(){return t(D)||(D="undefined"!=typeof PointerEvent&&(!t(R.pointerEnabled)||R.pointerEnabled)),D}function y(){if(!t(F)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;F=t(n)&&""!==n,F&&(L=n)}return F}function T(){return y()?L:void 0}var R;R="undefined"!=typeof navigator?navigator:{};var A,S,v,N,O,I,M,g,x,w,C,P,U,D,L,F,z={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isEdge:h,edgeVersion:E,isFirefox:d,firefoxVersion:m,isWindows:_,hardwareConcurrency:e(R.hardwareConcurrency,3),supportsPointerEvents:p,supportsImageRenderingPixelated:y,imageRenderingValue:T};return z.supportsFullscreen=function(){return n.supportsFullscreen()},z.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},z.supportsWebWorkers=function(){return"undefined"!=typeof Worker},z}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,a,i){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){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.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},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 Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,a){switch(r=e(r,0),a=e(a,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,a);case o.SHORT:return new Int16Array(n,r,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,a);case o.INT:return new Int32Array(n,r,a);case o.UNSIGNED_INT:return new Uint32Array(n,r,a);case o.FLOAT:return new Float32Array(n,r,a);case o.DOUBLE:return new Float64Array(n,r,a)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===n.POINTS||e===n.LINES||e===n.LINE_LOOP||e===n.LINE_STRIP||e===n.TRIANGLES||e===n.TRIANGLE_STRIP||e===n.TRIANGLE_FAN}};return e(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,a){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,a.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return i.computeNumberOfVertices=function(e){var n=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var a=e.attributes[r],i=a.values.length/a.componentsPerAttribute;n=i}return n},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(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 r}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,n,r,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(e){switch(e){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(t){return e(t)&&(t===i.UNSIGNED_BYTE||t===i.UNSIGNED_SHORT||t===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,n,a){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,a):new Uint16Array(t,n,a)},n(i)}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Intersect"],function(e,t,n,r,a){"use strict";function i(r,a,i){this.minimum=e.clone(t(r,e.ZERO)),this.maximum=e.clone(t(a,e.ZERO)),n(i)?i=e.clone(i):(i=e.add(this.minimum,this.maximum,new e),e.multiplyByScalar(i,.5,i)),this.center=i}i.fromPoints=function(t,r){if(n(r)||(r=new i),!n(t)||0===t.length)return r.minimum=e.clone(e.ZERO,r.minimum),r.maximum=e.clone(e.ZERO,r.maximum),r.center=e.clone(e.ZERO,r.center),r;for(var a=t[0].x,o=t[0].y,u=t[0].z,s=t[0].x,c=t[0].y,l=t[0].z,f=t.length,h=1;h<f;h++){var E=t[h],d=E.x,_=E.y,m=E.z;a=Math.min(d,a),s=Math.max(d,s),o=Math.min(_,o),c=Math.max(_,c),u=Math.min(m,u),l=Math.max(m,l)}var p=r.minimum;p.x=a,p.y=o,p.z=u;var y=r.maximum;y.x=s,y.y=c,y.z=l;var T=e.add(p,y,r.center);return e.multiplyByScalar(T,.5,T),r},i.clone=function(t,r){if(n(t))return n(r)?(r.minimum=e.clone(t.minimum,r.minimum),r.maximum=e.clone(t.maximum,r.maximum),r.center=e.clone(t.center,r.center),r):new i(t.minimum,t.maximum)},i.equals=function(t,r){return t===r||n(t)&&n(r)&&e.equals(t.center,r.center)&&e.equals(t.minimum,r.minimum)&&e.equals(t.maximum,r.maximum)};var o=new e;return i.intersectPlane=function(t,n){o=e.subtract(t.maximum,t.minimum,o);var r=e.multiplyByScalar(o,.5,o),i=n.normal,u=r.x*Math.abs(i.x)+r.y*Math.abs(i.y)+r.z*Math.abs(i.z),s=e.dot(t.center,i)+n.distance;return s-u>0?a.INSIDE:s+u<0?a.OUTSIDE:a.INTERSECTING},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.intersectPlane=function(e){return i.intersectPlane(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n){this.x=t(e,0),this.y=t(n,0)}o.fromElements=function(e,t,r){return n(r)?(r.x=e,r.y=t,r):new o(e,t)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t):new o(e.x,e.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r]=e.y,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=2*r:t=new Array(2*r);for(var a=0;a<r;++a)o.pack(e[a],t,2*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/2:t=new Array(r/2);for(var a=0;a<r;a+=2){var i=a/2;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y)},o.minimumComponent=function(e){return Math.min(e.x,e.y)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){return o.normalize(e,c),o.normalize(t,l),i.acosClamped(o.dot(c,l))};var f=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)},o.ZERO=a(new o(0,0)),o.UNIT_X=a(new o(1,0)),o.UNIT_Y=a(new o(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,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function n(e,n,r){var a=e+n;return t.sign(e)!==t.sign(n)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(n)))<r?0:a}var r={};return r.computeDiscriminant=function(e,t,n){var r=t*t-4*e*n;return r},r.computeRealRoots=function(e,r,a){var i;if(0===e)return 0===r?[]:[-a/r];if(0===r){if(0===a)return[0,0];var o=Math.abs(a),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,i<0)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-r/e,i<0?[i,0]:[0,i];var c=r*r,l=4*e*a,f=n(c,-l,t.EPSILON14);if(f<0)return[];var h=-.5*n(r,t.sign(r)*Math.sqrt(f),t.EPSILON14);return r>0?[h/e,a/h]:[a/h,h/e]},r}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function n(e,t,n,r){var a,i,o=e,u=t/3,s=n/3,c=r,l=o*s,f=u*c,h=u*u,E=s*s,d=o*s-h,_=o*c-u*s,m=u*c-E,p=4*d*m-_*_;if(p<0){var y,T,R;h*f>=l*E?(y=o,T=d,R=-2*u*d+o*_):(y=c,T=m,R=-c*_+2*s*m);var A=R<0?-1:1,S=-A*Math.abs(y)*Math.sqrt(-p);i=-R+S;var v=i/2,N=v<0?-Math.pow(-v,1/3):Math.pow(v,1/3),O=i===S?-N:-T/N;return a=T<=0?N+O:-R/(N*N+O*O+T),h*f>=l*E?[(a-u)/o]:[-c/(a+s)]}var I=d,M=-2*u*d+o*_,g=m,x=-c*_+2*s*m,w=Math.sqrt(p),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*w,-M)/3);a=2*Math.sqrt(-I);var U=Math.cos(P);i=a*U;var D=a*(-U/2-C*Math.sin(P)),L=i+D>2*u?i-u:D-u,F=o,z=L/F;P=Math.abs(Math.atan2(c*w,-x)/3),a=2*Math.sqrt(-g),U=Math.cos(P),i=a*U,D=a*(-U/2-C*Math.sin(P));var B=-c,b=i+D<2*s?i+s:D+s,G=B/b,q=F*b,W=-L*b-F*B,X=L*B,H=(s*W-u*X)/(-u*W+s*q);return z<=H?z<=G?H<=G?[z,H,G]:[z,G,H]:[G,z,H]:z<=G?[H,z,G]:H<=G?[H,G,z]:[G,H,z]}var r={};return r.computeDiscriminant=function(e,t,n,r){var a=e*e,i=t*t,o=n*n,u=r*r,s=18*e*t*n*r+i*o-27*a*u-4*(e*o*n+i*t*r);return s},r.computeRealRoots=function(e,r,a,i){var o,u;if(0===e)return t.computeRealRoots(r,a,i);if(0===r){if(0===a){if(0===i)return[0,0,0];u=-i/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===i?(o=t.computeRealRoots(e,0,a),0===o.Length?[0]:[o[0],0,o[1]]):n(e,0,a,i)}return 0===a?0===i?(u=-r/e,u<0?[u,0,0]:[0,0,u]):n(e,r,0,i):0===i?(o=t.computeRealRoots(e,r,a),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):n(e,r,a,i)},r}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,n,r){"use strict";function a(t,a,i,o){var u=t*t,s=a-3*u/8,c=i-a*t/2+u*t/8,l=o-i*t/4+a*u/16-3*u*u/256,f=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(f.length>0){var h=-t/4,E=f[f.length-1];if(Math.abs(E)<n.EPSILON14){var d=r.computeRealRoots(1,s,l);if(2===d.length){var _,m=d[0],p=d[1];if(m>=0&&p>=0){var y=Math.sqrt(m),T=Math.sqrt(p);return[h-T,h-y,h+y,h+T]}if(m>=0&&p<0)return _=Math.sqrt(m),[h-_,h+_];if(m<0&&p>=0)return _=Math.sqrt(p),[h-_,h+_]}return[]}if(E>0){var R=Math.sqrt(E),A=(s+E-c/R)/2,S=(s+E+c/R)/2,v=r.computeRealRoots(1,R,A),N=r.computeRealRoots(1,-R,S);return 0!==v.length?(v[0]+=h,v[1]+=h,0!==N.length?(N[0]+=h,N[1]+=h,v[1]<=N[0]?[v[0],v[1],N[0],N[1]]:N[1]<=v[0]?[N[0],N[1],v[0],v[1]]:v[0]>=N[0]&&v[1]<=N[1]?[N[0],v[0],v[1],N[1]]:N[0]>=v[0]&&N[1]<=v[1]?[v[0],N[0],N[1],v[1]]:v[0]>N[0]&&v[0]<N[1]?[N[0],v[0],N[1],v[1]]:[v[0],N[0],v[1],N[1]]):v):0!==N.length?(N[0]+=h,N[1]+=h,N):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,f=i*t+s-4*o,h=c*o-i*a*t+u,E=e.computeRealRoots(1,l,f,h);if(E.length>0){var d,_,m=E[0],p=a-m,y=p*p,T=t/2,R=p/2,A=y-4*o,S=y+4*Math.abs(o),v=c-4*m,N=c+4*Math.abs(m);if(m<0||A*N<v*S){var O=Math.sqrt(v);d=O/2,_=0===O?0:(t*R-i)/O}else{var I=Math.sqrt(A);d=0===I?0:(t*R-i)/I,_=I/2}var M,g;0===T&&0===d?(M=0,g=0):n.sign(T)===n.sign(d)?(M=T+d,g=m/M):(g=T-d,M=m/g);var x,w;0===R&&0===_?(x=0,w=0):n.sign(R)===n.sign(_)?(x=R+_,w=o/x):(w=R-_,x=o/w);var C=r.computeRealRoots(1,M,x),P=r.computeRealRoots(1,g,w);if(0!==C.length)return 0!==P.length?C[1]<=P[0]?[C[0],C[1],P[0],P[1]]:P[1]<=C[0]?[P[0],P[1],C[0],C[1]]:C[0]>=P[0]&&C[1]<=P[1]?[P[0],C[0],C[1],P[1]]:P[0]>=C[0]&&P[1]<=C[1]?[C[0],P[0],P[1],C[1]]:C[0]>P[0]&&C[0]<P[1]?[P[0],C[0],P[1],C[1]]:[C[0],P[0],C[1],P[1]]:C;if(0!==P.length)return P}return[]}var o={};return o.computeDiscriminant=function(e,t,n,r,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=n*n,l=c*n,f=r*r,h=f*r,E=a*a,d=E*a,_=u*c*f-4*s*h-4*e*l*f+18*e*t*n*h-27*i*f*f+256*o*d+a*(18*s*n*r-4*u*l+16*e*c*c-80*e*t*c*r-6*e*u*f+144*i*n*f)+E*(144*e*u*n-27*u*u-128*i*c-192*i*t*r);return _},o.computeRealRoots=function(t,r,o,u,s){if(Math.abs(t)<n.EPSILON15)return e.computeRealRoots(r,o,u,s);var c=r/t,l=o/t,f=u/t,h=s/t,E=c<0?1:0;switch(E+=l<0?E+1:E,E+=f<0?E+1:E,E+=h<0?E+1:E){case 0:return a(c,l,f,h);case 1:return i(c,l,f,h);case 2:return i(c,l,f,h);case 3:return a(c,l,f,h);case 4:return a(c,l,f,h);case 5:return i(c,l,f,h);case 6:return a(c,l,f,h);case 7:return a(c,l,f,h);case 8:return i(c,l,f,h);case 9:return a(c,l,f,h);case 10:return a(c,l,f,h);case 11:return i(c,l,f,h);case 12:return a(c,l,f,h);case 13:return a(c,l,f,h);case 14:return a(c,l,f,h);case 15:return a(c,l,f,h);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=e.clone(t(r,e.ZERO)),e.equals(r,e.ZERO)||e.normalize(r,r),this.origin=e.clone(t(n,e.ZERO)),this.direction=r}return a.getPoint=function(t,r,a){return n(a)||(a=new e),a=e.multiplyByScalar(t.direction,r,a),e.add(t.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,n,r,a,i,o,u,s,c,l){"use strict";function f(e,t,n,r){var a=t*t-4*e*n;if(!(a<0)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return u<s?(r.root0=u,r.root1=s):(r.root0=s,r.root1=u),r}var c=-t/(2*e);if(0!==c)return r.root0=r.root1=c,r}}function h(t,n,a){r(a)||(a=new i);var o=t.origin,u=t.direction,s=n.center,c=n.radius*n.radius,l=e.subtract(o,s,y),h=e.dot(u,u),E=2*e.dot(u,l),d=e.magnitudeSquared(l)-c,_=f(h,E,d,S);if(r(_))return a.start=_.root0,a.stop=_.root1,a}function E(e,t,n){var r=e+t;return o.sign(e)!==o.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))<n?0:r}function d(t,n,r,a,i){var l,f=a*a,h=i*i,d=(t[u.COLUMN1ROW1]-t[u.COLUMN2ROW2])*h,_=i*(a*E(t[u.COLUMN1ROW0],t[u.COLUMN0ROW1],o.EPSILON15)+n.y),m=t[u.COLUMN0ROW0]*f+t[u.COLUMN2ROW2]*h+a*n.x+r,p=h*E(t[u.COLUMN2ROW1],t[u.COLUMN1ROW2],o.EPSILON15),y=i*(a*E(t[u.COLUMN2ROW0],t[u.COLUMN0ROW2])+n.z),T=[];if(0===y&&0===p){if(l=s.computeRealRoots(d,_,m),0===l.length)return T;var R=l[0],A=Math.sqrt(Math.max(1-R*R,0));if(T.push(new e(a,i*R,i*-A)),T.push(new e(a,i*R,i*A)),2===l.length){var S=l[1],v=Math.sqrt(Math.max(1-S*S,0));T.push(new e(a,i*S,i*-v)),T.push(new e(a,i*S,i*v))}return T}var N=y*y,O=p*p,I=d*d,M=y*p,g=I+O,x=2*(_*d+M),w=2*m*d+_*_-O+N,C=2*(m*_-M),P=m*m-N;if(0===g&&0===x&&0===w&&0===C)return T;l=c.computeRealRoots(g,x,w,C,P);var U=l.length;if(0===U)return T;for(var D=0;D<U;++D){var L,F=l[D],z=F*F,B=Math.max(1-z,0),b=Math.sqrt(B);L=o.sign(d)===o.sign(m)?E(d*z+m,_*F,o.EPSILON12):o.sign(m)===o.sign(_*F)?E(d*z,_*F+m,o.EPSILON12):E(d*z+_*F,m,o.EPSILON12);var G=E(p*F,y,o.EPSILON15),q=L*G;q<0?T.push(new e(a,i*F,i*b)):q>0?T.push(new e(a,i*F,i*-b)):0!==b?(T.push(new e(a,i*F,i*-b)),T.push(new e(a,i*F,i*b)),++D):T.push(new e(a,i*F,i*b))}return T}var _={};_.rayPlane=function(t,n,a){r(a)||(a=new e);var i=t.origin,u=t.direction,s=n.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON15)){var l=(-n.distance-e.dot(s,i))/c;if(!(l<0))return a=e.multiplyByScalar(u,l,a),e.add(i,a,a)}};var m=new e,p=new e,y=new e,T=new e,R=new e;_.rayTriangleParametric=function(t,r,a,i,u){u=n(u,!1);var s,c,l,f,h,E=t.origin,d=t.direction,_=e.subtract(a,r,m),A=e.subtract(i,r,p),S=e.cross(d,A,y),v=e.dot(_,S);if(u){if(v<o.EPSILON6)return;if(s=e.subtract(E,r,T),l=e.dot(s,S),l<0||l>v)return;if(c=e.cross(s,_,R),f=e.dot(d,c),f<0||l+f>v)return;h=e.dot(A,c)/v}else{if(Math.abs(v)<o.EPSILON6)return;var N=1/v;if(s=e.subtract(E,r,T),l=e.dot(s,S)*N,l<0||l>1)return;if(c=e.cross(s,_,R),f=e.dot(d,c)*N,f<0||l+f>1)return;h=e.dot(A,c)*N}return h},_.rayTriangle=function(t,n,a,i,o,u){var s=_.rayTriangleParametric(t,n,a,i,o);if(r(s)&&!(s<0))return r(u)||(u=new e), +e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var A=new l;_.lineSegmentTriangle=function(t,n,a,i,o,u,s){var c=A;e.clone(t,c.origin),e.subtract(n,t,c.direction),e.normalize(c.direction,c.direction);var l=_.rayTriangleParametric(c,a,i,o,u);if(!(!r(l)||l<0||l>e.distance(t,n)))return r(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var S={root0:0,root1:0};_.raySphere=function(e,t,n){if(n=h(e,t,n),r(n)&&!(n.stop<0))return n.start=Math.max(n.start,0),n};var v=new l;_.lineSegmentSphere=function(t,n,a,i){var o=v;e.clone(t,o.origin);var u=e.subtract(n,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),i=h(o,a,i),!(!r(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var N=new e,O=new e;_.rayEllipsoid=function(t,n){var r,a,o,u,s,c=n.oneOverRadii,l=e.multiplyComponents(c,t.origin,N),f=e.multiplyComponents(c,t.direction,O),h=e.magnitudeSquared(l),E=e.dot(l,f);if(h>1){if(E>=0)return;var d=E*E;if(r=h-1,a=e.magnitudeSquared(f),o=a*r,d<o)return;if(d>o){u=E*E-o,s=-E+Math.sqrt(u);var _=s/a,m=r/s;return _<m?new i(_,m):{start:m,stop:_}}var p=Math.sqrt(r/a);return new i(p,p)}return h<1?(r=h-1,a=e.magnitudeSquared(f),o=a*r,u=E*E-o,s=-E+Math.sqrt(u),new i(0,s/a)):E<0?(a=e.magnitudeSquared(f),new i(0,-E/a)):void 0};var I=new e,M=new e,g=new e,x=new e,w=new e,C=new u,P=new u,U=new u,D=new u,L=new u,F=new u,z=new u,B=new e,b=new e,G=new t;_.grazingAltitudeLocation=function(t,n){var a=t.origin,i=t.direction;if(!e.equals(a,e.ZERO)){var s=n.geodeticSurfaceNormal(a,I);if(e.dot(i,s)>=0)return a}var c=r(this.rayEllipsoid(t,n)),l=n.transformPositionToScaledSpace(i,I),f=e.normalize(l,l),h=e.mostOrthogonalAxis(l,x),E=e.normalize(e.cross(h,f,M),M),_=e.normalize(e.cross(f,E,g),g),m=C;m[0]=f.x,m[1]=f.y,m[2]=f.z,m[3]=E.x,m[4]=E.y,m[5]=E.z,m[6]=_.x,m[7]=_.y,m[8]=_.z;var p=u.transpose(m,P),y=u.fromScale(n.radii,U),T=u.fromScale(n.oneOverRadii,D),R=L;R[0]=0,R[1]=-i.z,R[2]=i.y,R[3]=i.z,R[4]=0,R[5]=-i.x,R[6]=-i.y,R[7]=i.x,R[8]=0;var A,S,v=u.multiply(u.multiply(p,T,F),R,F),N=u.multiply(u.multiply(v,y,z),m,z),O=u.multiplyByVector(v,a,w),q=d(N,e.negate(O,I),0,0,1),W=q.length;if(W>0){for(var X=e.clone(e.ZERO,b),H=Number.NEGATIVE_INFINITY,V=0;V<W;++V){A=u.multiplyByVector(y,u.multiplyByVector(m,q[V],B),B);var Y=e.normalize(e.subtract(A,a,x),x),Z=e.dot(Y,i);Z>H&&(H=Z,X=e.clone(A,X))}var k=n.cartesianToCartographic(X,G);return H=o.clamp(H,0,1),S=e.magnitude(e.subtract(X,a,x))*Math.sqrt(1-H*H),S=c?-S:S,k.height=S,n.cartographicToCartesian(k,new e)}};var q=new e;return _.lineSegmentPlane=function(t,n,a,i){r(i)||(i=new e);var u=e.subtract(n,t,q),s=a.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON6)){var l=e.dot(s,t),f=-(a.distance+l)/c;if(!(f<0||f>1))return e.multiplyByScalar(u,f,i),e.add(t,i,i),i}},_.trianglePlaneIntersection=function(t,n,r,a){var i=a.normal,o=a.distance,u=e.dot(i,t)+o<0,s=e.dot(i,n)+o<0,c=e.dot(i,r)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var f,h;if(1!==l&&2!==l||(f=new e,h=new e),1===l){if(u)return _.lineSegmentPlane(t,n,a,f),_.lineSegmentPlane(t,r,a,h),{positions:[t,n,r,f,h],indices:[0,3,4,1,2,4,1,4,3]};if(s)return _.lineSegmentPlane(n,r,a,f),_.lineSegmentPlane(n,t,a,h),{positions:[t,n,r,f,h],indices:[1,3,4,2,0,4,2,4,3]};if(c)return _.lineSegmentPlane(r,t,a,f),_.lineSegmentPlane(r,n,a,h),{positions:[t,n,r,f,h],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return _.lineSegmentPlane(n,t,a,f),_.lineSegmentPlane(r,t,a,h),{positions:[t,n,r,f,h],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return _.lineSegmentPlane(r,n,a,f),_.lineSegmentPlane(t,n,a,h),{positions:[t,n,r,f,h],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return _.lineSegmentPlane(t,r,a,f),_.lineSegmentPlane(n,r,a,h),{positions:[t,n,r,f,h],indices:[0,1,4,0,4,3,2,3,4]}}},_}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";function a(t,n){this.normal=e.clone(t),this.distance=n}a.fromPointNormal=function(n,r,i){var o=-e.dot(r,n);return t(i)?(e.clone(r,i.normal),i.distance=o,i):new a(r,o)};var i=new e;return a.fromCartesian4=function(n,r){var o=e.fromCartesian4(n,i),u=n.w;return t(r)?(e.clone(o,r.normal),r.distance=u,r):new a(o,u)},a.getPointDistance=function(t,n){return e.dot(t.normal,n)+t.distance},a.ORIGIN_XY_PLANE=r(new a(e.UNIT_Z,0)),a.ORIGIN_YZ_PLANE=r(new a(e.UNIT_X,0)),a.ORIGIN_ZX_PLANE=r(new a(e.UNIT_Y,0)),a}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,n,r,a){return t(e).then(n,r,a)}function t(e){var t,n;return e instanceof r?t=e:u(e)?(n=o(),e.then(function(e){n.resolve(e)},function(e){n.reject(e)},function(e){n.progress(e)}),t=n.promise):t=a(e),t}function n(t){return e(t,i)}function r(e){this.then=e}function a(e){var n=new r(function(n){try{return t(n?n(e):e)}catch(e){return i(e)}});return n}function i(e){var n=new r(function(n,r){try{return r?t(r(e)):i(e)}catch(e){return i(e)}});return n}function o(){function e(e,t,n){return h(e,t,n)}function n(e){return d(e)}function a(e){return d(i(e))}function u(e){return E(e)}var s,c,l,f,h,E,d;return c=new r(e),s={then:e,resolve:n,reject:a,progress:u,promise:c,resolver:{resolve:n,reject:a,progress:u}},l=[],f=[],h=function(e,t,n){var r,a;return r=o(),a="function"==typeof n?function(e){try{r.progress(n(e))}catch(e){r.progress(e)}}:function(e){r.progress(e)},l.push(function(n){n.then(e,t).then(r.resolve,r.reject,a)}),f.push(a),r.promise},E=function(e){return _(f,e),e},d=function(e){return e=t(e),h=e.then,d=t,E=p,_(l,e),f=l=A,e},s}function u(e){return e&&"function"==typeof e.then}function s(t,n,r,a,i){return m(2,arguments),e(t,function(t){function u(e){_(e)}function s(e){d(e)}var c,l,f,h,E,d,_,m,y,T;if(y=t.length>>>0,c=Math.max(0,Math.min(n,y)),f=[],l=y-c+1,h=[],E=o(),c)for(m=E.progress,_=function(e){h.push(e),--l||(d=_=p,E.reject(h))},d=function(e){f.push(e),--c||(d=_=p,E.resolve(f))},T=0;T<y;++T)T in t&&e(t[T],s,u,m);else E.resolve(f);return E.then(r,a,i)})}function c(e,t,n,r){function a(e){return t?t(e[0]):e[0]}return s(e,1,a,n,r)}function l(e,t,n,r){return m(1,arguments),h(e,y).then(t,n,r)}function f(){return h(arguments,y)}function h(t,n){return e(t,function(t){var r,a,i,u,s,c;if(i=a=t.length>>>0,r=[],c=o(),i)for(u=function(t,a){e(t,n).then(function(e){r[a]=e,--i||c.resolve(r)},c.reject)},s=0;s<a;s++)s in t?u(t[s],s):--i;else c.resolve(r);return c.promise})}function E(t,n){var r=R.call(arguments,1);return e(t,function(t){var a;return a=t.length,r[0]=function(t,r,i){return e(t,function(t){return e(r,function(e){return n(t,e,i,a)})})},T.apply(t,r)})}function d(t,n,r){var a=arguments.length>2;return e(t,function(e){return e=a?r:e,n.resolve(e),e},function(e){return n.reject(e),i(e)},n.progress)}function _(e,t){for(var n,r=0;n=e[r++];)n(t)}function m(e,t){for(var n,r=t.length;r>e;)if(n=t[--r],null!=n&&"function"!=typeof n)throw new Error("arg "+r+" must be a function")}function p(){}function y(e){return e}var T,R,A;return e.defer=o,e.resolve=t,e.reject=n,e.join=f,e.all=l,e.map=h,e.reduce=E,e.any=c,e.some=s,e.chain=d,e.isPromise=u,r.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(A,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return l(t,function(t){return e.apply(A,t)})})}},R=[].slice,T=[].reduce||function(e){var t,n,r,a,i;if(i=0,t=Object(this),a=t.length>>>0,n=arguments,n.length<=1)for(;;){if(i in t){r=t[i++];break}if(++i>=a)throw new TypeError}else r=n[1];for(;i<a;++i)i in t&&(r=e(r,t[i],i,t));return r},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/binarySearch",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e,t,n){for(var r,a,i=0,o=e.length-1;i<=o;)if(r=~~((i+o)/2),a=n(e[r],t),a<0)i=r+1;else{if(!(a>0))return r;o=r-1}return~(o+1)}return n}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,n,r,a){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=r,this.ut1MinusUtc=a}return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,n=0,r=t[n++],a=function(e,t,n,r){n||(n=" ");var a=e.length>=t?"":Array(1+t-e.length>>>0).join(n);return r?e+a:a+e},i=function(e,t,n,r,i,o){var u=r-e.length;return u>0&&(e=n||!i?a(e,r,o,n):e.slice(0,t.length)+a("",u,"0",!0)+e.slice(t.length)),e},o=function(e,t,n,r,o,u,s){var c=e>>>0;return n=n&&c&&{2:"0b",8:"0",16:"0x"}[t]||"",e=n+a(c.toString(t),u||0,"0",!1),i(e,n,r,o,s)},u=function(e,t,n,r,a,o){return null!=r&&(e=e.slice(0,r)),i(e,"",t,n,a,o)},s=function(e,r,s,c,l,f,h){var E,d,_,m,p;if("%%"==e)return"%";for(var y=!1,T="",R=!1,A=!1,S=" ",v=s.length,N=0;s&&N<v;N++)switch(s.charAt(N)){case" ":T=" ";break;case"+":T="+";break;case"-":y=!0;break;case"'":S=s.charAt(N+1);break;case"0":R=!0;break;case"#":A=!0}if(c=c?"*"==c?+t[n++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,c<0&&(c=-c,y=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(f=f?"*"==f?+t[n++]:"*"==f.charAt(0)?+t[f.slice(1,-1)]:+f:"fFeE".indexOf(h)>-1?6:"d"==h?0:void 0,p=r?t[r.slice(0,-1)]:t[n++],h){case"s":return u(String(p),y,c,f,R,S);case"c":return u(String.fromCharCode(+p),y,c,f,R);case"b":return o(p,2,A,y,c,f,R);case"o":return o(p,8,A,y,c,f,R);case"x":return o(p,16,A,y,c,f,R);case"X":return o(p,16,A,y,c,f,R).toUpperCase();case"u":return o(p,10,A,y,c,f,R);case"i":case"d":return E=+p||0,E=Math.round(E-E%1),d=E<0?"-":T,p=d+a(String(Math.abs(E)),f,"0",!1),i(p,d,y,c,R);case"e":case"E":case"f":case"F":case"g":case"G":return E=+p,d=E<0?"-":T,_=["toExponential","toFixed","toPrecision"]["efg".indexOf(h.toLowerCase())],m=["toString","toUpperCase"]["eEfFgG".indexOf(h)%2],p=d+Math.abs(E)[_](f),i(p,d,y,c,R)[m]();default:return e}};return r.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,n,r,a,i,o,u){this.year=e,this.month=t,this.day=n,this.hour=r,this.minute=a,this.second=i,this.millisecond=o,this.isLeapSecond=u}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e(t)}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t){return _.compare(e.julianDate,t.julianDate)}function f(e){T.julianDate=e;var n=_.leapSeconds,r=t(n,T,l);r<0&&(r=~r),r>=n.length&&(r=n.length-1);var a=n[r].offset;if(r>0){var i=_.secondsDifference(n[r].julianDate,e);i>a&&(r--,a=n[r].offset)}_.addSeconds(e,a,e)}function h(e,n){T.julianDate=e;var r=_.leapSeconds,a=t(r,T,l);if(a<0&&(a=~a),0===a)return _.addSeconds(e,-r[0].offset,n);if(a>=r.length)return _.addSeconds(e,-r[a-1].offset,n);var i=_.secondsDifference(r[a].julianDate,e);return 0===i?_.addSeconds(e,-r[a].offset,n):i<=1?void 0:_.addSeconds(e,-r[--a].offset,n)}function E(e,t,n){var r=t/s.SECONDS_PER_DAY|0;return e+=r,t-=s.SECONDS_PER_DAY*r,t<0&&(e--,t+=s.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function d(e,t,n,r,a,i,o){var u=(t-14)/12|0,c=e+4800+u,l=(1461*c/4|0)+(367*(t-2-12*u)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;r-=12,r<0&&(r+=24);var f=i+(r*s.SECONDS_PER_HOUR+a*s.SECONDS_PER_MINUTE+o*s.SECONDS_PER_MILLISECOND);return f>=43200&&(l-=1),[l,f]}function _(e,t,r){this.dayNumber=void 0,this.secondsOfDay=void 0,e=n(e,0),t=n(t,0),r=n(r,c.UTC);var a=0|e;t+=(e-a)*s.SECONDS_PER_DAY,E(a,t,this),r===c.UTC&&f(this)}var m=new i,p=[31,28,31,30,31,30,31,31,30,31,30,31],y=29,T=new u,R=/^(\d{4})$/,A=/^(\d{4})-(\d{2})$/,S=/^(\d{4})-?(\d{3})$/,v=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,N=/^(\d{4})-?(\d{2})-?(\d{2})$/,O=/([Z+\-])?(\d{2})?:?(\d{2})?$/,I=/^(\d{2})(\.\d+)?/.source+O.source,M=/^(\d{2}):?(\d{2})(\.\d+)?/.source+O.source,g=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+O.source;_.fromDate=function(e,t){var n=d(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r(t)?(E(n[0],n[1],t),f(t),t):new _(n[0],n[1],c.UTC)},_.fromIso8601=function(e,t){e=e.replace(",",".");var n,a,i,u=e.split("T"),s=1,l=1,h=0,m=0,T=0,O=0,x=u[0],w=u[1];if(u=x.match(N),null!==u)n=+u[1],s=+u[2],l=+u[3];else if(u=x.match(A),null!==u)n=+u[1],s=+u[2];else if(u=x.match(R),null!==u)n=+u[1];else{var C;if(u=x.match(S),null!==u)n=+u[1],C=+u[2],i=o(n);else if(u=x.match(v),null!==u){n=+u[1];var P=+u[2],U=+u[3]||0,D=new Date(Date.UTC(n,0,4));C=7*P+U-D.getUTCDay()-3}a=new Date(Date.UTC(n,0,1)),a.setUTCDate(C),s=a.getUTCMonth()+1,l=a.getUTCDate()}i=o(n);var L;if(r(w)){u=w.match(g),null!==u?(h=+u[1],m=+u[2],T=+u[3],O=1e3*+(u[4]||0),L=5):(u=w.match(M),null!==u?(h=+u[1],m=+u[2],T=60*+(u[3]||0),L=4):(u=w.match(I),null!==u&&(h=+u[1],m=60*+(u[2]||0),L=3)));var F=u[L],z=+u[L+1],B=+(u[L+2]||0);switch(F){case"+":h-=z,m-=B;break;case"-":h+=z,m+=B;break;case"Z":break;default:m+=new Date(Date.UTC(n,s-1,l,h,m)).getTimezoneOffset()}}else m+=new Date(n,s-1,l).getTimezoneOffset();var b=60===T;for(b&&T--;m>=60;)m-=60,h++;for(;h>=24;)h-=24,l++;for(a=i&&2===s?y:p[s-1];l>a;)l-=a,s++,s>12&&(s-=12,n++),a=i&&2===s?y:p[s-1];for(;m<0;)m+=60,h--;for(;h<0;)h+=24,l--;for(;l<1;)s--,s<1&&(s+=12,n--),a=i&&2===s?y:p[s-1],l+=a;var G=d(n,s,l,h,m,T,O);return r(t)?(E(G[0],G[1],t),f(t)):t=new _(G[0],G[1],c.UTC),b&&_.addSeconds(t,1,t),t},_.now=function(e){return _.fromDate(new Date,e)};var x=new _(0,0,c.TAI);return _.toGregorianDate=function(e,t){var n=!1,a=h(e,x);r(a)||(_.addSeconds(e,-1,x),a=h(x,x),n=!0);var o=a.dayNumber,u=a.secondsOfDay;u>=43200&&(o+=1);var c=o+68569|0,l=4*c/146097|0;c=c-((146097*l+3)/4|0)|0;var f=4e3*(c+1)/1461001|0;c=c-(1461*f/4|0)+31|0;var E=80*c/2447|0,d=c-(2447*E/80|0)|0;c=E/11|0;var m=E+2-12*c|0,p=100*(l-49)+f+c|0,y=u/s.SECONDS_PER_HOUR|0,T=u-y*s.SECONDS_PER_HOUR,R=T/s.SECONDS_PER_MINUTE|0;T-=R*s.SECONDS_PER_MINUTE;var A=0|T,S=(T-A)/s.SECONDS_PER_MILLISECOND;return y+=12,y>23&&(y-=24),n&&(A+=1),r(t)?(t.year=p,t.month=m,t.day=d,t.hour=y,t.minute=R,t.second=A,t.millisecond=S,t.isLeapSecond=n,t):new i(p,m,d,y,R,A,S,n)},_.toDate=function(e){var t=_.toGregorianDate(e,m),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))},_.toIso8601=function(t,n){var a,i=_.toGregorianDate(t,i);return r(n)||0===i.millisecond?r(n)&&0!==n?(a=(.01*i.millisecond).toFixed(n).replace(".","").slice(0,n),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",i.year,i.month,i.day,i.hour,i.minute,i.second):(a=(.01*i.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a))},_.clone=function(e,t){if(r(e))return r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new _(e.dayNumber,e.secondsOfDay,c.TAI)},_.compare=function(e,t){var n=e.dayNumber-t.dayNumber;return 0!==n?n:e.secondsOfDay-t.secondsOfDay},_.equals=function(e,t){return e===t||r(e)&&r(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},_.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(_.secondsDifference(e,t))<=n},_.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},_.secondsDifference=function(e,t){var n=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return n+(e.secondsOfDay-t.secondsOfDay)},_.daysDifference=function(e,t){var n=e.dayNumber-t.dayNumber,r=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return n+r},_.computeTaiMinusUtc=function(e){T.julianDate=e;var n=_.leapSeconds,r=t(n,T,l);return r<0&&(r=~r,--r,r<0&&(r=0)),n[r].offset},_.addSeconds=function(e,t,n){return E(e.dayNumber,e.secondsOfDay+t,n)},_.addMinutes=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return E(e.dayNumber,r,n)},_.addHours=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return E(e.dayNumber,r,n)},_.addDays=function(e,t,n){var r=e.dayNumber+t;return E(r,e.secondsOfDay,n)},_.lessThan=function(e,t){return _.compare(e,t)<0},_.lessThanOrEquals=function(e,t){return _.compare(e,t)<=0},_.greaterThan=function(e,t){return _.compare(e,t)>0},_.greaterThanOrEquals=function(e,t){return _.compare(e,t)>=0},_.prototype.clone=function(e){return _.clone(this,e)},_.prototype.equals=function(e){return _.equals(this,e)},_.prototype.equalsEpsilon=function(e,t){return _.equalsEpsilon(this,e,t)},_.prototype.toString=function(){return _.toIso8601(this)},_.leapSeconds=[new u(new _(2441317,43210,c.TAI),10),new u(new _(2441499,43211,c.TAI),11),new u(new _(2441683,43212,c.TAI),12),new u(new _(2442048,43213,c.TAI),13),new u(new _(2442413,43214,c.TAI),14),new u(new _(2442778,43215,c.TAI),15),new u(new _(2443144,43216,c.TAI),16),new u(new _(2443509,43217,c.TAI),17),new u(new _(2443874,43218,c.TAI),18),new u(new _(2444239,43219,c.TAI),19),new u(new _(2444786,43220,c.TAI),20),new u(new _(2445151,43221,c.TAI),21),new u(new _(2445516,43222,c.TAI),22),new u(new _(2446247,43223,c.TAI),23),new u(new _(2447161,43224,c.TAI),24),new u(new _(2447892,43225,c.TAI),25),new u(new _(2448257,43226,c.TAI),26),new u(new _(2448804,43227,c.TAI),27),new u(new _(2449169,43228,c.TAI),28),new u(new _(2449534,43229,c.TAI),29),new u(new _(2450083,43230,c.TAI),30),new u(new _(2450630,43231,c.TAI),31),new u(new _(2451179,43232,c.TAI),32),new u(new _(2453736,43233,c.TAI),33),new u(new _(2454832,43234,c.TAI),34),new u(new _(2456109,43235,c.TAI),35),new u(new _(2457204,43236,c.TAI),36),new u(new _(2457754,43237,c.TAI),37)],_}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(n,r){if(null===n||"object"!=typeof n)return n;r=e(r,!1);var a=new n.constructor;for(var i in n)if(n.hasOwnProperty(i)){var o=n[i];r&&(o=t(o,r)),a[i]=o}return a}return t}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var n=e.split("\r\n"),r=0;r<n.length;++r){var a=n[r],i=a.indexOf(": ");if(i>0){var o=a.substring(0,i),u=a.substring(i+2);t[o]=u}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function n(e,n,r){this.statusCode=e,this.response=n,this.responseHeaders=r,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return n.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},n}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var n=r.exec(t);this.scheme=n[1],this.authority=n[2],this.path=n[3],this.query=n[4],this.fragment=n[5]}}function t(e){var t=unescape(e);return i.test(t)?t:e.toUpperCase()}function n(e,t,n,r){return(t||"")+n.toLowerCase()+(r||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var r=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(o,n).replace(a,t)),this.path&&(this.path=this.path.replace(a,t)),this.query&&(this.query=this.query.replace(a,t)),this.fragment&&(this.fragment=this.fragment.replace(a,t))};var a=/%[0-9a-z]{2}/gi,i=/[a-zA-Z0-9\-\._~]/,o=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var n=new e;return this.scheme?(n.scheme=this.scheme,n.authority=this.authority,n.path=this.path,n.query=this.query):(n.scheme=t.scheme,this.authority?(n.authority=this.authority,n.path=this.path,n.query=this.query):(n.authority=t.authority,""==this.path?(n.path=t.path,n.query=this.query||t.query):("/"==this.path.charAt(0)?(n.path=this.path,n.removeDotSegments()):(t.authority&&""==t.path?n.path="/"+this.path:n.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,n.removeDotSegments()),n.query=this.query))),n.fragment=this.fragment,n},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),n=[],r=""==t[0];r&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?n.pop():"."!=e&&n.push(e);"."!=e&&".."!=e||n.push(""),r&&n.unshift(""),this.path=n.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n){var r=new e(n);r.normalize();var a=r.getAuthority();if(t(a)){if(a.indexOf("@")!==-1){var i=a.split("@");a=i[1]}if(a.indexOf(":")===-1){var o=r.getScheme();if(t(o)||(o=window.location.protocol,o=o.substring(0,o.length-1)),"http"===o)a+=":80";else{if("https"!==o)return;a+=":443"}}return a}}var a={},i={};return a.add=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])||(i[r]=!0)},a.remove=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])&&delete i[r]},a.contains=function(e){var n=r(e);return!(!t(n)||!t(i[n]))},a.clear=function(){i={}},a}),define("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,n,r,a,i,o){"use strict";function u(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,a=t(n.method,"GET"),i=n.data,o=n.headers,s=n.overrideMimeType;return e(n.url,function(t){var n=e.defer();return u.load(t,r,a,i,o,n,s),n.promise})}function s(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function c(e,t){for(var n=s(e,t),r=new ArrayBuffer(n.length),a=new Uint8Array(r),i=0;i<n.length;i++)a[i]=n.charCodeAt(i);return r}function l(e,n){n=t(n,"");var r=e[1],a=!!e[2],i=e[3];switch(n){case"":case"text":return s(a,i);case"arraybuffer":return c(a,i);case"blob":var o=c(a,i);return new Blob([o],{type:r});case"document":var u=new DOMParser;return u.parseFromString(s(a,i),r);case"json":return JSON.parse(s(a,i))}}var f=/^data:(.*?)(;base64)?,(.*)$/;return u.load=function(e,t,r,u,s,c,h){var E=f.exec(e);if(null!==E)return void c.resolve(l(E,t));var d=new XMLHttpRequest;if(o.contains(e)&&(d.withCredentials=!0),n(h)&&n(d.overrideMimeType)&&d.overrideMimeType(h),d.open(r,e,!0),n(s))for(var _ in s)s.hasOwnProperty(_)&&d.setRequestHeader(_,s[_]);n(t)&&(d.responseType=t),d.onload=function(){if(d.status<200||d.status>=300)return void c.reject(new a(d.status,d.response,d.getAllResponseHeaders()));var e=d.response,r=d.responseType;if(!n(e)||n(t)&&r!==t)if("json"===t&&"string"==typeof e)try{c.resolve(JSON.parse(e))}catch(e){c.reject(e)}else(""===r||"document"===r)&&n(d.responseXML)&&d.responseXML.hasChildNodes()?c.resolve(d.responseXML):""!==r&&"text"!==r||!n(d.responseText)?c.reject(new i("Invalid XMLHttpRequest response type.")):c.resolve(d.responseText);else c.resolve(e)},d.onerror=function(e){c.reject(new a)},d.send(u)},u.defaultLoad=u.load,u}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,n){return e({url:t,headers:n})}return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";function a(n,a){return t(a)?t(a.Accept)||(a=e(a),a.Accept=i.Accept):a=i,r(n,a).then(function(e){return JSON.parse(e)})}var i={Accept:"application/json,*/*;q=0.01"};return a}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(t){if(t=n(t,n.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=n(t.addNewLeapSeconds,!0),r(t.data))d(this,t.data);else if(r(t.url)){var a=this;this._downloadPromise=e(s(t.url),function(e){d(a,e)},function(){a._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else d(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function E(e,t){return o.compare(e.julianDate,t)}function d(e,n){if(!r(n.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!r(n.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var a=n.columnNames.indexOf("modifiedJulianDateUtc"),i=n.columnNames.indexOf("xPoleWanderRadians"),s=n.columnNames.indexOf("yPoleWanderRadians"),c=n.columnNames.indexOf("ut1MinusUtcSeconds"),h=n.columnNames.indexOf("xCelestialPoleOffsetRadians"),d=n.columnNames.indexOf("yCelestialPoleOffsetRadians"),_=n.columnNames.indexOf("taiMinusUtcSeconds");if(a<0||i<0||s<0||c<0||h<0||d<0||_<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var m=e._samples=n.samples,p=e._dates=[];e._dateColumn=a,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=h,e._yCelestialPoleOffsetRadiansColumn=d,e._taiMinusUtcSecondsColumn=_,e._columnCount=n.columnNames.length,e._lastIndex=void 0;for(var y,T=e._addNewLeapSeconds,R=0,A=m.length;R<A;R+=e._columnCount){var S=m[R+a],v=m[R+_],N=S+l.MODIFIED_JULIAN_DATE_DIFFERENCE,O=new o(N,v,f.TAI);if(p.push(O),T){if(v!==y&&r(y)){var I=o.leapSeconds,M=t(I,O,E);if(M<0){var g=new u(O,v);I.splice(~M,0,g)}}y=v}}}function _(e,t,n,r,a){var i=n*r;a.xPoleWander=t[i+e._xPoleWanderRadiansColumn],a.yPoleWander=t[i+e._yPoleWanderRadiansColumn],a.xPoleOffset=t[i+e._xCelestialPoleOffsetRadiansColumn],a.yPoleOffset=t[i+e._yCelestialPoleOffsetRadiansColumn],a.ut1MinusUtc=t[i+e._ut1MinusUtcSecondsColumn]}function m(e,t,n){return t+e*(n-t)}function p(e,t,n,r,a,i,u){var s=e._columnCount;if(i>t.length-1)return u.xPoleWander=0,u.yPoleWander=0,u.xPoleOffset=0,u.yPoleOffset=0,u.ut1MinusUtc=0,u;var c=t[a],l=t[i];if(c.equals(l)||r.equals(c))return _(e,n,a,s,u),u;if(r.equals(l))return _(e,n,i,s,u),u;var f=o.secondsDifference(r,c)/o.secondsDifference(l,c),h=a*s,E=i*s,d=n[h+e._ut1MinusUtcSecondsColumn],p=n[E+e._ut1MinusUtcSecondsColumn],y=p-d;if(y>.5||y<-.5){var T=n[h+e._taiMinusUtcSecondsColumn],R=n[E+e._taiMinusUtcSecondsColumn];T!==R&&(l.equals(r)?d=p:p-=R-T)}return u.xPoleWander=m(f,n[h+e._xPoleWanderRadiansColumn],n[E+e._xPoleWanderRadiansColumn]),u.yPoleWander=m(f,n[h+e._yPoleWanderRadiansColumn],n[E+e._yPoleWanderRadiansColumn]),u.xPoleOffset=m(f,n[h+e._xCelestialPoleOffsetRadiansColumn],n[E+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=m(f,n[h+e._yCelestialPoleOffsetRadiansColumn],n[E+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=m(f,d,p),u}return h.NONE=i({getPromiseToLoad:function(){return e()},compute:function(e,t){return r(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new a(0,0,0,0,0),t}}),h.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},h.prototype.compute=function(e,n){if(r(this._samples)){if(r(n)||(n=new a(0,0,0,0,0)),0===this._samples.length)return n.xPoleWander=0,n.yPoleWander=0,n.xPoleOffset=0,n.yPoleOffset=0,n.ut1MinusUtc=0,n;var i=this._dates,u=this._lastIndex,s=0,l=0;if(r(u)){var f=i[u],h=i[u+1],E=o.lessThanOrEquals(f,e),d=!r(h),_=d||o.greaterThanOrEquals(h,e);if(E&&_)return s=u,!d&&h.equals(e)&&++s,l=s+1,p(this,i,this._samples,e,s,l,n),n}var m=t(i,e,o.compare,this._dateColumn);return m>=0?(m<i.length-1&&i[m+1].equals(e)&&++m,s=m,l=m):(l=~m,s=l-1,s<0&&(s=0)),this._lastIndex=s,p(this,i,this._samples,e,s,l,n),n}if(r(this._dataError))throw new c(this._dataError)},h}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(t,n,r){this.heading=e(t,0),this.pitch=e(n,0),this.roll=e(r,0)}return a.fromQuaternion=function(e,n){t(n)||(n=new a);var r=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return n.heading=-Math.atan2(s,u),n.roll=Math.atan2(o,i),n.pitch=-Math.asin(r),n},a.fromDegrees=function(e,n,i,o){return t(o)||(o=new a),o.heading=e*r.RADIANS_PER_DEGREE,o.pitch=n*r.RADIANS_PER_DEGREE,o.roll=i*r.RADIANS_PER_DEGREE,o},a.clone=function(e,n){if(t(e))return t(n)?(n.heading=e.heading,n.pitch=e.pitch,n.roll=e.roll,n):new a(e.heading,e.pitch,e.roll)},a.equals=function(e,n){return e===n||t(e)&&t(n)&&e.heading===n.heading&&e.pitch===n.pitch&&e.roll===n.roll},a.equalsEpsilon=function(e,n,a,i){return e===n||t(e)&&t(n)&&r.equalsEpsilon(e.heading,n.heading,a,i)&&r.equalsEpsilon(e.pitch,n.pitch,a,i)&&r.equalsEpsilon(e.roll,n.roll,a,i)},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,n){return a.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},a}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=t(r,document.location.href);var a=new e(r),i=new e(n);return i.resolve(a).toString()}return a}),define("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(r,a,i){i=t(i,!0),r instanceof e||(r=new e(r)),a instanceof e||(a=new e(a)),n(a.authority)&&!n(a.scheme)&&("undefined"!=typeof document&&n(document.location)&&n(document.location.href)?a.scheme=new e(document.location.href).scheme:a.scheme=r.scheme);var o=r;a.isAbsolute()&&(o=a);var u="";n(o.scheme)&&(u+=o.scheme+":"),n(o.authority)&&(u+="//"+o.authority,""!==o.path&&"/"!==o.path&&(u=u.replace(/\/?$/,"/"),o.path=o.path.replace(/^\/?/g,""))),u+=o===r?i?r.path.replace(/\/?$/,"/")+a.path.replace(/^\/?/g,""):r.path+a.path:a.path;var s=n(r.query),c=n(a.query);s&&c?u+="?"+r.query+"&"+a.query:s&&!c?u+="?"+r.query:!s&&c&&(u+="?"+a.query);var l=n(a.fragment);return n(r.fragment)&&!l?u+="#"+r.fragment:l&&(u+="#"+a.fragment),u}return a}),define("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","./joinUrls","require"],function(e,t,n,r,a,i){ +"use strict";function o(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;t<n;++t){var r=e[t].getAttribute("src"),a=d.exec(r);if(null!==a)return a[1]}}function u(){if(t(f))return f;var n;return n="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:o(),f=new e(r(n))}function s(e){return i.toUrl("../"+e)}function c(e){return a(u(),e)}function l(e){t(h)||(h=t(i.toUrl)?s:c),t(E)||(E=document.createElement("a"));var n=h(e);return E.href=n,E.href=E.href,E.href}var f,h,E,d=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return l._cesiumScriptRegex=d,l.setBaseUrl=function(t){f=new e(t).resolve(new e(document.location.href))},l}),define("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,n){this.x=e,this.y=t,this.s=n}return e}),define("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){e=n(e,n.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=n(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=n(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new i(this._sampleZeroJulianEphemerisDate,0,u.TAI),this._stepSizeDays=n(e.stepSizeDays,1),this._samplesPerXysFile=n(e.samplesPerXysFile,1e3),this._totalSamples=n(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,r=this._denominators=new Array(t+1),a=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t),s=0;s<=t;++s){r[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;c<=t;++c)c!==s&&(r[s]*=s-c);r[s]=1/r[s]}this._work=new Array(t+1),this._coef=new Array(t+1)}function c(e,t,n){var r=f;return r.dayNumber=t,r.secondsOfDay=n,i.daysDifference(r,e._sampleZeroDateTT)}function l(n,a){if(n._chunkDownloadsInProgress[a])return n._chunkDownloadsInProgress[a];var i=e.defer();n._chunkDownloadsInProgress[a]=i;var u,s=n._xysFileUrlTemplate;return u=r(s)?s.replace("{0}",a):t("Assets/IAU2006_XYS/IAU2006_XYS_"+a+".json"),e(o(u),function(e){n._chunkDownloadsInProgress[a]=!1;for(var t=n._samples,r=e.samples,o=a*n._samplesPerXysFile*3,u=0,s=r.length;u<s;++u)t[o+u]=r[u];i.resolve()}),i.promise}var f=new i(0,0,u.TAI);return s.prototype.preload=function(t,n,r,a){var i=c(this,t,n),o=c(this,r,a),u=i/this._stepSizeDays-this._interpolationOrder/2|0;u<0&&(u=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var f=u/this._samplesPerXysFile|0,h=s/this._samplesPerXysFile|0,E=[],d=f;d<=h;++d)E.push(l(this,d));return e.all(E)},s.prototype.computeXysRadians=function(e,t,n){var i=c(this,e,t);if(!(i<0)){var o=i/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);s<0&&(s=0);var f=s+u;f>=this._totalSamples&&(f=this._totalSamples-1,s=f-u,s<0&&(s=0));var h=!1,E=this._samples;if(r(E[3*s])||(l(this,s/this._samplesPerXysFile|0),h=!0),r(E[3*f])||(l(this,f/this._samplesPerXysFile|0),h=!0),!h){r(n)?(n.x=0,n.y=0,n.s=0):n=new a(0,0,0);var d,_,m=i-s*this._stepSizeDays,p=this._work,y=this._denominators,T=this._coef,R=this._xTable;for(d=0;d<=u;++d)p[d]=m-R[d];for(d=0;d<=u;++d){for(T[d]=1,_=0;_<=u;++_)_!==d&&(T[d]*=p[_]);T[d]*=y[d];var A=3*(s+d);n.x+=T[d]*E[A++],n.y+=T[d]*E[A++],n.s+=T[d]*E[A]}return n}}}},s}),define("Core/Quaternion",["./Cartesian3","./Check","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math","./Matrix3"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(e,t,r,a){this.x=n(e,0),this.y=n(t,0),this.z=n(r,0),this.w=n(a,0)}var l=new e;c.fromAxisAngle=function(t,n,a){var i=n/2,o=Math.sin(i);l=e.normalize(t,l);var u=l.x*o,s=l.y*o,f=l.z*o,h=Math.cos(i);return r(a)?(a.x=u,a.y=s,a.z=f,a.w=h,a):new c(u,s,f,h)};var f=[1,2,0],h=new Array(3);c.fromRotationMatrix=function(e,t){var n,a,i,o,u,l=e[s.COLUMN0ROW0],E=e[s.COLUMN1ROW1],d=e[s.COLUMN2ROW2],_=l+E+d;if(_>0)n=Math.sqrt(_+1),u=.5*n,n=.5/n,a=(e[s.COLUMN1ROW2]-e[s.COLUMN2ROW1])*n,i=(e[s.COLUMN2ROW0]-e[s.COLUMN0ROW2])*n,o=(e[s.COLUMN0ROW1]-e[s.COLUMN1ROW0])*n;else{var m=f,p=0;E>l&&(p=1),d>l&&d>E&&(p=2);var y=m[p],T=m[y];n=Math.sqrt(e[s.getElementIndex(p,p)]-e[s.getElementIndex(y,y)]-e[s.getElementIndex(T,T)]+1);var R=h;R[p]=.5*n,n=.5/n,u=(e[s.getElementIndex(T,y)]-e[s.getElementIndex(y,T)])*n,R[y]=(e[s.getElementIndex(y,p)]+e[s.getElementIndex(p,y)])*n,R[T]=(e[s.getElementIndex(T,p)]+e[s.getElementIndex(p,T)])*n,a=-R[0],i=-R[1],o=-R[2]}return r(t)?(t.x=a,t.y=i,t.z=o,t.w=u,t):new c(a,i,o,u)};var E=new c;c.fromHeadingPitchRoll=function(t,n,r,a){var i=c.fromAxisAngle(e.UNIT_X,r,E),o=c.fromAxisAngle(e.UNIT_Y,-n,a);a=c.multiply(o,i,o);var u=c.fromAxisAngle(e.UNIT_Z,-t,E);return c.multiply(u,a,a)};var d=new e,_=new e,m=new c,p=new c,y=new c;c.packedLength=4,c.pack=function(e,t,r){return r=n(r,0),t[r++]=e.x,t[r++]=e.y,t[r++]=e.z,t[r]=e.w,t},c.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new c),a.x=e[t],a.y=e[t+1],a.z=e[t+2],a.w=e[t+3],a},c.packedInterpolationLength=3,c.convertPackedArrayForInterpolation=function(e,t,n,r){c.unpack(e,4*n,y),c.conjugate(y,y);for(var a=0,i=n-t+1;a<i;a++){var o=3*a;c.unpack(e,4*(t+a),m),c.multiply(m,y,m),m.w<0&&c.negate(m,m),c.computeAxis(m,d);var u=c.computeAngle(m);r[o]=d.x*u,r[o+1]=d.y*u,r[o+2]=d.z*u}},c.unpackInterpolationResult=function(t,n,a,i,o){r(o)||(o=new c),e.fromArray(t,0,_);var u=e.magnitude(_);return c.unpack(n,4*i,p),0===u?c.clone(c.IDENTITY,m):c.fromAxisAngle(_,u,m),c.multiply(m,p,o)},c.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new c(e.x,e.y,e.z,e.w)},c.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},c.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},c.magnitude=function(e){return Math.sqrt(c.magnitudeSquared(e))},c.normalize=function(e,t){var n=1/c.magnitude(e),r=e.x*n,a=e.y*n,i=e.z*n,o=e.w*n;return t.x=r,t.y=a,t.z=i,t.w=o,t},c.inverse=function(e,t){var n=c.magnitudeSquared(e);return t=c.conjugate(e,t),c.multiplyByScalar(t,1/n,t)},c.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},c.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},c.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},c.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},c.multiply=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=e.w,u=t.x,s=t.y,c=t.z,l=t.w,f=o*u+r*l+a*c-i*s,h=o*s-r*c+a*l+i*u,E=o*c+r*s-a*u+i*l,d=o*l-r*u-a*s-i*c;return n.x=f,n.y=h,n.z=E,n.w=d,n},c.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},c.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},c.computeAxis=function(e,t){var n=e.w;if(Math.abs(n-1)<u.EPSILON6)return t.x=t.y=t.z=0,t;var r=1/Math.sqrt(1-n*n);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},c.computeAngle=function(e){return Math.abs(e.w-1)<u.EPSILON6?0:2*Math.acos(e.w)};var T=new c;c.lerp=function(e,t,n,r){return T=c.multiplyByScalar(t,n,T),r=c.multiplyByScalar(e,1-n,r),c.add(T,r,r)};var R=new c,A=new c,S=new c;c.slerp=function(e,t,n,r){var a=c.dot(e,t),i=t;if(a<0&&(a=-a,i=R=c.negate(t,R)),1-a<u.EPSILON6)return c.lerp(e,i,n,r);var o=Math.acos(a);return A=c.multiplyByScalar(e,Math.sin((1-n)*o),A),S=c.multiplyByScalar(i,Math.sin(n*o),S),r=c.add(A,S,r),c.multiplyByScalar(r,1/Math.sin(o),r)},c.log=function(t,n){var r=u.acosClamped(t.w),a=0;return 0!==r&&(a=r/Math.sin(r)),e.multiplyByScalar(t,a,n)},c.exp=function(t,n){var r=e.magnitude(t),a=0;return 0!==r&&(a=Math.sin(r)/r),n.x=t.x*a,n.y=t.y*a,n.z=t.z*a,n.w=Math.cos(r),n};var v=new e,N=new e,O=new c,I=new c;c.computeInnerQuadrangle=function(t,n,r,a){var i=c.conjugate(n,O);c.multiply(i,r,I);var o=c.log(I,v);c.multiply(i,t,I);var u=c.log(I,N);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),c.exp(o,O),c.multiply(n,O,a)},c.squad=function(e,t,n,r,a,i){var o=c.slerp(e,t,a,O),u=c.slerp(n,r,a,I);return c.slerp(o,u,2*a*(1-a),i)};for(var M=new c,g=1.9011074535173003,x=i.supportsTypedArrays()?new Float32Array(8):[],w=i.supportsTypedArrays()?new Float32Array(8):[],C=i.supportsTypedArrays()?new Float32Array(8):[],P=i.supportsTypedArrays()?new Float32Array(8):[],U=0;U<7;++U){var D=U+1,L=2*D+1;x[U]=1/(D*L),w[U]=D/L}return x[7]=g/136,w[7]=8*g/17,c.fastSlerp=function(e,t,n,r){var a,i=c.dot(e,t);i>=0?a=1:(a=-1,i=-i);for(var o=i-1,u=1-n,s=n*n,l=u*u,f=7;f>=0;--f)C[f]=(x[f]*s-w[f])*o,P[f]=(x[f]*l-w[f])*o;var h=a*n*(1+C[0]*(1+C[1]*(1+C[2]*(1+C[3]*(1+C[4]*(1+C[5]*(1+C[6]*(1+C[7])))))))),E=u*(1+P[0]*(1+P[1]*(1+P[2]*(1+P[3]*(1+P[4]*(1+P[5]*(1+P[6]*(1+P[7])))))))),d=c.multiplyByScalar(e,E,M);return c.multiplyByScalar(t,h,r),c.add(d,r,r)},c.fastSquad=function(e,t,n,r,a,i){var o=c.fastSlerp(e,t,a,O),u=c.fastSlerp(n,r,a,I);return c.fastSlerp(o,u,2*a*(1-a),i)},c.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},c.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n},c.ZERO=o(new c(0,0,0,0)),c.IDENTITY=o(new c(0,0,0,1)),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.x+", "+this.y+", "+this.z+", "+this.w+")"},c}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./Check","./defaultValue","./defined","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./HeadingPitchRoll","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,E,d,_,m,p,y,T,R){"use strict";var A={},S=new n,v=new n,N=new n;A.eastNorthUpToFixedFrame=function(e,t,r){if(m.equalsEpsilon(e.x,0,m.EPSILON14)&&m.equalsEpsilon(e.y,0,m.EPSILON14)){var a=m.sign(e.z);return u(r)?(r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=-a,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=a,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(0,-a,0,e.x,1,0,0,e.y,0,0,a,e.z,0,0,0,1)}var i=S,s=v,c=N;return t=o(t,f.WGS84),t.geodeticSurfaceNormal(e,i),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(i,s,c),u(r)?(r[0]=s.x,r[1]=s.y,r[2]=s.z,r[3]=0,r[4]=c.x,r[5]=c.y,r[6]=c.z,r[7]=0,r[8]=i.x,r[9]=i.y,r[10]=i.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(s.x,c.x,i.x,e.x,s.y,c.y,i.y,e.y,s.z,c.z,i.z,e.z,0,0,0,1)};var O=new n,I=new n,M=new n;A.northEastDownToFixedFrame=function(e,t,r){if(m.equalsEpsilon(e.x,0,m.EPSILON14)&&m.equalsEpsilon(e.y,0,m.EPSILON14)){var a=m.sign(e.z);return u(r)?(r[0]=-a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=-a,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(-a,0,0,e.x,0,1,0,e.y,0,0,-a,e.z,0,0,0,1)}var i=O,s=I,c=M;return t=o(t,f.WGS84),t.geodeticSurfaceNormal(e,i),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(i,s,c),u(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=s.x,r[5]=s.y,r[6]=s.z,r[7]=0,r[8]=-i.x,r[9]=-i.y,r[10]=-i.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(c.x,s.x,-i.x,e.x,c.y,s.y,-i.y,e.y,c.z,s.z,-i.z,e.z,0,0,0,1)},A.northUpEastToFixedFrame=function(e,t,r){if(m.equalsEpsilon(e.x,0,m.EPSILON14)&&m.equalsEpsilon(e.y,0,m.EPSILON14)){var a=m.sign(e.z);return u(r)?(r[0]=-a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=a,r[7]=0,r[8]=0,r[9]=1,r[10]=0,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(-a,0,0,e.x,0,0,1,e.y,0,a,0,e.z,0,0,0,1)}var i=S,s=v,c=N;return t=o(t,f.WGS84),t.geodeticSurfaceNormal(e,i),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(i,s,c),u(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=i.x,r[5]=i.y,r[6]=i.z,r[7]=0,r[8]=s.x,r[9]=s.y,r[10]=s.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(c.x,i.x,s.x,e.x,c.y,i.y,s.y,e.y,c.z,i.z,s.z,e.z,0,0,0,1)},A.northWestUpToFixedFrame=function(e,t,r){if(m.equalsEpsilon(e.x,0,m.EPSILON14)&&m.equalsEpsilon(e.y,0,m.EPSILON14)){var a=m.sign(e.z);return u(r)?(r[0]=-a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=a,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(-a,0,0,e.x,0,-1,0,e.y,0,0,a,e.z,0,0,0,1)}var i=S,s=v,c=N;return t=o(t,f.WGS84),t.geodeticSurfaceNormal(e,i),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(i,s,c),u(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=-s.x,r[5]=-s.y,r[6]=-s.z,r[7]=0,r[8]=i.x,r[9]=i.y,r[10]=i.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(c.x,-s.x,i.x,e.x,c.y,-s.y,i.y,e.y,c.z,-s.z,i.z,e.z,0,0,0,1)};var g=new T,x=new n(1,1,1),w=new y;A.headingPitchRollToFixedFrame=function(e,t,r,a){i.typeOf.object("headingPitchRoll",t);var o=t.heading,u=t.pitch,s=t.roll,c=T.fromHeadingPitchRoll(o,u,s,g),l=y.fromTranslationQuaternionRotationScale(n.ZERO,c,x,w);return a=A.eastNorthUpToFixedFrame(e,r,a),y.multiply(a,l,a)};var C=new y,P=new p;A.headingPitchRollQuaternion=function(e,t,n,r){i.typeOf.object("headingPitchRoll",t);var a=A.headingPitchRollToFixedFrame(e,t,n,C),o=y.getRotation(a,P);return T.fromRotationMatrix(o,r)};var U=24110.54841,D=8640184.812866,L=.093104,F=-62e-7,z=1.1772758384668e-19,B=72921158553e-15,b=m.TWO_PI/86400,G=new _;A.computeTemeToPseudoFixedMatrix=function(e,t){G=_.addSeconds(e,-_.computeTaiMinusUtc(e),G);var n,r=G.dayNumber,a=G.secondsOfDay,i=r-2451545;n=a>=43200?(i+.5)/R.DAYS_PER_JULIAN_CENTURY:(i-.5)/R.DAYS_PER_JULIAN_CENTURY;var o=U+n*(D+n*(L+n*F)),s=o*b%m.TWO_PI,c=B+z*(r-2451545.5),l=(a+.5*R.SECONDS_PER_DAY)%R.SECONDS_PER_DAY,f=s+c*l,h=Math.cos(f),E=Math.sin(f);return u(t)?(t[0]=h,t[1]=-E,t[2]=0,t[3]=E,t[4]=h,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new p(h,E,0,-E,h,0,0,0,1)},A.iau2006XysData=new E,A.earthOrientationParameters=c.NONE;var q=32.184,W=2451545;A.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+q,a=t.stop.dayNumber,i=t.stop.secondsOfDay+q,o=A.iau2006XysData.preload(n,r,a,i),u=A.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},A.computeIcrfToFixedMatrix=function(e,t){u(t)||(t=new p);var n=A.computeFixedToIcrfMatrix(e,t);if(u(n))return p.transpose(n,t)};var X=new d(0,0,0),H=new l(0,0,0,0,0,0),V=new p,Y=new p;A.computeFixedToIcrfMatrix=function(e,t){u(t)||(t=new p);var n=A.earthOrientationParameters.compute(e,H);if(u(n)){var r=e.dayNumber,a=e.secondsOfDay+q,i=A.iau2006XysData.computeXysRadians(r,a,X);if(u(i)){var o=i.x+n.xPoleOffset,s=i.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-o*o-s*s)),l=V;l[0]=1-c*o*o,l[3]=-c*o*s,l[6]=o,l[1]=-c*o*s,l[4]=1-c*s*s,l[7]=s,l[2]=-o,l[5]=-s,l[8]=1-c*(o*o+s*s);var f=p.fromRotationZ(-i.s,Y),h=p.multiply(l,f,V),E=e.dayNumber,d=e.secondsOfDay-_.computeTaiMinusUtc(e)+n.ut1MinusUtc,y=E-2451545,T=d/R.SECONDS_PER_DAY,S=.779057273264+T+.00273781191135448*(y+T);S=S%1*m.TWO_PI;var v=p.fromRotationZ(S,Y),N=p.multiply(h,v,V),O=Math.cos(n.xPoleWander),I=Math.cos(n.yPoleWander),M=Math.sin(n.xPoleWander),g=Math.sin(n.yPoleWander),x=r-W+a/R.SECONDS_PER_DAY;x/=36525;var w=-47e-6*x*m.RADIANS_PER_DEGREE/3600,C=Math.cos(w),P=Math.sin(w),U=Y;return U[0]=O*C,U[1]=O*P,U[2]=M,U[3]=-I*P+g*M*C,U[4]=I*C+g*M*P,U[5]=-g*O,U[6]=-g*P-I*M*C,U[7]=g*C-I*M*P,U[8]=I*O,p.multiply(N,U,t)}}};var Z=new r;A.pointToWindowCoordinates=function(e,t,n,r){return r=A.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},A.pointToGLWindowCoordinates=function(e,n,a,i){u(i)||(i=new t);var o=Z;return y.multiplyByVector(e,r.fromElements(a.x,a.y,a.z,1,o),o),r.multiplyByScalar(o,1/o.w,o),y.multiplyByVector(n,o,o),t.fromCartesian4(o,i)};var k=new n,j=new n,K=new n;A.rotationMatrixFromPositionVelocity=function(e,t,r,a){var i=o(r,f.WGS84).geodeticSurfaceNormal(e,k),s=n.cross(t,i,j);n.equalsEpsilon(s,n.ZERO,m.EPSILON6)&&(s=n.clone(n.UNIT_X,s));var c=n.cross(s,t,K);return n.cross(t,c,s),n.negate(s,s),u(a)||(a=new p),a[0]=t.x,a[1]=t.y,a[2]=t.z,a[3]=s.x,a[4]=s.y,a[5]=s.z,a[6]=c.x,a[7]=c.y,a[8]=c.z,a};var J=new a,Q=new n,$=new n,ee=new r,te=new r,ne=new r,re=new r,ae=new r,ie=new y,oe=new y;A.basisTo2D=function(e,t,a){var i=e.ellipsoid,o=y.getColumn(t,3,ee),u=i.cartesianToCartographic(o,J),s=A.eastNorthUpToFixedFrame(o,i,ie),c=y.inverseTransformation(s,oe),l=e.project(u,Q),f=te;f.x=l.z,f.y=l.x,f.z=l.y,f.w=1;var h=y.getColumn(t,0,$),E=n.magnitude(h),d=y.multiplyByVector(c,h,ne);r.fromElements(d.z,d.x,d.y,0,d);var _=y.getColumn(t,1,$),m=n.magnitude(_),p=y.multiplyByVector(c,_,re);r.fromElements(p.z,p.x,p.y,0,p);var T=y.getColumn(t,2,$),R=n.magnitude(T),S=ae;return n.cross(d,p,S),n.normalize(S,S),n.cross(p,S,d),n.normalize(d,d),n.cross(S,d,p),n.normalize(p,p),n.multiplyByScalar(d,E,d),n.multiplyByScalar(p,m,p),n.multiplyByScalar(S,R,S),y.setColumn(a,0,d,a),y.setColumn(a,1,p,a),y.setColumn(a,2,S,a),y.setColumn(a,3,f,a),a};var ue=new y(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);return A.wgs84To2DModelMatrix=function(e,t,n){var r=e.ellipsoid,a=A.eastNorthUpToFixedFrame(t,r,ie),i=y.inverseTransformation(a,oe),o=r.cartesianToCartographic(t,J),u=e.project(o,Q),s=te;s.x=u.z,s.y=u.x,s.z=u.y,s.w=1;var c=y.fromTranslation(s,ie);return y.multiply(ue,i,n),y.multiply(c,n,n),n},A}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,E){"use strict";function d(e,t){t=a(t,s.WGS84),e=t.scaleToGeodeticSurface(e);var r=E.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=n.fromCartesian4(l.getColumn(r,0,_)),this._yAxis=n.fromCartesian4(l.getColumn(r,1,_));var i=n.fromCartesian4(l.getColumn(r,2,_));this._plane=f.fromPointNormal(e,i)}var _=new r;o(d.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var m=new e;d.fromPoints=function(t,n){var r=e.fromPoints(t,m);return new d(r.center,n)};var p=new h,y=new n;d.prototype.projectPointOntoPlane=function(e,r){var a=p;a.origin=e,n.normalize(e,a.direction);var o=c.rayPlane(a,this._plane,y);if(i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,y)),i(o)){var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return i(r)?(r.x=s,r.y=l,r):new t(s,l)}},d.prototype.projectPointsOntoPlane=function(e,t){i(t)||(t=[]);for(var n=0,r=e.length,a=0;a<r;a++){var o=this.projectPointOntoPlane(e[a],t[n]);i(o)&&(t[n]=o,n++)}return t.length=n,t},d.prototype.projectPointToNearestOnPlane=function(e,r){i(r)||(r=new t);var a=p;a.origin=e,n.clone(this._plane.normal,a.direction);var o=c.rayPlane(a,this._plane,y);i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,y));var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return r.x=s,r.y=l,r},d.prototype.projectPointsToNearestOnPlane=function(e,t){i(t)||(t=[]);var n=e.length;t.length=n;for(var r=0;r<n;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var T=new n;return d.prototype.projectPointsOntoEllipsoid=function(e,t){var r=e.length;i(t)?t.length=r:t=new Array(r);for(var a=this._ellipsoid,o=this._origin,u=this._xAxis,s=this._yAxis,c=T,l=0;l<r;++l){var f=e[l];n.multiplyByScalar(u,f.x,c),i(t[l])||(t[l]=new n);var h=n.add(o,c,t[l]);n.multiplyByScalar(s,f.y,c),n.add(h,c,h),a.scaleToGeocentricSurface(h,h)}return t},d}),define("ThirdParty/earcut-2.1.1",[],function(){"use strict";function e(e,n,a){a=a||2;var i=n&&n.length,o=i?n[0]*a:e.length,u=t(e,0,o,a,!0),c=[];if(!u)return c;var l,f,h,E,d,_,m;if(i&&(u=s(e,n,u,a)),e.length>80*a){l=h=e[0],f=E=e[1];for(var p=a;p<o;p+=a)d=e[p],_=e[p+1],d<l&&(l=d),_<f&&(f=_),d>h&&(h=d),_>E&&(E=_);m=Math.max(h-l,E-f)}return r(u,c,a,l,f,m),c}function t(e,t,n,r,a){var i,o;if(a===g(e,t,n,r)>0)for(i=t;i<n;i+=r)o=O(i,e[i],e[i+1],o);else for(i=n-r;i>=t;i-=r)o=O(i,e[i],e[i+1],o);return o&&T(o,o.next)&&(I(o),o=o.next),o}function n(e,t){if(!e)return e;t||(t=e);var n,r=e;do if(n=!1,r.steiner||!T(r,r.next)&&0!==y(r.prev,r,r.next))r=r.next;else{if(I(r),r=t=r.prev,r===r.next)return null;n=!0}while(n||r!==t);return t}function r(e,t,s,c,l,f,E){if(e){!E&&f&&h(e,c,l,f);for(var d,_,m=e;e.prev!==e.next;)if(d=e.prev,_=e.next,f?i(e,c,l,f):a(e))t.push(d.i/s),t.push(e.i/s),t.push(_.i/s),I(e),e=_.next,m=_.next;else if(e=_,e===m){E?1===E?(e=o(e,t,s),r(e,t,s,c,l,f,2)):2===E&&u(e,t,s,c,l,f):r(n(e),t,s,c,l,f,1);break}}}function a(e){var t=e.prev,n=e,r=e.next;if(y(t,n,r)>=0)return!1;for(var a=e.next.next;a!==e.prev;){if(m(t.x,t.y,n.x,n.y,r.x,r.y,a.x,a.y)&&y(a.prev,a,a.next)>=0)return!1;a=a.next}return!0}function i(e,t,n,r){var a=e.prev,i=e,o=e.next;if(y(a,i,o)>=0)return!1;for(var u=a.x<i.x?a.x<o.x?a.x:o.x:i.x<o.x?i.x:o.x,s=a.y<i.y?a.y<o.y?a.y:o.y:i.y<o.y?i.y:o.y,c=a.x>i.x?a.x>o.x?a.x:o.x:i.x>o.x?i.x:o.x,l=a.y>i.y?a.y>o.y?a.y:o.y:i.y>o.y?i.y:o.y,f=d(u,s,t,n,r),h=d(c,l,t,n,r),E=e.nextZ;E&&E.z<=h;){if(E!==e.prev&&E!==e.next&&m(a.x,a.y,i.x,i.y,o.x,o.y,E.x,E.y)&&y(E.prev,E,E.next)>=0)return!1;E=E.nextZ}for(E=e.prevZ;E&&E.z>=f;){if(E!==e.prev&&E!==e.next&&m(a.x,a.y,i.x,i.y,o.x,o.y,E.x,E.y)&&y(E.prev,E,E.next)>=0)return!1;E=E.prevZ}return!0}function o(e,t,n){var r=e;do{var a=r.prev,i=r.next.next;!T(a,i)&&R(a,r,r.next,i)&&S(a,i)&&S(i,a)&&(t.push(a.i/n),t.push(r.i/n),t.push(i.i/n),I(r),I(r.next),r=e=i),r=r.next}while(r!==e);return r}function u(e,t,a,i,o,u){var s=e;do{for(var c=s.next.next;c!==s.prev;){if(s.i!==c.i&&p(s,c)){var l=N(s,c);return s=n(s,s.next),l=n(l,l.next),r(s,t,a,i,o,u),void r(l,t,a,i,o,u)}c=c.next}s=s.next}while(s!==e)}function s(e,r,a,i){var o,u,s,f,h,E=[];for(o=0,u=r.length;o<u;o++)s=r[o]*i,f=o<u-1?r[o+1]*i:e.length,h=t(e,s,f,i,!1),h===h.next&&(h.steiner=!0),E.push(_(h));for(E.sort(c),o=0;o<E.length;o++)l(E[o],a),a=n(a,a.next);return a}function c(e,t){return e.x-t.x}function l(e,t){if(t=f(e,t)){var r=N(t,e);n(r,r.next)}}function f(e,t){var n,r=t,a=e.x,i=e.y,o=-(1/0);do{if(i<=r.y&&i>=r.next.y){var u=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(u<=a&&u>o){if(o=u,u===a){if(i===r.y)return r;if(i===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(a===o)return n.prev;var s,c=n,l=n.x,f=n.y,h=1/0;for(r=n.next;r!==c;)a>=r.x&&r.x>=l&&m(i<f?a:o,i,l,f,i<f?o:a,i,r.x,r.y)&&(s=Math.abs(i-r.y)/(a-r.x),(s<h||s===h&&r.x>n.x)&&S(r,e)&&(n=r,h=s)),r=r.next;return n}function h(e,t,n,r){var a=e;do null===a.z&&(a.z=d(a.x,a.y,t,n,r)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next;while(a!==e);a.prevZ.nextZ=null,a.prevZ=null,E(a)}function E(e){var t,n,r,a,i,o,u,s,c=1;do{for(n=e,e=null,i=null,o=0;n;){for(o++,r=n,u=0,t=0;t<c&&(u++,r=r.nextZ,r);t++);for(s=c;u>0||s>0&&r;)0===u?(a=r,r=r.nextZ,s--):0!==s&&r?n.z<=r.z?(a=n,n=n.nextZ,u--):(a=r,r=r.nextZ,s--):(a=n,n=n.nextZ,u--),i?i.nextZ=a:e=a,a.prevZ=i,i=a;n=r}i.nextZ=null,c*=2}while(o>1);return e}function d(e,t,n,r,a){return e=32767*(e-n)/a,t=32767*(t-r)/a,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function _(e){var t=e,n=e;do t.x<n.x&&(n=t),t=t.next;while(t!==e);return n}function m(e,t,n,r,a,i,o,u){return(a-o)*(t-u)-(e-o)*(i-u)>=0&&(e-o)*(r-u)-(n-o)*(t-u)>=0&&(n-o)*(i-u)-(a-o)*(r-u)>=0}function p(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!A(e,t)&&S(e,t)&&S(t,e)&&v(e,t)}function y(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function T(e,t){return e.x===t.x&&e.y===t.y}function R(e,t,n,r){return!!(T(e,t)&&T(n,r)||T(e,r)&&T(n,t))||y(e,t,n)>0!=y(e,t,r)>0&&y(n,r,e)>0!=y(n,r,t)>0}function A(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&R(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function S(e,t){return y(e.prev,e,e.next)<0?y(e,t,e.next)>=0&&y(e,e.prev,t)>=0:y(e,t,e.prev)<0||y(e,e.next,t)<0}function v(e,t){var n=e,r=!1,a=(e.x+t.x)/2,i=(e.y+t.y)/2;do n.y>i!=n.next.y>i&&a<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function N(e,t){var n=new M(e.i,e.x,e.y),r=new M(t.i,t.x,t.y),a=e.next,i=t.prev;return e.next=t,t.prev=e,n.next=a,a.prev=n,r.next=n,n.prev=r,i.next=r,r.prev=i,r}function O(e,t,n,r){var a=new M(e,t,n);return r?(a.next=r.next,a.prev=r,r.next.prev=a,r.next=a):(a.prev=a,a.next=a),a}function I(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function M(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function g(e,t,n,r){for(var a=0,i=t,o=n-r;i<n;i+=r)a+=(e[o]-e[i])*(e[i+1]+e[o+1]),o=i;return a}return e.deviation=function(e,t,n,r){var a=t&&t.length,i=a?t[0]*n:e.length,o=Math.abs(g(e,0,i,n));if(a)for(var u=0,s=t.length;u<s;u++){var c=t[u]*n,l=u<s-1?t[u+1]*n:e.length;o-=Math.abs(g(e,c,l,n))}var f=0;for(u=0;u<r.length;u+=3){var h=r[u]*n,E=r[u+1]*n,d=r[u+2]*n;f+=Math.abs((e[h]-e[d])*(e[E+1]-e[h+1])-(e[h]-e[E])*(e[d+1]-e[h+1]))}return 0===o&&0===f?0:Math.abs((f-o)/o)},e.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,a=0;a<e.length;a++){for(var i=0;i<e[a].length;i++)for(var o=0;o<t;o++)n.vertices.push(e[a][i][o]);a>0&&(r+=e[a-1].length,n.holes.push(r))}return n},e}),define("Core/WindingOrder",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={CLOCKWISE:t.CW,COUNTER_CLOCKWISE:t.CCW,validate:function(e){return e===n.CLOCKWISE||e===n.COUNTER_CLOCKWISE}};return e(n)}),define("Core/PolygonPipeline",["../ThirdParty/earcut-2.1.1","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./Math","./PrimitiveType","./WindingOrder"],function(e,t,n,r,a,i,o,u,s,c,l,f,h){"use strict";var E=new n,d=new n,_={};_.computeArea2D=function(e){for(var t=e.length,n=0,r=t-1,a=0;a<t;r=a++){var i=e[r],o=e[a];n+=i.x*o.y-o.x*i.y}return.5*n},_.computeWindingOrder2D=function(e){var t=_.computeArea2D(e);return t>0?h.COUNTER_CLOCKWISE:h.CLOCKWISE},_.triangulate=function(n,r){var a=t.packArray(n);return e(a,r,2)};var m=new n,p=new n,y=new n,T=new n,R=new n,A=new n,S=new n;return _.computeSubdivision=function(e,t,o,u){u=a(u,l.RADIANS_PER_DEGREE);var h,E=o.slice(0),d=t.length,_=new Array(3*d),v=0;for(h=0;h<d;h++){var N=t[h];_[v++]=N.x,_[v++]=N.y,_[v++]=N.z}for(var O=[],I={},M=e.maximumRadius,g=l.chordLength(u,M),x=g*g;E.length>0;){var w,C,P=E.pop(),U=E.pop(),D=E.pop(),L=n.fromArray(_,3*D,m),F=n.fromArray(_,3*U,p),z=n.fromArray(_,3*P,y),B=n.multiplyByScalar(n.normalize(L,T),M,T),b=n.multiplyByScalar(n.normalize(F,R),M,R),G=n.multiplyByScalar(n.normalize(z,A),M,A),q=n.magnitudeSquared(n.subtract(B,b,S)),W=n.magnitudeSquared(n.subtract(b,G,S)),X=n.magnitudeSquared(n.subtract(G,B,S)),H=Math.max(q,W,X);H>x?q===H?(w=Math.min(D,U)+" "+Math.max(D,U),h=I[w],i(h)||(C=n.add(L,F,S),n.multiplyByScalar(C,.5,C),_.push(C.x,C.y,C.z),h=_.length/3-1,I[w]=h),E.push(D,h,P),E.push(h,U,P)):W===H?(w=Math.min(U,P)+" "+Math.max(U,P),h=I[w],i(h)||(C=n.add(F,z,S),n.multiplyByScalar(C,.5,C),_.push(C.x,C.y,C.z),h=_.length/3-1,I[w]=h),E.push(U,h,D),E.push(h,P,D)):X===H&&(w=Math.min(P,D)+" "+Math.max(P,D),h=I[w],i(h)||(C=n.add(z,L,S),n.multiplyByScalar(C,.5,C),_.push(C.x,C.y,C.z),h=_.length/3-1,I[w]=h),E.push(P,h,U),E.push(h,D,U)):(O.push(D),O.push(U),O.push(P))}return new s({attributes:{position:new c({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:_})},indices:O,primitiveType:f.TRIANGLES})},_.scaleToGeodeticHeight=function(e,t,r,o){r=a(r,u.WGS84);var s=E,c=d;if(t=a(t,0),o=a(o,!0),i(e))for(var l=e.length,f=0;f<l;f+=3)n.fromArray(e,f,c),o&&(c=r.scaleToGeodeticSurface(c,c)),0!==t&&(s=r.geodeticSurfaceNormal(c,s),n.multiplyByScalar(s,t,s),n.add(c,s,c)),e[f]=c.x,e[f+1]=c.y,e[f+2]=c.z;return e},_}),define("Core/EllipsoidGeodesic",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){var t=e._uSquared,n=e._ellipsoid.maximumRadius,r=e._ellipsoid.minimumRadius,a=(n-r)/n,i=Math.cos(e._startHeading),o=Math.sin(e._startHeading),u=(1-a)*Math.tan(e._start.latitude),s=1/Math.sqrt(1+u*u),c=s*u,l=Math.atan2(u,i),f=s*o,h=f*f,E=1-h,d=Math.sqrt(E),_=t/4,m=_*_,p=m*_,y=m*m,T=1+_-3*m/4+5*p/4-175*y/64,R=1-_+15*m/8-35*p/8,A=1-3*_+35*m/4,S=1-5*_,v=T*l-R*Math.sin(2*l)*_/2-A*Math.sin(4*l)*m/16-S*Math.sin(6*l)*p/48-5*Math.sin(8*l)*y/512,N=e._constants;N.a=n,N.b=r,N.f=a,N.cosineHeading=i,N.sineHeading=o,N.tanU=u,N.cosineU=s,N.sineU=c,N.sigma=l,N.sineAlpha=f,N.sineSquaredAlpha=h,N.cosineSquaredAlpha=E,N.cosineAlpha=d,N.u2Over4=_,N.u4Over16=m,N.u6Over64=p,N.u8Over256=y,N.a0=T,N.a1=R,N.a2=A,N.a3=S,N.distanceRatio=v}function c(e,t){return e*t*(4+e*(4-3*t))/16}function l(e,t,n,r,a,i,o){var u=c(e,n);return(1-u)*e*t*(r+u*a*(o+u*i*(2*o*o-1)))}function f(e,t,n,r,a,i,o){var s,c,f,h,E,d=(t-n)/t,_=i-r,m=Math.atan((1-d)*Math.tan(a)),p=Math.atan((1-d)*Math.tan(o)),y=Math.cos(m),T=Math.sin(m),R=Math.cos(p),A=Math.sin(p),S=y*R,v=y*A,N=T*A,O=T*R,I=_,M=u.TWO_PI,g=Math.cos(I),x=Math.sin(I);do{g=Math.cos(I),x=Math.sin(I);var w=v-O*g;f=Math.sqrt(R*R*x*x+w*w),c=N+S*g,s=Math.atan2(f,c);var C;0===f?(C=0,h=1):(C=S*x/f,h=1-C*C),M=I,E=c-2*N/h,isNaN(E)&&(E=0),I=_+l(d,C,h,s,f,c,E)}while(Math.abs(I-M)>u.EPSILON12);var P=h*(t*t-n*n)/(n*n),U=1+P*(4096+P*(P*(320-175*P)-768))/16384,D=P*(256+P*(P*(74-47*P)-128))/1024,L=E*E,F=D*f*(E+D*(c*(2*L-1)-D*E*(4*f*f-3)*(4*L-3)/6)/4),z=n*U*(s-F),B=Math.atan2(R*x,v-O*g),b=Math.atan2(y*x,v*g-O);e._distance=z,e._startHeading=B,e._endHeading=b,e._uSquared=P}function h(n,r,a,i){e.normalize(i.cartographicToCartesian(r,_),d),e.normalize(i.cartographicToCartesian(a,_),_);f(n,i.maximumRadius,i.minimumRadius,r.longitude,r.latitude,a.longitude,a.latitude),n._start=t.clone(r,n._start),n._end=t.clone(a,n._end),n._start.height=0,n._end.height=0,s(n)}function E(e,a,i){var u=n(i,o.WGS84);this._ellipsoid=u,this._start=new t,this._end=new t,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,r(e)&&r(a)&&h(this,e,a,u)}var d=new e,_=new e;return a(E.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return this._startHeading}},endHeading:{get:function(){return this._endHeading}}}),E.prototype.setEndPoints=function(e,t){h(this,e,t,this._ellipsoid)},E.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},E.prototype.interpolateUsingSurfaceDistance=function(e,n){var a=this._constants,i=a.distanceRatio+e/a.b,o=Math.cos(2*i),u=Math.cos(4*i),s=Math.cos(6*i),c=Math.sin(2*i),f=Math.sin(4*i),h=Math.sin(6*i),E=Math.sin(8*i),d=i*i,_=i*d,m=a.u8Over256,p=a.u2Over4,y=a.u6Over64,T=a.u4Over16,R=2*_*m*o/3+i*(1-p+7*T/4-15*y/4+579*m/64-(T-15*y/4+187*m/16)*o-(5*y/4-115*m/16)*u-29*m*s/16)+(p/2-T+71*y/32-85*m/16)*c+(5*T/16-5*y/4+383*m/96)*f-d*((y-11*m/2)*c+5*m*f/2)+(29*y/96-29*m/16)*h+539*m*E/1536,A=Math.asin(Math.sin(R)*a.cosineAlpha),S=Math.atan(a.a/a.b*Math.tan(A));R-=a.sigma;var v=Math.cos(2*a.sigma+R),N=Math.sin(R),O=Math.cos(R),I=a.cosineU*O,M=a.sineU*N,g=Math.atan2(N*a.sineHeading,I-M*a.cosineHeading),x=g-l(a.f,a.sineAlpha,a.cosineSquaredAlpha,R,N,O,v);return r(n)?(n.longitude=this._start.longitude+x,n.latitude=S,n.height=0,n):new t(this._start.longitude+x,S,0)},E}),define("Core/isArray",["./defined"],function(e){"use strict";var t=Array.isArray;return e(t)||(t=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),t}),define("Core/PolylinePipeline",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidGeodesic","./IntersectionTests","./isArray","./Math","./Matrix4","./Plane"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(e,t,n){var r=N;r.length=e;var a;if(t===n){for(a=0;a<e;a++)r[a]=t;return r; +}var i=n-t,o=i/e;for(a=0;a<e;a++){var u=t+a*o;r[a]=u}return r}function E(t,n,r,a,i,o,u,s){var c=a.scaleToGeodeticSurface(t,g),l=a.scaleToGeodeticSurface(n,x),f=d.numberOfPoints(t,n,r),E=a.cartesianToCartographic(c,O),_=a.cartesianToCartographic(l,I),m=h(f,i,o);w.setEndPoints(E,_);var p=w.surfaceDistance/f,y=s;E.height=i;var T=a.cartographicToCartesian(E,M);e.pack(T,u,y),y+=3;for(var R=1;R<f;R++){var A=w.interpolateUsingSurfaceDistance(R*p,I);A.height=m[R],T=a.cartographicToCartesian(A,M),e.pack(T,u,y),y+=3}return y}var d={};d.numberOfPoints=function(t,n,r){var a=e.distance(t,n);return Math.ceil(a/r)};var _=new t;d.extractHeights=function(e,t){for(var n=e.length,r=new Array(n),a=0;a<n;a++){var i=e[a];r[a]=t.cartesianToCartographic(i,_).height}return r};var m=new l,p=new e,y=new e,T=new f(e.ZERO,0),R=new e,A=new f(e.ZERO,0),S=new e,v=new e,N=[],O=new t,I=new t,M=new e,g=new e,x=new e,w=new o;return d.wrapLongitude=function(t,a){var i=[],o=[];if(r(t)&&t.length>0){a=n(a,l.IDENTITY);var s=l.inverseTransformation(a,m),c=l.multiplyByPoint(s,e.ZERO,p),h=l.multiplyByPointAsVector(s,e.UNIT_Y,y),E=f.fromPointNormal(c,h,T),d=l.multiplyByPointAsVector(s,e.UNIT_X,R),_=f.fromPointNormal(c,d,A),N=1;i.push(e.clone(t[0]));for(var O=i[0],I=t.length,M=1;M<I;++M){var g=t[M];if(f.getPointDistance(_,O)<0||f.getPointDistance(_,g)<0){var x=u.lineSegmentPlane(O,g,E,S);if(r(x)){var w=e.multiplyByScalar(h,5e-9,v);f.getPointDistance(E,O)<0&&e.negate(w,w),i.push(e.add(x,w,new e)),o.push(N+1),e.negate(w,w),i.push(e.add(x,w,new e)),N=1}}i.push(e.clone(t[M])),N++,O=g}o.push(N)}return{positions:i,lengths:o}},d.generateArc=function(t){r(t)||(t={});var a=t.positions,o=a.length,u=n(t.ellipsoid,i.WGS84),l=n(t.height,0),f=s(l);if(o<1)return[];if(1===o){var h=u.scaleToGeodeticSurface(a[0],g);if(l=f?l[0]:l,0!==l){var _=u.geodeticSurfaceNormal(h,M);e.multiplyByScalar(_,l,_),e.add(h,_,h)}return[h.x,h.y,h.z]}var m=t.minDistance;if(!r(m)){var p=n(t.granularity,c.RADIANS_PER_DEGREE);m=c.chordLength(p,u.maximumRadius)}var y,T=0;for(y=0;y<o-1;y++)T+=d.numberOfPoints(a[y],a[y+1],m);var R=3*(T+1),A=new Array(R),S=0;for(y=0;y<o-1;y++){var v=a[y],I=a[y+1],x=f?l[y]:l,w=f?l[y+1]:l;S=E(v,I,m,u,x,w,A,S)}N.length=0;var C=a[o-1],P=u.cartesianToCartographic(C,O);P.height=f?l[o-1]:l;var U=u.cartographicToCartesian(P,M);return e.pack(U,A,R-3),A},d.generateCartesianArc=function(t){for(var n=d.generateArc(t),r=n.length/3,a=new Array(r),i=0;i<r;i++)a[i]=e.unpack(n,3*i);return a},d}),define("Core/WallGeometryLibrary",["./Cartographic","./defined","./EllipsoidTangentPlane","./Math","./PolygonPipeline","./PolylinePipeline","./WindingOrder"],function(e,t,n,r,a,i,o){"use strict";function u(e,t){return r.equalsEpsilon(e.latitude,t.latitude,r.EPSILON14)&&r.equalsEpsilon(e.longitude,t.longitude,r.EPSILON14)}function s(n,r,a,i){var o=r.length;if(!(o<2)){var s=t(i),c=t(a),h=!0,E=new Array(o),d=new Array(o),_=new Array(o),m=r[0];E[0]=m;var p=n.cartesianToCartographic(m,l);c&&(p.height=a[0]),h=h&&p.height<=0,d[0]=p.height,s?_[0]=i[0]:_[0]=0;for(var y=1,T=1;T<o;++T){var R=r[T],A=n.cartesianToCartographic(R,f);c&&(A.height=a[T]),h=h&&A.height<=0,u(p,A)?p.height<A.height&&(d[y-1]=A.height):(E[y]=R,d[y]=A.height,s?_[y]=i[T]:_[y]=0,e.clone(A,p),++y)}if(!(h||y<2))return E.length=y,d.length=y,_.length=y,{positions:E,topHeights:d,bottomHeights:_}}}var c={},l=new e,f=new e,h=new Array(2),E=new Array(2),d={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};return c.computePositions=function(e,u,c,l,f,_){var m=s(e,u,c,l);if(t(m)){if(u=m.positions,c=m.topHeights,l=m.bottomHeights,u.length>=3){var p=n.fromPoints(u,e),y=p.projectPointsOntoPlane(u);a.computeWindingOrder2D(y)===o.CLOCKWISE&&(u.reverse(),c.reverse(),l.reverse())}var T,R,A=u.length,S=A-2,v=r.chordLength(f,e.maximumRadius),N=d;if(N.minDistance=v,N.ellipsoid=e,_){var O,I=0;for(O=0;O<A-1;O++)I+=i.numberOfPoints(u[O],u[O+1],v)+1;T=new Float64Array(3*I),R=new Float64Array(3*I);var M=h,g=E;N.positions=M,N.height=g;var x=0;for(O=0;O<A-1;O++){M[0]=u[O],M[1]=u[O+1],g[0]=c[O],g[1]=c[O+1];var w=i.generateArc(N);T.set(w,x),g[0]=l[O],g[1]=l[O+1],R.set(i.generateArc(N),x),x+=w.length}}else N.positions=u,N.height=c,T=new Float64Array(i.generateArc(N)),N.height=l,R=new Float64Array(i.generateArc(N));return{bottomPositions:R,topPositions:T,numCorners:S}}},c}),define("Core/WallOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./WallGeometryLibrary"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,E){"use strict";function d(e){e=r(e,r.EMPTY_OBJECT);var n=e.positions,i=e.maximumHeights,u=e.minimumHeights,s=r(e.granularity,f.RADIANS_PER_DEGREE),c=r(e.ellipsoid,o.WGS84);this._positions=n,this._minimumHeights=u,this._maximumHeights=i,this._granularity=s,this._ellipsoid=o.clone(c),this._workerName="createWallOutlineGeometry";var l=1+n.length*t.packedLength+2;a(u)&&(l+=u.length),a(i)&&(l+=i.length),this.packedLength=l+o.packedLength+1}var _=new t,m=new t;d.pack=function(e,n,i){i=r(i,0);var u,s=e._positions,c=s.length;for(n[i++]=c,u=0;u<c;++u,i+=t.packedLength)t.pack(s[u],n,i);var l=e._minimumHeights;if(c=a(l)?l.length:0,n[i++]=c,a(l))for(u=0;u<c;++u)n[i++]=l[u];var f=e._maximumHeights;if(c=a(f)?f.length:0,n[i++]=c,a(f))for(u=0;u<c;++u)n[i++]=f[u];return o.pack(e._ellipsoid,n,i),i+=o.packedLength,n[i]=e._granularity,n};var p=o.clone(o.UNIT_SPHERE),y={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:p,granularity:void 0};return d.unpack=function(e,n,i){n=r(n,0);var u,s=e[n++],c=new Array(s);for(u=0;u<s;++u,n+=t.packedLength)c[u]=t.unpack(e,n);s=e[n++];var l;if(s>0)for(l=new Array(s),u=0;u<s;++u)l[u]=e[n++];s=e[n++];var f;if(s>0)for(f=new Array(s),u=0;u<s;++u)f[u]=e[n++];var h=o.unpack(e,n,p);n+=o.packedLength;var E=e[n];return a(i)?(i._positions=c,i._minimumHeights=l,i._maximumHeights=f,i._ellipsoid=o.clone(h,i._ellipsoid),i._granularity=E,i):(y.positions=c,y.minimumHeights=l,y.maximumHeights=f,y.granularity=E,new d(y))},d.fromConstantHeights=function(e){e=r(e,r.EMPTY_OBJECT);var t,n,i=e.positions,o=e.minimumHeight,u=e.maximumHeight,s=a(o),c=a(u);if(s||c){var l=i.length;t=s?new Array(l):void 0,n=c?new Array(l):void 0;for(var f=0;f<l;++f)s&&(t[f]=o),c&&(n[f]=u)}var h={positions:i,maximumHeights:n,minimumHeights:t,ellipsoid:e.ellipsoid};return new d(h)},d.createGeometry=function(r){var i=r._positions,o=r._minimumHeights,d=r._maximumHeights,p=r._granularity,y=r._ellipsoid,T=E.computePositions(y,i,d,o,p,!1);if(a(T)){var R=T.bottomPositions,A=T.topPositions,S=A.length,v=2*S,N=new Float64Array(v),O=0;S/=3;var I;for(I=0;I<S;++I){var M=3*I,g=t.fromArray(A,M,_),x=t.fromArray(R,M,m);N[O++]=x.x,N[O++]=x.y,N[O++]=x.z,N[O++]=g.x,N[O++]=g.y,N[O++]=g.z}var w=new c({position:new s({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:N})}),C=v/3;v=2*C-4+C;var P=l.createTypedArray(C,v),U=0;for(I=0;I<C-2;I+=2){var D=I,L=I+2,F=t.fromArray(N,3*D,_),z=t.fromArray(N,3*L,m);if(!t.equalsEpsilon(F,z,f.EPSILON10)){var B=I+1,b=I+3;P[U++]=B,P[U++]=D,P[U++]=B,P[U++]=b,P[U++]=D,P[U++]=L}}return P[U++]=C-2,P[U++]=C-1,new u({attributes:w,indices:P,primitiveType:h.LINES,boundingSphere:new e.fromVertices(N)})}},d}),define("Workers/createWallOutlineGeometry",["../Core/defined","../Core/Ellipsoid","../Core/WallOutlineGeometry"],function(e,t,n){"use strict";function r(r,a){return e(a)&&(r=n.unpack(r,a)),r._ellipsoid=t.clone(r._ellipsoid),n.createGeometry(r)}return r})}(); \ No newline at end of file diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/transferTypedArrayTest.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/transferTypedArrayTest.js index a381290a..f289af0f 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/transferTypedArrayTest.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/transferTypedArrayTest.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/upsampleQuantizedTerrainMesh.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/upsampleQuantizedTerrainMesh.js index 49f01d52..2861e3dc 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/upsampleQuantizedTerrainMesh.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/Cesium/Workers/upsampleQuantizedTerrainMesh.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -222,9 +222,9 @@ OTHER DEALINGS IN THE SOFTWARE. * */ -!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==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";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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 n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(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^=e<<7&2636928640,e^=e<<15&4022730752,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,n,r){"use strict";var i={};i.EPSILON1=.1,i.EPSILON2=.01,i.EPSILON3=.001,i.EPSILON4=1e-4,i.EPSILON5=1e-5,i.EPSILON6=1e-6,i.EPSILON7=1e-7,i.EPSILON8=1e-8,i.EPSILON9=1e-9,i.EPSILON10=1e-10,i.EPSILON11=1e-11,i.EPSILON12=1e-12,i.EPSILON13=1e-13,i.EPSILON14=1e-14,i.EPSILON15=1e-15,i.EPSILON16=1e-16,i.EPSILON17=1e-17,i.EPSILON18=1e-18,i.EPSILON19=1e-19,i.EPSILON20=1e-20,i.GRAVITATIONALPARAMETER=3986004418e5,i.SOLAR_RADIUS=6955e5,i.LUNAR_RADIUS=1737400,i.SIXTY_FOUR_KILOBYTES=65536,i.sign=function(e){return e>0?1:e<0?-1:0},i.signNotZero=function(e){return e<0?-1:1},i.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*i.clamp(e,-1,1)+.5)*n)},i.fromSNorm=function(e,n){return n=t(n,255),i.clamp(e,0,n)/n*2-1},i.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},i.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},i.lerp=function(e,t,n){return(1-n)*e+n*t},i.PI=Math.PI,i.ONE_OVER_PI=1/Math.PI,i.PI_OVER_TWO=.5*Math.PI,i.PI_OVER_THREE=Math.PI/3,i.PI_OVER_FOUR=Math.PI/4,i.PI_OVER_SIX=Math.PI/6,i.THREE_PI_OVER_TWO=3*Math.PI*.5,i.TWO_PI=2*Math.PI,i.ONE_OVER_TWO_PI=1/(2*Math.PI),i.RADIANS_PER_DEGREE=Math.PI/180,i.DEGREES_PER_RADIAN=180/Math.PI,i.RADIANS_PER_ARCSECOND=i.RADIANS_PER_DEGREE/3600,i.toRadians=function(e){return e*i.RADIANS_PER_DEGREE},i.toDegrees=function(e){return e*i.DEGREES_PER_RADIAN},i.convertLongitudeRange=function(e){var t=i.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},i.clampToLatitudeRange=function(e){return i.clamp(e,-1*i.PI_OVER_TWO,i.PI_OVER_TWO)},i.negativePiToPi=function(e){return i.zeroToTwoPi(e+i.PI)-i.PI},i.zeroToTwoPi=function(e){var t=i.mod(e,i.TWO_PI);return Math.abs(t)<i.EPSILON14&&Math.abs(e)>i.EPSILON14?i.TWO_PI:t},i.mod=function(e,t){return(e%t+t)%t},i.equalsEpsilon=function(e,n,r,i){i=t(i,r);var a=Math.abs(e-n);return a<=i||a<=r*Math.max(Math.abs(e),Math.abs(n))};var a=[1];i.factorial=function(e){var t=a.length;if(e>=t)for(var n=a[t-1],r=t;r<=e;r++)a.push(n*r);return a[e]},i.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},i.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},i.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},i.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return i.setRandomNumberSeed=function(t){o=new e(t)},i.nextRandomNumber=function(){return o.random()},i.acosClamped=function(e){return Math.acos(i.clamp(e,-1,1))},i.asinClamped=function(e){return Math.asin(i.clamp(e,-1,1))},i.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},i.logBase=function(e,t){return Math.log(e)/Math.log(t)},i.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},i}),define("Core/Cartesian2",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i){"use strict";function a(t,n){this.x=e(t,0),this.y=e(n,0)}a.fromElements=function(e,n,r){return t(r)?(r.x=e,r.y=n,r):new a(e,n)},a.clone=function(e,n){if(t(e))return t(n)?(n.x=e.x,n.y=e.y,n):new a(e.x,e.y)},a.fromCartesian3=a.clone,a.fromCartesian4=a.clone,a.packedLength=2,a.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r]=t.y,n},a.unpack=function(n,r,i){return r=e(r,0),t(i)||(i=new a),i.x=n[r++],i.y=n[r],i},a.packArray=function(e,n){var r=e.length;t(n)?n.length=2*r:n=new Array(2*r);for(var i=0;i<r;++i)a.pack(e[i],n,2*i);return n},a.unpackArray=function(e,n){var r=e.length;t(n)?n.length=r/2:n=new Array(r/2);for(var i=0;i<r;i+=2){var o=i/2;n[o]=a.unpack(e,i,n[o])}return n},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,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},a.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},a.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},a.magnitude=function(e){return Math.sqrt(a.magnitudeSquared(e))};var o=new a;a.distance=function(e,t){return a.subtract(e,t,o),a.magnitude(o)},a.distanceSquared=function(e,t){return a.subtract(e,t,o),a.magnitudeSquared(o)},a.normalize=function(e,t){var n=a.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t},a.dot=function(e,t){return e.x*t.x+e.y*t.y},a.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n},a.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n},a.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n},a.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n},a.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n},a.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n},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,n,r){return a.multiplyByScalar(t,n,u),r=a.multiplyByScalar(e,1-n,r),a.add(u,r,r)};var s=new a,c=new a;a.angleBetween=function(e,t){return a.normalize(e,s),a.normalize(t,c),i.acosClamped(a.dot(s,c))};var l=new a;return a.mostOrthogonalAxis=function(e,t){var n=a.normalize(e,l);return a.abs(n,n),t=n.x<=n.y?a.clone(a.UNIT_X,t):a.clone(a.UNIT_Y,t)},a.equals=function(e,n){return e===n||t(e)&&t(n)&&e.x===n.x&&e.y===n.y},a.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},a.equalsEpsilon=function(e,n,r,a){return e===n||t(e)&&t(n)&&i.equalsEpsilon(e.x,n.x,r,a)&&i.equalsEpsilon(e.y,n.y,r,a)},a.ZERO=r(new a(0,0)),a.UNIT_X=r(new a(1,0)),a.UNIT_Y=r(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,n){return a.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return"("+this.x+", "+this.y+")"},a}),define("Core/isArray",["./defined"],function(e){"use strict";var t=Array.isArray;return e(t)||(t=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),t}),define("Core/Check",["./defaultValue","./defined","./DeveloperError","./isArray"],function(e,t,n,r){"use strict";function i(e){return e+" was required but undefined."}function a(e,t,n){return"Expected "+n+" to be typeof "+t+", got "+e}var o={};return o.typeOf={},o.numeric={},o.defined=function(e,r){if(!t(e))throw new n(i(r))},o.numeric.maximum=function(e,t){if(o.typeOf.number(e),o.typeOf.number(t),e>t)throw new n("Expected "+e+" to be at most "+t)},o.numeric.minimum=function(e,t){if(o.typeOf.number(e),o.typeOf.number(t),e<t)throw new n("Expected "+e+" to be at least "+t)},o.typeOf.function=function(e,t){if("function"!=typeof e)throw new n(a(typeof e,"function",t))},o.typeOf.string=function(e,t){if("string"!=typeof e)throw new n(a(typeof e,"string",t))},o.typeOf.number=function(e,t){if("number"!=typeof e)throw new n(a(typeof e,"number",t))},o.typeOf.object=function(e,t){if("object"!=typeof e)throw new n(a(typeof e,"object",t))},o.typeOf.boolean=function(e,t){if("boolean"!=typeof e)throw new n(a(typeof e,"boolean",t))},o}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var i=e.clock,a=e.cone,u=t(e.magnitude,1),s=u*Math.sin(a);return r.x=s*Math.cos(i),r.y=s*Math.sin(i),r.z=u*Math.cos(a),r},o.fromElements=function(e,t,r,i){return n(i)?(i.x=e,i.y=t,i.z=r,i):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new o),i.x=e[r++],i.y=e[r++],i.z=e[r],i},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var i=0;i<r;++i)o.pack(e[i],t,3*i);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var i=0;i<r;i+=3){var a=i/3;t[a]=o.unpack(e,i,t[a])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,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};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var n=o.dot(c,l),r=o.magnitude(o.cross(c,l,c));return Math.atan2(r,n)};var f=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,i){return e===t||n(e)&&n(t)&&a.equalsEpsilon(e.x,t.x,r,i)&&a.equalsEpsilon(e.y,t.y,r,i)&&a.equalsEpsilon(e.z,t.z,r,i)},o.cross=function(e,t,n){var r=e.x,i=e.y,a=e.z,o=t.x,u=t.y,s=t.z,c=i*s-a*u,l=a*o-r*s,f=r*u-i*o;return n.x=c,n.y=l,n.z=f,n},o.fromDegrees=function(e,t,n,r,i){return e=a.toRadians(e),t=a.toRadians(t),o.fromRadians(e,t,n,r,i)};var h=new o,d=new o,E=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,i,a,u){i=t(i,0);var s=n(a)?a.radiiSquared:E,c=Math.cos(r);h.x=c*Math.cos(e),h.y=c*Math.sin(e),h.z=Math.sin(r),h=o.normalize(h,h),o.multiplyComponents(s,h,d);var l=Math.sqrt(o.dot(h,d));return d=o.divideByScalar(d,l,d),h=o.multiplyByScalar(h,i,h),n(u)||(u=new o),o.add(d,h,u)},o.fromDegreesArray=function(e,t,r){var i=e.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],s=e[a+1],c=a/2;r[c]=o.fromDegrees(u,s,0,t,r[c])}return r},o.fromRadiansArray=function(e,t,r){var i=e.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],s=e[a+1],c=a/2;r[c]=o.fromRadians(u,s,0,t,r[c])}return r},o.fromDegreesArrayHeights=function(e,t,r){var i=e.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],s=e[a+1],c=e[a+2],l=a/3;r[l]=o.fromDegrees(u,s,c,t,r[l])}return r},o.fromRadiansArrayHeights=function(e,t,r){var i=e.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],s=e[a+1],c=e[a+2],l=a/3;r[l]=o.fromRadians(u,s,c,t,r[l])}return r},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,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r,i){"use strict";var a={};a.octEncodeInRange=function(e,t,n){if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var r=n.x,a=n.y;n.x=(1-Math.abs(a))*i.signNotZero(r),n.y=(1-Math.abs(r))*i.signNotZero(a)}return n.x=i.toSNorm(n.x,t),n.y=i.toSNorm(n.y,t),n},a.octEncode=function(e,t){return a.octEncodeInRange(e,255,t)},a.octDecodeInRange=function(e,n,r,a){if(a.x=i.fromSNorm(e,r),a.y=i.fromSNorm(n,r),a.z=1-(Math.abs(a.x)+Math.abs(a.y)),a.z<0){var o=a.x;a.x=(1-Math.abs(a.y))*i.signNotZero(o),a.y=(1-Math.abs(o))*i.signNotZero(a.y)}return t.normalize(a,a)},a.octDecode=function(e,t,n){return a.octDecodeInRange(e,t,255,n)},a.octPackFloat=function(e){return 256*e.x+e.y};var o=new e;return a.octEncodeFloat=function(e){return a.octEncode(e,o),a.octPackFloat(o)},a.octDecodeFloat=function(e,t){var n=e/256,r=Math.floor(n),i=256*(n-r);return a.octDecode(r,i,t)},a.octPack=function(e,t,n,r){var i=a.octEncodeFloat(e),u=a.octEncodeFloat(t),s=a.octEncode(n,o);return r.x=65536*s.x+i,r.y=65536*s.y+u,r},a.octUnpack=function(e,t,n,r){var i=e.x/65536,o=Math.floor(i),u=65536*(i-o);i=e.y/65536;var s=Math.floor(i),c=65536*(i-s);a.octDecodeFloat(u,t),a.octDecodeFloat(c,n),a.octDecode(o,s,r)},a.compressTextureCoordinates=function(e){var t=4095*e.x|0,n=4095*e.y|0;return 4096*t+n},a.decompressTextureCoordinates=function(e,t){var n=e/4096,r=Math.floor(n);return t.x=r/4095,t.y=(e-4096*r)/4095,t},a}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function i(n,i,u,s,c){var l=n.x,f=n.y,h=n.z,d=i.x,E=i.y,m=i.z,p=l*l*d*d,_=f*f*E*E,y=h*h*m*m,T=p+_+y,R=Math.sqrt(1/T),A=e.multiplyByScalar(n,R,a);if(T<s)return isFinite(R)?e.clone(A,c):void 0;var S=u.x,N=u.y,I=u.z,M=o;M.x=A.x*S*2,M.y=A.y*N*2,M.z=A.z*I*2;var g,v,O,x,w,C,P,U,D,L,F,z=(1-R)*e.magnitude(n)/(.5*e.magnitude(M)),B=0;do{z-=B,O=1/(1+z*S),x=1/(1+z*N),w=1/(1+z*I),C=O*O,P=x*x,U=w*w,D=C*O,L=P*x,F=U*w,g=p*C+_*P+y*U-1,v=p*D*S+_*L*N+y*F*I;var b=-2*v;B=g/b}while(Math.abs(g)>r.EPSILON12);return t(c)?(c.x=l*O,c.y=f*x,c.z=h*w,c):new e(l*O,f*x,h*w)}var a=new e,o=new e;return i}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,i,a,o){"use strict";function u(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)}u.fromRadians=function(e,r,i,a){return i=t(i,0),n(a)?(a.longitude=e,a.latitude=r,a.height=i,a):new u(e,r,i)},u.fromDegrees=function(e,t,n,r){return e=a.toRadians(e),t=a.toRadians(t),u.fromRadians(e,t,n,r)};var s=new e,c=new e,l=new e,f=new e(1/6378137,1/6378137,1/6356752.314245179),h=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),d=a.EPSILON1;return u.fromCartesian=function(t,r,i){var E=n(r)?r.oneOverRadii:f,m=n(r)?r.oneOverRadiiSquared:h,p=n(r)?r._centerToleranceSquared:d,_=o(t,E,m,p,c);if(n(_)){var y=e.multiplyComponents(_,m,s);y=e.normalize(y,y);var T=e.subtract(t,_,l),R=Math.atan2(y.y,y.x),A=Math.asin(y.z),S=a.sign(e.dot(T,t))*e.magnitude(T);return n(i)?(i.longitude=R,i.latitude=A,i.height=S,i):new u(R,A,S)}},u.clone=function(e,t){if(n(e))return n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},u.ZERO=i(new u(0,0,0)),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,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,i,a,o,u,s){"use strict";function c(t,r,i,a){r=n(r,0),i=n(i,0),a=n(a,0),t._radii=new e(r,i,a),t._radiiSquared=new e(r*r,i*i,a*a),t._radiiToTheFourth=new e(r*r*r*r,i*i*i*i,a*a*a*a),t._oneOverRadii=new e(0===r?0:1/r,0===i?0:1/i,0===a?0:1/a),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===i?0:1/(i*i),0===a?0:1/(a*a)),t._minimumRadius=Math.min(r,i,a),t._maximumRadius=Math.max(r,i,a),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,c(this,e,t,n)}i(l.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}}}),l.clone=function(t,n){if(r(t)){var i=t._radii;return r(n)?(e.clone(i,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new l(i.x,i.y,i.z)}},l.fromCartesian3=function(e,t){return r(t)||(t=new l),r(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,r,i){return i=n(i,0),e.pack(t._radii,r,i),r},l.unpack=function(t,r,i){r=n(r,0);var a=e.unpack(t,r);return l.fromCartesian3(a,i)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,n){var i=t.longitude,a=t.latitude,o=Math.cos(a),u=o*Math.cos(i),s=o*Math.sin(i),c=Math.sin(a);return r(n)||(n=new e),n.x=u,n.y=s,n.z=c,e.normalize(n,n)},l.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var f=new e,h=new e;l.prototype.cartographicToCartesian=function(t,n){var i=f,a=h;this.geodeticSurfaceNormalCartographic(t,i),e.multiplyComponents(this._radiiSquared,i,a);var o=Math.sqrt(e.dot(i,a));return e.divideByScalar(a,o,a),e.multiplyByScalar(i,t.height,i),r(n)||(n=new e),e.add(a,i,n)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;i<n;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var d=new e,E=new e,m=new e;return l.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,E);if(r(a)){var o=this.geodeticSurfaceNormal(a,d),s=e.subtract(n,a,m),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),f=u.sign(e.dot(s,n))*e.magnitude(s);return r(i)?(i.longitude=c,i.latitude=l,i.height=f,i):new t(c,l,f)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;i<n;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var i=t.x,a=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*u.z);return e.multiplyByScalar(t,s,n)},l.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},l.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},l.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,i,a){i=n(i,0);var o=this._sqauredXOverSquaredZ;if(r(a)||(a=new e),a.x=0,a.y=0,a.z=t.z*(1-o),!(Math.abs(a.z)>=this._radii.z-i))return a},l}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,i,a,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return i(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var i=this._semimajorAxis,a=t.longitude*i,o=t.latitude*i,u=t.height;return r(n)?(n.x=a,n.y=o,n.z=u,n):new e(a,o,u)},u.prototype.unproject=function(e,n){var i=this._oneOverSemimajorAxis,a=e.x*i,o=e.y*i,u=e.z;return r(n)?(n.longitude=a,n.latitude=o,n.height=u,n):new t(a,o,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";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a,o){"use strict";function u(e,n,r,i,a,o,u,s,c){this[0]=t(e,0),this[1]=t(i,0),this[2]=t(u,0),this[3]=t(n,0),this[4]=t(a,0),this[5]=t(s,0),this[6]=t(r,0),this[7]=t(o,0),this[8]=t(c,0)}function s(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function c(e){for(var t=0,n=0;n<3;++n){var r=e[u.getElementIndex(E[n],d[n])];t+=2*r*r}return Math.sqrt(t)}function l(e,t){for(var n=o.EPSILON15,r=0,i=1,a=0;a<3;++a){var s=Math.abs(e[u.getElementIndex(E[a],d[a])]);s>r&&(i=a,r=s)}var c=1,l=0,f=d[i],h=E[i];if(Math.abs(e[u.getElementIndex(h,f)])>n){var m,p=e[u.getElementIndex(h,h)],_=e[u.getElementIndex(f,f)],y=e[u.getElementIndex(h,f)],T=(p-_)/2/y;m=T<0?-1/(-T+Math.sqrt(1+T*T)):1/(T+Math.sqrt(1+T*T)),c=1/Math.sqrt(1+m*m),l=m*c}return t=u.clone(u.IDENTITY,t),t[u.getElementIndex(f,f)]=t[u.getElementIndex(h,h)]=c,t[u.getElementIndex(h,f)]=l,t[u.getElementIndex(f,h)]=-l,t}u.packedLength=9,u.pack=function(e,n,r){return r=t(r,0),n[r++]=e[0],n[r++]=e[1],n[r++]=e[2],n[r++]=e[3],n[r++]=e[4],n[r++]=e[5],n[r++]=e[6],n[r++]=e[7],n[r++]=e[8],n},u.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new u),i[0]=e[r++],i[1]=e[r++],i[2]=e[r++],i[3]=e[r++],i[4]=e[r++],i[5]=e[r++],i[6]=e[r++],i[7]=e[r++],i[8]=e[r++],i},u.clone=function(e,t){if(n(e))return n(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 u(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},u.fromArray=function(e,r,i){return r=t(r,0),n(i)||(i=new u),i[0]=e[r],i[1]=e[r+1],i[2]=e[r+2],i[3]=e[r+3],i[4]=e[r+4],i[5]=e[r+5],i[6]=e[r+6],i[7]=e[r+7],i[8]=e[r+8],i},u.fromColumnMajorArray=function(e,t){return u.clone(e,t)},u.fromRowMajorArray=function(e,t){return n(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 u(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},u.fromQuaternion=function(e,t){var r=e.x*e.x,i=e.x*e.y,a=e.x*e.z,o=e.x*e.w,s=e.y*e.y,c=e.y*e.z,l=e.y*e.w,f=e.z*e.z,h=e.z*e.w,d=e.w*e.w,E=r-s-f+d,m=2*(i-h),p=2*(a+l),_=2*(i+h),y=-r+s-f+d,T=2*(c-o),R=2*(a-l),A=2*(c+o),S=-r-s+f+d;return n(t)?(t[0]=E,t[1]=_,t[2]=R,t[3]=m,t[4]=y,t[5]=A,t[6]=p,t[7]=T,t[8]=S,t):new u(E,m,p,_,y,T,R,A,S)},u.fromHeadingPitchRoll=function(e,t){var r=Math.cos(-e.pitch),i=Math.cos(-e.heading),a=Math.cos(e.roll),o=Math.sin(-e.pitch),s=Math.sin(-e.heading),c=Math.sin(e.roll),l=r*i,f=-a*s+c*o*i,h=c*s+a*o*i,d=r*s,E=a*i+c*o*s,m=-o*a+a*o*s,p=-o,_=c*r,y=a*r;return n(t)?(t[0]=l,t[1]=d,t[2]=p,t[3]=f,t[4]=E,t[5]=_,t[6]=h,t[7]=m,t[8]=y,t):new u(l,f,h,d,E,m,p,_,y)},u.fromScale=function(e,t){return n(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 u(e.x,0,0,0,e.y,0,0,0,e.z)},u.fromUniformScale=function(e,t){return n(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 u(e,0,0,0,e,0,0,0,e)},u.fromCrossProduct=function(e,t){return n(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 u(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},u.fromRotationX=function(e,t){var r=Math.cos(e),i=Math.sin(e);return n(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=r,t[5]=i,t[6]=0,t[7]=-i,t[8]=r,t):new u(1,0,0,0,r,-i,0,i,r)},u.fromRotationY=function(e,t){var r=Math.cos(e),i=Math.sin(e);return n(t)?(t[0]=r,t[1]=0,t[2]=-i,t[3]=0,t[4]=1,t[5]=0,t[6]=i,t[7]=0,t[8]=r,t):new u(r,0,i,0,1,0,-i,0,r)},u.fromRotationZ=function(e,t){var r=Math.cos(e),i=Math.sin(e);return n(t)?(t[0]=r,t[1]=i,t[2]=0,t[3]=-i,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new u(r,-i,0,i,r,0,0,0,1)},u.toArray=function(e,t){return n(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]]},u.getElementIndex=function(e,t){return 3*e+t},u.getColumn=function(e,t,n){var r=3*t,i=e[r],a=e[r+1],o=e[r+2];return n.x=i,n.y=a,n.z=o,n},u.setColumn=function(e,t,n,r){r=u.clone(e,r);var i=3*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},u.getRow=function(e,t,n){var r=e[t],i=e[t+3],a=e[t+6];return n.x=r,n.y=i,n.z=a,n},u.setRow=function(e,t,n,r){return r=u.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var f=new e;u.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],f)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],f)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],f)),n};var h=new e;u.getMaximumScale=function(t){return u.getScale(t,h),e.maximumComponent(h)},u.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],i=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],o=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 n[0]=r,n[1]=i,n[2]=a,n[3]=o,n[4]=u,n[5]=s,n[6]=c,n[7]=l,n[8]=f,n},u.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},u.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},u.multiplyByVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[3]*i+e[6]*a,u=e[1]*r+e[4]*i+e[7]*a,s=e[2]*r+e[5]*i+e[8]*a;return n.x=o,n.y=u,n.z=s,n},u.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},u.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},u.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},u.transpose=function(e,t){var n=e[0],r=e[3],i=e[6],a=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var d=[1,0,0],E=[2,2,1],m=new u,p=new u;return u.computeEigenDecomposition=function(e,t){var r=o.EPSILON20,i=10,a=0,f=0;n(t)||(t={});for(var h=t.unitary=u.clone(u.IDENTITY,t.unitary),d=t.diagonal=u.clone(e,t.diagonal),E=r*s(d);f<i&&c(d)>E;)l(d,m),u.transpose(m,p),u.multiply(d,m,d),u.multiply(p,d,d),u.multiply(h,m,h),++a>2&&(++f,a=0);return t},u.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},u.determinant=function(e){var t=e[0],n=e[3],r=e[6],i=e[1],a=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(a*c-s*o)+i*(s*r-n*c)+u*(n*o-a*r)},u.inverse=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],l=e[7],f=e[8],h=u.determinant(e);t[0]=o*f-l*s,t[1]=l*i-r*f,t[2]=r*s-o*i,t[3]=c*s-a*f,t[4]=n*f-c*i,t[5]=a*i-n*s,t[6]=a*l-c*o,t[7]=c*r-n*l,t[8]=n*o-a*r;var d=1/h;return u.multiplyByScalar(t,d,t)},u.equals=function(e,t){return e===t||n(e)&&n(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]},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r},u.IDENTITY=a(new u(1,0,0,0,1,0,0,0,1)),u.ZERO=a(new u(0,0,0,0,0,0,0,0,0)),u.COLUMN0ROW0=0,u.COLUMN0ROW1=1,u.COLUMN0ROW2=2,u.COLUMN1ROW0=3,u.COLUMN1ROW1=4,u.COLUMN1ROW2=5,u.COLUMN2ROW0=6,u.COLUMN2ROW1=7,u.COLUMN2ROW2=8,r(u.prototype,{length:{get:function(){return u.packedLength}}}),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"; -},u}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i){"use strict";function a(t,n,r,i){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0),this.w=e(i,0)}a.fromElements=function(e,n,r,i,o){return t(o)?(o.x=e,o.y=n,o.z=r,o.w=i,o):new a(e,n,r,i)},a.fromColor=function(e,n){return t(n)?(n.x=e.red,n.y=e.green,n.z=e.blue,n.w=e.alpha,n):new a(e.red,e.green,e.blue,e.alpha)},a.clone=function(e,n){if(t(e))return t(n)?(n.x=e.x,n.y=e.y,n.z=e.z,n.w=e.w,n):new a(e.x,e.y,e.z,e.w)},a.packedLength=4,a.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w,n},a.unpack=function(n,r,i){return r=e(r,0),t(i)||(i=new a),i.x=n[r++],i.y=n[r++],i.z=n[r++],i.w=n[r],i},a.packArray=function(e,n){var r=e.length;t(n)?n.length=4*r:n=new Array(4*r);for(var i=0;i<r;++i)a.pack(e[i],n,4*i);return n},a.unpackArray=function(e,n){var r=e.length;t(n)?n.length=r/4:n=new Array(r/4);for(var i=0;i<r;i+=4){var o=i/4;n[o]=a.unpack(e,i,n[o])}return n},a.fromArray=a.unpack,a.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},a.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},a.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},a.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},a.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},a.magnitude=function(e){return Math.sqrt(a.magnitudeSquared(e))};var o=new a;a.distance=function(e,t){return a.subtract(e,t,o),a.magnitude(o)},a.distanceSquared=function(e,t){return a.subtract(e,t,o),a.magnitudeSquared(o)},a.normalize=function(e,t){var n=a.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t},a.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},a.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},a.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},a.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},a.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},a.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},a.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},a.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,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.w=Math.abs(e.w),t};var u=new a;a.lerp=function(e,t,n,r){return a.multiplyByScalar(t,n,u),r=a.multiplyByScalar(e,1-n,r),a.add(u,r,r)};var s=new a;return a.mostOrthogonalAxis=function(e,t){var n=a.normalize(e,s);return a.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?a.clone(a.UNIT_X,t):a.clone(a.UNIT_W,t):n.z<=n.w?a.clone(a.UNIT_Z,t):a.clone(a.UNIT_W,t):n.y<=n.z?n.y<=n.w?a.clone(a.UNIT_Y,t):a.clone(a.UNIT_W,t):n.z<=n.w?a.clone(a.UNIT_Z,t):a.clone(a.UNIT_W,t)},a.equals=function(e,n){return e===n||t(e)&&t(n)&&e.x===n.x&&e.y===n.y&&e.z===n.z&&e.w===n.w},a.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},a.equalsEpsilon=function(e,n,r,a){return e===n||t(e)&&t(n)&&i.equalsEpsilon(e.x,n.x,r,a)&&i.equalsEpsilon(e.y,n.y,r,a)&&i.equalsEpsilon(e.z,n.z,r,a)&&i.equalsEpsilon(e.w,n.w,r,a)},a.ZERO=r(new a(0,0,0,0)),a.UNIT_X=r(new a(1,0,0,0)),a.UNIT_Y=r(new a(0,1,0,0)),a.UNIT_Z=r(new a(0,0,1,0)),a.UNIT_W=r(new a(0,0,0,1)),a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,n){return a.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},a}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,i,a,o,u,s,c){"use strict";function l(e,t,r,i,a,o,u,s,c,l,f,h,d,E,m,p){this[0]=n(e,0),this[1]=n(a,0),this[2]=n(c,0),this[3]=n(d,0),this[4]=n(t,0),this[5]=n(o,0),this[6]=n(l,0),this[7]=n(E,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(f,0),this[11]=n(m,0),this[12]=n(i,0),this[13]=n(s,0),this[14]=n(h,0),this[15]=n(p,0)}l.packedLength=16,l.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t[r++]=e[9],t[r++]=e[10],t[r++]=e[11],t[r++]=e[12],t[r++]=e[13],t[r++]=e[14],t[r]=e[15],t},l.unpack=function(e,t,i){return t=n(t,0),r(i)||(i=new l),i[0]=e[t++],i[1]=e[t++],i[2]=e[t++],i[3]=e[t++],i[4]=e[t++],i[5]=e[t++],i[6]=e[t++],i[7]=e[t++],i[8]=e[t++],i[9]=e[t++],i[10]=e[t++],i[11]=e[t++],i[12]=e[t++],i[13]=e[t++],i[14]=e[t++],i[15]=e[t],i},l.clone=function(e,t){if(r(e))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):new l(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])},l.fromArray=l.unpack,l.fromColumnMajorArray=function(e,t){return l.clone(e,t)},l.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 l(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])},l.fromRotationTranslation=function(t,i,a){return i=n(i,e.ZERO),r(a)?(a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=0,a[4]=t[3],a[5]=t[4],a[6]=t[5],a[7]=0,a[8]=t[6],a[9]=t[7],a[10]=t[8],a[11]=0,a[12]=i.x,a[13]=i.y,a[14]=i.z,a[15]=1,a):new l(t[0],t[3],t[6],i.x,t[1],t[4],t[7],i.y,t[2],t[5],t[8],i.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(e,t,n,i){r(i)||(i=new l);var a=n.x,o=n.y,u=n.z,s=t.x*t.x,c=t.x*t.y,f=t.x*t.z,h=t.x*t.w,d=t.y*t.y,E=t.y*t.z,m=t.y*t.w,p=t.z*t.z,_=t.z*t.w,y=t.w*t.w,T=s-d-p+y,R=2*(c-_),A=2*(f+m),S=2*(c+_),N=-s+d-p+y,I=2*(E-h),M=2*(f-m),g=2*(E+h),v=-s-d+p+y;return i[0]=T*a,i[1]=S*a,i[2]=M*a,i[3]=0,i[4]=R*o,i[5]=N*o,i[6]=g*o,i[7]=0,i[8]=A*u,i[9]=I*u,i[10]=v*u,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i},l.fromTranslationRotationScale=function(e,t){return l.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},l.fromTranslation=function(e,t){return l.fromRotationTranslation(s.IDENTITY,e,t)},l.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 l(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},l.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 l(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var f=new e,h=new e,d=new e;l.fromCamera=function(t,n){var i=t.position,a=t.direction,o=t.up;e.normalize(a,f),e.normalize(e.cross(f,o,h),h),e.normalize(e.cross(h,f,d),d);var u=h.x,s=h.y,c=h.z,E=f.x,m=f.y,p=f.z,_=d.x,y=d.y,T=d.z,R=i.x,A=i.y,S=i.z,N=u*-R+s*-A+c*-S,I=_*-R+y*-A+T*-S,M=E*R+m*A+p*S;return r(n)?(n[0]=u,n[1]=_,n[2]=-E,n[3]=0,n[4]=s,n[5]=y,n[6]=-m,n[7]=0,n[8]=c,n[9]=T,n[10]=-p,n[11]=0,n[12]=N,n[13]=I,n[14]=M,n[15]=1,n):new l(u,s,c,N,_,y,T,I,-E,-m,-p,M,0,0,0,1)},l.computePerspectiveFieldOfView=function(e,t,n,r,i){var a=Math.tan(.5*e),o=1/a,u=o/t,s=(r+n)/(n-r),c=2*r*n/(n-r);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=o,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=s,i[11]=-1,i[12]=0,i[13]=0,i[14]=c,i[15]=0,i},l.computeOrthographicOffCenter=function(e,t,n,r,i,a,o){var u=1/(t-e),s=1/(r-n),c=1/(a-i),l=-(t+e)*u,f=-(r+n)*s,h=-(a+i)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=f,o[14]=h,o[15]=1,o},l.computePerspectiveOffCenter=function(e,t,n,r,i,a,o){var u=2*i/(t-e),s=2*i/(r-n),c=(t+e)/(t-e),l=(r+n)/(r-n),f=-(a+i)/(a-i),h=-1,d=-2*a*i/(a-i);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=f,o[11]=h,o[12]=0,o[13]=0,o[14]=d,o[15]=0,o},l.computeInfinitePerspectiveOffCenter=function(e,t,n,r,i,a){var o=2*i/(t-e),u=2*i/(r-n),s=(t+e)/(t-e),c=(r+n)/(r-n),l=-1,f=-1,h=-2*i;return a[0]=o,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]=h,a[15]=0,a},l.computeViewportTransformation=function(e,t,r,i){e=n(e,n.EMPTY_OBJECT);var a=n(e.x,0),o=n(e.y,0),u=n(e.width,0),s=n(e.height,0);t=n(t,0),r=n(r,1);var c=.5*u,l=.5*s,f=.5*(r-t),h=c,d=l,E=f,m=a+c,p=o+l,_=t+f,y=1;return i[0]=h,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=d,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=E,i[11]=0,i[12]=m,i[13]=p,i[14]=_,i[15]=y,i},l.computeView=function(t,n,r,i,a){return a[0]=i.x,a[1]=r.x,a[2]=-n.x,a[3]=0,a[4]=i.y,a[5]=r.y,a[6]=-n.y,a[7]=0,a[8]=i.z,a[9]=r.z,a[10]=-n.z,a[11]=0,a[12]=-e.dot(i,t),a[13]=-e.dot(r,t),a[14]=e.dot(n,t),a[15]=1,a},l.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]]},l.getElementIndex=function(e,t){return 4*e+t},l.getColumn=function(e,t,n){var r=4*t,i=e[r],a=e[r+1],o=e[r+2],u=e[r+3];return n.x=i,n.y=a,n.z=o,n.w=u,n},l.setColumn=function(e,t,n,r){r=l.clone(e,r);var i=4*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r[i+3]=n.w,r},l.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},l.getRow=function(e,t,n){var r=e[t],i=e[t+4],a=e[t+8],o=e[t+12];return n.x=r,n.y=i,n.z=a,n.w=o,n},l.setRow=function(e,t,n,r){return r=l.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var E=new e;l.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],E)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],E)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],E)),n};var m=new e;l.getMaximumScale=function(t){return l.getScale(t,m),e.maximumComponent(m)},l.multiply=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],f=e[8],h=e[9],d=e[10],E=e[11],m=e[12],p=e[13],_=e[14],y=e[15],T=t[0],R=t[1],A=t[2],S=t[3],N=t[4],I=t[5],M=t[6],g=t[7],v=t[8],O=t[9],x=t[10],w=t[11],C=t[12],P=t[13],U=t[14],D=t[15],L=r*T+u*R+f*A+m*S,F=i*T+s*R+h*A+p*S,z=a*T+c*R+d*A+_*S,B=o*T+l*R+E*A+y*S,b=r*N+u*I+f*M+m*g,q=i*N+s*I+h*M+p*g,G=a*N+c*I+d*M+_*g,W=o*N+l*I+E*M+y*g,X=r*v+u*O+f*x+m*w,V=i*v+s*O+h*x+p*w,H=a*v+c*O+d*x+_*w,Y=o*v+l*O+E*x+y*w,k=r*C+u*P+f*U+m*D,Z=i*C+s*P+h*U+p*D,j=a*C+c*P+d*U+_*D,K=o*C+l*P+E*U+y*D;return n[0]=L,n[1]=F,n[2]=z,n[3]=B,n[4]=b,n[5]=q,n[6]=G,n[7]=W,n[8]=X,n[9]=V,n[10]=H,n[11]=Y,n[12]=k,n[13]=Z,n[14]=j,n[15]=K,n},l.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},l.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},l.multiplyTransformation=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=e[12],d=e[13],E=e[14],m=t[0],p=t[1],_=t[2],y=t[4],T=t[5],R=t[6],A=t[8],S=t[9],N=t[10],I=t[12],M=t[13],g=t[14],v=r*m+o*p+c*_,O=i*m+u*p+l*_,x=a*m+s*p+f*_,w=r*y+o*T+c*R,C=i*y+u*T+l*R,P=a*y+s*T+f*R,U=r*A+o*S+c*N,D=i*A+u*S+l*N,L=a*A+s*S+f*N,F=r*I+o*M+c*g+h,z=i*I+u*M+l*g+d,B=a*I+s*M+f*g+E;return n[0]=v,n[1]=O,n[2]=x,n[3]=0,n[4]=w,n[5]=C,n[6]=P,n[7]=0,n[8]=U,n[9]=D,n[10]=L,n[11]=0,n[12]=F,n[13]=z,n[14]=B,n[15]=1,n},l.multiplyByMatrix3=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=t[0],d=t[1],E=t[2],m=t[3],p=t[4],_=t[5],y=t[6],T=t[7],R=t[8],A=r*h+o*d+c*E,S=i*h+u*d+l*E,N=a*h+s*d+f*E,I=r*m+o*p+c*_,M=i*m+u*p+l*_,g=a*m+s*p+f*_,v=r*y+o*T+c*R,O=i*y+u*T+l*R,x=a*y+s*T+f*R;return n[0]=A,n[1]=S,n[2]=N,n[3]=0,n[4]=I,n[5]=M,n[6]=g,n[7]=0,n[8]=v,n[9]=O,n[10]=x,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},l.multiplyByTranslation=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=r*e[0]+i*e[4]+a*e[8]+e[12],u=r*e[1]+i*e[5]+a*e[9]+e[13],s=r*e[2]+i*e[6]+a*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=s,n[15]=e[15],n};var p=new e;l.multiplyByUniformScale=function(e,t,n){return p.x=t,p.y=t,p.z=t,l.multiplyByScale(e,p,n)},l.multiplyByScale=function(e,t,n){var r=t.x,i=t.y,a=t.z;return 1===r&&1===i&&1===a?l.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=i*e[4],n[5]=i*e[5],n[6]=i*e[6],n[7]=0,n[8]=a*e[8],n[9]=a*e[9],n[10]=a*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},l.multiplyByVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=t.w,u=e[0]*r+e[4]*i+e[8]*a+e[12]*o,s=e[1]*r+e[5]*i+e[9]*a+e[13]*o,c=e[2]*r+e[6]*i+e[10]*a+e[14]*o,l=e[3]*r+e[7]*i+e[11]*a+e[15]*o;return n.x=u,n.y=s,n.z=c,n.w=l,n},l.multiplyByPointAsVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[4]*i+e[8]*a,u=e[1]*r+e[5]*i+e[9]*a,s=e[2]*r+e[6]*i+e[10]*a;return n.x=o,n.y=u,n.z=s,n},l.multiplyByPoint=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[4]*i+e[8]*a+e[12],u=e[1]*r+e[5]*i+e[9]*a+e[13],s=e[2]*r+e[6]*i+e[10]*a+e[14];return n.x=o,n.y=u,n.z=s,n},l.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},l.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},l.transpose=function(e,t){var n=e[1],r=e[2],i=e[3],a=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=a,t[10]=e[10],t[11]=e[14],t[12]=i,t[13]=o,t[14]=u,t[15]=e[15],t},l.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},l.equals=function(e,t){return e===t||r(e)&&r(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},l.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},l.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},l.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};var _=new s,y=new s,T=new t,R=new t(0,0,0,1);return l.inverse=function(e,n){if(s.equalsEpsilon(l.getRotation(e,_),y,u.EPSILON7)&&t.equals(l.getRow(e,3,T),R))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],i=e[4],a=e[8],o=e[12],f=e[1],h=e[5],d=e[9],E=e[13],m=e[2],p=e[6],A=e[10],S=e[14],N=e[3],I=e[7],M=e[11],g=e[15],v=A*g,O=S*M,x=p*g,w=S*I,C=p*M,P=A*I,U=m*g,D=S*N,L=m*M,F=A*N,z=m*I,B=p*N,b=v*h+w*d+C*E-(O*h+x*d+P*E),q=O*f+U*d+F*E-(v*f+D*d+L*E),G=x*f+D*h+z*E-(w*f+U*h+B*E),W=P*f+L*h+B*d-(C*f+F*h+z*d),X=O*i+x*a+P*o-(v*i+w*a+C*o),V=v*r+D*a+L*o-(O*r+U*a+F*o),H=w*r+U*i+B*o-(x*r+D*i+z*o),Y=C*r+F*i+z*a-(P*r+L*i+B*a);v=a*E,O=o*d,x=i*E,w=o*h,C=i*d,P=a*h,U=r*E,D=o*f,L=r*d,F=a*f,z=r*h,B=i*f;var k=v*I+w*M+C*g-(O*I+x*M+P*g),Z=O*N+U*M+F*g-(v*N+D*M+L*g),j=x*N+D*I+z*g-(w*N+U*I+B*g),K=P*N+L*I+B*M-(C*N+F*I+z*M),J=x*A+P*S+O*p-(C*S+v*p+w*A),Q=L*S+v*m+D*A-(U*A+F*S+O*m),$=U*p+B*S+w*m-(z*S+x*m+D*p),ee=z*A+C*m+F*p-(L*p+B*A+P*m),te=r*b+i*q+a*G+o*W;if(Math.abs(te)<u.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=b*te,n[1]=q*te,n[2]=G*te,n[3]=W*te,n[4]=X*te,n[5]=V*te,n[6]=H*te,n[7]=Y*te,n[8]=k*te,n[9]=Z*te,n[10]=j*te,n[11]=K*te,n[12]=J*te,n[13]=Q*te,n[14]=$*te,n[15]=ee*te,n},l.inverseTransformation=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],f=e[12],h=e[13],d=e[14],E=-n*f-r*h-i*d,m=-a*f-o*h-u*d,p=-s*f-c*h-l*d;return t[0]=n,t[1]=a,t[2]=s,t[3]=0,t[4]=r,t[5]=o,t[6]=c,t[7]=0,t[8]=i,t[9]=u,t[10]=l,t[11]=0,t[12]=E,t[13]=m,t[14]=p,t[15]=1,t},l.IDENTITY=o(new l(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),l.ZERO=o(new l(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN0ROW3=3,l.COLUMN1ROW0=4,l.COLUMN1ROW1=5,l.COLUMN1ROW2=6,l.COLUMN1ROW3=7,l.COLUMN2ROW0=8,l.COLUMN2ROW1=9,l.COLUMN2ROW2=10,l.COLUMN2ROW3=11,l.COLUMN3ROW0=12,l.COLUMN3ROW1=13,l.COLUMN3ROW2=14,l.COLUMN3ROW3=15,i(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.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]+")"},l}),define("Core/Rectangle",["./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,i,a,o,u){"use strict";function s(e,n,r,i){this.west=t(e,0),this.south=t(n,0),this.east=t(r,0),this.north=t(i,0)}r(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,n,r){return r=t(r,0),n[r++]=e.west,n[r++]=e.south,n[r++]=e.east,n[r]=e.north,n},s.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new s),i.west=e[r++],i.south=e[r++],i.east=e[r++],i.north=e[r],i},s.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=u.TWO_PI),t-n},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,r,i,a,o){return e=u.toRadians(t(e,0)),r=u.toRadians(t(r,0)),i=u.toRadians(t(i,0)),a=u.toRadians(t(a,0)),n(o)?(o.west=e,o.south=r,o.east=i,o.north=a,o):new s(e,r,i,a)},s.fromCartographicArray=function(e,t){for(var r=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE,f=0,h=e.length;f<h;f++){var d=e[f];r=Math.min(r,d.longitude),i=Math.max(i,d.longitude),c=Math.min(c,d.latitude),l=Math.max(l,d.latitude);var E=d.longitude>=0?d.longitude:d.longitude+u.TWO_PI;a=Math.min(a,E),o=Math.max(o,E)}return i-r>o-a&&(r=a,i=o,i>u.PI&&(i-=u.TWO_PI),r>u.PI&&(r-=u.TWO_PI)),n(t)?(t.west=r,t.south=c,t.east=i,t.north=l,t):new s(r,c,i,l)},s.fromCartesianArray=function(e,t,r){for(var i=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=Number.MAX_VALUE,f=-Number.MAX_VALUE,h=0,d=e.length;h<d;h++){var E=t.cartesianToCartographic(e[h]);i=Math.min(i,E.longitude),a=Math.max(a,E.longitude),l=Math.min(l,E.latitude),f=Math.max(f,E.latitude);var m=E.longitude>=0?E.longitude:E.longitude+u.TWO_PI;o=Math.min(o,m),c=Math.max(c,m)}return a-i>c-o&&(i=o,a=c,a>u.PI&&(a-=u.TWO_PI),i>u.PI&&(i-=u.TWO_PI)),n(r)?(r.west=i,r.south=l,r.east=a,r.north=f,r):new s(i,l,a,f)},s.clone=function(e,t){if(n(e))return n(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,t){return e===t||n(e)&&n(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},s.prototype.equalsEpsilon=function(e,t){return n(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},s.validate=function(e){},s.southwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.south,r.height=0,r):new e(t.west,t.south)},s.northwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.north,r.height=0,r):new e(t.west,t.north)},s.northeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.north,r.height=0,r):new e(t.east,t.north)},s.southeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.south,r.height=0,r):new e(t.east,t.south)},s.center=function(t,r){var i=t.east,a=t.west;i<a&&(i+=u.TWO_PI);var o=u.negativePiToPi(.5*(a+i)),s=.5*(t.south+t.north);return n(r)?(r.longitude=o,r.latitude=s,r.height=0,r):new e(o,s)},s.intersection=function(e,t,r){var i=e.east,a=e.west,o=t.east,c=t.west;i<a&&o>0?i+=u.TWO_PI:o<c&&i>0&&(o+=u.TWO_PI),i<a&&c<0?c+=u.TWO_PI:o<c&&a<0&&(a+=u.TWO_PI);var l=u.negativePiToPi(Math.max(a,c)),f=u.negativePiToPi(Math.min(i,o));if(!((e.west<e.east||t.west<t.east)&&f<=l)){var h=Math.max(e.south,t.south),d=Math.min(e.north,t.north);if(!(h>=d))return n(r)?(r.west=l,r.south=h,r.east=f,r.north=d,r):new s(l,h,f,d)}},s.simpleIntersection=function(e,t,r){var i=Math.max(e.west,t.west),a=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(a>=u||i>=o))return n(r)?(r.west=i,r.south=a,r.east=o,r.north=u,r):new s(i,a,o,u)},s.union=function(e,t,r){n(r)||(r=new s);var i=e.east,a=e.west,o=t.east,c=t.west;i<a&&o>0?i+=u.TWO_PI:o<c&&i>0&&(o+=u.TWO_PI),i<a&&c<0?c+=u.TWO_PI:o<c&&a<0&&(a+=u.TWO_PI);var l=u.convertLongitudeRange(Math.min(a,c)),f=u.convertLongitudeRange(Math.max(i,o));return r.west=l,r.south=Math.min(e.south,t.south),r.east=f,r.north=Math.max(e.north,t.north),r},s.expand=function(e,t,r){return n(r)||(r=new s),r.west=Math.min(e.west,t.longitude),r.south=Math.min(e.south,t.latitude),r.east=Math.max(e.east,t.longitude),r.north=Math.max(e.north,t.latitude),r},s.contains=function(e,t){var n=t.longitude,r=t.latitude,i=e.west,a=e.east;return a<i&&(a+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>i||u.equalsEpsilon(n,i,u.EPSILON14))&&(n<a||u.equalsEpsilon(n,a,u.EPSILON14))&&r>=e.south&&r<=e.north};var c=new e;return s.subsample=function(e,r,i,o){r=t(r,a.WGS84),i=t(i,0),n(o)||(o=[]);var l=0,f=e.north,h=e.south,d=e.east,E=e.west,m=c;m.height=i,m.longitude=E,m.latitude=f,o[l]=r.cartographicToCartesian(m,o[l]),l++,m.longitude=d,o[l]=r.cartographicToCartesian(m,o[l]),l++,m.latitude=h,o[l]=r.cartographicToCartesian(m,o[l]),l++,m.longitude=E,o[l]=r.cartographicToCartesian(m,o[l]),l++,f<0?m.latitude=f:h>0?m.latitude=h:m.latitude=0;for(var p=1;p<8;++p)m.longitude=-Math.PI+p*u.PI_OVER_TWO,s.contains(e,m)&&(o[l]=r.cartographicToCartesian(m,o[l]),l++);return 0===m.latitude&&(m.longitude=E,o[l]=r.cartographicToCartesian(m,o[l]),l++,m.longitude=d,o[l]=r.cartographicToCartesian(m,o[l]),l++),o.length=l,o},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,i,a,o,u,s,c,l,f){"use strict";function h(t,r){this.center=e.clone(n(t,e.ZERO)),this.radius=n(r,0)}var d=new e,E=new e,m=new e,p=new e,_=new e,y=new e,T=new e,R=new e,A=new e,S=new e,N=new e,I=new e;h.fromPoints=function(t,n){if(r(n)||(n=new h),!r(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var i=e.clone(t[0],T),a=e.clone(i,d),o=e.clone(i,E),u=e.clone(i,m),s=e.clone(i,p),c=e.clone(i,_),l=e.clone(i,y),f=t.length,M=1;M<f;M++){e.clone(t[M],i);var g=i.x,v=i.y,O=i.z;g<a.x&&e.clone(i,a),g>s.x&&e.clone(i,s),v<o.y&&e.clone(i,o),v>c.y&&e.clone(i,c),O<u.z&&e.clone(i,u),O>l.z&&e.clone(i,l)}var x=e.magnitudeSquared(e.subtract(s,a,R)),w=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=a,U=s,D=x;w>D&&(D=w,P=o,U=c),C>D&&(D=C,P=u,U=l);var L=A;L.x=.5*(P.x+U.x),L.y=.5*(P.y+U.y),L.z=.5*(P.z+U.z);var F=e.magnitudeSquared(e.subtract(U,L,R)),z=Math.sqrt(F),B=S;B.x=a.x,B.y=o.y,B.z=u.z;var b=N;b.x=s.x,b.y=c.y,b.z=l.z;var q=e.multiplyByScalar(e.add(B,b,R),.5,I),G=0;for(M=0;M<f;M++){e.clone(t[M],i);var W=e.magnitude(e.subtract(i,q,R));W>G&&(G=W);var X=e.magnitudeSquared(e.subtract(i,L,R));if(X>F){var V=Math.sqrt(X);z=.5*(z+V),F=z*z;var H=V-z;L.x=(z*L.x+H*i.x)/V,L.y=(z*L.y+H*i.y)/V,L.z=(z*L.z+H*i.z)/V}}return z<G?(e.clone(L,n.center),n.radius=z):(e.clone(q,n.center),n.radius=G),n};var M=new o,g=new e,v=new e,O=new t,x=new t;h.fromRectangle2D=function(e,t,n){return h.fromRectangleWithHeights2D(e,t,0,0,n)},h.fromRectangleWithHeights2D=function(t,i,a,o,u){if(r(u)||(u=new h),!r(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;i=n(i,M),f.southwest(t,O),O.height=a,f.northeast(t,x),x.height=o;var s=i.project(O,g),c=i.project(x,v),l=c.x-s.x,d=c.y-s.y,E=c.z-s.z;u.radius=.5*Math.sqrt(l*l+d*d+E*E);var m=u.center;return m.x=s.x+.5*l,m.y=s.y+.5*d,m.z=s.z+.5*E,u};var w=[];h.fromRectangle3D=function(e,t,i,o){t=n(t,a.WGS84),i=n(i,0);var u;return r(e)&&(u=f.subsample(e,t,i,w)),h.fromPoints(u,o)},h.fromVertices=function(t,i,a,o){if(r(o)||(o=new h),!r(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;i=n(i,e.ZERO),a=n(a,3);var u=T;u.x=t[0]+i.x,u.y=t[1]+i.y,u.z=t[2]+i.z;for(var s=e.clone(u,d),c=e.clone(u,E),l=e.clone(u,m),f=e.clone(u,p),M=e.clone(u,_),g=e.clone(u,y),v=t.length,O=0;O<v;O+=a){var x=t[O]+i.x,w=t[O+1]+i.y,C=t[O+2]+i.z;u.x=x,u.y=w,u.z=C,x<s.x&&e.clone(u,s),x>f.x&&e.clone(u,f),w<c.y&&e.clone(u,c),w>M.y&&e.clone(u,M),C<l.z&&e.clone(u,l),C>g.z&&e.clone(u,g)}var P=e.magnitudeSquared(e.subtract(f,s,R)),U=e.magnitudeSquared(e.subtract(M,c,R)),D=e.magnitudeSquared(e.subtract(g,l,R)),L=s,F=f,z=P;U>z&&(z=U,L=c,F=M),D>z&&(z=D,L=l,F=g);var B=A;B.x=.5*(L.x+F.x),B.y=.5*(L.y+F.y),B.z=.5*(L.z+F.z);var b=e.magnitudeSquared(e.subtract(F,B,R)),q=Math.sqrt(b),G=S;G.x=s.x,G.y=c.y,G.z=l.z;var W=N;W.x=f.x,W.y=M.y,W.z=g.z;var X=e.multiplyByScalar(e.add(G,W,R),.5,I),V=0;for(O=0;O<v;O+=a){u.x=t[O]+i.x,u.y=t[O+1]+i.y,u.z=t[O+2]+i.z;var H=e.magnitude(e.subtract(u,X,R));H>V&&(V=H);var Y=e.magnitudeSquared(e.subtract(u,B,R));if(Y>b){var k=Math.sqrt(Y);q=.5*(q+k),b=q*q;var Z=k-q;B.x=(q*B.x+Z*u.x)/k,B.y=(q*B.y+Z*u.y)/k,B.z=(q*B.z+Z*u.z)/k}}return q<V?(e.clone(B,o.center),o.radius=q):(e.clone(X,o.center),o.radius=V),o},h.fromEncodedCartesianVertices=function(t,n,i){if(r(i)||(i=new h),!r(t)||!r(n)||t.length!==n.length||0===t.length)return i.center=e.clone(e.ZERO,i.center),i.radius=0,i;var a=T;a.x=t[0]+n[0],a.y=t[1]+n[1],a.z=t[2]+n[2];for(var o=e.clone(a,d),u=e.clone(a,E),s=e.clone(a,m),c=e.clone(a,p),l=e.clone(a,_),f=e.clone(a,y),M=t.length,g=0;g<M;g+=3){var v=t[g]+n[g],O=t[g+1]+n[g+1],x=t[g+2]+n[g+2];a.x=v,a.y=O,a.z=x,v<o.x&&e.clone(a,o),v>c.x&&e.clone(a,c),O<u.y&&e.clone(a,u),O>l.y&&e.clone(a,l),x<s.z&&e.clone(a,s),x>f.z&&e.clone(a,f)}var w=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=e.magnitudeSquared(e.subtract(f,s,R)),U=o,D=c,L=w;C>L&&(L=C,U=u,D=l),P>L&&(L=P,U=s,D=f);var F=A;F.x=.5*(U.x+D.x),F.y=.5*(U.y+D.y),F.z=.5*(U.z+D.z);var z=e.magnitudeSquared(e.subtract(D,F,R)),B=Math.sqrt(z),b=S;b.x=o.x,b.y=u.y,b.z=s.z;var q=N;q.x=c.x,q.y=l.y,q.z=f.z;var G=e.multiplyByScalar(e.add(b,q,R),.5,I),W=0;for(g=0;g<M;g+=3){a.x=t[g]+n[g],a.y=t[g+1]+n[g+1],a.z=t[g+2]+n[g+2];var X=e.magnitude(e.subtract(a,G,R));X>W&&(W=X);var V=e.magnitudeSquared(e.subtract(a,F,R));if(V>z){var H=Math.sqrt(V);B=.5*(B+H),z=B*B;var Y=H-B;F.x=(B*F.x+Y*a.x)/H,F.y=(B*F.y+Y*a.y)/H,F.z=(B*F.z+Y*a.z)/H}}return B<W?(e.clone(F,i.center),i.radius=B):(e.clone(G,i.center),i.radius=W),i},h.fromCornerPoints=function(t,n,i){r(i)||(i=new h);var a=i.center;return e.add(t,n,a),e.multiplyByScalar(a,.5,a),i.radius=e.distance(a,n),i},h.fromEllipsoid=function(t,n){return r(n)||(n=new h),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var C=new e;h.fromBoundingSpheres=function(t,n){if(r(n)||(n=new h),!r(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var i=t.length;if(1===i)return h.clone(t[0],n);if(2===i)return h.union(t[0],t[1],n);for(var a=[],o=0;o<i;o++)a.push(t[o].center);n=h.fromPoints(a,n);var u=n.center,s=n.radius;for(o=0;o<i;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,C)+c.radius)}return n.radius=s,n};var P=new e,U=new e,D=new e;h.fromOrientedBoundingBox=function(t,n){r(n)||(n=new h);var i=t.halfAxes,a=c.getColumn(i,0,P),o=c.getColumn(i,1,U),u=c.getColumn(i,2,D),s=e.magnitude(a),l=e.magnitude(o),f=e.magnitude(u);return n.center=e.clone(t.center,n.center),n.radius=Math.max(s,l,f),n},h.clone=function(t,n){if(r(t))return r(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new h(t.center,t.radius)},h.packedLength=4,h.pack=function(e,t,r){r=n(r,0);var i=e.center;return t[r++]=i.x,t[r++]=i.y,t[r++]=i.z,t[r]=e.radius,t},h.unpack=function(e,t,i){t=n(t,0),r(i)||(i=new h);var a=i.center;return a.x=e[t++],a.y=e[t++],a.z=e[t++],i.radius=e[t],i};var L=new e,F=new e;h.union=function(t,n,i){r(i)||(i=new h);var a=t.center,o=t.radius,u=n.center,s=n.radius,c=e.subtract(u,a,L),l=e.magnitude(c);if(o>=l+s)return t.clone(i),i;if(s>=l+o)return n.clone(i),i;var f=.5*(o+l+s),d=e.multiplyByScalar(c,(-o+f)/l,F);return e.add(d,a,d),e.clone(d,i.center),i.radius=f,i};var z=new e;h.expand=function(t,n,r){r=h.clone(t,r);var i=e.magnitude(e.subtract(n,r.center,z));return i>r.radius&&(r.radius=i),r},h.intersectPlane=function(t,n){var r=t.center,i=t.radius,a=n.normal,o=e.dot(a,r)+n.distance;return o<-i?u.OUTSIDE:o<i?u.INTERSECTING:u.INSIDE},h.transform=function(e,t,n){return r(n)||(n=new h),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=l.getMaximumScale(t)*e.radius,n};var B=new e;h.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,B);return e.magnitudeSquared(r)-t.radius*t.radius},h.transformWithoutScale=function(e,t,n){return r(n)||(n=new h),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var b=new e;h.computePlaneDistances=function(t,n,i,a){r(a)||(a=new s);var o=e.subtract(t.center,n,b),u=e.dot(i,o);return a.start=u-t.radius,a.stop=u+t.radius,a};for(var q=new e,G=new e,W=new e,X=new e,V=new e,H=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var Z=new o;return h.projectTo2D=function(t,r,i){r=n(r,Z);var a=r.ellipsoid,o=t.center,u=t.radius,s=a.geodeticSurfaceNormal(o,q),c=e.cross(e.UNIT_Z,s,G);e.normalize(c,c);var l=e.cross(s,c,W);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var f=e.negate(l,V),d=e.negate(c,X),E=Y,m=E[0];e.add(s,l,m),e.add(m,c,m),m=E[1],e.add(s,l,m),e.add(m,d,m),m=E[2],e.add(s,f,m),e.add(m,d,m), -m=E[3],e.add(s,f,m),e.add(m,c,m),e.negate(s,s),m=E[4],e.add(s,l,m),e.add(m,c,m),m=E[5],e.add(s,l,m),e.add(m,d,m),m=E[6],e.add(s,f,m),e.add(m,d,m),m=E[7],e.add(s,f,m),e.add(m,c,m);for(var p=E.length,_=0;_<p;++_){var y=E[_];e.add(o,y,y);var T=a.cartesianToCartographic(y,H);r.project(T,y)}i=h.fromPoints(E,i),o=i.center;var R=o.x,A=o.y,S=o.z;return o.x=S,o.y=R,o.z=A,i},h.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},h.equals=function(t,n){return t===n||r(t)&&r(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},h.prototype.intersectPlane=function(e){return h.intersectPlane(this,e)},h.prototype.distanceSquaredTo=function(e){return h.distanceSquaredTo(this,e)},h.prototype.computePlaneDistances=function(e,t,n){return h.computePlaneDistances(this,e,t,n)},h.prototype.isOccluded=function(e){return h.isOccluded(this,e)},h.prototype.equals=function(e){return h.equals(this,e)},h.prototype.clone=function(e){return h.clone(this,e)},h}),define("Core/EllipsoidalOccluder",["./BoundingSphere","./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./Rectangle"],function(e,t,n,r,i,a,o){"use strict";function u(e,n){this._ellipsoid=e,this._cameraPosition=new t,this._cameraPositionInScaledSpace=new t,this._distanceToLimbInScaledSpaceSquared=0,r(n)&&(this.cameraPosition=n)}function s(e,n,r){var i=e.transformPositionToScaledSpace(n,E),a=t.magnitudeSquared(i),o=Math.sqrt(a),u=t.divideByScalar(i,o,m);a=Math.max(1,a),o=Math.max(1,o);var s=t.dot(u,r),c=t.magnitude(t.cross(u,r,u)),l=1/o,f=Math.sqrt(a-1)*l;return 1/(s*l-c*f)}function c(e,n,r){if(!(n<=0||n===1/0||n!==n))return t.multiplyByScalar(e,n,r)}function l(e,n){return t.equals(n,t.ZERO)?n:(e.transformPositionToScaledSpace(n,p),t.normalize(p,p))}i(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(e){var n=this._ellipsoid,r=n.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),i=t.magnitudeSquared(r)-1;t.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=r,this._distanceToLimbInScaledSpaceSquared=i}}});var f=new t;u.prototype.isPointVisible=function(e){var t=this._ellipsoid,n=t.transformPositionToScaledSpace(e,f);return this.isScaledSpacePointVisible(n)},u.prototype.isScaledSpacePointVisible=function(e){var n=this._cameraPositionInScaledSpace,r=this._distanceToLimbInScaledSpaceSquared,i=t.subtract(e,n,f),a=-t.dot(i,n),o=r<0?a>0:a>r&&a*a/t.magnitudeSquared(i)>r;return!o},u.prototype.computeHorizonCullingPoint=function(e,n,i){r(i)||(i=new t);for(var a=this._ellipsoid,o=l(a,e),u=0,f=0,h=n.length;f<h;++f){var d=n[f],E=s(a,d,o);u=Math.max(u,E)}return c(o,u,i)};var h=new t;u.prototype.computeHorizonCullingPointFromVertices=function(e,i,a,o,u){r(u)||(u=new t),o=n(o,t.ZERO);for(var f=this._ellipsoid,d=l(f,e),E=0,m=0,p=i.length;m<p;m+=a){h.x=i[m]+o.x,h.y=i[m+1]+o.y,h.z=i[m+2]+o.z;var _=s(f,h,d);E=Math.max(E,_)}return c(d,E,u)};var d=[];u.prototype.computeHorizonCullingPointFromRectangle=function(n,r,i){var a=o.subsample(n,r,0,d),u=e.fromPoints(a);if(!(t.magnitude(u.center)<.1*r.minimumRadius))return this.computeHorizonCullingPoint(u.center,a,i)};var E=new t,m=new t,p=new t;return u}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503};return e(t)}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,n,r,i){"use strict";var a={UNSIGNED_BYTE:i.UNSIGNED_BYTE,UNSIGNED_SHORT:i.UNSIGNED_SHORT,UNSIGNED_INT:i.UNSIGNED_INT};return a.getSizeInBytes=function(e){switch(e){case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},a.validate=function(t){return e(t)&&(t===a.UNSIGNED_BYTE||t===a.UNSIGNED_SHORT||t===a.UNSIGNED_INT)},a.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},a.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)},n(a)}),define("Core/Intersections2D",["./Cartesian3","./defined","./DeveloperError"],function(e,t,n){"use strict";var r={};return r.clipTriangleAtAxisAlignedThreshold=function(e,n,r,i,a,o){t(o)?o.length=0:o=[];var u,s,c;n?(u=r<e,s=i<e,c=a<e):(u=r>e,s=i>e,c=a>e);var l,f,h,d,E,m,p=u+s+c;return 1===p?u?(l=(e-r)/(i-r),f=(e-r)/(a-r),o.push(1),o.push(2),1!==f&&(o.push(-1),o.push(0),o.push(2),o.push(f)),1!==l&&(o.push(-1),o.push(0),o.push(1),o.push(l))):s?(h=(e-i)/(a-i),d=(e-i)/(r-i),o.push(2),o.push(0),1!==d&&(o.push(-1),o.push(1),o.push(0),o.push(d)),1!==h&&(o.push(-1),o.push(1),o.push(2),o.push(h))):c&&(E=(e-a)/(r-a),m=(e-a)/(i-a),o.push(0),o.push(1),1!==m&&(o.push(-1),o.push(2),o.push(1),o.push(m)),1!==E&&(o.push(-1),o.push(2),o.push(0),o.push(E))):2===p?u||r===e?s||i===e?c||a===e||(f=(e-r)/(a-r),h=(e-i)/(a-i),o.push(2),o.push(-1),o.push(0),o.push(2),o.push(f),o.push(-1),o.push(1),o.push(2),o.push(h)):(m=(e-a)/(i-a),l=(e-r)/(i-r),o.push(1),o.push(-1),o.push(2),o.push(1),o.push(m),o.push(-1),o.push(0),o.push(1),o.push(l)):(d=(e-i)/(r-i),E=(e-a)/(r-a),o.push(0),o.push(-1),o.push(1),o.push(0),o.push(d),o.push(-1),o.push(2),o.push(0),o.push(E)):3!==p&&(o.push(0),o.push(1),o.push(2)),o},r.computeBarycentricCoordinates=function(n,r,i,a,o,u,s,c,l){var f=i-s,h=s-o,d=u-c,E=a-c,m=1/(d*f+h*E),p=r-c,_=n-s,y=(d*_+h*p)*m,T=(-E*_+f*p)*m,R=1-y-T;return t(l)?(l.x=y,l.y=T,l.z=R,l):new e(y,T,R)},r}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Intersect"],function(e,t,n,r,i){"use strict";function a(r,i,a){this.minimum=e.clone(t(r,e.ZERO)),this.maximum=e.clone(t(i,e.ZERO)),n(a)?a=e.clone(a):(a=e.add(this.minimum,this.maximum,new e),e.multiplyByScalar(a,.5,a)),this.center=a}a.fromPoints=function(t,r){if(n(r)||(r=new a),!n(t)||0===t.length)return r.minimum=e.clone(e.ZERO,r.minimum),r.maximum=e.clone(e.ZERO,r.maximum),r.center=e.clone(e.ZERO,r.center),r;for(var i=t[0].x,o=t[0].y,u=t[0].z,s=t[0].x,c=t[0].y,l=t[0].z,f=t.length,h=1;h<f;h++){var d=t[h],E=d.x,m=d.y,p=d.z;i=Math.min(E,i),s=Math.max(E,s),o=Math.min(m,o),c=Math.max(m,c),u=Math.min(p,u),l=Math.max(p,l)}var _=r.minimum;_.x=i,_.y=o,_.z=u;var y=r.maximum;y.x=s,y.y=c,y.z=l;var T=e.add(_,y,r.center);return e.multiplyByScalar(T,.5,T),r},a.clone=function(t,r){if(n(t))return n(r)?(r.minimum=e.clone(t.minimum,r.minimum),r.maximum=e.clone(t.maximum,r.maximum),r.center=e.clone(t.center,r.center),r):new a(t.minimum,t.maximum)},a.equals=function(t,r){return t===r||n(t)&&n(r)&&e.equals(t.center,r.center)&&e.equals(t.minimum,r.minimum)&&e.equals(t.maximum,r.maximum)};var o=new e;return a.intersectPlane=function(t,n){o=e.subtract(t.maximum,t.minimum,o);var r=e.multiplyByScalar(o,.5,o),a=n.normal,u=r.x*Math.abs(a.x)+r.y*Math.abs(a.y)+r.z*Math.abs(a.z),s=e.dot(t.center,a)+n.distance;return s-u>0?i.INSIDE:s+u<0?i.OUTSIDE:i.INTERSECTING},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.intersectPlane=function(e){return a.intersectPlane(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function n(e,n,r){var i=e+n;return t.sign(e)!==t.sign(n)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(n)))<r?0:i}var r={};return r.computeDiscriminant=function(e,t,n){var r=t*t-4*e*n;return r},r.computeRealRoots=function(e,r,i){var a;if(0===e)return 0===r?[]:[-i/r];if(0===r){if(0===i)return[0,0];var o=Math.abs(i),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(a=-i/e,a<0)return[];var s=Math.sqrt(a);return[-s,s]}if(0===i)return a=-r/e,a<0?[a,0]:[0,a];var c=r*r,l=4*e*i,f=n(c,-l,t.EPSILON14);if(f<0)return[];var h=-.5*n(r,t.sign(r)*Math.sqrt(f),t.EPSILON14);return r>0?[h/e,i/h]:[i/h,h/e]},r}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function n(e,t,n,r){var i,a,o=e,u=t/3,s=n/3,c=r,l=o*s,f=u*c,h=u*u,d=s*s,E=o*s-h,m=o*c-u*s,p=u*c-d,_=4*E*p-m*m;if(_<0){var y,T,R;h*f>=l*d?(y=o,T=E,R=-2*u*E+o*m):(y=c,T=p,R=-c*m+2*s*p);var A=R<0?-1:1,S=-A*Math.abs(y)*Math.sqrt(-_);a=-R+S;var N=a/2,I=N<0?-Math.pow(-N,1/3):Math.pow(N,1/3),M=a===S?-I:-T/I;return i=T<=0?I+M:-R/(I*I+M*M+T),h*f>=l*d?[(i-u)/o]:[-c/(i+s)]}var g=E,v=-2*u*E+o*m,O=p,x=-c*m+2*s*p,w=Math.sqrt(_),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*w,-v)/3);i=2*Math.sqrt(-g);var U=Math.cos(P);a=i*U;var D=i*(-U/2-C*Math.sin(P)),L=a+D>2*u?a-u:D-u,F=o,z=L/F;P=Math.abs(Math.atan2(c*w,-x)/3),i=2*Math.sqrt(-O),U=Math.cos(P),a=i*U,D=i*(-U/2-C*Math.sin(P));var B=-c,b=a+D<2*s?a+s:D+s,q=B/b,G=F*b,W=-L*b-F*B,X=L*B,V=(s*W-u*X)/(-u*W+s*G);return z<=V?z<=q?V<=q?[z,V,q]:[z,q,V]:[q,z,V]:z<=q?[V,z,q]:V<=q?[V,q,z]:[q,V,z]}var r={};return r.computeDiscriminant=function(e,t,n,r){var i=e*e,a=t*t,o=n*n,u=r*r,s=18*e*t*n*r+a*o-27*i*u-4*(e*o*n+a*t*r);return s},r.computeRealRoots=function(e,r,i,a){var o,u;if(0===e)return t.computeRealRoots(r,i,a);if(0===r){if(0===i){if(0===a)return[0,0,0];u=-a/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===a?(o=t.computeRealRoots(e,0,i),0===o.Length?[0]:[o[0],0,o[1]]):n(e,0,i,a)}return 0===i?0===a?(u=-r/e,u<0?[u,0,0]:[0,0,u]):n(e,r,0,a):0===a?(o=t.computeRealRoots(e,r,i),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):n(e,r,i,a)},r}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,n,r){"use strict";function i(t,i,a,o){var u=t*t,s=i-3*u/8,c=a-i*t/2+u*t/8,l=o-a*t/4+i*u/16-3*u*u/256,f=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(f.length>0){var h=-t/4,d=f[f.length-1];if(Math.abs(d)<n.EPSILON14){var E=r.computeRealRoots(1,s,l);if(2===E.length){var m,p=E[0],_=E[1];if(p>=0&&_>=0){var y=Math.sqrt(p),T=Math.sqrt(_);return[h-T,h-y,h+y,h+T]}if(p>=0&&_<0)return m=Math.sqrt(p),[h-m,h+m];if(p<0&&_>=0)return m=Math.sqrt(_),[h-m,h+m]}return[]}if(d>0){var R=Math.sqrt(d),A=(s+d-c/R)/2,S=(s+d+c/R)/2,N=r.computeRealRoots(1,R,A),I=r.computeRealRoots(1,-R,S);return 0!==N.length?(N[0]+=h,N[1]+=h,0!==I.length?(I[0]+=h,I[1]+=h,N[1]<=I[0]?[N[0],N[1],I[0],I[1]]:I[1]<=N[0]?[I[0],I[1],N[0],N[1]]:N[0]>=I[0]&&N[1]<=I[1]?[I[0],N[0],N[1],I[1]]:I[0]>=N[0]&&I[1]<=N[1]?[N[0],I[0],I[1],N[1]]:N[0]>I[0]&&N[0]<I[1]?[I[0],N[0],I[1],N[1]]:[N[0],I[0],N[1],I[1]]):N):0!==I.length?(I[0]+=h,I[1]+=h,I):[]}}return[]}function a(t,i,a,o){var u=a*a,s=i*i,c=t*t,l=-2*i,f=a*t+s-4*o,h=c*o-a*i*t+u,d=e.computeRealRoots(1,l,f,h);if(d.length>0){var E,m,p=d[0],_=i-p,y=_*_,T=t/2,R=_/2,A=y-4*o,S=y+4*Math.abs(o),N=c-4*p,I=c+4*Math.abs(p);if(p<0||A*I<N*S){var M=Math.sqrt(N);E=M/2,m=0===M?0:(t*R-a)/M}else{var g=Math.sqrt(A);E=0===g?0:(t*R-a)/g,m=g/2}var v,O;0===T&&0===E?(v=0,O=0):n.sign(T)===n.sign(E)?(v=T+E,O=p/v):(O=T-E,v=p/O);var x,w;0===R&&0===m?(x=0,w=0):n.sign(R)===n.sign(m)?(x=R+m,w=o/x):(w=R-m,x=o/w);var C=r.computeRealRoots(1,v,x),P=r.computeRealRoots(1,O,w);if(0!==C.length)return 0!==P.length?C[1]<=P[0]?[C[0],C[1],P[0],P[1]]:P[1]<=C[0]?[P[0],P[1],C[0],C[1]]:C[0]>=P[0]&&C[1]<=P[1]?[P[0],C[0],C[1],P[1]]:P[0]>=C[0]&&P[1]<=C[1]?[C[0],P[0],P[1],C[1]]:C[0]>P[0]&&C[0]<P[1]?[P[0],C[0],P[1],C[1]]:[C[0],P[0],C[1],P[1]]:C;if(0!==P.length)return P}return[]}var o={};return o.computeDiscriminant=function(e,t,n,r,i){var a=e*e,o=a*e,u=t*t,s=u*t,c=n*n,l=c*n,f=r*r,h=f*r,d=i*i,E=d*i,m=u*c*f-4*s*h-4*e*l*f+18*e*t*n*h-27*a*f*f+256*o*E+i*(18*s*n*r-4*u*l+16*e*c*c-80*e*t*c*r-6*e*u*f+144*a*n*f)+d*(144*e*u*n-27*u*u-128*a*c-192*a*t*r);return m},o.computeRealRoots=function(t,r,o,u,s){if(Math.abs(t)<n.EPSILON15)return e.computeRealRoots(r,o,u,s);var c=r/t,l=o/t,f=u/t,h=s/t,d=c<0?1:0;switch(d+=l<0?d+1:d,d+=f<0?d+1:d,d+=h<0?d+1:d){case 0:return i(c,l,f,h);case 1:return a(c,l,f,h);case 2:return a(c,l,f,h);case 3:return i(c,l,f,h);case 4:return i(c,l,f,h);case 5:return a(c,l,f,h);case 6:return i(c,l,f,h);case 7:return i(c,l,f,h);case 8:return a(c,l,f,h);case 9:return i(c,l,f,h);case 10:return i(c,l,f,h);case 11:return a(c,l,f,h);case 12:return i(c,l,f,h);case 13:return i(c,l,f,h);case 14:return i(c,l,f,h);case 15:return i(c,l,f,h);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function i(n,r){r=e.clone(t(r,e.ZERO)),e.equals(r,e.ZERO)||e.normalize(r,r),this.origin=e.clone(t(n,e.ZERO)),this.direction=r}return i.getPoint=function(t,r,i){return n(i)||(i=new e),i=e.multiplyByScalar(t.direction,r,i),e.add(t.origin,i,i)},i}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,n,r,i,a,o,u,s,c){"use strict";function l(e,t,n,r){var i=t*t-4*e*n;if(!(i<0)){if(i>0){var a=1/(2*e),o=Math.sqrt(i),u=(-t+o)*a,s=(-t-o)*a;return u<s?(r.root0=u,r.root1=s):(r.root0=s,r.root1=u),r}var c=-t/(2*e);if(0!==c)return r.root0=r.root1=c,r}}function f(t,n,i){r(i)||(i={});var a=t.origin,o=t.direction,u=n.center,s=n.radius*n.radius,c=e.subtract(a,u,_),f=e.dot(o,o),h=2*e.dot(o,c),d=e.magnitudeSquared(c)-s,E=l(f,h,d,A);if(r(E))return i.start=E.root0,i.stop=E.root1,i}function h(e,t,n){var r=e+t;return a.sign(e)!==a.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))<n?0:r}function d(t,n,r,i,c){var l,f=i*i,d=c*c,E=(t[o.COLUMN1ROW1]-t[o.COLUMN2ROW2])*d,m=c*(i*h(t[o.COLUMN1ROW0],t[o.COLUMN0ROW1],a.EPSILON15)+n.y),p=t[o.COLUMN0ROW0]*f+t[o.COLUMN2ROW2]*d+i*n.x+r,_=d*h(t[o.COLUMN2ROW1],t[o.COLUMN1ROW2],a.EPSILON15),y=c*(i*h(t[o.COLUMN2ROW0],t[o.COLUMN0ROW2])+n.z),T=[];if(0===y&&0===_){if(l=u.computeRealRoots(E,m,p),0===l.length)return T;var R=l[0],A=Math.sqrt(Math.max(1-R*R,0));if(T.push(new e(i,c*R,c*-A)),T.push(new e(i,c*R,c*A)),2===l.length){var S=l[1],N=Math.sqrt(Math.max(1-S*S,0));T.push(new e(i,c*S,c*-N)),T.push(new e(i,c*S,c*N))}return T}var I=y*y,M=_*_,g=E*E,v=y*_,O=g+M,x=2*(m*E+v),w=2*p*E+m*m-M+I,C=2*(p*m-v),P=p*p-I;if(0===O&&0===x&&0===w&&0===C)return T;l=s.computeRealRoots(O,x,w,C,P);var U=l.length;if(0===U)return T;for(var D=0;D<U;++D){var L,F=l[D],z=F*F,B=Math.max(1-z,0),b=Math.sqrt(B);L=a.sign(E)===a.sign(p)?h(E*z+p,m*F,a.EPSILON12):a.sign(p)===a.sign(m*F)?h(E*z,m*F+p,a.EPSILON12):h(E*z+m*F,p,a.EPSILON12);var q=h(_*F,y,a.EPSILON15),G=L*q;G<0?T.push(new e(i,c*F,c*b)):G>0?T.push(new e(i,c*F,c*-b)):0!==b?(T.push(new e(i,c*F,c*-b)),T.push(new e(i,c*F,c*b)),++D):T.push(new e(i,c*F,c*b))}return T}var E={};E.rayPlane=function(t,n,i){r(i)||(i=new e);var o=t.origin,u=t.direction,s=n.normal,c=e.dot(s,u);if(!(Math.abs(c)<a.EPSILON15)){var l=(-n.distance-e.dot(s,o))/c;if(!(l<0))return i=e.multiplyByScalar(u,l,i),e.add(o,i,i)}};var m=new e,p=new e,_=new e,y=new e,T=new e;E.rayTriangleParametric=function(t,r,i,o,u){u=n(u,!1);var s,c,l,f,h,d=t.origin,E=t.direction,R=e.subtract(i,r,m),A=e.subtract(o,r,p),S=e.cross(E,A,_),N=e.dot(R,S);if(u){if(N<a.EPSILON6)return;if(s=e.subtract(d,r,y),l=e.dot(s,S),l<0||l>N)return;if(c=e.cross(s,R,T),f=e.dot(E,c),f<0||l+f>N)return;h=e.dot(A,c)/N}else{if(Math.abs(N)<a.EPSILON6)return;var I=1/N;if(s=e.subtract(d,r,y),l=e.dot(s,S)*I,l<0||l>1)return;if(c=e.cross(s,R,T),f=e.dot(E,c)*I,f<0||l+f>1)return;h=e.dot(A,c)*I}return h},E.rayTriangle=function(t,n,i,a,o,u){var s=E.rayTriangleParametric(t,n,i,a,o);if(r(s)&&!(s<0))return r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var R=new c;E.lineSegmentTriangle=function(t,n,i,a,o,u,s){var c=R;e.clone(t,c.origin),e.subtract(n,t,c.direction),e.normalize(c.direction,c.direction);var l=E.rayTriangleParametric(c,i,a,o,u);if(!(!r(l)||l<0||l>e.distance(t,n)))return r(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var A={root0:0,root1:0};E.raySphere=function(e,t,n){if(n=f(e,t,n),r(n)&&!(n.stop<0))return n.start=Math.max(n.start,0),n};var S=new c;E.lineSegmentSphere=function(t,n,i,a){var o=S;e.clone(t,o.origin);var u=e.subtract(n,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),a=f(o,i,a),!(!r(a)||a.stop<0||a.start>s))return a.start=Math.max(a.start,0),a.stop=Math.min(a.stop,s),a};var N=new e,I=new e;E.rayEllipsoid=function(t,n){var r,i,a,o,u,s=n.oneOverRadii,c=e.multiplyComponents(s,t.origin,N),l=e.multiplyComponents(s,t.direction,I),f=e.magnitudeSquared(c),h=e.dot(c,l);if(f>1){if(h>=0)return;var d=h*h;if(r=f-1,i=e.magnitudeSquared(l),a=i*r,d<a)return;if(d>a){o=h*h-a,u=-h+Math.sqrt(o);var E=u/i,m=r/u;return E<m?{start:E,stop:m}:{start:m,stop:E}}var p=Math.sqrt(r/i);return{start:p,stop:p}}return f<1?(r=f-1,i=e.magnitudeSquared(l),a=i*r,o=h*h-a,u=-h+Math.sqrt(o),{start:0,stop:u/i}):h<0?(i=e.magnitudeSquared(l),{start:0,stop:-h/i}):void 0};var M=new e,g=new e,v=new e,O=new e,x=new e,w=new o,C=new o,P=new o,U=new o,D=new o,L=new o,F=new o,z=new e,B=new e,b=new t;E.grazingAltitudeLocation=function(t,n){var i=t.origin,u=t.direction;if(!e.equals(i,e.ZERO)){var s=n.geodeticSurfaceNormal(i,M);if(e.dot(u,s)>=0)return i}var c=r(this.rayEllipsoid(t,n)),l=n.transformPositionToScaledSpace(u,M),f=e.normalize(l,l),h=e.mostOrthogonalAxis(l,O),E=e.normalize(e.cross(h,f,g),g),m=e.normalize(e.cross(f,E,v),v),p=w;p[0]=f.x,p[1]=f.y,p[2]=f.z,p[3]=E.x,p[4]=E.y,p[5]=E.z,p[6]=m.x,p[7]=m.y,p[8]=m.z;var _=o.transpose(p,C),y=o.fromScale(n.radii,P),T=o.fromScale(n.oneOverRadii,U),R=D;R[0]=0,R[1]=-u.z,R[2]=u.y,R[3]=u.z,R[4]=0,R[5]=-u.x,R[6]=-u.y,R[7]=u.x,R[8]=0;var A,S,N=o.multiply(o.multiply(_,T,L),R,L),I=o.multiply(o.multiply(N,y,F),p,F),q=o.multiplyByVector(N,i,x),G=d(I,e.negate(q,M),0,0,1),W=G.length;if(W>0){for(var X=e.clone(e.ZERO,B),V=Number.NEGATIVE_INFINITY,H=0;H<W;++H){A=o.multiplyByVector(y,o.multiplyByVector(p,G[H],z),z);var Y=e.normalize(e.subtract(A,i,O),O),k=e.dot(Y,u);k>V&&(V=k,X=e.clone(A,X))}var Z=n.cartesianToCartographic(X,b);return V=a.clamp(V,0,1),S=e.magnitude(e.subtract(X,i,O))*Math.sqrt(1-V*V),S=c?-S:S,Z.height=S,n.cartographicToCartesian(Z,new e)}};var q=new e;return E.lineSegmentPlane=function(t,n,i,o){r(o)||(o=new e);var u=e.subtract(n,t,q),s=i.normal,c=e.dot(s,u);if(!(Math.abs(c)<a.EPSILON6)){var l=e.dot(s,t),f=-(i.distance+l)/c;if(!(f<0||f>1))return e.multiplyByScalar(u,f,o),e.add(t,o,o),o}},E.trianglePlaneIntersection=function(t,n,r,i){var a=i.normal,o=i.distance,u=e.dot(a,t)+o<0,s=e.dot(a,n)+o<0,c=e.dot(a,r)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var f,h;if(1!==l&&2!==l||(f=new e,h=new e),1===l){if(u)return E.lineSegmentPlane(t,n,i,f),E.lineSegmentPlane(t,r,i,h),{positions:[t,n,r,f,h],indices:[0,3,4,1,2,4,1,4,3]};if(s)return E.lineSegmentPlane(n,r,i,f),E.lineSegmentPlane(n,t,i,h),{positions:[t,n,r,f,h],indices:[1,3,4,2,0,4,2,4,3]};if(c)return E.lineSegmentPlane(r,t,i,f),E.lineSegmentPlane(r,n,i,h),{positions:[t,n,r,f,h],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return E.lineSegmentPlane(n,t,i,f),E.lineSegmentPlane(r,t,i,h),{positions:[t,n,r,f,h],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return E.lineSegmentPlane(r,n,i,f),E.lineSegmentPlane(t,n,i,h),{positions:[t,n,r,f,h],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return E.lineSegmentPlane(t,r,i,f),E.lineSegmentPlane(n,r,i,h),{positions:[t,n,r,f,h],indices:[0,1,4,0,4,3,2,3,4]}}},E}), -define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";function i(t,n){this.normal=e.clone(t),this.distance=n}i.fromPointNormal=function(n,r,a){var o=-e.dot(r,n);return t(a)?(e.clone(r,a.normal),a.distance=o,a):new i(r,o)};var a=new e;return i.fromCartesian4=function(n,r){var o=e.fromCartesian4(n,a),u=n.w;return t(r)?(e.clone(o,r.normal),r.distance=u,r):new i(o,u)},i.getPointDistance=function(t,n){return e.dot(t.normal,n)+t.distance},i.ORIGIN_XY_PLANE=r(new i(e.UNIT_Z,0)),i.ORIGIN_YZ_PLANE=r(new i(e.UNIT_X,0)),i.ORIGIN_ZX_PLANE=r(new i(e.UNIT_Y,0)),i}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,n,r,i){return t(e).then(n,r,i)}function t(e){var t,n;return e instanceof r?t=e:u(e)?(n=o(),e.then(function(e){n.resolve(e)},function(e){n.reject(e)},function(e){n.progress(e)}),t=n.promise):t=i(e),t}function n(t){return e(t,a)}function r(e){this.then=e}function i(e){var n=new r(function(n){try{return t(n?n(e):e)}catch(e){return a(e)}});return n}function a(e){var n=new r(function(n,r){try{return r?t(r(e)):a(e)}catch(e){return a(e)}});return n}function o(){function e(e,t,n){return h(e,t,n)}function n(e){return E(e)}function i(e){return E(a(e))}function u(e){return d(e)}var s,c,l,f,h,d,E;return c=new r(e),s={then:e,resolve:n,reject:i,progress:u,promise:c,resolver:{resolve:n,reject:i,progress:u}},l=[],f=[],h=function(e,t,n){var r,i;return r=o(),i="function"==typeof n?function(e){try{r.progress(n(e))}catch(e){r.progress(e)}}:function(e){r.progress(e)},l.push(function(n){n.then(e,t).then(r.resolve,r.reject,i)}),f.push(i),r.promise},d=function(e){return m(f,e),e},E=function(e){return e=t(e),h=e.then,E=t,d=_,m(l,e),f=l=A,e},s}function u(e){return e&&"function"==typeof e.then}function s(t,n,r,i,a){return p(2,arguments),e(t,function(t){function u(e){m(e)}function s(e){E(e)}var c,l,f,h,d,E,m,p,y,T;if(y=t.length>>>0,c=Math.max(0,Math.min(n,y)),f=[],l=y-c+1,h=[],d=o(),c)for(p=d.progress,m=function(e){h.push(e),--l||(E=m=_,d.reject(h))},E=function(e){f.push(e),--c||(E=m=_,d.resolve(f))},T=0;T<y;++T)T in t&&e(t[T],s,u,p);else d.resolve(f);return d.then(r,i,a)})}function c(e,t,n,r){function i(e){return t?t(e[0]):e[0]}return s(e,1,i,n,r)}function l(e,t,n,r){return p(1,arguments),h(e,y).then(t,n,r)}function f(){return h(arguments,y)}function h(t,n){return e(t,function(t){var r,i,a,u,s,c;if(a=i=t.length>>>0,r=[],c=o(),a)for(u=function(t,i){e(t,n).then(function(e){r[i]=e,--a||c.resolve(r)},c.reject)},s=0;s<i;s++)s in t?u(t[s],s):--a;else c.resolve(r);return c.promise})}function d(t,n){var r=R.call(arguments,1);return e(t,function(t){var i;return i=t.length,r[0]=function(t,r,a){return e(t,function(t){return e(r,function(e){return n(t,e,a,i)})})},T.apply(t,r)})}function E(t,n,r){var i=arguments.length>2;return e(t,function(e){return e=i?r:e,n.resolve(e),e},function(e){return n.reject(e),a(e)},n.progress)}function m(e,t){for(var n,r=0;n=e[r++];)n(t)}function p(e,t){for(var n,r=t.length;r>e;)if(n=t[--r],null!=n&&"function"!=typeof n)throw new Error("arg "+r+" must be a function")}function _(){}function y(e){return e}var T,R,A;return e.defer=o,e.resolve=t,e.reject=n,e.join=f,e.all=l,e.map=h,e.reduce=d,e.any=c,e.some=s,e.chain=E,e.isPromise=u,r.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(A,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return l(t,function(t){return e.apply(A,t)})})}},R=[].slice,T=[].reduce||function(e){var t,n,r,i,a;if(a=0,t=Object(this),i=t.length>>>0,n=arguments,n.length<=1)for(;;){if(a in t){r=t[a++];break}if(++a>=i)throw new TypeError}else r=n[1];for(;a<i;++a)a in t&&(r=e(r,t[a],a,t));return r},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n,r){t(i[n])||(i[n]=!0,console.log(e(r,n)))}var i={};return r.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.",r}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,n){"use strict";function r(e,t){n(e,t)}return r}),define("Core/binarySearch",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e,t,n){for(var r,i,a=0,o=e.length-1;a<=o;)if(r=~~((a+o)/2),i=n(e[r],t),i<0)a=r+1;else{if(!(i>0))return r;o=r-1}return~(o+1)}return n}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,n,r,i){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=r,this.ut1MinusUtc=i}return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,n=0,r=t[n++],i=function(e,t,n,r){n||(n=" ");var i=e.length>=t?"":Array(1+t-e.length>>>0).join(n);return r?e+i:i+e},a=function(e,t,n,r,a,o){var u=r-e.length;return u>0&&(e=n||!a?i(e,r,o,n):e.slice(0,t.length)+i("",u,"0",!0)+e.slice(t.length)),e},o=function(e,t,n,r,o,u,s){var c=e>>>0;return n=n&&c&&{2:"0b",8:"0",16:"0x"}[t]||"",e=n+i(c.toString(t),u||0,"0",!1),a(e,n,r,o,s)},u=function(e,t,n,r,i,o){return null!=r&&(e=e.slice(0,r)),a(e,"",t,n,i,o)},s=function(e,r,s,c,l,f,h){var d,E,m,p,_;if("%%"==e)return"%";for(var y=!1,T="",R=!1,A=!1,S=" ",N=s.length,I=0;s&&I<N;I++)switch(s.charAt(I)){case" ":T=" ";break;case"+":T="+";break;case"-":y=!0;break;case"'":S=s.charAt(I+1);break;case"0":R=!0;break;case"#":A=!0}if(c=c?"*"==c?+t[n++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,c<0&&(c=-c,y=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(f=f?"*"==f?+t[n++]:"*"==f.charAt(0)?+t[f.slice(1,-1)]:+f:"fFeE".indexOf(h)>-1?6:"d"==h?0:void 0,_=r?t[r.slice(0,-1)]:t[n++],h){case"s":return u(String(_),y,c,f,R,S);case"c":return u(String.fromCharCode(+_),y,c,f,R);case"b":return o(_,2,A,y,c,f,R);case"o":return o(_,8,A,y,c,f,R);case"x":return o(_,16,A,y,c,f,R);case"X":return o(_,16,A,y,c,f,R).toUpperCase();case"u":return o(_,10,A,y,c,f,R);case"i":case"d":return d=+_||0,d=Math.round(d-d%1),E=d<0?"-":T,_=E+i(String(Math.abs(d)),f,"0",!1),a(_,E,y,c,R);case"e":case"E":case"f":case"F":case"g":case"G":return d=+_,E=d<0?"-":T,m=["toExponential","toFixed","toPrecision"]["efg".indexOf(h.toLowerCase())],p=["toString","toUpperCase"]["eEfFgG".indexOf(h)%2],_=E+Math.abs(d)[m](f),a(_,E,y,c,R)[p]();default:return e}};return r.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,n,r,i,a,o,u){this.year=e,this.month=t,this.day=n,this.hour=r,this.minute=i,this.second=a,this.millisecond=o,this.isLeapSecond=u}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e(t)}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,n,r,i,a,o,u,s,c){"use strict";function l(e,t){return m.compare(e.julianDate,t.julianDate)}function f(e){T.julianDate=e;var n=m.leapSeconds,r=t(n,T,l);r<0&&(r=~r),r>=n.length&&(r=n.length-1);var i=n[r].offset;if(r>0){var a=m.secondsDifference(n[r].julianDate,e);a>i&&(r--,i=n[r].offset)}m.addSeconds(e,i,e)}function h(e,n){T.julianDate=e;var r=m.leapSeconds,i=t(r,T,l);if(i<0&&(i=~i),0===i)return m.addSeconds(e,-r[0].offset,n);if(i>=r.length)return m.addSeconds(e,-r[i-1].offset,n);var a=m.secondsDifference(r[i].julianDate,e);return 0===a?m.addSeconds(e,-r[i].offset,n):a<=1?void 0:m.addSeconds(e,-r[--i].offset,n)}function d(e,t,n){var r=t/s.SECONDS_PER_DAY|0;return e+=r,t-=s.SECONDS_PER_DAY*r,t<0&&(e--,t+=s.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function E(e,t,n,r,i,a,o){var u=(t-14)/12|0,c=e+4800+u,l=(1461*c/4|0)+(367*(t-2-12*u)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;r-=12,r<0&&(r+=24);var f=a+(r*s.SECONDS_PER_HOUR+i*s.SECONDS_PER_MINUTE+o*s.SECONDS_PER_MILLISECOND);return f>=43200&&(l-=1),[l,f]}function m(e,t,r){this.dayNumber=void 0,this.secondsOfDay=void 0,e=n(e,0),t=n(t,0),r=n(r,c.UTC);var i=0|e;t+=(e-i)*s.SECONDS_PER_DAY,d(i,t,this),r===c.UTC&&f(this)}var p=new a,_=[31,28,31,30,31,30,31,31,30,31,30,31],y=29,T=new u,R=/^(\d{4})$/,A=/^(\d{4})-(\d{2})$/,S=/^(\d{4})-?(\d{3})$/,N=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,I=/^(\d{4})-?(\d{2})-?(\d{2})$/,M=/([Z+\-])?(\d{2})?:?(\d{2})?$/,g=/^(\d{2})(\.\d+)?/.source+M.source,v=/^(\d{2}):?(\d{2})(\.\d+)?/.source+M.source,O=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+M.source;m.fromDate=function(e,t){var n=E(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r(t)?(d(n[0],n[1],t),f(t),t):new m(n[0],n[1],c.UTC)},m.fromIso8601=function(e,t){e=e.replace(",",".");var n,i,a,u=e.split("T"),s=1,l=1,h=0,p=0,T=0,M=0,x=u[0],w=u[1];if(u=x.match(I),null!==u)n=+u[1],s=+u[2],l=+u[3];else if(u=x.match(A),null!==u)n=+u[1],s=+u[2];else if(u=x.match(R),null!==u)n=+u[1];else{var C;if(u=x.match(S),null!==u)n=+u[1],C=+u[2],a=o(n);else if(u=x.match(N),null!==u){n=+u[1];var P=+u[2],U=+u[3]||0,D=new Date(Date.UTC(n,0,4));C=7*P+U-D.getUTCDay()-3}i=new Date(Date.UTC(n,0,1)),i.setUTCDate(C),s=i.getUTCMonth()+1,l=i.getUTCDate()}a=o(n);var L;if(r(w)){u=w.match(O),null!==u?(h=+u[1],p=+u[2],T=+u[3],M=1e3*+(u[4]||0),L=5):(u=w.match(v),null!==u?(h=+u[1],p=+u[2],T=60*+(u[3]||0),L=4):(u=w.match(g),null!==u&&(h=+u[1],p=60*+(u[2]||0),L=3)));var F=u[L],z=+u[L+1],B=+(u[L+2]||0);switch(F){case"+":h-=z,p-=B;break;case"-":h+=z,p+=B;break;case"Z":break;default:p+=new Date(Date.UTC(n,s-1,l,h,p)).getTimezoneOffset()}}else p+=new Date(n,s-1,l).getTimezoneOffset();var b=60===T;for(b&&T--;p>=60;)p-=60,h++;for(;h>=24;)h-=24,l++;for(i=a&&2===s?y:_[s-1];l>i;)l-=i,s++,s>12&&(s-=12,n++),i=a&&2===s?y:_[s-1];for(;p<0;)p+=60,h--;for(;h<0;)h+=24,l--;for(;l<1;)s--,s<1&&(s+=12,n--),i=a&&2===s?y:_[s-1],l+=i;var q=E(n,s,l,h,p,T,M);return r(t)?(d(q[0],q[1],t),f(t)):t=new m(q[0],q[1],c.UTC),b&&m.addSeconds(t,1,t),t},m.now=function(e){return m.fromDate(new Date,e)};var x=new m(0,0,c.TAI);return m.toGregorianDate=function(e,t){var n=!1,i=h(e,x);r(i)||(m.addSeconds(e,-1,x),i=h(x,x),n=!0);var o=i.dayNumber,u=i.secondsOfDay;u>=43200&&(o+=1);var c=o+68569|0,l=4*c/146097|0;c=c-((146097*l+3)/4|0)|0;var f=4e3*(c+1)/1461001|0;c=c-(1461*f/4|0)+31|0;var d=80*c/2447|0,E=c-(2447*d/80|0)|0;c=d/11|0;var p=d+2-12*c|0,_=100*(l-49)+f+c|0,y=u/s.SECONDS_PER_HOUR|0,T=u-y*s.SECONDS_PER_HOUR,R=T/s.SECONDS_PER_MINUTE|0;T-=R*s.SECONDS_PER_MINUTE;var A=0|T,S=(T-A)/s.SECONDS_PER_MILLISECOND;return y+=12,y>23&&(y-=24),n&&(A+=1),r(t)?(t.year=_,t.month=p,t.day=E,t.hour=y,t.minute=R,t.second=A,t.millisecond=S,t.isLeapSecond=n,t):new a(_,p,E,y,R,A,S,n)},m.toDate=function(e){var t=m.toGregorianDate(e,p),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))},m.toIso8601=function(t,n){var i,a=m.toGregorianDate(t,a);return r(n)||0===a.millisecond?r(n)&&0!==n?(i=(.01*a.millisecond).toFixed(n).replace(".","").slice(0,n),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",a.year,a.month,a.day,a.hour,a.minute,a.second,i)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",a.year,a.month,a.day,a.hour,a.minute,a.second):(i=(.01*a.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",a.year,a.month,a.day,a.hour,a.minute,a.second,i))},m.clone=function(e,t){if(r(e))return r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new m(e.dayNumber,e.secondsOfDay,c.TAI)},m.compare=function(e,t){var n=e.dayNumber-t.dayNumber;return 0!==n?n:e.secondsOfDay-t.secondsOfDay},m.equals=function(e,t){return e===t||r(e)&&r(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},m.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(m.secondsDifference(e,t))<=n},m.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},m.secondsDifference=function(e,t){var n=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return n+(e.secondsOfDay-t.secondsOfDay)},m.daysDifference=function(e,t){var n=e.dayNumber-t.dayNumber,r=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return n+r},m.computeTaiMinusUtc=function(e){T.julianDate=e;var n=m.leapSeconds,r=t(n,T,l);return r<0&&(r=~r,--r,r<0&&(r=0)),n[r].offset},m.addSeconds=function(e,t,n){return d(e.dayNumber,e.secondsOfDay+t,n)},m.addMinutes=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return d(e.dayNumber,r,n)},m.addHours=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return d(e.dayNumber,r,n)},m.addDays=function(e,t,n){var r=e.dayNumber+t;return d(r,e.secondsOfDay,n)},m.lessThan=function(e,t){return m.compare(e,t)<0},m.lessThanOrEquals=function(e,t){return m.compare(e,t)<=0},m.greaterThan=function(e,t){return m.compare(e,t)>0},m.greaterThanOrEquals=function(e,t){return m.compare(e,t)>=0},m.prototype.clone=function(e){return m.clone(this,e)},m.prototype.equals=function(e){return m.equals(this,e)},m.prototype.equalsEpsilon=function(e,t){return m.equalsEpsilon(this,e,t)},m.prototype.toString=function(){return m.toIso8601(this)},m.leapSeconds=[new u(new m(2441317,43210,c.TAI),10),new u(new m(2441499,43211,c.TAI),11),new u(new m(2441683,43212,c.TAI),12),new u(new m(2442048,43213,c.TAI),13),new u(new m(2442413,43214,c.TAI),14),new u(new m(2442778,43215,c.TAI),15),new u(new m(2443144,43216,c.TAI),16),new u(new m(2443509,43217,c.TAI),17),new u(new m(2443874,43218,c.TAI),18),new u(new m(2444239,43219,c.TAI),19),new u(new m(2444786,43220,c.TAI),20),new u(new m(2445151,43221,c.TAI),21),new u(new m(2445516,43222,c.TAI),22),new u(new m(2446247,43223,c.TAI),23),new u(new m(2447161,43224,c.TAI),24),new u(new m(2447892,43225,c.TAI),25),new u(new m(2448257,43226,c.TAI),26),new u(new m(2448804,43227,c.TAI),27),new u(new m(2449169,43228,c.TAI),28),new u(new m(2449534,43229,c.TAI),29),new u(new m(2450083,43230,c.TAI),30),new u(new m(2450630,43231,c.TAI),31),new u(new m(2451179,43232,c.TAI),32),new u(new m(2453736,43233,c.TAI),33),new u(new m(2454832,43234,c.TAI),34),new u(new m(2456109,43235,c.TAI),35),new u(new m(2457204,43236,c.TAI),36),new u(new m(2457754,43237,c.TAI),37)],m}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(n,r){if(null===n||"object"!=typeof n)return n;r=e(r,!1);var i=new n.constructor;for(var a in n)if(n.hasOwnProperty(a)){var o=n[a];r&&(o=t(o,r)),i[a]=o}return i}return t}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var n=e.split("\r\n"),r=0;r<n.length;++r){var i=n[r],a=i.indexOf(": ");if(a>0){var o=i.substring(0,a),u=i.substring(a+2);t[o]=u}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function n(e,n,r){this.statusCode=e,this.response=n,this.responseHeaders=r,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return n.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},n}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var n=r.exec(t);this.scheme=n[1],this.authority=n[2],this.path=n[3],this.query=n[4],this.fragment=n[5]}}function t(e){var t=unescape(e);return a.test(t)?t:e.toUpperCase()}function n(e,t,n,r){return(t||"")+n.toLowerCase()+(r||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var r=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(o,n).replace(i,t)),this.path&&(this.path=this.path.replace(i,t)),this.query&&(this.query=this.query.replace(i,t)),this.fragment&&(this.fragment=this.fragment.replace(i,t))};var i=/%[0-9a-z]{2}/gi,a=/[a-zA-Z0-9\-\._~]/,o=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var n=new e;return this.scheme?(n.scheme=this.scheme,n.authority=this.authority,n.path=this.path,n.query=this.query):(n.scheme=t.scheme,this.authority?(n.authority=this.authority,n.path=this.path,n.query=this.query):(n.authority=t.authority,""==this.path?(n.path=t.path,n.query=this.query||t.query):("/"==this.path.charAt(0)?(n.path=this.path,n.removeDotSegments()):(t.authority&&""==t.path?n.path="/"+this.path:n.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,n.removeDotSegments()),n.query=this.query))),n.fragment=this.fragment,n},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),n=[],r=""==t[0];r&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?n.pop():"."!=e&&n.push(e);"."!=e&&".."!=e||n.push(""),r&&n.unshift(""),this.path=n.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n){var r=new e(n);r.normalize();var i=r.getAuthority();if(t(i)){if(i.indexOf("@")!==-1){var a=i.split("@");i=a[1]}if(i.indexOf(":")===-1){var o=r.getScheme();if(t(o)||(o=window.location.protocol,o=o.substring(0,o.length-1)),"http"===o)i+=":80";else{if("https"!==o)return;i+=":443"}}return i}}var i={},a={};return i.add=function(e,n){var r=e.toLowerCase()+":"+n;t(a[r])||(a[r]=!0)},i.remove=function(e,n){var r=e.toLowerCase()+":"+n;t(a[r])&&delete a[r]},i.contains=function(e){var n=r(e);return!(!t(n)||!t(a[n]))},i.clear=function(){a={}},i}),define("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,n,r,i,a,o){"use strict";function u(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,i=t(n.method,"GET"),a=n.data,o=n.headers,s=n.overrideMimeType;return e(n.url,function(t){var n=e.defer();return u.load(t,r,i,a,o,n,s),n.promise})}function s(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function c(e,t){for(var n=s(e,t),r=new ArrayBuffer(n.length),i=new Uint8Array(r),a=0;a<n.length;a++)i[a]=n.charCodeAt(a);return r}function l(e,n){n=t(n,"");var r=e[1],i=!!e[2],a=e[3];switch(n){case"":case"text":return s(i,a);case"arraybuffer":return c(i,a);case"blob":var o=c(i,a);return new Blob([o],{type:r});case"document":var u=new DOMParser;return u.parseFromString(s(i,a),r);case"json":return JSON.parse(s(i,a))}}var f=/^data:(.*?)(;base64)?,(.*)$/;return u.load=function(e,t,r,u,s,c,h){var d=f.exec(e);if(null!==d)return void c.resolve(l(d,t));var E=new XMLHttpRequest;if(o.contains(e)&&(E.withCredentials=!0),n(h)&&n(E.overrideMimeType)&&E.overrideMimeType(h),E.open(r,e,!0),n(s))for(var m in s)s.hasOwnProperty(m)&&E.setRequestHeader(m,s[m]);n(t)&&(E.responseType=t),E.onload=function(){if(E.status<200||E.status>=300)return void c.reject(new i(E.status,E.response,E.getAllResponseHeaders()));var e=E.response,r=E.responseType;if(!n(e)||n(t)&&r!==t)if("json"===t&&"string"==typeof e)try{c.resolve(JSON.parse(e))}catch(e){c.reject(e)}else(""===r||"document"===r)&&n(E.responseXML)&&E.responseXML.hasChildNodes()?c.resolve(E.responseXML):""!==r&&"text"!==r||!n(E.responseText)?c.reject(new a("Invalid XMLHttpRequest response type.")):c.resolve(E.responseText);else c.resolve(e)},E.onerror=function(e){c.reject(new i)},E.send(u)},u.defaultLoad=u.load,u}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,n){return e({url:t,headers:n})}return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";function i(n,i){return t(i)?t(i.Accept)||(i=e(i),i.Accept=a.Accept):i=a,r(n,i).then(function(e){return JSON.parse(e)})}var a={Accept:"application/json,*/*;q=0.01"};return i}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,n,r,i,a,o,u,s,c,l,f){"use strict";function h(t){if(t=n(t,n.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=n(t.addNewLeapSeconds,!0),r(t.data))E(this,t.data);else if(r(t.url)){var i=this;this._downloadPromise=e(s(t.url),function(e){E(i,e)},function(){i._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else E(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function d(e,t){return o.compare(e.julianDate,t)}function E(e,n){if(!r(n.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!r(n.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var i=n.columnNames.indexOf("modifiedJulianDateUtc"),a=n.columnNames.indexOf("xPoleWanderRadians"),s=n.columnNames.indexOf("yPoleWanderRadians"),c=n.columnNames.indexOf("ut1MinusUtcSeconds"),h=n.columnNames.indexOf("xCelestialPoleOffsetRadians"),E=n.columnNames.indexOf("yCelestialPoleOffsetRadians"),m=n.columnNames.indexOf("taiMinusUtcSeconds");if(i<0||a<0||s<0||c<0||h<0||E<0||m<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var p=e._samples=n.samples,_=e._dates=[];e._dateColumn=i,e._xPoleWanderRadiansColumn=a,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=h,e._yCelestialPoleOffsetRadiansColumn=E,e._taiMinusUtcSecondsColumn=m,e._columnCount=n.columnNames.length,e._lastIndex=void 0;for(var y,T=e._addNewLeapSeconds,R=0,A=p.length;R<A;R+=e._columnCount){var S=p[R+i],N=p[R+m],I=S+l.MODIFIED_JULIAN_DATE_DIFFERENCE,M=new o(I,N,f.TAI);if(_.push(M),T){if(N!==y&&r(y)){var g=o.leapSeconds,v=t(g,M,d);if(v<0){var O=new u(M,N);g.splice(~v,0,O)}}y=N}}}function m(e,t,n,r,i){var a=n*r;i.xPoleWander=t[a+e._xPoleWanderRadiansColumn],i.yPoleWander=t[a+e._yPoleWanderRadiansColumn],i.xPoleOffset=t[a+e._xCelestialPoleOffsetRadiansColumn],i.yPoleOffset=t[a+e._yCelestialPoleOffsetRadiansColumn],i.ut1MinusUtc=t[a+e._ut1MinusUtcSecondsColumn]}function p(e,t,n){return t+e*(n-t)}function _(e,t,n,r,i,a,u){var s=e._columnCount;if(a>t.length-1)return u.xPoleWander=0,u.yPoleWander=0,u.xPoleOffset=0,u.yPoleOffset=0,u.ut1MinusUtc=0,u;var c=t[i],l=t[a];if(c.equals(l)||r.equals(c))return m(e,n,i,s,u),u;if(r.equals(l))return m(e,n,a,s,u),u;var f=o.secondsDifference(r,c)/o.secondsDifference(l,c),h=i*s,d=a*s,E=n[h+e._ut1MinusUtcSecondsColumn],_=n[d+e._ut1MinusUtcSecondsColumn],y=_-E;if(y>.5||y<-.5){var T=n[h+e._taiMinusUtcSecondsColumn],R=n[d+e._taiMinusUtcSecondsColumn];T!==R&&(l.equals(r)?E=_:_-=R-T)}return u.xPoleWander=p(f,n[h+e._xPoleWanderRadiansColumn],n[d+e._xPoleWanderRadiansColumn]),u.yPoleWander=p(f,n[h+e._yPoleWanderRadiansColumn],n[d+e._yPoleWanderRadiansColumn]),u.xPoleOffset=p(f,n[h+e._xCelestialPoleOffsetRadiansColumn],n[d+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=p(f,n[h+e._yCelestialPoleOffsetRadiansColumn],n[d+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=p(f,E,_),u}return h.NONE=a({getPromiseToLoad:function(){return e()},compute:function(e,t){return r(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new i(0,0,0,0,0),t}}),h.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},h.prototype.compute=function(e,n){if(r(this._samples)){if(r(n)||(n=new i(0,0,0,0,0)),0===this._samples.length)return n.xPoleWander=0,n.yPoleWander=0,n.xPoleOffset=0,n.yPoleOffset=0,n.ut1MinusUtc=0,n;var a=this._dates,u=this._lastIndex,s=0,l=0;if(r(u)){var f=a[u],h=a[u+1],d=o.lessThanOrEquals(f,e),E=!r(h),m=E||o.greaterThanOrEquals(h,e);if(d&&m)return s=u,!E&&h.equals(e)&&++s,l=s+1,_(this,a,this._samples,e,s,l,n),n}var p=t(a,e,o.compare,this._dateColumn);return p>=0?(p<a.length-1&&a[p+1].equals(e)&&++p,s=p,l=p):(l=~p,s=l-1,s<0&&(s=0)),this._lastIndex=s,_(this,a,this._samples,e,s,l,n),n}if(r(this._dataError))throw new c(this._dataError)},h}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function i(t,n,r){this.heading=e(t,0),this.pitch=e(n,0),this.roll=e(r,0)}return i.fromQuaternion=function(e,n){t(n)||(n=new i);var r=2*(e.w*e.y-e.z*e.x),a=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return n.heading=-Math.atan2(s,u),n.roll=Math.atan2(o,a),n.pitch=-Math.asin(r),n},i.fromDegrees=function(e,n,a,o){return t(o)||(o=new i),o.heading=e*r.RADIANS_PER_DEGREE,o.pitch=n*r.RADIANS_PER_DEGREE,o.roll=a*r.RADIANS_PER_DEGREE,o},i.clone=function(e,n){if(t(e))return t(n)?(n.heading=e.heading,n.pitch=e.pitch,n.roll=e.roll,n):new i(e.heading,e.pitch,e.roll)},i.equals=function(e,n){return e===n||t(e)&&t(n)&&e.heading===n.heading&&e.pitch===n.pitch&&e.roll===n.roll},i.equalsEpsilon=function(e,n,i,a){return e===n||t(e)&&t(n)&&r.equalsEpsilon(e.heading,n.heading,i,a)&&r.equalsEpsilon(e.pitch,n.pitch,i,a)&&r.equalsEpsilon(e.roll,n.roll,i,a)},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i.prototype.equalsEpsilon=function(e,t,n){return i.equalsEpsilon(this,e,t,n)},i.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},i}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function i(n,r){r=t(r,document.location.href);var i=new e(r),a=new e(n);return a.resolve(i).toString()}return i}),define("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function i(r,i,a){a=t(a,!0),r instanceof e||(r=new e(r)),i instanceof e||(i=new e(i)),n(i.authority)&&!n(i.scheme)&&("undefined"!=typeof document&&n(document.location)&&n(document.location.href)?i.scheme=new e(document.location.href).scheme:i.scheme=r.scheme);var o=r;i.isAbsolute()&&(o=i);var u="";n(o.scheme)&&(u+=o.scheme+":"),n(o.authority)&&(u+="//"+o.authority,""!==o.path&&"/"!==o.path&&(u=u.replace(/\/?$/,"/"),o.path=o.path.replace(/^\/?/g,""))),u+=o===r?a?r.path.replace(/\/?$/,"/")+i.path.replace(/^\/?/g,""):r.path+i.path:i.path;var s=n(r.query),c=n(i.query);s&&c?u+="?"+r.query+"&"+i.query:s&&!c?u+="?"+r.query:!s&&c&&(u+="?"+i.query);var l=n(i.fragment);return n(r.fragment)&&!l?u+="#"+r.fragment:l&&(u+="#"+i.fragment),u}return i}),define("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","./joinUrls","require"],function(e,t,n,r,i,a){"use strict";function o(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;t<n;++t){var r=e[t].getAttribute("src"),i=E.exec(r);if(null!==i)return i[1]}}function u(){if(t(f))return f;var n;return n="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:o(),f=new e(r(n))}function s(e){return a.toUrl("../"+e)}function c(e){return i(u(),e)}function l(e){t(h)||(h=t(a.toUrl)?s:c),t(d)||(d=document.createElement("a"));var n=h(e);return d.href=n,d.href=d.href,d.href}var f,h,d,E=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return l._cesiumScriptRegex=E,l.setBaseUrl=function(t){f=new e(t).resolve(new e(document.location.href))},l}),define("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,n){this.x=e,this.y=t,this.s=n}return e}),define("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,n,r,i,a,o,u){"use strict";function s(e){e=n(e,n.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=n(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=n(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new a(this._sampleZeroJulianEphemerisDate,0,u.TAI),this._stepSizeDays=n(e.stepSizeDays,1),this._samplesPerXysFile=n(e.samplesPerXysFile,1e3),this._totalSamples=n(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,r=this._denominators=new Array(t+1),i=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t),s=0;s<=t;++s){r[s]=o,i[s]=s*this._stepSizeDays;for(var c=0;c<=t;++c)c!==s&&(r[s]*=s-c);r[s]=1/r[s]}this._work=new Array(t+1),this._coef=new Array(t+1)}function c(e,t,n){var r=f;return r.dayNumber=t,r.secondsOfDay=n,a.daysDifference(r,e._sampleZeroDateTT)}function l(n,i){if(n._chunkDownloadsInProgress[i])return n._chunkDownloadsInProgress[i];var a=e.defer();n._chunkDownloadsInProgress[i]=a;var u,s=n._xysFileUrlTemplate;return u=r(s)?s.replace("{0}",i):t("Assets/IAU2006_XYS/IAU2006_XYS_"+i+".json"),e(o(u),function(e){n._chunkDownloadsInProgress[i]=!1;for(var t=n._samples,r=e.samples,o=i*n._samplesPerXysFile*3,u=0,s=r.length;u<s;++u)t[o+u]=r[u];a.resolve()}),a.promise}var f=new a(0,0,u.TAI);return s.prototype.preload=function(t,n,r,i){var a=c(this,t,n),o=c(this,r,i),u=a/this._stepSizeDays-this._interpolationOrder/2|0;u<0&&(u=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var f=u/this._samplesPerXysFile|0,h=s/this._samplesPerXysFile|0,d=[],E=f;E<=h;++E)d.push(l(this,E));return e.all(d)},s.prototype.computeXysRadians=function(e,t,n){var a=c(this,e,t);if(!(a<0)){var o=a/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);s<0&&(s=0);var f=s+u;f>=this._totalSamples&&(f=this._totalSamples-1,s=f-u,s<0&&(s=0));var h=!1,d=this._samples;if(r(d[3*s])||(l(this,s/this._samplesPerXysFile|0),h=!0),r(d[3*f])||(l(this,f/this._samplesPerXysFile|0),h=!0),!h){r(n)?(n.x=0,n.y=0,n.s=0):n=new i(0,0,0);var E,m,p=a-s*this._stepSizeDays,_=this._work,y=this._denominators,T=this._coef,R=this._xTable; -for(E=0;E<=u;++E)_[E]=p-R[E];for(E=0;E<=u;++E){for(T[E]=1,m=0;m<=u;++m)m!==E&&(T[E]*=_[m]);T[E]*=y[E];var A=3*(s+E);n.x+=T[E]*d[A++],n.y+=T[E]*d[A++],n.s+=T[E]*d[A]}return n}}}},s}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},i={};return t(i,{element:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(i.supportsFullscreen())return null!==i.element}}}),i.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var i,a=["webkit","moz","o","ms","khtml"],o=0,u=a.length;o<u;++o){var s=a[o];i=s+"RequestFullscreen","function"==typeof t[i]?(r.requestFullscreen=i,n=!0):(i=s+"RequestFullScreen","function"==typeof t[i]&&(r.requestFullscreen=i,n=!0)),i=s+"ExitFullscreen","function"==typeof document[i]?r.exitFullscreen=i:(i=s+"CancelFullScreen","function"==typeof document[i]&&(r.exitFullscreen=i)),i=s+"FullscreenEnabled",void 0!==document[i]?r.fullscreenEnabled=i:(i=s+"FullScreenEnabled",void 0!==document[i]&&(r.fullscreenEnabled=i)),i=s+"FullscreenElement",void 0!==document[i]?r.fullscreenElement=i:(i=s+"FullScreenElement",void 0!==document[i]&&(r.fullscreenElement=i)),i=s+"fullscreenchange",void 0!==document["on"+i]&&("ms"===s&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=s+"fullscreenerror",void 0!==document["on"+i]&&("ms"===s&&(i="MSFullscreenError"),r.fullscreenerror=i)}return n},i.requestFullscreen=function(e,t){i.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},i.exitFullscreen=function(){i.supportsFullscreen()&&document[r.exitFullscreen]()},i}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function i(){if(!t(A)&&(A=!1,!h())){var e=/ Chrome\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(A=!0,S=r(e[1]))}return A}function a(){return i()&&S}function o(){if(!t(N)&&(N=!1,!i()&&!h()&&/ Safari\/[\.0-9]+/.test(R.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(N=!0,I=r(e[1]))}return N}function u(){return o()&&I}function s(){if(!t(M)){M=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(R.userAgent);null!==e&&(M=!0,g=r(e[1]),g.isNightly=!!e[2])}return M}function c(){return s()&&g}function l(){if(!t(v)){v=!1;var e;"Microsoft Internet Explorer"===R.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(v=!0,O=r(e[1]))):"Netscape"===R.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(v=!0,O=r(e[1])))}return v}function f(){return l()&&O}function h(){if(!t(x)){x=!1;var e=/ Edge\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(x=!0,w=r(e[1]))}return x}function d(){return h()&&w}function E(){if(!t(C)){C=!1;var e=/Firefox\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(C=!0,P=r(e[1]))}return C}function m(){return t(U)||(U=/Windows/i.test(R.appVersion)),U}function p(){return E()&&P}function _(){return t(D)||(D="undefined"!=typeof PointerEvent&&(!t(R.pointerEnabled)||R.pointerEnabled)),D}function y(){if(!t(F)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;F=t(n)&&""!==n,F&&(L=n)}return F}function T(){return y()?L:void 0}var R;R="undefined"!=typeof navigator?navigator:{};var A,S,N,I,M,g,v,O,x,w,C,P,U,D,L,F,z={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isEdge:h,edgeVersion:d,isFirefox:E,firefoxVersion:p,isWindows:m,hardwareConcurrency:e(R.hardwareConcurrency,3),supportsPointerEvents:_,supportsImageRenderingPixelated:y,imageRenderingValue:T};return z.supportsFullscreen=function(){return n.supportsFullscreen()},z.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},z.supportsWebWorkers=function(){return"undefined"!=typeof Worker},z}),define("Core/Quaternion",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math","./Matrix3"],function(e,t,n,r,i,a,o,u){"use strict";function s(e,n,r,i){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(i,0)}var c=new e;s.fromAxisAngle=function(t,r,i){var a=r/2,o=Math.sin(a);c=e.normalize(t,c);var u=c.x*o,l=c.y*o,f=c.z*o,h=Math.cos(a);return n(i)?(i.x=u,i.y=l,i.z=f,i.w=h,i):new s(u,l,f,h)};var l=[1,2,0],f=new Array(3);s.fromRotationMatrix=function(e,t){var r,i,a,o,c,h=e[u.COLUMN0ROW0],d=e[u.COLUMN1ROW1],E=e[u.COLUMN2ROW2],m=h+d+E;if(m>0)r=Math.sqrt(m+1),c=.5*r,r=.5/r,i=(e[u.COLUMN1ROW2]-e[u.COLUMN2ROW1])*r,a=(e[u.COLUMN2ROW0]-e[u.COLUMN0ROW2])*r,o=(e[u.COLUMN0ROW1]-e[u.COLUMN1ROW0])*r;else{var p=l,_=0;d>h&&(_=1),E>h&&E>d&&(_=2);var y=p[_],T=p[y];r=Math.sqrt(e[u.getElementIndex(_,_)]-e[u.getElementIndex(y,y)]-e[u.getElementIndex(T,T)]+1);var R=f;R[_]=.5*r,r=.5/r,c=(e[u.getElementIndex(T,y)]-e[u.getElementIndex(y,T)])*r,R[y]=(e[u.getElementIndex(y,_)]+e[u.getElementIndex(_,y)])*r,R[T]=(e[u.getElementIndex(T,_)]+e[u.getElementIndex(_,T)])*r,i=-R[0],a=-R[1],o=-R[2]}return n(t)?(t.x=i,t.y=a,t.z=o,t.w=c,t):new s(i,a,o,c)};var h=new s;s.fromHeadingPitchRoll=function(t,n,r,i){var a=s.fromAxisAngle(e.UNIT_X,r,h),o=s.fromAxisAngle(e.UNIT_Y,-n,i);i=s.multiply(o,a,o);var u=s.fromAxisAngle(e.UNIT_Z,-t,h);return s.multiply(u,i,i)};var d=new e,E=new e,m=new s,p=new s,_=new s;s.packedLength=4,s.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},s.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new s),i.x=e[r],i.y=e[r+1],i.z=e[r+2],i.w=e[r+3],i},s.packedInterpolationLength=3,s.convertPackedArrayForInterpolation=function(e,t,n,r){s.unpack(e,4*n,_),s.conjugate(_,_);for(var i=0,a=n-t+1;i<a;i++){var o=3*i;s.unpack(e,4*(t+i),m),s.multiply(m,_,m),m.w<0&&s.negate(m,m),s.computeAxis(m,d);var u=s.computeAngle(m);r[o]=d.x*u,r[o+1]=d.y*u,r[o+2]=d.z*u}},s.unpackInterpolationResult=function(t,r,i,a,o){n(o)||(o=new s),e.fromArray(t,0,E);var u=e.magnitude(E);return s.unpack(r,4*a,p),0===u?s.clone(s.IDENTITY,m):s.fromAxisAngle(E,u,m),s.multiply(m,p,o)},s.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new s(e.x,e.y,e.z,e.w)},s.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},s.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},s.magnitude=function(e){return Math.sqrt(s.magnitudeSquared(e))},s.normalize=function(e,t){var n=1/s.magnitude(e),r=e.x*n,i=e.y*n,a=e.z*n,o=e.w*n;return t.x=r,t.y=i,t.z=a,t.w=o,t},s.inverse=function(e,t){var n=s.magnitudeSquared(e);return t=s.conjugate(e,t),s.multiplyByScalar(t,1/n,t)},s.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},s.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},s.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},s.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},s.multiply=function(e,t,n){var r=e.x,i=e.y,a=e.z,o=e.w,u=t.x,s=t.y,c=t.z,l=t.w,f=o*u+r*l+i*c-a*s,h=o*s-r*c+i*l+a*u,d=o*c+r*s-i*u+a*l,E=o*l-r*u-i*s-a*c;return n.x=f,n.y=h,n.z=d,n.w=E,n},s.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},s.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},s.computeAxis=function(e,t){var n=e.w;if(Math.abs(n-1)<o.EPSILON6)return t.x=t.y=t.z=0,t;var r=1/Math.sqrt(1-n*n);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},s.computeAngle=function(e){return Math.abs(e.w-1)<o.EPSILON6?0:2*Math.acos(e.w)};var y=new s;s.lerp=function(e,t,n,r){return y=s.multiplyByScalar(t,n,y),r=s.multiplyByScalar(e,1-n,r),s.add(y,r,r)};var T=new s,R=new s,A=new s;s.slerp=function(e,t,n,r){var i=s.dot(e,t),a=t;if(i<0&&(i=-i,a=T=s.negate(t,T)),1-i<o.EPSILON6)return s.lerp(e,a,n,r);var u=Math.acos(i);return R=s.multiplyByScalar(e,Math.sin((1-n)*u),R),A=s.multiplyByScalar(a,Math.sin(n*u),A),r=s.add(R,A,r),s.multiplyByScalar(r,1/Math.sin(u),r)},s.log=function(t,n){var r=o.acosClamped(t.w),i=0;return 0!==r&&(i=r/Math.sin(r)),e.multiplyByScalar(t,i,n)},s.exp=function(t,n){var r=e.magnitude(t),i=0;return 0!==r&&(i=Math.sin(r)/r),n.x=t.x*i,n.y=t.y*i,n.z=t.z*i,n.w=Math.cos(r),n};var S=new e,N=new e,I=new s,M=new s;s.computeInnerQuadrangle=function(t,n,r,i){var a=s.conjugate(n,I);s.multiply(a,r,M);var o=s.log(M,S);s.multiply(a,t,M);var u=s.log(M,N);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),s.exp(o,I),s.multiply(n,I,i)},s.squad=function(e,t,n,r,i,a){var o=s.slerp(e,t,i,I),u=s.slerp(n,r,i,M);return s.slerp(o,u,2*i*(1-i),a)};for(var g=new s,v=1.9011074535173003,O=i.supportsTypedArrays()?new Float32Array(8):[],x=i.supportsTypedArrays()?new Float32Array(8):[],w=i.supportsTypedArrays()?new Float32Array(8):[],C=i.supportsTypedArrays()?new Float32Array(8):[],P=0;P<7;++P){var U=P+1,D=2*U+1;O[P]=1/(U*D),x[P]=U/D}return O[7]=v/136,x[7]=8*v/17,s.fastSlerp=function(e,t,n,r){var i,a=s.dot(e,t);a>=0?i=1:(i=-1,a=-a);for(var o=a-1,u=1-n,c=n*n,l=u*u,f=7;f>=0;--f)w[f]=(O[f]*c-x[f])*o,C[f]=(O[f]*l-x[f])*o;var h=i*n*(1+w[0]*(1+w[1]*(1+w[2]*(1+w[3]*(1+w[4]*(1+w[5]*(1+w[6]*(1+w[7])))))))),d=u*(1+C[0]*(1+C[1]*(1+C[2]*(1+C[3]*(1+C[4]*(1+C[5]*(1+C[6]*(1+C[7])))))))),E=s.multiplyByScalar(e,d,g);return s.multiplyByScalar(t,h,r),s.add(E,r,r)},s.fastSquad=function(e,t,n,r,i,a){var o=s.fastSlerp(e,t,i,I),u=s.fastSlerp(n,r,i,M);return s.fastSlerp(o,u,2*i*(1-i),a)},s.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},s.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.x-t.x)<=r&&Math.abs(e.y-t.y)<=r&&Math.abs(e.z-t.z)<=r&&Math.abs(e.w-t.w)<=r},s.ZERO=a(new s(0,0,0,0)),s.IDENTITY=a(new s(0,0,0,1)),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.x+", "+this.y+", "+this.z+", "+this.w+")"},s}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./defaultValue","./defined","./deprecationWarning","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./HeadingPitchRoll","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,n,r,i,a,o,u,s,c,l,f,h,d,E,m,p,_,y,T,R){"use strict";var A={},S=new n,N=new n,I=new n;A.eastNorthUpToFixedFrame=function(e,t,r){if(p.equalsEpsilon(e.x,0,p.EPSILON14)&&p.equalsEpsilon(e.y,0,p.EPSILON14)){var i=p.sign(e.z);return o(r)?(r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=-i,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=i,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(0,-i,0,e.x,1,0,0,e.y,0,0,i,e.z,0,0,0,1)}var u=S,s=N,c=I;return t=a(t,f.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,c),o(r)?(r[0]=s.x,r[1]=s.y,r[2]=s.z,r[3]=0,r[4]=c.x,r[5]=c.y,r[6]=c.z,r[7]=0,r[8]=u.x,r[9]=u.y,r[10]=u.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(s.x,c.x,u.x,e.x,s.y,c.y,u.y,e.y,s.z,c.z,u.z,e.z,0,0,0,1)};var M=new n,g=new n,v=new n;A.northEastDownToFixedFrame=function(e,t,r){if(p.equalsEpsilon(e.x,0,p.EPSILON14)&&p.equalsEpsilon(e.y,0,p.EPSILON14)){var i=p.sign(e.z);return o(r)?(r[0]=-i,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=-i,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(-i,0,0,e.x,0,1,0,e.y,0,0,-i,e.z,0,0,0,1)}var u=M,s=g,c=v;return t=a(t,f.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,c),o(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=s.x,r[5]=s.y,r[6]=s.z,r[7]=0,r[8]=-u.x,r[9]=-u.y,r[10]=-u.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(c.x,s.x,-u.x,e.x,c.y,s.y,-u.y,e.y,c.z,s.z,-u.z,e.z,0,0,0,1)},A.northUpEastToFixedFrame=function(e,t,r){if(p.equalsEpsilon(e.x,0,p.EPSILON14)&&p.equalsEpsilon(e.y,0,p.EPSILON14)){var i=p.sign(e.z);return o(r)?(r[0]=-i,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=i,r[7]=0,r[8]=0,r[9]=1,r[10]=0,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(-i,0,0,e.x,0,0,1,e.y,0,i,0,e.z,0,0,0,1)}var u=S,s=N,c=I;return t=a(t,f.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,c),o(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=u.x,r[5]=u.y,r[6]=u.z,r[7]=0,r[8]=s.x,r[9]=s.y,r[10]=s.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(c.x,u.x,s.x,e.x,c.y,u.y,s.y,e.y,c.z,u.z,s.z,e.z,0,0,0,1)},A.northWestUpToFixedFrame=function(e,t,r){if(p.equalsEpsilon(e.x,0,p.EPSILON14)&&p.equalsEpsilon(e.y,0,p.EPSILON14)){var i=p.sign(e.z);return o(r)?(r[0]=-i,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=i,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(-i,0,0,e.x,0,-1,0,e.y,0,0,i,e.z,0,0,0,1)}var u=S,s=N,c=I;return t=a(t,f.WGS84),t.geodeticSurfaceNormal(e,u),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(u,s,c),o(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=-s.x,r[5]=-s.y,r[6]=-s.z,r[7]=0,r[8]=u.x,r[9]=u.y,r[10]=u.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(c.x,-s.x,u.x,e.x,c.y,-s.y,u.y,e.y,c.z,-s.z,u.z,e.z,0,0,0,1)};var O=new T,x=new n(1,1,1),w=new y;A.headingPitchRollToFixedFrame=function(e,t,r,i,a,o){var s;"object"==typeof t?(a=r,o=i,s=t.heading,r=t.pitch,i=t.roll):(u("headingPitchRollToFixedFrame","headingPitchRollToFixedFrame with separate heading, pitch, and roll arguments was deprecated in 1.27. It will be removed in 1.30. Use a HeadingPitchRoll object."),s=t);var c=T.fromHeadingPitchRoll(s,r,i,O),l=y.fromTranslationQuaternionRotationScale(n.ZERO,c,x,w);return o=A.eastNorthUpToFixedFrame(e,a,o),y.multiply(o,l,o)};var C=new h,P=new y,U=new _;A.headingPitchRollQuaternion=function(e,t,n,r,i,a){var o;"object"==typeof t?(o=t,i=n,a=r):(u("headingPitchRollQuaternion","headingPitchRollQuaternion with separate heading, pitch, and roll arguments was deprecated in 1.27. It will be removed in 1.30. Use a HeadingPitchRoll object."),C.heading=t,C.pitch=n,C.roll=r,o=C);var s=A.headingPitchRollToFixedFrame(e,o,i,P),c=y.getRotation(s,U);return T.fromRotationMatrix(c,a)};var D=24110.54841,L=8640184.812866,F=.093104,z=-62e-7,B=1.1772758384668e-19,b=72921158553e-15,q=p.TWO_PI/86400,G=new m;A.computeTemeToPseudoFixedMatrix=function(e,t){G=m.addSeconds(e,-m.computeTaiMinusUtc(e),G);var n,r=G.dayNumber,i=G.secondsOfDay,a=r-2451545;n=i>=43200?(a+.5)/R.DAYS_PER_JULIAN_CENTURY:(a-.5)/R.DAYS_PER_JULIAN_CENTURY;var u=D+n*(L+n*(F+n*z)),s=u*q%p.TWO_PI,c=b+B*(r-2451545.5),l=(i+.5*R.SECONDS_PER_DAY)%R.SECONDS_PER_DAY,f=s+c*l,h=Math.cos(f),d=Math.sin(f);return o(t)?(t[0]=h,t[1]=-d,t[2]=0,t[3]=d,t[4]=h,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new _(h,d,0,-d,h,0,0,0,1)},A.iau2006XysData=new d,A.earthOrientationParameters=c.NONE;var W=32.184,X=2451545;A.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+W,i=t.stop.dayNumber,a=t.stop.secondsOfDay+W,o=A.iau2006XysData.preload(n,r,i,a),u=A.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},A.computeIcrfToFixedMatrix=function(e,t){o(t)||(t=new _);var n=A.computeFixedToIcrfMatrix(e,t);if(o(n))return _.transpose(n,t)};var V=new E(0,0,0),H=new l(0,0,0,0,0,0),Y=new _,k=new _;A.computeFixedToIcrfMatrix=function(e,t){o(t)||(t=new _);var n=A.earthOrientationParameters.compute(e,H);if(o(n)){var r=e.dayNumber,i=e.secondsOfDay+W,a=A.iau2006XysData.computeXysRadians(r,i,V);if(o(a)){var u=a.x+n.xPoleOffset,s=a.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-u*u-s*s)),l=Y;l[0]=1-c*u*u,l[3]=-c*u*s,l[6]=u,l[1]=-c*u*s,l[4]=1-c*s*s,l[7]=s,l[2]=-u,l[5]=-s,l[8]=1-c*(u*u+s*s);var f=_.fromRotationZ(-a.s,k),h=_.multiply(l,f,Y),d=e.dayNumber,E=e.secondsOfDay-m.computeTaiMinusUtc(e)+n.ut1MinusUtc,y=d-2451545,T=E/R.SECONDS_PER_DAY,S=.779057273264+T+.00273781191135448*(y+T);S=S%1*p.TWO_PI;var N=_.fromRotationZ(S,k),I=_.multiply(h,N,Y),M=Math.cos(n.xPoleWander),g=Math.cos(n.yPoleWander),v=Math.sin(n.xPoleWander),O=Math.sin(n.yPoleWander),x=r-X+i/R.SECONDS_PER_DAY;x/=36525;var w=-47e-6*x*p.RADIANS_PER_DEGREE/3600,C=Math.cos(w),P=Math.sin(w),U=k;return U[0]=M*C,U[1]=M*P,U[2]=v,U[3]=-g*P+O*v*C,U[4]=g*C+O*v*P,U[5]=-O*M,U[6]=-O*P-g*v*C,U[7]=O*C-g*v*P,U[8]=g*M,_.multiply(I,U,t)}}};var Z=new r;A.pointToWindowCoordinates=function(e,t,n,r){return r=A.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},A.pointToGLWindowCoordinates=function(e,n,i,a){o(a)||(a=new t);var u=Z;return y.multiplyByVector(e,r.fromElements(i.x,i.y,i.z,1,u),u),r.multiplyByScalar(u,1/u.w,u),y.multiplyByVector(n,u,u),t.fromCartesian4(u,a)};var j=new n,K=new n,J=new n;A.rotationMatrixFromPositionVelocity=function(e,t,r,i){var u=a(r,f.WGS84).geodeticSurfaceNormal(e,j),s=n.cross(t,u,K);n.equalsEpsilon(s,n.ZERO,p.EPSILON6)&&(s=n.clone(n.UNIT_X,s));var c=n.cross(s,t,J);return n.cross(t,c,s),n.negate(s,s),o(i)||(i=new _),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=s.x,i[4]=s.y,i[5]=s.z,i[6]=c.x,i[7]=c.y,i[8]=c.z,i};var Q=new i,$=new n,ee=new n,te=new r,ne=new r,re=new r,ie=new r,ae=new r,oe=new y,ue=new y;return A.basisTo2D=function(e,t,i){var a=e.ellipsoid,o=y.getColumn(t,3,te),u=a.cartesianToCartographic(o,Q),s=A.eastNorthUpToFixedFrame(o,a,oe),c=y.inverseTransformation(s,ue),l=e.project(u,$),f=ne;f.x=l.z,f.y=l.x,f.z=l.y,f.w=1;var h=y.getColumn(t,0,ee),d=n.magnitude(h),E=y.multiplyByVector(c,h,re);r.fromElements(E.z,E.x,E.y,0,E);var m=y.getColumn(t,1,ee),p=n.magnitude(m),_=y.multiplyByVector(c,m,ie);r.fromElements(_.z,_.x,_.y,0,_);var T=y.getColumn(t,2,ee),R=n.magnitude(T),S=ae;return n.cross(E,_,S),n.normalize(S,S),n.cross(_,S,E),n.normalize(E,E),n.cross(S,E,_),n.normalize(_,_),n.multiplyByScalar(E,d,E),n.multiplyByScalar(_,p,_),n.multiplyByScalar(S,R,S),y.setColumn(i,0,E,i),y.setColumn(i,1,_,i),y.setColumn(i,2,S,i),y.setColumn(i,3,f,i),i},A}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,n,r,i,a,o,u,s,c,l,f,h,d){"use strict";function E(e,t){t=i(t,s.WGS84),e=t.scaleToGeodeticSurface(e);var r=d.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=n.fromCartesian4(l.getColumn(r,0,m)),this._yAxis=n.fromCartesian4(l.getColumn(r,1,m));var a=n.fromCartesian4(l.getColumn(r,2,m));this._plane=f.fromPointNormal(e,a)}var m=new r;o(E.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var p=new e;E.fromPoints=function(t,n){var r=e.fromPoints(t,p);return new E(r.center,n)};var _=new h,y=new n;E.prototype.projectPointOntoPlane=function(e,r){var i=_;i.origin=e,n.normalize(e,i.direction);var o=c.rayPlane(i,this._plane,y);if(a(o)||(n.negate(i.direction,i.direction),o=c.rayPlane(i,this._plane,y)),a(o)){var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return a(r)?(r.x=s,r.y=l,r):new t(s,l)}},E.prototype.projectPointsOntoPlane=function(e,t){a(t)||(t=[]);for(var n=0,r=e.length,i=0;i<r;i++){var o=this.projectPointOntoPlane(e[i],t[n]);a(o)&&(t[n]=o,n++)}return t.length=n,t},E.prototype.projectPointToNearestOnPlane=function(e,r){a(r)||(r=new t);var i=_;i.origin=e,n.clone(this._plane.normal,i.direction);var o=c.rayPlane(i,this._plane,y);a(o)||(n.negate(i.direction,i.direction),o=c.rayPlane(i,this._plane,y));var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return r.x=s,r.y=l,r},E.prototype.projectPointsToNearestOnPlane=function(e,t){a(t)||(t=[]);var n=e.length;t.length=n;for(var r=0;r<n;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var T=new n;return E.prototype.projectPointsOntoEllipsoid=function(e,t){var r=e.length;a(t)?t.length=r:t=new Array(r);for(var i=this._ellipsoid,o=this._origin,u=this._xAxis,s=this._yAxis,c=T,l=0;l<r;++l){var f=e[l];n.multiplyByScalar(u,f.x,c),a(t[l])||(t[l]=new n);var h=n.add(o,c,t[l]);n.multiplyByScalar(s,f.y,c),n.add(h,c,h),i.scaleToGeocentricSurface(h,h)}return t},E}),define("Core/OrientedBoundingBox",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Intersect","./Interval","./Math","./Matrix3","./Plane","./Rectangle"],function(e,t,n,r,i,a,o,u,s,c,l,f,h,d,E){"use strict";function m(e,t){this.center=n.clone(i(e,n.ZERO)),this.halfAxes=h.clone(i(t,h.ZERO))}function p(e,t,r,i,o,u,s,c){a(c)||(c=new m);var l=c.halfAxes;h.setColumn(l,0,e.xAxis,l),h.setColumn(l,1,e.yAxis,l),h.setColumn(l,2,e.zAxis,l);var f=M;f.x=(t+r)/2,f.y=(i+o)/2,f.z=(u+s)/2;var d=g;d.x=(r-t)/2,d.y=(o-i)/2,d.z=(s-u)/2;var E=c.center;return f=h.multiplyByVector(l,f,f),n.add(e.origin,f,E),h.multiplyByScale(l,d,l),c}var _=new n,y=new n,T=new n,R=new n,A=new n,S=new n,N=new h,I={unitary:new h,diagonal:new h};m.fromPoints=function(e,t){if(a(t)||(t=new m),!a(e)||0===e.length)return t.halfAxes=h.ZERO,t.center=n.ZERO,t;var r,i=e.length,o=n.clone(e[0],_);for(r=1;r<i;r++)n.add(o,e[r],o);var u=1/i;n.multiplyByScalar(o,u,o);var s,c=0,l=0,f=0,d=0,E=0,p=0;for(r=0;r<i;r++)s=n.subtract(e[r],o,y),c+=s.x*s.x,l+=s.x*s.y,f+=s.x*s.z,d+=s.y*s.y,E+=s.y*s.z,p+=s.z*s.z;c*=u,l*=u,f*=u,d*=u,E*=u,p*=u;var M=N;M[0]=c,M[1]=l,M[2]=f,M[3]=l,M[4]=d,M[5]=E,M[6]=f,M[7]=E,M[8]=p;var g=h.computeEigenDecomposition(M,I),v=h.clone(g.unitary,t.halfAxes),O=h.getColumn(v,0,R),x=h.getColumn(v,1,A),w=h.getColumn(v,2,S),C=-Number.MAX_VALUE,P=-Number.MAX_VALUE,U=-Number.MAX_VALUE,D=Number.MAX_VALUE,L=Number.MAX_VALUE,F=Number.MAX_VALUE;for(r=0;r<i;r++)s=e[r],C=Math.max(n.dot(O,s),C),P=Math.max(n.dot(x,s),P),U=Math.max(n.dot(w,s),U),D=Math.min(n.dot(O,s),D),L=Math.min(n.dot(x,s),L),F=Math.min(n.dot(w,s),F);O=n.multiplyByScalar(O,.5*(D+C),O),x=n.multiplyByScalar(x,.5*(L+P),x),w=n.multiplyByScalar(w,.5*(F+U),w);var z=n.add(O,x,t.center);z=n.add(z,w,z);var B=T;return B.x=C-D,B.y=P-L,B.z=U-F,n.multiplyByScalar(B,.5,B),h.multiplyByScale(t.halfAxes,B,t.halfAxes),t};var M=new n,g=new n,v=new r,O=new n,x=[new r,new r,new r,new r,new r,new r,new r,new r],w=[new n,new n,new n,new n,new n,new n,new n,new n],C=[new t,new t,new t,new t,new t,new t,new t,new t];m.fromRectangle=function(e,t,n,r,a){t=i(t,0),n=i(n,0),r=i(r,u.WGS84);var o=E.center(e,v),c=r.cartographicToCartesian(o,O),l=new s(c,r),f=l.plane,h=x[0],m=x[1],_=x[2],y=x[3],T=x[4],R=x[5],A=x[6],S=x[7],N=o.longitude,I=e.south<0&&e.north>0?0:o.latitude;A.latitude=R.latitude=T.latitude=e.south,S.latitude=y.latitude=I,h.latitude=m.latitude=_.latitude=e.north,A.longitude=S.longitude=h.longitude=e.west,R.longitude=m.longitude=N,T.longitude=y.longitude=_.longitude=e.east,_.height=m.height=h.height=S.height=A.height=R.height=T.height=y.height=n,r.cartographicArrayToCartesianArray(x,w),l.projectPointsToNearestOnPlane(w,C);var M=Math.min(C[6].x,C[7].x,C[0].x),g=Math.max(C[2].x,C[3].x,C[4].x),P=Math.min(C[4].y,C[5].y,C[6].y),U=Math.max(C[0].y,C[1].y,C[2].y);_.height=h.height=T.height=A.height=t,r.cartographicArrayToCartesianArray(x,w);var D=Math.min(d.getPointDistance(f,w[0]),d.getPointDistance(f,w[2]),d.getPointDistance(f,w[4]),d.getPointDistance(f,w[6])),L=n;return p(l,M,g,P,U,D,L,a)},m.clone=function(e,t){if(a(e))return a(t)?(n.clone(e.center,t.center),h.clone(e.halfAxes,t.halfAxes),t):new m(e.center,e.halfAxes)},m.intersectPlane=function(e,t){var r=e.center,i=t.normal,a=e.halfAxes,o=i.x,u=i.y,s=i.z,l=Math.abs(o*a[h.COLUMN0ROW0]+u*a[h.COLUMN0ROW1]+s*a[h.COLUMN0ROW2])+Math.abs(o*a[h.COLUMN1ROW0]+u*a[h.COLUMN1ROW1]+s*a[h.COLUMN1ROW2])+Math.abs(o*a[h.COLUMN2ROW0]+u*a[h.COLUMN2ROW1]+s*a[h.COLUMN2ROW2]),f=n.dot(i,r)+t.distance;return f<=-l?c.OUTSIDE:f>=l?c.INSIDE:c.INTERSECTING};var P=new n,U=new n,D=new n,L=new n;m.distanceSquaredTo=function(e,t){var r=n.subtract(t,e.center,M),i=e.halfAxes,a=h.getColumn(i,0,P),o=h.getColumn(i,1,U),u=h.getColumn(i,2,D),s=n.magnitude(a),c=n.magnitude(o),l=n.magnitude(u);n.normalize(a,a),n.normalize(o,o),n.normalize(u,u);var f=L;f.x=n.dot(r,a),f.y=n.dot(r,o),f.z=n.dot(r,u);var d,E=0;return f.x<-s?(d=f.x+s,E+=d*d):f.x>s&&(d=f.x-s,E+=d*d),f.y<-c?(d=f.y+c,E+=d*d):f.y>c&&(d=f.y-c,E+=d*d),f.z<-l?(d=f.z+l,E+=d*d):f.z>l&&(d=f.z-l,E+=d*d),E};var F=new n,z=new n;m.computePlaneDistances=function(e,t,r,i){a(i)||(i=new l);var o=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,s=e.center,c=e.halfAxes,f=h.getColumn(c,0,P),d=h.getColumn(c,1,U),E=h.getColumn(c,2,D),m=n.add(f,d,F);n.add(m,E,m),n.add(m,s,m);var p=n.subtract(m,t,z),_=n.dot(r,p);return o=Math.min(_,o),u=Math.max(_,u),n.add(s,f,m),n.add(m,d,m),n.subtract(m,E,m),n.subtract(m,t,p),_=n.dot(r,p),o=Math.min(_,o),u=Math.max(_,u),n.add(s,f,m),n.subtract(m,d,m),n.add(m,E,m),n.subtract(m,t,p),_=n.dot(r,p),o=Math.min(_,o),u=Math.max(_,u),n.add(s,f,m),n.subtract(m,d,m),n.subtract(m,E,m),n.subtract(m,t,p),_=n.dot(r,p),o=Math.min(_,o),u=Math.max(_,u),n.subtract(s,f,m),n.add(m,d,m),n.add(m,E,m),n.subtract(m,t,p),_=n.dot(r,p),o=Math.min(_,o),u=Math.max(_,u),n.subtract(s,f,m),n.add(m,d,m),n.subtract(m,E,m),n.subtract(m,t,p),_=n.dot(r,p),o=Math.min(_,o),u=Math.max(_,u),n.subtract(s,f,m),n.subtract(m,d,m),n.add(m,E,m),n.subtract(m,t,p),_=n.dot(r,p),o=Math.min(_,o),u=Math.max(_,u),n.subtract(s,f,m),n.subtract(m,d,m),n.subtract(m,E,m),n.subtract(m,t,p),_=n.dot(r,p),o=Math.min(_,o),u=Math.max(_,u),i.start=o,i.stop=u,i};var B=new e;return m.isOccluded=function(t,n){var r=e.fromOrientedBoundingBox(t,B);return!n.isBoundingSphereVisible(r)},m.prototype.intersectPlane=function(e){return m.intersectPlane(this,e)},m.prototype.distanceSquaredTo=function(e){return m.distanceSquaredTo(this,e)},m.prototype.computePlaneDistances=function(e,t,n){return m.computePlaneDistances(this,e,t,n)},m.prototype.isOccluded=function(e){return m.isOccluded(this,e)},m.equals=function(e,t){return e===t||a(e)&&a(t)&&n.equals(e.center,t.center)&&h.equals(e.halfAxes,t.halfAxes)},m.prototype.clone=function(e){return m.clone(this,e)},m.prototype.equals=function(e){return m.equals(this,e)},m}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,i,a){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:a.BYTE,UNSIGNED_BYTE:a.UNSIGNED_BYTE,SHORT:a.SHORT,UNSIGNED_SHORT:a.UNSIGNED_SHORT,INT:a.INT,UNSIGNED_INT:a.UNSIGNED_INT,FLOAT:a.FLOAT,DOUBLE:a.DOUBLE};return o.getSizeInBytes=function(e){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.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},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 Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,i){switch(r=e(r,0),i=e(i,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,i);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,i);case o.SHORT:return new Int16Array(n,r,i);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,i);case o.INT:return new Int32Array(n,r,i);case o.UNSIGNED_INT:return new Uint32Array(n,r,i);case o.FLOAT:return new Float32Array(n,r,i);case o.DOUBLE:return new Float64Array(n,r,i)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},i(o)}),define("Core/TerrainQuantization",["./freezeObject"],function(e){"use strict";var t={NONE:0,BITS12:1};return e(t)}),define("Core/TerrainEncoding",["./AttributeCompression","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./Math","./Matrix4","./TerrainQuantization"],function(e,t,n,r,i,a,o,u,s){"use strict";function c(e,t,r,o,c,h){var p,_,y,T;if(a(e)&&a(t)&&a(r)&&a(o)){var R=e.minimum,A=e.maximum,S=n.subtract(A,R,f),N=r-t,I=Math.max(n.maximumComponent(S),N);p=I<m-1?s.BITS12:s.NONE,_=e.center,y=u.inverseTransformation(o,new u);var M=n.negate(R,l);u.multiply(u.fromTranslation(M,d),y,y);var g=l;g.x=1/S.x,g.y=1/S.y,g.z=1/S.z,u.multiply(u.fromScale(g,d),y,y),T=u.clone(o),u.setTranslation(T,n.ZERO,T),o=u.clone(o,new u);var v=u.fromTranslation(R,d),O=u.fromScale(S,E),x=u.multiply(v,O,d);u.multiply(o,x,o),u.multiply(T,x,T)}this.quantization=p,this.minimumHeight=t,this.maximumHeight=r,this.center=_,this.toScaledENU=y,this.fromScaledENU=o,this.matrix=T,this.hasVertexNormals=c,this.hasWebMercatorT=i(h,!1)}var l=new n,f=new n,h=new t,d=new u,E=new u,m=Math.pow(2,12);c.prototype.encode=function(r,i,a,c,f,d,E){var m=c.x,p=c.y;if(this.quantization===s.BITS12){a=u.multiplyByPoint(this.toScaledENU,a,l),a.x=o.clamp(a.x,0,1),a.y=o.clamp(a.y,0,1),a.z=o.clamp(a.z,0,1);var _=this.maximumHeight-this.minimumHeight,y=o.clamp((f-this.minimumHeight)/_,0,1);t.fromElements(a.x,a.y,h);var T=e.compressTextureCoordinates(h);t.fromElements(a.z,y,h);var R=e.compressTextureCoordinates(h);t.fromElements(m,p,h);var A=e.compressTextureCoordinates(h);if(r[i++]=T,r[i++]=R,r[i++]=A,this.hasWebMercatorT){t.fromElements(E,0,h);var S=e.compressTextureCoordinates(h);r[i++]=S}}else n.subtract(a,this.center,l),r[i++]=l.x,r[i++]=l.y,r[i++]=l.z,r[i++]=f,r[i++]=m,r[i++]=p,this.hasWebMercatorT&&(r[i++]=E);return this.hasVertexNormals&&(r[i++]=e.octPackFloat(d)),i},c.prototype.decodePosition=function(t,r,i){if(a(i)||(i=new n),r*=this.getStride(),this.quantization===s.BITS12){var o=e.decompressTextureCoordinates(t[r],h);i.x=o.x,i.y=o.y;var c=e.decompressTextureCoordinates(t[r+1],h);return i.z=c.x,u.multiplyByPoint(this.fromScaledENU,i,i)}return i.x=t[r],i.y=t[r+1],i.z=t[r+2],n.add(i,this.center,i)},c.prototype.decodeTextureCoordinates=function(n,r,i){return a(i)||(i=new t),r*=this.getStride(),this.quantization===s.BITS12?e.decompressTextureCoordinates(n[r+2],i):t.fromElements(n[r+4],n[r+5],i)},c.prototype.decodeHeight=function(t,n){if(n*=this.getStride(),this.quantization===s.BITS12){var r=e.decompressTextureCoordinates(t[n+1],h);return r.y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight}return t[n+3]},c.prototype.getOctEncodedNormal=function(e,n,r){var i=this.getStride();n=(n+1)*i-1;var a=e[n]/256,o=Math.floor(a),u=256*(a-o);return t.fromElements(o,u,r)},c.prototype.getStride=function(){ -var e;switch(this.quantization){case s.BITS12:e=3;break;default:e=6}return this.hasWebMercatorT&&++e,this.hasVertexNormals&&++e,e};var p={position3DAndHeight:0,textureCoordAndEncodedNormals:1},_={compressed0:0,compressed1:1};return c.prototype.getAttributes=function(e){var t,n=r.FLOAT,i=r.getSizeInBytes(n);if(this.quantization===s.NONE){var a=4,o=2;return this.hasWebMercatorT&&++o,this.hasVertexNormals&&++o,t=(a+o)*i,[{index:p.position3DAndHeight,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:a,offsetInBytes:0,strideInBytes:t},{index:p.textureCoordAndEncodedNormals,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:o,offsetInBytes:a*i,strideInBytes:t}]}var u=3,c=0;return(this.hasWebMercatorT||this.hasVertexNormals)&&++u,this.hasWebMercatorT&&this.hasVertexNormals?(++c,t=(u+c)*i,[{index:_.compressed0,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:u,offsetInBytes:0,strideInBytes:t},{index:_.compressed1,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:c,offsetInBytes:u*i,strideInBytes:t}]):[{index:_.compressed0,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:u}]},c.prototype.getAttributeLocations=function(){return this.quantization===s.NONE?p:_},c.clone=function(e,t){return a(t)||(t=new c),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=n.clone(e.center),t.toScaledENU=u.clone(e.toScaledENU),t.fromScaledENU=u.clone(e.fromScaledENU),t.matrix=u.clone(e.matrix),t.hasVertexNormals=e.hasVertexNormals,t.hasWebMercatorT=e.hasWebMercatorT,t},c}),define("Core/formatError",["./defined"],function(e){"use strict";function t(t){var n,r=t.name,i=t.message;n=e(r)&&e(i)?r+": "+i:t.toString();var a=t.stack;return e(a)&&(n+="\n"+a),n}return t}),define("Workers/createTaskProcessorWorker",["../Core/defaultValue","../Core/defined","../Core/formatError"],function(e,t,n){"use strict";function r(r){var i,a=[],o={id:void 0,result:void 0,error:void 0};return function(u){var s=u.data;a.length=0,o.id=s.id,o.error=void 0,o.result=void 0;try{o.result=r(s.parameters,a)}catch(e){e instanceof Error?o.error={name:e.name,message:e.message,stack:e.stack}:o.error=e}t(i)||(i=e(self.webkitPostMessage,self.postMessage)),s.canTransferArrayBuffer||(a.length=0);try{i(o,a)}catch(e){o.result=void 0,o.error="postMessage failed with error: "+n(e)+"\n with responseMessage: "+JSON.stringify(o),i(o)}}}return r}),define("Workers/upsampleQuantizedTerrainMesh",["../Core/AttributeCompression","../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/defined","../Core/Ellipsoid","../Core/EllipsoidalOccluder","../Core/IndexDatatype","../Core/Intersections2D","../Core/Math","../Core/OrientedBoundingBox","../Core/TerrainEncoding","./createTaskProcessorWorker"],function(e,t,n,r,i,a,o,u,s,c,l,f,h,d){"use strict";function E(e,n){var i=e.isEastChild,a=e.isNorthChild,d=i?T:0,E=i?y:T,p=a?T:0,L=a?y:T,F=M,z=g,B=v,b=x;F.length=0,z.length=0,B.length=0,b.length=0;var q=O;q.length=0;var G={},W=e.vertices,X=e.indices;X=X.subarray(0,e.skirtIndex);var V,H,Y,k=h.clone(e.encoding),Z=k.hasVertexNormals,j=e.exaggeration,K=0,J=e.vertexCountWithoutSkirts,Q=e.minimumHeight,$=e.maximumHeight,ee=new Array(J),te=new Array(J),ne=new Array(J),re=Z?new Array(2*J):void 0,ie=20;for(H=0,Y=0;H<J;++H,Y+=2){var ae=k.decodeTextureCoordinates(W,H,U);if(V=k.decodeHeight(W,H)/j,ee[H]=l.clamp(ae.x*y|0,0,y),te[H]=l.clamp(ae.y*y|0,0,y),ne[H]=l.clamp((V-Q)/($-Q)*y|0,0,y),ee[H]<ie&&(ee[H]=0),te[H]<ie&&(te[H]=0),y-ee[H]<ie&&(ee[H]=y),y-te[H]<ie&&(te[H]=y),Z){var oe=k.getOctEncodedNormal(W,H,D);re[Y]=oe.x,re[Y+1]=oe.y}}var ue,se;for(H=0,Y=0;H<J;++H,Y+=2)ue=ee[H],se=te[H],(i&&ue>=T||!i&&ue<=T)&&(a&&se>=T||!a&&se<=T)&&(G[H]=K,F.push(ue),z.push(se),B.push(ne[H]),Z&&(b.push(re[Y]),b.push(re[Y+1])),++K);var ce=[];ce.push(new m),ce.push(new m),ce.push(new m);var le=[];le.push(new m),le.push(new m),le.push(new m);var fe,he;for(H=0;H<X.length;H+=3){var de=X[H],Ee=X[H+1],me=X[H+2],pe=ee[de],_e=ee[Ee],ye=ee[me];ce[0].initializeIndexed(ee,te,ne,re,de),ce[1].initializeIndexed(ee,te,ne,re,Ee),ce[2].initializeIndexed(ee,te,ne,re,me);var Te=c.clipTriangleAtAxisAlignedThreshold(T,i,pe,_e,ye,R);fe=0,fe>=Te.length||(fe=le[0].initializeFromClipResult(Te,fe,ce),fe>=Te.length||(fe=le[1].initializeFromClipResult(Te,fe,ce),fe>=Te.length||(fe=le[2].initializeFromClipResult(Te,fe,ce),he=c.clipTriangleAtAxisAlignedThreshold(T,a,le[0].getV(),le[1].getV(),le[2].getV(),A),_(F,z,B,b,q,G,he,le,Z),fe<Te.length&&(le[2].clone(le[1]),le[2].initializeFromClipResult(Te,fe,ce),he=c.clipTriangleAtAxisAlignedThreshold(T,a,le[0].getV(),le[1].getV(),le[2].getV(),A),_(F,z,B,b,q,G,he,le,Z)))))}var Re=i?-y:0,Ae=a?-y:0,Se=[],Ne=[],Ie=[],Me=[],ge=Number.MAX_VALUE,ve=-ge,Oe=S;Oe.length=0;var xe=o.clone(e.ellipsoid),we=e.childRectangle,Ce=we.north,Pe=we.south,Ue=we.east,De=we.west;for(Ue<De&&(Ue+=l.TWO_PI),H=0;H<F.length;++H)ue=Math.round(F[H]),ue<=d?(Se.push(H),ue=0):ue>=E?(Ie.push(H),ue=y):ue=2*ue+Re,F[H]=ue,se=Math.round(z[H]),se<=p?(Ne.push(H),se=0):se>=L?(Me.push(H),se=y):se=2*se+Ae,z[H]=se,V=l.lerp(Q,$,B[H]/y),V<ge&&(ge=V),V>ve&&(ve=V),B[H]=V,N.longitude=l.lerp(De,Ue,ue/y),N.latitude=l.lerp(Pe,Ce,se/y),N.height=V,xe.cartographicToCartesian(N,I),Oe.push(I.x),Oe.push(I.y),Oe.push(I.z);var Le=t.fromVertices(Oe,r.ZERO,3,C),Fe=f.fromRectangle(we,ge,ve,xe,P),ze=new u(xe),Be=ze.computeHorizonCullingPointFromVertices(Le.center,Oe,3,Le.center,w),be=ve-ge,qe=new Uint16Array(F.length+z.length+B.length);for(H=0;H<F.length;++H)qe[H]=F[H];var Ge=F.length;for(H=0;H<z.length;++H)qe[Ge+H]=z[H];for(Ge+=z.length,H=0;H<B.length;++H)qe[Ge+H]=y*(B[H]-ge)/be;var We,Xe=s.createTypedArray(F.length,q);if(Z){var Ve=new Uint8Array(b);n.push(qe.buffer,Xe.buffer,Ve.buffer),We=Ve.buffer}else n.push(qe.buffer,Xe.buffer);return{vertices:qe.buffer,encodedNormals:We,indices:Xe.buffer,minimumHeight:ge,maximumHeight:ve,westIndices:Se,southIndices:Ne,eastIndices:Ie,northIndices:Me,boundingSphere:Le,orientedBoundingBox:Fe,horizonOcclusionPoint:Be}}function m(){this.vertexBuffer=void 0,this.index=void 0,this.first=void 0,this.second=void 0,this.ratio=void 0}function p(t,n){++F;var i=z[F],a=B[F];return i=e.octDecode(t.first.getNormalX(),t.first.getNormalY(),i),a=e.octDecode(t.second.getNormalX(),t.second.getNormalY(),a),I=r.lerp(i,a,t.ratio,I),r.normalize(I,I),e.octEncode(I,n),--F,n}function _(e,t,n,r,i,o,u,s,c){if(0!==u.length){for(var l=0,f=0;f<u.length;)f=b[l++].initializeFromClipResult(u,f,s);for(var h=0;h<l;++h){var d=b[h];if(d.isIndexed())d.newIndex=o[d.index],d.uBuffer=e,d.vBuffer=t,d.heightBuffer=n,c&&(d.normalBuffer=r);else{var E=d.getKey();if(a(o[E]))d.newIndex=o[E];else{var m=e.length;e.push(d.getU()),t.push(d.getV()),n.push(d.getH()),c&&(r.push(d.getNormalX()),r.push(d.getNormalY())),d.newIndex=m,o[E]=m}}}3===l?(i.push(b[0].newIndex),i.push(b[1].newIndex),i.push(b[2].newIndex)):4===l&&(i.push(b[0].newIndex),i.push(b[1].newIndex),i.push(b[2].newIndex),i.push(b[0].newIndex),i.push(b[2].newIndex),i.push(b[3].newIndex))}}var y=32767,T=y/2|0,R=[],A=[],S=[],N=new i,I=new r,M=[],g=[],v=[],O=[],x=[],w=new r,C=new t,P=new f,U=new n,D=new r;m.prototype.clone=function(e){return a(e)||(e=new m),e.uBuffer=this.uBuffer,e.vBuffer=this.vBuffer,e.heightBuffer=this.heightBuffer,e.normalBuffer=this.normalBuffer,e.index=this.index,e.first=this.first,e.second=this.second,e.ratio=this.ratio,e},m.prototype.initializeIndexed=function(e,t,n,r,i){this.uBuffer=e,this.vBuffer=t,this.heightBuffer=n,this.normalBuffer=r,this.index=i,this.first=void 0,this.second=void 0,this.ratio=void 0},m.prototype.initializeFromClipResult=function(e,t,n){var r=t+1;return e[t]!==-1?n[e[t]].clone(this):(this.vertexBuffer=void 0,this.index=void 0,this.first=n[e[r]],++r,this.second=n[e[r]],++r,this.ratio=e[r],++r),r},m.prototype.getKey=function(){return this.isIndexed()?this.index:JSON.stringify({first:this.first.getKey(),second:this.second.getKey(),ratio:this.ratio})},m.prototype.isIndexed=function(){return a(this.index)},m.prototype.getH=function(){return a(this.index)?this.heightBuffer[this.index]:l.lerp(this.first.getH(),this.second.getH(),this.ratio)},m.prototype.getU=function(){return a(this.index)?this.uBuffer[this.index]:l.lerp(this.first.getU(),this.second.getU(),this.ratio)},m.prototype.getV=function(){return a(this.index)?this.vBuffer[this.index]:l.lerp(this.first.getV(),this.second.getV(),this.ratio)};var L=new n,F=-1,z=[new r,new r],B=[new r,new r];m.prototype.getNormalX=function(){return a(this.index)?this.normalBuffer[2*this.index]:(L=p(this,L),L.x)},m.prototype.getNormalY=function(){return a(this.index)?this.normalBuffer[2*this.index+1]:(L=p(this,L),L.y)};var b=[];return b.push(new m),b.push(new m),b.push(new m),b.push(new m),d(E)})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e){return e+" is required, actual value was undefined"}function r(e,t,n){return"Expected "+n+" to be typeof "+t+", actual typeof was "+e}var a={};return a.typeOf={},a.defined=function(r,a){if(!e(a))throw new t(n(r))},a.typeOf.func=function(e,n){if("function"!=typeof n)throw new t(r(typeof n,"function",e))},a.typeOf.string=function(e,n){if("string"!=typeof n)throw new t(r(typeof n,"string",e))},a.typeOf.number=function(e,n){if("number"!=typeof n)throw new t(r(typeof n,"number",e))},a.typeOf.number.lessThan=function(e,n,r){if(a.typeOf.number(e,n),n>=r)throw new t("Expected "+e+" to be less than "+r+", actual value was "+n)},a.typeOf.number.lessThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n>r)throw new t("Expected "+e+" to be less than or equal to "+r+", actual value was "+n)},a.typeOf.number.greaterThan=function(e,n,r){if(a.typeOf.number(e,n),n<=r)throw new t("Expected "+e+" to be greater than "+r+", actual value was "+n)},a.typeOf.number.greaterThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n<r)throw new t("Expected "+e+" to be greater than or equal to"+r+", actual value was "+n)},a.typeOf.object=function(e,n){if("object"!=typeof n)throw new t(r(typeof n,"object",e))},a.typeOf.bool=function(e,n){if("boolean"!=typeof n)throw new t(r(typeof n,"boolean",e))},a}),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";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),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 n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(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^=e<<7&2636928640,e^=e<<15&4022730752,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,n,r){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:e<0?-1:0},a.signNotZero=function(e){return e<0?-1:1},a.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*a.clamp(e,-1,1)+.5)*n)},a.fromSNorm=function(e,n){return n=t(n,255),a.clamp(e,0,n)/n*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},a.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},a.lerp=function(e,t,n){return(1-n)*e+n*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){var t=a.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},a.clampToLatitudeRange=function(e){return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){return(e%t+t)%t},a.equalsEpsilon=function(e,n,r,a){a=t(a,r);var i=Math.abs(e-n);return i<=a||i<=r*Math.max(Math.abs(e),Math.abs(n))};var i=[1];a.factorial=function(e){var t=i.length;if(e>=t)for(var n=i[t-1],r=t;r<=e;r++)i.push(n*r);return i[e]},a.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},a.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return a.setRandomNumberSeed=function(t){o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(e){return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){return Math.log(e)/Math.log(t)},a.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},a}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n){this.x=t(e,0),this.y=t(n,0)}o.fromElements=function(e,t,r){return n(r)?(r.x=e,r.y=t,r):new o(e,t)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t):new o(e.x,e.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r]=e.y,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=2*r:t=new Array(2*r);for(var a=0;a<r;++a)o.pack(e[a],t,2*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/2:t=new Array(r/2);for(var a=0;a<r;a+=2){var i=a/2;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y)},o.minimumComponent=function(e){return Math.min(e.x,e.y)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){return o.normalize(e,c),o.normalize(t,l),i.acosClamped(o.dot(c,l))};var f=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)},o.ZERO=a(new o(0,0)),o.UNIT_X=a(new o(1,0)),o.UNIT_Y=a(new o(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,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var a=e.clock,i=e.cone,u=t(e.magnitude,1),s=u*Math.sin(i);return r.x=s*Math.cos(a),r.y=s*Math.sin(a),r.z=u*Math.cos(i),r},o.fromElements=function(e,t,r,a){return n(a)?(a.x=e,a.y=t,a.z=r,a):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var a=0;a<r;++a)o.pack(e[a],t,3*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var a=0;a<r;a+=3){var i=a/3;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,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};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var n=o.dot(c,l),r=o.magnitude(o.cross(c,l,c));return Math.atan2(r,n)};var f=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)},o.cross=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=t.x,u=t.y,s=t.z,c=a*s-i*u,l=i*o-r*s,f=r*u-a*o;return n.x=c,n.y=l,n.z=f,n},o.fromDegrees=function(e,t,n,r,a){return e=i.toRadians(e),t=i.toRadians(t),o.fromRadians(e,t,n,r,a)};var h=new o,d=new o,E=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,a,i,u){a=t(a,0);var s=n(i)?i.radiiSquared:E,c=Math.cos(r);h.x=c*Math.cos(e),h.y=c*Math.sin(e),h.z=Math.sin(r),h=o.normalize(h,h),o.multiplyComponents(s,h,d);var l=Math.sqrt(o.dot(h,d));return d=o.divideByScalar(d,l,d),h=o.multiplyByScalar(h,a,h),n(u)||(u=new o),o.add(d,h,u)},o.fromDegreesArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromDegrees(u,s,0,t,r[c])}return r},o.fromRadiansArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromRadians(u,s,0,t,r[c])}return r},o.fromDegreesArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromDegrees(u,s,c,t,r[l])}return r},o.fromRadiansArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromRadians(u,s,c,t,r[l])}return r},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(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,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r,a){"use strict";var i={};i.octEncodeInRange=function(e,t,n){if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var r=n.x,i=n.y;n.x=(1-Math.abs(i))*a.signNotZero(r),n.y=(1-Math.abs(r))*a.signNotZero(i)}return n.x=a.toSNorm(n.x,t),n.y=a.toSNorm(n.y,t),n},i.octEncode=function(e,t){return i.octEncodeInRange(e,255,t)},i.octDecodeInRange=function(e,n,r,i){if(i.x=a.fromSNorm(e,r),i.y=a.fromSNorm(n,r),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){var o=i.x;i.x=(1-Math.abs(i.y))*a.signNotZero(o),i.y=(1-Math.abs(o))*a.signNotZero(i.y)}return t.normalize(i,i)},i.octDecode=function(e,t,n){return i.octDecodeInRange(e,t,255,n)},i.octPackFloat=function(e){return 256*e.x+e.y};var o=new e;return i.octEncodeFloat=function(e){return i.octEncode(e,o),i.octPackFloat(o)},i.octDecodeFloat=function(e,t){var n=e/256,r=Math.floor(n),a=256*(n-r);return i.octDecode(r,a,t)},i.octPack=function(e,t,n,r){var a=i.octEncodeFloat(e),u=i.octEncodeFloat(t),s=i.octEncode(n,o);return r.x=65536*s.x+a,r.y=65536*s.y+u,r},i.octUnpack=function(e,t,n,r){var a=e.x/65536,o=Math.floor(a),u=65536*(a-o);a=e.y/65536;var s=Math.floor(a),c=65536*(a-s);i.octDecodeFloat(u,t),i.octDecodeFloat(c,n),i.octDecode(o,s,r)},i.compressTextureCoordinates=function(e){var t=4095*e.x|0,n=4095*e.y|0;return 4096*t+n},i.decompressTextureCoordinates=function(e,t){var n=e/4096,r=Math.floor(n);return t.x=r/4095,t.y=(e-4096*r)/4095,t},i}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(n,a,u,s,c){var l=n.x,f=n.y,h=n.z,d=a.x,E=a.y,m=a.z,p=l*l*d*d,_=f*f*E*E,y=h*h*m*m,T=p+_+y,R=Math.sqrt(1/T),A=e.multiplyByScalar(n,R,i);if(T<s)return isFinite(R)?e.clone(A,c):void 0;var S=u.x,N=u.y,M=u.z,I=o;I.x=A.x*S*2,I.y=A.y*N*2,I.z=A.z*M*2;var v,O,g,x,w,C,P,U,D,L,F,z=(1-R)*e.magnitude(n)/(.5*e.magnitude(I)),B=0;do{z-=B,g=1/(1+z*S),x=1/(1+z*N),w=1/(1+z*M),C=g*g,P=x*x,U=w*w,D=C*g,L=P*x,F=U*w,v=p*C+_*P+y*U-1,O=p*D*S+_*L*N+y*F*M;var b=-2*O;B=v/b}while(Math.abs(v)>r.EPSILON12);return t(c)?(c.x=l*g,c.y=f*x,c.z=h*w,c):new e(l*g,f*x,h*w)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o){"use strict";function u(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)}u.fromRadians=function(e,r,a,i){return a=t(a,0),n(i)?(i.longitude=e,i.latitude=r,i.height=a,i):new u(e,r,a)},u.fromDegrees=function(e,t,n,r){return e=i.toRadians(e),t=i.toRadians(t),u.fromRadians(e,t,n,r)};var s=new e,c=new e,l=new e,f=new e(1/6378137,1/6378137,1/6356752.314245179),h=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),d=i.EPSILON1;return u.fromCartesian=function(t,r,a){var E=n(r)?r.oneOverRadii:f,m=n(r)?r.oneOverRadiiSquared:h,p=n(r)?r._centerToleranceSquared:d,_=o(t,E,m,p,c);if(n(_)){var y=e.multiplyComponents(_,m,s);y=e.normalize(y,y);var T=e.subtract(t,_,l),R=Math.atan2(y.y,y.x),A=Math.asin(y.z),S=i.sign(e.dot(T,t))*e.magnitude(T);return n(a)?(a.longitude=R,a.latitude=A,a.height=S,a):new u(R,A,S)}},u.clone=function(e,t){if(n(e))return n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},u.ZERO=a(new u(0,0,0)),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,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(t,r,a,i){r=n(r,0),a=n(a,0),i=n(i,0),t._radii=new e(r,a,i),t._radiiSquared=new e(r*r,a*a,i*i),t._radiiToTheFourth=new e(r*r*r*r,a*a*a*a,i*i*i*i),t._oneOverRadii=new e(0===r?0:1/r,0===a?0:1/a,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===a?0:1/(a*a),0===i?0:1/(i*i)),t._minimumRadius=Math.min(r,a,i),t._maximumRadius=Math.max(r,a,i),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,c(this,e,t,n)}a(l.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}}}),l.clone=function(t,n){if(r(t)){var a=t._radii;return r(n)?(e.clone(a,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new l(a.x,a.y,a.z)}},l.fromCartesian3=function(e,t){return r(t)||(t=new l),r(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,r,a){return a=n(a,0),e.pack(t._radii,r,a),r},l.unpack=function(t,r,a){r=n(r,0);var i=e.unpack(t,r);return l.fromCartesian3(i,a)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,n){var a=t.longitude,i=t.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return r(n)||(n=new e),n.x=u,n.y=s,n.z=c,e.normalize(n,n)},l.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var f=new e,h=new e;l.prototype.cartographicToCartesian=function(t,n){var a=f,i=h;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(e.dot(a,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(a,t.height,a),r(n)||(n=new e),e.add(i,a,n)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var d=new e,E=new e,m=new e;return l.prototype.cartesianToCartographic=function(n,a){var i=this.scaleToGeodeticSurface(n,E);if(r(i)){var o=this.geodeticSurfaceNormal(i,d),s=e.subtract(n,i,m),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),f=u.sign(e.dot(s,n))*e.magnitude(s);return r(a)?(a.longitude=c,a.latitude=l,a.height=f,a):new t(c,l,f)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var a=t.x,i=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return e.multiplyByScalar(t,s,n)},l.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},l.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},l.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,a,i){a=n(a,0);var o=this._sqauredXOverSquaredZ;if(r(i)||(i=new e),i.x=0,i.y=0,i.z=t.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},l}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,a,i,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return r(n)?(n.x=i,n.y=o,n.z=u,n):new e(i,o,u)},u.prototype.unproject=function(e,n){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,u=e.z;return r(n)?(n.longitude=i,n.latitude=o,n.height=u,n):new t(i,o,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";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a,i,o,u,s,c){this[0]=n(e,0),this[1]=n(a,0),this[2]=n(u,0),this[3]=n(t,0),this[4]=n(i,0),this[5]=n(s,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(c,0)}function c(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function l(e){for(var t=0,n=0;n<3;++n){var r=e[s.getElementIndex(m[n],E[n])];t+=2*r*r}return Math.sqrt(t)}function f(e,t){for(var n=u.EPSILON15,r=0,a=1,i=0;i<3;++i){var o=Math.abs(e[s.getElementIndex(m[i],E[i])]);o>r&&(a=i,r=o)}var c=1,l=0,f=E[a],h=m[a];if(Math.abs(e[s.getElementIndex(h,f)])>n){var d,p=e[s.getElementIndex(h,h)],_=e[s.getElementIndex(f,f)],y=e[s.getElementIndex(h,f)],T=(p-_)/2/y;d=T<0?-1/(-T+Math.sqrt(1+T*T)):1/(T+Math.sqrt(1+T*T)),c=1/Math.sqrt(1+d*d),l=d*c}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(f,f)]=t[s.getElementIndex(h,h)]=c,t[s.getElementIndex(h,f)]=l,t[s.getElementIndex(f,h)]=-l,t}s.packedLength=9,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t},s.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a},s.clone=function(e,t){if(r(e))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):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t],a[1]=e[t+1],a[2]=e[t+2],a[3]=e[t+3],a[4]=e[t+4],a[5]=e[t+5],a[6]=e[t+6],a[7]=e[t+7],a[8]=e[t+8],a},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[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 s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var n=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,u=e.y*e.y,c=e.y*e.z,l=e.y*e.w,f=e.z*e.z,h=e.z*e.w,d=e.w*e.w,E=n-u-f+d,m=2*(a-h),p=2*(i+l),_=2*(a+h),y=-n+u-f+d,T=2*(c-o),R=2*(i-l),A=2*(c+o),S=-n-u+f+d;return r(t)?(t[0]=E,t[1]=_,t[2]=R,t[3]=m,t[4]=y,t[5]=A,t[6]=p,t[7]=T,t[8]=S,t):new s(E,m,p,_,y,T,R,A,S)},s.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),a=Math.cos(-e.heading),i=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),c=Math.sin(e.roll),l=n*a,f=-i*u+c*o*a,h=c*u+i*o*a,d=n*u,E=i*a+c*o*u,m=-o*i+i*o*u,p=-o,_=c*n,y=i*n;return r(t)?(t[0]=l,t[1]=d,t[2]=p,t[3]=f,t[4]=E,t[5]=_,t[6]=h,t[7]=m,t[8]=y,t):new s(l,f,h,d,E,m,p,_,y)},s.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 s(e.x,0,0,0,e.y,0,0,0,e.z)},s.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 s(e,0,0,0,e,0,0,0,e)},s.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 s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=a,t[6]=0,t[7]=-a,t[8]=n,t):new s(1,0,0,0,n,-a,0,a,n)},s.fromRotationY=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=n,t):new s(n,0,a,0,1,0,-a,0,n)},s.fromRotationZ=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=a,t[2]=0,t[3]=-a,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(n,-a,0,a,n,0,0,0,1)},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):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,n){var r=3*t,a=e[r],i=e[r+1],o=e[r+2];return n.x=a,n.y=i,n.z=o,n},s.setColumn=function(e,t,n,r){r=s.clone(e,r);var a=3*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},s.getRow=function(e,t,n){var r=e[t],a=e[t+3],i=e[t+6];return n.x=r,n.y=a,n.z=i,n},s.setRow=function(e,t,n,r){return r=s.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var h=new e;s.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],h)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],h)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],h)),n};var d=new e;s.getMaximumScale=function(t){return s.getScale(t,d),e.maximumComponent(d)},s.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=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 n[0]=r,n[1]=a,n[2]=i,n[3]=o,n[4]=u,n[5]=s,n[6]=c,n[7]=l,n[8]=f,n},s.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},s.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},s.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[3]*a+e[6]*i,u=e[1]*r+e[4]*a+e[7]*i,s=e[2]*r+e[5]*a+e[8]*i;return n.x=o,n.y=u,n.z=s,n},s.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},s.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},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},s.transpose=function(e,t){var n=e[0],r=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=n,t[1]=r,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var E=[1,0,0],m=[2,2,1],p=new s,_=new s;return s.computeEigenDecomposition=function(e,t){var n=u.EPSILON20,a=10,i=0,o=0;r(t)||(t={});for(var h=t.unitary=s.clone(s.IDENTITY,t.unitary),d=t.diagonal=s.clone(e,t.diagonal),E=n*c(d);o<a&&l(d)>E;)f(d,p),s.transpose(p,_),s.multiply(d,p,d),s.multiply(_,d,d),s.multiply(h,p,h),++i>2&&(++o,i=0);return 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},s.determinant=function(e){var t=e[0],n=e[3],r=e[6],a=e[1],i=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*o)+a*(s*r-n*c)+u*(n*o-i*r)},s.inverse=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[3],o=e[4],u=e[5],c=e[6],l=e[7],f=e[8],h=s.determinant(e);t[0]=o*f-l*u,t[1]=l*a-r*f,t[2]=r*u-o*a,t[3]=c*u-i*f,t[4]=n*f-c*a,t[5]=i*a-n*u,t[6]=i*l-c*o,t[7]=c*r-n*l,t[8]=n*o-i*r;var d=1/h;return s.multiplyByScalar(t,d,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]},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},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,a(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]}, +s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r,a){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(a,0)}o.fromElements=function(e,t,r,a,i){return n(i)?(i.x=e,i.y=t,i.z=r,i.w=a,i):new o(e,t,r,a)},o.fromColor=function(e,t){return n(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(n(e))return n(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)},o.packedLength=4,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r++],a.w=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=4*r:t=new Array(4*r);for(var a=0;a<r;++a)o.pack(e[a],t,4*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/4:t=new Array(r/4);for(var a=0;a<r;a+=4){var i=a/4;t[i]=o.unpack(e,a,t[i])}return t},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,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},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 u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,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,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},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 s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,c);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)&&i.equalsEpsilon(e.w,t.w,r,a)},o.ZERO=a(new o(0,0,0,0)),o.UNIT_X=a(new o(1,0,0,0)),o.UNIT_Y=a(new o(0,1,0,0)),o.UNIT_Z=a(new o(0,0,1,0)),o.UNIT_W=a(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,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,a,i,o,u,s,c,l){"use strict";function f(e,t,n,a,i,o,u,s,c,l,f,h,d,E,m,p){this[0]=r(e,0),this[1]=r(i,0),this[2]=r(c,0),this[3]=r(d,0),this[4]=r(t,0),this[5]=r(o,0),this[6]=r(l,0),this[7]=r(E,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(f,0),this[11]=r(m,0),this[12]=r(a,0),this[13]=r(s,0),this[14]=r(h,0),this[15]=r(p,0)}f.packedLength=16,f.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},f.unpack=function(e,t,n){return t=r(t,0),a(n)||(n=new f),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},f.clone=function(e,t){if(a(e))return a(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 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])},f.fromArray=f.unpack,f.fromColumnMajorArray=function(e,t){return f.clone(e,t)},f.fromRowMajorArray=function(e,t){return a(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 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(t,n,i){return n=r(n,e.ZERO),a(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=1,i):new f(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},f.fromTranslationQuaternionRotationScale=function(e,t,n,r){a(r)||(r=new f);var i=n.x,o=n.y,u=n.z,s=t.x*t.x,c=t.x*t.y,l=t.x*t.z,h=t.x*t.w,d=t.y*t.y,E=t.y*t.z,m=t.y*t.w,p=t.z*t.z,_=t.z*t.w,y=t.w*t.w,T=s-d-p+y,R=2*(c-_),A=2*(l+m),S=2*(c+_),N=-s+d-p+y,M=2*(E-h),I=2*(l-m),v=2*(E+h),O=-s-d+p+y;return r[0]=T*i,r[1]=S*i,r[2]=I*i,r[3]=0,r[4]=R*o,r[5]=N*o,r[6]=v*o,r[7]=0,r[8]=A*u,r[9]=M*u,r[10]=O*u,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},f.fromTranslationRotationScale=function(e,t){return f.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},f.fromTranslation=function(e,t){return f.fromRotationTranslation(c.IDENTITY,e,t)},f.fromScale=function(e,t){return a(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 f(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},f.fromUniformScale=function(e,t){return a(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 f(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var h=new e,d=new e,E=new e;f.fromCamera=function(t,n){var r=t.position,i=t.direction,o=t.up;e.normalize(i,h),e.normalize(e.cross(h,o,d),d),e.normalize(e.cross(d,h,E),E);var u=d.x,s=d.y,c=d.z,l=h.x,m=h.y,p=h.z,_=E.x,y=E.y,T=E.z,R=r.x,A=r.y,S=r.z,N=u*-R+s*-A+c*-S,M=_*-R+y*-A+T*-S,I=l*R+m*A+p*S;return a(n)?(n[0]=u,n[1]=_,n[2]=-l,n[3]=0,n[4]=s,n[5]=y,n[6]=-m,n[7]=0,n[8]=c,n[9]=T,n[10]=-p,n[11]=0,n[12]=N,n[13]=M,n[14]=I,n[15]=1,n):new f(u,s,c,N,_,y,T,M,-l,-m,-p,I,0,0,0,1)},f.computePerspectiveFieldOfView=function(e,t,n,r,a){var i=Math.tan(.5*e),o=1/i,u=o/t,s=(r+n)/(n-r),c=2*r*n/(n-r);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=c,a[15]=0,a},f.computeOrthographicOffCenter=function(e,t,n,r,a,i,o){var u=1/(t-e),s=1/(r-n),c=1/(i-a),l=-(t+e)*u,f=-(r+n)*s,h=-(i+a)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=f,o[14]=h,o[15]=1,o},f.computePerspectiveOffCenter=function(e,t,n,r,a,i,o){var u=2*a/(t-e),s=2*a/(r-n),c=(t+e)/(t-e),l=(r+n)/(r-n),f=-(i+a)/(i-a),h=-1,d=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=f,o[11]=h,o[12]=0,o[13]=0,o[14]=d,o[15]=0,o},f.computeInfinitePerspectiveOffCenter=function(e,t,n,r,a,i){var o=2*a/(t-e),u=2*a/(r-n),s=(t+e)/(t-e),c=(r+n)/(r-n),l=-1,f=-1,h=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=s,i[9]=c,i[10]=l,i[11]=f,i[12]=0,i[13]=0,i[14]=h,i[15]=0,i},f.computeViewportTransformation=function(e,t,n,a){e=r(e,r.EMPTY_OBJECT);var i=r(e.x,0),o=r(e.y,0),u=r(e.width,0),s=r(e.height,0);t=r(t,0),n=r(n,1);var c=.5*u,l=.5*s,f=.5*(n-t),h=c,d=l,E=f,m=i+c,p=o+l,_=t+f,y=1;return a[0]=h,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=d,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=E,a[11]=0,a[12]=m,a[13]=p,a[14]=_,a[15]=y,a},f.computeView=function(t,n,r,a,i){return i[0]=a.x,i[1]=r.x,i[2]=-n.x,i[3]=0,i[4]=a.y,i[5]=r.y,i[6]=-n.y,i[7]=0,i[8]=a.z,i[9]=r.z,i[10]=-n.z,i[11]=0,i[12]=-e.dot(a,t),i[13]=-e.dot(r,t),i[14]=e.dot(n,t),i[15]=1,i},f.toArray=function(e,t){return a(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]]},f.getElementIndex=function(e,t){return 4*e+t},f.getColumn=function(e,t,n){var r=4*t,a=e[r],i=e[r+1],o=e[r+2],u=e[r+3];return n.x=a,n.y=i,n.z=o,n.w=u,n},f.setColumn=function(e,t,n,r){r=f.clone(e,r);var a=4*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r[a+3]=n.w,r},f.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},f.getRow=function(e,t,n){var r=e[t],a=e[t+4],i=e[t+8],o=e[t+12];return n.x=r,n.y=a,n.z=i,n.w=o,n},f.setRow=function(e,t,n,r){return r=f.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var m=new e;f.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],m)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],m)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],m)),n};var p=new e;f.getMaximumScale=function(t){return f.getScale(t,p),e.maximumComponent(p)},f.multiply=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],f=e[8],h=e[9],d=e[10],E=e[11],m=e[12],p=e[13],_=e[14],y=e[15],T=t[0],R=t[1],A=t[2],S=t[3],N=t[4],M=t[5],I=t[6],v=t[7],O=t[8],g=t[9],x=t[10],w=t[11],C=t[12],P=t[13],U=t[14],D=t[15],L=r*T+u*R+f*A+m*S,F=a*T+s*R+h*A+p*S,z=i*T+c*R+d*A+_*S,B=o*T+l*R+E*A+y*S,b=r*N+u*M+f*I+m*v,q=a*N+s*M+h*I+p*v,G=i*N+c*M+d*I+_*v,W=o*N+l*M+E*I+y*v,X=r*O+u*g+f*x+m*w,V=a*O+s*g+h*x+p*w,H=i*O+c*g+d*x+_*w,Y=o*O+l*g+E*x+y*w,k=r*C+u*P+f*U+m*D,Z=a*C+s*P+h*U+p*D,j=i*C+c*P+d*U+_*D,K=o*C+l*P+E*U+y*D;return n[0]=L,n[1]=F,n[2]=z,n[3]=B,n[4]=b,n[5]=q,n[6]=G,n[7]=W,n[8]=X,n[9]=V,n[10]=H,n[11]=Y,n[12]=k,n[13]=Z,n[14]=j,n[15]=K,n},f.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},f.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},f.multiplyTransformation=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=e[12],d=e[13],E=e[14],m=t[0],p=t[1],_=t[2],y=t[4],T=t[5],R=t[6],A=t[8],S=t[9],N=t[10],M=t[12],I=t[13],v=t[14],O=r*m+o*p+c*_,g=a*m+u*p+l*_,x=i*m+s*p+f*_,w=r*y+o*T+c*R,C=a*y+u*T+l*R,P=i*y+s*T+f*R,U=r*A+o*S+c*N,D=a*A+u*S+l*N,L=i*A+s*S+f*N,F=r*M+o*I+c*v+h,z=a*M+u*I+l*v+d,B=i*M+s*I+f*v+E;return n[0]=O,n[1]=g,n[2]=x,n[3]=0,n[4]=w,n[5]=C,n[6]=P,n[7]=0,n[8]=U,n[9]=D,n[10]=L,n[11]=0,n[12]=F,n[13]=z,n[14]=B,n[15]=1,n},f.multiplyByMatrix3=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=t[0],d=t[1],E=t[2],m=t[3],p=t[4],_=t[5],y=t[6],T=t[7],R=t[8],A=r*h+o*d+c*E,S=a*h+u*d+l*E,N=i*h+s*d+f*E,M=r*m+o*p+c*_,I=a*m+u*p+l*_,v=i*m+s*p+f*_,O=r*y+o*T+c*R,g=a*y+u*T+l*R,x=i*y+s*T+f*R;return n[0]=A,n[1]=S,n[2]=N,n[3]=0,n[4]=M,n[5]=I,n[6]=v,n[7]=0,n[8]=O,n[9]=g,n[10]=x,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},f.multiplyByTranslation=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=r*e[0]+a*e[4]+i*e[8]+e[12],u=r*e[1]+a*e[5]+i*e[9]+e[13],s=r*e[2]+a*e[6]+i*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=s,n[15]=e[15],n};var _=new e;f.multiplyByUniformScale=function(e,t,n){return _.x=t,_.y=t,_.z=t,f.multiplyByScale(e,_,n)},f.multiplyByScale=function(e,t,n){var r=t.x,a=t.y,i=t.z;return 1===r&&1===a&&1===i?f.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=a*e[4],n[5]=a*e[5],n[6]=a*e[6],n[7]=0,n[8]=i*e[8],n[9]=i*e[9],n[10]=i*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},f.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=t.w,u=e[0]*r+e[4]*a+e[8]*i+e[12]*o,s=e[1]*r+e[5]*a+e[9]*i+e[13]*o,c=e[2]*r+e[6]*a+e[10]*i+e[14]*o,l=e[3]*r+e[7]*a+e[11]*i+e[15]*o;return n.x=u,n.y=s,n.z=c,n.w=l,n},f.multiplyByPointAsVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i,u=e[1]*r+e[5]*a+e[9]*i,s=e[2]*r+e[6]*a+e[10]*i;return n.x=o,n.y=u,n.z=s,n},f.multiplyByPoint=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i+e[12],u=e[1]*r+e[5]*a+e[9]*i+e[13],s=e[2]*r+e[6]*a+e[10]*i+e[14];return n.x=o,n.y=u,n.z=s,n},f.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},f.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},f.transpose=function(e,t){var n=e[1],r=e[2],a=e[3],i=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=o,t[14]=u,t[15]=e[15],t},f.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},f.equals=function(e,t){return e===t||a(e)&&a(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},f.equalsEpsilon=function(e,t,n){return e===t||a(e)&&a(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},f.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},f.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};var y=new c,T=new c,R=new t,A=new t(0,0,0,1);return f.inverse=function(e,n){if(c.equalsEpsilon(f.getRotation(e,y),T,s.EPSILON7)&&t.equals(f.getRow(e,3,R),A))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],a=e[4],i=e[8],o=e[12],u=e[1],h=e[5],d=e[9],E=e[13],m=e[2],p=e[6],_=e[10],S=e[14],N=e[3],M=e[7],I=e[11],v=e[15],O=_*v,g=S*I,x=p*v,w=S*M,C=p*I,P=_*M,U=m*v,D=S*N,L=m*I,F=_*N,z=m*M,B=p*N,b=O*h+w*d+C*E-(g*h+x*d+P*E),q=g*u+U*d+F*E-(O*u+D*d+L*E),G=x*u+D*h+z*E-(w*u+U*h+B*E),W=P*u+L*h+B*d-(C*u+F*h+z*d),X=g*a+x*i+P*o-(O*a+w*i+C*o),V=O*r+D*i+L*o-(g*r+U*i+F*o),H=w*r+U*a+B*o-(x*r+D*a+z*o),Y=C*r+F*a+z*i-(P*r+L*a+B*i);O=i*E,g=o*d,x=a*E,w=o*h,C=a*d,P=i*h,U=r*E,D=o*u,L=r*d,F=i*u,z=r*h,B=a*u;var k=O*M+w*I+C*v-(g*M+x*I+P*v),Z=g*N+U*I+F*v-(O*N+D*I+L*v),j=x*N+D*M+z*v-(w*N+U*M+B*v),K=P*N+L*M+B*I-(C*N+F*M+z*I),J=x*_+P*S+g*p-(C*S+O*p+w*_),Q=L*S+O*m+D*_-(U*_+F*S+g*m),$=U*p+B*S+w*m-(z*S+x*m+D*p),ee=z*_+C*m+F*p-(L*p+B*_+P*m),te=r*b+a*q+i*G+o*W;if(Math.abs(te)<s.EPSILON20)throw new l("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=b*te,n[1]=q*te,n[2]=G*te,n[3]=W*te,n[4]=X*te,n[5]=V*te,n[6]=H*te,n[7]=Y*te,n[8]=k*te,n[9]=Z*te,n[10]=j*te,n[11]=K*te,n[12]=J*te,n[13]=Q*te,n[14]=$*te,n[15]=ee*te,n},f.inverseTransformation=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],f=e[12],h=e[13],d=e[14],E=-n*f-r*h-a*d,m=-i*f-o*h-u*d,p=-s*f-c*h-l*d;return t[0]=n,t[1]=i,t[2]=s,t[3]=0,t[4]=r,t[5]=o,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=l,t[11]=0,t[12]=E,t[13]=m,t[14]=p,t[15]=1,t},f.IDENTITY=u(new f(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),f.ZERO=u(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,i(f.prototype,{length:{get:function(){return f.packedLength}}}),f.prototype.clone=function(e){return f.clone(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},f.prototype.equalsEpsilon=function(e,t){return f.equalsEpsilon(this,e,t)},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/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(e,t,r,a){this.west=n(e,0),this.south=n(t,0),this.east=n(r,0),this.north=n(a,0)}a(c.prototype,{width:{get:function(){return c.computeWidth(this)}},height:{get:function(){return c.computeHeight(this)}}}),c.packedLength=4,c.pack=function(e,t,r){return r=n(r,0),t[r++]=e.west,t[r++]=e.south,t[r++]=e.east,t[r]=e.north,t},c.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new c),a.west=e[t++],a.south=e[t++],a.east=e[t++],a.north=e[t],a},c.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=s.TWO_PI),t-n},c.computeHeight=function(e){return e.north-e.south},c.fromDegrees=function(e,t,a,i,o){return e=s.toRadians(n(e,0)),t=s.toRadians(n(t,0)),a=s.toRadians(n(a,0)),i=s.toRadians(n(i,0)),r(o)?(o.west=e,o.south=t,o.east=a,o.north=i,o):new c(e,t,a,i)},c.fromRadians=function(e,t,a,i,o){return r(o)?(o.west=n(e,0),o.south=n(t,0),o.east=n(a,0),o.north=n(i,0),o):new c(e,t,a,i)},c.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,u=Number.MAX_VALUE,l=-Number.MAX_VALUE,f=0,h=e.length;f<h;f++){var d=e[f];n=Math.min(n,d.longitude),a=Math.max(a,d.longitude),u=Math.min(u,d.latitude),l=Math.max(l,d.latitude);var E=d.longitude>=0?d.longitude:d.longitude+s.TWO_PI;i=Math.min(i,E),o=Math.max(o,E)}return a-n>o-i&&(n=i,a=o,a>s.PI&&(a-=s.TWO_PI),n>s.PI&&(n-=s.TWO_PI)),r(t)?(t.west=n,t.south=u,t.east=a,t.north=l,t):new c(n,u,a,l)},c.fromCartesianArray=function(e,t,n){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,u=-Number.MAX_VALUE,l=Number.MAX_VALUE,f=-Number.MAX_VALUE,h=0,d=e.length;h<d;h++){var E=t.cartesianToCartographic(e[h]);a=Math.min(a,E.longitude),i=Math.max(i,E.longitude),l=Math.min(l,E.latitude),f=Math.max(f,E.latitude);var m=E.longitude>=0?E.longitude:E.longitude+s.TWO_PI;o=Math.min(o,m),u=Math.max(u,m)}return i-a>u-o&&(a=o,i=u,i>s.PI&&(i-=s.TWO_PI),a>s.PI&&(a-=s.TWO_PI)),r(n)?(n.west=a,n.south=l,n.east=i,n.north=f,n):new c(a,l,i,f)},c.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new c(e.west,e.south,e.east,e.north)},c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.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},c.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},c.validate=function(e){},c.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)},c.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)},c.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)},c.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)},c.center=function(t,n){var a=t.east,i=t.west;a<i&&(a+=s.TWO_PI);var o=s.negativePiToPi(.5*(i+a)),u=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=u,n.height=0,n):new e(o,u)},c.intersection=function(e,t,n){var a=e.east,i=e.west,o=t.east,u=t.west;a<i&&o>0?a+=s.TWO_PI:o<u&&a>0&&(o+=s.TWO_PI),a<i&&u<0?u+=s.TWO_PI:o<u&&i<0&&(i+=s.TWO_PI);var l=s.negativePiToPi(Math.max(i,u)),f=s.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&f<=l)){var h=Math.max(e.south,t.south),d=Math.min(e.north,t.north);if(!(h>=d))return r(n)?(n.west=l,n.south=h,n.east=f,n.north=d,n):new c(l,h,f,d)}},c.simpleIntersection=function(e,t,n){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(i>=u||a>=o))return r(n)?(n.west=a,n.south=i,n.east=o,n.north=u,n):new c(a,i,o,u)},c.union=function(e,t,n){r(n)||(n=new c);var a=e.east,i=e.west,o=t.east,u=t.west;a<i&&o>0?a+=s.TWO_PI:o<u&&a>0&&(o+=s.TWO_PI),a<i&&u<0?u+=s.TWO_PI:o<u&&i<0&&(i+=s.TWO_PI);var l=s.convertLongitudeRange(Math.min(i,u)),f=s.convertLongitudeRange(Math.max(a,o));return n.west=l,n.south=Math.min(e.south,t.south),n.east=f,n.north=Math.max(e.north,t.north),n},c.expand=function(e,t,n){return r(n)||(n=new c),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},c.contains=function(e,t){var n=t.longitude,r=t.latitude,a=e.west,i=e.east;return i<a&&(i+=s.TWO_PI,n<0&&(n+=s.TWO_PI)),(n>a||s.equalsEpsilon(n,a,s.EPSILON14))&&(n<i||s.equalsEpsilon(n,i,s.EPSILON14))&&r>=e.south&&r<=e.north};var l=new e;return c.subsample=function(e,t,a,i){t=n(t,o.WGS84),a=n(a,0),r(i)||(i=[]);var u=0,f=e.north,h=e.south,d=e.east,E=e.west,m=l;m.height=a,m.longitude=E,m.latitude=f,i[u]=t.cartographicToCartesian(m,i[u]),u++,m.longitude=d,i[u]=t.cartographicToCartesian(m,i[u]),u++,m.latitude=h,i[u]=t.cartographicToCartesian(m,i[u]),u++,m.longitude=E,i[u]=t.cartographicToCartesian(m,i[u]),u++,f<0?m.latitude=f:h>0?m.latitude=h:m.latitude=0;for(var p=1;p<8;++p)m.longitude=-Math.PI+p*s.PI_OVER_TWO,c.contains(e,m)&&(i[u]=t.cartographicToCartesian(m,i[u]),u++);return 0===m.latitude&&(m.longitude=E,i[u]=t.cartographicToCartesian(m,i[u]),u++,m.longitude=d,i[u]=t.cartographicToCartesian(m,i[u]),u++),i.length=u,i},c.MAX_VALUE=u(new c(-Math.PI,-s.PI_OVER_TWO,Math.PI,s.PI_OVER_TWO)),c}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var d=new e,E=new e,m=new e,p=new e,_=new e,y=new e,T=new e,R=new e,A=new e,S=new e,N=new e,M=new e;h.fromPoints=function(t,n){if(a(n)||(n=new h),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var r=e.clone(t[0],T),i=e.clone(r,d),o=e.clone(r,E),u=e.clone(r,m),s=e.clone(r,p),c=e.clone(r,_),l=e.clone(r,y),f=t.length,I=1;I<f;I++){e.clone(t[I],r);var v=r.x,O=r.y,g=r.z;v<i.x&&e.clone(r,i),v>s.x&&e.clone(r,s),O<o.y&&e.clone(r,o),O>c.y&&e.clone(r,c),g<u.z&&e.clone(r,u),g>l.z&&e.clone(r,l)}var x=e.magnitudeSquared(e.subtract(s,i,R)),w=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=i,U=s,D=x;w>D&&(D=w,P=o,U=c),C>D&&(D=C,P=u,U=l);var L=A;L.x=.5*(P.x+U.x),L.y=.5*(P.y+U.y),L.z=.5*(P.z+U.z);var F=e.magnitudeSquared(e.subtract(U,L,R)),z=Math.sqrt(F),B=S;B.x=i.x,B.y=o.y,B.z=u.z;var b=N;b.x=s.x,b.y=c.y,b.z=l.z;var q=e.multiplyByScalar(e.add(B,b,R),.5,M),G=0;for(I=0;I<f;I++){e.clone(t[I],r);var W=e.magnitude(e.subtract(r,q,R));W>G&&(G=W);var X=e.magnitudeSquared(e.subtract(r,L,R));if(X>F){var V=Math.sqrt(X);z=.5*(z+V),F=z*z;var H=V-z;L.x=(z*L.x+H*r.x)/V,L.y=(z*L.y+H*r.y)/V,L.z=(z*L.z+H*r.z)/V}}return z<G?(e.clone(L,n.center),n.radius=z):(e.clone(q,n.center),n.radius=G),n};var I=new o,v=new e,O=new e,g=new t,x=new t;h.fromRectangle2D=function(e,t,n){return h.fromRectangleWithHeights2D(e,t,0,0,n)},h.fromRectangleWithHeights2D=function(t,n,i,o,u){if(a(u)||(u=new h),!a(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;n=r(n,I),f.southwest(t,g),g.height=i,f.northeast(t,x),x.height=o;var s=n.project(g,v),c=n.project(x,O),l=c.x-s.x,d=c.y-s.y,E=c.z-s.z;u.radius=.5*Math.sqrt(l*l+d*d+E*E);var m=u.center;return m.x=s.x+.5*l,m.y=s.y+.5*d,m.z=s.z+.5*E,u};var w=[];h.fromRectangle3D=function(e,t,n,o){t=r(t,i.WGS84),n=r(n,0);var u;return a(e)&&(u=f.subsample(e,t,n,w)),h.fromPoints(u,o)},h.fromVertices=function(t,n,i,o){if(a(o)||(o=new h),!a(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;n=r(n,e.ZERO),i=r(i,3);var u=T;u.x=t[0]+n.x,u.y=t[1]+n.y,u.z=t[2]+n.z;for(var s=e.clone(u,d),c=e.clone(u,E),l=e.clone(u,m),f=e.clone(u,p),I=e.clone(u,_),v=e.clone(u,y),O=t.length,g=0;g<O;g+=i){var x=t[g]+n.x,w=t[g+1]+n.y,C=t[g+2]+n.z;u.x=x,u.y=w,u.z=C,x<s.x&&e.clone(u,s),x>f.x&&e.clone(u,f),w<c.y&&e.clone(u,c),w>I.y&&e.clone(u,I),C<l.z&&e.clone(u,l),C>v.z&&e.clone(u,v)}var P=e.magnitudeSquared(e.subtract(f,s,R)),U=e.magnitudeSquared(e.subtract(I,c,R)),D=e.magnitudeSquared(e.subtract(v,l,R)),L=s,F=f,z=P;U>z&&(z=U,L=c,F=I),D>z&&(z=D,L=l,F=v);var B=A;B.x=.5*(L.x+F.x),B.y=.5*(L.y+F.y),B.z=.5*(L.z+F.z);var b=e.magnitudeSquared(e.subtract(F,B,R)),q=Math.sqrt(b),G=S;G.x=s.x,G.y=c.y,G.z=l.z;var W=N;W.x=f.x,W.y=I.y,W.z=v.z;var X=e.multiplyByScalar(e.add(G,W,R),.5,M),V=0;for(g=0;g<O;g+=i){u.x=t[g]+n.x,u.y=t[g+1]+n.y,u.z=t[g+2]+n.z;var H=e.magnitude(e.subtract(u,X,R));H>V&&(V=H);var Y=e.magnitudeSquared(e.subtract(u,B,R));if(Y>b){var k=Math.sqrt(Y);q=.5*(q+k),b=q*q;var Z=k-q;B.x=(q*B.x+Z*u.x)/k,B.y=(q*B.y+Z*u.y)/k,B.z=(q*B.z+Z*u.z)/k}}return q<V?(e.clone(B,o.center),o.radius=q):(e.clone(X,o.center),o.radius=V),o},h.fromEncodedCartesianVertices=function(t,n,r){if(a(r)||(r=new h),!a(t)||!a(n)||t.length!==n.length||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var i=T;i.x=t[0]+n[0],i.y=t[1]+n[1],i.z=t[2]+n[2];for(var o=e.clone(i,d),u=e.clone(i,E),s=e.clone(i,m),c=e.clone(i,p),l=e.clone(i,_),f=e.clone(i,y),I=t.length,v=0;v<I;v+=3){var O=t[v]+n[v],g=t[v+1]+n[v+1],x=t[v+2]+n[v+2];i.x=O,i.y=g,i.z=x,O<o.x&&e.clone(i,o),O>c.x&&e.clone(i,c),g<u.y&&e.clone(i,u),g>l.y&&e.clone(i,l),x<s.z&&e.clone(i,s),x>f.z&&e.clone(i,f)}var w=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=e.magnitudeSquared(e.subtract(f,s,R)),U=o,D=c,L=w;C>L&&(L=C,U=u,D=l),P>L&&(L=P,U=s,D=f);var F=A;F.x=.5*(U.x+D.x),F.y=.5*(U.y+D.y),F.z=.5*(U.z+D.z);var z=e.magnitudeSquared(e.subtract(D,F,R)),B=Math.sqrt(z),b=S;b.x=o.x,b.y=u.y,b.z=s.z;var q=N;q.x=c.x,q.y=l.y,q.z=f.z;var G=e.multiplyByScalar(e.add(b,q,R),.5,M),W=0;for(v=0;v<I;v+=3){i.x=t[v]+n[v],i.y=t[v+1]+n[v+1],i.z=t[v+2]+n[v+2];var X=e.magnitude(e.subtract(i,G,R));X>W&&(W=X);var V=e.magnitudeSquared(e.subtract(i,F,R));if(V>z){var H=Math.sqrt(V);B=.5*(B+H),z=B*B;var Y=H-B;F.x=(B*F.x+Y*i.x)/H,F.y=(B*F.y+Y*i.y)/H,F.z=(B*F.z+Y*i.z)/H}}return B<W?(e.clone(F,r.center),r.radius=B):(e.clone(G,r.center),r.radius=W),r},h.fromCornerPoints=function(t,n,r){a(r)||(r=new h);var i=r.center;return e.add(t,n,i),e.multiplyByScalar(i,.5,i),r.radius=e.distance(i,n),r},h.fromEllipsoid=function(t,n){return a(n)||(n=new h),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var C=new e;h.fromBoundingSpheres=function(t,n){if(a(n)||(n=new h),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var r=t.length;if(1===r)return h.clone(t[0],n);if(2===r)return h.union(t[0],t[1],n);for(var i=[],o=0;o<r;o++)i.push(t[o].center);n=h.fromPoints(i,n);var u=n.center,s=n.radius;for(o=0;o<r;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,C)+c.radius)}return n.radius=s,n};var P=new e,U=new e,D=new e;h.fromOrientedBoundingBox=function(t,n){a(n)||(n=new h);var r=t.halfAxes,i=c.getColumn(r,0,P),o=c.getColumn(r,1,U),u=c.getColumn(r,2,D),s=e.magnitude(i),l=e.magnitude(o),f=e.magnitude(u);return n.center=e.clone(t.center,n.center),n.radius=Math.max(s,l,f),n},h.clone=function(t,n){if(a(t))return a(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new h(t.center,t.radius)},h.packedLength=4,h.pack=function(e,t,n){n=r(n,0);var a=e.center;return t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n]=e.radius,t},h.unpack=function(e,t,n){t=r(t,0),a(n)||(n=new h);var i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};var L=new e,F=new e;h.union=function(t,n,r){a(r)||(r=new h);var i=t.center,o=t.radius,u=n.center,s=n.radius,c=e.subtract(u,i,L),l=e.magnitude(c);if(o>=l+s)return t.clone(r),r;if(s>=l+o)return n.clone(r),r;var f=.5*(o+l+s),d=e.multiplyByScalar(c,(-o+f)/l,F);return e.add(d,i,d),e.clone(d,r.center),r.radius=f,r};var z=new e;h.expand=function(t,n,r){r=h.clone(t,r);var a=e.magnitude(e.subtract(n,r.center,z));return a>r.radius&&(r.radius=a),r},h.intersectPlane=function(t,n){var r=t.center,a=t.radius,i=n.normal,o=e.dot(i,r)+n.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},h.transform=function(e,t,n){return a(n)||(n=new h),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=l.getMaximumScale(t)*e.radius,n};var B=new e;h.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,B);return e.magnitudeSquared(r)-t.radius*t.radius},h.transformWithoutScale=function(e,t,n){return a(n)||(n=new h),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var b=new e;h.computePlaneDistances=function(t,n,r,i){a(i)||(i=new s);var o=e.subtract(t.center,n,b),u=e.dot(r,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var q=new e,G=new e,W=new e,X=new e,V=new e,H=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var Z=new o;return h.projectTo2D=function(t,n,a){ +n=r(n,Z);var i=n.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,q),c=e.cross(e.UNIT_Z,s,G);e.normalize(c,c);var l=e.cross(s,c,W);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var f=e.negate(l,V),d=e.negate(c,X),E=Y,m=E[0];e.add(s,l,m),e.add(m,c,m),m=E[1],e.add(s,l,m),e.add(m,d,m),m=E[2],e.add(s,f,m),e.add(m,d,m),m=E[3],e.add(s,f,m),e.add(m,c,m),e.negate(s,s),m=E[4],e.add(s,l,m),e.add(m,c,m),m=E[5],e.add(s,l,m),e.add(m,d,m),m=E[6],e.add(s,f,m),e.add(m,d,m),m=E[7],e.add(s,f,m),e.add(m,c,m);for(var p=E.length,_=0;_<p;++_){var y=E[_];e.add(o,y,y);var T=i.cartesianToCartographic(y,H);n.project(T,y)}a=h.fromPoints(E,a),o=a.center;var R=o.x,A=o.y,S=o.z;return o.x=S,o.y=R,o.z=A,a},h.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},h.equals=function(t,n){return t===n||a(t)&&a(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},h.prototype.intersectPlane=function(e){return h.intersectPlane(this,e)},h.prototype.distanceSquaredTo=function(e){return h.distanceSquaredTo(this,e)},h.prototype.computePlaneDistances=function(e,t,n){return h.computePlaneDistances(this,e,t,n)},h.prototype.isOccluded=function(e){return h.isOccluded(this,e)},h.prototype.equals=function(e){return h.equals(this,e)},h.prototype.clone=function(e){return h.clone(this,e)},h}),define("Core/EllipsoidalOccluder",["./BoundingSphere","./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./Rectangle"],function(e,t,n,r,a,i,o){"use strict";function u(e,n){this._ellipsoid=e,this._cameraPosition=new t,this._cameraPositionInScaledSpace=new t,this._distanceToLimbInScaledSpaceSquared=0,r(n)&&(this.cameraPosition=n)}function s(e,n,r){var a=e.transformPositionToScaledSpace(n,E),i=t.magnitudeSquared(a),o=Math.sqrt(i),u=t.divideByScalar(a,o,m);i=Math.max(1,i),o=Math.max(1,o);var s=t.dot(u,r),c=t.magnitude(t.cross(u,r,u)),l=1/o,f=Math.sqrt(i-1)*l;return 1/(s*l-c*f)}function c(e,n,r){if(!(n<=0||n===1/0||n!==n))return t.multiplyByScalar(e,n,r)}function l(e,n){return t.equals(n,t.ZERO)?n:(e.transformPositionToScaledSpace(n,p),t.normalize(p,p))}a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(e){var n=this._ellipsoid,r=n.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),a=t.magnitudeSquared(r)-1;t.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=r,this._distanceToLimbInScaledSpaceSquared=a}}});var f=new t;u.prototype.isPointVisible=function(e){var t=this._ellipsoid,n=t.transformPositionToScaledSpace(e,f);return this.isScaledSpacePointVisible(n)},u.prototype.isScaledSpacePointVisible=function(e){var n=this._cameraPositionInScaledSpace,r=this._distanceToLimbInScaledSpaceSquared,a=t.subtract(e,n,f),i=-t.dot(a,n),o=r<0?i>0:i>r&&i*i/t.magnitudeSquared(a)>r;return!o},u.prototype.computeHorizonCullingPoint=function(e,n,a){r(a)||(a=new t);for(var i=this._ellipsoid,o=l(i,e),u=0,f=0,h=n.length;f<h;++f){var d=n[f],E=s(i,d,o);u=Math.max(u,E)}return c(o,u,a)};var h=new t;u.prototype.computeHorizonCullingPointFromVertices=function(e,a,i,o,u){r(u)||(u=new t),o=n(o,t.ZERO);for(var f=this._ellipsoid,d=l(f,e),E=0,m=0,p=a.length;m<p;m+=i){h.x=a[m]+o.x,h.y=a[m+1]+o.y,h.z=a[m+2]+o.z;var _=s(f,h,d);E=Math.max(E,_)}return c(d,E,u)};var d=[];u.prototype.computeHorizonCullingPointFromRectangle=function(n,r,a){var i=o.subsample(n,r,0,d),u=e.fromPoints(i);if(!(t.magnitude(u.center)<.1*r.minimumRadius))return this.computeHorizonCullingPoint(u.center,i,a)};var E=new t,m=new t,p=new t;return u}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047};return e(t)}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,n,r,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(e){switch(e){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(t){return e(t)&&(t===i.UNSIGNED_BYTE||t===i.UNSIGNED_SHORT||t===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,n,a){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,a):new Uint16Array(t,n,a)},n(i)}),define("Core/Intersections2D",["./Cartesian3","./defined","./DeveloperError"],function(e,t,n){"use strict";var r={};return r.clipTriangleAtAxisAlignedThreshold=function(e,n,r,a,i,o){t(o)?o.length=0:o=[];var u,s,c;n?(u=r<e,s=a<e,c=i<e):(u=r>e,s=a>e,c=i>e);var l,f,h,d,E,m,p=u+s+c;return 1===p?u?(l=(e-r)/(a-r),f=(e-r)/(i-r),o.push(1),o.push(2),1!==f&&(o.push(-1),o.push(0),o.push(2),o.push(f)),1!==l&&(o.push(-1),o.push(0),o.push(1),o.push(l))):s?(h=(e-a)/(i-a),d=(e-a)/(r-a),o.push(2),o.push(0),1!==d&&(o.push(-1),o.push(1),o.push(0),o.push(d)),1!==h&&(o.push(-1),o.push(1),o.push(2),o.push(h))):c&&(E=(e-i)/(r-i),m=(e-i)/(a-i),o.push(0),o.push(1),1!==m&&(o.push(-1),o.push(2),o.push(1),o.push(m)),1!==E&&(o.push(-1),o.push(2),o.push(0),o.push(E))):2===p?u||r===e?s||a===e?c||i===e||(f=(e-r)/(i-r),h=(e-a)/(i-a),o.push(2),o.push(-1),o.push(0),o.push(2),o.push(f),o.push(-1),o.push(1),o.push(2),o.push(h)):(m=(e-i)/(a-i),l=(e-r)/(a-r),o.push(1),o.push(-1),o.push(2),o.push(1),o.push(m),o.push(-1),o.push(0),o.push(1),o.push(l)):(d=(e-a)/(r-a),E=(e-i)/(r-i),o.push(0),o.push(-1),o.push(1),o.push(0),o.push(d),o.push(-1),o.push(2),o.push(0),o.push(E)):3!==p&&(o.push(0),o.push(1),o.push(2)),o},r.computeBarycentricCoordinates=function(n,r,a,i,o,u,s,c,l){var f=a-s,h=s-o,d=u-c,E=i-c,m=1/(d*f+h*E),p=r-c,_=n-s,y=(d*_+h*p)*m,T=(-E*_+f*p)*m,R=1-y-T;return t(l)?(l.x=y,l.y=T,l.z=R,l):new e(y,T,R)},r}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Intersect"],function(e,t,n,r,a){"use strict";function i(r,a,i){this.minimum=e.clone(t(r,e.ZERO)),this.maximum=e.clone(t(a,e.ZERO)),n(i)?i=e.clone(i):(i=e.add(this.minimum,this.maximum,new e),e.multiplyByScalar(i,.5,i)),this.center=i}i.fromPoints=function(t,r){if(n(r)||(r=new i),!n(t)||0===t.length)return r.minimum=e.clone(e.ZERO,r.minimum),r.maximum=e.clone(e.ZERO,r.maximum),r.center=e.clone(e.ZERO,r.center),r;for(var a=t[0].x,o=t[0].y,u=t[0].z,s=t[0].x,c=t[0].y,l=t[0].z,f=t.length,h=1;h<f;h++){var d=t[h],E=d.x,m=d.y,p=d.z;a=Math.min(E,a),s=Math.max(E,s),o=Math.min(m,o),c=Math.max(m,c),u=Math.min(p,u),l=Math.max(p,l)}var _=r.minimum;_.x=a,_.y=o,_.z=u;var y=r.maximum;y.x=s,y.y=c,y.z=l;var T=e.add(_,y,r.center);return e.multiplyByScalar(T,.5,T),r},i.clone=function(t,r){if(n(t))return n(r)?(r.minimum=e.clone(t.minimum,r.minimum),r.maximum=e.clone(t.maximum,r.maximum),r.center=e.clone(t.center,r.center),r):new i(t.minimum,t.maximum)},i.equals=function(t,r){return t===r||n(t)&&n(r)&&e.equals(t.center,r.center)&&e.equals(t.minimum,r.minimum)&&e.equals(t.maximum,r.maximum)};var o=new e;return i.intersectPlane=function(t,n){o=e.subtract(t.maximum,t.minimum,o);var r=e.multiplyByScalar(o,.5,o),i=n.normal,u=r.x*Math.abs(i.x)+r.y*Math.abs(i.y)+r.z*Math.abs(i.z),s=e.dot(t.center,i)+n.distance;return s-u>0?a.INSIDE:s+u<0?a.OUTSIDE:a.INTERSECTING},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.intersectPlane=function(e){return i.intersectPlane(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function n(e,n,r){var a=e+n;return t.sign(e)!==t.sign(n)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(n)))<r?0:a}var r={};return r.computeDiscriminant=function(e,t,n){var r=t*t-4*e*n;return r},r.computeRealRoots=function(e,r,a){var i;if(0===e)return 0===r?[]:[-a/r];if(0===r){if(0===a)return[0,0];var o=Math.abs(a),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,i<0)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-r/e,i<0?[i,0]:[0,i];var c=r*r,l=4*e*a,f=n(c,-l,t.EPSILON14);if(f<0)return[];var h=-.5*n(r,t.sign(r)*Math.sqrt(f),t.EPSILON14);return r>0?[h/e,a/h]:[a/h,h/e]},r}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function n(e,t,n,r){var a,i,o=e,u=t/3,s=n/3,c=r,l=o*s,f=u*c,h=u*u,d=s*s,E=o*s-h,m=o*c-u*s,p=u*c-d,_=4*E*p-m*m;if(_<0){var y,T,R;h*f>=l*d?(y=o,T=E,R=-2*u*E+o*m):(y=c,T=p,R=-c*m+2*s*p);var A=R<0?-1:1,S=-A*Math.abs(y)*Math.sqrt(-_);i=-R+S;var N=i/2,M=N<0?-Math.pow(-N,1/3):Math.pow(N,1/3),I=i===S?-M:-T/M;return a=T<=0?M+I:-R/(M*M+I*I+T),h*f>=l*d?[(a-u)/o]:[-c/(a+s)]}var v=E,O=-2*u*E+o*m,g=p,x=-c*m+2*s*p,w=Math.sqrt(_),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*w,-O)/3);a=2*Math.sqrt(-v);var U=Math.cos(P);i=a*U;var D=a*(-U/2-C*Math.sin(P)),L=i+D>2*u?i-u:D-u,F=o,z=L/F;P=Math.abs(Math.atan2(c*w,-x)/3),a=2*Math.sqrt(-g),U=Math.cos(P),i=a*U,D=a*(-U/2-C*Math.sin(P));var B=-c,b=i+D<2*s?i+s:D+s,q=B/b,G=F*b,W=-L*b-F*B,X=L*B,V=(s*W-u*X)/(-u*W+s*G);return z<=V?z<=q?V<=q?[z,V,q]:[z,q,V]:[q,z,V]:z<=q?[V,z,q]:V<=q?[V,q,z]:[q,V,z]}var r={};return r.computeDiscriminant=function(e,t,n,r){var a=e*e,i=t*t,o=n*n,u=r*r,s=18*e*t*n*r+i*o-27*a*u-4*(e*o*n+i*t*r);return s},r.computeRealRoots=function(e,r,a,i){var o,u;if(0===e)return t.computeRealRoots(r,a,i);if(0===r){if(0===a){if(0===i)return[0,0,0];u=-i/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===i?(o=t.computeRealRoots(e,0,a),0===o.Length?[0]:[o[0],0,o[1]]):n(e,0,a,i)}return 0===a?0===i?(u=-r/e,u<0?[u,0,0]:[0,0,u]):n(e,r,0,i):0===i?(o=t.computeRealRoots(e,r,a),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):n(e,r,a,i)},r}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,n,r){"use strict";function a(t,a,i,o){var u=t*t,s=a-3*u/8,c=i-a*t/2+u*t/8,l=o-i*t/4+a*u/16-3*u*u/256,f=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(f.length>0){var h=-t/4,d=f[f.length-1];if(Math.abs(d)<n.EPSILON14){var E=r.computeRealRoots(1,s,l);if(2===E.length){var m,p=E[0],_=E[1];if(p>=0&&_>=0){var y=Math.sqrt(p),T=Math.sqrt(_);return[h-T,h-y,h+y,h+T]}if(p>=0&&_<0)return m=Math.sqrt(p),[h-m,h+m];if(p<0&&_>=0)return m=Math.sqrt(_),[h-m,h+m]}return[]}if(d>0){var R=Math.sqrt(d),A=(s+d-c/R)/2,S=(s+d+c/R)/2,N=r.computeRealRoots(1,R,A),M=r.computeRealRoots(1,-R,S);return 0!==N.length?(N[0]+=h,N[1]+=h,0!==M.length?(M[0]+=h,M[1]+=h,N[1]<=M[0]?[N[0],N[1],M[0],M[1]]:M[1]<=N[0]?[M[0],M[1],N[0],N[1]]:N[0]>=M[0]&&N[1]<=M[1]?[M[0],N[0],N[1],M[1]]:M[0]>=N[0]&&M[1]<=N[1]?[N[0],M[0],M[1],N[1]]:N[0]>M[0]&&N[0]<M[1]?[M[0],N[0],M[1],N[1]]:[N[0],M[0],N[1],M[1]]):N):0!==M.length?(M[0]+=h,M[1]+=h,M):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,f=i*t+s-4*o,h=c*o-i*a*t+u,d=e.computeRealRoots(1,l,f,h);if(d.length>0){var E,m,p=d[0],_=a-p,y=_*_,T=t/2,R=_/2,A=y-4*o,S=y+4*Math.abs(o),N=c-4*p,M=c+4*Math.abs(p);if(p<0||A*M<N*S){var I=Math.sqrt(N);E=I/2,m=0===I?0:(t*R-i)/I}else{var v=Math.sqrt(A);E=0===v?0:(t*R-i)/v,m=v/2}var O,g;0===T&&0===E?(O=0,g=0):n.sign(T)===n.sign(E)?(O=T+E,g=p/O):(g=T-E,O=p/g);var x,w;0===R&&0===m?(x=0,w=0):n.sign(R)===n.sign(m)?(x=R+m,w=o/x):(w=R-m,x=o/w);var C=r.computeRealRoots(1,O,x),P=r.computeRealRoots(1,g,w);if(0!==C.length)return 0!==P.length?C[1]<=P[0]?[C[0],C[1],P[0],P[1]]:P[1]<=C[0]?[P[0],P[1],C[0],C[1]]:C[0]>=P[0]&&C[1]<=P[1]?[P[0],C[0],C[1],P[1]]:P[0]>=C[0]&&P[1]<=C[1]?[C[0],P[0],P[1],C[1]]:C[0]>P[0]&&C[0]<P[1]?[P[0],C[0],P[1],C[1]]:[C[0],P[0],C[1],P[1]]:C;if(0!==P.length)return P}return[]}var o={};return o.computeDiscriminant=function(e,t,n,r,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=n*n,l=c*n,f=r*r,h=f*r,d=a*a,E=d*a,m=u*c*f-4*s*h-4*e*l*f+18*e*t*n*h-27*i*f*f+256*o*E+a*(18*s*n*r-4*u*l+16*e*c*c-80*e*t*c*r-6*e*u*f+144*i*n*f)+d*(144*e*u*n-27*u*u-128*i*c-192*i*t*r);return m},o.computeRealRoots=function(t,r,o,u,s){if(Math.abs(t)<n.EPSILON15)return e.computeRealRoots(r,o,u,s);var c=r/t,l=o/t,f=u/t,h=s/t,d=c<0?1:0;switch(d+=l<0?d+1:d,d+=f<0?d+1:d,d+=h<0?d+1:d){case 0:return a(c,l,f,h);case 1:return i(c,l,f,h);case 2:return i(c,l,f,h);case 3:return a(c,l,f,h);case 4:return a(c,l,f,h);case 5:return i(c,l,f,h);case 6:return a(c,l,f,h);case 7:return a(c,l,f,h);case 8:return i(c,l,f,h);case 9:return a(c,l,f,h);case 10:return a(c,l,f,h);case 11:return i(c,l,f,h);case 12:return a(c,l,f,h);case 13:return a(c,l,f,h);case 14:return a(c,l,f,h);case 15:return a(c,l,f,h);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=e.clone(t(r,e.ZERO)),e.equals(r,e.ZERO)||e.normalize(r,r),this.origin=e.clone(t(n,e.ZERO)),this.direction=r}return a.getPoint=function(t,r,a){return n(a)||(a=new e),a=e.multiplyByScalar(t.direction,r,a),e.add(t.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,n,r,a,i,o,u,s,c,l){"use strict";function f(e,t,n,r){var a=t*t-4*e*n;if(!(a<0)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return u<s?(r.root0=u,r.root1=s):(r.root0=s,r.root1=u),r}var c=-t/(2*e);if(0!==c)return r.root0=r.root1=c,r}}function h(t,n,a){r(a)||(a=new i);var o=t.origin,u=t.direction,s=n.center,c=n.radius*n.radius,l=e.subtract(o,s,y),h=e.dot(u,u),d=2*e.dot(u,l),E=e.magnitudeSquared(l)-c,m=f(h,d,E,S);if(r(m))return a.start=m.root0,a.stop=m.root1,a}function d(e,t,n){var r=e+t;return o.sign(e)!==o.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))<n?0:r}function E(t,n,r,a,i){var l,f=a*a,h=i*i,E=(t[u.COLUMN1ROW1]-t[u.COLUMN2ROW2])*h,m=i*(a*d(t[u.COLUMN1ROW0],t[u.COLUMN0ROW1],o.EPSILON15)+n.y),p=t[u.COLUMN0ROW0]*f+t[u.COLUMN2ROW2]*h+a*n.x+r,_=h*d(t[u.COLUMN2ROW1],t[u.COLUMN1ROW2],o.EPSILON15),y=i*(a*d(t[u.COLUMN2ROW0],t[u.COLUMN0ROW2])+n.z),T=[];if(0===y&&0===_){if(l=s.computeRealRoots(E,m,p),0===l.length)return T;var R=l[0],A=Math.sqrt(Math.max(1-R*R,0));if(T.push(new e(a,i*R,i*-A)),T.push(new e(a,i*R,i*A)),2===l.length){var S=l[1],N=Math.sqrt(Math.max(1-S*S,0));T.push(new e(a,i*S,i*-N)),T.push(new e(a,i*S,i*N))}return T}var M=y*y,I=_*_,v=E*E,O=y*_,g=v+I,x=2*(m*E+O),w=2*p*E+m*m-I+M,C=2*(p*m-O),P=p*p-M;if(0===g&&0===x&&0===w&&0===C)return T;l=c.computeRealRoots(g,x,w,C,P);var U=l.length;if(0===U)return T;for(var D=0;D<U;++D){var L,F=l[D],z=F*F,B=Math.max(1-z,0),b=Math.sqrt(B);L=o.sign(E)===o.sign(p)?d(E*z+p,m*F,o.EPSILON12):o.sign(p)===o.sign(m*F)?d(E*z,m*F+p,o.EPSILON12):d(E*z+m*F,p,o.EPSILON12);var q=d(_*F,y,o.EPSILON15),G=L*q;G<0?T.push(new e(a,i*F,i*b)):G>0?T.push(new e(a,i*F,i*-b)):0!==b?(T.push(new e(a,i*F,i*-b)),T.push(new e(a,i*F,i*b)),++D):T.push(new e(a,i*F,i*b))}return T}var m={};m.rayPlane=function(t,n,a){r(a)||(a=new e);var i=t.origin,u=t.direction,s=n.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON15)){var l=(-n.distance-e.dot(s,i))/c;if(!(l<0))return a=e.multiplyByScalar(u,l,a),e.add(i,a,a)}};var p=new e,_=new e,y=new e,T=new e,R=new e;m.rayTriangleParametric=function(t,r,a,i,u){u=n(u,!1);var s,c,l,f,h,d=t.origin,E=t.direction,m=e.subtract(a,r,p),A=e.subtract(i,r,_),S=e.cross(E,A,y),N=e.dot(m,S);if(u){if(N<o.EPSILON6)return;if(s=e.subtract(d,r,T),l=e.dot(s,S),l<0||l>N)return;if(c=e.cross(s,m,R),f=e.dot(E,c),f<0||l+f>N)return;h=e.dot(A,c)/N}else{if(Math.abs(N)<o.EPSILON6)return;var M=1/N;if(s=e.subtract(d,r,T),l=e.dot(s,S)*M,l<0||l>1)return;if(c=e.cross(s,m,R),f=e.dot(E,c)*M,f<0||l+f>1)return;h=e.dot(A,c)*M}return h},m.rayTriangle=function(t,n,a,i,o,u){var s=m.rayTriangleParametric(t,n,a,i,o);if(r(s)&&!(s<0))return r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var A=new l;m.lineSegmentTriangle=function(t,n,a,i,o,u,s){var c=A;e.clone(t,c.origin),e.subtract(n,t,c.direction),e.normalize(c.direction,c.direction);var l=m.rayTriangleParametric(c,a,i,o,u);if(!(!r(l)||l<0||l>e.distance(t,n)))return r(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var S={root0:0,root1:0};m.raySphere=function(e,t,n){if(n=h(e,t,n),r(n)&&!(n.stop<0))return n.start=Math.max(n.start,0),n};var N=new l;m.lineSegmentSphere=function(t,n,a,i){var o=N;e.clone(t,o.origin);var u=e.subtract(n,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),i=h(o,a,i),!(!r(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var M=new e,I=new e;m.rayEllipsoid=function(t,n){var r,a,o,u,s,c=n.oneOverRadii,l=e.multiplyComponents(c,t.origin,M),f=e.multiplyComponents(c,t.direction,I),h=e.magnitudeSquared(l),d=e.dot(l,f);if(h>1){if(d>=0)return;var E=d*d;if(r=h-1,a=e.magnitudeSquared(f),o=a*r,E<o)return;if(E>o){u=d*d-o,s=-d+Math.sqrt(u);var m=s/a,p=r/s;return m<p?new i(m,p):{start:p,stop:m}}var _=Math.sqrt(r/a);return new i(_,_)}return h<1?(r=h-1,a=e.magnitudeSquared(f),o=a*r,u=d*d-o,s=-d+Math.sqrt(u),new i(0,s/a)):d<0?(a=e.magnitudeSquared(f),new i(0,-d/a)):void 0};var v=new e,O=new e,g=new e,x=new e,w=new e,C=new u,P=new u,U=new u,D=new u,L=new u,F=new u,z=new u,B=new e,b=new e,q=new t;m.grazingAltitudeLocation=function(t,n){var a=t.origin,i=t.direction;if(!e.equals(a,e.ZERO)){var s=n.geodeticSurfaceNormal(a,v);if(e.dot(i,s)>=0)return a}var c=r(this.rayEllipsoid(t,n)),l=n.transformPositionToScaledSpace(i,v),f=e.normalize(l,l),h=e.mostOrthogonalAxis(l,x),d=e.normalize(e.cross(h,f,O),O),m=e.normalize(e.cross(f,d,g),g),p=C;p[0]=f.x,p[1]=f.y,p[2]=f.z,p[3]=d.x,p[4]=d.y,p[5]=d.z,p[6]=m.x,p[7]=m.y,p[8]=m.z;var _=u.transpose(p,P),y=u.fromScale(n.radii,U),T=u.fromScale(n.oneOverRadii,D),R=L;R[0]=0,R[1]=-i.z,R[2]=i.y,R[3]=i.z,R[4]=0,R[5]=-i.x,R[6]=-i.y,R[7]=i.x,R[8]=0;var A,S,N=u.multiply(u.multiply(_,T,F),R,F),M=u.multiply(u.multiply(N,y,z),p,z),I=u.multiplyByVector(N,a,w),G=E(M,e.negate(I,v),0,0,1),W=G.length;if(W>0){for(var X=e.clone(e.ZERO,b),V=Number.NEGATIVE_INFINITY,H=0;H<W;++H){A=u.multiplyByVector(y,u.multiplyByVector(p,G[H],B),B);var Y=e.normalize(e.subtract(A,a,x),x),k=e.dot(Y,i);k>V&&(V=k,X=e.clone(A,X))}var Z=n.cartesianToCartographic(X,q);return V=o.clamp(V,0,1),S=e.magnitude(e.subtract(X,a,x))*Math.sqrt(1-V*V),S=c?-S:S,Z.height=S,n.cartographicToCartesian(Z,new e)}};var G=new e;return m.lineSegmentPlane=function(t,n,a,i){r(i)||(i=new e);var u=e.subtract(n,t,G),s=a.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON6)){var l=e.dot(s,t),f=-(a.distance+l)/c;if(!(f<0||f>1))return e.multiplyByScalar(u,f,i),e.add(t,i,i),i}},m.trianglePlaneIntersection=function(t,n,r,a){var i=a.normal,o=a.distance,u=e.dot(i,t)+o<0,s=e.dot(i,n)+o<0,c=e.dot(i,r)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var f,h;if(1!==l&&2!==l||(f=new e,h=new e),1===l){if(u)return m.lineSegmentPlane(t,n,a,f),m.lineSegmentPlane(t,r,a,h),{positions:[t,n,r,f,h],indices:[0,3,4,1,2,4,1,4,3]};if(s)return m.lineSegmentPlane(n,r,a,f),m.lineSegmentPlane(n,t,a,h),{positions:[t,n,r,f,h],indices:[1,3,4,2,0,4,2,4,3]};if(c)return m.lineSegmentPlane(r,t,a,f),m.lineSegmentPlane(r,n,a,h),{positions:[t,n,r,f,h],indices:[2,3,4,0,1,4,0,4,3] +}}else if(2===l){if(!u)return m.lineSegmentPlane(n,t,a,f),m.lineSegmentPlane(r,t,a,h),{positions:[t,n,r,f,h],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return m.lineSegmentPlane(r,n,a,f),m.lineSegmentPlane(t,n,a,h),{positions:[t,n,r,f,h],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return m.lineSegmentPlane(t,r,a,f),m.lineSegmentPlane(n,r,a,h),{positions:[t,n,r,f,h],indices:[0,1,4,0,4,3,2,3,4]}}},m}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";function a(t,n){this.normal=e.clone(t),this.distance=n}a.fromPointNormal=function(n,r,i){var o=-e.dot(r,n);return t(i)?(e.clone(r,i.normal),i.distance=o,i):new a(r,o)};var i=new e;return a.fromCartesian4=function(n,r){var o=e.fromCartesian4(n,i),u=n.w;return t(r)?(e.clone(o,r.normal),r.distance=u,r):new a(o,u)},a.getPointDistance=function(t,n){return e.dot(t.normal,n)+t.distance},a.ORIGIN_XY_PLANE=r(new a(e.UNIT_Z,0)),a.ORIGIN_YZ_PLANE=r(new a(e.UNIT_X,0)),a.ORIGIN_ZX_PLANE=r(new a(e.UNIT_Y,0)),a}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,n,r,a){return t(e).then(n,r,a)}function t(e){var t,n;return e instanceof r?t=e:u(e)?(n=o(),e.then(function(e){n.resolve(e)},function(e){n.reject(e)},function(e){n.progress(e)}),t=n.promise):t=a(e),t}function n(t){return e(t,i)}function r(e){this.then=e}function a(e){var n=new r(function(n){try{return t(n?n(e):e)}catch(e){return i(e)}});return n}function i(e){var n=new r(function(n,r){try{return r?t(r(e)):i(e)}catch(e){return i(e)}});return n}function o(){function e(e,t,n){return h(e,t,n)}function n(e){return E(e)}function a(e){return E(i(e))}function u(e){return d(e)}var s,c,l,f,h,d,E;return c=new r(e),s={then:e,resolve:n,reject:a,progress:u,promise:c,resolver:{resolve:n,reject:a,progress:u}},l=[],f=[],h=function(e,t,n){var r,a;return r=o(),a="function"==typeof n?function(e){try{r.progress(n(e))}catch(e){r.progress(e)}}:function(e){r.progress(e)},l.push(function(n){n.then(e,t).then(r.resolve,r.reject,a)}),f.push(a),r.promise},d=function(e){return m(f,e),e},E=function(e){return e=t(e),h=e.then,E=t,d=_,m(l,e),f=l=A,e},s}function u(e){return e&&"function"==typeof e.then}function s(t,n,r,a,i){return p(2,arguments),e(t,function(t){function u(e){m(e)}function s(e){E(e)}var c,l,f,h,d,E,m,p,y,T;if(y=t.length>>>0,c=Math.max(0,Math.min(n,y)),f=[],l=y-c+1,h=[],d=o(),c)for(p=d.progress,m=function(e){h.push(e),--l||(E=m=_,d.reject(h))},E=function(e){f.push(e),--c||(E=m=_,d.resolve(f))},T=0;T<y;++T)T in t&&e(t[T],s,u,p);else d.resolve(f);return d.then(r,a,i)})}function c(e,t,n,r){function a(e){return t?t(e[0]):e[0]}return s(e,1,a,n,r)}function l(e,t,n,r){return p(1,arguments),h(e,y).then(t,n,r)}function f(){return h(arguments,y)}function h(t,n){return e(t,function(t){var r,a,i,u,s,c;if(i=a=t.length>>>0,r=[],c=o(),i)for(u=function(t,a){e(t,n).then(function(e){r[a]=e,--i||c.resolve(r)},c.reject)},s=0;s<a;s++)s in t?u(t[s],s):--i;else c.resolve(r);return c.promise})}function d(t,n){var r=R.call(arguments,1);return e(t,function(t){var a;return a=t.length,r[0]=function(t,r,i){return e(t,function(t){return e(r,function(e){return n(t,e,i,a)})})},T.apply(t,r)})}function E(t,n,r){var a=arguments.length>2;return e(t,function(e){return e=a?r:e,n.resolve(e),e},function(e){return n.reject(e),i(e)},n.progress)}function m(e,t){for(var n,r=0;n=e[r++];)n(t)}function p(e,t){for(var n,r=t.length;r>e;)if(n=t[--r],null!=n&&"function"!=typeof n)throw new Error("arg "+r+" must be a function")}function _(){}function y(e){return e}var T,R,A;return e.defer=o,e.resolve=t,e.reject=n,e.join=f,e.all=l,e.map=h,e.reduce=d,e.any=c,e.some=s,e.chain=E,e.isPromise=u,r.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(A,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return l(t,function(t){return e.apply(A,t)})})}},R=[].slice,T=[].reduce||function(e){var t,n,r,a,i;if(i=0,t=Object(this),a=t.length>>>0,n=arguments,n.length<=1)for(;;){if(i in t){r=t[i++];break}if(++i>=a)throw new TypeError}else r=n[1];for(;i<a;++i)i in t&&(r=e(r,t[i],i,t));return r},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/binarySearch",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e,t,n){for(var r,a,i=0,o=e.length-1;i<=o;)if(r=~~((i+o)/2),a=n(e[r],t),a<0)i=r+1;else{if(!(a>0))return r;o=r-1}return~(o+1)}return n}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,n,r,a){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=r,this.ut1MinusUtc=a}return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,n=0,r=t[n++],a=function(e,t,n,r){n||(n=" ");var a=e.length>=t?"":Array(1+t-e.length>>>0).join(n);return r?e+a:a+e},i=function(e,t,n,r,i,o){var u=r-e.length;return u>0&&(e=n||!i?a(e,r,o,n):e.slice(0,t.length)+a("",u,"0",!0)+e.slice(t.length)),e},o=function(e,t,n,r,o,u,s){var c=e>>>0;return n=n&&c&&{2:"0b",8:"0",16:"0x"}[t]||"",e=n+a(c.toString(t),u||0,"0",!1),i(e,n,r,o,s)},u=function(e,t,n,r,a,o){return null!=r&&(e=e.slice(0,r)),i(e,"",t,n,a,o)},s=function(e,r,s,c,l,f,h){var d,E,m,p,_;if("%%"==e)return"%";for(var y=!1,T="",R=!1,A=!1,S=" ",N=s.length,M=0;s&&M<N;M++)switch(s.charAt(M)){case" ":T=" ";break;case"+":T="+";break;case"-":y=!0;break;case"'":S=s.charAt(M+1);break;case"0":R=!0;break;case"#":A=!0}if(c=c?"*"==c?+t[n++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,c<0&&(c=-c,y=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(f=f?"*"==f?+t[n++]:"*"==f.charAt(0)?+t[f.slice(1,-1)]:+f:"fFeE".indexOf(h)>-1?6:"d"==h?0:void 0,_=r?t[r.slice(0,-1)]:t[n++],h){case"s":return u(String(_),y,c,f,R,S);case"c":return u(String.fromCharCode(+_),y,c,f,R);case"b":return o(_,2,A,y,c,f,R);case"o":return o(_,8,A,y,c,f,R);case"x":return o(_,16,A,y,c,f,R);case"X":return o(_,16,A,y,c,f,R).toUpperCase();case"u":return o(_,10,A,y,c,f,R);case"i":case"d":return d=+_||0,d=Math.round(d-d%1),E=d<0?"-":T,_=E+a(String(Math.abs(d)),f,"0",!1),i(_,E,y,c,R);case"e":case"E":case"f":case"F":case"g":case"G":return d=+_,E=d<0?"-":T,m=["toExponential","toFixed","toPrecision"]["efg".indexOf(h.toLowerCase())],p=["toString","toUpperCase"]["eEfFgG".indexOf(h)%2],_=E+Math.abs(d)[m](f),i(_,E,y,c,R)[p]();default:return e}};return r.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,n,r,a,i,o,u){this.year=e,this.month=t,this.day=n,this.hour=r,this.minute=a,this.second=i,this.millisecond=o,this.isLeapSecond=u}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e(t)}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t){return m.compare(e.julianDate,t.julianDate)}function f(e){T.julianDate=e;var n=m.leapSeconds,r=t(n,T,l);r<0&&(r=~r),r>=n.length&&(r=n.length-1);var a=n[r].offset;if(r>0){var i=m.secondsDifference(n[r].julianDate,e);i>a&&(r--,a=n[r].offset)}m.addSeconds(e,a,e)}function h(e,n){T.julianDate=e;var r=m.leapSeconds,a=t(r,T,l);if(a<0&&(a=~a),0===a)return m.addSeconds(e,-r[0].offset,n);if(a>=r.length)return m.addSeconds(e,-r[a-1].offset,n);var i=m.secondsDifference(r[a].julianDate,e);return 0===i?m.addSeconds(e,-r[a].offset,n):i<=1?void 0:m.addSeconds(e,-r[--a].offset,n)}function d(e,t,n){var r=t/s.SECONDS_PER_DAY|0;return e+=r,t-=s.SECONDS_PER_DAY*r,t<0&&(e--,t+=s.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function E(e,t,n,r,a,i,o){var u=(t-14)/12|0,c=e+4800+u,l=(1461*c/4|0)+(367*(t-2-12*u)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;r-=12,r<0&&(r+=24);var f=i+(r*s.SECONDS_PER_HOUR+a*s.SECONDS_PER_MINUTE+o*s.SECONDS_PER_MILLISECOND);return f>=43200&&(l-=1),[l,f]}function m(e,t,r){this.dayNumber=void 0,this.secondsOfDay=void 0,e=n(e,0),t=n(t,0),r=n(r,c.UTC);var a=0|e;t+=(e-a)*s.SECONDS_PER_DAY,d(a,t,this),r===c.UTC&&f(this)}var p=new i,_=[31,28,31,30,31,30,31,31,30,31,30,31],y=29,T=new u,R=/^(\d{4})$/,A=/^(\d{4})-(\d{2})$/,S=/^(\d{4})-?(\d{3})$/,N=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,M=/^(\d{4})-?(\d{2})-?(\d{2})$/,I=/([Z+\-])?(\d{2})?:?(\d{2})?$/,v=/^(\d{2})(\.\d+)?/.source+I.source,O=/^(\d{2}):?(\d{2})(\.\d+)?/.source+I.source,g=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+I.source;m.fromDate=function(e,t){var n=E(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r(t)?(d(n[0],n[1],t),f(t),t):new m(n[0],n[1],c.UTC)},m.fromIso8601=function(e,t){e=e.replace(",",".");var n,a,i,u=e.split("T"),s=1,l=1,h=0,p=0,T=0,I=0,x=u[0],w=u[1];if(u=x.match(M),null!==u)n=+u[1],s=+u[2],l=+u[3];else if(u=x.match(A),null!==u)n=+u[1],s=+u[2];else if(u=x.match(R),null!==u)n=+u[1];else{var C;if(u=x.match(S),null!==u)n=+u[1],C=+u[2],i=o(n);else if(u=x.match(N),null!==u){n=+u[1];var P=+u[2],U=+u[3]||0,D=new Date(Date.UTC(n,0,4));C=7*P+U-D.getUTCDay()-3}a=new Date(Date.UTC(n,0,1)),a.setUTCDate(C),s=a.getUTCMonth()+1,l=a.getUTCDate()}i=o(n);var L;if(r(w)){u=w.match(g),null!==u?(h=+u[1],p=+u[2],T=+u[3],I=1e3*+(u[4]||0),L=5):(u=w.match(O),null!==u?(h=+u[1],p=+u[2],T=60*+(u[3]||0),L=4):(u=w.match(v),null!==u&&(h=+u[1],p=60*+(u[2]||0),L=3)));var F=u[L],z=+u[L+1],B=+(u[L+2]||0);switch(F){case"+":h-=z,p-=B;break;case"-":h+=z,p+=B;break;case"Z":break;default:p+=new Date(Date.UTC(n,s-1,l,h,p)).getTimezoneOffset()}}else p+=new Date(n,s-1,l).getTimezoneOffset();var b=60===T;for(b&&T--;p>=60;)p-=60,h++;for(;h>=24;)h-=24,l++;for(a=i&&2===s?y:_[s-1];l>a;)l-=a,s++,s>12&&(s-=12,n++),a=i&&2===s?y:_[s-1];for(;p<0;)p+=60,h--;for(;h<0;)h+=24,l--;for(;l<1;)s--,s<1&&(s+=12,n--),a=i&&2===s?y:_[s-1],l+=a;var q=E(n,s,l,h,p,T,I);return r(t)?(d(q[0],q[1],t),f(t)):t=new m(q[0],q[1],c.UTC),b&&m.addSeconds(t,1,t),t},m.now=function(e){return m.fromDate(new Date,e)};var x=new m(0,0,c.TAI);return m.toGregorianDate=function(e,t){var n=!1,a=h(e,x);r(a)||(m.addSeconds(e,-1,x),a=h(x,x),n=!0);var o=a.dayNumber,u=a.secondsOfDay;u>=43200&&(o+=1);var c=o+68569|0,l=4*c/146097|0;c=c-((146097*l+3)/4|0)|0;var f=4e3*(c+1)/1461001|0;c=c-(1461*f/4|0)+31|0;var d=80*c/2447|0,E=c-(2447*d/80|0)|0;c=d/11|0;var p=d+2-12*c|0,_=100*(l-49)+f+c|0,y=u/s.SECONDS_PER_HOUR|0,T=u-y*s.SECONDS_PER_HOUR,R=T/s.SECONDS_PER_MINUTE|0;T-=R*s.SECONDS_PER_MINUTE;var A=0|T,S=(T-A)/s.SECONDS_PER_MILLISECOND;return y+=12,y>23&&(y-=24),n&&(A+=1),r(t)?(t.year=_,t.month=p,t.day=E,t.hour=y,t.minute=R,t.second=A,t.millisecond=S,t.isLeapSecond=n,t):new i(_,p,E,y,R,A,S,n)},m.toDate=function(e){var t=m.toGregorianDate(e,p),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))},m.toIso8601=function(t,n){var a,i=m.toGregorianDate(t,i);return r(n)||0===i.millisecond?r(n)&&0!==n?(a=(.01*i.millisecond).toFixed(n).replace(".","").slice(0,n),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",i.year,i.month,i.day,i.hour,i.minute,i.second):(a=(.01*i.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a))},m.clone=function(e,t){if(r(e))return r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new m(e.dayNumber,e.secondsOfDay,c.TAI)},m.compare=function(e,t){var n=e.dayNumber-t.dayNumber;return 0!==n?n:e.secondsOfDay-t.secondsOfDay},m.equals=function(e,t){return e===t||r(e)&&r(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},m.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(m.secondsDifference(e,t))<=n},m.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},m.secondsDifference=function(e,t){var n=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return n+(e.secondsOfDay-t.secondsOfDay)},m.daysDifference=function(e,t){var n=e.dayNumber-t.dayNumber,r=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return n+r},m.computeTaiMinusUtc=function(e){T.julianDate=e;var n=m.leapSeconds,r=t(n,T,l);return r<0&&(r=~r,--r,r<0&&(r=0)),n[r].offset},m.addSeconds=function(e,t,n){return d(e.dayNumber,e.secondsOfDay+t,n)},m.addMinutes=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return d(e.dayNumber,r,n)},m.addHours=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return d(e.dayNumber,r,n)},m.addDays=function(e,t,n){var r=e.dayNumber+t;return d(r,e.secondsOfDay,n)},m.lessThan=function(e,t){return m.compare(e,t)<0},m.lessThanOrEquals=function(e,t){return m.compare(e,t)<=0},m.greaterThan=function(e,t){return m.compare(e,t)>0},m.greaterThanOrEquals=function(e,t){return m.compare(e,t)>=0},m.prototype.clone=function(e){return m.clone(this,e)},m.prototype.equals=function(e){return m.equals(this,e)},m.prototype.equalsEpsilon=function(e,t){return m.equalsEpsilon(this,e,t)},m.prototype.toString=function(){return m.toIso8601(this)},m.leapSeconds=[new u(new m(2441317,43210,c.TAI),10),new u(new m(2441499,43211,c.TAI),11),new u(new m(2441683,43212,c.TAI),12),new u(new m(2442048,43213,c.TAI),13),new u(new m(2442413,43214,c.TAI),14),new u(new m(2442778,43215,c.TAI),15),new u(new m(2443144,43216,c.TAI),16),new u(new m(2443509,43217,c.TAI),17),new u(new m(2443874,43218,c.TAI),18),new u(new m(2444239,43219,c.TAI),19),new u(new m(2444786,43220,c.TAI),20),new u(new m(2445151,43221,c.TAI),21),new u(new m(2445516,43222,c.TAI),22),new u(new m(2446247,43223,c.TAI),23),new u(new m(2447161,43224,c.TAI),24),new u(new m(2447892,43225,c.TAI),25),new u(new m(2448257,43226,c.TAI),26),new u(new m(2448804,43227,c.TAI),27),new u(new m(2449169,43228,c.TAI),28),new u(new m(2449534,43229,c.TAI),29),new u(new m(2450083,43230,c.TAI),30),new u(new m(2450630,43231,c.TAI),31),new u(new m(2451179,43232,c.TAI),32),new u(new m(2453736,43233,c.TAI),33),new u(new m(2454832,43234,c.TAI),34),new u(new m(2456109,43235,c.TAI),35),new u(new m(2457204,43236,c.TAI),36),new u(new m(2457754,43237,c.TAI),37)],m}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(n,r){if(null===n||"object"!=typeof n)return n;r=e(r,!1);var a=new n.constructor;for(var i in n)if(n.hasOwnProperty(i)){var o=n[i];r&&(o=t(o,r)),a[i]=o}return a}return t}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var n=e.split("\r\n"),r=0;r<n.length;++r){var a=n[r],i=a.indexOf(": ");if(i>0){var o=a.substring(0,i),u=a.substring(i+2);t[o]=u}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function n(e,n,r){this.statusCode=e,this.response=n,this.responseHeaders=r,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return n.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},n}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var n=r.exec(t);this.scheme=n[1],this.authority=n[2],this.path=n[3],this.query=n[4],this.fragment=n[5]}}function t(e){var t=unescape(e);return i.test(t)?t:e.toUpperCase()}function n(e,t,n,r){return(t||"")+n.toLowerCase()+(r||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var r=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(o,n).replace(a,t)),this.path&&(this.path=this.path.replace(a,t)),this.query&&(this.query=this.query.replace(a,t)),this.fragment&&(this.fragment=this.fragment.replace(a,t))};var a=/%[0-9a-z]{2}/gi,i=/[a-zA-Z0-9\-\._~]/,o=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var n=new e;return this.scheme?(n.scheme=this.scheme,n.authority=this.authority,n.path=this.path,n.query=this.query):(n.scheme=t.scheme,this.authority?(n.authority=this.authority,n.path=this.path,n.query=this.query):(n.authority=t.authority,""==this.path?(n.path=t.path,n.query=this.query||t.query):("/"==this.path.charAt(0)?(n.path=this.path,n.removeDotSegments()):(t.authority&&""==t.path?n.path="/"+this.path:n.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,n.removeDotSegments()),n.query=this.query))),n.fragment=this.fragment,n},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),n=[],r=""==t[0];r&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?n.pop():"."!=e&&n.push(e);"."!=e&&".."!=e||n.push(""),r&&n.unshift(""),this.path=n.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n){var r=new e(n);r.normalize();var a=r.getAuthority();if(t(a)){if(a.indexOf("@")!==-1){var i=a.split("@");a=i[1]}if(a.indexOf(":")===-1){var o=r.getScheme();if(t(o)||(o=window.location.protocol,o=o.substring(0,o.length-1)),"http"===o)a+=":80";else{if("https"!==o)return;a+=":443"}}return a}}var a={},i={};return a.add=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])||(i[r]=!0)},a.remove=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])&&delete i[r]},a.contains=function(e){var n=r(e);return!(!t(n)||!t(i[n]))},a.clear=function(){i={}},a}),define("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,n,r,a,i,o){"use strict";function u(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,a=t(n.method,"GET"),i=n.data,o=n.headers,s=n.overrideMimeType;return e(n.url,function(t){var n=e.defer();return u.load(t,r,a,i,o,n,s),n.promise})}function s(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function c(e,t){for(var n=s(e,t),r=new ArrayBuffer(n.length),a=new Uint8Array(r),i=0;i<n.length;i++)a[i]=n.charCodeAt(i);return r}function l(e,n){n=t(n,"");var r=e[1],a=!!e[2],i=e[3];switch(n){case"":case"text":return s(a,i);case"arraybuffer":return c(a,i);case"blob":var o=c(a,i);return new Blob([o],{type:r});case"document":var u=new DOMParser;return u.parseFromString(s(a,i),r);case"json":return JSON.parse(s(a,i))}}var f=/^data:(.*?)(;base64)?,(.*)$/;return u.load=function(e,t,r,u,s,c,h){var d=f.exec(e);if(null!==d)return void c.resolve(l(d,t));var E=new XMLHttpRequest;if(o.contains(e)&&(E.withCredentials=!0),n(h)&&n(E.overrideMimeType)&&E.overrideMimeType(h),E.open(r,e,!0),n(s))for(var m in s)s.hasOwnProperty(m)&&E.setRequestHeader(m,s[m]);n(t)&&(E.responseType=t),E.onload=function(){if(E.status<200||E.status>=300)return void c.reject(new a(E.status,E.response,E.getAllResponseHeaders()));var e=E.response,r=E.responseType;if(!n(e)||n(t)&&r!==t)if("json"===t&&"string"==typeof e)try{c.resolve(JSON.parse(e))}catch(e){c.reject(e)}else(""===r||"document"===r)&&n(E.responseXML)&&E.responseXML.hasChildNodes()?c.resolve(E.responseXML):""!==r&&"text"!==r||!n(E.responseText)?c.reject(new i("Invalid XMLHttpRequest response type.")):c.resolve(E.responseText);else c.resolve(e)},E.onerror=function(e){c.reject(new a)},E.send(u)},u.defaultLoad=u.load,u}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,n){return e({url:t,headers:n})}return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";function a(n,a){return t(a)?t(a.Accept)||(a=e(a),a.Accept=i.Accept):a=i,r(n,a).then(function(e){return JSON.parse(e)})}var i={Accept:"application/json,*/*;q=0.01"};return a}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(t){if(t=n(t,n.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=n(t.addNewLeapSeconds,!0),r(t.data))E(this,t.data);else if(r(t.url)){var a=this;this._downloadPromise=e(s(t.url),function(e){E(a,e)},function(){a._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else E(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function d(e,t){return o.compare(e.julianDate,t)}function E(e,n){if(!r(n.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!r(n.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var a=n.columnNames.indexOf("modifiedJulianDateUtc"),i=n.columnNames.indexOf("xPoleWanderRadians"),s=n.columnNames.indexOf("yPoleWanderRadians"),c=n.columnNames.indexOf("ut1MinusUtcSeconds"),h=n.columnNames.indexOf("xCelestialPoleOffsetRadians"),E=n.columnNames.indexOf("yCelestialPoleOffsetRadians"),m=n.columnNames.indexOf("taiMinusUtcSeconds");if(a<0||i<0||s<0||c<0||h<0||E<0||m<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var p=e._samples=n.samples,_=e._dates=[];e._dateColumn=a,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=h,e._yCelestialPoleOffsetRadiansColumn=E,e._taiMinusUtcSecondsColumn=m,e._columnCount=n.columnNames.length,e._lastIndex=void 0;for(var y,T=e._addNewLeapSeconds,R=0,A=p.length;R<A;R+=e._columnCount){var S=p[R+a],N=p[R+m],M=S+l.MODIFIED_JULIAN_DATE_DIFFERENCE,I=new o(M,N,f.TAI);if(_.push(I),T){if(N!==y&&r(y)){var v=o.leapSeconds,O=t(v,I,d);if(O<0){var g=new u(I,N);v.splice(~O,0,g)}}y=N}}}function m(e,t,n,r,a){var i=n*r;a.xPoleWander=t[i+e._xPoleWanderRadiansColumn],a.yPoleWander=t[i+e._yPoleWanderRadiansColumn],a.xPoleOffset=t[i+e._xCelestialPoleOffsetRadiansColumn],a.yPoleOffset=t[i+e._yCelestialPoleOffsetRadiansColumn],a.ut1MinusUtc=t[i+e._ut1MinusUtcSecondsColumn]}function p(e,t,n){return t+e*(n-t)}function _(e,t,n,r,a,i,u){var s=e._columnCount;if(i>t.length-1)return u.xPoleWander=0,u.yPoleWander=0,u.xPoleOffset=0,u.yPoleOffset=0,u.ut1MinusUtc=0,u;var c=t[a],l=t[i];if(c.equals(l)||r.equals(c))return m(e,n,a,s,u),u;if(r.equals(l))return m(e,n,i,s,u),u;var f=o.secondsDifference(r,c)/o.secondsDifference(l,c),h=a*s,d=i*s,E=n[h+e._ut1MinusUtcSecondsColumn],_=n[d+e._ut1MinusUtcSecondsColumn],y=_-E;if(y>.5||y<-.5){var T=n[h+e._taiMinusUtcSecondsColumn],R=n[d+e._taiMinusUtcSecondsColumn];T!==R&&(l.equals(r)?E=_:_-=R-T)}return u.xPoleWander=p(f,n[h+e._xPoleWanderRadiansColumn],n[d+e._xPoleWanderRadiansColumn]),u.yPoleWander=p(f,n[h+e._yPoleWanderRadiansColumn],n[d+e._yPoleWanderRadiansColumn]),u.xPoleOffset=p(f,n[h+e._xCelestialPoleOffsetRadiansColumn],n[d+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=p(f,n[h+e._yCelestialPoleOffsetRadiansColumn],n[d+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=p(f,E,_),u}return h.NONE=i({getPromiseToLoad:function(){return e()},compute:function(e,t){return r(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new a(0,0,0,0,0),t}}),h.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},h.prototype.compute=function(e,n){if(r(this._samples)){if(r(n)||(n=new a(0,0,0,0,0)),0===this._samples.length)return n.xPoleWander=0,n.yPoleWander=0,n.xPoleOffset=0,n.yPoleOffset=0,n.ut1MinusUtc=0,n;var i=this._dates,u=this._lastIndex,s=0,l=0;if(r(u)){var f=i[u],h=i[u+1],d=o.lessThanOrEquals(f,e),E=!r(h),m=E||o.greaterThanOrEquals(h,e);if(d&&m)return s=u,!E&&h.equals(e)&&++s,l=s+1,_(this,i,this._samples,e,s,l,n),n}var p=t(i,e,o.compare,this._dateColumn);return p>=0?(p<i.length-1&&i[p+1].equals(e)&&++p,s=p,l=p):(l=~p,s=l-1,s<0&&(s=0)),this._lastIndex=s,_(this,i,this._samples,e,s,l,n),n}if(r(this._dataError))throw new c(this._dataError)},h}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(t,n,r){this.heading=e(t,0),this.pitch=e(n,0),this.roll=e(r,0)}return a.fromQuaternion=function(e,n){t(n)||(n=new a);var r=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return n.heading=-Math.atan2(s,u),n.roll=Math.atan2(o,i),n.pitch=-Math.asin(r),n},a.fromDegrees=function(e,n,i,o){return t(o)||(o=new a),o.heading=e*r.RADIANS_PER_DEGREE,o.pitch=n*r.RADIANS_PER_DEGREE,o.roll=i*r.RADIANS_PER_DEGREE,o},a.clone=function(e,n){if(t(e))return t(n)?(n.heading=e.heading,n.pitch=e.pitch,n.roll=e.roll,n):new a(e.heading,e.pitch,e.roll)},a.equals=function(e,n){return e===n||t(e)&&t(n)&&e.heading===n.heading&&e.pitch===n.pitch&&e.roll===n.roll},a.equalsEpsilon=function(e,n,a,i){return e===n||t(e)&&t(n)&&r.equalsEpsilon(e.heading,n.heading,a,i)&&r.equalsEpsilon(e.pitch,n.pitch,a,i)&&r.equalsEpsilon(e.roll,n.roll,a,i)},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,n){return a.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},a}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=t(r,document.location.href);var a=new e(r),i=new e(n);return i.resolve(a).toString()}return a}),define("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(r,a,i){i=t(i,!0),r instanceof e||(r=new e(r)),a instanceof e||(a=new e(a)),n(a.authority)&&!n(a.scheme)&&("undefined"!=typeof document&&n(document.location)&&n(document.location.href)?a.scheme=new e(document.location.href).scheme:a.scheme=r.scheme);var o=r;a.isAbsolute()&&(o=a);var u="";n(o.scheme)&&(u+=o.scheme+":"),n(o.authority)&&(u+="//"+o.authority,""!==o.path&&"/"!==o.path&&(u=u.replace(/\/?$/,"/"),o.path=o.path.replace(/^\/?/g,""))),u+=o===r?i?r.path.replace(/\/?$/,"/")+a.path.replace(/^\/?/g,""):r.path+a.path:a.path;var s=n(r.query),c=n(a.query);s&&c?u+="?"+r.query+"&"+a.query:s&&!c?u+="?"+r.query:!s&&c&&(u+="?"+a.query);var l=n(a.fragment);return n(r.fragment)&&!l?u+="#"+r.fragment:l&&(u+="#"+a.fragment),u}return a}),define("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","./joinUrls","require"],function(e,t,n,r,a,i){"use strict";function o(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;t<n;++t){var r=e[t].getAttribute("src"),a=E.exec(r);if(null!==a)return a[1]}}function u(){if(t(f))return f;var n;return n="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:o(),f=new e(r(n))}function s(e){return i.toUrl("../"+e)}function c(e){return a(u(),e)}function l(e){t(h)||(h=t(i.toUrl)?s:c),t(d)||(d=document.createElement("a"));var n=h(e);return d.href=n,d.href=d.href,d.href}var f,h,d,E=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return l._cesiumScriptRegex=E,l.setBaseUrl=function(t){f=new e(t).resolve(new e(document.location.href))},l}),define("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,n){this.x=e,this.y=t,this.s=n}return e}),define("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){e=n(e,n.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=n(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=n(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new i(this._sampleZeroJulianEphemerisDate,0,u.TAI),this._stepSizeDays=n(e.stepSizeDays,1),this._samplesPerXysFile=n(e.samplesPerXysFile,1e3),this._totalSamples=n(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,r=this._denominators=new Array(t+1),a=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t),s=0;s<=t;++s){r[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;c<=t;++c)c!==s&&(r[s]*=s-c);r[s]=1/r[s]}this._work=new Array(t+1),this._coef=new Array(t+1)}function c(e,t,n){var r=f;return r.dayNumber=t,r.secondsOfDay=n,i.daysDifference(r,e._sampleZeroDateTT)}function l(n,a){if(n._chunkDownloadsInProgress[a])return n._chunkDownloadsInProgress[a];var i=e.defer();n._chunkDownloadsInProgress[a]=i;var u,s=n._xysFileUrlTemplate;return u=r(s)?s.replace("{0}",a):t("Assets/IAU2006_XYS/IAU2006_XYS_"+a+".json"),e(o(u),function(e){n._chunkDownloadsInProgress[a]=!1;for(var t=n._samples,r=e.samples,o=a*n._samplesPerXysFile*3,u=0,s=r.length;u<s;++u)t[o+u]=r[u];i.resolve()}),i.promise}var f=new i(0,0,u.TAI);return s.prototype.preload=function(t,n,r,a){var i=c(this,t,n),o=c(this,r,a),u=i/this._stepSizeDays-this._interpolationOrder/2|0;u<0&&(u=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var f=u/this._samplesPerXysFile|0,h=s/this._samplesPerXysFile|0,d=[],E=f;E<=h;++E)d.push(l(this,E));return e.all(d)},s.prototype.computeXysRadians=function(e,t,n){var i=c(this,e,t);if(!(i<0)){var o=i/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);s<0&&(s=0);var f=s+u;f>=this._totalSamples&&(f=this._totalSamples-1,s=f-u,s<0&&(s=0));var h=!1,d=this._samples;if(r(d[3*s])||(l(this,s/this._samplesPerXysFile|0),h=!0),r(d[3*f])||(l(this,f/this._samplesPerXysFile|0),h=!0),!h){r(n)?(n.x=0,n.y=0,n.s=0):n=new a(0,0,0);var E,m,p=i-s*this._stepSizeDays,_=this._work,y=this._denominators,T=this._coef,R=this._xTable;for(E=0;E<=u;++E)_[E]=p-R[E];for(E=0;E<=u;++E){for(T[E]=1,m=0;m<=u;++m)m!==E&&(T[E]*=_[m]);T[E]*=y[E];var A=3*(s+E); +n.x+=T[E]*d[A++],n.y+=T[E]*d[A++],n.s+=T[E]*d[A]}return n}}}},s}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return t(a,{element:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(r.requestFullscreen=a,n=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(r.requestFullscreen=a,n=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?r.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(r.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?r.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(r.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?r.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(r.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),r.fullscreenerror=a)}return n},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[r.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function a(){if(!t(A)&&(A=!1,!h())){var e=/ Chrome\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(A=!0,S=r(e[1]))}return A}function i(){return a()&&S}function o(){if(!t(N)&&(N=!1,!a()&&!h()&&/ Safari\/[\.0-9]+/.test(R.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(N=!0,M=r(e[1]))}return N}function u(){return o()&&M}function s(){if(!t(I)){I=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(R.userAgent);null!==e&&(I=!0,v=r(e[1]),v.isNightly=!!e[2])}return I}function c(){return s()&&v}function l(){if(!t(O)){O=!1;var e;"Microsoft Internet Explorer"===R.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(O=!0,g=r(e[1]))):"Netscape"===R.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(O=!0,g=r(e[1])))}return O}function f(){return l()&&g}function h(){if(!t(x)){x=!1;var e=/ Edge\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(x=!0,w=r(e[1]))}return x}function d(){return h()&&w}function E(){if(!t(C)){C=!1;var e=/Firefox\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(C=!0,P=r(e[1]))}return C}function m(){return t(U)||(U=/Windows/i.test(R.appVersion)),U}function p(){return E()&&P}function _(){return t(D)||(D="undefined"!=typeof PointerEvent&&(!t(R.pointerEnabled)||R.pointerEnabled)),D}function y(){if(!t(F)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;F=t(n)&&""!==n,F&&(L=n)}return F}function T(){return y()?L:void 0}var R;R="undefined"!=typeof navigator?navigator:{};var A,S,N,M,I,v,O,g,x,w,C,P,U,D,L,F,z={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isEdge:h,edgeVersion:d,isFirefox:E,firefoxVersion:p,isWindows:m,hardwareConcurrency:e(R.hardwareConcurrency,3),supportsPointerEvents:_,supportsImageRenderingPixelated:y,imageRenderingValue:T};return z.supportsFullscreen=function(){return n.supportsFullscreen()},z.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},z.supportsWebWorkers=function(){return"undefined"!=typeof Worker},z}),define("Core/Quaternion",["./Cartesian3","./Check","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math","./Matrix3"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(e,t,r,a){this.x=n(e,0),this.y=n(t,0),this.z=n(r,0),this.w=n(a,0)}var l=new e;c.fromAxisAngle=function(t,n,a){var i=n/2,o=Math.sin(i);l=e.normalize(t,l);var u=l.x*o,s=l.y*o,f=l.z*o,h=Math.cos(i);return r(a)?(a.x=u,a.y=s,a.z=f,a.w=h,a):new c(u,s,f,h)};var f=[1,2,0],h=new Array(3);c.fromRotationMatrix=function(e,t){var n,a,i,o,u,l=e[s.COLUMN0ROW0],d=e[s.COLUMN1ROW1],E=e[s.COLUMN2ROW2],m=l+d+E;if(m>0)n=Math.sqrt(m+1),u=.5*n,n=.5/n,a=(e[s.COLUMN1ROW2]-e[s.COLUMN2ROW1])*n,i=(e[s.COLUMN2ROW0]-e[s.COLUMN0ROW2])*n,o=(e[s.COLUMN0ROW1]-e[s.COLUMN1ROW0])*n;else{var p=f,_=0;d>l&&(_=1),E>l&&E>d&&(_=2);var y=p[_],T=p[y];n=Math.sqrt(e[s.getElementIndex(_,_)]-e[s.getElementIndex(y,y)]-e[s.getElementIndex(T,T)]+1);var R=h;R[_]=.5*n,n=.5/n,u=(e[s.getElementIndex(T,y)]-e[s.getElementIndex(y,T)])*n,R[y]=(e[s.getElementIndex(y,_)]+e[s.getElementIndex(_,y)])*n,R[T]=(e[s.getElementIndex(T,_)]+e[s.getElementIndex(_,T)])*n,a=-R[0],i=-R[1],o=-R[2]}return r(t)?(t.x=a,t.y=i,t.z=o,t.w=u,t):new c(a,i,o,u)};var d=new c;c.fromHeadingPitchRoll=function(t,n,r,a){var i=c.fromAxisAngle(e.UNIT_X,r,d),o=c.fromAxisAngle(e.UNIT_Y,-n,a);a=c.multiply(o,i,o);var u=c.fromAxisAngle(e.UNIT_Z,-t,d);return c.multiply(u,a,a)};var E=new e,m=new e,p=new c,_=new c,y=new c;c.packedLength=4,c.pack=function(e,t,r){return r=n(r,0),t[r++]=e.x,t[r++]=e.y,t[r++]=e.z,t[r]=e.w,t},c.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new c),a.x=e[t],a.y=e[t+1],a.z=e[t+2],a.w=e[t+3],a},c.packedInterpolationLength=3,c.convertPackedArrayForInterpolation=function(e,t,n,r){c.unpack(e,4*n,y),c.conjugate(y,y);for(var a=0,i=n-t+1;a<i;a++){var o=3*a;c.unpack(e,4*(t+a),p),c.multiply(p,y,p),p.w<0&&c.negate(p,p),c.computeAxis(p,E);var u=c.computeAngle(p);r[o]=E.x*u,r[o+1]=E.y*u,r[o+2]=E.z*u}},c.unpackInterpolationResult=function(t,n,a,i,o){r(o)||(o=new c),e.fromArray(t,0,m);var u=e.magnitude(m);return c.unpack(n,4*i,_),0===u?c.clone(c.IDENTITY,p):c.fromAxisAngle(m,u,p),c.multiply(p,_,o)},c.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new c(e.x,e.y,e.z,e.w)},c.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},c.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},c.magnitude=function(e){return Math.sqrt(c.magnitudeSquared(e))},c.normalize=function(e,t){var n=1/c.magnitude(e),r=e.x*n,a=e.y*n,i=e.z*n,o=e.w*n;return t.x=r,t.y=a,t.z=i,t.w=o,t},c.inverse=function(e,t){var n=c.magnitudeSquared(e);return t=c.conjugate(e,t),c.multiplyByScalar(t,1/n,t)},c.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},c.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},c.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},c.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},c.multiply=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=e.w,u=t.x,s=t.y,c=t.z,l=t.w,f=o*u+r*l+a*c-i*s,h=o*s-r*c+a*l+i*u,d=o*c+r*s-a*u+i*l,E=o*l-r*u-a*s-i*c;return n.x=f,n.y=h,n.z=d,n.w=E,n},c.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},c.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},c.computeAxis=function(e,t){var n=e.w;if(Math.abs(n-1)<u.EPSILON6)return t.x=t.y=t.z=0,t;var r=1/Math.sqrt(1-n*n);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},c.computeAngle=function(e){return Math.abs(e.w-1)<u.EPSILON6?0:2*Math.acos(e.w)};var T=new c;c.lerp=function(e,t,n,r){return T=c.multiplyByScalar(t,n,T),r=c.multiplyByScalar(e,1-n,r),c.add(T,r,r)};var R=new c,A=new c,S=new c;c.slerp=function(e,t,n,r){var a=c.dot(e,t),i=t;if(a<0&&(a=-a,i=R=c.negate(t,R)),1-a<u.EPSILON6)return c.lerp(e,i,n,r);var o=Math.acos(a);return A=c.multiplyByScalar(e,Math.sin((1-n)*o),A),S=c.multiplyByScalar(i,Math.sin(n*o),S),r=c.add(A,S,r),c.multiplyByScalar(r,1/Math.sin(o),r)},c.log=function(t,n){var r=u.acosClamped(t.w),a=0;return 0!==r&&(a=r/Math.sin(r)),e.multiplyByScalar(t,a,n)},c.exp=function(t,n){var r=e.magnitude(t),a=0;return 0!==r&&(a=Math.sin(r)/r),n.x=t.x*a,n.y=t.y*a,n.z=t.z*a,n.w=Math.cos(r),n};var N=new e,M=new e,I=new c,v=new c;c.computeInnerQuadrangle=function(t,n,r,a){var i=c.conjugate(n,I);c.multiply(i,r,v);var o=c.log(v,N);c.multiply(i,t,v);var u=c.log(v,M);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),c.exp(o,I),c.multiply(n,I,a)},c.squad=function(e,t,n,r,a,i){var o=c.slerp(e,t,a,I),u=c.slerp(n,r,a,v);return c.slerp(o,u,2*a*(1-a),i)};for(var O=new c,g=1.9011074535173003,x=i.supportsTypedArrays()?new Float32Array(8):[],w=i.supportsTypedArrays()?new Float32Array(8):[],C=i.supportsTypedArrays()?new Float32Array(8):[],P=i.supportsTypedArrays()?new Float32Array(8):[],U=0;U<7;++U){var D=U+1,L=2*D+1;x[U]=1/(D*L),w[U]=D/L}return x[7]=g/136,w[7]=8*g/17,c.fastSlerp=function(e,t,n,r){var a,i=c.dot(e,t);i>=0?a=1:(a=-1,i=-i);for(var o=i-1,u=1-n,s=n*n,l=u*u,f=7;f>=0;--f)C[f]=(x[f]*s-w[f])*o,P[f]=(x[f]*l-w[f])*o;var h=a*n*(1+C[0]*(1+C[1]*(1+C[2]*(1+C[3]*(1+C[4]*(1+C[5]*(1+C[6]*(1+C[7])))))))),d=u*(1+P[0]*(1+P[1]*(1+P[2]*(1+P[3]*(1+P[4]*(1+P[5]*(1+P[6]*(1+P[7])))))))),E=c.multiplyByScalar(e,d,O);return c.multiplyByScalar(t,h,r),c.add(E,r,r)},c.fastSquad=function(e,t,n,r,a,i){var o=c.fastSlerp(e,t,a,I),u=c.fastSlerp(n,r,a,v);return c.fastSlerp(o,u,2*a*(1-a),i)},c.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},c.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n},c.ZERO=o(new c(0,0,0,0)),c.IDENTITY=o(new c(0,0,0,1)),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.x+", "+this.y+", "+this.z+", "+this.w+")"},c}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./Check","./defaultValue","./defined","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./HeadingPitchRoll","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,E,m,p,_,y,T,R){"use strict";var A={},S=new n,N=new n,M=new n;A.eastNorthUpToFixedFrame=function(e,t,r){if(p.equalsEpsilon(e.x,0,p.EPSILON14)&&p.equalsEpsilon(e.y,0,p.EPSILON14)){var a=p.sign(e.z);return u(r)?(r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=-a,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=a,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(0,-a,0,e.x,1,0,0,e.y,0,0,a,e.z,0,0,0,1)}var i=S,s=N,c=M;return t=o(t,f.WGS84),t.geodeticSurfaceNormal(e,i),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(i,s,c),u(r)?(r[0]=s.x,r[1]=s.y,r[2]=s.z,r[3]=0,r[4]=c.x,r[5]=c.y,r[6]=c.z,r[7]=0,r[8]=i.x,r[9]=i.y,r[10]=i.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(s.x,c.x,i.x,e.x,s.y,c.y,i.y,e.y,s.z,c.z,i.z,e.z,0,0,0,1)};var I=new n,v=new n,O=new n;A.northEastDownToFixedFrame=function(e,t,r){if(p.equalsEpsilon(e.x,0,p.EPSILON14)&&p.equalsEpsilon(e.y,0,p.EPSILON14)){var a=p.sign(e.z);return u(r)?(r[0]=-a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=-a,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(-a,0,0,e.x,0,1,0,e.y,0,0,-a,e.z,0,0,0,1)}var i=I,s=v,c=O;return t=o(t,f.WGS84),t.geodeticSurfaceNormal(e,i),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(i,s,c),u(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=s.x,r[5]=s.y,r[6]=s.z,r[7]=0,r[8]=-i.x,r[9]=-i.y,r[10]=-i.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(c.x,s.x,-i.x,e.x,c.y,s.y,-i.y,e.y,c.z,s.z,-i.z,e.z,0,0,0,1)},A.northUpEastToFixedFrame=function(e,t,r){if(p.equalsEpsilon(e.x,0,p.EPSILON14)&&p.equalsEpsilon(e.y,0,p.EPSILON14)){var a=p.sign(e.z);return u(r)?(r[0]=-a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=a,r[7]=0,r[8]=0,r[9]=1,r[10]=0,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(-a,0,0,e.x,0,0,1,e.y,0,a,0,e.z,0,0,0,1)}var i=S,s=N,c=M;return t=o(t,f.WGS84),t.geodeticSurfaceNormal(e,i),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(i,s,c),u(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=i.x,r[5]=i.y,r[6]=i.z,r[7]=0,r[8]=s.x,r[9]=s.y,r[10]=s.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(c.x,i.x,s.x,e.x,c.y,i.y,s.y,e.y,c.z,i.z,s.z,e.z,0,0,0,1)},A.northWestUpToFixedFrame=function(e,t,r){if(p.equalsEpsilon(e.x,0,p.EPSILON14)&&p.equalsEpsilon(e.y,0,p.EPSILON14)){var a=p.sign(e.z);return u(r)?(r[0]=-a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=a,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(-a,0,0,e.x,0,-1,0,e.y,0,0,a,e.z,0,0,0,1)}var i=S,s=N,c=M;return t=o(t,f.WGS84),t.geodeticSurfaceNormal(e,i),s.x=-e.y,s.y=e.x,s.z=0,n.normalize(s,s),n.cross(i,s,c),u(r)?(r[0]=c.x,r[1]=c.y,r[2]=c.z,r[3]=0,r[4]=-s.x,r[5]=-s.y,r[6]=-s.z,r[7]=0,r[8]=i.x,r[9]=i.y,r[10]=i.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new y(c.x,-s.x,i.x,e.x,c.y,-s.y,i.y,e.y,c.z,-s.z,i.z,e.z,0,0,0,1)};var g=new T,x=new n(1,1,1),w=new y;A.headingPitchRollToFixedFrame=function(e,t,r,a){i.typeOf.object("headingPitchRoll",t);var o=t.heading,u=t.pitch,s=t.roll,c=T.fromHeadingPitchRoll(o,u,s,g),l=y.fromTranslationQuaternionRotationScale(n.ZERO,c,x,w);return a=A.eastNorthUpToFixedFrame(e,r,a),y.multiply(a,l,a)};var C=new y,P=new _;A.headingPitchRollQuaternion=function(e,t,n,r){i.typeOf.object("headingPitchRoll",t);var a=A.headingPitchRollToFixedFrame(e,t,n,C),o=y.getRotation(a,P);return T.fromRotationMatrix(o,r)};var U=24110.54841,D=8640184.812866,L=.093104,F=-62e-7,z=1.1772758384668e-19,B=72921158553e-15,b=p.TWO_PI/86400,q=new m;A.computeTemeToPseudoFixedMatrix=function(e,t){q=m.addSeconds(e,-m.computeTaiMinusUtc(e),q);var n,r=q.dayNumber,a=q.secondsOfDay,i=r-2451545;n=a>=43200?(i+.5)/R.DAYS_PER_JULIAN_CENTURY:(i-.5)/R.DAYS_PER_JULIAN_CENTURY;var o=U+n*(D+n*(L+n*F)),s=o*b%p.TWO_PI,c=B+z*(r-2451545.5),l=(a+.5*R.SECONDS_PER_DAY)%R.SECONDS_PER_DAY,f=s+c*l,h=Math.cos(f),d=Math.sin(f);return u(t)?(t[0]=h,t[1]=-d,t[2]=0,t[3]=d,t[4]=h,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new _(h,d,0,-d,h,0,0,0,1)},A.iau2006XysData=new d,A.earthOrientationParameters=c.NONE;var G=32.184,W=2451545;A.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+G,a=t.stop.dayNumber,i=t.stop.secondsOfDay+G,o=A.iau2006XysData.preload(n,r,a,i),u=A.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},A.computeIcrfToFixedMatrix=function(e,t){u(t)||(t=new _);var n=A.computeFixedToIcrfMatrix(e,t);if(u(n))return _.transpose(n,t)};var X=new E(0,0,0),V=new l(0,0,0,0,0,0),H=new _,Y=new _;A.computeFixedToIcrfMatrix=function(e,t){u(t)||(t=new _);var n=A.earthOrientationParameters.compute(e,V);if(u(n)){var r=e.dayNumber,a=e.secondsOfDay+G,i=A.iau2006XysData.computeXysRadians(r,a,X);if(u(i)){var o=i.x+n.xPoleOffset,s=i.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-o*o-s*s)),l=H;l[0]=1-c*o*o,l[3]=-c*o*s,l[6]=o,l[1]=-c*o*s,l[4]=1-c*s*s,l[7]=s,l[2]=-o,l[5]=-s,l[8]=1-c*(o*o+s*s);var f=_.fromRotationZ(-i.s,Y),h=_.multiply(l,f,H),d=e.dayNumber,E=e.secondsOfDay-m.computeTaiMinusUtc(e)+n.ut1MinusUtc,y=d-2451545,T=E/R.SECONDS_PER_DAY,S=.779057273264+T+.00273781191135448*(y+T);S=S%1*p.TWO_PI;var N=_.fromRotationZ(S,Y),M=_.multiply(h,N,H),I=Math.cos(n.xPoleWander),v=Math.cos(n.yPoleWander),O=Math.sin(n.xPoleWander),g=Math.sin(n.yPoleWander),x=r-W+a/R.SECONDS_PER_DAY;x/=36525;var w=-47e-6*x*p.RADIANS_PER_DEGREE/3600,C=Math.cos(w),P=Math.sin(w),U=Y;return U[0]=I*C,U[1]=I*P,U[2]=O,U[3]=-v*P+g*O*C,U[4]=v*C+g*O*P,U[5]=-g*I,U[6]=-g*P-v*O*C,U[7]=g*C-v*O*P,U[8]=v*I,_.multiply(M,U,t)}}};var k=new r;A.pointToWindowCoordinates=function(e,t,n,r){return r=A.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},A.pointToGLWindowCoordinates=function(e,n,a,i){u(i)||(i=new t);var o=k;return y.multiplyByVector(e,r.fromElements(a.x,a.y,a.z,1,o),o),r.multiplyByScalar(o,1/o.w,o),y.multiplyByVector(n,o,o),t.fromCartesian4(o,i)};var Z=new n,j=new n,K=new n;A.rotationMatrixFromPositionVelocity=function(e,t,r,a){var i=o(r,f.WGS84).geodeticSurfaceNormal(e,Z),s=n.cross(t,i,j);n.equalsEpsilon(s,n.ZERO,p.EPSILON6)&&(s=n.clone(n.UNIT_X,s));var c=n.cross(s,t,K);return n.cross(t,c,s),n.negate(s,s),u(a)||(a=new _),a[0]=t.x,a[1]=t.y,a[2]=t.z,a[3]=s.x,a[4]=s.y,a[5]=s.z,a[6]=c.x,a[7]=c.y,a[8]=c.z,a};var J=new a,Q=new n,$=new n,ee=new r,te=new r,ne=new r,re=new r,ae=new r,ie=new y,oe=new y;A.basisTo2D=function(e,t,a){var i=e.ellipsoid,o=y.getColumn(t,3,ee),u=i.cartesianToCartographic(o,J),s=A.eastNorthUpToFixedFrame(o,i,ie),c=y.inverseTransformation(s,oe),l=e.project(u,Q),f=te;f.x=l.z,f.y=l.x,f.z=l.y,f.w=1;var h=y.getColumn(t,0,$),d=n.magnitude(h),E=y.multiplyByVector(c,h,ne);r.fromElements(E.z,E.x,E.y,0,E);var m=y.getColumn(t,1,$),p=n.magnitude(m),_=y.multiplyByVector(c,m,re);r.fromElements(_.z,_.x,_.y,0,_);var T=y.getColumn(t,2,$),R=n.magnitude(T),S=ae;return n.cross(E,_,S),n.normalize(S,S),n.cross(_,S,E),n.normalize(E,E),n.cross(S,E,_),n.normalize(_,_),n.multiplyByScalar(E,d,E),n.multiplyByScalar(_,p,_),n.multiplyByScalar(S,R,S),y.setColumn(a,0,E,a),y.setColumn(a,1,_,a),y.setColumn(a,2,S,a),y.setColumn(a,3,f,a),a};var ue=new y(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);return A.wgs84To2DModelMatrix=function(e,t,n){var r=e.ellipsoid,a=A.eastNorthUpToFixedFrame(t,r,ie),i=y.inverseTransformation(a,oe),o=r.cartesianToCartographic(t,J),u=e.project(o,Q),s=te;s.x=u.z,s.y=u.x,s.z=u.y,s.w=1;var c=y.fromTranslation(s,ie);return y.multiply(ue,i,n),y.multiply(c,n,n),n},A}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d){"use strict";function E(e,t){t=a(t,s.WGS84),e=t.scaleToGeodeticSurface(e);var r=d.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=n.fromCartesian4(l.getColumn(r,0,m)),this._yAxis=n.fromCartesian4(l.getColumn(r,1,m));var i=n.fromCartesian4(l.getColumn(r,2,m));this._plane=f.fromPointNormal(e,i)}var m=new r;o(E.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var p=new e;E.fromPoints=function(t,n){var r=e.fromPoints(t,p);return new E(r.center,n)};var _=new h,y=new n;E.prototype.projectPointOntoPlane=function(e,r){var a=_;a.origin=e,n.normalize(e,a.direction);var o=c.rayPlane(a,this._plane,y);if(i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,y)),i(o)){var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return i(r)?(r.x=s,r.y=l,r):new t(s,l)}},E.prototype.projectPointsOntoPlane=function(e,t){i(t)||(t=[]);for(var n=0,r=e.length,a=0;a<r;a++){var o=this.projectPointOntoPlane(e[a],t[n]);i(o)&&(t[n]=o,n++)}return t.length=n,t},E.prototype.projectPointToNearestOnPlane=function(e,r){i(r)||(r=new t);var a=_;a.origin=e,n.clone(this._plane.normal,a.direction);var o=c.rayPlane(a,this._plane,y);i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,y));var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return r.x=s,r.y=l,r},E.prototype.projectPointsToNearestOnPlane=function(e,t){i(t)||(t=[]);var n=e.length;t.length=n;for(var r=0;r<n;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var T=new n;return E.prototype.projectPointsOntoEllipsoid=function(e,t){var r=e.length;i(t)?t.length=r:t=new Array(r);for(var a=this._ellipsoid,o=this._origin,u=this._xAxis,s=this._yAxis,c=T,l=0;l<r;++l){var f=e[l];n.multiplyByScalar(u,f.x,c),i(t[l])||(t[l]=new n);var h=n.add(o,c,t[l]);n.multiplyByScalar(s,f.y,c),n.add(h,c,h),a.scaleToGeocentricSurface(h,h)}return t},E}),define("Core/OrientedBoundingBox",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Intersect","./Interval","./Math","./Matrix3","./Plane","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,E){"use strict";function m(e,t){this.center=n.clone(a(e,n.ZERO)),this.halfAxes=h.clone(a(t,h.ZERO))}function p(e,t,r,a,o,u,s,c){i(c)||(c=new m);var l=c.halfAxes;h.setColumn(l,0,e.xAxis,l),h.setColumn(l,1,e.yAxis,l),h.setColumn(l,2,e.zAxis,l);var f=I;f.x=(t+r)/2,f.y=(a+o)/2,f.z=(u+s)/2;var d=v;d.x=(r-t)/2,d.y=(o-a)/2,d.z=(s-u)/2;var E=c.center;return f=h.multiplyByVector(l,f,f),n.add(e.origin,f,E),h.multiplyByScale(l,d,l),c}var _=new n,y=new n,T=new n,R=new n,A=new n,S=new n,N=new h,M={unitary:new h,diagonal:new h};m.fromPoints=function(e,t){if(i(t)||(t=new m),!i(e)||0===e.length)return t.halfAxes=h.ZERO,t.center=n.ZERO,t;var r,a=e.length,o=n.clone(e[0],_);for(r=1;r<a;r++)n.add(o,e[r],o);var u=1/a;n.multiplyByScalar(o,u,o);var s,c=0,l=0,f=0,d=0,E=0,p=0;for(r=0;r<a;r++)s=n.subtract(e[r],o,y),c+=s.x*s.x,l+=s.x*s.y,f+=s.x*s.z,d+=s.y*s.y,E+=s.y*s.z,p+=s.z*s.z;c*=u,l*=u,f*=u,d*=u,E*=u,p*=u;var I=N;I[0]=c,I[1]=l,I[2]=f,I[3]=l,I[4]=d,I[5]=E,I[6]=f,I[7]=E,I[8]=p;var v=h.computeEigenDecomposition(I,M),O=h.clone(v.unitary,t.halfAxes),g=h.getColumn(O,0,R),x=h.getColumn(O,1,A),w=h.getColumn(O,2,S),C=-Number.MAX_VALUE,P=-Number.MAX_VALUE,U=-Number.MAX_VALUE,D=Number.MAX_VALUE,L=Number.MAX_VALUE,F=Number.MAX_VALUE;for(r=0;r<a;r++)s=e[r],C=Math.max(n.dot(g,s),C),P=Math.max(n.dot(x,s),P),U=Math.max(n.dot(w,s),U),D=Math.min(n.dot(g,s),D),L=Math.min(n.dot(x,s),L),F=Math.min(n.dot(w,s),F);g=n.multiplyByScalar(g,.5*(D+C),g),x=n.multiplyByScalar(x,.5*(L+P),x),w=n.multiplyByScalar(w,.5*(F+U),w);var z=n.add(g,x,t.center);z=n.add(z,w,z);var B=T;return B.x=C-D,B.y=P-L,B.z=U-F,n.multiplyByScalar(B,.5,B),h.multiplyByScale(t.halfAxes,B,t.halfAxes),t};var I=new n,v=new n,O=new r,g=new n,x=[new r,new r,new r,new r,new r,new r,new r,new r],w=[new n,new n,new n,new n,new n,new n,new n,new n],C=[new t,new t,new t,new t,new t,new t,new t,new t];m.fromRectangle=function(e,t,n,r,i){t=a(t,0),n=a(n,0),r=a(r,u.WGS84);var o=E.center(e,O),c=r.cartographicToCartesian(o,g),l=new s(c,r),f=l.plane,h=x[0],m=x[1],_=x[2],y=x[3],T=x[4],R=x[5],A=x[6],S=x[7],N=o.longitude,M=e.south<0&&e.north>0?0:o.latitude;A.latitude=R.latitude=T.latitude=e.south,S.latitude=y.latitude=M,h.latitude=m.latitude=_.latitude=e.north,A.longitude=S.longitude=h.longitude=e.west,R.longitude=m.longitude=N,T.longitude=y.longitude=_.longitude=e.east,_.height=m.height=h.height=S.height=A.height=R.height=T.height=y.height=n,r.cartographicArrayToCartesianArray(x,w),l.projectPointsToNearestOnPlane(w,C);var I=Math.min(C[6].x,C[7].x,C[0].x),v=Math.max(C[2].x,C[3].x,C[4].x),P=Math.min(C[4].y,C[5].y,C[6].y),U=Math.max(C[0].y,C[1].y,C[2].y);_.height=h.height=T.height=A.height=t,r.cartographicArrayToCartesianArray(x,w);var D=Math.min(d.getPointDistance(f,w[0]),d.getPointDistance(f,w[2]),d.getPointDistance(f,w[4]),d.getPointDistance(f,w[6])),L=n;return p(l,I,v,P,U,D,L,i)},m.clone=function(e,t){if(i(e))return i(t)?(n.clone(e.center,t.center),h.clone(e.halfAxes,t.halfAxes),t):new m(e.center,e.halfAxes)},m.intersectPlane=function(e,t){var r=e.center,a=t.normal,i=e.halfAxes,o=a.x,u=a.y,s=a.z,l=Math.abs(o*i[h.COLUMN0ROW0]+u*i[h.COLUMN0ROW1]+s*i[h.COLUMN0ROW2])+Math.abs(o*i[h.COLUMN1ROW0]+u*i[h.COLUMN1ROW1]+s*i[h.COLUMN1ROW2])+Math.abs(o*i[h.COLUMN2ROW0]+u*i[h.COLUMN2ROW1]+s*i[h.COLUMN2ROW2]),f=n.dot(a,r)+t.distance;return f<=-l?c.OUTSIDE:f>=l?c.INSIDE:c.INTERSECTING};var P=new n,U=new n,D=new n,L=new n;m.distanceSquaredTo=function(e,t){var r=n.subtract(t,e.center,I),a=e.halfAxes,i=h.getColumn(a,0,P),o=h.getColumn(a,1,U),u=h.getColumn(a,2,D),s=n.magnitude(i),c=n.magnitude(o),l=n.magnitude(u);n.normalize(i,i),n.normalize(o,o),n.normalize(u,u);var f=L;f.x=n.dot(r,i),f.y=n.dot(r,o),f.z=n.dot(r,u);var d,E=0;return f.x<-s?(d=f.x+s,E+=d*d):f.x>s&&(d=f.x-s,E+=d*d),f.y<-c?(d=f.y+c,E+=d*d):f.y>c&&(d=f.y-c,E+=d*d),f.z<-l?(d=f.z+l,E+=d*d):f.z>l&&(d=f.z-l,E+=d*d),E};var F=new n,z=new n;m.computePlaneDistances=function(e,t,r,a){i(a)||(a=new l);var o=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,s=e.center,c=e.halfAxes,f=h.getColumn(c,0,P),d=h.getColumn(c,1,U),E=h.getColumn(c,2,D),m=n.add(f,d,F);n.add(m,E,m),n.add(m,s,m);var p=n.subtract(m,t,z),_=n.dot(r,p);return o=Math.min(_,o),u=Math.max(_,u),n.add(s,f,m),n.add(m,d,m),n.subtract(m,E,m),n.subtract(m,t,p),_=n.dot(r,p),o=Math.min(_,o),u=Math.max(_,u),n.add(s,f,m),n.subtract(m,d,m),n.add(m,E,m),n.subtract(m,t,p),_=n.dot(r,p),o=Math.min(_,o),u=Math.max(_,u),n.add(s,f,m),n.subtract(m,d,m),n.subtract(m,E,m),n.subtract(m,t,p),_=n.dot(r,p),o=Math.min(_,o),u=Math.max(_,u),n.subtract(s,f,m),n.add(m,d,m),n.add(m,E,m),n.subtract(m,t,p),_=n.dot(r,p),o=Math.min(_,o),u=Math.max(_,u),n.subtract(s,f,m),n.add(m,d,m),n.subtract(m,E,m),n.subtract(m,t,p),_=n.dot(r,p),o=Math.min(_,o),u=Math.max(_,u),n.subtract(s,f,m),n.subtract(m,d,m),n.add(m,E,m),n.subtract(m,t,p),_=n.dot(r,p),o=Math.min(_,o),u=Math.max(_,u),n.subtract(s,f,m),n.subtract(m,d,m),n.subtract(m,E,m),n.subtract(m,t,p),_=n.dot(r,p),o=Math.min(_,o),u=Math.max(_,u),a.start=o,a.stop=u,a};var B=new e;return m.isOccluded=function(t,n){var r=e.fromOrientedBoundingBox(t,B);return!n.isBoundingSphereVisible(r)},m.prototype.intersectPlane=function(e){return m.intersectPlane(this,e)},m.prototype.distanceSquaredTo=function(e){return m.distanceSquaredTo(this,e)},m.prototype.computePlaneDistances=function(e,t,n){return m.computePlaneDistances(this,e,t,n)},m.prototype.isOccluded=function(e){return m.isOccluded(this,e)},m.equals=function(e,t){return e===t||i(e)&&i(t)&&n.equals(e.center,t.center)&&h.equals(e.halfAxes,t.halfAxes)},m.prototype.clone=function(e){return m.clone(this,e)},m.prototype.equals=function(e){return m.equals(this,e)},m}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,a,i){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){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.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},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 Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,a){switch(r=e(r,0),a=e(a,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,a);case o.SHORT:return new Int16Array(n,r,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,a);case o.INT:return new Int32Array(n,r,a);case o.UNSIGNED_INT:return new Uint32Array(n,r,a);case o.FLOAT:return new Float32Array(n,r,a);case o.DOUBLE:return new Float64Array(n,r,a)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/TerrainQuantization",["./freezeObject"],function(e){"use strict";var t={NONE:0,BITS12:1};return e(t)}),define("Core/TerrainEncoding",["./AttributeCompression","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./Math","./Matrix4","./TerrainQuantization"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(e,t,r,o,c,h){var p,_,y,T;if(i(e)&&i(t)&&i(r)&&i(o)){var R=e.minimum,A=e.maximum,S=n.subtract(A,R,f),N=r-t,M=Math.max(n.maximumComponent(S),N);p=M<m-1?s.BITS12:s.NONE,_=e.center,y=u.inverseTransformation(o,new u);var I=n.negate(R,l);u.multiply(u.fromTranslation(I,d),y,y);var v=l;v.x=1/S.x,v.y=1/S.y,v.z=1/S.z,u.multiply(u.fromScale(v,d),y,y),T=u.clone(o),u.setTranslation(T,n.ZERO,T),o=u.clone(o,new u);var O=u.fromTranslation(R,d),g=u.fromScale(S,E),x=u.multiply(O,g,d);u.multiply(o,x,o),u.multiply(T,x,T)}this.quantization=p,this.minimumHeight=t,this.maximumHeight=r,this.center=_,this.toScaledENU=y,this.fromScaledENU=o,this.matrix=T,this.hasVertexNormals=c,this.hasWebMercatorT=a(h,!1)}var l=new n,f=new n,h=new t,d=new u,E=new u,m=Math.pow(2,12);c.prototype.encode=function(r,a,i,c,f,d,E){var m=c.x,p=c.y;if(this.quantization===s.BITS12){i=u.multiplyByPoint(this.toScaledENU,i,l),i.x=o.clamp(i.x,0,1),i.y=o.clamp(i.y,0,1),i.z=o.clamp(i.z,0,1);var _=this.maximumHeight-this.minimumHeight,y=o.clamp((f-this.minimumHeight)/_,0,1);t.fromElements(i.x,i.y,h);var T=e.compressTextureCoordinates(h);t.fromElements(i.z,y,h);var R=e.compressTextureCoordinates(h);t.fromElements(m,p,h);var A=e.compressTextureCoordinates(h);if(r[a++]=T,r[a++]=R,r[a++]=A,this.hasWebMercatorT){t.fromElements(E,0,h);var S=e.compressTextureCoordinates(h);r[a++]=S}}else n.subtract(i,this.center,l),r[a++]=l.x,r[a++]=l.y,r[a++]=l.z,r[a++]=f,r[a++]=m,r[a++]=p,this.hasWebMercatorT&&(r[a++]=E);return this.hasVertexNormals&&(r[a++]=e.octPackFloat(d)),a},c.prototype.decodePosition=function(t,r,a){if(i(a)||(a=new n),r*=this.getStride(),this.quantization===s.BITS12){var o=e.decompressTextureCoordinates(t[r],h);a.x=o.x,a.y=o.y;var c=e.decompressTextureCoordinates(t[r+1],h);return a.z=c.x,u.multiplyByPoint(this.fromScaledENU,a,a)}return a.x=t[r],a.y=t[r+1],a.z=t[r+2],n.add(a,this.center,a)},c.prototype.decodeTextureCoordinates=function(n,r,a){return i(a)||(a=new t),r*=this.getStride(),this.quantization===s.BITS12?e.decompressTextureCoordinates(n[r+2],a):t.fromElements(n[r+4],n[r+5],a)},c.prototype.decodeHeight=function(t,n){if(n*=this.getStride(),this.quantization===s.BITS12){var r=e.decompressTextureCoordinates(t[n+1],h);return r.y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight}return t[n+3]},c.prototype.getOctEncodedNormal=function(e,n,r){var a=this.getStride();n=(n+1)*a-1;var i=e[n]/256,o=Math.floor(i),u=256*(i-o);return t.fromElements(o,u,r)},c.prototype.getStride=function(){var e;switch(this.quantization){case s.BITS12:e=3;break;default:e=6}return this.hasWebMercatorT&&++e,this.hasVertexNormals&&++e,e};var p={position3DAndHeight:0,textureCoordAndEncodedNormals:1},_={compressed0:0,compressed1:1};return c.prototype.getAttributes=function(e){ +var t,n=r.FLOAT,a=r.getSizeInBytes(n);if(this.quantization===s.NONE){var i=4,o=2;return this.hasWebMercatorT&&++o,this.hasVertexNormals&&++o,t=(i+o)*a,[{index:p.position3DAndHeight,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:i,offsetInBytes:0,strideInBytes:t},{index:p.textureCoordAndEncodedNormals,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:o,offsetInBytes:i*a,strideInBytes:t}]}var u=3,c=0;return(this.hasWebMercatorT||this.hasVertexNormals)&&++u,this.hasWebMercatorT&&this.hasVertexNormals?(++c,t=(u+c)*a,[{index:_.compressed0,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:u,offsetInBytes:0,strideInBytes:t},{index:_.compressed1,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:c,offsetInBytes:u*a,strideInBytes:t}]):[{index:_.compressed0,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:u}]},c.prototype.getAttributeLocations=function(){return this.quantization===s.NONE?p:_},c.clone=function(e,t){return i(t)||(t=new c),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=n.clone(e.center),t.toScaledENU=u.clone(e.toScaledENU),t.fromScaledENU=u.clone(e.fromScaledENU),t.matrix=u.clone(e.matrix),t.hasVertexNormals=e.hasVertexNormals,t.hasWebMercatorT=e.hasWebMercatorT,t},c}),define("Core/formatError",["./defined"],function(e){"use strict";function t(t){var n,r=t.name,a=t.message;n=e(r)&&e(a)?r+": "+a:t.toString();var i=t.stack;return e(i)&&(n+="\n"+i),n}return t}),define("Workers/createTaskProcessorWorker",["../Core/defaultValue","../Core/defined","../Core/formatError"],function(e,t,n){"use strict";function r(r){var a,i=[],o={id:void 0,result:void 0,error:void 0};return function(u){var s=u.data;i.length=0,o.id=s.id,o.error=void 0,o.result=void 0;try{o.result=r(s.parameters,i)}catch(e){e instanceof Error?o.error={name:e.name,message:e.message,stack:e.stack}:o.error=e}t(a)||(a=e(self.webkitPostMessage,self.postMessage)),s.canTransferArrayBuffer||(i.length=0);try{a(o,i)}catch(e){o.result=void 0,o.error="postMessage failed with error: "+n(e)+"\n with responseMessage: "+JSON.stringify(o),a(o)}}}return r}),define("Workers/upsampleQuantizedTerrainMesh",["../Core/AttributeCompression","../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/defined","../Core/Ellipsoid","../Core/EllipsoidalOccluder","../Core/IndexDatatype","../Core/Intersections2D","../Core/Math","../Core/OrientedBoundingBox","../Core/TerrainEncoding","./createTaskProcessorWorker"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d){"use strict";function E(e,n){var a=e.isEastChild,i=e.isNorthChild,d=a?T:0,E=a?y:T,p=i?T:0,L=i?y:T,F=I,z=v,B=O,b=x;F.length=0,z.length=0,B.length=0,b.length=0;var q=g;q.length=0;var G={},W=e.vertices,X=e.indices;X=X.subarray(0,e.skirtIndex);var V,H,Y,k=h.clone(e.encoding),Z=k.hasVertexNormals,j=e.exaggeration,K=0,J=e.vertexCountWithoutSkirts,Q=e.minimumHeight,$=e.maximumHeight,ee=new Array(J),te=new Array(J),ne=new Array(J),re=Z?new Array(2*J):void 0,ae=20;for(H=0,Y=0;H<J;++H,Y+=2){var ie=k.decodeTextureCoordinates(W,H,U);if(V=k.decodeHeight(W,H)/j,ee[H]=l.clamp(ie.x*y|0,0,y),te[H]=l.clamp(ie.y*y|0,0,y),ne[H]=l.clamp((V-Q)/($-Q)*y|0,0,y),ee[H]<ae&&(ee[H]=0),te[H]<ae&&(te[H]=0),y-ee[H]<ae&&(ee[H]=y),y-te[H]<ae&&(te[H]=y),Z){var oe=k.getOctEncodedNormal(W,H,D);re[Y]=oe.x,re[Y+1]=oe.y}}var ue,se;for(H=0,Y=0;H<J;++H,Y+=2)ue=ee[H],se=te[H],(a&&ue>=T||!a&&ue<=T)&&(i&&se>=T||!i&&se<=T)&&(G[H]=K,F.push(ue),z.push(se),B.push(ne[H]),Z&&(b.push(re[Y]),b.push(re[Y+1])),++K);var ce=[];ce.push(new m),ce.push(new m),ce.push(new m);var le=[];le.push(new m),le.push(new m),le.push(new m);var fe,he;for(H=0;H<X.length;H+=3){var de=X[H],Ee=X[H+1],me=X[H+2],pe=ee[de],_e=ee[Ee],ye=ee[me];ce[0].initializeIndexed(ee,te,ne,re,de),ce[1].initializeIndexed(ee,te,ne,re,Ee),ce[2].initializeIndexed(ee,te,ne,re,me);var Te=c.clipTriangleAtAxisAlignedThreshold(T,a,pe,_e,ye,R);fe=0,fe>=Te.length||(fe=le[0].initializeFromClipResult(Te,fe,ce),fe>=Te.length||(fe=le[1].initializeFromClipResult(Te,fe,ce),fe>=Te.length||(fe=le[2].initializeFromClipResult(Te,fe,ce),he=c.clipTriangleAtAxisAlignedThreshold(T,i,le[0].getV(),le[1].getV(),le[2].getV(),A),_(F,z,B,b,q,G,he,le,Z),fe<Te.length&&(le[2].clone(le[1]),le[2].initializeFromClipResult(Te,fe,ce),he=c.clipTriangleAtAxisAlignedThreshold(T,i,le[0].getV(),le[1].getV(),le[2].getV(),A),_(F,z,B,b,q,G,he,le,Z)))))}var Re=a?-y:0,Ae=i?-y:0,Se=[],Ne=[],Me=[],Ie=[],ve=Number.MAX_VALUE,Oe=-ve,ge=S;ge.length=0;var xe=o.clone(e.ellipsoid),we=e.childRectangle,Ce=we.north,Pe=we.south,Ue=we.east,De=we.west;for(Ue<De&&(Ue+=l.TWO_PI),H=0;H<F.length;++H)ue=Math.round(F[H]),ue<=d?(Se.push(H),ue=0):ue>=E?(Me.push(H),ue=y):ue=2*ue+Re,F[H]=ue,se=Math.round(z[H]),se<=p?(Ne.push(H),se=0):se>=L?(Ie.push(H),se=y):se=2*se+Ae,z[H]=se,V=l.lerp(Q,$,B[H]/y),V<ve&&(ve=V),V>Oe&&(Oe=V),B[H]=V,N.longitude=l.lerp(De,Ue,ue/y),N.latitude=l.lerp(Pe,Ce,se/y),N.height=V,xe.cartographicToCartesian(N,M),ge.push(M.x),ge.push(M.y),ge.push(M.z);var Le=t.fromVertices(ge,r.ZERO,3,C),Fe=f.fromRectangle(we,ve,Oe,xe,P),ze=new u(xe),Be=ze.computeHorizonCullingPointFromVertices(Le.center,ge,3,Le.center,w),be=Oe-ve,qe=new Uint16Array(F.length+z.length+B.length);for(H=0;H<F.length;++H)qe[H]=F[H];var Ge=F.length;for(H=0;H<z.length;++H)qe[Ge+H]=z[H];for(Ge+=z.length,H=0;H<B.length;++H)qe[Ge+H]=y*(B[H]-ve)/be;var We,Xe=s.createTypedArray(F.length,q);if(Z){var Ve=new Uint8Array(b);n.push(qe.buffer,Xe.buffer,Ve.buffer),We=Ve.buffer}else n.push(qe.buffer,Xe.buffer);return{vertices:qe.buffer,encodedNormals:We,indices:Xe.buffer,minimumHeight:ve,maximumHeight:Oe,westIndices:Se,southIndices:Ne,eastIndices:Me,northIndices:Ie,boundingSphere:Le,orientedBoundingBox:Fe,horizonOcclusionPoint:Be}}function m(){this.vertexBuffer=void 0,this.index=void 0,this.first=void 0,this.second=void 0,this.ratio=void 0}function p(t,n){++F;var a=z[F],i=B[F];return a=e.octDecode(t.first.getNormalX(),t.first.getNormalY(),a),i=e.octDecode(t.second.getNormalX(),t.second.getNormalY(),i),M=r.lerp(a,i,t.ratio,M),r.normalize(M,M),e.octEncode(M,n),--F,n}function _(e,t,n,r,a,o,u,s,c){if(0!==u.length){for(var l=0,f=0;f<u.length;)f=b[l++].initializeFromClipResult(u,f,s);for(var h=0;h<l;++h){var d=b[h];if(d.isIndexed())d.newIndex=o[d.index],d.uBuffer=e,d.vBuffer=t,d.heightBuffer=n,c&&(d.normalBuffer=r);else{var E=d.getKey();if(i(o[E]))d.newIndex=o[E];else{var m=e.length;e.push(d.getU()),t.push(d.getV()),n.push(d.getH()),c&&(r.push(d.getNormalX()),r.push(d.getNormalY())),d.newIndex=m,o[E]=m}}}3===l?(a.push(b[0].newIndex),a.push(b[1].newIndex),a.push(b[2].newIndex)):4===l&&(a.push(b[0].newIndex),a.push(b[1].newIndex),a.push(b[2].newIndex),a.push(b[0].newIndex),a.push(b[2].newIndex),a.push(b[3].newIndex))}}var y=32767,T=y/2|0,R=[],A=[],S=[],N=new a,M=new r,I=[],v=[],O=[],g=[],x=[],w=new r,C=new t,P=new f,U=new n,D=new r;m.prototype.clone=function(e){return i(e)||(e=new m),e.uBuffer=this.uBuffer,e.vBuffer=this.vBuffer,e.heightBuffer=this.heightBuffer,e.normalBuffer=this.normalBuffer,e.index=this.index,e.first=this.first,e.second=this.second,e.ratio=this.ratio,e},m.prototype.initializeIndexed=function(e,t,n,r,a){this.uBuffer=e,this.vBuffer=t,this.heightBuffer=n,this.normalBuffer=r,this.index=a,this.first=void 0,this.second=void 0,this.ratio=void 0},m.prototype.initializeFromClipResult=function(e,t,n){var r=t+1;return e[t]!==-1?n[e[t]].clone(this):(this.vertexBuffer=void 0,this.index=void 0,this.first=n[e[r]],++r,this.second=n[e[r]],++r,this.ratio=e[r],++r),r},m.prototype.getKey=function(){return this.isIndexed()?this.index:JSON.stringify({first:this.first.getKey(),second:this.second.getKey(),ratio:this.ratio})},m.prototype.isIndexed=function(){return i(this.index)},m.prototype.getH=function(){return i(this.index)?this.heightBuffer[this.index]:l.lerp(this.first.getH(),this.second.getH(),this.ratio)},m.prototype.getU=function(){return i(this.index)?this.uBuffer[this.index]:l.lerp(this.first.getU(),this.second.getU(),this.ratio)},m.prototype.getV=function(){return i(this.index)?this.vBuffer[this.index]:l.lerp(this.first.getV(),this.second.getV(),this.ratio)};var L=new n,F=-1,z=[new r,new r],B=[new r,new r];m.prototype.getNormalX=function(){return i(this.index)?this.normalBuffer[2*this.index]:(L=p(this,L),L.x)},m.prototype.getNormalY=function(){return i(this.index)?this.normalBuffer[2*this.index+1]:(L=p(this,L),L.y)};var b=[];return b.push(new m),b.push(new m),b.push(new m),b.push(new m),d(E)})}(); \ No newline at end of file diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Cesium.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Cesium.js index faf79122..0af2bfc1 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Cesium.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Cesium.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -1509,7 +1509,7 @@ define('Core/Credit',[ /** * Returns true if the credits are equal * - * @param {Credit} credits The credit to compare to. + * @param {Credit} credit The credit to compare to. * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise. */ Credit.prototype.equals = function(credit) { @@ -1581,41 +1581,13 @@ define('Core/defaultValue',[ return defaultValue; }); -/*global define*/ -define('Core/isArray',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Tests an object to see if it is an array. - * @exports isArray - * - * @param {Object} value The value to test. - * @returns {Boolean} true if the value is an array, false otherwise. - */ - var isArray = Array.isArray; - if (!defined(isArray)) { - isArray = function(value) { - return Object.prototype.toString.call(value) === '[object Array]'; - }; - } - - return isArray; -}); - /*global define*/ define('Core/Check',[ - './defaultValue', - './defined', - './DeveloperError', - './isArray' + './defined', + './DeveloperError' ], function( - defaultValue, defined, - DeveloperError, - isArray) { + DeveloperError) { 'use strict'; /** @@ -1630,111 +1602,134 @@ define('Core/Check',[ */ Check.typeOf = {}; - /** - * Contains functions for checking numeric conditions such as minimum and maximum values - */ - Check.numeric = {}; - function getUndefinedErrorMessage(name) { - return name + ' was required but undefined.'; + return name + ' is required, actual value was undefined'; } function getFailedTypeErrorMessage(actual, expected, name) { - return 'Expected ' + name + ' to be typeof ' + expected + ', got ' + actual; + return 'Expected ' + name + ' to be typeof ' + expected + ', actual typeof was ' + actual; } /** * Throws if test is not defined * - * @param {*} test The value that is to be checked * @param {String} name The name of the variable being tested + * @param {*} test The value that is to be checked * @exception {DeveloperError} test must be defined */ - Check.defined = function (test, name) { + Check.defined = function (name, test) { if (!defined(test)) { throw new DeveloperError(getUndefinedErrorMessage(name)); } }; /** - * Throws if test is greater than maximum + * Throws if test is not typeof 'function' * - * @param {Number} test The value to test - * @param {Number} maximum The maximum allowed value - * @exception {DeveloperError} test must not be greater than maximum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'function' */ - Check.numeric.maximum = function (test, maximum) { - Check.typeOf.number(test); - Check.typeOf.number(maximum); - if (test > maximum) { - throw new DeveloperError('Expected ' + test + ' to be at most ' + maximum); + Check.typeOf.func = function (name, test) { + if (typeof test !== 'function') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); } }; /** - * Throws if test is less than minimum + * Throws if test is not typeof 'string' * - * @param {Number} test The value to test - * @param {Number} minimum The minimum allowed value - * @exception {DeveloperError} test must not be less than mininum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'string' */ - Check.numeric.minimum = function (test, minimum) { - Check.typeOf.number(test); - Check.typeOf.number(minimum); - if (test < minimum) { - throw new DeveloperError('Expected ' + test + ' to be at least ' + minimum); + Check.typeOf.string = function (name, test) { + if (typeof test !== 'string') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); } }; /** - * Throws if test is not typeof 'function' + * Throws if test is not typeof 'number' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'function' + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'number' */ - Check.typeOf.function = function (test, name) { - if (typeof test !== 'function') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); + Check.typeOf.number = function (name, test) { + if (typeof test !== 'number') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); } }; /** - * Throws if test is not typeof 'string' + * Throws if test is not typeof 'number' and less than limit * + * @param {String} name The name of the variable being tested * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than limit + */ + Check.typeOf.number.lessThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test >= limit) { + throw new DeveloperError('Expected ' + name + ' to be less than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and less than or equal to limit + * * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'string' + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than or equal to limit */ - Check.typeOf.string = function (test, name) { - if (typeof test !== 'string') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); + Check.typeOf.number.lessThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test > limit) { + throw new DeveloperError('Expected ' + name + ' to be less than or equal to ' + limit + ', actual value was ' + test); } }; /** - * Throws if test is not typeof 'number' + * Throws if test is not typeof 'number' and greater than limit * + * @param {String} name The name of the variable being tested * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than limit + */ + Check.typeOf.number.greaterThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test <= limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and greater than or equal to limit + * * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'number' + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than or equal to limit */ - Check.typeOf.number = function (test, name) { - if (typeof test !== 'number') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); + Check.typeOf.number.greaterThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test < limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than or equal to' + limit + ', actual value was ' + test); } }; /** * Throws if test is not typeof 'object' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested + * @param {*} test The value to test * @exception {DeveloperError} test must be typeof 'object' */ - Check.typeOf.object = function (test, name) { + Check.typeOf.object = function (name, test) { if (typeof test !== 'object') { throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'object', name)); } @@ -1743,11 +1738,11 @@ define('Core/Check',[ /** * Throws if test is not typeof 'boolean' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested + * @param {*} test The value to test * @exception {DeveloperError} test must be typeof 'boolean' */ - Check.typeOf.boolean = function (test, name) { + Check.typeOf.bool = function (name, test) { if (typeof test !== 'boolean') { throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'boolean', name)); } @@ -2440,7 +2435,7 @@ define('Core/Math',[ if (!defined(angle)) { throw new DeveloperError('angle is required.'); } - + return CesiumMath.clamp(angle, -1*CesiumMath.PI_OVER_TWO, CesiumMath.PI_OVER_TWO); }; @@ -2450,11 +2445,11 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [<code>-CesiumMath.PI</code>, <code>CesiumMath.PI</code>]. */ - CesiumMath.negativePiToPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.negativePiToPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - return CesiumMath.zeroToTwoPi(x + CesiumMath.PI) - CesiumMath.PI; + return CesiumMath.zeroToTwoPi(angle + CesiumMath.PI) - CesiumMath.PI; }; /** @@ -2463,12 +2458,12 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [0, <code>CesiumMath.TWO_PI</code>]. */ - CesiumMath.zeroToTwoPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.zeroToTwoPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - var mod = CesiumMath.mod(x, CesiumMath.TWO_PI); - if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(x) > CesiumMath.EPSILON14) { + var mod = CesiumMath.mod(angle, CesiumMath.TWO_PI); + if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(angle) > CesiumMath.EPSILON14) { return CesiumMath.TWO_PI; } return mod; @@ -2538,7 +2533,7 @@ define('Core/Math',[ * @example * //Compute 7!, which is equal to 5040 * var computedFactorial = Cesium.Math.factorial(7); - * + * * @see {@link http://en.wikipedia.org/wiki/Factorial|Factorial on Wikipedia} */ CesiumMath.factorial = function(n) { @@ -2822,7 +2817,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.fromSpherical = function(spherical, result) { - Check.typeOf.object(spherical, 'spherical'); + Check.typeOf.object('spherical', spherical); if (!defined(result)) { result = new Cartesian3(); @@ -2906,8 +2901,8 @@ define('Core/Cartesian3',[ * @returns {Number[]} The array that was packed into */ Cartesian3.pack = function(value, array, startingIndex) { - Check.typeOf.object(value, 'value'); - Check.defined(array, 'array'); + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -2927,7 +2922,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.unpack = function(array, startingIndex, result) { - Check.defined(array, 'array'); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -2948,7 +2943,7 @@ define('Core/Cartesian3',[ * @returns {Number[]} The packed array. */ Cartesian3.packArray = function(array, result) { - Check.defined(array, 'array'); + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -2971,8 +2966,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3[]} The unpacked array. */ Cartesian3.unpackArray = function(array, result) { - Check.defined(array, 'array'); - Check.numeric.minimum(array.length, 3); + Check.defined('array', array); + Check.typeOf.number.greaterThanOrEquals('array.length', array.length, 3); if (array.length % 3 !== 0) { throw new DeveloperError('array length must be a multiple of 3.'); } @@ -3018,7 +3013,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the maximum component. */ Cartesian3.maximumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z); }; @@ -3030,7 +3025,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the minimum component. */ Cartesian3.minimumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z); }; @@ -3044,9 +3039,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the minimum components. */ Cartesian3.minimumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -3064,9 +3059,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the maximum components. */ Cartesian3.maximumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -3081,7 +3076,7 @@ define('Core/Cartesian3',[ * @returns {Number} The squared magnitude. */ Cartesian3.magnitudeSquared = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z; }; @@ -3110,8 +3105,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distance(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(2.0, 0.0, 0.0)); */ Cartesian3.distance = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitude(distanceScratch); @@ -3130,8 +3125,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distanceSquared(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(3.0, 0.0, 0.0)); */ Cartesian3.distanceSquared = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitudeSquared(distanceScratch); @@ -3145,8 +3140,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.normalize = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian3.magnitude(cartesian); @@ -3169,8 +3164,8 @@ define('Core/Cartesian3',[ * @returns {Number} The dot product. */ Cartesian3.dot = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z; }; @@ -3184,9 +3179,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyComponents = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -3228,9 +3223,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.add = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -3247,9 +3242,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.subtract = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -3266,9 +3261,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -3285,9 +3280,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.divideByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -3303,8 +3298,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.negate = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -3320,8 +3315,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.abs = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -3340,10 +3335,10 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.lerp = function(start, end, t, result) { - Check.typeOf.object(start, 'start'); - Check.typeOf.object(end, 'end'); - Check.typeOf.number(t, 't'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian3.multiplyByScalar(end, t, lerpScratch); result = Cartesian3.multiplyByScalar(start, 1.0 - t, result); @@ -3360,8 +3355,8 @@ define('Core/Cartesian3',[ * @returns {Number} The angle between the Cartesians. */ Cartesian3.angleBetween = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.normalize(left, angleBetweenScratch); Cartesian3.normalize(right, angleBetweenScratch2); @@ -3379,8 +3374,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The most orthogonal axis. */ Cartesian3.mostOrthogonalAxis = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian3.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian3.abs(f, f); @@ -3457,9 +3452,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The cross product. */ Cartesian3.cross = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var leftX = left.x; var leftY = left.y; @@ -3492,8 +3487,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromDegrees(-115.0, 37.0); */ Cartesian3.fromDegrees = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); longitude = CesiumMath.toRadians(longitude); latitude = CesiumMath.toRadians(latitude); @@ -3518,8 +3513,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromRadians(-2.007, 0.645); */ Cartesian3.fromRadians = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); height = defaultValue(height, 0.0); var radiiSquared = defined(ellipsoid) ? ellipsoid.radiiSquared : wgs84RadiiSquared; @@ -3553,7 +3548,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArray([-115.0, 37.0, -107.0, 33.0]); */ Cartesian3.fromDegreesArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -3587,7 +3582,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArray([-2.007, 0.645, -1.867, .575]); */ Cartesian3.fromRadiansArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -3621,7 +3616,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArrayHeights([-115.0, 37.0, 100000.0, -107.0, 33.0, 150000.0]); */ Cartesian3.fromDegreesArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -3656,7 +3651,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArrayHeights([-2.007, 0.645, 100000.0, -1.867, .575, 150000.0]); */ Cartesian3.fromRadiansArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -4368,7 +4363,9 @@ define('Core/Ellipsoid',[ /** * Computes an Ellipsoid from a Cartesian specifying the radii in x, y, and z directions. * - * @param {Cartesian3} [radii=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Cartesian3} [cartesian=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new + * instance should be created. * @returns {Ellipsoid} A new Ellipsoid instance. * * @exception {DeveloperError} All radii components must be greater than or equal to zero. @@ -4979,12 +4976,14 @@ define('Core/Event',[ /*global define*/ define('Core/Cartesian2',[ + './Check', './defaultValue', './defined', './DeveloperError', './freezeObject', './Math' ], function( + Check, defaultValue, defined, DeveloperError, @@ -5096,12 +5095,8 @@ define('Core/Cartesian2',[ * @returns {Number[]} The array that was packed into */ Cartesian2.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5120,9 +5115,7 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided. */ Cartesian2.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5142,9 +5135,7 @@ define('Core/Cartesian2',[ * @returns {Number[]} The packed array. */ Cartesian2.packArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -5167,9 +5158,7 @@ define('Core/Cartesian2',[ * @returns {Cartesian2[]} The unpacked array. */ Cartesian2.unpackArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -5212,9 +5201,7 @@ define('Core/Cartesian2',[ * @returns {Number} The value of the maximum component. */ Cartesian2.maximumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y); }; @@ -5226,9 +5213,7 @@ define('Core/Cartesian2',[ * @returns {Number} The value of the minimum component. */ Cartesian2.minimumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y); }; @@ -5242,15 +5227,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} A cartesian with the minimum components. */ Cartesian2.minimumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); @@ -5268,15 +5247,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} A cartesian with the maximum components. */ Cartesian2.maximumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -5290,9 +5263,7 @@ define('Core/Cartesian2',[ * @returns {Number} The squared magnitude. */ Cartesian2.magnitudeSquared = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y; }; @@ -5358,12 +5329,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.normalize = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian2.magnitude(cartesian); @@ -5385,12 +5352,8 @@ define('Core/Cartesian2',[ * @returns {Number} The dot product. */ Cartesian2.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y; }; @@ -5404,15 +5367,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.multiplyComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -5428,15 +5385,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.divideComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x / right.x; result.y = left.y / right.y; @@ -5452,15 +5403,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -5476,15 +5421,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -5500,15 +5439,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.multiplyByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -5524,15 +5457,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.divideByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -5547,12 +5474,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.negate = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -5567,12 +5490,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.abs = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -5590,18 +5509,10 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian2.multiplyByScalar(end, t, lerpScratch); result = Cartesian2.multiplyByScalar(start, 1.0 - t, result); @@ -5618,12 +5529,8 @@ define('Core/Cartesian2',[ * @returns {Number} The angle between the Cartesians. */ Cartesian2.angleBetween = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian2.normalize(left, angleBetweenScratch); Cartesian2.normalize(right, angleBetweenScratch2); @@ -5639,12 +5546,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The most orthogonal axis. */ Cartesian2.mostOrthogonalAxis = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian2.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian2.abs(f, f); @@ -5893,6 +5796,7 @@ define('Core/GeographicProjection',[ /*global define*/ define('Core/Rectangle',[ './Cartographic', + './Check', './defaultValue', './defined', './defineProperties', @@ -5902,6 +5806,7 @@ define('Core/Rectangle',[ './Math' ], function( Cartographic, + Check, defaultValue, defined, defineProperties, @@ -5998,13 +5903,8 @@ define('Core/Rectangle',[ * @returns {Number[]} The array that was packed into */ Rectangle.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -6025,9 +5925,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -6048,9 +5946,7 @@ define('Core/Rectangle',[ * @returns {Number} The width. */ Rectangle.computeWidth = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; if (east < west) { @@ -6065,9 +5961,7 @@ define('Core/Rectangle',[ * @returns {Number} The height. */ Rectangle.computeHeight = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); return rectangle.north - rectangle.south; }; @@ -6102,6 +5996,32 @@ define('Core/Rectangle',[ return result; }; + /** + * Creates an rectangle given the boundary longitude and latitude in radians. + * + * @param {Number} [west=0.0] The westernmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [south=0.0] The southernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Number} [east=0.0] The easternmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [north=0.0] The northernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Rectangle} [result] The object onto which to store the result, or undefined if a new instance should be created. + * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. + * + * @example + * var rectangle = Cesium.Rectangle.fromRadians(0.0, Math.PI/4, Math.PI/8, 3*Math.PI/4); + */ + Rectangle.fromRadians = function(west, south, east, north, result) { + if (!defined(result)) { + return new Rectangle(west, south, east, north); + } + + result.west = defaultValue(west, 0.0); + result.south = defaultValue(south, 0.0); + result.east = defaultValue(east, 0.0); + result.north = defaultValue(north, 0.0); + + return result; + }; + /** * Creates the smallest possible Rectangle that encloses all positions in the provided array. * @@ -6110,9 +6030,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartographicArray = function(cartographics, result) { - if (!defined(cartographics)) { - throw new DeveloperError('cartographics is required.'); - } + Check.defined('cartographics', cartographics); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -6165,9 +6083,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartesianArray = function(cartesians, ellipsoid, result) { - if (!defined(cartesians)) { - throw new DeveloperError('cartesians is required.'); - } + Check.defined('cartesians', cartesians); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -6283,9 +6199,7 @@ define('Core/Rectangle',[ * @returns {Boolean} <code>true</code> if the Rectangles are within the provided epsilon, <code>false</code> otherwise. */ Rectangle.prototype.equalsEpsilon = function(other, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon is required and must be a number.'); - } + Check.typeOf.number('epsilon', epsilon); return defined(other) && (Math.abs(this.west - other.west) <= epsilon) && @@ -6305,45 +6219,23 @@ define('Core/Rectangle',[ * @exception {DeveloperError} <code>west</code> must be in the interval [<code>-Pi</code>, <code>Pi</code>]. */ Rectangle.validate = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var north = rectangle.north; - if (typeof north !== 'number') { - throw new DeveloperError('north is required to be a number.'); - } - - if (north < -CesiumMath.PI_OVER_TWO || north > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('north must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('north', north, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('north', north, CesiumMath.PI_OVER_TWO); var south = rectangle.south; - if (typeof south !== 'number') { - throw new DeveloperError('south is required to be a number.'); - } - - if (south < -CesiumMath.PI_OVER_TWO || south > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('south must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('south', south, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('south', south, CesiumMath.PI_OVER_TWO); var west = rectangle.west; - if (typeof west !== 'number') { - throw new DeveloperError('west is required to be a number.'); - } - - if (west < -Math.PI || west > Math.PI) { - throw new DeveloperError('west must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('west', west, -Math.PI); + Check.typeOf.number.lessThanOrEquals('west', west, Math.PI); var east = rectangle.east; - if (typeof east !== 'number') { - throw new DeveloperError('east is required to be a number.'); - } - - if (east < -Math.PI || east > Math.PI) { - throw new DeveloperError('east must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('east', east, -Math.PI); + Check.typeOf.number.lessThanOrEquals('east', east, Math.PI); }; /** @@ -6354,9 +6246,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.south); @@ -6375,9 +6265,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.north); @@ -6396,9 +6284,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.north); @@ -6417,9 +6303,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.south); @@ -6438,9 +6322,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.center = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; @@ -6475,12 +6357,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.intersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var rectangleEast = rectangle.east; var rectangleWest = rectangle.west; @@ -6536,12 +6414,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.simpleIntersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var west = Math.max(rectangle.west, otherRectangle.west); var south = Math.max(rectangle.south, otherRectangle.south); @@ -6572,12 +6446,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.union = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); if (!defined(result)) { result = new Rectangle(); @@ -6621,12 +6491,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.expand = function(rectangle, cartographic, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); if (!defined(result)) { result = new Rectangle(); @@ -6648,12 +6514,8 @@ define('Core/Rectangle',[ * @returns {Boolean} true if the provided cartographic is inside the rectangle, false otherwise. */ Rectangle.contains = function(rectangle, cartographic) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); var longitude = cartographic.longitude; var latitude = cartographic.latitude; @@ -6686,9 +6548,7 @@ define('Core/Rectangle',[ * @returns {Cartesian3[]} The modified result parameter or a new Array of Cartesians instances if none was provided. */ Rectangle.subsample = function(rectangle, ellipsoid, surfaceHeight, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84); surfaceHeight = defaultValue(surfaceHeight, 0.0); @@ -7022,6 +6882,8 @@ define('Core/getImagePixels',[ * @exports getImagePixels * * @param {Image} image The image to extract pixels from. + * @param {Number} width The width of the image. If not defined, then image.width is assigned. + * @param {Number} height The height of the image. If not defined, then image.height is assigned. * @returns {CanvasPixelArray} The pixels of the image. */ function getImagePixels(image, width, height) { @@ -7368,6 +7230,7 @@ define('Core/Interval',[ /*global define*/ define('Core/Matrix3',[ './Cartesian3', + './Check', './defaultValue', './defined', './defineProperties', @@ -7376,6 +7239,7 @@ define('Core/Matrix3',[ './Math' ], function( Cartesian3, + Check, defaultValue, defined, defineProperties, @@ -7438,13 +7302,8 @@ define('Core/Matrix3',[ * @returns {Number[]} The array that was packed into */ Matrix3.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -7470,9 +7329,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. */ Matrix3.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -7499,24 +7356,24 @@ define('Core/Matrix3',[ * @param {Matrix3} [result] The object onto which to store the result. * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. (Returns undefined if matrix is undefined) */ - Matrix3.clone = function(values, result) { - if (!defined(values)) { + Matrix3.clone = function(matrix, result) { + if (!defined(matrix)) { return undefined; } if (!defined(result)) { - return new Matrix3(values[0], values[3], values[6], - values[1], values[4], values[7], - values[2], values[5], values[8]); + return new Matrix3(matrix[0], matrix[3], matrix[6], + matrix[1], matrix[4], matrix[7], + matrix[2], matrix[5], matrix[8]); } - result[0] = values[0]; - result[1] = values[1]; - result[2] = values[2]; - result[3] = values[3]; - result[4] = values[4]; - result[5] = values[5]; - result[6] = values[6]; - result[7] = values[7]; - result[8] = values[8]; + result[0] = matrix[0]; + result[1] = matrix[1]; + result[2] = matrix[2]; + result[3] = matrix[3]; + result[4] = matrix[4]; + result[5] = matrix[5]; + result[6] = matrix[6]; + result[7] = matrix[7]; + result[8] = matrix[8]; return result; }; @@ -7542,9 +7399,7 @@ define('Core/Matrix3',[ * var m2 = Cesium.Matrix3.fromArray(v2, 2); */ Matrix3.fromArray = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -7572,9 +7427,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values parameter is required'); - } + Check.defined('values', values); return Matrix3.clone(values, result); }; @@ -7588,9 +7441,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix3(values[0], values[1], values[2], @@ -7617,9 +7468,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this quaternion. */ Matrix3.fromQuaternion = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); var x2 = quaternion.x * quaternion.x; var xy = quaternion.x * quaternion.y; @@ -7669,10 +7518,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this headingPitchRoll. */ Matrix3.fromHeadingPitchRoll = function(headingPitchRoll, result) { - if (!defined(headingPitchRoll)) { - throw new DeveloperError('headingPitchRoll is required'); - } - var cosTheta = Math.cos(-headingPitchRoll.pitch); + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + + var cosTheta = Math.cos(-headingPitchRoll.pitch); var cosPsi = Math.cos(-headingPitchRoll.heading); var cosPhi = Math.cos(headingPitchRoll.roll); var sinTheta = Math.sin(-headingPitchRoll.pitch); @@ -7723,9 +7571,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix3( @@ -7761,9 +7607,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromUniformScale(2.0); */ Matrix3.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix3( @@ -7787,7 +7631,7 @@ define('Core/Matrix3',[ /** * Computes a Matrix3 instance representing the cross product equivalent matrix of a Cartesian3 vector. * - * @param {Cartesian3} the vector on the left hand side of the cross product operation. + * @param {Cartesian3} vector the vector on the left hand side of the cross product operation. * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created. * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. * @@ -7799,9 +7643,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromCrossProduct(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromCrossProduct = function(vector, result) { - if (!defined(vector)) { - throw new DeveloperError('vector is required.'); - } + Check.typeOf.object('vector', vector); if (!defined(result)) { return new Matrix3( @@ -7836,9 +7678,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationX = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -7877,9 +7717,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationY = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -7918,9 +7756,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationZ = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -7954,9 +7790,7 @@ define('Core/Matrix3',[ * @returns {Number[]} The modified Array parameter or a new Array instance if one was not provided. */ Matrix3.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5], matrix[6], matrix[7], matrix[8]]; @@ -7990,12 +7824,10 @@ define('Core/Matrix3',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix3.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 2) { - throw new DeveloperError('row must be 0, 1, or 2.'); - } - if (typeof column !== 'number' || column < 0 || column > 2) { - throw new DeveloperError('column must be 0, 1, or 2.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 2); + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 2); return column * 3 + row; }; @@ -8011,16 +7843,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var startIndex = index * 3; var x = matrix[startIndex]; @@ -8045,18 +7871,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); var startIndex = index * 3; @@ -8077,15 +7896,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 3]; @@ -8109,18 +7923,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); result[index] = cartesian.x; @@ -8139,12 +7946,8 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[3], matrix[4], matrix[5], scratchColumn)); @@ -8175,15 +7978,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var column0Row0 = left[0] * right[0] + left[3] * right[1] + left[6] * right[2]; var column0Row1 = left[1] * right[0] + left[4] * right[1] + left[7] * right[2]; @@ -8218,15 +8015,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -8249,15 +8040,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -8280,15 +8065,9 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8313,15 +8092,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -8352,15 +8125,9 @@ define('Core/Matrix3',[ * @see Matrix3.multiplyByUniformScale */ Matrix3.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); result[0] = matrix[0] * scale.x; result[1] = matrix[1] * scale.x; @@ -8382,12 +8149,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -8409,12 +8172,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var column0Row0 = matrix[0]; var column0Row1 = matrix[3]; @@ -8554,9 +8313,7 @@ define('Core/Matrix3',[ * var c = Cesium.Cartesian3.multiplyByScalar(v, lambda, new Cesium.Cartesian3()); // equal to Cesium.Matrix3.multiplyByVector(a, v) */ Matrix3.computeEigenDecomposition = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); // This routine was created based upon Matrix Computations, 3rd ed., by Golub and Van Loan, // section 8.4.3 The Classical Jacobi Algorithm @@ -8600,12 +8357,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -8627,9 +8380,7 @@ define('Core/Matrix3',[ * @returns {Number} The value of the determinant of the matrix. */ Matrix3.determinant = function(matrix) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); var m11 = matrix[0]; var m21 = matrix[3]; @@ -8654,12 +8405,8 @@ define('Core/Matrix3',[ * @exception {DeveloperError} matrix is not invertible. */ Matrix3.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var m11 = matrix[0]; var m21 = matrix[1]; @@ -8725,9 +8472,7 @@ define('Core/Matrix3',[ * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. */ Matrix3.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -8915,12 +8660,14 @@ define('Core/Matrix3',[ /*global define*/ define('Core/Cartesian4',[ + './Check', './defaultValue', './defined', './DeveloperError', './freezeObject', './Math' ], function( + Check, defaultValue, defined, DeveloperError, @@ -9003,9 +8750,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.fromColor = function(color, result) { - if (!defined(color)) { - throw new DeveloperError('color is required'); - } + Check.typeOf.object('color', color); if (!defined(result)) { return new Cartesian4(color.red, color.green, color.blue, color.alpha); } @@ -9057,12 +8802,8 @@ define('Core/Cartesian4',[ * @returns {Number[]} The array that was packed into */ Cartesian4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -9083,9 +8824,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -9107,9 +8846,7 @@ define('Core/Cartesian4',[ * @returns {Number[]} The packed array. */ Cartesian4.packArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -9132,9 +8869,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4[]} The unpacked array. */ Cartesian4.unpackArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -9177,9 +8912,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the maximum component. */ Cartesian4.maximumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -9191,9 +8924,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the minimum component. */ Cartesian4.minimumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -9207,15 +8938,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the minimum components. */ Cartesian4.minimumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -9234,15 +8959,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the maximum components. */ Cartesian4.maximumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -9259,9 +8978,7 @@ define('Core/Cartesian4',[ * @returns {Number} The squared magnitude. */ Cartesian4.magnitudeSquared = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z + cartesian.w * cartesian.w; }; @@ -9292,9 +9009,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(2.0, 0.0, 0.0, 0.0)); */ Cartesian4.distance = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitude(distanceScratch); @@ -9315,9 +9031,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(3.0, 0.0, 0.0, 0.0)); */ Cartesian4.distanceSquared = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitudeSquared(distanceScratch); @@ -9331,12 +9046,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.normalize = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian4.magnitude(cartesian); @@ -9360,12 +9071,8 @@ define('Core/Cartesian4',[ * @returns {Number} The dot product. */ Cartesian4.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w; }; @@ -9379,15 +9086,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -9405,15 +9106,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x / right.x; result.y = left.y / right.y; @@ -9431,15 +9126,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -9457,15 +9146,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -9483,15 +9166,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -9509,15 +9186,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -9534,12 +9205,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.negate = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -9556,12 +9223,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.abs = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -9581,18 +9244,10 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian4.multiplyByScalar(end, t, lerpScratch); result = Cartesian4.multiplyByScalar(start, 1.0 - t, result); @@ -9608,12 +9263,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The most orthogonal axis. */ Cartesian4.mostOrthogonalAxis = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian4.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian4.abs(f, f); @@ -9858,6 +9509,7 @@ define('Core/RuntimeError',[ define('Core/Matrix4',[ './Cartesian3', './Cartesian4', + './Check', './defaultValue', './defined', './defineProperties', @@ -9869,6 +9521,7 @@ define('Core/Matrix4',[ ], function( Cartesian3, Cartesian4, + Check, defaultValue, defined, defineProperties, @@ -9959,13 +9612,8 @@ define('Core/Matrix4',[ * @returns {Number[]} The array that was packed into */ Matrix4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -9998,9 +9646,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if one was not provided. */ Matrix4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -10096,9 +9742,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required'); - } + Check.defined('values', values); return Matrix4.clone(values, result); }; @@ -10112,9 +9756,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix4(values[0], values[1], values[2], values[3], @@ -10151,9 +9793,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRotationTranslation = function(rotation, translation, result) { - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } + Check.typeOf.object('rotation', rotation); translation = defaultValue(translation, Cartesian3.ZERO); @@ -10201,15 +9841,9 @@ define('Core/Matrix4',[ * result); */ Matrix4.fromTranslationQuaternionRotationScale = function(translation, rotation, scale, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('translation', translation); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('scale', scale); if (!defined(result)) { result = new Matrix4(); @@ -10270,9 +9904,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromTranslationRotationScale = function(translationRotationScale, result) { - if (!defined(translationRotationScale)) { - throw new DeveloperError('translationRotationScale is required.'); - } + Check.typeOf.object('translationRotationScale', translationRotationScale); return Matrix4.fromTranslationQuaternionRotationScale(translationRotationScale.translation, translationRotationScale.rotation, translationRotationScale.scale, result); }; @@ -10287,9 +9919,7 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByTranslation */ Matrix4.fromTranslation = function(translation, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } + Check.typeOf.object('translation', translation); return Matrix4.fromRotationTranslation(Matrix3.IDENTITY, translation, result); }; @@ -10310,9 +9940,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix4.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix4( @@ -10357,9 +9985,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromUniformScale(2.0); */ Matrix4.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix4(scale, 0.0, 0.0, 0.0, @@ -10399,23 +10025,15 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromCamera = function(camera, result) { - if (!defined(camera)) { - throw new DeveloperError('camera is required.'); - } + Check.typeOf.object('camera', camera); var position = camera.position; var direction = camera.direction; var up = camera.up; - if (!defined(position)) { - throw new DeveloperError('camera.position is required.'); - } - if (!defined(direction)) { - throw new DeveloperError('camera.direction is required.'); - } - if (!defined(up)) { - throw new DeveloperError('camera.up is required.'); - } + Check.typeOf.object('camera.position', position); + Check.typeOf.object('camera.direction', direction); + Check.typeOf.object('camera.up', up); Cartesian3.normalize(direction, fromCameraF); Cartesian3.normalize(Cartesian3.cross(fromCameraF, up, fromCameraR), fromCameraR); @@ -10494,21 +10112,11 @@ define('Core/Matrix4',[ * @exception {DeveloperError} far must be greater than zero. */ Matrix4.computePerspectiveFieldOfView = function(fovY, aspectRatio, near, far, result) { - if (fovY <= 0.0 || fovY > Math.PI) { - throw new DeveloperError('fovY must be in (0, PI].'); - } - if (aspectRatio <= 0.0) { - throw new DeveloperError('aspectRatio must be greater than zero.'); - } - if (near <= 0.0) { - throw new DeveloperError('near must be greater than zero.'); - } - if (far <= 0.0) { - throw new DeveloperError('far must be greater than zero.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThan('fovY', fovY, 0.0); + Check.typeOf.number.lessThan('fovY', fovY, Math.PI); + Check.typeOf.number.greaterThan('near', near, 0.0); + Check.typeOf.number.greaterThan('far', far, 0.0); + Check.typeOf.object('result', result); var bottom = Math.tan(fovY * 0.5); @@ -10549,27 +10157,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeOrthographicOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var a = 1.0 / (right - left); var b = 1.0 / (top - bottom); @@ -10614,27 +10208,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computePerspectiveOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -10675,24 +10255,12 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeInfinitePerspectiveOffCenter = function(left, right, bottom, top, near, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -10740,9 +10308,7 @@ define('Core/Matrix4',[ * }, 0.0, 1.0, new Cesium.Matrix4()); */ Matrix4.computeViewportTransformation = function(viewport, nearDepthRange, farDepthRange, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); viewport = defaultValue(viewport, defaultValue.EMPTY_OBJECT); var x = defaultValue(viewport.x, 0.0); @@ -10794,21 +10360,11 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeView = function(position, direction, up, right, result) { - if (!defined(position)) { - throw new DeveloperError('position is required'); - } - if (!defined(direction)) { - throw new DeveloperError('direction is required'); - } - if (!defined(up)) { - throw new DeveloperError('up is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); + Check.typeOf.object('up', up); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = right.x; result[1] = up.x; @@ -10849,9 +10405,7 @@ define('Core/Matrix4',[ * //creates a = [10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0] */ Matrix4.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], @@ -10895,12 +10449,11 @@ define('Core/Matrix4',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix4.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 3) { - throw new DeveloperError('row must be 0, 1, 2, or 3.'); - } - if (typeof column !== 'number' || column < 0 || column > 3) { - throw new DeveloperError('column must be 0, 1, 2, or 3.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 3); + + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 3); return column * 4 + row; }; @@ -10933,16 +10486,12 @@ define('Core/Matrix4',[ * // a.x = 12.0; a.y = 16.0; a.z = 20.0; a.w = 24.0; */ Matrix4.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var startIndex = index * 4; var x = matrix[startIndex]; @@ -10984,18 +10533,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 96.0, 25.0] */ Matrix4.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); var startIndex = index * 4; @@ -11016,15 +10560,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.setTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -11077,16 +10615,12 @@ define('Core/Matrix4',[ * // a.x = 18.0; a.y = 19.0; a.z = 20.0; a.w = 21.0; */ Matrix4.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 4]; @@ -11127,18 +10661,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 24.0, 25.0] */ Matrix4.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); result[index] = cartesian.x; @@ -11158,12 +10687,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter */ Matrix4.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[4], matrix[5], matrix[6], scratchColumn)); @@ -11195,15 +10720,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -11287,15 +10806,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -11325,15 +10838,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -11374,15 +10881,9 @@ define('Core/Matrix4',[ * var m3 = Cesium.Matrix4.multiplyTransformation(m1, m2, new Cesium.Matrix4()); */ Matrix4.multiplyTransformation = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -11460,15 +10961,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByMatrix3(m, rotation, m); */ Matrix4.multiplyByMatrix3 = function(matrix, rotation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('result', result); var left0 = matrix[0]; var left1 = matrix[1]; @@ -11536,15 +11031,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByTranslation(m, position, m); */ Matrix4.multiplyByTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); var x = translation.x; var y = translation.y; @@ -11596,15 +11085,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByScale */ Matrix4.multiplyByUniformScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scale', scale); + Check.typeOf.object('result', result); uniformScaleScratch.x = scale; uniformScaleScratch.y = scale; @@ -11633,15 +11116,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByUniformScale */ Matrix4.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); var scaleX = scale.x; var scaleY = scale.y; @@ -11680,15 +11157,9 @@ define('Core/Matrix4',[ * @returns {Cartesian4} The modified result parameter. */ Matrix4.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -11724,15 +11195,9 @@ define('Core/Matrix4',[ * // Cesium.Matrix4.multiplyByVector(matrix, new Cesium.Cartesian4(p.x, p.y, p.z, 0.0), result); */ Matrix4.multiplyByPointAsVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -11762,16 +11227,9 @@ define('Core/Matrix4',[ * var result = Cesium.Matrix4.multiplyByPoint(matrix, p, new Cesium.Cartesian3()); */ Matrix4.multiplyByPoint = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -11811,15 +11269,9 @@ define('Core/Matrix4',[ * // [-44.0, -46.0, -48.0, -50.0] */ Matrix4.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -11863,12 +11315,8 @@ define('Core/Matrix4',[ * // [-22.0, -23.0, -24.0, -25.0] */ Matrix4.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -11912,12 +11360,8 @@ define('Core/Matrix4',[ * // [13.0, 17.0, 21.0, 25.0] */ Matrix4.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var matrix1 = matrix[1]; var matrix2 = matrix[2]; @@ -11953,12 +11397,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -12072,9 +11512,7 @@ define('Core/Matrix4',[ * //Prints "Difference between both the matrices is not less than 0.1" on the console */ Matrix4.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -12105,12 +11543,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter. */ Matrix4.getTranslation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = matrix[12]; result.y = matrix[13]; @@ -12141,12 +11575,8 @@ define('Core/Matrix4',[ * // [12.0, 16.0, 20.0] */ Matrix4.getRotation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -12178,12 +11608,8 @@ define('Core/Matrix4',[ * @exception {RuntimeError} matrix is not invertible because its determinate is zero. */ Matrix4.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); // Special case for a zero scale matrix that can occur, for example, // when a model's node has a [0, 0, 0] scale. @@ -12321,12 +11747,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.inverseTransformation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); //This function is an optimized version of the below 4 lines. //var rT = Matrix3.transpose(Matrix4.getRotation(matrix)); @@ -12611,9 +12033,9 @@ define('Core/Matrix4',[ define('Core/BoundingSphere',[ './Cartesian3', './Cartographic', + './Check', './defaultValue', './defined', - './DeveloperError', './Ellipsoid', './GeographicProjection', './Intersect', @@ -12624,9 +12046,9 @@ define('Core/BoundingSphere',[ ], function( Cartesian3, Cartographic, + Check, defaultValue, defined, - DeveloperError, Ellipsoid, GeographicProjection, Intersect, @@ -12956,9 +12378,7 @@ define('Core/BoundingSphere',[ stride = defaultValue(stride, 3); - if (stride < 3) { - throw new DeveloperError('stride must be 3 or greater.'); - } + Check.typeOf.number.greaterThanOrEquals('stride', stride, 3); var currentPos = fromPointsCurrentPos; currentPos.x = positions[0] + center.x; @@ -13262,9 +12682,8 @@ define('Core/BoundingSphere',[ * var sphere = Cesium.BoundingSphere.fromCornerPoints(new Cesium.Cartesian3(-0.5, -0.5, -0.5), new Cesium.Cartesian3(0.5, 0.5, 0.5)); */ BoundingSphere.fromCornerPoints = function(corner, oppositeCorner, result) { - if (!defined(corner) || !defined(oppositeCorner)) { - throw new DeveloperError('corner and oppositeCorner are required.'); - } + Check.typeOf.object('corner', corner); + Check.typeOf.object('oppositeCorner', oppositeCorner); if (!defined(result)) { result = new BoundingSphere(); @@ -13288,9 +12707,7 @@ define('Core/BoundingSphere',[ * var boundingSphere = Cesium.BoundingSphere.fromEllipsoid(ellipsoid); */ BoundingSphere.fromEllipsoid = function(ellipsoid, result) { - if (!defined(ellipsoid)) { - throw new DeveloperError('ellipsoid is required.'); - } + Check.typeOf.object('ellipsoid', ellipsoid); if (!defined(result)) { result = new BoundingSphere(); @@ -13416,13 +12833,8 @@ define('Core/BoundingSphere',[ * @returns {Number[]} The array that was packed into */ BoundingSphere.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -13444,9 +12856,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if one was not provided. */ BoundingSphere.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -13473,13 +12883,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.union = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); if (!defined(result)) { result = new BoundingSphere(); @@ -13528,13 +12933,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.expand = function(sphere, point, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(point)) { - throw new DeveloperError('point is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('point', point); result = BoundingSphere.clone(sphere, result); @@ -13557,13 +12957,8 @@ define('Core/BoundingSphere',[ * intersects the plane. */ BoundingSphere.intersectPlane = function(sphere, plane) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(plane)) { - throw new DeveloperError('plane is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('plane', plane); var center = sphere.center; var radius = sphere.radius; @@ -13589,13 +12984,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.transform = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -13623,12 +13013,8 @@ define('Core/BoundingSphere',[ * }); */ BoundingSphere.distanceSquaredTo = function(sphere, cartesian) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('cartesian', cartesian); var diff = Cartesian3.subtract(sphere.center, cartesian, distanceSquaredToScratch); return Cartesian3.magnitudeSquared(diff) - sphere.radius * sphere.radius; @@ -13650,13 +13036,8 @@ define('Core/BoundingSphere',[ * var newBoundingSphere = Cesium.BoundingSphere.transformWithoutScale(boundingSphere, modelMatrix); */ BoundingSphere.transformWithoutScale = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -13683,17 +13064,9 @@ define('Core/BoundingSphere',[ * @returns {Interval} The nearest and farthest distances on the bounding sphere from position in direction. */ BoundingSphere.computePlaneDistances = function(sphere, position, direction, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(position)) { - throw new DeveloperError('position is required.'); - } - - if (!defined(direction)) { - throw new DeveloperError('direction is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); if (!defined(result)) { result = new Interval(); @@ -13728,9 +13101,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.projectTo2D = function(sphere, projection, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } + Check.typeOf.object('sphere', sphere); projection = defaultValue(projection, projectTo2DProjection); @@ -13825,12 +13196,8 @@ define('Core/BoundingSphere',[ * @returns {Boolean} <code>true</code> if the sphere is not visible; otherwise <code>false</code>. */ BoundingSphere.isOccluded = function(sphere, occluder) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(occluder)) { - throw new DeveloperError('occluder is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('occluder', occluder); return !occluder.isBoundingSphereVisible(sphere); }; @@ -15018,6 +14385,7 @@ define('Core/IntersectionTests',[ './defaultValue', './defined', './DeveloperError', + './Interval', './Math', './Matrix3', './QuadraticRealPolynomial', @@ -15029,6 +14397,7 @@ define('Core/IntersectionTests',[ defaultValue, defined, DeveloperError, + Interval, CesiumMath, Matrix3, QuadraticRealPolynomial, @@ -15300,7 +14669,7 @@ define('Core/IntersectionTests',[ function raySphere(ray, sphere, result) { if (!defined(result)) { - result = {}; + result = new Interval(); } var origin = ray.origin; @@ -15331,8 +14700,8 @@ define('Core/IntersectionTests',[ * * @param {Ray} ray The ray. * @param {BoundingSphere} sphere The sphere. - * @param {Object} [result] The result onto which to store the result. - * @returns {Object} An object with the first (<code>start</code>) and the second (<code>stop</code>) intersection scalars for points along the ray or undefined if there are no intersections. + * @param {Interval} [result] The result onto which to store the result. + * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections. */ IntersectionTests.raySphere = function(ray, sphere, result) { if (!defined(ray)) { @@ -15360,8 +14729,8 @@ define('Core/IntersectionTests',[ * @param {Cartesian3} p0 An end point of the line segment. * @param {Cartesian3} p1 The other end point of the line segment. * @param {BoundingSphere} sphere The sphere. - * @param {Object} [result] The result onto which to store the result. - * @returns {Object} An object with the first (<code>start</code>) and the second (<code>stop</code>) intersection scalars for points along the line segment or undefined if there are no intersections. + * @param {Interval} [result] The result onto which to store the result. + * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections. */ IntersectionTests.lineSegmentSphere = function(p0, p1, sphere, result) { if (!defined(p0)) { @@ -15399,7 +14768,7 @@ define('Core/IntersectionTests',[ * * @param {Ray} ray The ray. * @param {Ellipsoid} ellipsoid The ellipsoid. - * @returns {Object} An object with the first (<code>start</code>) and the second (<code>stop</code>) intersection scalars for points along the ray or undefined if there are no intersections. + * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections. */ IntersectionTests.rayEllipsoid = function(ray, ellipsoid) { if (!defined(ray)) { @@ -15441,10 +14810,7 @@ define('Core/IntersectionTests',[ var root0 = temp / w2; var root1 = difference / temp; if (root0 < root1) { - return { - start : root0, - stop : root1 - }; + return new Interval(root0, root1); } return { @@ -15454,10 +14820,7 @@ define('Core/IntersectionTests',[ } else { // qw2 == product. Repeated roots (2 intersections). var root = Math.sqrt(difference / w2); - return { - start : root, - stop : root - }; + return new Interval(root, root); } } else if (q2 < 1.0) { // Inside ellipsoid (2 intersections). @@ -15467,19 +14830,13 @@ define('Core/IntersectionTests',[ discriminant = qw * qw - product; temp = -qw + Math.sqrt(discriminant); // Positively valued. - return { - start : 0.0, - stop : temp / w2 - }; + return new Interval(0.0, temp / w2); } else { // q2 == 1.0. On ellipsoid. if (qw < 0.0) { // Looking inward. w2 = Cartesian3.magnitudeSquared(w); - return { - start : 0.0, - stop : -qw / w2 - }; + return new Interval(0.0, -qw / w2); } // qw >= 0.0. Looking outward or tangent. @@ -16083,118 +15440,6 @@ define('Core/Plane',[ return Plane; }); -/*global define*/ -define('Core/oneTimeWarning',[ - './defaultValue', - './defined', - './DeveloperError' - ], function( - defaultValue, - defined, - DeveloperError) { - "use strict"; - - var warnings = {}; - - /** - * Logs a one time message to the console. Use this function instead of - * <code>console.log</code> directly since this does not log duplicate messages - * unless it is called from multiple workers. - * - * @exports oneTimeWarning - * - * @param {String} identifier The unique identifier for this warning. - * @param {String} [message=identifier] The message to log to the console. - * - * @example - * for(var i=0;i<foo.length;++i) { - * if (!defined(foo[i].bar)) { - * // Something that can be recovered from but may happen a lot - * oneTimeWarning('foo.bar undefined', 'foo.bar is undefined. Setting to 0.'); - * foo[i].bar = 0; - * // ... - * } - * } - * - * @private - */ - function oneTimeWarning(identifier, message) { - if (!defined(identifier)) { - throw new DeveloperError('identifier is required.'); - } - - if (!defined(warnings[identifier])) { - warnings[identifier] = true; - console.log(defaultValue(message, identifier)); - } - } - - oneTimeWarning.geometryOutlines = 'Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.'; - - return oneTimeWarning; -}); - -/*global define*/ -define('Core/deprecationWarning',[ - './defined', - './DeveloperError', - './oneTimeWarning' - ], function( - defined, - DeveloperError, - oneTimeWarning) { - 'use strict'; - - /** - * Logs a deprecation message to the console. Use this function instead of - * <code>console.log</code> directly since this does not log duplicate messages - * unless it is called from multiple workers. - * - * @exports deprecationWarning - * - * @param {String} identifier The unique identifier for this deprecated API. - * @param {String} message The message to log to the console. - * - * @example - * // Deprecated function or class - * function Foo() { - * deprecationWarning('Foo', 'Foo was deprecated in Cesium 1.01. It will be removed in 1.03. Use newFoo instead.'); - * // ... - * } - * - * // Deprecated function - * Bar.prototype.func = function() { - * deprecationWarning('Bar.func', 'Bar.func() was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newFunc() instead.'); - * // ... - * }; - * - * // Deprecated property - * defineProperties(Bar.prototype, { - * prop : { - * get : function() { - * deprecationWarning('Bar.prop', 'Bar.prop was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newProp instead.'); - * // ... - * }, - * set : function(value) { - * deprecationWarning('Bar.prop', 'Bar.prop was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newProp instead.'); - * // ... - * } - * } - * }); - * - * @private - */ - function deprecationWarning(identifier, message) { - if (!defined(identifier) || !defined(message)) { - throw new DeveloperError('identifier and message are required.'); - } - - oneTimeWarning(identifier, message); - } - - return deprecationWarning; -}); - /*global define*/ define('Core/binarySearch',[ './defined', @@ -20423,6 +19668,7 @@ define('Core/FeatureDetection',[ /*global define*/ define('Core/Quaternion',[ './Cartesian3', + './Check', './defaultValue', './defined', './DeveloperError', @@ -20432,6 +19678,7 @@ define('Core/Quaternion',[ './Matrix3' ], function( Cartesian3, + Check, defaultValue, defined, DeveloperError, @@ -20494,12 +19741,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided. */ Quaternion.fromAxisAngle = function(axis, angle, result) { - if (!defined(axis)) { - throw new DeveloperError('axis is required.'); - } - if (typeof angle !== 'number') { - throw new DeveloperError('angle is required and must be a number.'); - } + Check.typeOf.object('axis', axis); + Check.typeOf.number('angle', angle); var halfAngle = angle / 2.0; var s = Math.sin(halfAngle); @@ -20531,9 +19774,7 @@ define('Core/Quaternion',[ * @see Matrix3.fromQuaternion */ Quaternion.fromRotationMatrix = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); var root; var x; @@ -20607,15 +19848,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter or a new Quaternion instance if none was provided. */ Quaternion.fromHeadingPitchRoll = function(heading, pitch, roll, result) { - if (!defined(heading)) { - throw new DeveloperError('heading is required.'); - } - if (!defined(pitch)) { - throw new DeveloperError('pitch is required.'); - } - if (!defined(roll)) { - throw new DeveloperError('roll is required.'); - } + Check.typeOf.number('heading', heading); + Check.typeOf.number('pitch', pitch); + Check.typeOf.number('roll', roll); var rollQuaternion = Quaternion.fromAxisAngle(Cartesian3.UNIT_X, roll, scratchHPRQuaternion); var pitchQuaternion = Quaternion.fromAxisAngle(Cartesian3.UNIT_Y, -pitch, result); @@ -20646,13 +19881,8 @@ define('Core/Quaternion',[ * @returns {Number[]} The array that was packed into */ Quaternion.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -20673,9 +19903,7 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided. */ Quaternion.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -20730,7 +19958,7 @@ define('Core/Quaternion',[ * * @param {Number[]} array The array previously packed for interpolation. * @param {Number[]} sourceArray The original packed array. - * @param {Number} [startingIndex=0] The startingIndex used to convert the array. + * @param {Number} [firstIndex=0] The firstIndex used to convert the array. * @param {Number} [lastIndex=packedArray.length] The lastIndex used to convert the array. * @param {Quaternion} [result] The object into which to store the result. * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided. @@ -20784,12 +20012,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.conjugate = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); result.x = -quaternion.x; result.y = -quaternion.y; @@ -20805,9 +20029,7 @@ define('Core/Quaternion',[ * @returns {Number} The magnitude squared. */ Quaternion.magnitudeSquared = function(quaternion) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); return quaternion.x * quaternion.x + quaternion.y * quaternion.y + quaternion.z * quaternion.z + quaternion.w * quaternion.w; }; @@ -20830,9 +20052,7 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.normalize = function(quaternion, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); var inverseMagnitude = 1.0 / Quaternion.magnitude(quaternion); var x = quaternion.x * inverseMagnitude; @@ -20855,9 +20075,7 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.inverse = function(quaternion, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); var magnitudeSquared = Quaternion.magnitudeSquared(quaternion); result = Quaternion.conjugate(quaternion, result); @@ -20873,15 +20091,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -20899,15 +20111,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -20924,12 +20130,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.negate = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); result.x = -quaternion.x; result.y = -quaternion.y; @@ -20946,12 +20148,8 @@ define('Core/Quaternion',[ * @returns {Number} The dot product. */ Quaternion.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w; }; @@ -20965,15 +20163,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var leftX = left.x; var leftY = left.y; @@ -21006,15 +20198,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.multiplyByScalar = function(quaternion, scalar, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = quaternion.x * scalar; result.y = quaternion.y * scalar; @@ -21032,15 +20218,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.divideByScalar = function(quaternion, scalar, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = quaternion.x / scalar; result.y = quaternion.y / scalar; @@ -21057,12 +20237,8 @@ define('Core/Quaternion',[ * @returns {Cartesian3} The modified result parameter. */ Quaternion.computeAxis = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); var w = quaternion.w; if (Math.abs(w - 1.0) < CesiumMath.EPSILON6) { @@ -21085,9 +20261,7 @@ define('Core/Quaternion',[ * @returns {Number} The angle of rotation. */ Quaternion.computeAngle = function(quaternion) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); if (Math.abs(quaternion.w - 1.0) < CesiumMath.EPSILON6) { return 0.0; @@ -21106,18 +20280,10 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); lerpScratch = Quaternion.multiplyByScalar(end, t, lerpScratch); result = Quaternion.multiplyByScalar(start, 1.0 - t, result); @@ -21139,18 +20305,10 @@ define('Core/Quaternion',[ * @see Quaternion#fastSlerp */ Quaternion.slerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var dot = Quaternion.dot(start, end); @@ -21183,12 +20341,8 @@ define('Core/Quaternion',[ * @returns {Cartesian3} The modified result parameter. */ Quaternion.log = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); var theta = CesiumMath.acosClamped(quaternion.w); var thetaOverSinTheta = 0.0; @@ -21208,12 +20362,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.exp = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var theta = Cartesian3.magnitude(cartesian); var sinThetaOverTheta = 0.0; @@ -21248,12 +20398,10 @@ define('Core/Quaternion',[ * @see Quaternion#squad */ Quaternion.computeInnerQuadrangle = function(q0, q1, q2, result) { - if (!defined(q0) || !defined(q1) || !defined(q2)) { - throw new DeveloperError('q0, q1, and q2 are required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('q0', q0); + Check.typeOf.object('q1', q1); + Check.typeOf.object('q2', q2); + Check.typeOf.object('result', result); var qInv = Quaternion.conjugate(q1, squadScratchQuaternion0); Quaternion.multiply(qInv, q2, squadScratchQuaternion1); @@ -21295,15 +20443,12 @@ define('Core/Quaternion',[ * @see Quaternion#computeInnerQuadrangle */ Quaternion.squad = function(q0, q1, s0, s1, t, result) { - if (!defined(q0) || !defined(q1) || !defined(s0) || !defined(s1)) { - throw new DeveloperError('q0, q1, s0, and s1 are required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('q0', q0); + Check.typeOf.object('q1', q1); + Check.typeOf.object('s0', s0); + Check.typeOf.object('s1', s1); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var slerp0 = Quaternion.slerp(q0, q1, t, squadScratchQuaternion0); var slerp1 = Quaternion.slerp(s0, s1, t, squadScratchQuaternion1); @@ -21340,18 +20485,10 @@ define('Core/Quaternion',[ * @see Quaternion#slerp */ Quaternion.fastSlerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var x = Quaternion.dot(start, end); @@ -21400,15 +20537,12 @@ define('Core/Quaternion',[ * @see Quaternion#squad */ Quaternion.fastSquad = function(q0, q1, s0, s1, t, result) { - if (!defined(q0) || !defined(q1) || !defined(s0) || !defined(s1)) { - throw new DeveloperError('q0, q1, s0, and s1 are required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('q0', q0); + Check.typeOf.object('q1', q1); + Check.typeOf.object('s0', s0); + Check.typeOf.object('s1', s1); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var slerp0 = Quaternion.fastSlerp(q0, q1, t, squadScratchQuaternion0); var slerp1 = Quaternion.fastSlerp(s0, s1, t, squadScratchQuaternion1); @@ -21444,9 +20578,7 @@ define('Core/Quaternion',[ * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. */ Quaternion.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon is required and must be a number.'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || ((defined(left)) && @@ -21526,9 +20658,9 @@ define('Core/Transforms',[ './Cartesian3', './Cartesian4', './Cartographic', + './Check', './defaultValue', './defined', - './deprecationWarning', './DeveloperError', './EarthOrientationParameters', './EarthOrientationParametersSample', @@ -21548,9 +20680,9 @@ define('Core/Transforms',[ Cartesian3, Cartesian4, Cartographic, + Check, defaultValue, defined, - deprecationWarning, DeveloperError, EarthOrientationParameters, EarthOrientationParametersSample, @@ -21986,19 +21118,12 @@ define('Core/Transforms',[ * var hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll); * var transform = Cesium.Transforms.headingPitchRollToFixedFrame(center, hpr); */ - Transforms.headingPitchRollToFixedFrame = function(origin, headingPitchRoll, pitch, roll, ellipsoid, result) { - var heading; - if (typeof headingPitchRoll === 'object') { - // Shift arguments using assignments to encourage JIT optimization. - ellipsoid = pitch; - result = roll; - heading = headingPitchRoll.heading; - pitch = headingPitchRoll.pitch; - roll = headingPitchRoll.roll; - } else { - deprecationWarning('headingPitchRollToFixedFrame', 'headingPitchRollToFixedFrame with separate heading, pitch, and roll arguments was deprecated in 1.27. It will be removed in 1.30. Use a HeadingPitchRoll object.'); - heading = headingPitchRoll; - } + Transforms.headingPitchRollToFixedFrame = function(origin, headingPitchRoll, ellipsoid, result) { + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + var heading = headingPitchRoll.heading; + var pitch = headingPitchRoll.pitch; + var roll = headingPitchRoll.roll; + // checks for required parameters happen in the called functions var hprQuaternion = Quaternion.fromHeadingPitchRoll(heading, pitch, roll, scratchHPRQuaternion); var hprMatrix = Matrix4.fromTranslationQuaternionRotationScale(Cartesian3.ZERO, hprQuaternion, scratchScale, scratchHPRMatrix4); @@ -22006,7 +21131,6 @@ define('Core/Transforms',[ return Matrix4.multiply(result, hprMatrix, result); }; - var scratchHPR = new HeadingPitchRoll(); var scratchENUMatrix4 = new Matrix4(); var scratchHPRMatrix3 = new Matrix3(); @@ -22031,22 +21155,10 @@ define('Core/Transforms',[ * var hpr = new HeadingPitchRoll(heading, pitch, roll); * var quaternion = Cesium.Transforms.headingPitchRollQuaternion(center, hpr); */ - Transforms.headingPitchRollQuaternion = function(origin, headingPitchRoll, pitch, roll, ellipsoid, result) { - var hpr; - if (typeof headingPitchRoll === 'object') { - // Shift arguments using assignment to encourage JIT optimization. - hpr = headingPitchRoll; - ellipsoid = pitch; - result = roll; - } else { - deprecationWarning('headingPitchRollQuaternion', 'headingPitchRollQuaternion with separate heading, pitch, and roll arguments was deprecated in 1.27. It will be removed in 1.30. Use a HeadingPitchRoll object.'); - scratchHPR.heading = headingPitchRoll; - scratchHPR.pitch = pitch; - scratchHPR.roll = roll; - hpr = scratchHPR; - } + Transforms.headingPitchRollQuaternion = function(origin, headingPitchRoll, ellipsoid, result) { // checks for required parameters happen in the called functions - var transform = Transforms.headingPitchRollToFixedFrame(origin, hpr, ellipsoid, scratchENUMatrix4); + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + var transform = Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, scratchENUMatrix4); var rotation = Matrix4.getRotation(transform, scratchHPRMatrix3); return Quaternion.fromRotationMatrix(rotation, result); }; @@ -22522,6 +21634,46 @@ define('Core/Transforms',[ return result; }; + var swizzleMatrix = new Matrix4( + 0.0, 0.0, 1.0, 0.0, + 1.0, 0.0, 0.0, 0.0, + 0.0, 1.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + + /** + * @private + */ + Transforms.wgs84To2DModelMatrix = function(projection, center, result) { + if (!defined(projection)) { + throw new DeveloperError('projection is required.'); + } + if (!defined(center)) { + throw new DeveloperError('center is required.'); + } + if (!defined(result)) { + throw new DeveloperError('result is required.'); + } + + var ellipsoid = projection.ellipsoid; + + var fromENU = Transforms.eastNorthUpToFixedFrame(center, ellipsoid, scratchFromENU); + var toENU = Matrix4.inverseTransformation(fromENU, scratchToENU); + + var cartographic = ellipsoid.cartesianToCartographic(center, scratchCartographic); + var projectedPosition = projection.project(cartographic, scratchCartesian3Projection); + var newOrigin = scratchCartesian4NewOrigin; + newOrigin.x = projectedPosition.z; + newOrigin.y = projectedPosition.x; + newOrigin.z = projectedPosition.y; + newOrigin.w = 1.0; + + var translation = Matrix4.fromTranslation(newOrigin, scratchFromENU); + Matrix4.multiply(swizzleMatrix, toENU, result); + Matrix4.multiply(translation, result, result); + + return result; + }; + return Transforms; }); @@ -23060,6 +22212,7 @@ define('Core/OrientedBoundingBox',[ /** * Computes an OrientedBoundingBox given extents in the east-north-up space of the tangent plane. * + * @param {Plane} tangentPlane The tangent place corresponding to east-north-up. * @param {Number} minimumX Minimum X extent in tangent plane space. * @param {Number} maximumX Maximum X extent in tangent plane space. * @param {Number} minimumY Minimum Y extent in tangent plane space. @@ -24477,7 +23630,10 @@ define('Core/WebGLConstants',[ COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : 0x9279, TEXTURE_IMMUTABLE_FORMAT : 0x912F, MAX_ELEMENT_INDEX : 0x8D6B, - TEXTURE_IMMUTABLE_LEVELS : 0x82DF + TEXTURE_IMMUTABLE_LEVELS : 0x82DF, + + // Extensions + MAX_TEXTURE_MAX_ANISOTROPY_EXT : 0x84FF }; return freezeObject(WebGLConstants); @@ -26224,6 +25380,7 @@ define('Core/TerrainMesh',[ * @param {Number} [vertexStride=6] The number of components in each vertex. * @param {OrientedBoundingBox} [orientedBoundingBox] A bounding box that completely contains the tile. * @param {TerrainEncoding} encoding Information used to decode the mesh. + * @param {Number} exaggeration The amount that this mesh was exaggerated. * * @private */ @@ -26407,6 +25564,18 @@ define('Core/TerrainProvider',[ */ hasVertexNormals : { get : DeveloperError.throwInstantiationError + }, + + /** + * Gets an object that can be used to determine availability of terrain from this provider, such as + * at points and in rectangles. This function should not be called before + * {@link TerrainProvider#ready} returns true. This property may be undefined if availability + * information is not available. + * @memberof TerrainProvider.prototype + * @type {TileAvailability} + */ + availability : { + get : DeveloperError.throwInstantiationError } }); @@ -27906,7 +27075,7 @@ define('Core/BingMapsApi',[ console.log(errorString); printedBingWarning = true; } - return 'AhiQlDaPOwKbStA_3nJIdimUj4PRYkp0yHwcNpvxVlLNPRo5ZJWY5oX_h6B_dMbm'; + return 'AudaMP3YocqmIOQrFAValZ9d_tFqS4JWwiSEnvt2jwP5lizGzV_mJxLaKaI0fWRT'; } return BingMapsApi.defaultKey; @@ -27927,22 +27096,485 @@ define('Core/BingMapsApi',[ return BingMapsApi; }); +/*global define*/ +define('Core/combine',[ + './defaultValue', + './defined' + ], function( + defaultValue, + defined) { + 'use strict'; + + /** + * Merges two objects, copying their properties onto a new combined object. When two objects have the same + * property, the value of the property on the first object is used. If either object is undefined, + * it will be treated as an empty object. + * + * @example + * var object1 = { + * propOne : 1, + * propTwo : { + * value1 : 10 + * } + * } + * var object2 = { + * propTwo : 2 + * } + * var final = Cesium.combine(object1, object2); + * + * // final === { + * // propOne : 1, + * // propTwo : { + * // value1 : 10 + * // } + * // } + * + * @param {Object} [object1] The first object to merge. + * @param {Object} [object2] The second object to merge. + * @param {Boolean} [deep=false] Perform a recursive merge. + * @returns {Object} The combined object containing all properties from both objects. + * + * @exports combine + */ + function combine(object1, object2, deep) { + deep = defaultValue(deep, false); + + var result = {}; + + var object1Defined = defined(object1); + var object2Defined = defined(object2); + var property; + var object1Value; + var object2Value; + if (object1Defined) { + for (property in object1) { + if (object1.hasOwnProperty(property)) { + object1Value = object1[property]; + if (object2Defined && deep && typeof object1Value === 'object' && object2.hasOwnProperty(property)) { + object2Value = object2[property]; + if (typeof object2Value === 'object') { + result[property] = combine(object1Value, object2Value, deep); + } else { + result[property] = object1Value; + } + } else { + result[property] = object1Value; + } + } + } + } + if (object2Defined) { + for (property in object2) { + if (object2.hasOwnProperty(property) && !result.hasOwnProperty(property)) { + object2Value = object2[property]; + result[property] = object2Value; + } + } + } + return result; + } + + return combine; +}); + +/*global define*/ +define('Core/isArray',[ + './defined' + ], function( + defined) { + 'use strict'; + + /** + * Tests an object to see if it is an array. + * @exports isArray + * + * @param {Object} value The value to test. + * @returns {Boolean} true if the value is an array, false otherwise. + */ + var isArray = Array.isArray; + if (!defined(isArray)) { + isArray = function(value) { + return Object.prototype.toString.call(value) === '[object Array]'; + }; + } + + return isArray; +}); + +/*global define*/ +define('Core/objectToQuery',[ + './defined', + './DeveloperError', + './isArray' + ], function( + defined, + DeveloperError, + isArray) { + 'use strict'; + + /** + * Converts an object representing a set of name/value pairs into a query string, + * with names and values encoded properly for use in a URL. Values that are arrays + * will produce multiple values with the same name. + * @exports objectToQuery + * + * @param {Object} obj The object containing data to encode. + * @returns {String} An encoded query string. + * + * + * @example + * var str = Cesium.objectToQuery({ + * key1 : 'some value', + * key2 : 'a/b', + * key3 : ['x', 'y'] + * }); + * + * @see queryToObject + * // str will be: + * // 'key1=some%20value&key2=a%2Fb&key3=x&key3=y' + */ + function objectToQuery(obj) { + if (!defined(obj)) { + throw new DeveloperError('obj is required.'); + } + + var result = ''; + for ( var propName in obj) { + if (obj.hasOwnProperty(propName)) { + var value = obj[propName]; + + var part = encodeURIComponent(propName) + '='; + if (isArray(value)) { + for (var i = 0, len = value.length; i < len; ++i) { + result += part + encodeURIComponent(value[i]) + '&'; + } + } else { + result += part + encodeURIComponent(value) + '&'; + } + } + } + + // trim last & + result = result.slice(0, -1); + + // This function used to replace %20 with + which is more compact and readable. + // However, some servers didn't properly handle + as a space. + // https://github.com/AnalyticalGraphicsInc/cesium/issues/2192 + + return result; + } + + return objectToQuery; +}); + +/*global define*/ +define('Core/queryToObject',[ + './defined', + './DeveloperError', + './isArray' + ], function( + defined, + DeveloperError, + isArray) { + 'use strict'; + + /** + * Parses a query string into an object, where the keys and values of the object are the + * name/value pairs from the query string, decoded. If a name appears multiple times, + * the value in the object will be an array of values. + * @exports queryToObject + * + * @param {String} queryString The query string. + * @returns {Object} An object containing the parameters parsed from the query string. + * + * + * @example + * var obj = Cesium.queryToObject('key1=some%20value&key2=a%2Fb&key3=x&key3=y'); + * // obj will be: + * // { + * // key1 : 'some value', + * // key2 : 'a/b', + * // key3 : ['x', 'y'] + * // } + * + * @see objectToQuery + */ + function queryToObject(queryString) { + if (!defined(queryString)) { + throw new DeveloperError('queryString is required.'); + } + + var result = {}; + if (queryString === '') { + return result; + } + var parts = queryString.replace(/\+/g, '%20').split('&'); + for (var i = 0, len = parts.length; i < len; ++i) { + var subparts = parts[i].split('='); + + var name = decodeURIComponent(subparts[0]); + var value = subparts[1]; + if (defined(value)) { + value = decodeURIComponent(value); + } else { + value = ''; + } + + var resultValue = result[name]; + if (typeof resultValue === 'string') { + // expand the single value to an array + result[name] = [resultValue, value]; + } else if (isArray(resultValue)) { + resultValue.push(value); + } else { + result[name] = value; + } + } + return result; + } + + return queryToObject; +}); + +/*global define*/ +define('Core/loadJsonp',[ + '../ThirdParty/Uri', + '../ThirdParty/when', + './combine', + './defaultValue', + './defined', + './DeveloperError', + './objectToQuery', + './queryToObject' + ], function( + Uri, + when, + combine, + defaultValue, + defined, + DeveloperError, + objectToQuery, + queryToObject) { + 'use strict'; + + /** + * Requests a resource using JSONP. + * + * @exports loadJsonp + * + * @param {String} url The URL to request. + * @param {Object} [options] Object with the following properties: + * @param {Object} [options.parameters] Any extra query parameters to append to the URL. + * @param {String} [options.callbackParameterName='callback'] The callback parameter name that the server expects. + * @param {Proxy} [options.proxy] A proxy to use for the request. This object is expected to have a getURL function which returns the proxied URL, if needed. + * @returns {Promise.<Object>} a promise that will resolve to the requested data when loaded. + * + * + * @example + * // load a data asynchronously + * Cesium.loadJsonp('some/webservice').then(function(data) { + * // use the loaded data + * }).otherwise(function(error) { + * // an error occurred + * }); + * + * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A} + */ + function loadJsonp(url, options) { + if (!defined(url)) { + throw new DeveloperError('url is required.'); + } + + options = defaultValue(options, defaultValue.EMPTY_OBJECT); + + //generate a unique function name + var functionName; + do { + functionName = 'loadJsonp' + Math.random().toString().substring(2, 8); + } while (defined(window[functionName])); + + var deferred = when.defer(); + + //assign a function with that name in the global scope + window[functionName] = function(data) { + deferred.resolve(data); + + try { + delete window[functionName]; + } catch (e) { + window[functionName] = undefined; + } + }; + + var uri = new Uri(url); + + var queryOptions = queryToObject(defaultValue(uri.query, '')); + + if (defined(options.parameters)) { + queryOptions = combine(options.parameters, queryOptions); + } + + var callbackParameterName = defaultValue(options.callbackParameterName, 'callback'); + queryOptions[callbackParameterName] = functionName; + + uri.query = objectToQuery(queryOptions); + + url = uri.toString(); + + var proxy = options.proxy; + if (defined(proxy)) { + url = proxy.getURL(url); + } + + loadJsonp.loadAndExecuteScript(url, functionName, deferred); + + return deferred.promise; + } + + // This is broken out into a separate function so that it can be mocked for testing purposes. + loadJsonp.loadAndExecuteScript = function(url, functionName, deferred) { + var script = document.createElement('script'); + script.async = true; + script.src = url; + + var head = document.getElementsByTagName('head')[0]; + script.onload = function() { + script.onload = undefined; + head.removeChild(script); + }; + script.onerror = function(e) { + deferred.reject(e); + }; + + head.appendChild(script); + }; + + loadJsonp.defaultLoadAndExecuteScript = loadJsonp.loadAndExecuteScript; + + return loadJsonp; +}); + +/*global define*/ +define('Core/BingMapsGeocoderService',[ + './BingMapsApi', + './defaultValue', + './defined', + './defineProperties', + './DeveloperError', + './loadJsonp', + './Rectangle' +], function( + BingMapsApi, + defaultValue, + defined, + defineProperties, + DeveloperError, + loadJsonp, + Rectangle) { + 'use strict'; + + var url = 'https://dev.virtualearth.net/REST/v1/Locations'; + + /** + * Provides geocoding through Bing Maps. + * @alias BingMapsGeocoderService + * @constructor + * + * @param {Object} options Object with the following properties: + * @param {String} [options.key] A key to use with the Bing Maps geocoding service + */ + function BingMapsGeocoderService(options) { + options = defaultValue(options, defaultValue.EMPTY_OBJECT); + this._url = 'https://dev.virtualearth.net/REST/v1/Locations'; + this._key = BingMapsApi.getKey(options.key); + } + + defineProperties(BingMapsGeocoderService.prototype, { + /** + * The URL endpoint for the Bing geocoder service + * @type {String} + * @memberof {BingMapsGeocoderService.prototype} + * @readonly + */ + url : { + get : function () { + return this._url; + } + }, + + /** + * The key for the Bing geocoder service + * @type {String} + * @memberof {BingMapsGeocoderService.prototype} + * @readonly + */ + key : { + get : function () { + return this._key; + } + } + }); + + /** + * @function + * + * @param {String} query The query to be sent to the geocoder service + * @returns {Promise<GeocoderResult[]>} + */ + BingMapsGeocoderService.prototype.geocode = function(query) { + if (!defined(query)) { + throw new DeveloperError('query must be defined'); + } + + var key = this.key; + var promise = loadJsonp(url, { + parameters : { + query : query, + key : key + }, + callbackParameterName : 'jsonp' + }); + + return promise.then(function(result) { + if (result.resourceSets.length === 0) { + return []; + } + + var results = result.resourceSets[0].resources; + + return results.map(function (resource) { + var bbox = resource.bbox; + var south = bbox[0]; + var west = bbox[1]; + var north = bbox[2]; + var east = bbox[3]; + return { + displayName: resource.name, + destination: Rectangle.fromDegrees(west, south, east, north) + }; + }); + }); + }; + + return BingMapsGeocoderService; +}); + /*global define*/ define('Core/BoundingRectangle',[ './Cartesian2', './Cartographic', + './Check', './defaultValue', './defined', - './DeveloperError', './GeographicProjection', './Intersect', './Rectangle' ], function( Cartesian2, Cartographic, + Check, defaultValue, defined, - DeveloperError, GeographicProjection, Intersect, Rectangle) { @@ -28007,12 +27639,8 @@ define('Core/BoundingRectangle',[ * @returns {Number[]} The array that was packed into */ BoundingRectangle.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -28033,9 +27661,7 @@ define('Core/BoundingRectangle',[ * @returns {BoundingRectangle} The modified result parameter or a new BoundingRectangle instance if one was not provided. */ BoundingRectangle.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -28166,12 +27792,8 @@ define('Core/BoundingRectangle',[ * @returns {BoundingRectangle} The modified result parameter or a new BoundingRectangle instance if one was not provided. */ BoundingRectangle.union = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); if (!defined(result)) { result = new BoundingRectangle(); @@ -28198,12 +27820,8 @@ define('Core/BoundingRectangle',[ * @returns {BoundingRectangle} The modified result parameter or a new BoundingRectangle instance if one was not provided. */ BoundingRectangle.expand = function(rectangle, point, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } - if (!defined(point)) { - throw new DeveloperError('point is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('point', point); result = BoundingRectangle.clone(rectangle, result); @@ -28235,12 +27853,8 @@ define('Core/BoundingRectangle',[ * @returns {Intersect} <code>Intersect.INTESECTING</code> if the rectangles intersect, <code>Intersect.OUTSIDE</code> otherwise. */ BoundingRectangle.intersect = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); var leftX = left.x; var leftY = left.y; @@ -28505,7 +28119,7 @@ define('Core/Geometry',[ * <li><code>position</code> - 3D vertex position. 64-bit floating-point (for precision). 3 components per attribute. See {@link VertexFormat#position}.</li> * <li><code>normal</code> - Normal (normalized), commonly used for lighting. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#normal}.</li> * <li><code>st</code> - 2D texture coordinate. 32-bit floating-point. 2 components per attribute. See {@link VertexFormat#st}.</li> - * <li><code>binormal</code> - Binormal (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#binormal}.</li> + * <li><code>bitangent</code> - Bitangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#bitangent}.</li> * <li><code>tangent</code> - Tangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#tangent}.</li> * </ul> * </p> @@ -28534,7 +28148,7 @@ define('Core/Geometry',[ * componentsPerAttribute : 3, * values : new Float32Array(0) * }); - * + * * @see GeometryAttribute * @see VertexFormat */ @@ -28815,7 +28429,7 @@ define('Core/GeometryAttributes',[ this.st = options.st; /** - * The binormal attribute (normalized), which is used for tangent-space effects like bump mapping. + * The bitangent attribute (normalized), which is used for tangent-space effects like bump mapping. * <p> * 32-bit floating-point. 3 components per attribute. * </p> @@ -28824,7 +28438,7 @@ define('Core/GeometryAttributes',[ * * @default undefined */ - this.binormal = options.binormal; + this.bitangent = options.bitangent; /** * The tangent attribute (normalized), which is used for tangent-space effects like bump mapping. @@ -28927,7 +28541,7 @@ define('Core/VertexFormat',[ this.st = defaultValue(options.st, false); /** - * When <code>true</code>, the vertex has a binormal attribute (normalized), which is used for tangent-space effects like bump mapping. + * When <code>true</code>, the vertex has a bitangent attribute (normalized), which is used for tangent-space effects like bump mapping. * <p> * 32-bit floating-point. 3 components per attribute. * </p> @@ -28936,7 +28550,7 @@ define('Core/VertexFormat',[ * * @default false */ - this.binormal = defaultValue(options.binormal, false); + this.bitangent = defaultValue(options.bitangent, false); /** * When <code>true</code>, the vertex has a tangent attribute (normalized), which is used for tangent-space effects like bump mapping. @@ -29038,7 +28652,7 @@ define('Core/VertexFormat',[ })); /** - * An immutable vertex format with well-known attributes: position, normal, st, binormal, and tangent. + * An immutable vertex format with well-known attributes: position, normal, st, tangent, and bitangent. * * @type {VertexFormat} * @constant @@ -29046,15 +28660,15 @@ define('Core/VertexFormat',[ * @see VertexFormat#position * @see VertexFormat#normal * @see VertexFormat#st - * @see VertexFormat#binormal * @see VertexFormat#tangent + * @see VertexFormat#bitangent */ VertexFormat.ALL = freezeObject(new VertexFormat({ position : true, normal : true, st : true, - binormal : true, - tangent : true + tangent : true, + bitangent : true })); /** @@ -29099,8 +28713,8 @@ define('Core/VertexFormat',[ array[startingIndex++] = value.position ? 1.0 : 0.0; array[startingIndex++] = value.normal ? 1.0 : 0.0; array[startingIndex++] = value.st ? 1.0 : 0.0; - array[startingIndex++] = value.binormal ? 1.0 : 0.0; array[startingIndex++] = value.tangent ? 1.0 : 0.0; + array[startingIndex++] = value.bitangent ? 1.0 : 0.0; array[startingIndex++] = value.color ? 1.0 : 0.0; return array; @@ -29125,19 +28739,19 @@ define('Core/VertexFormat',[ result = new VertexFormat(); } - result.position = array[startingIndex++] === 1.0; - result.normal = array[startingIndex++] === 1.0; - result.st = array[startingIndex++] === 1.0; - result.binormal = array[startingIndex++] === 1.0; - result.tangent = array[startingIndex++] === 1.0; - result.color = array[startingIndex++] === 1.0; + result.position = array[startingIndex++] === 1.0; + result.normal = array[startingIndex++] === 1.0; + result.st = array[startingIndex++] === 1.0; + result.tangent = array[startingIndex++] === 1.0; + result.bitangent = array[startingIndex++] === 1.0; + result.color = array[startingIndex++] === 1.0; return result; }; /** * Duplicates a VertexFormat instance. * - * @param {VertexFormat} cartesian The vertex format to duplicate. + * @param {VertexFormat} vertexFormat The vertex format to duplicate. * @param {VertexFormat} [result] The object onto which to store the result. * @returns {VertexFormat} The modified result parameter or a new VertexFormat instance if one was not provided. (Returns undefined if vertexFormat is undefined) */ @@ -29152,8 +28766,8 @@ define('Core/VertexFormat',[ result.position = vertexFormat.position; result.normal = vertexFormat.normal; result.st = vertexFormat.st; - result.binormal = vertexFormat.binormal; result.tangent = vertexFormat.tangent; + result.bitangent = vertexFormat.bitangent; result.color = vertexFormat.color; return result; }; @@ -29398,7 +29012,7 @@ define('Core/BoxGeometry',[ var positions; if (vertexFormat.position && - (vertexFormat.st || vertexFormat.normal || vertexFormat.binormal || vertexFormat.tangent)) { + (vertexFormat.st || vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent)) { if (vertexFormat.position) { // 8 corner points. Duplicated 3 times each for each incident edge/face. positions = new Float64Array(6 * 4 * 3); @@ -29752,97 +29366,97 @@ define('Core/BoxGeometry',[ }); } - if (vertexFormat.binormal) { - var binormals = new Float32Array(6 * 4 * 3); + if (vertexFormat.bitangent) { + var bitangents = new Float32Array(6 * 4 * 3); // +z face - binormals[0] = 0.0; - binormals[1] = 1.0; - binormals[2] = 0.0; - binormals[3] = 0.0; - binormals[4] = 1.0; - binormals[5] = 0.0; - binormals[6] = 0.0; - binormals[7] = 1.0; - binormals[8] = 0.0; - binormals[9] = 0.0; - binormals[10] = 1.0; - binormals[11] = 0.0; + bitangents[0] = 0.0; + bitangents[1] = 1.0; + bitangents[2] = 0.0; + bitangents[3] = 0.0; + bitangents[4] = 1.0; + bitangents[5] = 0.0; + bitangents[6] = 0.0; + bitangents[7] = 1.0; + bitangents[8] = 0.0; + bitangents[9] = 0.0; + bitangents[10] = 1.0; + bitangents[11] = 0.0; // -z face - binormals[12] = 0.0; - binormals[13] = 1.0; - binormals[14] = 0.0; - binormals[15] = 0.0; - binormals[16] = 1.0; - binormals[17] = 0.0; - binormals[18] = 0.0; - binormals[19] = 1.0; - binormals[20] = 0.0; - binormals[21] = 0.0; - binormals[22] = 1.0; - binormals[23] = 0.0; + bitangents[12] = 0.0; + bitangents[13] = 1.0; + bitangents[14] = 0.0; + bitangents[15] = 0.0; + bitangents[16] = 1.0; + bitangents[17] = 0.0; + bitangents[18] = 0.0; + bitangents[19] = 1.0; + bitangents[20] = 0.0; + bitangents[21] = 0.0; + bitangents[22] = 1.0; + bitangents[23] = 0.0; // +x face - binormals[24] = 0.0; - binormals[25] = 0.0; - binormals[26] = 1.0; - binormals[27] = 0.0; - binormals[28] = 0.0; - binormals[29] = 1.0; - binormals[30] = 0.0; - binormals[31] = 0.0; - binormals[32] = 1.0; - binormals[33] = 0.0; - binormals[34] = 0.0; - binormals[35] = 1.0; + bitangents[24] = 0.0; + bitangents[25] = 0.0; + bitangents[26] = 1.0; + bitangents[27] = 0.0; + bitangents[28] = 0.0; + bitangents[29] = 1.0; + bitangents[30] = 0.0; + bitangents[31] = 0.0; + bitangents[32] = 1.0; + bitangents[33] = 0.0; + bitangents[34] = 0.0; + bitangents[35] = 1.0; // -x face - binormals[36] = 0.0; - binormals[37] = 0.0; - binormals[38] = 1.0; - binormals[39] = 0.0; - binormals[40] = 0.0; - binormals[41] = 1.0; - binormals[42] = 0.0; - binormals[43] = 0.0; - binormals[44] = 1.0; - binormals[45] = 0.0; - binormals[46] = 0.0; - binormals[47] = 1.0; + bitangents[36] = 0.0; + bitangents[37] = 0.0; + bitangents[38] = 1.0; + bitangents[39] = 0.0; + bitangents[40] = 0.0; + bitangents[41] = 1.0; + bitangents[42] = 0.0; + bitangents[43] = 0.0; + bitangents[44] = 1.0; + bitangents[45] = 0.0; + bitangents[46] = 0.0; + bitangents[47] = 1.0; // +y face - binormals[48] = 0.0; - binormals[49] = 0.0; - binormals[50] = 1.0; - binormals[51] = 0.0; - binormals[52] = 0.0; - binormals[53] = 1.0; - binormals[54] = 0.0; - binormals[55] = 0.0; - binormals[56] = 1.0; - binormals[57] = 0.0; - binormals[58] = 0.0; - binormals[59] = 1.0; + bitangents[48] = 0.0; + bitangents[49] = 0.0; + bitangents[50] = 1.0; + bitangents[51] = 0.0; + bitangents[52] = 0.0; + bitangents[53] = 1.0; + bitangents[54] = 0.0; + bitangents[55] = 0.0; + bitangents[56] = 1.0; + bitangents[57] = 0.0; + bitangents[58] = 0.0; + bitangents[59] = 1.0; // -y face - binormals[60] = 0.0; - binormals[61] = 0.0; - binormals[62] = 1.0; - binormals[63] = 0.0; - binormals[64] = 0.0; - binormals[65] = 1.0; - binormals[66] = 0.0; - binormals[67] = 0.0; - binormals[68] = 1.0; - binormals[69] = 0.0; - binormals[70] = 0.0; - binormals[71] = 1.0; - - attributes.binormal = new GeometryAttribute({ + bitangents[60] = 0.0; + bitangents[61] = 0.0; + bitangents[62] = 1.0; + bitangents[63] = 0.0; + bitangents[64] = 0.0; + bitangents[65] = 1.0; + bitangents[66] = 0.0; + bitangents[67] = 0.0; + bitangents[68] = 1.0; + bitangents[69] = 0.0; + bitangents[70] = 0.0; + bitangents[71] = 1.0; + + attributes.bitangent = new GeometryAttribute({ componentDatatype : ComponentDatatype.FLOAT, componentsPerAttribute : 3, - values : binormals + values : bitangents }); } @@ -30344,6 +29958,64 @@ define('Core/cancelAnimationFrame',[ return cancelAnimationFrame; }); +/*global define*/ +define('Core/CartographicGeocoderService',[ + './Cartesian3', + './defaultValue', + './defineProperties', + './defined', + './DeveloperError', + '../ThirdParty/when' +], function( + Cartesian3, + defaultValue, + defineProperties, + defined, + DeveloperError, + when) { + 'use strict'; + + /** + * Geocodes queries containing longitude and latitude coordinates and an optional height. + * Query format: `longitude latitude (height)` with longitude/latitude in degrees and height in meters. + * + * @alias CartographicGeocoderService + * @constructor + */ + function CartographicGeocoderService() { + } + + /** + * @function + * + * @param {String} query The query to be sent to the geocoder service + * @returns {Promise<GeocoderResult[]>} + */ + CartographicGeocoderService.prototype.geocode = function(query) { + if (!defined(query)) { + throw new DeveloperError('query must be defined'); + } + + var splitQuery = query.match(/[^\s,\n]+/g); + if ((splitQuery.length === 2) || (splitQuery.length === 3)) { + var longitude = +splitQuery[0]; + var latitude = +splitQuery[1]; + var height = (splitQuery.length === 3) ? +splitQuery[2] : 300.0; + + if (!isNaN(longitude) && !isNaN(latitude) && !isNaN(height)) { + var result = { + displayName: query, + destination: Cartesian3.fromDegrees(longitude, latitude, height) + }; + return when.resolve([result]); + } + } + return when.resolve([]); + }; + + return CartographicGeocoderService; +}); + /*global define*/ define('Core/Spline',[ './defaultValue', @@ -32601,6 +32273,580 @@ define('Core/QuantizedMeshTerrainData',[ return QuantizedMeshTerrainData; }); +/*global define*/ +define('Core/sampleTerrain',[ + '../ThirdParty/when', + './defined', + './DeveloperError' + ], function( + when, + defined, + DeveloperError) { + 'use strict'; + + /** + * Initiates a terrain height query for an array of {@link Cartographic} positions by + * requesting tiles from a terrain provider, sampling, and interpolating. The interpolation + * matches the triangles used to render the terrain at the specified level. The query + * happens asynchronously, so this function returns a promise that is resolved when + * the query completes. Each point height is modified in place. If a height can not be + * determined because no terrain data is available for the specified level at that location, + * or another error occurs, the height is set to undefined. As is typical of the + * {@link Cartographic} type, the supplied height is a height above the reference ellipsoid + * (such as {@link Ellipsoid.WGS84}) rather than an altitude above mean sea level. In other + * words, it will not necessarily be 0.0 if sampled in the ocean. + * + * @exports sampleTerrain + * + * @param {TerrainProvider} terrainProvider The terrain provider from which to query heights. + * @param {Number} level The terrain level-of-detail from which to query terrain heights. + * @param {Cartographic[]} positions The positions to update with terrain heights. + * @returns {Promise.<Cartographic[]>} A promise that resolves to the provided list of positions when terrain the query has completed. + * + * @example + * // Query the terrain height of two Cartographic positions + * var terrainProvider = new Cesium.CesiumTerrainProvider({ + * url : 'https://assets.agi.com/stk-terrain/world' + * }); + * var positions = [ + * Cesium.Cartographic.fromDegrees(86.925145, 27.988257), + * Cesium.Cartographic.fromDegrees(87.0, 28.0) + * ]; + * var promise = Cesium.sampleTerrain(terrainProvider, 11, positions); + * Cesium.when(promise, function(updatedPositions) { + * // positions[0].height and positions[1].height have been updated. + * // updatedPositions is just a reference to positions. + * }); + */ + function sampleTerrain(terrainProvider, level, positions) { + if (!defined(terrainProvider)) { + throw new DeveloperError('terrainProvider is required.'); + } + if (!defined(level)) { + throw new DeveloperError('level is required.'); + } + if (!defined(positions)) { + throw new DeveloperError('positions is required.'); + } + + var deferred = when.defer(); + + function doSamplingWhenReady() { + if (terrainProvider.ready) { + when(doSampling(terrainProvider, level, positions), function(updatedPositions) { + deferred.resolve(updatedPositions); + }); + } else { + setTimeout(doSamplingWhenReady, 10); + } + } + + doSamplingWhenReady(); + + return deferred.promise; + } + + function doSampling(terrainProvider, level, positions) { + var tilingScheme = terrainProvider.tilingScheme; + + var i; + + // Sort points into a set of tiles + var tileRequests = []; // Result will be an Array as it's easier to work with + var tileRequestSet = {}; // A unique set + for (i = 0; i < positions.length; ++i) { + var xy = tilingScheme.positionToTileXY(positions[i], level); + var key = xy.toString(); + + if (!tileRequestSet.hasOwnProperty(key)) { + // When tile is requested for the first time + var value = { + x : xy.x, + y : xy.y, + level : level, + tilingScheme : tilingScheme, + terrainProvider : terrainProvider, + positions : [] + }; + tileRequestSet[key] = value; + tileRequests.push(value); + } + + // Now append to array of points for the tile + tileRequestSet[key].positions.push(positions[i]); + } + + // Send request for each required tile + var tilePromises = []; + for (i = 0; i < tileRequests.length; ++i) { + var tileRequest = tileRequests[i]; + var requestPromise = tileRequest.terrainProvider.requestTileGeometry(tileRequest.x, tileRequest.y, tileRequest.level, false); + var tilePromise = when(requestPromise, createInterpolateFunction(tileRequest), createMarkFailedFunction(tileRequest)); + tilePromises.push(tilePromise); + } + + return when.all(tilePromises, function() { + return positions; + }); + } + + function createInterpolateFunction(tileRequest) { + var tilePositions = tileRequest.positions; + var rectangle = tileRequest.tilingScheme.tileXYToRectangle(tileRequest.x, tileRequest.y, tileRequest.level); + return function(terrainData) { + for (var i = 0; i < tilePositions.length; ++i) { + var position = tilePositions[i]; + position.height = terrainData.interpolateHeight(rectangle, position.longitude, position.latitude); + } + }; + } + + function createMarkFailedFunction(tileRequest) { + var tilePositions = tileRequest.positions; + return function() { + for (var i = 0; i < tilePositions.length; ++i) { + var position = tilePositions[i]; + position.height = undefined; + } + }; + } + + return sampleTerrain; +}); + +/*global define*/ +define('Core/TileAvailability',[ + '../ThirdParty/when', + './binarySearch', + './Cartographic', + './defined', + './sampleTerrain', + './DeveloperError', + './Rectangle' +], function( + when, + binarySearch, + Cartographic, + defined, + sampleTerrain, + DeveloperError, + Rectangle) { + "use strict"; + + /** + * Reports the availability of tiles in a {@link TilingScheme}. + * + * @alias TileAvailability + * @constructor + * + * @param {TilingScheme} tilingScheme The tiling scheme in which to report availability. + * @param {Number} maximumLevel The maximum tile level that is potentially available. + */ + function TileAvailability(tilingScheme, maximumLevel) { + this._tilingScheme = tilingScheme; + this._maximumLevel = maximumLevel; + + this._rootNodes = []; + for (var y = 0; y < tilingScheme.getNumberOfYTilesAtLevel(); ++y) { + for (var x = 0; x < tilingScheme.getNumberOfXTilesAtLevel(); ++x) { + this._rootNodes.push(new QuadtreeNode(tilingScheme, undefined, 0, x, y)); + } + } + } + + var rectangleScratch = new Rectangle(); + + /** + * Marks a rectangular range of tiles in a particular level as being available. For best performance, + * add your ranges in order of increasing level. + * + * @param {Number} level The level. + * @param {Number} startX The X coordinate of the first available tiles at the level. + * @param {Number} startY The Y coordinate of the first available tiles at the level. + * @param {Number} endX The X coordinate of the last available tiles at the level. + * @param {Number} endY The Y coordinate of the last available tiles at the level. + */ + TileAvailability.prototype.addAvailableTileRange = function(level, startX, startY, endX, endY) { + var tilingScheme = this._tilingScheme; + + tilingScheme.tileXYToRectangle(startX, startY, level, rectangleScratch); + var west = rectangleScratch.west; + var north = rectangleScratch.north; + + tilingScheme.tileXYToRectangle(endX, endY, level, rectangleScratch); + var east = rectangleScratch.east; + var south = rectangleScratch.south; + + var rectangleWithLevel = new RectangleWithLevel(level, west, south, east, north); + + for (var i = 0; i < this._rootNodes.length; ++i) { + var rootNode = this._rootNodes[i]; + if (rectanglesOverlap(rootNode.extent, rectangleWithLevel)) { + putRectangleInQuadtree(this._maximumLevel, rootNode, rectangleWithLevel); + } + } + }; + + /** + * Determines the level of the most detailed tile covering the position. This function + * usually completes in time logarithmic to the number of rectangles added with + * {@link TileAvailability#addAvailableTileRange}. + * + * @param {Cartographic} position The position for which to determine the maximum available level. The height component is ignored. + * @return {Number} The level of the most detailed tile covering the position. + * @throws {DeveloperError} If position is outside any tile according to the tiling scheme. + */ + TileAvailability.prototype.computeMaximumLevelAtPosition = function(position) { + // Find the root node that contains this position. + var node; + for (var nodeIndex = 0; nodeIndex < this._rootNodes.length; ++nodeIndex) { + var rootNode = this._rootNodes[nodeIndex]; + if (rectangleContainsPosition(rootNode.extent, position)) { + node = rootNode; + break; + } + } + + if (!defined(node)) { + throw new DeveloperError('The specified position does not exist in any root node of the tiling scheme.'); + } + + return findMaxLevelFromNode(undefined, node, position); + }; + + var rectanglesScratch = []; + var remainingToCoverByLevelScratch = []; + var westScratch = new Rectangle(); + var eastScratch = new Rectangle(); + + /** + * Finds the most detailed level that is available _everywhere_ within a given rectangle. More detailed + * tiles may be available in parts of the rectangle, but not the whole thing. The return value of this + * function may be safely passed to {@link sampleTerrain} for any position within the rectangle. This function + * usually completes in time logarithmic to the number of rectangles added with + * {@link TileAvailability#addAvailableTileRange}. + * + * @param {Rectangle} rectangle The rectangle. + * @return {Number} The best available level for the entire rectangle. + */ + TileAvailability.prototype.computeBestAvailableLevelOverRectangle = function(rectangle) { + var rectangles = rectanglesScratch; + rectangles.length = 0; + + if (rectangle.east < rectangle.west) { + // Rectangle crosses the IDL, make it two rectangles. + rectangles.push(Rectangle.fromRadians(-Math.PI, rectangle.south, rectangle.east, rectangle.north, westScratch)); + rectangles.push(Rectangle.fromRadians(rectangle.west, rectangle.south, Math.PI, rectangle.north, eastScratch)); + } else { + rectangles.push(rectangle); + } + + var remainingToCoverByLevel = remainingToCoverByLevelScratch; + remainingToCoverByLevel.length = 0; + + var i; + for (i = 0; i < this._rootNodes.length; ++i) { + updateCoverageWithNode(remainingToCoverByLevel, this._rootNodes[i], rectangles); + } + + for (i = remainingToCoverByLevel.length - 1; i >= 0; --i) { + if (defined(remainingToCoverByLevel[i]) && remainingToCoverByLevel[i].length === 0) { + return i; + } + } + + return 0; + }; + + var cartographicScratch = new Cartographic(); + + /** + * Determines if a particular tile is available. + * @param {Number} level The tile level to check. + * @param {Number} x The X coordinate of the tile to check. + * @param {Number} y The Y coordinate of the tile to check. + * @return {Boolean} True if the tile is available; otherwise, false. + */ + TileAvailability.prototype.isTileAvailable = function(level, x, y) { + // Get the center of the tile and find the maximum level at that position. + // Because availability is by tile, if the level is available at that point, it + // is sure to be available for the whole tile. We assume that if a tile at level n exists, + // then all its parent tiles back to level 0 exist too. This isn't really enforced + // anywhere, but Cesium would never load a tile for which this is not true. + var rectangle = this._tilingScheme.tileXYToRectangle(x, y, level, rectangleScratch); + Rectangle.center(rectangle, cartographicScratch); + return this.computeMaximumLevelAtPosition(cartographicScratch) >= level; + }; + + /** + * Computes a bit mask indicating which of a tile's four children exist. + * If a child's bit is set, a tile is available for that child. If it is cleared, + * the tile is not available. The bit values are as follows: + * <table> + * <tr><th>Bit Position</th><th>Bit Value</th><th>Child Tile</th></tr> + * <tr><td>0</td><td>1</td><td>Southwest</td></tr> + * <tr><td>1</td><td>2</td><td>Southeast</td></tr> + * <tr><td>2</td><td>4</td><td>Northwest</td></tr> + * <tr><td>3</td><td>8</td><td>Northeast</td></tr> + * </table> + * + * @param {Number} level The level of the parent tile. + * @param {Number} x The X coordinate of the parent tile. + * @param {Number} y The Y coordinate of the parent tile. + * @return {Number} The bit mask indicating child availability. + */ + TileAvailability.prototype.computeChildMaskForTile = function(level, x, y) { + var childLevel = level + 1; + if (childLevel >= this._maximumLevel) { + return 0; + } + + var mask = 0; + + mask |= this.isTileAvailable(childLevel, 2 * x, 2 * y + 1) ? 1 : 0; + mask |= this.isTileAvailable(childLevel, 2 * x + 1, 2 * y + 1) ? 2 : 0; + mask |= this.isTileAvailable(childLevel, 2 * x, 2 * y) ? 4 : 0; + mask |= this.isTileAvailable(childLevel, 2 * x + 1, 2 * y) ? 8 : 0; + + return mask; + }; + + function QuadtreeNode(tilingScheme, parent, level, x, y) { + this.tilingScheme = tilingScheme; + this.parent = parent; + this.level = level; + this.x = x; + this.y = y; + this.extent = tilingScheme.tileXYToRectangle(x, y, level); + + this.rectangles = []; + this._sw = undefined; + this._se = undefined; + this._nw = undefined; + this._ne = undefined; + } + + Object.defineProperties(QuadtreeNode.prototype, { + nw: { + get: function() { + if (!this._nw) { + this._nw = new QuadtreeNode(this.tilingScheme, this, this.level + 1, this.x * 2, this.y * 2); + } + return this._nw; + } + }, + + ne: { + get: function() { + if (!this._ne) { + this._ne = new QuadtreeNode(this.tilingScheme, this, this.level + 1, this.x * 2 + 1, this.y * 2); + } + return this._ne; + } + }, + + sw: { + get: function() { + if (!this._sw) { + this._sw = new QuadtreeNode(this.tilingScheme, this, this.level + 1, this.x * 2, this.y * 2 + 1); + } + return this._sw; + } + }, + + se: { + get: function() { + if (!this._se) { + this._se = new QuadtreeNode(this.tilingScheme, this, this.level + 1, this.x * 2 + 1, this.y * 2 + 1); + } + return this._se; + } + } + }); + + function RectangleWithLevel(level, west, south, east, north) { + this.level = level; + this.west = west; + this.south = south; + this.east = east; + this.north = north; + } + + function rectanglesOverlap(rectangle1, rectangle2) { + var west = Math.max(rectangle1.west, rectangle2.west); + var south = Math.max(rectangle1.south, rectangle2.south); + var east = Math.min(rectangle1.east, rectangle2.east); + var north = Math.min(rectangle1.north, rectangle2.north); + return south < north && west < east; + } + + function putRectangleInQuadtree(maxDepth, node, rectangle) { + while (node.level < maxDepth) { + if (rectangleFullyContainsRectangle(node.nw.extent, rectangle)) { + node = node.nw; + } else if (rectangleFullyContainsRectangle(node.ne.extent, rectangle)) { + node = node.ne; + } else if (rectangleFullyContainsRectangle(node.sw.extent, rectangle)) { + node = node.sw; + } else if (rectangleFullyContainsRectangle(node.se.extent, rectangle)) { + node = node.se; + } else { + break; + } + } + + if (node.rectangles.length === 0 || node.rectangles[node.rectangles.length - 1].level <= rectangle.level) { + node.rectangles.push(rectangle); + } else { + // Maintain ordering by level when inserting. + var index = binarySearch(node.rectangles, rectangle.level, rectangleLevelComparator); + if (index <= 0) { + index = ~index; + } + node.rectangles.splice(index, 0, rectangle); + } + } + + function rectangleLevelComparator(a, b) { + return a.level - b; + } + + function rectangleFullyContainsRectangle(potentialContainer, rectangleToTest) { + return rectangleToTest.west >= potentialContainer.west && + rectangleToTest.east <= potentialContainer.east && + rectangleToTest.south >= potentialContainer.south && + rectangleToTest.north <= potentialContainer.north; + } + + function rectangleContainsPosition(potentialContainer, positionToTest) { + return positionToTest.longitude >= potentialContainer.west && + positionToTest.longitude <= potentialContainer.east && + positionToTest.latitude >= potentialContainer.south && + positionToTest.latitude <= potentialContainer.north; + } + + function findMaxLevelFromNode(stopNode, node, position) { + var maxLevel = 0; + + // Find the deepest quadtree node containing this point. + while (true) { + var nw = node._nw && rectangleContainsPosition(node._nw.extent, position); + var ne = node._ne && rectangleContainsPosition(node._ne.extent, position); + var sw = node._sw && rectangleContainsPosition(node._sw.extent, position); + var se = node._se && rectangleContainsPosition(node._se.extent, position); + + // The common scenario is that the point is in only one quadrant and we can simply + // iterate down the tree. But if the point is on a boundary between tiles, it is + // in multiple tiles and we need to check all of them, so use recursion. + if (nw + ne + sw + se > 1) { + if (nw) { + maxLevel = Math.max(maxLevel, findMaxLevelFromNode(node, node._nw, position)); + } + if (ne) { + maxLevel = Math.max(maxLevel, findMaxLevelFromNode(node, node._ne, position)); + } + if (sw) { + maxLevel = Math.max(maxLevel, findMaxLevelFromNode(node, node._sw, position)); + } + if (se) { + maxLevel = Math.max(maxLevel, findMaxLevelFromNode(node, node._se, position)); + } + break; + } else if (nw) { + node = node._nw; + } else if (ne) { + node = node._ne; + } else if (sw) { + node = node._sw; + } else if (se) { + node = node._se; + } else { + break; + } + } + + // Work up the tree until we find a rectangle that contains this point. + while (node !== stopNode) { + var rectangles = node.rectangles; + + // Rectangles are sorted by level, lowest first. + for (var i = rectangles.length - 1; i >= 0 && rectangles[i].level > maxLevel; --i) { + var rectangle = rectangles[i]; + if (rectangleContainsPosition(rectangle, position)) { + maxLevel = rectangle.level; + } + } + + node = node.parent; + } + + return maxLevel; + } + + function updateCoverageWithNode(remainingToCoverByLevel, node, rectanglesToCover) { + if (!node) { + return; + } + + var i; + var anyOverlap = false; + for (i = 0; i < rectanglesToCover.length; ++i) { + anyOverlap = anyOverlap || rectanglesOverlap(node.extent, rectanglesToCover[i]); + } + + if (!anyOverlap) { + // This node is not applicable to the rectangle(s). + return; + } + + var rectangles = node.rectangles; + for (i = 0; i < rectangles.length; ++i) { + var rectangle = rectangles[i]; + + if (!remainingToCoverByLevel[rectangle.level]) { + remainingToCoverByLevel[rectangle.level] = rectanglesToCover; + } + + remainingToCoverByLevel[rectangle.level] = subtractRectangle(remainingToCoverByLevel[rectangle.level], rectangle); + } + + // Update with child nodes. + updateCoverageWithNode(remainingToCoverByLevel, node._nw, rectanglesToCover); + updateCoverageWithNode(remainingToCoverByLevel, node._ne, rectanglesToCover); + updateCoverageWithNode(remainingToCoverByLevel, node._sw, rectanglesToCover); + updateCoverageWithNode(remainingToCoverByLevel, node._se, rectanglesToCover); + } + + function subtractRectangle(rectangleList, rectangleToSubtract) { + var result = []; + for (var i = 0; i < rectangleList.length; ++i) { + var rectangle = rectangleList[i]; + if (!rectanglesOverlap(rectangle, rectangleToSubtract)) { + // Disjoint rectangles. Original rectangle is unmodified. + result.push(rectangle); + } else { + // rectangleToSubtract partially or completely overlaps rectangle. + if (rectangle.west < rectangleToSubtract.west) { + result.push(new Rectangle(rectangle.west, rectangle.south, rectangleToSubtract.west, rectangle.north)); + } + if (rectangle.east > rectangleToSubtract.east) { + result.push(new Rectangle(rectangleToSubtract.east, rectangle.south, rectangle.east, rectangle.north)); + } + if (rectangle.south < rectangleToSubtract.south) { + result.push(new Rectangle(Math.max(rectangleToSubtract.west, rectangle.west), rectangle.south, Math.min(rectangleToSubtract.east, rectangle.east), rectangleToSubtract.south)); + } + if (rectangle.north > rectangleToSubtract.north) { + result.push(new Rectangle(Math.max(rectangleToSubtract.west, rectangle.west), rectangleToSubtract.north, Math.min(rectangleToSubtract.east, rectangle.east), rectangle.north)); + } + } + } + + return result; + } + + return TileAvailability; +}); + /*global define*/ define('Core/formatError',[ './defined' @@ -32819,8 +33065,11 @@ define('Core/CesiumTerrainProvider',[ './Math', './OrientedBoundingBox', './QuantizedMeshTerrainData', + './Rectangle', + './RuntimeError', './TerrainProvider', './throttleRequestByServer', + './TileAvailability', './TileProviderError' ], function( Uri, @@ -32842,8 +33091,11 @@ define('Core/CesiumTerrainProvider',[ CesiumMath, OrientedBoundingBox, QuantizedMeshTerrainData, + Rectangle, + RuntimeError, TerrainProvider, throttleRequestByServer, + TileAvailability, TileProviderError) { 'use strict'; @@ -32934,6 +33186,7 @@ define('Core/CesiumTerrainProvider',[ this._requestWaterMask = defaultValue(options.requestWaterMask, false); this._errorEvent = new Event(); + this._availability = undefined; var credit = options.credit; if (typeof credit === 'string') { @@ -32997,7 +33250,21 @@ define('Core/CesiumTerrainProvider',[ that._tileUrlTemplates[i] = joinUrls(baseUri, template).toString().replace('{version}', data.version); } - that._availableTiles = data.available; + var availableTiles = data.available; + + if (defined(availableTiles)) { + that._availability = new TileAvailability(that._tilingScheme, availableTiles.length); + + for (var level = 0; level < availableTiles.length; ++level) { + var rangesAtLevel = availableTiles[level]; + var yTiles = that._tilingScheme.getNumberOfYTilesAtLevel(level); + + for (var rangeIndex = 0; rangeIndex < rangesAtLevel.length; ++rangeIndex) { + var range = rangesAtLevel[rangeIndex]; + that._availability.addAvailableTileRange(level, range.startX, yTiles - range.endY - 1, range.endX, yTiles - range.startY - 1); + } + } + } if (!defined(that._credit) && defined(data.attribution) && data.attribution !== null) { that._credit = new Credit(data.attribution); @@ -33257,7 +33524,7 @@ define('Core/CesiumTerrainProvider',[ southSkirtHeight : skirtHeight, eastSkirtHeight : skirtHeight, northSkirtHeight : skirtHeight, - childTileMask: getChildMaskForTile(provider, level, x, tmsY), + childTileMask: provider.availability.computeChildMaskForTile(level, x, y), waterMask: waterMaskBuffer }); } @@ -33464,6 +33731,23 @@ define('Core/CesiumTerrainProvider',[ get : function() { return this._requestWaterMask; } + }, + + /** + * Gets an object that can be used to determine availability of terrain from this provider, such as + * at points and in rectangles. This function should not be called before + * {@link CesiumTerrainProvider#ready} returns true. This property may be undefined if availability + * information is not available. + * @memberof CesiumTerrainProvider.prototype + * @type {TileAvailability} + */ + availability : { + get : function() { + if (!this._ready) { + throw new DeveloperError('availability must not be called before the terrain provider is ready.'); + } + return this._availability; + } } }); @@ -33477,40 +33761,6 @@ define('Core/CesiumTerrainProvider',[ return this._levelZeroMaximumGeometricError / (1 << level); }; - function getChildMaskForTile(terrainProvider, level, x, y) { - var available = terrainProvider._availableTiles; - if (!available || available.length === 0) { - return 15; - } - - var childLevel = level + 1; - if (childLevel >= available.length) { - return 0; - } - - var levelAvailable = available[childLevel]; - - var mask = 0; - - mask |= isTileInRange(levelAvailable, 2 * x, 2 * y) ? 1 : 0; - mask |= isTileInRange(levelAvailable, 2 * x + 1, 2 * y) ? 2 : 0; - mask |= isTileInRange(levelAvailable, 2 * x, 2 * y + 1) ? 4 : 0; - mask |= isTileInRange(levelAvailable, 2 * x + 1, 2 * y + 1) ? 8 : 0; - - return mask; - } - - function isTileInRange(levelAvailable, x, y) { - for (var i = 0, len = levelAvailable.length; i < len; ++i) { - var range = levelAvailable[i]; - if (x >= range.startX && x <= range.endX && y >= range.startY && y <= range.endY) { - return true; - } - } - - return false; - } - /** * Determines whether data for a tile is available to be loaded. * @@ -33520,19 +33770,10 @@ define('Core/CesiumTerrainProvider',[ * @returns {Boolean} Undefined if not supported, otherwise true or false. */ CesiumTerrainProvider.prototype.getTileDataAvailable = function(x, y, level) { - var available = this._availableTiles; - - if (!available || available.length === 0) { + if (!defined(this.availability)) { return undefined; - } else { - if (level >= available.length) { - return false; - } - var levelAvailable = available[level]; - var yTiles = this._tilingScheme.getNumberOfYTilesAtLevel(level); - var tmsY = (yTiles - y - 1); - return isTileInRange(levelAvailable, x, tmsY); } + return this.availability.isTileAvailable(level, x, y); }; return CesiumTerrainProvider; @@ -33940,6 +34181,118 @@ define('Core/GeometryInstance',[ return GeometryInstance; }); +/*global define*/ +define('Core/oneTimeWarning',[ + './defaultValue', + './defined', + './DeveloperError' + ], function( + defaultValue, + defined, + DeveloperError) { + "use strict"; + + var warnings = {}; + + /** + * Logs a one time message to the console. Use this function instead of + * <code>console.log</code> directly since this does not log duplicate messages + * unless it is called from multiple workers. + * + * @exports oneTimeWarning + * + * @param {String} identifier The unique identifier for this warning. + * @param {String} [message=identifier] The message to log to the console. + * + * @example + * for(var i=0;i<foo.length;++i) { + * if (!defined(foo[i].bar)) { + * // Something that can be recovered from but may happen a lot + * oneTimeWarning('foo.bar undefined', 'foo.bar is undefined. Setting to 0.'); + * foo[i].bar = 0; + * // ... + * } + * } + * + * @private + */ + function oneTimeWarning(identifier, message) { + if (!defined(identifier)) { + throw new DeveloperError('identifier is required.'); + } + + if (!defined(warnings[identifier])) { + warnings[identifier] = true; + console.warn(defaultValue(message, identifier)); + } + } + + oneTimeWarning.geometryOutlines = 'Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.'; + + return oneTimeWarning; +}); + +/*global define*/ +define('Core/deprecationWarning',[ + './defined', + './DeveloperError', + './oneTimeWarning' + ], function( + defined, + DeveloperError, + oneTimeWarning) { + 'use strict'; + + /** + * Logs a deprecation message to the console. Use this function instead of + * <code>console.log</code> directly since this does not log duplicate messages + * unless it is called from multiple workers. + * + * @exports deprecationWarning + * + * @param {String} identifier The unique identifier for this deprecated API. + * @param {String} message The message to log to the console. + * + * @example + * // Deprecated function or class + * function Foo() { + * deprecationWarning('Foo', 'Foo was deprecated in Cesium 1.01. It will be removed in 1.03. Use newFoo instead.'); + * // ... + * } + * + * // Deprecated function + * Bar.prototype.func = function() { + * deprecationWarning('Bar.func', 'Bar.func() was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newFunc() instead.'); + * // ... + * }; + * + * // Deprecated property + * defineProperties(Bar.prototype, { + * prop : { + * get : function() { + * deprecationWarning('Bar.prop', 'Bar.prop was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newProp instead.'); + * // ... + * }, + * set : function(value) { + * deprecationWarning('Bar.prop', 'Bar.prop was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newProp instead.'); + * // ... + * } + * } + * }); + * + * @private + */ + function deprecationWarning(identifier, message) { + if (!defined(identifier) || !defined(message)) { + throw new DeveloperError('identifier and message are required.'); + } + + oneTimeWarning(identifier, message); + } + + return deprecationWarning; +}); + /*global define*/ define('Core/EncodedCartesian3',[ './Cartesian3', @@ -34429,6 +34782,7 @@ define('Core/GeometryPipeline',[ './ComponentDatatype', './defaultValue', './defined', + './deprecationWarning', './DeveloperError', './EncodedCartesian3', './GeographicProjection', @@ -34455,6 +34809,7 @@ define('Core/GeometryPipeline',[ ComponentDatatype, defaultValue, defined, + deprecationWarning, DeveloperError, EncodedCartesian3, GeographicProjection, @@ -34588,7 +34943,7 @@ define('Core/GeometryPipeline',[ /** * Creates a new {@link Geometry} with <code>LINES</code> representing the provided * attribute (<code>attributeName</code>) for the provided geometry. This is used to - * visualize vector attributes like normals, binormals, and tangents. + * visualize vector attributes like normals, tangents, and bitangents. * * @param {Geometry} geometry The <code>Geometry</code> instance with the attribute. * @param {String} [attributeName='normal'] The name of the attribute. @@ -34598,7 +34953,7 @@ define('Core/GeometryPipeline',[ * @exception {DeveloperError} geometry.attributes must have an attribute with the same name as the attributeName parameter. * * @example - * var geometry = Cesium.GeometryPipeline.createLineSegmentsForVectors(instance.geometry, 'binormal', 100000.0); + * var geometry = Cesium.GeometryPipeline.createLineSegmentsForVectors(instance.geometry, 'bitangent', 100000.0); */ GeometryPipeline.createLineSegmentsForVectors = function(geometry, attributeName, length) { attributeName = defaultValue(attributeName, 'normal'); @@ -34690,8 +35045,11 @@ define('Core/GeometryPipeline',[ // From VertexFormat 'normal', 'st', - 'binormal', 'tangent', + 'bitangent', + + // For shadow volumes + 'extrudeDirection', // From compressing texture coordinates and normals 'compressedAttributes' @@ -34733,7 +35091,7 @@ define('Core/GeometryPipeline',[ * * @example * geometry = Cesium.GeometryPipeline.reorderForPreVertexCache(geometry); - * + * * @see GeometryPipeline.reorderForPostVertexCache */ GeometryPipeline.reorderForPreVertexCache = function(geometry) { @@ -34818,7 +35176,7 @@ define('Core/GeometryPipeline',[ * * @example * geometry = Cesium.GeometryPipeline.reorderForPostVertexCache(geometry); - * + * * @see GeometryPipeline.reorderForPreVertexCache * @see {@link http://gfx.cs.princ0eton.edu/pubs/Sander_2007_%3ETR/tipsy.pdf|Fast Triangle Reordering for Vertex Locality and Reduced Overdraw} * by Sander, Nehab, and Barczak @@ -35170,7 +35528,7 @@ define('Core/GeometryPipeline',[ * Transforms a geometry instance to world coordinates. This changes * the instance's <code>modelMatrix</code> to {@link Matrix4.IDENTITY} and transforms the * following attributes if they are present: <code>position</code>, <code>normal</code>, - * <code>binormal</code>, and <code>tangent</code>. + * <code>tangent</code>, and <code>bitangent</code>. * * @param {GeometryInstance} instance The geometry instance to modify. * @returns {GeometryInstance} The modified <code>instance</code> argument, with its attributes transforms to world coordinates. @@ -35198,16 +35556,16 @@ define('Core/GeometryPipeline',[ transformPoint(modelMatrix, attributes.nextPosition); if ((defined(attributes.normal)) || - (defined(attributes.binormal)) || - (defined(attributes.tangent))) { + (defined(attributes.tangent)) || + (defined(attributes.bitangent))) { Matrix4.inverse(modelMatrix, inverseTranspose); Matrix4.transpose(inverseTranspose, inverseTranspose); Matrix4.getRotation(inverseTranspose, normalMatrix); transformVector(normalMatrix, attributes.normal); - transformVector(normalMatrix, attributes.binormal); transformVector(normalMatrix, attributes.tangent); + transformVector(normalMatrix, attributes.bitangent); } var boundingSphere = instance.geometry.boundingSphere; @@ -35397,7 +35755,7 @@ define('Core/GeometryPipeline',[ * <p> * This is used by {@link Primitive} to efficiently render a large amount of static data. * </p> - * + * * @private * * @param {GeometryInstance[]} [instances] The array of {@link GeometryInstance} objects whose geometry will be combined. @@ -35413,7 +35771,7 @@ define('Core/GeometryPipeline',[ * Cesium.GeometryPipeline.transformToWorldCoordinates(instances[i]); * } * var geometries = Cesium.GeometryPipeline.combineInstances(instances); - * + * * @see GeometryPipeline.transformToWorldCoordinates */ GeometryPipeline.combineInstances = function(instances) { @@ -35589,8 +35947,8 @@ define('Core/GeometryPipeline',[ var tScratch = new Cartesian3(); /** - * Computes per-vertex binormals and tangents for a geometry containing <code>TRIANGLES</code>. - * The result is new <code>binormal</code> and <code>tangent</code> attributes added to the geometry. + * Computes per-vertex tangents and bitangents for a geometry containing <code>TRIANGLES</code>. + * The result is new <code>tangent</code> and <code>bitangent</code> attributes added to the geometry. * This assumes a counter-clockwise winding order. * <p> * Based on <a href="http://www.terathon.com/code/tangent.html">Computing Tangent Space Basis Vectors @@ -35598,15 +35956,15 @@ define('Core/GeometryPipeline',[ * </p> * * @param {Geometry} geometry The geometry to modify. - * @returns {Geometry} The modified <code>geometry</code> argument with the computed <code>binormal</code> and <code>tangent</code> attributes. + * @returns {Geometry} The modified <code>geometry</code> argument with the computed <code>tangent</code> and <code>bitangent</code> attributes. * * @exception {DeveloperError} geometry.indices length must be greater than 0 and be a multiple of 3. * @exception {DeveloperError} geometry.primitiveType must be {@link PrimitiveType.TRIANGLES}. * * @example - * Cesium.GeometryPipeline.computeBinormalAndTangent(geometry); + * Cesium.GeometryPipeline.computeTangentAndBiTangent(geometry); */ - GeometryPipeline.computeBinormalAndTangent = function(geometry) { + GeometryPipeline.computeTangentAndBitangent = function(geometry) { if (!defined(geometry)) { throw new DeveloperError('geometry is required.'); } @@ -35686,8 +36044,8 @@ define('Core/GeometryPipeline',[ tan1[i23 + 2] += sdirz; } - var binormalValues = new Float32Array(numVertices * 3); var tangentValues = new Float32Array(numVertices * 3); + var bitangentValues = new Float32Array(numVertices * 3); for (i = 0; i < numVertices; i++) { i03 = i * 3; @@ -35706,9 +36064,9 @@ define('Core/GeometryPipeline',[ Cartesian3.normalize(Cartesian3.cross(n, t, t), t); - binormalValues[i03] = t.x; - binormalValues[i13] = t.y; - binormalValues[i23] = t.z; + bitangentValues[i03] = t.x; + bitangentValues[i13] = t.y; + bitangentValues[i23] = t.z; } geometry.attributes.tangent = new GeometryAttribute({ @@ -35717,20 +36075,48 @@ define('Core/GeometryPipeline',[ values : tangentValues }); - geometry.attributes.binormal = new GeometryAttribute({ + geometry.attributes.bitangent = new GeometryAttribute({ componentDatatype : ComponentDatatype.FLOAT, componentsPerAttribute : 3, - values : binormalValues + values : bitangentValues }); return geometry; }; + /** + * Computes per-vertex binormal and tangents for a geometry containing <code>TRIANGLES</code>. + * The result is new <code>binormal</code> and <code>tangent</code> attributes added to the geometry. + * This assumes a counter-clockwise winding order. + * <p> + * Based on <a href="http://www.terathon.com/code/tangent.html">Computing Tangent Space Basis Vectors + * for an Arbitrary Mesh</a> by Eric Lengyel. + * </p> + * + * @param {Geometry} geometry The geometry to modify. + * @returns {Geometry} The modified <code>geometry</code> argument with the computed <code>binormal</code> and <code>tangent</code> attributes. + * + * @exception {DeveloperError} geometry.indices length must be greater than 0 and be a multiple of 3. + * @exception {DeveloperError} geometry.primitiveType must be {@link PrimitiveType.TRIANGLES}. + * + * @example + * Cesium.GeometryPipeline.computeBinormalAndTangent(geometry); + * + * @see GeometryPipeline.computeTangentAndBitangent + */ + GeometryPipeline.computeBinormalAndTangent = function(geometry) { + deprecationWarning('computeBinormalAndTangent', 'computeBinormalAndTangent was deprecated in 1.30. It will be removed in 1.31. Use a computeTangentAndBitangent.'); + GeometryPipeline.computeTangentAndBitangent(geometry); + geometry.attributes.binormal = geometry.attributes.bitangent; + + return geometry; + }; + var scratchCartesian2 = new Cartesian2(); var toEncode1 = new Cartesian3(); var toEncode2 = new Cartesian3(); var toEncode3 = new Cartesian3(); - + var encodeResult2 = new Cartesian2(); /** * Compresses and packs geometry normal attribute values to save memory. * @@ -35745,73 +36131,109 @@ define('Core/GeometryPipeline',[ throw new DeveloperError('geometry is required.'); } + var extrudeAttribute = geometry.attributes.extrudeDirection; + var i; + var numVertices; + if (defined(extrudeAttribute)) { + //only shadow volumes use extrudeDirection, and shadow volumes use vertexFormat: POSITION_ONLY so we don't need to check other attributes + var extrudeDirections = extrudeAttribute.values; + numVertices = extrudeDirections.length / 3.0; + var compressedDirections = new Float32Array(numVertices * 2); + + var i2 = 0; + for (i = 0; i < numVertices; ++i) { + Cartesian3.fromArray(extrudeDirections, i * 3.0, toEncode1); + if (Cartesian3.equals(toEncode1, Cartesian3.ZERO)) { + i2 += 2; + continue; + } + encodeResult2 = AttributeCompression.octEncodeInRange(toEncode1, 65535, encodeResult2); + compressedDirections[i2++] = encodeResult2.x; + compressedDirections[i2++] = encodeResult2.y; + } + + geometry.attributes.compressedAttributes = new GeometryAttribute({ + componentDatatype : ComponentDatatype.FLOAT, + componentsPerAttribute : 2, + values : compressedDirections + }); + delete geometry.attributes.extrudeDirection; + return geometry; + } + var normalAttribute = geometry.attributes.normal; var stAttribute = geometry.attributes.st; - if (!defined(normalAttribute) && !defined(stAttribute)) { + + var hasNormal = defined(normalAttribute); + var hasSt = defined(stAttribute); + if (!hasNormal && !hasSt) { return geometry; } var tangentAttribute = geometry.attributes.tangent; - var binormalAttribute = geometry.attributes.binormal; + var bitangentAttribute = geometry.attributes.bitangent; + + var hasTangent = defined(tangentAttribute); + var hasBitangent = defined(bitangentAttribute); var normals; var st; var tangents; - var binormals; + var bitangents; - if (defined(normalAttribute)) { + if (hasNormal) { normals = normalAttribute.values; } - if (defined(stAttribute)) { + if (hasSt) { st = stAttribute.values; } - if (defined(tangentAttribute)) { + if (hasTangent) { tangents = tangentAttribute.values; } - if (binormalAttribute) { - binormals = binormalAttribute.values; + if (hasBitangent) { + bitangents = bitangentAttribute.values; } - var length = defined(normals) ? normals.length : st.length; - var numComponents = defined(normals) ? 3.0 : 2.0; - var numVertices = length / numComponents; + var length = hasNormal ? normals.length : st.length; + var numComponents = hasNormal ? 3.0 : 2.0; + numVertices = length / numComponents; var compressedLength = numVertices; - var numCompressedComponents = defined(st) && defined(normals) ? 2.0 : 1.0; - numCompressedComponents += defined(tangents) || defined(binormals) ? 1.0 : 0.0; + var numCompressedComponents = hasSt && hasNormal ? 2.0 : 1.0; + numCompressedComponents += hasTangent || hasBitangent ? 1.0 : 0.0; compressedLength *= numCompressedComponents; var compressedAttributes = new Float32Array(compressedLength); var normalIndex = 0; - for (var i = 0; i < numVertices; ++i) { - if (defined(st)) { + for (i = 0; i < numVertices; ++i) { + if (hasSt) { Cartesian2.fromArray(st, i * 2.0, scratchCartesian2); compressedAttributes[normalIndex++] = AttributeCompression.compressTextureCoordinates(scratchCartesian2); } var index = i * 3.0; - if (defined(normals) && defined(tangents) && defined(binormals)) { + if (hasNormal && defined(tangents) && defined(bitangents)) { Cartesian3.fromArray(normals, index, toEncode1); Cartesian3.fromArray(tangents, index, toEncode2); - Cartesian3.fromArray(binormals, index, toEncode3); + Cartesian3.fromArray(bitangents, index, toEncode3); AttributeCompression.octPack(toEncode1, toEncode2, toEncode3, scratchCartesian2); compressedAttributes[normalIndex++] = scratchCartesian2.x; compressedAttributes[normalIndex++] = scratchCartesian2.y; } else { - if (defined(normals)) { + if (hasNormal) { Cartesian3.fromArray(normals, index, toEncode1); compressedAttributes[normalIndex++] = AttributeCompression.octEncodeFloat(toEncode1); } - if (defined(tangents)) { + if (hasTangent) { Cartesian3.fromArray(tangents, index, toEncode1); compressedAttributes[normalIndex++] = AttributeCompression.octEncodeFloat(toEncode1); } - if (defined(binormals)) { - Cartesian3.fromArray(binormals, index, toEncode1); + if (hasBitangent) { + Cartesian3.fromArray(bitangents, index, toEncode1); compressedAttributes[normalIndex++] = AttributeCompression.octEncodeFloat(toEncode1); } } @@ -35823,17 +36245,17 @@ define('Core/GeometryPipeline',[ values : compressedAttributes }); - if (defined(normals)) { + if (hasNormal) { delete geometry.attributes.normal; } - if (defined(st)) { + if (hasSt) { delete geometry.attributes.st; } - if (defined(tangents)) { - delete geometry.attributes.tangent; + if (hasBitangent) { + delete geometry.attributes.bitangent; } - if (defined(binormals)) { - delete geometry.attributes.binormal; + if (hasTangent) { + delete geometry.attributes.tangent; } return geometry; @@ -36250,8 +36672,8 @@ define('Core/GeometryPipeline',[ var s1Scratch = new Cartesian2(); var s2Scratch = new Cartesian2(); - function computeTriangleAttributes(i0, i1, i2, point, positions, normals, binormals, tangents, texCoords, currentAttributes, insertedIndex) { - if (!defined(normals) && !defined(binormals) && !defined(tangents) && !defined(texCoords)) { + function computeTriangleAttributes(i0, i1, i2, point, positions, normals, tangents, bitangents, texCoords, extrudeDirections, currentAttributes, insertedIndex) { + if (!defined(normals) && !defined(tangents) && !defined(bitangents) && !defined(texCoords) && !defined(extrudeDirections)) { return; } @@ -36276,20 +36698,27 @@ define('Core/GeometryPipeline',[ Cartesian3.pack(normal, currentAttributes.normal.values, insertedIndex * 3); } - if (defined(binormals)) { - var b0 = Cartesian3.fromArray(binormals, i0 * 3, p0Scratch); - var b1 = Cartesian3.fromArray(binormals, i1 * 3, p1Scratch); - var b2 = Cartesian3.fromArray(binormals, i2 * 3, p2Scratch); - - Cartesian3.multiplyByScalar(b0, coords.x, b0); - Cartesian3.multiplyByScalar(b1, coords.y, b1); - Cartesian3.multiplyByScalar(b2, coords.z, b2); + if (defined(extrudeDirections)) { + var d0 = Cartesian3.fromArray(extrudeDirections, i0 * 3, p0Scratch); + var d1 = Cartesian3.fromArray(extrudeDirections, i1 * 3, p1Scratch); + var d2 = Cartesian3.fromArray(extrudeDirections, i2 * 3, p2Scratch); - var binormal = Cartesian3.add(b0, b1, b0); - Cartesian3.add(binormal, b2, binormal); - Cartesian3.normalize(binormal, binormal); + Cartesian3.multiplyByScalar(d0, coords.x, d0); + Cartesian3.multiplyByScalar(d1, coords.y, d1); + Cartesian3.multiplyByScalar(d2, coords.z, d2); - Cartesian3.pack(binormal, currentAttributes.binormal.values, insertedIndex * 3); + var direction; + if (!Cartesian3.equals(d0, Cartesian3.ZERO) || !Cartesian3.equals(d1, Cartesian3.ZERO) || !Cartesian3.equals(d2, Cartesian3.ZERO)) { + direction = Cartesian3.add(d0, d1, d0); + Cartesian3.add(direction, d2, direction); + Cartesian3.normalize(direction, direction); + } else { + direction = p0Scratch; + direction.x = 0; + direction.y = 0; + direction.z = 0; + } + Cartesian3.pack(direction, currentAttributes.extrudeDirection.values, insertedIndex * 3); } if (defined(tangents)) { @@ -36308,6 +36737,22 @@ define('Core/GeometryPipeline',[ Cartesian3.pack(tangent, currentAttributes.tangent.values, insertedIndex * 3); } + if (defined(bitangents)) { + var b0 = Cartesian3.fromArray(bitangents, i0 * 3, p0Scratch); + var b1 = Cartesian3.fromArray(bitangents, i1 * 3, p1Scratch); + var b2 = Cartesian3.fromArray(bitangents, i2 * 3, p2Scratch); + + Cartesian3.multiplyByScalar(b0, coords.x, b0); + Cartesian3.multiplyByScalar(b1, coords.y, b1); + Cartesian3.multiplyByScalar(b2, coords.z, b2); + + var bitangent = Cartesian3.add(b0, b1, b0); + Cartesian3.add(bitangent, b2, bitangent); + Cartesian3.normalize(bitangent, bitangent); + + Cartesian3.pack(bitangent, currentAttributes.bitangent.values, insertedIndex * 3); + } + if (defined(texCoords)) { var s0 = Cartesian2.fromArray(texCoords, i0 * 2, s0Scratch); var s1 = Cartesian2.fromArray(texCoords, i1 * 2, s1Scratch); @@ -36352,9 +36797,10 @@ define('Core/GeometryPipeline',[ var attributes = geometry.attributes; var positions = attributes.position.values; var normals = (defined(attributes.normal)) ? attributes.normal.values : undefined; - var binormals = (defined(attributes.binormal)) ? attributes.binormal.values : undefined; + var bitangents = (defined(attributes.bitangent)) ? attributes.bitangent.values : undefined; var tangents = (defined(attributes.tangent)) ? attributes.tangent.values : undefined; var texCoords = (defined(attributes.st)) ? attributes.st.values : undefined; + var extrudeDirections = (defined(attributes.extrudeDirection)) ? attributes.extrudeDirection.values : undefined; var indices = geometry.indices; var eastGeometry = copyGeometryForSplit(geometry); @@ -36408,7 +36854,7 @@ define('Core/GeometryPipeline',[ } insertedIndex = insertSplitPoint(currentAttributes, currentIndices, currentIndexMap, indices, resultIndex < 3 ? i + resultIndex : -1, point); - computeTriangleAttributes(i0, i1, i2, point, positions, normals, binormals, tangents, texCoords, currentAttributes, insertedIndex); + computeTriangleAttributes(i0, i1, i2, point, positions, normals, tangents, bitangents, texCoords, extrudeDirections, currentAttributes, insertedIndex); } } else { if (defined(result)) { @@ -36428,13 +36874,13 @@ define('Core/GeometryPipeline',[ } insertedIndex = insertSplitPoint(currentAttributes, currentIndices, currentIndexMap, indices, i, p0); - computeTriangleAttributes(i0, i1, i2, p0, positions, normals, binormals, tangents, texCoords, currentAttributes, insertedIndex); + computeTriangleAttributes(i0, i1, i2, p0, positions, normals, tangents, bitangents, texCoords, extrudeDirections, currentAttributes, insertedIndex); insertedIndex = insertSplitPoint(currentAttributes, currentIndices, currentIndexMap, indices, i + 1, p1); - computeTriangleAttributes(i0, i1, i2, p1, positions, normals, binormals, tangents, texCoords, currentAttributes, insertedIndex); + computeTriangleAttributes(i0, i1, i2, p1, positions, normals, tangents, bitangents, texCoords, extrudeDirections, currentAttributes, insertedIndex); insertedIndex = insertSplitPoint(currentAttributes, currentIndices, currentIndexMap, indices, i + 2, p2); - computeTriangleAttributes(i0, i1, i2, p2, positions, normals, binormals, tangents, texCoords, currentAttributes, insertedIndex); + computeTriangleAttributes(i0, i1, i2, p2, positions, normals, tangents, bitangents, texCoords, extrudeDirections, currentAttributes, insertedIndex); } } @@ -36929,7 +37375,7 @@ define('Core/EllipseGeometry',[ var scratchNormal = new Cartesian3(); var scratchTangent = new Cartesian3(); - var scratchBinormal = new Cartesian3(); + var scratchBitangent = new Cartesian3(); var scratchCartographic = new Cartographic(); var projectedCenterScratch = new Cartesian3(); @@ -36945,19 +37391,22 @@ define('Core/EllipseGeometry',[ var ellipsoid = options.ellipsoid; var stRotation = options.stRotation; var size = (extrude) ? positions.length / 3 * 2 : positions.length / 3; + var shadowVolume = options.shadowVolume; var textureCoordinates = (vertexFormat.st) ? new Float32Array(size * 2) : undefined; var normals = (vertexFormat.normal) ? new Float32Array(size * 3) : undefined; var tangents = (vertexFormat.tangent) ? new Float32Array(size * 3) : undefined; - var binormals = (vertexFormat.binormal) ? new Float32Array(size * 3) : undefined; + var bitangents = (vertexFormat.bitangent) ? new Float32Array(size * 3) : undefined; + + var extrudeNormals = (shadowVolume) ? new Float32Array(size * 3) : undefined; var textureCoordIndex = 0; // Raise positions to a height above the ellipsoid and compute the - // texture coordinates, normals, tangents, and binormals. + // texture coordinates, normals, tangents, and bitangents. var normal = scratchNormal; var tangent = scratchTangent; - var binormal = scratchBinormal; + var bitangent = scratchBitangent; var projection = new GeographicProjection(ellipsoid); var projectedCenter = projection.project(ellipsoid.cartesianToCartographic(center, scratchCartographic), projectedCenterScratch); @@ -37000,44 +37449,52 @@ define('Core/EllipseGeometry',[ textureCoordinates[textureCoordIndex++] = texCoordScratch.y; } - normal = ellipsoid.geodeticSurfaceNormal(position, normal); + if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent || shadowVolume) { + normal = ellipsoid.geodeticSurfaceNormal(position, normal); - if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.binormal) { - if (vertexFormat.tangent || vertexFormat.binormal) { - tangent = Cartesian3.normalize(Cartesian3.cross(Cartesian3.UNIT_Z, normal, tangent), tangent); - Matrix3.multiplyByVector(textureMatrix, tangent, tangent); + if (shadowVolume) { + extrudeNormals[i + bottomOffset] = -normal.x; + extrudeNormals[i1 + bottomOffset] = -normal.y; + extrudeNormals[i2 + bottomOffset] = -normal.z; } - if (vertexFormat.normal) { - normals[i] = normal.x; - normals[i1] = normal.y; - normals[i2] = normal.z; - if (extrude) { - normals[i + bottomOffset] = -normal.x; - normals[i1 + bottomOffset] = -normal.y; - normals[i2 + bottomOffset] = -normal.z; + + if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent) { + if (vertexFormat.tangent || vertexFormat.bitangent) { + tangent = Cartesian3.normalize(Cartesian3.cross(Cartesian3.UNIT_Z, normal, tangent), tangent); + Matrix3.multiplyByVector(textureMatrix, tangent, tangent); + } + if (vertexFormat.normal) { + normals[i] = normal.x; + normals[i1] = normal.y; + normals[i2] = normal.z; + if (extrude) { + normals[i + bottomOffset] = -normal.x; + normals[i1 + bottomOffset] = -normal.y; + normals[i2 + bottomOffset] = -normal.z; + } } - } - if (vertexFormat.tangent) { - tangents[i] = tangent.x; - tangents[i1] = tangent.y; - tangents[i2] = tangent.z; - if (extrude) { - tangents[i + bottomOffset] = -tangent.x; - tangents[i1 + bottomOffset] = -tangent.y; - tangents[i2 + bottomOffset] = -tangent.z; + if (vertexFormat.tangent) { + tangents[i] = tangent.x; + tangents[i1] = tangent.y; + tangents[i2] = tangent.z; + if (extrude) { + tangents[i + bottomOffset] = -tangent.x; + tangents[i1 + bottomOffset] = -tangent.y; + tangents[i2 + bottomOffset] = -tangent.z; + } } - } - if (vertexFormat.binormal) { - binormal = Cartesian3.normalize(Cartesian3.cross(normal, tangent, binormal), binormal); - binormals[i] = binormal.x; - binormals[i1] = binormal.y; - binormals[i2] = binormal.z; - if (extrude) { - binormals[i + bottomOffset] = binormal.x; - binormals[i1 + bottomOffset] = binormal.y; - binormals[i2 + bottomOffset] = binormal.z; + if (vertexFormat.bitangent) { + bitangent = Cartesian3.normalize(Cartesian3.cross(normal, tangent, bitangent), bitangent); + bitangents[i ] = bitangent.x; + bitangents[i1] = bitangent.y; + bitangents[i2] = bitangent.z; + if (extrude) { + bitangents[i + bottomOffset] = bitangent.x; + bitangents[i1 + bottomOffset] = bitangent.y; + bitangents[i2 + bottomOffset] = bitangent.z; + } } } } @@ -37086,13 +37543,22 @@ define('Core/EllipseGeometry',[ }); } - if (vertexFormat.binormal) { - attributes.binormal = new GeometryAttribute({ + if (vertexFormat.bitangent) { + attributes.bitangent = new GeometryAttribute({ + componentDatatype : ComponentDatatype.FLOAT, + componentsPerAttribute : 3, + values : bitangents + }); + } + + if (shadowVolume) { + attributes.extrudeDirection = new GeometryAttribute({ componentDatatype : ComponentDatatype.FLOAT, componentsPerAttribute : 3, - values : binormals + values : extrudeNormals }); } + return attributes; } @@ -37233,15 +37699,18 @@ define('Core/EllipseGeometry',[ var textureCoordinates = (vertexFormat.st) ? new Float32Array(size * 2) : undefined; var normals = (vertexFormat.normal) ? new Float32Array(size * 3) : undefined; var tangents = (vertexFormat.tangent) ? new Float32Array(size * 3) : undefined; - var binormals = (vertexFormat.binormal) ? new Float32Array(size * 3) : undefined; + var bitangents = (vertexFormat.bitangent) ? new Float32Array(size * 3) : undefined; + + var shadowVolume = options.shadowVolume; + var extrudeNormals = (shadowVolume) ? new Float32Array(size * 3) : undefined; var textureCoordIndex = 0; // Raise positions to a height above the ellipsoid and compute the - // texture coordinates, normals, tangents, and binormals. + // texture coordinates, normals, tangents, and bitangents. var normal = scratchNormal; var tangent = scratchTangent; - var binormal = scratchBinormal; + var bitangent = scratchBitangent; var projection = new GeographicProjection(ellipsoid); var projectedCenter = projection.project(ellipsoid.cartesianToCartographic(center, scratchCartographic), projectedCenterScratch); @@ -37285,6 +37754,13 @@ define('Core/EllipseGeometry',[ position = ellipsoid.scaleToGeodeticSurface(position, position); extrudedPosition = Cartesian3.clone(position, scratchCartesian2); normal = ellipsoid.geodeticSurfaceNormal(position, normal); + + if (shadowVolume) { + extrudeNormals[i + length] = -normal.x; + extrudeNormals[i1 + length] = -normal.y; + extrudeNormals[i2 + length] = -normal.z; + } + var scaledNormal = Cartesian3.multiplyByScalar(normal, height, scratchCartesian4); position = Cartesian3.add(position, scaledNormal, position); scaledNormal = Cartesian3.multiplyByScalar(normal, extrudedHeight, scaledNormal); @@ -37300,9 +37776,9 @@ define('Core/EllipseGeometry',[ finalPositions[i2] = position.z; } - if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.binormal) { + if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent) { - binormal = Cartesian3.clone(normal, binormal); + bitangent = Cartesian3.clone(normal, bitangent); var next = Cartesian3.fromArray(positions, (i + 3) % length, scratchCartesian4); Cartesian3.subtract(next, position, next); var bottom = Cartesian3.subtract(extrudedPosition, position, scratchCartesian3); @@ -37320,7 +37796,7 @@ define('Core/EllipseGeometry',[ } if (vertexFormat.tangent) { - tangent = Cartesian3.normalize(Cartesian3.cross(binormal, normal, tangent), tangent); + tangent = Cartesian3.normalize(Cartesian3.cross(bitangent, normal, tangent), tangent); tangents[i] = tangent.x; tangents[i1] = tangent.y; tangents[i2] = tangent.z; @@ -37330,14 +37806,14 @@ define('Core/EllipseGeometry',[ tangents[i + 2 + length] = tangent.z; } - if (vertexFormat.binormal) { - binormals[i] = binormal.x; - binormals[i1] = binormal.y; - binormals[i2] = binormal.z; + if (vertexFormat.bitangent) { + bitangents[i ] = bitangent.x; + bitangents[i1] = bitangent.y; + bitangents[i2] = bitangent.z; - binormals[i + length] = binormal.x; - binormals[i1 + length] = binormal.y; - binormals[i2 + length] = binormal.z; + bitangents[i + length] = bitangent.x; + bitangents[i1 + length] = bitangent.y; + bitangents[i2 + length] = bitangent.z; } } } @@ -37384,13 +37860,22 @@ define('Core/EllipseGeometry',[ }); } - if (vertexFormat.binormal) { - attributes.binormal = new GeometryAttribute({ + if (vertexFormat.bitangent) { + attributes.bitangent = new GeometryAttribute({ + componentDatatype : ComponentDatatype.FLOAT, + componentsPerAttribute : 3, + values : bitangents + }); + } + + if (shadowVolume) { + attributes.extrudeDirection = new GeometryAttribute({ componentDatatype : ComponentDatatype.FLOAT, componentsPerAttribute : 3, - values : binormals + values : extrudeNormals }); } + return attributes; } @@ -37586,6 +38071,7 @@ define('Core/EllipseGeometry',[ this._vertexFormat = VertexFormat.clone(vertexFormat); this._extrudedHeight = defaultValue(extrudedHeight, height); this._extrude = extrude; + this._shadowVolume = defaultValue(options.shadowVolume, false); this._workerName = 'createEllipseGeometry'; this._rectangle = computeRectangle(this._center, this._ellipsoid, semiMajorAxis, semiMinorAxis, this._rotation); @@ -37595,7 +38081,7 @@ define('Core/EllipseGeometry',[ * The number of elements used to pack the object into an array. * @type {Number} */ - EllipseGeometry.packedLength = Cartesian3.packedLength + Ellipsoid.packedLength + VertexFormat.packedLength + Rectangle.packedLength + 8; + EllipseGeometry.packedLength = Cartesian3.packedLength + Ellipsoid.packedLength + VertexFormat.packedLength + Rectangle.packedLength + 9; /** * Stores the provided instance into the provided array. @@ -37635,7 +38121,8 @@ define('Core/EllipseGeometry',[ array[startingIndex++] = value._height; array[startingIndex++] = value._granularity; array[startingIndex++] = value._extrudedHeight; - array[startingIndex] = value._extrude ? 1.0 : 0.0; + array[startingIndex++] = value._extrude ? 1.0 : 0.0; + array[startingIndex] = value._shadowVolume ? 1.0 : 0.0; return array; }; @@ -37654,7 +38141,8 @@ define('Core/EllipseGeometry',[ stRotation : undefined, height : undefined, granularity : undefined, - extrudedHeight : undefined + extrudedHeight : undefined, + shadowVolume: undefined }; /** @@ -37691,7 +38179,8 @@ define('Core/EllipseGeometry',[ var height = array[startingIndex++]; var granularity = array[startingIndex++]; var extrudedHeight = array[startingIndex++]; - var extrude = array[startingIndex] === 1.0; + var extrude = array[startingIndex++] === 1.0; + var shadowVolume = array[startingIndex] === 1.0; if (!defined(result)) { scratchOptions.height = height; @@ -37701,6 +38190,7 @@ define('Core/EllipseGeometry',[ scratchOptions.rotation = rotation; scratchOptions.semiMajorAxis = semiMajorAxis; scratchOptions.semiMinorAxis = semiMinorAxis; + scratchOptions.shadowVolume = shadowVolume; return new EllipseGeometry(scratchOptions); } @@ -37715,6 +38205,7 @@ define('Core/EllipseGeometry',[ result._granularity = granularity; result._extrudedHeight = extrudedHeight; result._extrude = extrude; + result._shadowVolume = shadowVolume; result._rectangle = Rectangle.clone(rectangle); return result; @@ -37748,6 +38239,7 @@ define('Core/EllipseGeometry',[ if (ellipseGeometry._extrude) { options.extrudedHeight = Math.min(ellipseGeometry._extrudedHeight, ellipseGeometry._height); options.height = Math.max(ellipseGeometry._extrudedHeight, ellipseGeometry._height); + options.shadowVolume = ellipseGeometry._shadowVolume; geometry = computeExtrudedEllipse(options); } else { geometry = computeEllipse(options); @@ -37781,7 +38273,8 @@ define('Core/EllipseGeometry',[ granularity : granularity, extrudedHeight : minHeight, height : maxHeight, - vertexFormat : VertexFormat.POSITION_ONLY + vertexFormat : VertexFormat.POSITION_ONLY, + shadowVolume: true }); }; @@ -37802,6 +38295,7 @@ define('Core/EllipseGeometry',[ /*global define*/ define('Core/CircleGeometry',[ './Cartesian3', + './Check', './defaultValue', './defined', './defineProperties', @@ -37811,6 +38305,7 @@ define('Core/CircleGeometry',[ './VertexFormat' ], function( Cartesian3, + Check, defaultValue, defined, defineProperties, @@ -37854,9 +38349,7 @@ define('Core/CircleGeometry',[ options = defaultValue(options, defaultValue.EMPTY_OBJECT); var radius = options.radius; - if (!defined(radius)) { - throw new DeveloperError('radius is required.'); - } + Check.typeOf.number('radius', radius); var ellipseGeometryOptions = { center : options.center, @@ -37867,7 +38360,8 @@ define('Core/CircleGeometry',[ extrudedHeight : options.extrudedHeight, granularity : options.granularity, vertexFormat : options.vertexFormat, - stRotation : options.stRotation + stRotation : options.stRotation, + shadowVolume: options.shadowVolume }; this._ellipseGeometry = new EllipseGeometry(ellipseGeometryOptions); this._workerName = 'createCircleGeometry'; @@ -37889,9 +38383,7 @@ define('Core/CircleGeometry',[ * @returns {Number[]} The array that was packed into */ CircleGeometry.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } + Check.typeOf.object('value', value); return EllipseGeometry.pack(value._ellipseGeometry, array, startingIndex); }; @@ -37910,7 +38402,8 @@ define('Core/CircleGeometry',[ vertexFormat : new VertexFormat(), stRotation : undefined, semiMajorAxis : undefined, - semiMinorAxis : undefined + semiMinorAxis : undefined, + shadowVolume: undefined }; /** @@ -37930,6 +38423,7 @@ define('Core/CircleGeometry',[ scratchOptions.granularity = ellipseGeometry._granularity; scratchOptions.vertexFormat = VertexFormat.clone(ellipseGeometry._vertexFormat, scratchOptions.vertexFormat); scratchOptions.stRotation = ellipseGeometry._stRotation; + scratchOptions.shadowVolume = ellipseGeometry._shadowVolume; if (!defined(result)) { scratchOptions.radius = ellipseGeometry._semiMajorAxis; @@ -37970,7 +38464,8 @@ define('Core/CircleGeometry',[ granularity : granularity, extrudedHeight : minHeight, height : maxHeight, - vertexFormat : VertexFormat.POSITION_ONLY + vertexFormat : VertexFormat.POSITION_ONLY, + shadowVolume: true }); }; @@ -38347,6 +38842,7 @@ define('Core/EllipseOutlineGeometry',[ /*global define*/ define('Core/CircleOutlineGeometry',[ './Cartesian3', + './Check', './defaultValue', './defined', './DeveloperError', @@ -38354,6 +38850,7 @@ define('Core/CircleOutlineGeometry',[ './Ellipsoid' ], function( Cartesian3, + Check, defaultValue, defined, DeveloperError, @@ -38394,9 +38891,7 @@ define('Core/CircleOutlineGeometry',[ options = defaultValue(options, defaultValue.EMPTY_OBJECT); var radius = options.radius; - if (!defined(radius)) { - throw new DeveloperError('radius is required.'); - } + Check.typeOf.number('radius', radius); var ellipseGeometryOptions = { center : options.center, @@ -38428,9 +38923,7 @@ define('Core/CircleOutlineGeometry',[ * @returns {Number[]} The array that was packed into */ CircleOutlineGeometry.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } + Check.typeOf.object('value', value); return EllipseOutlineGeometry.pack(value._ellipseGeometry, array, startingIndex); }; @@ -41347,87 +41840,6 @@ define('Core/ColorGeometryInstanceAttribute',[ return ColorGeometryInstanceAttribute; }); -/*global define*/ -define('Core/combine',[ - './defaultValue', - './defined' - ], function( - defaultValue, - defined) { - 'use strict'; - - /** - * Merges two objects, copying their properties onto a new combined object. When two objects have the same - * property, the value of the property on the first object is used. If either object is undefined, - * it will be treated as an empty object. - * - * @example - * var object1 = { - * propOne : 1, - * propTwo : { - * value1 : 10 - * } - * } - * var object2 = { - * propTwo : 2 - * } - * var final = Cesium.combine(object1, object2); - * - * // final === { - * // propOne : 1, - * // propTwo : { - * // value1 : 10 - * // } - * // } - * - * @param {Object} [object1] The first object to merge. - * @param {Object} [object2] The second object to merge. - * @param {Boolean} [deep=false] Perform a recursive merge. - * @returns {Object} The combined object containing all properties from both objects. - * - * @exports combine - */ - function combine(object1, object2, deep) { - deep = defaultValue(deep, false); - - var result = {}; - - var object1Defined = defined(object1); - var object2Defined = defined(object2); - var property; - var object1Value; - var object2Value; - if (object1Defined) { - for (property in object1) { - if (object1.hasOwnProperty(property)) { - object1Value = object1[property]; - if (object2Defined && deep && typeof object1Value === 'object' && object2.hasOwnProperty(property)) { - object2Value = object2[property]; - if (typeof object2Value === 'object') { - result[property] = combine(object1Value, object2Value, deep); - } else { - result[property] = object1Value; - } - } else { - result[property] = object1Value; - } - } - } - } - if (object2Defined) { - for (property in object2) { - if (object2.hasOwnProperty(property) && !result.hasOwnProperty(property)) { - object2Value = object2[property]; - result[property] = object2Value; - } - } - } - return result; - } - - return combine; -}); - /*global define*/ define('Core/CornerType',[ './freezeObject' @@ -41804,6 +42216,7 @@ define('Core/EllipsoidGeodesic',[ * Provides the location of a point at the indicated portion along the geodesic. * * @param {Number} fraction The portion of the distance between the initial and final points. + * @param {Cartographic} result The object in which to store the result. * @returns {Cartographic} The location of the point along the geodesic. */ EllipsoidGeodesic.prototype.interpolateUsingFraction = function(fraction, result) { @@ -41814,6 +42227,7 @@ define('Core/EllipsoidGeodesic',[ * Provides the location of a point at the indicated distance along the geodesic. * * @param {Number} distance The distance from the inital point to the point of interest along the geodesic + * @param {Cartographic} result The object in which to store the result. * @returns {Cartographic} The location of the point along the geodesic. * * @exception {DeveloperError} start and end must be set before calling function interpolateUsingSurfaceDistance @@ -42089,10 +42503,10 @@ define('Core/PolylinePipeline',[ /** * Subdivides polyline and raises all points to the specified height. Returns an array of numbers to represent the positions. - * @param {Cartesian3[]} positions The array of type {Cartesian3} representing positions. - * @param {Number|Number[]} [height=0.0] A number or array of numbers representing the heights of each position. - * @param {Number} [granularity = CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. - * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie. + * @param {Cartesian3[]} options.positions The array of type {Cartesian3} representing positions. + * @param {Number|Number[]} [options.height=0.0] A number or array of numbers representing the heights of each position. + * @param {Number} [options.granularity = CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. + * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie. * @returns {Number[]} A new array of positions of type {Number} that have been subdivided and raised to the surface of the ellipsoid. * * @example @@ -42174,10 +42588,10 @@ define('Core/PolylinePipeline',[ /** * Subdivides polyline and raises all points to the specified height. Returns an array of new {Cartesian3} positions. - * @param {Cartesian3[]} positions The array of type {Cartesian3} representing positions. - * @param {Number|Number[]} [height=0.0] A number or array of numbers representing the heights of each position. - * @param {Number} [granularity = CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. - * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie. + * @param {Cartesian3[]} options.positions The array of type {Cartesian3} representing positions. + * @param {Number|Number[]} [options.height=0.0] A number or array of numbers representing the heights of each position. + * @param {Number} [options.granularity = CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. + * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie. * @returns {Cartesian3[]} A new array of cartesian3 positions that have been subdivided and raised to the surface of the ellipsoid. * * @example @@ -43980,17 +44394,17 @@ define('Core/CorridorGeometry',[ function addNormals(attr, normal, left, front, back, vertexFormat) { var normals = attr.normals; var tangents = attr.tangents; - var binormals = attr.binormals; + var bitangents = attr.bitangents; var forward = Cartesian3.normalize(Cartesian3.cross(left, normal, scratch1), scratch1); if (vertexFormat.normal) { CorridorGeometryLibrary.addAttribute(normals, normal, front, back); } - if (vertexFormat.binormal) { - CorridorGeometryLibrary.addAttribute(binormals, left, front, back); - } if (vertexFormat.tangent) { CorridorGeometryLibrary.addAttribute(tangents, forward, front, back); } + if (vertexFormat.bitangent) { + CorridorGeometryLibrary.addAttribute(bitangents, left, front, back); + } } function combine(computedPositions, vertexFormat, ellipsoid) { @@ -44041,11 +44455,11 @@ define('Core/CorridorGeometry',[ var finalPositions = new Float64Array(size); var normals = (vertexFormat.normal) ? new Float32Array(size) : undefined; var tangents = (vertexFormat.tangent) ? new Float32Array(size) : undefined; - var binormals = (vertexFormat.binormal) ? new Float32Array(size) : undefined; + var bitangents = (vertexFormat.bitangent) ? new Float32Array(size) : undefined; var attr = { normals : normals, tangents : tangents, - binormals : binormals + bitangents : bitangents }; var front = 0; var back = size - 1; @@ -44330,11 +44744,11 @@ define('Core/CorridorGeometry',[ }); } - if (vertexFormat.binormal) { - attributes.binormal = new GeometryAttribute({ + if (vertexFormat.bitangent) { + attributes.bitangent = new GeometryAttribute({ componentDatatype : ComponentDatatype.FLOAT, componentsPerAttribute : 3, - values : attr.binormals + values : attr.bitangents }); } @@ -44345,31 +44759,31 @@ define('Core/CorridorGeometry',[ } function extrudedAttributes(attributes, vertexFormat) { - if (!vertexFormat.normal && !vertexFormat.binormal && !vertexFormat.tangent && !vertexFormat.st) { + if (!vertexFormat.normal && !vertexFormat.tangent && !vertexFormat.bitangent && !vertexFormat.st) { return attributes; } var positions = attributes.position.values; var topNormals; - var topBinormals; - if (vertexFormat.normal || vertexFormat.binormal) { + var topBitangents; + if (vertexFormat.normal || vertexFormat.bitangent) { topNormals = attributes.normal.values; - topBinormals = attributes.binormal.values; + topBitangents = attributes.bitangent.values; } var size = attributes.position.values.length / 18; var threeSize = size * 3; var twoSize = size * 2; var sixSize = threeSize * 2; var i; - if (vertexFormat.normal || vertexFormat.binormal || vertexFormat.tangent) { + if (vertexFormat.normal || vertexFormat.bitangent || vertexFormat.tangent) { var normals = (vertexFormat.normal) ? new Float32Array(threeSize * 6) : undefined; - var binormals = (vertexFormat.binormal) ? new Float32Array(threeSize * 6) : undefined; var tangents = (vertexFormat.tangent) ? new Float32Array(threeSize * 6) : undefined; + var bitangents = (vertexFormat.bitangent) ? new Float32Array(threeSize * 6) : undefined; var topPosition = cartesian1; var bottomPosition = cartesian2; var previousPosition = cartesian3; var normal = cartesian4; var tangent = cartesian5; - var binormal = cartesian6; + var bitangent = cartesian6; var attrIndex = sixSize; for (i = 0; i < threeSize; i += 3) { var attrIndexOffset = attrIndex + sixSize; @@ -44385,17 +44799,17 @@ define('Core/CorridorGeometry',[ CorridorGeometryLibrary.addAttribute(normals, normal, attrIndex); CorridorGeometryLibrary.addAttribute(normals, normal, attrIndex + 3); } - if (vertexFormat.tangent || vertexFormat.binormal) { - binormal = Cartesian3.fromArray(topNormals, i, binormal); - if (vertexFormat.binormal) { - CorridorGeometryLibrary.addAttribute(binormals, binormal, attrIndexOffset); - CorridorGeometryLibrary.addAttribute(binormals, binormal, attrIndexOffset + 3); - CorridorGeometryLibrary.addAttribute(binormals, binormal, attrIndex); - CorridorGeometryLibrary.addAttribute(binormals, binormal, attrIndex + 3); + if (vertexFormat.tangent || vertexFormat.bitangent) { + bitangent = Cartesian3.fromArray(topNormals, i, bitangent); + if (vertexFormat.bitangent) { + CorridorGeometryLibrary.addAttribute(bitangents, bitangent, attrIndexOffset); + CorridorGeometryLibrary.addAttribute(bitangents, bitangent, attrIndexOffset + 3); + CorridorGeometryLibrary.addAttribute(bitangents, bitangent, attrIndex); + CorridorGeometryLibrary.addAttribute(bitangents, bitangent, attrIndex + 3); } if (vertexFormat.tangent) { - tangent = Cartesian3.normalize(Cartesian3.cross(binormal, normal, tangent), tangent); + tangent = Cartesian3.normalize(Cartesian3.cross(bitangent, normal, tangent), tangent); CorridorGeometryLibrary.addAttribute(tangents, tangent, attrIndexOffset); CorridorGeometryLibrary.addAttribute(tangents, tangent, attrIndexOffset + 3); CorridorGeometryLibrary.addAttribute(tangents, tangent, attrIndex); @@ -44417,12 +44831,12 @@ define('Core/CorridorGeometry',[ attributes.normal = undefined; } - if (vertexFormat.binormal) { - binormals.set(topBinormals); //top - binormals.set(topBinormals, threeSize); //bottom - attributes.binormal.values = binormals; + if (vertexFormat.bitangent) { + bitangents.set(topBitangents); //top + bitangents.set(topBitangents, threeSize); //bottom + attributes.bitangent.values = bitangents; } else { - attributes.binormal = undefined; + attributes.bitangent = undefined; } if (vertexFormat.tangent) { @@ -44483,10 +44897,10 @@ define('Core/CorridorGeometry',[ function computePositionsExtruded(params, vertexFormat) { var topVertexFormat = new VertexFormat({ - position : vertexFormat.positon, - normal : (vertexFormat.normal || vertexFormat.binormal), + position : vertexFormat.position, + normal : (vertexFormat.normal || vertexFormat.bitangent || params.shadowVolume), tangent : vertexFormat.tangent, - binormal : (vertexFormat.normal || vertexFormat.binormal), + bitangent : (vertexFormat.normal || vertexFormat.bitangent), st : vertexFormat.st }); var ellipsoid = params.ellipsoid; @@ -44512,28 +44926,49 @@ define('Core/CorridorGeometry',[ newPositions.set(wallPositions, length * 2); attributes.position.values = newPositions; - length /= 3; + attributes = extrudedAttributes(attributes, vertexFormat); + var size = length / 3; + if (params.shadowVolume) { + var topNormals = attributes.normal.values; + length = topNormals.length; + + var extrudeNormals = new Float32Array(length * 6); + for (i = 0; i < length; i ++) { + topNormals[i] = -topNormals[i]; + } + //only get normals for bottom layer that's going to be pushed down + extrudeNormals.set(topNormals, length); //bottom face + extrudeNormals = addWallPositions(topNormals, length*4, extrudeNormals); //bottom wall + attributes.extrudeDirection = new GeometryAttribute({ + componentDatatype : ComponentDatatype.FLOAT, + componentsPerAttribute : 3, + values : extrudeNormals + }); + if (!vertexFormat.normal) { + attributes.normal = undefined; + } + } + var i; var iLength = indices.length; - var twoLength = length + length; - var newIndices = IndexDatatype.createTypedArray(newPositions.length / 3, iLength * 2 + twoLength * 3); + var twoSize = size + size; + var newIndices = IndexDatatype.createTypedArray(newPositions.length / 3, iLength * 2 + twoSize * 3); newIndices.set(indices); var index = iLength; for (i = 0; i < iLength; i += 3) { // bottom indices var v0 = indices[i]; var v1 = indices[i + 1]; var v2 = indices[i + 2]; - newIndices[index++] = v2 + length; - newIndices[index++] = v1 + length; - newIndices[index++] = v0 + length; + newIndices[index++] = v2 + size; + newIndices[index++] = v1 + size; + newIndices[index++] = v0 + size; } - attributes = extrudedAttributes(attributes, vertexFormat); var UL, LL, UR, LR; - for (i = 0; i < twoLength; i += 2) { //wall indices - UL = i + twoLength; - LL = UL + twoLength; + for (i = 0; i < twoSize; i += 2) { //wall indices + UL = i + twoSize; + LL = UL + twoSize; UR = UL + 1; LR = LL + 1; newIndices[index++] = UL; @@ -44713,6 +45148,7 @@ define('Core/CorridorGeometry',[ this._extrudedHeight = defaultValue(options.extrudedHeight, this._height); this._cornerType = defaultValue(options.cornerType, CornerType.ROUNDED); this._granularity = defaultValue(options.granularity, CesiumMath.RADIANS_PER_DEGREE); + this._shadowVolume = defaultValue(options.shadowVolume, false); this._workerName = 'createCorridorGeometry'; this._rectangle = computeRectangle(positions, this._ellipsoid, width, this._cornerType); @@ -44720,7 +45156,7 @@ define('Core/CorridorGeometry',[ * The number of elements used to pack the object into an array. * @type {Number} */ - this.packedLength = 1 + positions.length * Cartesian3.packedLength + Ellipsoid.packedLength + VertexFormat.packedLength + Rectangle.packedLength + 5; + this.packedLength = 1 + positions.length * Cartesian3.packedLength + Ellipsoid.packedLength + VertexFormat.packedLength + Rectangle.packedLength + 6; } /** @@ -44763,7 +45199,8 @@ define('Core/CorridorGeometry',[ array[startingIndex++] = value._height; array[startingIndex++] = value._extrudedHeight; array[startingIndex++] = value._cornerType; - array[startingIndex] = value._granularity; + array[startingIndex++] = value._granularity; + array[startingIndex] = value._shadowVolume ? 1.0 : 0.0; return array; }; @@ -44779,7 +45216,8 @@ define('Core/CorridorGeometry',[ height : undefined, extrudedHeight : undefined, cornerType : undefined, - granularity : undefined + granularity : undefined, + shadowVolume: undefined }; /** @@ -44817,7 +45255,8 @@ define('Core/CorridorGeometry',[ var height = array[startingIndex++]; var extrudedHeight = array[startingIndex++]; var cornerType = array[startingIndex++]; - var granularity = array[startingIndex]; + var granularity = array[startingIndex++]; + var shadowVolume = array[startingIndex] === 1.0; if (!defined(result)) { scratchOptions.positions = positions; @@ -44826,6 +45265,7 @@ define('Core/CorridorGeometry',[ scratchOptions.extrudedHeight = extrudedHeight; scratchOptions.cornerType = cornerType; scratchOptions.granularity = granularity; + scratchOptions.shadowVolume = shadowVolume; return new CorridorGeometry(scratchOptions); } @@ -44838,6 +45278,7 @@ define('Core/CorridorGeometry',[ result._cornerType = cornerType; result._granularity = granularity; result._rectangle = Rectangle.clone(rectangle); + result._shadowVolume = shadowVolume; return result; }; @@ -44878,6 +45319,7 @@ define('Core/CorridorGeometry',[ height = h; params.height = height; params.extrudedHeight = extrudedHeight; + params.shadowVolume = corridorGeometry._shadowVolume; attr = computePositionsExtruded(params, vertexFormat); } else { var computedPositions = CorridorGeometryLibrary.computePositions(params); @@ -44916,7 +45358,8 @@ define('Core/CorridorGeometry',[ granularity : granularity, extrudedHeight : minHeight, height : maxHeight, - vertexFormat : VertexFormat.POSITION_ONLY + vertexFormat : VertexFormat.POSITION_ONLY, + shadowVolume: true }); }; @@ -45573,7 +46016,7 @@ define('Core/CylinderGeometry',[ var radiusScratch = new Cartesian2(); var normalScratch = new Cartesian3(); - var binormalScratch = new Cartesian3(); + var bitangentScratch = new Cartesian3(); var tangentScratch = new Cartesian3(); var positionScratch = new Cartesian3(); @@ -45749,22 +46192,22 @@ define('Core/CylinderGeometry',[ var st = (vertexFormat.st) ? new Float32Array(numVertices * 2) : undefined; var normals = (vertexFormat.normal) ? new Float32Array(numVertices * 3) : undefined; var tangents = (vertexFormat.tangent) ? new Float32Array(numVertices * 3) : undefined; - var binormals = (vertexFormat.binormal) ? new Float32Array(numVertices * 3) : undefined; + var bitangents = (vertexFormat.bitangent) ? new Float32Array(numVertices * 3) : undefined; var i; - var computeNormal = (vertexFormat.normal || vertexFormat.tangent || vertexFormat.binormal); + var computeNormal = (vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent); if (computeNormal) { - var computeTangent = (vertexFormat.tangent || vertexFormat.binormal); + var computeTangent = (vertexFormat.tangent || vertexFormat.bitangent); var normalIndex = 0; var tangentIndex = 0; - var binormalIndex = 0; + var bitangentIndex = 0; var normal = normalScratch; normal.z = 0; var tangent = tangentScratch; - var binormal = binormalScratch; + var bitangent = bitangentScratch; for (i = 0; i < slices; i++) { var angle = i / slices * CesiumMath.TWO_PI; @@ -45796,14 +46239,14 @@ define('Core/CylinderGeometry',[ tangents[tangentIndex++] = tangent.z; } - if (vertexFormat.binormal) { - binormal = Cartesian3.normalize(Cartesian3.cross(normal, tangent, binormal), binormal); - binormals[binormalIndex++] = binormal.x; - binormals[binormalIndex++] = binormal.y; - binormals[binormalIndex++] = binormal.z; - binormals[binormalIndex++] = binormal.x; - binormals[binormalIndex++] = binormal.y; - binormals[binormalIndex++] = binormal.z; + if (vertexFormat.bitangent) { + bitangent = Cartesian3.normalize(Cartesian3.cross(normal, tangent, bitangent), bitangent); + bitangents[bitangentIndex++] = bitangent.x; + bitangents[bitangentIndex++] = bitangent.y; + bitangents[bitangentIndex++] = bitangent.z; + bitangents[bitangentIndex++] = bitangent.x; + bitangents[bitangentIndex++] = bitangent.y; + bitangents[bitangentIndex++] = bitangent.z; } } } @@ -45819,10 +46262,10 @@ define('Core/CylinderGeometry',[ tangents[tangentIndex++] = 0; tangents[tangentIndex++] = 0; } - if (vertexFormat.binormal) { - binormals[binormalIndex++] = 0; - binormals[binormalIndex++] = -1; - binormals[binormalIndex++] = 0; + if (vertexFormat.bitangent) { + bitangents[bitangentIndex++] = 0; + bitangents[bitangentIndex++] = -1; + bitangents[bitangentIndex++] = 0; } } @@ -45837,10 +46280,10 @@ define('Core/CylinderGeometry',[ tangents[tangentIndex++] = 0; tangents[tangentIndex++] = 0; } - if (vertexFormat.binormal) { - binormals[binormalIndex++] = 0; - binormals[binormalIndex++] = 1; - binormals[binormalIndex++] = 0; + if (vertexFormat.bitangent) { + bitangents[bitangentIndex++] = 0; + bitangents[bitangentIndex++] = 1; + bitangents[bitangentIndex++] = 0; } } } @@ -45915,11 +46358,11 @@ define('Core/CylinderGeometry',[ }); } - if (vertexFormat.binormal) { - attributes.binormal = new GeometryAttribute({ + if (vertexFormat.bitangent) { + attributes.bitangent = new GeometryAttribute({ componentDatatype : ComponentDatatype.FLOAT, componentsPerAttribute : 3, - values : binormals + values : bitangents }); } @@ -47614,7 +48057,7 @@ define('Core/EllipsoidGeometry',[ var scratchPosition = new Cartesian3(); var scratchNormal = new Cartesian3(); var scratchTangent = new Cartesian3(); - var scratchBinormal = new Cartesian3(); + var scratchBitangent = new Cartesian3(); var scratchNormalST = new Cartesian3(); var defaultRadii = new Cartesian3(1.0, 1.0, 1.0); @@ -47781,7 +48224,7 @@ define('Core/EllipsoidGeometry',[ var normals = (vertexFormat.normal) ? new Float32Array(vertexCount * 3) : undefined; var tangents = (vertexFormat.tangent) ? new Float32Array(vertexCount * 3) : undefined; - var binormals = (vertexFormat.binormal) ? new Float32Array(vertexCount * 3) : undefined; + var bitangents = (vertexFormat.bitangent) ? new Float32Array(vertexCount * 3) : undefined; var st = (vertexFormat.st) ? new Float32Array(vertexCount * 2) : undefined; var cosTheta = new Array(slicePartitions); @@ -47839,9 +48282,9 @@ define('Core/EllipsoidGeometry',[ var stIndex = 0; var normalIndex = 0; var tangentIndex = 0; - var binormalIndex = 0; + var bitangentIndex = 0; - if (vertexFormat.st || vertexFormat.normal || vertexFormat.tangent || vertexFormat.binormal) { + if (vertexFormat.st || vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent) { for( i = 0; i < vertexCount; i++) { var position = Cartesian3.fromArray(positions, i * 3, scratchPosition); var normal = ellipsoid.geodeticSurfaceNormal(position, scratchNormal); @@ -47871,7 +48314,7 @@ define('Core/EllipsoidGeometry',[ normals[normalIndex++] = normal.z; } - if (vertexFormat.tangent || vertexFormat.binormal) { + if (vertexFormat.tangent || vertexFormat.bitangent) { var tangent = scratchTangent; if (i < slicePartitions || i > vertexCount - slicePartitions - 1) { Cartesian3.cross(Cartesian3.UNIT_X, normal, tangent); @@ -47887,13 +48330,13 @@ define('Core/EllipsoidGeometry',[ tangents[tangentIndex++] = tangent.z; } - if (vertexFormat.binormal) { - var binormal = Cartesian3.cross(normal, tangent, scratchBinormal); - Cartesian3.normalize(binormal, binormal); + if (vertexFormat.bitangent) { + var bitangent = Cartesian3.cross(normal, tangent, scratchBitangent); + Cartesian3.normalize(bitangent, bitangent); - binormals[binormalIndex++] = binormal.x; - binormals[binormalIndex++] = binormal.y; - binormals[binormalIndex++] = binormal.z; + bitangents[bitangentIndex++] = bitangent.x; + bitangents[bitangentIndex++] = bitangent.y; + bitangents[bitangentIndex++] = bitangent.z; } } } @@ -47922,11 +48365,11 @@ define('Core/EllipsoidGeometry',[ }); } - if (vertexFormat.binormal) { - attributes.binormal = new GeometryAttribute({ + if (vertexFormat.bitangent) { + attributes.bitangent = new GeometryAttribute({ componentDatatype : ComponentDatatype.FLOAT, componentsPerAttribute : 3, - values : binormals + values : bitangents }); } } @@ -48596,6 +49039,43 @@ define('Core/ExtrapolationType',[ return freezeObject(ExtrapolationType); }); +/*global define*/ +define('Core/GeocoderService',[ + './defineProperties', + './DeveloperError' + ], function( + defineProperties, + DeveloperError) { + 'use strict'; + + /** + * @typedef {Object} GeocoderResult + * @property {String} displayName The display name for a location + * @property {Rectangle|Cartesian3} destination The bounding box for a location + */ + + /** + * Provides geocoding through an external service. This type describes an interface and + * is not intended to be used. + * @alias GeocoderService + * @constructor + * + * @see BingMapsGeocoderService + */ + function GeocoderService() { + } + + /** + * @function + * + * @param {String} query The query to be sent to the geocoder service + * @returns {Promise<GeocoderResult[]>} + */ + GeocoderService.prototype.geocode = DeveloperError.throwInstantiationError; + + return GeocoderService; +}); + /*global define*/ define('Core/GeometryInstanceAttribute',[ './defaultValue', @@ -50520,259 +51000,6 @@ define('Core/loadImageViaBlob',[ return xhrBlobSupported ? loadImageViaBlob : loadImage; }); -/*global define*/ -define('Core/objectToQuery',[ - './defined', - './DeveloperError', - './isArray' - ], function( - defined, - DeveloperError, - isArray) { - 'use strict'; - - /** - * Converts an object representing a set of name/value pairs into a query string, - * with names and values encoded properly for use in a URL. Values that are arrays - * will produce multiple values with the same name. - * @exports objectToQuery - * - * @param {Object} obj The object containing data to encode. - * @returns {String} An encoded query string. - * - * - * @example - * var str = Cesium.objectToQuery({ - * key1 : 'some value', - * key2 : 'a/b', - * key3 : ['x', 'y'] - * }); - * - * @see queryToObject - * // str will be: - * // 'key1=some%20value&key2=a%2Fb&key3=x&key3=y' - */ - function objectToQuery(obj) { - if (!defined(obj)) { - throw new DeveloperError('obj is required.'); - } - - var result = ''; - for ( var propName in obj) { - if (obj.hasOwnProperty(propName)) { - var value = obj[propName]; - - var part = encodeURIComponent(propName) + '='; - if (isArray(value)) { - for (var i = 0, len = value.length; i < len; ++i) { - result += part + encodeURIComponent(value[i]) + '&'; - } - } else { - result += part + encodeURIComponent(value) + '&'; - } - } - } - - // trim last & - result = result.slice(0, -1); - - // This function used to replace %20 with + which is more compact and readable. - // However, some servers didn't properly handle + as a space. - // https://github.com/AnalyticalGraphicsInc/cesium/issues/2192 - - return result; - } - - return objectToQuery; -}); - -/*global define*/ -define('Core/queryToObject',[ - './defined', - './DeveloperError', - './isArray' - ], function( - defined, - DeveloperError, - isArray) { - 'use strict'; - - /** - * Parses a query string into an object, where the keys and values of the object are the - * name/value pairs from the query string, decoded. If a name appears multiple times, - * the value in the object will be an array of values. - * @exports queryToObject - * - * @param {String} queryString The query string. - * @returns {Object} An object containing the parameters parsed from the query string. - * - * - * @example - * var obj = Cesium.queryToObject('key1=some%20value&key2=a%2Fb&key3=x&key3=y'); - * // obj will be: - * // { - * // key1 : 'some value', - * // key2 : 'a/b', - * // key3 : ['x', 'y'] - * // } - * - * @see objectToQuery - */ - function queryToObject(queryString) { - if (!defined(queryString)) { - throw new DeveloperError('queryString is required.'); - } - - var result = {}; - if (queryString === '') { - return result; - } - var parts = queryString.replace(/\+/g, '%20').split('&'); - for (var i = 0, len = parts.length; i < len; ++i) { - var subparts = parts[i].split('='); - - var name = decodeURIComponent(subparts[0]); - var value = subparts[1]; - if (defined(value)) { - value = decodeURIComponent(value); - } else { - value = ''; - } - - var resultValue = result[name]; - if (typeof resultValue === 'string') { - // expand the single value to an array - result[name] = [resultValue, value]; - } else if (isArray(resultValue)) { - resultValue.push(value); - } else { - result[name] = value; - } - } - return result; - } - - return queryToObject; -}); - -/*global define*/ -define('Core/loadJsonp',[ - '../ThirdParty/Uri', - '../ThirdParty/when', - './combine', - './defaultValue', - './defined', - './DeveloperError', - './objectToQuery', - './queryToObject' - ], function( - Uri, - when, - combine, - defaultValue, - defined, - DeveloperError, - objectToQuery, - queryToObject) { - 'use strict'; - - /** - * Requests a resource using JSONP. - * - * @exports loadJsonp - * - * @param {String} url The URL to request. - * @param {Object} [options] Object with the following properties: - * @param {Object} [options.parameters] Any extra query parameters to append to the URL. - * @param {String} [options.callbackParameterName='callback'] The callback parameter name that the server expects. - * @param {Proxy} [options.proxy] A proxy to use for the request. This object is expected to have a getURL function which returns the proxied URL, if needed. - * @returns {Promise.<Object>} a promise that will resolve to the requested data when loaded. - * - * - * @example - * // load a data asynchronously - * Cesium.loadJsonp('some/webservice').then(function(data) { - * // use the loaded data - * }).otherwise(function(error) { - * // an error occurred - * }); - * - * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A} - */ - function loadJsonp(url, options) { - if (!defined(url)) { - throw new DeveloperError('url is required.'); - } - - options = defaultValue(options, defaultValue.EMPTY_OBJECT); - - //generate a unique function name - var functionName; - do { - functionName = 'loadJsonp' + Math.random().toString().substring(2, 8); - } while (defined(window[functionName])); - - var deferred = when.defer(); - - //assign a function with that name in the global scope - window[functionName] = function(data) { - deferred.resolve(data); - - try { - delete window[functionName]; - } catch (e) { - window[functionName] = undefined; - } - }; - - var uri = new Uri(url); - - var queryOptions = queryToObject(defaultValue(uri.query, '')); - - if (defined(options.parameters)) { - queryOptions = combine(options.parameters, queryOptions); - } - - var callbackParameterName = defaultValue(options.callbackParameterName, 'callback'); - queryOptions[callbackParameterName] = functionName; - - uri.query = objectToQuery(queryOptions); - - url = uri.toString(); - - var proxy = options.proxy; - if (defined(proxy)) { - url = proxy.getURL(url); - } - - loadJsonp.loadAndExecuteScript(url, functionName, deferred); - - return deferred.promise; - } - - // This is broken out into a separate function so that it can be mocked for testing purposes. - loadJsonp.loadAndExecuteScript = function(url, functionName, deferred) { - var script = document.createElement('script'); - script.async = true; - script.src = url; - - var head = document.getElementsByTagName('head')[0]; - script.onload = function() { - script.onload = undefined; - head.removeChild(script); - }; - script.onerror = function(e) { - deferred.reject(e); - }; - - head.appendChild(script); - }; - - loadJsonp.defaultLoadAndExecuteScript = loadJsonp.loadAndExecuteScript; - - return loadJsonp; -}); - /*global define*/ define('Core/loadXML',[ './loadWithXhr' @@ -50954,6 +51181,7 @@ define('Core/MapProjection',[ /*global define*/ define('Core/Matrix2',[ './Cartesian2', + './Check', './defaultValue', './defined', './defineProperties', @@ -50961,6 +51189,7 @@ define('Core/Matrix2',[ './freezeObject' ], function( Cartesian2, + Check, defaultValue, defined, defineProperties, @@ -51009,13 +51238,8 @@ define('Core/Matrix2',[ * @returns {Number[]} The array that was packed into */ Matrix2.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -51036,9 +51260,7 @@ define('Core/Matrix2',[ * @returns {Matrix2} The modified result parameter or a new Matrix2 instance if one was not provided. */ Matrix2.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -51060,18 +51282,18 @@ define('Core/Matrix2',[ * @param {Matrix2} [result] The object onto which to store the result. * @returns {Matrix2} The modified result parameter or a new Matrix2 instance if one was not provided. (Returns undefined if matrix is undefined) */ - Matrix2.clone = function(values, result) { - if (!defined(values)) { + Matrix2.clone = function(matrix, result) { + if (!defined(matrix)) { return undefined; } if (!defined(result)) { - return new Matrix2(values[0], values[2], - values[1], values[3]); + return new Matrix2(matrix[0], matrix[2], + matrix[1], matrix[3]); } - result[0] = values[0]; - result[1] = values[1]; - result[2] = values[2]; - result[3] = values[3]; + result[0] = matrix[0]; + result[1] = matrix[1]; + result[2] = matrix[2]; + result[3] = matrix[3]; return result; }; @@ -51096,9 +51318,7 @@ define('Core/Matrix2',[ * var m2 = Cesium.Matrix2.fromArray(v2, 2); */ Matrix2.fromArray = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -51121,9 +51341,7 @@ define('Core/Matrix2',[ * @returns {Matrix2} The modified result parameter, or a new Matrix2 instance if one was not provided. */ Matrix2.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values parameter is required'); - } + Check.defined('values', values); return Matrix2.clone(values, result); }; @@ -51137,9 +51355,7 @@ define('Core/Matrix2',[ * @returns {Matrix2} The modified result parameter, or a new Matrix2 instance if one was not provided. */ Matrix2.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix2(values[0], values[1], @@ -51166,9 +51382,7 @@ define('Core/Matrix2',[ * var m = Cesium.Matrix2.fromScale(new Cesium.Cartesian2(7.0, 8.0)); */ Matrix2.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix2( @@ -51197,9 +51411,7 @@ define('Core/Matrix2',[ * var m = Cesium.Matrix2.fromUniformScale(2.0); */ Matrix2.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix2( @@ -51228,9 +51440,7 @@ define('Core/Matrix2',[ * var rotated = Cesium.Matrix2.multiplyByVector(m, p, new Cesium.Cartesian2()); */ Matrix2.fromRotation = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -51256,9 +51466,7 @@ define('Core/Matrix2',[ * @returns {Number[]} The modified Array parameter or a new Array instance if one was not provided. */ Matrix2.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3]]; @@ -51287,12 +51495,11 @@ define('Core/Matrix2',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix2.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 1) { - throw new DeveloperError('row must be 0 or 1.'); - } - if (typeof column !== 'number' || column < 0 || column > 1) { - throw new DeveloperError('column must be 0 or 1.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 1); + + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 1); return column * 2 + row; }; @@ -51308,15 +51515,12 @@ define('Core/Matrix2',[ * @exception {DeveloperError} index must be 0 or 1. */ Matrix2.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (typeof index !== 'number' || index < 0 || index > 1) { - throw new DeveloperError('index must be 0 or 1.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 1); + + Check.typeOf.object('result', result); var startIndex = index * 2; var x = matrix[startIndex]; @@ -51339,18 +51543,13 @@ define('Core/Matrix2',[ * @exception {DeveloperError} index must be 0 or 1. */ Matrix2.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 1) { - throw new DeveloperError('index must be 0 or 1.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 1); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix2.clone(matrix, result); var startIndex = index * 2; @@ -51370,15 +51569,12 @@ define('Core/Matrix2',[ * @exception {DeveloperError} index must be 0 or 1. */ Matrix2.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (typeof index !== 'number' || index < 0 || index > 1) { - throw new DeveloperError('index must be 0 or 1.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 1); + + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 2]; @@ -51400,18 +51596,13 @@ define('Core/Matrix2',[ * @exception {DeveloperError} index must be 0 or 1. */ Matrix2.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 1) { - throw new DeveloperError('index must be 0 or 1.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 1); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix2.clone(matrix, result); result[index] = cartesian.x; @@ -51429,12 +51620,8 @@ define('Core/Matrix2',[ * @returns {Cartesian2} The modified result parameter. */ Matrix2.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian2.magnitude(Cartesian2.fromElements(matrix[0], matrix[1], scratchColumn)); result.y = Cartesian2.magnitude(Cartesian2.fromElements(matrix[2], matrix[3], scratchColumn)); @@ -51464,15 +51651,9 @@ define('Core/Matrix2',[ * @returns {Matrix2} The modified result parameter. */ Matrix2.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var column0Row0 = left[0] * right[0] + left[2] * right[1]; var column1Row0 = left[0] * right[2] + left[2] * right[3]; @@ -51495,15 +51676,9 @@ define('Core/Matrix2',[ * @returns {Matrix2} The modified result parameter. */ Matrix2.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -51521,15 +51696,9 @@ define('Core/Matrix2',[ * @returns {Matrix2} The modified result parameter. */ Matrix2.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -51547,15 +51716,9 @@ define('Core/Matrix2',[ * @returns {Cartesian2} The modified result parameter. */ Matrix2.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var x = matrix[0] * cartesian.x + matrix[2] * cartesian.y; var y = matrix[1] * cartesian.x + matrix[3] * cartesian.y; @@ -51574,15 +51737,9 @@ define('Core/Matrix2',[ * @returns {Matrix2} The modified result parameter. */ Matrix2.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -51608,15 +51765,9 @@ define('Core/Matrix2',[ * @see Matrix2.multiplyByUniformScale */ Matrix2.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); result[0] = matrix[0] * scale.x; result[1] = matrix[1] * scale.x; @@ -51633,12 +51784,8 @@ define('Core/Matrix2',[ * @returns {Matrix2} The modified result parameter. */ Matrix2.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -51655,12 +51802,8 @@ define('Core/Matrix2',[ * @returns {Matrix2} The modified result parameter. */ Matrix2.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var column0Row0 = matrix[0]; var column0Row1 = matrix[2]; @@ -51682,12 +51825,8 @@ define('Core/Matrix2',[ * @returns {Matrix2} The modified result parameter. */ Matrix2.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -51736,9 +51875,7 @@ define('Core/Matrix2',[ * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. */ Matrix2.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -54248,6 +54385,7 @@ define('Core/PolygonGeometry',[ './Cartesian2', './Cartesian3', './Cartographic', + './Check', './ComponentDatatype', './defaultValue', './defined', @@ -54274,6 +54412,7 @@ define('Core/PolygonGeometry',[ Cartesian2, Cartesian3, Cartographic, + Check, ComponentDatatype, defaultValue, defined, @@ -54350,12 +54489,12 @@ define('Core/PolygonGeometry',[ var scratchPosition = new Cartesian3(); var scratchNormal = new Cartesian3(); var scratchTangent = new Cartesian3(); - var scratchBinormal = new Cartesian3(); + var scratchBitangent = new Cartesian3(); var p1Scratch = new Cartesian3(); var p2Scratch = new Cartesian3(); var scratchPerPosNormal = new Cartesian3(); var scratchPerPosTangent = new Cartesian3(); - var scratchPerPosBinormal = new Cartesian3(); + var scratchPerPosBitangent = new Cartesian3(); var appendTextureCoordinatesOrigin = new Cartesian2(); var appendTextureCoordinatesCartesian2 = new Cartesian2(); @@ -54366,7 +54505,8 @@ define('Core/PolygonGeometry',[ function computeAttributes(options) { var vertexFormat = options.vertexFormat; var geometry = options.geometry; - if (vertexFormat.st || vertexFormat.normal || vertexFormat.tangent || vertexFormat.binormal) { + var shadowVolume = options.shadowVolume; + if (vertexFormat.st || vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent || shadowVolume) { // PERFORMANCE_IDEA: Compute before subdivision, then just interpolate during subdivision. // PERFORMANCE_IDEA: Compute with createGeometryFromPositions() for fast path when there's no holes. var boundingRectangle = options.boundingRectangle; @@ -54395,14 +54535,15 @@ define('Core/PolygonGeometry',[ } } var tangents = vertexFormat.tangent ? new Float32Array(length) : undefined; - var binormals = vertexFormat.binormal ? new Float32Array(length) : undefined; + var bitangents = vertexFormat.bitangent ? new Float32Array(length) : undefined; + var extrudeNormals = shadowVolume ? new Float32Array(length) : undefined; var textureCoordIndex = 0; var attrIndex = 0; var normal = scratchNormal; var tangent = scratchTangent; - var binormal = scratchBinormal; + var bitangent = scratchBitangent; var recomputeNormal = true; var rotation = Quaternion.fromAxisAngle(tangentPlane._plane.normal, stRotation, appendTextureCoordinatesQuaternion); @@ -54441,7 +54582,7 @@ define('Core/PolygonGeometry',[ textureCoordIndex += 2; } - if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.binormal) { + if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent || shadowVolume) { var attrIndex1 = attrIndex + 1; var attrIndex2 = attrIndex + 2; @@ -54465,28 +54606,28 @@ define('Core/PolygonGeometry',[ } } - if (vertexFormat.tangent || vertexFormat.binormal) { - binormal = ellipsoid.geodeticSurfaceNormal(position, binormal); + if (vertexFormat.tangent || vertexFormat.bitangent) { + bitangent = ellipsoid.geodeticSurfaceNormal(position, bitangent); if (vertexFormat.tangent) { - tangent = Cartesian3.normalize(Cartesian3.cross(binormal, normal, tangent), tangent); + tangent = Cartesian3.normalize(Cartesian3.cross(bitangent, normal, tangent), tangent); } } } else { normal = ellipsoid.geodeticSurfaceNormal(position, normal); - if (vertexFormat.tangent || vertexFormat.binormal) { + if (vertexFormat.tangent || vertexFormat.bitangent) { if (perPositionHeight) { scratchPerPosNormal = Cartesian3.fromArray(normals, attrIndex, scratchPerPosNormal); scratchPerPosTangent = Cartesian3.cross(Cartesian3.UNIT_Z, scratchPerPosNormal, scratchPerPosTangent); scratchPerPosTangent = Cartesian3.normalize(Matrix3.multiplyByVector(textureMatrix, scratchPerPosTangent, scratchPerPosTangent), scratchPerPosTangent); - if (vertexFormat.binormal) { - scratchPerPosBinormal = Cartesian3.normalize(Cartesian3.cross(scratchPerPosNormal, scratchPerPosTangent, scratchPerPosBinormal), scratchPerPosBinormal); + if (vertexFormat.bitangent) { + scratchPerPosBitangent = Cartesian3.normalize(Cartesian3.cross(scratchPerPosNormal, scratchPerPosTangent, scratchPerPosBitangent), scratchPerPosBitangent); } } tangent = Cartesian3.cross(Cartesian3.UNIT_Z, normal, tangent); tangent = Cartesian3.normalize(Matrix3.multiplyByVector(textureMatrix, tangent, tangent), tangent); - if (vertexFormat.binormal) { - binormal = Cartesian3.normalize(Cartesian3.cross(normal, tangent, binormal), binormal); + if (vertexFormat.bitangent) { + bitangent = Cartesian3.normalize(Cartesian3.cross(normal, tangent, bitangent), bitangent); } } } @@ -54509,6 +54650,15 @@ define('Core/PolygonGeometry',[ } } + if (shadowVolume) { + if (wall) { + normal = ellipsoid.geodeticSurfaceNormal(position, normal); + } + extrudeNormals[attrIndex + bottomOffset] = -normal.x; + extrudeNormals[attrIndex1 + bottomOffset] = -normal.y; + extrudeNormals[attrIndex2 + bottomOffset] = -normal.z; + } + if (vertexFormat.tangent) { if (options.wall) { tangents[attrIndex + bottomOffset] = tangent.x; @@ -54533,21 +54683,21 @@ define('Core/PolygonGeometry',[ } } - if (vertexFormat.binormal) { + if (vertexFormat.bitangent) { if (bottom) { - binormals[attrIndex + bottomOffset] = binormal.x; - binormals[attrIndex1 + bottomOffset] = binormal.y; - binormals[attrIndex2 + bottomOffset] = binormal.z; + bitangents[attrIndex + bottomOffset] = bitangent.x; + bitangents[attrIndex1 + bottomOffset] = bitangent.y; + bitangents[attrIndex2 + bottomOffset] = bitangent.z; } if (top) { if (perPositionHeight) { - binormals[attrIndex] = scratchPerPosBinormal.x; - binormals[attrIndex1] = scratchPerPosBinormal.y; - binormals[attrIndex2] = scratchPerPosBinormal.z; + bitangents[attrIndex] = scratchPerPosBitangent.x; + bitangents[attrIndex1] = scratchPerPosBitangent.y; + bitangents[attrIndex2] = scratchPerPosBitangent.z; } else { - binormals[attrIndex] = binormal.x; - binormals[attrIndex1] = binormal.y; - binormals[attrIndex2] = binormal.z; + bitangents[attrIndex] = bitangent.x; + bitangents[attrIndex1] = bitangent.y; + bitangents[attrIndex2] = bitangent.z; } } } @@ -54579,11 +54729,19 @@ define('Core/PolygonGeometry',[ }); } - if (vertexFormat.binormal) { - geometry.attributes.binormal = new GeometryAttribute({ + if (vertexFormat.bitangent) { + geometry.attributes.bitangent = new GeometryAttribute({ componentDatatype : ComponentDatatype.FLOAT, componentsPerAttribute : 3, - values : binormals + values : bitangents + }); + } + + if (shadowVolume) { + geometry.attributes.extrudeDirection = new GeometryAttribute({ + componentDatatype : ComponentDatatype.FLOAT, + componentsPerAttribute : 3, + values : extrudeNormals }); } } @@ -54608,13 +54766,13 @@ define('Core/PolygonGeometry',[ if (closeTop && closeBottom) { var topBottomPositions = edgePoints.concat(edgePoints); + numPositions = topBottomPositions.length / 3; newIndices = IndexDatatype.createTypedArray(numPositions, indices.length * 2); newIndices.set(indices); var ilength = indices.length; - var length = numPositions / 2; for (i = 0; i < ilength; i += 3) { @@ -54779,9 +54937,8 @@ define('Core/PolygonGeometry',[ * var geometry = Cesium.PolygonGeometry.createGeometry(extrudedPolygon); */ function PolygonGeometry(options) { - if (!defined(options) || !defined(options.polygonHierarchy)) { - throw new DeveloperError('options.polygonHierarchy is required.'); - } + Check.typeOf.object('options', options); + Check.typeOf.object('options.polygonHierarchy', options.polygonHierarchy); if (defined(options.perPositionHeight) && options.perPositionHeight && defined(options.height)) { throw new DeveloperError('Cannot use both options.perPositionHeight and options.height'); } @@ -54820,6 +54977,7 @@ define('Core/PolygonGeometry',[ this._closeBottom = defaultValue(options.closeBottom, true); this._polygonHierarchy = polygonHierarchy; this._perPositionHeight = perPositionHeight; + this._shadowVolume = defaultValue(options.shadowVolume, false); this._workerName = 'createPolygonGeometry'; var positions = polygonHierarchy.positions; @@ -54833,7 +54991,7 @@ define('Core/PolygonGeometry',[ * The number of elements used to pack the object into an array. * @type {Number} */ - this.packedLength = PolygonGeometryLibrary.computeHierarchyPackedLength(polygonHierarchy) + Ellipsoid.packedLength + VertexFormat.packedLength + Rectangle.packedLength + 9; + this.packedLength = PolygonGeometryLibrary.computeHierarchyPackedLength(polygonHierarchy) + Ellipsoid.packedLength + VertexFormat.packedLength + Rectangle.packedLength + 10; } /** @@ -54844,7 +55002,7 @@ define('Core/PolygonGeometry',[ * @param {Number} [options.height=0.0] The height of the polygon. * @param {Number} [options.extrudedHeight] The height of the polygon extrusion. * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed. - * @param {Number} [options.stRotation=0.0] The rotation of the texture coordiantes, in radians. A positive rotation is counter-clockwise. + * @param {Number} [options.stRotation=0.0] The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise. * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference. * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. * @param {Boolean} [options.perPositionHeight=false] Use the height of options.positions for each position instead of using options.height to determine the height. @@ -54871,9 +55029,7 @@ define('Core/PolygonGeometry',[ PolygonGeometry.fromPositions = function(options) { options = defaultValue(options, defaultValue.EMPTY_OBJECT); - if (!defined(options.positions)) { - throw new DeveloperError('options.positions is required.'); - } + Check.defined('options.positions', options.positions); var newOptions = { polygonHierarchy : { @@ -54902,12 +55058,8 @@ define('Core/PolygonGeometry',[ * @returns {Number[]} The array that was packed into */ PolygonGeometry.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -54930,6 +55082,7 @@ define('Core/PolygonGeometry',[ array[startingIndex++] = value._perPositionHeight ? 1.0 : 0.0; array[startingIndex++] = value._closeTop ? 1.0 : 0.0; array[startingIndex++] = value._closeBottom ? 1.0 : 0.0; + array[startingIndex++] = value._shadowVolume ? 1.0 : 0.0; array[startingIndex] = value.packedLength; return array; @@ -54952,9 +55105,7 @@ define('Core/PolygonGeometry',[ * @param {PolygonGeometry} [result] The object into which to store the result. */ PolygonGeometry.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -54979,6 +55130,7 @@ define('Core/PolygonGeometry',[ var perPositionHeight = array[startingIndex++] === 1.0; var closeTop = array[startingIndex++] === 1.0; var closeBottom = array[startingIndex++] === 1.0; + var shadowVolume = array[startingIndex++] === 1.0; var packedLength = array[startingIndex]; if (!defined(result)) { @@ -54997,6 +55149,7 @@ define('Core/PolygonGeometry',[ result._closeTop = closeTop; result._closeBottom = closeBottom; result._rectangle = Rectangle.clone(rectangle); + result._shadowVolume = shadowVolume; result.packedLength = packedLength; return result; }; @@ -55059,6 +55212,7 @@ define('Core/PolygonGeometry',[ if (extrude) { options.top = closeTop; options.bottom = closeBottom; + options.shadowVolume = polygonGeometry._shadowVolume; for (i = 0; i < polygons.length; i++) { geometry = createGeometryFromPositionsExtruded(ellipsoid, polygons[i], granularity, hierarchy[i], perPositionHeight, closeTop, closeBottom, vertexFormat); @@ -55139,7 +55293,8 @@ define('Core/PolygonGeometry',[ perPositionHeight : false, extrudedHeight : minHeight, height : maxHeight, - vertexFormat : VertexFormat.POSITION_ONLY + vertexFormat : VertexFormat.POSITION_ONLY, + shadowVolume: true }); }; @@ -55195,6 +55350,7 @@ define('Core/PolygonOutlineGeometry',[ './arrayRemoveDuplicates', './BoundingSphere', './Cartesian3', + './Check', './ComponentDatatype', './defaultValue', './defined', @@ -55217,6 +55373,7 @@ define('Core/PolygonOutlineGeometry',[ arrayRemoveDuplicates, BoundingSphere, Cartesian3, + Check, ComponentDatatype, defaultValue, defined, @@ -55477,9 +55634,9 @@ define('Core/PolygonOutlineGeometry',[ * var geometry = Cesium.PolygonOutlineGeometry.createGeometry(extrudedPolygon); */ function PolygonOutlineGeometry(options) { - if (!defined(options) || !defined(options.polygonHierarchy)) { - throw new DeveloperError('options.polygonHierarchy is required.'); - } + Check.typeOf.object('options', options); + Check.typeOf.object('options.polygonHierarchy', options.polygonHierarchy); + if (defined(options.perPositionHeight) && options.perPositionHeight && defined(options.height)) { throw new DeveloperError('Cannot use both options.perPositionHeight and options.height'); } @@ -55524,12 +55681,8 @@ define('Core/PolygonOutlineGeometry',[ * @returns {Number[]} The array that was packed into */ PolygonOutlineGeometry.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -55562,9 +55715,7 @@ define('Core/PolygonOutlineGeometry',[ * @returns {PolygonOutlineGeometry} The modified result parameter or a new PolygonOutlineGeometry instance if one was not provided. */ PolygonOutlineGeometry.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -55629,9 +55780,7 @@ define('Core/PolygonOutlineGeometry',[ PolygonOutlineGeometry.fromPositions = function(options) { options = defaultValue(options, defaultValue.EMPTY_OBJECT); - if (!defined(options.positions)) { - throw new DeveloperError('options.positions is required.'); - } + Check.defined('options.positions', options.positions); var newOptions = { polygonHierarchy : { @@ -56343,7 +56492,7 @@ define('Core/PolylineVolumeGeometry',[ indices[index++] = lr; } - if (vertexFormat.st || vertexFormat.tangent || vertexFormat.binormal) { // st required for tangent/binormal calculation + if (vertexFormat.st || vertexFormat.tangent || vertexFormat.bitangent) { // st required for tangent/bitangent calculation var st = new Float32Array(vertexCount * 2); var lengthSt = 1 / (length - 1); var heightSt = 1 / (boundingRectangle.height); @@ -56411,19 +56560,19 @@ define('Core/PolylineVolumeGeometry',[ geometry = GeometryPipeline.computeNormal(geometry); } - if (vertexFormat.tangent || vertexFormat.binormal) { + if (vertexFormat.tangent || vertexFormat.bitangent) { try { - geometry = GeometryPipeline.computeBinormalAndTangent(geometry); + geometry = GeometryPipeline.computeTangentAndBitangent(geometry); } catch (e) { - oneTimeWarning('polyline-volume-tangent-binormal', 'Unable to compute tangents and binormals for polyline volume geometry'); + oneTimeWarning('polyline-volume-tangent-bitangent', 'Unable to compute tangents and bitangents for polyline volume geometry'); //TODO https://github.com/AnalyticalGraphicsInc/cesium/issues/3609 } if (!vertexFormat.tangent) { geometry.attributes.tangent = undefined; } - if (!vertexFormat.binormal) { - geometry.attributes.binormal = undefined; + if (!vertexFormat.bitangent) { + geometry.attributes.bitangent = undefined; } if (!vertexFormat.st) { geometry.attributes.st = undefined; @@ -57383,6 +57532,7 @@ define('Core/RectangleGeometry',[ './Cartesian2', './Cartesian3', './Cartographic', + './Check', './ComponentDatatype', './defaultValue', './defined', @@ -57409,6 +57559,7 @@ define('Core/RectangleGeometry',[ Cartesian2, Cartesian3, Cartographic, + Check, ComponentDatatype, defaultValue, defined, @@ -57435,7 +57586,7 @@ define('Core/RectangleGeometry',[ var positionScratch = new Cartesian3(); var normalScratch = new Cartesian3(); var tangentScratch = new Cartesian3(); - var binormalScratch = new Cartesian3(); + var bitangentScratch = new Cartesian3(); var rectangleScratch = new Rectangle(); var stScratch = new Cartesian2(); var bottomBoundingSphere = new BoundingSphere(); @@ -57466,11 +57617,11 @@ define('Core/RectangleGeometry',[ values : attributes.tangents }); } - if (vertexFormat.binormal) { - geo.attributes.binormal = new GeometryAttribute({ + if (vertexFormat.bitangent) { + geo.attributes.bitangent = new GeometryAttribute({ componentDatatype : ComponentDatatype.FLOAT, componentsPerAttribute : 3, - values : attributes.binormals + values : attributes.bitangents }); } return geo; @@ -57481,10 +57632,10 @@ define('Core/RectangleGeometry',[ var normals = (vertexFormat.normal) ? new Float32Array(length) : undefined; var tangents = (vertexFormat.tangent) ? new Float32Array(length) : undefined; - var binormals = (vertexFormat.binormal) ? new Float32Array(length) : undefined; + var bitangents = (vertexFormat.bitangent) ? new Float32Array(length) : undefined; var attrIndex = 0; - var binormal = binormalScratch; + var bitangent = bitangentScratch; var tangent = tangentScratch; var normal = normalScratch; for (var i = 0; i < length; i += 3) { @@ -57492,15 +57643,15 @@ define('Core/RectangleGeometry',[ var attrIndex1 = attrIndex + 1; var attrIndex2 = attrIndex + 2; - if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.binormal) { + if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent) { normal = ellipsoid.geodeticSurfaceNormal(p, normal); - if (vertexFormat.tangent || vertexFormat.binormal) { + if (vertexFormat.tangent || vertexFormat.bitangent) { Cartesian3.cross(Cartesian3.UNIT_Z, normal, tangent); Matrix3.multiplyByVector(tangentRotationMatrix, tangent, tangent); Cartesian3.normalize(tangent, tangent); - if (vertexFormat.binormal) { - Cartesian3.normalize(Cartesian3.cross(normal, tangent, binormal), binormal); + if (vertexFormat.bitangent) { + Cartesian3.normalize(Cartesian3.cross(normal, tangent, bitangent), bitangent); } } @@ -57514,10 +57665,10 @@ define('Core/RectangleGeometry',[ tangents[attrIndex1] = tangent.y; tangents[attrIndex2] = tangent.z; } - if (vertexFormat.binormal) { - binormals[attrIndex] = binormal.x; - binormals[attrIndex1] = binormal.y; - binormals[attrIndex2] = binormal.z; + if (vertexFormat.bitangent) { + bitangents[attrIndex] = bitangent.x; + bitangents[attrIndex1] = bitangent.y; + bitangents[attrIndex2] = bitangent.z; } } attrIndex += 3; @@ -57526,7 +57677,7 @@ define('Core/RectangleGeometry',[ positions : positions, normals : normals, tangents : tangents, - binormals : binormals + bitangents : bitangents }); } @@ -57537,20 +57688,20 @@ define('Core/RectangleGeometry',[ var normals = (vertexFormat.normal) ? new Float32Array(length) : undefined; var tangents = (vertexFormat.tangent) ? new Float32Array(length) : undefined; - var binormals = (vertexFormat.binormal) ? new Float32Array(length) : undefined; + var bitangents = (vertexFormat.bitangent) ? new Float32Array(length) : undefined; var normalIndex = 0; var tangentIndex = 0; - var binormalIndex = 0; + var bitangentIndex = 0; var recomputeNormal = true; - var binormal = binormalScratch; + var bitangent = bitangentScratch; var tangent = tangentScratch; var normal = normalScratch; for (var i = 0; i < length; i += 6) { var p = Cartesian3.fromArray(positions, i, positionScratch); - if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.binormal) { + if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent) { var p1 = Cartesian3.fromArray(positions, (i + 6) % length, v1Scratch); if (recomputeNormal) { var p2 = Cartesian3.fromArray(positions, (i + 3) % length, v2Scratch); @@ -57564,10 +57715,10 @@ define('Core/RectangleGeometry',[ recomputeNormal = true; } - if (vertexFormat.tangent || vertexFormat.binormal) { - binormal = ellipsoid.geodeticSurfaceNormal(p, binormal); + if (vertexFormat.tangent || vertexFormat.bitangent) { + bitangent = ellipsoid.geodeticSurfaceNormal(p, bitangent); if (vertexFormat.tangent) { - tangent = Cartesian3.normalize(Cartesian3.cross(binormal, normal, tangent), tangent); + tangent = Cartesian3.normalize(Cartesian3.cross(bitangent, normal, tangent), tangent); } } @@ -57589,13 +57740,13 @@ define('Core/RectangleGeometry',[ tangents[tangentIndex++] = tangent.z; } - if (vertexFormat.binormal) { - binormals[binormalIndex++] = binormal.x; - binormals[binormalIndex++] = binormal.y; - binormals[binormalIndex++] = binormal.z; - binormals[binormalIndex++] = binormal.x; - binormals[binormalIndex++] = binormal.y; - binormals[binormalIndex++] = binormal.z; + if (vertexFormat.bitangent) { + bitangents[bitangentIndex++] = bitangent.x; + bitangents[bitangentIndex++] = bitangent.y; + bitangents[bitangentIndex++] = bitangent.z; + bitangents[bitangentIndex++] = bitangent.x; + bitangents[bitangentIndex++] = bitangent.y; + bitangents[bitangentIndex++] = bitangent.z; } } } @@ -57604,7 +57755,7 @@ define('Core/RectangleGeometry',[ positions : positions, normals : normals, tangents : tangents, - binormals : binormals + bitangents : bitangents }); } @@ -57709,7 +57860,9 @@ define('Core/RectangleGeometry',[ return wallTextures; } + var scratchVertexFormat = new VertexFormat(); function constructExtrudedRectangle(options) { + var shadowVolume = options.shadowVolume; var vertexFormat = options.vertexFormat; var surfaceHeight = options.surfaceHeight; var extrudedHeight = options.extrudedHeight; @@ -57721,10 +57874,15 @@ define('Core/RectangleGeometry',[ var ellipsoid = options.ellipsoid; var i; + if (shadowVolume) { + options.vertexFormat = VertexFormat.clone(vertexFormat, scratchVertexFormat); + options.vertexFormat.normal = true; + } var topBottomGeo = constructRectangle(options); if (CesiumMath.equalsEpsilon(minHeight, maxHeight, CesiumMath.EPSILON10)) { return topBottomGeo; } + var topPositions = PolygonPipeline.scaleToGeodeticHeight(topBottomGeo.attributes.position.values, maxHeight, ellipsoid, false); topPositions = new Float64Array(topPositions); var length = topPositions.length; @@ -57737,11 +57895,12 @@ define('Core/RectangleGeometry',[ var normals = (vertexFormat.normal) ? new Float32Array(newLength) : undefined; var tangents = (vertexFormat.tangent) ? new Float32Array(newLength) : undefined; - var binormals = (vertexFormat.binormal) ? new Float32Array(newLength) : undefined; + var bitangents = (vertexFormat.bitangent) ? new Float32Array(newLength) : undefined; var textures = (vertexFormat.st) ? new Float32Array(newLength/3*2) : undefined; var topSt; + var topNormals; if (vertexFormat.normal) { - var topNormals = topBottomGeo.attributes.normal.values; + topNormals = topBottomGeo.attributes.normal.values; normals.set(topNormals); for (i = 0; i < length; i ++) { topNormals[i] = -topNormals[i]; @@ -57749,6 +57908,23 @@ define('Core/RectangleGeometry',[ normals.set(topNormals, length); topBottomGeo.attributes.normal.values = normals; } + if (shadowVolume) { + topNormals = topBottomGeo.attributes.normal.values; + if (!vertexFormat.normal) { + topBottomGeo.attributes.normal = undefined; + } + var extrudeNormals = new Float32Array(newLength); + for (i = 0; i < length; i ++) { + topNormals[i] = -topNormals[i]; + } + extrudeNormals.set(topNormals, length); //only get normals for bottom layer that's going to be pushed down + topBottomGeo.attributes.extrudeDirection = new GeometryAttribute({ + componentDatatype : ComponentDatatype.FLOAT, + componentsPerAttribute : 3, + values : extrudeNormals + }); + } + if (vertexFormat.tangent) { var topTangents = topBottomGeo.attributes.tangent.values; tangents.set(topTangents); @@ -57758,11 +57934,11 @@ define('Core/RectangleGeometry',[ tangents.set(topTangents, length); topBottomGeo.attributes.tangent.values = tangents; } - if (vertexFormat.binormal) { - var topBinormals = topBottomGeo.attributes.binormal.values; - binormals.set(topBinormals); - binormals.set(topBinormals, length); - topBottomGeo.attributes.binormal.values = binormals; + if (vertexFormat.bitangent) { + var topBitangents = topBottomGeo.attributes.bitangent.values; + bitangents.set(topBitangents); + bitangents.set(topBitangents, length); + topBottomGeo.attributes.bitangent.values = bitangents; } if (vertexFormat.st) { topSt = topBottomGeo.attributes.st.values; @@ -57787,45 +57963,76 @@ define('Core/RectangleGeometry',[ var wallCount = (perimeterPositions + 4) * 2; var wallPositions = new Float64Array(wallCount * 3); + var wallExtrudeNormals = shadowVolume ? new Float32Array(wallCount * 3) : undefined; var wallTextures = (vertexFormat.st) ? new Float32Array(wallCount * 2) : undefined; var posIndex = 0; var stIndex = 0; + var extrudeNormalIndex = 0; var area = width * height; + var threeI; for (i = 0; i < area; i+=width) { - wallPositions = addWallPositions(wallPositions, posIndex, i*3, topPositions, bottomPositions); + threeI = i * 3; + wallPositions = addWallPositions(wallPositions, posIndex, threeI, topPositions, bottomPositions); posIndex += 6; if (vertexFormat.st) { wallTextures = addWallTextureCoordinates(wallTextures, stIndex, i*2, topSt); stIndex += 4; } + if (shadowVolume) { + extrudeNormalIndex += 3; + wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI]; + wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 1]; + wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 2]; + } } for (i = area-width; i < area; i++) { - wallPositions = addWallPositions(wallPositions, posIndex, i*3, topPositions, bottomPositions); + threeI = i * 3; + wallPositions = addWallPositions(wallPositions, posIndex, threeI, topPositions, bottomPositions); posIndex += 6; if (vertexFormat.st) { wallTextures = addWallTextureCoordinates(wallTextures, stIndex, i*2, topSt); stIndex += 4; } + if (shadowVolume) { + extrudeNormalIndex += 3; + wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI]; + wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 1]; + wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 2]; + } } for (i = area-1; i > 0; i-=width) { - wallPositions = addWallPositions(wallPositions, posIndex, i*3, topPositions, bottomPositions); + threeI = i * 3; + wallPositions = addWallPositions(wallPositions, posIndex, threeI, topPositions, bottomPositions); posIndex += 6; if (vertexFormat.st) { wallTextures = addWallTextureCoordinates(wallTextures, stIndex, i*2, topSt); stIndex += 4; } + if (shadowVolume) { + extrudeNormalIndex += 3; + wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI]; + wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 1]; + wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 2]; + } } for (i = width-1; i >= 0; i--) { - wallPositions = addWallPositions(wallPositions, posIndex, i*3, topPositions, bottomPositions); + threeI = i * 3; + wallPositions = addWallPositions(wallPositions, posIndex, threeI, topPositions, bottomPositions); posIndex += 6; if (vertexFormat.st) { wallTextures = addWallTextureCoordinates(wallTextures, stIndex, i*2, topSt); stIndex += 4; } + if (shadowVolume) { + extrudeNormalIndex += 3; + wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI]; + wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 1]; + wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 2]; + } } var geo = calculateAttributesWall(wallPositions, vertexFormat, ellipsoid); @@ -57837,6 +58044,13 @@ define('Core/RectangleGeometry',[ values : wallTextures }); } + if (shadowVolume) { + geo.attributes.extrudeDirection = new GeometryAttribute({ + componentDatatype : ComponentDatatype.FLOAT, + componentsPerAttribute : 3, + values : wallExtrudeNormals + }); + } var wallIndices = IndexDatatype.createTypedArray(wallCount, perimeterPositions * 6); @@ -57961,36 +58175,26 @@ define('Core/RectangleGeometry',[ options = defaultValue(options, defaultValue.EMPTY_OBJECT); var rectangle = options.rectangle; - var granularity = defaultValue(options.granularity, CesiumMath.RADIANS_PER_DEGREE); - var ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84); - var surfaceHeight = defaultValue(options.height, 0.0); - var rotation = defaultValue(options.rotation, 0.0); - var stRotation = defaultValue(options.stRotation, 0.0); - var vertexFormat = defaultValue(options.vertexFormat, VertexFormat.DEFAULT); - var extrudedHeight = options.extrudedHeight; - var extrude = defined(extrudedHeight); - var closeTop = defaultValue(options.closeTop, true); - var closeBottom = defaultValue(options.closeBottom, true); - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); Rectangle.validate(rectangle); if (rectangle.north < rectangle.south) { - throw new DeveloperError('options.rectangle.north must be greater than options.rectangle.south'); + throw new DeveloperError('options.rectangle.north must be greater than or equal to options.rectangle.south'); } + var rotation = defaultValue(options.rotation, 0.0); this._rectangle = rectangle; - this._granularity = granularity; - this._ellipsoid = Ellipsoid.clone(ellipsoid); - this._surfaceHeight = surfaceHeight; + this._granularity = defaultValue(options.granularity, CesiumMath.RADIANS_PER_DEGREE); + this._ellipsoid = Ellipsoid.clone(defaultValue(options.ellipsoid, Ellipsoid.WGS84)); + this._surfaceHeight = defaultValue(options.height, 0.0); this._rotation = rotation; - this._stRotation = stRotation; - this._vertexFormat = VertexFormat.clone(vertexFormat); - this._extrudedHeight = defaultValue(extrudedHeight, 0.0); - this._extrude = extrude; - this._closeTop = closeTop; - this._closeBottom = closeBottom; + this._stRotation = defaultValue(options.stRotation, 0.0); + this._vertexFormat = VertexFormat.clone(defaultValue(options.vertexFormat, VertexFormat.DEFAULT)); + this._extrudedHeight = defaultValue(options.extrudedHeight, 0.0); + this._extrude = defined(options.extrudedHeight); + this._closeTop = defaultValue(options.closeTop, true); + this._closeBottom = defaultValue(options.closeBottom, true); + this._shadowVolume = defaultValue(options.shadowVolume, false); this._workerName = 'createRectangleGeometry'; this._rotatedRectangle = computeRectangle(this._rectangle, this._ellipsoid, rotation); } @@ -57999,7 +58203,7 @@ define('Core/RectangleGeometry',[ * The number of elements used to pack the object into an array. * @type {Number} */ - RectangleGeometry.packedLength = Rectangle.packedLength + Ellipsoid.packedLength + VertexFormat.packedLength + Rectangle.packedLength + 8; + RectangleGeometry.packedLength = Rectangle.packedLength + Ellipsoid.packedLength + VertexFormat.packedLength + Rectangle.packedLength + 9; /** * Stores the provided instance into the provided array. @@ -58011,13 +58215,8 @@ define('Core/RectangleGeometry',[ * @returns {Number[]} The array that was packed into */ RectangleGeometry.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -58040,7 +58239,8 @@ define('Core/RectangleGeometry',[ array[startingIndex++] = value._extrudedHeight; array[startingIndex++] = value._extrude ? 1.0 : 0.0; array[startingIndex++] = value._closeTop ? 1.0 : 0.0; - array[startingIndex] = value._closeBottom ? 1.0 : 0.0; + array[startingIndex++] = value._closeBottom ? 1.0 : 0.0; + array[startingIndex] = value._shadowVolume ? 1.0 : 0.0; return array; }; @@ -58048,7 +58248,6 @@ define('Core/RectangleGeometry',[ var scratchRectangle = new Rectangle(); var scratchRotatedRectangle = new Rectangle(); var scratchEllipsoid = Ellipsoid.clone(Ellipsoid.UNIT_SPHERE); - var scratchVertexFormat = new VertexFormat(); var scratchOptions = { rectangle : scratchRectangle, ellipsoid : scratchEllipsoid, @@ -58059,7 +58258,8 @@ define('Core/RectangleGeometry',[ stRotation : undefined, extrudedHeight : undefined, closeTop : undefined, - closeBottom : undefined + closeBottom : undefined, + shadowVolume: undefined }; /** @@ -58071,9 +58271,7 @@ define('Core/RectangleGeometry',[ * @returns {RectangleGeometry} The modified result parameter or a new RectangleGeometry instance if one was not provided. */ RectangleGeometry.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -58096,7 +58294,8 @@ define('Core/RectangleGeometry',[ var extrudedHeight = array[startingIndex++]; var extrude = array[startingIndex++] === 1.0; var closeTop = array[startingIndex++] === 1.0; - var closeBottom = array[startingIndex] === 1.0; + var closeBottom = array[startingIndex++] === 1.0; + var shadowVolume = array[startingIndex] === 1.0; if (!defined(result)) { scratchOptions.granularity = granularity; @@ -58106,6 +58305,7 @@ define('Core/RectangleGeometry',[ scratchOptions.extrudedHeight = extrude ? extrudedHeight : undefined; scratchOptions.closeTop = closeTop; scratchOptions.closeBottom = closeBottom; + scratchOptions.shadowVolume = shadowVolume; return new RectangleGeometry(scratchOptions); } @@ -58121,6 +58321,7 @@ define('Core/RectangleGeometry',[ result._closeTop = closeTop; result._closeBottom = closeBottom; result._rotatedRectangle = rotatedRectangle; + result._shadowVolume = shadowVolume; return result; }; @@ -58177,6 +58378,7 @@ define('Core/RectangleGeometry',[ var boundingSphere; rectangle = rectangleGeometry._rectangle; if (extrude) { + options.shadowVolume = rectangleGeometry._shadowVolume; geometry = constructExtrudedRectangle(options); var topBS = BoundingSphere.fromRectangle3D(rectangle, ellipsoid, surfaceHeight, topBoundingSphere); var bottomBS = BoundingSphere.fromRectangle3D(rectangle, ellipsoid, extrudedHeight, bottomBoundingSphere); @@ -58192,7 +58394,7 @@ define('Core/RectangleGeometry',[ } return new Geometry({ - attributes : new GeometryAttributes(geometry.attributes), + attributes : geometry.attributes, indices : geometry.indices, primitiveType : geometry.primitiveType, boundingSphere : boundingSphere @@ -58220,7 +58422,8 @@ define('Core/RectangleGeometry',[ height : minHeight, closeTop : true, closeBottom : true, - vertexFormat : VertexFormat.POSITION_ONLY + vertexFormat : VertexFormat.POSITION_ONLY, + shadowVolume: true }); }; @@ -58718,144 +58921,84 @@ define('Core/requestAnimationFrame',[ }); /*global define*/ -define('Core/sampleTerrain',[ - '../ThirdParty/when', - './defined', - './DeveloperError' - ], function( - when, - defined, - DeveloperError) { - 'use strict'; +define('Core/sampleTerrainMostDetailed',[ + '../ThirdParty/when', + './defined', + './sampleTerrain', + './DeveloperError', + './Rectangle' +], function( + when, + defined, + sampleTerrain, + DeveloperError, + Rectangle) { + "use strict"; /** - * Initiates a terrain height query for an array of {@link Cartographic} positions by - * requesting tiles from a terrain provider, sampling, and interpolating. The interpolation - * matches the triangles used to render the terrain at the specified level. The query - * happens asynchronously, so this function returns a promise that is resolved when - * the query completes. Each point height is modified in place. If a height can not be - * determined because no terrain data is available for the specified level at that location, - * or another error occurs, the height is set to undefined. As is typical of the - * {@link Cartographic} type, the supplied height is a height above the reference ellipsoid - * (such as {@link Ellipsoid.WGS84}) rather than an altitude above mean sea level. In other - * words, it will not necessarily be 0.0 if sampled in the ocean. + * Initiates a sampleTerrain() request at the maximum available tile level for a terrain dataset. * - * @exports sampleTerrain + * @exports sampleTerrainMostDetailed * * @param {TerrainProvider} terrainProvider The terrain provider from which to query heights. - * @param {Number} level The terrain level-of-detail from which to query terrain heights. * @param {Cartographic[]} positions The positions to update with terrain heights. - * @returns {Promise.<Cartographic[]>} A promise that resolves to the provided list of positions when terrain the query has completed. + * @returns {Promise.<Cartographic[]>} A promise that resolves to the provided list of positions when terrain the query has completed. This + * promise will reject if the terrain provider's `availability` property is undefined. * * @example * // Query the terrain height of two Cartographic positions * var terrainProvider = new Cesium.CesiumTerrainProvider({ - * url : 'https://assets.agi.com/stk-terrain/world' + * url : '//assets.agi.com/stk-terrain/world' * }); * var positions = [ * Cesium.Cartographic.fromDegrees(86.925145, 27.988257), * Cesium.Cartographic.fromDegrees(87.0, 28.0) * ]; - * var promise = Cesium.sampleTerrain(terrainProvider, 11, positions); + * var promise = Cesium.sampleTerrainMostDetailed(terrainProvider, positions); * Cesium.when(promise, function(updatedPositions) { * // positions[0].height and positions[1].height have been updated. * // updatedPositions is just a reference to positions. * }); */ - function sampleTerrain(terrainProvider, level, positions) { + function sampleTerrainMostDetailed(terrainProvider, positions) { if (!defined(terrainProvider)) { throw new DeveloperError('terrainProvider is required.'); } - if (!defined(level)) { - throw new DeveloperError('level is required.'); - } if (!defined(positions)) { throw new DeveloperError('positions is required.'); } - var deferred = when.defer(); - - function doSamplingWhenReady() { - if (terrainProvider.ready) { - when(doSampling(terrainProvider, level, positions), function(updatedPositions) { - deferred.resolve(updatedPositions); - }); - } else { - setTimeout(doSamplingWhenReady, 10); - } - } - - doSamplingWhenReady(); - - return deferred.promise; - } + return terrainProvider.readyPromise.then(function() { + var byLevel = []; - function doSampling(terrainProvider, level, positions) { - var tilingScheme = terrainProvider.tilingScheme; - - var i; + var availability = terrainProvider.availability; - // Sort points into a set of tiles - var tileRequests = []; // Result will be an Array as it's easier to work with - var tileRequestSet = {}; // A unique set - for (i = 0; i < positions.length; ++i) { - var xy = tilingScheme.positionToTileXY(positions[i], level); - var key = xy.toString(); - - if (!tileRequestSet.hasOwnProperty(key)) { - // When tile is requested for the first time - var value = { - x : xy.x, - y : xy.y, - level : level, - tilingScheme : tilingScheme, - terrainProvider : terrainProvider, - positions : [] - }; - tileRequestSet[key] = value; - tileRequests.push(value); + if (!defined(availability)) { + throw new DeveloperError('sampleTerrainMostDetailed requires a terrain provider that has tile availability.'); } + + for (var i = 0; i < positions.length; ++i) { + var position = positions[i]; + var maxLevel = availability.computeMaximumLevelAtPosition(position); - // Now append to array of points for the tile - tileRequestSet[key].positions.push(positions[i]); - } - - // Send request for each required tile - var tilePromises = []; - for (i = 0; i < tileRequests.length; ++i) { - var tileRequest = tileRequests[i]; - var requestPromise = tileRequest.terrainProvider.requestTileGeometry(tileRequest.x, tileRequest.y, tileRequest.level, false); - var tilePromise = when(requestPromise, createInterpolateFunction(tileRequest), createMarkFailedFunction(tileRequest)); - tilePromises.push(tilePromise); - } - - return when.all(tilePromises, function() { - return positions; - }); - } - - function createInterpolateFunction(tileRequest) { - var tilePositions = tileRequest.positions; - var rectangle = tileRequest.tilingScheme.tileXYToRectangle(tileRequest.x, tileRequest.y, tileRequest.level); - return function(terrainData) { - for (var i = 0; i < tilePositions.length; ++i) { - var position = tilePositions[i]; - position.height = terrainData.interpolateHeight(rectangle, position.longitude, position.latitude); + var atLevel = byLevel[maxLevel]; + if (!defined(atLevel)) { + byLevel[maxLevel] = atLevel = []; + } + atLevel.push(position); } - }; - } - function createMarkFailedFunction(tileRequest) { - var tilePositions = tileRequest.positions; - return function() { - for (var i = 0; i < tilePositions.length; ++i) { - var position = tilePositions[i]; - position.height = undefined; - } - }; + return when.all(byLevel.map(function(positionsAtLevel, index) { + if (defined(positionsAtLevel)) { + return sampleTerrain(terrainProvider, index, positionsAtLevel); + } + })).then(function() { + return positions; + }); + }); } - return sampleTerrain; + return sampleTerrainMostDetailed; }); /*global define*/ @@ -58932,6 +59075,8 @@ define('Core/ScreenSpaceEventType',[ * * @type {Number} * @constant + * + * @deprecated */ RIGHT_DOUBLE_CLICK : 8, @@ -58964,6 +59109,8 @@ define('Core/ScreenSpaceEventType',[ * * @type {Number} * @constant + * + * @deprecated */ MIDDLE_DOUBLE_CLICK : 13, @@ -59017,6 +59164,7 @@ define('Core/ScreenSpaceEventHandler',[ './Cartesian2', './defaultValue', './defined', + './deprecationWarning', './destroyObject', './DeveloperError', './FeatureDetection', @@ -59028,6 +59176,7 @@ define('Core/ScreenSpaceEventHandler',[ Cartesian2, defaultValue, defined, + deprecationWarning, destroyObject, DeveloperError, FeatureDetection, @@ -59496,7 +59645,7 @@ define('Core/ScreenSpaceEventHandler',[ action(touch2StartEvent); - // Touch-enabled devices, in particular iOS can have many default behaviours for + // Touch-enabled devices, in particular iOS can have many default behaviours for // "pinch" events, which can still be executed unless we prevent them here. event.preventDefault(); } @@ -59697,6 +59846,14 @@ define('Core/ScreenSpaceEventHandler',[ registerListeners(this); } + function checkForDoubleClick(type) { + if (type === ScreenSpaceEventType.MIDDLE_DOUBLE_CLICK) { + deprecationWarning('MIDDLE_DOUBLE_CLICK', 'ScreenSpaceEventType.MIDDLE_DOUBLE_CLICK was deprecated in Cesium 1.30. It will be removed in 1.31.'); + } else if (type === ScreenSpaceEventType.RIGHT_DOUBLE_CLICK) { + deprecationWarning('RIGHT_DOUBLE_CLICK', 'ScreenSpaceEventType.RIGHT_DOUBLE_CLICK was deprecated in Cesium 1.30. It will be removed in 1.31.'); + } + } + /** * Set a function to be executed on an input event. * @@ -59716,6 +59873,8 @@ define('Core/ScreenSpaceEventHandler',[ throw new DeveloperError('type is required.'); } + checkForDoubleClick(type); + var key = getInputEventKey(type, modifier); this._inputEvents[key] = action; }; @@ -59735,6 +59894,8 @@ define('Core/ScreenSpaceEventHandler',[ throw new DeveloperError('type is required.'); } + checkForDoubleClick(type); + var key = getInputEventKey(type, modifier); return this._inputEvents[key]; }; @@ -59754,6 +59915,8 @@ define('Core/ScreenSpaceEventHandler',[ throw new DeveloperError('type is required.'); } + checkForDoubleClick(type); + var key = getInputEventKey(type, modifier); delete this._inputEvents[key]; }; @@ -60432,9 +60595,9 @@ define('Core/Simon1994PlanetaryPositions',[ * @param {Cartesian3} [result] The object onto which to store the result. * @returns {Cartesian3} Calculated sun position */ - Simon1994PlanetaryPositions.computeSunPositionInEarthInertialFrame= function(date, result){ - if (!defined(date)) { - date = JulianDate.now(); + Simon1994PlanetaryPositions.computeSunPositionInEarthInertialFrame= function(julianDate, result){ + if (!defined(julianDate)) { + julianDate = JulianDate.now(); } if (!defined(result)) { @@ -60442,11 +60605,11 @@ define('Core/Simon1994PlanetaryPositions',[ } //first forward transformation - translation = computeSimonEarthMoonBarycenter(date, translation); + translation = computeSimonEarthMoonBarycenter(julianDate, translation); result = Cartesian3.negate(translation, result); //second forward transformation - computeSimonEarth(date, translation); + computeSimonEarth(julianDate, translation); Cartesian3.subtract(result, translation, result); Matrix3.multiplyByVector(axesTransformation, result, result); @@ -60461,12 +60624,12 @@ define('Core/Simon1994PlanetaryPositions',[ * @param {Cartesian3} [result] The object onto which to store the result. * @returns {Cartesian3} Calculated moon position */ - Simon1994PlanetaryPositions.computeMoonPositionInEarthInertialFrame = function(date, result){ - if (!defined(date)) { - date = JulianDate.now(); + Simon1994PlanetaryPositions.computeMoonPositionInEarthInertialFrame = function(julianDate, result){ + if (!defined(julianDate)) { + julianDate = JulianDate.now(); } - result = computeSimonMoon(date, result); + result = computeSimonMoon(julianDate, result); Matrix3.multiplyByVector(axesTransformation, result, result); return result; @@ -60897,6 +61060,7 @@ define('Core/SimplePolylineGeometry',[ /*global define*/ define('Core/SphereGeometry',[ './Cartesian3', + './Check', './defaultValue', './defined', './DeveloperError', @@ -60904,6 +61068,7 @@ define('Core/SphereGeometry',[ './VertexFormat' ], function( Cartesian3, + Check, defaultValue, defined, DeveloperError, @@ -60965,9 +61130,7 @@ define('Core/SphereGeometry',[ * @returns {Number[]} The array that was packed into */ SphereGeometry.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } + Check.typeOf.object('value', value); return EllipsoidGeometry.pack(value._ellipsoidGeometry, array, startingIndex); }; @@ -61021,12 +61184,14 @@ define('Core/SphereGeometry',[ /*global define*/ define('Core/SphereOutlineGeometry',[ './Cartesian3', + './Check', './defaultValue', './defined', './DeveloperError', './EllipsoidOutlineGeometry' ], function( Cartesian3, + Check, defaultValue, defined, DeveloperError, @@ -61087,9 +61252,7 @@ define('Core/SphereOutlineGeometry',[ * @returns {Number[]} The array that was packed into */ SphereOutlineGeometry.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } + Check.typeOf.object('value', value); return EllipsoidOutlineGeometry.pack(value._ellipsoidGeometry, array, startingIndex); }; @@ -61142,10 +61305,12 @@ define('Core/SphereOutlineGeometry',[ /*global define*/ define('Core/Spherical',[ + './Check', './defaultValue', './defined', './DeveloperError' ], function( + Check, defaultValue, defined, DeveloperError) { @@ -61171,13 +61336,11 @@ define('Core/Spherical',[ * Converts the provided Cartesian3 into Spherical coordinates. * * @param {Cartesian3} cartesian3 The Cartesian3 to be converted to Spherical. - * @param {Spherical} [spherical] The object in which the result will be stored, if undefined a new instance will be created. + * @param {Spherical} [result] The object in which the result will be stored, if undefined a new instance will be created. * @returns {Spherical} The modified result parameter, or a new instance if one was not provided. */ Spherical.fromCartesian3 = function(cartesian3, result) { - if (!defined(cartesian3)) { - throw new DeveloperError('cartesian3 is required'); - } + Check.typeOf.object('cartesian3', cartesian3); var x = cartesian3.x; var y = cartesian3.y; @@ -61224,9 +61387,7 @@ define('Core/Spherical',[ * @returns {Spherical} The modified result parameter or a new instance if result was undefined. */ Spherical.normalize = function(spherical, result) { - if (!defined(spherical)) { - throw new DeveloperError('spherical is required'); - } + Check.typeOf.object('spherical', spherical); if (!defined(result)) { return new Spherical(spherical.clock, spherical.cone, 1.0); @@ -61818,8 +61979,8 @@ define('Core/TimeIntervalCollection',[ * @param {JulianDate} julianDate The date to check. * @returns {Boolean} <code>true</code> if the collection contains the specified date, <code>false</code> otherwise. */ - TimeIntervalCollection.prototype.contains = function(date) { - return this.indexOf(date) >= 0; + TimeIntervalCollection.prototype.contains = function(julianDate) { + return this.indexOf(julianDate) >= 0; }; var indexOfScratch = new TimeInterval(); @@ -63134,7 +63295,7 @@ define('Core/WallGeometry',[ var scratchCartesian3Position3 = new Cartesian3(); var scratchCartesian3Position4 = new Cartesian3(); var scratchCartesian3Position5 = new Cartesian3(); - var scratchBinormal = new Cartesian3(); + var scratchBitangent = new Cartesian3(); var scratchTangent = new Cartesian3(); var scratchNormal = new Cartesian3(); @@ -63465,12 +63626,12 @@ define('Core/WallGeometry',[ var positions = vertexFormat.position ? new Float64Array(size) : undefined; var normals = vertexFormat.normal ? new Float32Array(size) : undefined; var tangents = vertexFormat.tangent ? new Float32Array(size) : undefined; - var binormals = vertexFormat.binormal ? new Float32Array(size) : undefined; + var bitangents = vertexFormat.bitangent ? new Float32Array(size) : undefined; var textureCoordinates = vertexFormat.st ? new Float32Array(size / 3 * 2) : undefined; var positionIndex = 0; var normalIndex = 0; - var binormalIndex = 0; + var bitangentIndex = 0; var tangentIndex = 0; var stIndex = 0; @@ -63478,7 +63639,7 @@ define('Core/WallGeometry',[ // points being even and upper points being odd var normal = scratchNormal; var tangent = scratchTangent; - var binormal = scratchBinormal; + var bitangent = scratchBitangent; var recomputeNormal = true; length /= 3; var i; @@ -63508,7 +63669,7 @@ define('Core/WallGeometry',[ textureCoordinates[stIndex++] = 1.0; } - if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.binormal) { + if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent) { var nextPosition; var nextTop = Cartesian3.clone(Cartesian3.ZERO, scratchCartesian3Position5); var groundPosition = ellipsoid.scaleToGeodeticSurface(Cartesian3.fromArray(topPositions, i3, scratchCartesian3Position2), scratchCartesian3Position2); @@ -63531,8 +63692,8 @@ define('Core/WallGeometry',[ if (vertexFormat.tangent) { tangent = Cartesian3.normalize(Cartesian3.subtract(nextPosition, groundPosition, tangent), tangent); } - if (vertexFormat.binormal) { - binormal = Cartesian3.normalize(Cartesian3.cross(normal, tangent, binormal), binormal); + if (vertexFormat.bitangent) { + bitangent = Cartesian3.normalize(Cartesian3.cross(normal, tangent, bitangent), bitangent); } } @@ -63556,14 +63717,14 @@ define('Core/WallGeometry',[ tangents[tangentIndex++] = tangent.z; } - if (vertexFormat.binormal) { - binormals[binormalIndex++] = binormal.x; - binormals[binormalIndex++] = binormal.y; - binormals[binormalIndex++] = binormal.z; + if (vertexFormat.bitangent) { + bitangents[bitangentIndex++] = bitangent.x; + bitangents[bitangentIndex++] = bitangent.y; + bitangents[bitangentIndex++] = bitangent.z; - binormals[binormalIndex++] = binormal.x; - binormals[binormalIndex++] = binormal.y; - binormals[binormalIndex++] = binormal.z; + bitangents[bitangentIndex++] = bitangent.x; + bitangents[bitangentIndex++] = bitangent.y; + bitangents[bitangentIndex++] = bitangent.z; } } } @@ -63594,11 +63755,11 @@ define('Core/WallGeometry',[ }); } - if (vertexFormat.binormal) { - attributes.binormal = new GeometryAttribute({ + if (vertexFormat.bitangent) { + attributes.bitangent = new GeometryAttribute({ componentDatatype : ComponentDatatype.FLOAT, componentsPerAttribute : 3, - values : binormals + values : bitangents }); } @@ -65524,12 +65685,12 @@ define('Shaders/Appearances/AllMaterialAppearanceFS',[],function() { return "varying vec3 v_positionEC;\n\ varying vec3 v_normalEC;\n\ varying vec3 v_tangentEC;\n\ -varying vec3 v_binormalEC;\n\ +varying vec3 v_bitangentEC;\n\ varying vec2 v_st;\n\ void main()\n\ {\n\ vec3 positionToEyeEC = -v_positionEC;\n\ -mat3 tangentToEyeMatrix = czm_tangentToEyeSpaceMatrix(v_normalEC, v_tangentEC, v_binormalEC);\n\ +mat3 tangentToEyeMatrix = czm_tangentToEyeSpaceMatrix(v_normalEC, v_tangentEC, v_bitangentEC);\n\ vec3 normalEC = normalize(v_normalEC);\n\ #ifdef FACE_FORWARD\n\ normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n\ @@ -65556,13 +65717,13 @@ define('Shaders/Appearances/AllMaterialAppearanceVS',[],function() { attribute vec3 position3DLow;\n\ attribute vec3 normal;\n\ attribute vec3 tangent;\n\ -attribute vec3 binormal;\n\ +attribute vec3 bitangent;\n\ attribute vec2 st;\n\ attribute float batchId;\n\ varying vec3 v_positionEC;\n\ varying vec3 v_normalEC;\n\ varying vec3 v_tangentEC;\n\ -varying vec3 v_binormalEC;\n\ +varying vec3 v_bitangentEC;\n\ varying vec2 v_st;\n\ void main()\n\ {\n\ @@ -65570,7 +65731,7 @@ vec4 p = czm_computePosition();\n\ v_positionEC = (czm_modelViewRelativeToEye * p).xyz;\n\ v_normalEC = czm_normal * normal;\n\ v_tangentEC = czm_normal * tangent;\n\ -v_binormalEC = czm_normal * binormal;\n\ +v_bitangentEC = czm_normal * bitangent;\n\ v_st = st;\n\ gl_Position = czm_modelViewProjectionRelativeToEye * p;\n\ }\n\ @@ -69455,7 +69616,7 @@ define('Scene/Material',[ }, translucent : function(material) { var uniforms = material.uniforms; - return (uniforms.fadeInColor.alpha < 1.0) || (uniforms.fadeOutColor.alpha < 0.0); + return (uniforms.fadeInColor.alpha < 1.0) || (uniforms.fadeOutColor.alpha < 1.0); } }); @@ -69832,7 +69993,7 @@ define('Scene/MaterialAppearance',[ /** * All materials, including those that work in tangent space, are supported. * This requires <code>position</code>, <code>normal</code>, <code>st</code>, - * <code>binormal</code>, and <code>tangent</code> vertex attributes. + * <code>tangent</code>, and <code>bitangent</code> vertex attributes. * * @constant */ @@ -73098,6 +73259,40 @@ define('Renderer/AutomaticUniforms',[ getValue : function(uniformState) { return uniformState.fogDensity; } + }), + + /** + * An automatic GLSL uniform representing the splitter position to use when rendering imagery layers with a splitter. + * This will be in the range 0.0 to 1.0 with 0.0 being the far left of the viewport and 1.0 being the far right of the viewport. + * + * @alias czm_imagerySplitPosition + * @glslUniform + * + * + * @example + * // GLSL declaration + * uniform float czm_imagerySplitPosition; + */ + czm_imagerySplitPosition : new AutomaticUniform({ + size : 1, + datatype : WebGLConstants.FLOAT, + getValue : function(uniformState) { + return uniformState.imagerySplitPosition; + } + }), + + /** + * An automatic GLSL uniform scalar representing the geometric tolerance per meter + * + * @alias czm_geometricToleranceOverMeter + * @glslUniform + */ + czm_geometricToleranceOverMeter : new AutomaticUniform({ + size: 1, + datatype: WebGLConstants.FLOAT, + getValue: function(uniformState) { + return uniformState.geometricToleranceOverMeter; + } }) }; @@ -75541,9 +75736,12 @@ return mix(valueAtMin, valueAtMax, t);\n\ /*global define*/ define('Shaders/Builtin/Functions/octDecode',[],function() { 'use strict'; - return "vec3 czm_octDecode(vec2 encoded)\n\ + return "vec3 czm_octDecode(vec2 encoded, float range)\n\ {\n\ -encoded = encoded / 255.0 * 2.0 - 1.0;\n\ +if (encoded.x == 0.0 && encoded.y == 0.0) {\n\ +return vec3(0.0, 0.0, 0.0);\n\ +}\n\ +encoded = encoded / range * 2.0 - 1.0;\n\ vec3 v = vec3(encoded.x, encoded.y, 1.0 - abs(encoded.x) - abs(encoded.y));\n\ if (v.z < 0.0)\n\ {\n\ @@ -75551,6 +75749,10 @@ v.xy = (1.0 - abs(v.yx)) * czm_signNotZero(v.xy);\n\ }\n\ return normalize(v);\n\ }\n\ +vec3 czm_octDecode(vec2 encoded)\n\ +{\n\ +return czm_octDecode(encoded, 255.0);\n\ +}\n\ vec3 czm_octDecode(float encoded)\n\ {\n\ float temp = encoded / 256.0;\n\ @@ -75859,14 +76061,14 @@ return vec4(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero( /*global define*/ define('Shaders/Builtin/Functions/tangentToEyeSpaceMatrix',[],function() { 'use strict'; - return "mat3 czm_tangentToEyeSpaceMatrix(vec3 normalEC, vec3 tangentEC, vec3 binormalEC)\n\ + return "mat3 czm_tangentToEyeSpaceMatrix(vec3 normalEC, vec3 tangentEC, vec3 bitangentEC)\n\ {\n\ vec3 normal = normalize(normalEC);\n\ vec3 tangent = normalize(tangentEC);\n\ -vec3 binormal = normalize(binormalEC);\n\ -return mat3(tangent.x, tangent.y, tangent.z,\n\ -binormal.x, binormal.y, binormal.z,\n\ -normal.x, normal.y, normal.z);\n\ +vec3 bitangent = normalize(bitangentEC);\n\ +return mat3(tangent.x , tangent.y , tangent.z,\n\ +bitangent.x, bitangent.y, bitangent.z,\n\ +normal.x , normal.y , normal.z);\n\ }\n\ "; }); @@ -76783,7 +76985,7 @@ define('Renderer/Buffer',[ * @param {ArrayBufferView} [options.typedArray] A typed array containing the data to copy to the buffer. * @param {Number} [options.sizeInBytes] A <code>Number</code> defining the size of the buffer in bytes. Required if options.typedArray is not given. * @param {BufferUsage} options.usage Specifies the expected usage pattern of the buffer. On some GL implementations, this can significantly affect performance. See {@link BufferUsage}. - * @param {IndexDatatype} indexDatatype The datatype of indices in the buffer. + * @param {IndexDatatype} options.indexDatatype The datatype of indices in the buffer. * @returns {IndexBuffer} The index buffer, ready to be attached to a vertex array. * * @exception {DeveloperError} Must specify either <options.typedArray> or <options.sizeInBytes>, but not both. @@ -77686,6 +77888,7 @@ define('Scene/BatchTable',[ '../Core/defineProperties', '../Core/destroyObject', '../Core/DeveloperError', + '../Core/FeatureDetection', '../Core/Math', '../Core/PixelFormat', '../Core/RuntimeError', @@ -77705,6 +77908,7 @@ define('Scene/BatchTable',[ defineProperties, destroyObject, DeveloperError, + FeatureDetection, CesiumMath, PixelFormat, RuntimeError, @@ -77948,6 +78152,9 @@ define('Scene/BatchTable',[ return Cartesian4.fromElements(x, y, z, w, result); } + if (!FeatureDetection.supportsTypedArrays()) { + return; + } var scratchFloatArray = new Float32Array(1); function packFloat(value, result) { @@ -80127,10 +80334,10 @@ define('Scene/Primitive',[ } var containsTangent = vertexShaderSource.search(/attribute\s+vec3\s+tangent;/g) !== -1; - var containsBinormal = vertexShaderSource.search(/attribute\s+vec3\s+binormal;/g) !== -1; + var containsBitangent = vertexShaderSource.search(/attribute\s+vec3\s+bitangent;/g) !== -1; var numComponents = containsSt && containsNormal ? 2.0 : 1.0; - numComponents += containsTangent || containsBinormal ? 1 : 0; + numComponents += containsTangent || containsBitangent ? 1 : 0; var type = (numComponents > 1) ? 'vec' + numComponents : 'float'; @@ -80146,12 +80353,12 @@ define('Scene/Primitive',[ decode += ' st = czm_decompressTextureCoordinates(' + stComponent + ');\n'; } - if (containsNormal && containsTangent && containsBinormal) { + if (containsNormal && containsTangent && containsBitangent) { globalDecl += 'vec3 normal;\n' + 'vec3 tangent;\n' + - 'vec3 binormal;\n'; - decode += ' czm_octDecode(' + attributeName + '.' + (containsSt ? 'yz' : 'xy') + ', normal, tangent, binormal);\n'; + 'vec3 bitangent;\n'; + decode += ' czm_octDecode(' + attributeName + '.' + (containsSt ? 'yz' : 'xy') + ', normal, tangent, bitangent);\n'; } else { if (containsNormal) { globalDecl += 'vec3 normal;\n'; @@ -80163,9 +80370,9 @@ define('Scene/Primitive',[ decode += ' tangent = czm_octDecode(' + attributeName + '.' + (containsSt && containsNormal ? 'z' : 'y') + ');\n'; } - if (containsBinormal) { - globalDecl += 'vec3 binormal;\n'; - decode += ' binormal = czm_octDecode(' + attributeName + '.' + (containsSt && containsNormal ? 'z' : 'y') + ');\n'; + if (containsBitangent) { + globalDecl += 'vec3 bitangent;\n'; + decode += ' bitangent = czm_octDecode(' + attributeName + '.' + (containsSt && containsNormal ? 'z' : 'y') + ');\n'; } } @@ -80173,7 +80380,7 @@ define('Scene/Primitive',[ modifiedVS = modifiedVS.replace(/attribute\s+vec3\s+normal;/g, ''); modifiedVS = modifiedVS.replace(/attribute\s+vec2\s+st;/g, ''); modifiedVS = modifiedVS.replace(/attribute\s+vec3\s+tangent;/g, ''); - modifiedVS = modifiedVS.replace(/attribute\s+vec3\s+binormal;/g, ''); + modifiedVS = modifiedVS.replace(/attribute\s+vec3\s+bitangent;/g, ''); modifiedVS = ShaderSource.replaceMain(modifiedVS, 'czm_non_compressed_main'); var compressedMain = 'void main() \n' + @@ -81223,14 +81430,12 @@ define('DataSources/dynamicGeometryGetBoundingSphere',[ } var attributes; - var modelMatrix; //Outline and Fill geometries have the same bounding sphere, so just use whichever one is defined and ready if (defined(primitive) && primitive.show && primitive.ready) { attributes = primitive.getGeometryInstanceAttributes(entity); if (defined(attributes) && defined(attributes.boundingSphere)) { - modelMatrix = defaultValue(primitive.modelMatrix, Matrix4.IDENTITY); - BoundingSphere.transform(attributes.boundingSphere, modelMatrix, result); + BoundingSphere.clone(attributes.boundingSphere, result); return BoundingSphereState.DONE; } } @@ -81238,8 +81443,7 @@ define('DataSources/dynamicGeometryGetBoundingSphere',[ if (defined(outlinePrimitive) && outlinePrimitive.show && outlinePrimitive.ready) { attributes = outlinePrimitive.getGeometryInstanceAttributes(entity); if (defined(attributes) && defined(attributes.boundingSphere)) { - modelMatrix = defaultValue(outlinePrimitive.modelMatrix, Matrix4.IDENTITY); - BoundingSphere.transform(attributes.boundingSphere, modelMatrix, result); + BoundingSphere.clone(attributes.boundingSphere, result); return BoundingSphereState.DONE; } } @@ -88699,8 +88903,10 @@ define('Shaders/ShadowVolumeVS',[],function() { 'use strict'; return "attribute vec3 position3DHigh;\n\ attribute vec3 position3DLow;\n\ +attribute vec3 extrudeDirection;\n\ attribute vec4 color;\n\ attribute float batchId;\n\ +uniform float u_globeMinimumAltitude;\n\ varying float v_WindowZ;\n\ varying vec4 v_color;\n\ vec4 depthClampFarPlane(vec4 vertexInClipCoordinates)\n\ @@ -88713,6 +88919,8 @@ void main()\n\ {\n\ v_color = color;\n\ vec4 position = czm_computePosition();\n\ +float delta = min(u_globeMinimumAltitude, czm_geometricToleranceOverMeter * length(position.xyz));\n\ +position = position + vec4(extrudeDirection * delta, 0.0);\n\ gl_Position = depthClampFarPlane(czm_modelViewProjectionRelativeToEye * position);\n\ }\n\ "; @@ -88973,6 +89181,7 @@ define('Scene/GroundPrimitive',[ '../Core/Cartesian2', '../Core/Cartesian3', '../Core/Cartographic', + '../Core/clone', '../Core/Color', '../Core/ColorGeometryInstanceAttribute', '../Core/defaultValue', @@ -89008,6 +89217,7 @@ define('Scene/GroundPrimitive',[ Cartesian2, Cartesian3, Cartographic, + clone, Color, ColorGeometryInstanceAttribute, defaultValue, @@ -89051,7 +89261,7 @@ define('Scene/GroundPrimitive',[ * </p> * <p> * Because of the cutting edge nature of this feature in WebGL, it requires the EXT_frag_depth extension, which is currently only supported in Chrome, - * Firefox, and Edge. Apple support is expected in iOS 9 and MacOS Safari 9. Android support varies by hardware and IE11 will most likely never support + * Firefox, Edge, and Safari 10. It's not yet supported in iOS 10. Android support varies by hardware and IE11 will most likely never support * it. You can use webglreport.com to verify support for your hardware. * </p> * <p> @@ -89164,9 +89374,7 @@ define('Scene/GroundPrimitive',[ /** * This property is for debugging only; it is not for production use nor is it optimized. * <p> - * Draws the shadow volume for each geometry in the primitive. Must be <code>true</code> on - * creation for the volumes to be created before the geometry is released or releaseGeometryInstances - * must be <code>false</code> + * Draws the shadow volume for each geometry in the primitive. * </p> * * @type {Boolean} @@ -89174,6 +89382,7 @@ define('Scene/GroundPrimitive',[ * @default false */ this.debugShowShadowVolume = defaultValue(options.debugShowShadowVolume, false); + this._debugShowShadowVolume = false; this._sp = undefined; this._spPick = undefined; @@ -89183,7 +89392,11 @@ define('Scene/GroundPrimitive',[ this._rsColorPass = undefined; this._rsPickPass = undefined; - this._uniformMap = {}; + this._uniformMap = { + u_globeMinimumAltitude: function() { + return 55000.0; + } + }; this._boundingVolumes = []; this._boundingVolumes2D = []; @@ -89192,7 +89405,6 @@ define('Scene/GroundPrimitive',[ this._readyPromise = when.defer(); this._primitive = undefined; - this._debugPrimitive = undefined; this._maxHeight = undefined; this._minHeight = undefined; @@ -89387,91 +89599,98 @@ define('Scene/GroundPrimitive',[ }; } - var stencilPreloadRenderState = { - colorMask : { - red : false, - green : false, - blue : false, - alpha : false - }, - stencilTest : { - enabled : true, - frontFunction : StencilFunction.ALWAYS, - frontOperation : { - fail : StencilOperation.KEEP, - zFail : StencilOperation.DECREMENT_WRAP, - zPass : StencilOperation.DECREMENT_WRAP + function getStencilPreloadRenderState(enableStencil) { + return { + colorMask : { + red : false, + green : false, + blue : false, + alpha : false }, - backFunction : StencilFunction.ALWAYS, - backOperation : { - fail : StencilOperation.KEEP, - zFail : StencilOperation.INCREMENT_WRAP, - zPass : StencilOperation.INCREMENT_WRAP + stencilTest : { + enabled : enableStencil, + frontFunction : StencilFunction.ALWAYS, + frontOperation : { + fail : StencilOperation.KEEP, + zFail : StencilOperation.DECREMENT_WRAP, + zPass : StencilOperation.DECREMENT_WRAP + }, + backFunction : StencilFunction.ALWAYS, + backOperation : { + fail : StencilOperation.KEEP, + zFail : StencilOperation.INCREMENT_WRAP, + zPass : StencilOperation.INCREMENT_WRAP + }, + reference : 0, + mask : ~0 }, - reference : 0, - mask : ~0 - }, - depthTest : { - enabled : false - }, - depthMask : false - }; + depthTest : { + enabled : false + }, + depthMask : false + }; + } - var stencilDepthRenderState = { - colorMask : { - red : false, - green : false, - blue : false, - alpha : false - }, - stencilTest : { - enabled : true, - frontFunction : StencilFunction.ALWAYS, - frontOperation : { - fail : StencilOperation.KEEP, - zFail : StencilOperation.KEEP, - zPass : StencilOperation.INCREMENT_WRAP + function getStencilDepthRenderState(enableStencil) { + return { + colorMask : { + red : false, + green : false, + blue : false, + alpha : false }, - backFunction : StencilFunction.ALWAYS, - backOperation : { - fail : StencilOperation.KEEP, - zFail : StencilOperation.KEEP, - zPass : StencilOperation.DECREMENT_WRAP + stencilTest : { + enabled : enableStencil, + frontFunction : StencilFunction.ALWAYS, + frontOperation : { + fail : StencilOperation.KEEP, + zFail : StencilOperation.KEEP, + zPass : StencilOperation.INCREMENT_WRAP + }, + backFunction : StencilFunction.ALWAYS, + backOperation : { + fail : StencilOperation.KEEP, + zFail : StencilOperation.KEEP, + zPass : StencilOperation.DECREMENT_WRAP + }, + reference : 0, + mask : ~0 }, - reference : 0, - mask : ~0 - }, - depthTest : { - enabled : true, - func : DepthFunction.LESS_OR_EQUAL - }, - depthMask : false - }; + depthTest : { + enabled : true, + func : DepthFunction.LESS_OR_EQUAL + }, + depthMask : false + }; + } - var colorRenderState = { - stencilTest : { - enabled : true, - frontFunction : StencilFunction.NOT_EQUAL, - frontOperation : { - fail : StencilOperation.KEEP, - zFail : StencilOperation.KEEP, - zPass : StencilOperation.DECREMENT_WRAP + + function getColorRenderState(enableStencil) { + return { + stencilTest : { + enabled : enableStencil, + frontFunction : StencilFunction.NOT_EQUAL, + frontOperation : { + fail : StencilOperation.KEEP, + zFail : StencilOperation.KEEP, + zPass : StencilOperation.DECREMENT_WRAP + }, + backFunction : StencilFunction.NOT_EQUAL, + backOperation : { + fail : StencilOperation.KEEP, + zFail : StencilOperation.KEEP, + zPass : StencilOperation.DECREMENT_WRAP + }, + reference : 0, + mask : ~0 }, - backFunction : StencilFunction.NOT_EQUAL, - backOperation : { - fail : StencilOperation.KEEP, - zFail : StencilOperation.KEEP, - zPass : StencilOperation.DECREMENT_WRAP + depthTest : { + enabled : false }, - reference : 0, - mask : ~0 - }, - depthTest : { - enabled : false - }, - depthMask : false, - blending : BlendingState.ALPHA_BLEND - }; + depthMask : false, + blending : BlendingState.ALPHA_BLEND + }; + } var pickRenderState = { stencilTest : { @@ -89508,7 +89727,7 @@ define('Scene/GroundPrimitive',[ function getRectangle(frameState, geometry) { var ellipsoid = frameState.mapProjection.ellipsoid; - + if (!defined(geometry.attributes) || !defined(geometry.attributes.position3DHigh)) { if (defined(geometry.rectangle)) { return geometry.rectangle; @@ -89652,70 +89871,100 @@ define('Scene/GroundPrimitive',[ var result = BoundingSphere.fromRectangle3D(rectangle, ellipsoid, 0.0); BoundingSphere.fromRectangle3D(rectangle, ellipsoid, maxTerrainHeight, scratchBoundingSphere); - + return BoundingSphere.union(result, scratchBoundingSphere, result); } - function createBoundingVolume(primitive, frameState, geometry) { + function createBoundingVolume(groundPrimitive, frameState, geometry) { var ellipsoid = frameState.mapProjection.ellipsoid; var rectangle = getRectangle(frameState, geometry); // Use an oriented bounding box by default, but switch to a bounding sphere if bounding box creation would fail. if (rectangle.width < CesiumMath.PI) { - var obb = OrientedBoundingBox.fromRectangle(rectangle, primitive._maxHeight, primitive._minHeight, ellipsoid); - primitive._boundingVolumes.push(obb); + var obb = OrientedBoundingBox.fromRectangle(rectangle, groundPrimitive._maxHeight, groundPrimitive._minHeight, ellipsoid); + groundPrimitive._boundingVolumes.push(obb); } else { var highPositions = geometry.attributes.position3DHigh.values; var lowPositions = geometry.attributes.position3DLow.values; - primitive._boundingVolumes.push(BoundingSphere.fromEncodedCartesianVertices(highPositions, lowPositions)); + groundPrimitive._boundingVolumes.push(BoundingSphere.fromEncodedCartesianVertices(highPositions, lowPositions)); } if (!frameState.scene3DOnly) { var projection = frameState.mapProjection; - var boundingVolume = BoundingSphere.fromRectangleWithHeights2D(rectangle, projection, primitive._maxHeight, primitive._minHeight); + var boundingVolume = BoundingSphere.fromRectangleWithHeights2D(rectangle, projection, groundPrimitive._maxHeight, groundPrimitive._minHeight); Cartesian3.fromElements(boundingVolume.center.z, boundingVolume.center.x, boundingVolume.center.y, boundingVolume.center); - primitive._boundingVolumes2D.push(boundingVolume); + groundPrimitive._boundingVolumes2D.push(boundingVolume); } } - function createRenderStates(primitive, context, appearance, twoPasses) { - if (defined(primitive._rsStencilPreloadPass)) { + function createRenderStates(groundPrimitive, context, appearance, twoPasses) { + if (defined(groundPrimitive._rsStencilPreloadPass)) { return; } + var stencilEnabled = !groundPrimitive.debugShowShadowVolume; - primitive._rsStencilPreloadPass = RenderState.fromCache(stencilPreloadRenderState); - primitive._rsStencilDepthPass = RenderState.fromCache(stencilDepthRenderState); - primitive._rsColorPass = RenderState.fromCache(colorRenderState); - primitive._rsPickPass = RenderState.fromCache(pickRenderState); + groundPrimitive._rsStencilPreloadPass = RenderState.fromCache(getStencilPreloadRenderState(stencilEnabled)); + groundPrimitive._rsStencilDepthPass = RenderState.fromCache(getStencilDepthRenderState(stencilEnabled)); + groundPrimitive._rsColorPass = RenderState.fromCache(getColorRenderState(stencilEnabled)); + groundPrimitive._rsPickPass = RenderState.fromCache(pickRenderState); } - function createShaderProgram(primitive, frameState, appearance) { - if (defined(primitive._sp)) { + function modifyForEncodedNormals(primitive, vertexShaderSource) { + if (!primitive.compressVertices) { + return vertexShaderSource; + } + + if (vertexShaderSource.search(/attribute\s+vec3\s+extrudeDirection;/g) !== -1) { + var attributeName = 'compressedAttributes'; + + //only shadow volumes use extrudeDirection, and shadow volumes use vertexFormat: POSITION_ONLY so we don't need to check other attributes + var attributeDecl = 'attribute vec2 ' + attributeName + ';'; + + var globalDecl = 'vec3 extrudeDirection;\n'; + var decode = ' extrudeDirection = czm_octDecode(' + attributeName + ', 65535.0);\n'; + + var modifiedVS = vertexShaderSource; + modifiedVS = modifiedVS.replace(/attribute\s+vec3\s+extrudeDirection;/g, ''); + modifiedVS = ShaderSource.replaceMain(modifiedVS, 'czm_non_compressed_main'); + var compressedMain = + 'void main() \n' + + '{ \n' + + decode + + ' czm_non_compressed_main(); \n' + + '}'; + + return [attributeDecl, globalDecl, modifiedVS, compressedMain].join('\n'); + } + } + + function createShaderProgram(groundPrimitive, frameState, appearance) { + if (defined(groundPrimitive._sp)) { return; } var context = frameState.context; - + var primitive = groundPrimitive._primitive; var vs = ShadowVolumeVS; - vs = primitive._primitive._batchTable.getVertexShaderCallback()(vs); - vs = Primitive._appendShowToShader(primitive._primitive, vs); - vs = Primitive._appendDistanceDisplayConditionToShader(primitive._primitive, vs); - vs = Primitive._modifyShaderPosition(primitive, vs, frameState.scene3DOnly); - vs = Primitive._updateColorAttribute(primitive._primitive, vs); + vs = groundPrimitive._primitive._batchTable.getVertexShaderCallback()(vs); + vs = Primitive._appendShowToShader(primitive, vs); + vs = Primitive._appendDistanceDisplayConditionToShader(primitive, vs); + vs = Primitive._modifyShaderPosition(groundPrimitive, vs, frameState.scene3DOnly); + vs = Primitive._updateColorAttribute(primitive, vs); + vs = modifyForEncodedNormals(primitive, vs); var fs = ShadowVolumeFS; - var attributeLocations = primitive._primitive._attributeLocations; + var attributeLocations = groundPrimitive._primitive._attributeLocations; - primitive._sp = ShaderProgram.replaceCache({ + groundPrimitive._sp = ShaderProgram.replaceCache({ context : context, - shaderProgram : primitive._sp, + shaderProgram : groundPrimitive._sp, vertexShaderSource : vs, fragmentShaderSource : fs, attributeLocations : attributeLocations }); - if (primitive._primitive.allowPicking) { + if (groundPrimitive._primitive.allowPicking) { var vsPick = ShaderSource.createPickVertexShaderSource(vs); vsPick = Primitive._updatePickColorAttribute(vsPick); @@ -89723,15 +89972,15 @@ define('Scene/GroundPrimitive',[ sources : [fs], pickColorQualifier : 'varying' }); - primitive._spPick = ShaderProgram.replaceCache({ + groundPrimitive._spPick = ShaderProgram.replaceCache({ context : context, - shaderProgram : primitive._spPick, + shaderProgram : groundPrimitive._spPick, vertexShaderSource : vsPick, fragmentShaderSource : pickFS, attributeLocations : attributeLocations }); } else { - primitive._spPick = ShaderProgram.fromCache({ + groundPrimitive._spPick = ShaderProgram.fromCache({ context : context, vertexShaderSource : vs, fragmentShaderSource : fs, @@ -89973,8 +90222,10 @@ define('Scene/GroundPrimitive',[ return; } + var that = this; + var primitiveOptions = this._primitiveOptions; + if (!defined(this._primitive)) { - var primitiveOptions = this._primitiveOptions; var ellipsoid = frameState.mapProjection.ellipsoid; var instance; @@ -90044,7 +90295,6 @@ define('Scene/GroundPrimitive',[ primitiveOptions.geometryInstances = groundInstances; - var that = this; primitiveOptions._createBoundingVolumeFunction = function(frameState, geometry) { createBoundingVolume(that, frameState, geometry); }; @@ -90078,52 +90328,20 @@ define('Scene/GroundPrimitive',[ }); } - this._primitive.debugShowBoundingVolume = this.debugShowBoundingVolume; - this._primitive.update(frameState); - - if (this.debugShowShadowVolume && !defined(this._debugPrimitive) && defined(this.geometryInstances)) { - var debugInstances = isArray(this.geometryInstances) ? this.geometryInstances : [this.geometryInstances]; - var debugLength = debugInstances.length; - var debugVolumeInstances = new Array(debugLength); - - for (var j = 0 ; j < debugLength; ++j) { - var debugInstance = debugInstances[j]; - var debugGeometry = debugInstance.geometry; - var debugInstanceType = debugGeometry.constructor; - if (defined(debugInstanceType) && defined(debugInstanceType.createShadowVolume)) { - var debugColorArray = debugInstance.attributes.color.value; - var debugColor = Color.fromBytes(debugColorArray[0], debugColorArray[1], debugColorArray[2], debugColorArray[3]); - Color.subtract(new Color(1.0, 1.0, 1.0, 0.0), debugColor, debugColor); - debugVolumeInstances[j] = new GeometryInstance({ - geometry : debugInstanceType.createShadowVolume(debugGeometry, getComputeMinimumHeightFunction(this), getComputeMaximumHeightFunction(this)), - attributes : { - color : ColorGeometryInstanceAttribute.fromColor(debugColor) - }, - id : debugInstance.id, - pickPrimitive : this - }); - } - } - - this._debugPrimitive = new Primitive({ - geometryInstances : debugVolumeInstances, - releaseGeometryInstances : true, - allowPicking : false, - asynchronous : false, - appearance : new PerInstanceColorAppearance({ - flat : true - }) - }); + if (this.debugShowShadowVolume && !this._debugShowShadowVolume && this._ready) { + this._debugShowShadowVolume = true; + this._rsStencilPreloadPass = RenderState.fromCache(getStencilPreloadRenderState(false)); + this._rsStencilDepthPass = RenderState.fromCache(getStencilDepthRenderState(false)); + this._rsColorPass = RenderState.fromCache(getColorRenderState(false)); + } else if (!this.debugShowShadowVolume && this._debugShowShadowVolume) { + this._debugShowShadowVolume = false; + this._rsStencilPreloadPass = RenderState.fromCache(getStencilPreloadRenderState(true)); + this._rsStencilDepthPass = RenderState.fromCache(getStencilDepthRenderState(true)); + this._rsColorPass = RenderState.fromCache(getColorRenderState(true)); } - if (defined(this._debugPrimitive)) { - if (this.debugShowShadowVolume) { - this._debugPrimitive.update(frameState); - } else { - this._debugPrimitive.destroy(); - this._debugPrimitive = undefined; - } - } + this._primitive.debugShowBoundingVolume = this.debugShowBoundingVolume; + this._primitive.update(frameState); }; /** @@ -90193,7 +90411,6 @@ define('Scene/GroundPrimitive',[ */ GroundPrimitive.prototype.destroy = function() { this._primitive = this._primitive && this._primitive.destroy(); - this._debugPrimitive = this._debugPrimitive && this._debugPrimitive.destroy(); this._sp = this._sp && this._sp.destroy(); this._spPick = this._spPick && this._spPick.destroy(); return destroyObject(this); @@ -90445,7 +90662,7 @@ define('DataSources/CorridorGeometryUpdater',[ * Gets the property specifying whether the geometry * casts or receives shadows from each light source. * @memberof CorridorGeometryUpdater.prototype - * + * * @type {Property} * @readonly */ @@ -90750,6 +90967,7 @@ define('DataSources/CorridorGeometryUpdater',[ * Creates the dynamic updater to be used when GeometryUpdater#isDynamic is true. * * @param {PrimitiveCollection} primitives The primitive collection to use. + * @param {PrimitiveCollection} groundPrimitives The ground primitives collection to use. * @returns {DynamicGeometryUpdater} The dynamic updater used to update the geometry each frame. * * @exception {DeveloperError} This instance does not represent dynamic geometry. @@ -93108,10 +93326,24 @@ vec4 vertexColor = vec4(1.0, 1.0, 1.0, 1.0);\n\ vec4 vertexColor = v_color;\n\ #endif\n\ vec4 color = texture2D(u_atlas, v_textureCoordinates) * vertexColor;\n\ -if (color.a == 0.0)\n\ +#if defined(RENDER_FOR_PICK) || (!defined(OPAQUE) && !defined(TRANSLUCENT))\n\ +if (color.a < 0.005)\n\ +{\n\ +discard;\n\ +}\n\ +#else\n\ +#ifdef OPAQUE\n\ +if (color.a < 0.995)\n\ +{\n\ +discard;\n\ +}\n\ +#else\n\ +if (color.a >= 0.995)\n\ {\n\ discard;\n\ }\n\ +#endif\n\ +#endif\n\ #ifdef RENDER_FOR_PICK\n\ gl_FragColor = v_pickColor;\n\ #else\n\ @@ -93331,6 +93563,44 @@ v_color.a *= translucency;\n\ }\n\ "; }); +/*global define*/ +define('Scene/BlendOption',[ + '../Core/freezeObject' +], function( + freezeObject) { + 'use strict'; + + /** + * Determines how opaque and translucent parts of billboards, points, and labels are blended with the scene. + * + * @exports BlendOption + */ + var BlendOption = { + /** + * The billboards, points, or labels in the collection are completely opaque. + * @type {Number} + * @constant + */ + OPAQUE : 0, + + /** + * The billboards, points, or labels in the collection are completely translucent. + * @type {Number} + * @constant + */ + TRANSLUCENT : 1, + + /** + * The billboards, points, or labels in the collection are both opaque and translucent. + * @type {Number} + * @constant + */ + OPAQUE_AND_TRANSLUCENT : 2 + }; + + return freezeObject(BlendOption); +}); + /*global define*/ define('Renderer/Framebuffer',[ '../Core/defaultValue', @@ -94184,6 +94454,7 @@ define('Scene/BillboardCollection',[ '../Shaders/BillboardCollectionVS', './Billboard', './BlendingState', + './BlendOption', './HeightReference', './HorizontalOrigin', './SceneMode', @@ -94218,6 +94489,7 @@ define('Scene/BillboardCollection',[ BillboardCollectionVS, Billboard, BlendingState, + BlendOption, HeightReference, HorizontalOrigin, SceneMode, @@ -94289,6 +94561,9 @@ define('Scene/BillboardCollection',[ * @param {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] The 4x4 transformation matrix that transforms each billboard from model to world coordinates. * @param {Boolean} [options.debugShowBoundingVolume=false] For debugging only. Determines if this primitive's commands' bounding spheres are shown. * @param {Scene} [options.scene] Must be passed in for billboards that use the height reference property or will be depth tested against the globe. + * @param {BlendOption} [options.blendOption=BlendOption.OPAQUE_AND_TRANSLUCENT] The billboard blending option. The default + * is used for rendering both opaque and translucent billboards. However, if either all of the billboards are completely opaque or all are completely translucent, + * setting the technique to BillboardRenderTechnique.OPAQUE or BillboardRenderTechnique.TRANSLUCENT can improve performance by up to 2x. * * @performance For best performance, prefer a few collections, each with many billboards, to * many collections with only a few billboards each. Organize collections so that billboards @@ -94324,9 +94599,11 @@ define('Scene/BillboardCollection',[ this._textureAtlasGUID = undefined; this._destroyTextureAtlas = true; this._sp = undefined; - this._rs = undefined; - this._vaf = undefined; + this._spTranslucent = undefined; this._spPick = undefined; + this._rsOpaque = undefined; + this._rsTranslucent = undefined; + this._vaf = undefined; this._billboards = []; this._billboardsToUpdate = []; @@ -94424,6 +94701,17 @@ define('Scene/BillboardCollection',[ */ this.debugShowBoundingVolume = defaultValue(options.debugShowBoundingVolume, false); + /** + * The billboard blending option. The default is used for rendering both opaque and translucent billboards. + * However, if either all of the billboards are completely opaque or all are completely translucent, + * setting the technique to BillboardRenderTechnique.OPAQUE or BillboardRenderTechnique.TRANSLUCENT can improve + * performance by up to 2x. + * @type {BlendOption} + * @default BlendOption.OPAQUE_AND_TRANSLUCENT + */ + this.blendOption = defaultValue(options.blendOption, BlendOption.OPAQUE_AND_TRANSLUCENT); + this._blendOption = undefined; + this._mode = SceneMode.SCENE3D; // The buffer usage for each attribute is determined based on the usage of the attribute over time. @@ -95573,97 +95861,223 @@ define('Scene/BillboardCollection',[ } updateBoundingVolume(this, frameState, boundingVolume); - var va; - var vaLength; - var command; - var vs; - var fs; - var j; - - var commandList = frameState.commandList; + var blendOptionChanged = this._blendOption !== this.blendOption; + this._blendOption = this.blendOption; - if (pass.render) { - var colorList = this._colorCommands; + if (blendOptionChanged) { + if (this._blendOption === BlendOption.OPAQUE || this._blendOption === BlendOption.OPAQUE_AND_TRANSLUCENT) { + this._rsOpaque = RenderState.fromCache({ + depthTest : { + enabled : true, + func : WebGLConstants.LEQUAL // Allows label glyphs and billboards to overlap. + }, + depthMask : true + }); + } else { + this._rsOpaque = undefined; + } - if (!defined(this._rs)) { - this._rs = RenderState.fromCache({ + if (this._blendOption === BlendOption.TRANSLUCENT || this._blendOption === BlendOption.OPAQUE_AND_TRANSLUCENT) { + this._rsTranslucent = RenderState.fromCache({ depthTest : { enabled : true, func : WebGLConstants.LEQUAL // Allows label glyphs and billboards to overlap. }, + depthMask : this._blendOption === BlendOption.TRANSLUCENT, blending : BlendingState.ALPHA_BLEND }); + } else { + this._rsTranslucent = undefined; } + } - if (!defined(this._sp) || - (this._shaderRotation !== this._compiledShaderRotation) || - (this._shaderAlignedAxis !== this._compiledShaderAlignedAxis) || - (this._shaderScaleByDistance !== this._compiledShaderScaleByDistance) || - (this._shaderTranslucencyByDistance !== this._compiledShaderTranslucencyByDistance) || - (this._shaderPixelOffsetScaleByDistance !== this._compiledShaderPixelOffsetScaleByDistance) || - (this._shaderDistanceDisplayCondition !== this._compiledShaderDistanceDisplayCondition)) { + if (blendOptionChanged || + (this._shaderRotation !== this._compiledShaderRotation) || + (this._shaderAlignedAxis !== this._compiledShaderAlignedAxis) || + (this._shaderScaleByDistance !== this._compiledShaderScaleByDistance) || + (this._shaderTranslucencyByDistance !== this._compiledShaderTranslucencyByDistance) || + (this._shaderPixelOffsetScaleByDistance !== this._compiledShaderPixelOffsetScaleByDistance) || + (this._shaderDistanceDisplayCondition !== this._compiledShaderDistanceDisplayCondition)) { - vs = new ShaderSource({ - sources : [BillboardCollectionVS] + vs = new ShaderSource({ + sources : [BillboardCollectionVS] + }); + if (this._instanced) { + vs.defines.push('INSTANCED'); + } + if (this._shaderRotation) { + vs.defines.push('ROTATION'); + } + if (this._shaderAlignedAxis) { + vs.defines.push('ALIGNED_AXIS'); + } + if (this._shaderScaleByDistance) { + vs.defines.push('EYE_DISTANCE_SCALING'); + } + if (this._shaderTranslucencyByDistance) { + vs.defines.push('EYE_DISTANCE_TRANSLUCENCY'); + } + if (this._shaderPixelOffsetScaleByDistance) { + vs.defines.push('EYE_DISTANCE_PIXEL_OFFSET'); + } + if (this._shaderDistanceDisplayCondition) { + vs.defines.push('DISTANCE_DISPLAY_CONDITION'); + } + + if (this._blendOption === BlendOption.OPAQUE_AND_TRANSLUCENT) { + fs = new ShaderSource({ + defines : ['OPAQUE'], + sources : [BillboardCollectionFS] + }); + this._sp = ShaderProgram.replaceCache({ + context : context, + shaderProgram : this._sp, + vertexShaderSource : vs, + fragmentShaderSource : fs, + attributeLocations : attributeLocations }); - if (this._instanced) { - vs.defines.push('INSTANCED'); - } - if (this._shaderRotation) { - vs.defines.push('ROTATION'); - } - if (this._shaderAlignedAxis) { - vs.defines.push('ALIGNED_AXIS'); - } - if (this._shaderScaleByDistance) { - vs.defines.push('EYE_DISTANCE_SCALING'); - } - if (this._shaderTranslucencyByDistance) { - vs.defines.push('EYE_DISTANCE_TRANSLUCENCY'); - } - if (this._shaderPixelOffsetScaleByDistance) { - vs.defines.push('EYE_DISTANCE_PIXEL_OFFSET'); - } - if (this._shaderDistanceDisplayCondition) { - vs.defines.push('DISTANCE_DISPLAY_CONDITION'); - } + fs = new ShaderSource({ + defines : ['TRANSLUCENT'], + sources : [BillboardCollectionFS] + }); + this._spTranslucent = ShaderProgram.replaceCache({ + context : context, + shaderProgram : this._spTranslucent, + vertexShaderSource : vs, + fragmentShaderSource : fs, + attributeLocations : attributeLocations + }); + } + + if (this._blendOption === BlendOption.OPAQUE) { + fs = new ShaderSource({ + sources : [BillboardCollectionFS] + }); this._sp = ShaderProgram.replaceCache({ context : context, shaderProgram : this._sp, vertexShaderSource : vs, - fragmentShaderSource : BillboardCollectionFS, + fragmentShaderSource : fs, attributeLocations : attributeLocations }); + } - this._compiledShaderRotation = this._shaderRotation; - this._compiledShaderAlignedAxis = this._shaderAlignedAxis; - this._compiledShaderScaleByDistance = this._shaderScaleByDistance; - this._compiledShaderTranslucencyByDistance = this._shaderTranslucencyByDistance; - this._compiledShaderPixelOffsetScaleByDistance = this._shaderPixelOffsetScaleByDistance; - this._compiledShaderDistanceDisplayCondition = this._shaderDistanceDisplayCondition; + if (this._blendOption === BlendOption.TRANSLUCENT) { + fs = new ShaderSource({ + sources : [BillboardCollectionFS] + }); + this._spTranslucent = ShaderProgram.replaceCache({ + context : context, + shaderProgram : this._spTranslucent, + vertexShaderSource : vs, + fragmentShaderSource : fs, + attributeLocations : attributeLocations + }); } + this._compiledShaderRotation = this._shaderRotation; + this._compiledShaderAlignedAxis = this._shaderAlignedAxis; + this._compiledShaderScaleByDistance = this._shaderScaleByDistance; + this._compiledShaderTranslucencyByDistance = this._shaderTranslucencyByDistance; + this._compiledShaderPixelOffsetScaleByDistance = this._shaderPixelOffsetScaleByDistance; + this._compiledShaderDistanceDisplayCondition = this._shaderDistanceDisplayCondition; + } + + if (!defined(this._spPick) || + (this._shaderRotation !== this._compiledShaderRotationPick) || + (this._shaderAlignedAxis !== this._compiledShaderAlignedAxisPick) || + (this._shaderScaleByDistance !== this._compiledShaderScaleByDistancePick) || + (this._shaderTranslucencyByDistance !== this._compiledShaderTranslucencyByDistancePick) || + (this._shaderPixelOffsetScaleByDistance !== this._compiledShaderPixelOffsetScaleByDistancePick) || + (this._shaderDistanceDisplayCondition !== this._compiledShaderDistanceDisplayConditionPick)) { + + vs = new ShaderSource({ + defines : ['RENDER_FOR_PICK'], + sources : [BillboardCollectionVS] + }); + + if(this._instanced) { + vs.defines.push('INSTANCED'); + } + if (this._shaderRotation) { + vs.defines.push('ROTATION'); + } + if (this._shaderAlignedAxis) { + vs.defines.push('ALIGNED_AXIS'); + } + if (this._shaderScaleByDistance) { + vs.defines.push('EYE_DISTANCE_SCALING'); + } + if (this._shaderTranslucencyByDistance) { + vs.defines.push('EYE_DISTANCE_TRANSLUCENCY'); + } + if (this._shaderPixelOffsetScaleByDistance) { + vs.defines.push('EYE_DISTANCE_PIXEL_OFFSET'); + } + if (this._shaderDistanceDisplayCondition) { + vs.defines.push('DISTANCE_DISPLAY_CONDITION'); + } + + fs = new ShaderSource({ + defines : ['RENDER_FOR_PICK'], + sources : [BillboardCollectionFS] + }); + + this._spPick = ShaderProgram.replaceCache({ + context : context, + shaderProgram : this._spPick, + vertexShaderSource : vs, + fragmentShaderSource : fs, + attributeLocations : attributeLocations + }); + this._compiledShaderRotationPick = this._shaderRotation; + this._compiledShaderAlignedAxisPick = this._shaderAlignedAxis; + this._compiledShaderScaleByDistancePick = this._shaderScaleByDistance; + this._compiledShaderTranslucencyByDistancePick = this._shaderTranslucencyByDistance; + this._compiledShaderPixelOffsetScaleByDistancePick = this._shaderPixelOffsetScaleByDistance; + this._compiledShaderDistanceDisplayConditionPick = this._shaderDistanceDisplayCondition; + } + + var va; + var vaLength; + var command; + var vs; + var fs; + var j; + + var commandList = frameState.commandList; + + if (pass.render) { + var colorList = this._colorCommands; + + var opaque = this._blendOption === BlendOption.OPAQUE; + var opaqueAndTranslucent = this._blendOption === BlendOption.OPAQUE_AND_TRANSLUCENT; + va = this._vaf.va; vaLength = va.length; colorList.length = vaLength; - for (j = 0; j < vaLength; ++j) { + var totalLength = opaqueAndTranslucent ? vaLength * 2 : vaLength; + for (j = 0; j < totalLength; ++j) { command = colorList[j]; if (!defined(command)) { - command = colorList[j] = new DrawCommand({ - pass : Pass.OPAQUE, - owner : this - }); + command = colorList[j] = new DrawCommand(); } + var opaqueCommand = opaque || (opaqueAndTranslucent && j % 2 === 0); + + command.pass = opaqueCommand || !opaqueAndTranslucent ? Pass.OPAQUE : Pass.TRANSLUCENT; + command.owner = this; + + var index = opaqueAndTranslucent ? Math.floor(j / 2.0) : j; command.boundingVolume = boundingVolume; command.modelMatrix = modelMatrix; - command.count = va[j].indicesCount; - command.shaderProgram = this._sp; + command.count = va[index].indicesCount; + command.shaderProgram = opaqueCommand ? this._sp : this._spTranslucent; command.uniformMap = this._uniforms; - command.vertexArray = va[j].va; - command.renderState = this._rs; + command.vertexArray = va[index].va; + command.renderState = opaqueCommand ? this._rsOpaque : this._rsTranslucent; command.debugShowBoundingVolume = this.debugShowBoundingVolume; if (this._instanced) { @@ -95678,61 +96092,6 @@ define('Scene/BillboardCollection',[ if (picking) { var pickList = this._pickCommands; - if (!defined(this._spPick) || - (this._shaderRotation !== this._compiledShaderRotationPick) || - (this._shaderAlignedAxis !== this._compiledShaderAlignedAxisPick) || - (this._shaderScaleByDistance !== this._compiledShaderScaleByDistancePick) || - (this._shaderTranslucencyByDistance !== this._compiledShaderTranslucencyByDistancePick) || - (this._shaderPixelOffsetScaleByDistance !== this._compiledShaderPixelOffsetScaleByDistancePick) || - (this._shaderDistanceDisplayCondition !== this._compiledShaderDistanceDisplayConditionPick)) { - - vs = new ShaderSource({ - defines : ['RENDER_FOR_PICK'], - sources : [BillboardCollectionVS] - }); - - if(this._instanced) { - vs.defines.push('INSTANCED'); - } - if (this._shaderRotation) { - vs.defines.push('ROTATION'); - } - if (this._shaderAlignedAxis) { - vs.defines.push('ALIGNED_AXIS'); - } - if (this._shaderScaleByDistance) { - vs.defines.push('EYE_DISTANCE_SCALING'); - } - if (this._shaderTranslucencyByDistance) { - vs.defines.push('EYE_DISTANCE_TRANSLUCENCY'); - } - if (this._shaderPixelOffsetScaleByDistance) { - vs.defines.push('EYE_DISTANCE_PIXEL_OFFSET'); - } - if (this._shaderDistanceDisplayCondition) { - vs.defines.push('DISTANCE_DISPLAY_CONDITION'); - } - - fs = new ShaderSource({ - defines : ['RENDER_FOR_PICK'], - sources : [BillboardCollectionFS] - }); - - this._spPick = ShaderProgram.replaceCache({ - context : context, - shaderProgram : this._spPick, - vertexShaderSource : vs, - fragmentShaderSource : fs, - attributeLocations : attributeLocations - }); - this._compiledShaderRotationPick = this._shaderRotation; - this._compiledShaderAlignedAxisPick = this._shaderAlignedAxis; - this._compiledShaderScaleByDistancePick = this._shaderScaleByDistance; - this._compiledShaderTranslucencyByDistancePick = this._shaderTranslucencyByDistance; - this._compiledShaderPixelOffsetScaleByDistancePick = this._shaderPixelOffsetScaleByDistance; - this._compiledShaderDistanceDisplayConditionPick = this._shaderDistanceDisplayCondition; - } - va = this._vaf.va; vaLength = va.length; @@ -95752,7 +96111,7 @@ define('Scene/BillboardCollection',[ command.shaderProgram = this._spPick; command.uniformMap = this._uniforms; command.vertexArray = va[j].va; - command.renderState = this._rs; + command.renderState = this._rsOpaque; if (this._instanced) { command.count = 6; @@ -95804,6 +96163,7 @@ define('Scene/BillboardCollection',[ this._textureAtlas = this._destroyTextureAtlas && this._textureAtlas && this._textureAtlas.destroy(); this._sp = this._sp && this._sp.destroy(); + this._spTranslucent = this._spTranslucent && this._spTranslucent.destroy(); this._spPick = this._spPick && this._spPick.destroy(); this._vaf = this._vaf && this._vaf.destroy(); destroyBillboards(this._billboards); @@ -96913,6 +97273,7 @@ define('Scene/LabelCollection',[ '../Core/Matrix4', '../Core/writeTextToCanvas', './BillboardCollection', + './BlendOption', './HorizontalOrigin', './Label', './LabelStyle', @@ -96930,6 +97291,7 @@ define('Scene/LabelCollection',[ Matrix4, writeTextToCanvas, BillboardCollection, + BlendOption, HorizontalOrigin, Label, LabelStyle, @@ -97342,6 +97704,9 @@ define('Scene/LabelCollection',[ * @param {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] The 4x4 transformation matrix that transforms each label from model to world coordinates. * @param {Boolean} [options.debugShowBoundingVolume=false] For debugging only. Determines if this primitive's commands' bounding spheres are shown. * @param {Scene} [options.scene] Must be passed in for labels that use the height reference property or will be depth tested against the globe. + * @param {BlendOption} [options.blendOption=BlendOption.OPAQUE_AND_TRANSLUCENT] The label blending option. The default + * is used for rendering both opaque and translucent labels. However, if either all of the labels are completely opaque or all are completely translucent, + * setting the technique to BillboardRenderTechnique.OPAQUE or BillboardRenderTechnique.TRANSLUCENT can improve performance by up to 2x. * * @performance For best performance, prefer a few collections, each with many labels, to * many collections with only a few labels each. Avoid having collections where some @@ -97435,6 +97800,16 @@ define('Scene/LabelCollection',[ * @default false */ this.debugShowBoundingVolume = defaultValue(options.debugShowBoundingVolume, false); + + /** + * The label blending option. The default is used for rendering both opaque and translucent labels. + * However, if either all of the labels are completely opaque or all are completely translucent, + * setting the technique to BillboardRenderTechnique.OPAQUE or BillboardRenderTechnique.TRANSLUCENT can improve + * performance by up to 2x. + * @type {BlendOption} + * @default BlendOption.OPAQUE_AND_TRANSLUCENT + */ + this.blendOption = defaultValue(options.blendOption, BlendOption.OPAQUE_AND_TRANSLUCENT); } defineProperties(LabelCollection.prototype, { @@ -97688,6 +98063,10 @@ define('Scene/LabelCollection',[ this._totalGlyphCount += glyphCountDifference; } + var blendOption = backgroundBillboardCollection.length > 0 ? BlendOption.TRANSLUCENT : this.blendOption; + billboardCollection.blendOption = blendOption; + backgroundBillboardCollection.blendOption = blendOption; + this._labelsToUpdate.length = 0; backgroundBillboardCollection.update(frameState); billboardCollection.update(frameState); @@ -98287,10 +98666,24 @@ float wholeAlpha = 1.0 - smoothstep(maxDistance, 0.5, distanceToCenter);\n\ float innerAlpha = 1.0 - smoothstep(maxDistance * v_innerPercent, 0.5 * v_innerPercent, distanceToCenter);\n\ vec4 color = mix(v_outlineColor, v_color, innerAlpha);\n\ color.a *= wholeAlpha;\n\ +#if defined(RENDER_FOR_PICK) || (!defined(OPAQUE) && !defined(TRANSLUCENT))\n\ if (color.a < 0.005)\n\ {\n\ discard;\n\ }\n\ +#else\n\ +#ifdef OPAQUE\n\ +if (color.a < 0.995)\n\ +{\n\ +discard;\n\ +}\n\ +#else\n\ +if (color.a >= 0.995)\n\ +{\n\ +discard;\n\ +}\n\ +#endif\n\ +#endif\n\ #ifdef RENDER_FOR_PICK\n\ gl_FragColor = v_pickColor;\n\ #else\n\ @@ -98450,6 +98843,7 @@ define('Scene/PointPrimitiveCollection',[ '../Shaders/PointPrimitiveCollectionFS', '../Shaders/PointPrimitiveCollectionVS', './BlendingState', + './BlendOption', './PointPrimitive', './SceneMode' ], function( @@ -98477,6 +98871,7 @@ define('Scene/PointPrimitiveCollection',[ PointPrimitiveCollectionFS, PointPrimitiveCollectionVS, BlendingState, + BlendOption, PointPrimitive, SceneMode) { 'use strict'; @@ -98513,6 +98908,9 @@ define('Scene/PointPrimitiveCollection',[ * @param {Object} [options] Object with the following properties: * @param {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] The 4x4 transformation matrix that transforms each point from model to world coordinates. * @param {Boolean} [options.debugShowBoundingVolume=false] For debugging only. Determines if this primitive's commands' bounding spheres are shown. + * @param {BlendOption} [options.blendOption=BlendOption.OPAQUE_AND_TRANSLUCENT] The point blending option. The default + * is used for rendering both opaque and translucent points. However, if either all of the points are completely opaque or all are completely translucent, + * setting the technique to BillboardRenderTechnique.OPAQUE or BillboardRenderTechnique.TRANSLUCENT can improve performance by up to 2x. * * @performance For best performance, prefer a few collections, each with many points, to * many collections with only a few points each. Organize collections so that points @@ -98541,9 +98939,11 @@ define('Scene/PointPrimitiveCollection',[ options = defaultValue(options, defaultValue.EMPTY_OBJECT); this._sp = undefined; - this._rs = undefined; - this._vaf = undefined; + this._spTranslucent = undefined; this._spPick = undefined; + this._rsOpaque = undefined; + this._rsTranslucent = undefined; + this._vaf = undefined; this._pointPrimitives = []; this._pointPrimitivesToUpdate = []; @@ -98623,6 +99023,17 @@ define('Scene/PointPrimitiveCollection',[ */ this.debugShowBoundingVolume = defaultValue(options.debugShowBoundingVolume, false); + /** + * The point blending option. The default is used for rendering both opaque and translucent points. + * However, if either all of the points are completely opaque or all are completely translucent, + * setting the technique to BillboardRenderTechnique.OPAQUE or BillboardRenderTechnique.TRANSLUCENT can improve + * performance by up to 2x. + * @type {BlendOption} + * @default BlendOption.OPAQUE_AND_TRANSLUCENT + */ + this.blendOption = defaultValue(options.blendOption, BlendOption.OPAQUE_AND_TRANSLUCENT); + this._blendOption = undefined; + this._mode = SceneMode.SCENE3D; this._maxTotalPointSize = 1; @@ -99259,79 +99670,188 @@ define('Scene/PointPrimitiveCollection',[ } updateBoundingVolume(this, frameState, boundingVolume); - var va; - var vaLength; - var command; - var j; - var vs; - var fs; + var blendOptionChanged = this._blendOption !== this.blendOption; + this._blendOption = this.blendOption; - var commandList = frameState.commandList; - - if (pass.render) { - var colorList = this._colorCommands; + if (blendOptionChanged) { + if (this._blendOption === BlendOption.OPAQUE || this._blendOption === BlendOption.OPAQUE_AND_TRANSLUCENT) { + this._rsOpaque = RenderState.fromCache({ + depthTest : { + enabled : true, + func : WebGLConstants.LEQUAL + }, + depthMask : true + }); + } else { + this._rsOpaque = undefined; + } - if (!defined(this._rs)) { - this._rs = RenderState.fromCache({ + if (this._blendOption === BlendOption.TRANSLUCENT || this._blendOption === BlendOption.OPAQUE_AND_TRANSLUCENT) { + this._rsTranslucent = RenderState.fromCache({ depthTest : { enabled : true, func : WebGLConstants.LEQUAL }, + depthMask : false, blending : BlendingState.ALPHA_BLEND }); + } else { + this._rsTranslucent = undefined; } + } + + if (blendOptionChanged || + (this._shaderScaleByDistance && !this._compiledShaderScaleByDistance) || + (this._shaderTranslucencyByDistance && !this._compiledShaderTranslucencyByDistance) || + (this._shaderDistanceDisplayCondition && !this._compiledShaderDistanceDisplayCondition)) { - if (!defined(this._sp) || - (this._shaderScaleByDistance && !this._compiledShaderScaleByDistance) || - (this._shaderTranslucencyByDistance && !this._compiledShaderTranslucencyByDistance) || - (this._shaderDistanceDisplayCondition && !this._compiledShaderDistanceDisplayCondition)) { + vs = new ShaderSource({ + sources : [PointPrimitiveCollectionVS] + }); + if (this._shaderScaleByDistance) { + vs.defines.push('EYE_DISTANCE_SCALING'); + } + if (this._shaderTranslucencyByDistance) { + vs.defines.push('EYE_DISTANCE_TRANSLUCENCY'); + } + if (this._shaderDistanceDisplayCondition) { + vs.defines.push('DISTANCE_DISPLAY_CONDITION'); + } - vs = new ShaderSource({ - sources : [PointPrimitiveCollectionVS] + if (this._blendOption === BlendOption.OPAQUE_AND_TRANSLUCENT) { + fs = new ShaderSource({ + defines : ['OPAQUE'], + sources : [PointPrimitiveCollectionFS] + }); + this._sp = ShaderProgram.replaceCache({ + context : context, + shaderProgram : this._sp, + vertexShaderSource : vs, + fragmentShaderSource : fs, + attributeLocations : attributeLocations }); - if (this._shaderScaleByDistance) { - vs.defines.push('EYE_DISTANCE_SCALING'); - } - if (this._shaderTranslucencyByDistance) { - vs.defines.push('EYE_DISTANCE_TRANSLUCENCY'); - } - if (this._shaderDistanceDisplayCondition) { - vs.defines.push('DISTANCE_DISPLAY_CONDITION'); - } + fs = new ShaderSource({ + defines : ['TRANSLUCENT'], + sources : [PointPrimitiveCollectionFS] + }); + this._spTranslucent = ShaderProgram.replaceCache({ + context : context, + shaderProgram : this._spTranslucent, + vertexShaderSource : vs, + fragmentShaderSource : fs, + attributeLocations : attributeLocations + }); + } + + if (this._blendOption === BlendOption.OPAQUE) { + fs = new ShaderSource({ + sources : [PointPrimitiveCollectionFS] + }); this._sp = ShaderProgram.replaceCache({ context : context, shaderProgram : this._sp, vertexShaderSource : vs, - fragmentShaderSource : PointPrimitiveCollectionFS, + fragmentShaderSource : fs, + attributeLocations : attributeLocations + }); + } + + if (this._blendOption === BlendOption.TRANSLUCENT) { + fs = new ShaderSource({ + sources : [PointPrimitiveCollectionFS] + }); + this._spTranslucent = ShaderProgram.replaceCache({ + context : context, + shaderProgram : this._spTranslucent, + vertexShaderSource : vs, + fragmentShaderSource : fs, attributeLocations : attributeLocations }); + } + + this._compiledShaderScaleByDistance = this._shaderScaleByDistance; + this._compiledShaderTranslucencyByDistance = this._shaderTranslucencyByDistance; + this._compiledShaderDistanceDisplayCondition = this._shaderDistanceDisplayCondition; + } + + if (!defined(this._spPick) || + (this._shaderScaleByDistance && !this._compiledShaderScaleByDistancePick) || + (this._shaderTranslucencyByDistance && !this._compiledShaderTranslucencyByDistancePick) || + (this._shaderDistanceDisplayCondition && !this._compiledShaderDistanceDisplayConditionPick)) { + + vs = new ShaderSource({ + defines : ['RENDER_FOR_PICK'], + sources : [PointPrimitiveCollectionVS] + }); - this._compiledShaderScaleByDistance = this._shaderScaleByDistance; - this._compiledShaderTranslucencyByDistance = this._shaderTranslucencyByDistance; - this._compiledShaderDistanceDisplayCondition = this._shaderDistanceDisplayCondition; + if (this._shaderScaleByDistance) { + vs.defines.push('EYE_DISTANCE_SCALING'); } + if (this._shaderTranslucencyByDistance) { + vs.defines.push('EYE_DISTANCE_TRANSLUCENCY'); + } + if (this._shaderDistanceDisplayCondition) { + vs.defines.push('DISTANCE_DISPLAY_CONDITION'); + } + + fs = new ShaderSource({ + defines : ['RENDER_FOR_PICK'], + sources : [PointPrimitiveCollectionFS] + }); + + this._spPick = ShaderProgram.replaceCache({ + context : context, + shaderProgram : this._spPick, + vertexShaderSource : vs, + fragmentShaderSource : fs, + attributeLocations : attributeLocations + }); + + this._compiledShaderScaleByDistancePick = this._shaderScaleByDistance; + this._compiledShaderTranslucencyByDistancePick = this._shaderTranslucencyByDistance; + this._compiledShaderDistanceDisplayConditionPick = this._shaderDistanceDisplayCondition; + } + + var va; + var vaLength; + var command; + var j; + var vs; + var fs; + + var commandList = frameState.commandList; + + if (pass.render) { + var colorList = this._colorCommands; + + var opaque = this._blendOption === BlendOption.OPAQUE; + var opaqueAndTranslucent = this._blendOption === BlendOption.OPAQUE_AND_TRANSLUCENT; va = this._vaf.va; vaLength = va.length; colorList.length = vaLength; - for (j = 0; j < vaLength; ++j) { + var totalLength = opaqueAndTranslucent ? vaLength * 2 : vaLength; + for (j = 0; j < totalLength; ++j) { + var opaqueCommand = opaque || (opaqueAndTranslucent && j % 2 === 0); + command = colorList[j]; if (!defined(command)) { - command = colorList[j] = new DrawCommand({ - primitiveType : PrimitiveType.POINTS, - pass : Pass.OPAQUE, - owner : this - }); + command = colorList[j] = new DrawCommand(); } + command.primitiveType = PrimitiveType.POINTS; + command.pass = opaqueCommand || !opaqueAndTranslucent ? Pass.OPAQUE : Pass.TRANSLUCENT; + command.owner = this; + + var index = opaqueAndTranslucent ? Math.floor(j / 2.0) : j; command.boundingVolume = boundingVolume; command.modelMatrix = modelMatrix; - command.shaderProgram = this._sp; + command.shaderProgram = opaqueCommand ? this._sp : this._spTranslucent; command.uniformMap = this._uniforms; - command.vertexArray = va[j].va; - command.renderState = this._rs; + command.vertexArray = va[index].va; + command.renderState = opaqueCommand ? this._rsOpaque : this._rsTranslucent; command.debugShowBoundingVolume = this.debugShowBoundingVolume; commandList.push(command); @@ -99341,44 +99861,6 @@ define('Scene/PointPrimitiveCollection',[ if (picking) { var pickList = this._pickCommands; - if (!defined(this._spPick) || - (this._shaderScaleByDistance && !this._compiledShaderScaleByDistancePick) || - (this._shaderTranslucencyByDistance && !this._compiledShaderTranslucencyByDistancePick) || - (this._shaderDistanceDisplayCondition && !this._compiledShaderDistanceDisplayConditionPick)) { - - vs = new ShaderSource({ - defines : ['RENDER_FOR_PICK'], - sources : [PointPrimitiveCollectionVS] - }); - - if (this._shaderScaleByDistance) { - vs.defines.push('EYE_DISTANCE_SCALING'); - } - if (this._shaderTranslucencyByDistance) { - vs.defines.push('EYE_DISTANCE_TRANSLUCENCY'); - } - if (this._shaderDistanceDisplayCondition) { - vs.defines.push('DISTANCE_DISPLAY_CONDITION'); - } - - fs = new ShaderSource({ - defines : ['RENDER_FOR_PICK'], - sources : [PointPrimitiveCollectionFS] - }); - - this._spPick = ShaderProgram.replaceCache({ - context : context, - shaderProgram : this._spPick, - vertexShaderSource : vs, - fragmentShaderSource : fs, - attributeLocations : attributeLocations - }); - - this._compiledShaderScaleByDistancePick = this._shaderScaleByDistance; - this._compiledShaderTranslucencyByDistancePick = this._shaderTranslucencyByDistance; - this._compiledShaderDistanceDisplayConditionPick = this._shaderDistanceDisplayCondition; - } - va = this._vaf.va; vaLength = va.length; @@ -99398,7 +99880,7 @@ define('Scene/PointPrimitiveCollection',[ command.shaderProgram = this._spPick; command.uniformMap = this._uniforms; command.vertexArray = va[j].va; - command.renderState = this._rs; + command.renderState = this._rsOpaque; commandList.push(command); } @@ -99439,6 +99921,7 @@ define('Scene/PointPrimitiveCollection',[ */ PointPrimitiveCollection.prototype.destroy = function() { this._sp = this._sp && this._sp.destroy(); + this._spTranslucent = this._spTranslucent && this._spTranslucent.destroy(); this._spPick = this._spPick && this._spPick.destroy(); this._vaf = this._vaf && this._vaf.destroy(); destroyPointPrimitives(this._pointPrimitives); @@ -102910,7 +103393,7 @@ define('DataSources/Rotation',[ * * @param {Number[]} array The array previously packed for interpolation. * @param {Number[]} sourceArray The original packed array. - * @param {Number} [startingIndex=0] The startingIndex used to convert the array. + * @param {Number} [firstIndex=0] The firstIndex used to convert the array. * @param {Number} [lastIndex=packedArray.length] The lastIndex used to convert the array. * @param {Rotation} [result] The object into which to store the result. * @returns {Rotation} The modified result parameter or a new Rotation instance if one was not provided. @@ -103911,8 +104394,8 @@ define('DataSources/SampledPositionProperty',[ * @param {Number[]} packedSamples The array of packed samples. * @param {JulianDate} [epoch] If any of the dates in packedSamples are numbers, they are considered an offset from this epoch, in seconds. */ - SampledPositionProperty.prototype.addSamplesPackedArray = function(data, epoch) { - this._property.addSamplesPackedArray(data, epoch); + SampledPositionProperty.prototype.addSamplesPackedArray = function(packedSamples, epoch) { + this._property.addSamplesPackedArray(packedSamples, epoch); }; /** @@ -106500,7 +106983,7 @@ define('DataSources/CzmlDataSource',[ /** * Creates a Promise to a new instance loaded with the provided CZML data. * - * @param {String|Object} data A url or CZML object to be processed. + * @param {String|Object} czml A url or CZML object to be processed. * @param {Object} [options] An object with the following properties: * @param {String} [options.sourceUri] Overrides the url to use for resolving relative links. * @returns {Promise.<CzmlDataSource>} A promise that resolves to the new instance once the data is processed. @@ -106890,6 +107373,7 @@ define('DataSources/DataSourceCollection',[ * Gets a data source by index from the collection. * * @param {Number} index the index to retrieve. + * @returns {DataSource} The data source at the specified index. */ DataSourceCollection.prototype.get = function(index) { if (!defined(index)) { @@ -107183,7 +107667,7 @@ define('DataSources/EllipseGeometryUpdater',[ * Gets the property specifying whether the geometry * casts or receives shadows from each light source. * @memberof EllipseGeometryUpdater.prototype - * + * * @type {Property} * @readonly */ @@ -107499,6 +107983,7 @@ define('DataSources/EllipseGeometryUpdater',[ * Creates the dynamic updater to be used when GeometryUpdater#isDynamic is true. * * @param {PrimitiveCollection} primitives The primitive collection to use. + * @param {PrimitiveCollection} groundPrimitives The ground primitives collection to use. * @returns {DynamicGeometryUpdater} The dynamic updater used to update the geometry each frame. * * @exception {DeveloperError} This instance does not represent dynamic geometry. @@ -113630,6 +114115,7 @@ define('Scene/Model',[ */ this.silhouetteColor = defaultValue(options.silhouetteColor, Color.RED); this._silhouetteColor = new Color(); + this._silhouetteColorPreviousAlpha = 1.0; this._normalAttributeName = undefined; /** @@ -113768,6 +114254,7 @@ define('Scene/Model',[ */ this.color = defaultValue(options.color, Color.WHITE); this._color = new Color(); + this._colorPreviousAlpha = 1.0; /** * Defines how the color blends with the model. @@ -113881,8 +114368,10 @@ define('Scene/Model',[ this._pickIds = []; // CESIUM_RTC extension - this._rtcCenter = undefined; // in world coordinates + this._rtcCenter = undefined; // reference to either 3D or 2D this._rtcCenterEye = undefined; // in eye coordinates + this._rtcCenter3D = undefined; // in world coordinates + this._rtcCenter2D = undefined; // in projected world coordinates } defineProperties(Model.prototype, { @@ -115692,10 +116181,13 @@ define('Scene/Model',[ // CESIUM_RTC extension var mvRtc = new Matrix4(); return function() { - Matrix4.getTranslation(uniformState.model, scratchTranslationRtc); - Cartesian3.add(scratchTranslationRtc, model._rtcCenter, scratchTranslationRtc); - Matrix4.multiplyByPoint(uniformState.view, scratchTranslationRtc, scratchTranslationRtc); - return Matrix4.setTranslation(uniformState.modelView, scratchTranslationRtc, mvRtc); + if (defined(model._rtcCenter)) { + Matrix4.getTranslation(uniformState.model, scratchTranslationRtc); + Cartesian3.add(scratchTranslationRtc, model._rtcCenter, scratchTranslationRtc); + Matrix4.multiplyByPoint(uniformState.view, scratchTranslationRtc, scratchTranslationRtc); + return Matrix4.setTranslation(uniformState.modelView, scratchTranslationRtc, mvRtc); + } + return uniformState.modelView; }; }, MODELVIEWPROJECTION : function(uniformState, model) { @@ -116523,6 +117015,7 @@ define('Scene/Model',[ } var scratchNodeStack = []; + var scratchComputedTranslation = new Cartesian4(); var scratchComputedMatrixIn2D = new Matrix4(); function updateNodeHierarchyModelMatrix(model, modelTransformChanged, justLoaded, projection) { @@ -116536,7 +117029,20 @@ define('Scene/Model',[ var computedModelMatrix = model._computedModelMatrix; if (model._mode !== SceneMode.SCENE3D) { - computedModelMatrix = Transforms.basisTo2D(projection, computedModelMatrix, scratchComputedMatrixIn2D); + var translation = Matrix4.getColumn(computedModelMatrix, 3, scratchComputedTranslation); + if (!Cartesian4.equals(translation, Cartesian4.UNIT_W)) { + computedModelMatrix = Transforms.basisTo2D(projection, computedModelMatrix, scratchComputedMatrixIn2D); + model._rtcCenter = model._rtcCenter3D; + } else { + var center = model.boundingSphere.center; + var to2D = Transforms.wgs84To2DModelMatrix(projection, center, scratchComputedMatrixIn2D); + computedModelMatrix = Matrix4.multiply(to2D, computedModelMatrix, scratchComputedMatrixIn2D); + + if (defined(model._rtcCenter)) { + Matrix4.setTranslation(computedModelMatrix, Cartesian4.UNIT_W, computedModelMatrix); + model._rtcCenter = model._rtcCenter2D; + } + } } for (var i = 0; i < length; ++i) { @@ -117000,12 +117506,12 @@ define('Scene/Model',[ } var nodeCommands = model._nodeCommands; - var dirty = alphaDirty(model.color.alpha, model._color.alpha) || - alphaDirty(model.silhouetteColor.alpha, model._silhouetteColor.alpha) || + var dirty = alphaDirty(model.color.alpha, model._colorPreviousAlpha) || + alphaDirty(model.silhouetteColor.alpha, model._silhouetteColorPreviousAlpha) || !defined(nodeCommands[0].silhouetteModelCommand); - Color.clone(model.color, model._color); - Color.clone(model.silhouetteColor, model._silhouetteColor); + model._colorPreviousAlpha = model.color.alpha; + model._silhouetteColorPreviousAlpha = model.silhouetteColor.alpha; if (dirty) { createSilhouetteCommands(model, frameState); @@ -117287,8 +117793,20 @@ define('Scene/Model',[ if (this._state !== ModelState.FAILED) { var extensions = this.gltf.extensions; if (defined(extensions) && defined(extensions.CESIUM_RTC)) { - this._rtcCenter = Cartesian3.fromArray(extensions.CESIUM_RTC.center); - this._rtcCenterEye = new Cartesian3(); + var center = Cartesian3.fromArray(extensions.CESIUM_RTC.center); + if (!Cartesian3.equals(center, Cartesian3.ZERO)) { + this._rtcCenter3D = center; + + var projection = frameState.mapProjection; + var ellipsoid = projection.ellipsoid; + var cartographic = ellipsoid.cartesianToCartographic(this._rtcCenter3D); + var projectedCart = projection.project(cartographic); + Cartesian3.fromElements(projectedCart.z, projectedCart.x, projectedCart.y, projectedCart); + this._rtcCenter2D = projectedCart; + + this._rtcCenterEye = new Cartesian3(); + this._rtcCenter = this._rtcCenter3D; + } } this._loadResources = new LoadResources(); @@ -117592,7 +118110,6 @@ define('DataSources/ModelVisualizer',[ var defaultColorBlendMode = ColorBlendMode.HIGHLIGHT; var defaultColorBlendAmount = 0.5; - var color = new Color(); var modelMatrixScratch = new Matrix4(); var nodeMatrixScratch = new Matrix4(); @@ -117695,9 +118212,9 @@ define('DataSources/ModelVisualizer',[ model.shadows = Property.getValueOrDefault(modelGraphics._shadows, time, defaultShadows); model.heightReference = Property.getValueOrDefault(modelGraphics._heightReference, time, defaultHeightReference); model.distanceDisplayCondition = Property.getValueOrUndefined(modelGraphics._distanceDisplayCondition, time); - model.silhouetteColor = Property.getValueOrDefault(modelGraphics.silhouetteColor, time, defaultSilhouetteColor); - model.silhouetteSize = Property.getValueOrDefault(modelGraphics.silhouetteSize, time, defaultSilhouetteSize); - model.color = Property.getValueOrDefault(modelGraphics._color, time, defaultColor, color); + model.silhouetteColor = Property.getValueOrDefault(modelGraphics._silhouetteColor, time, defaultSilhouetteColor, model._silhouetteColor); + model.silhouetteSize = Property.getValueOrDefault(modelGraphics._silhouetteSize, time, defaultSilhouetteSize); + model.color = Property.getValueOrDefault(modelGraphics._color, time, defaultColor, model._color); model.colorBlendMode = Property.getValueOrDefault(modelGraphics._colorBlendMode, time, defaultColorBlendMode); model.colorBlendAmount = Property.getValueOrDefault(modelGraphics._colorBlendAmount, time, defaultColorBlendAmount); @@ -118102,6 +118619,7 @@ define('Scene/Polyline',[ * @param {Cartesian3[]} [options.positions] The positions. * @param {Object} [options.id] The user-defined object to be returned when this polyline is picked. * @param {DistanceDisplayCondition} [options.distanceDisplayCondition] The condition specifying at what distance from the camera that this polyline will be displayed. + * @param {PolylineCollection} polylineCollection The renderable polyline collection. * * @see PolylineCollection * @@ -120425,25 +120943,20 @@ define('DataSources/PathVisualizer',[ } function reallySubSample(property, start, stop, updateTime, referenceFrame, maximumStep, index, result) { - var innerProperty = property; - - while (innerProperty instanceof ReferenceProperty || innerProperty instanceof ScaledPositionProperty) { - if (innerProperty instanceof ReferenceProperty) { - innerProperty = innerProperty.resolvedProperty; - } - if (innerProperty instanceof ScaledPositionProperty) { - innerProperty = innerProperty._value; - } + //Unwrap any references until we have the actual property. + while (property instanceof ReferenceProperty) { + property = property.resolvedProperty; } - if (innerProperty instanceof SampledPositionProperty) { - var times = innerProperty._property._times; + if (property instanceof SampledPositionProperty) { + var times = property._property._times; index = subSampleSampledProperty(property, start, stop, times, updateTime, referenceFrame, maximumStep, index, result); - } else if (innerProperty instanceof CompositePositionProperty) { + } else if (property instanceof CompositePositionProperty) { index = subSampleCompositeProperty(property, start, stop, updateTime, referenceFrame, maximumStep, index, result); - } else if (innerProperty instanceof TimeIntervalCollectionPositionProperty) { + } else if (property instanceof TimeIntervalCollectionPositionProperty) { index = subSampleIntervalProperty(property, start, stop, updateTime, referenceFrame, maximumStep, index, result); - } else if (innerProperty instanceof ConstantPositionProperty) { + } else if (property instanceof ConstantPositionProperty || + (property instanceof ScaledPositionProperty && Property.isConstant(property))) { index = subSampleConstantProperty(property, start, stop, updateTime, referenceFrame, maximumStep, index, result); } else { //Fallback to generic sampling. @@ -121325,7 +121838,7 @@ define('DataSources/PolygonGeometryUpdater',[ * Gets the property specifying whether the geometry * casts or receives shadows from each light source. * @memberof PolygonGeometryUpdater.prototype - * + * * @type {Property} * @readonly */ @@ -121655,6 +122168,7 @@ define('DataSources/PolygonGeometryUpdater',[ * Creates the dynamic updater to be used when GeometryUpdater#isDynamic is true. * * @param {PrimitiveCollection} primitives The primitive collection to use. + * @param {PrimitiveCollection} groundPrimitives The ground primitive collection to use. * @returns {DynamicGeometryUpdater} The dynamic updater used to update the geometry each frame. * * @exception {DeveloperError} This instance does not represent dynamic geometry. @@ -121732,7 +122246,7 @@ define('DataSources/PolygonGeometryUpdater',[ options.closeBottom = closeBottomValue; var shadows = this._geometryUpdater.shadowsProperty.getValue(time); - + if (Property.getValueOrDefault(polygon.fill, time, true)) { var fillMaterialProperty = geometryUpdater.fillMaterialProperty; var material = MaterialProperty.getValue(time, fillMaterialProperty, this._material); @@ -125603,7 +126117,7 @@ define('DataSources/EntityView',[ * Should be called each animation frame to update the camera * to the latest settings. * @param {JulianDate} time The current animation time. - * @param {BoundingSphere} current bounding sphere of the object. + * @param {BoundingSphere} boundingSphere bounding sphere of the object. * */ EntityView.prototype.update = function(time, boundingSphere) { @@ -131492,7 +132006,7 @@ define('DataSources/KmlDataSource',[ var colorOptions = {}; function parseColorString(value, isRandom) { - if (!defined(value)) { + if (!defined(value) || /^\s*$/gm.test(value)) { return undefined; } @@ -134324,7 +134838,7 @@ define('Renderer/ComputeCommand',[ /** * Executes the compute command. * - * @param {Context} context The context that processes the compute command. + * @param {Context} computeEngine The context that processes the compute command. */ ComputeCommand.prototype.execute = function(computeEngine) { computeEngine.execute(this); @@ -135172,6 +135686,10 @@ define('Renderer/UniformState',[ this._resolutionScale = 1.0; this._fogDensity = undefined; + + this._imagerySplitPosition = 0.0; + this._pixelSizePerMeter = undefined; + this._geometricToleranceOverMeter = undefined; } defineProperties(UniformState.prototype, { @@ -135790,6 +136308,17 @@ define('Renderer/UniformState',[ } }, + /** + * A scalar that represents the geometric tolerance per meter + * @memberof UniformStat.prototype + * @type {Number} + */ + geometricToleranceOverMeter: { + get: function() { + return this._geometricToleranceOverMeter; + } + }, + /** * @memberof UniformState.prototype * @type {Pass} @@ -135798,6 +136327,16 @@ define('Renderer/UniformState',[ get : function() { return this._pass; } + }, + + /** + * @memberof UniformState.prototype + * @type {Number} + */ + imagerySplitPosition : { + get : function() { + return this._imagerySplitPosition; + } } }); @@ -135958,6 +136497,18 @@ define('Renderer/UniformState',[ this._frameState = frameState; this._temeToPseudoFixed = Transforms.computeTemeToPseudoFixedMatrix(frameState.time, this._temeToPseudoFixed); + + this._imagerySplitPosition = frameState.imagerySplitPosition; + var fov = camera.frustum.fov; + var viewport = this._viewport; + var pixelSizePerMeter; + if (viewport.height > viewport.width) { + pixelSizePerMeter = Math.tan(0.5 * fov) * 2.0 / viewport.height; + } else { + pixelSizePerMeter = Math.tan(0.5 * fov) * 2.0 / viewport.width; + } + + this._geometricToleranceOverMeter = pixelSizePerMeter * frameState.maximumScreenSpaceError; }; function cleanViewport(uniformState) { @@ -136357,29 +136908,29 @@ define('Renderer/Context',[ } } - function makeGetterSetter(gl, propertyName, logFunc) { + function makeGetterSetter(gl, propertyName, logFunction) { return { get : function() { var value = gl[propertyName]; - logFunc(gl, 'get: ' + propertyName, value); + logFunction(gl, 'get: ' + propertyName, value); return gl[propertyName]; }, set : function(value) { gl[propertyName] = value; - logFunc(gl, 'set: ' + propertyName, value); + logFunction(gl, 'set: ' + propertyName, value); } }; } - function wrapGL(gl, logFunc) { - if (!logFunc) { + function wrapGL(gl, logFunction) { + if (!defined(logFunction)) { return gl; } function wrapFunction(property) { return function() { var result = property.apply(gl, arguments); - logFunc(gl, property, arguments); + logFunction(gl, property, arguments); return result; }; } @@ -136391,14 +136942,14 @@ define('Renderer/Context',[ // JSLint normally demands that a for..in loop must directly contain an if, // but in our loop below, we actually intend to iterate all properties, including // those in the prototype. - for ( var propertyName in gl) { + for (var propertyName in gl) { var property = gl[propertyName]; // wrap any functions we encounter, otherwise just copy the property to the wrapper. - if (typeof property === 'function') { + if (property instanceof Function) { glWrapper[propertyName] = wrapFunction(property); } else { - Object.defineProperty(glWrapper, propertyName, makeGetterSetter(gl, propertyName, logFunc)); + Object.defineProperty(glWrapper, propertyName, makeGetterSetter(gl, propertyName, logFunction)); } } @@ -136442,24 +136993,32 @@ define('Renderer/Context',[ webglOptions.stencil = defaultValue(webglOptions.stencil, true); // WebGL default is false var defaultToWebgl2 = false; - var webgl2Supported = (typeof WebGL2RenderingContext !== 'undefined'); + var requestWebgl2 = defaultToWebgl2 && (typeof WebGL2RenderingContext !== 'undefined'); var webgl2 = false; + var glContext; + var getWebGLStub = options.getWebGLStub; - if (defaultToWebgl2 && webgl2Supported) { - glContext = canvas.getContext('webgl2', webglOptions) || canvas.getContext('experimental-webgl2', webglOptions) || undefined; - if (defined(glContext)) { - webgl2 = true; + if (!defined(getWebGLStub)) { + if (requestWebgl2) { + glContext = canvas.getContext('webgl2', webglOptions) || canvas.getContext('experimental-webgl2', webglOptions) || undefined; + if (defined(glContext)) { + webgl2 = true; + } } - } - if (!defined(glContext)) { - glContext = canvas.getContext('webgl', webglOptions) || canvas.getContext('experimental-webgl', webglOptions) || undefined; - } - if (!defined(glContext)) { - throw new RuntimeError('The browser supports WebGL, but initialization failed.'); + if (!defined(glContext)) { + glContext = canvas.getContext('webgl', webglOptions) || canvas.getContext('experimental-webgl', webglOptions) || undefined; + } + if (!defined(glContext)) { + throw new RuntimeError('The browser supports WebGL, but initialization failed.'); + } + } else { + // Use WebGL stub when requested for unit tests + glContext = getWebGLStub(canvas, webglOptions); } this._originalGLContext = glContext; + this._gl = glContext; this._webgl2 = webgl2; this._id = createGuid(); @@ -136472,13 +137031,8 @@ define('Renderer/Context',[ this._shaderCache = new ShaderCache(this); - var gl = this._gl = this._originalGLContext; + var gl = glContext; - this._redBits = gl.getParameter(gl.RED_BITS); - this._greenBits = gl.getParameter(gl.GREEN_BITS); - this._blueBits = gl.getParameter(gl.BLUE_BITS); - this._alphaBits = gl.getParameter(gl.ALPHA_BITS); - this._depthBits = gl.getParameter(gl.DEPTH_BITS); this._stencilBits = gl.getParameter(gl.STENCIL_BITS); ContextLimits._maximumCombinedTextureImageUnits = gl.getParameter(gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS); // min: 8 @@ -136587,10 +137141,9 @@ define('Renderer/Context',[ ContextLimits._maximumDrawBuffers = this.drawBuffers ? gl.getParameter(WebGLConstants.MAX_DRAW_BUFFERS) : 1; ContextLimits._maximumColorAttachments = this.drawBuffers ? gl.getParameter(WebGLConstants.MAX_COLOR_ATTACHMENTS) : 1; - var cc = gl.getParameter(gl.COLOR_CLEAR_VALUE); - this._clearColor = new Color(cc[0], cc[1], cc[2], cc[3]); - this._clearDepth = gl.getParameter(gl.DEPTH_CLEAR_VALUE); - this._clearStencil = gl.getParameter(gl.STENCIL_CLEAR_VALUE); + this._clearColor = new Color(0.0, 0.0, 0.0, 0.0); + this._clearDepth = 1.0; + this._clearStencil = 0; var us = new UniformState(); var ps = new PassState(this); @@ -136645,7 +137198,6 @@ define('Renderer/Context',[ */ this.cache = {}; - RenderState.apply(gl, rs, ps); } @@ -136678,70 +137230,6 @@ define('Renderer/Context',[ } }, - /** - * The number of red bits per component in the default framebuffer's color buffer. The minimum is eight. - * @memberof Context.prototype - * @type {Number} - * @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGet.xml|glGet} with <code>RED_BITS</code>. - */ - redBits : { - get : function() { - return this._redBits; - } - }, - - /** - * The number of green bits per component in the default framebuffer's color buffer. The minimum is eight. - * @memberof Context.prototype - * @type {Number} - * @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGet.xml|glGet} with <code>GREEN_BITS</code>. - */ - greenBits : { - get : function() { - return this._greenBits; - } - }, - - /** - * The number of blue bits per component in the default framebuffer's color buffer. The minimum is eight. - * @memberof Context.prototype - * @type {Number} - * @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGet.xml|glGet} with <code>BLUE_BITS</code>. - */ - blueBits : { - get : function() { - return this._blueBits; - } - }, - - /** - * The number of alpha bits per component in the default framebuffer's color buffer. The minimum is eight. - * <br /><br /> - * The alpha channel is used for GL destination alpha operations and by the HTML compositor to combine the color buffer - * with the rest of the page. - * @memberof Context.prototype - * @type {Number} - * @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGet.xml|glGet} with <code>ALPHA_BITS</code>. - */ - alphaBits : { - get : function() { - return this._alphaBits; - } - }, - - /** - * The number of depth bits per pixel in the default bound framebuffer. The minimum is 16 bits; most - * implementations will have 24 bits. - * @memberof Context.prototype - * @type {Number} - * @see {@link https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGet.xml|glGet} with <code>DEPTH_BITS</code>. - */ - depthBits : { - get : function() { - return this._depthBits; - } - }, - /** * The number of stencil bits per pixel in the default bound framebuffer. The minimum is eight bits. * @memberof Context.prototype @@ -136909,7 +137397,7 @@ define('Renderer/Context',[ }, set : function(value) { this._throwOnWebGLError = value; - this._gl = wrapGL(this._originalGLContext, value ? throwOnError : null); + this._gl = wrapGL(this._originalGLContext, value ? throwOnError : undefined); } }, @@ -138103,6 +138591,7 @@ define('Scene/ImageryProvider',[ * too many requests pending, this function will instead return undefined, indicating * that the request should be retried later. * + * @param {ImageryProvider} imageryProvider The imagery provider for the URL. * @param {String} url The URL of the image. * @returns {Promise.<Image|Canvas>|undefined} A promise for the image that will resolve when the image is available, or * undefined if there are too many active requests to the server, and the request @@ -139393,7 +139882,7 @@ define('Scene/BingMapsImageryProvider',[ * instances. The array may be empty if no features are found at the given location. * It may also be undefined if picking is not supported. */ - BingMapsImageryProvider.prototype.pickFeatures = function() { + BingMapsImageryProvider.prototype.pickFeatures = function(x, y, level, longitude, latitude) { return undefined; }; @@ -141901,7 +142390,7 @@ define('Scene/Camera',[ * * @param {Object} options Object with the following properties: * @param {Cartesian3|Rectangle} [options.destination] The final position of the camera in WGS84 (world) coordinates or a rectangle that would be visible from a top-down view. - * @param {Object} [options.orientation] An object that contains either direction and up properties or heading, pith and roll properties. By default, the direction will point + * @param {Object} [options.orientation] An object that contains either direction and up properties or heading, pitch and roll properties. By default, the direction will point * towards the center of the frame in 3D and in the negative z direction in Columbus view. The up direction will point towards local north in 3D and in the positive * y direction in Columbus view. Orientation is not used in 2D when in infinite scrolling mode. * @param {Matrix4} [options.endTransform] Transform matrix representing the reference frame of the camera. @@ -144080,7 +144569,7 @@ define('Scene/CameraEventAggregator',[ * @alias CameraEventAggregator * @constructor * - * @param {Canvas} [element=document] The element to handle events for. + * @param {Canvas} [canvas=document] The element to handle events for. * * @see ScreenSpaceEventHandler */ @@ -145440,8 +145929,8 @@ define('Scene/createTangentSpaceDebugPrimitive',[ /** * Creates a {@link Primitive} to visualize well-known vector vertex attributes: - * <code>normal</code>, <code>binormal</code>, and <code>tangent</code>. Normal - * is red; binormal is green; and tangent is blue. If an attribute is not + * <code>normal</code>, <code>tangent</code>, and <code>bitangent</code>. Normal + * is red; tangent is green; and bitangent is blue. If an attribute is not * present, it is not drawn. * * @exports createTangentSpaceDebugPrimitive @@ -145488,9 +145977,9 @@ define('Scene/createTangentSpaceDebugPrimitive',[ })); } - if (defined(attributes.binormal)) { + if (defined(attributes.tangent)) { instances.push(new GeometryInstance({ - geometry : GeometryPipeline.createLineSegmentsForVectors(geometry, 'binormal', length), + geometry : GeometryPipeline.createLineSegmentsForVectors(geometry, 'tangent', length), attributes : { color : new ColorGeometryInstanceAttribute(0.0, 1.0, 0.0, 1.0) }, @@ -145498,9 +145987,9 @@ define('Scene/createTangentSpaceDebugPrimitive',[ })); } - if (defined(attributes.tangent)) { + if (defined(attributes.bitangent)) { instances.push(new GeometryInstance({ - geometry : GeometryPipeline.createLineSegmentsForVectors(geometry, 'tangent', length), + geometry : GeometryPipeline.createLineSegmentsForVectors(geometry, 'bitangent', length), attributes : { color : new ColorGeometryInstanceAttribute(0.0, 0.0, 1.0, 1.0) }, @@ -146065,8 +146554,6 @@ define('Scene/CreditDisplay',[ /** * Resets the credit display to a beginning of frame state, clearing out current credits. - * - * @param {Credit} credit The credit to display */ CreditDisplay.prototype.beginFrame = function() { this._currentFrameCredits.imageCredits.length = 0; @@ -146075,8 +146562,6 @@ define('Scene/CreditDisplay',[ /** * Sets the credit display to the end of frame state, displaying current credits in the credit container - * - * @param {Credit} credit The credit to display */ CreditDisplay.prototype.endFrame = function() { var textCredits = this._defaultTextCredits.concat(this._currentFrameCredits.textCredits); @@ -146140,7 +146625,7 @@ define('Scene/DebugAppearance',[ * Visualizes a vertex attribute by displaying it as a color for debugging. * <p> * Components for well-known unit-length vectors, i.e., <code>normal</code>, - * <code>binormal</code>, and <code>tangent</code>, are scaled and biased + * <code>tangent</code>, and <code>bitangent</code>, are scaled and biased * from [-1.0, 1.0] to (-1.0, 1.0). * </p> * @@ -146149,7 +146634,7 @@ define('Scene/DebugAppearance',[ * * @param {Object} options Object with the following properties: * @param {String} options.attributeName The name of the attribute to visualize. - * @param {Boolean} options.perInstanceAttribute Boolean that determines whether this attribute is a per-instance geometry attribute. + * @param {Boolean} [options.perInstanceAttribute=false] Boolean that determines whether this attribute is a per-instance geometry attribute. * @param {String} [options.glslDatatype='vec3'] The GLSL datatype of the attribute. Supported datatypes are <code>float</code>, <code>vec2</code>, <code>vec3</code>, and <code>vec4</code>. * @param {String} [options.vertexShaderSource] Optional GLSL vertex shader source to override the default vertex shader. * @param {String} [options.fragmentShaderSource] Optional GLSL fragment shader source to override the default fragment shader. @@ -146173,16 +146658,17 @@ define('Scene/DebugAppearance',[ if (!defined(attributeName)) { throw new DeveloperError('options.attributeName is required.'); } + if (!defined(perInstanceAttribute)) { - throw new DeveloperError('options.perInstanceAttribute is required.'); + perInstanceAttribute = false; } - + var glslDatatype = defaultValue(options.glslDatatype, 'vec3'); var varyingName = 'v_' + attributeName; var getColor; // Well-known normalized vector attributes in VertexFormat - if ((attributeName === 'normal') || (attributeName === 'binormal') || (attributeName === 'tangent')) { + if ((attributeName === 'normal') || (attributeName === 'tangent') || (attributeName === 'bitangent')) { getColor = 'vec4 getColor() { return vec4((' + varyingName + ' + vec3(1.0)) * 0.5, 1.0); }\n'; } else { // All other attributes, both well-known and custom @@ -147884,7 +148370,7 @@ define('Scene/EllipsoidSurfaceAppearance',[ * and {@link RectangleGeometry}, which supports all materials like {@link MaterialAppearance} * with {@link MaterialAppearance.MaterialSupport.ALL}. However, this appearance requires * fewer vertex attributes since the fragment shader can procedurally compute <code>normal</code>, - * <code>binormal</code>, and <code>tangent</code>. + * <code>tangent</code>, and <code>bitangent</code>. * * @alias EllipsoidSurfaceAppearance * @constructor @@ -148630,6 +149116,7 @@ define('Scene/FrameState',[ * State information about the current frame. An instance of this class * is provided to update functions. * + * @param {Context} context The rendering context. * @param {CreditDisplay} creditDisplay Handles adding and removing credits from an HTML element * * @alias FrameState @@ -148716,6 +149203,15 @@ define('Scene/FrameState',[ */ this.occluder = undefined; + /** + * The maximum screen-space error used to drive level-of-detail refinement. Higher + * values will provide better performance but lower visual quality. + * + * @type {Number} + * @default 2 + */ + this.maximumScreenSpaceError = undefined; + this.passes = { /** * <code>true</code> if the primitive should update for a render pass, <code>false</code> otherwise. @@ -148838,6 +149334,14 @@ define('Scene/FrameState',[ */ outOfView : true }; + + /** + * The position of the splitter to use when rendering imagery layers on either side of a splitter. + * This value should be between 0.0 and 1.0 with 0 being the far left of the viewport and 1 being the far right of the viewport. + * @type {Number} + * @default 0.0 + */ + this.imagerySplitPosition = 0.0; } /** @@ -149585,6 +150089,9 @@ uniform bool u_dayTextureUseWebMercatorT[TEXTURE_UNITS];\n\ #ifdef APPLY_ALPHA\n\ uniform float u_dayTextureAlpha[TEXTURE_UNITS];\n\ #endif\n\ +#ifdef APPLY_SPLIT\n\ +uniform float u_dayTextureSplit[TEXTURE_UNITS];\n\ +#endif\n\ #ifdef APPLY_BRIGHTNESS\n\ uniform float u_dayTextureBrightness[TEXTURE_UNITS];\n\ #endif\n\ @@ -149634,7 +150141,8 @@ float textureBrightness,\n\ float textureContrast,\n\ float textureHue,\n\ float textureSaturation,\n\ -float textureOneOverGamma)\n\ +float textureOneOverGamma,\n\ +float split)\n\ {\n\ vec2 alphaMultiplier = step(textureCoordinateRectangle.st, tileTextureCoordinates);\n\ textureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;\n\ @@ -149646,6 +150154,15 @@ vec2 textureCoordinates = tileTextureCoordinates * scale + translation;\n\ vec4 value = texture2D(texture, textureCoordinates);\n\ vec3 color = value.rgb;\n\ float alpha = value.a;\n\ +#ifdef APPLY_SPLIT\n\ +float splitPosition = czm_imagerySplitPosition * czm_viewport.z;\n\ +if (split < 0.0 && gl_FragCoord.x > splitPosition) {\n\ +alpha = 0.0;\n\ +}\n\ +else if (split > 0.0 && gl_FragCoord.x < splitPosition) {\n\ +alpha = 0.0;\n\ +}\n\ +#endif\n\ #ifdef APPLY_BRIGHTNESS\n\ color = mix(vec3(0.0), color, textureBrightness);\n\ #endif\n\ @@ -150055,7 +150572,7 @@ define('Scene/GlobeSurfaceShaderSet',[ return useWebMercatorProjection ? get2DYPositionFractionMercatorProjection : get2DYPositionFractionGeographicProjection; } - GlobeSurfaceShaderSet.prototype.getShaderProgram = function(frameState, surfaceTile, numberOfDayTextures, applyBrightness, applyContrast, applyHue, applySaturation, applyGamma, applyAlpha, showReflectiveOcean, showOceanWaves, enableLighting, hasVertexNormals, useWebMercatorProjection, enableFog) { + GlobeSurfaceShaderSet.prototype.getShaderProgram = function(frameState, surfaceTile, numberOfDayTextures, applyBrightness, applyContrast, applyHue, applySaturation, applyGamma, applyAlpha, applySplit, showReflectiveOcean, showOceanWaves, enableLighting, hasVertexNormals, useWebMercatorProjection, enableFog) { var quantization = 0; var quantizationDefine = ''; @@ -150080,7 +150597,8 @@ define('Scene/GlobeSurfaceShaderSet',[ (hasVertexNormals << 11) | (useWebMercatorProjection << 12) | (enableFog << 13) | - (quantization << 14); + (quantization << 14) | + (applySplit << 15); var surfaceShader = surfaceTile.surfaceShader; if (defined(surfaceShader) && @@ -150149,6 +150667,10 @@ define('Scene/GlobeSurfaceShaderSet',[ fs.defines.push('FOG'); } + if (applySplit) { + fs.defines.push('APPLY_SPLIT'); + } + var computeDayColor = '\ vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates)\n\ {\n\ @@ -150167,7 +150689,8 @@ define('Scene/GlobeSurfaceShaderSet',[ ' + (applyContrast ? 'u_dayTextureContrast[' + i + ']' : '0.0') + ',\n\ ' + (applyHue ? 'u_dayTextureHue[' + i + ']' : '0.0') + ',\n\ ' + (applySaturation ? 'u_dayTextureSaturation[' + i + ']' : '0.0') + ',\n\ - ' + (applyGamma ? 'u_dayTextureOneOverGamma[' + i + ']' : '0.0') + '\n\ + ' + (applyGamma ? 'u_dayTextureOneOverGamma[' + i + ']' : '0.0') + ',\n\ + ' + (applySplit ? 'u_dayTextureSplit[' + i + ']' : '0.0') + '\n\ );\n'; } @@ -151648,6 +152171,49 @@ define('Scene/Imagery',[ return Imagery; }); +/*global define*/ +define('Scene/ImagerySplitDirection',[ + '../Core/freezeObject' + ], function( + freezeObject) { + 'use strict'; + + /** + * The direction to display an ImageryLayer relative to the {@link Scene#imagerySplitPosition}. + * + * @exports ImagerySplitDirection + * + * @see ImageryLayer#splitDirection + */ + var ImagerySplitDirection = { + /** + * Display the ImageryLayer to the left of the {@link Scene#imagerySplitPosition}. + * + * @type {Number} + * @constant + */ + LEFT : -1.0, + + /** + * Always display the ImageryLayer. + * + * @type {Number} + * @constant + */ + NONE: 0.0, + + /** + * Display the ImageryLayer to the right of the {@link Scene#imagerySplitPosition}. + * + * @type {Number} + * @constant + */ + RIGHT : 1.0 + }; + + return freezeObject(ImagerySplitDirection); +}); + /*global define*/ define('Scene/TileImagery',[ '../Core/defined', @@ -151715,7 +152281,7 @@ define('Scene/TileImagery',[ // Find some ancestor imagery we can use while this imagery is still loading. var ancestor = loadingImagery.parent; var closestAncestorThatNeedsLoading; - while (defined(ancestor) && ancestor.state !== ImageryState.READY) { + while (defined(ancestor) && (ancestor.state !== ImageryState.READY || (!this.useWebMercatorT && !defined(ancestor.texture)))) { if (ancestor.state !== ImageryState.FAILED && ancestor.state !== ImageryState.INVALID) { // ancestor is still loading closestAncestorThatNeedsLoading = closestAncestorThatNeedsLoading || ancestor; @@ -151791,6 +152357,7 @@ define('Scene/ImageryLayer',[ '../Shaders/ReprojectWebMercatorVS', '../ThirdParty/when', './Imagery', + './ImagerySplitDirection', './ImageryState', './TileImagery' ], function( @@ -151827,6 +152394,7 @@ define('Scene/ImageryLayer',[ ReprojectWebMercatorVS, when, Imagery, + ImagerySplitDirection, ImageryState, TileImagery) { 'use strict'; @@ -151886,6 +152454,7 @@ define('Scene/ImageryLayer',[ * imagery tile for which the gamma is required, and it is expected to return * the gamma value to use for the tile. The function is executed for every * frame and for every tile, so it must be fast. + * @param {ImagerySplitDirection|Function} [options.splitDirection=ImagerySplitDirection.NONE] The {@link ImagerySplitDirection} split to apply to this layer. * @param {Boolean} [options.show=true] True if the layer is shown; otherwise, false. * @param {Number} [options.maximumAnisotropy=maximum supported] The maximum anisotropy level to use * for texture filtering. If this parameter is not specified, the maximum anisotropy supported @@ -151953,6 +152522,14 @@ define('Scene/ImageryLayer',[ */ this.gamma = defaultValue(options.gamma, defaultValue(imageryProvider.defaultGamma, ImageryLayer.DEFAULT_GAMMA)); + /** + * The {@link ImagerySplitDirection} to apply to this layer. + * + * @type {ImagerySplitDirection} + * @default {@link ImageryLayer.DEFAULT_SPLIT} + */ + this.splitDirection = defaultValue(options.splitDirection, defaultValue(imageryProvider.defaultSplit, ImageryLayer.DEFAULT_SPLIT)); + /** * Determines if this layer is shown. * @@ -152050,6 +152627,14 @@ define('Scene/ImageryLayer',[ */ ImageryLayer.DEFAULT_GAMMA = 1.0; + /** + * This value is used as the default spliat for the imagery layer if one is not provided during construction + * or by the imagery provider. + * @type {ImagerySplitDirection} + * @default ImagerySplitDirection.NONE + */ + ImageryLayer.DEFAULT_SPLIT = ImagerySplitDirection.NONE; + /** * Gets a value indicating whether this layer is the base layer in the * {@link ImageryLayerCollection}. The base layer is the one that underlies all @@ -152334,7 +152919,7 @@ define('Scene/ImageryLayer',[ if (!defined(clippedImageryRectangle)) { continue; } - + minV = Math.max(0.0, (clippedImageryRectangle.south - terrainRectangle.south) / terrainRectangle.height); // If this is the southern-most imagery tile mapped to this terrain tile, @@ -152817,6 +153402,7 @@ define('Scene/ImageryLayer',[ /** * Gets the level with the specified world coordinate spacing between texels, or less. * + * @param {ImageryLayer} layer The imagery layer to use. * @param {Number} texelSpacing The texel spacing for which to find a corresponding level. * @param {Number} latitudeClosestToEquator The latitude closest to the equator that we're concerned with. * @returns {Number} The level with the specified texel spacing or less. @@ -153585,6 +154171,9 @@ define('Scene/GlobeSurfaceTileProvider',[ u_scaleAndBias : function() { return this.properties.scaleAndBias; }, + u_dayTextureSplit : function() { + return this.properties.dayTextureSplit; + }, // make a separate object so that changes to the properties are seen on // derived commands that combine another uniform map with this one. @@ -153609,6 +154198,7 @@ define('Scene/GlobeSurfaceTileProvider',[ dayTextureHue : [], dayTextureSaturation : [], dayTextureOneOverGamma : [], + dayTextureSplit : [], dayIntensity : 0.0, southAndNorthLatitude : new Cartesian2(), @@ -153903,6 +154493,7 @@ define('Scene/GlobeSurfaceTileProvider',[ var applySaturation = false; var applyGamma = false; var applyAlpha = false; + var applySplit = false; while (numberOfDayTextures < maxTextures && imageryIndex < imageryLen) { var tileImagery = tileImageryCollection[imageryIndex]; @@ -153958,6 +154549,9 @@ define('Scene/GlobeSurfaceTileProvider',[ uniformMapProperties.dayTextureOneOverGamma[numberOfDayTextures] = 1.0 / imageryLayer.gamma; applyGamma = applyGamma || uniformMapProperties.dayTextureOneOverGamma[numberOfDayTextures] !== 1.0 / ImageryLayer.DEFAULT_GAMMA; + uniformMapProperties.dayTextureSplit[numberOfDayTextures] = imageryLayer.splitDirection; + applySplit = applySplit || uniformMapProperties.dayTextureSplit[numberOfDayTextures] !== 0.0; + if (defined(imagery.credits)) { var creditDisplay = frameState.creditDisplay; var credits = imagery.credits; @@ -153979,7 +154573,7 @@ define('Scene/GlobeSurfaceTileProvider',[ uniformMapProperties.minMaxHeight.y = encoding.maximumHeight; Matrix4.clone(encoding.matrix, uniformMapProperties.scaleAndBias); - command.shaderProgram = tileProvider._surfaceShaderSet.getShaderProgram(frameState, surfaceTile, numberOfDayTextures, applyBrightness, applyContrast, applyHue, applySaturation, applyGamma, applyAlpha, showReflectiveOcean, showOceanWaves, tileProvider.enableLighting, hasVertexNormals, useWebMercatorProjection, applyFog); + command.shaderProgram = tileProvider._surfaceShaderSet.getShaderProgram(frameState, surfaceTile, numberOfDayTextures, applyBrightness, applyContrast, applyHue, applySaturation, applyGamma, applyAlpha, applySplit, showReflectiveOcean, showOceanWaves, tileProvider.enableLighting, hasVertexNormals, useWebMercatorProjection, applyFog); command.castShadows = castShadows; command.receiveShadows = receiveShadows; command.renderState = renderState; @@ -157012,7 +157606,7 @@ define('Scene/GoogleEarthImageryProvider',[ * url : 'https://earth.localdomain', * channel : 1008 * }); - * + * * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing} */ function GoogleEarthImageryProvider(options) { @@ -157463,7 +158057,7 @@ define('Scene/GoogleEarthImageryProvider',[ * instances. The array may be empty if no features are found at the given location. * It may also be undefined if picking is not supported. */ - GoogleEarthImageryProvider.prototype.pickFeatures = function() { + GoogleEarthImageryProvider.prototype.pickFeatures = function(x, y, level, longitude, latitude) { return undefined; }; @@ -157528,7 +158122,7 @@ define('Scene/GridImageryProvider',[ * @param {Color} [options.color=Color(1.0, 1.0, 1.0, 0.4)] The color to draw grid lines. * @param {Color} [options.glowColor=Color(0.0, 1.0, 0.0, 0.05)] The color to draw glow for grid lines. * @param {Number} [options.glowWidth=6] The width of lines used for rendering the line glow effect. - * @param {Color} [backgroundColor=Color(0.0, 0.5, 0.0, 0.2)] Background fill color. + * @param {Color} [options.backgroundColor=Color(0.0, 0.5, 0.0, 0.2)] Background fill color. * @param {Number} [options.tileWidth=256] The width of the tile for level-of-detail selection purposes. * @param {Number} [options.tileHeight=256] The height of the tile for level-of-detail selection purposes. * @param {Number} [options.canvasSize=256] The size of the canvas used for rendering. @@ -157835,7 +158429,7 @@ define('Scene/GridImageryProvider',[ * instances. The array may be empty if no features are found at the given location. * It may also be undefined if picking is not supported. */ - GridImageryProvider.prototype.pickFeatures = function() { + GridImageryProvider.prototype.pickFeatures = function(x, y, level, longitude, latitude) { return undefined; }; @@ -160787,11 +161381,12 @@ define('Scene/SceneTransitioner',[ if (duration > 0.0) { position.x = 0.0; - position.y = 0.0; - position.z = 5.0 * ellipsoid.maximumRadius; + position.y = -1.0; + position.z = 1.0; + position = Cartesian3.multiplyByScalar(Cartesian3.normalize(position, position), 5.0 * ellipsoid.maximumRadius, position); - Cartesian3.negate(Cartesian3.UNIT_Z, direction); - Cartesian3.clone(Cartesian3.UNIT_Y, up); + Cartesian3.negate(Cartesian3.normalize(position, direction), direction); + Cartesian3.cross(Cartesian3.UNIT_X, direction, up); } else { var camera = scene.camera; if (this._previousMode === SceneMode.SCENE2D) { @@ -161355,48 +161950,42 @@ define('Scene/SceneTransitioner',[ var scene = transitioner._scene; var camera = scene.camera; - var startPos = Cartesian3.clone(camera.position, scratch3DToCVStartPos); - var startDir = Cartesian3.clone(camera.direction, scratch3DToCVStartDir); - var startUp = Cartesian3.clone(camera.up, scratch3DToCVStartUp); - var endPos = Cartesian3.clone(cameraCV.position, scratch3DToCVEndPos); var endDir = Cartesian3.clone(cameraCV.direction, scratch3DToCVEndDir); var endUp = Cartesian3.clone(cameraCV.up, scratch3DToCVEndUp); - var startRight = camera.frustum.right; - var endRight = endPos.z * 0.5; - - function update(value) { - columbusViewMorph(startPos, endPos, value.time, camera.position); - columbusViewMorph(startDir, endDir, value.time, camera.direction); - columbusViewMorph(startUp, endUp, value.time, camera.up); - Cartesian3.cross(camera.direction, camera.up, camera.right); - Cartesian3.normalize(camera.right, camera.right); - - var frustum = camera.frustum; - frustum.right = CesiumMath.lerp(startRight, endRight, value.time); - frustum.left = -frustum.right; - frustum.top = frustum.right * (scene.drawingBufferHeight / scene.drawingBufferWidth); - frustum.bottom = -frustum.top; - - camera.position.z = 2.0 * scene.mapProjection.ellipsoid.maximumRadius; - } - var tween = scene.tweens.add({ - duration : duration, - easingFunction : EasingFunction.QUARTIC_OUT, - startObject : { - time : 0.0 - }, - stopObject : { - time : 1.0 - }, - update : update, - complete : function() { - scene._mode = SceneMode.MORPHING; - morphOrthographicToPerspective(transitioner, duration, cameraCV, complete); + scene._mode = SceneMode.MORPHING; + morphOrthographicToPerspective(transitioner, 0.0, cameraCV, function() { + camera.frustum = cameraCV.frustum.clone(); + + var startPos = Cartesian3.clone(camera.position, scratch3DToCVStartPos); + var startDir = Cartesian3.clone(camera.direction, scratch3DToCVStartDir); + var startUp = Cartesian3.clone(camera.up, scratch3DToCVStartUp); + startPos.z = endPos.z; + + function update(value) { + columbusViewMorph(startPos, endPos, value.time, camera.position); + columbusViewMorph(startDir, endDir, value.time, camera.direction); + columbusViewMorph(startUp, endUp, value.time, camera.up); + Cartesian3.cross(camera.direction, camera.up, camera.right); + Cartesian3.normalize(camera.right, camera.right); } + var tween = scene.tweens.add({ + duration : duration, + easingFunction : EasingFunction.QUARTIC_OUT, + startObject : { + time : 0.0 + }, + stopObject : { + time : 1.0 + }, + update : update, + complete : function() { + complete(transitioner); + } + }); + transitioner._currentTweens.push(tween); }); - transitioner._currentTweens.push(tween); } var scratch3DToCVStartPos = new Cartesian3(); @@ -164499,16 +165088,17 @@ define('Scene/ShadowMap',[ 'use strict'; /** - * Creates a shadow map from the provided light camera. + * Use {@link Viewer#shadowMap} to get the scene's shadow map originating from the sun. Do not construct this directly. * + * <p> * The normalOffset bias pushes the shadows forward slightly, and may be disabled * for applications that require ultra precise shadows. + * </p> * * @alias ShadowMap - * @constructor + * @internalConstructor * * @param {Object} options An object containing the following properties: - * @param {Context} options.context The context in which to create the shadow map. * @param {Camera} options.lightCamera A camera representing the light source. * @param {Boolean} [options.enabled=true] Whether the shadow map is enabled. * @param {Boolean} [options.isPointLight=false] Whether the light source is a point light. Point light shadows do not use cascades. @@ -164519,6 +165109,7 @@ define('Scene/ShadowMap',[ * @param {Number} [options.size=2048] The width and height, in pixels, of each shadow map. * @param {Boolean} [options.softShadows=false] Whether percentage-closer-filtering is enabled for producing softer shadows. * @param {Number} [options.darkness=0.3] The shadow darkness. + * @param {Boolean} [options.normalOffset=true] Whether a normal bias is applied to shadows. * * @exception {DeveloperError} Only one or four cascades are supported. * @@ -164526,6 +165117,7 @@ define('Scene/ShadowMap',[ */ function ShadowMap(options) { options = defaultValue(options, defaultValue.EMPTY_OBJECT); + // options.context is an undocumented option var context = options.context; if (!defined(context)) { @@ -164540,6 +165132,7 @@ define('Scene/ShadowMap',[ this._enabled = defaultValue(options.enabled, true); this._softShadows = defaultValue(options.softShadows, false); + this._normalOffset = defaultValue(options.normalOffset, true); this.dirty = true; /** @@ -164584,7 +165177,7 @@ define('Scene/ShadowMap',[ polygonOffset : polygonOffsetSupported, polygonOffsetFactor : 1.1, polygonOffsetUnits : 4.0, - normalOffset : true, + normalOffset : this._normalOffset, normalOffsetScale : 0.5, normalShading : true, normalShadingSmooth : 0.3, @@ -164595,7 +165188,7 @@ define('Scene/ShadowMap',[ polygonOffset : polygonOffsetSupported, polygonOffsetFactor : 1.1, polygonOffsetUnits : 4.0, - normalOffset : true, + normalOffset : this._normalOffset, normalOffsetScale : 0.1, normalShading : true, normalShadingSmooth : 0.05, @@ -164606,7 +165199,7 @@ define('Scene/ShadowMap',[ polygonOffset : false, polygonOffsetFactor : 1.1, polygonOffsetUnits : 4.0, - normalOffset : false, + normalOffset : this._normalOffset, normalOffsetScale : 0.0, normalShading : true, normalShadingSmooth : 0.1, @@ -164775,6 +165368,26 @@ define('Scene/ShadowMap',[ } }, + /** + * Determines if a normal bias will be applied to shadows. + * + * @memberof ShadowMap.prototype + * @type {Boolean} + * @default true + */ + normalOffset : { + get : function() { + return this._normalOffset; + }, + set : function(value) { + this.dirty = this._normalOffset !== value; + this._normalOffset = value; + this._terrainBias.normalOffset = value; + this._primitiveBias.normalOffset = value; + this._pointBias.normalOffset = value; + } + }, + /** * Determines if soft shadows are enabled. Uses pcf filtering which requires more texture reads and may hurt performance. * @@ -167559,6 +168172,22 @@ define('Scene/Scene',[ get : function() { return this._mapMode2D; } + }, + + /** + * Gets or sets the position of the Imagery splitter within the viewport. Valid values are between 0.0 and 1.0. + * @memberof Scene.prototype + * + * @type {Number} + */ + imagerySplitPosition : { + get: function() { + return this._frameState.imagerySplitPosition; + }, + + set: function(value) { + this._frameState.imagerySplitPosition = value; + } } }); @@ -167657,6 +168286,11 @@ define('Scene/Scene',[ frameState.cullingVolume = camera.frustum.computeCullingVolume(camera.positionWC, camera.directionWC, camera.upWC); frameState.occluder = getOccluder(scene); frameState.terrainExaggeration = scene._terrainExaggeration; + if (defined(scene.globe)) { + frameState.maximumScreenSpaceError = scene.globe.maximumScreenSpaceError; + } else { + frameState.maximumScreenSpaceError = 2; + } clearPasses(frameState.passes); } @@ -167909,22 +168543,38 @@ define('Scene/Scene',[ var sp = defaultValue(shaderProgram, command.shaderProgram); var fs = sp.fragmentShaderSource.clone(); + var targets = []; fs.sources = fs.sources.map(function(source) { source = ShaderSource.replaceMain(source, 'czm_Debug_main'); + var re = /gl_FragData\[(\d+)\]/g; + var match; + while ((match = re.exec(source)) !== null) { + if (targets.indexOf(match[1]) === -1) { + targets.push(match[1]); + } + } return source; }); + var length = targets.length; var newMain = 'void main() \n' + '{ \n' + ' czm_Debug_main(); \n'; + var i; if (scene.debugShowCommands) { if (!defined(command._debugColor)) { command._debugColor = Color.fromRandom(); } var c = command._debugColor; - newMain += ' gl_FragColor.rgb *= vec3(' + c.red + ', ' + c.green + ', ' + c.blue + '); \n'; + if (length > 0) { + for (i = 0; i < length; ++i) { + newMain += ' gl_FragData[' + targets[i] + '].rgb *= vec3(' + c.red + ', ' + c.green + ', ' + c.blue + '); \n'; + } + } else { + newMain += ' ' + 'gl_FragColor' + '.rgb *= vec3(' + c.red + ', ' + c.green + ', ' + c.blue + '); \n'; + } } if (scene.debugShowFrustums) { @@ -167933,7 +168583,13 @@ define('Scene/Scene',[ var r = (command.debugOverlappingFrustums & (1 << 0)) ? '1.0' : '0.0'; var g = (command.debugOverlappingFrustums & (1 << 1)) ? '1.0' : '0.0'; var b = (command.debugOverlappingFrustums & (1 << 2)) ? '1.0' : '0.0'; - newMain += ' gl_FragColor.rgb *= vec3(' + r + ', ' + g + ', ' + b + '); \n'; + if (length > 0) { + for (i = 0; i < length; ++i) { + newMain += ' gl_FragData[' + targets[i] + '].rgb *= vec3(' + r + ', ' + g + ', ' + b + '); \n'; + } + } else { + newMain += ' ' + 'gl_FragColor' + '.rgb *= vec3(' + r + ', ' + g + ', ' + b + '); \n'; + } } newMain += '}'; @@ -168105,7 +168761,7 @@ define('Scene/Scene',[ var scratchPerspectiveOffCenterFrustum = new PerspectiveOffCenterFrustum(); var scratchOrthographicFrustum = new OrthographicFrustum(); - function executeCommands(scene, passState) { + function executeCommands(scene, passState, picking) { var camera = scene._camera; var context = scene.context; var us = context.uniformState; @@ -168129,37 +168785,40 @@ define('Scene/Scene',[ us.updateFrustum(frustum); us.updatePass(Pass.ENVIRONMENT); + var useWebVR = scene._useWebVR && scene.mode !== SceneMode.SCENE2D; var environmentState = scene._environmentState; - var skyBoxCommand = environmentState.skyBoxCommand; - if (defined(skyBoxCommand)) { - executeCommand(skyBoxCommand, scene, context, passState); - } - if (environmentState.isSkyAtmosphereVisible) { - executeCommand(environmentState.skyAtmosphereCommand, scene, context, passState); - } + // Do not render environment primitives during a pick pass since they do not generate picking commands. + if (!picking) { + var skyBoxCommand = environmentState.skyBoxCommand; + if (defined(skyBoxCommand)) { + executeCommand(skyBoxCommand, scene, context, passState); + } - var useWebVR = scene._useWebVR && scene.mode !== SceneMode.SCENE2D; + if (environmentState.isSkyAtmosphereVisible) { + executeCommand(environmentState.skyAtmosphereCommand, scene, context, passState); + } - if (environmentState.isSunVisible) { - environmentState.sunDrawCommand.execute(context, passState); - if (scene.sunBloom && !useWebVR) { - var framebuffer; - if (environmentState.useGlobeDepthFramebuffer) { - framebuffer = scene._globeDepth.framebuffer; - } else if (environmentState.useFXAA) { - framebuffer = scene._fxaa.getColorFramebuffer(); - } else { - framebuffer = environmentState.originalFramebuffer; + if (environmentState.isSunVisible) { + environmentState.sunDrawCommand.execute(context, passState); + if (scene.sunBloom && !useWebVR) { + var framebuffer; + if (environmentState.useGlobeDepthFramebuffer) { + framebuffer = scene._globeDepth.framebuffer; + } else if (environmentState.useFXAA) { + framebuffer = scene._fxaa.getColorFramebuffer(); + } else { + framebuffer = environmentState.originalFramebuffer; + } + scene._sunPostProcess.execute(context, framebuffer); + passState.framebuffer = framebuffer; } - scene._sunPostProcess.execute(context, framebuffer); - passState.framebuffer = framebuffer; } - } - // Moon can be seen through the atmosphere, since the sun is rendered after the atmosphere. - if (environmentState.isMoonVisible) { - environmentState.moonCommand.execute(context, passState); + // Moon can be seen through the atmosphere, since the sun is rendered after the atmosphere. + if (environmentState.isMoonVisible) { + environmentState.moonCommand.execute(context, passState); + } } // Determine how translucent surfaces will be handled. @@ -168435,14 +169094,14 @@ define('Scene/Scene',[ Cartesian3.add(savedCamera.position, eyeTranslation, camera.position); camera.frustum.xOffset = offset; - executeCommands(scene, passState); + executeCommands(scene, passState, picking); viewport.x = passState.viewport.width; Cartesian3.subtract(savedCamera.position, eyeTranslation, camera.position); camera.frustum.xOffset = -offset; - executeCommands(scene, passState); + executeCommands(scene, passState, picking); Camera.clone(savedCamera, camera); } else { @@ -168593,7 +169252,7 @@ define('Scene/Scene',[ executeShadowMapCastCommands(scene); } - executeCommands(scene, passState); + executeCommands(scene, passState, picking); } function updateEnvironment(scene) { @@ -168822,7 +169481,7 @@ define('Scene/Scene',[ if (defined(this._deviceOrientationCameraController)) { this._deviceOrientationCameraController.update(); } - + this._camera.update(this._mode); this._camera._updateCameraChanged(); }; @@ -169733,7 +170392,7 @@ define('Scene/SingleTileImageryProvider',[ * instances. The array may be empty if no features are found at the given location. * It may also be undefined if picking is not supported. */ - SingleTileImageryProvider.prototype.pickFeatures = function() { + SingleTileImageryProvider.prototype.pickFeatures = function(x, y, level, longitude, latitude) { return undefined; }; @@ -171254,7 +171913,7 @@ define('Scene/TileCoordinatesImageryProvider',[ * instances. The array may be empty if no features are found at the given location. * It may also be undefined if picking is not supported. */ - TileCoordinatesImageryProvider.prototype.pickFeatures = function() { + TileCoordinatesImageryProvider.prototype.pickFeatures = function(x, y, level, longitude, latitude) { return undefined; }; @@ -171668,7 +172327,19 @@ define('Scene/WebMapServiceImageryProvider',[ } setParameter('layers', options.layers); - setParameter('srs', options.tilingScheme instanceof WebMercatorTilingScheme ? 'EPSG:3857' : 'EPSG:4326'); + + // Use SRS or CRS based on the WMS version. + if (parseFloat(parameters.version) >= 1.3) { + // Use CRS with 1.3.0 and going forward. + // For GeographicTilingScheme, use CRS:84 vice EPSG:4326 to specify lon, lat (x, y) ordering for + // bbox requests. + setParameter('crs', options.tilingScheme instanceof WebMercatorTilingScheme ? 'EPSG:3857' : 'CRS:84'); + } + else { + // SRS for WMS 1.1.0 or 1.1.1. + setParameter('srs', options.tilingScheme instanceof WebMercatorTilingScheme ? 'EPSG:3857' : 'EPSG:4326'); + } + setParameter('bbox', '{westProjected},{southProjected},{eastProjected},{northProjected}'); setParameter('width', '{width}'); setParameter('height', '{height}'); @@ -172129,7 +172800,7 @@ define('Scene/WebMapTileServiceImageryProvider',[ * credit : new Cesium.Credit('U. S. Geological Survey') * }); * viewer.imageryLayers.addImageryProvider(shadedRelief2); - * + * * @see ArcGisMapServerImageryProvider * @see BingMapsImageryProvider * @see GoogleEarthImageryProvider @@ -172494,7 +173165,7 @@ define('Scene/WebMapTileServiceImageryProvider',[ * instances. The array may be empty if no features are found at the given location. * It may also be undefined if picking is not supported. */ - WebMapTileServiceImageryProvider.prototype.pickFeatures = function() { + WebMapTileServiceImageryProvider.prototype.pickFeatures = function(x, y, level, longitude, latitude) { return undefined; }; @@ -175781,6 +176452,7 @@ define('Widgets/CesiumInspector/CesiumInspectorViewModel',[ * @constructor * * @param {Scene} scene The scene instance to use. + * @param {PerformanceContainer} performanceContainer The instance to use for performance container. * * @exception {DeveloperError} scene is required. */ @@ -175893,13 +176565,6 @@ define('Widgets/CesiumInspector/CesiumInspectorViewModel',[ this.depthFrustum = 1; this._numberOfFrustums = 1; - /** - * Gets or sets the index of the depth frustum text. This property is observable. - * @type {String} - * @default '1 of 1' - */ - this.depthFrustumText = '1 of 1'; - /** * Gets or sets the suspend updates state. This property is observable. * @type {Boolean} @@ -175919,7 +176584,7 @@ define('Widgets/CesiumInspector/CesiumInspectorViewModel',[ * @type {String} * @default '' */ - this.frustumStatisticText = ''; + this.frustumStatisticText = false; /** * Gets or sets the selected tile information text. This property is observable. @@ -175947,7 +176612,7 @@ define('Widgets/CesiumInspector/CesiumInspectorViewModel',[ * @type {Boolean} * @default false */ - this.pickPimitiveActive = false; + this.pickPrimitiveActive = false; /** * Gets if the picking tile command is active. This property is observable. @@ -175985,30 +176650,66 @@ define('Widgets/CesiumInspector/CesiumInspectorViewModel',[ this.terrainVisible = false; /** - * Gets or sets if the text on the general section expand button. This property is observable. + * Gets or sets the index of the depth frustum text. This property is observable. + * @type {String} + * @default '' + */ + this.depthFrustumText = ''; + + /** + * Gets the text on the general section expand button. This property is computed. * @type {String} * @default '-' */ - this.generalSwitchText = '-'; + this.generalSwitchText = knockout.pureComputed(function() { + return that.generalVisible ? '-' : '+'; + }); /** - * Gets or sets if the text on the primitive section expand button. This property is observable. + * Gets the text on the primitives section expand button. This property is computed. * @type {String} * @default '+' */ - this.primitivesSwitchText = '+'; + this.primitivesSwitchText = knockout.pureComputed(function() { + return that.primitivesVisible ? '-' : '+'; + }); /** - * Gets or sets if the text on the terrain section expand button. This property is observable. + * Gets the text on the terrain section expand button. This property is computed. * @type {String} * @default '+' */ - this.terrainSwitchText = '+'; + this.terrainSwitchText = knockout.pureComputed(function() { + return that.terrainVisible ? '-' : '+'; + }); - knockout.track(this, ['filterTile', 'suspendUpdates', 'dropDownVisible', 'shaderCacheText', 'frustums', - 'frustumStatisticText', 'pickTileActive', 'pickPrimitiveActive', 'hasPickedPrimitive', - 'hasPickedTile', 'tileText', 'generalVisible', 'generalSwitchText', - 'primitivesVisible', 'primitivesSwitchText', 'terrainVisible', 'terrainSwitchText', 'depthFrustumText']); + knockout.track(this, [ + 'frustums', + 'performance', + 'shaderCacheText', + 'primitiveBoundingSphere', + 'primitiveReferenceFrame', + 'filterPrimitive', + 'tileBoundingSphere', + 'filterTile', + 'wireframe', + 'globeDepth', + 'pickDepth', + 'depthFrustum', + 'suspendUpdates', + 'tileCoordinates', + 'frustumStatisticText', + 'tileText', + 'hasPickedPrimitive', + 'hasPickedTile', + 'pickPrimitiveActive', + 'pickTileActive', + 'dropDownVisible', + 'generalVisible', + 'primitivesVisible', + 'terrainVisible', + 'depthFrustumText' + ]); this._toggleDropDown = createCommand(function() { that.dropDownVisible = !that.dropDownVisible; @@ -176016,37 +176717,28 @@ define('Widgets/CesiumInspector/CesiumInspectorViewModel',[ this._toggleGeneral = createCommand(function() { that.generalVisible = !that.generalVisible; - that.generalSwitchText = that.generalVisible ? '-' : '+'; }); this._togglePrimitives = createCommand(function() { that.primitivesVisible = !that.primitivesVisible; - that.primitivesSwitchText = that.primitivesVisible ? '-' : '+'; }); this._toggleTerrain = createCommand(function() { that.terrainVisible = !that.terrainVisible; - that.terrainSwitchText = that.terrainVisible ? '-' : '+'; }); - this._showFrustums = createCommand(function() { - if (that.frustums) { - that._scene.debugShowFrustums = true; - } else { - that._scene.debugShowFrustums = false; - } - return true; + this._frustumsSubscription = knockout.getObservable(this, 'frustums').subscribe(function(val) { + that._scene.debugShowFrustums = val; }); - this._showPerformance = createCommand(function() { - if (that.performance) { + this._performanceSubscription = knockout.getObservable(this, 'performance').subscribe(function(val) { + if (val) { that._performanceDisplay = new PerformanceDisplay({ container : that._performanceContainer }); } else { that._performanceContainer.innerHTML = ''; } - return true; }); this._showPrimitiveBoundingSphere = createCommand(function() { @@ -176054,6 +176746,10 @@ define('Widgets/CesiumInspector/CesiumInspectorViewModel',[ return true; }); + this._primitiveBoundingSphereSubscription = knockout.getObservable(this, 'primitiveBoundingSphere').subscribe(function() { + that._showPrimitiveBoundingSphere(); + }); + this._showPrimitiveReferenceFrame = createCommand(function() { if (that.primitiveReferenceFrame) { var modelMatrix = that._primitive.modelMatrix; @@ -176068,6 +176764,10 @@ define('Widgets/CesiumInspector/CesiumInspectorViewModel',[ return true; }); + this._primitiveReferenceFrameSubscription = knockout.getObservable(this, 'primitiveReferenceFrame').subscribe(function() { + that._showPrimitiveReferenceFrame(); + }); + this._doFilterPrimitive = createCommand(function() { if (that.filterPrimitive) { that._scene.debugCommandFilter = function(command) { @@ -176084,41 +176784,43 @@ define('Widgets/CesiumInspector/CesiumInspectorViewModel',[ return true; }); - this._showWireframe = createCommand(function() { - globe._surface.tileProvider._debug.wireframe = that.wireframe; - return true; + this._filterPrimitiveSubscription = knockout.getObservable(this, 'filterPrimitive').subscribe(function() { + that._doFilterPrimitive(); }); - this._showGlobeDepth = createCommand(function() { - that._scene.debugShowGlobeDepth = that.globeDepth; - return true; + this._wireframeSubscription = knockout.getObservable(this, 'wireframe').subscribe(function(val) { + globe._surface.tileProvider._debug.wireframe = val; }); - this._showPickDepth = createCommand(function() { - that._scene.debugShowPickDepth = that.pickDepth; - return true; + this._globeDepthSubscription = knockout.getObservable(this, 'globeDepth').subscribe(function(val) { + that._scene.debugShowGlobeDepth = val; + }); + + this._pickDepthSubscription = knockout.getObservable(this, 'pickDepth').subscribe(function(val) { + that._scene.debugShowPickDepth = val; + }); + + this._depthFrustumSubscription = knockout.getObservable(this, 'depthFrustum').subscribe(function(val) { + that.scene.debugShowDepthFrustum = val; }); this._incrementDepthFrustum = createCommand(function() { var next = that.depthFrustum + 1; that.depthFrustum = boundDepthFrustum(1, that._numberOfFrustums, next); - that.scene.debugShowDepthFrustum = that.depthFrustum; return true; }); this._decrementDepthFrustum = createCommand(function() { var next = that.depthFrustum - 1; that.depthFrustum = boundDepthFrustum(1, that._numberOfFrustums, next); - that.scene.debugShowDepthFrustum = that.depthFrustum; return true; }); - this._doSuspendUpdates = createCommand(function() { - globe._surface._debug.suspendLodUpdate = that.suspendUpdates; - if (!that.suspendUpdates) { + this._suspendUpdatesSubscription = knockout.getObservable(this, 'suspendUpdates').subscribe(function(val) { + globe._surface._debug.suspendLodUpdate = val; + if (!val) { that.filterTile = false; } - return true; }); var tileBoundariesLayer; @@ -176134,6 +176836,14 @@ define('Widgets/CesiumInspector/CesiumInspectorViewModel',[ return true; }); + this._tileCoordinatesSubscription = knockout.getObservable(this, 'tileCoordinates').subscribe(function() { + that._showTileCoordinates(); + }); + + this._tileBoundingSphereSubscription = knockout.getObservable(this, 'tileBoundingSphere').subscribe(function() { + that._showTileBoundingSphere(); + }); + this._showTileBoundingSphere = createCommand(function() { if (that.tileBoundingSphere) { globe._surface.tileProvider._debug.boundingSphereTile = that._tile; @@ -176146,10 +176856,8 @@ define('Widgets/CesiumInspector/CesiumInspectorViewModel',[ this._doFilterTile = createCommand(function() { if (!that.filterTile) { that.suspendUpdates = false; - that.doSuspendUpdates(); } else { that.suspendUpdates = true; - that.doSuspendUpdates(); globe._surface._tilesToRender = []; @@ -176160,9 +176868,11 @@ define('Widgets/CesiumInspector/CesiumInspectorViewModel',[ return true; }); + this._filterTileSubscription = knockout.getObservable(this, 'filterTile').subscribe(function() { + that.doFilterTile(); + }); + function pickPrimitive(e) { - eventHandler.removeInputAction(ScreenSpaceEventType.LEFT_CLICK); - that.pickPrimitiveActive = false; var newPick = that._scene.pick({ x : e.position.x, y : e.position.y @@ -176170,10 +176880,16 @@ define('Widgets/CesiumInspector/CesiumInspectorViewModel',[ if (defined(newPick)) { that.primitive = defined(newPick.collection) ? newPick.collection : newPick.primitive; } + + that.pickPrimitiveActive = false; } + this._pickPrimitive = createCommand(function() { that.pickPrimitiveActive = !that.pickPrimitiveActive; - if (that.pickPrimitiveActive) { + }); + + this._pickPrimitiveActiveSubscription = knockout.getObservable(this, 'pickPrimitiveActive').subscribe(function(val) { + if (val) { eventHandler.setInputAction(pickPrimitive, ScreenSpaceEventType.LEFT_CLICK); } else { eventHandler.removeInputAction(ScreenSpaceEventType.LEFT_CLICK); @@ -176208,13 +176924,15 @@ define('Widgets/CesiumInspector/CesiumInspectorViewModel',[ that.tile = selectedTile; - eventHandler.removeInputAction(ScreenSpaceEventType.LEFT_CLICK); that.pickTileActive = false; } + this._pickTile = createCommand(function() { that.pickTileActive = !that.pickTileActive; + }); - if (that.pickTileActive) { + this._pickTileActiveSubscription = knockout.getObservable(this, 'pickTileActive').subscribe(function(val) { + if (val) { eventHandler.setInputAction(selectTile, ScreenSpaceEventType.LEFT_CLICK); } else { eventHandler.removeInputAction(ScreenSpaceEventType.LEFT_CLICK); @@ -176259,29 +176977,6 @@ define('Widgets/CesiumInspector/CesiumInspectorViewModel',[ } }, - /** - * Gets the command to toggle {@link Scene.debugShowFrustums} - * @memberof CesiumInspectorViewModel.prototype - * - * @type {Command} - */ - showFrustums : { - get : function() { - return this._showFrustums; - } - }, - - /** - * Gets the command to toggle the visibility of the performance display. - * @memberof CesiumInspectorViewModel.prototype - * - * @type {Command} - */ - showPerformance : { - get : function() { - return this._showPerformance; - } - }, /** * Gets the command to toggle the visibility of a BoundingSphere for a primitive @@ -176319,41 +177014,6 @@ define('Widgets/CesiumInspector/CesiumInspectorViewModel',[ } }, - /** - * Gets the command to toggle the view of the Globe as a wireframe - * @memberof CesiumInspectorViewModel.prototype - * - * @type {Command} - */ - showWireframe : { - get : function() { - return this._showWireframe; - } - }, - - /** - * Gets the command to toggle the view of the Globe depth buffer - * @memberof CesiumInspectorViewModel.prototype - * - * @type {Command} - */ - showGlobeDepth : { - get : function() { - return this._showGlobeDepth; - } - }, - - /** - * Gets the command to toggle the view of the pick depth buffer - * @memberof CesiumInspectorViewModel.prototype - * - * @type {Command} - */ - showPickDepth : { - get : function() { - return this._showPickDepth; - } - }, /** * Gets the command to increment the depth frustum index to be shown @@ -176379,17 +177039,6 @@ define('Widgets/CesiumInspector/CesiumInspectorViewModel',[ } }, - /** - * Gets the command to toggle whether to suspend tile updates - * @memberof CesiumInspectorViewModel.prototype - * - * @type {Command} - */ - doSuspendUpdates : { - get : function() { - return this._doSuspendUpdates; - } - }, /** * Gets the command to toggle the visibility of tile coordinates @@ -176640,11 +177289,9 @@ define('Widgets/CesiumInspector/CesiumInspectorViewModel',[ var numberOfFrustums = that._scene.numberOfFrustums; that._numberOfFrustums = numberOfFrustums; // Bound the frustum to be displayed. - var depthFrustum = boundDepthFrustum(1, numberOfFrustums, that.depthFrustum); - that.depthFrustum = depthFrustum; - that.scene.debugShowDepthFrustum = depthFrustum; + that.depthFrustum = boundDepthFrustum(1, numberOfFrustums, that.depthFrustum); // Update the displayed text. - that.depthFrustumText = depthFrustum + ' of ' + numberOfFrustums; + that.depthFrustumText = that.depthFrustum + ' of ' + numberOfFrustums; if (that.performance) { that._performanceDisplay.update(); @@ -176672,6 +177319,21 @@ define('Widgets/CesiumInspector/CesiumInspectorViewModel',[ */ CesiumInspectorViewModel.prototype.destroy = function() { this._eventHandler.destroy(); + this._frustumsSubscription.dispose(); + this._performanceSubscription.dispose(); + this._primitiveBoundingSphereSubscription.dispose(); + this._primitiveReferenceFrameSubscription.dispose(); + this._filterPrimitiveSubscription.dispose(); + this._wireframeSubscription.dispose(); + this._globeDepthSubscription.dispose(); + this._pickDepthSubscription.dispose(); + this._depthFrustumSubscription.dispose(); + this._suspendUpdatesSubscription.dispose(); + this._tileCoordinatesSubscription.dispose(); + this._tileBoundingSphereSubscription.dispose(); + this._filterTileSubscription.dispose(); + this._pickPrimitiveActiveSubscription.dispose(); + this._pickTileActiveSubscription.dispose(); return destroyObject(this); }; @@ -176762,10 +177424,10 @@ define('Widgets/CesiumInspector/CesiumInspector',[ generalSection.appendChild(debugShowFrustums); var frustumStats = document.createElement('div'); frustumStats.className = 'cesium-cesiumInspector-frustumStats'; - frustumStats.setAttribute('data-bind', 'css: {"cesium-cesiumInspector-show" : frustums, "cesium-cesiumInspector-hide" : !frustums}, html: frustumStatisticText'); + frustumStats.setAttribute('data-bind', 'css: {"cesium-cesiumInspector-show" : frustums, "cesium-cesiumInspector-hide" : !frustums}, html: frustumStatisticText'); var frustumsCheckbox = document.createElement('input'); frustumsCheckbox.type = 'checkbox'; - frustumsCheckbox.setAttribute('data-bind', 'checked: frustums, click: showFrustums'); + frustumsCheckbox.setAttribute('data-bind', 'checked: frustums'); debugShowFrustums.appendChild(frustumsCheckbox); debugShowFrustums.appendChild(document.createTextNode('Show Frustums')); debugShowFrustums.appendChild(frustumStats); @@ -176774,7 +177436,7 @@ define('Widgets/CesiumInspector/CesiumInspector',[ generalSection.appendChild(performanceDisplay); var pdCheckbox = document.createElement('input'); pdCheckbox.type = 'checkbox'; - pdCheckbox.setAttribute('data-bind', 'checked: performance, click: showPerformance'); + pdCheckbox.setAttribute('data-bind', 'checked: performance'); performanceDisplay.appendChild(pdCheckbox); performanceDisplay.appendChild(document.createTextNode('Performance Display')); @@ -176790,7 +177452,7 @@ define('Widgets/CesiumInspector/CesiumInspector',[ generalSection.appendChild(globeDepth); var gCheckbox = document.createElement('input'); gCheckbox.type = 'checkbox'; - gCheckbox.setAttribute('data-bind', 'checked: globeDepth, click: showGlobeDepth'); + gCheckbox.setAttribute('data-bind', 'checked: globeDepth'); globeDepth.appendChild(gCheckbox); globeDepth.appendChild(document.createTextNode('Show globe depth')); @@ -176801,7 +177463,7 @@ define('Widgets/CesiumInspector/CesiumInspector',[ generalSection.appendChild(pickDepth); var pCheckbox = document.createElement('input'); pCheckbox.type = 'checkbox'; - pCheckbox.setAttribute('data-bind', 'checked: pickDepth, click: showPickDepth'); + pCheckbox.setAttribute('data-bind', 'checked: pickDepth'); pickDepth.appendChild(pCheckbox); pickDepth.appendChild(document.createTextNode('Show pick depth')); @@ -176863,7 +177525,7 @@ define('Widgets/CesiumInspector/CesiumInspector',[ pickPrimRequired.appendChild(debugSphere); var bsCheckbox = document.createElement('input'); bsCheckbox.type = 'checkbox'; - bsCheckbox.setAttribute('data-bind', 'checked: primitiveBoundingSphere, click: showPrimitiveBoundingSphere, enable: hasPickedPrimitive'); + bsCheckbox.setAttribute('data-bind', 'checked: primitiveBoundingSphere, enable: hasPickedPrimitive'); debugSphere.appendChild(bsCheckbox); debugSphere.appendChild(document.createTextNode('Show bounding sphere')); @@ -176871,7 +177533,7 @@ define('Widgets/CesiumInspector/CesiumInspector',[ pickPrimRequired.appendChild(refFrame); var rfCheckbox = document.createElement('input'); rfCheckbox.type = 'checkbox'; - rfCheckbox.setAttribute('data-bind', 'checked: primitiveReferenceFrame, click: showPrimitiveReferenceFrame, enable: hasPickedPrimitive'); + rfCheckbox.setAttribute('data-bind', 'checked: primitiveReferenceFrame, enable: hasPickedPrimitive'); refFrame.appendChild(rfCheckbox); refFrame.appendChild(document.createTextNode('Show reference frame')); @@ -176880,7 +177542,7 @@ define('Widgets/CesiumInspector/CesiumInspector',[ pickPrimRequired.appendChild(primitiveOnly); var primitiveOnlyCheckbox = document.createElement('input'); primitiveOnlyCheckbox.type = 'checkbox'; - primitiveOnlyCheckbox.setAttribute('data-bind', 'checked: filterPrimitive, click: doFilterPrimitive, enable: hasPickedPrimitive'); + primitiveOnlyCheckbox.setAttribute('data-bind', 'checked: filterPrimitive, enable: hasPickedPrimitive'); primitiveOnly.appendChild(primitiveOnlyCheckbox); primitiveOnly.appendChild(document.createTextNode('Show only selected')); @@ -176896,7 +177558,7 @@ define('Widgets/CesiumInspector/CesiumInspector',[ var terrainSection = document.createElement('div'); terrainSection.className = 'cesium-cesiumInspector-section'; - terrainSection.setAttribute('data-bind', 'css: {"cesium-cesiumInspector-show" : terrainVisible, "cesium-cesiumInspector-hide" : !terrainVisible}'); + terrainSection.setAttribute('data-bind', 'css: {"cesium-cesiumInspector-show" : terrainVisible, "cesium-cesiumInspector-hide" : !terrainVisible}'); panel.appendChild(terrainSection); var pickTileRequired = document.createElement('div'); pickTileRequired.className = 'cesium-cesiumInspector-pickSection'; @@ -176942,7 +177604,7 @@ define('Widgets/CesiumInspector/CesiumInspector',[ tileText.className = 'cesium-cesiumInspector-tileText'; tileInfo.className = 'cesium-cesiumInspector-frustumStats'; tileInfo.appendChild(tileText); - tileInfo.setAttribute('data-bind', 'css: {"cesium-cesiumInspector-show" : hasPickedTile, "cesium-cesiumInspector-hide" : !hasPickedTile}'); + tileInfo.setAttribute('data-bind', 'css: {"cesium-cesiumInspector-show" : hasPickedTile, "cesium-cesiumInspector-hide" : !hasPickedTile}'); tileText.setAttribute('data-bind', 'html: tileText'); var relativeText = document.createElement('div'); @@ -176979,7 +177641,7 @@ define('Widgets/CesiumInspector/CesiumInspector',[ pickTileRequired.appendChild(tileBoundingSphere); var tbsCheck = document.createElement('input'); tbsCheck.type = 'checkbox'; - tbsCheck.setAttribute('data-bind', 'checked: tileBoundingSphere, enable: hasPickedTile, click: showTileBoundingSphere'); + tbsCheck.setAttribute('data-bind', 'checked: tileBoundingSphere, enable: hasPickedTile'); tileBoundingSphere.appendChild(tbsCheck); tileBoundingSphere.appendChild(document.createTextNode('Show bounding volume')); @@ -176987,7 +177649,7 @@ define('Widgets/CesiumInspector/CesiumInspector',[ pickTileRequired.appendChild(renderTile); var rCheck = document.createElement('input'); rCheck.type = 'checkbox'; - rCheck.setAttribute('data-bind', 'checked: filterTile, enable: hasPickedTile, click: doFilterTile'); + rCheck.setAttribute('data-bind', 'checked: filterTile, enable: hasPickedTile'); renderTile.appendChild(rCheck); renderTile.appendChild(document.createTextNode('Show only selected')); @@ -176995,7 +177657,7 @@ define('Widgets/CesiumInspector/CesiumInspector',[ terrainSection.appendChild(wireframe); var wCheckbox = document.createElement('input'); wCheckbox.type = 'checkbox'; - wCheckbox.setAttribute('data-bind', 'checked: wireframe, click: showWireframe'); + wCheckbox.setAttribute('data-bind', 'checked: wireframe'); wireframe.appendChild(wCheckbox); wireframe.appendChild(document.createTextNode('Wireframe')); @@ -177003,7 +177665,7 @@ define('Widgets/CesiumInspector/CesiumInspector',[ terrainSection.appendChild(suspendUpdates); var upCheckbox = document.createElement('input'); upCheckbox.type = 'checkbox'; - upCheckbox.setAttribute('data-bind', 'checked: suspendUpdates, click: doSuspendUpdates'); + upCheckbox.setAttribute('data-bind', 'checked: suspendUpdates'); suspendUpdates.appendChild(upCheckbox); suspendUpdates.appendChild(document.createTextNode('Suspend LOD update')); @@ -177011,7 +177673,7 @@ define('Widgets/CesiumInspector/CesiumInspector',[ terrainSection.appendChild(tileCoords); var coordCheck = document.createElement('input'); coordCheck.type = 'checkbox'; - coordCheck.setAttribute('data-bind', 'checked: tileCoordinates, click: showTileCoordinates'); + coordCheck.setAttribute('data-bind', 'checked: tileCoordinates'); tileCoords.appendChild(coordCheck); tileCoords.appendChild(document.createTextNode('Show tile coordinates')); @@ -178261,33 +178923,39 @@ cesiumSvgPath: { path: isFullscreen ? _exitFullScreenPath : _enterFullScreenPath /*global define*/ define('Widgets/Geocoder/GeocoderViewModel',[ - '../../Core/BingMapsApi', - '../../Core/Cartesian3', - '../../Core/defaultValue', - '../../Core/defined', - '../../Core/defineProperties', - '../../Core/DeveloperError', - '../../Core/Event', - '../../Core/loadJsonp', - '../../Core/Matrix4', - '../../Core/Rectangle', - '../../ThirdParty/knockout', - '../../ThirdParty/when', - '../createCommand' + '../../Core/BingMapsApi', + '../../Core/BingMapsGeocoderService', + '../../Core/Cartesian3', + '../../Core/defaultValue', + '../../Core/defined', + '../../Core/defineProperties', + '../../Core/deprecationWarning', + '../../Core/DeveloperError', + '../../Core/Event', + '../../Core/CartographicGeocoderService', + '../../Core/Matrix4', + '../../Core/Rectangle', + '../../ThirdParty/knockout', + '../../ThirdParty/when', + '../createCommand', + '../getElement' ], function( BingMapsApi, + BingMapsGeocoderService, Cartesian3, defaultValue, defined, defineProperties, + deprecationWarning, DeveloperError, Event, - loadJsonp, + CartographicGeocoderService, Matrix4, Rectangle, knockout, when, - createCommand) { + createCommand, + getElement) { 'use strict'; /** @@ -178297,6 +178965,9 @@ define('Widgets/Geocoder/GeocoderViewModel',[ * * @param {Object} options Object with the following properties: * @param {Scene} options.scene The Scene instance to use. + * @param {GeocoderService[]} [options.geocoderServices] Geocoder services to use for geocoding queries. + * If more than one are supplied, suggestions will be gathered for the geocoders that support it, + * and if no suggestion is selected the result from the first geocoder service wil be used. * @param {String} [options.url='https://dev.virtualearth.net'] The base URL of the Bing Maps API. * @param {String} [options.key] The Bing Maps key for your application, which can be * created at {@link https://www.bingmapsportal.com}. @@ -178312,33 +178983,124 @@ define('Widgets/Geocoder/GeocoderViewModel',[ throw new DeveloperError('options.scene is required.'); } + if (defined(options.geocoderServices)) { + this._geocoderServices = options.geocoderServices; + } else { + this._geocoderServices = [ + new CartographicGeocoderService(), + new BingMapsGeocoderService() + ]; + } + + var errorCredit; this._url = defaultValue(options.url, 'https://dev.virtualearth.net/'); if (this._url.length > 0 && this._url[this._url.length - 1] !== '/') { this._url += '/'; } this._key = BingMapsApi.getKey(options.key); - var errorCredit = BingMapsApi.getErrorCredit(options.key); + this._defaultGeocoderOptions = { + url: this._url, + key: this._key + }; + + if (defined(options.key)) { + errorCredit = BingMapsApi.getErrorCredit(options.key); + } if (defined(errorCredit)) { options.scene._frameState.creditDisplay.addDefaultCredit(errorCredit); } + this._viewContainer = options.container; this._scene = options.scene; this._flightDuration = options.flightDuration; this._searchText = ''; this._isSearchInProgress = false; - this._geocodeInProgress = undefined; + this._geocodePromise = undefined; this._complete = new Event(); + this._suggestions = []; + this._selectedSuggestion = undefined; + this._showSuggestions = true; + this._updateCamera = updateCamera; + this._adjustSuggestionsScroll = adjustSuggestionsScroll; + this._updateSearchSuggestions = updateSearchSuggestions; + this._handleArrowDown = handleArrowDown; + this._handleArrowUp = handleArrowUp; var that = this; + + this._suggestionsVisible = knockout.pureComputed(function () { + var suggestions = knockout.getObservable(that, '_suggestions'); + var suggestionsNotEmpty = suggestions().length > 0; + var showSuggestions = knockout.getObservable(that, '_showSuggestions')(); + return suggestionsNotEmpty && showSuggestions; + }); + this._searchCommand = createCommand(function() { + that.hideSuggestions(); + that._focusTextbox = false; + if (defined(that._selectedSuggestion)) { + that.activateSuggestion(that._selectedSuggestion); + return false; + } if (that.isSearchInProgress) { cancelGeocode(that); } else { - geocode(that); + geocode(that, that._geocoderServices); } }); + this.deselectSuggestion = function () { + that._selectedSuggestion = undefined; + }; + + this.handleKeyDown = function(data, event) { + var downKey = event.key === 'ArrowDown' || event.key === 'Down' || event.keyCode === 40; + var upKey = event.key === 'ArrowUp' || event.key === 'Up' || event.keyCode === 38; + if (downKey || upKey) { + event.preventDefault(); + } + + return true; + }; + + this.handleKeyUp = function (data, event) { + var downKey = event.key === 'ArrowDown' || event.key === 'Down' || event.keyCode === 40; + var upKey = event.key === 'ArrowUp' || event.key === 'Up' || event.keyCode === 38; + var enterKey = event.key === 'Enter' || event.keyCode === 13; + if (upKey) { + handleArrowUp(that); + } else if (downKey) { + handleArrowDown(that); + } else if (enterKey) { + that._searchCommand(); + } + return true; + }; + + this.activateSuggestion = function (data) { + that.hideSuggestions(); + that._searchText = data.displayName; + var destination = data.destination; + clearSuggestions(that); + updateCamera(that, destination); + }; + + this.hideSuggestions = function () { + that._showSuggestions = false; + that._selectedSuggestion = undefined; + }; + + this.showSuggestions = function () { + that._showSuggestions = true; + }; + + this.handleMouseover = function (data, event) { + if (data !== that._selectedSuggestion) { + that._selectedSuggestion = data; + } + }; + /** * Gets or sets a value indicating if this instance should always show its text input field. * @@ -178347,8 +179109,22 @@ define('Widgets/Geocoder/GeocoderViewModel',[ */ this.keepExpanded = false; - knockout.track(this, ['_searchText', '_isSearchInProgress', 'keepExpanded']); + /** + * True if the geocoder should query as the user types to autocomplete + * @type {Booelan} + * @default true + */ + this.autoComplete = defaultValue(options.autocomplete, true); + + this._focusTextbox = false; + knockout.track(this, ['_searchText', '_isSearchInProgress', 'keepExpanded', '_suggestions', '_selectedSuggestion', '_showSuggestions', '_focusTextbox']); + + var searchTextObservable = knockout.getObservable(this, '_searchText'); + searchTextObservable.extend({ rateLimit: { timeout: 500 } }); + this._suggestionSubscription = searchTextObservable.subscribe(function() { + updateSearchSuggestions(that); + }); /** * Gets a value indicating whether a search is currently in progress. This property is observable. * @@ -178373,14 +179149,14 @@ define('Widgets/Geocoder/GeocoderViewModel',[ if (this.isSearchInProgress) { return 'Searching...'; } + return this._searchText; }, set : function(value) { if (typeof value !== 'string') { throw new DeveloperError('value must be a valid string.'); } - - this._searchText = value; + this._searchText = value; } }); @@ -178410,24 +179186,28 @@ define('Widgets/Geocoder/GeocoderViewModel',[ defineProperties(GeocoderViewModel.prototype, { /** * Gets the Bing maps url. + * @deprecated * @memberof GeocoderViewModel.prototype * * @type {String} */ url : { get : function() { + deprecationWarning('url is deprecated', 'The url property was deprecated in Cesium 1.30 and will be removed in version 1.31.'); return this._url; } }, /** * Gets the Bing maps key. + * @deprecated * @memberof GeocoderViewModel.prototype * * @type {String} */ key : { get : function() { + deprecationWarning('key is deprecated', 'The key property was deprecated in Cesium 1.30 and will be removed in version 1.31.'); return this._key; } }, @@ -178466,9 +179246,68 @@ define('Widgets/Geocoder/GeocoderViewModel',[ get : function() { return this._searchCommand; } + }, + + /** + * Gets the currently selected geocoder search suggestion + * @memberof GeocoderViewModel.prototype + * + * @type {Object} + */ + selectedSuggestion : { + get : function() { + return this._selectedSuggestion; + } + }, + + /** + * Gets the list of geocoder search suggestions + * @memberof GeocoderViewModel.prototype + * + * @type {Object[]} + */ + suggestions : { + get : function() { + return this._suggestions; + } } }); + /** + * Destroys the widget. Should be called if permanently + * removing the widget from layout. + */ + GeocoderViewModel.prototype.destroy = function() { + this._suggestionSubscription.dispose(); + }; + + function handleArrowUp(viewModel) { + if (viewModel._suggestions.length === 0) { + return; + } + var next; + var currentIndex = viewModel._suggestions.indexOf(viewModel._selectedSuggestion); + if (currentIndex === -1 || currentIndex === 0) { + viewModel._selectedSuggestion = undefined; + return; + } + next = currentIndex - 1; + viewModel._selectedSuggestion = viewModel._suggestions[next]; + adjustSuggestionsScroll(viewModel, next); + } + + function handleArrowDown(viewModel) { + if (viewModel._suggestions.length === 0) { + return; + } + var numberOfSuggestions = viewModel._suggestions.length; + var currentIndex = viewModel._suggestions.indexOf(viewModel._selectedSuggestion); + var next = (currentIndex + 1) % numberOfSuggestions; + viewModel._selectedSuggestion = viewModel._suggestions[next]; + + adjustSuggestionsScroll(viewModel, next); + } + function updateCamera(viewModel, destination) { viewModel._scene.camera.flyTo({ destination : destination, @@ -178480,81 +179319,124 @@ define('Widgets/Geocoder/GeocoderViewModel',[ }); } - function geocode(viewModel) { - var query = viewModel.searchText; + function chainPromise(promise, geocoderService, query) { + return promise + .then(function(result) { + if (defined(result) && result.state === 'fulfilled' && result.value.length > 0){ + return result; + } + var nextPromise = geocoderService.geocode(query) + .then(function (result) { + return {state: 'fulfilled', value: result}; + }) + .otherwise(function (err) { + return {state: 'rejected', reason: err}; + }); - if (/^\s*$/.test(query)) { - //whitespace string - return; - } + return nextPromise; + }); + } - // If the user entered (longitude, latitude, [height]) in degrees/meters, - // fly without calling the geocoder. - var splitQuery = query.match(/[^\s,\n]+/g); - if ((splitQuery.length === 2) || (splitQuery.length === 3)) { - var longitude = +splitQuery[0]; - var latitude = +splitQuery[1]; - var height = (splitQuery.length === 3) ? +splitQuery[2] : 300.0; + function geocode(viewModel, geocoderServices) { + var query = viewModel._searchText; - if (!isNaN(longitude) && !isNaN(latitude) && !isNaN(height)) { - updateCamera(viewModel, Cartesian3.fromDegrees(longitude, latitude, height)); - return; - } + if (hasOnlyWhitespace(query)) { + viewModel.showSuggestions(); + return; } + viewModel._isSearchInProgress = true; - var promise = loadJsonp(viewModel._url + 'REST/v1/Locations', { - parameters : { - query : query, - key : viewModel._key + var promise = when.resolve(); + for (var i = 0; i < geocoderServices.length; i++) { + promise = chainPromise(promise, geocoderServices[i], query); + } - }, - callbackParameterName : 'jsonp' - }); + viewModel._geocodePromise = promise; + promise + .then(function (result) { + if (promise.cancel) { + return; + } + viewModel._isSearchInProgress = false; - var geocodeInProgress = viewModel._geocodeInProgress = when(promise, function(result) { - if (geocodeInProgress.cancel) { - return; - } - viewModel._isSearchInProgress = false; + var geocoderResults = result.value; + if (result.state === 'fulfilled' && defined(geocoderResults) && geocoderResults.length > 0) { + viewModel._searchText = geocoderResults[0].displayName; + updateCamera(viewModel, geocoderResults[0].destination); + return; + } + viewModel._searchText = query + ' (not found)'; + }); + } - if (result.resourceSets.length === 0) { - viewModel.searchText = viewModel._searchText + ' (not found)'; - return; - } + function adjustSuggestionsScroll(viewModel, focusedItemIndex) { + var container = getElement(viewModel._viewContainer); + var searchResults = container.getElementsByClassName('search-results')[0]; + var listItems = container.getElementsByTagName('li'); + var element = listItems[focusedItemIndex]; - var resourceSet = result.resourceSets[0]; - if (resourceSet.resources.length === 0) { - viewModel.searchText = viewModel._searchText + ' (not found)'; - return; - } + if (focusedItemIndex === 0) { + searchResults.scrollTop = 0; + return; + } - var resource = resourceSet.resources[0]; + var offsetTop = element.offsetTop; + if (offsetTop + element.clientHeight > searchResults.clientHeight) { + searchResults.scrollTop = offsetTop + element.clientHeight; + } else if (offsetTop < searchResults.scrollTop) { + searchResults.scrollTop = offsetTop; + } + } - viewModel._searchText = resource.name; - var bbox = resource.bbox; - var south = bbox[0]; - var west = bbox[1]; - var north = bbox[2]; - var east = bbox[3]; + function cancelGeocode(viewModel) { + viewModel._isSearchInProgress = false; + if (defined(viewModel._geocodePromise)) { + viewModel._geocodePromise.cancel = true; + viewModel._geocodePromise = undefined; + } + } - updateCamera(viewModel, Rectangle.fromDegrees(west, south, east, north)); - }, function() { - if (geocodeInProgress.cancel) { - return; - } + function hasOnlyWhitespace(string) { + return /^\s*$/.test(string); + } - viewModel._isSearchInProgress = false; - viewModel.searchText = viewModel._searchText + ' (error)'; - }); + function clearSuggestions(viewModel) { + knockout.getObservable(viewModel, '_suggestions').removeAll(); } - function cancelGeocode(viewModel) { - viewModel._isSearchInProgress = false; - if (defined(viewModel._geocodeInProgress)) { - viewModel._geocodeInProgress.cancel = true; - viewModel._geocodeInProgress = undefined; + function updateSearchSuggestions(viewModel) { + if (!viewModel.autoComplete) { + return; } + + var query = viewModel._searchText; + + clearSuggestions(viewModel); + if (hasOnlyWhitespace(query)) { + return; + } + + var promise = when.resolve([]); + viewModel._geocoderServices.forEach(function (service) { + promise = promise.then(function(results) { + if (results.length >= 5) { + return results; + } + return service.geocode(query) + .then(function(newResults) { + results = results.concat(newResults); + return results; + }); + }); + }); + promise + .then(function (results) { + var suggestions = viewModel._suggestions; + for (var i = 0; i < results.length; i++) { + suggestions.push(results[i]); + } + }); } return GeocoderViewModel; @@ -178594,6 +179476,8 @@ define('Widgets/Geocoder/Geocoder',[ * @param {Object} options Object with the following properties: * @param {Element|String} options.container The DOM element or ID that will contain the widget. * @param {Scene} options.scene The Scene instance to use. + * @param {GeocoderService[]} [options.geocoderServices] The geocoder services to be used + * @param {Boolean} [options.autoComplete = true] True if the geocoder should query as the user types to autocomplete * @param {String} [options.url='https://dev.virtualearth.net'] The base URL of the Bing Maps API. * @param {String} [options.key] The Bing Maps key for your application, which can be * created at {@link https://www.bingmapsportal.com}. @@ -178626,10 +179510,11 @@ define('Widgets/Geocoder/Geocoder',[ textBox.className = 'cesium-geocoder-input'; textBox.setAttribute('placeholder', 'Enter an address or landmark...'); textBox.setAttribute('data-bind', '\ -value: searchText,\ -valueUpdate: "afterkeydown",\ +textInput: searchText,\ disable: isSearchInProgress,\ -css: { "cesium-geocoder-input-wide" : keepExpanded || searchText.length > 0 }'); +event: { keyup: handleKeyUp, keydown: handleKeyDown, mouseover: deselectSuggestion },\ +css: { "cesium-geocoder-input-wide" : keepExpanded || searchText.length > 0 },\ +hasFocus: _focusTextbox'); this._onTextBoxFocus = function() { // as of 2016-10-19, setTimeout is required to ensure that the @@ -178652,21 +179537,41 @@ cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, container.appendChild(form); + var searchSuggestionsContainer = document.createElement('div'); + searchSuggestionsContainer.className = 'search-results'; + searchSuggestionsContainer.setAttribute('data-bind', 'visible: _suggestionsVisible'); + + var suggestionsList = document.createElement('ul'); + suggestionsList.setAttribute('data-bind', 'foreach: _suggestions'); + var suggestions = document.createElement('li'); + suggestionsList.appendChild(suggestions); + suggestions.setAttribute('data-bind', 'text: $data.displayName, \ +click: $parent.activateSuggestion, \ +event: { mouseover: $parent.handleMouseover}, \ +css: { active: $data === $parent._selectedSuggestion }'); + + searchSuggestionsContainer.appendChild(suggestionsList); + container.appendChild(searchSuggestionsContainer); + knockout.applyBindings(viewModel, form); + knockout.applyBindings(viewModel, searchSuggestionsContainer); this._container = container; + this._searchSuggestionsContainer = searchSuggestionsContainer; this._viewModel = viewModel; this._form = form; this._onInputBegin = function(e) { if (!container.contains(e.target)) { - textBox.blur(); + viewModel._focusTextbox = false; + viewModel.hideSuggestions(); } }; this._onInputEnd = function(e) { if (container.contains(e.target)) { - textBox.focus(); + viewModel._focusTextbox = true; + viewModel.showSuggestions(); } }; @@ -178700,6 +179605,18 @@ cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, } }, + /** + * Gets the parent container. + * @memberof Geocoder.prototype + * + * @type {Element} + */ + searchSuggestionsContainer : { + get : function() { + return this._searchSuggestionsContainer; + } + }, + /** * Gets the view model. * @memberof Geocoder.prototype @@ -178734,9 +179651,11 @@ cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, document.removeEventListener('touchstart', this._onInputBegin, true); document.removeEventListener('touchend', this._onInputEnd, true); } - + this._viewModel.destroy(); knockout.cleanNode(this._form); + knockout.cleanNode(this._searchSuggestionsContainer); this._container.removeChild(this._form); + this._container.removeChild(this._searchSuggestionsContainer); this._textBox.removeEventListener('focus', this._onTextBoxFocus, false); return destroyObject(this); @@ -182304,6 +183223,7 @@ Either specify options.terrainProvider instead or set options.baseLayerPicker to toolbar.appendChild(geocoderContainer); geocoder = new Geocoder({ container : geocoderContainer, + geocoderServices: defined(options.geocoder) ? (isArray(options.geocoder) ? options.geocoder : [options.geocoder]) : undefined, scene : cesiumWidget.scene }); // Subscribe to search so that we can clear the trackedEntity when it is clicked. @@ -183097,6 +184017,11 @@ Either specify options.terrainProvider instead or set options.baseLayerPicker to baseLayerPickerDropDown.style.maxHeight = panelMaxHeight + 'px'; } + if (defined(this._geocoder)) { + var geocoderSuggestions = this._geocoder.searchSuggestionsContainer; + geocoderSuggestions.style.maxHeight = panelMaxHeight + 'px'; + } + if (defined(this._infoBox)) { this._infoBox.viewModel.maxHeight = panelMaxHeight; } @@ -184102,6 +185027,7 @@ define('Widgets/Viewer/viewerPerformanceWatchdogMixin',[ * @exports viewerPerformanceWatchdogMixin * * @param {Viewer} viewer The viewer instance. + * @param {Object} [options] An object with properties. * @param {String} [options.lowFrameRateMessage='This application appears to be performing poorly on your system. Please try using a different web browser or updating your video drivers.'] The * message to display when a low frame rate is detected. The message is interpeted as HTML, so make sure * it comes from a trusted source so that your application is not vulnerable to cross-site scripting attacks. @@ -184263,11 +185189,11 @@ define('Workers/createTaskProcessorWorker',[ }); /*global define*/ -define('Cesium',['./Core/appendForwardSlash', './Core/ArcGisImageServerTerrainProvider', './Core/arrayRemoveDuplicates', './Core/AssociativeArray', './Core/AttributeCompression', './Core/AxisAlignedBoundingBox', './Core/barycentricCoordinates', './Core/binarySearch', './Core/BingMapsApi', './Core/BoundingRectangle', './Core/BoundingSphere', './Core/BoxGeometry', './Core/BoxOutlineGeometry', './Core/buildModuleUrl', './Core/cancelAnimationFrame', './Core/Cartesian2', './Core/Cartesian3', './Core/Cartesian4', './Core/Cartographic', './Core/CatmullRomSpline', './Core/CesiumTerrainProvider', './Core/Check', './Core/CircleGeometry', './Core/CircleOutlineGeometry', './Core/Clock', './Core/ClockRange', './Core/ClockStep', './Core/clone', './Core/Color', './Core/ColorGeometryInstanceAttribute', './Core/combine', './Core/ComponentDatatype', './Core/CornerType', './Core/CorridorGeometry', './Core/CorridorGeometryLibrary', './Core/CorridorOutlineGeometry', './Core/createGuid', './Core/Credit', './Core/CubicRealPolynomial', './Core/CylinderGeometry', './Core/CylinderGeometryLibrary', './Core/CylinderOutlineGeometry', './Core/DefaultProxy', './Core/defaultValue', './Core/defined', './Core/defineProperties', './Core/deprecationWarning', './Core/destroyObject', './Core/DeveloperError', './Core/DistanceDisplayCondition', './Core/DistanceDisplayConditionGeometryInstanceAttribute', './Core/EarthOrientationParameters', './Core/EarthOrientationParametersSample', './Core/EasingFunction', './Core/EllipseGeometry', './Core/EllipseGeometryLibrary', './Core/EllipseOutlineGeometry', './Core/Ellipsoid', './Core/EllipsoidalOccluder', './Core/EllipsoidGeodesic', './Core/EllipsoidGeometry', './Core/EllipsoidOutlineGeometry', './Core/EllipsoidTangentPlane', './Core/EllipsoidTerrainProvider', './Core/EncodedCartesian3', './Core/Event', './Core/EventHelper', './Core/ExtrapolationType', './Core/FeatureDetection', './Core/formatError', './Core/freezeObject', './Core/Fullscreen', './Core/GeographicProjection', './Core/GeographicTilingScheme', './Core/Geometry', './Core/GeometryAttribute', './Core/GeometryAttributes', './Core/GeometryInstance', './Core/GeometryInstanceAttribute', './Core/GeometryPipeline', './Core/GeometryType', './Core/getAbsoluteUri', './Core/getBaseUri', './Core/getExtensionFromUri', './Core/getFilenameFromUri', './Core/getImagePixels', './Core/getMagic', './Core/getStringFromTypedArray', './Core/getTimestamp', './Core/GregorianDate', './Core/HeadingPitchRange', './Core/HeadingPitchRoll', './Core/HeightmapTerrainData', './Core/HeightmapTessellator', './Core/HermitePolynomialApproximation', './Core/HermiteSpline', './Core/Iau2000Orientation', './Core/Iau2006XysData', './Core/Iau2006XysSample', './Core/IauOrientationAxes', './Core/IauOrientationParameters', './Core/IndexDatatype', './Core/InterpolationAlgorithm', './Core/Intersect', './Core/Intersections2D', './Core/IntersectionTests', './Core/Interval', './Core/isArray', './Core/isCrossOriginUrl', './Core/isLeapYear', './Core/Iso8601', './Core/joinUrls', './Core/JulianDate', './Core/KeyboardEventModifier', './Core/LagrangePolynomialApproximation', './Core/LeapSecond', './Core/LinearApproximation', './Core/LinearSpline', './Core/loadArrayBuffer', './Core/loadBlob', './Core/loadImage', './Core/loadImageFromTypedArray', './Core/loadImageViaBlob', './Core/loadJson', './Core/loadJsonp', './Core/loadText', './Core/loadWithXhr', './Core/loadXML', './Core/MapboxApi', './Core/MapProjection', './Core/Math', './Core/Matrix2', './Core/Matrix3', './Core/Matrix4', './Core/mergeSort', './Core/NearFarScalar', './Core/objectToQuery', './Core/Occluder', './Core/oneTimeWarning', './Core/OrientedBoundingBox', './Core/Packable', './Core/PackableForInterpolation', './Core/parseResponseHeaders', './Core/PinBuilder', './Core/PixelFormat', './Core/Plane', './Core/PointGeometry', './Core/pointInsideTriangle', './Core/PolygonGeometry', './Core/PolygonGeometryLibrary', './Core/PolygonHierarchy', './Core/PolygonOutlineGeometry', './Core/PolygonPipeline', './Core/PolylineGeometry', './Core/PolylinePipeline', './Core/PolylineVolumeGeometry', './Core/PolylineVolumeGeometryLibrary', './Core/PolylineVolumeOutlineGeometry', './Core/PrimitiveType', './Core/QuadraticRealPolynomial', './Core/QuantizedMeshTerrainData', './Core/QuarticRealPolynomial', './Core/Quaternion', './Core/QuaternionSpline', './Core/queryToObject', './Core/Queue', './Core/Ray', './Core/Rectangle', './Core/RectangleGeometry', './Core/RectangleGeometryLibrary', './Core/RectangleOutlineGeometry', './Core/ReferenceFrame', './Core/requestAnimationFrame', './Core/RequestErrorEvent', './Core/RuntimeError', './Core/sampleTerrain', './Core/scaleToGeodeticSurface', './Core/ScreenSpaceEventHandler', './Core/ScreenSpaceEventType', './Core/ShowGeometryInstanceAttribute', './Core/Simon1994PlanetaryPositions', './Core/SimplePolylineGeometry', './Core/SphereGeometry', './Core/SphereOutlineGeometry', './Core/Spherical', './Core/Spline', './Core/subdivideArray', './Core/TaskProcessor', './Core/TerrainData', './Core/TerrainEncoding', './Core/TerrainMesh', './Core/TerrainProvider', './Core/TerrainQuantization', './Core/throttleRequestByServer', './Core/TileProviderError', './Core/TilingScheme', './Core/TimeConstants', './Core/TimeInterval', './Core/TimeIntervalCollection', './Core/TimeStandard', './Core/Tipsify', './Core/Transforms', './Core/TranslationRotationScale', './Core/TridiagonalSystemSolver', './Core/TrustedServers', './Core/VertexFormat', './Core/VideoSynchronizer', './Core/Visibility', './Core/VRTheWorldTerrainProvider', './Core/WallGeometry', './Core/WallGeometryLibrary', './Core/WallOutlineGeometry', './Core/WebGLConstants', './Core/WebMercatorProjection', './Core/WebMercatorTilingScheme', './Core/WindingOrder', './Core/wrapFunction', './Core/writeTextToCanvas', './DataSources/BillboardGraphics', './DataSources/BillboardVisualizer', './DataSources/BoundingSphereState', './DataSources/BoxGeometryUpdater', './DataSources/BoxGraphics', './DataSources/CallbackProperty', './DataSources/CheckerboardMaterialProperty', './DataSources/ColorMaterialProperty', './DataSources/CompositeEntityCollection', './DataSources/CompositeMaterialProperty', './DataSources/CompositePositionProperty', './DataSources/CompositeProperty', './DataSources/ConstantPositionProperty', './DataSources/ConstantProperty', './DataSources/CorridorGeometryUpdater', './DataSources/CorridorGraphics', './DataSources/createMaterialPropertyDescriptor', './DataSources/createPropertyDescriptor', './DataSources/createRawPropertyDescriptor', './DataSources/CustomDataSource', './DataSources/CylinderGeometryUpdater', './DataSources/CylinderGraphics', './DataSources/CzmlDataSource', './DataSources/DataSource', './DataSources/DataSourceClock', './DataSources/DataSourceCollection', './DataSources/DataSourceDisplay', './DataSources/dynamicGeometryGetBoundingSphere', './DataSources/DynamicGeometryUpdater', './DataSources/EllipseGeometryUpdater', './DataSources/EllipseGraphics', './DataSources/EllipsoidGeometryUpdater', './DataSources/EllipsoidGraphics', './DataSources/Entity', './DataSources/EntityCluster', './DataSources/EntityCollection', './DataSources/EntityView', './DataSources/GeoJsonDataSource', './DataSources/GeometryUpdater', './DataSources/GeometryVisualizer', './DataSources/GridMaterialProperty', './DataSources/ImageMaterialProperty', './DataSources/KmlDataSource', './DataSources/LabelGraphics', './DataSources/LabelVisualizer', './DataSources/MaterialProperty', './DataSources/ModelGraphics', './DataSources/ModelVisualizer', './DataSources/NodeTransformationProperty', './DataSources/PathGraphics', './DataSources/PathVisualizer', './DataSources/PointGraphics', './DataSources/PointVisualizer', './DataSources/PolygonGeometryUpdater', './DataSources/PolygonGraphics', './DataSources/PolylineArrowMaterialProperty', './DataSources/PolylineGeometryUpdater', './DataSources/PolylineGlowMaterialProperty', './DataSources/PolylineGraphics', './DataSources/PolylineOutlineMaterialProperty', './DataSources/PolylineVolumeGeometryUpdater', './DataSources/PolylineVolumeGraphics', './DataSources/PositionProperty', './DataSources/PositionPropertyArray', './DataSources/Property', './DataSources/PropertyArray', './DataSources/PropertyBag', './DataSources/RectangleGeometryUpdater', './DataSources/RectangleGraphics', './DataSources/ReferenceProperty', './DataSources/Rotation', './DataSources/SampledPositionProperty', './DataSources/SampledProperty', './DataSources/ScaledPositionProperty', './DataSources/StaticGeometryColorBatch', './DataSources/StaticGeometryPerMaterialBatch', './DataSources/StaticGroundGeometryColorBatch', './DataSources/StaticOutlineGeometryBatch', './DataSources/StripeMaterialProperty', './DataSources/StripeOrientation', './DataSources/TimeIntervalCollectionPositionProperty', './DataSources/TimeIntervalCollectionProperty', './DataSources/VelocityOrientationProperty', './DataSources/VelocityVectorProperty', './DataSources/Visualizer', './DataSources/WallGeometryUpdater', './DataSources/WallGraphics', './Renderer/AutomaticUniforms', './Renderer/Buffer', './Renderer/BufferUsage', './Renderer/ClearCommand', './Renderer/ComputeCommand', './Renderer/ComputeEngine', './Renderer/Context', './Renderer/ContextLimits', './Renderer/createUniform', './Renderer/createUniformArray', './Renderer/CubeMap', './Renderer/CubeMapFace', './Renderer/DrawCommand', './Renderer/Framebuffer', './Renderer/loadCubeMap', './Renderer/MipmapHint', './Renderer/Pass', './Renderer/PassState', './Renderer/PickFramebuffer', './Renderer/PixelDatatype', './Renderer/Renderbuffer', './Renderer/RenderbufferFormat', './Renderer/RenderState', './Renderer/Sampler', './Renderer/ShaderCache', './Renderer/ShaderProgram', './Renderer/ShaderSource', './Renderer/Texture', './Renderer/TextureMagnificationFilter', './Renderer/TextureMinificationFilter', './Renderer/TextureWrap', './Renderer/UniformState', './Renderer/VertexArray', './Renderer/VertexArrayFacade', './Scene/Appearance', './Scene/ArcGisMapServerImageryProvider', './Scene/BatchTable', './Scene/Billboard', './Scene/BillboardCollection', './Scene/BingMapsImageryProvider', './Scene/BingMapsStyle', './Scene/BlendEquation', './Scene/BlendFunction', './Scene/BlendingState', './Scene/Camera', './Scene/CameraEventAggregator', './Scene/CameraEventType', './Scene/CameraFlightPath', './Scene/ColorBlendMode', './Scene/createOpenStreetMapImageryProvider', './Scene/createTangentSpaceDebugPrimitive', './Scene/createTileMapServiceImageryProvider', './Scene/CreditDisplay', './Scene/CullFace', './Scene/CullingVolume', './Scene/DebugAppearance', './Scene/DebugCameraPrimitive', './Scene/DebugModelMatrixPrimitive', './Scene/DepthFunction', './Scene/DepthPlane', './Scene/DeviceOrientationCameraController', './Scene/DiscardMissingTileImagePolicy', './Scene/EllipsoidPrimitive', './Scene/EllipsoidSurfaceAppearance', './Scene/Fog', './Scene/FrameRateMonitor', './Scene/FrameState', './Scene/FrustumCommands', './Scene/FXAA', './Scene/getAttributeOrUniformBySemantic', './Scene/getBinaryAccessor', './Scene/GetFeatureInfoFormat', './Scene/Globe', './Scene/GlobeDepth', './Scene/GlobeSurfaceShaderSet', './Scene/GlobeSurfaceTile', './Scene/GlobeSurfaceTileProvider', './Scene/GoogleEarthImageryProvider', './Scene/GridImageryProvider', './Scene/GroundPrimitive', './Scene/HeightReference', './Scene/HorizontalOrigin', './Scene/Imagery', './Scene/ImageryLayer', './Scene/ImageryLayerCollection', './Scene/ImageryLayerFeatureInfo', './Scene/ImageryProvider', './Scene/ImageryState', './Scene/Label', './Scene/LabelCollection', './Scene/LabelStyle', './Scene/MapboxImageryProvider', './Scene/MapMode2D', './Scene/Material', './Scene/MaterialAppearance', './Scene/Model', './Scene/ModelAnimation', './Scene/ModelAnimationCache', './Scene/ModelAnimationCollection', './Scene/ModelAnimationLoop', './Scene/ModelAnimationState', './Scene/ModelMaterial', './Scene/modelMaterialsCommon', './Scene/ModelMesh', './Scene/ModelNode', './Scene/Moon', './Scene/NeverTileDiscardPolicy', './Scene/OIT', './Scene/OrthographicFrustum', './Scene/PerformanceDisplay', './Scene/PerInstanceColorAppearance', './Scene/PerspectiveFrustum', './Scene/PerspectiveOffCenterFrustum', './Scene/PickDepth', './Scene/PointAppearance', './Scene/PointPrimitive', './Scene/PointPrimitiveCollection', './Scene/Polyline', './Scene/PolylineCollection', './Scene/PolylineColorAppearance', './Scene/PolylineMaterialAppearance', './Scene/Primitive', './Scene/PrimitiveCollection', './Scene/PrimitivePipeline', './Scene/PrimitiveState', './Scene/QuadtreeOccluders', './Scene/QuadtreePrimitive', './Scene/QuadtreeTile', './Scene/QuadtreeTileLoadState', './Scene/QuadtreeTileProvider', './Scene/Scene', './Scene/SceneMode', './Scene/SceneTransforms', './Scene/SceneTransitioner', './Scene/ScreenSpaceCameraController', './Scene/ShadowMap', './Scene/ShadowMapShader', './Scene/ShadowMode', './Scene/SingleTileImageryProvider', './Scene/SkyAtmosphere', './Scene/SkyBox', './Scene/StencilFunction', './Scene/StencilOperation', './Scene/Sun', './Scene/SunPostProcess', './Scene/TerrainState', './Scene/TextureAtlas', './Scene/TileBoundingBox', './Scene/TileCoordinatesImageryProvider', './Scene/TileDiscardPolicy', './Scene/TileImagery', './Scene/TileReplacementQueue', './Scene/TileState', './Scene/TileTerrain', './Scene/TweenCollection', './Scene/UrlTemplateImageryProvider', './Scene/VerticalOrigin', './Scene/ViewportQuad', './Scene/WebMapServiceImageryProvider', './Scene/WebMapTileServiceImageryProvider', './Shaders/AdjustTranslucentFS', './Shaders/Appearances/AllMaterialAppearanceFS', './Shaders/Appearances/AllMaterialAppearanceVS', './Shaders/Appearances/BasicMaterialAppearanceFS', './Shaders/Appearances/BasicMaterialAppearanceVS', './Shaders/Appearances/EllipsoidSurfaceAppearanceFS', './Shaders/Appearances/EllipsoidSurfaceAppearanceVS', './Shaders/Appearances/PerInstanceColorAppearanceFS', './Shaders/Appearances/PerInstanceColorAppearanceVS', './Shaders/Appearances/PerInstanceFlatColorAppearanceFS', './Shaders/Appearances/PerInstanceFlatColorAppearanceVS', './Shaders/Appearances/PointAppearanceFS', './Shaders/Appearances/PointAppearanceVS', './Shaders/Appearances/PolylineColorAppearanceVS', './Shaders/Appearances/PolylineMaterialAppearanceVS', './Shaders/Appearances/TexturedMaterialAppearanceFS', './Shaders/Appearances/TexturedMaterialAppearanceVS', './Shaders/BillboardCollectionFS', './Shaders/BillboardCollectionVS', './Shaders/Builtin/Constants/degreesPerRadian', './Shaders/Builtin/Constants/depthRange', './Shaders/Builtin/Constants/epsilon1', './Shaders/Builtin/Constants/epsilon2', './Shaders/Builtin/Constants/epsilon3', './Shaders/Builtin/Constants/epsilon4', './Shaders/Builtin/Constants/epsilon5', './Shaders/Builtin/Constants/epsilon6', './Shaders/Builtin/Constants/epsilon7', './Shaders/Builtin/Constants/infinity', './Shaders/Builtin/Constants/oneOverPi', './Shaders/Builtin/Constants/oneOverTwoPi', './Shaders/Builtin/Constants/passCompute', './Shaders/Builtin/Constants/passEnvironment', './Shaders/Builtin/Constants/passGlobe', './Shaders/Builtin/Constants/passGround', './Shaders/Builtin/Constants/passOpaque', './Shaders/Builtin/Constants/passOverlay', './Shaders/Builtin/Constants/passTranslucent', './Shaders/Builtin/Constants/pi', './Shaders/Builtin/Constants/piOverFour', './Shaders/Builtin/Constants/piOverSix', './Shaders/Builtin/Constants/piOverThree', './Shaders/Builtin/Constants/piOverTwo', './Shaders/Builtin/Constants/radiansPerDegree', './Shaders/Builtin/Constants/sceneMode2D', './Shaders/Builtin/Constants/sceneMode3D', './Shaders/Builtin/Constants/sceneModeColumbusView', './Shaders/Builtin/Constants/sceneModeMorphing', './Shaders/Builtin/Constants/solarRadius', './Shaders/Builtin/Constants/threePiOver2', './Shaders/Builtin/Constants/twoPi', './Shaders/Builtin/Constants/webMercatorMaxLatitude', './Shaders/Builtin/CzmBuiltins', './Shaders/Builtin/Functions/alphaWeight', './Shaders/Builtin/Functions/antialias', './Shaders/Builtin/Functions/cascadeColor', './Shaders/Builtin/Functions/cascadeDistance', './Shaders/Builtin/Functions/cascadeMatrix', './Shaders/Builtin/Functions/cascadeWeights', './Shaders/Builtin/Functions/columbusViewMorph', './Shaders/Builtin/Functions/computePosition', './Shaders/Builtin/Functions/cosineAndSine', './Shaders/Builtin/Functions/decompressTextureCoordinates', './Shaders/Builtin/Functions/eastNorthUpToEyeCoordinates', './Shaders/Builtin/Functions/ellipsoidContainsPoint', './Shaders/Builtin/Functions/ellipsoidNew', './Shaders/Builtin/Functions/ellipsoidWgs84TextureCoordinates', './Shaders/Builtin/Functions/equalsEpsilon', './Shaders/Builtin/Functions/eyeOffset', './Shaders/Builtin/Functions/eyeToWindowCoordinates', './Shaders/Builtin/Functions/fog', './Shaders/Builtin/Functions/geodeticSurfaceNormal', './Shaders/Builtin/Functions/getDefaultMaterial', './Shaders/Builtin/Functions/getLambertDiffuse', './Shaders/Builtin/Functions/getSpecular', './Shaders/Builtin/Functions/getWaterNoise', './Shaders/Builtin/Functions/getWgs84EllipsoidEC', './Shaders/Builtin/Functions/hue', './Shaders/Builtin/Functions/isEmpty', './Shaders/Builtin/Functions/isFull', './Shaders/Builtin/Functions/latitudeToWebMercatorFraction', './Shaders/Builtin/Functions/luminance', './Shaders/Builtin/Functions/metersPerPixel', './Shaders/Builtin/Functions/modelToWindowCoordinates', './Shaders/Builtin/Functions/multiplyWithColorBalance', './Shaders/Builtin/Functions/nearFarScalar', './Shaders/Builtin/Functions/octDecode', './Shaders/Builtin/Functions/packDepth', './Shaders/Builtin/Functions/phong', './Shaders/Builtin/Functions/pointAlongRay', './Shaders/Builtin/Functions/rayEllipsoidIntersectionInterval', './Shaders/Builtin/Functions/RGBToXYZ', './Shaders/Builtin/Functions/saturation', './Shaders/Builtin/Functions/shadowDepthCompare', './Shaders/Builtin/Functions/shadowVisibility', './Shaders/Builtin/Functions/signNotZero', './Shaders/Builtin/Functions/tangentToEyeSpaceMatrix', './Shaders/Builtin/Functions/translateRelativeToEye', './Shaders/Builtin/Functions/translucentPhong', './Shaders/Builtin/Functions/transpose', './Shaders/Builtin/Functions/unpackDepth', './Shaders/Builtin/Functions/windowToEyeCoordinates', './Shaders/Builtin/Functions/XYZToRGB', './Shaders/Builtin/Structs/depthRangeStruct', './Shaders/Builtin/Structs/ellipsoid', './Shaders/Builtin/Structs/material', './Shaders/Builtin/Structs/materialInput', './Shaders/Builtin/Structs/ray', './Shaders/Builtin/Structs/raySegment', './Shaders/Builtin/Structs/shadowParameters', './Shaders/CompositeOITFS', './Shaders/DepthPlaneFS', './Shaders/DepthPlaneVS', './Shaders/EllipsoidFS', './Shaders/EllipsoidVS', './Shaders/GlobeFS', './Shaders/GlobeVS', './Shaders/GroundAtmosphere', './Shaders/Materials/BumpMapMaterial', './Shaders/Materials/CheckerboardMaterial', './Shaders/Materials/DotMaterial', './Shaders/Materials/FadeMaterial', './Shaders/Materials/GridMaterial', './Shaders/Materials/NormalMapMaterial', './Shaders/Materials/PolylineArrowMaterial', './Shaders/Materials/PolylineGlowMaterial', './Shaders/Materials/PolylineOutlineMaterial', './Shaders/Materials/RimLightingMaterial', './Shaders/Materials/StripeMaterial', './Shaders/Materials/Water', './Shaders/PointPrimitiveCollectionFS', './Shaders/PointPrimitiveCollectionVS', './Shaders/PolylineCommon', './Shaders/PolylineFS', './Shaders/PolylineVS', './Shaders/PostProcessFilters/AdditiveBlend', './Shaders/PostProcessFilters/BrightPass', './Shaders/PostProcessFilters/FXAA', './Shaders/PostProcessFilters/GaussianBlur1D', './Shaders/PostProcessFilters/PassThrough', './Shaders/ReprojectWebMercatorFS', './Shaders/ReprojectWebMercatorVS', './Shaders/ShadowVolumeFS', './Shaders/ShadowVolumeVS', './Shaders/SkyAtmosphereFS', './Shaders/SkyAtmosphereVS', './Shaders/SkyBoxFS', './Shaders/SkyBoxVS', './Shaders/SunFS', './Shaders/SunTextureFS', './Shaders/SunVS', './Shaders/ViewportQuadFS', './Shaders/ViewportQuadVS', './ThirdParty/Autolinker', './ThirdParty/earcut-2.1.1', './ThirdParty/gltfDefaults', './ThirdParty/kdbush', './ThirdParty/knockout-3.4.0', './ThirdParty/knockout-es5', './ThirdParty/knockout', './ThirdParty/measureText', './ThirdParty/mersenne-twister', './ThirdParty/NoSleep', './ThirdParty/sprintf', './ThirdParty/topojson', './ThirdParty/Tween', './ThirdParty/Uri', './ThirdParty/when', './ThirdParty/zip', './Widgets/Animation/Animation', './Widgets/Animation/AnimationViewModel', './Widgets/BaseLayerPicker/BaseLayerPicker', './Widgets/BaseLayerPicker/BaseLayerPickerViewModel', './Widgets/BaseLayerPicker/createDefaultImageryProviderViewModels', './Widgets/BaseLayerPicker/createDefaultTerrainProviderViewModels', './Widgets/BaseLayerPicker/ProviderViewModel', './Widgets/CesiumInspector/CesiumInspector', './Widgets/CesiumInspector/CesiumInspectorViewModel', './Widgets/CesiumWidget/CesiumWidget', './Widgets/ClockViewModel', './Widgets/Command', './Widgets/createCommand', './Widgets/FullscreenButton/FullscreenButton', './Widgets/FullscreenButton/FullscreenButtonViewModel', './Widgets/Geocoder/Geocoder', './Widgets/Geocoder/GeocoderViewModel', './Widgets/getElement', './Widgets/HomeButton/HomeButton', './Widgets/HomeButton/HomeButtonViewModel', './Widgets/InfoBox/InfoBox', './Widgets/InfoBox/InfoBoxViewModel', './Widgets/NavigationHelpButton/NavigationHelpButton', './Widgets/NavigationHelpButton/NavigationHelpButtonViewModel', './Widgets/PerformanceWatchdog/PerformanceWatchdog', './Widgets/PerformanceWatchdog/PerformanceWatchdogViewModel', './Widgets/SceneModePicker/SceneModePicker', './Widgets/SceneModePicker/SceneModePickerViewModel', './Widgets/SelectionIndicator/SelectionIndicator', './Widgets/SelectionIndicator/SelectionIndicatorViewModel', './Widgets/subscribeAndEvaluate', './Widgets/SvgPathBindingHandler', './Widgets/Timeline/Timeline', './Widgets/Timeline/TimelineHighlightRange', './Widgets/Timeline/TimelineTrack', './Widgets/ToggleButtonViewModel', './Widgets/Viewer/Viewer', './Widgets/Viewer/viewerCesiumInspectorMixin', './Widgets/Viewer/viewerDragDropMixin', './Widgets/Viewer/viewerPerformanceWatchdogMixin', './Widgets/VRButton/VRButton', './Widgets/VRButton/VRButtonViewModel', './Workers/createTaskProcessorWorker'], function(Core_appendForwardSlash, Core_ArcGisImageServerTerrainProvider, Core_arrayRemoveDuplicates, Core_AssociativeArray, Core_AttributeCompression, Core_AxisAlignedBoundingBox, Core_barycentricCoordinates, Core_binarySearch, Core_BingMapsApi, Core_BoundingRectangle, Core_BoundingSphere, Core_BoxGeometry, Core_BoxOutlineGeometry, Core_buildModuleUrl, Core_cancelAnimationFrame, Core_Cartesian2, Core_Cartesian3, Core_Cartesian4, Core_Cartographic, Core_CatmullRomSpline, Core_CesiumTerrainProvider, Core_Check, Core_CircleGeometry, Core_CircleOutlineGeometry, Core_Clock, Core_ClockRange, Core_ClockStep, Core_clone, Core_Color, Core_ColorGeometryInstanceAttribute, Core_combine, Core_ComponentDatatype, Core_CornerType, Core_CorridorGeometry, Core_CorridorGeometryLibrary, Core_CorridorOutlineGeometry, Core_createGuid, Core_Credit, Core_CubicRealPolynomial, Core_CylinderGeometry, Core_CylinderGeometryLibrary, Core_CylinderOutlineGeometry, Core_DefaultProxy, Core_defaultValue, Core_defined, Core_defineProperties, Core_deprecationWarning, Core_destroyObject, Core_DeveloperError, Core_DistanceDisplayCondition, Core_DistanceDisplayConditionGeometryInstanceAttribute, Core_EarthOrientationParameters, Core_EarthOrientationParametersSample, Core_EasingFunction, Core_EllipseGeometry, Core_EllipseGeometryLibrary, Core_EllipseOutlineGeometry, Core_Ellipsoid, Core_EllipsoidalOccluder, Core_EllipsoidGeodesic, Core_EllipsoidGeometry, Core_EllipsoidOutlineGeometry, Core_EllipsoidTangentPlane, Core_EllipsoidTerrainProvider, Core_EncodedCartesian3, Core_Event, Core_EventHelper, Core_ExtrapolationType, Core_FeatureDetection, Core_formatError, Core_freezeObject, Core_Fullscreen, Core_GeographicProjection, Core_GeographicTilingScheme, Core_Geometry, Core_GeometryAttribute, Core_GeometryAttributes, Core_GeometryInstance, Core_GeometryInstanceAttribute, Core_GeometryPipeline, Core_GeometryType, Core_getAbsoluteUri, Core_getBaseUri, Core_getExtensionFromUri, Core_getFilenameFromUri, Core_getImagePixels, Core_getMagic, Core_getStringFromTypedArray, Core_getTimestamp, Core_GregorianDate, Core_HeadingPitchRange, Core_HeadingPitchRoll, Core_HeightmapTerrainData, Core_HeightmapTessellator, Core_HermitePolynomialApproximation, Core_HermiteSpline, Core_Iau2000Orientation, Core_Iau2006XysData, Core_Iau2006XysSample, Core_IauOrientationAxes, Core_IauOrientationParameters, Core_IndexDatatype, Core_InterpolationAlgorithm, Core_Intersect, Core_Intersections2D, Core_IntersectionTests, Core_Interval, Core_isArray, Core_isCrossOriginUrl, Core_isLeapYear, Core_Iso8601, Core_joinUrls, Core_JulianDate, Core_KeyboardEventModifier, Core_LagrangePolynomialApproximation, Core_LeapSecond, Core_LinearApproximation, Core_LinearSpline, Core_loadArrayBuffer, Core_loadBlob, Core_loadImage, Core_loadImageFromTypedArray, Core_loadImageViaBlob, Core_loadJson, Core_loadJsonp, Core_loadText, Core_loadWithXhr, Core_loadXML, Core_MapboxApi, Core_MapProjection, Core_Math, Core_Matrix2, Core_Matrix3, Core_Matrix4, Core_mergeSort, Core_NearFarScalar, Core_objectToQuery, Core_Occluder, Core_oneTimeWarning, Core_OrientedBoundingBox, Core_Packable, Core_PackableForInterpolation, Core_parseResponseHeaders, Core_PinBuilder, Core_PixelFormat, Core_Plane, Core_PointGeometry, Core_pointInsideTriangle, Core_PolygonGeometry, Core_PolygonGeometryLibrary, Core_PolygonHierarchy, Core_PolygonOutlineGeometry, Core_PolygonPipeline, Core_PolylineGeometry, Core_PolylinePipeline, Core_PolylineVolumeGeometry, Core_PolylineVolumeGeometryLibrary, Core_PolylineVolumeOutlineGeometry, Core_PrimitiveType, Core_QuadraticRealPolynomial, Core_QuantizedMeshTerrainData, Core_QuarticRealPolynomial, Core_Quaternion, Core_QuaternionSpline, Core_queryToObject, Core_Queue, Core_Ray, Core_Rectangle, Core_RectangleGeometry, Core_RectangleGeometryLibrary, Core_RectangleOutlineGeometry, Core_ReferenceFrame, Core_requestAnimationFrame, Core_RequestErrorEvent, Core_RuntimeError, Core_sampleTerrain, Core_scaleToGeodeticSurface, Core_ScreenSpaceEventHandler, Core_ScreenSpaceEventType, Core_ShowGeometryInstanceAttribute, Core_Simon1994PlanetaryPositions, Core_SimplePolylineGeometry, Core_SphereGeometry, Core_SphereOutlineGeometry, Core_Spherical, Core_Spline, Core_subdivideArray, Core_TaskProcessor, Core_TerrainData, Core_TerrainEncoding, Core_TerrainMesh, Core_TerrainProvider, Core_TerrainQuantization, Core_throttleRequestByServer, Core_TileProviderError, Core_TilingScheme, Core_TimeConstants, Core_TimeInterval, Core_TimeIntervalCollection, Core_TimeStandard, Core_Tipsify, Core_Transforms, Core_TranslationRotationScale, Core_TridiagonalSystemSolver, Core_TrustedServers, Core_VertexFormat, Core_VideoSynchronizer, Core_Visibility, Core_VRTheWorldTerrainProvider, Core_WallGeometry, Core_WallGeometryLibrary, Core_WallOutlineGeometry, Core_WebGLConstants, Core_WebMercatorProjection, Core_WebMercatorTilingScheme, Core_WindingOrder, Core_wrapFunction, Core_writeTextToCanvas, DataSources_BillboardGraphics, DataSources_BillboardVisualizer, DataSources_BoundingSphereState, DataSources_BoxGeometryUpdater, DataSources_BoxGraphics, DataSources_CallbackProperty, DataSources_CheckerboardMaterialProperty, DataSources_ColorMaterialProperty, DataSources_CompositeEntityCollection, DataSources_CompositeMaterialProperty, DataSources_CompositePositionProperty, DataSources_CompositeProperty, DataSources_ConstantPositionProperty, DataSources_ConstantProperty, DataSources_CorridorGeometryUpdater, DataSources_CorridorGraphics, DataSources_createMaterialPropertyDescriptor, DataSources_createPropertyDescriptor, DataSources_createRawPropertyDescriptor, DataSources_CustomDataSource, DataSources_CylinderGeometryUpdater, DataSources_CylinderGraphics, DataSources_CzmlDataSource, DataSources_DataSource, DataSources_DataSourceClock, DataSources_DataSourceCollection, DataSources_DataSourceDisplay, DataSources_dynamicGeometryGetBoundingSphere, DataSources_DynamicGeometryUpdater, DataSources_EllipseGeometryUpdater, DataSources_EllipseGraphics, DataSources_EllipsoidGeometryUpdater, DataSources_EllipsoidGraphics, DataSources_Entity, DataSources_EntityCluster, DataSources_EntityCollection, DataSources_EntityView, DataSources_GeoJsonDataSource, DataSources_GeometryUpdater, DataSources_GeometryVisualizer, DataSources_GridMaterialProperty, DataSources_ImageMaterialProperty, DataSources_KmlDataSource, DataSources_LabelGraphics, DataSources_LabelVisualizer, DataSources_MaterialProperty, DataSources_ModelGraphics, DataSources_ModelVisualizer, DataSources_NodeTransformationProperty, DataSources_PathGraphics, DataSources_PathVisualizer, DataSources_PointGraphics, DataSources_PointVisualizer, DataSources_PolygonGeometryUpdater, DataSources_PolygonGraphics, DataSources_PolylineArrowMaterialProperty, DataSources_PolylineGeometryUpdater, DataSources_PolylineGlowMaterialProperty, DataSources_PolylineGraphics, DataSources_PolylineOutlineMaterialProperty, DataSources_PolylineVolumeGeometryUpdater, DataSources_PolylineVolumeGraphics, DataSources_PositionProperty, DataSources_PositionPropertyArray, DataSources_Property, DataSources_PropertyArray, DataSources_PropertyBag, DataSources_RectangleGeometryUpdater, DataSources_RectangleGraphics, DataSources_ReferenceProperty, DataSources_Rotation, DataSources_SampledPositionProperty, DataSources_SampledProperty, DataSources_ScaledPositionProperty, DataSources_StaticGeometryColorBatch, DataSources_StaticGeometryPerMaterialBatch, DataSources_StaticGroundGeometryColorBatch, DataSources_StaticOutlineGeometryBatch, DataSources_StripeMaterialProperty, DataSources_StripeOrientation, DataSources_TimeIntervalCollectionPositionProperty, DataSources_TimeIntervalCollectionProperty, DataSources_VelocityOrientationProperty, DataSources_VelocityVectorProperty, DataSources_Visualizer, DataSources_WallGeometryUpdater, DataSources_WallGraphics, Renderer_AutomaticUniforms, Renderer_Buffer, Renderer_BufferUsage, Renderer_ClearCommand, Renderer_ComputeCommand, Renderer_ComputeEngine, Renderer_Context, Renderer_ContextLimits, Renderer_createUniform, Renderer_createUniformArray, Renderer_CubeMap, Renderer_CubeMapFace, Renderer_DrawCommand, Renderer_Framebuffer, Renderer_loadCubeMap, Renderer_MipmapHint, Renderer_Pass, Renderer_PassState, Renderer_PickFramebuffer, Renderer_PixelDatatype, Renderer_Renderbuffer, Renderer_RenderbufferFormat, Renderer_RenderState, Renderer_Sampler, Renderer_ShaderCache, Renderer_ShaderProgram, Renderer_ShaderSource, Renderer_Texture, Renderer_TextureMagnificationFilter, Renderer_TextureMinificationFilter, Renderer_TextureWrap, Renderer_UniformState, Renderer_VertexArray, Renderer_VertexArrayFacade, Scene_Appearance, Scene_ArcGisMapServerImageryProvider, Scene_BatchTable, Scene_Billboard, Scene_BillboardCollection, Scene_BingMapsImageryProvider, Scene_BingMapsStyle, Scene_BlendEquation, Scene_BlendFunction, Scene_BlendingState, Scene_Camera, Scene_CameraEventAggregator, Scene_CameraEventType, Scene_CameraFlightPath, Scene_ColorBlendMode, Scene_createOpenStreetMapImageryProvider, Scene_createTangentSpaceDebugPrimitive, Scene_createTileMapServiceImageryProvider, Scene_CreditDisplay, Scene_CullFace, Scene_CullingVolume, Scene_DebugAppearance, Scene_DebugCameraPrimitive, Scene_DebugModelMatrixPrimitive, Scene_DepthFunction, Scene_DepthPlane, Scene_DeviceOrientationCameraController, Scene_DiscardMissingTileImagePolicy, Scene_EllipsoidPrimitive, Scene_EllipsoidSurfaceAppearance, Scene_Fog, Scene_FrameRateMonitor, Scene_FrameState, Scene_FrustumCommands, Scene_FXAA, Scene_getAttributeOrUniformBySemantic, Scene_getBinaryAccessor, Scene_GetFeatureInfoFormat, Scene_Globe, Scene_GlobeDepth, Scene_GlobeSurfaceShaderSet, Scene_GlobeSurfaceTile, Scene_GlobeSurfaceTileProvider, Scene_GoogleEarthImageryProvider, Scene_GridImageryProvider, Scene_GroundPrimitive, Scene_HeightReference, Scene_HorizontalOrigin, Scene_Imagery, Scene_ImageryLayer, Scene_ImageryLayerCollection, Scene_ImageryLayerFeatureInfo, Scene_ImageryProvider, Scene_ImageryState, Scene_Label, Scene_LabelCollection, Scene_LabelStyle, Scene_MapboxImageryProvider, Scene_MapMode2D, Scene_Material, Scene_MaterialAppearance, Scene_Model, Scene_ModelAnimation, Scene_ModelAnimationCache, Scene_ModelAnimationCollection, Scene_ModelAnimationLoop, Scene_ModelAnimationState, Scene_ModelMaterial, Scene_modelMaterialsCommon, Scene_ModelMesh, Scene_ModelNode, Scene_Moon, Scene_NeverTileDiscardPolicy, Scene_OIT, Scene_OrthographicFrustum, Scene_PerformanceDisplay, Scene_PerInstanceColorAppearance, Scene_PerspectiveFrustum, Scene_PerspectiveOffCenterFrustum, Scene_PickDepth, Scene_PointAppearance, Scene_PointPrimitive, Scene_PointPrimitiveCollection, Scene_Polyline, Scene_PolylineCollection, Scene_PolylineColorAppearance, Scene_PolylineMaterialAppearance, Scene_Primitive, Scene_PrimitiveCollection, Scene_PrimitivePipeline, Scene_PrimitiveState, Scene_QuadtreeOccluders, Scene_QuadtreePrimitive, Scene_QuadtreeTile, Scene_QuadtreeTileLoadState, Scene_QuadtreeTileProvider, Scene_Scene, Scene_SceneMode, Scene_SceneTransforms, Scene_SceneTransitioner, Scene_ScreenSpaceCameraController, Scene_ShadowMap, Scene_ShadowMapShader, Scene_ShadowMode, Scene_SingleTileImageryProvider, Scene_SkyAtmosphere, Scene_SkyBox, Scene_StencilFunction, Scene_StencilOperation, Scene_Sun, Scene_SunPostProcess, Scene_TerrainState, Scene_TextureAtlas, Scene_TileBoundingBox, Scene_TileCoordinatesImageryProvider, Scene_TileDiscardPolicy, Scene_TileImagery, Scene_TileReplacementQueue, Scene_TileState, Scene_TileTerrain, Scene_TweenCollection, Scene_UrlTemplateImageryProvider, Scene_VerticalOrigin, Scene_ViewportQuad, Scene_WebMapServiceImageryProvider, Scene_WebMapTileServiceImageryProvider, Shaders_AdjustTranslucentFS, Shaders_Appearances_AllMaterialAppearanceFS, Shaders_Appearances_AllMaterialAppearanceVS, Shaders_Appearances_BasicMaterialAppearanceFS, Shaders_Appearances_BasicMaterialAppearanceVS, Shaders_Appearances_EllipsoidSurfaceAppearanceFS, Shaders_Appearances_EllipsoidSurfaceAppearanceVS, Shaders_Appearances_PerInstanceColorAppearanceFS, Shaders_Appearances_PerInstanceColorAppearanceVS, Shaders_Appearances_PerInstanceFlatColorAppearanceFS, Shaders_Appearances_PerInstanceFlatColorAppearanceVS, Shaders_Appearances_PointAppearanceFS, Shaders_Appearances_PointAppearanceVS, Shaders_Appearances_PolylineColorAppearanceVS, Shaders_Appearances_PolylineMaterialAppearanceVS, Shaders_Appearances_TexturedMaterialAppearanceFS, Shaders_Appearances_TexturedMaterialAppearanceVS, Shaders_BillboardCollectionFS, Shaders_BillboardCollectionVS, Shaders_Builtin_Constants_degreesPerRadian, Shaders_Builtin_Constants_depthRange, Shaders_Builtin_Constants_epsilon1, Shaders_Builtin_Constants_epsilon2, Shaders_Builtin_Constants_epsilon3, Shaders_Builtin_Constants_epsilon4, Shaders_Builtin_Constants_epsilon5, Shaders_Builtin_Constants_epsilon6, Shaders_Builtin_Constants_epsilon7, Shaders_Builtin_Constants_infinity, Shaders_Builtin_Constants_oneOverPi, Shaders_Builtin_Constants_oneOverTwoPi, Shaders_Builtin_Constants_passCompute, Shaders_Builtin_Constants_passEnvironment, Shaders_Builtin_Constants_passGlobe, Shaders_Builtin_Constants_passGround, Shaders_Builtin_Constants_passOpaque, Shaders_Builtin_Constants_passOverlay, Shaders_Builtin_Constants_passTranslucent, Shaders_Builtin_Constants_pi, Shaders_Builtin_Constants_piOverFour, Shaders_Builtin_Constants_piOverSix, Shaders_Builtin_Constants_piOverThree, Shaders_Builtin_Constants_piOverTwo, Shaders_Builtin_Constants_radiansPerDegree, Shaders_Builtin_Constants_sceneMode2D, Shaders_Builtin_Constants_sceneMode3D, Shaders_Builtin_Constants_sceneModeColumbusView, Shaders_Builtin_Constants_sceneModeMorphing, Shaders_Builtin_Constants_solarRadius, Shaders_Builtin_Constants_threePiOver2, Shaders_Builtin_Constants_twoPi, Shaders_Builtin_Constants_webMercatorMaxLatitude, Shaders_Builtin_CzmBuiltins, Shaders_Builtin_Functions_alphaWeight, Shaders_Builtin_Functions_antialias, Shaders_Builtin_Functions_cascadeColor, Shaders_Builtin_Functions_cascadeDistance, Shaders_Builtin_Functions_cascadeMatrix, Shaders_Builtin_Functions_cascadeWeights, Shaders_Builtin_Functions_columbusViewMorph, Shaders_Builtin_Functions_computePosition, Shaders_Builtin_Functions_cosineAndSine, Shaders_Builtin_Functions_decompressTextureCoordinates, Shaders_Builtin_Functions_eastNorthUpToEyeCoordinates, Shaders_Builtin_Functions_ellipsoidContainsPoint, Shaders_Builtin_Functions_ellipsoidNew, Shaders_Builtin_Functions_ellipsoidWgs84TextureCoordinates, Shaders_Builtin_Functions_equalsEpsilon, Shaders_Builtin_Functions_eyeOffset, Shaders_Builtin_Functions_eyeToWindowCoordinates, Shaders_Builtin_Functions_fog, Shaders_Builtin_Functions_geodeticSurfaceNormal, Shaders_Builtin_Functions_getDefaultMaterial, Shaders_Builtin_Functions_getLambertDiffuse, Shaders_Builtin_Functions_getSpecular, Shaders_Builtin_Functions_getWaterNoise, Shaders_Builtin_Functions_getWgs84EllipsoidEC, Shaders_Builtin_Functions_hue, Shaders_Builtin_Functions_isEmpty, Shaders_Builtin_Functions_isFull, Shaders_Builtin_Functions_latitudeToWebMercatorFraction, Shaders_Builtin_Functions_luminance, Shaders_Builtin_Functions_metersPerPixel, Shaders_Builtin_Functions_modelToWindowCoordinates, Shaders_Builtin_Functions_multiplyWithColorBalance, Shaders_Builtin_Functions_nearFarScalar, Shaders_Builtin_Functions_octDecode, Shaders_Builtin_Functions_packDepth, Shaders_Builtin_Functions_phong, Shaders_Builtin_Functions_pointAlongRay, Shaders_Builtin_Functions_rayEllipsoidIntersectionInterval, Shaders_Builtin_Functions_RGBToXYZ, Shaders_Builtin_Functions_saturation, Shaders_Builtin_Functions_shadowDepthCompare, Shaders_Builtin_Functions_shadowVisibility, Shaders_Builtin_Functions_signNotZero, Shaders_Builtin_Functions_tangentToEyeSpaceMatrix, Shaders_Builtin_Functions_translateRelativeToEye, Shaders_Builtin_Functions_translucentPhong, Shaders_Builtin_Functions_transpose, Shaders_Builtin_Functions_unpackDepth, Shaders_Builtin_Functions_windowToEyeCoordinates, Shaders_Builtin_Functions_XYZToRGB, Shaders_Builtin_Structs_depthRangeStruct, Shaders_Builtin_Structs_ellipsoid, Shaders_Builtin_Structs_material, Shaders_Builtin_Structs_materialInput, Shaders_Builtin_Structs_ray, Shaders_Builtin_Structs_raySegment, Shaders_Builtin_Structs_shadowParameters, Shaders_CompositeOITFS, Shaders_DepthPlaneFS, Shaders_DepthPlaneVS, Shaders_EllipsoidFS, Shaders_EllipsoidVS, Shaders_GlobeFS, Shaders_GlobeVS, Shaders_GroundAtmosphere, Shaders_Materials_BumpMapMaterial, Shaders_Materials_CheckerboardMaterial, Shaders_Materials_DotMaterial, Shaders_Materials_FadeMaterial, Shaders_Materials_GridMaterial, Shaders_Materials_NormalMapMaterial, Shaders_Materials_PolylineArrowMaterial, Shaders_Materials_PolylineGlowMaterial, Shaders_Materials_PolylineOutlineMaterial, Shaders_Materials_RimLightingMaterial, Shaders_Materials_StripeMaterial, Shaders_Materials_Water, Shaders_PointPrimitiveCollectionFS, Shaders_PointPrimitiveCollectionVS, Shaders_PolylineCommon, Shaders_PolylineFS, Shaders_PolylineVS, Shaders_PostProcessFilters_AdditiveBlend, Shaders_PostProcessFilters_BrightPass, Shaders_PostProcessFilters_FXAA, Shaders_PostProcessFilters_GaussianBlur1D, Shaders_PostProcessFilters_PassThrough, Shaders_ReprojectWebMercatorFS, Shaders_ReprojectWebMercatorVS, Shaders_ShadowVolumeFS, Shaders_ShadowVolumeVS, Shaders_SkyAtmosphereFS, Shaders_SkyAtmosphereVS, Shaders_SkyBoxFS, Shaders_SkyBoxVS, Shaders_SunFS, Shaders_SunTextureFS, Shaders_SunVS, Shaders_ViewportQuadFS, Shaders_ViewportQuadVS, ThirdParty_Autolinker, ThirdParty_earcut_2_1_1, ThirdParty_gltfDefaults, ThirdParty_kdbush, ThirdParty_knockout_3_4_0, ThirdParty_knockout_es5, ThirdParty_knockout, ThirdParty_measureText, ThirdParty_mersenne_twister, ThirdParty_NoSleep, ThirdParty_sprintf, ThirdParty_topojson, ThirdParty_Tween, ThirdParty_Uri, ThirdParty_when, ThirdParty_zip, Widgets_Animation_Animation, Widgets_Animation_AnimationViewModel, Widgets_BaseLayerPicker_BaseLayerPicker, Widgets_BaseLayerPicker_BaseLayerPickerViewModel, Widgets_BaseLayerPicker_createDefaultImageryProviderViewModels, Widgets_BaseLayerPicker_createDefaultTerrainProviderViewModels, Widgets_BaseLayerPicker_ProviderViewModel, Widgets_CesiumInspector_CesiumInspector, Widgets_CesiumInspector_CesiumInspectorViewModel, Widgets_CesiumWidget_CesiumWidget, Widgets_ClockViewModel, Widgets_Command, Widgets_createCommand, Widgets_FullscreenButton_FullscreenButton, Widgets_FullscreenButton_FullscreenButtonViewModel, Widgets_Geocoder_Geocoder, Widgets_Geocoder_GeocoderViewModel, Widgets_getElement, Widgets_HomeButton_HomeButton, Widgets_HomeButton_HomeButtonViewModel, Widgets_InfoBox_InfoBox, Widgets_InfoBox_InfoBoxViewModel, Widgets_NavigationHelpButton_NavigationHelpButton, Widgets_NavigationHelpButton_NavigationHelpButtonViewModel, Widgets_PerformanceWatchdog_PerformanceWatchdog, Widgets_PerformanceWatchdog_PerformanceWatchdogViewModel, Widgets_SceneModePicker_SceneModePicker, Widgets_SceneModePicker_SceneModePickerViewModel, Widgets_SelectionIndicator_SelectionIndicator, Widgets_SelectionIndicator_SelectionIndicatorViewModel, Widgets_subscribeAndEvaluate, Widgets_SvgPathBindingHandler, Widgets_Timeline_Timeline, Widgets_Timeline_TimelineHighlightRange, Widgets_Timeline_TimelineTrack, Widgets_ToggleButtonViewModel, Widgets_Viewer_Viewer, Widgets_Viewer_viewerCesiumInspectorMixin, Widgets_Viewer_viewerDragDropMixin, Widgets_Viewer_viewerPerformanceWatchdogMixin, Widgets_VRButton_VRButton, Widgets_VRButton_VRButtonViewModel, Workers_createTaskProcessorWorker) { +define('Cesium',['./Core/appendForwardSlash', './Core/ArcGisImageServerTerrainProvider', './Core/arrayRemoveDuplicates', './Core/AssociativeArray', './Core/AttributeCompression', './Core/AxisAlignedBoundingBox', './Core/barycentricCoordinates', './Core/binarySearch', './Core/BingMapsApi', './Core/BingMapsGeocoderService', './Core/BoundingRectangle', './Core/BoundingSphere', './Core/BoxGeometry', './Core/BoxOutlineGeometry', './Core/buildModuleUrl', './Core/cancelAnimationFrame', './Core/Cartesian2', './Core/Cartesian3', './Core/Cartesian4', './Core/Cartographic', './Core/CartographicGeocoderService', './Core/CatmullRomSpline', './Core/CesiumTerrainProvider', './Core/Check', './Core/CircleGeometry', './Core/CircleOutlineGeometry', './Core/Clock', './Core/ClockRange', './Core/ClockStep', './Core/clone', './Core/Color', './Core/ColorGeometryInstanceAttribute', './Core/combine', './Core/ComponentDatatype', './Core/CornerType', './Core/CorridorGeometry', './Core/CorridorGeometryLibrary', './Core/CorridorOutlineGeometry', './Core/createGuid', './Core/Credit', './Core/CubicRealPolynomial', './Core/CylinderGeometry', './Core/CylinderGeometryLibrary', './Core/CylinderOutlineGeometry', './Core/DefaultProxy', './Core/defaultValue', './Core/defined', './Core/defineProperties', './Core/deprecationWarning', './Core/destroyObject', './Core/DeveloperError', './Core/DistanceDisplayCondition', './Core/DistanceDisplayConditionGeometryInstanceAttribute', './Core/EarthOrientationParameters', './Core/EarthOrientationParametersSample', './Core/EasingFunction', './Core/EllipseGeometry', './Core/EllipseGeometryLibrary', './Core/EllipseOutlineGeometry', './Core/Ellipsoid', './Core/EllipsoidalOccluder', './Core/EllipsoidGeodesic', './Core/EllipsoidGeometry', './Core/EllipsoidOutlineGeometry', './Core/EllipsoidTangentPlane', './Core/EllipsoidTerrainProvider', './Core/EncodedCartesian3', './Core/Event', './Core/EventHelper', './Core/ExtrapolationType', './Core/FeatureDetection', './Core/formatError', './Core/freezeObject', './Core/Fullscreen', './Core/GeocoderService', './Core/GeographicProjection', './Core/GeographicTilingScheme', './Core/Geometry', './Core/GeometryAttribute', './Core/GeometryAttributes', './Core/GeometryInstance', './Core/GeometryInstanceAttribute', './Core/GeometryPipeline', './Core/GeometryType', './Core/getAbsoluteUri', './Core/getBaseUri', './Core/getExtensionFromUri', './Core/getFilenameFromUri', './Core/getImagePixels', './Core/getMagic', './Core/getStringFromTypedArray', './Core/getTimestamp', './Core/GregorianDate', './Core/HeadingPitchRange', './Core/HeadingPitchRoll', './Core/HeightmapTerrainData', './Core/HeightmapTessellator', './Core/HermitePolynomialApproximation', './Core/HermiteSpline', './Core/Iau2000Orientation', './Core/Iau2006XysData', './Core/Iau2006XysSample', './Core/IauOrientationAxes', './Core/IauOrientationParameters', './Core/IndexDatatype', './Core/InterpolationAlgorithm', './Core/Intersect', './Core/Intersections2D', './Core/IntersectionTests', './Core/Interval', './Core/isArray', './Core/isCrossOriginUrl', './Core/isLeapYear', './Core/Iso8601', './Core/joinUrls', './Core/JulianDate', './Core/KeyboardEventModifier', './Core/LagrangePolynomialApproximation', './Core/LeapSecond', './Core/LinearApproximation', './Core/LinearSpline', './Core/loadArrayBuffer', './Core/loadBlob', './Core/loadImage', './Core/loadImageFromTypedArray', './Core/loadImageViaBlob', './Core/loadJson', './Core/loadJsonp', './Core/loadText', './Core/loadWithXhr', './Core/loadXML', './Core/MapboxApi', './Core/MapProjection', './Core/Math', './Core/Matrix2', './Core/Matrix3', './Core/Matrix4', './Core/mergeSort', './Core/NearFarScalar', './Core/objectToQuery', './Core/Occluder', './Core/oneTimeWarning', './Core/OrientedBoundingBox', './Core/Packable', './Core/PackableForInterpolation', './Core/parseResponseHeaders', './Core/PinBuilder', './Core/PixelFormat', './Core/Plane', './Core/PointGeometry', './Core/pointInsideTriangle', './Core/PolygonGeometry', './Core/PolygonGeometryLibrary', './Core/PolygonHierarchy', './Core/PolygonOutlineGeometry', './Core/PolygonPipeline', './Core/PolylineGeometry', './Core/PolylinePipeline', './Core/PolylineVolumeGeometry', './Core/PolylineVolumeGeometryLibrary', './Core/PolylineVolumeOutlineGeometry', './Core/PrimitiveType', './Core/QuadraticRealPolynomial', './Core/QuantizedMeshTerrainData', './Core/QuarticRealPolynomial', './Core/Quaternion', './Core/QuaternionSpline', './Core/queryToObject', './Core/Queue', './Core/Ray', './Core/Rectangle', './Core/RectangleGeometry', './Core/RectangleGeometryLibrary', './Core/RectangleOutlineGeometry', './Core/ReferenceFrame', './Core/requestAnimationFrame', './Core/RequestErrorEvent', './Core/RuntimeError', './Core/sampleTerrain', './Core/sampleTerrainMostDetailed', './Core/scaleToGeodeticSurface', './Core/ScreenSpaceEventHandler', './Core/ScreenSpaceEventType', './Core/ShowGeometryInstanceAttribute', './Core/Simon1994PlanetaryPositions', './Core/SimplePolylineGeometry', './Core/SphereGeometry', './Core/SphereOutlineGeometry', './Core/Spherical', './Core/Spline', './Core/subdivideArray', './Core/TaskProcessor', './Core/TerrainData', './Core/TerrainEncoding', './Core/TerrainMesh', './Core/TerrainProvider', './Core/TerrainQuantization', './Core/throttleRequestByServer', './Core/TileAvailability', './Core/TileProviderError', './Core/TilingScheme', './Core/TimeConstants', './Core/TimeInterval', './Core/TimeIntervalCollection', './Core/TimeStandard', './Core/Tipsify', './Core/Transforms', './Core/TranslationRotationScale', './Core/TridiagonalSystemSolver', './Core/TrustedServers', './Core/VertexFormat', './Core/VideoSynchronizer', './Core/Visibility', './Core/VRTheWorldTerrainProvider', './Core/WallGeometry', './Core/WallGeometryLibrary', './Core/WallOutlineGeometry', './Core/WebGLConstants', './Core/WebMercatorProjection', './Core/WebMercatorTilingScheme', './Core/WindingOrder', './Core/wrapFunction', './Core/writeTextToCanvas', './DataSources/BillboardGraphics', './DataSources/BillboardVisualizer', './DataSources/BoundingSphereState', './DataSources/BoxGeometryUpdater', './DataSources/BoxGraphics', './DataSources/CallbackProperty', './DataSources/CheckerboardMaterialProperty', './DataSources/ColorMaterialProperty', './DataSources/CompositeEntityCollection', './DataSources/CompositeMaterialProperty', './DataSources/CompositePositionProperty', './DataSources/CompositeProperty', './DataSources/ConstantPositionProperty', './DataSources/ConstantProperty', './DataSources/CorridorGeometryUpdater', './DataSources/CorridorGraphics', './DataSources/createMaterialPropertyDescriptor', './DataSources/createPropertyDescriptor', './DataSources/createRawPropertyDescriptor', './DataSources/CustomDataSource', './DataSources/CylinderGeometryUpdater', './DataSources/CylinderGraphics', './DataSources/CzmlDataSource', './DataSources/DataSource', './DataSources/DataSourceClock', './DataSources/DataSourceCollection', './DataSources/DataSourceDisplay', './DataSources/dynamicGeometryGetBoundingSphere', './DataSources/DynamicGeometryUpdater', './DataSources/EllipseGeometryUpdater', './DataSources/EllipseGraphics', './DataSources/EllipsoidGeometryUpdater', './DataSources/EllipsoidGraphics', './DataSources/Entity', './DataSources/EntityCluster', './DataSources/EntityCollection', './DataSources/EntityView', './DataSources/GeoJsonDataSource', './DataSources/GeometryUpdater', './DataSources/GeometryVisualizer', './DataSources/GridMaterialProperty', './DataSources/ImageMaterialProperty', './DataSources/KmlDataSource', './DataSources/LabelGraphics', './DataSources/LabelVisualizer', './DataSources/MaterialProperty', './DataSources/ModelGraphics', './DataSources/ModelVisualizer', './DataSources/NodeTransformationProperty', './DataSources/PathGraphics', './DataSources/PathVisualizer', './DataSources/PointGraphics', './DataSources/PointVisualizer', './DataSources/PolygonGeometryUpdater', './DataSources/PolygonGraphics', './DataSources/PolylineArrowMaterialProperty', './DataSources/PolylineGeometryUpdater', './DataSources/PolylineGlowMaterialProperty', './DataSources/PolylineGraphics', './DataSources/PolylineOutlineMaterialProperty', './DataSources/PolylineVolumeGeometryUpdater', './DataSources/PolylineVolumeGraphics', './DataSources/PositionProperty', './DataSources/PositionPropertyArray', './DataSources/Property', './DataSources/PropertyArray', './DataSources/PropertyBag', './DataSources/RectangleGeometryUpdater', './DataSources/RectangleGraphics', './DataSources/ReferenceProperty', './DataSources/Rotation', './DataSources/SampledPositionProperty', './DataSources/SampledProperty', './DataSources/ScaledPositionProperty', './DataSources/StaticGeometryColorBatch', './DataSources/StaticGeometryPerMaterialBatch', './DataSources/StaticGroundGeometryColorBatch', './DataSources/StaticOutlineGeometryBatch', './DataSources/StripeMaterialProperty', './DataSources/StripeOrientation', './DataSources/TimeIntervalCollectionPositionProperty', './DataSources/TimeIntervalCollectionProperty', './DataSources/VelocityOrientationProperty', './DataSources/VelocityVectorProperty', './DataSources/Visualizer', './DataSources/WallGeometryUpdater', './DataSources/WallGraphics', './Renderer/AutomaticUniforms', './Renderer/Buffer', './Renderer/BufferUsage', './Renderer/ClearCommand', './Renderer/ComputeCommand', './Renderer/ComputeEngine', './Renderer/Context', './Renderer/ContextLimits', './Renderer/createUniform', './Renderer/createUniformArray', './Renderer/CubeMap', './Renderer/CubeMapFace', './Renderer/DrawCommand', './Renderer/Framebuffer', './Renderer/loadCubeMap', './Renderer/MipmapHint', './Renderer/Pass', './Renderer/PassState', './Renderer/PickFramebuffer', './Renderer/PixelDatatype', './Renderer/Renderbuffer', './Renderer/RenderbufferFormat', './Renderer/RenderState', './Renderer/Sampler', './Renderer/ShaderCache', './Renderer/ShaderProgram', './Renderer/ShaderSource', './Renderer/Texture', './Renderer/TextureMagnificationFilter', './Renderer/TextureMinificationFilter', './Renderer/TextureWrap', './Renderer/UniformState', './Renderer/VertexArray', './Renderer/VertexArrayFacade', './Scene/Appearance', './Scene/ArcGisMapServerImageryProvider', './Scene/BatchTable', './Scene/Billboard', './Scene/BillboardCollection', './Scene/BingMapsImageryProvider', './Scene/BingMapsStyle', './Scene/BlendEquation', './Scene/BlendFunction', './Scene/BlendingState', './Scene/BlendOption', './Scene/Camera', './Scene/CameraEventAggregator', './Scene/CameraEventType', './Scene/CameraFlightPath', './Scene/ColorBlendMode', './Scene/createOpenStreetMapImageryProvider', './Scene/createTangentSpaceDebugPrimitive', './Scene/createTileMapServiceImageryProvider', './Scene/CreditDisplay', './Scene/CullFace', './Scene/CullingVolume', './Scene/DebugAppearance', './Scene/DebugCameraPrimitive', './Scene/DebugModelMatrixPrimitive', './Scene/DepthFunction', './Scene/DepthPlane', './Scene/DeviceOrientationCameraController', './Scene/DiscardMissingTileImagePolicy', './Scene/EllipsoidPrimitive', './Scene/EllipsoidSurfaceAppearance', './Scene/Fog', './Scene/FrameRateMonitor', './Scene/FrameState', './Scene/FrustumCommands', './Scene/FXAA', './Scene/getAttributeOrUniformBySemantic', './Scene/getBinaryAccessor', './Scene/GetFeatureInfoFormat', './Scene/Globe', './Scene/GlobeDepth', './Scene/GlobeSurfaceShaderSet', './Scene/GlobeSurfaceTile', './Scene/GlobeSurfaceTileProvider', './Scene/GoogleEarthImageryProvider', './Scene/GridImageryProvider', './Scene/GroundPrimitive', './Scene/HeightReference', './Scene/HorizontalOrigin', './Scene/Imagery', './Scene/ImageryLayer', './Scene/ImageryLayerCollection', './Scene/ImageryLayerFeatureInfo', './Scene/ImageryProvider', './Scene/ImagerySplitDirection', './Scene/ImageryState', './Scene/Label', './Scene/LabelCollection', './Scene/LabelStyle', './Scene/MapboxImageryProvider', './Scene/MapMode2D', './Scene/Material', './Scene/MaterialAppearance', './Scene/Model', './Scene/ModelAnimation', './Scene/ModelAnimationCache', './Scene/ModelAnimationCollection', './Scene/ModelAnimationLoop', './Scene/ModelAnimationState', './Scene/ModelMaterial', './Scene/modelMaterialsCommon', './Scene/ModelMesh', './Scene/ModelNode', './Scene/Moon', './Scene/NeverTileDiscardPolicy', './Scene/OIT', './Scene/OrthographicFrustum', './Scene/PerformanceDisplay', './Scene/PerInstanceColorAppearance', './Scene/PerspectiveFrustum', './Scene/PerspectiveOffCenterFrustum', './Scene/PickDepth', './Scene/PointAppearance', './Scene/PointPrimitive', './Scene/PointPrimitiveCollection', './Scene/Polyline', './Scene/PolylineCollection', './Scene/PolylineColorAppearance', './Scene/PolylineMaterialAppearance', './Scene/Primitive', './Scene/PrimitiveCollection', './Scene/PrimitivePipeline', './Scene/PrimitiveState', './Scene/QuadtreeOccluders', './Scene/QuadtreePrimitive', './Scene/QuadtreeTile', './Scene/QuadtreeTileLoadState', './Scene/QuadtreeTileProvider', './Scene/Scene', './Scene/SceneMode', './Scene/SceneTransforms', './Scene/SceneTransitioner', './Scene/ScreenSpaceCameraController', './Scene/ShadowMap', './Scene/ShadowMapShader', './Scene/ShadowMode', './Scene/SingleTileImageryProvider', './Scene/SkyAtmosphere', './Scene/SkyBox', './Scene/StencilFunction', './Scene/StencilOperation', './Scene/Sun', './Scene/SunPostProcess', './Scene/TerrainState', './Scene/TextureAtlas', './Scene/TileBoundingBox', './Scene/TileCoordinatesImageryProvider', './Scene/TileDiscardPolicy', './Scene/TileImagery', './Scene/TileReplacementQueue', './Scene/TileState', './Scene/TileTerrain', './Scene/TweenCollection', './Scene/UrlTemplateImageryProvider', './Scene/VerticalOrigin', './Scene/ViewportQuad', './Scene/WebMapServiceImageryProvider', './Scene/WebMapTileServiceImageryProvider', './Shaders/AdjustTranslucentFS', './Shaders/Appearances/AllMaterialAppearanceFS', './Shaders/Appearances/AllMaterialAppearanceVS', './Shaders/Appearances/BasicMaterialAppearanceFS', './Shaders/Appearances/BasicMaterialAppearanceVS', './Shaders/Appearances/EllipsoidSurfaceAppearanceFS', './Shaders/Appearances/EllipsoidSurfaceAppearanceVS', './Shaders/Appearances/PerInstanceColorAppearanceFS', './Shaders/Appearances/PerInstanceColorAppearanceVS', './Shaders/Appearances/PerInstanceFlatColorAppearanceFS', './Shaders/Appearances/PerInstanceFlatColorAppearanceVS', './Shaders/Appearances/PointAppearanceFS', './Shaders/Appearances/PointAppearanceVS', './Shaders/Appearances/PolylineColorAppearanceVS', './Shaders/Appearances/PolylineMaterialAppearanceVS', './Shaders/Appearances/TexturedMaterialAppearanceFS', './Shaders/Appearances/TexturedMaterialAppearanceVS', './Shaders/BillboardCollectionFS', './Shaders/BillboardCollectionVS', './Shaders/Builtin/Constants/degreesPerRadian', './Shaders/Builtin/Constants/depthRange', './Shaders/Builtin/Constants/epsilon1', './Shaders/Builtin/Constants/epsilon2', './Shaders/Builtin/Constants/epsilon3', './Shaders/Builtin/Constants/epsilon4', './Shaders/Builtin/Constants/epsilon5', './Shaders/Builtin/Constants/epsilon6', './Shaders/Builtin/Constants/epsilon7', './Shaders/Builtin/Constants/infinity', './Shaders/Builtin/Constants/oneOverPi', './Shaders/Builtin/Constants/oneOverTwoPi', './Shaders/Builtin/Constants/passCompute', './Shaders/Builtin/Constants/passEnvironment', './Shaders/Builtin/Constants/passGlobe', './Shaders/Builtin/Constants/passGround', './Shaders/Builtin/Constants/passOpaque', './Shaders/Builtin/Constants/passOverlay', './Shaders/Builtin/Constants/passTranslucent', './Shaders/Builtin/Constants/pi', './Shaders/Builtin/Constants/piOverFour', './Shaders/Builtin/Constants/piOverSix', './Shaders/Builtin/Constants/piOverThree', './Shaders/Builtin/Constants/piOverTwo', './Shaders/Builtin/Constants/radiansPerDegree', './Shaders/Builtin/Constants/sceneMode2D', './Shaders/Builtin/Constants/sceneMode3D', './Shaders/Builtin/Constants/sceneModeColumbusView', './Shaders/Builtin/Constants/sceneModeMorphing', './Shaders/Builtin/Constants/solarRadius', './Shaders/Builtin/Constants/threePiOver2', './Shaders/Builtin/Constants/twoPi', './Shaders/Builtin/Constants/webMercatorMaxLatitude', './Shaders/Builtin/CzmBuiltins', './Shaders/Builtin/Functions/alphaWeight', './Shaders/Builtin/Functions/antialias', './Shaders/Builtin/Functions/cascadeColor', './Shaders/Builtin/Functions/cascadeDistance', './Shaders/Builtin/Functions/cascadeMatrix', './Shaders/Builtin/Functions/cascadeWeights', './Shaders/Builtin/Functions/columbusViewMorph', './Shaders/Builtin/Functions/computePosition', './Shaders/Builtin/Functions/cosineAndSine', './Shaders/Builtin/Functions/decompressTextureCoordinates', './Shaders/Builtin/Functions/eastNorthUpToEyeCoordinates', './Shaders/Builtin/Functions/ellipsoidContainsPoint', './Shaders/Builtin/Functions/ellipsoidNew', './Shaders/Builtin/Functions/ellipsoidWgs84TextureCoordinates', './Shaders/Builtin/Functions/equalsEpsilon', './Shaders/Builtin/Functions/eyeOffset', './Shaders/Builtin/Functions/eyeToWindowCoordinates', './Shaders/Builtin/Functions/fog', './Shaders/Builtin/Functions/geodeticSurfaceNormal', './Shaders/Builtin/Functions/getDefaultMaterial', './Shaders/Builtin/Functions/getLambertDiffuse', './Shaders/Builtin/Functions/getSpecular', './Shaders/Builtin/Functions/getWaterNoise', './Shaders/Builtin/Functions/getWgs84EllipsoidEC', './Shaders/Builtin/Functions/hue', './Shaders/Builtin/Functions/isEmpty', './Shaders/Builtin/Functions/isFull', './Shaders/Builtin/Functions/latitudeToWebMercatorFraction', './Shaders/Builtin/Functions/luminance', './Shaders/Builtin/Functions/metersPerPixel', './Shaders/Builtin/Functions/modelToWindowCoordinates', './Shaders/Builtin/Functions/multiplyWithColorBalance', './Shaders/Builtin/Functions/nearFarScalar', './Shaders/Builtin/Functions/octDecode', './Shaders/Builtin/Functions/packDepth', './Shaders/Builtin/Functions/phong', './Shaders/Builtin/Functions/pointAlongRay', './Shaders/Builtin/Functions/rayEllipsoidIntersectionInterval', './Shaders/Builtin/Functions/RGBToXYZ', './Shaders/Builtin/Functions/saturation', './Shaders/Builtin/Functions/shadowDepthCompare', './Shaders/Builtin/Functions/shadowVisibility', './Shaders/Builtin/Functions/signNotZero', './Shaders/Builtin/Functions/tangentToEyeSpaceMatrix', './Shaders/Builtin/Functions/translateRelativeToEye', './Shaders/Builtin/Functions/translucentPhong', './Shaders/Builtin/Functions/transpose', './Shaders/Builtin/Functions/unpackDepth', './Shaders/Builtin/Functions/windowToEyeCoordinates', './Shaders/Builtin/Functions/XYZToRGB', './Shaders/Builtin/Structs/depthRangeStruct', './Shaders/Builtin/Structs/ellipsoid', './Shaders/Builtin/Structs/material', './Shaders/Builtin/Structs/materialInput', './Shaders/Builtin/Structs/ray', './Shaders/Builtin/Structs/raySegment', './Shaders/Builtin/Structs/shadowParameters', './Shaders/CompositeOITFS', './Shaders/DepthPlaneFS', './Shaders/DepthPlaneVS', './Shaders/EllipsoidFS', './Shaders/EllipsoidVS', './Shaders/GlobeFS', './Shaders/GlobeVS', './Shaders/GroundAtmosphere', './Shaders/Materials/BumpMapMaterial', './Shaders/Materials/CheckerboardMaterial', './Shaders/Materials/DotMaterial', './Shaders/Materials/FadeMaterial', './Shaders/Materials/GridMaterial', './Shaders/Materials/NormalMapMaterial', './Shaders/Materials/PolylineArrowMaterial', './Shaders/Materials/PolylineGlowMaterial', './Shaders/Materials/PolylineOutlineMaterial', './Shaders/Materials/RimLightingMaterial', './Shaders/Materials/StripeMaterial', './Shaders/Materials/Water', './Shaders/PointPrimitiveCollectionFS', './Shaders/PointPrimitiveCollectionVS', './Shaders/PolylineCommon', './Shaders/PolylineFS', './Shaders/PolylineVS', './Shaders/PostProcessFilters/AdditiveBlend', './Shaders/PostProcessFilters/BrightPass', './Shaders/PostProcessFilters/FXAA', './Shaders/PostProcessFilters/GaussianBlur1D', './Shaders/PostProcessFilters/PassThrough', './Shaders/ReprojectWebMercatorFS', './Shaders/ReprojectWebMercatorVS', './Shaders/ShadowVolumeFS', './Shaders/ShadowVolumeVS', './Shaders/SkyAtmosphereFS', './Shaders/SkyAtmosphereVS', './Shaders/SkyBoxFS', './Shaders/SkyBoxVS', './Shaders/SunFS', './Shaders/SunTextureFS', './Shaders/SunVS', './Shaders/ViewportQuadFS', './Shaders/ViewportQuadVS', './ThirdParty/Autolinker', './ThirdParty/earcut-2.1.1', './ThirdParty/gltfDefaults', './ThirdParty/kdbush', './ThirdParty/knockout-3.4.0', './ThirdParty/knockout-es5', './ThirdParty/knockout', './ThirdParty/measureText', './ThirdParty/mersenne-twister', './ThirdParty/NoSleep', './ThirdParty/sprintf', './ThirdParty/topojson', './ThirdParty/Tween', './ThirdParty/Uri', './ThirdParty/when', './ThirdParty/zip', './Widgets/Animation/Animation', './Widgets/Animation/AnimationViewModel', './Widgets/BaseLayerPicker/BaseLayerPicker', './Widgets/BaseLayerPicker/BaseLayerPickerViewModel', './Widgets/BaseLayerPicker/createDefaultImageryProviderViewModels', './Widgets/BaseLayerPicker/createDefaultTerrainProviderViewModels', './Widgets/BaseLayerPicker/ProviderViewModel', './Widgets/CesiumInspector/CesiumInspector', './Widgets/CesiumInspector/CesiumInspectorViewModel', './Widgets/CesiumWidget/CesiumWidget', './Widgets/ClockViewModel', './Widgets/Command', './Widgets/createCommand', './Widgets/FullscreenButton/FullscreenButton', './Widgets/FullscreenButton/FullscreenButtonViewModel', './Widgets/Geocoder/Geocoder', './Widgets/Geocoder/GeocoderViewModel', './Widgets/getElement', './Widgets/HomeButton/HomeButton', './Widgets/HomeButton/HomeButtonViewModel', './Widgets/InfoBox/InfoBox', './Widgets/InfoBox/InfoBoxViewModel', './Widgets/NavigationHelpButton/NavigationHelpButton', './Widgets/NavigationHelpButton/NavigationHelpButtonViewModel', './Widgets/PerformanceWatchdog/PerformanceWatchdog', './Widgets/PerformanceWatchdog/PerformanceWatchdogViewModel', './Widgets/SceneModePicker/SceneModePicker', './Widgets/SceneModePicker/SceneModePickerViewModel', './Widgets/SelectionIndicator/SelectionIndicator', './Widgets/SelectionIndicator/SelectionIndicatorViewModel', './Widgets/subscribeAndEvaluate', './Widgets/SvgPathBindingHandler', './Widgets/Timeline/Timeline', './Widgets/Timeline/TimelineHighlightRange', './Widgets/Timeline/TimelineTrack', './Widgets/ToggleButtonViewModel', './Widgets/Viewer/Viewer', './Widgets/Viewer/viewerCesiumInspectorMixin', './Widgets/Viewer/viewerDragDropMixin', './Widgets/Viewer/viewerPerformanceWatchdogMixin', './Widgets/VRButton/VRButton', './Widgets/VRButton/VRButtonViewModel', './Workers/createTaskProcessorWorker'], function(Core_appendForwardSlash, Core_ArcGisImageServerTerrainProvider, Core_arrayRemoveDuplicates, Core_AssociativeArray, Core_AttributeCompression, Core_AxisAlignedBoundingBox, Core_barycentricCoordinates, Core_binarySearch, Core_BingMapsApi, Core_BingMapsGeocoderService, Core_BoundingRectangle, Core_BoundingSphere, Core_BoxGeometry, Core_BoxOutlineGeometry, Core_buildModuleUrl, Core_cancelAnimationFrame, Core_Cartesian2, Core_Cartesian3, Core_Cartesian4, Core_Cartographic, Core_CartographicGeocoderService, Core_CatmullRomSpline, Core_CesiumTerrainProvider, Core_Check, Core_CircleGeometry, Core_CircleOutlineGeometry, Core_Clock, Core_ClockRange, Core_ClockStep, Core_clone, Core_Color, Core_ColorGeometryInstanceAttribute, Core_combine, Core_ComponentDatatype, Core_CornerType, Core_CorridorGeometry, Core_CorridorGeometryLibrary, Core_CorridorOutlineGeometry, Core_createGuid, Core_Credit, Core_CubicRealPolynomial, Core_CylinderGeometry, Core_CylinderGeometryLibrary, Core_CylinderOutlineGeometry, Core_DefaultProxy, Core_defaultValue, Core_defined, Core_defineProperties, Core_deprecationWarning, Core_destroyObject, Core_DeveloperError, Core_DistanceDisplayCondition, Core_DistanceDisplayConditionGeometryInstanceAttribute, Core_EarthOrientationParameters, Core_EarthOrientationParametersSample, Core_EasingFunction, Core_EllipseGeometry, Core_EllipseGeometryLibrary, Core_EllipseOutlineGeometry, Core_Ellipsoid, Core_EllipsoidalOccluder, Core_EllipsoidGeodesic, Core_EllipsoidGeometry, Core_EllipsoidOutlineGeometry, Core_EllipsoidTangentPlane, Core_EllipsoidTerrainProvider, Core_EncodedCartesian3, Core_Event, Core_EventHelper, Core_ExtrapolationType, Core_FeatureDetection, Core_formatError, Core_freezeObject, Core_Fullscreen, Core_GeocoderService, Core_GeographicProjection, Core_GeographicTilingScheme, Core_Geometry, Core_GeometryAttribute, Core_GeometryAttributes, Core_GeometryInstance, Core_GeometryInstanceAttribute, Core_GeometryPipeline, Core_GeometryType, Core_getAbsoluteUri, Core_getBaseUri, Core_getExtensionFromUri, Core_getFilenameFromUri, Core_getImagePixels, Core_getMagic, Core_getStringFromTypedArray, Core_getTimestamp, Core_GregorianDate, Core_HeadingPitchRange, Core_HeadingPitchRoll, Core_HeightmapTerrainData, Core_HeightmapTessellator, Core_HermitePolynomialApproximation, Core_HermiteSpline, Core_Iau2000Orientation, Core_Iau2006XysData, Core_Iau2006XysSample, Core_IauOrientationAxes, Core_IauOrientationParameters, Core_IndexDatatype, Core_InterpolationAlgorithm, Core_Intersect, Core_Intersections2D, Core_IntersectionTests, Core_Interval, Core_isArray, Core_isCrossOriginUrl, Core_isLeapYear, Core_Iso8601, Core_joinUrls, Core_JulianDate, Core_KeyboardEventModifier, Core_LagrangePolynomialApproximation, Core_LeapSecond, Core_LinearApproximation, Core_LinearSpline, Core_loadArrayBuffer, Core_loadBlob, Core_loadImage, Core_loadImageFromTypedArray, Core_loadImageViaBlob, Core_loadJson, Core_loadJsonp, Core_loadText, Core_loadWithXhr, Core_loadXML, Core_MapboxApi, Core_MapProjection, Core_Math, Core_Matrix2, Core_Matrix3, Core_Matrix4, Core_mergeSort, Core_NearFarScalar, Core_objectToQuery, Core_Occluder, Core_oneTimeWarning, Core_OrientedBoundingBox, Core_Packable, Core_PackableForInterpolation, Core_parseResponseHeaders, Core_PinBuilder, Core_PixelFormat, Core_Plane, Core_PointGeometry, Core_pointInsideTriangle, Core_PolygonGeometry, Core_PolygonGeometryLibrary, Core_PolygonHierarchy, Core_PolygonOutlineGeometry, Core_PolygonPipeline, Core_PolylineGeometry, Core_PolylinePipeline, Core_PolylineVolumeGeometry, Core_PolylineVolumeGeometryLibrary, Core_PolylineVolumeOutlineGeometry, Core_PrimitiveType, Core_QuadraticRealPolynomial, Core_QuantizedMeshTerrainData, Core_QuarticRealPolynomial, Core_Quaternion, Core_QuaternionSpline, Core_queryToObject, Core_Queue, Core_Ray, Core_Rectangle, Core_RectangleGeometry, Core_RectangleGeometryLibrary, Core_RectangleOutlineGeometry, Core_ReferenceFrame, Core_requestAnimationFrame, Core_RequestErrorEvent, Core_RuntimeError, Core_sampleTerrain, Core_sampleTerrainMostDetailed, Core_scaleToGeodeticSurface, Core_ScreenSpaceEventHandler, Core_ScreenSpaceEventType, Core_ShowGeometryInstanceAttribute, Core_Simon1994PlanetaryPositions, Core_SimplePolylineGeometry, Core_SphereGeometry, Core_SphereOutlineGeometry, Core_Spherical, Core_Spline, Core_subdivideArray, Core_TaskProcessor, Core_TerrainData, Core_TerrainEncoding, Core_TerrainMesh, Core_TerrainProvider, Core_TerrainQuantization, Core_throttleRequestByServer, Core_TileAvailability, Core_TileProviderError, Core_TilingScheme, Core_TimeConstants, Core_TimeInterval, Core_TimeIntervalCollection, Core_TimeStandard, Core_Tipsify, Core_Transforms, Core_TranslationRotationScale, Core_TridiagonalSystemSolver, Core_TrustedServers, Core_VertexFormat, Core_VideoSynchronizer, Core_Visibility, Core_VRTheWorldTerrainProvider, Core_WallGeometry, Core_WallGeometryLibrary, Core_WallOutlineGeometry, Core_WebGLConstants, Core_WebMercatorProjection, Core_WebMercatorTilingScheme, Core_WindingOrder, Core_wrapFunction, Core_writeTextToCanvas, DataSources_BillboardGraphics, DataSources_BillboardVisualizer, DataSources_BoundingSphereState, DataSources_BoxGeometryUpdater, DataSources_BoxGraphics, DataSources_CallbackProperty, DataSources_CheckerboardMaterialProperty, DataSources_ColorMaterialProperty, DataSources_CompositeEntityCollection, DataSources_CompositeMaterialProperty, DataSources_CompositePositionProperty, DataSources_CompositeProperty, DataSources_ConstantPositionProperty, DataSources_ConstantProperty, DataSources_CorridorGeometryUpdater, DataSources_CorridorGraphics, DataSources_createMaterialPropertyDescriptor, DataSources_createPropertyDescriptor, DataSources_createRawPropertyDescriptor, DataSources_CustomDataSource, DataSources_CylinderGeometryUpdater, DataSources_CylinderGraphics, DataSources_CzmlDataSource, DataSources_DataSource, DataSources_DataSourceClock, DataSources_DataSourceCollection, DataSources_DataSourceDisplay, DataSources_dynamicGeometryGetBoundingSphere, DataSources_DynamicGeometryUpdater, DataSources_EllipseGeometryUpdater, DataSources_EllipseGraphics, DataSources_EllipsoidGeometryUpdater, DataSources_EllipsoidGraphics, DataSources_Entity, DataSources_EntityCluster, DataSources_EntityCollection, DataSources_EntityView, DataSources_GeoJsonDataSource, DataSources_GeometryUpdater, DataSources_GeometryVisualizer, DataSources_GridMaterialProperty, DataSources_ImageMaterialProperty, DataSources_KmlDataSource, DataSources_LabelGraphics, DataSources_LabelVisualizer, DataSources_MaterialProperty, DataSources_ModelGraphics, DataSources_ModelVisualizer, DataSources_NodeTransformationProperty, DataSources_PathGraphics, DataSources_PathVisualizer, DataSources_PointGraphics, DataSources_PointVisualizer, DataSources_PolygonGeometryUpdater, DataSources_PolygonGraphics, DataSources_PolylineArrowMaterialProperty, DataSources_PolylineGeometryUpdater, DataSources_PolylineGlowMaterialProperty, DataSources_PolylineGraphics, DataSources_PolylineOutlineMaterialProperty, DataSources_PolylineVolumeGeometryUpdater, DataSources_PolylineVolumeGraphics, DataSources_PositionProperty, DataSources_PositionPropertyArray, DataSources_Property, DataSources_PropertyArray, DataSources_PropertyBag, DataSources_RectangleGeometryUpdater, DataSources_RectangleGraphics, DataSources_ReferenceProperty, DataSources_Rotation, DataSources_SampledPositionProperty, DataSources_SampledProperty, DataSources_ScaledPositionProperty, DataSources_StaticGeometryColorBatch, DataSources_StaticGeometryPerMaterialBatch, DataSources_StaticGroundGeometryColorBatch, DataSources_StaticOutlineGeometryBatch, DataSources_StripeMaterialProperty, DataSources_StripeOrientation, DataSources_TimeIntervalCollectionPositionProperty, DataSources_TimeIntervalCollectionProperty, DataSources_VelocityOrientationProperty, DataSources_VelocityVectorProperty, DataSources_Visualizer, DataSources_WallGeometryUpdater, DataSources_WallGraphics, Renderer_AutomaticUniforms, Renderer_Buffer, Renderer_BufferUsage, Renderer_ClearCommand, Renderer_ComputeCommand, Renderer_ComputeEngine, Renderer_Context, Renderer_ContextLimits, Renderer_createUniform, Renderer_createUniformArray, Renderer_CubeMap, Renderer_CubeMapFace, Renderer_DrawCommand, Renderer_Framebuffer, Renderer_loadCubeMap, Renderer_MipmapHint, Renderer_Pass, Renderer_PassState, Renderer_PickFramebuffer, Renderer_PixelDatatype, Renderer_Renderbuffer, Renderer_RenderbufferFormat, Renderer_RenderState, Renderer_Sampler, Renderer_ShaderCache, Renderer_ShaderProgram, Renderer_ShaderSource, Renderer_Texture, Renderer_TextureMagnificationFilter, Renderer_TextureMinificationFilter, Renderer_TextureWrap, Renderer_UniformState, Renderer_VertexArray, Renderer_VertexArrayFacade, Scene_Appearance, Scene_ArcGisMapServerImageryProvider, Scene_BatchTable, Scene_Billboard, Scene_BillboardCollection, Scene_BingMapsImageryProvider, Scene_BingMapsStyle, Scene_BlendEquation, Scene_BlendFunction, Scene_BlendingState, Scene_BlendOption, Scene_Camera, Scene_CameraEventAggregator, Scene_CameraEventType, Scene_CameraFlightPath, Scene_ColorBlendMode, Scene_createOpenStreetMapImageryProvider, Scene_createTangentSpaceDebugPrimitive, Scene_createTileMapServiceImageryProvider, Scene_CreditDisplay, Scene_CullFace, Scene_CullingVolume, Scene_DebugAppearance, Scene_DebugCameraPrimitive, Scene_DebugModelMatrixPrimitive, Scene_DepthFunction, Scene_DepthPlane, Scene_DeviceOrientationCameraController, Scene_DiscardMissingTileImagePolicy, Scene_EllipsoidPrimitive, Scene_EllipsoidSurfaceAppearance, Scene_Fog, Scene_FrameRateMonitor, Scene_FrameState, Scene_FrustumCommands, Scene_FXAA, Scene_getAttributeOrUniformBySemantic, Scene_getBinaryAccessor, Scene_GetFeatureInfoFormat, Scene_Globe, Scene_GlobeDepth, Scene_GlobeSurfaceShaderSet, Scene_GlobeSurfaceTile, Scene_GlobeSurfaceTileProvider, Scene_GoogleEarthImageryProvider, Scene_GridImageryProvider, Scene_GroundPrimitive, Scene_HeightReference, Scene_HorizontalOrigin, Scene_Imagery, Scene_ImageryLayer, Scene_ImageryLayerCollection, Scene_ImageryLayerFeatureInfo, Scene_ImageryProvider, Scene_ImagerySplitDirection, Scene_ImageryState, Scene_Label, Scene_LabelCollection, Scene_LabelStyle, Scene_MapboxImageryProvider, Scene_MapMode2D, Scene_Material, Scene_MaterialAppearance, Scene_Model, Scene_ModelAnimation, Scene_ModelAnimationCache, Scene_ModelAnimationCollection, Scene_ModelAnimationLoop, Scene_ModelAnimationState, Scene_ModelMaterial, Scene_modelMaterialsCommon, Scene_ModelMesh, Scene_ModelNode, Scene_Moon, Scene_NeverTileDiscardPolicy, Scene_OIT, Scene_OrthographicFrustum, Scene_PerformanceDisplay, Scene_PerInstanceColorAppearance, Scene_PerspectiveFrustum, Scene_PerspectiveOffCenterFrustum, Scene_PickDepth, Scene_PointAppearance, Scene_PointPrimitive, Scene_PointPrimitiveCollection, Scene_Polyline, Scene_PolylineCollection, Scene_PolylineColorAppearance, Scene_PolylineMaterialAppearance, Scene_Primitive, Scene_PrimitiveCollection, Scene_PrimitivePipeline, Scene_PrimitiveState, Scene_QuadtreeOccluders, Scene_QuadtreePrimitive, Scene_QuadtreeTile, Scene_QuadtreeTileLoadState, Scene_QuadtreeTileProvider, Scene_Scene, Scene_SceneMode, Scene_SceneTransforms, Scene_SceneTransitioner, Scene_ScreenSpaceCameraController, Scene_ShadowMap, Scene_ShadowMapShader, Scene_ShadowMode, Scene_SingleTileImageryProvider, Scene_SkyAtmosphere, Scene_SkyBox, Scene_StencilFunction, Scene_StencilOperation, Scene_Sun, Scene_SunPostProcess, Scene_TerrainState, Scene_TextureAtlas, Scene_TileBoundingBox, Scene_TileCoordinatesImageryProvider, Scene_TileDiscardPolicy, Scene_TileImagery, Scene_TileReplacementQueue, Scene_TileState, Scene_TileTerrain, Scene_TweenCollection, Scene_UrlTemplateImageryProvider, Scene_VerticalOrigin, Scene_ViewportQuad, Scene_WebMapServiceImageryProvider, Scene_WebMapTileServiceImageryProvider, Shaders_AdjustTranslucentFS, Shaders_Appearances_AllMaterialAppearanceFS, Shaders_Appearances_AllMaterialAppearanceVS, Shaders_Appearances_BasicMaterialAppearanceFS, Shaders_Appearances_BasicMaterialAppearanceVS, Shaders_Appearances_EllipsoidSurfaceAppearanceFS, Shaders_Appearances_EllipsoidSurfaceAppearanceVS, Shaders_Appearances_PerInstanceColorAppearanceFS, Shaders_Appearances_PerInstanceColorAppearanceVS, Shaders_Appearances_PerInstanceFlatColorAppearanceFS, Shaders_Appearances_PerInstanceFlatColorAppearanceVS, Shaders_Appearances_PointAppearanceFS, Shaders_Appearances_PointAppearanceVS, Shaders_Appearances_PolylineColorAppearanceVS, Shaders_Appearances_PolylineMaterialAppearanceVS, Shaders_Appearances_TexturedMaterialAppearanceFS, Shaders_Appearances_TexturedMaterialAppearanceVS, Shaders_BillboardCollectionFS, Shaders_BillboardCollectionVS, Shaders_Builtin_Constants_degreesPerRadian, Shaders_Builtin_Constants_depthRange, Shaders_Builtin_Constants_epsilon1, Shaders_Builtin_Constants_epsilon2, Shaders_Builtin_Constants_epsilon3, Shaders_Builtin_Constants_epsilon4, Shaders_Builtin_Constants_epsilon5, Shaders_Builtin_Constants_epsilon6, Shaders_Builtin_Constants_epsilon7, Shaders_Builtin_Constants_infinity, Shaders_Builtin_Constants_oneOverPi, Shaders_Builtin_Constants_oneOverTwoPi, Shaders_Builtin_Constants_passCompute, Shaders_Builtin_Constants_passEnvironment, Shaders_Builtin_Constants_passGlobe, Shaders_Builtin_Constants_passGround, Shaders_Builtin_Constants_passOpaque, Shaders_Builtin_Constants_passOverlay, Shaders_Builtin_Constants_passTranslucent, Shaders_Builtin_Constants_pi, Shaders_Builtin_Constants_piOverFour, Shaders_Builtin_Constants_piOverSix, Shaders_Builtin_Constants_piOverThree, Shaders_Builtin_Constants_piOverTwo, Shaders_Builtin_Constants_radiansPerDegree, Shaders_Builtin_Constants_sceneMode2D, Shaders_Builtin_Constants_sceneMode3D, Shaders_Builtin_Constants_sceneModeColumbusView, Shaders_Builtin_Constants_sceneModeMorphing, Shaders_Builtin_Constants_solarRadius, Shaders_Builtin_Constants_threePiOver2, Shaders_Builtin_Constants_twoPi, Shaders_Builtin_Constants_webMercatorMaxLatitude, Shaders_Builtin_CzmBuiltins, Shaders_Builtin_Functions_alphaWeight, Shaders_Builtin_Functions_antialias, Shaders_Builtin_Functions_cascadeColor, Shaders_Builtin_Functions_cascadeDistance, Shaders_Builtin_Functions_cascadeMatrix, Shaders_Builtin_Functions_cascadeWeights, Shaders_Builtin_Functions_columbusViewMorph, Shaders_Builtin_Functions_computePosition, Shaders_Builtin_Functions_cosineAndSine, Shaders_Builtin_Functions_decompressTextureCoordinates, Shaders_Builtin_Functions_eastNorthUpToEyeCoordinates, Shaders_Builtin_Functions_ellipsoidContainsPoint, Shaders_Builtin_Functions_ellipsoidNew, Shaders_Builtin_Functions_ellipsoidWgs84TextureCoordinates, Shaders_Builtin_Functions_equalsEpsilon, Shaders_Builtin_Functions_eyeOffset, Shaders_Builtin_Functions_eyeToWindowCoordinates, Shaders_Builtin_Functions_fog, Shaders_Builtin_Functions_geodeticSurfaceNormal, Shaders_Builtin_Functions_getDefaultMaterial, Shaders_Builtin_Functions_getLambertDiffuse, Shaders_Builtin_Functions_getSpecular, Shaders_Builtin_Functions_getWaterNoise, Shaders_Builtin_Functions_getWgs84EllipsoidEC, Shaders_Builtin_Functions_hue, Shaders_Builtin_Functions_isEmpty, Shaders_Builtin_Functions_isFull, Shaders_Builtin_Functions_latitudeToWebMercatorFraction, Shaders_Builtin_Functions_luminance, Shaders_Builtin_Functions_metersPerPixel, Shaders_Builtin_Functions_modelToWindowCoordinates, Shaders_Builtin_Functions_multiplyWithColorBalance, Shaders_Builtin_Functions_nearFarScalar, Shaders_Builtin_Functions_octDecode, Shaders_Builtin_Functions_packDepth, Shaders_Builtin_Functions_phong, Shaders_Builtin_Functions_pointAlongRay, Shaders_Builtin_Functions_rayEllipsoidIntersectionInterval, Shaders_Builtin_Functions_RGBToXYZ, Shaders_Builtin_Functions_saturation, Shaders_Builtin_Functions_shadowDepthCompare, Shaders_Builtin_Functions_shadowVisibility, Shaders_Builtin_Functions_signNotZero, Shaders_Builtin_Functions_tangentToEyeSpaceMatrix, Shaders_Builtin_Functions_translateRelativeToEye, Shaders_Builtin_Functions_translucentPhong, Shaders_Builtin_Functions_transpose, Shaders_Builtin_Functions_unpackDepth, Shaders_Builtin_Functions_windowToEyeCoordinates, Shaders_Builtin_Functions_XYZToRGB, Shaders_Builtin_Structs_depthRangeStruct, Shaders_Builtin_Structs_ellipsoid, Shaders_Builtin_Structs_material, Shaders_Builtin_Structs_materialInput, Shaders_Builtin_Structs_ray, Shaders_Builtin_Structs_raySegment, Shaders_Builtin_Structs_shadowParameters, Shaders_CompositeOITFS, Shaders_DepthPlaneFS, Shaders_DepthPlaneVS, Shaders_EllipsoidFS, Shaders_EllipsoidVS, Shaders_GlobeFS, Shaders_GlobeVS, Shaders_GroundAtmosphere, Shaders_Materials_BumpMapMaterial, Shaders_Materials_CheckerboardMaterial, Shaders_Materials_DotMaterial, Shaders_Materials_FadeMaterial, Shaders_Materials_GridMaterial, Shaders_Materials_NormalMapMaterial, Shaders_Materials_PolylineArrowMaterial, Shaders_Materials_PolylineGlowMaterial, Shaders_Materials_PolylineOutlineMaterial, Shaders_Materials_RimLightingMaterial, Shaders_Materials_StripeMaterial, Shaders_Materials_Water, Shaders_PointPrimitiveCollectionFS, Shaders_PointPrimitiveCollectionVS, Shaders_PolylineCommon, Shaders_PolylineFS, Shaders_PolylineVS, Shaders_PostProcessFilters_AdditiveBlend, Shaders_PostProcessFilters_BrightPass, Shaders_PostProcessFilters_FXAA, Shaders_PostProcessFilters_GaussianBlur1D, Shaders_PostProcessFilters_PassThrough, Shaders_ReprojectWebMercatorFS, Shaders_ReprojectWebMercatorVS, Shaders_ShadowVolumeFS, Shaders_ShadowVolumeVS, Shaders_SkyAtmosphereFS, Shaders_SkyAtmosphereVS, Shaders_SkyBoxFS, Shaders_SkyBoxVS, Shaders_SunFS, Shaders_SunTextureFS, Shaders_SunVS, Shaders_ViewportQuadFS, Shaders_ViewportQuadVS, ThirdParty_Autolinker, ThirdParty_earcut_2_1_1, ThirdParty_gltfDefaults, ThirdParty_kdbush, ThirdParty_knockout_3_4_0, ThirdParty_knockout_es5, ThirdParty_knockout, ThirdParty_measureText, ThirdParty_mersenne_twister, ThirdParty_NoSleep, ThirdParty_sprintf, ThirdParty_topojson, ThirdParty_Tween, ThirdParty_Uri, ThirdParty_when, ThirdParty_zip, Widgets_Animation_Animation, Widgets_Animation_AnimationViewModel, Widgets_BaseLayerPicker_BaseLayerPicker, Widgets_BaseLayerPicker_BaseLayerPickerViewModel, Widgets_BaseLayerPicker_createDefaultImageryProviderViewModels, Widgets_BaseLayerPicker_createDefaultTerrainProviderViewModels, Widgets_BaseLayerPicker_ProviderViewModel, Widgets_CesiumInspector_CesiumInspector, Widgets_CesiumInspector_CesiumInspectorViewModel, Widgets_CesiumWidget_CesiumWidget, Widgets_ClockViewModel, Widgets_Command, Widgets_createCommand, Widgets_FullscreenButton_FullscreenButton, Widgets_FullscreenButton_FullscreenButtonViewModel, Widgets_Geocoder_Geocoder, Widgets_Geocoder_GeocoderViewModel, Widgets_getElement, Widgets_HomeButton_HomeButton, Widgets_HomeButton_HomeButtonViewModel, Widgets_InfoBox_InfoBox, Widgets_InfoBox_InfoBoxViewModel, Widgets_NavigationHelpButton_NavigationHelpButton, Widgets_NavigationHelpButton_NavigationHelpButtonViewModel, Widgets_PerformanceWatchdog_PerformanceWatchdog, Widgets_PerformanceWatchdog_PerformanceWatchdogViewModel, Widgets_SceneModePicker_SceneModePicker, Widgets_SceneModePicker_SceneModePickerViewModel, Widgets_SelectionIndicator_SelectionIndicator, Widgets_SelectionIndicator_SelectionIndicatorViewModel, Widgets_subscribeAndEvaluate, Widgets_SvgPathBindingHandler, Widgets_Timeline_Timeline, Widgets_Timeline_TimelineHighlightRange, Widgets_Timeline_TimelineTrack, Widgets_ToggleButtonViewModel, Widgets_Viewer_Viewer, Widgets_Viewer_viewerCesiumInspectorMixin, Widgets_Viewer_viewerDragDropMixin, Widgets_Viewer_viewerPerformanceWatchdogMixin, Widgets_VRButton_VRButton, Widgets_VRButton_VRButtonViewModel, Workers_createTaskProcessorWorker) { 'use strict'; /*jshint sub:true*/ var Cesium = { - VERSION : "1.29", + VERSION : "1.30", _shaders : {} }; Cesium['appendForwardSlash'] = Core_appendForwardSlash; @@ -184279,6 +185205,7 @@ define('Cesium',['./Core/appendForwardSlash', './Core/ArcGisImageServerTerrainPr Cesium['barycentricCoordinates'] = Core_barycentricCoordinates; Cesium['binarySearch'] = Core_binarySearch; Cesium['BingMapsApi'] = Core_BingMapsApi; + Cesium['BingMapsGeocoderService'] = Core_BingMapsGeocoderService; Cesium['BoundingRectangle'] = Core_BoundingRectangle; Cesium['BoundingSphere'] = Core_BoundingSphere; Cesium['BoxGeometry'] = Core_BoxGeometry; @@ -184289,6 +185216,7 @@ define('Cesium',['./Core/appendForwardSlash', './Core/ArcGisImageServerTerrainPr Cesium['Cartesian3'] = Core_Cartesian3; Cesium['Cartesian4'] = Core_Cartesian4; Cesium['Cartographic'] = Core_Cartographic; + Cesium['CartographicGeocoderService'] = Core_CartographicGeocoderService; Cesium['CatmullRomSpline'] = Core_CatmullRomSpline; Cesium['CesiumTerrainProvider'] = Core_CesiumTerrainProvider; Cesium['Check'] = Core_Check; @@ -184342,6 +185270,7 @@ define('Cesium',['./Core/appendForwardSlash', './Core/ArcGisImageServerTerrainPr Cesium['formatError'] = Core_formatError; Cesium['freezeObject'] = Core_freezeObject; Cesium['Fullscreen'] = Core_Fullscreen; + Cesium['GeocoderService'] = Core_GeocoderService; Cesium['GeographicProjection'] = Core_GeographicProjection; Cesium['GeographicTilingScheme'] = Core_GeographicTilingScheme; Cesium['Geometry'] = Core_Geometry; @@ -184446,6 +185375,7 @@ define('Cesium',['./Core/appendForwardSlash', './Core/ArcGisImageServerTerrainPr Cesium['RequestErrorEvent'] = Core_RequestErrorEvent; Cesium['RuntimeError'] = Core_RuntimeError; Cesium['sampleTerrain'] = Core_sampleTerrain; + Cesium['sampleTerrainMostDetailed'] = Core_sampleTerrainMostDetailed; Cesium['scaleToGeodeticSurface'] = Core_scaleToGeodeticSurface; Cesium['ScreenSpaceEventHandler'] = Core_ScreenSpaceEventHandler; Cesium['ScreenSpaceEventType'] = Core_ScreenSpaceEventType; @@ -184464,6 +185394,7 @@ define('Cesium',['./Core/appendForwardSlash', './Core/ArcGisImageServerTerrainPr Cesium['TerrainProvider'] = Core_TerrainProvider; Cesium['TerrainQuantization'] = Core_TerrainQuantization; Cesium['throttleRequestByServer'] = Core_throttleRequestByServer; + Cesium['TileAvailability'] = Core_TileAvailability; Cesium['TileProviderError'] = Core_TileProviderError; Cesium['TilingScheme'] = Core_TilingScheme; Cesium['TimeConstants'] = Core_TimeConstants; @@ -184619,6 +185550,7 @@ define('Cesium',['./Core/appendForwardSlash', './Core/ArcGisImageServerTerrainPr Cesium['BlendEquation'] = Scene_BlendEquation; Cesium['BlendFunction'] = Scene_BlendFunction; Cesium['BlendingState'] = Scene_BlendingState; + Cesium['BlendOption'] = Scene_BlendOption; Cesium['Camera'] = Scene_Camera; Cesium['CameraEventAggregator'] = Scene_CameraEventAggregator; Cesium['CameraEventType'] = Scene_CameraEventType; @@ -184662,6 +185594,7 @@ define('Cesium',['./Core/appendForwardSlash', './Core/ArcGisImageServerTerrainPr Cesium['ImageryLayerCollection'] = Scene_ImageryLayerCollection; Cesium['ImageryLayerFeatureInfo'] = Scene_ImageryLayerFeatureInfo; Cesium['ImageryProvider'] = Scene_ImageryProvider; + Cesium['ImagerySplitDirection'] = Scene_ImagerySplitDirection; Cesium['ImageryState'] = Scene_ImageryState; Cesium['Label'] = Scene_Label; Cesium['LabelCollection'] = Scene_LabelCollection; diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/ThirdParty/Workers/deflate.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/ThirdParty/Workers/deflate.js index efacfcc4..8a6a0f28 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/ThirdParty/Workers/deflate.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/ThirdParty/Workers/deflate.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/ThirdParty/Workers/inflate.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/ThirdParty/Workers/inflate.js index 8a30ecbc..edc9d4f1 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/ThirdParty/Workers/inflate.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/ThirdParty/Workers/inflate.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Widgets/Geocoder/Geocoder.css b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Widgets/Geocoder/Geocoder.css index b8da4c24..244e41de 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Widgets/Geocoder/Geocoder.css +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Widgets/Geocoder/Geocoder.css @@ -37,6 +37,33 @@ width: 250px; } +.cesium-viewer-geocoderContainer .search-results { + position: absolute; + background-color: #000; + color: #eee; + overflow-y: auto; + opacity: 0.8; + width: 100%; +} + +.cesium-viewer-geocoderContainer .search-results ul { + list-style-type: none; + margin: 0; + padding: 0; +} + +.cesium-viewer-geocoderContainer .search-results ul li { + font-size: 14px; + padding: 3px 10px; +} +.cesium-viewer-geocoderContainer .search-results ul li:hover { + cursor: pointer; +} + +.cesium-viewer-geocoderContainer .search-results ul li.active { + background: #48b; +} + .cesium-geocoder-searchButton { background-color: #303336; display: inline-block; diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/cesiumWorkerBootstrapper.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/cesiumWorkerBootstrapper.js index 6761a3c3..8c407be0 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/cesiumWorkerBootstrapper.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/cesiumWorkerBootstrapper.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -200,8 +200,9 @@ var requirejs, require, define; /** * Constructs an error with a pointer to an URL with more information. * @param {String} id the error ID that maps to an ID on a web page. - * @param {String} message human readable error. + * @param {String} msg human readable error. * @param {Error} [err] the original error, if there is one. + * @param {RequireModules} requireModules The modules required but not found. * * @returns {Error} */ diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/combineGeometry.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/combineGeometry.js index a979ec26..6c9cb701 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/combineGeometry.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/combineGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,68 +45,6 @@ define('Core/defined',[],function() { return defined; }); -/*global define*/ -define('Core/freezeObject',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Freezes an object, using Object.freeze if available, otherwise returns - * the object unchanged. This function should be used in setup code to prevent - * errors from completely halting JavaScript execution in legacy browsers. - * - * @private - * - * @exports freezeObject - */ - var freezeObject = Object.freeze; - if (!defined(freezeObject)) { - freezeObject = function(o) { - return o; - }; - } - - return freezeObject; -}); - -/*global define*/ -define('Core/defaultValue',[ - './freezeObject' - ], function( - freezeObject) { - 'use strict'; - - /** - * Returns the first parameter if not undefined, otherwise the second parameter. - * Useful for setting a default value for a parameter. - * - * @exports defaultValue - * - * @param {*} a - * @param {*} b - * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter. - * - * @example - * param = Cesium.defaultValue(param, 'default'); - */ - function defaultValue(a, b) { - if (a !== undefined) { - return a; - } - return b; - } - - /** - * A frozen empty object that can be used as the default value for options passed as - * an object literal. - */ - defaultValue.EMPTY_OBJECT = freezeObject({}); - - return defaultValue; -}); - /*global define*/ define('Core/DeveloperError',[ './defined' @@ -188,41 +126,13 @@ define('Core/DeveloperError',[ return DeveloperError; }); -/*global define*/ -define('Core/isArray',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Tests an object to see if it is an array. - * @exports isArray - * - * @param {Object} value The value to test. - * @returns {Boolean} true if the value is an array, false otherwise. - */ - var isArray = Array.isArray; - if (!defined(isArray)) { - isArray = function(value) { - return Object.prototype.toString.call(value) === '[object Array]'; - }; - } - - return isArray; -}); - /*global define*/ define('Core/Check',[ - './defaultValue', - './defined', - './DeveloperError', - './isArray' + './defined', + './DeveloperError' ], function( - defaultValue, defined, - DeveloperError, - isArray) { + DeveloperError) { 'use strict'; /** @@ -237,111 +147,134 @@ define('Core/Check',[ */ Check.typeOf = {}; - /** - * Contains functions for checking numeric conditions such as minimum and maximum values - */ - Check.numeric = {}; - function getUndefinedErrorMessage(name) { - return name + ' was required but undefined.'; + return name + ' is required, actual value was undefined'; } function getFailedTypeErrorMessage(actual, expected, name) { - return 'Expected ' + name + ' to be typeof ' + expected + ', got ' + actual; + return 'Expected ' + name + ' to be typeof ' + expected + ', actual typeof was ' + actual; } /** * Throws if test is not defined * - * @param {*} test The value that is to be checked * @param {String} name The name of the variable being tested + * @param {*} test The value that is to be checked * @exception {DeveloperError} test must be defined */ - Check.defined = function (test, name) { + Check.defined = function (name, test) { if (!defined(test)) { throw new DeveloperError(getUndefinedErrorMessage(name)); } }; /** - * Throws if test is greater than maximum + * Throws if test is not typeof 'function' * - * @param {Number} test The value to test - * @param {Number} maximum The maximum allowed value - * @exception {DeveloperError} test must not be greater than maximum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'function' */ - Check.numeric.maximum = function (test, maximum) { - Check.typeOf.number(test); - Check.typeOf.number(maximum); - if (test > maximum) { - throw new DeveloperError('Expected ' + test + ' to be at most ' + maximum); + Check.typeOf.func = function (name, test) { + if (typeof test !== 'function') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); } }; /** - * Throws if test is less than minimum + * Throws if test is not typeof 'string' * - * @param {Number} test The value to test - * @param {Number} minimum The minimum allowed value - * @exception {DeveloperError} test must not be less than mininum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'string' */ - Check.numeric.minimum = function (test, minimum) { - Check.typeOf.number(test); - Check.typeOf.number(minimum); - if (test < minimum) { - throw new DeveloperError('Expected ' + test + ' to be at least ' + minimum); + Check.typeOf.string = function (name, test) { + if (typeof test !== 'string') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); } }; /** - * Throws if test is not typeof 'function' + * Throws if test is not typeof 'number' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'function' + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'number' */ - Check.typeOf.function = function (test, name) { - if (typeof test !== 'function') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); + Check.typeOf.number = function (name, test) { + if (typeof test !== 'number') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); } }; /** - * Throws if test is not typeof 'string' + * Throws if test is not typeof 'number' and less than limit * + * @param {String} name The name of the variable being tested * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than limit + */ + Check.typeOf.number.lessThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test >= limit) { + throw new DeveloperError('Expected ' + name + ' to be less than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and less than or equal to limit + * * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'string' + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than or equal to limit */ - Check.typeOf.string = function (test, name) { - if (typeof test !== 'string') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); + Check.typeOf.number.lessThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test > limit) { + throw new DeveloperError('Expected ' + name + ' to be less than or equal to ' + limit + ', actual value was ' + test); } }; /** - * Throws if test is not typeof 'number' + * Throws if test is not typeof 'number' and greater than limit * + * @param {String} name The name of the variable being tested * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than limit + */ + Check.typeOf.number.greaterThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test <= limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and greater than or equal to limit + * * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'number' + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than or equal to limit */ - Check.typeOf.number = function (test, name) { - if (typeof test !== 'number') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); + Check.typeOf.number.greaterThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test < limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than or equal to' + limit + ', actual value was ' + test); } }; /** * Throws if test is not typeof 'object' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested + * @param {*} test The value to test * @exception {DeveloperError} test must be typeof 'object' */ - Check.typeOf.object = function (test, name) { + Check.typeOf.object = function (name, test) { if (typeof test !== 'object') { throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'object', name)); } @@ -350,11 +283,11 @@ define('Core/Check',[ /** * Throws if test is not typeof 'boolean' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested + * @param {*} test The value to test * @exception {DeveloperError} test must be typeof 'boolean' */ - Check.typeOf.boolean = function (test, name) { + Check.typeOf.bool = function (name, test) { if (typeof test !== 'boolean') { throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'boolean', name)); } @@ -363,6 +296,68 @@ define('Core/Check',[ return Check; }); +/*global define*/ +define('Core/freezeObject',[ + './defined' + ], function( + defined) { + 'use strict'; + + /** + * Freezes an object, using Object.freeze if available, otherwise returns + * the object unchanged. This function should be used in setup code to prevent + * errors from completely halting JavaScript execution in legacy browsers. + * + * @private + * + * @exports freezeObject + */ + var freezeObject = Object.freeze; + if (!defined(freezeObject)) { + freezeObject = function(o) { + return o; + }; + } + + return freezeObject; +}); + +/*global define*/ +define('Core/defaultValue',[ + './freezeObject' + ], function( + freezeObject) { + 'use strict'; + + /** + * Returns the first parameter if not undefined, otherwise the second parameter. + * Useful for setting a default value for a parameter. + * + * @exports defaultValue + * + * @param {*} a + * @param {*} b + * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter. + * + * @example + * param = Cesium.defaultValue(param, 'default'); + */ + function defaultValue(a, b) { + if (a !== undefined) { + return a; + } + return b; + } + + /** + * A frozen empty object that can be used as the default value for options passed as + * an object literal. + */ + defaultValue.EMPTY_OBJECT = freezeObject({}); + + return defaultValue; +}); + /* I've wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace so it's better encapsulated. Now you can have multiple random number generators @@ -1047,7 +1042,7 @@ define('Core/Math',[ if (!defined(angle)) { throw new DeveloperError('angle is required.'); } - + return CesiumMath.clamp(angle, -1*CesiumMath.PI_OVER_TWO, CesiumMath.PI_OVER_TWO); }; @@ -1057,11 +1052,11 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [<code>-CesiumMath.PI</code>, <code>CesiumMath.PI</code>]. */ - CesiumMath.negativePiToPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.negativePiToPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - return CesiumMath.zeroToTwoPi(x + CesiumMath.PI) - CesiumMath.PI; + return CesiumMath.zeroToTwoPi(angle + CesiumMath.PI) - CesiumMath.PI; }; /** @@ -1070,12 +1065,12 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [0, <code>CesiumMath.TWO_PI</code>]. */ - CesiumMath.zeroToTwoPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.zeroToTwoPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - var mod = CesiumMath.mod(x, CesiumMath.TWO_PI); - if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(x) > CesiumMath.EPSILON14) { + var mod = CesiumMath.mod(angle, CesiumMath.TWO_PI); + if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(angle) > CesiumMath.EPSILON14) { return CesiumMath.TWO_PI; } return mod; @@ -1145,7 +1140,7 @@ define('Core/Math',[ * @example * //Compute 7!, which is equal to 5040 * var computedFactorial = Cesium.Math.factorial(7); - * + * * @see {@link http://en.wikipedia.org/wiki/Factorial|Factorial on Wikipedia} */ CesiumMath.factorial = function(n) { @@ -1429,7 +1424,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.fromSpherical = function(spherical, result) { - Check.typeOf.object(spherical, 'spherical'); + Check.typeOf.object('spherical', spherical); if (!defined(result)) { result = new Cartesian3(); @@ -1513,8 +1508,8 @@ define('Core/Cartesian3',[ * @returns {Number[]} The array that was packed into */ Cartesian3.pack = function(value, array, startingIndex) { - Check.typeOf.object(value, 'value'); - Check.defined(array, 'array'); + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1534,7 +1529,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.unpack = function(array, startingIndex, result) { - Check.defined(array, 'array'); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1555,7 +1550,7 @@ define('Core/Cartesian3',[ * @returns {Number[]} The packed array. */ Cartesian3.packArray = function(array, result) { - Check.defined(array, 'array'); + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -1578,8 +1573,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3[]} The unpacked array. */ Cartesian3.unpackArray = function(array, result) { - Check.defined(array, 'array'); - Check.numeric.minimum(array.length, 3); + Check.defined('array', array); + Check.typeOf.number.greaterThanOrEquals('array.length', array.length, 3); if (array.length % 3 !== 0) { throw new DeveloperError('array length must be a multiple of 3.'); } @@ -1625,7 +1620,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the maximum component. */ Cartesian3.maximumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z); }; @@ -1637,7 +1632,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the minimum component. */ Cartesian3.minimumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z); }; @@ -1651,9 +1646,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the minimum components. */ Cartesian3.minimumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -1671,9 +1666,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the maximum components. */ Cartesian3.maximumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -1688,7 +1683,7 @@ define('Core/Cartesian3',[ * @returns {Number} The squared magnitude. */ Cartesian3.magnitudeSquared = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z; }; @@ -1717,8 +1712,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distance(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(2.0, 0.0, 0.0)); */ Cartesian3.distance = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitude(distanceScratch); @@ -1737,8 +1732,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distanceSquared(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(3.0, 0.0, 0.0)); */ Cartesian3.distanceSquared = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitudeSquared(distanceScratch); @@ -1752,8 +1747,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.normalize = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian3.magnitude(cartesian); @@ -1776,8 +1771,8 @@ define('Core/Cartesian3',[ * @returns {Number} The dot product. */ Cartesian3.dot = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z; }; @@ -1791,9 +1786,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyComponents = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -1835,9 +1830,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.add = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -1854,9 +1849,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.subtract = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -1873,9 +1868,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -1892,9 +1887,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.divideByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -1910,8 +1905,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.negate = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -1927,8 +1922,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.abs = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -1947,10 +1942,10 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.lerp = function(start, end, t, result) { - Check.typeOf.object(start, 'start'); - Check.typeOf.object(end, 'end'); - Check.typeOf.number(t, 't'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian3.multiplyByScalar(end, t, lerpScratch); result = Cartesian3.multiplyByScalar(start, 1.0 - t, result); @@ -1967,8 +1962,8 @@ define('Core/Cartesian3',[ * @returns {Number} The angle between the Cartesians. */ Cartesian3.angleBetween = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.normalize(left, angleBetweenScratch); Cartesian3.normalize(right, angleBetweenScratch2); @@ -1986,8 +1981,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The most orthogonal axis. */ Cartesian3.mostOrthogonalAxis = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian3.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian3.abs(f, f); @@ -2064,9 +2059,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The cross product. */ Cartesian3.cross = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var leftX = left.x; var leftY = left.y; @@ -2099,8 +2094,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromDegrees(-115.0, 37.0); */ Cartesian3.fromDegrees = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); longitude = CesiumMath.toRadians(longitude); latitude = CesiumMath.toRadians(latitude); @@ -2125,8 +2120,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromRadians(-2.007, 0.645); */ Cartesian3.fromRadians = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); height = defaultValue(height, 0.0); var radiiSquared = defined(ellipsoid) ? ellipsoid.radiiSquared : wgs84RadiiSquared; @@ -2160,7 +2155,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArray([-115.0, 37.0, -107.0, 33.0]); */ Cartesian3.fromDegreesArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -2194,7 +2189,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArray([-2.007, 0.645, -1.867, .575]); */ Cartesian3.fromRadiansArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -2228,7 +2223,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArrayHeights([-115.0, 37.0, 100000.0, -107.0, 33.0, 150000.0]); */ Cartesian3.fromDegreesArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -2263,7 +2258,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArrayHeights([-2.007, 0.645, 100000.0, -1.867, .575, 150000.0]); */ Cartesian3.fromRadiansArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -3010,7 +3005,9 @@ define('Core/Ellipsoid',[ /** * Computes an Ellipsoid from a Cartesian specifying the radii in x, y, and z directions. * - * @param {Cartesian3} [radii=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Cartesian3} [cartesian=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new + * instance should be created. * @returns {Ellipsoid} A new Ellipsoid instance. * * @exception {DeveloperError} All radii components must be greater than or equal to zero. @@ -3650,6 +3647,7 @@ define('Core/Interval',[ /*global define*/ define('Core/Matrix3',[ './Cartesian3', + './Check', './defaultValue', './defined', './defineProperties', @@ -3658,6 +3656,7 @@ define('Core/Matrix3',[ './Math' ], function( Cartesian3, + Check, defaultValue, defined, defineProperties, @@ -3720,13 +3719,8 @@ define('Core/Matrix3',[ * @returns {Number[]} The array that was packed into */ Matrix3.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3752,9 +3746,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. */ Matrix3.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3781,24 +3773,24 @@ define('Core/Matrix3',[ * @param {Matrix3} [result] The object onto which to store the result. * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. (Returns undefined if matrix is undefined) */ - Matrix3.clone = function(values, result) { - if (!defined(values)) { + Matrix3.clone = function(matrix, result) { + if (!defined(matrix)) { return undefined; } if (!defined(result)) { - return new Matrix3(values[0], values[3], values[6], - values[1], values[4], values[7], - values[2], values[5], values[8]); + return new Matrix3(matrix[0], matrix[3], matrix[6], + matrix[1], matrix[4], matrix[7], + matrix[2], matrix[5], matrix[8]); } - result[0] = values[0]; - result[1] = values[1]; - result[2] = values[2]; - result[3] = values[3]; - result[4] = values[4]; - result[5] = values[5]; - result[6] = values[6]; - result[7] = values[7]; - result[8] = values[8]; + result[0] = matrix[0]; + result[1] = matrix[1]; + result[2] = matrix[2]; + result[3] = matrix[3]; + result[4] = matrix[4]; + result[5] = matrix[5]; + result[6] = matrix[6]; + result[7] = matrix[7]; + result[8] = matrix[8]; return result; }; @@ -3824,9 +3816,7 @@ define('Core/Matrix3',[ * var m2 = Cesium.Matrix3.fromArray(v2, 2); */ Matrix3.fromArray = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3854,9 +3844,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values parameter is required'); - } + Check.defined('values', values); return Matrix3.clone(values, result); }; @@ -3870,9 +3858,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix3(values[0], values[1], values[2], @@ -3899,9 +3885,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this quaternion. */ Matrix3.fromQuaternion = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); var x2 = quaternion.x * quaternion.x; var xy = quaternion.x * quaternion.y; @@ -3951,10 +3935,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this headingPitchRoll. */ Matrix3.fromHeadingPitchRoll = function(headingPitchRoll, result) { - if (!defined(headingPitchRoll)) { - throw new DeveloperError('headingPitchRoll is required'); - } - var cosTheta = Math.cos(-headingPitchRoll.pitch); + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + + var cosTheta = Math.cos(-headingPitchRoll.pitch); var cosPsi = Math.cos(-headingPitchRoll.heading); var cosPhi = Math.cos(headingPitchRoll.roll); var sinTheta = Math.sin(-headingPitchRoll.pitch); @@ -4005,9 +3988,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix3( @@ -4043,9 +4024,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromUniformScale(2.0); */ Matrix3.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix3( @@ -4069,7 +4048,7 @@ define('Core/Matrix3',[ /** * Computes a Matrix3 instance representing the cross product equivalent matrix of a Cartesian3 vector. * - * @param {Cartesian3} the vector on the left hand side of the cross product operation. + * @param {Cartesian3} vector the vector on the left hand side of the cross product operation. * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created. * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. * @@ -4081,9 +4060,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromCrossProduct(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromCrossProduct = function(vector, result) { - if (!defined(vector)) { - throw new DeveloperError('vector is required.'); - } + Check.typeOf.object('vector', vector); if (!defined(result)) { return new Matrix3( @@ -4118,9 +4095,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationX = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4159,9 +4134,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationY = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4200,9 +4173,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationZ = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4236,9 +4207,7 @@ define('Core/Matrix3',[ * @returns {Number[]} The modified Array parameter or a new Array instance if one was not provided. */ Matrix3.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5], matrix[6], matrix[7], matrix[8]]; @@ -4272,12 +4241,10 @@ define('Core/Matrix3',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix3.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 2) { - throw new DeveloperError('row must be 0, 1, or 2.'); - } - if (typeof column !== 'number' || column < 0 || column > 2) { - throw new DeveloperError('column must be 0, 1, or 2.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 2); + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 2); return column * 3 + row; }; @@ -4293,16 +4260,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var startIndex = index * 3; var x = matrix[startIndex]; @@ -4327,18 +4288,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); var startIndex = index * 3; @@ -4359,15 +4313,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 3]; @@ -4391,18 +4340,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); result[index] = cartesian.x; @@ -4421,12 +4363,8 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[3], matrix[4], matrix[5], scratchColumn)); @@ -4457,15 +4395,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var column0Row0 = left[0] * right[0] + left[3] * right[1] + left[6] * right[2]; var column0Row1 = left[1] * right[0] + left[4] * right[1] + left[7] * right[2]; @@ -4500,15 +4432,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -4531,15 +4457,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -4562,15 +4482,9 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -4595,15 +4509,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -4634,15 +4542,9 @@ define('Core/Matrix3',[ * @see Matrix3.multiplyByUniformScale */ Matrix3.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); result[0] = matrix[0] * scale.x; result[1] = matrix[1] * scale.x; @@ -4664,12 +4566,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -4691,12 +4589,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var column0Row0 = matrix[0]; var column0Row1 = matrix[3]; @@ -4836,9 +4730,7 @@ define('Core/Matrix3',[ * var c = Cesium.Cartesian3.multiplyByScalar(v, lambda, new Cesium.Cartesian3()); // equal to Cesium.Matrix3.multiplyByVector(a, v) */ Matrix3.computeEigenDecomposition = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); // This routine was created based upon Matrix Computations, 3rd ed., by Golub and Van Loan, // section 8.4.3 The Classical Jacobi Algorithm @@ -4882,12 +4774,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -4909,9 +4797,7 @@ define('Core/Matrix3',[ * @returns {Number} The value of the determinant of the matrix. */ Matrix3.determinant = function(matrix) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); var m11 = matrix[0]; var m21 = matrix[3]; @@ -4936,12 +4822,8 @@ define('Core/Matrix3',[ * @exception {DeveloperError} matrix is not invertible. */ Matrix3.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var m11 = matrix[0]; var m21 = matrix[1]; @@ -5007,9 +4889,7 @@ define('Core/Matrix3',[ * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. */ Matrix3.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -5197,12 +5077,14 @@ define('Core/Matrix3',[ /*global define*/ define('Core/Cartesian4',[ + './Check', './defaultValue', './defined', './DeveloperError', './freezeObject', './Math' ], function( + Check, defaultValue, defined, DeveloperError, @@ -5285,9 +5167,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.fromColor = function(color, result) { - if (!defined(color)) { - throw new DeveloperError('color is required'); - } + Check.typeOf.object('color', color); if (!defined(result)) { return new Cartesian4(color.red, color.green, color.blue, color.alpha); } @@ -5339,12 +5219,8 @@ define('Core/Cartesian4',[ * @returns {Number[]} The array that was packed into */ Cartesian4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5365,9 +5241,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5389,9 +5263,7 @@ define('Core/Cartesian4',[ * @returns {Number[]} The packed array. */ Cartesian4.packArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -5414,9 +5286,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4[]} The unpacked array. */ Cartesian4.unpackArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -5459,9 +5329,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the maximum component. */ Cartesian4.maximumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -5473,9 +5341,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the minimum component. */ Cartesian4.minimumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -5489,15 +5355,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the minimum components. */ Cartesian4.minimumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -5516,15 +5376,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the maximum components. */ Cartesian4.maximumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -5541,9 +5395,7 @@ define('Core/Cartesian4',[ * @returns {Number} The squared magnitude. */ Cartesian4.magnitudeSquared = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z + cartesian.w * cartesian.w; }; @@ -5574,9 +5426,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(2.0, 0.0, 0.0, 0.0)); */ Cartesian4.distance = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitude(distanceScratch); @@ -5597,9 +5448,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(3.0, 0.0, 0.0, 0.0)); */ Cartesian4.distanceSquared = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitudeSquared(distanceScratch); @@ -5613,12 +5463,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.normalize = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian4.magnitude(cartesian); @@ -5642,12 +5488,8 @@ define('Core/Cartesian4',[ * @returns {Number} The dot product. */ Cartesian4.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w; }; @@ -5661,15 +5503,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -5687,15 +5523,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x / right.x; result.y = left.y / right.y; @@ -5713,15 +5543,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -5739,15 +5563,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -5765,15 +5583,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -5791,15 +5603,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -5816,12 +5622,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.negate = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -5838,12 +5640,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.abs = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -5863,18 +5661,10 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian4.multiplyByScalar(end, t, lerpScratch); result = Cartesian4.multiplyByScalar(start, 1.0 - t, result); @@ -5890,12 +5680,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The most orthogonal axis. */ Cartesian4.mostOrthogonalAxis = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian4.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian4.abs(f, f); @@ -6140,6 +5926,7 @@ define('Core/RuntimeError',[ define('Core/Matrix4',[ './Cartesian3', './Cartesian4', + './Check', './defaultValue', './defined', './defineProperties', @@ -6151,6 +5938,7 @@ define('Core/Matrix4',[ ], function( Cartesian3, Cartesian4, + Check, defaultValue, defined, defineProperties, @@ -6241,13 +6029,8 @@ define('Core/Matrix4',[ * @returns {Number[]} The array that was packed into */ Matrix4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -6280,9 +6063,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if one was not provided. */ Matrix4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -6378,9 +6159,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required'); - } + Check.defined('values', values); return Matrix4.clone(values, result); }; @@ -6394,9 +6173,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix4(values[0], values[1], values[2], values[3], @@ -6433,9 +6210,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRotationTranslation = function(rotation, translation, result) { - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } + Check.typeOf.object('rotation', rotation); translation = defaultValue(translation, Cartesian3.ZERO); @@ -6483,15 +6258,9 @@ define('Core/Matrix4',[ * result); */ Matrix4.fromTranslationQuaternionRotationScale = function(translation, rotation, scale, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('translation', translation); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('scale', scale); if (!defined(result)) { result = new Matrix4(); @@ -6552,9 +6321,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromTranslationRotationScale = function(translationRotationScale, result) { - if (!defined(translationRotationScale)) { - throw new DeveloperError('translationRotationScale is required.'); - } + Check.typeOf.object('translationRotationScale', translationRotationScale); return Matrix4.fromTranslationQuaternionRotationScale(translationRotationScale.translation, translationRotationScale.rotation, translationRotationScale.scale, result); }; @@ -6569,9 +6336,7 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByTranslation */ Matrix4.fromTranslation = function(translation, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } + Check.typeOf.object('translation', translation); return Matrix4.fromRotationTranslation(Matrix3.IDENTITY, translation, result); }; @@ -6592,9 +6357,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix4.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix4( @@ -6639,9 +6402,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromUniformScale(2.0); */ Matrix4.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix4(scale, 0.0, 0.0, 0.0, @@ -6681,23 +6442,15 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromCamera = function(camera, result) { - if (!defined(camera)) { - throw new DeveloperError('camera is required.'); - } + Check.typeOf.object('camera', camera); var position = camera.position; var direction = camera.direction; var up = camera.up; - if (!defined(position)) { - throw new DeveloperError('camera.position is required.'); - } - if (!defined(direction)) { - throw new DeveloperError('camera.direction is required.'); - } - if (!defined(up)) { - throw new DeveloperError('camera.up is required.'); - } + Check.typeOf.object('camera.position', position); + Check.typeOf.object('camera.direction', direction); + Check.typeOf.object('camera.up', up); Cartesian3.normalize(direction, fromCameraF); Cartesian3.normalize(Cartesian3.cross(fromCameraF, up, fromCameraR), fromCameraR); @@ -6776,21 +6529,11 @@ define('Core/Matrix4',[ * @exception {DeveloperError} far must be greater than zero. */ Matrix4.computePerspectiveFieldOfView = function(fovY, aspectRatio, near, far, result) { - if (fovY <= 0.0 || fovY > Math.PI) { - throw new DeveloperError('fovY must be in (0, PI].'); - } - if (aspectRatio <= 0.0) { - throw new DeveloperError('aspectRatio must be greater than zero.'); - } - if (near <= 0.0) { - throw new DeveloperError('near must be greater than zero.'); - } - if (far <= 0.0) { - throw new DeveloperError('far must be greater than zero.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThan('fovY', fovY, 0.0); + Check.typeOf.number.lessThan('fovY', fovY, Math.PI); + Check.typeOf.number.greaterThan('near', near, 0.0); + Check.typeOf.number.greaterThan('far', far, 0.0); + Check.typeOf.object('result', result); var bottom = Math.tan(fovY * 0.5); @@ -6831,27 +6574,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeOrthographicOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var a = 1.0 / (right - left); var b = 1.0 / (top - bottom); @@ -6896,27 +6625,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computePerspectiveOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -6957,24 +6672,12 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeInfinitePerspectiveOffCenter = function(left, right, bottom, top, near, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -7022,9 +6725,7 @@ define('Core/Matrix4',[ * }, 0.0, 1.0, new Cesium.Matrix4()); */ Matrix4.computeViewportTransformation = function(viewport, nearDepthRange, farDepthRange, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); viewport = defaultValue(viewport, defaultValue.EMPTY_OBJECT); var x = defaultValue(viewport.x, 0.0); @@ -7076,21 +6777,11 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeView = function(position, direction, up, right, result) { - if (!defined(position)) { - throw new DeveloperError('position is required'); - } - if (!defined(direction)) { - throw new DeveloperError('direction is required'); - } - if (!defined(up)) { - throw new DeveloperError('up is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); + Check.typeOf.object('up', up); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = right.x; result[1] = up.x; @@ -7131,9 +6822,7 @@ define('Core/Matrix4',[ * //creates a = [10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0] */ Matrix4.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], @@ -7177,12 +6866,11 @@ define('Core/Matrix4',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix4.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 3) { - throw new DeveloperError('row must be 0, 1, 2, or 3.'); - } - if (typeof column !== 'number' || column < 0 || column > 3) { - throw new DeveloperError('column must be 0, 1, 2, or 3.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 3); + + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 3); return column * 4 + row; }; @@ -7215,16 +6903,12 @@ define('Core/Matrix4',[ * // a.x = 12.0; a.y = 16.0; a.z = 20.0; a.w = 24.0; */ Matrix4.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var startIndex = index * 4; var x = matrix[startIndex]; @@ -7266,18 +6950,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 96.0, 25.0] */ Matrix4.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); var startIndex = index * 4; @@ -7298,15 +6977,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.setTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -7359,16 +7032,12 @@ define('Core/Matrix4',[ * // a.x = 18.0; a.y = 19.0; a.z = 20.0; a.w = 21.0; */ Matrix4.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 4]; @@ -7409,18 +7078,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 24.0, 25.0] */ Matrix4.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); result[index] = cartesian.x; @@ -7440,12 +7104,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter */ Matrix4.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[4], matrix[5], matrix[6], scratchColumn)); @@ -7470,22 +7130,16 @@ define('Core/Matrix4',[ /** * Computes the product of two matrices. - * - * @param {Matrix4} left The first matrix. - * @param {Matrix4} right The second matrix. - * @param {Matrix4} result The object onto which to store the result. - * @returns {Matrix4} The modified result parameter. - */ - Matrix4.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + * + * @param {Matrix4} left The first matrix. + * @param {Matrix4} right The second matrix. + * @param {Matrix4} result The object onto which to store the result. + * @returns {Matrix4} The modified result parameter. + */ + Matrix4.multiply = function(left, right, result) { + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -7569,15 +7223,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -7607,15 +7255,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -7656,15 +7298,9 @@ define('Core/Matrix4',[ * var m3 = Cesium.Matrix4.multiplyTransformation(m1, m2, new Cesium.Matrix4()); */ Matrix4.multiplyTransformation = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -7742,15 +7378,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByMatrix3(m, rotation, m); */ Matrix4.multiplyByMatrix3 = function(matrix, rotation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('result', result); var left0 = matrix[0]; var left1 = matrix[1]; @@ -7818,15 +7448,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByTranslation(m, position, m); */ Matrix4.multiplyByTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); var x = translation.x; var y = translation.y; @@ -7878,15 +7502,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByScale */ Matrix4.multiplyByUniformScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scale', scale); + Check.typeOf.object('result', result); uniformScaleScratch.x = scale; uniformScaleScratch.y = scale; @@ -7915,15 +7533,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByUniformScale */ Matrix4.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); var scaleX = scale.x; var scaleY = scale.y; @@ -7962,15 +7574,9 @@ define('Core/Matrix4',[ * @returns {Cartesian4} The modified result parameter. */ Matrix4.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8006,15 +7612,9 @@ define('Core/Matrix4',[ * // Cesium.Matrix4.multiplyByVector(matrix, new Cesium.Cartesian4(p.x, p.y, p.z, 0.0), result); */ Matrix4.multiplyByPointAsVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8044,16 +7644,9 @@ define('Core/Matrix4',[ * var result = Cesium.Matrix4.multiplyByPoint(matrix, p, new Cesium.Cartesian3()); */ Matrix4.multiplyByPoint = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8093,15 +7686,9 @@ define('Core/Matrix4',[ * // [-44.0, -46.0, -48.0, -50.0] */ Matrix4.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -8145,12 +7732,8 @@ define('Core/Matrix4',[ * // [-22.0, -23.0, -24.0, -25.0] */ Matrix4.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -8194,12 +7777,8 @@ define('Core/Matrix4',[ * // [13.0, 17.0, 21.0, 25.0] */ Matrix4.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var matrix1 = matrix[1]; var matrix2 = matrix[2]; @@ -8235,12 +7814,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -8354,9 +7929,7 @@ define('Core/Matrix4',[ * //Prints "Difference between both the matrices is not less than 0.1" on the console */ Matrix4.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -8387,12 +7960,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter. */ Matrix4.getTranslation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = matrix[12]; result.y = matrix[13]; @@ -8423,12 +7992,8 @@ define('Core/Matrix4',[ * // [12.0, 16.0, 20.0] */ Matrix4.getRotation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -8460,12 +8025,8 @@ define('Core/Matrix4',[ * @exception {RuntimeError} matrix is not invertible because its determinate is zero. */ Matrix4.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); // Special case for a zero scale matrix that can occur, for example, // when a model's node has a [0, 0, 0] scale. @@ -8603,12 +8164,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.inverseTransformation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); //This function is an optimized version of the below 4 lines. //var rT = Matrix3.transpose(Matrix4.getRotation(matrix)); @@ -8892,6 +8449,7 @@ define('Core/Matrix4',[ /*global define*/ define('Core/Rectangle',[ './Cartographic', + './Check', './defaultValue', './defined', './defineProperties', @@ -8901,6 +8459,7 @@ define('Core/Rectangle',[ './Math' ], function( Cartographic, + Check, defaultValue, defined, defineProperties, @@ -8997,13 +8556,8 @@ define('Core/Rectangle',[ * @returns {Number[]} The array that was packed into */ Rectangle.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -9024,9 +8578,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -9047,9 +8599,7 @@ define('Core/Rectangle',[ * @returns {Number} The width. */ Rectangle.computeWidth = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; if (east < west) { @@ -9064,9 +8614,7 @@ define('Core/Rectangle',[ * @returns {Number} The height. */ Rectangle.computeHeight = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); return rectangle.north - rectangle.south; }; @@ -9101,6 +8649,32 @@ define('Core/Rectangle',[ return result; }; + /** + * Creates an rectangle given the boundary longitude and latitude in radians. + * + * @param {Number} [west=0.0] The westernmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [south=0.0] The southernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Number} [east=0.0] The easternmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [north=0.0] The northernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Rectangle} [result] The object onto which to store the result, or undefined if a new instance should be created. + * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. + * + * @example + * var rectangle = Cesium.Rectangle.fromRadians(0.0, Math.PI/4, Math.PI/8, 3*Math.PI/4); + */ + Rectangle.fromRadians = function(west, south, east, north, result) { + if (!defined(result)) { + return new Rectangle(west, south, east, north); + } + + result.west = defaultValue(west, 0.0); + result.south = defaultValue(south, 0.0); + result.east = defaultValue(east, 0.0); + result.north = defaultValue(north, 0.0); + + return result; + }; + /** * Creates the smallest possible Rectangle that encloses all positions in the provided array. * @@ -9109,9 +8683,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartographicArray = function(cartographics, result) { - if (!defined(cartographics)) { - throw new DeveloperError('cartographics is required.'); - } + Check.defined('cartographics', cartographics); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -9164,9 +8736,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartesianArray = function(cartesians, ellipsoid, result) { - if (!defined(cartesians)) { - throw new DeveloperError('cartesians is required.'); - } + Check.defined('cartesians', cartesians); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -9282,9 +8852,7 @@ define('Core/Rectangle',[ * @returns {Boolean} <code>true</code> if the Rectangles are within the provided epsilon, <code>false</code> otherwise. */ Rectangle.prototype.equalsEpsilon = function(other, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon is required and must be a number.'); - } + Check.typeOf.number('epsilon', epsilon); return defined(other) && (Math.abs(this.west - other.west) <= epsilon) && @@ -9304,45 +8872,23 @@ define('Core/Rectangle',[ * @exception {DeveloperError} <code>west</code> must be in the interval [<code>-Pi</code>, <code>Pi</code>]. */ Rectangle.validate = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var north = rectangle.north; - if (typeof north !== 'number') { - throw new DeveloperError('north is required to be a number.'); - } - - if (north < -CesiumMath.PI_OVER_TWO || north > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('north must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('north', north, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('north', north, CesiumMath.PI_OVER_TWO); var south = rectangle.south; - if (typeof south !== 'number') { - throw new DeveloperError('south is required to be a number.'); - } - - if (south < -CesiumMath.PI_OVER_TWO || south > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('south must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('south', south, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('south', south, CesiumMath.PI_OVER_TWO); var west = rectangle.west; - if (typeof west !== 'number') { - throw new DeveloperError('west is required to be a number.'); - } - - if (west < -Math.PI || west > Math.PI) { - throw new DeveloperError('west must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('west', west, -Math.PI); + Check.typeOf.number.lessThanOrEquals('west', west, Math.PI); var east = rectangle.east; - if (typeof east !== 'number') { - throw new DeveloperError('east is required to be a number.'); - } - - if (east < -Math.PI || east > Math.PI) { - throw new DeveloperError('east must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('east', east, -Math.PI); + Check.typeOf.number.lessThanOrEquals('east', east, Math.PI); }; /** @@ -9353,9 +8899,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.south); @@ -9374,9 +8918,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.north); @@ -9395,9 +8937,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.north); @@ -9416,9 +8956,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.south); @@ -9437,9 +8975,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.center = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; @@ -9474,12 +9010,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.intersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var rectangleEast = rectangle.east; var rectangleWest = rectangle.west; @@ -9535,12 +9067,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.simpleIntersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var west = Math.max(rectangle.west, otherRectangle.west); var south = Math.max(rectangle.south, otherRectangle.south); @@ -9571,12 +9099,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.union = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); if (!defined(result)) { result = new Rectangle(); @@ -9620,12 +9144,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.expand = function(rectangle, cartographic, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); if (!defined(result)) { result = new Rectangle(); @@ -9647,12 +9167,8 @@ define('Core/Rectangle',[ * @returns {Boolean} true if the provided cartographic is inside the rectangle, false otherwise. */ Rectangle.contains = function(rectangle, cartographic) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); var longitude = cartographic.longitude; var latitude = cartographic.latitude; @@ -9685,9 +9201,7 @@ define('Core/Rectangle',[ * @returns {Cartesian3[]} The modified result parameter or a new Array of Cartesians instances if none was provided. */ Rectangle.subsample = function(rectangle, ellipsoid, surfaceHeight, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84); surfaceHeight = defaultValue(surfaceHeight, 0.0); @@ -9765,9 +9279,9 @@ define('Core/Rectangle',[ define('Core/BoundingSphere',[ './Cartesian3', './Cartographic', + './Check', './defaultValue', './defined', - './DeveloperError', './Ellipsoid', './GeographicProjection', './Intersect', @@ -9778,9 +9292,9 @@ define('Core/BoundingSphere',[ ], function( Cartesian3, Cartographic, + Check, defaultValue, defined, - DeveloperError, Ellipsoid, GeographicProjection, Intersect, @@ -10110,9 +9624,7 @@ define('Core/BoundingSphere',[ stride = defaultValue(stride, 3); - if (stride < 3) { - throw new DeveloperError('stride must be 3 or greater.'); - } + Check.typeOf.number.greaterThanOrEquals('stride', stride, 3); var currentPos = fromPointsCurrentPos; currentPos.x = positions[0] + center.x; @@ -10416,9 +9928,8 @@ define('Core/BoundingSphere',[ * var sphere = Cesium.BoundingSphere.fromCornerPoints(new Cesium.Cartesian3(-0.5, -0.5, -0.5), new Cesium.Cartesian3(0.5, 0.5, 0.5)); */ BoundingSphere.fromCornerPoints = function(corner, oppositeCorner, result) { - if (!defined(corner) || !defined(oppositeCorner)) { - throw new DeveloperError('corner and oppositeCorner are required.'); - } + Check.typeOf.object('corner', corner); + Check.typeOf.object('oppositeCorner', oppositeCorner); if (!defined(result)) { result = new BoundingSphere(); @@ -10442,9 +9953,7 @@ define('Core/BoundingSphere',[ * var boundingSphere = Cesium.BoundingSphere.fromEllipsoid(ellipsoid); */ BoundingSphere.fromEllipsoid = function(ellipsoid, result) { - if (!defined(ellipsoid)) { - throw new DeveloperError('ellipsoid is required.'); - } + Check.typeOf.object('ellipsoid', ellipsoid); if (!defined(result)) { result = new BoundingSphere(); @@ -10570,13 +10079,8 @@ define('Core/BoundingSphere',[ * @returns {Number[]} The array that was packed into */ BoundingSphere.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -10598,9 +10102,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if one was not provided. */ BoundingSphere.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -10627,13 +10129,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.union = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); if (!defined(result)) { result = new BoundingSphere(); @@ -10682,13 +10179,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.expand = function(sphere, point, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(point)) { - throw new DeveloperError('point is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('point', point); result = BoundingSphere.clone(sphere, result); @@ -10711,13 +10203,8 @@ define('Core/BoundingSphere',[ * intersects the plane. */ BoundingSphere.intersectPlane = function(sphere, plane) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(plane)) { - throw new DeveloperError('plane is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('plane', plane); var center = sphere.center; var radius = sphere.radius; @@ -10743,13 +10230,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.transform = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -10777,12 +10259,8 @@ define('Core/BoundingSphere',[ * }); */ BoundingSphere.distanceSquaredTo = function(sphere, cartesian) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('cartesian', cartesian); var diff = Cartesian3.subtract(sphere.center, cartesian, distanceSquaredToScratch); return Cartesian3.magnitudeSquared(diff) - sphere.radius * sphere.radius; @@ -10804,13 +10282,8 @@ define('Core/BoundingSphere',[ * var newBoundingSphere = Cesium.BoundingSphere.transformWithoutScale(boundingSphere, modelMatrix); */ BoundingSphere.transformWithoutScale = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -10837,17 +10310,9 @@ define('Core/BoundingSphere',[ * @returns {Interval} The nearest and farthest distances on the bounding sphere from position in direction. */ BoundingSphere.computePlaneDistances = function(sphere, position, direction, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(position)) { - throw new DeveloperError('position is required.'); - } - - if (!defined(direction)) { - throw new DeveloperError('direction is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); if (!defined(result)) { result = new Interval(); @@ -10882,9 +10347,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.projectTo2D = function(sphere, projection, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } + Check.typeOf.object('sphere', sphere); projection = defaultValue(projection, projectTo2DProjection); @@ -10979,12 +10442,8 @@ define('Core/BoundingSphere',[ * @returns {Boolean} <code>true</code> if the sphere is not visible; otherwise <code>false</code>. */ BoundingSphere.isOccluded = function(sphere, occluder) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(occluder)) { - throw new DeveloperError('occluder is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('occluder', occluder); return !occluder.isBoundingSphereVisible(sphere); }; @@ -12193,7 +11652,10 @@ define('Core/WebGLConstants',[ COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : 0x9279, TEXTURE_IMMUTABLE_FORMAT : 0x912F, MAX_ELEMENT_INDEX : 0x8D6B, - TEXTURE_IMMUTABLE_LEVELS : 0x82DF + TEXTURE_IMMUTABLE_LEVELS : 0x82DF, + + // Extensions + MAX_TEXTURE_MAX_ANISOTROPY_EXT : 0x84FF }; return freezeObject(WebGLConstants); @@ -12723,7 +12185,7 @@ define('Core/Geometry',[ * <li><code>position</code> - 3D vertex position. 64-bit floating-point (for precision). 3 components per attribute. See {@link VertexFormat#position}.</li> * <li><code>normal</code> - Normal (normalized), commonly used for lighting. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#normal}.</li> * <li><code>st</code> - 2D texture coordinate. 32-bit floating-point. 2 components per attribute. See {@link VertexFormat#st}.</li> - * <li><code>binormal</code> - Binormal (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#binormal}.</li> + * <li><code>bitangent</code> - Bitangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#bitangent}.</li> * <li><code>tangent</code> - Tangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#tangent}.</li> * </ul> * </p> @@ -12752,7 +12214,7 @@ define('Core/Geometry',[ * componentsPerAttribute : 3, * values : new Float32Array(0) * }); - * + * * @see GeometryAttribute * @see VertexFormat */ @@ -13033,7 +12495,7 @@ define('Core/GeometryAttributes',[ this.st = options.st; /** - * The binormal attribute (normalized), which is used for tangent-space effects like bump mapping. + * The bitangent attribute (normalized), which is used for tangent-space effects like bump mapping. * <p> * 32-bit floating-point. 3 components per attribute. * </p> @@ -13042,7 +12504,7 @@ define('Core/GeometryAttributes',[ * * @default undefined */ - this.binormal = options.binormal; + this.bitangent = options.bitangent; /** * The tangent attribute (normalized), which is used for tangent-space effects like bump mapping. @@ -13074,12 +12536,14 @@ define('Core/GeometryAttributes',[ /*global define*/ define('Core/Cartesian2',[ + './Check', './defaultValue', './defined', './DeveloperError', './freezeObject', './Math' ], function( + Check, defaultValue, defined, DeveloperError, @@ -13186,17 +12650,13 @@ define('Core/Cartesian2',[ * * @param {Cartesian2} value The value to pack. * @param {Number[]} array The array to pack into. - * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements. - * - * @returns {Number[]} The array that was packed into - */ - Cartesian2.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements. + * + * @returns {Number[]} The array that was packed into + */ + Cartesian2.pack = function(value, array, startingIndex) { + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -13215,9 +12675,7 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided. */ Cartesian2.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -13237,9 +12695,7 @@ define('Core/Cartesian2',[ * @returns {Number[]} The packed array. */ Cartesian2.packArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -13262,9 +12718,7 @@ define('Core/Cartesian2',[ * @returns {Cartesian2[]} The unpacked array. */ Cartesian2.unpackArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -13307,9 +12761,7 @@ define('Core/Cartesian2',[ * @returns {Number} The value of the maximum component. */ Cartesian2.maximumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y); }; @@ -13321,9 +12773,7 @@ define('Core/Cartesian2',[ * @returns {Number} The value of the minimum component. */ Cartesian2.minimumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y); }; @@ -13337,15 +12787,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} A cartesian with the minimum components. */ Cartesian2.minimumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); @@ -13363,15 +12807,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} A cartesian with the maximum components. */ Cartesian2.maximumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -13385,9 +12823,7 @@ define('Core/Cartesian2',[ * @returns {Number} The squared magnitude. */ Cartesian2.magnitudeSquared = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y; }; @@ -13453,12 +12889,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.normalize = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian2.magnitude(cartesian); @@ -13480,12 +12912,8 @@ define('Core/Cartesian2',[ * @returns {Number} The dot product. */ Cartesian2.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y; }; @@ -13499,15 +12927,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.multiplyComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -13523,15 +12945,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.divideComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x / right.x; result.y = left.y / right.y; @@ -13547,15 +12963,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -13571,15 +12981,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -13595,15 +12999,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.multiplyByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -13619,15 +13017,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.divideByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -13642,12 +13034,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.negate = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -13662,12 +13050,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.abs = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -13685,18 +13069,10 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian2.multiplyByScalar(end, t, lerpScratch); result = Cartesian2.multiplyByScalar(start, 1.0 - t, result); @@ -13713,12 +13089,8 @@ define('Core/Cartesian2',[ * @returns {Number} The angle between the Cartesians. */ Cartesian2.angleBetween = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian2.normalize(left, angleBetweenScratch); Cartesian2.normalize(right, angleBetweenScratch2); @@ -13734,12 +13106,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The most orthogonal axis. */ Cartesian2.mostOrthogonalAxis = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian2.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian2.abs(f, f); @@ -14247,6 +13615,118 @@ define('Core/barycentricCoordinates',[ return barycentricCoordinates; }); +/*global define*/ +define('Core/oneTimeWarning',[ + './defaultValue', + './defined', + './DeveloperError' + ], function( + defaultValue, + defined, + DeveloperError) { + "use strict"; + + var warnings = {}; + + /** + * Logs a one time message to the console. Use this function instead of + * <code>console.log</code> directly since this does not log duplicate messages + * unless it is called from multiple workers. + * + * @exports oneTimeWarning + * + * @param {String} identifier The unique identifier for this warning. + * @param {String} [message=identifier] The message to log to the console. + * + * @example + * for(var i=0;i<foo.length;++i) { + * if (!defined(foo[i].bar)) { + * // Something that can be recovered from but may happen a lot + * oneTimeWarning('foo.bar undefined', 'foo.bar is undefined. Setting to 0.'); + * foo[i].bar = 0; + * // ... + * } + * } + * + * @private + */ + function oneTimeWarning(identifier, message) { + if (!defined(identifier)) { + throw new DeveloperError('identifier is required.'); + } + + if (!defined(warnings[identifier])) { + warnings[identifier] = true; + console.warn(defaultValue(message, identifier)); + } + } + + oneTimeWarning.geometryOutlines = 'Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.'; + + return oneTimeWarning; +}); + +/*global define*/ +define('Core/deprecationWarning',[ + './defined', + './DeveloperError', + './oneTimeWarning' + ], function( + defined, + DeveloperError, + oneTimeWarning) { + 'use strict'; + + /** + * Logs a deprecation message to the console. Use this function instead of + * <code>console.log</code> directly since this does not log duplicate messages + * unless it is called from multiple workers. + * + * @exports deprecationWarning + * + * @param {String} identifier The unique identifier for this deprecated API. + * @param {String} message The message to log to the console. + * + * @example + * // Deprecated function or class + * function Foo() { + * deprecationWarning('Foo', 'Foo was deprecated in Cesium 1.01. It will be removed in 1.03. Use newFoo instead.'); + * // ... + * } + * + * // Deprecated function + * Bar.prototype.func = function() { + * deprecationWarning('Bar.func', 'Bar.func() was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newFunc() instead.'); + * // ... + * }; + * + * // Deprecated property + * defineProperties(Bar.prototype, { + * prop : { + * get : function() { + * deprecationWarning('Bar.prop', 'Bar.prop was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newProp instead.'); + * // ... + * }, + * set : function(value) { + * deprecationWarning('Bar.prop', 'Bar.prop was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newProp instead.'); + * // ... + * } + * } + * }); + * + * @private + */ + function deprecationWarning(identifier, message) { + if (!defined(identifier) || !defined(message)) { + throw new DeveloperError('identifier and message are required.'); + } + + oneTimeWarning(identifier, message); + } + + return deprecationWarning; +}); + /*global define*/ define('Core/EncodedCartesian3',[ './Cartesian3', @@ -15356,6 +14836,7 @@ define('Core/IntersectionTests',[ './defaultValue', './defined', './DeveloperError', + './Interval', './Math', './Matrix3', './QuadraticRealPolynomial', @@ -15367,6 +14848,7 @@ define('Core/IntersectionTests',[ defaultValue, defined, DeveloperError, + Interval, CesiumMath, Matrix3, QuadraticRealPolynomial, @@ -15638,7 +15120,7 @@ define('Core/IntersectionTests',[ function raySphere(ray, sphere, result) { if (!defined(result)) { - result = {}; + result = new Interval(); } var origin = ray.origin; @@ -15669,8 +15151,8 @@ define('Core/IntersectionTests',[ * * @param {Ray} ray The ray. * @param {BoundingSphere} sphere The sphere. - * @param {Object} [result] The result onto which to store the result. - * @returns {Object} An object with the first (<code>start</code>) and the second (<code>stop</code>) intersection scalars for points along the ray or undefined if there are no intersections. + * @param {Interval} [result] The result onto which to store the result. + * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections. */ IntersectionTests.raySphere = function(ray, sphere, result) { if (!defined(ray)) { @@ -15698,8 +15180,8 @@ define('Core/IntersectionTests',[ * @param {Cartesian3} p0 An end point of the line segment. * @param {Cartesian3} p1 The other end point of the line segment. * @param {BoundingSphere} sphere The sphere. - * @param {Object} [result] The result onto which to store the result. - * @returns {Object} An object with the first (<code>start</code>) and the second (<code>stop</code>) intersection scalars for points along the line segment or undefined if there are no intersections. + * @param {Interval} [result] The result onto which to store the result. + * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections. */ IntersectionTests.lineSegmentSphere = function(p0, p1, sphere, result) { if (!defined(p0)) { @@ -15737,7 +15219,7 @@ define('Core/IntersectionTests',[ * * @param {Ray} ray The ray. * @param {Ellipsoid} ellipsoid The ellipsoid. - * @returns {Object} An object with the first (<code>start</code>) and the second (<code>stop</code>) intersection scalars for points along the ray or undefined if there are no intersections. + * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections. */ IntersectionTests.rayEllipsoid = function(ray, ellipsoid) { if (!defined(ray)) { @@ -15779,10 +15261,7 @@ define('Core/IntersectionTests',[ var root0 = temp / w2; var root1 = difference / temp; if (root0 < root1) { - return { - start : root0, - stop : root1 - }; + return new Interval(root0, root1); } return { @@ -15792,10 +15271,7 @@ define('Core/IntersectionTests',[ } else { // qw2 == product. Repeated roots (2 intersections). var root = Math.sqrt(difference / w2); - return { - start : root, - stop : root - }; + return new Interval(root, root); } } else if (q2 < 1.0) { // Inside ellipsoid (2 intersections). @@ -15805,19 +15281,13 @@ define('Core/IntersectionTests',[ discriminant = qw * qw - product; temp = -qw + Math.sqrt(discriminant); // Positively valued. - return { - start : 0.0, - stop : temp / w2 - }; + return new Interval(0.0, temp / w2); } else { // q2 == 1.0. On ellipsoid. if (qw < 0.0) { // Looking inward. w2 = Cartesian3.magnitudeSquared(w); - return { - start : 0.0, - stop : -qw / w2 - }; + return new Interval(0.0, -qw / w2); } // qw >= 0.0. Looking outward or tangent. @@ -16726,6 +16196,7 @@ define('Core/GeometryPipeline',[ './ComponentDatatype', './defaultValue', './defined', + './deprecationWarning', './DeveloperError', './EncodedCartesian3', './GeographicProjection', @@ -16752,6 +16223,7 @@ define('Core/GeometryPipeline',[ ComponentDatatype, defaultValue, defined, + deprecationWarning, DeveloperError, EncodedCartesian3, GeographicProjection, @@ -16885,7 +16357,7 @@ define('Core/GeometryPipeline',[ /** * Creates a new {@link Geometry} with <code>LINES</code> representing the provided * attribute (<code>attributeName</code>) for the provided geometry. This is used to - * visualize vector attributes like normals, binormals, and tangents. + * visualize vector attributes like normals, tangents, and bitangents. * * @param {Geometry} geometry The <code>Geometry</code> instance with the attribute. * @param {String} [attributeName='normal'] The name of the attribute. @@ -16895,7 +16367,7 @@ define('Core/GeometryPipeline',[ * @exception {DeveloperError} geometry.attributes must have an attribute with the same name as the attributeName parameter. * * @example - * var geometry = Cesium.GeometryPipeline.createLineSegmentsForVectors(instance.geometry, 'binormal', 100000.0); + * var geometry = Cesium.GeometryPipeline.createLineSegmentsForVectors(instance.geometry, 'bitangent', 100000.0); */ GeometryPipeline.createLineSegmentsForVectors = function(geometry, attributeName, length) { attributeName = defaultValue(attributeName, 'normal'); @@ -16987,8 +16459,11 @@ define('Core/GeometryPipeline',[ // From VertexFormat 'normal', 'st', - 'binormal', 'tangent', + 'bitangent', + + // For shadow volumes + 'extrudeDirection', // From compressing texture coordinates and normals 'compressedAttributes' @@ -17030,7 +16505,7 @@ define('Core/GeometryPipeline',[ * * @example * geometry = Cesium.GeometryPipeline.reorderForPreVertexCache(geometry); - * + * * @see GeometryPipeline.reorderForPostVertexCache */ GeometryPipeline.reorderForPreVertexCache = function(geometry) { @@ -17115,7 +16590,7 @@ define('Core/GeometryPipeline',[ * * @example * geometry = Cesium.GeometryPipeline.reorderForPostVertexCache(geometry); - * + * * @see GeometryPipeline.reorderForPreVertexCache * @see {@link http://gfx.cs.princ0eton.edu/pubs/Sander_2007_%3ETR/tipsy.pdf|Fast Triangle Reordering for Vertex Locality and Reduced Overdraw} * by Sander, Nehab, and Barczak @@ -17467,7 +16942,7 @@ define('Core/GeometryPipeline',[ * Transforms a geometry instance to world coordinates. This changes * the instance's <code>modelMatrix</code> to {@link Matrix4.IDENTITY} and transforms the * following attributes if they are present: <code>position</code>, <code>normal</code>, - * <code>binormal</code>, and <code>tangent</code>. + * <code>tangent</code>, and <code>bitangent</code>. * * @param {GeometryInstance} instance The geometry instance to modify. * @returns {GeometryInstance} The modified <code>instance</code> argument, with its attributes transforms to world coordinates. @@ -17495,16 +16970,16 @@ define('Core/GeometryPipeline',[ transformPoint(modelMatrix, attributes.nextPosition); if ((defined(attributes.normal)) || - (defined(attributes.binormal)) || - (defined(attributes.tangent))) { + (defined(attributes.tangent)) || + (defined(attributes.bitangent))) { Matrix4.inverse(modelMatrix, inverseTranspose); Matrix4.transpose(inverseTranspose, inverseTranspose); Matrix4.getRotation(inverseTranspose, normalMatrix); transformVector(normalMatrix, attributes.normal); - transformVector(normalMatrix, attributes.binormal); transformVector(normalMatrix, attributes.tangent); + transformVector(normalMatrix, attributes.bitangent); } var boundingSphere = instance.geometry.boundingSphere; @@ -17694,7 +17169,7 @@ define('Core/GeometryPipeline',[ * <p> * This is used by {@link Primitive} to efficiently render a large amount of static data. * </p> - * + * * @private * * @param {GeometryInstance[]} [instances] The array of {@link GeometryInstance} objects whose geometry will be combined. @@ -17710,7 +17185,7 @@ define('Core/GeometryPipeline',[ * Cesium.GeometryPipeline.transformToWorldCoordinates(instances[i]); * } * var geometries = Cesium.GeometryPipeline.combineInstances(instances); - * + * * @see GeometryPipeline.transformToWorldCoordinates */ GeometryPipeline.combineInstances = function(instances) { @@ -17886,8 +17361,8 @@ define('Core/GeometryPipeline',[ var tScratch = new Cartesian3(); /** - * Computes per-vertex binormals and tangents for a geometry containing <code>TRIANGLES</code>. - * The result is new <code>binormal</code> and <code>tangent</code> attributes added to the geometry. + * Computes per-vertex tangents and bitangents for a geometry containing <code>TRIANGLES</code>. + * The result is new <code>tangent</code> and <code>bitangent</code> attributes added to the geometry. * This assumes a counter-clockwise winding order. * <p> * Based on <a href="http://www.terathon.com/code/tangent.html">Computing Tangent Space Basis Vectors @@ -17895,15 +17370,15 @@ define('Core/GeometryPipeline',[ * </p> * * @param {Geometry} geometry The geometry to modify. - * @returns {Geometry} The modified <code>geometry</code> argument with the computed <code>binormal</code> and <code>tangent</code> attributes. + * @returns {Geometry} The modified <code>geometry</code> argument with the computed <code>tangent</code> and <code>bitangent</code> attributes. * * @exception {DeveloperError} geometry.indices length must be greater than 0 and be a multiple of 3. * @exception {DeveloperError} geometry.primitiveType must be {@link PrimitiveType.TRIANGLES}. * * @example - * Cesium.GeometryPipeline.computeBinormalAndTangent(geometry); + * Cesium.GeometryPipeline.computeTangentAndBiTangent(geometry); */ - GeometryPipeline.computeBinormalAndTangent = function(geometry) { + GeometryPipeline.computeTangentAndBitangent = function(geometry) { if (!defined(geometry)) { throw new DeveloperError('geometry is required.'); } @@ -17983,8 +17458,8 @@ define('Core/GeometryPipeline',[ tan1[i23 + 2] += sdirz; } - var binormalValues = new Float32Array(numVertices * 3); var tangentValues = new Float32Array(numVertices * 3); + var bitangentValues = new Float32Array(numVertices * 3); for (i = 0; i < numVertices; i++) { i03 = i * 3; @@ -18003,9 +17478,9 @@ define('Core/GeometryPipeline',[ Cartesian3.normalize(Cartesian3.cross(n, t, t), t); - binormalValues[i03] = t.x; - binormalValues[i13] = t.y; - binormalValues[i23] = t.z; + bitangentValues[i03] = t.x; + bitangentValues[i13] = t.y; + bitangentValues[i23] = t.z; } geometry.attributes.tangent = new GeometryAttribute({ @@ -18014,20 +17489,48 @@ define('Core/GeometryPipeline',[ values : tangentValues }); - geometry.attributes.binormal = new GeometryAttribute({ + geometry.attributes.bitangent = new GeometryAttribute({ componentDatatype : ComponentDatatype.FLOAT, componentsPerAttribute : 3, - values : binormalValues + values : bitangentValues }); return geometry; }; + /** + * Computes per-vertex binormal and tangents for a geometry containing <code>TRIANGLES</code>. + * The result is new <code>binormal</code> and <code>tangent</code> attributes added to the geometry. + * This assumes a counter-clockwise winding order. + * <p> + * Based on <a href="http://www.terathon.com/code/tangent.html">Computing Tangent Space Basis Vectors + * for an Arbitrary Mesh</a> by Eric Lengyel. + * </p> + * + * @param {Geometry} geometry The geometry to modify. + * @returns {Geometry} The modified <code>geometry</code> argument with the computed <code>binormal</code> and <code>tangent</code> attributes. + * + * @exception {DeveloperError} geometry.indices length must be greater than 0 and be a multiple of 3. + * @exception {DeveloperError} geometry.primitiveType must be {@link PrimitiveType.TRIANGLES}. + * + * @example + * Cesium.GeometryPipeline.computeBinormalAndTangent(geometry); + * + * @see GeometryPipeline.computeTangentAndBitangent + */ + GeometryPipeline.computeBinormalAndTangent = function(geometry) { + deprecationWarning('computeBinormalAndTangent', 'computeBinormalAndTangent was deprecated in 1.30. It will be removed in 1.31. Use a computeTangentAndBitangent.'); + GeometryPipeline.computeTangentAndBitangent(geometry); + geometry.attributes.binormal = geometry.attributes.bitangent; + + return geometry; + }; + var scratchCartesian2 = new Cartesian2(); var toEncode1 = new Cartesian3(); var toEncode2 = new Cartesian3(); var toEncode3 = new Cartesian3(); - + var encodeResult2 = new Cartesian2(); /** * Compresses and packs geometry normal attribute values to save memory. * @@ -18042,73 +17545,109 @@ define('Core/GeometryPipeline',[ throw new DeveloperError('geometry is required.'); } + var extrudeAttribute = geometry.attributes.extrudeDirection; + var i; + var numVertices; + if (defined(extrudeAttribute)) { + //only shadow volumes use extrudeDirection, and shadow volumes use vertexFormat: POSITION_ONLY so we don't need to check other attributes + var extrudeDirections = extrudeAttribute.values; + numVertices = extrudeDirections.length / 3.0; + var compressedDirections = new Float32Array(numVertices * 2); + + var i2 = 0; + for (i = 0; i < numVertices; ++i) { + Cartesian3.fromArray(extrudeDirections, i * 3.0, toEncode1); + if (Cartesian3.equals(toEncode1, Cartesian3.ZERO)) { + i2 += 2; + continue; + } + encodeResult2 = AttributeCompression.octEncodeInRange(toEncode1, 65535, encodeResult2); + compressedDirections[i2++] = encodeResult2.x; + compressedDirections[i2++] = encodeResult2.y; + } + + geometry.attributes.compressedAttributes = new GeometryAttribute({ + componentDatatype : ComponentDatatype.FLOAT, + componentsPerAttribute : 2, + values : compressedDirections + }); + delete geometry.attributes.extrudeDirection; + return geometry; + } + var normalAttribute = geometry.attributes.normal; var stAttribute = geometry.attributes.st; - if (!defined(normalAttribute) && !defined(stAttribute)) { + + var hasNormal = defined(normalAttribute); + var hasSt = defined(stAttribute); + if (!hasNormal && !hasSt) { return geometry; } var tangentAttribute = geometry.attributes.tangent; - var binormalAttribute = geometry.attributes.binormal; + var bitangentAttribute = geometry.attributes.bitangent; + + var hasTangent = defined(tangentAttribute); + var hasBitangent = defined(bitangentAttribute); var normals; var st; var tangents; - var binormals; + var bitangents; - if (defined(normalAttribute)) { + if (hasNormal) { normals = normalAttribute.values; } - if (defined(stAttribute)) { + if (hasSt) { st = stAttribute.values; } - if (defined(tangentAttribute)) { + if (hasTangent) { tangents = tangentAttribute.values; } - if (binormalAttribute) { - binormals = binormalAttribute.values; + if (hasBitangent) { + bitangents = bitangentAttribute.values; } - var length = defined(normals) ? normals.length : st.length; - var numComponents = defined(normals) ? 3.0 : 2.0; - var numVertices = length / numComponents; + var length = hasNormal ? normals.length : st.length; + var numComponents = hasNormal ? 3.0 : 2.0; + numVertices = length / numComponents; var compressedLength = numVertices; - var numCompressedComponents = defined(st) && defined(normals) ? 2.0 : 1.0; - numCompressedComponents += defined(tangents) || defined(binormals) ? 1.0 : 0.0; + var numCompressedComponents = hasSt && hasNormal ? 2.0 : 1.0; + numCompressedComponents += hasTangent || hasBitangent ? 1.0 : 0.0; compressedLength *= numCompressedComponents; var compressedAttributes = new Float32Array(compressedLength); var normalIndex = 0; - for (var i = 0; i < numVertices; ++i) { - if (defined(st)) { + for (i = 0; i < numVertices; ++i) { + if (hasSt) { Cartesian2.fromArray(st, i * 2.0, scratchCartesian2); compressedAttributes[normalIndex++] = AttributeCompression.compressTextureCoordinates(scratchCartesian2); } var index = i * 3.0; - if (defined(normals) && defined(tangents) && defined(binormals)) { + if (hasNormal && defined(tangents) && defined(bitangents)) { Cartesian3.fromArray(normals, index, toEncode1); Cartesian3.fromArray(tangents, index, toEncode2); - Cartesian3.fromArray(binormals, index, toEncode3); + Cartesian3.fromArray(bitangents, index, toEncode3); AttributeCompression.octPack(toEncode1, toEncode2, toEncode3, scratchCartesian2); compressedAttributes[normalIndex++] = scratchCartesian2.x; compressedAttributes[normalIndex++] = scratchCartesian2.y; } else { - if (defined(normals)) { + if (hasNormal) { Cartesian3.fromArray(normals, index, toEncode1); compressedAttributes[normalIndex++] = AttributeCompression.octEncodeFloat(toEncode1); } - if (defined(tangents)) { + if (hasTangent) { Cartesian3.fromArray(tangents, index, toEncode1); compressedAttributes[normalIndex++] = AttributeCompression.octEncodeFloat(toEncode1); } - if (defined(binormals)) { - Cartesian3.fromArray(binormals, index, toEncode1); + if (hasBitangent) { + Cartesian3.fromArray(bitangents, index, toEncode1); compressedAttributes[normalIndex++] = AttributeCompression.octEncodeFloat(toEncode1); } } @@ -18120,17 +17659,17 @@ define('Core/GeometryPipeline',[ values : compressedAttributes }); - if (defined(normals)) { + if (hasNormal) { delete geometry.attributes.normal; } - if (defined(st)) { + if (hasSt) { delete geometry.attributes.st; } - if (defined(tangents)) { - delete geometry.attributes.tangent; + if (hasBitangent) { + delete geometry.attributes.bitangent; } - if (defined(binormals)) { - delete geometry.attributes.binormal; + if (hasTangent) { + delete geometry.attributes.tangent; } return geometry; @@ -18547,8 +18086,8 @@ define('Core/GeometryPipeline',[ var s1Scratch = new Cartesian2(); var s2Scratch = new Cartesian2(); - function computeTriangleAttributes(i0, i1, i2, point, positions, normals, binormals, tangents, texCoords, currentAttributes, insertedIndex) { - if (!defined(normals) && !defined(binormals) && !defined(tangents) && !defined(texCoords)) { + function computeTriangleAttributes(i0, i1, i2, point, positions, normals, tangents, bitangents, texCoords, extrudeDirections, currentAttributes, insertedIndex) { + if (!defined(normals) && !defined(tangents) && !defined(bitangents) && !defined(texCoords) && !defined(extrudeDirections)) { return; } @@ -18573,20 +18112,27 @@ define('Core/GeometryPipeline',[ Cartesian3.pack(normal, currentAttributes.normal.values, insertedIndex * 3); } - if (defined(binormals)) { - var b0 = Cartesian3.fromArray(binormals, i0 * 3, p0Scratch); - var b1 = Cartesian3.fromArray(binormals, i1 * 3, p1Scratch); - var b2 = Cartesian3.fromArray(binormals, i2 * 3, p2Scratch); - - Cartesian3.multiplyByScalar(b0, coords.x, b0); - Cartesian3.multiplyByScalar(b1, coords.y, b1); - Cartesian3.multiplyByScalar(b2, coords.z, b2); + if (defined(extrudeDirections)) { + var d0 = Cartesian3.fromArray(extrudeDirections, i0 * 3, p0Scratch); + var d1 = Cartesian3.fromArray(extrudeDirections, i1 * 3, p1Scratch); + var d2 = Cartesian3.fromArray(extrudeDirections, i2 * 3, p2Scratch); - var binormal = Cartesian3.add(b0, b1, b0); - Cartesian3.add(binormal, b2, binormal); - Cartesian3.normalize(binormal, binormal); + Cartesian3.multiplyByScalar(d0, coords.x, d0); + Cartesian3.multiplyByScalar(d1, coords.y, d1); + Cartesian3.multiplyByScalar(d2, coords.z, d2); - Cartesian3.pack(binormal, currentAttributes.binormal.values, insertedIndex * 3); + var direction; + if (!Cartesian3.equals(d0, Cartesian3.ZERO) || !Cartesian3.equals(d1, Cartesian3.ZERO) || !Cartesian3.equals(d2, Cartesian3.ZERO)) { + direction = Cartesian3.add(d0, d1, d0); + Cartesian3.add(direction, d2, direction); + Cartesian3.normalize(direction, direction); + } else { + direction = p0Scratch; + direction.x = 0; + direction.y = 0; + direction.z = 0; + } + Cartesian3.pack(direction, currentAttributes.extrudeDirection.values, insertedIndex * 3); } if (defined(tangents)) { @@ -18605,6 +18151,22 @@ define('Core/GeometryPipeline',[ Cartesian3.pack(tangent, currentAttributes.tangent.values, insertedIndex * 3); } + if (defined(bitangents)) { + var b0 = Cartesian3.fromArray(bitangents, i0 * 3, p0Scratch); + var b1 = Cartesian3.fromArray(bitangents, i1 * 3, p1Scratch); + var b2 = Cartesian3.fromArray(bitangents, i2 * 3, p2Scratch); + + Cartesian3.multiplyByScalar(b0, coords.x, b0); + Cartesian3.multiplyByScalar(b1, coords.y, b1); + Cartesian3.multiplyByScalar(b2, coords.z, b2); + + var bitangent = Cartesian3.add(b0, b1, b0); + Cartesian3.add(bitangent, b2, bitangent); + Cartesian3.normalize(bitangent, bitangent); + + Cartesian3.pack(bitangent, currentAttributes.bitangent.values, insertedIndex * 3); + } + if (defined(texCoords)) { var s0 = Cartesian2.fromArray(texCoords, i0 * 2, s0Scratch); var s1 = Cartesian2.fromArray(texCoords, i1 * 2, s1Scratch); @@ -18649,9 +18211,10 @@ define('Core/GeometryPipeline',[ var attributes = geometry.attributes; var positions = attributes.position.values; var normals = (defined(attributes.normal)) ? attributes.normal.values : undefined; - var binormals = (defined(attributes.binormal)) ? attributes.binormal.values : undefined; + var bitangents = (defined(attributes.bitangent)) ? attributes.bitangent.values : undefined; var tangents = (defined(attributes.tangent)) ? attributes.tangent.values : undefined; var texCoords = (defined(attributes.st)) ? attributes.st.values : undefined; + var extrudeDirections = (defined(attributes.extrudeDirection)) ? attributes.extrudeDirection.values : undefined; var indices = geometry.indices; var eastGeometry = copyGeometryForSplit(geometry); @@ -18705,7 +18268,7 @@ define('Core/GeometryPipeline',[ } insertedIndex = insertSplitPoint(currentAttributes, currentIndices, currentIndexMap, indices, resultIndex < 3 ? i + resultIndex : -1, point); - computeTriangleAttributes(i0, i1, i2, point, positions, normals, binormals, tangents, texCoords, currentAttributes, insertedIndex); + computeTriangleAttributes(i0, i1, i2, point, positions, normals, tangents, bitangents, texCoords, extrudeDirections, currentAttributes, insertedIndex); } } else { if (defined(result)) { @@ -18725,13 +18288,13 @@ define('Core/GeometryPipeline',[ } insertedIndex = insertSplitPoint(currentAttributes, currentIndices, currentIndexMap, indices, i, p0); - computeTriangleAttributes(i0, i1, i2, p0, positions, normals, binormals, tangents, texCoords, currentAttributes, insertedIndex); + computeTriangleAttributes(i0, i1, i2, p0, positions, normals, tangents, bitangents, texCoords, extrudeDirections, currentAttributes, insertedIndex); insertedIndex = insertSplitPoint(currentAttributes, currentIndices, currentIndexMap, indices, i + 1, p1); - computeTriangleAttributes(i0, i1, i2, p1, positions, normals, binormals, tangents, texCoords, currentAttributes, insertedIndex); + computeTriangleAttributes(i0, i1, i2, p1, positions, normals, tangents, bitangents, texCoords, extrudeDirections, currentAttributes, insertedIndex); insertedIndex = insertSplitPoint(currentAttributes, currentIndices, currentIndexMap, indices, i + 2, p2); - computeTriangleAttributes(i0, i1, i2, p2, positions, normals, binormals, tangents, texCoords, currentAttributes, insertedIndex); + computeTriangleAttributes(i0, i1, i2, p2, positions, normals, tangents, bitangents, texCoords, extrudeDirections, currentAttributes, insertedIndex); } } diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createBoxGeometry.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createBoxGeometry.js index 61250b9a..5d71bcfb 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createBoxGeometry.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createBoxGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,68 +45,6 @@ define('Core/defined',[],function() { return defined; }); -/*global define*/ -define('Core/freezeObject',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Freezes an object, using Object.freeze if available, otherwise returns - * the object unchanged. This function should be used in setup code to prevent - * errors from completely halting JavaScript execution in legacy browsers. - * - * @private - * - * @exports freezeObject - */ - var freezeObject = Object.freeze; - if (!defined(freezeObject)) { - freezeObject = function(o) { - return o; - }; - } - - return freezeObject; -}); - -/*global define*/ -define('Core/defaultValue',[ - './freezeObject' - ], function( - freezeObject) { - 'use strict'; - - /** - * Returns the first parameter if not undefined, otherwise the second parameter. - * Useful for setting a default value for a parameter. - * - * @exports defaultValue - * - * @param {*} a - * @param {*} b - * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter. - * - * @example - * param = Cesium.defaultValue(param, 'default'); - */ - function defaultValue(a, b) { - if (a !== undefined) { - return a; - } - return b; - } - - /** - * A frozen empty object that can be used as the default value for options passed as - * an object literal. - */ - defaultValue.EMPTY_OBJECT = freezeObject({}); - - return defaultValue; -}); - /*global define*/ define('Core/DeveloperError',[ './defined' @@ -188,41 +126,13 @@ define('Core/DeveloperError',[ return DeveloperError; }); -/*global define*/ -define('Core/isArray',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Tests an object to see if it is an array. - * @exports isArray - * - * @param {Object} value The value to test. - * @returns {Boolean} true if the value is an array, false otherwise. - */ - var isArray = Array.isArray; - if (!defined(isArray)) { - isArray = function(value) { - return Object.prototype.toString.call(value) === '[object Array]'; - }; - } - - return isArray; -}); - /*global define*/ define('Core/Check',[ - './defaultValue', - './defined', - './DeveloperError', - './isArray' + './defined', + './DeveloperError' ], function( - defaultValue, defined, - DeveloperError, - isArray) { + DeveloperError) { 'use strict'; /** @@ -237,111 +147,134 @@ define('Core/Check',[ */ Check.typeOf = {}; - /** - * Contains functions for checking numeric conditions such as minimum and maximum values - */ - Check.numeric = {}; - function getUndefinedErrorMessage(name) { - return name + ' was required but undefined.'; + return name + ' is required, actual value was undefined'; } function getFailedTypeErrorMessage(actual, expected, name) { - return 'Expected ' + name + ' to be typeof ' + expected + ', got ' + actual; + return 'Expected ' + name + ' to be typeof ' + expected + ', actual typeof was ' + actual; } /** * Throws if test is not defined * - * @param {*} test The value that is to be checked * @param {String} name The name of the variable being tested + * @param {*} test The value that is to be checked * @exception {DeveloperError} test must be defined */ - Check.defined = function (test, name) { + Check.defined = function (name, test) { if (!defined(test)) { throw new DeveloperError(getUndefinedErrorMessage(name)); } }; /** - * Throws if test is greater than maximum + * Throws if test is not typeof 'function' * - * @param {Number} test The value to test - * @param {Number} maximum The maximum allowed value - * @exception {DeveloperError} test must not be greater than maximum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'function' */ - Check.numeric.maximum = function (test, maximum) { - Check.typeOf.number(test); - Check.typeOf.number(maximum); - if (test > maximum) { - throw new DeveloperError('Expected ' + test + ' to be at most ' + maximum); + Check.typeOf.func = function (name, test) { + if (typeof test !== 'function') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); } }; /** - * Throws if test is less than minimum + * Throws if test is not typeof 'string' * - * @param {Number} test The value to test - * @param {Number} minimum The minimum allowed value - * @exception {DeveloperError} test must not be less than mininum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'string' */ - Check.numeric.minimum = function (test, minimum) { - Check.typeOf.number(test); - Check.typeOf.number(minimum); - if (test < minimum) { - throw new DeveloperError('Expected ' + test + ' to be at least ' + minimum); + Check.typeOf.string = function (name, test) { + if (typeof test !== 'string') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); } }; /** - * Throws if test is not typeof 'function' + * Throws if test is not typeof 'number' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'function' + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'number' */ - Check.typeOf.function = function (test, name) { - if (typeof test !== 'function') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); + Check.typeOf.number = function (name, test) { + if (typeof test !== 'number') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); } }; /** - * Throws if test is not typeof 'string' + * Throws if test is not typeof 'number' and less than limit * + * @param {String} name The name of the variable being tested * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than limit + */ + Check.typeOf.number.lessThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test >= limit) { + throw new DeveloperError('Expected ' + name + ' to be less than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and less than or equal to limit + * * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'string' + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than or equal to limit */ - Check.typeOf.string = function (test, name) { - if (typeof test !== 'string') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); + Check.typeOf.number.lessThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test > limit) { + throw new DeveloperError('Expected ' + name + ' to be less than or equal to ' + limit + ', actual value was ' + test); } }; /** - * Throws if test is not typeof 'number' + * Throws if test is not typeof 'number' and greater than limit * + * @param {String} name The name of the variable being tested * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than limit + */ + Check.typeOf.number.greaterThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test <= limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and greater than or equal to limit + * * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'number' + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than or equal to limit */ - Check.typeOf.number = function (test, name) { - if (typeof test !== 'number') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); + Check.typeOf.number.greaterThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test < limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than or equal to' + limit + ', actual value was ' + test); } }; /** * Throws if test is not typeof 'object' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested + * @param {*} test The value to test * @exception {DeveloperError} test must be typeof 'object' */ - Check.typeOf.object = function (test, name) { + Check.typeOf.object = function (name, test) { if (typeof test !== 'object') { throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'object', name)); } @@ -350,11 +283,11 @@ define('Core/Check',[ /** * Throws if test is not typeof 'boolean' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested + * @param {*} test The value to test * @exception {DeveloperError} test must be typeof 'boolean' */ - Check.typeOf.boolean = function (test, name) { + Check.typeOf.bool = function (name, test) { if (typeof test !== 'boolean') { throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'boolean', name)); } @@ -363,6 +296,68 @@ define('Core/Check',[ return Check; }); +/*global define*/ +define('Core/freezeObject',[ + './defined' + ], function( + defined) { + 'use strict'; + + /** + * Freezes an object, using Object.freeze if available, otherwise returns + * the object unchanged. This function should be used in setup code to prevent + * errors from completely halting JavaScript execution in legacy browsers. + * + * @private + * + * @exports freezeObject + */ + var freezeObject = Object.freeze; + if (!defined(freezeObject)) { + freezeObject = function(o) { + return o; + }; + } + + return freezeObject; +}); + +/*global define*/ +define('Core/defaultValue',[ + './freezeObject' + ], function( + freezeObject) { + 'use strict'; + + /** + * Returns the first parameter if not undefined, otherwise the second parameter. + * Useful for setting a default value for a parameter. + * + * @exports defaultValue + * + * @param {*} a + * @param {*} b + * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter. + * + * @example + * param = Cesium.defaultValue(param, 'default'); + */ + function defaultValue(a, b) { + if (a !== undefined) { + return a; + } + return b; + } + + /** + * A frozen empty object that can be used as the default value for options passed as + * an object literal. + */ + defaultValue.EMPTY_OBJECT = freezeObject({}); + + return defaultValue; +}); + /* I've wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace so it's better encapsulated. Now you can have multiple random number generators @@ -1047,7 +1042,7 @@ define('Core/Math',[ if (!defined(angle)) { throw new DeveloperError('angle is required.'); } - + return CesiumMath.clamp(angle, -1*CesiumMath.PI_OVER_TWO, CesiumMath.PI_OVER_TWO); }; @@ -1057,11 +1052,11 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [<code>-CesiumMath.PI</code>, <code>CesiumMath.PI</code>]. */ - CesiumMath.negativePiToPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.negativePiToPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - return CesiumMath.zeroToTwoPi(x + CesiumMath.PI) - CesiumMath.PI; + return CesiumMath.zeroToTwoPi(angle + CesiumMath.PI) - CesiumMath.PI; }; /** @@ -1070,12 +1065,12 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [0, <code>CesiumMath.TWO_PI</code>]. */ - CesiumMath.zeroToTwoPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.zeroToTwoPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - var mod = CesiumMath.mod(x, CesiumMath.TWO_PI); - if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(x) > CesiumMath.EPSILON14) { + var mod = CesiumMath.mod(angle, CesiumMath.TWO_PI); + if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(angle) > CesiumMath.EPSILON14) { return CesiumMath.TWO_PI; } return mod; @@ -1145,7 +1140,7 @@ define('Core/Math',[ * @example * //Compute 7!, which is equal to 5040 * var computedFactorial = Cesium.Math.factorial(7); - * + * * @see {@link http://en.wikipedia.org/wiki/Factorial|Factorial on Wikipedia} */ CesiumMath.factorial = function(n) { @@ -1429,7 +1424,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.fromSpherical = function(spherical, result) { - Check.typeOf.object(spherical, 'spherical'); + Check.typeOf.object('spherical', spherical); if (!defined(result)) { result = new Cartesian3(); @@ -1513,8 +1508,8 @@ define('Core/Cartesian3',[ * @returns {Number[]} The array that was packed into */ Cartesian3.pack = function(value, array, startingIndex) { - Check.typeOf.object(value, 'value'); - Check.defined(array, 'array'); + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1534,7 +1529,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.unpack = function(array, startingIndex, result) { - Check.defined(array, 'array'); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1555,7 +1550,7 @@ define('Core/Cartesian3',[ * @returns {Number[]} The packed array. */ Cartesian3.packArray = function(array, result) { - Check.defined(array, 'array'); + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -1578,8 +1573,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3[]} The unpacked array. */ Cartesian3.unpackArray = function(array, result) { - Check.defined(array, 'array'); - Check.numeric.minimum(array.length, 3); + Check.defined('array', array); + Check.typeOf.number.greaterThanOrEquals('array.length', array.length, 3); if (array.length % 3 !== 0) { throw new DeveloperError('array length must be a multiple of 3.'); } @@ -1625,7 +1620,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the maximum component. */ Cartesian3.maximumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z); }; @@ -1637,7 +1632,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the minimum component. */ Cartesian3.minimumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z); }; @@ -1651,9 +1646,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the minimum components. */ Cartesian3.minimumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -1671,9 +1666,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the maximum components. */ Cartesian3.maximumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -1688,7 +1683,7 @@ define('Core/Cartesian3',[ * @returns {Number} The squared magnitude. */ Cartesian3.magnitudeSquared = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z; }; @@ -1717,8 +1712,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distance(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(2.0, 0.0, 0.0)); */ Cartesian3.distance = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitude(distanceScratch); @@ -1737,8 +1732,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distanceSquared(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(3.0, 0.0, 0.0)); */ Cartesian3.distanceSquared = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitudeSquared(distanceScratch); @@ -1752,8 +1747,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.normalize = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian3.magnitude(cartesian); @@ -1776,8 +1771,8 @@ define('Core/Cartesian3',[ * @returns {Number} The dot product. */ Cartesian3.dot = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z; }; @@ -1791,9 +1786,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyComponents = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -1835,9 +1830,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.add = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -1854,9 +1849,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.subtract = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -1873,9 +1868,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -1892,9 +1887,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.divideByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -1910,8 +1905,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.negate = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -1927,8 +1922,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.abs = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -1947,10 +1942,10 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.lerp = function(start, end, t, result) { - Check.typeOf.object(start, 'start'); - Check.typeOf.object(end, 'end'); - Check.typeOf.number(t, 't'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian3.multiplyByScalar(end, t, lerpScratch); result = Cartesian3.multiplyByScalar(start, 1.0 - t, result); @@ -1967,8 +1962,8 @@ define('Core/Cartesian3',[ * @returns {Number} The angle between the Cartesians. */ Cartesian3.angleBetween = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.normalize(left, angleBetweenScratch); Cartesian3.normalize(right, angleBetweenScratch2); @@ -1986,8 +1981,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The most orthogonal axis. */ Cartesian3.mostOrthogonalAxis = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian3.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian3.abs(f, f); @@ -2064,9 +2059,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The cross product. */ Cartesian3.cross = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var leftX = left.x; var leftY = left.y; @@ -2099,8 +2094,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromDegrees(-115.0, 37.0); */ Cartesian3.fromDegrees = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); longitude = CesiumMath.toRadians(longitude); latitude = CesiumMath.toRadians(latitude); @@ -2125,8 +2120,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromRadians(-2.007, 0.645); */ Cartesian3.fromRadians = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); height = defaultValue(height, 0.0); var radiiSquared = defined(ellipsoid) ? ellipsoid.radiiSquared : wgs84RadiiSquared; @@ -2160,7 +2155,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArray([-115.0, 37.0, -107.0, 33.0]); */ Cartesian3.fromDegreesArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -2194,7 +2189,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArray([-2.007, 0.645, -1.867, .575]); */ Cartesian3.fromRadiansArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -2228,7 +2223,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArrayHeights([-115.0, 37.0, 100000.0, -107.0, 33.0, 150000.0]); */ Cartesian3.fromDegreesArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -2263,7 +2258,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArrayHeights([-2.007, 0.645, 100000.0, -1.867, .575, 150000.0]); */ Cartesian3.fromRadiansArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -3010,7 +3005,9 @@ define('Core/Ellipsoid',[ /** * Computes an Ellipsoid from a Cartesian specifying the radii in x, y, and z directions. * - * @param {Cartesian3} [radii=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Cartesian3} [cartesian=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new + * instance should be created. * @returns {Ellipsoid} A new Ellipsoid instance. * * @exception {DeveloperError} All radii components must be greater than or equal to zero. @@ -3650,6 +3647,7 @@ define('Core/Interval',[ /*global define*/ define('Core/Matrix3',[ './Cartesian3', + './Check', './defaultValue', './defined', './defineProperties', @@ -3658,6 +3656,7 @@ define('Core/Matrix3',[ './Math' ], function( Cartesian3, + Check, defaultValue, defined, defineProperties, @@ -3720,13 +3719,8 @@ define('Core/Matrix3',[ * @returns {Number[]} The array that was packed into */ Matrix3.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3752,9 +3746,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. */ Matrix3.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3781,24 +3773,24 @@ define('Core/Matrix3',[ * @param {Matrix3} [result] The object onto which to store the result. * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. (Returns undefined if matrix is undefined) */ - Matrix3.clone = function(values, result) { - if (!defined(values)) { + Matrix3.clone = function(matrix, result) { + if (!defined(matrix)) { return undefined; } if (!defined(result)) { - return new Matrix3(values[0], values[3], values[6], - values[1], values[4], values[7], - values[2], values[5], values[8]); + return new Matrix3(matrix[0], matrix[3], matrix[6], + matrix[1], matrix[4], matrix[7], + matrix[2], matrix[5], matrix[8]); } - result[0] = values[0]; - result[1] = values[1]; - result[2] = values[2]; - result[3] = values[3]; - result[4] = values[4]; - result[5] = values[5]; - result[6] = values[6]; - result[7] = values[7]; - result[8] = values[8]; + result[0] = matrix[0]; + result[1] = matrix[1]; + result[2] = matrix[2]; + result[3] = matrix[3]; + result[4] = matrix[4]; + result[5] = matrix[5]; + result[6] = matrix[6]; + result[7] = matrix[7]; + result[8] = matrix[8]; return result; }; @@ -3824,9 +3816,7 @@ define('Core/Matrix3',[ * var m2 = Cesium.Matrix3.fromArray(v2, 2); */ Matrix3.fromArray = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3854,9 +3844,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values parameter is required'); - } + Check.defined('values', values); return Matrix3.clone(values, result); }; @@ -3870,9 +3858,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix3(values[0], values[1], values[2], @@ -3899,9 +3885,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this quaternion. */ Matrix3.fromQuaternion = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); var x2 = quaternion.x * quaternion.x; var xy = quaternion.x * quaternion.y; @@ -3951,10 +3935,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this headingPitchRoll. */ Matrix3.fromHeadingPitchRoll = function(headingPitchRoll, result) { - if (!defined(headingPitchRoll)) { - throw new DeveloperError('headingPitchRoll is required'); - } - var cosTheta = Math.cos(-headingPitchRoll.pitch); + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + + var cosTheta = Math.cos(-headingPitchRoll.pitch); var cosPsi = Math.cos(-headingPitchRoll.heading); var cosPhi = Math.cos(headingPitchRoll.roll); var sinTheta = Math.sin(-headingPitchRoll.pitch); @@ -4005,9 +3988,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix3( @@ -4043,9 +4024,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromUniformScale(2.0); */ Matrix3.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix3( @@ -4069,7 +4048,7 @@ define('Core/Matrix3',[ /** * Computes a Matrix3 instance representing the cross product equivalent matrix of a Cartesian3 vector. * - * @param {Cartesian3} the vector on the left hand side of the cross product operation. + * @param {Cartesian3} vector the vector on the left hand side of the cross product operation. * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created. * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. * @@ -4081,9 +4060,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromCrossProduct(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromCrossProduct = function(vector, result) { - if (!defined(vector)) { - throw new DeveloperError('vector is required.'); - } + Check.typeOf.object('vector', vector); if (!defined(result)) { return new Matrix3( @@ -4118,9 +4095,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationX = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4159,9 +4134,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationY = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4200,9 +4173,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationZ = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4236,9 +4207,7 @@ define('Core/Matrix3',[ * @returns {Number[]} The modified Array parameter or a new Array instance if one was not provided. */ Matrix3.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5], matrix[6], matrix[7], matrix[8]]; @@ -4272,12 +4241,10 @@ define('Core/Matrix3',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix3.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 2) { - throw new DeveloperError('row must be 0, 1, or 2.'); - } - if (typeof column !== 'number' || column < 0 || column > 2) { - throw new DeveloperError('column must be 0, 1, or 2.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 2); + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 2); return column * 3 + row; }; @@ -4293,16 +4260,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var startIndex = index * 3; var x = matrix[startIndex]; @@ -4327,18 +4288,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); var startIndex = index * 3; @@ -4359,15 +4313,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 3]; @@ -4391,18 +4340,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); result[index] = cartesian.x; @@ -4421,12 +4363,8 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[3], matrix[4], matrix[5], scratchColumn)); @@ -4457,15 +4395,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var column0Row0 = left[0] * right[0] + left[3] * right[1] + left[6] * right[2]; var column0Row1 = left[1] * right[0] + left[4] * right[1] + left[7] * right[2]; @@ -4500,15 +4432,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -4531,15 +4457,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -4562,15 +4482,9 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -4595,15 +4509,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -4634,15 +4542,9 @@ define('Core/Matrix3',[ * @see Matrix3.multiplyByUniformScale */ Matrix3.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); result[0] = matrix[0] * scale.x; result[1] = matrix[1] * scale.x; @@ -4664,12 +4566,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -4691,12 +4589,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var column0Row0 = matrix[0]; var column0Row1 = matrix[3]; @@ -4836,9 +4730,7 @@ define('Core/Matrix3',[ * var c = Cesium.Cartesian3.multiplyByScalar(v, lambda, new Cesium.Cartesian3()); // equal to Cesium.Matrix3.multiplyByVector(a, v) */ Matrix3.computeEigenDecomposition = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); // This routine was created based upon Matrix Computations, 3rd ed., by Golub and Van Loan, // section 8.4.3 The Classical Jacobi Algorithm @@ -4882,12 +4774,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -4909,9 +4797,7 @@ define('Core/Matrix3',[ * @returns {Number} The value of the determinant of the matrix. */ Matrix3.determinant = function(matrix) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); var m11 = matrix[0]; var m21 = matrix[3]; @@ -4936,12 +4822,8 @@ define('Core/Matrix3',[ * @exception {DeveloperError} matrix is not invertible. */ Matrix3.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var m11 = matrix[0]; var m21 = matrix[1]; @@ -5007,9 +4889,7 @@ define('Core/Matrix3',[ * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. */ Matrix3.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -5197,12 +5077,14 @@ define('Core/Matrix3',[ /*global define*/ define('Core/Cartesian4',[ + './Check', './defaultValue', './defined', './DeveloperError', './freezeObject', './Math' ], function( + Check, defaultValue, defined, DeveloperError, @@ -5285,9 +5167,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.fromColor = function(color, result) { - if (!defined(color)) { - throw new DeveloperError('color is required'); - } + Check.typeOf.object('color', color); if (!defined(result)) { return new Cartesian4(color.red, color.green, color.blue, color.alpha); } @@ -5339,12 +5219,8 @@ define('Core/Cartesian4',[ * @returns {Number[]} The array that was packed into */ Cartesian4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5365,9 +5241,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5389,9 +5263,7 @@ define('Core/Cartesian4',[ * @returns {Number[]} The packed array. */ Cartesian4.packArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -5414,9 +5286,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4[]} The unpacked array. */ Cartesian4.unpackArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -5459,9 +5329,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the maximum component. */ Cartesian4.maximumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -5473,9 +5341,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the minimum component. */ Cartesian4.minimumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -5489,15 +5355,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the minimum components. */ Cartesian4.minimumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -5516,15 +5376,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the maximum components. */ Cartesian4.maximumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -5541,9 +5395,7 @@ define('Core/Cartesian4',[ * @returns {Number} The squared magnitude. */ Cartesian4.magnitudeSquared = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z + cartesian.w * cartesian.w; }; @@ -5574,9 +5426,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(2.0, 0.0, 0.0, 0.0)); */ Cartesian4.distance = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitude(distanceScratch); @@ -5597,9 +5448,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(3.0, 0.0, 0.0, 0.0)); */ Cartesian4.distanceSquared = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitudeSquared(distanceScratch); @@ -5613,12 +5463,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.normalize = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian4.magnitude(cartesian); @@ -5642,12 +5488,8 @@ define('Core/Cartesian4',[ * @returns {Number} The dot product. */ Cartesian4.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w; }; @@ -5661,15 +5503,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -5687,15 +5523,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x / right.x; result.y = left.y / right.y; @@ -5713,15 +5543,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -5739,15 +5563,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -5765,15 +5583,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -5791,15 +5603,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -5816,12 +5622,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.negate = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -5838,12 +5640,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.abs = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -5863,18 +5661,10 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian4.multiplyByScalar(end, t, lerpScratch); result = Cartesian4.multiplyByScalar(start, 1.0 - t, result); @@ -5890,12 +5680,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The most orthogonal axis. */ Cartesian4.mostOrthogonalAxis = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian4.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian4.abs(f, f); @@ -6140,6 +5926,7 @@ define('Core/RuntimeError',[ define('Core/Matrix4',[ './Cartesian3', './Cartesian4', + './Check', './defaultValue', './defined', './defineProperties', @@ -6151,6 +5938,7 @@ define('Core/Matrix4',[ ], function( Cartesian3, Cartesian4, + Check, defaultValue, defined, defineProperties, @@ -6241,13 +6029,8 @@ define('Core/Matrix4',[ * @returns {Number[]} The array that was packed into */ Matrix4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -6280,9 +6063,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if one was not provided. */ Matrix4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -6378,9 +6159,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required'); - } + Check.defined('values', values); return Matrix4.clone(values, result); }; @@ -6394,9 +6173,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix4(values[0], values[1], values[2], values[3], @@ -6433,9 +6210,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRotationTranslation = function(rotation, translation, result) { - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } + Check.typeOf.object('rotation', rotation); translation = defaultValue(translation, Cartesian3.ZERO); @@ -6483,15 +6258,9 @@ define('Core/Matrix4',[ * result); */ Matrix4.fromTranslationQuaternionRotationScale = function(translation, rotation, scale, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('translation', translation); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('scale', scale); if (!defined(result)) { result = new Matrix4(); @@ -6552,9 +6321,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromTranslationRotationScale = function(translationRotationScale, result) { - if (!defined(translationRotationScale)) { - throw new DeveloperError('translationRotationScale is required.'); - } + Check.typeOf.object('translationRotationScale', translationRotationScale); return Matrix4.fromTranslationQuaternionRotationScale(translationRotationScale.translation, translationRotationScale.rotation, translationRotationScale.scale, result); }; @@ -6569,9 +6336,7 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByTranslation */ Matrix4.fromTranslation = function(translation, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } + Check.typeOf.object('translation', translation); return Matrix4.fromRotationTranslation(Matrix3.IDENTITY, translation, result); }; @@ -6592,9 +6357,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix4.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix4( @@ -6639,9 +6402,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromUniformScale(2.0); */ Matrix4.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix4(scale, 0.0, 0.0, 0.0, @@ -6681,23 +6442,15 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromCamera = function(camera, result) { - if (!defined(camera)) { - throw new DeveloperError('camera is required.'); - } + Check.typeOf.object('camera', camera); var position = camera.position; var direction = camera.direction; var up = camera.up; - if (!defined(position)) { - throw new DeveloperError('camera.position is required.'); - } - if (!defined(direction)) { - throw new DeveloperError('camera.direction is required.'); - } - if (!defined(up)) { - throw new DeveloperError('camera.up is required.'); - } + Check.typeOf.object('camera.position', position); + Check.typeOf.object('camera.direction', direction); + Check.typeOf.object('camera.up', up); Cartesian3.normalize(direction, fromCameraF); Cartesian3.normalize(Cartesian3.cross(fromCameraF, up, fromCameraR), fromCameraR); @@ -6776,21 +6529,11 @@ define('Core/Matrix4',[ * @exception {DeveloperError} far must be greater than zero. */ Matrix4.computePerspectiveFieldOfView = function(fovY, aspectRatio, near, far, result) { - if (fovY <= 0.0 || fovY > Math.PI) { - throw new DeveloperError('fovY must be in (0, PI].'); - } - if (aspectRatio <= 0.0) { - throw new DeveloperError('aspectRatio must be greater than zero.'); - } - if (near <= 0.0) { - throw new DeveloperError('near must be greater than zero.'); - } - if (far <= 0.0) { - throw new DeveloperError('far must be greater than zero.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThan('fovY', fovY, 0.0); + Check.typeOf.number.lessThan('fovY', fovY, Math.PI); + Check.typeOf.number.greaterThan('near', near, 0.0); + Check.typeOf.number.greaterThan('far', far, 0.0); + Check.typeOf.object('result', result); var bottom = Math.tan(fovY * 0.5); @@ -6831,27 +6574,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeOrthographicOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var a = 1.0 / (right - left); var b = 1.0 / (top - bottom); @@ -6896,27 +6625,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computePerspectiveOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -6957,24 +6672,12 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeInfinitePerspectiveOffCenter = function(left, right, bottom, top, near, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -7022,9 +6725,7 @@ define('Core/Matrix4',[ * }, 0.0, 1.0, new Cesium.Matrix4()); */ Matrix4.computeViewportTransformation = function(viewport, nearDepthRange, farDepthRange, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); viewport = defaultValue(viewport, defaultValue.EMPTY_OBJECT); var x = defaultValue(viewport.x, 0.0); @@ -7076,21 +6777,11 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeView = function(position, direction, up, right, result) { - if (!defined(position)) { - throw new DeveloperError('position is required'); - } - if (!defined(direction)) { - throw new DeveloperError('direction is required'); - } - if (!defined(up)) { - throw new DeveloperError('up is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); + Check.typeOf.object('up', up); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = right.x; result[1] = up.x; @@ -7131,9 +6822,7 @@ define('Core/Matrix4',[ * //creates a = [10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0] */ Matrix4.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], @@ -7177,12 +6866,11 @@ define('Core/Matrix4',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix4.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 3) { - throw new DeveloperError('row must be 0, 1, 2, or 3.'); - } - if (typeof column !== 'number' || column < 0 || column > 3) { - throw new DeveloperError('column must be 0, 1, 2, or 3.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 3); + + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 3); return column * 4 + row; }; @@ -7215,16 +6903,12 @@ define('Core/Matrix4',[ * // a.x = 12.0; a.y = 16.0; a.z = 20.0; a.w = 24.0; */ Matrix4.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var startIndex = index * 4; var x = matrix[startIndex]; @@ -7266,18 +6950,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 96.0, 25.0] */ Matrix4.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); var startIndex = index * 4; @@ -7295,18 +6974,12 @@ define('Core/Matrix4',[ * @param {Matrix4} matrix The matrix to use. * @param {Cartesian3} translation The translation that replaces the translation of the provided matrix. * @param {Cartesian4} result The object onto which to store the result. - * @returns {Matrix4} The modified result parameter. - */ - Matrix4.setTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + * @returns {Matrix4} The modified result parameter. + */ + Matrix4.setTranslation = function(matrix, translation, result) { + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -7359,16 +7032,12 @@ define('Core/Matrix4',[ * // a.x = 18.0; a.y = 19.0; a.z = 20.0; a.w = 21.0; */ Matrix4.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 4]; @@ -7409,18 +7078,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 24.0, 25.0] */ Matrix4.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); result[index] = cartesian.x; @@ -7440,12 +7104,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter */ Matrix4.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[4], matrix[5], matrix[6], scratchColumn)); @@ -7477,15 +7137,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -7569,15 +7223,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -7607,15 +7255,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -7656,15 +7298,9 @@ define('Core/Matrix4',[ * var m3 = Cesium.Matrix4.multiplyTransformation(m1, m2, new Cesium.Matrix4()); */ Matrix4.multiplyTransformation = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -7742,15 +7378,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByMatrix3(m, rotation, m); */ Matrix4.multiplyByMatrix3 = function(matrix, rotation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('result', result); var left0 = matrix[0]; var left1 = matrix[1]; @@ -7818,15 +7448,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByTranslation(m, position, m); */ Matrix4.multiplyByTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); var x = translation.x; var y = translation.y; @@ -7878,15 +7502,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByScale */ Matrix4.multiplyByUniformScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scale', scale); + Check.typeOf.object('result', result); uniformScaleScratch.x = scale; uniformScaleScratch.y = scale; @@ -7915,15 +7533,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByUniformScale */ Matrix4.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); var scaleX = scale.x; var scaleY = scale.y; @@ -7962,15 +7574,9 @@ define('Core/Matrix4',[ * @returns {Cartesian4} The modified result parameter. */ Matrix4.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8006,15 +7612,9 @@ define('Core/Matrix4',[ * // Cesium.Matrix4.multiplyByVector(matrix, new Cesium.Cartesian4(p.x, p.y, p.z, 0.0), result); */ Matrix4.multiplyByPointAsVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8044,16 +7644,9 @@ define('Core/Matrix4',[ * var result = Cesium.Matrix4.multiplyByPoint(matrix, p, new Cesium.Cartesian3()); */ Matrix4.multiplyByPoint = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8093,15 +7686,9 @@ define('Core/Matrix4',[ * // [-44.0, -46.0, -48.0, -50.0] */ Matrix4.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -8145,12 +7732,8 @@ define('Core/Matrix4',[ * // [-22.0, -23.0, -24.0, -25.0] */ Matrix4.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -8194,12 +7777,8 @@ define('Core/Matrix4',[ * // [13.0, 17.0, 21.0, 25.0] */ Matrix4.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var matrix1 = matrix[1]; var matrix2 = matrix[2]; @@ -8235,12 +7814,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -8354,9 +7929,7 @@ define('Core/Matrix4',[ * //Prints "Difference between both the matrices is not less than 0.1" on the console */ Matrix4.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -8387,12 +7960,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter. */ Matrix4.getTranslation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = matrix[12]; result.y = matrix[13]; @@ -8423,12 +7992,8 @@ define('Core/Matrix4',[ * // [12.0, 16.0, 20.0] */ Matrix4.getRotation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -8460,12 +8025,8 @@ define('Core/Matrix4',[ * @exception {RuntimeError} matrix is not invertible because its determinate is zero. */ Matrix4.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); // Special case for a zero scale matrix that can occur, for example, // when a model's node has a [0, 0, 0] scale. @@ -8603,12 +8164,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.inverseTransformation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); //This function is an optimized version of the below 4 lines. //var rT = Matrix3.transpose(Matrix4.getRotation(matrix)); @@ -8892,6 +8449,7 @@ define('Core/Matrix4',[ /*global define*/ define('Core/Rectangle',[ './Cartographic', + './Check', './defaultValue', './defined', './defineProperties', @@ -8901,6 +8459,7 @@ define('Core/Rectangle',[ './Math' ], function( Cartographic, + Check, defaultValue, defined, defineProperties, @@ -8997,13 +8556,8 @@ define('Core/Rectangle',[ * @returns {Number[]} The array that was packed into */ Rectangle.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -9024,9 +8578,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -9047,9 +8599,7 @@ define('Core/Rectangle',[ * @returns {Number} The width. */ Rectangle.computeWidth = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; if (east < west) { @@ -9064,9 +8614,7 @@ define('Core/Rectangle',[ * @returns {Number} The height. */ Rectangle.computeHeight = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); return rectangle.north - rectangle.south; }; @@ -9101,6 +8649,32 @@ define('Core/Rectangle',[ return result; }; + /** + * Creates an rectangle given the boundary longitude and latitude in radians. + * + * @param {Number} [west=0.0] The westernmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [south=0.0] The southernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Number} [east=0.0] The easternmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [north=0.0] The northernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Rectangle} [result] The object onto which to store the result, or undefined if a new instance should be created. + * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. + * + * @example + * var rectangle = Cesium.Rectangle.fromRadians(0.0, Math.PI/4, Math.PI/8, 3*Math.PI/4); + */ + Rectangle.fromRadians = function(west, south, east, north, result) { + if (!defined(result)) { + return new Rectangle(west, south, east, north); + } + + result.west = defaultValue(west, 0.0); + result.south = defaultValue(south, 0.0); + result.east = defaultValue(east, 0.0); + result.north = defaultValue(north, 0.0); + + return result; + }; + /** * Creates the smallest possible Rectangle that encloses all positions in the provided array. * @@ -9109,9 +8683,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartographicArray = function(cartographics, result) { - if (!defined(cartographics)) { - throw new DeveloperError('cartographics is required.'); - } + Check.defined('cartographics', cartographics); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -9164,9 +8736,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartesianArray = function(cartesians, ellipsoid, result) { - if (!defined(cartesians)) { - throw new DeveloperError('cartesians is required.'); - } + Check.defined('cartesians', cartesians); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -9282,9 +8852,7 @@ define('Core/Rectangle',[ * @returns {Boolean} <code>true</code> if the Rectangles are within the provided epsilon, <code>false</code> otherwise. */ Rectangle.prototype.equalsEpsilon = function(other, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon is required and must be a number.'); - } + Check.typeOf.number('epsilon', epsilon); return defined(other) && (Math.abs(this.west - other.west) <= epsilon) && @@ -9304,45 +8872,23 @@ define('Core/Rectangle',[ * @exception {DeveloperError} <code>west</code> must be in the interval [<code>-Pi</code>, <code>Pi</code>]. */ Rectangle.validate = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var north = rectangle.north; - if (typeof north !== 'number') { - throw new DeveloperError('north is required to be a number.'); - } - - if (north < -CesiumMath.PI_OVER_TWO || north > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('north must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('north', north, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('north', north, CesiumMath.PI_OVER_TWO); var south = rectangle.south; - if (typeof south !== 'number') { - throw new DeveloperError('south is required to be a number.'); - } - - if (south < -CesiumMath.PI_OVER_TWO || south > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('south must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('south', south, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('south', south, CesiumMath.PI_OVER_TWO); var west = rectangle.west; - if (typeof west !== 'number') { - throw new DeveloperError('west is required to be a number.'); - } - - if (west < -Math.PI || west > Math.PI) { - throw new DeveloperError('west must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('west', west, -Math.PI); + Check.typeOf.number.lessThanOrEquals('west', west, Math.PI); var east = rectangle.east; - if (typeof east !== 'number') { - throw new DeveloperError('east is required to be a number.'); - } - - if (east < -Math.PI || east > Math.PI) { - throw new DeveloperError('east must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('east', east, -Math.PI); + Check.typeOf.number.lessThanOrEquals('east', east, Math.PI); }; /** @@ -9353,9 +8899,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.south); @@ -9374,9 +8918,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.north); @@ -9395,9 +8937,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.north); @@ -9416,9 +8956,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.south); @@ -9437,9 +8975,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.center = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; @@ -9474,12 +9010,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.intersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var rectangleEast = rectangle.east; var rectangleWest = rectangle.west; @@ -9535,12 +9067,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.simpleIntersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var west = Math.max(rectangle.west, otherRectangle.west); var south = Math.max(rectangle.south, otherRectangle.south); @@ -9571,12 +9099,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.union = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); if (!defined(result)) { result = new Rectangle(); @@ -9620,12 +9144,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.expand = function(rectangle, cartographic, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); if (!defined(result)) { result = new Rectangle(); @@ -9647,12 +9167,8 @@ define('Core/Rectangle',[ * @returns {Boolean} true if the provided cartographic is inside the rectangle, false otherwise. */ Rectangle.contains = function(rectangle, cartographic) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); var longitude = cartographic.longitude; var latitude = cartographic.latitude; @@ -9685,9 +9201,7 @@ define('Core/Rectangle',[ * @returns {Cartesian3[]} The modified result parameter or a new Array of Cartesians instances if none was provided. */ Rectangle.subsample = function(rectangle, ellipsoid, surfaceHeight, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84); surfaceHeight = defaultValue(surfaceHeight, 0.0); @@ -9765,9 +9279,9 @@ define('Core/Rectangle',[ define('Core/BoundingSphere',[ './Cartesian3', './Cartographic', + './Check', './defaultValue', './defined', - './DeveloperError', './Ellipsoid', './GeographicProjection', './Intersect', @@ -9778,9 +9292,9 @@ define('Core/BoundingSphere',[ ], function( Cartesian3, Cartographic, + Check, defaultValue, defined, - DeveloperError, Ellipsoid, GeographicProjection, Intersect, @@ -10110,9 +9624,7 @@ define('Core/BoundingSphere',[ stride = defaultValue(stride, 3); - if (stride < 3) { - throw new DeveloperError('stride must be 3 or greater.'); - } + Check.typeOf.number.greaterThanOrEquals('stride', stride, 3); var currentPos = fromPointsCurrentPos; currentPos.x = positions[0] + center.x; @@ -10416,9 +9928,8 @@ define('Core/BoundingSphere',[ * var sphere = Cesium.BoundingSphere.fromCornerPoints(new Cesium.Cartesian3(-0.5, -0.5, -0.5), new Cesium.Cartesian3(0.5, 0.5, 0.5)); */ BoundingSphere.fromCornerPoints = function(corner, oppositeCorner, result) { - if (!defined(corner) || !defined(oppositeCorner)) { - throw new DeveloperError('corner and oppositeCorner are required.'); - } + Check.typeOf.object('corner', corner); + Check.typeOf.object('oppositeCorner', oppositeCorner); if (!defined(result)) { result = new BoundingSphere(); @@ -10442,9 +9953,7 @@ define('Core/BoundingSphere',[ * var boundingSphere = Cesium.BoundingSphere.fromEllipsoid(ellipsoid); */ BoundingSphere.fromEllipsoid = function(ellipsoid, result) { - if (!defined(ellipsoid)) { - throw new DeveloperError('ellipsoid is required.'); - } + Check.typeOf.object('ellipsoid', ellipsoid); if (!defined(result)) { result = new BoundingSphere(); @@ -10570,13 +10079,8 @@ define('Core/BoundingSphere',[ * @returns {Number[]} The array that was packed into */ BoundingSphere.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -10598,9 +10102,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if one was not provided. */ BoundingSphere.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -10627,13 +10129,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.union = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); if (!defined(result)) { result = new BoundingSphere(); @@ -10682,13 +10179,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.expand = function(sphere, point, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(point)) { - throw new DeveloperError('point is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('point', point); result = BoundingSphere.clone(sphere, result); @@ -10711,13 +10203,8 @@ define('Core/BoundingSphere',[ * intersects the plane. */ BoundingSphere.intersectPlane = function(sphere, plane) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(plane)) { - throw new DeveloperError('plane is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('plane', plane); var center = sphere.center; var radius = sphere.radius; @@ -10743,13 +10230,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.transform = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -10777,12 +10259,8 @@ define('Core/BoundingSphere',[ * }); */ BoundingSphere.distanceSquaredTo = function(sphere, cartesian) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('cartesian', cartesian); var diff = Cartesian3.subtract(sphere.center, cartesian, distanceSquaredToScratch); return Cartesian3.magnitudeSquared(diff) - sphere.radius * sphere.radius; @@ -10804,13 +10282,8 @@ define('Core/BoundingSphere',[ * var newBoundingSphere = Cesium.BoundingSphere.transformWithoutScale(boundingSphere, modelMatrix); */ BoundingSphere.transformWithoutScale = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -10837,17 +10310,9 @@ define('Core/BoundingSphere',[ * @returns {Interval} The nearest and farthest distances on the bounding sphere from position in direction. */ BoundingSphere.computePlaneDistances = function(sphere, position, direction, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(position)) { - throw new DeveloperError('position is required.'); - } - - if (!defined(direction)) { - throw new DeveloperError('direction is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); if (!defined(result)) { result = new Interval(); @@ -10882,9 +10347,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.projectTo2D = function(sphere, projection, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } + Check.typeOf.object('sphere', sphere); projection = defaultValue(projection, projectTo2DProjection); @@ -10979,12 +10442,8 @@ define('Core/BoundingSphere',[ * @returns {Boolean} <code>true</code> if the sphere is not visible; otherwise <code>false</code>. */ BoundingSphere.isOccluded = function(sphere, occluder) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(occluder)) { - throw new DeveloperError('occluder is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('occluder', occluder); return !occluder.isBoundingSphereVisible(sphere); }; @@ -12193,7 +11652,10 @@ define('Core/WebGLConstants',[ COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : 0x9279, TEXTURE_IMMUTABLE_FORMAT : 0x912F, MAX_ELEMENT_INDEX : 0x8D6B, - TEXTURE_IMMUTABLE_LEVELS : 0x82DF + TEXTURE_IMMUTABLE_LEVELS : 0x82DF, + + // Extensions + MAX_TEXTURE_MAX_ANISOTROPY_EXT : 0x84FF }; return freezeObject(WebGLConstants); @@ -12723,7 +12185,7 @@ define('Core/Geometry',[ * <li><code>position</code> - 3D vertex position. 64-bit floating-point (for precision). 3 components per attribute. See {@link VertexFormat#position}.</li> * <li><code>normal</code> - Normal (normalized), commonly used for lighting. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#normal}.</li> * <li><code>st</code> - 2D texture coordinate. 32-bit floating-point. 2 components per attribute. See {@link VertexFormat#st}.</li> - * <li><code>binormal</code> - Binormal (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#binormal}.</li> + * <li><code>bitangent</code> - Bitangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#bitangent}.</li> * <li><code>tangent</code> - Tangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#tangent}.</li> * </ul> * </p> @@ -12752,7 +12214,7 @@ define('Core/Geometry',[ * componentsPerAttribute : 3, * values : new Float32Array(0) * }); - * + * * @see GeometryAttribute * @see VertexFormat */ @@ -13033,7 +12495,7 @@ define('Core/GeometryAttributes',[ this.st = options.st; /** - * The binormal attribute (normalized), which is used for tangent-space effects like bump mapping. + * The bitangent attribute (normalized), which is used for tangent-space effects like bump mapping. * <p> * 32-bit floating-point. 3 components per attribute. * </p> @@ -13042,7 +12504,7 @@ define('Core/GeometryAttributes',[ * * @default undefined */ - this.binormal = options.binormal; + this.bitangent = options.bitangent; /** * The tangent attribute (normalized), which is used for tangent-space effects like bump mapping. @@ -13145,7 +12607,7 @@ define('Core/VertexFormat',[ this.st = defaultValue(options.st, false); /** - * When <code>true</code>, the vertex has a binormal attribute (normalized), which is used for tangent-space effects like bump mapping. + * When <code>true</code>, the vertex has a bitangent attribute (normalized), which is used for tangent-space effects like bump mapping. * <p> * 32-bit floating-point. 3 components per attribute. * </p> @@ -13154,7 +12616,7 @@ define('Core/VertexFormat',[ * * @default false */ - this.binormal = defaultValue(options.binormal, false); + this.bitangent = defaultValue(options.bitangent, false); /** * When <code>true</code>, the vertex has a tangent attribute (normalized), which is used for tangent-space effects like bump mapping. @@ -13256,7 +12718,7 @@ define('Core/VertexFormat',[ })); /** - * An immutable vertex format with well-known attributes: position, normal, st, binormal, and tangent. + * An immutable vertex format with well-known attributes: position, normal, st, tangent, and bitangent. * * @type {VertexFormat} * @constant @@ -13264,15 +12726,15 @@ define('Core/VertexFormat',[ * @see VertexFormat#position * @see VertexFormat#normal * @see VertexFormat#st - * @see VertexFormat#binormal * @see VertexFormat#tangent + * @see VertexFormat#bitangent */ VertexFormat.ALL = freezeObject(new VertexFormat({ position : true, normal : true, st : true, - binormal : true, - tangent : true + tangent : true, + bitangent : true })); /** @@ -13317,8 +12779,8 @@ define('Core/VertexFormat',[ array[startingIndex++] = value.position ? 1.0 : 0.0; array[startingIndex++] = value.normal ? 1.0 : 0.0; array[startingIndex++] = value.st ? 1.0 : 0.0; - array[startingIndex++] = value.binormal ? 1.0 : 0.0; array[startingIndex++] = value.tangent ? 1.0 : 0.0; + array[startingIndex++] = value.bitangent ? 1.0 : 0.0; array[startingIndex++] = value.color ? 1.0 : 0.0; return array; @@ -13343,19 +12805,19 @@ define('Core/VertexFormat',[ result = new VertexFormat(); } - result.position = array[startingIndex++] === 1.0; - result.normal = array[startingIndex++] === 1.0; - result.st = array[startingIndex++] === 1.0; - result.binormal = array[startingIndex++] === 1.0; - result.tangent = array[startingIndex++] === 1.0; - result.color = array[startingIndex++] === 1.0; + result.position = array[startingIndex++] === 1.0; + result.normal = array[startingIndex++] === 1.0; + result.st = array[startingIndex++] === 1.0; + result.tangent = array[startingIndex++] === 1.0; + result.bitangent = array[startingIndex++] === 1.0; + result.color = array[startingIndex++] === 1.0; return result; }; /** * Duplicates a VertexFormat instance. * - * @param {VertexFormat} cartesian The vertex format to duplicate. + * @param {VertexFormat} vertexFormat The vertex format to duplicate. * @param {VertexFormat} [result] The object onto which to store the result. * @returns {VertexFormat} The modified result parameter or a new VertexFormat instance if one was not provided. (Returns undefined if vertexFormat is undefined) */ @@ -13370,8 +12832,8 @@ define('Core/VertexFormat',[ result.position = vertexFormat.position; result.normal = vertexFormat.normal; result.st = vertexFormat.st; - result.binormal = vertexFormat.binormal; result.tangent = vertexFormat.tangent; + result.bitangent = vertexFormat.bitangent; result.color = vertexFormat.color; return result; }; @@ -13616,7 +13078,7 @@ define('Core/BoxGeometry',[ var positions; if (vertexFormat.position && - (vertexFormat.st || vertexFormat.normal || vertexFormat.binormal || vertexFormat.tangent)) { + (vertexFormat.st || vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent)) { if (vertexFormat.position) { // 8 corner points. Duplicated 3 times each for each incident edge/face. positions = new Float64Array(6 * 4 * 3); @@ -13970,97 +13432,97 @@ define('Core/BoxGeometry',[ }); } - if (vertexFormat.binormal) { - var binormals = new Float32Array(6 * 4 * 3); + if (vertexFormat.bitangent) { + var bitangents = new Float32Array(6 * 4 * 3); // +z face - binormals[0] = 0.0; - binormals[1] = 1.0; - binormals[2] = 0.0; - binormals[3] = 0.0; - binormals[4] = 1.0; - binormals[5] = 0.0; - binormals[6] = 0.0; - binormals[7] = 1.0; - binormals[8] = 0.0; - binormals[9] = 0.0; - binormals[10] = 1.0; - binormals[11] = 0.0; + bitangents[0] = 0.0; + bitangents[1] = 1.0; + bitangents[2] = 0.0; + bitangents[3] = 0.0; + bitangents[4] = 1.0; + bitangents[5] = 0.0; + bitangents[6] = 0.0; + bitangents[7] = 1.0; + bitangents[8] = 0.0; + bitangents[9] = 0.0; + bitangents[10] = 1.0; + bitangents[11] = 0.0; // -z face - binormals[12] = 0.0; - binormals[13] = 1.0; - binormals[14] = 0.0; - binormals[15] = 0.0; - binormals[16] = 1.0; - binormals[17] = 0.0; - binormals[18] = 0.0; - binormals[19] = 1.0; - binormals[20] = 0.0; - binormals[21] = 0.0; - binormals[22] = 1.0; - binormals[23] = 0.0; + bitangents[12] = 0.0; + bitangents[13] = 1.0; + bitangents[14] = 0.0; + bitangents[15] = 0.0; + bitangents[16] = 1.0; + bitangents[17] = 0.0; + bitangents[18] = 0.0; + bitangents[19] = 1.0; + bitangents[20] = 0.0; + bitangents[21] = 0.0; + bitangents[22] = 1.0; + bitangents[23] = 0.0; // +x face - binormals[24] = 0.0; - binormals[25] = 0.0; - binormals[26] = 1.0; - binormals[27] = 0.0; - binormals[28] = 0.0; - binormals[29] = 1.0; - binormals[30] = 0.0; - binormals[31] = 0.0; - binormals[32] = 1.0; - binormals[33] = 0.0; - binormals[34] = 0.0; - binormals[35] = 1.0; + bitangents[24] = 0.0; + bitangents[25] = 0.0; + bitangents[26] = 1.0; + bitangents[27] = 0.0; + bitangents[28] = 0.0; + bitangents[29] = 1.0; + bitangents[30] = 0.0; + bitangents[31] = 0.0; + bitangents[32] = 1.0; + bitangents[33] = 0.0; + bitangents[34] = 0.0; + bitangents[35] = 1.0; // -x face - binormals[36] = 0.0; - binormals[37] = 0.0; - binormals[38] = 1.0; - binormals[39] = 0.0; - binormals[40] = 0.0; - binormals[41] = 1.0; - binormals[42] = 0.0; - binormals[43] = 0.0; - binormals[44] = 1.0; - binormals[45] = 0.0; - binormals[46] = 0.0; - binormals[47] = 1.0; + bitangents[36] = 0.0; + bitangents[37] = 0.0; + bitangents[38] = 1.0; + bitangents[39] = 0.0; + bitangents[40] = 0.0; + bitangents[41] = 1.0; + bitangents[42] = 0.0; + bitangents[43] = 0.0; + bitangents[44] = 1.0; + bitangents[45] = 0.0; + bitangents[46] = 0.0; + bitangents[47] = 1.0; // +y face - binormals[48] = 0.0; - binormals[49] = 0.0; - binormals[50] = 1.0; - binormals[51] = 0.0; - binormals[52] = 0.0; - binormals[53] = 1.0; - binormals[54] = 0.0; - binormals[55] = 0.0; - binormals[56] = 1.0; - binormals[57] = 0.0; - binormals[58] = 0.0; - binormals[59] = 1.0; + bitangents[48] = 0.0; + bitangents[49] = 0.0; + bitangents[50] = 1.0; + bitangents[51] = 0.0; + bitangents[52] = 0.0; + bitangents[53] = 1.0; + bitangents[54] = 0.0; + bitangents[55] = 0.0; + bitangents[56] = 1.0; + bitangents[57] = 0.0; + bitangents[58] = 0.0; + bitangents[59] = 1.0; // -y face - binormals[60] = 0.0; - binormals[61] = 0.0; - binormals[62] = 1.0; - binormals[63] = 0.0; - binormals[64] = 0.0; - binormals[65] = 1.0; - binormals[66] = 0.0; - binormals[67] = 0.0; - binormals[68] = 1.0; - binormals[69] = 0.0; - binormals[70] = 0.0; - binormals[71] = 1.0; - - attributes.binormal = new GeometryAttribute({ + bitangents[60] = 0.0; + bitangents[61] = 0.0; + bitangents[62] = 1.0; + bitangents[63] = 0.0; + bitangents[64] = 0.0; + bitangents[65] = 1.0; + bitangents[66] = 0.0; + bitangents[67] = 0.0; + bitangents[68] = 1.0; + bitangents[69] = 0.0; + bitangents[70] = 0.0; + bitangents[71] = 1.0; + + attributes.bitangent = new GeometryAttribute({ componentDatatype : ComponentDatatype.FLOAT, componentsPerAttribute : 3, - values : binormals + values : bitangents }); } diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createBoxOutlineGeometry.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createBoxOutlineGeometry.js index dfa4a7ae..307ff15c 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createBoxOutlineGeometry.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createBoxOutlineGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,68 +45,6 @@ define('Core/defined',[],function() { return defined; }); -/*global define*/ -define('Core/freezeObject',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Freezes an object, using Object.freeze if available, otherwise returns - * the object unchanged. This function should be used in setup code to prevent - * errors from completely halting JavaScript execution in legacy browsers. - * - * @private - * - * @exports freezeObject - */ - var freezeObject = Object.freeze; - if (!defined(freezeObject)) { - freezeObject = function(o) { - return o; - }; - } - - return freezeObject; -}); - -/*global define*/ -define('Core/defaultValue',[ - './freezeObject' - ], function( - freezeObject) { - 'use strict'; - - /** - * Returns the first parameter if not undefined, otherwise the second parameter. - * Useful for setting a default value for a parameter. - * - * @exports defaultValue - * - * @param {*} a - * @param {*} b - * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter. - * - * @example - * param = Cesium.defaultValue(param, 'default'); - */ - function defaultValue(a, b) { - if (a !== undefined) { - return a; - } - return b; - } - - /** - * A frozen empty object that can be used as the default value for options passed as - * an object literal. - */ - defaultValue.EMPTY_OBJECT = freezeObject({}); - - return defaultValue; -}); - /*global define*/ define('Core/DeveloperError',[ './defined' @@ -188,41 +126,13 @@ define('Core/DeveloperError',[ return DeveloperError; }); -/*global define*/ -define('Core/isArray',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Tests an object to see if it is an array. - * @exports isArray - * - * @param {Object} value The value to test. - * @returns {Boolean} true if the value is an array, false otherwise. - */ - var isArray = Array.isArray; - if (!defined(isArray)) { - isArray = function(value) { - return Object.prototype.toString.call(value) === '[object Array]'; - }; - } - - return isArray; -}); - /*global define*/ define('Core/Check',[ - './defaultValue', - './defined', - './DeveloperError', - './isArray' + './defined', + './DeveloperError' ], function( - defaultValue, defined, - DeveloperError, - isArray) { + DeveloperError) { 'use strict'; /** @@ -237,111 +147,134 @@ define('Core/Check',[ */ Check.typeOf = {}; - /** - * Contains functions for checking numeric conditions such as minimum and maximum values - */ - Check.numeric = {}; - function getUndefinedErrorMessage(name) { - return name + ' was required but undefined.'; + return name + ' is required, actual value was undefined'; } function getFailedTypeErrorMessage(actual, expected, name) { - return 'Expected ' + name + ' to be typeof ' + expected + ', got ' + actual; + return 'Expected ' + name + ' to be typeof ' + expected + ', actual typeof was ' + actual; } /** * Throws if test is not defined * - * @param {*} test The value that is to be checked * @param {String} name The name of the variable being tested + * @param {*} test The value that is to be checked * @exception {DeveloperError} test must be defined */ - Check.defined = function (test, name) { + Check.defined = function (name, test) { if (!defined(test)) { throw new DeveloperError(getUndefinedErrorMessage(name)); } }; /** - * Throws if test is greater than maximum + * Throws if test is not typeof 'function' * - * @param {Number} test The value to test - * @param {Number} maximum The maximum allowed value - * @exception {DeveloperError} test must not be greater than maximum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'function' */ - Check.numeric.maximum = function (test, maximum) { - Check.typeOf.number(test); - Check.typeOf.number(maximum); - if (test > maximum) { - throw new DeveloperError('Expected ' + test + ' to be at most ' + maximum); + Check.typeOf.func = function (name, test) { + if (typeof test !== 'function') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); } }; /** - * Throws if test is less than minimum + * Throws if test is not typeof 'string' * - * @param {Number} test The value to test - * @param {Number} minimum The minimum allowed value - * @exception {DeveloperError} test must not be less than mininum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'string' */ - Check.numeric.minimum = function (test, minimum) { - Check.typeOf.number(test); - Check.typeOf.number(minimum); - if (test < minimum) { - throw new DeveloperError('Expected ' + test + ' to be at least ' + minimum); + Check.typeOf.string = function (name, test) { + if (typeof test !== 'string') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); } }; /** - * Throws if test is not typeof 'function' + * Throws if test is not typeof 'number' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'function' + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'number' */ - Check.typeOf.function = function (test, name) { - if (typeof test !== 'function') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); + Check.typeOf.number = function (name, test) { + if (typeof test !== 'number') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); } }; /** - * Throws if test is not typeof 'string' + * Throws if test is not typeof 'number' and less than limit * + * @param {String} name The name of the variable being tested * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than limit + */ + Check.typeOf.number.lessThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test >= limit) { + throw new DeveloperError('Expected ' + name + ' to be less than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and less than or equal to limit + * * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'string' + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than or equal to limit */ - Check.typeOf.string = function (test, name) { - if (typeof test !== 'string') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); + Check.typeOf.number.lessThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test > limit) { + throw new DeveloperError('Expected ' + name + ' to be less than or equal to ' + limit + ', actual value was ' + test); } }; /** - * Throws if test is not typeof 'number' + * Throws if test is not typeof 'number' and greater than limit * + * @param {String} name The name of the variable being tested * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than limit + */ + Check.typeOf.number.greaterThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test <= limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and greater than or equal to limit + * * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'number' + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than or equal to limit */ - Check.typeOf.number = function (test, name) { - if (typeof test !== 'number') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); + Check.typeOf.number.greaterThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test < limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than or equal to' + limit + ', actual value was ' + test); } }; /** * Throws if test is not typeof 'object' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested + * @param {*} test The value to test * @exception {DeveloperError} test must be typeof 'object' */ - Check.typeOf.object = function (test, name) { + Check.typeOf.object = function (name, test) { if (typeof test !== 'object') { throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'object', name)); } @@ -350,11 +283,11 @@ define('Core/Check',[ /** * Throws if test is not typeof 'boolean' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested + * @param {*} test The value to test * @exception {DeveloperError} test must be typeof 'boolean' */ - Check.typeOf.boolean = function (test, name) { + Check.typeOf.bool = function (name, test) { if (typeof test !== 'boolean') { throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'boolean', name)); } @@ -363,6 +296,68 @@ define('Core/Check',[ return Check; }); +/*global define*/ +define('Core/freezeObject',[ + './defined' + ], function( + defined) { + 'use strict'; + + /** + * Freezes an object, using Object.freeze if available, otherwise returns + * the object unchanged. This function should be used in setup code to prevent + * errors from completely halting JavaScript execution in legacy browsers. + * + * @private + * + * @exports freezeObject + */ + var freezeObject = Object.freeze; + if (!defined(freezeObject)) { + freezeObject = function(o) { + return o; + }; + } + + return freezeObject; +}); + +/*global define*/ +define('Core/defaultValue',[ + './freezeObject' + ], function( + freezeObject) { + 'use strict'; + + /** + * Returns the first parameter if not undefined, otherwise the second parameter. + * Useful for setting a default value for a parameter. + * + * @exports defaultValue + * + * @param {*} a + * @param {*} b + * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter. + * + * @example + * param = Cesium.defaultValue(param, 'default'); + */ + function defaultValue(a, b) { + if (a !== undefined) { + return a; + } + return b; + } + + /** + * A frozen empty object that can be used as the default value for options passed as + * an object literal. + */ + defaultValue.EMPTY_OBJECT = freezeObject({}); + + return defaultValue; +}); + /* I've wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace so it's better encapsulated. Now you can have multiple random number generators @@ -1047,7 +1042,7 @@ define('Core/Math',[ if (!defined(angle)) { throw new DeveloperError('angle is required.'); } - + return CesiumMath.clamp(angle, -1*CesiumMath.PI_OVER_TWO, CesiumMath.PI_OVER_TWO); }; @@ -1057,11 +1052,11 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [<code>-CesiumMath.PI</code>, <code>CesiumMath.PI</code>]. */ - CesiumMath.negativePiToPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.negativePiToPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - return CesiumMath.zeroToTwoPi(x + CesiumMath.PI) - CesiumMath.PI; + return CesiumMath.zeroToTwoPi(angle + CesiumMath.PI) - CesiumMath.PI; }; /** @@ -1070,12 +1065,12 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [0, <code>CesiumMath.TWO_PI</code>]. */ - CesiumMath.zeroToTwoPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.zeroToTwoPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - var mod = CesiumMath.mod(x, CesiumMath.TWO_PI); - if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(x) > CesiumMath.EPSILON14) { + var mod = CesiumMath.mod(angle, CesiumMath.TWO_PI); + if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(angle) > CesiumMath.EPSILON14) { return CesiumMath.TWO_PI; } return mod; @@ -1145,7 +1140,7 @@ define('Core/Math',[ * @example * //Compute 7!, which is equal to 5040 * var computedFactorial = Cesium.Math.factorial(7); - * + * * @see {@link http://en.wikipedia.org/wiki/Factorial|Factorial on Wikipedia} */ CesiumMath.factorial = function(n) { @@ -1429,7 +1424,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.fromSpherical = function(spherical, result) { - Check.typeOf.object(spherical, 'spherical'); + Check.typeOf.object('spherical', spherical); if (!defined(result)) { result = new Cartesian3(); @@ -1513,8 +1508,8 @@ define('Core/Cartesian3',[ * @returns {Number[]} The array that was packed into */ Cartesian3.pack = function(value, array, startingIndex) { - Check.typeOf.object(value, 'value'); - Check.defined(array, 'array'); + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1534,7 +1529,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.unpack = function(array, startingIndex, result) { - Check.defined(array, 'array'); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1555,7 +1550,7 @@ define('Core/Cartesian3',[ * @returns {Number[]} The packed array. */ Cartesian3.packArray = function(array, result) { - Check.defined(array, 'array'); + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -1578,8 +1573,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3[]} The unpacked array. */ Cartesian3.unpackArray = function(array, result) { - Check.defined(array, 'array'); - Check.numeric.minimum(array.length, 3); + Check.defined('array', array); + Check.typeOf.number.greaterThanOrEquals('array.length', array.length, 3); if (array.length % 3 !== 0) { throw new DeveloperError('array length must be a multiple of 3.'); } @@ -1625,7 +1620,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the maximum component. */ Cartesian3.maximumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z); }; @@ -1637,7 +1632,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the minimum component. */ Cartesian3.minimumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z); }; @@ -1651,9 +1646,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the minimum components. */ Cartesian3.minimumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -1671,9 +1666,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the maximum components. */ Cartesian3.maximumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -1688,7 +1683,7 @@ define('Core/Cartesian3',[ * @returns {Number} The squared magnitude. */ Cartesian3.magnitudeSquared = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z; }; @@ -1717,8 +1712,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distance(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(2.0, 0.0, 0.0)); */ Cartesian3.distance = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitude(distanceScratch); @@ -1737,8 +1732,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distanceSquared(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(3.0, 0.0, 0.0)); */ Cartesian3.distanceSquared = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitudeSquared(distanceScratch); @@ -1752,8 +1747,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.normalize = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian3.magnitude(cartesian); @@ -1776,8 +1771,8 @@ define('Core/Cartesian3',[ * @returns {Number} The dot product. */ Cartesian3.dot = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z; }; @@ -1791,9 +1786,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyComponents = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -1835,9 +1830,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.add = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -1854,9 +1849,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.subtract = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -1873,9 +1868,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -1892,9 +1887,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.divideByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -1910,8 +1905,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.negate = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -1927,8 +1922,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.abs = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -1947,10 +1942,10 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.lerp = function(start, end, t, result) { - Check.typeOf.object(start, 'start'); - Check.typeOf.object(end, 'end'); - Check.typeOf.number(t, 't'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian3.multiplyByScalar(end, t, lerpScratch); result = Cartesian3.multiplyByScalar(start, 1.0 - t, result); @@ -1967,8 +1962,8 @@ define('Core/Cartesian3',[ * @returns {Number} The angle between the Cartesians. */ Cartesian3.angleBetween = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.normalize(left, angleBetweenScratch); Cartesian3.normalize(right, angleBetweenScratch2); @@ -1986,8 +1981,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The most orthogonal axis. */ Cartesian3.mostOrthogonalAxis = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian3.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian3.abs(f, f); @@ -2064,9 +2059,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The cross product. */ Cartesian3.cross = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var leftX = left.x; var leftY = left.y; @@ -2099,8 +2094,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromDegrees(-115.0, 37.0); */ Cartesian3.fromDegrees = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); longitude = CesiumMath.toRadians(longitude); latitude = CesiumMath.toRadians(latitude); @@ -2125,8 +2120,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromRadians(-2.007, 0.645); */ Cartesian3.fromRadians = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); height = defaultValue(height, 0.0); var radiiSquared = defined(ellipsoid) ? ellipsoid.radiiSquared : wgs84RadiiSquared; @@ -2160,7 +2155,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArray([-115.0, 37.0, -107.0, 33.0]); */ Cartesian3.fromDegreesArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -2194,7 +2189,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArray([-2.007, 0.645, -1.867, .575]); */ Cartesian3.fromRadiansArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -2228,7 +2223,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArrayHeights([-115.0, 37.0, 100000.0, -107.0, 33.0, 150000.0]); */ Cartesian3.fromDegreesArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -2263,7 +2258,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArrayHeights([-2.007, 0.645, 100000.0, -1.867, .575, 150000.0]); */ Cartesian3.fromRadiansArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -3010,7 +3005,9 @@ define('Core/Ellipsoid',[ /** * Computes an Ellipsoid from a Cartesian specifying the radii in x, y, and z directions. * - * @param {Cartesian3} [radii=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Cartesian3} [cartesian=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new + * instance should be created. * @returns {Ellipsoid} A new Ellipsoid instance. * * @exception {DeveloperError} All radii components must be greater than or equal to zero. @@ -3650,6 +3647,7 @@ define('Core/Interval',[ /*global define*/ define('Core/Matrix3',[ './Cartesian3', + './Check', './defaultValue', './defined', './defineProperties', @@ -3658,6 +3656,7 @@ define('Core/Matrix3',[ './Math' ], function( Cartesian3, + Check, defaultValue, defined, defineProperties, @@ -3720,13 +3719,8 @@ define('Core/Matrix3',[ * @returns {Number[]} The array that was packed into */ Matrix3.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3752,9 +3746,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. */ Matrix3.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3781,24 +3773,24 @@ define('Core/Matrix3',[ * @param {Matrix3} [result] The object onto which to store the result. * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. (Returns undefined if matrix is undefined) */ - Matrix3.clone = function(values, result) { - if (!defined(values)) { + Matrix3.clone = function(matrix, result) { + if (!defined(matrix)) { return undefined; } if (!defined(result)) { - return new Matrix3(values[0], values[3], values[6], - values[1], values[4], values[7], - values[2], values[5], values[8]); + return new Matrix3(matrix[0], matrix[3], matrix[6], + matrix[1], matrix[4], matrix[7], + matrix[2], matrix[5], matrix[8]); } - result[0] = values[0]; - result[1] = values[1]; - result[2] = values[2]; - result[3] = values[3]; - result[4] = values[4]; - result[5] = values[5]; - result[6] = values[6]; - result[7] = values[7]; - result[8] = values[8]; + result[0] = matrix[0]; + result[1] = matrix[1]; + result[2] = matrix[2]; + result[3] = matrix[3]; + result[4] = matrix[4]; + result[5] = matrix[5]; + result[6] = matrix[6]; + result[7] = matrix[7]; + result[8] = matrix[8]; return result; }; @@ -3824,9 +3816,7 @@ define('Core/Matrix3',[ * var m2 = Cesium.Matrix3.fromArray(v2, 2); */ Matrix3.fromArray = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3854,9 +3844,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values parameter is required'); - } + Check.defined('values', values); return Matrix3.clone(values, result); }; @@ -3870,9 +3858,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix3(values[0], values[1], values[2], @@ -3899,9 +3885,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this quaternion. */ Matrix3.fromQuaternion = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); var x2 = quaternion.x * quaternion.x; var xy = quaternion.x * quaternion.y; @@ -3951,10 +3935,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this headingPitchRoll. */ Matrix3.fromHeadingPitchRoll = function(headingPitchRoll, result) { - if (!defined(headingPitchRoll)) { - throw new DeveloperError('headingPitchRoll is required'); - } - var cosTheta = Math.cos(-headingPitchRoll.pitch); + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + + var cosTheta = Math.cos(-headingPitchRoll.pitch); var cosPsi = Math.cos(-headingPitchRoll.heading); var cosPhi = Math.cos(headingPitchRoll.roll); var sinTheta = Math.sin(-headingPitchRoll.pitch); @@ -4005,9 +3988,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix3( @@ -4043,9 +4024,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromUniformScale(2.0); */ Matrix3.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix3( @@ -4069,7 +4048,7 @@ define('Core/Matrix3',[ /** * Computes a Matrix3 instance representing the cross product equivalent matrix of a Cartesian3 vector. * - * @param {Cartesian3} the vector on the left hand side of the cross product operation. + * @param {Cartesian3} vector the vector on the left hand side of the cross product operation. * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created. * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. * @@ -4081,9 +4060,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromCrossProduct(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromCrossProduct = function(vector, result) { - if (!defined(vector)) { - throw new DeveloperError('vector is required.'); - } + Check.typeOf.object('vector', vector); if (!defined(result)) { return new Matrix3( @@ -4118,9 +4095,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationX = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4159,9 +4134,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationY = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4200,9 +4173,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationZ = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4236,9 +4207,7 @@ define('Core/Matrix3',[ * @returns {Number[]} The modified Array parameter or a new Array instance if one was not provided. */ Matrix3.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5], matrix[6], matrix[7], matrix[8]]; @@ -4272,12 +4241,10 @@ define('Core/Matrix3',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix3.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 2) { - throw new DeveloperError('row must be 0, 1, or 2.'); - } - if (typeof column !== 'number' || column < 0 || column > 2) { - throw new DeveloperError('column must be 0, 1, or 2.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 2); + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 2); return column * 3 + row; }; @@ -4293,16 +4260,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var startIndex = index * 3; var x = matrix[startIndex]; @@ -4327,18 +4288,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); var startIndex = index * 3; @@ -4359,15 +4313,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 3]; @@ -4391,18 +4340,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); result[index] = cartesian.x; @@ -4421,12 +4363,8 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[3], matrix[4], matrix[5], scratchColumn)); @@ -4457,15 +4395,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var column0Row0 = left[0] * right[0] + left[3] * right[1] + left[6] * right[2]; var column0Row1 = left[1] * right[0] + left[4] * right[1] + left[7] * right[2]; @@ -4500,15 +4432,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -4531,15 +4457,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -4562,15 +4482,9 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -4595,15 +4509,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -4634,15 +4542,9 @@ define('Core/Matrix3',[ * @see Matrix3.multiplyByUniformScale */ Matrix3.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); result[0] = matrix[0] * scale.x; result[1] = matrix[1] * scale.x; @@ -4664,12 +4566,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -4691,12 +4589,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var column0Row0 = matrix[0]; var column0Row1 = matrix[3]; @@ -4836,9 +4730,7 @@ define('Core/Matrix3',[ * var c = Cesium.Cartesian3.multiplyByScalar(v, lambda, new Cesium.Cartesian3()); // equal to Cesium.Matrix3.multiplyByVector(a, v) */ Matrix3.computeEigenDecomposition = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); // This routine was created based upon Matrix Computations, 3rd ed., by Golub and Van Loan, // section 8.4.3 The Classical Jacobi Algorithm @@ -4882,12 +4774,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -4909,9 +4797,7 @@ define('Core/Matrix3',[ * @returns {Number} The value of the determinant of the matrix. */ Matrix3.determinant = function(matrix) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); var m11 = matrix[0]; var m21 = matrix[3]; @@ -4936,12 +4822,8 @@ define('Core/Matrix3',[ * @exception {DeveloperError} matrix is not invertible. */ Matrix3.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var m11 = matrix[0]; var m21 = matrix[1]; @@ -5007,9 +4889,7 @@ define('Core/Matrix3',[ * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. */ Matrix3.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -5197,12 +5077,14 @@ define('Core/Matrix3',[ /*global define*/ define('Core/Cartesian4',[ + './Check', './defaultValue', './defined', './DeveloperError', './freezeObject', './Math' ], function( + Check, defaultValue, defined, DeveloperError, @@ -5285,9 +5167,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.fromColor = function(color, result) { - if (!defined(color)) { - throw new DeveloperError('color is required'); - } + Check.typeOf.object('color', color); if (!defined(result)) { return new Cartesian4(color.red, color.green, color.blue, color.alpha); } @@ -5339,12 +5219,8 @@ define('Core/Cartesian4',[ * @returns {Number[]} The array that was packed into */ Cartesian4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5365,9 +5241,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5389,9 +5263,7 @@ define('Core/Cartesian4',[ * @returns {Number[]} The packed array. */ Cartesian4.packArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -5414,9 +5286,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4[]} The unpacked array. */ Cartesian4.unpackArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -5459,9 +5329,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the maximum component. */ Cartesian4.maximumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -5473,9 +5341,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the minimum component. */ Cartesian4.minimumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -5489,15 +5355,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the minimum components. */ Cartesian4.minimumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -5516,15 +5376,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the maximum components. */ Cartesian4.maximumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -5541,9 +5395,7 @@ define('Core/Cartesian4',[ * @returns {Number} The squared magnitude. */ Cartesian4.magnitudeSquared = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z + cartesian.w * cartesian.w; }; @@ -5574,9 +5426,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(2.0, 0.0, 0.0, 0.0)); */ Cartesian4.distance = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitude(distanceScratch); @@ -5597,9 +5448,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(3.0, 0.0, 0.0, 0.0)); */ Cartesian4.distanceSquared = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitudeSquared(distanceScratch); @@ -5613,12 +5463,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.normalize = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian4.magnitude(cartesian); @@ -5642,12 +5488,8 @@ define('Core/Cartesian4',[ * @returns {Number} The dot product. */ Cartesian4.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w; }; @@ -5661,15 +5503,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -5687,15 +5523,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x / right.x; result.y = left.y / right.y; @@ -5713,15 +5543,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -5739,15 +5563,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -5765,15 +5583,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -5791,15 +5603,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -5816,12 +5622,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.negate = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -5838,12 +5640,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.abs = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -5863,18 +5661,10 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian4.multiplyByScalar(end, t, lerpScratch); result = Cartesian4.multiplyByScalar(start, 1.0 - t, result); @@ -5890,12 +5680,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The most orthogonal axis. */ Cartesian4.mostOrthogonalAxis = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian4.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian4.abs(f, f); @@ -6140,6 +5926,7 @@ define('Core/RuntimeError',[ define('Core/Matrix4',[ './Cartesian3', './Cartesian4', + './Check', './defaultValue', './defined', './defineProperties', @@ -6151,6 +5938,7 @@ define('Core/Matrix4',[ ], function( Cartesian3, Cartesian4, + Check, defaultValue, defined, defineProperties, @@ -6241,13 +6029,8 @@ define('Core/Matrix4',[ * @returns {Number[]} The array that was packed into */ Matrix4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -6280,9 +6063,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if one was not provided. */ Matrix4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -6378,9 +6159,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required'); - } + Check.defined('values', values); return Matrix4.clone(values, result); }; @@ -6394,9 +6173,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix4(values[0], values[1], values[2], values[3], @@ -6433,9 +6210,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRotationTranslation = function(rotation, translation, result) { - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } + Check.typeOf.object('rotation', rotation); translation = defaultValue(translation, Cartesian3.ZERO); @@ -6483,15 +6258,9 @@ define('Core/Matrix4',[ * result); */ Matrix4.fromTranslationQuaternionRotationScale = function(translation, rotation, scale, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('translation', translation); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('scale', scale); if (!defined(result)) { result = new Matrix4(); @@ -6552,9 +6321,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromTranslationRotationScale = function(translationRotationScale, result) { - if (!defined(translationRotationScale)) { - throw new DeveloperError('translationRotationScale is required.'); - } + Check.typeOf.object('translationRotationScale', translationRotationScale); return Matrix4.fromTranslationQuaternionRotationScale(translationRotationScale.translation, translationRotationScale.rotation, translationRotationScale.scale, result); }; @@ -6569,9 +6336,7 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByTranslation */ Matrix4.fromTranslation = function(translation, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } + Check.typeOf.object('translation', translation); return Matrix4.fromRotationTranslation(Matrix3.IDENTITY, translation, result); }; @@ -6592,9 +6357,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix4.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix4( @@ -6639,9 +6402,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromUniformScale(2.0); */ Matrix4.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix4(scale, 0.0, 0.0, 0.0, @@ -6681,23 +6442,15 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromCamera = function(camera, result) { - if (!defined(camera)) { - throw new DeveloperError('camera is required.'); - } + Check.typeOf.object('camera', camera); var position = camera.position; var direction = camera.direction; var up = camera.up; - if (!defined(position)) { - throw new DeveloperError('camera.position is required.'); - } - if (!defined(direction)) { - throw new DeveloperError('camera.direction is required.'); - } - if (!defined(up)) { - throw new DeveloperError('camera.up is required.'); - } + Check.typeOf.object('camera.position', position); + Check.typeOf.object('camera.direction', direction); + Check.typeOf.object('camera.up', up); Cartesian3.normalize(direction, fromCameraF); Cartesian3.normalize(Cartesian3.cross(fromCameraF, up, fromCameraR), fromCameraR); @@ -6776,21 +6529,11 @@ define('Core/Matrix4',[ * @exception {DeveloperError} far must be greater than zero. */ Matrix4.computePerspectiveFieldOfView = function(fovY, aspectRatio, near, far, result) { - if (fovY <= 0.0 || fovY > Math.PI) { - throw new DeveloperError('fovY must be in (0, PI].'); - } - if (aspectRatio <= 0.0) { - throw new DeveloperError('aspectRatio must be greater than zero.'); - } - if (near <= 0.0) { - throw new DeveloperError('near must be greater than zero.'); - } - if (far <= 0.0) { - throw new DeveloperError('far must be greater than zero.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThan('fovY', fovY, 0.0); + Check.typeOf.number.lessThan('fovY', fovY, Math.PI); + Check.typeOf.number.greaterThan('near', near, 0.0); + Check.typeOf.number.greaterThan('far', far, 0.0); + Check.typeOf.object('result', result); var bottom = Math.tan(fovY * 0.5); @@ -6831,27 +6574,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeOrthographicOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var a = 1.0 / (right - left); var b = 1.0 / (top - bottom); @@ -6896,27 +6625,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computePerspectiveOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -6957,24 +6672,12 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeInfinitePerspectiveOffCenter = function(left, right, bottom, top, near, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -7022,9 +6725,7 @@ define('Core/Matrix4',[ * }, 0.0, 1.0, new Cesium.Matrix4()); */ Matrix4.computeViewportTransformation = function(viewport, nearDepthRange, farDepthRange, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); viewport = defaultValue(viewport, defaultValue.EMPTY_OBJECT); var x = defaultValue(viewport.x, 0.0); @@ -7076,21 +6777,11 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeView = function(position, direction, up, right, result) { - if (!defined(position)) { - throw new DeveloperError('position is required'); - } - if (!defined(direction)) { - throw new DeveloperError('direction is required'); - } - if (!defined(up)) { - throw new DeveloperError('up is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); + Check.typeOf.object('up', up); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = right.x; result[1] = up.x; @@ -7131,9 +6822,7 @@ define('Core/Matrix4',[ * //creates a = [10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0] */ Matrix4.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], @@ -7177,12 +6866,11 @@ define('Core/Matrix4',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix4.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 3) { - throw new DeveloperError('row must be 0, 1, 2, or 3.'); - } - if (typeof column !== 'number' || column < 0 || column > 3) { - throw new DeveloperError('column must be 0, 1, 2, or 3.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 3); + + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 3); return column * 4 + row; }; @@ -7215,16 +6903,12 @@ define('Core/Matrix4',[ * // a.x = 12.0; a.y = 16.0; a.z = 20.0; a.w = 24.0; */ Matrix4.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var startIndex = index * 4; var x = matrix[startIndex]; @@ -7266,18 +6950,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 96.0, 25.0] */ Matrix4.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); var startIndex = index * 4; @@ -7295,18 +6974,12 @@ define('Core/Matrix4',[ * @param {Matrix4} matrix The matrix to use. * @param {Cartesian3} translation The translation that replaces the translation of the provided matrix. * @param {Cartesian4} result The object onto which to store the result. - * @returns {Matrix4} The modified result parameter. - */ - Matrix4.setTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + * @returns {Matrix4} The modified result parameter. + */ + Matrix4.setTranslation = function(matrix, translation, result) { + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -7359,16 +7032,12 @@ define('Core/Matrix4',[ * // a.x = 18.0; a.y = 19.0; a.z = 20.0; a.w = 21.0; */ Matrix4.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 4]; @@ -7409,18 +7078,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 24.0, 25.0] */ Matrix4.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); result[index] = cartesian.x; @@ -7440,12 +7104,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter */ Matrix4.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[4], matrix[5], matrix[6], scratchColumn)); @@ -7477,15 +7137,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -7569,15 +7223,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -7607,15 +7255,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -7656,15 +7298,9 @@ define('Core/Matrix4',[ * var m3 = Cesium.Matrix4.multiplyTransformation(m1, m2, new Cesium.Matrix4()); */ Matrix4.multiplyTransformation = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -7742,15 +7378,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByMatrix3(m, rotation, m); */ Matrix4.multiplyByMatrix3 = function(matrix, rotation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('result', result); var left0 = matrix[0]; var left1 = matrix[1]; @@ -7818,15 +7448,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByTranslation(m, position, m); */ Matrix4.multiplyByTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); var x = translation.x; var y = translation.y; @@ -7878,15 +7502,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByScale */ Matrix4.multiplyByUniformScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scale', scale); + Check.typeOf.object('result', result); uniformScaleScratch.x = scale; uniformScaleScratch.y = scale; @@ -7915,15 +7533,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByUniformScale */ Matrix4.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); var scaleX = scale.x; var scaleY = scale.y; @@ -7962,15 +7574,9 @@ define('Core/Matrix4',[ * @returns {Cartesian4} The modified result parameter. */ Matrix4.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8006,15 +7612,9 @@ define('Core/Matrix4',[ * // Cesium.Matrix4.multiplyByVector(matrix, new Cesium.Cartesian4(p.x, p.y, p.z, 0.0), result); */ Matrix4.multiplyByPointAsVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8044,16 +7644,9 @@ define('Core/Matrix4',[ * var result = Cesium.Matrix4.multiplyByPoint(matrix, p, new Cesium.Cartesian3()); */ Matrix4.multiplyByPoint = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8093,15 +7686,9 @@ define('Core/Matrix4',[ * // [-44.0, -46.0, -48.0, -50.0] */ Matrix4.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -8145,12 +7732,8 @@ define('Core/Matrix4',[ * // [-22.0, -23.0, -24.0, -25.0] */ Matrix4.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -8194,12 +7777,8 @@ define('Core/Matrix4',[ * // [13.0, 17.0, 21.0, 25.0] */ Matrix4.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var matrix1 = matrix[1]; var matrix2 = matrix[2]; @@ -8235,12 +7814,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -8354,9 +7929,7 @@ define('Core/Matrix4',[ * //Prints "Difference between both the matrices is not less than 0.1" on the console */ Matrix4.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -8387,12 +7960,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter. */ Matrix4.getTranslation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = matrix[12]; result.y = matrix[13]; @@ -8423,12 +7992,8 @@ define('Core/Matrix4',[ * // [12.0, 16.0, 20.0] */ Matrix4.getRotation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -8460,12 +8025,8 @@ define('Core/Matrix4',[ * @exception {RuntimeError} matrix is not invertible because its determinate is zero. */ Matrix4.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); // Special case for a zero scale matrix that can occur, for example, // when a model's node has a [0, 0, 0] scale. @@ -8603,12 +8164,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.inverseTransformation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); //This function is an optimized version of the below 4 lines. //var rT = Matrix3.transpose(Matrix4.getRotation(matrix)); @@ -8892,6 +8449,7 @@ define('Core/Matrix4',[ /*global define*/ define('Core/Rectangle',[ './Cartographic', + './Check', './defaultValue', './defined', './defineProperties', @@ -8901,6 +8459,7 @@ define('Core/Rectangle',[ './Math' ], function( Cartographic, + Check, defaultValue, defined, defineProperties, @@ -8997,13 +8556,8 @@ define('Core/Rectangle',[ * @returns {Number[]} The array that was packed into */ Rectangle.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -9024,9 +8578,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -9047,9 +8599,7 @@ define('Core/Rectangle',[ * @returns {Number} The width. */ Rectangle.computeWidth = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; if (east < west) { @@ -9064,9 +8614,7 @@ define('Core/Rectangle',[ * @returns {Number} The height. */ Rectangle.computeHeight = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); return rectangle.north - rectangle.south; }; @@ -9101,6 +8649,32 @@ define('Core/Rectangle',[ return result; }; + /** + * Creates an rectangle given the boundary longitude and latitude in radians. + * + * @param {Number} [west=0.0] The westernmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [south=0.0] The southernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Number} [east=0.0] The easternmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [north=0.0] The northernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Rectangle} [result] The object onto which to store the result, or undefined if a new instance should be created. + * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. + * + * @example + * var rectangle = Cesium.Rectangle.fromRadians(0.0, Math.PI/4, Math.PI/8, 3*Math.PI/4); + */ + Rectangle.fromRadians = function(west, south, east, north, result) { + if (!defined(result)) { + return new Rectangle(west, south, east, north); + } + + result.west = defaultValue(west, 0.0); + result.south = defaultValue(south, 0.0); + result.east = defaultValue(east, 0.0); + result.north = defaultValue(north, 0.0); + + return result; + }; + /** * Creates the smallest possible Rectangle that encloses all positions in the provided array. * @@ -9109,9 +8683,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartographicArray = function(cartographics, result) { - if (!defined(cartographics)) { - throw new DeveloperError('cartographics is required.'); - } + Check.defined('cartographics', cartographics); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -9164,9 +8736,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartesianArray = function(cartesians, ellipsoid, result) { - if (!defined(cartesians)) { - throw new DeveloperError('cartesians is required.'); - } + Check.defined('cartesians', cartesians); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -9282,9 +8852,7 @@ define('Core/Rectangle',[ * @returns {Boolean} <code>true</code> if the Rectangles are within the provided epsilon, <code>false</code> otherwise. */ Rectangle.prototype.equalsEpsilon = function(other, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon is required and must be a number.'); - } + Check.typeOf.number('epsilon', epsilon); return defined(other) && (Math.abs(this.west - other.west) <= epsilon) && @@ -9304,45 +8872,23 @@ define('Core/Rectangle',[ * @exception {DeveloperError} <code>west</code> must be in the interval [<code>-Pi</code>, <code>Pi</code>]. */ Rectangle.validate = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var north = rectangle.north; - if (typeof north !== 'number') { - throw new DeveloperError('north is required to be a number.'); - } - - if (north < -CesiumMath.PI_OVER_TWO || north > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('north must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('north', north, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('north', north, CesiumMath.PI_OVER_TWO); var south = rectangle.south; - if (typeof south !== 'number') { - throw new DeveloperError('south is required to be a number.'); - } - - if (south < -CesiumMath.PI_OVER_TWO || south > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('south must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('south', south, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('south', south, CesiumMath.PI_OVER_TWO); var west = rectangle.west; - if (typeof west !== 'number') { - throw new DeveloperError('west is required to be a number.'); - } - - if (west < -Math.PI || west > Math.PI) { - throw new DeveloperError('west must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('west', west, -Math.PI); + Check.typeOf.number.lessThanOrEquals('west', west, Math.PI); var east = rectangle.east; - if (typeof east !== 'number') { - throw new DeveloperError('east is required to be a number.'); - } - - if (east < -Math.PI || east > Math.PI) { - throw new DeveloperError('east must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('east', east, -Math.PI); + Check.typeOf.number.lessThanOrEquals('east', east, Math.PI); }; /** @@ -9353,9 +8899,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.south); @@ -9374,9 +8918,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.north); @@ -9395,9 +8937,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.north); @@ -9416,9 +8956,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.south); @@ -9437,9 +8975,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.center = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; @@ -9474,12 +9010,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.intersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var rectangleEast = rectangle.east; var rectangleWest = rectangle.west; @@ -9535,12 +9067,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.simpleIntersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var west = Math.max(rectangle.west, otherRectangle.west); var south = Math.max(rectangle.south, otherRectangle.south); @@ -9571,12 +9099,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.union = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); if (!defined(result)) { result = new Rectangle(); @@ -9620,12 +9144,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.expand = function(rectangle, cartographic, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); if (!defined(result)) { result = new Rectangle(); @@ -9647,12 +9167,8 @@ define('Core/Rectangle',[ * @returns {Boolean} true if the provided cartographic is inside the rectangle, false otherwise. */ Rectangle.contains = function(rectangle, cartographic) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); var longitude = cartographic.longitude; var latitude = cartographic.latitude; @@ -9685,9 +9201,7 @@ define('Core/Rectangle',[ * @returns {Cartesian3[]} The modified result parameter or a new Array of Cartesians instances if none was provided. */ Rectangle.subsample = function(rectangle, ellipsoid, surfaceHeight, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84); surfaceHeight = defaultValue(surfaceHeight, 0.0); @@ -9765,9 +9279,9 @@ define('Core/Rectangle',[ define('Core/BoundingSphere',[ './Cartesian3', './Cartographic', + './Check', './defaultValue', './defined', - './DeveloperError', './Ellipsoid', './GeographicProjection', './Intersect', @@ -9778,9 +9292,9 @@ define('Core/BoundingSphere',[ ], function( Cartesian3, Cartographic, + Check, defaultValue, defined, - DeveloperError, Ellipsoid, GeographicProjection, Intersect, @@ -10110,9 +9624,7 @@ define('Core/BoundingSphere',[ stride = defaultValue(stride, 3); - if (stride < 3) { - throw new DeveloperError('stride must be 3 or greater.'); - } + Check.typeOf.number.greaterThanOrEquals('stride', stride, 3); var currentPos = fromPointsCurrentPos; currentPos.x = positions[0] + center.x; @@ -10416,9 +9928,8 @@ define('Core/BoundingSphere',[ * var sphere = Cesium.BoundingSphere.fromCornerPoints(new Cesium.Cartesian3(-0.5, -0.5, -0.5), new Cesium.Cartesian3(0.5, 0.5, 0.5)); */ BoundingSphere.fromCornerPoints = function(corner, oppositeCorner, result) { - if (!defined(corner) || !defined(oppositeCorner)) { - throw new DeveloperError('corner and oppositeCorner are required.'); - } + Check.typeOf.object('corner', corner); + Check.typeOf.object('oppositeCorner', oppositeCorner); if (!defined(result)) { result = new BoundingSphere(); @@ -10442,9 +9953,7 @@ define('Core/BoundingSphere',[ * var boundingSphere = Cesium.BoundingSphere.fromEllipsoid(ellipsoid); */ BoundingSphere.fromEllipsoid = function(ellipsoid, result) { - if (!defined(ellipsoid)) { - throw new DeveloperError('ellipsoid is required.'); - } + Check.typeOf.object('ellipsoid', ellipsoid); if (!defined(result)) { result = new BoundingSphere(); @@ -10570,13 +10079,8 @@ define('Core/BoundingSphere',[ * @returns {Number[]} The array that was packed into */ BoundingSphere.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -10598,9 +10102,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if one was not provided. */ BoundingSphere.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -10627,13 +10129,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.union = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); if (!defined(result)) { result = new BoundingSphere(); @@ -10682,13 +10179,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.expand = function(sphere, point, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(point)) { - throw new DeveloperError('point is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('point', point); result = BoundingSphere.clone(sphere, result); @@ -10711,13 +10203,8 @@ define('Core/BoundingSphere',[ * intersects the plane. */ BoundingSphere.intersectPlane = function(sphere, plane) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(plane)) { - throw new DeveloperError('plane is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('plane', plane); var center = sphere.center; var radius = sphere.radius; @@ -10743,13 +10230,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.transform = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -10777,12 +10259,8 @@ define('Core/BoundingSphere',[ * }); */ BoundingSphere.distanceSquaredTo = function(sphere, cartesian) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('cartesian', cartesian); var diff = Cartesian3.subtract(sphere.center, cartesian, distanceSquaredToScratch); return Cartesian3.magnitudeSquared(diff) - sphere.radius * sphere.radius; @@ -10804,13 +10282,8 @@ define('Core/BoundingSphere',[ * var newBoundingSphere = Cesium.BoundingSphere.transformWithoutScale(boundingSphere, modelMatrix); */ BoundingSphere.transformWithoutScale = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -10837,17 +10310,9 @@ define('Core/BoundingSphere',[ * @returns {Interval} The nearest and farthest distances on the bounding sphere from position in direction. */ BoundingSphere.computePlaneDistances = function(sphere, position, direction, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(position)) { - throw new DeveloperError('position is required.'); - } - - if (!defined(direction)) { - throw new DeveloperError('direction is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); if (!defined(result)) { result = new Interval(); @@ -10882,9 +10347,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.projectTo2D = function(sphere, projection, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } + Check.typeOf.object('sphere', sphere); projection = defaultValue(projection, projectTo2DProjection); @@ -10979,12 +10442,8 @@ define('Core/BoundingSphere',[ * @returns {Boolean} <code>true</code> if the sphere is not visible; otherwise <code>false</code>. */ BoundingSphere.isOccluded = function(sphere, occluder) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(occluder)) { - throw new DeveloperError('occluder is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('occluder', occluder); return !occluder.isBoundingSphereVisible(sphere); }; @@ -12193,7 +11652,10 @@ define('Core/WebGLConstants',[ COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : 0x9279, TEXTURE_IMMUTABLE_FORMAT : 0x912F, MAX_ELEMENT_INDEX : 0x8D6B, - TEXTURE_IMMUTABLE_LEVELS : 0x82DF + TEXTURE_IMMUTABLE_LEVELS : 0x82DF, + + // Extensions + MAX_TEXTURE_MAX_ANISOTROPY_EXT : 0x84FF }; return freezeObject(WebGLConstants); @@ -12723,7 +12185,7 @@ define('Core/Geometry',[ * <li><code>position</code> - 3D vertex position. 64-bit floating-point (for precision). 3 components per attribute. See {@link VertexFormat#position}.</li> * <li><code>normal</code> - Normal (normalized), commonly used for lighting. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#normal}.</li> * <li><code>st</code> - 2D texture coordinate. 32-bit floating-point. 2 components per attribute. See {@link VertexFormat#st}.</li> - * <li><code>binormal</code> - Binormal (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#binormal}.</li> + * <li><code>bitangent</code> - Bitangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#bitangent}.</li> * <li><code>tangent</code> - Tangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#tangent}.</li> * </ul> * </p> @@ -12752,7 +12214,7 @@ define('Core/Geometry',[ * componentsPerAttribute : 3, * values : new Float32Array(0) * }); - * + * * @see GeometryAttribute * @see VertexFormat */ @@ -13033,7 +12495,7 @@ define('Core/GeometryAttributes',[ this.st = options.st; /** - * The binormal attribute (normalized), which is used for tangent-space effects like bump mapping. + * The bitangent attribute (normalized), which is used for tangent-space effects like bump mapping. * <p> * 32-bit floating-point. 3 components per attribute. * </p> @@ -13042,7 +12504,7 @@ define('Core/GeometryAttributes',[ * * @default undefined */ - this.binormal = options.binormal; + this.bitangent = options.bitangent; /** * The tangent attribute (normalized), which is used for tangent-space effects like bump mapping. diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createCircleGeometry.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createCircleGeometry.js index 449b74fd..fcddefcd 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createCircleGeometry.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createCircleGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,68 +45,6 @@ define('Core/defined',[],function() { return defined; }); -/*global define*/ -define('Core/freezeObject',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Freezes an object, using Object.freeze if available, otherwise returns - * the object unchanged. This function should be used in setup code to prevent - * errors from completely halting JavaScript execution in legacy browsers. - * - * @private - * - * @exports freezeObject - */ - var freezeObject = Object.freeze; - if (!defined(freezeObject)) { - freezeObject = function(o) { - return o; - }; - } - - return freezeObject; -}); - -/*global define*/ -define('Core/defaultValue',[ - './freezeObject' - ], function( - freezeObject) { - 'use strict'; - - /** - * Returns the first parameter if not undefined, otherwise the second parameter. - * Useful for setting a default value for a parameter. - * - * @exports defaultValue - * - * @param {*} a - * @param {*} b - * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter. - * - * @example - * param = Cesium.defaultValue(param, 'default'); - */ - function defaultValue(a, b) { - if (a !== undefined) { - return a; - } - return b; - } - - /** - * A frozen empty object that can be used as the default value for options passed as - * an object literal. - */ - defaultValue.EMPTY_OBJECT = freezeObject({}); - - return defaultValue; -}); - /*global define*/ define('Core/DeveloperError',[ './defined' @@ -188,41 +126,13 @@ define('Core/DeveloperError',[ return DeveloperError; }); -/*global define*/ -define('Core/isArray',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Tests an object to see if it is an array. - * @exports isArray - * - * @param {Object} value The value to test. - * @returns {Boolean} true if the value is an array, false otherwise. - */ - var isArray = Array.isArray; - if (!defined(isArray)) { - isArray = function(value) { - return Object.prototype.toString.call(value) === '[object Array]'; - }; - } - - return isArray; -}); - /*global define*/ define('Core/Check',[ - './defaultValue', - './defined', - './DeveloperError', - './isArray' + './defined', + './DeveloperError' ], function( - defaultValue, defined, - DeveloperError, - isArray) { + DeveloperError) { 'use strict'; /** @@ -237,111 +147,134 @@ define('Core/Check',[ */ Check.typeOf = {}; - /** - * Contains functions for checking numeric conditions such as minimum and maximum values - */ - Check.numeric = {}; - function getUndefinedErrorMessage(name) { - return name + ' was required but undefined.'; + return name + ' is required, actual value was undefined'; } function getFailedTypeErrorMessage(actual, expected, name) { - return 'Expected ' + name + ' to be typeof ' + expected + ', got ' + actual; + return 'Expected ' + name + ' to be typeof ' + expected + ', actual typeof was ' + actual; } /** * Throws if test is not defined * - * @param {*} test The value that is to be checked * @param {String} name The name of the variable being tested + * @param {*} test The value that is to be checked * @exception {DeveloperError} test must be defined */ - Check.defined = function (test, name) { + Check.defined = function (name, test) { if (!defined(test)) { throw new DeveloperError(getUndefinedErrorMessage(name)); } }; /** - * Throws if test is greater than maximum + * Throws if test is not typeof 'function' * - * @param {Number} test The value to test - * @param {Number} maximum The maximum allowed value - * @exception {DeveloperError} test must not be greater than maximum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'function' */ - Check.numeric.maximum = function (test, maximum) { - Check.typeOf.number(test); - Check.typeOf.number(maximum); - if (test > maximum) { - throw new DeveloperError('Expected ' + test + ' to be at most ' + maximum); + Check.typeOf.func = function (name, test) { + if (typeof test !== 'function') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); } }; /** - * Throws if test is less than minimum + * Throws if test is not typeof 'string' * - * @param {Number} test The value to test - * @param {Number} minimum The minimum allowed value - * @exception {DeveloperError} test must not be less than mininum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'string' */ - Check.numeric.minimum = function (test, minimum) { - Check.typeOf.number(test); - Check.typeOf.number(minimum); - if (test < minimum) { - throw new DeveloperError('Expected ' + test + ' to be at least ' + minimum); + Check.typeOf.string = function (name, test) { + if (typeof test !== 'string') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); } }; /** - * Throws if test is not typeof 'function' + * Throws if test is not typeof 'number' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'function' + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'number' */ - Check.typeOf.function = function (test, name) { - if (typeof test !== 'function') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); + Check.typeOf.number = function (name, test) { + if (typeof test !== 'number') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); } }; /** - * Throws if test is not typeof 'string' + * Throws if test is not typeof 'number' and less than limit * + * @param {String} name The name of the variable being tested * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than limit + */ + Check.typeOf.number.lessThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test >= limit) { + throw new DeveloperError('Expected ' + name + ' to be less than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and less than or equal to limit + * * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'string' + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than or equal to limit */ - Check.typeOf.string = function (test, name) { - if (typeof test !== 'string') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); + Check.typeOf.number.lessThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test > limit) { + throw new DeveloperError('Expected ' + name + ' to be less than or equal to ' + limit + ', actual value was ' + test); } }; /** - * Throws if test is not typeof 'number' + * Throws if test is not typeof 'number' and greater than limit * + * @param {String} name The name of the variable being tested * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than limit + */ + Check.typeOf.number.greaterThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test <= limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and greater than or equal to limit + * * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'number' + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than or equal to limit */ - Check.typeOf.number = function (test, name) { - if (typeof test !== 'number') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); + Check.typeOf.number.greaterThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test < limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than or equal to' + limit + ', actual value was ' + test); } }; /** * Throws if test is not typeof 'object' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested + * @param {*} test The value to test * @exception {DeveloperError} test must be typeof 'object' */ - Check.typeOf.object = function (test, name) { + Check.typeOf.object = function (name, test) { if (typeof test !== 'object') { throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'object', name)); } @@ -350,11 +283,11 @@ define('Core/Check',[ /** * Throws if test is not typeof 'boolean' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested + * @param {*} test The value to test * @exception {DeveloperError} test must be typeof 'boolean' */ - Check.typeOf.boolean = function (test, name) { + Check.typeOf.bool = function (name, test) { if (typeof test !== 'boolean') { throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'boolean', name)); } @@ -363,6 +296,68 @@ define('Core/Check',[ return Check; }); +/*global define*/ +define('Core/freezeObject',[ + './defined' + ], function( + defined) { + 'use strict'; + + /** + * Freezes an object, using Object.freeze if available, otherwise returns + * the object unchanged. This function should be used in setup code to prevent + * errors from completely halting JavaScript execution in legacy browsers. + * + * @private + * + * @exports freezeObject + */ + var freezeObject = Object.freeze; + if (!defined(freezeObject)) { + freezeObject = function(o) { + return o; + }; + } + + return freezeObject; +}); + +/*global define*/ +define('Core/defaultValue',[ + './freezeObject' + ], function( + freezeObject) { + 'use strict'; + + /** + * Returns the first parameter if not undefined, otherwise the second parameter. + * Useful for setting a default value for a parameter. + * + * @exports defaultValue + * + * @param {*} a + * @param {*} b + * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter. + * + * @example + * param = Cesium.defaultValue(param, 'default'); + */ + function defaultValue(a, b) { + if (a !== undefined) { + return a; + } + return b; + } + + /** + * A frozen empty object that can be used as the default value for options passed as + * an object literal. + */ + defaultValue.EMPTY_OBJECT = freezeObject({}); + + return defaultValue; +}); + /* I've wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace so it's better encapsulated. Now you can have multiple random number generators @@ -1047,7 +1042,7 @@ define('Core/Math',[ if (!defined(angle)) { throw new DeveloperError('angle is required.'); } - + return CesiumMath.clamp(angle, -1*CesiumMath.PI_OVER_TWO, CesiumMath.PI_OVER_TWO); }; @@ -1057,11 +1052,11 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [<code>-CesiumMath.PI</code>, <code>CesiumMath.PI</code>]. */ - CesiumMath.negativePiToPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.negativePiToPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - return CesiumMath.zeroToTwoPi(x + CesiumMath.PI) - CesiumMath.PI; + return CesiumMath.zeroToTwoPi(angle + CesiumMath.PI) - CesiumMath.PI; }; /** @@ -1070,12 +1065,12 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [0, <code>CesiumMath.TWO_PI</code>]. */ - CesiumMath.zeroToTwoPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.zeroToTwoPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - var mod = CesiumMath.mod(x, CesiumMath.TWO_PI); - if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(x) > CesiumMath.EPSILON14) { + var mod = CesiumMath.mod(angle, CesiumMath.TWO_PI); + if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(angle) > CesiumMath.EPSILON14) { return CesiumMath.TWO_PI; } return mod; @@ -1145,7 +1140,7 @@ define('Core/Math',[ * @example * //Compute 7!, which is equal to 5040 * var computedFactorial = Cesium.Math.factorial(7); - * + * * @see {@link http://en.wikipedia.org/wiki/Factorial|Factorial on Wikipedia} */ CesiumMath.factorial = function(n) { @@ -1429,7 +1424,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.fromSpherical = function(spherical, result) { - Check.typeOf.object(spherical, 'spherical'); + Check.typeOf.object('spherical', spherical); if (!defined(result)) { result = new Cartesian3(); @@ -1513,8 +1508,8 @@ define('Core/Cartesian3',[ * @returns {Number[]} The array that was packed into */ Cartesian3.pack = function(value, array, startingIndex) { - Check.typeOf.object(value, 'value'); - Check.defined(array, 'array'); + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1534,7 +1529,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.unpack = function(array, startingIndex, result) { - Check.defined(array, 'array'); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1555,7 +1550,7 @@ define('Core/Cartesian3',[ * @returns {Number[]} The packed array. */ Cartesian3.packArray = function(array, result) { - Check.defined(array, 'array'); + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -1578,8 +1573,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3[]} The unpacked array. */ Cartesian3.unpackArray = function(array, result) { - Check.defined(array, 'array'); - Check.numeric.minimum(array.length, 3); + Check.defined('array', array); + Check.typeOf.number.greaterThanOrEquals('array.length', array.length, 3); if (array.length % 3 !== 0) { throw new DeveloperError('array length must be a multiple of 3.'); } @@ -1625,7 +1620,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the maximum component. */ Cartesian3.maximumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z); }; @@ -1637,7 +1632,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the minimum component. */ Cartesian3.minimumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z); }; @@ -1651,9 +1646,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the minimum components. */ Cartesian3.minimumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -1671,9 +1666,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the maximum components. */ Cartesian3.maximumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -1688,7 +1683,7 @@ define('Core/Cartesian3',[ * @returns {Number} The squared magnitude. */ Cartesian3.magnitudeSquared = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z; }; @@ -1717,8 +1712,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distance(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(2.0, 0.0, 0.0)); */ Cartesian3.distance = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitude(distanceScratch); @@ -1737,8 +1732,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distanceSquared(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(3.0, 0.0, 0.0)); */ Cartesian3.distanceSquared = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitudeSquared(distanceScratch); @@ -1752,8 +1747,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.normalize = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian3.magnitude(cartesian); @@ -1776,8 +1771,8 @@ define('Core/Cartesian3',[ * @returns {Number} The dot product. */ Cartesian3.dot = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z; }; @@ -1791,9 +1786,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyComponents = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -1835,9 +1830,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.add = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -1854,9 +1849,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.subtract = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -1873,9 +1868,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -1892,9 +1887,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.divideByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -1910,8 +1905,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.negate = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -1927,8 +1922,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.abs = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -1947,10 +1942,10 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.lerp = function(start, end, t, result) { - Check.typeOf.object(start, 'start'); - Check.typeOf.object(end, 'end'); - Check.typeOf.number(t, 't'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian3.multiplyByScalar(end, t, lerpScratch); result = Cartesian3.multiplyByScalar(start, 1.0 - t, result); @@ -1967,8 +1962,8 @@ define('Core/Cartesian3',[ * @returns {Number} The angle between the Cartesians. */ Cartesian3.angleBetween = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.normalize(left, angleBetweenScratch); Cartesian3.normalize(right, angleBetweenScratch2); @@ -1986,8 +1981,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The most orthogonal axis. */ Cartesian3.mostOrthogonalAxis = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian3.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian3.abs(f, f); @@ -2064,9 +2059,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The cross product. */ Cartesian3.cross = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var leftX = left.x; var leftY = left.y; @@ -2099,8 +2094,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromDegrees(-115.0, 37.0); */ Cartesian3.fromDegrees = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); longitude = CesiumMath.toRadians(longitude); latitude = CesiumMath.toRadians(latitude); @@ -2125,8 +2120,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromRadians(-2.007, 0.645); */ Cartesian3.fromRadians = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); height = defaultValue(height, 0.0); var radiiSquared = defined(ellipsoid) ? ellipsoid.radiiSquared : wgs84RadiiSquared; @@ -2160,7 +2155,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArray([-115.0, 37.0, -107.0, 33.0]); */ Cartesian3.fromDegreesArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -2194,7 +2189,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArray([-2.007, 0.645, -1.867, .575]); */ Cartesian3.fromRadiansArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -2228,7 +2223,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArrayHeights([-115.0, 37.0, 100000.0, -107.0, 33.0, 150000.0]); */ Cartesian3.fromDegreesArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -2263,7 +2258,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArrayHeights([-2.007, 0.645, 100000.0, -1.867, .575, 150000.0]); */ Cartesian3.fromRadiansArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -3010,7 +3005,9 @@ define('Core/Ellipsoid',[ /** * Computes an Ellipsoid from a Cartesian specifying the radii in x, y, and z directions. * - * @param {Cartesian3} [radii=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Cartesian3} [cartesian=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new + * instance should be created. * @returns {Ellipsoid} A new Ellipsoid instance. * * @exception {DeveloperError} All radii components must be greater than or equal to zero. @@ -3650,6 +3647,7 @@ define('Core/Interval',[ /*global define*/ define('Core/Matrix3',[ './Cartesian3', + './Check', './defaultValue', './defined', './defineProperties', @@ -3658,6 +3656,7 @@ define('Core/Matrix3',[ './Math' ], function( Cartesian3, + Check, defaultValue, defined, defineProperties, @@ -3720,13 +3719,8 @@ define('Core/Matrix3',[ * @returns {Number[]} The array that was packed into */ Matrix3.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3752,9 +3746,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. */ Matrix3.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3781,24 +3773,24 @@ define('Core/Matrix3',[ * @param {Matrix3} [result] The object onto which to store the result. * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. (Returns undefined if matrix is undefined) */ - Matrix3.clone = function(values, result) { - if (!defined(values)) { + Matrix3.clone = function(matrix, result) { + if (!defined(matrix)) { return undefined; } if (!defined(result)) { - return new Matrix3(values[0], values[3], values[6], - values[1], values[4], values[7], - values[2], values[5], values[8]); + return new Matrix3(matrix[0], matrix[3], matrix[6], + matrix[1], matrix[4], matrix[7], + matrix[2], matrix[5], matrix[8]); } - result[0] = values[0]; - result[1] = values[1]; - result[2] = values[2]; - result[3] = values[3]; - result[4] = values[4]; - result[5] = values[5]; - result[6] = values[6]; - result[7] = values[7]; - result[8] = values[8]; + result[0] = matrix[0]; + result[1] = matrix[1]; + result[2] = matrix[2]; + result[3] = matrix[3]; + result[4] = matrix[4]; + result[5] = matrix[5]; + result[6] = matrix[6]; + result[7] = matrix[7]; + result[8] = matrix[8]; return result; }; @@ -3824,9 +3816,7 @@ define('Core/Matrix3',[ * var m2 = Cesium.Matrix3.fromArray(v2, 2); */ Matrix3.fromArray = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3854,9 +3844,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values parameter is required'); - } + Check.defined('values', values); return Matrix3.clone(values, result); }; @@ -3870,9 +3858,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix3(values[0], values[1], values[2], @@ -3899,9 +3885,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this quaternion. */ Matrix3.fromQuaternion = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); var x2 = quaternion.x * quaternion.x; var xy = quaternion.x * quaternion.y; @@ -3951,10 +3935,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this headingPitchRoll. */ Matrix3.fromHeadingPitchRoll = function(headingPitchRoll, result) { - if (!defined(headingPitchRoll)) { - throw new DeveloperError('headingPitchRoll is required'); - } - var cosTheta = Math.cos(-headingPitchRoll.pitch); + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + + var cosTheta = Math.cos(-headingPitchRoll.pitch); var cosPsi = Math.cos(-headingPitchRoll.heading); var cosPhi = Math.cos(headingPitchRoll.roll); var sinTheta = Math.sin(-headingPitchRoll.pitch); @@ -4005,9 +3988,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix3( @@ -4043,9 +4024,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromUniformScale(2.0); */ Matrix3.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix3( @@ -4069,7 +4048,7 @@ define('Core/Matrix3',[ /** * Computes a Matrix3 instance representing the cross product equivalent matrix of a Cartesian3 vector. * - * @param {Cartesian3} the vector on the left hand side of the cross product operation. + * @param {Cartesian3} vector the vector on the left hand side of the cross product operation. * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created. * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. * @@ -4081,9 +4060,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromCrossProduct(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromCrossProduct = function(vector, result) { - if (!defined(vector)) { - throw new DeveloperError('vector is required.'); - } + Check.typeOf.object('vector', vector); if (!defined(result)) { return new Matrix3( @@ -4118,9 +4095,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationX = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4159,9 +4134,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationY = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4200,9 +4173,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationZ = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4236,9 +4207,7 @@ define('Core/Matrix3',[ * @returns {Number[]} The modified Array parameter or a new Array instance if one was not provided. */ Matrix3.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5], matrix[6], matrix[7], matrix[8]]; @@ -4272,12 +4241,10 @@ define('Core/Matrix3',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix3.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 2) { - throw new DeveloperError('row must be 0, 1, or 2.'); - } - if (typeof column !== 'number' || column < 0 || column > 2) { - throw new DeveloperError('column must be 0, 1, or 2.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 2); + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 2); return column * 3 + row; }; @@ -4293,16 +4260,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var startIndex = index * 3; var x = matrix[startIndex]; @@ -4327,18 +4288,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); var startIndex = index * 3; @@ -4359,15 +4313,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 3]; @@ -4391,18 +4340,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); result[index] = cartesian.x; @@ -4421,12 +4363,8 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[3], matrix[4], matrix[5], scratchColumn)); @@ -4457,15 +4395,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var column0Row0 = left[0] * right[0] + left[3] * right[1] + left[6] * right[2]; var column0Row1 = left[1] * right[0] + left[4] * right[1] + left[7] * right[2]; @@ -4500,15 +4432,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -4531,15 +4457,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -4562,15 +4482,9 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -4595,15 +4509,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -4634,15 +4542,9 @@ define('Core/Matrix3',[ * @see Matrix3.multiplyByUniformScale */ Matrix3.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); result[0] = matrix[0] * scale.x; result[1] = matrix[1] * scale.x; @@ -4664,12 +4566,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -4691,12 +4589,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var column0Row0 = matrix[0]; var column0Row1 = matrix[3]; @@ -4836,9 +4730,7 @@ define('Core/Matrix3',[ * var c = Cesium.Cartesian3.multiplyByScalar(v, lambda, new Cesium.Cartesian3()); // equal to Cesium.Matrix3.multiplyByVector(a, v) */ Matrix3.computeEigenDecomposition = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); // This routine was created based upon Matrix Computations, 3rd ed., by Golub and Van Loan, // section 8.4.3 The Classical Jacobi Algorithm @@ -4882,12 +4774,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -4909,9 +4797,7 @@ define('Core/Matrix3',[ * @returns {Number} The value of the determinant of the matrix. */ Matrix3.determinant = function(matrix) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); var m11 = matrix[0]; var m21 = matrix[3]; @@ -4936,12 +4822,8 @@ define('Core/Matrix3',[ * @exception {DeveloperError} matrix is not invertible. */ Matrix3.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var m11 = matrix[0]; var m21 = matrix[1]; @@ -5007,9 +4889,7 @@ define('Core/Matrix3',[ * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. */ Matrix3.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -5197,12 +5077,14 @@ define('Core/Matrix3',[ /*global define*/ define('Core/Cartesian4',[ + './Check', './defaultValue', './defined', './DeveloperError', './freezeObject', './Math' ], function( + Check, defaultValue, defined, DeveloperError, @@ -5285,9 +5167,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.fromColor = function(color, result) { - if (!defined(color)) { - throw new DeveloperError('color is required'); - } + Check.typeOf.object('color', color); if (!defined(result)) { return new Cartesian4(color.red, color.green, color.blue, color.alpha); } @@ -5339,12 +5219,8 @@ define('Core/Cartesian4',[ * @returns {Number[]} The array that was packed into */ Cartesian4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5365,9 +5241,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5389,9 +5263,7 @@ define('Core/Cartesian4',[ * @returns {Number[]} The packed array. */ Cartesian4.packArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -5414,9 +5286,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4[]} The unpacked array. */ Cartesian4.unpackArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -5459,9 +5329,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the maximum component. */ Cartesian4.maximumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -5473,9 +5341,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the minimum component. */ Cartesian4.minimumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -5489,15 +5355,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the minimum components. */ Cartesian4.minimumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -5516,15 +5376,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the maximum components. */ Cartesian4.maximumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -5541,9 +5395,7 @@ define('Core/Cartesian4',[ * @returns {Number} The squared magnitude. */ Cartesian4.magnitudeSquared = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z + cartesian.w * cartesian.w; }; @@ -5574,9 +5426,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(2.0, 0.0, 0.0, 0.0)); */ Cartesian4.distance = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitude(distanceScratch); @@ -5597,9 +5448,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(3.0, 0.0, 0.0, 0.0)); */ Cartesian4.distanceSquared = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitudeSquared(distanceScratch); @@ -5613,12 +5463,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.normalize = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian4.magnitude(cartesian); @@ -5642,12 +5488,8 @@ define('Core/Cartesian4',[ * @returns {Number} The dot product. */ Cartesian4.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w; }; @@ -5661,15 +5503,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -5687,15 +5523,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x / right.x; result.y = left.y / right.y; @@ -5713,15 +5543,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -5739,15 +5563,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -5765,15 +5583,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -5791,15 +5603,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -5816,12 +5622,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.negate = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -5838,12 +5640,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.abs = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -5863,18 +5661,10 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian4.multiplyByScalar(end, t, lerpScratch); result = Cartesian4.multiplyByScalar(start, 1.0 - t, result); @@ -5890,12 +5680,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The most orthogonal axis. */ Cartesian4.mostOrthogonalAxis = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian4.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian4.abs(f, f); @@ -6140,6 +5926,7 @@ define('Core/RuntimeError',[ define('Core/Matrix4',[ './Cartesian3', './Cartesian4', + './Check', './defaultValue', './defined', './defineProperties', @@ -6151,6 +5938,7 @@ define('Core/Matrix4',[ ], function( Cartesian3, Cartesian4, + Check, defaultValue, defined, defineProperties, @@ -6241,13 +6029,8 @@ define('Core/Matrix4',[ * @returns {Number[]} The array that was packed into */ Matrix4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -6280,9 +6063,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if one was not provided. */ Matrix4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -6378,9 +6159,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required'); - } + Check.defined('values', values); return Matrix4.clone(values, result); }; @@ -6394,9 +6173,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix4(values[0], values[1], values[2], values[3], @@ -6433,9 +6210,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRotationTranslation = function(rotation, translation, result) { - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } + Check.typeOf.object('rotation', rotation); translation = defaultValue(translation, Cartesian3.ZERO); @@ -6483,15 +6258,9 @@ define('Core/Matrix4',[ * result); */ Matrix4.fromTranslationQuaternionRotationScale = function(translation, rotation, scale, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('translation', translation); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('scale', scale); if (!defined(result)) { result = new Matrix4(); @@ -6552,9 +6321,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromTranslationRotationScale = function(translationRotationScale, result) { - if (!defined(translationRotationScale)) { - throw new DeveloperError('translationRotationScale is required.'); - } + Check.typeOf.object('translationRotationScale', translationRotationScale); return Matrix4.fromTranslationQuaternionRotationScale(translationRotationScale.translation, translationRotationScale.rotation, translationRotationScale.scale, result); }; @@ -6569,9 +6336,7 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByTranslation */ Matrix4.fromTranslation = function(translation, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } + Check.typeOf.object('translation', translation); return Matrix4.fromRotationTranslation(Matrix3.IDENTITY, translation, result); }; @@ -6592,9 +6357,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix4.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix4( @@ -6639,9 +6402,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromUniformScale(2.0); */ Matrix4.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix4(scale, 0.0, 0.0, 0.0, @@ -6681,23 +6442,15 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromCamera = function(camera, result) { - if (!defined(camera)) { - throw new DeveloperError('camera is required.'); - } + Check.typeOf.object('camera', camera); var position = camera.position; var direction = camera.direction; var up = camera.up; - if (!defined(position)) { - throw new DeveloperError('camera.position is required.'); - } - if (!defined(direction)) { - throw new DeveloperError('camera.direction is required.'); - } - if (!defined(up)) { - throw new DeveloperError('camera.up is required.'); - } + Check.typeOf.object('camera.position', position); + Check.typeOf.object('camera.direction', direction); + Check.typeOf.object('camera.up', up); Cartesian3.normalize(direction, fromCameraF); Cartesian3.normalize(Cartesian3.cross(fromCameraF, up, fromCameraR), fromCameraR); @@ -6776,21 +6529,11 @@ define('Core/Matrix4',[ * @exception {DeveloperError} far must be greater than zero. */ Matrix4.computePerspectiveFieldOfView = function(fovY, aspectRatio, near, far, result) { - if (fovY <= 0.0 || fovY > Math.PI) { - throw new DeveloperError('fovY must be in (0, PI].'); - } - if (aspectRatio <= 0.0) { - throw new DeveloperError('aspectRatio must be greater than zero.'); - } - if (near <= 0.0) { - throw new DeveloperError('near must be greater than zero.'); - } - if (far <= 0.0) { - throw new DeveloperError('far must be greater than zero.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThan('fovY', fovY, 0.0); + Check.typeOf.number.lessThan('fovY', fovY, Math.PI); + Check.typeOf.number.greaterThan('near', near, 0.0); + Check.typeOf.number.greaterThan('far', far, 0.0); + Check.typeOf.object('result', result); var bottom = Math.tan(fovY * 0.5); @@ -6831,27 +6574,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeOrthographicOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var a = 1.0 / (right - left); var b = 1.0 / (top - bottom); @@ -6896,27 +6625,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computePerspectiveOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -6957,24 +6672,12 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeInfinitePerspectiveOffCenter = function(left, right, bottom, top, near, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -7022,9 +6725,7 @@ define('Core/Matrix4',[ * }, 0.0, 1.0, new Cesium.Matrix4()); */ Matrix4.computeViewportTransformation = function(viewport, nearDepthRange, farDepthRange, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); viewport = defaultValue(viewport, defaultValue.EMPTY_OBJECT); var x = defaultValue(viewport.x, 0.0); @@ -7076,21 +6777,11 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeView = function(position, direction, up, right, result) { - if (!defined(position)) { - throw new DeveloperError('position is required'); - } - if (!defined(direction)) { - throw new DeveloperError('direction is required'); - } - if (!defined(up)) { - throw new DeveloperError('up is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); + Check.typeOf.object('up', up); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = right.x; result[1] = up.x; @@ -7131,9 +6822,7 @@ define('Core/Matrix4',[ * //creates a = [10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0] */ Matrix4.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], @@ -7177,12 +6866,11 @@ define('Core/Matrix4',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix4.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 3) { - throw new DeveloperError('row must be 0, 1, 2, or 3.'); - } - if (typeof column !== 'number' || column < 0 || column > 3) { - throw new DeveloperError('column must be 0, 1, 2, or 3.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 3); + + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 3); return column * 4 + row; }; @@ -7215,16 +6903,12 @@ define('Core/Matrix4',[ * // a.x = 12.0; a.y = 16.0; a.z = 20.0; a.w = 24.0; */ Matrix4.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var startIndex = index * 4; var x = matrix[startIndex]; @@ -7266,18 +6950,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 96.0, 25.0] */ Matrix4.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); var startIndex = index * 4; @@ -7298,15 +6977,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.setTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -7359,16 +7032,12 @@ define('Core/Matrix4',[ * // a.x = 18.0; a.y = 19.0; a.z = 20.0; a.w = 21.0; */ Matrix4.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 4]; @@ -7409,18 +7078,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 24.0, 25.0] */ Matrix4.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); result[index] = cartesian.x; @@ -7440,12 +7104,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter */ Matrix4.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[4], matrix[5], matrix[6], scratchColumn)); @@ -7477,15 +7137,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -7569,15 +7223,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -7607,15 +7255,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -7656,15 +7298,9 @@ define('Core/Matrix4',[ * var m3 = Cesium.Matrix4.multiplyTransformation(m1, m2, new Cesium.Matrix4()); */ Matrix4.multiplyTransformation = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -7742,15 +7378,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByMatrix3(m, rotation, m); */ Matrix4.multiplyByMatrix3 = function(matrix, rotation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('result', result); var left0 = matrix[0]; var left1 = matrix[1]; @@ -7818,15 +7448,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByTranslation(m, position, m); */ Matrix4.multiplyByTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); var x = translation.x; var y = translation.y; @@ -7878,15 +7502,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByScale */ Matrix4.multiplyByUniformScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scale', scale); + Check.typeOf.object('result', result); uniformScaleScratch.x = scale; uniformScaleScratch.y = scale; @@ -7915,15 +7533,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByUniformScale */ Matrix4.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); var scaleX = scale.x; var scaleY = scale.y; @@ -7962,15 +7574,9 @@ define('Core/Matrix4',[ * @returns {Cartesian4} The modified result parameter. */ Matrix4.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8006,15 +7612,9 @@ define('Core/Matrix4',[ * // Cesium.Matrix4.multiplyByVector(matrix, new Cesium.Cartesian4(p.x, p.y, p.z, 0.0), result); */ Matrix4.multiplyByPointAsVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8044,16 +7644,9 @@ define('Core/Matrix4',[ * var result = Cesium.Matrix4.multiplyByPoint(matrix, p, new Cesium.Cartesian3()); */ Matrix4.multiplyByPoint = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8093,15 +7686,9 @@ define('Core/Matrix4',[ * // [-44.0, -46.0, -48.0, -50.0] */ Matrix4.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -8145,12 +7732,8 @@ define('Core/Matrix4',[ * // [-22.0, -23.0, -24.0, -25.0] */ Matrix4.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -8194,12 +7777,8 @@ define('Core/Matrix4',[ * // [13.0, 17.0, 21.0, 25.0] */ Matrix4.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var matrix1 = matrix[1]; var matrix2 = matrix[2]; @@ -8235,12 +7814,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -8354,9 +7929,7 @@ define('Core/Matrix4',[ * //Prints "Difference between both the matrices is not less than 0.1" on the console */ Matrix4.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -8387,12 +7960,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter. */ Matrix4.getTranslation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = matrix[12]; result.y = matrix[13]; @@ -8423,12 +7992,8 @@ define('Core/Matrix4',[ * // [12.0, 16.0, 20.0] */ Matrix4.getRotation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -8460,12 +8025,8 @@ define('Core/Matrix4',[ * @exception {RuntimeError} matrix is not invertible because its determinate is zero. */ Matrix4.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); // Special case for a zero scale matrix that can occur, for example, // when a model's node has a [0, 0, 0] scale. @@ -8603,12 +8164,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.inverseTransformation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); //This function is an optimized version of the below 4 lines. //var rT = Matrix3.transpose(Matrix4.getRotation(matrix)); @@ -8892,6 +8449,7 @@ define('Core/Matrix4',[ /*global define*/ define('Core/Rectangle',[ './Cartographic', + './Check', './defaultValue', './defined', './defineProperties', @@ -8901,6 +8459,7 @@ define('Core/Rectangle',[ './Math' ], function( Cartographic, + Check, defaultValue, defined, defineProperties, @@ -8997,13 +8556,8 @@ define('Core/Rectangle',[ * @returns {Number[]} The array that was packed into */ Rectangle.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -9024,9 +8578,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -9047,9 +8599,7 @@ define('Core/Rectangle',[ * @returns {Number} The width. */ Rectangle.computeWidth = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; if (east < west) { @@ -9064,9 +8614,7 @@ define('Core/Rectangle',[ * @returns {Number} The height. */ Rectangle.computeHeight = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); return rectangle.north - rectangle.south; }; @@ -9102,16 +8650,40 @@ define('Core/Rectangle',[ }; /** - * Creates the smallest possible Rectangle that encloses all positions in the provided array. + * Creates an rectangle given the boundary longitude and latitude in radians. * - * @param {Cartographic[]} cartographics The list of Cartographic instances. + * @param {Number} [west=0.0] The westernmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [south=0.0] The southernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Number} [east=0.0] The easternmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [north=0.0] The northernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. * @param {Rectangle} [result] The object onto which to store the result, or undefined if a new instance should be created. * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. + * + * @example + * var rectangle = Cesium.Rectangle.fromRadians(0.0, Math.PI/4, Math.PI/8, 3*Math.PI/4); */ - Rectangle.fromCartographicArray = function(cartographics, result) { - if (!defined(cartographics)) { - throw new DeveloperError('cartographics is required.'); + Rectangle.fromRadians = function(west, south, east, north, result) { + if (!defined(result)) { + return new Rectangle(west, south, east, north); } + + result.west = defaultValue(west, 0.0); + result.south = defaultValue(south, 0.0); + result.east = defaultValue(east, 0.0); + result.north = defaultValue(north, 0.0); + + return result; + }; + + /** + * Creates the smallest possible Rectangle that encloses all positions in the provided array. + * + * @param {Cartographic[]} cartographics The list of Cartographic instances. + * @param {Rectangle} [result] The object onto which to store the result, or undefined if a new instance should be created. + * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. + */ + Rectangle.fromCartographicArray = function(cartographics, result) { + Check.defined('cartographics', cartographics); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -9164,9 +8736,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartesianArray = function(cartesians, ellipsoid, result) { - if (!defined(cartesians)) { - throw new DeveloperError('cartesians is required.'); - } + Check.defined('cartesians', cartesians); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -9282,9 +8852,7 @@ define('Core/Rectangle',[ * @returns {Boolean} <code>true</code> if the Rectangles are within the provided epsilon, <code>false</code> otherwise. */ Rectangle.prototype.equalsEpsilon = function(other, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon is required and must be a number.'); - } + Check.typeOf.number('epsilon', epsilon); return defined(other) && (Math.abs(this.west - other.west) <= epsilon) && @@ -9304,45 +8872,23 @@ define('Core/Rectangle',[ * @exception {DeveloperError} <code>west</code> must be in the interval [<code>-Pi</code>, <code>Pi</code>]. */ Rectangle.validate = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var north = rectangle.north; - if (typeof north !== 'number') { - throw new DeveloperError('north is required to be a number.'); - } - - if (north < -CesiumMath.PI_OVER_TWO || north > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('north must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('north', north, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('north', north, CesiumMath.PI_OVER_TWO); var south = rectangle.south; - if (typeof south !== 'number') { - throw new DeveloperError('south is required to be a number.'); - } - - if (south < -CesiumMath.PI_OVER_TWO || south > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('south must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('south', south, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('south', south, CesiumMath.PI_OVER_TWO); var west = rectangle.west; - if (typeof west !== 'number') { - throw new DeveloperError('west is required to be a number.'); - } - - if (west < -Math.PI || west > Math.PI) { - throw new DeveloperError('west must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('west', west, -Math.PI); + Check.typeOf.number.lessThanOrEquals('west', west, Math.PI); var east = rectangle.east; - if (typeof east !== 'number') { - throw new DeveloperError('east is required to be a number.'); - } - - if (east < -Math.PI || east > Math.PI) { - throw new DeveloperError('east must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('east', east, -Math.PI); + Check.typeOf.number.lessThanOrEquals('east', east, Math.PI); }; /** @@ -9353,9 +8899,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.south); @@ -9374,9 +8918,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.north); @@ -9395,9 +8937,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.north); @@ -9416,9 +8956,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.south); @@ -9437,9 +8975,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.center = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; @@ -9474,12 +9010,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.intersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var rectangleEast = rectangle.east; var rectangleWest = rectangle.west; @@ -9535,12 +9067,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.simpleIntersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var west = Math.max(rectangle.west, otherRectangle.west); var south = Math.max(rectangle.south, otherRectangle.south); @@ -9571,12 +9099,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.union = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); if (!defined(result)) { result = new Rectangle(); @@ -9620,12 +9144,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.expand = function(rectangle, cartographic, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); if (!defined(result)) { result = new Rectangle(); @@ -9647,12 +9167,8 @@ define('Core/Rectangle',[ * @returns {Boolean} true if the provided cartographic is inside the rectangle, false otherwise. */ Rectangle.contains = function(rectangle, cartographic) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); var longitude = cartographic.longitude; var latitude = cartographic.latitude; @@ -9685,9 +9201,7 @@ define('Core/Rectangle',[ * @returns {Cartesian3[]} The modified result parameter or a new Array of Cartesians instances if none was provided. */ Rectangle.subsample = function(rectangle, ellipsoid, surfaceHeight, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84); surfaceHeight = defaultValue(surfaceHeight, 0.0); @@ -9765,9 +9279,9 @@ define('Core/Rectangle',[ define('Core/BoundingSphere',[ './Cartesian3', './Cartographic', + './Check', './defaultValue', './defined', - './DeveloperError', './Ellipsoid', './GeographicProjection', './Intersect', @@ -9778,9 +9292,9 @@ define('Core/BoundingSphere',[ ], function( Cartesian3, Cartographic, + Check, defaultValue, defined, - DeveloperError, Ellipsoid, GeographicProjection, Intersect, @@ -10110,9 +9624,7 @@ define('Core/BoundingSphere',[ stride = defaultValue(stride, 3); - if (stride < 3) { - throw new DeveloperError('stride must be 3 or greater.'); - } + Check.typeOf.number.greaterThanOrEquals('stride', stride, 3); var currentPos = fromPointsCurrentPos; currentPos.x = positions[0] + center.x; @@ -10416,9 +9928,8 @@ define('Core/BoundingSphere',[ * var sphere = Cesium.BoundingSphere.fromCornerPoints(new Cesium.Cartesian3(-0.5, -0.5, -0.5), new Cesium.Cartesian3(0.5, 0.5, 0.5)); */ BoundingSphere.fromCornerPoints = function(corner, oppositeCorner, result) { - if (!defined(corner) || !defined(oppositeCorner)) { - throw new DeveloperError('corner and oppositeCorner are required.'); - } + Check.typeOf.object('corner', corner); + Check.typeOf.object('oppositeCorner', oppositeCorner); if (!defined(result)) { result = new BoundingSphere(); @@ -10442,9 +9953,7 @@ define('Core/BoundingSphere',[ * var boundingSphere = Cesium.BoundingSphere.fromEllipsoid(ellipsoid); */ BoundingSphere.fromEllipsoid = function(ellipsoid, result) { - if (!defined(ellipsoid)) { - throw new DeveloperError('ellipsoid is required.'); - } + Check.typeOf.object('ellipsoid', ellipsoid); if (!defined(result)) { result = new BoundingSphere(); @@ -10570,13 +10079,8 @@ define('Core/BoundingSphere',[ * @returns {Number[]} The array that was packed into */ BoundingSphere.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -10598,9 +10102,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if one was not provided. */ BoundingSphere.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -10627,13 +10129,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.union = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); if (!defined(result)) { result = new BoundingSphere(); @@ -10682,13 +10179,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.expand = function(sphere, point, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(point)) { - throw new DeveloperError('point is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('point', point); result = BoundingSphere.clone(sphere, result); @@ -10711,13 +10203,8 @@ define('Core/BoundingSphere',[ * intersects the plane. */ BoundingSphere.intersectPlane = function(sphere, plane) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(plane)) { - throw new DeveloperError('plane is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('plane', plane); var center = sphere.center; var radius = sphere.radius; @@ -10743,13 +10230,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.transform = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -10777,12 +10259,8 @@ define('Core/BoundingSphere',[ * }); */ BoundingSphere.distanceSquaredTo = function(sphere, cartesian) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('cartesian', cartesian); var diff = Cartesian3.subtract(sphere.center, cartesian, distanceSquaredToScratch); return Cartesian3.magnitudeSquared(diff) - sphere.radius * sphere.radius; @@ -10804,13 +10282,8 @@ define('Core/BoundingSphere',[ * var newBoundingSphere = Cesium.BoundingSphere.transformWithoutScale(boundingSphere, modelMatrix); */ BoundingSphere.transformWithoutScale = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -10837,17 +10310,9 @@ define('Core/BoundingSphere',[ * @returns {Interval} The nearest and farthest distances on the bounding sphere from position in direction. */ BoundingSphere.computePlaneDistances = function(sphere, position, direction, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(position)) { - throw new DeveloperError('position is required.'); - } - - if (!defined(direction)) { - throw new DeveloperError('direction is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); if (!defined(result)) { result = new Interval(); @@ -10882,9 +10347,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.projectTo2D = function(sphere, projection, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } + Check.typeOf.object('sphere', sphere); projection = defaultValue(projection, projectTo2DProjection); @@ -10979,12 +10442,8 @@ define('Core/BoundingSphere',[ * @returns {Boolean} <code>true</code> if the sphere is not visible; otherwise <code>false</code>. */ BoundingSphere.isOccluded = function(sphere, occluder) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(occluder)) { - throw new DeveloperError('occluder is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('occluder', occluder); return !occluder.isBoundingSphereVisible(sphere); }; @@ -11085,12 +10544,14 @@ define('Core/BoundingSphere',[ /*global define*/ define('Core/Cartesian2',[ + './Check', './defaultValue', './defined', './DeveloperError', './freezeObject', './Math' ], function( + Check, defaultValue, defined, DeveloperError, @@ -11202,12 +10663,8 @@ define('Core/Cartesian2',[ * @returns {Number[]} The array that was packed into */ Cartesian2.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -11226,9 +10683,7 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided. */ Cartesian2.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -11248,9 +10703,7 @@ define('Core/Cartesian2',[ * @returns {Number[]} The packed array. */ Cartesian2.packArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -11273,9 +10726,7 @@ define('Core/Cartesian2',[ * @returns {Cartesian2[]} The unpacked array. */ Cartesian2.unpackArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -11318,9 +10769,7 @@ define('Core/Cartesian2',[ * @returns {Number} The value of the maximum component. */ Cartesian2.maximumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y); }; @@ -11332,9 +10781,7 @@ define('Core/Cartesian2',[ * @returns {Number} The value of the minimum component. */ Cartesian2.minimumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y); }; @@ -11348,15 +10795,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} A cartesian with the minimum components. */ Cartesian2.minimumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); @@ -11374,15 +10815,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} A cartesian with the maximum components. */ Cartesian2.maximumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -11396,9 +10831,7 @@ define('Core/Cartesian2',[ * @returns {Number} The squared magnitude. */ Cartesian2.magnitudeSquared = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y; }; @@ -11464,12 +10897,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.normalize = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian2.magnitude(cartesian); @@ -11491,12 +10920,8 @@ define('Core/Cartesian2',[ * @returns {Number} The dot product. */ Cartesian2.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y; }; @@ -11510,15 +10935,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.multiplyComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -11534,15 +10953,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.divideComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x / right.x; result.y = left.y / right.y; @@ -11558,15 +10971,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -11582,15 +10989,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -11606,15 +11007,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.multiplyByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -11630,15 +11025,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.divideByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -11653,12 +11042,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.negate = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -11673,12 +11058,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.abs = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -11696,18 +11077,10 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian2.multiplyByScalar(end, t, lerpScratch); result = Cartesian2.multiplyByScalar(start, 1.0 - t, result); @@ -11724,12 +11097,8 @@ define('Core/Cartesian2',[ * @returns {Number} The angle between the Cartesians. */ Cartesian2.angleBetween = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian2.normalize(left, angleBetweenScratch); Cartesian2.normalize(right, angleBetweenScratch2); @@ -11745,12 +11114,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The most orthogonal axis. */ Cartesian2.mostOrthogonalAxis = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian2.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian2.abs(f, f); @@ -12988,7 +12353,10 @@ define('Core/WebGLConstants',[ COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : 0x9279, TEXTURE_IMMUTABLE_FORMAT : 0x912F, MAX_ELEMENT_INDEX : 0x8D6B, - TEXTURE_IMMUTABLE_LEVELS : 0x82DF + TEXTURE_IMMUTABLE_LEVELS : 0x82DF, + + // Extensions + MAX_TEXTURE_MAX_ANISOTROPY_EXT : 0x84FF }; return freezeObject(WebGLConstants); @@ -13324,6 +12692,7 @@ define('Core/ComponentDatatype',[ /*global define*/ define('Core/Quaternion',[ './Cartesian3', + './Check', './defaultValue', './defined', './DeveloperError', @@ -13333,6 +12702,7 @@ define('Core/Quaternion',[ './Matrix3' ], function( Cartesian3, + Check, defaultValue, defined, DeveloperError, @@ -13395,12 +12765,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided. */ Quaternion.fromAxisAngle = function(axis, angle, result) { - if (!defined(axis)) { - throw new DeveloperError('axis is required.'); - } - if (typeof angle !== 'number') { - throw new DeveloperError('angle is required and must be a number.'); - } + Check.typeOf.object('axis', axis); + Check.typeOf.number('angle', angle); var halfAngle = angle / 2.0; var s = Math.sin(halfAngle); @@ -13432,9 +12798,7 @@ define('Core/Quaternion',[ * @see Matrix3.fromQuaternion */ Quaternion.fromRotationMatrix = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); var root; var x; @@ -13508,15 +12872,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter or a new Quaternion instance if none was provided. */ Quaternion.fromHeadingPitchRoll = function(heading, pitch, roll, result) { - if (!defined(heading)) { - throw new DeveloperError('heading is required.'); - } - if (!defined(pitch)) { - throw new DeveloperError('pitch is required.'); - } - if (!defined(roll)) { - throw new DeveloperError('roll is required.'); - } + Check.typeOf.number('heading', heading); + Check.typeOf.number('pitch', pitch); + Check.typeOf.number('roll', roll); var rollQuaternion = Quaternion.fromAxisAngle(Cartesian3.UNIT_X, roll, scratchHPRQuaternion); var pitchQuaternion = Quaternion.fromAxisAngle(Cartesian3.UNIT_Y, -pitch, result); @@ -13544,16 +12902,11 @@ define('Core/Quaternion',[ * @param {Number[]} array The array to pack into. * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements. * - * @returns {Number[]} The array that was packed into - */ - Quaternion.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + * @returns {Number[]} The array that was packed into + */ + Quaternion.pack = function(value, array, startingIndex) { + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -13574,9 +12927,7 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided. */ Quaternion.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -13631,7 +12982,7 @@ define('Core/Quaternion',[ * * @param {Number[]} array The array previously packed for interpolation. * @param {Number[]} sourceArray The original packed array. - * @param {Number} [startingIndex=0] The startingIndex used to convert the array. + * @param {Number} [firstIndex=0] The firstIndex used to convert the array. * @param {Number} [lastIndex=packedArray.length] The lastIndex used to convert the array. * @param {Quaternion} [result] The object into which to store the result. * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided. @@ -13685,12 +13036,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.conjugate = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); result.x = -quaternion.x; result.y = -quaternion.y; @@ -13706,9 +13053,7 @@ define('Core/Quaternion',[ * @returns {Number} The magnitude squared. */ Quaternion.magnitudeSquared = function(quaternion) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); return quaternion.x * quaternion.x + quaternion.y * quaternion.y + quaternion.z * quaternion.z + quaternion.w * quaternion.w; }; @@ -13731,9 +13076,7 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.normalize = function(quaternion, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); var inverseMagnitude = 1.0 / Quaternion.magnitude(quaternion); var x = quaternion.x * inverseMagnitude; @@ -13756,9 +13099,7 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.inverse = function(quaternion, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); var magnitudeSquared = Quaternion.magnitudeSquared(quaternion); result = Quaternion.conjugate(quaternion, result); @@ -13774,15 +13115,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -13800,15 +13135,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -13825,12 +13154,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.negate = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); result.x = -quaternion.x; result.y = -quaternion.y; @@ -13847,12 +13172,8 @@ define('Core/Quaternion',[ * @returns {Number} The dot product. */ Quaternion.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w; }; @@ -13866,15 +13187,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var leftX = left.x; var leftY = left.y; @@ -13907,15 +13222,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.multiplyByScalar = function(quaternion, scalar, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = quaternion.x * scalar; result.y = quaternion.y * scalar; @@ -13933,15 +13242,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.divideByScalar = function(quaternion, scalar, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = quaternion.x / scalar; result.y = quaternion.y / scalar; @@ -13958,12 +13261,8 @@ define('Core/Quaternion',[ * @returns {Cartesian3} The modified result parameter. */ Quaternion.computeAxis = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); var w = quaternion.w; if (Math.abs(w - 1.0) < CesiumMath.EPSILON6) { @@ -13986,9 +13285,7 @@ define('Core/Quaternion',[ * @returns {Number} The angle of rotation. */ Quaternion.computeAngle = function(quaternion) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); if (Math.abs(quaternion.w - 1.0) < CesiumMath.EPSILON6) { return 0.0; @@ -14007,18 +13304,10 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); lerpScratch = Quaternion.multiplyByScalar(end, t, lerpScratch); result = Quaternion.multiplyByScalar(start, 1.0 - t, result); @@ -14040,18 +13329,10 @@ define('Core/Quaternion',[ * @see Quaternion#fastSlerp */ Quaternion.slerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var dot = Quaternion.dot(start, end); @@ -14084,12 +13365,8 @@ define('Core/Quaternion',[ * @returns {Cartesian3} The modified result parameter. */ Quaternion.log = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); var theta = CesiumMath.acosClamped(quaternion.w); var thetaOverSinTheta = 0.0; @@ -14109,12 +13386,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.exp = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var theta = Cartesian3.magnitude(cartesian); var sinThetaOverTheta = 0.0; @@ -14149,12 +13422,10 @@ define('Core/Quaternion',[ * @see Quaternion#squad */ Quaternion.computeInnerQuadrangle = function(q0, q1, q2, result) { - if (!defined(q0) || !defined(q1) || !defined(q2)) { - throw new DeveloperError('q0, q1, and q2 are required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('q0', q0); + Check.typeOf.object('q1', q1); + Check.typeOf.object('q2', q2); + Check.typeOf.object('result', result); var qInv = Quaternion.conjugate(q1, squadScratchQuaternion0); Quaternion.multiply(qInv, q2, squadScratchQuaternion1); @@ -14196,15 +13467,12 @@ define('Core/Quaternion',[ * @see Quaternion#computeInnerQuadrangle */ Quaternion.squad = function(q0, q1, s0, s1, t, result) { - if (!defined(q0) || !defined(q1) || !defined(s0) || !defined(s1)) { - throw new DeveloperError('q0, q1, s0, and s1 are required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('q0', q0); + Check.typeOf.object('q1', q1); + Check.typeOf.object('s0', s0); + Check.typeOf.object('s1', s1); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var slerp0 = Quaternion.slerp(q0, q1, t, squadScratchQuaternion0); var slerp1 = Quaternion.slerp(s0, s1, t, squadScratchQuaternion1); @@ -14241,18 +13509,10 @@ define('Core/Quaternion',[ * @see Quaternion#slerp */ Quaternion.fastSlerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var x = Quaternion.dot(start, end); @@ -14301,15 +13561,12 @@ define('Core/Quaternion',[ * @see Quaternion#squad */ Quaternion.fastSquad = function(q0, q1, s0, s1, t, result) { - if (!defined(q0) || !defined(q1) || !defined(s0) || !defined(s1)) { - throw new DeveloperError('q0, q1, s0, and s1 are required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('q0', q0); + Check.typeOf.object('q1', q1); + Check.typeOf.object('s0', s0); + Check.typeOf.object('s1', s1); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var slerp0 = Quaternion.fastSlerp(q0, q1, t, squadScratchQuaternion0); var slerp1 = Quaternion.fastSlerp(s0, s1, t, squadScratchQuaternion1); @@ -14345,9 +13602,7 @@ define('Core/Quaternion',[ * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. */ Quaternion.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon is required and must be a number.'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || ((defined(left)) && @@ -14891,7 +14146,7 @@ define('Core/Geometry',[ * <li><code>position</code> - 3D vertex position. 64-bit floating-point (for precision). 3 components per attribute. See {@link VertexFormat#position}.</li> * <li><code>normal</code> - Normal (normalized), commonly used for lighting. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#normal}.</li> * <li><code>st</code> - 2D texture coordinate. 32-bit floating-point. 2 components per attribute. See {@link VertexFormat#st}.</li> - * <li><code>binormal</code> - Binormal (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#binormal}.</li> + * <li><code>bitangent</code> - Bitangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#bitangent}.</li> * <li><code>tangent</code> - Tangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#tangent}.</li> * </ul> * </p> @@ -14920,7 +14175,7 @@ define('Core/Geometry',[ * componentsPerAttribute : 3, * values : new Float32Array(0) * }); - * + * * @see GeometryAttribute * @see VertexFormat */ @@ -15201,7 +14456,7 @@ define('Core/GeometryAttributes',[ this.st = options.st; /** - * The binormal attribute (normalized), which is used for tangent-space effects like bump mapping. + * The bitangent attribute (normalized), which is used for tangent-space effects like bump mapping. * <p> * 32-bit floating-point. 3 components per attribute. * </p> @@ -15210,7 +14465,7 @@ define('Core/GeometryAttributes',[ * * @default undefined */ - this.binormal = options.binormal; + this.bitangent = options.bitangent; /** * The tangent attribute (normalized), which is used for tangent-space effects like bump mapping. @@ -15748,6 +15003,118 @@ define('Core/barycentricCoordinates',[ return barycentricCoordinates; }); +/*global define*/ +define('Core/oneTimeWarning',[ + './defaultValue', + './defined', + './DeveloperError' + ], function( + defaultValue, + defined, + DeveloperError) { + "use strict"; + + var warnings = {}; + + /** + * Logs a one time message to the console. Use this function instead of + * <code>console.log</code> directly since this does not log duplicate messages + * unless it is called from multiple workers. + * + * @exports oneTimeWarning + * + * @param {String} identifier The unique identifier for this warning. + * @param {String} [message=identifier] The message to log to the console. + * + * @example + * for(var i=0;i<foo.length;++i) { + * if (!defined(foo[i].bar)) { + * // Something that can be recovered from but may happen a lot + * oneTimeWarning('foo.bar undefined', 'foo.bar is undefined. Setting to 0.'); + * foo[i].bar = 0; + * // ... + * } + * } + * + * @private + */ + function oneTimeWarning(identifier, message) { + if (!defined(identifier)) { + throw new DeveloperError('identifier is required.'); + } + + if (!defined(warnings[identifier])) { + warnings[identifier] = true; + console.warn(defaultValue(message, identifier)); + } + } + + oneTimeWarning.geometryOutlines = 'Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.'; + + return oneTimeWarning; +}); + +/*global define*/ +define('Core/deprecationWarning',[ + './defined', + './DeveloperError', + './oneTimeWarning' + ], function( + defined, + DeveloperError, + oneTimeWarning) { + 'use strict'; + + /** + * Logs a deprecation message to the console. Use this function instead of + * <code>console.log</code> directly since this does not log duplicate messages + * unless it is called from multiple workers. + * + * @exports deprecationWarning + * + * @param {String} identifier The unique identifier for this deprecated API. + * @param {String} message The message to log to the console. + * + * @example + * // Deprecated function or class + * function Foo() { + * deprecationWarning('Foo', 'Foo was deprecated in Cesium 1.01. It will be removed in 1.03. Use newFoo instead.'); + * // ... + * } + * + * // Deprecated function + * Bar.prototype.func = function() { + * deprecationWarning('Bar.func', 'Bar.func() was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newFunc() instead.'); + * // ... + * }; + * + * // Deprecated property + * defineProperties(Bar.prototype, { + * prop : { + * get : function() { + * deprecationWarning('Bar.prop', 'Bar.prop was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newProp instead.'); + * // ... + * }, + * set : function(value) { + * deprecationWarning('Bar.prop', 'Bar.prop was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newProp instead.'); + * // ... + * } + * } + * }); + * + * @private + */ + function deprecationWarning(identifier, message) { + if (!defined(identifier) || !defined(message)) { + throw new DeveloperError('identifier and message are required.'); + } + + oneTimeWarning(identifier, message); + } + + return deprecationWarning; +}); + /*global define*/ define('Core/EncodedCartesian3',[ './Cartesian3', @@ -16857,6 +16224,7 @@ define('Core/IntersectionTests',[ './defaultValue', './defined', './DeveloperError', + './Interval', './Math', './Matrix3', './QuadraticRealPolynomial', @@ -16868,6 +16236,7 @@ define('Core/IntersectionTests',[ defaultValue, defined, DeveloperError, + Interval, CesiumMath, Matrix3, QuadraticRealPolynomial, @@ -17139,7 +16508,7 @@ define('Core/IntersectionTests',[ function raySphere(ray, sphere, result) { if (!defined(result)) { - result = {}; + result = new Interval(); } var origin = ray.origin; @@ -17170,8 +16539,8 @@ define('Core/IntersectionTests',[ * * @param {Ray} ray The ray. * @param {BoundingSphere} sphere The sphere. - * @param {Object} [result] The result onto which to store the result. - * @returns {Object} An object with the first (<code>start</code>) and the second (<code>stop</code>) intersection scalars for points along the ray or undefined if there are no intersections. + * @param {Interval} [result] The result onto which to store the result. + * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections. */ IntersectionTests.raySphere = function(ray, sphere, result) { if (!defined(ray)) { @@ -17199,8 +16568,8 @@ define('Core/IntersectionTests',[ * @param {Cartesian3} p0 An end point of the line segment. * @param {Cartesian3} p1 The other end point of the line segment. * @param {BoundingSphere} sphere The sphere. - * @param {Object} [result] The result onto which to store the result. - * @returns {Object} An object with the first (<code>start</code>) and the second (<code>stop</code>) intersection scalars for points along the line segment or undefined if there are no intersections. + * @param {Interval} [result] The result onto which to store the result. + * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections. */ IntersectionTests.lineSegmentSphere = function(p0, p1, sphere, result) { if (!defined(p0)) { @@ -17238,7 +16607,7 @@ define('Core/IntersectionTests',[ * * @param {Ray} ray The ray. * @param {Ellipsoid} ellipsoid The ellipsoid. - * @returns {Object} An object with the first (<code>start</code>) and the second (<code>stop</code>) intersection scalars for points along the ray or undefined if there are no intersections. + * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections. */ IntersectionTests.rayEllipsoid = function(ray, ellipsoid) { if (!defined(ray)) { @@ -17280,10 +16649,7 @@ define('Core/IntersectionTests',[ var root0 = temp / w2; var root1 = difference / temp; if (root0 < root1) { - return { - start : root0, - stop : root1 - }; + return new Interval(root0, root1); } return { @@ -17293,10 +16659,7 @@ define('Core/IntersectionTests',[ } else { // qw2 == product. Repeated roots (2 intersections). var root = Math.sqrt(difference / w2); - return { - start : root, - stop : root - }; + return new Interval(root, root); } } else if (q2 < 1.0) { // Inside ellipsoid (2 intersections). @@ -17306,19 +16669,13 @@ define('Core/IntersectionTests',[ discriminant = qw * qw - product; temp = -qw + Math.sqrt(discriminant); // Positively valued. - return { - start : 0.0, - stop : temp / w2 - }; + return new Interval(0.0, temp / w2); } else { // q2 == 1.0. On ellipsoid. if (qw < 0.0) { // Looking inward. w2 = Cartesian3.magnitudeSquared(w); - return { - start : 0.0, - stop : -qw / w2 - }; + return new Interval(0.0, -qw / w2); } // qw >= 0.0. Looking outward or tangent. @@ -18227,6 +17584,7 @@ define('Core/GeometryPipeline',[ './ComponentDatatype', './defaultValue', './defined', + './deprecationWarning', './DeveloperError', './EncodedCartesian3', './GeographicProjection', @@ -18253,6 +17611,7 @@ define('Core/GeometryPipeline',[ ComponentDatatype, defaultValue, defined, + deprecationWarning, DeveloperError, EncodedCartesian3, GeographicProjection, @@ -18386,7 +17745,7 @@ define('Core/GeometryPipeline',[ /** * Creates a new {@link Geometry} with <code>LINES</code> representing the provided * attribute (<code>attributeName</code>) for the provided geometry. This is used to - * visualize vector attributes like normals, binormals, and tangents. + * visualize vector attributes like normals, tangents, and bitangents. * * @param {Geometry} geometry The <code>Geometry</code> instance with the attribute. * @param {String} [attributeName='normal'] The name of the attribute. @@ -18396,7 +17755,7 @@ define('Core/GeometryPipeline',[ * @exception {DeveloperError} geometry.attributes must have an attribute with the same name as the attributeName parameter. * * @example - * var geometry = Cesium.GeometryPipeline.createLineSegmentsForVectors(instance.geometry, 'binormal', 100000.0); + * var geometry = Cesium.GeometryPipeline.createLineSegmentsForVectors(instance.geometry, 'bitangent', 100000.0); */ GeometryPipeline.createLineSegmentsForVectors = function(geometry, attributeName, length) { attributeName = defaultValue(attributeName, 'normal'); @@ -18488,8 +17847,11 @@ define('Core/GeometryPipeline',[ // From VertexFormat 'normal', 'st', - 'binormal', 'tangent', + 'bitangent', + + // For shadow volumes + 'extrudeDirection', // From compressing texture coordinates and normals 'compressedAttributes' @@ -18531,7 +17893,7 @@ define('Core/GeometryPipeline',[ * * @example * geometry = Cesium.GeometryPipeline.reorderForPreVertexCache(geometry); - * + * * @see GeometryPipeline.reorderForPostVertexCache */ GeometryPipeline.reorderForPreVertexCache = function(geometry) { @@ -18616,7 +17978,7 @@ define('Core/GeometryPipeline',[ * * @example * geometry = Cesium.GeometryPipeline.reorderForPostVertexCache(geometry); - * + * * @see GeometryPipeline.reorderForPreVertexCache * @see {@link http://gfx.cs.princ0eton.edu/pubs/Sander_2007_%3ETR/tipsy.pdf|Fast Triangle Reordering for Vertex Locality and Reduced Overdraw} * by Sander, Nehab, and Barczak @@ -18968,7 +18330,7 @@ define('Core/GeometryPipeline',[ * Transforms a geometry instance to world coordinates. This changes * the instance's <code>modelMatrix</code> to {@link Matrix4.IDENTITY} and transforms the * following attributes if they are present: <code>position</code>, <code>normal</code>, - * <code>binormal</code>, and <code>tangent</code>. + * <code>tangent</code>, and <code>bitangent</code>. * * @param {GeometryInstance} instance The geometry instance to modify. * @returns {GeometryInstance} The modified <code>instance</code> argument, with its attributes transforms to world coordinates. @@ -18996,16 +18358,16 @@ define('Core/GeometryPipeline',[ transformPoint(modelMatrix, attributes.nextPosition); if ((defined(attributes.normal)) || - (defined(attributes.binormal)) || - (defined(attributes.tangent))) { + (defined(attributes.tangent)) || + (defined(attributes.bitangent))) { Matrix4.inverse(modelMatrix, inverseTranspose); Matrix4.transpose(inverseTranspose, inverseTranspose); Matrix4.getRotation(inverseTranspose, normalMatrix); transformVector(normalMatrix, attributes.normal); - transformVector(normalMatrix, attributes.binormal); transformVector(normalMatrix, attributes.tangent); + transformVector(normalMatrix, attributes.bitangent); } var boundingSphere = instance.geometry.boundingSphere; @@ -19195,7 +18557,7 @@ define('Core/GeometryPipeline',[ * <p> * This is used by {@link Primitive} to efficiently render a large amount of static data. * </p> - * + * * @private * * @param {GeometryInstance[]} [instances] The array of {@link GeometryInstance} objects whose geometry will be combined. @@ -19211,7 +18573,7 @@ define('Core/GeometryPipeline',[ * Cesium.GeometryPipeline.transformToWorldCoordinates(instances[i]); * } * var geometries = Cesium.GeometryPipeline.combineInstances(instances); - * + * * @see GeometryPipeline.transformToWorldCoordinates */ GeometryPipeline.combineInstances = function(instances) { @@ -19387,8 +18749,8 @@ define('Core/GeometryPipeline',[ var tScratch = new Cartesian3(); /** - * Computes per-vertex binormals and tangents for a geometry containing <code>TRIANGLES</code>. - * The result is new <code>binormal</code> and <code>tangent</code> attributes added to the geometry. + * Computes per-vertex tangents and bitangents for a geometry containing <code>TRIANGLES</code>. + * The result is new <code>tangent</code> and <code>bitangent</code> attributes added to the geometry. * This assumes a counter-clockwise winding order. * <p> * Based on <a href="http://www.terathon.com/code/tangent.html">Computing Tangent Space Basis Vectors @@ -19396,15 +18758,15 @@ define('Core/GeometryPipeline',[ * </p> * * @param {Geometry} geometry The geometry to modify. - * @returns {Geometry} The modified <code>geometry</code> argument with the computed <code>binormal</code> and <code>tangent</code> attributes. + * @returns {Geometry} The modified <code>geometry</code> argument with the computed <code>tangent</code> and <code>bitangent</code> attributes. * * @exception {DeveloperError} geometry.indices length must be greater than 0 and be a multiple of 3. * @exception {DeveloperError} geometry.primitiveType must be {@link PrimitiveType.TRIANGLES}. * * @example - * Cesium.GeometryPipeline.computeBinormalAndTangent(geometry); + * Cesium.GeometryPipeline.computeTangentAndBiTangent(geometry); */ - GeometryPipeline.computeBinormalAndTangent = function(geometry) { + GeometryPipeline.computeTangentAndBitangent = function(geometry) { if (!defined(geometry)) { throw new DeveloperError('geometry is required.'); } @@ -19484,8 +18846,8 @@ define('Core/GeometryPipeline',[ tan1[i23 + 2] += sdirz; } - var binormalValues = new Float32Array(numVertices * 3); var tangentValues = new Float32Array(numVertices * 3); + var bitangentValues = new Float32Array(numVertices * 3); for (i = 0; i < numVertices; i++) { i03 = i * 3; @@ -19504,9 +18866,9 @@ define('Core/GeometryPipeline',[ Cartesian3.normalize(Cartesian3.cross(n, t, t), t); - binormalValues[i03] = t.x; - binormalValues[i13] = t.y; - binormalValues[i23] = t.z; + bitangentValues[i03] = t.x; + bitangentValues[i13] = t.y; + bitangentValues[i23] = t.z; } geometry.attributes.tangent = new GeometryAttribute({ @@ -19515,20 +18877,48 @@ define('Core/GeometryPipeline',[ values : tangentValues }); - geometry.attributes.binormal = new GeometryAttribute({ + geometry.attributes.bitangent = new GeometryAttribute({ componentDatatype : ComponentDatatype.FLOAT, componentsPerAttribute : 3, - values : binormalValues + values : bitangentValues }); return geometry; }; + /** + * Computes per-vertex binormal and tangents for a geometry containing <code>TRIANGLES</code>. + * The result is new <code>binormal</code> and <code>tangent</code> attributes added to the geometry. + * This assumes a counter-clockwise winding order. + * <p> + * Based on <a href="http://www.terathon.com/code/tangent.html">Computing Tangent Space Basis Vectors + * for an Arbitrary Mesh</a> by Eric Lengyel. + * </p> + * + * @param {Geometry} geometry The geometry to modify. + * @returns {Geometry} The modified <code>geometry</code> argument with the computed <code>binormal</code> and <code>tangent</code> attributes. + * + * @exception {DeveloperError} geometry.indices length must be greater than 0 and be a multiple of 3. + * @exception {DeveloperError} geometry.primitiveType must be {@link PrimitiveType.TRIANGLES}. + * + * @example + * Cesium.GeometryPipeline.computeBinormalAndTangent(geometry); + * + * @see GeometryPipeline.computeTangentAndBitangent + */ + GeometryPipeline.computeBinormalAndTangent = function(geometry) { + deprecationWarning('computeBinormalAndTangent', 'computeBinormalAndTangent was deprecated in 1.30. It will be removed in 1.31. Use a computeTangentAndBitangent.'); + GeometryPipeline.computeTangentAndBitangent(geometry); + geometry.attributes.binormal = geometry.attributes.bitangent; + + return geometry; + }; + var scratchCartesian2 = new Cartesian2(); var toEncode1 = new Cartesian3(); var toEncode2 = new Cartesian3(); var toEncode3 = new Cartesian3(); - + var encodeResult2 = new Cartesian2(); /** * Compresses and packs geometry normal attribute values to save memory. * @@ -19543,73 +18933,109 @@ define('Core/GeometryPipeline',[ throw new DeveloperError('geometry is required.'); } + var extrudeAttribute = geometry.attributes.extrudeDirection; + var i; + var numVertices; + if (defined(extrudeAttribute)) { + //only shadow volumes use extrudeDirection, and shadow volumes use vertexFormat: POSITION_ONLY so we don't need to check other attributes + var extrudeDirections = extrudeAttribute.values; + numVertices = extrudeDirections.length / 3.0; + var compressedDirections = new Float32Array(numVertices * 2); + + var i2 = 0; + for (i = 0; i < numVertices; ++i) { + Cartesian3.fromArray(extrudeDirections, i * 3.0, toEncode1); + if (Cartesian3.equals(toEncode1, Cartesian3.ZERO)) { + i2 += 2; + continue; + } + encodeResult2 = AttributeCompression.octEncodeInRange(toEncode1, 65535, encodeResult2); + compressedDirections[i2++] = encodeResult2.x; + compressedDirections[i2++] = encodeResult2.y; + } + + geometry.attributes.compressedAttributes = new GeometryAttribute({ + componentDatatype : ComponentDatatype.FLOAT, + componentsPerAttribute : 2, + values : compressedDirections + }); + delete geometry.attributes.extrudeDirection; + return geometry; + } + var normalAttribute = geometry.attributes.normal; var stAttribute = geometry.attributes.st; - if (!defined(normalAttribute) && !defined(stAttribute)) { + + var hasNormal = defined(normalAttribute); + var hasSt = defined(stAttribute); + if (!hasNormal && !hasSt) { return geometry; } var tangentAttribute = geometry.attributes.tangent; - var binormalAttribute = geometry.attributes.binormal; + var bitangentAttribute = geometry.attributes.bitangent; + + var hasTangent = defined(tangentAttribute); + var hasBitangent = defined(bitangentAttribute); var normals; var st; var tangents; - var binormals; + var bitangents; - if (defined(normalAttribute)) { + if (hasNormal) { normals = normalAttribute.values; } - if (defined(stAttribute)) { + if (hasSt) { st = stAttribute.values; } - if (defined(tangentAttribute)) { + if (hasTangent) { tangents = tangentAttribute.values; } - if (binormalAttribute) { - binormals = binormalAttribute.values; + if (hasBitangent) { + bitangents = bitangentAttribute.values; } - var length = defined(normals) ? normals.length : st.length; - var numComponents = defined(normals) ? 3.0 : 2.0; - var numVertices = length / numComponents; + var length = hasNormal ? normals.length : st.length; + var numComponents = hasNormal ? 3.0 : 2.0; + numVertices = length / numComponents; var compressedLength = numVertices; - var numCompressedComponents = defined(st) && defined(normals) ? 2.0 : 1.0; - numCompressedComponents += defined(tangents) || defined(binormals) ? 1.0 : 0.0; + var numCompressedComponents = hasSt && hasNormal ? 2.0 : 1.0; + numCompressedComponents += hasTangent || hasBitangent ? 1.0 : 0.0; compressedLength *= numCompressedComponents; var compressedAttributes = new Float32Array(compressedLength); var normalIndex = 0; - for (var i = 0; i < numVertices; ++i) { - if (defined(st)) { + for (i = 0; i < numVertices; ++i) { + if (hasSt) { Cartesian2.fromArray(st, i * 2.0, scratchCartesian2); compressedAttributes[normalIndex++] = AttributeCompression.compressTextureCoordinates(scratchCartesian2); } var index = i * 3.0; - if (defined(normals) && defined(tangents) && defined(binormals)) { + if (hasNormal && defined(tangents) && defined(bitangents)) { Cartesian3.fromArray(normals, index, toEncode1); Cartesian3.fromArray(tangents, index, toEncode2); - Cartesian3.fromArray(binormals, index, toEncode3); + Cartesian3.fromArray(bitangents, index, toEncode3); AttributeCompression.octPack(toEncode1, toEncode2, toEncode3, scratchCartesian2); compressedAttributes[normalIndex++] = scratchCartesian2.x; compressedAttributes[normalIndex++] = scratchCartesian2.y; } else { - if (defined(normals)) { + if (hasNormal) { Cartesian3.fromArray(normals, index, toEncode1); compressedAttributes[normalIndex++] = AttributeCompression.octEncodeFloat(toEncode1); } - if (defined(tangents)) { + if (hasTangent) { Cartesian3.fromArray(tangents, index, toEncode1); compressedAttributes[normalIndex++] = AttributeCompression.octEncodeFloat(toEncode1); } - if (defined(binormals)) { - Cartesian3.fromArray(binormals, index, toEncode1); + if (hasBitangent) { + Cartesian3.fromArray(bitangents, index, toEncode1); compressedAttributes[normalIndex++] = AttributeCompression.octEncodeFloat(toEncode1); } } @@ -19621,17 +19047,17 @@ define('Core/GeometryPipeline',[ values : compressedAttributes }); - if (defined(normals)) { + if (hasNormal) { delete geometry.attributes.normal; } - if (defined(st)) { + if (hasSt) { delete geometry.attributes.st; } - if (defined(tangents)) { - delete geometry.attributes.tangent; + if (hasBitangent) { + delete geometry.attributes.bitangent; } - if (defined(binormals)) { - delete geometry.attributes.binormal; + if (hasTangent) { + delete geometry.attributes.tangent; } return geometry; @@ -20048,8 +19474,8 @@ define('Core/GeometryPipeline',[ var s1Scratch = new Cartesian2(); var s2Scratch = new Cartesian2(); - function computeTriangleAttributes(i0, i1, i2, point, positions, normals, binormals, tangents, texCoords, currentAttributes, insertedIndex) { - if (!defined(normals) && !defined(binormals) && !defined(tangents) && !defined(texCoords)) { + function computeTriangleAttributes(i0, i1, i2, point, positions, normals, tangents, bitangents, texCoords, extrudeDirections, currentAttributes, insertedIndex) { + if (!defined(normals) && !defined(tangents) && !defined(bitangents) && !defined(texCoords) && !defined(extrudeDirections)) { return; } @@ -20074,20 +19500,27 @@ define('Core/GeometryPipeline',[ Cartesian3.pack(normal, currentAttributes.normal.values, insertedIndex * 3); } - if (defined(binormals)) { - var b0 = Cartesian3.fromArray(binormals, i0 * 3, p0Scratch); - var b1 = Cartesian3.fromArray(binormals, i1 * 3, p1Scratch); - var b2 = Cartesian3.fromArray(binormals, i2 * 3, p2Scratch); - - Cartesian3.multiplyByScalar(b0, coords.x, b0); - Cartesian3.multiplyByScalar(b1, coords.y, b1); - Cartesian3.multiplyByScalar(b2, coords.z, b2); + if (defined(extrudeDirections)) { + var d0 = Cartesian3.fromArray(extrudeDirections, i0 * 3, p0Scratch); + var d1 = Cartesian3.fromArray(extrudeDirections, i1 * 3, p1Scratch); + var d2 = Cartesian3.fromArray(extrudeDirections, i2 * 3, p2Scratch); - var binormal = Cartesian3.add(b0, b1, b0); - Cartesian3.add(binormal, b2, binormal); - Cartesian3.normalize(binormal, binormal); + Cartesian3.multiplyByScalar(d0, coords.x, d0); + Cartesian3.multiplyByScalar(d1, coords.y, d1); + Cartesian3.multiplyByScalar(d2, coords.z, d2); - Cartesian3.pack(binormal, currentAttributes.binormal.values, insertedIndex * 3); + var direction; + if (!Cartesian3.equals(d0, Cartesian3.ZERO) || !Cartesian3.equals(d1, Cartesian3.ZERO) || !Cartesian3.equals(d2, Cartesian3.ZERO)) { + direction = Cartesian3.add(d0, d1, d0); + Cartesian3.add(direction, d2, direction); + Cartesian3.normalize(direction, direction); + } else { + direction = p0Scratch; + direction.x = 0; + direction.y = 0; + direction.z = 0; + } + Cartesian3.pack(direction, currentAttributes.extrudeDirection.values, insertedIndex * 3); } if (defined(tangents)) { @@ -20106,6 +19539,22 @@ define('Core/GeometryPipeline',[ Cartesian3.pack(tangent, currentAttributes.tangent.values, insertedIndex * 3); } + if (defined(bitangents)) { + var b0 = Cartesian3.fromArray(bitangents, i0 * 3, p0Scratch); + var b1 = Cartesian3.fromArray(bitangents, i1 * 3, p1Scratch); + var b2 = Cartesian3.fromArray(bitangents, i2 * 3, p2Scratch); + + Cartesian3.multiplyByScalar(b0, coords.x, b0); + Cartesian3.multiplyByScalar(b1, coords.y, b1); + Cartesian3.multiplyByScalar(b2, coords.z, b2); + + var bitangent = Cartesian3.add(b0, b1, b0); + Cartesian3.add(bitangent, b2, bitangent); + Cartesian3.normalize(bitangent, bitangent); + + Cartesian3.pack(bitangent, currentAttributes.bitangent.values, insertedIndex * 3); + } + if (defined(texCoords)) { var s0 = Cartesian2.fromArray(texCoords, i0 * 2, s0Scratch); var s1 = Cartesian2.fromArray(texCoords, i1 * 2, s1Scratch); @@ -20150,9 +19599,10 @@ define('Core/GeometryPipeline',[ var attributes = geometry.attributes; var positions = attributes.position.values; var normals = (defined(attributes.normal)) ? attributes.normal.values : undefined; - var binormals = (defined(attributes.binormal)) ? attributes.binormal.values : undefined; + var bitangents = (defined(attributes.bitangent)) ? attributes.bitangent.values : undefined; var tangents = (defined(attributes.tangent)) ? attributes.tangent.values : undefined; var texCoords = (defined(attributes.st)) ? attributes.st.values : undefined; + var extrudeDirections = (defined(attributes.extrudeDirection)) ? attributes.extrudeDirection.values : undefined; var indices = geometry.indices; var eastGeometry = copyGeometryForSplit(geometry); @@ -20206,7 +19656,7 @@ define('Core/GeometryPipeline',[ } insertedIndex = insertSplitPoint(currentAttributes, currentIndices, currentIndexMap, indices, resultIndex < 3 ? i + resultIndex : -1, point); - computeTriangleAttributes(i0, i1, i2, point, positions, normals, binormals, tangents, texCoords, currentAttributes, insertedIndex); + computeTriangleAttributes(i0, i1, i2, point, positions, normals, tangents, bitangents, texCoords, extrudeDirections, currentAttributes, insertedIndex); } } else { if (defined(result)) { @@ -20226,13 +19676,13 @@ define('Core/GeometryPipeline',[ } insertedIndex = insertSplitPoint(currentAttributes, currentIndices, currentIndexMap, indices, i, p0); - computeTriangleAttributes(i0, i1, i2, p0, positions, normals, binormals, tangents, texCoords, currentAttributes, insertedIndex); + computeTriangleAttributes(i0, i1, i2, p0, positions, normals, tangents, bitangents, texCoords, extrudeDirections, currentAttributes, insertedIndex); insertedIndex = insertSplitPoint(currentAttributes, currentIndices, currentIndexMap, indices, i + 1, p1); - computeTriangleAttributes(i0, i1, i2, p1, positions, normals, binormals, tangents, texCoords, currentAttributes, insertedIndex); + computeTriangleAttributes(i0, i1, i2, p1, positions, normals, tangents, bitangents, texCoords, extrudeDirections, currentAttributes, insertedIndex); insertedIndex = insertSplitPoint(currentAttributes, currentIndices, currentIndexMap, indices, i + 2, p2); - computeTriangleAttributes(i0, i1, i2, p2, positions, normals, binormals, tangents, texCoords, currentAttributes, insertedIndex); + computeTriangleAttributes(i0, i1, i2, p2, positions, normals, tangents, bitangents, texCoords, extrudeDirections, currentAttributes, insertedIndex); } } @@ -21409,118 +20859,6 @@ define('ThirdParty/when',[],function () { // Boilerplate for AMD, Node, and browser global ); -/*global define*/ -define('Core/oneTimeWarning',[ - './defaultValue', - './defined', - './DeveloperError' - ], function( - defaultValue, - defined, - DeveloperError) { - "use strict"; - - var warnings = {}; - - /** - * Logs a one time message to the console. Use this function instead of - * <code>console.log</code> directly since this does not log duplicate messages - * unless it is called from multiple workers. - * - * @exports oneTimeWarning - * - * @param {String} identifier The unique identifier for this warning. - * @param {String} [message=identifier] The message to log to the console. - * - * @example - * for(var i=0;i<foo.length;++i) { - * if (!defined(foo[i].bar)) { - * // Something that can be recovered from but may happen a lot - * oneTimeWarning('foo.bar undefined', 'foo.bar is undefined. Setting to 0.'); - * foo[i].bar = 0; - * // ... - * } - * } - * - * @private - */ - function oneTimeWarning(identifier, message) { - if (!defined(identifier)) { - throw new DeveloperError('identifier is required.'); - } - - if (!defined(warnings[identifier])) { - warnings[identifier] = true; - console.log(defaultValue(message, identifier)); - } - } - - oneTimeWarning.geometryOutlines = 'Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.'; - - return oneTimeWarning; -}); - -/*global define*/ -define('Core/deprecationWarning',[ - './defined', - './DeveloperError', - './oneTimeWarning' - ], function( - defined, - DeveloperError, - oneTimeWarning) { - 'use strict'; - - /** - * Logs a deprecation message to the console. Use this function instead of - * <code>console.log</code> directly since this does not log duplicate messages - * unless it is called from multiple workers. - * - * @exports deprecationWarning - * - * @param {String} identifier The unique identifier for this deprecated API. - * @param {String} message The message to log to the console. - * - * @example - * // Deprecated function or class - * function Foo() { - * deprecationWarning('Foo', 'Foo was deprecated in Cesium 1.01. It will be removed in 1.03. Use newFoo instead.'); - * // ... - * } - * - * // Deprecated function - * Bar.prototype.func = function() { - * deprecationWarning('Bar.func', 'Bar.func() was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newFunc() instead.'); - * // ... - * }; - * - * // Deprecated property - * defineProperties(Bar.prototype, { - * prop : { - * get : function() { - * deprecationWarning('Bar.prop', 'Bar.prop was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newProp instead.'); - * // ... - * }, - * set : function(value) { - * deprecationWarning('Bar.prop', 'Bar.prop was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newProp instead.'); - * // ... - * } - * } - * }); - * - * @private - */ - function deprecationWarning(identifier, message) { - if (!defined(identifier) || !defined(message)) { - throw new DeveloperError('identifier and message are required.'); - } - - oneTimeWarning(identifier, message); - } - - return deprecationWarning; -}); - /*global define*/ define('Core/binarySearch',[ './defined', @@ -25234,9 +24572,9 @@ define('Core/Transforms',[ './Cartesian3', './Cartesian4', './Cartographic', + './Check', './defaultValue', './defined', - './deprecationWarning', './DeveloperError', './EarthOrientationParameters', './EarthOrientationParametersSample', @@ -25256,9 +24594,9 @@ define('Core/Transforms',[ Cartesian3, Cartesian4, Cartographic, + Check, defaultValue, defined, - deprecationWarning, DeveloperError, EarthOrientationParameters, EarthOrientationParametersSample, @@ -25694,19 +25032,12 @@ define('Core/Transforms',[ * var hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll); * var transform = Cesium.Transforms.headingPitchRollToFixedFrame(center, hpr); */ - Transforms.headingPitchRollToFixedFrame = function(origin, headingPitchRoll, pitch, roll, ellipsoid, result) { - var heading; - if (typeof headingPitchRoll === 'object') { - // Shift arguments using assignments to encourage JIT optimization. - ellipsoid = pitch; - result = roll; - heading = headingPitchRoll.heading; - pitch = headingPitchRoll.pitch; - roll = headingPitchRoll.roll; - } else { - deprecationWarning('headingPitchRollToFixedFrame', 'headingPitchRollToFixedFrame with separate heading, pitch, and roll arguments was deprecated in 1.27. It will be removed in 1.30. Use a HeadingPitchRoll object.'); - heading = headingPitchRoll; - } + Transforms.headingPitchRollToFixedFrame = function(origin, headingPitchRoll, ellipsoid, result) { + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + var heading = headingPitchRoll.heading; + var pitch = headingPitchRoll.pitch; + var roll = headingPitchRoll.roll; + // checks for required parameters happen in the called functions var hprQuaternion = Quaternion.fromHeadingPitchRoll(heading, pitch, roll, scratchHPRQuaternion); var hprMatrix = Matrix4.fromTranslationQuaternionRotationScale(Cartesian3.ZERO, hprQuaternion, scratchScale, scratchHPRMatrix4); @@ -25714,7 +25045,6 @@ define('Core/Transforms',[ return Matrix4.multiply(result, hprMatrix, result); }; - var scratchHPR = new HeadingPitchRoll(); var scratchENUMatrix4 = new Matrix4(); var scratchHPRMatrix3 = new Matrix3(); @@ -25739,22 +25069,10 @@ define('Core/Transforms',[ * var hpr = new HeadingPitchRoll(heading, pitch, roll); * var quaternion = Cesium.Transforms.headingPitchRollQuaternion(center, hpr); */ - Transforms.headingPitchRollQuaternion = function(origin, headingPitchRoll, pitch, roll, ellipsoid, result) { - var hpr; - if (typeof headingPitchRoll === 'object') { - // Shift arguments using assignment to encourage JIT optimization. - hpr = headingPitchRoll; - ellipsoid = pitch; - result = roll; - } else { - deprecationWarning('headingPitchRollQuaternion', 'headingPitchRollQuaternion with separate heading, pitch, and roll arguments was deprecated in 1.27. It will be removed in 1.30. Use a HeadingPitchRoll object.'); - scratchHPR.heading = headingPitchRoll; - scratchHPR.pitch = pitch; - scratchHPR.roll = roll; - hpr = scratchHPR; - } + Transforms.headingPitchRollQuaternion = function(origin, headingPitchRoll, ellipsoid, result) { // checks for required parameters happen in the called functions - var transform = Transforms.headingPitchRollToFixedFrame(origin, hpr, ellipsoid, scratchENUMatrix4); + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + var transform = Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, scratchENUMatrix4); var rotation = Matrix4.getRotation(transform, scratchHPRMatrix3); return Quaternion.fromRotationMatrix(rotation, result); }; @@ -26230,6 +25548,46 @@ define('Core/Transforms',[ return result; }; + var swizzleMatrix = new Matrix4( + 0.0, 0.0, 1.0, 0.0, + 1.0, 0.0, 0.0, 0.0, + 0.0, 1.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + + /** + * @private + */ + Transforms.wgs84To2DModelMatrix = function(projection, center, result) { + if (!defined(projection)) { + throw new DeveloperError('projection is required.'); + } + if (!defined(center)) { + throw new DeveloperError('center is required.'); + } + if (!defined(result)) { + throw new DeveloperError('result is required.'); + } + + var ellipsoid = projection.ellipsoid; + + var fromENU = Transforms.eastNorthUpToFixedFrame(center, ellipsoid, scratchFromENU); + var toENU = Matrix4.inverseTransformation(fromENU, scratchToENU); + + var cartographic = ellipsoid.cartesianToCartographic(center, scratchCartographic); + var projectedPosition = projection.project(cartographic, scratchCartesian3Projection); + var newOrigin = scratchCartesian4NewOrigin; + newOrigin.x = projectedPosition.z; + newOrigin.y = projectedPosition.x; + newOrigin.z = projectedPosition.y; + newOrigin.w = 1.0; + + var translation = Matrix4.fromTranslation(newOrigin, scratchFromENU); + Matrix4.multiply(swizzleMatrix, toENU, result); + Matrix4.multiply(translation, result, result); + + return result; + }; + return Transforms; }); @@ -26306,7 +25664,7 @@ define('Core/VertexFormat',[ this.st = defaultValue(options.st, false); /** - * When <code>true</code>, the vertex has a binormal attribute (normalized), which is used for tangent-space effects like bump mapping. + * When <code>true</code>, the vertex has a bitangent attribute (normalized), which is used for tangent-space effects like bump mapping. * <p> * 32-bit floating-point. 3 components per attribute. * </p> @@ -26315,7 +25673,7 @@ define('Core/VertexFormat',[ * * @default false */ - this.binormal = defaultValue(options.binormal, false); + this.bitangent = defaultValue(options.bitangent, false); /** * When <code>true</code>, the vertex has a tangent attribute (normalized), which is used for tangent-space effects like bump mapping. @@ -26417,7 +25775,7 @@ define('Core/VertexFormat',[ })); /** - * An immutable vertex format with well-known attributes: position, normal, st, binormal, and tangent. + * An immutable vertex format with well-known attributes: position, normal, st, tangent, and bitangent. * * @type {VertexFormat} * @constant @@ -26425,15 +25783,15 @@ define('Core/VertexFormat',[ * @see VertexFormat#position * @see VertexFormat#normal * @see VertexFormat#st - * @see VertexFormat#binormal * @see VertexFormat#tangent + * @see VertexFormat#bitangent */ VertexFormat.ALL = freezeObject(new VertexFormat({ position : true, normal : true, st : true, - binormal : true, - tangent : true + tangent : true, + bitangent : true })); /** @@ -26478,8 +25836,8 @@ define('Core/VertexFormat',[ array[startingIndex++] = value.position ? 1.0 : 0.0; array[startingIndex++] = value.normal ? 1.0 : 0.0; array[startingIndex++] = value.st ? 1.0 : 0.0; - array[startingIndex++] = value.binormal ? 1.0 : 0.0; array[startingIndex++] = value.tangent ? 1.0 : 0.0; + array[startingIndex++] = value.bitangent ? 1.0 : 0.0; array[startingIndex++] = value.color ? 1.0 : 0.0; return array; @@ -26504,19 +25862,19 @@ define('Core/VertexFormat',[ result = new VertexFormat(); } - result.position = array[startingIndex++] === 1.0; - result.normal = array[startingIndex++] === 1.0; - result.st = array[startingIndex++] === 1.0; - result.binormal = array[startingIndex++] === 1.0; - result.tangent = array[startingIndex++] === 1.0; - result.color = array[startingIndex++] === 1.0; + result.position = array[startingIndex++] === 1.0; + result.normal = array[startingIndex++] === 1.0; + result.st = array[startingIndex++] === 1.0; + result.tangent = array[startingIndex++] === 1.0; + result.bitangent = array[startingIndex++] === 1.0; + result.color = array[startingIndex++] === 1.0; return result; }; /** * Duplicates a VertexFormat instance. * - * @param {VertexFormat} cartesian The vertex format to duplicate. + * @param {VertexFormat} vertexFormat The vertex format to duplicate. * @param {VertexFormat} [result] The object onto which to store the result. * @returns {VertexFormat} The modified result parameter or a new VertexFormat instance if one was not provided. (Returns undefined if vertexFormat is undefined) */ @@ -26531,8 +25889,8 @@ define('Core/VertexFormat',[ result.position = vertexFormat.position; result.normal = vertexFormat.normal; result.st = vertexFormat.st; - result.binormal = vertexFormat.binormal; result.tangent = vertexFormat.tangent; + result.bitangent = vertexFormat.bitangent; result.color = vertexFormat.color; return result; }; @@ -26607,7 +25965,7 @@ define('Core/EllipseGeometry',[ var scratchNormal = new Cartesian3(); var scratchTangent = new Cartesian3(); - var scratchBinormal = new Cartesian3(); + var scratchBitangent = new Cartesian3(); var scratchCartographic = new Cartographic(); var projectedCenterScratch = new Cartesian3(); @@ -26623,19 +25981,22 @@ define('Core/EllipseGeometry',[ var ellipsoid = options.ellipsoid; var stRotation = options.stRotation; var size = (extrude) ? positions.length / 3 * 2 : positions.length / 3; + var shadowVolume = options.shadowVolume; var textureCoordinates = (vertexFormat.st) ? new Float32Array(size * 2) : undefined; var normals = (vertexFormat.normal) ? new Float32Array(size * 3) : undefined; var tangents = (vertexFormat.tangent) ? new Float32Array(size * 3) : undefined; - var binormals = (vertexFormat.binormal) ? new Float32Array(size * 3) : undefined; + var bitangents = (vertexFormat.bitangent) ? new Float32Array(size * 3) : undefined; + + var extrudeNormals = (shadowVolume) ? new Float32Array(size * 3) : undefined; var textureCoordIndex = 0; // Raise positions to a height above the ellipsoid and compute the - // texture coordinates, normals, tangents, and binormals. + // texture coordinates, normals, tangents, and bitangents. var normal = scratchNormal; var tangent = scratchTangent; - var binormal = scratchBinormal; + var bitangent = scratchBitangent; var projection = new GeographicProjection(ellipsoid); var projectedCenter = projection.project(ellipsoid.cartesianToCartographic(center, scratchCartographic), projectedCenterScratch); @@ -26678,44 +26039,52 @@ define('Core/EllipseGeometry',[ textureCoordinates[textureCoordIndex++] = texCoordScratch.y; } - normal = ellipsoid.geodeticSurfaceNormal(position, normal); + if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent || shadowVolume) { + normal = ellipsoid.geodeticSurfaceNormal(position, normal); - if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.binormal) { - if (vertexFormat.tangent || vertexFormat.binormal) { - tangent = Cartesian3.normalize(Cartesian3.cross(Cartesian3.UNIT_Z, normal, tangent), tangent); - Matrix3.multiplyByVector(textureMatrix, tangent, tangent); + if (shadowVolume) { + extrudeNormals[i + bottomOffset] = -normal.x; + extrudeNormals[i1 + bottomOffset] = -normal.y; + extrudeNormals[i2 + bottomOffset] = -normal.z; } - if (vertexFormat.normal) { - normals[i] = normal.x; - normals[i1] = normal.y; - normals[i2] = normal.z; - if (extrude) { - normals[i + bottomOffset] = -normal.x; - normals[i1 + bottomOffset] = -normal.y; - normals[i2 + bottomOffset] = -normal.z; + + if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent) { + if (vertexFormat.tangent || vertexFormat.bitangent) { + tangent = Cartesian3.normalize(Cartesian3.cross(Cartesian3.UNIT_Z, normal, tangent), tangent); + Matrix3.multiplyByVector(textureMatrix, tangent, tangent); + } + if (vertexFormat.normal) { + normals[i] = normal.x; + normals[i1] = normal.y; + normals[i2] = normal.z; + if (extrude) { + normals[i + bottomOffset] = -normal.x; + normals[i1 + bottomOffset] = -normal.y; + normals[i2 + bottomOffset] = -normal.z; + } } - } - if (vertexFormat.tangent) { - tangents[i] = tangent.x; - tangents[i1] = tangent.y; - tangents[i2] = tangent.z; - if (extrude) { - tangents[i + bottomOffset] = -tangent.x; - tangents[i1 + bottomOffset] = -tangent.y; - tangents[i2 + bottomOffset] = -tangent.z; + if (vertexFormat.tangent) { + tangents[i] = tangent.x; + tangents[i1] = tangent.y; + tangents[i2] = tangent.z; + if (extrude) { + tangents[i + bottomOffset] = -tangent.x; + tangents[i1 + bottomOffset] = -tangent.y; + tangents[i2 + bottomOffset] = -tangent.z; + } } - } - if (vertexFormat.binormal) { - binormal = Cartesian3.normalize(Cartesian3.cross(normal, tangent, binormal), binormal); - binormals[i] = binormal.x; - binormals[i1] = binormal.y; - binormals[i2] = binormal.z; - if (extrude) { - binormals[i + bottomOffset] = binormal.x; - binormals[i1 + bottomOffset] = binormal.y; - binormals[i2 + bottomOffset] = binormal.z; + if (vertexFormat.bitangent) { + bitangent = Cartesian3.normalize(Cartesian3.cross(normal, tangent, bitangent), bitangent); + bitangents[i ] = bitangent.x; + bitangents[i1] = bitangent.y; + bitangents[i2] = bitangent.z; + if (extrude) { + bitangents[i + bottomOffset] = bitangent.x; + bitangents[i1 + bottomOffset] = bitangent.y; + bitangents[i2 + bottomOffset] = bitangent.z; + } } } } @@ -26764,13 +26133,22 @@ define('Core/EllipseGeometry',[ }); } - if (vertexFormat.binormal) { - attributes.binormal = new GeometryAttribute({ + if (vertexFormat.bitangent) { + attributes.bitangent = new GeometryAttribute({ componentDatatype : ComponentDatatype.FLOAT, componentsPerAttribute : 3, - values : binormals + values : bitangents }); } + + if (shadowVolume) { + attributes.extrudeDirection = new GeometryAttribute({ + componentDatatype : ComponentDatatype.FLOAT, + componentsPerAttribute : 3, + values : extrudeNormals + }); + } + return attributes; } @@ -26911,15 +26289,18 @@ define('Core/EllipseGeometry',[ var textureCoordinates = (vertexFormat.st) ? new Float32Array(size * 2) : undefined; var normals = (vertexFormat.normal) ? new Float32Array(size * 3) : undefined; var tangents = (vertexFormat.tangent) ? new Float32Array(size * 3) : undefined; - var binormals = (vertexFormat.binormal) ? new Float32Array(size * 3) : undefined; + var bitangents = (vertexFormat.bitangent) ? new Float32Array(size * 3) : undefined; + + var shadowVolume = options.shadowVolume; + var extrudeNormals = (shadowVolume) ? new Float32Array(size * 3) : undefined; var textureCoordIndex = 0; // Raise positions to a height above the ellipsoid and compute the - // texture coordinates, normals, tangents, and binormals. + // texture coordinates, normals, tangents, and bitangents. var normal = scratchNormal; var tangent = scratchTangent; - var binormal = scratchBinormal; + var bitangent = scratchBitangent; var projection = new GeographicProjection(ellipsoid); var projectedCenter = projection.project(ellipsoid.cartesianToCartographic(center, scratchCartographic), projectedCenterScratch); @@ -26963,6 +26344,13 @@ define('Core/EllipseGeometry',[ position = ellipsoid.scaleToGeodeticSurface(position, position); extrudedPosition = Cartesian3.clone(position, scratchCartesian2); normal = ellipsoid.geodeticSurfaceNormal(position, normal); + + if (shadowVolume) { + extrudeNormals[i + length] = -normal.x; + extrudeNormals[i1 + length] = -normal.y; + extrudeNormals[i2 + length] = -normal.z; + } + var scaledNormal = Cartesian3.multiplyByScalar(normal, height, scratchCartesian4); position = Cartesian3.add(position, scaledNormal, position); scaledNormal = Cartesian3.multiplyByScalar(normal, extrudedHeight, scaledNormal); @@ -26978,9 +26366,9 @@ define('Core/EllipseGeometry',[ finalPositions[i2] = position.z; } - if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.binormal) { + if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent) { - binormal = Cartesian3.clone(normal, binormal); + bitangent = Cartesian3.clone(normal, bitangent); var next = Cartesian3.fromArray(positions, (i + 3) % length, scratchCartesian4); Cartesian3.subtract(next, position, next); var bottom = Cartesian3.subtract(extrudedPosition, position, scratchCartesian3); @@ -26998,7 +26386,7 @@ define('Core/EllipseGeometry',[ } if (vertexFormat.tangent) { - tangent = Cartesian3.normalize(Cartesian3.cross(binormal, normal, tangent), tangent); + tangent = Cartesian3.normalize(Cartesian3.cross(bitangent, normal, tangent), tangent); tangents[i] = tangent.x; tangents[i1] = tangent.y; tangents[i2] = tangent.z; @@ -27008,14 +26396,14 @@ define('Core/EllipseGeometry',[ tangents[i + 2 + length] = tangent.z; } - if (vertexFormat.binormal) { - binormals[i] = binormal.x; - binormals[i1] = binormal.y; - binormals[i2] = binormal.z; + if (vertexFormat.bitangent) { + bitangents[i ] = bitangent.x; + bitangents[i1] = bitangent.y; + bitangents[i2] = bitangent.z; - binormals[i + length] = binormal.x; - binormals[i1 + length] = binormal.y; - binormals[i2 + length] = binormal.z; + bitangents[i + length] = bitangent.x; + bitangents[i1 + length] = bitangent.y; + bitangents[i2 + length] = bitangent.z; } } } @@ -27062,13 +26450,22 @@ define('Core/EllipseGeometry',[ }); } - if (vertexFormat.binormal) { - attributes.binormal = new GeometryAttribute({ + if (vertexFormat.bitangent) { + attributes.bitangent = new GeometryAttribute({ + componentDatatype : ComponentDatatype.FLOAT, + componentsPerAttribute : 3, + values : bitangents + }); + } + + if (shadowVolume) { + attributes.extrudeDirection = new GeometryAttribute({ componentDatatype : ComponentDatatype.FLOAT, componentsPerAttribute : 3, - values : binormals + values : extrudeNormals }); } + return attributes; } @@ -27264,6 +26661,7 @@ define('Core/EllipseGeometry',[ this._vertexFormat = VertexFormat.clone(vertexFormat); this._extrudedHeight = defaultValue(extrudedHeight, height); this._extrude = extrude; + this._shadowVolume = defaultValue(options.shadowVolume, false); this._workerName = 'createEllipseGeometry'; this._rectangle = computeRectangle(this._center, this._ellipsoid, semiMajorAxis, semiMinorAxis, this._rotation); @@ -27273,7 +26671,7 @@ define('Core/EllipseGeometry',[ * The number of elements used to pack the object into an array. * @type {Number} */ - EllipseGeometry.packedLength = Cartesian3.packedLength + Ellipsoid.packedLength + VertexFormat.packedLength + Rectangle.packedLength + 8; + EllipseGeometry.packedLength = Cartesian3.packedLength + Ellipsoid.packedLength + VertexFormat.packedLength + Rectangle.packedLength + 9; /** * Stores the provided instance into the provided array. @@ -27313,7 +26711,8 @@ define('Core/EllipseGeometry',[ array[startingIndex++] = value._height; array[startingIndex++] = value._granularity; array[startingIndex++] = value._extrudedHeight; - array[startingIndex] = value._extrude ? 1.0 : 0.0; + array[startingIndex++] = value._extrude ? 1.0 : 0.0; + array[startingIndex] = value._shadowVolume ? 1.0 : 0.0; return array; }; @@ -27332,7 +26731,8 @@ define('Core/EllipseGeometry',[ stRotation : undefined, height : undefined, granularity : undefined, - extrudedHeight : undefined + extrudedHeight : undefined, + shadowVolume: undefined }; /** @@ -27369,7 +26769,8 @@ define('Core/EllipseGeometry',[ var height = array[startingIndex++]; var granularity = array[startingIndex++]; var extrudedHeight = array[startingIndex++]; - var extrude = array[startingIndex] === 1.0; + var extrude = array[startingIndex++] === 1.0; + var shadowVolume = array[startingIndex] === 1.0; if (!defined(result)) { scratchOptions.height = height; @@ -27379,6 +26780,7 @@ define('Core/EllipseGeometry',[ scratchOptions.rotation = rotation; scratchOptions.semiMajorAxis = semiMajorAxis; scratchOptions.semiMinorAxis = semiMinorAxis; + scratchOptions.shadowVolume = shadowVolume; return new EllipseGeometry(scratchOptions); } @@ -27393,6 +26795,7 @@ define('Core/EllipseGeometry',[ result._granularity = granularity; result._extrudedHeight = extrudedHeight; result._extrude = extrude; + result._shadowVolume = shadowVolume; result._rectangle = Rectangle.clone(rectangle); return result; @@ -27426,6 +26829,7 @@ define('Core/EllipseGeometry',[ if (ellipseGeometry._extrude) { options.extrudedHeight = Math.min(ellipseGeometry._extrudedHeight, ellipseGeometry._height); options.height = Math.max(ellipseGeometry._extrudedHeight, ellipseGeometry._height); + options.shadowVolume = ellipseGeometry._shadowVolume; geometry = computeExtrudedEllipse(options); } else { geometry = computeEllipse(options); @@ -27459,7 +26863,8 @@ define('Core/EllipseGeometry',[ granularity : granularity, extrudedHeight : minHeight, height : maxHeight, - vertexFormat : VertexFormat.POSITION_ONLY + vertexFormat : VertexFormat.POSITION_ONLY, + shadowVolume: true }); }; @@ -27480,6 +26885,7 @@ define('Core/EllipseGeometry',[ /*global define*/ define('Core/CircleGeometry',[ './Cartesian3', + './Check', './defaultValue', './defined', './defineProperties', @@ -27489,6 +26895,7 @@ define('Core/CircleGeometry',[ './VertexFormat' ], function( Cartesian3, + Check, defaultValue, defined, defineProperties, @@ -27532,9 +26939,7 @@ define('Core/CircleGeometry',[ options = defaultValue(options, defaultValue.EMPTY_OBJECT); var radius = options.radius; - if (!defined(radius)) { - throw new DeveloperError('radius is required.'); - } + Check.typeOf.number('radius', radius); var ellipseGeometryOptions = { center : options.center, @@ -27545,7 +26950,8 @@ define('Core/CircleGeometry',[ extrudedHeight : options.extrudedHeight, granularity : options.granularity, vertexFormat : options.vertexFormat, - stRotation : options.stRotation + stRotation : options.stRotation, + shadowVolume: options.shadowVolume }; this._ellipseGeometry = new EllipseGeometry(ellipseGeometryOptions); this._workerName = 'createCircleGeometry'; @@ -27567,9 +26973,7 @@ define('Core/CircleGeometry',[ * @returns {Number[]} The array that was packed into */ CircleGeometry.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } + Check.typeOf.object('value', value); return EllipseGeometry.pack(value._ellipseGeometry, array, startingIndex); }; @@ -27588,7 +26992,8 @@ define('Core/CircleGeometry',[ vertexFormat : new VertexFormat(), stRotation : undefined, semiMajorAxis : undefined, - semiMinorAxis : undefined + semiMinorAxis : undefined, + shadowVolume: undefined }; /** @@ -27608,6 +27013,7 @@ define('Core/CircleGeometry',[ scratchOptions.granularity = ellipseGeometry._granularity; scratchOptions.vertexFormat = VertexFormat.clone(ellipseGeometry._vertexFormat, scratchOptions.vertexFormat); scratchOptions.stRotation = ellipseGeometry._stRotation; + scratchOptions.shadowVolume = ellipseGeometry._shadowVolume; if (!defined(result)) { scratchOptions.radius = ellipseGeometry._semiMajorAxis; @@ -27648,7 +27054,8 @@ define('Core/CircleGeometry',[ granularity : granularity, extrudedHeight : minHeight, height : maxHeight, - vertexFormat : VertexFormat.POSITION_ONLY + vertexFormat : VertexFormat.POSITION_ONLY, + shadowVolume: true }); }; diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createCircleOutlineGeometry.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createCircleOutlineGeometry.js index c2d7145d..e96d2eaf 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createCircleOutlineGeometry.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createCircleOutlineGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,68 +45,6 @@ define('Core/defined',[],function() { return defined; }); -/*global define*/ -define('Core/freezeObject',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Freezes an object, using Object.freeze if available, otherwise returns - * the object unchanged. This function should be used in setup code to prevent - * errors from completely halting JavaScript execution in legacy browsers. - * - * @private - * - * @exports freezeObject - */ - var freezeObject = Object.freeze; - if (!defined(freezeObject)) { - freezeObject = function(o) { - return o; - }; - } - - return freezeObject; -}); - -/*global define*/ -define('Core/defaultValue',[ - './freezeObject' - ], function( - freezeObject) { - 'use strict'; - - /** - * Returns the first parameter if not undefined, otherwise the second parameter. - * Useful for setting a default value for a parameter. - * - * @exports defaultValue - * - * @param {*} a - * @param {*} b - * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter. - * - * @example - * param = Cesium.defaultValue(param, 'default'); - */ - function defaultValue(a, b) { - if (a !== undefined) { - return a; - } - return b; - } - - /** - * A frozen empty object that can be used as the default value for options passed as - * an object literal. - */ - defaultValue.EMPTY_OBJECT = freezeObject({}); - - return defaultValue; -}); - /*global define*/ define('Core/DeveloperError',[ './defined' @@ -188,41 +126,13 @@ define('Core/DeveloperError',[ return DeveloperError; }); -/*global define*/ -define('Core/isArray',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Tests an object to see if it is an array. - * @exports isArray - * - * @param {Object} value The value to test. - * @returns {Boolean} true if the value is an array, false otherwise. - */ - var isArray = Array.isArray; - if (!defined(isArray)) { - isArray = function(value) { - return Object.prototype.toString.call(value) === '[object Array]'; - }; - } - - return isArray; -}); - /*global define*/ define('Core/Check',[ - './defaultValue', - './defined', - './DeveloperError', - './isArray' + './defined', + './DeveloperError' ], function( - defaultValue, defined, - DeveloperError, - isArray) { + DeveloperError) { 'use strict'; /** @@ -237,111 +147,134 @@ define('Core/Check',[ */ Check.typeOf = {}; - /** - * Contains functions for checking numeric conditions such as minimum and maximum values - */ - Check.numeric = {}; - function getUndefinedErrorMessage(name) { - return name + ' was required but undefined.'; + return name + ' is required, actual value was undefined'; } function getFailedTypeErrorMessage(actual, expected, name) { - return 'Expected ' + name + ' to be typeof ' + expected + ', got ' + actual; + return 'Expected ' + name + ' to be typeof ' + expected + ', actual typeof was ' + actual; } /** * Throws if test is not defined * - * @param {*} test The value that is to be checked * @param {String} name The name of the variable being tested + * @param {*} test The value that is to be checked * @exception {DeveloperError} test must be defined */ - Check.defined = function (test, name) { + Check.defined = function (name, test) { if (!defined(test)) { throw new DeveloperError(getUndefinedErrorMessage(name)); } }; /** - * Throws if test is greater than maximum + * Throws if test is not typeof 'function' * - * @param {Number} test The value to test - * @param {Number} maximum The maximum allowed value - * @exception {DeveloperError} test must not be greater than maximum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'function' */ - Check.numeric.maximum = function (test, maximum) { - Check.typeOf.number(test); - Check.typeOf.number(maximum); - if (test > maximum) { - throw new DeveloperError('Expected ' + test + ' to be at most ' + maximum); + Check.typeOf.func = function (name, test) { + if (typeof test !== 'function') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); } }; /** - * Throws if test is less than minimum + * Throws if test is not typeof 'string' * - * @param {Number} test The value to test - * @param {Number} minimum The minimum allowed value - * @exception {DeveloperError} test must not be less than mininum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'string' */ - Check.numeric.minimum = function (test, minimum) { - Check.typeOf.number(test); - Check.typeOf.number(minimum); - if (test < minimum) { - throw new DeveloperError('Expected ' + test + ' to be at least ' + minimum); + Check.typeOf.string = function (name, test) { + if (typeof test !== 'string') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); } }; /** - * Throws if test is not typeof 'function' + * Throws if test is not typeof 'number' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'function' + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'number' */ - Check.typeOf.function = function (test, name) { - if (typeof test !== 'function') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); + Check.typeOf.number = function (name, test) { + if (typeof test !== 'number') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); } }; /** - * Throws if test is not typeof 'string' + * Throws if test is not typeof 'number' and less than limit * + * @param {String} name The name of the variable being tested * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than limit + */ + Check.typeOf.number.lessThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test >= limit) { + throw new DeveloperError('Expected ' + name + ' to be less than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and less than or equal to limit + * * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'string' + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than or equal to limit */ - Check.typeOf.string = function (test, name) { - if (typeof test !== 'string') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); + Check.typeOf.number.lessThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test > limit) { + throw new DeveloperError('Expected ' + name + ' to be less than or equal to ' + limit + ', actual value was ' + test); } }; /** - * Throws if test is not typeof 'number' + * Throws if test is not typeof 'number' and greater than limit * + * @param {String} name The name of the variable being tested * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than limit + */ + Check.typeOf.number.greaterThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test <= limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and greater than or equal to limit + * * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'number' + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than or equal to limit */ - Check.typeOf.number = function (test, name) { - if (typeof test !== 'number') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); + Check.typeOf.number.greaterThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test < limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than or equal to' + limit + ', actual value was ' + test); } }; /** * Throws if test is not typeof 'object' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested + * @param {*} test The value to test * @exception {DeveloperError} test must be typeof 'object' */ - Check.typeOf.object = function (test, name) { + Check.typeOf.object = function (name, test) { if (typeof test !== 'object') { throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'object', name)); } @@ -350,11 +283,11 @@ define('Core/Check',[ /** * Throws if test is not typeof 'boolean' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested + * @param {*} test The value to test * @exception {DeveloperError} test must be typeof 'boolean' */ - Check.typeOf.boolean = function (test, name) { + Check.typeOf.bool = function (name, test) { if (typeof test !== 'boolean') { throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'boolean', name)); } @@ -363,6 +296,68 @@ define('Core/Check',[ return Check; }); +/*global define*/ +define('Core/freezeObject',[ + './defined' + ], function( + defined) { + 'use strict'; + + /** + * Freezes an object, using Object.freeze if available, otherwise returns + * the object unchanged. This function should be used in setup code to prevent + * errors from completely halting JavaScript execution in legacy browsers. + * + * @private + * + * @exports freezeObject + */ + var freezeObject = Object.freeze; + if (!defined(freezeObject)) { + freezeObject = function(o) { + return o; + }; + } + + return freezeObject; +}); + +/*global define*/ +define('Core/defaultValue',[ + './freezeObject' + ], function( + freezeObject) { + 'use strict'; + + /** + * Returns the first parameter if not undefined, otherwise the second parameter. + * Useful for setting a default value for a parameter. + * + * @exports defaultValue + * + * @param {*} a + * @param {*} b + * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter. + * + * @example + * param = Cesium.defaultValue(param, 'default'); + */ + function defaultValue(a, b) { + if (a !== undefined) { + return a; + } + return b; + } + + /** + * A frozen empty object that can be used as the default value for options passed as + * an object literal. + */ + defaultValue.EMPTY_OBJECT = freezeObject({}); + + return defaultValue; +}); + /* I've wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace so it's better encapsulated. Now you can have multiple random number generators @@ -1047,7 +1042,7 @@ define('Core/Math',[ if (!defined(angle)) { throw new DeveloperError('angle is required.'); } - + return CesiumMath.clamp(angle, -1*CesiumMath.PI_OVER_TWO, CesiumMath.PI_OVER_TWO); }; @@ -1057,11 +1052,11 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [<code>-CesiumMath.PI</code>, <code>CesiumMath.PI</code>]. */ - CesiumMath.negativePiToPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.negativePiToPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - return CesiumMath.zeroToTwoPi(x + CesiumMath.PI) - CesiumMath.PI; + return CesiumMath.zeroToTwoPi(angle + CesiumMath.PI) - CesiumMath.PI; }; /** @@ -1070,12 +1065,12 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [0, <code>CesiumMath.TWO_PI</code>]. */ - CesiumMath.zeroToTwoPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.zeroToTwoPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - var mod = CesiumMath.mod(x, CesiumMath.TWO_PI); - if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(x) > CesiumMath.EPSILON14) { + var mod = CesiumMath.mod(angle, CesiumMath.TWO_PI); + if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(angle) > CesiumMath.EPSILON14) { return CesiumMath.TWO_PI; } return mod; @@ -1145,7 +1140,7 @@ define('Core/Math',[ * @example * //Compute 7!, which is equal to 5040 * var computedFactorial = Cesium.Math.factorial(7); - * + * * @see {@link http://en.wikipedia.org/wiki/Factorial|Factorial on Wikipedia} */ CesiumMath.factorial = function(n) { @@ -1429,7 +1424,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.fromSpherical = function(spherical, result) { - Check.typeOf.object(spherical, 'spherical'); + Check.typeOf.object('spherical', spherical); if (!defined(result)) { result = new Cartesian3(); @@ -1513,8 +1508,8 @@ define('Core/Cartesian3',[ * @returns {Number[]} The array that was packed into */ Cartesian3.pack = function(value, array, startingIndex) { - Check.typeOf.object(value, 'value'); - Check.defined(array, 'array'); + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1534,7 +1529,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.unpack = function(array, startingIndex, result) { - Check.defined(array, 'array'); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1555,7 +1550,7 @@ define('Core/Cartesian3',[ * @returns {Number[]} The packed array. */ Cartesian3.packArray = function(array, result) { - Check.defined(array, 'array'); + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -1578,8 +1573,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3[]} The unpacked array. */ Cartesian3.unpackArray = function(array, result) { - Check.defined(array, 'array'); - Check.numeric.minimum(array.length, 3); + Check.defined('array', array); + Check.typeOf.number.greaterThanOrEquals('array.length', array.length, 3); if (array.length % 3 !== 0) { throw new DeveloperError('array length must be a multiple of 3.'); } @@ -1625,7 +1620,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the maximum component. */ Cartesian3.maximumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z); }; @@ -1637,7 +1632,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the minimum component. */ Cartesian3.minimumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z); }; @@ -1651,9 +1646,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the minimum components. */ Cartesian3.minimumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -1671,9 +1666,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the maximum components. */ Cartesian3.maximumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -1688,7 +1683,7 @@ define('Core/Cartesian3',[ * @returns {Number} The squared magnitude. */ Cartesian3.magnitudeSquared = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z; }; @@ -1717,8 +1712,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distance(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(2.0, 0.0, 0.0)); */ Cartesian3.distance = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitude(distanceScratch); @@ -1737,8 +1732,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distanceSquared(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(3.0, 0.0, 0.0)); */ Cartesian3.distanceSquared = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitudeSquared(distanceScratch); @@ -1752,8 +1747,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.normalize = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian3.magnitude(cartesian); @@ -1776,8 +1771,8 @@ define('Core/Cartesian3',[ * @returns {Number} The dot product. */ Cartesian3.dot = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z; }; @@ -1791,9 +1786,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyComponents = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -1835,9 +1830,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.add = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -1854,9 +1849,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.subtract = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -1873,9 +1868,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -1892,9 +1887,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.divideByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -1910,8 +1905,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.negate = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -1927,8 +1922,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.abs = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -1947,10 +1942,10 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.lerp = function(start, end, t, result) { - Check.typeOf.object(start, 'start'); - Check.typeOf.object(end, 'end'); - Check.typeOf.number(t, 't'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian3.multiplyByScalar(end, t, lerpScratch); result = Cartesian3.multiplyByScalar(start, 1.0 - t, result); @@ -1967,8 +1962,8 @@ define('Core/Cartesian3',[ * @returns {Number} The angle between the Cartesians. */ Cartesian3.angleBetween = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.normalize(left, angleBetweenScratch); Cartesian3.normalize(right, angleBetweenScratch2); @@ -1986,8 +1981,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The most orthogonal axis. */ Cartesian3.mostOrthogonalAxis = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian3.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian3.abs(f, f); @@ -2064,9 +2059,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The cross product. */ Cartesian3.cross = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var leftX = left.x; var leftY = left.y; @@ -2099,8 +2094,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromDegrees(-115.0, 37.0); */ Cartesian3.fromDegrees = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); longitude = CesiumMath.toRadians(longitude); latitude = CesiumMath.toRadians(latitude); @@ -2125,8 +2120,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromRadians(-2.007, 0.645); */ Cartesian3.fromRadians = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); height = defaultValue(height, 0.0); var radiiSquared = defined(ellipsoid) ? ellipsoid.radiiSquared : wgs84RadiiSquared; @@ -2160,7 +2155,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArray([-115.0, 37.0, -107.0, 33.0]); */ Cartesian3.fromDegreesArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -2194,7 +2189,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArray([-2.007, 0.645, -1.867, .575]); */ Cartesian3.fromRadiansArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -2228,7 +2223,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArrayHeights([-115.0, 37.0, 100000.0, -107.0, 33.0, 150000.0]); */ Cartesian3.fromDegreesArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -2263,7 +2258,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArrayHeights([-2.007, 0.645, 100000.0, -1.867, .575, 150000.0]); */ Cartesian3.fromRadiansArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -3010,7 +3005,9 @@ define('Core/Ellipsoid',[ /** * Computes an Ellipsoid from a Cartesian specifying the radii in x, y, and z directions. * - * @param {Cartesian3} [radii=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Cartesian3} [cartesian=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new + * instance should be created. * @returns {Ellipsoid} A new Ellipsoid instance. * * @exception {DeveloperError} All radii components must be greater than or equal to zero. @@ -3650,6 +3647,7 @@ define('Core/Interval',[ /*global define*/ define('Core/Matrix3',[ './Cartesian3', + './Check', './defaultValue', './defined', './defineProperties', @@ -3658,6 +3656,7 @@ define('Core/Matrix3',[ './Math' ], function( Cartesian3, + Check, defaultValue, defined, defineProperties, @@ -3720,13 +3719,8 @@ define('Core/Matrix3',[ * @returns {Number[]} The array that was packed into */ Matrix3.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3752,9 +3746,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. */ Matrix3.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3781,24 +3773,24 @@ define('Core/Matrix3',[ * @param {Matrix3} [result] The object onto which to store the result. * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. (Returns undefined if matrix is undefined) */ - Matrix3.clone = function(values, result) { - if (!defined(values)) { + Matrix3.clone = function(matrix, result) { + if (!defined(matrix)) { return undefined; } if (!defined(result)) { - return new Matrix3(values[0], values[3], values[6], - values[1], values[4], values[7], - values[2], values[5], values[8]); + return new Matrix3(matrix[0], matrix[3], matrix[6], + matrix[1], matrix[4], matrix[7], + matrix[2], matrix[5], matrix[8]); } - result[0] = values[0]; - result[1] = values[1]; - result[2] = values[2]; - result[3] = values[3]; - result[4] = values[4]; - result[5] = values[5]; - result[6] = values[6]; - result[7] = values[7]; - result[8] = values[8]; + result[0] = matrix[0]; + result[1] = matrix[1]; + result[2] = matrix[2]; + result[3] = matrix[3]; + result[4] = matrix[4]; + result[5] = matrix[5]; + result[6] = matrix[6]; + result[7] = matrix[7]; + result[8] = matrix[8]; return result; }; @@ -3824,9 +3816,7 @@ define('Core/Matrix3',[ * var m2 = Cesium.Matrix3.fromArray(v2, 2); */ Matrix3.fromArray = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3854,9 +3844,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values parameter is required'); - } + Check.defined('values', values); return Matrix3.clone(values, result); }; @@ -3870,9 +3858,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix3(values[0], values[1], values[2], @@ -3899,9 +3885,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this quaternion. */ Matrix3.fromQuaternion = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); var x2 = quaternion.x * quaternion.x; var xy = quaternion.x * quaternion.y; @@ -3951,10 +3935,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this headingPitchRoll. */ Matrix3.fromHeadingPitchRoll = function(headingPitchRoll, result) { - if (!defined(headingPitchRoll)) { - throw new DeveloperError('headingPitchRoll is required'); - } - var cosTheta = Math.cos(-headingPitchRoll.pitch); + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + + var cosTheta = Math.cos(-headingPitchRoll.pitch); var cosPsi = Math.cos(-headingPitchRoll.heading); var cosPhi = Math.cos(headingPitchRoll.roll); var sinTheta = Math.sin(-headingPitchRoll.pitch); @@ -4005,9 +3988,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix3( @@ -4043,9 +4024,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromUniformScale(2.0); */ Matrix3.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix3( @@ -4069,7 +4048,7 @@ define('Core/Matrix3',[ /** * Computes a Matrix3 instance representing the cross product equivalent matrix of a Cartesian3 vector. * - * @param {Cartesian3} the vector on the left hand side of the cross product operation. + * @param {Cartesian3} vector the vector on the left hand side of the cross product operation. * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created. * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. * @@ -4081,9 +4060,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromCrossProduct(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromCrossProduct = function(vector, result) { - if (!defined(vector)) { - throw new DeveloperError('vector is required.'); - } + Check.typeOf.object('vector', vector); if (!defined(result)) { return new Matrix3( @@ -4118,9 +4095,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationX = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4159,9 +4134,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationY = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4200,9 +4173,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationZ = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4236,9 +4207,7 @@ define('Core/Matrix3',[ * @returns {Number[]} The modified Array parameter or a new Array instance if one was not provided. */ Matrix3.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5], matrix[6], matrix[7], matrix[8]]; @@ -4272,12 +4241,10 @@ define('Core/Matrix3',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix3.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 2) { - throw new DeveloperError('row must be 0, 1, or 2.'); - } - if (typeof column !== 'number' || column < 0 || column > 2) { - throw new DeveloperError('column must be 0, 1, or 2.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 2); + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 2); return column * 3 + row; }; @@ -4293,16 +4260,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var startIndex = index * 3; var x = matrix[startIndex]; @@ -4327,18 +4288,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); var startIndex = index * 3; @@ -4359,15 +4313,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 3]; @@ -4391,18 +4340,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); result[index] = cartesian.x; @@ -4421,12 +4363,8 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[3], matrix[4], matrix[5], scratchColumn)); @@ -4457,15 +4395,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var column0Row0 = left[0] * right[0] + left[3] * right[1] + left[6] * right[2]; var column0Row1 = left[1] * right[0] + left[4] * right[1] + left[7] * right[2]; @@ -4500,15 +4432,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -4531,15 +4457,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -4562,15 +4482,9 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -4595,15 +4509,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -4634,15 +4542,9 @@ define('Core/Matrix3',[ * @see Matrix3.multiplyByUniformScale */ Matrix3.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); result[0] = matrix[0] * scale.x; result[1] = matrix[1] * scale.x; @@ -4664,12 +4566,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -4691,12 +4589,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var column0Row0 = matrix[0]; var column0Row1 = matrix[3]; @@ -4836,9 +4730,7 @@ define('Core/Matrix3',[ * var c = Cesium.Cartesian3.multiplyByScalar(v, lambda, new Cesium.Cartesian3()); // equal to Cesium.Matrix3.multiplyByVector(a, v) */ Matrix3.computeEigenDecomposition = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); // This routine was created based upon Matrix Computations, 3rd ed., by Golub and Van Loan, // section 8.4.3 The Classical Jacobi Algorithm @@ -4882,12 +4774,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -4909,9 +4797,7 @@ define('Core/Matrix3',[ * @returns {Number} The value of the determinant of the matrix. */ Matrix3.determinant = function(matrix) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); var m11 = matrix[0]; var m21 = matrix[3]; @@ -4936,12 +4822,8 @@ define('Core/Matrix3',[ * @exception {DeveloperError} matrix is not invertible. */ Matrix3.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var m11 = matrix[0]; var m21 = matrix[1]; @@ -5007,9 +4889,7 @@ define('Core/Matrix3',[ * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. */ Matrix3.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -5197,12 +5077,14 @@ define('Core/Matrix3',[ /*global define*/ define('Core/Cartesian4',[ + './Check', './defaultValue', './defined', './DeveloperError', './freezeObject', './Math' ], function( + Check, defaultValue, defined, DeveloperError, @@ -5285,9 +5167,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.fromColor = function(color, result) { - if (!defined(color)) { - throw new DeveloperError('color is required'); - } + Check.typeOf.object('color', color); if (!defined(result)) { return new Cartesian4(color.red, color.green, color.blue, color.alpha); } @@ -5339,12 +5219,8 @@ define('Core/Cartesian4',[ * @returns {Number[]} The array that was packed into */ Cartesian4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5365,9 +5241,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5389,9 +5263,7 @@ define('Core/Cartesian4',[ * @returns {Number[]} The packed array. */ Cartesian4.packArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -5414,9 +5286,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4[]} The unpacked array. */ Cartesian4.unpackArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -5459,9 +5329,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the maximum component. */ Cartesian4.maximumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -5473,9 +5341,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the minimum component. */ Cartesian4.minimumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -5489,15 +5355,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the minimum components. */ Cartesian4.minimumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -5516,15 +5376,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the maximum components. */ Cartesian4.maximumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -5541,9 +5395,7 @@ define('Core/Cartesian4',[ * @returns {Number} The squared magnitude. */ Cartesian4.magnitudeSquared = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z + cartesian.w * cartesian.w; }; @@ -5574,9 +5426,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(2.0, 0.0, 0.0, 0.0)); */ Cartesian4.distance = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitude(distanceScratch); @@ -5597,9 +5448,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(3.0, 0.0, 0.0, 0.0)); */ Cartesian4.distanceSquared = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitudeSquared(distanceScratch); @@ -5613,12 +5463,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.normalize = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian4.magnitude(cartesian); @@ -5642,12 +5488,8 @@ define('Core/Cartesian4',[ * @returns {Number} The dot product. */ Cartesian4.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w; }; @@ -5661,15 +5503,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -5687,15 +5523,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x / right.x; result.y = left.y / right.y; @@ -5713,15 +5543,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -5739,15 +5563,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -5765,15 +5583,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -5791,15 +5603,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -5816,12 +5622,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.negate = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -5838,12 +5640,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.abs = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -5863,18 +5661,10 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian4.multiplyByScalar(end, t, lerpScratch); result = Cartesian4.multiplyByScalar(start, 1.0 - t, result); @@ -5890,12 +5680,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The most orthogonal axis. */ Cartesian4.mostOrthogonalAxis = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian4.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian4.abs(f, f); @@ -6140,6 +5926,7 @@ define('Core/RuntimeError',[ define('Core/Matrix4',[ './Cartesian3', './Cartesian4', + './Check', './defaultValue', './defined', './defineProperties', @@ -6151,6 +5938,7 @@ define('Core/Matrix4',[ ], function( Cartesian3, Cartesian4, + Check, defaultValue, defined, defineProperties, @@ -6241,13 +6029,8 @@ define('Core/Matrix4',[ * @returns {Number[]} The array that was packed into */ Matrix4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -6280,9 +6063,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if one was not provided. */ Matrix4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -6378,9 +6159,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required'); - } + Check.defined('values', values); return Matrix4.clone(values, result); }; @@ -6394,9 +6173,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix4(values[0], values[1], values[2], values[3], @@ -6433,9 +6210,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRotationTranslation = function(rotation, translation, result) { - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } + Check.typeOf.object('rotation', rotation); translation = defaultValue(translation, Cartesian3.ZERO); @@ -6483,15 +6258,9 @@ define('Core/Matrix4',[ * result); */ Matrix4.fromTranslationQuaternionRotationScale = function(translation, rotation, scale, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('translation', translation); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('scale', scale); if (!defined(result)) { result = new Matrix4(); @@ -6552,9 +6321,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromTranslationRotationScale = function(translationRotationScale, result) { - if (!defined(translationRotationScale)) { - throw new DeveloperError('translationRotationScale is required.'); - } + Check.typeOf.object('translationRotationScale', translationRotationScale); return Matrix4.fromTranslationQuaternionRotationScale(translationRotationScale.translation, translationRotationScale.rotation, translationRotationScale.scale, result); }; @@ -6569,9 +6336,7 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByTranslation */ Matrix4.fromTranslation = function(translation, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } + Check.typeOf.object('translation', translation); return Matrix4.fromRotationTranslation(Matrix3.IDENTITY, translation, result); }; @@ -6592,9 +6357,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix4.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix4( @@ -6639,9 +6402,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromUniformScale(2.0); */ Matrix4.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix4(scale, 0.0, 0.0, 0.0, @@ -6681,23 +6442,15 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromCamera = function(camera, result) { - if (!defined(camera)) { - throw new DeveloperError('camera is required.'); - } + Check.typeOf.object('camera', camera); var position = camera.position; var direction = camera.direction; var up = camera.up; - if (!defined(position)) { - throw new DeveloperError('camera.position is required.'); - } - if (!defined(direction)) { - throw new DeveloperError('camera.direction is required.'); - } - if (!defined(up)) { - throw new DeveloperError('camera.up is required.'); - } + Check.typeOf.object('camera.position', position); + Check.typeOf.object('camera.direction', direction); + Check.typeOf.object('camera.up', up); Cartesian3.normalize(direction, fromCameraF); Cartesian3.normalize(Cartesian3.cross(fromCameraF, up, fromCameraR), fromCameraR); @@ -6776,21 +6529,11 @@ define('Core/Matrix4',[ * @exception {DeveloperError} far must be greater than zero. */ Matrix4.computePerspectiveFieldOfView = function(fovY, aspectRatio, near, far, result) { - if (fovY <= 0.0 || fovY > Math.PI) { - throw new DeveloperError('fovY must be in (0, PI].'); - } - if (aspectRatio <= 0.0) { - throw new DeveloperError('aspectRatio must be greater than zero.'); - } - if (near <= 0.0) { - throw new DeveloperError('near must be greater than zero.'); - } - if (far <= 0.0) { - throw new DeveloperError('far must be greater than zero.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThan('fovY', fovY, 0.0); + Check.typeOf.number.lessThan('fovY', fovY, Math.PI); + Check.typeOf.number.greaterThan('near', near, 0.0); + Check.typeOf.number.greaterThan('far', far, 0.0); + Check.typeOf.object('result', result); var bottom = Math.tan(fovY * 0.5); @@ -6831,27 +6574,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeOrthographicOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var a = 1.0 / (right - left); var b = 1.0 / (top - bottom); @@ -6896,27 +6625,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computePerspectiveOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -6957,24 +6672,12 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeInfinitePerspectiveOffCenter = function(left, right, bottom, top, near, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -7022,9 +6725,7 @@ define('Core/Matrix4',[ * }, 0.0, 1.0, new Cesium.Matrix4()); */ Matrix4.computeViewportTransformation = function(viewport, nearDepthRange, farDepthRange, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); viewport = defaultValue(viewport, defaultValue.EMPTY_OBJECT); var x = defaultValue(viewport.x, 0.0); @@ -7076,21 +6777,11 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeView = function(position, direction, up, right, result) { - if (!defined(position)) { - throw new DeveloperError('position is required'); - } - if (!defined(direction)) { - throw new DeveloperError('direction is required'); - } - if (!defined(up)) { - throw new DeveloperError('up is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); + Check.typeOf.object('up', up); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = right.x; result[1] = up.x; @@ -7131,9 +6822,7 @@ define('Core/Matrix4',[ * //creates a = [10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0] */ Matrix4.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], @@ -7177,12 +6866,11 @@ define('Core/Matrix4',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix4.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 3) { - throw new DeveloperError('row must be 0, 1, 2, or 3.'); - } - if (typeof column !== 'number' || column < 0 || column > 3) { - throw new DeveloperError('column must be 0, 1, 2, or 3.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 3); + + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 3); return column * 4 + row; }; @@ -7215,16 +6903,12 @@ define('Core/Matrix4',[ * // a.x = 12.0; a.y = 16.0; a.z = 20.0; a.w = 24.0; */ Matrix4.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var startIndex = index * 4; var x = matrix[startIndex]; @@ -7266,18 +6950,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 96.0, 25.0] */ Matrix4.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); var startIndex = index * 4; @@ -7298,15 +6977,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.setTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -7359,16 +7032,12 @@ define('Core/Matrix4',[ * // a.x = 18.0; a.y = 19.0; a.z = 20.0; a.w = 21.0; */ Matrix4.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 4]; @@ -7409,18 +7078,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 24.0, 25.0] */ Matrix4.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); result[index] = cartesian.x; @@ -7440,12 +7104,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter */ Matrix4.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[4], matrix[5], matrix[6], scratchColumn)); @@ -7477,15 +7137,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -7569,15 +7223,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -7607,15 +7255,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -7656,15 +7298,9 @@ define('Core/Matrix4',[ * var m3 = Cesium.Matrix4.multiplyTransformation(m1, m2, new Cesium.Matrix4()); */ Matrix4.multiplyTransformation = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -7742,15 +7378,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByMatrix3(m, rotation, m); */ Matrix4.multiplyByMatrix3 = function(matrix, rotation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('result', result); var left0 = matrix[0]; var left1 = matrix[1]; @@ -7818,15 +7448,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByTranslation(m, position, m); */ Matrix4.multiplyByTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); var x = translation.x; var y = translation.y; @@ -7878,15 +7502,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByScale */ Matrix4.multiplyByUniformScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scale', scale); + Check.typeOf.object('result', result); uniformScaleScratch.x = scale; uniformScaleScratch.y = scale; @@ -7915,15 +7533,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByUniformScale */ Matrix4.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); var scaleX = scale.x; var scaleY = scale.y; @@ -7962,15 +7574,9 @@ define('Core/Matrix4',[ * @returns {Cartesian4} The modified result parameter. */ Matrix4.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8006,15 +7612,9 @@ define('Core/Matrix4',[ * // Cesium.Matrix4.multiplyByVector(matrix, new Cesium.Cartesian4(p.x, p.y, p.z, 0.0), result); */ Matrix4.multiplyByPointAsVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8044,16 +7644,9 @@ define('Core/Matrix4',[ * var result = Cesium.Matrix4.multiplyByPoint(matrix, p, new Cesium.Cartesian3()); */ Matrix4.multiplyByPoint = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8093,15 +7686,9 @@ define('Core/Matrix4',[ * // [-44.0, -46.0, -48.0, -50.0] */ Matrix4.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -8145,12 +7732,8 @@ define('Core/Matrix4',[ * // [-22.0, -23.0, -24.0, -25.0] */ Matrix4.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -8194,12 +7777,8 @@ define('Core/Matrix4',[ * // [13.0, 17.0, 21.0, 25.0] */ Matrix4.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var matrix1 = matrix[1]; var matrix2 = matrix[2]; @@ -8235,12 +7814,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -8354,9 +7929,7 @@ define('Core/Matrix4',[ * //Prints "Difference between both the matrices is not less than 0.1" on the console */ Matrix4.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -8387,12 +7960,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter. */ Matrix4.getTranslation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = matrix[12]; result.y = matrix[13]; @@ -8423,12 +7992,8 @@ define('Core/Matrix4',[ * // [12.0, 16.0, 20.0] */ Matrix4.getRotation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -8459,13 +8024,9 @@ define('Core/Matrix4',[ * * @exception {RuntimeError} matrix is not invertible because its determinate is zero. */ - Matrix4.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Matrix4.inverse = function(matrix, result) { + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); // Special case for a zero scale matrix that can occur, for example, // when a model's node has a [0, 0, 0] scale. @@ -8603,12 +8164,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.inverseTransformation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); //This function is an optimized version of the below 4 lines. //var rT = Matrix3.transpose(Matrix4.getRotation(matrix)); @@ -8892,6 +8449,7 @@ define('Core/Matrix4',[ /*global define*/ define('Core/Rectangle',[ './Cartographic', + './Check', './defaultValue', './defined', './defineProperties', @@ -8901,6 +8459,7 @@ define('Core/Rectangle',[ './Math' ], function( Cartographic, + Check, defaultValue, defined, defineProperties, @@ -8997,13 +8556,8 @@ define('Core/Rectangle',[ * @returns {Number[]} The array that was packed into */ Rectangle.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -9024,9 +8578,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -9047,9 +8599,7 @@ define('Core/Rectangle',[ * @returns {Number} The width. */ Rectangle.computeWidth = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; if (east < west) { @@ -9064,9 +8614,7 @@ define('Core/Rectangle',[ * @returns {Number} The height. */ Rectangle.computeHeight = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); return rectangle.north - rectangle.south; }; @@ -9101,6 +8649,32 @@ define('Core/Rectangle',[ return result; }; + /** + * Creates an rectangle given the boundary longitude and latitude in radians. + * + * @param {Number} [west=0.0] The westernmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [south=0.0] The southernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Number} [east=0.0] The easternmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [north=0.0] The northernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Rectangle} [result] The object onto which to store the result, or undefined if a new instance should be created. + * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. + * + * @example + * var rectangle = Cesium.Rectangle.fromRadians(0.0, Math.PI/4, Math.PI/8, 3*Math.PI/4); + */ + Rectangle.fromRadians = function(west, south, east, north, result) { + if (!defined(result)) { + return new Rectangle(west, south, east, north); + } + + result.west = defaultValue(west, 0.0); + result.south = defaultValue(south, 0.0); + result.east = defaultValue(east, 0.0); + result.north = defaultValue(north, 0.0); + + return result; + }; + /** * Creates the smallest possible Rectangle that encloses all positions in the provided array. * @@ -9109,9 +8683,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartographicArray = function(cartographics, result) { - if (!defined(cartographics)) { - throw new DeveloperError('cartographics is required.'); - } + Check.defined('cartographics', cartographics); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -9164,9 +8736,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartesianArray = function(cartesians, ellipsoid, result) { - if (!defined(cartesians)) { - throw new DeveloperError('cartesians is required.'); - } + Check.defined('cartesians', cartesians); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -9282,9 +8852,7 @@ define('Core/Rectangle',[ * @returns {Boolean} <code>true</code> if the Rectangles are within the provided epsilon, <code>false</code> otherwise. */ Rectangle.prototype.equalsEpsilon = function(other, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon is required and must be a number.'); - } + Check.typeOf.number('epsilon', epsilon); return defined(other) && (Math.abs(this.west - other.west) <= epsilon) && @@ -9304,45 +8872,23 @@ define('Core/Rectangle',[ * @exception {DeveloperError} <code>west</code> must be in the interval [<code>-Pi</code>, <code>Pi</code>]. */ Rectangle.validate = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var north = rectangle.north; - if (typeof north !== 'number') { - throw new DeveloperError('north is required to be a number.'); - } - - if (north < -CesiumMath.PI_OVER_TWO || north > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('north must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('north', north, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('north', north, CesiumMath.PI_OVER_TWO); var south = rectangle.south; - if (typeof south !== 'number') { - throw new DeveloperError('south is required to be a number.'); - } - - if (south < -CesiumMath.PI_OVER_TWO || south > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('south must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('south', south, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('south', south, CesiumMath.PI_OVER_TWO); var west = rectangle.west; - if (typeof west !== 'number') { - throw new DeveloperError('west is required to be a number.'); - } - - if (west < -Math.PI || west > Math.PI) { - throw new DeveloperError('west must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('west', west, -Math.PI); + Check.typeOf.number.lessThanOrEquals('west', west, Math.PI); var east = rectangle.east; - if (typeof east !== 'number') { - throw new DeveloperError('east is required to be a number.'); - } - - if (east < -Math.PI || east > Math.PI) { - throw new DeveloperError('east must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('east', east, -Math.PI); + Check.typeOf.number.lessThanOrEquals('east', east, Math.PI); }; /** @@ -9353,9 +8899,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.south); @@ -9374,9 +8918,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.north); @@ -9395,9 +8937,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.north); @@ -9416,9 +8956,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.south); @@ -9437,9 +8975,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.center = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; @@ -9474,12 +9010,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.intersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var rectangleEast = rectangle.east; var rectangleWest = rectangle.west; @@ -9535,12 +9067,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.simpleIntersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var west = Math.max(rectangle.west, otherRectangle.west); var south = Math.max(rectangle.south, otherRectangle.south); @@ -9571,12 +9099,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.union = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); if (!defined(result)) { result = new Rectangle(); @@ -9620,12 +9144,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.expand = function(rectangle, cartographic, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); if (!defined(result)) { result = new Rectangle(); @@ -9647,12 +9167,8 @@ define('Core/Rectangle',[ * @returns {Boolean} true if the provided cartographic is inside the rectangle, false otherwise. */ Rectangle.contains = function(rectangle, cartographic) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); var longitude = cartographic.longitude; var latitude = cartographic.latitude; @@ -9685,9 +9201,7 @@ define('Core/Rectangle',[ * @returns {Cartesian3[]} The modified result parameter or a new Array of Cartesians instances if none was provided. */ Rectangle.subsample = function(rectangle, ellipsoid, surfaceHeight, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84); surfaceHeight = defaultValue(surfaceHeight, 0.0); @@ -9765,9 +9279,9 @@ define('Core/Rectangle',[ define('Core/BoundingSphere',[ './Cartesian3', './Cartographic', + './Check', './defaultValue', './defined', - './DeveloperError', './Ellipsoid', './GeographicProjection', './Intersect', @@ -9778,9 +9292,9 @@ define('Core/BoundingSphere',[ ], function( Cartesian3, Cartographic, + Check, defaultValue, defined, - DeveloperError, Ellipsoid, GeographicProjection, Intersect, @@ -10110,9 +9624,7 @@ define('Core/BoundingSphere',[ stride = defaultValue(stride, 3); - if (stride < 3) { - throw new DeveloperError('stride must be 3 or greater.'); - } + Check.typeOf.number.greaterThanOrEquals('stride', stride, 3); var currentPos = fromPointsCurrentPos; currentPos.x = positions[0] + center.x; @@ -10416,9 +9928,8 @@ define('Core/BoundingSphere',[ * var sphere = Cesium.BoundingSphere.fromCornerPoints(new Cesium.Cartesian3(-0.5, -0.5, -0.5), new Cesium.Cartesian3(0.5, 0.5, 0.5)); */ BoundingSphere.fromCornerPoints = function(corner, oppositeCorner, result) { - if (!defined(corner) || !defined(oppositeCorner)) { - throw new DeveloperError('corner and oppositeCorner are required.'); - } + Check.typeOf.object('corner', corner); + Check.typeOf.object('oppositeCorner', oppositeCorner); if (!defined(result)) { result = new BoundingSphere(); @@ -10442,9 +9953,7 @@ define('Core/BoundingSphere',[ * var boundingSphere = Cesium.BoundingSphere.fromEllipsoid(ellipsoid); */ BoundingSphere.fromEllipsoid = function(ellipsoid, result) { - if (!defined(ellipsoid)) { - throw new DeveloperError('ellipsoid is required.'); - } + Check.typeOf.object('ellipsoid', ellipsoid); if (!defined(result)) { result = new BoundingSphere(); @@ -10570,13 +10079,8 @@ define('Core/BoundingSphere',[ * @returns {Number[]} The array that was packed into */ BoundingSphere.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -10598,9 +10102,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if one was not provided. */ BoundingSphere.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -10627,13 +10129,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.union = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); if (!defined(result)) { result = new BoundingSphere(); @@ -10682,13 +10179,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.expand = function(sphere, point, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(point)) { - throw new DeveloperError('point is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('point', point); result = BoundingSphere.clone(sphere, result); @@ -10711,13 +10203,8 @@ define('Core/BoundingSphere',[ * intersects the plane. */ BoundingSphere.intersectPlane = function(sphere, plane) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(plane)) { - throw new DeveloperError('plane is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('plane', plane); var center = sphere.center; var radius = sphere.radius; @@ -10743,13 +10230,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.transform = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -10777,12 +10259,8 @@ define('Core/BoundingSphere',[ * }); */ BoundingSphere.distanceSquaredTo = function(sphere, cartesian) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('cartesian', cartesian); var diff = Cartesian3.subtract(sphere.center, cartesian, distanceSquaredToScratch); return Cartesian3.magnitudeSquared(diff) - sphere.radius * sphere.radius; @@ -10804,13 +10282,8 @@ define('Core/BoundingSphere',[ * var newBoundingSphere = Cesium.BoundingSphere.transformWithoutScale(boundingSphere, modelMatrix); */ BoundingSphere.transformWithoutScale = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -10837,17 +10310,9 @@ define('Core/BoundingSphere',[ * @returns {Interval} The nearest and farthest distances on the bounding sphere from position in direction. */ BoundingSphere.computePlaneDistances = function(sphere, position, direction, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(position)) { - throw new DeveloperError('position is required.'); - } - - if (!defined(direction)) { - throw new DeveloperError('direction is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); if (!defined(result)) { result = new Interval(); @@ -10882,9 +10347,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.projectTo2D = function(sphere, projection, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } + Check.typeOf.object('sphere', sphere); projection = defaultValue(projection, projectTo2DProjection); @@ -10979,12 +10442,8 @@ define('Core/BoundingSphere',[ * @returns {Boolean} <code>true</code> if the sphere is not visible; otherwise <code>false</code>. */ BoundingSphere.isOccluded = function(sphere, occluder) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(occluder)) { - throw new DeveloperError('occluder is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('occluder', occluder); return !occluder.isBoundingSphereVisible(sphere); }; @@ -12193,7 +11652,10 @@ define('Core/WebGLConstants',[ COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : 0x9279, TEXTURE_IMMUTABLE_FORMAT : 0x912F, MAX_ELEMENT_INDEX : 0x8D6B, - TEXTURE_IMMUTABLE_LEVELS : 0x82DF + TEXTURE_IMMUTABLE_LEVELS : 0x82DF, + + // Extensions + MAX_TEXTURE_MAX_ANISOTROPY_EXT : 0x84FF }; return freezeObject(WebGLConstants); @@ -12529,6 +11991,7 @@ define('Core/ComponentDatatype',[ /*global define*/ define('Core/Quaternion',[ './Cartesian3', + './Check', './defaultValue', './defined', './DeveloperError', @@ -12538,6 +12001,7 @@ define('Core/Quaternion',[ './Matrix3' ], function( Cartesian3, + Check, defaultValue, defined, DeveloperError, @@ -12600,12 +12064,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided. */ Quaternion.fromAxisAngle = function(axis, angle, result) { - if (!defined(axis)) { - throw new DeveloperError('axis is required.'); - } - if (typeof angle !== 'number') { - throw new DeveloperError('angle is required and must be a number.'); - } + Check.typeOf.object('axis', axis); + Check.typeOf.number('angle', angle); var halfAngle = angle / 2.0; var s = Math.sin(halfAngle); @@ -12637,9 +12097,7 @@ define('Core/Quaternion',[ * @see Matrix3.fromQuaternion */ Quaternion.fromRotationMatrix = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); var root; var x; @@ -12713,15 +12171,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter or a new Quaternion instance if none was provided. */ Quaternion.fromHeadingPitchRoll = function(heading, pitch, roll, result) { - if (!defined(heading)) { - throw new DeveloperError('heading is required.'); - } - if (!defined(pitch)) { - throw new DeveloperError('pitch is required.'); - } - if (!defined(roll)) { - throw new DeveloperError('roll is required.'); - } + Check.typeOf.number('heading', heading); + Check.typeOf.number('pitch', pitch); + Check.typeOf.number('roll', roll); var rollQuaternion = Quaternion.fromAxisAngle(Cartesian3.UNIT_X, roll, scratchHPRQuaternion); var pitchQuaternion = Quaternion.fromAxisAngle(Cartesian3.UNIT_Y, -pitch, result); @@ -12752,13 +12204,8 @@ define('Core/Quaternion',[ * @returns {Number[]} The array that was packed into */ Quaternion.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -12779,9 +12226,7 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided. */ Quaternion.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -12836,7 +12281,7 @@ define('Core/Quaternion',[ * * @param {Number[]} array The array previously packed for interpolation. * @param {Number[]} sourceArray The original packed array. - * @param {Number} [startingIndex=0] The startingIndex used to convert the array. + * @param {Number} [firstIndex=0] The firstIndex used to convert the array. * @param {Number} [lastIndex=packedArray.length] The lastIndex used to convert the array. * @param {Quaternion} [result] The object into which to store the result. * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided. @@ -12890,12 +12335,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.conjugate = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); result.x = -quaternion.x; result.y = -quaternion.y; @@ -12911,9 +12352,7 @@ define('Core/Quaternion',[ * @returns {Number} The magnitude squared. */ Quaternion.magnitudeSquared = function(quaternion) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); return quaternion.x * quaternion.x + quaternion.y * quaternion.y + quaternion.z * quaternion.z + quaternion.w * quaternion.w; }; @@ -12936,9 +12375,7 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.normalize = function(quaternion, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); var inverseMagnitude = 1.0 / Quaternion.magnitude(quaternion); var x = quaternion.x * inverseMagnitude; @@ -12961,9 +12398,7 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.inverse = function(quaternion, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); var magnitudeSquared = Quaternion.magnitudeSquared(quaternion); result = Quaternion.conjugate(quaternion, result); @@ -12979,15 +12414,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -13005,15 +12434,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -13030,12 +12453,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.negate = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); result.x = -quaternion.x; result.y = -quaternion.y; @@ -13052,12 +12471,8 @@ define('Core/Quaternion',[ * @returns {Number} The dot product. */ Quaternion.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w; }; @@ -13071,15 +12486,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var leftX = left.x; var leftY = left.y; @@ -13112,15 +12521,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.multiplyByScalar = function(quaternion, scalar, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = quaternion.x * scalar; result.y = quaternion.y * scalar; @@ -13138,15 +12541,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.divideByScalar = function(quaternion, scalar, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = quaternion.x / scalar; result.y = quaternion.y / scalar; @@ -13163,12 +12560,8 @@ define('Core/Quaternion',[ * @returns {Cartesian3} The modified result parameter. */ Quaternion.computeAxis = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); var w = quaternion.w; if (Math.abs(w - 1.0) < CesiumMath.EPSILON6) { @@ -13191,9 +12584,7 @@ define('Core/Quaternion',[ * @returns {Number} The angle of rotation. */ Quaternion.computeAngle = function(quaternion) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); if (Math.abs(quaternion.w - 1.0) < CesiumMath.EPSILON6) { return 0.0; @@ -13212,18 +12603,10 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); lerpScratch = Quaternion.multiplyByScalar(end, t, lerpScratch); result = Quaternion.multiplyByScalar(start, 1.0 - t, result); @@ -13245,18 +12628,10 @@ define('Core/Quaternion',[ * @see Quaternion#fastSlerp */ Quaternion.slerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var dot = Quaternion.dot(start, end); @@ -13289,12 +12664,8 @@ define('Core/Quaternion',[ * @returns {Cartesian3} The modified result parameter. */ Quaternion.log = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); var theta = CesiumMath.acosClamped(quaternion.w); var thetaOverSinTheta = 0.0; @@ -13314,12 +12685,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.exp = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var theta = Cartesian3.magnitude(cartesian); var sinThetaOverTheta = 0.0; @@ -13354,12 +12721,10 @@ define('Core/Quaternion',[ * @see Quaternion#squad */ Quaternion.computeInnerQuadrangle = function(q0, q1, q2, result) { - if (!defined(q0) || !defined(q1) || !defined(q2)) { - throw new DeveloperError('q0, q1, and q2 are required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('q0', q0); + Check.typeOf.object('q1', q1); + Check.typeOf.object('q2', q2); + Check.typeOf.object('result', result); var qInv = Quaternion.conjugate(q1, squadScratchQuaternion0); Quaternion.multiply(qInv, q2, squadScratchQuaternion1); @@ -13401,15 +12766,12 @@ define('Core/Quaternion',[ * @see Quaternion#computeInnerQuadrangle */ Quaternion.squad = function(q0, q1, s0, s1, t, result) { - if (!defined(q0) || !defined(q1) || !defined(s0) || !defined(s1)) { - throw new DeveloperError('q0, q1, s0, and s1 are required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('q0', q0); + Check.typeOf.object('q1', q1); + Check.typeOf.object('s0', s0); + Check.typeOf.object('s1', s1); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var slerp0 = Quaternion.slerp(q0, q1, t, squadScratchQuaternion0); var slerp1 = Quaternion.slerp(s0, s1, t, squadScratchQuaternion1); @@ -13446,18 +12808,10 @@ define('Core/Quaternion',[ * @see Quaternion#slerp */ Quaternion.fastSlerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var x = Quaternion.dot(start, end); @@ -13506,15 +12860,12 @@ define('Core/Quaternion',[ * @see Quaternion#squad */ Quaternion.fastSquad = function(q0, q1, s0, s1, t, result) { - if (!defined(q0) || !defined(q1) || !defined(s0) || !defined(s1)) { - throw new DeveloperError('q0, q1, s0, and s1 are required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('q0', q0); + Check.typeOf.object('q1', q1); + Check.typeOf.object('s0', s0); + Check.typeOf.object('s1', s1); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var slerp0 = Quaternion.fastSlerp(q0, q1, t, squadScratchQuaternion0); var slerp1 = Quaternion.fastSlerp(s0, s1, t, squadScratchQuaternion1); @@ -13550,9 +12901,7 @@ define('Core/Quaternion',[ * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. */ Quaternion.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon is required and must be a number.'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || ((defined(left)) && @@ -14096,7 +13445,7 @@ define('Core/Geometry',[ * <li><code>position</code> - 3D vertex position. 64-bit floating-point (for precision). 3 components per attribute. See {@link VertexFormat#position}.</li> * <li><code>normal</code> - Normal (normalized), commonly used for lighting. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#normal}.</li> * <li><code>st</code> - 2D texture coordinate. 32-bit floating-point. 2 components per attribute. See {@link VertexFormat#st}.</li> - * <li><code>binormal</code> - Binormal (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#binormal}.</li> + * <li><code>bitangent</code> - Bitangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#bitangent}.</li> * <li><code>tangent</code> - Tangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#tangent}.</li> * </ul> * </p> @@ -14125,7 +13474,7 @@ define('Core/Geometry',[ * componentsPerAttribute : 3, * values : new Float32Array(0) * }); - * + * * @see GeometryAttribute * @see VertexFormat */ @@ -14406,7 +13755,7 @@ define('Core/GeometryAttributes',[ this.st = options.st; /** - * The binormal attribute (normalized), which is used for tangent-space effects like bump mapping. + * The bitangent attribute (normalized), which is used for tangent-space effects like bump mapping. * <p> * 32-bit floating-point. 3 components per attribute. * </p> @@ -14415,7 +13764,7 @@ define('Core/GeometryAttributes',[ * * @default undefined */ - this.binormal = options.binormal; + this.bitangent = options.bitangent; /** * The tangent attribute (normalized), which is used for tangent-space effects like bump mapping. @@ -14950,6 +14299,7 @@ define('Core/EllipseOutlineGeometry',[ /*global define*/ define('Core/CircleOutlineGeometry',[ './Cartesian3', + './Check', './defaultValue', './defined', './DeveloperError', @@ -14957,6 +14307,7 @@ define('Core/CircleOutlineGeometry',[ './Ellipsoid' ], function( Cartesian3, + Check, defaultValue, defined, DeveloperError, @@ -14997,9 +14348,7 @@ define('Core/CircleOutlineGeometry',[ options = defaultValue(options, defaultValue.EMPTY_OBJECT); var radius = options.radius; - if (!defined(radius)) { - throw new DeveloperError('radius is required.'); - } + Check.typeOf.number('radius', radius); var ellipseGeometryOptions = { center : options.center, @@ -15031,9 +14380,7 @@ define('Core/CircleOutlineGeometry',[ * @returns {Number[]} The array that was packed into */ CircleOutlineGeometry.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } + Check.typeOf.object('value', value); return EllipseOutlineGeometry.pack(value._ellipseGeometry, array, startingIndex); }; diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createCorridorGeometry.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createCorridorGeometry.js index 84f156fc..17e1009b 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createCorridorGeometry.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createCorridorGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -872,7 +872,7 @@ define('Core/Math',[ if (!defined(angle)) { throw new DeveloperError('angle is required.'); } - + return CesiumMath.clamp(angle, -1*CesiumMath.PI_OVER_TWO, CesiumMath.PI_OVER_TWO); }; @@ -882,11 +882,11 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [<code>-CesiumMath.PI</code>, <code>CesiumMath.PI</code>]. */ - CesiumMath.negativePiToPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.negativePiToPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - return CesiumMath.zeroToTwoPi(x + CesiumMath.PI) - CesiumMath.PI; + return CesiumMath.zeroToTwoPi(angle + CesiumMath.PI) - CesiumMath.PI; }; /** @@ -895,12 +895,12 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [0, <code>CesiumMath.TWO_PI</code>]. */ - CesiumMath.zeroToTwoPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.zeroToTwoPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - var mod = CesiumMath.mod(x, CesiumMath.TWO_PI); - if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(x) > CesiumMath.EPSILON14) { + var mod = CesiumMath.mod(angle, CesiumMath.TWO_PI); + if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(angle) > CesiumMath.EPSILON14) { return CesiumMath.TWO_PI; } return mod; @@ -970,7 +970,7 @@ define('Core/Math',[ * @example * //Compute 7!, which is equal to 5040 * var computedFactorial = Cesium.Math.factorial(7); - * + * * @see {@link http://en.wikipedia.org/wiki/Factorial|Factorial on Wikipedia} */ CesiumMath.factorial = function(n) { @@ -1293,41 +1293,13 @@ define('Core/arrayRemoveDuplicates',[ return arrayRemoveDuplicates; }); -/*global define*/ -define('Core/isArray',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Tests an object to see if it is an array. - * @exports isArray - * - * @param {Object} value The value to test. - * @returns {Boolean} true if the value is an array, false otherwise. - */ - var isArray = Array.isArray; - if (!defined(isArray)) { - isArray = function(value) { - return Object.prototype.toString.call(value) === '[object Array]'; - }; - } - - return isArray; -}); - /*global define*/ define('Core/Check',[ - './defaultValue', - './defined', - './DeveloperError', - './isArray' + './defined', + './DeveloperError' ], function( - defaultValue, defined, - DeveloperError, - isArray) { + DeveloperError) { 'use strict'; /** @@ -1342,111 +1314,134 @@ define('Core/Check',[ */ Check.typeOf = {}; - /** - * Contains functions for checking numeric conditions such as minimum and maximum values - */ - Check.numeric = {}; - function getUndefinedErrorMessage(name) { - return name + ' was required but undefined.'; + return name + ' is required, actual value was undefined'; } function getFailedTypeErrorMessage(actual, expected, name) { - return 'Expected ' + name + ' to be typeof ' + expected + ', got ' + actual; + return 'Expected ' + name + ' to be typeof ' + expected + ', actual typeof was ' + actual; } /** * Throws if test is not defined * - * @param {*} test The value that is to be checked * @param {String} name The name of the variable being tested + * @param {*} test The value that is to be checked * @exception {DeveloperError} test must be defined */ - Check.defined = function (test, name) { + Check.defined = function (name, test) { if (!defined(test)) { throw new DeveloperError(getUndefinedErrorMessage(name)); } }; /** - * Throws if test is greater than maximum + * Throws if test is not typeof 'function' * - * @param {Number} test The value to test - * @param {Number} maximum The maximum allowed value - * @exception {DeveloperError} test must not be greater than maximum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'function' */ - Check.numeric.maximum = function (test, maximum) { - Check.typeOf.number(test); - Check.typeOf.number(maximum); - if (test > maximum) { - throw new DeveloperError('Expected ' + test + ' to be at most ' + maximum); + Check.typeOf.func = function (name, test) { + if (typeof test !== 'function') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); } }; /** - * Throws if test is less than minimum + * Throws if test is not typeof 'string' * - * @param {Number} test The value to test - * @param {Number} minimum The minimum allowed value - * @exception {DeveloperError} test must not be less than mininum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'string' */ - Check.numeric.minimum = function (test, minimum) { - Check.typeOf.number(test); - Check.typeOf.number(minimum); - if (test < minimum) { - throw new DeveloperError('Expected ' + test + ' to be at least ' + minimum); + Check.typeOf.string = function (name, test) { + if (typeof test !== 'string') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); } }; /** - * Throws if test is not typeof 'function' + * Throws if test is not typeof 'number' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'function' + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'number' */ - Check.typeOf.function = function (test, name) { - if (typeof test !== 'function') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); + Check.typeOf.number = function (name, test) { + if (typeof test !== 'number') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); } }; /** - * Throws if test is not typeof 'string' + * Throws if test is not typeof 'number' and less than limit * + * @param {String} name The name of the variable being tested * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than limit + */ + Check.typeOf.number.lessThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test >= limit) { + throw new DeveloperError('Expected ' + name + ' to be less than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and less than or equal to limit + * * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'string' + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than or equal to limit */ - Check.typeOf.string = function (test, name) { - if (typeof test !== 'string') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); + Check.typeOf.number.lessThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test > limit) { + throw new DeveloperError('Expected ' + name + ' to be less than or equal to ' + limit + ', actual value was ' + test); } }; /** - * Throws if test is not typeof 'number' + * Throws if test is not typeof 'number' and greater than limit * + * @param {String} name The name of the variable being tested * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than limit + */ + Check.typeOf.number.greaterThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test <= limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and greater than or equal to limit + * * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'number' + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than or equal to limit */ - Check.typeOf.number = function (test, name) { - if (typeof test !== 'number') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); + Check.typeOf.number.greaterThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test < limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than or equal to' + limit + ', actual value was ' + test); } }; /** * Throws if test is not typeof 'object' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested + * @param {*} test The value to test * @exception {DeveloperError} test must be typeof 'object' */ - Check.typeOf.object = function (test, name) { + Check.typeOf.object = function (name, test) { if (typeof test !== 'object') { throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'object', name)); } @@ -1455,11 +1450,11 @@ define('Core/Check',[ /** * Throws if test is not typeof 'boolean' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested + * @param {*} test The value to test * @exception {DeveloperError} test must be typeof 'boolean' */ - Check.typeOf.boolean = function (test, name) { + Check.typeOf.bool = function (name, test) { if (typeof test !== 'boolean') { throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'boolean', name)); } @@ -1529,7 +1524,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.fromSpherical = function(spherical, result) { - Check.typeOf.object(spherical, 'spherical'); + Check.typeOf.object('spherical', spherical); if (!defined(result)) { result = new Cartesian3(); @@ -1613,8 +1608,8 @@ define('Core/Cartesian3',[ * @returns {Number[]} The array that was packed into */ Cartesian3.pack = function(value, array, startingIndex) { - Check.typeOf.object(value, 'value'); - Check.defined(array, 'array'); + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1634,7 +1629,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.unpack = function(array, startingIndex, result) { - Check.defined(array, 'array'); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1655,7 +1650,7 @@ define('Core/Cartesian3',[ * @returns {Number[]} The packed array. */ Cartesian3.packArray = function(array, result) { - Check.defined(array, 'array'); + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -1678,8 +1673,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3[]} The unpacked array. */ Cartesian3.unpackArray = function(array, result) { - Check.defined(array, 'array'); - Check.numeric.minimum(array.length, 3); + Check.defined('array', array); + Check.typeOf.number.greaterThanOrEquals('array.length', array.length, 3); if (array.length % 3 !== 0) { throw new DeveloperError('array length must be a multiple of 3.'); } @@ -1725,7 +1720,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the maximum component. */ Cartesian3.maximumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z); }; @@ -1737,7 +1732,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the minimum component. */ Cartesian3.minimumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z); }; @@ -1751,9 +1746,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the minimum components. */ Cartesian3.minimumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -1771,9 +1766,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the maximum components. */ Cartesian3.maximumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -1788,7 +1783,7 @@ define('Core/Cartesian3',[ * @returns {Number} The squared magnitude. */ Cartesian3.magnitudeSquared = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z; }; @@ -1817,8 +1812,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distance(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(2.0, 0.0, 0.0)); */ Cartesian3.distance = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitude(distanceScratch); @@ -1837,8 +1832,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distanceSquared(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(3.0, 0.0, 0.0)); */ Cartesian3.distanceSquared = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitudeSquared(distanceScratch); @@ -1852,8 +1847,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.normalize = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian3.magnitude(cartesian); @@ -1876,8 +1871,8 @@ define('Core/Cartesian3',[ * @returns {Number} The dot product. */ Cartesian3.dot = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z; }; @@ -1891,9 +1886,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyComponents = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -1935,9 +1930,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.add = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -1954,9 +1949,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.subtract = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -1973,9 +1968,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -1992,9 +1987,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.divideByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -2010,8 +2005,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.negate = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -2027,8 +2022,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.abs = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -2047,10 +2042,10 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.lerp = function(start, end, t, result) { - Check.typeOf.object(start, 'start'); - Check.typeOf.object(end, 'end'); - Check.typeOf.number(t, 't'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian3.multiplyByScalar(end, t, lerpScratch); result = Cartesian3.multiplyByScalar(start, 1.0 - t, result); @@ -2067,8 +2062,8 @@ define('Core/Cartesian3',[ * @returns {Number} The angle between the Cartesians. */ Cartesian3.angleBetween = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.normalize(left, angleBetweenScratch); Cartesian3.normalize(right, angleBetweenScratch2); @@ -2086,8 +2081,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The most orthogonal axis. */ Cartesian3.mostOrthogonalAxis = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian3.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian3.abs(f, f); @@ -2164,9 +2159,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The cross product. */ Cartesian3.cross = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var leftX = left.x; var leftY = left.y; @@ -2199,8 +2194,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromDegrees(-115.0, 37.0); */ Cartesian3.fromDegrees = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); longitude = CesiumMath.toRadians(longitude); latitude = CesiumMath.toRadians(latitude); @@ -2225,8 +2220,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromRadians(-2.007, 0.645); */ Cartesian3.fromRadians = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); height = defaultValue(height, 0.0); var radiiSquared = defined(ellipsoid) ? ellipsoid.radiiSquared : wgs84RadiiSquared; @@ -2260,7 +2255,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArray([-115.0, 37.0, -107.0, 33.0]); */ Cartesian3.fromDegreesArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -2294,7 +2289,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArray([-2.007, 0.645, -1.867, .575]); */ Cartesian3.fromRadiansArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -2328,7 +2323,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArrayHeights([-115.0, 37.0, 100000.0, -107.0, 33.0, 150000.0]); */ Cartesian3.fromDegreesArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -2363,7 +2358,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArrayHeights([-2.007, 0.645, 100000.0, -1.867, .575, 150000.0]); */ Cartesian3.fromRadiansArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -3110,7 +3105,9 @@ define('Core/Ellipsoid',[ /** * Computes an Ellipsoid from a Cartesian specifying the radii in x, y, and z directions. * - * @param {Cartesian3} [radii=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Cartesian3} [cartesian=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new + * instance should be created. * @returns {Ellipsoid} A new Ellipsoid instance. * * @exception {DeveloperError} All radii components must be greater than or equal to zero. @@ -3750,6 +3747,7 @@ define('Core/Interval',[ /*global define*/ define('Core/Matrix3',[ './Cartesian3', + './Check', './defaultValue', './defined', './defineProperties', @@ -3758,6 +3756,7 @@ define('Core/Matrix3',[ './Math' ], function( Cartesian3, + Check, defaultValue, defined, defineProperties, @@ -3820,13 +3819,8 @@ define('Core/Matrix3',[ * @returns {Number[]} The array that was packed into */ Matrix3.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3852,9 +3846,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. */ Matrix3.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3881,24 +3873,24 @@ define('Core/Matrix3',[ * @param {Matrix3} [result] The object onto which to store the result. * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. (Returns undefined if matrix is undefined) */ - Matrix3.clone = function(values, result) { - if (!defined(values)) { + Matrix3.clone = function(matrix, result) { + if (!defined(matrix)) { return undefined; } if (!defined(result)) { - return new Matrix3(values[0], values[3], values[6], - values[1], values[4], values[7], - values[2], values[5], values[8]); + return new Matrix3(matrix[0], matrix[3], matrix[6], + matrix[1], matrix[4], matrix[7], + matrix[2], matrix[5], matrix[8]); } - result[0] = values[0]; - result[1] = values[1]; - result[2] = values[2]; - result[3] = values[3]; - result[4] = values[4]; - result[5] = values[5]; - result[6] = values[6]; - result[7] = values[7]; - result[8] = values[8]; + result[0] = matrix[0]; + result[1] = matrix[1]; + result[2] = matrix[2]; + result[3] = matrix[3]; + result[4] = matrix[4]; + result[5] = matrix[5]; + result[6] = matrix[6]; + result[7] = matrix[7]; + result[8] = matrix[8]; return result; }; @@ -3924,9 +3916,7 @@ define('Core/Matrix3',[ * var m2 = Cesium.Matrix3.fromArray(v2, 2); */ Matrix3.fromArray = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3954,9 +3944,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values parameter is required'); - } + Check.defined('values', values); return Matrix3.clone(values, result); }; @@ -3970,9 +3958,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix3(values[0], values[1], values[2], @@ -3999,9 +3985,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this quaternion. */ Matrix3.fromQuaternion = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); var x2 = quaternion.x * quaternion.x; var xy = quaternion.x * quaternion.y; @@ -4051,10 +4035,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this headingPitchRoll. */ Matrix3.fromHeadingPitchRoll = function(headingPitchRoll, result) { - if (!defined(headingPitchRoll)) { - throw new DeveloperError('headingPitchRoll is required'); - } - var cosTheta = Math.cos(-headingPitchRoll.pitch); + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + + var cosTheta = Math.cos(-headingPitchRoll.pitch); var cosPsi = Math.cos(-headingPitchRoll.heading); var cosPhi = Math.cos(headingPitchRoll.roll); var sinTheta = Math.sin(-headingPitchRoll.pitch); @@ -4105,9 +4088,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix3( @@ -4143,9 +4124,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromUniformScale(2.0); */ Matrix3.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix3( @@ -4169,7 +4148,7 @@ define('Core/Matrix3',[ /** * Computes a Matrix3 instance representing the cross product equivalent matrix of a Cartesian3 vector. * - * @param {Cartesian3} the vector on the left hand side of the cross product operation. + * @param {Cartesian3} vector the vector on the left hand side of the cross product operation. * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created. * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. * @@ -4181,9 +4160,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromCrossProduct(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromCrossProduct = function(vector, result) { - if (!defined(vector)) { - throw new DeveloperError('vector is required.'); - } + Check.typeOf.object('vector', vector); if (!defined(result)) { return new Matrix3( @@ -4218,9 +4195,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationX = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4259,9 +4234,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationY = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4300,9 +4273,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationZ = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4336,9 +4307,7 @@ define('Core/Matrix3',[ * @returns {Number[]} The modified Array parameter or a new Array instance if one was not provided. */ Matrix3.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5], matrix[6], matrix[7], matrix[8]]; @@ -4372,12 +4341,10 @@ define('Core/Matrix3',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix3.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 2) { - throw new DeveloperError('row must be 0, 1, or 2.'); - } - if (typeof column !== 'number' || column < 0 || column > 2) { - throw new DeveloperError('column must be 0, 1, or 2.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 2); + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 2); return column * 3 + row; }; @@ -4393,16 +4360,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var startIndex = index * 3; var x = matrix[startIndex]; @@ -4427,18 +4388,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); var startIndex = index * 3; @@ -4459,15 +4413,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 3]; @@ -4491,18 +4440,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); result[index] = cartesian.x; @@ -4521,12 +4463,8 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[3], matrix[4], matrix[5], scratchColumn)); @@ -4557,15 +4495,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var column0Row0 = left[0] * right[0] + left[3] * right[1] + left[6] * right[2]; var column0Row1 = left[1] * right[0] + left[4] * right[1] + left[7] * right[2]; @@ -4600,15 +4532,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -4631,15 +4557,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -4662,15 +4582,9 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -4695,15 +4609,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -4734,15 +4642,9 @@ define('Core/Matrix3',[ * @see Matrix3.multiplyByUniformScale */ Matrix3.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); result[0] = matrix[0] * scale.x; result[1] = matrix[1] * scale.x; @@ -4764,12 +4666,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -4791,12 +4689,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var column0Row0 = matrix[0]; var column0Row1 = matrix[3]; @@ -4936,9 +4830,7 @@ define('Core/Matrix3',[ * var c = Cesium.Cartesian3.multiplyByScalar(v, lambda, new Cesium.Cartesian3()); // equal to Cesium.Matrix3.multiplyByVector(a, v) */ Matrix3.computeEigenDecomposition = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); // This routine was created based upon Matrix Computations, 3rd ed., by Golub and Van Loan, // section 8.4.3 The Classical Jacobi Algorithm @@ -4982,12 +4874,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -5009,9 +4897,7 @@ define('Core/Matrix3',[ * @returns {Number} The value of the determinant of the matrix. */ Matrix3.determinant = function(matrix) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); var m11 = matrix[0]; var m21 = matrix[3]; @@ -5036,12 +4922,8 @@ define('Core/Matrix3',[ * @exception {DeveloperError} matrix is not invertible. */ Matrix3.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var m11 = matrix[0]; var m21 = matrix[1]; @@ -5107,9 +4989,7 @@ define('Core/Matrix3',[ * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. */ Matrix3.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -5297,12 +5177,14 @@ define('Core/Matrix3',[ /*global define*/ define('Core/Cartesian4',[ + './Check', './defaultValue', './defined', './DeveloperError', './freezeObject', './Math' ], function( + Check, defaultValue, defined, DeveloperError, @@ -5385,9 +5267,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.fromColor = function(color, result) { - if (!defined(color)) { - throw new DeveloperError('color is required'); - } + Check.typeOf.object('color', color); if (!defined(result)) { return new Cartesian4(color.red, color.green, color.blue, color.alpha); } @@ -5439,12 +5319,8 @@ define('Core/Cartesian4',[ * @returns {Number[]} The array that was packed into */ Cartesian4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5465,9 +5341,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5489,9 +5363,7 @@ define('Core/Cartesian4',[ * @returns {Number[]} The packed array. */ Cartesian4.packArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -5514,9 +5386,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4[]} The unpacked array. */ Cartesian4.unpackArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -5559,9 +5429,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the maximum component. */ Cartesian4.maximumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -5573,9 +5441,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the minimum component. */ Cartesian4.minimumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -5589,15 +5455,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the minimum components. */ Cartesian4.minimumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -5616,15 +5476,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the maximum components. */ Cartesian4.maximumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -5641,9 +5495,7 @@ define('Core/Cartesian4',[ * @returns {Number} The squared magnitude. */ Cartesian4.magnitudeSquared = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z + cartesian.w * cartesian.w; }; @@ -5674,9 +5526,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(2.0, 0.0, 0.0, 0.0)); */ Cartesian4.distance = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitude(distanceScratch); @@ -5697,9 +5548,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(3.0, 0.0, 0.0, 0.0)); */ Cartesian4.distanceSquared = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitudeSquared(distanceScratch); @@ -5713,12 +5563,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.normalize = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian4.magnitude(cartesian); @@ -5742,12 +5588,8 @@ define('Core/Cartesian4',[ * @returns {Number} The dot product. */ Cartesian4.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w; }; @@ -5761,15 +5603,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -5787,15 +5623,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x / right.x; result.y = left.y / right.y; @@ -5813,15 +5643,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -5839,15 +5663,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -5865,15 +5683,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -5891,15 +5703,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -5916,12 +5722,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.negate = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -5938,12 +5740,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.abs = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -5963,18 +5761,10 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian4.multiplyByScalar(end, t, lerpScratch); result = Cartesian4.multiplyByScalar(start, 1.0 - t, result); @@ -5990,12 +5780,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The most orthogonal axis. */ Cartesian4.mostOrthogonalAxis = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian4.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian4.abs(f, f); @@ -6240,6 +6026,7 @@ define('Core/RuntimeError',[ define('Core/Matrix4',[ './Cartesian3', './Cartesian4', + './Check', './defaultValue', './defined', './defineProperties', @@ -6251,6 +6038,7 @@ define('Core/Matrix4',[ ], function( Cartesian3, Cartesian4, + Check, defaultValue, defined, defineProperties, @@ -6341,13 +6129,8 @@ define('Core/Matrix4',[ * @returns {Number[]} The array that was packed into */ Matrix4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -6380,9 +6163,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if one was not provided. */ Matrix4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -6478,9 +6259,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required'); - } + Check.defined('values', values); return Matrix4.clone(values, result); }; @@ -6494,9 +6273,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix4(values[0], values[1], values[2], values[3], @@ -6533,9 +6310,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRotationTranslation = function(rotation, translation, result) { - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } + Check.typeOf.object('rotation', rotation); translation = defaultValue(translation, Cartesian3.ZERO); @@ -6583,15 +6358,9 @@ define('Core/Matrix4',[ * result); */ Matrix4.fromTranslationQuaternionRotationScale = function(translation, rotation, scale, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('translation', translation); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('scale', scale); if (!defined(result)) { result = new Matrix4(); @@ -6652,9 +6421,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromTranslationRotationScale = function(translationRotationScale, result) { - if (!defined(translationRotationScale)) { - throw new DeveloperError('translationRotationScale is required.'); - } + Check.typeOf.object('translationRotationScale', translationRotationScale); return Matrix4.fromTranslationQuaternionRotationScale(translationRotationScale.translation, translationRotationScale.rotation, translationRotationScale.scale, result); }; @@ -6669,9 +6436,7 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByTranslation */ Matrix4.fromTranslation = function(translation, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } + Check.typeOf.object('translation', translation); return Matrix4.fromRotationTranslation(Matrix3.IDENTITY, translation, result); }; @@ -6692,9 +6457,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix4.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix4( @@ -6739,9 +6502,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromUniformScale(2.0); */ Matrix4.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix4(scale, 0.0, 0.0, 0.0, @@ -6781,23 +6542,15 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromCamera = function(camera, result) { - if (!defined(camera)) { - throw new DeveloperError('camera is required.'); - } + Check.typeOf.object('camera', camera); var position = camera.position; var direction = camera.direction; var up = camera.up; - if (!defined(position)) { - throw new DeveloperError('camera.position is required.'); - } - if (!defined(direction)) { - throw new DeveloperError('camera.direction is required.'); - } - if (!defined(up)) { - throw new DeveloperError('camera.up is required.'); - } + Check.typeOf.object('camera.position', position); + Check.typeOf.object('camera.direction', direction); + Check.typeOf.object('camera.up', up); Cartesian3.normalize(direction, fromCameraF); Cartesian3.normalize(Cartesian3.cross(fromCameraF, up, fromCameraR), fromCameraR); @@ -6876,21 +6629,11 @@ define('Core/Matrix4',[ * @exception {DeveloperError} far must be greater than zero. */ Matrix4.computePerspectiveFieldOfView = function(fovY, aspectRatio, near, far, result) { - if (fovY <= 0.0 || fovY > Math.PI) { - throw new DeveloperError('fovY must be in (0, PI].'); - } - if (aspectRatio <= 0.0) { - throw new DeveloperError('aspectRatio must be greater than zero.'); - } - if (near <= 0.0) { - throw new DeveloperError('near must be greater than zero.'); - } - if (far <= 0.0) { - throw new DeveloperError('far must be greater than zero.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThan('fovY', fovY, 0.0); + Check.typeOf.number.lessThan('fovY', fovY, Math.PI); + Check.typeOf.number.greaterThan('near', near, 0.0); + Check.typeOf.number.greaterThan('far', far, 0.0); + Check.typeOf.object('result', result); var bottom = Math.tan(fovY * 0.5); @@ -6931,27 +6674,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeOrthographicOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var a = 1.0 / (right - left); var b = 1.0 / (top - bottom); @@ -6996,27 +6725,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computePerspectiveOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -7057,24 +6772,12 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeInfinitePerspectiveOffCenter = function(left, right, bottom, top, near, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -7122,9 +6825,7 @@ define('Core/Matrix4',[ * }, 0.0, 1.0, new Cesium.Matrix4()); */ Matrix4.computeViewportTransformation = function(viewport, nearDepthRange, farDepthRange, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); viewport = defaultValue(viewport, defaultValue.EMPTY_OBJECT); var x = defaultValue(viewport.x, 0.0); @@ -7176,21 +6877,11 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeView = function(position, direction, up, right, result) { - if (!defined(position)) { - throw new DeveloperError('position is required'); - } - if (!defined(direction)) { - throw new DeveloperError('direction is required'); - } - if (!defined(up)) { - throw new DeveloperError('up is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); + Check.typeOf.object('up', up); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = right.x; result[1] = up.x; @@ -7231,9 +6922,7 @@ define('Core/Matrix4',[ * //creates a = [10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0] */ Matrix4.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], @@ -7277,12 +6966,11 @@ define('Core/Matrix4',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix4.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 3) { - throw new DeveloperError('row must be 0, 1, 2, or 3.'); - } - if (typeof column !== 'number' || column < 0 || column > 3) { - throw new DeveloperError('column must be 0, 1, 2, or 3.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 3); + + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 3); return column * 4 + row; }; @@ -7315,16 +7003,12 @@ define('Core/Matrix4',[ * // a.x = 12.0; a.y = 16.0; a.z = 20.0; a.w = 24.0; */ Matrix4.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var startIndex = index * 4; var x = matrix[startIndex]; @@ -7366,18 +7050,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 96.0, 25.0] */ Matrix4.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); var startIndex = index * 4; @@ -7398,15 +7077,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.setTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -7459,16 +7132,12 @@ define('Core/Matrix4',[ * // a.x = 18.0; a.y = 19.0; a.z = 20.0; a.w = 21.0; */ Matrix4.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 4]; @@ -7509,18 +7178,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 24.0, 25.0] */ Matrix4.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); result[index] = cartesian.x; @@ -7540,12 +7204,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter */ Matrix4.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[4], matrix[5], matrix[6], scratchColumn)); @@ -7577,15 +7237,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -7669,15 +7323,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -7707,15 +7355,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -7756,15 +7398,9 @@ define('Core/Matrix4',[ * var m3 = Cesium.Matrix4.multiplyTransformation(m1, m2, new Cesium.Matrix4()); */ Matrix4.multiplyTransformation = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -7842,15 +7478,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByMatrix3(m, rotation, m); */ Matrix4.multiplyByMatrix3 = function(matrix, rotation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('result', result); var left0 = matrix[0]; var left1 = matrix[1]; @@ -7918,15 +7548,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByTranslation(m, position, m); */ Matrix4.multiplyByTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); var x = translation.x; var y = translation.y; @@ -7978,15 +7602,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByScale */ Matrix4.multiplyByUniformScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scale', scale); + Check.typeOf.object('result', result); uniformScaleScratch.x = scale; uniformScaleScratch.y = scale; @@ -8015,15 +7633,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByUniformScale */ Matrix4.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); var scaleX = scale.x; var scaleY = scale.y; @@ -8062,15 +7674,9 @@ define('Core/Matrix4',[ * @returns {Cartesian4} The modified result parameter. */ Matrix4.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8106,15 +7712,9 @@ define('Core/Matrix4',[ * // Cesium.Matrix4.multiplyByVector(matrix, new Cesium.Cartesian4(p.x, p.y, p.z, 0.0), result); */ Matrix4.multiplyByPointAsVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8144,16 +7744,9 @@ define('Core/Matrix4',[ * var result = Cesium.Matrix4.multiplyByPoint(matrix, p, new Cesium.Cartesian3()); */ Matrix4.multiplyByPoint = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8193,15 +7786,9 @@ define('Core/Matrix4',[ * // [-44.0, -46.0, -48.0, -50.0] */ Matrix4.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -8245,12 +7832,8 @@ define('Core/Matrix4',[ * // [-22.0, -23.0, -24.0, -25.0] */ Matrix4.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -8294,12 +7877,8 @@ define('Core/Matrix4',[ * // [13.0, 17.0, 21.0, 25.0] */ Matrix4.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var matrix1 = matrix[1]; var matrix2 = matrix[2]; @@ -8335,12 +7914,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -8454,9 +8029,7 @@ define('Core/Matrix4',[ * //Prints "Difference between both the matrices is not less than 0.1" on the console */ Matrix4.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -8487,12 +8060,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter. */ Matrix4.getTranslation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = matrix[12]; result.y = matrix[13]; @@ -8523,12 +8092,8 @@ define('Core/Matrix4',[ * // [12.0, 16.0, 20.0] */ Matrix4.getRotation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -8560,12 +8125,8 @@ define('Core/Matrix4',[ * @exception {RuntimeError} matrix is not invertible because its determinate is zero. */ Matrix4.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); // Special case for a zero scale matrix that can occur, for example, // when a model's node has a [0, 0, 0] scale. @@ -8703,12 +8264,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.inverseTransformation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); //This function is an optimized version of the below 4 lines. //var rT = Matrix3.transpose(Matrix4.getRotation(matrix)); @@ -8992,6 +8549,7 @@ define('Core/Matrix4',[ /*global define*/ define('Core/Rectangle',[ './Cartographic', + './Check', './defaultValue', './defined', './defineProperties', @@ -9001,6 +8559,7 @@ define('Core/Rectangle',[ './Math' ], function( Cartographic, + Check, defaultValue, defined, defineProperties, @@ -9097,13 +8656,8 @@ define('Core/Rectangle',[ * @returns {Number[]} The array that was packed into */ Rectangle.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -9124,9 +8678,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -9147,9 +8699,7 @@ define('Core/Rectangle',[ * @returns {Number} The width. */ Rectangle.computeWidth = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; if (east < west) { @@ -9164,9 +8714,7 @@ define('Core/Rectangle',[ * @returns {Number} The height. */ Rectangle.computeHeight = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); return rectangle.north - rectangle.south; }; @@ -9201,6 +8749,32 @@ define('Core/Rectangle',[ return result; }; + /** + * Creates an rectangle given the boundary longitude and latitude in radians. + * + * @param {Number} [west=0.0] The westernmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [south=0.0] The southernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Number} [east=0.0] The easternmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [north=0.0] The northernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Rectangle} [result] The object onto which to store the result, or undefined if a new instance should be created. + * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. + * + * @example + * var rectangle = Cesium.Rectangle.fromRadians(0.0, Math.PI/4, Math.PI/8, 3*Math.PI/4); + */ + Rectangle.fromRadians = function(west, south, east, north, result) { + if (!defined(result)) { + return new Rectangle(west, south, east, north); + } + + result.west = defaultValue(west, 0.0); + result.south = defaultValue(south, 0.0); + result.east = defaultValue(east, 0.0); + result.north = defaultValue(north, 0.0); + + return result; + }; + /** * Creates the smallest possible Rectangle that encloses all positions in the provided array. * @@ -9209,9 +8783,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartographicArray = function(cartographics, result) { - if (!defined(cartographics)) { - throw new DeveloperError('cartographics is required.'); - } + Check.defined('cartographics', cartographics); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -9264,9 +8836,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartesianArray = function(cartesians, ellipsoid, result) { - if (!defined(cartesians)) { - throw new DeveloperError('cartesians is required.'); - } + Check.defined('cartesians', cartesians); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -9382,9 +8952,7 @@ define('Core/Rectangle',[ * @returns {Boolean} <code>true</code> if the Rectangles are within the provided epsilon, <code>false</code> otherwise. */ Rectangle.prototype.equalsEpsilon = function(other, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon is required and must be a number.'); - } + Check.typeOf.number('epsilon', epsilon); return defined(other) && (Math.abs(this.west - other.west) <= epsilon) && @@ -9404,45 +8972,23 @@ define('Core/Rectangle',[ * @exception {DeveloperError} <code>west</code> must be in the interval [<code>-Pi</code>, <code>Pi</code>]. */ Rectangle.validate = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var north = rectangle.north; - if (typeof north !== 'number') { - throw new DeveloperError('north is required to be a number.'); - } - - if (north < -CesiumMath.PI_OVER_TWO || north > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('north must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('north', north, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('north', north, CesiumMath.PI_OVER_TWO); var south = rectangle.south; - if (typeof south !== 'number') { - throw new DeveloperError('south is required to be a number.'); - } - - if (south < -CesiumMath.PI_OVER_TWO || south > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('south must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('south', south, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('south', south, CesiumMath.PI_OVER_TWO); var west = rectangle.west; - if (typeof west !== 'number') { - throw new DeveloperError('west is required to be a number.'); - } - - if (west < -Math.PI || west > Math.PI) { - throw new DeveloperError('west must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('west', west, -Math.PI); + Check.typeOf.number.lessThanOrEquals('west', west, Math.PI); var east = rectangle.east; - if (typeof east !== 'number') { - throw new DeveloperError('east is required to be a number.'); - } - - if (east < -Math.PI || east > Math.PI) { - throw new DeveloperError('east must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('east', east, -Math.PI); + Check.typeOf.number.lessThanOrEquals('east', east, Math.PI); }; /** @@ -9453,9 +8999,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.south); @@ -9474,9 +9018,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.north); @@ -9495,9 +9037,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.north); @@ -9516,9 +9056,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.south); @@ -9537,9 +9075,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.center = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; @@ -9574,12 +9110,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.intersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var rectangleEast = rectangle.east; var rectangleWest = rectangle.west; @@ -9635,12 +9167,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.simpleIntersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var west = Math.max(rectangle.west, otherRectangle.west); var south = Math.max(rectangle.south, otherRectangle.south); @@ -9671,12 +9199,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.union = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); if (!defined(result)) { result = new Rectangle(); @@ -9720,12 +9244,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.expand = function(rectangle, cartographic, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); if (!defined(result)) { result = new Rectangle(); @@ -9747,12 +9267,8 @@ define('Core/Rectangle',[ * @returns {Boolean} true if the provided cartographic is inside the rectangle, false otherwise. */ Rectangle.contains = function(rectangle, cartographic) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); var longitude = cartographic.longitude; var latitude = cartographic.latitude; @@ -9785,9 +9301,7 @@ define('Core/Rectangle',[ * @returns {Cartesian3[]} The modified result parameter or a new Array of Cartesians instances if none was provided. */ Rectangle.subsample = function(rectangle, ellipsoid, surfaceHeight, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84); surfaceHeight = defaultValue(surfaceHeight, 0.0); @@ -9865,9 +9379,9 @@ define('Core/Rectangle',[ define('Core/BoundingSphere',[ './Cartesian3', './Cartographic', + './Check', './defaultValue', './defined', - './DeveloperError', './Ellipsoid', './GeographicProjection', './Intersect', @@ -9878,9 +9392,9 @@ define('Core/BoundingSphere',[ ], function( Cartesian3, Cartographic, + Check, defaultValue, defined, - DeveloperError, Ellipsoid, GeographicProjection, Intersect, @@ -10210,9 +9724,7 @@ define('Core/BoundingSphere',[ stride = defaultValue(stride, 3); - if (stride < 3) { - throw new DeveloperError('stride must be 3 or greater.'); - } + Check.typeOf.number.greaterThanOrEquals('stride', stride, 3); var currentPos = fromPointsCurrentPos; currentPos.x = positions[0] + center.x; @@ -10516,9 +10028,8 @@ define('Core/BoundingSphere',[ * var sphere = Cesium.BoundingSphere.fromCornerPoints(new Cesium.Cartesian3(-0.5, -0.5, -0.5), new Cesium.Cartesian3(0.5, 0.5, 0.5)); */ BoundingSphere.fromCornerPoints = function(corner, oppositeCorner, result) { - if (!defined(corner) || !defined(oppositeCorner)) { - throw new DeveloperError('corner and oppositeCorner are required.'); - } + Check.typeOf.object('corner', corner); + Check.typeOf.object('oppositeCorner', oppositeCorner); if (!defined(result)) { result = new BoundingSphere(); @@ -10542,9 +10053,7 @@ define('Core/BoundingSphere',[ * var boundingSphere = Cesium.BoundingSphere.fromEllipsoid(ellipsoid); */ BoundingSphere.fromEllipsoid = function(ellipsoid, result) { - if (!defined(ellipsoid)) { - throw new DeveloperError('ellipsoid is required.'); - } + Check.typeOf.object('ellipsoid', ellipsoid); if (!defined(result)) { result = new BoundingSphere(); @@ -10670,13 +10179,8 @@ define('Core/BoundingSphere',[ * @returns {Number[]} The array that was packed into */ BoundingSphere.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -10698,9 +10202,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if one was not provided. */ BoundingSphere.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -10727,13 +10229,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.union = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); if (!defined(result)) { result = new BoundingSphere(); @@ -10782,13 +10279,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.expand = function(sphere, point, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(point)) { - throw new DeveloperError('point is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('point', point); result = BoundingSphere.clone(sphere, result); @@ -10809,15 +10301,10 @@ define('Core/BoundingSphere',[ * the normal is pointing, {@link Intersect.OUTSIDE} if the entire sphere is * on the opposite side, and {@link Intersect.INTERSECTING} if the sphere * intersects the plane. - */ - BoundingSphere.intersectPlane = function(sphere, plane) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(plane)) { - throw new DeveloperError('plane is required.'); - } + */ + BoundingSphere.intersectPlane = function(sphere, plane) { + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('plane', plane); var center = sphere.center; var radius = sphere.radius; @@ -10843,13 +10330,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.transform = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -10877,12 +10359,8 @@ define('Core/BoundingSphere',[ * }); */ BoundingSphere.distanceSquaredTo = function(sphere, cartesian) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('cartesian', cartesian); var diff = Cartesian3.subtract(sphere.center, cartesian, distanceSquaredToScratch); return Cartesian3.magnitudeSquared(diff) - sphere.radius * sphere.radius; @@ -10904,13 +10382,8 @@ define('Core/BoundingSphere',[ * var newBoundingSphere = Cesium.BoundingSphere.transformWithoutScale(boundingSphere, modelMatrix); */ BoundingSphere.transformWithoutScale = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -10937,17 +10410,9 @@ define('Core/BoundingSphere',[ * @returns {Interval} The nearest and farthest distances on the bounding sphere from position in direction. */ BoundingSphere.computePlaneDistances = function(sphere, position, direction, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(position)) { - throw new DeveloperError('position is required.'); - } - - if (!defined(direction)) { - throw new DeveloperError('direction is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); if (!defined(result)) { result = new Interval(); @@ -10982,9 +10447,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.projectTo2D = function(sphere, projection, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } + Check.typeOf.object('sphere', sphere); projection = defaultValue(projection, projectTo2DProjection); @@ -11079,12 +10542,8 @@ define('Core/BoundingSphere',[ * @returns {Boolean} <code>true</code> if the sphere is not visible; otherwise <code>false</code>. */ BoundingSphere.isOccluded = function(sphere, occluder) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(occluder)) { - throw new DeveloperError('occluder is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('occluder', occluder); return !occluder.isBoundingSphereVisible(sphere); }; @@ -12293,7 +11752,10 @@ define('Core/WebGLConstants',[ COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : 0x9279, TEXTURE_IMMUTABLE_FORMAT : 0x912F, MAX_ELEMENT_INDEX : 0x8D6B, - TEXTURE_IMMUTABLE_LEVELS : 0x82DF + TEXTURE_IMMUTABLE_LEVELS : 0x82DF, + + // Extensions + MAX_TEXTURE_MAX_ANISOTROPY_EXT : 0x84FF }; return freezeObject(WebGLConstants); @@ -13002,6 +12464,7 @@ define('Core/EllipsoidGeodesic',[ * Provides the location of a point at the indicated portion along the geodesic. * * @param {Number} fraction The portion of the distance between the initial and final points. + * @param {Cartographic} result The object in which to store the result. * @returns {Cartographic} The location of the point along the geodesic. */ EllipsoidGeodesic.prototype.interpolateUsingFraction = function(fraction, result) { @@ -13012,6 +12475,7 @@ define('Core/EllipsoidGeodesic',[ * Provides the location of a point at the indicated distance along the geodesic. * * @param {Number} distance The distance from the inital point to the point of interest along the geodesic + * @param {Cartographic} result The object in which to store the result. * @returns {Cartographic} The location of the point along the geodesic. * * @exception {DeveloperError} start and end must be set before calling function interpolateUsingSurfaceDistance @@ -13862,6 +13326,7 @@ define('Core/IntersectionTests',[ './defaultValue', './defined', './DeveloperError', + './Interval', './Math', './Matrix3', './QuadraticRealPolynomial', @@ -13873,6 +13338,7 @@ define('Core/IntersectionTests',[ defaultValue, defined, DeveloperError, + Interval, CesiumMath, Matrix3, QuadraticRealPolynomial, @@ -14144,7 +13610,7 @@ define('Core/IntersectionTests',[ function raySphere(ray, sphere, result) { if (!defined(result)) { - result = {}; + result = new Interval(); } var origin = ray.origin; @@ -14175,8 +13641,8 @@ define('Core/IntersectionTests',[ * * @param {Ray} ray The ray. * @param {BoundingSphere} sphere The sphere. - * @param {Object} [result] The result onto which to store the result. - * @returns {Object} An object with the first (<code>start</code>) and the second (<code>stop</code>) intersection scalars for points along the ray or undefined if there are no intersections. + * @param {Interval} [result] The result onto which to store the result. + * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections. */ IntersectionTests.raySphere = function(ray, sphere, result) { if (!defined(ray)) { @@ -14204,8 +13670,8 @@ define('Core/IntersectionTests',[ * @param {Cartesian3} p0 An end point of the line segment. * @param {Cartesian3} p1 The other end point of the line segment. * @param {BoundingSphere} sphere The sphere. - * @param {Object} [result] The result onto which to store the result. - * @returns {Object} An object with the first (<code>start</code>) and the second (<code>stop</code>) intersection scalars for points along the line segment or undefined if there are no intersections. + * @param {Interval} [result] The result onto which to store the result. + * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections. */ IntersectionTests.lineSegmentSphere = function(p0, p1, sphere, result) { if (!defined(p0)) { @@ -14243,7 +13709,7 @@ define('Core/IntersectionTests',[ * * @param {Ray} ray The ray. * @param {Ellipsoid} ellipsoid The ellipsoid. - * @returns {Object} An object with the first (<code>start</code>) and the second (<code>stop</code>) intersection scalars for points along the ray or undefined if there are no intersections. + * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections. */ IntersectionTests.rayEllipsoid = function(ray, ellipsoid) { if (!defined(ray)) { @@ -14285,10 +13751,7 @@ define('Core/IntersectionTests',[ var root0 = temp / w2; var root1 = difference / temp; if (root0 < root1) { - return { - start : root0, - stop : root1 - }; + return new Interval(root0, root1); } return { @@ -14298,10 +13761,7 @@ define('Core/IntersectionTests',[ } else { // qw2 == product. Repeated roots (2 intersections). var root = Math.sqrt(difference / w2); - return { - start : root, - stop : root - }; + return new Interval(root, root); } } else if (q2 < 1.0) { // Inside ellipsoid (2 intersections). @@ -14311,19 +13771,13 @@ define('Core/IntersectionTests',[ discriminant = qw * qw - product; temp = -qw + Math.sqrt(discriminant); // Positively valued. - return { - start : 0.0, - stop : temp / w2 - }; + return new Interval(0.0, temp / w2); } else { // q2 == 1.0. On ellipsoid. if (qw < 0.0) { // Looking inward. w2 = Cartesian3.magnitudeSquared(w); - return { - start : 0.0, - stop : -qw / w2 - }; + return new Interval(0.0, -qw / w2); } // qw >= 0.0. Looking outward or tangent. @@ -14758,6 +14212,30 @@ define('Core/IntersectionTests',[ return IntersectionTests; }); +/*global define*/ +define('Core/isArray',[ + './defined' + ], function( + defined) { + 'use strict'; + + /** + * Tests an object to see if it is an array. + * @exports isArray + * + * @param {Object} value The value to test. + * @returns {Boolean} true if the value is an array, false otherwise. + */ + var isArray = Array.isArray; + if (!defined(isArray)) { + isArray = function(value) { + return Object.prototype.toString.call(value) === '[object Array]'; + }; + } + + return isArray; +}); + /*global define*/ define('Core/Plane',[ './Cartesian3', @@ -15131,10 +14609,10 @@ define('Core/PolylinePipeline',[ /** * Subdivides polyline and raises all points to the specified height. Returns an array of numbers to represent the positions. - * @param {Cartesian3[]} positions The array of type {Cartesian3} representing positions. - * @param {Number|Number[]} [height=0.0] A number or array of numbers representing the heights of each position. - * @param {Number} [granularity = CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. - * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie. + * @param {Cartesian3[]} options.positions The array of type {Cartesian3} representing positions. + * @param {Number|Number[]} [options.height=0.0] A number or array of numbers representing the heights of each position. + * @param {Number} [options.granularity = CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. + * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie. * @returns {Number[]} A new array of positions of type {Number} that have been subdivided and raised to the surface of the ellipsoid. * * @example @@ -15216,10 +14694,10 @@ define('Core/PolylinePipeline',[ /** * Subdivides polyline and raises all points to the specified height. Returns an array of new {Cartesian3} positions. - * @param {Cartesian3[]} positions The array of type {Cartesian3} representing positions. - * @param {Number|Number[]} [height=0.0] A number or array of numbers representing the heights of each position. - * @param {Number} [granularity = CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. - * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie. + * @param {Cartesian3[]} options.positions The array of type {Cartesian3} representing positions. + * @param {Number|Number[]} [options.height=0.0] A number or array of numbers representing the heights of each position. + * @param {Number} [options.granularity = CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. + * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie. * @returns {Cartesian3[]} A new array of cartesian3 positions that have been subdivided and raised to the surface of the ellipsoid. * * @example @@ -15248,12 +14726,14 @@ define('Core/PolylinePipeline',[ /*global define*/ define('Core/Cartesian2',[ + './Check', './defaultValue', './defined', './DeveloperError', './freezeObject', './Math' ], function( + Check, defaultValue, defined, DeveloperError, @@ -15365,12 +14845,8 @@ define('Core/Cartesian2',[ * @returns {Number[]} The array that was packed into */ Cartesian2.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -15389,9 +14865,7 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided. */ Cartesian2.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -15411,9 +14885,7 @@ define('Core/Cartesian2',[ * @returns {Number[]} The packed array. */ Cartesian2.packArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -15436,9 +14908,7 @@ define('Core/Cartesian2',[ * @returns {Cartesian2[]} The unpacked array. */ Cartesian2.unpackArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -15481,9 +14951,7 @@ define('Core/Cartesian2',[ * @returns {Number} The value of the maximum component. */ Cartesian2.maximumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y); }; @@ -15495,9 +14963,7 @@ define('Core/Cartesian2',[ * @returns {Number} The value of the minimum component. */ Cartesian2.minimumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y); }; @@ -15511,15 +14977,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} A cartesian with the minimum components. */ Cartesian2.minimumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); @@ -15537,15 +14997,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} A cartesian with the maximum components. */ Cartesian2.maximumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -15559,9 +15013,7 @@ define('Core/Cartesian2',[ * @returns {Number} The squared magnitude. */ Cartesian2.magnitudeSquared = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y; }; @@ -15627,12 +15079,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.normalize = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian2.magnitude(cartesian); @@ -15654,12 +15102,8 @@ define('Core/Cartesian2',[ * @returns {Number} The dot product. */ Cartesian2.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y; }; @@ -15673,15 +15117,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.multiplyComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -15697,15 +15135,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.divideComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x / right.x; result.y = left.y / right.y; @@ -15721,15 +15153,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -15745,15 +15171,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -15769,15 +15189,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.multiplyByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -15793,15 +15207,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.divideByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -15816,12 +15224,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.negate = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -15836,12 +15240,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.abs = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -15859,18 +15259,10 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian2.multiplyByScalar(end, t, lerpScratch); result = Cartesian2.multiplyByScalar(start, 1.0 - t, result); @@ -15887,12 +15279,8 @@ define('Core/Cartesian2',[ * @returns {Number} The angle between the Cartesians. */ Cartesian2.angleBetween = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian2.normalize(left, angleBetweenScratch); Cartesian2.normalize(right, angleBetweenScratch2); @@ -15908,12 +15296,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The most orthogonal axis. */ Cartesian2.mostOrthogonalAxis = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian2.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian2.abs(f, f); @@ -16988,152 +16372,40 @@ define('ThirdParty/when',[],function () { // If we reached the end of the array without finding any real // elements, it's a TypeError - if(++i >= len) { - throw new TypeError(); - } - } - } else { - // If initialValue provided, use it - reduced = args[1]; - } - - // Do the actual reduce - for(;i < len; ++i) { - // Skip holes - if(i in arr) { - reduced = reduceFunc(reduced, arr[i], i, arr); - } - } - - return reduced; - }; - - function identity(x) { - return x; - } - - return when; -}); -})(typeof define == 'function' && define.amd - ? define - : function (factory) { typeof exports === 'object' - ? (module.exports = factory()) - : (this.when = factory()); - } - // Boilerplate for AMD, Node, and browser global -); - -/*global define*/ -define('Core/oneTimeWarning',[ - './defaultValue', - './defined', - './DeveloperError' - ], function( - defaultValue, - defined, - DeveloperError) { - "use strict"; - - var warnings = {}; - - /** - * Logs a one time message to the console. Use this function instead of - * <code>console.log</code> directly since this does not log duplicate messages - * unless it is called from multiple workers. - * - * @exports oneTimeWarning - * - * @param {String} identifier The unique identifier for this warning. - * @param {String} [message=identifier] The message to log to the console. - * - * @example - * for(var i=0;i<foo.length;++i) { - * if (!defined(foo[i].bar)) { - * // Something that can be recovered from but may happen a lot - * oneTimeWarning('foo.bar undefined', 'foo.bar is undefined. Setting to 0.'); - * foo[i].bar = 0; - * // ... - * } - * } - * - * @private - */ - function oneTimeWarning(identifier, message) { - if (!defined(identifier)) { - throw new DeveloperError('identifier is required.'); - } - - if (!defined(warnings[identifier])) { - warnings[identifier] = true; - console.log(defaultValue(message, identifier)); - } - } + if(++i >= len) { + throw new TypeError(); + } + } + } else { + // If initialValue provided, use it + reduced = args[1]; + } - oneTimeWarning.geometryOutlines = 'Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.'; + // Do the actual reduce + for(;i < len; ++i) { + // Skip holes + if(i in arr) { + reduced = reduceFunc(reduced, arr[i], i, arr); + } + } - return oneTimeWarning; -}); + return reduced; + }; -/*global define*/ -define('Core/deprecationWarning',[ - './defined', - './DeveloperError', - './oneTimeWarning' - ], function( - defined, - DeveloperError, - oneTimeWarning) { - 'use strict'; - - /** - * Logs a deprecation message to the console. Use this function instead of - * <code>console.log</code> directly since this does not log duplicate messages - * unless it is called from multiple workers. - * - * @exports deprecationWarning - * - * @param {String} identifier The unique identifier for this deprecated API. - * @param {String} message The message to log to the console. - * - * @example - * // Deprecated function or class - * function Foo() { - * deprecationWarning('Foo', 'Foo was deprecated in Cesium 1.01. It will be removed in 1.03. Use newFoo instead.'); - * // ... - * } - * - * // Deprecated function - * Bar.prototype.func = function() { - * deprecationWarning('Bar.func', 'Bar.func() was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newFunc() instead.'); - * // ... - * }; - * - * // Deprecated property - * defineProperties(Bar.prototype, { - * prop : { - * get : function() { - * deprecationWarning('Bar.prop', 'Bar.prop was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newProp instead.'); - * // ... - * }, - * set : function(value) { - * deprecationWarning('Bar.prop', 'Bar.prop was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newProp instead.'); - * // ... - * } - * } - * }); - * - * @private - */ - function deprecationWarning(identifier, message) { - if (!defined(identifier) || !defined(message)) { - throw new DeveloperError('identifier and message are required.'); - } - - oneTimeWarning(identifier, message); - } + function identity(x) { + return x; + } - return deprecationWarning; + return when; }); +})(typeof define == 'function' && define.amd + ? define + : function (factory) { typeof exports === 'object' + ? (module.exports = factory()) + : (this.when = factory()); + } + // Boilerplate for AMD, Node, and browser global +); /*global define*/ define('Core/binarySearch',[ @@ -20844,6 +20116,7 @@ define('Core/Iau2006XysData',[ /*global define*/ define('Core/Quaternion',[ './Cartesian3', + './Check', './defaultValue', './defined', './DeveloperError', @@ -20853,6 +20126,7 @@ define('Core/Quaternion',[ './Matrix3' ], function( Cartesian3, + Check, defaultValue, defined, DeveloperError, @@ -20915,12 +20189,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided. */ Quaternion.fromAxisAngle = function(axis, angle, result) { - if (!defined(axis)) { - throw new DeveloperError('axis is required.'); - } - if (typeof angle !== 'number') { - throw new DeveloperError('angle is required and must be a number.'); - } + Check.typeOf.object('axis', axis); + Check.typeOf.number('angle', angle); var halfAngle = angle / 2.0; var s = Math.sin(halfAngle); @@ -20952,9 +20222,7 @@ define('Core/Quaternion',[ * @see Matrix3.fromQuaternion */ Quaternion.fromRotationMatrix = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); var root; var x; @@ -21028,15 +20296,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter or a new Quaternion instance if none was provided. */ Quaternion.fromHeadingPitchRoll = function(heading, pitch, roll, result) { - if (!defined(heading)) { - throw new DeveloperError('heading is required.'); - } - if (!defined(pitch)) { - throw new DeveloperError('pitch is required.'); - } - if (!defined(roll)) { - throw new DeveloperError('roll is required.'); - } + Check.typeOf.number('heading', heading); + Check.typeOf.number('pitch', pitch); + Check.typeOf.number('roll', roll); var rollQuaternion = Quaternion.fromAxisAngle(Cartesian3.UNIT_X, roll, scratchHPRQuaternion); var pitchQuaternion = Quaternion.fromAxisAngle(Cartesian3.UNIT_Y, -pitch, result); @@ -21067,13 +20329,8 @@ define('Core/Quaternion',[ * @returns {Number[]} The array that was packed into */ Quaternion.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -21094,9 +20351,7 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided. */ Quaternion.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -21151,7 +20406,7 @@ define('Core/Quaternion',[ * * @param {Number[]} array The array previously packed for interpolation. * @param {Number[]} sourceArray The original packed array. - * @param {Number} [startingIndex=0] The startingIndex used to convert the array. + * @param {Number} [firstIndex=0] The firstIndex used to convert the array. * @param {Number} [lastIndex=packedArray.length] The lastIndex used to convert the array. * @param {Quaternion} [result] The object into which to store the result. * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided. @@ -21205,12 +20460,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.conjugate = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); result.x = -quaternion.x; result.y = -quaternion.y; @@ -21226,9 +20477,7 @@ define('Core/Quaternion',[ * @returns {Number} The magnitude squared. */ Quaternion.magnitudeSquared = function(quaternion) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); return quaternion.x * quaternion.x + quaternion.y * quaternion.y + quaternion.z * quaternion.z + quaternion.w * quaternion.w; }; @@ -21251,9 +20500,7 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.normalize = function(quaternion, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); var inverseMagnitude = 1.0 / Quaternion.magnitude(quaternion); var x = quaternion.x * inverseMagnitude; @@ -21276,9 +20523,7 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.inverse = function(quaternion, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); var magnitudeSquared = Quaternion.magnitudeSquared(quaternion); result = Quaternion.conjugate(quaternion, result); @@ -21294,15 +20539,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -21320,15 +20559,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -21345,12 +20578,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.negate = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); result.x = -quaternion.x; result.y = -quaternion.y; @@ -21367,12 +20596,8 @@ define('Core/Quaternion',[ * @returns {Number} The dot product. */ Quaternion.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w; }; @@ -21386,15 +20611,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var leftX = left.x; var leftY = left.y; @@ -21427,15 +20646,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.multiplyByScalar = function(quaternion, scalar, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = quaternion.x * scalar; result.y = quaternion.y * scalar; @@ -21453,15 +20666,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.divideByScalar = function(quaternion, scalar, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = quaternion.x / scalar; result.y = quaternion.y / scalar; @@ -21478,12 +20685,8 @@ define('Core/Quaternion',[ * @returns {Cartesian3} The modified result parameter. */ Quaternion.computeAxis = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); var w = quaternion.w; if (Math.abs(w - 1.0) < CesiumMath.EPSILON6) { @@ -21506,9 +20709,7 @@ define('Core/Quaternion',[ * @returns {Number} The angle of rotation. */ Quaternion.computeAngle = function(quaternion) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); if (Math.abs(quaternion.w - 1.0) < CesiumMath.EPSILON6) { return 0.0; @@ -21527,18 +20728,10 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); lerpScratch = Quaternion.multiplyByScalar(end, t, lerpScratch); result = Quaternion.multiplyByScalar(start, 1.0 - t, result); @@ -21560,18 +20753,10 @@ define('Core/Quaternion',[ * @see Quaternion#fastSlerp */ Quaternion.slerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var dot = Quaternion.dot(start, end); @@ -21604,12 +20789,8 @@ define('Core/Quaternion',[ * @returns {Cartesian3} The modified result parameter. */ Quaternion.log = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); var theta = CesiumMath.acosClamped(quaternion.w); var thetaOverSinTheta = 0.0; @@ -21629,12 +20810,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.exp = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var theta = Cartesian3.magnitude(cartesian); var sinThetaOverTheta = 0.0; @@ -21669,12 +20846,10 @@ define('Core/Quaternion',[ * @see Quaternion#squad */ Quaternion.computeInnerQuadrangle = function(q0, q1, q2, result) { - if (!defined(q0) || !defined(q1) || !defined(q2)) { - throw new DeveloperError('q0, q1, and q2 are required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('q0', q0); + Check.typeOf.object('q1', q1); + Check.typeOf.object('q2', q2); + Check.typeOf.object('result', result); var qInv = Quaternion.conjugate(q1, squadScratchQuaternion0); Quaternion.multiply(qInv, q2, squadScratchQuaternion1); @@ -21716,15 +20891,12 @@ define('Core/Quaternion',[ * @see Quaternion#computeInnerQuadrangle */ Quaternion.squad = function(q0, q1, s0, s1, t, result) { - if (!defined(q0) || !defined(q1) || !defined(s0) || !defined(s1)) { - throw new DeveloperError('q0, q1, s0, and s1 are required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('q0', q0); + Check.typeOf.object('q1', q1); + Check.typeOf.object('s0', s0); + Check.typeOf.object('s1', s1); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var slerp0 = Quaternion.slerp(q0, q1, t, squadScratchQuaternion0); var slerp1 = Quaternion.slerp(s0, s1, t, squadScratchQuaternion1); @@ -21761,18 +20933,10 @@ define('Core/Quaternion',[ * @see Quaternion#slerp */ Quaternion.fastSlerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var x = Quaternion.dot(start, end); @@ -21821,15 +20985,12 @@ define('Core/Quaternion',[ * @see Quaternion#squad */ Quaternion.fastSquad = function(q0, q1, s0, s1, t, result) { - if (!defined(q0) || !defined(q1) || !defined(s0) || !defined(s1)) { - throw new DeveloperError('q0, q1, s0, and s1 are required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('q0', q0); + Check.typeOf.object('q1', q1); + Check.typeOf.object('s0', s0); + Check.typeOf.object('s1', s1); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var slerp0 = Quaternion.fastSlerp(q0, q1, t, squadScratchQuaternion0); var slerp1 = Quaternion.fastSlerp(s0, s1, t, squadScratchQuaternion1); @@ -21865,9 +21026,7 @@ define('Core/Quaternion',[ * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. */ Quaternion.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon is required and must be a number.'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || ((defined(left)) && @@ -21947,9 +21106,9 @@ define('Core/Transforms',[ './Cartesian3', './Cartesian4', './Cartographic', + './Check', './defaultValue', './defined', - './deprecationWarning', './DeveloperError', './EarthOrientationParameters', './EarthOrientationParametersSample', @@ -21969,9 +21128,9 @@ define('Core/Transforms',[ Cartesian3, Cartesian4, Cartographic, + Check, defaultValue, defined, - deprecationWarning, DeveloperError, EarthOrientationParameters, EarthOrientationParametersSample, @@ -22407,19 +21566,12 @@ define('Core/Transforms',[ * var hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll); * var transform = Cesium.Transforms.headingPitchRollToFixedFrame(center, hpr); */ - Transforms.headingPitchRollToFixedFrame = function(origin, headingPitchRoll, pitch, roll, ellipsoid, result) { - var heading; - if (typeof headingPitchRoll === 'object') { - // Shift arguments using assignments to encourage JIT optimization. - ellipsoid = pitch; - result = roll; - heading = headingPitchRoll.heading; - pitch = headingPitchRoll.pitch; - roll = headingPitchRoll.roll; - } else { - deprecationWarning('headingPitchRollToFixedFrame', 'headingPitchRollToFixedFrame with separate heading, pitch, and roll arguments was deprecated in 1.27. It will be removed in 1.30. Use a HeadingPitchRoll object.'); - heading = headingPitchRoll; - } + Transforms.headingPitchRollToFixedFrame = function(origin, headingPitchRoll, ellipsoid, result) { + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + var heading = headingPitchRoll.heading; + var pitch = headingPitchRoll.pitch; + var roll = headingPitchRoll.roll; + // checks for required parameters happen in the called functions var hprQuaternion = Quaternion.fromHeadingPitchRoll(heading, pitch, roll, scratchHPRQuaternion); var hprMatrix = Matrix4.fromTranslationQuaternionRotationScale(Cartesian3.ZERO, hprQuaternion, scratchScale, scratchHPRMatrix4); @@ -22427,7 +21579,6 @@ define('Core/Transforms',[ return Matrix4.multiply(result, hprMatrix, result); }; - var scratchHPR = new HeadingPitchRoll(); var scratchENUMatrix4 = new Matrix4(); var scratchHPRMatrix3 = new Matrix3(); @@ -22452,22 +21603,10 @@ define('Core/Transforms',[ * var hpr = new HeadingPitchRoll(heading, pitch, roll); * var quaternion = Cesium.Transforms.headingPitchRollQuaternion(center, hpr); */ - Transforms.headingPitchRollQuaternion = function(origin, headingPitchRoll, pitch, roll, ellipsoid, result) { - var hpr; - if (typeof headingPitchRoll === 'object') { - // Shift arguments using assignment to encourage JIT optimization. - hpr = headingPitchRoll; - ellipsoid = pitch; - result = roll; - } else { - deprecationWarning('headingPitchRollQuaternion', 'headingPitchRollQuaternion with separate heading, pitch, and roll arguments was deprecated in 1.27. It will be removed in 1.30. Use a HeadingPitchRoll object.'); - scratchHPR.heading = headingPitchRoll; - scratchHPR.pitch = pitch; - scratchHPR.roll = roll; - hpr = scratchHPR; - } + Transforms.headingPitchRollQuaternion = function(origin, headingPitchRoll, ellipsoid, result) { // checks for required parameters happen in the called functions - var transform = Transforms.headingPitchRollToFixedFrame(origin, hpr, ellipsoid, scratchENUMatrix4); + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + var transform = Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, scratchENUMatrix4); var rotation = Matrix4.getRotation(transform, scratchHPRMatrix3); return Quaternion.fromRotationMatrix(rotation, result); }; @@ -22943,6 +22082,46 @@ define('Core/Transforms',[ return result; }; + var swizzleMatrix = new Matrix4( + 0.0, 0.0, 1.0, 0.0, + 1.0, 0.0, 0.0, 0.0, + 0.0, 1.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + + /** + * @private + */ + Transforms.wgs84To2DModelMatrix = function(projection, center, result) { + if (!defined(projection)) { + throw new DeveloperError('projection is required.'); + } + if (!defined(center)) { + throw new DeveloperError('center is required.'); + } + if (!defined(result)) { + throw new DeveloperError('result is required.'); + } + + var ellipsoid = projection.ellipsoid; + + var fromENU = Transforms.eastNorthUpToFixedFrame(center, ellipsoid, scratchFromENU); + var toENU = Matrix4.inverseTransformation(fromENU, scratchToENU); + + var cartographic = ellipsoid.cartesianToCartographic(center, scratchCartographic); + var projectedPosition = projection.project(cartographic, scratchCartesian3Projection); + var newOrigin = scratchCartesian4NewOrigin; + newOrigin.x = projectedPosition.z; + newOrigin.y = projectedPosition.x; + newOrigin.z = projectedPosition.y; + newOrigin.w = 1.0; + + var translation = Matrix4.fromTranslation(newOrigin, scratchFromENU); + Matrix4.multiply(swizzleMatrix, toENU, result); + Matrix4.multiply(translation, result, result); + + return result; + }; + return Transforms; }); @@ -24213,7 +23392,7 @@ define('Core/Geometry',[ * <li><code>position</code> - 3D vertex position. 64-bit floating-point (for precision). 3 components per attribute. See {@link VertexFormat#position}.</li> * <li><code>normal</code> - Normal (normalized), commonly used for lighting. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#normal}.</li> * <li><code>st</code> - 2D texture coordinate. 32-bit floating-point. 2 components per attribute. See {@link VertexFormat#st}.</li> - * <li><code>binormal</code> - Binormal (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#binormal}.</li> + * <li><code>bitangent</code> - Bitangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#bitangent}.</li> * <li><code>tangent</code> - Tangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#tangent}.</li> * </ul> * </p> @@ -24242,7 +23421,7 @@ define('Core/Geometry',[ * componentsPerAttribute : 3, * values : new Float32Array(0) * }); - * + * * @see GeometryAttribute * @see VertexFormat */ @@ -24523,7 +23702,7 @@ define('Core/GeometryAttributes',[ this.st = options.st; /** - * The binormal attribute (normalized), which is used for tangent-space effects like bump mapping. + * The bitangent attribute (normalized), which is used for tangent-space effects like bump mapping. * <p> * 32-bit floating-point. 3 components per attribute. * </p> @@ -24532,7 +23711,7 @@ define('Core/GeometryAttributes',[ * * @default undefined */ - this.binormal = options.binormal; + this.bitangent = options.bitangent; /** * The tangent attribute (normalized), which is used for tangent-space effects like bump mapping. @@ -25761,7 +24940,7 @@ define('Core/VertexFormat',[ this.st = defaultValue(options.st, false); /** - * When <code>true</code>, the vertex has a binormal attribute (normalized), which is used for tangent-space effects like bump mapping. + * When <code>true</code>, the vertex has a bitangent attribute (normalized), which is used for tangent-space effects like bump mapping. * <p> * 32-bit floating-point. 3 components per attribute. * </p> @@ -25770,7 +24949,7 @@ define('Core/VertexFormat',[ * * @default false */ - this.binormal = defaultValue(options.binormal, false); + this.bitangent = defaultValue(options.bitangent, false); /** * When <code>true</code>, the vertex has a tangent attribute (normalized), which is used for tangent-space effects like bump mapping. @@ -25872,7 +25051,7 @@ define('Core/VertexFormat',[ })); /** - * An immutable vertex format with well-known attributes: position, normal, st, binormal, and tangent. + * An immutable vertex format with well-known attributes: position, normal, st, tangent, and bitangent. * * @type {VertexFormat} * @constant @@ -25880,15 +25059,15 @@ define('Core/VertexFormat',[ * @see VertexFormat#position * @see VertexFormat#normal * @see VertexFormat#st - * @see VertexFormat#binormal * @see VertexFormat#tangent + * @see VertexFormat#bitangent */ VertexFormat.ALL = freezeObject(new VertexFormat({ position : true, normal : true, st : true, - binormal : true, - tangent : true + tangent : true, + bitangent : true })); /** @@ -25933,8 +25112,8 @@ define('Core/VertexFormat',[ array[startingIndex++] = value.position ? 1.0 : 0.0; array[startingIndex++] = value.normal ? 1.0 : 0.0; array[startingIndex++] = value.st ? 1.0 : 0.0; - array[startingIndex++] = value.binormal ? 1.0 : 0.0; array[startingIndex++] = value.tangent ? 1.0 : 0.0; + array[startingIndex++] = value.bitangent ? 1.0 : 0.0; array[startingIndex++] = value.color ? 1.0 : 0.0; return array; @@ -25959,19 +25138,19 @@ define('Core/VertexFormat',[ result = new VertexFormat(); } - result.position = array[startingIndex++] === 1.0; - result.normal = array[startingIndex++] === 1.0; - result.st = array[startingIndex++] === 1.0; - result.binormal = array[startingIndex++] === 1.0; - result.tangent = array[startingIndex++] === 1.0; - result.color = array[startingIndex++] === 1.0; + result.position = array[startingIndex++] === 1.0; + result.normal = array[startingIndex++] === 1.0; + result.st = array[startingIndex++] === 1.0; + result.tangent = array[startingIndex++] === 1.0; + result.bitangent = array[startingIndex++] === 1.0; + result.color = array[startingIndex++] === 1.0; return result; }; /** * Duplicates a VertexFormat instance. * - * @param {VertexFormat} cartesian The vertex format to duplicate. + * @param {VertexFormat} vertexFormat The vertex format to duplicate. * @param {VertexFormat} [result] The object onto which to store the result. * @returns {VertexFormat} The modified result parameter or a new VertexFormat instance if one was not provided. (Returns undefined if vertexFormat is undefined) */ @@ -25986,8 +25165,8 @@ define('Core/VertexFormat',[ result.position = vertexFormat.position; result.normal = vertexFormat.normal; result.st = vertexFormat.st; - result.binormal = vertexFormat.binormal; result.tangent = vertexFormat.tangent; + result.bitangent = vertexFormat.bitangent; result.color = vertexFormat.color; return result; }; @@ -26055,17 +25234,17 @@ define('Core/CorridorGeometry',[ function addNormals(attr, normal, left, front, back, vertexFormat) { var normals = attr.normals; var tangents = attr.tangents; - var binormals = attr.binormals; + var bitangents = attr.bitangents; var forward = Cartesian3.normalize(Cartesian3.cross(left, normal, scratch1), scratch1); if (vertexFormat.normal) { CorridorGeometryLibrary.addAttribute(normals, normal, front, back); } - if (vertexFormat.binormal) { - CorridorGeometryLibrary.addAttribute(binormals, left, front, back); - } if (vertexFormat.tangent) { CorridorGeometryLibrary.addAttribute(tangents, forward, front, back); } + if (vertexFormat.bitangent) { + CorridorGeometryLibrary.addAttribute(bitangents, left, front, back); + } } function combine(computedPositions, vertexFormat, ellipsoid) { @@ -26116,11 +25295,11 @@ define('Core/CorridorGeometry',[ var finalPositions = new Float64Array(size); var normals = (vertexFormat.normal) ? new Float32Array(size) : undefined; var tangents = (vertexFormat.tangent) ? new Float32Array(size) : undefined; - var binormals = (vertexFormat.binormal) ? new Float32Array(size) : undefined; + var bitangents = (vertexFormat.bitangent) ? new Float32Array(size) : undefined; var attr = { normals : normals, tangents : tangents, - binormals : binormals + bitangents : bitangents }; var front = 0; var back = size - 1; @@ -26405,11 +25584,11 @@ define('Core/CorridorGeometry',[ }); } - if (vertexFormat.binormal) { - attributes.binormal = new GeometryAttribute({ + if (vertexFormat.bitangent) { + attributes.bitangent = new GeometryAttribute({ componentDatatype : ComponentDatatype.FLOAT, componentsPerAttribute : 3, - values : attr.binormals + values : attr.bitangents }); } @@ -26420,31 +25599,31 @@ define('Core/CorridorGeometry',[ } function extrudedAttributes(attributes, vertexFormat) { - if (!vertexFormat.normal && !vertexFormat.binormal && !vertexFormat.tangent && !vertexFormat.st) { + if (!vertexFormat.normal && !vertexFormat.tangent && !vertexFormat.bitangent && !vertexFormat.st) { return attributes; } var positions = attributes.position.values; var topNormals; - var topBinormals; - if (vertexFormat.normal || vertexFormat.binormal) { + var topBitangents; + if (vertexFormat.normal || vertexFormat.bitangent) { topNormals = attributes.normal.values; - topBinormals = attributes.binormal.values; + topBitangents = attributes.bitangent.values; } var size = attributes.position.values.length / 18; var threeSize = size * 3; var twoSize = size * 2; var sixSize = threeSize * 2; var i; - if (vertexFormat.normal || vertexFormat.binormal || vertexFormat.tangent) { + if (vertexFormat.normal || vertexFormat.bitangent || vertexFormat.tangent) { var normals = (vertexFormat.normal) ? new Float32Array(threeSize * 6) : undefined; - var binormals = (vertexFormat.binormal) ? new Float32Array(threeSize * 6) : undefined; var tangents = (vertexFormat.tangent) ? new Float32Array(threeSize * 6) : undefined; + var bitangents = (vertexFormat.bitangent) ? new Float32Array(threeSize * 6) : undefined; var topPosition = cartesian1; var bottomPosition = cartesian2; var previousPosition = cartesian3; var normal = cartesian4; var tangent = cartesian5; - var binormal = cartesian6; + var bitangent = cartesian6; var attrIndex = sixSize; for (i = 0; i < threeSize; i += 3) { var attrIndexOffset = attrIndex + sixSize; @@ -26460,17 +25639,17 @@ define('Core/CorridorGeometry',[ CorridorGeometryLibrary.addAttribute(normals, normal, attrIndex); CorridorGeometryLibrary.addAttribute(normals, normal, attrIndex + 3); } - if (vertexFormat.tangent || vertexFormat.binormal) { - binormal = Cartesian3.fromArray(topNormals, i, binormal); - if (vertexFormat.binormal) { - CorridorGeometryLibrary.addAttribute(binormals, binormal, attrIndexOffset); - CorridorGeometryLibrary.addAttribute(binormals, binormal, attrIndexOffset + 3); - CorridorGeometryLibrary.addAttribute(binormals, binormal, attrIndex); - CorridorGeometryLibrary.addAttribute(binormals, binormal, attrIndex + 3); + if (vertexFormat.tangent || vertexFormat.bitangent) { + bitangent = Cartesian3.fromArray(topNormals, i, bitangent); + if (vertexFormat.bitangent) { + CorridorGeometryLibrary.addAttribute(bitangents, bitangent, attrIndexOffset); + CorridorGeometryLibrary.addAttribute(bitangents, bitangent, attrIndexOffset + 3); + CorridorGeometryLibrary.addAttribute(bitangents, bitangent, attrIndex); + CorridorGeometryLibrary.addAttribute(bitangents, bitangent, attrIndex + 3); } if (vertexFormat.tangent) { - tangent = Cartesian3.normalize(Cartesian3.cross(binormal, normal, tangent), tangent); + tangent = Cartesian3.normalize(Cartesian3.cross(bitangent, normal, tangent), tangent); CorridorGeometryLibrary.addAttribute(tangents, tangent, attrIndexOffset); CorridorGeometryLibrary.addAttribute(tangents, tangent, attrIndexOffset + 3); CorridorGeometryLibrary.addAttribute(tangents, tangent, attrIndex); @@ -26492,12 +25671,12 @@ define('Core/CorridorGeometry',[ attributes.normal = undefined; } - if (vertexFormat.binormal) { - binormals.set(topBinormals); //top - binormals.set(topBinormals, threeSize); //bottom - attributes.binormal.values = binormals; + if (vertexFormat.bitangent) { + bitangents.set(topBitangents); //top + bitangents.set(topBitangents, threeSize); //bottom + attributes.bitangent.values = bitangents; } else { - attributes.binormal = undefined; + attributes.bitangent = undefined; } if (vertexFormat.tangent) { @@ -26558,10 +25737,10 @@ define('Core/CorridorGeometry',[ function computePositionsExtruded(params, vertexFormat) { var topVertexFormat = new VertexFormat({ - position : vertexFormat.positon, - normal : (vertexFormat.normal || vertexFormat.binormal), + position : vertexFormat.position, + normal : (vertexFormat.normal || vertexFormat.bitangent || params.shadowVolume), tangent : vertexFormat.tangent, - binormal : (vertexFormat.normal || vertexFormat.binormal), + bitangent : (vertexFormat.normal || vertexFormat.bitangent), st : vertexFormat.st }); var ellipsoid = params.ellipsoid; @@ -26587,28 +25766,49 @@ define('Core/CorridorGeometry',[ newPositions.set(wallPositions, length * 2); attributes.position.values = newPositions; - length /= 3; + attributes = extrudedAttributes(attributes, vertexFormat); + var size = length / 3; + if (params.shadowVolume) { + var topNormals = attributes.normal.values; + length = topNormals.length; + + var extrudeNormals = new Float32Array(length * 6); + for (i = 0; i < length; i ++) { + topNormals[i] = -topNormals[i]; + } + //only get normals for bottom layer that's going to be pushed down + extrudeNormals.set(topNormals, length); //bottom face + extrudeNormals = addWallPositions(topNormals, length*4, extrudeNormals); //bottom wall + attributes.extrudeDirection = new GeometryAttribute({ + componentDatatype : ComponentDatatype.FLOAT, + componentsPerAttribute : 3, + values : extrudeNormals + }); + if (!vertexFormat.normal) { + attributes.normal = undefined; + } + } + var i; var iLength = indices.length; - var twoLength = length + length; - var newIndices = IndexDatatype.createTypedArray(newPositions.length / 3, iLength * 2 + twoLength * 3); + var twoSize = size + size; + var newIndices = IndexDatatype.createTypedArray(newPositions.length / 3, iLength * 2 + twoSize * 3); newIndices.set(indices); var index = iLength; for (i = 0; i < iLength; i += 3) { // bottom indices var v0 = indices[i]; var v1 = indices[i + 1]; var v2 = indices[i + 2]; - newIndices[index++] = v2 + length; - newIndices[index++] = v1 + length; - newIndices[index++] = v0 + length; + newIndices[index++] = v2 + size; + newIndices[index++] = v1 + size; + newIndices[index++] = v0 + size; } - attributes = extrudedAttributes(attributes, vertexFormat); var UL, LL, UR, LR; - for (i = 0; i < twoLength; i += 2) { //wall indices - UL = i + twoLength; - LL = UL + twoLength; + for (i = 0; i < twoSize; i += 2) { //wall indices + UL = i + twoSize; + LL = UL + twoSize; UR = UL + 1; LR = LL + 1; newIndices[index++] = UL; @@ -26788,6 +25988,7 @@ define('Core/CorridorGeometry',[ this._extrudedHeight = defaultValue(options.extrudedHeight, this._height); this._cornerType = defaultValue(options.cornerType, CornerType.ROUNDED); this._granularity = defaultValue(options.granularity, CesiumMath.RADIANS_PER_DEGREE); + this._shadowVolume = defaultValue(options.shadowVolume, false); this._workerName = 'createCorridorGeometry'; this._rectangle = computeRectangle(positions, this._ellipsoid, width, this._cornerType); @@ -26795,7 +25996,7 @@ define('Core/CorridorGeometry',[ * The number of elements used to pack the object into an array. * @type {Number} */ - this.packedLength = 1 + positions.length * Cartesian3.packedLength + Ellipsoid.packedLength + VertexFormat.packedLength + Rectangle.packedLength + 5; + this.packedLength = 1 + positions.length * Cartesian3.packedLength + Ellipsoid.packedLength + VertexFormat.packedLength + Rectangle.packedLength + 6; } /** @@ -26838,7 +26039,8 @@ define('Core/CorridorGeometry',[ array[startingIndex++] = value._height; array[startingIndex++] = value._extrudedHeight; array[startingIndex++] = value._cornerType; - array[startingIndex] = value._granularity; + array[startingIndex++] = value._granularity; + array[startingIndex] = value._shadowVolume ? 1.0 : 0.0; return array; }; @@ -26854,7 +26056,8 @@ define('Core/CorridorGeometry',[ height : undefined, extrudedHeight : undefined, cornerType : undefined, - granularity : undefined + granularity : undefined, + shadowVolume: undefined }; /** @@ -26892,7 +26095,8 @@ define('Core/CorridorGeometry',[ var height = array[startingIndex++]; var extrudedHeight = array[startingIndex++]; var cornerType = array[startingIndex++]; - var granularity = array[startingIndex]; + var granularity = array[startingIndex++]; + var shadowVolume = array[startingIndex] === 1.0; if (!defined(result)) { scratchOptions.positions = positions; @@ -26901,6 +26105,7 @@ define('Core/CorridorGeometry',[ scratchOptions.extrudedHeight = extrudedHeight; scratchOptions.cornerType = cornerType; scratchOptions.granularity = granularity; + scratchOptions.shadowVolume = shadowVolume; return new CorridorGeometry(scratchOptions); } @@ -26913,6 +26118,7 @@ define('Core/CorridorGeometry',[ result._cornerType = cornerType; result._granularity = granularity; result._rectangle = Rectangle.clone(rectangle); + result._shadowVolume = shadowVolume; return result; }; @@ -26953,6 +26159,7 @@ define('Core/CorridorGeometry',[ height = h; params.height = height; params.extrudedHeight = extrudedHeight; + params.shadowVolume = corridorGeometry._shadowVolume; attr = computePositionsExtruded(params, vertexFormat); } else { var computedPositions = CorridorGeometryLibrary.computePositions(params); @@ -26991,7 +26198,8 @@ define('Core/CorridorGeometry',[ granularity : granularity, extrudedHeight : minHeight, height : maxHeight, - vertexFormat : VertexFormat.POSITION_ONLY + vertexFormat : VertexFormat.POSITION_ONLY, + shadowVolume: true }); }; diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createCorridorOutlineGeometry.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createCorridorOutlineGeometry.js index 913d18a7..0a486945 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createCorridorOutlineGeometry.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createCorridorOutlineGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -872,7 +872,7 @@ define('Core/Math',[ if (!defined(angle)) { throw new DeveloperError('angle is required.'); } - + return CesiumMath.clamp(angle, -1*CesiumMath.PI_OVER_TWO, CesiumMath.PI_OVER_TWO); }; @@ -882,11 +882,11 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [<code>-CesiumMath.PI</code>, <code>CesiumMath.PI</code>]. */ - CesiumMath.negativePiToPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.negativePiToPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - return CesiumMath.zeroToTwoPi(x + CesiumMath.PI) - CesiumMath.PI; + return CesiumMath.zeroToTwoPi(angle + CesiumMath.PI) - CesiumMath.PI; }; /** @@ -895,12 +895,12 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [0, <code>CesiumMath.TWO_PI</code>]. */ - CesiumMath.zeroToTwoPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.zeroToTwoPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - var mod = CesiumMath.mod(x, CesiumMath.TWO_PI); - if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(x) > CesiumMath.EPSILON14) { + var mod = CesiumMath.mod(angle, CesiumMath.TWO_PI); + if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(angle) > CesiumMath.EPSILON14) { return CesiumMath.TWO_PI; } return mod; @@ -970,7 +970,7 @@ define('Core/Math',[ * @example * //Compute 7!, which is equal to 5040 * var computedFactorial = Cesium.Math.factorial(7); - * + * * @see {@link http://en.wikipedia.org/wiki/Factorial|Factorial on Wikipedia} */ CesiumMath.factorial = function(n) { @@ -1293,41 +1293,13 @@ define('Core/arrayRemoveDuplicates',[ return arrayRemoveDuplicates; }); -/*global define*/ -define('Core/isArray',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Tests an object to see if it is an array. - * @exports isArray - * - * @param {Object} value The value to test. - * @returns {Boolean} true if the value is an array, false otherwise. - */ - var isArray = Array.isArray; - if (!defined(isArray)) { - isArray = function(value) { - return Object.prototype.toString.call(value) === '[object Array]'; - }; - } - - return isArray; -}); - /*global define*/ define('Core/Check',[ - './defaultValue', - './defined', - './DeveloperError', - './isArray' + './defined', + './DeveloperError' ], function( - defaultValue, defined, - DeveloperError, - isArray) { + DeveloperError) { 'use strict'; /** @@ -1342,111 +1314,134 @@ define('Core/Check',[ */ Check.typeOf = {}; - /** - * Contains functions for checking numeric conditions such as minimum and maximum values - */ - Check.numeric = {}; - function getUndefinedErrorMessage(name) { - return name + ' was required but undefined.'; + return name + ' is required, actual value was undefined'; } function getFailedTypeErrorMessage(actual, expected, name) { - return 'Expected ' + name + ' to be typeof ' + expected + ', got ' + actual; + return 'Expected ' + name + ' to be typeof ' + expected + ', actual typeof was ' + actual; } /** * Throws if test is not defined * - * @param {*} test The value that is to be checked * @param {String} name The name of the variable being tested + * @param {*} test The value that is to be checked * @exception {DeveloperError} test must be defined */ - Check.defined = function (test, name) { + Check.defined = function (name, test) { if (!defined(test)) { throw new DeveloperError(getUndefinedErrorMessage(name)); } }; /** - * Throws if test is greater than maximum + * Throws if test is not typeof 'function' * - * @param {Number} test The value to test - * @param {Number} maximum The maximum allowed value - * @exception {DeveloperError} test must not be greater than maximum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'function' */ - Check.numeric.maximum = function (test, maximum) { - Check.typeOf.number(test); - Check.typeOf.number(maximum); - if (test > maximum) { - throw new DeveloperError('Expected ' + test + ' to be at most ' + maximum); + Check.typeOf.func = function (name, test) { + if (typeof test !== 'function') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); } }; /** - * Throws if test is less than minimum + * Throws if test is not typeof 'string' * - * @param {Number} test The value to test - * @param {Number} minimum The minimum allowed value - * @exception {DeveloperError} test must not be less than mininum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'string' */ - Check.numeric.minimum = function (test, minimum) { - Check.typeOf.number(test); - Check.typeOf.number(minimum); - if (test < minimum) { - throw new DeveloperError('Expected ' + test + ' to be at least ' + minimum); + Check.typeOf.string = function (name, test) { + if (typeof test !== 'string') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); } }; /** - * Throws if test is not typeof 'function' + * Throws if test is not typeof 'number' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'function' + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'number' */ - Check.typeOf.function = function (test, name) { - if (typeof test !== 'function') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); + Check.typeOf.number = function (name, test) { + if (typeof test !== 'number') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); } }; /** - * Throws if test is not typeof 'string' + * Throws if test is not typeof 'number' and less than limit * + * @param {String} name The name of the variable being tested * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than limit + */ + Check.typeOf.number.lessThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test >= limit) { + throw new DeveloperError('Expected ' + name + ' to be less than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and less than or equal to limit + * * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'string' + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than or equal to limit */ - Check.typeOf.string = function (test, name) { - if (typeof test !== 'string') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); + Check.typeOf.number.lessThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test > limit) { + throw new DeveloperError('Expected ' + name + ' to be less than or equal to ' + limit + ', actual value was ' + test); } }; /** - * Throws if test is not typeof 'number' + * Throws if test is not typeof 'number' and greater than limit * + * @param {String} name The name of the variable being tested * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than limit + */ + Check.typeOf.number.greaterThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test <= limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and greater than or equal to limit + * * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'number' + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than or equal to limit */ - Check.typeOf.number = function (test, name) { - if (typeof test !== 'number') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); + Check.typeOf.number.greaterThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test < limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than or equal to' + limit + ', actual value was ' + test); } }; /** * Throws if test is not typeof 'object' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested + * @param {*} test The value to test * @exception {DeveloperError} test must be typeof 'object' */ - Check.typeOf.object = function (test, name) { + Check.typeOf.object = function (name, test) { if (typeof test !== 'object') { throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'object', name)); } @@ -1455,11 +1450,11 @@ define('Core/Check',[ /** * Throws if test is not typeof 'boolean' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested + * @param {*} test The value to test * @exception {DeveloperError} test must be typeof 'boolean' */ - Check.typeOf.boolean = function (test, name) { + Check.typeOf.bool = function (name, test) { if (typeof test !== 'boolean') { throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'boolean', name)); } @@ -1529,7 +1524,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.fromSpherical = function(spherical, result) { - Check.typeOf.object(spherical, 'spherical'); + Check.typeOf.object('spherical', spherical); if (!defined(result)) { result = new Cartesian3(); @@ -1613,8 +1608,8 @@ define('Core/Cartesian3',[ * @returns {Number[]} The array that was packed into */ Cartesian3.pack = function(value, array, startingIndex) { - Check.typeOf.object(value, 'value'); - Check.defined(array, 'array'); + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1634,7 +1629,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.unpack = function(array, startingIndex, result) { - Check.defined(array, 'array'); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1655,7 +1650,7 @@ define('Core/Cartesian3',[ * @returns {Number[]} The packed array. */ Cartesian3.packArray = function(array, result) { - Check.defined(array, 'array'); + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -1678,8 +1673,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3[]} The unpacked array. */ Cartesian3.unpackArray = function(array, result) { - Check.defined(array, 'array'); - Check.numeric.minimum(array.length, 3); + Check.defined('array', array); + Check.typeOf.number.greaterThanOrEquals('array.length', array.length, 3); if (array.length % 3 !== 0) { throw new DeveloperError('array length must be a multiple of 3.'); } @@ -1725,7 +1720,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the maximum component. */ Cartesian3.maximumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z); }; @@ -1737,7 +1732,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the minimum component. */ Cartesian3.minimumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z); }; @@ -1751,9 +1746,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the minimum components. */ Cartesian3.minimumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -1771,9 +1766,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the maximum components. */ Cartesian3.maximumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -1788,7 +1783,7 @@ define('Core/Cartesian3',[ * @returns {Number} The squared magnitude. */ Cartesian3.magnitudeSquared = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z; }; @@ -1817,8 +1812,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distance(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(2.0, 0.0, 0.0)); */ Cartesian3.distance = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitude(distanceScratch); @@ -1837,8 +1832,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distanceSquared(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(3.0, 0.0, 0.0)); */ Cartesian3.distanceSquared = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitudeSquared(distanceScratch); @@ -1852,8 +1847,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.normalize = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian3.magnitude(cartesian); @@ -1876,8 +1871,8 @@ define('Core/Cartesian3',[ * @returns {Number} The dot product. */ Cartesian3.dot = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z; }; @@ -1891,9 +1886,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyComponents = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -1935,9 +1930,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.add = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -1954,9 +1949,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.subtract = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -1973,9 +1968,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -1992,9 +1987,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.divideByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -2010,8 +2005,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.negate = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -2027,8 +2022,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.abs = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -2047,10 +2042,10 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.lerp = function(start, end, t, result) { - Check.typeOf.object(start, 'start'); - Check.typeOf.object(end, 'end'); - Check.typeOf.number(t, 't'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian3.multiplyByScalar(end, t, lerpScratch); result = Cartesian3.multiplyByScalar(start, 1.0 - t, result); @@ -2067,8 +2062,8 @@ define('Core/Cartesian3',[ * @returns {Number} The angle between the Cartesians. */ Cartesian3.angleBetween = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.normalize(left, angleBetweenScratch); Cartesian3.normalize(right, angleBetweenScratch2); @@ -2086,8 +2081,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The most orthogonal axis. */ Cartesian3.mostOrthogonalAxis = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian3.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian3.abs(f, f); @@ -2164,9 +2159,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The cross product. */ Cartesian3.cross = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var leftX = left.x; var leftY = left.y; @@ -2199,8 +2194,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromDegrees(-115.0, 37.0); */ Cartesian3.fromDegrees = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); longitude = CesiumMath.toRadians(longitude); latitude = CesiumMath.toRadians(latitude); @@ -2225,8 +2220,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromRadians(-2.007, 0.645); */ Cartesian3.fromRadians = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); height = defaultValue(height, 0.0); var radiiSquared = defined(ellipsoid) ? ellipsoid.radiiSquared : wgs84RadiiSquared; @@ -2260,7 +2255,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArray([-115.0, 37.0, -107.0, 33.0]); */ Cartesian3.fromDegreesArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -2294,7 +2289,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArray([-2.007, 0.645, -1.867, .575]); */ Cartesian3.fromRadiansArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -2328,7 +2323,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArrayHeights([-115.0, 37.0, 100000.0, -107.0, 33.0, 150000.0]); */ Cartesian3.fromDegreesArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -2363,7 +2358,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArrayHeights([-2.007, 0.645, 100000.0, -1.867, .575, 150000.0]); */ Cartesian3.fromRadiansArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -3110,7 +3105,9 @@ define('Core/Ellipsoid',[ /** * Computes an Ellipsoid from a Cartesian specifying the radii in x, y, and z directions. * - * @param {Cartesian3} [radii=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Cartesian3} [cartesian=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new + * instance should be created. * @returns {Ellipsoid} A new Ellipsoid instance. * * @exception {DeveloperError} All radii components must be greater than or equal to zero. @@ -3750,6 +3747,7 @@ define('Core/Interval',[ /*global define*/ define('Core/Matrix3',[ './Cartesian3', + './Check', './defaultValue', './defined', './defineProperties', @@ -3758,6 +3756,7 @@ define('Core/Matrix3',[ './Math' ], function( Cartesian3, + Check, defaultValue, defined, defineProperties, @@ -3820,13 +3819,8 @@ define('Core/Matrix3',[ * @returns {Number[]} The array that was packed into */ Matrix3.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3852,9 +3846,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. */ Matrix3.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3881,24 +3873,24 @@ define('Core/Matrix3',[ * @param {Matrix3} [result] The object onto which to store the result. * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. (Returns undefined if matrix is undefined) */ - Matrix3.clone = function(values, result) { - if (!defined(values)) { + Matrix3.clone = function(matrix, result) { + if (!defined(matrix)) { return undefined; } if (!defined(result)) { - return new Matrix3(values[0], values[3], values[6], - values[1], values[4], values[7], - values[2], values[5], values[8]); + return new Matrix3(matrix[0], matrix[3], matrix[6], + matrix[1], matrix[4], matrix[7], + matrix[2], matrix[5], matrix[8]); } - result[0] = values[0]; - result[1] = values[1]; - result[2] = values[2]; - result[3] = values[3]; - result[4] = values[4]; - result[5] = values[5]; - result[6] = values[6]; - result[7] = values[7]; - result[8] = values[8]; + result[0] = matrix[0]; + result[1] = matrix[1]; + result[2] = matrix[2]; + result[3] = matrix[3]; + result[4] = matrix[4]; + result[5] = matrix[5]; + result[6] = matrix[6]; + result[7] = matrix[7]; + result[8] = matrix[8]; return result; }; @@ -3924,9 +3916,7 @@ define('Core/Matrix3',[ * var m2 = Cesium.Matrix3.fromArray(v2, 2); */ Matrix3.fromArray = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3954,9 +3944,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values parameter is required'); - } + Check.defined('values', values); return Matrix3.clone(values, result); }; @@ -3970,9 +3958,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix3(values[0], values[1], values[2], @@ -3999,9 +3985,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this quaternion. */ Matrix3.fromQuaternion = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); var x2 = quaternion.x * quaternion.x; var xy = quaternion.x * quaternion.y; @@ -4051,10 +4035,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this headingPitchRoll. */ Matrix3.fromHeadingPitchRoll = function(headingPitchRoll, result) { - if (!defined(headingPitchRoll)) { - throw new DeveloperError('headingPitchRoll is required'); - } - var cosTheta = Math.cos(-headingPitchRoll.pitch); + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + + var cosTheta = Math.cos(-headingPitchRoll.pitch); var cosPsi = Math.cos(-headingPitchRoll.heading); var cosPhi = Math.cos(headingPitchRoll.roll); var sinTheta = Math.sin(-headingPitchRoll.pitch); @@ -4105,9 +4088,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix3( @@ -4143,9 +4124,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromUniformScale(2.0); */ Matrix3.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix3( @@ -4169,7 +4148,7 @@ define('Core/Matrix3',[ /** * Computes a Matrix3 instance representing the cross product equivalent matrix of a Cartesian3 vector. * - * @param {Cartesian3} the vector on the left hand side of the cross product operation. + * @param {Cartesian3} vector the vector on the left hand side of the cross product operation. * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created. * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. * @@ -4181,9 +4160,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromCrossProduct(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromCrossProduct = function(vector, result) { - if (!defined(vector)) { - throw new DeveloperError('vector is required.'); - } + Check.typeOf.object('vector', vector); if (!defined(result)) { return new Matrix3( @@ -4218,9 +4195,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationX = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4259,9 +4234,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationY = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4300,9 +4273,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationZ = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4336,9 +4307,7 @@ define('Core/Matrix3',[ * @returns {Number[]} The modified Array parameter or a new Array instance if one was not provided. */ Matrix3.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5], matrix[6], matrix[7], matrix[8]]; @@ -4372,12 +4341,10 @@ define('Core/Matrix3',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix3.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 2) { - throw new DeveloperError('row must be 0, 1, or 2.'); - } - if (typeof column !== 'number' || column < 0 || column > 2) { - throw new DeveloperError('column must be 0, 1, or 2.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 2); + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 2); return column * 3 + row; }; @@ -4393,16 +4360,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var startIndex = index * 3; var x = matrix[startIndex]; @@ -4427,18 +4388,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); var startIndex = index * 3; @@ -4459,15 +4413,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 3]; @@ -4491,18 +4440,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); result[index] = cartesian.x; @@ -4521,12 +4463,8 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[3], matrix[4], matrix[5], scratchColumn)); @@ -4557,15 +4495,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var column0Row0 = left[0] * right[0] + left[3] * right[1] + left[6] * right[2]; var column0Row1 = left[1] * right[0] + left[4] * right[1] + left[7] * right[2]; @@ -4600,15 +4532,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -4631,15 +4557,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -4662,15 +4582,9 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -4695,15 +4609,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -4734,15 +4642,9 @@ define('Core/Matrix3',[ * @see Matrix3.multiplyByUniformScale */ Matrix3.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); result[0] = matrix[0] * scale.x; result[1] = matrix[1] * scale.x; @@ -4764,12 +4666,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -4791,12 +4689,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var column0Row0 = matrix[0]; var column0Row1 = matrix[3]; @@ -4936,9 +4830,7 @@ define('Core/Matrix3',[ * var c = Cesium.Cartesian3.multiplyByScalar(v, lambda, new Cesium.Cartesian3()); // equal to Cesium.Matrix3.multiplyByVector(a, v) */ Matrix3.computeEigenDecomposition = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); // This routine was created based upon Matrix Computations, 3rd ed., by Golub and Van Loan, // section 8.4.3 The Classical Jacobi Algorithm @@ -4982,12 +4874,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -5009,9 +4897,7 @@ define('Core/Matrix3',[ * @returns {Number} The value of the determinant of the matrix. */ Matrix3.determinant = function(matrix) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); var m11 = matrix[0]; var m21 = matrix[3]; @@ -5036,12 +4922,8 @@ define('Core/Matrix3',[ * @exception {DeveloperError} matrix is not invertible. */ Matrix3.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var m11 = matrix[0]; var m21 = matrix[1]; @@ -5107,9 +4989,7 @@ define('Core/Matrix3',[ * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. */ Matrix3.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -5297,12 +5177,14 @@ define('Core/Matrix3',[ /*global define*/ define('Core/Cartesian4',[ + './Check', './defaultValue', './defined', './DeveloperError', './freezeObject', './Math' ], function( + Check, defaultValue, defined, DeveloperError, @@ -5385,9 +5267,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.fromColor = function(color, result) { - if (!defined(color)) { - throw new DeveloperError('color is required'); - } + Check.typeOf.object('color', color); if (!defined(result)) { return new Cartesian4(color.red, color.green, color.blue, color.alpha); } @@ -5439,12 +5319,8 @@ define('Core/Cartesian4',[ * @returns {Number[]} The array that was packed into */ Cartesian4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5465,9 +5341,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5489,9 +5363,7 @@ define('Core/Cartesian4',[ * @returns {Number[]} The packed array. */ Cartesian4.packArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -5514,9 +5386,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4[]} The unpacked array. */ Cartesian4.unpackArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -5559,9 +5429,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the maximum component. */ Cartesian4.maximumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -5573,9 +5441,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the minimum component. */ Cartesian4.minimumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -5589,15 +5455,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the minimum components. */ Cartesian4.minimumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -5616,15 +5476,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the maximum components. */ Cartesian4.maximumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -5641,9 +5495,7 @@ define('Core/Cartesian4',[ * @returns {Number} The squared magnitude. */ Cartesian4.magnitudeSquared = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z + cartesian.w * cartesian.w; }; @@ -5674,9 +5526,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(2.0, 0.0, 0.0, 0.0)); */ Cartesian4.distance = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitude(distanceScratch); @@ -5697,9 +5548,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(3.0, 0.0, 0.0, 0.0)); */ Cartesian4.distanceSquared = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitudeSquared(distanceScratch); @@ -5713,12 +5563,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.normalize = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian4.magnitude(cartesian); @@ -5742,12 +5588,8 @@ define('Core/Cartesian4',[ * @returns {Number} The dot product. */ Cartesian4.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w; }; @@ -5761,15 +5603,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -5787,15 +5623,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x / right.x; result.y = left.y / right.y; @@ -5813,15 +5643,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -5839,15 +5663,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -5865,15 +5683,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -5891,15 +5703,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -5916,12 +5722,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.negate = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -5938,12 +5740,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.abs = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -5963,18 +5761,10 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian4.multiplyByScalar(end, t, lerpScratch); result = Cartesian4.multiplyByScalar(start, 1.0 - t, result); @@ -5990,12 +5780,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The most orthogonal axis. */ Cartesian4.mostOrthogonalAxis = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian4.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian4.abs(f, f); @@ -6240,6 +6026,7 @@ define('Core/RuntimeError',[ define('Core/Matrix4',[ './Cartesian3', './Cartesian4', + './Check', './defaultValue', './defined', './defineProperties', @@ -6251,6 +6038,7 @@ define('Core/Matrix4',[ ], function( Cartesian3, Cartesian4, + Check, defaultValue, defined, defineProperties, @@ -6341,13 +6129,8 @@ define('Core/Matrix4',[ * @returns {Number[]} The array that was packed into */ Matrix4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -6380,9 +6163,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if one was not provided. */ Matrix4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -6478,9 +6259,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required'); - } + Check.defined('values', values); return Matrix4.clone(values, result); }; @@ -6494,9 +6273,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix4(values[0], values[1], values[2], values[3], @@ -6533,9 +6310,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRotationTranslation = function(rotation, translation, result) { - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } + Check.typeOf.object('rotation', rotation); translation = defaultValue(translation, Cartesian3.ZERO); @@ -6583,15 +6358,9 @@ define('Core/Matrix4',[ * result); */ Matrix4.fromTranslationQuaternionRotationScale = function(translation, rotation, scale, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('translation', translation); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('scale', scale); if (!defined(result)) { result = new Matrix4(); @@ -6652,9 +6421,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromTranslationRotationScale = function(translationRotationScale, result) { - if (!defined(translationRotationScale)) { - throw new DeveloperError('translationRotationScale is required.'); - } + Check.typeOf.object('translationRotationScale', translationRotationScale); return Matrix4.fromTranslationQuaternionRotationScale(translationRotationScale.translation, translationRotationScale.rotation, translationRotationScale.scale, result); }; @@ -6669,9 +6436,7 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByTranslation */ Matrix4.fromTranslation = function(translation, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } + Check.typeOf.object('translation', translation); return Matrix4.fromRotationTranslation(Matrix3.IDENTITY, translation, result); }; @@ -6692,9 +6457,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix4.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix4( @@ -6739,9 +6502,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromUniformScale(2.0); */ Matrix4.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix4(scale, 0.0, 0.0, 0.0, @@ -6781,23 +6542,15 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromCamera = function(camera, result) { - if (!defined(camera)) { - throw new DeveloperError('camera is required.'); - } + Check.typeOf.object('camera', camera); var position = camera.position; var direction = camera.direction; var up = camera.up; - if (!defined(position)) { - throw new DeveloperError('camera.position is required.'); - } - if (!defined(direction)) { - throw new DeveloperError('camera.direction is required.'); - } - if (!defined(up)) { - throw new DeveloperError('camera.up is required.'); - } + Check.typeOf.object('camera.position', position); + Check.typeOf.object('camera.direction', direction); + Check.typeOf.object('camera.up', up); Cartesian3.normalize(direction, fromCameraF); Cartesian3.normalize(Cartesian3.cross(fromCameraF, up, fromCameraR), fromCameraR); @@ -6876,21 +6629,11 @@ define('Core/Matrix4',[ * @exception {DeveloperError} far must be greater than zero. */ Matrix4.computePerspectiveFieldOfView = function(fovY, aspectRatio, near, far, result) { - if (fovY <= 0.0 || fovY > Math.PI) { - throw new DeveloperError('fovY must be in (0, PI].'); - } - if (aspectRatio <= 0.0) { - throw new DeveloperError('aspectRatio must be greater than zero.'); - } - if (near <= 0.0) { - throw new DeveloperError('near must be greater than zero.'); - } - if (far <= 0.0) { - throw new DeveloperError('far must be greater than zero.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThan('fovY', fovY, 0.0); + Check.typeOf.number.lessThan('fovY', fovY, Math.PI); + Check.typeOf.number.greaterThan('near', near, 0.0); + Check.typeOf.number.greaterThan('far', far, 0.0); + Check.typeOf.object('result', result); var bottom = Math.tan(fovY * 0.5); @@ -6931,27 +6674,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeOrthographicOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var a = 1.0 / (right - left); var b = 1.0 / (top - bottom); @@ -6996,27 +6725,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computePerspectiveOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -7057,24 +6772,12 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeInfinitePerspectiveOffCenter = function(left, right, bottom, top, near, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -7122,9 +6825,7 @@ define('Core/Matrix4',[ * }, 0.0, 1.0, new Cesium.Matrix4()); */ Matrix4.computeViewportTransformation = function(viewport, nearDepthRange, farDepthRange, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); viewport = defaultValue(viewport, defaultValue.EMPTY_OBJECT); var x = defaultValue(viewport.x, 0.0); @@ -7176,21 +6877,11 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeView = function(position, direction, up, right, result) { - if (!defined(position)) { - throw new DeveloperError('position is required'); - } - if (!defined(direction)) { - throw new DeveloperError('direction is required'); - } - if (!defined(up)) { - throw new DeveloperError('up is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); + Check.typeOf.object('up', up); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = right.x; result[1] = up.x; @@ -7231,9 +6922,7 @@ define('Core/Matrix4',[ * //creates a = [10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0] */ Matrix4.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], @@ -7277,12 +6966,11 @@ define('Core/Matrix4',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix4.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 3) { - throw new DeveloperError('row must be 0, 1, 2, or 3.'); - } - if (typeof column !== 'number' || column < 0 || column > 3) { - throw new DeveloperError('column must be 0, 1, 2, or 3.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 3); + + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 3); return column * 4 + row; }; @@ -7315,16 +7003,12 @@ define('Core/Matrix4',[ * // a.x = 12.0; a.y = 16.0; a.z = 20.0; a.w = 24.0; */ Matrix4.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var startIndex = index * 4; var x = matrix[startIndex]; @@ -7366,18 +7050,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 96.0, 25.0] */ Matrix4.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); var startIndex = index * 4; @@ -7398,15 +7077,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.setTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -7459,16 +7132,12 @@ define('Core/Matrix4',[ * // a.x = 18.0; a.y = 19.0; a.z = 20.0; a.w = 21.0; */ Matrix4.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 4]; @@ -7509,18 +7178,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 24.0, 25.0] */ Matrix4.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); result[index] = cartesian.x; @@ -7540,12 +7204,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter */ Matrix4.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[4], matrix[5], matrix[6], scratchColumn)); @@ -7577,15 +7237,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -7669,15 +7323,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -7707,15 +7355,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -7756,15 +7398,9 @@ define('Core/Matrix4',[ * var m3 = Cesium.Matrix4.multiplyTransformation(m1, m2, new Cesium.Matrix4()); */ Matrix4.multiplyTransformation = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -7842,15 +7478,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByMatrix3(m, rotation, m); */ Matrix4.multiplyByMatrix3 = function(matrix, rotation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('result', result); var left0 = matrix[0]; var left1 = matrix[1]; @@ -7918,15 +7548,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByTranslation(m, position, m); */ Matrix4.multiplyByTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); var x = translation.x; var y = translation.y; @@ -7978,15 +7602,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByScale */ Matrix4.multiplyByUniformScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scale', scale); + Check.typeOf.object('result', result); uniformScaleScratch.x = scale; uniformScaleScratch.y = scale; @@ -8015,15 +7633,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByUniformScale */ Matrix4.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); var scaleX = scale.x; var scaleY = scale.y; @@ -8062,15 +7674,9 @@ define('Core/Matrix4',[ * @returns {Cartesian4} The modified result parameter. */ Matrix4.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8106,15 +7712,9 @@ define('Core/Matrix4',[ * // Cesium.Matrix4.multiplyByVector(matrix, new Cesium.Cartesian4(p.x, p.y, p.z, 0.0), result); */ Matrix4.multiplyByPointAsVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8144,16 +7744,9 @@ define('Core/Matrix4',[ * var result = Cesium.Matrix4.multiplyByPoint(matrix, p, new Cesium.Cartesian3()); */ Matrix4.multiplyByPoint = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8193,15 +7786,9 @@ define('Core/Matrix4',[ * // [-44.0, -46.0, -48.0, -50.0] */ Matrix4.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -8245,12 +7832,8 @@ define('Core/Matrix4',[ * // [-22.0, -23.0, -24.0, -25.0] */ Matrix4.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -8294,12 +7877,8 @@ define('Core/Matrix4',[ * // [13.0, 17.0, 21.0, 25.0] */ Matrix4.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var matrix1 = matrix[1]; var matrix2 = matrix[2]; @@ -8335,12 +7914,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -8454,9 +8029,7 @@ define('Core/Matrix4',[ * //Prints "Difference between both the matrices is not less than 0.1" on the console */ Matrix4.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -8487,12 +8060,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter. */ Matrix4.getTranslation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = matrix[12]; result.y = matrix[13]; @@ -8523,12 +8092,8 @@ define('Core/Matrix4',[ * // [12.0, 16.0, 20.0] */ Matrix4.getRotation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -8560,12 +8125,8 @@ define('Core/Matrix4',[ * @exception {RuntimeError} matrix is not invertible because its determinate is zero. */ Matrix4.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); // Special case for a zero scale matrix that can occur, for example, // when a model's node has a [0, 0, 0] scale. @@ -8703,12 +8264,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.inverseTransformation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); //This function is an optimized version of the below 4 lines. //var rT = Matrix3.transpose(Matrix4.getRotation(matrix)); @@ -8992,6 +8549,7 @@ define('Core/Matrix4',[ /*global define*/ define('Core/Rectangle',[ './Cartographic', + './Check', './defaultValue', './defined', './defineProperties', @@ -9001,6 +8559,7 @@ define('Core/Rectangle',[ './Math' ], function( Cartographic, + Check, defaultValue, defined, defineProperties, @@ -9097,13 +8656,8 @@ define('Core/Rectangle',[ * @returns {Number[]} The array that was packed into */ Rectangle.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -9124,9 +8678,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -9147,9 +8699,7 @@ define('Core/Rectangle',[ * @returns {Number} The width. */ Rectangle.computeWidth = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; if (east < west) { @@ -9164,9 +8714,7 @@ define('Core/Rectangle',[ * @returns {Number} The height. */ Rectangle.computeHeight = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); return rectangle.north - rectangle.south; }; @@ -9201,6 +8749,32 @@ define('Core/Rectangle',[ return result; }; + /** + * Creates an rectangle given the boundary longitude and latitude in radians. + * + * @param {Number} [west=0.0] The westernmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [south=0.0] The southernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Number} [east=0.0] The easternmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [north=0.0] The northernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Rectangle} [result] The object onto which to store the result, or undefined if a new instance should be created. + * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. + * + * @example + * var rectangle = Cesium.Rectangle.fromRadians(0.0, Math.PI/4, Math.PI/8, 3*Math.PI/4); + */ + Rectangle.fromRadians = function(west, south, east, north, result) { + if (!defined(result)) { + return new Rectangle(west, south, east, north); + } + + result.west = defaultValue(west, 0.0); + result.south = defaultValue(south, 0.0); + result.east = defaultValue(east, 0.0); + result.north = defaultValue(north, 0.0); + + return result; + }; + /** * Creates the smallest possible Rectangle that encloses all positions in the provided array. * @@ -9209,9 +8783,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartographicArray = function(cartographics, result) { - if (!defined(cartographics)) { - throw new DeveloperError('cartographics is required.'); - } + Check.defined('cartographics', cartographics); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -9264,9 +8836,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartesianArray = function(cartesians, ellipsoid, result) { - if (!defined(cartesians)) { - throw new DeveloperError('cartesians is required.'); - } + Check.defined('cartesians', cartesians); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -9382,9 +8952,7 @@ define('Core/Rectangle',[ * @returns {Boolean} <code>true</code> if the Rectangles are within the provided epsilon, <code>false</code> otherwise. */ Rectangle.prototype.equalsEpsilon = function(other, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon is required and must be a number.'); - } + Check.typeOf.number('epsilon', epsilon); return defined(other) && (Math.abs(this.west - other.west) <= epsilon) && @@ -9404,45 +8972,23 @@ define('Core/Rectangle',[ * @exception {DeveloperError} <code>west</code> must be in the interval [<code>-Pi</code>, <code>Pi</code>]. */ Rectangle.validate = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var north = rectangle.north; - if (typeof north !== 'number') { - throw new DeveloperError('north is required to be a number.'); - } - - if (north < -CesiumMath.PI_OVER_TWO || north > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('north must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('north', north, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('north', north, CesiumMath.PI_OVER_TWO); var south = rectangle.south; - if (typeof south !== 'number') { - throw new DeveloperError('south is required to be a number.'); - } - - if (south < -CesiumMath.PI_OVER_TWO || south > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('south must be in the interval [-Pi/2, Pi/2].'); - } - - var west = rectangle.west; - if (typeof west !== 'number') { - throw new DeveloperError('west is required to be a number.'); - } + Check.typeOf.number.greaterThanOrEquals('south', south, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('south', south, CesiumMath.PI_OVER_TWO); - if (west < -Math.PI || west > Math.PI) { - throw new DeveloperError('west must be in the interval [-Pi, Pi].'); - } + var west = rectangle.west; + Check.typeOf.number.greaterThanOrEquals('west', west, -Math.PI); + Check.typeOf.number.lessThanOrEquals('west', west, Math.PI); var east = rectangle.east; - if (typeof east !== 'number') { - throw new DeveloperError('east is required to be a number.'); - } - - if (east < -Math.PI || east > Math.PI) { - throw new DeveloperError('east must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('east', east, -Math.PI); + Check.typeOf.number.lessThanOrEquals('east', east, Math.PI); }; /** @@ -9453,9 +8999,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.south); @@ -9474,9 +9018,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.north); @@ -9495,9 +9037,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.north); @@ -9516,9 +9056,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.south); @@ -9537,9 +9075,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.center = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; @@ -9574,12 +9110,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.intersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var rectangleEast = rectangle.east; var rectangleWest = rectangle.west; @@ -9635,12 +9167,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.simpleIntersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var west = Math.max(rectangle.west, otherRectangle.west); var south = Math.max(rectangle.south, otherRectangle.south); @@ -9671,12 +9199,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.union = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); if (!defined(result)) { result = new Rectangle(); @@ -9720,12 +9244,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.expand = function(rectangle, cartographic, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); if (!defined(result)) { result = new Rectangle(); @@ -9747,12 +9267,8 @@ define('Core/Rectangle',[ * @returns {Boolean} true if the provided cartographic is inside the rectangle, false otherwise. */ Rectangle.contains = function(rectangle, cartographic) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); var longitude = cartographic.longitude; var latitude = cartographic.latitude; @@ -9785,9 +9301,7 @@ define('Core/Rectangle',[ * @returns {Cartesian3[]} The modified result parameter or a new Array of Cartesians instances if none was provided. */ Rectangle.subsample = function(rectangle, ellipsoid, surfaceHeight, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84); surfaceHeight = defaultValue(surfaceHeight, 0.0); @@ -9865,9 +9379,9 @@ define('Core/Rectangle',[ define('Core/BoundingSphere',[ './Cartesian3', './Cartographic', + './Check', './defaultValue', './defined', - './DeveloperError', './Ellipsoid', './GeographicProjection', './Intersect', @@ -9878,9 +9392,9 @@ define('Core/BoundingSphere',[ ], function( Cartesian3, Cartographic, + Check, defaultValue, defined, - DeveloperError, Ellipsoid, GeographicProjection, Intersect, @@ -10210,9 +9724,7 @@ define('Core/BoundingSphere',[ stride = defaultValue(stride, 3); - if (stride < 3) { - throw new DeveloperError('stride must be 3 or greater.'); - } + Check.typeOf.number.greaterThanOrEquals('stride', stride, 3); var currentPos = fromPointsCurrentPos; currentPos.x = positions[0] + center.x; @@ -10516,9 +10028,8 @@ define('Core/BoundingSphere',[ * var sphere = Cesium.BoundingSphere.fromCornerPoints(new Cesium.Cartesian3(-0.5, -0.5, -0.5), new Cesium.Cartesian3(0.5, 0.5, 0.5)); */ BoundingSphere.fromCornerPoints = function(corner, oppositeCorner, result) { - if (!defined(corner) || !defined(oppositeCorner)) { - throw new DeveloperError('corner and oppositeCorner are required.'); - } + Check.typeOf.object('corner', corner); + Check.typeOf.object('oppositeCorner', oppositeCorner); if (!defined(result)) { result = new BoundingSphere(); @@ -10542,9 +10053,7 @@ define('Core/BoundingSphere',[ * var boundingSphere = Cesium.BoundingSphere.fromEllipsoid(ellipsoid); */ BoundingSphere.fromEllipsoid = function(ellipsoid, result) { - if (!defined(ellipsoid)) { - throw new DeveloperError('ellipsoid is required.'); - } + Check.typeOf.object('ellipsoid', ellipsoid); if (!defined(result)) { result = new BoundingSphere(); @@ -10670,13 +10179,8 @@ define('Core/BoundingSphere',[ * @returns {Number[]} The array that was packed into */ BoundingSphere.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -10698,9 +10202,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if one was not provided. */ BoundingSphere.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -10727,13 +10229,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.union = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); if (!defined(result)) { result = new BoundingSphere(); @@ -10782,13 +10279,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.expand = function(sphere, point, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(point)) { - throw new DeveloperError('point is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('point', point); result = BoundingSphere.clone(sphere, result); @@ -10811,13 +10303,8 @@ define('Core/BoundingSphere',[ * intersects the plane. */ BoundingSphere.intersectPlane = function(sphere, plane) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(plane)) { - throw new DeveloperError('plane is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('plane', plane); var center = sphere.center; var radius = sphere.radius; @@ -10843,13 +10330,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.transform = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -10877,12 +10359,8 @@ define('Core/BoundingSphere',[ * }); */ BoundingSphere.distanceSquaredTo = function(sphere, cartesian) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('cartesian', cartesian); var diff = Cartesian3.subtract(sphere.center, cartesian, distanceSquaredToScratch); return Cartesian3.magnitudeSquared(diff) - sphere.radius * sphere.radius; @@ -10904,13 +10382,8 @@ define('Core/BoundingSphere',[ * var newBoundingSphere = Cesium.BoundingSphere.transformWithoutScale(boundingSphere, modelMatrix); */ BoundingSphere.transformWithoutScale = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -10937,17 +10410,9 @@ define('Core/BoundingSphere',[ * @returns {Interval} The nearest and farthest distances on the bounding sphere from position in direction. */ BoundingSphere.computePlaneDistances = function(sphere, position, direction, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(position)) { - throw new DeveloperError('position is required.'); - } - - if (!defined(direction)) { - throw new DeveloperError('direction is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); if (!defined(result)) { result = new Interval(); @@ -10982,9 +10447,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.projectTo2D = function(sphere, projection, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } + Check.typeOf.object('sphere', sphere); projection = defaultValue(projection, projectTo2DProjection); @@ -11079,12 +10542,8 @@ define('Core/BoundingSphere',[ * @returns {Boolean} <code>true</code> if the sphere is not visible; otherwise <code>false</code>. */ BoundingSphere.isOccluded = function(sphere, occluder) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(occluder)) { - throw new DeveloperError('occluder is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('occluder', occluder); return !occluder.isBoundingSphereVisible(sphere); }; @@ -12293,7 +11752,10 @@ define('Core/WebGLConstants',[ COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : 0x9279, TEXTURE_IMMUTABLE_FORMAT : 0x912F, MAX_ELEMENT_INDEX : 0x8D6B, - TEXTURE_IMMUTABLE_LEVELS : 0x82DF + TEXTURE_IMMUTABLE_LEVELS : 0x82DF, + + // Extensions + MAX_TEXTURE_MAX_ANISOTROPY_EXT : 0x84FF }; return freezeObject(WebGLConstants); @@ -13002,6 +12464,7 @@ define('Core/EllipsoidGeodesic',[ * Provides the location of a point at the indicated portion along the geodesic. * * @param {Number} fraction The portion of the distance between the initial and final points. + * @param {Cartographic} result The object in which to store the result. * @returns {Cartographic} The location of the point along the geodesic. */ EllipsoidGeodesic.prototype.interpolateUsingFraction = function(fraction, result) { @@ -13012,6 +12475,7 @@ define('Core/EllipsoidGeodesic',[ * Provides the location of a point at the indicated distance along the geodesic. * * @param {Number} distance The distance from the inital point to the point of interest along the geodesic + * @param {Cartographic} result The object in which to store the result. * @returns {Cartographic} The location of the point along the geodesic. * * @exception {DeveloperError} start and end must be set before calling function interpolateUsingSurfaceDistance @@ -13862,6 +13326,7 @@ define('Core/IntersectionTests',[ './defaultValue', './defined', './DeveloperError', + './Interval', './Math', './Matrix3', './QuadraticRealPolynomial', @@ -13873,6 +13338,7 @@ define('Core/IntersectionTests',[ defaultValue, defined, DeveloperError, + Interval, CesiumMath, Matrix3, QuadraticRealPolynomial, @@ -14144,7 +13610,7 @@ define('Core/IntersectionTests',[ function raySphere(ray, sphere, result) { if (!defined(result)) { - result = {}; + result = new Interval(); } var origin = ray.origin; @@ -14175,8 +13641,8 @@ define('Core/IntersectionTests',[ * * @param {Ray} ray The ray. * @param {BoundingSphere} sphere The sphere. - * @param {Object} [result] The result onto which to store the result. - * @returns {Object} An object with the first (<code>start</code>) and the second (<code>stop</code>) intersection scalars for points along the ray or undefined if there are no intersections. + * @param {Interval} [result] The result onto which to store the result. + * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections. */ IntersectionTests.raySphere = function(ray, sphere, result) { if (!defined(ray)) { @@ -14204,8 +13670,8 @@ define('Core/IntersectionTests',[ * @param {Cartesian3} p0 An end point of the line segment. * @param {Cartesian3} p1 The other end point of the line segment. * @param {BoundingSphere} sphere The sphere. - * @param {Object} [result] The result onto which to store the result. - * @returns {Object} An object with the first (<code>start</code>) and the second (<code>stop</code>) intersection scalars for points along the line segment or undefined if there are no intersections. + * @param {Interval} [result] The result onto which to store the result. + * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections. */ IntersectionTests.lineSegmentSphere = function(p0, p1, sphere, result) { if (!defined(p0)) { @@ -14243,7 +13709,7 @@ define('Core/IntersectionTests',[ * * @param {Ray} ray The ray. * @param {Ellipsoid} ellipsoid The ellipsoid. - * @returns {Object} An object with the first (<code>start</code>) and the second (<code>stop</code>) intersection scalars for points along the ray or undefined if there are no intersections. + * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections. */ IntersectionTests.rayEllipsoid = function(ray, ellipsoid) { if (!defined(ray)) { @@ -14285,10 +13751,7 @@ define('Core/IntersectionTests',[ var root0 = temp / w2; var root1 = difference / temp; if (root0 < root1) { - return { - start : root0, - stop : root1 - }; + return new Interval(root0, root1); } return { @@ -14298,10 +13761,7 @@ define('Core/IntersectionTests',[ } else { // qw2 == product. Repeated roots (2 intersections). var root = Math.sqrt(difference / w2); - return { - start : root, - stop : root - }; + return new Interval(root, root); } } else if (q2 < 1.0) { // Inside ellipsoid (2 intersections). @@ -14311,19 +13771,13 @@ define('Core/IntersectionTests',[ discriminant = qw * qw - product; temp = -qw + Math.sqrt(discriminant); // Positively valued. - return { - start : 0.0, - stop : temp / w2 - }; + return new Interval(0.0, temp / w2); } else { // q2 == 1.0. On ellipsoid. if (qw < 0.0) { // Looking inward. w2 = Cartesian3.magnitudeSquared(w); - return { - start : 0.0, - stop : -qw / w2 - }; + return new Interval(0.0, -qw / w2); } // qw >= 0.0. Looking outward or tangent. @@ -14758,6 +14212,30 @@ define('Core/IntersectionTests',[ return IntersectionTests; }); +/*global define*/ +define('Core/isArray',[ + './defined' + ], function( + defined) { + 'use strict'; + + /** + * Tests an object to see if it is an array. + * @exports isArray + * + * @param {Object} value The value to test. + * @returns {Boolean} true if the value is an array, false otherwise. + */ + var isArray = Array.isArray; + if (!defined(isArray)) { + isArray = function(value) { + return Object.prototype.toString.call(value) === '[object Array]'; + }; + } + + return isArray; +}); + /*global define*/ define('Core/Plane',[ './Cartesian3', @@ -15131,10 +14609,10 @@ define('Core/PolylinePipeline',[ /** * Subdivides polyline and raises all points to the specified height. Returns an array of numbers to represent the positions. - * @param {Cartesian3[]} positions The array of type {Cartesian3} representing positions. - * @param {Number|Number[]} [height=0.0] A number or array of numbers representing the heights of each position. - * @param {Number} [granularity = CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. - * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie. + * @param {Cartesian3[]} options.positions The array of type {Cartesian3} representing positions. + * @param {Number|Number[]} [options.height=0.0] A number or array of numbers representing the heights of each position. + * @param {Number} [options.granularity = CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. + * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie. * @returns {Number[]} A new array of positions of type {Number} that have been subdivided and raised to the surface of the ellipsoid. * * @example @@ -15216,10 +14694,10 @@ define('Core/PolylinePipeline',[ /** * Subdivides polyline and raises all points to the specified height. Returns an array of new {Cartesian3} positions. - * @param {Cartesian3[]} positions The array of type {Cartesian3} representing positions. - * @param {Number|Number[]} [height=0.0] A number or array of numbers representing the heights of each position. - * @param {Number} [granularity = CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. - * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie. + * @param {Cartesian3[]} options.positions The array of type {Cartesian3} representing positions. + * @param {Number|Number[]} [options.height=0.0] A number or array of numbers representing the heights of each position. + * @param {Number} [options.granularity = CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. + * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie. * @returns {Cartesian3[]} A new array of cartesian3 positions that have been subdivided and raised to the surface of the ellipsoid. * * @example @@ -15248,12 +14726,14 @@ define('Core/PolylinePipeline',[ /*global define*/ define('Core/Cartesian2',[ + './Check', './defaultValue', './defined', './DeveloperError', './freezeObject', './Math' ], function( + Check, defaultValue, defined, DeveloperError, @@ -15365,12 +14845,8 @@ define('Core/Cartesian2',[ * @returns {Number[]} The array that was packed into */ Cartesian2.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -15389,9 +14865,7 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided. */ Cartesian2.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -15411,9 +14885,7 @@ define('Core/Cartesian2',[ * @returns {Number[]} The packed array. */ Cartesian2.packArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -15436,9 +14908,7 @@ define('Core/Cartesian2',[ * @returns {Cartesian2[]} The unpacked array. */ Cartesian2.unpackArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -15481,9 +14951,7 @@ define('Core/Cartesian2',[ * @returns {Number} The value of the maximum component. */ Cartesian2.maximumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y); }; @@ -15495,9 +14963,7 @@ define('Core/Cartesian2',[ * @returns {Number} The value of the minimum component. */ Cartesian2.minimumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y); }; @@ -15511,15 +14977,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} A cartesian with the minimum components. */ Cartesian2.minimumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); @@ -15537,15 +14997,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} A cartesian with the maximum components. */ Cartesian2.maximumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -15559,9 +15013,7 @@ define('Core/Cartesian2',[ * @returns {Number} The squared magnitude. */ Cartesian2.magnitudeSquared = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y; }; @@ -15627,12 +15079,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.normalize = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian2.magnitude(cartesian); @@ -15654,12 +15102,8 @@ define('Core/Cartesian2',[ * @returns {Number} The dot product. */ Cartesian2.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y; }; @@ -15673,15 +15117,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.multiplyComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -15697,15 +15135,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.divideComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x / right.x; result.y = left.y / right.y; @@ -15721,15 +15153,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -15745,15 +15171,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -15769,15 +15189,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.multiplyByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -15793,15 +15207,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.divideByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -15816,12 +15224,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.negate = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -15836,12 +15240,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.abs = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -15859,18 +15259,10 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian2.multiplyByScalar(end, t, lerpScratch); result = Cartesian2.multiplyByScalar(start, 1.0 - t, result); @@ -15882,17 +15274,13 @@ define('Core/Cartesian2',[ /** * Returns the angle, in radians, between the provided Cartesians. * - * @param {Cartesian2} left The first Cartesian. - * @param {Cartesian2} right The second Cartesian. - * @returns {Number} The angle between the Cartesians. - */ - Cartesian2.angleBetween = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + * @param {Cartesian2} left The first Cartesian. + * @param {Cartesian2} right The second Cartesian. + * @returns {Number} The angle between the Cartesians. + */ + Cartesian2.angleBetween = function(left, right) { + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian2.normalize(left, angleBetweenScratch); Cartesian2.normalize(right, angleBetweenScratch2); @@ -15908,12 +15296,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The most orthogonal axis. */ Cartesian2.mostOrthogonalAxis = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian2.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian2.abs(f, f); @@ -17023,118 +16407,6 @@ define('ThirdParty/when',[],function () { // Boilerplate for AMD, Node, and browser global ); -/*global define*/ -define('Core/oneTimeWarning',[ - './defaultValue', - './defined', - './DeveloperError' - ], function( - defaultValue, - defined, - DeveloperError) { - "use strict"; - - var warnings = {}; - - /** - * Logs a one time message to the console. Use this function instead of - * <code>console.log</code> directly since this does not log duplicate messages - * unless it is called from multiple workers. - * - * @exports oneTimeWarning - * - * @param {String} identifier The unique identifier for this warning. - * @param {String} [message=identifier] The message to log to the console. - * - * @example - * for(var i=0;i<foo.length;++i) { - * if (!defined(foo[i].bar)) { - * // Something that can be recovered from but may happen a lot - * oneTimeWarning('foo.bar undefined', 'foo.bar is undefined. Setting to 0.'); - * foo[i].bar = 0; - * // ... - * } - * } - * - * @private - */ - function oneTimeWarning(identifier, message) { - if (!defined(identifier)) { - throw new DeveloperError('identifier is required.'); - } - - if (!defined(warnings[identifier])) { - warnings[identifier] = true; - console.log(defaultValue(message, identifier)); - } - } - - oneTimeWarning.geometryOutlines = 'Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.'; - - return oneTimeWarning; -}); - -/*global define*/ -define('Core/deprecationWarning',[ - './defined', - './DeveloperError', - './oneTimeWarning' - ], function( - defined, - DeveloperError, - oneTimeWarning) { - 'use strict'; - - /** - * Logs a deprecation message to the console. Use this function instead of - * <code>console.log</code> directly since this does not log duplicate messages - * unless it is called from multiple workers. - * - * @exports deprecationWarning - * - * @param {String} identifier The unique identifier for this deprecated API. - * @param {String} message The message to log to the console. - * - * @example - * // Deprecated function or class - * function Foo() { - * deprecationWarning('Foo', 'Foo was deprecated in Cesium 1.01. It will be removed in 1.03. Use newFoo instead.'); - * // ... - * } - * - * // Deprecated function - * Bar.prototype.func = function() { - * deprecationWarning('Bar.func', 'Bar.func() was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newFunc() instead.'); - * // ... - * }; - * - * // Deprecated property - * defineProperties(Bar.prototype, { - * prop : { - * get : function() { - * deprecationWarning('Bar.prop', 'Bar.prop was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newProp instead.'); - * // ... - * }, - * set : function(value) { - * deprecationWarning('Bar.prop', 'Bar.prop was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newProp instead.'); - * // ... - * } - * } - * }); - * - * @private - */ - function deprecationWarning(identifier, message) { - if (!defined(identifier) || !defined(message)) { - throw new DeveloperError('identifier and message are required.'); - } - - oneTimeWarning(identifier, message); - } - - return deprecationWarning; -}); - /*global define*/ define('Core/binarySearch',[ './defined', @@ -20844,6 +20116,7 @@ define('Core/Iau2006XysData',[ /*global define*/ define('Core/Quaternion',[ './Cartesian3', + './Check', './defaultValue', './defined', './DeveloperError', @@ -20853,6 +20126,7 @@ define('Core/Quaternion',[ './Matrix3' ], function( Cartesian3, + Check, defaultValue, defined, DeveloperError, @@ -20915,12 +20189,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided. */ Quaternion.fromAxisAngle = function(axis, angle, result) { - if (!defined(axis)) { - throw new DeveloperError('axis is required.'); - } - if (typeof angle !== 'number') { - throw new DeveloperError('angle is required and must be a number.'); - } + Check.typeOf.object('axis', axis); + Check.typeOf.number('angle', angle); var halfAngle = angle / 2.0; var s = Math.sin(halfAngle); @@ -20952,9 +20222,7 @@ define('Core/Quaternion',[ * @see Matrix3.fromQuaternion */ Quaternion.fromRotationMatrix = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); var root; var x; @@ -21028,15 +20296,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter or a new Quaternion instance if none was provided. */ Quaternion.fromHeadingPitchRoll = function(heading, pitch, roll, result) { - if (!defined(heading)) { - throw new DeveloperError('heading is required.'); - } - if (!defined(pitch)) { - throw new DeveloperError('pitch is required.'); - } - if (!defined(roll)) { - throw new DeveloperError('roll is required.'); - } + Check.typeOf.number('heading', heading); + Check.typeOf.number('pitch', pitch); + Check.typeOf.number('roll', roll); var rollQuaternion = Quaternion.fromAxisAngle(Cartesian3.UNIT_X, roll, scratchHPRQuaternion); var pitchQuaternion = Quaternion.fromAxisAngle(Cartesian3.UNIT_Y, -pitch, result); @@ -21067,13 +20329,8 @@ define('Core/Quaternion',[ * @returns {Number[]} The array that was packed into */ Quaternion.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -21094,9 +20351,7 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided. */ Quaternion.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -21151,7 +20406,7 @@ define('Core/Quaternion',[ * * @param {Number[]} array The array previously packed for interpolation. * @param {Number[]} sourceArray The original packed array. - * @param {Number} [startingIndex=0] The startingIndex used to convert the array. + * @param {Number} [firstIndex=0] The firstIndex used to convert the array. * @param {Number} [lastIndex=packedArray.length] The lastIndex used to convert the array. * @param {Quaternion} [result] The object into which to store the result. * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided. @@ -21205,12 +20460,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.conjugate = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); result.x = -quaternion.x; result.y = -quaternion.y; @@ -21226,9 +20477,7 @@ define('Core/Quaternion',[ * @returns {Number} The magnitude squared. */ Quaternion.magnitudeSquared = function(quaternion) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); return quaternion.x * quaternion.x + quaternion.y * quaternion.y + quaternion.z * quaternion.z + quaternion.w * quaternion.w; }; @@ -21251,9 +20500,7 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.normalize = function(quaternion, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); var inverseMagnitude = 1.0 / Quaternion.magnitude(quaternion); var x = quaternion.x * inverseMagnitude; @@ -21276,9 +20523,7 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.inverse = function(quaternion, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); var magnitudeSquared = Quaternion.magnitudeSquared(quaternion); result = Quaternion.conjugate(quaternion, result); @@ -21294,15 +20539,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -21320,15 +20559,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -21345,12 +20578,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.negate = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); result.x = -quaternion.x; result.y = -quaternion.y; @@ -21367,12 +20596,8 @@ define('Core/Quaternion',[ * @returns {Number} The dot product. */ Quaternion.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w; }; @@ -21386,15 +20611,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var leftX = left.x; var leftY = left.y; @@ -21427,15 +20646,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.multiplyByScalar = function(quaternion, scalar, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = quaternion.x * scalar; result.y = quaternion.y * scalar; @@ -21453,15 +20666,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.divideByScalar = function(quaternion, scalar, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = quaternion.x / scalar; result.y = quaternion.y / scalar; @@ -21478,12 +20685,8 @@ define('Core/Quaternion',[ * @returns {Cartesian3} The modified result parameter. */ Quaternion.computeAxis = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); var w = quaternion.w; if (Math.abs(w - 1.0) < CesiumMath.EPSILON6) { @@ -21506,9 +20709,7 @@ define('Core/Quaternion',[ * @returns {Number} The angle of rotation. */ Quaternion.computeAngle = function(quaternion) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); if (Math.abs(quaternion.w - 1.0) < CesiumMath.EPSILON6) { return 0.0; @@ -21527,18 +20728,10 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); lerpScratch = Quaternion.multiplyByScalar(end, t, lerpScratch); result = Quaternion.multiplyByScalar(start, 1.0 - t, result); @@ -21560,18 +20753,10 @@ define('Core/Quaternion',[ * @see Quaternion#fastSlerp */ Quaternion.slerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var dot = Quaternion.dot(start, end); @@ -21604,12 +20789,8 @@ define('Core/Quaternion',[ * @returns {Cartesian3} The modified result parameter. */ Quaternion.log = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); var theta = CesiumMath.acosClamped(quaternion.w); var thetaOverSinTheta = 0.0; @@ -21629,12 +20810,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.exp = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var theta = Cartesian3.magnitude(cartesian); var sinThetaOverTheta = 0.0; @@ -21669,12 +20846,10 @@ define('Core/Quaternion',[ * @see Quaternion#squad */ Quaternion.computeInnerQuadrangle = function(q0, q1, q2, result) { - if (!defined(q0) || !defined(q1) || !defined(q2)) { - throw new DeveloperError('q0, q1, and q2 are required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('q0', q0); + Check.typeOf.object('q1', q1); + Check.typeOf.object('q2', q2); + Check.typeOf.object('result', result); var qInv = Quaternion.conjugate(q1, squadScratchQuaternion0); Quaternion.multiply(qInv, q2, squadScratchQuaternion1); @@ -21716,15 +20891,12 @@ define('Core/Quaternion',[ * @see Quaternion#computeInnerQuadrangle */ Quaternion.squad = function(q0, q1, s0, s1, t, result) { - if (!defined(q0) || !defined(q1) || !defined(s0) || !defined(s1)) { - throw new DeveloperError('q0, q1, s0, and s1 are required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('q0', q0); + Check.typeOf.object('q1', q1); + Check.typeOf.object('s0', s0); + Check.typeOf.object('s1', s1); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var slerp0 = Quaternion.slerp(q0, q1, t, squadScratchQuaternion0); var slerp1 = Quaternion.slerp(s0, s1, t, squadScratchQuaternion1); @@ -21761,18 +20933,10 @@ define('Core/Quaternion',[ * @see Quaternion#slerp */ Quaternion.fastSlerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var x = Quaternion.dot(start, end); @@ -21821,15 +20985,12 @@ define('Core/Quaternion',[ * @see Quaternion#squad */ Quaternion.fastSquad = function(q0, q1, s0, s1, t, result) { - if (!defined(q0) || !defined(q1) || !defined(s0) || !defined(s1)) { - throw new DeveloperError('q0, q1, s0, and s1 are required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('q0', q0); + Check.typeOf.object('q1', q1); + Check.typeOf.object('s0', s0); + Check.typeOf.object('s1', s1); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var slerp0 = Quaternion.fastSlerp(q0, q1, t, squadScratchQuaternion0); var slerp1 = Quaternion.fastSlerp(s0, s1, t, squadScratchQuaternion1); @@ -21865,9 +21026,7 @@ define('Core/Quaternion',[ * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. */ Quaternion.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon is required and must be a number.'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || ((defined(left)) && @@ -21947,9 +21106,9 @@ define('Core/Transforms',[ './Cartesian3', './Cartesian4', './Cartographic', + './Check', './defaultValue', './defined', - './deprecationWarning', './DeveloperError', './EarthOrientationParameters', './EarthOrientationParametersSample', @@ -21969,9 +21128,9 @@ define('Core/Transforms',[ Cartesian3, Cartesian4, Cartographic, + Check, defaultValue, defined, - deprecationWarning, DeveloperError, EarthOrientationParameters, EarthOrientationParametersSample, @@ -22407,19 +21566,12 @@ define('Core/Transforms',[ * var hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll); * var transform = Cesium.Transforms.headingPitchRollToFixedFrame(center, hpr); */ - Transforms.headingPitchRollToFixedFrame = function(origin, headingPitchRoll, pitch, roll, ellipsoid, result) { - var heading; - if (typeof headingPitchRoll === 'object') { - // Shift arguments using assignments to encourage JIT optimization. - ellipsoid = pitch; - result = roll; - heading = headingPitchRoll.heading; - pitch = headingPitchRoll.pitch; - roll = headingPitchRoll.roll; - } else { - deprecationWarning('headingPitchRollToFixedFrame', 'headingPitchRollToFixedFrame with separate heading, pitch, and roll arguments was deprecated in 1.27. It will be removed in 1.30. Use a HeadingPitchRoll object.'); - heading = headingPitchRoll; - } + Transforms.headingPitchRollToFixedFrame = function(origin, headingPitchRoll, ellipsoid, result) { + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + var heading = headingPitchRoll.heading; + var pitch = headingPitchRoll.pitch; + var roll = headingPitchRoll.roll; + // checks for required parameters happen in the called functions var hprQuaternion = Quaternion.fromHeadingPitchRoll(heading, pitch, roll, scratchHPRQuaternion); var hprMatrix = Matrix4.fromTranslationQuaternionRotationScale(Cartesian3.ZERO, hprQuaternion, scratchScale, scratchHPRMatrix4); @@ -22427,7 +21579,6 @@ define('Core/Transforms',[ return Matrix4.multiply(result, hprMatrix, result); }; - var scratchHPR = new HeadingPitchRoll(); var scratchENUMatrix4 = new Matrix4(); var scratchHPRMatrix3 = new Matrix3(); @@ -22452,22 +21603,10 @@ define('Core/Transforms',[ * var hpr = new HeadingPitchRoll(heading, pitch, roll); * var quaternion = Cesium.Transforms.headingPitchRollQuaternion(center, hpr); */ - Transforms.headingPitchRollQuaternion = function(origin, headingPitchRoll, pitch, roll, ellipsoid, result) { - var hpr; - if (typeof headingPitchRoll === 'object') { - // Shift arguments using assignment to encourage JIT optimization. - hpr = headingPitchRoll; - ellipsoid = pitch; - result = roll; - } else { - deprecationWarning('headingPitchRollQuaternion', 'headingPitchRollQuaternion with separate heading, pitch, and roll arguments was deprecated in 1.27. It will be removed in 1.30. Use a HeadingPitchRoll object.'); - scratchHPR.heading = headingPitchRoll; - scratchHPR.pitch = pitch; - scratchHPR.roll = roll; - hpr = scratchHPR; - } + Transforms.headingPitchRollQuaternion = function(origin, headingPitchRoll, ellipsoid, result) { // checks for required parameters happen in the called functions - var transform = Transforms.headingPitchRollToFixedFrame(origin, hpr, ellipsoid, scratchENUMatrix4); + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + var transform = Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, scratchENUMatrix4); var rotation = Matrix4.getRotation(transform, scratchHPRMatrix3); return Quaternion.fromRotationMatrix(rotation, result); }; @@ -22943,6 +22082,46 @@ define('Core/Transforms',[ return result; }; + var swizzleMatrix = new Matrix4( + 0.0, 0.0, 1.0, 0.0, + 1.0, 0.0, 0.0, 0.0, + 0.0, 1.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + + /** + * @private + */ + Transforms.wgs84To2DModelMatrix = function(projection, center, result) { + if (!defined(projection)) { + throw new DeveloperError('projection is required.'); + } + if (!defined(center)) { + throw new DeveloperError('center is required.'); + } + if (!defined(result)) { + throw new DeveloperError('result is required.'); + } + + var ellipsoid = projection.ellipsoid; + + var fromENU = Transforms.eastNorthUpToFixedFrame(center, ellipsoid, scratchFromENU); + var toENU = Matrix4.inverseTransformation(fromENU, scratchToENU); + + var cartographic = ellipsoid.cartesianToCartographic(center, scratchCartographic); + var projectedPosition = projection.project(cartographic, scratchCartesian3Projection); + var newOrigin = scratchCartesian4NewOrigin; + newOrigin.x = projectedPosition.z; + newOrigin.y = projectedPosition.x; + newOrigin.z = projectedPosition.y; + newOrigin.w = 1.0; + + var translation = Matrix4.fromTranslation(newOrigin, scratchFromENU); + Matrix4.multiply(swizzleMatrix, toENU, result); + Matrix4.multiply(translation, result, result); + + return result; + }; + return Transforms; }); @@ -24213,7 +23392,7 @@ define('Core/Geometry',[ * <li><code>position</code> - 3D vertex position. 64-bit floating-point (for precision). 3 components per attribute. See {@link VertexFormat#position}.</li> * <li><code>normal</code> - Normal (normalized), commonly used for lighting. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#normal}.</li> * <li><code>st</code> - 2D texture coordinate. 32-bit floating-point. 2 components per attribute. See {@link VertexFormat#st}.</li> - * <li><code>binormal</code> - Binormal (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#binormal}.</li> + * <li><code>bitangent</code> - Bitangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#bitangent}.</li> * <li><code>tangent</code> - Tangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#tangent}.</li> * </ul> * </p> @@ -24242,7 +23421,7 @@ define('Core/Geometry',[ * componentsPerAttribute : 3, * values : new Float32Array(0) * }); - * + * * @see GeometryAttribute * @see VertexFormat */ @@ -24523,7 +23702,7 @@ define('Core/GeometryAttributes',[ this.st = options.st; /** - * The binormal attribute (normalized), which is used for tangent-space effects like bump mapping. + * The bitangent attribute (normalized), which is used for tangent-space effects like bump mapping. * <p> * 32-bit floating-point. 3 components per attribute. * </p> @@ -24532,7 +23711,7 @@ define('Core/GeometryAttributes',[ * * @default undefined */ - this.binormal = options.binormal; + this.bitangent = options.bitangent; /** * The tangent attribute (normalized), which is used for tangent-space effects like bump mapping. diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createCylinderGeometry.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createCylinderGeometry.js index e13679ee..b026d6b2 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createCylinderGeometry.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createCylinderGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,68 +45,6 @@ define('Core/defined',[],function() { return defined; }); -/*global define*/ -define('Core/freezeObject',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Freezes an object, using Object.freeze if available, otherwise returns - * the object unchanged. This function should be used in setup code to prevent - * errors from completely halting JavaScript execution in legacy browsers. - * - * @private - * - * @exports freezeObject - */ - var freezeObject = Object.freeze; - if (!defined(freezeObject)) { - freezeObject = function(o) { - return o; - }; - } - - return freezeObject; -}); - -/*global define*/ -define('Core/defaultValue',[ - './freezeObject' - ], function( - freezeObject) { - 'use strict'; - - /** - * Returns the first parameter if not undefined, otherwise the second parameter. - * Useful for setting a default value for a parameter. - * - * @exports defaultValue - * - * @param {*} a - * @param {*} b - * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter. - * - * @example - * param = Cesium.defaultValue(param, 'default'); - */ - function defaultValue(a, b) { - if (a !== undefined) { - return a; - } - return b; - } - - /** - * A frozen empty object that can be used as the default value for options passed as - * an object literal. - */ - defaultValue.EMPTY_OBJECT = freezeObject({}); - - return defaultValue; -}); - /*global define*/ define('Core/DeveloperError',[ './defined' @@ -188,41 +126,13 @@ define('Core/DeveloperError',[ return DeveloperError; }); -/*global define*/ -define('Core/isArray',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Tests an object to see if it is an array. - * @exports isArray - * - * @param {Object} value The value to test. - * @returns {Boolean} true if the value is an array, false otherwise. - */ - var isArray = Array.isArray; - if (!defined(isArray)) { - isArray = function(value) { - return Object.prototype.toString.call(value) === '[object Array]'; - }; - } - - return isArray; -}); - /*global define*/ define('Core/Check',[ - './defaultValue', - './defined', - './DeveloperError', - './isArray' + './defined', + './DeveloperError' ], function( - defaultValue, defined, - DeveloperError, - isArray) { + DeveloperError) { 'use strict'; /** @@ -237,111 +147,134 @@ define('Core/Check',[ */ Check.typeOf = {}; - /** - * Contains functions for checking numeric conditions such as minimum and maximum values - */ - Check.numeric = {}; - function getUndefinedErrorMessage(name) { - return name + ' was required but undefined.'; + return name + ' is required, actual value was undefined'; } function getFailedTypeErrorMessage(actual, expected, name) { - return 'Expected ' + name + ' to be typeof ' + expected + ', got ' + actual; + return 'Expected ' + name + ' to be typeof ' + expected + ', actual typeof was ' + actual; } /** * Throws if test is not defined * - * @param {*} test The value that is to be checked * @param {String} name The name of the variable being tested + * @param {*} test The value that is to be checked * @exception {DeveloperError} test must be defined */ - Check.defined = function (test, name) { + Check.defined = function (name, test) { if (!defined(test)) { throw new DeveloperError(getUndefinedErrorMessage(name)); } }; /** - * Throws if test is greater than maximum + * Throws if test is not typeof 'function' * - * @param {Number} test The value to test - * @param {Number} maximum The maximum allowed value - * @exception {DeveloperError} test must not be greater than maximum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'function' */ - Check.numeric.maximum = function (test, maximum) { - Check.typeOf.number(test); - Check.typeOf.number(maximum); - if (test > maximum) { - throw new DeveloperError('Expected ' + test + ' to be at most ' + maximum); + Check.typeOf.func = function (name, test) { + if (typeof test !== 'function') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); } }; /** - * Throws if test is less than minimum + * Throws if test is not typeof 'string' * - * @param {Number} test The value to test - * @param {Number} minimum The minimum allowed value - * @exception {DeveloperError} test must not be less than mininum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'string' */ - Check.numeric.minimum = function (test, minimum) { - Check.typeOf.number(test); - Check.typeOf.number(minimum); - if (test < minimum) { - throw new DeveloperError('Expected ' + test + ' to be at least ' + minimum); + Check.typeOf.string = function (name, test) { + if (typeof test !== 'string') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); } }; /** - * Throws if test is not typeof 'function' + * Throws if test is not typeof 'number' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'function' + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'number' */ - Check.typeOf.function = function (test, name) { - if (typeof test !== 'function') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); + Check.typeOf.number = function (name, test) { + if (typeof test !== 'number') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); } }; /** - * Throws if test is not typeof 'string' + * Throws if test is not typeof 'number' and less than limit * + * @param {String} name The name of the variable being tested * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than limit + */ + Check.typeOf.number.lessThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test >= limit) { + throw new DeveloperError('Expected ' + name + ' to be less than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and less than or equal to limit + * * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'string' + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than or equal to limit */ - Check.typeOf.string = function (test, name) { - if (typeof test !== 'string') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); + Check.typeOf.number.lessThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test > limit) { + throw new DeveloperError('Expected ' + name + ' to be less than or equal to ' + limit + ', actual value was ' + test); } }; /** - * Throws if test is not typeof 'number' + * Throws if test is not typeof 'number' and greater than limit * + * @param {String} name The name of the variable being tested * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than limit + */ + Check.typeOf.number.greaterThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test <= limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and greater than or equal to limit + * * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'number' + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than or equal to limit */ - Check.typeOf.number = function (test, name) { - if (typeof test !== 'number') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); + Check.typeOf.number.greaterThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test < limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than or equal to' + limit + ', actual value was ' + test); } }; /** * Throws if test is not typeof 'object' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested + * @param {*} test The value to test * @exception {DeveloperError} test must be typeof 'object' */ - Check.typeOf.object = function (test, name) { + Check.typeOf.object = function (name, test) { if (typeof test !== 'object') { throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'object', name)); } @@ -350,11 +283,11 @@ define('Core/Check',[ /** * Throws if test is not typeof 'boolean' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested + * @param {*} test The value to test * @exception {DeveloperError} test must be typeof 'boolean' */ - Check.typeOf.boolean = function (test, name) { + Check.typeOf.bool = function (name, test) { if (typeof test !== 'boolean') { throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'boolean', name)); } @@ -363,6 +296,68 @@ define('Core/Check',[ return Check; }); +/*global define*/ +define('Core/freezeObject',[ + './defined' + ], function( + defined) { + 'use strict'; + + /** + * Freezes an object, using Object.freeze if available, otherwise returns + * the object unchanged. This function should be used in setup code to prevent + * errors from completely halting JavaScript execution in legacy browsers. + * + * @private + * + * @exports freezeObject + */ + var freezeObject = Object.freeze; + if (!defined(freezeObject)) { + freezeObject = function(o) { + return o; + }; + } + + return freezeObject; +}); + +/*global define*/ +define('Core/defaultValue',[ + './freezeObject' + ], function( + freezeObject) { + 'use strict'; + + /** + * Returns the first parameter if not undefined, otherwise the second parameter. + * Useful for setting a default value for a parameter. + * + * @exports defaultValue + * + * @param {*} a + * @param {*} b + * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter. + * + * @example + * param = Cesium.defaultValue(param, 'default'); + */ + function defaultValue(a, b) { + if (a !== undefined) { + return a; + } + return b; + } + + /** + * A frozen empty object that can be used as the default value for options passed as + * an object literal. + */ + defaultValue.EMPTY_OBJECT = freezeObject({}); + + return defaultValue; +}); + /* I've wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace so it's better encapsulated. Now you can have multiple random number generators @@ -1047,7 +1042,7 @@ define('Core/Math',[ if (!defined(angle)) { throw new DeveloperError('angle is required.'); } - + return CesiumMath.clamp(angle, -1*CesiumMath.PI_OVER_TWO, CesiumMath.PI_OVER_TWO); }; @@ -1057,11 +1052,11 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [<code>-CesiumMath.PI</code>, <code>CesiumMath.PI</code>]. */ - CesiumMath.negativePiToPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.negativePiToPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - return CesiumMath.zeroToTwoPi(x + CesiumMath.PI) - CesiumMath.PI; + return CesiumMath.zeroToTwoPi(angle + CesiumMath.PI) - CesiumMath.PI; }; /** @@ -1070,12 +1065,12 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [0, <code>CesiumMath.TWO_PI</code>]. */ - CesiumMath.zeroToTwoPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.zeroToTwoPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - var mod = CesiumMath.mod(x, CesiumMath.TWO_PI); - if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(x) > CesiumMath.EPSILON14) { + var mod = CesiumMath.mod(angle, CesiumMath.TWO_PI); + if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(angle) > CesiumMath.EPSILON14) { return CesiumMath.TWO_PI; } return mod; @@ -1145,7 +1140,7 @@ define('Core/Math',[ * @example * //Compute 7!, which is equal to 5040 * var computedFactorial = Cesium.Math.factorial(7); - * + * * @see {@link http://en.wikipedia.org/wiki/Factorial|Factorial on Wikipedia} */ CesiumMath.factorial = function(n) { @@ -1429,7 +1424,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.fromSpherical = function(spherical, result) { - Check.typeOf.object(spherical, 'spherical'); + Check.typeOf.object('spherical', spherical); if (!defined(result)) { result = new Cartesian3(); @@ -1513,8 +1508,8 @@ define('Core/Cartesian3',[ * @returns {Number[]} The array that was packed into */ Cartesian3.pack = function(value, array, startingIndex) { - Check.typeOf.object(value, 'value'); - Check.defined(array, 'array'); + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1534,7 +1529,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.unpack = function(array, startingIndex, result) { - Check.defined(array, 'array'); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1555,7 +1550,7 @@ define('Core/Cartesian3',[ * @returns {Number[]} The packed array. */ Cartesian3.packArray = function(array, result) { - Check.defined(array, 'array'); + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -1578,8 +1573,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3[]} The unpacked array. */ Cartesian3.unpackArray = function(array, result) { - Check.defined(array, 'array'); - Check.numeric.minimum(array.length, 3); + Check.defined('array', array); + Check.typeOf.number.greaterThanOrEquals('array.length', array.length, 3); if (array.length % 3 !== 0) { throw new DeveloperError('array length must be a multiple of 3.'); } @@ -1625,7 +1620,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the maximum component. */ Cartesian3.maximumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z); }; @@ -1637,7 +1632,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the minimum component. */ Cartesian3.minimumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z); }; @@ -1651,9 +1646,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the minimum components. */ Cartesian3.minimumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -1671,9 +1666,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the maximum components. */ Cartesian3.maximumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -1688,7 +1683,7 @@ define('Core/Cartesian3',[ * @returns {Number} The squared magnitude. */ Cartesian3.magnitudeSquared = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z; }; @@ -1717,8 +1712,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distance(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(2.0, 0.0, 0.0)); */ Cartesian3.distance = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitude(distanceScratch); @@ -1737,8 +1732,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distanceSquared(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(3.0, 0.0, 0.0)); */ Cartesian3.distanceSquared = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitudeSquared(distanceScratch); @@ -1752,8 +1747,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.normalize = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian3.magnitude(cartesian); @@ -1776,8 +1771,8 @@ define('Core/Cartesian3',[ * @returns {Number} The dot product. */ Cartesian3.dot = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z; }; @@ -1791,9 +1786,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyComponents = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -1835,9 +1830,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.add = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -1854,9 +1849,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.subtract = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -1873,9 +1868,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -1892,9 +1887,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.divideByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -1910,8 +1905,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.negate = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -1927,8 +1922,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.abs = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -1947,10 +1942,10 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.lerp = function(start, end, t, result) { - Check.typeOf.object(start, 'start'); - Check.typeOf.object(end, 'end'); - Check.typeOf.number(t, 't'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian3.multiplyByScalar(end, t, lerpScratch); result = Cartesian3.multiplyByScalar(start, 1.0 - t, result); @@ -1967,8 +1962,8 @@ define('Core/Cartesian3',[ * @returns {Number} The angle between the Cartesians. */ Cartesian3.angleBetween = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.normalize(left, angleBetweenScratch); Cartesian3.normalize(right, angleBetweenScratch2); @@ -1986,8 +1981,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The most orthogonal axis. */ Cartesian3.mostOrthogonalAxis = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian3.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian3.abs(f, f); @@ -2064,9 +2059,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The cross product. */ Cartesian3.cross = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var leftX = left.x; var leftY = left.y; @@ -2099,8 +2094,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromDegrees(-115.0, 37.0); */ Cartesian3.fromDegrees = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); longitude = CesiumMath.toRadians(longitude); latitude = CesiumMath.toRadians(latitude); @@ -2125,8 +2120,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromRadians(-2.007, 0.645); */ Cartesian3.fromRadians = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); height = defaultValue(height, 0.0); var radiiSquared = defined(ellipsoid) ? ellipsoid.radiiSquared : wgs84RadiiSquared; @@ -2160,7 +2155,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArray([-115.0, 37.0, -107.0, 33.0]); */ Cartesian3.fromDegreesArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -2194,7 +2189,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArray([-2.007, 0.645, -1.867, .575]); */ Cartesian3.fromRadiansArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -2228,7 +2223,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArrayHeights([-115.0, 37.0, 100000.0, -107.0, 33.0, 150000.0]); */ Cartesian3.fromDegreesArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -2263,7 +2258,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArrayHeights([-2.007, 0.645, 100000.0, -1.867, .575, 150000.0]); */ Cartesian3.fromRadiansArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -3010,7 +3005,9 @@ define('Core/Ellipsoid',[ /** * Computes an Ellipsoid from a Cartesian specifying the radii in x, y, and z directions. * - * @param {Cartesian3} [radii=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Cartesian3} [cartesian=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new + * instance should be created. * @returns {Ellipsoid} A new Ellipsoid instance. * * @exception {DeveloperError} All radii components must be greater than or equal to zero. @@ -3650,6 +3647,7 @@ define('Core/Interval',[ /*global define*/ define('Core/Matrix3',[ './Cartesian3', + './Check', './defaultValue', './defined', './defineProperties', @@ -3658,6 +3656,7 @@ define('Core/Matrix3',[ './Math' ], function( Cartesian3, + Check, defaultValue, defined, defineProperties, @@ -3720,13 +3719,8 @@ define('Core/Matrix3',[ * @returns {Number[]} The array that was packed into */ Matrix3.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3752,9 +3746,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. */ Matrix3.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3781,24 +3773,24 @@ define('Core/Matrix3',[ * @param {Matrix3} [result] The object onto which to store the result. * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. (Returns undefined if matrix is undefined) */ - Matrix3.clone = function(values, result) { - if (!defined(values)) { + Matrix3.clone = function(matrix, result) { + if (!defined(matrix)) { return undefined; } if (!defined(result)) { - return new Matrix3(values[0], values[3], values[6], - values[1], values[4], values[7], - values[2], values[5], values[8]); + return new Matrix3(matrix[0], matrix[3], matrix[6], + matrix[1], matrix[4], matrix[7], + matrix[2], matrix[5], matrix[8]); } - result[0] = values[0]; - result[1] = values[1]; - result[2] = values[2]; - result[3] = values[3]; - result[4] = values[4]; - result[5] = values[5]; - result[6] = values[6]; - result[7] = values[7]; - result[8] = values[8]; + result[0] = matrix[0]; + result[1] = matrix[1]; + result[2] = matrix[2]; + result[3] = matrix[3]; + result[4] = matrix[4]; + result[5] = matrix[5]; + result[6] = matrix[6]; + result[7] = matrix[7]; + result[8] = matrix[8]; return result; }; @@ -3824,9 +3816,7 @@ define('Core/Matrix3',[ * var m2 = Cesium.Matrix3.fromArray(v2, 2); */ Matrix3.fromArray = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3854,9 +3844,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values parameter is required'); - } + Check.defined('values', values); return Matrix3.clone(values, result); }; @@ -3870,9 +3858,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix3(values[0], values[1], values[2], @@ -3899,9 +3885,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this quaternion. */ Matrix3.fromQuaternion = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); var x2 = quaternion.x * quaternion.x; var xy = quaternion.x * quaternion.y; @@ -3951,10 +3935,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this headingPitchRoll. */ Matrix3.fromHeadingPitchRoll = function(headingPitchRoll, result) { - if (!defined(headingPitchRoll)) { - throw new DeveloperError('headingPitchRoll is required'); - } - var cosTheta = Math.cos(-headingPitchRoll.pitch); + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + + var cosTheta = Math.cos(-headingPitchRoll.pitch); var cosPsi = Math.cos(-headingPitchRoll.heading); var cosPhi = Math.cos(headingPitchRoll.roll); var sinTheta = Math.sin(-headingPitchRoll.pitch); @@ -4005,9 +3988,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix3( @@ -4043,9 +4024,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromUniformScale(2.0); */ Matrix3.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix3( @@ -4069,7 +4048,7 @@ define('Core/Matrix3',[ /** * Computes a Matrix3 instance representing the cross product equivalent matrix of a Cartesian3 vector. * - * @param {Cartesian3} the vector on the left hand side of the cross product operation. + * @param {Cartesian3} vector the vector on the left hand side of the cross product operation. * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created. * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. * @@ -4081,9 +4060,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromCrossProduct(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromCrossProduct = function(vector, result) { - if (!defined(vector)) { - throw new DeveloperError('vector is required.'); - } + Check.typeOf.object('vector', vector); if (!defined(result)) { return new Matrix3( @@ -4118,9 +4095,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationX = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4159,9 +4134,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationY = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4200,9 +4173,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationZ = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4236,9 +4207,7 @@ define('Core/Matrix3',[ * @returns {Number[]} The modified Array parameter or a new Array instance if one was not provided. */ Matrix3.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5], matrix[6], matrix[7], matrix[8]]; @@ -4272,12 +4241,10 @@ define('Core/Matrix3',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix3.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 2) { - throw new DeveloperError('row must be 0, 1, or 2.'); - } - if (typeof column !== 'number' || column < 0 || column > 2) { - throw new DeveloperError('column must be 0, 1, or 2.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 2); + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 2); return column * 3 + row; }; @@ -4293,16 +4260,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var startIndex = index * 3; var x = matrix[startIndex]; @@ -4327,18 +4288,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); var startIndex = index * 3; @@ -4359,15 +4313,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 3]; @@ -4391,18 +4340,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); result[index] = cartesian.x; @@ -4421,12 +4363,8 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[3], matrix[4], matrix[5], scratchColumn)); @@ -4457,15 +4395,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var column0Row0 = left[0] * right[0] + left[3] * right[1] + left[6] * right[2]; var column0Row1 = left[1] * right[0] + left[4] * right[1] + left[7] * right[2]; @@ -4500,15 +4432,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -4531,15 +4457,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -4562,15 +4482,9 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -4595,15 +4509,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -4634,15 +4542,9 @@ define('Core/Matrix3',[ * @see Matrix3.multiplyByUniformScale */ Matrix3.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); result[0] = matrix[0] * scale.x; result[1] = matrix[1] * scale.x; @@ -4664,12 +4566,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -4691,12 +4589,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var column0Row0 = matrix[0]; var column0Row1 = matrix[3]; @@ -4836,9 +4730,7 @@ define('Core/Matrix3',[ * var c = Cesium.Cartesian3.multiplyByScalar(v, lambda, new Cesium.Cartesian3()); // equal to Cesium.Matrix3.multiplyByVector(a, v) */ Matrix3.computeEigenDecomposition = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); // This routine was created based upon Matrix Computations, 3rd ed., by Golub and Van Loan, // section 8.4.3 The Classical Jacobi Algorithm @@ -4882,12 +4774,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -4909,9 +4797,7 @@ define('Core/Matrix3',[ * @returns {Number} The value of the determinant of the matrix. */ Matrix3.determinant = function(matrix) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); var m11 = matrix[0]; var m21 = matrix[3]; @@ -4936,12 +4822,8 @@ define('Core/Matrix3',[ * @exception {DeveloperError} matrix is not invertible. */ Matrix3.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var m11 = matrix[0]; var m21 = matrix[1]; @@ -5007,9 +4889,7 @@ define('Core/Matrix3',[ * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. */ Matrix3.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -5197,12 +5077,14 @@ define('Core/Matrix3',[ /*global define*/ define('Core/Cartesian4',[ + './Check', './defaultValue', './defined', './DeveloperError', './freezeObject', './Math' ], function( + Check, defaultValue, defined, DeveloperError, @@ -5285,9 +5167,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.fromColor = function(color, result) { - if (!defined(color)) { - throw new DeveloperError('color is required'); - } + Check.typeOf.object('color', color); if (!defined(result)) { return new Cartesian4(color.red, color.green, color.blue, color.alpha); } @@ -5339,12 +5219,8 @@ define('Core/Cartesian4',[ * @returns {Number[]} The array that was packed into */ Cartesian4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5365,9 +5241,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5389,9 +5263,7 @@ define('Core/Cartesian4',[ * @returns {Number[]} The packed array. */ Cartesian4.packArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -5414,9 +5286,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4[]} The unpacked array. */ Cartesian4.unpackArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -5459,9 +5329,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the maximum component. */ Cartesian4.maximumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -5473,9 +5341,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the minimum component. */ Cartesian4.minimumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -5489,15 +5355,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the minimum components. */ Cartesian4.minimumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -5516,15 +5376,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the maximum components. */ Cartesian4.maximumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -5541,9 +5395,7 @@ define('Core/Cartesian4',[ * @returns {Number} The squared magnitude. */ Cartesian4.magnitudeSquared = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z + cartesian.w * cartesian.w; }; @@ -5574,9 +5426,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(2.0, 0.0, 0.0, 0.0)); */ Cartesian4.distance = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitude(distanceScratch); @@ -5597,9 +5448,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(3.0, 0.0, 0.0, 0.0)); */ Cartesian4.distanceSquared = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitudeSquared(distanceScratch); @@ -5613,12 +5463,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.normalize = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian4.magnitude(cartesian); @@ -5642,12 +5488,8 @@ define('Core/Cartesian4',[ * @returns {Number} The dot product. */ Cartesian4.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w; }; @@ -5661,15 +5503,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -5687,15 +5523,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x / right.x; result.y = left.y / right.y; @@ -5713,15 +5543,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -5739,15 +5563,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -5765,15 +5583,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -5791,15 +5603,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -5816,12 +5622,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.negate = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -5838,12 +5640,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.abs = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -5863,18 +5661,10 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian4.multiplyByScalar(end, t, lerpScratch); result = Cartesian4.multiplyByScalar(start, 1.0 - t, result); @@ -5890,12 +5680,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The most orthogonal axis. */ Cartesian4.mostOrthogonalAxis = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian4.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian4.abs(f, f); @@ -6140,6 +5926,7 @@ define('Core/RuntimeError',[ define('Core/Matrix4',[ './Cartesian3', './Cartesian4', + './Check', './defaultValue', './defined', './defineProperties', @@ -6151,6 +5938,7 @@ define('Core/Matrix4',[ ], function( Cartesian3, Cartesian4, + Check, defaultValue, defined, defineProperties, @@ -6241,13 +6029,8 @@ define('Core/Matrix4',[ * @returns {Number[]} The array that was packed into */ Matrix4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -6280,9 +6063,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if one was not provided. */ Matrix4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -6378,9 +6159,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required'); - } + Check.defined('values', values); return Matrix4.clone(values, result); }; @@ -6394,9 +6173,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix4(values[0], values[1], values[2], values[3], @@ -6433,9 +6210,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRotationTranslation = function(rotation, translation, result) { - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } + Check.typeOf.object('rotation', rotation); translation = defaultValue(translation, Cartesian3.ZERO); @@ -6483,15 +6258,9 @@ define('Core/Matrix4',[ * result); */ Matrix4.fromTranslationQuaternionRotationScale = function(translation, rotation, scale, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('translation', translation); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('scale', scale); if (!defined(result)) { result = new Matrix4(); @@ -6552,9 +6321,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromTranslationRotationScale = function(translationRotationScale, result) { - if (!defined(translationRotationScale)) { - throw new DeveloperError('translationRotationScale is required.'); - } + Check.typeOf.object('translationRotationScale', translationRotationScale); return Matrix4.fromTranslationQuaternionRotationScale(translationRotationScale.translation, translationRotationScale.rotation, translationRotationScale.scale, result); }; @@ -6569,9 +6336,7 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByTranslation */ Matrix4.fromTranslation = function(translation, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } + Check.typeOf.object('translation', translation); return Matrix4.fromRotationTranslation(Matrix3.IDENTITY, translation, result); }; @@ -6592,9 +6357,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix4.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix4( @@ -6639,9 +6402,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromUniformScale(2.0); */ Matrix4.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix4(scale, 0.0, 0.0, 0.0, @@ -6681,23 +6442,15 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromCamera = function(camera, result) { - if (!defined(camera)) { - throw new DeveloperError('camera is required.'); - } + Check.typeOf.object('camera', camera); var position = camera.position; var direction = camera.direction; var up = camera.up; - if (!defined(position)) { - throw new DeveloperError('camera.position is required.'); - } - if (!defined(direction)) { - throw new DeveloperError('camera.direction is required.'); - } - if (!defined(up)) { - throw new DeveloperError('camera.up is required.'); - } + Check.typeOf.object('camera.position', position); + Check.typeOf.object('camera.direction', direction); + Check.typeOf.object('camera.up', up); Cartesian3.normalize(direction, fromCameraF); Cartesian3.normalize(Cartesian3.cross(fromCameraF, up, fromCameraR), fromCameraR); @@ -6776,21 +6529,11 @@ define('Core/Matrix4',[ * @exception {DeveloperError} far must be greater than zero. */ Matrix4.computePerspectiveFieldOfView = function(fovY, aspectRatio, near, far, result) { - if (fovY <= 0.0 || fovY > Math.PI) { - throw new DeveloperError('fovY must be in (0, PI].'); - } - if (aspectRatio <= 0.0) { - throw new DeveloperError('aspectRatio must be greater than zero.'); - } - if (near <= 0.0) { - throw new DeveloperError('near must be greater than zero.'); - } - if (far <= 0.0) { - throw new DeveloperError('far must be greater than zero.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThan('fovY', fovY, 0.0); + Check.typeOf.number.lessThan('fovY', fovY, Math.PI); + Check.typeOf.number.greaterThan('near', near, 0.0); + Check.typeOf.number.greaterThan('far', far, 0.0); + Check.typeOf.object('result', result); var bottom = Math.tan(fovY * 0.5); @@ -6831,27 +6574,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeOrthographicOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var a = 1.0 / (right - left); var b = 1.0 / (top - bottom); @@ -6896,27 +6625,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computePerspectiveOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -6957,24 +6672,12 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeInfinitePerspectiveOffCenter = function(left, right, bottom, top, near, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -7022,9 +6725,7 @@ define('Core/Matrix4',[ * }, 0.0, 1.0, new Cesium.Matrix4()); */ Matrix4.computeViewportTransformation = function(viewport, nearDepthRange, farDepthRange, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); viewport = defaultValue(viewport, defaultValue.EMPTY_OBJECT); var x = defaultValue(viewport.x, 0.0); @@ -7076,21 +6777,11 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeView = function(position, direction, up, right, result) { - if (!defined(position)) { - throw new DeveloperError('position is required'); - } - if (!defined(direction)) { - throw new DeveloperError('direction is required'); - } - if (!defined(up)) { - throw new DeveloperError('up is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); + Check.typeOf.object('up', up); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = right.x; result[1] = up.x; @@ -7131,9 +6822,7 @@ define('Core/Matrix4',[ * //creates a = [10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0] */ Matrix4.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], @@ -7177,12 +6866,11 @@ define('Core/Matrix4',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix4.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 3) { - throw new DeveloperError('row must be 0, 1, 2, or 3.'); - } - if (typeof column !== 'number' || column < 0 || column > 3) { - throw new DeveloperError('column must be 0, 1, 2, or 3.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 3); + + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 3); return column * 4 + row; }; @@ -7215,16 +6903,12 @@ define('Core/Matrix4',[ * // a.x = 12.0; a.y = 16.0; a.z = 20.0; a.w = 24.0; */ Matrix4.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var startIndex = index * 4; var x = matrix[startIndex]; @@ -7266,18 +6950,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 96.0, 25.0] */ Matrix4.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); var startIndex = index * 4; @@ -7298,15 +6977,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.setTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -7359,16 +7032,12 @@ define('Core/Matrix4',[ * // a.x = 18.0; a.y = 19.0; a.z = 20.0; a.w = 21.0; */ Matrix4.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 4]; @@ -7409,18 +7078,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 24.0, 25.0] */ Matrix4.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); result[index] = cartesian.x; @@ -7440,12 +7104,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter */ Matrix4.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[4], matrix[5], matrix[6], scratchColumn)); @@ -7477,15 +7137,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -7569,15 +7223,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -7607,15 +7255,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -7656,15 +7298,9 @@ define('Core/Matrix4',[ * var m3 = Cesium.Matrix4.multiplyTransformation(m1, m2, new Cesium.Matrix4()); */ Matrix4.multiplyTransformation = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -7742,15 +7378,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByMatrix3(m, rotation, m); */ Matrix4.multiplyByMatrix3 = function(matrix, rotation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('result', result); var left0 = matrix[0]; var left1 = matrix[1]; @@ -7818,15 +7448,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByTranslation(m, position, m); */ Matrix4.multiplyByTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); var x = translation.x; var y = translation.y; @@ -7878,15 +7502,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByScale */ Matrix4.multiplyByUniformScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scale', scale); + Check.typeOf.object('result', result); uniformScaleScratch.x = scale; uniformScaleScratch.y = scale; @@ -7915,15 +7533,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByUniformScale */ Matrix4.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); var scaleX = scale.x; var scaleY = scale.y; @@ -7962,15 +7574,9 @@ define('Core/Matrix4',[ * @returns {Cartesian4} The modified result parameter. */ Matrix4.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8006,15 +7612,9 @@ define('Core/Matrix4',[ * // Cesium.Matrix4.multiplyByVector(matrix, new Cesium.Cartesian4(p.x, p.y, p.z, 0.0), result); */ Matrix4.multiplyByPointAsVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8044,16 +7644,9 @@ define('Core/Matrix4',[ * var result = Cesium.Matrix4.multiplyByPoint(matrix, p, new Cesium.Cartesian3()); */ Matrix4.multiplyByPoint = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8093,15 +7686,9 @@ define('Core/Matrix4',[ * // [-44.0, -46.0, -48.0, -50.0] */ Matrix4.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -8145,12 +7732,8 @@ define('Core/Matrix4',[ * // [-22.0, -23.0, -24.0, -25.0] */ Matrix4.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -8194,12 +7777,8 @@ define('Core/Matrix4',[ * // [13.0, 17.0, 21.0, 25.0] */ Matrix4.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var matrix1 = matrix[1]; var matrix2 = matrix[2]; @@ -8235,12 +7814,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -8354,9 +7929,7 @@ define('Core/Matrix4',[ * //Prints "Difference between both the matrices is not less than 0.1" on the console */ Matrix4.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -8386,13 +7959,9 @@ define('Core/Matrix4',[ * @param {Cartesian3} result The object onto which to store the result. * @returns {Cartesian3} The modified result parameter. */ - Matrix4.getTranslation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Matrix4.getTranslation = function(matrix, result) { + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = matrix[12]; result.y = matrix[13]; @@ -8423,12 +7992,8 @@ define('Core/Matrix4',[ * // [12.0, 16.0, 20.0] */ Matrix4.getRotation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -8460,12 +8025,8 @@ define('Core/Matrix4',[ * @exception {RuntimeError} matrix is not invertible because its determinate is zero. */ Matrix4.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); // Special case for a zero scale matrix that can occur, for example, // when a model's node has a [0, 0, 0] scale. @@ -8603,12 +8164,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.inverseTransformation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); //This function is an optimized version of the below 4 lines. //var rT = Matrix3.transpose(Matrix4.getRotation(matrix)); @@ -8892,6 +8449,7 @@ define('Core/Matrix4',[ /*global define*/ define('Core/Rectangle',[ './Cartographic', + './Check', './defaultValue', './defined', './defineProperties', @@ -8901,6 +8459,7 @@ define('Core/Rectangle',[ './Math' ], function( Cartographic, + Check, defaultValue, defined, defineProperties, @@ -8997,13 +8556,8 @@ define('Core/Rectangle',[ * @returns {Number[]} The array that was packed into */ Rectangle.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -9024,9 +8578,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -9047,9 +8599,7 @@ define('Core/Rectangle',[ * @returns {Number} The width. */ Rectangle.computeWidth = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; if (east < west) { @@ -9064,9 +8614,7 @@ define('Core/Rectangle',[ * @returns {Number} The height. */ Rectangle.computeHeight = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); return rectangle.north - rectangle.south; }; @@ -9101,6 +8649,32 @@ define('Core/Rectangle',[ return result; }; + /** + * Creates an rectangle given the boundary longitude and latitude in radians. + * + * @param {Number} [west=0.0] The westernmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [south=0.0] The southernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Number} [east=0.0] The easternmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [north=0.0] The northernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Rectangle} [result] The object onto which to store the result, or undefined if a new instance should be created. + * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. + * + * @example + * var rectangle = Cesium.Rectangle.fromRadians(0.0, Math.PI/4, Math.PI/8, 3*Math.PI/4); + */ + Rectangle.fromRadians = function(west, south, east, north, result) { + if (!defined(result)) { + return new Rectangle(west, south, east, north); + } + + result.west = defaultValue(west, 0.0); + result.south = defaultValue(south, 0.0); + result.east = defaultValue(east, 0.0); + result.north = defaultValue(north, 0.0); + + return result; + }; + /** * Creates the smallest possible Rectangle that encloses all positions in the provided array. * @@ -9109,9 +8683,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartographicArray = function(cartographics, result) { - if (!defined(cartographics)) { - throw new DeveloperError('cartographics is required.'); - } + Check.defined('cartographics', cartographics); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -9164,9 +8736,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartesianArray = function(cartesians, ellipsoid, result) { - if (!defined(cartesians)) { - throw new DeveloperError('cartesians is required.'); - } + Check.defined('cartesians', cartesians); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -9282,9 +8852,7 @@ define('Core/Rectangle',[ * @returns {Boolean} <code>true</code> if the Rectangles are within the provided epsilon, <code>false</code> otherwise. */ Rectangle.prototype.equalsEpsilon = function(other, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon is required and must be a number.'); - } + Check.typeOf.number('epsilon', epsilon); return defined(other) && (Math.abs(this.west - other.west) <= epsilon) && @@ -9304,45 +8872,23 @@ define('Core/Rectangle',[ * @exception {DeveloperError} <code>west</code> must be in the interval [<code>-Pi</code>, <code>Pi</code>]. */ Rectangle.validate = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var north = rectangle.north; - if (typeof north !== 'number') { - throw new DeveloperError('north is required to be a number.'); - } - - if (north < -CesiumMath.PI_OVER_TWO || north > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('north must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('north', north, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('north', north, CesiumMath.PI_OVER_TWO); var south = rectangle.south; - if (typeof south !== 'number') { - throw new DeveloperError('south is required to be a number.'); - } - - if (south < -CesiumMath.PI_OVER_TWO || south > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('south must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('south', south, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('south', south, CesiumMath.PI_OVER_TWO); var west = rectangle.west; - if (typeof west !== 'number') { - throw new DeveloperError('west is required to be a number.'); - } - - if (west < -Math.PI || west > Math.PI) { - throw new DeveloperError('west must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('west', west, -Math.PI); + Check.typeOf.number.lessThanOrEquals('west', west, Math.PI); var east = rectangle.east; - if (typeof east !== 'number') { - throw new DeveloperError('east is required to be a number.'); - } - - if (east < -Math.PI || east > Math.PI) { - throw new DeveloperError('east must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('east', east, -Math.PI); + Check.typeOf.number.lessThanOrEquals('east', east, Math.PI); }; /** @@ -9353,9 +8899,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.south); @@ -9374,9 +8918,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.north); @@ -9395,9 +8937,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.north); @@ -9416,9 +8956,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.south); @@ -9437,9 +8975,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.center = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; @@ -9474,12 +9010,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.intersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var rectangleEast = rectangle.east; var rectangleWest = rectangle.west; @@ -9535,12 +9067,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.simpleIntersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var west = Math.max(rectangle.west, otherRectangle.west); var south = Math.max(rectangle.south, otherRectangle.south); @@ -9571,12 +9099,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.union = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); if (!defined(result)) { result = new Rectangle(); @@ -9620,12 +9144,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.expand = function(rectangle, cartographic, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); if (!defined(result)) { result = new Rectangle(); @@ -9647,12 +9167,8 @@ define('Core/Rectangle',[ * @returns {Boolean} true if the provided cartographic is inside the rectangle, false otherwise. */ Rectangle.contains = function(rectangle, cartographic) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); var longitude = cartographic.longitude; var latitude = cartographic.latitude; @@ -9685,9 +9201,7 @@ define('Core/Rectangle',[ * @returns {Cartesian3[]} The modified result parameter or a new Array of Cartesians instances if none was provided. */ Rectangle.subsample = function(rectangle, ellipsoid, surfaceHeight, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84); surfaceHeight = defaultValue(surfaceHeight, 0.0); @@ -9765,9 +9279,9 @@ define('Core/Rectangle',[ define('Core/BoundingSphere',[ './Cartesian3', './Cartographic', + './Check', './defaultValue', './defined', - './DeveloperError', './Ellipsoid', './GeographicProjection', './Intersect', @@ -9778,9 +9292,9 @@ define('Core/BoundingSphere',[ ], function( Cartesian3, Cartographic, + Check, defaultValue, defined, - DeveloperError, Ellipsoid, GeographicProjection, Intersect, @@ -10110,9 +9624,7 @@ define('Core/BoundingSphere',[ stride = defaultValue(stride, 3); - if (stride < 3) { - throw new DeveloperError('stride must be 3 or greater.'); - } + Check.typeOf.number.greaterThanOrEquals('stride', stride, 3); var currentPos = fromPointsCurrentPos; currentPos.x = positions[0] + center.x; @@ -10416,9 +9928,8 @@ define('Core/BoundingSphere',[ * var sphere = Cesium.BoundingSphere.fromCornerPoints(new Cesium.Cartesian3(-0.5, -0.5, -0.5), new Cesium.Cartesian3(0.5, 0.5, 0.5)); */ BoundingSphere.fromCornerPoints = function(corner, oppositeCorner, result) { - if (!defined(corner) || !defined(oppositeCorner)) { - throw new DeveloperError('corner and oppositeCorner are required.'); - } + Check.typeOf.object('corner', corner); + Check.typeOf.object('oppositeCorner', oppositeCorner); if (!defined(result)) { result = new BoundingSphere(); @@ -10442,9 +9953,7 @@ define('Core/BoundingSphere',[ * var boundingSphere = Cesium.BoundingSphere.fromEllipsoid(ellipsoid); */ BoundingSphere.fromEllipsoid = function(ellipsoid, result) { - if (!defined(ellipsoid)) { - throw new DeveloperError('ellipsoid is required.'); - } + Check.typeOf.object('ellipsoid', ellipsoid); if (!defined(result)) { result = new BoundingSphere(); @@ -10570,13 +10079,8 @@ define('Core/BoundingSphere',[ * @returns {Number[]} The array that was packed into */ BoundingSphere.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -10598,9 +10102,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if one was not provided. */ BoundingSphere.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -10627,13 +10129,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.union = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); if (!defined(result)) { result = new BoundingSphere(); @@ -10682,13 +10179,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.expand = function(sphere, point, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(point)) { - throw new DeveloperError('point is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('point', point); result = BoundingSphere.clone(sphere, result); @@ -10711,13 +10203,8 @@ define('Core/BoundingSphere',[ * intersects the plane. */ BoundingSphere.intersectPlane = function(sphere, plane) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(plane)) { - throw new DeveloperError('plane is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('plane', plane); var center = sphere.center; var radius = sphere.radius; @@ -10743,13 +10230,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.transform = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -10777,12 +10259,8 @@ define('Core/BoundingSphere',[ * }); */ BoundingSphere.distanceSquaredTo = function(sphere, cartesian) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('cartesian', cartesian); var diff = Cartesian3.subtract(sphere.center, cartesian, distanceSquaredToScratch); return Cartesian3.magnitudeSquared(diff) - sphere.radius * sphere.radius; @@ -10804,13 +10282,8 @@ define('Core/BoundingSphere',[ * var newBoundingSphere = Cesium.BoundingSphere.transformWithoutScale(boundingSphere, modelMatrix); */ BoundingSphere.transformWithoutScale = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -10837,17 +10310,9 @@ define('Core/BoundingSphere',[ * @returns {Interval} The nearest and farthest distances on the bounding sphere from position in direction. */ BoundingSphere.computePlaneDistances = function(sphere, position, direction, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(position)) { - throw new DeveloperError('position is required.'); - } - - if (!defined(direction)) { - throw new DeveloperError('direction is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); if (!defined(result)) { result = new Interval(); @@ -10882,9 +10347,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.projectTo2D = function(sphere, projection, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } + Check.typeOf.object('sphere', sphere); projection = defaultValue(projection, projectTo2DProjection); @@ -10979,12 +10442,8 @@ define('Core/BoundingSphere',[ * @returns {Boolean} <code>true</code> if the sphere is not visible; otherwise <code>false</code>. */ BoundingSphere.isOccluded = function(sphere, occluder) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(occluder)) { - throw new DeveloperError('occluder is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('occluder', occluder); return !occluder.isBoundingSphereVisible(sphere); }; @@ -11085,12 +10544,14 @@ define('Core/BoundingSphere',[ /*global define*/ define('Core/Cartesian2',[ + './Check', './defaultValue', './defined', './DeveloperError', './freezeObject', './Math' ], function( + Check, defaultValue, defined, DeveloperError, @@ -11202,12 +10663,8 @@ define('Core/Cartesian2',[ * @returns {Number[]} The array that was packed into */ Cartesian2.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -11226,9 +10683,7 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided. */ Cartesian2.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -11248,9 +10703,7 @@ define('Core/Cartesian2',[ * @returns {Number[]} The packed array. */ Cartesian2.packArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -11273,9 +10726,7 @@ define('Core/Cartesian2',[ * @returns {Cartesian2[]} The unpacked array. */ Cartesian2.unpackArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -11318,9 +10769,7 @@ define('Core/Cartesian2',[ * @returns {Number} The value of the maximum component. */ Cartesian2.maximumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y); }; @@ -11332,9 +10781,7 @@ define('Core/Cartesian2',[ * @returns {Number} The value of the minimum component. */ Cartesian2.minimumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y); }; @@ -11348,15 +10795,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} A cartesian with the minimum components. */ Cartesian2.minimumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); @@ -11374,15 +10815,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} A cartesian with the maximum components. */ Cartesian2.maximumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -11396,9 +10831,7 @@ define('Core/Cartesian2',[ * @returns {Number} The squared magnitude. */ Cartesian2.magnitudeSquared = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y; }; @@ -11464,12 +10897,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.normalize = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian2.magnitude(cartesian); @@ -11491,12 +10920,8 @@ define('Core/Cartesian2',[ * @returns {Number} The dot product. */ Cartesian2.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y; }; @@ -11510,15 +10935,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.multiplyComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -11534,15 +10953,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.divideComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x / right.x; result.y = left.y / right.y; @@ -11558,15 +10971,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -11582,15 +10989,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -11606,15 +11007,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.multiplyByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -11630,15 +11025,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.divideByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -11653,12 +11042,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.negate = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -11673,12 +11058,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.abs = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -11696,18 +11077,10 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian2.multiplyByScalar(end, t, lerpScratch); result = Cartesian2.multiplyByScalar(start, 1.0 - t, result); @@ -11724,12 +11097,8 @@ define('Core/Cartesian2',[ * @returns {Number} The angle between the Cartesians. */ Cartesian2.angleBetween = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian2.normalize(left, angleBetweenScratch); Cartesian2.normalize(right, angleBetweenScratch2); @@ -11745,12 +11114,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The most orthogonal axis. */ Cartesian2.mostOrthogonalAxis = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian2.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian2.abs(f, f); @@ -12988,7 +12353,10 @@ define('Core/WebGLConstants',[ COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : 0x9279, TEXTURE_IMMUTABLE_FORMAT : 0x912F, MAX_ELEMENT_INDEX : 0x8D6B, - TEXTURE_IMMUTABLE_LEVELS : 0x82DF + TEXTURE_IMMUTABLE_LEVELS : 0x82DF, + + // Extensions + MAX_TEXTURE_MAX_ANISOTROPY_EXT : 0x84FF }; return freezeObject(WebGLConstants); @@ -13579,7 +12947,7 @@ define('Core/Geometry',[ * <li><code>position</code> - 3D vertex position. 64-bit floating-point (for precision). 3 components per attribute. See {@link VertexFormat#position}.</li> * <li><code>normal</code> - Normal (normalized), commonly used for lighting. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#normal}.</li> * <li><code>st</code> - 2D texture coordinate. 32-bit floating-point. 2 components per attribute. See {@link VertexFormat#st}.</li> - * <li><code>binormal</code> - Binormal (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#binormal}.</li> + * <li><code>bitangent</code> - Bitangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#bitangent}.</li> * <li><code>tangent</code> - Tangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#tangent}.</li> * </ul> * </p> @@ -13608,7 +12976,7 @@ define('Core/Geometry',[ * componentsPerAttribute : 3, * values : new Float32Array(0) * }); - * + * * @see GeometryAttribute * @see VertexFormat */ @@ -13889,7 +13257,7 @@ define('Core/GeometryAttributes',[ this.st = options.st; /** - * The binormal attribute (normalized), which is used for tangent-space effects like bump mapping. + * The bitangent attribute (normalized), which is used for tangent-space effects like bump mapping. * <p> * 32-bit floating-point. 3 components per attribute. * </p> @@ -13898,7 +13266,7 @@ define('Core/GeometryAttributes',[ * * @default undefined */ - this.binormal = options.binormal; + this.bitangent = options.bitangent; /** * The tangent attribute (normalized), which is used for tangent-space effects like bump mapping. @@ -14147,7 +13515,7 @@ define('Core/VertexFormat',[ this.st = defaultValue(options.st, false); /** - * When <code>true</code>, the vertex has a binormal attribute (normalized), which is used for tangent-space effects like bump mapping. + * When <code>true</code>, the vertex has a bitangent attribute (normalized), which is used for tangent-space effects like bump mapping. * <p> * 32-bit floating-point. 3 components per attribute. * </p> @@ -14156,7 +13524,7 @@ define('Core/VertexFormat',[ * * @default false */ - this.binormal = defaultValue(options.binormal, false); + this.bitangent = defaultValue(options.bitangent, false); /** * When <code>true</code>, the vertex has a tangent attribute (normalized), which is used for tangent-space effects like bump mapping. @@ -14258,7 +13626,7 @@ define('Core/VertexFormat',[ })); /** - * An immutable vertex format with well-known attributes: position, normal, st, binormal, and tangent. + * An immutable vertex format with well-known attributes: position, normal, st, tangent, and bitangent. * * @type {VertexFormat} * @constant @@ -14266,15 +13634,15 @@ define('Core/VertexFormat',[ * @see VertexFormat#position * @see VertexFormat#normal * @see VertexFormat#st - * @see VertexFormat#binormal * @see VertexFormat#tangent + * @see VertexFormat#bitangent */ VertexFormat.ALL = freezeObject(new VertexFormat({ position : true, normal : true, st : true, - binormal : true, - tangent : true + tangent : true, + bitangent : true })); /** @@ -14319,8 +13687,8 @@ define('Core/VertexFormat',[ array[startingIndex++] = value.position ? 1.0 : 0.0; array[startingIndex++] = value.normal ? 1.0 : 0.0; array[startingIndex++] = value.st ? 1.0 : 0.0; - array[startingIndex++] = value.binormal ? 1.0 : 0.0; array[startingIndex++] = value.tangent ? 1.0 : 0.0; + array[startingIndex++] = value.bitangent ? 1.0 : 0.0; array[startingIndex++] = value.color ? 1.0 : 0.0; return array; @@ -14345,19 +13713,19 @@ define('Core/VertexFormat',[ result = new VertexFormat(); } - result.position = array[startingIndex++] === 1.0; - result.normal = array[startingIndex++] === 1.0; - result.st = array[startingIndex++] === 1.0; - result.binormal = array[startingIndex++] === 1.0; - result.tangent = array[startingIndex++] === 1.0; - result.color = array[startingIndex++] === 1.0; + result.position = array[startingIndex++] === 1.0; + result.normal = array[startingIndex++] === 1.0; + result.st = array[startingIndex++] === 1.0; + result.tangent = array[startingIndex++] === 1.0; + result.bitangent = array[startingIndex++] === 1.0; + result.color = array[startingIndex++] === 1.0; return result; }; /** * Duplicates a VertexFormat instance. * - * @param {VertexFormat} cartesian The vertex format to duplicate. + * @param {VertexFormat} vertexFormat The vertex format to duplicate. * @param {VertexFormat} [result] The object onto which to store the result. * @returns {VertexFormat} The modified result parameter or a new VertexFormat instance if one was not provided. (Returns undefined if vertexFormat is undefined) */ @@ -14372,8 +13740,8 @@ define('Core/VertexFormat',[ result.position = vertexFormat.position; result.normal = vertexFormat.normal; result.st = vertexFormat.st; - result.binormal = vertexFormat.binormal; result.tangent = vertexFormat.tangent; + result.bitangent = vertexFormat.bitangent; result.color = vertexFormat.color; return result; }; @@ -14418,7 +13786,7 @@ define('Core/CylinderGeometry',[ var radiusScratch = new Cartesian2(); var normalScratch = new Cartesian3(); - var binormalScratch = new Cartesian3(); + var bitangentScratch = new Cartesian3(); var tangentScratch = new Cartesian3(); var positionScratch = new Cartesian3(); @@ -14594,22 +13962,22 @@ define('Core/CylinderGeometry',[ var st = (vertexFormat.st) ? new Float32Array(numVertices * 2) : undefined; var normals = (vertexFormat.normal) ? new Float32Array(numVertices * 3) : undefined; var tangents = (vertexFormat.tangent) ? new Float32Array(numVertices * 3) : undefined; - var binormals = (vertexFormat.binormal) ? new Float32Array(numVertices * 3) : undefined; + var bitangents = (vertexFormat.bitangent) ? new Float32Array(numVertices * 3) : undefined; var i; - var computeNormal = (vertexFormat.normal || vertexFormat.tangent || vertexFormat.binormal); + var computeNormal = (vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent); if (computeNormal) { - var computeTangent = (vertexFormat.tangent || vertexFormat.binormal); + var computeTangent = (vertexFormat.tangent || vertexFormat.bitangent); var normalIndex = 0; var tangentIndex = 0; - var binormalIndex = 0; + var bitangentIndex = 0; var normal = normalScratch; normal.z = 0; var tangent = tangentScratch; - var binormal = binormalScratch; + var bitangent = bitangentScratch; for (i = 0; i < slices; i++) { var angle = i / slices * CesiumMath.TWO_PI; @@ -14641,14 +14009,14 @@ define('Core/CylinderGeometry',[ tangents[tangentIndex++] = tangent.z; } - if (vertexFormat.binormal) { - binormal = Cartesian3.normalize(Cartesian3.cross(normal, tangent, binormal), binormal); - binormals[binormalIndex++] = binormal.x; - binormals[binormalIndex++] = binormal.y; - binormals[binormalIndex++] = binormal.z; - binormals[binormalIndex++] = binormal.x; - binormals[binormalIndex++] = binormal.y; - binormals[binormalIndex++] = binormal.z; + if (vertexFormat.bitangent) { + bitangent = Cartesian3.normalize(Cartesian3.cross(normal, tangent, bitangent), bitangent); + bitangents[bitangentIndex++] = bitangent.x; + bitangents[bitangentIndex++] = bitangent.y; + bitangents[bitangentIndex++] = bitangent.z; + bitangents[bitangentIndex++] = bitangent.x; + bitangents[bitangentIndex++] = bitangent.y; + bitangents[bitangentIndex++] = bitangent.z; } } } @@ -14664,10 +14032,10 @@ define('Core/CylinderGeometry',[ tangents[tangentIndex++] = 0; tangents[tangentIndex++] = 0; } - if (vertexFormat.binormal) { - binormals[binormalIndex++] = 0; - binormals[binormalIndex++] = -1; - binormals[binormalIndex++] = 0; + if (vertexFormat.bitangent) { + bitangents[bitangentIndex++] = 0; + bitangents[bitangentIndex++] = -1; + bitangents[bitangentIndex++] = 0; } } @@ -14682,10 +14050,10 @@ define('Core/CylinderGeometry',[ tangents[tangentIndex++] = 0; tangents[tangentIndex++] = 0; } - if (vertexFormat.binormal) { - binormals[binormalIndex++] = 0; - binormals[binormalIndex++] = 1; - binormals[binormalIndex++] = 0; + if (vertexFormat.bitangent) { + bitangents[bitangentIndex++] = 0; + bitangents[bitangentIndex++] = 1; + bitangents[bitangentIndex++] = 0; } } } @@ -14760,11 +14128,11 @@ define('Core/CylinderGeometry',[ }); } - if (vertexFormat.binormal) { - attributes.binormal = new GeometryAttribute({ + if (vertexFormat.bitangent) { + attributes.bitangent = new GeometryAttribute({ componentDatatype : ComponentDatatype.FLOAT, componentsPerAttribute : 3, - values : binormals + values : bitangents }); } diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createCylinderOutlineGeometry.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createCylinderOutlineGeometry.js index eaadd5ad..51ca1b86 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createCylinderOutlineGeometry.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createCylinderOutlineGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,68 +45,6 @@ define('Core/defined',[],function() { return defined; }); -/*global define*/ -define('Core/freezeObject',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Freezes an object, using Object.freeze if available, otherwise returns - * the object unchanged. This function should be used in setup code to prevent - * errors from completely halting JavaScript execution in legacy browsers. - * - * @private - * - * @exports freezeObject - */ - var freezeObject = Object.freeze; - if (!defined(freezeObject)) { - freezeObject = function(o) { - return o; - }; - } - - return freezeObject; -}); - -/*global define*/ -define('Core/defaultValue',[ - './freezeObject' - ], function( - freezeObject) { - 'use strict'; - - /** - * Returns the first parameter if not undefined, otherwise the second parameter. - * Useful for setting a default value for a parameter. - * - * @exports defaultValue - * - * @param {*} a - * @param {*} b - * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter. - * - * @example - * param = Cesium.defaultValue(param, 'default'); - */ - function defaultValue(a, b) { - if (a !== undefined) { - return a; - } - return b; - } - - /** - * A frozen empty object that can be used as the default value for options passed as - * an object literal. - */ - defaultValue.EMPTY_OBJECT = freezeObject({}); - - return defaultValue; -}); - /*global define*/ define('Core/DeveloperError',[ './defined' @@ -188,41 +126,13 @@ define('Core/DeveloperError',[ return DeveloperError; }); -/*global define*/ -define('Core/isArray',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Tests an object to see if it is an array. - * @exports isArray - * - * @param {Object} value The value to test. - * @returns {Boolean} true if the value is an array, false otherwise. - */ - var isArray = Array.isArray; - if (!defined(isArray)) { - isArray = function(value) { - return Object.prototype.toString.call(value) === '[object Array]'; - }; - } - - return isArray; -}); - /*global define*/ define('Core/Check',[ - './defaultValue', - './defined', - './DeveloperError', - './isArray' + './defined', + './DeveloperError' ], function( - defaultValue, defined, - DeveloperError, - isArray) { + DeveloperError) { 'use strict'; /** @@ -237,111 +147,134 @@ define('Core/Check',[ */ Check.typeOf = {}; - /** - * Contains functions for checking numeric conditions such as minimum and maximum values - */ - Check.numeric = {}; - function getUndefinedErrorMessage(name) { - return name + ' was required but undefined.'; + return name + ' is required, actual value was undefined'; } function getFailedTypeErrorMessage(actual, expected, name) { - return 'Expected ' + name + ' to be typeof ' + expected + ', got ' + actual; + return 'Expected ' + name + ' to be typeof ' + expected + ', actual typeof was ' + actual; } /** * Throws if test is not defined * - * @param {*} test The value that is to be checked * @param {String} name The name of the variable being tested + * @param {*} test The value that is to be checked * @exception {DeveloperError} test must be defined */ - Check.defined = function (test, name) { + Check.defined = function (name, test) { if (!defined(test)) { throw new DeveloperError(getUndefinedErrorMessage(name)); } }; /** - * Throws if test is greater than maximum + * Throws if test is not typeof 'function' * - * @param {Number} test The value to test - * @param {Number} maximum The maximum allowed value - * @exception {DeveloperError} test must not be greater than maximum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'function' */ - Check.numeric.maximum = function (test, maximum) { - Check.typeOf.number(test); - Check.typeOf.number(maximum); - if (test > maximum) { - throw new DeveloperError('Expected ' + test + ' to be at most ' + maximum); + Check.typeOf.func = function (name, test) { + if (typeof test !== 'function') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); } }; /** - * Throws if test is less than minimum + * Throws if test is not typeof 'string' * - * @param {Number} test The value to test - * @param {Number} minimum The minimum allowed value - * @exception {DeveloperError} test must not be less than mininum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'string' */ - Check.numeric.minimum = function (test, minimum) { - Check.typeOf.number(test); - Check.typeOf.number(minimum); - if (test < minimum) { - throw new DeveloperError('Expected ' + test + ' to be at least ' + minimum); + Check.typeOf.string = function (name, test) { + if (typeof test !== 'string') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); } }; /** - * Throws if test is not typeof 'function' + * Throws if test is not typeof 'number' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'function' + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'number' */ - Check.typeOf.function = function (test, name) { - if (typeof test !== 'function') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); + Check.typeOf.number = function (name, test) { + if (typeof test !== 'number') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); } }; /** - * Throws if test is not typeof 'string' + * Throws if test is not typeof 'number' and less than limit * + * @param {String} name The name of the variable being tested * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than limit + */ + Check.typeOf.number.lessThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test >= limit) { + throw new DeveloperError('Expected ' + name + ' to be less than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and less than or equal to limit + * * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'string' + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than or equal to limit */ - Check.typeOf.string = function (test, name) { - if (typeof test !== 'string') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); + Check.typeOf.number.lessThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test > limit) { + throw new DeveloperError('Expected ' + name + ' to be less than or equal to ' + limit + ', actual value was ' + test); } }; /** - * Throws if test is not typeof 'number' + * Throws if test is not typeof 'number' and greater than limit * + * @param {String} name The name of the variable being tested * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than limit + */ + Check.typeOf.number.greaterThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test <= limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and greater than or equal to limit + * * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'number' + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than or equal to limit */ - Check.typeOf.number = function (test, name) { - if (typeof test !== 'number') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); + Check.typeOf.number.greaterThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test < limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than or equal to' + limit + ', actual value was ' + test); } }; /** * Throws if test is not typeof 'object' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested + * @param {*} test The value to test * @exception {DeveloperError} test must be typeof 'object' */ - Check.typeOf.object = function (test, name) { + Check.typeOf.object = function (name, test) { if (typeof test !== 'object') { throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'object', name)); } @@ -350,11 +283,11 @@ define('Core/Check',[ /** * Throws if test is not typeof 'boolean' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested + * @param {*} test The value to test * @exception {DeveloperError} test must be typeof 'boolean' */ - Check.typeOf.boolean = function (test, name) { + Check.typeOf.bool = function (name, test) { if (typeof test !== 'boolean') { throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'boolean', name)); } @@ -363,6 +296,68 @@ define('Core/Check',[ return Check; }); +/*global define*/ +define('Core/freezeObject',[ + './defined' + ], function( + defined) { + 'use strict'; + + /** + * Freezes an object, using Object.freeze if available, otherwise returns + * the object unchanged. This function should be used in setup code to prevent + * errors from completely halting JavaScript execution in legacy browsers. + * + * @private + * + * @exports freezeObject + */ + var freezeObject = Object.freeze; + if (!defined(freezeObject)) { + freezeObject = function(o) { + return o; + }; + } + + return freezeObject; +}); + +/*global define*/ +define('Core/defaultValue',[ + './freezeObject' + ], function( + freezeObject) { + 'use strict'; + + /** + * Returns the first parameter if not undefined, otherwise the second parameter. + * Useful for setting a default value for a parameter. + * + * @exports defaultValue + * + * @param {*} a + * @param {*} b + * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter. + * + * @example + * param = Cesium.defaultValue(param, 'default'); + */ + function defaultValue(a, b) { + if (a !== undefined) { + return a; + } + return b; + } + + /** + * A frozen empty object that can be used as the default value for options passed as + * an object literal. + */ + defaultValue.EMPTY_OBJECT = freezeObject({}); + + return defaultValue; +}); + /* I've wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace so it's better encapsulated. Now you can have multiple random number generators @@ -1047,7 +1042,7 @@ define('Core/Math',[ if (!defined(angle)) { throw new DeveloperError('angle is required.'); } - + return CesiumMath.clamp(angle, -1*CesiumMath.PI_OVER_TWO, CesiumMath.PI_OVER_TWO); }; @@ -1057,11 +1052,11 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [<code>-CesiumMath.PI</code>, <code>CesiumMath.PI</code>]. */ - CesiumMath.negativePiToPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.negativePiToPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - return CesiumMath.zeroToTwoPi(x + CesiumMath.PI) - CesiumMath.PI; + return CesiumMath.zeroToTwoPi(angle + CesiumMath.PI) - CesiumMath.PI; }; /** @@ -1070,12 +1065,12 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [0, <code>CesiumMath.TWO_PI</code>]. */ - CesiumMath.zeroToTwoPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.zeroToTwoPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - var mod = CesiumMath.mod(x, CesiumMath.TWO_PI); - if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(x) > CesiumMath.EPSILON14) { + var mod = CesiumMath.mod(angle, CesiumMath.TWO_PI); + if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(angle) > CesiumMath.EPSILON14) { return CesiumMath.TWO_PI; } return mod; @@ -1145,7 +1140,7 @@ define('Core/Math',[ * @example * //Compute 7!, which is equal to 5040 * var computedFactorial = Cesium.Math.factorial(7); - * + * * @see {@link http://en.wikipedia.org/wiki/Factorial|Factorial on Wikipedia} */ CesiumMath.factorial = function(n) { @@ -1429,7 +1424,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.fromSpherical = function(spherical, result) { - Check.typeOf.object(spherical, 'spherical'); + Check.typeOf.object('spherical', spherical); if (!defined(result)) { result = new Cartesian3(); @@ -1513,8 +1508,8 @@ define('Core/Cartesian3',[ * @returns {Number[]} The array that was packed into */ Cartesian3.pack = function(value, array, startingIndex) { - Check.typeOf.object(value, 'value'); - Check.defined(array, 'array'); + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1534,7 +1529,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.unpack = function(array, startingIndex, result) { - Check.defined(array, 'array'); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1555,7 +1550,7 @@ define('Core/Cartesian3',[ * @returns {Number[]} The packed array. */ Cartesian3.packArray = function(array, result) { - Check.defined(array, 'array'); + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -1578,8 +1573,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3[]} The unpacked array. */ Cartesian3.unpackArray = function(array, result) { - Check.defined(array, 'array'); - Check.numeric.minimum(array.length, 3); + Check.defined('array', array); + Check.typeOf.number.greaterThanOrEquals('array.length', array.length, 3); if (array.length % 3 !== 0) { throw new DeveloperError('array length must be a multiple of 3.'); } @@ -1625,7 +1620,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the maximum component. */ Cartesian3.maximumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z); }; @@ -1637,7 +1632,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the minimum component. */ Cartesian3.minimumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z); }; @@ -1651,9 +1646,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the minimum components. */ Cartesian3.minimumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -1671,9 +1666,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the maximum components. */ Cartesian3.maximumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -1688,7 +1683,7 @@ define('Core/Cartesian3',[ * @returns {Number} The squared magnitude. */ Cartesian3.magnitudeSquared = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z; }; @@ -1717,8 +1712,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distance(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(2.0, 0.0, 0.0)); */ Cartesian3.distance = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitude(distanceScratch); @@ -1737,8 +1732,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distanceSquared(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(3.0, 0.0, 0.0)); */ Cartesian3.distanceSquared = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitudeSquared(distanceScratch); @@ -1752,8 +1747,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.normalize = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian3.magnitude(cartesian); @@ -1776,8 +1771,8 @@ define('Core/Cartesian3',[ * @returns {Number} The dot product. */ Cartesian3.dot = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z; }; @@ -1791,9 +1786,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyComponents = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -1835,9 +1830,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.add = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -1854,9 +1849,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.subtract = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -1873,9 +1868,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -1892,9 +1887,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.divideByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -1910,8 +1905,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.negate = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -1927,8 +1922,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.abs = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -1947,10 +1942,10 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.lerp = function(start, end, t, result) { - Check.typeOf.object(start, 'start'); - Check.typeOf.object(end, 'end'); - Check.typeOf.number(t, 't'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian3.multiplyByScalar(end, t, lerpScratch); result = Cartesian3.multiplyByScalar(start, 1.0 - t, result); @@ -1967,8 +1962,8 @@ define('Core/Cartesian3',[ * @returns {Number} The angle between the Cartesians. */ Cartesian3.angleBetween = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.normalize(left, angleBetweenScratch); Cartesian3.normalize(right, angleBetweenScratch2); @@ -1986,8 +1981,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The most orthogonal axis. */ Cartesian3.mostOrthogonalAxis = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian3.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian3.abs(f, f); @@ -2064,9 +2059,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The cross product. */ Cartesian3.cross = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var leftX = left.x; var leftY = left.y; @@ -2099,8 +2094,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromDegrees(-115.0, 37.0); */ Cartesian3.fromDegrees = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); longitude = CesiumMath.toRadians(longitude); latitude = CesiumMath.toRadians(latitude); @@ -2125,8 +2120,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromRadians(-2.007, 0.645); */ Cartesian3.fromRadians = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); height = defaultValue(height, 0.0); var radiiSquared = defined(ellipsoid) ? ellipsoid.radiiSquared : wgs84RadiiSquared; @@ -2160,7 +2155,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArray([-115.0, 37.0, -107.0, 33.0]); */ Cartesian3.fromDegreesArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -2194,7 +2189,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArray([-2.007, 0.645, -1.867, .575]); */ Cartesian3.fromRadiansArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -2228,7 +2223,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArrayHeights([-115.0, 37.0, 100000.0, -107.0, 33.0, 150000.0]); */ Cartesian3.fromDegreesArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -2263,7 +2258,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArrayHeights([-2.007, 0.645, 100000.0, -1.867, .575, 150000.0]); */ Cartesian3.fromRadiansArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -3010,7 +3005,9 @@ define('Core/Ellipsoid',[ /** * Computes an Ellipsoid from a Cartesian specifying the radii in x, y, and z directions. * - * @param {Cartesian3} [radii=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Cartesian3} [cartesian=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new + * instance should be created. * @returns {Ellipsoid} A new Ellipsoid instance. * * @exception {DeveloperError} All radii components must be greater than or equal to zero. @@ -3650,6 +3647,7 @@ define('Core/Interval',[ /*global define*/ define('Core/Matrix3',[ './Cartesian3', + './Check', './defaultValue', './defined', './defineProperties', @@ -3658,6 +3656,7 @@ define('Core/Matrix3',[ './Math' ], function( Cartesian3, + Check, defaultValue, defined, defineProperties, @@ -3720,13 +3719,8 @@ define('Core/Matrix3',[ * @returns {Number[]} The array that was packed into */ Matrix3.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3752,9 +3746,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. */ Matrix3.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3781,24 +3773,24 @@ define('Core/Matrix3',[ * @param {Matrix3} [result] The object onto which to store the result. * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. (Returns undefined if matrix is undefined) */ - Matrix3.clone = function(values, result) { - if (!defined(values)) { + Matrix3.clone = function(matrix, result) { + if (!defined(matrix)) { return undefined; } if (!defined(result)) { - return new Matrix3(values[0], values[3], values[6], - values[1], values[4], values[7], - values[2], values[5], values[8]); + return new Matrix3(matrix[0], matrix[3], matrix[6], + matrix[1], matrix[4], matrix[7], + matrix[2], matrix[5], matrix[8]); } - result[0] = values[0]; - result[1] = values[1]; - result[2] = values[2]; - result[3] = values[3]; - result[4] = values[4]; - result[5] = values[5]; - result[6] = values[6]; - result[7] = values[7]; - result[8] = values[8]; + result[0] = matrix[0]; + result[1] = matrix[1]; + result[2] = matrix[2]; + result[3] = matrix[3]; + result[4] = matrix[4]; + result[5] = matrix[5]; + result[6] = matrix[6]; + result[7] = matrix[7]; + result[8] = matrix[8]; return result; }; @@ -3824,9 +3816,7 @@ define('Core/Matrix3',[ * var m2 = Cesium.Matrix3.fromArray(v2, 2); */ Matrix3.fromArray = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3854,9 +3844,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values parameter is required'); - } + Check.defined('values', values); return Matrix3.clone(values, result); }; @@ -3870,9 +3858,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix3(values[0], values[1], values[2], @@ -3899,9 +3885,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this quaternion. */ Matrix3.fromQuaternion = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); var x2 = quaternion.x * quaternion.x; var xy = quaternion.x * quaternion.y; @@ -3951,10 +3935,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this headingPitchRoll. */ Matrix3.fromHeadingPitchRoll = function(headingPitchRoll, result) { - if (!defined(headingPitchRoll)) { - throw new DeveloperError('headingPitchRoll is required'); - } - var cosTheta = Math.cos(-headingPitchRoll.pitch); + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + + var cosTheta = Math.cos(-headingPitchRoll.pitch); var cosPsi = Math.cos(-headingPitchRoll.heading); var cosPhi = Math.cos(headingPitchRoll.roll); var sinTheta = Math.sin(-headingPitchRoll.pitch); @@ -4005,9 +3988,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix3( @@ -4043,9 +4024,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromUniformScale(2.0); */ Matrix3.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix3( @@ -4069,7 +4048,7 @@ define('Core/Matrix3',[ /** * Computes a Matrix3 instance representing the cross product equivalent matrix of a Cartesian3 vector. * - * @param {Cartesian3} the vector on the left hand side of the cross product operation. + * @param {Cartesian3} vector the vector on the left hand side of the cross product operation. * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created. * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. * @@ -4081,9 +4060,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromCrossProduct(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromCrossProduct = function(vector, result) { - if (!defined(vector)) { - throw new DeveloperError('vector is required.'); - } + Check.typeOf.object('vector', vector); if (!defined(result)) { return new Matrix3( @@ -4118,9 +4095,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationX = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4159,9 +4134,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationY = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4200,9 +4173,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationZ = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4236,9 +4207,7 @@ define('Core/Matrix3',[ * @returns {Number[]} The modified Array parameter or a new Array instance if one was not provided. */ Matrix3.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5], matrix[6], matrix[7], matrix[8]]; @@ -4272,12 +4241,10 @@ define('Core/Matrix3',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix3.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 2) { - throw new DeveloperError('row must be 0, 1, or 2.'); - } - if (typeof column !== 'number' || column < 0 || column > 2) { - throw new DeveloperError('column must be 0, 1, or 2.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 2); + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 2); return column * 3 + row; }; @@ -4293,16 +4260,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var startIndex = index * 3; var x = matrix[startIndex]; @@ -4327,18 +4288,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); var startIndex = index * 3; @@ -4359,15 +4313,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 3]; @@ -4391,18 +4340,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); result[index] = cartesian.x; @@ -4421,12 +4363,8 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[3], matrix[4], matrix[5], scratchColumn)); @@ -4457,15 +4395,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var column0Row0 = left[0] * right[0] + left[3] * right[1] + left[6] * right[2]; var column0Row1 = left[1] * right[0] + left[4] * right[1] + left[7] * right[2]; @@ -4500,15 +4432,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -4531,15 +4457,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -4562,15 +4482,9 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -4595,15 +4509,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -4634,15 +4542,9 @@ define('Core/Matrix3',[ * @see Matrix3.multiplyByUniformScale */ Matrix3.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); result[0] = matrix[0] * scale.x; result[1] = matrix[1] * scale.x; @@ -4664,12 +4566,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -4691,12 +4589,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var column0Row0 = matrix[0]; var column0Row1 = matrix[3]; @@ -4836,9 +4730,7 @@ define('Core/Matrix3',[ * var c = Cesium.Cartesian3.multiplyByScalar(v, lambda, new Cesium.Cartesian3()); // equal to Cesium.Matrix3.multiplyByVector(a, v) */ Matrix3.computeEigenDecomposition = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); // This routine was created based upon Matrix Computations, 3rd ed., by Golub and Van Loan, // section 8.4.3 The Classical Jacobi Algorithm @@ -4882,12 +4774,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -4909,9 +4797,7 @@ define('Core/Matrix3',[ * @returns {Number} The value of the determinant of the matrix. */ Matrix3.determinant = function(matrix) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); var m11 = matrix[0]; var m21 = matrix[3]; @@ -4936,12 +4822,8 @@ define('Core/Matrix3',[ * @exception {DeveloperError} matrix is not invertible. */ Matrix3.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var m11 = matrix[0]; var m21 = matrix[1]; @@ -5007,9 +4889,7 @@ define('Core/Matrix3',[ * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. */ Matrix3.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -5197,12 +5077,14 @@ define('Core/Matrix3',[ /*global define*/ define('Core/Cartesian4',[ + './Check', './defaultValue', './defined', './DeveloperError', './freezeObject', './Math' ], function( + Check, defaultValue, defined, DeveloperError, @@ -5285,9 +5167,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.fromColor = function(color, result) { - if (!defined(color)) { - throw new DeveloperError('color is required'); - } + Check.typeOf.object('color', color); if (!defined(result)) { return new Cartesian4(color.red, color.green, color.blue, color.alpha); } @@ -5339,12 +5219,8 @@ define('Core/Cartesian4',[ * @returns {Number[]} The array that was packed into */ Cartesian4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5365,9 +5241,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5389,9 +5263,7 @@ define('Core/Cartesian4',[ * @returns {Number[]} The packed array. */ Cartesian4.packArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -5414,9 +5286,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4[]} The unpacked array. */ Cartesian4.unpackArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -5459,9 +5329,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the maximum component. */ Cartesian4.maximumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -5473,9 +5341,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the minimum component. */ Cartesian4.minimumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -5489,15 +5355,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the minimum components. */ Cartesian4.minimumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -5516,15 +5376,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the maximum components. */ Cartesian4.maximumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -5541,9 +5395,7 @@ define('Core/Cartesian4',[ * @returns {Number} The squared magnitude. */ Cartesian4.magnitudeSquared = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z + cartesian.w * cartesian.w; }; @@ -5574,9 +5426,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(2.0, 0.0, 0.0, 0.0)); */ Cartesian4.distance = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitude(distanceScratch); @@ -5597,9 +5448,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(3.0, 0.0, 0.0, 0.0)); */ Cartesian4.distanceSquared = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitudeSquared(distanceScratch); @@ -5613,12 +5463,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.normalize = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian4.magnitude(cartesian); @@ -5642,12 +5488,8 @@ define('Core/Cartesian4',[ * @returns {Number} The dot product. */ Cartesian4.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w; }; @@ -5661,15 +5503,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -5687,15 +5523,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x / right.x; result.y = left.y / right.y; @@ -5713,15 +5543,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -5739,15 +5563,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -5765,15 +5583,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -5791,15 +5603,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -5816,12 +5622,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.negate = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -5838,12 +5640,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.abs = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -5863,18 +5661,10 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian4.multiplyByScalar(end, t, lerpScratch); result = Cartesian4.multiplyByScalar(start, 1.0 - t, result); @@ -5890,12 +5680,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The most orthogonal axis. */ Cartesian4.mostOrthogonalAxis = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian4.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian4.abs(f, f); @@ -6140,6 +5926,7 @@ define('Core/RuntimeError',[ define('Core/Matrix4',[ './Cartesian3', './Cartesian4', + './Check', './defaultValue', './defined', './defineProperties', @@ -6151,6 +5938,7 @@ define('Core/Matrix4',[ ], function( Cartesian3, Cartesian4, + Check, defaultValue, defined, defineProperties, @@ -6241,13 +6029,8 @@ define('Core/Matrix4',[ * @returns {Number[]} The array that was packed into */ Matrix4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -6280,9 +6063,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if one was not provided. */ Matrix4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -6378,9 +6159,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required'); - } + Check.defined('values', values); return Matrix4.clone(values, result); }; @@ -6394,9 +6173,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix4(values[0], values[1], values[2], values[3], @@ -6433,9 +6210,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRotationTranslation = function(rotation, translation, result) { - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } + Check.typeOf.object('rotation', rotation); translation = defaultValue(translation, Cartesian3.ZERO); @@ -6483,15 +6258,9 @@ define('Core/Matrix4',[ * result); */ Matrix4.fromTranslationQuaternionRotationScale = function(translation, rotation, scale, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('translation', translation); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('scale', scale); if (!defined(result)) { result = new Matrix4(); @@ -6552,9 +6321,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromTranslationRotationScale = function(translationRotationScale, result) { - if (!defined(translationRotationScale)) { - throw new DeveloperError('translationRotationScale is required.'); - } + Check.typeOf.object('translationRotationScale', translationRotationScale); return Matrix4.fromTranslationQuaternionRotationScale(translationRotationScale.translation, translationRotationScale.rotation, translationRotationScale.scale, result); }; @@ -6569,9 +6336,7 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByTranslation */ Matrix4.fromTranslation = function(translation, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } + Check.typeOf.object('translation', translation); return Matrix4.fromRotationTranslation(Matrix3.IDENTITY, translation, result); }; @@ -6592,9 +6357,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix4.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix4( @@ -6639,9 +6402,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromUniformScale(2.0); */ Matrix4.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix4(scale, 0.0, 0.0, 0.0, @@ -6681,23 +6442,15 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromCamera = function(camera, result) { - if (!defined(camera)) { - throw new DeveloperError('camera is required.'); - } + Check.typeOf.object('camera', camera); var position = camera.position; var direction = camera.direction; var up = camera.up; - if (!defined(position)) { - throw new DeveloperError('camera.position is required.'); - } - if (!defined(direction)) { - throw new DeveloperError('camera.direction is required.'); - } - if (!defined(up)) { - throw new DeveloperError('camera.up is required.'); - } + Check.typeOf.object('camera.position', position); + Check.typeOf.object('camera.direction', direction); + Check.typeOf.object('camera.up', up); Cartesian3.normalize(direction, fromCameraF); Cartesian3.normalize(Cartesian3.cross(fromCameraF, up, fromCameraR), fromCameraR); @@ -6776,21 +6529,11 @@ define('Core/Matrix4',[ * @exception {DeveloperError} far must be greater than zero. */ Matrix4.computePerspectiveFieldOfView = function(fovY, aspectRatio, near, far, result) { - if (fovY <= 0.0 || fovY > Math.PI) { - throw new DeveloperError('fovY must be in (0, PI].'); - } - if (aspectRatio <= 0.0) { - throw new DeveloperError('aspectRatio must be greater than zero.'); - } - if (near <= 0.0) { - throw new DeveloperError('near must be greater than zero.'); - } - if (far <= 0.0) { - throw new DeveloperError('far must be greater than zero.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThan('fovY', fovY, 0.0); + Check.typeOf.number.lessThan('fovY', fovY, Math.PI); + Check.typeOf.number.greaterThan('near', near, 0.0); + Check.typeOf.number.greaterThan('far', far, 0.0); + Check.typeOf.object('result', result); var bottom = Math.tan(fovY * 0.5); @@ -6831,27 +6574,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeOrthographicOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var a = 1.0 / (right - left); var b = 1.0 / (top - bottom); @@ -6896,27 +6625,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computePerspectiveOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -6957,24 +6672,12 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeInfinitePerspectiveOffCenter = function(left, right, bottom, top, near, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -7022,9 +6725,7 @@ define('Core/Matrix4',[ * }, 0.0, 1.0, new Cesium.Matrix4()); */ Matrix4.computeViewportTransformation = function(viewport, nearDepthRange, farDepthRange, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); viewport = defaultValue(viewport, defaultValue.EMPTY_OBJECT); var x = defaultValue(viewport.x, 0.0); @@ -7076,21 +6777,11 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeView = function(position, direction, up, right, result) { - if (!defined(position)) { - throw new DeveloperError('position is required'); - } - if (!defined(direction)) { - throw new DeveloperError('direction is required'); - } - if (!defined(up)) { - throw new DeveloperError('up is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); + Check.typeOf.object('up', up); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = right.x; result[1] = up.x; @@ -7131,9 +6822,7 @@ define('Core/Matrix4',[ * //creates a = [10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0] */ Matrix4.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], @@ -7177,12 +6866,11 @@ define('Core/Matrix4',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix4.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 3) { - throw new DeveloperError('row must be 0, 1, 2, or 3.'); - } - if (typeof column !== 'number' || column < 0 || column > 3) { - throw new DeveloperError('column must be 0, 1, 2, or 3.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 3); + + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 3); return column * 4 + row; }; @@ -7215,16 +6903,12 @@ define('Core/Matrix4',[ * // a.x = 12.0; a.y = 16.0; a.z = 20.0; a.w = 24.0; */ Matrix4.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var startIndex = index * 4; var x = matrix[startIndex]; @@ -7266,18 +6950,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 96.0, 25.0] */ Matrix4.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); var startIndex = index * 4; @@ -7298,15 +6977,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.setTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -7359,16 +7032,12 @@ define('Core/Matrix4',[ * // a.x = 18.0; a.y = 19.0; a.z = 20.0; a.w = 21.0; */ Matrix4.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 4]; @@ -7409,18 +7078,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 24.0, 25.0] */ Matrix4.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); result[index] = cartesian.x; @@ -7440,12 +7104,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter */ Matrix4.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[4], matrix[5], matrix[6], scratchColumn)); @@ -7477,15 +7137,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -7569,15 +7223,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -7607,15 +7255,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -7656,15 +7298,9 @@ define('Core/Matrix4',[ * var m3 = Cesium.Matrix4.multiplyTransformation(m1, m2, new Cesium.Matrix4()); */ Matrix4.multiplyTransformation = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -7742,15 +7378,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByMatrix3(m, rotation, m); */ Matrix4.multiplyByMatrix3 = function(matrix, rotation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('result', result); var left0 = matrix[0]; var left1 = matrix[1]; @@ -7818,15 +7448,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByTranslation(m, position, m); */ Matrix4.multiplyByTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); var x = translation.x; var y = translation.y; @@ -7878,15 +7502,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByScale */ Matrix4.multiplyByUniformScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scale', scale); + Check.typeOf.object('result', result); uniformScaleScratch.x = scale; uniformScaleScratch.y = scale; @@ -7915,15 +7533,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByUniformScale */ Matrix4.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); var scaleX = scale.x; var scaleY = scale.y; @@ -7962,15 +7574,9 @@ define('Core/Matrix4',[ * @returns {Cartesian4} The modified result parameter. */ Matrix4.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8006,15 +7612,9 @@ define('Core/Matrix4',[ * // Cesium.Matrix4.multiplyByVector(matrix, new Cesium.Cartesian4(p.x, p.y, p.z, 0.0), result); */ Matrix4.multiplyByPointAsVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8044,16 +7644,9 @@ define('Core/Matrix4',[ * var result = Cesium.Matrix4.multiplyByPoint(matrix, p, new Cesium.Cartesian3()); */ Matrix4.multiplyByPoint = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8093,15 +7686,9 @@ define('Core/Matrix4',[ * // [-44.0, -46.0, -48.0, -50.0] */ Matrix4.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -8145,12 +7732,8 @@ define('Core/Matrix4',[ * // [-22.0, -23.0, -24.0, -25.0] */ Matrix4.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -8194,12 +7777,8 @@ define('Core/Matrix4',[ * // [13.0, 17.0, 21.0, 25.0] */ Matrix4.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var matrix1 = matrix[1]; var matrix2 = matrix[2]; @@ -8235,12 +7814,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -8354,9 +7929,7 @@ define('Core/Matrix4',[ * //Prints "Difference between both the matrices is not less than 0.1" on the console */ Matrix4.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -8386,13 +7959,9 @@ define('Core/Matrix4',[ * @param {Cartesian3} result The object onto which to store the result. * @returns {Cartesian3} The modified result parameter. */ - Matrix4.getTranslation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Matrix4.getTranslation = function(matrix, result) { + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = matrix[12]; result.y = matrix[13]; @@ -8423,12 +7992,8 @@ define('Core/Matrix4',[ * // [12.0, 16.0, 20.0] */ Matrix4.getRotation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -8460,12 +8025,8 @@ define('Core/Matrix4',[ * @exception {RuntimeError} matrix is not invertible because its determinate is zero. */ Matrix4.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); // Special case for a zero scale matrix that can occur, for example, // when a model's node has a [0, 0, 0] scale. @@ -8603,12 +8164,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.inverseTransformation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); //This function is an optimized version of the below 4 lines. //var rT = Matrix3.transpose(Matrix4.getRotation(matrix)); @@ -8892,6 +8449,7 @@ define('Core/Matrix4',[ /*global define*/ define('Core/Rectangle',[ './Cartographic', + './Check', './defaultValue', './defined', './defineProperties', @@ -8901,6 +8459,7 @@ define('Core/Rectangle',[ './Math' ], function( Cartographic, + Check, defaultValue, defined, defineProperties, @@ -8997,13 +8556,8 @@ define('Core/Rectangle',[ * @returns {Number[]} The array that was packed into */ Rectangle.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -9024,9 +8578,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -9047,9 +8599,7 @@ define('Core/Rectangle',[ * @returns {Number} The width. */ Rectangle.computeWidth = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; if (east < west) { @@ -9064,9 +8614,7 @@ define('Core/Rectangle',[ * @returns {Number} The height. */ Rectangle.computeHeight = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); return rectangle.north - rectangle.south; }; @@ -9101,6 +8649,32 @@ define('Core/Rectangle',[ return result; }; + /** + * Creates an rectangle given the boundary longitude and latitude in radians. + * + * @param {Number} [west=0.0] The westernmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [south=0.0] The southernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Number} [east=0.0] The easternmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [north=0.0] The northernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Rectangle} [result] The object onto which to store the result, or undefined if a new instance should be created. + * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. + * + * @example + * var rectangle = Cesium.Rectangle.fromRadians(0.0, Math.PI/4, Math.PI/8, 3*Math.PI/4); + */ + Rectangle.fromRadians = function(west, south, east, north, result) { + if (!defined(result)) { + return new Rectangle(west, south, east, north); + } + + result.west = defaultValue(west, 0.0); + result.south = defaultValue(south, 0.0); + result.east = defaultValue(east, 0.0); + result.north = defaultValue(north, 0.0); + + return result; + }; + /** * Creates the smallest possible Rectangle that encloses all positions in the provided array. * @@ -9109,9 +8683,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartographicArray = function(cartographics, result) { - if (!defined(cartographics)) { - throw new DeveloperError('cartographics is required.'); - } + Check.defined('cartographics', cartographics); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -9164,9 +8736,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartesianArray = function(cartesians, ellipsoid, result) { - if (!defined(cartesians)) { - throw new DeveloperError('cartesians is required.'); - } + Check.defined('cartesians', cartesians); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -9282,9 +8852,7 @@ define('Core/Rectangle',[ * @returns {Boolean} <code>true</code> if the Rectangles are within the provided epsilon, <code>false</code> otherwise. */ Rectangle.prototype.equalsEpsilon = function(other, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon is required and must be a number.'); - } + Check.typeOf.number('epsilon', epsilon); return defined(other) && (Math.abs(this.west - other.west) <= epsilon) && @@ -9304,45 +8872,23 @@ define('Core/Rectangle',[ * @exception {DeveloperError} <code>west</code> must be in the interval [<code>-Pi</code>, <code>Pi</code>]. */ Rectangle.validate = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var north = rectangle.north; - if (typeof north !== 'number') { - throw new DeveloperError('north is required to be a number.'); - } - - if (north < -CesiumMath.PI_OVER_TWO || north > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('north must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('north', north, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('north', north, CesiumMath.PI_OVER_TWO); var south = rectangle.south; - if (typeof south !== 'number') { - throw new DeveloperError('south is required to be a number.'); - } - - if (south < -CesiumMath.PI_OVER_TWO || south > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('south must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('south', south, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('south', south, CesiumMath.PI_OVER_TWO); var west = rectangle.west; - if (typeof west !== 'number') { - throw new DeveloperError('west is required to be a number.'); - } - - if (west < -Math.PI || west > Math.PI) { - throw new DeveloperError('west must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('west', west, -Math.PI); + Check.typeOf.number.lessThanOrEquals('west', west, Math.PI); var east = rectangle.east; - if (typeof east !== 'number') { - throw new DeveloperError('east is required to be a number.'); - } - - if (east < -Math.PI || east > Math.PI) { - throw new DeveloperError('east must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('east', east, -Math.PI); + Check.typeOf.number.lessThanOrEquals('east', east, Math.PI); }; /** @@ -9353,9 +8899,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.south); @@ -9374,9 +8918,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.north); @@ -9395,9 +8937,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.north); @@ -9416,9 +8956,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.south); @@ -9437,9 +8975,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.center = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; @@ -9474,12 +9010,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.intersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var rectangleEast = rectangle.east; var rectangleWest = rectangle.west; @@ -9535,12 +9067,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.simpleIntersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var west = Math.max(rectangle.west, otherRectangle.west); var south = Math.max(rectangle.south, otherRectangle.south); @@ -9571,12 +9099,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.union = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); if (!defined(result)) { result = new Rectangle(); @@ -9620,12 +9144,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.expand = function(rectangle, cartographic, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); if (!defined(result)) { result = new Rectangle(); @@ -9647,12 +9167,8 @@ define('Core/Rectangle',[ * @returns {Boolean} true if the provided cartographic is inside the rectangle, false otherwise. */ Rectangle.contains = function(rectangle, cartographic) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); var longitude = cartographic.longitude; var latitude = cartographic.latitude; @@ -9685,9 +9201,7 @@ define('Core/Rectangle',[ * @returns {Cartesian3[]} The modified result parameter or a new Array of Cartesians instances if none was provided. */ Rectangle.subsample = function(rectangle, ellipsoid, surfaceHeight, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84); surfaceHeight = defaultValue(surfaceHeight, 0.0); @@ -9765,9 +9279,9 @@ define('Core/Rectangle',[ define('Core/BoundingSphere',[ './Cartesian3', './Cartographic', + './Check', './defaultValue', './defined', - './DeveloperError', './Ellipsoid', './GeographicProjection', './Intersect', @@ -9778,9 +9292,9 @@ define('Core/BoundingSphere',[ ], function( Cartesian3, Cartographic, + Check, defaultValue, defined, - DeveloperError, Ellipsoid, GeographicProjection, Intersect, @@ -10110,9 +9624,7 @@ define('Core/BoundingSphere',[ stride = defaultValue(stride, 3); - if (stride < 3) { - throw new DeveloperError('stride must be 3 or greater.'); - } + Check.typeOf.number.greaterThanOrEquals('stride', stride, 3); var currentPos = fromPointsCurrentPos; currentPos.x = positions[0] + center.x; @@ -10416,9 +9928,8 @@ define('Core/BoundingSphere',[ * var sphere = Cesium.BoundingSphere.fromCornerPoints(new Cesium.Cartesian3(-0.5, -0.5, -0.5), new Cesium.Cartesian3(0.5, 0.5, 0.5)); */ BoundingSphere.fromCornerPoints = function(corner, oppositeCorner, result) { - if (!defined(corner) || !defined(oppositeCorner)) { - throw new DeveloperError('corner and oppositeCorner are required.'); - } + Check.typeOf.object('corner', corner); + Check.typeOf.object('oppositeCorner', oppositeCorner); if (!defined(result)) { result = new BoundingSphere(); @@ -10442,9 +9953,7 @@ define('Core/BoundingSphere',[ * var boundingSphere = Cesium.BoundingSphere.fromEllipsoid(ellipsoid); */ BoundingSphere.fromEllipsoid = function(ellipsoid, result) { - if (!defined(ellipsoid)) { - throw new DeveloperError('ellipsoid is required.'); - } + Check.typeOf.object('ellipsoid', ellipsoid); if (!defined(result)) { result = new BoundingSphere(); @@ -10570,13 +10079,8 @@ define('Core/BoundingSphere',[ * @returns {Number[]} The array that was packed into */ BoundingSphere.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -10598,9 +10102,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if one was not provided. */ BoundingSphere.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -10627,13 +10129,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.union = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); if (!defined(result)) { result = new BoundingSphere(); @@ -10682,13 +10179,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.expand = function(sphere, point, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(point)) { - throw new DeveloperError('point is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('point', point); result = BoundingSphere.clone(sphere, result); @@ -10711,13 +10203,8 @@ define('Core/BoundingSphere',[ * intersects the plane. */ BoundingSphere.intersectPlane = function(sphere, plane) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(plane)) { - throw new DeveloperError('plane is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('plane', plane); var center = sphere.center; var radius = sphere.radius; @@ -10743,13 +10230,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.transform = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -10777,12 +10259,8 @@ define('Core/BoundingSphere',[ * }); */ BoundingSphere.distanceSquaredTo = function(sphere, cartesian) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('cartesian', cartesian); var diff = Cartesian3.subtract(sphere.center, cartesian, distanceSquaredToScratch); return Cartesian3.magnitudeSquared(diff) - sphere.radius * sphere.radius; @@ -10804,13 +10282,8 @@ define('Core/BoundingSphere',[ * var newBoundingSphere = Cesium.BoundingSphere.transformWithoutScale(boundingSphere, modelMatrix); */ BoundingSphere.transformWithoutScale = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -10837,17 +10310,9 @@ define('Core/BoundingSphere',[ * @returns {Interval} The nearest and farthest distances on the bounding sphere from position in direction. */ BoundingSphere.computePlaneDistances = function(sphere, position, direction, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(position)) { - throw new DeveloperError('position is required.'); - } - - if (!defined(direction)) { - throw new DeveloperError('direction is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); if (!defined(result)) { result = new Interval(); @@ -10882,9 +10347,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.projectTo2D = function(sphere, projection, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } + Check.typeOf.object('sphere', sphere); projection = defaultValue(projection, projectTo2DProjection); @@ -10979,12 +10442,8 @@ define('Core/BoundingSphere',[ * @returns {Boolean} <code>true</code> if the sphere is not visible; otherwise <code>false</code>. */ BoundingSphere.isOccluded = function(sphere, occluder) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(occluder)) { - throw new DeveloperError('occluder is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('occluder', occluder); return !occluder.isBoundingSphereVisible(sphere); }; @@ -11085,12 +10544,14 @@ define('Core/BoundingSphere',[ /*global define*/ define('Core/Cartesian2',[ + './Check', './defaultValue', './defined', './DeveloperError', './freezeObject', './Math' ], function( + Check, defaultValue, defined, DeveloperError, @@ -11202,12 +10663,8 @@ define('Core/Cartesian2',[ * @returns {Number[]} The array that was packed into */ Cartesian2.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -11226,9 +10683,7 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided. */ Cartesian2.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -11248,9 +10703,7 @@ define('Core/Cartesian2',[ * @returns {Number[]} The packed array. */ Cartesian2.packArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -11273,9 +10726,7 @@ define('Core/Cartesian2',[ * @returns {Cartesian2[]} The unpacked array. */ Cartesian2.unpackArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -11318,9 +10769,7 @@ define('Core/Cartesian2',[ * @returns {Number} The value of the maximum component. */ Cartesian2.maximumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y); }; @@ -11332,9 +10781,7 @@ define('Core/Cartesian2',[ * @returns {Number} The value of the minimum component. */ Cartesian2.minimumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y); }; @@ -11348,15 +10795,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} A cartesian with the minimum components. */ Cartesian2.minimumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); @@ -11374,15 +10815,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} A cartesian with the maximum components. */ Cartesian2.maximumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -11396,9 +10831,7 @@ define('Core/Cartesian2',[ * @returns {Number} The squared magnitude. */ Cartesian2.magnitudeSquared = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y; }; @@ -11464,12 +10897,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.normalize = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian2.magnitude(cartesian); @@ -11491,12 +10920,8 @@ define('Core/Cartesian2',[ * @returns {Number} The dot product. */ Cartesian2.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y; }; @@ -11510,15 +10935,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.multiplyComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -11534,15 +10953,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.divideComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x / right.x; result.y = left.y / right.y; @@ -11558,15 +10971,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -11582,15 +10989,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -11606,15 +11007,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.multiplyByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -11630,15 +11025,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.divideByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -11653,12 +11042,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.negate = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -11673,12 +11058,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.abs = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -11696,18 +11077,10 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian2.multiplyByScalar(end, t, lerpScratch); result = Cartesian2.multiplyByScalar(start, 1.0 - t, result); @@ -11724,12 +11097,8 @@ define('Core/Cartesian2',[ * @returns {Number} The angle between the Cartesians. */ Cartesian2.angleBetween = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian2.normalize(left, angleBetweenScratch); Cartesian2.normalize(right, angleBetweenScratch2); @@ -11745,12 +11114,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The most orthogonal axis. */ Cartesian2.mostOrthogonalAxis = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian2.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian2.abs(f, f); @@ -12988,7 +12353,10 @@ define('Core/WebGLConstants',[ COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : 0x9279, TEXTURE_IMMUTABLE_FORMAT : 0x912F, MAX_ELEMENT_INDEX : 0x8D6B, - TEXTURE_IMMUTABLE_LEVELS : 0x82DF + TEXTURE_IMMUTABLE_LEVELS : 0x82DF, + + // Extensions + MAX_TEXTURE_MAX_ANISOTROPY_EXT : 0x84FF }; return freezeObject(WebGLConstants); @@ -13579,7 +12947,7 @@ define('Core/Geometry',[ * <li><code>position</code> - 3D vertex position. 64-bit floating-point (for precision). 3 components per attribute. See {@link VertexFormat#position}.</li> * <li><code>normal</code> - Normal (normalized), commonly used for lighting. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#normal}.</li> * <li><code>st</code> - 2D texture coordinate. 32-bit floating-point. 2 components per attribute. See {@link VertexFormat#st}.</li> - * <li><code>binormal</code> - Binormal (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#binormal}.</li> + * <li><code>bitangent</code> - Bitangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#bitangent}.</li> * <li><code>tangent</code> - Tangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#tangent}.</li> * </ul> * </p> @@ -13608,7 +12976,7 @@ define('Core/Geometry',[ * componentsPerAttribute : 3, * values : new Float32Array(0) * }); - * + * * @see GeometryAttribute * @see VertexFormat */ @@ -13889,7 +13257,7 @@ define('Core/GeometryAttributes',[ this.st = options.st; /** - * The binormal attribute (normalized), which is used for tangent-space effects like bump mapping. + * The bitangent attribute (normalized), which is used for tangent-space effects like bump mapping. * <p> * 32-bit floating-point. 3 components per attribute. * </p> @@ -13898,7 +13266,7 @@ define('Core/GeometryAttributes',[ * * @default undefined */ - this.binormal = options.binormal; + this.bitangent = options.bitangent; /** * The tangent attribute (normalized), which is used for tangent-space effects like bump mapping. diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createEllipseGeometry.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createEllipseGeometry.js index 6cbd2d20..20f642bb 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createEllipseGeometry.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createEllipseGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,68 +45,6 @@ define('Core/defined',[],function() { return defined; }); -/*global define*/ -define('Core/freezeObject',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Freezes an object, using Object.freeze if available, otherwise returns - * the object unchanged. This function should be used in setup code to prevent - * errors from completely halting JavaScript execution in legacy browsers. - * - * @private - * - * @exports freezeObject - */ - var freezeObject = Object.freeze; - if (!defined(freezeObject)) { - freezeObject = function(o) { - return o; - }; - } - - return freezeObject; -}); - -/*global define*/ -define('Core/defaultValue',[ - './freezeObject' - ], function( - freezeObject) { - 'use strict'; - - /** - * Returns the first parameter if not undefined, otherwise the second parameter. - * Useful for setting a default value for a parameter. - * - * @exports defaultValue - * - * @param {*} a - * @param {*} b - * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter. - * - * @example - * param = Cesium.defaultValue(param, 'default'); - */ - function defaultValue(a, b) { - if (a !== undefined) { - return a; - } - return b; - } - - /** - * A frozen empty object that can be used as the default value for options passed as - * an object literal. - */ - defaultValue.EMPTY_OBJECT = freezeObject({}); - - return defaultValue; -}); - /*global define*/ define('Core/DeveloperError',[ './defined' @@ -188,41 +126,13 @@ define('Core/DeveloperError',[ return DeveloperError; }); -/*global define*/ -define('Core/isArray',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Tests an object to see if it is an array. - * @exports isArray - * - * @param {Object} value The value to test. - * @returns {Boolean} true if the value is an array, false otherwise. - */ - var isArray = Array.isArray; - if (!defined(isArray)) { - isArray = function(value) { - return Object.prototype.toString.call(value) === '[object Array]'; - }; - } - - return isArray; -}); - /*global define*/ define('Core/Check',[ - './defaultValue', - './defined', - './DeveloperError', - './isArray' + './defined', + './DeveloperError' ], function( - defaultValue, defined, - DeveloperError, - isArray) { + DeveloperError) { 'use strict'; /** @@ -237,111 +147,134 @@ define('Core/Check',[ */ Check.typeOf = {}; - /** - * Contains functions for checking numeric conditions such as minimum and maximum values - */ - Check.numeric = {}; - function getUndefinedErrorMessage(name) { - return name + ' was required but undefined.'; + return name + ' is required, actual value was undefined'; } function getFailedTypeErrorMessage(actual, expected, name) { - return 'Expected ' + name + ' to be typeof ' + expected + ', got ' + actual; + return 'Expected ' + name + ' to be typeof ' + expected + ', actual typeof was ' + actual; } /** * Throws if test is not defined * - * @param {*} test The value that is to be checked * @param {String} name The name of the variable being tested + * @param {*} test The value that is to be checked * @exception {DeveloperError} test must be defined */ - Check.defined = function (test, name) { + Check.defined = function (name, test) { if (!defined(test)) { throw new DeveloperError(getUndefinedErrorMessage(name)); } }; /** - * Throws if test is greater than maximum + * Throws if test is not typeof 'function' * - * @param {Number} test The value to test - * @param {Number} maximum The maximum allowed value - * @exception {DeveloperError} test must not be greater than maximum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'function' */ - Check.numeric.maximum = function (test, maximum) { - Check.typeOf.number(test); - Check.typeOf.number(maximum); - if (test > maximum) { - throw new DeveloperError('Expected ' + test + ' to be at most ' + maximum); + Check.typeOf.func = function (name, test) { + if (typeof test !== 'function') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); } }; /** - * Throws if test is less than minimum + * Throws if test is not typeof 'string' * - * @param {Number} test The value to test - * @param {Number} minimum The minimum allowed value - * @exception {DeveloperError} test must not be less than mininum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'string' */ - Check.numeric.minimum = function (test, minimum) { - Check.typeOf.number(test); - Check.typeOf.number(minimum); - if (test < minimum) { - throw new DeveloperError('Expected ' + test + ' to be at least ' + minimum); + Check.typeOf.string = function (name, test) { + if (typeof test !== 'string') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); } }; /** - * Throws if test is not typeof 'function' + * Throws if test is not typeof 'number' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'function' + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'number' */ - Check.typeOf.function = function (test, name) { - if (typeof test !== 'function') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); + Check.typeOf.number = function (name, test) { + if (typeof test !== 'number') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); } }; /** - * Throws if test is not typeof 'string' + * Throws if test is not typeof 'number' and less than limit * + * @param {String} name The name of the variable being tested * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than limit + */ + Check.typeOf.number.lessThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test >= limit) { + throw new DeveloperError('Expected ' + name + ' to be less than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and less than or equal to limit + * * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'string' + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than or equal to limit */ - Check.typeOf.string = function (test, name) { - if (typeof test !== 'string') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); + Check.typeOf.number.lessThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test > limit) { + throw new DeveloperError('Expected ' + name + ' to be less than or equal to ' + limit + ', actual value was ' + test); } }; /** - * Throws if test is not typeof 'number' + * Throws if test is not typeof 'number' and greater than limit * + * @param {String} name The name of the variable being tested * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than limit + */ + Check.typeOf.number.greaterThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test <= limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and greater than or equal to limit + * * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'number' + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than or equal to limit */ - Check.typeOf.number = function (test, name) { - if (typeof test !== 'number') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); + Check.typeOf.number.greaterThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test < limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than or equal to' + limit + ', actual value was ' + test); } }; /** * Throws if test is not typeof 'object' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested + * @param {*} test The value to test * @exception {DeveloperError} test must be typeof 'object' */ - Check.typeOf.object = function (test, name) { + Check.typeOf.object = function (name, test) { if (typeof test !== 'object') { throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'object', name)); } @@ -350,11 +283,11 @@ define('Core/Check',[ /** * Throws if test is not typeof 'boolean' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested + * @param {*} test The value to test * @exception {DeveloperError} test must be typeof 'boolean' */ - Check.typeOf.boolean = function (test, name) { + Check.typeOf.bool = function (name, test) { if (typeof test !== 'boolean') { throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'boolean', name)); } @@ -363,6 +296,68 @@ define('Core/Check',[ return Check; }); +/*global define*/ +define('Core/freezeObject',[ + './defined' + ], function( + defined) { + 'use strict'; + + /** + * Freezes an object, using Object.freeze if available, otherwise returns + * the object unchanged. This function should be used in setup code to prevent + * errors from completely halting JavaScript execution in legacy browsers. + * + * @private + * + * @exports freezeObject + */ + var freezeObject = Object.freeze; + if (!defined(freezeObject)) { + freezeObject = function(o) { + return o; + }; + } + + return freezeObject; +}); + +/*global define*/ +define('Core/defaultValue',[ + './freezeObject' + ], function( + freezeObject) { + 'use strict'; + + /** + * Returns the first parameter if not undefined, otherwise the second parameter. + * Useful for setting a default value for a parameter. + * + * @exports defaultValue + * + * @param {*} a + * @param {*} b + * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter. + * + * @example + * param = Cesium.defaultValue(param, 'default'); + */ + function defaultValue(a, b) { + if (a !== undefined) { + return a; + } + return b; + } + + /** + * A frozen empty object that can be used as the default value for options passed as + * an object literal. + */ + defaultValue.EMPTY_OBJECT = freezeObject({}); + + return defaultValue; +}); + /* I've wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace so it's better encapsulated. Now you can have multiple random number generators @@ -1047,7 +1042,7 @@ define('Core/Math',[ if (!defined(angle)) { throw new DeveloperError('angle is required.'); } - + return CesiumMath.clamp(angle, -1*CesiumMath.PI_OVER_TWO, CesiumMath.PI_OVER_TWO); }; @@ -1057,11 +1052,11 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [<code>-CesiumMath.PI</code>, <code>CesiumMath.PI</code>]. */ - CesiumMath.negativePiToPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.negativePiToPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - return CesiumMath.zeroToTwoPi(x + CesiumMath.PI) - CesiumMath.PI; + return CesiumMath.zeroToTwoPi(angle + CesiumMath.PI) - CesiumMath.PI; }; /** @@ -1070,12 +1065,12 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [0, <code>CesiumMath.TWO_PI</code>]. */ - CesiumMath.zeroToTwoPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.zeroToTwoPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - var mod = CesiumMath.mod(x, CesiumMath.TWO_PI); - if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(x) > CesiumMath.EPSILON14) { + var mod = CesiumMath.mod(angle, CesiumMath.TWO_PI); + if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(angle) > CesiumMath.EPSILON14) { return CesiumMath.TWO_PI; } return mod; @@ -1145,7 +1140,7 @@ define('Core/Math',[ * @example * //Compute 7!, which is equal to 5040 * var computedFactorial = Cesium.Math.factorial(7); - * + * * @see {@link http://en.wikipedia.org/wiki/Factorial|Factorial on Wikipedia} */ CesiumMath.factorial = function(n) { @@ -1429,7 +1424,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.fromSpherical = function(spherical, result) { - Check.typeOf.object(spherical, 'spherical'); + Check.typeOf.object('spherical', spherical); if (!defined(result)) { result = new Cartesian3(); @@ -1513,8 +1508,8 @@ define('Core/Cartesian3',[ * @returns {Number[]} The array that was packed into */ Cartesian3.pack = function(value, array, startingIndex) { - Check.typeOf.object(value, 'value'); - Check.defined(array, 'array'); + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1534,7 +1529,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.unpack = function(array, startingIndex, result) { - Check.defined(array, 'array'); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1555,7 +1550,7 @@ define('Core/Cartesian3',[ * @returns {Number[]} The packed array. */ Cartesian3.packArray = function(array, result) { - Check.defined(array, 'array'); + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -1578,8 +1573,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3[]} The unpacked array. */ Cartesian3.unpackArray = function(array, result) { - Check.defined(array, 'array'); - Check.numeric.minimum(array.length, 3); + Check.defined('array', array); + Check.typeOf.number.greaterThanOrEquals('array.length', array.length, 3); if (array.length % 3 !== 0) { throw new DeveloperError('array length must be a multiple of 3.'); } @@ -1625,7 +1620,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the maximum component. */ Cartesian3.maximumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z); }; @@ -1637,7 +1632,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the minimum component. */ Cartesian3.minimumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z); }; @@ -1651,9 +1646,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the minimum components. */ Cartesian3.minimumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -1671,9 +1666,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the maximum components. */ Cartesian3.maximumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -1688,7 +1683,7 @@ define('Core/Cartesian3',[ * @returns {Number} The squared magnitude. */ Cartesian3.magnitudeSquared = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z; }; @@ -1717,8 +1712,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distance(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(2.0, 0.0, 0.0)); */ Cartesian3.distance = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitude(distanceScratch); @@ -1737,8 +1732,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distanceSquared(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(3.0, 0.0, 0.0)); */ Cartesian3.distanceSquared = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitudeSquared(distanceScratch); @@ -1752,8 +1747,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.normalize = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian3.magnitude(cartesian); @@ -1776,8 +1771,8 @@ define('Core/Cartesian3',[ * @returns {Number} The dot product. */ Cartesian3.dot = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z; }; @@ -1791,9 +1786,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyComponents = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -1835,9 +1830,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.add = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -1854,9 +1849,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.subtract = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -1873,9 +1868,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -1892,9 +1887,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.divideByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -1910,8 +1905,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.negate = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -1927,8 +1922,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.abs = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -1947,10 +1942,10 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.lerp = function(start, end, t, result) { - Check.typeOf.object(start, 'start'); - Check.typeOf.object(end, 'end'); - Check.typeOf.number(t, 't'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian3.multiplyByScalar(end, t, lerpScratch); result = Cartesian3.multiplyByScalar(start, 1.0 - t, result); @@ -1967,8 +1962,8 @@ define('Core/Cartesian3',[ * @returns {Number} The angle between the Cartesians. */ Cartesian3.angleBetween = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.normalize(left, angleBetweenScratch); Cartesian3.normalize(right, angleBetweenScratch2); @@ -1986,8 +1981,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The most orthogonal axis. */ Cartesian3.mostOrthogonalAxis = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian3.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian3.abs(f, f); @@ -2064,9 +2059,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The cross product. */ Cartesian3.cross = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var leftX = left.x; var leftY = left.y; @@ -2099,8 +2094,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromDegrees(-115.0, 37.0); */ Cartesian3.fromDegrees = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); longitude = CesiumMath.toRadians(longitude); latitude = CesiumMath.toRadians(latitude); @@ -2125,8 +2120,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromRadians(-2.007, 0.645); */ Cartesian3.fromRadians = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); height = defaultValue(height, 0.0); var radiiSquared = defined(ellipsoid) ? ellipsoid.radiiSquared : wgs84RadiiSquared; @@ -2160,7 +2155,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArray([-115.0, 37.0, -107.0, 33.0]); */ Cartesian3.fromDegreesArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -2194,7 +2189,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArray([-2.007, 0.645, -1.867, .575]); */ Cartesian3.fromRadiansArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -2228,7 +2223,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArrayHeights([-115.0, 37.0, 100000.0, -107.0, 33.0, 150000.0]); */ Cartesian3.fromDegreesArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -2263,7 +2258,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArrayHeights([-2.007, 0.645, 100000.0, -1.867, .575, 150000.0]); */ Cartesian3.fromRadiansArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -3010,7 +3005,9 @@ define('Core/Ellipsoid',[ /** * Computes an Ellipsoid from a Cartesian specifying the radii in x, y, and z directions. * - * @param {Cartesian3} [radii=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Cartesian3} [cartesian=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new + * instance should be created. * @returns {Ellipsoid} A new Ellipsoid instance. * * @exception {DeveloperError} All radii components must be greater than or equal to zero. @@ -3650,6 +3647,7 @@ define('Core/Interval',[ /*global define*/ define('Core/Matrix3',[ './Cartesian3', + './Check', './defaultValue', './defined', './defineProperties', @@ -3658,6 +3656,7 @@ define('Core/Matrix3',[ './Math' ], function( Cartesian3, + Check, defaultValue, defined, defineProperties, @@ -3720,13 +3719,8 @@ define('Core/Matrix3',[ * @returns {Number[]} The array that was packed into */ Matrix3.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3752,9 +3746,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. */ Matrix3.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3781,24 +3773,24 @@ define('Core/Matrix3',[ * @param {Matrix3} [result] The object onto which to store the result. * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. (Returns undefined if matrix is undefined) */ - Matrix3.clone = function(values, result) { - if (!defined(values)) { + Matrix3.clone = function(matrix, result) { + if (!defined(matrix)) { return undefined; } if (!defined(result)) { - return new Matrix3(values[0], values[3], values[6], - values[1], values[4], values[7], - values[2], values[5], values[8]); + return new Matrix3(matrix[0], matrix[3], matrix[6], + matrix[1], matrix[4], matrix[7], + matrix[2], matrix[5], matrix[8]); } - result[0] = values[0]; - result[1] = values[1]; - result[2] = values[2]; - result[3] = values[3]; - result[4] = values[4]; - result[5] = values[5]; - result[6] = values[6]; - result[7] = values[7]; - result[8] = values[8]; + result[0] = matrix[0]; + result[1] = matrix[1]; + result[2] = matrix[2]; + result[3] = matrix[3]; + result[4] = matrix[4]; + result[5] = matrix[5]; + result[6] = matrix[6]; + result[7] = matrix[7]; + result[8] = matrix[8]; return result; }; @@ -3824,9 +3816,7 @@ define('Core/Matrix3',[ * var m2 = Cesium.Matrix3.fromArray(v2, 2); */ Matrix3.fromArray = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3854,9 +3844,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values parameter is required'); - } + Check.defined('values', values); return Matrix3.clone(values, result); }; @@ -3870,9 +3858,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix3(values[0], values[1], values[2], @@ -3899,9 +3885,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this quaternion. */ Matrix3.fromQuaternion = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); var x2 = quaternion.x * quaternion.x; var xy = quaternion.x * quaternion.y; @@ -3951,10 +3935,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this headingPitchRoll. */ Matrix3.fromHeadingPitchRoll = function(headingPitchRoll, result) { - if (!defined(headingPitchRoll)) { - throw new DeveloperError('headingPitchRoll is required'); - } - var cosTheta = Math.cos(-headingPitchRoll.pitch); + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + + var cosTheta = Math.cos(-headingPitchRoll.pitch); var cosPsi = Math.cos(-headingPitchRoll.heading); var cosPhi = Math.cos(headingPitchRoll.roll); var sinTheta = Math.sin(-headingPitchRoll.pitch); @@ -4005,9 +3988,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix3( @@ -4043,9 +4024,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromUniformScale(2.0); */ Matrix3.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix3( @@ -4069,7 +4048,7 @@ define('Core/Matrix3',[ /** * Computes a Matrix3 instance representing the cross product equivalent matrix of a Cartesian3 vector. * - * @param {Cartesian3} the vector on the left hand side of the cross product operation. + * @param {Cartesian3} vector the vector on the left hand side of the cross product operation. * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created. * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. * @@ -4081,9 +4060,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromCrossProduct(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromCrossProduct = function(vector, result) { - if (!defined(vector)) { - throw new DeveloperError('vector is required.'); - } + Check.typeOf.object('vector', vector); if (!defined(result)) { return new Matrix3( @@ -4118,9 +4095,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationX = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4159,9 +4134,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationY = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4200,9 +4173,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationZ = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4236,9 +4207,7 @@ define('Core/Matrix3',[ * @returns {Number[]} The modified Array parameter or a new Array instance if one was not provided. */ Matrix3.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5], matrix[6], matrix[7], matrix[8]]; @@ -4272,12 +4241,10 @@ define('Core/Matrix3',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix3.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 2) { - throw new DeveloperError('row must be 0, 1, or 2.'); - } - if (typeof column !== 'number' || column < 0 || column > 2) { - throw new DeveloperError('column must be 0, 1, or 2.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 2); + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 2); return column * 3 + row; }; @@ -4293,16 +4260,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var startIndex = index * 3; var x = matrix[startIndex]; @@ -4327,18 +4288,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); var startIndex = index * 3; @@ -4359,15 +4313,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 3]; @@ -4391,18 +4340,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); result[index] = cartesian.x; @@ -4421,12 +4363,8 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[3], matrix[4], matrix[5], scratchColumn)); @@ -4457,15 +4395,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var column0Row0 = left[0] * right[0] + left[3] * right[1] + left[6] * right[2]; var column0Row1 = left[1] * right[0] + left[4] * right[1] + left[7] * right[2]; @@ -4500,15 +4432,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -4531,15 +4457,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -4562,15 +4482,9 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -4595,15 +4509,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -4634,15 +4542,9 @@ define('Core/Matrix3',[ * @see Matrix3.multiplyByUniformScale */ Matrix3.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); result[0] = matrix[0] * scale.x; result[1] = matrix[1] * scale.x; @@ -4664,12 +4566,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -4691,12 +4589,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var column0Row0 = matrix[0]; var column0Row1 = matrix[3]; @@ -4836,9 +4730,7 @@ define('Core/Matrix3',[ * var c = Cesium.Cartesian3.multiplyByScalar(v, lambda, new Cesium.Cartesian3()); // equal to Cesium.Matrix3.multiplyByVector(a, v) */ Matrix3.computeEigenDecomposition = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); // This routine was created based upon Matrix Computations, 3rd ed., by Golub and Van Loan, // section 8.4.3 The Classical Jacobi Algorithm @@ -4882,12 +4774,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -4909,9 +4797,7 @@ define('Core/Matrix3',[ * @returns {Number} The value of the determinant of the matrix. */ Matrix3.determinant = function(matrix) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); var m11 = matrix[0]; var m21 = matrix[3]; @@ -4936,12 +4822,8 @@ define('Core/Matrix3',[ * @exception {DeveloperError} matrix is not invertible. */ Matrix3.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var m11 = matrix[0]; var m21 = matrix[1]; @@ -5007,9 +4889,7 @@ define('Core/Matrix3',[ * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. */ Matrix3.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -5197,12 +5077,14 @@ define('Core/Matrix3',[ /*global define*/ define('Core/Cartesian4',[ + './Check', './defaultValue', './defined', './DeveloperError', './freezeObject', './Math' ], function( + Check, defaultValue, defined, DeveloperError, @@ -5285,9 +5167,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.fromColor = function(color, result) { - if (!defined(color)) { - throw new DeveloperError('color is required'); - } + Check.typeOf.object('color', color); if (!defined(result)) { return new Cartesian4(color.red, color.green, color.blue, color.alpha); } @@ -5339,12 +5219,8 @@ define('Core/Cartesian4',[ * @returns {Number[]} The array that was packed into */ Cartesian4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5365,9 +5241,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5389,9 +5263,7 @@ define('Core/Cartesian4',[ * @returns {Number[]} The packed array. */ Cartesian4.packArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -5414,9 +5286,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4[]} The unpacked array. */ Cartesian4.unpackArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -5459,9 +5329,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the maximum component. */ Cartesian4.maximumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -5473,9 +5341,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the minimum component. */ Cartesian4.minimumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -5489,15 +5355,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the minimum components. */ Cartesian4.minimumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -5516,15 +5376,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the maximum components. */ Cartesian4.maximumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -5541,9 +5395,7 @@ define('Core/Cartesian4',[ * @returns {Number} The squared magnitude. */ Cartesian4.magnitudeSquared = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z + cartesian.w * cartesian.w; }; @@ -5574,9 +5426,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(2.0, 0.0, 0.0, 0.0)); */ Cartesian4.distance = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitude(distanceScratch); @@ -5597,9 +5448,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(3.0, 0.0, 0.0, 0.0)); */ Cartesian4.distanceSquared = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitudeSquared(distanceScratch); @@ -5613,12 +5463,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.normalize = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian4.magnitude(cartesian); @@ -5642,12 +5488,8 @@ define('Core/Cartesian4',[ * @returns {Number} The dot product. */ Cartesian4.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w; }; @@ -5661,15 +5503,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -5687,15 +5523,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x / right.x; result.y = left.y / right.y; @@ -5713,15 +5543,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -5739,15 +5563,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -5765,15 +5583,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -5791,15 +5603,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -5816,12 +5622,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.negate = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -5838,12 +5640,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.abs = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -5863,18 +5661,10 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian4.multiplyByScalar(end, t, lerpScratch); result = Cartesian4.multiplyByScalar(start, 1.0 - t, result); @@ -5890,12 +5680,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The most orthogonal axis. */ Cartesian4.mostOrthogonalAxis = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian4.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian4.abs(f, f); @@ -6140,6 +5926,7 @@ define('Core/RuntimeError',[ define('Core/Matrix4',[ './Cartesian3', './Cartesian4', + './Check', './defaultValue', './defined', './defineProperties', @@ -6151,6 +5938,7 @@ define('Core/Matrix4',[ ], function( Cartesian3, Cartesian4, + Check, defaultValue, defined, defineProperties, @@ -6241,13 +6029,8 @@ define('Core/Matrix4',[ * @returns {Number[]} The array that was packed into */ Matrix4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -6280,9 +6063,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if one was not provided. */ Matrix4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -6378,9 +6159,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required'); - } + Check.defined('values', values); return Matrix4.clone(values, result); }; @@ -6394,9 +6173,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix4(values[0], values[1], values[2], values[3], @@ -6433,9 +6210,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRotationTranslation = function(rotation, translation, result) { - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } + Check.typeOf.object('rotation', rotation); translation = defaultValue(translation, Cartesian3.ZERO); @@ -6483,15 +6258,9 @@ define('Core/Matrix4',[ * result); */ Matrix4.fromTranslationQuaternionRotationScale = function(translation, rotation, scale, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('translation', translation); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('scale', scale); if (!defined(result)) { result = new Matrix4(); @@ -6552,9 +6321,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromTranslationRotationScale = function(translationRotationScale, result) { - if (!defined(translationRotationScale)) { - throw new DeveloperError('translationRotationScale is required.'); - } + Check.typeOf.object('translationRotationScale', translationRotationScale); return Matrix4.fromTranslationQuaternionRotationScale(translationRotationScale.translation, translationRotationScale.rotation, translationRotationScale.scale, result); }; @@ -6569,9 +6336,7 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByTranslation */ Matrix4.fromTranslation = function(translation, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } + Check.typeOf.object('translation', translation); return Matrix4.fromRotationTranslation(Matrix3.IDENTITY, translation, result); }; @@ -6592,9 +6357,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix4.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix4( @@ -6639,9 +6402,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromUniformScale(2.0); */ Matrix4.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix4(scale, 0.0, 0.0, 0.0, @@ -6681,23 +6442,15 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromCamera = function(camera, result) { - if (!defined(camera)) { - throw new DeveloperError('camera is required.'); - } + Check.typeOf.object('camera', camera); var position = camera.position; var direction = camera.direction; var up = camera.up; - if (!defined(position)) { - throw new DeveloperError('camera.position is required.'); - } - if (!defined(direction)) { - throw new DeveloperError('camera.direction is required.'); - } - if (!defined(up)) { - throw new DeveloperError('camera.up is required.'); - } + Check.typeOf.object('camera.position', position); + Check.typeOf.object('camera.direction', direction); + Check.typeOf.object('camera.up', up); Cartesian3.normalize(direction, fromCameraF); Cartesian3.normalize(Cartesian3.cross(fromCameraF, up, fromCameraR), fromCameraR); @@ -6776,21 +6529,11 @@ define('Core/Matrix4',[ * @exception {DeveloperError} far must be greater than zero. */ Matrix4.computePerspectiveFieldOfView = function(fovY, aspectRatio, near, far, result) { - if (fovY <= 0.0 || fovY > Math.PI) { - throw new DeveloperError('fovY must be in (0, PI].'); - } - if (aspectRatio <= 0.0) { - throw new DeveloperError('aspectRatio must be greater than zero.'); - } - if (near <= 0.0) { - throw new DeveloperError('near must be greater than zero.'); - } - if (far <= 0.0) { - throw new DeveloperError('far must be greater than zero.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThan('fovY', fovY, 0.0); + Check.typeOf.number.lessThan('fovY', fovY, Math.PI); + Check.typeOf.number.greaterThan('near', near, 0.0); + Check.typeOf.number.greaterThan('far', far, 0.0); + Check.typeOf.object('result', result); var bottom = Math.tan(fovY * 0.5); @@ -6831,27 +6574,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeOrthographicOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var a = 1.0 / (right - left); var b = 1.0 / (top - bottom); @@ -6896,27 +6625,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computePerspectiveOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -6957,24 +6672,12 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeInfinitePerspectiveOffCenter = function(left, right, bottom, top, near, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -7022,9 +6725,7 @@ define('Core/Matrix4',[ * }, 0.0, 1.0, new Cesium.Matrix4()); */ Matrix4.computeViewportTransformation = function(viewport, nearDepthRange, farDepthRange, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); viewport = defaultValue(viewport, defaultValue.EMPTY_OBJECT); var x = defaultValue(viewport.x, 0.0); @@ -7076,21 +6777,11 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeView = function(position, direction, up, right, result) { - if (!defined(position)) { - throw new DeveloperError('position is required'); - } - if (!defined(direction)) { - throw new DeveloperError('direction is required'); - } - if (!defined(up)) { - throw new DeveloperError('up is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); + Check.typeOf.object('up', up); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = right.x; result[1] = up.x; @@ -7131,9 +6822,7 @@ define('Core/Matrix4',[ * //creates a = [10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0] */ Matrix4.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], @@ -7177,12 +6866,11 @@ define('Core/Matrix4',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix4.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 3) { - throw new DeveloperError('row must be 0, 1, 2, or 3.'); - } - if (typeof column !== 'number' || column < 0 || column > 3) { - throw new DeveloperError('column must be 0, 1, 2, or 3.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 3); + + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 3); return column * 4 + row; }; @@ -7215,16 +6903,12 @@ define('Core/Matrix4',[ * // a.x = 12.0; a.y = 16.0; a.z = 20.0; a.w = 24.0; */ Matrix4.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var startIndex = index * 4; var x = matrix[startIndex]; @@ -7266,18 +6950,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 96.0, 25.0] */ Matrix4.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); var startIndex = index * 4; @@ -7298,15 +6977,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.setTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -7359,16 +7032,12 @@ define('Core/Matrix4',[ * // a.x = 18.0; a.y = 19.0; a.z = 20.0; a.w = 21.0; */ Matrix4.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 4]; @@ -7409,18 +7078,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 24.0, 25.0] */ Matrix4.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); result[index] = cartesian.x; @@ -7440,12 +7104,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter */ Matrix4.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[4], matrix[5], matrix[6], scratchColumn)); @@ -7477,15 +7137,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -7569,15 +7223,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -7607,15 +7255,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -7656,15 +7298,9 @@ define('Core/Matrix4',[ * var m3 = Cesium.Matrix4.multiplyTransformation(m1, m2, new Cesium.Matrix4()); */ Matrix4.multiplyTransformation = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -7742,15 +7378,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByMatrix3(m, rotation, m); */ Matrix4.multiplyByMatrix3 = function(matrix, rotation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('result', result); var left0 = matrix[0]; var left1 = matrix[1]; @@ -7818,15 +7448,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByTranslation(m, position, m); */ Matrix4.multiplyByTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); var x = translation.x; var y = translation.y; @@ -7878,15 +7502,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByScale */ Matrix4.multiplyByUniformScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scale', scale); + Check.typeOf.object('result', result); uniformScaleScratch.x = scale; uniformScaleScratch.y = scale; @@ -7915,15 +7533,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByUniformScale */ Matrix4.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); var scaleX = scale.x; var scaleY = scale.y; @@ -7962,15 +7574,9 @@ define('Core/Matrix4',[ * @returns {Cartesian4} The modified result parameter. */ Matrix4.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8006,15 +7612,9 @@ define('Core/Matrix4',[ * // Cesium.Matrix4.multiplyByVector(matrix, new Cesium.Cartesian4(p.x, p.y, p.z, 0.0), result); */ Matrix4.multiplyByPointAsVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8044,16 +7644,9 @@ define('Core/Matrix4',[ * var result = Cesium.Matrix4.multiplyByPoint(matrix, p, new Cesium.Cartesian3()); */ Matrix4.multiplyByPoint = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8093,15 +7686,9 @@ define('Core/Matrix4',[ * // [-44.0, -46.0, -48.0, -50.0] */ Matrix4.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -8145,12 +7732,8 @@ define('Core/Matrix4',[ * // [-22.0, -23.0, -24.0, -25.0] */ Matrix4.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -8194,12 +7777,8 @@ define('Core/Matrix4',[ * // [13.0, 17.0, 21.0, 25.0] */ Matrix4.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var matrix1 = matrix[1]; var matrix2 = matrix[2]; @@ -8235,12 +7814,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -8354,9 +7929,7 @@ define('Core/Matrix4',[ * //Prints "Difference between both the matrices is not less than 0.1" on the console */ Matrix4.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -8387,12 +7960,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter. */ Matrix4.getTranslation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = matrix[12]; result.y = matrix[13]; @@ -8423,12 +7992,8 @@ define('Core/Matrix4',[ * // [12.0, 16.0, 20.0] */ Matrix4.getRotation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -8460,12 +8025,8 @@ define('Core/Matrix4',[ * @exception {RuntimeError} matrix is not invertible because its determinate is zero. */ Matrix4.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); // Special case for a zero scale matrix that can occur, for example, // when a model's node has a [0, 0, 0] scale. @@ -8603,12 +8164,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.inverseTransformation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); //This function is an optimized version of the below 4 lines. //var rT = Matrix3.transpose(Matrix4.getRotation(matrix)); @@ -8892,6 +8449,7 @@ define('Core/Matrix4',[ /*global define*/ define('Core/Rectangle',[ './Cartographic', + './Check', './defaultValue', './defined', './defineProperties', @@ -8901,6 +8459,7 @@ define('Core/Rectangle',[ './Math' ], function( Cartographic, + Check, defaultValue, defined, defineProperties, @@ -8997,13 +8556,8 @@ define('Core/Rectangle',[ * @returns {Number[]} The array that was packed into */ Rectangle.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -9024,9 +8578,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -9047,9 +8599,7 @@ define('Core/Rectangle',[ * @returns {Number} The width. */ Rectangle.computeWidth = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; if (east < west) { @@ -9064,9 +8614,7 @@ define('Core/Rectangle',[ * @returns {Number} The height. */ Rectangle.computeHeight = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); return rectangle.north - rectangle.south; }; @@ -9093,10 +8641,36 @@ define('Core/Rectangle',[ return new Rectangle(west, south, east, north); } - result.west = west; - result.south = south; - result.east = east; - result.north = north; + result.west = west; + result.south = south; + result.east = east; + result.north = north; + + return result; + }; + + /** + * Creates an rectangle given the boundary longitude and latitude in radians. + * + * @param {Number} [west=0.0] The westernmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [south=0.0] The southernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Number} [east=0.0] The easternmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [north=0.0] The northernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Rectangle} [result] The object onto which to store the result, or undefined if a new instance should be created. + * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. + * + * @example + * var rectangle = Cesium.Rectangle.fromRadians(0.0, Math.PI/4, Math.PI/8, 3*Math.PI/4); + */ + Rectangle.fromRadians = function(west, south, east, north, result) { + if (!defined(result)) { + return new Rectangle(west, south, east, north); + } + + result.west = defaultValue(west, 0.0); + result.south = defaultValue(south, 0.0); + result.east = defaultValue(east, 0.0); + result.north = defaultValue(north, 0.0); return result; }; @@ -9109,9 +8683,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartographicArray = function(cartographics, result) { - if (!defined(cartographics)) { - throw new DeveloperError('cartographics is required.'); - } + Check.defined('cartographics', cartographics); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -9164,9 +8736,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartesianArray = function(cartesians, ellipsoid, result) { - if (!defined(cartesians)) { - throw new DeveloperError('cartesians is required.'); - } + Check.defined('cartesians', cartesians); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -9282,9 +8852,7 @@ define('Core/Rectangle',[ * @returns {Boolean} <code>true</code> if the Rectangles are within the provided epsilon, <code>false</code> otherwise. */ Rectangle.prototype.equalsEpsilon = function(other, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon is required and must be a number.'); - } + Check.typeOf.number('epsilon', epsilon); return defined(other) && (Math.abs(this.west - other.west) <= epsilon) && @@ -9304,45 +8872,23 @@ define('Core/Rectangle',[ * @exception {DeveloperError} <code>west</code> must be in the interval [<code>-Pi</code>, <code>Pi</code>]. */ Rectangle.validate = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var north = rectangle.north; - if (typeof north !== 'number') { - throw new DeveloperError('north is required to be a number.'); - } - - if (north < -CesiumMath.PI_OVER_TWO || north > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('north must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('north', north, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('north', north, CesiumMath.PI_OVER_TWO); var south = rectangle.south; - if (typeof south !== 'number') { - throw new DeveloperError('south is required to be a number.'); - } - - if (south < -CesiumMath.PI_OVER_TWO || south > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('south must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('south', south, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('south', south, CesiumMath.PI_OVER_TWO); var west = rectangle.west; - if (typeof west !== 'number') { - throw new DeveloperError('west is required to be a number.'); - } - - if (west < -Math.PI || west > Math.PI) { - throw new DeveloperError('west must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('west', west, -Math.PI); + Check.typeOf.number.lessThanOrEquals('west', west, Math.PI); var east = rectangle.east; - if (typeof east !== 'number') { - throw new DeveloperError('east is required to be a number.'); - } - - if (east < -Math.PI || east > Math.PI) { - throw new DeveloperError('east must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('east', east, -Math.PI); + Check.typeOf.number.lessThanOrEquals('east', east, Math.PI); }; /** @@ -9353,9 +8899,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.south); @@ -9374,9 +8918,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.north); @@ -9395,9 +8937,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.north); @@ -9416,9 +8956,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.south); @@ -9437,9 +8975,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.center = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; @@ -9474,12 +9010,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.intersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var rectangleEast = rectangle.east; var rectangleWest = rectangle.west; @@ -9535,12 +9067,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.simpleIntersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var west = Math.max(rectangle.west, otherRectangle.west); var south = Math.max(rectangle.south, otherRectangle.south); @@ -9571,12 +9099,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.union = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); if (!defined(result)) { result = new Rectangle(); @@ -9620,12 +9144,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.expand = function(rectangle, cartographic, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); if (!defined(result)) { result = new Rectangle(); @@ -9647,12 +9167,8 @@ define('Core/Rectangle',[ * @returns {Boolean} true if the provided cartographic is inside the rectangle, false otherwise. */ Rectangle.contains = function(rectangle, cartographic) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); var longitude = cartographic.longitude; var latitude = cartographic.latitude; @@ -9685,9 +9201,7 @@ define('Core/Rectangle',[ * @returns {Cartesian3[]} The modified result parameter or a new Array of Cartesians instances if none was provided. */ Rectangle.subsample = function(rectangle, ellipsoid, surfaceHeight, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84); surfaceHeight = defaultValue(surfaceHeight, 0.0); @@ -9765,9 +9279,9 @@ define('Core/Rectangle',[ define('Core/BoundingSphere',[ './Cartesian3', './Cartographic', + './Check', './defaultValue', './defined', - './DeveloperError', './Ellipsoid', './GeographicProjection', './Intersect', @@ -9778,9 +9292,9 @@ define('Core/BoundingSphere',[ ], function( Cartesian3, Cartographic, + Check, defaultValue, defined, - DeveloperError, Ellipsoid, GeographicProjection, Intersect, @@ -10110,9 +9624,7 @@ define('Core/BoundingSphere',[ stride = defaultValue(stride, 3); - if (stride < 3) { - throw new DeveloperError('stride must be 3 or greater.'); - } + Check.typeOf.number.greaterThanOrEquals('stride', stride, 3); var currentPos = fromPointsCurrentPos; currentPos.x = positions[0] + center.x; @@ -10416,9 +9928,8 @@ define('Core/BoundingSphere',[ * var sphere = Cesium.BoundingSphere.fromCornerPoints(new Cesium.Cartesian3(-0.5, -0.5, -0.5), new Cesium.Cartesian3(0.5, 0.5, 0.5)); */ BoundingSphere.fromCornerPoints = function(corner, oppositeCorner, result) { - if (!defined(corner) || !defined(oppositeCorner)) { - throw new DeveloperError('corner and oppositeCorner are required.'); - } + Check.typeOf.object('corner', corner); + Check.typeOf.object('oppositeCorner', oppositeCorner); if (!defined(result)) { result = new BoundingSphere(); @@ -10442,9 +9953,7 @@ define('Core/BoundingSphere',[ * var boundingSphere = Cesium.BoundingSphere.fromEllipsoid(ellipsoid); */ BoundingSphere.fromEllipsoid = function(ellipsoid, result) { - if (!defined(ellipsoid)) { - throw new DeveloperError('ellipsoid is required.'); - } + Check.typeOf.object('ellipsoid', ellipsoid); if (!defined(result)) { result = new BoundingSphere(); @@ -10570,13 +10079,8 @@ define('Core/BoundingSphere',[ * @returns {Number[]} The array that was packed into */ BoundingSphere.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -10598,9 +10102,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if one was not provided. */ BoundingSphere.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -10627,13 +10129,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.union = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); if (!defined(result)) { result = new BoundingSphere(); @@ -10682,13 +10179,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.expand = function(sphere, point, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(point)) { - throw new DeveloperError('point is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('point', point); result = BoundingSphere.clone(sphere, result); @@ -10711,13 +10203,8 @@ define('Core/BoundingSphere',[ * intersects the plane. */ BoundingSphere.intersectPlane = function(sphere, plane) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(plane)) { - throw new DeveloperError('plane is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('plane', plane); var center = sphere.center; var radius = sphere.radius; @@ -10743,13 +10230,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.transform = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -10777,12 +10259,8 @@ define('Core/BoundingSphere',[ * }); */ BoundingSphere.distanceSquaredTo = function(sphere, cartesian) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('cartesian', cartesian); var diff = Cartesian3.subtract(sphere.center, cartesian, distanceSquaredToScratch); return Cartesian3.magnitudeSquared(diff) - sphere.radius * sphere.radius; @@ -10804,13 +10282,8 @@ define('Core/BoundingSphere',[ * var newBoundingSphere = Cesium.BoundingSphere.transformWithoutScale(boundingSphere, modelMatrix); */ BoundingSphere.transformWithoutScale = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -10837,17 +10310,9 @@ define('Core/BoundingSphere',[ * @returns {Interval} The nearest and farthest distances on the bounding sphere from position in direction. */ BoundingSphere.computePlaneDistances = function(sphere, position, direction, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(position)) { - throw new DeveloperError('position is required.'); - } - - if (!defined(direction)) { - throw new DeveloperError('direction is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); if (!defined(result)) { result = new Interval(); @@ -10882,9 +10347,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.projectTo2D = function(sphere, projection, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } + Check.typeOf.object('sphere', sphere); projection = defaultValue(projection, projectTo2DProjection); @@ -10979,12 +10442,8 @@ define('Core/BoundingSphere',[ * @returns {Boolean} <code>true</code> if the sphere is not visible; otherwise <code>false</code>. */ BoundingSphere.isOccluded = function(sphere, occluder) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(occluder)) { - throw new DeveloperError('occluder is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('occluder', occluder); return !occluder.isBoundingSphereVisible(sphere); }; @@ -11085,12 +10544,14 @@ define('Core/BoundingSphere',[ /*global define*/ define('Core/Cartesian2',[ + './Check', './defaultValue', './defined', './DeveloperError', './freezeObject', './Math' ], function( + Check, defaultValue, defined, DeveloperError, @@ -11202,12 +10663,8 @@ define('Core/Cartesian2',[ * @returns {Number[]} The array that was packed into */ Cartesian2.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -11226,9 +10683,7 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided. */ Cartesian2.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -11248,9 +10703,7 @@ define('Core/Cartesian2',[ * @returns {Number[]} The packed array. */ Cartesian2.packArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -11273,9 +10726,7 @@ define('Core/Cartesian2',[ * @returns {Cartesian2[]} The unpacked array. */ Cartesian2.unpackArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -11318,9 +10769,7 @@ define('Core/Cartesian2',[ * @returns {Number} The value of the maximum component. */ Cartesian2.maximumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y); }; @@ -11332,9 +10781,7 @@ define('Core/Cartesian2',[ * @returns {Number} The value of the minimum component. */ Cartesian2.minimumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y); }; @@ -11348,15 +10795,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} A cartesian with the minimum components. */ Cartesian2.minimumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); @@ -11374,15 +10815,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} A cartesian with the maximum components. */ Cartesian2.maximumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -11396,9 +10831,7 @@ define('Core/Cartesian2',[ * @returns {Number} The squared magnitude. */ Cartesian2.magnitudeSquared = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y; }; @@ -11464,12 +10897,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.normalize = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian2.magnitude(cartesian); @@ -11491,12 +10920,8 @@ define('Core/Cartesian2',[ * @returns {Number} The dot product. */ Cartesian2.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y; }; @@ -11510,15 +10935,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.multiplyComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -11534,15 +10953,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.divideComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x / right.x; result.y = left.y / right.y; @@ -11558,15 +10971,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -11582,15 +10989,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -11606,15 +11007,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.multiplyByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -11630,15 +11025,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.divideByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -11653,12 +11042,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.negate = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -11673,12 +11058,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.abs = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -11696,18 +11077,10 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian2.multiplyByScalar(end, t, lerpScratch); result = Cartesian2.multiplyByScalar(start, 1.0 - t, result); @@ -11724,12 +11097,8 @@ define('Core/Cartesian2',[ * @returns {Number} The angle between the Cartesians. */ Cartesian2.angleBetween = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian2.normalize(left, angleBetweenScratch); Cartesian2.normalize(right, angleBetweenScratch2); @@ -11745,12 +11114,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The most orthogonal axis. */ Cartesian2.mostOrthogonalAxis = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian2.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian2.abs(f, f); @@ -12988,7 +12353,10 @@ define('Core/WebGLConstants',[ COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : 0x9279, TEXTURE_IMMUTABLE_FORMAT : 0x912F, MAX_ELEMENT_INDEX : 0x8D6B, - TEXTURE_IMMUTABLE_LEVELS : 0x82DF + TEXTURE_IMMUTABLE_LEVELS : 0x82DF, + + // Extensions + MAX_TEXTURE_MAX_ANISOTROPY_EXT : 0x84FF }; return freezeObject(WebGLConstants); @@ -13324,6 +12692,7 @@ define('Core/ComponentDatatype',[ /*global define*/ define('Core/Quaternion',[ './Cartesian3', + './Check', './defaultValue', './defined', './DeveloperError', @@ -13333,6 +12702,7 @@ define('Core/Quaternion',[ './Matrix3' ], function( Cartesian3, + Check, defaultValue, defined, DeveloperError, @@ -13395,12 +12765,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided. */ Quaternion.fromAxisAngle = function(axis, angle, result) { - if (!defined(axis)) { - throw new DeveloperError('axis is required.'); - } - if (typeof angle !== 'number') { - throw new DeveloperError('angle is required and must be a number.'); - } + Check.typeOf.object('axis', axis); + Check.typeOf.number('angle', angle); var halfAngle = angle / 2.0; var s = Math.sin(halfAngle); @@ -13432,9 +12798,7 @@ define('Core/Quaternion',[ * @see Matrix3.fromQuaternion */ Quaternion.fromRotationMatrix = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); var root; var x; @@ -13504,19 +12868,13 @@ define('Core/Quaternion',[ * @param {Number} heading The heading angle in radians. * @param {Number} pitch The pitch angle in radians. * @param {Number} roll The roll angle in radians. - * @param {Quaternion} [result] The object onto which to store the result. - * @returns {Quaternion} The modified result parameter or a new Quaternion instance if none was provided. - */ - Quaternion.fromHeadingPitchRoll = function(heading, pitch, roll, result) { - if (!defined(heading)) { - throw new DeveloperError('heading is required.'); - } - if (!defined(pitch)) { - throw new DeveloperError('pitch is required.'); - } - if (!defined(roll)) { - throw new DeveloperError('roll is required.'); - } + * @param {Quaternion} [result] The object onto which to store the result. + * @returns {Quaternion} The modified result parameter or a new Quaternion instance if none was provided. + */ + Quaternion.fromHeadingPitchRoll = function(heading, pitch, roll, result) { + Check.typeOf.number('heading', heading); + Check.typeOf.number('pitch', pitch); + Check.typeOf.number('roll', roll); var rollQuaternion = Quaternion.fromAxisAngle(Cartesian3.UNIT_X, roll, scratchHPRQuaternion); var pitchQuaternion = Quaternion.fromAxisAngle(Cartesian3.UNIT_Y, -pitch, result); @@ -13547,13 +12905,8 @@ define('Core/Quaternion',[ * @returns {Number[]} The array that was packed into */ Quaternion.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -13574,9 +12927,7 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided. */ Quaternion.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -13631,7 +12982,7 @@ define('Core/Quaternion',[ * * @param {Number[]} array The array previously packed for interpolation. * @param {Number[]} sourceArray The original packed array. - * @param {Number} [startingIndex=0] The startingIndex used to convert the array. + * @param {Number} [firstIndex=0] The firstIndex used to convert the array. * @param {Number} [lastIndex=packedArray.length] The lastIndex used to convert the array. * @param {Quaternion} [result] The object into which to store the result. * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided. @@ -13685,12 +13036,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.conjugate = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); result.x = -quaternion.x; result.y = -quaternion.y; @@ -13706,9 +13053,7 @@ define('Core/Quaternion',[ * @returns {Number} The magnitude squared. */ Quaternion.magnitudeSquared = function(quaternion) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); return quaternion.x * quaternion.x + quaternion.y * quaternion.y + quaternion.z * quaternion.z + quaternion.w * quaternion.w; }; @@ -13731,9 +13076,7 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.normalize = function(quaternion, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); var inverseMagnitude = 1.0 / Quaternion.magnitude(quaternion); var x = quaternion.x * inverseMagnitude; @@ -13756,9 +13099,7 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.inverse = function(quaternion, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); var magnitudeSquared = Quaternion.magnitudeSquared(quaternion); result = Quaternion.conjugate(quaternion, result); @@ -13774,15 +13115,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -13800,15 +13135,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -13825,12 +13154,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.negate = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); result.x = -quaternion.x; result.y = -quaternion.y; @@ -13847,12 +13172,8 @@ define('Core/Quaternion',[ * @returns {Number} The dot product. */ Quaternion.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w; }; @@ -13866,15 +13187,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var leftX = left.x; var leftY = left.y; @@ -13907,15 +13222,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.multiplyByScalar = function(quaternion, scalar, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = quaternion.x * scalar; result.y = quaternion.y * scalar; @@ -13933,15 +13242,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.divideByScalar = function(quaternion, scalar, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = quaternion.x / scalar; result.y = quaternion.y / scalar; @@ -13958,12 +13261,8 @@ define('Core/Quaternion',[ * @returns {Cartesian3} The modified result parameter. */ Quaternion.computeAxis = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); var w = quaternion.w; if (Math.abs(w - 1.0) < CesiumMath.EPSILON6) { @@ -13986,9 +13285,7 @@ define('Core/Quaternion',[ * @returns {Number} The angle of rotation. */ Quaternion.computeAngle = function(quaternion) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); if (Math.abs(quaternion.w - 1.0) < CesiumMath.EPSILON6) { return 0.0; @@ -14007,18 +13304,10 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); lerpScratch = Quaternion.multiplyByScalar(end, t, lerpScratch); result = Quaternion.multiplyByScalar(start, 1.0 - t, result); @@ -14040,18 +13329,10 @@ define('Core/Quaternion',[ * @see Quaternion#fastSlerp */ Quaternion.slerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var dot = Quaternion.dot(start, end); @@ -14084,12 +13365,8 @@ define('Core/Quaternion',[ * @returns {Cartesian3} The modified result parameter. */ Quaternion.log = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); var theta = CesiumMath.acosClamped(quaternion.w); var thetaOverSinTheta = 0.0; @@ -14109,12 +13386,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.exp = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var theta = Cartesian3.magnitude(cartesian); var sinThetaOverTheta = 0.0; @@ -14149,12 +13422,10 @@ define('Core/Quaternion',[ * @see Quaternion#squad */ Quaternion.computeInnerQuadrangle = function(q0, q1, q2, result) { - if (!defined(q0) || !defined(q1) || !defined(q2)) { - throw new DeveloperError('q0, q1, and q2 are required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('q0', q0); + Check.typeOf.object('q1', q1); + Check.typeOf.object('q2', q2); + Check.typeOf.object('result', result); var qInv = Quaternion.conjugate(q1, squadScratchQuaternion0); Quaternion.multiply(qInv, q2, squadScratchQuaternion1); @@ -14196,15 +13467,12 @@ define('Core/Quaternion',[ * @see Quaternion#computeInnerQuadrangle */ Quaternion.squad = function(q0, q1, s0, s1, t, result) { - if (!defined(q0) || !defined(q1) || !defined(s0) || !defined(s1)) { - throw new DeveloperError('q0, q1, s0, and s1 are required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('q0', q0); + Check.typeOf.object('q1', q1); + Check.typeOf.object('s0', s0); + Check.typeOf.object('s1', s1); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var slerp0 = Quaternion.slerp(q0, q1, t, squadScratchQuaternion0); var slerp1 = Quaternion.slerp(s0, s1, t, squadScratchQuaternion1); @@ -14241,18 +13509,10 @@ define('Core/Quaternion',[ * @see Quaternion#slerp */ Quaternion.fastSlerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var x = Quaternion.dot(start, end); @@ -14301,15 +13561,12 @@ define('Core/Quaternion',[ * @see Quaternion#squad */ Quaternion.fastSquad = function(q0, q1, s0, s1, t, result) { - if (!defined(q0) || !defined(q1) || !defined(s0) || !defined(s1)) { - throw new DeveloperError('q0, q1, s0, and s1 are required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('q0', q0); + Check.typeOf.object('q1', q1); + Check.typeOf.object('s0', s0); + Check.typeOf.object('s1', s1); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var slerp0 = Quaternion.fastSlerp(q0, q1, t, squadScratchQuaternion0); var slerp1 = Quaternion.fastSlerp(s0, s1, t, squadScratchQuaternion1); @@ -14345,9 +13602,7 @@ define('Core/Quaternion',[ * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. */ Quaternion.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon is required and must be a number.'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || ((defined(left)) && @@ -14891,7 +14146,7 @@ define('Core/Geometry',[ * <li><code>position</code> - 3D vertex position. 64-bit floating-point (for precision). 3 components per attribute. See {@link VertexFormat#position}.</li> * <li><code>normal</code> - Normal (normalized), commonly used for lighting. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#normal}.</li> * <li><code>st</code> - 2D texture coordinate. 32-bit floating-point. 2 components per attribute. See {@link VertexFormat#st}.</li> - * <li><code>binormal</code> - Binormal (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#binormal}.</li> + * <li><code>bitangent</code> - Bitangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#bitangent}.</li> * <li><code>tangent</code> - Tangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#tangent}.</li> * </ul> * </p> @@ -14920,7 +14175,7 @@ define('Core/Geometry',[ * componentsPerAttribute : 3, * values : new Float32Array(0) * }); - * + * * @see GeometryAttribute * @see VertexFormat */ @@ -15201,7 +14456,7 @@ define('Core/GeometryAttributes',[ this.st = options.st; /** - * The binormal attribute (normalized), which is used for tangent-space effects like bump mapping. + * The bitangent attribute (normalized), which is used for tangent-space effects like bump mapping. * <p> * 32-bit floating-point. 3 components per attribute. * </p> @@ -15210,7 +14465,7 @@ define('Core/GeometryAttributes',[ * * @default undefined */ - this.binormal = options.binormal; + this.bitangent = options.bitangent; /** * The tangent attribute (normalized), which is used for tangent-space effects like bump mapping. @@ -15748,6 +15003,118 @@ define('Core/barycentricCoordinates',[ return barycentricCoordinates; }); +/*global define*/ +define('Core/oneTimeWarning',[ + './defaultValue', + './defined', + './DeveloperError' + ], function( + defaultValue, + defined, + DeveloperError) { + "use strict"; + + var warnings = {}; + + /** + * Logs a one time message to the console. Use this function instead of + * <code>console.log</code> directly since this does not log duplicate messages + * unless it is called from multiple workers. + * + * @exports oneTimeWarning + * + * @param {String} identifier The unique identifier for this warning. + * @param {String} [message=identifier] The message to log to the console. + * + * @example + * for(var i=0;i<foo.length;++i) { + * if (!defined(foo[i].bar)) { + * // Something that can be recovered from but may happen a lot + * oneTimeWarning('foo.bar undefined', 'foo.bar is undefined. Setting to 0.'); + * foo[i].bar = 0; + * // ... + * } + * } + * + * @private + */ + function oneTimeWarning(identifier, message) { + if (!defined(identifier)) { + throw new DeveloperError('identifier is required.'); + } + + if (!defined(warnings[identifier])) { + warnings[identifier] = true; + console.warn(defaultValue(message, identifier)); + } + } + + oneTimeWarning.geometryOutlines = 'Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.'; + + return oneTimeWarning; +}); + +/*global define*/ +define('Core/deprecationWarning',[ + './defined', + './DeveloperError', + './oneTimeWarning' + ], function( + defined, + DeveloperError, + oneTimeWarning) { + 'use strict'; + + /** + * Logs a deprecation message to the console. Use this function instead of + * <code>console.log</code> directly since this does not log duplicate messages + * unless it is called from multiple workers. + * + * @exports deprecationWarning + * + * @param {String} identifier The unique identifier for this deprecated API. + * @param {String} message The message to log to the console. + * + * @example + * // Deprecated function or class + * function Foo() { + * deprecationWarning('Foo', 'Foo was deprecated in Cesium 1.01. It will be removed in 1.03. Use newFoo instead.'); + * // ... + * } + * + * // Deprecated function + * Bar.prototype.func = function() { + * deprecationWarning('Bar.func', 'Bar.func() was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newFunc() instead.'); + * // ... + * }; + * + * // Deprecated property + * defineProperties(Bar.prototype, { + * prop : { + * get : function() { + * deprecationWarning('Bar.prop', 'Bar.prop was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newProp instead.'); + * // ... + * }, + * set : function(value) { + * deprecationWarning('Bar.prop', 'Bar.prop was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newProp instead.'); + * // ... + * } + * } + * }); + * + * @private + */ + function deprecationWarning(identifier, message) { + if (!defined(identifier) || !defined(message)) { + throw new DeveloperError('identifier and message are required.'); + } + + oneTimeWarning(identifier, message); + } + + return deprecationWarning; +}); + /*global define*/ define('Core/EncodedCartesian3',[ './Cartesian3', @@ -16857,6 +16224,7 @@ define('Core/IntersectionTests',[ './defaultValue', './defined', './DeveloperError', + './Interval', './Math', './Matrix3', './QuadraticRealPolynomial', @@ -16868,6 +16236,7 @@ define('Core/IntersectionTests',[ defaultValue, defined, DeveloperError, + Interval, CesiumMath, Matrix3, QuadraticRealPolynomial, @@ -17139,7 +16508,7 @@ define('Core/IntersectionTests',[ function raySphere(ray, sphere, result) { if (!defined(result)) { - result = {}; + result = new Interval(); } var origin = ray.origin; @@ -17170,8 +16539,8 @@ define('Core/IntersectionTests',[ * * @param {Ray} ray The ray. * @param {BoundingSphere} sphere The sphere. - * @param {Object} [result] The result onto which to store the result. - * @returns {Object} An object with the first (<code>start</code>) and the second (<code>stop</code>) intersection scalars for points along the ray or undefined if there are no intersections. + * @param {Interval} [result] The result onto which to store the result. + * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections. */ IntersectionTests.raySphere = function(ray, sphere, result) { if (!defined(ray)) { @@ -17199,8 +16568,8 @@ define('Core/IntersectionTests',[ * @param {Cartesian3} p0 An end point of the line segment. * @param {Cartesian3} p1 The other end point of the line segment. * @param {BoundingSphere} sphere The sphere. - * @param {Object} [result] The result onto which to store the result. - * @returns {Object} An object with the first (<code>start</code>) and the second (<code>stop</code>) intersection scalars for points along the line segment or undefined if there are no intersections. + * @param {Interval} [result] The result onto which to store the result. + * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections. */ IntersectionTests.lineSegmentSphere = function(p0, p1, sphere, result) { if (!defined(p0)) { @@ -17238,7 +16607,7 @@ define('Core/IntersectionTests',[ * * @param {Ray} ray The ray. * @param {Ellipsoid} ellipsoid The ellipsoid. - * @returns {Object} An object with the first (<code>start</code>) and the second (<code>stop</code>) intersection scalars for points along the ray or undefined if there are no intersections. + * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections. */ IntersectionTests.rayEllipsoid = function(ray, ellipsoid) { if (!defined(ray)) { @@ -17280,10 +16649,7 @@ define('Core/IntersectionTests',[ var root0 = temp / w2; var root1 = difference / temp; if (root0 < root1) { - return { - start : root0, - stop : root1 - }; + return new Interval(root0, root1); } return { @@ -17293,10 +16659,7 @@ define('Core/IntersectionTests',[ } else { // qw2 == product. Repeated roots (2 intersections). var root = Math.sqrt(difference / w2); - return { - start : root, - stop : root - }; + return new Interval(root, root); } } else if (q2 < 1.0) { // Inside ellipsoid (2 intersections). @@ -17306,19 +16669,13 @@ define('Core/IntersectionTests',[ discriminant = qw * qw - product; temp = -qw + Math.sqrt(discriminant); // Positively valued. - return { - start : 0.0, - stop : temp / w2 - }; + return new Interval(0.0, temp / w2); } else { // q2 == 1.0. On ellipsoid. if (qw < 0.0) { // Looking inward. w2 = Cartesian3.magnitudeSquared(w); - return { - start : 0.0, - stop : -qw / w2 - }; + return new Interval(0.0, -qw / w2); } // qw >= 0.0. Looking outward or tangent. @@ -18227,6 +17584,7 @@ define('Core/GeometryPipeline',[ './ComponentDatatype', './defaultValue', './defined', + './deprecationWarning', './DeveloperError', './EncodedCartesian3', './GeographicProjection', @@ -18253,6 +17611,7 @@ define('Core/GeometryPipeline',[ ComponentDatatype, defaultValue, defined, + deprecationWarning, DeveloperError, EncodedCartesian3, GeographicProjection, @@ -18386,7 +17745,7 @@ define('Core/GeometryPipeline',[ /** * Creates a new {@link Geometry} with <code>LINES</code> representing the provided * attribute (<code>attributeName</code>) for the provided geometry. This is used to - * visualize vector attributes like normals, binormals, and tangents. + * visualize vector attributes like normals, tangents, and bitangents. * * @param {Geometry} geometry The <code>Geometry</code> instance with the attribute. * @param {String} [attributeName='normal'] The name of the attribute. @@ -18396,7 +17755,7 @@ define('Core/GeometryPipeline',[ * @exception {DeveloperError} geometry.attributes must have an attribute with the same name as the attributeName parameter. * * @example - * var geometry = Cesium.GeometryPipeline.createLineSegmentsForVectors(instance.geometry, 'binormal', 100000.0); + * var geometry = Cesium.GeometryPipeline.createLineSegmentsForVectors(instance.geometry, 'bitangent', 100000.0); */ GeometryPipeline.createLineSegmentsForVectors = function(geometry, attributeName, length) { attributeName = defaultValue(attributeName, 'normal'); @@ -18488,8 +17847,11 @@ define('Core/GeometryPipeline',[ // From VertexFormat 'normal', 'st', - 'binormal', 'tangent', + 'bitangent', + + // For shadow volumes + 'extrudeDirection', // From compressing texture coordinates and normals 'compressedAttributes' @@ -18531,7 +17893,7 @@ define('Core/GeometryPipeline',[ * * @example * geometry = Cesium.GeometryPipeline.reorderForPreVertexCache(geometry); - * + * * @see GeometryPipeline.reorderForPostVertexCache */ GeometryPipeline.reorderForPreVertexCache = function(geometry) { @@ -18616,7 +17978,7 @@ define('Core/GeometryPipeline',[ * * @example * geometry = Cesium.GeometryPipeline.reorderForPostVertexCache(geometry); - * + * * @see GeometryPipeline.reorderForPreVertexCache * @see {@link http://gfx.cs.princ0eton.edu/pubs/Sander_2007_%3ETR/tipsy.pdf|Fast Triangle Reordering for Vertex Locality and Reduced Overdraw} * by Sander, Nehab, and Barczak @@ -18968,7 +18330,7 @@ define('Core/GeometryPipeline',[ * Transforms a geometry instance to world coordinates. This changes * the instance's <code>modelMatrix</code> to {@link Matrix4.IDENTITY} and transforms the * following attributes if they are present: <code>position</code>, <code>normal</code>, - * <code>binormal</code>, and <code>tangent</code>. + * <code>tangent</code>, and <code>bitangent</code>. * * @param {GeometryInstance} instance The geometry instance to modify. * @returns {GeometryInstance} The modified <code>instance</code> argument, with its attributes transforms to world coordinates. @@ -18996,16 +18358,16 @@ define('Core/GeometryPipeline',[ transformPoint(modelMatrix, attributes.nextPosition); if ((defined(attributes.normal)) || - (defined(attributes.binormal)) || - (defined(attributes.tangent))) { + (defined(attributes.tangent)) || + (defined(attributes.bitangent))) { Matrix4.inverse(modelMatrix, inverseTranspose); Matrix4.transpose(inverseTranspose, inverseTranspose); Matrix4.getRotation(inverseTranspose, normalMatrix); transformVector(normalMatrix, attributes.normal); - transformVector(normalMatrix, attributes.binormal); transformVector(normalMatrix, attributes.tangent); + transformVector(normalMatrix, attributes.bitangent); } var boundingSphere = instance.geometry.boundingSphere; @@ -19195,7 +18557,7 @@ define('Core/GeometryPipeline',[ * <p> * This is used by {@link Primitive} to efficiently render a large amount of static data. * </p> - * + * * @private * * @param {GeometryInstance[]} [instances] The array of {@link GeometryInstance} objects whose geometry will be combined. @@ -19211,7 +18573,7 @@ define('Core/GeometryPipeline',[ * Cesium.GeometryPipeline.transformToWorldCoordinates(instances[i]); * } * var geometries = Cesium.GeometryPipeline.combineInstances(instances); - * + * * @see GeometryPipeline.transformToWorldCoordinates */ GeometryPipeline.combineInstances = function(instances) { @@ -19387,8 +18749,8 @@ define('Core/GeometryPipeline',[ var tScratch = new Cartesian3(); /** - * Computes per-vertex binormals and tangents for a geometry containing <code>TRIANGLES</code>. - * The result is new <code>binormal</code> and <code>tangent</code> attributes added to the geometry. + * Computes per-vertex tangents and bitangents for a geometry containing <code>TRIANGLES</code>. + * The result is new <code>tangent</code> and <code>bitangent</code> attributes added to the geometry. * This assumes a counter-clockwise winding order. * <p> * Based on <a href="http://www.terathon.com/code/tangent.html">Computing Tangent Space Basis Vectors @@ -19396,15 +18758,15 @@ define('Core/GeometryPipeline',[ * </p> * * @param {Geometry} geometry The geometry to modify. - * @returns {Geometry} The modified <code>geometry</code> argument with the computed <code>binormal</code> and <code>tangent</code> attributes. + * @returns {Geometry} The modified <code>geometry</code> argument with the computed <code>tangent</code> and <code>bitangent</code> attributes. * * @exception {DeveloperError} geometry.indices length must be greater than 0 and be a multiple of 3. * @exception {DeveloperError} geometry.primitiveType must be {@link PrimitiveType.TRIANGLES}. * * @example - * Cesium.GeometryPipeline.computeBinormalAndTangent(geometry); + * Cesium.GeometryPipeline.computeTangentAndBiTangent(geometry); */ - GeometryPipeline.computeBinormalAndTangent = function(geometry) { + GeometryPipeline.computeTangentAndBitangent = function(geometry) { if (!defined(geometry)) { throw new DeveloperError('geometry is required.'); } @@ -19484,8 +18846,8 @@ define('Core/GeometryPipeline',[ tan1[i23 + 2] += sdirz; } - var binormalValues = new Float32Array(numVertices * 3); var tangentValues = new Float32Array(numVertices * 3); + var bitangentValues = new Float32Array(numVertices * 3); for (i = 0; i < numVertices; i++) { i03 = i * 3; @@ -19504,9 +18866,9 @@ define('Core/GeometryPipeline',[ Cartesian3.normalize(Cartesian3.cross(n, t, t), t); - binormalValues[i03] = t.x; - binormalValues[i13] = t.y; - binormalValues[i23] = t.z; + bitangentValues[i03] = t.x; + bitangentValues[i13] = t.y; + bitangentValues[i23] = t.z; } geometry.attributes.tangent = new GeometryAttribute({ @@ -19515,20 +18877,48 @@ define('Core/GeometryPipeline',[ values : tangentValues }); - geometry.attributes.binormal = new GeometryAttribute({ + geometry.attributes.bitangent = new GeometryAttribute({ componentDatatype : ComponentDatatype.FLOAT, componentsPerAttribute : 3, - values : binormalValues + values : bitangentValues }); return geometry; }; + /** + * Computes per-vertex binormal and tangents for a geometry containing <code>TRIANGLES</code>. + * The result is new <code>binormal</code> and <code>tangent</code> attributes added to the geometry. + * This assumes a counter-clockwise winding order. + * <p> + * Based on <a href="http://www.terathon.com/code/tangent.html">Computing Tangent Space Basis Vectors + * for an Arbitrary Mesh</a> by Eric Lengyel. + * </p> + * + * @param {Geometry} geometry The geometry to modify. + * @returns {Geometry} The modified <code>geometry</code> argument with the computed <code>binormal</code> and <code>tangent</code> attributes. + * + * @exception {DeveloperError} geometry.indices length must be greater than 0 and be a multiple of 3. + * @exception {DeveloperError} geometry.primitiveType must be {@link PrimitiveType.TRIANGLES}. + * + * @example + * Cesium.GeometryPipeline.computeBinormalAndTangent(geometry); + * + * @see GeometryPipeline.computeTangentAndBitangent + */ + GeometryPipeline.computeBinormalAndTangent = function(geometry) { + deprecationWarning('computeBinormalAndTangent', 'computeBinormalAndTangent was deprecated in 1.30. It will be removed in 1.31. Use a computeTangentAndBitangent.'); + GeometryPipeline.computeTangentAndBitangent(geometry); + geometry.attributes.binormal = geometry.attributes.bitangent; + + return geometry; + }; + var scratchCartesian2 = new Cartesian2(); var toEncode1 = new Cartesian3(); var toEncode2 = new Cartesian3(); var toEncode3 = new Cartesian3(); - + var encodeResult2 = new Cartesian2(); /** * Compresses and packs geometry normal attribute values to save memory. * @@ -19543,73 +18933,109 @@ define('Core/GeometryPipeline',[ throw new DeveloperError('geometry is required.'); } + var extrudeAttribute = geometry.attributes.extrudeDirection; + var i; + var numVertices; + if (defined(extrudeAttribute)) { + //only shadow volumes use extrudeDirection, and shadow volumes use vertexFormat: POSITION_ONLY so we don't need to check other attributes + var extrudeDirections = extrudeAttribute.values; + numVertices = extrudeDirections.length / 3.0; + var compressedDirections = new Float32Array(numVertices * 2); + + var i2 = 0; + for (i = 0; i < numVertices; ++i) { + Cartesian3.fromArray(extrudeDirections, i * 3.0, toEncode1); + if (Cartesian3.equals(toEncode1, Cartesian3.ZERO)) { + i2 += 2; + continue; + } + encodeResult2 = AttributeCompression.octEncodeInRange(toEncode1, 65535, encodeResult2); + compressedDirections[i2++] = encodeResult2.x; + compressedDirections[i2++] = encodeResult2.y; + } + + geometry.attributes.compressedAttributes = new GeometryAttribute({ + componentDatatype : ComponentDatatype.FLOAT, + componentsPerAttribute : 2, + values : compressedDirections + }); + delete geometry.attributes.extrudeDirection; + return geometry; + } + var normalAttribute = geometry.attributes.normal; var stAttribute = geometry.attributes.st; - if (!defined(normalAttribute) && !defined(stAttribute)) { + + var hasNormal = defined(normalAttribute); + var hasSt = defined(stAttribute); + if (!hasNormal && !hasSt) { return geometry; } var tangentAttribute = geometry.attributes.tangent; - var binormalAttribute = geometry.attributes.binormal; + var bitangentAttribute = geometry.attributes.bitangent; + + var hasTangent = defined(tangentAttribute); + var hasBitangent = defined(bitangentAttribute); var normals; var st; var tangents; - var binormals; + var bitangents; - if (defined(normalAttribute)) { + if (hasNormal) { normals = normalAttribute.values; } - if (defined(stAttribute)) { + if (hasSt) { st = stAttribute.values; } - if (defined(tangentAttribute)) { + if (hasTangent) { tangents = tangentAttribute.values; } - if (binormalAttribute) { - binormals = binormalAttribute.values; + if (hasBitangent) { + bitangents = bitangentAttribute.values; } - var length = defined(normals) ? normals.length : st.length; - var numComponents = defined(normals) ? 3.0 : 2.0; - var numVertices = length / numComponents; + var length = hasNormal ? normals.length : st.length; + var numComponents = hasNormal ? 3.0 : 2.0; + numVertices = length / numComponents; var compressedLength = numVertices; - var numCompressedComponents = defined(st) && defined(normals) ? 2.0 : 1.0; - numCompressedComponents += defined(tangents) || defined(binormals) ? 1.0 : 0.0; + var numCompressedComponents = hasSt && hasNormal ? 2.0 : 1.0; + numCompressedComponents += hasTangent || hasBitangent ? 1.0 : 0.0; compressedLength *= numCompressedComponents; var compressedAttributes = new Float32Array(compressedLength); var normalIndex = 0; - for (var i = 0; i < numVertices; ++i) { - if (defined(st)) { + for (i = 0; i < numVertices; ++i) { + if (hasSt) { Cartesian2.fromArray(st, i * 2.0, scratchCartesian2); compressedAttributes[normalIndex++] = AttributeCompression.compressTextureCoordinates(scratchCartesian2); } var index = i * 3.0; - if (defined(normals) && defined(tangents) && defined(binormals)) { + if (hasNormal && defined(tangents) && defined(bitangents)) { Cartesian3.fromArray(normals, index, toEncode1); Cartesian3.fromArray(tangents, index, toEncode2); - Cartesian3.fromArray(binormals, index, toEncode3); + Cartesian3.fromArray(bitangents, index, toEncode3); AttributeCompression.octPack(toEncode1, toEncode2, toEncode3, scratchCartesian2); compressedAttributes[normalIndex++] = scratchCartesian2.x; compressedAttributes[normalIndex++] = scratchCartesian2.y; } else { - if (defined(normals)) { + if (hasNormal) { Cartesian3.fromArray(normals, index, toEncode1); compressedAttributes[normalIndex++] = AttributeCompression.octEncodeFloat(toEncode1); } - if (defined(tangents)) { + if (hasTangent) { Cartesian3.fromArray(tangents, index, toEncode1); compressedAttributes[normalIndex++] = AttributeCompression.octEncodeFloat(toEncode1); } - if (defined(binormals)) { - Cartesian3.fromArray(binormals, index, toEncode1); + if (hasBitangent) { + Cartesian3.fromArray(bitangents, index, toEncode1); compressedAttributes[normalIndex++] = AttributeCompression.octEncodeFloat(toEncode1); } } @@ -19621,17 +19047,17 @@ define('Core/GeometryPipeline',[ values : compressedAttributes }); - if (defined(normals)) { + if (hasNormal) { delete geometry.attributes.normal; } - if (defined(st)) { + if (hasSt) { delete geometry.attributes.st; } - if (defined(tangents)) { - delete geometry.attributes.tangent; + if (hasBitangent) { + delete geometry.attributes.bitangent; } - if (defined(binormals)) { - delete geometry.attributes.binormal; + if (hasTangent) { + delete geometry.attributes.tangent; } return geometry; @@ -20048,8 +19474,8 @@ define('Core/GeometryPipeline',[ var s1Scratch = new Cartesian2(); var s2Scratch = new Cartesian2(); - function computeTriangleAttributes(i0, i1, i2, point, positions, normals, binormals, tangents, texCoords, currentAttributes, insertedIndex) { - if (!defined(normals) && !defined(binormals) && !defined(tangents) && !defined(texCoords)) { + function computeTriangleAttributes(i0, i1, i2, point, positions, normals, tangents, bitangents, texCoords, extrudeDirections, currentAttributes, insertedIndex) { + if (!defined(normals) && !defined(tangents) && !defined(bitangents) && !defined(texCoords) && !defined(extrudeDirections)) { return; } @@ -20074,20 +19500,27 @@ define('Core/GeometryPipeline',[ Cartesian3.pack(normal, currentAttributes.normal.values, insertedIndex * 3); } - if (defined(binormals)) { - var b0 = Cartesian3.fromArray(binormals, i0 * 3, p0Scratch); - var b1 = Cartesian3.fromArray(binormals, i1 * 3, p1Scratch); - var b2 = Cartesian3.fromArray(binormals, i2 * 3, p2Scratch); - - Cartesian3.multiplyByScalar(b0, coords.x, b0); - Cartesian3.multiplyByScalar(b1, coords.y, b1); - Cartesian3.multiplyByScalar(b2, coords.z, b2); + if (defined(extrudeDirections)) { + var d0 = Cartesian3.fromArray(extrudeDirections, i0 * 3, p0Scratch); + var d1 = Cartesian3.fromArray(extrudeDirections, i1 * 3, p1Scratch); + var d2 = Cartesian3.fromArray(extrudeDirections, i2 * 3, p2Scratch); - var binormal = Cartesian3.add(b0, b1, b0); - Cartesian3.add(binormal, b2, binormal); - Cartesian3.normalize(binormal, binormal); + Cartesian3.multiplyByScalar(d0, coords.x, d0); + Cartesian3.multiplyByScalar(d1, coords.y, d1); + Cartesian3.multiplyByScalar(d2, coords.z, d2); - Cartesian3.pack(binormal, currentAttributes.binormal.values, insertedIndex * 3); + var direction; + if (!Cartesian3.equals(d0, Cartesian3.ZERO) || !Cartesian3.equals(d1, Cartesian3.ZERO) || !Cartesian3.equals(d2, Cartesian3.ZERO)) { + direction = Cartesian3.add(d0, d1, d0); + Cartesian3.add(direction, d2, direction); + Cartesian3.normalize(direction, direction); + } else { + direction = p0Scratch; + direction.x = 0; + direction.y = 0; + direction.z = 0; + } + Cartesian3.pack(direction, currentAttributes.extrudeDirection.values, insertedIndex * 3); } if (defined(tangents)) { @@ -20106,6 +19539,22 @@ define('Core/GeometryPipeline',[ Cartesian3.pack(tangent, currentAttributes.tangent.values, insertedIndex * 3); } + if (defined(bitangents)) { + var b0 = Cartesian3.fromArray(bitangents, i0 * 3, p0Scratch); + var b1 = Cartesian3.fromArray(bitangents, i1 * 3, p1Scratch); + var b2 = Cartesian3.fromArray(bitangents, i2 * 3, p2Scratch); + + Cartesian3.multiplyByScalar(b0, coords.x, b0); + Cartesian3.multiplyByScalar(b1, coords.y, b1); + Cartesian3.multiplyByScalar(b2, coords.z, b2); + + var bitangent = Cartesian3.add(b0, b1, b0); + Cartesian3.add(bitangent, b2, bitangent); + Cartesian3.normalize(bitangent, bitangent); + + Cartesian3.pack(bitangent, currentAttributes.bitangent.values, insertedIndex * 3); + } + if (defined(texCoords)) { var s0 = Cartesian2.fromArray(texCoords, i0 * 2, s0Scratch); var s1 = Cartesian2.fromArray(texCoords, i1 * 2, s1Scratch); @@ -20150,9 +19599,10 @@ define('Core/GeometryPipeline',[ var attributes = geometry.attributes; var positions = attributes.position.values; var normals = (defined(attributes.normal)) ? attributes.normal.values : undefined; - var binormals = (defined(attributes.binormal)) ? attributes.binormal.values : undefined; + var bitangents = (defined(attributes.bitangent)) ? attributes.bitangent.values : undefined; var tangents = (defined(attributes.tangent)) ? attributes.tangent.values : undefined; var texCoords = (defined(attributes.st)) ? attributes.st.values : undefined; + var extrudeDirections = (defined(attributes.extrudeDirection)) ? attributes.extrudeDirection.values : undefined; var indices = geometry.indices; var eastGeometry = copyGeometryForSplit(geometry); @@ -20206,7 +19656,7 @@ define('Core/GeometryPipeline',[ } insertedIndex = insertSplitPoint(currentAttributes, currentIndices, currentIndexMap, indices, resultIndex < 3 ? i + resultIndex : -1, point); - computeTriangleAttributes(i0, i1, i2, point, positions, normals, binormals, tangents, texCoords, currentAttributes, insertedIndex); + computeTriangleAttributes(i0, i1, i2, point, positions, normals, tangents, bitangents, texCoords, extrudeDirections, currentAttributes, insertedIndex); } } else { if (defined(result)) { @@ -20226,13 +19676,13 @@ define('Core/GeometryPipeline',[ } insertedIndex = insertSplitPoint(currentAttributes, currentIndices, currentIndexMap, indices, i, p0); - computeTriangleAttributes(i0, i1, i2, p0, positions, normals, binormals, tangents, texCoords, currentAttributes, insertedIndex); + computeTriangleAttributes(i0, i1, i2, p0, positions, normals, tangents, bitangents, texCoords, extrudeDirections, currentAttributes, insertedIndex); insertedIndex = insertSplitPoint(currentAttributes, currentIndices, currentIndexMap, indices, i + 1, p1); - computeTriangleAttributes(i0, i1, i2, p1, positions, normals, binormals, tangents, texCoords, currentAttributes, insertedIndex); + computeTriangleAttributes(i0, i1, i2, p1, positions, normals, tangents, bitangents, texCoords, extrudeDirections, currentAttributes, insertedIndex); insertedIndex = insertSplitPoint(currentAttributes, currentIndices, currentIndexMap, indices, i + 2, p2); - computeTriangleAttributes(i0, i1, i2, p2, positions, normals, binormals, tangents, texCoords, currentAttributes, insertedIndex); + computeTriangleAttributes(i0, i1, i2, p2, positions, normals, tangents, bitangents, texCoords, extrudeDirections, currentAttributes, insertedIndex); } } @@ -21409,118 +20859,6 @@ define('ThirdParty/when',[],function () { // Boilerplate for AMD, Node, and browser global ); -/*global define*/ -define('Core/oneTimeWarning',[ - './defaultValue', - './defined', - './DeveloperError' - ], function( - defaultValue, - defined, - DeveloperError) { - "use strict"; - - var warnings = {}; - - /** - * Logs a one time message to the console. Use this function instead of - * <code>console.log</code> directly since this does not log duplicate messages - * unless it is called from multiple workers. - * - * @exports oneTimeWarning - * - * @param {String} identifier The unique identifier for this warning. - * @param {String} [message=identifier] The message to log to the console. - * - * @example - * for(var i=0;i<foo.length;++i) { - * if (!defined(foo[i].bar)) { - * // Something that can be recovered from but may happen a lot - * oneTimeWarning('foo.bar undefined', 'foo.bar is undefined. Setting to 0.'); - * foo[i].bar = 0; - * // ... - * } - * } - * - * @private - */ - function oneTimeWarning(identifier, message) { - if (!defined(identifier)) { - throw new DeveloperError('identifier is required.'); - } - - if (!defined(warnings[identifier])) { - warnings[identifier] = true; - console.log(defaultValue(message, identifier)); - } - } - - oneTimeWarning.geometryOutlines = 'Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.'; - - return oneTimeWarning; -}); - -/*global define*/ -define('Core/deprecationWarning',[ - './defined', - './DeveloperError', - './oneTimeWarning' - ], function( - defined, - DeveloperError, - oneTimeWarning) { - 'use strict'; - - /** - * Logs a deprecation message to the console. Use this function instead of - * <code>console.log</code> directly since this does not log duplicate messages - * unless it is called from multiple workers. - * - * @exports deprecationWarning - * - * @param {String} identifier The unique identifier for this deprecated API. - * @param {String} message The message to log to the console. - * - * @example - * // Deprecated function or class - * function Foo() { - * deprecationWarning('Foo', 'Foo was deprecated in Cesium 1.01. It will be removed in 1.03. Use newFoo instead.'); - * // ... - * } - * - * // Deprecated function - * Bar.prototype.func = function() { - * deprecationWarning('Bar.func', 'Bar.func() was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newFunc() instead.'); - * // ... - * }; - * - * // Deprecated property - * defineProperties(Bar.prototype, { - * prop : { - * get : function() { - * deprecationWarning('Bar.prop', 'Bar.prop was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newProp instead.'); - * // ... - * }, - * set : function(value) { - * deprecationWarning('Bar.prop', 'Bar.prop was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newProp instead.'); - * // ... - * } - * } - * }); - * - * @private - */ - function deprecationWarning(identifier, message) { - if (!defined(identifier) || !defined(message)) { - throw new DeveloperError('identifier and message are required.'); - } - - oneTimeWarning(identifier, message); - } - - return deprecationWarning; -}); - /*global define*/ define('Core/binarySearch',[ './defined', @@ -25234,9 +24572,9 @@ define('Core/Transforms',[ './Cartesian3', './Cartesian4', './Cartographic', + './Check', './defaultValue', './defined', - './deprecationWarning', './DeveloperError', './EarthOrientationParameters', './EarthOrientationParametersSample', @@ -25256,9 +24594,9 @@ define('Core/Transforms',[ Cartesian3, Cartesian4, Cartographic, + Check, defaultValue, defined, - deprecationWarning, DeveloperError, EarthOrientationParameters, EarthOrientationParametersSample, @@ -25694,19 +25032,12 @@ define('Core/Transforms',[ * var hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll); * var transform = Cesium.Transforms.headingPitchRollToFixedFrame(center, hpr); */ - Transforms.headingPitchRollToFixedFrame = function(origin, headingPitchRoll, pitch, roll, ellipsoid, result) { - var heading; - if (typeof headingPitchRoll === 'object') { - // Shift arguments using assignments to encourage JIT optimization. - ellipsoid = pitch; - result = roll; - heading = headingPitchRoll.heading; - pitch = headingPitchRoll.pitch; - roll = headingPitchRoll.roll; - } else { - deprecationWarning('headingPitchRollToFixedFrame', 'headingPitchRollToFixedFrame with separate heading, pitch, and roll arguments was deprecated in 1.27. It will be removed in 1.30. Use a HeadingPitchRoll object.'); - heading = headingPitchRoll; - } + Transforms.headingPitchRollToFixedFrame = function(origin, headingPitchRoll, ellipsoid, result) { + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + var heading = headingPitchRoll.heading; + var pitch = headingPitchRoll.pitch; + var roll = headingPitchRoll.roll; + // checks for required parameters happen in the called functions var hprQuaternion = Quaternion.fromHeadingPitchRoll(heading, pitch, roll, scratchHPRQuaternion); var hprMatrix = Matrix4.fromTranslationQuaternionRotationScale(Cartesian3.ZERO, hprQuaternion, scratchScale, scratchHPRMatrix4); @@ -25714,7 +25045,6 @@ define('Core/Transforms',[ return Matrix4.multiply(result, hprMatrix, result); }; - var scratchHPR = new HeadingPitchRoll(); var scratchENUMatrix4 = new Matrix4(); var scratchHPRMatrix3 = new Matrix3(); @@ -25739,22 +25069,10 @@ define('Core/Transforms',[ * var hpr = new HeadingPitchRoll(heading, pitch, roll); * var quaternion = Cesium.Transforms.headingPitchRollQuaternion(center, hpr); */ - Transforms.headingPitchRollQuaternion = function(origin, headingPitchRoll, pitch, roll, ellipsoid, result) { - var hpr; - if (typeof headingPitchRoll === 'object') { - // Shift arguments using assignment to encourage JIT optimization. - hpr = headingPitchRoll; - ellipsoid = pitch; - result = roll; - } else { - deprecationWarning('headingPitchRollQuaternion', 'headingPitchRollQuaternion with separate heading, pitch, and roll arguments was deprecated in 1.27. It will be removed in 1.30. Use a HeadingPitchRoll object.'); - scratchHPR.heading = headingPitchRoll; - scratchHPR.pitch = pitch; - scratchHPR.roll = roll; - hpr = scratchHPR; - } + Transforms.headingPitchRollQuaternion = function(origin, headingPitchRoll, ellipsoid, result) { // checks for required parameters happen in the called functions - var transform = Transforms.headingPitchRollToFixedFrame(origin, hpr, ellipsoid, scratchENUMatrix4); + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + var transform = Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, scratchENUMatrix4); var rotation = Matrix4.getRotation(transform, scratchHPRMatrix3); return Quaternion.fromRotationMatrix(rotation, result); }; @@ -26230,6 +25548,46 @@ define('Core/Transforms',[ return result; }; + var swizzleMatrix = new Matrix4( + 0.0, 0.0, 1.0, 0.0, + 1.0, 0.0, 0.0, 0.0, + 0.0, 1.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + + /** + * @private + */ + Transforms.wgs84To2DModelMatrix = function(projection, center, result) { + if (!defined(projection)) { + throw new DeveloperError('projection is required.'); + } + if (!defined(center)) { + throw new DeveloperError('center is required.'); + } + if (!defined(result)) { + throw new DeveloperError('result is required.'); + } + + var ellipsoid = projection.ellipsoid; + + var fromENU = Transforms.eastNorthUpToFixedFrame(center, ellipsoid, scratchFromENU); + var toENU = Matrix4.inverseTransformation(fromENU, scratchToENU); + + var cartographic = ellipsoid.cartesianToCartographic(center, scratchCartographic); + var projectedPosition = projection.project(cartographic, scratchCartesian3Projection); + var newOrigin = scratchCartesian4NewOrigin; + newOrigin.x = projectedPosition.z; + newOrigin.y = projectedPosition.x; + newOrigin.z = projectedPosition.y; + newOrigin.w = 1.0; + + var translation = Matrix4.fromTranslation(newOrigin, scratchFromENU); + Matrix4.multiply(swizzleMatrix, toENU, result); + Matrix4.multiply(translation, result, result); + + return result; + }; + return Transforms; }); @@ -26306,7 +25664,7 @@ define('Core/VertexFormat',[ this.st = defaultValue(options.st, false); /** - * When <code>true</code>, the vertex has a binormal attribute (normalized), which is used for tangent-space effects like bump mapping. + * When <code>true</code>, the vertex has a bitangent attribute (normalized), which is used for tangent-space effects like bump mapping. * <p> * 32-bit floating-point. 3 components per attribute. * </p> @@ -26315,7 +25673,7 @@ define('Core/VertexFormat',[ * * @default false */ - this.binormal = defaultValue(options.binormal, false); + this.bitangent = defaultValue(options.bitangent, false); /** * When <code>true</code>, the vertex has a tangent attribute (normalized), which is used for tangent-space effects like bump mapping. @@ -26417,7 +25775,7 @@ define('Core/VertexFormat',[ })); /** - * An immutable vertex format with well-known attributes: position, normal, st, binormal, and tangent. + * An immutable vertex format with well-known attributes: position, normal, st, tangent, and bitangent. * * @type {VertexFormat} * @constant @@ -26425,15 +25783,15 @@ define('Core/VertexFormat',[ * @see VertexFormat#position * @see VertexFormat#normal * @see VertexFormat#st - * @see VertexFormat#binormal * @see VertexFormat#tangent + * @see VertexFormat#bitangent */ VertexFormat.ALL = freezeObject(new VertexFormat({ position : true, normal : true, st : true, - binormal : true, - tangent : true + tangent : true, + bitangent : true })); /** @@ -26478,8 +25836,8 @@ define('Core/VertexFormat',[ array[startingIndex++] = value.position ? 1.0 : 0.0; array[startingIndex++] = value.normal ? 1.0 : 0.0; array[startingIndex++] = value.st ? 1.0 : 0.0; - array[startingIndex++] = value.binormal ? 1.0 : 0.0; array[startingIndex++] = value.tangent ? 1.0 : 0.0; + array[startingIndex++] = value.bitangent ? 1.0 : 0.0; array[startingIndex++] = value.color ? 1.0 : 0.0; return array; @@ -26504,19 +25862,19 @@ define('Core/VertexFormat',[ result = new VertexFormat(); } - result.position = array[startingIndex++] === 1.0; - result.normal = array[startingIndex++] === 1.0; - result.st = array[startingIndex++] === 1.0; - result.binormal = array[startingIndex++] === 1.0; - result.tangent = array[startingIndex++] === 1.0; - result.color = array[startingIndex++] === 1.0; + result.position = array[startingIndex++] === 1.0; + result.normal = array[startingIndex++] === 1.0; + result.st = array[startingIndex++] === 1.0; + result.tangent = array[startingIndex++] === 1.0; + result.bitangent = array[startingIndex++] === 1.0; + result.color = array[startingIndex++] === 1.0; return result; }; /** * Duplicates a VertexFormat instance. * - * @param {VertexFormat} cartesian The vertex format to duplicate. + * @param {VertexFormat} vertexFormat The vertex format to duplicate. * @param {VertexFormat} [result] The object onto which to store the result. * @returns {VertexFormat} The modified result parameter or a new VertexFormat instance if one was not provided. (Returns undefined if vertexFormat is undefined) */ @@ -26531,8 +25889,8 @@ define('Core/VertexFormat',[ result.position = vertexFormat.position; result.normal = vertexFormat.normal; result.st = vertexFormat.st; - result.binormal = vertexFormat.binormal; result.tangent = vertexFormat.tangent; + result.bitangent = vertexFormat.bitangent; result.color = vertexFormat.color; return result; }; @@ -26607,7 +25965,7 @@ define('Core/EllipseGeometry',[ var scratchNormal = new Cartesian3(); var scratchTangent = new Cartesian3(); - var scratchBinormal = new Cartesian3(); + var scratchBitangent = new Cartesian3(); var scratchCartographic = new Cartographic(); var projectedCenterScratch = new Cartesian3(); @@ -26623,19 +25981,22 @@ define('Core/EllipseGeometry',[ var ellipsoid = options.ellipsoid; var stRotation = options.stRotation; var size = (extrude) ? positions.length / 3 * 2 : positions.length / 3; + var shadowVolume = options.shadowVolume; var textureCoordinates = (vertexFormat.st) ? new Float32Array(size * 2) : undefined; var normals = (vertexFormat.normal) ? new Float32Array(size * 3) : undefined; var tangents = (vertexFormat.tangent) ? new Float32Array(size * 3) : undefined; - var binormals = (vertexFormat.binormal) ? new Float32Array(size * 3) : undefined; + var bitangents = (vertexFormat.bitangent) ? new Float32Array(size * 3) : undefined; + + var extrudeNormals = (shadowVolume) ? new Float32Array(size * 3) : undefined; var textureCoordIndex = 0; // Raise positions to a height above the ellipsoid and compute the - // texture coordinates, normals, tangents, and binormals. + // texture coordinates, normals, tangents, and bitangents. var normal = scratchNormal; var tangent = scratchTangent; - var binormal = scratchBinormal; + var bitangent = scratchBitangent; var projection = new GeographicProjection(ellipsoid); var projectedCenter = projection.project(ellipsoid.cartesianToCartographic(center, scratchCartographic), projectedCenterScratch); @@ -26678,44 +26039,52 @@ define('Core/EllipseGeometry',[ textureCoordinates[textureCoordIndex++] = texCoordScratch.y; } - normal = ellipsoid.geodeticSurfaceNormal(position, normal); + if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent || shadowVolume) { + normal = ellipsoid.geodeticSurfaceNormal(position, normal); - if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.binormal) { - if (vertexFormat.tangent || vertexFormat.binormal) { - tangent = Cartesian3.normalize(Cartesian3.cross(Cartesian3.UNIT_Z, normal, tangent), tangent); - Matrix3.multiplyByVector(textureMatrix, tangent, tangent); + if (shadowVolume) { + extrudeNormals[i + bottomOffset] = -normal.x; + extrudeNormals[i1 + bottomOffset] = -normal.y; + extrudeNormals[i2 + bottomOffset] = -normal.z; } - if (vertexFormat.normal) { - normals[i] = normal.x; - normals[i1] = normal.y; - normals[i2] = normal.z; - if (extrude) { - normals[i + bottomOffset] = -normal.x; - normals[i1 + bottomOffset] = -normal.y; - normals[i2 + bottomOffset] = -normal.z; + + if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent) { + if (vertexFormat.tangent || vertexFormat.bitangent) { + tangent = Cartesian3.normalize(Cartesian3.cross(Cartesian3.UNIT_Z, normal, tangent), tangent); + Matrix3.multiplyByVector(textureMatrix, tangent, tangent); + } + if (vertexFormat.normal) { + normals[i] = normal.x; + normals[i1] = normal.y; + normals[i2] = normal.z; + if (extrude) { + normals[i + bottomOffset] = -normal.x; + normals[i1 + bottomOffset] = -normal.y; + normals[i2 + bottomOffset] = -normal.z; + } } - } - if (vertexFormat.tangent) { - tangents[i] = tangent.x; - tangents[i1] = tangent.y; - tangents[i2] = tangent.z; - if (extrude) { - tangents[i + bottomOffset] = -tangent.x; - tangents[i1 + bottomOffset] = -tangent.y; - tangents[i2 + bottomOffset] = -tangent.z; + if (vertexFormat.tangent) { + tangents[i] = tangent.x; + tangents[i1] = tangent.y; + tangents[i2] = tangent.z; + if (extrude) { + tangents[i + bottomOffset] = -tangent.x; + tangents[i1 + bottomOffset] = -tangent.y; + tangents[i2 + bottomOffset] = -tangent.z; + } } - } - if (vertexFormat.binormal) { - binormal = Cartesian3.normalize(Cartesian3.cross(normal, tangent, binormal), binormal); - binormals[i] = binormal.x; - binormals[i1] = binormal.y; - binormals[i2] = binormal.z; - if (extrude) { - binormals[i + bottomOffset] = binormal.x; - binormals[i1 + bottomOffset] = binormal.y; - binormals[i2 + bottomOffset] = binormal.z; + if (vertexFormat.bitangent) { + bitangent = Cartesian3.normalize(Cartesian3.cross(normal, tangent, bitangent), bitangent); + bitangents[i ] = bitangent.x; + bitangents[i1] = bitangent.y; + bitangents[i2] = bitangent.z; + if (extrude) { + bitangents[i + bottomOffset] = bitangent.x; + bitangents[i1 + bottomOffset] = bitangent.y; + bitangents[i2 + bottomOffset] = bitangent.z; + } } } } @@ -26764,13 +26133,22 @@ define('Core/EllipseGeometry',[ }); } - if (vertexFormat.binormal) { - attributes.binormal = new GeometryAttribute({ + if (vertexFormat.bitangent) { + attributes.bitangent = new GeometryAttribute({ componentDatatype : ComponentDatatype.FLOAT, componentsPerAttribute : 3, - values : binormals + values : bitangents }); } + + if (shadowVolume) { + attributes.extrudeDirection = new GeometryAttribute({ + componentDatatype : ComponentDatatype.FLOAT, + componentsPerAttribute : 3, + values : extrudeNormals + }); + } + return attributes; } @@ -26911,15 +26289,18 @@ define('Core/EllipseGeometry',[ var textureCoordinates = (vertexFormat.st) ? new Float32Array(size * 2) : undefined; var normals = (vertexFormat.normal) ? new Float32Array(size * 3) : undefined; var tangents = (vertexFormat.tangent) ? new Float32Array(size * 3) : undefined; - var binormals = (vertexFormat.binormal) ? new Float32Array(size * 3) : undefined; + var bitangents = (vertexFormat.bitangent) ? new Float32Array(size * 3) : undefined; + + var shadowVolume = options.shadowVolume; + var extrudeNormals = (shadowVolume) ? new Float32Array(size * 3) : undefined; var textureCoordIndex = 0; // Raise positions to a height above the ellipsoid and compute the - // texture coordinates, normals, tangents, and binormals. + // texture coordinates, normals, tangents, and bitangents. var normal = scratchNormal; var tangent = scratchTangent; - var binormal = scratchBinormal; + var bitangent = scratchBitangent; var projection = new GeographicProjection(ellipsoid); var projectedCenter = projection.project(ellipsoid.cartesianToCartographic(center, scratchCartographic), projectedCenterScratch); @@ -26963,6 +26344,13 @@ define('Core/EllipseGeometry',[ position = ellipsoid.scaleToGeodeticSurface(position, position); extrudedPosition = Cartesian3.clone(position, scratchCartesian2); normal = ellipsoid.geodeticSurfaceNormal(position, normal); + + if (shadowVolume) { + extrudeNormals[i + length] = -normal.x; + extrudeNormals[i1 + length] = -normal.y; + extrudeNormals[i2 + length] = -normal.z; + } + var scaledNormal = Cartesian3.multiplyByScalar(normal, height, scratchCartesian4); position = Cartesian3.add(position, scaledNormal, position); scaledNormal = Cartesian3.multiplyByScalar(normal, extrudedHeight, scaledNormal); @@ -26978,9 +26366,9 @@ define('Core/EllipseGeometry',[ finalPositions[i2] = position.z; } - if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.binormal) { + if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent) { - binormal = Cartesian3.clone(normal, binormal); + bitangent = Cartesian3.clone(normal, bitangent); var next = Cartesian3.fromArray(positions, (i + 3) % length, scratchCartesian4); Cartesian3.subtract(next, position, next); var bottom = Cartesian3.subtract(extrudedPosition, position, scratchCartesian3); @@ -26998,7 +26386,7 @@ define('Core/EllipseGeometry',[ } if (vertexFormat.tangent) { - tangent = Cartesian3.normalize(Cartesian3.cross(binormal, normal, tangent), tangent); + tangent = Cartesian3.normalize(Cartesian3.cross(bitangent, normal, tangent), tangent); tangents[i] = tangent.x; tangents[i1] = tangent.y; tangents[i2] = tangent.z; @@ -27008,14 +26396,14 @@ define('Core/EllipseGeometry',[ tangents[i + 2 + length] = tangent.z; } - if (vertexFormat.binormal) { - binormals[i] = binormal.x; - binormals[i1] = binormal.y; - binormals[i2] = binormal.z; + if (vertexFormat.bitangent) { + bitangents[i ] = bitangent.x; + bitangents[i1] = bitangent.y; + bitangents[i2] = bitangent.z; - binormals[i + length] = binormal.x; - binormals[i1 + length] = binormal.y; - binormals[i2 + length] = binormal.z; + bitangents[i + length] = bitangent.x; + bitangents[i1 + length] = bitangent.y; + bitangents[i2 + length] = bitangent.z; } } } @@ -27062,13 +26450,22 @@ define('Core/EllipseGeometry',[ }); } - if (vertexFormat.binormal) { - attributes.binormal = new GeometryAttribute({ + if (vertexFormat.bitangent) { + attributes.bitangent = new GeometryAttribute({ + componentDatatype : ComponentDatatype.FLOAT, + componentsPerAttribute : 3, + values : bitangents + }); + } + + if (shadowVolume) { + attributes.extrudeDirection = new GeometryAttribute({ componentDatatype : ComponentDatatype.FLOAT, componentsPerAttribute : 3, - values : binormals + values : extrudeNormals }); } + return attributes; } @@ -27264,6 +26661,7 @@ define('Core/EllipseGeometry',[ this._vertexFormat = VertexFormat.clone(vertexFormat); this._extrudedHeight = defaultValue(extrudedHeight, height); this._extrude = extrude; + this._shadowVolume = defaultValue(options.shadowVolume, false); this._workerName = 'createEllipseGeometry'; this._rectangle = computeRectangle(this._center, this._ellipsoid, semiMajorAxis, semiMinorAxis, this._rotation); @@ -27273,7 +26671,7 @@ define('Core/EllipseGeometry',[ * The number of elements used to pack the object into an array. * @type {Number} */ - EllipseGeometry.packedLength = Cartesian3.packedLength + Ellipsoid.packedLength + VertexFormat.packedLength + Rectangle.packedLength + 8; + EllipseGeometry.packedLength = Cartesian3.packedLength + Ellipsoid.packedLength + VertexFormat.packedLength + Rectangle.packedLength + 9; /** * Stores the provided instance into the provided array. @@ -27313,7 +26711,8 @@ define('Core/EllipseGeometry',[ array[startingIndex++] = value._height; array[startingIndex++] = value._granularity; array[startingIndex++] = value._extrudedHeight; - array[startingIndex] = value._extrude ? 1.0 : 0.0; + array[startingIndex++] = value._extrude ? 1.0 : 0.0; + array[startingIndex] = value._shadowVolume ? 1.0 : 0.0; return array; }; @@ -27332,7 +26731,8 @@ define('Core/EllipseGeometry',[ stRotation : undefined, height : undefined, granularity : undefined, - extrudedHeight : undefined + extrudedHeight : undefined, + shadowVolume: undefined }; /** @@ -27369,7 +26769,8 @@ define('Core/EllipseGeometry',[ var height = array[startingIndex++]; var granularity = array[startingIndex++]; var extrudedHeight = array[startingIndex++]; - var extrude = array[startingIndex] === 1.0; + var extrude = array[startingIndex++] === 1.0; + var shadowVolume = array[startingIndex] === 1.0; if (!defined(result)) { scratchOptions.height = height; @@ -27379,6 +26780,7 @@ define('Core/EllipseGeometry',[ scratchOptions.rotation = rotation; scratchOptions.semiMajorAxis = semiMajorAxis; scratchOptions.semiMinorAxis = semiMinorAxis; + scratchOptions.shadowVolume = shadowVolume; return new EllipseGeometry(scratchOptions); } @@ -27393,6 +26795,7 @@ define('Core/EllipseGeometry',[ result._granularity = granularity; result._extrudedHeight = extrudedHeight; result._extrude = extrude; + result._shadowVolume = shadowVolume; result._rectangle = Rectangle.clone(rectangle); return result; @@ -27426,6 +26829,7 @@ define('Core/EllipseGeometry',[ if (ellipseGeometry._extrude) { options.extrudedHeight = Math.min(ellipseGeometry._extrudedHeight, ellipseGeometry._height); options.height = Math.max(ellipseGeometry._extrudedHeight, ellipseGeometry._height); + options.shadowVolume = ellipseGeometry._shadowVolume; geometry = computeExtrudedEllipse(options); } else { geometry = computeEllipse(options); @@ -27459,7 +26863,8 @@ define('Core/EllipseGeometry',[ granularity : granularity, extrudedHeight : minHeight, height : maxHeight, - vertexFormat : VertexFormat.POSITION_ONLY + vertexFormat : VertexFormat.POSITION_ONLY, + shadowVolume: true }); }; diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createEllipseOutlineGeometry.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createEllipseOutlineGeometry.js index dbc45262..cfe6e135 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createEllipseOutlineGeometry.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createEllipseOutlineGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,68 +45,6 @@ define('Core/defined',[],function() { return defined; }); -/*global define*/ -define('Core/freezeObject',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Freezes an object, using Object.freeze if available, otherwise returns - * the object unchanged. This function should be used in setup code to prevent - * errors from completely halting JavaScript execution in legacy browsers. - * - * @private - * - * @exports freezeObject - */ - var freezeObject = Object.freeze; - if (!defined(freezeObject)) { - freezeObject = function(o) { - return o; - }; - } - - return freezeObject; -}); - -/*global define*/ -define('Core/defaultValue',[ - './freezeObject' - ], function( - freezeObject) { - 'use strict'; - - /** - * Returns the first parameter if not undefined, otherwise the second parameter. - * Useful for setting a default value for a parameter. - * - * @exports defaultValue - * - * @param {*} a - * @param {*} b - * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter. - * - * @example - * param = Cesium.defaultValue(param, 'default'); - */ - function defaultValue(a, b) { - if (a !== undefined) { - return a; - } - return b; - } - - /** - * A frozen empty object that can be used as the default value for options passed as - * an object literal. - */ - defaultValue.EMPTY_OBJECT = freezeObject({}); - - return defaultValue; -}); - /*global define*/ define('Core/DeveloperError',[ './defined' @@ -188,41 +126,13 @@ define('Core/DeveloperError',[ return DeveloperError; }); -/*global define*/ -define('Core/isArray',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Tests an object to see if it is an array. - * @exports isArray - * - * @param {Object} value The value to test. - * @returns {Boolean} true if the value is an array, false otherwise. - */ - var isArray = Array.isArray; - if (!defined(isArray)) { - isArray = function(value) { - return Object.prototype.toString.call(value) === '[object Array]'; - }; - } - - return isArray; -}); - /*global define*/ define('Core/Check',[ - './defaultValue', - './defined', - './DeveloperError', - './isArray' + './defined', + './DeveloperError' ], function( - defaultValue, defined, - DeveloperError, - isArray) { + DeveloperError) { 'use strict'; /** @@ -237,111 +147,134 @@ define('Core/Check',[ */ Check.typeOf = {}; - /** - * Contains functions for checking numeric conditions such as minimum and maximum values - */ - Check.numeric = {}; - function getUndefinedErrorMessage(name) { - return name + ' was required but undefined.'; + return name + ' is required, actual value was undefined'; } function getFailedTypeErrorMessage(actual, expected, name) { - return 'Expected ' + name + ' to be typeof ' + expected + ', got ' + actual; + return 'Expected ' + name + ' to be typeof ' + expected + ', actual typeof was ' + actual; } /** * Throws if test is not defined * - * @param {*} test The value that is to be checked * @param {String} name The name of the variable being tested + * @param {*} test The value that is to be checked * @exception {DeveloperError} test must be defined */ - Check.defined = function (test, name) { + Check.defined = function (name, test) { if (!defined(test)) { throw new DeveloperError(getUndefinedErrorMessage(name)); } }; /** - * Throws if test is greater than maximum + * Throws if test is not typeof 'function' * - * @param {Number} test The value to test - * @param {Number} maximum The maximum allowed value - * @exception {DeveloperError} test must not be greater than maximum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'function' */ - Check.numeric.maximum = function (test, maximum) { - Check.typeOf.number(test); - Check.typeOf.number(maximum); - if (test > maximum) { - throw new DeveloperError('Expected ' + test + ' to be at most ' + maximum); + Check.typeOf.func = function (name, test) { + if (typeof test !== 'function') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); } }; /** - * Throws if test is less than minimum + * Throws if test is not typeof 'string' * - * @param {Number} test The value to test - * @param {Number} minimum The minimum allowed value - * @exception {DeveloperError} test must not be less than mininum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'string' */ - Check.numeric.minimum = function (test, minimum) { - Check.typeOf.number(test); - Check.typeOf.number(minimum); - if (test < minimum) { - throw new DeveloperError('Expected ' + test + ' to be at least ' + minimum); + Check.typeOf.string = function (name, test) { + if (typeof test !== 'string') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); } }; /** - * Throws if test is not typeof 'function' + * Throws if test is not typeof 'number' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'function' + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'number' */ - Check.typeOf.function = function (test, name) { - if (typeof test !== 'function') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); + Check.typeOf.number = function (name, test) { + if (typeof test !== 'number') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); } }; /** - * Throws if test is not typeof 'string' + * Throws if test is not typeof 'number' and less than limit * + * @param {String} name The name of the variable being tested * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than limit + */ + Check.typeOf.number.lessThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test >= limit) { + throw new DeveloperError('Expected ' + name + ' to be less than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and less than or equal to limit + * * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'string' + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than or equal to limit */ - Check.typeOf.string = function (test, name) { - if (typeof test !== 'string') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); + Check.typeOf.number.lessThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test > limit) { + throw new DeveloperError('Expected ' + name + ' to be less than or equal to ' + limit + ', actual value was ' + test); } }; /** - * Throws if test is not typeof 'number' + * Throws if test is not typeof 'number' and greater than limit * + * @param {String} name The name of the variable being tested * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than limit + */ + Check.typeOf.number.greaterThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test <= limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and greater than or equal to limit + * * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'number' + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than or equal to limit */ - Check.typeOf.number = function (test, name) { - if (typeof test !== 'number') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); + Check.typeOf.number.greaterThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test < limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than or equal to' + limit + ', actual value was ' + test); } }; /** * Throws if test is not typeof 'object' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested + * @param {*} test The value to test * @exception {DeveloperError} test must be typeof 'object' */ - Check.typeOf.object = function (test, name) { + Check.typeOf.object = function (name, test) { if (typeof test !== 'object') { throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'object', name)); } @@ -350,11 +283,11 @@ define('Core/Check',[ /** * Throws if test is not typeof 'boolean' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested + * @param {*} test The value to test * @exception {DeveloperError} test must be typeof 'boolean' */ - Check.typeOf.boolean = function (test, name) { + Check.typeOf.bool = function (name, test) { if (typeof test !== 'boolean') { throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'boolean', name)); } @@ -363,6 +296,68 @@ define('Core/Check',[ return Check; }); +/*global define*/ +define('Core/freezeObject',[ + './defined' + ], function( + defined) { + 'use strict'; + + /** + * Freezes an object, using Object.freeze if available, otherwise returns + * the object unchanged. This function should be used in setup code to prevent + * errors from completely halting JavaScript execution in legacy browsers. + * + * @private + * + * @exports freezeObject + */ + var freezeObject = Object.freeze; + if (!defined(freezeObject)) { + freezeObject = function(o) { + return o; + }; + } + + return freezeObject; +}); + +/*global define*/ +define('Core/defaultValue',[ + './freezeObject' + ], function( + freezeObject) { + 'use strict'; + + /** + * Returns the first parameter if not undefined, otherwise the second parameter. + * Useful for setting a default value for a parameter. + * + * @exports defaultValue + * + * @param {*} a + * @param {*} b + * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter. + * + * @example + * param = Cesium.defaultValue(param, 'default'); + */ + function defaultValue(a, b) { + if (a !== undefined) { + return a; + } + return b; + } + + /** + * A frozen empty object that can be used as the default value for options passed as + * an object literal. + */ + defaultValue.EMPTY_OBJECT = freezeObject({}); + + return defaultValue; +}); + /* I've wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace so it's better encapsulated. Now you can have multiple random number generators @@ -1047,7 +1042,7 @@ define('Core/Math',[ if (!defined(angle)) { throw new DeveloperError('angle is required.'); } - + return CesiumMath.clamp(angle, -1*CesiumMath.PI_OVER_TWO, CesiumMath.PI_OVER_TWO); }; @@ -1057,11 +1052,11 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [<code>-CesiumMath.PI</code>, <code>CesiumMath.PI</code>]. */ - CesiumMath.negativePiToPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.negativePiToPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - return CesiumMath.zeroToTwoPi(x + CesiumMath.PI) - CesiumMath.PI; + return CesiumMath.zeroToTwoPi(angle + CesiumMath.PI) - CesiumMath.PI; }; /** @@ -1070,12 +1065,12 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [0, <code>CesiumMath.TWO_PI</code>]. */ - CesiumMath.zeroToTwoPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.zeroToTwoPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - var mod = CesiumMath.mod(x, CesiumMath.TWO_PI); - if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(x) > CesiumMath.EPSILON14) { + var mod = CesiumMath.mod(angle, CesiumMath.TWO_PI); + if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(angle) > CesiumMath.EPSILON14) { return CesiumMath.TWO_PI; } return mod; @@ -1145,7 +1140,7 @@ define('Core/Math',[ * @example * //Compute 7!, which is equal to 5040 * var computedFactorial = Cesium.Math.factorial(7); - * + * * @see {@link http://en.wikipedia.org/wiki/Factorial|Factorial on Wikipedia} */ CesiumMath.factorial = function(n) { @@ -1429,7 +1424,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.fromSpherical = function(spherical, result) { - Check.typeOf.object(spherical, 'spherical'); + Check.typeOf.object('spherical', spherical); if (!defined(result)) { result = new Cartesian3(); @@ -1513,8 +1508,8 @@ define('Core/Cartesian3',[ * @returns {Number[]} The array that was packed into */ Cartesian3.pack = function(value, array, startingIndex) { - Check.typeOf.object(value, 'value'); - Check.defined(array, 'array'); + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1534,7 +1529,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.unpack = function(array, startingIndex, result) { - Check.defined(array, 'array'); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1555,7 +1550,7 @@ define('Core/Cartesian3',[ * @returns {Number[]} The packed array. */ Cartesian3.packArray = function(array, result) { - Check.defined(array, 'array'); + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -1578,8 +1573,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3[]} The unpacked array. */ Cartesian3.unpackArray = function(array, result) { - Check.defined(array, 'array'); - Check.numeric.minimum(array.length, 3); + Check.defined('array', array); + Check.typeOf.number.greaterThanOrEquals('array.length', array.length, 3); if (array.length % 3 !== 0) { throw new DeveloperError('array length must be a multiple of 3.'); } @@ -1625,7 +1620,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the maximum component. */ Cartesian3.maximumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z); }; @@ -1637,7 +1632,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the minimum component. */ Cartesian3.minimumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z); }; @@ -1651,9 +1646,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the minimum components. */ Cartesian3.minimumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -1671,9 +1666,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the maximum components. */ Cartesian3.maximumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -1688,7 +1683,7 @@ define('Core/Cartesian3',[ * @returns {Number} The squared magnitude. */ Cartesian3.magnitudeSquared = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z; }; @@ -1717,8 +1712,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distance(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(2.0, 0.0, 0.0)); */ Cartesian3.distance = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitude(distanceScratch); @@ -1737,8 +1732,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distanceSquared(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(3.0, 0.0, 0.0)); */ Cartesian3.distanceSquared = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitudeSquared(distanceScratch); @@ -1752,8 +1747,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.normalize = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian3.magnitude(cartesian); @@ -1776,8 +1771,8 @@ define('Core/Cartesian3',[ * @returns {Number} The dot product. */ Cartesian3.dot = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z; }; @@ -1791,9 +1786,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyComponents = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -1835,9 +1830,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.add = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -1854,9 +1849,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.subtract = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -1873,9 +1868,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -1892,9 +1887,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.divideByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -1910,8 +1905,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.negate = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -1927,8 +1922,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.abs = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -1947,10 +1942,10 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.lerp = function(start, end, t, result) { - Check.typeOf.object(start, 'start'); - Check.typeOf.object(end, 'end'); - Check.typeOf.number(t, 't'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian3.multiplyByScalar(end, t, lerpScratch); result = Cartesian3.multiplyByScalar(start, 1.0 - t, result); @@ -1967,8 +1962,8 @@ define('Core/Cartesian3',[ * @returns {Number} The angle between the Cartesians. */ Cartesian3.angleBetween = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.normalize(left, angleBetweenScratch); Cartesian3.normalize(right, angleBetweenScratch2); @@ -1986,8 +1981,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The most orthogonal axis. */ Cartesian3.mostOrthogonalAxis = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian3.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian3.abs(f, f); @@ -2064,9 +2059,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The cross product. */ Cartesian3.cross = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var leftX = left.x; var leftY = left.y; @@ -2099,8 +2094,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromDegrees(-115.0, 37.0); */ Cartesian3.fromDegrees = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); longitude = CesiumMath.toRadians(longitude); latitude = CesiumMath.toRadians(latitude); @@ -2125,8 +2120,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromRadians(-2.007, 0.645); */ Cartesian3.fromRadians = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); height = defaultValue(height, 0.0); var radiiSquared = defined(ellipsoid) ? ellipsoid.radiiSquared : wgs84RadiiSquared; @@ -2160,7 +2155,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArray([-115.0, 37.0, -107.0, 33.0]); */ Cartesian3.fromDegreesArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -2194,7 +2189,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArray([-2.007, 0.645, -1.867, .575]); */ Cartesian3.fromRadiansArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -2228,7 +2223,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArrayHeights([-115.0, 37.0, 100000.0, -107.0, 33.0, 150000.0]); */ Cartesian3.fromDegreesArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -2263,7 +2258,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArrayHeights([-2.007, 0.645, 100000.0, -1.867, .575, 150000.0]); */ Cartesian3.fromRadiansArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -3010,7 +3005,9 @@ define('Core/Ellipsoid',[ /** * Computes an Ellipsoid from a Cartesian specifying the radii in x, y, and z directions. * - * @param {Cartesian3} [radii=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Cartesian3} [cartesian=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new + * instance should be created. * @returns {Ellipsoid} A new Ellipsoid instance. * * @exception {DeveloperError} All radii components must be greater than or equal to zero. @@ -3650,6 +3647,7 @@ define('Core/Interval',[ /*global define*/ define('Core/Matrix3',[ './Cartesian3', + './Check', './defaultValue', './defined', './defineProperties', @@ -3658,6 +3656,7 @@ define('Core/Matrix3',[ './Math' ], function( Cartesian3, + Check, defaultValue, defined, defineProperties, @@ -3720,13 +3719,8 @@ define('Core/Matrix3',[ * @returns {Number[]} The array that was packed into */ Matrix3.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3752,9 +3746,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. */ Matrix3.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3781,24 +3773,24 @@ define('Core/Matrix3',[ * @param {Matrix3} [result] The object onto which to store the result. * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. (Returns undefined if matrix is undefined) */ - Matrix3.clone = function(values, result) { - if (!defined(values)) { + Matrix3.clone = function(matrix, result) { + if (!defined(matrix)) { return undefined; } if (!defined(result)) { - return new Matrix3(values[0], values[3], values[6], - values[1], values[4], values[7], - values[2], values[5], values[8]); + return new Matrix3(matrix[0], matrix[3], matrix[6], + matrix[1], matrix[4], matrix[7], + matrix[2], matrix[5], matrix[8]); } - result[0] = values[0]; - result[1] = values[1]; - result[2] = values[2]; - result[3] = values[3]; - result[4] = values[4]; - result[5] = values[5]; - result[6] = values[6]; - result[7] = values[7]; - result[8] = values[8]; + result[0] = matrix[0]; + result[1] = matrix[1]; + result[2] = matrix[2]; + result[3] = matrix[3]; + result[4] = matrix[4]; + result[5] = matrix[5]; + result[6] = matrix[6]; + result[7] = matrix[7]; + result[8] = matrix[8]; return result; }; @@ -3824,9 +3816,7 @@ define('Core/Matrix3',[ * var m2 = Cesium.Matrix3.fromArray(v2, 2); */ Matrix3.fromArray = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3854,9 +3844,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values parameter is required'); - } + Check.defined('values', values); return Matrix3.clone(values, result); }; @@ -3870,9 +3858,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix3(values[0], values[1], values[2], @@ -3899,9 +3885,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this quaternion. */ Matrix3.fromQuaternion = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); var x2 = quaternion.x * quaternion.x; var xy = quaternion.x * quaternion.y; @@ -3951,10 +3935,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this headingPitchRoll. */ Matrix3.fromHeadingPitchRoll = function(headingPitchRoll, result) { - if (!defined(headingPitchRoll)) { - throw new DeveloperError('headingPitchRoll is required'); - } - var cosTheta = Math.cos(-headingPitchRoll.pitch); + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + + var cosTheta = Math.cos(-headingPitchRoll.pitch); var cosPsi = Math.cos(-headingPitchRoll.heading); var cosPhi = Math.cos(headingPitchRoll.roll); var sinTheta = Math.sin(-headingPitchRoll.pitch); @@ -4005,9 +3988,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix3( @@ -4043,9 +4024,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromUniformScale(2.0); */ Matrix3.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix3( @@ -4069,7 +4048,7 @@ define('Core/Matrix3',[ /** * Computes a Matrix3 instance representing the cross product equivalent matrix of a Cartesian3 vector. * - * @param {Cartesian3} the vector on the left hand side of the cross product operation. + * @param {Cartesian3} vector the vector on the left hand side of the cross product operation. * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created. * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. * @@ -4081,9 +4060,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromCrossProduct(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromCrossProduct = function(vector, result) { - if (!defined(vector)) { - throw new DeveloperError('vector is required.'); - } + Check.typeOf.object('vector', vector); if (!defined(result)) { return new Matrix3( @@ -4118,9 +4095,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationX = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4159,9 +4134,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationY = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4200,9 +4173,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationZ = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4236,9 +4207,7 @@ define('Core/Matrix3',[ * @returns {Number[]} The modified Array parameter or a new Array instance if one was not provided. */ Matrix3.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5], matrix[6], matrix[7], matrix[8]]; @@ -4272,12 +4241,10 @@ define('Core/Matrix3',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix3.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 2) { - throw new DeveloperError('row must be 0, 1, or 2.'); - } - if (typeof column !== 'number' || column < 0 || column > 2) { - throw new DeveloperError('column must be 0, 1, or 2.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 2); + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 2); return column * 3 + row; }; @@ -4293,16 +4260,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var startIndex = index * 3; var x = matrix[startIndex]; @@ -4327,18 +4288,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); var startIndex = index * 3; @@ -4359,15 +4313,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 3]; @@ -4391,18 +4340,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); result[index] = cartesian.x; @@ -4421,12 +4363,8 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[3], matrix[4], matrix[5], scratchColumn)); @@ -4457,15 +4395,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var column0Row0 = left[0] * right[0] + left[3] * right[1] + left[6] * right[2]; var column0Row1 = left[1] * right[0] + left[4] * right[1] + left[7] * right[2]; @@ -4500,15 +4432,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -4531,15 +4457,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -4562,15 +4482,9 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -4595,15 +4509,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -4634,15 +4542,9 @@ define('Core/Matrix3',[ * @see Matrix3.multiplyByUniformScale */ Matrix3.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); result[0] = matrix[0] * scale.x; result[1] = matrix[1] * scale.x; @@ -4664,12 +4566,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -4691,12 +4589,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var column0Row0 = matrix[0]; var column0Row1 = matrix[3]; @@ -4836,9 +4730,7 @@ define('Core/Matrix3',[ * var c = Cesium.Cartesian3.multiplyByScalar(v, lambda, new Cesium.Cartesian3()); // equal to Cesium.Matrix3.multiplyByVector(a, v) */ Matrix3.computeEigenDecomposition = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); // This routine was created based upon Matrix Computations, 3rd ed., by Golub and Van Loan, // section 8.4.3 The Classical Jacobi Algorithm @@ -4882,12 +4774,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -4909,9 +4797,7 @@ define('Core/Matrix3',[ * @returns {Number} The value of the determinant of the matrix. */ Matrix3.determinant = function(matrix) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); var m11 = matrix[0]; var m21 = matrix[3]; @@ -4936,12 +4822,8 @@ define('Core/Matrix3',[ * @exception {DeveloperError} matrix is not invertible. */ Matrix3.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var m11 = matrix[0]; var m21 = matrix[1]; @@ -5007,9 +4889,7 @@ define('Core/Matrix3',[ * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. */ Matrix3.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -5197,12 +5077,14 @@ define('Core/Matrix3',[ /*global define*/ define('Core/Cartesian4',[ + './Check', './defaultValue', './defined', './DeveloperError', './freezeObject', './Math' ], function( + Check, defaultValue, defined, DeveloperError, @@ -5285,9 +5167,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.fromColor = function(color, result) { - if (!defined(color)) { - throw new DeveloperError('color is required'); - } + Check.typeOf.object('color', color); if (!defined(result)) { return new Cartesian4(color.red, color.green, color.blue, color.alpha); } @@ -5339,12 +5219,8 @@ define('Core/Cartesian4',[ * @returns {Number[]} The array that was packed into */ Cartesian4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5365,9 +5241,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5389,9 +5263,7 @@ define('Core/Cartesian4',[ * @returns {Number[]} The packed array. */ Cartesian4.packArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -5414,9 +5286,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4[]} The unpacked array. */ Cartesian4.unpackArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -5459,9 +5329,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the maximum component. */ Cartesian4.maximumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -5473,9 +5341,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the minimum component. */ Cartesian4.minimumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -5489,15 +5355,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the minimum components. */ Cartesian4.minimumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -5516,15 +5376,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the maximum components. */ Cartesian4.maximumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -5541,9 +5395,7 @@ define('Core/Cartesian4',[ * @returns {Number} The squared magnitude. */ Cartesian4.magnitudeSquared = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z + cartesian.w * cartesian.w; }; @@ -5574,9 +5426,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(2.0, 0.0, 0.0, 0.0)); */ Cartesian4.distance = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitude(distanceScratch); @@ -5597,9 +5448,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(3.0, 0.0, 0.0, 0.0)); */ Cartesian4.distanceSquared = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitudeSquared(distanceScratch); @@ -5613,12 +5463,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.normalize = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian4.magnitude(cartesian); @@ -5642,12 +5488,8 @@ define('Core/Cartesian4',[ * @returns {Number} The dot product. */ Cartesian4.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w; }; @@ -5661,15 +5503,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -5687,15 +5523,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x / right.x; result.y = left.y / right.y; @@ -5713,15 +5543,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -5739,15 +5563,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -5765,15 +5583,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -5791,15 +5603,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -5816,12 +5622,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.negate = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -5838,12 +5640,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.abs = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -5863,18 +5661,10 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian4.multiplyByScalar(end, t, lerpScratch); result = Cartesian4.multiplyByScalar(start, 1.0 - t, result); @@ -5890,12 +5680,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The most orthogonal axis. */ Cartesian4.mostOrthogonalAxis = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian4.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian4.abs(f, f); @@ -6140,6 +5926,7 @@ define('Core/RuntimeError',[ define('Core/Matrix4',[ './Cartesian3', './Cartesian4', + './Check', './defaultValue', './defined', './defineProperties', @@ -6151,6 +5938,7 @@ define('Core/Matrix4',[ ], function( Cartesian3, Cartesian4, + Check, defaultValue, defined, defineProperties, @@ -6241,13 +6029,8 @@ define('Core/Matrix4',[ * @returns {Number[]} The array that was packed into */ Matrix4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -6280,9 +6063,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if one was not provided. */ Matrix4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -6378,9 +6159,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required'); - } + Check.defined('values', values); return Matrix4.clone(values, result); }; @@ -6394,9 +6173,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix4(values[0], values[1], values[2], values[3], @@ -6433,9 +6210,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRotationTranslation = function(rotation, translation, result) { - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } + Check.typeOf.object('rotation', rotation); translation = defaultValue(translation, Cartesian3.ZERO); @@ -6483,15 +6258,9 @@ define('Core/Matrix4',[ * result); */ Matrix4.fromTranslationQuaternionRotationScale = function(translation, rotation, scale, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('translation', translation); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('scale', scale); if (!defined(result)) { result = new Matrix4(); @@ -6552,9 +6321,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromTranslationRotationScale = function(translationRotationScale, result) { - if (!defined(translationRotationScale)) { - throw new DeveloperError('translationRotationScale is required.'); - } + Check.typeOf.object('translationRotationScale', translationRotationScale); return Matrix4.fromTranslationQuaternionRotationScale(translationRotationScale.translation, translationRotationScale.rotation, translationRotationScale.scale, result); }; @@ -6569,9 +6336,7 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByTranslation */ Matrix4.fromTranslation = function(translation, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } + Check.typeOf.object('translation', translation); return Matrix4.fromRotationTranslation(Matrix3.IDENTITY, translation, result); }; @@ -6592,9 +6357,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix4.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix4( @@ -6639,9 +6402,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromUniformScale(2.0); */ Matrix4.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix4(scale, 0.0, 0.0, 0.0, @@ -6681,23 +6442,15 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromCamera = function(camera, result) { - if (!defined(camera)) { - throw new DeveloperError('camera is required.'); - } + Check.typeOf.object('camera', camera); var position = camera.position; var direction = camera.direction; var up = camera.up; - if (!defined(position)) { - throw new DeveloperError('camera.position is required.'); - } - if (!defined(direction)) { - throw new DeveloperError('camera.direction is required.'); - } - if (!defined(up)) { - throw new DeveloperError('camera.up is required.'); - } + Check.typeOf.object('camera.position', position); + Check.typeOf.object('camera.direction', direction); + Check.typeOf.object('camera.up', up); Cartesian3.normalize(direction, fromCameraF); Cartesian3.normalize(Cartesian3.cross(fromCameraF, up, fromCameraR), fromCameraR); @@ -6776,21 +6529,11 @@ define('Core/Matrix4',[ * @exception {DeveloperError} far must be greater than zero. */ Matrix4.computePerspectiveFieldOfView = function(fovY, aspectRatio, near, far, result) { - if (fovY <= 0.0 || fovY > Math.PI) { - throw new DeveloperError('fovY must be in (0, PI].'); - } - if (aspectRatio <= 0.0) { - throw new DeveloperError('aspectRatio must be greater than zero.'); - } - if (near <= 0.0) { - throw new DeveloperError('near must be greater than zero.'); - } - if (far <= 0.0) { - throw new DeveloperError('far must be greater than zero.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThan('fovY', fovY, 0.0); + Check.typeOf.number.lessThan('fovY', fovY, Math.PI); + Check.typeOf.number.greaterThan('near', near, 0.0); + Check.typeOf.number.greaterThan('far', far, 0.0); + Check.typeOf.object('result', result); var bottom = Math.tan(fovY * 0.5); @@ -6831,27 +6574,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeOrthographicOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var a = 1.0 / (right - left); var b = 1.0 / (top - bottom); @@ -6896,27 +6625,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computePerspectiveOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -6957,24 +6672,12 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeInfinitePerspectiveOffCenter = function(left, right, bottom, top, near, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -7022,9 +6725,7 @@ define('Core/Matrix4',[ * }, 0.0, 1.0, new Cesium.Matrix4()); */ Matrix4.computeViewportTransformation = function(viewport, nearDepthRange, farDepthRange, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); viewport = defaultValue(viewport, defaultValue.EMPTY_OBJECT); var x = defaultValue(viewport.x, 0.0); @@ -7076,21 +6777,11 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeView = function(position, direction, up, right, result) { - if (!defined(position)) { - throw new DeveloperError('position is required'); - } - if (!defined(direction)) { - throw new DeveloperError('direction is required'); - } - if (!defined(up)) { - throw new DeveloperError('up is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); + Check.typeOf.object('up', up); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = right.x; result[1] = up.x; @@ -7131,9 +6822,7 @@ define('Core/Matrix4',[ * //creates a = [10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0] */ Matrix4.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], @@ -7177,12 +6866,11 @@ define('Core/Matrix4',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix4.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 3) { - throw new DeveloperError('row must be 0, 1, 2, or 3.'); - } - if (typeof column !== 'number' || column < 0 || column > 3) { - throw new DeveloperError('column must be 0, 1, 2, or 3.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 3); + + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 3); return column * 4 + row; }; @@ -7215,16 +6903,12 @@ define('Core/Matrix4',[ * // a.x = 12.0; a.y = 16.0; a.z = 20.0; a.w = 24.0; */ Matrix4.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var startIndex = index * 4; var x = matrix[startIndex]; @@ -7266,18 +6950,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 96.0, 25.0] */ Matrix4.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); var startIndex = index * 4; @@ -7298,15 +6977,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.setTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -7359,16 +7032,12 @@ define('Core/Matrix4',[ * // a.x = 18.0; a.y = 19.0; a.z = 20.0; a.w = 21.0; */ Matrix4.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 4]; @@ -7409,18 +7078,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 24.0, 25.0] */ Matrix4.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); result[index] = cartesian.x; @@ -7440,12 +7104,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter */ Matrix4.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[4], matrix[5], matrix[6], scratchColumn)); @@ -7477,15 +7137,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -7569,15 +7223,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -7607,15 +7255,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -7656,15 +7298,9 @@ define('Core/Matrix4',[ * var m3 = Cesium.Matrix4.multiplyTransformation(m1, m2, new Cesium.Matrix4()); */ Matrix4.multiplyTransformation = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -7742,15 +7378,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByMatrix3(m, rotation, m); */ Matrix4.multiplyByMatrix3 = function(matrix, rotation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('result', result); var left0 = matrix[0]; var left1 = matrix[1]; @@ -7818,15 +7448,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByTranslation(m, position, m); */ Matrix4.multiplyByTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); var x = translation.x; var y = translation.y; @@ -7878,15 +7502,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByScale */ Matrix4.multiplyByUniformScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scale', scale); + Check.typeOf.object('result', result); uniformScaleScratch.x = scale; uniformScaleScratch.y = scale; @@ -7915,15 +7533,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByUniformScale */ Matrix4.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); var scaleX = scale.x; var scaleY = scale.y; @@ -7962,15 +7574,9 @@ define('Core/Matrix4',[ * @returns {Cartesian4} The modified result parameter. */ Matrix4.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8006,15 +7612,9 @@ define('Core/Matrix4',[ * // Cesium.Matrix4.multiplyByVector(matrix, new Cesium.Cartesian4(p.x, p.y, p.z, 0.0), result); */ Matrix4.multiplyByPointAsVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8044,16 +7644,9 @@ define('Core/Matrix4',[ * var result = Cesium.Matrix4.multiplyByPoint(matrix, p, new Cesium.Cartesian3()); */ Matrix4.multiplyByPoint = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8093,15 +7686,9 @@ define('Core/Matrix4',[ * // [-44.0, -46.0, -48.0, -50.0] */ Matrix4.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -8145,12 +7732,8 @@ define('Core/Matrix4',[ * // [-22.0, -23.0, -24.0, -25.0] */ Matrix4.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -8194,12 +7777,8 @@ define('Core/Matrix4',[ * // [13.0, 17.0, 21.0, 25.0] */ Matrix4.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var matrix1 = matrix[1]; var matrix2 = matrix[2]; @@ -8235,12 +7814,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -8354,9 +7929,7 @@ define('Core/Matrix4',[ * //Prints "Difference between both the matrices is not less than 0.1" on the console */ Matrix4.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -8387,12 +7960,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter. */ Matrix4.getTranslation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = matrix[12]; result.y = matrix[13]; @@ -8420,15 +7989,11 @@ define('Core/Matrix4',[ * * // b = [10.0, 14.0, 18.0] * // [11.0, 15.0, 19.0] - * // [12.0, 16.0, 20.0] - */ - Matrix4.getRotation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + * // [12.0, 16.0, 20.0] + */ + Matrix4.getRotation = function(matrix, result) { + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -8460,12 +8025,8 @@ define('Core/Matrix4',[ * @exception {RuntimeError} matrix is not invertible because its determinate is zero. */ Matrix4.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); // Special case for a zero scale matrix that can occur, for example, // when a model's node has a [0, 0, 0] scale. @@ -8603,12 +8164,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.inverseTransformation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); //This function is an optimized version of the below 4 lines. //var rT = Matrix3.transpose(Matrix4.getRotation(matrix)); @@ -8892,6 +8449,7 @@ define('Core/Matrix4',[ /*global define*/ define('Core/Rectangle',[ './Cartographic', + './Check', './defaultValue', './defined', './defineProperties', @@ -8901,6 +8459,7 @@ define('Core/Rectangle',[ './Math' ], function( Cartographic, + Check, defaultValue, defined, defineProperties, @@ -8997,13 +8556,8 @@ define('Core/Rectangle',[ * @returns {Number[]} The array that was packed into */ Rectangle.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -9024,9 +8578,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -9047,9 +8599,7 @@ define('Core/Rectangle',[ * @returns {Number} The width. */ Rectangle.computeWidth = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; if (east < west) { @@ -9064,9 +8614,7 @@ define('Core/Rectangle',[ * @returns {Number} The height. */ Rectangle.computeHeight = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); return rectangle.north - rectangle.south; }; @@ -9101,6 +8649,32 @@ define('Core/Rectangle',[ return result; }; + /** + * Creates an rectangle given the boundary longitude and latitude in radians. + * + * @param {Number} [west=0.0] The westernmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [south=0.0] The southernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Number} [east=0.0] The easternmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [north=0.0] The northernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Rectangle} [result] The object onto which to store the result, or undefined if a new instance should be created. + * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. + * + * @example + * var rectangle = Cesium.Rectangle.fromRadians(0.0, Math.PI/4, Math.PI/8, 3*Math.PI/4); + */ + Rectangle.fromRadians = function(west, south, east, north, result) { + if (!defined(result)) { + return new Rectangle(west, south, east, north); + } + + result.west = defaultValue(west, 0.0); + result.south = defaultValue(south, 0.0); + result.east = defaultValue(east, 0.0); + result.north = defaultValue(north, 0.0); + + return result; + }; + /** * Creates the smallest possible Rectangle that encloses all positions in the provided array. * @@ -9109,9 +8683,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartographicArray = function(cartographics, result) { - if (!defined(cartographics)) { - throw new DeveloperError('cartographics is required.'); - } + Check.defined('cartographics', cartographics); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -9164,9 +8736,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartesianArray = function(cartesians, ellipsoid, result) { - if (!defined(cartesians)) { - throw new DeveloperError('cartesians is required.'); - } + Check.defined('cartesians', cartesians); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -9282,9 +8852,7 @@ define('Core/Rectangle',[ * @returns {Boolean} <code>true</code> if the Rectangles are within the provided epsilon, <code>false</code> otherwise. */ Rectangle.prototype.equalsEpsilon = function(other, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon is required and must be a number.'); - } + Check.typeOf.number('epsilon', epsilon); return defined(other) && (Math.abs(this.west - other.west) <= epsilon) && @@ -9304,45 +8872,23 @@ define('Core/Rectangle',[ * @exception {DeveloperError} <code>west</code> must be in the interval [<code>-Pi</code>, <code>Pi</code>]. */ Rectangle.validate = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var north = rectangle.north; - if (typeof north !== 'number') { - throw new DeveloperError('north is required to be a number.'); - } - - if (north < -CesiumMath.PI_OVER_TWO || north > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('north must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('north', north, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('north', north, CesiumMath.PI_OVER_TWO); var south = rectangle.south; - if (typeof south !== 'number') { - throw new DeveloperError('south is required to be a number.'); - } - - if (south < -CesiumMath.PI_OVER_TWO || south > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('south must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('south', south, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('south', south, CesiumMath.PI_OVER_TWO); var west = rectangle.west; - if (typeof west !== 'number') { - throw new DeveloperError('west is required to be a number.'); - } - - if (west < -Math.PI || west > Math.PI) { - throw new DeveloperError('west must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('west', west, -Math.PI); + Check.typeOf.number.lessThanOrEquals('west', west, Math.PI); var east = rectangle.east; - if (typeof east !== 'number') { - throw new DeveloperError('east is required to be a number.'); - } - - if (east < -Math.PI || east > Math.PI) { - throw new DeveloperError('east must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('east', east, -Math.PI); + Check.typeOf.number.lessThanOrEquals('east', east, Math.PI); }; /** @@ -9353,9 +8899,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.south); @@ -9374,9 +8918,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.north); @@ -9395,9 +8937,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.north); @@ -9416,9 +8956,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.south); @@ -9437,9 +8975,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.center = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; @@ -9474,12 +9010,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.intersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var rectangleEast = rectangle.east; var rectangleWest = rectangle.west; @@ -9535,12 +9067,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.simpleIntersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var west = Math.max(rectangle.west, otherRectangle.west); var south = Math.max(rectangle.south, otherRectangle.south); @@ -9571,12 +9099,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.union = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); if (!defined(result)) { result = new Rectangle(); @@ -9620,12 +9144,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.expand = function(rectangle, cartographic, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); if (!defined(result)) { result = new Rectangle(); @@ -9647,12 +9167,8 @@ define('Core/Rectangle',[ * @returns {Boolean} true if the provided cartographic is inside the rectangle, false otherwise. */ Rectangle.contains = function(rectangle, cartographic) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); var longitude = cartographic.longitude; var latitude = cartographic.latitude; @@ -9685,9 +9201,7 @@ define('Core/Rectangle',[ * @returns {Cartesian3[]} The modified result parameter or a new Array of Cartesians instances if none was provided. */ Rectangle.subsample = function(rectangle, ellipsoid, surfaceHeight, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84); surfaceHeight = defaultValue(surfaceHeight, 0.0); @@ -9765,9 +9279,9 @@ define('Core/Rectangle',[ define('Core/BoundingSphere',[ './Cartesian3', './Cartographic', + './Check', './defaultValue', './defined', - './DeveloperError', './Ellipsoid', './GeographicProjection', './Intersect', @@ -9778,9 +9292,9 @@ define('Core/BoundingSphere',[ ], function( Cartesian3, Cartographic, + Check, defaultValue, defined, - DeveloperError, Ellipsoid, GeographicProjection, Intersect, @@ -10110,9 +9624,7 @@ define('Core/BoundingSphere',[ stride = defaultValue(stride, 3); - if (stride < 3) { - throw new DeveloperError('stride must be 3 or greater.'); - } + Check.typeOf.number.greaterThanOrEquals('stride', stride, 3); var currentPos = fromPointsCurrentPos; currentPos.x = positions[0] + center.x; @@ -10416,9 +9928,8 @@ define('Core/BoundingSphere',[ * var sphere = Cesium.BoundingSphere.fromCornerPoints(new Cesium.Cartesian3(-0.5, -0.5, -0.5), new Cesium.Cartesian3(0.5, 0.5, 0.5)); */ BoundingSphere.fromCornerPoints = function(corner, oppositeCorner, result) { - if (!defined(corner) || !defined(oppositeCorner)) { - throw new DeveloperError('corner and oppositeCorner are required.'); - } + Check.typeOf.object('corner', corner); + Check.typeOf.object('oppositeCorner', oppositeCorner); if (!defined(result)) { result = new BoundingSphere(); @@ -10442,9 +9953,7 @@ define('Core/BoundingSphere',[ * var boundingSphere = Cesium.BoundingSphere.fromEllipsoid(ellipsoid); */ BoundingSphere.fromEllipsoid = function(ellipsoid, result) { - if (!defined(ellipsoid)) { - throw new DeveloperError('ellipsoid is required.'); - } + Check.typeOf.object('ellipsoid', ellipsoid); if (!defined(result)) { result = new BoundingSphere(); @@ -10570,13 +10079,8 @@ define('Core/BoundingSphere',[ * @returns {Number[]} The array that was packed into */ BoundingSphere.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -10598,9 +10102,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if one was not provided. */ BoundingSphere.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -10627,13 +10129,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.union = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); if (!defined(result)) { result = new BoundingSphere(); @@ -10682,13 +10179,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.expand = function(sphere, point, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(point)) { - throw new DeveloperError('point is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('point', point); result = BoundingSphere.clone(sphere, result); @@ -10711,13 +10203,8 @@ define('Core/BoundingSphere',[ * intersects the plane. */ BoundingSphere.intersectPlane = function(sphere, plane) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(plane)) { - throw new DeveloperError('plane is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('plane', plane); var center = sphere.center; var radius = sphere.radius; @@ -10743,13 +10230,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.transform = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -10777,12 +10259,8 @@ define('Core/BoundingSphere',[ * }); */ BoundingSphere.distanceSquaredTo = function(sphere, cartesian) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('cartesian', cartesian); var diff = Cartesian3.subtract(sphere.center, cartesian, distanceSquaredToScratch); return Cartesian3.magnitudeSquared(diff) - sphere.radius * sphere.radius; @@ -10804,13 +10282,8 @@ define('Core/BoundingSphere',[ * var newBoundingSphere = Cesium.BoundingSphere.transformWithoutScale(boundingSphere, modelMatrix); */ BoundingSphere.transformWithoutScale = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -10837,17 +10310,9 @@ define('Core/BoundingSphere',[ * @returns {Interval} The nearest and farthest distances on the bounding sphere from position in direction. */ BoundingSphere.computePlaneDistances = function(sphere, position, direction, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(position)) { - throw new DeveloperError('position is required.'); - } - - if (!defined(direction)) { - throw new DeveloperError('direction is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); if (!defined(result)) { result = new Interval(); @@ -10882,9 +10347,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.projectTo2D = function(sphere, projection, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } + Check.typeOf.object('sphere', sphere); projection = defaultValue(projection, projectTo2DProjection); @@ -10979,12 +10442,8 @@ define('Core/BoundingSphere',[ * @returns {Boolean} <code>true</code> if the sphere is not visible; otherwise <code>false</code>. */ BoundingSphere.isOccluded = function(sphere, occluder) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(occluder)) { - throw new DeveloperError('occluder is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('occluder', occluder); return !occluder.isBoundingSphereVisible(sphere); }; @@ -12193,7 +11652,10 @@ define('Core/WebGLConstants',[ COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : 0x9279, TEXTURE_IMMUTABLE_FORMAT : 0x912F, MAX_ELEMENT_INDEX : 0x8D6B, - TEXTURE_IMMUTABLE_LEVELS : 0x82DF + TEXTURE_IMMUTABLE_LEVELS : 0x82DF, + + // Extensions + MAX_TEXTURE_MAX_ANISOTROPY_EXT : 0x84FF }; return freezeObject(WebGLConstants); @@ -12529,6 +11991,7 @@ define('Core/ComponentDatatype',[ /*global define*/ define('Core/Quaternion',[ './Cartesian3', + './Check', './defaultValue', './defined', './DeveloperError', @@ -12538,6 +12001,7 @@ define('Core/Quaternion',[ './Matrix3' ], function( Cartesian3, + Check, defaultValue, defined, DeveloperError, @@ -12600,12 +12064,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided. */ Quaternion.fromAxisAngle = function(axis, angle, result) { - if (!defined(axis)) { - throw new DeveloperError('axis is required.'); - } - if (typeof angle !== 'number') { - throw new DeveloperError('angle is required and must be a number.'); - } + Check.typeOf.object('axis', axis); + Check.typeOf.number('angle', angle); var halfAngle = angle / 2.0; var s = Math.sin(halfAngle); @@ -12637,9 +12097,7 @@ define('Core/Quaternion',[ * @see Matrix3.fromQuaternion */ Quaternion.fromRotationMatrix = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); var root; var x; @@ -12713,15 +12171,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter or a new Quaternion instance if none was provided. */ Quaternion.fromHeadingPitchRoll = function(heading, pitch, roll, result) { - if (!defined(heading)) { - throw new DeveloperError('heading is required.'); - } - if (!defined(pitch)) { - throw new DeveloperError('pitch is required.'); - } - if (!defined(roll)) { - throw new DeveloperError('roll is required.'); - } + Check.typeOf.number('heading', heading); + Check.typeOf.number('pitch', pitch); + Check.typeOf.number('roll', roll); var rollQuaternion = Quaternion.fromAxisAngle(Cartesian3.UNIT_X, roll, scratchHPRQuaternion); var pitchQuaternion = Quaternion.fromAxisAngle(Cartesian3.UNIT_Y, -pitch, result); @@ -12752,13 +12204,8 @@ define('Core/Quaternion',[ * @returns {Number[]} The array that was packed into */ Quaternion.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -12779,9 +12226,7 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided. */ Quaternion.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -12836,7 +12281,7 @@ define('Core/Quaternion',[ * * @param {Number[]} array The array previously packed for interpolation. * @param {Number[]} sourceArray The original packed array. - * @param {Number} [startingIndex=0] The startingIndex used to convert the array. + * @param {Number} [firstIndex=0] The firstIndex used to convert the array. * @param {Number} [lastIndex=packedArray.length] The lastIndex used to convert the array. * @param {Quaternion} [result] The object into which to store the result. * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided. @@ -12890,12 +12335,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.conjugate = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); result.x = -quaternion.x; result.y = -quaternion.y; @@ -12911,9 +12352,7 @@ define('Core/Quaternion',[ * @returns {Number} The magnitude squared. */ Quaternion.magnitudeSquared = function(quaternion) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); return quaternion.x * quaternion.x + quaternion.y * quaternion.y + quaternion.z * quaternion.z + quaternion.w * quaternion.w; }; @@ -12936,9 +12375,7 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.normalize = function(quaternion, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); var inverseMagnitude = 1.0 / Quaternion.magnitude(quaternion); var x = quaternion.x * inverseMagnitude; @@ -12961,9 +12398,7 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.inverse = function(quaternion, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); var magnitudeSquared = Quaternion.magnitudeSquared(quaternion); result = Quaternion.conjugate(quaternion, result); @@ -12979,15 +12414,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -13005,15 +12434,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -13030,12 +12453,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.negate = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); result.x = -quaternion.x; result.y = -quaternion.y; @@ -13052,12 +12471,8 @@ define('Core/Quaternion',[ * @returns {Number} The dot product. */ Quaternion.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w; }; @@ -13071,15 +12486,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var leftX = left.x; var leftY = left.y; @@ -13112,15 +12521,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.multiplyByScalar = function(quaternion, scalar, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = quaternion.x * scalar; result.y = quaternion.y * scalar; @@ -13138,15 +12541,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.divideByScalar = function(quaternion, scalar, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = quaternion.x / scalar; result.y = quaternion.y / scalar; @@ -13163,12 +12560,8 @@ define('Core/Quaternion',[ * @returns {Cartesian3} The modified result parameter. */ Quaternion.computeAxis = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); var w = quaternion.w; if (Math.abs(w - 1.0) < CesiumMath.EPSILON6) { @@ -13191,9 +12584,7 @@ define('Core/Quaternion',[ * @returns {Number} The angle of rotation. */ Quaternion.computeAngle = function(quaternion) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); if (Math.abs(quaternion.w - 1.0) < CesiumMath.EPSILON6) { return 0.0; @@ -13212,18 +12603,10 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); lerpScratch = Quaternion.multiplyByScalar(end, t, lerpScratch); result = Quaternion.multiplyByScalar(start, 1.0 - t, result); @@ -13245,18 +12628,10 @@ define('Core/Quaternion',[ * @see Quaternion#fastSlerp */ Quaternion.slerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var dot = Quaternion.dot(start, end); @@ -13289,12 +12664,8 @@ define('Core/Quaternion',[ * @returns {Cartesian3} The modified result parameter. */ Quaternion.log = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); var theta = CesiumMath.acosClamped(quaternion.w); var thetaOverSinTheta = 0.0; @@ -13314,12 +12685,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.exp = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var theta = Cartesian3.magnitude(cartesian); var sinThetaOverTheta = 0.0; @@ -13354,12 +12721,10 @@ define('Core/Quaternion',[ * @see Quaternion#squad */ Quaternion.computeInnerQuadrangle = function(q0, q1, q2, result) { - if (!defined(q0) || !defined(q1) || !defined(q2)) { - throw new DeveloperError('q0, q1, and q2 are required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('q0', q0); + Check.typeOf.object('q1', q1); + Check.typeOf.object('q2', q2); + Check.typeOf.object('result', result); var qInv = Quaternion.conjugate(q1, squadScratchQuaternion0); Quaternion.multiply(qInv, q2, squadScratchQuaternion1); @@ -13401,15 +12766,12 @@ define('Core/Quaternion',[ * @see Quaternion#computeInnerQuadrangle */ Quaternion.squad = function(q0, q1, s0, s1, t, result) { - if (!defined(q0) || !defined(q1) || !defined(s0) || !defined(s1)) { - throw new DeveloperError('q0, q1, s0, and s1 are required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('q0', q0); + Check.typeOf.object('q1', q1); + Check.typeOf.object('s0', s0); + Check.typeOf.object('s1', s1); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var slerp0 = Quaternion.slerp(q0, q1, t, squadScratchQuaternion0); var slerp1 = Quaternion.slerp(s0, s1, t, squadScratchQuaternion1); @@ -13446,18 +12808,10 @@ define('Core/Quaternion',[ * @see Quaternion#slerp */ Quaternion.fastSlerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var x = Quaternion.dot(start, end); @@ -13506,15 +12860,12 @@ define('Core/Quaternion',[ * @see Quaternion#squad */ Quaternion.fastSquad = function(q0, q1, s0, s1, t, result) { - if (!defined(q0) || !defined(q1) || !defined(s0) || !defined(s1)) { - throw new DeveloperError('q0, q1, s0, and s1 are required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('q0', q0); + Check.typeOf.object('q1', q1); + Check.typeOf.object('s0', s0); + Check.typeOf.object('s1', s1); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var slerp0 = Quaternion.fastSlerp(q0, q1, t, squadScratchQuaternion0); var slerp1 = Quaternion.fastSlerp(s0, s1, t, squadScratchQuaternion1); @@ -13550,9 +12901,7 @@ define('Core/Quaternion',[ * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. */ Quaternion.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon is required and must be a number.'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || ((defined(left)) && @@ -14096,7 +13445,7 @@ define('Core/Geometry',[ * <li><code>position</code> - 3D vertex position. 64-bit floating-point (for precision). 3 components per attribute. See {@link VertexFormat#position}.</li> * <li><code>normal</code> - Normal (normalized), commonly used for lighting. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#normal}.</li> * <li><code>st</code> - 2D texture coordinate. 32-bit floating-point. 2 components per attribute. See {@link VertexFormat#st}.</li> - * <li><code>binormal</code> - Binormal (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#binormal}.</li> + * <li><code>bitangent</code> - Bitangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#bitangent}.</li> * <li><code>tangent</code> - Tangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#tangent}.</li> * </ul> * </p> @@ -14125,7 +13474,7 @@ define('Core/Geometry',[ * componentsPerAttribute : 3, * values : new Float32Array(0) * }); - * + * * @see GeometryAttribute * @see VertexFormat */ @@ -14406,7 +13755,7 @@ define('Core/GeometryAttributes',[ this.st = options.st; /** - * The binormal attribute (normalized), which is used for tangent-space effects like bump mapping. + * The bitangent attribute (normalized), which is used for tangent-space effects like bump mapping. * <p> * 32-bit floating-point. 3 components per attribute. * </p> @@ -14415,7 +13764,7 @@ define('Core/GeometryAttributes',[ * * @default undefined */ - this.binormal = options.binormal; + this.bitangent = options.bitangent; /** * The tangent attribute (normalized), which is used for tangent-space effects like bump mapping. diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createEllipsoidGeometry.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createEllipsoidGeometry.js index 5df30663..d0f55490 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createEllipsoidGeometry.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createEllipsoidGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,68 +45,6 @@ define('Core/defined',[],function() { return defined; }); -/*global define*/ -define('Core/freezeObject',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Freezes an object, using Object.freeze if available, otherwise returns - * the object unchanged. This function should be used in setup code to prevent - * errors from completely halting JavaScript execution in legacy browsers. - * - * @private - * - * @exports freezeObject - */ - var freezeObject = Object.freeze; - if (!defined(freezeObject)) { - freezeObject = function(o) { - return o; - }; - } - - return freezeObject; -}); - -/*global define*/ -define('Core/defaultValue',[ - './freezeObject' - ], function( - freezeObject) { - 'use strict'; - - /** - * Returns the first parameter if not undefined, otherwise the second parameter. - * Useful for setting a default value for a parameter. - * - * @exports defaultValue - * - * @param {*} a - * @param {*} b - * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter. - * - * @example - * param = Cesium.defaultValue(param, 'default'); - */ - function defaultValue(a, b) { - if (a !== undefined) { - return a; - } - return b; - } - - /** - * A frozen empty object that can be used as the default value for options passed as - * an object literal. - */ - defaultValue.EMPTY_OBJECT = freezeObject({}); - - return defaultValue; -}); - /*global define*/ define('Core/DeveloperError',[ './defined' @@ -188,41 +126,13 @@ define('Core/DeveloperError',[ return DeveloperError; }); -/*global define*/ -define('Core/isArray',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Tests an object to see if it is an array. - * @exports isArray - * - * @param {Object} value The value to test. - * @returns {Boolean} true if the value is an array, false otherwise. - */ - var isArray = Array.isArray; - if (!defined(isArray)) { - isArray = function(value) { - return Object.prototype.toString.call(value) === '[object Array]'; - }; - } - - return isArray; -}); - /*global define*/ define('Core/Check',[ - './defaultValue', - './defined', - './DeveloperError', - './isArray' + './defined', + './DeveloperError' ], function( - defaultValue, defined, - DeveloperError, - isArray) { + DeveloperError) { 'use strict'; /** @@ -237,111 +147,134 @@ define('Core/Check',[ */ Check.typeOf = {}; - /** - * Contains functions for checking numeric conditions such as minimum and maximum values - */ - Check.numeric = {}; - function getUndefinedErrorMessage(name) { - return name + ' was required but undefined.'; + return name + ' is required, actual value was undefined'; } function getFailedTypeErrorMessage(actual, expected, name) { - return 'Expected ' + name + ' to be typeof ' + expected + ', got ' + actual; + return 'Expected ' + name + ' to be typeof ' + expected + ', actual typeof was ' + actual; } /** * Throws if test is not defined * - * @param {*} test The value that is to be checked * @param {String} name The name of the variable being tested + * @param {*} test The value that is to be checked * @exception {DeveloperError} test must be defined */ - Check.defined = function (test, name) { + Check.defined = function (name, test) { if (!defined(test)) { throw new DeveloperError(getUndefinedErrorMessage(name)); } }; /** - * Throws if test is greater than maximum + * Throws if test is not typeof 'function' * - * @param {Number} test The value to test - * @param {Number} maximum The maximum allowed value - * @exception {DeveloperError} test must not be greater than maximum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'function' */ - Check.numeric.maximum = function (test, maximum) { - Check.typeOf.number(test); - Check.typeOf.number(maximum); - if (test > maximum) { - throw new DeveloperError('Expected ' + test + ' to be at most ' + maximum); + Check.typeOf.func = function (name, test) { + if (typeof test !== 'function') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); } }; /** - * Throws if test is less than minimum + * Throws if test is not typeof 'string' * - * @param {Number} test The value to test - * @param {Number} minimum The minimum allowed value - * @exception {DeveloperError} test must not be less than mininum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'string' */ - Check.numeric.minimum = function (test, minimum) { - Check.typeOf.number(test); - Check.typeOf.number(minimum); - if (test < minimum) { - throw new DeveloperError('Expected ' + test + ' to be at least ' + minimum); + Check.typeOf.string = function (name, test) { + if (typeof test !== 'string') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); } }; /** - * Throws if test is not typeof 'function' + * Throws if test is not typeof 'number' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'function' + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'number' */ - Check.typeOf.function = function (test, name) { - if (typeof test !== 'function') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); + Check.typeOf.number = function (name, test) { + if (typeof test !== 'number') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); } }; /** - * Throws if test is not typeof 'string' + * Throws if test is not typeof 'number' and less than limit * + * @param {String} name The name of the variable being tested * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than limit + */ + Check.typeOf.number.lessThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test >= limit) { + throw new DeveloperError('Expected ' + name + ' to be less than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and less than or equal to limit + * * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'string' + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than or equal to limit */ - Check.typeOf.string = function (test, name) { - if (typeof test !== 'string') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); + Check.typeOf.number.lessThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test > limit) { + throw new DeveloperError('Expected ' + name + ' to be less than or equal to ' + limit + ', actual value was ' + test); } }; /** - * Throws if test is not typeof 'number' + * Throws if test is not typeof 'number' and greater than limit * + * @param {String} name The name of the variable being tested * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than limit + */ + Check.typeOf.number.greaterThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test <= limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and greater than or equal to limit + * * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'number' + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than or equal to limit */ - Check.typeOf.number = function (test, name) { - if (typeof test !== 'number') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); + Check.typeOf.number.greaterThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test < limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than or equal to' + limit + ', actual value was ' + test); } }; /** * Throws if test is not typeof 'object' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested + * @param {*} test The value to test * @exception {DeveloperError} test must be typeof 'object' */ - Check.typeOf.object = function (test, name) { + Check.typeOf.object = function (name, test) { if (typeof test !== 'object') { throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'object', name)); } @@ -350,11 +283,11 @@ define('Core/Check',[ /** * Throws if test is not typeof 'boolean' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested + * @param {*} test The value to test * @exception {DeveloperError} test must be typeof 'boolean' */ - Check.typeOf.boolean = function (test, name) { + Check.typeOf.bool = function (name, test) { if (typeof test !== 'boolean') { throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'boolean', name)); } @@ -363,6 +296,68 @@ define('Core/Check',[ return Check; }); +/*global define*/ +define('Core/freezeObject',[ + './defined' + ], function( + defined) { + 'use strict'; + + /** + * Freezes an object, using Object.freeze if available, otherwise returns + * the object unchanged. This function should be used in setup code to prevent + * errors from completely halting JavaScript execution in legacy browsers. + * + * @private + * + * @exports freezeObject + */ + var freezeObject = Object.freeze; + if (!defined(freezeObject)) { + freezeObject = function(o) { + return o; + }; + } + + return freezeObject; +}); + +/*global define*/ +define('Core/defaultValue',[ + './freezeObject' + ], function( + freezeObject) { + 'use strict'; + + /** + * Returns the first parameter if not undefined, otherwise the second parameter. + * Useful for setting a default value for a parameter. + * + * @exports defaultValue + * + * @param {*} a + * @param {*} b + * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter. + * + * @example + * param = Cesium.defaultValue(param, 'default'); + */ + function defaultValue(a, b) { + if (a !== undefined) { + return a; + } + return b; + } + + /** + * A frozen empty object that can be used as the default value for options passed as + * an object literal. + */ + defaultValue.EMPTY_OBJECT = freezeObject({}); + + return defaultValue; +}); + /* I've wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace so it's better encapsulated. Now you can have multiple random number generators @@ -1047,7 +1042,7 @@ define('Core/Math',[ if (!defined(angle)) { throw new DeveloperError('angle is required.'); } - + return CesiumMath.clamp(angle, -1*CesiumMath.PI_OVER_TWO, CesiumMath.PI_OVER_TWO); }; @@ -1057,11 +1052,11 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [<code>-CesiumMath.PI</code>, <code>CesiumMath.PI</code>]. */ - CesiumMath.negativePiToPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.negativePiToPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - return CesiumMath.zeroToTwoPi(x + CesiumMath.PI) - CesiumMath.PI; + return CesiumMath.zeroToTwoPi(angle + CesiumMath.PI) - CesiumMath.PI; }; /** @@ -1070,12 +1065,12 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [0, <code>CesiumMath.TWO_PI</code>]. */ - CesiumMath.zeroToTwoPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.zeroToTwoPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - var mod = CesiumMath.mod(x, CesiumMath.TWO_PI); - if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(x) > CesiumMath.EPSILON14) { + var mod = CesiumMath.mod(angle, CesiumMath.TWO_PI); + if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(angle) > CesiumMath.EPSILON14) { return CesiumMath.TWO_PI; } return mod; @@ -1145,7 +1140,7 @@ define('Core/Math',[ * @example * //Compute 7!, which is equal to 5040 * var computedFactorial = Cesium.Math.factorial(7); - * + * * @see {@link http://en.wikipedia.org/wiki/Factorial|Factorial on Wikipedia} */ CesiumMath.factorial = function(n) { @@ -1429,7 +1424,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.fromSpherical = function(spherical, result) { - Check.typeOf.object(spherical, 'spherical'); + Check.typeOf.object('spherical', spherical); if (!defined(result)) { result = new Cartesian3(); @@ -1513,8 +1508,8 @@ define('Core/Cartesian3',[ * @returns {Number[]} The array that was packed into */ Cartesian3.pack = function(value, array, startingIndex) { - Check.typeOf.object(value, 'value'); - Check.defined(array, 'array'); + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1534,7 +1529,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.unpack = function(array, startingIndex, result) { - Check.defined(array, 'array'); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1555,7 +1550,7 @@ define('Core/Cartesian3',[ * @returns {Number[]} The packed array. */ Cartesian3.packArray = function(array, result) { - Check.defined(array, 'array'); + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -1578,8 +1573,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3[]} The unpacked array. */ Cartesian3.unpackArray = function(array, result) { - Check.defined(array, 'array'); - Check.numeric.minimum(array.length, 3); + Check.defined('array', array); + Check.typeOf.number.greaterThanOrEquals('array.length', array.length, 3); if (array.length % 3 !== 0) { throw new DeveloperError('array length must be a multiple of 3.'); } @@ -1625,7 +1620,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the maximum component. */ Cartesian3.maximumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z); }; @@ -1637,7 +1632,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the minimum component. */ Cartesian3.minimumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z); }; @@ -1651,9 +1646,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the minimum components. */ Cartesian3.minimumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -1671,9 +1666,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the maximum components. */ Cartesian3.maximumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -1688,7 +1683,7 @@ define('Core/Cartesian3',[ * @returns {Number} The squared magnitude. */ Cartesian3.magnitudeSquared = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z; }; @@ -1717,8 +1712,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distance(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(2.0, 0.0, 0.0)); */ Cartesian3.distance = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitude(distanceScratch); @@ -1737,8 +1732,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distanceSquared(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(3.0, 0.0, 0.0)); */ Cartesian3.distanceSquared = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitudeSquared(distanceScratch); @@ -1752,8 +1747,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.normalize = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian3.magnitude(cartesian); @@ -1776,8 +1771,8 @@ define('Core/Cartesian3',[ * @returns {Number} The dot product. */ Cartesian3.dot = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z; }; @@ -1791,9 +1786,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyComponents = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -1835,9 +1830,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.add = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -1854,9 +1849,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.subtract = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -1873,9 +1868,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -1892,9 +1887,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.divideByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -1910,8 +1905,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.negate = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -1927,8 +1922,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.abs = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -1947,10 +1942,10 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.lerp = function(start, end, t, result) { - Check.typeOf.object(start, 'start'); - Check.typeOf.object(end, 'end'); - Check.typeOf.number(t, 't'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian3.multiplyByScalar(end, t, lerpScratch); result = Cartesian3.multiplyByScalar(start, 1.0 - t, result); @@ -1967,8 +1962,8 @@ define('Core/Cartesian3',[ * @returns {Number} The angle between the Cartesians. */ Cartesian3.angleBetween = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.normalize(left, angleBetweenScratch); Cartesian3.normalize(right, angleBetweenScratch2); @@ -1986,8 +1981,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The most orthogonal axis. */ Cartesian3.mostOrthogonalAxis = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian3.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian3.abs(f, f); @@ -2064,9 +2059,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The cross product. */ Cartesian3.cross = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var leftX = left.x; var leftY = left.y; @@ -2099,8 +2094,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromDegrees(-115.0, 37.0); */ Cartesian3.fromDegrees = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); longitude = CesiumMath.toRadians(longitude); latitude = CesiumMath.toRadians(latitude); @@ -2125,8 +2120,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromRadians(-2.007, 0.645); */ Cartesian3.fromRadians = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); height = defaultValue(height, 0.0); var radiiSquared = defined(ellipsoid) ? ellipsoid.radiiSquared : wgs84RadiiSquared; @@ -2160,7 +2155,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArray([-115.0, 37.0, -107.0, 33.0]); */ Cartesian3.fromDegreesArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -2194,7 +2189,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArray([-2.007, 0.645, -1.867, .575]); */ Cartesian3.fromRadiansArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -2228,7 +2223,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArrayHeights([-115.0, 37.0, 100000.0, -107.0, 33.0, 150000.0]); */ Cartesian3.fromDegreesArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -2263,7 +2258,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArrayHeights([-2.007, 0.645, 100000.0, -1.867, .575, 150000.0]); */ Cartesian3.fromRadiansArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -3010,7 +3005,9 @@ define('Core/Ellipsoid',[ /** * Computes an Ellipsoid from a Cartesian specifying the radii in x, y, and z directions. * - * @param {Cartesian3} [radii=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Cartesian3} [cartesian=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new + * instance should be created. * @returns {Ellipsoid} A new Ellipsoid instance. * * @exception {DeveloperError} All radii components must be greater than or equal to zero. @@ -3650,6 +3647,7 @@ define('Core/Interval',[ /*global define*/ define('Core/Matrix3',[ './Cartesian3', + './Check', './defaultValue', './defined', './defineProperties', @@ -3658,6 +3656,7 @@ define('Core/Matrix3',[ './Math' ], function( Cartesian3, + Check, defaultValue, defined, defineProperties, @@ -3720,13 +3719,8 @@ define('Core/Matrix3',[ * @returns {Number[]} The array that was packed into */ Matrix3.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3752,9 +3746,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. */ Matrix3.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3781,24 +3773,24 @@ define('Core/Matrix3',[ * @param {Matrix3} [result] The object onto which to store the result. * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. (Returns undefined if matrix is undefined) */ - Matrix3.clone = function(values, result) { - if (!defined(values)) { + Matrix3.clone = function(matrix, result) { + if (!defined(matrix)) { return undefined; } if (!defined(result)) { - return new Matrix3(values[0], values[3], values[6], - values[1], values[4], values[7], - values[2], values[5], values[8]); + return new Matrix3(matrix[0], matrix[3], matrix[6], + matrix[1], matrix[4], matrix[7], + matrix[2], matrix[5], matrix[8]); } - result[0] = values[0]; - result[1] = values[1]; - result[2] = values[2]; - result[3] = values[3]; - result[4] = values[4]; - result[5] = values[5]; - result[6] = values[6]; - result[7] = values[7]; - result[8] = values[8]; + result[0] = matrix[0]; + result[1] = matrix[1]; + result[2] = matrix[2]; + result[3] = matrix[3]; + result[4] = matrix[4]; + result[5] = matrix[5]; + result[6] = matrix[6]; + result[7] = matrix[7]; + result[8] = matrix[8]; return result; }; @@ -3824,9 +3816,7 @@ define('Core/Matrix3',[ * var m2 = Cesium.Matrix3.fromArray(v2, 2); */ Matrix3.fromArray = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3854,9 +3844,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values parameter is required'); - } + Check.defined('values', values); return Matrix3.clone(values, result); }; @@ -3870,9 +3858,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix3(values[0], values[1], values[2], @@ -3899,9 +3885,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this quaternion. */ Matrix3.fromQuaternion = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); var x2 = quaternion.x * quaternion.x; var xy = quaternion.x * quaternion.y; @@ -3951,10 +3935,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this headingPitchRoll. */ Matrix3.fromHeadingPitchRoll = function(headingPitchRoll, result) { - if (!defined(headingPitchRoll)) { - throw new DeveloperError('headingPitchRoll is required'); - } - var cosTheta = Math.cos(-headingPitchRoll.pitch); + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + + var cosTheta = Math.cos(-headingPitchRoll.pitch); var cosPsi = Math.cos(-headingPitchRoll.heading); var cosPhi = Math.cos(headingPitchRoll.roll); var sinTheta = Math.sin(-headingPitchRoll.pitch); @@ -4005,9 +3988,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix3( @@ -4043,9 +4024,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromUniformScale(2.0); */ Matrix3.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix3( @@ -4069,7 +4048,7 @@ define('Core/Matrix3',[ /** * Computes a Matrix3 instance representing the cross product equivalent matrix of a Cartesian3 vector. * - * @param {Cartesian3} the vector on the left hand side of the cross product operation. + * @param {Cartesian3} vector the vector on the left hand side of the cross product operation. * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created. * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. * @@ -4081,9 +4060,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromCrossProduct(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromCrossProduct = function(vector, result) { - if (!defined(vector)) { - throw new DeveloperError('vector is required.'); - } + Check.typeOf.object('vector', vector); if (!defined(result)) { return new Matrix3( @@ -4118,9 +4095,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationX = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4159,9 +4134,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationY = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4200,9 +4173,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationZ = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4236,9 +4207,7 @@ define('Core/Matrix3',[ * @returns {Number[]} The modified Array parameter or a new Array instance if one was not provided. */ Matrix3.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5], matrix[6], matrix[7], matrix[8]]; @@ -4272,12 +4241,10 @@ define('Core/Matrix3',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix3.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 2) { - throw new DeveloperError('row must be 0, 1, or 2.'); - } - if (typeof column !== 'number' || column < 0 || column > 2) { - throw new DeveloperError('column must be 0, 1, or 2.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 2); + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 2); return column * 3 + row; }; @@ -4293,16 +4260,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var startIndex = index * 3; var x = matrix[startIndex]; @@ -4327,18 +4288,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); var startIndex = index * 3; @@ -4359,15 +4313,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 3]; @@ -4391,18 +4340,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); result[index] = cartesian.x; @@ -4421,12 +4363,8 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[3], matrix[4], matrix[5], scratchColumn)); @@ -4457,15 +4395,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var column0Row0 = left[0] * right[0] + left[3] * right[1] + left[6] * right[2]; var column0Row1 = left[1] * right[0] + left[4] * right[1] + left[7] * right[2]; @@ -4500,15 +4432,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -4531,15 +4457,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -4562,15 +4482,9 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -4595,15 +4509,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -4634,15 +4542,9 @@ define('Core/Matrix3',[ * @see Matrix3.multiplyByUniformScale */ Matrix3.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); result[0] = matrix[0] * scale.x; result[1] = matrix[1] * scale.x; @@ -4664,12 +4566,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -4691,12 +4589,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var column0Row0 = matrix[0]; var column0Row1 = matrix[3]; @@ -4836,9 +4730,7 @@ define('Core/Matrix3',[ * var c = Cesium.Cartesian3.multiplyByScalar(v, lambda, new Cesium.Cartesian3()); // equal to Cesium.Matrix3.multiplyByVector(a, v) */ Matrix3.computeEigenDecomposition = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); // This routine was created based upon Matrix Computations, 3rd ed., by Golub and Van Loan, // section 8.4.3 The Classical Jacobi Algorithm @@ -4882,12 +4774,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -4909,9 +4797,7 @@ define('Core/Matrix3',[ * @returns {Number} The value of the determinant of the matrix. */ Matrix3.determinant = function(matrix) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); var m11 = matrix[0]; var m21 = matrix[3]; @@ -4936,12 +4822,8 @@ define('Core/Matrix3',[ * @exception {DeveloperError} matrix is not invertible. */ Matrix3.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var m11 = matrix[0]; var m21 = matrix[1]; @@ -5007,9 +4889,7 @@ define('Core/Matrix3',[ * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. */ Matrix3.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -5197,12 +5077,14 @@ define('Core/Matrix3',[ /*global define*/ define('Core/Cartesian4',[ + './Check', './defaultValue', './defined', './DeveloperError', './freezeObject', './Math' ], function( + Check, defaultValue, defined, DeveloperError, @@ -5285,9 +5167,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.fromColor = function(color, result) { - if (!defined(color)) { - throw new DeveloperError('color is required'); - } + Check.typeOf.object('color', color); if (!defined(result)) { return new Cartesian4(color.red, color.green, color.blue, color.alpha); } @@ -5339,12 +5219,8 @@ define('Core/Cartesian4',[ * @returns {Number[]} The array that was packed into */ Cartesian4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5365,9 +5241,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5389,9 +5263,7 @@ define('Core/Cartesian4',[ * @returns {Number[]} The packed array. */ Cartesian4.packArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -5414,9 +5286,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4[]} The unpacked array. */ Cartesian4.unpackArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -5459,9 +5329,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the maximum component. */ Cartesian4.maximumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -5473,9 +5341,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the minimum component. */ Cartesian4.minimumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -5489,15 +5355,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the minimum components. */ Cartesian4.minimumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -5516,15 +5376,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the maximum components. */ Cartesian4.maximumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -5541,9 +5395,7 @@ define('Core/Cartesian4',[ * @returns {Number} The squared magnitude. */ Cartesian4.magnitudeSquared = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z + cartesian.w * cartesian.w; }; @@ -5574,9 +5426,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(2.0, 0.0, 0.0, 0.0)); */ Cartesian4.distance = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitude(distanceScratch); @@ -5597,9 +5448,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(3.0, 0.0, 0.0, 0.0)); */ Cartesian4.distanceSquared = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitudeSquared(distanceScratch); @@ -5613,12 +5463,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.normalize = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian4.magnitude(cartesian); @@ -5642,12 +5488,8 @@ define('Core/Cartesian4',[ * @returns {Number} The dot product. */ Cartesian4.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w; }; @@ -5661,15 +5503,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -5687,15 +5523,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x / right.x; result.y = left.y / right.y; @@ -5713,15 +5543,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -5739,15 +5563,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -5765,15 +5583,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -5791,15 +5603,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -5816,12 +5622,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.negate = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -5838,12 +5640,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.abs = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -5863,18 +5661,10 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian4.multiplyByScalar(end, t, lerpScratch); result = Cartesian4.multiplyByScalar(start, 1.0 - t, result); @@ -5890,12 +5680,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The most orthogonal axis. */ Cartesian4.mostOrthogonalAxis = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian4.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian4.abs(f, f); @@ -6140,6 +5926,7 @@ define('Core/RuntimeError',[ define('Core/Matrix4',[ './Cartesian3', './Cartesian4', + './Check', './defaultValue', './defined', './defineProperties', @@ -6151,6 +5938,7 @@ define('Core/Matrix4',[ ], function( Cartesian3, Cartesian4, + Check, defaultValue, defined, defineProperties, @@ -6241,13 +6029,8 @@ define('Core/Matrix4',[ * @returns {Number[]} The array that was packed into */ Matrix4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -6280,9 +6063,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if one was not provided. */ Matrix4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -6378,9 +6159,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required'); - } + Check.defined('values', values); return Matrix4.clone(values, result); }; @@ -6394,9 +6173,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix4(values[0], values[1], values[2], values[3], @@ -6433,9 +6210,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRotationTranslation = function(rotation, translation, result) { - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } + Check.typeOf.object('rotation', rotation); translation = defaultValue(translation, Cartesian3.ZERO); @@ -6483,15 +6258,9 @@ define('Core/Matrix4',[ * result); */ Matrix4.fromTranslationQuaternionRotationScale = function(translation, rotation, scale, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('translation', translation); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('scale', scale); if (!defined(result)) { result = new Matrix4(); @@ -6552,9 +6321,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromTranslationRotationScale = function(translationRotationScale, result) { - if (!defined(translationRotationScale)) { - throw new DeveloperError('translationRotationScale is required.'); - } + Check.typeOf.object('translationRotationScale', translationRotationScale); return Matrix4.fromTranslationQuaternionRotationScale(translationRotationScale.translation, translationRotationScale.rotation, translationRotationScale.scale, result); }; @@ -6569,9 +6336,7 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByTranslation */ Matrix4.fromTranslation = function(translation, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } + Check.typeOf.object('translation', translation); return Matrix4.fromRotationTranslation(Matrix3.IDENTITY, translation, result); }; @@ -6592,9 +6357,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix4.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix4( @@ -6639,9 +6402,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromUniformScale(2.0); */ Matrix4.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix4(scale, 0.0, 0.0, 0.0, @@ -6681,23 +6442,15 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromCamera = function(camera, result) { - if (!defined(camera)) { - throw new DeveloperError('camera is required.'); - } + Check.typeOf.object('camera', camera); var position = camera.position; var direction = camera.direction; var up = camera.up; - if (!defined(position)) { - throw new DeveloperError('camera.position is required.'); - } - if (!defined(direction)) { - throw new DeveloperError('camera.direction is required.'); - } - if (!defined(up)) { - throw new DeveloperError('camera.up is required.'); - } + Check.typeOf.object('camera.position', position); + Check.typeOf.object('camera.direction', direction); + Check.typeOf.object('camera.up', up); Cartesian3.normalize(direction, fromCameraF); Cartesian3.normalize(Cartesian3.cross(fromCameraF, up, fromCameraR), fromCameraR); @@ -6776,21 +6529,11 @@ define('Core/Matrix4',[ * @exception {DeveloperError} far must be greater than zero. */ Matrix4.computePerspectiveFieldOfView = function(fovY, aspectRatio, near, far, result) { - if (fovY <= 0.0 || fovY > Math.PI) { - throw new DeveloperError('fovY must be in (0, PI].'); - } - if (aspectRatio <= 0.0) { - throw new DeveloperError('aspectRatio must be greater than zero.'); - } - if (near <= 0.0) { - throw new DeveloperError('near must be greater than zero.'); - } - if (far <= 0.0) { - throw new DeveloperError('far must be greater than zero.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThan('fovY', fovY, 0.0); + Check.typeOf.number.lessThan('fovY', fovY, Math.PI); + Check.typeOf.number.greaterThan('near', near, 0.0); + Check.typeOf.number.greaterThan('far', far, 0.0); + Check.typeOf.object('result', result); var bottom = Math.tan(fovY * 0.5); @@ -6831,27 +6574,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeOrthographicOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var a = 1.0 / (right - left); var b = 1.0 / (top - bottom); @@ -6896,27 +6625,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computePerspectiveOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -6957,24 +6672,12 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeInfinitePerspectiveOffCenter = function(left, right, bottom, top, near, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -7022,9 +6725,7 @@ define('Core/Matrix4',[ * }, 0.0, 1.0, new Cesium.Matrix4()); */ Matrix4.computeViewportTransformation = function(viewport, nearDepthRange, farDepthRange, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); viewport = defaultValue(viewport, defaultValue.EMPTY_OBJECT); var x = defaultValue(viewport.x, 0.0); @@ -7076,21 +6777,11 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeView = function(position, direction, up, right, result) { - if (!defined(position)) { - throw new DeveloperError('position is required'); - } - if (!defined(direction)) { - throw new DeveloperError('direction is required'); - } - if (!defined(up)) { - throw new DeveloperError('up is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); + Check.typeOf.object('up', up); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = right.x; result[1] = up.x; @@ -7131,9 +6822,7 @@ define('Core/Matrix4',[ * //creates a = [10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0] */ Matrix4.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], @@ -7177,12 +6866,11 @@ define('Core/Matrix4',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix4.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 3) { - throw new DeveloperError('row must be 0, 1, 2, or 3.'); - } - if (typeof column !== 'number' || column < 0 || column > 3) { - throw new DeveloperError('column must be 0, 1, 2, or 3.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 3); + + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 3); return column * 4 + row; }; @@ -7215,16 +6903,12 @@ define('Core/Matrix4',[ * // a.x = 12.0; a.y = 16.0; a.z = 20.0; a.w = 24.0; */ Matrix4.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var startIndex = index * 4; var x = matrix[startIndex]; @@ -7266,18 +6950,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 96.0, 25.0] */ Matrix4.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); var startIndex = index * 4; @@ -7298,15 +6977,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.setTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -7359,16 +7032,12 @@ define('Core/Matrix4',[ * // a.x = 18.0; a.y = 19.0; a.z = 20.0; a.w = 21.0; */ Matrix4.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 4]; @@ -7409,18 +7078,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 24.0, 25.0] */ Matrix4.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); result[index] = cartesian.x; @@ -7440,12 +7104,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter */ Matrix4.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[4], matrix[5], matrix[6], scratchColumn)); @@ -7477,15 +7137,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -7569,15 +7223,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -7607,15 +7255,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -7656,15 +7298,9 @@ define('Core/Matrix4',[ * var m3 = Cesium.Matrix4.multiplyTransformation(m1, m2, new Cesium.Matrix4()); */ Matrix4.multiplyTransformation = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -7742,15 +7378,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByMatrix3(m, rotation, m); */ Matrix4.multiplyByMatrix3 = function(matrix, rotation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('result', result); var left0 = matrix[0]; var left1 = matrix[1]; @@ -7818,15 +7448,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByTranslation(m, position, m); */ Matrix4.multiplyByTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); var x = translation.x; var y = translation.y; @@ -7878,15 +7502,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByScale */ Matrix4.multiplyByUniformScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scale', scale); + Check.typeOf.object('result', result); uniformScaleScratch.x = scale; uniformScaleScratch.y = scale; @@ -7915,15 +7533,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByUniformScale */ Matrix4.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); var scaleX = scale.x; var scaleY = scale.y; @@ -7962,15 +7574,9 @@ define('Core/Matrix4',[ * @returns {Cartesian4} The modified result parameter. */ Matrix4.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8006,15 +7612,9 @@ define('Core/Matrix4',[ * // Cesium.Matrix4.multiplyByVector(matrix, new Cesium.Cartesian4(p.x, p.y, p.z, 0.0), result); */ Matrix4.multiplyByPointAsVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8044,16 +7644,9 @@ define('Core/Matrix4',[ * var result = Cesium.Matrix4.multiplyByPoint(matrix, p, new Cesium.Cartesian3()); */ Matrix4.multiplyByPoint = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8093,15 +7686,9 @@ define('Core/Matrix4',[ * // [-44.0, -46.0, -48.0, -50.0] */ Matrix4.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -8145,12 +7732,8 @@ define('Core/Matrix4',[ * // [-22.0, -23.0, -24.0, -25.0] */ Matrix4.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -8194,12 +7777,8 @@ define('Core/Matrix4',[ * // [13.0, 17.0, 21.0, 25.0] */ Matrix4.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var matrix1 = matrix[1]; var matrix2 = matrix[2]; @@ -8235,12 +7814,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -8354,9 +7929,7 @@ define('Core/Matrix4',[ * //Prints "Difference between both the matrices is not less than 0.1" on the console */ Matrix4.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -8386,13 +7959,9 @@ define('Core/Matrix4',[ * @param {Cartesian3} result The object onto which to store the result. * @returns {Cartesian3} The modified result parameter. */ - Matrix4.getTranslation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Matrix4.getTranslation = function(matrix, result) { + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = matrix[12]; result.y = matrix[13]; @@ -8423,12 +7992,8 @@ define('Core/Matrix4',[ * // [12.0, 16.0, 20.0] */ Matrix4.getRotation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -8460,12 +8025,8 @@ define('Core/Matrix4',[ * @exception {RuntimeError} matrix is not invertible because its determinate is zero. */ Matrix4.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); // Special case for a zero scale matrix that can occur, for example, // when a model's node has a [0, 0, 0] scale. @@ -8603,12 +8164,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.inverseTransformation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); //This function is an optimized version of the below 4 lines. //var rT = Matrix3.transpose(Matrix4.getRotation(matrix)); @@ -8892,6 +8449,7 @@ define('Core/Matrix4',[ /*global define*/ define('Core/Rectangle',[ './Cartographic', + './Check', './defaultValue', './defined', './defineProperties', @@ -8901,6 +8459,7 @@ define('Core/Rectangle',[ './Math' ], function( Cartographic, + Check, defaultValue, defined, defineProperties, @@ -8997,13 +8556,8 @@ define('Core/Rectangle',[ * @returns {Number[]} The array that was packed into */ Rectangle.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -9024,9 +8578,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -9047,9 +8599,7 @@ define('Core/Rectangle',[ * @returns {Number} The width. */ Rectangle.computeWidth = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; if (east < west) { @@ -9064,9 +8614,7 @@ define('Core/Rectangle',[ * @returns {Number} The height. */ Rectangle.computeHeight = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); return rectangle.north - rectangle.south; }; @@ -9101,6 +8649,32 @@ define('Core/Rectangle',[ return result; }; + /** + * Creates an rectangle given the boundary longitude and latitude in radians. + * + * @param {Number} [west=0.0] The westernmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [south=0.0] The southernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Number} [east=0.0] The easternmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [north=0.0] The northernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Rectangle} [result] The object onto which to store the result, or undefined if a new instance should be created. + * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. + * + * @example + * var rectangle = Cesium.Rectangle.fromRadians(0.0, Math.PI/4, Math.PI/8, 3*Math.PI/4); + */ + Rectangle.fromRadians = function(west, south, east, north, result) { + if (!defined(result)) { + return new Rectangle(west, south, east, north); + } + + result.west = defaultValue(west, 0.0); + result.south = defaultValue(south, 0.0); + result.east = defaultValue(east, 0.0); + result.north = defaultValue(north, 0.0); + + return result; + }; + /** * Creates the smallest possible Rectangle that encloses all positions in the provided array. * @@ -9109,9 +8683,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartographicArray = function(cartographics, result) { - if (!defined(cartographics)) { - throw new DeveloperError('cartographics is required.'); - } + Check.defined('cartographics', cartographics); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -9164,9 +8736,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartesianArray = function(cartesians, ellipsoid, result) { - if (!defined(cartesians)) { - throw new DeveloperError('cartesians is required.'); - } + Check.defined('cartesians', cartesians); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -9282,9 +8852,7 @@ define('Core/Rectangle',[ * @returns {Boolean} <code>true</code> if the Rectangles are within the provided epsilon, <code>false</code> otherwise. */ Rectangle.prototype.equalsEpsilon = function(other, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon is required and must be a number.'); - } + Check.typeOf.number('epsilon', epsilon); return defined(other) && (Math.abs(this.west - other.west) <= epsilon) && @@ -9304,45 +8872,23 @@ define('Core/Rectangle',[ * @exception {DeveloperError} <code>west</code> must be in the interval [<code>-Pi</code>, <code>Pi</code>]. */ Rectangle.validate = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var north = rectangle.north; - if (typeof north !== 'number') { - throw new DeveloperError('north is required to be a number.'); - } - - if (north < -CesiumMath.PI_OVER_TWO || north > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('north must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('north', north, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('north', north, CesiumMath.PI_OVER_TWO); var south = rectangle.south; - if (typeof south !== 'number') { - throw new DeveloperError('south is required to be a number.'); - } - - if (south < -CesiumMath.PI_OVER_TWO || south > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('south must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('south', south, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('south', south, CesiumMath.PI_OVER_TWO); var west = rectangle.west; - if (typeof west !== 'number') { - throw new DeveloperError('west is required to be a number.'); - } - - if (west < -Math.PI || west > Math.PI) { - throw new DeveloperError('west must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('west', west, -Math.PI); + Check.typeOf.number.lessThanOrEquals('west', west, Math.PI); var east = rectangle.east; - if (typeof east !== 'number') { - throw new DeveloperError('east is required to be a number.'); - } - - if (east < -Math.PI || east > Math.PI) { - throw new DeveloperError('east must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('east', east, -Math.PI); + Check.typeOf.number.lessThanOrEquals('east', east, Math.PI); }; /** @@ -9353,9 +8899,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.south); @@ -9374,9 +8918,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.north); @@ -9395,9 +8937,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.north); @@ -9416,9 +8956,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.south); @@ -9437,9 +8975,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.center = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; @@ -9474,12 +9010,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.intersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var rectangleEast = rectangle.east; var rectangleWest = rectangle.west; @@ -9535,12 +9067,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.simpleIntersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var west = Math.max(rectangle.west, otherRectangle.west); var south = Math.max(rectangle.south, otherRectangle.south); @@ -9571,12 +9099,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.union = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); if (!defined(result)) { result = new Rectangle(); @@ -9620,12 +9144,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.expand = function(rectangle, cartographic, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); if (!defined(result)) { result = new Rectangle(); @@ -9647,12 +9167,8 @@ define('Core/Rectangle',[ * @returns {Boolean} true if the provided cartographic is inside the rectangle, false otherwise. */ Rectangle.contains = function(rectangle, cartographic) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); var longitude = cartographic.longitude; var latitude = cartographic.latitude; @@ -9685,9 +9201,7 @@ define('Core/Rectangle',[ * @returns {Cartesian3[]} The modified result parameter or a new Array of Cartesians instances if none was provided. */ Rectangle.subsample = function(rectangle, ellipsoid, surfaceHeight, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84); surfaceHeight = defaultValue(surfaceHeight, 0.0); @@ -9765,9 +9279,9 @@ define('Core/Rectangle',[ define('Core/BoundingSphere',[ './Cartesian3', './Cartographic', + './Check', './defaultValue', './defined', - './DeveloperError', './Ellipsoid', './GeographicProjection', './Intersect', @@ -9778,9 +9292,9 @@ define('Core/BoundingSphere',[ ], function( Cartesian3, Cartographic, + Check, defaultValue, defined, - DeveloperError, Ellipsoid, GeographicProjection, Intersect, @@ -10110,9 +9624,7 @@ define('Core/BoundingSphere',[ stride = defaultValue(stride, 3); - if (stride < 3) { - throw new DeveloperError('stride must be 3 or greater.'); - } + Check.typeOf.number.greaterThanOrEquals('stride', stride, 3); var currentPos = fromPointsCurrentPos; currentPos.x = positions[0] + center.x; @@ -10416,9 +9928,8 @@ define('Core/BoundingSphere',[ * var sphere = Cesium.BoundingSphere.fromCornerPoints(new Cesium.Cartesian3(-0.5, -0.5, -0.5), new Cesium.Cartesian3(0.5, 0.5, 0.5)); */ BoundingSphere.fromCornerPoints = function(corner, oppositeCorner, result) { - if (!defined(corner) || !defined(oppositeCorner)) { - throw new DeveloperError('corner and oppositeCorner are required.'); - } + Check.typeOf.object('corner', corner); + Check.typeOf.object('oppositeCorner', oppositeCorner); if (!defined(result)) { result = new BoundingSphere(); @@ -10442,9 +9953,7 @@ define('Core/BoundingSphere',[ * var boundingSphere = Cesium.BoundingSphere.fromEllipsoid(ellipsoid); */ BoundingSphere.fromEllipsoid = function(ellipsoid, result) { - if (!defined(ellipsoid)) { - throw new DeveloperError('ellipsoid is required.'); - } + Check.typeOf.object('ellipsoid', ellipsoid); if (!defined(result)) { result = new BoundingSphere(); @@ -10570,13 +10079,8 @@ define('Core/BoundingSphere',[ * @returns {Number[]} The array that was packed into */ BoundingSphere.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -10598,9 +10102,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if one was not provided. */ BoundingSphere.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -10627,13 +10129,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.union = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); if (!defined(result)) { result = new BoundingSphere(); @@ -10682,13 +10179,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.expand = function(sphere, point, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(point)) { - throw new DeveloperError('point is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('point', point); result = BoundingSphere.clone(sphere, result); @@ -10711,13 +10203,8 @@ define('Core/BoundingSphere',[ * intersects the plane. */ BoundingSphere.intersectPlane = function(sphere, plane) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(plane)) { - throw new DeveloperError('plane is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('plane', plane); var center = sphere.center; var radius = sphere.radius; @@ -10743,13 +10230,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.transform = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -10777,12 +10259,8 @@ define('Core/BoundingSphere',[ * }); */ BoundingSphere.distanceSquaredTo = function(sphere, cartesian) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('cartesian', cartesian); var diff = Cartesian3.subtract(sphere.center, cartesian, distanceSquaredToScratch); return Cartesian3.magnitudeSquared(diff) - sphere.radius * sphere.radius; @@ -10804,13 +10282,8 @@ define('Core/BoundingSphere',[ * var newBoundingSphere = Cesium.BoundingSphere.transformWithoutScale(boundingSphere, modelMatrix); */ BoundingSphere.transformWithoutScale = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -10837,17 +10310,9 @@ define('Core/BoundingSphere',[ * @returns {Interval} The nearest and farthest distances on the bounding sphere from position in direction. */ BoundingSphere.computePlaneDistances = function(sphere, position, direction, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(position)) { - throw new DeveloperError('position is required.'); - } - - if (!defined(direction)) { - throw new DeveloperError('direction is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); if (!defined(result)) { result = new Interval(); @@ -10882,9 +10347,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.projectTo2D = function(sphere, projection, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } + Check.typeOf.object('sphere', sphere); projection = defaultValue(projection, projectTo2DProjection); @@ -10979,12 +10442,8 @@ define('Core/BoundingSphere',[ * @returns {Boolean} <code>true</code> if the sphere is not visible; otherwise <code>false</code>. */ BoundingSphere.isOccluded = function(sphere, occluder) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(occluder)) { - throw new DeveloperError('occluder is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('occluder', occluder); return !occluder.isBoundingSphereVisible(sphere); }; @@ -11085,12 +10544,14 @@ define('Core/BoundingSphere',[ /*global define*/ define('Core/Cartesian2',[ + './Check', './defaultValue', './defined', './DeveloperError', './freezeObject', './Math' ], function( + Check, defaultValue, defined, DeveloperError, @@ -11202,12 +10663,8 @@ define('Core/Cartesian2',[ * @returns {Number[]} The array that was packed into */ Cartesian2.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -11226,9 +10683,7 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided. */ Cartesian2.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -11248,9 +10703,7 @@ define('Core/Cartesian2',[ * @returns {Number[]} The packed array. */ Cartesian2.packArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -11273,9 +10726,7 @@ define('Core/Cartesian2',[ * @returns {Cartesian2[]} The unpacked array. */ Cartesian2.unpackArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -11318,9 +10769,7 @@ define('Core/Cartesian2',[ * @returns {Number} The value of the maximum component. */ Cartesian2.maximumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y); }; @@ -11332,9 +10781,7 @@ define('Core/Cartesian2',[ * @returns {Number} The value of the minimum component. */ Cartesian2.minimumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y); }; @@ -11348,15 +10795,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} A cartesian with the minimum components. */ Cartesian2.minimumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); @@ -11374,15 +10815,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} A cartesian with the maximum components. */ Cartesian2.maximumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -11396,9 +10831,7 @@ define('Core/Cartesian2',[ * @returns {Number} The squared magnitude. */ Cartesian2.magnitudeSquared = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y; }; @@ -11464,12 +10897,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.normalize = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian2.magnitude(cartesian); @@ -11491,12 +10920,8 @@ define('Core/Cartesian2',[ * @returns {Number} The dot product. */ Cartesian2.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y; }; @@ -11510,15 +10935,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.multiplyComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -11534,15 +10953,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.divideComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x / right.x; result.y = left.y / right.y; @@ -11558,15 +10971,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -11582,15 +10989,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -11606,15 +11007,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.multiplyByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -11630,15 +11025,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.divideByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -11653,12 +11042,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.negate = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -11673,12 +11058,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.abs = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -11696,18 +11077,10 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian2.multiplyByScalar(end, t, lerpScratch); result = Cartesian2.multiplyByScalar(start, 1.0 - t, result); @@ -11724,12 +11097,8 @@ define('Core/Cartesian2',[ * @returns {Number} The angle between the Cartesians. */ Cartesian2.angleBetween = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian2.normalize(left, angleBetweenScratch); Cartesian2.normalize(right, angleBetweenScratch2); @@ -11745,12 +11114,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The most orthogonal axis. */ Cartesian2.mostOrthogonalAxis = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian2.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian2.abs(f, f); @@ -12988,7 +12353,10 @@ define('Core/WebGLConstants',[ COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : 0x9279, TEXTURE_IMMUTABLE_FORMAT : 0x912F, MAX_ELEMENT_INDEX : 0x8D6B, - TEXTURE_IMMUTABLE_LEVELS : 0x82DF + TEXTURE_IMMUTABLE_LEVELS : 0x82DF, + + // Extensions + MAX_TEXTURE_MAX_ANISOTROPY_EXT : 0x84FF }; return freezeObject(WebGLConstants); @@ -13518,7 +12886,7 @@ define('Core/Geometry',[ * <li><code>position</code> - 3D vertex position. 64-bit floating-point (for precision). 3 components per attribute. See {@link VertexFormat#position}.</li> * <li><code>normal</code> - Normal (normalized), commonly used for lighting. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#normal}.</li> * <li><code>st</code> - 2D texture coordinate. 32-bit floating-point. 2 components per attribute. See {@link VertexFormat#st}.</li> - * <li><code>binormal</code> - Binormal (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#binormal}.</li> + * <li><code>bitangent</code> - Bitangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#bitangent}.</li> * <li><code>tangent</code> - Tangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#tangent}.</li> * </ul> * </p> @@ -13547,7 +12915,7 @@ define('Core/Geometry',[ * componentsPerAttribute : 3, * values : new Float32Array(0) * }); - * + * * @see GeometryAttribute * @see VertexFormat */ @@ -13828,7 +13196,7 @@ define('Core/GeometryAttributes',[ this.st = options.st; /** - * The binormal attribute (normalized), which is used for tangent-space effects like bump mapping. + * The bitangent attribute (normalized), which is used for tangent-space effects like bump mapping. * <p> * 32-bit floating-point. 3 components per attribute. * </p> @@ -13837,7 +13205,7 @@ define('Core/GeometryAttributes',[ * * @default undefined */ - this.binormal = options.binormal; + this.bitangent = options.bitangent; /** * The tangent attribute (normalized), which is used for tangent-space effects like bump mapping. @@ -14086,7 +13454,7 @@ define('Core/VertexFormat',[ this.st = defaultValue(options.st, false); /** - * When <code>true</code>, the vertex has a binormal attribute (normalized), which is used for tangent-space effects like bump mapping. + * When <code>true</code>, the vertex has a bitangent attribute (normalized), which is used for tangent-space effects like bump mapping. * <p> * 32-bit floating-point. 3 components per attribute. * </p> @@ -14095,7 +13463,7 @@ define('Core/VertexFormat',[ * * @default false */ - this.binormal = defaultValue(options.binormal, false); + this.bitangent = defaultValue(options.bitangent, false); /** * When <code>true</code>, the vertex has a tangent attribute (normalized), which is used for tangent-space effects like bump mapping. @@ -14197,7 +13565,7 @@ define('Core/VertexFormat',[ })); /** - * An immutable vertex format with well-known attributes: position, normal, st, binormal, and tangent. + * An immutable vertex format with well-known attributes: position, normal, st, tangent, and bitangent. * * @type {VertexFormat} * @constant @@ -14205,15 +13573,15 @@ define('Core/VertexFormat',[ * @see VertexFormat#position * @see VertexFormat#normal * @see VertexFormat#st - * @see VertexFormat#binormal * @see VertexFormat#tangent + * @see VertexFormat#bitangent */ VertexFormat.ALL = freezeObject(new VertexFormat({ position : true, normal : true, st : true, - binormal : true, - tangent : true + tangent : true, + bitangent : true })); /** @@ -14258,8 +13626,8 @@ define('Core/VertexFormat',[ array[startingIndex++] = value.position ? 1.0 : 0.0; array[startingIndex++] = value.normal ? 1.0 : 0.0; array[startingIndex++] = value.st ? 1.0 : 0.0; - array[startingIndex++] = value.binormal ? 1.0 : 0.0; array[startingIndex++] = value.tangent ? 1.0 : 0.0; + array[startingIndex++] = value.bitangent ? 1.0 : 0.0; array[startingIndex++] = value.color ? 1.0 : 0.0; return array; @@ -14284,19 +13652,19 @@ define('Core/VertexFormat',[ result = new VertexFormat(); } - result.position = array[startingIndex++] === 1.0; - result.normal = array[startingIndex++] === 1.0; - result.st = array[startingIndex++] === 1.0; - result.binormal = array[startingIndex++] === 1.0; - result.tangent = array[startingIndex++] === 1.0; - result.color = array[startingIndex++] === 1.0; + result.position = array[startingIndex++] === 1.0; + result.normal = array[startingIndex++] === 1.0; + result.st = array[startingIndex++] === 1.0; + result.tangent = array[startingIndex++] === 1.0; + result.bitangent = array[startingIndex++] === 1.0; + result.color = array[startingIndex++] === 1.0; return result; }; /** * Duplicates a VertexFormat instance. * - * @param {VertexFormat} cartesian The vertex format to duplicate. + * @param {VertexFormat} vertexFormat The vertex format to duplicate. * @param {VertexFormat} [result] The object onto which to store the result. * @returns {VertexFormat} The modified result parameter or a new VertexFormat instance if one was not provided. (Returns undefined if vertexFormat is undefined) */ @@ -14311,8 +13679,8 @@ define('Core/VertexFormat',[ result.position = vertexFormat.position; result.normal = vertexFormat.normal; result.st = vertexFormat.st; - result.binormal = vertexFormat.binormal; result.tangent = vertexFormat.tangent; + result.bitangent = vertexFormat.bitangent; result.color = vertexFormat.color; return result; }; @@ -14358,7 +13726,7 @@ define('Core/EllipsoidGeometry',[ var scratchPosition = new Cartesian3(); var scratchNormal = new Cartesian3(); var scratchTangent = new Cartesian3(); - var scratchBinormal = new Cartesian3(); + var scratchBitangent = new Cartesian3(); var scratchNormalST = new Cartesian3(); var defaultRadii = new Cartesian3(1.0, 1.0, 1.0); @@ -14525,7 +13893,7 @@ define('Core/EllipsoidGeometry',[ var normals = (vertexFormat.normal) ? new Float32Array(vertexCount * 3) : undefined; var tangents = (vertexFormat.tangent) ? new Float32Array(vertexCount * 3) : undefined; - var binormals = (vertexFormat.binormal) ? new Float32Array(vertexCount * 3) : undefined; + var bitangents = (vertexFormat.bitangent) ? new Float32Array(vertexCount * 3) : undefined; var st = (vertexFormat.st) ? new Float32Array(vertexCount * 2) : undefined; var cosTheta = new Array(slicePartitions); @@ -14583,9 +13951,9 @@ define('Core/EllipsoidGeometry',[ var stIndex = 0; var normalIndex = 0; var tangentIndex = 0; - var binormalIndex = 0; + var bitangentIndex = 0; - if (vertexFormat.st || vertexFormat.normal || vertexFormat.tangent || vertexFormat.binormal) { + if (vertexFormat.st || vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent) { for( i = 0; i < vertexCount; i++) { var position = Cartesian3.fromArray(positions, i * 3, scratchPosition); var normal = ellipsoid.geodeticSurfaceNormal(position, scratchNormal); @@ -14615,7 +13983,7 @@ define('Core/EllipsoidGeometry',[ normals[normalIndex++] = normal.z; } - if (vertexFormat.tangent || vertexFormat.binormal) { + if (vertexFormat.tangent || vertexFormat.bitangent) { var tangent = scratchTangent; if (i < slicePartitions || i > vertexCount - slicePartitions - 1) { Cartesian3.cross(Cartesian3.UNIT_X, normal, tangent); @@ -14631,13 +13999,13 @@ define('Core/EllipsoidGeometry',[ tangents[tangentIndex++] = tangent.z; } - if (vertexFormat.binormal) { - var binormal = Cartesian3.cross(normal, tangent, scratchBinormal); - Cartesian3.normalize(binormal, binormal); + if (vertexFormat.bitangent) { + var bitangent = Cartesian3.cross(normal, tangent, scratchBitangent); + Cartesian3.normalize(bitangent, bitangent); - binormals[binormalIndex++] = binormal.x; - binormals[binormalIndex++] = binormal.y; - binormals[binormalIndex++] = binormal.z; + bitangents[bitangentIndex++] = bitangent.x; + bitangents[bitangentIndex++] = bitangent.y; + bitangents[bitangentIndex++] = bitangent.z; } } } @@ -14666,11 +14034,11 @@ define('Core/EllipsoidGeometry',[ }); } - if (vertexFormat.binormal) { - attributes.binormal = new GeometryAttribute({ + if (vertexFormat.bitangent) { + attributes.bitangent = new GeometryAttribute({ componentDatatype : ComponentDatatype.FLOAT, componentsPerAttribute : 3, - values : binormals + values : bitangents }); } } diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createEllipsoidOutlineGeometry.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createEllipsoidOutlineGeometry.js index 68a8824a..3c395faf 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createEllipsoidOutlineGeometry.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createEllipsoidOutlineGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,68 +45,6 @@ define('Core/defined',[],function() { return defined; }); -/*global define*/ -define('Core/freezeObject',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Freezes an object, using Object.freeze if available, otherwise returns - * the object unchanged. This function should be used in setup code to prevent - * errors from completely halting JavaScript execution in legacy browsers. - * - * @private - * - * @exports freezeObject - */ - var freezeObject = Object.freeze; - if (!defined(freezeObject)) { - freezeObject = function(o) { - return o; - }; - } - - return freezeObject; -}); - -/*global define*/ -define('Core/defaultValue',[ - './freezeObject' - ], function( - freezeObject) { - 'use strict'; - - /** - * Returns the first parameter if not undefined, otherwise the second parameter. - * Useful for setting a default value for a parameter. - * - * @exports defaultValue - * - * @param {*} a - * @param {*} b - * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter. - * - * @example - * param = Cesium.defaultValue(param, 'default'); - */ - function defaultValue(a, b) { - if (a !== undefined) { - return a; - } - return b; - } - - /** - * A frozen empty object that can be used as the default value for options passed as - * an object literal. - */ - defaultValue.EMPTY_OBJECT = freezeObject({}); - - return defaultValue; -}); - /*global define*/ define('Core/DeveloperError',[ './defined' @@ -188,41 +126,13 @@ define('Core/DeveloperError',[ return DeveloperError; }); -/*global define*/ -define('Core/isArray',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Tests an object to see if it is an array. - * @exports isArray - * - * @param {Object} value The value to test. - * @returns {Boolean} true if the value is an array, false otherwise. - */ - var isArray = Array.isArray; - if (!defined(isArray)) { - isArray = function(value) { - return Object.prototype.toString.call(value) === '[object Array]'; - }; - } - - return isArray; -}); - /*global define*/ define('Core/Check',[ - './defaultValue', - './defined', - './DeveloperError', - './isArray' + './defined', + './DeveloperError' ], function( - defaultValue, defined, - DeveloperError, - isArray) { + DeveloperError) { 'use strict'; /** @@ -237,111 +147,134 @@ define('Core/Check',[ */ Check.typeOf = {}; - /** - * Contains functions for checking numeric conditions such as minimum and maximum values - */ - Check.numeric = {}; - function getUndefinedErrorMessage(name) { - return name + ' was required but undefined.'; + return name + ' is required, actual value was undefined'; } function getFailedTypeErrorMessage(actual, expected, name) { - return 'Expected ' + name + ' to be typeof ' + expected + ', got ' + actual; + return 'Expected ' + name + ' to be typeof ' + expected + ', actual typeof was ' + actual; } /** * Throws if test is not defined * - * @param {*} test The value that is to be checked * @param {String} name The name of the variable being tested + * @param {*} test The value that is to be checked * @exception {DeveloperError} test must be defined */ - Check.defined = function (test, name) { + Check.defined = function (name, test) { if (!defined(test)) { throw new DeveloperError(getUndefinedErrorMessage(name)); } }; /** - * Throws if test is greater than maximum + * Throws if test is not typeof 'function' * - * @param {Number} test The value to test - * @param {Number} maximum The maximum allowed value - * @exception {DeveloperError} test must not be greater than maximum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'function' */ - Check.numeric.maximum = function (test, maximum) { - Check.typeOf.number(test); - Check.typeOf.number(maximum); - if (test > maximum) { - throw new DeveloperError('Expected ' + test + ' to be at most ' + maximum); + Check.typeOf.func = function (name, test) { + if (typeof test !== 'function') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); } }; /** - * Throws if test is less than minimum + * Throws if test is not typeof 'string' * - * @param {Number} test The value to test - * @param {Number} minimum The minimum allowed value - * @exception {DeveloperError} test must not be less than mininum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'string' */ - Check.numeric.minimum = function (test, minimum) { - Check.typeOf.number(test); - Check.typeOf.number(minimum); - if (test < minimum) { - throw new DeveloperError('Expected ' + test + ' to be at least ' + minimum); + Check.typeOf.string = function (name, test) { + if (typeof test !== 'string') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); } }; /** - * Throws if test is not typeof 'function' + * Throws if test is not typeof 'number' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'function' + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'number' */ - Check.typeOf.function = function (test, name) { - if (typeof test !== 'function') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); + Check.typeOf.number = function (name, test) { + if (typeof test !== 'number') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); } }; /** - * Throws if test is not typeof 'string' + * Throws if test is not typeof 'number' and less than limit * + * @param {String} name The name of the variable being tested * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than limit + */ + Check.typeOf.number.lessThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test >= limit) { + throw new DeveloperError('Expected ' + name + ' to be less than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and less than or equal to limit + * * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'string' + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than or equal to limit */ - Check.typeOf.string = function (test, name) { - if (typeof test !== 'string') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); + Check.typeOf.number.lessThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test > limit) { + throw new DeveloperError('Expected ' + name + ' to be less than or equal to ' + limit + ', actual value was ' + test); } }; /** - * Throws if test is not typeof 'number' + * Throws if test is not typeof 'number' and greater than limit * + * @param {String} name The name of the variable being tested * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than limit + */ + Check.typeOf.number.greaterThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test <= limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and greater than or equal to limit + * * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'number' + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than or equal to limit */ - Check.typeOf.number = function (test, name) { - if (typeof test !== 'number') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); + Check.typeOf.number.greaterThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test < limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than or equal to' + limit + ', actual value was ' + test); } }; /** * Throws if test is not typeof 'object' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested + * @param {*} test The value to test * @exception {DeveloperError} test must be typeof 'object' */ - Check.typeOf.object = function (test, name) { + Check.typeOf.object = function (name, test) { if (typeof test !== 'object') { throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'object', name)); } @@ -350,11 +283,11 @@ define('Core/Check',[ /** * Throws if test is not typeof 'boolean' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested + * @param {*} test The value to test * @exception {DeveloperError} test must be typeof 'boolean' */ - Check.typeOf.boolean = function (test, name) { + Check.typeOf.bool = function (name, test) { if (typeof test !== 'boolean') { throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'boolean', name)); } @@ -363,6 +296,68 @@ define('Core/Check',[ return Check; }); +/*global define*/ +define('Core/freezeObject',[ + './defined' + ], function( + defined) { + 'use strict'; + + /** + * Freezes an object, using Object.freeze if available, otherwise returns + * the object unchanged. This function should be used in setup code to prevent + * errors from completely halting JavaScript execution in legacy browsers. + * + * @private + * + * @exports freezeObject + */ + var freezeObject = Object.freeze; + if (!defined(freezeObject)) { + freezeObject = function(o) { + return o; + }; + } + + return freezeObject; +}); + +/*global define*/ +define('Core/defaultValue',[ + './freezeObject' + ], function( + freezeObject) { + 'use strict'; + + /** + * Returns the first parameter if not undefined, otherwise the second parameter. + * Useful for setting a default value for a parameter. + * + * @exports defaultValue + * + * @param {*} a + * @param {*} b + * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter. + * + * @example + * param = Cesium.defaultValue(param, 'default'); + */ + function defaultValue(a, b) { + if (a !== undefined) { + return a; + } + return b; + } + + /** + * A frozen empty object that can be used as the default value for options passed as + * an object literal. + */ + defaultValue.EMPTY_OBJECT = freezeObject({}); + + return defaultValue; +}); + /* I've wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace so it's better encapsulated. Now you can have multiple random number generators @@ -1047,7 +1042,7 @@ define('Core/Math',[ if (!defined(angle)) { throw new DeveloperError('angle is required.'); } - + return CesiumMath.clamp(angle, -1*CesiumMath.PI_OVER_TWO, CesiumMath.PI_OVER_TWO); }; @@ -1057,11 +1052,11 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [<code>-CesiumMath.PI</code>, <code>CesiumMath.PI</code>]. */ - CesiumMath.negativePiToPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.negativePiToPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - return CesiumMath.zeroToTwoPi(x + CesiumMath.PI) - CesiumMath.PI; + return CesiumMath.zeroToTwoPi(angle + CesiumMath.PI) - CesiumMath.PI; }; /** @@ -1070,12 +1065,12 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [0, <code>CesiumMath.TWO_PI</code>]. */ - CesiumMath.zeroToTwoPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.zeroToTwoPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - var mod = CesiumMath.mod(x, CesiumMath.TWO_PI); - if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(x) > CesiumMath.EPSILON14) { + var mod = CesiumMath.mod(angle, CesiumMath.TWO_PI); + if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(angle) > CesiumMath.EPSILON14) { return CesiumMath.TWO_PI; } return mod; @@ -1145,7 +1140,7 @@ define('Core/Math',[ * @example * //Compute 7!, which is equal to 5040 * var computedFactorial = Cesium.Math.factorial(7); - * + * * @see {@link http://en.wikipedia.org/wiki/Factorial|Factorial on Wikipedia} */ CesiumMath.factorial = function(n) { @@ -1429,7 +1424,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.fromSpherical = function(spherical, result) { - Check.typeOf.object(spherical, 'spherical'); + Check.typeOf.object('spherical', spherical); if (!defined(result)) { result = new Cartesian3(); @@ -1513,8 +1508,8 @@ define('Core/Cartesian3',[ * @returns {Number[]} The array that was packed into */ Cartesian3.pack = function(value, array, startingIndex) { - Check.typeOf.object(value, 'value'); - Check.defined(array, 'array'); + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1534,7 +1529,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.unpack = function(array, startingIndex, result) { - Check.defined(array, 'array'); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1555,7 +1550,7 @@ define('Core/Cartesian3',[ * @returns {Number[]} The packed array. */ Cartesian3.packArray = function(array, result) { - Check.defined(array, 'array'); + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -1578,8 +1573,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3[]} The unpacked array. */ Cartesian3.unpackArray = function(array, result) { - Check.defined(array, 'array'); - Check.numeric.minimum(array.length, 3); + Check.defined('array', array); + Check.typeOf.number.greaterThanOrEquals('array.length', array.length, 3); if (array.length % 3 !== 0) { throw new DeveloperError('array length must be a multiple of 3.'); } @@ -1625,7 +1620,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the maximum component. */ Cartesian3.maximumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z); }; @@ -1637,7 +1632,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the minimum component. */ Cartesian3.minimumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z); }; @@ -1651,9 +1646,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the minimum components. */ Cartesian3.minimumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -1671,9 +1666,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the maximum components. */ Cartesian3.maximumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -1688,7 +1683,7 @@ define('Core/Cartesian3',[ * @returns {Number} The squared magnitude. */ Cartesian3.magnitudeSquared = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z; }; @@ -1717,8 +1712,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distance(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(2.0, 0.0, 0.0)); */ Cartesian3.distance = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitude(distanceScratch); @@ -1737,8 +1732,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distanceSquared(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(3.0, 0.0, 0.0)); */ Cartesian3.distanceSquared = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitudeSquared(distanceScratch); @@ -1752,8 +1747,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.normalize = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian3.magnitude(cartesian); @@ -1776,8 +1771,8 @@ define('Core/Cartesian3',[ * @returns {Number} The dot product. */ Cartesian3.dot = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z; }; @@ -1791,9 +1786,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyComponents = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -1835,9 +1830,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.add = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -1854,9 +1849,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.subtract = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -1873,9 +1868,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -1892,9 +1887,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.divideByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -1910,8 +1905,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.negate = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -1927,8 +1922,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.abs = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -1947,10 +1942,10 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.lerp = function(start, end, t, result) { - Check.typeOf.object(start, 'start'); - Check.typeOf.object(end, 'end'); - Check.typeOf.number(t, 't'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian3.multiplyByScalar(end, t, lerpScratch); result = Cartesian3.multiplyByScalar(start, 1.0 - t, result); @@ -1967,8 +1962,8 @@ define('Core/Cartesian3',[ * @returns {Number} The angle between the Cartesians. */ Cartesian3.angleBetween = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.normalize(left, angleBetweenScratch); Cartesian3.normalize(right, angleBetweenScratch2); @@ -1986,8 +1981,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The most orthogonal axis. */ Cartesian3.mostOrthogonalAxis = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian3.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian3.abs(f, f); @@ -2064,9 +2059,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The cross product. */ Cartesian3.cross = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var leftX = left.x; var leftY = left.y; @@ -2099,8 +2094,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromDegrees(-115.0, 37.0); */ Cartesian3.fromDegrees = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); longitude = CesiumMath.toRadians(longitude); latitude = CesiumMath.toRadians(latitude); @@ -2125,8 +2120,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromRadians(-2.007, 0.645); */ Cartesian3.fromRadians = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); height = defaultValue(height, 0.0); var radiiSquared = defined(ellipsoid) ? ellipsoid.radiiSquared : wgs84RadiiSquared; @@ -2160,7 +2155,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArray([-115.0, 37.0, -107.0, 33.0]); */ Cartesian3.fromDegreesArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -2194,7 +2189,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArray([-2.007, 0.645, -1.867, .575]); */ Cartesian3.fromRadiansArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -2228,7 +2223,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArrayHeights([-115.0, 37.0, 100000.0, -107.0, 33.0, 150000.0]); */ Cartesian3.fromDegreesArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -2263,7 +2258,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArrayHeights([-2.007, 0.645, 100000.0, -1.867, .575, 150000.0]); */ Cartesian3.fromRadiansArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -3010,7 +3005,9 @@ define('Core/Ellipsoid',[ /** * Computes an Ellipsoid from a Cartesian specifying the radii in x, y, and z directions. * - * @param {Cartesian3} [radii=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Cartesian3} [cartesian=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new + * instance should be created. * @returns {Ellipsoid} A new Ellipsoid instance. * * @exception {DeveloperError} All radii components must be greater than or equal to zero. @@ -3650,6 +3647,7 @@ define('Core/Interval',[ /*global define*/ define('Core/Matrix3',[ './Cartesian3', + './Check', './defaultValue', './defined', './defineProperties', @@ -3658,6 +3656,7 @@ define('Core/Matrix3',[ './Math' ], function( Cartesian3, + Check, defaultValue, defined, defineProperties, @@ -3720,13 +3719,8 @@ define('Core/Matrix3',[ * @returns {Number[]} The array that was packed into */ Matrix3.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3752,9 +3746,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. */ Matrix3.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3781,24 +3773,24 @@ define('Core/Matrix3',[ * @param {Matrix3} [result] The object onto which to store the result. * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. (Returns undefined if matrix is undefined) */ - Matrix3.clone = function(values, result) { - if (!defined(values)) { + Matrix3.clone = function(matrix, result) { + if (!defined(matrix)) { return undefined; } if (!defined(result)) { - return new Matrix3(values[0], values[3], values[6], - values[1], values[4], values[7], - values[2], values[5], values[8]); + return new Matrix3(matrix[0], matrix[3], matrix[6], + matrix[1], matrix[4], matrix[7], + matrix[2], matrix[5], matrix[8]); } - result[0] = values[0]; - result[1] = values[1]; - result[2] = values[2]; - result[3] = values[3]; - result[4] = values[4]; - result[5] = values[5]; - result[6] = values[6]; - result[7] = values[7]; - result[8] = values[8]; + result[0] = matrix[0]; + result[1] = matrix[1]; + result[2] = matrix[2]; + result[3] = matrix[3]; + result[4] = matrix[4]; + result[5] = matrix[5]; + result[6] = matrix[6]; + result[7] = matrix[7]; + result[8] = matrix[8]; return result; }; @@ -3824,9 +3816,7 @@ define('Core/Matrix3',[ * var m2 = Cesium.Matrix3.fromArray(v2, 2); */ Matrix3.fromArray = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3854,9 +3844,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values parameter is required'); - } + Check.defined('values', values); return Matrix3.clone(values, result); }; @@ -3870,9 +3858,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix3(values[0], values[1], values[2], @@ -3899,9 +3885,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this quaternion. */ Matrix3.fromQuaternion = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); var x2 = quaternion.x * quaternion.x; var xy = quaternion.x * quaternion.y; @@ -3951,10 +3935,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this headingPitchRoll. */ Matrix3.fromHeadingPitchRoll = function(headingPitchRoll, result) { - if (!defined(headingPitchRoll)) { - throw new DeveloperError('headingPitchRoll is required'); - } - var cosTheta = Math.cos(-headingPitchRoll.pitch); + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + + var cosTheta = Math.cos(-headingPitchRoll.pitch); var cosPsi = Math.cos(-headingPitchRoll.heading); var cosPhi = Math.cos(headingPitchRoll.roll); var sinTheta = Math.sin(-headingPitchRoll.pitch); @@ -4005,9 +3988,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix3( @@ -4043,9 +4024,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromUniformScale(2.0); */ Matrix3.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix3( @@ -4069,7 +4048,7 @@ define('Core/Matrix3',[ /** * Computes a Matrix3 instance representing the cross product equivalent matrix of a Cartesian3 vector. * - * @param {Cartesian3} the vector on the left hand side of the cross product operation. + * @param {Cartesian3} vector the vector on the left hand side of the cross product operation. * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created. * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. * @@ -4081,9 +4060,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromCrossProduct(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromCrossProduct = function(vector, result) { - if (!defined(vector)) { - throw new DeveloperError('vector is required.'); - } + Check.typeOf.object('vector', vector); if (!defined(result)) { return new Matrix3( @@ -4118,9 +4095,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationX = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4159,9 +4134,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationY = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4200,9 +4173,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationZ = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4236,9 +4207,7 @@ define('Core/Matrix3',[ * @returns {Number[]} The modified Array parameter or a new Array instance if one was not provided. */ Matrix3.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5], matrix[6], matrix[7], matrix[8]]; @@ -4272,12 +4241,10 @@ define('Core/Matrix3',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix3.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 2) { - throw new DeveloperError('row must be 0, 1, or 2.'); - } - if (typeof column !== 'number' || column < 0 || column > 2) { - throw new DeveloperError('column must be 0, 1, or 2.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 2); + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 2); return column * 3 + row; }; @@ -4293,16 +4260,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var startIndex = index * 3; var x = matrix[startIndex]; @@ -4327,18 +4288,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); var startIndex = index * 3; @@ -4359,15 +4313,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 3]; @@ -4391,18 +4340,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); result[index] = cartesian.x; @@ -4421,12 +4363,8 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[3], matrix[4], matrix[5], scratchColumn)); @@ -4457,15 +4395,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var column0Row0 = left[0] * right[0] + left[3] * right[1] + left[6] * right[2]; var column0Row1 = left[1] * right[0] + left[4] * right[1] + left[7] * right[2]; @@ -4500,15 +4432,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -4531,15 +4457,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -4562,15 +4482,9 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -4595,15 +4509,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -4634,15 +4542,9 @@ define('Core/Matrix3',[ * @see Matrix3.multiplyByUniformScale */ Matrix3.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); result[0] = matrix[0] * scale.x; result[1] = matrix[1] * scale.x; @@ -4664,12 +4566,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -4691,12 +4589,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var column0Row0 = matrix[0]; var column0Row1 = matrix[3]; @@ -4836,9 +4730,7 @@ define('Core/Matrix3',[ * var c = Cesium.Cartesian3.multiplyByScalar(v, lambda, new Cesium.Cartesian3()); // equal to Cesium.Matrix3.multiplyByVector(a, v) */ Matrix3.computeEigenDecomposition = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); // This routine was created based upon Matrix Computations, 3rd ed., by Golub and Van Loan, // section 8.4.3 The Classical Jacobi Algorithm @@ -4882,12 +4774,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -4909,9 +4797,7 @@ define('Core/Matrix3',[ * @returns {Number} The value of the determinant of the matrix. */ Matrix3.determinant = function(matrix) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); var m11 = matrix[0]; var m21 = matrix[3]; @@ -4936,12 +4822,8 @@ define('Core/Matrix3',[ * @exception {DeveloperError} matrix is not invertible. */ Matrix3.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var m11 = matrix[0]; var m21 = matrix[1]; @@ -5007,9 +4889,7 @@ define('Core/Matrix3',[ * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. */ Matrix3.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -5197,12 +5077,14 @@ define('Core/Matrix3',[ /*global define*/ define('Core/Cartesian4',[ + './Check', './defaultValue', './defined', './DeveloperError', './freezeObject', './Math' ], function( + Check, defaultValue, defined, DeveloperError, @@ -5285,9 +5167,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.fromColor = function(color, result) { - if (!defined(color)) { - throw new DeveloperError('color is required'); - } + Check.typeOf.object('color', color); if (!defined(result)) { return new Cartesian4(color.red, color.green, color.blue, color.alpha); } @@ -5339,12 +5219,8 @@ define('Core/Cartesian4',[ * @returns {Number[]} The array that was packed into */ Cartesian4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5365,9 +5241,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5389,9 +5263,7 @@ define('Core/Cartesian4',[ * @returns {Number[]} The packed array. */ Cartesian4.packArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -5414,9 +5286,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4[]} The unpacked array. */ Cartesian4.unpackArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -5459,9 +5329,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the maximum component. */ Cartesian4.maximumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -5473,9 +5341,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the minimum component. */ Cartesian4.minimumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -5489,15 +5355,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the minimum components. */ Cartesian4.minimumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -5516,15 +5376,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the maximum components. */ Cartesian4.maximumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -5541,9 +5395,7 @@ define('Core/Cartesian4',[ * @returns {Number} The squared magnitude. */ Cartesian4.magnitudeSquared = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z + cartesian.w * cartesian.w; }; @@ -5574,9 +5426,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(2.0, 0.0, 0.0, 0.0)); */ Cartesian4.distance = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitude(distanceScratch); @@ -5597,9 +5448,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(3.0, 0.0, 0.0, 0.0)); */ Cartesian4.distanceSquared = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitudeSquared(distanceScratch); @@ -5613,12 +5463,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.normalize = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian4.magnitude(cartesian); @@ -5642,12 +5488,8 @@ define('Core/Cartesian4',[ * @returns {Number} The dot product. */ Cartesian4.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w; }; @@ -5661,15 +5503,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -5687,15 +5523,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x / right.x; result.y = left.y / right.y; @@ -5713,15 +5543,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -5739,15 +5563,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -5765,15 +5583,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -5791,15 +5603,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -5816,12 +5622,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.negate = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -5838,12 +5640,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.abs = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -5863,18 +5661,10 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian4.multiplyByScalar(end, t, lerpScratch); result = Cartesian4.multiplyByScalar(start, 1.0 - t, result); @@ -5890,12 +5680,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The most orthogonal axis. */ Cartesian4.mostOrthogonalAxis = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian4.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian4.abs(f, f); @@ -6140,6 +5926,7 @@ define('Core/RuntimeError',[ define('Core/Matrix4',[ './Cartesian3', './Cartesian4', + './Check', './defaultValue', './defined', './defineProperties', @@ -6151,6 +5938,7 @@ define('Core/Matrix4',[ ], function( Cartesian3, Cartesian4, + Check, defaultValue, defined, defineProperties, @@ -6241,13 +6029,8 @@ define('Core/Matrix4',[ * @returns {Number[]} The array that was packed into */ Matrix4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -6280,9 +6063,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if one was not provided. */ Matrix4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -6378,9 +6159,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required'); - } + Check.defined('values', values); return Matrix4.clone(values, result); }; @@ -6394,9 +6173,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix4(values[0], values[1], values[2], values[3], @@ -6433,9 +6210,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRotationTranslation = function(rotation, translation, result) { - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } + Check.typeOf.object('rotation', rotation); translation = defaultValue(translation, Cartesian3.ZERO); @@ -6483,15 +6258,9 @@ define('Core/Matrix4',[ * result); */ Matrix4.fromTranslationQuaternionRotationScale = function(translation, rotation, scale, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('translation', translation); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('scale', scale); if (!defined(result)) { result = new Matrix4(); @@ -6552,9 +6321,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromTranslationRotationScale = function(translationRotationScale, result) { - if (!defined(translationRotationScale)) { - throw new DeveloperError('translationRotationScale is required.'); - } + Check.typeOf.object('translationRotationScale', translationRotationScale); return Matrix4.fromTranslationQuaternionRotationScale(translationRotationScale.translation, translationRotationScale.rotation, translationRotationScale.scale, result); }; @@ -6569,9 +6336,7 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByTranslation */ Matrix4.fromTranslation = function(translation, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } + Check.typeOf.object('translation', translation); return Matrix4.fromRotationTranslation(Matrix3.IDENTITY, translation, result); }; @@ -6592,9 +6357,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix4.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix4( @@ -6639,9 +6402,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromUniformScale(2.0); */ Matrix4.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix4(scale, 0.0, 0.0, 0.0, @@ -6681,23 +6442,15 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromCamera = function(camera, result) { - if (!defined(camera)) { - throw new DeveloperError('camera is required.'); - } + Check.typeOf.object('camera', camera); var position = camera.position; var direction = camera.direction; var up = camera.up; - if (!defined(position)) { - throw new DeveloperError('camera.position is required.'); - } - if (!defined(direction)) { - throw new DeveloperError('camera.direction is required.'); - } - if (!defined(up)) { - throw new DeveloperError('camera.up is required.'); - } + Check.typeOf.object('camera.position', position); + Check.typeOf.object('camera.direction', direction); + Check.typeOf.object('camera.up', up); Cartesian3.normalize(direction, fromCameraF); Cartesian3.normalize(Cartesian3.cross(fromCameraF, up, fromCameraR), fromCameraR); @@ -6776,21 +6529,11 @@ define('Core/Matrix4',[ * @exception {DeveloperError} far must be greater than zero. */ Matrix4.computePerspectiveFieldOfView = function(fovY, aspectRatio, near, far, result) { - if (fovY <= 0.0 || fovY > Math.PI) { - throw new DeveloperError('fovY must be in (0, PI].'); - } - if (aspectRatio <= 0.0) { - throw new DeveloperError('aspectRatio must be greater than zero.'); - } - if (near <= 0.0) { - throw new DeveloperError('near must be greater than zero.'); - } - if (far <= 0.0) { - throw new DeveloperError('far must be greater than zero.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThan('fovY', fovY, 0.0); + Check.typeOf.number.lessThan('fovY', fovY, Math.PI); + Check.typeOf.number.greaterThan('near', near, 0.0); + Check.typeOf.number.greaterThan('far', far, 0.0); + Check.typeOf.object('result', result); var bottom = Math.tan(fovY * 0.5); @@ -6831,27 +6574,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeOrthographicOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var a = 1.0 / (right - left); var b = 1.0 / (top - bottom); @@ -6896,27 +6625,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computePerspectiveOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -6957,24 +6672,12 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeInfinitePerspectiveOffCenter = function(left, right, bottom, top, near, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -7022,9 +6725,7 @@ define('Core/Matrix4',[ * }, 0.0, 1.0, new Cesium.Matrix4()); */ Matrix4.computeViewportTransformation = function(viewport, nearDepthRange, farDepthRange, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); viewport = defaultValue(viewport, defaultValue.EMPTY_OBJECT); var x = defaultValue(viewport.x, 0.0); @@ -7076,21 +6777,11 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeView = function(position, direction, up, right, result) { - if (!defined(position)) { - throw new DeveloperError('position is required'); - } - if (!defined(direction)) { - throw new DeveloperError('direction is required'); - } - if (!defined(up)) { - throw new DeveloperError('up is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); + Check.typeOf.object('up', up); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = right.x; result[1] = up.x; @@ -7131,9 +6822,7 @@ define('Core/Matrix4',[ * //creates a = [10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0] */ Matrix4.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], @@ -7177,12 +6866,11 @@ define('Core/Matrix4',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix4.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 3) { - throw new DeveloperError('row must be 0, 1, 2, or 3.'); - } - if (typeof column !== 'number' || column < 0 || column > 3) { - throw new DeveloperError('column must be 0, 1, 2, or 3.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 3); + + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 3); return column * 4 + row; }; @@ -7215,16 +6903,12 @@ define('Core/Matrix4',[ * // a.x = 12.0; a.y = 16.0; a.z = 20.0; a.w = 24.0; */ Matrix4.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var startIndex = index * 4; var x = matrix[startIndex]; @@ -7266,18 +6950,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 96.0, 25.0] */ Matrix4.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); var startIndex = index * 4; @@ -7295,18 +6974,12 @@ define('Core/Matrix4',[ * @param {Matrix4} matrix The matrix to use. * @param {Cartesian3} translation The translation that replaces the translation of the provided matrix. * @param {Cartesian4} result The object onto which to store the result. - * @returns {Matrix4} The modified result parameter. - */ - Matrix4.setTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + * @returns {Matrix4} The modified result parameter. + */ + Matrix4.setTranslation = function(matrix, translation, result) { + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -7359,16 +7032,12 @@ define('Core/Matrix4',[ * // a.x = 18.0; a.y = 19.0; a.z = 20.0; a.w = 21.0; */ Matrix4.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 4]; @@ -7409,18 +7078,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 24.0, 25.0] */ Matrix4.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); result[index] = cartesian.x; @@ -7440,12 +7104,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter */ Matrix4.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[4], matrix[5], matrix[6], scratchColumn)); @@ -7477,15 +7137,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -7569,15 +7223,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -7607,15 +7255,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -7656,15 +7298,9 @@ define('Core/Matrix4',[ * var m3 = Cesium.Matrix4.multiplyTransformation(m1, m2, new Cesium.Matrix4()); */ Matrix4.multiplyTransformation = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -7742,15 +7378,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByMatrix3(m, rotation, m); */ Matrix4.multiplyByMatrix3 = function(matrix, rotation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('result', result); var left0 = matrix[0]; var left1 = matrix[1]; @@ -7818,15 +7448,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByTranslation(m, position, m); */ Matrix4.multiplyByTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); var x = translation.x; var y = translation.y; @@ -7878,15 +7502,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByScale */ Matrix4.multiplyByUniformScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scale', scale); + Check.typeOf.object('result', result); uniformScaleScratch.x = scale; uniformScaleScratch.y = scale; @@ -7915,15 +7533,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByUniformScale */ Matrix4.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); var scaleX = scale.x; var scaleY = scale.y; @@ -7962,15 +7574,9 @@ define('Core/Matrix4',[ * @returns {Cartesian4} The modified result parameter. */ Matrix4.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8006,15 +7612,9 @@ define('Core/Matrix4',[ * // Cesium.Matrix4.multiplyByVector(matrix, new Cesium.Cartesian4(p.x, p.y, p.z, 0.0), result); */ Matrix4.multiplyByPointAsVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8044,16 +7644,9 @@ define('Core/Matrix4',[ * var result = Cesium.Matrix4.multiplyByPoint(matrix, p, new Cesium.Cartesian3()); */ Matrix4.multiplyByPoint = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8093,15 +7686,9 @@ define('Core/Matrix4',[ * // [-44.0, -46.0, -48.0, -50.0] */ Matrix4.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -8145,12 +7732,8 @@ define('Core/Matrix4',[ * // [-22.0, -23.0, -24.0, -25.0] */ Matrix4.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -8194,12 +7777,8 @@ define('Core/Matrix4',[ * // [13.0, 17.0, 21.0, 25.0] */ Matrix4.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var matrix1 = matrix[1]; var matrix2 = matrix[2]; @@ -8235,12 +7814,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -8354,9 +7929,7 @@ define('Core/Matrix4',[ * //Prints "Difference between both the matrices is not less than 0.1" on the console */ Matrix4.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -8387,12 +7960,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter. */ Matrix4.getTranslation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = matrix[12]; result.y = matrix[13]; @@ -8423,12 +7992,8 @@ define('Core/Matrix4',[ * // [12.0, 16.0, 20.0] */ Matrix4.getRotation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -8460,12 +8025,8 @@ define('Core/Matrix4',[ * @exception {RuntimeError} matrix is not invertible because its determinate is zero. */ Matrix4.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); // Special case for a zero scale matrix that can occur, for example, // when a model's node has a [0, 0, 0] scale. @@ -8603,12 +8164,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.inverseTransformation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); //This function is an optimized version of the below 4 lines. //var rT = Matrix3.transpose(Matrix4.getRotation(matrix)); @@ -8892,6 +8449,7 @@ define('Core/Matrix4',[ /*global define*/ define('Core/Rectangle',[ './Cartographic', + './Check', './defaultValue', './defined', './defineProperties', @@ -8901,6 +8459,7 @@ define('Core/Rectangle',[ './Math' ], function( Cartographic, + Check, defaultValue, defined, defineProperties, @@ -8997,13 +8556,8 @@ define('Core/Rectangle',[ * @returns {Number[]} The array that was packed into */ Rectangle.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -9024,9 +8578,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -9047,9 +8599,7 @@ define('Core/Rectangle',[ * @returns {Number} The width. */ Rectangle.computeWidth = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; if (east < west) { @@ -9064,9 +8614,7 @@ define('Core/Rectangle',[ * @returns {Number} The height. */ Rectangle.computeHeight = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); return rectangle.north - rectangle.south; }; @@ -9101,6 +8649,32 @@ define('Core/Rectangle',[ return result; }; + /** + * Creates an rectangle given the boundary longitude and latitude in radians. + * + * @param {Number} [west=0.0] The westernmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [south=0.0] The southernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Number} [east=0.0] The easternmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [north=0.0] The northernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Rectangle} [result] The object onto which to store the result, or undefined if a new instance should be created. + * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. + * + * @example + * var rectangle = Cesium.Rectangle.fromRadians(0.0, Math.PI/4, Math.PI/8, 3*Math.PI/4); + */ + Rectangle.fromRadians = function(west, south, east, north, result) { + if (!defined(result)) { + return new Rectangle(west, south, east, north); + } + + result.west = defaultValue(west, 0.0); + result.south = defaultValue(south, 0.0); + result.east = defaultValue(east, 0.0); + result.north = defaultValue(north, 0.0); + + return result; + }; + /** * Creates the smallest possible Rectangle that encloses all positions in the provided array. * @@ -9109,9 +8683,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartographicArray = function(cartographics, result) { - if (!defined(cartographics)) { - throw new DeveloperError('cartographics is required.'); - } + Check.defined('cartographics', cartographics); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -9164,9 +8736,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartesianArray = function(cartesians, ellipsoid, result) { - if (!defined(cartesians)) { - throw new DeveloperError('cartesians is required.'); - } + Check.defined('cartesians', cartesians); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -9282,9 +8852,7 @@ define('Core/Rectangle',[ * @returns {Boolean} <code>true</code> if the Rectangles are within the provided epsilon, <code>false</code> otherwise. */ Rectangle.prototype.equalsEpsilon = function(other, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon is required and must be a number.'); - } + Check.typeOf.number('epsilon', epsilon); return defined(other) && (Math.abs(this.west - other.west) <= epsilon) && @@ -9304,45 +8872,23 @@ define('Core/Rectangle',[ * @exception {DeveloperError} <code>west</code> must be in the interval [<code>-Pi</code>, <code>Pi</code>]. */ Rectangle.validate = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var north = rectangle.north; - if (typeof north !== 'number') { - throw new DeveloperError('north is required to be a number.'); - } - - if (north < -CesiumMath.PI_OVER_TWO || north > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('north must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('north', north, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('north', north, CesiumMath.PI_OVER_TWO); var south = rectangle.south; - if (typeof south !== 'number') { - throw new DeveloperError('south is required to be a number.'); - } - - if (south < -CesiumMath.PI_OVER_TWO || south > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('south must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('south', south, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('south', south, CesiumMath.PI_OVER_TWO); var west = rectangle.west; - if (typeof west !== 'number') { - throw new DeveloperError('west is required to be a number.'); - } - - if (west < -Math.PI || west > Math.PI) { - throw new DeveloperError('west must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('west', west, -Math.PI); + Check.typeOf.number.lessThanOrEquals('west', west, Math.PI); var east = rectangle.east; - if (typeof east !== 'number') { - throw new DeveloperError('east is required to be a number.'); - } - - if (east < -Math.PI || east > Math.PI) { - throw new DeveloperError('east must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('east', east, -Math.PI); + Check.typeOf.number.lessThanOrEquals('east', east, Math.PI); }; /** @@ -9353,9 +8899,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.south); @@ -9374,9 +8918,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.north); @@ -9395,9 +8937,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.north); @@ -9416,9 +8956,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.south); @@ -9437,9 +8975,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.center = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; @@ -9474,12 +9010,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.intersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var rectangleEast = rectangle.east; var rectangleWest = rectangle.west; @@ -9535,12 +9067,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.simpleIntersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var west = Math.max(rectangle.west, otherRectangle.west); var south = Math.max(rectangle.south, otherRectangle.south); @@ -9571,12 +9099,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.union = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); if (!defined(result)) { result = new Rectangle(); @@ -9620,12 +9144,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.expand = function(rectangle, cartographic, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); if (!defined(result)) { result = new Rectangle(); @@ -9647,12 +9167,8 @@ define('Core/Rectangle',[ * @returns {Boolean} true if the provided cartographic is inside the rectangle, false otherwise. */ Rectangle.contains = function(rectangle, cartographic) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); var longitude = cartographic.longitude; var latitude = cartographic.latitude; @@ -9685,9 +9201,7 @@ define('Core/Rectangle',[ * @returns {Cartesian3[]} The modified result parameter or a new Array of Cartesians instances if none was provided. */ Rectangle.subsample = function(rectangle, ellipsoid, surfaceHeight, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84); surfaceHeight = defaultValue(surfaceHeight, 0.0); @@ -9765,9 +9279,9 @@ define('Core/Rectangle',[ define('Core/BoundingSphere',[ './Cartesian3', './Cartographic', + './Check', './defaultValue', './defined', - './DeveloperError', './Ellipsoid', './GeographicProjection', './Intersect', @@ -9778,9 +9292,9 @@ define('Core/BoundingSphere',[ ], function( Cartesian3, Cartographic, + Check, defaultValue, defined, - DeveloperError, Ellipsoid, GeographicProjection, Intersect, @@ -10110,9 +9624,7 @@ define('Core/BoundingSphere',[ stride = defaultValue(stride, 3); - if (stride < 3) { - throw new DeveloperError('stride must be 3 or greater.'); - } + Check.typeOf.number.greaterThanOrEquals('stride', stride, 3); var currentPos = fromPointsCurrentPos; currentPos.x = positions[0] + center.x; @@ -10416,9 +9928,8 @@ define('Core/BoundingSphere',[ * var sphere = Cesium.BoundingSphere.fromCornerPoints(new Cesium.Cartesian3(-0.5, -0.5, -0.5), new Cesium.Cartesian3(0.5, 0.5, 0.5)); */ BoundingSphere.fromCornerPoints = function(corner, oppositeCorner, result) { - if (!defined(corner) || !defined(oppositeCorner)) { - throw new DeveloperError('corner and oppositeCorner are required.'); - } + Check.typeOf.object('corner', corner); + Check.typeOf.object('oppositeCorner', oppositeCorner); if (!defined(result)) { result = new BoundingSphere(); @@ -10442,9 +9953,7 @@ define('Core/BoundingSphere',[ * var boundingSphere = Cesium.BoundingSphere.fromEllipsoid(ellipsoid); */ BoundingSphere.fromEllipsoid = function(ellipsoid, result) { - if (!defined(ellipsoid)) { - throw new DeveloperError('ellipsoid is required.'); - } + Check.typeOf.object('ellipsoid', ellipsoid); if (!defined(result)) { result = new BoundingSphere(); @@ -10570,13 +10079,8 @@ define('Core/BoundingSphere',[ * @returns {Number[]} The array that was packed into */ BoundingSphere.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -10598,9 +10102,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if one was not provided. */ BoundingSphere.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -10627,13 +10129,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.union = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); if (!defined(result)) { result = new BoundingSphere(); @@ -10682,13 +10179,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.expand = function(sphere, point, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(point)) { - throw new DeveloperError('point is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('point', point); result = BoundingSphere.clone(sphere, result); @@ -10711,13 +10203,8 @@ define('Core/BoundingSphere',[ * intersects the plane. */ BoundingSphere.intersectPlane = function(sphere, plane) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(plane)) { - throw new DeveloperError('plane is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('plane', plane); var center = sphere.center; var radius = sphere.radius; @@ -10743,13 +10230,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.transform = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -10777,12 +10259,8 @@ define('Core/BoundingSphere',[ * }); */ BoundingSphere.distanceSquaredTo = function(sphere, cartesian) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('cartesian', cartesian); var diff = Cartesian3.subtract(sphere.center, cartesian, distanceSquaredToScratch); return Cartesian3.magnitudeSquared(diff) - sphere.radius * sphere.radius; @@ -10804,13 +10282,8 @@ define('Core/BoundingSphere',[ * var newBoundingSphere = Cesium.BoundingSphere.transformWithoutScale(boundingSphere, modelMatrix); */ BoundingSphere.transformWithoutScale = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -10837,17 +10310,9 @@ define('Core/BoundingSphere',[ * @returns {Interval} The nearest and farthest distances on the bounding sphere from position in direction. */ BoundingSphere.computePlaneDistances = function(sphere, position, direction, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(position)) { - throw new DeveloperError('position is required.'); - } - - if (!defined(direction)) { - throw new DeveloperError('direction is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); if (!defined(result)) { result = new Interval(); @@ -10882,9 +10347,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.projectTo2D = function(sphere, projection, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } + Check.typeOf.object('sphere', sphere); projection = defaultValue(projection, projectTo2DProjection); @@ -10979,12 +10442,8 @@ define('Core/BoundingSphere',[ * @returns {Boolean} <code>true</code> if the sphere is not visible; otherwise <code>false</code>. */ BoundingSphere.isOccluded = function(sphere, occluder) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(occluder)) { - throw new DeveloperError('occluder is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('occluder', occluder); return !occluder.isBoundingSphereVisible(sphere); }; @@ -12193,7 +11652,10 @@ define('Core/WebGLConstants',[ COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : 0x9279, TEXTURE_IMMUTABLE_FORMAT : 0x912F, MAX_ELEMENT_INDEX : 0x8D6B, - TEXTURE_IMMUTABLE_LEVELS : 0x82DF + TEXTURE_IMMUTABLE_LEVELS : 0x82DF, + + // Extensions + MAX_TEXTURE_MAX_ANISOTROPY_EXT : 0x84FF }; return freezeObject(WebGLConstants); @@ -12723,7 +12185,7 @@ define('Core/Geometry',[ * <li><code>position</code> - 3D vertex position. 64-bit floating-point (for precision). 3 components per attribute. See {@link VertexFormat#position}.</li> * <li><code>normal</code> - Normal (normalized), commonly used for lighting. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#normal}.</li> * <li><code>st</code> - 2D texture coordinate. 32-bit floating-point. 2 components per attribute. See {@link VertexFormat#st}.</li> - * <li><code>binormal</code> - Binormal (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#binormal}.</li> + * <li><code>bitangent</code> - Bitangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#bitangent}.</li> * <li><code>tangent</code> - Tangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#tangent}.</li> * </ul> * </p> @@ -12752,7 +12214,7 @@ define('Core/Geometry',[ * componentsPerAttribute : 3, * values : new Float32Array(0) * }); - * + * * @see GeometryAttribute * @see VertexFormat */ @@ -13033,7 +12495,7 @@ define('Core/GeometryAttributes',[ this.st = options.st; /** - * The binormal attribute (normalized), which is used for tangent-space effects like bump mapping. + * The bitangent attribute (normalized), which is used for tangent-space effects like bump mapping. * <p> * 32-bit floating-point. 3 components per attribute. * </p> @@ -13042,7 +12504,7 @@ define('Core/GeometryAttributes',[ * * @default undefined */ - this.binormal = options.binormal; + this.bitangent = options.bitangent; /** * The tangent attribute (normalized), which is used for tangent-space effects like bump mapping. diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createGeometry.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createGeometry.js index 85473d41..a3cc7ce5 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createGeometry.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,68 +45,6 @@ define('Core/defined',[],function() { return defined; }); -/*global define*/ -define('Core/freezeObject',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Freezes an object, using Object.freeze if available, otherwise returns - * the object unchanged. This function should be used in setup code to prevent - * errors from completely halting JavaScript execution in legacy browsers. - * - * @private - * - * @exports freezeObject - */ - var freezeObject = Object.freeze; - if (!defined(freezeObject)) { - freezeObject = function(o) { - return o; - }; - } - - return freezeObject; -}); - -/*global define*/ -define('Core/defaultValue',[ - './freezeObject' - ], function( - freezeObject) { - 'use strict'; - - /** - * Returns the first parameter if not undefined, otherwise the second parameter. - * Useful for setting a default value for a parameter. - * - * @exports defaultValue - * - * @param {*} a - * @param {*} b - * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter. - * - * @example - * param = Cesium.defaultValue(param, 'default'); - */ - function defaultValue(a, b) { - if (a !== undefined) { - return a; - } - return b; - } - - /** - * A frozen empty object that can be used as the default value for options passed as - * an object literal. - */ - defaultValue.EMPTY_OBJECT = freezeObject({}); - - return defaultValue; -}); - /*global define*/ define('Core/DeveloperError',[ './defined' @@ -188,41 +126,13 @@ define('Core/DeveloperError',[ return DeveloperError; }); -/*global define*/ -define('Core/isArray',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Tests an object to see if it is an array. - * @exports isArray - * - * @param {Object} value The value to test. - * @returns {Boolean} true if the value is an array, false otherwise. - */ - var isArray = Array.isArray; - if (!defined(isArray)) { - isArray = function(value) { - return Object.prototype.toString.call(value) === '[object Array]'; - }; - } - - return isArray; -}); - /*global define*/ define('Core/Check',[ - './defaultValue', - './defined', - './DeveloperError', - './isArray' + './defined', + './DeveloperError' ], function( - defaultValue, defined, - DeveloperError, - isArray) { + DeveloperError) { 'use strict'; /** @@ -237,111 +147,134 @@ define('Core/Check',[ */ Check.typeOf = {}; - /** - * Contains functions for checking numeric conditions such as minimum and maximum values - */ - Check.numeric = {}; - function getUndefinedErrorMessage(name) { - return name + ' was required but undefined.'; + return name + ' is required, actual value was undefined'; } function getFailedTypeErrorMessage(actual, expected, name) { - return 'Expected ' + name + ' to be typeof ' + expected + ', got ' + actual; + return 'Expected ' + name + ' to be typeof ' + expected + ', actual typeof was ' + actual; } /** * Throws if test is not defined * - * @param {*} test The value that is to be checked * @param {String} name The name of the variable being tested + * @param {*} test The value that is to be checked * @exception {DeveloperError} test must be defined */ - Check.defined = function (test, name) { + Check.defined = function (name, test) { if (!defined(test)) { throw new DeveloperError(getUndefinedErrorMessage(name)); } }; /** - * Throws if test is greater than maximum + * Throws if test is not typeof 'function' * - * @param {Number} test The value to test - * @param {Number} maximum The maximum allowed value - * @exception {DeveloperError} test must not be greater than maximum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'function' */ - Check.numeric.maximum = function (test, maximum) { - Check.typeOf.number(test); - Check.typeOf.number(maximum); - if (test > maximum) { - throw new DeveloperError('Expected ' + test + ' to be at most ' + maximum); + Check.typeOf.func = function (name, test) { + if (typeof test !== 'function') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); } }; /** - * Throws if test is less than minimum + * Throws if test is not typeof 'string' * - * @param {Number} test The value to test - * @param {Number} minimum The minimum allowed value - * @exception {DeveloperError} test must not be less than mininum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'string' */ - Check.numeric.minimum = function (test, minimum) { - Check.typeOf.number(test); - Check.typeOf.number(minimum); - if (test < minimum) { - throw new DeveloperError('Expected ' + test + ' to be at least ' + minimum); + Check.typeOf.string = function (name, test) { + if (typeof test !== 'string') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); } }; /** - * Throws if test is not typeof 'function' + * Throws if test is not typeof 'number' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'function' + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'number' */ - Check.typeOf.function = function (test, name) { - if (typeof test !== 'function') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); + Check.typeOf.number = function (name, test) { + if (typeof test !== 'number') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); } }; /** - * Throws if test is not typeof 'string' + * Throws if test is not typeof 'number' and less than limit * + * @param {String} name The name of the variable being tested * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than limit + */ + Check.typeOf.number.lessThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test >= limit) { + throw new DeveloperError('Expected ' + name + ' to be less than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and less than or equal to limit + * * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'string' + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than or equal to limit */ - Check.typeOf.string = function (test, name) { - if (typeof test !== 'string') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); + Check.typeOf.number.lessThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test > limit) { + throw new DeveloperError('Expected ' + name + ' to be less than or equal to ' + limit + ', actual value was ' + test); } }; /** - * Throws if test is not typeof 'number' + * Throws if test is not typeof 'number' and greater than limit * + * @param {String} name The name of the variable being tested * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than limit + */ + Check.typeOf.number.greaterThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test <= limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and greater than or equal to limit + * * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'number' + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than or equal to limit */ - Check.typeOf.number = function (test, name) { - if (typeof test !== 'number') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); + Check.typeOf.number.greaterThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test < limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than or equal to' + limit + ', actual value was ' + test); } }; /** * Throws if test is not typeof 'object' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested + * @param {*} test The value to test * @exception {DeveloperError} test must be typeof 'object' */ - Check.typeOf.object = function (test, name) { + Check.typeOf.object = function (name, test) { if (typeof test !== 'object') { throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'object', name)); } @@ -350,11 +283,11 @@ define('Core/Check',[ /** * Throws if test is not typeof 'boolean' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested + * @param {*} test The value to test * @exception {DeveloperError} test must be typeof 'boolean' */ - Check.typeOf.boolean = function (test, name) { + Check.typeOf.bool = function (name, test) { if (typeof test !== 'boolean') { throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'boolean', name)); } @@ -363,6 +296,68 @@ define('Core/Check',[ return Check; }); +/*global define*/ +define('Core/freezeObject',[ + './defined' + ], function( + defined) { + 'use strict'; + + /** + * Freezes an object, using Object.freeze if available, otherwise returns + * the object unchanged. This function should be used in setup code to prevent + * errors from completely halting JavaScript execution in legacy browsers. + * + * @private + * + * @exports freezeObject + */ + var freezeObject = Object.freeze; + if (!defined(freezeObject)) { + freezeObject = function(o) { + return o; + }; + } + + return freezeObject; +}); + +/*global define*/ +define('Core/defaultValue',[ + './freezeObject' + ], function( + freezeObject) { + 'use strict'; + + /** + * Returns the first parameter if not undefined, otherwise the second parameter. + * Useful for setting a default value for a parameter. + * + * @exports defaultValue + * + * @param {*} a + * @param {*} b + * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter. + * + * @example + * param = Cesium.defaultValue(param, 'default'); + */ + function defaultValue(a, b) { + if (a !== undefined) { + return a; + } + return b; + } + + /** + * A frozen empty object that can be used as the default value for options passed as + * an object literal. + */ + defaultValue.EMPTY_OBJECT = freezeObject({}); + + return defaultValue; +}); + /* I've wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace so it's better encapsulated. Now you can have multiple random number generators @@ -1047,7 +1042,7 @@ define('Core/Math',[ if (!defined(angle)) { throw new DeveloperError('angle is required.'); } - + return CesiumMath.clamp(angle, -1*CesiumMath.PI_OVER_TWO, CesiumMath.PI_OVER_TWO); }; @@ -1057,11 +1052,11 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [<code>-CesiumMath.PI</code>, <code>CesiumMath.PI</code>]. */ - CesiumMath.negativePiToPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.negativePiToPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - return CesiumMath.zeroToTwoPi(x + CesiumMath.PI) - CesiumMath.PI; + return CesiumMath.zeroToTwoPi(angle + CesiumMath.PI) - CesiumMath.PI; }; /** @@ -1070,12 +1065,12 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [0, <code>CesiumMath.TWO_PI</code>]. */ - CesiumMath.zeroToTwoPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.zeroToTwoPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - var mod = CesiumMath.mod(x, CesiumMath.TWO_PI); - if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(x) > CesiumMath.EPSILON14) { + var mod = CesiumMath.mod(angle, CesiumMath.TWO_PI); + if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(angle) > CesiumMath.EPSILON14) { return CesiumMath.TWO_PI; } return mod; @@ -1145,7 +1140,7 @@ define('Core/Math',[ * @example * //Compute 7!, which is equal to 5040 * var computedFactorial = Cesium.Math.factorial(7); - * + * * @see {@link http://en.wikipedia.org/wiki/Factorial|Factorial on Wikipedia} */ CesiumMath.factorial = function(n) { @@ -1429,7 +1424,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.fromSpherical = function(spherical, result) { - Check.typeOf.object(spherical, 'spherical'); + Check.typeOf.object('spherical', spherical); if (!defined(result)) { result = new Cartesian3(); @@ -1513,8 +1508,8 @@ define('Core/Cartesian3',[ * @returns {Number[]} The array that was packed into */ Cartesian3.pack = function(value, array, startingIndex) { - Check.typeOf.object(value, 'value'); - Check.defined(array, 'array'); + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1534,7 +1529,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.unpack = function(array, startingIndex, result) { - Check.defined(array, 'array'); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1555,7 +1550,7 @@ define('Core/Cartesian3',[ * @returns {Number[]} The packed array. */ Cartesian3.packArray = function(array, result) { - Check.defined(array, 'array'); + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -1578,8 +1573,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3[]} The unpacked array. */ Cartesian3.unpackArray = function(array, result) { - Check.defined(array, 'array'); - Check.numeric.minimum(array.length, 3); + Check.defined('array', array); + Check.typeOf.number.greaterThanOrEquals('array.length', array.length, 3); if (array.length % 3 !== 0) { throw new DeveloperError('array length must be a multiple of 3.'); } @@ -1625,7 +1620,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the maximum component. */ Cartesian3.maximumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z); }; @@ -1637,7 +1632,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the minimum component. */ Cartesian3.minimumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z); }; @@ -1651,9 +1646,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the minimum components. */ Cartesian3.minimumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -1671,9 +1666,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the maximum components. */ Cartesian3.maximumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -1688,7 +1683,7 @@ define('Core/Cartesian3',[ * @returns {Number} The squared magnitude. */ Cartesian3.magnitudeSquared = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z; }; @@ -1717,8 +1712,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distance(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(2.0, 0.0, 0.0)); */ Cartesian3.distance = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitude(distanceScratch); @@ -1737,8 +1732,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distanceSquared(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(3.0, 0.0, 0.0)); */ Cartesian3.distanceSquared = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitudeSquared(distanceScratch); @@ -1752,8 +1747,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.normalize = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian3.magnitude(cartesian); @@ -1776,8 +1771,8 @@ define('Core/Cartesian3',[ * @returns {Number} The dot product. */ Cartesian3.dot = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z; }; @@ -1791,9 +1786,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyComponents = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -1835,9 +1830,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.add = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -1854,9 +1849,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.subtract = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -1873,9 +1868,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -1892,9 +1887,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.divideByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -1910,8 +1905,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.negate = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -1927,8 +1922,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.abs = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -1947,10 +1942,10 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.lerp = function(start, end, t, result) { - Check.typeOf.object(start, 'start'); - Check.typeOf.object(end, 'end'); - Check.typeOf.number(t, 't'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian3.multiplyByScalar(end, t, lerpScratch); result = Cartesian3.multiplyByScalar(start, 1.0 - t, result); @@ -1967,8 +1962,8 @@ define('Core/Cartesian3',[ * @returns {Number} The angle between the Cartesians. */ Cartesian3.angleBetween = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.normalize(left, angleBetweenScratch); Cartesian3.normalize(right, angleBetweenScratch2); @@ -1986,8 +1981,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The most orthogonal axis. */ Cartesian3.mostOrthogonalAxis = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian3.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian3.abs(f, f); @@ -2064,9 +2059,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The cross product. */ Cartesian3.cross = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var leftX = left.x; var leftY = left.y; @@ -2099,8 +2094,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromDegrees(-115.0, 37.0); */ Cartesian3.fromDegrees = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); longitude = CesiumMath.toRadians(longitude); latitude = CesiumMath.toRadians(latitude); @@ -2125,8 +2120,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromRadians(-2.007, 0.645); */ Cartesian3.fromRadians = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); height = defaultValue(height, 0.0); var radiiSquared = defined(ellipsoid) ? ellipsoid.radiiSquared : wgs84RadiiSquared; @@ -2160,7 +2155,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArray([-115.0, 37.0, -107.0, 33.0]); */ Cartesian3.fromDegreesArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -2194,7 +2189,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArray([-2.007, 0.645, -1.867, .575]); */ Cartesian3.fromRadiansArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -2228,7 +2223,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArrayHeights([-115.0, 37.0, 100000.0, -107.0, 33.0, 150000.0]); */ Cartesian3.fromDegreesArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -2263,7 +2258,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArrayHeights([-2.007, 0.645, 100000.0, -1.867, .575, 150000.0]); */ Cartesian3.fromRadiansArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -3010,7 +3005,9 @@ define('Core/Ellipsoid',[ /** * Computes an Ellipsoid from a Cartesian specifying the radii in x, y, and z directions. * - * @param {Cartesian3} [radii=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Cartesian3} [cartesian=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new + * instance should be created. * @returns {Ellipsoid} A new Ellipsoid instance. * * @exception {DeveloperError} All radii components must be greater than or equal to zero. @@ -3650,6 +3647,7 @@ define('Core/Interval',[ /*global define*/ define('Core/Matrix3',[ './Cartesian3', + './Check', './defaultValue', './defined', './defineProperties', @@ -3658,6 +3656,7 @@ define('Core/Matrix3',[ './Math' ], function( Cartesian3, + Check, defaultValue, defined, defineProperties, @@ -3720,13 +3719,8 @@ define('Core/Matrix3',[ * @returns {Number[]} The array that was packed into */ Matrix3.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3752,9 +3746,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. */ Matrix3.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3781,24 +3773,24 @@ define('Core/Matrix3',[ * @param {Matrix3} [result] The object onto which to store the result. * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. (Returns undefined if matrix is undefined) */ - Matrix3.clone = function(values, result) { - if (!defined(values)) { + Matrix3.clone = function(matrix, result) { + if (!defined(matrix)) { return undefined; } if (!defined(result)) { - return new Matrix3(values[0], values[3], values[6], - values[1], values[4], values[7], - values[2], values[5], values[8]); + return new Matrix3(matrix[0], matrix[3], matrix[6], + matrix[1], matrix[4], matrix[7], + matrix[2], matrix[5], matrix[8]); } - result[0] = values[0]; - result[1] = values[1]; - result[2] = values[2]; - result[3] = values[3]; - result[4] = values[4]; - result[5] = values[5]; - result[6] = values[6]; - result[7] = values[7]; - result[8] = values[8]; + result[0] = matrix[0]; + result[1] = matrix[1]; + result[2] = matrix[2]; + result[3] = matrix[3]; + result[4] = matrix[4]; + result[5] = matrix[5]; + result[6] = matrix[6]; + result[7] = matrix[7]; + result[8] = matrix[8]; return result; }; @@ -3824,9 +3816,7 @@ define('Core/Matrix3',[ * var m2 = Cesium.Matrix3.fromArray(v2, 2); */ Matrix3.fromArray = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3854,9 +3844,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values parameter is required'); - } + Check.defined('values', values); return Matrix3.clone(values, result); }; @@ -3870,9 +3858,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix3(values[0], values[1], values[2], @@ -3899,9 +3885,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this quaternion. */ Matrix3.fromQuaternion = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); var x2 = quaternion.x * quaternion.x; var xy = quaternion.x * quaternion.y; @@ -3951,10 +3935,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this headingPitchRoll. */ Matrix3.fromHeadingPitchRoll = function(headingPitchRoll, result) { - if (!defined(headingPitchRoll)) { - throw new DeveloperError('headingPitchRoll is required'); - } - var cosTheta = Math.cos(-headingPitchRoll.pitch); + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + + var cosTheta = Math.cos(-headingPitchRoll.pitch); var cosPsi = Math.cos(-headingPitchRoll.heading); var cosPhi = Math.cos(headingPitchRoll.roll); var sinTheta = Math.sin(-headingPitchRoll.pitch); @@ -4005,9 +3988,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix3( @@ -4043,9 +4024,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromUniformScale(2.0); */ Matrix3.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix3( @@ -4069,7 +4048,7 @@ define('Core/Matrix3',[ /** * Computes a Matrix3 instance representing the cross product equivalent matrix of a Cartesian3 vector. * - * @param {Cartesian3} the vector on the left hand side of the cross product operation. + * @param {Cartesian3} vector the vector on the left hand side of the cross product operation. * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created. * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. * @@ -4081,9 +4060,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromCrossProduct(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromCrossProduct = function(vector, result) { - if (!defined(vector)) { - throw new DeveloperError('vector is required.'); - } + Check.typeOf.object('vector', vector); if (!defined(result)) { return new Matrix3( @@ -4118,9 +4095,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationX = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4159,9 +4134,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationY = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4200,9 +4173,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationZ = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4236,9 +4207,7 @@ define('Core/Matrix3',[ * @returns {Number[]} The modified Array parameter or a new Array instance if one was not provided. */ Matrix3.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5], matrix[6], matrix[7], matrix[8]]; @@ -4272,12 +4241,10 @@ define('Core/Matrix3',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix3.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 2) { - throw new DeveloperError('row must be 0, 1, or 2.'); - } - if (typeof column !== 'number' || column < 0 || column > 2) { - throw new DeveloperError('column must be 0, 1, or 2.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 2); + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 2); return column * 3 + row; }; @@ -4293,16 +4260,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var startIndex = index * 3; var x = matrix[startIndex]; @@ -4327,18 +4288,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); var startIndex = index * 3; @@ -4359,15 +4313,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 3]; @@ -4391,18 +4340,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); result[index] = cartesian.x; @@ -4421,12 +4363,8 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[3], matrix[4], matrix[5], scratchColumn)); @@ -4457,15 +4395,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var column0Row0 = left[0] * right[0] + left[3] * right[1] + left[6] * right[2]; var column0Row1 = left[1] * right[0] + left[4] * right[1] + left[7] * right[2]; @@ -4500,15 +4432,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -4531,15 +4457,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -4562,15 +4482,9 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -4595,15 +4509,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -4634,15 +4542,9 @@ define('Core/Matrix3',[ * @see Matrix3.multiplyByUniformScale */ Matrix3.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); result[0] = matrix[0] * scale.x; result[1] = matrix[1] * scale.x; @@ -4664,12 +4566,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -4691,12 +4589,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var column0Row0 = matrix[0]; var column0Row1 = matrix[3]; @@ -4836,9 +4730,7 @@ define('Core/Matrix3',[ * var c = Cesium.Cartesian3.multiplyByScalar(v, lambda, new Cesium.Cartesian3()); // equal to Cesium.Matrix3.multiplyByVector(a, v) */ Matrix3.computeEigenDecomposition = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); // This routine was created based upon Matrix Computations, 3rd ed., by Golub and Van Loan, // section 8.4.3 The Classical Jacobi Algorithm @@ -4882,12 +4774,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -4909,9 +4797,7 @@ define('Core/Matrix3',[ * @returns {Number} The value of the determinant of the matrix. */ Matrix3.determinant = function(matrix) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); var m11 = matrix[0]; var m21 = matrix[3]; @@ -4936,12 +4822,8 @@ define('Core/Matrix3',[ * @exception {DeveloperError} matrix is not invertible. */ Matrix3.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var m11 = matrix[0]; var m21 = matrix[1]; @@ -5007,9 +4889,7 @@ define('Core/Matrix3',[ * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. */ Matrix3.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -5197,12 +5077,14 @@ define('Core/Matrix3',[ /*global define*/ define('Core/Cartesian4',[ + './Check', './defaultValue', './defined', './DeveloperError', './freezeObject', './Math' ], function( + Check, defaultValue, defined, DeveloperError, @@ -5285,9 +5167,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.fromColor = function(color, result) { - if (!defined(color)) { - throw new DeveloperError('color is required'); - } + Check.typeOf.object('color', color); if (!defined(result)) { return new Cartesian4(color.red, color.green, color.blue, color.alpha); } @@ -5339,12 +5219,8 @@ define('Core/Cartesian4',[ * @returns {Number[]} The array that was packed into */ Cartesian4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5365,9 +5241,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5389,9 +5263,7 @@ define('Core/Cartesian4',[ * @returns {Number[]} The packed array. */ Cartesian4.packArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -5414,9 +5286,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4[]} The unpacked array. */ Cartesian4.unpackArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -5459,9 +5329,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the maximum component. */ Cartesian4.maximumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -5473,9 +5341,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the minimum component. */ Cartesian4.minimumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -5489,15 +5355,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the minimum components. */ Cartesian4.minimumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -5516,15 +5376,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the maximum components. */ Cartesian4.maximumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -5541,9 +5395,7 @@ define('Core/Cartesian4',[ * @returns {Number} The squared magnitude. */ Cartesian4.magnitudeSquared = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z + cartesian.w * cartesian.w; }; @@ -5574,9 +5426,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(2.0, 0.0, 0.0, 0.0)); */ Cartesian4.distance = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitude(distanceScratch); @@ -5597,9 +5448,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(3.0, 0.0, 0.0, 0.0)); */ Cartesian4.distanceSquared = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitudeSquared(distanceScratch); @@ -5613,12 +5463,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.normalize = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian4.magnitude(cartesian); @@ -5642,12 +5488,8 @@ define('Core/Cartesian4',[ * @returns {Number} The dot product. */ Cartesian4.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w; }; @@ -5661,15 +5503,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -5687,15 +5523,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x / right.x; result.y = left.y / right.y; @@ -5713,15 +5543,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -5739,15 +5563,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -5765,15 +5583,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -5791,15 +5603,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -5816,12 +5622,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.negate = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -5838,12 +5640,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.abs = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -5863,18 +5661,10 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian4.multiplyByScalar(end, t, lerpScratch); result = Cartesian4.multiplyByScalar(start, 1.0 - t, result); @@ -5890,12 +5680,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The most orthogonal axis. */ Cartesian4.mostOrthogonalAxis = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian4.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian4.abs(f, f); @@ -6140,6 +5926,7 @@ define('Core/RuntimeError',[ define('Core/Matrix4',[ './Cartesian3', './Cartesian4', + './Check', './defaultValue', './defined', './defineProperties', @@ -6151,6 +5938,7 @@ define('Core/Matrix4',[ ], function( Cartesian3, Cartesian4, + Check, defaultValue, defined, defineProperties, @@ -6241,13 +6029,8 @@ define('Core/Matrix4',[ * @returns {Number[]} The array that was packed into */ Matrix4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -6280,9 +6063,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if one was not provided. */ Matrix4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -6378,9 +6159,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required'); - } + Check.defined('values', values); return Matrix4.clone(values, result); }; @@ -6394,9 +6173,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix4(values[0], values[1], values[2], values[3], @@ -6433,9 +6210,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRotationTranslation = function(rotation, translation, result) { - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } + Check.typeOf.object('rotation', rotation); translation = defaultValue(translation, Cartesian3.ZERO); @@ -6483,15 +6258,9 @@ define('Core/Matrix4',[ * result); */ Matrix4.fromTranslationQuaternionRotationScale = function(translation, rotation, scale, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('translation', translation); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('scale', scale); if (!defined(result)) { result = new Matrix4(); @@ -6552,9 +6321,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromTranslationRotationScale = function(translationRotationScale, result) { - if (!defined(translationRotationScale)) { - throw new DeveloperError('translationRotationScale is required.'); - } + Check.typeOf.object('translationRotationScale', translationRotationScale); return Matrix4.fromTranslationQuaternionRotationScale(translationRotationScale.translation, translationRotationScale.rotation, translationRotationScale.scale, result); }; @@ -6569,9 +6336,7 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByTranslation */ Matrix4.fromTranslation = function(translation, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } + Check.typeOf.object('translation', translation); return Matrix4.fromRotationTranslation(Matrix3.IDENTITY, translation, result); }; @@ -6592,9 +6357,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix4.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix4( @@ -6639,9 +6402,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromUniformScale(2.0); */ Matrix4.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix4(scale, 0.0, 0.0, 0.0, @@ -6681,23 +6442,15 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromCamera = function(camera, result) { - if (!defined(camera)) { - throw new DeveloperError('camera is required.'); - } + Check.typeOf.object('camera', camera); var position = camera.position; var direction = camera.direction; var up = camera.up; - if (!defined(position)) { - throw new DeveloperError('camera.position is required.'); - } - if (!defined(direction)) { - throw new DeveloperError('camera.direction is required.'); - } - if (!defined(up)) { - throw new DeveloperError('camera.up is required.'); - } + Check.typeOf.object('camera.position', position); + Check.typeOf.object('camera.direction', direction); + Check.typeOf.object('camera.up', up); Cartesian3.normalize(direction, fromCameraF); Cartesian3.normalize(Cartesian3.cross(fromCameraF, up, fromCameraR), fromCameraR); @@ -6776,21 +6529,11 @@ define('Core/Matrix4',[ * @exception {DeveloperError} far must be greater than zero. */ Matrix4.computePerspectiveFieldOfView = function(fovY, aspectRatio, near, far, result) { - if (fovY <= 0.0 || fovY > Math.PI) { - throw new DeveloperError('fovY must be in (0, PI].'); - } - if (aspectRatio <= 0.0) { - throw new DeveloperError('aspectRatio must be greater than zero.'); - } - if (near <= 0.0) { - throw new DeveloperError('near must be greater than zero.'); - } - if (far <= 0.0) { - throw new DeveloperError('far must be greater than zero.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThan('fovY', fovY, 0.0); + Check.typeOf.number.lessThan('fovY', fovY, Math.PI); + Check.typeOf.number.greaterThan('near', near, 0.0); + Check.typeOf.number.greaterThan('far', far, 0.0); + Check.typeOf.object('result', result); var bottom = Math.tan(fovY * 0.5); @@ -6831,27 +6574,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeOrthographicOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var a = 1.0 / (right - left); var b = 1.0 / (top - bottom); @@ -6896,27 +6625,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computePerspectiveOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -6957,24 +6672,12 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeInfinitePerspectiveOffCenter = function(left, right, bottom, top, near, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -7022,9 +6725,7 @@ define('Core/Matrix4',[ * }, 0.0, 1.0, new Cesium.Matrix4()); */ Matrix4.computeViewportTransformation = function(viewport, nearDepthRange, farDepthRange, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); viewport = defaultValue(viewport, defaultValue.EMPTY_OBJECT); var x = defaultValue(viewport.x, 0.0); @@ -7076,21 +6777,11 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeView = function(position, direction, up, right, result) { - if (!defined(position)) { - throw new DeveloperError('position is required'); - } - if (!defined(direction)) { - throw new DeveloperError('direction is required'); - } - if (!defined(up)) { - throw new DeveloperError('up is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); + Check.typeOf.object('up', up); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = right.x; result[1] = up.x; @@ -7131,9 +6822,7 @@ define('Core/Matrix4',[ * //creates a = [10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0] */ Matrix4.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], @@ -7177,12 +6866,11 @@ define('Core/Matrix4',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix4.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 3) { - throw new DeveloperError('row must be 0, 1, 2, or 3.'); - } - if (typeof column !== 'number' || column < 0 || column > 3) { - throw new DeveloperError('column must be 0, 1, 2, or 3.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 3); + + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 3); return column * 4 + row; }; @@ -7215,16 +6903,12 @@ define('Core/Matrix4',[ * // a.x = 12.0; a.y = 16.0; a.z = 20.0; a.w = 24.0; */ Matrix4.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var startIndex = index * 4; var x = matrix[startIndex]; @@ -7266,18 +6950,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 96.0, 25.0] */ Matrix4.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); var startIndex = index * 4; @@ -7298,15 +6977,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.setTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -7359,16 +7032,12 @@ define('Core/Matrix4',[ * // a.x = 18.0; a.y = 19.0; a.z = 20.0; a.w = 21.0; */ Matrix4.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 4]; @@ -7409,18 +7078,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 24.0, 25.0] */ Matrix4.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); result[index] = cartesian.x; @@ -7440,12 +7104,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter */ Matrix4.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[4], matrix[5], matrix[6], scratchColumn)); @@ -7470,22 +7130,16 @@ define('Core/Matrix4',[ /** * Computes the product of two matrices. - * - * @param {Matrix4} left The first matrix. - * @param {Matrix4} right The second matrix. - * @param {Matrix4} result The object onto which to store the result. - * @returns {Matrix4} The modified result parameter. - */ - Matrix4.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + * + * @param {Matrix4} left The first matrix. + * @param {Matrix4} right The second matrix. + * @param {Matrix4} result The object onto which to store the result. + * @returns {Matrix4} The modified result parameter. + */ + Matrix4.multiply = function(left, right, result) { + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -7569,15 +7223,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -7607,15 +7255,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -7656,15 +7298,9 @@ define('Core/Matrix4',[ * var m3 = Cesium.Matrix4.multiplyTransformation(m1, m2, new Cesium.Matrix4()); */ Matrix4.multiplyTransformation = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -7742,15 +7378,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByMatrix3(m, rotation, m); */ Matrix4.multiplyByMatrix3 = function(matrix, rotation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('result', result); var left0 = matrix[0]; var left1 = matrix[1]; @@ -7818,15 +7448,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByTranslation(m, position, m); */ Matrix4.multiplyByTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); var x = translation.x; var y = translation.y; @@ -7878,15 +7502,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByScale */ Matrix4.multiplyByUniformScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scale', scale); + Check.typeOf.object('result', result); uniformScaleScratch.x = scale; uniformScaleScratch.y = scale; @@ -7915,15 +7533,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByUniformScale */ Matrix4.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); var scaleX = scale.x; var scaleY = scale.y; @@ -7962,15 +7574,9 @@ define('Core/Matrix4',[ * @returns {Cartesian4} The modified result parameter. */ Matrix4.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8006,15 +7612,9 @@ define('Core/Matrix4',[ * // Cesium.Matrix4.multiplyByVector(matrix, new Cesium.Cartesian4(p.x, p.y, p.z, 0.0), result); */ Matrix4.multiplyByPointAsVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8044,16 +7644,9 @@ define('Core/Matrix4',[ * var result = Cesium.Matrix4.multiplyByPoint(matrix, p, new Cesium.Cartesian3()); */ Matrix4.multiplyByPoint = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8093,15 +7686,9 @@ define('Core/Matrix4',[ * // [-44.0, -46.0, -48.0, -50.0] */ Matrix4.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -8145,12 +7732,8 @@ define('Core/Matrix4',[ * // [-22.0, -23.0, -24.0, -25.0] */ Matrix4.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -8194,12 +7777,8 @@ define('Core/Matrix4',[ * // [13.0, 17.0, 21.0, 25.0] */ Matrix4.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var matrix1 = matrix[1]; var matrix2 = matrix[2]; @@ -8235,12 +7814,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -8354,9 +7929,7 @@ define('Core/Matrix4',[ * //Prints "Difference between both the matrices is not less than 0.1" on the console */ Matrix4.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -8387,12 +7960,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter. */ Matrix4.getTranslation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = matrix[12]; result.y = matrix[13]; @@ -8423,12 +7992,8 @@ define('Core/Matrix4',[ * // [12.0, 16.0, 20.0] */ Matrix4.getRotation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -8460,12 +8025,8 @@ define('Core/Matrix4',[ * @exception {RuntimeError} matrix is not invertible because its determinate is zero. */ Matrix4.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); // Special case for a zero scale matrix that can occur, for example, // when a model's node has a [0, 0, 0] scale. @@ -8603,12 +8164,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.inverseTransformation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); //This function is an optimized version of the below 4 lines. //var rT = Matrix3.transpose(Matrix4.getRotation(matrix)); @@ -8892,6 +8449,7 @@ define('Core/Matrix4',[ /*global define*/ define('Core/Rectangle',[ './Cartographic', + './Check', './defaultValue', './defined', './defineProperties', @@ -8901,6 +8459,7 @@ define('Core/Rectangle',[ './Math' ], function( Cartographic, + Check, defaultValue, defined, defineProperties, @@ -8997,13 +8556,8 @@ define('Core/Rectangle',[ * @returns {Number[]} The array that was packed into */ Rectangle.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -9024,9 +8578,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -9047,9 +8599,7 @@ define('Core/Rectangle',[ * @returns {Number} The width. */ Rectangle.computeWidth = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; if (east < west) { @@ -9064,9 +8614,7 @@ define('Core/Rectangle',[ * @returns {Number} The height. */ Rectangle.computeHeight = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); return rectangle.north - rectangle.south; }; @@ -9101,6 +8649,32 @@ define('Core/Rectangle',[ return result; }; + /** + * Creates an rectangle given the boundary longitude and latitude in radians. + * + * @param {Number} [west=0.0] The westernmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [south=0.0] The southernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Number} [east=0.0] The easternmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [north=0.0] The northernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Rectangle} [result] The object onto which to store the result, or undefined if a new instance should be created. + * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. + * + * @example + * var rectangle = Cesium.Rectangle.fromRadians(0.0, Math.PI/4, Math.PI/8, 3*Math.PI/4); + */ + Rectangle.fromRadians = function(west, south, east, north, result) { + if (!defined(result)) { + return new Rectangle(west, south, east, north); + } + + result.west = defaultValue(west, 0.0); + result.south = defaultValue(south, 0.0); + result.east = defaultValue(east, 0.0); + result.north = defaultValue(north, 0.0); + + return result; + }; + /** * Creates the smallest possible Rectangle that encloses all positions in the provided array. * @@ -9109,9 +8683,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartographicArray = function(cartographics, result) { - if (!defined(cartographics)) { - throw new DeveloperError('cartographics is required.'); - } + Check.defined('cartographics', cartographics); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -9164,9 +8736,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartesianArray = function(cartesians, ellipsoid, result) { - if (!defined(cartesians)) { - throw new DeveloperError('cartesians is required.'); - } + Check.defined('cartesians', cartesians); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -9282,9 +8852,7 @@ define('Core/Rectangle',[ * @returns {Boolean} <code>true</code> if the Rectangles are within the provided epsilon, <code>false</code> otherwise. */ Rectangle.prototype.equalsEpsilon = function(other, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon is required and must be a number.'); - } + Check.typeOf.number('epsilon', epsilon); return defined(other) && (Math.abs(this.west - other.west) <= epsilon) && @@ -9304,45 +8872,23 @@ define('Core/Rectangle',[ * @exception {DeveloperError} <code>west</code> must be in the interval [<code>-Pi</code>, <code>Pi</code>]. */ Rectangle.validate = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var north = rectangle.north; - if (typeof north !== 'number') { - throw new DeveloperError('north is required to be a number.'); - } - - if (north < -CesiumMath.PI_OVER_TWO || north > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('north must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('north', north, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('north', north, CesiumMath.PI_OVER_TWO); var south = rectangle.south; - if (typeof south !== 'number') { - throw new DeveloperError('south is required to be a number.'); - } - - if (south < -CesiumMath.PI_OVER_TWO || south > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('south must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('south', south, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('south', south, CesiumMath.PI_OVER_TWO); var west = rectangle.west; - if (typeof west !== 'number') { - throw new DeveloperError('west is required to be a number.'); - } - - if (west < -Math.PI || west > Math.PI) { - throw new DeveloperError('west must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('west', west, -Math.PI); + Check.typeOf.number.lessThanOrEquals('west', west, Math.PI); var east = rectangle.east; - if (typeof east !== 'number') { - throw new DeveloperError('east is required to be a number.'); - } - - if (east < -Math.PI || east > Math.PI) { - throw new DeveloperError('east must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('east', east, -Math.PI); + Check.typeOf.number.lessThanOrEquals('east', east, Math.PI); }; /** @@ -9353,9 +8899,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.south); @@ -9374,9 +8918,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.north); @@ -9395,9 +8937,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.north); @@ -9416,9 +8956,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.south); @@ -9437,9 +8975,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.center = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; @@ -9474,12 +9010,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.intersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var rectangleEast = rectangle.east; var rectangleWest = rectangle.west; @@ -9535,12 +9067,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.simpleIntersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var west = Math.max(rectangle.west, otherRectangle.west); var south = Math.max(rectangle.south, otherRectangle.south); @@ -9571,12 +9099,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.union = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); if (!defined(result)) { result = new Rectangle(); @@ -9620,12 +9144,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.expand = function(rectangle, cartographic, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); if (!defined(result)) { result = new Rectangle(); @@ -9647,12 +9167,8 @@ define('Core/Rectangle',[ * @returns {Boolean} true if the provided cartographic is inside the rectangle, false otherwise. */ Rectangle.contains = function(rectangle, cartographic) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); var longitude = cartographic.longitude; var latitude = cartographic.latitude; @@ -9685,9 +9201,7 @@ define('Core/Rectangle',[ * @returns {Cartesian3[]} The modified result parameter or a new Array of Cartesians instances if none was provided. */ Rectangle.subsample = function(rectangle, ellipsoid, surfaceHeight, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84); surfaceHeight = defaultValue(surfaceHeight, 0.0); @@ -9765,9 +9279,9 @@ define('Core/Rectangle',[ define('Core/BoundingSphere',[ './Cartesian3', './Cartographic', + './Check', './defaultValue', './defined', - './DeveloperError', './Ellipsoid', './GeographicProjection', './Intersect', @@ -9778,9 +9292,9 @@ define('Core/BoundingSphere',[ ], function( Cartesian3, Cartographic, + Check, defaultValue, defined, - DeveloperError, Ellipsoid, GeographicProjection, Intersect, @@ -10110,9 +9624,7 @@ define('Core/BoundingSphere',[ stride = defaultValue(stride, 3); - if (stride < 3) { - throw new DeveloperError('stride must be 3 or greater.'); - } + Check.typeOf.number.greaterThanOrEquals('stride', stride, 3); var currentPos = fromPointsCurrentPos; currentPos.x = positions[0] + center.x; @@ -10416,9 +9928,8 @@ define('Core/BoundingSphere',[ * var sphere = Cesium.BoundingSphere.fromCornerPoints(new Cesium.Cartesian3(-0.5, -0.5, -0.5), new Cesium.Cartesian3(0.5, 0.5, 0.5)); */ BoundingSphere.fromCornerPoints = function(corner, oppositeCorner, result) { - if (!defined(corner) || !defined(oppositeCorner)) { - throw new DeveloperError('corner and oppositeCorner are required.'); - } + Check.typeOf.object('corner', corner); + Check.typeOf.object('oppositeCorner', oppositeCorner); if (!defined(result)) { result = new BoundingSphere(); @@ -10442,9 +9953,7 @@ define('Core/BoundingSphere',[ * var boundingSphere = Cesium.BoundingSphere.fromEllipsoid(ellipsoid); */ BoundingSphere.fromEllipsoid = function(ellipsoid, result) { - if (!defined(ellipsoid)) { - throw new DeveloperError('ellipsoid is required.'); - } + Check.typeOf.object('ellipsoid', ellipsoid); if (!defined(result)) { result = new BoundingSphere(); @@ -10570,13 +10079,8 @@ define('Core/BoundingSphere',[ * @returns {Number[]} The array that was packed into */ BoundingSphere.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -10598,9 +10102,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if one was not provided. */ BoundingSphere.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -10627,13 +10129,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.union = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); if (!defined(result)) { result = new BoundingSphere(); @@ -10682,13 +10179,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.expand = function(sphere, point, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(point)) { - throw new DeveloperError('point is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('point', point); result = BoundingSphere.clone(sphere, result); @@ -10711,13 +10203,8 @@ define('Core/BoundingSphere',[ * intersects the plane. */ BoundingSphere.intersectPlane = function(sphere, plane) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(plane)) { - throw new DeveloperError('plane is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('plane', plane); var center = sphere.center; var radius = sphere.radius; @@ -10743,13 +10230,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.transform = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -10777,12 +10259,8 @@ define('Core/BoundingSphere',[ * }); */ BoundingSphere.distanceSquaredTo = function(sphere, cartesian) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('cartesian', cartesian); var diff = Cartesian3.subtract(sphere.center, cartesian, distanceSquaredToScratch); return Cartesian3.magnitudeSquared(diff) - sphere.radius * sphere.radius; @@ -10804,13 +10282,8 @@ define('Core/BoundingSphere',[ * var newBoundingSphere = Cesium.BoundingSphere.transformWithoutScale(boundingSphere, modelMatrix); */ BoundingSphere.transformWithoutScale = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -10837,17 +10310,9 @@ define('Core/BoundingSphere',[ * @returns {Interval} The nearest and farthest distances on the bounding sphere from position in direction. */ BoundingSphere.computePlaneDistances = function(sphere, position, direction, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(position)) { - throw new DeveloperError('position is required.'); - } - - if (!defined(direction)) { - throw new DeveloperError('direction is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); if (!defined(result)) { result = new Interval(); @@ -10882,9 +10347,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.projectTo2D = function(sphere, projection, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } + Check.typeOf.object('sphere', sphere); projection = defaultValue(projection, projectTo2DProjection); @@ -10979,12 +10442,8 @@ define('Core/BoundingSphere',[ * @returns {Boolean} <code>true</code> if the sphere is not visible; otherwise <code>false</code>. */ BoundingSphere.isOccluded = function(sphere, occluder) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(occluder)) { - throw new DeveloperError('occluder is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('occluder', occluder); return !occluder.isBoundingSphereVisible(sphere); }; @@ -12193,7 +11652,10 @@ define('Core/WebGLConstants',[ COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : 0x9279, TEXTURE_IMMUTABLE_FORMAT : 0x912F, MAX_ELEMENT_INDEX : 0x8D6B, - TEXTURE_IMMUTABLE_LEVELS : 0x82DF + TEXTURE_IMMUTABLE_LEVELS : 0x82DF, + + // Extensions + MAX_TEXTURE_MAX_ANISOTROPY_EXT : 0x84FF }; return freezeObject(WebGLConstants); @@ -12723,7 +12185,7 @@ define('Core/Geometry',[ * <li><code>position</code> - 3D vertex position. 64-bit floating-point (for precision). 3 components per attribute. See {@link VertexFormat#position}.</li> * <li><code>normal</code> - Normal (normalized), commonly used for lighting. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#normal}.</li> * <li><code>st</code> - 2D texture coordinate. 32-bit floating-point. 2 components per attribute. See {@link VertexFormat#st}.</li> - * <li><code>binormal</code> - Binormal (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#binormal}.</li> + * <li><code>bitangent</code> - Bitangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#bitangent}.</li> * <li><code>tangent</code> - Tangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#tangent}.</li> * </ul> * </p> @@ -12752,7 +12214,7 @@ define('Core/Geometry',[ * componentsPerAttribute : 3, * values : new Float32Array(0) * }); - * + * * @see GeometryAttribute * @see VertexFormat */ @@ -13033,7 +12495,7 @@ define('Core/GeometryAttributes',[ this.st = options.st; /** - * The binormal attribute (normalized), which is used for tangent-space effects like bump mapping. + * The bitangent attribute (normalized), which is used for tangent-space effects like bump mapping. * <p> * 32-bit floating-point. 3 components per attribute. * </p> @@ -13042,7 +12504,7 @@ define('Core/GeometryAttributes',[ * * @default undefined */ - this.binormal = options.binormal; + this.bitangent = options.bitangent; /** * The tangent attribute (normalized), which is used for tangent-space effects like bump mapping. @@ -13074,12 +12536,14 @@ define('Core/GeometryAttributes',[ /*global define*/ define('Core/Cartesian2',[ + './Check', './defaultValue', './defined', './DeveloperError', './freezeObject', './Math' ], function( + Check, defaultValue, defined, DeveloperError, @@ -13186,17 +12650,13 @@ define('Core/Cartesian2',[ * * @param {Cartesian2} value The value to pack. * @param {Number[]} array The array to pack into. - * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements. - * - * @returns {Number[]} The array that was packed into - */ - Cartesian2.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements. + * + * @returns {Number[]} The array that was packed into + */ + Cartesian2.pack = function(value, array, startingIndex) { + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -13215,9 +12675,7 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided. */ Cartesian2.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -13237,9 +12695,7 @@ define('Core/Cartesian2',[ * @returns {Number[]} The packed array. */ Cartesian2.packArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -13262,9 +12718,7 @@ define('Core/Cartesian2',[ * @returns {Cartesian2[]} The unpacked array. */ Cartesian2.unpackArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -13307,9 +12761,7 @@ define('Core/Cartesian2',[ * @returns {Number} The value of the maximum component. */ Cartesian2.maximumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y); }; @@ -13321,9 +12773,7 @@ define('Core/Cartesian2',[ * @returns {Number} The value of the minimum component. */ Cartesian2.minimumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y); }; @@ -13337,15 +12787,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} A cartesian with the minimum components. */ Cartesian2.minimumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); @@ -13363,15 +12807,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} A cartesian with the maximum components. */ Cartesian2.maximumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -13385,9 +12823,7 @@ define('Core/Cartesian2',[ * @returns {Number} The squared magnitude. */ Cartesian2.magnitudeSquared = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y; }; @@ -13453,12 +12889,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.normalize = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian2.magnitude(cartesian); @@ -13480,12 +12912,8 @@ define('Core/Cartesian2',[ * @returns {Number} The dot product. */ Cartesian2.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y; }; @@ -13499,15 +12927,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.multiplyComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -13523,15 +12945,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.divideComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x / right.x; result.y = left.y / right.y; @@ -13547,15 +12963,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -13571,15 +12981,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -13595,15 +12999,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.multiplyByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -13619,15 +13017,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.divideByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -13642,12 +13034,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.negate = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -13662,12 +13050,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.abs = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -13685,18 +13069,10 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian2.multiplyByScalar(end, t, lerpScratch); result = Cartesian2.multiplyByScalar(start, 1.0 - t, result); @@ -13713,12 +13089,8 @@ define('Core/Cartesian2',[ * @returns {Number} The angle between the Cartesians. */ Cartesian2.angleBetween = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian2.normalize(left, angleBetweenScratch); Cartesian2.normalize(right, angleBetweenScratch2); @@ -13734,12 +13106,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The most orthogonal axis. */ Cartesian2.mostOrthogonalAxis = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian2.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian2.abs(f, f); @@ -14247,6 +13615,118 @@ define('Core/barycentricCoordinates',[ return barycentricCoordinates; }); +/*global define*/ +define('Core/oneTimeWarning',[ + './defaultValue', + './defined', + './DeveloperError' + ], function( + defaultValue, + defined, + DeveloperError) { + "use strict"; + + var warnings = {}; + + /** + * Logs a one time message to the console. Use this function instead of + * <code>console.log</code> directly since this does not log duplicate messages + * unless it is called from multiple workers. + * + * @exports oneTimeWarning + * + * @param {String} identifier The unique identifier for this warning. + * @param {String} [message=identifier] The message to log to the console. + * + * @example + * for(var i=0;i<foo.length;++i) { + * if (!defined(foo[i].bar)) { + * // Something that can be recovered from but may happen a lot + * oneTimeWarning('foo.bar undefined', 'foo.bar is undefined. Setting to 0.'); + * foo[i].bar = 0; + * // ... + * } + * } + * + * @private + */ + function oneTimeWarning(identifier, message) { + if (!defined(identifier)) { + throw new DeveloperError('identifier is required.'); + } + + if (!defined(warnings[identifier])) { + warnings[identifier] = true; + console.warn(defaultValue(message, identifier)); + } + } + + oneTimeWarning.geometryOutlines = 'Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.'; + + return oneTimeWarning; +}); + +/*global define*/ +define('Core/deprecationWarning',[ + './defined', + './DeveloperError', + './oneTimeWarning' + ], function( + defined, + DeveloperError, + oneTimeWarning) { + 'use strict'; + + /** + * Logs a deprecation message to the console. Use this function instead of + * <code>console.log</code> directly since this does not log duplicate messages + * unless it is called from multiple workers. + * + * @exports deprecationWarning + * + * @param {String} identifier The unique identifier for this deprecated API. + * @param {String} message The message to log to the console. + * + * @example + * // Deprecated function or class + * function Foo() { + * deprecationWarning('Foo', 'Foo was deprecated in Cesium 1.01. It will be removed in 1.03. Use newFoo instead.'); + * // ... + * } + * + * // Deprecated function + * Bar.prototype.func = function() { + * deprecationWarning('Bar.func', 'Bar.func() was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newFunc() instead.'); + * // ... + * }; + * + * // Deprecated property + * defineProperties(Bar.prototype, { + * prop : { + * get : function() { + * deprecationWarning('Bar.prop', 'Bar.prop was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newProp instead.'); + * // ... + * }, + * set : function(value) { + * deprecationWarning('Bar.prop', 'Bar.prop was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newProp instead.'); + * // ... + * } + * } + * }); + * + * @private + */ + function deprecationWarning(identifier, message) { + if (!defined(identifier) || !defined(message)) { + throw new DeveloperError('identifier and message are required.'); + } + + oneTimeWarning(identifier, message); + } + + return deprecationWarning; +}); + /*global define*/ define('Core/EncodedCartesian3',[ './Cartesian3', @@ -15356,6 +14836,7 @@ define('Core/IntersectionTests',[ './defaultValue', './defined', './DeveloperError', + './Interval', './Math', './Matrix3', './QuadraticRealPolynomial', @@ -15367,6 +14848,7 @@ define('Core/IntersectionTests',[ defaultValue, defined, DeveloperError, + Interval, CesiumMath, Matrix3, QuadraticRealPolynomial, @@ -15638,7 +15120,7 @@ define('Core/IntersectionTests',[ function raySphere(ray, sphere, result) { if (!defined(result)) { - result = {}; + result = new Interval(); } var origin = ray.origin; @@ -15669,8 +15151,8 @@ define('Core/IntersectionTests',[ * * @param {Ray} ray The ray. * @param {BoundingSphere} sphere The sphere. - * @param {Object} [result] The result onto which to store the result. - * @returns {Object} An object with the first (<code>start</code>) and the second (<code>stop</code>) intersection scalars for points along the ray or undefined if there are no intersections. + * @param {Interval} [result] The result onto which to store the result. + * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections. */ IntersectionTests.raySphere = function(ray, sphere, result) { if (!defined(ray)) { @@ -15698,8 +15180,8 @@ define('Core/IntersectionTests',[ * @param {Cartesian3} p0 An end point of the line segment. * @param {Cartesian3} p1 The other end point of the line segment. * @param {BoundingSphere} sphere The sphere. - * @param {Object} [result] The result onto which to store the result. - * @returns {Object} An object with the first (<code>start</code>) and the second (<code>stop</code>) intersection scalars for points along the line segment or undefined if there are no intersections. + * @param {Interval} [result] The result onto which to store the result. + * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections. */ IntersectionTests.lineSegmentSphere = function(p0, p1, sphere, result) { if (!defined(p0)) { @@ -15737,7 +15219,7 @@ define('Core/IntersectionTests',[ * * @param {Ray} ray The ray. * @param {Ellipsoid} ellipsoid The ellipsoid. - * @returns {Object} An object with the first (<code>start</code>) and the second (<code>stop</code>) intersection scalars for points along the ray or undefined if there are no intersections. + * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections. */ IntersectionTests.rayEllipsoid = function(ray, ellipsoid) { if (!defined(ray)) { @@ -15779,10 +15261,7 @@ define('Core/IntersectionTests',[ var root0 = temp / w2; var root1 = difference / temp; if (root0 < root1) { - return { - start : root0, - stop : root1 - }; + return new Interval(root0, root1); } return { @@ -15792,10 +15271,7 @@ define('Core/IntersectionTests',[ } else { // qw2 == product. Repeated roots (2 intersections). var root = Math.sqrt(difference / w2); - return { - start : root, - stop : root - }; + return new Interval(root, root); } } else if (q2 < 1.0) { // Inside ellipsoid (2 intersections). @@ -15805,19 +15281,13 @@ define('Core/IntersectionTests',[ discriminant = qw * qw - product; temp = -qw + Math.sqrt(discriminant); // Positively valued. - return { - start : 0.0, - stop : temp / w2 - }; + return new Interval(0.0, temp / w2); } else { // q2 == 1.0. On ellipsoid. if (qw < 0.0) { // Looking inward. w2 = Cartesian3.magnitudeSquared(w); - return { - start : 0.0, - stop : -qw / w2 - }; + return new Interval(0.0, -qw / w2); } // qw >= 0.0. Looking outward or tangent. @@ -16726,6 +16196,7 @@ define('Core/GeometryPipeline',[ './ComponentDatatype', './defaultValue', './defined', + './deprecationWarning', './DeveloperError', './EncodedCartesian3', './GeographicProjection', @@ -16752,6 +16223,7 @@ define('Core/GeometryPipeline',[ ComponentDatatype, defaultValue, defined, + deprecationWarning, DeveloperError, EncodedCartesian3, GeographicProjection, @@ -16885,7 +16357,7 @@ define('Core/GeometryPipeline',[ /** * Creates a new {@link Geometry} with <code>LINES</code> representing the provided * attribute (<code>attributeName</code>) for the provided geometry. This is used to - * visualize vector attributes like normals, binormals, and tangents. + * visualize vector attributes like normals, tangents, and bitangents. * * @param {Geometry} geometry The <code>Geometry</code> instance with the attribute. * @param {String} [attributeName='normal'] The name of the attribute. @@ -16895,7 +16367,7 @@ define('Core/GeometryPipeline',[ * @exception {DeveloperError} geometry.attributes must have an attribute with the same name as the attributeName parameter. * * @example - * var geometry = Cesium.GeometryPipeline.createLineSegmentsForVectors(instance.geometry, 'binormal', 100000.0); + * var geometry = Cesium.GeometryPipeline.createLineSegmentsForVectors(instance.geometry, 'bitangent', 100000.0); */ GeometryPipeline.createLineSegmentsForVectors = function(geometry, attributeName, length) { attributeName = defaultValue(attributeName, 'normal'); @@ -16987,8 +16459,11 @@ define('Core/GeometryPipeline',[ // From VertexFormat 'normal', 'st', - 'binormal', 'tangent', + 'bitangent', + + // For shadow volumes + 'extrudeDirection', // From compressing texture coordinates and normals 'compressedAttributes' @@ -17030,7 +16505,7 @@ define('Core/GeometryPipeline',[ * * @example * geometry = Cesium.GeometryPipeline.reorderForPreVertexCache(geometry); - * + * * @see GeometryPipeline.reorderForPostVertexCache */ GeometryPipeline.reorderForPreVertexCache = function(geometry) { @@ -17115,7 +16590,7 @@ define('Core/GeometryPipeline',[ * * @example * geometry = Cesium.GeometryPipeline.reorderForPostVertexCache(geometry); - * + * * @see GeometryPipeline.reorderForPreVertexCache * @see {@link http://gfx.cs.princ0eton.edu/pubs/Sander_2007_%3ETR/tipsy.pdf|Fast Triangle Reordering for Vertex Locality and Reduced Overdraw} * by Sander, Nehab, and Barczak @@ -17467,7 +16942,7 @@ define('Core/GeometryPipeline',[ * Transforms a geometry instance to world coordinates. This changes * the instance's <code>modelMatrix</code> to {@link Matrix4.IDENTITY} and transforms the * following attributes if they are present: <code>position</code>, <code>normal</code>, - * <code>binormal</code>, and <code>tangent</code>. + * <code>tangent</code>, and <code>bitangent</code>. * * @param {GeometryInstance} instance The geometry instance to modify. * @returns {GeometryInstance} The modified <code>instance</code> argument, with its attributes transforms to world coordinates. @@ -17495,16 +16970,16 @@ define('Core/GeometryPipeline',[ transformPoint(modelMatrix, attributes.nextPosition); if ((defined(attributes.normal)) || - (defined(attributes.binormal)) || - (defined(attributes.tangent))) { + (defined(attributes.tangent)) || + (defined(attributes.bitangent))) { Matrix4.inverse(modelMatrix, inverseTranspose); Matrix4.transpose(inverseTranspose, inverseTranspose); Matrix4.getRotation(inverseTranspose, normalMatrix); transformVector(normalMatrix, attributes.normal); - transformVector(normalMatrix, attributes.binormal); transformVector(normalMatrix, attributes.tangent); + transformVector(normalMatrix, attributes.bitangent); } var boundingSphere = instance.geometry.boundingSphere; @@ -17694,7 +17169,7 @@ define('Core/GeometryPipeline',[ * <p> * This is used by {@link Primitive} to efficiently render a large amount of static data. * </p> - * + * * @private * * @param {GeometryInstance[]} [instances] The array of {@link GeometryInstance} objects whose geometry will be combined. @@ -17710,7 +17185,7 @@ define('Core/GeometryPipeline',[ * Cesium.GeometryPipeline.transformToWorldCoordinates(instances[i]); * } * var geometries = Cesium.GeometryPipeline.combineInstances(instances); - * + * * @see GeometryPipeline.transformToWorldCoordinates */ GeometryPipeline.combineInstances = function(instances) { @@ -17886,8 +17361,8 @@ define('Core/GeometryPipeline',[ var tScratch = new Cartesian3(); /** - * Computes per-vertex binormals and tangents for a geometry containing <code>TRIANGLES</code>. - * The result is new <code>binormal</code> and <code>tangent</code> attributes added to the geometry. + * Computes per-vertex tangents and bitangents for a geometry containing <code>TRIANGLES</code>. + * The result is new <code>tangent</code> and <code>bitangent</code> attributes added to the geometry. * This assumes a counter-clockwise winding order. * <p> * Based on <a href="http://www.terathon.com/code/tangent.html">Computing Tangent Space Basis Vectors @@ -17895,15 +17370,15 @@ define('Core/GeometryPipeline',[ * </p> * * @param {Geometry} geometry The geometry to modify. - * @returns {Geometry} The modified <code>geometry</code> argument with the computed <code>binormal</code> and <code>tangent</code> attributes. + * @returns {Geometry} The modified <code>geometry</code> argument with the computed <code>tangent</code> and <code>bitangent</code> attributes. * * @exception {DeveloperError} geometry.indices length must be greater than 0 and be a multiple of 3. * @exception {DeveloperError} geometry.primitiveType must be {@link PrimitiveType.TRIANGLES}. * * @example - * Cesium.GeometryPipeline.computeBinormalAndTangent(geometry); + * Cesium.GeometryPipeline.computeTangentAndBiTangent(geometry); */ - GeometryPipeline.computeBinormalAndTangent = function(geometry) { + GeometryPipeline.computeTangentAndBitangent = function(geometry) { if (!defined(geometry)) { throw new DeveloperError('geometry is required.'); } @@ -17983,8 +17458,8 @@ define('Core/GeometryPipeline',[ tan1[i23 + 2] += sdirz; } - var binormalValues = new Float32Array(numVertices * 3); var tangentValues = new Float32Array(numVertices * 3); + var bitangentValues = new Float32Array(numVertices * 3); for (i = 0; i < numVertices; i++) { i03 = i * 3; @@ -18003,9 +17478,9 @@ define('Core/GeometryPipeline',[ Cartesian3.normalize(Cartesian3.cross(n, t, t), t); - binormalValues[i03] = t.x; - binormalValues[i13] = t.y; - binormalValues[i23] = t.z; + bitangentValues[i03] = t.x; + bitangentValues[i13] = t.y; + bitangentValues[i23] = t.z; } geometry.attributes.tangent = new GeometryAttribute({ @@ -18014,20 +17489,48 @@ define('Core/GeometryPipeline',[ values : tangentValues }); - geometry.attributes.binormal = new GeometryAttribute({ + geometry.attributes.bitangent = new GeometryAttribute({ componentDatatype : ComponentDatatype.FLOAT, componentsPerAttribute : 3, - values : binormalValues + values : bitangentValues }); return geometry; }; + /** + * Computes per-vertex binormal and tangents for a geometry containing <code>TRIANGLES</code>. + * The result is new <code>binormal</code> and <code>tangent</code> attributes added to the geometry. + * This assumes a counter-clockwise winding order. + * <p> + * Based on <a href="http://www.terathon.com/code/tangent.html">Computing Tangent Space Basis Vectors + * for an Arbitrary Mesh</a> by Eric Lengyel. + * </p> + * + * @param {Geometry} geometry The geometry to modify. + * @returns {Geometry} The modified <code>geometry</code> argument with the computed <code>binormal</code> and <code>tangent</code> attributes. + * + * @exception {DeveloperError} geometry.indices length must be greater than 0 and be a multiple of 3. + * @exception {DeveloperError} geometry.primitiveType must be {@link PrimitiveType.TRIANGLES}. + * + * @example + * Cesium.GeometryPipeline.computeBinormalAndTangent(geometry); + * + * @see GeometryPipeline.computeTangentAndBitangent + */ + GeometryPipeline.computeBinormalAndTangent = function(geometry) { + deprecationWarning('computeBinormalAndTangent', 'computeBinormalAndTangent was deprecated in 1.30. It will be removed in 1.31. Use a computeTangentAndBitangent.'); + GeometryPipeline.computeTangentAndBitangent(geometry); + geometry.attributes.binormal = geometry.attributes.bitangent; + + return geometry; + }; + var scratchCartesian2 = new Cartesian2(); var toEncode1 = new Cartesian3(); var toEncode2 = new Cartesian3(); var toEncode3 = new Cartesian3(); - + var encodeResult2 = new Cartesian2(); /** * Compresses and packs geometry normal attribute values to save memory. * @@ -18042,73 +17545,109 @@ define('Core/GeometryPipeline',[ throw new DeveloperError('geometry is required.'); } + var extrudeAttribute = geometry.attributes.extrudeDirection; + var i; + var numVertices; + if (defined(extrudeAttribute)) { + //only shadow volumes use extrudeDirection, and shadow volumes use vertexFormat: POSITION_ONLY so we don't need to check other attributes + var extrudeDirections = extrudeAttribute.values; + numVertices = extrudeDirections.length / 3.0; + var compressedDirections = new Float32Array(numVertices * 2); + + var i2 = 0; + for (i = 0; i < numVertices; ++i) { + Cartesian3.fromArray(extrudeDirections, i * 3.0, toEncode1); + if (Cartesian3.equals(toEncode1, Cartesian3.ZERO)) { + i2 += 2; + continue; + } + encodeResult2 = AttributeCompression.octEncodeInRange(toEncode1, 65535, encodeResult2); + compressedDirections[i2++] = encodeResult2.x; + compressedDirections[i2++] = encodeResult2.y; + } + + geometry.attributes.compressedAttributes = new GeometryAttribute({ + componentDatatype : ComponentDatatype.FLOAT, + componentsPerAttribute : 2, + values : compressedDirections + }); + delete geometry.attributes.extrudeDirection; + return geometry; + } + var normalAttribute = geometry.attributes.normal; var stAttribute = geometry.attributes.st; - if (!defined(normalAttribute) && !defined(stAttribute)) { + + var hasNormal = defined(normalAttribute); + var hasSt = defined(stAttribute); + if (!hasNormal && !hasSt) { return geometry; } var tangentAttribute = geometry.attributes.tangent; - var binormalAttribute = geometry.attributes.binormal; + var bitangentAttribute = geometry.attributes.bitangent; + + var hasTangent = defined(tangentAttribute); + var hasBitangent = defined(bitangentAttribute); var normals; var st; var tangents; - var binormals; + var bitangents; - if (defined(normalAttribute)) { + if (hasNormal) { normals = normalAttribute.values; } - if (defined(stAttribute)) { + if (hasSt) { st = stAttribute.values; } - if (defined(tangentAttribute)) { + if (hasTangent) { tangents = tangentAttribute.values; } - if (binormalAttribute) { - binormals = binormalAttribute.values; + if (hasBitangent) { + bitangents = bitangentAttribute.values; } - var length = defined(normals) ? normals.length : st.length; - var numComponents = defined(normals) ? 3.0 : 2.0; - var numVertices = length / numComponents; + var length = hasNormal ? normals.length : st.length; + var numComponents = hasNormal ? 3.0 : 2.0; + numVertices = length / numComponents; var compressedLength = numVertices; - var numCompressedComponents = defined(st) && defined(normals) ? 2.0 : 1.0; - numCompressedComponents += defined(tangents) || defined(binormals) ? 1.0 : 0.0; + var numCompressedComponents = hasSt && hasNormal ? 2.0 : 1.0; + numCompressedComponents += hasTangent || hasBitangent ? 1.0 : 0.0; compressedLength *= numCompressedComponents; var compressedAttributes = new Float32Array(compressedLength); var normalIndex = 0; - for (var i = 0; i < numVertices; ++i) { - if (defined(st)) { + for (i = 0; i < numVertices; ++i) { + if (hasSt) { Cartesian2.fromArray(st, i * 2.0, scratchCartesian2); compressedAttributes[normalIndex++] = AttributeCompression.compressTextureCoordinates(scratchCartesian2); } var index = i * 3.0; - if (defined(normals) && defined(tangents) && defined(binormals)) { + if (hasNormal && defined(tangents) && defined(bitangents)) { Cartesian3.fromArray(normals, index, toEncode1); Cartesian3.fromArray(tangents, index, toEncode2); - Cartesian3.fromArray(binormals, index, toEncode3); + Cartesian3.fromArray(bitangents, index, toEncode3); AttributeCompression.octPack(toEncode1, toEncode2, toEncode3, scratchCartesian2); compressedAttributes[normalIndex++] = scratchCartesian2.x; compressedAttributes[normalIndex++] = scratchCartesian2.y; } else { - if (defined(normals)) { + if (hasNormal) { Cartesian3.fromArray(normals, index, toEncode1); compressedAttributes[normalIndex++] = AttributeCompression.octEncodeFloat(toEncode1); } - if (defined(tangents)) { + if (hasTangent) { Cartesian3.fromArray(tangents, index, toEncode1); compressedAttributes[normalIndex++] = AttributeCompression.octEncodeFloat(toEncode1); } - if (defined(binormals)) { - Cartesian3.fromArray(binormals, index, toEncode1); + if (hasBitangent) { + Cartesian3.fromArray(bitangents, index, toEncode1); compressedAttributes[normalIndex++] = AttributeCompression.octEncodeFloat(toEncode1); } } @@ -18120,17 +17659,17 @@ define('Core/GeometryPipeline',[ values : compressedAttributes }); - if (defined(normals)) { + if (hasNormal) { delete geometry.attributes.normal; } - if (defined(st)) { + if (hasSt) { delete geometry.attributes.st; } - if (defined(tangents)) { - delete geometry.attributes.tangent; + if (hasBitangent) { + delete geometry.attributes.bitangent; } - if (defined(binormals)) { - delete geometry.attributes.binormal; + if (hasTangent) { + delete geometry.attributes.tangent; } return geometry; @@ -18547,8 +18086,8 @@ define('Core/GeometryPipeline',[ var s1Scratch = new Cartesian2(); var s2Scratch = new Cartesian2(); - function computeTriangleAttributes(i0, i1, i2, point, positions, normals, binormals, tangents, texCoords, currentAttributes, insertedIndex) { - if (!defined(normals) && !defined(binormals) && !defined(tangents) && !defined(texCoords)) { + function computeTriangleAttributes(i0, i1, i2, point, positions, normals, tangents, bitangents, texCoords, extrudeDirections, currentAttributes, insertedIndex) { + if (!defined(normals) && !defined(tangents) && !defined(bitangents) && !defined(texCoords) && !defined(extrudeDirections)) { return; } @@ -18573,20 +18112,27 @@ define('Core/GeometryPipeline',[ Cartesian3.pack(normal, currentAttributes.normal.values, insertedIndex * 3); } - if (defined(binormals)) { - var b0 = Cartesian3.fromArray(binormals, i0 * 3, p0Scratch); - var b1 = Cartesian3.fromArray(binormals, i1 * 3, p1Scratch); - var b2 = Cartesian3.fromArray(binormals, i2 * 3, p2Scratch); - - Cartesian3.multiplyByScalar(b0, coords.x, b0); - Cartesian3.multiplyByScalar(b1, coords.y, b1); - Cartesian3.multiplyByScalar(b2, coords.z, b2); + if (defined(extrudeDirections)) { + var d0 = Cartesian3.fromArray(extrudeDirections, i0 * 3, p0Scratch); + var d1 = Cartesian3.fromArray(extrudeDirections, i1 * 3, p1Scratch); + var d2 = Cartesian3.fromArray(extrudeDirections, i2 * 3, p2Scratch); - var binormal = Cartesian3.add(b0, b1, b0); - Cartesian3.add(binormal, b2, binormal); - Cartesian3.normalize(binormal, binormal); + Cartesian3.multiplyByScalar(d0, coords.x, d0); + Cartesian3.multiplyByScalar(d1, coords.y, d1); + Cartesian3.multiplyByScalar(d2, coords.z, d2); - Cartesian3.pack(binormal, currentAttributes.binormal.values, insertedIndex * 3); + var direction; + if (!Cartesian3.equals(d0, Cartesian3.ZERO) || !Cartesian3.equals(d1, Cartesian3.ZERO) || !Cartesian3.equals(d2, Cartesian3.ZERO)) { + direction = Cartesian3.add(d0, d1, d0); + Cartesian3.add(direction, d2, direction); + Cartesian3.normalize(direction, direction); + } else { + direction = p0Scratch; + direction.x = 0; + direction.y = 0; + direction.z = 0; + } + Cartesian3.pack(direction, currentAttributes.extrudeDirection.values, insertedIndex * 3); } if (defined(tangents)) { @@ -18605,6 +18151,22 @@ define('Core/GeometryPipeline',[ Cartesian3.pack(tangent, currentAttributes.tangent.values, insertedIndex * 3); } + if (defined(bitangents)) { + var b0 = Cartesian3.fromArray(bitangents, i0 * 3, p0Scratch); + var b1 = Cartesian3.fromArray(bitangents, i1 * 3, p1Scratch); + var b2 = Cartesian3.fromArray(bitangents, i2 * 3, p2Scratch); + + Cartesian3.multiplyByScalar(b0, coords.x, b0); + Cartesian3.multiplyByScalar(b1, coords.y, b1); + Cartesian3.multiplyByScalar(b2, coords.z, b2); + + var bitangent = Cartesian3.add(b0, b1, b0); + Cartesian3.add(bitangent, b2, bitangent); + Cartesian3.normalize(bitangent, bitangent); + + Cartesian3.pack(bitangent, currentAttributes.bitangent.values, insertedIndex * 3); + } + if (defined(texCoords)) { var s0 = Cartesian2.fromArray(texCoords, i0 * 2, s0Scratch); var s1 = Cartesian2.fromArray(texCoords, i1 * 2, s1Scratch); @@ -18649,9 +18211,10 @@ define('Core/GeometryPipeline',[ var attributes = geometry.attributes; var positions = attributes.position.values; var normals = (defined(attributes.normal)) ? attributes.normal.values : undefined; - var binormals = (defined(attributes.binormal)) ? attributes.binormal.values : undefined; + var bitangents = (defined(attributes.bitangent)) ? attributes.bitangent.values : undefined; var tangents = (defined(attributes.tangent)) ? attributes.tangent.values : undefined; var texCoords = (defined(attributes.st)) ? attributes.st.values : undefined; + var extrudeDirections = (defined(attributes.extrudeDirection)) ? attributes.extrudeDirection.values : undefined; var indices = geometry.indices; var eastGeometry = copyGeometryForSplit(geometry); @@ -18705,7 +18268,7 @@ define('Core/GeometryPipeline',[ } insertedIndex = insertSplitPoint(currentAttributes, currentIndices, currentIndexMap, indices, resultIndex < 3 ? i + resultIndex : -1, point); - computeTriangleAttributes(i0, i1, i2, point, positions, normals, binormals, tangents, texCoords, currentAttributes, insertedIndex); + computeTriangleAttributes(i0, i1, i2, point, positions, normals, tangents, bitangents, texCoords, extrudeDirections, currentAttributes, insertedIndex); } } else { if (defined(result)) { @@ -18725,13 +18288,13 @@ define('Core/GeometryPipeline',[ } insertedIndex = insertSplitPoint(currentAttributes, currentIndices, currentIndexMap, indices, i, p0); - computeTriangleAttributes(i0, i1, i2, p0, positions, normals, binormals, tangents, texCoords, currentAttributes, insertedIndex); + computeTriangleAttributes(i0, i1, i2, p0, positions, normals, tangents, bitangents, texCoords, extrudeDirections, currentAttributes, insertedIndex); insertedIndex = insertSplitPoint(currentAttributes, currentIndices, currentIndexMap, indices, i + 1, p1); - computeTriangleAttributes(i0, i1, i2, p1, positions, normals, binormals, tangents, texCoords, currentAttributes, insertedIndex); + computeTriangleAttributes(i0, i1, i2, p1, positions, normals, tangents, bitangents, texCoords, extrudeDirections, currentAttributes, insertedIndex); insertedIndex = insertSplitPoint(currentAttributes, currentIndices, currentIndexMap, indices, i + 2, p2); - computeTriangleAttributes(i0, i1, i2, p2, positions, normals, binormals, tangents, texCoords, currentAttributes, insertedIndex); + computeTriangleAttributes(i0, i1, i2, p2, positions, normals, tangents, bitangents, texCoords, extrudeDirections, currentAttributes, insertedIndex); } } diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createPointGeometry.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createPointGeometry.js index de76b04d..aa71b5e3 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createPointGeometry.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createPointGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,68 +45,6 @@ define('Core/defined',[],function() { return defined; }); -/*global define*/ -define('Core/freezeObject',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Freezes an object, using Object.freeze if available, otherwise returns - * the object unchanged. This function should be used in setup code to prevent - * errors from completely halting JavaScript execution in legacy browsers. - * - * @private - * - * @exports freezeObject - */ - var freezeObject = Object.freeze; - if (!defined(freezeObject)) { - freezeObject = function(o) { - return o; - }; - } - - return freezeObject; -}); - -/*global define*/ -define('Core/defaultValue',[ - './freezeObject' - ], function( - freezeObject) { - 'use strict'; - - /** - * Returns the first parameter if not undefined, otherwise the second parameter. - * Useful for setting a default value for a parameter. - * - * @exports defaultValue - * - * @param {*} a - * @param {*} b - * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter. - * - * @example - * param = Cesium.defaultValue(param, 'default'); - */ - function defaultValue(a, b) { - if (a !== undefined) { - return a; - } - return b; - } - - /** - * A frozen empty object that can be used as the default value for options passed as - * an object literal. - */ - defaultValue.EMPTY_OBJECT = freezeObject({}); - - return defaultValue; -}); - /*global define*/ define('Core/DeveloperError',[ './defined' @@ -188,41 +126,13 @@ define('Core/DeveloperError',[ return DeveloperError; }); -/*global define*/ -define('Core/isArray',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Tests an object to see if it is an array. - * @exports isArray - * - * @param {Object} value The value to test. - * @returns {Boolean} true if the value is an array, false otherwise. - */ - var isArray = Array.isArray; - if (!defined(isArray)) { - isArray = function(value) { - return Object.prototype.toString.call(value) === '[object Array]'; - }; - } - - return isArray; -}); - /*global define*/ define('Core/Check',[ - './defaultValue', - './defined', - './DeveloperError', - './isArray' + './defined', + './DeveloperError' ], function( - defaultValue, defined, - DeveloperError, - isArray) { + DeveloperError) { 'use strict'; /** @@ -237,111 +147,134 @@ define('Core/Check',[ */ Check.typeOf = {}; - /** - * Contains functions for checking numeric conditions such as minimum and maximum values - */ - Check.numeric = {}; - function getUndefinedErrorMessage(name) { - return name + ' was required but undefined.'; + return name + ' is required, actual value was undefined'; } function getFailedTypeErrorMessage(actual, expected, name) { - return 'Expected ' + name + ' to be typeof ' + expected + ', got ' + actual; + return 'Expected ' + name + ' to be typeof ' + expected + ', actual typeof was ' + actual; } /** * Throws if test is not defined * - * @param {*} test The value that is to be checked * @param {String} name The name of the variable being tested + * @param {*} test The value that is to be checked * @exception {DeveloperError} test must be defined */ - Check.defined = function (test, name) { + Check.defined = function (name, test) { if (!defined(test)) { throw new DeveloperError(getUndefinedErrorMessage(name)); } }; /** - * Throws if test is greater than maximum + * Throws if test is not typeof 'function' * - * @param {Number} test The value to test - * @param {Number} maximum The maximum allowed value - * @exception {DeveloperError} test must not be greater than maximum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'function' */ - Check.numeric.maximum = function (test, maximum) { - Check.typeOf.number(test); - Check.typeOf.number(maximum); - if (test > maximum) { - throw new DeveloperError('Expected ' + test + ' to be at most ' + maximum); + Check.typeOf.func = function (name, test) { + if (typeof test !== 'function') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); } }; /** - * Throws if test is less than minimum + * Throws if test is not typeof 'string' * - * @param {Number} test The value to test - * @param {Number} minimum The minimum allowed value - * @exception {DeveloperError} test must not be less than mininum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'string' */ - Check.numeric.minimum = function (test, minimum) { - Check.typeOf.number(test); - Check.typeOf.number(minimum); - if (test < minimum) { - throw new DeveloperError('Expected ' + test + ' to be at least ' + minimum); + Check.typeOf.string = function (name, test) { + if (typeof test !== 'string') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); } }; /** - * Throws if test is not typeof 'function' + * Throws if test is not typeof 'number' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'function' + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'number' */ - Check.typeOf.function = function (test, name) { - if (typeof test !== 'function') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); + Check.typeOf.number = function (name, test) { + if (typeof test !== 'number') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); } }; /** - * Throws if test is not typeof 'string' + * Throws if test is not typeof 'number' and less than limit * + * @param {String} name The name of the variable being tested * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than limit + */ + Check.typeOf.number.lessThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test >= limit) { + throw new DeveloperError('Expected ' + name + ' to be less than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and less than or equal to limit + * * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'string' + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than or equal to limit */ - Check.typeOf.string = function (test, name) { - if (typeof test !== 'string') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); + Check.typeOf.number.lessThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test > limit) { + throw new DeveloperError('Expected ' + name + ' to be less than or equal to ' + limit + ', actual value was ' + test); } }; /** - * Throws if test is not typeof 'number' + * Throws if test is not typeof 'number' and greater than limit * + * @param {String} name The name of the variable being tested * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than limit + */ + Check.typeOf.number.greaterThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test <= limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and greater than or equal to limit + * * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'number' + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than or equal to limit */ - Check.typeOf.number = function (test, name) { - if (typeof test !== 'number') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); + Check.typeOf.number.greaterThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test < limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than or equal to' + limit + ', actual value was ' + test); } }; /** * Throws if test is not typeof 'object' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested + * @param {*} test The value to test * @exception {DeveloperError} test must be typeof 'object' */ - Check.typeOf.object = function (test, name) { + Check.typeOf.object = function (name, test) { if (typeof test !== 'object') { throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'object', name)); } @@ -350,11 +283,11 @@ define('Core/Check',[ /** * Throws if test is not typeof 'boolean' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested + * @param {*} test The value to test * @exception {DeveloperError} test must be typeof 'boolean' */ - Check.typeOf.boolean = function (test, name) { + Check.typeOf.bool = function (name, test) { if (typeof test !== 'boolean') { throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'boolean', name)); } @@ -363,6 +296,68 @@ define('Core/Check',[ return Check; }); +/*global define*/ +define('Core/freezeObject',[ + './defined' + ], function( + defined) { + 'use strict'; + + /** + * Freezes an object, using Object.freeze if available, otherwise returns + * the object unchanged. This function should be used in setup code to prevent + * errors from completely halting JavaScript execution in legacy browsers. + * + * @private + * + * @exports freezeObject + */ + var freezeObject = Object.freeze; + if (!defined(freezeObject)) { + freezeObject = function(o) { + return o; + }; + } + + return freezeObject; +}); + +/*global define*/ +define('Core/defaultValue',[ + './freezeObject' + ], function( + freezeObject) { + 'use strict'; + + /** + * Returns the first parameter if not undefined, otherwise the second parameter. + * Useful for setting a default value for a parameter. + * + * @exports defaultValue + * + * @param {*} a + * @param {*} b + * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter. + * + * @example + * param = Cesium.defaultValue(param, 'default'); + */ + function defaultValue(a, b) { + if (a !== undefined) { + return a; + } + return b; + } + + /** + * A frozen empty object that can be used as the default value for options passed as + * an object literal. + */ + defaultValue.EMPTY_OBJECT = freezeObject({}); + + return defaultValue; +}); + /* I've wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace so it's better encapsulated. Now you can have multiple random number generators @@ -1047,7 +1042,7 @@ define('Core/Math',[ if (!defined(angle)) { throw new DeveloperError('angle is required.'); } - + return CesiumMath.clamp(angle, -1*CesiumMath.PI_OVER_TWO, CesiumMath.PI_OVER_TWO); }; @@ -1057,11 +1052,11 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [<code>-CesiumMath.PI</code>, <code>CesiumMath.PI</code>]. */ - CesiumMath.negativePiToPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.negativePiToPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - return CesiumMath.zeroToTwoPi(x + CesiumMath.PI) - CesiumMath.PI; + return CesiumMath.zeroToTwoPi(angle + CesiumMath.PI) - CesiumMath.PI; }; /** @@ -1070,12 +1065,12 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [0, <code>CesiumMath.TWO_PI</code>]. */ - CesiumMath.zeroToTwoPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.zeroToTwoPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - var mod = CesiumMath.mod(x, CesiumMath.TWO_PI); - if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(x) > CesiumMath.EPSILON14) { + var mod = CesiumMath.mod(angle, CesiumMath.TWO_PI); + if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(angle) > CesiumMath.EPSILON14) { return CesiumMath.TWO_PI; } return mod; @@ -1145,7 +1140,7 @@ define('Core/Math',[ * @example * //Compute 7!, which is equal to 5040 * var computedFactorial = Cesium.Math.factorial(7); - * + * * @see {@link http://en.wikipedia.org/wiki/Factorial|Factorial on Wikipedia} */ CesiumMath.factorial = function(n) { @@ -1429,7 +1424,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.fromSpherical = function(spherical, result) { - Check.typeOf.object(spherical, 'spherical'); + Check.typeOf.object('spherical', spherical); if (!defined(result)) { result = new Cartesian3(); @@ -1513,8 +1508,8 @@ define('Core/Cartesian3',[ * @returns {Number[]} The array that was packed into */ Cartesian3.pack = function(value, array, startingIndex) { - Check.typeOf.object(value, 'value'); - Check.defined(array, 'array'); + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1534,7 +1529,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.unpack = function(array, startingIndex, result) { - Check.defined(array, 'array'); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1555,7 +1550,7 @@ define('Core/Cartesian3',[ * @returns {Number[]} The packed array. */ Cartesian3.packArray = function(array, result) { - Check.defined(array, 'array'); + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -1578,8 +1573,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3[]} The unpacked array. */ Cartesian3.unpackArray = function(array, result) { - Check.defined(array, 'array'); - Check.numeric.minimum(array.length, 3); + Check.defined('array', array); + Check.typeOf.number.greaterThanOrEquals('array.length', array.length, 3); if (array.length % 3 !== 0) { throw new DeveloperError('array length must be a multiple of 3.'); } @@ -1625,7 +1620,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the maximum component. */ Cartesian3.maximumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z); }; @@ -1637,7 +1632,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the minimum component. */ Cartesian3.minimumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z); }; @@ -1651,9 +1646,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the minimum components. */ Cartesian3.minimumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -1671,9 +1666,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the maximum components. */ Cartesian3.maximumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -1688,7 +1683,7 @@ define('Core/Cartesian3',[ * @returns {Number} The squared magnitude. */ Cartesian3.magnitudeSquared = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z; }; @@ -1717,8 +1712,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distance(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(2.0, 0.0, 0.0)); */ Cartesian3.distance = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitude(distanceScratch); @@ -1737,8 +1732,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distanceSquared(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(3.0, 0.0, 0.0)); */ Cartesian3.distanceSquared = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitudeSquared(distanceScratch); @@ -1752,8 +1747,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.normalize = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian3.magnitude(cartesian); @@ -1776,8 +1771,8 @@ define('Core/Cartesian3',[ * @returns {Number} The dot product. */ Cartesian3.dot = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z; }; @@ -1791,9 +1786,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyComponents = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -1835,9 +1830,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.add = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -1854,9 +1849,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.subtract = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -1873,9 +1868,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -1892,9 +1887,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.divideByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -1910,8 +1905,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.negate = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -1927,8 +1922,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.abs = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -1947,10 +1942,10 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.lerp = function(start, end, t, result) { - Check.typeOf.object(start, 'start'); - Check.typeOf.object(end, 'end'); - Check.typeOf.number(t, 't'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian3.multiplyByScalar(end, t, lerpScratch); result = Cartesian3.multiplyByScalar(start, 1.0 - t, result); @@ -1967,8 +1962,8 @@ define('Core/Cartesian3',[ * @returns {Number} The angle between the Cartesians. */ Cartesian3.angleBetween = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.normalize(left, angleBetweenScratch); Cartesian3.normalize(right, angleBetweenScratch2); @@ -1986,8 +1981,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The most orthogonal axis. */ Cartesian3.mostOrthogonalAxis = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian3.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian3.abs(f, f); @@ -2064,9 +2059,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The cross product. */ Cartesian3.cross = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var leftX = left.x; var leftY = left.y; @@ -2099,8 +2094,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromDegrees(-115.0, 37.0); */ Cartesian3.fromDegrees = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); longitude = CesiumMath.toRadians(longitude); latitude = CesiumMath.toRadians(latitude); @@ -2125,8 +2120,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromRadians(-2.007, 0.645); */ Cartesian3.fromRadians = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); height = defaultValue(height, 0.0); var radiiSquared = defined(ellipsoid) ? ellipsoid.radiiSquared : wgs84RadiiSquared; @@ -2160,7 +2155,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArray([-115.0, 37.0, -107.0, 33.0]); */ Cartesian3.fromDegreesArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -2194,7 +2189,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArray([-2.007, 0.645, -1.867, .575]); */ Cartesian3.fromRadiansArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -2228,7 +2223,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArrayHeights([-115.0, 37.0, 100000.0, -107.0, 33.0, 150000.0]); */ Cartesian3.fromDegreesArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -2263,7 +2258,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArrayHeights([-2.007, 0.645, 100000.0, -1.867, .575, 150000.0]); */ Cartesian3.fromRadiansArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -3010,7 +3005,9 @@ define('Core/Ellipsoid',[ /** * Computes an Ellipsoid from a Cartesian specifying the radii in x, y, and z directions. * - * @param {Cartesian3} [radii=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Cartesian3} [cartesian=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new + * instance should be created. * @returns {Ellipsoid} A new Ellipsoid instance. * * @exception {DeveloperError} All radii components must be greater than or equal to zero. @@ -3650,6 +3647,7 @@ define('Core/Interval',[ /*global define*/ define('Core/Matrix3',[ './Cartesian3', + './Check', './defaultValue', './defined', './defineProperties', @@ -3658,6 +3656,7 @@ define('Core/Matrix3',[ './Math' ], function( Cartesian3, + Check, defaultValue, defined, defineProperties, @@ -3720,13 +3719,8 @@ define('Core/Matrix3',[ * @returns {Number[]} The array that was packed into */ Matrix3.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3752,9 +3746,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. */ Matrix3.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3781,24 +3773,24 @@ define('Core/Matrix3',[ * @param {Matrix3} [result] The object onto which to store the result. * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. (Returns undefined if matrix is undefined) */ - Matrix3.clone = function(values, result) { - if (!defined(values)) { + Matrix3.clone = function(matrix, result) { + if (!defined(matrix)) { return undefined; } if (!defined(result)) { - return new Matrix3(values[0], values[3], values[6], - values[1], values[4], values[7], - values[2], values[5], values[8]); + return new Matrix3(matrix[0], matrix[3], matrix[6], + matrix[1], matrix[4], matrix[7], + matrix[2], matrix[5], matrix[8]); } - result[0] = values[0]; - result[1] = values[1]; - result[2] = values[2]; - result[3] = values[3]; - result[4] = values[4]; - result[5] = values[5]; - result[6] = values[6]; - result[7] = values[7]; - result[8] = values[8]; + result[0] = matrix[0]; + result[1] = matrix[1]; + result[2] = matrix[2]; + result[3] = matrix[3]; + result[4] = matrix[4]; + result[5] = matrix[5]; + result[6] = matrix[6]; + result[7] = matrix[7]; + result[8] = matrix[8]; return result; }; @@ -3824,9 +3816,7 @@ define('Core/Matrix3',[ * var m2 = Cesium.Matrix3.fromArray(v2, 2); */ Matrix3.fromArray = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3854,9 +3844,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values parameter is required'); - } + Check.defined('values', values); return Matrix3.clone(values, result); }; @@ -3870,9 +3858,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix3(values[0], values[1], values[2], @@ -3899,9 +3885,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this quaternion. */ Matrix3.fromQuaternion = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); var x2 = quaternion.x * quaternion.x; var xy = quaternion.x * quaternion.y; @@ -3951,10 +3935,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this headingPitchRoll. */ Matrix3.fromHeadingPitchRoll = function(headingPitchRoll, result) { - if (!defined(headingPitchRoll)) { - throw new DeveloperError('headingPitchRoll is required'); - } - var cosTheta = Math.cos(-headingPitchRoll.pitch); + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + + var cosTheta = Math.cos(-headingPitchRoll.pitch); var cosPsi = Math.cos(-headingPitchRoll.heading); var cosPhi = Math.cos(headingPitchRoll.roll); var sinTheta = Math.sin(-headingPitchRoll.pitch); @@ -4005,9 +3988,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix3( @@ -4043,9 +4024,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromUniformScale(2.0); */ Matrix3.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix3( @@ -4069,7 +4048,7 @@ define('Core/Matrix3',[ /** * Computes a Matrix3 instance representing the cross product equivalent matrix of a Cartesian3 vector. * - * @param {Cartesian3} the vector on the left hand side of the cross product operation. + * @param {Cartesian3} vector the vector on the left hand side of the cross product operation. * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created. * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. * @@ -4081,9 +4060,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromCrossProduct(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromCrossProduct = function(vector, result) { - if (!defined(vector)) { - throw new DeveloperError('vector is required.'); - } + Check.typeOf.object('vector', vector); if (!defined(result)) { return new Matrix3( @@ -4118,9 +4095,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationX = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4159,9 +4134,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationY = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4200,9 +4173,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationZ = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4236,9 +4207,7 @@ define('Core/Matrix3',[ * @returns {Number[]} The modified Array parameter or a new Array instance if one was not provided. */ Matrix3.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5], matrix[6], matrix[7], matrix[8]]; @@ -4272,12 +4241,10 @@ define('Core/Matrix3',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix3.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 2) { - throw new DeveloperError('row must be 0, 1, or 2.'); - } - if (typeof column !== 'number' || column < 0 || column > 2) { - throw new DeveloperError('column must be 0, 1, or 2.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 2); + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 2); return column * 3 + row; }; @@ -4293,16 +4260,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var startIndex = index * 3; var x = matrix[startIndex]; @@ -4327,18 +4288,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); var startIndex = index * 3; @@ -4359,15 +4313,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 3]; @@ -4391,18 +4340,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); result[index] = cartesian.x; @@ -4421,12 +4363,8 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[3], matrix[4], matrix[5], scratchColumn)); @@ -4457,15 +4395,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var column0Row0 = left[0] * right[0] + left[3] * right[1] + left[6] * right[2]; var column0Row1 = left[1] * right[0] + left[4] * right[1] + left[7] * right[2]; @@ -4500,15 +4432,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -4531,15 +4457,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -4562,15 +4482,9 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -4595,15 +4509,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -4634,15 +4542,9 @@ define('Core/Matrix3',[ * @see Matrix3.multiplyByUniformScale */ Matrix3.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); result[0] = matrix[0] * scale.x; result[1] = matrix[1] * scale.x; @@ -4664,12 +4566,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -4691,12 +4589,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var column0Row0 = matrix[0]; var column0Row1 = matrix[3]; @@ -4836,9 +4730,7 @@ define('Core/Matrix3',[ * var c = Cesium.Cartesian3.multiplyByScalar(v, lambda, new Cesium.Cartesian3()); // equal to Cesium.Matrix3.multiplyByVector(a, v) */ Matrix3.computeEigenDecomposition = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); // This routine was created based upon Matrix Computations, 3rd ed., by Golub and Van Loan, // section 8.4.3 The Classical Jacobi Algorithm @@ -4882,12 +4774,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -4909,9 +4797,7 @@ define('Core/Matrix3',[ * @returns {Number} The value of the determinant of the matrix. */ Matrix3.determinant = function(matrix) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); var m11 = matrix[0]; var m21 = matrix[3]; @@ -4936,12 +4822,8 @@ define('Core/Matrix3',[ * @exception {DeveloperError} matrix is not invertible. */ Matrix3.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var m11 = matrix[0]; var m21 = matrix[1]; @@ -5007,9 +4889,7 @@ define('Core/Matrix3',[ * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. */ Matrix3.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -5197,12 +5077,14 @@ define('Core/Matrix3',[ /*global define*/ define('Core/Cartesian4',[ + './Check', './defaultValue', './defined', './DeveloperError', './freezeObject', './Math' ], function( + Check, defaultValue, defined, DeveloperError, @@ -5285,9 +5167,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.fromColor = function(color, result) { - if (!defined(color)) { - throw new DeveloperError('color is required'); - } + Check.typeOf.object('color', color); if (!defined(result)) { return new Cartesian4(color.red, color.green, color.blue, color.alpha); } @@ -5339,12 +5219,8 @@ define('Core/Cartesian4',[ * @returns {Number[]} The array that was packed into */ Cartesian4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5365,9 +5241,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5389,9 +5263,7 @@ define('Core/Cartesian4',[ * @returns {Number[]} The packed array. */ Cartesian4.packArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -5414,9 +5286,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4[]} The unpacked array. */ Cartesian4.unpackArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -5459,9 +5329,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the maximum component. */ Cartesian4.maximumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -5473,9 +5341,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the minimum component. */ Cartesian4.minimumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -5489,15 +5355,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the minimum components. */ Cartesian4.minimumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -5516,15 +5376,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the maximum components. */ Cartesian4.maximumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -5541,9 +5395,7 @@ define('Core/Cartesian4',[ * @returns {Number} The squared magnitude. */ Cartesian4.magnitudeSquared = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z + cartesian.w * cartesian.w; }; @@ -5574,9 +5426,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(2.0, 0.0, 0.0, 0.0)); */ Cartesian4.distance = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitude(distanceScratch); @@ -5597,9 +5448,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(3.0, 0.0, 0.0, 0.0)); */ Cartesian4.distanceSquared = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitudeSquared(distanceScratch); @@ -5613,12 +5463,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.normalize = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian4.magnitude(cartesian); @@ -5642,12 +5488,8 @@ define('Core/Cartesian4',[ * @returns {Number} The dot product. */ Cartesian4.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w; }; @@ -5661,15 +5503,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -5687,15 +5523,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x / right.x; result.y = left.y / right.y; @@ -5713,15 +5543,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -5739,15 +5563,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -5765,15 +5583,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -5791,15 +5603,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -5816,12 +5622,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.negate = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -5838,12 +5640,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.abs = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -5863,18 +5661,10 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian4.multiplyByScalar(end, t, lerpScratch); result = Cartesian4.multiplyByScalar(start, 1.0 - t, result); @@ -5890,12 +5680,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The most orthogonal axis. */ Cartesian4.mostOrthogonalAxis = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian4.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian4.abs(f, f); @@ -6140,6 +5926,7 @@ define('Core/RuntimeError',[ define('Core/Matrix4',[ './Cartesian3', './Cartesian4', + './Check', './defaultValue', './defined', './defineProperties', @@ -6151,6 +5938,7 @@ define('Core/Matrix4',[ ], function( Cartesian3, Cartesian4, + Check, defaultValue, defined, defineProperties, @@ -6241,13 +6029,8 @@ define('Core/Matrix4',[ * @returns {Number[]} The array that was packed into */ Matrix4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -6280,9 +6063,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if one was not provided. */ Matrix4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -6378,9 +6159,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required'); - } + Check.defined('values', values); return Matrix4.clone(values, result); }; @@ -6394,9 +6173,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix4(values[0], values[1], values[2], values[3], @@ -6433,9 +6210,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRotationTranslation = function(rotation, translation, result) { - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } + Check.typeOf.object('rotation', rotation); translation = defaultValue(translation, Cartesian3.ZERO); @@ -6483,15 +6258,9 @@ define('Core/Matrix4',[ * result); */ Matrix4.fromTranslationQuaternionRotationScale = function(translation, rotation, scale, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('translation', translation); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('scale', scale); if (!defined(result)) { result = new Matrix4(); @@ -6552,9 +6321,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromTranslationRotationScale = function(translationRotationScale, result) { - if (!defined(translationRotationScale)) { - throw new DeveloperError('translationRotationScale is required.'); - } + Check.typeOf.object('translationRotationScale', translationRotationScale); return Matrix4.fromTranslationQuaternionRotationScale(translationRotationScale.translation, translationRotationScale.rotation, translationRotationScale.scale, result); }; @@ -6569,9 +6336,7 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByTranslation */ Matrix4.fromTranslation = function(translation, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } + Check.typeOf.object('translation', translation); return Matrix4.fromRotationTranslation(Matrix3.IDENTITY, translation, result); }; @@ -6592,9 +6357,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix4.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix4( @@ -6639,9 +6402,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromUniformScale(2.0); */ Matrix4.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix4(scale, 0.0, 0.0, 0.0, @@ -6681,23 +6442,15 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromCamera = function(camera, result) { - if (!defined(camera)) { - throw new DeveloperError('camera is required.'); - } + Check.typeOf.object('camera', camera); var position = camera.position; var direction = camera.direction; var up = camera.up; - if (!defined(position)) { - throw new DeveloperError('camera.position is required.'); - } - if (!defined(direction)) { - throw new DeveloperError('camera.direction is required.'); - } - if (!defined(up)) { - throw new DeveloperError('camera.up is required.'); - } + Check.typeOf.object('camera.position', position); + Check.typeOf.object('camera.direction', direction); + Check.typeOf.object('camera.up', up); Cartesian3.normalize(direction, fromCameraF); Cartesian3.normalize(Cartesian3.cross(fromCameraF, up, fromCameraR), fromCameraR); @@ -6776,21 +6529,11 @@ define('Core/Matrix4',[ * @exception {DeveloperError} far must be greater than zero. */ Matrix4.computePerspectiveFieldOfView = function(fovY, aspectRatio, near, far, result) { - if (fovY <= 0.0 || fovY > Math.PI) { - throw new DeveloperError('fovY must be in (0, PI].'); - } - if (aspectRatio <= 0.0) { - throw new DeveloperError('aspectRatio must be greater than zero.'); - } - if (near <= 0.0) { - throw new DeveloperError('near must be greater than zero.'); - } - if (far <= 0.0) { - throw new DeveloperError('far must be greater than zero.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThan('fovY', fovY, 0.0); + Check.typeOf.number.lessThan('fovY', fovY, Math.PI); + Check.typeOf.number.greaterThan('near', near, 0.0); + Check.typeOf.number.greaterThan('far', far, 0.0); + Check.typeOf.object('result', result); var bottom = Math.tan(fovY * 0.5); @@ -6831,27 +6574,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeOrthographicOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var a = 1.0 / (right - left); var b = 1.0 / (top - bottom); @@ -6896,27 +6625,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computePerspectiveOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -6957,24 +6672,12 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeInfinitePerspectiveOffCenter = function(left, right, bottom, top, near, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -7022,9 +6725,7 @@ define('Core/Matrix4',[ * }, 0.0, 1.0, new Cesium.Matrix4()); */ Matrix4.computeViewportTransformation = function(viewport, nearDepthRange, farDepthRange, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); viewport = defaultValue(viewport, defaultValue.EMPTY_OBJECT); var x = defaultValue(viewport.x, 0.0); @@ -7076,21 +6777,11 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeView = function(position, direction, up, right, result) { - if (!defined(position)) { - throw new DeveloperError('position is required'); - } - if (!defined(direction)) { - throw new DeveloperError('direction is required'); - } - if (!defined(up)) { - throw new DeveloperError('up is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); + Check.typeOf.object('up', up); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = right.x; result[1] = up.x; @@ -7131,9 +6822,7 @@ define('Core/Matrix4',[ * //creates a = [10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0] */ Matrix4.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], @@ -7177,12 +6866,11 @@ define('Core/Matrix4',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix4.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 3) { - throw new DeveloperError('row must be 0, 1, 2, or 3.'); - } - if (typeof column !== 'number' || column < 0 || column > 3) { - throw new DeveloperError('column must be 0, 1, 2, or 3.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 3); + + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 3); return column * 4 + row; }; @@ -7215,16 +6903,12 @@ define('Core/Matrix4',[ * // a.x = 12.0; a.y = 16.0; a.z = 20.0; a.w = 24.0; */ Matrix4.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var startIndex = index * 4; var x = matrix[startIndex]; @@ -7266,18 +6950,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 96.0, 25.0] */ Matrix4.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); var startIndex = index * 4; @@ -7295,18 +6974,12 @@ define('Core/Matrix4',[ * @param {Matrix4} matrix The matrix to use. * @param {Cartesian3} translation The translation that replaces the translation of the provided matrix. * @param {Cartesian4} result The object onto which to store the result. - * @returns {Matrix4} The modified result parameter. - */ - Matrix4.setTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + * @returns {Matrix4} The modified result parameter. + */ + Matrix4.setTranslation = function(matrix, translation, result) { + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -7359,16 +7032,12 @@ define('Core/Matrix4',[ * // a.x = 18.0; a.y = 19.0; a.z = 20.0; a.w = 21.0; */ Matrix4.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 4]; @@ -7409,18 +7078,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 24.0, 25.0] */ Matrix4.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); result[index] = cartesian.x; @@ -7440,12 +7104,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter */ Matrix4.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[4], matrix[5], matrix[6], scratchColumn)); @@ -7477,15 +7137,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -7569,15 +7223,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -7607,15 +7255,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -7656,15 +7298,9 @@ define('Core/Matrix4',[ * var m3 = Cesium.Matrix4.multiplyTransformation(m1, m2, new Cesium.Matrix4()); */ Matrix4.multiplyTransformation = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -7742,15 +7378,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByMatrix3(m, rotation, m); */ Matrix4.multiplyByMatrix3 = function(matrix, rotation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('result', result); var left0 = matrix[0]; var left1 = matrix[1]; @@ -7818,15 +7448,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByTranslation(m, position, m); */ Matrix4.multiplyByTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); var x = translation.x; var y = translation.y; @@ -7878,15 +7502,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByScale */ Matrix4.multiplyByUniformScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scale', scale); + Check.typeOf.object('result', result); uniformScaleScratch.x = scale; uniformScaleScratch.y = scale; @@ -7915,15 +7533,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByUniformScale */ Matrix4.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); var scaleX = scale.x; var scaleY = scale.y; @@ -7962,15 +7574,9 @@ define('Core/Matrix4',[ * @returns {Cartesian4} The modified result parameter. */ Matrix4.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8006,15 +7612,9 @@ define('Core/Matrix4',[ * // Cesium.Matrix4.multiplyByVector(matrix, new Cesium.Cartesian4(p.x, p.y, p.z, 0.0), result); */ Matrix4.multiplyByPointAsVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8044,16 +7644,9 @@ define('Core/Matrix4',[ * var result = Cesium.Matrix4.multiplyByPoint(matrix, p, new Cesium.Cartesian3()); */ Matrix4.multiplyByPoint = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8093,15 +7686,9 @@ define('Core/Matrix4',[ * // [-44.0, -46.0, -48.0, -50.0] */ Matrix4.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -8145,12 +7732,8 @@ define('Core/Matrix4',[ * // [-22.0, -23.0, -24.0, -25.0] */ Matrix4.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -8194,12 +7777,8 @@ define('Core/Matrix4',[ * // [13.0, 17.0, 21.0, 25.0] */ Matrix4.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var matrix1 = matrix[1]; var matrix2 = matrix[2]; @@ -8235,12 +7814,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -8354,9 +7929,7 @@ define('Core/Matrix4',[ * //Prints "Difference between both the matrices is not less than 0.1" on the console */ Matrix4.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -8387,12 +7960,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter. */ Matrix4.getTranslation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = matrix[12]; result.y = matrix[13]; @@ -8423,12 +7992,8 @@ define('Core/Matrix4',[ * // [12.0, 16.0, 20.0] */ Matrix4.getRotation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -8460,12 +8025,8 @@ define('Core/Matrix4',[ * @exception {RuntimeError} matrix is not invertible because its determinate is zero. */ Matrix4.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); // Special case for a zero scale matrix that can occur, for example, // when a model's node has a [0, 0, 0] scale. @@ -8603,12 +8164,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.inverseTransformation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); //This function is an optimized version of the below 4 lines. //var rT = Matrix3.transpose(Matrix4.getRotation(matrix)); @@ -8892,6 +8449,7 @@ define('Core/Matrix4',[ /*global define*/ define('Core/Rectangle',[ './Cartographic', + './Check', './defaultValue', './defined', './defineProperties', @@ -8901,6 +8459,7 @@ define('Core/Rectangle',[ './Math' ], function( Cartographic, + Check, defaultValue, defined, defineProperties, @@ -8997,13 +8556,8 @@ define('Core/Rectangle',[ * @returns {Number[]} The array that was packed into */ Rectangle.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -9024,9 +8578,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -9047,9 +8599,7 @@ define('Core/Rectangle',[ * @returns {Number} The width. */ Rectangle.computeWidth = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; if (east < west) { @@ -9064,9 +8614,7 @@ define('Core/Rectangle',[ * @returns {Number} The height. */ Rectangle.computeHeight = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); return rectangle.north - rectangle.south; }; @@ -9101,6 +8649,32 @@ define('Core/Rectangle',[ return result; }; + /** + * Creates an rectangle given the boundary longitude and latitude in radians. + * + * @param {Number} [west=0.0] The westernmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [south=0.0] The southernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Number} [east=0.0] The easternmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [north=0.0] The northernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Rectangle} [result] The object onto which to store the result, or undefined if a new instance should be created. + * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. + * + * @example + * var rectangle = Cesium.Rectangle.fromRadians(0.0, Math.PI/4, Math.PI/8, 3*Math.PI/4); + */ + Rectangle.fromRadians = function(west, south, east, north, result) { + if (!defined(result)) { + return new Rectangle(west, south, east, north); + } + + result.west = defaultValue(west, 0.0); + result.south = defaultValue(south, 0.0); + result.east = defaultValue(east, 0.0); + result.north = defaultValue(north, 0.0); + + return result; + }; + /** * Creates the smallest possible Rectangle that encloses all positions in the provided array. * @@ -9109,9 +8683,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartographicArray = function(cartographics, result) { - if (!defined(cartographics)) { - throw new DeveloperError('cartographics is required.'); - } + Check.defined('cartographics', cartographics); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -9164,9 +8736,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartesianArray = function(cartesians, ellipsoid, result) { - if (!defined(cartesians)) { - throw new DeveloperError('cartesians is required.'); - } + Check.defined('cartesians', cartesians); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -9282,9 +8852,7 @@ define('Core/Rectangle',[ * @returns {Boolean} <code>true</code> if the Rectangles are within the provided epsilon, <code>false</code> otherwise. */ Rectangle.prototype.equalsEpsilon = function(other, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon is required and must be a number.'); - } + Check.typeOf.number('epsilon', epsilon); return defined(other) && (Math.abs(this.west - other.west) <= epsilon) && @@ -9304,45 +8872,23 @@ define('Core/Rectangle',[ * @exception {DeveloperError} <code>west</code> must be in the interval [<code>-Pi</code>, <code>Pi</code>]. */ Rectangle.validate = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var north = rectangle.north; - if (typeof north !== 'number') { - throw new DeveloperError('north is required to be a number.'); - } - - if (north < -CesiumMath.PI_OVER_TWO || north > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('north must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('north', north, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('north', north, CesiumMath.PI_OVER_TWO); var south = rectangle.south; - if (typeof south !== 'number') { - throw new DeveloperError('south is required to be a number.'); - } - - if (south < -CesiumMath.PI_OVER_TWO || south > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('south must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('south', south, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('south', south, CesiumMath.PI_OVER_TWO); var west = rectangle.west; - if (typeof west !== 'number') { - throw new DeveloperError('west is required to be a number.'); - } - - if (west < -Math.PI || west > Math.PI) { - throw new DeveloperError('west must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('west', west, -Math.PI); + Check.typeOf.number.lessThanOrEquals('west', west, Math.PI); var east = rectangle.east; - if (typeof east !== 'number') { - throw new DeveloperError('east is required to be a number.'); - } - - if (east < -Math.PI || east > Math.PI) { - throw new DeveloperError('east must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('east', east, -Math.PI); + Check.typeOf.number.lessThanOrEquals('east', east, Math.PI); }; /** @@ -9353,9 +8899,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.south); @@ -9374,9 +8918,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.north); @@ -9395,9 +8937,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.north); @@ -9416,9 +8956,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.south); @@ -9437,9 +8975,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.center = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; @@ -9474,12 +9010,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.intersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var rectangleEast = rectangle.east; var rectangleWest = rectangle.west; @@ -9535,12 +9067,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.simpleIntersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var west = Math.max(rectangle.west, otherRectangle.west); var south = Math.max(rectangle.south, otherRectangle.south); @@ -9571,12 +9099,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.union = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); if (!defined(result)) { result = new Rectangle(); @@ -9620,12 +9144,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.expand = function(rectangle, cartographic, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); if (!defined(result)) { result = new Rectangle(); @@ -9647,12 +9167,8 @@ define('Core/Rectangle',[ * @returns {Boolean} true if the provided cartographic is inside the rectangle, false otherwise. */ Rectangle.contains = function(rectangle, cartographic) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); var longitude = cartographic.longitude; var latitude = cartographic.latitude; @@ -9685,9 +9201,7 @@ define('Core/Rectangle',[ * @returns {Cartesian3[]} The modified result parameter or a new Array of Cartesians instances if none was provided. */ Rectangle.subsample = function(rectangle, ellipsoid, surfaceHeight, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84); surfaceHeight = defaultValue(surfaceHeight, 0.0); @@ -9765,9 +9279,9 @@ define('Core/Rectangle',[ define('Core/BoundingSphere',[ './Cartesian3', './Cartographic', + './Check', './defaultValue', './defined', - './DeveloperError', './Ellipsoid', './GeographicProjection', './Intersect', @@ -9778,9 +9292,9 @@ define('Core/BoundingSphere',[ ], function( Cartesian3, Cartographic, + Check, defaultValue, defined, - DeveloperError, Ellipsoid, GeographicProjection, Intersect, @@ -10110,9 +9624,7 @@ define('Core/BoundingSphere',[ stride = defaultValue(stride, 3); - if (stride < 3) { - throw new DeveloperError('stride must be 3 or greater.'); - } + Check.typeOf.number.greaterThanOrEquals('stride', stride, 3); var currentPos = fromPointsCurrentPos; currentPos.x = positions[0] + center.x; @@ -10416,9 +9928,8 @@ define('Core/BoundingSphere',[ * var sphere = Cesium.BoundingSphere.fromCornerPoints(new Cesium.Cartesian3(-0.5, -0.5, -0.5), new Cesium.Cartesian3(0.5, 0.5, 0.5)); */ BoundingSphere.fromCornerPoints = function(corner, oppositeCorner, result) { - if (!defined(corner) || !defined(oppositeCorner)) { - throw new DeveloperError('corner and oppositeCorner are required.'); - } + Check.typeOf.object('corner', corner); + Check.typeOf.object('oppositeCorner', oppositeCorner); if (!defined(result)) { result = new BoundingSphere(); @@ -10442,9 +9953,7 @@ define('Core/BoundingSphere',[ * var boundingSphere = Cesium.BoundingSphere.fromEllipsoid(ellipsoid); */ BoundingSphere.fromEllipsoid = function(ellipsoid, result) { - if (!defined(ellipsoid)) { - throw new DeveloperError('ellipsoid is required.'); - } + Check.typeOf.object('ellipsoid', ellipsoid); if (!defined(result)) { result = new BoundingSphere(); @@ -10570,13 +10079,8 @@ define('Core/BoundingSphere',[ * @returns {Number[]} The array that was packed into */ BoundingSphere.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -10598,9 +10102,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if one was not provided. */ BoundingSphere.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -10627,13 +10129,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.union = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); if (!defined(result)) { result = new BoundingSphere(); @@ -10682,13 +10179,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.expand = function(sphere, point, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(point)) { - throw new DeveloperError('point is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('point', point); result = BoundingSphere.clone(sphere, result); @@ -10711,13 +10203,8 @@ define('Core/BoundingSphere',[ * intersects the plane. */ BoundingSphere.intersectPlane = function(sphere, plane) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(plane)) { - throw new DeveloperError('plane is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('plane', plane); var center = sphere.center; var radius = sphere.radius; @@ -10743,13 +10230,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.transform = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -10777,12 +10259,8 @@ define('Core/BoundingSphere',[ * }); */ BoundingSphere.distanceSquaredTo = function(sphere, cartesian) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('cartesian', cartesian); var diff = Cartesian3.subtract(sphere.center, cartesian, distanceSquaredToScratch); return Cartesian3.magnitudeSquared(diff) - sphere.radius * sphere.radius; @@ -10804,13 +10282,8 @@ define('Core/BoundingSphere',[ * var newBoundingSphere = Cesium.BoundingSphere.transformWithoutScale(boundingSphere, modelMatrix); */ BoundingSphere.transformWithoutScale = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -10837,17 +10310,9 @@ define('Core/BoundingSphere',[ * @returns {Interval} The nearest and farthest distances on the bounding sphere from position in direction. */ BoundingSphere.computePlaneDistances = function(sphere, position, direction, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(position)) { - throw new DeveloperError('position is required.'); - } - - if (!defined(direction)) { - throw new DeveloperError('direction is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); if (!defined(result)) { result = new Interval(); @@ -10882,9 +10347,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.projectTo2D = function(sphere, projection, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } + Check.typeOf.object('sphere', sphere); projection = defaultValue(projection, projectTo2DProjection); @@ -10979,12 +10442,8 @@ define('Core/BoundingSphere',[ * @returns {Boolean} <code>true</code> if the sphere is not visible; otherwise <code>false</code>. */ BoundingSphere.isOccluded = function(sphere, occluder) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(occluder)) { - throw new DeveloperError('occluder is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('occluder', occluder); return !occluder.isBoundingSphereVisible(sphere); }; @@ -12193,7 +11652,10 @@ define('Core/WebGLConstants',[ COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : 0x9279, TEXTURE_IMMUTABLE_FORMAT : 0x912F, MAX_ELEMENT_INDEX : 0x8D6B, - TEXTURE_IMMUTABLE_LEVELS : 0x82DF + TEXTURE_IMMUTABLE_LEVELS : 0x82DF, + + // Extensions + MAX_TEXTURE_MAX_ANISOTROPY_EXT : 0x84FF }; return freezeObject(WebGLConstants); @@ -12723,7 +12185,7 @@ define('Core/Geometry',[ * <li><code>position</code> - 3D vertex position. 64-bit floating-point (for precision). 3 components per attribute. See {@link VertexFormat#position}.</li> * <li><code>normal</code> - Normal (normalized), commonly used for lighting. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#normal}.</li> * <li><code>st</code> - 2D texture coordinate. 32-bit floating-point. 2 components per attribute. See {@link VertexFormat#st}.</li> - * <li><code>binormal</code> - Binormal (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#binormal}.</li> + * <li><code>bitangent</code> - Bitangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#bitangent}.</li> * <li><code>tangent</code> - Tangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#tangent}.</li> * </ul> * </p> @@ -12752,7 +12214,7 @@ define('Core/Geometry',[ * componentsPerAttribute : 3, * values : new Float32Array(0) * }); - * + * * @see GeometryAttribute * @see VertexFormat */ @@ -13033,7 +12495,7 @@ define('Core/GeometryAttributes',[ this.st = options.st; /** - * The binormal attribute (normalized), which is used for tangent-space effects like bump mapping. + * The bitangent attribute (normalized), which is used for tangent-space effects like bump mapping. * <p> * 32-bit floating-point. 3 components per attribute. * </p> @@ -13042,7 +12504,7 @@ define('Core/GeometryAttributes',[ * * @default undefined */ - this.binormal = options.binormal; + this.bitangent = options.bitangent; /** * The tangent attribute (normalized), which is used for tangent-space effects like bump mapping. diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createPolygonGeometry.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createPolygonGeometry.js index b757c827..0264b5bf 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createPolygonGeometry.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createPolygonGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,68 +45,6 @@ define('Core/defined',[],function() { return defined; }); -/*global define*/ -define('Core/freezeObject',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Freezes an object, using Object.freeze if available, otherwise returns - * the object unchanged. This function should be used in setup code to prevent - * errors from completely halting JavaScript execution in legacy browsers. - * - * @private - * - * @exports freezeObject - */ - var freezeObject = Object.freeze; - if (!defined(freezeObject)) { - freezeObject = function(o) { - return o; - }; - } - - return freezeObject; -}); - -/*global define*/ -define('Core/defaultValue',[ - './freezeObject' - ], function( - freezeObject) { - 'use strict'; - - /** - * Returns the first parameter if not undefined, otherwise the second parameter. - * Useful for setting a default value for a parameter. - * - * @exports defaultValue - * - * @param {*} a - * @param {*} b - * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter. - * - * @example - * param = Cesium.defaultValue(param, 'default'); - */ - function defaultValue(a, b) { - if (a !== undefined) { - return a; - } - return b; - } - - /** - * A frozen empty object that can be used as the default value for options passed as - * an object literal. - */ - defaultValue.EMPTY_OBJECT = freezeObject({}); - - return defaultValue; -}); - /*global define*/ define('Core/DeveloperError',[ './defined' @@ -188,41 +126,13 @@ define('Core/DeveloperError',[ return DeveloperError; }); -/*global define*/ -define('Core/isArray',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Tests an object to see if it is an array. - * @exports isArray - * - * @param {Object} value The value to test. - * @returns {Boolean} true if the value is an array, false otherwise. - */ - var isArray = Array.isArray; - if (!defined(isArray)) { - isArray = function(value) { - return Object.prototype.toString.call(value) === '[object Array]'; - }; - } - - return isArray; -}); - /*global define*/ define('Core/Check',[ - './defaultValue', - './defined', - './DeveloperError', - './isArray' + './defined', + './DeveloperError' ], function( - defaultValue, defined, - DeveloperError, - isArray) { + DeveloperError) { 'use strict'; /** @@ -237,111 +147,134 @@ define('Core/Check',[ */ Check.typeOf = {}; - /** - * Contains functions for checking numeric conditions such as minimum and maximum values - */ - Check.numeric = {}; - function getUndefinedErrorMessage(name) { - return name + ' was required but undefined.'; + return name + ' is required, actual value was undefined'; } function getFailedTypeErrorMessage(actual, expected, name) { - return 'Expected ' + name + ' to be typeof ' + expected + ', got ' + actual; + return 'Expected ' + name + ' to be typeof ' + expected + ', actual typeof was ' + actual; } /** * Throws if test is not defined * - * @param {*} test The value that is to be checked * @param {String} name The name of the variable being tested + * @param {*} test The value that is to be checked * @exception {DeveloperError} test must be defined */ - Check.defined = function (test, name) { + Check.defined = function (name, test) { if (!defined(test)) { throw new DeveloperError(getUndefinedErrorMessage(name)); } }; /** - * Throws if test is greater than maximum + * Throws if test is not typeof 'function' * - * @param {Number} test The value to test - * @param {Number} maximum The maximum allowed value - * @exception {DeveloperError} test must not be greater than maximum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'function' */ - Check.numeric.maximum = function (test, maximum) { - Check.typeOf.number(test); - Check.typeOf.number(maximum); - if (test > maximum) { - throw new DeveloperError('Expected ' + test + ' to be at most ' + maximum); + Check.typeOf.func = function (name, test) { + if (typeof test !== 'function') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); } }; /** - * Throws if test is less than minimum + * Throws if test is not typeof 'string' * - * @param {Number} test The value to test - * @param {Number} minimum The minimum allowed value - * @exception {DeveloperError} test must not be less than mininum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'string' */ - Check.numeric.minimum = function (test, minimum) { - Check.typeOf.number(test); - Check.typeOf.number(minimum); - if (test < minimum) { - throw new DeveloperError('Expected ' + test + ' to be at least ' + minimum); + Check.typeOf.string = function (name, test) { + if (typeof test !== 'string') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); } }; /** - * Throws if test is not typeof 'function' + * Throws if test is not typeof 'number' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'function' + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'number' */ - Check.typeOf.function = function (test, name) { - if (typeof test !== 'function') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); + Check.typeOf.number = function (name, test) { + if (typeof test !== 'number') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); } }; /** - * Throws if test is not typeof 'string' + * Throws if test is not typeof 'number' and less than limit * + * @param {String} name The name of the variable being tested * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than limit + */ + Check.typeOf.number.lessThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test >= limit) { + throw new DeveloperError('Expected ' + name + ' to be less than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and less than or equal to limit + * * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'string' + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than or equal to limit */ - Check.typeOf.string = function (test, name) { - if (typeof test !== 'string') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); + Check.typeOf.number.lessThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test > limit) { + throw new DeveloperError('Expected ' + name + ' to be less than or equal to ' + limit + ', actual value was ' + test); } }; /** - * Throws if test is not typeof 'number' + * Throws if test is not typeof 'number' and greater than limit * + * @param {String} name The name of the variable being tested * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than limit + */ + Check.typeOf.number.greaterThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test <= limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and greater than or equal to limit + * * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'number' + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than or equal to limit */ - Check.typeOf.number = function (test, name) { - if (typeof test !== 'number') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); + Check.typeOf.number.greaterThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test < limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than or equal to' + limit + ', actual value was ' + test); } }; /** * Throws if test is not typeof 'object' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested + * @param {*} test The value to test * @exception {DeveloperError} test must be typeof 'object' */ - Check.typeOf.object = function (test, name) { + Check.typeOf.object = function (name, test) { if (typeof test !== 'object') { throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'object', name)); } @@ -350,11 +283,11 @@ define('Core/Check',[ /** * Throws if test is not typeof 'boolean' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested + * @param {*} test The value to test * @exception {DeveloperError} test must be typeof 'boolean' */ - Check.typeOf.boolean = function (test, name) { + Check.typeOf.bool = function (name, test) { if (typeof test !== 'boolean') { throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'boolean', name)); } @@ -363,6 +296,68 @@ define('Core/Check',[ return Check; }); +/*global define*/ +define('Core/freezeObject',[ + './defined' + ], function( + defined) { + 'use strict'; + + /** + * Freezes an object, using Object.freeze if available, otherwise returns + * the object unchanged. This function should be used in setup code to prevent + * errors from completely halting JavaScript execution in legacy browsers. + * + * @private + * + * @exports freezeObject + */ + var freezeObject = Object.freeze; + if (!defined(freezeObject)) { + freezeObject = function(o) { + return o; + }; + } + + return freezeObject; +}); + +/*global define*/ +define('Core/defaultValue',[ + './freezeObject' + ], function( + freezeObject) { + 'use strict'; + + /** + * Returns the first parameter if not undefined, otherwise the second parameter. + * Useful for setting a default value for a parameter. + * + * @exports defaultValue + * + * @param {*} a + * @param {*} b + * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter. + * + * @example + * param = Cesium.defaultValue(param, 'default'); + */ + function defaultValue(a, b) { + if (a !== undefined) { + return a; + } + return b; + } + + /** + * A frozen empty object that can be used as the default value for options passed as + * an object literal. + */ + defaultValue.EMPTY_OBJECT = freezeObject({}); + + return defaultValue; +}); + /* I've wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace so it's better encapsulated. Now you can have multiple random number generators @@ -1047,7 +1042,7 @@ define('Core/Math',[ if (!defined(angle)) { throw new DeveloperError('angle is required.'); } - + return CesiumMath.clamp(angle, -1*CesiumMath.PI_OVER_TWO, CesiumMath.PI_OVER_TWO); }; @@ -1057,11 +1052,11 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [<code>-CesiumMath.PI</code>, <code>CesiumMath.PI</code>]. */ - CesiumMath.negativePiToPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.negativePiToPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - return CesiumMath.zeroToTwoPi(x + CesiumMath.PI) - CesiumMath.PI; + return CesiumMath.zeroToTwoPi(angle + CesiumMath.PI) - CesiumMath.PI; }; /** @@ -1070,12 +1065,12 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [0, <code>CesiumMath.TWO_PI</code>]. */ - CesiumMath.zeroToTwoPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.zeroToTwoPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - var mod = CesiumMath.mod(x, CesiumMath.TWO_PI); - if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(x) > CesiumMath.EPSILON14) { + var mod = CesiumMath.mod(angle, CesiumMath.TWO_PI); + if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(angle) > CesiumMath.EPSILON14) { return CesiumMath.TWO_PI; } return mod; @@ -1145,7 +1140,7 @@ define('Core/Math',[ * @example * //Compute 7!, which is equal to 5040 * var computedFactorial = Cesium.Math.factorial(7); - * + * * @see {@link http://en.wikipedia.org/wiki/Factorial|Factorial on Wikipedia} */ CesiumMath.factorial = function(n) { @@ -1429,7 +1424,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.fromSpherical = function(spherical, result) { - Check.typeOf.object(spherical, 'spherical'); + Check.typeOf.object('spherical', spherical); if (!defined(result)) { result = new Cartesian3(); @@ -1513,8 +1508,8 @@ define('Core/Cartesian3',[ * @returns {Number[]} The array that was packed into */ Cartesian3.pack = function(value, array, startingIndex) { - Check.typeOf.object(value, 'value'); - Check.defined(array, 'array'); + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1534,7 +1529,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.unpack = function(array, startingIndex, result) { - Check.defined(array, 'array'); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1555,7 +1550,7 @@ define('Core/Cartesian3',[ * @returns {Number[]} The packed array. */ Cartesian3.packArray = function(array, result) { - Check.defined(array, 'array'); + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -1578,8 +1573,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3[]} The unpacked array. */ Cartesian3.unpackArray = function(array, result) { - Check.defined(array, 'array'); - Check.numeric.minimum(array.length, 3); + Check.defined('array', array); + Check.typeOf.number.greaterThanOrEquals('array.length', array.length, 3); if (array.length % 3 !== 0) { throw new DeveloperError('array length must be a multiple of 3.'); } @@ -1625,7 +1620,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the maximum component. */ Cartesian3.maximumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z); }; @@ -1637,7 +1632,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the minimum component. */ Cartesian3.minimumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z); }; @@ -1651,9 +1646,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the minimum components. */ Cartesian3.minimumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -1671,9 +1666,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the maximum components. */ Cartesian3.maximumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -1688,7 +1683,7 @@ define('Core/Cartesian3',[ * @returns {Number} The squared magnitude. */ Cartesian3.magnitudeSquared = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z; }; @@ -1717,8 +1712,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distance(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(2.0, 0.0, 0.0)); */ Cartesian3.distance = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitude(distanceScratch); @@ -1737,8 +1732,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distanceSquared(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(3.0, 0.0, 0.0)); */ Cartesian3.distanceSquared = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitudeSquared(distanceScratch); @@ -1752,8 +1747,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.normalize = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian3.magnitude(cartesian); @@ -1776,8 +1771,8 @@ define('Core/Cartesian3',[ * @returns {Number} The dot product. */ Cartesian3.dot = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z; }; @@ -1791,9 +1786,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyComponents = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -1835,9 +1830,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.add = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -1854,9 +1849,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.subtract = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -1873,9 +1868,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -1892,9 +1887,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.divideByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -1910,8 +1905,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.negate = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -1927,8 +1922,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.abs = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -1947,10 +1942,10 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.lerp = function(start, end, t, result) { - Check.typeOf.object(start, 'start'); - Check.typeOf.object(end, 'end'); - Check.typeOf.number(t, 't'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian3.multiplyByScalar(end, t, lerpScratch); result = Cartesian3.multiplyByScalar(start, 1.0 - t, result); @@ -1967,8 +1962,8 @@ define('Core/Cartesian3',[ * @returns {Number} The angle between the Cartesians. */ Cartesian3.angleBetween = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.normalize(left, angleBetweenScratch); Cartesian3.normalize(right, angleBetweenScratch2); @@ -1986,8 +1981,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The most orthogonal axis. */ Cartesian3.mostOrthogonalAxis = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian3.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian3.abs(f, f); @@ -2064,9 +2059,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The cross product. */ Cartesian3.cross = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var leftX = left.x; var leftY = left.y; @@ -2099,8 +2094,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromDegrees(-115.0, 37.0); */ Cartesian3.fromDegrees = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); longitude = CesiumMath.toRadians(longitude); latitude = CesiumMath.toRadians(latitude); @@ -2125,8 +2120,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromRadians(-2.007, 0.645); */ Cartesian3.fromRadians = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); height = defaultValue(height, 0.0); var radiiSquared = defined(ellipsoid) ? ellipsoid.radiiSquared : wgs84RadiiSquared; @@ -2160,7 +2155,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArray([-115.0, 37.0, -107.0, 33.0]); */ Cartesian3.fromDegreesArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -2194,7 +2189,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArray([-2.007, 0.645, -1.867, .575]); */ Cartesian3.fromRadiansArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -2228,7 +2223,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArrayHeights([-115.0, 37.0, 100000.0, -107.0, 33.0, 150000.0]); */ Cartesian3.fromDegreesArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -2263,7 +2258,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArrayHeights([-2.007, 0.645, 100000.0, -1.867, .575, 150000.0]); */ Cartesian3.fromRadiansArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -3010,7 +3005,9 @@ define('Core/Ellipsoid',[ /** * Computes an Ellipsoid from a Cartesian specifying the radii in x, y, and z directions. * - * @param {Cartesian3} [radii=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Cartesian3} [cartesian=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new + * instance should be created. * @returns {Ellipsoid} A new Ellipsoid instance. * * @exception {DeveloperError} All radii components must be greater than or equal to zero. @@ -3454,12 +3451,14 @@ define('Core/Ellipsoid',[ /*global define*/ define('Core/Cartesian2',[ + './Check', './defaultValue', './defined', './DeveloperError', './freezeObject', './Math' ], function( + Check, defaultValue, defined, DeveloperError, @@ -3571,12 +3570,8 @@ define('Core/Cartesian2',[ * @returns {Number[]} The array that was packed into */ Cartesian2.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3595,9 +3590,7 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided. */ Cartesian2.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3617,9 +3610,7 @@ define('Core/Cartesian2',[ * @returns {Number[]} The packed array. */ Cartesian2.packArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -3642,9 +3633,7 @@ define('Core/Cartesian2',[ * @returns {Cartesian2[]} The unpacked array. */ Cartesian2.unpackArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -3687,9 +3676,7 @@ define('Core/Cartesian2',[ * @returns {Number} The value of the maximum component. */ Cartesian2.maximumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y); }; @@ -3701,9 +3688,7 @@ define('Core/Cartesian2',[ * @returns {Number} The value of the minimum component. */ Cartesian2.minimumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y); }; @@ -3717,15 +3702,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} A cartesian with the minimum components. */ Cartesian2.minimumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); @@ -3743,15 +3722,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} A cartesian with the maximum components. */ Cartesian2.maximumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -3765,9 +3738,7 @@ define('Core/Cartesian2',[ * @returns {Number} The squared magnitude. */ Cartesian2.magnitudeSquared = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y; }; @@ -3833,12 +3804,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.normalize = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian2.magnitude(cartesian); @@ -3860,12 +3827,8 @@ define('Core/Cartesian2',[ * @returns {Number} The dot product. */ Cartesian2.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y; }; @@ -3879,15 +3842,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.multiplyComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -3903,15 +3860,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.divideComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x / right.x; result.y = left.y / right.y; @@ -3927,15 +3878,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -3951,15 +3896,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -3975,15 +3914,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.multiplyByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -3999,15 +3932,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.divideByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -4022,12 +3949,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.negate = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -4042,12 +3965,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.abs = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -4065,18 +3984,10 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian2.multiplyByScalar(end, t, lerpScratch); result = Cartesian2.multiplyByScalar(start, 1.0 - t, result); @@ -4093,12 +4004,8 @@ define('Core/Cartesian2',[ * @returns {Number} The angle between the Cartesians. */ Cartesian2.angleBetween = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian2.normalize(left, angleBetweenScratch); Cartesian2.normalize(right, angleBetweenScratch2); @@ -4114,12 +4021,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The most orthogonal axis. */ Cartesian2.mostOrthogonalAxis = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian2.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian2.abs(f, f); @@ -4412,6 +4315,7 @@ define('Core/Intersect',[ /*global define*/ define('Core/Rectangle',[ './Cartographic', + './Check', './defaultValue', './defined', './defineProperties', @@ -4421,6 +4325,7 @@ define('Core/Rectangle',[ './Math' ], function( Cartographic, + Check, defaultValue, defined, defineProperties, @@ -4517,13 +4422,8 @@ define('Core/Rectangle',[ * @returns {Number[]} The array that was packed into */ Rectangle.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -4544,9 +4444,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -4567,9 +4465,7 @@ define('Core/Rectangle',[ * @returns {Number} The width. */ Rectangle.computeWidth = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; if (east < west) { @@ -4584,9 +4480,7 @@ define('Core/Rectangle',[ * @returns {Number} The height. */ Rectangle.computeHeight = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); return rectangle.north - rectangle.south; }; @@ -4621,6 +4515,32 @@ define('Core/Rectangle',[ return result; }; + /** + * Creates an rectangle given the boundary longitude and latitude in radians. + * + * @param {Number} [west=0.0] The westernmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [south=0.0] The southernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Number} [east=0.0] The easternmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [north=0.0] The northernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Rectangle} [result] The object onto which to store the result, or undefined if a new instance should be created. + * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. + * + * @example + * var rectangle = Cesium.Rectangle.fromRadians(0.0, Math.PI/4, Math.PI/8, 3*Math.PI/4); + */ + Rectangle.fromRadians = function(west, south, east, north, result) { + if (!defined(result)) { + return new Rectangle(west, south, east, north); + } + + result.west = defaultValue(west, 0.0); + result.south = defaultValue(south, 0.0); + result.east = defaultValue(east, 0.0); + result.north = defaultValue(north, 0.0); + + return result; + }; + /** * Creates the smallest possible Rectangle that encloses all positions in the provided array. * @@ -4629,9 +4549,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartographicArray = function(cartographics, result) { - if (!defined(cartographics)) { - throw new DeveloperError('cartographics is required.'); - } + Check.defined('cartographics', cartographics); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -4684,9 +4602,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartesianArray = function(cartesians, ellipsoid, result) { - if (!defined(cartesians)) { - throw new DeveloperError('cartesians is required.'); - } + Check.defined('cartesians', cartesians); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -4802,9 +4718,7 @@ define('Core/Rectangle',[ * @returns {Boolean} <code>true</code> if the Rectangles are within the provided epsilon, <code>false</code> otherwise. */ Rectangle.prototype.equalsEpsilon = function(other, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon is required and must be a number.'); - } + Check.typeOf.number('epsilon', epsilon); return defined(other) && (Math.abs(this.west - other.west) <= epsilon) && @@ -4824,45 +4738,23 @@ define('Core/Rectangle',[ * @exception {DeveloperError} <code>west</code> must be in the interval [<code>-Pi</code>, <code>Pi</code>]. */ Rectangle.validate = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var north = rectangle.north; - if (typeof north !== 'number') { - throw new DeveloperError('north is required to be a number.'); - } - - if (north < -CesiumMath.PI_OVER_TWO || north > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('north must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('north', north, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('north', north, CesiumMath.PI_OVER_TWO); var south = rectangle.south; - if (typeof south !== 'number') { - throw new DeveloperError('south is required to be a number.'); - } - - if (south < -CesiumMath.PI_OVER_TWO || south > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('south must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('south', south, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('south', south, CesiumMath.PI_OVER_TWO); var west = rectangle.west; - if (typeof west !== 'number') { - throw new DeveloperError('west is required to be a number.'); - } - - if (west < -Math.PI || west > Math.PI) { - throw new DeveloperError('west must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('west', west, -Math.PI); + Check.typeOf.number.lessThanOrEquals('west', west, Math.PI); var east = rectangle.east; - if (typeof east !== 'number') { - throw new DeveloperError('east is required to be a number.'); - } - - if (east < -Math.PI || east > Math.PI) { - throw new DeveloperError('east must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('east', east, -Math.PI); + Check.typeOf.number.lessThanOrEquals('east', east, Math.PI); }; /** @@ -4873,9 +4765,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.south); @@ -4894,9 +4784,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.north); @@ -4915,9 +4803,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.north); @@ -4936,9 +4822,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.south); @@ -4957,9 +4841,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.center = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; @@ -4994,12 +4876,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.intersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var rectangleEast = rectangle.east; var rectangleWest = rectangle.west; @@ -5055,12 +4933,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.simpleIntersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var west = Math.max(rectangle.west, otherRectangle.west); var south = Math.max(rectangle.south, otherRectangle.south); @@ -5091,12 +4965,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.union = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); if (!defined(result)) { result = new Rectangle(); @@ -5140,12 +5010,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.expand = function(rectangle, cartographic, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); if (!defined(result)) { result = new Rectangle(); @@ -5167,12 +5033,8 @@ define('Core/Rectangle',[ * @returns {Boolean} true if the provided cartographic is inside the rectangle, false otherwise. */ Rectangle.contains = function(rectangle, cartographic) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); var longitude = cartographic.longitude; var latitude = cartographic.latitude; @@ -5205,9 +5067,7 @@ define('Core/Rectangle',[ * @returns {Cartesian3[]} The modified result parameter or a new Array of Cartesians instances if none was provided. */ Rectangle.subsample = function(rectangle, ellipsoid, surfaceHeight, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84); surfaceHeight = defaultValue(surfaceHeight, 0.0); @@ -5285,18 +5145,18 @@ define('Core/Rectangle',[ define('Core/BoundingRectangle',[ './Cartesian2', './Cartographic', + './Check', './defaultValue', './defined', - './DeveloperError', './GeographicProjection', './Intersect', './Rectangle' ], function( Cartesian2, Cartographic, + Check, defaultValue, defined, - DeveloperError, GeographicProjection, Intersect, Rectangle) { @@ -5361,12 +5221,8 @@ define('Core/BoundingRectangle',[ * @returns {Number[]} The array that was packed into */ BoundingRectangle.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5387,9 +5243,7 @@ define('Core/BoundingRectangle',[ * @returns {BoundingRectangle} The modified result parameter or a new BoundingRectangle instance if one was not provided. */ BoundingRectangle.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5520,12 +5374,8 @@ define('Core/BoundingRectangle',[ * @returns {BoundingRectangle} The modified result parameter or a new BoundingRectangle instance if one was not provided. */ BoundingRectangle.union = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); if (!defined(result)) { result = new BoundingRectangle(); @@ -5552,12 +5402,8 @@ define('Core/BoundingRectangle',[ * @returns {BoundingRectangle} The modified result parameter or a new BoundingRectangle instance if one was not provided. */ BoundingRectangle.expand = function(rectangle, point, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } - if (!defined(point)) { - throw new DeveloperError('point is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('point', point); result = BoundingRectangle.clone(rectangle, result); @@ -5589,12 +5435,8 @@ define('Core/BoundingRectangle',[ * @returns {Intersect} <code>Intersect.INTESECTING</code> if the rectangles intersect, <code>Intersect.OUTSIDE</code> otherwise. */ BoundingRectangle.intersect = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); var leftX = left.x; var leftY = left.y; @@ -5698,6 +5540,7 @@ define('Core/Interval',[ /*global define*/ define('Core/Matrix3',[ './Cartesian3', + './Check', './defaultValue', './defined', './defineProperties', @@ -5706,6 +5549,7 @@ define('Core/Matrix3',[ './Math' ], function( Cartesian3, + Check, defaultValue, defined, defineProperties, @@ -5768,13 +5612,8 @@ define('Core/Matrix3',[ * @returns {Number[]} The array that was packed into */ Matrix3.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5800,9 +5639,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. */ Matrix3.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5829,24 +5666,24 @@ define('Core/Matrix3',[ * @param {Matrix3} [result] The object onto which to store the result. * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. (Returns undefined if matrix is undefined) */ - Matrix3.clone = function(values, result) { - if (!defined(values)) { + Matrix3.clone = function(matrix, result) { + if (!defined(matrix)) { return undefined; } if (!defined(result)) { - return new Matrix3(values[0], values[3], values[6], - values[1], values[4], values[7], - values[2], values[5], values[8]); + return new Matrix3(matrix[0], matrix[3], matrix[6], + matrix[1], matrix[4], matrix[7], + matrix[2], matrix[5], matrix[8]); } - result[0] = values[0]; - result[1] = values[1]; - result[2] = values[2]; - result[3] = values[3]; - result[4] = values[4]; - result[5] = values[5]; - result[6] = values[6]; - result[7] = values[7]; - result[8] = values[8]; + result[0] = matrix[0]; + result[1] = matrix[1]; + result[2] = matrix[2]; + result[3] = matrix[3]; + result[4] = matrix[4]; + result[5] = matrix[5]; + result[6] = matrix[6]; + result[7] = matrix[7]; + result[8] = matrix[8]; return result; }; @@ -5872,9 +5709,7 @@ define('Core/Matrix3',[ * var m2 = Cesium.Matrix3.fromArray(v2, 2); */ Matrix3.fromArray = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5902,9 +5737,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values parameter is required'); - } + Check.defined('values', values); return Matrix3.clone(values, result); }; @@ -5918,9 +5751,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix3(values[0], values[1], values[2], @@ -5947,9 +5778,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this quaternion. */ Matrix3.fromQuaternion = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); var x2 = quaternion.x * quaternion.x; var xy = quaternion.x * quaternion.y; @@ -5999,10 +5828,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this headingPitchRoll. */ Matrix3.fromHeadingPitchRoll = function(headingPitchRoll, result) { - if (!defined(headingPitchRoll)) { - throw new DeveloperError('headingPitchRoll is required'); - } - var cosTheta = Math.cos(-headingPitchRoll.pitch); + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + + var cosTheta = Math.cos(-headingPitchRoll.pitch); var cosPsi = Math.cos(-headingPitchRoll.heading); var cosPhi = Math.cos(headingPitchRoll.roll); var sinTheta = Math.sin(-headingPitchRoll.pitch); @@ -6053,9 +5881,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix3( @@ -6091,9 +5917,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromUniformScale(2.0); */ Matrix3.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix3( @@ -6117,7 +5941,7 @@ define('Core/Matrix3',[ /** * Computes a Matrix3 instance representing the cross product equivalent matrix of a Cartesian3 vector. * - * @param {Cartesian3} the vector on the left hand side of the cross product operation. + * @param {Cartesian3} vector the vector on the left hand side of the cross product operation. * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created. * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. * @@ -6129,9 +5953,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromCrossProduct(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromCrossProduct = function(vector, result) { - if (!defined(vector)) { - throw new DeveloperError('vector is required.'); - } + Check.typeOf.object('vector', vector); if (!defined(result)) { return new Matrix3( @@ -6166,9 +5988,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationX = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -6207,9 +6027,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationY = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -6248,9 +6066,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationZ = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -6284,9 +6100,7 @@ define('Core/Matrix3',[ * @returns {Number[]} The modified Array parameter or a new Array instance if one was not provided. */ Matrix3.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5], matrix[6], matrix[7], matrix[8]]; @@ -6320,12 +6134,10 @@ define('Core/Matrix3',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix3.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 2) { - throw new DeveloperError('row must be 0, 1, or 2.'); - } - if (typeof column !== 'number' || column < 0 || column > 2) { - throw new DeveloperError('column must be 0, 1, or 2.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 2); + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 2); return column * 3 + row; }; @@ -6341,16 +6153,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var startIndex = index * 3; var x = matrix[startIndex]; @@ -6375,18 +6181,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); var startIndex = index * 3; @@ -6407,15 +6206,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 3]; @@ -6439,18 +6233,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); result[index] = cartesian.x; @@ -6469,12 +6256,8 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[3], matrix[4], matrix[5], scratchColumn)); @@ -6505,15 +6288,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var column0Row0 = left[0] * right[0] + left[3] * right[1] + left[6] * right[2]; var column0Row1 = left[1] * right[0] + left[4] * right[1] + left[7] * right[2]; @@ -6548,15 +6325,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -6579,15 +6350,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -6610,15 +6375,9 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -6643,15 +6402,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -6682,15 +6435,9 @@ define('Core/Matrix3',[ * @see Matrix3.multiplyByUniformScale */ Matrix3.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); result[0] = matrix[0] * scale.x; result[1] = matrix[1] * scale.x; @@ -6712,12 +6459,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -6739,12 +6482,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var column0Row0 = matrix[0]; var column0Row1 = matrix[3]; @@ -6884,9 +6623,7 @@ define('Core/Matrix3',[ * var c = Cesium.Cartesian3.multiplyByScalar(v, lambda, new Cesium.Cartesian3()); // equal to Cesium.Matrix3.multiplyByVector(a, v) */ Matrix3.computeEigenDecomposition = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); // This routine was created based upon Matrix Computations, 3rd ed., by Golub and Van Loan, // section 8.4.3 The Classical Jacobi Algorithm @@ -6930,12 +6667,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -6957,9 +6690,7 @@ define('Core/Matrix3',[ * @returns {Number} The value of the determinant of the matrix. */ Matrix3.determinant = function(matrix) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); var m11 = matrix[0]; var m21 = matrix[3]; @@ -6984,12 +6715,8 @@ define('Core/Matrix3',[ * @exception {DeveloperError} matrix is not invertible. */ Matrix3.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var m11 = matrix[0]; var m21 = matrix[1]; @@ -7055,9 +6782,7 @@ define('Core/Matrix3',[ * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. */ Matrix3.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -7245,12 +6970,14 @@ define('Core/Matrix3',[ /*global define*/ define('Core/Cartesian4',[ + './Check', './defaultValue', './defined', './DeveloperError', './freezeObject', './Math' ], function( + Check, defaultValue, defined, DeveloperError, @@ -7333,9 +7060,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.fromColor = function(color, result) { - if (!defined(color)) { - throw new DeveloperError('color is required'); - } + Check.typeOf.object('color', color); if (!defined(result)) { return new Cartesian4(color.red, color.green, color.blue, color.alpha); } @@ -7387,12 +7112,8 @@ define('Core/Cartesian4',[ * @returns {Number[]} The array that was packed into */ Cartesian4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -7413,9 +7134,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -7437,9 +7156,7 @@ define('Core/Cartesian4',[ * @returns {Number[]} The packed array. */ Cartesian4.packArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -7462,9 +7179,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4[]} The unpacked array. */ Cartesian4.unpackArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -7507,9 +7222,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the maximum component. */ Cartesian4.maximumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -7521,9 +7234,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the minimum component. */ Cartesian4.minimumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -7537,15 +7248,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the minimum components. */ Cartesian4.minimumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -7564,15 +7269,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the maximum components. */ Cartesian4.maximumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -7589,9 +7288,7 @@ define('Core/Cartesian4',[ * @returns {Number} The squared magnitude. */ Cartesian4.magnitudeSquared = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z + cartesian.w * cartesian.w; }; @@ -7622,9 +7319,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(2.0, 0.0, 0.0, 0.0)); */ Cartesian4.distance = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitude(distanceScratch); @@ -7645,9 +7341,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(3.0, 0.0, 0.0, 0.0)); */ Cartesian4.distanceSquared = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitudeSquared(distanceScratch); @@ -7661,12 +7356,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.normalize = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian4.magnitude(cartesian); @@ -7690,12 +7381,8 @@ define('Core/Cartesian4',[ * @returns {Number} The dot product. */ Cartesian4.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w; }; @@ -7709,15 +7396,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -7735,15 +7416,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x / right.x; result.y = left.y / right.y; @@ -7761,15 +7436,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -7787,15 +7456,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -7813,15 +7476,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -7839,15 +7496,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -7864,12 +7515,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.negate = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -7886,12 +7533,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.abs = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -7911,18 +7554,10 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian4.multiplyByScalar(end, t, lerpScratch); result = Cartesian4.multiplyByScalar(start, 1.0 - t, result); @@ -7938,12 +7573,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The most orthogonal axis. */ Cartesian4.mostOrthogonalAxis = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian4.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian4.abs(f, f); @@ -8188,6 +7819,7 @@ define('Core/RuntimeError',[ define('Core/Matrix4',[ './Cartesian3', './Cartesian4', + './Check', './defaultValue', './defined', './defineProperties', @@ -8199,6 +7831,7 @@ define('Core/Matrix4',[ ], function( Cartesian3, Cartesian4, + Check, defaultValue, defined, defineProperties, @@ -8289,13 +7922,8 @@ define('Core/Matrix4',[ * @returns {Number[]} The array that was packed into */ Matrix4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -8328,9 +7956,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if one was not provided. */ Matrix4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -8426,9 +8052,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required'); - } + Check.defined('values', values); return Matrix4.clone(values, result); }; @@ -8442,9 +8066,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix4(values[0], values[1], values[2], values[3], @@ -8481,9 +8103,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRotationTranslation = function(rotation, translation, result) { - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } + Check.typeOf.object('rotation', rotation); translation = defaultValue(translation, Cartesian3.ZERO); @@ -8531,15 +8151,9 @@ define('Core/Matrix4',[ * result); */ Matrix4.fromTranslationQuaternionRotationScale = function(translation, rotation, scale, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('translation', translation); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('scale', scale); if (!defined(result)) { result = new Matrix4(); @@ -8600,9 +8214,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromTranslationRotationScale = function(translationRotationScale, result) { - if (!defined(translationRotationScale)) { - throw new DeveloperError('translationRotationScale is required.'); - } + Check.typeOf.object('translationRotationScale', translationRotationScale); return Matrix4.fromTranslationQuaternionRotationScale(translationRotationScale.translation, translationRotationScale.rotation, translationRotationScale.scale, result); }; @@ -8617,9 +8229,7 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByTranslation */ Matrix4.fromTranslation = function(translation, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } + Check.typeOf.object('translation', translation); return Matrix4.fromRotationTranslation(Matrix3.IDENTITY, translation, result); }; @@ -8640,9 +8250,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix4.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix4( @@ -8687,9 +8295,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromUniformScale(2.0); */ Matrix4.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix4(scale, 0.0, 0.0, 0.0, @@ -8729,23 +8335,15 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromCamera = function(camera, result) { - if (!defined(camera)) { - throw new DeveloperError('camera is required.'); - } + Check.typeOf.object('camera', camera); var position = camera.position; var direction = camera.direction; var up = camera.up; - if (!defined(position)) { - throw new DeveloperError('camera.position is required.'); - } - if (!defined(direction)) { - throw new DeveloperError('camera.direction is required.'); - } - if (!defined(up)) { - throw new DeveloperError('camera.up is required.'); - } + Check.typeOf.object('camera.position', position); + Check.typeOf.object('camera.direction', direction); + Check.typeOf.object('camera.up', up); Cartesian3.normalize(direction, fromCameraF); Cartesian3.normalize(Cartesian3.cross(fromCameraF, up, fromCameraR), fromCameraR); @@ -8824,21 +8422,11 @@ define('Core/Matrix4',[ * @exception {DeveloperError} far must be greater than zero. */ Matrix4.computePerspectiveFieldOfView = function(fovY, aspectRatio, near, far, result) { - if (fovY <= 0.0 || fovY > Math.PI) { - throw new DeveloperError('fovY must be in (0, PI].'); - } - if (aspectRatio <= 0.0) { - throw new DeveloperError('aspectRatio must be greater than zero.'); - } - if (near <= 0.0) { - throw new DeveloperError('near must be greater than zero.'); - } - if (far <= 0.0) { - throw new DeveloperError('far must be greater than zero.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThan('fovY', fovY, 0.0); + Check.typeOf.number.lessThan('fovY', fovY, Math.PI); + Check.typeOf.number.greaterThan('near', near, 0.0); + Check.typeOf.number.greaterThan('far', far, 0.0); + Check.typeOf.object('result', result); var bottom = Math.tan(fovY * 0.5); @@ -8879,27 +8467,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeOrthographicOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var a = 1.0 / (right - left); var b = 1.0 / (top - bottom); @@ -8938,33 +8512,19 @@ define('Core/Matrix4',[ * @param {Number} right The number of meters to the right of the camera that will be in view. * @param {Number} bottom The number of meters below of the camera that will be in view. * @param {Number} top The number of meters above of the camera that will be in view. - * @param {Number} near The distance to the near plane in meters. - * @param {Number} far The distance to the far plane in meters. - * @param {Matrix4} result The object in which the result will be stored. - * @returns {Matrix4} The modified result parameter. - */ - Matrix4.computePerspectiveOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + * @param {Number} near The distance to the near plane in meters. + * @param {Number} far The distance to the far plane in meters. + * @param {Matrix4} result The object in which the result will be stored. + * @returns {Matrix4} The modified result parameter. + */ + Matrix4.computePerspectiveOffCenter = function(left, right, bottom, top, near, far, result) { + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -9005,24 +8565,12 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeInfinitePerspectiveOffCenter = function(left, right, bottom, top, near, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -9070,9 +8618,7 @@ define('Core/Matrix4',[ * }, 0.0, 1.0, new Cesium.Matrix4()); */ Matrix4.computeViewportTransformation = function(viewport, nearDepthRange, farDepthRange, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); viewport = defaultValue(viewport, defaultValue.EMPTY_OBJECT); var x = defaultValue(viewport.x, 0.0); @@ -9124,21 +8670,11 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeView = function(position, direction, up, right, result) { - if (!defined(position)) { - throw new DeveloperError('position is required'); - } - if (!defined(direction)) { - throw new DeveloperError('direction is required'); - } - if (!defined(up)) { - throw new DeveloperError('up is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); + Check.typeOf.object('up', up); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = right.x; result[1] = up.x; @@ -9179,9 +8715,7 @@ define('Core/Matrix4',[ * //creates a = [10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0] */ Matrix4.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], @@ -9225,12 +8759,11 @@ define('Core/Matrix4',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix4.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 3) { - throw new DeveloperError('row must be 0, 1, 2, or 3.'); - } - if (typeof column !== 'number' || column < 0 || column > 3) { - throw new DeveloperError('column must be 0, 1, 2, or 3.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 3); + + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 3); return column * 4 + row; }; @@ -9263,16 +8796,12 @@ define('Core/Matrix4',[ * // a.x = 12.0; a.y = 16.0; a.z = 20.0; a.w = 24.0; */ Matrix4.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var startIndex = index * 4; var x = matrix[startIndex]; @@ -9314,18 +8843,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 96.0, 25.0] */ Matrix4.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); var startIndex = index * 4; @@ -9346,15 +8870,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.setTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -9407,16 +8925,12 @@ define('Core/Matrix4',[ * // a.x = 18.0; a.y = 19.0; a.z = 20.0; a.w = 21.0; */ Matrix4.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 4]; @@ -9457,18 +8971,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 24.0, 25.0] */ Matrix4.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); result[index] = cartesian.x; @@ -9488,12 +8997,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter */ Matrix4.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[4], matrix[5], matrix[6], scratchColumn)); @@ -9525,15 +9030,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -9617,15 +9116,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -9655,15 +9148,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -9704,15 +9191,9 @@ define('Core/Matrix4',[ * var m3 = Cesium.Matrix4.multiplyTransformation(m1, m2, new Cesium.Matrix4()); */ Matrix4.multiplyTransformation = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -9790,15 +9271,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByMatrix3(m, rotation, m); */ Matrix4.multiplyByMatrix3 = function(matrix, rotation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('result', result); var left0 = matrix[0]; var left1 = matrix[1]; @@ -9866,15 +9341,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByTranslation(m, position, m); */ Matrix4.multiplyByTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); var x = translation.x; var y = translation.y; @@ -9926,15 +9395,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByScale */ Matrix4.multiplyByUniformScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scale', scale); + Check.typeOf.object('result', result); uniformScaleScratch.x = scale; uniformScaleScratch.y = scale; @@ -9963,15 +9426,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByUniformScale */ Matrix4.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); var scaleX = scale.x; var scaleY = scale.y; @@ -10010,15 +9467,9 @@ define('Core/Matrix4',[ * @returns {Cartesian4} The modified result parameter. */ Matrix4.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -10054,15 +9505,9 @@ define('Core/Matrix4',[ * // Cesium.Matrix4.multiplyByVector(matrix, new Cesium.Cartesian4(p.x, p.y, p.z, 0.0), result); */ Matrix4.multiplyByPointAsVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -10092,16 +9537,9 @@ define('Core/Matrix4',[ * var result = Cesium.Matrix4.multiplyByPoint(matrix, p, new Cesium.Cartesian3()); */ Matrix4.multiplyByPoint = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -10141,15 +9579,9 @@ define('Core/Matrix4',[ * // [-44.0, -46.0, -48.0, -50.0] */ Matrix4.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -10193,12 +9625,8 @@ define('Core/Matrix4',[ * // [-22.0, -23.0, -24.0, -25.0] */ Matrix4.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -10242,12 +9670,8 @@ define('Core/Matrix4',[ * // [13.0, 17.0, 21.0, 25.0] */ Matrix4.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var matrix1 = matrix[1]; var matrix2 = matrix[2]; @@ -10283,12 +9707,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -10402,9 +9822,7 @@ define('Core/Matrix4',[ * //Prints "Difference between both the matrices is not less than 0.1" on the console */ Matrix4.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -10435,12 +9853,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter. */ Matrix4.getTranslation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = matrix[12]; result.y = matrix[13]; @@ -10471,12 +9885,8 @@ define('Core/Matrix4',[ * // [12.0, 16.0, 20.0] */ Matrix4.getRotation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -10508,12 +9918,8 @@ define('Core/Matrix4',[ * @exception {RuntimeError} matrix is not invertible because its determinate is zero. */ Matrix4.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); // Special case for a zero scale matrix that can occur, for example, // when a model's node has a [0, 0, 0] scale. @@ -10651,12 +10057,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.inverseTransformation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); //This function is an optimized version of the below 4 lines. //var rT = Matrix3.transpose(Matrix4.getRotation(matrix)); @@ -10941,9 +10343,9 @@ define('Core/Matrix4',[ define('Core/BoundingSphere',[ './Cartesian3', './Cartographic', + './Check', './defaultValue', './defined', - './DeveloperError', './Ellipsoid', './GeographicProjection', './Intersect', @@ -10954,9 +10356,9 @@ define('Core/BoundingSphere',[ ], function( Cartesian3, Cartographic, + Check, defaultValue, defined, - DeveloperError, Ellipsoid, GeographicProjection, Intersect, @@ -11286,9 +10688,7 @@ define('Core/BoundingSphere',[ stride = defaultValue(stride, 3); - if (stride < 3) { - throw new DeveloperError('stride must be 3 or greater.'); - } + Check.typeOf.number.greaterThanOrEquals('stride', stride, 3); var currentPos = fromPointsCurrentPos; currentPos.x = positions[0] + center.x; @@ -11592,9 +10992,8 @@ define('Core/BoundingSphere',[ * var sphere = Cesium.BoundingSphere.fromCornerPoints(new Cesium.Cartesian3(-0.5, -0.5, -0.5), new Cesium.Cartesian3(0.5, 0.5, 0.5)); */ BoundingSphere.fromCornerPoints = function(corner, oppositeCorner, result) { - if (!defined(corner) || !defined(oppositeCorner)) { - throw new DeveloperError('corner and oppositeCorner are required.'); - } + Check.typeOf.object('corner', corner); + Check.typeOf.object('oppositeCorner', oppositeCorner); if (!defined(result)) { result = new BoundingSphere(); @@ -11618,9 +11017,7 @@ define('Core/BoundingSphere',[ * var boundingSphere = Cesium.BoundingSphere.fromEllipsoid(ellipsoid); */ BoundingSphere.fromEllipsoid = function(ellipsoid, result) { - if (!defined(ellipsoid)) { - throw new DeveloperError('ellipsoid is required.'); - } + Check.typeOf.object('ellipsoid', ellipsoid); if (!defined(result)) { result = new BoundingSphere(); @@ -11746,13 +11143,8 @@ define('Core/BoundingSphere',[ * @returns {Number[]} The array that was packed into */ BoundingSphere.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -11774,9 +11166,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if one was not provided. */ BoundingSphere.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -11803,13 +11193,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.union = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); if (!defined(result)) { result = new BoundingSphere(); @@ -11858,13 +11243,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.expand = function(sphere, point, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(point)) { - throw new DeveloperError('point is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('point', point); result = BoundingSphere.clone(sphere, result); @@ -11887,13 +11267,8 @@ define('Core/BoundingSphere',[ * intersects the plane. */ BoundingSphere.intersectPlane = function(sphere, plane) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(plane)) { - throw new DeveloperError('plane is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('plane', plane); var center = sphere.center; var radius = sphere.radius; @@ -11919,13 +11294,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.transform = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -11953,12 +11323,8 @@ define('Core/BoundingSphere',[ * }); */ BoundingSphere.distanceSquaredTo = function(sphere, cartesian) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('cartesian', cartesian); var diff = Cartesian3.subtract(sphere.center, cartesian, distanceSquaredToScratch); return Cartesian3.magnitudeSquared(diff) - sphere.radius * sphere.radius; @@ -11980,13 +11346,8 @@ define('Core/BoundingSphere',[ * var newBoundingSphere = Cesium.BoundingSphere.transformWithoutScale(boundingSphere, modelMatrix); */ BoundingSphere.transformWithoutScale = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -12013,17 +11374,9 @@ define('Core/BoundingSphere',[ * @returns {Interval} The nearest and farthest distances on the bounding sphere from position in direction. */ BoundingSphere.computePlaneDistances = function(sphere, position, direction, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(position)) { - throw new DeveloperError('position is required.'); - } - - if (!defined(direction)) { - throw new DeveloperError('direction is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); if (!defined(result)) { result = new Interval(); @@ -12058,9 +11411,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.projectTo2D = function(sphere, projection, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } + Check.typeOf.object('sphere', sphere); projection = defaultValue(projection, projectTo2DProjection); @@ -12153,14 +11504,10 @@ define('Core/BoundingSphere',[ * @param {BoundingSphere} sphere The bounding sphere surrounding the occludee object. * @param {Occluder} occluder The occluder. * @returns {Boolean} <code>true</code> if the sphere is not visible; otherwise <code>false</code>. - */ - BoundingSphere.isOccluded = function(sphere, occluder) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(occluder)) { - throw new DeveloperError('occluder is required.'); - } + */ + BoundingSphere.isOccluded = function(sphere, occluder) { + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('occluder', occluder); return !occluder.isBoundingSphereVisible(sphere); }; @@ -13369,7 +12716,10 @@ define('Core/WebGLConstants',[ COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : 0x9279, TEXTURE_IMMUTABLE_FORMAT : 0x912F, MAX_ELEMENT_INDEX : 0x8D6B, - TEXTURE_IMMUTABLE_LEVELS : 0x82DF + TEXTURE_IMMUTABLE_LEVELS : 0x82DF, + + // Extensions + MAX_TEXTURE_MAX_ANISOTROPY_EXT : 0x84FF }; return freezeObject(WebGLConstants); @@ -14714,6 +14064,7 @@ define('Core/IntersectionTests',[ './defaultValue', './defined', './DeveloperError', + './Interval', './Math', './Matrix3', './QuadraticRealPolynomial', @@ -14725,6 +14076,7 @@ define('Core/IntersectionTests',[ defaultValue, defined, DeveloperError, + Interval, CesiumMath, Matrix3, QuadraticRealPolynomial, @@ -14996,7 +14348,7 @@ define('Core/IntersectionTests',[ function raySphere(ray, sphere, result) { if (!defined(result)) { - result = {}; + result = new Interval(); } var origin = ray.origin; @@ -15027,8 +14379,8 @@ define('Core/IntersectionTests',[ * * @param {Ray} ray The ray. * @param {BoundingSphere} sphere The sphere. - * @param {Object} [result] The result onto which to store the result. - * @returns {Object} An object with the first (<code>start</code>) and the second (<code>stop</code>) intersection scalars for points along the ray or undefined if there are no intersections. + * @param {Interval} [result] The result onto which to store the result. + * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections. */ IntersectionTests.raySphere = function(ray, sphere, result) { if (!defined(ray)) { @@ -15056,8 +14408,8 @@ define('Core/IntersectionTests',[ * @param {Cartesian3} p0 An end point of the line segment. * @param {Cartesian3} p1 The other end point of the line segment. * @param {BoundingSphere} sphere The sphere. - * @param {Object} [result] The result onto which to store the result. - * @returns {Object} An object with the first (<code>start</code>) and the second (<code>stop</code>) intersection scalars for points along the line segment or undefined if there are no intersections. + * @param {Interval} [result] The result onto which to store the result. + * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections. */ IntersectionTests.lineSegmentSphere = function(p0, p1, sphere, result) { if (!defined(p0)) { @@ -15095,7 +14447,7 @@ define('Core/IntersectionTests',[ * * @param {Ray} ray The ray. * @param {Ellipsoid} ellipsoid The ellipsoid. - * @returns {Object} An object with the first (<code>start</code>) and the second (<code>stop</code>) intersection scalars for points along the ray or undefined if there are no intersections. + * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections. */ IntersectionTests.rayEllipsoid = function(ray, ellipsoid) { if (!defined(ray)) { @@ -15137,10 +14489,7 @@ define('Core/IntersectionTests',[ var root0 = temp / w2; var root1 = difference / temp; if (root0 < root1) { - return { - start : root0, - stop : root1 - }; + return new Interval(root0, root1); } return { @@ -15150,10 +14499,7 @@ define('Core/IntersectionTests',[ } else { // qw2 == product. Repeated roots (2 intersections). var root = Math.sqrt(difference / w2); - return { - start : root, - stop : root - }; + return new Interval(root, root); } } else if (q2 < 1.0) { // Inside ellipsoid (2 intersections). @@ -15163,19 +14509,13 @@ define('Core/IntersectionTests',[ discriminant = qw * qw - product; temp = -qw + Math.sqrt(discriminant); // Positively valued. - return { - start : 0.0, - stop : temp / w2 - }; + return new Interval(0.0, temp / w2); } else { // q2 == 1.0. On ellipsoid. if (qw < 0.0) { // Looking inward. w2 = Cartesian3.magnitudeSquared(w); - return { - start : 0.0, - stop : -qw / w2 - }; + return new Interval(0.0, -qw / w2); } // qw >= 0.0. Looking outward or tangent. @@ -16528,118 +15868,6 @@ define('ThirdParty/when',[],function () { // Boilerplate for AMD, Node, and browser global ); -/*global define*/ -define('Core/oneTimeWarning',[ - './defaultValue', - './defined', - './DeveloperError' - ], function( - defaultValue, - defined, - DeveloperError) { - "use strict"; - - var warnings = {}; - - /** - * Logs a one time message to the console. Use this function instead of - * <code>console.log</code> directly since this does not log duplicate messages - * unless it is called from multiple workers. - * - * @exports oneTimeWarning - * - * @param {String} identifier The unique identifier for this warning. - * @param {String} [message=identifier] The message to log to the console. - * - * @example - * for(var i=0;i<foo.length;++i) { - * if (!defined(foo[i].bar)) { - * // Something that can be recovered from but may happen a lot - * oneTimeWarning('foo.bar undefined', 'foo.bar is undefined. Setting to 0.'); - * foo[i].bar = 0; - * // ... - * } - * } - * - * @private - */ - function oneTimeWarning(identifier, message) { - if (!defined(identifier)) { - throw new DeveloperError('identifier is required.'); - } - - if (!defined(warnings[identifier])) { - warnings[identifier] = true; - console.log(defaultValue(message, identifier)); - } - } - - oneTimeWarning.geometryOutlines = 'Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.'; - - return oneTimeWarning; -}); - -/*global define*/ -define('Core/deprecationWarning',[ - './defined', - './DeveloperError', - './oneTimeWarning' - ], function( - defined, - DeveloperError, - oneTimeWarning) { - 'use strict'; - - /** - * Logs a deprecation message to the console. Use this function instead of - * <code>console.log</code> directly since this does not log duplicate messages - * unless it is called from multiple workers. - * - * @exports deprecationWarning - * - * @param {String} identifier The unique identifier for this deprecated API. - * @param {String} message The message to log to the console. - * - * @example - * // Deprecated function or class - * function Foo() { - * deprecationWarning('Foo', 'Foo was deprecated in Cesium 1.01. It will be removed in 1.03. Use newFoo instead.'); - * // ... - * } - * - * // Deprecated function - * Bar.prototype.func = function() { - * deprecationWarning('Bar.func', 'Bar.func() was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newFunc() instead.'); - * // ... - * }; - * - * // Deprecated property - * defineProperties(Bar.prototype, { - * prop : { - * get : function() { - * deprecationWarning('Bar.prop', 'Bar.prop was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newProp instead.'); - * // ... - * }, - * set : function(value) { - * deprecationWarning('Bar.prop', 'Bar.prop was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newProp instead.'); - * // ... - * } - * } - * }); - * - * @private - */ - function deprecationWarning(identifier, message) { - if (!defined(identifier) || !defined(message)) { - throw new DeveloperError('identifier and message are required.'); - } - - oneTimeWarning(identifier, message); - } - - return deprecationWarning; -}); - /*global define*/ define('Core/binarySearch',[ './defined', @@ -20349,6 +19577,7 @@ define('Core/Iau2006XysData',[ /*global define*/ define('Core/Quaternion',[ './Cartesian3', + './Check', './defaultValue', './defined', './DeveloperError', @@ -20358,6 +19587,7 @@ define('Core/Quaternion',[ './Matrix3' ], function( Cartesian3, + Check, defaultValue, defined, DeveloperError, @@ -20420,12 +19650,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided. */ Quaternion.fromAxisAngle = function(axis, angle, result) { - if (!defined(axis)) { - throw new DeveloperError('axis is required.'); - } - if (typeof angle !== 'number') { - throw new DeveloperError('angle is required and must be a number.'); - } + Check.typeOf.object('axis', axis); + Check.typeOf.number('angle', angle); var halfAngle = angle / 2.0; var s = Math.sin(halfAngle); @@ -20457,9 +19683,7 @@ define('Core/Quaternion',[ * @see Matrix3.fromQuaternion */ Quaternion.fromRotationMatrix = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); var root; var x; @@ -20533,15 +19757,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter or a new Quaternion instance if none was provided. */ Quaternion.fromHeadingPitchRoll = function(heading, pitch, roll, result) { - if (!defined(heading)) { - throw new DeveloperError('heading is required.'); - } - if (!defined(pitch)) { - throw new DeveloperError('pitch is required.'); - } - if (!defined(roll)) { - throw new DeveloperError('roll is required.'); - } + Check.typeOf.number('heading', heading); + Check.typeOf.number('pitch', pitch); + Check.typeOf.number('roll', roll); var rollQuaternion = Quaternion.fromAxisAngle(Cartesian3.UNIT_X, roll, scratchHPRQuaternion); var pitchQuaternion = Quaternion.fromAxisAngle(Cartesian3.UNIT_Y, -pitch, result); @@ -20572,13 +19790,8 @@ define('Core/Quaternion',[ * @returns {Number[]} The array that was packed into */ Quaternion.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -20599,9 +19812,7 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided. */ Quaternion.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -20656,7 +19867,7 @@ define('Core/Quaternion',[ * * @param {Number[]} array The array previously packed for interpolation. * @param {Number[]} sourceArray The original packed array. - * @param {Number} [startingIndex=0] The startingIndex used to convert the array. + * @param {Number} [firstIndex=0] The firstIndex used to convert the array. * @param {Number} [lastIndex=packedArray.length] The lastIndex used to convert the array. * @param {Quaternion} [result] The object into which to store the result. * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided. @@ -20710,12 +19921,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.conjugate = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); result.x = -quaternion.x; result.y = -quaternion.y; @@ -20731,9 +19938,7 @@ define('Core/Quaternion',[ * @returns {Number} The magnitude squared. */ Quaternion.magnitudeSquared = function(quaternion) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); return quaternion.x * quaternion.x + quaternion.y * quaternion.y + quaternion.z * quaternion.z + quaternion.w * quaternion.w; }; @@ -20756,9 +19961,7 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.normalize = function(quaternion, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); var inverseMagnitude = 1.0 / Quaternion.magnitude(quaternion); var x = quaternion.x * inverseMagnitude; @@ -20781,9 +19984,7 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.inverse = function(quaternion, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); var magnitudeSquared = Quaternion.magnitudeSquared(quaternion); result = Quaternion.conjugate(quaternion, result); @@ -20799,15 +20000,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -20825,15 +20020,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -20850,12 +20039,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.negate = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); result.x = -quaternion.x; result.y = -quaternion.y; @@ -20872,12 +20057,8 @@ define('Core/Quaternion',[ * @returns {Number} The dot product. */ Quaternion.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w; }; @@ -20891,15 +20072,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var leftX = left.x; var leftY = left.y; @@ -20932,15 +20107,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.multiplyByScalar = function(quaternion, scalar, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = quaternion.x * scalar; result.y = quaternion.y * scalar; @@ -20958,15 +20127,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.divideByScalar = function(quaternion, scalar, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = quaternion.x / scalar; result.y = quaternion.y / scalar; @@ -20983,12 +20146,8 @@ define('Core/Quaternion',[ * @returns {Cartesian3} The modified result parameter. */ Quaternion.computeAxis = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); var w = quaternion.w; if (Math.abs(w - 1.0) < CesiumMath.EPSILON6) { @@ -21011,9 +20170,7 @@ define('Core/Quaternion',[ * @returns {Number} The angle of rotation. */ Quaternion.computeAngle = function(quaternion) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); if (Math.abs(quaternion.w - 1.0) < CesiumMath.EPSILON6) { return 0.0; @@ -21032,18 +20189,10 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); lerpScratch = Quaternion.multiplyByScalar(end, t, lerpScratch); result = Quaternion.multiplyByScalar(start, 1.0 - t, result); @@ -21065,18 +20214,10 @@ define('Core/Quaternion',[ * @see Quaternion#fastSlerp */ Quaternion.slerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var dot = Quaternion.dot(start, end); @@ -21109,12 +20250,8 @@ define('Core/Quaternion',[ * @returns {Cartesian3} The modified result parameter. */ Quaternion.log = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); var theta = CesiumMath.acosClamped(quaternion.w); var thetaOverSinTheta = 0.0; @@ -21134,12 +20271,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.exp = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var theta = Cartesian3.magnitude(cartesian); var sinThetaOverTheta = 0.0; @@ -21174,12 +20307,10 @@ define('Core/Quaternion',[ * @see Quaternion#squad */ Quaternion.computeInnerQuadrangle = function(q0, q1, q2, result) { - if (!defined(q0) || !defined(q1) || !defined(q2)) { - throw new DeveloperError('q0, q1, and q2 are required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('q0', q0); + Check.typeOf.object('q1', q1); + Check.typeOf.object('q2', q2); + Check.typeOf.object('result', result); var qInv = Quaternion.conjugate(q1, squadScratchQuaternion0); Quaternion.multiply(qInv, q2, squadScratchQuaternion1); @@ -21221,15 +20352,12 @@ define('Core/Quaternion',[ * @see Quaternion#computeInnerQuadrangle */ Quaternion.squad = function(q0, q1, s0, s1, t, result) { - if (!defined(q0) || !defined(q1) || !defined(s0) || !defined(s1)) { - throw new DeveloperError('q0, q1, s0, and s1 are required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('q0', q0); + Check.typeOf.object('q1', q1); + Check.typeOf.object('s0', s0); + Check.typeOf.object('s1', s1); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var slerp0 = Quaternion.slerp(q0, q1, t, squadScratchQuaternion0); var slerp1 = Quaternion.slerp(s0, s1, t, squadScratchQuaternion1); @@ -21266,18 +20394,10 @@ define('Core/Quaternion',[ * @see Quaternion#slerp */ Quaternion.fastSlerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var x = Quaternion.dot(start, end); @@ -21326,15 +20446,12 @@ define('Core/Quaternion',[ * @see Quaternion#squad */ Quaternion.fastSquad = function(q0, q1, s0, s1, t, result) { - if (!defined(q0) || !defined(q1) || !defined(s0) || !defined(s1)) { - throw new DeveloperError('q0, q1, s0, and s1 are required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('q0', q0); + Check.typeOf.object('q1', q1); + Check.typeOf.object('s0', s0); + Check.typeOf.object('s1', s1); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var slerp0 = Quaternion.fastSlerp(q0, q1, t, squadScratchQuaternion0); var slerp1 = Quaternion.fastSlerp(s0, s1, t, squadScratchQuaternion1); @@ -21370,9 +20487,7 @@ define('Core/Quaternion',[ * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. */ Quaternion.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon is required and must be a number.'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || ((defined(left)) && @@ -21452,9 +20567,9 @@ define('Core/Transforms',[ './Cartesian3', './Cartesian4', './Cartographic', + './Check', './defaultValue', './defined', - './deprecationWarning', './DeveloperError', './EarthOrientationParameters', './EarthOrientationParametersSample', @@ -21474,9 +20589,9 @@ define('Core/Transforms',[ Cartesian3, Cartesian4, Cartographic, + Check, defaultValue, defined, - deprecationWarning, DeveloperError, EarthOrientationParameters, EarthOrientationParametersSample, @@ -21912,19 +21027,12 @@ define('Core/Transforms',[ * var hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll); * var transform = Cesium.Transforms.headingPitchRollToFixedFrame(center, hpr); */ - Transforms.headingPitchRollToFixedFrame = function(origin, headingPitchRoll, pitch, roll, ellipsoid, result) { - var heading; - if (typeof headingPitchRoll === 'object') { - // Shift arguments using assignments to encourage JIT optimization. - ellipsoid = pitch; - result = roll; - heading = headingPitchRoll.heading; - pitch = headingPitchRoll.pitch; - roll = headingPitchRoll.roll; - } else { - deprecationWarning('headingPitchRollToFixedFrame', 'headingPitchRollToFixedFrame with separate heading, pitch, and roll arguments was deprecated in 1.27. It will be removed in 1.30. Use a HeadingPitchRoll object.'); - heading = headingPitchRoll; - } + Transforms.headingPitchRollToFixedFrame = function(origin, headingPitchRoll, ellipsoid, result) { + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + var heading = headingPitchRoll.heading; + var pitch = headingPitchRoll.pitch; + var roll = headingPitchRoll.roll; + // checks for required parameters happen in the called functions var hprQuaternion = Quaternion.fromHeadingPitchRoll(heading, pitch, roll, scratchHPRQuaternion); var hprMatrix = Matrix4.fromTranslationQuaternionRotationScale(Cartesian3.ZERO, hprQuaternion, scratchScale, scratchHPRMatrix4); @@ -21932,7 +21040,6 @@ define('Core/Transforms',[ return Matrix4.multiply(result, hprMatrix, result); }; - var scratchHPR = new HeadingPitchRoll(); var scratchENUMatrix4 = new Matrix4(); var scratchHPRMatrix3 = new Matrix3(); @@ -21957,22 +21064,10 @@ define('Core/Transforms',[ * var hpr = new HeadingPitchRoll(heading, pitch, roll); * var quaternion = Cesium.Transforms.headingPitchRollQuaternion(center, hpr); */ - Transforms.headingPitchRollQuaternion = function(origin, headingPitchRoll, pitch, roll, ellipsoid, result) { - var hpr; - if (typeof headingPitchRoll === 'object') { - // Shift arguments using assignment to encourage JIT optimization. - hpr = headingPitchRoll; - ellipsoid = pitch; - result = roll; - } else { - deprecationWarning('headingPitchRollQuaternion', 'headingPitchRollQuaternion with separate heading, pitch, and roll arguments was deprecated in 1.27. It will be removed in 1.30. Use a HeadingPitchRoll object.'); - scratchHPR.heading = headingPitchRoll; - scratchHPR.pitch = pitch; - scratchHPR.roll = roll; - hpr = scratchHPR; - } + Transforms.headingPitchRollQuaternion = function(origin, headingPitchRoll, ellipsoid, result) { // checks for required parameters happen in the called functions - var transform = Transforms.headingPitchRollToFixedFrame(origin, hpr, ellipsoid, scratchENUMatrix4); + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + var transform = Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, scratchENUMatrix4); var rotation = Matrix4.getRotation(transform, scratchHPRMatrix3); return Quaternion.fromRotationMatrix(rotation, result); }; @@ -22448,6 +21543,46 @@ define('Core/Transforms',[ return result; }; + var swizzleMatrix = new Matrix4( + 0.0, 0.0, 1.0, 0.0, + 1.0, 0.0, 0.0, 0.0, + 0.0, 1.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + + /** + * @private + */ + Transforms.wgs84To2DModelMatrix = function(projection, center, result) { + if (!defined(projection)) { + throw new DeveloperError('projection is required.'); + } + if (!defined(center)) { + throw new DeveloperError('center is required.'); + } + if (!defined(result)) { + throw new DeveloperError('result is required.'); + } + + var ellipsoid = projection.ellipsoid; + + var fromENU = Transforms.eastNorthUpToFixedFrame(center, ellipsoid, scratchFromENU); + var toENU = Matrix4.inverseTransformation(fromENU, scratchToENU); + + var cartographic = ellipsoid.cartesianToCartographic(center, scratchCartographic); + var projectedPosition = projection.project(cartographic, scratchCartesian3Projection); + var newOrigin = scratchCartesian4NewOrigin; + newOrigin.x = projectedPosition.z; + newOrigin.y = projectedPosition.x; + newOrigin.z = projectedPosition.y; + newOrigin.w = 1.0; + + var translation = Matrix4.fromTranslation(newOrigin, scratchFromENU); + Matrix4.multiply(swizzleMatrix, toENU, result); + Matrix4.multiply(translation, result, result); + + return result; + }; + return Transforms; }); @@ -22982,7 +22117,7 @@ define('Core/Geometry',[ * <li><code>position</code> - 3D vertex position. 64-bit floating-point (for precision). 3 components per attribute. See {@link VertexFormat#position}.</li> * <li><code>normal</code> - Normal (normalized), commonly used for lighting. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#normal}.</li> * <li><code>st</code> - 2D texture coordinate. 32-bit floating-point. 2 components per attribute. See {@link VertexFormat#st}.</li> - * <li><code>binormal</code> - Binormal (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#binormal}.</li> + * <li><code>bitangent</code> - Bitangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#bitangent}.</li> * <li><code>tangent</code> - Tangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#tangent}.</li> * </ul> * </p> @@ -23011,7 +22146,7 @@ define('Core/Geometry',[ * componentsPerAttribute : 3, * values : new Float32Array(0) * }); - * + * * @see GeometryAttribute * @see VertexFormat */ @@ -23743,6 +22878,118 @@ define('Core/barycentricCoordinates',[ return barycentricCoordinates; }); +/*global define*/ +define('Core/oneTimeWarning',[ + './defaultValue', + './defined', + './DeveloperError' + ], function( + defaultValue, + defined, + DeveloperError) { + "use strict"; + + var warnings = {}; + + /** + * Logs a one time message to the console. Use this function instead of + * <code>console.log</code> directly since this does not log duplicate messages + * unless it is called from multiple workers. + * + * @exports oneTimeWarning + * + * @param {String} identifier The unique identifier for this warning. + * @param {String} [message=identifier] The message to log to the console. + * + * @example + * for(var i=0;i<foo.length;++i) { + * if (!defined(foo[i].bar)) { + * // Something that can be recovered from but may happen a lot + * oneTimeWarning('foo.bar undefined', 'foo.bar is undefined. Setting to 0.'); + * foo[i].bar = 0; + * // ... + * } + * } + * + * @private + */ + function oneTimeWarning(identifier, message) { + if (!defined(identifier)) { + throw new DeveloperError('identifier is required.'); + } + + if (!defined(warnings[identifier])) { + warnings[identifier] = true; + console.warn(defaultValue(message, identifier)); + } + } + + oneTimeWarning.geometryOutlines = 'Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.'; + + return oneTimeWarning; +}); + +/*global define*/ +define('Core/deprecationWarning',[ + './defined', + './DeveloperError', + './oneTimeWarning' + ], function( + defined, + DeveloperError, + oneTimeWarning) { + 'use strict'; + + /** + * Logs a deprecation message to the console. Use this function instead of + * <code>console.log</code> directly since this does not log duplicate messages + * unless it is called from multiple workers. + * + * @exports deprecationWarning + * + * @param {String} identifier The unique identifier for this deprecated API. + * @param {String} message The message to log to the console. + * + * @example + * // Deprecated function or class + * function Foo() { + * deprecationWarning('Foo', 'Foo was deprecated in Cesium 1.01. It will be removed in 1.03. Use newFoo instead.'); + * // ... + * } + * + * // Deprecated function + * Bar.prototype.func = function() { + * deprecationWarning('Bar.func', 'Bar.func() was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newFunc() instead.'); + * // ... + * }; + * + * // Deprecated property + * defineProperties(Bar.prototype, { + * prop : { + * get : function() { + * deprecationWarning('Bar.prop', 'Bar.prop was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newProp instead.'); + * // ... + * }, + * set : function(value) { + * deprecationWarning('Bar.prop', 'Bar.prop was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newProp instead.'); + * // ... + * } + * } + * }); + * + * @private + */ + function deprecationWarning(identifier, message) { + if (!defined(identifier) || !defined(message)) { + throw new DeveloperError('identifier and message are required.'); + } + + oneTimeWarning(identifier, message); + } + + return deprecationWarning; +}); + /*global define*/ define('Core/EncodedCartesian3',[ './Cartesian3', @@ -24378,6 +23625,7 @@ define('Core/GeometryPipeline',[ './ComponentDatatype', './defaultValue', './defined', + './deprecationWarning', './DeveloperError', './EncodedCartesian3', './GeographicProjection', @@ -24404,6 +23652,7 @@ define('Core/GeometryPipeline',[ ComponentDatatype, defaultValue, defined, + deprecationWarning, DeveloperError, EncodedCartesian3, GeographicProjection, @@ -24537,7 +23786,7 @@ define('Core/GeometryPipeline',[ /** * Creates a new {@link Geometry} with <code>LINES</code> representing the provided * attribute (<code>attributeName</code>) for the provided geometry. This is used to - * visualize vector attributes like normals, binormals, and tangents. + * visualize vector attributes like normals, tangents, and bitangents. * * @param {Geometry} geometry The <code>Geometry</code> instance with the attribute. * @param {String} [attributeName='normal'] The name of the attribute. @@ -24547,7 +23796,7 @@ define('Core/GeometryPipeline',[ * @exception {DeveloperError} geometry.attributes must have an attribute with the same name as the attributeName parameter. * * @example - * var geometry = Cesium.GeometryPipeline.createLineSegmentsForVectors(instance.geometry, 'binormal', 100000.0); + * var geometry = Cesium.GeometryPipeline.createLineSegmentsForVectors(instance.geometry, 'bitangent', 100000.0); */ GeometryPipeline.createLineSegmentsForVectors = function(geometry, attributeName, length) { attributeName = defaultValue(attributeName, 'normal'); @@ -24639,8 +23888,11 @@ define('Core/GeometryPipeline',[ // From VertexFormat 'normal', 'st', - 'binormal', 'tangent', + 'bitangent', + + // For shadow volumes + 'extrudeDirection', // From compressing texture coordinates and normals 'compressedAttributes' @@ -24682,7 +23934,7 @@ define('Core/GeometryPipeline',[ * * @example * geometry = Cesium.GeometryPipeline.reorderForPreVertexCache(geometry); - * + * * @see GeometryPipeline.reorderForPostVertexCache */ GeometryPipeline.reorderForPreVertexCache = function(geometry) { @@ -24767,7 +24019,7 @@ define('Core/GeometryPipeline',[ * * @example * geometry = Cesium.GeometryPipeline.reorderForPostVertexCache(geometry); - * + * * @see GeometryPipeline.reorderForPreVertexCache * @see {@link http://gfx.cs.princ0eton.edu/pubs/Sander_2007_%3ETR/tipsy.pdf|Fast Triangle Reordering for Vertex Locality and Reduced Overdraw} * by Sander, Nehab, and Barczak @@ -25119,7 +24371,7 @@ define('Core/GeometryPipeline',[ * Transforms a geometry instance to world coordinates. This changes * the instance's <code>modelMatrix</code> to {@link Matrix4.IDENTITY} and transforms the * following attributes if they are present: <code>position</code>, <code>normal</code>, - * <code>binormal</code>, and <code>tangent</code>. + * <code>tangent</code>, and <code>bitangent</code>. * * @param {GeometryInstance} instance The geometry instance to modify. * @returns {GeometryInstance} The modified <code>instance</code> argument, with its attributes transforms to world coordinates. @@ -25147,16 +24399,16 @@ define('Core/GeometryPipeline',[ transformPoint(modelMatrix, attributes.nextPosition); if ((defined(attributes.normal)) || - (defined(attributes.binormal)) || - (defined(attributes.tangent))) { + (defined(attributes.tangent)) || + (defined(attributes.bitangent))) { Matrix4.inverse(modelMatrix, inverseTranspose); Matrix4.transpose(inverseTranspose, inverseTranspose); Matrix4.getRotation(inverseTranspose, normalMatrix); transformVector(normalMatrix, attributes.normal); - transformVector(normalMatrix, attributes.binormal); transformVector(normalMatrix, attributes.tangent); + transformVector(normalMatrix, attributes.bitangent); } var boundingSphere = instance.geometry.boundingSphere; @@ -25346,7 +24598,7 @@ define('Core/GeometryPipeline',[ * <p> * This is used by {@link Primitive} to efficiently render a large amount of static data. * </p> - * + * * @private * * @param {GeometryInstance[]} [instances] The array of {@link GeometryInstance} objects whose geometry will be combined. @@ -25362,7 +24614,7 @@ define('Core/GeometryPipeline',[ * Cesium.GeometryPipeline.transformToWorldCoordinates(instances[i]); * } * var geometries = Cesium.GeometryPipeline.combineInstances(instances); - * + * * @see GeometryPipeline.transformToWorldCoordinates */ GeometryPipeline.combineInstances = function(instances) { @@ -25538,8 +24790,8 @@ define('Core/GeometryPipeline',[ var tScratch = new Cartesian3(); /** - * Computes per-vertex binormals and tangents for a geometry containing <code>TRIANGLES</code>. - * The result is new <code>binormal</code> and <code>tangent</code> attributes added to the geometry. + * Computes per-vertex tangents and bitangents for a geometry containing <code>TRIANGLES</code>. + * The result is new <code>tangent</code> and <code>bitangent</code> attributes added to the geometry. * This assumes a counter-clockwise winding order. * <p> * Based on <a href="http://www.terathon.com/code/tangent.html">Computing Tangent Space Basis Vectors @@ -25547,15 +24799,15 @@ define('Core/GeometryPipeline',[ * </p> * * @param {Geometry} geometry The geometry to modify. - * @returns {Geometry} The modified <code>geometry</code> argument with the computed <code>binormal</code> and <code>tangent</code> attributes. + * @returns {Geometry} The modified <code>geometry</code> argument with the computed <code>tangent</code> and <code>bitangent</code> attributes. * * @exception {DeveloperError} geometry.indices length must be greater than 0 and be a multiple of 3. * @exception {DeveloperError} geometry.primitiveType must be {@link PrimitiveType.TRIANGLES}. * * @example - * Cesium.GeometryPipeline.computeBinormalAndTangent(geometry); + * Cesium.GeometryPipeline.computeTangentAndBiTangent(geometry); */ - GeometryPipeline.computeBinormalAndTangent = function(geometry) { + GeometryPipeline.computeTangentAndBitangent = function(geometry) { if (!defined(geometry)) { throw new DeveloperError('geometry is required.'); } @@ -25635,8 +24887,8 @@ define('Core/GeometryPipeline',[ tan1[i23 + 2] += sdirz; } - var binormalValues = new Float32Array(numVertices * 3); var tangentValues = new Float32Array(numVertices * 3); + var bitangentValues = new Float32Array(numVertices * 3); for (i = 0; i < numVertices; i++) { i03 = i * 3; @@ -25655,9 +24907,9 @@ define('Core/GeometryPipeline',[ Cartesian3.normalize(Cartesian3.cross(n, t, t), t); - binormalValues[i03] = t.x; - binormalValues[i13] = t.y; - binormalValues[i23] = t.z; + bitangentValues[i03] = t.x; + bitangentValues[i13] = t.y; + bitangentValues[i23] = t.z; } geometry.attributes.tangent = new GeometryAttribute({ @@ -25666,20 +24918,48 @@ define('Core/GeometryPipeline',[ values : tangentValues }); - geometry.attributes.binormal = new GeometryAttribute({ + geometry.attributes.bitangent = new GeometryAttribute({ componentDatatype : ComponentDatatype.FLOAT, componentsPerAttribute : 3, - values : binormalValues + values : bitangentValues }); return geometry; }; + /** + * Computes per-vertex binormal and tangents for a geometry containing <code>TRIANGLES</code>. + * The result is new <code>binormal</code> and <code>tangent</code> attributes added to the geometry. + * This assumes a counter-clockwise winding order. + * <p> + * Based on <a href="http://www.terathon.com/code/tangent.html">Computing Tangent Space Basis Vectors + * for an Arbitrary Mesh</a> by Eric Lengyel. + * </p> + * + * @param {Geometry} geometry The geometry to modify. + * @returns {Geometry} The modified <code>geometry</code> argument with the computed <code>binormal</code> and <code>tangent</code> attributes. + * + * @exception {DeveloperError} geometry.indices length must be greater than 0 and be a multiple of 3. + * @exception {DeveloperError} geometry.primitiveType must be {@link PrimitiveType.TRIANGLES}. + * + * @example + * Cesium.GeometryPipeline.computeBinormalAndTangent(geometry); + * + * @see GeometryPipeline.computeTangentAndBitangent + */ + GeometryPipeline.computeBinormalAndTangent = function(geometry) { + deprecationWarning('computeBinormalAndTangent', 'computeBinormalAndTangent was deprecated in 1.30. It will be removed in 1.31. Use a computeTangentAndBitangent.'); + GeometryPipeline.computeTangentAndBitangent(geometry); + geometry.attributes.binormal = geometry.attributes.bitangent; + + return geometry; + }; + var scratchCartesian2 = new Cartesian2(); var toEncode1 = new Cartesian3(); var toEncode2 = new Cartesian3(); var toEncode3 = new Cartesian3(); - + var encodeResult2 = new Cartesian2(); /** * Compresses and packs geometry normal attribute values to save memory. * @@ -25694,73 +24974,109 @@ define('Core/GeometryPipeline',[ throw new DeveloperError('geometry is required.'); } + var extrudeAttribute = geometry.attributes.extrudeDirection; + var i; + var numVertices; + if (defined(extrudeAttribute)) { + //only shadow volumes use extrudeDirection, and shadow volumes use vertexFormat: POSITION_ONLY so we don't need to check other attributes + var extrudeDirections = extrudeAttribute.values; + numVertices = extrudeDirections.length / 3.0; + var compressedDirections = new Float32Array(numVertices * 2); + + var i2 = 0; + for (i = 0; i < numVertices; ++i) { + Cartesian3.fromArray(extrudeDirections, i * 3.0, toEncode1); + if (Cartesian3.equals(toEncode1, Cartesian3.ZERO)) { + i2 += 2; + continue; + } + encodeResult2 = AttributeCompression.octEncodeInRange(toEncode1, 65535, encodeResult2); + compressedDirections[i2++] = encodeResult2.x; + compressedDirections[i2++] = encodeResult2.y; + } + + geometry.attributes.compressedAttributes = new GeometryAttribute({ + componentDatatype : ComponentDatatype.FLOAT, + componentsPerAttribute : 2, + values : compressedDirections + }); + delete geometry.attributes.extrudeDirection; + return geometry; + } + var normalAttribute = geometry.attributes.normal; var stAttribute = geometry.attributes.st; - if (!defined(normalAttribute) && !defined(stAttribute)) { + + var hasNormal = defined(normalAttribute); + var hasSt = defined(stAttribute); + if (!hasNormal && !hasSt) { return geometry; } var tangentAttribute = geometry.attributes.tangent; - var binormalAttribute = geometry.attributes.binormal; + var bitangentAttribute = geometry.attributes.bitangent; + + var hasTangent = defined(tangentAttribute); + var hasBitangent = defined(bitangentAttribute); var normals; var st; var tangents; - var binormals; + var bitangents; - if (defined(normalAttribute)) { + if (hasNormal) { normals = normalAttribute.values; } - if (defined(stAttribute)) { + if (hasSt) { st = stAttribute.values; } - if (defined(tangentAttribute)) { + if (hasTangent) { tangents = tangentAttribute.values; } - if (binormalAttribute) { - binormals = binormalAttribute.values; + if (hasBitangent) { + bitangents = bitangentAttribute.values; } - var length = defined(normals) ? normals.length : st.length; - var numComponents = defined(normals) ? 3.0 : 2.0; - var numVertices = length / numComponents; + var length = hasNormal ? normals.length : st.length; + var numComponents = hasNormal ? 3.0 : 2.0; + numVertices = length / numComponents; var compressedLength = numVertices; - var numCompressedComponents = defined(st) && defined(normals) ? 2.0 : 1.0; - numCompressedComponents += defined(tangents) || defined(binormals) ? 1.0 : 0.0; + var numCompressedComponents = hasSt && hasNormal ? 2.0 : 1.0; + numCompressedComponents += hasTangent || hasBitangent ? 1.0 : 0.0; compressedLength *= numCompressedComponents; var compressedAttributes = new Float32Array(compressedLength); var normalIndex = 0; - for (var i = 0; i < numVertices; ++i) { - if (defined(st)) { + for (i = 0; i < numVertices; ++i) { + if (hasSt) { Cartesian2.fromArray(st, i * 2.0, scratchCartesian2); compressedAttributes[normalIndex++] = AttributeCompression.compressTextureCoordinates(scratchCartesian2); } var index = i * 3.0; - if (defined(normals) && defined(tangents) && defined(binormals)) { + if (hasNormal && defined(tangents) && defined(bitangents)) { Cartesian3.fromArray(normals, index, toEncode1); Cartesian3.fromArray(tangents, index, toEncode2); - Cartesian3.fromArray(binormals, index, toEncode3); + Cartesian3.fromArray(bitangents, index, toEncode3); AttributeCompression.octPack(toEncode1, toEncode2, toEncode3, scratchCartesian2); compressedAttributes[normalIndex++] = scratchCartesian2.x; compressedAttributes[normalIndex++] = scratchCartesian2.y; } else { - if (defined(normals)) { + if (hasNormal) { Cartesian3.fromArray(normals, index, toEncode1); compressedAttributes[normalIndex++] = AttributeCompression.octEncodeFloat(toEncode1); } - if (defined(tangents)) { + if (hasTangent) { Cartesian3.fromArray(tangents, index, toEncode1); compressedAttributes[normalIndex++] = AttributeCompression.octEncodeFloat(toEncode1); } - if (defined(binormals)) { - Cartesian3.fromArray(binormals, index, toEncode1); + if (hasBitangent) { + Cartesian3.fromArray(bitangents, index, toEncode1); compressedAttributes[normalIndex++] = AttributeCompression.octEncodeFloat(toEncode1); } } @@ -25772,17 +25088,17 @@ define('Core/GeometryPipeline',[ values : compressedAttributes }); - if (defined(normals)) { + if (hasNormal) { delete geometry.attributes.normal; } - if (defined(st)) { + if (hasSt) { delete geometry.attributes.st; } - if (defined(tangents)) { - delete geometry.attributes.tangent; + if (hasBitangent) { + delete geometry.attributes.bitangent; } - if (defined(binormals)) { - delete geometry.attributes.binormal; + if (hasTangent) { + delete geometry.attributes.tangent; } return geometry; @@ -26199,8 +25515,8 @@ define('Core/GeometryPipeline',[ var s1Scratch = new Cartesian2(); var s2Scratch = new Cartesian2(); - function computeTriangleAttributes(i0, i1, i2, point, positions, normals, binormals, tangents, texCoords, currentAttributes, insertedIndex) { - if (!defined(normals) && !defined(binormals) && !defined(tangents) && !defined(texCoords)) { + function computeTriangleAttributes(i0, i1, i2, point, positions, normals, tangents, bitangents, texCoords, extrudeDirections, currentAttributes, insertedIndex) { + if (!defined(normals) && !defined(tangents) && !defined(bitangents) && !defined(texCoords) && !defined(extrudeDirections)) { return; } @@ -26225,20 +25541,27 @@ define('Core/GeometryPipeline',[ Cartesian3.pack(normal, currentAttributes.normal.values, insertedIndex * 3); } - if (defined(binormals)) { - var b0 = Cartesian3.fromArray(binormals, i0 * 3, p0Scratch); - var b1 = Cartesian3.fromArray(binormals, i1 * 3, p1Scratch); - var b2 = Cartesian3.fromArray(binormals, i2 * 3, p2Scratch); - - Cartesian3.multiplyByScalar(b0, coords.x, b0); - Cartesian3.multiplyByScalar(b1, coords.y, b1); - Cartesian3.multiplyByScalar(b2, coords.z, b2); + if (defined(extrudeDirections)) { + var d0 = Cartesian3.fromArray(extrudeDirections, i0 * 3, p0Scratch); + var d1 = Cartesian3.fromArray(extrudeDirections, i1 * 3, p1Scratch); + var d2 = Cartesian3.fromArray(extrudeDirections, i2 * 3, p2Scratch); - var binormal = Cartesian3.add(b0, b1, b0); - Cartesian3.add(binormal, b2, binormal); - Cartesian3.normalize(binormal, binormal); + Cartesian3.multiplyByScalar(d0, coords.x, d0); + Cartesian3.multiplyByScalar(d1, coords.y, d1); + Cartesian3.multiplyByScalar(d2, coords.z, d2); - Cartesian3.pack(binormal, currentAttributes.binormal.values, insertedIndex * 3); + var direction; + if (!Cartesian3.equals(d0, Cartesian3.ZERO) || !Cartesian3.equals(d1, Cartesian3.ZERO) || !Cartesian3.equals(d2, Cartesian3.ZERO)) { + direction = Cartesian3.add(d0, d1, d0); + Cartesian3.add(direction, d2, direction); + Cartesian3.normalize(direction, direction); + } else { + direction = p0Scratch; + direction.x = 0; + direction.y = 0; + direction.z = 0; + } + Cartesian3.pack(direction, currentAttributes.extrudeDirection.values, insertedIndex * 3); } if (defined(tangents)) { @@ -26257,6 +25580,22 @@ define('Core/GeometryPipeline',[ Cartesian3.pack(tangent, currentAttributes.tangent.values, insertedIndex * 3); } + if (defined(bitangents)) { + var b0 = Cartesian3.fromArray(bitangents, i0 * 3, p0Scratch); + var b1 = Cartesian3.fromArray(bitangents, i1 * 3, p1Scratch); + var b2 = Cartesian3.fromArray(bitangents, i2 * 3, p2Scratch); + + Cartesian3.multiplyByScalar(b0, coords.x, b0); + Cartesian3.multiplyByScalar(b1, coords.y, b1); + Cartesian3.multiplyByScalar(b2, coords.z, b2); + + var bitangent = Cartesian3.add(b0, b1, b0); + Cartesian3.add(bitangent, b2, bitangent); + Cartesian3.normalize(bitangent, bitangent); + + Cartesian3.pack(bitangent, currentAttributes.bitangent.values, insertedIndex * 3); + } + if (defined(texCoords)) { var s0 = Cartesian2.fromArray(texCoords, i0 * 2, s0Scratch); var s1 = Cartesian2.fromArray(texCoords, i1 * 2, s1Scratch); @@ -26301,9 +25640,10 @@ define('Core/GeometryPipeline',[ var attributes = geometry.attributes; var positions = attributes.position.values; var normals = (defined(attributes.normal)) ? attributes.normal.values : undefined; - var binormals = (defined(attributes.binormal)) ? attributes.binormal.values : undefined; + var bitangents = (defined(attributes.bitangent)) ? attributes.bitangent.values : undefined; var tangents = (defined(attributes.tangent)) ? attributes.tangent.values : undefined; var texCoords = (defined(attributes.st)) ? attributes.st.values : undefined; + var extrudeDirections = (defined(attributes.extrudeDirection)) ? attributes.extrudeDirection.values : undefined; var indices = geometry.indices; var eastGeometry = copyGeometryForSplit(geometry); @@ -26357,7 +25697,7 @@ define('Core/GeometryPipeline',[ } insertedIndex = insertSplitPoint(currentAttributes, currentIndices, currentIndexMap, indices, resultIndex < 3 ? i + resultIndex : -1, point); - computeTriangleAttributes(i0, i1, i2, point, positions, normals, binormals, tangents, texCoords, currentAttributes, insertedIndex); + computeTriangleAttributes(i0, i1, i2, point, positions, normals, tangents, bitangents, texCoords, extrudeDirections, currentAttributes, insertedIndex); } } else { if (defined(result)) { @@ -26377,13 +25717,13 @@ define('Core/GeometryPipeline',[ } insertedIndex = insertSplitPoint(currentAttributes, currentIndices, currentIndexMap, indices, i, p0); - computeTriangleAttributes(i0, i1, i2, p0, positions, normals, binormals, tangents, texCoords, currentAttributes, insertedIndex); + computeTriangleAttributes(i0, i1, i2, p0, positions, normals, tangents, bitangents, texCoords, extrudeDirections, currentAttributes, insertedIndex); insertedIndex = insertSplitPoint(currentAttributes, currentIndices, currentIndexMap, indices, i + 1, p1); - computeTriangleAttributes(i0, i1, i2, p1, positions, normals, binormals, tangents, texCoords, currentAttributes, insertedIndex); + computeTriangleAttributes(i0, i1, i2, p1, positions, normals, tangents, bitangents, texCoords, extrudeDirections, currentAttributes, insertedIndex); insertedIndex = insertSplitPoint(currentAttributes, currentIndices, currentIndexMap, indices, i + 2, p2); - computeTriangleAttributes(i0, i1, i2, p2, positions, normals, binormals, tangents, texCoords, currentAttributes, insertedIndex); + computeTriangleAttributes(i0, i1, i2, p2, positions, normals, tangents, bitangents, texCoords, extrudeDirections, currentAttributes, insertedIndex); } } @@ -26968,7 +26308,7 @@ define('Core/GeometryAttributes',[ this.st = options.st; /** - * The binormal attribute (normalized), which is used for tangent-space effects like bump mapping. + * The bitangent attribute (normalized), which is used for tangent-space effects like bump mapping. * <p> * 32-bit floating-point. 3 components per attribute. * </p> @@ -26977,7 +26317,7 @@ define('Core/GeometryAttributes',[ * * @default undefined */ - this.binormal = options.binormal; + this.bitangent = options.bitangent; /** * The tangent attribute (normalized), which is used for tangent-space effects like bump mapping. @@ -28646,7 +27986,7 @@ define('Core/VertexFormat',[ this.st = defaultValue(options.st, false); /** - * When <code>true</code>, the vertex has a binormal attribute (normalized), which is used for tangent-space effects like bump mapping. + * When <code>true</code>, the vertex has a bitangent attribute (normalized), which is used for tangent-space effects like bump mapping. * <p> * 32-bit floating-point. 3 components per attribute. * </p> @@ -28655,7 +27995,7 @@ define('Core/VertexFormat',[ * * @default false */ - this.binormal = defaultValue(options.binormal, false); + this.bitangent = defaultValue(options.bitangent, false); /** * When <code>true</code>, the vertex has a tangent attribute (normalized), which is used for tangent-space effects like bump mapping. @@ -28757,7 +28097,7 @@ define('Core/VertexFormat',[ })); /** - * An immutable vertex format with well-known attributes: position, normal, st, binormal, and tangent. + * An immutable vertex format with well-known attributes: position, normal, st, tangent, and bitangent. * * @type {VertexFormat} * @constant @@ -28765,15 +28105,15 @@ define('Core/VertexFormat',[ * @see VertexFormat#position * @see VertexFormat#normal * @see VertexFormat#st - * @see VertexFormat#binormal * @see VertexFormat#tangent + * @see VertexFormat#bitangent */ VertexFormat.ALL = freezeObject(new VertexFormat({ position : true, normal : true, st : true, - binormal : true, - tangent : true + tangent : true, + bitangent : true })); /** @@ -28818,8 +28158,8 @@ define('Core/VertexFormat',[ array[startingIndex++] = value.position ? 1.0 : 0.0; array[startingIndex++] = value.normal ? 1.0 : 0.0; array[startingIndex++] = value.st ? 1.0 : 0.0; - array[startingIndex++] = value.binormal ? 1.0 : 0.0; array[startingIndex++] = value.tangent ? 1.0 : 0.0; + array[startingIndex++] = value.bitangent ? 1.0 : 0.0; array[startingIndex++] = value.color ? 1.0 : 0.0; return array; @@ -28844,19 +28184,19 @@ define('Core/VertexFormat',[ result = new VertexFormat(); } - result.position = array[startingIndex++] === 1.0; - result.normal = array[startingIndex++] === 1.0; - result.st = array[startingIndex++] === 1.0; - result.binormal = array[startingIndex++] === 1.0; - result.tangent = array[startingIndex++] === 1.0; - result.color = array[startingIndex++] === 1.0; + result.position = array[startingIndex++] === 1.0; + result.normal = array[startingIndex++] === 1.0; + result.st = array[startingIndex++] === 1.0; + result.tangent = array[startingIndex++] === 1.0; + result.bitangent = array[startingIndex++] === 1.0; + result.color = array[startingIndex++] === 1.0; return result; }; /** * Duplicates a VertexFormat instance. * - * @param {VertexFormat} cartesian The vertex format to duplicate. + * @param {VertexFormat} vertexFormat The vertex format to duplicate. * @param {VertexFormat} [result] The object onto which to store the result. * @returns {VertexFormat} The modified result parameter or a new VertexFormat instance if one was not provided. (Returns undefined if vertexFormat is undefined) */ @@ -28871,8 +28211,8 @@ define('Core/VertexFormat',[ result.position = vertexFormat.position; result.normal = vertexFormat.normal; result.st = vertexFormat.st; - result.binormal = vertexFormat.binormal; result.tangent = vertexFormat.tangent; + result.bitangent = vertexFormat.bitangent; result.color = vertexFormat.color; return result; }; @@ -28887,6 +28227,7 @@ define('Core/PolygonGeometry',[ './Cartesian2', './Cartesian3', './Cartographic', + './Check', './ComponentDatatype', './defaultValue', './defined', @@ -28913,6 +28254,7 @@ define('Core/PolygonGeometry',[ Cartesian2, Cartesian3, Cartographic, + Check, ComponentDatatype, defaultValue, defined, @@ -28989,12 +28331,12 @@ define('Core/PolygonGeometry',[ var scratchPosition = new Cartesian3(); var scratchNormal = new Cartesian3(); var scratchTangent = new Cartesian3(); - var scratchBinormal = new Cartesian3(); + var scratchBitangent = new Cartesian3(); var p1Scratch = new Cartesian3(); var p2Scratch = new Cartesian3(); var scratchPerPosNormal = new Cartesian3(); var scratchPerPosTangent = new Cartesian3(); - var scratchPerPosBinormal = new Cartesian3(); + var scratchPerPosBitangent = new Cartesian3(); var appendTextureCoordinatesOrigin = new Cartesian2(); var appendTextureCoordinatesCartesian2 = new Cartesian2(); @@ -29005,7 +28347,8 @@ define('Core/PolygonGeometry',[ function computeAttributes(options) { var vertexFormat = options.vertexFormat; var geometry = options.geometry; - if (vertexFormat.st || vertexFormat.normal || vertexFormat.tangent || vertexFormat.binormal) { + var shadowVolume = options.shadowVolume; + if (vertexFormat.st || vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent || shadowVolume) { // PERFORMANCE_IDEA: Compute before subdivision, then just interpolate during subdivision. // PERFORMANCE_IDEA: Compute with createGeometryFromPositions() for fast path when there's no holes. var boundingRectangle = options.boundingRectangle; @@ -29034,14 +28377,15 @@ define('Core/PolygonGeometry',[ } } var tangents = vertexFormat.tangent ? new Float32Array(length) : undefined; - var binormals = vertexFormat.binormal ? new Float32Array(length) : undefined; + var bitangents = vertexFormat.bitangent ? new Float32Array(length) : undefined; + var extrudeNormals = shadowVolume ? new Float32Array(length) : undefined; var textureCoordIndex = 0; var attrIndex = 0; var normal = scratchNormal; var tangent = scratchTangent; - var binormal = scratchBinormal; + var bitangent = scratchBitangent; var recomputeNormal = true; var rotation = Quaternion.fromAxisAngle(tangentPlane._plane.normal, stRotation, appendTextureCoordinatesQuaternion); @@ -29080,7 +28424,7 @@ define('Core/PolygonGeometry',[ textureCoordIndex += 2; } - if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.binormal) { + if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent || shadowVolume) { var attrIndex1 = attrIndex + 1; var attrIndex2 = attrIndex + 2; @@ -29104,28 +28448,28 @@ define('Core/PolygonGeometry',[ } } - if (vertexFormat.tangent || vertexFormat.binormal) { - binormal = ellipsoid.geodeticSurfaceNormal(position, binormal); + if (vertexFormat.tangent || vertexFormat.bitangent) { + bitangent = ellipsoid.geodeticSurfaceNormal(position, bitangent); if (vertexFormat.tangent) { - tangent = Cartesian3.normalize(Cartesian3.cross(binormal, normal, tangent), tangent); + tangent = Cartesian3.normalize(Cartesian3.cross(bitangent, normal, tangent), tangent); } } } else { normal = ellipsoid.geodeticSurfaceNormal(position, normal); - if (vertexFormat.tangent || vertexFormat.binormal) { + if (vertexFormat.tangent || vertexFormat.bitangent) { if (perPositionHeight) { scratchPerPosNormal = Cartesian3.fromArray(normals, attrIndex, scratchPerPosNormal); scratchPerPosTangent = Cartesian3.cross(Cartesian3.UNIT_Z, scratchPerPosNormal, scratchPerPosTangent); scratchPerPosTangent = Cartesian3.normalize(Matrix3.multiplyByVector(textureMatrix, scratchPerPosTangent, scratchPerPosTangent), scratchPerPosTangent); - if (vertexFormat.binormal) { - scratchPerPosBinormal = Cartesian3.normalize(Cartesian3.cross(scratchPerPosNormal, scratchPerPosTangent, scratchPerPosBinormal), scratchPerPosBinormal); + if (vertexFormat.bitangent) { + scratchPerPosBitangent = Cartesian3.normalize(Cartesian3.cross(scratchPerPosNormal, scratchPerPosTangent, scratchPerPosBitangent), scratchPerPosBitangent); } } tangent = Cartesian3.cross(Cartesian3.UNIT_Z, normal, tangent); tangent = Cartesian3.normalize(Matrix3.multiplyByVector(textureMatrix, tangent, tangent), tangent); - if (vertexFormat.binormal) { - binormal = Cartesian3.normalize(Cartesian3.cross(normal, tangent, binormal), binormal); + if (vertexFormat.bitangent) { + bitangent = Cartesian3.normalize(Cartesian3.cross(normal, tangent, bitangent), bitangent); } } } @@ -29148,6 +28492,15 @@ define('Core/PolygonGeometry',[ } } + if (shadowVolume) { + if (wall) { + normal = ellipsoid.geodeticSurfaceNormal(position, normal); + } + extrudeNormals[attrIndex + bottomOffset] = -normal.x; + extrudeNormals[attrIndex1 + bottomOffset] = -normal.y; + extrudeNormals[attrIndex2 + bottomOffset] = -normal.z; + } + if (vertexFormat.tangent) { if (options.wall) { tangents[attrIndex + bottomOffset] = tangent.x; @@ -29172,21 +28525,21 @@ define('Core/PolygonGeometry',[ } } - if (vertexFormat.binormal) { + if (vertexFormat.bitangent) { if (bottom) { - binormals[attrIndex + bottomOffset] = binormal.x; - binormals[attrIndex1 + bottomOffset] = binormal.y; - binormals[attrIndex2 + bottomOffset] = binormal.z; + bitangents[attrIndex + bottomOffset] = bitangent.x; + bitangents[attrIndex1 + bottomOffset] = bitangent.y; + bitangents[attrIndex2 + bottomOffset] = bitangent.z; } if (top) { if (perPositionHeight) { - binormals[attrIndex] = scratchPerPosBinormal.x; - binormals[attrIndex1] = scratchPerPosBinormal.y; - binormals[attrIndex2] = scratchPerPosBinormal.z; + bitangents[attrIndex] = scratchPerPosBitangent.x; + bitangents[attrIndex1] = scratchPerPosBitangent.y; + bitangents[attrIndex2] = scratchPerPosBitangent.z; } else { - binormals[attrIndex] = binormal.x; - binormals[attrIndex1] = binormal.y; - binormals[attrIndex2] = binormal.z; + bitangents[attrIndex] = bitangent.x; + bitangents[attrIndex1] = bitangent.y; + bitangents[attrIndex2] = bitangent.z; } } } @@ -29218,11 +28571,19 @@ define('Core/PolygonGeometry',[ }); } - if (vertexFormat.binormal) { - geometry.attributes.binormal = new GeometryAttribute({ + if (vertexFormat.bitangent) { + geometry.attributes.bitangent = new GeometryAttribute({ + componentDatatype : ComponentDatatype.FLOAT, + componentsPerAttribute : 3, + values : bitangents + }); + } + + if (shadowVolume) { + geometry.attributes.extrudeDirection = new GeometryAttribute({ componentDatatype : ComponentDatatype.FLOAT, componentsPerAttribute : 3, - values : binormals + values : extrudeNormals }); } } @@ -29247,13 +28608,13 @@ define('Core/PolygonGeometry',[ if (closeTop && closeBottom) { var topBottomPositions = edgePoints.concat(edgePoints); + numPositions = topBottomPositions.length / 3; newIndices = IndexDatatype.createTypedArray(numPositions, indices.length * 2); newIndices.set(indices); var ilength = indices.length; - var length = numPositions / 2; for (i = 0; i < ilength; i += 3) { @@ -29418,9 +28779,8 @@ define('Core/PolygonGeometry',[ * var geometry = Cesium.PolygonGeometry.createGeometry(extrudedPolygon); */ function PolygonGeometry(options) { - if (!defined(options) || !defined(options.polygonHierarchy)) { - throw new DeveloperError('options.polygonHierarchy is required.'); - } + Check.typeOf.object('options', options); + Check.typeOf.object('options.polygonHierarchy', options.polygonHierarchy); if (defined(options.perPositionHeight) && options.perPositionHeight && defined(options.height)) { throw new DeveloperError('Cannot use both options.perPositionHeight and options.height'); } @@ -29459,6 +28819,7 @@ define('Core/PolygonGeometry',[ this._closeBottom = defaultValue(options.closeBottom, true); this._polygonHierarchy = polygonHierarchy; this._perPositionHeight = perPositionHeight; + this._shadowVolume = defaultValue(options.shadowVolume, false); this._workerName = 'createPolygonGeometry'; var positions = polygonHierarchy.positions; @@ -29472,7 +28833,7 @@ define('Core/PolygonGeometry',[ * The number of elements used to pack the object into an array. * @type {Number} */ - this.packedLength = PolygonGeometryLibrary.computeHierarchyPackedLength(polygonHierarchy) + Ellipsoid.packedLength + VertexFormat.packedLength + Rectangle.packedLength + 9; + this.packedLength = PolygonGeometryLibrary.computeHierarchyPackedLength(polygonHierarchy) + Ellipsoid.packedLength + VertexFormat.packedLength + Rectangle.packedLength + 10; } /** @@ -29483,7 +28844,7 @@ define('Core/PolygonGeometry',[ * @param {Number} [options.height=0.0] The height of the polygon. * @param {Number} [options.extrudedHeight] The height of the polygon extrusion. * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed. - * @param {Number} [options.stRotation=0.0] The rotation of the texture coordiantes, in radians. A positive rotation is counter-clockwise. + * @param {Number} [options.stRotation=0.0] The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise. * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference. * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. * @param {Boolean} [options.perPositionHeight=false] Use the height of options.positions for each position instead of using options.height to determine the height. @@ -29510,9 +28871,7 @@ define('Core/PolygonGeometry',[ PolygonGeometry.fromPositions = function(options) { options = defaultValue(options, defaultValue.EMPTY_OBJECT); - if (!defined(options.positions)) { - throw new DeveloperError('options.positions is required.'); - } + Check.defined('options.positions', options.positions); var newOptions = { polygonHierarchy : { @@ -29541,12 +28900,8 @@ define('Core/PolygonGeometry',[ * @returns {Number[]} The array that was packed into */ PolygonGeometry.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -29569,6 +28924,7 @@ define('Core/PolygonGeometry',[ array[startingIndex++] = value._perPositionHeight ? 1.0 : 0.0; array[startingIndex++] = value._closeTop ? 1.0 : 0.0; array[startingIndex++] = value._closeBottom ? 1.0 : 0.0; + array[startingIndex++] = value._shadowVolume ? 1.0 : 0.0; array[startingIndex] = value.packedLength; return array; @@ -29591,9 +28947,7 @@ define('Core/PolygonGeometry',[ * @param {PolygonGeometry} [result] The object into which to store the result. */ PolygonGeometry.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -29618,6 +28972,7 @@ define('Core/PolygonGeometry',[ var perPositionHeight = array[startingIndex++] === 1.0; var closeTop = array[startingIndex++] === 1.0; var closeBottom = array[startingIndex++] === 1.0; + var shadowVolume = array[startingIndex++] === 1.0; var packedLength = array[startingIndex]; if (!defined(result)) { @@ -29636,6 +28991,7 @@ define('Core/PolygonGeometry',[ result._closeTop = closeTop; result._closeBottom = closeBottom; result._rectangle = Rectangle.clone(rectangle); + result._shadowVolume = shadowVolume; result.packedLength = packedLength; return result; }; @@ -29698,6 +29054,7 @@ define('Core/PolygonGeometry',[ if (extrude) { options.top = closeTop; options.bottom = closeBottom; + options.shadowVolume = polygonGeometry._shadowVolume; for (i = 0; i < polygons.length; i++) { geometry = createGeometryFromPositionsExtruded(ellipsoid, polygons[i], granularity, hierarchy[i], perPositionHeight, closeTop, closeBottom, vertexFormat); @@ -29778,7 +29135,8 @@ define('Core/PolygonGeometry',[ perPositionHeight : false, extrudedHeight : minHeight, height : maxHeight, - vertexFormat : VertexFormat.POSITION_ONLY + vertexFormat : VertexFormat.POSITION_ONLY, + shadowVolume: true }); }; diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createPolygonOutlineGeometry.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createPolygonOutlineGeometry.js index da43cc6b..17ce7d07 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createPolygonOutlineGeometry.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createPolygonOutlineGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,68 +45,6 @@ define('Core/defined',[],function() { return defined; }); -/*global define*/ -define('Core/freezeObject',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Freezes an object, using Object.freeze if available, otherwise returns - * the object unchanged. This function should be used in setup code to prevent - * errors from completely halting JavaScript execution in legacy browsers. - * - * @private - * - * @exports freezeObject - */ - var freezeObject = Object.freeze; - if (!defined(freezeObject)) { - freezeObject = function(o) { - return o; - }; - } - - return freezeObject; -}); - -/*global define*/ -define('Core/defaultValue',[ - './freezeObject' - ], function( - freezeObject) { - 'use strict'; - - /** - * Returns the first parameter if not undefined, otherwise the second parameter. - * Useful for setting a default value for a parameter. - * - * @exports defaultValue - * - * @param {*} a - * @param {*} b - * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter. - * - * @example - * param = Cesium.defaultValue(param, 'default'); - */ - function defaultValue(a, b) { - if (a !== undefined) { - return a; - } - return b; - } - - /** - * A frozen empty object that can be used as the default value for options passed as - * an object literal. - */ - defaultValue.EMPTY_OBJECT = freezeObject({}); - - return defaultValue; -}); - /*global define*/ define('Core/DeveloperError',[ './defined' @@ -188,41 +126,13 @@ define('Core/DeveloperError',[ return DeveloperError; }); -/*global define*/ -define('Core/isArray',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Tests an object to see if it is an array. - * @exports isArray - * - * @param {Object} value The value to test. - * @returns {Boolean} true if the value is an array, false otherwise. - */ - var isArray = Array.isArray; - if (!defined(isArray)) { - isArray = function(value) { - return Object.prototype.toString.call(value) === '[object Array]'; - }; - } - - return isArray; -}); - /*global define*/ define('Core/Check',[ - './defaultValue', - './defined', - './DeveloperError', - './isArray' + './defined', + './DeveloperError' ], function( - defaultValue, defined, - DeveloperError, - isArray) { + DeveloperError) { 'use strict'; /** @@ -237,111 +147,134 @@ define('Core/Check',[ */ Check.typeOf = {}; - /** - * Contains functions for checking numeric conditions such as minimum and maximum values - */ - Check.numeric = {}; - function getUndefinedErrorMessage(name) { - return name + ' was required but undefined.'; + return name + ' is required, actual value was undefined'; } function getFailedTypeErrorMessage(actual, expected, name) { - return 'Expected ' + name + ' to be typeof ' + expected + ', got ' + actual; + return 'Expected ' + name + ' to be typeof ' + expected + ', actual typeof was ' + actual; } /** * Throws if test is not defined * - * @param {*} test The value that is to be checked * @param {String} name The name of the variable being tested + * @param {*} test The value that is to be checked * @exception {DeveloperError} test must be defined */ - Check.defined = function (test, name) { + Check.defined = function (name, test) { if (!defined(test)) { throw new DeveloperError(getUndefinedErrorMessage(name)); } }; /** - * Throws if test is greater than maximum + * Throws if test is not typeof 'function' * - * @param {Number} test The value to test - * @param {Number} maximum The maximum allowed value - * @exception {DeveloperError} test must not be greater than maximum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'function' */ - Check.numeric.maximum = function (test, maximum) { - Check.typeOf.number(test); - Check.typeOf.number(maximum); - if (test > maximum) { - throw new DeveloperError('Expected ' + test + ' to be at most ' + maximum); + Check.typeOf.func = function (name, test) { + if (typeof test !== 'function') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); } }; /** - * Throws if test is less than minimum + * Throws if test is not typeof 'string' * - * @param {Number} test The value to test - * @param {Number} minimum The minimum allowed value - * @exception {DeveloperError} test must not be less than mininum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'string' */ - Check.numeric.minimum = function (test, minimum) { - Check.typeOf.number(test); - Check.typeOf.number(minimum); - if (test < minimum) { - throw new DeveloperError('Expected ' + test + ' to be at least ' + minimum); + Check.typeOf.string = function (name, test) { + if (typeof test !== 'string') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); } }; /** - * Throws if test is not typeof 'function' + * Throws if test is not typeof 'number' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'function' + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'number' */ - Check.typeOf.function = function (test, name) { - if (typeof test !== 'function') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); + Check.typeOf.number = function (name, test) { + if (typeof test !== 'number') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); } }; /** - * Throws if test is not typeof 'string' + * Throws if test is not typeof 'number' and less than limit * + * @param {String} name The name of the variable being tested * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than limit + */ + Check.typeOf.number.lessThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test >= limit) { + throw new DeveloperError('Expected ' + name + ' to be less than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and less than or equal to limit + * * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'string' + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than or equal to limit */ - Check.typeOf.string = function (test, name) { - if (typeof test !== 'string') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); + Check.typeOf.number.lessThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test > limit) { + throw new DeveloperError('Expected ' + name + ' to be less than or equal to ' + limit + ', actual value was ' + test); } }; /** - * Throws if test is not typeof 'number' + * Throws if test is not typeof 'number' and greater than limit * + * @param {String} name The name of the variable being tested * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than limit + */ + Check.typeOf.number.greaterThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test <= limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and greater than or equal to limit + * * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'number' + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than or equal to limit */ - Check.typeOf.number = function (test, name) { - if (typeof test !== 'number') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); + Check.typeOf.number.greaterThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test < limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than or equal to' + limit + ', actual value was ' + test); } }; /** * Throws if test is not typeof 'object' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested + * @param {*} test The value to test * @exception {DeveloperError} test must be typeof 'object' */ - Check.typeOf.object = function (test, name) { + Check.typeOf.object = function (name, test) { if (typeof test !== 'object') { throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'object', name)); } @@ -350,11 +283,11 @@ define('Core/Check',[ /** * Throws if test is not typeof 'boolean' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested + * @param {*} test The value to test * @exception {DeveloperError} test must be typeof 'boolean' */ - Check.typeOf.boolean = function (test, name) { + Check.typeOf.bool = function (name, test) { if (typeof test !== 'boolean') { throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'boolean', name)); } @@ -363,6 +296,68 @@ define('Core/Check',[ return Check; }); +/*global define*/ +define('Core/freezeObject',[ + './defined' + ], function( + defined) { + 'use strict'; + + /** + * Freezes an object, using Object.freeze if available, otherwise returns + * the object unchanged. This function should be used in setup code to prevent + * errors from completely halting JavaScript execution in legacy browsers. + * + * @private + * + * @exports freezeObject + */ + var freezeObject = Object.freeze; + if (!defined(freezeObject)) { + freezeObject = function(o) { + return o; + }; + } + + return freezeObject; +}); + +/*global define*/ +define('Core/defaultValue',[ + './freezeObject' + ], function( + freezeObject) { + 'use strict'; + + /** + * Returns the first parameter if not undefined, otherwise the second parameter. + * Useful for setting a default value for a parameter. + * + * @exports defaultValue + * + * @param {*} a + * @param {*} b + * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter. + * + * @example + * param = Cesium.defaultValue(param, 'default'); + */ + function defaultValue(a, b) { + if (a !== undefined) { + return a; + } + return b; + } + + /** + * A frozen empty object that can be used as the default value for options passed as + * an object literal. + */ + defaultValue.EMPTY_OBJECT = freezeObject({}); + + return defaultValue; +}); + /* I've wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace so it's better encapsulated. Now you can have multiple random number generators @@ -1047,7 +1042,7 @@ define('Core/Math',[ if (!defined(angle)) { throw new DeveloperError('angle is required.'); } - + return CesiumMath.clamp(angle, -1*CesiumMath.PI_OVER_TWO, CesiumMath.PI_OVER_TWO); }; @@ -1057,11 +1052,11 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [<code>-CesiumMath.PI</code>, <code>CesiumMath.PI</code>]. */ - CesiumMath.negativePiToPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.negativePiToPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - return CesiumMath.zeroToTwoPi(x + CesiumMath.PI) - CesiumMath.PI; + return CesiumMath.zeroToTwoPi(angle + CesiumMath.PI) - CesiumMath.PI; }; /** @@ -1070,12 +1065,12 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [0, <code>CesiumMath.TWO_PI</code>]. */ - CesiumMath.zeroToTwoPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.zeroToTwoPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - var mod = CesiumMath.mod(x, CesiumMath.TWO_PI); - if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(x) > CesiumMath.EPSILON14) { + var mod = CesiumMath.mod(angle, CesiumMath.TWO_PI); + if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(angle) > CesiumMath.EPSILON14) { return CesiumMath.TWO_PI; } return mod; @@ -1145,7 +1140,7 @@ define('Core/Math',[ * @example * //Compute 7!, which is equal to 5040 * var computedFactorial = Cesium.Math.factorial(7); - * + * * @see {@link http://en.wikipedia.org/wiki/Factorial|Factorial on Wikipedia} */ CesiumMath.factorial = function(n) { @@ -1429,7 +1424,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.fromSpherical = function(spherical, result) { - Check.typeOf.object(spherical, 'spherical'); + Check.typeOf.object('spherical', spherical); if (!defined(result)) { result = new Cartesian3(); @@ -1513,8 +1508,8 @@ define('Core/Cartesian3',[ * @returns {Number[]} The array that was packed into */ Cartesian3.pack = function(value, array, startingIndex) { - Check.typeOf.object(value, 'value'); - Check.defined(array, 'array'); + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1534,7 +1529,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.unpack = function(array, startingIndex, result) { - Check.defined(array, 'array'); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1555,7 +1550,7 @@ define('Core/Cartesian3',[ * @returns {Number[]} The packed array. */ Cartesian3.packArray = function(array, result) { - Check.defined(array, 'array'); + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -1578,8 +1573,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3[]} The unpacked array. */ Cartesian3.unpackArray = function(array, result) { - Check.defined(array, 'array'); - Check.numeric.minimum(array.length, 3); + Check.defined('array', array); + Check.typeOf.number.greaterThanOrEquals('array.length', array.length, 3); if (array.length % 3 !== 0) { throw new DeveloperError('array length must be a multiple of 3.'); } @@ -1625,7 +1620,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the maximum component. */ Cartesian3.maximumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z); }; @@ -1637,7 +1632,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the minimum component. */ Cartesian3.minimumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z); }; @@ -1651,9 +1646,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the minimum components. */ Cartesian3.minimumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -1671,9 +1666,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the maximum components. */ Cartesian3.maximumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -1688,7 +1683,7 @@ define('Core/Cartesian3',[ * @returns {Number} The squared magnitude. */ Cartesian3.magnitudeSquared = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z; }; @@ -1717,8 +1712,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distance(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(2.0, 0.0, 0.0)); */ Cartesian3.distance = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitude(distanceScratch); @@ -1737,8 +1732,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distanceSquared(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(3.0, 0.0, 0.0)); */ Cartesian3.distanceSquared = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitudeSquared(distanceScratch); @@ -1752,8 +1747,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.normalize = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian3.magnitude(cartesian); @@ -1776,8 +1771,8 @@ define('Core/Cartesian3',[ * @returns {Number} The dot product. */ Cartesian3.dot = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z; }; @@ -1791,9 +1786,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyComponents = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -1835,9 +1830,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.add = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -1854,9 +1849,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.subtract = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -1873,9 +1868,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -1892,9 +1887,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.divideByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -1910,8 +1905,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.negate = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -1927,8 +1922,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.abs = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -1947,10 +1942,10 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.lerp = function(start, end, t, result) { - Check.typeOf.object(start, 'start'); - Check.typeOf.object(end, 'end'); - Check.typeOf.number(t, 't'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian3.multiplyByScalar(end, t, lerpScratch); result = Cartesian3.multiplyByScalar(start, 1.0 - t, result); @@ -1967,8 +1962,8 @@ define('Core/Cartesian3',[ * @returns {Number} The angle between the Cartesians. */ Cartesian3.angleBetween = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.normalize(left, angleBetweenScratch); Cartesian3.normalize(right, angleBetweenScratch2); @@ -1986,8 +1981,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The most orthogonal axis. */ Cartesian3.mostOrthogonalAxis = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian3.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian3.abs(f, f); @@ -2064,9 +2059,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The cross product. */ Cartesian3.cross = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var leftX = left.x; var leftY = left.y; @@ -2099,8 +2094,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromDegrees(-115.0, 37.0); */ Cartesian3.fromDegrees = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); longitude = CesiumMath.toRadians(longitude); latitude = CesiumMath.toRadians(latitude); @@ -2125,8 +2120,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromRadians(-2.007, 0.645); */ Cartesian3.fromRadians = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); height = defaultValue(height, 0.0); var radiiSquared = defined(ellipsoid) ? ellipsoid.radiiSquared : wgs84RadiiSquared; @@ -2160,7 +2155,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArray([-115.0, 37.0, -107.0, 33.0]); */ Cartesian3.fromDegreesArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -2194,7 +2189,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArray([-2.007, 0.645, -1.867, .575]); */ Cartesian3.fromRadiansArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -2228,7 +2223,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArrayHeights([-115.0, 37.0, 100000.0, -107.0, 33.0, 150000.0]); */ Cartesian3.fromDegreesArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -2263,7 +2258,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArrayHeights([-2.007, 0.645, 100000.0, -1.867, .575, 150000.0]); */ Cartesian3.fromRadiansArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -3010,7 +3005,9 @@ define('Core/Ellipsoid',[ /** * Computes an Ellipsoid from a Cartesian specifying the radii in x, y, and z directions. * - * @param {Cartesian3} [radii=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Cartesian3} [cartesian=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new + * instance should be created. * @returns {Ellipsoid} A new Ellipsoid instance. * * @exception {DeveloperError} All radii components must be greater than or equal to zero. @@ -3750,6 +3747,7 @@ define('Core/Interval',[ /*global define*/ define('Core/Matrix3',[ './Cartesian3', + './Check', './defaultValue', './defined', './defineProperties', @@ -3758,6 +3756,7 @@ define('Core/Matrix3',[ './Math' ], function( Cartesian3, + Check, defaultValue, defined, defineProperties, @@ -3820,13 +3819,8 @@ define('Core/Matrix3',[ * @returns {Number[]} The array that was packed into */ Matrix3.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3852,9 +3846,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. */ Matrix3.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3881,24 +3873,24 @@ define('Core/Matrix3',[ * @param {Matrix3} [result] The object onto which to store the result. * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. (Returns undefined if matrix is undefined) */ - Matrix3.clone = function(values, result) { - if (!defined(values)) { + Matrix3.clone = function(matrix, result) { + if (!defined(matrix)) { return undefined; } if (!defined(result)) { - return new Matrix3(values[0], values[3], values[6], - values[1], values[4], values[7], - values[2], values[5], values[8]); + return new Matrix3(matrix[0], matrix[3], matrix[6], + matrix[1], matrix[4], matrix[7], + matrix[2], matrix[5], matrix[8]); } - result[0] = values[0]; - result[1] = values[1]; - result[2] = values[2]; - result[3] = values[3]; - result[4] = values[4]; - result[5] = values[5]; - result[6] = values[6]; - result[7] = values[7]; - result[8] = values[8]; + result[0] = matrix[0]; + result[1] = matrix[1]; + result[2] = matrix[2]; + result[3] = matrix[3]; + result[4] = matrix[4]; + result[5] = matrix[5]; + result[6] = matrix[6]; + result[7] = matrix[7]; + result[8] = matrix[8]; return result; }; @@ -3924,9 +3916,7 @@ define('Core/Matrix3',[ * var m2 = Cesium.Matrix3.fromArray(v2, 2); */ Matrix3.fromArray = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3954,9 +3944,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values parameter is required'); - } + Check.defined('values', values); return Matrix3.clone(values, result); }; @@ -3970,9 +3958,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix3(values[0], values[1], values[2], @@ -3999,9 +3985,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this quaternion. */ Matrix3.fromQuaternion = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); var x2 = quaternion.x * quaternion.x; var xy = quaternion.x * quaternion.y; @@ -4051,10 +4035,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this headingPitchRoll. */ Matrix3.fromHeadingPitchRoll = function(headingPitchRoll, result) { - if (!defined(headingPitchRoll)) { - throw new DeveloperError('headingPitchRoll is required'); - } - var cosTheta = Math.cos(-headingPitchRoll.pitch); + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + + var cosTheta = Math.cos(-headingPitchRoll.pitch); var cosPsi = Math.cos(-headingPitchRoll.heading); var cosPhi = Math.cos(headingPitchRoll.roll); var sinTheta = Math.sin(-headingPitchRoll.pitch); @@ -4105,9 +4088,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix3( @@ -4143,9 +4124,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromUniformScale(2.0); */ Matrix3.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix3( @@ -4169,7 +4148,7 @@ define('Core/Matrix3',[ /** * Computes a Matrix3 instance representing the cross product equivalent matrix of a Cartesian3 vector. * - * @param {Cartesian3} the vector on the left hand side of the cross product operation. + * @param {Cartesian3} vector the vector on the left hand side of the cross product operation. * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created. * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. * @@ -4181,9 +4160,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromCrossProduct(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromCrossProduct = function(vector, result) { - if (!defined(vector)) { - throw new DeveloperError('vector is required.'); - } + Check.typeOf.object('vector', vector); if (!defined(result)) { return new Matrix3( @@ -4218,9 +4195,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationX = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4259,9 +4234,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationY = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4300,9 +4273,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationZ = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4336,9 +4307,7 @@ define('Core/Matrix3',[ * @returns {Number[]} The modified Array parameter or a new Array instance if one was not provided. */ Matrix3.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5], matrix[6], matrix[7], matrix[8]]; @@ -4372,12 +4341,10 @@ define('Core/Matrix3',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix3.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 2) { - throw new DeveloperError('row must be 0, 1, or 2.'); - } - if (typeof column !== 'number' || column < 0 || column > 2) { - throw new DeveloperError('column must be 0, 1, or 2.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 2); + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 2); return column * 3 + row; }; @@ -4393,16 +4360,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var startIndex = index * 3; var x = matrix[startIndex]; @@ -4427,18 +4388,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); var startIndex = index * 3; @@ -4459,15 +4413,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 3]; @@ -4491,18 +4440,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); result[index] = cartesian.x; @@ -4521,12 +4463,8 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[3], matrix[4], matrix[5], scratchColumn)); @@ -4557,15 +4495,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var column0Row0 = left[0] * right[0] + left[3] * right[1] + left[6] * right[2]; var column0Row1 = left[1] * right[0] + left[4] * right[1] + left[7] * right[2]; @@ -4600,15 +4532,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -4631,15 +4557,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -4662,15 +4582,9 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -4695,15 +4609,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -4734,15 +4642,9 @@ define('Core/Matrix3',[ * @see Matrix3.multiplyByUniformScale */ Matrix3.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); result[0] = matrix[0] * scale.x; result[1] = matrix[1] * scale.x; @@ -4764,12 +4666,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -4791,12 +4689,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var column0Row0 = matrix[0]; var column0Row1 = matrix[3]; @@ -4936,9 +4830,7 @@ define('Core/Matrix3',[ * var c = Cesium.Cartesian3.multiplyByScalar(v, lambda, new Cesium.Cartesian3()); // equal to Cesium.Matrix3.multiplyByVector(a, v) */ Matrix3.computeEigenDecomposition = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); // This routine was created based upon Matrix Computations, 3rd ed., by Golub and Van Loan, // section 8.4.3 The Classical Jacobi Algorithm @@ -4982,12 +4874,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -5009,9 +4897,7 @@ define('Core/Matrix3',[ * @returns {Number} The value of the determinant of the matrix. */ Matrix3.determinant = function(matrix) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); var m11 = matrix[0]; var m21 = matrix[3]; @@ -5036,12 +4922,8 @@ define('Core/Matrix3',[ * @exception {DeveloperError} matrix is not invertible. */ Matrix3.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var m11 = matrix[0]; var m21 = matrix[1]; @@ -5107,9 +4989,7 @@ define('Core/Matrix3',[ * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. */ Matrix3.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -5297,12 +5177,14 @@ define('Core/Matrix3',[ /*global define*/ define('Core/Cartesian4',[ + './Check', './defaultValue', './defined', './DeveloperError', './freezeObject', './Math' ], function( + Check, defaultValue, defined, DeveloperError, @@ -5385,9 +5267,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.fromColor = function(color, result) { - if (!defined(color)) { - throw new DeveloperError('color is required'); - } + Check.typeOf.object('color', color); if (!defined(result)) { return new Cartesian4(color.red, color.green, color.blue, color.alpha); } @@ -5439,12 +5319,8 @@ define('Core/Cartesian4',[ * @returns {Number[]} The array that was packed into */ Cartesian4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5465,9 +5341,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5489,9 +5363,7 @@ define('Core/Cartesian4',[ * @returns {Number[]} The packed array. */ Cartesian4.packArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -5514,9 +5386,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4[]} The unpacked array. */ Cartesian4.unpackArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -5559,9 +5429,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the maximum component. */ Cartesian4.maximumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -5573,9 +5441,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the minimum component. */ Cartesian4.minimumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -5589,15 +5455,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the minimum components. */ Cartesian4.minimumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -5616,15 +5476,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the maximum components. */ Cartesian4.maximumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -5641,9 +5495,7 @@ define('Core/Cartesian4',[ * @returns {Number} The squared magnitude. */ Cartesian4.magnitudeSquared = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z + cartesian.w * cartesian.w; }; @@ -5674,9 +5526,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(2.0, 0.0, 0.0, 0.0)); */ Cartesian4.distance = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitude(distanceScratch); @@ -5697,9 +5548,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(3.0, 0.0, 0.0, 0.0)); */ Cartesian4.distanceSquared = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitudeSquared(distanceScratch); @@ -5713,12 +5563,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.normalize = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian4.magnitude(cartesian); @@ -5742,12 +5588,8 @@ define('Core/Cartesian4',[ * @returns {Number} The dot product. */ Cartesian4.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w; }; @@ -5761,15 +5603,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -5787,15 +5623,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x / right.x; result.y = left.y / right.y; @@ -5813,15 +5643,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -5839,15 +5663,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -5865,15 +5683,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -5891,15 +5703,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -5916,12 +5722,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.negate = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -5938,12 +5740,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.abs = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -5963,18 +5761,10 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian4.multiplyByScalar(end, t, lerpScratch); result = Cartesian4.multiplyByScalar(start, 1.0 - t, result); @@ -5990,12 +5780,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The most orthogonal axis. */ Cartesian4.mostOrthogonalAxis = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian4.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian4.abs(f, f); @@ -6240,6 +6026,7 @@ define('Core/RuntimeError',[ define('Core/Matrix4',[ './Cartesian3', './Cartesian4', + './Check', './defaultValue', './defined', './defineProperties', @@ -6251,6 +6038,7 @@ define('Core/Matrix4',[ ], function( Cartesian3, Cartesian4, + Check, defaultValue, defined, defineProperties, @@ -6341,13 +6129,8 @@ define('Core/Matrix4',[ * @returns {Number[]} The array that was packed into */ Matrix4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -6380,9 +6163,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if one was not provided. */ Matrix4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -6478,9 +6259,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required'); - } + Check.defined('values', values); return Matrix4.clone(values, result); }; @@ -6494,9 +6273,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix4(values[0], values[1], values[2], values[3], @@ -6533,9 +6310,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRotationTranslation = function(rotation, translation, result) { - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } + Check.typeOf.object('rotation', rotation); translation = defaultValue(translation, Cartesian3.ZERO); @@ -6583,15 +6358,9 @@ define('Core/Matrix4',[ * result); */ Matrix4.fromTranslationQuaternionRotationScale = function(translation, rotation, scale, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('translation', translation); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('scale', scale); if (!defined(result)) { result = new Matrix4(); @@ -6652,9 +6421,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromTranslationRotationScale = function(translationRotationScale, result) { - if (!defined(translationRotationScale)) { - throw new DeveloperError('translationRotationScale is required.'); - } + Check.typeOf.object('translationRotationScale', translationRotationScale); return Matrix4.fromTranslationQuaternionRotationScale(translationRotationScale.translation, translationRotationScale.rotation, translationRotationScale.scale, result); }; @@ -6669,9 +6436,7 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByTranslation */ Matrix4.fromTranslation = function(translation, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } + Check.typeOf.object('translation', translation); return Matrix4.fromRotationTranslation(Matrix3.IDENTITY, translation, result); }; @@ -6692,9 +6457,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix4.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix4( @@ -6739,9 +6502,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromUniformScale(2.0); */ Matrix4.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix4(scale, 0.0, 0.0, 0.0, @@ -6781,23 +6542,15 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromCamera = function(camera, result) { - if (!defined(camera)) { - throw new DeveloperError('camera is required.'); - } + Check.typeOf.object('camera', camera); var position = camera.position; var direction = camera.direction; var up = camera.up; - if (!defined(position)) { - throw new DeveloperError('camera.position is required.'); - } - if (!defined(direction)) { - throw new DeveloperError('camera.direction is required.'); - } - if (!defined(up)) { - throw new DeveloperError('camera.up is required.'); - } + Check.typeOf.object('camera.position', position); + Check.typeOf.object('camera.direction', direction); + Check.typeOf.object('camera.up', up); Cartesian3.normalize(direction, fromCameraF); Cartesian3.normalize(Cartesian3.cross(fromCameraF, up, fromCameraR), fromCameraR); @@ -6876,21 +6629,11 @@ define('Core/Matrix4',[ * @exception {DeveloperError} far must be greater than zero. */ Matrix4.computePerspectiveFieldOfView = function(fovY, aspectRatio, near, far, result) { - if (fovY <= 0.0 || fovY > Math.PI) { - throw new DeveloperError('fovY must be in (0, PI].'); - } - if (aspectRatio <= 0.0) { - throw new DeveloperError('aspectRatio must be greater than zero.'); - } - if (near <= 0.0) { - throw new DeveloperError('near must be greater than zero.'); - } - if (far <= 0.0) { - throw new DeveloperError('far must be greater than zero.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThan('fovY', fovY, 0.0); + Check.typeOf.number.lessThan('fovY', fovY, Math.PI); + Check.typeOf.number.greaterThan('near', near, 0.0); + Check.typeOf.number.greaterThan('far', far, 0.0); + Check.typeOf.object('result', result); var bottom = Math.tan(fovY * 0.5); @@ -6931,27 +6674,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeOrthographicOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var a = 1.0 / (right - left); var b = 1.0 / (top - bottom); @@ -6996,27 +6725,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computePerspectiveOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -7057,24 +6772,12 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeInfinitePerspectiveOffCenter = function(left, right, bottom, top, near, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -7122,9 +6825,7 @@ define('Core/Matrix4',[ * }, 0.0, 1.0, new Cesium.Matrix4()); */ Matrix4.computeViewportTransformation = function(viewport, nearDepthRange, farDepthRange, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); viewport = defaultValue(viewport, defaultValue.EMPTY_OBJECT); var x = defaultValue(viewport.x, 0.0); @@ -7176,21 +6877,11 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeView = function(position, direction, up, right, result) { - if (!defined(position)) { - throw new DeveloperError('position is required'); - } - if (!defined(direction)) { - throw new DeveloperError('direction is required'); - } - if (!defined(up)) { - throw new DeveloperError('up is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); + Check.typeOf.object('up', up); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = right.x; result[1] = up.x; @@ -7231,9 +6922,7 @@ define('Core/Matrix4',[ * //creates a = [10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0] */ Matrix4.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], @@ -7277,12 +6966,11 @@ define('Core/Matrix4',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix4.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 3) { - throw new DeveloperError('row must be 0, 1, 2, or 3.'); - } - if (typeof column !== 'number' || column < 0 || column > 3) { - throw new DeveloperError('column must be 0, 1, 2, or 3.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 3); + + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 3); return column * 4 + row; }; @@ -7315,16 +7003,12 @@ define('Core/Matrix4',[ * // a.x = 12.0; a.y = 16.0; a.z = 20.0; a.w = 24.0; */ Matrix4.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var startIndex = index * 4; var x = matrix[startIndex]; @@ -7366,18 +7050,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 96.0, 25.0] */ Matrix4.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); var startIndex = index * 4; @@ -7398,15 +7077,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.setTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -7459,16 +7132,12 @@ define('Core/Matrix4',[ * // a.x = 18.0; a.y = 19.0; a.z = 20.0; a.w = 21.0; */ Matrix4.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 4]; @@ -7509,18 +7178,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 24.0, 25.0] */ Matrix4.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); result[index] = cartesian.x; @@ -7540,12 +7204,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter */ Matrix4.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[4], matrix[5], matrix[6], scratchColumn)); @@ -7577,15 +7237,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -7669,15 +7323,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -7707,15 +7355,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -7756,15 +7398,9 @@ define('Core/Matrix4',[ * var m3 = Cesium.Matrix4.multiplyTransformation(m1, m2, new Cesium.Matrix4()); */ Matrix4.multiplyTransformation = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -7842,15 +7478,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByMatrix3(m, rotation, m); */ Matrix4.multiplyByMatrix3 = function(matrix, rotation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('result', result); var left0 = matrix[0]; var left1 = matrix[1]; @@ -7918,15 +7548,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByTranslation(m, position, m); */ Matrix4.multiplyByTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); var x = translation.x; var y = translation.y; @@ -7978,15 +7602,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByScale */ Matrix4.multiplyByUniformScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scale', scale); + Check.typeOf.object('result', result); uniformScaleScratch.x = scale; uniformScaleScratch.y = scale; @@ -8015,15 +7633,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByUniformScale */ Matrix4.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); var scaleX = scale.x; var scaleY = scale.y; @@ -8062,15 +7674,9 @@ define('Core/Matrix4',[ * @returns {Cartesian4} The modified result parameter. */ Matrix4.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8106,15 +7712,9 @@ define('Core/Matrix4',[ * // Cesium.Matrix4.multiplyByVector(matrix, new Cesium.Cartesian4(p.x, p.y, p.z, 0.0), result); */ Matrix4.multiplyByPointAsVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8144,16 +7744,9 @@ define('Core/Matrix4',[ * var result = Cesium.Matrix4.multiplyByPoint(matrix, p, new Cesium.Cartesian3()); */ Matrix4.multiplyByPoint = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8193,15 +7786,9 @@ define('Core/Matrix4',[ * // [-44.0, -46.0, -48.0, -50.0] */ Matrix4.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -8245,12 +7832,8 @@ define('Core/Matrix4',[ * // [-22.0, -23.0, -24.0, -25.0] */ Matrix4.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -8294,12 +7877,8 @@ define('Core/Matrix4',[ * // [13.0, 17.0, 21.0, 25.0] */ Matrix4.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var matrix1 = matrix[1]; var matrix2 = matrix[2]; @@ -8335,12 +7914,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -8454,9 +8029,7 @@ define('Core/Matrix4',[ * //Prints "Difference between both the matrices is not less than 0.1" on the console */ Matrix4.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -8487,12 +8060,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter. */ Matrix4.getTranslation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = matrix[12]; result.y = matrix[13]; @@ -8523,12 +8092,8 @@ define('Core/Matrix4',[ * // [12.0, 16.0, 20.0] */ Matrix4.getRotation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -8560,12 +8125,8 @@ define('Core/Matrix4',[ * @exception {RuntimeError} matrix is not invertible because its determinate is zero. */ Matrix4.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); // Special case for a zero scale matrix that can occur, for example, // when a model's node has a [0, 0, 0] scale. @@ -8700,15 +8261,11 @@ define('Core/Matrix4',[ * * @param {Matrix4} matrix The matrix to invert. * @param {Matrix4} result The object onto which to store the result. - * @returns {Matrix4} The modified result parameter. - */ - Matrix4.inverseTransformation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + * @returns {Matrix4} The modified result parameter. + */ + Matrix4.inverseTransformation = function(matrix, result) { + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); //This function is an optimized version of the below 4 lines. //var rT = Matrix3.transpose(Matrix4.getRotation(matrix)); @@ -8992,6 +8549,7 @@ define('Core/Matrix4',[ /*global define*/ define('Core/Rectangle',[ './Cartographic', + './Check', './defaultValue', './defined', './defineProperties', @@ -9001,6 +8559,7 @@ define('Core/Rectangle',[ './Math' ], function( Cartographic, + Check, defaultValue, defined, defineProperties, @@ -9097,13 +8656,8 @@ define('Core/Rectangle',[ * @returns {Number[]} The array that was packed into */ Rectangle.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -9124,9 +8678,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -9147,9 +8699,7 @@ define('Core/Rectangle',[ * @returns {Number} The width. */ Rectangle.computeWidth = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; if (east < west) { @@ -9164,9 +8714,7 @@ define('Core/Rectangle',[ * @returns {Number} The height. */ Rectangle.computeHeight = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); return rectangle.north - rectangle.south; }; @@ -9201,6 +8749,32 @@ define('Core/Rectangle',[ return result; }; + /** + * Creates an rectangle given the boundary longitude and latitude in radians. + * + * @param {Number} [west=0.0] The westernmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [south=0.0] The southernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Number} [east=0.0] The easternmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [north=0.0] The northernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Rectangle} [result] The object onto which to store the result, or undefined if a new instance should be created. + * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. + * + * @example + * var rectangle = Cesium.Rectangle.fromRadians(0.0, Math.PI/4, Math.PI/8, 3*Math.PI/4); + */ + Rectangle.fromRadians = function(west, south, east, north, result) { + if (!defined(result)) { + return new Rectangle(west, south, east, north); + } + + result.west = defaultValue(west, 0.0); + result.south = defaultValue(south, 0.0); + result.east = defaultValue(east, 0.0); + result.north = defaultValue(north, 0.0); + + return result; + }; + /** * Creates the smallest possible Rectangle that encloses all positions in the provided array. * @@ -9209,9 +8783,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartographicArray = function(cartographics, result) { - if (!defined(cartographics)) { - throw new DeveloperError('cartographics is required.'); - } + Check.defined('cartographics', cartographics); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -9264,9 +8836,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartesianArray = function(cartesians, ellipsoid, result) { - if (!defined(cartesians)) { - throw new DeveloperError('cartesians is required.'); - } + Check.defined('cartesians', cartesians); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -9382,9 +8952,7 @@ define('Core/Rectangle',[ * @returns {Boolean} <code>true</code> if the Rectangles are within the provided epsilon, <code>false</code> otherwise. */ Rectangle.prototype.equalsEpsilon = function(other, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon is required and must be a number.'); - } + Check.typeOf.number('epsilon', epsilon); return defined(other) && (Math.abs(this.west - other.west) <= epsilon) && @@ -9404,45 +8972,23 @@ define('Core/Rectangle',[ * @exception {DeveloperError} <code>west</code> must be in the interval [<code>-Pi</code>, <code>Pi</code>]. */ Rectangle.validate = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var north = rectangle.north; - if (typeof north !== 'number') { - throw new DeveloperError('north is required to be a number.'); - } - - if (north < -CesiumMath.PI_OVER_TWO || north > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('north must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('north', north, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('north', north, CesiumMath.PI_OVER_TWO); var south = rectangle.south; - if (typeof south !== 'number') { - throw new DeveloperError('south is required to be a number.'); - } - - if (south < -CesiumMath.PI_OVER_TWO || south > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('south must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('south', south, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('south', south, CesiumMath.PI_OVER_TWO); var west = rectangle.west; - if (typeof west !== 'number') { - throw new DeveloperError('west is required to be a number.'); - } - - if (west < -Math.PI || west > Math.PI) { - throw new DeveloperError('west must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('west', west, -Math.PI); + Check.typeOf.number.lessThanOrEquals('west', west, Math.PI); var east = rectangle.east; - if (typeof east !== 'number') { - throw new DeveloperError('east is required to be a number.'); - } - - if (east < -Math.PI || east > Math.PI) { - throw new DeveloperError('east must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('east', east, -Math.PI); + Check.typeOf.number.lessThanOrEquals('east', east, Math.PI); }; /** @@ -9453,9 +8999,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.south); @@ -9474,9 +9018,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.north); @@ -9495,9 +9037,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.north); @@ -9516,9 +9056,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.south); @@ -9537,9 +9075,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.center = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; @@ -9574,12 +9110,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.intersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var rectangleEast = rectangle.east; var rectangleWest = rectangle.west; @@ -9635,12 +9167,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.simpleIntersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var west = Math.max(rectangle.west, otherRectangle.west); var south = Math.max(rectangle.south, otherRectangle.south); @@ -9671,12 +9199,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.union = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); if (!defined(result)) { result = new Rectangle(); @@ -9720,12 +9244,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.expand = function(rectangle, cartographic, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); if (!defined(result)) { result = new Rectangle(); @@ -9747,12 +9267,8 @@ define('Core/Rectangle',[ * @returns {Boolean} true if the provided cartographic is inside the rectangle, false otherwise. */ Rectangle.contains = function(rectangle, cartographic) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); var longitude = cartographic.longitude; var latitude = cartographic.latitude; @@ -9785,9 +9301,7 @@ define('Core/Rectangle',[ * @returns {Cartesian3[]} The modified result parameter or a new Array of Cartesians instances if none was provided. */ Rectangle.subsample = function(rectangle, ellipsoid, surfaceHeight, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84); surfaceHeight = defaultValue(surfaceHeight, 0.0); @@ -9865,9 +9379,9 @@ define('Core/Rectangle',[ define('Core/BoundingSphere',[ './Cartesian3', './Cartographic', + './Check', './defaultValue', './defined', - './DeveloperError', './Ellipsoid', './GeographicProjection', './Intersect', @@ -9878,9 +9392,9 @@ define('Core/BoundingSphere',[ ], function( Cartesian3, Cartographic, + Check, defaultValue, defined, - DeveloperError, Ellipsoid, GeographicProjection, Intersect, @@ -10210,9 +9724,7 @@ define('Core/BoundingSphere',[ stride = defaultValue(stride, 3); - if (stride < 3) { - throw new DeveloperError('stride must be 3 or greater.'); - } + Check.typeOf.number.greaterThanOrEquals('stride', stride, 3); var currentPos = fromPointsCurrentPos; currentPos.x = positions[0] + center.x; @@ -10516,9 +10028,8 @@ define('Core/BoundingSphere',[ * var sphere = Cesium.BoundingSphere.fromCornerPoints(new Cesium.Cartesian3(-0.5, -0.5, -0.5), new Cesium.Cartesian3(0.5, 0.5, 0.5)); */ BoundingSphere.fromCornerPoints = function(corner, oppositeCorner, result) { - if (!defined(corner) || !defined(oppositeCorner)) { - throw new DeveloperError('corner and oppositeCorner are required.'); - } + Check.typeOf.object('corner', corner); + Check.typeOf.object('oppositeCorner', oppositeCorner); if (!defined(result)) { result = new BoundingSphere(); @@ -10542,9 +10053,7 @@ define('Core/BoundingSphere',[ * var boundingSphere = Cesium.BoundingSphere.fromEllipsoid(ellipsoid); */ BoundingSphere.fromEllipsoid = function(ellipsoid, result) { - if (!defined(ellipsoid)) { - throw new DeveloperError('ellipsoid is required.'); - } + Check.typeOf.object('ellipsoid', ellipsoid); if (!defined(result)) { result = new BoundingSphere(); @@ -10670,13 +10179,8 @@ define('Core/BoundingSphere',[ * @returns {Number[]} The array that was packed into */ BoundingSphere.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -10698,9 +10202,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if one was not provided. */ BoundingSphere.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -10727,13 +10229,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.union = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); if (!defined(result)) { result = new BoundingSphere(); @@ -10782,13 +10279,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.expand = function(sphere, point, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(point)) { - throw new DeveloperError('point is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('point', point); result = BoundingSphere.clone(sphere, result); @@ -10811,13 +10303,8 @@ define('Core/BoundingSphere',[ * intersects the plane. */ BoundingSphere.intersectPlane = function(sphere, plane) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(plane)) { - throw new DeveloperError('plane is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('plane', plane); var center = sphere.center; var radius = sphere.radius; @@ -10843,13 +10330,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.transform = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -10877,12 +10359,8 @@ define('Core/BoundingSphere',[ * }); */ BoundingSphere.distanceSquaredTo = function(sphere, cartesian) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('cartesian', cartesian); var diff = Cartesian3.subtract(sphere.center, cartesian, distanceSquaredToScratch); return Cartesian3.magnitudeSquared(diff) - sphere.radius * sphere.radius; @@ -10904,13 +10382,8 @@ define('Core/BoundingSphere',[ * var newBoundingSphere = Cesium.BoundingSphere.transformWithoutScale(boundingSphere, modelMatrix); */ BoundingSphere.transformWithoutScale = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -10937,17 +10410,9 @@ define('Core/BoundingSphere',[ * @returns {Interval} The nearest and farthest distances on the bounding sphere from position in direction. */ BoundingSphere.computePlaneDistances = function(sphere, position, direction, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(position)) { - throw new DeveloperError('position is required.'); - } - - if (!defined(direction)) { - throw new DeveloperError('direction is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); if (!defined(result)) { result = new Interval(); @@ -10982,9 +10447,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.projectTo2D = function(sphere, projection, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } + Check.typeOf.object('sphere', sphere); projection = defaultValue(projection, projectTo2DProjection); @@ -11079,12 +10542,8 @@ define('Core/BoundingSphere',[ * @returns {Boolean} <code>true</code> if the sphere is not visible; otherwise <code>false</code>. */ BoundingSphere.isOccluded = function(sphere, occluder) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(occluder)) { - throw new DeveloperError('occluder is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('occluder', occluder); return !occluder.isBoundingSphereVisible(sphere); }; @@ -12293,7 +11752,10 @@ define('Core/WebGLConstants',[ COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : 0x9279, TEXTURE_IMMUTABLE_FORMAT : 0x912F, MAX_ELEMENT_INDEX : 0x8D6B, - TEXTURE_IMMUTABLE_LEVELS : 0x82DF + TEXTURE_IMMUTABLE_LEVELS : 0x82DF, + + // Extensions + MAX_TEXTURE_MAX_ANISOTROPY_EXT : 0x84FF }; return freezeObject(WebGLConstants); @@ -12861,12 +12323,14 @@ define('Core/AxisAlignedBoundingBox',[ /*global define*/ define('Core/Cartesian2',[ + './Check', './defaultValue', './defined', './DeveloperError', './freezeObject', './Math' ], function( + Check, defaultValue, defined, DeveloperError, @@ -12978,12 +12442,8 @@ define('Core/Cartesian2',[ * @returns {Number[]} The array that was packed into */ Cartesian2.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -13002,9 +12462,7 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided. */ Cartesian2.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -13024,9 +12482,7 @@ define('Core/Cartesian2',[ * @returns {Number[]} The packed array. */ Cartesian2.packArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -13049,9 +12505,7 @@ define('Core/Cartesian2',[ * @returns {Cartesian2[]} The unpacked array. */ Cartesian2.unpackArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -13094,9 +12548,7 @@ define('Core/Cartesian2',[ * @returns {Number} The value of the maximum component. */ Cartesian2.maximumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y); }; @@ -13108,9 +12560,7 @@ define('Core/Cartesian2',[ * @returns {Number} The value of the minimum component. */ Cartesian2.minimumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y); }; @@ -13124,15 +12574,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} A cartesian with the minimum components. */ Cartesian2.minimumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); @@ -13150,15 +12594,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} A cartesian with the maximum components. */ Cartesian2.maximumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -13172,9 +12610,7 @@ define('Core/Cartesian2',[ * @returns {Number} The squared magnitude. */ Cartesian2.magnitudeSquared = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y; }; @@ -13240,12 +12676,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.normalize = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian2.magnitude(cartesian); @@ -13267,12 +12699,8 @@ define('Core/Cartesian2',[ * @returns {Number} The dot product. */ Cartesian2.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y; }; @@ -13286,15 +12714,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.multiplyComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -13310,15 +12732,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.divideComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x / right.x; result.y = left.y / right.y; @@ -13334,15 +12750,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -13358,15 +12768,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -13382,15 +12786,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.multiplyByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -13406,15 +12804,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.divideByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -13429,12 +12821,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.negate = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -13449,12 +12837,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.abs = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -13472,18 +12856,10 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian2.multiplyByScalar(end, t, lerpScratch); result = Cartesian2.multiplyByScalar(start, 1.0 - t, result); @@ -13500,12 +12876,8 @@ define('Core/Cartesian2',[ * @returns {Number} The angle between the Cartesians. */ Cartesian2.angleBetween = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian2.normalize(left, angleBetweenScratch); Cartesian2.normalize(right, angleBetweenScratch2); @@ -13521,12 +12893,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The most orthogonal axis. */ Cartesian2.mostOrthogonalAxis = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian2.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian2.abs(f, f); @@ -14433,6 +13801,7 @@ define('Core/IntersectionTests',[ './defaultValue', './defined', './DeveloperError', + './Interval', './Math', './Matrix3', './QuadraticRealPolynomial', @@ -14444,6 +13813,7 @@ define('Core/IntersectionTests',[ defaultValue, defined, DeveloperError, + Interval, CesiumMath, Matrix3, QuadraticRealPolynomial, @@ -14715,7 +14085,7 @@ define('Core/IntersectionTests',[ function raySphere(ray, sphere, result) { if (!defined(result)) { - result = {}; + result = new Interval(); } var origin = ray.origin; @@ -14746,8 +14116,8 @@ define('Core/IntersectionTests',[ * * @param {Ray} ray The ray. * @param {BoundingSphere} sphere The sphere. - * @param {Object} [result] The result onto which to store the result. - * @returns {Object} An object with the first (<code>start</code>) and the second (<code>stop</code>) intersection scalars for points along the ray or undefined if there are no intersections. + * @param {Interval} [result] The result onto which to store the result. + * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections. */ IntersectionTests.raySphere = function(ray, sphere, result) { if (!defined(ray)) { @@ -14775,8 +14145,8 @@ define('Core/IntersectionTests',[ * @param {Cartesian3} p0 An end point of the line segment. * @param {Cartesian3} p1 The other end point of the line segment. * @param {BoundingSphere} sphere The sphere. - * @param {Object} [result] The result onto which to store the result. - * @returns {Object} An object with the first (<code>start</code>) and the second (<code>stop</code>) intersection scalars for points along the line segment or undefined if there are no intersections. + * @param {Interval} [result] The result onto which to store the result. + * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections. */ IntersectionTests.lineSegmentSphere = function(p0, p1, sphere, result) { if (!defined(p0)) { @@ -14814,7 +14184,7 @@ define('Core/IntersectionTests',[ * * @param {Ray} ray The ray. * @param {Ellipsoid} ellipsoid The ellipsoid. - * @returns {Object} An object with the first (<code>start</code>) and the second (<code>stop</code>) intersection scalars for points along the ray or undefined if there are no intersections. + * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections. */ IntersectionTests.rayEllipsoid = function(ray, ellipsoid) { if (!defined(ray)) { @@ -14856,10 +14226,7 @@ define('Core/IntersectionTests',[ var root0 = temp / w2; var root1 = difference / temp; if (root0 < root1) { - return { - start : root0, - stop : root1 - }; + return new Interval(root0, root1); } return { @@ -14869,10 +14236,7 @@ define('Core/IntersectionTests',[ } else { // qw2 == product. Repeated roots (2 intersections). var root = Math.sqrt(difference / w2); - return { - start : root, - stop : root - }; + return new Interval(root, root); } } else if (q2 < 1.0) { // Inside ellipsoid (2 intersections). @@ -14882,19 +14246,13 @@ define('Core/IntersectionTests',[ discriminant = qw * qw - product; temp = -qw + Math.sqrt(discriminant); // Positively valued. - return { - start : 0.0, - stop : temp / w2 - }; + return new Interval(0.0, temp / w2); } else { // q2 == 1.0. On ellipsoid. if (qw < 0.0) { // Looking inward. w2 = Cartesian3.magnitudeSquared(w); - return { - start : 0.0, - stop : -qw / w2 - }; + return new Interval(0.0, -qw / w2); } // qw >= 0.0. Looking outward or tangent. @@ -16247,118 +15605,6 @@ define('ThirdParty/when',[],function () { // Boilerplate for AMD, Node, and browser global ); -/*global define*/ -define('Core/oneTimeWarning',[ - './defaultValue', - './defined', - './DeveloperError' - ], function( - defaultValue, - defined, - DeveloperError) { - "use strict"; - - var warnings = {}; - - /** - * Logs a one time message to the console. Use this function instead of - * <code>console.log</code> directly since this does not log duplicate messages - * unless it is called from multiple workers. - * - * @exports oneTimeWarning - * - * @param {String} identifier The unique identifier for this warning. - * @param {String} [message=identifier] The message to log to the console. - * - * @example - * for(var i=0;i<foo.length;++i) { - * if (!defined(foo[i].bar)) { - * // Something that can be recovered from but may happen a lot - * oneTimeWarning('foo.bar undefined', 'foo.bar is undefined. Setting to 0.'); - * foo[i].bar = 0; - * // ... - * } - * } - * - * @private - */ - function oneTimeWarning(identifier, message) { - if (!defined(identifier)) { - throw new DeveloperError('identifier is required.'); - } - - if (!defined(warnings[identifier])) { - warnings[identifier] = true; - console.log(defaultValue(message, identifier)); - } - } - - oneTimeWarning.geometryOutlines = 'Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.'; - - return oneTimeWarning; -}); - -/*global define*/ -define('Core/deprecationWarning',[ - './defined', - './DeveloperError', - './oneTimeWarning' - ], function( - defined, - DeveloperError, - oneTimeWarning) { - 'use strict'; - - /** - * Logs a deprecation message to the console. Use this function instead of - * <code>console.log</code> directly since this does not log duplicate messages - * unless it is called from multiple workers. - * - * @exports deprecationWarning - * - * @param {String} identifier The unique identifier for this deprecated API. - * @param {String} message The message to log to the console. - * - * @example - * // Deprecated function or class - * function Foo() { - * deprecationWarning('Foo', 'Foo was deprecated in Cesium 1.01. It will be removed in 1.03. Use newFoo instead.'); - * // ... - * } - * - * // Deprecated function - * Bar.prototype.func = function() { - * deprecationWarning('Bar.func', 'Bar.func() was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newFunc() instead.'); - * // ... - * }; - * - * // Deprecated property - * defineProperties(Bar.prototype, { - * prop : { - * get : function() { - * deprecationWarning('Bar.prop', 'Bar.prop was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newProp instead.'); - * // ... - * }, - * set : function(value) { - * deprecationWarning('Bar.prop', 'Bar.prop was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newProp instead.'); - * // ... - * } - * } - * }); - * - * @private - */ - function deprecationWarning(identifier, message) { - if (!defined(identifier) || !defined(message)) { - throw new DeveloperError('identifier and message are required.'); - } - - oneTimeWarning(identifier, message); - } - - return deprecationWarning; -}); - /*global define*/ define('Core/binarySearch',[ './defined', @@ -20068,6 +19314,7 @@ define('Core/Iau2006XysData',[ /*global define*/ define('Core/Quaternion',[ './Cartesian3', + './Check', './defaultValue', './defined', './DeveloperError', @@ -20077,6 +19324,7 @@ define('Core/Quaternion',[ './Matrix3' ], function( Cartesian3, + Check, defaultValue, defined, DeveloperError, @@ -20139,12 +19387,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided. */ Quaternion.fromAxisAngle = function(axis, angle, result) { - if (!defined(axis)) { - throw new DeveloperError('axis is required.'); - } - if (typeof angle !== 'number') { - throw new DeveloperError('angle is required and must be a number.'); - } + Check.typeOf.object('axis', axis); + Check.typeOf.number('angle', angle); var halfAngle = angle / 2.0; var s = Math.sin(halfAngle); @@ -20176,9 +19420,7 @@ define('Core/Quaternion',[ * @see Matrix3.fromQuaternion */ Quaternion.fromRotationMatrix = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); var root; var x; @@ -20252,15 +19494,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter or a new Quaternion instance if none was provided. */ Quaternion.fromHeadingPitchRoll = function(heading, pitch, roll, result) { - if (!defined(heading)) { - throw new DeveloperError('heading is required.'); - } - if (!defined(pitch)) { - throw new DeveloperError('pitch is required.'); - } - if (!defined(roll)) { - throw new DeveloperError('roll is required.'); - } + Check.typeOf.number('heading', heading); + Check.typeOf.number('pitch', pitch); + Check.typeOf.number('roll', roll); var rollQuaternion = Quaternion.fromAxisAngle(Cartesian3.UNIT_X, roll, scratchHPRQuaternion); var pitchQuaternion = Quaternion.fromAxisAngle(Cartesian3.UNIT_Y, -pitch, result); @@ -20291,13 +19527,8 @@ define('Core/Quaternion',[ * @returns {Number[]} The array that was packed into */ Quaternion.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -20318,9 +19549,7 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided. */ Quaternion.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -20375,7 +19604,7 @@ define('Core/Quaternion',[ * * @param {Number[]} array The array previously packed for interpolation. * @param {Number[]} sourceArray The original packed array. - * @param {Number} [startingIndex=0] The startingIndex used to convert the array. + * @param {Number} [firstIndex=0] The firstIndex used to convert the array. * @param {Number} [lastIndex=packedArray.length] The lastIndex used to convert the array. * @param {Quaternion} [result] The object into which to store the result. * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided. @@ -20429,12 +19658,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.conjugate = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); result.x = -quaternion.x; result.y = -quaternion.y; @@ -20450,9 +19675,7 @@ define('Core/Quaternion',[ * @returns {Number} The magnitude squared. */ Quaternion.magnitudeSquared = function(quaternion) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); return quaternion.x * quaternion.x + quaternion.y * quaternion.y + quaternion.z * quaternion.z + quaternion.w * quaternion.w; }; @@ -20475,9 +19698,7 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.normalize = function(quaternion, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); var inverseMagnitude = 1.0 / Quaternion.magnitude(quaternion); var x = quaternion.x * inverseMagnitude; @@ -20500,9 +19721,7 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.inverse = function(quaternion, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); var magnitudeSquared = Quaternion.magnitudeSquared(quaternion); result = Quaternion.conjugate(quaternion, result); @@ -20518,15 +19737,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -20544,15 +19757,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -20569,12 +19776,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.negate = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); result.x = -quaternion.x; result.y = -quaternion.y; @@ -20591,12 +19794,8 @@ define('Core/Quaternion',[ * @returns {Number} The dot product. */ Quaternion.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w; }; @@ -20610,15 +19809,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var leftX = left.x; var leftY = left.y; @@ -20651,15 +19844,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.multiplyByScalar = function(quaternion, scalar, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = quaternion.x * scalar; result.y = quaternion.y * scalar; @@ -20677,15 +19864,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.divideByScalar = function(quaternion, scalar, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = quaternion.x / scalar; result.y = quaternion.y / scalar; @@ -20702,12 +19883,8 @@ define('Core/Quaternion',[ * @returns {Cartesian3} The modified result parameter. */ Quaternion.computeAxis = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); var w = quaternion.w; if (Math.abs(w - 1.0) < CesiumMath.EPSILON6) { @@ -20730,9 +19907,7 @@ define('Core/Quaternion',[ * @returns {Number} The angle of rotation. */ Quaternion.computeAngle = function(quaternion) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); if (Math.abs(quaternion.w - 1.0) < CesiumMath.EPSILON6) { return 0.0; @@ -20751,18 +19926,10 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); lerpScratch = Quaternion.multiplyByScalar(end, t, lerpScratch); result = Quaternion.multiplyByScalar(start, 1.0 - t, result); @@ -20784,18 +19951,10 @@ define('Core/Quaternion',[ * @see Quaternion#fastSlerp */ Quaternion.slerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var dot = Quaternion.dot(start, end); @@ -20828,12 +19987,8 @@ define('Core/Quaternion',[ * @returns {Cartesian3} The modified result parameter. */ Quaternion.log = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); var theta = CesiumMath.acosClamped(quaternion.w); var thetaOverSinTheta = 0.0; @@ -20852,13 +20007,9 @@ define('Core/Quaternion',[ * @param {Quaternion} result The object onto which to store the result. * @returns {Quaternion} The modified result parameter. */ - Quaternion.exp = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Quaternion.exp = function(cartesian, result) { + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var theta = Cartesian3.magnitude(cartesian); var sinThetaOverTheta = 0.0; @@ -20893,12 +20044,10 @@ define('Core/Quaternion',[ * @see Quaternion#squad */ Quaternion.computeInnerQuadrangle = function(q0, q1, q2, result) { - if (!defined(q0) || !defined(q1) || !defined(q2)) { - throw new DeveloperError('q0, q1, and q2 are required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('q0', q0); + Check.typeOf.object('q1', q1); + Check.typeOf.object('q2', q2); + Check.typeOf.object('result', result); var qInv = Quaternion.conjugate(q1, squadScratchQuaternion0); Quaternion.multiply(qInv, q2, squadScratchQuaternion1); @@ -20940,15 +20089,12 @@ define('Core/Quaternion',[ * @see Quaternion#computeInnerQuadrangle */ Quaternion.squad = function(q0, q1, s0, s1, t, result) { - if (!defined(q0) || !defined(q1) || !defined(s0) || !defined(s1)) { - throw new DeveloperError('q0, q1, s0, and s1 are required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('q0', q0); + Check.typeOf.object('q1', q1); + Check.typeOf.object('s0', s0); + Check.typeOf.object('s1', s1); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var slerp0 = Quaternion.slerp(q0, q1, t, squadScratchQuaternion0); var slerp1 = Quaternion.slerp(s0, s1, t, squadScratchQuaternion1); @@ -20985,18 +20131,10 @@ define('Core/Quaternion',[ * @see Quaternion#slerp */ Quaternion.fastSlerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var x = Quaternion.dot(start, end); @@ -21045,15 +20183,12 @@ define('Core/Quaternion',[ * @see Quaternion#squad */ Quaternion.fastSquad = function(q0, q1, s0, s1, t, result) { - if (!defined(q0) || !defined(q1) || !defined(s0) || !defined(s1)) { - throw new DeveloperError('q0, q1, s0, and s1 are required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('q0', q0); + Check.typeOf.object('q1', q1); + Check.typeOf.object('s0', s0); + Check.typeOf.object('s1', s1); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var slerp0 = Quaternion.fastSlerp(q0, q1, t, squadScratchQuaternion0); var slerp1 = Quaternion.fastSlerp(s0, s1, t, squadScratchQuaternion1); @@ -21089,9 +20224,7 @@ define('Core/Quaternion',[ * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. */ Quaternion.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon is required and must be a number.'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || ((defined(left)) && @@ -21171,9 +20304,9 @@ define('Core/Transforms',[ './Cartesian3', './Cartesian4', './Cartographic', + './Check', './defaultValue', './defined', - './deprecationWarning', './DeveloperError', './EarthOrientationParameters', './EarthOrientationParametersSample', @@ -21193,9 +20326,9 @@ define('Core/Transforms',[ Cartesian3, Cartesian4, Cartographic, + Check, defaultValue, defined, - deprecationWarning, DeveloperError, EarthOrientationParameters, EarthOrientationParametersSample, @@ -21631,19 +20764,12 @@ define('Core/Transforms',[ * var hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll); * var transform = Cesium.Transforms.headingPitchRollToFixedFrame(center, hpr); */ - Transforms.headingPitchRollToFixedFrame = function(origin, headingPitchRoll, pitch, roll, ellipsoid, result) { - var heading; - if (typeof headingPitchRoll === 'object') { - // Shift arguments using assignments to encourage JIT optimization. - ellipsoid = pitch; - result = roll; - heading = headingPitchRoll.heading; - pitch = headingPitchRoll.pitch; - roll = headingPitchRoll.roll; - } else { - deprecationWarning('headingPitchRollToFixedFrame', 'headingPitchRollToFixedFrame with separate heading, pitch, and roll arguments was deprecated in 1.27. It will be removed in 1.30. Use a HeadingPitchRoll object.'); - heading = headingPitchRoll; - } + Transforms.headingPitchRollToFixedFrame = function(origin, headingPitchRoll, ellipsoid, result) { + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + var heading = headingPitchRoll.heading; + var pitch = headingPitchRoll.pitch; + var roll = headingPitchRoll.roll; + // checks for required parameters happen in the called functions var hprQuaternion = Quaternion.fromHeadingPitchRoll(heading, pitch, roll, scratchHPRQuaternion); var hprMatrix = Matrix4.fromTranslationQuaternionRotationScale(Cartesian3.ZERO, hprQuaternion, scratchScale, scratchHPRMatrix4); @@ -21651,7 +20777,6 @@ define('Core/Transforms',[ return Matrix4.multiply(result, hprMatrix, result); }; - var scratchHPR = new HeadingPitchRoll(); var scratchENUMatrix4 = new Matrix4(); var scratchHPRMatrix3 = new Matrix3(); @@ -21676,22 +20801,10 @@ define('Core/Transforms',[ * var hpr = new HeadingPitchRoll(heading, pitch, roll); * var quaternion = Cesium.Transforms.headingPitchRollQuaternion(center, hpr); */ - Transforms.headingPitchRollQuaternion = function(origin, headingPitchRoll, pitch, roll, ellipsoid, result) { - var hpr; - if (typeof headingPitchRoll === 'object') { - // Shift arguments using assignment to encourage JIT optimization. - hpr = headingPitchRoll; - ellipsoid = pitch; - result = roll; - } else { - deprecationWarning('headingPitchRollQuaternion', 'headingPitchRollQuaternion with separate heading, pitch, and roll arguments was deprecated in 1.27. It will be removed in 1.30. Use a HeadingPitchRoll object.'); - scratchHPR.heading = headingPitchRoll; - scratchHPR.pitch = pitch; - scratchHPR.roll = roll; - hpr = scratchHPR; - } + Transforms.headingPitchRollQuaternion = function(origin, headingPitchRoll, ellipsoid, result) { // checks for required parameters happen in the called functions - var transform = Transforms.headingPitchRollToFixedFrame(origin, hpr, ellipsoid, scratchENUMatrix4); + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + var transform = Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, scratchENUMatrix4); var rotation = Matrix4.getRotation(transform, scratchHPRMatrix3); return Quaternion.fromRotationMatrix(rotation, result); }; @@ -22167,6 +21280,46 @@ define('Core/Transforms',[ return result; }; + var swizzleMatrix = new Matrix4( + 0.0, 0.0, 1.0, 0.0, + 1.0, 0.0, 0.0, 0.0, + 0.0, 1.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + + /** + * @private + */ + Transforms.wgs84To2DModelMatrix = function(projection, center, result) { + if (!defined(projection)) { + throw new DeveloperError('projection is required.'); + } + if (!defined(center)) { + throw new DeveloperError('center is required.'); + } + if (!defined(result)) { + throw new DeveloperError('result is required.'); + } + + var ellipsoid = projection.ellipsoid; + + var fromENU = Transforms.eastNorthUpToFixedFrame(center, ellipsoid, scratchFromENU); + var toENU = Matrix4.inverseTransformation(fromENU, scratchToENU); + + var cartographic = ellipsoid.cartesianToCartographic(center, scratchCartographic); + var projectedPosition = projection.project(cartographic, scratchCartesian3Projection); + var newOrigin = scratchCartesian4NewOrigin; + newOrigin.x = projectedPosition.z; + newOrigin.y = projectedPosition.x; + newOrigin.z = projectedPosition.y; + newOrigin.w = 1.0; + + var translation = Matrix4.fromTranslation(newOrigin, scratchFromENU); + Matrix4.multiply(swizzleMatrix, toENU, result); + Matrix4.multiply(translation, result, result); + + return result; + }; + return Transforms; }); @@ -22701,7 +21854,7 @@ define('Core/Geometry',[ * <li><code>position</code> - 3D vertex position. 64-bit floating-point (for precision). 3 components per attribute. See {@link VertexFormat#position}.</li> * <li><code>normal</code> - Normal (normalized), commonly used for lighting. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#normal}.</li> * <li><code>st</code> - 2D texture coordinate. 32-bit floating-point. 2 components per attribute. See {@link VertexFormat#st}.</li> - * <li><code>binormal</code> - Binormal (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#binormal}.</li> + * <li><code>bitangent</code> - Bitangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#bitangent}.</li> * <li><code>tangent</code> - Tangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#tangent}.</li> * </ul> * </p> @@ -22730,7 +21883,7 @@ define('Core/Geometry',[ * componentsPerAttribute : 3, * values : new Float32Array(0) * }); - * + * * @see GeometryAttribute * @see VertexFormat */ @@ -23011,7 +22164,7 @@ define('Core/GeometryAttributes',[ this.st = options.st; /** - * The binormal attribute (normalized), which is used for tangent-space effects like bump mapping. + * The bitangent attribute (normalized), which is used for tangent-space effects like bump mapping. * <p> * 32-bit floating-point. 3 components per attribute. * </p> @@ -23020,7 +22173,7 @@ define('Core/GeometryAttributes',[ * * @default undefined */ - this.binormal = options.binormal; + this.bitangent = options.bitangent; /** * The tangent attribute (normalized), which is used for tangent-space effects like bump mapping. @@ -23558,6 +22711,118 @@ define('Core/barycentricCoordinates',[ return barycentricCoordinates; }); +/*global define*/ +define('Core/oneTimeWarning',[ + './defaultValue', + './defined', + './DeveloperError' + ], function( + defaultValue, + defined, + DeveloperError) { + "use strict"; + + var warnings = {}; + + /** + * Logs a one time message to the console. Use this function instead of + * <code>console.log</code> directly since this does not log duplicate messages + * unless it is called from multiple workers. + * + * @exports oneTimeWarning + * + * @param {String} identifier The unique identifier for this warning. + * @param {String} [message=identifier] The message to log to the console. + * + * @example + * for(var i=0;i<foo.length;++i) { + * if (!defined(foo[i].bar)) { + * // Something that can be recovered from but may happen a lot + * oneTimeWarning('foo.bar undefined', 'foo.bar is undefined. Setting to 0.'); + * foo[i].bar = 0; + * // ... + * } + * } + * + * @private + */ + function oneTimeWarning(identifier, message) { + if (!defined(identifier)) { + throw new DeveloperError('identifier is required.'); + } + + if (!defined(warnings[identifier])) { + warnings[identifier] = true; + console.warn(defaultValue(message, identifier)); + } + } + + oneTimeWarning.geometryOutlines = 'Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.'; + + return oneTimeWarning; +}); + +/*global define*/ +define('Core/deprecationWarning',[ + './defined', + './DeveloperError', + './oneTimeWarning' + ], function( + defined, + DeveloperError, + oneTimeWarning) { + 'use strict'; + + /** + * Logs a deprecation message to the console. Use this function instead of + * <code>console.log</code> directly since this does not log duplicate messages + * unless it is called from multiple workers. + * + * @exports deprecationWarning + * + * @param {String} identifier The unique identifier for this deprecated API. + * @param {String} message The message to log to the console. + * + * @example + * // Deprecated function or class + * function Foo() { + * deprecationWarning('Foo', 'Foo was deprecated in Cesium 1.01. It will be removed in 1.03. Use newFoo instead.'); + * // ... + * } + * + * // Deprecated function + * Bar.prototype.func = function() { + * deprecationWarning('Bar.func', 'Bar.func() was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newFunc() instead.'); + * // ... + * }; + * + * // Deprecated property + * defineProperties(Bar.prototype, { + * prop : { + * get : function() { + * deprecationWarning('Bar.prop', 'Bar.prop was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newProp instead.'); + * // ... + * }, + * set : function(value) { + * deprecationWarning('Bar.prop', 'Bar.prop was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newProp instead.'); + * // ... + * } + * } + * }); + * + * @private + */ + function deprecationWarning(identifier, message) { + if (!defined(identifier) || !defined(message)) { + throw new DeveloperError('identifier and message are required.'); + } + + oneTimeWarning(identifier, message); + } + + return deprecationWarning; +}); + /*global define*/ define('Core/EncodedCartesian3',[ './Cartesian3', @@ -24193,6 +23458,7 @@ define('Core/GeometryPipeline',[ './ComponentDatatype', './defaultValue', './defined', + './deprecationWarning', './DeveloperError', './EncodedCartesian3', './GeographicProjection', @@ -24219,6 +23485,7 @@ define('Core/GeometryPipeline',[ ComponentDatatype, defaultValue, defined, + deprecationWarning, DeveloperError, EncodedCartesian3, GeographicProjection, @@ -24352,7 +23619,7 @@ define('Core/GeometryPipeline',[ /** * Creates a new {@link Geometry} with <code>LINES</code> representing the provided * attribute (<code>attributeName</code>) for the provided geometry. This is used to - * visualize vector attributes like normals, binormals, and tangents. + * visualize vector attributes like normals, tangents, and bitangents. * * @param {Geometry} geometry The <code>Geometry</code> instance with the attribute. * @param {String} [attributeName='normal'] The name of the attribute. @@ -24362,7 +23629,7 @@ define('Core/GeometryPipeline',[ * @exception {DeveloperError} geometry.attributes must have an attribute with the same name as the attributeName parameter. * * @example - * var geometry = Cesium.GeometryPipeline.createLineSegmentsForVectors(instance.geometry, 'binormal', 100000.0); + * var geometry = Cesium.GeometryPipeline.createLineSegmentsForVectors(instance.geometry, 'bitangent', 100000.0); */ GeometryPipeline.createLineSegmentsForVectors = function(geometry, attributeName, length) { attributeName = defaultValue(attributeName, 'normal'); @@ -24454,8 +23721,11 @@ define('Core/GeometryPipeline',[ // From VertexFormat 'normal', 'st', - 'binormal', 'tangent', + 'bitangent', + + // For shadow volumes + 'extrudeDirection', // From compressing texture coordinates and normals 'compressedAttributes' @@ -24497,7 +23767,7 @@ define('Core/GeometryPipeline',[ * * @example * geometry = Cesium.GeometryPipeline.reorderForPreVertexCache(geometry); - * + * * @see GeometryPipeline.reorderForPostVertexCache */ GeometryPipeline.reorderForPreVertexCache = function(geometry) { @@ -24582,7 +23852,7 @@ define('Core/GeometryPipeline',[ * * @example * geometry = Cesium.GeometryPipeline.reorderForPostVertexCache(geometry); - * + * * @see GeometryPipeline.reorderForPreVertexCache * @see {@link http://gfx.cs.princ0eton.edu/pubs/Sander_2007_%3ETR/tipsy.pdf|Fast Triangle Reordering for Vertex Locality and Reduced Overdraw} * by Sander, Nehab, and Barczak @@ -24934,7 +24204,7 @@ define('Core/GeometryPipeline',[ * Transforms a geometry instance to world coordinates. This changes * the instance's <code>modelMatrix</code> to {@link Matrix4.IDENTITY} and transforms the * following attributes if they are present: <code>position</code>, <code>normal</code>, - * <code>binormal</code>, and <code>tangent</code>. + * <code>tangent</code>, and <code>bitangent</code>. * * @param {GeometryInstance} instance The geometry instance to modify. * @returns {GeometryInstance} The modified <code>instance</code> argument, with its attributes transforms to world coordinates. @@ -24962,16 +24232,16 @@ define('Core/GeometryPipeline',[ transformPoint(modelMatrix, attributes.nextPosition); if ((defined(attributes.normal)) || - (defined(attributes.binormal)) || - (defined(attributes.tangent))) { + (defined(attributes.tangent)) || + (defined(attributes.bitangent))) { Matrix4.inverse(modelMatrix, inverseTranspose); Matrix4.transpose(inverseTranspose, inverseTranspose); Matrix4.getRotation(inverseTranspose, normalMatrix); transformVector(normalMatrix, attributes.normal); - transformVector(normalMatrix, attributes.binormal); transformVector(normalMatrix, attributes.tangent); + transformVector(normalMatrix, attributes.bitangent); } var boundingSphere = instance.geometry.boundingSphere; @@ -25161,7 +24431,7 @@ define('Core/GeometryPipeline',[ * <p> * This is used by {@link Primitive} to efficiently render a large amount of static data. * </p> - * + * * @private * * @param {GeometryInstance[]} [instances] The array of {@link GeometryInstance} objects whose geometry will be combined. @@ -25177,7 +24447,7 @@ define('Core/GeometryPipeline',[ * Cesium.GeometryPipeline.transformToWorldCoordinates(instances[i]); * } * var geometries = Cesium.GeometryPipeline.combineInstances(instances); - * + * * @see GeometryPipeline.transformToWorldCoordinates */ GeometryPipeline.combineInstances = function(instances) { @@ -25353,8 +24623,8 @@ define('Core/GeometryPipeline',[ var tScratch = new Cartesian3(); /** - * Computes per-vertex binormals and tangents for a geometry containing <code>TRIANGLES</code>. - * The result is new <code>binormal</code> and <code>tangent</code> attributes added to the geometry. + * Computes per-vertex tangents and bitangents for a geometry containing <code>TRIANGLES</code>. + * The result is new <code>tangent</code> and <code>bitangent</code> attributes added to the geometry. * This assumes a counter-clockwise winding order. * <p> * Based on <a href="http://www.terathon.com/code/tangent.html">Computing Tangent Space Basis Vectors @@ -25362,15 +24632,15 @@ define('Core/GeometryPipeline',[ * </p> * * @param {Geometry} geometry The geometry to modify. - * @returns {Geometry} The modified <code>geometry</code> argument with the computed <code>binormal</code> and <code>tangent</code> attributes. + * @returns {Geometry} The modified <code>geometry</code> argument with the computed <code>tangent</code> and <code>bitangent</code> attributes. * * @exception {DeveloperError} geometry.indices length must be greater than 0 and be a multiple of 3. * @exception {DeveloperError} geometry.primitiveType must be {@link PrimitiveType.TRIANGLES}. * * @example - * Cesium.GeometryPipeline.computeBinormalAndTangent(geometry); + * Cesium.GeometryPipeline.computeTangentAndBiTangent(geometry); */ - GeometryPipeline.computeBinormalAndTangent = function(geometry) { + GeometryPipeline.computeTangentAndBitangent = function(geometry) { if (!defined(geometry)) { throw new DeveloperError('geometry is required.'); } @@ -25450,8 +24720,8 @@ define('Core/GeometryPipeline',[ tan1[i23 + 2] += sdirz; } - var binormalValues = new Float32Array(numVertices * 3); var tangentValues = new Float32Array(numVertices * 3); + var bitangentValues = new Float32Array(numVertices * 3); for (i = 0; i < numVertices; i++) { i03 = i * 3; @@ -25470,9 +24740,9 @@ define('Core/GeometryPipeline',[ Cartesian3.normalize(Cartesian3.cross(n, t, t), t); - binormalValues[i03] = t.x; - binormalValues[i13] = t.y; - binormalValues[i23] = t.z; + bitangentValues[i03] = t.x; + bitangentValues[i13] = t.y; + bitangentValues[i23] = t.z; } geometry.attributes.tangent = new GeometryAttribute({ @@ -25481,20 +24751,48 @@ define('Core/GeometryPipeline',[ values : tangentValues }); - geometry.attributes.binormal = new GeometryAttribute({ + geometry.attributes.bitangent = new GeometryAttribute({ componentDatatype : ComponentDatatype.FLOAT, componentsPerAttribute : 3, - values : binormalValues + values : bitangentValues }); return geometry; }; + /** + * Computes per-vertex binormal and tangents for a geometry containing <code>TRIANGLES</code>. + * The result is new <code>binormal</code> and <code>tangent</code> attributes added to the geometry. + * This assumes a counter-clockwise winding order. + * <p> + * Based on <a href="http://www.terathon.com/code/tangent.html">Computing Tangent Space Basis Vectors + * for an Arbitrary Mesh</a> by Eric Lengyel. + * </p> + * + * @param {Geometry} geometry The geometry to modify. + * @returns {Geometry} The modified <code>geometry</code> argument with the computed <code>binormal</code> and <code>tangent</code> attributes. + * + * @exception {DeveloperError} geometry.indices length must be greater than 0 and be a multiple of 3. + * @exception {DeveloperError} geometry.primitiveType must be {@link PrimitiveType.TRIANGLES}. + * + * @example + * Cesium.GeometryPipeline.computeBinormalAndTangent(geometry); + * + * @see GeometryPipeline.computeTangentAndBitangent + */ + GeometryPipeline.computeBinormalAndTangent = function(geometry) { + deprecationWarning('computeBinormalAndTangent', 'computeBinormalAndTangent was deprecated in 1.30. It will be removed in 1.31. Use a computeTangentAndBitangent.'); + GeometryPipeline.computeTangentAndBitangent(geometry); + geometry.attributes.binormal = geometry.attributes.bitangent; + + return geometry; + }; + var scratchCartesian2 = new Cartesian2(); var toEncode1 = new Cartesian3(); var toEncode2 = new Cartesian3(); var toEncode3 = new Cartesian3(); - + var encodeResult2 = new Cartesian2(); /** * Compresses and packs geometry normal attribute values to save memory. * @@ -25509,73 +24807,109 @@ define('Core/GeometryPipeline',[ throw new DeveloperError('geometry is required.'); } + var extrudeAttribute = geometry.attributes.extrudeDirection; + var i; + var numVertices; + if (defined(extrudeAttribute)) { + //only shadow volumes use extrudeDirection, and shadow volumes use vertexFormat: POSITION_ONLY so we don't need to check other attributes + var extrudeDirections = extrudeAttribute.values; + numVertices = extrudeDirections.length / 3.0; + var compressedDirections = new Float32Array(numVertices * 2); + + var i2 = 0; + for (i = 0; i < numVertices; ++i) { + Cartesian3.fromArray(extrudeDirections, i * 3.0, toEncode1); + if (Cartesian3.equals(toEncode1, Cartesian3.ZERO)) { + i2 += 2; + continue; + } + encodeResult2 = AttributeCompression.octEncodeInRange(toEncode1, 65535, encodeResult2); + compressedDirections[i2++] = encodeResult2.x; + compressedDirections[i2++] = encodeResult2.y; + } + + geometry.attributes.compressedAttributes = new GeometryAttribute({ + componentDatatype : ComponentDatatype.FLOAT, + componentsPerAttribute : 2, + values : compressedDirections + }); + delete geometry.attributes.extrudeDirection; + return geometry; + } + var normalAttribute = geometry.attributes.normal; var stAttribute = geometry.attributes.st; - if (!defined(normalAttribute) && !defined(stAttribute)) { + + var hasNormal = defined(normalAttribute); + var hasSt = defined(stAttribute); + if (!hasNormal && !hasSt) { return geometry; } var tangentAttribute = geometry.attributes.tangent; - var binormalAttribute = geometry.attributes.binormal; + var bitangentAttribute = geometry.attributes.bitangent; + + var hasTangent = defined(tangentAttribute); + var hasBitangent = defined(bitangentAttribute); var normals; var st; var tangents; - var binormals; + var bitangents; - if (defined(normalAttribute)) { + if (hasNormal) { normals = normalAttribute.values; } - if (defined(stAttribute)) { + if (hasSt) { st = stAttribute.values; } - if (defined(tangentAttribute)) { + if (hasTangent) { tangents = tangentAttribute.values; } - if (binormalAttribute) { - binormals = binormalAttribute.values; + if (hasBitangent) { + bitangents = bitangentAttribute.values; } - var length = defined(normals) ? normals.length : st.length; - var numComponents = defined(normals) ? 3.0 : 2.0; - var numVertices = length / numComponents; + var length = hasNormal ? normals.length : st.length; + var numComponents = hasNormal ? 3.0 : 2.0; + numVertices = length / numComponents; var compressedLength = numVertices; - var numCompressedComponents = defined(st) && defined(normals) ? 2.0 : 1.0; - numCompressedComponents += defined(tangents) || defined(binormals) ? 1.0 : 0.0; + var numCompressedComponents = hasSt && hasNormal ? 2.0 : 1.0; + numCompressedComponents += hasTangent || hasBitangent ? 1.0 : 0.0; compressedLength *= numCompressedComponents; var compressedAttributes = new Float32Array(compressedLength); var normalIndex = 0; - for (var i = 0; i < numVertices; ++i) { - if (defined(st)) { + for (i = 0; i < numVertices; ++i) { + if (hasSt) { Cartesian2.fromArray(st, i * 2.0, scratchCartesian2); compressedAttributes[normalIndex++] = AttributeCompression.compressTextureCoordinates(scratchCartesian2); } var index = i * 3.0; - if (defined(normals) && defined(tangents) && defined(binormals)) { + if (hasNormal && defined(tangents) && defined(bitangents)) { Cartesian3.fromArray(normals, index, toEncode1); Cartesian3.fromArray(tangents, index, toEncode2); - Cartesian3.fromArray(binormals, index, toEncode3); + Cartesian3.fromArray(bitangents, index, toEncode3); AttributeCompression.octPack(toEncode1, toEncode2, toEncode3, scratchCartesian2); compressedAttributes[normalIndex++] = scratchCartesian2.x; compressedAttributes[normalIndex++] = scratchCartesian2.y; } else { - if (defined(normals)) { + if (hasNormal) { Cartesian3.fromArray(normals, index, toEncode1); compressedAttributes[normalIndex++] = AttributeCompression.octEncodeFloat(toEncode1); } - if (defined(tangents)) { + if (hasTangent) { Cartesian3.fromArray(tangents, index, toEncode1); compressedAttributes[normalIndex++] = AttributeCompression.octEncodeFloat(toEncode1); } - if (defined(binormals)) { - Cartesian3.fromArray(binormals, index, toEncode1); + if (hasBitangent) { + Cartesian3.fromArray(bitangents, index, toEncode1); compressedAttributes[normalIndex++] = AttributeCompression.octEncodeFloat(toEncode1); } } @@ -25587,17 +24921,17 @@ define('Core/GeometryPipeline',[ values : compressedAttributes }); - if (defined(normals)) { + if (hasNormal) { delete geometry.attributes.normal; } - if (defined(st)) { + if (hasSt) { delete geometry.attributes.st; } - if (defined(tangents)) { - delete geometry.attributes.tangent; + if (hasBitangent) { + delete geometry.attributes.bitangent; } - if (defined(binormals)) { - delete geometry.attributes.binormal; + if (hasTangent) { + delete geometry.attributes.tangent; } return geometry; @@ -26014,8 +25348,8 @@ define('Core/GeometryPipeline',[ var s1Scratch = new Cartesian2(); var s2Scratch = new Cartesian2(); - function computeTriangleAttributes(i0, i1, i2, point, positions, normals, binormals, tangents, texCoords, currentAttributes, insertedIndex) { - if (!defined(normals) && !defined(binormals) && !defined(tangents) && !defined(texCoords)) { + function computeTriangleAttributes(i0, i1, i2, point, positions, normals, tangents, bitangents, texCoords, extrudeDirections, currentAttributes, insertedIndex) { + if (!defined(normals) && !defined(tangents) && !defined(bitangents) && !defined(texCoords) && !defined(extrudeDirections)) { return; } @@ -26040,20 +25374,27 @@ define('Core/GeometryPipeline',[ Cartesian3.pack(normal, currentAttributes.normal.values, insertedIndex * 3); } - if (defined(binormals)) { - var b0 = Cartesian3.fromArray(binormals, i0 * 3, p0Scratch); - var b1 = Cartesian3.fromArray(binormals, i1 * 3, p1Scratch); - var b2 = Cartesian3.fromArray(binormals, i2 * 3, p2Scratch); - - Cartesian3.multiplyByScalar(b0, coords.x, b0); - Cartesian3.multiplyByScalar(b1, coords.y, b1); - Cartesian3.multiplyByScalar(b2, coords.z, b2); + if (defined(extrudeDirections)) { + var d0 = Cartesian3.fromArray(extrudeDirections, i0 * 3, p0Scratch); + var d1 = Cartesian3.fromArray(extrudeDirections, i1 * 3, p1Scratch); + var d2 = Cartesian3.fromArray(extrudeDirections, i2 * 3, p2Scratch); - var binormal = Cartesian3.add(b0, b1, b0); - Cartesian3.add(binormal, b2, binormal); - Cartesian3.normalize(binormal, binormal); + Cartesian3.multiplyByScalar(d0, coords.x, d0); + Cartesian3.multiplyByScalar(d1, coords.y, d1); + Cartesian3.multiplyByScalar(d2, coords.z, d2); - Cartesian3.pack(binormal, currentAttributes.binormal.values, insertedIndex * 3); + var direction; + if (!Cartesian3.equals(d0, Cartesian3.ZERO) || !Cartesian3.equals(d1, Cartesian3.ZERO) || !Cartesian3.equals(d2, Cartesian3.ZERO)) { + direction = Cartesian3.add(d0, d1, d0); + Cartesian3.add(direction, d2, direction); + Cartesian3.normalize(direction, direction); + } else { + direction = p0Scratch; + direction.x = 0; + direction.y = 0; + direction.z = 0; + } + Cartesian3.pack(direction, currentAttributes.extrudeDirection.values, insertedIndex * 3); } if (defined(tangents)) { @@ -26072,6 +25413,22 @@ define('Core/GeometryPipeline',[ Cartesian3.pack(tangent, currentAttributes.tangent.values, insertedIndex * 3); } + if (defined(bitangents)) { + var b0 = Cartesian3.fromArray(bitangents, i0 * 3, p0Scratch); + var b1 = Cartesian3.fromArray(bitangents, i1 * 3, p1Scratch); + var b2 = Cartesian3.fromArray(bitangents, i2 * 3, p2Scratch); + + Cartesian3.multiplyByScalar(b0, coords.x, b0); + Cartesian3.multiplyByScalar(b1, coords.y, b1); + Cartesian3.multiplyByScalar(b2, coords.z, b2); + + var bitangent = Cartesian3.add(b0, b1, b0); + Cartesian3.add(bitangent, b2, bitangent); + Cartesian3.normalize(bitangent, bitangent); + + Cartesian3.pack(bitangent, currentAttributes.bitangent.values, insertedIndex * 3); + } + if (defined(texCoords)) { var s0 = Cartesian2.fromArray(texCoords, i0 * 2, s0Scratch); var s1 = Cartesian2.fromArray(texCoords, i1 * 2, s1Scratch); @@ -26116,9 +25473,10 @@ define('Core/GeometryPipeline',[ var attributes = geometry.attributes; var positions = attributes.position.values; var normals = (defined(attributes.normal)) ? attributes.normal.values : undefined; - var binormals = (defined(attributes.binormal)) ? attributes.binormal.values : undefined; + var bitangents = (defined(attributes.bitangent)) ? attributes.bitangent.values : undefined; var tangents = (defined(attributes.tangent)) ? attributes.tangent.values : undefined; var texCoords = (defined(attributes.st)) ? attributes.st.values : undefined; + var extrudeDirections = (defined(attributes.extrudeDirection)) ? attributes.extrudeDirection.values : undefined; var indices = geometry.indices; var eastGeometry = copyGeometryForSplit(geometry); @@ -26172,7 +25530,7 @@ define('Core/GeometryPipeline',[ } insertedIndex = insertSplitPoint(currentAttributes, currentIndices, currentIndexMap, indices, resultIndex < 3 ? i + resultIndex : -1, point); - computeTriangleAttributes(i0, i1, i2, point, positions, normals, binormals, tangents, texCoords, currentAttributes, insertedIndex); + computeTriangleAttributes(i0, i1, i2, point, positions, normals, tangents, bitangents, texCoords, extrudeDirections, currentAttributes, insertedIndex); } } else { if (defined(result)) { @@ -26192,13 +25550,13 @@ define('Core/GeometryPipeline',[ } insertedIndex = insertSplitPoint(currentAttributes, currentIndices, currentIndexMap, indices, i, p0); - computeTriangleAttributes(i0, i1, i2, p0, positions, normals, binormals, tangents, texCoords, currentAttributes, insertedIndex); + computeTriangleAttributes(i0, i1, i2, p0, positions, normals, tangents, bitangents, texCoords, extrudeDirections, currentAttributes, insertedIndex); insertedIndex = insertSplitPoint(currentAttributes, currentIndices, currentIndexMap, indices, i + 1, p1); - computeTriangleAttributes(i0, i1, i2, p1, positions, normals, binormals, tangents, texCoords, currentAttributes, insertedIndex); + computeTriangleAttributes(i0, i1, i2, p1, positions, normals, tangents, bitangents, texCoords, extrudeDirections, currentAttributes, insertedIndex); insertedIndex = insertSplitPoint(currentAttributes, currentIndices, currentIndexMap, indices, i + 2, p2); - computeTriangleAttributes(i0, i1, i2, p2, positions, normals, binormals, tangents, texCoords, currentAttributes, insertedIndex); + computeTriangleAttributes(i0, i1, i2, p2, positions, normals, tangents, bitangents, texCoords, extrudeDirections, currentAttributes, insertedIndex); } } @@ -28197,6 +27555,7 @@ define('Core/PolygonOutlineGeometry',[ './arrayRemoveDuplicates', './BoundingSphere', './Cartesian3', + './Check', './ComponentDatatype', './defaultValue', './defined', @@ -28219,6 +27578,7 @@ define('Core/PolygonOutlineGeometry',[ arrayRemoveDuplicates, BoundingSphere, Cartesian3, + Check, ComponentDatatype, defaultValue, defined, @@ -28479,9 +27839,9 @@ define('Core/PolygonOutlineGeometry',[ * var geometry = Cesium.PolygonOutlineGeometry.createGeometry(extrudedPolygon); */ function PolygonOutlineGeometry(options) { - if (!defined(options) || !defined(options.polygonHierarchy)) { - throw new DeveloperError('options.polygonHierarchy is required.'); - } + Check.typeOf.object('options', options); + Check.typeOf.object('options.polygonHierarchy', options.polygonHierarchy); + if (defined(options.perPositionHeight) && options.perPositionHeight && defined(options.height)) { throw new DeveloperError('Cannot use both options.perPositionHeight and options.height'); } @@ -28526,12 +27886,8 @@ define('Core/PolygonOutlineGeometry',[ * @returns {Number[]} The array that was packed into */ PolygonOutlineGeometry.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -28564,9 +27920,7 @@ define('Core/PolygonOutlineGeometry',[ * @returns {PolygonOutlineGeometry} The modified result parameter or a new PolygonOutlineGeometry instance if one was not provided. */ PolygonOutlineGeometry.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -28631,9 +27985,7 @@ define('Core/PolygonOutlineGeometry',[ PolygonOutlineGeometry.fromPositions = function(options) { options = defaultValue(options, defaultValue.EMPTY_OBJECT); - if (!defined(options.positions)) { - throw new DeveloperError('options.positions is required.'); - } + Check.defined('options.positions', options.positions); var newOptions = { polygonHierarchy : { diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createPolylineGeometry.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createPolylineGeometry.js index 0ba06118..88c1250e 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createPolylineGeometry.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createPolylineGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,68 +45,6 @@ define('Core/defined',[],function() { return defined; }); -/*global define*/ -define('Core/freezeObject',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Freezes an object, using Object.freeze if available, otherwise returns - * the object unchanged. This function should be used in setup code to prevent - * errors from completely halting JavaScript execution in legacy browsers. - * - * @private - * - * @exports freezeObject - */ - var freezeObject = Object.freeze; - if (!defined(freezeObject)) { - freezeObject = function(o) { - return o; - }; - } - - return freezeObject; -}); - -/*global define*/ -define('Core/defaultValue',[ - './freezeObject' - ], function( - freezeObject) { - 'use strict'; - - /** - * Returns the first parameter if not undefined, otherwise the second parameter. - * Useful for setting a default value for a parameter. - * - * @exports defaultValue - * - * @param {*} a - * @param {*} b - * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter. - * - * @example - * param = Cesium.defaultValue(param, 'default'); - */ - function defaultValue(a, b) { - if (a !== undefined) { - return a; - } - return b; - } - - /** - * A frozen empty object that can be used as the default value for options passed as - * an object literal. - */ - defaultValue.EMPTY_OBJECT = freezeObject({}); - - return defaultValue; -}); - /*global define*/ define('Core/DeveloperError',[ './defined' @@ -188,41 +126,13 @@ define('Core/DeveloperError',[ return DeveloperError; }); -/*global define*/ -define('Core/isArray',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Tests an object to see if it is an array. - * @exports isArray - * - * @param {Object} value The value to test. - * @returns {Boolean} true if the value is an array, false otherwise. - */ - var isArray = Array.isArray; - if (!defined(isArray)) { - isArray = function(value) { - return Object.prototype.toString.call(value) === '[object Array]'; - }; - } - - return isArray; -}); - /*global define*/ define('Core/Check',[ - './defaultValue', - './defined', - './DeveloperError', - './isArray' + './defined', + './DeveloperError' ], function( - defaultValue, defined, - DeveloperError, - isArray) { + DeveloperError) { 'use strict'; /** @@ -237,111 +147,134 @@ define('Core/Check',[ */ Check.typeOf = {}; - /** - * Contains functions for checking numeric conditions such as minimum and maximum values - */ - Check.numeric = {}; - function getUndefinedErrorMessage(name) { - return name + ' was required but undefined.'; + return name + ' is required, actual value was undefined'; } function getFailedTypeErrorMessage(actual, expected, name) { - return 'Expected ' + name + ' to be typeof ' + expected + ', got ' + actual; + return 'Expected ' + name + ' to be typeof ' + expected + ', actual typeof was ' + actual; } /** * Throws if test is not defined * - * @param {*} test The value that is to be checked * @param {String} name The name of the variable being tested + * @param {*} test The value that is to be checked * @exception {DeveloperError} test must be defined */ - Check.defined = function (test, name) { + Check.defined = function (name, test) { if (!defined(test)) { throw new DeveloperError(getUndefinedErrorMessage(name)); } }; /** - * Throws if test is greater than maximum + * Throws if test is not typeof 'function' * - * @param {Number} test The value to test - * @param {Number} maximum The maximum allowed value - * @exception {DeveloperError} test must not be greater than maximum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'function' */ - Check.numeric.maximum = function (test, maximum) { - Check.typeOf.number(test); - Check.typeOf.number(maximum); - if (test > maximum) { - throw new DeveloperError('Expected ' + test + ' to be at most ' + maximum); + Check.typeOf.func = function (name, test) { + if (typeof test !== 'function') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); } }; /** - * Throws if test is less than minimum + * Throws if test is not typeof 'string' * - * @param {Number} test The value to test - * @param {Number} minimum The minimum allowed value - * @exception {DeveloperError} test must not be less than mininum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'string' */ - Check.numeric.minimum = function (test, minimum) { - Check.typeOf.number(test); - Check.typeOf.number(minimum); - if (test < minimum) { - throw new DeveloperError('Expected ' + test + ' to be at least ' + minimum); + Check.typeOf.string = function (name, test) { + if (typeof test !== 'string') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); } }; /** - * Throws if test is not typeof 'function' + * Throws if test is not typeof 'number' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'function' + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'number' */ - Check.typeOf.function = function (test, name) { - if (typeof test !== 'function') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); + Check.typeOf.number = function (name, test) { + if (typeof test !== 'number') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); } }; /** - * Throws if test is not typeof 'string' + * Throws if test is not typeof 'number' and less than limit * + * @param {String} name The name of the variable being tested * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than limit + */ + Check.typeOf.number.lessThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test >= limit) { + throw new DeveloperError('Expected ' + name + ' to be less than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and less than or equal to limit + * * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'string' + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than or equal to limit */ - Check.typeOf.string = function (test, name) { - if (typeof test !== 'string') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); + Check.typeOf.number.lessThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test > limit) { + throw new DeveloperError('Expected ' + name + ' to be less than or equal to ' + limit + ', actual value was ' + test); } }; /** - * Throws if test is not typeof 'number' + * Throws if test is not typeof 'number' and greater than limit * + * @param {String} name The name of the variable being tested * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than limit + */ + Check.typeOf.number.greaterThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test <= limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and greater than or equal to limit + * * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'number' + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than or equal to limit */ - Check.typeOf.number = function (test, name) { - if (typeof test !== 'number') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); + Check.typeOf.number.greaterThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test < limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than or equal to' + limit + ', actual value was ' + test); } }; /** * Throws if test is not typeof 'object' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested + * @param {*} test The value to test * @exception {DeveloperError} test must be typeof 'object' */ - Check.typeOf.object = function (test, name) { + Check.typeOf.object = function (name, test) { if (typeof test !== 'object') { throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'object', name)); } @@ -350,11 +283,11 @@ define('Core/Check',[ /** * Throws if test is not typeof 'boolean' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested + * @param {*} test The value to test * @exception {DeveloperError} test must be typeof 'boolean' */ - Check.typeOf.boolean = function (test, name) { + Check.typeOf.bool = function (name, test) { if (typeof test !== 'boolean') { throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'boolean', name)); } @@ -363,6 +296,68 @@ define('Core/Check',[ return Check; }); +/*global define*/ +define('Core/freezeObject',[ + './defined' + ], function( + defined) { + 'use strict'; + + /** + * Freezes an object, using Object.freeze if available, otherwise returns + * the object unchanged. This function should be used in setup code to prevent + * errors from completely halting JavaScript execution in legacy browsers. + * + * @private + * + * @exports freezeObject + */ + var freezeObject = Object.freeze; + if (!defined(freezeObject)) { + freezeObject = function(o) { + return o; + }; + } + + return freezeObject; +}); + +/*global define*/ +define('Core/defaultValue',[ + './freezeObject' + ], function( + freezeObject) { + 'use strict'; + + /** + * Returns the first parameter if not undefined, otherwise the second parameter. + * Useful for setting a default value for a parameter. + * + * @exports defaultValue + * + * @param {*} a + * @param {*} b + * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter. + * + * @example + * param = Cesium.defaultValue(param, 'default'); + */ + function defaultValue(a, b) { + if (a !== undefined) { + return a; + } + return b; + } + + /** + * A frozen empty object that can be used as the default value for options passed as + * an object literal. + */ + defaultValue.EMPTY_OBJECT = freezeObject({}); + + return defaultValue; +}); + /* I've wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace so it's better encapsulated. Now you can have multiple random number generators @@ -1047,7 +1042,7 @@ define('Core/Math',[ if (!defined(angle)) { throw new DeveloperError('angle is required.'); } - + return CesiumMath.clamp(angle, -1*CesiumMath.PI_OVER_TWO, CesiumMath.PI_OVER_TWO); }; @@ -1057,11 +1052,11 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [<code>-CesiumMath.PI</code>, <code>CesiumMath.PI</code>]. */ - CesiumMath.negativePiToPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.negativePiToPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - return CesiumMath.zeroToTwoPi(x + CesiumMath.PI) - CesiumMath.PI; + return CesiumMath.zeroToTwoPi(angle + CesiumMath.PI) - CesiumMath.PI; }; /** @@ -1070,12 +1065,12 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [0, <code>CesiumMath.TWO_PI</code>]. */ - CesiumMath.zeroToTwoPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.zeroToTwoPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - var mod = CesiumMath.mod(x, CesiumMath.TWO_PI); - if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(x) > CesiumMath.EPSILON14) { + var mod = CesiumMath.mod(angle, CesiumMath.TWO_PI); + if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(angle) > CesiumMath.EPSILON14) { return CesiumMath.TWO_PI; } return mod; @@ -1145,7 +1140,7 @@ define('Core/Math',[ * @example * //Compute 7!, which is equal to 5040 * var computedFactorial = Cesium.Math.factorial(7); - * + * * @see {@link http://en.wikipedia.org/wiki/Factorial|Factorial on Wikipedia} */ CesiumMath.factorial = function(n) { @@ -1429,7 +1424,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.fromSpherical = function(spherical, result) { - Check.typeOf.object(spherical, 'spherical'); + Check.typeOf.object('spherical', spherical); if (!defined(result)) { result = new Cartesian3(); @@ -1513,8 +1508,8 @@ define('Core/Cartesian3',[ * @returns {Number[]} The array that was packed into */ Cartesian3.pack = function(value, array, startingIndex) { - Check.typeOf.object(value, 'value'); - Check.defined(array, 'array'); + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1534,7 +1529,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.unpack = function(array, startingIndex, result) { - Check.defined(array, 'array'); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1555,7 +1550,7 @@ define('Core/Cartesian3',[ * @returns {Number[]} The packed array. */ Cartesian3.packArray = function(array, result) { - Check.defined(array, 'array'); + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -1578,8 +1573,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3[]} The unpacked array. */ Cartesian3.unpackArray = function(array, result) { - Check.defined(array, 'array'); - Check.numeric.minimum(array.length, 3); + Check.defined('array', array); + Check.typeOf.number.greaterThanOrEquals('array.length', array.length, 3); if (array.length % 3 !== 0) { throw new DeveloperError('array length must be a multiple of 3.'); } @@ -1625,7 +1620,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the maximum component. */ Cartesian3.maximumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z); }; @@ -1637,7 +1632,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the minimum component. */ Cartesian3.minimumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z); }; @@ -1651,9 +1646,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the minimum components. */ Cartesian3.minimumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -1671,9 +1666,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the maximum components. */ Cartesian3.maximumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -1688,7 +1683,7 @@ define('Core/Cartesian3',[ * @returns {Number} The squared magnitude. */ Cartesian3.magnitudeSquared = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z; }; @@ -1717,8 +1712,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distance(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(2.0, 0.0, 0.0)); */ Cartesian3.distance = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitude(distanceScratch); @@ -1737,8 +1732,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distanceSquared(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(3.0, 0.0, 0.0)); */ Cartesian3.distanceSquared = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitudeSquared(distanceScratch); @@ -1752,8 +1747,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.normalize = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian3.magnitude(cartesian); @@ -1776,8 +1771,8 @@ define('Core/Cartesian3',[ * @returns {Number} The dot product. */ Cartesian3.dot = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z; }; @@ -1791,9 +1786,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyComponents = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -1835,9 +1830,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.add = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -1854,9 +1849,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.subtract = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -1873,9 +1868,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -1892,9 +1887,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.divideByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -1910,8 +1905,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.negate = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -1927,8 +1922,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.abs = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -1947,10 +1942,10 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.lerp = function(start, end, t, result) { - Check.typeOf.object(start, 'start'); - Check.typeOf.object(end, 'end'); - Check.typeOf.number(t, 't'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian3.multiplyByScalar(end, t, lerpScratch); result = Cartesian3.multiplyByScalar(start, 1.0 - t, result); @@ -1967,8 +1962,8 @@ define('Core/Cartesian3',[ * @returns {Number} The angle between the Cartesians. */ Cartesian3.angleBetween = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.normalize(left, angleBetweenScratch); Cartesian3.normalize(right, angleBetweenScratch2); @@ -1986,8 +1981,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The most orthogonal axis. */ Cartesian3.mostOrthogonalAxis = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian3.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian3.abs(f, f); @@ -2064,9 +2059,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The cross product. */ Cartesian3.cross = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var leftX = left.x; var leftY = left.y; @@ -2099,8 +2094,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromDegrees(-115.0, 37.0); */ Cartesian3.fromDegrees = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); longitude = CesiumMath.toRadians(longitude); latitude = CesiumMath.toRadians(latitude); @@ -2125,8 +2120,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromRadians(-2.007, 0.645); */ Cartesian3.fromRadians = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); height = defaultValue(height, 0.0); var radiiSquared = defined(ellipsoid) ? ellipsoid.radiiSquared : wgs84RadiiSquared; @@ -2160,7 +2155,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArray([-115.0, 37.0, -107.0, 33.0]); */ Cartesian3.fromDegreesArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -2194,7 +2189,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArray([-2.007, 0.645, -1.867, .575]); */ Cartesian3.fromRadiansArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -2228,7 +2223,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArrayHeights([-115.0, 37.0, 100000.0, -107.0, 33.0, 150000.0]); */ Cartesian3.fromDegreesArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -2263,7 +2258,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArrayHeights([-2.007, 0.645, 100000.0, -1.867, .575, 150000.0]); */ Cartesian3.fromRadiansArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -3010,7 +3005,9 @@ define('Core/Ellipsoid',[ /** * Computes an Ellipsoid from a Cartesian specifying the radii in x, y, and z directions. * - * @param {Cartesian3} [radii=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Cartesian3} [cartesian=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new + * instance should be created. * @returns {Ellipsoid} A new Ellipsoid instance. * * @exception {DeveloperError} All radii components must be greater than or equal to zero. @@ -3750,6 +3747,7 @@ define('Core/Interval',[ /*global define*/ define('Core/Matrix3',[ './Cartesian3', + './Check', './defaultValue', './defined', './defineProperties', @@ -3758,6 +3756,7 @@ define('Core/Matrix3',[ './Math' ], function( Cartesian3, + Check, defaultValue, defined, defineProperties, @@ -3820,13 +3819,8 @@ define('Core/Matrix3',[ * @returns {Number[]} The array that was packed into */ Matrix3.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3852,9 +3846,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. */ Matrix3.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3881,24 +3873,24 @@ define('Core/Matrix3',[ * @param {Matrix3} [result] The object onto which to store the result. * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. (Returns undefined if matrix is undefined) */ - Matrix3.clone = function(values, result) { - if (!defined(values)) { + Matrix3.clone = function(matrix, result) { + if (!defined(matrix)) { return undefined; } if (!defined(result)) { - return new Matrix3(values[0], values[3], values[6], - values[1], values[4], values[7], - values[2], values[5], values[8]); + return new Matrix3(matrix[0], matrix[3], matrix[6], + matrix[1], matrix[4], matrix[7], + matrix[2], matrix[5], matrix[8]); } - result[0] = values[0]; - result[1] = values[1]; - result[2] = values[2]; - result[3] = values[3]; - result[4] = values[4]; - result[5] = values[5]; - result[6] = values[6]; - result[7] = values[7]; - result[8] = values[8]; + result[0] = matrix[0]; + result[1] = matrix[1]; + result[2] = matrix[2]; + result[3] = matrix[3]; + result[4] = matrix[4]; + result[5] = matrix[5]; + result[6] = matrix[6]; + result[7] = matrix[7]; + result[8] = matrix[8]; return result; }; @@ -3924,9 +3916,7 @@ define('Core/Matrix3',[ * var m2 = Cesium.Matrix3.fromArray(v2, 2); */ Matrix3.fromArray = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3954,9 +3944,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values parameter is required'); - } + Check.defined('values', values); return Matrix3.clone(values, result); }; @@ -3970,9 +3958,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix3(values[0], values[1], values[2], @@ -3999,9 +3985,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this quaternion. */ Matrix3.fromQuaternion = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); var x2 = quaternion.x * quaternion.x; var xy = quaternion.x * quaternion.y; @@ -4051,10 +4035,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this headingPitchRoll. */ Matrix3.fromHeadingPitchRoll = function(headingPitchRoll, result) { - if (!defined(headingPitchRoll)) { - throw new DeveloperError('headingPitchRoll is required'); - } - var cosTheta = Math.cos(-headingPitchRoll.pitch); + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + + var cosTheta = Math.cos(-headingPitchRoll.pitch); var cosPsi = Math.cos(-headingPitchRoll.heading); var cosPhi = Math.cos(headingPitchRoll.roll); var sinTheta = Math.sin(-headingPitchRoll.pitch); @@ -4105,9 +4088,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix3( @@ -4143,9 +4124,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromUniformScale(2.0); */ Matrix3.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix3( @@ -4169,7 +4148,7 @@ define('Core/Matrix3',[ /** * Computes a Matrix3 instance representing the cross product equivalent matrix of a Cartesian3 vector. * - * @param {Cartesian3} the vector on the left hand side of the cross product operation. + * @param {Cartesian3} vector the vector on the left hand side of the cross product operation. * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created. * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. * @@ -4181,9 +4160,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromCrossProduct(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromCrossProduct = function(vector, result) { - if (!defined(vector)) { - throw new DeveloperError('vector is required.'); - } + Check.typeOf.object('vector', vector); if (!defined(result)) { return new Matrix3( @@ -4218,9 +4195,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationX = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4259,9 +4234,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationY = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4300,9 +4273,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationZ = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4336,9 +4307,7 @@ define('Core/Matrix3',[ * @returns {Number[]} The modified Array parameter or a new Array instance if one was not provided. */ Matrix3.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5], matrix[6], matrix[7], matrix[8]]; @@ -4372,12 +4341,10 @@ define('Core/Matrix3',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix3.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 2) { - throw new DeveloperError('row must be 0, 1, or 2.'); - } - if (typeof column !== 'number' || column < 0 || column > 2) { - throw new DeveloperError('column must be 0, 1, or 2.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 2); + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 2); return column * 3 + row; }; @@ -4393,16 +4360,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var startIndex = index * 3; var x = matrix[startIndex]; @@ -4427,18 +4388,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); var startIndex = index * 3; @@ -4459,15 +4413,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 3]; @@ -4491,18 +4440,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); result[index] = cartesian.x; @@ -4521,12 +4463,8 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[3], matrix[4], matrix[5], scratchColumn)); @@ -4557,15 +4495,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var column0Row0 = left[0] * right[0] + left[3] * right[1] + left[6] * right[2]; var column0Row1 = left[1] * right[0] + left[4] * right[1] + left[7] * right[2]; @@ -4600,15 +4532,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -4631,15 +4557,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -4662,15 +4582,9 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -4695,15 +4609,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -4734,15 +4642,9 @@ define('Core/Matrix3',[ * @see Matrix3.multiplyByUniformScale */ Matrix3.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); result[0] = matrix[0] * scale.x; result[1] = matrix[1] * scale.x; @@ -4764,12 +4666,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -4791,12 +4689,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var column0Row0 = matrix[0]; var column0Row1 = matrix[3]; @@ -4936,9 +4830,7 @@ define('Core/Matrix3',[ * var c = Cesium.Cartesian3.multiplyByScalar(v, lambda, new Cesium.Cartesian3()); // equal to Cesium.Matrix3.multiplyByVector(a, v) */ Matrix3.computeEigenDecomposition = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); // This routine was created based upon Matrix Computations, 3rd ed., by Golub and Van Loan, // section 8.4.3 The Classical Jacobi Algorithm @@ -4982,12 +4874,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -5009,9 +4897,7 @@ define('Core/Matrix3',[ * @returns {Number} The value of the determinant of the matrix. */ Matrix3.determinant = function(matrix) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); var m11 = matrix[0]; var m21 = matrix[3]; @@ -5036,12 +4922,8 @@ define('Core/Matrix3',[ * @exception {DeveloperError} matrix is not invertible. */ Matrix3.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var m11 = matrix[0]; var m21 = matrix[1]; @@ -5107,9 +4989,7 @@ define('Core/Matrix3',[ * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. */ Matrix3.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -5297,12 +5177,14 @@ define('Core/Matrix3',[ /*global define*/ define('Core/Cartesian4',[ + './Check', './defaultValue', './defined', './DeveloperError', './freezeObject', './Math' ], function( + Check, defaultValue, defined, DeveloperError, @@ -5385,9 +5267,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.fromColor = function(color, result) { - if (!defined(color)) { - throw new DeveloperError('color is required'); - } + Check.typeOf.object('color', color); if (!defined(result)) { return new Cartesian4(color.red, color.green, color.blue, color.alpha); } @@ -5439,12 +5319,8 @@ define('Core/Cartesian4',[ * @returns {Number[]} The array that was packed into */ Cartesian4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5465,9 +5341,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5489,9 +5363,7 @@ define('Core/Cartesian4',[ * @returns {Number[]} The packed array. */ Cartesian4.packArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -5514,9 +5386,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4[]} The unpacked array. */ Cartesian4.unpackArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -5559,9 +5429,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the maximum component. */ Cartesian4.maximumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -5573,9 +5441,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the minimum component. */ Cartesian4.minimumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -5589,15 +5455,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the minimum components. */ Cartesian4.minimumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -5616,15 +5476,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the maximum components. */ Cartesian4.maximumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -5641,9 +5495,7 @@ define('Core/Cartesian4',[ * @returns {Number} The squared magnitude. */ Cartesian4.magnitudeSquared = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z + cartesian.w * cartesian.w; }; @@ -5674,9 +5526,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(2.0, 0.0, 0.0, 0.0)); */ Cartesian4.distance = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitude(distanceScratch); @@ -5697,9 +5548,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(3.0, 0.0, 0.0, 0.0)); */ Cartesian4.distanceSquared = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitudeSquared(distanceScratch); @@ -5713,12 +5563,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.normalize = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian4.magnitude(cartesian); @@ -5742,12 +5588,8 @@ define('Core/Cartesian4',[ * @returns {Number} The dot product. */ Cartesian4.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w; }; @@ -5761,15 +5603,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -5787,15 +5623,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x / right.x; result.y = left.y / right.y; @@ -5813,15 +5643,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -5839,15 +5663,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -5865,15 +5683,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -5891,15 +5703,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -5916,12 +5722,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.negate = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -5938,12 +5740,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.abs = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -5963,18 +5761,10 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian4.multiplyByScalar(end, t, lerpScratch); result = Cartesian4.multiplyByScalar(start, 1.0 - t, result); @@ -5990,12 +5780,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The most orthogonal axis. */ Cartesian4.mostOrthogonalAxis = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian4.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian4.abs(f, f); @@ -6240,6 +6026,7 @@ define('Core/RuntimeError',[ define('Core/Matrix4',[ './Cartesian3', './Cartesian4', + './Check', './defaultValue', './defined', './defineProperties', @@ -6251,6 +6038,7 @@ define('Core/Matrix4',[ ], function( Cartesian3, Cartesian4, + Check, defaultValue, defined, defineProperties, @@ -6341,13 +6129,8 @@ define('Core/Matrix4',[ * @returns {Number[]} The array that was packed into */ Matrix4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -6380,9 +6163,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if one was not provided. */ Matrix4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -6478,9 +6259,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required'); - } + Check.defined('values', values); return Matrix4.clone(values, result); }; @@ -6494,9 +6273,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix4(values[0], values[1], values[2], values[3], @@ -6533,9 +6310,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRotationTranslation = function(rotation, translation, result) { - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } + Check.typeOf.object('rotation', rotation); translation = defaultValue(translation, Cartesian3.ZERO); @@ -6583,15 +6358,9 @@ define('Core/Matrix4',[ * result); */ Matrix4.fromTranslationQuaternionRotationScale = function(translation, rotation, scale, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('translation', translation); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('scale', scale); if (!defined(result)) { result = new Matrix4(); @@ -6652,9 +6421,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromTranslationRotationScale = function(translationRotationScale, result) { - if (!defined(translationRotationScale)) { - throw new DeveloperError('translationRotationScale is required.'); - } + Check.typeOf.object('translationRotationScale', translationRotationScale); return Matrix4.fromTranslationQuaternionRotationScale(translationRotationScale.translation, translationRotationScale.rotation, translationRotationScale.scale, result); }; @@ -6669,9 +6436,7 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByTranslation */ Matrix4.fromTranslation = function(translation, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } + Check.typeOf.object('translation', translation); return Matrix4.fromRotationTranslation(Matrix3.IDENTITY, translation, result); }; @@ -6692,9 +6457,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix4.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix4( @@ -6739,9 +6502,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromUniformScale(2.0); */ Matrix4.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix4(scale, 0.0, 0.0, 0.0, @@ -6781,23 +6542,15 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromCamera = function(camera, result) { - if (!defined(camera)) { - throw new DeveloperError('camera is required.'); - } + Check.typeOf.object('camera', camera); var position = camera.position; var direction = camera.direction; var up = camera.up; - if (!defined(position)) { - throw new DeveloperError('camera.position is required.'); - } - if (!defined(direction)) { - throw new DeveloperError('camera.direction is required.'); - } - if (!defined(up)) { - throw new DeveloperError('camera.up is required.'); - } + Check.typeOf.object('camera.position', position); + Check.typeOf.object('camera.direction', direction); + Check.typeOf.object('camera.up', up); Cartesian3.normalize(direction, fromCameraF); Cartesian3.normalize(Cartesian3.cross(fromCameraF, up, fromCameraR), fromCameraR); @@ -6876,21 +6629,11 @@ define('Core/Matrix4',[ * @exception {DeveloperError} far must be greater than zero. */ Matrix4.computePerspectiveFieldOfView = function(fovY, aspectRatio, near, far, result) { - if (fovY <= 0.0 || fovY > Math.PI) { - throw new DeveloperError('fovY must be in (0, PI].'); - } - if (aspectRatio <= 0.0) { - throw new DeveloperError('aspectRatio must be greater than zero.'); - } - if (near <= 0.0) { - throw new DeveloperError('near must be greater than zero.'); - } - if (far <= 0.0) { - throw new DeveloperError('far must be greater than zero.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThan('fovY', fovY, 0.0); + Check.typeOf.number.lessThan('fovY', fovY, Math.PI); + Check.typeOf.number.greaterThan('near', near, 0.0); + Check.typeOf.number.greaterThan('far', far, 0.0); + Check.typeOf.object('result', result); var bottom = Math.tan(fovY * 0.5); @@ -6931,27 +6674,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeOrthographicOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var a = 1.0 / (right - left); var b = 1.0 / (top - bottom); @@ -6996,27 +6725,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computePerspectiveOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -7057,24 +6772,12 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeInfinitePerspectiveOffCenter = function(left, right, bottom, top, near, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -7122,9 +6825,7 @@ define('Core/Matrix4',[ * }, 0.0, 1.0, new Cesium.Matrix4()); */ Matrix4.computeViewportTransformation = function(viewport, nearDepthRange, farDepthRange, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); viewport = defaultValue(viewport, defaultValue.EMPTY_OBJECT); var x = defaultValue(viewport.x, 0.0); @@ -7176,21 +6877,11 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeView = function(position, direction, up, right, result) { - if (!defined(position)) { - throw new DeveloperError('position is required'); - } - if (!defined(direction)) { - throw new DeveloperError('direction is required'); - } - if (!defined(up)) { - throw new DeveloperError('up is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); + Check.typeOf.object('up', up); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = right.x; result[1] = up.x; @@ -7231,9 +6922,7 @@ define('Core/Matrix4',[ * //creates a = [10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0] */ Matrix4.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], @@ -7277,12 +6966,11 @@ define('Core/Matrix4',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix4.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 3) { - throw new DeveloperError('row must be 0, 1, 2, or 3.'); - } - if (typeof column !== 'number' || column < 0 || column > 3) { - throw new DeveloperError('column must be 0, 1, 2, or 3.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 3); + + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 3); return column * 4 + row; }; @@ -7315,16 +7003,12 @@ define('Core/Matrix4',[ * // a.x = 12.0; a.y = 16.0; a.z = 20.0; a.w = 24.0; */ Matrix4.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var startIndex = index * 4; var x = matrix[startIndex]; @@ -7366,18 +7050,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 96.0, 25.0] */ Matrix4.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); var startIndex = index * 4; @@ -7398,15 +7077,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.setTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -7459,16 +7132,12 @@ define('Core/Matrix4',[ * // a.x = 18.0; a.y = 19.0; a.z = 20.0; a.w = 21.0; */ Matrix4.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 4]; @@ -7509,18 +7178,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 24.0, 25.0] */ Matrix4.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); result[index] = cartesian.x; @@ -7540,12 +7204,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter */ Matrix4.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[4], matrix[5], matrix[6], scratchColumn)); @@ -7577,15 +7237,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -7669,15 +7323,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -7704,18 +7352,12 @@ define('Core/Matrix4',[ * @param {Matrix4} left The first matrix. * @param {Matrix4} right The second matrix. * @param {Matrix4} result The object onto which to store the result. - * @returns {Matrix4} The modified result parameter. - */ - Matrix4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + * @returns {Matrix4} The modified result parameter. + */ + Matrix4.subtract = function(left, right, result) { + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -7756,15 +7398,9 @@ define('Core/Matrix4',[ * var m3 = Cesium.Matrix4.multiplyTransformation(m1, m2, new Cesium.Matrix4()); */ Matrix4.multiplyTransformation = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -7842,15 +7478,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByMatrix3(m, rotation, m); */ Matrix4.multiplyByMatrix3 = function(matrix, rotation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('result', result); var left0 = matrix[0]; var left1 = matrix[1]; @@ -7918,15 +7548,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByTranslation(m, position, m); */ Matrix4.multiplyByTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); var x = translation.x; var y = translation.y; @@ -7978,15 +7602,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByScale */ Matrix4.multiplyByUniformScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scale', scale); + Check.typeOf.object('result', result); uniformScaleScratch.x = scale; uniformScaleScratch.y = scale; @@ -8015,15 +7633,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByUniformScale */ Matrix4.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); var scaleX = scale.x; var scaleY = scale.y; @@ -8062,15 +7674,9 @@ define('Core/Matrix4',[ * @returns {Cartesian4} The modified result parameter. */ Matrix4.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8106,15 +7712,9 @@ define('Core/Matrix4',[ * // Cesium.Matrix4.multiplyByVector(matrix, new Cesium.Cartesian4(p.x, p.y, p.z, 0.0), result); */ Matrix4.multiplyByPointAsVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8144,16 +7744,9 @@ define('Core/Matrix4',[ * var result = Cesium.Matrix4.multiplyByPoint(matrix, p, new Cesium.Cartesian3()); */ Matrix4.multiplyByPoint = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8193,15 +7786,9 @@ define('Core/Matrix4',[ * // [-44.0, -46.0, -48.0, -50.0] */ Matrix4.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -8245,12 +7832,8 @@ define('Core/Matrix4',[ * // [-22.0, -23.0, -24.0, -25.0] */ Matrix4.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -8294,12 +7877,8 @@ define('Core/Matrix4',[ * // [13.0, 17.0, 21.0, 25.0] */ Matrix4.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var matrix1 = matrix[1]; var matrix2 = matrix[2]; @@ -8335,12 +7914,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -8454,9 +8029,7 @@ define('Core/Matrix4',[ * //Prints "Difference between both the matrices is not less than 0.1" on the console */ Matrix4.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -8487,12 +8060,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter. */ Matrix4.getTranslation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = matrix[12]; result.y = matrix[13]; @@ -8523,12 +8092,8 @@ define('Core/Matrix4',[ * // [12.0, 16.0, 20.0] */ Matrix4.getRotation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -8560,12 +8125,8 @@ define('Core/Matrix4',[ * @exception {RuntimeError} matrix is not invertible because its determinate is zero. */ Matrix4.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); // Special case for a zero scale matrix that can occur, for example, // when a model's node has a [0, 0, 0] scale. @@ -8703,12 +8264,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.inverseTransformation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); //This function is an optimized version of the below 4 lines. //var rT = Matrix3.transpose(Matrix4.getRotation(matrix)); @@ -8992,6 +8549,7 @@ define('Core/Matrix4',[ /*global define*/ define('Core/Rectangle',[ './Cartographic', + './Check', './defaultValue', './defined', './defineProperties', @@ -9001,6 +8559,7 @@ define('Core/Rectangle',[ './Math' ], function( Cartographic, + Check, defaultValue, defined, defineProperties, @@ -9097,13 +8656,8 @@ define('Core/Rectangle',[ * @returns {Number[]} The array that was packed into */ Rectangle.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -9124,9 +8678,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -9147,9 +8699,7 @@ define('Core/Rectangle',[ * @returns {Number} The width. */ Rectangle.computeWidth = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; if (east < west) { @@ -9164,9 +8714,7 @@ define('Core/Rectangle',[ * @returns {Number} The height. */ Rectangle.computeHeight = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); return rectangle.north - rectangle.south; }; @@ -9201,6 +8749,32 @@ define('Core/Rectangle',[ return result; }; + /** + * Creates an rectangle given the boundary longitude and latitude in radians. + * + * @param {Number} [west=0.0] The westernmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [south=0.0] The southernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Number} [east=0.0] The easternmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [north=0.0] The northernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Rectangle} [result] The object onto which to store the result, or undefined if a new instance should be created. + * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. + * + * @example + * var rectangle = Cesium.Rectangle.fromRadians(0.0, Math.PI/4, Math.PI/8, 3*Math.PI/4); + */ + Rectangle.fromRadians = function(west, south, east, north, result) { + if (!defined(result)) { + return new Rectangle(west, south, east, north); + } + + result.west = defaultValue(west, 0.0); + result.south = defaultValue(south, 0.0); + result.east = defaultValue(east, 0.0); + result.north = defaultValue(north, 0.0); + + return result; + }; + /** * Creates the smallest possible Rectangle that encloses all positions in the provided array. * @@ -9209,9 +8783,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartographicArray = function(cartographics, result) { - if (!defined(cartographics)) { - throw new DeveloperError('cartographics is required.'); - } + Check.defined('cartographics', cartographics); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -9264,9 +8836,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartesianArray = function(cartesians, ellipsoid, result) { - if (!defined(cartesians)) { - throw new DeveloperError('cartesians is required.'); - } + Check.defined('cartesians', cartesians); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -9382,9 +8952,7 @@ define('Core/Rectangle',[ * @returns {Boolean} <code>true</code> if the Rectangles are within the provided epsilon, <code>false</code> otherwise. */ Rectangle.prototype.equalsEpsilon = function(other, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon is required and must be a number.'); - } + Check.typeOf.number('epsilon', epsilon); return defined(other) && (Math.abs(this.west - other.west) <= epsilon) && @@ -9404,45 +8972,23 @@ define('Core/Rectangle',[ * @exception {DeveloperError} <code>west</code> must be in the interval [<code>-Pi</code>, <code>Pi</code>]. */ Rectangle.validate = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var north = rectangle.north; - if (typeof north !== 'number') { - throw new DeveloperError('north is required to be a number.'); - } - - if (north < -CesiumMath.PI_OVER_TWO || north > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('north must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('north', north, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('north', north, CesiumMath.PI_OVER_TWO); var south = rectangle.south; - if (typeof south !== 'number') { - throw new DeveloperError('south is required to be a number.'); - } - - if (south < -CesiumMath.PI_OVER_TWO || south > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('south must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('south', south, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('south', south, CesiumMath.PI_OVER_TWO); var west = rectangle.west; - if (typeof west !== 'number') { - throw new DeveloperError('west is required to be a number.'); - } - - if (west < -Math.PI || west > Math.PI) { - throw new DeveloperError('west must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('west', west, -Math.PI); + Check.typeOf.number.lessThanOrEquals('west', west, Math.PI); var east = rectangle.east; - if (typeof east !== 'number') { - throw new DeveloperError('east is required to be a number.'); - } - - if (east < -Math.PI || east > Math.PI) { - throw new DeveloperError('east must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('east', east, -Math.PI); + Check.typeOf.number.lessThanOrEquals('east', east, Math.PI); }; /** @@ -9453,9 +8999,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.south); @@ -9474,9 +9018,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.north); @@ -9495,9 +9037,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.north); @@ -9516,9 +9056,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.south); @@ -9537,9 +9075,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.center = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; @@ -9574,12 +9110,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.intersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var rectangleEast = rectangle.east; var rectangleWest = rectangle.west; @@ -9635,12 +9167,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.simpleIntersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var west = Math.max(rectangle.west, otherRectangle.west); var south = Math.max(rectangle.south, otherRectangle.south); @@ -9671,12 +9199,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.union = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); if (!defined(result)) { result = new Rectangle(); @@ -9720,12 +9244,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.expand = function(rectangle, cartographic, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); if (!defined(result)) { result = new Rectangle(); @@ -9747,12 +9267,8 @@ define('Core/Rectangle',[ * @returns {Boolean} true if the provided cartographic is inside the rectangle, false otherwise. */ Rectangle.contains = function(rectangle, cartographic) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); var longitude = cartographic.longitude; var latitude = cartographic.latitude; @@ -9785,9 +9301,7 @@ define('Core/Rectangle',[ * @returns {Cartesian3[]} The modified result parameter or a new Array of Cartesians instances if none was provided. */ Rectangle.subsample = function(rectangle, ellipsoid, surfaceHeight, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84); surfaceHeight = defaultValue(surfaceHeight, 0.0); @@ -9865,9 +9379,9 @@ define('Core/Rectangle',[ define('Core/BoundingSphere',[ './Cartesian3', './Cartographic', + './Check', './defaultValue', './defined', - './DeveloperError', './Ellipsoid', './GeographicProjection', './Intersect', @@ -9878,9 +9392,9 @@ define('Core/BoundingSphere',[ ], function( Cartesian3, Cartographic, + Check, defaultValue, defined, - DeveloperError, Ellipsoid, GeographicProjection, Intersect, @@ -10210,9 +9724,7 @@ define('Core/BoundingSphere',[ stride = defaultValue(stride, 3); - if (stride < 3) { - throw new DeveloperError('stride must be 3 or greater.'); - } + Check.typeOf.number.greaterThanOrEquals('stride', stride, 3); var currentPos = fromPointsCurrentPos; currentPos.x = positions[0] + center.x; @@ -10516,9 +10028,8 @@ define('Core/BoundingSphere',[ * var sphere = Cesium.BoundingSphere.fromCornerPoints(new Cesium.Cartesian3(-0.5, -0.5, -0.5), new Cesium.Cartesian3(0.5, 0.5, 0.5)); */ BoundingSphere.fromCornerPoints = function(corner, oppositeCorner, result) { - if (!defined(corner) || !defined(oppositeCorner)) { - throw new DeveloperError('corner and oppositeCorner are required.'); - } + Check.typeOf.object('corner', corner); + Check.typeOf.object('oppositeCorner', oppositeCorner); if (!defined(result)) { result = new BoundingSphere(); @@ -10542,9 +10053,7 @@ define('Core/BoundingSphere',[ * var boundingSphere = Cesium.BoundingSphere.fromEllipsoid(ellipsoid); */ BoundingSphere.fromEllipsoid = function(ellipsoid, result) { - if (!defined(ellipsoid)) { - throw new DeveloperError('ellipsoid is required.'); - } + Check.typeOf.object('ellipsoid', ellipsoid); if (!defined(result)) { result = new BoundingSphere(); @@ -10670,13 +10179,8 @@ define('Core/BoundingSphere',[ * @returns {Number[]} The array that was packed into */ BoundingSphere.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -10698,9 +10202,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if one was not provided. */ BoundingSphere.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -10727,13 +10229,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.union = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); if (!defined(result)) { result = new BoundingSphere(); @@ -10782,13 +10279,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.expand = function(sphere, point, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(point)) { - throw new DeveloperError('point is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('point', point); result = BoundingSphere.clone(sphere, result); @@ -10811,13 +10303,8 @@ define('Core/BoundingSphere',[ * intersects the plane. */ BoundingSphere.intersectPlane = function(sphere, plane) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(plane)) { - throw new DeveloperError('plane is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('plane', plane); var center = sphere.center; var radius = sphere.radius; @@ -10843,13 +10330,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.transform = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -10877,12 +10359,8 @@ define('Core/BoundingSphere',[ * }); */ BoundingSphere.distanceSquaredTo = function(sphere, cartesian) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('cartesian', cartesian); var diff = Cartesian3.subtract(sphere.center, cartesian, distanceSquaredToScratch); return Cartesian3.magnitudeSquared(diff) - sphere.radius * sphere.radius; @@ -10904,13 +10382,8 @@ define('Core/BoundingSphere',[ * var newBoundingSphere = Cesium.BoundingSphere.transformWithoutScale(boundingSphere, modelMatrix); */ BoundingSphere.transformWithoutScale = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -10937,17 +10410,9 @@ define('Core/BoundingSphere',[ * @returns {Interval} The nearest and farthest distances on the bounding sphere from position in direction. */ BoundingSphere.computePlaneDistances = function(sphere, position, direction, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(position)) { - throw new DeveloperError('position is required.'); - } - - if (!defined(direction)) { - throw new DeveloperError('direction is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); if (!defined(result)) { result = new Interval(); @@ -10982,9 +10447,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.projectTo2D = function(sphere, projection, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } + Check.typeOf.object('sphere', sphere); projection = defaultValue(projection, projectTo2DProjection); @@ -11079,12 +10542,8 @@ define('Core/BoundingSphere',[ * @returns {Boolean} <code>true</code> if the sphere is not visible; otherwise <code>false</code>. */ BoundingSphere.isOccluded = function(sphere, occluder) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(occluder)) { - throw new DeveloperError('occluder is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('occluder', occluder); return !occluder.isBoundingSphereVisible(sphere); }; @@ -14520,7 +13979,10 @@ define('Core/WebGLConstants',[ COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : 0x9279, TEXTURE_IMMUTABLE_FORMAT : 0x912F, MAX_ELEMENT_INDEX : 0x8D6B, - TEXTURE_IMMUTABLE_LEVELS : 0x82DF + TEXTURE_IMMUTABLE_LEVELS : 0x82DF, + + // Extensions + MAX_TEXTURE_MAX_ANISOTROPY_EXT : 0x84FF }; return freezeObject(WebGLConstants); @@ -15050,7 +14512,7 @@ define('Core/Geometry',[ * <li><code>position</code> - 3D vertex position. 64-bit floating-point (for precision). 3 components per attribute. See {@link VertexFormat#position}.</li> * <li><code>normal</code> - Normal (normalized), commonly used for lighting. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#normal}.</li> * <li><code>st</code> - 2D texture coordinate. 32-bit floating-point. 2 components per attribute. See {@link VertexFormat#st}.</li> - * <li><code>binormal</code> - Binormal (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#binormal}.</li> + * <li><code>bitangent</code> - Bitangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#bitangent}.</li> * <li><code>tangent</code> - Tangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#tangent}.</li> * </ul> * </p> @@ -15079,7 +14541,7 @@ define('Core/Geometry',[ * componentsPerAttribute : 3, * values : new Float32Array(0) * }); - * + * * @see GeometryAttribute * @see VertexFormat */ @@ -15360,7 +14822,7 @@ define('Core/GeometryAttributes',[ this.st = options.st; /** - * The binormal attribute (normalized), which is used for tangent-space effects like bump mapping. + * The bitangent attribute (normalized), which is used for tangent-space effects like bump mapping. * <p> * 32-bit floating-point. 3 components per attribute. * </p> @@ -15369,7 +14831,7 @@ define('Core/GeometryAttributes',[ * * @default undefined */ - this.binormal = options.binormal; + this.bitangent = options.bitangent; /** * The tangent attribute (normalized), which is used for tangent-space effects like bump mapping. @@ -15874,6 +15336,7 @@ define('Core/EllipsoidGeodesic',[ * Provides the location of a point at the indicated portion along the geodesic. * * @param {Number} fraction The portion of the distance between the initial and final points. + * @param {Cartographic} result The object in which to store the result. * @returns {Cartographic} The location of the point along the geodesic. */ EllipsoidGeodesic.prototype.interpolateUsingFraction = function(fraction, result) { @@ -15884,6 +15347,7 @@ define('Core/EllipsoidGeodesic',[ * Provides the location of a point at the indicated distance along the geodesic. * * @param {Number} distance The distance from the inital point to the point of interest along the geodesic + * @param {Cartographic} result The object in which to store the result. * @returns {Cartographic} The location of the point along the geodesic. * * @exception {DeveloperError} start and end must be set before calling function interpolateUsingSurfaceDistance @@ -16734,6 +16198,7 @@ define('Core/IntersectionTests',[ './defaultValue', './defined', './DeveloperError', + './Interval', './Math', './Matrix3', './QuadraticRealPolynomial', @@ -16745,6 +16210,7 @@ define('Core/IntersectionTests',[ defaultValue, defined, DeveloperError, + Interval, CesiumMath, Matrix3, QuadraticRealPolynomial, @@ -17016,7 +16482,7 @@ define('Core/IntersectionTests',[ function raySphere(ray, sphere, result) { if (!defined(result)) { - result = {}; + result = new Interval(); } var origin = ray.origin; @@ -17047,8 +16513,8 @@ define('Core/IntersectionTests',[ * * @param {Ray} ray The ray. * @param {BoundingSphere} sphere The sphere. - * @param {Object} [result] The result onto which to store the result. - * @returns {Object} An object with the first (<code>start</code>) and the second (<code>stop</code>) intersection scalars for points along the ray or undefined if there are no intersections. + * @param {Interval} [result] The result onto which to store the result. + * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections. */ IntersectionTests.raySphere = function(ray, sphere, result) { if (!defined(ray)) { @@ -17076,8 +16542,8 @@ define('Core/IntersectionTests',[ * @param {Cartesian3} p0 An end point of the line segment. * @param {Cartesian3} p1 The other end point of the line segment. * @param {BoundingSphere} sphere The sphere. - * @param {Object} [result] The result onto which to store the result. - * @returns {Object} An object with the first (<code>start</code>) and the second (<code>stop</code>) intersection scalars for points along the line segment or undefined if there are no intersections. + * @param {Interval} [result] The result onto which to store the result. + * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections. */ IntersectionTests.lineSegmentSphere = function(p0, p1, sphere, result) { if (!defined(p0)) { @@ -17115,7 +16581,7 @@ define('Core/IntersectionTests',[ * * @param {Ray} ray The ray. * @param {Ellipsoid} ellipsoid The ellipsoid. - * @returns {Object} An object with the first (<code>start</code>) and the second (<code>stop</code>) intersection scalars for points along the ray or undefined if there are no intersections. + * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections. */ IntersectionTests.rayEllipsoid = function(ray, ellipsoid) { if (!defined(ray)) { @@ -17157,10 +16623,7 @@ define('Core/IntersectionTests',[ var root0 = temp / w2; var root1 = difference / temp; if (root0 < root1) { - return { - start : root0, - stop : root1 - }; + return new Interval(root0, root1); } return { @@ -17170,10 +16633,7 @@ define('Core/IntersectionTests',[ } else { // qw2 == product. Repeated roots (2 intersections). var root = Math.sqrt(difference / w2); - return { - start : root, - stop : root - }; + return new Interval(root, root); } } else if (q2 < 1.0) { // Inside ellipsoid (2 intersections). @@ -17183,19 +16643,13 @@ define('Core/IntersectionTests',[ discriminant = qw * qw - product; temp = -qw + Math.sqrt(discriminant); // Positively valued. - return { - start : 0.0, - stop : temp / w2 - }; + return new Interval(0.0, temp / w2); } else { // q2 == 1.0. On ellipsoid. if (qw < 0.0) { // Looking inward. w2 = Cartesian3.magnitudeSquared(w); - return { - start : 0.0, - stop : -qw / w2 - }; + return new Interval(0.0, -qw / w2); } // qw >= 0.0. Looking outward or tangent. @@ -17630,6 +17084,30 @@ define('Core/IntersectionTests',[ return IntersectionTests; }); +/*global define*/ +define('Core/isArray',[ + './defined' + ], function( + defined) { + 'use strict'; + + /** + * Tests an object to see if it is an array. + * @exports isArray + * + * @param {Object} value The value to test. + * @returns {Boolean} true if the value is an array, false otherwise. + */ + var isArray = Array.isArray; + if (!defined(isArray)) { + isArray = function(value) { + return Object.prototype.toString.call(value) === '[object Array]'; + }; + } + + return isArray; +}); + /*global define*/ define('Core/Plane',[ './Cartesian3', @@ -18003,10 +17481,10 @@ define('Core/PolylinePipeline',[ /** * Subdivides polyline and raises all points to the specified height. Returns an array of numbers to represent the positions. - * @param {Cartesian3[]} positions The array of type {Cartesian3} representing positions. - * @param {Number|Number[]} [height=0.0] A number or array of numbers representing the heights of each position. - * @param {Number} [granularity = CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. - * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie. + * @param {Cartesian3[]} options.positions The array of type {Cartesian3} representing positions. + * @param {Number|Number[]} [options.height=0.0] A number or array of numbers representing the heights of each position. + * @param {Number} [options.granularity = CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. + * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie. * @returns {Number[]} A new array of positions of type {Number} that have been subdivided and raised to the surface of the ellipsoid. * * @example @@ -18088,10 +17566,10 @@ define('Core/PolylinePipeline',[ /** * Subdivides polyline and raises all points to the specified height. Returns an array of new {Cartesian3} positions. - * @param {Cartesian3[]} positions The array of type {Cartesian3} representing positions. - * @param {Number|Number[]} [height=0.0] A number or array of numbers representing the heights of each position. - * @param {Number} [granularity = CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. - * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie. + * @param {Cartesian3[]} options.positions The array of type {Cartesian3} representing positions. + * @param {Number|Number[]} [options.height=0.0] A number or array of numbers representing the heights of each position. + * @param {Number} [options.granularity = CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. + * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie. * @returns {Cartesian3[]} A new array of cartesian3 positions that have been subdivided and raised to the surface of the ellipsoid. * * @example @@ -18191,7 +17669,7 @@ define('Core/VertexFormat',[ this.st = defaultValue(options.st, false); /** - * When <code>true</code>, the vertex has a binormal attribute (normalized), which is used for tangent-space effects like bump mapping. + * When <code>true</code>, the vertex has a bitangent attribute (normalized), which is used for tangent-space effects like bump mapping. * <p> * 32-bit floating-point. 3 components per attribute. * </p> @@ -18200,7 +17678,7 @@ define('Core/VertexFormat',[ * * @default false */ - this.binormal = defaultValue(options.binormal, false); + this.bitangent = defaultValue(options.bitangent, false); /** * When <code>true</code>, the vertex has a tangent attribute (normalized), which is used for tangent-space effects like bump mapping. @@ -18302,7 +17780,7 @@ define('Core/VertexFormat',[ })); /** - * An immutable vertex format with well-known attributes: position, normal, st, binormal, and tangent. + * An immutable vertex format with well-known attributes: position, normal, st, tangent, and bitangent. * * @type {VertexFormat} * @constant @@ -18310,15 +17788,15 @@ define('Core/VertexFormat',[ * @see VertexFormat#position * @see VertexFormat#normal * @see VertexFormat#st - * @see VertexFormat#binormal * @see VertexFormat#tangent + * @see VertexFormat#bitangent */ VertexFormat.ALL = freezeObject(new VertexFormat({ position : true, normal : true, st : true, - binormal : true, - tangent : true + tangent : true, + bitangent : true })); /** @@ -18363,8 +17841,8 @@ define('Core/VertexFormat',[ array[startingIndex++] = value.position ? 1.0 : 0.0; array[startingIndex++] = value.normal ? 1.0 : 0.0; array[startingIndex++] = value.st ? 1.0 : 0.0; - array[startingIndex++] = value.binormal ? 1.0 : 0.0; array[startingIndex++] = value.tangent ? 1.0 : 0.0; + array[startingIndex++] = value.bitangent ? 1.0 : 0.0; array[startingIndex++] = value.color ? 1.0 : 0.0; return array; @@ -18389,19 +17867,19 @@ define('Core/VertexFormat',[ result = new VertexFormat(); } - result.position = array[startingIndex++] === 1.0; - result.normal = array[startingIndex++] === 1.0; - result.st = array[startingIndex++] === 1.0; - result.binormal = array[startingIndex++] === 1.0; - result.tangent = array[startingIndex++] === 1.0; - result.color = array[startingIndex++] === 1.0; + result.position = array[startingIndex++] === 1.0; + result.normal = array[startingIndex++] === 1.0; + result.st = array[startingIndex++] === 1.0; + result.tangent = array[startingIndex++] === 1.0; + result.bitangent = array[startingIndex++] === 1.0; + result.color = array[startingIndex++] === 1.0; return result; }; /** * Duplicates a VertexFormat instance. * - * @param {VertexFormat} cartesian The vertex format to duplicate. + * @param {VertexFormat} vertexFormat The vertex format to duplicate. * @param {VertexFormat} [result] The object onto which to store the result. * @returns {VertexFormat} The modified result parameter or a new VertexFormat instance if one was not provided. (Returns undefined if vertexFormat is undefined) */ @@ -18416,8 +17894,8 @@ define('Core/VertexFormat',[ result.position = vertexFormat.position; result.normal = vertexFormat.normal; result.st = vertexFormat.st; - result.binormal = vertexFormat.binormal; result.tangent = vertexFormat.tangent; + result.bitangent = vertexFormat.bitangent; result.color = vertexFormat.color; return result; }; diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createPolylineVolumeGeometry.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createPolylineVolumeGeometry.js index d38abbd6..90fbc512 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createPolylineVolumeGeometry.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createPolylineVolumeGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,68 +45,6 @@ define('Core/defined',[],function() { return defined; }); -/*global define*/ -define('Core/freezeObject',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Freezes an object, using Object.freeze if available, otherwise returns - * the object unchanged. This function should be used in setup code to prevent - * errors from completely halting JavaScript execution in legacy browsers. - * - * @private - * - * @exports freezeObject - */ - var freezeObject = Object.freeze; - if (!defined(freezeObject)) { - freezeObject = function(o) { - return o; - }; - } - - return freezeObject; -}); - -/*global define*/ -define('Core/defaultValue',[ - './freezeObject' - ], function( - freezeObject) { - 'use strict'; - - /** - * Returns the first parameter if not undefined, otherwise the second parameter. - * Useful for setting a default value for a parameter. - * - * @exports defaultValue - * - * @param {*} a - * @param {*} b - * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter. - * - * @example - * param = Cesium.defaultValue(param, 'default'); - */ - function defaultValue(a, b) { - if (a !== undefined) { - return a; - } - return b; - } - - /** - * A frozen empty object that can be used as the default value for options passed as - * an object literal. - */ - defaultValue.EMPTY_OBJECT = freezeObject({}); - - return defaultValue; -}); - /*global define*/ define('Core/DeveloperError',[ './defined' @@ -188,41 +126,13 @@ define('Core/DeveloperError',[ return DeveloperError; }); -/*global define*/ -define('Core/isArray',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Tests an object to see if it is an array. - * @exports isArray - * - * @param {Object} value The value to test. - * @returns {Boolean} true if the value is an array, false otherwise. - */ - var isArray = Array.isArray; - if (!defined(isArray)) { - isArray = function(value) { - return Object.prototype.toString.call(value) === '[object Array]'; - }; - } - - return isArray; -}); - /*global define*/ define('Core/Check',[ - './defaultValue', - './defined', - './DeveloperError', - './isArray' + './defined', + './DeveloperError' ], function( - defaultValue, defined, - DeveloperError, - isArray) { + DeveloperError) { 'use strict'; /** @@ -237,111 +147,134 @@ define('Core/Check',[ */ Check.typeOf = {}; - /** - * Contains functions for checking numeric conditions such as minimum and maximum values - */ - Check.numeric = {}; - function getUndefinedErrorMessage(name) { - return name + ' was required but undefined.'; + return name + ' is required, actual value was undefined'; } function getFailedTypeErrorMessage(actual, expected, name) { - return 'Expected ' + name + ' to be typeof ' + expected + ', got ' + actual; + return 'Expected ' + name + ' to be typeof ' + expected + ', actual typeof was ' + actual; } /** * Throws if test is not defined * - * @param {*} test The value that is to be checked * @param {String} name The name of the variable being tested + * @param {*} test The value that is to be checked * @exception {DeveloperError} test must be defined */ - Check.defined = function (test, name) { + Check.defined = function (name, test) { if (!defined(test)) { throw new DeveloperError(getUndefinedErrorMessage(name)); } }; /** - * Throws if test is greater than maximum + * Throws if test is not typeof 'function' * - * @param {Number} test The value to test - * @param {Number} maximum The maximum allowed value - * @exception {DeveloperError} test must not be greater than maximum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'function' */ - Check.numeric.maximum = function (test, maximum) { - Check.typeOf.number(test); - Check.typeOf.number(maximum); - if (test > maximum) { - throw new DeveloperError('Expected ' + test + ' to be at most ' + maximum); + Check.typeOf.func = function (name, test) { + if (typeof test !== 'function') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); } }; /** - * Throws if test is less than minimum + * Throws if test is not typeof 'string' * - * @param {Number} test The value to test - * @param {Number} minimum The minimum allowed value - * @exception {DeveloperError} test must not be less than mininum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'string' */ - Check.numeric.minimum = function (test, minimum) { - Check.typeOf.number(test); - Check.typeOf.number(minimum); - if (test < minimum) { - throw new DeveloperError('Expected ' + test + ' to be at least ' + minimum); + Check.typeOf.string = function (name, test) { + if (typeof test !== 'string') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); } }; /** - * Throws if test is not typeof 'function' + * Throws if test is not typeof 'number' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'function' + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'number' */ - Check.typeOf.function = function (test, name) { - if (typeof test !== 'function') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); + Check.typeOf.number = function (name, test) { + if (typeof test !== 'number') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); } }; /** - * Throws if test is not typeof 'string' + * Throws if test is not typeof 'number' and less than limit * + * @param {String} name The name of the variable being tested * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than limit + */ + Check.typeOf.number.lessThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test >= limit) { + throw new DeveloperError('Expected ' + name + ' to be less than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and less than or equal to limit + * * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'string' + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than or equal to limit */ - Check.typeOf.string = function (test, name) { - if (typeof test !== 'string') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); + Check.typeOf.number.lessThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test > limit) { + throw new DeveloperError('Expected ' + name + ' to be less than or equal to ' + limit + ', actual value was ' + test); } }; /** - * Throws if test is not typeof 'number' + * Throws if test is not typeof 'number' and greater than limit * + * @param {String} name The name of the variable being tested * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than limit + */ + Check.typeOf.number.greaterThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test <= limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and greater than or equal to limit + * * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'number' + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than or equal to limit */ - Check.typeOf.number = function (test, name) { - if (typeof test !== 'number') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); + Check.typeOf.number.greaterThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test < limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than or equal to' + limit + ', actual value was ' + test); } }; /** * Throws if test is not typeof 'object' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested + * @param {*} test The value to test * @exception {DeveloperError} test must be typeof 'object' */ - Check.typeOf.object = function (test, name) { + Check.typeOf.object = function (name, test) { if (typeof test !== 'object') { throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'object', name)); } @@ -350,11 +283,11 @@ define('Core/Check',[ /** * Throws if test is not typeof 'boolean' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested + * @param {*} test The value to test * @exception {DeveloperError} test must be typeof 'boolean' */ - Check.typeOf.boolean = function (test, name) { + Check.typeOf.bool = function (name, test) { if (typeof test !== 'boolean') { throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'boolean', name)); } @@ -363,6 +296,68 @@ define('Core/Check',[ return Check; }); +/*global define*/ +define('Core/freezeObject',[ + './defined' + ], function( + defined) { + 'use strict'; + + /** + * Freezes an object, using Object.freeze if available, otherwise returns + * the object unchanged. This function should be used in setup code to prevent + * errors from completely halting JavaScript execution in legacy browsers. + * + * @private + * + * @exports freezeObject + */ + var freezeObject = Object.freeze; + if (!defined(freezeObject)) { + freezeObject = function(o) { + return o; + }; + } + + return freezeObject; +}); + +/*global define*/ +define('Core/defaultValue',[ + './freezeObject' + ], function( + freezeObject) { + 'use strict'; + + /** + * Returns the first parameter if not undefined, otherwise the second parameter. + * Useful for setting a default value for a parameter. + * + * @exports defaultValue + * + * @param {*} a + * @param {*} b + * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter. + * + * @example + * param = Cesium.defaultValue(param, 'default'); + */ + function defaultValue(a, b) { + if (a !== undefined) { + return a; + } + return b; + } + + /** + * A frozen empty object that can be used as the default value for options passed as + * an object literal. + */ + defaultValue.EMPTY_OBJECT = freezeObject({}); + + return defaultValue; +}); + /* I've wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace so it's better encapsulated. Now you can have multiple random number generators @@ -1047,7 +1042,7 @@ define('Core/Math',[ if (!defined(angle)) { throw new DeveloperError('angle is required.'); } - + return CesiumMath.clamp(angle, -1*CesiumMath.PI_OVER_TWO, CesiumMath.PI_OVER_TWO); }; @@ -1057,11 +1052,11 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [<code>-CesiumMath.PI</code>, <code>CesiumMath.PI</code>]. */ - CesiumMath.negativePiToPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.negativePiToPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - return CesiumMath.zeroToTwoPi(x + CesiumMath.PI) - CesiumMath.PI; + return CesiumMath.zeroToTwoPi(angle + CesiumMath.PI) - CesiumMath.PI; }; /** @@ -1070,12 +1065,12 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [0, <code>CesiumMath.TWO_PI</code>]. */ - CesiumMath.zeroToTwoPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.zeroToTwoPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - var mod = CesiumMath.mod(x, CesiumMath.TWO_PI); - if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(x) > CesiumMath.EPSILON14) { + var mod = CesiumMath.mod(angle, CesiumMath.TWO_PI); + if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(angle) > CesiumMath.EPSILON14) { return CesiumMath.TWO_PI; } return mod; @@ -1145,7 +1140,7 @@ define('Core/Math',[ * @example * //Compute 7!, which is equal to 5040 * var computedFactorial = Cesium.Math.factorial(7); - * + * * @see {@link http://en.wikipedia.org/wiki/Factorial|Factorial on Wikipedia} */ CesiumMath.factorial = function(n) { @@ -1429,7 +1424,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.fromSpherical = function(spherical, result) { - Check.typeOf.object(spherical, 'spherical'); + Check.typeOf.object('spherical', spherical); if (!defined(result)) { result = new Cartesian3(); @@ -1513,8 +1508,8 @@ define('Core/Cartesian3',[ * @returns {Number[]} The array that was packed into */ Cartesian3.pack = function(value, array, startingIndex) { - Check.typeOf.object(value, 'value'); - Check.defined(array, 'array'); + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1534,7 +1529,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.unpack = function(array, startingIndex, result) { - Check.defined(array, 'array'); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1555,7 +1550,7 @@ define('Core/Cartesian3',[ * @returns {Number[]} The packed array. */ Cartesian3.packArray = function(array, result) { - Check.defined(array, 'array'); + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -1578,8 +1573,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3[]} The unpacked array. */ Cartesian3.unpackArray = function(array, result) { - Check.defined(array, 'array'); - Check.numeric.minimum(array.length, 3); + Check.defined('array', array); + Check.typeOf.number.greaterThanOrEquals('array.length', array.length, 3); if (array.length % 3 !== 0) { throw new DeveloperError('array length must be a multiple of 3.'); } @@ -1625,7 +1620,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the maximum component. */ Cartesian3.maximumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z); }; @@ -1637,7 +1632,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the minimum component. */ Cartesian3.minimumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z); }; @@ -1651,9 +1646,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the minimum components. */ Cartesian3.minimumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -1671,9 +1666,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the maximum components. */ Cartesian3.maximumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -1688,7 +1683,7 @@ define('Core/Cartesian3',[ * @returns {Number} The squared magnitude. */ Cartesian3.magnitudeSquared = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z; }; @@ -1717,8 +1712,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distance(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(2.0, 0.0, 0.0)); */ Cartesian3.distance = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitude(distanceScratch); @@ -1737,8 +1732,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distanceSquared(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(3.0, 0.0, 0.0)); */ Cartesian3.distanceSquared = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitudeSquared(distanceScratch); @@ -1752,8 +1747,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.normalize = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian3.magnitude(cartesian); @@ -1776,8 +1771,8 @@ define('Core/Cartesian3',[ * @returns {Number} The dot product. */ Cartesian3.dot = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z; }; @@ -1791,9 +1786,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyComponents = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -1835,9 +1830,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.add = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -1854,9 +1849,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.subtract = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -1873,9 +1868,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -1892,9 +1887,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.divideByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -1910,8 +1905,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.negate = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -1927,8 +1922,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.abs = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -1947,10 +1942,10 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.lerp = function(start, end, t, result) { - Check.typeOf.object(start, 'start'); - Check.typeOf.object(end, 'end'); - Check.typeOf.number(t, 't'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian3.multiplyByScalar(end, t, lerpScratch); result = Cartesian3.multiplyByScalar(start, 1.0 - t, result); @@ -1967,8 +1962,8 @@ define('Core/Cartesian3',[ * @returns {Number} The angle between the Cartesians. */ Cartesian3.angleBetween = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.normalize(left, angleBetweenScratch); Cartesian3.normalize(right, angleBetweenScratch2); @@ -1986,8 +1981,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The most orthogonal axis. */ Cartesian3.mostOrthogonalAxis = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian3.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian3.abs(f, f); @@ -2064,9 +2059,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The cross product. */ Cartesian3.cross = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var leftX = left.x; var leftY = left.y; @@ -2099,8 +2094,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromDegrees(-115.0, 37.0); */ Cartesian3.fromDegrees = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); longitude = CesiumMath.toRadians(longitude); latitude = CesiumMath.toRadians(latitude); @@ -2125,8 +2120,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromRadians(-2.007, 0.645); */ Cartesian3.fromRadians = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); height = defaultValue(height, 0.0); var radiiSquared = defined(ellipsoid) ? ellipsoid.radiiSquared : wgs84RadiiSquared; @@ -2160,7 +2155,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArray([-115.0, 37.0, -107.0, 33.0]); */ Cartesian3.fromDegreesArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -2194,7 +2189,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArray([-2.007, 0.645, -1.867, .575]); */ Cartesian3.fromRadiansArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -2228,7 +2223,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArrayHeights([-115.0, 37.0, 100000.0, -107.0, 33.0, 150000.0]); */ Cartesian3.fromDegreesArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -2263,7 +2258,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArrayHeights([-2.007, 0.645, 100000.0, -1.867, .575, 150000.0]); */ Cartesian3.fromRadiansArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -3010,7 +3005,9 @@ define('Core/Ellipsoid',[ /** * Computes an Ellipsoid from a Cartesian specifying the radii in x, y, and z directions. * - * @param {Cartesian3} [radii=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Cartesian3} [cartesian=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new + * instance should be created. * @returns {Ellipsoid} A new Ellipsoid instance. * * @exception {DeveloperError} All radii components must be greater than or equal to zero. @@ -3554,12 +3551,14 @@ define('Core/arrayRemoveDuplicates',[ /*global define*/ define('Core/Cartesian2',[ + './Check', './defaultValue', './defined', './DeveloperError', './freezeObject', './Math' ], function( + Check, defaultValue, defined, DeveloperError, @@ -3671,12 +3670,8 @@ define('Core/Cartesian2',[ * @returns {Number[]} The array that was packed into */ Cartesian2.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3695,9 +3690,7 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided. */ Cartesian2.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3717,9 +3710,7 @@ define('Core/Cartesian2',[ * @returns {Number[]} The packed array. */ Cartesian2.packArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -3742,9 +3733,7 @@ define('Core/Cartesian2',[ * @returns {Cartesian2[]} The unpacked array. */ Cartesian2.unpackArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -3787,9 +3776,7 @@ define('Core/Cartesian2',[ * @returns {Number} The value of the maximum component. */ Cartesian2.maximumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y); }; @@ -3801,9 +3788,7 @@ define('Core/Cartesian2',[ * @returns {Number} The value of the minimum component. */ Cartesian2.minimumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y); }; @@ -3817,15 +3802,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} A cartesian with the minimum components. */ Cartesian2.minimumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); @@ -3843,15 +3822,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} A cartesian with the maximum components. */ Cartesian2.maximumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -3865,9 +3838,7 @@ define('Core/Cartesian2',[ * @returns {Number} The squared magnitude. */ Cartesian2.magnitudeSquared = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y; }; @@ -3933,12 +3904,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.normalize = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian2.magnitude(cartesian); @@ -3960,12 +3927,8 @@ define('Core/Cartesian2',[ * @returns {Number} The dot product. */ Cartesian2.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y; }; @@ -3979,15 +3942,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.multiplyComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -4003,15 +3960,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.divideComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x / right.x; result.y = left.y / right.y; @@ -4027,15 +3978,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -4051,15 +3996,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -4075,15 +4014,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.multiplyByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -4099,15 +4032,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.divideByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -4122,12 +4049,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.negate = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -4142,12 +4065,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.abs = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -4165,18 +4084,10 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian2.multiplyByScalar(end, t, lerpScratch); result = Cartesian2.multiplyByScalar(start, 1.0 - t, result); @@ -4193,12 +4104,8 @@ define('Core/Cartesian2',[ * @returns {Number} The angle between the Cartesians. */ Cartesian2.angleBetween = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian2.normalize(left, angleBetweenScratch); Cartesian2.normalize(right, angleBetweenScratch2); @@ -4214,12 +4121,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The most orthogonal axis. */ Cartesian2.mostOrthogonalAxis = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian2.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian2.abs(f, f); @@ -4512,6 +4415,7 @@ define('Core/Intersect',[ /*global define*/ define('Core/Rectangle',[ './Cartographic', + './Check', './defaultValue', './defined', './defineProperties', @@ -4521,6 +4425,7 @@ define('Core/Rectangle',[ './Math' ], function( Cartographic, + Check, defaultValue, defined, defineProperties, @@ -4617,13 +4522,8 @@ define('Core/Rectangle',[ * @returns {Number[]} The array that was packed into */ Rectangle.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -4644,9 +4544,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -4667,9 +4565,7 @@ define('Core/Rectangle',[ * @returns {Number} The width. */ Rectangle.computeWidth = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; if (east < west) { @@ -4684,9 +4580,7 @@ define('Core/Rectangle',[ * @returns {Number} The height. */ Rectangle.computeHeight = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); return rectangle.north - rectangle.south; }; @@ -4721,6 +4615,32 @@ define('Core/Rectangle',[ return result; }; + /** + * Creates an rectangle given the boundary longitude and latitude in radians. + * + * @param {Number} [west=0.0] The westernmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [south=0.0] The southernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Number} [east=0.0] The easternmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [north=0.0] The northernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Rectangle} [result] The object onto which to store the result, or undefined if a new instance should be created. + * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. + * + * @example + * var rectangle = Cesium.Rectangle.fromRadians(0.0, Math.PI/4, Math.PI/8, 3*Math.PI/4); + */ + Rectangle.fromRadians = function(west, south, east, north, result) { + if (!defined(result)) { + return new Rectangle(west, south, east, north); + } + + result.west = defaultValue(west, 0.0); + result.south = defaultValue(south, 0.0); + result.east = defaultValue(east, 0.0); + result.north = defaultValue(north, 0.0); + + return result; + }; + /** * Creates the smallest possible Rectangle that encloses all positions in the provided array. * @@ -4729,9 +4649,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartographicArray = function(cartographics, result) { - if (!defined(cartographics)) { - throw new DeveloperError('cartographics is required.'); - } + Check.defined('cartographics', cartographics); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -4784,9 +4702,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartesianArray = function(cartesians, ellipsoid, result) { - if (!defined(cartesians)) { - throw new DeveloperError('cartesians is required.'); - } + Check.defined('cartesians', cartesians); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -4902,9 +4818,7 @@ define('Core/Rectangle',[ * @returns {Boolean} <code>true</code> if the Rectangles are within the provided epsilon, <code>false</code> otherwise. */ Rectangle.prototype.equalsEpsilon = function(other, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon is required and must be a number.'); - } + Check.typeOf.number('epsilon', epsilon); return defined(other) && (Math.abs(this.west - other.west) <= epsilon) && @@ -4924,45 +4838,23 @@ define('Core/Rectangle',[ * @exception {DeveloperError} <code>west</code> must be in the interval [<code>-Pi</code>, <code>Pi</code>]. */ Rectangle.validate = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var north = rectangle.north; - if (typeof north !== 'number') { - throw new DeveloperError('north is required to be a number.'); - } - - if (north < -CesiumMath.PI_OVER_TWO || north > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('north must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('north', north, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('north', north, CesiumMath.PI_OVER_TWO); var south = rectangle.south; - if (typeof south !== 'number') { - throw new DeveloperError('south is required to be a number.'); - } - - if (south < -CesiumMath.PI_OVER_TWO || south > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('south must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('south', south, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('south', south, CesiumMath.PI_OVER_TWO); var west = rectangle.west; - if (typeof west !== 'number') { - throw new DeveloperError('west is required to be a number.'); - } - - if (west < -Math.PI || west > Math.PI) { - throw new DeveloperError('west must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('west', west, -Math.PI); + Check.typeOf.number.lessThanOrEquals('west', west, Math.PI); var east = rectangle.east; - if (typeof east !== 'number') { - throw new DeveloperError('east is required to be a number.'); - } - - if (east < -Math.PI || east > Math.PI) { - throw new DeveloperError('east must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('east', east, -Math.PI); + Check.typeOf.number.lessThanOrEquals('east', east, Math.PI); }; /** @@ -4973,9 +4865,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.south); @@ -4994,9 +4884,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.north); @@ -5015,9 +4903,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.north); @@ -5036,9 +4922,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.south); @@ -5057,9 +4941,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.center = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; @@ -5094,12 +4976,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.intersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var rectangleEast = rectangle.east; var rectangleWest = rectangle.west; @@ -5155,12 +5033,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.simpleIntersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var west = Math.max(rectangle.west, otherRectangle.west); var south = Math.max(rectangle.south, otherRectangle.south); @@ -5191,12 +5065,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.union = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); if (!defined(result)) { result = new Rectangle(); @@ -5240,12 +5110,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.expand = function(rectangle, cartographic, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); if (!defined(result)) { result = new Rectangle(); @@ -5267,12 +5133,8 @@ define('Core/Rectangle',[ * @returns {Boolean} true if the provided cartographic is inside the rectangle, false otherwise. */ Rectangle.contains = function(rectangle, cartographic) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); var longitude = cartographic.longitude; var latitude = cartographic.latitude; @@ -5305,9 +5167,7 @@ define('Core/Rectangle',[ * @returns {Cartesian3[]} The modified result parameter or a new Array of Cartesians instances if none was provided. */ Rectangle.subsample = function(rectangle, ellipsoid, surfaceHeight, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84); surfaceHeight = defaultValue(surfaceHeight, 0.0); @@ -5385,18 +5245,18 @@ define('Core/Rectangle',[ define('Core/BoundingRectangle',[ './Cartesian2', './Cartographic', + './Check', './defaultValue', './defined', - './DeveloperError', './GeographicProjection', './Intersect', './Rectangle' ], function( Cartesian2, Cartographic, + Check, defaultValue, defined, - DeveloperError, GeographicProjection, Intersect, Rectangle) { @@ -5461,12 +5321,8 @@ define('Core/BoundingRectangle',[ * @returns {Number[]} The array that was packed into */ BoundingRectangle.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5487,9 +5343,7 @@ define('Core/BoundingRectangle',[ * @returns {BoundingRectangle} The modified result parameter or a new BoundingRectangle instance if one was not provided. */ BoundingRectangle.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5620,12 +5474,8 @@ define('Core/BoundingRectangle',[ * @returns {BoundingRectangle} The modified result parameter or a new BoundingRectangle instance if one was not provided. */ BoundingRectangle.union = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); if (!defined(result)) { result = new BoundingRectangle(); @@ -5652,12 +5502,8 @@ define('Core/BoundingRectangle',[ * @returns {BoundingRectangle} The modified result parameter or a new BoundingRectangle instance if one was not provided. */ BoundingRectangle.expand = function(rectangle, point, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } - if (!defined(point)) { - throw new DeveloperError('point is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('point', point); result = BoundingRectangle.clone(rectangle, result); @@ -5689,12 +5535,8 @@ define('Core/BoundingRectangle',[ * @returns {Intersect} <code>Intersect.INTESECTING</code> if the rectangles intersect, <code>Intersect.OUTSIDE</code> otherwise. */ BoundingRectangle.intersect = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); var leftX = left.x; var leftY = left.y; @@ -5798,6 +5640,7 @@ define('Core/Interval',[ /*global define*/ define('Core/Matrix3',[ './Cartesian3', + './Check', './defaultValue', './defined', './defineProperties', @@ -5806,6 +5649,7 @@ define('Core/Matrix3',[ './Math' ], function( Cartesian3, + Check, defaultValue, defined, defineProperties, @@ -5868,13 +5712,8 @@ define('Core/Matrix3',[ * @returns {Number[]} The array that was packed into */ Matrix3.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5900,9 +5739,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. */ Matrix3.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5929,24 +5766,24 @@ define('Core/Matrix3',[ * @param {Matrix3} [result] The object onto which to store the result. * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. (Returns undefined if matrix is undefined) */ - Matrix3.clone = function(values, result) { - if (!defined(values)) { + Matrix3.clone = function(matrix, result) { + if (!defined(matrix)) { return undefined; } if (!defined(result)) { - return new Matrix3(values[0], values[3], values[6], - values[1], values[4], values[7], - values[2], values[5], values[8]); + return new Matrix3(matrix[0], matrix[3], matrix[6], + matrix[1], matrix[4], matrix[7], + matrix[2], matrix[5], matrix[8]); } - result[0] = values[0]; - result[1] = values[1]; - result[2] = values[2]; - result[3] = values[3]; - result[4] = values[4]; - result[5] = values[5]; - result[6] = values[6]; - result[7] = values[7]; - result[8] = values[8]; + result[0] = matrix[0]; + result[1] = matrix[1]; + result[2] = matrix[2]; + result[3] = matrix[3]; + result[4] = matrix[4]; + result[5] = matrix[5]; + result[6] = matrix[6]; + result[7] = matrix[7]; + result[8] = matrix[8]; return result; }; @@ -5972,9 +5809,7 @@ define('Core/Matrix3',[ * var m2 = Cesium.Matrix3.fromArray(v2, 2); */ Matrix3.fromArray = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -6002,9 +5837,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values parameter is required'); - } + Check.defined('values', values); return Matrix3.clone(values, result); }; @@ -6018,9 +5851,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix3(values[0], values[1], values[2], @@ -6047,9 +5878,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this quaternion. */ Matrix3.fromQuaternion = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); var x2 = quaternion.x * quaternion.x; var xy = quaternion.x * quaternion.y; @@ -6099,10 +5928,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this headingPitchRoll. */ Matrix3.fromHeadingPitchRoll = function(headingPitchRoll, result) { - if (!defined(headingPitchRoll)) { - throw new DeveloperError('headingPitchRoll is required'); - } - var cosTheta = Math.cos(-headingPitchRoll.pitch); + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + + var cosTheta = Math.cos(-headingPitchRoll.pitch); var cosPsi = Math.cos(-headingPitchRoll.heading); var cosPhi = Math.cos(headingPitchRoll.roll); var sinTheta = Math.sin(-headingPitchRoll.pitch); @@ -6153,9 +5981,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix3( @@ -6191,9 +6017,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromUniformScale(2.0); */ Matrix3.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix3( @@ -6217,7 +6041,7 @@ define('Core/Matrix3',[ /** * Computes a Matrix3 instance representing the cross product equivalent matrix of a Cartesian3 vector. * - * @param {Cartesian3} the vector on the left hand side of the cross product operation. + * @param {Cartesian3} vector the vector on the left hand side of the cross product operation. * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created. * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. * @@ -6229,9 +6053,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromCrossProduct(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromCrossProduct = function(vector, result) { - if (!defined(vector)) { - throw new DeveloperError('vector is required.'); - } + Check.typeOf.object('vector', vector); if (!defined(result)) { return new Matrix3( @@ -6266,9 +6088,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationX = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -6307,9 +6127,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationY = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -6348,9 +6166,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationZ = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -6384,9 +6200,7 @@ define('Core/Matrix3',[ * @returns {Number[]} The modified Array parameter or a new Array instance if one was not provided. */ Matrix3.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5], matrix[6], matrix[7], matrix[8]]; @@ -6420,12 +6234,10 @@ define('Core/Matrix3',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix3.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 2) { - throw new DeveloperError('row must be 0, 1, or 2.'); - } - if (typeof column !== 'number' || column < 0 || column > 2) { - throw new DeveloperError('column must be 0, 1, or 2.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 2); + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 2); return column * 3 + row; }; @@ -6441,16 +6253,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var startIndex = index * 3; var x = matrix[startIndex]; @@ -6475,18 +6281,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); var startIndex = index * 3; @@ -6507,15 +6306,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 3]; @@ -6539,18 +6333,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); result[index] = cartesian.x; @@ -6569,12 +6356,8 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[3], matrix[4], matrix[5], scratchColumn)); @@ -6605,15 +6388,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var column0Row0 = left[0] * right[0] + left[3] * right[1] + left[6] * right[2]; var column0Row1 = left[1] * right[0] + left[4] * right[1] + left[7] * right[2]; @@ -6648,15 +6425,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -6679,15 +6450,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -6710,15 +6475,9 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -6743,15 +6502,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -6782,15 +6535,9 @@ define('Core/Matrix3',[ * @see Matrix3.multiplyByUniformScale */ Matrix3.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); result[0] = matrix[0] * scale.x; result[1] = matrix[1] * scale.x; @@ -6812,12 +6559,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -6839,12 +6582,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var column0Row0 = matrix[0]; var column0Row1 = matrix[3]; @@ -6984,9 +6723,7 @@ define('Core/Matrix3',[ * var c = Cesium.Cartesian3.multiplyByScalar(v, lambda, new Cesium.Cartesian3()); // equal to Cesium.Matrix3.multiplyByVector(a, v) */ Matrix3.computeEigenDecomposition = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); // This routine was created based upon Matrix Computations, 3rd ed., by Golub and Van Loan, // section 8.4.3 The Classical Jacobi Algorithm @@ -7030,12 +6767,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -7057,9 +6790,7 @@ define('Core/Matrix3',[ * @returns {Number} The value of the determinant of the matrix. */ Matrix3.determinant = function(matrix) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); var m11 = matrix[0]; var m21 = matrix[3]; @@ -7084,12 +6815,8 @@ define('Core/Matrix3',[ * @exception {DeveloperError} matrix is not invertible. */ Matrix3.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var m11 = matrix[0]; var m21 = matrix[1]; @@ -7155,9 +6882,7 @@ define('Core/Matrix3',[ * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. */ Matrix3.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -7345,12 +7070,14 @@ define('Core/Matrix3',[ /*global define*/ define('Core/Cartesian4',[ + './Check', './defaultValue', './defined', './DeveloperError', './freezeObject', './Math' ], function( + Check, defaultValue, defined, DeveloperError, @@ -7433,9 +7160,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.fromColor = function(color, result) { - if (!defined(color)) { - throw new DeveloperError('color is required'); - } + Check.typeOf.object('color', color); if (!defined(result)) { return new Cartesian4(color.red, color.green, color.blue, color.alpha); } @@ -7487,12 +7212,8 @@ define('Core/Cartesian4',[ * @returns {Number[]} The array that was packed into */ Cartesian4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -7513,9 +7234,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -7537,9 +7256,7 @@ define('Core/Cartesian4',[ * @returns {Number[]} The packed array. */ Cartesian4.packArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -7562,9 +7279,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4[]} The unpacked array. */ Cartesian4.unpackArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -7607,9 +7322,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the maximum component. */ Cartesian4.maximumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -7621,9 +7334,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the minimum component. */ Cartesian4.minimumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -7637,15 +7348,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the minimum components. */ Cartesian4.minimumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -7664,15 +7369,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the maximum components. */ Cartesian4.maximumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -7689,9 +7388,7 @@ define('Core/Cartesian4',[ * @returns {Number} The squared magnitude. */ Cartesian4.magnitudeSquared = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z + cartesian.w * cartesian.w; }; @@ -7722,9 +7419,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(2.0, 0.0, 0.0, 0.0)); */ Cartesian4.distance = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitude(distanceScratch); @@ -7745,9 +7441,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(3.0, 0.0, 0.0, 0.0)); */ Cartesian4.distanceSquared = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitudeSquared(distanceScratch); @@ -7761,12 +7456,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.normalize = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian4.magnitude(cartesian); @@ -7790,12 +7481,8 @@ define('Core/Cartesian4',[ * @returns {Number} The dot product. */ Cartesian4.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w; }; @@ -7809,15 +7496,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -7835,15 +7516,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x / right.x; result.y = left.y / right.y; @@ -7861,15 +7536,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -7887,15 +7556,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -7913,15 +7576,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -7939,15 +7596,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -7964,12 +7615,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.negate = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -7986,12 +7633,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.abs = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -8011,18 +7654,10 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian4.multiplyByScalar(end, t, lerpScratch); result = Cartesian4.multiplyByScalar(start, 1.0 - t, result); @@ -8038,12 +7673,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The most orthogonal axis. */ Cartesian4.mostOrthogonalAxis = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian4.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian4.abs(f, f); @@ -8288,6 +7919,7 @@ define('Core/RuntimeError',[ define('Core/Matrix4',[ './Cartesian3', './Cartesian4', + './Check', './defaultValue', './defined', './defineProperties', @@ -8299,6 +7931,7 @@ define('Core/Matrix4',[ ], function( Cartesian3, Cartesian4, + Check, defaultValue, defined, defineProperties, @@ -8389,13 +8022,8 @@ define('Core/Matrix4',[ * @returns {Number[]} The array that was packed into */ Matrix4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -8428,9 +8056,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if one was not provided. */ Matrix4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -8526,9 +8152,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required'); - } + Check.defined('values', values); return Matrix4.clone(values, result); }; @@ -8542,9 +8166,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix4(values[0], values[1], values[2], values[3], @@ -8581,9 +8203,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRotationTranslation = function(rotation, translation, result) { - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } + Check.typeOf.object('rotation', rotation); translation = defaultValue(translation, Cartesian3.ZERO); @@ -8631,15 +8251,9 @@ define('Core/Matrix4',[ * result); */ Matrix4.fromTranslationQuaternionRotationScale = function(translation, rotation, scale, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('translation', translation); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('scale', scale); if (!defined(result)) { result = new Matrix4(); @@ -8700,9 +8314,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromTranslationRotationScale = function(translationRotationScale, result) { - if (!defined(translationRotationScale)) { - throw new DeveloperError('translationRotationScale is required.'); - } + Check.typeOf.object('translationRotationScale', translationRotationScale); return Matrix4.fromTranslationQuaternionRotationScale(translationRotationScale.translation, translationRotationScale.rotation, translationRotationScale.scale, result); }; @@ -8717,9 +8329,7 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByTranslation */ Matrix4.fromTranslation = function(translation, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } + Check.typeOf.object('translation', translation); return Matrix4.fromRotationTranslation(Matrix3.IDENTITY, translation, result); }; @@ -8740,9 +8350,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix4.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix4( @@ -8787,9 +8395,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromUniformScale(2.0); */ Matrix4.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix4(scale, 0.0, 0.0, 0.0, @@ -8829,23 +8435,15 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromCamera = function(camera, result) { - if (!defined(camera)) { - throw new DeveloperError('camera is required.'); - } + Check.typeOf.object('camera', camera); var position = camera.position; var direction = camera.direction; var up = camera.up; - if (!defined(position)) { - throw new DeveloperError('camera.position is required.'); - } - if (!defined(direction)) { - throw new DeveloperError('camera.direction is required.'); - } - if (!defined(up)) { - throw new DeveloperError('camera.up is required.'); - } + Check.typeOf.object('camera.position', position); + Check.typeOf.object('camera.direction', direction); + Check.typeOf.object('camera.up', up); Cartesian3.normalize(direction, fromCameraF); Cartesian3.normalize(Cartesian3.cross(fromCameraF, up, fromCameraR), fromCameraR); @@ -8924,21 +8522,11 @@ define('Core/Matrix4',[ * @exception {DeveloperError} far must be greater than zero. */ Matrix4.computePerspectiveFieldOfView = function(fovY, aspectRatio, near, far, result) { - if (fovY <= 0.0 || fovY > Math.PI) { - throw new DeveloperError('fovY must be in (0, PI].'); - } - if (aspectRatio <= 0.0) { - throw new DeveloperError('aspectRatio must be greater than zero.'); - } - if (near <= 0.0) { - throw new DeveloperError('near must be greater than zero.'); - } - if (far <= 0.0) { - throw new DeveloperError('far must be greater than zero.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThan('fovY', fovY, 0.0); + Check.typeOf.number.lessThan('fovY', fovY, Math.PI); + Check.typeOf.number.greaterThan('near', near, 0.0); + Check.typeOf.number.greaterThan('far', far, 0.0); + Check.typeOf.object('result', result); var bottom = Math.tan(fovY * 0.5); @@ -8979,27 +8567,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeOrthographicOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var a = 1.0 / (right - left); var b = 1.0 / (top - bottom); @@ -9044,27 +8618,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computePerspectiveOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -9105,24 +8665,12 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeInfinitePerspectiveOffCenter = function(left, right, bottom, top, near, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -9170,9 +8718,7 @@ define('Core/Matrix4',[ * }, 0.0, 1.0, new Cesium.Matrix4()); */ Matrix4.computeViewportTransformation = function(viewport, nearDepthRange, farDepthRange, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); viewport = defaultValue(viewport, defaultValue.EMPTY_OBJECT); var x = defaultValue(viewport.x, 0.0); @@ -9224,21 +8770,11 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeView = function(position, direction, up, right, result) { - if (!defined(position)) { - throw new DeveloperError('position is required'); - } - if (!defined(direction)) { - throw new DeveloperError('direction is required'); - } - if (!defined(up)) { - throw new DeveloperError('up is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); + Check.typeOf.object('up', up); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = right.x; result[1] = up.x; @@ -9279,9 +8815,7 @@ define('Core/Matrix4',[ * //creates a = [10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0] */ Matrix4.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], @@ -9325,12 +8859,11 @@ define('Core/Matrix4',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix4.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 3) { - throw new DeveloperError('row must be 0, 1, 2, or 3.'); - } - if (typeof column !== 'number' || column < 0 || column > 3) { - throw new DeveloperError('column must be 0, 1, 2, or 3.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 3); + + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 3); return column * 4 + row; }; @@ -9363,16 +8896,12 @@ define('Core/Matrix4',[ * // a.x = 12.0; a.y = 16.0; a.z = 20.0; a.w = 24.0; */ Matrix4.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var startIndex = index * 4; var x = matrix[startIndex]; @@ -9414,18 +8943,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 96.0, 25.0] */ Matrix4.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); var startIndex = index * 4; @@ -9446,15 +8970,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.setTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -9507,16 +9025,12 @@ define('Core/Matrix4',[ * // a.x = 18.0; a.y = 19.0; a.z = 20.0; a.w = 21.0; */ Matrix4.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 4]; @@ -9557,18 +9071,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 24.0, 25.0] */ Matrix4.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); result[index] = cartesian.x; @@ -9588,12 +9097,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter */ Matrix4.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[4], matrix[5], matrix[6], scratchColumn)); @@ -9625,15 +9130,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -9715,17 +9214,11 @@ define('Core/Matrix4',[ * @param {Matrix4} right The second matrix. * @param {Matrix4} result The object onto which to store the result. * @returns {Matrix4} The modified result parameter. - */ - Matrix4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + */ + Matrix4.add = function(left, right, result) { + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -9755,15 +9248,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -9804,15 +9291,9 @@ define('Core/Matrix4',[ * var m3 = Cesium.Matrix4.multiplyTransformation(m1, m2, new Cesium.Matrix4()); */ Matrix4.multiplyTransformation = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -9890,15 +9371,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByMatrix3(m, rotation, m); */ Matrix4.multiplyByMatrix3 = function(matrix, rotation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('result', result); var left0 = matrix[0]; var left1 = matrix[1]; @@ -9966,15 +9441,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByTranslation(m, position, m); */ Matrix4.multiplyByTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); var x = translation.x; var y = translation.y; @@ -10026,15 +9495,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByScale */ Matrix4.multiplyByUniformScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scale', scale); + Check.typeOf.object('result', result); uniformScaleScratch.x = scale; uniformScaleScratch.y = scale; @@ -10063,15 +9526,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByUniformScale */ Matrix4.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); var scaleX = scale.x; var scaleY = scale.y; @@ -10110,15 +9567,9 @@ define('Core/Matrix4',[ * @returns {Cartesian4} The modified result parameter. */ Matrix4.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -10154,15 +9605,9 @@ define('Core/Matrix4',[ * // Cesium.Matrix4.multiplyByVector(matrix, new Cesium.Cartesian4(p.x, p.y, p.z, 0.0), result); */ Matrix4.multiplyByPointAsVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -10192,16 +9637,9 @@ define('Core/Matrix4',[ * var result = Cesium.Matrix4.multiplyByPoint(matrix, p, new Cesium.Cartesian3()); */ Matrix4.multiplyByPoint = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -10241,15 +9679,9 @@ define('Core/Matrix4',[ * // [-44.0, -46.0, -48.0, -50.0] */ Matrix4.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -10293,12 +9725,8 @@ define('Core/Matrix4',[ * // [-22.0, -23.0, -24.0, -25.0] */ Matrix4.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -10342,12 +9770,8 @@ define('Core/Matrix4',[ * // [13.0, 17.0, 21.0, 25.0] */ Matrix4.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var matrix1 = matrix[1]; var matrix2 = matrix[2]; @@ -10383,12 +9807,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -10502,9 +9922,7 @@ define('Core/Matrix4',[ * //Prints "Difference between both the matrices is not less than 0.1" on the console */ Matrix4.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -10535,12 +9953,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter. */ Matrix4.getTranslation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = matrix[12]; result.y = matrix[13]; @@ -10571,12 +9985,8 @@ define('Core/Matrix4',[ * // [12.0, 16.0, 20.0] */ Matrix4.getRotation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -10608,12 +10018,8 @@ define('Core/Matrix4',[ * @exception {RuntimeError} matrix is not invertible because its determinate is zero. */ Matrix4.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); // Special case for a zero scale matrix that can occur, for example, // when a model's node has a [0, 0, 0] scale. @@ -10751,12 +10157,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.inverseTransformation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); //This function is an optimized version of the below 4 lines. //var rT = Matrix3.transpose(Matrix4.getRotation(matrix)); @@ -11041,9 +10443,9 @@ define('Core/Matrix4',[ define('Core/BoundingSphere',[ './Cartesian3', './Cartographic', + './Check', './defaultValue', './defined', - './DeveloperError', './Ellipsoid', './GeographicProjection', './Intersect', @@ -11054,9 +10456,9 @@ define('Core/BoundingSphere',[ ], function( Cartesian3, Cartographic, + Check, defaultValue, defined, - DeveloperError, Ellipsoid, GeographicProjection, Intersect, @@ -11386,9 +10788,7 @@ define('Core/BoundingSphere',[ stride = defaultValue(stride, 3); - if (stride < 3) { - throw new DeveloperError('stride must be 3 or greater.'); - } + Check.typeOf.number.greaterThanOrEquals('stride', stride, 3); var currentPos = fromPointsCurrentPos; currentPos.x = positions[0] + center.x; @@ -11692,9 +11092,8 @@ define('Core/BoundingSphere',[ * var sphere = Cesium.BoundingSphere.fromCornerPoints(new Cesium.Cartesian3(-0.5, -0.5, -0.5), new Cesium.Cartesian3(0.5, 0.5, 0.5)); */ BoundingSphere.fromCornerPoints = function(corner, oppositeCorner, result) { - if (!defined(corner) || !defined(oppositeCorner)) { - throw new DeveloperError('corner and oppositeCorner are required.'); - } + Check.typeOf.object('corner', corner); + Check.typeOf.object('oppositeCorner', oppositeCorner); if (!defined(result)) { result = new BoundingSphere(); @@ -11718,9 +11117,7 @@ define('Core/BoundingSphere',[ * var boundingSphere = Cesium.BoundingSphere.fromEllipsoid(ellipsoid); */ BoundingSphere.fromEllipsoid = function(ellipsoid, result) { - if (!defined(ellipsoid)) { - throw new DeveloperError('ellipsoid is required.'); - } + Check.typeOf.object('ellipsoid', ellipsoid); if (!defined(result)) { result = new BoundingSphere(); @@ -11846,13 +11243,8 @@ define('Core/BoundingSphere',[ * @returns {Number[]} The array that was packed into */ BoundingSphere.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -11874,9 +11266,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if one was not provided. */ BoundingSphere.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -11903,13 +11293,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.union = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); if (!defined(result)) { result = new BoundingSphere(); @@ -11958,13 +11343,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.expand = function(sphere, point, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(point)) { - throw new DeveloperError('point is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('point', point); result = BoundingSphere.clone(sphere, result); @@ -11987,13 +11367,8 @@ define('Core/BoundingSphere',[ * intersects the plane. */ BoundingSphere.intersectPlane = function(sphere, plane) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(plane)) { - throw new DeveloperError('plane is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('plane', plane); var center = sphere.center; var radius = sphere.radius; @@ -12019,13 +11394,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.transform = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -12053,12 +11423,8 @@ define('Core/BoundingSphere',[ * }); */ BoundingSphere.distanceSquaredTo = function(sphere, cartesian) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('cartesian', cartesian); var diff = Cartesian3.subtract(sphere.center, cartesian, distanceSquaredToScratch); return Cartesian3.magnitudeSquared(diff) - sphere.radius * sphere.radius; @@ -12080,13 +11446,8 @@ define('Core/BoundingSphere',[ * var newBoundingSphere = Cesium.BoundingSphere.transformWithoutScale(boundingSphere, modelMatrix); */ BoundingSphere.transformWithoutScale = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -12113,17 +11474,9 @@ define('Core/BoundingSphere',[ * @returns {Interval} The nearest and farthest distances on the bounding sphere from position in direction. */ BoundingSphere.computePlaneDistances = function(sphere, position, direction, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(position)) { - throw new DeveloperError('position is required.'); - } - - if (!defined(direction)) { - throw new DeveloperError('direction is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); if (!defined(result)) { result = new Interval(); @@ -12158,9 +11511,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.projectTo2D = function(sphere, projection, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } + Check.typeOf.object('sphere', sphere); projection = defaultValue(projection, projectTo2DProjection); @@ -12255,12 +11606,8 @@ define('Core/BoundingSphere',[ * @returns {Boolean} <code>true</code> if the sphere is not visible; otherwise <code>false</code>. */ BoundingSphere.isOccluded = function(sphere, occluder) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(occluder)) { - throw new DeveloperError('occluder is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('occluder', occluder); return !occluder.isBoundingSphereVisible(sphere); }; @@ -13469,7 +12816,10 @@ define('Core/WebGLConstants',[ COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : 0x9279, TEXTURE_IMMUTABLE_FORMAT : 0x912F, MAX_ELEMENT_INDEX : 0x8D6B, - TEXTURE_IMMUTABLE_LEVELS : 0x82DF + TEXTURE_IMMUTABLE_LEVELS : 0x82DF, + + // Extensions + MAX_TEXTURE_MAX_ANISOTROPY_EXT : 0x84FF }; return freezeObject(WebGLConstants); @@ -14046,7 +13396,7 @@ define('Core/Geometry',[ * <li><code>position</code> - 3D vertex position. 64-bit floating-point (for precision). 3 components per attribute. See {@link VertexFormat#position}.</li> * <li><code>normal</code> - Normal (normalized), commonly used for lighting. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#normal}.</li> * <li><code>st</code> - 2D texture coordinate. 32-bit floating-point. 2 components per attribute. See {@link VertexFormat#st}.</li> - * <li><code>binormal</code> - Binormal (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#binormal}.</li> + * <li><code>bitangent</code> - Bitangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#bitangent}.</li> * <li><code>tangent</code> - Tangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#tangent}.</li> * </ul> * </p> @@ -14075,7 +13425,7 @@ define('Core/Geometry',[ * componentsPerAttribute : 3, * values : new Float32Array(0) * }); - * + * * @see GeometryAttribute * @see VertexFormat */ @@ -14356,7 +13706,7 @@ define('Core/GeometryAttributes',[ this.st = options.st; /** - * The binormal attribute (normalized), which is used for tangent-space effects like bump mapping. + * The bitangent attribute (normalized), which is used for tangent-space effects like bump mapping. * <p> * 32-bit floating-point. 3 components per attribute. * </p> @@ -14365,7 +13715,7 @@ define('Core/GeometryAttributes',[ * * @default undefined */ - this.binormal = options.binormal; + this.bitangent = options.bitangent; /** * The tangent attribute (normalized), which is used for tangent-space effects like bump mapping. @@ -14764,15 +14114,127 @@ define('Core/barycentricCoordinates',[ dot11 = Cartesian3.dot(v1, v1); dot12 = Cartesian3.dot(v1, v2); } - - var q = 1.0 / (dot00 * dot11 - dot01 * dot01); - result.y = (dot11 * dot02 - dot01 * dot12) * q; - result.z = (dot00 * dot12 - dot01 * dot02) * q; - result.x = 1.0 - result.y - result.z; - return result; + + var q = 1.0 / (dot00 * dot11 - dot01 * dot01); + result.y = (dot11 * dot02 - dot01 * dot12) * q; + result.z = (dot00 * dot12 - dot01 * dot02) * q; + result.x = 1.0 - result.y - result.z; + return result; + } + + return barycentricCoordinates; +}); + +/*global define*/ +define('Core/oneTimeWarning',[ + './defaultValue', + './defined', + './DeveloperError' + ], function( + defaultValue, + defined, + DeveloperError) { + "use strict"; + + var warnings = {}; + + /** + * Logs a one time message to the console. Use this function instead of + * <code>console.log</code> directly since this does not log duplicate messages + * unless it is called from multiple workers. + * + * @exports oneTimeWarning + * + * @param {String} identifier The unique identifier for this warning. + * @param {String} [message=identifier] The message to log to the console. + * + * @example + * for(var i=0;i<foo.length;++i) { + * if (!defined(foo[i].bar)) { + * // Something that can be recovered from but may happen a lot + * oneTimeWarning('foo.bar undefined', 'foo.bar is undefined. Setting to 0.'); + * foo[i].bar = 0; + * // ... + * } + * } + * + * @private + */ + function oneTimeWarning(identifier, message) { + if (!defined(identifier)) { + throw new DeveloperError('identifier is required.'); + } + + if (!defined(warnings[identifier])) { + warnings[identifier] = true; + console.warn(defaultValue(message, identifier)); + } + } + + oneTimeWarning.geometryOutlines = 'Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.'; + + return oneTimeWarning; +}); + +/*global define*/ +define('Core/deprecationWarning',[ + './defined', + './DeveloperError', + './oneTimeWarning' + ], function( + defined, + DeveloperError, + oneTimeWarning) { + 'use strict'; + + /** + * Logs a deprecation message to the console. Use this function instead of + * <code>console.log</code> directly since this does not log duplicate messages + * unless it is called from multiple workers. + * + * @exports deprecationWarning + * + * @param {String} identifier The unique identifier for this deprecated API. + * @param {String} message The message to log to the console. + * + * @example + * // Deprecated function or class + * function Foo() { + * deprecationWarning('Foo', 'Foo was deprecated in Cesium 1.01. It will be removed in 1.03. Use newFoo instead.'); + * // ... + * } + * + * // Deprecated function + * Bar.prototype.func = function() { + * deprecationWarning('Bar.func', 'Bar.func() was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newFunc() instead.'); + * // ... + * }; + * + * // Deprecated property + * defineProperties(Bar.prototype, { + * prop : { + * get : function() { + * deprecationWarning('Bar.prop', 'Bar.prop was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newProp instead.'); + * // ... + * }, + * set : function(value) { + * deprecationWarning('Bar.prop', 'Bar.prop was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newProp instead.'); + * // ... + * } + * } + * }); + * + * @private + */ + function deprecationWarning(identifier, message) { + if (!defined(identifier) || !defined(message)) { + throw new DeveloperError('identifier and message are required.'); + } + + oneTimeWarning(identifier, message); } - return barycentricCoordinates; + return deprecationWarning; }); /*global define*/ @@ -15884,6 +15346,7 @@ define('Core/IntersectionTests',[ './defaultValue', './defined', './DeveloperError', + './Interval', './Math', './Matrix3', './QuadraticRealPolynomial', @@ -15895,6 +15358,7 @@ define('Core/IntersectionTests',[ defaultValue, defined, DeveloperError, + Interval, CesiumMath, Matrix3, QuadraticRealPolynomial, @@ -16166,7 +15630,7 @@ define('Core/IntersectionTests',[ function raySphere(ray, sphere, result) { if (!defined(result)) { - result = {}; + result = new Interval(); } var origin = ray.origin; @@ -16197,8 +15661,8 @@ define('Core/IntersectionTests',[ * * @param {Ray} ray The ray. * @param {BoundingSphere} sphere The sphere. - * @param {Object} [result] The result onto which to store the result. - * @returns {Object} An object with the first (<code>start</code>) and the second (<code>stop</code>) intersection scalars for points along the ray or undefined if there are no intersections. + * @param {Interval} [result] The result onto which to store the result. + * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections. */ IntersectionTests.raySphere = function(ray, sphere, result) { if (!defined(ray)) { @@ -16226,8 +15690,8 @@ define('Core/IntersectionTests',[ * @param {Cartesian3} p0 An end point of the line segment. * @param {Cartesian3} p1 The other end point of the line segment. * @param {BoundingSphere} sphere The sphere. - * @param {Object} [result] The result onto which to store the result. - * @returns {Object} An object with the first (<code>start</code>) and the second (<code>stop</code>) intersection scalars for points along the line segment or undefined if there are no intersections. + * @param {Interval} [result] The result onto which to store the result. + * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections. */ IntersectionTests.lineSegmentSphere = function(p0, p1, sphere, result) { if (!defined(p0)) { @@ -16265,7 +15729,7 @@ define('Core/IntersectionTests',[ * * @param {Ray} ray The ray. * @param {Ellipsoid} ellipsoid The ellipsoid. - * @returns {Object} An object with the first (<code>start</code>) and the second (<code>stop</code>) intersection scalars for points along the ray or undefined if there are no intersections. + * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections. */ IntersectionTests.rayEllipsoid = function(ray, ellipsoid) { if (!defined(ray)) { @@ -16307,10 +15771,7 @@ define('Core/IntersectionTests',[ var root0 = temp / w2; var root1 = difference / temp; if (root0 < root1) { - return { - start : root0, - stop : root1 - }; + return new Interval(root0, root1); } return { @@ -16320,10 +15781,7 @@ define('Core/IntersectionTests',[ } else { // qw2 == product. Repeated roots (2 intersections). var root = Math.sqrt(difference / w2); - return { - start : root, - stop : root - }; + return new Interval(root, root); } } else if (q2 < 1.0) { // Inside ellipsoid (2 intersections). @@ -16333,19 +15791,13 @@ define('Core/IntersectionTests',[ discriminant = qw * qw - product; temp = -qw + Math.sqrt(discriminant); // Positively valued. - return { - start : 0.0, - stop : temp / w2 - }; + return new Interval(0.0, temp / w2); } else { // q2 == 1.0. On ellipsoid. if (qw < 0.0) { // Looking inward. w2 = Cartesian3.magnitudeSquared(w); - return { - start : 0.0, - stop : -qw / w2 - }; + return new Interval(0.0, -qw / w2); } // qw >= 0.0. Looking outward or tangent. @@ -17254,6 +16706,7 @@ define('Core/GeometryPipeline',[ './ComponentDatatype', './defaultValue', './defined', + './deprecationWarning', './DeveloperError', './EncodedCartesian3', './GeographicProjection', @@ -17280,6 +16733,7 @@ define('Core/GeometryPipeline',[ ComponentDatatype, defaultValue, defined, + deprecationWarning, DeveloperError, EncodedCartesian3, GeographicProjection, @@ -17413,7 +16867,7 @@ define('Core/GeometryPipeline',[ /** * Creates a new {@link Geometry} with <code>LINES</code> representing the provided * attribute (<code>attributeName</code>) for the provided geometry. This is used to - * visualize vector attributes like normals, binormals, and tangents. + * visualize vector attributes like normals, tangents, and bitangents. * * @param {Geometry} geometry The <code>Geometry</code> instance with the attribute. * @param {String} [attributeName='normal'] The name of the attribute. @@ -17423,7 +16877,7 @@ define('Core/GeometryPipeline',[ * @exception {DeveloperError} geometry.attributes must have an attribute with the same name as the attributeName parameter. * * @example - * var geometry = Cesium.GeometryPipeline.createLineSegmentsForVectors(instance.geometry, 'binormal', 100000.0); + * var geometry = Cesium.GeometryPipeline.createLineSegmentsForVectors(instance.geometry, 'bitangent', 100000.0); */ GeometryPipeline.createLineSegmentsForVectors = function(geometry, attributeName, length) { attributeName = defaultValue(attributeName, 'normal'); @@ -17515,8 +16969,11 @@ define('Core/GeometryPipeline',[ // From VertexFormat 'normal', 'st', - 'binormal', 'tangent', + 'bitangent', + + // For shadow volumes + 'extrudeDirection', // From compressing texture coordinates and normals 'compressedAttributes' @@ -17558,7 +17015,7 @@ define('Core/GeometryPipeline',[ * * @example * geometry = Cesium.GeometryPipeline.reorderForPreVertexCache(geometry); - * + * * @see GeometryPipeline.reorderForPostVertexCache */ GeometryPipeline.reorderForPreVertexCache = function(geometry) { @@ -17643,7 +17100,7 @@ define('Core/GeometryPipeline',[ * * @example * geometry = Cesium.GeometryPipeline.reorderForPostVertexCache(geometry); - * + * * @see GeometryPipeline.reorderForPreVertexCache * @see {@link http://gfx.cs.princ0eton.edu/pubs/Sander_2007_%3ETR/tipsy.pdf|Fast Triangle Reordering for Vertex Locality and Reduced Overdraw} * by Sander, Nehab, and Barczak @@ -17995,7 +17452,7 @@ define('Core/GeometryPipeline',[ * Transforms a geometry instance to world coordinates. This changes * the instance's <code>modelMatrix</code> to {@link Matrix4.IDENTITY} and transforms the * following attributes if they are present: <code>position</code>, <code>normal</code>, - * <code>binormal</code>, and <code>tangent</code>. + * <code>tangent</code>, and <code>bitangent</code>. * * @param {GeometryInstance} instance The geometry instance to modify. * @returns {GeometryInstance} The modified <code>instance</code> argument, with its attributes transforms to world coordinates. @@ -18023,16 +17480,16 @@ define('Core/GeometryPipeline',[ transformPoint(modelMatrix, attributes.nextPosition); if ((defined(attributes.normal)) || - (defined(attributes.binormal)) || - (defined(attributes.tangent))) { + (defined(attributes.tangent)) || + (defined(attributes.bitangent))) { Matrix4.inverse(modelMatrix, inverseTranspose); Matrix4.transpose(inverseTranspose, inverseTranspose); Matrix4.getRotation(inverseTranspose, normalMatrix); transformVector(normalMatrix, attributes.normal); - transformVector(normalMatrix, attributes.binormal); transformVector(normalMatrix, attributes.tangent); + transformVector(normalMatrix, attributes.bitangent); } var boundingSphere = instance.geometry.boundingSphere; @@ -18222,7 +17679,7 @@ define('Core/GeometryPipeline',[ * <p> * This is used by {@link Primitive} to efficiently render a large amount of static data. * </p> - * + * * @private * * @param {GeometryInstance[]} [instances] The array of {@link GeometryInstance} objects whose geometry will be combined. @@ -18238,7 +17695,7 @@ define('Core/GeometryPipeline',[ * Cesium.GeometryPipeline.transformToWorldCoordinates(instances[i]); * } * var geometries = Cesium.GeometryPipeline.combineInstances(instances); - * + * * @see GeometryPipeline.transformToWorldCoordinates */ GeometryPipeline.combineInstances = function(instances) { @@ -18414,8 +17871,8 @@ define('Core/GeometryPipeline',[ var tScratch = new Cartesian3(); /** - * Computes per-vertex binormals and tangents for a geometry containing <code>TRIANGLES</code>. - * The result is new <code>binormal</code> and <code>tangent</code> attributes added to the geometry. + * Computes per-vertex tangents and bitangents for a geometry containing <code>TRIANGLES</code>. + * The result is new <code>tangent</code> and <code>bitangent</code> attributes added to the geometry. * This assumes a counter-clockwise winding order. * <p> * Based on <a href="http://www.terathon.com/code/tangent.html">Computing Tangent Space Basis Vectors @@ -18423,15 +17880,15 @@ define('Core/GeometryPipeline',[ * </p> * * @param {Geometry} geometry The geometry to modify. - * @returns {Geometry} The modified <code>geometry</code> argument with the computed <code>binormal</code> and <code>tangent</code> attributes. + * @returns {Geometry} The modified <code>geometry</code> argument with the computed <code>tangent</code> and <code>bitangent</code> attributes. * * @exception {DeveloperError} geometry.indices length must be greater than 0 and be a multiple of 3. * @exception {DeveloperError} geometry.primitiveType must be {@link PrimitiveType.TRIANGLES}. * * @example - * Cesium.GeometryPipeline.computeBinormalAndTangent(geometry); + * Cesium.GeometryPipeline.computeTangentAndBiTangent(geometry); */ - GeometryPipeline.computeBinormalAndTangent = function(geometry) { + GeometryPipeline.computeTangentAndBitangent = function(geometry) { if (!defined(geometry)) { throw new DeveloperError('geometry is required.'); } @@ -18511,8 +17968,8 @@ define('Core/GeometryPipeline',[ tan1[i23 + 2] += sdirz; } - var binormalValues = new Float32Array(numVertices * 3); var tangentValues = new Float32Array(numVertices * 3); + var bitangentValues = new Float32Array(numVertices * 3); for (i = 0; i < numVertices; i++) { i03 = i * 3; @@ -18531,9 +17988,9 @@ define('Core/GeometryPipeline',[ Cartesian3.normalize(Cartesian3.cross(n, t, t), t); - binormalValues[i03] = t.x; - binormalValues[i13] = t.y; - binormalValues[i23] = t.z; + bitangentValues[i03] = t.x; + bitangentValues[i13] = t.y; + bitangentValues[i23] = t.z; } geometry.attributes.tangent = new GeometryAttribute({ @@ -18542,20 +17999,48 @@ define('Core/GeometryPipeline',[ values : tangentValues }); - geometry.attributes.binormal = new GeometryAttribute({ + geometry.attributes.bitangent = new GeometryAttribute({ componentDatatype : ComponentDatatype.FLOAT, componentsPerAttribute : 3, - values : binormalValues + values : bitangentValues }); return geometry; }; + /** + * Computes per-vertex binormal and tangents for a geometry containing <code>TRIANGLES</code>. + * The result is new <code>binormal</code> and <code>tangent</code> attributes added to the geometry. + * This assumes a counter-clockwise winding order. + * <p> + * Based on <a href="http://www.terathon.com/code/tangent.html">Computing Tangent Space Basis Vectors + * for an Arbitrary Mesh</a> by Eric Lengyel. + * </p> + * + * @param {Geometry} geometry The geometry to modify. + * @returns {Geometry} The modified <code>geometry</code> argument with the computed <code>binormal</code> and <code>tangent</code> attributes. + * + * @exception {DeveloperError} geometry.indices length must be greater than 0 and be a multiple of 3. + * @exception {DeveloperError} geometry.primitiveType must be {@link PrimitiveType.TRIANGLES}. + * + * @example + * Cesium.GeometryPipeline.computeBinormalAndTangent(geometry); + * + * @see GeometryPipeline.computeTangentAndBitangent + */ + GeometryPipeline.computeBinormalAndTangent = function(geometry) { + deprecationWarning('computeBinormalAndTangent', 'computeBinormalAndTangent was deprecated in 1.30. It will be removed in 1.31. Use a computeTangentAndBitangent.'); + GeometryPipeline.computeTangentAndBitangent(geometry); + geometry.attributes.binormal = geometry.attributes.bitangent; + + return geometry; + }; + var scratchCartesian2 = new Cartesian2(); var toEncode1 = new Cartesian3(); var toEncode2 = new Cartesian3(); var toEncode3 = new Cartesian3(); - + var encodeResult2 = new Cartesian2(); /** * Compresses and packs geometry normal attribute values to save memory. * @@ -18570,73 +18055,109 @@ define('Core/GeometryPipeline',[ throw new DeveloperError('geometry is required.'); } + var extrudeAttribute = geometry.attributes.extrudeDirection; + var i; + var numVertices; + if (defined(extrudeAttribute)) { + //only shadow volumes use extrudeDirection, and shadow volumes use vertexFormat: POSITION_ONLY so we don't need to check other attributes + var extrudeDirections = extrudeAttribute.values; + numVertices = extrudeDirections.length / 3.0; + var compressedDirections = new Float32Array(numVertices * 2); + + var i2 = 0; + for (i = 0; i < numVertices; ++i) { + Cartesian3.fromArray(extrudeDirections, i * 3.0, toEncode1); + if (Cartesian3.equals(toEncode1, Cartesian3.ZERO)) { + i2 += 2; + continue; + } + encodeResult2 = AttributeCompression.octEncodeInRange(toEncode1, 65535, encodeResult2); + compressedDirections[i2++] = encodeResult2.x; + compressedDirections[i2++] = encodeResult2.y; + } + + geometry.attributes.compressedAttributes = new GeometryAttribute({ + componentDatatype : ComponentDatatype.FLOAT, + componentsPerAttribute : 2, + values : compressedDirections + }); + delete geometry.attributes.extrudeDirection; + return geometry; + } + var normalAttribute = geometry.attributes.normal; var stAttribute = geometry.attributes.st; - if (!defined(normalAttribute) && !defined(stAttribute)) { + + var hasNormal = defined(normalAttribute); + var hasSt = defined(stAttribute); + if (!hasNormal && !hasSt) { return geometry; } var tangentAttribute = geometry.attributes.tangent; - var binormalAttribute = geometry.attributes.binormal; + var bitangentAttribute = geometry.attributes.bitangent; + + var hasTangent = defined(tangentAttribute); + var hasBitangent = defined(bitangentAttribute); var normals; var st; var tangents; - var binormals; + var bitangents; - if (defined(normalAttribute)) { + if (hasNormal) { normals = normalAttribute.values; } - if (defined(stAttribute)) { + if (hasSt) { st = stAttribute.values; } - if (defined(tangentAttribute)) { + if (hasTangent) { tangents = tangentAttribute.values; } - if (binormalAttribute) { - binormals = binormalAttribute.values; + if (hasBitangent) { + bitangents = bitangentAttribute.values; } - var length = defined(normals) ? normals.length : st.length; - var numComponents = defined(normals) ? 3.0 : 2.0; - var numVertices = length / numComponents; + var length = hasNormal ? normals.length : st.length; + var numComponents = hasNormal ? 3.0 : 2.0; + numVertices = length / numComponents; var compressedLength = numVertices; - var numCompressedComponents = defined(st) && defined(normals) ? 2.0 : 1.0; - numCompressedComponents += defined(tangents) || defined(binormals) ? 1.0 : 0.0; + var numCompressedComponents = hasSt && hasNormal ? 2.0 : 1.0; + numCompressedComponents += hasTangent || hasBitangent ? 1.0 : 0.0; compressedLength *= numCompressedComponents; var compressedAttributes = new Float32Array(compressedLength); var normalIndex = 0; - for (var i = 0; i < numVertices; ++i) { - if (defined(st)) { + for (i = 0; i < numVertices; ++i) { + if (hasSt) { Cartesian2.fromArray(st, i * 2.0, scratchCartesian2); compressedAttributes[normalIndex++] = AttributeCompression.compressTextureCoordinates(scratchCartesian2); } var index = i * 3.0; - if (defined(normals) && defined(tangents) && defined(binormals)) { + if (hasNormal && defined(tangents) && defined(bitangents)) { Cartesian3.fromArray(normals, index, toEncode1); Cartesian3.fromArray(tangents, index, toEncode2); - Cartesian3.fromArray(binormals, index, toEncode3); + Cartesian3.fromArray(bitangents, index, toEncode3); AttributeCompression.octPack(toEncode1, toEncode2, toEncode3, scratchCartesian2); compressedAttributes[normalIndex++] = scratchCartesian2.x; compressedAttributes[normalIndex++] = scratchCartesian2.y; } else { - if (defined(normals)) { + if (hasNormal) { Cartesian3.fromArray(normals, index, toEncode1); compressedAttributes[normalIndex++] = AttributeCompression.octEncodeFloat(toEncode1); } - if (defined(tangents)) { + if (hasTangent) { Cartesian3.fromArray(tangents, index, toEncode1); compressedAttributes[normalIndex++] = AttributeCompression.octEncodeFloat(toEncode1); } - if (defined(binormals)) { - Cartesian3.fromArray(binormals, index, toEncode1); + if (hasBitangent) { + Cartesian3.fromArray(bitangents, index, toEncode1); compressedAttributes[normalIndex++] = AttributeCompression.octEncodeFloat(toEncode1); } } @@ -18648,17 +18169,17 @@ define('Core/GeometryPipeline',[ values : compressedAttributes }); - if (defined(normals)) { + if (hasNormal) { delete geometry.attributes.normal; } - if (defined(st)) { + if (hasSt) { delete geometry.attributes.st; } - if (defined(tangents)) { - delete geometry.attributes.tangent; + if (hasBitangent) { + delete geometry.attributes.bitangent; } - if (defined(binormals)) { - delete geometry.attributes.binormal; + if (hasTangent) { + delete geometry.attributes.tangent; } return geometry; @@ -19075,8 +18596,8 @@ define('Core/GeometryPipeline',[ var s1Scratch = new Cartesian2(); var s2Scratch = new Cartesian2(); - function computeTriangleAttributes(i0, i1, i2, point, positions, normals, binormals, tangents, texCoords, currentAttributes, insertedIndex) { - if (!defined(normals) && !defined(binormals) && !defined(tangents) && !defined(texCoords)) { + function computeTriangleAttributes(i0, i1, i2, point, positions, normals, tangents, bitangents, texCoords, extrudeDirections, currentAttributes, insertedIndex) { + if (!defined(normals) && !defined(tangents) && !defined(bitangents) && !defined(texCoords) && !defined(extrudeDirections)) { return; } @@ -19101,20 +18622,27 @@ define('Core/GeometryPipeline',[ Cartesian3.pack(normal, currentAttributes.normal.values, insertedIndex * 3); } - if (defined(binormals)) { - var b0 = Cartesian3.fromArray(binormals, i0 * 3, p0Scratch); - var b1 = Cartesian3.fromArray(binormals, i1 * 3, p1Scratch); - var b2 = Cartesian3.fromArray(binormals, i2 * 3, p2Scratch); - - Cartesian3.multiplyByScalar(b0, coords.x, b0); - Cartesian3.multiplyByScalar(b1, coords.y, b1); - Cartesian3.multiplyByScalar(b2, coords.z, b2); + if (defined(extrudeDirections)) { + var d0 = Cartesian3.fromArray(extrudeDirections, i0 * 3, p0Scratch); + var d1 = Cartesian3.fromArray(extrudeDirections, i1 * 3, p1Scratch); + var d2 = Cartesian3.fromArray(extrudeDirections, i2 * 3, p2Scratch); - var binormal = Cartesian3.add(b0, b1, b0); - Cartesian3.add(binormal, b2, binormal); - Cartesian3.normalize(binormal, binormal); + Cartesian3.multiplyByScalar(d0, coords.x, d0); + Cartesian3.multiplyByScalar(d1, coords.y, d1); + Cartesian3.multiplyByScalar(d2, coords.z, d2); - Cartesian3.pack(binormal, currentAttributes.binormal.values, insertedIndex * 3); + var direction; + if (!Cartesian3.equals(d0, Cartesian3.ZERO) || !Cartesian3.equals(d1, Cartesian3.ZERO) || !Cartesian3.equals(d2, Cartesian3.ZERO)) { + direction = Cartesian3.add(d0, d1, d0); + Cartesian3.add(direction, d2, direction); + Cartesian3.normalize(direction, direction); + } else { + direction = p0Scratch; + direction.x = 0; + direction.y = 0; + direction.z = 0; + } + Cartesian3.pack(direction, currentAttributes.extrudeDirection.values, insertedIndex * 3); } if (defined(tangents)) { @@ -19133,6 +18661,22 @@ define('Core/GeometryPipeline',[ Cartesian3.pack(tangent, currentAttributes.tangent.values, insertedIndex * 3); } + if (defined(bitangents)) { + var b0 = Cartesian3.fromArray(bitangents, i0 * 3, p0Scratch); + var b1 = Cartesian3.fromArray(bitangents, i1 * 3, p1Scratch); + var b2 = Cartesian3.fromArray(bitangents, i2 * 3, p2Scratch); + + Cartesian3.multiplyByScalar(b0, coords.x, b0); + Cartesian3.multiplyByScalar(b1, coords.y, b1); + Cartesian3.multiplyByScalar(b2, coords.z, b2); + + var bitangent = Cartesian3.add(b0, b1, b0); + Cartesian3.add(bitangent, b2, bitangent); + Cartesian3.normalize(bitangent, bitangent); + + Cartesian3.pack(bitangent, currentAttributes.bitangent.values, insertedIndex * 3); + } + if (defined(texCoords)) { var s0 = Cartesian2.fromArray(texCoords, i0 * 2, s0Scratch); var s1 = Cartesian2.fromArray(texCoords, i1 * 2, s1Scratch); @@ -19177,9 +18721,10 @@ define('Core/GeometryPipeline',[ var attributes = geometry.attributes; var positions = attributes.position.values; var normals = (defined(attributes.normal)) ? attributes.normal.values : undefined; - var binormals = (defined(attributes.binormal)) ? attributes.binormal.values : undefined; + var bitangents = (defined(attributes.bitangent)) ? attributes.bitangent.values : undefined; var tangents = (defined(attributes.tangent)) ? attributes.tangent.values : undefined; var texCoords = (defined(attributes.st)) ? attributes.st.values : undefined; + var extrudeDirections = (defined(attributes.extrudeDirection)) ? attributes.extrudeDirection.values : undefined; var indices = geometry.indices; var eastGeometry = copyGeometryForSplit(geometry); @@ -19233,7 +18778,7 @@ define('Core/GeometryPipeline',[ } insertedIndex = insertSplitPoint(currentAttributes, currentIndices, currentIndexMap, indices, resultIndex < 3 ? i + resultIndex : -1, point); - computeTriangleAttributes(i0, i1, i2, point, positions, normals, binormals, tangents, texCoords, currentAttributes, insertedIndex); + computeTriangleAttributes(i0, i1, i2, point, positions, normals, tangents, bitangents, texCoords, extrudeDirections, currentAttributes, insertedIndex); } } else { if (defined(result)) { @@ -19253,13 +18798,13 @@ define('Core/GeometryPipeline',[ } insertedIndex = insertSplitPoint(currentAttributes, currentIndices, currentIndexMap, indices, i, p0); - computeTriangleAttributes(i0, i1, i2, p0, positions, normals, binormals, tangents, texCoords, currentAttributes, insertedIndex); + computeTriangleAttributes(i0, i1, i2, p0, positions, normals, tangents, bitangents, texCoords, extrudeDirections, currentAttributes, insertedIndex); insertedIndex = insertSplitPoint(currentAttributes, currentIndices, currentIndexMap, indices, i + 1, p1); - computeTriangleAttributes(i0, i1, i2, p1, positions, normals, binormals, tangents, texCoords, currentAttributes, insertedIndex); + computeTriangleAttributes(i0, i1, i2, p1, positions, normals, tangents, bitangents, texCoords, extrudeDirections, currentAttributes, insertedIndex); insertedIndex = insertSplitPoint(currentAttributes, currentIndices, currentIndexMap, indices, i + 2, p2); - computeTriangleAttributes(i0, i1, i2, p2, positions, normals, binormals, tangents, texCoords, currentAttributes, insertedIndex); + computeTriangleAttributes(i0, i1, i2, p2, positions, normals, tangents, bitangents, texCoords, extrudeDirections, currentAttributes, insertedIndex); } } @@ -19687,57 +19232,6 @@ define('Core/GeometryPipeline',[ return GeometryPipeline; }); -/*global define*/ -define('Core/oneTimeWarning',[ - './defaultValue', - './defined', - './DeveloperError' - ], function( - defaultValue, - defined, - DeveloperError) { - "use strict"; - - var warnings = {}; - - /** - * Logs a one time message to the console. Use this function instead of - * <code>console.log</code> directly since this does not log duplicate messages - * unless it is called from multiple workers. - * - * @exports oneTimeWarning - * - * @param {String} identifier The unique identifier for this warning. - * @param {String} [message=identifier] The message to log to the console. - * - * @example - * for(var i=0;i<foo.length;++i) { - * if (!defined(foo[i].bar)) { - * // Something that can be recovered from but may happen a lot - * oneTimeWarning('foo.bar undefined', 'foo.bar is undefined. Setting to 0.'); - * foo[i].bar = 0; - * // ... - * } - * } - * - * @private - */ - function oneTimeWarning(identifier, message) { - if (!defined(identifier)) { - throw new DeveloperError('identifier is required.'); - } - - if (!defined(warnings[identifier])) { - warnings[identifier] = true; - console.log(defaultValue(message, identifier)); - } - } - - oneTimeWarning.geometryOutlines = 'Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.'; - - return oneTimeWarning; -}); - /*global define*/ define('ThirdParty/earcut-2.1.1',[], function() { 'use strict'; @@ -21659,107 +21153,46 @@ define('ThirdParty/when',[],function () { // Skip to the first real element in the array for(;;) { if(i in arr) { - reduced = arr[i++]; - break; - } - - // If we reached the end of the array without finding any real - // elements, it's a TypeError - if(++i >= len) { - throw new TypeError(); - } - } - } else { - // If initialValue provided, use it - reduced = args[1]; - } - - // Do the actual reduce - for(;i < len; ++i) { - // Skip holes - if(i in arr) { - reduced = reduceFunc(reduced, arr[i], i, arr); - } - } - - return reduced; - }; - - function identity(x) { - return x; - } - - return when; -}); -})(typeof define == 'function' && define.amd - ? define - : function (factory) { typeof exports === 'object' - ? (module.exports = factory()) - : (this.when = factory()); - } - // Boilerplate for AMD, Node, and browser global -); - -/*global define*/ -define('Core/deprecationWarning',[ - './defined', - './DeveloperError', - './oneTimeWarning' - ], function( - defined, - DeveloperError, - oneTimeWarning) { - 'use strict'; - - /** - * Logs a deprecation message to the console. Use this function instead of - * <code>console.log</code> directly since this does not log duplicate messages - * unless it is called from multiple workers. - * - * @exports deprecationWarning - * - * @param {String} identifier The unique identifier for this deprecated API. - * @param {String} message The message to log to the console. - * - * @example - * // Deprecated function or class - * function Foo() { - * deprecationWarning('Foo', 'Foo was deprecated in Cesium 1.01. It will be removed in 1.03. Use newFoo instead.'); - * // ... - * } - * - * // Deprecated function - * Bar.prototype.func = function() { - * deprecationWarning('Bar.func', 'Bar.func() was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newFunc() instead.'); - * // ... - * }; - * - * // Deprecated property - * defineProperties(Bar.prototype, { - * prop : { - * get : function() { - * deprecationWarning('Bar.prop', 'Bar.prop was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newProp instead.'); - * // ... - * }, - * set : function(value) { - * deprecationWarning('Bar.prop', 'Bar.prop was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newProp instead.'); - * // ... - * } - * } - * }); - * - * @private - */ - function deprecationWarning(identifier, message) { - if (!defined(identifier) || !defined(message)) { - throw new DeveloperError('identifier and message are required.'); - } - - oneTimeWarning(identifier, message); - } + reduced = arr[i++]; + break; + } - return deprecationWarning; + // If we reached the end of the array without finding any real + // elements, it's a TypeError + if(++i >= len) { + throw new TypeError(); + } + } + } else { + // If initialValue provided, use it + reduced = args[1]; + } + + // Do the actual reduce + for(;i < len; ++i) { + // Skip holes + if(i in arr) { + reduced = reduceFunc(reduced, arr[i], i, arr); + } + } + + return reduced; + }; + + function identity(x) { + return x; + } + + return when; }); +})(typeof define == 'function' && define.amd + ? define + : function (factory) { typeof exports === 'object' + ? (module.exports = factory()) + : (this.when = factory()); + } + // Boilerplate for AMD, Node, and browser global +); /*global define*/ define('Core/binarySearch',[ @@ -25470,6 +24903,7 @@ define('Core/Iau2006XysData',[ /*global define*/ define('Core/Quaternion',[ './Cartesian3', + './Check', './defaultValue', './defined', './DeveloperError', @@ -25479,6 +24913,7 @@ define('Core/Quaternion',[ './Matrix3' ], function( Cartesian3, + Check, defaultValue, defined, DeveloperError, @@ -25541,12 +24976,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided. */ Quaternion.fromAxisAngle = function(axis, angle, result) { - if (!defined(axis)) { - throw new DeveloperError('axis is required.'); - } - if (typeof angle !== 'number') { - throw new DeveloperError('angle is required and must be a number.'); - } + Check.typeOf.object('axis', axis); + Check.typeOf.number('angle', angle); var halfAngle = angle / 2.0; var s = Math.sin(halfAngle); @@ -25578,9 +25009,7 @@ define('Core/Quaternion',[ * @see Matrix3.fromQuaternion */ Quaternion.fromRotationMatrix = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); var root; var x; @@ -25654,15 +25083,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter or a new Quaternion instance if none was provided. */ Quaternion.fromHeadingPitchRoll = function(heading, pitch, roll, result) { - if (!defined(heading)) { - throw new DeveloperError('heading is required.'); - } - if (!defined(pitch)) { - throw new DeveloperError('pitch is required.'); - } - if (!defined(roll)) { - throw new DeveloperError('roll is required.'); - } + Check.typeOf.number('heading', heading); + Check.typeOf.number('pitch', pitch); + Check.typeOf.number('roll', roll); var rollQuaternion = Quaternion.fromAxisAngle(Cartesian3.UNIT_X, roll, scratchHPRQuaternion); var pitchQuaternion = Quaternion.fromAxisAngle(Cartesian3.UNIT_Y, -pitch, result); @@ -25693,13 +25116,8 @@ define('Core/Quaternion',[ * @returns {Number[]} The array that was packed into */ Quaternion.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -25720,9 +25138,7 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided. */ Quaternion.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -25777,7 +25193,7 @@ define('Core/Quaternion',[ * * @param {Number[]} array The array previously packed for interpolation. * @param {Number[]} sourceArray The original packed array. - * @param {Number} [startingIndex=0] The startingIndex used to convert the array. + * @param {Number} [firstIndex=0] The firstIndex used to convert the array. * @param {Number} [lastIndex=packedArray.length] The lastIndex used to convert the array. * @param {Quaternion} [result] The object into which to store the result. * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided. @@ -25831,12 +25247,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.conjugate = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); result.x = -quaternion.x; result.y = -quaternion.y; @@ -25852,9 +25264,7 @@ define('Core/Quaternion',[ * @returns {Number} The magnitude squared. */ Quaternion.magnitudeSquared = function(quaternion) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); return quaternion.x * quaternion.x + quaternion.y * quaternion.y + quaternion.z * quaternion.z + quaternion.w * quaternion.w; }; @@ -25877,9 +25287,7 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.normalize = function(quaternion, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); var inverseMagnitude = 1.0 / Quaternion.magnitude(quaternion); var x = quaternion.x * inverseMagnitude; @@ -25902,9 +25310,7 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.inverse = function(quaternion, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); var magnitudeSquared = Quaternion.magnitudeSquared(quaternion); result = Quaternion.conjugate(quaternion, result); @@ -25920,15 +25326,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -25946,15 +25346,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -25971,12 +25365,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.negate = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); result.x = -quaternion.x; result.y = -quaternion.y; @@ -25993,12 +25383,8 @@ define('Core/Quaternion',[ * @returns {Number} The dot product. */ Quaternion.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w; }; @@ -26012,15 +25398,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var leftX = left.x; var leftY = left.y; @@ -26053,15 +25433,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.multiplyByScalar = function(quaternion, scalar, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = quaternion.x * scalar; result.y = quaternion.y * scalar; @@ -26079,15 +25453,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.divideByScalar = function(quaternion, scalar, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = quaternion.x / scalar; result.y = quaternion.y / scalar; @@ -26104,12 +25472,8 @@ define('Core/Quaternion',[ * @returns {Cartesian3} The modified result parameter. */ Quaternion.computeAxis = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); var w = quaternion.w; if (Math.abs(w - 1.0) < CesiumMath.EPSILON6) { @@ -26132,9 +25496,7 @@ define('Core/Quaternion',[ * @returns {Number} The angle of rotation. */ Quaternion.computeAngle = function(quaternion) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); if (Math.abs(quaternion.w - 1.0) < CesiumMath.EPSILON6) { return 0.0; @@ -26153,18 +25515,10 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); lerpScratch = Quaternion.multiplyByScalar(end, t, lerpScratch); result = Quaternion.multiplyByScalar(start, 1.0 - t, result); @@ -26186,18 +25540,10 @@ define('Core/Quaternion',[ * @see Quaternion#fastSlerp */ Quaternion.slerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var dot = Quaternion.dot(start, end); @@ -26230,12 +25576,8 @@ define('Core/Quaternion',[ * @returns {Cartesian3} The modified result parameter. */ Quaternion.log = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); var theta = CesiumMath.acosClamped(quaternion.w); var thetaOverSinTheta = 0.0; @@ -26255,12 +25597,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.exp = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var theta = Cartesian3.magnitude(cartesian); var sinThetaOverTheta = 0.0; @@ -26295,12 +25633,10 @@ define('Core/Quaternion',[ * @see Quaternion#squad */ Quaternion.computeInnerQuadrangle = function(q0, q1, q2, result) { - if (!defined(q0) || !defined(q1) || !defined(q2)) { - throw new DeveloperError('q0, q1, and q2 are required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('q0', q0); + Check.typeOf.object('q1', q1); + Check.typeOf.object('q2', q2); + Check.typeOf.object('result', result); var qInv = Quaternion.conjugate(q1, squadScratchQuaternion0); Quaternion.multiply(qInv, q2, squadScratchQuaternion1); @@ -26342,15 +25678,12 @@ define('Core/Quaternion',[ * @see Quaternion#computeInnerQuadrangle */ Quaternion.squad = function(q0, q1, s0, s1, t, result) { - if (!defined(q0) || !defined(q1) || !defined(s0) || !defined(s1)) { - throw new DeveloperError('q0, q1, s0, and s1 are required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('q0', q0); + Check.typeOf.object('q1', q1); + Check.typeOf.object('s0', s0); + Check.typeOf.object('s1', s1); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var slerp0 = Quaternion.slerp(q0, q1, t, squadScratchQuaternion0); var slerp1 = Quaternion.slerp(s0, s1, t, squadScratchQuaternion1); @@ -26387,18 +25720,10 @@ define('Core/Quaternion',[ * @see Quaternion#slerp */ Quaternion.fastSlerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var x = Quaternion.dot(start, end); @@ -26447,15 +25772,12 @@ define('Core/Quaternion',[ * @see Quaternion#squad */ Quaternion.fastSquad = function(q0, q1, s0, s1, t, result) { - if (!defined(q0) || !defined(q1) || !defined(s0) || !defined(s1)) { - throw new DeveloperError('q0, q1, s0, and s1 are required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('q0', q0); + Check.typeOf.object('q1', q1); + Check.typeOf.object('s0', s0); + Check.typeOf.object('s1', s1); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var slerp0 = Quaternion.fastSlerp(q0, q1, t, squadScratchQuaternion0); var slerp1 = Quaternion.fastSlerp(s0, s1, t, squadScratchQuaternion1); @@ -26491,9 +25813,7 @@ define('Core/Quaternion',[ * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. */ Quaternion.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon is required and must be a number.'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || ((defined(left)) && @@ -26573,9 +25893,9 @@ define('Core/Transforms',[ './Cartesian3', './Cartesian4', './Cartographic', + './Check', './defaultValue', './defined', - './deprecationWarning', './DeveloperError', './EarthOrientationParameters', './EarthOrientationParametersSample', @@ -26595,9 +25915,9 @@ define('Core/Transforms',[ Cartesian3, Cartesian4, Cartographic, + Check, defaultValue, defined, - deprecationWarning, DeveloperError, EarthOrientationParameters, EarthOrientationParametersSample, @@ -27033,19 +26353,12 @@ define('Core/Transforms',[ * var hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll); * var transform = Cesium.Transforms.headingPitchRollToFixedFrame(center, hpr); */ - Transforms.headingPitchRollToFixedFrame = function(origin, headingPitchRoll, pitch, roll, ellipsoid, result) { - var heading; - if (typeof headingPitchRoll === 'object') { - // Shift arguments using assignments to encourage JIT optimization. - ellipsoid = pitch; - result = roll; - heading = headingPitchRoll.heading; - pitch = headingPitchRoll.pitch; - roll = headingPitchRoll.roll; - } else { - deprecationWarning('headingPitchRollToFixedFrame', 'headingPitchRollToFixedFrame with separate heading, pitch, and roll arguments was deprecated in 1.27. It will be removed in 1.30. Use a HeadingPitchRoll object.'); - heading = headingPitchRoll; - } + Transforms.headingPitchRollToFixedFrame = function(origin, headingPitchRoll, ellipsoid, result) { + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + var heading = headingPitchRoll.heading; + var pitch = headingPitchRoll.pitch; + var roll = headingPitchRoll.roll; + // checks for required parameters happen in the called functions var hprQuaternion = Quaternion.fromHeadingPitchRoll(heading, pitch, roll, scratchHPRQuaternion); var hprMatrix = Matrix4.fromTranslationQuaternionRotationScale(Cartesian3.ZERO, hprQuaternion, scratchScale, scratchHPRMatrix4); @@ -27053,7 +26366,6 @@ define('Core/Transforms',[ return Matrix4.multiply(result, hprMatrix, result); }; - var scratchHPR = new HeadingPitchRoll(); var scratchENUMatrix4 = new Matrix4(); var scratchHPRMatrix3 = new Matrix3(); @@ -27078,22 +26390,10 @@ define('Core/Transforms',[ * var hpr = new HeadingPitchRoll(heading, pitch, roll); * var quaternion = Cesium.Transforms.headingPitchRollQuaternion(center, hpr); */ - Transforms.headingPitchRollQuaternion = function(origin, headingPitchRoll, pitch, roll, ellipsoid, result) { - var hpr; - if (typeof headingPitchRoll === 'object') { - // Shift arguments using assignment to encourage JIT optimization. - hpr = headingPitchRoll; - ellipsoid = pitch; - result = roll; - } else { - deprecationWarning('headingPitchRollQuaternion', 'headingPitchRollQuaternion with separate heading, pitch, and roll arguments was deprecated in 1.27. It will be removed in 1.30. Use a HeadingPitchRoll object.'); - scratchHPR.heading = headingPitchRoll; - scratchHPR.pitch = pitch; - scratchHPR.roll = roll; - hpr = scratchHPR; - } + Transforms.headingPitchRollQuaternion = function(origin, headingPitchRoll, ellipsoid, result) { // checks for required parameters happen in the called functions - var transform = Transforms.headingPitchRollToFixedFrame(origin, hpr, ellipsoid, scratchENUMatrix4); + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + var transform = Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, scratchENUMatrix4); var rotation = Matrix4.getRotation(transform, scratchHPRMatrix3); return Quaternion.fromRotationMatrix(rotation, result); }; @@ -27569,6 +26869,46 @@ define('Core/Transforms',[ return result; }; + var swizzleMatrix = new Matrix4( + 0.0, 0.0, 1.0, 0.0, + 1.0, 0.0, 0.0, 0.0, + 0.0, 1.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + + /** + * @private + */ + Transforms.wgs84To2DModelMatrix = function(projection, center, result) { + if (!defined(projection)) { + throw new DeveloperError('projection is required.'); + } + if (!defined(center)) { + throw new DeveloperError('center is required.'); + } + if (!defined(result)) { + throw new DeveloperError('result is required.'); + } + + var ellipsoid = projection.ellipsoid; + + var fromENU = Transforms.eastNorthUpToFixedFrame(center, ellipsoid, scratchFromENU); + var toENU = Matrix4.inverseTransformation(fromENU, scratchToENU); + + var cartographic = ellipsoid.cartesianToCartographic(center, scratchCartographic); + var projectedPosition = projection.project(cartographic, scratchCartesian3Projection); + var newOrigin = scratchCartesian4NewOrigin; + newOrigin.x = projectedPosition.z; + newOrigin.y = projectedPosition.x; + newOrigin.z = projectedPosition.y; + newOrigin.w = 1.0; + + var translation = Matrix4.fromTranslation(newOrigin, scratchFromENU); + Matrix4.multiply(swizzleMatrix, toENU, result); + Matrix4.multiply(translation, result, result); + + return result; + }; + return Transforms; }); @@ -28235,6 +27575,7 @@ define('Core/EllipsoidGeodesic',[ * Provides the location of a point at the indicated portion along the geodesic. * * @param {Number} fraction The portion of the distance between the initial and final points. + * @param {Cartographic} result The object in which to store the result. * @returns {Cartographic} The location of the point along the geodesic. */ EllipsoidGeodesic.prototype.interpolateUsingFraction = function(fraction, result) { @@ -28245,6 +27586,7 @@ define('Core/EllipsoidGeodesic',[ * Provides the location of a point at the indicated distance along the geodesic. * * @param {Number} distance The distance from the inital point to the point of interest along the geodesic + * @param {Cartographic} result The object in which to store the result. * @returns {Cartographic} The location of the point along the geodesic. * * @exception {DeveloperError} start and end must be set before calling function interpolateUsingSurfaceDistance @@ -28316,6 +27658,30 @@ define('Core/EllipsoidGeodesic',[ return EllipsoidGeodesic; }); +/*global define*/ +define('Core/isArray',[ + './defined' + ], function( + defined) { + 'use strict'; + + /** + * Tests an object to see if it is an array. + * @exports isArray + * + * @param {Object} value The value to test. + * @returns {Boolean} true if the value is an array, false otherwise. + */ + var isArray = Array.isArray; + if (!defined(isArray)) { + isArray = function(value) { + return Object.prototype.toString.call(value) === '[object Array]'; + }; + } + + return isArray; +}); + /*global define*/ define('Core/PolylinePipeline',[ './Cartesian3', @@ -28520,10 +27886,10 @@ define('Core/PolylinePipeline',[ /** * Subdivides polyline and raises all points to the specified height. Returns an array of numbers to represent the positions. - * @param {Cartesian3[]} positions The array of type {Cartesian3} representing positions. - * @param {Number|Number[]} [height=0.0] A number or array of numbers representing the heights of each position. - * @param {Number} [granularity = CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. - * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie. + * @param {Cartesian3[]} options.positions The array of type {Cartesian3} representing positions. + * @param {Number|Number[]} [options.height=0.0] A number or array of numbers representing the heights of each position. + * @param {Number} [options.granularity = CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. + * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie. * @returns {Number[]} A new array of positions of type {Number} that have been subdivided and raised to the surface of the ellipsoid. * * @example @@ -28605,10 +27971,10 @@ define('Core/PolylinePipeline',[ /** * Subdivides polyline and raises all points to the specified height. Returns an array of new {Cartesian3} positions. - * @param {Cartesian3[]} positions The array of type {Cartesian3} representing positions. - * @param {Number|Number[]} [height=0.0] A number or array of numbers representing the heights of each position. - * @param {Number} [granularity = CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. - * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie. + * @param {Cartesian3[]} options.positions The array of type {Cartesian3} representing positions. + * @param {Number|Number[]} [options.height=0.0] A number or array of numbers representing the heights of each position. + * @param {Number} [options.granularity = CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. + * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie. * @returns {Cartesian3[]} A new array of cartesian3 positions that have been subdivided and raised to the surface of the ellipsoid. * * @example @@ -29121,7 +28487,7 @@ define('Core/VertexFormat',[ this.st = defaultValue(options.st, false); /** - * When <code>true</code>, the vertex has a binormal attribute (normalized), which is used for tangent-space effects like bump mapping. + * When <code>true</code>, the vertex has a bitangent attribute (normalized), which is used for tangent-space effects like bump mapping. * <p> * 32-bit floating-point. 3 components per attribute. * </p> @@ -29130,7 +28496,7 @@ define('Core/VertexFormat',[ * * @default false */ - this.binormal = defaultValue(options.binormal, false); + this.bitangent = defaultValue(options.bitangent, false); /** * When <code>true</code>, the vertex has a tangent attribute (normalized), which is used for tangent-space effects like bump mapping. @@ -29232,7 +28598,7 @@ define('Core/VertexFormat',[ })); /** - * An immutable vertex format with well-known attributes: position, normal, st, binormal, and tangent. + * An immutable vertex format with well-known attributes: position, normal, st, tangent, and bitangent. * * @type {VertexFormat} * @constant @@ -29240,15 +28606,15 @@ define('Core/VertexFormat',[ * @see VertexFormat#position * @see VertexFormat#normal * @see VertexFormat#st - * @see VertexFormat#binormal * @see VertexFormat#tangent + * @see VertexFormat#bitangent */ VertexFormat.ALL = freezeObject(new VertexFormat({ position : true, normal : true, st : true, - binormal : true, - tangent : true + tangent : true, + bitangent : true })); /** @@ -29293,8 +28659,8 @@ define('Core/VertexFormat',[ array[startingIndex++] = value.position ? 1.0 : 0.0; array[startingIndex++] = value.normal ? 1.0 : 0.0; array[startingIndex++] = value.st ? 1.0 : 0.0; - array[startingIndex++] = value.binormal ? 1.0 : 0.0; array[startingIndex++] = value.tangent ? 1.0 : 0.0; + array[startingIndex++] = value.bitangent ? 1.0 : 0.0; array[startingIndex++] = value.color ? 1.0 : 0.0; return array; @@ -29319,19 +28685,19 @@ define('Core/VertexFormat',[ result = new VertexFormat(); } - result.position = array[startingIndex++] === 1.0; - result.normal = array[startingIndex++] === 1.0; - result.st = array[startingIndex++] === 1.0; - result.binormal = array[startingIndex++] === 1.0; - result.tangent = array[startingIndex++] === 1.0; - result.color = array[startingIndex++] === 1.0; + result.position = array[startingIndex++] === 1.0; + result.normal = array[startingIndex++] === 1.0; + result.st = array[startingIndex++] === 1.0; + result.tangent = array[startingIndex++] === 1.0; + result.bitangent = array[startingIndex++] === 1.0; + result.color = array[startingIndex++] === 1.0; return result; }; /** * Duplicates a VertexFormat instance. * - * @param {VertexFormat} cartesian The vertex format to duplicate. + * @param {VertexFormat} vertexFormat The vertex format to duplicate. * @param {VertexFormat} [result] The object onto which to store the result. * @returns {VertexFormat} The modified result parameter or a new VertexFormat instance if one was not provided. (Returns undefined if vertexFormat is undefined) */ @@ -29346,8 +28712,8 @@ define('Core/VertexFormat',[ result.position = vertexFormat.position; result.normal = vertexFormat.normal; result.st = vertexFormat.st; - result.binormal = vertexFormat.binormal; result.tangent = vertexFormat.tangent; + result.bitangent = vertexFormat.bitangent; result.color = vertexFormat.color; return result; }; @@ -29453,7 +28819,7 @@ define('Core/PolylineVolumeGeometry',[ indices[index++] = lr; } - if (vertexFormat.st || vertexFormat.tangent || vertexFormat.binormal) { // st required for tangent/binormal calculation + if (vertexFormat.st || vertexFormat.tangent || vertexFormat.bitangent) { // st required for tangent/bitangent calculation var st = new Float32Array(vertexCount * 2); var lengthSt = 1 / (length - 1); var heightSt = 1 / (boundingRectangle.height); @@ -29521,19 +28887,19 @@ define('Core/PolylineVolumeGeometry',[ geometry = GeometryPipeline.computeNormal(geometry); } - if (vertexFormat.tangent || vertexFormat.binormal) { + if (vertexFormat.tangent || vertexFormat.bitangent) { try { - geometry = GeometryPipeline.computeBinormalAndTangent(geometry); + geometry = GeometryPipeline.computeTangentAndBitangent(geometry); } catch (e) { - oneTimeWarning('polyline-volume-tangent-binormal', 'Unable to compute tangents and binormals for polyline volume geometry'); + oneTimeWarning('polyline-volume-tangent-bitangent', 'Unable to compute tangents and bitangents for polyline volume geometry'); //TODO https://github.com/AnalyticalGraphicsInc/cesium/issues/3609 } if (!vertexFormat.tangent) { geometry.attributes.tangent = undefined; } - if (!vertexFormat.binormal) { - geometry.attributes.binormal = undefined; + if (!vertexFormat.bitangent) { + geometry.attributes.bitangent = undefined; } if (!vertexFormat.st) { geometry.attributes.st = undefined; diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createPolylineVolumeOutlineGeometry.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createPolylineVolumeOutlineGeometry.js index d605b303..5d13fe4e 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createPolylineVolumeOutlineGeometry.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createPolylineVolumeOutlineGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,68 +45,6 @@ define('Core/defined',[],function() { return defined; }); -/*global define*/ -define('Core/freezeObject',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Freezes an object, using Object.freeze if available, otherwise returns - * the object unchanged. This function should be used in setup code to prevent - * errors from completely halting JavaScript execution in legacy browsers. - * - * @private - * - * @exports freezeObject - */ - var freezeObject = Object.freeze; - if (!defined(freezeObject)) { - freezeObject = function(o) { - return o; - }; - } - - return freezeObject; -}); - -/*global define*/ -define('Core/defaultValue',[ - './freezeObject' - ], function( - freezeObject) { - 'use strict'; - - /** - * Returns the first parameter if not undefined, otherwise the second parameter. - * Useful for setting a default value for a parameter. - * - * @exports defaultValue - * - * @param {*} a - * @param {*} b - * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter. - * - * @example - * param = Cesium.defaultValue(param, 'default'); - */ - function defaultValue(a, b) { - if (a !== undefined) { - return a; - } - return b; - } - - /** - * A frozen empty object that can be used as the default value for options passed as - * an object literal. - */ - defaultValue.EMPTY_OBJECT = freezeObject({}); - - return defaultValue; -}); - /*global define*/ define('Core/DeveloperError',[ './defined' @@ -188,41 +126,13 @@ define('Core/DeveloperError',[ return DeveloperError; }); -/*global define*/ -define('Core/isArray',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Tests an object to see if it is an array. - * @exports isArray - * - * @param {Object} value The value to test. - * @returns {Boolean} true if the value is an array, false otherwise. - */ - var isArray = Array.isArray; - if (!defined(isArray)) { - isArray = function(value) { - return Object.prototype.toString.call(value) === '[object Array]'; - }; - } - - return isArray; -}); - /*global define*/ define('Core/Check',[ - './defaultValue', - './defined', - './DeveloperError', - './isArray' + './defined', + './DeveloperError' ], function( - defaultValue, defined, - DeveloperError, - isArray) { + DeveloperError) { 'use strict'; /** @@ -237,111 +147,134 @@ define('Core/Check',[ */ Check.typeOf = {}; - /** - * Contains functions for checking numeric conditions such as minimum and maximum values - */ - Check.numeric = {}; - function getUndefinedErrorMessage(name) { - return name + ' was required but undefined.'; + return name + ' is required, actual value was undefined'; } function getFailedTypeErrorMessage(actual, expected, name) { - return 'Expected ' + name + ' to be typeof ' + expected + ', got ' + actual; + return 'Expected ' + name + ' to be typeof ' + expected + ', actual typeof was ' + actual; } /** * Throws if test is not defined * - * @param {*} test The value that is to be checked * @param {String} name The name of the variable being tested + * @param {*} test The value that is to be checked * @exception {DeveloperError} test must be defined */ - Check.defined = function (test, name) { + Check.defined = function (name, test) { if (!defined(test)) { throw new DeveloperError(getUndefinedErrorMessage(name)); } }; /** - * Throws if test is greater than maximum + * Throws if test is not typeof 'function' * - * @param {Number} test The value to test - * @param {Number} maximum The maximum allowed value - * @exception {DeveloperError} test must not be greater than maximum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'function' */ - Check.numeric.maximum = function (test, maximum) { - Check.typeOf.number(test); - Check.typeOf.number(maximum); - if (test > maximum) { - throw new DeveloperError('Expected ' + test + ' to be at most ' + maximum); + Check.typeOf.func = function (name, test) { + if (typeof test !== 'function') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); } }; /** - * Throws if test is less than minimum + * Throws if test is not typeof 'string' * - * @param {Number} test The value to test - * @param {Number} minimum The minimum allowed value - * @exception {DeveloperError} test must not be less than mininum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'string' */ - Check.numeric.minimum = function (test, minimum) { - Check.typeOf.number(test); - Check.typeOf.number(minimum); - if (test < minimum) { - throw new DeveloperError('Expected ' + test + ' to be at least ' + minimum); + Check.typeOf.string = function (name, test) { + if (typeof test !== 'string') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); } }; /** - * Throws if test is not typeof 'function' + * Throws if test is not typeof 'number' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'function' + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'number' */ - Check.typeOf.function = function (test, name) { - if (typeof test !== 'function') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); + Check.typeOf.number = function (name, test) { + if (typeof test !== 'number') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); } }; /** - * Throws if test is not typeof 'string' + * Throws if test is not typeof 'number' and less than limit * + * @param {String} name The name of the variable being tested * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than limit + */ + Check.typeOf.number.lessThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test >= limit) { + throw new DeveloperError('Expected ' + name + ' to be less than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and less than or equal to limit + * * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'string' + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than or equal to limit */ - Check.typeOf.string = function (test, name) { - if (typeof test !== 'string') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); + Check.typeOf.number.lessThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test > limit) { + throw new DeveloperError('Expected ' + name + ' to be less than or equal to ' + limit + ', actual value was ' + test); } }; /** - * Throws if test is not typeof 'number' + * Throws if test is not typeof 'number' and greater than limit * + * @param {String} name The name of the variable being tested * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than limit + */ + Check.typeOf.number.greaterThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test <= limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and greater than or equal to limit + * * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'number' + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than or equal to limit */ - Check.typeOf.number = function (test, name) { - if (typeof test !== 'number') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); + Check.typeOf.number.greaterThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test < limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than or equal to' + limit + ', actual value was ' + test); } }; /** * Throws if test is not typeof 'object' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested + * @param {*} test The value to test * @exception {DeveloperError} test must be typeof 'object' */ - Check.typeOf.object = function (test, name) { + Check.typeOf.object = function (name, test) { if (typeof test !== 'object') { throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'object', name)); } @@ -350,11 +283,11 @@ define('Core/Check',[ /** * Throws if test is not typeof 'boolean' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested + * @param {*} test The value to test * @exception {DeveloperError} test must be typeof 'boolean' */ - Check.typeOf.boolean = function (test, name) { + Check.typeOf.bool = function (name, test) { if (typeof test !== 'boolean') { throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'boolean', name)); } @@ -363,6 +296,68 @@ define('Core/Check',[ return Check; }); +/*global define*/ +define('Core/freezeObject',[ + './defined' + ], function( + defined) { + 'use strict'; + + /** + * Freezes an object, using Object.freeze if available, otherwise returns + * the object unchanged. This function should be used in setup code to prevent + * errors from completely halting JavaScript execution in legacy browsers. + * + * @private + * + * @exports freezeObject + */ + var freezeObject = Object.freeze; + if (!defined(freezeObject)) { + freezeObject = function(o) { + return o; + }; + } + + return freezeObject; +}); + +/*global define*/ +define('Core/defaultValue',[ + './freezeObject' + ], function( + freezeObject) { + 'use strict'; + + /** + * Returns the first parameter if not undefined, otherwise the second parameter. + * Useful for setting a default value for a parameter. + * + * @exports defaultValue + * + * @param {*} a + * @param {*} b + * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter. + * + * @example + * param = Cesium.defaultValue(param, 'default'); + */ + function defaultValue(a, b) { + if (a !== undefined) { + return a; + } + return b; + } + + /** + * A frozen empty object that can be used as the default value for options passed as + * an object literal. + */ + defaultValue.EMPTY_OBJECT = freezeObject({}); + + return defaultValue; +}); + /* I've wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace so it's better encapsulated. Now you can have multiple random number generators @@ -1047,7 +1042,7 @@ define('Core/Math',[ if (!defined(angle)) { throw new DeveloperError('angle is required.'); } - + return CesiumMath.clamp(angle, -1*CesiumMath.PI_OVER_TWO, CesiumMath.PI_OVER_TWO); }; @@ -1057,11 +1052,11 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [<code>-CesiumMath.PI</code>, <code>CesiumMath.PI</code>]. */ - CesiumMath.negativePiToPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.negativePiToPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - return CesiumMath.zeroToTwoPi(x + CesiumMath.PI) - CesiumMath.PI; + return CesiumMath.zeroToTwoPi(angle + CesiumMath.PI) - CesiumMath.PI; }; /** @@ -1070,12 +1065,12 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [0, <code>CesiumMath.TWO_PI</code>]. */ - CesiumMath.zeroToTwoPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.zeroToTwoPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - var mod = CesiumMath.mod(x, CesiumMath.TWO_PI); - if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(x) > CesiumMath.EPSILON14) { + var mod = CesiumMath.mod(angle, CesiumMath.TWO_PI); + if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(angle) > CesiumMath.EPSILON14) { return CesiumMath.TWO_PI; } return mod; @@ -1145,7 +1140,7 @@ define('Core/Math',[ * @example * //Compute 7!, which is equal to 5040 * var computedFactorial = Cesium.Math.factorial(7); - * + * * @see {@link http://en.wikipedia.org/wiki/Factorial|Factorial on Wikipedia} */ CesiumMath.factorial = function(n) { @@ -1429,7 +1424,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.fromSpherical = function(spherical, result) { - Check.typeOf.object(spherical, 'spherical'); + Check.typeOf.object('spherical', spherical); if (!defined(result)) { result = new Cartesian3(); @@ -1513,8 +1508,8 @@ define('Core/Cartesian3',[ * @returns {Number[]} The array that was packed into */ Cartesian3.pack = function(value, array, startingIndex) { - Check.typeOf.object(value, 'value'); - Check.defined(array, 'array'); + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1534,7 +1529,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.unpack = function(array, startingIndex, result) { - Check.defined(array, 'array'); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1555,7 +1550,7 @@ define('Core/Cartesian3',[ * @returns {Number[]} The packed array. */ Cartesian3.packArray = function(array, result) { - Check.defined(array, 'array'); + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -1578,8 +1573,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3[]} The unpacked array. */ Cartesian3.unpackArray = function(array, result) { - Check.defined(array, 'array'); - Check.numeric.minimum(array.length, 3); + Check.defined('array', array); + Check.typeOf.number.greaterThanOrEquals('array.length', array.length, 3); if (array.length % 3 !== 0) { throw new DeveloperError('array length must be a multiple of 3.'); } @@ -1625,7 +1620,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the maximum component. */ Cartesian3.maximumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z); }; @@ -1637,7 +1632,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the minimum component. */ Cartesian3.minimumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z); }; @@ -1651,9 +1646,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the minimum components. */ Cartesian3.minimumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -1671,9 +1666,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the maximum components. */ Cartesian3.maximumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -1688,7 +1683,7 @@ define('Core/Cartesian3',[ * @returns {Number} The squared magnitude. */ Cartesian3.magnitudeSquared = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z; }; @@ -1717,8 +1712,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distance(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(2.0, 0.0, 0.0)); */ Cartesian3.distance = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitude(distanceScratch); @@ -1737,8 +1732,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distanceSquared(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(3.0, 0.0, 0.0)); */ Cartesian3.distanceSquared = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitudeSquared(distanceScratch); @@ -1752,8 +1747,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.normalize = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian3.magnitude(cartesian); @@ -1776,8 +1771,8 @@ define('Core/Cartesian3',[ * @returns {Number} The dot product. */ Cartesian3.dot = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z; }; @@ -1791,9 +1786,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyComponents = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -1835,9 +1830,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.add = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -1854,9 +1849,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.subtract = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -1873,9 +1868,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -1892,9 +1887,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.divideByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -1910,8 +1905,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.negate = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -1927,8 +1922,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.abs = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -1947,10 +1942,10 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.lerp = function(start, end, t, result) { - Check.typeOf.object(start, 'start'); - Check.typeOf.object(end, 'end'); - Check.typeOf.number(t, 't'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian3.multiplyByScalar(end, t, lerpScratch); result = Cartesian3.multiplyByScalar(start, 1.0 - t, result); @@ -1967,8 +1962,8 @@ define('Core/Cartesian3',[ * @returns {Number} The angle between the Cartesians. */ Cartesian3.angleBetween = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.normalize(left, angleBetweenScratch); Cartesian3.normalize(right, angleBetweenScratch2); @@ -1986,8 +1981,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The most orthogonal axis. */ Cartesian3.mostOrthogonalAxis = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian3.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian3.abs(f, f); @@ -2064,9 +2059,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The cross product. */ Cartesian3.cross = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var leftX = left.x; var leftY = left.y; @@ -2099,8 +2094,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromDegrees(-115.0, 37.0); */ Cartesian3.fromDegrees = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); longitude = CesiumMath.toRadians(longitude); latitude = CesiumMath.toRadians(latitude); @@ -2125,8 +2120,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromRadians(-2.007, 0.645); */ Cartesian3.fromRadians = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); height = defaultValue(height, 0.0); var radiiSquared = defined(ellipsoid) ? ellipsoid.radiiSquared : wgs84RadiiSquared; @@ -2160,7 +2155,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArray([-115.0, 37.0, -107.0, 33.0]); */ Cartesian3.fromDegreesArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -2194,7 +2189,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArray([-2.007, 0.645, -1.867, .575]); */ Cartesian3.fromRadiansArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -2228,7 +2223,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArrayHeights([-115.0, 37.0, 100000.0, -107.0, 33.0, 150000.0]); */ Cartesian3.fromDegreesArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -2263,7 +2258,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArrayHeights([-2.007, 0.645, 100000.0, -1.867, .575, 150000.0]); */ Cartesian3.fromRadiansArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -3010,7 +3005,9 @@ define('Core/Ellipsoid',[ /** * Computes an Ellipsoid from a Cartesian specifying the radii in x, y, and z directions. * - * @param {Cartesian3} [radii=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Cartesian3} [cartesian=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new + * instance should be created. * @returns {Ellipsoid} A new Ellipsoid instance. * * @exception {DeveloperError} All radii components must be greater than or equal to zero. @@ -3554,12 +3551,14 @@ define('Core/arrayRemoveDuplicates',[ /*global define*/ define('Core/Cartesian2',[ + './Check', './defaultValue', './defined', './DeveloperError', './freezeObject', './Math' ], function( + Check, defaultValue, defined, DeveloperError, @@ -3671,12 +3670,8 @@ define('Core/Cartesian2',[ * @returns {Number[]} The array that was packed into */ Cartesian2.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3695,9 +3690,7 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided. */ Cartesian2.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3717,9 +3710,7 @@ define('Core/Cartesian2',[ * @returns {Number[]} The packed array. */ Cartesian2.packArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -3742,9 +3733,7 @@ define('Core/Cartesian2',[ * @returns {Cartesian2[]} The unpacked array. */ Cartesian2.unpackArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -3787,9 +3776,7 @@ define('Core/Cartesian2',[ * @returns {Number} The value of the maximum component. */ Cartesian2.maximumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y); }; @@ -3801,9 +3788,7 @@ define('Core/Cartesian2',[ * @returns {Number} The value of the minimum component. */ Cartesian2.minimumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y); }; @@ -3817,15 +3802,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} A cartesian with the minimum components. */ Cartesian2.minimumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); @@ -3843,15 +3822,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} A cartesian with the maximum components. */ Cartesian2.maximumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -3865,9 +3838,7 @@ define('Core/Cartesian2',[ * @returns {Number} The squared magnitude. */ Cartesian2.magnitudeSquared = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y; }; @@ -3933,12 +3904,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.normalize = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian2.magnitude(cartesian); @@ -3960,12 +3927,8 @@ define('Core/Cartesian2',[ * @returns {Number} The dot product. */ Cartesian2.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y; }; @@ -3979,15 +3942,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.multiplyComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -4003,15 +3960,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.divideComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x / right.x; result.y = left.y / right.y; @@ -4027,15 +3978,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -4051,15 +3996,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -4075,15 +4014,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.multiplyByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -4099,15 +4032,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.divideByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -4122,12 +4049,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.negate = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -4142,12 +4065,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.abs = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -4165,18 +4084,10 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian2.multiplyByScalar(end, t, lerpScratch); result = Cartesian2.multiplyByScalar(start, 1.0 - t, result); @@ -4193,12 +4104,8 @@ define('Core/Cartesian2',[ * @returns {Number} The angle between the Cartesians. */ Cartesian2.angleBetween = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian2.normalize(left, angleBetweenScratch); Cartesian2.normalize(right, angleBetweenScratch2); @@ -4214,12 +4121,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The most orthogonal axis. */ Cartesian2.mostOrthogonalAxis = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian2.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian2.abs(f, f); @@ -4512,6 +4415,7 @@ define('Core/Intersect',[ /*global define*/ define('Core/Rectangle',[ './Cartographic', + './Check', './defaultValue', './defined', './defineProperties', @@ -4521,6 +4425,7 @@ define('Core/Rectangle',[ './Math' ], function( Cartographic, + Check, defaultValue, defined, defineProperties, @@ -4617,13 +4522,8 @@ define('Core/Rectangle',[ * @returns {Number[]} The array that was packed into */ Rectangle.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -4644,9 +4544,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -4667,9 +4565,7 @@ define('Core/Rectangle',[ * @returns {Number} The width. */ Rectangle.computeWidth = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; if (east < west) { @@ -4684,9 +4580,7 @@ define('Core/Rectangle',[ * @returns {Number} The height. */ Rectangle.computeHeight = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); return rectangle.north - rectangle.south; }; @@ -4721,6 +4615,32 @@ define('Core/Rectangle',[ return result; }; + /** + * Creates an rectangle given the boundary longitude and latitude in radians. + * + * @param {Number} [west=0.0] The westernmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [south=0.0] The southernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Number} [east=0.0] The easternmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [north=0.0] The northernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Rectangle} [result] The object onto which to store the result, or undefined if a new instance should be created. + * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. + * + * @example + * var rectangle = Cesium.Rectangle.fromRadians(0.0, Math.PI/4, Math.PI/8, 3*Math.PI/4); + */ + Rectangle.fromRadians = function(west, south, east, north, result) { + if (!defined(result)) { + return new Rectangle(west, south, east, north); + } + + result.west = defaultValue(west, 0.0); + result.south = defaultValue(south, 0.0); + result.east = defaultValue(east, 0.0); + result.north = defaultValue(north, 0.0); + + return result; + }; + /** * Creates the smallest possible Rectangle that encloses all positions in the provided array. * @@ -4729,9 +4649,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartographicArray = function(cartographics, result) { - if (!defined(cartographics)) { - throw new DeveloperError('cartographics is required.'); - } + Check.defined('cartographics', cartographics); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -4784,9 +4702,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartesianArray = function(cartesians, ellipsoid, result) { - if (!defined(cartesians)) { - throw new DeveloperError('cartesians is required.'); - } + Check.defined('cartesians', cartesians); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -4902,9 +4818,7 @@ define('Core/Rectangle',[ * @returns {Boolean} <code>true</code> if the Rectangles are within the provided epsilon, <code>false</code> otherwise. */ Rectangle.prototype.equalsEpsilon = function(other, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon is required and must be a number.'); - } + Check.typeOf.number('epsilon', epsilon); return defined(other) && (Math.abs(this.west - other.west) <= epsilon) && @@ -4924,45 +4838,23 @@ define('Core/Rectangle',[ * @exception {DeveloperError} <code>west</code> must be in the interval [<code>-Pi</code>, <code>Pi</code>]. */ Rectangle.validate = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var north = rectangle.north; - if (typeof north !== 'number') { - throw new DeveloperError('north is required to be a number.'); - } - - if (north < -CesiumMath.PI_OVER_TWO || north > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('north must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('north', north, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('north', north, CesiumMath.PI_OVER_TWO); var south = rectangle.south; - if (typeof south !== 'number') { - throw new DeveloperError('south is required to be a number.'); - } - - if (south < -CesiumMath.PI_OVER_TWO || south > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('south must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('south', south, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('south', south, CesiumMath.PI_OVER_TWO); var west = rectangle.west; - if (typeof west !== 'number') { - throw new DeveloperError('west is required to be a number.'); - } - - if (west < -Math.PI || west > Math.PI) { - throw new DeveloperError('west must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('west', west, -Math.PI); + Check.typeOf.number.lessThanOrEquals('west', west, Math.PI); var east = rectangle.east; - if (typeof east !== 'number') { - throw new DeveloperError('east is required to be a number.'); - } - - if (east < -Math.PI || east > Math.PI) { - throw new DeveloperError('east must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('east', east, -Math.PI); + Check.typeOf.number.lessThanOrEquals('east', east, Math.PI); }; /** @@ -4973,9 +4865,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.south); @@ -4994,9 +4884,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.north); @@ -5015,9 +4903,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.north); @@ -5036,9 +4922,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.south); @@ -5057,9 +4941,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.center = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; @@ -5094,12 +4976,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.intersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var rectangleEast = rectangle.east; var rectangleWest = rectangle.west; @@ -5155,12 +5033,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.simpleIntersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var west = Math.max(rectangle.west, otherRectangle.west); var south = Math.max(rectangle.south, otherRectangle.south); @@ -5191,12 +5065,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.union = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); if (!defined(result)) { result = new Rectangle(); @@ -5240,12 +5110,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.expand = function(rectangle, cartographic, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); if (!defined(result)) { result = new Rectangle(); @@ -5267,12 +5133,8 @@ define('Core/Rectangle',[ * @returns {Boolean} true if the provided cartographic is inside the rectangle, false otherwise. */ Rectangle.contains = function(rectangle, cartographic) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); var longitude = cartographic.longitude; var latitude = cartographic.latitude; @@ -5305,9 +5167,7 @@ define('Core/Rectangle',[ * @returns {Cartesian3[]} The modified result parameter or a new Array of Cartesians instances if none was provided. */ Rectangle.subsample = function(rectangle, ellipsoid, surfaceHeight, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84); surfaceHeight = defaultValue(surfaceHeight, 0.0); @@ -5385,18 +5245,18 @@ define('Core/Rectangle',[ define('Core/BoundingRectangle',[ './Cartesian2', './Cartographic', + './Check', './defaultValue', './defined', - './DeveloperError', './GeographicProjection', './Intersect', './Rectangle' ], function( Cartesian2, Cartographic, + Check, defaultValue, defined, - DeveloperError, GeographicProjection, Intersect, Rectangle) { @@ -5461,12 +5321,8 @@ define('Core/BoundingRectangle',[ * @returns {Number[]} The array that was packed into */ BoundingRectangle.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5487,9 +5343,7 @@ define('Core/BoundingRectangle',[ * @returns {BoundingRectangle} The modified result parameter or a new BoundingRectangle instance if one was not provided. */ BoundingRectangle.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5620,12 +5474,8 @@ define('Core/BoundingRectangle',[ * @returns {BoundingRectangle} The modified result parameter or a new BoundingRectangle instance if one was not provided. */ BoundingRectangle.union = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); if (!defined(result)) { result = new BoundingRectangle(); @@ -5652,12 +5502,8 @@ define('Core/BoundingRectangle',[ * @returns {BoundingRectangle} The modified result parameter or a new BoundingRectangle instance if one was not provided. */ BoundingRectangle.expand = function(rectangle, point, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } - if (!defined(point)) { - throw new DeveloperError('point is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('point', point); result = BoundingRectangle.clone(rectangle, result); @@ -5689,12 +5535,8 @@ define('Core/BoundingRectangle',[ * @returns {Intersect} <code>Intersect.INTESECTING</code> if the rectangles intersect, <code>Intersect.OUTSIDE</code> otherwise. */ BoundingRectangle.intersect = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); var leftX = left.x; var leftY = left.y; @@ -5798,6 +5640,7 @@ define('Core/Interval',[ /*global define*/ define('Core/Matrix3',[ './Cartesian3', + './Check', './defaultValue', './defined', './defineProperties', @@ -5806,6 +5649,7 @@ define('Core/Matrix3',[ './Math' ], function( Cartesian3, + Check, defaultValue, defined, defineProperties, @@ -5868,13 +5712,8 @@ define('Core/Matrix3',[ * @returns {Number[]} The array that was packed into */ Matrix3.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5900,9 +5739,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. */ Matrix3.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5929,24 +5766,24 @@ define('Core/Matrix3',[ * @param {Matrix3} [result] The object onto which to store the result. * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. (Returns undefined if matrix is undefined) */ - Matrix3.clone = function(values, result) { - if (!defined(values)) { + Matrix3.clone = function(matrix, result) { + if (!defined(matrix)) { return undefined; } if (!defined(result)) { - return new Matrix3(values[0], values[3], values[6], - values[1], values[4], values[7], - values[2], values[5], values[8]); + return new Matrix3(matrix[0], matrix[3], matrix[6], + matrix[1], matrix[4], matrix[7], + matrix[2], matrix[5], matrix[8]); } - result[0] = values[0]; - result[1] = values[1]; - result[2] = values[2]; - result[3] = values[3]; - result[4] = values[4]; - result[5] = values[5]; - result[6] = values[6]; - result[7] = values[7]; - result[8] = values[8]; + result[0] = matrix[0]; + result[1] = matrix[1]; + result[2] = matrix[2]; + result[3] = matrix[3]; + result[4] = matrix[4]; + result[5] = matrix[5]; + result[6] = matrix[6]; + result[7] = matrix[7]; + result[8] = matrix[8]; return result; }; @@ -5972,9 +5809,7 @@ define('Core/Matrix3',[ * var m2 = Cesium.Matrix3.fromArray(v2, 2); */ Matrix3.fromArray = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -6002,9 +5837,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values parameter is required'); - } + Check.defined('values', values); return Matrix3.clone(values, result); }; @@ -6018,9 +5851,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix3(values[0], values[1], values[2], @@ -6047,9 +5878,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this quaternion. */ Matrix3.fromQuaternion = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); var x2 = quaternion.x * quaternion.x; var xy = quaternion.x * quaternion.y; @@ -6099,10 +5928,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this headingPitchRoll. */ Matrix3.fromHeadingPitchRoll = function(headingPitchRoll, result) { - if (!defined(headingPitchRoll)) { - throw new DeveloperError('headingPitchRoll is required'); - } - var cosTheta = Math.cos(-headingPitchRoll.pitch); + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + + var cosTheta = Math.cos(-headingPitchRoll.pitch); var cosPsi = Math.cos(-headingPitchRoll.heading); var cosPhi = Math.cos(headingPitchRoll.roll); var sinTheta = Math.sin(-headingPitchRoll.pitch); @@ -6153,9 +5981,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix3( @@ -6191,9 +6017,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromUniformScale(2.0); */ Matrix3.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix3( @@ -6217,7 +6041,7 @@ define('Core/Matrix3',[ /** * Computes a Matrix3 instance representing the cross product equivalent matrix of a Cartesian3 vector. * - * @param {Cartesian3} the vector on the left hand side of the cross product operation. + * @param {Cartesian3} vector the vector on the left hand side of the cross product operation. * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created. * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. * @@ -6229,9 +6053,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromCrossProduct(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromCrossProduct = function(vector, result) { - if (!defined(vector)) { - throw new DeveloperError('vector is required.'); - } + Check.typeOf.object('vector', vector); if (!defined(result)) { return new Matrix3( @@ -6266,9 +6088,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationX = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -6307,9 +6127,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationY = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -6348,9 +6166,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationZ = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -6384,9 +6200,7 @@ define('Core/Matrix3',[ * @returns {Number[]} The modified Array parameter or a new Array instance if one was not provided. */ Matrix3.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5], matrix[6], matrix[7], matrix[8]]; @@ -6420,12 +6234,10 @@ define('Core/Matrix3',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix3.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 2) { - throw new DeveloperError('row must be 0, 1, or 2.'); - } - if (typeof column !== 'number' || column < 0 || column > 2) { - throw new DeveloperError('column must be 0, 1, or 2.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 2); + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 2); return column * 3 + row; }; @@ -6441,16 +6253,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var startIndex = index * 3; var x = matrix[startIndex]; @@ -6475,18 +6281,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); var startIndex = index * 3; @@ -6507,15 +6306,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 3]; @@ -6539,18 +6333,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); result[index] = cartesian.x; @@ -6569,12 +6356,8 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[3], matrix[4], matrix[5], scratchColumn)); @@ -6605,15 +6388,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var column0Row0 = left[0] * right[0] + left[3] * right[1] + left[6] * right[2]; var column0Row1 = left[1] * right[0] + left[4] * right[1] + left[7] * right[2]; @@ -6648,15 +6425,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -6679,15 +6450,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -6710,15 +6475,9 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -6743,15 +6502,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -6782,15 +6535,9 @@ define('Core/Matrix3',[ * @see Matrix3.multiplyByUniformScale */ Matrix3.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); result[0] = matrix[0] * scale.x; result[1] = matrix[1] * scale.x; @@ -6812,12 +6559,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -6839,12 +6582,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var column0Row0 = matrix[0]; var column0Row1 = matrix[3]; @@ -6984,9 +6723,7 @@ define('Core/Matrix3',[ * var c = Cesium.Cartesian3.multiplyByScalar(v, lambda, new Cesium.Cartesian3()); // equal to Cesium.Matrix3.multiplyByVector(a, v) */ Matrix3.computeEigenDecomposition = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); // This routine was created based upon Matrix Computations, 3rd ed., by Golub and Van Loan, // section 8.4.3 The Classical Jacobi Algorithm @@ -7030,12 +6767,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -7057,9 +6790,7 @@ define('Core/Matrix3',[ * @returns {Number} The value of the determinant of the matrix. */ Matrix3.determinant = function(matrix) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); var m11 = matrix[0]; var m21 = matrix[3]; @@ -7084,12 +6815,8 @@ define('Core/Matrix3',[ * @exception {DeveloperError} matrix is not invertible. */ Matrix3.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var m11 = matrix[0]; var m21 = matrix[1]; @@ -7155,9 +6882,7 @@ define('Core/Matrix3',[ * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. */ Matrix3.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -7345,12 +7070,14 @@ define('Core/Matrix3',[ /*global define*/ define('Core/Cartesian4',[ + './Check', './defaultValue', './defined', './DeveloperError', './freezeObject', './Math' ], function( + Check, defaultValue, defined, DeveloperError, @@ -7433,9 +7160,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.fromColor = function(color, result) { - if (!defined(color)) { - throw new DeveloperError('color is required'); - } + Check.typeOf.object('color', color); if (!defined(result)) { return new Cartesian4(color.red, color.green, color.blue, color.alpha); } @@ -7487,12 +7212,8 @@ define('Core/Cartesian4',[ * @returns {Number[]} The array that was packed into */ Cartesian4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -7513,9 +7234,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -7537,9 +7256,7 @@ define('Core/Cartesian4',[ * @returns {Number[]} The packed array. */ Cartesian4.packArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -7562,9 +7279,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4[]} The unpacked array. */ Cartesian4.unpackArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -7607,9 +7322,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the maximum component. */ Cartesian4.maximumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -7621,9 +7334,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the minimum component. */ Cartesian4.minimumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -7637,15 +7348,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the minimum components. */ Cartesian4.minimumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -7664,15 +7369,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the maximum components. */ Cartesian4.maximumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -7689,9 +7388,7 @@ define('Core/Cartesian4',[ * @returns {Number} The squared magnitude. */ Cartesian4.magnitudeSquared = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z + cartesian.w * cartesian.w; }; @@ -7722,9 +7419,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(2.0, 0.0, 0.0, 0.0)); */ Cartesian4.distance = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitude(distanceScratch); @@ -7745,9 +7441,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(3.0, 0.0, 0.0, 0.0)); */ Cartesian4.distanceSquared = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitudeSquared(distanceScratch); @@ -7761,12 +7456,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.normalize = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian4.magnitude(cartesian); @@ -7790,12 +7481,8 @@ define('Core/Cartesian4',[ * @returns {Number} The dot product. */ Cartesian4.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w; }; @@ -7809,15 +7496,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -7835,15 +7516,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x / right.x; result.y = left.y / right.y; @@ -7861,15 +7536,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -7887,15 +7556,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -7913,15 +7576,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -7939,15 +7596,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -7964,12 +7615,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.negate = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -7986,12 +7633,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.abs = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -8011,18 +7654,10 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian4.multiplyByScalar(end, t, lerpScratch); result = Cartesian4.multiplyByScalar(start, 1.0 - t, result); @@ -8038,12 +7673,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The most orthogonal axis. */ Cartesian4.mostOrthogonalAxis = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian4.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian4.abs(f, f); @@ -8288,6 +7919,7 @@ define('Core/RuntimeError',[ define('Core/Matrix4',[ './Cartesian3', './Cartesian4', + './Check', './defaultValue', './defined', './defineProperties', @@ -8299,6 +7931,7 @@ define('Core/Matrix4',[ ], function( Cartesian3, Cartesian4, + Check, defaultValue, defined, defineProperties, @@ -8389,13 +8022,8 @@ define('Core/Matrix4',[ * @returns {Number[]} The array that was packed into */ Matrix4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -8428,9 +8056,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if one was not provided. */ Matrix4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -8526,9 +8152,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required'); - } + Check.defined('values', values); return Matrix4.clone(values, result); }; @@ -8542,9 +8166,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix4(values[0], values[1], values[2], values[3], @@ -8581,9 +8203,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRotationTranslation = function(rotation, translation, result) { - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } + Check.typeOf.object('rotation', rotation); translation = defaultValue(translation, Cartesian3.ZERO); @@ -8631,15 +8251,9 @@ define('Core/Matrix4',[ * result); */ Matrix4.fromTranslationQuaternionRotationScale = function(translation, rotation, scale, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('translation', translation); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('scale', scale); if (!defined(result)) { result = new Matrix4(); @@ -8700,9 +8314,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromTranslationRotationScale = function(translationRotationScale, result) { - if (!defined(translationRotationScale)) { - throw new DeveloperError('translationRotationScale is required.'); - } + Check.typeOf.object('translationRotationScale', translationRotationScale); return Matrix4.fromTranslationQuaternionRotationScale(translationRotationScale.translation, translationRotationScale.rotation, translationRotationScale.scale, result); }; @@ -8717,9 +8329,7 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByTranslation */ Matrix4.fromTranslation = function(translation, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } + Check.typeOf.object('translation', translation); return Matrix4.fromRotationTranslation(Matrix3.IDENTITY, translation, result); }; @@ -8740,9 +8350,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix4.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix4( @@ -8787,9 +8395,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromUniformScale(2.0); */ Matrix4.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix4(scale, 0.0, 0.0, 0.0, @@ -8829,23 +8435,15 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromCamera = function(camera, result) { - if (!defined(camera)) { - throw new DeveloperError('camera is required.'); - } + Check.typeOf.object('camera', camera); var position = camera.position; var direction = camera.direction; var up = camera.up; - if (!defined(position)) { - throw new DeveloperError('camera.position is required.'); - } - if (!defined(direction)) { - throw new DeveloperError('camera.direction is required.'); - } - if (!defined(up)) { - throw new DeveloperError('camera.up is required.'); - } + Check.typeOf.object('camera.position', position); + Check.typeOf.object('camera.direction', direction); + Check.typeOf.object('camera.up', up); Cartesian3.normalize(direction, fromCameraF); Cartesian3.normalize(Cartesian3.cross(fromCameraF, up, fromCameraR), fromCameraR); @@ -8924,21 +8522,11 @@ define('Core/Matrix4',[ * @exception {DeveloperError} far must be greater than zero. */ Matrix4.computePerspectiveFieldOfView = function(fovY, aspectRatio, near, far, result) { - if (fovY <= 0.0 || fovY > Math.PI) { - throw new DeveloperError('fovY must be in (0, PI].'); - } - if (aspectRatio <= 0.0) { - throw new DeveloperError('aspectRatio must be greater than zero.'); - } - if (near <= 0.0) { - throw new DeveloperError('near must be greater than zero.'); - } - if (far <= 0.0) { - throw new DeveloperError('far must be greater than zero.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThan('fovY', fovY, 0.0); + Check.typeOf.number.lessThan('fovY', fovY, Math.PI); + Check.typeOf.number.greaterThan('near', near, 0.0); + Check.typeOf.number.greaterThan('far', far, 0.0); + Check.typeOf.object('result', result); var bottom = Math.tan(fovY * 0.5); @@ -8979,27 +8567,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeOrthographicOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var a = 1.0 / (right - left); var b = 1.0 / (top - bottom); @@ -9044,27 +8618,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computePerspectiveOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -9105,24 +8665,12 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeInfinitePerspectiveOffCenter = function(left, right, bottom, top, near, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -9170,9 +8718,7 @@ define('Core/Matrix4',[ * }, 0.0, 1.0, new Cesium.Matrix4()); */ Matrix4.computeViewportTransformation = function(viewport, nearDepthRange, farDepthRange, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); viewport = defaultValue(viewport, defaultValue.EMPTY_OBJECT); var x = defaultValue(viewport.x, 0.0); @@ -9224,21 +8770,11 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeView = function(position, direction, up, right, result) { - if (!defined(position)) { - throw new DeveloperError('position is required'); - } - if (!defined(direction)) { - throw new DeveloperError('direction is required'); - } - if (!defined(up)) { - throw new DeveloperError('up is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); + Check.typeOf.object('up', up); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = right.x; result[1] = up.x; @@ -9279,9 +8815,7 @@ define('Core/Matrix4',[ * //creates a = [10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0] */ Matrix4.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], @@ -9325,12 +8859,11 @@ define('Core/Matrix4',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix4.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 3) { - throw new DeveloperError('row must be 0, 1, 2, or 3.'); - } - if (typeof column !== 'number' || column < 0 || column > 3) { - throw new DeveloperError('column must be 0, 1, 2, or 3.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 3); + + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 3); return column * 4 + row; }; @@ -9363,16 +8896,12 @@ define('Core/Matrix4',[ * // a.x = 12.0; a.y = 16.0; a.z = 20.0; a.w = 24.0; */ Matrix4.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var startIndex = index * 4; var x = matrix[startIndex]; @@ -9414,18 +8943,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 96.0, 25.0] */ Matrix4.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); var startIndex = index * 4; @@ -9444,17 +8968,11 @@ define('Core/Matrix4',[ * @param {Cartesian3} translation The translation that replaces the translation of the provided matrix. * @param {Cartesian4} result The object onto which to store the result. * @returns {Matrix4} The modified result parameter. - */ - Matrix4.setTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + */ + Matrix4.setTranslation = function(matrix, translation, result) { + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -9507,16 +9025,12 @@ define('Core/Matrix4',[ * // a.x = 18.0; a.y = 19.0; a.z = 20.0; a.w = 21.0; */ Matrix4.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 4]; @@ -9557,18 +9071,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 24.0, 25.0] */ Matrix4.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); result[index] = cartesian.x; @@ -9588,12 +9097,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter */ Matrix4.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[4], matrix[5], matrix[6], scratchColumn)); @@ -9625,15 +9130,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -9717,15 +9216,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -9755,15 +9248,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -9804,15 +9291,9 @@ define('Core/Matrix4',[ * var m3 = Cesium.Matrix4.multiplyTransformation(m1, m2, new Cesium.Matrix4()); */ Matrix4.multiplyTransformation = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -9890,15 +9371,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByMatrix3(m, rotation, m); */ Matrix4.multiplyByMatrix3 = function(matrix, rotation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('result', result); var left0 = matrix[0]; var left1 = matrix[1]; @@ -9966,15 +9441,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByTranslation(m, position, m); */ Matrix4.multiplyByTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); var x = translation.x; var y = translation.y; @@ -10026,15 +9495,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByScale */ Matrix4.multiplyByUniformScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scale', scale); + Check.typeOf.object('result', result); uniformScaleScratch.x = scale; uniformScaleScratch.y = scale; @@ -10063,15 +9526,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByUniformScale */ Matrix4.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); var scaleX = scale.x; var scaleY = scale.y; @@ -10110,15 +9567,9 @@ define('Core/Matrix4',[ * @returns {Cartesian4} The modified result parameter. */ Matrix4.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -10154,15 +9605,9 @@ define('Core/Matrix4',[ * // Cesium.Matrix4.multiplyByVector(matrix, new Cesium.Cartesian4(p.x, p.y, p.z, 0.0), result); */ Matrix4.multiplyByPointAsVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -10192,16 +9637,9 @@ define('Core/Matrix4',[ * var result = Cesium.Matrix4.multiplyByPoint(matrix, p, new Cesium.Cartesian3()); */ Matrix4.multiplyByPoint = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -10241,15 +9679,9 @@ define('Core/Matrix4',[ * // [-44.0, -46.0, -48.0, -50.0] */ Matrix4.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -10293,12 +9725,8 @@ define('Core/Matrix4',[ * // [-22.0, -23.0, -24.0, -25.0] */ Matrix4.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -10342,12 +9770,8 @@ define('Core/Matrix4',[ * // [13.0, 17.0, 21.0, 25.0] */ Matrix4.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var matrix1 = matrix[1]; var matrix2 = matrix[2]; @@ -10383,12 +9807,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -10502,9 +9922,7 @@ define('Core/Matrix4',[ * //Prints "Difference between both the matrices is not less than 0.1" on the console */ Matrix4.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -10535,12 +9953,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter. */ Matrix4.getTranslation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = matrix[12]; result.y = matrix[13]; @@ -10571,12 +9985,8 @@ define('Core/Matrix4',[ * // [12.0, 16.0, 20.0] */ Matrix4.getRotation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -10608,12 +10018,8 @@ define('Core/Matrix4',[ * @exception {RuntimeError} matrix is not invertible because its determinate is zero. */ Matrix4.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); // Special case for a zero scale matrix that can occur, for example, // when a model's node has a [0, 0, 0] scale. @@ -10751,12 +10157,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.inverseTransformation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); //This function is an optimized version of the below 4 lines. //var rT = Matrix3.transpose(Matrix4.getRotation(matrix)); @@ -11041,9 +10443,9 @@ define('Core/Matrix4',[ define('Core/BoundingSphere',[ './Cartesian3', './Cartographic', + './Check', './defaultValue', './defined', - './DeveloperError', './Ellipsoid', './GeographicProjection', './Intersect', @@ -11054,9 +10456,9 @@ define('Core/BoundingSphere',[ ], function( Cartesian3, Cartographic, + Check, defaultValue, defined, - DeveloperError, Ellipsoid, GeographicProjection, Intersect, @@ -11386,9 +10788,7 @@ define('Core/BoundingSphere',[ stride = defaultValue(stride, 3); - if (stride < 3) { - throw new DeveloperError('stride must be 3 or greater.'); - } + Check.typeOf.number.greaterThanOrEquals('stride', stride, 3); var currentPos = fromPointsCurrentPos; currentPos.x = positions[0] + center.x; @@ -11692,9 +11092,8 @@ define('Core/BoundingSphere',[ * var sphere = Cesium.BoundingSphere.fromCornerPoints(new Cesium.Cartesian3(-0.5, -0.5, -0.5), new Cesium.Cartesian3(0.5, 0.5, 0.5)); */ BoundingSphere.fromCornerPoints = function(corner, oppositeCorner, result) { - if (!defined(corner) || !defined(oppositeCorner)) { - throw new DeveloperError('corner and oppositeCorner are required.'); - } + Check.typeOf.object('corner', corner); + Check.typeOf.object('oppositeCorner', oppositeCorner); if (!defined(result)) { result = new BoundingSphere(); @@ -11718,9 +11117,7 @@ define('Core/BoundingSphere',[ * var boundingSphere = Cesium.BoundingSphere.fromEllipsoid(ellipsoid); */ BoundingSphere.fromEllipsoid = function(ellipsoid, result) { - if (!defined(ellipsoid)) { - throw new DeveloperError('ellipsoid is required.'); - } + Check.typeOf.object('ellipsoid', ellipsoid); if (!defined(result)) { result = new BoundingSphere(); @@ -11846,13 +11243,8 @@ define('Core/BoundingSphere',[ * @returns {Number[]} The array that was packed into */ BoundingSphere.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -11874,9 +11266,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if one was not provided. */ BoundingSphere.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -11903,13 +11293,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.union = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); if (!defined(result)) { result = new BoundingSphere(); @@ -11958,13 +11343,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.expand = function(sphere, point, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(point)) { - throw new DeveloperError('point is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('point', point); result = BoundingSphere.clone(sphere, result); @@ -11987,13 +11367,8 @@ define('Core/BoundingSphere',[ * intersects the plane. */ BoundingSphere.intersectPlane = function(sphere, plane) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(plane)) { - throw new DeveloperError('plane is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('plane', plane); var center = sphere.center; var radius = sphere.radius; @@ -12019,13 +11394,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.transform = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -12053,12 +11423,8 @@ define('Core/BoundingSphere',[ * }); */ BoundingSphere.distanceSquaredTo = function(sphere, cartesian) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('cartesian', cartesian); var diff = Cartesian3.subtract(sphere.center, cartesian, distanceSquaredToScratch); return Cartesian3.magnitudeSquared(diff) - sphere.radius * sphere.radius; @@ -12080,13 +11446,8 @@ define('Core/BoundingSphere',[ * var newBoundingSphere = Cesium.BoundingSphere.transformWithoutScale(boundingSphere, modelMatrix); */ BoundingSphere.transformWithoutScale = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -12113,17 +11474,9 @@ define('Core/BoundingSphere',[ * @returns {Interval} The nearest and farthest distances on the bounding sphere from position in direction. */ BoundingSphere.computePlaneDistances = function(sphere, position, direction, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(position)) { - throw new DeveloperError('position is required.'); - } - - if (!defined(direction)) { - throw new DeveloperError('direction is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); if (!defined(result)) { result = new Interval(); @@ -12158,9 +11511,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.projectTo2D = function(sphere, projection, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } + Check.typeOf.object('sphere', sphere); projection = defaultValue(projection, projectTo2DProjection); @@ -12255,12 +11606,8 @@ define('Core/BoundingSphere',[ * @returns {Boolean} <code>true</code> if the sphere is not visible; otherwise <code>false</code>. */ BoundingSphere.isOccluded = function(sphere, occluder) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(occluder)) { - throw new DeveloperError('occluder is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('occluder', occluder); return !occluder.isBoundingSphereVisible(sphere); }; @@ -13469,7 +12816,10 @@ define('Core/WebGLConstants',[ COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : 0x9279, TEXTURE_IMMUTABLE_FORMAT : 0x912F, MAX_ELEMENT_INDEX : 0x8D6B, - TEXTURE_IMMUTABLE_LEVELS : 0x82DF + TEXTURE_IMMUTABLE_LEVELS : 0x82DF, + + // Extensions + MAX_TEXTURE_MAX_ANISOTROPY_EXT : 0x84FF }; return freezeObject(WebGLConstants); @@ -14046,7 +13396,7 @@ define('Core/Geometry',[ * <li><code>position</code> - 3D vertex position. 64-bit floating-point (for precision). 3 components per attribute. See {@link VertexFormat#position}.</li> * <li><code>normal</code> - Normal (normalized), commonly used for lighting. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#normal}.</li> * <li><code>st</code> - 2D texture coordinate. 32-bit floating-point. 2 components per attribute. See {@link VertexFormat#st}.</li> - * <li><code>binormal</code> - Binormal (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#binormal}.</li> + * <li><code>bitangent</code> - Bitangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#bitangent}.</li> * <li><code>tangent</code> - Tangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#tangent}.</li> * </ul> * </p> @@ -14075,7 +13425,7 @@ define('Core/Geometry',[ * componentsPerAttribute : 3, * values : new Float32Array(0) * }); - * + * * @see GeometryAttribute * @see VertexFormat */ @@ -14356,7 +13706,7 @@ define('Core/GeometryAttributes',[ this.st = options.st; /** - * The binormal attribute (normalized), which is used for tangent-space effects like bump mapping. + * The bitangent attribute (normalized), which is used for tangent-space effects like bump mapping. * <p> * 32-bit floating-point. 3 components per attribute. * </p> @@ -14365,7 +13715,7 @@ define('Core/GeometryAttributes',[ * * @default undefined */ - this.binormal = options.binormal; + this.bitangent = options.bitangent; /** * The tangent attribute (normalized), which is used for tangent-space effects like bump mapping. @@ -16533,6 +15883,7 @@ define('Core/IntersectionTests',[ './defaultValue', './defined', './DeveloperError', + './Interval', './Math', './Matrix3', './QuadraticRealPolynomial', @@ -16544,6 +15895,7 @@ define('Core/IntersectionTests',[ defaultValue, defined, DeveloperError, + Interval, CesiumMath, Matrix3, QuadraticRealPolynomial, @@ -16815,7 +16167,7 @@ define('Core/IntersectionTests',[ function raySphere(ray, sphere, result) { if (!defined(result)) { - result = {}; + result = new Interval(); } var origin = ray.origin; @@ -16846,8 +16198,8 @@ define('Core/IntersectionTests',[ * * @param {Ray} ray The ray. * @param {BoundingSphere} sphere The sphere. - * @param {Object} [result] The result onto which to store the result. - * @returns {Object} An object with the first (<code>start</code>) and the second (<code>stop</code>) intersection scalars for points along the ray or undefined if there are no intersections. + * @param {Interval} [result] The result onto which to store the result. + * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections. */ IntersectionTests.raySphere = function(ray, sphere, result) { if (!defined(ray)) { @@ -16875,8 +16227,8 @@ define('Core/IntersectionTests',[ * @param {Cartesian3} p0 An end point of the line segment. * @param {Cartesian3} p1 The other end point of the line segment. * @param {BoundingSphere} sphere The sphere. - * @param {Object} [result] The result onto which to store the result. - * @returns {Object} An object with the first (<code>start</code>) and the second (<code>stop</code>) intersection scalars for points along the line segment or undefined if there are no intersections. + * @param {Interval} [result] The result onto which to store the result. + * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections. */ IntersectionTests.lineSegmentSphere = function(p0, p1, sphere, result) { if (!defined(p0)) { @@ -16914,7 +16266,7 @@ define('Core/IntersectionTests',[ * * @param {Ray} ray The ray. * @param {Ellipsoid} ellipsoid The ellipsoid. - * @returns {Object} An object with the first (<code>start</code>) and the second (<code>stop</code>) intersection scalars for points along the ray or undefined if there are no intersections. + * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections. */ IntersectionTests.rayEllipsoid = function(ray, ellipsoid) { if (!defined(ray)) { @@ -16956,10 +16308,7 @@ define('Core/IntersectionTests',[ var root0 = temp / w2; var root1 = difference / temp; if (root0 < root1) { - return { - start : root0, - stop : root1 - }; + return new Interval(root0, root1); } return { @@ -16969,10 +16318,7 @@ define('Core/IntersectionTests',[ } else { // qw2 == product. Repeated roots (2 intersections). var root = Math.sqrt(difference / w2); - return { - start : root, - stop : root - }; + return new Interval(root, root); } } else if (q2 < 1.0) { // Inside ellipsoid (2 intersections). @@ -16982,19 +16328,13 @@ define('Core/IntersectionTests',[ discriminant = qw * qw - product; temp = -qw + Math.sqrt(discriminant); // Positively valued. - return { - start : 0.0, - stop : temp / w2 - }; + return new Interval(0.0, temp / w2); } else { // q2 == 1.0. On ellipsoid. if (qw < 0.0) { // Looking inward. w2 = Cartesian3.magnitudeSquared(w); - return { - start : 0.0, - stop : -qw / w2 - }; + return new Interval(0.0, -qw / w2); } // qw >= 0.0. Looking outward or tangent. @@ -18326,138 +17666,26 @@ define('ThirdParty/when',[],function () { // Skip holes if(i in arr) { reduced = reduceFunc(reduced, arr[i], i, arr); - } - } - - return reduced; - }; - - function identity(x) { - return x; - } - - return when; -}); -})(typeof define == 'function' && define.amd - ? define - : function (factory) { typeof exports === 'object' - ? (module.exports = factory()) - : (this.when = factory()); - } - // Boilerplate for AMD, Node, and browser global -); - -/*global define*/ -define('Core/oneTimeWarning',[ - './defaultValue', - './defined', - './DeveloperError' - ], function( - defaultValue, - defined, - DeveloperError) { - "use strict"; - - var warnings = {}; - - /** - * Logs a one time message to the console. Use this function instead of - * <code>console.log</code> directly since this does not log duplicate messages - * unless it is called from multiple workers. - * - * @exports oneTimeWarning - * - * @param {String} identifier The unique identifier for this warning. - * @param {String} [message=identifier] The message to log to the console. - * - * @example - * for(var i=0;i<foo.length;++i) { - * if (!defined(foo[i].bar)) { - * // Something that can be recovered from but may happen a lot - * oneTimeWarning('foo.bar undefined', 'foo.bar is undefined. Setting to 0.'); - * foo[i].bar = 0; - * // ... - * } - * } - * - * @private - */ - function oneTimeWarning(identifier, message) { - if (!defined(identifier)) { - throw new DeveloperError('identifier is required.'); - } - - if (!defined(warnings[identifier])) { - warnings[identifier] = true; - console.log(defaultValue(message, identifier)); - } - } - - oneTimeWarning.geometryOutlines = 'Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.'; + } + } - return oneTimeWarning; -}); + return reduced; + }; -/*global define*/ -define('Core/deprecationWarning',[ - './defined', - './DeveloperError', - './oneTimeWarning' - ], function( - defined, - DeveloperError, - oneTimeWarning) { - 'use strict'; - - /** - * Logs a deprecation message to the console. Use this function instead of - * <code>console.log</code> directly since this does not log duplicate messages - * unless it is called from multiple workers. - * - * @exports deprecationWarning - * - * @param {String} identifier The unique identifier for this deprecated API. - * @param {String} message The message to log to the console. - * - * @example - * // Deprecated function or class - * function Foo() { - * deprecationWarning('Foo', 'Foo was deprecated in Cesium 1.01. It will be removed in 1.03. Use newFoo instead.'); - * // ... - * } - * - * // Deprecated function - * Bar.prototype.func = function() { - * deprecationWarning('Bar.func', 'Bar.func() was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newFunc() instead.'); - * // ... - * }; - * - * // Deprecated property - * defineProperties(Bar.prototype, { - * prop : { - * get : function() { - * deprecationWarning('Bar.prop', 'Bar.prop was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newProp instead.'); - * // ... - * }, - * set : function(value) { - * deprecationWarning('Bar.prop', 'Bar.prop was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newProp instead.'); - * // ... - * } - * } - * }); - * - * @private - */ - function deprecationWarning(identifier, message) { - if (!defined(identifier) || !defined(message)) { - throw new DeveloperError('identifier and message are required.'); - } - - oneTimeWarning(identifier, message); - } + function identity(x) { + return x; + } - return deprecationWarning; + return when; }); +})(typeof define == 'function' && define.amd + ? define + : function (factory) { typeof exports === 'object' + ? (module.exports = factory()) + : (this.when = factory()); + } + // Boilerplate for AMD, Node, and browser global +); /*global define*/ define('Core/binarySearch',[ @@ -22168,6 +21396,7 @@ define('Core/Iau2006XysData',[ /*global define*/ define('Core/Quaternion',[ './Cartesian3', + './Check', './defaultValue', './defined', './DeveloperError', @@ -22177,6 +21406,7 @@ define('Core/Quaternion',[ './Matrix3' ], function( Cartesian3, + Check, defaultValue, defined, DeveloperError, @@ -22239,12 +21469,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided. */ Quaternion.fromAxisAngle = function(axis, angle, result) { - if (!defined(axis)) { - throw new DeveloperError('axis is required.'); - } - if (typeof angle !== 'number') { - throw new DeveloperError('angle is required and must be a number.'); - } + Check.typeOf.object('axis', axis); + Check.typeOf.number('angle', angle); var halfAngle = angle / 2.0; var s = Math.sin(halfAngle); @@ -22276,9 +21502,7 @@ define('Core/Quaternion',[ * @see Matrix3.fromQuaternion */ Quaternion.fromRotationMatrix = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); var root; var x; @@ -22352,15 +21576,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter or a new Quaternion instance if none was provided. */ Quaternion.fromHeadingPitchRoll = function(heading, pitch, roll, result) { - if (!defined(heading)) { - throw new DeveloperError('heading is required.'); - } - if (!defined(pitch)) { - throw new DeveloperError('pitch is required.'); - } - if (!defined(roll)) { - throw new DeveloperError('roll is required.'); - } + Check.typeOf.number('heading', heading); + Check.typeOf.number('pitch', pitch); + Check.typeOf.number('roll', roll); var rollQuaternion = Quaternion.fromAxisAngle(Cartesian3.UNIT_X, roll, scratchHPRQuaternion); var pitchQuaternion = Quaternion.fromAxisAngle(Cartesian3.UNIT_Y, -pitch, result); @@ -22391,13 +21609,8 @@ define('Core/Quaternion',[ * @returns {Number[]} The array that was packed into */ Quaternion.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -22418,9 +21631,7 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided. */ Quaternion.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -22475,7 +21686,7 @@ define('Core/Quaternion',[ * * @param {Number[]} array The array previously packed for interpolation. * @param {Number[]} sourceArray The original packed array. - * @param {Number} [startingIndex=0] The startingIndex used to convert the array. + * @param {Number} [firstIndex=0] The firstIndex used to convert the array. * @param {Number} [lastIndex=packedArray.length] The lastIndex used to convert the array. * @param {Quaternion} [result] The object into which to store the result. * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided. @@ -22529,12 +21740,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.conjugate = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); result.x = -quaternion.x; result.y = -quaternion.y; @@ -22550,9 +21757,7 @@ define('Core/Quaternion',[ * @returns {Number} The magnitude squared. */ Quaternion.magnitudeSquared = function(quaternion) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); return quaternion.x * quaternion.x + quaternion.y * quaternion.y + quaternion.z * quaternion.z + quaternion.w * quaternion.w; }; @@ -22575,9 +21780,7 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.normalize = function(quaternion, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); var inverseMagnitude = 1.0 / Quaternion.magnitude(quaternion); var x = quaternion.x * inverseMagnitude; @@ -22600,9 +21803,7 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.inverse = function(quaternion, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); var magnitudeSquared = Quaternion.magnitudeSquared(quaternion); result = Quaternion.conjugate(quaternion, result); @@ -22618,15 +21819,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -22644,15 +21839,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -22669,12 +21858,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.negate = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); result.x = -quaternion.x; result.y = -quaternion.y; @@ -22691,12 +21876,8 @@ define('Core/Quaternion',[ * @returns {Number} The dot product. */ Quaternion.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w; }; @@ -22710,15 +21891,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var leftX = left.x; var leftY = left.y; @@ -22751,15 +21926,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.multiplyByScalar = function(quaternion, scalar, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = quaternion.x * scalar; result.y = quaternion.y * scalar; @@ -22777,15 +21946,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.divideByScalar = function(quaternion, scalar, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = quaternion.x / scalar; result.y = quaternion.y / scalar; @@ -22802,12 +21965,8 @@ define('Core/Quaternion',[ * @returns {Cartesian3} The modified result parameter. */ Quaternion.computeAxis = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); var w = quaternion.w; if (Math.abs(w - 1.0) < CesiumMath.EPSILON6) { @@ -22830,9 +21989,7 @@ define('Core/Quaternion',[ * @returns {Number} The angle of rotation. */ Quaternion.computeAngle = function(quaternion) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); if (Math.abs(quaternion.w - 1.0) < CesiumMath.EPSILON6) { return 0.0; @@ -22851,18 +22008,10 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); lerpScratch = Quaternion.multiplyByScalar(end, t, lerpScratch); result = Quaternion.multiplyByScalar(start, 1.0 - t, result); @@ -22884,18 +22033,10 @@ define('Core/Quaternion',[ * @see Quaternion#fastSlerp */ Quaternion.slerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var dot = Quaternion.dot(start, end); @@ -22928,12 +22069,8 @@ define('Core/Quaternion',[ * @returns {Cartesian3} The modified result parameter. */ Quaternion.log = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); var theta = CesiumMath.acosClamped(quaternion.w); var thetaOverSinTheta = 0.0; @@ -22953,12 +22090,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.exp = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var theta = Cartesian3.magnitude(cartesian); var sinThetaOverTheta = 0.0; @@ -22993,12 +22126,10 @@ define('Core/Quaternion',[ * @see Quaternion#squad */ Quaternion.computeInnerQuadrangle = function(q0, q1, q2, result) { - if (!defined(q0) || !defined(q1) || !defined(q2)) { - throw new DeveloperError('q0, q1, and q2 are required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('q0', q0); + Check.typeOf.object('q1', q1); + Check.typeOf.object('q2', q2); + Check.typeOf.object('result', result); var qInv = Quaternion.conjugate(q1, squadScratchQuaternion0); Quaternion.multiply(qInv, q2, squadScratchQuaternion1); @@ -23040,15 +22171,12 @@ define('Core/Quaternion',[ * @see Quaternion#computeInnerQuadrangle */ Quaternion.squad = function(q0, q1, s0, s1, t, result) { - if (!defined(q0) || !defined(q1) || !defined(s0) || !defined(s1)) { - throw new DeveloperError('q0, q1, s0, and s1 are required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('q0', q0); + Check.typeOf.object('q1', q1); + Check.typeOf.object('s0', s0); + Check.typeOf.object('s1', s1); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var slerp0 = Quaternion.slerp(q0, q1, t, squadScratchQuaternion0); var slerp1 = Quaternion.slerp(s0, s1, t, squadScratchQuaternion1); @@ -23085,18 +22213,10 @@ define('Core/Quaternion',[ * @see Quaternion#slerp */ Quaternion.fastSlerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var x = Quaternion.dot(start, end); @@ -23145,15 +22265,12 @@ define('Core/Quaternion',[ * @see Quaternion#squad */ Quaternion.fastSquad = function(q0, q1, s0, s1, t, result) { - if (!defined(q0) || !defined(q1) || !defined(s0) || !defined(s1)) { - throw new DeveloperError('q0, q1, s0, and s1 are required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('q0', q0); + Check.typeOf.object('q1', q1); + Check.typeOf.object('s0', s0); + Check.typeOf.object('s1', s1); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var slerp0 = Quaternion.fastSlerp(q0, q1, t, squadScratchQuaternion0); var slerp1 = Quaternion.fastSlerp(s0, s1, t, squadScratchQuaternion1); @@ -23189,9 +22306,7 @@ define('Core/Quaternion',[ * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. */ Quaternion.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon is required and must be a number.'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || ((defined(left)) && @@ -23271,9 +22386,9 @@ define('Core/Transforms',[ './Cartesian3', './Cartesian4', './Cartographic', + './Check', './defaultValue', './defined', - './deprecationWarning', './DeveloperError', './EarthOrientationParameters', './EarthOrientationParametersSample', @@ -23293,9 +22408,9 @@ define('Core/Transforms',[ Cartesian3, Cartesian4, Cartographic, + Check, defaultValue, defined, - deprecationWarning, DeveloperError, EarthOrientationParameters, EarthOrientationParametersSample, @@ -23731,19 +22846,12 @@ define('Core/Transforms',[ * var hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll); * var transform = Cesium.Transforms.headingPitchRollToFixedFrame(center, hpr); */ - Transforms.headingPitchRollToFixedFrame = function(origin, headingPitchRoll, pitch, roll, ellipsoid, result) { - var heading; - if (typeof headingPitchRoll === 'object') { - // Shift arguments using assignments to encourage JIT optimization. - ellipsoid = pitch; - result = roll; - heading = headingPitchRoll.heading; - pitch = headingPitchRoll.pitch; - roll = headingPitchRoll.roll; - } else { - deprecationWarning('headingPitchRollToFixedFrame', 'headingPitchRollToFixedFrame with separate heading, pitch, and roll arguments was deprecated in 1.27. It will be removed in 1.30. Use a HeadingPitchRoll object.'); - heading = headingPitchRoll; - } + Transforms.headingPitchRollToFixedFrame = function(origin, headingPitchRoll, ellipsoid, result) { + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + var heading = headingPitchRoll.heading; + var pitch = headingPitchRoll.pitch; + var roll = headingPitchRoll.roll; + // checks for required parameters happen in the called functions var hprQuaternion = Quaternion.fromHeadingPitchRoll(heading, pitch, roll, scratchHPRQuaternion); var hprMatrix = Matrix4.fromTranslationQuaternionRotationScale(Cartesian3.ZERO, hprQuaternion, scratchScale, scratchHPRMatrix4); @@ -23751,7 +22859,6 @@ define('Core/Transforms',[ return Matrix4.multiply(result, hprMatrix, result); }; - var scratchHPR = new HeadingPitchRoll(); var scratchENUMatrix4 = new Matrix4(); var scratchHPRMatrix3 = new Matrix3(); @@ -23776,22 +22883,10 @@ define('Core/Transforms',[ * var hpr = new HeadingPitchRoll(heading, pitch, roll); * var quaternion = Cesium.Transforms.headingPitchRollQuaternion(center, hpr); */ - Transforms.headingPitchRollQuaternion = function(origin, headingPitchRoll, pitch, roll, ellipsoid, result) { - var hpr; - if (typeof headingPitchRoll === 'object') { - // Shift arguments using assignment to encourage JIT optimization. - hpr = headingPitchRoll; - ellipsoid = pitch; - result = roll; - } else { - deprecationWarning('headingPitchRollQuaternion', 'headingPitchRollQuaternion with separate heading, pitch, and roll arguments was deprecated in 1.27. It will be removed in 1.30. Use a HeadingPitchRoll object.'); - scratchHPR.heading = headingPitchRoll; - scratchHPR.pitch = pitch; - scratchHPR.roll = roll; - hpr = scratchHPR; - } + Transforms.headingPitchRollQuaternion = function(origin, headingPitchRoll, ellipsoid, result) { // checks for required parameters happen in the called functions - var transform = Transforms.headingPitchRollToFixedFrame(origin, hpr, ellipsoid, scratchENUMatrix4); + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + var transform = Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, scratchENUMatrix4); var rotation = Matrix4.getRotation(transform, scratchHPRMatrix3); return Quaternion.fromRotationMatrix(rotation, result); }; @@ -24267,6 +23362,46 @@ define('Core/Transforms',[ return result; }; + var swizzleMatrix = new Matrix4( + 0.0, 0.0, 1.0, 0.0, + 1.0, 0.0, 0.0, 0.0, + 0.0, 1.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + + /** + * @private + */ + Transforms.wgs84To2DModelMatrix = function(projection, center, result) { + if (!defined(projection)) { + throw new DeveloperError('projection is required.'); + } + if (!defined(center)) { + throw new DeveloperError('center is required.'); + } + if (!defined(result)) { + throw new DeveloperError('result is required.'); + } + + var ellipsoid = projection.ellipsoid; + + var fromENU = Transforms.eastNorthUpToFixedFrame(center, ellipsoid, scratchFromENU); + var toENU = Matrix4.inverseTransformation(fromENU, scratchToENU); + + var cartographic = ellipsoid.cartesianToCartographic(center, scratchCartographic); + var projectedPosition = projection.project(cartographic, scratchCartesian3Projection); + var newOrigin = scratchCartesian4NewOrigin; + newOrigin.x = projectedPosition.z; + newOrigin.y = projectedPosition.x; + newOrigin.z = projectedPosition.y; + newOrigin.w = 1.0; + + var translation = Matrix4.fromTranslation(newOrigin, scratchFromENU); + Matrix4.multiply(swizzleMatrix, toENU, result); + Matrix4.multiply(translation, result, result); + + return result; + }; + return Transforms; }); @@ -24933,6 +24068,7 @@ define('Core/EllipsoidGeodesic',[ * Provides the location of a point at the indicated portion along the geodesic. * * @param {Number} fraction The portion of the distance between the initial and final points. + * @param {Cartographic} result The object in which to store the result. * @returns {Cartographic} The location of the point along the geodesic. */ EllipsoidGeodesic.prototype.interpolateUsingFraction = function(fraction, result) { @@ -24943,6 +24079,7 @@ define('Core/EllipsoidGeodesic',[ * Provides the location of a point at the indicated distance along the geodesic. * * @param {Number} distance The distance from the inital point to the point of interest along the geodesic + * @param {Cartographic} result The object in which to store the result. * @returns {Cartographic} The location of the point along the geodesic. * * @exception {DeveloperError} start and end must be set before calling function interpolateUsingSurfaceDistance @@ -25014,6 +24151,30 @@ define('Core/EllipsoidGeodesic',[ return EllipsoidGeodesic; }); +/*global define*/ +define('Core/isArray',[ + './defined' + ], function( + defined) { + 'use strict'; + + /** + * Tests an object to see if it is an array. + * @exports isArray + * + * @param {Object} value The value to test. + * @returns {Boolean} true if the value is an array, false otherwise. + */ + var isArray = Array.isArray; + if (!defined(isArray)) { + isArray = function(value) { + return Object.prototype.toString.call(value) === '[object Array]'; + }; + } + + return isArray; +}); + /*global define*/ define('Core/PolylinePipeline',[ './Cartesian3', @@ -25218,10 +24379,10 @@ define('Core/PolylinePipeline',[ /** * Subdivides polyline and raises all points to the specified height. Returns an array of numbers to represent the positions. - * @param {Cartesian3[]} positions The array of type {Cartesian3} representing positions. - * @param {Number|Number[]} [height=0.0] A number or array of numbers representing the heights of each position. - * @param {Number} [granularity = CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. - * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie. + * @param {Cartesian3[]} options.positions The array of type {Cartesian3} representing positions. + * @param {Number|Number[]} [options.height=0.0] A number or array of numbers representing the heights of each position. + * @param {Number} [options.granularity = CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. + * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie. * @returns {Number[]} A new array of positions of type {Number} that have been subdivided and raised to the surface of the ellipsoid. * * @example @@ -25303,10 +24464,10 @@ define('Core/PolylinePipeline',[ /** * Subdivides polyline and raises all points to the specified height. Returns an array of new {Cartesian3} positions. - * @param {Cartesian3[]} positions The array of type {Cartesian3} representing positions. - * @param {Number|Number[]} [height=0.0] A number or array of numbers representing the heights of each position. - * @param {Number} [granularity = CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. - * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie. + * @param {Cartesian3[]} options.positions The array of type {Cartesian3} representing positions. + * @param {Number|Number[]} [options.height=0.0] A number or array of numbers representing the heights of each position. + * @param {Number} [options.granularity = CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. + * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie. * @returns {Cartesian3[]} A new array of cartesian3 positions that have been subdivided and raised to the surface of the ellipsoid. * * @example diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createRectangleGeometry.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createRectangleGeometry.js index fb200443..f4e6e737 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createRectangleGeometry.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createRectangleGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,68 +45,6 @@ define('Core/defined',[],function() { return defined; }); -/*global define*/ -define('Core/freezeObject',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Freezes an object, using Object.freeze if available, otherwise returns - * the object unchanged. This function should be used in setup code to prevent - * errors from completely halting JavaScript execution in legacy browsers. - * - * @private - * - * @exports freezeObject - */ - var freezeObject = Object.freeze; - if (!defined(freezeObject)) { - freezeObject = function(o) { - return o; - }; - } - - return freezeObject; -}); - -/*global define*/ -define('Core/defaultValue',[ - './freezeObject' - ], function( - freezeObject) { - 'use strict'; - - /** - * Returns the first parameter if not undefined, otherwise the second parameter. - * Useful for setting a default value for a parameter. - * - * @exports defaultValue - * - * @param {*} a - * @param {*} b - * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter. - * - * @example - * param = Cesium.defaultValue(param, 'default'); - */ - function defaultValue(a, b) { - if (a !== undefined) { - return a; - } - return b; - } - - /** - * A frozen empty object that can be used as the default value for options passed as - * an object literal. - */ - defaultValue.EMPTY_OBJECT = freezeObject({}); - - return defaultValue; -}); - /*global define*/ define('Core/DeveloperError',[ './defined' @@ -188,41 +126,13 @@ define('Core/DeveloperError',[ return DeveloperError; }); -/*global define*/ -define('Core/isArray',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Tests an object to see if it is an array. - * @exports isArray - * - * @param {Object} value The value to test. - * @returns {Boolean} true if the value is an array, false otherwise. - */ - var isArray = Array.isArray; - if (!defined(isArray)) { - isArray = function(value) { - return Object.prototype.toString.call(value) === '[object Array]'; - }; - } - - return isArray; -}); - /*global define*/ define('Core/Check',[ - './defaultValue', - './defined', - './DeveloperError', - './isArray' + './defined', + './DeveloperError' ], function( - defaultValue, defined, - DeveloperError, - isArray) { + DeveloperError) { 'use strict'; /** @@ -237,111 +147,134 @@ define('Core/Check',[ */ Check.typeOf = {}; - /** - * Contains functions for checking numeric conditions such as minimum and maximum values - */ - Check.numeric = {}; - function getUndefinedErrorMessage(name) { - return name + ' was required but undefined.'; + return name + ' is required, actual value was undefined'; } function getFailedTypeErrorMessage(actual, expected, name) { - return 'Expected ' + name + ' to be typeof ' + expected + ', got ' + actual; + return 'Expected ' + name + ' to be typeof ' + expected + ', actual typeof was ' + actual; } /** * Throws if test is not defined * - * @param {*} test The value that is to be checked * @param {String} name The name of the variable being tested + * @param {*} test The value that is to be checked * @exception {DeveloperError} test must be defined */ - Check.defined = function (test, name) { + Check.defined = function (name, test) { if (!defined(test)) { throw new DeveloperError(getUndefinedErrorMessage(name)); } }; /** - * Throws if test is greater than maximum + * Throws if test is not typeof 'function' * - * @param {Number} test The value to test - * @param {Number} maximum The maximum allowed value - * @exception {DeveloperError} test must not be greater than maximum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'function' */ - Check.numeric.maximum = function (test, maximum) { - Check.typeOf.number(test); - Check.typeOf.number(maximum); - if (test > maximum) { - throw new DeveloperError('Expected ' + test + ' to be at most ' + maximum); + Check.typeOf.func = function (name, test) { + if (typeof test !== 'function') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); } }; /** - * Throws if test is less than minimum + * Throws if test is not typeof 'string' * - * @param {Number} test The value to test - * @param {Number} minimum The minimum allowed value - * @exception {DeveloperError} test must not be less than mininum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'string' */ - Check.numeric.minimum = function (test, minimum) { - Check.typeOf.number(test); - Check.typeOf.number(minimum); - if (test < minimum) { - throw new DeveloperError('Expected ' + test + ' to be at least ' + minimum); + Check.typeOf.string = function (name, test) { + if (typeof test !== 'string') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); } }; /** - * Throws if test is not typeof 'function' + * Throws if test is not typeof 'number' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'function' + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'number' */ - Check.typeOf.function = function (test, name) { - if (typeof test !== 'function') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); + Check.typeOf.number = function (name, test) { + if (typeof test !== 'number') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); } }; /** - * Throws if test is not typeof 'string' + * Throws if test is not typeof 'number' and less than limit * + * @param {String} name The name of the variable being tested * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than limit + */ + Check.typeOf.number.lessThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test >= limit) { + throw new DeveloperError('Expected ' + name + ' to be less than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and less than or equal to limit + * * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'string' + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than or equal to limit */ - Check.typeOf.string = function (test, name) { - if (typeof test !== 'string') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); + Check.typeOf.number.lessThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test > limit) { + throw new DeveloperError('Expected ' + name + ' to be less than or equal to ' + limit + ', actual value was ' + test); } }; /** - * Throws if test is not typeof 'number' + * Throws if test is not typeof 'number' and greater than limit * + * @param {String} name The name of the variable being tested * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than limit + */ + Check.typeOf.number.greaterThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test <= limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and greater than or equal to limit + * * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'number' + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than or equal to limit */ - Check.typeOf.number = function (test, name) { - if (typeof test !== 'number') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); + Check.typeOf.number.greaterThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test < limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than or equal to' + limit + ', actual value was ' + test); } }; /** * Throws if test is not typeof 'object' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested + * @param {*} test The value to test * @exception {DeveloperError} test must be typeof 'object' */ - Check.typeOf.object = function (test, name) { + Check.typeOf.object = function (name, test) { if (typeof test !== 'object') { throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'object', name)); } @@ -350,11 +283,11 @@ define('Core/Check',[ /** * Throws if test is not typeof 'boolean' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested + * @param {*} test The value to test * @exception {DeveloperError} test must be typeof 'boolean' */ - Check.typeOf.boolean = function (test, name) { + Check.typeOf.bool = function (name, test) { if (typeof test !== 'boolean') { throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'boolean', name)); } @@ -363,6 +296,68 @@ define('Core/Check',[ return Check; }); +/*global define*/ +define('Core/freezeObject',[ + './defined' + ], function( + defined) { + 'use strict'; + + /** + * Freezes an object, using Object.freeze if available, otherwise returns + * the object unchanged. This function should be used in setup code to prevent + * errors from completely halting JavaScript execution in legacy browsers. + * + * @private + * + * @exports freezeObject + */ + var freezeObject = Object.freeze; + if (!defined(freezeObject)) { + freezeObject = function(o) { + return o; + }; + } + + return freezeObject; +}); + +/*global define*/ +define('Core/defaultValue',[ + './freezeObject' + ], function( + freezeObject) { + 'use strict'; + + /** + * Returns the first parameter if not undefined, otherwise the second parameter. + * Useful for setting a default value for a parameter. + * + * @exports defaultValue + * + * @param {*} a + * @param {*} b + * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter. + * + * @example + * param = Cesium.defaultValue(param, 'default'); + */ + function defaultValue(a, b) { + if (a !== undefined) { + return a; + } + return b; + } + + /** + * A frozen empty object that can be used as the default value for options passed as + * an object literal. + */ + defaultValue.EMPTY_OBJECT = freezeObject({}); + + return defaultValue; +}); + /* I've wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace so it's better encapsulated. Now you can have multiple random number generators @@ -1047,7 +1042,7 @@ define('Core/Math',[ if (!defined(angle)) { throw new DeveloperError('angle is required.'); } - + return CesiumMath.clamp(angle, -1*CesiumMath.PI_OVER_TWO, CesiumMath.PI_OVER_TWO); }; @@ -1057,11 +1052,11 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [<code>-CesiumMath.PI</code>, <code>CesiumMath.PI</code>]. */ - CesiumMath.negativePiToPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.negativePiToPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - return CesiumMath.zeroToTwoPi(x + CesiumMath.PI) - CesiumMath.PI; + return CesiumMath.zeroToTwoPi(angle + CesiumMath.PI) - CesiumMath.PI; }; /** @@ -1070,12 +1065,12 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [0, <code>CesiumMath.TWO_PI</code>]. */ - CesiumMath.zeroToTwoPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.zeroToTwoPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - var mod = CesiumMath.mod(x, CesiumMath.TWO_PI); - if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(x) > CesiumMath.EPSILON14) { + var mod = CesiumMath.mod(angle, CesiumMath.TWO_PI); + if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(angle) > CesiumMath.EPSILON14) { return CesiumMath.TWO_PI; } return mod; @@ -1145,7 +1140,7 @@ define('Core/Math',[ * @example * //Compute 7!, which is equal to 5040 * var computedFactorial = Cesium.Math.factorial(7); - * + * * @see {@link http://en.wikipedia.org/wiki/Factorial|Factorial on Wikipedia} */ CesiumMath.factorial = function(n) { @@ -1429,7 +1424,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.fromSpherical = function(spherical, result) { - Check.typeOf.object(spherical, 'spherical'); + Check.typeOf.object('spherical', spherical); if (!defined(result)) { result = new Cartesian3(); @@ -1513,8 +1508,8 @@ define('Core/Cartesian3',[ * @returns {Number[]} The array that was packed into */ Cartesian3.pack = function(value, array, startingIndex) { - Check.typeOf.object(value, 'value'); - Check.defined(array, 'array'); + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1534,7 +1529,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.unpack = function(array, startingIndex, result) { - Check.defined(array, 'array'); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1555,7 +1550,7 @@ define('Core/Cartesian3',[ * @returns {Number[]} The packed array. */ Cartesian3.packArray = function(array, result) { - Check.defined(array, 'array'); + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -1578,8 +1573,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3[]} The unpacked array. */ Cartesian3.unpackArray = function(array, result) { - Check.defined(array, 'array'); - Check.numeric.minimum(array.length, 3); + Check.defined('array', array); + Check.typeOf.number.greaterThanOrEquals('array.length', array.length, 3); if (array.length % 3 !== 0) { throw new DeveloperError('array length must be a multiple of 3.'); } @@ -1625,7 +1620,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the maximum component. */ Cartesian3.maximumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z); }; @@ -1637,7 +1632,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the minimum component. */ Cartesian3.minimumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z); }; @@ -1651,9 +1646,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the minimum components. */ Cartesian3.minimumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -1671,9 +1666,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the maximum components. */ Cartesian3.maximumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -1688,7 +1683,7 @@ define('Core/Cartesian3',[ * @returns {Number} The squared magnitude. */ Cartesian3.magnitudeSquared = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z; }; @@ -1717,8 +1712,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distance(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(2.0, 0.0, 0.0)); */ Cartesian3.distance = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitude(distanceScratch); @@ -1737,8 +1732,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distanceSquared(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(3.0, 0.0, 0.0)); */ Cartesian3.distanceSquared = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitudeSquared(distanceScratch); @@ -1752,8 +1747,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.normalize = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian3.magnitude(cartesian); @@ -1776,8 +1771,8 @@ define('Core/Cartesian3',[ * @returns {Number} The dot product. */ Cartesian3.dot = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z; }; @@ -1791,9 +1786,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyComponents = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -1835,9 +1830,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.add = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -1854,9 +1849,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.subtract = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -1873,9 +1868,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -1892,9 +1887,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.divideByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -1910,8 +1905,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.negate = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -1927,8 +1922,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.abs = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -1947,10 +1942,10 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.lerp = function(start, end, t, result) { - Check.typeOf.object(start, 'start'); - Check.typeOf.object(end, 'end'); - Check.typeOf.number(t, 't'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian3.multiplyByScalar(end, t, lerpScratch); result = Cartesian3.multiplyByScalar(start, 1.0 - t, result); @@ -1967,8 +1962,8 @@ define('Core/Cartesian3',[ * @returns {Number} The angle between the Cartesians. */ Cartesian3.angleBetween = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.normalize(left, angleBetweenScratch); Cartesian3.normalize(right, angleBetweenScratch2); @@ -1986,8 +1981,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The most orthogonal axis. */ Cartesian3.mostOrthogonalAxis = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian3.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian3.abs(f, f); @@ -2064,9 +2059,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The cross product. */ Cartesian3.cross = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var leftX = left.x; var leftY = left.y; @@ -2099,8 +2094,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromDegrees(-115.0, 37.0); */ Cartesian3.fromDegrees = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); longitude = CesiumMath.toRadians(longitude); latitude = CesiumMath.toRadians(latitude); @@ -2125,8 +2120,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromRadians(-2.007, 0.645); */ Cartesian3.fromRadians = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); height = defaultValue(height, 0.0); var radiiSquared = defined(ellipsoid) ? ellipsoid.radiiSquared : wgs84RadiiSquared; @@ -2160,7 +2155,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArray([-115.0, 37.0, -107.0, 33.0]); */ Cartesian3.fromDegreesArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -2194,7 +2189,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArray([-2.007, 0.645, -1.867, .575]); */ Cartesian3.fromRadiansArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -2228,7 +2223,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArrayHeights([-115.0, 37.0, 100000.0, -107.0, 33.0, 150000.0]); */ Cartesian3.fromDegreesArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -2263,7 +2258,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArrayHeights([-2.007, 0.645, 100000.0, -1.867, .575, 150000.0]); */ Cartesian3.fromRadiansArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -3010,7 +3005,9 @@ define('Core/Ellipsoid',[ /** * Computes an Ellipsoid from a Cartesian specifying the radii in x, y, and z directions. * - * @param {Cartesian3} [radii=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Cartesian3} [cartesian=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new + * instance should be created. * @returns {Ellipsoid} A new Ellipsoid instance. * * @exception {DeveloperError} All radii components must be greater than or equal to zero. @@ -3455,6 +3452,7 @@ define('Core/Ellipsoid',[ /*global define*/ define('Core/Rectangle',[ './Cartographic', + './Check', './defaultValue', './defined', './defineProperties', @@ -3464,6 +3462,7 @@ define('Core/Rectangle',[ './Math' ], function( Cartographic, + Check, defaultValue, defined, defineProperties, @@ -3560,13 +3559,8 @@ define('Core/Rectangle',[ * @returns {Number[]} The array that was packed into */ Rectangle.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3587,9 +3581,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3610,9 +3602,7 @@ define('Core/Rectangle',[ * @returns {Number} The width. */ Rectangle.computeWidth = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; if (east < west) { @@ -3627,9 +3617,7 @@ define('Core/Rectangle',[ * @returns {Number} The height. */ Rectangle.computeHeight = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); return rectangle.north - rectangle.south; }; @@ -3664,6 +3652,32 @@ define('Core/Rectangle',[ return result; }; + /** + * Creates an rectangle given the boundary longitude and latitude in radians. + * + * @param {Number} [west=0.0] The westernmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [south=0.0] The southernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Number} [east=0.0] The easternmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [north=0.0] The northernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Rectangle} [result] The object onto which to store the result, or undefined if a new instance should be created. + * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. + * + * @example + * var rectangle = Cesium.Rectangle.fromRadians(0.0, Math.PI/4, Math.PI/8, 3*Math.PI/4); + */ + Rectangle.fromRadians = function(west, south, east, north, result) { + if (!defined(result)) { + return new Rectangle(west, south, east, north); + } + + result.west = defaultValue(west, 0.0); + result.south = defaultValue(south, 0.0); + result.east = defaultValue(east, 0.0); + result.north = defaultValue(north, 0.0); + + return result; + }; + /** * Creates the smallest possible Rectangle that encloses all positions in the provided array. * @@ -3672,9 +3686,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartographicArray = function(cartographics, result) { - if (!defined(cartographics)) { - throw new DeveloperError('cartographics is required.'); - } + Check.defined('cartographics', cartographics); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -3727,9 +3739,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartesianArray = function(cartesians, ellipsoid, result) { - if (!defined(cartesians)) { - throw new DeveloperError('cartesians is required.'); - } + Check.defined('cartesians', cartesians); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -3845,9 +3855,7 @@ define('Core/Rectangle',[ * @returns {Boolean} <code>true</code> if the Rectangles are within the provided epsilon, <code>false</code> otherwise. */ Rectangle.prototype.equalsEpsilon = function(other, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon is required and must be a number.'); - } + Check.typeOf.number('epsilon', epsilon); return defined(other) && (Math.abs(this.west - other.west) <= epsilon) && @@ -3867,45 +3875,23 @@ define('Core/Rectangle',[ * @exception {DeveloperError} <code>west</code> must be in the interval [<code>-Pi</code>, <code>Pi</code>]. */ Rectangle.validate = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var north = rectangle.north; - if (typeof north !== 'number') { - throw new DeveloperError('north is required to be a number.'); - } - - if (north < -CesiumMath.PI_OVER_TWO || north > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('north must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('north', north, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('north', north, CesiumMath.PI_OVER_TWO); var south = rectangle.south; - if (typeof south !== 'number') { - throw new DeveloperError('south is required to be a number.'); - } - - if (south < -CesiumMath.PI_OVER_TWO || south > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('south must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('south', south, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('south', south, CesiumMath.PI_OVER_TWO); var west = rectangle.west; - if (typeof west !== 'number') { - throw new DeveloperError('west is required to be a number.'); - } - - if (west < -Math.PI || west > Math.PI) { - throw new DeveloperError('west must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('west', west, -Math.PI); + Check.typeOf.number.lessThanOrEquals('west', west, Math.PI); var east = rectangle.east; - if (typeof east !== 'number') { - throw new DeveloperError('east is required to be a number.'); - } - - if (east < -Math.PI || east > Math.PI) { - throw new DeveloperError('east must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('east', east, -Math.PI); + Check.typeOf.number.lessThanOrEquals('east', east, Math.PI); }; /** @@ -3916,9 +3902,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.south); @@ -3937,9 +3921,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.north); @@ -3958,9 +3940,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.north); @@ -3979,9 +3959,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.south); @@ -4000,9 +3978,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.center = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; @@ -4037,12 +4013,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.intersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var rectangleEast = rectangle.east; var rectangleWest = rectangle.west; @@ -4098,12 +4070,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.simpleIntersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var west = Math.max(rectangle.west, otherRectangle.west); var south = Math.max(rectangle.south, otherRectangle.south); @@ -4134,12 +4102,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.union = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); if (!defined(result)) { result = new Rectangle(); @@ -4183,12 +4147,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.expand = function(rectangle, cartographic, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); if (!defined(result)) { result = new Rectangle(); @@ -4210,12 +4170,8 @@ define('Core/Rectangle',[ * @returns {Boolean} true if the provided cartographic is inside the rectangle, false otherwise. */ Rectangle.contains = function(rectangle, cartographic) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); var longitude = cartographic.longitude; var latitude = cartographic.latitude; @@ -4248,9 +4204,7 @@ define('Core/Rectangle',[ * @returns {Cartesian3[]} The modified result parameter or a new Array of Cartesians instances if none was provided. */ Rectangle.subsample = function(rectangle, ellipsoid, surfaceHeight, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84); surfaceHeight = defaultValue(surfaceHeight, 0.0); @@ -4522,6 +4476,7 @@ define('Core/Interval',[ /*global define*/ define('Core/Matrix3',[ './Cartesian3', + './Check', './defaultValue', './defined', './defineProperties', @@ -4530,6 +4485,7 @@ define('Core/Matrix3',[ './Math' ], function( Cartesian3, + Check, defaultValue, defined, defineProperties, @@ -4592,13 +4548,8 @@ define('Core/Matrix3',[ * @returns {Number[]} The array that was packed into */ Matrix3.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -4624,9 +4575,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. */ Matrix3.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -4653,24 +4602,24 @@ define('Core/Matrix3',[ * @param {Matrix3} [result] The object onto which to store the result. * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. (Returns undefined if matrix is undefined) */ - Matrix3.clone = function(values, result) { - if (!defined(values)) { + Matrix3.clone = function(matrix, result) { + if (!defined(matrix)) { return undefined; } if (!defined(result)) { - return new Matrix3(values[0], values[3], values[6], - values[1], values[4], values[7], - values[2], values[5], values[8]); + return new Matrix3(matrix[0], matrix[3], matrix[6], + matrix[1], matrix[4], matrix[7], + matrix[2], matrix[5], matrix[8]); } - result[0] = values[0]; - result[1] = values[1]; - result[2] = values[2]; - result[3] = values[3]; - result[4] = values[4]; - result[5] = values[5]; - result[6] = values[6]; - result[7] = values[7]; - result[8] = values[8]; + result[0] = matrix[0]; + result[1] = matrix[1]; + result[2] = matrix[2]; + result[3] = matrix[3]; + result[4] = matrix[4]; + result[5] = matrix[5]; + result[6] = matrix[6]; + result[7] = matrix[7]; + result[8] = matrix[8]; return result; }; @@ -4696,9 +4645,7 @@ define('Core/Matrix3',[ * var m2 = Cesium.Matrix3.fromArray(v2, 2); */ Matrix3.fromArray = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -4726,9 +4673,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values parameter is required'); - } + Check.defined('values', values); return Matrix3.clone(values, result); }; @@ -4742,9 +4687,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix3(values[0], values[1], values[2], @@ -4771,9 +4714,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this quaternion. */ Matrix3.fromQuaternion = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); var x2 = quaternion.x * quaternion.x; var xy = quaternion.x * quaternion.y; @@ -4823,10 +4764,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this headingPitchRoll. */ Matrix3.fromHeadingPitchRoll = function(headingPitchRoll, result) { - if (!defined(headingPitchRoll)) { - throw new DeveloperError('headingPitchRoll is required'); - } - var cosTheta = Math.cos(-headingPitchRoll.pitch); + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + + var cosTheta = Math.cos(-headingPitchRoll.pitch); var cosPsi = Math.cos(-headingPitchRoll.heading); var cosPhi = Math.cos(headingPitchRoll.roll); var sinTheta = Math.sin(-headingPitchRoll.pitch); @@ -4877,9 +4817,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix3( @@ -4915,9 +4853,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromUniformScale(2.0); */ Matrix3.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix3( @@ -4941,7 +4877,7 @@ define('Core/Matrix3',[ /** * Computes a Matrix3 instance representing the cross product equivalent matrix of a Cartesian3 vector. * - * @param {Cartesian3} the vector on the left hand side of the cross product operation. + * @param {Cartesian3} vector the vector on the left hand side of the cross product operation. * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created. * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. * @@ -4953,9 +4889,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromCrossProduct(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromCrossProduct = function(vector, result) { - if (!defined(vector)) { - throw new DeveloperError('vector is required.'); - } + Check.typeOf.object('vector', vector); if (!defined(result)) { return new Matrix3( @@ -4990,9 +4924,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationX = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -5031,9 +4963,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationY = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -5072,9 +5002,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationZ = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -5108,9 +5036,7 @@ define('Core/Matrix3',[ * @returns {Number[]} The modified Array parameter or a new Array instance if one was not provided. */ Matrix3.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5], matrix[6], matrix[7], matrix[8]]; @@ -5144,12 +5070,10 @@ define('Core/Matrix3',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix3.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 2) { - throw new DeveloperError('row must be 0, 1, or 2.'); - } - if (typeof column !== 'number' || column < 0 || column > 2) { - throw new DeveloperError('column must be 0, 1, or 2.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 2); + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 2); return column * 3 + row; }; @@ -5165,16 +5089,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var startIndex = index * 3; var x = matrix[startIndex]; @@ -5199,18 +5117,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); var startIndex = index * 3; @@ -5231,15 +5142,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 3]; @@ -5263,18 +5169,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); result[index] = cartesian.x; @@ -5293,12 +5192,8 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[3], matrix[4], matrix[5], scratchColumn)); @@ -5329,15 +5224,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var column0Row0 = left[0] * right[0] + left[3] * right[1] + left[6] * right[2]; var column0Row1 = left[1] * right[0] + left[4] * right[1] + left[7] * right[2]; @@ -5372,15 +5261,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -5403,15 +5286,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -5434,15 +5311,9 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -5467,15 +5338,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -5506,15 +5371,9 @@ define('Core/Matrix3',[ * @see Matrix3.multiplyByUniformScale */ Matrix3.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); result[0] = matrix[0] * scale.x; result[1] = matrix[1] * scale.x; @@ -5536,12 +5395,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -5563,12 +5418,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var column0Row0 = matrix[0]; var column0Row1 = matrix[3]; @@ -5708,9 +5559,7 @@ define('Core/Matrix3',[ * var c = Cesium.Cartesian3.multiplyByScalar(v, lambda, new Cesium.Cartesian3()); // equal to Cesium.Matrix3.multiplyByVector(a, v) */ Matrix3.computeEigenDecomposition = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); // This routine was created based upon Matrix Computations, 3rd ed., by Golub and Van Loan, // section 8.4.3 The Classical Jacobi Algorithm @@ -5754,12 +5603,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -5781,9 +5626,7 @@ define('Core/Matrix3',[ * @returns {Number} The value of the determinant of the matrix. */ Matrix3.determinant = function(matrix) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); var m11 = matrix[0]; var m21 = matrix[3]; @@ -5808,12 +5651,8 @@ define('Core/Matrix3',[ * @exception {DeveloperError} matrix is not invertible. */ Matrix3.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var m11 = matrix[0]; var m21 = matrix[1]; @@ -5879,9 +5718,7 @@ define('Core/Matrix3',[ * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. */ Matrix3.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -6069,12 +5906,14 @@ define('Core/Matrix3',[ /*global define*/ define('Core/Cartesian4',[ + './Check', './defaultValue', './defined', './DeveloperError', './freezeObject', './Math' ], function( + Check, defaultValue, defined, DeveloperError, @@ -6157,9 +5996,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.fromColor = function(color, result) { - if (!defined(color)) { - throw new DeveloperError('color is required'); - } + Check.typeOf.object('color', color); if (!defined(result)) { return new Cartesian4(color.red, color.green, color.blue, color.alpha); } @@ -6211,12 +6048,8 @@ define('Core/Cartesian4',[ * @returns {Number[]} The array that was packed into */ Cartesian4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -6237,9 +6070,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -6261,9 +6092,7 @@ define('Core/Cartesian4',[ * @returns {Number[]} The packed array. */ Cartesian4.packArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -6286,9 +6115,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4[]} The unpacked array. */ Cartesian4.unpackArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -6331,9 +6158,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the maximum component. */ Cartesian4.maximumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -6345,9 +6170,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the minimum component. */ Cartesian4.minimumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -6361,15 +6184,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the minimum components. */ Cartesian4.minimumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -6388,15 +6205,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the maximum components. */ Cartesian4.maximumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -6413,9 +6224,7 @@ define('Core/Cartesian4',[ * @returns {Number} The squared magnitude. */ Cartesian4.magnitudeSquared = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z + cartesian.w * cartesian.w; }; @@ -6446,9 +6255,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(2.0, 0.0, 0.0, 0.0)); */ Cartesian4.distance = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitude(distanceScratch); @@ -6469,9 +6277,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(3.0, 0.0, 0.0, 0.0)); */ Cartesian4.distanceSquared = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitudeSquared(distanceScratch); @@ -6485,12 +6292,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.normalize = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian4.magnitude(cartesian); @@ -6514,12 +6317,8 @@ define('Core/Cartesian4',[ * @returns {Number} The dot product. */ Cartesian4.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w; }; @@ -6533,15 +6332,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -6559,15 +6352,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x / right.x; result.y = left.y / right.y; @@ -6585,15 +6372,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -6611,15 +6392,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -6637,15 +6412,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -6663,15 +6432,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -6688,12 +6451,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.negate = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -6710,12 +6469,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.abs = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -6735,18 +6490,10 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian4.multiplyByScalar(end, t, lerpScratch); result = Cartesian4.multiplyByScalar(start, 1.0 - t, result); @@ -6762,12 +6509,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The most orthogonal axis. */ Cartesian4.mostOrthogonalAxis = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian4.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian4.abs(f, f); @@ -7012,6 +6755,7 @@ define('Core/RuntimeError',[ define('Core/Matrix4',[ './Cartesian3', './Cartesian4', + './Check', './defaultValue', './defined', './defineProperties', @@ -7023,6 +6767,7 @@ define('Core/Matrix4',[ ], function( Cartesian3, Cartesian4, + Check, defaultValue, defined, defineProperties, @@ -7113,13 +6858,8 @@ define('Core/Matrix4',[ * @returns {Number[]} The array that was packed into */ Matrix4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -7152,9 +6892,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if one was not provided. */ Matrix4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -7250,9 +6988,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required'); - } + Check.defined('values', values); return Matrix4.clone(values, result); }; @@ -7266,9 +7002,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix4(values[0], values[1], values[2], values[3], @@ -7305,9 +7039,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRotationTranslation = function(rotation, translation, result) { - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } + Check.typeOf.object('rotation', rotation); translation = defaultValue(translation, Cartesian3.ZERO); @@ -7355,15 +7087,9 @@ define('Core/Matrix4',[ * result); */ Matrix4.fromTranslationQuaternionRotationScale = function(translation, rotation, scale, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('translation', translation); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('scale', scale); if (!defined(result)) { result = new Matrix4(); @@ -7424,9 +7150,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromTranslationRotationScale = function(translationRotationScale, result) { - if (!defined(translationRotationScale)) { - throw new DeveloperError('translationRotationScale is required.'); - } + Check.typeOf.object('translationRotationScale', translationRotationScale); return Matrix4.fromTranslationQuaternionRotationScale(translationRotationScale.translation, translationRotationScale.rotation, translationRotationScale.scale, result); }; @@ -7441,9 +7165,7 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByTranslation */ Matrix4.fromTranslation = function(translation, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } + Check.typeOf.object('translation', translation); return Matrix4.fromRotationTranslation(Matrix3.IDENTITY, translation, result); }; @@ -7464,9 +7186,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix4.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix4( @@ -7511,9 +7231,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromUniformScale(2.0); */ Matrix4.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix4(scale, 0.0, 0.0, 0.0, @@ -7553,23 +7271,15 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromCamera = function(camera, result) { - if (!defined(camera)) { - throw new DeveloperError('camera is required.'); - } + Check.typeOf.object('camera', camera); var position = camera.position; var direction = camera.direction; var up = camera.up; - if (!defined(position)) { - throw new DeveloperError('camera.position is required.'); - } - if (!defined(direction)) { - throw new DeveloperError('camera.direction is required.'); - } - if (!defined(up)) { - throw new DeveloperError('camera.up is required.'); - } + Check.typeOf.object('camera.position', position); + Check.typeOf.object('camera.direction', direction); + Check.typeOf.object('camera.up', up); Cartesian3.normalize(direction, fromCameraF); Cartesian3.normalize(Cartesian3.cross(fromCameraF, up, fromCameraR), fromCameraR); @@ -7648,21 +7358,11 @@ define('Core/Matrix4',[ * @exception {DeveloperError} far must be greater than zero. */ Matrix4.computePerspectiveFieldOfView = function(fovY, aspectRatio, near, far, result) { - if (fovY <= 0.0 || fovY > Math.PI) { - throw new DeveloperError('fovY must be in (0, PI].'); - } - if (aspectRatio <= 0.0) { - throw new DeveloperError('aspectRatio must be greater than zero.'); - } - if (near <= 0.0) { - throw new DeveloperError('near must be greater than zero.'); - } - if (far <= 0.0) { - throw new DeveloperError('far must be greater than zero.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThan('fovY', fovY, 0.0); + Check.typeOf.number.lessThan('fovY', fovY, Math.PI); + Check.typeOf.number.greaterThan('near', near, 0.0); + Check.typeOf.number.greaterThan('far', far, 0.0); + Check.typeOf.object('result', result); var bottom = Math.tan(fovY * 0.5); @@ -7703,27 +7403,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeOrthographicOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var a = 1.0 / (right - left); var b = 1.0 / (top - bottom); @@ -7768,27 +7454,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computePerspectiveOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -7829,24 +7501,12 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeInfinitePerspectiveOffCenter = function(left, right, bottom, top, near, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -7894,9 +7554,7 @@ define('Core/Matrix4',[ * }, 0.0, 1.0, new Cesium.Matrix4()); */ Matrix4.computeViewportTransformation = function(viewport, nearDepthRange, farDepthRange, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); viewport = defaultValue(viewport, defaultValue.EMPTY_OBJECT); var x = defaultValue(viewport.x, 0.0); @@ -7948,21 +7606,11 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeView = function(position, direction, up, right, result) { - if (!defined(position)) { - throw new DeveloperError('position is required'); - } - if (!defined(direction)) { - throw new DeveloperError('direction is required'); - } - if (!defined(up)) { - throw new DeveloperError('up is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); + Check.typeOf.object('up', up); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = right.x; result[1] = up.x; @@ -8003,9 +7651,7 @@ define('Core/Matrix4',[ * //creates a = [10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0] */ Matrix4.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], @@ -8049,12 +7695,11 @@ define('Core/Matrix4',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix4.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 3) { - throw new DeveloperError('row must be 0, 1, 2, or 3.'); - } - if (typeof column !== 'number' || column < 0 || column > 3) { - throw new DeveloperError('column must be 0, 1, 2, or 3.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 3); + + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 3); return column * 4 + row; }; @@ -8087,16 +7732,12 @@ define('Core/Matrix4',[ * // a.x = 12.0; a.y = 16.0; a.z = 20.0; a.w = 24.0; */ Matrix4.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var startIndex = index * 4; var x = matrix[startIndex]; @@ -8135,21 +7776,16 @@ define('Core/Matrix4',[ * // a = [10.0, 11.0, 99.0, 13.0] * // [14.0, 15.0, 98.0, 17.0] * // [18.0, 19.0, 97.0, 21.0] - * // [22.0, 23.0, 96.0, 25.0] - */ - Matrix4.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + * // [22.0, 23.0, 96.0, 25.0] + */ + Matrix4.setColumn = function(matrix, index, cartesian, result) { + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); var startIndex = index * 4; @@ -8170,15 +7806,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.setTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -8231,16 +7861,12 @@ define('Core/Matrix4',[ * // a.x = 18.0; a.y = 19.0; a.z = 20.0; a.w = 21.0; */ Matrix4.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 4]; @@ -8281,18 +7907,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 24.0, 25.0] */ Matrix4.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); result[index] = cartesian.x; @@ -8312,12 +7933,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter */ Matrix4.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[4], matrix[5], matrix[6], scratchColumn)); @@ -8349,15 +7966,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -8441,15 +8052,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -8479,15 +8084,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -8528,15 +8127,9 @@ define('Core/Matrix4',[ * var m3 = Cesium.Matrix4.multiplyTransformation(m1, m2, new Cesium.Matrix4()); */ Matrix4.multiplyTransformation = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -8614,15 +8207,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByMatrix3(m, rotation, m); */ Matrix4.multiplyByMatrix3 = function(matrix, rotation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('result', result); var left0 = matrix[0]; var left1 = matrix[1]; @@ -8690,15 +8277,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByTranslation(m, position, m); */ Matrix4.multiplyByTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); var x = translation.x; var y = translation.y; @@ -8750,15 +8331,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByScale */ Matrix4.multiplyByUniformScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scale', scale); + Check.typeOf.object('result', result); uniformScaleScratch.x = scale; uniformScaleScratch.y = scale; @@ -8787,15 +8362,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByUniformScale */ Matrix4.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); var scaleX = scale.x; var scaleY = scale.y; @@ -8834,15 +8403,9 @@ define('Core/Matrix4',[ * @returns {Cartesian4} The modified result parameter. */ Matrix4.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8878,15 +8441,9 @@ define('Core/Matrix4',[ * // Cesium.Matrix4.multiplyByVector(matrix, new Cesium.Cartesian4(p.x, p.y, p.z, 0.0), result); */ Matrix4.multiplyByPointAsVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8916,16 +8473,9 @@ define('Core/Matrix4',[ * var result = Cesium.Matrix4.multiplyByPoint(matrix, p, new Cesium.Cartesian3()); */ Matrix4.multiplyByPoint = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8965,15 +8515,9 @@ define('Core/Matrix4',[ * // [-44.0, -46.0, -48.0, -50.0] */ Matrix4.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -9017,12 +8561,8 @@ define('Core/Matrix4',[ * // [-22.0, -23.0, -24.0, -25.0] */ Matrix4.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -9066,12 +8606,8 @@ define('Core/Matrix4',[ * // [13.0, 17.0, 21.0, 25.0] */ Matrix4.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var matrix1 = matrix[1]; var matrix2 = matrix[2]; @@ -9107,12 +8643,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -9226,9 +8758,7 @@ define('Core/Matrix4',[ * //Prints "Difference between both the matrices is not less than 0.1" on the console */ Matrix4.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -9259,12 +8789,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter. */ Matrix4.getTranslation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = matrix[12]; result.y = matrix[13]; @@ -9295,12 +8821,8 @@ define('Core/Matrix4',[ * // [12.0, 16.0, 20.0] */ Matrix4.getRotation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -9332,12 +8854,8 @@ define('Core/Matrix4',[ * @exception {RuntimeError} matrix is not invertible because its determinate is zero. */ Matrix4.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); // Special case for a zero scale matrix that can occur, for example, // when a model's node has a [0, 0, 0] scale. @@ -9475,12 +8993,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.inverseTransformation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); //This function is an optimized version of the below 4 lines. //var rT = Matrix3.transpose(Matrix4.getRotation(matrix)); @@ -9765,9 +9279,9 @@ define('Core/Matrix4',[ define('Core/BoundingSphere',[ './Cartesian3', './Cartographic', + './Check', './defaultValue', './defined', - './DeveloperError', './Ellipsoid', './GeographicProjection', './Intersect', @@ -9778,9 +9292,9 @@ define('Core/BoundingSphere',[ ], function( Cartesian3, Cartographic, + Check, defaultValue, defined, - DeveloperError, Ellipsoid, GeographicProjection, Intersect, @@ -10110,9 +9624,7 @@ define('Core/BoundingSphere',[ stride = defaultValue(stride, 3); - if (stride < 3) { - throw new DeveloperError('stride must be 3 or greater.'); - } + Check.typeOf.number.greaterThanOrEquals('stride', stride, 3); var currentPos = fromPointsCurrentPos; currentPos.x = positions[0] + center.x; @@ -10416,9 +9928,8 @@ define('Core/BoundingSphere',[ * var sphere = Cesium.BoundingSphere.fromCornerPoints(new Cesium.Cartesian3(-0.5, -0.5, -0.5), new Cesium.Cartesian3(0.5, 0.5, 0.5)); */ BoundingSphere.fromCornerPoints = function(corner, oppositeCorner, result) { - if (!defined(corner) || !defined(oppositeCorner)) { - throw new DeveloperError('corner and oppositeCorner are required.'); - } + Check.typeOf.object('corner', corner); + Check.typeOf.object('oppositeCorner', oppositeCorner); if (!defined(result)) { result = new BoundingSphere(); @@ -10442,9 +9953,7 @@ define('Core/BoundingSphere',[ * var boundingSphere = Cesium.BoundingSphere.fromEllipsoid(ellipsoid); */ BoundingSphere.fromEllipsoid = function(ellipsoid, result) { - if (!defined(ellipsoid)) { - throw new DeveloperError('ellipsoid is required.'); - } + Check.typeOf.object('ellipsoid', ellipsoid); if (!defined(result)) { result = new BoundingSphere(); @@ -10570,13 +10079,8 @@ define('Core/BoundingSphere',[ * @returns {Number[]} The array that was packed into */ BoundingSphere.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -10598,9 +10102,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if one was not provided. */ BoundingSphere.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -10627,13 +10129,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.union = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); if (!defined(result)) { result = new BoundingSphere(); @@ -10682,13 +10179,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.expand = function(sphere, point, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(point)) { - throw new DeveloperError('point is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('point', point); result = BoundingSphere.clone(sphere, result); @@ -10711,13 +10203,8 @@ define('Core/BoundingSphere',[ * intersects the plane. */ BoundingSphere.intersectPlane = function(sphere, plane) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(plane)) { - throw new DeveloperError('plane is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('plane', plane); var center = sphere.center; var radius = sphere.radius; @@ -10743,13 +10230,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.transform = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -10777,12 +10259,8 @@ define('Core/BoundingSphere',[ * }); */ BoundingSphere.distanceSquaredTo = function(sphere, cartesian) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('cartesian', cartesian); var diff = Cartesian3.subtract(sphere.center, cartesian, distanceSquaredToScratch); return Cartesian3.magnitudeSquared(diff) - sphere.radius * sphere.radius; @@ -10804,13 +10282,8 @@ define('Core/BoundingSphere',[ * var newBoundingSphere = Cesium.BoundingSphere.transformWithoutScale(boundingSphere, modelMatrix); */ BoundingSphere.transformWithoutScale = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -10837,17 +10310,9 @@ define('Core/BoundingSphere',[ * @returns {Interval} The nearest and farthest distances on the bounding sphere from position in direction. */ BoundingSphere.computePlaneDistances = function(sphere, position, direction, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(position)) { - throw new DeveloperError('position is required.'); - } - - if (!defined(direction)) { - throw new DeveloperError('direction is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); if (!defined(result)) { result = new Interval(); @@ -10882,9 +10347,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.projectTo2D = function(sphere, projection, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } + Check.typeOf.object('sphere', sphere); projection = defaultValue(projection, projectTo2DProjection); @@ -10979,12 +10442,8 @@ define('Core/BoundingSphere',[ * @returns {Boolean} <code>true</code> if the sphere is not visible; otherwise <code>false</code>. */ BoundingSphere.isOccluded = function(sphere, occluder) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(occluder)) { - throw new DeveloperError('occluder is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('occluder', occluder); return !occluder.isBoundingSphereVisible(sphere); }; @@ -11085,12 +10544,14 @@ define('Core/BoundingSphere',[ /*global define*/ define('Core/Cartesian2',[ + './Check', './defaultValue', './defined', './DeveloperError', './freezeObject', './Math' ], function( + Check, defaultValue, defined, DeveloperError, @@ -11202,12 +10663,8 @@ define('Core/Cartesian2',[ * @returns {Number[]} The array that was packed into */ Cartesian2.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -11226,9 +10683,7 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided. */ Cartesian2.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -11248,9 +10703,7 @@ define('Core/Cartesian2',[ * @returns {Number[]} The packed array. */ Cartesian2.packArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -11273,9 +10726,7 @@ define('Core/Cartesian2',[ * @returns {Cartesian2[]} The unpacked array. */ Cartesian2.unpackArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -11318,9 +10769,7 @@ define('Core/Cartesian2',[ * @returns {Number} The value of the maximum component. */ Cartesian2.maximumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y); }; @@ -11332,9 +10781,7 @@ define('Core/Cartesian2',[ * @returns {Number} The value of the minimum component. */ Cartesian2.minimumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y); }; @@ -11348,15 +10795,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} A cartesian with the minimum components. */ Cartesian2.minimumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); @@ -11374,15 +10815,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} A cartesian with the maximum components. */ Cartesian2.maximumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -11396,9 +10831,7 @@ define('Core/Cartesian2',[ * @returns {Number} The squared magnitude. */ Cartesian2.magnitudeSquared = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y; }; @@ -11464,12 +10897,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.normalize = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian2.magnitude(cartesian); @@ -11487,16 +10916,12 @@ define('Core/Cartesian2',[ * Computes the dot (scalar) product of two Cartesians. * * @param {Cartesian2} left The first Cartesian. - * @param {Cartesian2} right The second Cartesian. - * @returns {Number} The dot product. - */ - Cartesian2.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + * @param {Cartesian2} right The second Cartesian. + * @returns {Number} The dot product. + */ + Cartesian2.dot = function(left, right) { + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y; }; @@ -11510,15 +10935,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.multiplyComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -11534,15 +10953,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.divideComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x / right.x; result.y = left.y / right.y; @@ -11558,15 +10971,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -11582,15 +10989,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -11606,15 +11007,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.multiplyByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -11630,15 +11025,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.divideByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -11653,12 +11042,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.negate = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -11673,12 +11058,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.abs = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -11696,18 +11077,10 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian2.multiplyByScalar(end, t, lerpScratch); result = Cartesian2.multiplyByScalar(start, 1.0 - t, result); @@ -11724,12 +11097,8 @@ define('Core/Cartesian2',[ * @returns {Number} The angle between the Cartesians. */ Cartesian2.angleBetween = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian2.normalize(left, angleBetweenScratch); Cartesian2.normalize(right, angleBetweenScratch2); @@ -11745,12 +11114,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The most orthogonal axis. */ Cartesian2.mostOrthogonalAxis = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian2.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian2.abs(f, f); @@ -12988,7 +12353,10 @@ define('Core/WebGLConstants',[ COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : 0x9279, TEXTURE_IMMUTABLE_FORMAT : 0x912F, MAX_ELEMENT_INDEX : 0x8D6B, - TEXTURE_IMMUTABLE_LEVELS : 0x82DF + TEXTURE_IMMUTABLE_LEVELS : 0x82DF, + + // Extensions + MAX_TEXTURE_MAX_ANISOTROPY_EXT : 0x84FF }; return freezeObject(WebGLConstants); @@ -13518,7 +12886,7 @@ define('Core/Geometry',[ * <li><code>position</code> - 3D vertex position. 64-bit floating-point (for precision). 3 components per attribute. See {@link VertexFormat#position}.</li> * <li><code>normal</code> - Normal (normalized), commonly used for lighting. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#normal}.</li> * <li><code>st</code> - 2D texture coordinate. 32-bit floating-point. 2 components per attribute. See {@link VertexFormat#st}.</li> - * <li><code>binormal</code> - Binormal (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#binormal}.</li> + * <li><code>bitangent</code> - Bitangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#bitangent}.</li> * <li><code>tangent</code> - Tangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#tangent}.</li> * </ul> * </p> @@ -13547,7 +12915,7 @@ define('Core/Geometry',[ * componentsPerAttribute : 3, * values : new Float32Array(0) * }); - * + * * @see GeometryAttribute * @see VertexFormat */ @@ -13828,7 +13196,7 @@ define('Core/GeometryAttributes',[ this.st = options.st; /** - * The binormal attribute (normalized), which is used for tangent-space effects like bump mapping. + * The bitangent attribute (normalized), which is used for tangent-space effects like bump mapping. * <p> * 32-bit floating-point. 3 components per attribute. * </p> @@ -13837,7 +13205,7 @@ define('Core/GeometryAttributes',[ * * @default undefined */ - this.binormal = options.binormal; + this.bitangent = options.bitangent; /** * The tangent attribute (normalized), which is used for tangent-space effects like bump mapping. @@ -14375,6 +13743,118 @@ define('Core/barycentricCoordinates',[ return barycentricCoordinates; }); +/*global define*/ +define('Core/oneTimeWarning',[ + './defaultValue', + './defined', + './DeveloperError' + ], function( + defaultValue, + defined, + DeveloperError) { + "use strict"; + + var warnings = {}; + + /** + * Logs a one time message to the console. Use this function instead of + * <code>console.log</code> directly since this does not log duplicate messages + * unless it is called from multiple workers. + * + * @exports oneTimeWarning + * + * @param {String} identifier The unique identifier for this warning. + * @param {String} [message=identifier] The message to log to the console. + * + * @example + * for(var i=0;i<foo.length;++i) { + * if (!defined(foo[i].bar)) { + * // Something that can be recovered from but may happen a lot + * oneTimeWarning('foo.bar undefined', 'foo.bar is undefined. Setting to 0.'); + * foo[i].bar = 0; + * // ... + * } + * } + * + * @private + */ + function oneTimeWarning(identifier, message) { + if (!defined(identifier)) { + throw new DeveloperError('identifier is required.'); + } + + if (!defined(warnings[identifier])) { + warnings[identifier] = true; + console.warn(defaultValue(message, identifier)); + } + } + + oneTimeWarning.geometryOutlines = 'Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.'; + + return oneTimeWarning; +}); + +/*global define*/ +define('Core/deprecationWarning',[ + './defined', + './DeveloperError', + './oneTimeWarning' + ], function( + defined, + DeveloperError, + oneTimeWarning) { + 'use strict'; + + /** + * Logs a deprecation message to the console. Use this function instead of + * <code>console.log</code> directly since this does not log duplicate messages + * unless it is called from multiple workers. + * + * @exports deprecationWarning + * + * @param {String} identifier The unique identifier for this deprecated API. + * @param {String} message The message to log to the console. + * + * @example + * // Deprecated function or class + * function Foo() { + * deprecationWarning('Foo', 'Foo was deprecated in Cesium 1.01. It will be removed in 1.03. Use newFoo instead.'); + * // ... + * } + * + * // Deprecated function + * Bar.prototype.func = function() { + * deprecationWarning('Bar.func', 'Bar.func() was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newFunc() instead.'); + * // ... + * }; + * + * // Deprecated property + * defineProperties(Bar.prototype, { + * prop : { + * get : function() { + * deprecationWarning('Bar.prop', 'Bar.prop was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newProp instead.'); + * // ... + * }, + * set : function(value) { + * deprecationWarning('Bar.prop', 'Bar.prop was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newProp instead.'); + * // ... + * } + * } + * }); + * + * @private + */ + function deprecationWarning(identifier, message) { + if (!defined(identifier) || !defined(message)) { + throw new DeveloperError('identifier and message are required.'); + } + + oneTimeWarning(identifier, message); + } + + return deprecationWarning; +}); + /*global define*/ define('Core/EncodedCartesian3',[ './Cartesian3', @@ -15484,6 +14964,7 @@ define('Core/IntersectionTests',[ './defaultValue', './defined', './DeveloperError', + './Interval', './Math', './Matrix3', './QuadraticRealPolynomial', @@ -15495,6 +14976,7 @@ define('Core/IntersectionTests',[ defaultValue, defined, DeveloperError, + Interval, CesiumMath, Matrix3, QuadraticRealPolynomial, @@ -15766,7 +15248,7 @@ define('Core/IntersectionTests',[ function raySphere(ray, sphere, result) { if (!defined(result)) { - result = {}; + result = new Interval(); } var origin = ray.origin; @@ -15797,8 +15279,8 @@ define('Core/IntersectionTests',[ * * @param {Ray} ray The ray. * @param {BoundingSphere} sphere The sphere. - * @param {Object} [result] The result onto which to store the result. - * @returns {Object} An object with the first (<code>start</code>) and the second (<code>stop</code>) intersection scalars for points along the ray or undefined if there are no intersections. + * @param {Interval} [result] The result onto which to store the result. + * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections. */ IntersectionTests.raySphere = function(ray, sphere, result) { if (!defined(ray)) { @@ -15826,8 +15308,8 @@ define('Core/IntersectionTests',[ * @param {Cartesian3} p0 An end point of the line segment. * @param {Cartesian3} p1 The other end point of the line segment. * @param {BoundingSphere} sphere The sphere. - * @param {Object} [result] The result onto which to store the result. - * @returns {Object} An object with the first (<code>start</code>) and the second (<code>stop</code>) intersection scalars for points along the line segment or undefined if there are no intersections. + * @param {Interval} [result] The result onto which to store the result. + * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections. */ IntersectionTests.lineSegmentSphere = function(p0, p1, sphere, result) { if (!defined(p0)) { @@ -15865,7 +15347,7 @@ define('Core/IntersectionTests',[ * * @param {Ray} ray The ray. * @param {Ellipsoid} ellipsoid The ellipsoid. - * @returns {Object} An object with the first (<code>start</code>) and the second (<code>stop</code>) intersection scalars for points along the ray or undefined if there are no intersections. + * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections. */ IntersectionTests.rayEllipsoid = function(ray, ellipsoid) { if (!defined(ray)) { @@ -15907,10 +15389,7 @@ define('Core/IntersectionTests',[ var root0 = temp / w2; var root1 = difference / temp; if (root0 < root1) { - return { - start : root0, - stop : root1 - }; + return new Interval(root0, root1); } return { @@ -15920,10 +15399,7 @@ define('Core/IntersectionTests',[ } else { // qw2 == product. Repeated roots (2 intersections). var root = Math.sqrt(difference / w2); - return { - start : root, - stop : root - }; + return new Interval(root, root); } } else if (q2 < 1.0) { // Inside ellipsoid (2 intersections). @@ -15933,19 +15409,13 @@ define('Core/IntersectionTests',[ discriminant = qw * qw - product; temp = -qw + Math.sqrt(discriminant); // Positively valued. - return { - start : 0.0, - stop : temp / w2 - }; + return new Interval(0.0, temp / w2); } else { // q2 == 1.0. On ellipsoid. if (qw < 0.0) { // Looking inward. w2 = Cartesian3.magnitudeSquared(w); - return { - start : 0.0, - stop : -qw / w2 - }; + return new Interval(0.0, -qw / w2); } // qw >= 0.0. Looking outward or tangent. @@ -16854,6 +16324,7 @@ define('Core/GeometryPipeline',[ './ComponentDatatype', './defaultValue', './defined', + './deprecationWarning', './DeveloperError', './EncodedCartesian3', './GeographicProjection', @@ -16880,6 +16351,7 @@ define('Core/GeometryPipeline',[ ComponentDatatype, defaultValue, defined, + deprecationWarning, DeveloperError, EncodedCartesian3, GeographicProjection, @@ -17013,7 +16485,7 @@ define('Core/GeometryPipeline',[ /** * Creates a new {@link Geometry} with <code>LINES</code> representing the provided * attribute (<code>attributeName</code>) for the provided geometry. This is used to - * visualize vector attributes like normals, binormals, and tangents. + * visualize vector attributes like normals, tangents, and bitangents. * * @param {Geometry} geometry The <code>Geometry</code> instance with the attribute. * @param {String} [attributeName='normal'] The name of the attribute. @@ -17023,7 +16495,7 @@ define('Core/GeometryPipeline',[ * @exception {DeveloperError} geometry.attributes must have an attribute with the same name as the attributeName parameter. * * @example - * var geometry = Cesium.GeometryPipeline.createLineSegmentsForVectors(instance.geometry, 'binormal', 100000.0); + * var geometry = Cesium.GeometryPipeline.createLineSegmentsForVectors(instance.geometry, 'bitangent', 100000.0); */ GeometryPipeline.createLineSegmentsForVectors = function(geometry, attributeName, length) { attributeName = defaultValue(attributeName, 'normal'); @@ -17115,8 +16587,11 @@ define('Core/GeometryPipeline',[ // From VertexFormat 'normal', 'st', - 'binormal', 'tangent', + 'bitangent', + + // For shadow volumes + 'extrudeDirection', // From compressing texture coordinates and normals 'compressedAttributes' @@ -17158,7 +16633,7 @@ define('Core/GeometryPipeline',[ * * @example * geometry = Cesium.GeometryPipeline.reorderForPreVertexCache(geometry); - * + * * @see GeometryPipeline.reorderForPostVertexCache */ GeometryPipeline.reorderForPreVertexCache = function(geometry) { @@ -17243,7 +16718,7 @@ define('Core/GeometryPipeline',[ * * @example * geometry = Cesium.GeometryPipeline.reorderForPostVertexCache(geometry); - * + * * @see GeometryPipeline.reorderForPreVertexCache * @see {@link http://gfx.cs.princ0eton.edu/pubs/Sander_2007_%3ETR/tipsy.pdf|Fast Triangle Reordering for Vertex Locality and Reduced Overdraw} * by Sander, Nehab, and Barczak @@ -17595,7 +17070,7 @@ define('Core/GeometryPipeline',[ * Transforms a geometry instance to world coordinates. This changes * the instance's <code>modelMatrix</code> to {@link Matrix4.IDENTITY} and transforms the * following attributes if they are present: <code>position</code>, <code>normal</code>, - * <code>binormal</code>, and <code>tangent</code>. + * <code>tangent</code>, and <code>bitangent</code>. * * @param {GeometryInstance} instance The geometry instance to modify. * @returns {GeometryInstance} The modified <code>instance</code> argument, with its attributes transforms to world coordinates. @@ -17623,16 +17098,16 @@ define('Core/GeometryPipeline',[ transformPoint(modelMatrix, attributes.nextPosition); if ((defined(attributes.normal)) || - (defined(attributes.binormal)) || - (defined(attributes.tangent))) { + (defined(attributes.tangent)) || + (defined(attributes.bitangent))) { Matrix4.inverse(modelMatrix, inverseTranspose); Matrix4.transpose(inverseTranspose, inverseTranspose); Matrix4.getRotation(inverseTranspose, normalMatrix); transformVector(normalMatrix, attributes.normal); - transformVector(normalMatrix, attributes.binormal); transformVector(normalMatrix, attributes.tangent); + transformVector(normalMatrix, attributes.bitangent); } var boundingSphere = instance.geometry.boundingSphere; @@ -17822,7 +17297,7 @@ define('Core/GeometryPipeline',[ * <p> * This is used by {@link Primitive} to efficiently render a large amount of static data. * </p> - * + * * @private * * @param {GeometryInstance[]} [instances] The array of {@link GeometryInstance} objects whose geometry will be combined. @@ -17838,7 +17313,7 @@ define('Core/GeometryPipeline',[ * Cesium.GeometryPipeline.transformToWorldCoordinates(instances[i]); * } * var geometries = Cesium.GeometryPipeline.combineInstances(instances); - * + * * @see GeometryPipeline.transformToWorldCoordinates */ GeometryPipeline.combineInstances = function(instances) { @@ -18014,8 +17489,8 @@ define('Core/GeometryPipeline',[ var tScratch = new Cartesian3(); /** - * Computes per-vertex binormals and tangents for a geometry containing <code>TRIANGLES</code>. - * The result is new <code>binormal</code> and <code>tangent</code> attributes added to the geometry. + * Computes per-vertex tangents and bitangents for a geometry containing <code>TRIANGLES</code>. + * The result is new <code>tangent</code> and <code>bitangent</code> attributes added to the geometry. * This assumes a counter-clockwise winding order. * <p> * Based on <a href="http://www.terathon.com/code/tangent.html">Computing Tangent Space Basis Vectors @@ -18023,15 +17498,15 @@ define('Core/GeometryPipeline',[ * </p> * * @param {Geometry} geometry The geometry to modify. - * @returns {Geometry} The modified <code>geometry</code> argument with the computed <code>binormal</code> and <code>tangent</code> attributes. + * @returns {Geometry} The modified <code>geometry</code> argument with the computed <code>tangent</code> and <code>bitangent</code> attributes. * * @exception {DeveloperError} geometry.indices length must be greater than 0 and be a multiple of 3. * @exception {DeveloperError} geometry.primitiveType must be {@link PrimitiveType.TRIANGLES}. * * @example - * Cesium.GeometryPipeline.computeBinormalAndTangent(geometry); + * Cesium.GeometryPipeline.computeTangentAndBiTangent(geometry); */ - GeometryPipeline.computeBinormalAndTangent = function(geometry) { + GeometryPipeline.computeTangentAndBitangent = function(geometry) { if (!defined(geometry)) { throw new DeveloperError('geometry is required.'); } @@ -18111,8 +17586,8 @@ define('Core/GeometryPipeline',[ tan1[i23 + 2] += sdirz; } - var binormalValues = new Float32Array(numVertices * 3); var tangentValues = new Float32Array(numVertices * 3); + var bitangentValues = new Float32Array(numVertices * 3); for (i = 0; i < numVertices; i++) { i03 = i * 3; @@ -18131,9 +17606,9 @@ define('Core/GeometryPipeline',[ Cartesian3.normalize(Cartesian3.cross(n, t, t), t); - binormalValues[i03] = t.x; - binormalValues[i13] = t.y; - binormalValues[i23] = t.z; + bitangentValues[i03] = t.x; + bitangentValues[i13] = t.y; + bitangentValues[i23] = t.z; } geometry.attributes.tangent = new GeometryAttribute({ @@ -18142,20 +17617,48 @@ define('Core/GeometryPipeline',[ values : tangentValues }); - geometry.attributes.binormal = new GeometryAttribute({ + geometry.attributes.bitangent = new GeometryAttribute({ componentDatatype : ComponentDatatype.FLOAT, componentsPerAttribute : 3, - values : binormalValues + values : bitangentValues }); return geometry; }; + /** + * Computes per-vertex binormal and tangents for a geometry containing <code>TRIANGLES</code>. + * The result is new <code>binormal</code> and <code>tangent</code> attributes added to the geometry. + * This assumes a counter-clockwise winding order. + * <p> + * Based on <a href="http://www.terathon.com/code/tangent.html">Computing Tangent Space Basis Vectors + * for an Arbitrary Mesh</a> by Eric Lengyel. + * </p> + * + * @param {Geometry} geometry The geometry to modify. + * @returns {Geometry} The modified <code>geometry</code> argument with the computed <code>binormal</code> and <code>tangent</code> attributes. + * + * @exception {DeveloperError} geometry.indices length must be greater than 0 and be a multiple of 3. + * @exception {DeveloperError} geometry.primitiveType must be {@link PrimitiveType.TRIANGLES}. + * + * @example + * Cesium.GeometryPipeline.computeBinormalAndTangent(geometry); + * + * @see GeometryPipeline.computeTangentAndBitangent + */ + GeometryPipeline.computeBinormalAndTangent = function(geometry) { + deprecationWarning('computeBinormalAndTangent', 'computeBinormalAndTangent was deprecated in 1.30. It will be removed in 1.31. Use a computeTangentAndBitangent.'); + GeometryPipeline.computeTangentAndBitangent(geometry); + geometry.attributes.binormal = geometry.attributes.bitangent; + + return geometry; + }; + var scratchCartesian2 = new Cartesian2(); var toEncode1 = new Cartesian3(); var toEncode2 = new Cartesian3(); var toEncode3 = new Cartesian3(); - + var encodeResult2 = new Cartesian2(); /** * Compresses and packs geometry normal attribute values to save memory. * @@ -18170,73 +17673,109 @@ define('Core/GeometryPipeline',[ throw new DeveloperError('geometry is required.'); } + var extrudeAttribute = geometry.attributes.extrudeDirection; + var i; + var numVertices; + if (defined(extrudeAttribute)) { + //only shadow volumes use extrudeDirection, and shadow volumes use vertexFormat: POSITION_ONLY so we don't need to check other attributes + var extrudeDirections = extrudeAttribute.values; + numVertices = extrudeDirections.length / 3.0; + var compressedDirections = new Float32Array(numVertices * 2); + + var i2 = 0; + for (i = 0; i < numVertices; ++i) { + Cartesian3.fromArray(extrudeDirections, i * 3.0, toEncode1); + if (Cartesian3.equals(toEncode1, Cartesian3.ZERO)) { + i2 += 2; + continue; + } + encodeResult2 = AttributeCompression.octEncodeInRange(toEncode1, 65535, encodeResult2); + compressedDirections[i2++] = encodeResult2.x; + compressedDirections[i2++] = encodeResult2.y; + } + + geometry.attributes.compressedAttributes = new GeometryAttribute({ + componentDatatype : ComponentDatatype.FLOAT, + componentsPerAttribute : 2, + values : compressedDirections + }); + delete geometry.attributes.extrudeDirection; + return geometry; + } + var normalAttribute = geometry.attributes.normal; var stAttribute = geometry.attributes.st; - if (!defined(normalAttribute) && !defined(stAttribute)) { + + var hasNormal = defined(normalAttribute); + var hasSt = defined(stAttribute); + if (!hasNormal && !hasSt) { return geometry; } var tangentAttribute = geometry.attributes.tangent; - var binormalAttribute = geometry.attributes.binormal; + var bitangentAttribute = geometry.attributes.bitangent; + + var hasTangent = defined(tangentAttribute); + var hasBitangent = defined(bitangentAttribute); var normals; var st; var tangents; - var binormals; + var bitangents; - if (defined(normalAttribute)) { + if (hasNormal) { normals = normalAttribute.values; } - if (defined(stAttribute)) { + if (hasSt) { st = stAttribute.values; } - if (defined(tangentAttribute)) { + if (hasTangent) { tangents = tangentAttribute.values; } - if (binormalAttribute) { - binormals = binormalAttribute.values; + if (hasBitangent) { + bitangents = bitangentAttribute.values; } - var length = defined(normals) ? normals.length : st.length; - var numComponents = defined(normals) ? 3.0 : 2.0; - var numVertices = length / numComponents; + var length = hasNormal ? normals.length : st.length; + var numComponents = hasNormal ? 3.0 : 2.0; + numVertices = length / numComponents; var compressedLength = numVertices; - var numCompressedComponents = defined(st) && defined(normals) ? 2.0 : 1.0; - numCompressedComponents += defined(tangents) || defined(binormals) ? 1.0 : 0.0; + var numCompressedComponents = hasSt && hasNormal ? 2.0 : 1.0; + numCompressedComponents += hasTangent || hasBitangent ? 1.0 : 0.0; compressedLength *= numCompressedComponents; var compressedAttributes = new Float32Array(compressedLength); var normalIndex = 0; - for (var i = 0; i < numVertices; ++i) { - if (defined(st)) { + for (i = 0; i < numVertices; ++i) { + if (hasSt) { Cartesian2.fromArray(st, i * 2.0, scratchCartesian2); compressedAttributes[normalIndex++] = AttributeCompression.compressTextureCoordinates(scratchCartesian2); } var index = i * 3.0; - if (defined(normals) && defined(tangents) && defined(binormals)) { + if (hasNormal && defined(tangents) && defined(bitangents)) { Cartesian3.fromArray(normals, index, toEncode1); Cartesian3.fromArray(tangents, index, toEncode2); - Cartesian3.fromArray(binormals, index, toEncode3); + Cartesian3.fromArray(bitangents, index, toEncode3); AttributeCompression.octPack(toEncode1, toEncode2, toEncode3, scratchCartesian2); compressedAttributes[normalIndex++] = scratchCartesian2.x; compressedAttributes[normalIndex++] = scratchCartesian2.y; } else { - if (defined(normals)) { + if (hasNormal) { Cartesian3.fromArray(normals, index, toEncode1); compressedAttributes[normalIndex++] = AttributeCompression.octEncodeFloat(toEncode1); } - if (defined(tangents)) { + if (hasTangent) { Cartesian3.fromArray(tangents, index, toEncode1); compressedAttributes[normalIndex++] = AttributeCompression.octEncodeFloat(toEncode1); } - if (defined(binormals)) { - Cartesian3.fromArray(binormals, index, toEncode1); + if (hasBitangent) { + Cartesian3.fromArray(bitangents, index, toEncode1); compressedAttributes[normalIndex++] = AttributeCompression.octEncodeFloat(toEncode1); } } @@ -18248,17 +17787,17 @@ define('Core/GeometryPipeline',[ values : compressedAttributes }); - if (defined(normals)) { + if (hasNormal) { delete geometry.attributes.normal; } - if (defined(st)) { + if (hasSt) { delete geometry.attributes.st; } - if (defined(tangents)) { - delete geometry.attributes.tangent; + if (hasBitangent) { + delete geometry.attributes.bitangent; } - if (defined(binormals)) { - delete geometry.attributes.binormal; + if (hasTangent) { + delete geometry.attributes.tangent; } return geometry; @@ -18675,8 +18214,8 @@ define('Core/GeometryPipeline',[ var s1Scratch = new Cartesian2(); var s2Scratch = new Cartesian2(); - function computeTriangleAttributes(i0, i1, i2, point, positions, normals, binormals, tangents, texCoords, currentAttributes, insertedIndex) { - if (!defined(normals) && !defined(binormals) && !defined(tangents) && !defined(texCoords)) { + function computeTriangleAttributes(i0, i1, i2, point, positions, normals, tangents, bitangents, texCoords, extrudeDirections, currentAttributes, insertedIndex) { + if (!defined(normals) && !defined(tangents) && !defined(bitangents) && !defined(texCoords) && !defined(extrudeDirections)) { return; } @@ -18701,20 +18240,27 @@ define('Core/GeometryPipeline',[ Cartesian3.pack(normal, currentAttributes.normal.values, insertedIndex * 3); } - if (defined(binormals)) { - var b0 = Cartesian3.fromArray(binormals, i0 * 3, p0Scratch); - var b1 = Cartesian3.fromArray(binormals, i1 * 3, p1Scratch); - var b2 = Cartesian3.fromArray(binormals, i2 * 3, p2Scratch); - - Cartesian3.multiplyByScalar(b0, coords.x, b0); - Cartesian3.multiplyByScalar(b1, coords.y, b1); - Cartesian3.multiplyByScalar(b2, coords.z, b2); + if (defined(extrudeDirections)) { + var d0 = Cartesian3.fromArray(extrudeDirections, i0 * 3, p0Scratch); + var d1 = Cartesian3.fromArray(extrudeDirections, i1 * 3, p1Scratch); + var d2 = Cartesian3.fromArray(extrudeDirections, i2 * 3, p2Scratch); - var binormal = Cartesian3.add(b0, b1, b0); - Cartesian3.add(binormal, b2, binormal); - Cartesian3.normalize(binormal, binormal); + Cartesian3.multiplyByScalar(d0, coords.x, d0); + Cartesian3.multiplyByScalar(d1, coords.y, d1); + Cartesian3.multiplyByScalar(d2, coords.z, d2); - Cartesian3.pack(binormal, currentAttributes.binormal.values, insertedIndex * 3); + var direction; + if (!Cartesian3.equals(d0, Cartesian3.ZERO) || !Cartesian3.equals(d1, Cartesian3.ZERO) || !Cartesian3.equals(d2, Cartesian3.ZERO)) { + direction = Cartesian3.add(d0, d1, d0); + Cartesian3.add(direction, d2, direction); + Cartesian3.normalize(direction, direction); + } else { + direction = p0Scratch; + direction.x = 0; + direction.y = 0; + direction.z = 0; + } + Cartesian3.pack(direction, currentAttributes.extrudeDirection.values, insertedIndex * 3); } if (defined(tangents)) { @@ -18733,6 +18279,22 @@ define('Core/GeometryPipeline',[ Cartesian3.pack(tangent, currentAttributes.tangent.values, insertedIndex * 3); } + if (defined(bitangents)) { + var b0 = Cartesian3.fromArray(bitangents, i0 * 3, p0Scratch); + var b1 = Cartesian3.fromArray(bitangents, i1 * 3, p1Scratch); + var b2 = Cartesian3.fromArray(bitangents, i2 * 3, p2Scratch); + + Cartesian3.multiplyByScalar(b0, coords.x, b0); + Cartesian3.multiplyByScalar(b1, coords.y, b1); + Cartesian3.multiplyByScalar(b2, coords.z, b2); + + var bitangent = Cartesian3.add(b0, b1, b0); + Cartesian3.add(bitangent, b2, bitangent); + Cartesian3.normalize(bitangent, bitangent); + + Cartesian3.pack(bitangent, currentAttributes.bitangent.values, insertedIndex * 3); + } + if (defined(texCoords)) { var s0 = Cartesian2.fromArray(texCoords, i0 * 2, s0Scratch); var s1 = Cartesian2.fromArray(texCoords, i1 * 2, s1Scratch); @@ -18777,9 +18339,10 @@ define('Core/GeometryPipeline',[ var attributes = geometry.attributes; var positions = attributes.position.values; var normals = (defined(attributes.normal)) ? attributes.normal.values : undefined; - var binormals = (defined(attributes.binormal)) ? attributes.binormal.values : undefined; + var bitangents = (defined(attributes.bitangent)) ? attributes.bitangent.values : undefined; var tangents = (defined(attributes.tangent)) ? attributes.tangent.values : undefined; var texCoords = (defined(attributes.st)) ? attributes.st.values : undefined; + var extrudeDirections = (defined(attributes.extrudeDirection)) ? attributes.extrudeDirection.values : undefined; var indices = geometry.indices; var eastGeometry = copyGeometryForSplit(geometry); @@ -18833,7 +18396,7 @@ define('Core/GeometryPipeline',[ } insertedIndex = insertSplitPoint(currentAttributes, currentIndices, currentIndexMap, indices, resultIndex < 3 ? i + resultIndex : -1, point); - computeTriangleAttributes(i0, i1, i2, point, positions, normals, binormals, tangents, texCoords, currentAttributes, insertedIndex); + computeTriangleAttributes(i0, i1, i2, point, positions, normals, tangents, bitangents, texCoords, extrudeDirections, currentAttributes, insertedIndex); } } else { if (defined(result)) { @@ -18853,13 +18416,13 @@ define('Core/GeometryPipeline',[ } insertedIndex = insertSplitPoint(currentAttributes, currentIndices, currentIndexMap, indices, i, p0); - computeTriangleAttributes(i0, i1, i2, p0, positions, normals, binormals, tangents, texCoords, currentAttributes, insertedIndex); + computeTriangleAttributes(i0, i1, i2, p0, positions, normals, tangents, bitangents, texCoords, extrudeDirections, currentAttributes, insertedIndex); insertedIndex = insertSplitPoint(currentAttributes, currentIndices, currentIndexMap, indices, i + 1, p1); - computeTriangleAttributes(i0, i1, i2, p1, positions, normals, binormals, tangents, texCoords, currentAttributes, insertedIndex); + computeTriangleAttributes(i0, i1, i2, p1, positions, normals, tangents, bitangents, texCoords, extrudeDirections, currentAttributes, insertedIndex); insertedIndex = insertSplitPoint(currentAttributes, currentIndices, currentIndexMap, indices, i + 2, p2); - computeTriangleAttributes(i0, i1, i2, p2, positions, normals, binormals, tangents, texCoords, currentAttributes, insertedIndex); + computeTriangleAttributes(i0, i1, i2, p2, positions, normals, tangents, bitangents, texCoords, extrudeDirections, currentAttributes, insertedIndex); } } @@ -19290,6 +18853,7 @@ define('Core/GeometryPipeline',[ /*global define*/ define('Core/Matrix2',[ './Cartesian2', + './Check', './defaultValue', './defined', './defineProperties', @@ -19297,6 +18861,7 @@ define('Core/Matrix2',[ './freezeObject' ], function( Cartesian2, + Check, defaultValue, defined, defineProperties, @@ -19345,13 +18910,8 @@ define('Core/Matrix2',[ * @returns {Number[]} The array that was packed into */ Matrix2.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -19372,9 +18932,7 @@ define('Core/Matrix2',[ * @returns {Matrix2} The modified result parameter or a new Matrix2 instance if one was not provided. */ Matrix2.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -19396,18 +18954,18 @@ define('Core/Matrix2',[ * @param {Matrix2} [result] The object onto which to store the result. * @returns {Matrix2} The modified result parameter or a new Matrix2 instance if one was not provided. (Returns undefined if matrix is undefined) */ - Matrix2.clone = function(values, result) { - if (!defined(values)) { + Matrix2.clone = function(matrix, result) { + if (!defined(matrix)) { return undefined; } if (!defined(result)) { - return new Matrix2(values[0], values[2], - values[1], values[3]); + return new Matrix2(matrix[0], matrix[2], + matrix[1], matrix[3]); } - result[0] = values[0]; - result[1] = values[1]; - result[2] = values[2]; - result[3] = values[3]; + result[0] = matrix[0]; + result[1] = matrix[1]; + result[2] = matrix[2]; + result[3] = matrix[3]; return result; }; @@ -19432,9 +18990,7 @@ define('Core/Matrix2',[ * var m2 = Cesium.Matrix2.fromArray(v2, 2); */ Matrix2.fromArray = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -19457,9 +19013,7 @@ define('Core/Matrix2',[ * @returns {Matrix2} The modified result parameter, or a new Matrix2 instance if one was not provided. */ Matrix2.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values parameter is required'); - } + Check.defined('values', values); return Matrix2.clone(values, result); }; @@ -19473,9 +19027,7 @@ define('Core/Matrix2',[ * @returns {Matrix2} The modified result parameter, or a new Matrix2 instance if one was not provided. */ Matrix2.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix2(values[0], values[1], @@ -19502,9 +19054,7 @@ define('Core/Matrix2',[ * var m = Cesium.Matrix2.fromScale(new Cesium.Cartesian2(7.0, 8.0)); */ Matrix2.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix2( @@ -19533,9 +19083,7 @@ define('Core/Matrix2',[ * var m = Cesium.Matrix2.fromUniformScale(2.0); */ Matrix2.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix2( @@ -19564,9 +19112,7 @@ define('Core/Matrix2',[ * var rotated = Cesium.Matrix2.multiplyByVector(m, p, new Cesium.Cartesian2()); */ Matrix2.fromRotation = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -19592,9 +19138,7 @@ define('Core/Matrix2',[ * @returns {Number[]} The modified Array parameter or a new Array instance if one was not provided. */ Matrix2.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3]]; @@ -19623,12 +19167,11 @@ define('Core/Matrix2',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix2.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 1) { - throw new DeveloperError('row must be 0 or 1.'); - } - if (typeof column !== 'number' || column < 0 || column > 1) { - throw new DeveloperError('column must be 0 or 1.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 1); + + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 1); return column * 2 + row; }; @@ -19644,15 +19187,12 @@ define('Core/Matrix2',[ * @exception {DeveloperError} index must be 0 or 1. */ Matrix2.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (typeof index !== 'number' || index < 0 || index > 1) { - throw new DeveloperError('index must be 0 or 1.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 1); + + Check.typeOf.object('result', result); var startIndex = index * 2; var x = matrix[startIndex]; @@ -19675,18 +19215,13 @@ define('Core/Matrix2',[ * @exception {DeveloperError} index must be 0 or 1. */ Matrix2.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 1) { - throw new DeveloperError('index must be 0 or 1.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 1); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix2.clone(matrix, result); var startIndex = index * 2; @@ -19706,15 +19241,12 @@ define('Core/Matrix2',[ * @exception {DeveloperError} index must be 0 or 1. */ Matrix2.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (typeof index !== 'number' || index < 0 || index > 1) { - throw new DeveloperError('index must be 0 or 1.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 1); + + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 2]; @@ -19736,18 +19268,13 @@ define('Core/Matrix2',[ * @exception {DeveloperError} index must be 0 or 1. */ Matrix2.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 1) { - throw new DeveloperError('index must be 0 or 1.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 1); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix2.clone(matrix, result); result[index] = cartesian.x; @@ -19765,12 +19292,8 @@ define('Core/Matrix2',[ * @returns {Cartesian2} The modified result parameter. */ Matrix2.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian2.magnitude(Cartesian2.fromElements(matrix[0], matrix[1], scratchColumn)); result.y = Cartesian2.magnitude(Cartesian2.fromElements(matrix[2], matrix[3], scratchColumn)); @@ -19800,15 +19323,9 @@ define('Core/Matrix2',[ * @returns {Matrix2} The modified result parameter. */ Matrix2.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var column0Row0 = left[0] * right[0] + left[2] * right[1]; var column1Row0 = left[0] * right[2] + left[2] * right[3]; @@ -19831,15 +19348,9 @@ define('Core/Matrix2',[ * @returns {Matrix2} The modified result parameter. */ Matrix2.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -19857,15 +19368,9 @@ define('Core/Matrix2',[ * @returns {Matrix2} The modified result parameter. */ Matrix2.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -19883,15 +19388,9 @@ define('Core/Matrix2',[ * @returns {Cartesian2} The modified result parameter. */ Matrix2.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var x = matrix[0] * cartesian.x + matrix[2] * cartesian.y; var y = matrix[1] * cartesian.x + matrix[3] * cartesian.y; @@ -19910,15 +19409,9 @@ define('Core/Matrix2',[ * @returns {Matrix2} The modified result parameter. */ Matrix2.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -19944,15 +19437,9 @@ define('Core/Matrix2',[ * @see Matrix2.multiplyByUniformScale */ Matrix2.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); result[0] = matrix[0] * scale.x; result[1] = matrix[1] * scale.x; @@ -19969,12 +19456,8 @@ define('Core/Matrix2',[ * @returns {Matrix2} The modified result parameter. */ Matrix2.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -19991,12 +19474,8 @@ define('Core/Matrix2',[ * @returns {Matrix2} The modified result parameter. */ Matrix2.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var column0Row0 = matrix[0]; var column0Row1 = matrix[2]; @@ -20018,12 +19497,8 @@ define('Core/Matrix2',[ * @returns {Matrix2} The modified result parameter. */ Matrix2.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -20072,9 +19547,7 @@ define('Core/Matrix2',[ * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. */ Matrix2.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -21196,6 +20669,7 @@ define('Core/PolygonPipeline',[ /*global define*/ define('Core/Quaternion',[ './Cartesian3', + './Check', './defaultValue', './defined', './DeveloperError', @@ -21205,6 +20679,7 @@ define('Core/Quaternion',[ './Matrix3' ], function( Cartesian3, + Check, defaultValue, defined, DeveloperError, @@ -21267,12 +20742,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided. */ Quaternion.fromAxisAngle = function(axis, angle, result) { - if (!defined(axis)) { - throw new DeveloperError('axis is required.'); - } - if (typeof angle !== 'number') { - throw new DeveloperError('angle is required and must be a number.'); - } + Check.typeOf.object('axis', axis); + Check.typeOf.number('angle', angle); var halfAngle = angle / 2.0; var s = Math.sin(halfAngle); @@ -21304,9 +20775,7 @@ define('Core/Quaternion',[ * @see Matrix3.fromQuaternion */ Quaternion.fromRotationMatrix = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); var root; var x; @@ -21380,15 +20849,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter or a new Quaternion instance if none was provided. */ Quaternion.fromHeadingPitchRoll = function(heading, pitch, roll, result) { - if (!defined(heading)) { - throw new DeveloperError('heading is required.'); - } - if (!defined(pitch)) { - throw new DeveloperError('pitch is required.'); - } - if (!defined(roll)) { - throw new DeveloperError('roll is required.'); - } + Check.typeOf.number('heading', heading); + Check.typeOf.number('pitch', pitch); + Check.typeOf.number('roll', roll); var rollQuaternion = Quaternion.fromAxisAngle(Cartesian3.UNIT_X, roll, scratchHPRQuaternion); var pitchQuaternion = Quaternion.fromAxisAngle(Cartesian3.UNIT_Y, -pitch, result); @@ -21419,13 +20882,8 @@ define('Core/Quaternion',[ * @returns {Number[]} The array that was packed into */ Quaternion.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -21446,9 +20904,7 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided. */ Quaternion.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -21503,7 +20959,7 @@ define('Core/Quaternion',[ * * @param {Number[]} array The array previously packed for interpolation. * @param {Number[]} sourceArray The original packed array. - * @param {Number} [startingIndex=0] The startingIndex used to convert the array. + * @param {Number} [firstIndex=0] The firstIndex used to convert the array. * @param {Number} [lastIndex=packedArray.length] The lastIndex used to convert the array. * @param {Quaternion} [result] The object into which to store the result. * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided. @@ -21557,12 +21013,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.conjugate = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); result.x = -quaternion.x; result.y = -quaternion.y; @@ -21578,9 +21030,7 @@ define('Core/Quaternion',[ * @returns {Number} The magnitude squared. */ Quaternion.magnitudeSquared = function(quaternion) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); return quaternion.x * quaternion.x + quaternion.y * quaternion.y + quaternion.z * quaternion.z + quaternion.w * quaternion.w; }; @@ -21603,9 +21053,7 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.normalize = function(quaternion, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); var inverseMagnitude = 1.0 / Quaternion.magnitude(quaternion); var x = quaternion.x * inverseMagnitude; @@ -21628,9 +21076,7 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.inverse = function(quaternion, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); var magnitudeSquared = Quaternion.magnitudeSquared(quaternion); result = Quaternion.conjugate(quaternion, result); @@ -21646,15 +21092,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -21672,15 +21112,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -21697,12 +21131,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.negate = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); result.x = -quaternion.x; result.y = -quaternion.y; @@ -21719,12 +21149,8 @@ define('Core/Quaternion',[ * @returns {Number} The dot product. */ Quaternion.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w; }; @@ -21738,15 +21164,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var leftX = left.x; var leftY = left.y; @@ -21779,15 +21199,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.multiplyByScalar = function(quaternion, scalar, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = quaternion.x * scalar; result.y = quaternion.y * scalar; @@ -21805,15 +21219,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.divideByScalar = function(quaternion, scalar, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = quaternion.x / scalar; result.y = quaternion.y / scalar; @@ -21830,12 +21238,8 @@ define('Core/Quaternion',[ * @returns {Cartesian3} The modified result parameter. */ Quaternion.computeAxis = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); var w = quaternion.w; if (Math.abs(w - 1.0) < CesiumMath.EPSILON6) { @@ -21858,9 +21262,7 @@ define('Core/Quaternion',[ * @returns {Number} The angle of rotation. */ Quaternion.computeAngle = function(quaternion) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); if (Math.abs(quaternion.w - 1.0) < CesiumMath.EPSILON6) { return 0.0; @@ -21879,18 +21281,10 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); lerpScratch = Quaternion.multiplyByScalar(end, t, lerpScratch); result = Quaternion.multiplyByScalar(start, 1.0 - t, result); @@ -21912,18 +21306,10 @@ define('Core/Quaternion',[ * @see Quaternion#fastSlerp */ Quaternion.slerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var dot = Quaternion.dot(start, end); @@ -21956,12 +21342,8 @@ define('Core/Quaternion',[ * @returns {Cartesian3} The modified result parameter. */ Quaternion.log = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); var theta = CesiumMath.acosClamped(quaternion.w); var thetaOverSinTheta = 0.0; @@ -21981,12 +21363,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.exp = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var theta = Cartesian3.magnitude(cartesian); var sinThetaOverTheta = 0.0; @@ -22021,12 +21399,10 @@ define('Core/Quaternion',[ * @see Quaternion#squad */ Quaternion.computeInnerQuadrangle = function(q0, q1, q2, result) { - if (!defined(q0) || !defined(q1) || !defined(q2)) { - throw new DeveloperError('q0, q1, and q2 are required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('q0', q0); + Check.typeOf.object('q1', q1); + Check.typeOf.object('q2', q2); + Check.typeOf.object('result', result); var qInv = Quaternion.conjugate(q1, squadScratchQuaternion0); Quaternion.multiply(qInv, q2, squadScratchQuaternion1); @@ -22068,15 +21444,12 @@ define('Core/Quaternion',[ * @see Quaternion#computeInnerQuadrangle */ Quaternion.squad = function(q0, q1, s0, s1, t, result) { - if (!defined(q0) || !defined(q1) || !defined(s0) || !defined(s1)) { - throw new DeveloperError('q0, q1, s0, and s1 are required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('q0', q0); + Check.typeOf.object('q1', q1); + Check.typeOf.object('s0', s0); + Check.typeOf.object('s1', s1); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var slerp0 = Quaternion.slerp(q0, q1, t, squadScratchQuaternion0); var slerp1 = Quaternion.slerp(s0, s1, t, squadScratchQuaternion1); @@ -22113,18 +21486,10 @@ define('Core/Quaternion',[ * @see Quaternion#slerp */ Quaternion.fastSlerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var x = Quaternion.dot(start, end); @@ -22173,15 +21538,12 @@ define('Core/Quaternion',[ * @see Quaternion#squad */ Quaternion.fastSquad = function(q0, q1, s0, s1, t, result) { - if (!defined(q0) || !defined(q1) || !defined(s0) || !defined(s1)) { - throw new DeveloperError('q0, q1, s0, and s1 are required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('q0', q0); + Check.typeOf.object('q1', q1); + Check.typeOf.object('s0', s0); + Check.typeOf.object('s1', s1); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var slerp0 = Quaternion.fastSlerp(q0, q1, t, squadScratchQuaternion0); var slerp1 = Quaternion.fastSlerp(s0, s1, t, squadScratchQuaternion1); @@ -22217,9 +21579,7 @@ define('Core/Quaternion',[ * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. */ Quaternion.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon is required and must be a number.'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || ((defined(left)) && @@ -22598,7 +21958,7 @@ define('Core/VertexFormat',[ this.st = defaultValue(options.st, false); /** - * When <code>true</code>, the vertex has a binormal attribute (normalized), which is used for tangent-space effects like bump mapping. + * When <code>true</code>, the vertex has a bitangent attribute (normalized), which is used for tangent-space effects like bump mapping. * <p> * 32-bit floating-point. 3 components per attribute. * </p> @@ -22607,7 +21967,7 @@ define('Core/VertexFormat',[ * * @default false */ - this.binormal = defaultValue(options.binormal, false); + this.bitangent = defaultValue(options.bitangent, false); /** * When <code>true</code>, the vertex has a tangent attribute (normalized), which is used for tangent-space effects like bump mapping. @@ -22709,7 +22069,7 @@ define('Core/VertexFormat',[ })); /** - * An immutable vertex format with well-known attributes: position, normal, st, binormal, and tangent. + * An immutable vertex format with well-known attributes: position, normal, st, tangent, and bitangent. * * @type {VertexFormat} * @constant @@ -22717,15 +22077,15 @@ define('Core/VertexFormat',[ * @see VertexFormat#position * @see VertexFormat#normal * @see VertexFormat#st - * @see VertexFormat#binormal * @see VertexFormat#tangent + * @see VertexFormat#bitangent */ VertexFormat.ALL = freezeObject(new VertexFormat({ position : true, normal : true, st : true, - binormal : true, - tangent : true + tangent : true, + bitangent : true })); /** @@ -22770,8 +22130,8 @@ define('Core/VertexFormat',[ array[startingIndex++] = value.position ? 1.0 : 0.0; array[startingIndex++] = value.normal ? 1.0 : 0.0; array[startingIndex++] = value.st ? 1.0 : 0.0; - array[startingIndex++] = value.binormal ? 1.0 : 0.0; array[startingIndex++] = value.tangent ? 1.0 : 0.0; + array[startingIndex++] = value.bitangent ? 1.0 : 0.0; array[startingIndex++] = value.color ? 1.0 : 0.0; return array; @@ -22796,19 +22156,19 @@ define('Core/VertexFormat',[ result = new VertexFormat(); } - result.position = array[startingIndex++] === 1.0; - result.normal = array[startingIndex++] === 1.0; - result.st = array[startingIndex++] === 1.0; - result.binormal = array[startingIndex++] === 1.0; - result.tangent = array[startingIndex++] === 1.0; - result.color = array[startingIndex++] === 1.0; + result.position = array[startingIndex++] === 1.0; + result.normal = array[startingIndex++] === 1.0; + result.st = array[startingIndex++] === 1.0; + result.tangent = array[startingIndex++] === 1.0; + result.bitangent = array[startingIndex++] === 1.0; + result.color = array[startingIndex++] === 1.0; return result; }; /** * Duplicates a VertexFormat instance. * - * @param {VertexFormat} cartesian The vertex format to duplicate. + * @param {VertexFormat} vertexFormat The vertex format to duplicate. * @param {VertexFormat} [result] The object onto which to store the result. * @returns {VertexFormat} The modified result parameter or a new VertexFormat instance if one was not provided. (Returns undefined if vertexFormat is undefined) */ @@ -22823,8 +22183,8 @@ define('Core/VertexFormat',[ result.position = vertexFormat.position; result.normal = vertexFormat.normal; result.st = vertexFormat.st; - result.binormal = vertexFormat.binormal; result.tangent = vertexFormat.tangent; + result.bitangent = vertexFormat.bitangent; result.color = vertexFormat.color; return result; }; @@ -22838,6 +22198,7 @@ define('Core/RectangleGeometry',[ './Cartesian2', './Cartesian3', './Cartographic', + './Check', './ComponentDatatype', './defaultValue', './defined', @@ -22864,6 +22225,7 @@ define('Core/RectangleGeometry',[ Cartesian2, Cartesian3, Cartographic, + Check, ComponentDatatype, defaultValue, defined, @@ -22890,7 +22252,7 @@ define('Core/RectangleGeometry',[ var positionScratch = new Cartesian3(); var normalScratch = new Cartesian3(); var tangentScratch = new Cartesian3(); - var binormalScratch = new Cartesian3(); + var bitangentScratch = new Cartesian3(); var rectangleScratch = new Rectangle(); var stScratch = new Cartesian2(); var bottomBoundingSphere = new BoundingSphere(); @@ -22921,11 +22283,11 @@ define('Core/RectangleGeometry',[ values : attributes.tangents }); } - if (vertexFormat.binormal) { - geo.attributes.binormal = new GeometryAttribute({ + if (vertexFormat.bitangent) { + geo.attributes.bitangent = new GeometryAttribute({ componentDatatype : ComponentDatatype.FLOAT, componentsPerAttribute : 3, - values : attributes.binormals + values : attributes.bitangents }); } return geo; @@ -22936,10 +22298,10 @@ define('Core/RectangleGeometry',[ var normals = (vertexFormat.normal) ? new Float32Array(length) : undefined; var tangents = (vertexFormat.tangent) ? new Float32Array(length) : undefined; - var binormals = (vertexFormat.binormal) ? new Float32Array(length) : undefined; + var bitangents = (vertexFormat.bitangent) ? new Float32Array(length) : undefined; var attrIndex = 0; - var binormal = binormalScratch; + var bitangent = bitangentScratch; var tangent = tangentScratch; var normal = normalScratch; for (var i = 0; i < length; i += 3) { @@ -22947,15 +22309,15 @@ define('Core/RectangleGeometry',[ var attrIndex1 = attrIndex + 1; var attrIndex2 = attrIndex + 2; - if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.binormal) { + if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent) { normal = ellipsoid.geodeticSurfaceNormal(p, normal); - if (vertexFormat.tangent || vertexFormat.binormal) { + if (vertexFormat.tangent || vertexFormat.bitangent) { Cartesian3.cross(Cartesian3.UNIT_Z, normal, tangent); Matrix3.multiplyByVector(tangentRotationMatrix, tangent, tangent); Cartesian3.normalize(tangent, tangent); - if (vertexFormat.binormal) { - Cartesian3.normalize(Cartesian3.cross(normal, tangent, binormal), binormal); + if (vertexFormat.bitangent) { + Cartesian3.normalize(Cartesian3.cross(normal, tangent, bitangent), bitangent); } } @@ -22969,10 +22331,10 @@ define('Core/RectangleGeometry',[ tangents[attrIndex1] = tangent.y; tangents[attrIndex2] = tangent.z; } - if (vertexFormat.binormal) { - binormals[attrIndex] = binormal.x; - binormals[attrIndex1] = binormal.y; - binormals[attrIndex2] = binormal.z; + if (vertexFormat.bitangent) { + bitangents[attrIndex] = bitangent.x; + bitangents[attrIndex1] = bitangent.y; + bitangents[attrIndex2] = bitangent.z; } } attrIndex += 3; @@ -22981,7 +22343,7 @@ define('Core/RectangleGeometry',[ positions : positions, normals : normals, tangents : tangents, - binormals : binormals + bitangents : bitangents }); } @@ -22992,20 +22354,20 @@ define('Core/RectangleGeometry',[ var normals = (vertexFormat.normal) ? new Float32Array(length) : undefined; var tangents = (vertexFormat.tangent) ? new Float32Array(length) : undefined; - var binormals = (vertexFormat.binormal) ? new Float32Array(length) : undefined; + var bitangents = (vertexFormat.bitangent) ? new Float32Array(length) : undefined; var normalIndex = 0; var tangentIndex = 0; - var binormalIndex = 0; + var bitangentIndex = 0; var recomputeNormal = true; - var binormal = binormalScratch; + var bitangent = bitangentScratch; var tangent = tangentScratch; var normal = normalScratch; for (var i = 0; i < length; i += 6) { var p = Cartesian3.fromArray(positions, i, positionScratch); - if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.binormal) { + if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent) { var p1 = Cartesian3.fromArray(positions, (i + 6) % length, v1Scratch); if (recomputeNormal) { var p2 = Cartesian3.fromArray(positions, (i + 3) % length, v2Scratch); @@ -23019,10 +22381,10 @@ define('Core/RectangleGeometry',[ recomputeNormal = true; } - if (vertexFormat.tangent || vertexFormat.binormal) { - binormal = ellipsoid.geodeticSurfaceNormal(p, binormal); + if (vertexFormat.tangent || vertexFormat.bitangent) { + bitangent = ellipsoid.geodeticSurfaceNormal(p, bitangent); if (vertexFormat.tangent) { - tangent = Cartesian3.normalize(Cartesian3.cross(binormal, normal, tangent), tangent); + tangent = Cartesian3.normalize(Cartesian3.cross(bitangent, normal, tangent), tangent); } } @@ -23044,13 +22406,13 @@ define('Core/RectangleGeometry',[ tangents[tangentIndex++] = tangent.z; } - if (vertexFormat.binormal) { - binormals[binormalIndex++] = binormal.x; - binormals[binormalIndex++] = binormal.y; - binormals[binormalIndex++] = binormal.z; - binormals[binormalIndex++] = binormal.x; - binormals[binormalIndex++] = binormal.y; - binormals[binormalIndex++] = binormal.z; + if (vertexFormat.bitangent) { + bitangents[bitangentIndex++] = bitangent.x; + bitangents[bitangentIndex++] = bitangent.y; + bitangents[bitangentIndex++] = bitangent.z; + bitangents[bitangentIndex++] = bitangent.x; + bitangents[bitangentIndex++] = bitangent.y; + bitangents[bitangentIndex++] = bitangent.z; } } } @@ -23059,7 +22421,7 @@ define('Core/RectangleGeometry',[ positions : positions, normals : normals, tangents : tangents, - binormals : binormals + bitangents : bitangents }); } @@ -23164,7 +22526,9 @@ define('Core/RectangleGeometry',[ return wallTextures; } + var scratchVertexFormat = new VertexFormat(); function constructExtrudedRectangle(options) { + var shadowVolume = options.shadowVolume; var vertexFormat = options.vertexFormat; var surfaceHeight = options.surfaceHeight; var extrudedHeight = options.extrudedHeight; @@ -23176,10 +22540,15 @@ define('Core/RectangleGeometry',[ var ellipsoid = options.ellipsoid; var i; + if (shadowVolume) { + options.vertexFormat = VertexFormat.clone(vertexFormat, scratchVertexFormat); + options.vertexFormat.normal = true; + } var topBottomGeo = constructRectangle(options); if (CesiumMath.equalsEpsilon(minHeight, maxHeight, CesiumMath.EPSILON10)) { return topBottomGeo; } + var topPositions = PolygonPipeline.scaleToGeodeticHeight(topBottomGeo.attributes.position.values, maxHeight, ellipsoid, false); topPositions = new Float64Array(topPositions); var length = topPositions.length; @@ -23192,11 +22561,12 @@ define('Core/RectangleGeometry',[ var normals = (vertexFormat.normal) ? new Float32Array(newLength) : undefined; var tangents = (vertexFormat.tangent) ? new Float32Array(newLength) : undefined; - var binormals = (vertexFormat.binormal) ? new Float32Array(newLength) : undefined; + var bitangents = (vertexFormat.bitangent) ? new Float32Array(newLength) : undefined; var textures = (vertexFormat.st) ? new Float32Array(newLength/3*2) : undefined; var topSt; + var topNormals; if (vertexFormat.normal) { - var topNormals = topBottomGeo.attributes.normal.values; + topNormals = topBottomGeo.attributes.normal.values; normals.set(topNormals); for (i = 0; i < length; i ++) { topNormals[i] = -topNormals[i]; @@ -23204,6 +22574,23 @@ define('Core/RectangleGeometry',[ normals.set(topNormals, length); topBottomGeo.attributes.normal.values = normals; } + if (shadowVolume) { + topNormals = topBottomGeo.attributes.normal.values; + if (!vertexFormat.normal) { + topBottomGeo.attributes.normal = undefined; + } + var extrudeNormals = new Float32Array(newLength); + for (i = 0; i < length; i ++) { + topNormals[i] = -topNormals[i]; + } + extrudeNormals.set(topNormals, length); //only get normals for bottom layer that's going to be pushed down + topBottomGeo.attributes.extrudeDirection = new GeometryAttribute({ + componentDatatype : ComponentDatatype.FLOAT, + componentsPerAttribute : 3, + values : extrudeNormals + }); + } + if (vertexFormat.tangent) { var topTangents = topBottomGeo.attributes.tangent.values; tangents.set(topTangents); @@ -23213,11 +22600,11 @@ define('Core/RectangleGeometry',[ tangents.set(topTangents, length); topBottomGeo.attributes.tangent.values = tangents; } - if (vertexFormat.binormal) { - var topBinormals = topBottomGeo.attributes.binormal.values; - binormals.set(topBinormals); - binormals.set(topBinormals, length); - topBottomGeo.attributes.binormal.values = binormals; + if (vertexFormat.bitangent) { + var topBitangents = topBottomGeo.attributes.bitangent.values; + bitangents.set(topBitangents); + bitangents.set(topBitangents, length); + topBottomGeo.attributes.bitangent.values = bitangents; } if (vertexFormat.st) { topSt = topBottomGeo.attributes.st.values; @@ -23242,45 +22629,76 @@ define('Core/RectangleGeometry',[ var wallCount = (perimeterPositions + 4) * 2; var wallPositions = new Float64Array(wallCount * 3); + var wallExtrudeNormals = shadowVolume ? new Float32Array(wallCount * 3) : undefined; var wallTextures = (vertexFormat.st) ? new Float32Array(wallCount * 2) : undefined; var posIndex = 0; var stIndex = 0; + var extrudeNormalIndex = 0; var area = width * height; + var threeI; for (i = 0; i < area; i+=width) { - wallPositions = addWallPositions(wallPositions, posIndex, i*3, topPositions, bottomPositions); + threeI = i * 3; + wallPositions = addWallPositions(wallPositions, posIndex, threeI, topPositions, bottomPositions); posIndex += 6; if (vertexFormat.st) { wallTextures = addWallTextureCoordinates(wallTextures, stIndex, i*2, topSt); stIndex += 4; } + if (shadowVolume) { + extrudeNormalIndex += 3; + wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI]; + wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 1]; + wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 2]; + } } for (i = area-width; i < area; i++) { - wallPositions = addWallPositions(wallPositions, posIndex, i*3, topPositions, bottomPositions); + threeI = i * 3; + wallPositions = addWallPositions(wallPositions, posIndex, threeI, topPositions, bottomPositions); posIndex += 6; if (vertexFormat.st) { wallTextures = addWallTextureCoordinates(wallTextures, stIndex, i*2, topSt); stIndex += 4; } + if (shadowVolume) { + extrudeNormalIndex += 3; + wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI]; + wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 1]; + wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 2]; + } } for (i = area-1; i > 0; i-=width) { - wallPositions = addWallPositions(wallPositions, posIndex, i*3, topPositions, bottomPositions); + threeI = i * 3; + wallPositions = addWallPositions(wallPositions, posIndex, threeI, topPositions, bottomPositions); posIndex += 6; if (vertexFormat.st) { wallTextures = addWallTextureCoordinates(wallTextures, stIndex, i*2, topSt); stIndex += 4; } + if (shadowVolume) { + extrudeNormalIndex += 3; + wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI]; + wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 1]; + wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 2]; + } } for (i = width-1; i >= 0; i--) { - wallPositions = addWallPositions(wallPositions, posIndex, i*3, topPositions, bottomPositions); + threeI = i * 3; + wallPositions = addWallPositions(wallPositions, posIndex, threeI, topPositions, bottomPositions); posIndex += 6; if (vertexFormat.st) { wallTextures = addWallTextureCoordinates(wallTextures, stIndex, i*2, topSt); stIndex += 4; } + if (shadowVolume) { + extrudeNormalIndex += 3; + wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI]; + wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 1]; + wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 2]; + } } var geo = calculateAttributesWall(wallPositions, vertexFormat, ellipsoid); @@ -23292,6 +22710,13 @@ define('Core/RectangleGeometry',[ values : wallTextures }); } + if (shadowVolume) { + geo.attributes.extrudeDirection = new GeometryAttribute({ + componentDatatype : ComponentDatatype.FLOAT, + componentsPerAttribute : 3, + values : wallExtrudeNormals + }); + } var wallIndices = IndexDatatype.createTypedArray(wallCount, perimeterPositions * 6); @@ -23416,36 +22841,26 @@ define('Core/RectangleGeometry',[ options = defaultValue(options, defaultValue.EMPTY_OBJECT); var rectangle = options.rectangle; - var granularity = defaultValue(options.granularity, CesiumMath.RADIANS_PER_DEGREE); - var ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84); - var surfaceHeight = defaultValue(options.height, 0.0); - var rotation = defaultValue(options.rotation, 0.0); - var stRotation = defaultValue(options.stRotation, 0.0); - var vertexFormat = defaultValue(options.vertexFormat, VertexFormat.DEFAULT); - var extrudedHeight = options.extrudedHeight; - var extrude = defined(extrudedHeight); - var closeTop = defaultValue(options.closeTop, true); - var closeBottom = defaultValue(options.closeBottom, true); - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); Rectangle.validate(rectangle); if (rectangle.north < rectangle.south) { - throw new DeveloperError('options.rectangle.north must be greater than options.rectangle.south'); + throw new DeveloperError('options.rectangle.north must be greater than or equal to options.rectangle.south'); } + var rotation = defaultValue(options.rotation, 0.0); this._rectangle = rectangle; - this._granularity = granularity; - this._ellipsoid = Ellipsoid.clone(ellipsoid); - this._surfaceHeight = surfaceHeight; + this._granularity = defaultValue(options.granularity, CesiumMath.RADIANS_PER_DEGREE); + this._ellipsoid = Ellipsoid.clone(defaultValue(options.ellipsoid, Ellipsoid.WGS84)); + this._surfaceHeight = defaultValue(options.height, 0.0); this._rotation = rotation; - this._stRotation = stRotation; - this._vertexFormat = VertexFormat.clone(vertexFormat); - this._extrudedHeight = defaultValue(extrudedHeight, 0.0); - this._extrude = extrude; - this._closeTop = closeTop; - this._closeBottom = closeBottom; + this._stRotation = defaultValue(options.stRotation, 0.0); + this._vertexFormat = VertexFormat.clone(defaultValue(options.vertexFormat, VertexFormat.DEFAULT)); + this._extrudedHeight = defaultValue(options.extrudedHeight, 0.0); + this._extrude = defined(options.extrudedHeight); + this._closeTop = defaultValue(options.closeTop, true); + this._closeBottom = defaultValue(options.closeBottom, true); + this._shadowVolume = defaultValue(options.shadowVolume, false); this._workerName = 'createRectangleGeometry'; this._rotatedRectangle = computeRectangle(this._rectangle, this._ellipsoid, rotation); } @@ -23454,7 +22869,7 @@ define('Core/RectangleGeometry',[ * The number of elements used to pack the object into an array. * @type {Number} */ - RectangleGeometry.packedLength = Rectangle.packedLength + Ellipsoid.packedLength + VertexFormat.packedLength + Rectangle.packedLength + 8; + RectangleGeometry.packedLength = Rectangle.packedLength + Ellipsoid.packedLength + VertexFormat.packedLength + Rectangle.packedLength + 9; /** * Stores the provided instance into the provided array. @@ -23466,13 +22881,8 @@ define('Core/RectangleGeometry',[ * @returns {Number[]} The array that was packed into */ RectangleGeometry.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -23495,7 +22905,8 @@ define('Core/RectangleGeometry',[ array[startingIndex++] = value._extrudedHeight; array[startingIndex++] = value._extrude ? 1.0 : 0.0; array[startingIndex++] = value._closeTop ? 1.0 : 0.0; - array[startingIndex] = value._closeBottom ? 1.0 : 0.0; + array[startingIndex++] = value._closeBottom ? 1.0 : 0.0; + array[startingIndex] = value._shadowVolume ? 1.0 : 0.0; return array; }; @@ -23503,7 +22914,6 @@ define('Core/RectangleGeometry',[ var scratchRectangle = new Rectangle(); var scratchRotatedRectangle = new Rectangle(); var scratchEllipsoid = Ellipsoid.clone(Ellipsoid.UNIT_SPHERE); - var scratchVertexFormat = new VertexFormat(); var scratchOptions = { rectangle : scratchRectangle, ellipsoid : scratchEllipsoid, @@ -23514,7 +22924,8 @@ define('Core/RectangleGeometry',[ stRotation : undefined, extrudedHeight : undefined, closeTop : undefined, - closeBottom : undefined + closeBottom : undefined, + shadowVolume: undefined }; /** @@ -23526,9 +22937,7 @@ define('Core/RectangleGeometry',[ * @returns {RectangleGeometry} The modified result parameter or a new RectangleGeometry instance if one was not provided. */ RectangleGeometry.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -23551,7 +22960,8 @@ define('Core/RectangleGeometry',[ var extrudedHeight = array[startingIndex++]; var extrude = array[startingIndex++] === 1.0; var closeTop = array[startingIndex++] === 1.0; - var closeBottom = array[startingIndex] === 1.0; + var closeBottom = array[startingIndex++] === 1.0; + var shadowVolume = array[startingIndex] === 1.0; if (!defined(result)) { scratchOptions.granularity = granularity; @@ -23561,6 +22971,7 @@ define('Core/RectangleGeometry',[ scratchOptions.extrudedHeight = extrude ? extrudedHeight : undefined; scratchOptions.closeTop = closeTop; scratchOptions.closeBottom = closeBottom; + scratchOptions.shadowVolume = shadowVolume; return new RectangleGeometry(scratchOptions); } @@ -23576,6 +22987,7 @@ define('Core/RectangleGeometry',[ result._closeTop = closeTop; result._closeBottom = closeBottom; result._rotatedRectangle = rotatedRectangle; + result._shadowVolume = shadowVolume; return result; }; @@ -23632,6 +23044,7 @@ define('Core/RectangleGeometry',[ var boundingSphere; rectangle = rectangleGeometry._rectangle; if (extrude) { + options.shadowVolume = rectangleGeometry._shadowVolume; geometry = constructExtrudedRectangle(options); var topBS = BoundingSphere.fromRectangle3D(rectangle, ellipsoid, surfaceHeight, topBoundingSphere); var bottomBS = BoundingSphere.fromRectangle3D(rectangle, ellipsoid, extrudedHeight, bottomBoundingSphere); @@ -23647,7 +23060,7 @@ define('Core/RectangleGeometry',[ } return new Geometry({ - attributes : new GeometryAttributes(geometry.attributes), + attributes : geometry.attributes, indices : geometry.indices, primitiveType : geometry.primitiveType, boundingSphere : boundingSphere @@ -23675,7 +23088,8 @@ define('Core/RectangleGeometry',[ height : minHeight, closeTop : true, closeBottom : true, - vertexFormat : VertexFormat.POSITION_ONLY + vertexFormat : VertexFormat.POSITION_ONLY, + shadowVolume: true }); }; diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createRectangleOutlineGeometry.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createRectangleOutlineGeometry.js index 06785f0d..92414469 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createRectangleOutlineGeometry.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createRectangleOutlineGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,68 +45,6 @@ define('Core/defined',[],function() { return defined; }); -/*global define*/ -define('Core/freezeObject',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Freezes an object, using Object.freeze if available, otherwise returns - * the object unchanged. This function should be used in setup code to prevent - * errors from completely halting JavaScript execution in legacy browsers. - * - * @private - * - * @exports freezeObject - */ - var freezeObject = Object.freeze; - if (!defined(freezeObject)) { - freezeObject = function(o) { - return o; - }; - } - - return freezeObject; -}); - -/*global define*/ -define('Core/defaultValue',[ - './freezeObject' - ], function( - freezeObject) { - 'use strict'; - - /** - * Returns the first parameter if not undefined, otherwise the second parameter. - * Useful for setting a default value for a parameter. - * - * @exports defaultValue - * - * @param {*} a - * @param {*} b - * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter. - * - * @example - * param = Cesium.defaultValue(param, 'default'); - */ - function defaultValue(a, b) { - if (a !== undefined) { - return a; - } - return b; - } - - /** - * A frozen empty object that can be used as the default value for options passed as - * an object literal. - */ - defaultValue.EMPTY_OBJECT = freezeObject({}); - - return defaultValue; -}); - /*global define*/ define('Core/DeveloperError',[ './defined' @@ -188,41 +126,13 @@ define('Core/DeveloperError',[ return DeveloperError; }); -/*global define*/ -define('Core/isArray',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Tests an object to see if it is an array. - * @exports isArray - * - * @param {Object} value The value to test. - * @returns {Boolean} true if the value is an array, false otherwise. - */ - var isArray = Array.isArray; - if (!defined(isArray)) { - isArray = function(value) { - return Object.prototype.toString.call(value) === '[object Array]'; - }; - } - - return isArray; -}); - /*global define*/ define('Core/Check',[ - './defaultValue', - './defined', - './DeveloperError', - './isArray' + './defined', + './DeveloperError' ], function( - defaultValue, defined, - DeveloperError, - isArray) { + DeveloperError) { 'use strict'; /** @@ -237,111 +147,134 @@ define('Core/Check',[ */ Check.typeOf = {}; - /** - * Contains functions for checking numeric conditions such as minimum and maximum values - */ - Check.numeric = {}; - function getUndefinedErrorMessage(name) { - return name + ' was required but undefined.'; + return name + ' is required, actual value was undefined'; } function getFailedTypeErrorMessage(actual, expected, name) { - return 'Expected ' + name + ' to be typeof ' + expected + ', got ' + actual; + return 'Expected ' + name + ' to be typeof ' + expected + ', actual typeof was ' + actual; } /** * Throws if test is not defined * - * @param {*} test The value that is to be checked * @param {String} name The name of the variable being tested + * @param {*} test The value that is to be checked * @exception {DeveloperError} test must be defined */ - Check.defined = function (test, name) { + Check.defined = function (name, test) { if (!defined(test)) { throw new DeveloperError(getUndefinedErrorMessage(name)); } }; /** - * Throws if test is greater than maximum + * Throws if test is not typeof 'function' * - * @param {Number} test The value to test - * @param {Number} maximum The maximum allowed value - * @exception {DeveloperError} test must not be greater than maximum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'function' */ - Check.numeric.maximum = function (test, maximum) { - Check.typeOf.number(test); - Check.typeOf.number(maximum); - if (test > maximum) { - throw new DeveloperError('Expected ' + test + ' to be at most ' + maximum); + Check.typeOf.func = function (name, test) { + if (typeof test !== 'function') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); } }; /** - * Throws if test is less than minimum + * Throws if test is not typeof 'string' * - * @param {Number} test The value to test - * @param {Number} minimum The minimum allowed value - * @exception {DeveloperError} test must not be less than mininum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'string' */ - Check.numeric.minimum = function (test, minimum) { - Check.typeOf.number(test); - Check.typeOf.number(minimum); - if (test < minimum) { - throw new DeveloperError('Expected ' + test + ' to be at least ' + minimum); + Check.typeOf.string = function (name, test) { + if (typeof test !== 'string') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); } }; /** - * Throws if test is not typeof 'function' + * Throws if test is not typeof 'number' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'function' + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'number' */ - Check.typeOf.function = function (test, name) { - if (typeof test !== 'function') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); + Check.typeOf.number = function (name, test) { + if (typeof test !== 'number') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); } }; /** - * Throws if test is not typeof 'string' + * Throws if test is not typeof 'number' and less than limit * + * @param {String} name The name of the variable being tested * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than limit + */ + Check.typeOf.number.lessThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test >= limit) { + throw new DeveloperError('Expected ' + name + ' to be less than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and less than or equal to limit + * * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'string' + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than or equal to limit */ - Check.typeOf.string = function (test, name) { - if (typeof test !== 'string') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); + Check.typeOf.number.lessThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test > limit) { + throw new DeveloperError('Expected ' + name + ' to be less than or equal to ' + limit + ', actual value was ' + test); } }; /** - * Throws if test is not typeof 'number' + * Throws if test is not typeof 'number' and greater than limit * + * @param {String} name The name of the variable being tested * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than limit + */ + Check.typeOf.number.greaterThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test <= limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and greater than or equal to limit + * * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'number' + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than or equal to limit */ - Check.typeOf.number = function (test, name) { - if (typeof test !== 'number') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); + Check.typeOf.number.greaterThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test < limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than or equal to' + limit + ', actual value was ' + test); } }; /** * Throws if test is not typeof 'object' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested + * @param {*} test The value to test * @exception {DeveloperError} test must be typeof 'object' */ - Check.typeOf.object = function (test, name) { + Check.typeOf.object = function (name, test) { if (typeof test !== 'object') { throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'object', name)); } @@ -350,11 +283,11 @@ define('Core/Check',[ /** * Throws if test is not typeof 'boolean' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested + * @param {*} test The value to test * @exception {DeveloperError} test must be typeof 'boolean' */ - Check.typeOf.boolean = function (test, name) { + Check.typeOf.bool = function (name, test) { if (typeof test !== 'boolean') { throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'boolean', name)); } @@ -363,6 +296,68 @@ define('Core/Check',[ return Check; }); +/*global define*/ +define('Core/freezeObject',[ + './defined' + ], function( + defined) { + 'use strict'; + + /** + * Freezes an object, using Object.freeze if available, otherwise returns + * the object unchanged. This function should be used in setup code to prevent + * errors from completely halting JavaScript execution in legacy browsers. + * + * @private + * + * @exports freezeObject + */ + var freezeObject = Object.freeze; + if (!defined(freezeObject)) { + freezeObject = function(o) { + return o; + }; + } + + return freezeObject; +}); + +/*global define*/ +define('Core/defaultValue',[ + './freezeObject' + ], function( + freezeObject) { + 'use strict'; + + /** + * Returns the first parameter if not undefined, otherwise the second parameter. + * Useful for setting a default value for a parameter. + * + * @exports defaultValue + * + * @param {*} a + * @param {*} b + * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter. + * + * @example + * param = Cesium.defaultValue(param, 'default'); + */ + function defaultValue(a, b) { + if (a !== undefined) { + return a; + } + return b; + } + + /** + * A frozen empty object that can be used as the default value for options passed as + * an object literal. + */ + defaultValue.EMPTY_OBJECT = freezeObject({}); + + return defaultValue; +}); + /* I've wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace so it's better encapsulated. Now you can have multiple random number generators @@ -1047,7 +1042,7 @@ define('Core/Math',[ if (!defined(angle)) { throw new DeveloperError('angle is required.'); } - + return CesiumMath.clamp(angle, -1*CesiumMath.PI_OVER_TWO, CesiumMath.PI_OVER_TWO); }; @@ -1057,11 +1052,11 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [<code>-CesiumMath.PI</code>, <code>CesiumMath.PI</code>]. */ - CesiumMath.negativePiToPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.negativePiToPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - return CesiumMath.zeroToTwoPi(x + CesiumMath.PI) - CesiumMath.PI; + return CesiumMath.zeroToTwoPi(angle + CesiumMath.PI) - CesiumMath.PI; }; /** @@ -1070,12 +1065,12 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [0, <code>CesiumMath.TWO_PI</code>]. */ - CesiumMath.zeroToTwoPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.zeroToTwoPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - var mod = CesiumMath.mod(x, CesiumMath.TWO_PI); - if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(x) > CesiumMath.EPSILON14) { + var mod = CesiumMath.mod(angle, CesiumMath.TWO_PI); + if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(angle) > CesiumMath.EPSILON14) { return CesiumMath.TWO_PI; } return mod; @@ -1145,7 +1140,7 @@ define('Core/Math',[ * @example * //Compute 7!, which is equal to 5040 * var computedFactorial = Cesium.Math.factorial(7); - * + * * @see {@link http://en.wikipedia.org/wiki/Factorial|Factorial on Wikipedia} */ CesiumMath.factorial = function(n) { @@ -1429,7 +1424,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.fromSpherical = function(spherical, result) { - Check.typeOf.object(spherical, 'spherical'); + Check.typeOf.object('spherical', spherical); if (!defined(result)) { result = new Cartesian3(); @@ -1513,8 +1508,8 @@ define('Core/Cartesian3',[ * @returns {Number[]} The array that was packed into */ Cartesian3.pack = function(value, array, startingIndex) { - Check.typeOf.object(value, 'value'); - Check.defined(array, 'array'); + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1534,7 +1529,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.unpack = function(array, startingIndex, result) { - Check.defined(array, 'array'); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1555,7 +1550,7 @@ define('Core/Cartesian3',[ * @returns {Number[]} The packed array. */ Cartesian3.packArray = function(array, result) { - Check.defined(array, 'array'); + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -1578,8 +1573,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3[]} The unpacked array. */ Cartesian3.unpackArray = function(array, result) { - Check.defined(array, 'array'); - Check.numeric.minimum(array.length, 3); + Check.defined('array', array); + Check.typeOf.number.greaterThanOrEquals('array.length', array.length, 3); if (array.length % 3 !== 0) { throw new DeveloperError('array length must be a multiple of 3.'); } @@ -1625,7 +1620,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the maximum component. */ Cartesian3.maximumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z); }; @@ -1637,7 +1632,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the minimum component. */ Cartesian3.minimumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z); }; @@ -1651,9 +1646,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the minimum components. */ Cartesian3.minimumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -1671,9 +1666,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the maximum components. */ Cartesian3.maximumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -1688,7 +1683,7 @@ define('Core/Cartesian3',[ * @returns {Number} The squared magnitude. */ Cartesian3.magnitudeSquared = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z; }; @@ -1717,8 +1712,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distance(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(2.0, 0.0, 0.0)); */ Cartesian3.distance = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitude(distanceScratch); @@ -1737,8 +1732,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distanceSquared(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(3.0, 0.0, 0.0)); */ Cartesian3.distanceSquared = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitudeSquared(distanceScratch); @@ -1752,8 +1747,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.normalize = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian3.magnitude(cartesian); @@ -1776,8 +1771,8 @@ define('Core/Cartesian3',[ * @returns {Number} The dot product. */ Cartesian3.dot = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z; }; @@ -1791,9 +1786,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyComponents = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -1835,9 +1830,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.add = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -1854,9 +1849,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.subtract = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -1873,9 +1868,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -1892,9 +1887,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.divideByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -1910,8 +1905,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.negate = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -1927,8 +1922,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.abs = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -1947,10 +1942,10 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.lerp = function(start, end, t, result) { - Check.typeOf.object(start, 'start'); - Check.typeOf.object(end, 'end'); - Check.typeOf.number(t, 't'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian3.multiplyByScalar(end, t, lerpScratch); result = Cartesian3.multiplyByScalar(start, 1.0 - t, result); @@ -1967,8 +1962,8 @@ define('Core/Cartesian3',[ * @returns {Number} The angle between the Cartesians. */ Cartesian3.angleBetween = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.normalize(left, angleBetweenScratch); Cartesian3.normalize(right, angleBetweenScratch2); @@ -1986,8 +1981,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The most orthogonal axis. */ Cartesian3.mostOrthogonalAxis = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian3.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian3.abs(f, f); @@ -2064,9 +2059,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The cross product. */ Cartesian3.cross = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var leftX = left.x; var leftY = left.y; @@ -2099,8 +2094,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromDegrees(-115.0, 37.0); */ Cartesian3.fromDegrees = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); longitude = CesiumMath.toRadians(longitude); latitude = CesiumMath.toRadians(latitude); @@ -2125,8 +2120,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromRadians(-2.007, 0.645); */ Cartesian3.fromRadians = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); height = defaultValue(height, 0.0); var radiiSquared = defined(ellipsoid) ? ellipsoid.radiiSquared : wgs84RadiiSquared; @@ -2160,7 +2155,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArray([-115.0, 37.0, -107.0, 33.0]); */ Cartesian3.fromDegreesArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -2194,7 +2189,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArray([-2.007, 0.645, -1.867, .575]); */ Cartesian3.fromRadiansArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -2228,7 +2223,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArrayHeights([-115.0, 37.0, 100000.0, -107.0, 33.0, 150000.0]); */ Cartesian3.fromDegreesArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -2263,7 +2258,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArrayHeights([-2.007, 0.645, 100000.0, -1.867, .575, 150000.0]); */ Cartesian3.fromRadiansArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -3010,7 +3005,9 @@ define('Core/Ellipsoid',[ /** * Computes an Ellipsoid from a Cartesian specifying the radii in x, y, and z directions. * - * @param {Cartesian3} [radii=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Cartesian3} [cartesian=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new + * instance should be created. * @returns {Ellipsoid} A new Ellipsoid instance. * * @exception {DeveloperError} All radii components must be greater than or equal to zero. @@ -3455,6 +3452,7 @@ define('Core/Ellipsoid',[ /*global define*/ define('Core/Rectangle',[ './Cartographic', + './Check', './defaultValue', './defined', './defineProperties', @@ -3464,6 +3462,7 @@ define('Core/Rectangle',[ './Math' ], function( Cartographic, + Check, defaultValue, defined, defineProperties, @@ -3560,13 +3559,8 @@ define('Core/Rectangle',[ * @returns {Number[]} The array that was packed into */ Rectangle.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3587,9 +3581,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3610,9 +3602,7 @@ define('Core/Rectangle',[ * @returns {Number} The width. */ Rectangle.computeWidth = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; if (east < west) { @@ -3627,9 +3617,7 @@ define('Core/Rectangle',[ * @returns {Number} The height. */ Rectangle.computeHeight = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); return rectangle.north - rectangle.south; }; @@ -3664,6 +3652,32 @@ define('Core/Rectangle',[ return result; }; + /** + * Creates an rectangle given the boundary longitude and latitude in radians. + * + * @param {Number} [west=0.0] The westernmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [south=0.0] The southernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Number} [east=0.0] The easternmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [north=0.0] The northernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Rectangle} [result] The object onto which to store the result, or undefined if a new instance should be created. + * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. + * + * @example + * var rectangle = Cesium.Rectangle.fromRadians(0.0, Math.PI/4, Math.PI/8, 3*Math.PI/4); + */ + Rectangle.fromRadians = function(west, south, east, north, result) { + if (!defined(result)) { + return new Rectangle(west, south, east, north); + } + + result.west = defaultValue(west, 0.0); + result.south = defaultValue(south, 0.0); + result.east = defaultValue(east, 0.0); + result.north = defaultValue(north, 0.0); + + return result; + }; + /** * Creates the smallest possible Rectangle that encloses all positions in the provided array. * @@ -3672,9 +3686,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartographicArray = function(cartographics, result) { - if (!defined(cartographics)) { - throw new DeveloperError('cartographics is required.'); - } + Check.defined('cartographics', cartographics); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -3727,9 +3739,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartesianArray = function(cartesians, ellipsoid, result) { - if (!defined(cartesians)) { - throw new DeveloperError('cartesians is required.'); - } + Check.defined('cartesians', cartesians); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -3845,9 +3855,7 @@ define('Core/Rectangle',[ * @returns {Boolean} <code>true</code> if the Rectangles are within the provided epsilon, <code>false</code> otherwise. */ Rectangle.prototype.equalsEpsilon = function(other, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon is required and must be a number.'); - } + Check.typeOf.number('epsilon', epsilon); return defined(other) && (Math.abs(this.west - other.west) <= epsilon) && @@ -3867,45 +3875,23 @@ define('Core/Rectangle',[ * @exception {DeveloperError} <code>west</code> must be in the interval [<code>-Pi</code>, <code>Pi</code>]. */ Rectangle.validate = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var north = rectangle.north; - if (typeof north !== 'number') { - throw new DeveloperError('north is required to be a number.'); - } - - if (north < -CesiumMath.PI_OVER_TWO || north > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('north must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('north', north, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('north', north, CesiumMath.PI_OVER_TWO); var south = rectangle.south; - if (typeof south !== 'number') { - throw new DeveloperError('south is required to be a number.'); - } - - if (south < -CesiumMath.PI_OVER_TWO || south > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('south must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('south', south, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('south', south, CesiumMath.PI_OVER_TWO); var west = rectangle.west; - if (typeof west !== 'number') { - throw new DeveloperError('west is required to be a number.'); - } - - if (west < -Math.PI || west > Math.PI) { - throw new DeveloperError('west must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('west', west, -Math.PI); + Check.typeOf.number.lessThanOrEquals('west', west, Math.PI); var east = rectangle.east; - if (typeof east !== 'number') { - throw new DeveloperError('east is required to be a number.'); - } - - if (east < -Math.PI || east > Math.PI) { - throw new DeveloperError('east must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('east', east, -Math.PI); + Check.typeOf.number.lessThanOrEquals('east', east, Math.PI); }; /** @@ -3916,9 +3902,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.south); @@ -3937,9 +3921,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.north); @@ -3958,9 +3940,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.north); @@ -3979,9 +3959,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.south); @@ -4000,9 +3978,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.center = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; @@ -4037,12 +4013,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.intersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var rectangleEast = rectangle.east; var rectangleWest = rectangle.west; @@ -4098,12 +4070,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.simpleIntersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var west = Math.max(rectangle.west, otherRectangle.west); var south = Math.max(rectangle.south, otherRectangle.south); @@ -4134,12 +4102,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.union = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); if (!defined(result)) { result = new Rectangle(); @@ -4183,12 +4147,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.expand = function(rectangle, cartographic, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); if (!defined(result)) { result = new Rectangle(); @@ -4210,12 +4170,8 @@ define('Core/Rectangle',[ * @returns {Boolean} true if the provided cartographic is inside the rectangle, false otherwise. */ Rectangle.contains = function(rectangle, cartographic) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); var longitude = cartographic.longitude; var latitude = cartographic.latitude; @@ -4248,9 +4204,7 @@ define('Core/Rectangle',[ * @returns {Cartesian3[]} The modified result parameter or a new Array of Cartesians instances if none was provided. */ Rectangle.subsample = function(rectangle, ellipsoid, surfaceHeight, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84); surfaceHeight = defaultValue(surfaceHeight, 0.0); @@ -4522,6 +4476,7 @@ define('Core/Interval',[ /*global define*/ define('Core/Matrix3',[ './Cartesian3', + './Check', './defaultValue', './defined', './defineProperties', @@ -4530,6 +4485,7 @@ define('Core/Matrix3',[ './Math' ], function( Cartesian3, + Check, defaultValue, defined, defineProperties, @@ -4592,13 +4548,8 @@ define('Core/Matrix3',[ * @returns {Number[]} The array that was packed into */ Matrix3.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -4624,9 +4575,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. */ Matrix3.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -4653,24 +4602,24 @@ define('Core/Matrix3',[ * @param {Matrix3} [result] The object onto which to store the result. * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. (Returns undefined if matrix is undefined) */ - Matrix3.clone = function(values, result) { - if (!defined(values)) { + Matrix3.clone = function(matrix, result) { + if (!defined(matrix)) { return undefined; } if (!defined(result)) { - return new Matrix3(values[0], values[3], values[6], - values[1], values[4], values[7], - values[2], values[5], values[8]); + return new Matrix3(matrix[0], matrix[3], matrix[6], + matrix[1], matrix[4], matrix[7], + matrix[2], matrix[5], matrix[8]); } - result[0] = values[0]; - result[1] = values[1]; - result[2] = values[2]; - result[3] = values[3]; - result[4] = values[4]; - result[5] = values[5]; - result[6] = values[6]; - result[7] = values[7]; - result[8] = values[8]; + result[0] = matrix[0]; + result[1] = matrix[1]; + result[2] = matrix[2]; + result[3] = matrix[3]; + result[4] = matrix[4]; + result[5] = matrix[5]; + result[6] = matrix[6]; + result[7] = matrix[7]; + result[8] = matrix[8]; return result; }; @@ -4696,9 +4645,7 @@ define('Core/Matrix3',[ * var m2 = Cesium.Matrix3.fromArray(v2, 2); */ Matrix3.fromArray = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -4726,9 +4673,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values parameter is required'); - } + Check.defined('values', values); return Matrix3.clone(values, result); }; @@ -4742,9 +4687,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix3(values[0], values[1], values[2], @@ -4771,9 +4714,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this quaternion. */ Matrix3.fromQuaternion = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); var x2 = quaternion.x * quaternion.x; var xy = quaternion.x * quaternion.y; @@ -4823,10 +4764,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this headingPitchRoll. */ Matrix3.fromHeadingPitchRoll = function(headingPitchRoll, result) { - if (!defined(headingPitchRoll)) { - throw new DeveloperError('headingPitchRoll is required'); - } - var cosTheta = Math.cos(-headingPitchRoll.pitch); + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + + var cosTheta = Math.cos(-headingPitchRoll.pitch); var cosPsi = Math.cos(-headingPitchRoll.heading); var cosPhi = Math.cos(headingPitchRoll.roll); var sinTheta = Math.sin(-headingPitchRoll.pitch); @@ -4877,9 +4817,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix3( @@ -4915,9 +4853,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromUniformScale(2.0); */ Matrix3.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix3( @@ -4941,7 +4877,7 @@ define('Core/Matrix3',[ /** * Computes a Matrix3 instance representing the cross product equivalent matrix of a Cartesian3 vector. * - * @param {Cartesian3} the vector on the left hand side of the cross product operation. + * @param {Cartesian3} vector the vector on the left hand side of the cross product operation. * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created. * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. * @@ -4953,9 +4889,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromCrossProduct(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromCrossProduct = function(vector, result) { - if (!defined(vector)) { - throw new DeveloperError('vector is required.'); - } + Check.typeOf.object('vector', vector); if (!defined(result)) { return new Matrix3( @@ -4990,9 +4924,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationX = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -5031,9 +4963,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationY = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -5072,9 +5002,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationZ = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -5108,9 +5036,7 @@ define('Core/Matrix3',[ * @returns {Number[]} The modified Array parameter or a new Array instance if one was not provided. */ Matrix3.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5], matrix[6], matrix[7], matrix[8]]; @@ -5144,12 +5070,10 @@ define('Core/Matrix3',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix3.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 2) { - throw new DeveloperError('row must be 0, 1, or 2.'); - } - if (typeof column !== 'number' || column < 0 || column > 2) { - throw new DeveloperError('column must be 0, 1, or 2.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 2); + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 2); return column * 3 + row; }; @@ -5165,16 +5089,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var startIndex = index * 3; var x = matrix[startIndex]; @@ -5199,18 +5117,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); var startIndex = index * 3; @@ -5231,15 +5142,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 3]; @@ -5263,18 +5169,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); result[index] = cartesian.x; @@ -5293,12 +5192,8 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[3], matrix[4], matrix[5], scratchColumn)); @@ -5329,15 +5224,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var column0Row0 = left[0] * right[0] + left[3] * right[1] + left[6] * right[2]; var column0Row1 = left[1] * right[0] + left[4] * right[1] + left[7] * right[2]; @@ -5372,15 +5261,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -5403,15 +5286,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -5434,15 +5311,9 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -5467,15 +5338,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -5506,15 +5371,9 @@ define('Core/Matrix3',[ * @see Matrix3.multiplyByUniformScale */ Matrix3.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); result[0] = matrix[0] * scale.x; result[1] = matrix[1] * scale.x; @@ -5536,12 +5395,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -5563,12 +5418,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var column0Row0 = matrix[0]; var column0Row1 = matrix[3]; @@ -5708,9 +5559,7 @@ define('Core/Matrix3',[ * var c = Cesium.Cartesian3.multiplyByScalar(v, lambda, new Cesium.Cartesian3()); // equal to Cesium.Matrix3.multiplyByVector(a, v) */ Matrix3.computeEigenDecomposition = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); // This routine was created based upon Matrix Computations, 3rd ed., by Golub and Van Loan, // section 8.4.3 The Classical Jacobi Algorithm @@ -5754,12 +5603,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -5781,9 +5626,7 @@ define('Core/Matrix3',[ * @returns {Number} The value of the determinant of the matrix. */ Matrix3.determinant = function(matrix) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); var m11 = matrix[0]; var m21 = matrix[3]; @@ -5808,12 +5651,8 @@ define('Core/Matrix3',[ * @exception {DeveloperError} matrix is not invertible. */ Matrix3.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var m11 = matrix[0]; var m21 = matrix[1]; @@ -5879,9 +5718,7 @@ define('Core/Matrix3',[ * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. */ Matrix3.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -6069,12 +5906,14 @@ define('Core/Matrix3',[ /*global define*/ define('Core/Cartesian4',[ + './Check', './defaultValue', './defined', './DeveloperError', './freezeObject', './Math' ], function( + Check, defaultValue, defined, DeveloperError, @@ -6157,9 +5996,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.fromColor = function(color, result) { - if (!defined(color)) { - throw new DeveloperError('color is required'); - } + Check.typeOf.object('color', color); if (!defined(result)) { return new Cartesian4(color.red, color.green, color.blue, color.alpha); } @@ -6211,12 +6048,8 @@ define('Core/Cartesian4',[ * @returns {Number[]} The array that was packed into */ Cartesian4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -6237,9 +6070,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -6261,9 +6092,7 @@ define('Core/Cartesian4',[ * @returns {Number[]} The packed array. */ Cartesian4.packArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -6286,9 +6115,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4[]} The unpacked array. */ Cartesian4.unpackArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -6331,9 +6158,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the maximum component. */ Cartesian4.maximumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -6345,9 +6170,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the minimum component. */ Cartesian4.minimumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -6361,15 +6184,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the minimum components. */ Cartesian4.minimumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -6388,15 +6205,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the maximum components. */ Cartesian4.maximumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -6413,9 +6224,7 @@ define('Core/Cartesian4',[ * @returns {Number} The squared magnitude. */ Cartesian4.magnitudeSquared = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z + cartesian.w * cartesian.w; }; @@ -6446,9 +6255,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(2.0, 0.0, 0.0, 0.0)); */ Cartesian4.distance = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitude(distanceScratch); @@ -6469,9 +6277,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(3.0, 0.0, 0.0, 0.0)); */ Cartesian4.distanceSquared = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitudeSquared(distanceScratch); @@ -6485,12 +6292,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.normalize = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian4.magnitude(cartesian); @@ -6514,12 +6317,8 @@ define('Core/Cartesian4',[ * @returns {Number} The dot product. */ Cartesian4.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w; }; @@ -6533,15 +6332,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -6559,15 +6352,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x / right.x; result.y = left.y / right.y; @@ -6585,15 +6372,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -6611,15 +6392,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -6637,15 +6412,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -6663,15 +6432,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -6688,12 +6451,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.negate = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -6710,12 +6469,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.abs = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -6735,18 +6490,10 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian4.multiplyByScalar(end, t, lerpScratch); result = Cartesian4.multiplyByScalar(start, 1.0 - t, result); @@ -6762,12 +6509,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The most orthogonal axis. */ Cartesian4.mostOrthogonalAxis = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian4.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian4.abs(f, f); @@ -7012,6 +6755,7 @@ define('Core/RuntimeError',[ define('Core/Matrix4',[ './Cartesian3', './Cartesian4', + './Check', './defaultValue', './defined', './defineProperties', @@ -7023,6 +6767,7 @@ define('Core/Matrix4',[ ], function( Cartesian3, Cartesian4, + Check, defaultValue, defined, defineProperties, @@ -7113,13 +6858,8 @@ define('Core/Matrix4',[ * @returns {Number[]} The array that was packed into */ Matrix4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -7152,9 +6892,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if one was not provided. */ Matrix4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -7250,9 +6988,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required'); - } + Check.defined('values', values); return Matrix4.clone(values, result); }; @@ -7266,9 +7002,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix4(values[0], values[1], values[2], values[3], @@ -7305,9 +7039,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRotationTranslation = function(rotation, translation, result) { - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } + Check.typeOf.object('rotation', rotation); translation = defaultValue(translation, Cartesian3.ZERO); @@ -7355,15 +7087,9 @@ define('Core/Matrix4',[ * result); */ Matrix4.fromTranslationQuaternionRotationScale = function(translation, rotation, scale, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('translation', translation); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('scale', scale); if (!defined(result)) { result = new Matrix4(); @@ -7424,9 +7150,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromTranslationRotationScale = function(translationRotationScale, result) { - if (!defined(translationRotationScale)) { - throw new DeveloperError('translationRotationScale is required.'); - } + Check.typeOf.object('translationRotationScale', translationRotationScale); return Matrix4.fromTranslationQuaternionRotationScale(translationRotationScale.translation, translationRotationScale.rotation, translationRotationScale.scale, result); }; @@ -7441,9 +7165,7 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByTranslation */ Matrix4.fromTranslation = function(translation, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } + Check.typeOf.object('translation', translation); return Matrix4.fromRotationTranslation(Matrix3.IDENTITY, translation, result); }; @@ -7464,9 +7186,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix4.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix4( @@ -7511,9 +7231,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromUniformScale(2.0); */ Matrix4.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix4(scale, 0.0, 0.0, 0.0, @@ -7553,23 +7271,15 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromCamera = function(camera, result) { - if (!defined(camera)) { - throw new DeveloperError('camera is required.'); - } + Check.typeOf.object('camera', camera); var position = camera.position; var direction = camera.direction; var up = camera.up; - if (!defined(position)) { - throw new DeveloperError('camera.position is required.'); - } - if (!defined(direction)) { - throw new DeveloperError('camera.direction is required.'); - } - if (!defined(up)) { - throw new DeveloperError('camera.up is required.'); - } + Check.typeOf.object('camera.position', position); + Check.typeOf.object('camera.direction', direction); + Check.typeOf.object('camera.up', up); Cartesian3.normalize(direction, fromCameraF); Cartesian3.normalize(Cartesian3.cross(fromCameraF, up, fromCameraR), fromCameraR); @@ -7648,21 +7358,11 @@ define('Core/Matrix4',[ * @exception {DeveloperError} far must be greater than zero. */ Matrix4.computePerspectiveFieldOfView = function(fovY, aspectRatio, near, far, result) { - if (fovY <= 0.0 || fovY > Math.PI) { - throw new DeveloperError('fovY must be in (0, PI].'); - } - if (aspectRatio <= 0.0) { - throw new DeveloperError('aspectRatio must be greater than zero.'); - } - if (near <= 0.0) { - throw new DeveloperError('near must be greater than zero.'); - } - if (far <= 0.0) { - throw new DeveloperError('far must be greater than zero.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThan('fovY', fovY, 0.0); + Check.typeOf.number.lessThan('fovY', fovY, Math.PI); + Check.typeOf.number.greaterThan('near', near, 0.0); + Check.typeOf.number.greaterThan('far', far, 0.0); + Check.typeOf.object('result', result); var bottom = Math.tan(fovY * 0.5); @@ -7703,27 +7403,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeOrthographicOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var a = 1.0 / (right - left); var b = 1.0 / (top - bottom); @@ -7768,27 +7454,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computePerspectiveOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -7829,24 +7501,12 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeInfinitePerspectiveOffCenter = function(left, right, bottom, top, near, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -7894,9 +7554,7 @@ define('Core/Matrix4',[ * }, 0.0, 1.0, new Cesium.Matrix4()); */ Matrix4.computeViewportTransformation = function(viewport, nearDepthRange, farDepthRange, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); viewport = defaultValue(viewport, defaultValue.EMPTY_OBJECT); var x = defaultValue(viewport.x, 0.0); @@ -7948,21 +7606,11 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeView = function(position, direction, up, right, result) { - if (!defined(position)) { - throw new DeveloperError('position is required'); - } - if (!defined(direction)) { - throw new DeveloperError('direction is required'); - } - if (!defined(up)) { - throw new DeveloperError('up is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); + Check.typeOf.object('up', up); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = right.x; result[1] = up.x; @@ -8003,9 +7651,7 @@ define('Core/Matrix4',[ * //creates a = [10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0] */ Matrix4.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], @@ -8049,12 +7695,11 @@ define('Core/Matrix4',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix4.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 3) { - throw new DeveloperError('row must be 0, 1, 2, or 3.'); - } - if (typeof column !== 'number' || column < 0 || column > 3) { - throw new DeveloperError('column must be 0, 1, 2, or 3.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 3); + + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 3); return column * 4 + row; }; @@ -8087,16 +7732,12 @@ define('Core/Matrix4',[ * // a.x = 12.0; a.y = 16.0; a.z = 20.0; a.w = 24.0; */ Matrix4.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var startIndex = index * 4; var x = matrix[startIndex]; @@ -8138,18 +7779,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 96.0, 25.0] */ Matrix4.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); var startIndex = index * 4; @@ -8170,15 +7806,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.setTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -8231,16 +7861,12 @@ define('Core/Matrix4',[ * // a.x = 18.0; a.y = 19.0; a.z = 20.0; a.w = 21.0; */ Matrix4.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 4]; @@ -8281,18 +7907,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 24.0, 25.0] */ Matrix4.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); result[index] = cartesian.x; @@ -8312,12 +7933,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter */ Matrix4.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[4], matrix[5], matrix[6], scratchColumn)); @@ -8349,15 +7966,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -8441,15 +8052,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -8479,15 +8084,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -8528,15 +8127,9 @@ define('Core/Matrix4',[ * var m3 = Cesium.Matrix4.multiplyTransformation(m1, m2, new Cesium.Matrix4()); */ Matrix4.multiplyTransformation = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -8614,15 +8207,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByMatrix3(m, rotation, m); */ Matrix4.multiplyByMatrix3 = function(matrix, rotation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('result', result); var left0 = matrix[0]; var left1 = matrix[1]; @@ -8690,15 +8277,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByTranslation(m, position, m); */ Matrix4.multiplyByTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); var x = translation.x; var y = translation.y; @@ -8750,15 +8331,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByScale */ Matrix4.multiplyByUniformScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scale', scale); + Check.typeOf.object('result', result); uniformScaleScratch.x = scale; uniformScaleScratch.y = scale; @@ -8787,15 +8362,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByUniformScale */ Matrix4.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); var scaleX = scale.x; var scaleY = scale.y; @@ -8834,15 +8403,9 @@ define('Core/Matrix4',[ * @returns {Cartesian4} The modified result parameter. */ Matrix4.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8878,15 +8441,9 @@ define('Core/Matrix4',[ * // Cesium.Matrix4.multiplyByVector(matrix, new Cesium.Cartesian4(p.x, p.y, p.z, 0.0), result); */ Matrix4.multiplyByPointAsVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8916,16 +8473,9 @@ define('Core/Matrix4',[ * var result = Cesium.Matrix4.multiplyByPoint(matrix, p, new Cesium.Cartesian3()); */ Matrix4.multiplyByPoint = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8965,15 +8515,9 @@ define('Core/Matrix4',[ * // [-44.0, -46.0, -48.0, -50.0] */ Matrix4.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -9017,12 +8561,8 @@ define('Core/Matrix4',[ * // [-22.0, -23.0, -24.0, -25.0] */ Matrix4.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -9066,12 +8606,8 @@ define('Core/Matrix4',[ * // [13.0, 17.0, 21.0, 25.0] */ Matrix4.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var matrix1 = matrix[1]; var matrix2 = matrix[2]; @@ -9107,12 +8643,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -9226,9 +8758,7 @@ define('Core/Matrix4',[ * //Prints "Difference between both the matrices is not less than 0.1" on the console */ Matrix4.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -9259,12 +8789,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter. */ Matrix4.getTranslation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = matrix[12]; result.y = matrix[13]; @@ -9295,12 +8821,8 @@ define('Core/Matrix4',[ * // [12.0, 16.0, 20.0] */ Matrix4.getRotation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -9332,12 +8854,8 @@ define('Core/Matrix4',[ * @exception {RuntimeError} matrix is not invertible because its determinate is zero. */ Matrix4.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); // Special case for a zero scale matrix that can occur, for example, // when a model's node has a [0, 0, 0] scale. @@ -9475,12 +8993,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.inverseTransformation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); //This function is an optimized version of the below 4 lines. //var rT = Matrix3.transpose(Matrix4.getRotation(matrix)); @@ -9765,9 +9279,9 @@ define('Core/Matrix4',[ define('Core/BoundingSphere',[ './Cartesian3', './Cartographic', + './Check', './defaultValue', './defined', - './DeveloperError', './Ellipsoid', './GeographicProjection', './Intersect', @@ -9778,9 +9292,9 @@ define('Core/BoundingSphere',[ ], function( Cartesian3, Cartographic, + Check, defaultValue, defined, - DeveloperError, Ellipsoid, GeographicProjection, Intersect, @@ -10110,9 +9624,7 @@ define('Core/BoundingSphere',[ stride = defaultValue(stride, 3); - if (stride < 3) { - throw new DeveloperError('stride must be 3 or greater.'); - } + Check.typeOf.number.greaterThanOrEquals('stride', stride, 3); var currentPos = fromPointsCurrentPos; currentPos.x = positions[0] + center.x; @@ -10416,9 +9928,8 @@ define('Core/BoundingSphere',[ * var sphere = Cesium.BoundingSphere.fromCornerPoints(new Cesium.Cartesian3(-0.5, -0.5, -0.5), new Cesium.Cartesian3(0.5, 0.5, 0.5)); */ BoundingSphere.fromCornerPoints = function(corner, oppositeCorner, result) { - if (!defined(corner) || !defined(oppositeCorner)) { - throw new DeveloperError('corner and oppositeCorner are required.'); - } + Check.typeOf.object('corner', corner); + Check.typeOf.object('oppositeCorner', oppositeCorner); if (!defined(result)) { result = new BoundingSphere(); @@ -10442,9 +9953,7 @@ define('Core/BoundingSphere',[ * var boundingSphere = Cesium.BoundingSphere.fromEllipsoid(ellipsoid); */ BoundingSphere.fromEllipsoid = function(ellipsoid, result) { - if (!defined(ellipsoid)) { - throw new DeveloperError('ellipsoid is required.'); - } + Check.typeOf.object('ellipsoid', ellipsoid); if (!defined(result)) { result = new BoundingSphere(); @@ -10570,13 +10079,8 @@ define('Core/BoundingSphere',[ * @returns {Number[]} The array that was packed into */ BoundingSphere.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -10598,9 +10102,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if one was not provided. */ BoundingSphere.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -10627,13 +10129,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.union = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); if (!defined(result)) { result = new BoundingSphere(); @@ -10682,13 +10179,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.expand = function(sphere, point, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(point)) { - throw new DeveloperError('point is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('point', point); result = BoundingSphere.clone(sphere, result); @@ -10711,13 +10203,8 @@ define('Core/BoundingSphere',[ * intersects the plane. */ BoundingSphere.intersectPlane = function(sphere, plane) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(plane)) { - throw new DeveloperError('plane is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('plane', plane); var center = sphere.center; var radius = sphere.radius; @@ -10743,13 +10230,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.transform = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -10777,12 +10259,8 @@ define('Core/BoundingSphere',[ * }); */ BoundingSphere.distanceSquaredTo = function(sphere, cartesian) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('cartesian', cartesian); var diff = Cartesian3.subtract(sphere.center, cartesian, distanceSquaredToScratch); return Cartesian3.magnitudeSquared(diff) - sphere.radius * sphere.radius; @@ -10804,13 +10282,8 @@ define('Core/BoundingSphere',[ * var newBoundingSphere = Cesium.BoundingSphere.transformWithoutScale(boundingSphere, modelMatrix); */ BoundingSphere.transformWithoutScale = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -10837,17 +10310,9 @@ define('Core/BoundingSphere',[ * @returns {Interval} The nearest and farthest distances on the bounding sphere from position in direction. */ BoundingSphere.computePlaneDistances = function(sphere, position, direction, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(position)) { - throw new DeveloperError('position is required.'); - } - - if (!defined(direction)) { - throw new DeveloperError('direction is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); if (!defined(result)) { result = new Interval(); @@ -10882,9 +10347,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.projectTo2D = function(sphere, projection, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } + Check.typeOf.object('sphere', sphere); projection = defaultValue(projection, projectTo2DProjection); @@ -10979,12 +10442,8 @@ define('Core/BoundingSphere',[ * @returns {Boolean} <code>true</code> if the sphere is not visible; otherwise <code>false</code>. */ BoundingSphere.isOccluded = function(sphere, occluder) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(occluder)) { - throw new DeveloperError('occluder is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('occluder', occluder); return !occluder.isBoundingSphereVisible(sphere); }; @@ -12193,7 +11652,10 @@ define('Core/WebGLConstants',[ COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : 0x9279, TEXTURE_IMMUTABLE_FORMAT : 0x912F, MAX_ELEMENT_INDEX : 0x8D6B, - TEXTURE_IMMUTABLE_LEVELS : 0x82DF + TEXTURE_IMMUTABLE_LEVELS : 0x82DF, + + // Extensions + MAX_TEXTURE_MAX_ANISOTROPY_EXT : 0x84FF }; return freezeObject(WebGLConstants); @@ -12723,7 +12185,7 @@ define('Core/Geometry',[ * <li><code>position</code> - 3D vertex position. 64-bit floating-point (for precision). 3 components per attribute. See {@link VertexFormat#position}.</li> * <li><code>normal</code> - Normal (normalized), commonly used for lighting. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#normal}.</li> * <li><code>st</code> - 2D texture coordinate. 32-bit floating-point. 2 components per attribute. See {@link VertexFormat#st}.</li> - * <li><code>binormal</code> - Binormal (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#binormal}.</li> + * <li><code>bitangent</code> - Bitangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#bitangent}.</li> * <li><code>tangent</code> - Tangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#tangent}.</li> * </ul> * </p> @@ -12752,7 +12214,7 @@ define('Core/Geometry',[ * componentsPerAttribute : 3, * values : new Float32Array(0) * }); - * + * * @see GeometryAttribute * @see VertexFormat */ @@ -13033,7 +12495,7 @@ define('Core/GeometryAttributes',[ this.st = options.st; /** - * The binormal attribute (normalized), which is used for tangent-space effects like bump mapping. + * The bitangent attribute (normalized), which is used for tangent-space effects like bump mapping. * <p> * 32-bit floating-point. 3 components per attribute. * </p> @@ -13042,7 +12504,7 @@ define('Core/GeometryAttributes',[ * * @default undefined */ - this.binormal = options.binormal; + this.bitangent = options.bitangent; /** * The tangent attribute (normalized), which is used for tangent-space effects like bump mapping. @@ -13868,12 +13330,14 @@ return earcut; /*global define*/ define('Core/Cartesian2',[ + './Check', './defaultValue', './defined', './DeveloperError', './freezeObject', './Math' ], function( + Check, defaultValue, defined, DeveloperError, @@ -13985,12 +13449,8 @@ define('Core/Cartesian2',[ * @returns {Number[]} The array that was packed into */ Cartesian2.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -14009,9 +13469,7 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided. */ Cartesian2.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -14031,9 +13489,7 @@ define('Core/Cartesian2',[ * @returns {Number[]} The packed array. */ Cartesian2.packArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -14056,9 +13512,7 @@ define('Core/Cartesian2',[ * @returns {Cartesian2[]} The unpacked array. */ Cartesian2.unpackArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -14101,9 +13555,7 @@ define('Core/Cartesian2',[ * @returns {Number} The value of the maximum component. */ Cartesian2.maximumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y); }; @@ -14115,9 +13567,7 @@ define('Core/Cartesian2',[ * @returns {Number} The value of the minimum component. */ Cartesian2.minimumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y); }; @@ -14131,15 +13581,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} A cartesian with the minimum components. */ Cartesian2.minimumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); @@ -14157,15 +13601,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} A cartesian with the maximum components. */ Cartesian2.maximumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -14179,9 +13617,7 @@ define('Core/Cartesian2',[ * @returns {Number} The squared magnitude. */ Cartesian2.magnitudeSquared = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y; }; @@ -14247,12 +13683,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.normalize = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian2.magnitude(cartesian); @@ -14274,12 +13706,8 @@ define('Core/Cartesian2',[ * @returns {Number} The dot product. */ Cartesian2.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y; }; @@ -14293,15 +13721,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.multiplyComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -14317,15 +13739,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.divideComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x / right.x; result.y = left.y / right.y; @@ -14341,15 +13757,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -14365,15 +13775,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -14389,15 +13793,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.multiplyByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -14413,15 +13811,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.divideByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -14436,12 +13828,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.negate = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -14456,12 +13844,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.abs = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -14479,18 +13863,10 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian2.multiplyByScalar(end, t, lerpScratch); result = Cartesian2.multiplyByScalar(start, 1.0 - t, result); @@ -14507,12 +13883,8 @@ define('Core/Cartesian2',[ * @returns {Number} The angle between the Cartesians. */ Cartesian2.angleBetween = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian2.normalize(left, angleBetweenScratch); Cartesian2.normalize(right, angleBetweenScratch2); @@ -14528,12 +13900,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The most orthogonal axis. */ Cartesian2.mostOrthogonalAxis = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian2.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian2.abs(f, f); @@ -14996,6 +14364,7 @@ define('Core/PolygonPipeline',[ /*global define*/ define('Core/Matrix2',[ './Cartesian2', + './Check', './defaultValue', './defined', './defineProperties', @@ -15003,6 +14372,7 @@ define('Core/Matrix2',[ './freezeObject' ], function( Cartesian2, + Check, defaultValue, defined, defineProperties, @@ -15051,13 +14421,8 @@ define('Core/Matrix2',[ * @returns {Number[]} The array that was packed into */ Matrix2.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -15078,9 +14443,7 @@ define('Core/Matrix2',[ * @returns {Matrix2} The modified result parameter or a new Matrix2 instance if one was not provided. */ Matrix2.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -15102,18 +14465,18 @@ define('Core/Matrix2',[ * @param {Matrix2} [result] The object onto which to store the result. * @returns {Matrix2} The modified result parameter or a new Matrix2 instance if one was not provided. (Returns undefined if matrix is undefined) */ - Matrix2.clone = function(values, result) { - if (!defined(values)) { + Matrix2.clone = function(matrix, result) { + if (!defined(matrix)) { return undefined; } if (!defined(result)) { - return new Matrix2(values[0], values[2], - values[1], values[3]); + return new Matrix2(matrix[0], matrix[2], + matrix[1], matrix[3]); } - result[0] = values[0]; - result[1] = values[1]; - result[2] = values[2]; - result[3] = values[3]; + result[0] = matrix[0]; + result[1] = matrix[1]; + result[2] = matrix[2]; + result[3] = matrix[3]; return result; }; @@ -15138,9 +14501,7 @@ define('Core/Matrix2',[ * var m2 = Cesium.Matrix2.fromArray(v2, 2); */ Matrix2.fromArray = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -15163,9 +14524,7 @@ define('Core/Matrix2',[ * @returns {Matrix2} The modified result parameter, or a new Matrix2 instance if one was not provided. */ Matrix2.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values parameter is required'); - } + Check.defined('values', values); return Matrix2.clone(values, result); }; @@ -15179,9 +14538,7 @@ define('Core/Matrix2',[ * @returns {Matrix2} The modified result parameter, or a new Matrix2 instance if one was not provided. */ Matrix2.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix2(values[0], values[1], @@ -15208,9 +14565,7 @@ define('Core/Matrix2',[ * var m = Cesium.Matrix2.fromScale(new Cesium.Cartesian2(7.0, 8.0)); */ Matrix2.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix2( @@ -15239,9 +14594,7 @@ define('Core/Matrix2',[ * var m = Cesium.Matrix2.fromUniformScale(2.0); */ Matrix2.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix2( @@ -15270,9 +14623,7 @@ define('Core/Matrix2',[ * var rotated = Cesium.Matrix2.multiplyByVector(m, p, new Cesium.Cartesian2()); */ Matrix2.fromRotation = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -15298,9 +14649,7 @@ define('Core/Matrix2',[ * @returns {Number[]} The modified Array parameter or a new Array instance if one was not provided. */ Matrix2.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3]]; @@ -15329,12 +14678,11 @@ define('Core/Matrix2',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix2.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 1) { - throw new DeveloperError('row must be 0 or 1.'); - } - if (typeof column !== 'number' || column < 0 || column > 1) { - throw new DeveloperError('column must be 0 or 1.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 1); + + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 1); return column * 2 + row; }; @@ -15350,15 +14698,12 @@ define('Core/Matrix2',[ * @exception {DeveloperError} index must be 0 or 1. */ Matrix2.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (typeof index !== 'number' || index < 0 || index > 1) { - throw new DeveloperError('index must be 0 or 1.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 1); + + Check.typeOf.object('result', result); var startIndex = index * 2; var x = matrix[startIndex]; @@ -15381,18 +14726,13 @@ define('Core/Matrix2',[ * @exception {DeveloperError} index must be 0 or 1. */ Matrix2.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 1) { - throw new DeveloperError('index must be 0 or 1.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 1); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix2.clone(matrix, result); var startIndex = index * 2; @@ -15412,15 +14752,12 @@ define('Core/Matrix2',[ * @exception {DeveloperError} index must be 0 or 1. */ Matrix2.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (typeof index !== 'number' || index < 0 || index > 1) { - throw new DeveloperError('index must be 0 or 1.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 1); + + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 2]; @@ -15442,18 +14779,13 @@ define('Core/Matrix2',[ * @exception {DeveloperError} index must be 0 or 1. */ Matrix2.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 1) { - throw new DeveloperError('index must be 0 or 1.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 1); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix2.clone(matrix, result); result[index] = cartesian.x; @@ -15471,12 +14803,8 @@ define('Core/Matrix2',[ * @returns {Cartesian2} The modified result parameter. */ Matrix2.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian2.magnitude(Cartesian2.fromElements(matrix[0], matrix[1], scratchColumn)); result.y = Cartesian2.magnitude(Cartesian2.fromElements(matrix[2], matrix[3], scratchColumn)); @@ -15506,15 +14834,9 @@ define('Core/Matrix2',[ * @returns {Matrix2} The modified result parameter. */ Matrix2.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var column0Row0 = left[0] * right[0] + left[2] * right[1]; var column1Row0 = left[0] * right[2] + left[2] * right[3]; @@ -15537,15 +14859,9 @@ define('Core/Matrix2',[ * @returns {Matrix2} The modified result parameter. */ Matrix2.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -15563,15 +14879,9 @@ define('Core/Matrix2',[ * @returns {Matrix2} The modified result parameter. */ Matrix2.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -15589,15 +14899,9 @@ define('Core/Matrix2',[ * @returns {Cartesian2} The modified result parameter. */ Matrix2.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var x = matrix[0] * cartesian.x + matrix[2] * cartesian.y; var y = matrix[1] * cartesian.x + matrix[3] * cartesian.y; @@ -15616,15 +14920,9 @@ define('Core/Matrix2',[ * @returns {Matrix2} The modified result parameter. */ Matrix2.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -15650,15 +14948,9 @@ define('Core/Matrix2',[ * @see Matrix2.multiplyByUniformScale */ Matrix2.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); result[0] = matrix[0] * scale.x; result[1] = matrix[1] * scale.x; @@ -15675,12 +14967,8 @@ define('Core/Matrix2',[ * @returns {Matrix2} The modified result parameter. */ Matrix2.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -15697,12 +14985,8 @@ define('Core/Matrix2',[ * @returns {Matrix2} The modified result parameter. */ Matrix2.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var column0Row0 = matrix[0]; var column0Row1 = matrix[2]; @@ -15724,12 +15008,8 @@ define('Core/Matrix2',[ * @returns {Matrix2} The modified result parameter. */ Matrix2.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -15778,9 +15058,7 @@ define('Core/Matrix2',[ * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. */ Matrix2.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createSimplePolylineGeometry.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createSimplePolylineGeometry.js index d3e36a63..ed7e5c05 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createSimplePolylineGeometry.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createSimplePolylineGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,68 +45,6 @@ define('Core/defined',[],function() { return defined; }); -/*global define*/ -define('Core/freezeObject',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Freezes an object, using Object.freeze if available, otherwise returns - * the object unchanged. This function should be used in setup code to prevent - * errors from completely halting JavaScript execution in legacy browsers. - * - * @private - * - * @exports freezeObject - */ - var freezeObject = Object.freeze; - if (!defined(freezeObject)) { - freezeObject = function(o) { - return o; - }; - } - - return freezeObject; -}); - -/*global define*/ -define('Core/defaultValue',[ - './freezeObject' - ], function( - freezeObject) { - 'use strict'; - - /** - * Returns the first parameter if not undefined, otherwise the second parameter. - * Useful for setting a default value for a parameter. - * - * @exports defaultValue - * - * @param {*} a - * @param {*} b - * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter. - * - * @example - * param = Cesium.defaultValue(param, 'default'); - */ - function defaultValue(a, b) { - if (a !== undefined) { - return a; - } - return b; - } - - /** - * A frozen empty object that can be used as the default value for options passed as - * an object literal. - */ - defaultValue.EMPTY_OBJECT = freezeObject({}); - - return defaultValue; -}); - /*global define*/ define('Core/DeveloperError',[ './defined' @@ -188,41 +126,13 @@ define('Core/DeveloperError',[ return DeveloperError; }); -/*global define*/ -define('Core/isArray',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Tests an object to see if it is an array. - * @exports isArray - * - * @param {Object} value The value to test. - * @returns {Boolean} true if the value is an array, false otherwise. - */ - var isArray = Array.isArray; - if (!defined(isArray)) { - isArray = function(value) { - return Object.prototype.toString.call(value) === '[object Array]'; - }; - } - - return isArray; -}); - /*global define*/ define('Core/Check',[ - './defaultValue', - './defined', - './DeveloperError', - './isArray' + './defined', + './DeveloperError' ], function( - defaultValue, defined, - DeveloperError, - isArray) { + DeveloperError) { 'use strict'; /** @@ -237,111 +147,134 @@ define('Core/Check',[ */ Check.typeOf = {}; - /** - * Contains functions for checking numeric conditions such as minimum and maximum values - */ - Check.numeric = {}; - function getUndefinedErrorMessage(name) { - return name + ' was required but undefined.'; + return name + ' is required, actual value was undefined'; } function getFailedTypeErrorMessage(actual, expected, name) { - return 'Expected ' + name + ' to be typeof ' + expected + ', got ' + actual; + return 'Expected ' + name + ' to be typeof ' + expected + ', actual typeof was ' + actual; } /** * Throws if test is not defined * - * @param {*} test The value that is to be checked * @param {String} name The name of the variable being tested + * @param {*} test The value that is to be checked * @exception {DeveloperError} test must be defined */ - Check.defined = function (test, name) { + Check.defined = function (name, test) { if (!defined(test)) { throw new DeveloperError(getUndefinedErrorMessage(name)); } }; /** - * Throws if test is greater than maximum + * Throws if test is not typeof 'function' * - * @param {Number} test The value to test - * @param {Number} maximum The maximum allowed value - * @exception {DeveloperError} test must not be greater than maximum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'function' */ - Check.numeric.maximum = function (test, maximum) { - Check.typeOf.number(test); - Check.typeOf.number(maximum); - if (test > maximum) { - throw new DeveloperError('Expected ' + test + ' to be at most ' + maximum); + Check.typeOf.func = function (name, test) { + if (typeof test !== 'function') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); } }; /** - * Throws if test is less than minimum + * Throws if test is not typeof 'string' * - * @param {Number} test The value to test - * @param {Number} minimum The minimum allowed value - * @exception {DeveloperError} test must not be less than mininum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'string' */ - Check.numeric.minimum = function (test, minimum) { - Check.typeOf.number(test); - Check.typeOf.number(minimum); - if (test < minimum) { - throw new DeveloperError('Expected ' + test + ' to be at least ' + minimum); + Check.typeOf.string = function (name, test) { + if (typeof test !== 'string') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); } }; /** - * Throws if test is not typeof 'function' + * Throws if test is not typeof 'number' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'function' + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'number' */ - Check.typeOf.function = function (test, name) { - if (typeof test !== 'function') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); + Check.typeOf.number = function (name, test) { + if (typeof test !== 'number') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); } }; /** - * Throws if test is not typeof 'string' + * Throws if test is not typeof 'number' and less than limit * + * @param {String} name The name of the variable being tested * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than limit + */ + Check.typeOf.number.lessThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test >= limit) { + throw new DeveloperError('Expected ' + name + ' to be less than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and less than or equal to limit + * * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'string' + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than or equal to limit */ - Check.typeOf.string = function (test, name) { - if (typeof test !== 'string') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); + Check.typeOf.number.lessThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test > limit) { + throw new DeveloperError('Expected ' + name + ' to be less than or equal to ' + limit + ', actual value was ' + test); } }; /** - * Throws if test is not typeof 'number' + * Throws if test is not typeof 'number' and greater than limit * + * @param {String} name The name of the variable being tested * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than limit + */ + Check.typeOf.number.greaterThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test <= limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and greater than or equal to limit + * * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'number' + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than or equal to limit */ - Check.typeOf.number = function (test, name) { - if (typeof test !== 'number') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); + Check.typeOf.number.greaterThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test < limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than or equal to' + limit + ', actual value was ' + test); } }; /** * Throws if test is not typeof 'object' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested + * @param {*} test The value to test * @exception {DeveloperError} test must be typeof 'object' */ - Check.typeOf.object = function (test, name) { + Check.typeOf.object = function (name, test) { if (typeof test !== 'object') { throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'object', name)); } @@ -350,11 +283,11 @@ define('Core/Check',[ /** * Throws if test is not typeof 'boolean' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested + * @param {*} test The value to test * @exception {DeveloperError} test must be typeof 'boolean' */ - Check.typeOf.boolean = function (test, name) { + Check.typeOf.bool = function (name, test) { if (typeof test !== 'boolean') { throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'boolean', name)); } @@ -363,6 +296,68 @@ define('Core/Check',[ return Check; }); +/*global define*/ +define('Core/freezeObject',[ + './defined' + ], function( + defined) { + 'use strict'; + + /** + * Freezes an object, using Object.freeze if available, otherwise returns + * the object unchanged. This function should be used in setup code to prevent + * errors from completely halting JavaScript execution in legacy browsers. + * + * @private + * + * @exports freezeObject + */ + var freezeObject = Object.freeze; + if (!defined(freezeObject)) { + freezeObject = function(o) { + return o; + }; + } + + return freezeObject; +}); + +/*global define*/ +define('Core/defaultValue',[ + './freezeObject' + ], function( + freezeObject) { + 'use strict'; + + /** + * Returns the first parameter if not undefined, otherwise the second parameter. + * Useful for setting a default value for a parameter. + * + * @exports defaultValue + * + * @param {*} a + * @param {*} b + * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter. + * + * @example + * param = Cesium.defaultValue(param, 'default'); + */ + function defaultValue(a, b) { + if (a !== undefined) { + return a; + } + return b; + } + + /** + * A frozen empty object that can be used as the default value for options passed as + * an object literal. + */ + defaultValue.EMPTY_OBJECT = freezeObject({}); + + return defaultValue; +}); + /* I've wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace so it's better encapsulated. Now you can have multiple random number generators @@ -1047,7 +1042,7 @@ define('Core/Math',[ if (!defined(angle)) { throw new DeveloperError('angle is required.'); } - + return CesiumMath.clamp(angle, -1*CesiumMath.PI_OVER_TWO, CesiumMath.PI_OVER_TWO); }; @@ -1057,11 +1052,11 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [<code>-CesiumMath.PI</code>, <code>CesiumMath.PI</code>]. */ - CesiumMath.negativePiToPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.negativePiToPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - return CesiumMath.zeroToTwoPi(x + CesiumMath.PI) - CesiumMath.PI; + return CesiumMath.zeroToTwoPi(angle + CesiumMath.PI) - CesiumMath.PI; }; /** @@ -1070,12 +1065,12 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [0, <code>CesiumMath.TWO_PI</code>]. */ - CesiumMath.zeroToTwoPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.zeroToTwoPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - var mod = CesiumMath.mod(x, CesiumMath.TWO_PI); - if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(x) > CesiumMath.EPSILON14) { + var mod = CesiumMath.mod(angle, CesiumMath.TWO_PI); + if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(angle) > CesiumMath.EPSILON14) { return CesiumMath.TWO_PI; } return mod; @@ -1145,7 +1140,7 @@ define('Core/Math',[ * @example * //Compute 7!, which is equal to 5040 * var computedFactorial = Cesium.Math.factorial(7); - * + * * @see {@link http://en.wikipedia.org/wiki/Factorial|Factorial on Wikipedia} */ CesiumMath.factorial = function(n) { @@ -1429,7 +1424,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.fromSpherical = function(spherical, result) { - Check.typeOf.object(spherical, 'spherical'); + Check.typeOf.object('spherical', spherical); if (!defined(result)) { result = new Cartesian3(); @@ -1513,8 +1508,8 @@ define('Core/Cartesian3',[ * @returns {Number[]} The array that was packed into */ Cartesian3.pack = function(value, array, startingIndex) { - Check.typeOf.object(value, 'value'); - Check.defined(array, 'array'); + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1534,7 +1529,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.unpack = function(array, startingIndex, result) { - Check.defined(array, 'array'); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1555,7 +1550,7 @@ define('Core/Cartesian3',[ * @returns {Number[]} The packed array. */ Cartesian3.packArray = function(array, result) { - Check.defined(array, 'array'); + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -1578,8 +1573,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3[]} The unpacked array. */ Cartesian3.unpackArray = function(array, result) { - Check.defined(array, 'array'); - Check.numeric.minimum(array.length, 3); + Check.defined('array', array); + Check.typeOf.number.greaterThanOrEquals('array.length', array.length, 3); if (array.length % 3 !== 0) { throw new DeveloperError('array length must be a multiple of 3.'); } @@ -1625,7 +1620,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the maximum component. */ Cartesian3.maximumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z); }; @@ -1637,7 +1632,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the minimum component. */ Cartesian3.minimumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z); }; @@ -1651,9 +1646,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the minimum components. */ Cartesian3.minimumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -1671,9 +1666,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the maximum components. */ Cartesian3.maximumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -1688,7 +1683,7 @@ define('Core/Cartesian3',[ * @returns {Number} The squared magnitude. */ Cartesian3.magnitudeSquared = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z; }; @@ -1717,8 +1712,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distance(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(2.0, 0.0, 0.0)); */ Cartesian3.distance = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitude(distanceScratch); @@ -1737,8 +1732,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distanceSquared(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(3.0, 0.0, 0.0)); */ Cartesian3.distanceSquared = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitudeSquared(distanceScratch); @@ -1752,8 +1747,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.normalize = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian3.magnitude(cartesian); @@ -1776,8 +1771,8 @@ define('Core/Cartesian3',[ * @returns {Number} The dot product. */ Cartesian3.dot = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z; }; @@ -1791,9 +1786,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyComponents = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -1835,9 +1830,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.add = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -1854,9 +1849,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.subtract = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -1873,9 +1868,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -1892,9 +1887,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.divideByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -1910,8 +1905,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.negate = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -1927,8 +1922,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.abs = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -1947,10 +1942,10 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.lerp = function(start, end, t, result) { - Check.typeOf.object(start, 'start'); - Check.typeOf.object(end, 'end'); - Check.typeOf.number(t, 't'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian3.multiplyByScalar(end, t, lerpScratch); result = Cartesian3.multiplyByScalar(start, 1.0 - t, result); @@ -1967,8 +1962,8 @@ define('Core/Cartesian3',[ * @returns {Number} The angle between the Cartesians. */ Cartesian3.angleBetween = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.normalize(left, angleBetweenScratch); Cartesian3.normalize(right, angleBetweenScratch2); @@ -1986,8 +1981,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The most orthogonal axis. */ Cartesian3.mostOrthogonalAxis = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian3.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian3.abs(f, f); @@ -2064,9 +2059,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The cross product. */ Cartesian3.cross = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var leftX = left.x; var leftY = left.y; @@ -2099,8 +2094,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromDegrees(-115.0, 37.0); */ Cartesian3.fromDegrees = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); longitude = CesiumMath.toRadians(longitude); latitude = CesiumMath.toRadians(latitude); @@ -2125,8 +2120,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromRadians(-2.007, 0.645); */ Cartesian3.fromRadians = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); height = defaultValue(height, 0.0); var radiiSquared = defined(ellipsoid) ? ellipsoid.radiiSquared : wgs84RadiiSquared; @@ -2160,7 +2155,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArray([-115.0, 37.0, -107.0, 33.0]); */ Cartesian3.fromDegreesArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -2194,7 +2189,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArray([-2.007, 0.645, -1.867, .575]); */ Cartesian3.fromRadiansArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -2228,7 +2223,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArrayHeights([-115.0, 37.0, 100000.0, -107.0, 33.0, 150000.0]); */ Cartesian3.fromDegreesArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -2263,7 +2258,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArrayHeights([-2.007, 0.645, 100000.0, -1.867, .575, 150000.0]); */ Cartesian3.fromRadiansArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -3010,7 +3005,9 @@ define('Core/Ellipsoid',[ /** * Computes an Ellipsoid from a Cartesian specifying the radii in x, y, and z directions. * - * @param {Cartesian3} [radii=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Cartesian3} [cartesian=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new + * instance should be created. * @returns {Ellipsoid} A new Ellipsoid instance. * * @exception {DeveloperError} All radii components must be greater than or equal to zero. @@ -3650,6 +3647,7 @@ define('Core/Interval',[ /*global define*/ define('Core/Matrix3',[ './Cartesian3', + './Check', './defaultValue', './defined', './defineProperties', @@ -3658,6 +3656,7 @@ define('Core/Matrix3',[ './Math' ], function( Cartesian3, + Check, defaultValue, defined, defineProperties, @@ -3720,13 +3719,8 @@ define('Core/Matrix3',[ * @returns {Number[]} The array that was packed into */ Matrix3.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3752,9 +3746,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. */ Matrix3.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3781,24 +3773,24 @@ define('Core/Matrix3',[ * @param {Matrix3} [result] The object onto which to store the result. * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. (Returns undefined if matrix is undefined) */ - Matrix3.clone = function(values, result) { - if (!defined(values)) { + Matrix3.clone = function(matrix, result) { + if (!defined(matrix)) { return undefined; } if (!defined(result)) { - return new Matrix3(values[0], values[3], values[6], - values[1], values[4], values[7], - values[2], values[5], values[8]); + return new Matrix3(matrix[0], matrix[3], matrix[6], + matrix[1], matrix[4], matrix[7], + matrix[2], matrix[5], matrix[8]); } - result[0] = values[0]; - result[1] = values[1]; - result[2] = values[2]; - result[3] = values[3]; - result[4] = values[4]; - result[5] = values[5]; - result[6] = values[6]; - result[7] = values[7]; - result[8] = values[8]; + result[0] = matrix[0]; + result[1] = matrix[1]; + result[2] = matrix[2]; + result[3] = matrix[3]; + result[4] = matrix[4]; + result[5] = matrix[5]; + result[6] = matrix[6]; + result[7] = matrix[7]; + result[8] = matrix[8]; return result; }; @@ -3824,9 +3816,7 @@ define('Core/Matrix3',[ * var m2 = Cesium.Matrix3.fromArray(v2, 2); */ Matrix3.fromArray = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3854,9 +3844,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values parameter is required'); - } + Check.defined('values', values); return Matrix3.clone(values, result); }; @@ -3870,9 +3858,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix3(values[0], values[1], values[2], @@ -3899,9 +3885,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this quaternion. */ Matrix3.fromQuaternion = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); var x2 = quaternion.x * quaternion.x; var xy = quaternion.x * quaternion.y; @@ -3951,10 +3935,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this headingPitchRoll. */ Matrix3.fromHeadingPitchRoll = function(headingPitchRoll, result) { - if (!defined(headingPitchRoll)) { - throw new DeveloperError('headingPitchRoll is required'); - } - var cosTheta = Math.cos(-headingPitchRoll.pitch); + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + + var cosTheta = Math.cos(-headingPitchRoll.pitch); var cosPsi = Math.cos(-headingPitchRoll.heading); var cosPhi = Math.cos(headingPitchRoll.roll); var sinTheta = Math.sin(-headingPitchRoll.pitch); @@ -4005,9 +3988,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix3( @@ -4043,9 +4024,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromUniformScale(2.0); */ Matrix3.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix3( @@ -4069,7 +4048,7 @@ define('Core/Matrix3',[ /** * Computes a Matrix3 instance representing the cross product equivalent matrix of a Cartesian3 vector. * - * @param {Cartesian3} the vector on the left hand side of the cross product operation. + * @param {Cartesian3} vector the vector on the left hand side of the cross product operation. * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created. * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. * @@ -4081,9 +4060,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromCrossProduct(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromCrossProduct = function(vector, result) { - if (!defined(vector)) { - throw new DeveloperError('vector is required.'); - } + Check.typeOf.object('vector', vector); if (!defined(result)) { return new Matrix3( @@ -4118,9 +4095,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationX = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4159,9 +4134,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationY = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4200,9 +4173,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationZ = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4236,9 +4207,7 @@ define('Core/Matrix3',[ * @returns {Number[]} The modified Array parameter or a new Array instance if one was not provided. */ Matrix3.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5], matrix[6], matrix[7], matrix[8]]; @@ -4272,12 +4241,10 @@ define('Core/Matrix3',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix3.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 2) { - throw new DeveloperError('row must be 0, 1, or 2.'); - } - if (typeof column !== 'number' || column < 0 || column > 2) { - throw new DeveloperError('column must be 0, 1, or 2.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 2); + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 2); return column * 3 + row; }; @@ -4293,16 +4260,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var startIndex = index * 3; var x = matrix[startIndex]; @@ -4327,18 +4288,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); var startIndex = index * 3; @@ -4359,15 +4313,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 3]; @@ -4391,18 +4340,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); result[index] = cartesian.x; @@ -4421,12 +4363,8 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[3], matrix[4], matrix[5], scratchColumn)); @@ -4457,15 +4395,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var column0Row0 = left[0] * right[0] + left[3] * right[1] + left[6] * right[2]; var column0Row1 = left[1] * right[0] + left[4] * right[1] + left[7] * right[2]; @@ -4500,15 +4432,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -4531,15 +4457,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -4562,15 +4482,9 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -4595,15 +4509,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -4634,15 +4542,9 @@ define('Core/Matrix3',[ * @see Matrix3.multiplyByUniformScale */ Matrix3.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); result[0] = matrix[0] * scale.x; result[1] = matrix[1] * scale.x; @@ -4664,12 +4566,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -4691,12 +4589,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var column0Row0 = matrix[0]; var column0Row1 = matrix[3]; @@ -4836,9 +4730,7 @@ define('Core/Matrix3',[ * var c = Cesium.Cartesian3.multiplyByScalar(v, lambda, new Cesium.Cartesian3()); // equal to Cesium.Matrix3.multiplyByVector(a, v) */ Matrix3.computeEigenDecomposition = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); // This routine was created based upon Matrix Computations, 3rd ed., by Golub and Van Loan, // section 8.4.3 The Classical Jacobi Algorithm @@ -4882,12 +4774,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -4909,9 +4797,7 @@ define('Core/Matrix3',[ * @returns {Number} The value of the determinant of the matrix. */ Matrix3.determinant = function(matrix) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); var m11 = matrix[0]; var m21 = matrix[3]; @@ -4936,12 +4822,8 @@ define('Core/Matrix3',[ * @exception {DeveloperError} matrix is not invertible. */ Matrix3.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var m11 = matrix[0]; var m21 = matrix[1]; @@ -5007,9 +4889,7 @@ define('Core/Matrix3',[ * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. */ Matrix3.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -5197,12 +5077,14 @@ define('Core/Matrix3',[ /*global define*/ define('Core/Cartesian4',[ + './Check', './defaultValue', './defined', './DeveloperError', './freezeObject', './Math' ], function( + Check, defaultValue, defined, DeveloperError, @@ -5285,9 +5167,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.fromColor = function(color, result) { - if (!defined(color)) { - throw new DeveloperError('color is required'); - } + Check.typeOf.object('color', color); if (!defined(result)) { return new Cartesian4(color.red, color.green, color.blue, color.alpha); } @@ -5339,12 +5219,8 @@ define('Core/Cartesian4',[ * @returns {Number[]} The array that was packed into */ Cartesian4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5365,9 +5241,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5389,9 +5263,7 @@ define('Core/Cartesian4',[ * @returns {Number[]} The packed array. */ Cartesian4.packArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -5414,9 +5286,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4[]} The unpacked array. */ Cartesian4.unpackArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -5459,9 +5329,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the maximum component. */ Cartesian4.maximumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -5473,9 +5341,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the minimum component. */ Cartesian4.minimumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -5489,15 +5355,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the minimum components. */ Cartesian4.minimumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -5516,15 +5376,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the maximum components. */ Cartesian4.maximumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -5541,9 +5395,7 @@ define('Core/Cartesian4',[ * @returns {Number} The squared magnitude. */ Cartesian4.magnitudeSquared = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z + cartesian.w * cartesian.w; }; @@ -5574,9 +5426,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(2.0, 0.0, 0.0, 0.0)); */ Cartesian4.distance = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitude(distanceScratch); @@ -5597,9 +5448,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(3.0, 0.0, 0.0, 0.0)); */ Cartesian4.distanceSquared = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitudeSquared(distanceScratch); @@ -5613,12 +5463,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.normalize = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian4.magnitude(cartesian); @@ -5642,12 +5488,8 @@ define('Core/Cartesian4',[ * @returns {Number} The dot product. */ Cartesian4.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w; }; @@ -5661,15 +5503,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -5687,15 +5523,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x / right.x; result.y = left.y / right.y; @@ -5713,15 +5543,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -5739,15 +5563,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -5765,15 +5583,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -5791,15 +5603,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -5816,12 +5622,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.negate = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -5838,12 +5640,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.abs = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -5863,18 +5661,10 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian4.multiplyByScalar(end, t, lerpScratch); result = Cartesian4.multiplyByScalar(start, 1.0 - t, result); @@ -5890,12 +5680,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The most orthogonal axis. */ Cartesian4.mostOrthogonalAxis = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian4.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian4.abs(f, f); @@ -6140,6 +5926,7 @@ define('Core/RuntimeError',[ define('Core/Matrix4',[ './Cartesian3', './Cartesian4', + './Check', './defaultValue', './defined', './defineProperties', @@ -6151,6 +5938,7 @@ define('Core/Matrix4',[ ], function( Cartesian3, Cartesian4, + Check, defaultValue, defined, defineProperties, @@ -6241,13 +6029,8 @@ define('Core/Matrix4',[ * @returns {Number[]} The array that was packed into */ Matrix4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -6280,9 +6063,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if one was not provided. */ Matrix4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -6378,9 +6159,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required'); - } + Check.defined('values', values); return Matrix4.clone(values, result); }; @@ -6394,9 +6173,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix4(values[0], values[1], values[2], values[3], @@ -6433,9 +6210,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRotationTranslation = function(rotation, translation, result) { - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } + Check.typeOf.object('rotation', rotation); translation = defaultValue(translation, Cartesian3.ZERO); @@ -6483,15 +6258,9 @@ define('Core/Matrix4',[ * result); */ Matrix4.fromTranslationQuaternionRotationScale = function(translation, rotation, scale, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('translation', translation); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('scale', scale); if (!defined(result)) { result = new Matrix4(); @@ -6552,9 +6321,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromTranslationRotationScale = function(translationRotationScale, result) { - if (!defined(translationRotationScale)) { - throw new DeveloperError('translationRotationScale is required.'); - } + Check.typeOf.object('translationRotationScale', translationRotationScale); return Matrix4.fromTranslationQuaternionRotationScale(translationRotationScale.translation, translationRotationScale.rotation, translationRotationScale.scale, result); }; @@ -6569,9 +6336,7 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByTranslation */ Matrix4.fromTranslation = function(translation, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } + Check.typeOf.object('translation', translation); return Matrix4.fromRotationTranslation(Matrix3.IDENTITY, translation, result); }; @@ -6592,9 +6357,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix4.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix4( @@ -6639,9 +6402,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromUniformScale(2.0); */ Matrix4.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix4(scale, 0.0, 0.0, 0.0, @@ -6681,23 +6442,15 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromCamera = function(camera, result) { - if (!defined(camera)) { - throw new DeveloperError('camera is required.'); - } + Check.typeOf.object('camera', camera); var position = camera.position; var direction = camera.direction; var up = camera.up; - if (!defined(position)) { - throw new DeveloperError('camera.position is required.'); - } - if (!defined(direction)) { - throw new DeveloperError('camera.direction is required.'); - } - if (!defined(up)) { - throw new DeveloperError('camera.up is required.'); - } + Check.typeOf.object('camera.position', position); + Check.typeOf.object('camera.direction', direction); + Check.typeOf.object('camera.up', up); Cartesian3.normalize(direction, fromCameraF); Cartesian3.normalize(Cartesian3.cross(fromCameraF, up, fromCameraR), fromCameraR); @@ -6776,21 +6529,11 @@ define('Core/Matrix4',[ * @exception {DeveloperError} far must be greater than zero. */ Matrix4.computePerspectiveFieldOfView = function(fovY, aspectRatio, near, far, result) { - if (fovY <= 0.0 || fovY > Math.PI) { - throw new DeveloperError('fovY must be in (0, PI].'); - } - if (aspectRatio <= 0.0) { - throw new DeveloperError('aspectRatio must be greater than zero.'); - } - if (near <= 0.0) { - throw new DeveloperError('near must be greater than zero.'); - } - if (far <= 0.0) { - throw new DeveloperError('far must be greater than zero.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThan('fovY', fovY, 0.0); + Check.typeOf.number.lessThan('fovY', fovY, Math.PI); + Check.typeOf.number.greaterThan('near', near, 0.0); + Check.typeOf.number.greaterThan('far', far, 0.0); + Check.typeOf.object('result', result); var bottom = Math.tan(fovY * 0.5); @@ -6831,27 +6574,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeOrthographicOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var a = 1.0 / (right - left); var b = 1.0 / (top - bottom); @@ -6896,27 +6625,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computePerspectiveOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -6957,24 +6672,12 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeInfinitePerspectiveOffCenter = function(left, right, bottom, top, near, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -7022,9 +6725,7 @@ define('Core/Matrix4',[ * }, 0.0, 1.0, new Cesium.Matrix4()); */ Matrix4.computeViewportTransformation = function(viewport, nearDepthRange, farDepthRange, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); viewport = defaultValue(viewport, defaultValue.EMPTY_OBJECT); var x = defaultValue(viewport.x, 0.0); @@ -7076,21 +6777,11 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeView = function(position, direction, up, right, result) { - if (!defined(position)) { - throw new DeveloperError('position is required'); - } - if (!defined(direction)) { - throw new DeveloperError('direction is required'); - } - if (!defined(up)) { - throw new DeveloperError('up is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); + Check.typeOf.object('up', up); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = right.x; result[1] = up.x; @@ -7131,9 +6822,7 @@ define('Core/Matrix4',[ * //creates a = [10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0] */ Matrix4.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], @@ -7177,12 +6866,11 @@ define('Core/Matrix4',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix4.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 3) { - throw new DeveloperError('row must be 0, 1, 2, or 3.'); - } - if (typeof column !== 'number' || column < 0 || column > 3) { - throw new DeveloperError('column must be 0, 1, 2, or 3.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 3); + + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 3); return column * 4 + row; }; @@ -7215,16 +6903,12 @@ define('Core/Matrix4',[ * // a.x = 12.0; a.y = 16.0; a.z = 20.0; a.w = 24.0; */ Matrix4.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var startIndex = index * 4; var x = matrix[startIndex]; @@ -7266,18 +6950,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 96.0, 25.0] */ Matrix4.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); var startIndex = index * 4; @@ -7298,15 +6977,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.setTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -7359,16 +7032,12 @@ define('Core/Matrix4',[ * // a.x = 18.0; a.y = 19.0; a.z = 20.0; a.w = 21.0; */ Matrix4.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 4]; @@ -7409,18 +7078,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 24.0, 25.0] */ Matrix4.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); result[index] = cartesian.x; @@ -7440,12 +7104,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter */ Matrix4.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[4], matrix[5], matrix[6], scratchColumn)); @@ -7477,15 +7137,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -7569,15 +7223,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -7604,18 +7252,12 @@ define('Core/Matrix4',[ * @param {Matrix4} left The first matrix. * @param {Matrix4} right The second matrix. * @param {Matrix4} result The object onto which to store the result. - * @returns {Matrix4} The modified result parameter. - */ - Matrix4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + * @returns {Matrix4} The modified result parameter. + */ + Matrix4.subtract = function(left, right, result) { + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -7656,15 +7298,9 @@ define('Core/Matrix4',[ * var m3 = Cesium.Matrix4.multiplyTransformation(m1, m2, new Cesium.Matrix4()); */ Matrix4.multiplyTransformation = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -7742,15 +7378,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByMatrix3(m, rotation, m); */ Matrix4.multiplyByMatrix3 = function(matrix, rotation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('result', result); var left0 = matrix[0]; var left1 = matrix[1]; @@ -7818,15 +7448,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByTranslation(m, position, m); */ Matrix4.multiplyByTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); var x = translation.x; var y = translation.y; @@ -7878,15 +7502,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByScale */ Matrix4.multiplyByUniformScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scale', scale); + Check.typeOf.object('result', result); uniformScaleScratch.x = scale; uniformScaleScratch.y = scale; @@ -7915,15 +7533,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByUniformScale */ Matrix4.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); var scaleX = scale.x; var scaleY = scale.y; @@ -7962,15 +7574,9 @@ define('Core/Matrix4',[ * @returns {Cartesian4} The modified result parameter. */ Matrix4.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8006,15 +7612,9 @@ define('Core/Matrix4',[ * // Cesium.Matrix4.multiplyByVector(matrix, new Cesium.Cartesian4(p.x, p.y, p.z, 0.0), result); */ Matrix4.multiplyByPointAsVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8044,16 +7644,9 @@ define('Core/Matrix4',[ * var result = Cesium.Matrix4.multiplyByPoint(matrix, p, new Cesium.Cartesian3()); */ Matrix4.multiplyByPoint = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8093,15 +7686,9 @@ define('Core/Matrix4',[ * // [-44.0, -46.0, -48.0, -50.0] */ Matrix4.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -8145,12 +7732,8 @@ define('Core/Matrix4',[ * // [-22.0, -23.0, -24.0, -25.0] */ Matrix4.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -8194,12 +7777,8 @@ define('Core/Matrix4',[ * // [13.0, 17.0, 21.0, 25.0] */ Matrix4.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var matrix1 = matrix[1]; var matrix2 = matrix[2]; @@ -8235,12 +7814,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -8354,9 +7929,7 @@ define('Core/Matrix4',[ * //Prints "Difference between both the matrices is not less than 0.1" on the console */ Matrix4.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -8387,12 +7960,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter. */ Matrix4.getTranslation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = matrix[12]; result.y = matrix[13]; @@ -8423,12 +7992,8 @@ define('Core/Matrix4',[ * // [12.0, 16.0, 20.0] */ Matrix4.getRotation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -8460,12 +8025,8 @@ define('Core/Matrix4',[ * @exception {RuntimeError} matrix is not invertible because its determinate is zero. */ Matrix4.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); // Special case for a zero scale matrix that can occur, for example, // when a model's node has a [0, 0, 0] scale. @@ -8603,12 +8164,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.inverseTransformation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); //This function is an optimized version of the below 4 lines. //var rT = Matrix3.transpose(Matrix4.getRotation(matrix)); @@ -8892,6 +8449,7 @@ define('Core/Matrix4',[ /*global define*/ define('Core/Rectangle',[ './Cartographic', + './Check', './defaultValue', './defined', './defineProperties', @@ -8901,6 +8459,7 @@ define('Core/Rectangle',[ './Math' ], function( Cartographic, + Check, defaultValue, defined, defineProperties, @@ -8997,13 +8556,8 @@ define('Core/Rectangle',[ * @returns {Number[]} The array that was packed into */ Rectangle.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -9024,9 +8578,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -9047,9 +8599,7 @@ define('Core/Rectangle',[ * @returns {Number} The width. */ Rectangle.computeWidth = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; if (east < west) { @@ -9064,9 +8614,7 @@ define('Core/Rectangle',[ * @returns {Number} The height. */ Rectangle.computeHeight = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); return rectangle.north - rectangle.south; }; @@ -9101,6 +8649,32 @@ define('Core/Rectangle',[ return result; }; + /** + * Creates an rectangle given the boundary longitude and latitude in radians. + * + * @param {Number} [west=0.0] The westernmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [south=0.0] The southernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Number} [east=0.0] The easternmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [north=0.0] The northernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Rectangle} [result] The object onto which to store the result, or undefined if a new instance should be created. + * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. + * + * @example + * var rectangle = Cesium.Rectangle.fromRadians(0.0, Math.PI/4, Math.PI/8, 3*Math.PI/4); + */ + Rectangle.fromRadians = function(west, south, east, north, result) { + if (!defined(result)) { + return new Rectangle(west, south, east, north); + } + + result.west = defaultValue(west, 0.0); + result.south = defaultValue(south, 0.0); + result.east = defaultValue(east, 0.0); + result.north = defaultValue(north, 0.0); + + return result; + }; + /** * Creates the smallest possible Rectangle that encloses all positions in the provided array. * @@ -9109,9 +8683,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartographicArray = function(cartographics, result) { - if (!defined(cartographics)) { - throw new DeveloperError('cartographics is required.'); - } + Check.defined('cartographics', cartographics); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -9164,9 +8736,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartesianArray = function(cartesians, ellipsoid, result) { - if (!defined(cartesians)) { - throw new DeveloperError('cartesians is required.'); - } + Check.defined('cartesians', cartesians); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -9282,9 +8852,7 @@ define('Core/Rectangle',[ * @returns {Boolean} <code>true</code> if the Rectangles are within the provided epsilon, <code>false</code> otherwise. */ Rectangle.prototype.equalsEpsilon = function(other, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon is required and must be a number.'); - } + Check.typeOf.number('epsilon', epsilon); return defined(other) && (Math.abs(this.west - other.west) <= epsilon) && @@ -9304,45 +8872,23 @@ define('Core/Rectangle',[ * @exception {DeveloperError} <code>west</code> must be in the interval [<code>-Pi</code>, <code>Pi</code>]. */ Rectangle.validate = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var north = rectangle.north; - if (typeof north !== 'number') { - throw new DeveloperError('north is required to be a number.'); - } - - if (north < -CesiumMath.PI_OVER_TWO || north > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('north must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('north', north, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('north', north, CesiumMath.PI_OVER_TWO); var south = rectangle.south; - if (typeof south !== 'number') { - throw new DeveloperError('south is required to be a number.'); - } - - if (south < -CesiumMath.PI_OVER_TWO || south > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('south must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('south', south, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('south', south, CesiumMath.PI_OVER_TWO); var west = rectangle.west; - if (typeof west !== 'number') { - throw new DeveloperError('west is required to be a number.'); - } - - if (west < -Math.PI || west > Math.PI) { - throw new DeveloperError('west must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('west', west, -Math.PI); + Check.typeOf.number.lessThanOrEquals('west', west, Math.PI); var east = rectangle.east; - if (typeof east !== 'number') { - throw new DeveloperError('east is required to be a number.'); - } - - if (east < -Math.PI || east > Math.PI) { - throw new DeveloperError('east must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('east', east, -Math.PI); + Check.typeOf.number.lessThanOrEquals('east', east, Math.PI); }; /** @@ -9353,9 +8899,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.south); @@ -9374,9 +8918,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.north); @@ -9395,9 +8937,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.north); @@ -9416,9 +8956,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.south); @@ -9437,9 +8975,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.center = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; @@ -9474,12 +9010,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.intersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var rectangleEast = rectangle.east; var rectangleWest = rectangle.west; @@ -9535,12 +9067,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.simpleIntersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var west = Math.max(rectangle.west, otherRectangle.west); var south = Math.max(rectangle.south, otherRectangle.south); @@ -9571,12 +9099,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.union = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); if (!defined(result)) { result = new Rectangle(); @@ -9620,12 +9144,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.expand = function(rectangle, cartographic, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); if (!defined(result)) { result = new Rectangle(); @@ -9647,12 +9167,8 @@ define('Core/Rectangle',[ * @returns {Boolean} true if the provided cartographic is inside the rectangle, false otherwise. */ Rectangle.contains = function(rectangle, cartographic) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); var longitude = cartographic.longitude; var latitude = cartographic.latitude; @@ -9685,9 +9201,7 @@ define('Core/Rectangle',[ * @returns {Cartesian3[]} The modified result parameter or a new Array of Cartesians instances if none was provided. */ Rectangle.subsample = function(rectangle, ellipsoid, surfaceHeight, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84); surfaceHeight = defaultValue(surfaceHeight, 0.0); @@ -9765,9 +9279,9 @@ define('Core/Rectangle',[ define('Core/BoundingSphere',[ './Cartesian3', './Cartographic', + './Check', './defaultValue', './defined', - './DeveloperError', './Ellipsoid', './GeographicProjection', './Intersect', @@ -9778,9 +9292,9 @@ define('Core/BoundingSphere',[ ], function( Cartesian3, Cartographic, + Check, defaultValue, defined, - DeveloperError, Ellipsoid, GeographicProjection, Intersect, @@ -10110,9 +9624,7 @@ define('Core/BoundingSphere',[ stride = defaultValue(stride, 3); - if (stride < 3) { - throw new DeveloperError('stride must be 3 or greater.'); - } + Check.typeOf.number.greaterThanOrEquals('stride', stride, 3); var currentPos = fromPointsCurrentPos; currentPos.x = positions[0] + center.x; @@ -10416,9 +9928,8 @@ define('Core/BoundingSphere',[ * var sphere = Cesium.BoundingSphere.fromCornerPoints(new Cesium.Cartesian3(-0.5, -0.5, -0.5), new Cesium.Cartesian3(0.5, 0.5, 0.5)); */ BoundingSphere.fromCornerPoints = function(corner, oppositeCorner, result) { - if (!defined(corner) || !defined(oppositeCorner)) { - throw new DeveloperError('corner and oppositeCorner are required.'); - } + Check.typeOf.object('corner', corner); + Check.typeOf.object('oppositeCorner', oppositeCorner); if (!defined(result)) { result = new BoundingSphere(); @@ -10442,9 +9953,7 @@ define('Core/BoundingSphere',[ * var boundingSphere = Cesium.BoundingSphere.fromEllipsoid(ellipsoid); */ BoundingSphere.fromEllipsoid = function(ellipsoid, result) { - if (!defined(ellipsoid)) { - throw new DeveloperError('ellipsoid is required.'); - } + Check.typeOf.object('ellipsoid', ellipsoid); if (!defined(result)) { result = new BoundingSphere(); @@ -10570,13 +10079,8 @@ define('Core/BoundingSphere',[ * @returns {Number[]} The array that was packed into */ BoundingSphere.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -10598,9 +10102,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if one was not provided. */ BoundingSphere.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -10627,13 +10129,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.union = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); if (!defined(result)) { result = new BoundingSphere(); @@ -10682,13 +10179,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.expand = function(sphere, point, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(point)) { - throw new DeveloperError('point is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('point', point); result = BoundingSphere.clone(sphere, result); @@ -10711,13 +10203,8 @@ define('Core/BoundingSphere',[ * intersects the plane. */ BoundingSphere.intersectPlane = function(sphere, plane) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(plane)) { - throw new DeveloperError('plane is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('plane', plane); var center = sphere.center; var radius = sphere.radius; @@ -10743,13 +10230,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.transform = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -10777,12 +10259,8 @@ define('Core/BoundingSphere',[ * }); */ BoundingSphere.distanceSquaredTo = function(sphere, cartesian) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('cartesian', cartesian); var diff = Cartesian3.subtract(sphere.center, cartesian, distanceSquaredToScratch); return Cartesian3.magnitudeSquared(diff) - sphere.radius * sphere.radius; @@ -10804,13 +10282,8 @@ define('Core/BoundingSphere',[ * var newBoundingSphere = Cesium.BoundingSphere.transformWithoutScale(boundingSphere, modelMatrix); */ BoundingSphere.transformWithoutScale = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -10837,17 +10310,9 @@ define('Core/BoundingSphere',[ * @returns {Interval} The nearest and farthest distances on the bounding sphere from position in direction. */ BoundingSphere.computePlaneDistances = function(sphere, position, direction, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(position)) { - throw new DeveloperError('position is required.'); - } - - if (!defined(direction)) { - throw new DeveloperError('direction is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); if (!defined(result)) { result = new Interval(); @@ -10882,9 +10347,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.projectTo2D = function(sphere, projection, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } + Check.typeOf.object('sphere', sphere); projection = defaultValue(projection, projectTo2DProjection); @@ -10979,12 +10442,8 @@ define('Core/BoundingSphere',[ * @returns {Boolean} <code>true</code> if the sphere is not visible; otherwise <code>false</code>. */ BoundingSphere.isOccluded = function(sphere, occluder) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(occluder)) { - throw new DeveloperError('occluder is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('occluder', occluder); return !occluder.isBoundingSphereVisible(sphere); }; @@ -14420,7 +13879,10 @@ define('Core/WebGLConstants',[ COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : 0x9279, TEXTURE_IMMUTABLE_FORMAT : 0x912F, MAX_ELEMENT_INDEX : 0x8D6B, - TEXTURE_IMMUTABLE_LEVELS : 0x82DF + TEXTURE_IMMUTABLE_LEVELS : 0x82DF, + + // Extensions + MAX_TEXTURE_MAX_ANISOTROPY_EXT : 0x84FF }; return freezeObject(WebGLConstants); @@ -14950,7 +14412,7 @@ define('Core/Geometry',[ * <li><code>position</code> - 3D vertex position. 64-bit floating-point (for precision). 3 components per attribute. See {@link VertexFormat#position}.</li> * <li><code>normal</code> - Normal (normalized), commonly used for lighting. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#normal}.</li> * <li><code>st</code> - 2D texture coordinate. 32-bit floating-point. 2 components per attribute. See {@link VertexFormat#st}.</li> - * <li><code>binormal</code> - Binormal (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#binormal}.</li> + * <li><code>bitangent</code> - Bitangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#bitangent}.</li> * <li><code>tangent</code> - Tangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#tangent}.</li> * </ul> * </p> @@ -14979,7 +14441,7 @@ define('Core/Geometry',[ * componentsPerAttribute : 3, * values : new Float32Array(0) * }); - * + * * @see GeometryAttribute * @see VertexFormat */ @@ -15260,7 +14722,7 @@ define('Core/GeometryAttributes',[ this.st = options.st; /** - * The binormal attribute (normalized), which is used for tangent-space effects like bump mapping. + * The bitangent attribute (normalized), which is used for tangent-space effects like bump mapping. * <p> * 32-bit floating-point. 3 components per attribute. * </p> @@ -15269,7 +14731,7 @@ define('Core/GeometryAttributes',[ * * @default undefined */ - this.binormal = options.binormal; + this.bitangent = options.bitangent; /** * The tangent attribute (normalized), which is used for tangent-space effects like bump mapping. @@ -15774,6 +15236,7 @@ define('Core/EllipsoidGeodesic',[ * Provides the location of a point at the indicated portion along the geodesic. * * @param {Number} fraction The portion of the distance between the initial and final points. + * @param {Cartographic} result The object in which to store the result. * @returns {Cartographic} The location of the point along the geodesic. */ EllipsoidGeodesic.prototype.interpolateUsingFraction = function(fraction, result) { @@ -15784,6 +15247,7 @@ define('Core/EllipsoidGeodesic',[ * Provides the location of a point at the indicated distance along the geodesic. * * @param {Number} distance The distance from the inital point to the point of interest along the geodesic + * @param {Cartographic} result The object in which to store the result. * @returns {Cartographic} The location of the point along the geodesic. * * @exception {DeveloperError} start and end must be set before calling function interpolateUsingSurfaceDistance @@ -16634,6 +16098,7 @@ define('Core/IntersectionTests',[ './defaultValue', './defined', './DeveloperError', + './Interval', './Math', './Matrix3', './QuadraticRealPolynomial', @@ -16645,6 +16110,7 @@ define('Core/IntersectionTests',[ defaultValue, defined, DeveloperError, + Interval, CesiumMath, Matrix3, QuadraticRealPolynomial, @@ -16916,7 +16382,7 @@ define('Core/IntersectionTests',[ function raySphere(ray, sphere, result) { if (!defined(result)) { - result = {}; + result = new Interval(); } var origin = ray.origin; @@ -16947,8 +16413,8 @@ define('Core/IntersectionTests',[ * * @param {Ray} ray The ray. * @param {BoundingSphere} sphere The sphere. - * @param {Object} [result] The result onto which to store the result. - * @returns {Object} An object with the first (<code>start</code>) and the second (<code>stop</code>) intersection scalars for points along the ray or undefined if there are no intersections. + * @param {Interval} [result] The result onto which to store the result. + * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections. */ IntersectionTests.raySphere = function(ray, sphere, result) { if (!defined(ray)) { @@ -16976,8 +16442,8 @@ define('Core/IntersectionTests',[ * @param {Cartesian3} p0 An end point of the line segment. * @param {Cartesian3} p1 The other end point of the line segment. * @param {BoundingSphere} sphere The sphere. - * @param {Object} [result] The result onto which to store the result. - * @returns {Object} An object with the first (<code>start</code>) and the second (<code>stop</code>) intersection scalars for points along the line segment or undefined if there are no intersections. + * @param {Interval} [result] The result onto which to store the result. + * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections. */ IntersectionTests.lineSegmentSphere = function(p0, p1, sphere, result) { if (!defined(p0)) { @@ -17015,7 +16481,7 @@ define('Core/IntersectionTests',[ * * @param {Ray} ray The ray. * @param {Ellipsoid} ellipsoid The ellipsoid. - * @returns {Object} An object with the first (<code>start</code>) and the second (<code>stop</code>) intersection scalars for points along the ray or undefined if there are no intersections. + * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections. */ IntersectionTests.rayEllipsoid = function(ray, ellipsoid) { if (!defined(ray)) { @@ -17057,10 +16523,7 @@ define('Core/IntersectionTests',[ var root0 = temp / w2; var root1 = difference / temp; if (root0 < root1) { - return { - start : root0, - stop : root1 - }; + return new Interval(root0, root1); } return { @@ -17070,10 +16533,7 @@ define('Core/IntersectionTests',[ } else { // qw2 == product. Repeated roots (2 intersections). var root = Math.sqrt(difference / w2); - return { - start : root, - stop : root - }; + return new Interval(root, root); } } else if (q2 < 1.0) { // Inside ellipsoid (2 intersections). @@ -17083,19 +16543,13 @@ define('Core/IntersectionTests',[ discriminant = qw * qw - product; temp = -qw + Math.sqrt(discriminant); // Positively valued. - return { - start : 0.0, - stop : temp / w2 - }; + return new Interval(0.0, temp / w2); } else { // q2 == 1.0. On ellipsoid. if (qw < 0.0) { // Looking inward. w2 = Cartesian3.magnitudeSquared(w); - return { - start : 0.0, - stop : -qw / w2 - }; + return new Interval(0.0, -qw / w2); } // qw >= 0.0. Looking outward or tangent. @@ -17530,6 +16984,30 @@ define('Core/IntersectionTests',[ return IntersectionTests; }); +/*global define*/ +define('Core/isArray',[ + './defined' + ], function( + defined) { + 'use strict'; + + /** + * Tests an object to see if it is an array. + * @exports isArray + * + * @param {Object} value The value to test. + * @returns {Boolean} true if the value is an array, false otherwise. + */ + var isArray = Array.isArray; + if (!defined(isArray)) { + isArray = function(value) { + return Object.prototype.toString.call(value) === '[object Array]'; + }; + } + + return isArray; +}); + /*global define*/ define('Core/Plane',[ './Cartesian3', @@ -17903,10 +17381,10 @@ define('Core/PolylinePipeline',[ /** * Subdivides polyline and raises all points to the specified height. Returns an array of numbers to represent the positions. - * @param {Cartesian3[]} positions The array of type {Cartesian3} representing positions. - * @param {Number|Number[]} [height=0.0] A number or array of numbers representing the heights of each position. - * @param {Number} [granularity = CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. - * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie. + * @param {Cartesian3[]} options.positions The array of type {Cartesian3} representing positions. + * @param {Number|Number[]} [options.height=0.0] A number or array of numbers representing the heights of each position. + * @param {Number} [options.granularity = CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. + * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie. * @returns {Number[]} A new array of positions of type {Number} that have been subdivided and raised to the surface of the ellipsoid. * * @example @@ -17988,10 +17466,10 @@ define('Core/PolylinePipeline',[ /** * Subdivides polyline and raises all points to the specified height. Returns an array of new {Cartesian3} positions. - * @param {Cartesian3[]} positions The array of type {Cartesian3} representing positions. - * @param {Number|Number[]} [height=0.0] A number or array of numbers representing the heights of each position. - * @param {Number} [granularity = CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. - * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie. + * @param {Cartesian3[]} options.positions The array of type {Cartesian3} representing positions. + * @param {Number|Number[]} [options.height=0.0] A number or array of numbers representing the heights of each position. + * @param {Number} [options.granularity = CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. + * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie. * @returns {Cartesian3[]} A new array of cartesian3 positions that have been subdivided and raised to the surface of the ellipsoid. * * @example diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createSphereGeometry.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createSphereGeometry.js index 81966310..a0b4eeb3 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createSphereGeometry.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createSphereGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,68 +45,6 @@ define('Core/defined',[],function() { return defined; }); -/*global define*/ -define('Core/freezeObject',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Freezes an object, using Object.freeze if available, otherwise returns - * the object unchanged. This function should be used in setup code to prevent - * errors from completely halting JavaScript execution in legacy browsers. - * - * @private - * - * @exports freezeObject - */ - var freezeObject = Object.freeze; - if (!defined(freezeObject)) { - freezeObject = function(o) { - return o; - }; - } - - return freezeObject; -}); - -/*global define*/ -define('Core/defaultValue',[ - './freezeObject' - ], function( - freezeObject) { - 'use strict'; - - /** - * Returns the first parameter if not undefined, otherwise the second parameter. - * Useful for setting a default value for a parameter. - * - * @exports defaultValue - * - * @param {*} a - * @param {*} b - * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter. - * - * @example - * param = Cesium.defaultValue(param, 'default'); - */ - function defaultValue(a, b) { - if (a !== undefined) { - return a; - } - return b; - } - - /** - * A frozen empty object that can be used as the default value for options passed as - * an object literal. - */ - defaultValue.EMPTY_OBJECT = freezeObject({}); - - return defaultValue; -}); - /*global define*/ define('Core/DeveloperError',[ './defined' @@ -188,41 +126,13 @@ define('Core/DeveloperError',[ return DeveloperError; }); -/*global define*/ -define('Core/isArray',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Tests an object to see if it is an array. - * @exports isArray - * - * @param {Object} value The value to test. - * @returns {Boolean} true if the value is an array, false otherwise. - */ - var isArray = Array.isArray; - if (!defined(isArray)) { - isArray = function(value) { - return Object.prototype.toString.call(value) === '[object Array]'; - }; - } - - return isArray; -}); - /*global define*/ define('Core/Check',[ - './defaultValue', - './defined', - './DeveloperError', - './isArray' + './defined', + './DeveloperError' ], function( - defaultValue, defined, - DeveloperError, - isArray) { + DeveloperError) { 'use strict'; /** @@ -237,111 +147,134 @@ define('Core/Check',[ */ Check.typeOf = {}; - /** - * Contains functions for checking numeric conditions such as minimum and maximum values - */ - Check.numeric = {}; - function getUndefinedErrorMessage(name) { - return name + ' was required but undefined.'; + return name + ' is required, actual value was undefined'; } function getFailedTypeErrorMessage(actual, expected, name) { - return 'Expected ' + name + ' to be typeof ' + expected + ', got ' + actual; + return 'Expected ' + name + ' to be typeof ' + expected + ', actual typeof was ' + actual; } /** * Throws if test is not defined * - * @param {*} test The value that is to be checked * @param {String} name The name of the variable being tested + * @param {*} test The value that is to be checked * @exception {DeveloperError} test must be defined */ - Check.defined = function (test, name) { + Check.defined = function (name, test) { if (!defined(test)) { throw new DeveloperError(getUndefinedErrorMessage(name)); } }; /** - * Throws if test is greater than maximum + * Throws if test is not typeof 'function' * - * @param {Number} test The value to test - * @param {Number} maximum The maximum allowed value - * @exception {DeveloperError} test must not be greater than maximum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'function' */ - Check.numeric.maximum = function (test, maximum) { - Check.typeOf.number(test); - Check.typeOf.number(maximum); - if (test > maximum) { - throw new DeveloperError('Expected ' + test + ' to be at most ' + maximum); + Check.typeOf.func = function (name, test) { + if (typeof test !== 'function') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); } }; /** - * Throws if test is less than minimum + * Throws if test is not typeof 'string' * - * @param {Number} test The value to test - * @param {Number} minimum The minimum allowed value - * @exception {DeveloperError} test must not be less than mininum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'string' */ - Check.numeric.minimum = function (test, minimum) { - Check.typeOf.number(test); - Check.typeOf.number(minimum); - if (test < minimum) { - throw new DeveloperError('Expected ' + test + ' to be at least ' + minimum); + Check.typeOf.string = function (name, test) { + if (typeof test !== 'string') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); } }; /** - * Throws if test is not typeof 'function' + * Throws if test is not typeof 'number' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'function' + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'number' */ - Check.typeOf.function = function (test, name) { - if (typeof test !== 'function') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); + Check.typeOf.number = function (name, test) { + if (typeof test !== 'number') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); } }; /** - * Throws if test is not typeof 'string' + * Throws if test is not typeof 'number' and less than limit * + * @param {String} name The name of the variable being tested * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than limit + */ + Check.typeOf.number.lessThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test >= limit) { + throw new DeveloperError('Expected ' + name + ' to be less than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and less than or equal to limit + * * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'string' + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than or equal to limit */ - Check.typeOf.string = function (test, name) { - if (typeof test !== 'string') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); + Check.typeOf.number.lessThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test > limit) { + throw new DeveloperError('Expected ' + name + ' to be less than or equal to ' + limit + ', actual value was ' + test); } }; /** - * Throws if test is not typeof 'number' + * Throws if test is not typeof 'number' and greater than limit * + * @param {String} name The name of the variable being tested * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than limit + */ + Check.typeOf.number.greaterThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test <= limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and greater than or equal to limit + * * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'number' + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than or equal to limit */ - Check.typeOf.number = function (test, name) { - if (typeof test !== 'number') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); + Check.typeOf.number.greaterThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test < limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than or equal to' + limit + ', actual value was ' + test); } }; /** * Throws if test is not typeof 'object' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested + * @param {*} test The value to test * @exception {DeveloperError} test must be typeof 'object' */ - Check.typeOf.object = function (test, name) { + Check.typeOf.object = function (name, test) { if (typeof test !== 'object') { throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'object', name)); } @@ -350,11 +283,11 @@ define('Core/Check',[ /** * Throws if test is not typeof 'boolean' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested + * @param {*} test The value to test * @exception {DeveloperError} test must be typeof 'boolean' */ - Check.typeOf.boolean = function (test, name) { + Check.typeOf.bool = function (name, test) { if (typeof test !== 'boolean') { throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'boolean', name)); } @@ -363,6 +296,68 @@ define('Core/Check',[ return Check; }); +/*global define*/ +define('Core/freezeObject',[ + './defined' + ], function( + defined) { + 'use strict'; + + /** + * Freezes an object, using Object.freeze if available, otherwise returns + * the object unchanged. This function should be used in setup code to prevent + * errors from completely halting JavaScript execution in legacy browsers. + * + * @private + * + * @exports freezeObject + */ + var freezeObject = Object.freeze; + if (!defined(freezeObject)) { + freezeObject = function(o) { + return o; + }; + } + + return freezeObject; +}); + +/*global define*/ +define('Core/defaultValue',[ + './freezeObject' + ], function( + freezeObject) { + 'use strict'; + + /** + * Returns the first parameter if not undefined, otherwise the second parameter. + * Useful for setting a default value for a parameter. + * + * @exports defaultValue + * + * @param {*} a + * @param {*} b + * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter. + * + * @example + * param = Cesium.defaultValue(param, 'default'); + */ + function defaultValue(a, b) { + if (a !== undefined) { + return a; + } + return b; + } + + /** + * A frozen empty object that can be used as the default value for options passed as + * an object literal. + */ + defaultValue.EMPTY_OBJECT = freezeObject({}); + + return defaultValue; +}); + /* I've wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace so it's better encapsulated. Now you can have multiple random number generators @@ -1047,7 +1042,7 @@ define('Core/Math',[ if (!defined(angle)) { throw new DeveloperError('angle is required.'); } - + return CesiumMath.clamp(angle, -1*CesiumMath.PI_OVER_TWO, CesiumMath.PI_OVER_TWO); }; @@ -1057,11 +1052,11 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [<code>-CesiumMath.PI</code>, <code>CesiumMath.PI</code>]. */ - CesiumMath.negativePiToPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.negativePiToPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - return CesiumMath.zeroToTwoPi(x + CesiumMath.PI) - CesiumMath.PI; + return CesiumMath.zeroToTwoPi(angle + CesiumMath.PI) - CesiumMath.PI; }; /** @@ -1070,12 +1065,12 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [0, <code>CesiumMath.TWO_PI</code>]. */ - CesiumMath.zeroToTwoPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.zeroToTwoPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - var mod = CesiumMath.mod(x, CesiumMath.TWO_PI); - if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(x) > CesiumMath.EPSILON14) { + var mod = CesiumMath.mod(angle, CesiumMath.TWO_PI); + if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(angle) > CesiumMath.EPSILON14) { return CesiumMath.TWO_PI; } return mod; @@ -1145,7 +1140,7 @@ define('Core/Math',[ * @example * //Compute 7!, which is equal to 5040 * var computedFactorial = Cesium.Math.factorial(7); - * + * * @see {@link http://en.wikipedia.org/wiki/Factorial|Factorial on Wikipedia} */ CesiumMath.factorial = function(n) { @@ -1429,7 +1424,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.fromSpherical = function(spherical, result) { - Check.typeOf.object(spherical, 'spherical'); + Check.typeOf.object('spherical', spherical); if (!defined(result)) { result = new Cartesian3(); @@ -1513,8 +1508,8 @@ define('Core/Cartesian3',[ * @returns {Number[]} The array that was packed into */ Cartesian3.pack = function(value, array, startingIndex) { - Check.typeOf.object(value, 'value'); - Check.defined(array, 'array'); + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1534,7 +1529,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.unpack = function(array, startingIndex, result) { - Check.defined(array, 'array'); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1555,7 +1550,7 @@ define('Core/Cartesian3',[ * @returns {Number[]} The packed array. */ Cartesian3.packArray = function(array, result) { - Check.defined(array, 'array'); + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -1578,8 +1573,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3[]} The unpacked array. */ Cartesian3.unpackArray = function(array, result) { - Check.defined(array, 'array'); - Check.numeric.minimum(array.length, 3); + Check.defined('array', array); + Check.typeOf.number.greaterThanOrEquals('array.length', array.length, 3); if (array.length % 3 !== 0) { throw new DeveloperError('array length must be a multiple of 3.'); } @@ -1625,7 +1620,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the maximum component. */ Cartesian3.maximumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z); }; @@ -1637,7 +1632,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the minimum component. */ Cartesian3.minimumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z); }; @@ -1651,9 +1646,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the minimum components. */ Cartesian3.minimumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -1671,9 +1666,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the maximum components. */ Cartesian3.maximumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -1688,7 +1683,7 @@ define('Core/Cartesian3',[ * @returns {Number} The squared magnitude. */ Cartesian3.magnitudeSquared = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z; }; @@ -1717,8 +1712,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distance(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(2.0, 0.0, 0.0)); */ Cartesian3.distance = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitude(distanceScratch); @@ -1737,8 +1732,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distanceSquared(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(3.0, 0.0, 0.0)); */ Cartesian3.distanceSquared = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitudeSquared(distanceScratch); @@ -1752,8 +1747,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.normalize = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian3.magnitude(cartesian); @@ -1776,8 +1771,8 @@ define('Core/Cartesian3',[ * @returns {Number} The dot product. */ Cartesian3.dot = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z; }; @@ -1791,9 +1786,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyComponents = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -1835,9 +1830,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.add = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -1854,9 +1849,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.subtract = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -1873,9 +1868,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -1892,9 +1887,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.divideByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -1910,8 +1905,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.negate = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -1927,8 +1922,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.abs = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -1947,10 +1942,10 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.lerp = function(start, end, t, result) { - Check.typeOf.object(start, 'start'); - Check.typeOf.object(end, 'end'); - Check.typeOf.number(t, 't'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian3.multiplyByScalar(end, t, lerpScratch); result = Cartesian3.multiplyByScalar(start, 1.0 - t, result); @@ -1967,8 +1962,8 @@ define('Core/Cartesian3',[ * @returns {Number} The angle between the Cartesians. */ Cartesian3.angleBetween = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.normalize(left, angleBetweenScratch); Cartesian3.normalize(right, angleBetweenScratch2); @@ -1986,8 +1981,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The most orthogonal axis. */ Cartesian3.mostOrthogonalAxis = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian3.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian3.abs(f, f); @@ -2064,9 +2059,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The cross product. */ Cartesian3.cross = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var leftX = left.x; var leftY = left.y; @@ -2099,8 +2094,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromDegrees(-115.0, 37.0); */ Cartesian3.fromDegrees = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); longitude = CesiumMath.toRadians(longitude); latitude = CesiumMath.toRadians(latitude); @@ -2125,8 +2120,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromRadians(-2.007, 0.645); */ Cartesian3.fromRadians = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); height = defaultValue(height, 0.0); var radiiSquared = defined(ellipsoid) ? ellipsoid.radiiSquared : wgs84RadiiSquared; @@ -2160,7 +2155,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArray([-115.0, 37.0, -107.0, 33.0]); */ Cartesian3.fromDegreesArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -2194,7 +2189,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArray([-2.007, 0.645, -1.867, .575]); */ Cartesian3.fromRadiansArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -2228,7 +2223,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArrayHeights([-115.0, 37.0, 100000.0, -107.0, 33.0, 150000.0]); */ Cartesian3.fromDegreesArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -2263,7 +2258,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArrayHeights([-2.007, 0.645, 100000.0, -1.867, .575, 150000.0]); */ Cartesian3.fromRadiansArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -3010,7 +3005,9 @@ define('Core/Ellipsoid',[ /** * Computes an Ellipsoid from a Cartesian specifying the radii in x, y, and z directions. * - * @param {Cartesian3} [radii=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Cartesian3} [cartesian=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new + * instance should be created. * @returns {Ellipsoid} A new Ellipsoid instance. * * @exception {DeveloperError} All radii components must be greater than or equal to zero. @@ -3650,6 +3647,7 @@ define('Core/Interval',[ /*global define*/ define('Core/Matrix3',[ './Cartesian3', + './Check', './defaultValue', './defined', './defineProperties', @@ -3658,6 +3656,7 @@ define('Core/Matrix3',[ './Math' ], function( Cartesian3, + Check, defaultValue, defined, defineProperties, @@ -3720,13 +3719,8 @@ define('Core/Matrix3',[ * @returns {Number[]} The array that was packed into */ Matrix3.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3752,9 +3746,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. */ Matrix3.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3781,24 +3773,24 @@ define('Core/Matrix3',[ * @param {Matrix3} [result] The object onto which to store the result. * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. (Returns undefined if matrix is undefined) */ - Matrix3.clone = function(values, result) { - if (!defined(values)) { + Matrix3.clone = function(matrix, result) { + if (!defined(matrix)) { return undefined; } if (!defined(result)) { - return new Matrix3(values[0], values[3], values[6], - values[1], values[4], values[7], - values[2], values[5], values[8]); + return new Matrix3(matrix[0], matrix[3], matrix[6], + matrix[1], matrix[4], matrix[7], + matrix[2], matrix[5], matrix[8]); } - result[0] = values[0]; - result[1] = values[1]; - result[2] = values[2]; - result[3] = values[3]; - result[4] = values[4]; - result[5] = values[5]; - result[6] = values[6]; - result[7] = values[7]; - result[8] = values[8]; + result[0] = matrix[0]; + result[1] = matrix[1]; + result[2] = matrix[2]; + result[3] = matrix[3]; + result[4] = matrix[4]; + result[5] = matrix[5]; + result[6] = matrix[6]; + result[7] = matrix[7]; + result[8] = matrix[8]; return result; }; @@ -3824,9 +3816,7 @@ define('Core/Matrix3',[ * var m2 = Cesium.Matrix3.fromArray(v2, 2); */ Matrix3.fromArray = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3854,9 +3844,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values parameter is required'); - } + Check.defined('values', values); return Matrix3.clone(values, result); }; @@ -3870,9 +3858,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix3(values[0], values[1], values[2], @@ -3899,9 +3885,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this quaternion. */ Matrix3.fromQuaternion = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); var x2 = quaternion.x * quaternion.x; var xy = quaternion.x * quaternion.y; @@ -3951,10 +3935,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this headingPitchRoll. */ Matrix3.fromHeadingPitchRoll = function(headingPitchRoll, result) { - if (!defined(headingPitchRoll)) { - throw new DeveloperError('headingPitchRoll is required'); - } - var cosTheta = Math.cos(-headingPitchRoll.pitch); + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + + var cosTheta = Math.cos(-headingPitchRoll.pitch); var cosPsi = Math.cos(-headingPitchRoll.heading); var cosPhi = Math.cos(headingPitchRoll.roll); var sinTheta = Math.sin(-headingPitchRoll.pitch); @@ -4005,9 +3988,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix3( @@ -4043,9 +4024,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromUniformScale(2.0); */ Matrix3.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix3( @@ -4069,7 +4048,7 @@ define('Core/Matrix3',[ /** * Computes a Matrix3 instance representing the cross product equivalent matrix of a Cartesian3 vector. * - * @param {Cartesian3} the vector on the left hand side of the cross product operation. + * @param {Cartesian3} vector the vector on the left hand side of the cross product operation. * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created. * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. * @@ -4081,9 +4060,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromCrossProduct(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromCrossProduct = function(vector, result) { - if (!defined(vector)) { - throw new DeveloperError('vector is required.'); - } + Check.typeOf.object('vector', vector); if (!defined(result)) { return new Matrix3( @@ -4118,9 +4095,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationX = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4159,9 +4134,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationY = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4200,9 +4173,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationZ = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4236,9 +4207,7 @@ define('Core/Matrix3',[ * @returns {Number[]} The modified Array parameter or a new Array instance if one was not provided. */ Matrix3.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5], matrix[6], matrix[7], matrix[8]]; @@ -4272,12 +4241,10 @@ define('Core/Matrix3',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix3.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 2) { - throw new DeveloperError('row must be 0, 1, or 2.'); - } - if (typeof column !== 'number' || column < 0 || column > 2) { - throw new DeveloperError('column must be 0, 1, or 2.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 2); + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 2); return column * 3 + row; }; @@ -4293,16 +4260,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var startIndex = index * 3; var x = matrix[startIndex]; @@ -4327,18 +4288,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); var startIndex = index * 3; @@ -4359,15 +4313,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 3]; @@ -4391,18 +4340,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); result[index] = cartesian.x; @@ -4421,12 +4363,8 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[3], matrix[4], matrix[5], scratchColumn)); @@ -4457,15 +4395,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var column0Row0 = left[0] * right[0] + left[3] * right[1] + left[6] * right[2]; var column0Row1 = left[1] * right[0] + left[4] * right[1] + left[7] * right[2]; @@ -4500,15 +4432,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -4531,15 +4457,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -4562,15 +4482,9 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -4595,15 +4509,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -4634,15 +4542,9 @@ define('Core/Matrix3',[ * @see Matrix3.multiplyByUniformScale */ Matrix3.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); result[0] = matrix[0] * scale.x; result[1] = matrix[1] * scale.x; @@ -4664,12 +4566,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -4691,12 +4589,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var column0Row0 = matrix[0]; var column0Row1 = matrix[3]; @@ -4836,9 +4730,7 @@ define('Core/Matrix3',[ * var c = Cesium.Cartesian3.multiplyByScalar(v, lambda, new Cesium.Cartesian3()); // equal to Cesium.Matrix3.multiplyByVector(a, v) */ Matrix3.computeEigenDecomposition = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); // This routine was created based upon Matrix Computations, 3rd ed., by Golub and Van Loan, // section 8.4.3 The Classical Jacobi Algorithm @@ -4882,12 +4774,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -4909,9 +4797,7 @@ define('Core/Matrix3',[ * @returns {Number} The value of the determinant of the matrix. */ Matrix3.determinant = function(matrix) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); var m11 = matrix[0]; var m21 = matrix[3]; @@ -4936,12 +4822,8 @@ define('Core/Matrix3',[ * @exception {DeveloperError} matrix is not invertible. */ Matrix3.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var m11 = matrix[0]; var m21 = matrix[1]; @@ -5007,9 +4889,7 @@ define('Core/Matrix3',[ * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. */ Matrix3.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -5197,12 +5077,14 @@ define('Core/Matrix3',[ /*global define*/ define('Core/Cartesian4',[ + './Check', './defaultValue', './defined', './DeveloperError', './freezeObject', './Math' ], function( + Check, defaultValue, defined, DeveloperError, @@ -5285,9 +5167,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.fromColor = function(color, result) { - if (!defined(color)) { - throw new DeveloperError('color is required'); - } + Check.typeOf.object('color', color); if (!defined(result)) { return new Cartesian4(color.red, color.green, color.blue, color.alpha); } @@ -5339,12 +5219,8 @@ define('Core/Cartesian4',[ * @returns {Number[]} The array that was packed into */ Cartesian4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5365,9 +5241,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5389,9 +5263,7 @@ define('Core/Cartesian4',[ * @returns {Number[]} The packed array. */ Cartesian4.packArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -5414,9 +5286,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4[]} The unpacked array. */ Cartesian4.unpackArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -5459,9 +5329,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the maximum component. */ Cartesian4.maximumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -5473,9 +5341,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the minimum component. */ Cartesian4.minimumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -5489,15 +5355,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the minimum components. */ Cartesian4.minimumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -5516,15 +5376,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the maximum components. */ Cartesian4.maximumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -5541,9 +5395,7 @@ define('Core/Cartesian4',[ * @returns {Number} The squared magnitude. */ Cartesian4.magnitudeSquared = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z + cartesian.w * cartesian.w; }; @@ -5574,9 +5426,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(2.0, 0.0, 0.0, 0.0)); */ Cartesian4.distance = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitude(distanceScratch); @@ -5597,9 +5448,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(3.0, 0.0, 0.0, 0.0)); */ Cartesian4.distanceSquared = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitudeSquared(distanceScratch); @@ -5613,12 +5463,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.normalize = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian4.magnitude(cartesian); @@ -5642,12 +5488,8 @@ define('Core/Cartesian4',[ * @returns {Number} The dot product. */ Cartesian4.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w; }; @@ -5661,15 +5503,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -5687,15 +5523,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x / right.x; result.y = left.y / right.y; @@ -5713,15 +5543,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -5739,15 +5563,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -5765,15 +5583,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -5791,15 +5603,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -5816,12 +5622,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.negate = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -5838,12 +5640,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.abs = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -5863,18 +5661,10 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian4.multiplyByScalar(end, t, lerpScratch); result = Cartesian4.multiplyByScalar(start, 1.0 - t, result); @@ -5890,12 +5680,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The most orthogonal axis. */ Cartesian4.mostOrthogonalAxis = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian4.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian4.abs(f, f); @@ -6140,6 +5926,7 @@ define('Core/RuntimeError',[ define('Core/Matrix4',[ './Cartesian3', './Cartesian4', + './Check', './defaultValue', './defined', './defineProperties', @@ -6151,6 +5938,7 @@ define('Core/Matrix4',[ ], function( Cartesian3, Cartesian4, + Check, defaultValue, defined, defineProperties, @@ -6241,13 +6029,8 @@ define('Core/Matrix4',[ * @returns {Number[]} The array that was packed into */ Matrix4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -6280,9 +6063,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if one was not provided. */ Matrix4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -6378,9 +6159,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required'); - } + Check.defined('values', values); return Matrix4.clone(values, result); }; @@ -6394,9 +6173,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix4(values[0], values[1], values[2], values[3], @@ -6433,9 +6210,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRotationTranslation = function(rotation, translation, result) { - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } + Check.typeOf.object('rotation', rotation); translation = defaultValue(translation, Cartesian3.ZERO); @@ -6483,15 +6258,9 @@ define('Core/Matrix4',[ * result); */ Matrix4.fromTranslationQuaternionRotationScale = function(translation, rotation, scale, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('translation', translation); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('scale', scale); if (!defined(result)) { result = new Matrix4(); @@ -6552,9 +6321,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromTranslationRotationScale = function(translationRotationScale, result) { - if (!defined(translationRotationScale)) { - throw new DeveloperError('translationRotationScale is required.'); - } + Check.typeOf.object('translationRotationScale', translationRotationScale); return Matrix4.fromTranslationQuaternionRotationScale(translationRotationScale.translation, translationRotationScale.rotation, translationRotationScale.scale, result); }; @@ -6569,9 +6336,7 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByTranslation */ Matrix4.fromTranslation = function(translation, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } + Check.typeOf.object('translation', translation); return Matrix4.fromRotationTranslation(Matrix3.IDENTITY, translation, result); }; @@ -6592,9 +6357,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix4.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix4( @@ -6639,9 +6402,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromUniformScale(2.0); */ Matrix4.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix4(scale, 0.0, 0.0, 0.0, @@ -6681,23 +6442,15 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromCamera = function(camera, result) { - if (!defined(camera)) { - throw new DeveloperError('camera is required.'); - } + Check.typeOf.object('camera', camera); var position = camera.position; var direction = camera.direction; var up = camera.up; - if (!defined(position)) { - throw new DeveloperError('camera.position is required.'); - } - if (!defined(direction)) { - throw new DeveloperError('camera.direction is required.'); - } - if (!defined(up)) { - throw new DeveloperError('camera.up is required.'); - } + Check.typeOf.object('camera.position', position); + Check.typeOf.object('camera.direction', direction); + Check.typeOf.object('camera.up', up); Cartesian3.normalize(direction, fromCameraF); Cartesian3.normalize(Cartesian3.cross(fromCameraF, up, fromCameraR), fromCameraR); @@ -6776,21 +6529,11 @@ define('Core/Matrix4',[ * @exception {DeveloperError} far must be greater than zero. */ Matrix4.computePerspectiveFieldOfView = function(fovY, aspectRatio, near, far, result) { - if (fovY <= 0.0 || fovY > Math.PI) { - throw new DeveloperError('fovY must be in (0, PI].'); - } - if (aspectRatio <= 0.0) { - throw new DeveloperError('aspectRatio must be greater than zero.'); - } - if (near <= 0.0) { - throw new DeveloperError('near must be greater than zero.'); - } - if (far <= 0.0) { - throw new DeveloperError('far must be greater than zero.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThan('fovY', fovY, 0.0); + Check.typeOf.number.lessThan('fovY', fovY, Math.PI); + Check.typeOf.number.greaterThan('near', near, 0.0); + Check.typeOf.number.greaterThan('far', far, 0.0); + Check.typeOf.object('result', result); var bottom = Math.tan(fovY * 0.5); @@ -6831,27 +6574,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeOrthographicOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var a = 1.0 / (right - left); var b = 1.0 / (top - bottom); @@ -6896,27 +6625,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computePerspectiveOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -6957,24 +6672,12 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeInfinitePerspectiveOffCenter = function(left, right, bottom, top, near, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -7022,9 +6725,7 @@ define('Core/Matrix4',[ * }, 0.0, 1.0, new Cesium.Matrix4()); */ Matrix4.computeViewportTransformation = function(viewport, nearDepthRange, farDepthRange, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); viewport = defaultValue(viewport, defaultValue.EMPTY_OBJECT); var x = defaultValue(viewport.x, 0.0); @@ -7076,21 +6777,11 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeView = function(position, direction, up, right, result) { - if (!defined(position)) { - throw new DeveloperError('position is required'); - } - if (!defined(direction)) { - throw new DeveloperError('direction is required'); - } - if (!defined(up)) { - throw new DeveloperError('up is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); + Check.typeOf.object('up', up); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = right.x; result[1] = up.x; @@ -7131,9 +6822,7 @@ define('Core/Matrix4',[ * //creates a = [10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0] */ Matrix4.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], @@ -7177,12 +6866,11 @@ define('Core/Matrix4',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix4.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 3) { - throw new DeveloperError('row must be 0, 1, 2, or 3.'); - } - if (typeof column !== 'number' || column < 0 || column > 3) { - throw new DeveloperError('column must be 0, 1, 2, or 3.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 3); + + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 3); return column * 4 + row; }; @@ -7215,16 +6903,12 @@ define('Core/Matrix4',[ * // a.x = 12.0; a.y = 16.0; a.z = 20.0; a.w = 24.0; */ Matrix4.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var startIndex = index * 4; var x = matrix[startIndex]; @@ -7266,18 +6950,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 96.0, 25.0] */ Matrix4.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); var startIndex = index * 4; @@ -7298,15 +6977,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.setTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -7359,16 +7032,12 @@ define('Core/Matrix4',[ * // a.x = 18.0; a.y = 19.0; a.z = 20.0; a.w = 21.0; */ Matrix4.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 4]; @@ -7409,18 +7078,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 24.0, 25.0] */ Matrix4.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); result[index] = cartesian.x; @@ -7440,12 +7104,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter */ Matrix4.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[4], matrix[5], matrix[6], scratchColumn)); @@ -7477,15 +7137,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -7569,15 +7223,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -7607,15 +7255,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -7656,15 +7298,9 @@ define('Core/Matrix4',[ * var m3 = Cesium.Matrix4.multiplyTransformation(m1, m2, new Cesium.Matrix4()); */ Matrix4.multiplyTransformation = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -7742,15 +7378,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByMatrix3(m, rotation, m); */ Matrix4.multiplyByMatrix3 = function(matrix, rotation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('result', result); var left0 = matrix[0]; var left1 = matrix[1]; @@ -7818,15 +7448,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByTranslation(m, position, m); */ Matrix4.multiplyByTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); var x = translation.x; var y = translation.y; @@ -7878,15 +7502,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByScale */ Matrix4.multiplyByUniformScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scale', scale); + Check.typeOf.object('result', result); uniformScaleScratch.x = scale; uniformScaleScratch.y = scale; @@ -7915,15 +7533,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByUniformScale */ Matrix4.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); var scaleX = scale.x; var scaleY = scale.y; @@ -7962,15 +7574,9 @@ define('Core/Matrix4',[ * @returns {Cartesian4} The modified result parameter. */ Matrix4.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8006,15 +7612,9 @@ define('Core/Matrix4',[ * // Cesium.Matrix4.multiplyByVector(matrix, new Cesium.Cartesian4(p.x, p.y, p.z, 0.0), result); */ Matrix4.multiplyByPointAsVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8044,16 +7644,9 @@ define('Core/Matrix4',[ * var result = Cesium.Matrix4.multiplyByPoint(matrix, p, new Cesium.Cartesian3()); */ Matrix4.multiplyByPoint = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8093,15 +7686,9 @@ define('Core/Matrix4',[ * // [-44.0, -46.0, -48.0, -50.0] */ Matrix4.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -8145,12 +7732,8 @@ define('Core/Matrix4',[ * // [-22.0, -23.0, -24.0, -25.0] */ Matrix4.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -8194,12 +7777,8 @@ define('Core/Matrix4',[ * // [13.0, 17.0, 21.0, 25.0] */ Matrix4.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var matrix1 = matrix[1]; var matrix2 = matrix[2]; @@ -8235,12 +7814,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -8354,9 +7929,7 @@ define('Core/Matrix4',[ * //Prints "Difference between both the matrices is not less than 0.1" on the console */ Matrix4.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -8387,12 +7960,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter. */ Matrix4.getTranslation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = matrix[12]; result.y = matrix[13]; @@ -8422,13 +7991,9 @@ define('Core/Matrix4',[ * // [11.0, 15.0, 19.0] * // [12.0, 16.0, 20.0] */ - Matrix4.getRotation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Matrix4.getRotation = function(matrix, result) { + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -8460,12 +8025,8 @@ define('Core/Matrix4',[ * @exception {RuntimeError} matrix is not invertible because its determinate is zero. */ Matrix4.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); // Special case for a zero scale matrix that can occur, for example, // when a model's node has a [0, 0, 0] scale. @@ -8603,12 +8164,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.inverseTransformation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); //This function is an optimized version of the below 4 lines. //var rT = Matrix3.transpose(Matrix4.getRotation(matrix)); @@ -8892,6 +8449,7 @@ define('Core/Matrix4',[ /*global define*/ define('Core/Rectangle',[ './Cartographic', + './Check', './defaultValue', './defined', './defineProperties', @@ -8901,6 +8459,7 @@ define('Core/Rectangle',[ './Math' ], function( Cartographic, + Check, defaultValue, defined, defineProperties, @@ -8997,13 +8556,8 @@ define('Core/Rectangle',[ * @returns {Number[]} The array that was packed into */ Rectangle.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -9024,9 +8578,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -9047,9 +8599,7 @@ define('Core/Rectangle',[ * @returns {Number} The width. */ Rectangle.computeWidth = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; if (east < west) { @@ -9064,9 +8614,7 @@ define('Core/Rectangle',[ * @returns {Number} The height. */ Rectangle.computeHeight = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); return rectangle.north - rectangle.south; }; @@ -9101,6 +8649,32 @@ define('Core/Rectangle',[ return result; }; + /** + * Creates an rectangle given the boundary longitude and latitude in radians. + * + * @param {Number} [west=0.0] The westernmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [south=0.0] The southernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Number} [east=0.0] The easternmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [north=0.0] The northernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Rectangle} [result] The object onto which to store the result, or undefined if a new instance should be created. + * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. + * + * @example + * var rectangle = Cesium.Rectangle.fromRadians(0.0, Math.PI/4, Math.PI/8, 3*Math.PI/4); + */ + Rectangle.fromRadians = function(west, south, east, north, result) { + if (!defined(result)) { + return new Rectangle(west, south, east, north); + } + + result.west = defaultValue(west, 0.0); + result.south = defaultValue(south, 0.0); + result.east = defaultValue(east, 0.0); + result.north = defaultValue(north, 0.0); + + return result; + }; + /** * Creates the smallest possible Rectangle that encloses all positions in the provided array. * @@ -9109,9 +8683,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartographicArray = function(cartographics, result) { - if (!defined(cartographics)) { - throw new DeveloperError('cartographics is required.'); - } + Check.defined('cartographics', cartographics); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -9164,9 +8736,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartesianArray = function(cartesians, ellipsoid, result) { - if (!defined(cartesians)) { - throw new DeveloperError('cartesians is required.'); - } + Check.defined('cartesians', cartesians); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -9282,9 +8852,7 @@ define('Core/Rectangle',[ * @returns {Boolean} <code>true</code> if the Rectangles are within the provided epsilon, <code>false</code> otherwise. */ Rectangle.prototype.equalsEpsilon = function(other, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon is required and must be a number.'); - } + Check.typeOf.number('epsilon', epsilon); return defined(other) && (Math.abs(this.west - other.west) <= epsilon) && @@ -9304,45 +8872,23 @@ define('Core/Rectangle',[ * @exception {DeveloperError} <code>west</code> must be in the interval [<code>-Pi</code>, <code>Pi</code>]. */ Rectangle.validate = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var north = rectangle.north; - if (typeof north !== 'number') { - throw new DeveloperError('north is required to be a number.'); - } - - if (north < -CesiumMath.PI_OVER_TWO || north > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('north must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('north', north, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('north', north, CesiumMath.PI_OVER_TWO); var south = rectangle.south; - if (typeof south !== 'number') { - throw new DeveloperError('south is required to be a number.'); - } - - if (south < -CesiumMath.PI_OVER_TWO || south > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('south must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('south', south, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('south', south, CesiumMath.PI_OVER_TWO); var west = rectangle.west; - if (typeof west !== 'number') { - throw new DeveloperError('west is required to be a number.'); - } - - if (west < -Math.PI || west > Math.PI) { - throw new DeveloperError('west must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('west', west, -Math.PI); + Check.typeOf.number.lessThanOrEquals('west', west, Math.PI); var east = rectangle.east; - if (typeof east !== 'number') { - throw new DeveloperError('east is required to be a number.'); - } - - if (east < -Math.PI || east > Math.PI) { - throw new DeveloperError('east must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('east', east, -Math.PI); + Check.typeOf.number.lessThanOrEquals('east', east, Math.PI); }; /** @@ -9353,9 +8899,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.south); @@ -9374,9 +8918,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.north); @@ -9395,9 +8937,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.north); @@ -9416,9 +8956,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.south); @@ -9437,9 +8975,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.center = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; @@ -9474,12 +9010,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.intersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var rectangleEast = rectangle.east; var rectangleWest = rectangle.west; @@ -9535,12 +9067,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.simpleIntersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var west = Math.max(rectangle.west, otherRectangle.west); var south = Math.max(rectangle.south, otherRectangle.south); @@ -9571,12 +9099,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.union = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); if (!defined(result)) { result = new Rectangle(); @@ -9620,12 +9144,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.expand = function(rectangle, cartographic, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); if (!defined(result)) { result = new Rectangle(); @@ -9647,12 +9167,8 @@ define('Core/Rectangle',[ * @returns {Boolean} true if the provided cartographic is inside the rectangle, false otherwise. */ Rectangle.contains = function(rectangle, cartographic) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); var longitude = cartographic.longitude; var latitude = cartographic.latitude; @@ -9685,9 +9201,7 @@ define('Core/Rectangle',[ * @returns {Cartesian3[]} The modified result parameter or a new Array of Cartesians instances if none was provided. */ Rectangle.subsample = function(rectangle, ellipsoid, surfaceHeight, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84); surfaceHeight = defaultValue(surfaceHeight, 0.0); @@ -9765,9 +9279,9 @@ define('Core/Rectangle',[ define('Core/BoundingSphere',[ './Cartesian3', './Cartographic', + './Check', './defaultValue', './defined', - './DeveloperError', './Ellipsoid', './GeographicProjection', './Intersect', @@ -9778,9 +9292,9 @@ define('Core/BoundingSphere',[ ], function( Cartesian3, Cartographic, + Check, defaultValue, defined, - DeveloperError, Ellipsoid, GeographicProjection, Intersect, @@ -10110,9 +9624,7 @@ define('Core/BoundingSphere',[ stride = defaultValue(stride, 3); - if (stride < 3) { - throw new DeveloperError('stride must be 3 or greater.'); - } + Check.typeOf.number.greaterThanOrEquals('stride', stride, 3); var currentPos = fromPointsCurrentPos; currentPos.x = positions[0] + center.x; @@ -10416,9 +9928,8 @@ define('Core/BoundingSphere',[ * var sphere = Cesium.BoundingSphere.fromCornerPoints(new Cesium.Cartesian3(-0.5, -0.5, -0.5), new Cesium.Cartesian3(0.5, 0.5, 0.5)); */ BoundingSphere.fromCornerPoints = function(corner, oppositeCorner, result) { - if (!defined(corner) || !defined(oppositeCorner)) { - throw new DeveloperError('corner and oppositeCorner are required.'); - } + Check.typeOf.object('corner', corner); + Check.typeOf.object('oppositeCorner', oppositeCorner); if (!defined(result)) { result = new BoundingSphere(); @@ -10442,9 +9953,7 @@ define('Core/BoundingSphere',[ * var boundingSphere = Cesium.BoundingSphere.fromEllipsoid(ellipsoid); */ BoundingSphere.fromEllipsoid = function(ellipsoid, result) { - if (!defined(ellipsoid)) { - throw new DeveloperError('ellipsoid is required.'); - } + Check.typeOf.object('ellipsoid', ellipsoid); if (!defined(result)) { result = new BoundingSphere(); @@ -10570,13 +10079,8 @@ define('Core/BoundingSphere',[ * @returns {Number[]} The array that was packed into */ BoundingSphere.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -10598,9 +10102,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if one was not provided. */ BoundingSphere.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -10627,13 +10129,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.union = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); if (!defined(result)) { result = new BoundingSphere(); @@ -10682,13 +10179,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.expand = function(sphere, point, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(point)) { - throw new DeveloperError('point is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('point', point); result = BoundingSphere.clone(sphere, result); @@ -10711,13 +10203,8 @@ define('Core/BoundingSphere',[ * intersects the plane. */ BoundingSphere.intersectPlane = function(sphere, plane) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(plane)) { - throw new DeveloperError('plane is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('plane', plane); var center = sphere.center; var radius = sphere.radius; @@ -10743,13 +10230,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.transform = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -10777,12 +10259,8 @@ define('Core/BoundingSphere',[ * }); */ BoundingSphere.distanceSquaredTo = function(sphere, cartesian) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('cartesian', cartesian); var diff = Cartesian3.subtract(sphere.center, cartesian, distanceSquaredToScratch); return Cartesian3.magnitudeSquared(diff) - sphere.radius * sphere.radius; @@ -10804,13 +10282,8 @@ define('Core/BoundingSphere',[ * var newBoundingSphere = Cesium.BoundingSphere.transformWithoutScale(boundingSphere, modelMatrix); */ BoundingSphere.transformWithoutScale = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -10837,17 +10310,9 @@ define('Core/BoundingSphere',[ * @returns {Interval} The nearest and farthest distances on the bounding sphere from position in direction. */ BoundingSphere.computePlaneDistances = function(sphere, position, direction, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(position)) { - throw new DeveloperError('position is required.'); - } - - if (!defined(direction)) { - throw new DeveloperError('direction is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); if (!defined(result)) { result = new Interval(); @@ -10882,9 +10347,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.projectTo2D = function(sphere, projection, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } + Check.typeOf.object('sphere', sphere); projection = defaultValue(projection, projectTo2DProjection); @@ -10979,12 +10442,8 @@ define('Core/BoundingSphere',[ * @returns {Boolean} <code>true</code> if the sphere is not visible; otherwise <code>false</code>. */ BoundingSphere.isOccluded = function(sphere, occluder) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(occluder)) { - throw new DeveloperError('occluder is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('occluder', occluder); return !occluder.isBoundingSphereVisible(sphere); }; @@ -11085,12 +10544,14 @@ define('Core/BoundingSphere',[ /*global define*/ define('Core/Cartesian2',[ + './Check', './defaultValue', './defined', './DeveloperError', './freezeObject', './Math' ], function( + Check, defaultValue, defined, DeveloperError, @@ -11202,12 +10663,8 @@ define('Core/Cartesian2',[ * @returns {Number[]} The array that was packed into */ Cartesian2.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -11226,9 +10683,7 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided. */ Cartesian2.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -11248,9 +10703,7 @@ define('Core/Cartesian2',[ * @returns {Number[]} The packed array. */ Cartesian2.packArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -11273,9 +10726,7 @@ define('Core/Cartesian2',[ * @returns {Cartesian2[]} The unpacked array. */ Cartesian2.unpackArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -11318,9 +10769,7 @@ define('Core/Cartesian2',[ * @returns {Number} The value of the maximum component. */ Cartesian2.maximumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y); }; @@ -11332,9 +10781,7 @@ define('Core/Cartesian2',[ * @returns {Number} The value of the minimum component. */ Cartesian2.minimumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y); }; @@ -11348,15 +10795,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} A cartesian with the minimum components. */ Cartesian2.minimumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); @@ -11374,15 +10815,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} A cartesian with the maximum components. */ Cartesian2.maximumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -11396,9 +10831,7 @@ define('Core/Cartesian2',[ * @returns {Number} The squared magnitude. */ Cartesian2.magnitudeSquared = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y; }; @@ -11464,12 +10897,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.normalize = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian2.magnitude(cartesian); @@ -11491,12 +10920,8 @@ define('Core/Cartesian2',[ * @returns {Number} The dot product. */ Cartesian2.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y; }; @@ -11510,15 +10935,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.multiplyComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -11534,15 +10953,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.divideComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x / right.x; result.y = left.y / right.y; @@ -11558,15 +10971,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -11582,15 +10989,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -11606,15 +11007,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.multiplyByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -11630,15 +11025,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.divideByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -11653,12 +11042,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.negate = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -11673,12 +11058,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.abs = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -11696,18 +11077,10 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian2.multiplyByScalar(end, t, lerpScratch); result = Cartesian2.multiplyByScalar(start, 1.0 - t, result); @@ -11724,12 +11097,8 @@ define('Core/Cartesian2',[ * @returns {Number} The angle between the Cartesians. */ Cartesian2.angleBetween = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian2.normalize(left, angleBetweenScratch); Cartesian2.normalize(right, angleBetweenScratch2); @@ -11745,12 +11114,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The most orthogonal axis. */ Cartesian2.mostOrthogonalAxis = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian2.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian2.abs(f, f); @@ -12988,7 +12353,10 @@ define('Core/WebGLConstants',[ COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : 0x9279, TEXTURE_IMMUTABLE_FORMAT : 0x912F, MAX_ELEMENT_INDEX : 0x8D6B, - TEXTURE_IMMUTABLE_LEVELS : 0x82DF + TEXTURE_IMMUTABLE_LEVELS : 0x82DF, + + // Extensions + MAX_TEXTURE_MAX_ANISOTROPY_EXT : 0x84FF }; return freezeObject(WebGLConstants); @@ -13518,7 +12886,7 @@ define('Core/Geometry',[ * <li><code>position</code> - 3D vertex position. 64-bit floating-point (for precision). 3 components per attribute. See {@link VertexFormat#position}.</li> * <li><code>normal</code> - Normal (normalized), commonly used for lighting. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#normal}.</li> * <li><code>st</code> - 2D texture coordinate. 32-bit floating-point. 2 components per attribute. See {@link VertexFormat#st}.</li> - * <li><code>binormal</code> - Binormal (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#binormal}.</li> + * <li><code>bitangent</code> - Bitangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#bitangent}.</li> * <li><code>tangent</code> - Tangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#tangent}.</li> * </ul> * </p> @@ -13547,7 +12915,7 @@ define('Core/Geometry',[ * componentsPerAttribute : 3, * values : new Float32Array(0) * }); - * + * * @see GeometryAttribute * @see VertexFormat */ @@ -13828,7 +13196,7 @@ define('Core/GeometryAttributes',[ this.st = options.st; /** - * The binormal attribute (normalized), which is used for tangent-space effects like bump mapping. + * The bitangent attribute (normalized), which is used for tangent-space effects like bump mapping. * <p> * 32-bit floating-point. 3 components per attribute. * </p> @@ -13837,7 +13205,7 @@ define('Core/GeometryAttributes',[ * * @default undefined */ - this.binormal = options.binormal; + this.bitangent = options.bitangent; /** * The tangent attribute (normalized), which is used for tangent-space effects like bump mapping. @@ -14086,7 +13454,7 @@ define('Core/VertexFormat',[ this.st = defaultValue(options.st, false); /** - * When <code>true</code>, the vertex has a binormal attribute (normalized), which is used for tangent-space effects like bump mapping. + * When <code>true</code>, the vertex has a bitangent attribute (normalized), which is used for tangent-space effects like bump mapping. * <p> * 32-bit floating-point. 3 components per attribute. * </p> @@ -14095,7 +13463,7 @@ define('Core/VertexFormat',[ * * @default false */ - this.binormal = defaultValue(options.binormal, false); + this.bitangent = defaultValue(options.bitangent, false); /** * When <code>true</code>, the vertex has a tangent attribute (normalized), which is used for tangent-space effects like bump mapping. @@ -14197,7 +13565,7 @@ define('Core/VertexFormat',[ })); /** - * An immutable vertex format with well-known attributes: position, normal, st, binormal, and tangent. + * An immutable vertex format with well-known attributes: position, normal, st, tangent, and bitangent. * * @type {VertexFormat} * @constant @@ -14205,15 +13573,15 @@ define('Core/VertexFormat',[ * @see VertexFormat#position * @see VertexFormat#normal * @see VertexFormat#st - * @see VertexFormat#binormal * @see VertexFormat#tangent + * @see VertexFormat#bitangent */ VertexFormat.ALL = freezeObject(new VertexFormat({ position : true, normal : true, st : true, - binormal : true, - tangent : true + tangent : true, + bitangent : true })); /** @@ -14258,8 +13626,8 @@ define('Core/VertexFormat',[ array[startingIndex++] = value.position ? 1.0 : 0.0; array[startingIndex++] = value.normal ? 1.0 : 0.0; array[startingIndex++] = value.st ? 1.0 : 0.0; - array[startingIndex++] = value.binormal ? 1.0 : 0.0; array[startingIndex++] = value.tangent ? 1.0 : 0.0; + array[startingIndex++] = value.bitangent ? 1.0 : 0.0; array[startingIndex++] = value.color ? 1.0 : 0.0; return array; @@ -14284,19 +13652,19 @@ define('Core/VertexFormat',[ result = new VertexFormat(); } - result.position = array[startingIndex++] === 1.0; - result.normal = array[startingIndex++] === 1.0; - result.st = array[startingIndex++] === 1.0; - result.binormal = array[startingIndex++] === 1.0; - result.tangent = array[startingIndex++] === 1.0; - result.color = array[startingIndex++] === 1.0; + result.position = array[startingIndex++] === 1.0; + result.normal = array[startingIndex++] === 1.0; + result.st = array[startingIndex++] === 1.0; + result.tangent = array[startingIndex++] === 1.0; + result.bitangent = array[startingIndex++] === 1.0; + result.color = array[startingIndex++] === 1.0; return result; }; /** * Duplicates a VertexFormat instance. * - * @param {VertexFormat} cartesian The vertex format to duplicate. + * @param {VertexFormat} vertexFormat The vertex format to duplicate. * @param {VertexFormat} [result] The object onto which to store the result. * @returns {VertexFormat} The modified result parameter or a new VertexFormat instance if one was not provided. (Returns undefined if vertexFormat is undefined) */ @@ -14311,8 +13679,8 @@ define('Core/VertexFormat',[ result.position = vertexFormat.position; result.normal = vertexFormat.normal; result.st = vertexFormat.st; - result.binormal = vertexFormat.binormal; result.tangent = vertexFormat.tangent; + result.bitangent = vertexFormat.bitangent; result.color = vertexFormat.color; return result; }; @@ -14358,7 +13726,7 @@ define('Core/EllipsoidGeometry',[ var scratchPosition = new Cartesian3(); var scratchNormal = new Cartesian3(); var scratchTangent = new Cartesian3(); - var scratchBinormal = new Cartesian3(); + var scratchBitangent = new Cartesian3(); var scratchNormalST = new Cartesian3(); var defaultRadii = new Cartesian3(1.0, 1.0, 1.0); @@ -14525,7 +13893,7 @@ define('Core/EllipsoidGeometry',[ var normals = (vertexFormat.normal) ? new Float32Array(vertexCount * 3) : undefined; var tangents = (vertexFormat.tangent) ? new Float32Array(vertexCount * 3) : undefined; - var binormals = (vertexFormat.binormal) ? new Float32Array(vertexCount * 3) : undefined; + var bitangents = (vertexFormat.bitangent) ? new Float32Array(vertexCount * 3) : undefined; var st = (vertexFormat.st) ? new Float32Array(vertexCount * 2) : undefined; var cosTheta = new Array(slicePartitions); @@ -14583,9 +13951,9 @@ define('Core/EllipsoidGeometry',[ var stIndex = 0; var normalIndex = 0; var tangentIndex = 0; - var binormalIndex = 0; + var bitangentIndex = 0; - if (vertexFormat.st || vertexFormat.normal || vertexFormat.tangent || vertexFormat.binormal) { + if (vertexFormat.st || vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent) { for( i = 0; i < vertexCount; i++) { var position = Cartesian3.fromArray(positions, i * 3, scratchPosition); var normal = ellipsoid.geodeticSurfaceNormal(position, scratchNormal); @@ -14615,7 +13983,7 @@ define('Core/EllipsoidGeometry',[ normals[normalIndex++] = normal.z; } - if (vertexFormat.tangent || vertexFormat.binormal) { + if (vertexFormat.tangent || vertexFormat.bitangent) { var tangent = scratchTangent; if (i < slicePartitions || i > vertexCount - slicePartitions - 1) { Cartesian3.cross(Cartesian3.UNIT_X, normal, tangent); @@ -14631,13 +13999,13 @@ define('Core/EllipsoidGeometry',[ tangents[tangentIndex++] = tangent.z; } - if (vertexFormat.binormal) { - var binormal = Cartesian3.cross(normal, tangent, scratchBinormal); - Cartesian3.normalize(binormal, binormal); + if (vertexFormat.bitangent) { + var bitangent = Cartesian3.cross(normal, tangent, scratchBitangent); + Cartesian3.normalize(bitangent, bitangent); - binormals[binormalIndex++] = binormal.x; - binormals[binormalIndex++] = binormal.y; - binormals[binormalIndex++] = binormal.z; + bitangents[bitangentIndex++] = bitangent.x; + bitangents[bitangentIndex++] = bitangent.y; + bitangents[bitangentIndex++] = bitangent.z; } } } @@ -14666,11 +14034,11 @@ define('Core/EllipsoidGeometry',[ }); } - if (vertexFormat.binormal) { - attributes.binormal = new GeometryAttribute({ + if (vertexFormat.bitangent) { + attributes.bitangent = new GeometryAttribute({ componentDatatype : ComponentDatatype.FLOAT, componentsPerAttribute : 3, - values : binormals + values : bitangents }); } } @@ -14723,6 +14091,7 @@ define('Core/EllipsoidGeometry',[ /*global define*/ define('Core/SphereGeometry',[ './Cartesian3', + './Check', './defaultValue', './defined', './DeveloperError', @@ -14730,6 +14099,7 @@ define('Core/SphereGeometry',[ './VertexFormat' ], function( Cartesian3, + Check, defaultValue, defined, DeveloperError, @@ -14791,9 +14161,7 @@ define('Core/SphereGeometry',[ * @returns {Number[]} The array that was packed into */ SphereGeometry.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } + Check.typeOf.object('value', value); return EllipsoidGeometry.pack(value._ellipsoidGeometry, array, startingIndex); }; diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createSphereOutlineGeometry.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createSphereOutlineGeometry.js index bcefc329..7fbaf8ce 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createSphereOutlineGeometry.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createSphereOutlineGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,68 +45,6 @@ define('Core/defined',[],function() { return defined; }); -/*global define*/ -define('Core/freezeObject',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Freezes an object, using Object.freeze if available, otherwise returns - * the object unchanged. This function should be used in setup code to prevent - * errors from completely halting JavaScript execution in legacy browsers. - * - * @private - * - * @exports freezeObject - */ - var freezeObject = Object.freeze; - if (!defined(freezeObject)) { - freezeObject = function(o) { - return o; - }; - } - - return freezeObject; -}); - -/*global define*/ -define('Core/defaultValue',[ - './freezeObject' - ], function( - freezeObject) { - 'use strict'; - - /** - * Returns the first parameter if not undefined, otherwise the second parameter. - * Useful for setting a default value for a parameter. - * - * @exports defaultValue - * - * @param {*} a - * @param {*} b - * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter. - * - * @example - * param = Cesium.defaultValue(param, 'default'); - */ - function defaultValue(a, b) { - if (a !== undefined) { - return a; - } - return b; - } - - /** - * A frozen empty object that can be used as the default value for options passed as - * an object literal. - */ - defaultValue.EMPTY_OBJECT = freezeObject({}); - - return defaultValue; -}); - /*global define*/ define('Core/DeveloperError',[ './defined' @@ -188,41 +126,13 @@ define('Core/DeveloperError',[ return DeveloperError; }); -/*global define*/ -define('Core/isArray',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Tests an object to see if it is an array. - * @exports isArray - * - * @param {Object} value The value to test. - * @returns {Boolean} true if the value is an array, false otherwise. - */ - var isArray = Array.isArray; - if (!defined(isArray)) { - isArray = function(value) { - return Object.prototype.toString.call(value) === '[object Array]'; - }; - } - - return isArray; -}); - /*global define*/ define('Core/Check',[ - './defaultValue', - './defined', - './DeveloperError', - './isArray' + './defined', + './DeveloperError' ], function( - defaultValue, defined, - DeveloperError, - isArray) { + DeveloperError) { 'use strict'; /** @@ -237,111 +147,134 @@ define('Core/Check',[ */ Check.typeOf = {}; - /** - * Contains functions for checking numeric conditions such as minimum and maximum values - */ - Check.numeric = {}; - function getUndefinedErrorMessage(name) { - return name + ' was required but undefined.'; + return name + ' is required, actual value was undefined'; } function getFailedTypeErrorMessage(actual, expected, name) { - return 'Expected ' + name + ' to be typeof ' + expected + ', got ' + actual; + return 'Expected ' + name + ' to be typeof ' + expected + ', actual typeof was ' + actual; } /** * Throws if test is not defined * - * @param {*} test The value that is to be checked * @param {String} name The name of the variable being tested + * @param {*} test The value that is to be checked * @exception {DeveloperError} test must be defined */ - Check.defined = function (test, name) { + Check.defined = function (name, test) { if (!defined(test)) { throw new DeveloperError(getUndefinedErrorMessage(name)); } }; /** - * Throws if test is greater than maximum + * Throws if test is not typeof 'function' * - * @param {Number} test The value to test - * @param {Number} maximum The maximum allowed value - * @exception {DeveloperError} test must not be greater than maximum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'function' */ - Check.numeric.maximum = function (test, maximum) { - Check.typeOf.number(test); - Check.typeOf.number(maximum); - if (test > maximum) { - throw new DeveloperError('Expected ' + test + ' to be at most ' + maximum); + Check.typeOf.func = function (name, test) { + if (typeof test !== 'function') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); } }; /** - * Throws if test is less than minimum + * Throws if test is not typeof 'string' * - * @param {Number} test The value to test - * @param {Number} minimum The minimum allowed value - * @exception {DeveloperError} test must not be less than mininum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'string' */ - Check.numeric.minimum = function (test, minimum) { - Check.typeOf.number(test); - Check.typeOf.number(minimum); - if (test < minimum) { - throw new DeveloperError('Expected ' + test + ' to be at least ' + minimum); + Check.typeOf.string = function (name, test) { + if (typeof test !== 'string') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); } }; /** - * Throws if test is not typeof 'function' + * Throws if test is not typeof 'number' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'function' + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'number' */ - Check.typeOf.function = function (test, name) { - if (typeof test !== 'function') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); + Check.typeOf.number = function (name, test) { + if (typeof test !== 'number') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); } }; /** - * Throws if test is not typeof 'string' + * Throws if test is not typeof 'number' and less than limit * + * @param {String} name The name of the variable being tested * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than limit + */ + Check.typeOf.number.lessThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test >= limit) { + throw new DeveloperError('Expected ' + name + ' to be less than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and less than or equal to limit + * * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'string' + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than or equal to limit */ - Check.typeOf.string = function (test, name) { - if (typeof test !== 'string') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); + Check.typeOf.number.lessThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test > limit) { + throw new DeveloperError('Expected ' + name + ' to be less than or equal to ' + limit + ', actual value was ' + test); } }; /** - * Throws if test is not typeof 'number' + * Throws if test is not typeof 'number' and greater than limit * + * @param {String} name The name of the variable being tested * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than limit + */ + Check.typeOf.number.greaterThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test <= limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and greater than or equal to limit + * * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'number' + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than or equal to limit */ - Check.typeOf.number = function (test, name) { - if (typeof test !== 'number') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); + Check.typeOf.number.greaterThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test < limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than or equal to' + limit + ', actual value was ' + test); } }; /** * Throws if test is not typeof 'object' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested + * @param {*} test The value to test * @exception {DeveloperError} test must be typeof 'object' */ - Check.typeOf.object = function (test, name) { + Check.typeOf.object = function (name, test) { if (typeof test !== 'object') { throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'object', name)); } @@ -350,11 +283,11 @@ define('Core/Check',[ /** * Throws if test is not typeof 'boolean' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested + * @param {*} test The value to test * @exception {DeveloperError} test must be typeof 'boolean' */ - Check.typeOf.boolean = function (test, name) { + Check.typeOf.bool = function (name, test) { if (typeof test !== 'boolean') { throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'boolean', name)); } @@ -363,6 +296,68 @@ define('Core/Check',[ return Check; }); +/*global define*/ +define('Core/freezeObject',[ + './defined' + ], function( + defined) { + 'use strict'; + + /** + * Freezes an object, using Object.freeze if available, otherwise returns + * the object unchanged. This function should be used in setup code to prevent + * errors from completely halting JavaScript execution in legacy browsers. + * + * @private + * + * @exports freezeObject + */ + var freezeObject = Object.freeze; + if (!defined(freezeObject)) { + freezeObject = function(o) { + return o; + }; + } + + return freezeObject; +}); + +/*global define*/ +define('Core/defaultValue',[ + './freezeObject' + ], function( + freezeObject) { + 'use strict'; + + /** + * Returns the first parameter if not undefined, otherwise the second parameter. + * Useful for setting a default value for a parameter. + * + * @exports defaultValue + * + * @param {*} a + * @param {*} b + * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter. + * + * @example + * param = Cesium.defaultValue(param, 'default'); + */ + function defaultValue(a, b) { + if (a !== undefined) { + return a; + } + return b; + } + + /** + * A frozen empty object that can be used as the default value for options passed as + * an object literal. + */ + defaultValue.EMPTY_OBJECT = freezeObject({}); + + return defaultValue; +}); + /* I've wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace so it's better encapsulated. Now you can have multiple random number generators @@ -1047,7 +1042,7 @@ define('Core/Math',[ if (!defined(angle)) { throw new DeveloperError('angle is required.'); } - + return CesiumMath.clamp(angle, -1*CesiumMath.PI_OVER_TWO, CesiumMath.PI_OVER_TWO); }; @@ -1057,11 +1052,11 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [<code>-CesiumMath.PI</code>, <code>CesiumMath.PI</code>]. */ - CesiumMath.negativePiToPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.negativePiToPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - return CesiumMath.zeroToTwoPi(x + CesiumMath.PI) - CesiumMath.PI; + return CesiumMath.zeroToTwoPi(angle + CesiumMath.PI) - CesiumMath.PI; }; /** @@ -1070,12 +1065,12 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [0, <code>CesiumMath.TWO_PI</code>]. */ - CesiumMath.zeroToTwoPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.zeroToTwoPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - var mod = CesiumMath.mod(x, CesiumMath.TWO_PI); - if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(x) > CesiumMath.EPSILON14) { + var mod = CesiumMath.mod(angle, CesiumMath.TWO_PI); + if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(angle) > CesiumMath.EPSILON14) { return CesiumMath.TWO_PI; } return mod; @@ -1145,7 +1140,7 @@ define('Core/Math',[ * @example * //Compute 7!, which is equal to 5040 * var computedFactorial = Cesium.Math.factorial(7); - * + * * @see {@link http://en.wikipedia.org/wiki/Factorial|Factorial on Wikipedia} */ CesiumMath.factorial = function(n) { @@ -1429,7 +1424,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.fromSpherical = function(spherical, result) { - Check.typeOf.object(spherical, 'spherical'); + Check.typeOf.object('spherical', spherical); if (!defined(result)) { result = new Cartesian3(); @@ -1513,8 +1508,8 @@ define('Core/Cartesian3',[ * @returns {Number[]} The array that was packed into */ Cartesian3.pack = function(value, array, startingIndex) { - Check.typeOf.object(value, 'value'); - Check.defined(array, 'array'); + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1534,7 +1529,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.unpack = function(array, startingIndex, result) { - Check.defined(array, 'array'); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1555,7 +1550,7 @@ define('Core/Cartesian3',[ * @returns {Number[]} The packed array. */ Cartesian3.packArray = function(array, result) { - Check.defined(array, 'array'); + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -1578,8 +1573,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3[]} The unpacked array. */ Cartesian3.unpackArray = function(array, result) { - Check.defined(array, 'array'); - Check.numeric.minimum(array.length, 3); + Check.defined('array', array); + Check.typeOf.number.greaterThanOrEquals('array.length', array.length, 3); if (array.length % 3 !== 0) { throw new DeveloperError('array length must be a multiple of 3.'); } @@ -1625,7 +1620,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the maximum component. */ Cartesian3.maximumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z); }; @@ -1637,7 +1632,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the minimum component. */ Cartesian3.minimumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z); }; @@ -1651,9 +1646,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the minimum components. */ Cartesian3.minimumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -1671,9 +1666,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the maximum components. */ Cartesian3.maximumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -1688,7 +1683,7 @@ define('Core/Cartesian3',[ * @returns {Number} The squared magnitude. */ Cartesian3.magnitudeSquared = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z; }; @@ -1717,8 +1712,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distance(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(2.0, 0.0, 0.0)); */ Cartesian3.distance = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitude(distanceScratch); @@ -1737,8 +1732,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distanceSquared(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(3.0, 0.0, 0.0)); */ Cartesian3.distanceSquared = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitudeSquared(distanceScratch); @@ -1752,8 +1747,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.normalize = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian3.magnitude(cartesian); @@ -1776,8 +1771,8 @@ define('Core/Cartesian3',[ * @returns {Number} The dot product. */ Cartesian3.dot = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z; }; @@ -1791,9 +1786,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyComponents = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -1835,9 +1830,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.add = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -1854,9 +1849,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.subtract = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -1873,9 +1868,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -1892,9 +1887,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.divideByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -1910,8 +1905,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.negate = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -1927,8 +1922,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.abs = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -1947,10 +1942,10 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.lerp = function(start, end, t, result) { - Check.typeOf.object(start, 'start'); - Check.typeOf.object(end, 'end'); - Check.typeOf.number(t, 't'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian3.multiplyByScalar(end, t, lerpScratch); result = Cartesian3.multiplyByScalar(start, 1.0 - t, result); @@ -1967,8 +1962,8 @@ define('Core/Cartesian3',[ * @returns {Number} The angle between the Cartesians. */ Cartesian3.angleBetween = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.normalize(left, angleBetweenScratch); Cartesian3.normalize(right, angleBetweenScratch2); @@ -1986,8 +1981,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The most orthogonal axis. */ Cartesian3.mostOrthogonalAxis = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian3.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian3.abs(f, f); @@ -2064,9 +2059,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The cross product. */ Cartesian3.cross = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var leftX = left.x; var leftY = left.y; @@ -2099,8 +2094,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromDegrees(-115.0, 37.0); */ Cartesian3.fromDegrees = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); longitude = CesiumMath.toRadians(longitude); latitude = CesiumMath.toRadians(latitude); @@ -2125,8 +2120,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromRadians(-2.007, 0.645); */ Cartesian3.fromRadians = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); height = defaultValue(height, 0.0); var radiiSquared = defined(ellipsoid) ? ellipsoid.radiiSquared : wgs84RadiiSquared; @@ -2160,7 +2155,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArray([-115.0, 37.0, -107.0, 33.0]); */ Cartesian3.fromDegreesArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -2194,7 +2189,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArray([-2.007, 0.645, -1.867, .575]); */ Cartesian3.fromRadiansArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -2228,7 +2223,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArrayHeights([-115.0, 37.0, 100000.0, -107.0, 33.0, 150000.0]); */ Cartesian3.fromDegreesArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -2263,7 +2258,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArrayHeights([-2.007, 0.645, 100000.0, -1.867, .575, 150000.0]); */ Cartesian3.fromRadiansArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -3010,7 +3005,9 @@ define('Core/Ellipsoid',[ /** * Computes an Ellipsoid from a Cartesian specifying the radii in x, y, and z directions. * - * @param {Cartesian3} [radii=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Cartesian3} [cartesian=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new + * instance should be created. * @returns {Ellipsoid} A new Ellipsoid instance. * * @exception {DeveloperError} All radii components must be greater than or equal to zero. @@ -3650,6 +3647,7 @@ define('Core/Interval',[ /*global define*/ define('Core/Matrix3',[ './Cartesian3', + './Check', './defaultValue', './defined', './defineProperties', @@ -3658,6 +3656,7 @@ define('Core/Matrix3',[ './Math' ], function( Cartesian3, + Check, defaultValue, defined, defineProperties, @@ -3720,13 +3719,8 @@ define('Core/Matrix3',[ * @returns {Number[]} The array that was packed into */ Matrix3.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3752,9 +3746,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. */ Matrix3.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3781,24 +3773,24 @@ define('Core/Matrix3',[ * @param {Matrix3} [result] The object onto which to store the result. * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. (Returns undefined if matrix is undefined) */ - Matrix3.clone = function(values, result) { - if (!defined(values)) { + Matrix3.clone = function(matrix, result) { + if (!defined(matrix)) { return undefined; } if (!defined(result)) { - return new Matrix3(values[0], values[3], values[6], - values[1], values[4], values[7], - values[2], values[5], values[8]); + return new Matrix3(matrix[0], matrix[3], matrix[6], + matrix[1], matrix[4], matrix[7], + matrix[2], matrix[5], matrix[8]); } - result[0] = values[0]; - result[1] = values[1]; - result[2] = values[2]; - result[3] = values[3]; - result[4] = values[4]; - result[5] = values[5]; - result[6] = values[6]; - result[7] = values[7]; - result[8] = values[8]; + result[0] = matrix[0]; + result[1] = matrix[1]; + result[2] = matrix[2]; + result[3] = matrix[3]; + result[4] = matrix[4]; + result[5] = matrix[5]; + result[6] = matrix[6]; + result[7] = matrix[7]; + result[8] = matrix[8]; return result; }; @@ -3824,9 +3816,7 @@ define('Core/Matrix3',[ * var m2 = Cesium.Matrix3.fromArray(v2, 2); */ Matrix3.fromArray = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3854,9 +3844,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values parameter is required'); - } + Check.defined('values', values); return Matrix3.clone(values, result); }; @@ -3870,9 +3858,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix3(values[0], values[1], values[2], @@ -3899,9 +3885,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this quaternion. */ Matrix3.fromQuaternion = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); var x2 = quaternion.x * quaternion.x; var xy = quaternion.x * quaternion.y; @@ -3951,10 +3935,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this headingPitchRoll. */ Matrix3.fromHeadingPitchRoll = function(headingPitchRoll, result) { - if (!defined(headingPitchRoll)) { - throw new DeveloperError('headingPitchRoll is required'); - } - var cosTheta = Math.cos(-headingPitchRoll.pitch); + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + + var cosTheta = Math.cos(-headingPitchRoll.pitch); var cosPsi = Math.cos(-headingPitchRoll.heading); var cosPhi = Math.cos(headingPitchRoll.roll); var sinTheta = Math.sin(-headingPitchRoll.pitch); @@ -4005,9 +3988,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix3( @@ -4043,9 +4024,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromUniformScale(2.0); */ Matrix3.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix3( @@ -4069,7 +4048,7 @@ define('Core/Matrix3',[ /** * Computes a Matrix3 instance representing the cross product equivalent matrix of a Cartesian3 vector. * - * @param {Cartesian3} the vector on the left hand side of the cross product operation. + * @param {Cartesian3} vector the vector on the left hand side of the cross product operation. * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created. * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. * @@ -4081,9 +4060,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromCrossProduct(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromCrossProduct = function(vector, result) { - if (!defined(vector)) { - throw new DeveloperError('vector is required.'); - } + Check.typeOf.object('vector', vector); if (!defined(result)) { return new Matrix3( @@ -4118,9 +4095,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationX = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4159,9 +4134,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationY = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4200,9 +4173,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationZ = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4236,9 +4207,7 @@ define('Core/Matrix3',[ * @returns {Number[]} The modified Array parameter or a new Array instance if one was not provided. */ Matrix3.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5], matrix[6], matrix[7], matrix[8]]; @@ -4272,12 +4241,10 @@ define('Core/Matrix3',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix3.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 2) { - throw new DeveloperError('row must be 0, 1, or 2.'); - } - if (typeof column !== 'number' || column < 0 || column > 2) { - throw new DeveloperError('column must be 0, 1, or 2.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 2); + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 2); return column * 3 + row; }; @@ -4293,16 +4260,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var startIndex = index * 3; var x = matrix[startIndex]; @@ -4327,18 +4288,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); var startIndex = index * 3; @@ -4359,15 +4313,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 3]; @@ -4391,18 +4340,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); result[index] = cartesian.x; @@ -4421,12 +4363,8 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[3], matrix[4], matrix[5], scratchColumn)); @@ -4457,15 +4395,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var column0Row0 = left[0] * right[0] + left[3] * right[1] + left[6] * right[2]; var column0Row1 = left[1] * right[0] + left[4] * right[1] + left[7] * right[2]; @@ -4500,15 +4432,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -4531,15 +4457,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -4562,15 +4482,9 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -4595,15 +4509,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -4634,15 +4542,9 @@ define('Core/Matrix3',[ * @see Matrix3.multiplyByUniformScale */ Matrix3.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); result[0] = matrix[0] * scale.x; result[1] = matrix[1] * scale.x; @@ -4664,12 +4566,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -4691,12 +4589,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var column0Row0 = matrix[0]; var column0Row1 = matrix[3]; @@ -4836,9 +4730,7 @@ define('Core/Matrix3',[ * var c = Cesium.Cartesian3.multiplyByScalar(v, lambda, new Cesium.Cartesian3()); // equal to Cesium.Matrix3.multiplyByVector(a, v) */ Matrix3.computeEigenDecomposition = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); // This routine was created based upon Matrix Computations, 3rd ed., by Golub and Van Loan, // section 8.4.3 The Classical Jacobi Algorithm @@ -4882,12 +4774,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -4909,9 +4797,7 @@ define('Core/Matrix3',[ * @returns {Number} The value of the determinant of the matrix. */ Matrix3.determinant = function(matrix) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); var m11 = matrix[0]; var m21 = matrix[3]; @@ -4936,12 +4822,8 @@ define('Core/Matrix3',[ * @exception {DeveloperError} matrix is not invertible. */ Matrix3.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var m11 = matrix[0]; var m21 = matrix[1]; @@ -5007,9 +4889,7 @@ define('Core/Matrix3',[ * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. */ Matrix3.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -5197,12 +5077,14 @@ define('Core/Matrix3',[ /*global define*/ define('Core/Cartesian4',[ + './Check', './defaultValue', './defined', './DeveloperError', './freezeObject', './Math' ], function( + Check, defaultValue, defined, DeveloperError, @@ -5285,9 +5167,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.fromColor = function(color, result) { - if (!defined(color)) { - throw new DeveloperError('color is required'); - } + Check.typeOf.object('color', color); if (!defined(result)) { return new Cartesian4(color.red, color.green, color.blue, color.alpha); } @@ -5339,12 +5219,8 @@ define('Core/Cartesian4',[ * @returns {Number[]} The array that was packed into */ Cartesian4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5365,9 +5241,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5389,9 +5263,7 @@ define('Core/Cartesian4',[ * @returns {Number[]} The packed array. */ Cartesian4.packArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -5414,9 +5286,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4[]} The unpacked array. */ Cartesian4.unpackArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -5459,9 +5329,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the maximum component. */ Cartesian4.maximumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -5473,9 +5341,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the minimum component. */ Cartesian4.minimumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -5489,15 +5355,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the minimum components. */ Cartesian4.minimumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -5516,15 +5376,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the maximum components. */ Cartesian4.maximumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -5541,9 +5395,7 @@ define('Core/Cartesian4',[ * @returns {Number} The squared magnitude. */ Cartesian4.magnitudeSquared = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z + cartesian.w * cartesian.w; }; @@ -5574,9 +5426,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(2.0, 0.0, 0.0, 0.0)); */ Cartesian4.distance = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitude(distanceScratch); @@ -5597,9 +5448,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(3.0, 0.0, 0.0, 0.0)); */ Cartesian4.distanceSquared = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitudeSquared(distanceScratch); @@ -5613,12 +5463,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.normalize = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian4.magnitude(cartesian); @@ -5642,12 +5488,8 @@ define('Core/Cartesian4',[ * @returns {Number} The dot product. */ Cartesian4.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w; }; @@ -5661,15 +5503,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -5687,15 +5523,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x / right.x; result.y = left.y / right.y; @@ -5713,15 +5543,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -5739,15 +5563,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -5765,15 +5583,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -5791,15 +5603,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -5816,12 +5622,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.negate = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -5838,12 +5640,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.abs = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -5863,18 +5661,10 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian4.multiplyByScalar(end, t, lerpScratch); result = Cartesian4.multiplyByScalar(start, 1.0 - t, result); @@ -5890,12 +5680,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The most orthogonal axis. */ Cartesian4.mostOrthogonalAxis = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian4.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian4.abs(f, f); @@ -6140,6 +5926,7 @@ define('Core/RuntimeError',[ define('Core/Matrix4',[ './Cartesian3', './Cartesian4', + './Check', './defaultValue', './defined', './defineProperties', @@ -6151,6 +5938,7 @@ define('Core/Matrix4',[ ], function( Cartesian3, Cartesian4, + Check, defaultValue, defined, defineProperties, @@ -6241,13 +6029,8 @@ define('Core/Matrix4',[ * @returns {Number[]} The array that was packed into */ Matrix4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -6280,9 +6063,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if one was not provided. */ Matrix4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -6378,9 +6159,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required'); - } + Check.defined('values', values); return Matrix4.clone(values, result); }; @@ -6394,9 +6173,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix4(values[0], values[1], values[2], values[3], @@ -6433,9 +6210,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRotationTranslation = function(rotation, translation, result) { - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } + Check.typeOf.object('rotation', rotation); translation = defaultValue(translation, Cartesian3.ZERO); @@ -6483,15 +6258,9 @@ define('Core/Matrix4',[ * result); */ Matrix4.fromTranslationQuaternionRotationScale = function(translation, rotation, scale, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('translation', translation); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('scale', scale); if (!defined(result)) { result = new Matrix4(); @@ -6552,9 +6321,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromTranslationRotationScale = function(translationRotationScale, result) { - if (!defined(translationRotationScale)) { - throw new DeveloperError('translationRotationScale is required.'); - } + Check.typeOf.object('translationRotationScale', translationRotationScale); return Matrix4.fromTranslationQuaternionRotationScale(translationRotationScale.translation, translationRotationScale.rotation, translationRotationScale.scale, result); }; @@ -6569,9 +6336,7 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByTranslation */ Matrix4.fromTranslation = function(translation, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } + Check.typeOf.object('translation', translation); return Matrix4.fromRotationTranslation(Matrix3.IDENTITY, translation, result); }; @@ -6592,9 +6357,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix4.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix4( @@ -6639,9 +6402,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromUniformScale(2.0); */ Matrix4.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix4(scale, 0.0, 0.0, 0.0, @@ -6681,23 +6442,15 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromCamera = function(camera, result) { - if (!defined(camera)) { - throw new DeveloperError('camera is required.'); - } + Check.typeOf.object('camera', camera); var position = camera.position; var direction = camera.direction; var up = camera.up; - if (!defined(position)) { - throw new DeveloperError('camera.position is required.'); - } - if (!defined(direction)) { - throw new DeveloperError('camera.direction is required.'); - } - if (!defined(up)) { - throw new DeveloperError('camera.up is required.'); - } + Check.typeOf.object('camera.position', position); + Check.typeOf.object('camera.direction', direction); + Check.typeOf.object('camera.up', up); Cartesian3.normalize(direction, fromCameraF); Cartesian3.normalize(Cartesian3.cross(fromCameraF, up, fromCameraR), fromCameraR); @@ -6776,21 +6529,11 @@ define('Core/Matrix4',[ * @exception {DeveloperError} far must be greater than zero. */ Matrix4.computePerspectiveFieldOfView = function(fovY, aspectRatio, near, far, result) { - if (fovY <= 0.0 || fovY > Math.PI) { - throw new DeveloperError('fovY must be in (0, PI].'); - } - if (aspectRatio <= 0.0) { - throw new DeveloperError('aspectRatio must be greater than zero.'); - } - if (near <= 0.0) { - throw new DeveloperError('near must be greater than zero.'); - } - if (far <= 0.0) { - throw new DeveloperError('far must be greater than zero.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThan('fovY', fovY, 0.0); + Check.typeOf.number.lessThan('fovY', fovY, Math.PI); + Check.typeOf.number.greaterThan('near', near, 0.0); + Check.typeOf.number.greaterThan('far', far, 0.0); + Check.typeOf.object('result', result); var bottom = Math.tan(fovY * 0.5); @@ -6831,27 +6574,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeOrthographicOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var a = 1.0 / (right - left); var b = 1.0 / (top - bottom); @@ -6896,27 +6625,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computePerspectiveOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -6957,24 +6672,12 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeInfinitePerspectiveOffCenter = function(left, right, bottom, top, near, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -7022,9 +6725,7 @@ define('Core/Matrix4',[ * }, 0.0, 1.0, new Cesium.Matrix4()); */ Matrix4.computeViewportTransformation = function(viewport, nearDepthRange, farDepthRange, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); viewport = defaultValue(viewport, defaultValue.EMPTY_OBJECT); var x = defaultValue(viewport.x, 0.0); @@ -7076,21 +6777,11 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeView = function(position, direction, up, right, result) { - if (!defined(position)) { - throw new DeveloperError('position is required'); - } - if (!defined(direction)) { - throw new DeveloperError('direction is required'); - } - if (!defined(up)) { - throw new DeveloperError('up is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); + Check.typeOf.object('up', up); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = right.x; result[1] = up.x; @@ -7131,9 +6822,7 @@ define('Core/Matrix4',[ * //creates a = [10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0] */ Matrix4.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], @@ -7177,12 +6866,11 @@ define('Core/Matrix4',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix4.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 3) { - throw new DeveloperError('row must be 0, 1, 2, or 3.'); - } - if (typeof column !== 'number' || column < 0 || column > 3) { - throw new DeveloperError('column must be 0, 1, 2, or 3.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 3); + + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 3); return column * 4 + row; }; @@ -7215,16 +6903,12 @@ define('Core/Matrix4',[ * // a.x = 12.0; a.y = 16.0; a.z = 20.0; a.w = 24.0; */ Matrix4.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var startIndex = index * 4; var x = matrix[startIndex]; @@ -7266,18 +6950,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 96.0, 25.0] */ Matrix4.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); var startIndex = index * 4; @@ -7298,15 +6977,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.setTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -7359,16 +7032,12 @@ define('Core/Matrix4',[ * // a.x = 18.0; a.y = 19.0; a.z = 20.0; a.w = 21.0; */ Matrix4.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 4]; @@ -7409,18 +7078,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 24.0, 25.0] */ Matrix4.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); result[index] = cartesian.x; @@ -7440,12 +7104,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter */ Matrix4.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[4], matrix[5], matrix[6], scratchColumn)); @@ -7477,15 +7137,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -7569,15 +7223,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -7607,15 +7255,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -7656,15 +7298,9 @@ define('Core/Matrix4',[ * var m3 = Cesium.Matrix4.multiplyTransformation(m1, m2, new Cesium.Matrix4()); */ Matrix4.multiplyTransformation = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -7742,15 +7378,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByMatrix3(m, rotation, m); */ Matrix4.multiplyByMatrix3 = function(matrix, rotation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('result', result); var left0 = matrix[0]; var left1 = matrix[1]; @@ -7818,15 +7448,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByTranslation(m, position, m); */ Matrix4.multiplyByTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); var x = translation.x; var y = translation.y; @@ -7878,15 +7502,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByScale */ Matrix4.multiplyByUniformScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scale', scale); + Check.typeOf.object('result', result); uniformScaleScratch.x = scale; uniformScaleScratch.y = scale; @@ -7915,15 +7533,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByUniformScale */ Matrix4.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); var scaleX = scale.x; var scaleY = scale.y; @@ -7962,15 +7574,9 @@ define('Core/Matrix4',[ * @returns {Cartesian4} The modified result parameter. */ Matrix4.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8006,15 +7612,9 @@ define('Core/Matrix4',[ * // Cesium.Matrix4.multiplyByVector(matrix, new Cesium.Cartesian4(p.x, p.y, p.z, 0.0), result); */ Matrix4.multiplyByPointAsVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8044,16 +7644,9 @@ define('Core/Matrix4',[ * var result = Cesium.Matrix4.multiplyByPoint(matrix, p, new Cesium.Cartesian3()); */ Matrix4.multiplyByPoint = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8093,15 +7686,9 @@ define('Core/Matrix4',[ * // [-44.0, -46.0, -48.0, -50.0] */ Matrix4.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -8145,12 +7732,8 @@ define('Core/Matrix4',[ * // [-22.0, -23.0, -24.0, -25.0] */ Matrix4.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -8194,12 +7777,8 @@ define('Core/Matrix4',[ * // [13.0, 17.0, 21.0, 25.0] */ Matrix4.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var matrix1 = matrix[1]; var matrix2 = matrix[2]; @@ -8235,12 +7814,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -8354,9 +7929,7 @@ define('Core/Matrix4',[ * //Prints "Difference between both the matrices is not less than 0.1" on the console */ Matrix4.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -8387,12 +7960,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter. */ Matrix4.getTranslation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = matrix[12]; result.y = matrix[13]; @@ -8423,12 +7992,8 @@ define('Core/Matrix4',[ * // [12.0, 16.0, 20.0] */ Matrix4.getRotation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -8460,12 +8025,8 @@ define('Core/Matrix4',[ * @exception {RuntimeError} matrix is not invertible because its determinate is zero. */ Matrix4.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); // Special case for a zero scale matrix that can occur, for example, // when a model's node has a [0, 0, 0] scale. @@ -8603,12 +8164,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.inverseTransformation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); //This function is an optimized version of the below 4 lines. //var rT = Matrix3.transpose(Matrix4.getRotation(matrix)); @@ -8892,6 +8449,7 @@ define('Core/Matrix4',[ /*global define*/ define('Core/Rectangle',[ './Cartographic', + './Check', './defaultValue', './defined', './defineProperties', @@ -8901,6 +8459,7 @@ define('Core/Rectangle',[ './Math' ], function( Cartographic, + Check, defaultValue, defined, defineProperties, @@ -8997,13 +8556,8 @@ define('Core/Rectangle',[ * @returns {Number[]} The array that was packed into */ Rectangle.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -9024,9 +8578,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -9047,9 +8599,7 @@ define('Core/Rectangle',[ * @returns {Number} The width. */ Rectangle.computeWidth = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; if (east < west) { @@ -9064,9 +8614,7 @@ define('Core/Rectangle',[ * @returns {Number} The height. */ Rectangle.computeHeight = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); return rectangle.north - rectangle.south; }; @@ -9101,6 +8649,32 @@ define('Core/Rectangle',[ return result; }; + /** + * Creates an rectangle given the boundary longitude and latitude in radians. + * + * @param {Number} [west=0.0] The westernmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [south=0.0] The southernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Number} [east=0.0] The easternmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [north=0.0] The northernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Rectangle} [result] The object onto which to store the result, or undefined if a new instance should be created. + * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. + * + * @example + * var rectangle = Cesium.Rectangle.fromRadians(0.0, Math.PI/4, Math.PI/8, 3*Math.PI/4); + */ + Rectangle.fromRadians = function(west, south, east, north, result) { + if (!defined(result)) { + return new Rectangle(west, south, east, north); + } + + result.west = defaultValue(west, 0.0); + result.south = defaultValue(south, 0.0); + result.east = defaultValue(east, 0.0); + result.north = defaultValue(north, 0.0); + + return result; + }; + /** * Creates the smallest possible Rectangle that encloses all positions in the provided array. * @@ -9109,9 +8683,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartographicArray = function(cartographics, result) { - if (!defined(cartographics)) { - throw new DeveloperError('cartographics is required.'); - } + Check.defined('cartographics', cartographics); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -9164,9 +8736,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartesianArray = function(cartesians, ellipsoid, result) { - if (!defined(cartesians)) { - throw new DeveloperError('cartesians is required.'); - } + Check.defined('cartesians', cartesians); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -9282,9 +8852,7 @@ define('Core/Rectangle',[ * @returns {Boolean} <code>true</code> if the Rectangles are within the provided epsilon, <code>false</code> otherwise. */ Rectangle.prototype.equalsEpsilon = function(other, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon is required and must be a number.'); - } + Check.typeOf.number('epsilon', epsilon); return defined(other) && (Math.abs(this.west - other.west) <= epsilon) && @@ -9304,45 +8872,23 @@ define('Core/Rectangle',[ * @exception {DeveloperError} <code>west</code> must be in the interval [<code>-Pi</code>, <code>Pi</code>]. */ Rectangle.validate = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var north = rectangle.north; - if (typeof north !== 'number') { - throw new DeveloperError('north is required to be a number.'); - } - - if (north < -CesiumMath.PI_OVER_TWO || north > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('north must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('north', north, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('north', north, CesiumMath.PI_OVER_TWO); var south = rectangle.south; - if (typeof south !== 'number') { - throw new DeveloperError('south is required to be a number.'); - } - - if (south < -CesiumMath.PI_OVER_TWO || south > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('south must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('south', south, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('south', south, CesiumMath.PI_OVER_TWO); var west = rectangle.west; - if (typeof west !== 'number') { - throw new DeveloperError('west is required to be a number.'); - } - - if (west < -Math.PI || west > Math.PI) { - throw new DeveloperError('west must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('west', west, -Math.PI); + Check.typeOf.number.lessThanOrEquals('west', west, Math.PI); var east = rectangle.east; - if (typeof east !== 'number') { - throw new DeveloperError('east is required to be a number.'); - } - - if (east < -Math.PI || east > Math.PI) { - throw new DeveloperError('east must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('east', east, -Math.PI); + Check.typeOf.number.lessThanOrEquals('east', east, Math.PI); }; /** @@ -9353,9 +8899,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.south); @@ -9374,9 +8918,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.north); @@ -9395,9 +8937,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.north); @@ -9416,9 +8956,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.south); @@ -9437,9 +8975,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.center = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; @@ -9474,12 +9010,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.intersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var rectangleEast = rectangle.east; var rectangleWest = rectangle.west; @@ -9535,12 +9067,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.simpleIntersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var west = Math.max(rectangle.west, otherRectangle.west); var south = Math.max(rectangle.south, otherRectangle.south); @@ -9571,12 +9099,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.union = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); if (!defined(result)) { result = new Rectangle(); @@ -9620,12 +9144,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.expand = function(rectangle, cartographic, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); if (!defined(result)) { result = new Rectangle(); @@ -9647,12 +9167,8 @@ define('Core/Rectangle',[ * @returns {Boolean} true if the provided cartographic is inside the rectangle, false otherwise. */ Rectangle.contains = function(rectangle, cartographic) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); var longitude = cartographic.longitude; var latitude = cartographic.latitude; @@ -9685,9 +9201,7 @@ define('Core/Rectangle',[ * @returns {Cartesian3[]} The modified result parameter or a new Array of Cartesians instances if none was provided. */ Rectangle.subsample = function(rectangle, ellipsoid, surfaceHeight, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84); surfaceHeight = defaultValue(surfaceHeight, 0.0); @@ -9765,9 +9279,9 @@ define('Core/Rectangle',[ define('Core/BoundingSphere',[ './Cartesian3', './Cartographic', + './Check', './defaultValue', './defined', - './DeveloperError', './Ellipsoid', './GeographicProjection', './Intersect', @@ -9778,9 +9292,9 @@ define('Core/BoundingSphere',[ ], function( Cartesian3, Cartographic, + Check, defaultValue, defined, - DeveloperError, Ellipsoid, GeographicProjection, Intersect, @@ -10110,9 +9624,7 @@ define('Core/BoundingSphere',[ stride = defaultValue(stride, 3); - if (stride < 3) { - throw new DeveloperError('stride must be 3 or greater.'); - } + Check.typeOf.number.greaterThanOrEquals('stride', stride, 3); var currentPos = fromPointsCurrentPos; currentPos.x = positions[0] + center.x; @@ -10416,9 +9928,8 @@ define('Core/BoundingSphere',[ * var sphere = Cesium.BoundingSphere.fromCornerPoints(new Cesium.Cartesian3(-0.5, -0.5, -0.5), new Cesium.Cartesian3(0.5, 0.5, 0.5)); */ BoundingSphere.fromCornerPoints = function(corner, oppositeCorner, result) { - if (!defined(corner) || !defined(oppositeCorner)) { - throw new DeveloperError('corner and oppositeCorner are required.'); - } + Check.typeOf.object('corner', corner); + Check.typeOf.object('oppositeCorner', oppositeCorner); if (!defined(result)) { result = new BoundingSphere(); @@ -10442,9 +9953,7 @@ define('Core/BoundingSphere',[ * var boundingSphere = Cesium.BoundingSphere.fromEllipsoid(ellipsoid); */ BoundingSphere.fromEllipsoid = function(ellipsoid, result) { - if (!defined(ellipsoid)) { - throw new DeveloperError('ellipsoid is required.'); - } + Check.typeOf.object('ellipsoid', ellipsoid); if (!defined(result)) { result = new BoundingSphere(); @@ -10570,13 +10079,8 @@ define('Core/BoundingSphere',[ * @returns {Number[]} The array that was packed into */ BoundingSphere.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -10598,9 +10102,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if one was not provided. */ BoundingSphere.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -10627,13 +10129,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.union = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); if (!defined(result)) { result = new BoundingSphere(); @@ -10682,13 +10179,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.expand = function(sphere, point, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(point)) { - throw new DeveloperError('point is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('point', point); result = BoundingSphere.clone(sphere, result); @@ -10711,13 +10203,8 @@ define('Core/BoundingSphere',[ * intersects the plane. */ BoundingSphere.intersectPlane = function(sphere, plane) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(plane)) { - throw new DeveloperError('plane is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('plane', plane); var center = sphere.center; var radius = sphere.radius; @@ -10743,13 +10230,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.transform = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -10777,12 +10259,8 @@ define('Core/BoundingSphere',[ * }); */ BoundingSphere.distanceSquaredTo = function(sphere, cartesian) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('cartesian', cartesian); var diff = Cartesian3.subtract(sphere.center, cartesian, distanceSquaredToScratch); return Cartesian3.magnitudeSquared(diff) - sphere.radius * sphere.radius; @@ -10804,13 +10282,8 @@ define('Core/BoundingSphere',[ * var newBoundingSphere = Cesium.BoundingSphere.transformWithoutScale(boundingSphere, modelMatrix); */ BoundingSphere.transformWithoutScale = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -10837,17 +10310,9 @@ define('Core/BoundingSphere',[ * @returns {Interval} The nearest and farthest distances on the bounding sphere from position in direction. */ BoundingSphere.computePlaneDistances = function(sphere, position, direction, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(position)) { - throw new DeveloperError('position is required.'); - } - - if (!defined(direction)) { - throw new DeveloperError('direction is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); if (!defined(result)) { result = new Interval(); @@ -10882,9 +10347,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.projectTo2D = function(sphere, projection, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } + Check.typeOf.object('sphere', sphere); projection = defaultValue(projection, projectTo2DProjection); @@ -10979,12 +10442,8 @@ define('Core/BoundingSphere',[ * @returns {Boolean} <code>true</code> if the sphere is not visible; otherwise <code>false</code>. */ BoundingSphere.isOccluded = function(sphere, occluder) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(occluder)) { - throw new DeveloperError('occluder is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('occluder', occluder); return !occluder.isBoundingSphereVisible(sphere); }; @@ -12193,7 +11652,10 @@ define('Core/WebGLConstants',[ COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : 0x9279, TEXTURE_IMMUTABLE_FORMAT : 0x912F, MAX_ELEMENT_INDEX : 0x8D6B, - TEXTURE_IMMUTABLE_LEVELS : 0x82DF + TEXTURE_IMMUTABLE_LEVELS : 0x82DF, + + // Extensions + MAX_TEXTURE_MAX_ANISOTROPY_EXT : 0x84FF }; return freezeObject(WebGLConstants); @@ -12723,7 +12185,7 @@ define('Core/Geometry',[ * <li><code>position</code> - 3D vertex position. 64-bit floating-point (for precision). 3 components per attribute. See {@link VertexFormat#position}.</li> * <li><code>normal</code> - Normal (normalized), commonly used for lighting. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#normal}.</li> * <li><code>st</code> - 2D texture coordinate. 32-bit floating-point. 2 components per attribute. See {@link VertexFormat#st}.</li> - * <li><code>binormal</code> - Binormal (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#binormal}.</li> + * <li><code>bitangent</code> - Bitangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#bitangent}.</li> * <li><code>tangent</code> - Tangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#tangent}.</li> * </ul> * </p> @@ -12752,7 +12214,7 @@ define('Core/Geometry',[ * componentsPerAttribute : 3, * values : new Float32Array(0) * }); - * + * * @see GeometryAttribute * @see VertexFormat */ @@ -13033,7 +12495,7 @@ define('Core/GeometryAttributes',[ this.st = options.st; /** - * The binormal attribute (normalized), which is used for tangent-space effects like bump mapping. + * The bitangent attribute (normalized), which is used for tangent-space effects like bump mapping. * <p> * 32-bit floating-point. 3 components per attribute. * </p> @@ -13042,7 +12504,7 @@ define('Core/GeometryAttributes',[ * * @default undefined */ - this.binormal = options.binormal; + this.bitangent = options.bitangent; /** * The tangent attribute (normalized), which is used for tangent-space effects like bump mapping. @@ -13520,12 +12982,14 @@ define('Core/EllipsoidOutlineGeometry',[ /*global define*/ define('Core/SphereOutlineGeometry',[ './Cartesian3', + './Check', './defaultValue', './defined', './DeveloperError', './EllipsoidOutlineGeometry' ], function( Cartesian3, + Check, defaultValue, defined, DeveloperError, @@ -13586,9 +13050,7 @@ define('Core/SphereOutlineGeometry',[ * @returns {Number[]} The array that was packed into */ SphereOutlineGeometry.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } + Check.typeOf.object('value', value); return EllipsoidOutlineGeometry.pack(value._ellipsoidGeometry, array, startingIndex); }; diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createVerticesFromHeightmap.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createVerticesFromHeightmap.js index ff9a0d0a..b92adb63 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createVerticesFromHeightmap.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createVerticesFromHeightmap.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,68 +45,6 @@ define('Core/defined',[],function() { return defined; }); -/*global define*/ -define('Core/freezeObject',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Freezes an object, using Object.freeze if available, otherwise returns - * the object unchanged. This function should be used in setup code to prevent - * errors from completely halting JavaScript execution in legacy browsers. - * - * @private - * - * @exports freezeObject - */ - var freezeObject = Object.freeze; - if (!defined(freezeObject)) { - freezeObject = function(o) { - return o; - }; - } - - return freezeObject; -}); - -/*global define*/ -define('Core/defaultValue',[ - './freezeObject' - ], function( - freezeObject) { - 'use strict'; - - /** - * Returns the first parameter if not undefined, otherwise the second parameter. - * Useful for setting a default value for a parameter. - * - * @exports defaultValue - * - * @param {*} a - * @param {*} b - * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter. - * - * @example - * param = Cesium.defaultValue(param, 'default'); - */ - function defaultValue(a, b) { - if (a !== undefined) { - return a; - } - return b; - } - - /** - * A frozen empty object that can be used as the default value for options passed as - * an object literal. - */ - defaultValue.EMPTY_OBJECT = freezeObject({}); - - return defaultValue; -}); - /*global define*/ define('Core/DeveloperError',[ './defined' @@ -188,41 +126,13 @@ define('Core/DeveloperError',[ return DeveloperError; }); -/*global define*/ -define('Core/isArray',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Tests an object to see if it is an array. - * @exports isArray - * - * @param {Object} value The value to test. - * @returns {Boolean} true if the value is an array, false otherwise. - */ - var isArray = Array.isArray; - if (!defined(isArray)) { - isArray = function(value) { - return Object.prototype.toString.call(value) === '[object Array]'; - }; - } - - return isArray; -}); - /*global define*/ define('Core/Check',[ - './defaultValue', - './defined', - './DeveloperError', - './isArray' + './defined', + './DeveloperError' ], function( - defaultValue, defined, - DeveloperError, - isArray) { + DeveloperError) { 'use strict'; /** @@ -237,111 +147,134 @@ define('Core/Check',[ */ Check.typeOf = {}; - /** - * Contains functions for checking numeric conditions such as minimum and maximum values - */ - Check.numeric = {}; - function getUndefinedErrorMessage(name) { - return name + ' was required but undefined.'; + return name + ' is required, actual value was undefined'; } function getFailedTypeErrorMessage(actual, expected, name) { - return 'Expected ' + name + ' to be typeof ' + expected + ', got ' + actual; + return 'Expected ' + name + ' to be typeof ' + expected + ', actual typeof was ' + actual; } /** * Throws if test is not defined * - * @param {*} test The value that is to be checked * @param {String} name The name of the variable being tested + * @param {*} test The value that is to be checked * @exception {DeveloperError} test must be defined */ - Check.defined = function (test, name) { + Check.defined = function (name, test) { if (!defined(test)) { throw new DeveloperError(getUndefinedErrorMessage(name)); } }; /** - * Throws if test is greater than maximum + * Throws if test is not typeof 'function' * - * @param {Number} test The value to test - * @param {Number} maximum The maximum allowed value - * @exception {DeveloperError} test must not be greater than maximum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'function' */ - Check.numeric.maximum = function (test, maximum) { - Check.typeOf.number(test); - Check.typeOf.number(maximum); - if (test > maximum) { - throw new DeveloperError('Expected ' + test + ' to be at most ' + maximum); + Check.typeOf.func = function (name, test) { + if (typeof test !== 'function') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); } }; /** - * Throws if test is less than minimum + * Throws if test is not typeof 'string' * - * @param {Number} test The value to test - * @param {Number} minimum The minimum allowed value - * @exception {DeveloperError} test must not be less than mininum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'string' */ - Check.numeric.minimum = function (test, minimum) { - Check.typeOf.number(test); - Check.typeOf.number(minimum); - if (test < minimum) { - throw new DeveloperError('Expected ' + test + ' to be at least ' + minimum); + Check.typeOf.string = function (name, test) { + if (typeof test !== 'string') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); } }; /** - * Throws if test is not typeof 'function' + * Throws if test is not typeof 'number' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'function' + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'number' */ - Check.typeOf.function = function (test, name) { - if (typeof test !== 'function') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); + Check.typeOf.number = function (name, test) { + if (typeof test !== 'number') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); } }; /** - * Throws if test is not typeof 'string' + * Throws if test is not typeof 'number' and less than limit * + * @param {String} name The name of the variable being tested * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than limit + */ + Check.typeOf.number.lessThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test >= limit) { + throw new DeveloperError('Expected ' + name + ' to be less than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and less than or equal to limit + * * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'string' + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than or equal to limit */ - Check.typeOf.string = function (test, name) { - if (typeof test !== 'string') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); + Check.typeOf.number.lessThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test > limit) { + throw new DeveloperError('Expected ' + name + ' to be less than or equal to ' + limit + ', actual value was ' + test); } }; /** - * Throws if test is not typeof 'number' + * Throws if test is not typeof 'number' and greater than limit * + * @param {String} name The name of the variable being tested * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than limit + */ + Check.typeOf.number.greaterThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test <= limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and greater than or equal to limit + * * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'number' + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than or equal to limit */ - Check.typeOf.number = function (test, name) { - if (typeof test !== 'number') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); + Check.typeOf.number.greaterThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test < limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than or equal to' + limit + ', actual value was ' + test); } }; /** * Throws if test is not typeof 'object' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested + * @param {*} test The value to test * @exception {DeveloperError} test must be typeof 'object' */ - Check.typeOf.object = function (test, name) { + Check.typeOf.object = function (name, test) { if (typeof test !== 'object') { throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'object', name)); } @@ -350,11 +283,11 @@ define('Core/Check',[ /** * Throws if test is not typeof 'boolean' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested + * @param {*} test The value to test * @exception {DeveloperError} test must be typeof 'boolean' */ - Check.typeOf.boolean = function (test, name) { + Check.typeOf.bool = function (name, test) { if (typeof test !== 'boolean') { throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'boolean', name)); } @@ -363,6 +296,68 @@ define('Core/Check',[ return Check; }); +/*global define*/ +define('Core/freezeObject',[ + './defined' + ], function( + defined) { + 'use strict'; + + /** + * Freezes an object, using Object.freeze if available, otherwise returns + * the object unchanged. This function should be used in setup code to prevent + * errors from completely halting JavaScript execution in legacy browsers. + * + * @private + * + * @exports freezeObject + */ + var freezeObject = Object.freeze; + if (!defined(freezeObject)) { + freezeObject = function(o) { + return o; + }; + } + + return freezeObject; +}); + +/*global define*/ +define('Core/defaultValue',[ + './freezeObject' + ], function( + freezeObject) { + 'use strict'; + + /** + * Returns the first parameter if not undefined, otherwise the second parameter. + * Useful for setting a default value for a parameter. + * + * @exports defaultValue + * + * @param {*} a + * @param {*} b + * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter. + * + * @example + * param = Cesium.defaultValue(param, 'default'); + */ + function defaultValue(a, b) { + if (a !== undefined) { + return a; + } + return b; + } + + /** + * A frozen empty object that can be used as the default value for options passed as + * an object literal. + */ + defaultValue.EMPTY_OBJECT = freezeObject({}); + + return defaultValue; +}); + /* I've wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace so it's better encapsulated. Now you can have multiple random number generators @@ -1047,7 +1042,7 @@ define('Core/Math',[ if (!defined(angle)) { throw new DeveloperError('angle is required.'); } - + return CesiumMath.clamp(angle, -1*CesiumMath.PI_OVER_TWO, CesiumMath.PI_OVER_TWO); }; @@ -1057,11 +1052,11 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [<code>-CesiumMath.PI</code>, <code>CesiumMath.PI</code>]. */ - CesiumMath.negativePiToPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.negativePiToPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - return CesiumMath.zeroToTwoPi(x + CesiumMath.PI) - CesiumMath.PI; + return CesiumMath.zeroToTwoPi(angle + CesiumMath.PI) - CesiumMath.PI; }; /** @@ -1070,12 +1065,12 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [0, <code>CesiumMath.TWO_PI</code>]. */ - CesiumMath.zeroToTwoPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.zeroToTwoPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - var mod = CesiumMath.mod(x, CesiumMath.TWO_PI); - if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(x) > CesiumMath.EPSILON14) { + var mod = CesiumMath.mod(angle, CesiumMath.TWO_PI); + if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(angle) > CesiumMath.EPSILON14) { return CesiumMath.TWO_PI; } return mod; @@ -1145,7 +1140,7 @@ define('Core/Math',[ * @example * //Compute 7!, which is equal to 5040 * var computedFactorial = Cesium.Math.factorial(7); - * + * * @see {@link http://en.wikipedia.org/wiki/Factorial|Factorial on Wikipedia} */ CesiumMath.factorial = function(n) { @@ -1429,7 +1424,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.fromSpherical = function(spherical, result) { - Check.typeOf.object(spherical, 'spherical'); + Check.typeOf.object('spherical', spherical); if (!defined(result)) { result = new Cartesian3(); @@ -1513,8 +1508,8 @@ define('Core/Cartesian3',[ * @returns {Number[]} The array that was packed into */ Cartesian3.pack = function(value, array, startingIndex) { - Check.typeOf.object(value, 'value'); - Check.defined(array, 'array'); + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1534,7 +1529,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.unpack = function(array, startingIndex, result) { - Check.defined(array, 'array'); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1555,7 +1550,7 @@ define('Core/Cartesian3',[ * @returns {Number[]} The packed array. */ Cartesian3.packArray = function(array, result) { - Check.defined(array, 'array'); + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -1578,8 +1573,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3[]} The unpacked array. */ Cartesian3.unpackArray = function(array, result) { - Check.defined(array, 'array'); - Check.numeric.minimum(array.length, 3); + Check.defined('array', array); + Check.typeOf.number.greaterThanOrEquals('array.length', array.length, 3); if (array.length % 3 !== 0) { throw new DeveloperError('array length must be a multiple of 3.'); } @@ -1625,7 +1620,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the maximum component. */ Cartesian3.maximumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z); }; @@ -1637,7 +1632,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the minimum component. */ Cartesian3.minimumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z); }; @@ -1651,9 +1646,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the minimum components. */ Cartesian3.minimumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -1671,9 +1666,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the maximum components. */ Cartesian3.maximumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -1688,7 +1683,7 @@ define('Core/Cartesian3',[ * @returns {Number} The squared magnitude. */ Cartesian3.magnitudeSquared = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z; }; @@ -1717,8 +1712,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distance(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(2.0, 0.0, 0.0)); */ Cartesian3.distance = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitude(distanceScratch); @@ -1737,8 +1732,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distanceSquared(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(3.0, 0.0, 0.0)); */ Cartesian3.distanceSquared = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitudeSquared(distanceScratch); @@ -1752,8 +1747,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.normalize = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian3.magnitude(cartesian); @@ -1776,8 +1771,8 @@ define('Core/Cartesian3',[ * @returns {Number} The dot product. */ Cartesian3.dot = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z; }; @@ -1791,9 +1786,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyComponents = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -1835,9 +1830,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.add = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -1854,9 +1849,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.subtract = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -1873,9 +1868,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -1892,9 +1887,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.divideByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -1910,8 +1905,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.negate = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -1927,8 +1922,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.abs = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -1947,10 +1942,10 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.lerp = function(start, end, t, result) { - Check.typeOf.object(start, 'start'); - Check.typeOf.object(end, 'end'); - Check.typeOf.number(t, 't'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian3.multiplyByScalar(end, t, lerpScratch); result = Cartesian3.multiplyByScalar(start, 1.0 - t, result); @@ -1967,8 +1962,8 @@ define('Core/Cartesian3',[ * @returns {Number} The angle between the Cartesians. */ Cartesian3.angleBetween = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.normalize(left, angleBetweenScratch); Cartesian3.normalize(right, angleBetweenScratch2); @@ -1986,8 +1981,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The most orthogonal axis. */ Cartesian3.mostOrthogonalAxis = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian3.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian3.abs(f, f); @@ -2064,9 +2059,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The cross product. */ Cartesian3.cross = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var leftX = left.x; var leftY = left.y; @@ -2099,8 +2094,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromDegrees(-115.0, 37.0); */ Cartesian3.fromDegrees = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); longitude = CesiumMath.toRadians(longitude); latitude = CesiumMath.toRadians(latitude); @@ -2125,8 +2120,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromRadians(-2.007, 0.645); */ Cartesian3.fromRadians = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); height = defaultValue(height, 0.0); var radiiSquared = defined(ellipsoid) ? ellipsoid.radiiSquared : wgs84RadiiSquared; @@ -2160,7 +2155,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArray([-115.0, 37.0, -107.0, 33.0]); */ Cartesian3.fromDegreesArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -2194,7 +2189,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArray([-2.007, 0.645, -1.867, .575]); */ Cartesian3.fromRadiansArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -2228,7 +2223,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArrayHeights([-115.0, 37.0, 100000.0, -107.0, 33.0, 150000.0]); */ Cartesian3.fromDegreesArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -2263,7 +2258,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArrayHeights([-2.007, 0.645, 100000.0, -1.867, .575, 150000.0]); */ Cartesian3.fromRadiansArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -3010,7 +3005,9 @@ define('Core/Ellipsoid',[ /** * Computes an Ellipsoid from a Cartesian specifying the radii in x, y, and z directions. * - * @param {Cartesian3} [radii=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Cartesian3} [cartesian=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new + * instance should be created. * @returns {Ellipsoid} A new Ellipsoid instance. * * @exception {DeveloperError} All radii components must be greater than or equal to zero. @@ -3883,6 +3880,7 @@ define('Core/Interval',[ /*global define*/ define('Core/Matrix3',[ './Cartesian3', + './Check', './defaultValue', './defined', './defineProperties', @@ -3891,6 +3889,7 @@ define('Core/Matrix3',[ './Math' ], function( Cartesian3, + Check, defaultValue, defined, defineProperties, @@ -3953,13 +3952,8 @@ define('Core/Matrix3',[ * @returns {Number[]} The array that was packed into */ Matrix3.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3985,9 +3979,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. */ Matrix3.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -4014,24 +4006,24 @@ define('Core/Matrix3',[ * @param {Matrix3} [result] The object onto which to store the result. * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. (Returns undefined if matrix is undefined) */ - Matrix3.clone = function(values, result) { - if (!defined(values)) { + Matrix3.clone = function(matrix, result) { + if (!defined(matrix)) { return undefined; } if (!defined(result)) { - return new Matrix3(values[0], values[3], values[6], - values[1], values[4], values[7], - values[2], values[5], values[8]); + return new Matrix3(matrix[0], matrix[3], matrix[6], + matrix[1], matrix[4], matrix[7], + matrix[2], matrix[5], matrix[8]); } - result[0] = values[0]; - result[1] = values[1]; - result[2] = values[2]; - result[3] = values[3]; - result[4] = values[4]; - result[5] = values[5]; - result[6] = values[6]; - result[7] = values[7]; - result[8] = values[8]; + result[0] = matrix[0]; + result[1] = matrix[1]; + result[2] = matrix[2]; + result[3] = matrix[3]; + result[4] = matrix[4]; + result[5] = matrix[5]; + result[6] = matrix[6]; + result[7] = matrix[7]; + result[8] = matrix[8]; return result; }; @@ -4057,9 +4049,7 @@ define('Core/Matrix3',[ * var m2 = Cesium.Matrix3.fromArray(v2, 2); */ Matrix3.fromArray = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -4087,9 +4077,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values parameter is required'); - } + Check.defined('values', values); return Matrix3.clone(values, result); }; @@ -4103,9 +4091,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix3(values[0], values[1], values[2], @@ -4132,9 +4118,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this quaternion. */ Matrix3.fromQuaternion = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); var x2 = quaternion.x * quaternion.x; var xy = quaternion.x * quaternion.y; @@ -4184,10 +4168,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this headingPitchRoll. */ Matrix3.fromHeadingPitchRoll = function(headingPitchRoll, result) { - if (!defined(headingPitchRoll)) { - throw new DeveloperError('headingPitchRoll is required'); - } - var cosTheta = Math.cos(-headingPitchRoll.pitch); + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + + var cosTheta = Math.cos(-headingPitchRoll.pitch); var cosPsi = Math.cos(-headingPitchRoll.heading); var cosPhi = Math.cos(headingPitchRoll.roll); var sinTheta = Math.sin(-headingPitchRoll.pitch); @@ -4238,9 +4221,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix3( @@ -4276,9 +4257,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromUniformScale(2.0); */ Matrix3.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix3( @@ -4302,7 +4281,7 @@ define('Core/Matrix3',[ /** * Computes a Matrix3 instance representing the cross product equivalent matrix of a Cartesian3 vector. * - * @param {Cartesian3} the vector on the left hand side of the cross product operation. + * @param {Cartesian3} vector the vector on the left hand side of the cross product operation. * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created. * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. * @@ -4314,9 +4293,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromCrossProduct(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromCrossProduct = function(vector, result) { - if (!defined(vector)) { - throw new DeveloperError('vector is required.'); - } + Check.typeOf.object('vector', vector); if (!defined(result)) { return new Matrix3( @@ -4351,9 +4328,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationX = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4392,9 +4367,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationY = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4433,9 +4406,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationZ = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4469,9 +4440,7 @@ define('Core/Matrix3',[ * @returns {Number[]} The modified Array parameter or a new Array instance if one was not provided. */ Matrix3.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5], matrix[6], matrix[7], matrix[8]]; @@ -4505,12 +4474,10 @@ define('Core/Matrix3',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix3.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 2) { - throw new DeveloperError('row must be 0, 1, or 2.'); - } - if (typeof column !== 'number' || column < 0 || column > 2) { - throw new DeveloperError('column must be 0, 1, or 2.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 2); + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 2); return column * 3 + row; }; @@ -4526,16 +4493,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var startIndex = index * 3; var x = matrix[startIndex]; @@ -4560,18 +4521,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); var startIndex = index * 3; @@ -4592,15 +4546,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 3]; @@ -4624,18 +4573,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); result[index] = cartesian.x; @@ -4654,12 +4596,8 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[3], matrix[4], matrix[5], scratchColumn)); @@ -4690,15 +4628,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var column0Row0 = left[0] * right[0] + left[3] * right[1] + left[6] * right[2]; var column0Row1 = left[1] * right[0] + left[4] * right[1] + left[7] * right[2]; @@ -4733,15 +4665,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -4764,15 +4690,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -4795,15 +4715,9 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -4828,15 +4742,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -4867,15 +4775,9 @@ define('Core/Matrix3',[ * @see Matrix3.multiplyByUniformScale */ Matrix3.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); result[0] = matrix[0] * scale.x; result[1] = matrix[1] * scale.x; @@ -4897,12 +4799,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -4924,12 +4822,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var column0Row0 = matrix[0]; var column0Row1 = matrix[3]; @@ -5069,9 +4963,7 @@ define('Core/Matrix3',[ * var c = Cesium.Cartesian3.multiplyByScalar(v, lambda, new Cesium.Cartesian3()); // equal to Cesium.Matrix3.multiplyByVector(a, v) */ Matrix3.computeEigenDecomposition = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); // This routine was created based upon Matrix Computations, 3rd ed., by Golub and Van Loan, // section 8.4.3 The Classical Jacobi Algorithm @@ -5115,12 +5007,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -5142,9 +5030,7 @@ define('Core/Matrix3',[ * @returns {Number} The value of the determinant of the matrix. */ Matrix3.determinant = function(matrix) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); var m11 = matrix[0]; var m21 = matrix[3]; @@ -5169,12 +5055,8 @@ define('Core/Matrix3',[ * @exception {DeveloperError} matrix is not invertible. */ Matrix3.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var m11 = matrix[0]; var m21 = matrix[1]; @@ -5240,9 +5122,7 @@ define('Core/Matrix3',[ * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. */ Matrix3.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -5430,12 +5310,14 @@ define('Core/Matrix3',[ /*global define*/ define('Core/Cartesian4',[ + './Check', './defaultValue', './defined', './DeveloperError', './freezeObject', './Math' ], function( + Check, defaultValue, defined, DeveloperError, @@ -5518,9 +5400,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.fromColor = function(color, result) { - if (!defined(color)) { - throw new DeveloperError('color is required'); - } + Check.typeOf.object('color', color); if (!defined(result)) { return new Cartesian4(color.red, color.green, color.blue, color.alpha); } @@ -5572,12 +5452,8 @@ define('Core/Cartesian4',[ * @returns {Number[]} The array that was packed into */ Cartesian4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5598,9 +5474,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5622,9 +5496,7 @@ define('Core/Cartesian4',[ * @returns {Number[]} The packed array. */ Cartesian4.packArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -5647,9 +5519,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4[]} The unpacked array. */ Cartesian4.unpackArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -5692,9 +5562,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the maximum component. */ Cartesian4.maximumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -5706,9 +5574,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the minimum component. */ Cartesian4.minimumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -5722,15 +5588,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the minimum components. */ Cartesian4.minimumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -5749,15 +5609,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the maximum components. */ Cartesian4.maximumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -5774,9 +5628,7 @@ define('Core/Cartesian4',[ * @returns {Number} The squared magnitude. */ Cartesian4.magnitudeSquared = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z + cartesian.w * cartesian.w; }; @@ -5807,9 +5659,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(2.0, 0.0, 0.0, 0.0)); */ Cartesian4.distance = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitude(distanceScratch); @@ -5830,9 +5681,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(3.0, 0.0, 0.0, 0.0)); */ Cartesian4.distanceSquared = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitudeSquared(distanceScratch); @@ -5846,12 +5696,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.normalize = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian4.magnitude(cartesian); @@ -5875,12 +5721,8 @@ define('Core/Cartesian4',[ * @returns {Number} The dot product. */ Cartesian4.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w; }; @@ -5894,15 +5736,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -5920,15 +5756,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x / right.x; result.y = left.y / right.y; @@ -5946,15 +5776,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -5972,15 +5796,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -5998,15 +5816,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -6024,15 +5836,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -6049,12 +5855,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.negate = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -6071,12 +5873,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.abs = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -6096,18 +5894,10 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian4.multiplyByScalar(end, t, lerpScratch); result = Cartesian4.multiplyByScalar(start, 1.0 - t, result); @@ -6123,12 +5913,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The most orthogonal axis. */ Cartesian4.mostOrthogonalAxis = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian4.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian4.abs(f, f); @@ -6373,6 +6159,7 @@ define('Core/RuntimeError',[ define('Core/Matrix4',[ './Cartesian3', './Cartesian4', + './Check', './defaultValue', './defined', './defineProperties', @@ -6384,6 +6171,7 @@ define('Core/Matrix4',[ ], function( Cartesian3, Cartesian4, + Check, defaultValue, defined, defineProperties, @@ -6474,13 +6262,8 @@ define('Core/Matrix4',[ * @returns {Number[]} The array that was packed into */ Matrix4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -6513,9 +6296,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if one was not provided. */ Matrix4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -6611,9 +6392,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required'); - } + Check.defined('values', values); return Matrix4.clone(values, result); }; @@ -6627,9 +6406,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix4(values[0], values[1], values[2], values[3], @@ -6666,9 +6443,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRotationTranslation = function(rotation, translation, result) { - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } + Check.typeOf.object('rotation', rotation); translation = defaultValue(translation, Cartesian3.ZERO); @@ -6716,15 +6491,9 @@ define('Core/Matrix4',[ * result); */ Matrix4.fromTranslationQuaternionRotationScale = function(translation, rotation, scale, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('translation', translation); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('scale', scale); if (!defined(result)) { result = new Matrix4(); @@ -6785,9 +6554,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromTranslationRotationScale = function(translationRotationScale, result) { - if (!defined(translationRotationScale)) { - throw new DeveloperError('translationRotationScale is required.'); - } + Check.typeOf.object('translationRotationScale', translationRotationScale); return Matrix4.fromTranslationQuaternionRotationScale(translationRotationScale.translation, translationRotationScale.rotation, translationRotationScale.scale, result); }; @@ -6802,9 +6569,7 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByTranslation */ Matrix4.fromTranslation = function(translation, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } + Check.typeOf.object('translation', translation); return Matrix4.fromRotationTranslation(Matrix3.IDENTITY, translation, result); }; @@ -6825,9 +6590,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix4.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix4( @@ -6872,9 +6635,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromUniformScale(2.0); */ Matrix4.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix4(scale, 0.0, 0.0, 0.0, @@ -6914,23 +6675,15 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromCamera = function(camera, result) { - if (!defined(camera)) { - throw new DeveloperError('camera is required.'); - } + Check.typeOf.object('camera', camera); var position = camera.position; var direction = camera.direction; var up = camera.up; - - if (!defined(position)) { - throw new DeveloperError('camera.position is required.'); - } - if (!defined(direction)) { - throw new DeveloperError('camera.direction is required.'); - } - if (!defined(up)) { - throw new DeveloperError('camera.up is required.'); - } + + Check.typeOf.object('camera.position', position); + Check.typeOf.object('camera.direction', direction); + Check.typeOf.object('camera.up', up); Cartesian3.normalize(direction, fromCameraF); Cartesian3.normalize(Cartesian3.cross(fromCameraF, up, fromCameraR), fromCameraR); @@ -7009,21 +6762,11 @@ define('Core/Matrix4',[ * @exception {DeveloperError} far must be greater than zero. */ Matrix4.computePerspectiveFieldOfView = function(fovY, aspectRatio, near, far, result) { - if (fovY <= 0.0 || fovY > Math.PI) { - throw new DeveloperError('fovY must be in (0, PI].'); - } - if (aspectRatio <= 0.0) { - throw new DeveloperError('aspectRatio must be greater than zero.'); - } - if (near <= 0.0) { - throw new DeveloperError('near must be greater than zero.'); - } - if (far <= 0.0) { - throw new DeveloperError('far must be greater than zero.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThan('fovY', fovY, 0.0); + Check.typeOf.number.lessThan('fovY', fovY, Math.PI); + Check.typeOf.number.greaterThan('near', near, 0.0); + Check.typeOf.number.greaterThan('far', far, 0.0); + Check.typeOf.object('result', result); var bottom = Math.tan(fovY * 0.5); @@ -7064,27 +6807,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeOrthographicOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var a = 1.0 / (right - left); var b = 1.0 / (top - bottom); @@ -7129,27 +6858,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computePerspectiveOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -7190,24 +6905,12 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeInfinitePerspectiveOffCenter = function(left, right, bottom, top, near, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -7255,9 +6958,7 @@ define('Core/Matrix4',[ * }, 0.0, 1.0, new Cesium.Matrix4()); */ Matrix4.computeViewportTransformation = function(viewport, nearDepthRange, farDepthRange, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); viewport = defaultValue(viewport, defaultValue.EMPTY_OBJECT); var x = defaultValue(viewport.x, 0.0); @@ -7309,21 +7010,11 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeView = function(position, direction, up, right, result) { - if (!defined(position)) { - throw new DeveloperError('position is required'); - } - if (!defined(direction)) { - throw new DeveloperError('direction is required'); - } - if (!defined(up)) { - throw new DeveloperError('up is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); + Check.typeOf.object('up', up); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = right.x; result[1] = up.x; @@ -7364,9 +7055,7 @@ define('Core/Matrix4',[ * //creates a = [10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0] */ Matrix4.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], @@ -7410,12 +7099,11 @@ define('Core/Matrix4',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix4.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 3) { - throw new DeveloperError('row must be 0, 1, 2, or 3.'); - } - if (typeof column !== 'number' || column < 0 || column > 3) { - throw new DeveloperError('column must be 0, 1, 2, or 3.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 3); + + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 3); return column * 4 + row; }; @@ -7448,16 +7136,12 @@ define('Core/Matrix4',[ * // a.x = 12.0; a.y = 16.0; a.z = 20.0; a.w = 24.0; */ Matrix4.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var startIndex = index * 4; var x = matrix[startIndex]; @@ -7499,18 +7183,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 96.0, 25.0] */ Matrix4.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); var startIndex = index * 4; @@ -7531,15 +7210,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.setTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -7592,16 +7265,12 @@ define('Core/Matrix4',[ * // a.x = 18.0; a.y = 19.0; a.z = 20.0; a.w = 21.0; */ Matrix4.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 4]; @@ -7642,18 +7311,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 24.0, 25.0] */ Matrix4.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); result[index] = cartesian.x; @@ -7673,12 +7337,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter */ Matrix4.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[4], matrix[5], matrix[6], scratchColumn)); @@ -7710,15 +7370,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -7802,15 +7456,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -7840,15 +7488,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -7889,15 +7531,9 @@ define('Core/Matrix4',[ * var m3 = Cesium.Matrix4.multiplyTransformation(m1, m2, new Cesium.Matrix4()); */ Matrix4.multiplyTransformation = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -7975,15 +7611,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByMatrix3(m, rotation, m); */ Matrix4.multiplyByMatrix3 = function(matrix, rotation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('result', result); var left0 = matrix[0]; var left1 = matrix[1]; @@ -8051,15 +7681,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByTranslation(m, position, m); */ Matrix4.multiplyByTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); var x = translation.x; var y = translation.y; @@ -8111,15 +7735,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByScale */ Matrix4.multiplyByUniformScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scale', scale); + Check.typeOf.object('result', result); uniformScaleScratch.x = scale; uniformScaleScratch.y = scale; @@ -8148,15 +7766,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByUniformScale */ Matrix4.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); var scaleX = scale.x; var scaleY = scale.y; @@ -8195,15 +7807,9 @@ define('Core/Matrix4',[ * @returns {Cartesian4} The modified result parameter. */ Matrix4.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8239,15 +7845,9 @@ define('Core/Matrix4',[ * // Cesium.Matrix4.multiplyByVector(matrix, new Cesium.Cartesian4(p.x, p.y, p.z, 0.0), result); */ Matrix4.multiplyByPointAsVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8277,16 +7877,9 @@ define('Core/Matrix4',[ * var result = Cesium.Matrix4.multiplyByPoint(matrix, p, new Cesium.Cartesian3()); */ Matrix4.multiplyByPoint = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8326,15 +7919,9 @@ define('Core/Matrix4',[ * // [-44.0, -46.0, -48.0, -50.0] */ Matrix4.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -8378,12 +7965,8 @@ define('Core/Matrix4',[ * // [-22.0, -23.0, -24.0, -25.0] */ Matrix4.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -8427,12 +8010,8 @@ define('Core/Matrix4',[ * // [13.0, 17.0, 21.0, 25.0] */ Matrix4.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var matrix1 = matrix[1]; var matrix2 = matrix[2]; @@ -8468,12 +8047,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -8587,9 +8162,7 @@ define('Core/Matrix4',[ * //Prints "Difference between both the matrices is not less than 0.1" on the console */ Matrix4.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -8620,12 +8193,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter. */ Matrix4.getTranslation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = matrix[12]; result.y = matrix[13]; @@ -8656,12 +8225,8 @@ define('Core/Matrix4',[ * // [12.0, 16.0, 20.0] */ Matrix4.getRotation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -8693,12 +8258,8 @@ define('Core/Matrix4',[ * @exception {RuntimeError} matrix is not invertible because its determinate is zero. */ Matrix4.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); // Special case for a zero scale matrix that can occur, for example, // when a model's node has a [0, 0, 0] scale. @@ -8836,12 +8397,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.inverseTransformation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); //This function is an optimized version of the below 4 lines. //var rT = Matrix3.transpose(Matrix4.getRotation(matrix)); @@ -9125,6 +8682,7 @@ define('Core/Matrix4',[ /*global define*/ define('Core/Rectangle',[ './Cartographic', + './Check', './defaultValue', './defined', './defineProperties', @@ -9134,6 +8692,7 @@ define('Core/Rectangle',[ './Math' ], function( Cartographic, + Check, defaultValue, defined, defineProperties, @@ -9230,13 +8789,8 @@ define('Core/Rectangle',[ * @returns {Number[]} The array that was packed into */ Rectangle.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -9257,9 +8811,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -9280,9 +8832,7 @@ define('Core/Rectangle',[ * @returns {Number} The width. */ Rectangle.computeWidth = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; if (east < west) { @@ -9297,9 +8847,7 @@ define('Core/Rectangle',[ * @returns {Number} The height. */ Rectangle.computeHeight = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); return rectangle.north - rectangle.south; }; @@ -9334,6 +8882,32 @@ define('Core/Rectangle',[ return result; }; + /** + * Creates an rectangle given the boundary longitude and latitude in radians. + * + * @param {Number} [west=0.0] The westernmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [south=0.0] The southernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Number} [east=0.0] The easternmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [north=0.0] The northernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Rectangle} [result] The object onto which to store the result, or undefined if a new instance should be created. + * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. + * + * @example + * var rectangle = Cesium.Rectangle.fromRadians(0.0, Math.PI/4, Math.PI/8, 3*Math.PI/4); + */ + Rectangle.fromRadians = function(west, south, east, north, result) { + if (!defined(result)) { + return new Rectangle(west, south, east, north); + } + + result.west = defaultValue(west, 0.0); + result.south = defaultValue(south, 0.0); + result.east = defaultValue(east, 0.0); + result.north = defaultValue(north, 0.0); + + return result; + }; + /** * Creates the smallest possible Rectangle that encloses all positions in the provided array. * @@ -9342,9 +8916,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartographicArray = function(cartographics, result) { - if (!defined(cartographics)) { - throw new DeveloperError('cartographics is required.'); - } + Check.defined('cartographics', cartographics); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -9397,9 +8969,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartesianArray = function(cartesians, ellipsoid, result) { - if (!defined(cartesians)) { - throw new DeveloperError('cartesians is required.'); - } + Check.defined('cartesians', cartesians); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -9515,9 +9085,7 @@ define('Core/Rectangle',[ * @returns {Boolean} <code>true</code> if the Rectangles are within the provided epsilon, <code>false</code> otherwise. */ Rectangle.prototype.equalsEpsilon = function(other, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon is required and must be a number.'); - } + Check.typeOf.number('epsilon', epsilon); return defined(other) && (Math.abs(this.west - other.west) <= epsilon) && @@ -9537,45 +9105,23 @@ define('Core/Rectangle',[ * @exception {DeveloperError} <code>west</code> must be in the interval [<code>-Pi</code>, <code>Pi</code>]. */ Rectangle.validate = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var north = rectangle.north; - if (typeof north !== 'number') { - throw new DeveloperError('north is required to be a number.'); - } - - if (north < -CesiumMath.PI_OVER_TWO || north > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('north must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('north', north, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('north', north, CesiumMath.PI_OVER_TWO); var south = rectangle.south; - if (typeof south !== 'number') { - throw new DeveloperError('south is required to be a number.'); - } - - if (south < -CesiumMath.PI_OVER_TWO || south > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('south must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('south', south, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('south', south, CesiumMath.PI_OVER_TWO); var west = rectangle.west; - if (typeof west !== 'number') { - throw new DeveloperError('west is required to be a number.'); - } - - if (west < -Math.PI || west > Math.PI) { - throw new DeveloperError('west must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('west', west, -Math.PI); + Check.typeOf.number.lessThanOrEquals('west', west, Math.PI); var east = rectangle.east; - if (typeof east !== 'number') { - throw new DeveloperError('east is required to be a number.'); - } - - if (east < -Math.PI || east > Math.PI) { - throw new DeveloperError('east must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('east', east, -Math.PI); + Check.typeOf.number.lessThanOrEquals('east', east, Math.PI); }; /** @@ -9586,9 +9132,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.south); @@ -9607,9 +9151,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.north); @@ -9628,9 +9170,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.north); @@ -9649,9 +9189,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.south); @@ -9670,9 +9208,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.center = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; @@ -9707,12 +9243,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.intersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var rectangleEast = rectangle.east; var rectangleWest = rectangle.west; @@ -9768,12 +9300,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.simpleIntersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var west = Math.max(rectangle.west, otherRectangle.west); var south = Math.max(rectangle.south, otherRectangle.south); @@ -9804,12 +9332,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.union = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); if (!defined(result)) { result = new Rectangle(); @@ -9853,12 +9377,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.expand = function(rectangle, cartographic, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); if (!defined(result)) { result = new Rectangle(); @@ -9880,12 +9400,8 @@ define('Core/Rectangle',[ * @returns {Boolean} true if the provided cartographic is inside the rectangle, false otherwise. */ Rectangle.contains = function(rectangle, cartographic) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); var longitude = cartographic.longitude; var latitude = cartographic.latitude; @@ -9918,9 +9434,7 @@ define('Core/Rectangle',[ * @returns {Cartesian3[]} The modified result parameter or a new Array of Cartesians instances if none was provided. */ Rectangle.subsample = function(rectangle, ellipsoid, surfaceHeight, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84); surfaceHeight = defaultValue(surfaceHeight, 0.0); @@ -9998,9 +9512,9 @@ define('Core/Rectangle',[ define('Core/BoundingSphere',[ './Cartesian3', './Cartographic', + './Check', './defaultValue', './defined', - './DeveloperError', './Ellipsoid', './GeographicProjection', './Intersect', @@ -10011,9 +9525,9 @@ define('Core/BoundingSphere',[ ], function( Cartesian3, Cartographic, + Check, defaultValue, defined, - DeveloperError, Ellipsoid, GeographicProjection, Intersect, @@ -10343,9 +9857,7 @@ define('Core/BoundingSphere',[ stride = defaultValue(stride, 3); - if (stride < 3) { - throw new DeveloperError('stride must be 3 or greater.'); - } + Check.typeOf.number.greaterThanOrEquals('stride', stride, 3); var currentPos = fromPointsCurrentPos; currentPos.x = positions[0] + center.x; @@ -10649,9 +10161,8 @@ define('Core/BoundingSphere',[ * var sphere = Cesium.BoundingSphere.fromCornerPoints(new Cesium.Cartesian3(-0.5, -0.5, -0.5), new Cesium.Cartesian3(0.5, 0.5, 0.5)); */ BoundingSphere.fromCornerPoints = function(corner, oppositeCorner, result) { - if (!defined(corner) || !defined(oppositeCorner)) { - throw new DeveloperError('corner and oppositeCorner are required.'); - } + Check.typeOf.object('corner', corner); + Check.typeOf.object('oppositeCorner', oppositeCorner); if (!defined(result)) { result = new BoundingSphere(); @@ -10675,9 +10186,7 @@ define('Core/BoundingSphere',[ * var boundingSphere = Cesium.BoundingSphere.fromEllipsoid(ellipsoid); */ BoundingSphere.fromEllipsoid = function(ellipsoid, result) { - if (!defined(ellipsoid)) { - throw new DeveloperError('ellipsoid is required.'); - } + Check.typeOf.object('ellipsoid', ellipsoid); if (!defined(result)) { result = new BoundingSphere(); @@ -10803,13 +10312,8 @@ define('Core/BoundingSphere',[ * @returns {Number[]} The array that was packed into */ BoundingSphere.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -10831,9 +10335,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if one was not provided. */ BoundingSphere.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -10860,13 +10362,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.union = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); if (!defined(result)) { result = new BoundingSphere(); @@ -10915,13 +10412,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.expand = function(sphere, point, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(point)) { - throw new DeveloperError('point is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('point', point); result = BoundingSphere.clone(sphere, result); @@ -10944,13 +10436,8 @@ define('Core/BoundingSphere',[ * intersects the plane. */ BoundingSphere.intersectPlane = function(sphere, plane) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(plane)) { - throw new DeveloperError('plane is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('plane', plane); var center = sphere.center; var radius = sphere.radius; @@ -10976,13 +10463,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.transform = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -11010,12 +10492,8 @@ define('Core/BoundingSphere',[ * }); */ BoundingSphere.distanceSquaredTo = function(sphere, cartesian) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('cartesian', cartesian); var diff = Cartesian3.subtract(sphere.center, cartesian, distanceSquaredToScratch); return Cartesian3.magnitudeSquared(diff) - sphere.radius * sphere.radius; @@ -11037,13 +10515,8 @@ define('Core/BoundingSphere',[ * var newBoundingSphere = Cesium.BoundingSphere.transformWithoutScale(boundingSphere, modelMatrix); */ BoundingSphere.transformWithoutScale = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -11070,17 +10543,9 @@ define('Core/BoundingSphere',[ * @returns {Interval} The nearest and farthest distances on the bounding sphere from position in direction. */ BoundingSphere.computePlaneDistances = function(sphere, position, direction, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(position)) { - throw new DeveloperError('position is required.'); - } - - if (!defined(direction)) { - throw new DeveloperError('direction is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); if (!defined(result)) { result = new Interval(); @@ -11115,9 +10580,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.projectTo2D = function(sphere, projection, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } + Check.typeOf.object('sphere', sphere); projection = defaultValue(projection, projectTo2DProjection); @@ -11212,12 +10675,8 @@ define('Core/BoundingSphere',[ * @returns {Boolean} <code>true</code> if the sphere is not visible; otherwise <code>false</code>. */ BoundingSphere.isOccluded = function(sphere, occluder) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(occluder)) { - throw new DeveloperError('occluder is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('occluder', occluder); return !occluder.isBoundingSphereVisible(sphere); }; @@ -11318,12 +10777,14 @@ define('Core/BoundingSphere',[ /*global define*/ define('Core/Cartesian2',[ + './Check', './defaultValue', './defined', './DeveloperError', './freezeObject', './Math' ], function( + Check, defaultValue, defined, DeveloperError, @@ -11435,12 +10896,8 @@ define('Core/Cartesian2',[ * @returns {Number[]} The array that was packed into */ Cartesian2.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -11459,9 +10916,7 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided. */ Cartesian2.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -11481,9 +10936,7 @@ define('Core/Cartesian2',[ * @returns {Number[]} The packed array. */ Cartesian2.packArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -11506,9 +10959,7 @@ define('Core/Cartesian2',[ * @returns {Cartesian2[]} The unpacked array. */ Cartesian2.unpackArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -11551,9 +11002,7 @@ define('Core/Cartesian2',[ * @returns {Number} The value of the maximum component. */ Cartesian2.maximumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y); }; @@ -11565,9 +11014,7 @@ define('Core/Cartesian2',[ * @returns {Number} The value of the minimum component. */ Cartesian2.minimumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y); }; @@ -11581,15 +11028,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} A cartesian with the minimum components. */ Cartesian2.minimumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); @@ -11607,15 +11048,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} A cartesian with the maximum components. */ Cartesian2.maximumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -11629,9 +11064,7 @@ define('Core/Cartesian2',[ * @returns {Number} The squared magnitude. */ Cartesian2.magnitudeSquared = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y; }; @@ -11697,12 +11130,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.normalize = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian2.magnitude(cartesian); @@ -11724,12 +11153,8 @@ define('Core/Cartesian2',[ * @returns {Number} The dot product. */ Cartesian2.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y; }; @@ -11743,15 +11168,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.multiplyComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -11767,15 +11186,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.divideComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x / right.x; result.y = left.y / right.y; @@ -11791,15 +11204,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -11815,15 +11222,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -11839,15 +11240,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.multiplyByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -11863,15 +11258,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.divideByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -11886,12 +11275,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.negate = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -11906,12 +11291,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.abs = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -11929,18 +11310,10 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian2.multiplyByScalar(end, t, lerpScratch); result = Cartesian2.multiplyByScalar(start, 1.0 - t, result); @@ -11957,12 +11330,8 @@ define('Core/Cartesian2',[ * @returns {Number} The angle between the Cartesians. */ Cartesian2.angleBetween = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian2.normalize(left, angleBetweenScratch); Cartesian2.normalize(right, angleBetweenScratch2); @@ -11978,12 +11347,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The most orthogonal axis. */ Cartesian2.mostOrthogonalAxis = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian2.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian2.abs(f, f); @@ -13200,6 +12565,7 @@ define('Core/IntersectionTests',[ './defaultValue', './defined', './DeveloperError', + './Interval', './Math', './Matrix3', './QuadraticRealPolynomial', @@ -13211,6 +12577,7 @@ define('Core/IntersectionTests',[ defaultValue, defined, DeveloperError, + Interval, CesiumMath, Matrix3, QuadraticRealPolynomial, @@ -13482,7 +12849,7 @@ define('Core/IntersectionTests',[ function raySphere(ray, sphere, result) { if (!defined(result)) { - result = {}; + result = new Interval(); } var origin = ray.origin; @@ -13513,8 +12880,8 @@ define('Core/IntersectionTests',[ * * @param {Ray} ray The ray. * @param {BoundingSphere} sphere The sphere. - * @param {Object} [result] The result onto which to store the result. - * @returns {Object} An object with the first (<code>start</code>) and the second (<code>stop</code>) intersection scalars for points along the ray or undefined if there are no intersections. + * @param {Interval} [result] The result onto which to store the result. + * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections. */ IntersectionTests.raySphere = function(ray, sphere, result) { if (!defined(ray)) { @@ -13542,8 +12909,8 @@ define('Core/IntersectionTests',[ * @param {Cartesian3} p0 An end point of the line segment. * @param {Cartesian3} p1 The other end point of the line segment. * @param {BoundingSphere} sphere The sphere. - * @param {Object} [result] The result onto which to store the result. - * @returns {Object} An object with the first (<code>start</code>) and the second (<code>stop</code>) intersection scalars for points along the line segment or undefined if there are no intersections. + * @param {Interval} [result] The result onto which to store the result. + * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections. */ IntersectionTests.lineSegmentSphere = function(p0, p1, sphere, result) { if (!defined(p0)) { @@ -13581,7 +12948,7 @@ define('Core/IntersectionTests',[ * * @param {Ray} ray The ray. * @param {Ellipsoid} ellipsoid The ellipsoid. - * @returns {Object} An object with the first (<code>start</code>) and the second (<code>stop</code>) intersection scalars for points along the ray or undefined if there are no intersections. + * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections. */ IntersectionTests.rayEllipsoid = function(ray, ellipsoid) { if (!defined(ray)) { @@ -13623,10 +12990,7 @@ define('Core/IntersectionTests',[ var root0 = temp / w2; var root1 = difference / temp; if (root0 < root1) { - return { - start : root0, - stop : root1 - }; + return new Interval(root0, root1); } return { @@ -13636,10 +13000,7 @@ define('Core/IntersectionTests',[ } else { // qw2 == product. Repeated roots (2 intersections). var root = Math.sqrt(difference / w2); - return { - start : root, - stop : root - }; + return new Interval(root, root); } } else if (q2 < 1.0) { // Inside ellipsoid (2 intersections). @@ -13649,19 +13010,13 @@ define('Core/IntersectionTests',[ discriminant = qw * qw - product; temp = -qw + Math.sqrt(discriminant); // Positively valued. - return { - start : 0.0, - stop : temp / w2 - }; + return new Interval(0.0, temp / w2); } else { // q2 == 1.0. On ellipsoid. if (qw < 0.0) { // Looking inward. w2 = Cartesian3.magnitudeSquared(w); - return { - start : 0.0, - stop : -qw / w2 - }; + return new Interval(0.0, -qw / w2); } // qw >= 0.0. Looking outward or tangent. @@ -15014,118 +14369,6 @@ define('ThirdParty/when',[],function () { // Boilerplate for AMD, Node, and browser global ); -/*global define*/ -define('Core/oneTimeWarning',[ - './defaultValue', - './defined', - './DeveloperError' - ], function( - defaultValue, - defined, - DeveloperError) { - "use strict"; - - var warnings = {}; - - /** - * Logs a one time message to the console. Use this function instead of - * <code>console.log</code> directly since this does not log duplicate messages - * unless it is called from multiple workers. - * - * @exports oneTimeWarning - * - * @param {String} identifier The unique identifier for this warning. - * @param {String} [message=identifier] The message to log to the console. - * - * @example - * for(var i=0;i<foo.length;++i) { - * if (!defined(foo[i].bar)) { - * // Something that can be recovered from but may happen a lot - * oneTimeWarning('foo.bar undefined', 'foo.bar is undefined. Setting to 0.'); - * foo[i].bar = 0; - * // ... - * } - * } - * - * @private - */ - function oneTimeWarning(identifier, message) { - if (!defined(identifier)) { - throw new DeveloperError('identifier is required.'); - } - - if (!defined(warnings[identifier])) { - warnings[identifier] = true; - console.log(defaultValue(message, identifier)); - } - } - - oneTimeWarning.geometryOutlines = 'Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.'; - - return oneTimeWarning; -}); - -/*global define*/ -define('Core/deprecationWarning',[ - './defined', - './DeveloperError', - './oneTimeWarning' - ], function( - defined, - DeveloperError, - oneTimeWarning) { - 'use strict'; - - /** - * Logs a deprecation message to the console. Use this function instead of - * <code>console.log</code> directly since this does not log duplicate messages - * unless it is called from multiple workers. - * - * @exports deprecationWarning - * - * @param {String} identifier The unique identifier for this deprecated API. - * @param {String} message The message to log to the console. - * - * @example - * // Deprecated function or class - * function Foo() { - * deprecationWarning('Foo', 'Foo was deprecated in Cesium 1.01. It will be removed in 1.03. Use newFoo instead.'); - * // ... - * } - * - * // Deprecated function - * Bar.prototype.func = function() { - * deprecationWarning('Bar.func', 'Bar.func() was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newFunc() instead.'); - * // ... - * }; - * - * // Deprecated property - * defineProperties(Bar.prototype, { - * prop : { - * get : function() { - * deprecationWarning('Bar.prop', 'Bar.prop was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newProp instead.'); - * // ... - * }, - * set : function(value) { - * deprecationWarning('Bar.prop', 'Bar.prop was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newProp instead.'); - * // ... - * } - * } - * }); - * - * @private - */ - function deprecationWarning(identifier, message) { - if (!defined(identifier) || !defined(message)) { - throw new DeveloperError('identifier and message are required.'); - } - - oneTimeWarning(identifier, message); - } - - return deprecationWarning; -}); - /*global define*/ define('Core/binarySearch',[ './defined', @@ -19354,6 +18597,7 @@ define('Core/FeatureDetection',[ /*global define*/ define('Core/Quaternion',[ './Cartesian3', + './Check', './defaultValue', './defined', './DeveloperError', @@ -19363,6 +18607,7 @@ define('Core/Quaternion',[ './Matrix3' ], function( Cartesian3, + Check, defaultValue, defined, DeveloperError, @@ -19425,12 +18670,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided. */ Quaternion.fromAxisAngle = function(axis, angle, result) { - if (!defined(axis)) { - throw new DeveloperError('axis is required.'); - } - if (typeof angle !== 'number') { - throw new DeveloperError('angle is required and must be a number.'); - } + Check.typeOf.object('axis', axis); + Check.typeOf.number('angle', angle); var halfAngle = angle / 2.0; var s = Math.sin(halfAngle); @@ -19462,9 +18703,7 @@ define('Core/Quaternion',[ * @see Matrix3.fromQuaternion */ Quaternion.fromRotationMatrix = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); var root; var x; @@ -19538,15 +18777,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter or a new Quaternion instance if none was provided. */ Quaternion.fromHeadingPitchRoll = function(heading, pitch, roll, result) { - if (!defined(heading)) { - throw new DeveloperError('heading is required.'); - } - if (!defined(pitch)) { - throw new DeveloperError('pitch is required.'); - } - if (!defined(roll)) { - throw new DeveloperError('roll is required.'); - } + Check.typeOf.number('heading', heading); + Check.typeOf.number('pitch', pitch); + Check.typeOf.number('roll', roll); var rollQuaternion = Quaternion.fromAxisAngle(Cartesian3.UNIT_X, roll, scratchHPRQuaternion); var pitchQuaternion = Quaternion.fromAxisAngle(Cartesian3.UNIT_Y, -pitch, result); @@ -19577,13 +18810,8 @@ define('Core/Quaternion',[ * @returns {Number[]} The array that was packed into */ Quaternion.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -19604,9 +18832,7 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided. */ Quaternion.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -19661,7 +18887,7 @@ define('Core/Quaternion',[ * * @param {Number[]} array The array previously packed for interpolation. * @param {Number[]} sourceArray The original packed array. - * @param {Number} [startingIndex=0] The startingIndex used to convert the array. + * @param {Number} [firstIndex=0] The firstIndex used to convert the array. * @param {Number} [lastIndex=packedArray.length] The lastIndex used to convert the array. * @param {Quaternion} [result] The object into which to store the result. * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided. @@ -19715,12 +18941,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.conjugate = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); result.x = -quaternion.x; result.y = -quaternion.y; @@ -19736,9 +18958,7 @@ define('Core/Quaternion',[ * @returns {Number} The magnitude squared. */ Quaternion.magnitudeSquared = function(quaternion) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); return quaternion.x * quaternion.x + quaternion.y * quaternion.y + quaternion.z * quaternion.z + quaternion.w * quaternion.w; }; @@ -19761,9 +18981,7 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.normalize = function(quaternion, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); var inverseMagnitude = 1.0 / Quaternion.magnitude(quaternion); var x = quaternion.x * inverseMagnitude; @@ -19786,9 +19004,7 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.inverse = function(quaternion, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); var magnitudeSquared = Quaternion.magnitudeSquared(quaternion); result = Quaternion.conjugate(quaternion, result); @@ -19804,15 +19020,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -19830,15 +19040,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -19855,12 +19059,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.negate = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); result.x = -quaternion.x; result.y = -quaternion.y; @@ -19877,12 +19077,8 @@ define('Core/Quaternion',[ * @returns {Number} The dot product. */ Quaternion.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w; }; @@ -19896,15 +19092,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var leftX = left.x; var leftY = left.y; @@ -19937,15 +19127,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.multiplyByScalar = function(quaternion, scalar, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = quaternion.x * scalar; result.y = quaternion.y * scalar; @@ -19963,15 +19147,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.divideByScalar = function(quaternion, scalar, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = quaternion.x / scalar; result.y = quaternion.y / scalar; @@ -19988,12 +19166,8 @@ define('Core/Quaternion',[ * @returns {Cartesian3} The modified result parameter. */ Quaternion.computeAxis = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); var w = quaternion.w; if (Math.abs(w - 1.0) < CesiumMath.EPSILON6) { @@ -20016,9 +19190,7 @@ define('Core/Quaternion',[ * @returns {Number} The angle of rotation. */ Quaternion.computeAngle = function(quaternion) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); if (Math.abs(quaternion.w - 1.0) < CesiumMath.EPSILON6) { return 0.0; @@ -20037,18 +19209,10 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); lerpScratch = Quaternion.multiplyByScalar(end, t, lerpScratch); result = Quaternion.multiplyByScalar(start, 1.0 - t, result); @@ -20070,18 +19234,10 @@ define('Core/Quaternion',[ * @see Quaternion#fastSlerp */ Quaternion.slerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var dot = Quaternion.dot(start, end); @@ -20114,12 +19270,8 @@ define('Core/Quaternion',[ * @returns {Cartesian3} The modified result parameter. */ Quaternion.log = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); var theta = CesiumMath.acosClamped(quaternion.w); var thetaOverSinTheta = 0.0; @@ -20139,12 +19291,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.exp = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var theta = Cartesian3.magnitude(cartesian); var sinThetaOverTheta = 0.0; @@ -20179,12 +19327,10 @@ define('Core/Quaternion',[ * @see Quaternion#squad */ Quaternion.computeInnerQuadrangle = function(q0, q1, q2, result) { - if (!defined(q0) || !defined(q1) || !defined(q2)) { - throw new DeveloperError('q0, q1, and q2 are required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('q0', q0); + Check.typeOf.object('q1', q1); + Check.typeOf.object('q2', q2); + Check.typeOf.object('result', result); var qInv = Quaternion.conjugate(q1, squadScratchQuaternion0); Quaternion.multiply(qInv, q2, squadScratchQuaternion1); @@ -20226,15 +19372,12 @@ define('Core/Quaternion',[ * @see Quaternion#computeInnerQuadrangle */ Quaternion.squad = function(q0, q1, s0, s1, t, result) { - if (!defined(q0) || !defined(q1) || !defined(s0) || !defined(s1)) { - throw new DeveloperError('q0, q1, s0, and s1 are required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('q0', q0); + Check.typeOf.object('q1', q1); + Check.typeOf.object('s0', s0); + Check.typeOf.object('s1', s1); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var slerp0 = Quaternion.slerp(q0, q1, t, squadScratchQuaternion0); var slerp1 = Quaternion.slerp(s0, s1, t, squadScratchQuaternion1); @@ -20271,18 +19414,10 @@ define('Core/Quaternion',[ * @see Quaternion#slerp */ Quaternion.fastSlerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var x = Quaternion.dot(start, end); @@ -20331,15 +19466,12 @@ define('Core/Quaternion',[ * @see Quaternion#squad */ Quaternion.fastSquad = function(q0, q1, s0, s1, t, result) { - if (!defined(q0) || !defined(q1) || !defined(s0) || !defined(s1)) { - throw new DeveloperError('q0, q1, s0, and s1 are required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('q0', q0); + Check.typeOf.object('q1', q1); + Check.typeOf.object('s0', s0); + Check.typeOf.object('s1', s1); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var slerp0 = Quaternion.fastSlerp(q0, q1, t, squadScratchQuaternion0); var slerp1 = Quaternion.fastSlerp(s0, s1, t, squadScratchQuaternion1); @@ -20375,9 +19507,7 @@ define('Core/Quaternion',[ * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. */ Quaternion.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon is required and must be a number.'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || ((defined(left)) && @@ -20457,9 +19587,9 @@ define('Core/Transforms',[ './Cartesian3', './Cartesian4', './Cartographic', + './Check', './defaultValue', './defined', - './deprecationWarning', './DeveloperError', './EarthOrientationParameters', './EarthOrientationParametersSample', @@ -20479,9 +19609,9 @@ define('Core/Transforms',[ Cartesian3, Cartesian4, Cartographic, + Check, defaultValue, defined, - deprecationWarning, DeveloperError, EarthOrientationParameters, EarthOrientationParametersSample, @@ -20917,19 +20047,12 @@ define('Core/Transforms',[ * var hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll); * var transform = Cesium.Transforms.headingPitchRollToFixedFrame(center, hpr); */ - Transforms.headingPitchRollToFixedFrame = function(origin, headingPitchRoll, pitch, roll, ellipsoid, result) { - var heading; - if (typeof headingPitchRoll === 'object') { - // Shift arguments using assignments to encourage JIT optimization. - ellipsoid = pitch; - result = roll; - heading = headingPitchRoll.heading; - pitch = headingPitchRoll.pitch; - roll = headingPitchRoll.roll; - } else { - deprecationWarning('headingPitchRollToFixedFrame', 'headingPitchRollToFixedFrame with separate heading, pitch, and roll arguments was deprecated in 1.27. It will be removed in 1.30. Use a HeadingPitchRoll object.'); - heading = headingPitchRoll; - } + Transforms.headingPitchRollToFixedFrame = function(origin, headingPitchRoll, ellipsoid, result) { + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + var heading = headingPitchRoll.heading; + var pitch = headingPitchRoll.pitch; + var roll = headingPitchRoll.roll; + // checks for required parameters happen in the called functions var hprQuaternion = Quaternion.fromHeadingPitchRoll(heading, pitch, roll, scratchHPRQuaternion); var hprMatrix = Matrix4.fromTranslationQuaternionRotationScale(Cartesian3.ZERO, hprQuaternion, scratchScale, scratchHPRMatrix4); @@ -20937,7 +20060,6 @@ define('Core/Transforms',[ return Matrix4.multiply(result, hprMatrix, result); }; - var scratchHPR = new HeadingPitchRoll(); var scratchENUMatrix4 = new Matrix4(); var scratchHPRMatrix3 = new Matrix3(); @@ -20962,22 +20084,10 @@ define('Core/Transforms',[ * var hpr = new HeadingPitchRoll(heading, pitch, roll); * var quaternion = Cesium.Transforms.headingPitchRollQuaternion(center, hpr); */ - Transforms.headingPitchRollQuaternion = function(origin, headingPitchRoll, pitch, roll, ellipsoid, result) { - var hpr; - if (typeof headingPitchRoll === 'object') { - // Shift arguments using assignment to encourage JIT optimization. - hpr = headingPitchRoll; - ellipsoid = pitch; - result = roll; - } else { - deprecationWarning('headingPitchRollQuaternion', 'headingPitchRollQuaternion with separate heading, pitch, and roll arguments was deprecated in 1.27. It will be removed in 1.30. Use a HeadingPitchRoll object.'); - scratchHPR.heading = headingPitchRoll; - scratchHPR.pitch = pitch; - scratchHPR.roll = roll; - hpr = scratchHPR; - } + Transforms.headingPitchRollQuaternion = function(origin, headingPitchRoll, ellipsoid, result) { // checks for required parameters happen in the called functions - var transform = Transforms.headingPitchRollToFixedFrame(origin, hpr, ellipsoid, scratchENUMatrix4); + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + var transform = Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, scratchENUMatrix4); var rotation = Matrix4.getRotation(transform, scratchHPRMatrix3); return Quaternion.fromRotationMatrix(rotation, result); }; @@ -21453,6 +20563,46 @@ define('Core/Transforms',[ return result; }; + var swizzleMatrix = new Matrix4( + 0.0, 0.0, 1.0, 0.0, + 1.0, 0.0, 0.0, 0.0, + 0.0, 1.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + + /** + * @private + */ + Transforms.wgs84To2DModelMatrix = function(projection, center, result) { + if (!defined(projection)) { + throw new DeveloperError('projection is required.'); + } + if (!defined(center)) { + throw new DeveloperError('center is required.'); + } + if (!defined(result)) { + throw new DeveloperError('result is required.'); + } + + var ellipsoid = projection.ellipsoid; + + var fromENU = Transforms.eastNorthUpToFixedFrame(center, ellipsoid, scratchFromENU); + var toENU = Matrix4.inverseTransformation(fromENU, scratchToENU); + + var cartographic = ellipsoid.cartesianToCartographic(center, scratchCartographic); + var projectedPosition = projection.project(cartographic, scratchCartesian3Projection); + var newOrigin = scratchCartesian4NewOrigin; + newOrigin.x = projectedPosition.z; + newOrigin.y = projectedPosition.x; + newOrigin.z = projectedPosition.y; + newOrigin.w = 1.0; + + var translation = Matrix4.fromTranslation(newOrigin, scratchFromENU); + Matrix4.multiply(swizzleMatrix, toENU, result); + Matrix4.multiply(translation, result, result); + + return result; + }; + return Transforms; }); @@ -21991,6 +21141,7 @@ define('Core/OrientedBoundingBox',[ /** * Computes an OrientedBoundingBox given extents in the east-north-up space of the tangent plane. * + * @param {Plane} tangentPlane The tangent place corresponding to east-north-up. * @param {Number} minimumX Minimum X extent in tangent plane space. * @param {Number} maximumX Maximum X extent in tangent plane space. * @param {Number} minimumY Minimum Y extent in tangent plane space. @@ -23408,7 +22559,10 @@ define('Core/WebGLConstants',[ COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : 0x9279, TEXTURE_IMMUTABLE_FORMAT : 0x912F, MAX_ELEMENT_INDEX : 0x8D6B, - TEXTURE_IMMUTABLE_LEVELS : 0x82DF + TEXTURE_IMMUTABLE_LEVELS : 0x82DF, + + // Extensions + MAX_TEXTURE_MAX_ANISOTROPY_EXT : 0x84FF }; return freezeObject(WebGLConstants); diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createVerticesFromQuantizedTerrainMesh.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createVerticesFromQuantizedTerrainMesh.js index 333ff2a3..42649bca 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createVerticesFromQuantizedTerrainMesh.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createVerticesFromQuantizedTerrainMesh.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,68 +45,6 @@ define('Core/defined',[],function() { return defined; }); -/*global define*/ -define('Core/freezeObject',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Freezes an object, using Object.freeze if available, otherwise returns - * the object unchanged. This function should be used in setup code to prevent - * errors from completely halting JavaScript execution in legacy browsers. - * - * @private - * - * @exports freezeObject - */ - var freezeObject = Object.freeze; - if (!defined(freezeObject)) { - freezeObject = function(o) { - return o; - }; - } - - return freezeObject; -}); - -/*global define*/ -define('Core/defaultValue',[ - './freezeObject' - ], function( - freezeObject) { - 'use strict'; - - /** - * Returns the first parameter if not undefined, otherwise the second parameter. - * Useful for setting a default value for a parameter. - * - * @exports defaultValue - * - * @param {*} a - * @param {*} b - * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter. - * - * @example - * param = Cesium.defaultValue(param, 'default'); - */ - function defaultValue(a, b) { - if (a !== undefined) { - return a; - } - return b; - } - - /** - * A frozen empty object that can be used as the default value for options passed as - * an object literal. - */ - defaultValue.EMPTY_OBJECT = freezeObject({}); - - return defaultValue; -}); - /*global define*/ define('Core/DeveloperError',[ './defined' @@ -188,6 +126,238 @@ define('Core/DeveloperError',[ return DeveloperError; }); +/*global define*/ +define('Core/Check',[ + './defined', + './DeveloperError' + ], function( + defined, + DeveloperError) { + 'use strict'; + + /** + * Contains functions for checking that supplied arguments are of a specified type + * or meet specified conditions + * @private + */ + var Check = {}; + + /** + * Contains type checking functions, all using the typeof operator + */ + Check.typeOf = {}; + + function getUndefinedErrorMessage(name) { + return name + ' is required, actual value was undefined'; + } + + function getFailedTypeErrorMessage(actual, expected, name) { + return 'Expected ' + name + ' to be typeof ' + expected + ', actual typeof was ' + actual; + } + + /** + * Throws if test is not defined + * + * @param {String} name The name of the variable being tested + * @param {*} test The value that is to be checked + * @exception {DeveloperError} test must be defined + */ + Check.defined = function (name, test) { + if (!defined(test)) { + throw new DeveloperError(getUndefinedErrorMessage(name)); + } + }; + + /** + * Throws if test is not typeof 'function' + * + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'function' + */ + Check.typeOf.func = function (name, test) { + if (typeof test !== 'function') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); + } + }; + + /** + * Throws if test is not typeof 'string' + * + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'string' + */ + Check.typeOf.string = function (name, test) { + if (typeof test !== 'string') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); + } + }; + + /** + * Throws if test is not typeof 'number' + * + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'number' + */ + Check.typeOf.number = function (name, test) { + if (typeof test !== 'number') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); + } + }; + + /** + * Throws if test is not typeof 'number' and less than limit + * + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than limit + */ + Check.typeOf.number.lessThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test >= limit) { + throw new DeveloperError('Expected ' + name + ' to be less than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and less than or equal to limit + * + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than or equal to limit + */ + Check.typeOf.number.lessThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test > limit) { + throw new DeveloperError('Expected ' + name + ' to be less than or equal to ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and greater than limit + * + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than limit + */ + Check.typeOf.number.greaterThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test <= limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and greater than or equal to limit + * + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than or equal to limit + */ + Check.typeOf.number.greaterThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test < limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than or equal to' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'object' + * + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'object' + */ + Check.typeOf.object = function (name, test) { + if (typeof test !== 'object') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'object', name)); + } + }; + + /** + * Throws if test is not typeof 'boolean' + * + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'boolean' + */ + Check.typeOf.bool = function (name, test) { + if (typeof test !== 'boolean') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'boolean', name)); + } + }; + + return Check; +}); + +/*global define*/ +define('Core/freezeObject',[ + './defined' + ], function( + defined) { + 'use strict'; + + /** + * Freezes an object, using Object.freeze if available, otherwise returns + * the object unchanged. This function should be used in setup code to prevent + * errors from completely halting JavaScript execution in legacy browsers. + * + * @private + * + * @exports freezeObject + */ + var freezeObject = Object.freeze; + if (!defined(freezeObject)) { + freezeObject = function(o) { + return o; + }; + } + + return freezeObject; +}); + +/*global define*/ +define('Core/defaultValue',[ + './freezeObject' + ], function( + freezeObject) { + 'use strict'; + + /** + * Returns the first parameter if not undefined, otherwise the second parameter. + * Useful for setting a default value for a parameter. + * + * @exports defaultValue + * + * @param {*} a + * @param {*} b + * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter. + * + * @example + * param = Cesium.defaultValue(param, 'default'); + */ + function defaultValue(a, b) { + if (a !== undefined) { + return a; + } + return b; + } + + /** + * A frozen empty object that can be used as the default value for options passed as + * an object literal. + */ + defaultValue.EMPTY_OBJECT = freezeObject({}); + + return defaultValue; +}); + /* I've wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace so it's better encapsulated. Now you can have multiple random number generators @@ -872,7 +1042,7 @@ define('Core/Math',[ if (!defined(angle)) { throw new DeveloperError('angle is required.'); } - + return CesiumMath.clamp(angle, -1*CesiumMath.PI_OVER_TWO, CesiumMath.PI_OVER_TWO); }; @@ -882,11 +1052,11 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [<code>-CesiumMath.PI</code>, <code>CesiumMath.PI</code>]. */ - CesiumMath.negativePiToPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.negativePiToPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - return CesiumMath.zeroToTwoPi(x + CesiumMath.PI) - CesiumMath.PI; + return CesiumMath.zeroToTwoPi(angle + CesiumMath.PI) - CesiumMath.PI; }; /** @@ -895,12 +1065,12 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [0, <code>CesiumMath.TWO_PI</code>]. */ - CesiumMath.zeroToTwoPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.zeroToTwoPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - var mod = CesiumMath.mod(x, CesiumMath.TWO_PI); - if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(x) > CesiumMath.EPSILON14) { + var mod = CesiumMath.mod(angle, CesiumMath.TWO_PI); + if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(angle) > CesiumMath.EPSILON14) { return CesiumMath.TWO_PI; } return mod; @@ -970,7 +1140,7 @@ define('Core/Math',[ * @example * //Compute 7!, which is equal to 5040 * var computedFactorial = Cesium.Math.factorial(7); - * + * * @see {@link http://en.wikipedia.org/wiki/Factorial|Factorial on Wikipedia} */ CesiumMath.factorial = function(n) { @@ -1195,12 +1365,14 @@ define('Core/Math',[ /*global define*/ define('Core/Cartesian2',[ + './Check', './defaultValue', './defined', './DeveloperError', './freezeObject', './Math' ], function( + Check, defaultValue, defined, DeveloperError, @@ -1307,17 +1479,13 @@ define('Core/Cartesian2',[ * * @param {Cartesian2} value The value to pack. * @param {Number[]} array The array to pack into. - * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements. - * - * @returns {Number[]} The array that was packed into - */ - Cartesian2.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements. + * + * @returns {Number[]} The array that was packed into + */ + Cartesian2.pack = function(value, array, startingIndex) { + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1336,9 +1504,7 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided. */ Cartesian2.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1358,9 +1524,7 @@ define('Core/Cartesian2',[ * @returns {Number[]} The packed array. */ Cartesian2.packArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -1383,9 +1547,7 @@ define('Core/Cartesian2',[ * @returns {Cartesian2[]} The unpacked array. */ Cartesian2.unpackArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -1428,9 +1590,7 @@ define('Core/Cartesian2',[ * @returns {Number} The value of the maximum component. */ Cartesian2.maximumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y); }; @@ -1442,9 +1602,7 @@ define('Core/Cartesian2',[ * @returns {Number} The value of the minimum component. */ Cartesian2.minimumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y); }; @@ -1458,15 +1616,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} A cartesian with the minimum components. */ Cartesian2.minimumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); @@ -1484,15 +1636,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} A cartesian with the maximum components. */ Cartesian2.maximumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -1506,9 +1652,7 @@ define('Core/Cartesian2',[ * @returns {Number} The squared magnitude. */ Cartesian2.magnitudeSquared = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y; }; @@ -1574,12 +1718,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.normalize = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian2.magnitude(cartesian); @@ -1601,12 +1741,8 @@ define('Core/Cartesian2',[ * @returns {Number} The dot product. */ Cartesian2.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y; }; @@ -1620,15 +1756,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.multiplyComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -1644,15 +1774,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.divideComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x / right.x; result.y = left.y / right.y; @@ -1668,15 +1792,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -1692,15 +1810,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -1716,15 +1828,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.multiplyByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -1740,15 +1846,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.divideByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -1763,12 +1863,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.negate = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -1783,12 +1879,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.abs = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -1806,18 +1898,10 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian2.multiplyByScalar(end, t, lerpScratch); result = Cartesian2.multiplyByScalar(start, 1.0 - t, result); @@ -1834,12 +1918,8 @@ define('Core/Cartesian2',[ * @returns {Number} The angle between the Cartesians. */ Cartesian2.angleBetween = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian2.normalize(left, angleBetweenScratch); Cartesian2.normalize(right, angleBetweenScratch2); @@ -1855,12 +1935,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The most orthogonal axis. */ Cartesian2.mostOrthogonalAxis = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian2.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian2.abs(f, f); @@ -1934,233 +2010,58 @@ define('Core/Cartesian2',[ Cartesian2.UNIT_X = freezeObject(new Cartesian2(1.0, 0.0)); /** - * An immutable Cartesian2 instance initialized to (0.0, 1.0). - * - * @type {Cartesian2} - * @constant - */ - Cartesian2.UNIT_Y = freezeObject(new Cartesian2(0.0, 1.0)); - - /** - * Duplicates this Cartesian2 instance. - * - * @param {Cartesian2} [result] The object onto which to store the result. - * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided. - */ - Cartesian2.prototype.clone = function(result) { - return Cartesian2.clone(this, result); - }; - - /** - * Compares this Cartesian against the provided Cartesian componentwise and returns - * <code>true</code> if they are equal, <code>false</code> otherwise. - * - * @param {Cartesian2} [right] The right hand side Cartesian. - * @returns {Boolean} <code>true</code> if they are equal, <code>false</code> otherwise. - */ - Cartesian2.prototype.equals = function(right) { - return Cartesian2.equals(this, right); - }; - - /** - * Compares this Cartesian against the provided Cartesian componentwise and returns - * <code>true</code> if they pass an absolute or relative tolerance test, - * <code>false</code> otherwise. - * - * @param {Cartesian2} [right] The right hand side Cartesian. - * @param {Number} relativeEpsilon The relative epsilon tolerance to use for equality testing. - * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing. - * @returns {Boolean} <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise. - */ - Cartesian2.prototype.equalsEpsilon = function(right, relativeEpsilon, absoluteEpsilon) { - return Cartesian2.equalsEpsilon(this, right, relativeEpsilon, absoluteEpsilon); - }; - - /** - * Creates a string representing this Cartesian in the format '(x, y)'. - * - * @returns {String} A string representing the provided Cartesian in the format '(x, y)'. - */ - Cartesian2.prototype.toString = function() { - return '(' + this.x + ', ' + this.y + ')'; - }; - - return Cartesian2; -}); - -/*global define*/ -define('Core/isArray',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Tests an object to see if it is an array. - * @exports isArray - * - * @param {Object} value The value to test. - * @returns {Boolean} true if the value is an array, false otherwise. - */ - var isArray = Array.isArray; - if (!defined(isArray)) { - isArray = function(value) { - return Object.prototype.toString.call(value) === '[object Array]'; - }; - } - - return isArray; -}); - -/*global define*/ -define('Core/Check',[ - './defaultValue', - './defined', - './DeveloperError', - './isArray' - ], function( - defaultValue, - defined, - DeveloperError, - isArray) { - 'use strict'; - - /** - * Contains functions for checking that supplied arguments are of a specified type - * or meet specified conditions - * @private - */ - var Check = {}; - - /** - * Contains type checking functions, all using the typeof operator - */ - Check.typeOf = {}; - - /** - * Contains functions for checking numeric conditions such as minimum and maximum values - */ - Check.numeric = {}; - - function getUndefinedErrorMessage(name) { - return name + ' was required but undefined.'; - } - - function getFailedTypeErrorMessage(actual, expected, name) { - return 'Expected ' + name + ' to be typeof ' + expected + ', got ' + actual; - } - - /** - * Throws if test is not defined - * - * @param {*} test The value that is to be checked - * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be defined - */ - Check.defined = function (test, name) { - if (!defined(test)) { - throw new DeveloperError(getUndefinedErrorMessage(name)); - } - }; - - /** - * Throws if test is greater than maximum - * - * @param {Number} test The value to test - * @param {Number} maximum The maximum allowed value - * @exception {DeveloperError} test must not be greater than maximum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' - */ - Check.numeric.maximum = function (test, maximum) { - Check.typeOf.number(test); - Check.typeOf.number(maximum); - if (test > maximum) { - throw new DeveloperError('Expected ' + test + ' to be at most ' + maximum); - } - }; - - /** - * Throws if test is less than minimum - * - * @param {Number} test The value to test - * @param {Number} minimum The minimum allowed value - * @exception {DeveloperError} test must not be less than mininum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' - */ - Check.numeric.minimum = function (test, minimum) { - Check.typeOf.number(test); - Check.typeOf.number(minimum); - if (test < minimum) { - throw new DeveloperError('Expected ' + test + ' to be at least ' + minimum); - } - }; - - /** - * Throws if test is not typeof 'function' + * An immutable Cartesian2 instance initialized to (0.0, 1.0). * - * @param {*} test The value to test - * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'function' + * @type {Cartesian2} + * @constant */ - Check.typeOf.function = function (test, name) { - if (typeof test !== 'function') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); - } - }; + Cartesian2.UNIT_Y = freezeObject(new Cartesian2(0.0, 1.0)); /** - * Throws if test is not typeof 'string' + * Duplicates this Cartesian2 instance. * - * @param {*} test The value to test - * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'string' + * @param {Cartesian2} [result] The object onto which to store the result. + * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided. */ - Check.typeOf.string = function (test, name) { - if (typeof test !== 'string') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); - } + Cartesian2.prototype.clone = function(result) { + return Cartesian2.clone(this, result); }; /** - * Throws if test is not typeof 'number' + * Compares this Cartesian against the provided Cartesian componentwise and returns + * <code>true</code> if they are equal, <code>false</code> otherwise. * - * @param {*} test The value to test - * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'number' + * @param {Cartesian2} [right] The right hand side Cartesian. + * @returns {Boolean} <code>true</code> if they are equal, <code>false</code> otherwise. */ - Check.typeOf.number = function (test, name) { - if (typeof test !== 'number') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); - } + Cartesian2.prototype.equals = function(right) { + return Cartesian2.equals(this, right); }; /** - * Throws if test is not typeof 'object' + * Compares this Cartesian against the provided Cartesian componentwise and returns + * <code>true</code> if they pass an absolute or relative tolerance test, + * <code>false</code> otherwise. * - * @param {*} test The value to test - * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'object' + * @param {Cartesian2} [right] The right hand side Cartesian. + * @param {Number} relativeEpsilon The relative epsilon tolerance to use for equality testing. + * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing. + * @returns {Boolean} <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise. */ - Check.typeOf.object = function (test, name) { - if (typeof test !== 'object') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'object', name)); - } + Cartesian2.prototype.equalsEpsilon = function(right, relativeEpsilon, absoluteEpsilon) { + return Cartesian2.equalsEpsilon(this, right, relativeEpsilon, absoluteEpsilon); }; /** - * Throws if test is not typeof 'boolean' + * Creates a string representing this Cartesian in the format '(x, y)'. * - * @param {*} test The value to test - * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'boolean' + * @returns {String} A string representing the provided Cartesian in the format '(x, y)'. */ - Check.typeOf.boolean = function (test, name) { - if (typeof test !== 'boolean') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'boolean', name)); - } + Cartesian2.prototype.toString = function() { + return '(' + this.x + ', ' + this.y + ')'; }; - return Check; + return Cartesian2; }); /*global define*/ @@ -2224,7 +2125,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.fromSpherical = function(spherical, result) { - Check.typeOf.object(spherical, 'spherical'); + Check.typeOf.object('spherical', spherical); if (!defined(result)) { result = new Cartesian3(); @@ -2308,8 +2209,8 @@ define('Core/Cartesian3',[ * @returns {Number[]} The array that was packed into */ Cartesian3.pack = function(value, array, startingIndex) { - Check.typeOf.object(value, 'value'); - Check.defined(array, 'array'); + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -2329,7 +2230,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.unpack = function(array, startingIndex, result) { - Check.defined(array, 'array'); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -2350,7 +2251,7 @@ define('Core/Cartesian3',[ * @returns {Number[]} The packed array. */ Cartesian3.packArray = function(array, result) { - Check.defined(array, 'array'); + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -2373,8 +2274,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3[]} The unpacked array. */ Cartesian3.unpackArray = function(array, result) { - Check.defined(array, 'array'); - Check.numeric.minimum(array.length, 3); + Check.defined('array', array); + Check.typeOf.number.greaterThanOrEquals('array.length', array.length, 3); if (array.length % 3 !== 0) { throw new DeveloperError('array length must be a multiple of 3.'); } @@ -2420,7 +2321,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the maximum component. */ Cartesian3.maximumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z); }; @@ -2432,7 +2333,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the minimum component. */ Cartesian3.minimumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z); }; @@ -2446,9 +2347,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the minimum components. */ Cartesian3.minimumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -2466,9 +2367,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the maximum components. */ Cartesian3.maximumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -2483,7 +2384,7 @@ define('Core/Cartesian3',[ * @returns {Number} The squared magnitude. */ Cartesian3.magnitudeSquared = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z; }; @@ -2512,8 +2413,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distance(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(2.0, 0.0, 0.0)); */ Cartesian3.distance = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitude(distanceScratch); @@ -2532,8 +2433,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distanceSquared(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(3.0, 0.0, 0.0)); */ Cartesian3.distanceSquared = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitudeSquared(distanceScratch); @@ -2547,8 +2448,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.normalize = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian3.magnitude(cartesian); @@ -2571,8 +2472,8 @@ define('Core/Cartesian3',[ * @returns {Number} The dot product. */ Cartesian3.dot = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z; }; @@ -2586,9 +2487,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyComponents = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -2630,9 +2531,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.add = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -2649,9 +2550,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.subtract = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -2668,9 +2569,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -2687,9 +2588,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.divideByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -2705,8 +2606,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.negate = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -2722,8 +2623,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.abs = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -2742,10 +2643,10 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.lerp = function(start, end, t, result) { - Check.typeOf.object(start, 'start'); - Check.typeOf.object(end, 'end'); - Check.typeOf.number(t, 't'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian3.multiplyByScalar(end, t, lerpScratch); result = Cartesian3.multiplyByScalar(start, 1.0 - t, result); @@ -2762,8 +2663,8 @@ define('Core/Cartesian3',[ * @returns {Number} The angle between the Cartesians. */ Cartesian3.angleBetween = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.normalize(left, angleBetweenScratch); Cartesian3.normalize(right, angleBetweenScratch2); @@ -2781,8 +2682,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The most orthogonal axis. */ Cartesian3.mostOrthogonalAxis = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian3.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian3.abs(f, f); @@ -2859,9 +2760,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The cross product. */ Cartesian3.cross = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var leftX = left.x; var leftY = left.y; @@ -2894,8 +2795,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromDegrees(-115.0, 37.0); */ Cartesian3.fromDegrees = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); longitude = CesiumMath.toRadians(longitude); latitude = CesiumMath.toRadians(latitude); @@ -2920,8 +2821,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromRadians(-2.007, 0.645); */ Cartesian3.fromRadians = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); height = defaultValue(height, 0.0); var radiiSquared = defined(ellipsoid) ? ellipsoid.radiiSquared : wgs84RadiiSquared; @@ -2955,7 +2856,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArray([-115.0, 37.0, -107.0, 33.0]); */ Cartesian3.fromDegreesArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -2989,7 +2890,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArray([-2.007, 0.645, -1.867, .575]); */ Cartesian3.fromRadiansArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -3023,7 +2924,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArrayHeights([-115.0, 37.0, 100000.0, -107.0, 33.0, 150000.0]); */ Cartesian3.fromDegreesArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -3058,7 +2959,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArrayHeights([-2.007, 0.645, 100000.0, -1.867, .575, 150000.0]); */ Cartesian3.fromRadiansArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -4379,7 +4280,9 @@ define('Core/Ellipsoid',[ /** * Computes an Ellipsoid from a Cartesian specifying the radii in x, y, and z directions. * - * @param {Cartesian3} [radii=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Cartesian3} [cartesian=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new + * instance should be created. * @returns {Ellipsoid} A new Ellipsoid instance. * * @exception {DeveloperError} All radii components must be greater than or equal to zero. @@ -4975,6 +4878,7 @@ define('Core/Interval',[ /*global define*/ define('Core/Matrix3',[ './Cartesian3', + './Check', './defaultValue', './defined', './defineProperties', @@ -4983,6 +4887,7 @@ define('Core/Matrix3',[ './Math' ], function( Cartesian3, + Check, defaultValue, defined, defineProperties, @@ -5045,13 +4950,8 @@ define('Core/Matrix3',[ * @returns {Number[]} The array that was packed into */ Matrix3.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5077,9 +4977,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. */ Matrix3.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5106,24 +5004,24 @@ define('Core/Matrix3',[ * @param {Matrix3} [result] The object onto which to store the result. * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. (Returns undefined if matrix is undefined) */ - Matrix3.clone = function(values, result) { - if (!defined(values)) { + Matrix3.clone = function(matrix, result) { + if (!defined(matrix)) { return undefined; } if (!defined(result)) { - return new Matrix3(values[0], values[3], values[6], - values[1], values[4], values[7], - values[2], values[5], values[8]); + return new Matrix3(matrix[0], matrix[3], matrix[6], + matrix[1], matrix[4], matrix[7], + matrix[2], matrix[5], matrix[8]); } - result[0] = values[0]; - result[1] = values[1]; - result[2] = values[2]; - result[3] = values[3]; - result[4] = values[4]; - result[5] = values[5]; - result[6] = values[6]; - result[7] = values[7]; - result[8] = values[8]; + result[0] = matrix[0]; + result[1] = matrix[1]; + result[2] = matrix[2]; + result[3] = matrix[3]; + result[4] = matrix[4]; + result[5] = matrix[5]; + result[6] = matrix[6]; + result[7] = matrix[7]; + result[8] = matrix[8]; return result; }; @@ -5149,9 +5047,7 @@ define('Core/Matrix3',[ * var m2 = Cesium.Matrix3.fromArray(v2, 2); */ Matrix3.fromArray = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5179,9 +5075,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values parameter is required'); - } + Check.defined('values', values); return Matrix3.clone(values, result); }; @@ -5195,9 +5089,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix3(values[0], values[1], values[2], @@ -5224,9 +5116,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this quaternion. */ Matrix3.fromQuaternion = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); var x2 = quaternion.x * quaternion.x; var xy = quaternion.x * quaternion.y; @@ -5276,10 +5166,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this headingPitchRoll. */ Matrix3.fromHeadingPitchRoll = function(headingPitchRoll, result) { - if (!defined(headingPitchRoll)) { - throw new DeveloperError('headingPitchRoll is required'); - } - var cosTheta = Math.cos(-headingPitchRoll.pitch); + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + + var cosTheta = Math.cos(-headingPitchRoll.pitch); var cosPsi = Math.cos(-headingPitchRoll.heading); var cosPhi = Math.cos(headingPitchRoll.roll); var sinTheta = Math.sin(-headingPitchRoll.pitch); @@ -5330,9 +5219,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix3( @@ -5368,9 +5255,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromUniformScale(2.0); */ Matrix3.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix3( @@ -5394,7 +5279,7 @@ define('Core/Matrix3',[ /** * Computes a Matrix3 instance representing the cross product equivalent matrix of a Cartesian3 vector. * - * @param {Cartesian3} the vector on the left hand side of the cross product operation. + * @param {Cartesian3} vector the vector on the left hand side of the cross product operation. * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created. * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. * @@ -5406,9 +5291,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromCrossProduct(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromCrossProduct = function(vector, result) { - if (!defined(vector)) { - throw new DeveloperError('vector is required.'); - } + Check.typeOf.object('vector', vector); if (!defined(result)) { return new Matrix3( @@ -5443,9 +5326,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationX = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -5484,9 +5365,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationY = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -5525,9 +5404,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationZ = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -5561,9 +5438,7 @@ define('Core/Matrix3',[ * @returns {Number[]} The modified Array parameter or a new Array instance if one was not provided. */ Matrix3.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5], matrix[6], matrix[7], matrix[8]]; @@ -5597,12 +5472,10 @@ define('Core/Matrix3',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix3.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 2) { - throw new DeveloperError('row must be 0, 1, or 2.'); - } - if (typeof column !== 'number' || column < 0 || column > 2) { - throw new DeveloperError('column must be 0, 1, or 2.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 2); + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 2); return column * 3 + row; }; @@ -5618,16 +5491,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var startIndex = index * 3; var x = matrix[startIndex]; @@ -5652,18 +5519,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); var startIndex = index * 3; @@ -5684,15 +5544,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 3]; @@ -5716,18 +5571,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); result[index] = cartesian.x; @@ -5746,12 +5594,8 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[3], matrix[4], matrix[5], scratchColumn)); @@ -5782,15 +5626,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var column0Row0 = left[0] * right[0] + left[3] * right[1] + left[6] * right[2]; var column0Row1 = left[1] * right[0] + left[4] * right[1] + left[7] * right[2]; @@ -5825,15 +5663,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -5856,15 +5688,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -5887,15 +5713,9 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -5920,15 +5740,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -5959,15 +5773,9 @@ define('Core/Matrix3',[ * @see Matrix3.multiplyByUniformScale */ Matrix3.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); result[0] = matrix[0] * scale.x; result[1] = matrix[1] * scale.x; @@ -5989,12 +5797,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -6016,12 +5820,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var column0Row0 = matrix[0]; var column0Row1 = matrix[3]; @@ -6161,9 +5961,7 @@ define('Core/Matrix3',[ * var c = Cesium.Cartesian3.multiplyByScalar(v, lambda, new Cesium.Cartesian3()); // equal to Cesium.Matrix3.multiplyByVector(a, v) */ Matrix3.computeEigenDecomposition = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); // This routine was created based upon Matrix Computations, 3rd ed., by Golub and Van Loan, // section 8.4.3 The Classical Jacobi Algorithm @@ -6207,12 +6005,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -6234,9 +6028,7 @@ define('Core/Matrix3',[ * @returns {Number} The value of the determinant of the matrix. */ Matrix3.determinant = function(matrix) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); var m11 = matrix[0]; var m21 = matrix[3]; @@ -6261,12 +6053,8 @@ define('Core/Matrix3',[ * @exception {DeveloperError} matrix is not invertible. */ Matrix3.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var m11 = matrix[0]; var m21 = matrix[1]; @@ -6332,9 +6120,7 @@ define('Core/Matrix3',[ * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. */ Matrix3.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -6522,12 +6308,14 @@ define('Core/Matrix3',[ /*global define*/ define('Core/Cartesian4',[ + './Check', './defaultValue', './defined', './DeveloperError', './freezeObject', './Math' ], function( + Check, defaultValue, defined, DeveloperError, @@ -6610,9 +6398,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.fromColor = function(color, result) { - if (!defined(color)) { - throw new DeveloperError('color is required'); - } + Check.typeOf.object('color', color); if (!defined(result)) { return new Cartesian4(color.red, color.green, color.blue, color.alpha); } @@ -6664,12 +6450,8 @@ define('Core/Cartesian4',[ * @returns {Number[]} The array that was packed into */ Cartesian4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -6690,9 +6472,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -6714,9 +6494,7 @@ define('Core/Cartesian4',[ * @returns {Number[]} The packed array. */ Cartesian4.packArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -6739,9 +6517,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4[]} The unpacked array. */ Cartesian4.unpackArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -6784,9 +6560,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the maximum component. */ Cartesian4.maximumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -6798,9 +6572,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the minimum component. */ Cartesian4.minimumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -6814,15 +6586,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the minimum components. */ Cartesian4.minimumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -6840,16 +6606,10 @@ define('Core/Cartesian4',[ * @param {Cartesian4} result The object into which to store the result. * @returns {Cartesian4} A cartesian with the maximum components. */ - Cartesian4.maximumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Cartesian4.maximumByComponent = function(first, second, result) { + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -6866,9 +6626,7 @@ define('Core/Cartesian4',[ * @returns {Number} The squared magnitude. */ Cartesian4.magnitudeSquared = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z + cartesian.w * cartesian.w; }; @@ -6899,9 +6657,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(2.0, 0.0, 0.0, 0.0)); */ Cartesian4.distance = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitude(distanceScratch); @@ -6922,9 +6679,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(3.0, 0.0, 0.0, 0.0)); */ Cartesian4.distanceSquared = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitudeSquared(distanceScratch); @@ -6938,12 +6694,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.normalize = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian4.magnitude(cartesian); @@ -6967,12 +6719,8 @@ define('Core/Cartesian4',[ * @returns {Number} The dot product. */ Cartesian4.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w; }; @@ -6986,15 +6734,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -7012,15 +6754,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x / right.x; result.y = left.y / right.y; @@ -7038,15 +6774,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -7064,15 +6794,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -7090,15 +6814,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -7116,15 +6834,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -7141,12 +6853,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.negate = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -7163,12 +6871,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.abs = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -7188,18 +6892,10 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian4.multiplyByScalar(end, t, lerpScratch); result = Cartesian4.multiplyByScalar(start, 1.0 - t, result); @@ -7215,12 +6911,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The most orthogonal axis. */ Cartesian4.mostOrthogonalAxis = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian4.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian4.abs(f, f); @@ -7465,6 +7157,7 @@ define('Core/RuntimeError',[ define('Core/Matrix4',[ './Cartesian3', './Cartesian4', + './Check', './defaultValue', './defined', './defineProperties', @@ -7476,6 +7169,7 @@ define('Core/Matrix4',[ ], function( Cartesian3, Cartesian4, + Check, defaultValue, defined, defineProperties, @@ -7566,13 +7260,8 @@ define('Core/Matrix4',[ * @returns {Number[]} The array that was packed into */ Matrix4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -7605,9 +7294,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if one was not provided. */ Matrix4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -7703,9 +7390,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required'); - } + Check.defined('values', values); return Matrix4.clone(values, result); }; @@ -7719,9 +7404,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix4(values[0], values[1], values[2], values[3], @@ -7758,9 +7441,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRotationTranslation = function(rotation, translation, result) { - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } + Check.typeOf.object('rotation', rotation); translation = defaultValue(translation, Cartesian3.ZERO); @@ -7808,15 +7489,9 @@ define('Core/Matrix4',[ * result); */ Matrix4.fromTranslationQuaternionRotationScale = function(translation, rotation, scale, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('translation', translation); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('scale', scale); if (!defined(result)) { result = new Matrix4(); @@ -7877,9 +7552,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromTranslationRotationScale = function(translationRotationScale, result) { - if (!defined(translationRotationScale)) { - throw new DeveloperError('translationRotationScale is required.'); - } + Check.typeOf.object('translationRotationScale', translationRotationScale); return Matrix4.fromTranslationQuaternionRotationScale(translationRotationScale.translation, translationRotationScale.rotation, translationRotationScale.scale, result); }; @@ -7894,9 +7567,7 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByTranslation */ Matrix4.fromTranslation = function(translation, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } + Check.typeOf.object('translation', translation); return Matrix4.fromRotationTranslation(Matrix3.IDENTITY, translation, result); }; @@ -7917,9 +7588,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix4.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix4( @@ -7964,9 +7633,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromUniformScale(2.0); */ Matrix4.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix4(scale, 0.0, 0.0, 0.0, @@ -8006,23 +7673,15 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromCamera = function(camera, result) { - if (!defined(camera)) { - throw new DeveloperError('camera is required.'); - } + Check.typeOf.object('camera', camera); var position = camera.position; var direction = camera.direction; var up = camera.up; - if (!defined(position)) { - throw new DeveloperError('camera.position is required.'); - } - if (!defined(direction)) { - throw new DeveloperError('camera.direction is required.'); - } - if (!defined(up)) { - throw new DeveloperError('camera.up is required.'); - } + Check.typeOf.object('camera.position', position); + Check.typeOf.object('camera.direction', direction); + Check.typeOf.object('camera.up', up); Cartesian3.normalize(direction, fromCameraF); Cartesian3.normalize(Cartesian3.cross(fromCameraF, up, fromCameraR), fromCameraR); @@ -8101,21 +7760,11 @@ define('Core/Matrix4',[ * @exception {DeveloperError} far must be greater than zero. */ Matrix4.computePerspectiveFieldOfView = function(fovY, aspectRatio, near, far, result) { - if (fovY <= 0.0 || fovY > Math.PI) { - throw new DeveloperError('fovY must be in (0, PI].'); - } - if (aspectRatio <= 0.0) { - throw new DeveloperError('aspectRatio must be greater than zero.'); - } - if (near <= 0.0) { - throw new DeveloperError('near must be greater than zero.'); - } - if (far <= 0.0) { - throw new DeveloperError('far must be greater than zero.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThan('fovY', fovY, 0.0); + Check.typeOf.number.lessThan('fovY', fovY, Math.PI); + Check.typeOf.number.greaterThan('near', near, 0.0); + Check.typeOf.number.greaterThan('far', far, 0.0); + Check.typeOf.object('result', result); var bottom = Math.tan(fovY * 0.5); @@ -8156,27 +7805,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeOrthographicOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var a = 1.0 / (right - left); var b = 1.0 / (top - bottom); @@ -8221,27 +7856,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computePerspectiveOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -8282,24 +7903,12 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeInfinitePerspectiveOffCenter = function(left, right, bottom, top, near, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -8347,9 +7956,7 @@ define('Core/Matrix4',[ * }, 0.0, 1.0, new Cesium.Matrix4()); */ Matrix4.computeViewportTransformation = function(viewport, nearDepthRange, farDepthRange, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); viewport = defaultValue(viewport, defaultValue.EMPTY_OBJECT); var x = defaultValue(viewport.x, 0.0); @@ -8401,21 +8008,11 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeView = function(position, direction, up, right, result) { - if (!defined(position)) { - throw new DeveloperError('position is required'); - } - if (!defined(direction)) { - throw new DeveloperError('direction is required'); - } - if (!defined(up)) { - throw new DeveloperError('up is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); + Check.typeOf.object('up', up); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = right.x; result[1] = up.x; @@ -8456,9 +8053,7 @@ define('Core/Matrix4',[ * //creates a = [10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0] */ Matrix4.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], @@ -8502,12 +8097,11 @@ define('Core/Matrix4',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix4.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 3) { - throw new DeveloperError('row must be 0, 1, 2, or 3.'); - } - if (typeof column !== 'number' || column < 0 || column > 3) { - throw new DeveloperError('column must be 0, 1, 2, or 3.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 3); + + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 3); return column * 4 + row; }; @@ -8540,16 +8134,12 @@ define('Core/Matrix4',[ * // a.x = 12.0; a.y = 16.0; a.z = 20.0; a.w = 24.0; */ Matrix4.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var startIndex = index * 4; var x = matrix[startIndex]; @@ -8591,18 +8181,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 96.0, 25.0] */ Matrix4.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); var startIndex = index * 4; @@ -8623,15 +8208,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.setTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -8684,16 +8263,12 @@ define('Core/Matrix4',[ * // a.x = 18.0; a.y = 19.0; a.z = 20.0; a.w = 21.0; */ Matrix4.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 4]; @@ -8734,18 +8309,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 24.0, 25.0] */ Matrix4.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); result[index] = cartesian.x; @@ -8765,12 +8335,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter */ Matrix4.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[4], matrix[5], matrix[6], scratchColumn)); @@ -8802,15 +8368,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -8887,22 +8447,16 @@ define('Core/Matrix4',[ /** * Computes the sum of two matrices. - * - * @param {Matrix4} left The first matrix. - * @param {Matrix4} right The second matrix. - * @param {Matrix4} result The object onto which to store the result. - * @returns {Matrix4} The modified result parameter. - */ - Matrix4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + * + * @param {Matrix4} left The first matrix. + * @param {Matrix4} right The second matrix. + * @param {Matrix4} result The object onto which to store the result. + * @returns {Matrix4} The modified result parameter. + */ + Matrix4.add = function(left, right, result) { + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -8932,15 +8486,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -8981,15 +8529,9 @@ define('Core/Matrix4',[ * var m3 = Cesium.Matrix4.multiplyTransformation(m1, m2, new Cesium.Matrix4()); */ Matrix4.multiplyTransformation = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -9067,15 +8609,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByMatrix3(m, rotation, m); */ Matrix4.multiplyByMatrix3 = function(matrix, rotation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('result', result); var left0 = matrix[0]; var left1 = matrix[1]; @@ -9143,15 +8679,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByTranslation(m, position, m); */ Matrix4.multiplyByTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); var x = translation.x; var y = translation.y; @@ -9203,15 +8733,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByScale */ Matrix4.multiplyByUniformScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scale', scale); + Check.typeOf.object('result', result); uniformScaleScratch.x = scale; uniformScaleScratch.y = scale; @@ -9240,15 +8764,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByUniformScale */ Matrix4.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); var scaleX = scale.x; var scaleY = scale.y; @@ -9287,15 +8805,9 @@ define('Core/Matrix4',[ * @returns {Cartesian4} The modified result parameter. */ Matrix4.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -9331,15 +8843,9 @@ define('Core/Matrix4',[ * // Cesium.Matrix4.multiplyByVector(matrix, new Cesium.Cartesian4(p.x, p.y, p.z, 0.0), result); */ Matrix4.multiplyByPointAsVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -9369,16 +8875,9 @@ define('Core/Matrix4',[ * var result = Cesium.Matrix4.multiplyByPoint(matrix, p, new Cesium.Cartesian3()); */ Matrix4.multiplyByPoint = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -9418,15 +8917,9 @@ define('Core/Matrix4',[ * // [-44.0, -46.0, -48.0, -50.0] */ Matrix4.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -9470,12 +8963,8 @@ define('Core/Matrix4',[ * // [-22.0, -23.0, -24.0, -25.0] */ Matrix4.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -9519,12 +9008,8 @@ define('Core/Matrix4',[ * // [13.0, 17.0, 21.0, 25.0] */ Matrix4.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var matrix1 = matrix[1]; var matrix2 = matrix[2]; @@ -9560,12 +9045,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -9679,9 +9160,7 @@ define('Core/Matrix4',[ * //Prints "Difference between both the matrices is not less than 0.1" on the console */ Matrix4.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -9712,12 +9191,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter. */ Matrix4.getTranslation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = matrix[12]; result.y = matrix[13]; @@ -9748,12 +9223,8 @@ define('Core/Matrix4',[ * // [12.0, 16.0, 20.0] */ Matrix4.getRotation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -9785,12 +9256,8 @@ define('Core/Matrix4',[ * @exception {RuntimeError} matrix is not invertible because its determinate is zero. */ Matrix4.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); // Special case for a zero scale matrix that can occur, for example, // when a model's node has a [0, 0, 0] scale. @@ -9928,12 +9395,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.inverseTransformation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); //This function is an optimized version of the below 4 lines. //var rT = Matrix3.transpose(Matrix4.getRotation(matrix)); @@ -10217,6 +9680,7 @@ define('Core/Matrix4',[ /*global define*/ define('Core/Rectangle',[ './Cartographic', + './Check', './defaultValue', './defined', './defineProperties', @@ -10226,6 +9690,7 @@ define('Core/Rectangle',[ './Math' ], function( Cartographic, + Check, defaultValue, defined, defineProperties, @@ -10322,13 +9787,8 @@ define('Core/Rectangle',[ * @returns {Number[]} The array that was packed into */ Rectangle.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -10349,9 +9809,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -10372,9 +9830,7 @@ define('Core/Rectangle',[ * @returns {Number} The width. */ Rectangle.computeWidth = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; if (east < west) { @@ -10389,9 +9845,7 @@ define('Core/Rectangle',[ * @returns {Number} The height. */ Rectangle.computeHeight = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); return rectangle.north - rectangle.south; }; @@ -10426,6 +9880,32 @@ define('Core/Rectangle',[ return result; }; + /** + * Creates an rectangle given the boundary longitude and latitude in radians. + * + * @param {Number} [west=0.0] The westernmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [south=0.0] The southernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Number} [east=0.0] The easternmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [north=0.0] The northernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Rectangle} [result] The object onto which to store the result, or undefined if a new instance should be created. + * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. + * + * @example + * var rectangle = Cesium.Rectangle.fromRadians(0.0, Math.PI/4, Math.PI/8, 3*Math.PI/4); + */ + Rectangle.fromRadians = function(west, south, east, north, result) { + if (!defined(result)) { + return new Rectangle(west, south, east, north); + } + + result.west = defaultValue(west, 0.0); + result.south = defaultValue(south, 0.0); + result.east = defaultValue(east, 0.0); + result.north = defaultValue(north, 0.0); + + return result; + }; + /** * Creates the smallest possible Rectangle that encloses all positions in the provided array. * @@ -10434,9 +9914,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartographicArray = function(cartographics, result) { - if (!defined(cartographics)) { - throw new DeveloperError('cartographics is required.'); - } + Check.defined('cartographics', cartographics); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -10489,9 +9967,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartesianArray = function(cartesians, ellipsoid, result) { - if (!defined(cartesians)) { - throw new DeveloperError('cartesians is required.'); - } + Check.defined('cartesians', cartesians); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -10607,9 +10083,7 @@ define('Core/Rectangle',[ * @returns {Boolean} <code>true</code> if the Rectangles are within the provided epsilon, <code>false</code> otherwise. */ Rectangle.prototype.equalsEpsilon = function(other, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon is required and must be a number.'); - } + Check.typeOf.number('epsilon', epsilon); return defined(other) && (Math.abs(this.west - other.west) <= epsilon) && @@ -10629,45 +10103,23 @@ define('Core/Rectangle',[ * @exception {DeveloperError} <code>west</code> must be in the interval [<code>-Pi</code>, <code>Pi</code>]. */ Rectangle.validate = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var north = rectangle.north; - if (typeof north !== 'number') { - throw new DeveloperError('north is required to be a number.'); - } - - if (north < -CesiumMath.PI_OVER_TWO || north > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('north must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('north', north, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('north', north, CesiumMath.PI_OVER_TWO); var south = rectangle.south; - if (typeof south !== 'number') { - throw new DeveloperError('south is required to be a number.'); - } - - if (south < -CesiumMath.PI_OVER_TWO || south > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('south must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('south', south, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('south', south, CesiumMath.PI_OVER_TWO); var west = rectangle.west; - if (typeof west !== 'number') { - throw new DeveloperError('west is required to be a number.'); - } - - if (west < -Math.PI || west > Math.PI) { - throw new DeveloperError('west must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('west', west, -Math.PI); + Check.typeOf.number.lessThanOrEquals('west', west, Math.PI); var east = rectangle.east; - if (typeof east !== 'number') { - throw new DeveloperError('east is required to be a number.'); - } - - if (east < -Math.PI || east > Math.PI) { - throw new DeveloperError('east must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('east', east, -Math.PI); + Check.typeOf.number.lessThanOrEquals('east', east, Math.PI); }; /** @@ -10678,9 +10130,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.south); @@ -10699,9 +10149,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.north); @@ -10720,9 +10168,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.north); @@ -10741,9 +10187,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.south); @@ -10762,9 +10206,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.center = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; @@ -10799,12 +10241,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.intersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var rectangleEast = rectangle.east; var rectangleWest = rectangle.west; @@ -10860,12 +10298,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.simpleIntersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var west = Math.max(rectangle.west, otherRectangle.west); var south = Math.max(rectangle.south, otherRectangle.south); @@ -10896,12 +10330,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.union = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); if (!defined(result)) { result = new Rectangle(); @@ -10945,12 +10375,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.expand = function(rectangle, cartographic, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); if (!defined(result)) { result = new Rectangle(); @@ -10972,12 +10398,8 @@ define('Core/Rectangle',[ * @returns {Boolean} true if the provided cartographic is inside the rectangle, false otherwise. */ Rectangle.contains = function(rectangle, cartographic) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); var longitude = cartographic.longitude; var latitude = cartographic.latitude; @@ -11010,9 +10432,7 @@ define('Core/Rectangle',[ * @returns {Cartesian3[]} The modified result parameter or a new Array of Cartesians instances if none was provided. */ Rectangle.subsample = function(rectangle, ellipsoid, surfaceHeight, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84); surfaceHeight = defaultValue(surfaceHeight, 0.0); @@ -11090,9 +10510,9 @@ define('Core/Rectangle',[ define('Core/BoundingSphere',[ './Cartesian3', './Cartographic', + './Check', './defaultValue', './defined', - './DeveloperError', './Ellipsoid', './GeographicProjection', './Intersect', @@ -11103,9 +10523,9 @@ define('Core/BoundingSphere',[ ], function( Cartesian3, Cartographic, + Check, defaultValue, defined, - DeveloperError, Ellipsoid, GeographicProjection, Intersect, @@ -11435,9 +10855,7 @@ define('Core/BoundingSphere',[ stride = defaultValue(stride, 3); - if (stride < 3) { - throw new DeveloperError('stride must be 3 or greater.'); - } + Check.typeOf.number.greaterThanOrEquals('stride', stride, 3); var currentPos = fromPointsCurrentPos; currentPos.x = positions[0] + center.x; @@ -11741,9 +11159,8 @@ define('Core/BoundingSphere',[ * var sphere = Cesium.BoundingSphere.fromCornerPoints(new Cesium.Cartesian3(-0.5, -0.5, -0.5), new Cesium.Cartesian3(0.5, 0.5, 0.5)); */ BoundingSphere.fromCornerPoints = function(corner, oppositeCorner, result) { - if (!defined(corner) || !defined(oppositeCorner)) { - throw new DeveloperError('corner and oppositeCorner are required.'); - } + Check.typeOf.object('corner', corner); + Check.typeOf.object('oppositeCorner', oppositeCorner); if (!defined(result)) { result = new BoundingSphere(); @@ -11767,9 +11184,7 @@ define('Core/BoundingSphere',[ * var boundingSphere = Cesium.BoundingSphere.fromEllipsoid(ellipsoid); */ BoundingSphere.fromEllipsoid = function(ellipsoid, result) { - if (!defined(ellipsoid)) { - throw new DeveloperError('ellipsoid is required.'); - } + Check.typeOf.object('ellipsoid', ellipsoid); if (!defined(result)) { result = new BoundingSphere(); @@ -11895,13 +11310,8 @@ define('Core/BoundingSphere',[ * @returns {Number[]} The array that was packed into */ BoundingSphere.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -11923,9 +11333,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if one was not provided. */ BoundingSphere.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -11952,13 +11360,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.union = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); if (!defined(result)) { result = new BoundingSphere(); @@ -12007,13 +11410,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.expand = function(sphere, point, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(point)) { - throw new DeveloperError('point is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('point', point); result = BoundingSphere.clone(sphere, result); @@ -12036,13 +11434,8 @@ define('Core/BoundingSphere',[ * intersects the plane. */ BoundingSphere.intersectPlane = function(sphere, plane) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(plane)) { - throw new DeveloperError('plane is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('plane', plane); var center = sphere.center; var radius = sphere.radius; @@ -12068,13 +11461,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.transform = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -12102,12 +11490,8 @@ define('Core/BoundingSphere',[ * }); */ BoundingSphere.distanceSquaredTo = function(sphere, cartesian) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('cartesian', cartesian); var diff = Cartesian3.subtract(sphere.center, cartesian, distanceSquaredToScratch); return Cartesian3.magnitudeSquared(diff) - sphere.radius * sphere.radius; @@ -12129,13 +11513,8 @@ define('Core/BoundingSphere',[ * var newBoundingSphere = Cesium.BoundingSphere.transformWithoutScale(boundingSphere, modelMatrix); */ BoundingSphere.transformWithoutScale = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -12162,17 +11541,9 @@ define('Core/BoundingSphere',[ * @returns {Interval} The nearest and farthest distances on the bounding sphere from position in direction. */ BoundingSphere.computePlaneDistances = function(sphere, position, direction, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(position)) { - throw new DeveloperError('position is required.'); - } - - if (!defined(direction)) { - throw new DeveloperError('direction is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); if (!defined(result)) { result = new Interval(); @@ -12207,9 +11578,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.projectTo2D = function(sphere, projection, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } + Check.typeOf.object('sphere', sphere); projection = defaultValue(projection, projectTo2DProjection); @@ -12304,12 +11673,8 @@ define('Core/BoundingSphere',[ * @returns {Boolean} <code>true</code> if the sphere is not visible; otherwise <code>false</code>. */ BoundingSphere.isOccluded = function(sphere, occluder) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(occluder)) { - throw new DeveloperError('occluder is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('occluder', occluder); return !occluder.isBoundingSphereVisible(sphere); }; @@ -12999,7 +12364,10 @@ define('Core/WebGLConstants',[ COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : 0x9279, TEXTURE_IMMUTABLE_FORMAT : 0x912F, MAX_ELEMENT_INDEX : 0x8D6B, - TEXTURE_IMMUTABLE_LEVELS : 0x82DF + TEXTURE_IMMUTABLE_LEVELS : 0x82DF, + + // Extensions + MAX_TEXTURE_MAX_ANISOTROPY_EXT : 0x84FF }; return freezeObject(WebGLConstants); @@ -13930,6 +13298,7 @@ define('Core/IntersectionTests',[ './defaultValue', './defined', './DeveloperError', + './Interval', './Math', './Matrix3', './QuadraticRealPolynomial', @@ -13941,6 +13310,7 @@ define('Core/IntersectionTests',[ defaultValue, defined, DeveloperError, + Interval, CesiumMath, Matrix3, QuadraticRealPolynomial, @@ -14212,7 +13582,7 @@ define('Core/IntersectionTests',[ function raySphere(ray, sphere, result) { if (!defined(result)) { - result = {}; + result = new Interval(); } var origin = ray.origin; @@ -14243,8 +13613,8 @@ define('Core/IntersectionTests',[ * * @param {Ray} ray The ray. * @param {BoundingSphere} sphere The sphere. - * @param {Object} [result] The result onto which to store the result. - * @returns {Object} An object with the first (<code>start</code>) and the second (<code>stop</code>) intersection scalars for points along the ray or undefined if there are no intersections. + * @param {Interval} [result] The result onto which to store the result. + * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections. */ IntersectionTests.raySphere = function(ray, sphere, result) { if (!defined(ray)) { @@ -14272,8 +13642,8 @@ define('Core/IntersectionTests',[ * @param {Cartesian3} p0 An end point of the line segment. * @param {Cartesian3} p1 The other end point of the line segment. * @param {BoundingSphere} sphere The sphere. - * @param {Object} [result] The result onto which to store the result. - * @returns {Object} An object with the first (<code>start</code>) and the second (<code>stop</code>) intersection scalars for points along the line segment or undefined if there are no intersections. + * @param {Interval} [result] The result onto which to store the result. + * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections. */ IntersectionTests.lineSegmentSphere = function(p0, p1, sphere, result) { if (!defined(p0)) { @@ -14311,7 +13681,7 @@ define('Core/IntersectionTests',[ * * @param {Ray} ray The ray. * @param {Ellipsoid} ellipsoid The ellipsoid. - * @returns {Object} An object with the first (<code>start</code>) and the second (<code>stop</code>) intersection scalars for points along the ray or undefined if there are no intersections. + * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections. */ IntersectionTests.rayEllipsoid = function(ray, ellipsoid) { if (!defined(ray)) { @@ -14353,10 +13723,7 @@ define('Core/IntersectionTests',[ var root0 = temp / w2; var root1 = difference / temp; if (root0 < root1) { - return { - start : root0, - stop : root1 - }; + return new Interval(root0, root1); } return { @@ -14366,10 +13733,7 @@ define('Core/IntersectionTests',[ } else { // qw2 == product. Repeated roots (2 intersections). var root = Math.sqrt(difference / w2); - return { - start : root, - stop : root - }; + return new Interval(root, root); } } else if (q2 < 1.0) { // Inside ellipsoid (2 intersections). @@ -14379,19 +13743,13 @@ define('Core/IntersectionTests',[ discriminant = qw * qw - product; temp = -qw + Math.sqrt(discriminant); // Positively valued. - return { - start : 0.0, - stop : temp / w2 - }; + return new Interval(0.0, temp / w2); } else { // q2 == 1.0. On ellipsoid. if (qw < 0.0) { // Looking inward. w2 = Cartesian3.magnitudeSquared(w); - return { - start : 0.0, - stop : -qw / w2 - }; + return new Interval(0.0, -qw / w2); } // qw >= 0.0. Looking outward or tangent. @@ -15744,118 +15102,6 @@ define('ThirdParty/when',[],function () { // Boilerplate for AMD, Node, and browser global ); -/*global define*/ -define('Core/oneTimeWarning',[ - './defaultValue', - './defined', - './DeveloperError' - ], function( - defaultValue, - defined, - DeveloperError) { - "use strict"; - - var warnings = {}; - - /** - * Logs a one time message to the console. Use this function instead of - * <code>console.log</code> directly since this does not log duplicate messages - * unless it is called from multiple workers. - * - * @exports oneTimeWarning - * - * @param {String} identifier The unique identifier for this warning. - * @param {String} [message=identifier] The message to log to the console. - * - * @example - * for(var i=0;i<foo.length;++i) { - * if (!defined(foo[i].bar)) { - * // Something that can be recovered from but may happen a lot - * oneTimeWarning('foo.bar undefined', 'foo.bar is undefined. Setting to 0.'); - * foo[i].bar = 0; - * // ... - * } - * } - * - * @private - */ - function oneTimeWarning(identifier, message) { - if (!defined(identifier)) { - throw new DeveloperError('identifier is required.'); - } - - if (!defined(warnings[identifier])) { - warnings[identifier] = true; - console.log(defaultValue(message, identifier)); - } - } - - oneTimeWarning.geometryOutlines = 'Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.'; - - return oneTimeWarning; -}); - -/*global define*/ -define('Core/deprecationWarning',[ - './defined', - './DeveloperError', - './oneTimeWarning' - ], function( - defined, - DeveloperError, - oneTimeWarning) { - 'use strict'; - - /** - * Logs a deprecation message to the console. Use this function instead of - * <code>console.log</code> directly since this does not log duplicate messages - * unless it is called from multiple workers. - * - * @exports deprecationWarning - * - * @param {String} identifier The unique identifier for this deprecated API. - * @param {String} message The message to log to the console. - * - * @example - * // Deprecated function or class - * function Foo() { - * deprecationWarning('Foo', 'Foo was deprecated in Cesium 1.01. It will be removed in 1.03. Use newFoo instead.'); - * // ... - * } - * - * // Deprecated function - * Bar.prototype.func = function() { - * deprecationWarning('Bar.func', 'Bar.func() was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newFunc() instead.'); - * // ... - * }; - * - * // Deprecated property - * defineProperties(Bar.prototype, { - * prop : { - * get : function() { - * deprecationWarning('Bar.prop', 'Bar.prop was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newProp instead.'); - * // ... - * }, - * set : function(value) { - * deprecationWarning('Bar.prop', 'Bar.prop was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newProp instead.'); - * // ... - * } - * } - * }); - * - * @private - */ - function deprecationWarning(identifier, message) { - if (!defined(identifier) || !defined(message)) { - throw new DeveloperError('identifier and message are required.'); - } - - oneTimeWarning(identifier, message); - } - - return deprecationWarning; -}); - /*global define*/ define('Core/binarySearch',[ './defined', @@ -20084,6 +19330,7 @@ define('Core/FeatureDetection',[ /*global define*/ define('Core/Quaternion',[ './Cartesian3', + './Check', './defaultValue', './defined', './DeveloperError', @@ -20093,6 +19340,7 @@ define('Core/Quaternion',[ './Matrix3' ], function( Cartesian3, + Check, defaultValue, defined, DeveloperError, @@ -20155,12 +19403,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided. */ Quaternion.fromAxisAngle = function(axis, angle, result) { - if (!defined(axis)) { - throw new DeveloperError('axis is required.'); - } - if (typeof angle !== 'number') { - throw new DeveloperError('angle is required and must be a number.'); - } + Check.typeOf.object('axis', axis); + Check.typeOf.number('angle', angle); var halfAngle = angle / 2.0; var s = Math.sin(halfAngle); @@ -20192,9 +19436,7 @@ define('Core/Quaternion',[ * @see Matrix3.fromQuaternion */ Quaternion.fromRotationMatrix = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); var root; var x; @@ -20268,15 +19510,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter or a new Quaternion instance if none was provided. */ Quaternion.fromHeadingPitchRoll = function(heading, pitch, roll, result) { - if (!defined(heading)) { - throw new DeveloperError('heading is required.'); - } - if (!defined(pitch)) { - throw new DeveloperError('pitch is required.'); - } - if (!defined(roll)) { - throw new DeveloperError('roll is required.'); - } + Check.typeOf.number('heading', heading); + Check.typeOf.number('pitch', pitch); + Check.typeOf.number('roll', roll); var rollQuaternion = Quaternion.fromAxisAngle(Cartesian3.UNIT_X, roll, scratchHPRQuaternion); var pitchQuaternion = Quaternion.fromAxisAngle(Cartesian3.UNIT_Y, -pitch, result); @@ -20307,13 +19543,8 @@ define('Core/Quaternion',[ * @returns {Number[]} The array that was packed into */ Quaternion.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -20334,9 +19565,7 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided. */ Quaternion.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -20391,7 +19620,7 @@ define('Core/Quaternion',[ * * @param {Number[]} array The array previously packed for interpolation. * @param {Number[]} sourceArray The original packed array. - * @param {Number} [startingIndex=0] The startingIndex used to convert the array. + * @param {Number} [firstIndex=0] The firstIndex used to convert the array. * @param {Number} [lastIndex=packedArray.length] The lastIndex used to convert the array. * @param {Quaternion} [result] The object into which to store the result. * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided. @@ -20445,12 +19674,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.conjugate = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); result.x = -quaternion.x; result.y = -quaternion.y; @@ -20466,9 +19691,7 @@ define('Core/Quaternion',[ * @returns {Number} The magnitude squared. */ Quaternion.magnitudeSquared = function(quaternion) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); return quaternion.x * quaternion.x + quaternion.y * quaternion.y + quaternion.z * quaternion.z + quaternion.w * quaternion.w; }; @@ -20491,9 +19714,7 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.normalize = function(quaternion, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); var inverseMagnitude = 1.0 / Quaternion.magnitude(quaternion); var x = quaternion.x * inverseMagnitude; @@ -20516,9 +19737,7 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.inverse = function(quaternion, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); var magnitudeSquared = Quaternion.magnitudeSquared(quaternion); result = Quaternion.conjugate(quaternion, result); @@ -20534,15 +19753,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -20560,15 +19773,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -20585,12 +19792,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.negate = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); result.x = -quaternion.x; result.y = -quaternion.y; @@ -20607,12 +19810,8 @@ define('Core/Quaternion',[ * @returns {Number} The dot product. */ Quaternion.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w; }; @@ -20626,15 +19825,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var leftX = left.x; var leftY = left.y; @@ -20667,15 +19860,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.multiplyByScalar = function(quaternion, scalar, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = quaternion.x * scalar; result.y = quaternion.y * scalar; @@ -20693,15 +19880,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.divideByScalar = function(quaternion, scalar, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = quaternion.x / scalar; result.y = quaternion.y / scalar; @@ -20718,12 +19899,8 @@ define('Core/Quaternion',[ * @returns {Cartesian3} The modified result parameter. */ Quaternion.computeAxis = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); var w = quaternion.w; if (Math.abs(w - 1.0) < CesiumMath.EPSILON6) { @@ -20746,9 +19923,7 @@ define('Core/Quaternion',[ * @returns {Number} The angle of rotation. */ Quaternion.computeAngle = function(quaternion) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); if (Math.abs(quaternion.w - 1.0) < CesiumMath.EPSILON6) { return 0.0; @@ -20767,18 +19942,10 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); lerpScratch = Quaternion.multiplyByScalar(end, t, lerpScratch); result = Quaternion.multiplyByScalar(start, 1.0 - t, result); @@ -20800,18 +19967,10 @@ define('Core/Quaternion',[ * @see Quaternion#fastSlerp */ Quaternion.slerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var dot = Quaternion.dot(start, end); @@ -20844,12 +20003,8 @@ define('Core/Quaternion',[ * @returns {Cartesian3} The modified result parameter. */ Quaternion.log = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); var theta = CesiumMath.acosClamped(quaternion.w); var thetaOverSinTheta = 0.0; @@ -20869,12 +20024,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.exp = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var theta = Cartesian3.magnitude(cartesian); var sinThetaOverTheta = 0.0; @@ -20909,12 +20060,10 @@ define('Core/Quaternion',[ * @see Quaternion#squad */ Quaternion.computeInnerQuadrangle = function(q0, q1, q2, result) { - if (!defined(q0) || !defined(q1) || !defined(q2)) { - throw new DeveloperError('q0, q1, and q2 are required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('q0', q0); + Check.typeOf.object('q1', q1); + Check.typeOf.object('q2', q2); + Check.typeOf.object('result', result); var qInv = Quaternion.conjugate(q1, squadScratchQuaternion0); Quaternion.multiply(qInv, q2, squadScratchQuaternion1); @@ -20956,15 +20105,12 @@ define('Core/Quaternion',[ * @see Quaternion#computeInnerQuadrangle */ Quaternion.squad = function(q0, q1, s0, s1, t, result) { - if (!defined(q0) || !defined(q1) || !defined(s0) || !defined(s1)) { - throw new DeveloperError('q0, q1, s0, and s1 are required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('q0', q0); + Check.typeOf.object('q1', q1); + Check.typeOf.object('s0', s0); + Check.typeOf.object('s1', s1); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var slerp0 = Quaternion.slerp(q0, q1, t, squadScratchQuaternion0); var slerp1 = Quaternion.slerp(s0, s1, t, squadScratchQuaternion1); @@ -21001,18 +20147,10 @@ define('Core/Quaternion',[ * @see Quaternion#slerp */ Quaternion.fastSlerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var x = Quaternion.dot(start, end); @@ -21061,15 +20199,12 @@ define('Core/Quaternion',[ * @see Quaternion#squad */ Quaternion.fastSquad = function(q0, q1, s0, s1, t, result) { - if (!defined(q0) || !defined(q1) || !defined(s0) || !defined(s1)) { - throw new DeveloperError('q0, q1, s0, and s1 are required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('q0', q0); + Check.typeOf.object('q1', q1); + Check.typeOf.object('s0', s0); + Check.typeOf.object('s1', s1); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var slerp0 = Quaternion.fastSlerp(q0, q1, t, squadScratchQuaternion0); var slerp1 = Quaternion.fastSlerp(s0, s1, t, squadScratchQuaternion1); @@ -21105,9 +20240,7 @@ define('Core/Quaternion',[ * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. */ Quaternion.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon is required and must be a number.'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || ((defined(left)) && @@ -21187,9 +20320,9 @@ define('Core/Transforms',[ './Cartesian3', './Cartesian4', './Cartographic', + './Check', './defaultValue', './defined', - './deprecationWarning', './DeveloperError', './EarthOrientationParameters', './EarthOrientationParametersSample', @@ -21209,9 +20342,9 @@ define('Core/Transforms',[ Cartesian3, Cartesian4, Cartographic, + Check, defaultValue, defined, - deprecationWarning, DeveloperError, EarthOrientationParameters, EarthOrientationParametersSample, @@ -21647,19 +20780,12 @@ define('Core/Transforms',[ * var hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll); * var transform = Cesium.Transforms.headingPitchRollToFixedFrame(center, hpr); */ - Transforms.headingPitchRollToFixedFrame = function(origin, headingPitchRoll, pitch, roll, ellipsoid, result) { - var heading; - if (typeof headingPitchRoll === 'object') { - // Shift arguments using assignments to encourage JIT optimization. - ellipsoid = pitch; - result = roll; - heading = headingPitchRoll.heading; - pitch = headingPitchRoll.pitch; - roll = headingPitchRoll.roll; - } else { - deprecationWarning('headingPitchRollToFixedFrame', 'headingPitchRollToFixedFrame with separate heading, pitch, and roll arguments was deprecated in 1.27. It will be removed in 1.30. Use a HeadingPitchRoll object.'); - heading = headingPitchRoll; - } + Transforms.headingPitchRollToFixedFrame = function(origin, headingPitchRoll, ellipsoid, result) { + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + var heading = headingPitchRoll.heading; + var pitch = headingPitchRoll.pitch; + var roll = headingPitchRoll.roll; + // checks for required parameters happen in the called functions var hprQuaternion = Quaternion.fromHeadingPitchRoll(heading, pitch, roll, scratchHPRQuaternion); var hprMatrix = Matrix4.fromTranslationQuaternionRotationScale(Cartesian3.ZERO, hprQuaternion, scratchScale, scratchHPRMatrix4); @@ -21667,7 +20793,6 @@ define('Core/Transforms',[ return Matrix4.multiply(result, hprMatrix, result); }; - var scratchHPR = new HeadingPitchRoll(); var scratchENUMatrix4 = new Matrix4(); var scratchHPRMatrix3 = new Matrix3(); @@ -21692,22 +20817,10 @@ define('Core/Transforms',[ * var hpr = new HeadingPitchRoll(heading, pitch, roll); * var quaternion = Cesium.Transforms.headingPitchRollQuaternion(center, hpr); */ - Transforms.headingPitchRollQuaternion = function(origin, headingPitchRoll, pitch, roll, ellipsoid, result) { - var hpr; - if (typeof headingPitchRoll === 'object') { - // Shift arguments using assignment to encourage JIT optimization. - hpr = headingPitchRoll; - ellipsoid = pitch; - result = roll; - } else { - deprecationWarning('headingPitchRollQuaternion', 'headingPitchRollQuaternion with separate heading, pitch, and roll arguments was deprecated in 1.27. It will be removed in 1.30. Use a HeadingPitchRoll object.'); - scratchHPR.heading = headingPitchRoll; - scratchHPR.pitch = pitch; - scratchHPR.roll = roll; - hpr = scratchHPR; - } + Transforms.headingPitchRollQuaternion = function(origin, headingPitchRoll, ellipsoid, result) { // checks for required parameters happen in the called functions - var transform = Transforms.headingPitchRollToFixedFrame(origin, hpr, ellipsoid, scratchENUMatrix4); + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + var transform = Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, scratchENUMatrix4); var rotation = Matrix4.getRotation(transform, scratchHPRMatrix3); return Quaternion.fromRotationMatrix(rotation, result); }; @@ -22183,6 +21296,46 @@ define('Core/Transforms',[ return result; }; + var swizzleMatrix = new Matrix4( + 0.0, 0.0, 1.0, 0.0, + 1.0, 0.0, 0.0, 0.0, + 0.0, 1.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + + /** + * @private + */ + Transforms.wgs84To2DModelMatrix = function(projection, center, result) { + if (!defined(projection)) { + throw new DeveloperError('projection is required.'); + } + if (!defined(center)) { + throw new DeveloperError('center is required.'); + } + if (!defined(result)) { + throw new DeveloperError('result is required.'); + } + + var ellipsoid = projection.ellipsoid; + + var fromENU = Transforms.eastNorthUpToFixedFrame(center, ellipsoid, scratchFromENU); + var toENU = Matrix4.inverseTransformation(fromENU, scratchToENU); + + var cartographic = ellipsoid.cartesianToCartographic(center, scratchCartographic); + var projectedPosition = projection.project(cartographic, scratchCartesian3Projection); + var newOrigin = scratchCartesian4NewOrigin; + newOrigin.x = projectedPosition.z; + newOrigin.y = projectedPosition.x; + newOrigin.z = projectedPosition.y; + newOrigin.w = 1.0; + + var translation = Matrix4.fromTranslation(newOrigin, scratchFromENU); + Matrix4.multiply(swizzleMatrix, toENU, result); + Matrix4.multiply(translation, result, result); + + return result; + }; + return Transforms; }); @@ -22721,6 +21874,7 @@ define('Core/OrientedBoundingBox',[ /** * Computes an OrientedBoundingBox given extents in the east-north-up space of the tangent plane. * + * @param {Plane} tangentPlane The tangent place corresponding to east-north-up. * @param {Number} minimumX Minimum X extent in tangent plane space. * @param {Number} maximumX Maximum X extent in tangent plane space. * @param {Number} minimumY Minimum Y extent in tangent plane space. diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createWallGeometry.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createWallGeometry.js index f3f3b613..596fa2a1 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createWallGeometry.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createWallGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,68 +45,6 @@ define('Core/defined',[],function() { return defined; }); -/*global define*/ -define('Core/freezeObject',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Freezes an object, using Object.freeze if available, otherwise returns - * the object unchanged. This function should be used in setup code to prevent - * errors from completely halting JavaScript execution in legacy browsers. - * - * @private - * - * @exports freezeObject - */ - var freezeObject = Object.freeze; - if (!defined(freezeObject)) { - freezeObject = function(o) { - return o; - }; - } - - return freezeObject; -}); - -/*global define*/ -define('Core/defaultValue',[ - './freezeObject' - ], function( - freezeObject) { - 'use strict'; - - /** - * Returns the first parameter if not undefined, otherwise the second parameter. - * Useful for setting a default value for a parameter. - * - * @exports defaultValue - * - * @param {*} a - * @param {*} b - * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter. - * - * @example - * param = Cesium.defaultValue(param, 'default'); - */ - function defaultValue(a, b) { - if (a !== undefined) { - return a; - } - return b; - } - - /** - * A frozen empty object that can be used as the default value for options passed as - * an object literal. - */ - defaultValue.EMPTY_OBJECT = freezeObject({}); - - return defaultValue; -}); - /*global define*/ define('Core/DeveloperError',[ './defined' @@ -188,41 +126,13 @@ define('Core/DeveloperError',[ return DeveloperError; }); -/*global define*/ -define('Core/isArray',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Tests an object to see if it is an array. - * @exports isArray - * - * @param {Object} value The value to test. - * @returns {Boolean} true if the value is an array, false otherwise. - */ - var isArray = Array.isArray; - if (!defined(isArray)) { - isArray = function(value) { - return Object.prototype.toString.call(value) === '[object Array]'; - }; - } - - return isArray; -}); - /*global define*/ define('Core/Check',[ - './defaultValue', - './defined', - './DeveloperError', - './isArray' + './defined', + './DeveloperError' ], function( - defaultValue, defined, - DeveloperError, - isArray) { + DeveloperError) { 'use strict'; /** @@ -237,111 +147,134 @@ define('Core/Check',[ */ Check.typeOf = {}; - /** - * Contains functions for checking numeric conditions such as minimum and maximum values - */ - Check.numeric = {}; - function getUndefinedErrorMessage(name) { - return name + ' was required but undefined.'; + return name + ' is required, actual value was undefined'; } function getFailedTypeErrorMessage(actual, expected, name) { - return 'Expected ' + name + ' to be typeof ' + expected + ', got ' + actual; + return 'Expected ' + name + ' to be typeof ' + expected + ', actual typeof was ' + actual; } /** * Throws if test is not defined * - * @param {*} test The value that is to be checked * @param {String} name The name of the variable being tested + * @param {*} test The value that is to be checked * @exception {DeveloperError} test must be defined */ - Check.defined = function (test, name) { + Check.defined = function (name, test) { if (!defined(test)) { throw new DeveloperError(getUndefinedErrorMessage(name)); } }; /** - * Throws if test is greater than maximum + * Throws if test is not typeof 'function' * - * @param {Number} test The value to test - * @param {Number} maximum The maximum allowed value - * @exception {DeveloperError} test must not be greater than maximum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'function' */ - Check.numeric.maximum = function (test, maximum) { - Check.typeOf.number(test); - Check.typeOf.number(maximum); - if (test > maximum) { - throw new DeveloperError('Expected ' + test + ' to be at most ' + maximum); + Check.typeOf.func = function (name, test) { + if (typeof test !== 'function') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); } }; /** - * Throws if test is less than minimum + * Throws if test is not typeof 'string' * - * @param {Number} test The value to test - * @param {Number} minimum The minimum allowed value - * @exception {DeveloperError} test must not be less than mininum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'string' */ - Check.numeric.minimum = function (test, minimum) { - Check.typeOf.number(test); - Check.typeOf.number(minimum); - if (test < minimum) { - throw new DeveloperError('Expected ' + test + ' to be at least ' + minimum); + Check.typeOf.string = function (name, test) { + if (typeof test !== 'string') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); } }; /** - * Throws if test is not typeof 'function' + * Throws if test is not typeof 'number' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'function' + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'number' */ - Check.typeOf.function = function (test, name) { - if (typeof test !== 'function') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); + Check.typeOf.number = function (name, test) { + if (typeof test !== 'number') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); } }; /** - * Throws if test is not typeof 'string' + * Throws if test is not typeof 'number' and less than limit * + * @param {String} name The name of the variable being tested * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than limit + */ + Check.typeOf.number.lessThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test >= limit) { + throw new DeveloperError('Expected ' + name + ' to be less than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and less than or equal to limit + * * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'string' + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than or equal to limit */ - Check.typeOf.string = function (test, name) { - if (typeof test !== 'string') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); + Check.typeOf.number.lessThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test > limit) { + throw new DeveloperError('Expected ' + name + ' to be less than or equal to ' + limit + ', actual value was ' + test); } }; /** - * Throws if test is not typeof 'number' + * Throws if test is not typeof 'number' and greater than limit * + * @param {String} name The name of the variable being tested * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than limit + */ + Check.typeOf.number.greaterThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test <= limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and greater than or equal to limit + * * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'number' + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than or equal to limit */ - Check.typeOf.number = function (test, name) { - if (typeof test !== 'number') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); + Check.typeOf.number.greaterThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test < limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than or equal to' + limit + ', actual value was ' + test); } }; /** * Throws if test is not typeof 'object' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested + * @param {*} test The value to test * @exception {DeveloperError} test must be typeof 'object' */ - Check.typeOf.object = function (test, name) { + Check.typeOf.object = function (name, test) { if (typeof test !== 'object') { throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'object', name)); } @@ -350,11 +283,11 @@ define('Core/Check',[ /** * Throws if test is not typeof 'boolean' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested + * @param {*} test The value to test * @exception {DeveloperError} test must be typeof 'boolean' */ - Check.typeOf.boolean = function (test, name) { + Check.typeOf.bool = function (name, test) { if (typeof test !== 'boolean') { throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'boolean', name)); } @@ -363,6 +296,68 @@ define('Core/Check',[ return Check; }); +/*global define*/ +define('Core/freezeObject',[ + './defined' + ], function( + defined) { + 'use strict'; + + /** + * Freezes an object, using Object.freeze if available, otherwise returns + * the object unchanged. This function should be used in setup code to prevent + * errors from completely halting JavaScript execution in legacy browsers. + * + * @private + * + * @exports freezeObject + */ + var freezeObject = Object.freeze; + if (!defined(freezeObject)) { + freezeObject = function(o) { + return o; + }; + } + + return freezeObject; +}); + +/*global define*/ +define('Core/defaultValue',[ + './freezeObject' + ], function( + freezeObject) { + 'use strict'; + + /** + * Returns the first parameter if not undefined, otherwise the second parameter. + * Useful for setting a default value for a parameter. + * + * @exports defaultValue + * + * @param {*} a + * @param {*} b + * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter. + * + * @example + * param = Cesium.defaultValue(param, 'default'); + */ + function defaultValue(a, b) { + if (a !== undefined) { + return a; + } + return b; + } + + /** + * A frozen empty object that can be used as the default value for options passed as + * an object literal. + */ + defaultValue.EMPTY_OBJECT = freezeObject({}); + + return defaultValue; +}); + /* I've wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace so it's better encapsulated. Now you can have multiple random number generators @@ -1047,7 +1042,7 @@ define('Core/Math',[ if (!defined(angle)) { throw new DeveloperError('angle is required.'); } - + return CesiumMath.clamp(angle, -1*CesiumMath.PI_OVER_TWO, CesiumMath.PI_OVER_TWO); }; @@ -1057,11 +1052,11 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [<code>-CesiumMath.PI</code>, <code>CesiumMath.PI</code>]. */ - CesiumMath.negativePiToPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.negativePiToPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - return CesiumMath.zeroToTwoPi(x + CesiumMath.PI) - CesiumMath.PI; + return CesiumMath.zeroToTwoPi(angle + CesiumMath.PI) - CesiumMath.PI; }; /** @@ -1070,12 +1065,12 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [0, <code>CesiumMath.TWO_PI</code>]. */ - CesiumMath.zeroToTwoPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.zeroToTwoPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - var mod = CesiumMath.mod(x, CesiumMath.TWO_PI); - if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(x) > CesiumMath.EPSILON14) { + var mod = CesiumMath.mod(angle, CesiumMath.TWO_PI); + if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(angle) > CesiumMath.EPSILON14) { return CesiumMath.TWO_PI; } return mod; @@ -1145,7 +1140,7 @@ define('Core/Math',[ * @example * //Compute 7!, which is equal to 5040 * var computedFactorial = Cesium.Math.factorial(7); - * + * * @see {@link http://en.wikipedia.org/wiki/Factorial|Factorial on Wikipedia} */ CesiumMath.factorial = function(n) { @@ -1429,7 +1424,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.fromSpherical = function(spherical, result) { - Check.typeOf.object(spherical, 'spherical'); + Check.typeOf.object('spherical', spherical); if (!defined(result)) { result = new Cartesian3(); @@ -1513,8 +1508,8 @@ define('Core/Cartesian3',[ * @returns {Number[]} The array that was packed into */ Cartesian3.pack = function(value, array, startingIndex) { - Check.typeOf.object(value, 'value'); - Check.defined(array, 'array'); + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1534,7 +1529,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.unpack = function(array, startingIndex, result) { - Check.defined(array, 'array'); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1555,7 +1550,7 @@ define('Core/Cartesian3',[ * @returns {Number[]} The packed array. */ Cartesian3.packArray = function(array, result) { - Check.defined(array, 'array'); + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -1578,8 +1573,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3[]} The unpacked array. */ Cartesian3.unpackArray = function(array, result) { - Check.defined(array, 'array'); - Check.numeric.minimum(array.length, 3); + Check.defined('array', array); + Check.typeOf.number.greaterThanOrEquals('array.length', array.length, 3); if (array.length % 3 !== 0) { throw new DeveloperError('array length must be a multiple of 3.'); } @@ -1625,7 +1620,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the maximum component. */ Cartesian3.maximumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z); }; @@ -1637,7 +1632,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the minimum component. */ Cartesian3.minimumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z); }; @@ -1651,9 +1646,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the minimum components. */ Cartesian3.minimumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -1671,9 +1666,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the maximum components. */ Cartesian3.maximumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -1688,7 +1683,7 @@ define('Core/Cartesian3',[ * @returns {Number} The squared magnitude. */ Cartesian3.magnitudeSquared = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z; }; @@ -1717,8 +1712,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distance(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(2.0, 0.0, 0.0)); */ Cartesian3.distance = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitude(distanceScratch); @@ -1737,8 +1732,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distanceSquared(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(3.0, 0.0, 0.0)); */ Cartesian3.distanceSquared = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitudeSquared(distanceScratch); @@ -1752,8 +1747,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.normalize = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian3.magnitude(cartesian); @@ -1776,8 +1771,8 @@ define('Core/Cartesian3',[ * @returns {Number} The dot product. */ Cartesian3.dot = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z; }; @@ -1791,9 +1786,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyComponents = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -1835,9 +1830,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.add = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -1854,9 +1849,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.subtract = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -1873,9 +1868,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -1892,9 +1887,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.divideByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -1910,8 +1905,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.negate = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -1927,8 +1922,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.abs = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -1947,10 +1942,10 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.lerp = function(start, end, t, result) { - Check.typeOf.object(start, 'start'); - Check.typeOf.object(end, 'end'); - Check.typeOf.number(t, 't'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian3.multiplyByScalar(end, t, lerpScratch); result = Cartesian3.multiplyByScalar(start, 1.0 - t, result); @@ -1967,8 +1962,8 @@ define('Core/Cartesian3',[ * @returns {Number} The angle between the Cartesians. */ Cartesian3.angleBetween = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.normalize(left, angleBetweenScratch); Cartesian3.normalize(right, angleBetweenScratch2); @@ -1986,8 +1981,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The most orthogonal axis. */ Cartesian3.mostOrthogonalAxis = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian3.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian3.abs(f, f); @@ -2064,9 +2059,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The cross product. */ Cartesian3.cross = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var leftX = left.x; var leftY = left.y; @@ -2099,8 +2094,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromDegrees(-115.0, 37.0); */ Cartesian3.fromDegrees = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); longitude = CesiumMath.toRadians(longitude); latitude = CesiumMath.toRadians(latitude); @@ -2125,8 +2120,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromRadians(-2.007, 0.645); */ Cartesian3.fromRadians = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); height = defaultValue(height, 0.0); var radiiSquared = defined(ellipsoid) ? ellipsoid.radiiSquared : wgs84RadiiSquared; @@ -2160,7 +2155,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArray([-115.0, 37.0, -107.0, 33.0]); */ Cartesian3.fromDegreesArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -2194,7 +2189,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArray([-2.007, 0.645, -1.867, .575]); */ Cartesian3.fromRadiansArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -2228,7 +2223,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArrayHeights([-115.0, 37.0, 100000.0, -107.0, 33.0, 150000.0]); */ Cartesian3.fromDegreesArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -2263,7 +2258,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArrayHeights([-2.007, 0.645, 100000.0, -1.867, .575, 150000.0]); */ Cartesian3.fromRadiansArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -3010,7 +3005,9 @@ define('Core/Ellipsoid',[ /** * Computes an Ellipsoid from a Cartesian specifying the radii in x, y, and z directions. * - * @param {Cartesian3} [radii=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Cartesian3} [cartesian=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new + * instance should be created. * @returns {Ellipsoid} A new Ellipsoid instance. * * @exception {DeveloperError} All radii components must be greater than or equal to zero. @@ -3650,6 +3647,7 @@ define('Core/Interval',[ /*global define*/ define('Core/Matrix3',[ './Cartesian3', + './Check', './defaultValue', './defined', './defineProperties', @@ -3658,6 +3656,7 @@ define('Core/Matrix3',[ './Math' ], function( Cartesian3, + Check, defaultValue, defined, defineProperties, @@ -3720,13 +3719,8 @@ define('Core/Matrix3',[ * @returns {Number[]} The array that was packed into */ Matrix3.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3752,9 +3746,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. */ Matrix3.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3781,24 +3773,24 @@ define('Core/Matrix3',[ * @param {Matrix3} [result] The object onto which to store the result. * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. (Returns undefined if matrix is undefined) */ - Matrix3.clone = function(values, result) { - if (!defined(values)) { + Matrix3.clone = function(matrix, result) { + if (!defined(matrix)) { return undefined; } if (!defined(result)) { - return new Matrix3(values[0], values[3], values[6], - values[1], values[4], values[7], - values[2], values[5], values[8]); + return new Matrix3(matrix[0], matrix[3], matrix[6], + matrix[1], matrix[4], matrix[7], + matrix[2], matrix[5], matrix[8]); } - result[0] = values[0]; - result[1] = values[1]; - result[2] = values[2]; - result[3] = values[3]; - result[4] = values[4]; - result[5] = values[5]; - result[6] = values[6]; - result[7] = values[7]; - result[8] = values[8]; + result[0] = matrix[0]; + result[1] = matrix[1]; + result[2] = matrix[2]; + result[3] = matrix[3]; + result[4] = matrix[4]; + result[5] = matrix[5]; + result[6] = matrix[6]; + result[7] = matrix[7]; + result[8] = matrix[8]; return result; }; @@ -3824,9 +3816,7 @@ define('Core/Matrix3',[ * var m2 = Cesium.Matrix3.fromArray(v2, 2); */ Matrix3.fromArray = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3854,9 +3844,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values parameter is required'); - } + Check.defined('values', values); return Matrix3.clone(values, result); }; @@ -3870,9 +3858,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix3(values[0], values[1], values[2], @@ -3899,9 +3885,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this quaternion. */ Matrix3.fromQuaternion = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); var x2 = quaternion.x * quaternion.x; var xy = quaternion.x * quaternion.y; @@ -3951,10 +3935,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this headingPitchRoll. */ Matrix3.fromHeadingPitchRoll = function(headingPitchRoll, result) { - if (!defined(headingPitchRoll)) { - throw new DeveloperError('headingPitchRoll is required'); - } - var cosTheta = Math.cos(-headingPitchRoll.pitch); + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + + var cosTheta = Math.cos(-headingPitchRoll.pitch); var cosPsi = Math.cos(-headingPitchRoll.heading); var cosPhi = Math.cos(headingPitchRoll.roll); var sinTheta = Math.sin(-headingPitchRoll.pitch); @@ -4005,9 +3988,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix3( @@ -4043,9 +4024,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromUniformScale(2.0); */ Matrix3.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix3( @@ -4069,7 +4048,7 @@ define('Core/Matrix3',[ /** * Computes a Matrix3 instance representing the cross product equivalent matrix of a Cartesian3 vector. * - * @param {Cartesian3} the vector on the left hand side of the cross product operation. + * @param {Cartesian3} vector the vector on the left hand side of the cross product operation. * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created. * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. * @@ -4081,9 +4060,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromCrossProduct(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromCrossProduct = function(vector, result) { - if (!defined(vector)) { - throw new DeveloperError('vector is required.'); - } + Check.typeOf.object('vector', vector); if (!defined(result)) { return new Matrix3( @@ -4118,9 +4095,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationX = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4159,9 +4134,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationY = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4200,9 +4173,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationZ = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4236,9 +4207,7 @@ define('Core/Matrix3',[ * @returns {Number[]} The modified Array parameter or a new Array instance if one was not provided. */ Matrix3.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5], matrix[6], matrix[7], matrix[8]]; @@ -4272,12 +4241,10 @@ define('Core/Matrix3',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix3.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 2) { - throw new DeveloperError('row must be 0, 1, or 2.'); - } - if (typeof column !== 'number' || column < 0 || column > 2) { - throw new DeveloperError('column must be 0, 1, or 2.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 2); + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 2); return column * 3 + row; }; @@ -4293,16 +4260,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var startIndex = index * 3; var x = matrix[startIndex]; @@ -4327,18 +4288,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); var startIndex = index * 3; @@ -4359,15 +4313,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 3]; @@ -4391,18 +4340,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); result[index] = cartesian.x; @@ -4421,12 +4363,8 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[3], matrix[4], matrix[5], scratchColumn)); @@ -4457,15 +4395,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var column0Row0 = left[0] * right[0] + left[3] * right[1] + left[6] * right[2]; var column0Row1 = left[1] * right[0] + left[4] * right[1] + left[7] * right[2]; @@ -4500,15 +4432,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -4531,15 +4457,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -4562,15 +4482,9 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -4595,15 +4509,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -4634,15 +4542,9 @@ define('Core/Matrix3',[ * @see Matrix3.multiplyByUniformScale */ Matrix3.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); result[0] = matrix[0] * scale.x; result[1] = matrix[1] * scale.x; @@ -4664,12 +4566,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -4691,12 +4589,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var column0Row0 = matrix[0]; var column0Row1 = matrix[3]; @@ -4836,9 +4730,7 @@ define('Core/Matrix3',[ * var c = Cesium.Cartesian3.multiplyByScalar(v, lambda, new Cesium.Cartesian3()); // equal to Cesium.Matrix3.multiplyByVector(a, v) */ Matrix3.computeEigenDecomposition = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); // This routine was created based upon Matrix Computations, 3rd ed., by Golub and Van Loan, // section 8.4.3 The Classical Jacobi Algorithm @@ -4882,12 +4774,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -4909,9 +4797,7 @@ define('Core/Matrix3',[ * @returns {Number} The value of the determinant of the matrix. */ Matrix3.determinant = function(matrix) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); var m11 = matrix[0]; var m21 = matrix[3]; @@ -4936,12 +4822,8 @@ define('Core/Matrix3',[ * @exception {DeveloperError} matrix is not invertible. */ Matrix3.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var m11 = matrix[0]; var m21 = matrix[1]; @@ -5007,9 +4889,7 @@ define('Core/Matrix3',[ * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. */ Matrix3.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -5197,12 +5077,14 @@ define('Core/Matrix3',[ /*global define*/ define('Core/Cartesian4',[ + './Check', './defaultValue', './defined', './DeveloperError', './freezeObject', './Math' ], function( + Check, defaultValue, defined, DeveloperError, @@ -5285,9 +5167,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.fromColor = function(color, result) { - if (!defined(color)) { - throw new DeveloperError('color is required'); - } + Check.typeOf.object('color', color); if (!defined(result)) { return new Cartesian4(color.red, color.green, color.blue, color.alpha); } @@ -5339,12 +5219,8 @@ define('Core/Cartesian4',[ * @returns {Number[]} The array that was packed into */ Cartesian4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5365,9 +5241,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5389,9 +5263,7 @@ define('Core/Cartesian4',[ * @returns {Number[]} The packed array. */ Cartesian4.packArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -5414,9 +5286,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4[]} The unpacked array. */ Cartesian4.unpackArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -5459,9 +5329,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the maximum component. */ Cartesian4.maximumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -5473,9 +5341,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the minimum component. */ Cartesian4.minimumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -5489,15 +5355,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the minimum components. */ Cartesian4.minimumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -5516,15 +5376,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the maximum components. */ Cartesian4.maximumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -5541,9 +5395,7 @@ define('Core/Cartesian4',[ * @returns {Number} The squared magnitude. */ Cartesian4.magnitudeSquared = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z + cartesian.w * cartesian.w; }; @@ -5574,9 +5426,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(2.0, 0.0, 0.0, 0.0)); */ Cartesian4.distance = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitude(distanceScratch); @@ -5597,9 +5448,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(3.0, 0.0, 0.0, 0.0)); */ Cartesian4.distanceSquared = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitudeSquared(distanceScratch); @@ -5613,12 +5463,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.normalize = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian4.magnitude(cartesian); @@ -5642,12 +5488,8 @@ define('Core/Cartesian4',[ * @returns {Number} The dot product. */ Cartesian4.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w; }; @@ -5661,15 +5503,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -5687,15 +5523,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x / right.x; result.y = left.y / right.y; @@ -5713,15 +5543,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -5739,15 +5563,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -5765,15 +5583,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -5791,15 +5603,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -5816,12 +5622,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.negate = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -5838,12 +5640,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.abs = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -5863,18 +5661,10 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian4.multiplyByScalar(end, t, lerpScratch); result = Cartesian4.multiplyByScalar(start, 1.0 - t, result); @@ -5890,12 +5680,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The most orthogonal axis. */ Cartesian4.mostOrthogonalAxis = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian4.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian4.abs(f, f); @@ -6140,6 +5926,7 @@ define('Core/RuntimeError',[ define('Core/Matrix4',[ './Cartesian3', './Cartesian4', + './Check', './defaultValue', './defined', './defineProperties', @@ -6151,6 +5938,7 @@ define('Core/Matrix4',[ ], function( Cartesian3, Cartesian4, + Check, defaultValue, defined, defineProperties, @@ -6241,13 +6029,8 @@ define('Core/Matrix4',[ * @returns {Number[]} The array that was packed into */ Matrix4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -6280,9 +6063,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if one was not provided. */ Matrix4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -6378,9 +6159,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required'); - } + Check.defined('values', values); return Matrix4.clone(values, result); }; @@ -6394,9 +6173,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix4(values[0], values[1], values[2], values[3], @@ -6433,9 +6210,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRotationTranslation = function(rotation, translation, result) { - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } + Check.typeOf.object('rotation', rotation); translation = defaultValue(translation, Cartesian3.ZERO); @@ -6483,15 +6258,9 @@ define('Core/Matrix4',[ * result); */ Matrix4.fromTranslationQuaternionRotationScale = function(translation, rotation, scale, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('translation', translation); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('scale', scale); if (!defined(result)) { result = new Matrix4(); @@ -6552,9 +6321,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromTranslationRotationScale = function(translationRotationScale, result) { - if (!defined(translationRotationScale)) { - throw new DeveloperError('translationRotationScale is required.'); - } + Check.typeOf.object('translationRotationScale', translationRotationScale); return Matrix4.fromTranslationQuaternionRotationScale(translationRotationScale.translation, translationRotationScale.rotation, translationRotationScale.scale, result); }; @@ -6569,9 +6336,7 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByTranslation */ Matrix4.fromTranslation = function(translation, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } + Check.typeOf.object('translation', translation); return Matrix4.fromRotationTranslation(Matrix3.IDENTITY, translation, result); }; @@ -6592,9 +6357,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix4.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix4( @@ -6639,9 +6402,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromUniformScale(2.0); */ Matrix4.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix4(scale, 0.0, 0.0, 0.0, @@ -6681,23 +6442,15 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromCamera = function(camera, result) { - if (!defined(camera)) { - throw new DeveloperError('camera is required.'); - } + Check.typeOf.object('camera', camera); var position = camera.position; var direction = camera.direction; var up = camera.up; - if (!defined(position)) { - throw new DeveloperError('camera.position is required.'); - } - if (!defined(direction)) { - throw new DeveloperError('camera.direction is required.'); - } - if (!defined(up)) { - throw new DeveloperError('camera.up is required.'); - } + Check.typeOf.object('camera.position', position); + Check.typeOf.object('camera.direction', direction); + Check.typeOf.object('camera.up', up); Cartesian3.normalize(direction, fromCameraF); Cartesian3.normalize(Cartesian3.cross(fromCameraF, up, fromCameraR), fromCameraR); @@ -6776,21 +6529,11 @@ define('Core/Matrix4',[ * @exception {DeveloperError} far must be greater than zero. */ Matrix4.computePerspectiveFieldOfView = function(fovY, aspectRatio, near, far, result) { - if (fovY <= 0.0 || fovY > Math.PI) { - throw new DeveloperError('fovY must be in (0, PI].'); - } - if (aspectRatio <= 0.0) { - throw new DeveloperError('aspectRatio must be greater than zero.'); - } - if (near <= 0.0) { - throw new DeveloperError('near must be greater than zero.'); - } - if (far <= 0.0) { - throw new DeveloperError('far must be greater than zero.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThan('fovY', fovY, 0.0); + Check.typeOf.number.lessThan('fovY', fovY, Math.PI); + Check.typeOf.number.greaterThan('near', near, 0.0); + Check.typeOf.number.greaterThan('far', far, 0.0); + Check.typeOf.object('result', result); var bottom = Math.tan(fovY * 0.5); @@ -6831,27 +6574,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeOrthographicOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var a = 1.0 / (right - left); var b = 1.0 / (top - bottom); @@ -6896,27 +6625,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computePerspectiveOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -6946,35 +6661,23 @@ define('Core/Matrix4',[ }; /** - * Computes a Matrix4 instance representing an infinite off center perspective transformation. - * - * @param {Number} left The number of meters to the left of the camera that will be in view. - * @param {Number} right The number of meters to the right of the camera that will be in view. - * @param {Number} bottom The number of meters below of the camera that will be in view. - * @param {Number} top The number of meters above of the camera that will be in view. - * @param {Number} near The distance to the near plane in meters. - * @param {Matrix4} result The object in which the result will be stored. - * @returns {Matrix4} The modified result parameter. - */ - Matrix4.computeInfinitePerspectiveOffCenter = function(left, right, bottom, top, near, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + * Computes a Matrix4 instance representing an infinite off center perspective transformation. + * + * @param {Number} left The number of meters to the left of the camera that will be in view. + * @param {Number} right The number of meters to the right of the camera that will be in view. + * @param {Number} bottom The number of meters below of the camera that will be in view. + * @param {Number} top The number of meters above of the camera that will be in view. + * @param {Number} near The distance to the near plane in meters. + * @param {Matrix4} result The object in which the result will be stored. + * @returns {Matrix4} The modified result parameter. + */ + Matrix4.computeInfinitePerspectiveOffCenter = function(left, right, bottom, top, near, result) { + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -7022,9 +6725,7 @@ define('Core/Matrix4',[ * }, 0.0, 1.0, new Cesium.Matrix4()); */ Matrix4.computeViewportTransformation = function(viewport, nearDepthRange, farDepthRange, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); viewport = defaultValue(viewport, defaultValue.EMPTY_OBJECT); var x = defaultValue(viewport.x, 0.0); @@ -7076,21 +6777,11 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeView = function(position, direction, up, right, result) { - if (!defined(position)) { - throw new DeveloperError('position is required'); - } - if (!defined(direction)) { - throw new DeveloperError('direction is required'); - } - if (!defined(up)) { - throw new DeveloperError('up is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); + Check.typeOf.object('up', up); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = right.x; result[1] = up.x; @@ -7131,9 +6822,7 @@ define('Core/Matrix4',[ * //creates a = [10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0] */ Matrix4.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], @@ -7177,12 +6866,11 @@ define('Core/Matrix4',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix4.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 3) { - throw new DeveloperError('row must be 0, 1, 2, or 3.'); - } - if (typeof column !== 'number' || column < 0 || column > 3) { - throw new DeveloperError('column must be 0, 1, 2, or 3.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 3); + + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 3); return column * 4 + row; }; @@ -7215,16 +6903,12 @@ define('Core/Matrix4',[ * // a.x = 12.0; a.y = 16.0; a.z = 20.0; a.w = 24.0; */ Matrix4.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var startIndex = index * 4; var x = matrix[startIndex]; @@ -7266,18 +6950,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 96.0, 25.0] */ Matrix4.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); var startIndex = index * 4; @@ -7298,15 +6977,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.setTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -7359,16 +7032,12 @@ define('Core/Matrix4',[ * // a.x = 18.0; a.y = 19.0; a.z = 20.0; a.w = 21.0; */ Matrix4.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 4]; @@ -7409,18 +7078,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 24.0, 25.0] */ Matrix4.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); result[index] = cartesian.x; @@ -7440,12 +7104,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter */ Matrix4.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[4], matrix[5], matrix[6], scratchColumn)); @@ -7477,15 +7137,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -7569,15 +7223,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -7607,15 +7255,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -7656,15 +7298,9 @@ define('Core/Matrix4',[ * var m3 = Cesium.Matrix4.multiplyTransformation(m1, m2, new Cesium.Matrix4()); */ Matrix4.multiplyTransformation = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -7742,15 +7378,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByMatrix3(m, rotation, m); */ Matrix4.multiplyByMatrix3 = function(matrix, rotation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('result', result); var left0 = matrix[0]; var left1 = matrix[1]; @@ -7818,15 +7448,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByTranslation(m, position, m); */ Matrix4.multiplyByTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); var x = translation.x; var y = translation.y; @@ -7878,15 +7502,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByScale */ Matrix4.multiplyByUniformScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scale', scale); + Check.typeOf.object('result', result); uniformScaleScratch.x = scale; uniformScaleScratch.y = scale; @@ -7915,15 +7533,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByUniformScale */ Matrix4.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); var scaleX = scale.x; var scaleY = scale.y; @@ -7962,15 +7574,9 @@ define('Core/Matrix4',[ * @returns {Cartesian4} The modified result parameter. */ Matrix4.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8006,15 +7612,9 @@ define('Core/Matrix4',[ * // Cesium.Matrix4.multiplyByVector(matrix, new Cesium.Cartesian4(p.x, p.y, p.z, 0.0), result); */ Matrix4.multiplyByPointAsVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8044,16 +7644,9 @@ define('Core/Matrix4',[ * var result = Cesium.Matrix4.multiplyByPoint(matrix, p, new Cesium.Cartesian3()); */ Matrix4.multiplyByPoint = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8093,15 +7686,9 @@ define('Core/Matrix4',[ * // [-44.0, -46.0, -48.0, -50.0] */ Matrix4.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -8145,12 +7732,8 @@ define('Core/Matrix4',[ * // [-22.0, -23.0, -24.0, -25.0] */ Matrix4.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -8194,12 +7777,8 @@ define('Core/Matrix4',[ * // [13.0, 17.0, 21.0, 25.0] */ Matrix4.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var matrix1 = matrix[1]; var matrix2 = matrix[2]; @@ -8235,12 +7814,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -8354,9 +7929,7 @@ define('Core/Matrix4',[ * //Prints "Difference between both the matrices is not less than 0.1" on the console */ Matrix4.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -8387,12 +7960,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter. */ Matrix4.getTranslation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = matrix[12]; result.y = matrix[13]; @@ -8423,12 +7992,8 @@ define('Core/Matrix4',[ * // [12.0, 16.0, 20.0] */ Matrix4.getRotation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -8460,12 +8025,8 @@ define('Core/Matrix4',[ * @exception {RuntimeError} matrix is not invertible because its determinate is zero. */ Matrix4.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); // Special case for a zero scale matrix that can occur, for example, // when a model's node has a [0, 0, 0] scale. @@ -8603,12 +8164,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.inverseTransformation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); //This function is an optimized version of the below 4 lines. //var rT = Matrix3.transpose(Matrix4.getRotation(matrix)); @@ -8892,6 +8449,7 @@ define('Core/Matrix4',[ /*global define*/ define('Core/Rectangle',[ './Cartographic', + './Check', './defaultValue', './defined', './defineProperties', @@ -8901,6 +8459,7 @@ define('Core/Rectangle',[ './Math' ], function( Cartographic, + Check, defaultValue, defined, defineProperties, @@ -8997,13 +8556,8 @@ define('Core/Rectangle',[ * @returns {Number[]} The array that was packed into */ Rectangle.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -9024,9 +8578,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -9047,9 +8599,7 @@ define('Core/Rectangle',[ * @returns {Number} The width. */ Rectangle.computeWidth = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; if (east < west) { @@ -9064,9 +8614,7 @@ define('Core/Rectangle',[ * @returns {Number} The height. */ Rectangle.computeHeight = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); return rectangle.north - rectangle.south; }; @@ -9101,6 +8649,32 @@ define('Core/Rectangle',[ return result; }; + /** + * Creates an rectangle given the boundary longitude and latitude in radians. + * + * @param {Number} [west=0.0] The westernmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [south=0.0] The southernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Number} [east=0.0] The easternmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [north=0.0] The northernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Rectangle} [result] The object onto which to store the result, or undefined if a new instance should be created. + * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. + * + * @example + * var rectangle = Cesium.Rectangle.fromRadians(0.0, Math.PI/4, Math.PI/8, 3*Math.PI/4); + */ + Rectangle.fromRadians = function(west, south, east, north, result) { + if (!defined(result)) { + return new Rectangle(west, south, east, north); + } + + result.west = defaultValue(west, 0.0); + result.south = defaultValue(south, 0.0); + result.east = defaultValue(east, 0.0); + result.north = defaultValue(north, 0.0); + + return result; + }; + /** * Creates the smallest possible Rectangle that encloses all positions in the provided array. * @@ -9109,9 +8683,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartographicArray = function(cartographics, result) { - if (!defined(cartographics)) { - throw new DeveloperError('cartographics is required.'); - } + Check.defined('cartographics', cartographics); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -9164,9 +8736,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartesianArray = function(cartesians, ellipsoid, result) { - if (!defined(cartesians)) { - throw new DeveloperError('cartesians is required.'); - } + Check.defined('cartesians', cartesians); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -9282,9 +8852,7 @@ define('Core/Rectangle',[ * @returns {Boolean} <code>true</code> if the Rectangles are within the provided epsilon, <code>false</code> otherwise. */ Rectangle.prototype.equalsEpsilon = function(other, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon is required and must be a number.'); - } + Check.typeOf.number('epsilon', epsilon); return defined(other) && (Math.abs(this.west - other.west) <= epsilon) && @@ -9304,45 +8872,23 @@ define('Core/Rectangle',[ * @exception {DeveloperError} <code>west</code> must be in the interval [<code>-Pi</code>, <code>Pi</code>]. */ Rectangle.validate = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var north = rectangle.north; - if (typeof north !== 'number') { - throw new DeveloperError('north is required to be a number.'); - } - - if (north < -CesiumMath.PI_OVER_TWO || north > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('north must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('north', north, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('north', north, CesiumMath.PI_OVER_TWO); var south = rectangle.south; - if (typeof south !== 'number') { - throw new DeveloperError('south is required to be a number.'); - } - - if (south < -CesiumMath.PI_OVER_TWO || south > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('south must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('south', south, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('south', south, CesiumMath.PI_OVER_TWO); var west = rectangle.west; - if (typeof west !== 'number') { - throw new DeveloperError('west is required to be a number.'); - } - - if (west < -Math.PI || west > Math.PI) { - throw new DeveloperError('west must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('west', west, -Math.PI); + Check.typeOf.number.lessThanOrEquals('west', west, Math.PI); var east = rectangle.east; - if (typeof east !== 'number') { - throw new DeveloperError('east is required to be a number.'); - } - - if (east < -Math.PI || east > Math.PI) { - throw new DeveloperError('east must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('east', east, -Math.PI); + Check.typeOf.number.lessThanOrEquals('east', east, Math.PI); }; /** @@ -9353,9 +8899,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.south); @@ -9374,9 +8918,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.north); @@ -9395,9 +8937,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.north); @@ -9416,9 +8956,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.south); @@ -9437,9 +8975,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.center = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; @@ -9474,12 +9010,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.intersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var rectangleEast = rectangle.east; var rectangleWest = rectangle.west; @@ -9535,12 +9067,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.simpleIntersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var west = Math.max(rectangle.west, otherRectangle.west); var south = Math.max(rectangle.south, otherRectangle.south); @@ -9571,12 +9099,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.union = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); if (!defined(result)) { result = new Rectangle(); @@ -9620,12 +9144,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.expand = function(rectangle, cartographic, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); if (!defined(result)) { result = new Rectangle(); @@ -9645,14 +9165,10 @@ define('Core/Rectangle',[ * @param {Rectangle} rectangle The rectangle * @param {Cartographic} cartographic The cartographic to test. * @returns {Boolean} true if the provided cartographic is inside the rectangle, false otherwise. - */ - Rectangle.contains = function(rectangle, cartographic) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + */ + Rectangle.contains = function(rectangle, cartographic) { + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); var longitude = cartographic.longitude; var latitude = cartographic.latitude; @@ -9685,9 +9201,7 @@ define('Core/Rectangle',[ * @returns {Cartesian3[]} The modified result parameter or a new Array of Cartesians instances if none was provided. */ Rectangle.subsample = function(rectangle, ellipsoid, surfaceHeight, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84); surfaceHeight = defaultValue(surfaceHeight, 0.0); @@ -9765,9 +9279,9 @@ define('Core/Rectangle',[ define('Core/BoundingSphere',[ './Cartesian3', './Cartographic', + './Check', './defaultValue', './defined', - './DeveloperError', './Ellipsoid', './GeographicProjection', './Intersect', @@ -9778,9 +9292,9 @@ define('Core/BoundingSphere',[ ], function( Cartesian3, Cartographic, + Check, defaultValue, defined, - DeveloperError, Ellipsoid, GeographicProjection, Intersect, @@ -10110,9 +9624,7 @@ define('Core/BoundingSphere',[ stride = defaultValue(stride, 3); - if (stride < 3) { - throw new DeveloperError('stride must be 3 or greater.'); - } + Check.typeOf.number.greaterThanOrEquals('stride', stride, 3); var currentPos = fromPointsCurrentPos; currentPos.x = positions[0] + center.x; @@ -10416,9 +9928,8 @@ define('Core/BoundingSphere',[ * var sphere = Cesium.BoundingSphere.fromCornerPoints(new Cesium.Cartesian3(-0.5, -0.5, -0.5), new Cesium.Cartesian3(0.5, 0.5, 0.5)); */ BoundingSphere.fromCornerPoints = function(corner, oppositeCorner, result) { - if (!defined(corner) || !defined(oppositeCorner)) { - throw new DeveloperError('corner and oppositeCorner are required.'); - } + Check.typeOf.object('corner', corner); + Check.typeOf.object('oppositeCorner', oppositeCorner); if (!defined(result)) { result = new BoundingSphere(); @@ -10442,9 +9953,7 @@ define('Core/BoundingSphere',[ * var boundingSphere = Cesium.BoundingSphere.fromEllipsoid(ellipsoid); */ BoundingSphere.fromEllipsoid = function(ellipsoid, result) { - if (!defined(ellipsoid)) { - throw new DeveloperError('ellipsoid is required.'); - } + Check.typeOf.object('ellipsoid', ellipsoid); if (!defined(result)) { result = new BoundingSphere(); @@ -10570,13 +10079,8 @@ define('Core/BoundingSphere',[ * @returns {Number[]} The array that was packed into */ BoundingSphere.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -10598,9 +10102,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if one was not provided. */ BoundingSphere.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -10627,13 +10129,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.union = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); if (!defined(result)) { result = new BoundingSphere(); @@ -10682,13 +10179,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.expand = function(sphere, point, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(point)) { - throw new DeveloperError('point is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('point', point); result = BoundingSphere.clone(sphere, result); @@ -10711,13 +10203,8 @@ define('Core/BoundingSphere',[ * intersects the plane. */ BoundingSphere.intersectPlane = function(sphere, plane) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(plane)) { - throw new DeveloperError('plane is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('plane', plane); var center = sphere.center; var radius = sphere.radius; @@ -10743,13 +10230,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.transform = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -10777,12 +10259,8 @@ define('Core/BoundingSphere',[ * }); */ BoundingSphere.distanceSquaredTo = function(sphere, cartesian) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('cartesian', cartesian); var diff = Cartesian3.subtract(sphere.center, cartesian, distanceSquaredToScratch); return Cartesian3.magnitudeSquared(diff) - sphere.radius * sphere.radius; @@ -10804,13 +10282,8 @@ define('Core/BoundingSphere',[ * var newBoundingSphere = Cesium.BoundingSphere.transformWithoutScale(boundingSphere, modelMatrix); */ BoundingSphere.transformWithoutScale = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -10837,17 +10310,9 @@ define('Core/BoundingSphere',[ * @returns {Interval} The nearest and farthest distances on the bounding sphere from position in direction. */ BoundingSphere.computePlaneDistances = function(sphere, position, direction, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(position)) { - throw new DeveloperError('position is required.'); - } - - if (!defined(direction)) { - throw new DeveloperError('direction is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); if (!defined(result)) { result = new Interval(); @@ -10882,9 +10347,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.projectTo2D = function(sphere, projection, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } + Check.typeOf.object('sphere', sphere); projection = defaultValue(projection, projectTo2DProjection); @@ -10979,12 +10442,8 @@ define('Core/BoundingSphere',[ * @returns {Boolean} <code>true</code> if the sphere is not visible; otherwise <code>false</code>. */ BoundingSphere.isOccluded = function(sphere, occluder) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(occluder)) { - throw new DeveloperError('occluder is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('occluder', occluder); return !occluder.isBoundingSphereVisible(sphere); }; @@ -12193,7 +11652,10 @@ define('Core/WebGLConstants',[ COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : 0x9279, TEXTURE_IMMUTABLE_FORMAT : 0x912F, MAX_ELEMENT_INDEX : 0x8D6B, - TEXTURE_IMMUTABLE_LEVELS : 0x82DF + TEXTURE_IMMUTABLE_LEVELS : 0x82DF, + + // Extensions + MAX_TEXTURE_MAX_ANISOTROPY_EXT : 0x84FF }; return freezeObject(WebGLConstants); @@ -12723,7 +12185,7 @@ define('Core/Geometry',[ * <li><code>position</code> - 3D vertex position. 64-bit floating-point (for precision). 3 components per attribute. See {@link VertexFormat#position}.</li> * <li><code>normal</code> - Normal (normalized), commonly used for lighting. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#normal}.</li> * <li><code>st</code> - 2D texture coordinate. 32-bit floating-point. 2 components per attribute. See {@link VertexFormat#st}.</li> - * <li><code>binormal</code> - Binormal (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#binormal}.</li> + * <li><code>bitangent</code> - Bitangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#bitangent}.</li> * <li><code>tangent</code> - Tangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#tangent}.</li> * </ul> * </p> @@ -12752,7 +12214,7 @@ define('Core/Geometry',[ * componentsPerAttribute : 3, * values : new Float32Array(0) * }); - * + * * @see GeometryAttribute * @see VertexFormat */ @@ -13033,7 +12495,7 @@ define('Core/GeometryAttributes',[ this.st = options.st; /** - * The binormal attribute (normalized), which is used for tangent-space effects like bump mapping. + * The bitangent attribute (normalized), which is used for tangent-space effects like bump mapping. * <p> * 32-bit floating-point. 3 components per attribute. * </p> @@ -13042,7 +12504,7 @@ define('Core/GeometryAttributes',[ * * @default undefined */ - this.binormal = options.binormal; + this.bitangent = options.bitangent; /** * The tangent attribute (normalized), which is used for tangent-space effects like bump mapping. @@ -13291,7 +12753,7 @@ define('Core/VertexFormat',[ this.st = defaultValue(options.st, false); /** - * When <code>true</code>, the vertex has a binormal attribute (normalized), which is used for tangent-space effects like bump mapping. + * When <code>true</code>, the vertex has a bitangent attribute (normalized), which is used for tangent-space effects like bump mapping. * <p> * 32-bit floating-point. 3 components per attribute. * </p> @@ -13300,7 +12762,7 @@ define('Core/VertexFormat',[ * * @default false */ - this.binormal = defaultValue(options.binormal, false); + this.bitangent = defaultValue(options.bitangent, false); /** * When <code>true</code>, the vertex has a tangent attribute (normalized), which is used for tangent-space effects like bump mapping. @@ -13402,7 +12864,7 @@ define('Core/VertexFormat',[ })); /** - * An immutable vertex format with well-known attributes: position, normal, st, binormal, and tangent. + * An immutable vertex format with well-known attributes: position, normal, st, tangent, and bitangent. * * @type {VertexFormat} * @constant @@ -13410,15 +12872,15 @@ define('Core/VertexFormat',[ * @see VertexFormat#position * @see VertexFormat#normal * @see VertexFormat#st - * @see VertexFormat#binormal * @see VertexFormat#tangent + * @see VertexFormat#bitangent */ VertexFormat.ALL = freezeObject(new VertexFormat({ position : true, normal : true, st : true, - binormal : true, - tangent : true + tangent : true, + bitangent : true })); /** @@ -13463,8 +12925,8 @@ define('Core/VertexFormat',[ array[startingIndex++] = value.position ? 1.0 : 0.0; array[startingIndex++] = value.normal ? 1.0 : 0.0; array[startingIndex++] = value.st ? 1.0 : 0.0; - array[startingIndex++] = value.binormal ? 1.0 : 0.0; array[startingIndex++] = value.tangent ? 1.0 : 0.0; + array[startingIndex++] = value.bitangent ? 1.0 : 0.0; array[startingIndex++] = value.color ? 1.0 : 0.0; return array; @@ -13489,19 +12951,19 @@ define('Core/VertexFormat',[ result = new VertexFormat(); } - result.position = array[startingIndex++] === 1.0; - result.normal = array[startingIndex++] === 1.0; - result.st = array[startingIndex++] === 1.0; - result.binormal = array[startingIndex++] === 1.0; - result.tangent = array[startingIndex++] === 1.0; - result.color = array[startingIndex++] === 1.0; + result.position = array[startingIndex++] === 1.0; + result.normal = array[startingIndex++] === 1.0; + result.st = array[startingIndex++] === 1.0; + result.tangent = array[startingIndex++] === 1.0; + result.bitangent = array[startingIndex++] === 1.0; + result.color = array[startingIndex++] === 1.0; return result; }; /** * Duplicates a VertexFormat instance. * - * @param {VertexFormat} cartesian The vertex format to duplicate. + * @param {VertexFormat} vertexFormat The vertex format to duplicate. * @param {VertexFormat} [result] The object onto which to store the result. * @returns {VertexFormat} The modified result parameter or a new VertexFormat instance if one was not provided. (Returns undefined if vertexFormat is undefined) */ @@ -13516,8 +12978,8 @@ define('Core/VertexFormat',[ result.position = vertexFormat.position; result.normal = vertexFormat.normal; result.st = vertexFormat.st; - result.binormal = vertexFormat.binormal; result.tangent = vertexFormat.tangent; + result.bitangent = vertexFormat.bitangent; result.color = vertexFormat.color; return result; }; @@ -13760,12 +13222,14 @@ define('Core/AxisAlignedBoundingBox',[ /*global define*/ define('Core/Cartesian2',[ + './Check', './defaultValue', './defined', './DeveloperError', './freezeObject', './Math' ], function( + Check, defaultValue, defined, DeveloperError, @@ -13877,12 +13341,8 @@ define('Core/Cartesian2',[ * @returns {Number[]} The array that was packed into */ Cartesian2.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -13901,9 +13361,7 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided. */ Cartesian2.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -13923,9 +13381,7 @@ define('Core/Cartesian2',[ * @returns {Number[]} The packed array. */ Cartesian2.packArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -13948,9 +13404,7 @@ define('Core/Cartesian2',[ * @returns {Cartesian2[]} The unpacked array. */ Cartesian2.unpackArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -13993,9 +13447,7 @@ define('Core/Cartesian2',[ * @returns {Number} The value of the maximum component. */ Cartesian2.maximumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y); }; @@ -14007,9 +13459,7 @@ define('Core/Cartesian2',[ * @returns {Number} The value of the minimum component. */ Cartesian2.minimumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y); }; @@ -14023,15 +13473,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} A cartesian with the minimum components. */ Cartesian2.minimumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); @@ -14049,15 +13493,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} A cartesian with the maximum components. */ Cartesian2.maximumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -14071,9 +13509,7 @@ define('Core/Cartesian2',[ * @returns {Number} The squared magnitude. */ Cartesian2.magnitudeSquared = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y; }; @@ -14139,12 +13575,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.normalize = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian2.magnitude(cartesian); @@ -14166,12 +13598,8 @@ define('Core/Cartesian2',[ * @returns {Number} The dot product. */ Cartesian2.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y; }; @@ -14185,15 +13613,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.multiplyComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -14209,15 +13631,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.divideComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x / right.x; result.y = left.y / right.y; @@ -14233,15 +13649,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -14257,15 +13667,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -14281,15 +13685,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.multiplyByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -14305,15 +13703,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.divideByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -14328,12 +13720,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.negate = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -14348,12 +13736,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.abs = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -14371,18 +13755,10 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian2.multiplyByScalar(end, t, lerpScratch); result = Cartesian2.multiplyByScalar(start, 1.0 - t, result); @@ -14399,12 +13775,8 @@ define('Core/Cartesian2',[ * @returns {Number} The angle between the Cartesians. */ Cartesian2.angleBetween = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian2.normalize(left, angleBetweenScratch); Cartesian2.normalize(right, angleBetweenScratch2); @@ -14420,12 +13792,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The most orthogonal axis. */ Cartesian2.mostOrthogonalAxis = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian2.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian2.abs(f, f); @@ -15332,6 +14700,7 @@ define('Core/IntersectionTests',[ './defaultValue', './defined', './DeveloperError', + './Interval', './Math', './Matrix3', './QuadraticRealPolynomial', @@ -15343,6 +14712,7 @@ define('Core/IntersectionTests',[ defaultValue, defined, DeveloperError, + Interval, CesiumMath, Matrix3, QuadraticRealPolynomial, @@ -15614,7 +14984,7 @@ define('Core/IntersectionTests',[ function raySphere(ray, sphere, result) { if (!defined(result)) { - result = {}; + result = new Interval(); } var origin = ray.origin; @@ -15645,8 +15015,8 @@ define('Core/IntersectionTests',[ * * @param {Ray} ray The ray. * @param {BoundingSphere} sphere The sphere. - * @param {Object} [result] The result onto which to store the result. - * @returns {Object} An object with the first (<code>start</code>) and the second (<code>stop</code>) intersection scalars for points along the ray or undefined if there are no intersections. + * @param {Interval} [result] The result onto which to store the result. + * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections. */ IntersectionTests.raySphere = function(ray, sphere, result) { if (!defined(ray)) { @@ -15674,8 +15044,8 @@ define('Core/IntersectionTests',[ * @param {Cartesian3} p0 An end point of the line segment. * @param {Cartesian3} p1 The other end point of the line segment. * @param {BoundingSphere} sphere The sphere. - * @param {Object} [result] The result onto which to store the result. - * @returns {Object} An object with the first (<code>start</code>) and the second (<code>stop</code>) intersection scalars for points along the line segment or undefined if there are no intersections. + * @param {Interval} [result] The result onto which to store the result. + * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections. */ IntersectionTests.lineSegmentSphere = function(p0, p1, sphere, result) { if (!defined(p0)) { @@ -15713,7 +15083,7 @@ define('Core/IntersectionTests',[ * * @param {Ray} ray The ray. * @param {Ellipsoid} ellipsoid The ellipsoid. - * @returns {Object} An object with the first (<code>start</code>) and the second (<code>stop</code>) intersection scalars for points along the ray or undefined if there are no intersections. + * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections. */ IntersectionTests.rayEllipsoid = function(ray, ellipsoid) { if (!defined(ray)) { @@ -15755,10 +15125,7 @@ define('Core/IntersectionTests',[ var root0 = temp / w2; var root1 = difference / temp; if (root0 < root1) { - return { - start : root0, - stop : root1 - }; + return new Interval(root0, root1); } return { @@ -15768,10 +15135,7 @@ define('Core/IntersectionTests',[ } else { // qw2 == product. Repeated roots (2 intersections). var root = Math.sqrt(difference / w2); - return { - start : root, - stop : root - }; + return new Interval(root, root); } } else if (q2 < 1.0) { // Inside ellipsoid (2 intersections). @@ -15781,19 +15145,13 @@ define('Core/IntersectionTests',[ discriminant = qw * qw - product; temp = -qw + Math.sqrt(discriminant); // Positively valued. - return { - start : 0.0, - stop : temp / w2 - }; + return new Interval(0.0, temp / w2); } else { // q2 == 1.0. On ellipsoid. if (qw < 0.0) { // Looking inward. w2 = Cartesian3.magnitudeSquared(w); - return { - start : 0.0, - stop : -qw / w2 - }; + return new Interval(0.0, -qw / w2); } // qw >= 0.0. Looking outward or tangent. @@ -17125,138 +16483,26 @@ define('ThirdParty/when',[],function () { // Skip holes if(i in arr) { reduced = reduceFunc(reduced, arr[i], i, arr); - } - } - - return reduced; - }; - - function identity(x) { - return x; - } - - return when; -}); -})(typeof define == 'function' && define.amd - ? define - : function (factory) { typeof exports === 'object' - ? (module.exports = factory()) - : (this.when = factory()); - } - // Boilerplate for AMD, Node, and browser global -); - -/*global define*/ -define('Core/oneTimeWarning',[ - './defaultValue', - './defined', - './DeveloperError' - ], function( - defaultValue, - defined, - DeveloperError) { - "use strict"; - - var warnings = {}; - - /** - * Logs a one time message to the console. Use this function instead of - * <code>console.log</code> directly since this does not log duplicate messages - * unless it is called from multiple workers. - * - * @exports oneTimeWarning - * - * @param {String} identifier The unique identifier for this warning. - * @param {String} [message=identifier] The message to log to the console. - * - * @example - * for(var i=0;i<foo.length;++i) { - * if (!defined(foo[i].bar)) { - * // Something that can be recovered from but may happen a lot - * oneTimeWarning('foo.bar undefined', 'foo.bar is undefined. Setting to 0.'); - * foo[i].bar = 0; - * // ... - * } - * } - * - * @private - */ - function oneTimeWarning(identifier, message) { - if (!defined(identifier)) { - throw new DeveloperError('identifier is required.'); - } - - if (!defined(warnings[identifier])) { - warnings[identifier] = true; - console.log(defaultValue(message, identifier)); - } - } - - oneTimeWarning.geometryOutlines = 'Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.'; + } + } - return oneTimeWarning; -}); + return reduced; + }; -/*global define*/ -define('Core/deprecationWarning',[ - './defined', - './DeveloperError', - './oneTimeWarning' - ], function( - defined, - DeveloperError, - oneTimeWarning) { - 'use strict'; - - /** - * Logs a deprecation message to the console. Use this function instead of - * <code>console.log</code> directly since this does not log duplicate messages - * unless it is called from multiple workers. - * - * @exports deprecationWarning - * - * @param {String} identifier The unique identifier for this deprecated API. - * @param {String} message The message to log to the console. - * - * @example - * // Deprecated function or class - * function Foo() { - * deprecationWarning('Foo', 'Foo was deprecated in Cesium 1.01. It will be removed in 1.03. Use newFoo instead.'); - * // ... - * } - * - * // Deprecated function - * Bar.prototype.func = function() { - * deprecationWarning('Bar.func', 'Bar.func() was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newFunc() instead.'); - * // ... - * }; - * - * // Deprecated property - * defineProperties(Bar.prototype, { - * prop : { - * get : function() { - * deprecationWarning('Bar.prop', 'Bar.prop was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newProp instead.'); - * // ... - * }, - * set : function(value) { - * deprecationWarning('Bar.prop', 'Bar.prop was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newProp instead.'); - * // ... - * } - * } - * }); - * - * @private - */ - function deprecationWarning(identifier, message) { - if (!defined(identifier) || !defined(message)) { - throw new DeveloperError('identifier and message are required.'); - } - - oneTimeWarning(identifier, message); - } + function identity(x) { + return x; + } - return deprecationWarning; + return when; }); +})(typeof define == 'function' && define.amd + ? define + : function (factory) { typeof exports === 'object' + ? (module.exports = factory()) + : (this.when = factory()); + } + // Boilerplate for AMD, Node, and browser global +); /*global define*/ define('Core/binarySearch',[ @@ -20967,6 +20213,7 @@ define('Core/Iau2006XysData',[ /*global define*/ define('Core/Quaternion',[ './Cartesian3', + './Check', './defaultValue', './defined', './DeveloperError', @@ -20976,6 +20223,7 @@ define('Core/Quaternion',[ './Matrix3' ], function( Cartesian3, + Check, defaultValue, defined, DeveloperError, @@ -21038,12 +20286,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided. */ Quaternion.fromAxisAngle = function(axis, angle, result) { - if (!defined(axis)) { - throw new DeveloperError('axis is required.'); - } - if (typeof angle !== 'number') { - throw new DeveloperError('angle is required and must be a number.'); - } + Check.typeOf.object('axis', axis); + Check.typeOf.number('angle', angle); var halfAngle = angle / 2.0; var s = Math.sin(halfAngle); @@ -21075,9 +20319,7 @@ define('Core/Quaternion',[ * @see Matrix3.fromQuaternion */ Quaternion.fromRotationMatrix = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); var root; var x; @@ -21151,15 +20393,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter or a new Quaternion instance if none was provided. */ Quaternion.fromHeadingPitchRoll = function(heading, pitch, roll, result) { - if (!defined(heading)) { - throw new DeveloperError('heading is required.'); - } - if (!defined(pitch)) { - throw new DeveloperError('pitch is required.'); - } - if (!defined(roll)) { - throw new DeveloperError('roll is required.'); - } + Check.typeOf.number('heading', heading); + Check.typeOf.number('pitch', pitch); + Check.typeOf.number('roll', roll); var rollQuaternion = Quaternion.fromAxisAngle(Cartesian3.UNIT_X, roll, scratchHPRQuaternion); var pitchQuaternion = Quaternion.fromAxisAngle(Cartesian3.UNIT_Y, -pitch, result); @@ -21190,13 +20426,8 @@ define('Core/Quaternion',[ * @returns {Number[]} The array that was packed into */ Quaternion.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -21217,9 +20448,7 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided. */ Quaternion.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -21274,7 +20503,7 @@ define('Core/Quaternion',[ * * @param {Number[]} array The array previously packed for interpolation. * @param {Number[]} sourceArray The original packed array. - * @param {Number} [startingIndex=0] The startingIndex used to convert the array. + * @param {Number} [firstIndex=0] The firstIndex used to convert the array. * @param {Number} [lastIndex=packedArray.length] The lastIndex used to convert the array. * @param {Quaternion} [result] The object into which to store the result. * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided. @@ -21328,12 +20557,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.conjugate = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); result.x = -quaternion.x; result.y = -quaternion.y; @@ -21349,9 +20574,7 @@ define('Core/Quaternion',[ * @returns {Number} The magnitude squared. */ Quaternion.magnitudeSquared = function(quaternion) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); return quaternion.x * quaternion.x + quaternion.y * quaternion.y + quaternion.z * quaternion.z + quaternion.w * quaternion.w; }; @@ -21374,9 +20597,7 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.normalize = function(quaternion, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); var inverseMagnitude = 1.0 / Quaternion.magnitude(quaternion); var x = quaternion.x * inverseMagnitude; @@ -21399,9 +20620,7 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.inverse = function(quaternion, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); var magnitudeSquared = Quaternion.magnitudeSquared(quaternion); result = Quaternion.conjugate(quaternion, result); @@ -21417,15 +20636,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -21443,15 +20656,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -21468,12 +20675,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.negate = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); result.x = -quaternion.x; result.y = -quaternion.y; @@ -21490,12 +20693,8 @@ define('Core/Quaternion',[ * @returns {Number} The dot product. */ Quaternion.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w; }; @@ -21509,15 +20708,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var leftX = left.x; var leftY = left.y; @@ -21550,15 +20743,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.multiplyByScalar = function(quaternion, scalar, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = quaternion.x * scalar; result.y = quaternion.y * scalar; @@ -21576,15 +20763,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.divideByScalar = function(quaternion, scalar, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = quaternion.x / scalar; result.y = quaternion.y / scalar; @@ -21601,12 +20782,8 @@ define('Core/Quaternion',[ * @returns {Cartesian3} The modified result parameter. */ Quaternion.computeAxis = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); var w = quaternion.w; if (Math.abs(w - 1.0) < CesiumMath.EPSILON6) { @@ -21629,9 +20806,7 @@ define('Core/Quaternion',[ * @returns {Number} The angle of rotation. */ Quaternion.computeAngle = function(quaternion) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); if (Math.abs(quaternion.w - 1.0) < CesiumMath.EPSILON6) { return 0.0; @@ -21650,18 +20825,10 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); lerpScratch = Quaternion.multiplyByScalar(end, t, lerpScratch); result = Quaternion.multiplyByScalar(start, 1.0 - t, result); @@ -21683,18 +20850,10 @@ define('Core/Quaternion',[ * @see Quaternion#fastSlerp */ Quaternion.slerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var dot = Quaternion.dot(start, end); @@ -21727,12 +20886,8 @@ define('Core/Quaternion',[ * @returns {Cartesian3} The modified result parameter. */ Quaternion.log = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); var theta = CesiumMath.acosClamped(quaternion.w); var thetaOverSinTheta = 0.0; @@ -21752,12 +20907,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.exp = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var theta = Cartesian3.magnitude(cartesian); var sinThetaOverTheta = 0.0; @@ -21792,12 +20943,10 @@ define('Core/Quaternion',[ * @see Quaternion#squad */ Quaternion.computeInnerQuadrangle = function(q0, q1, q2, result) { - if (!defined(q0) || !defined(q1) || !defined(q2)) { - throw new DeveloperError('q0, q1, and q2 are required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('q0', q0); + Check.typeOf.object('q1', q1); + Check.typeOf.object('q2', q2); + Check.typeOf.object('result', result); var qInv = Quaternion.conjugate(q1, squadScratchQuaternion0); Quaternion.multiply(qInv, q2, squadScratchQuaternion1); @@ -21839,15 +20988,12 @@ define('Core/Quaternion',[ * @see Quaternion#computeInnerQuadrangle */ Quaternion.squad = function(q0, q1, s0, s1, t, result) { - if (!defined(q0) || !defined(q1) || !defined(s0) || !defined(s1)) { - throw new DeveloperError('q0, q1, s0, and s1 are required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('q0', q0); + Check.typeOf.object('q1', q1); + Check.typeOf.object('s0', s0); + Check.typeOf.object('s1', s1); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var slerp0 = Quaternion.slerp(q0, q1, t, squadScratchQuaternion0); var slerp1 = Quaternion.slerp(s0, s1, t, squadScratchQuaternion1); @@ -21884,18 +21030,10 @@ define('Core/Quaternion',[ * @see Quaternion#slerp */ Quaternion.fastSlerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var x = Quaternion.dot(start, end); @@ -21944,15 +21082,12 @@ define('Core/Quaternion',[ * @see Quaternion#squad */ Quaternion.fastSquad = function(q0, q1, s0, s1, t, result) { - if (!defined(q0) || !defined(q1) || !defined(s0) || !defined(s1)) { - throw new DeveloperError('q0, q1, s0, and s1 are required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('q0', q0); + Check.typeOf.object('q1', q1); + Check.typeOf.object('s0', s0); + Check.typeOf.object('s1', s1); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var slerp0 = Quaternion.fastSlerp(q0, q1, t, squadScratchQuaternion0); var slerp1 = Quaternion.fastSlerp(s0, s1, t, squadScratchQuaternion1); @@ -21988,9 +21123,7 @@ define('Core/Quaternion',[ * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. */ Quaternion.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon is required and must be a number.'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || ((defined(left)) && @@ -22070,9 +21203,9 @@ define('Core/Transforms',[ './Cartesian3', './Cartesian4', './Cartographic', + './Check', './defaultValue', './defined', - './deprecationWarning', './DeveloperError', './EarthOrientationParameters', './EarthOrientationParametersSample', @@ -22092,9 +21225,9 @@ define('Core/Transforms',[ Cartesian3, Cartesian4, Cartographic, + Check, defaultValue, defined, - deprecationWarning, DeveloperError, EarthOrientationParameters, EarthOrientationParametersSample, @@ -22530,19 +21663,12 @@ define('Core/Transforms',[ * var hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll); * var transform = Cesium.Transforms.headingPitchRollToFixedFrame(center, hpr); */ - Transforms.headingPitchRollToFixedFrame = function(origin, headingPitchRoll, pitch, roll, ellipsoid, result) { - var heading; - if (typeof headingPitchRoll === 'object') { - // Shift arguments using assignments to encourage JIT optimization. - ellipsoid = pitch; - result = roll; - heading = headingPitchRoll.heading; - pitch = headingPitchRoll.pitch; - roll = headingPitchRoll.roll; - } else { - deprecationWarning('headingPitchRollToFixedFrame', 'headingPitchRollToFixedFrame with separate heading, pitch, and roll arguments was deprecated in 1.27. It will be removed in 1.30. Use a HeadingPitchRoll object.'); - heading = headingPitchRoll; - } + Transforms.headingPitchRollToFixedFrame = function(origin, headingPitchRoll, ellipsoid, result) { + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + var heading = headingPitchRoll.heading; + var pitch = headingPitchRoll.pitch; + var roll = headingPitchRoll.roll; + // checks for required parameters happen in the called functions var hprQuaternion = Quaternion.fromHeadingPitchRoll(heading, pitch, roll, scratchHPRQuaternion); var hprMatrix = Matrix4.fromTranslationQuaternionRotationScale(Cartesian3.ZERO, hprQuaternion, scratchScale, scratchHPRMatrix4); @@ -22550,7 +21676,6 @@ define('Core/Transforms',[ return Matrix4.multiply(result, hprMatrix, result); }; - var scratchHPR = new HeadingPitchRoll(); var scratchENUMatrix4 = new Matrix4(); var scratchHPRMatrix3 = new Matrix3(); @@ -22575,22 +21700,10 @@ define('Core/Transforms',[ * var hpr = new HeadingPitchRoll(heading, pitch, roll); * var quaternion = Cesium.Transforms.headingPitchRollQuaternion(center, hpr); */ - Transforms.headingPitchRollQuaternion = function(origin, headingPitchRoll, pitch, roll, ellipsoid, result) { - var hpr; - if (typeof headingPitchRoll === 'object') { - // Shift arguments using assignment to encourage JIT optimization. - hpr = headingPitchRoll; - ellipsoid = pitch; - result = roll; - } else { - deprecationWarning('headingPitchRollQuaternion', 'headingPitchRollQuaternion with separate heading, pitch, and roll arguments was deprecated in 1.27. It will be removed in 1.30. Use a HeadingPitchRoll object.'); - scratchHPR.heading = headingPitchRoll; - scratchHPR.pitch = pitch; - scratchHPR.roll = roll; - hpr = scratchHPR; - } + Transforms.headingPitchRollQuaternion = function(origin, headingPitchRoll, ellipsoid, result) { // checks for required parameters happen in the called functions - var transform = Transforms.headingPitchRollToFixedFrame(origin, hpr, ellipsoid, scratchENUMatrix4); + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + var transform = Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, scratchENUMatrix4); var rotation = Matrix4.getRotation(transform, scratchHPRMatrix3); return Quaternion.fromRotationMatrix(rotation, result); }; @@ -23066,6 +22179,46 @@ define('Core/Transforms',[ return result; }; + var swizzleMatrix = new Matrix4( + 0.0, 0.0, 1.0, 0.0, + 1.0, 0.0, 0.0, 0.0, + 0.0, 1.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + + /** + * @private + */ + Transforms.wgs84To2DModelMatrix = function(projection, center, result) { + if (!defined(projection)) { + throw new DeveloperError('projection is required.'); + } + if (!defined(center)) { + throw new DeveloperError('center is required.'); + } + if (!defined(result)) { + throw new DeveloperError('result is required.'); + } + + var ellipsoid = projection.ellipsoid; + + var fromENU = Transforms.eastNorthUpToFixedFrame(center, ellipsoid, scratchFromENU); + var toENU = Matrix4.inverseTransformation(fromENU, scratchToENU); + + var cartographic = ellipsoid.cartesianToCartographic(center, scratchCartographic); + var projectedPosition = projection.project(cartographic, scratchCartesian3Projection); + var newOrigin = scratchCartesian4NewOrigin; + newOrigin.x = projectedPosition.z; + newOrigin.y = projectedPosition.x; + newOrigin.z = projectedPosition.y; + newOrigin.w = 1.0; + + var translation = Matrix4.fromTranslation(newOrigin, scratchFromENU); + Matrix4.multiply(swizzleMatrix, toENU, result); + Matrix4.multiply(translation, result, result); + + return result; + }; + return Transforms; }); @@ -24712,6 +23865,7 @@ define('Core/EllipsoidGeodesic',[ * Provides the location of a point at the indicated portion along the geodesic. * * @param {Number} fraction The portion of the distance between the initial and final points. + * @param {Cartographic} result The object in which to store the result. * @returns {Cartographic} The location of the point along the geodesic. */ EllipsoidGeodesic.prototype.interpolateUsingFraction = function(fraction, result) { @@ -24722,6 +23876,7 @@ define('Core/EllipsoidGeodesic',[ * Provides the location of a point at the indicated distance along the geodesic. * * @param {Number} distance The distance from the inital point to the point of interest along the geodesic + * @param {Cartographic} result The object in which to store the result. * @returns {Cartographic} The location of the point along the geodesic. * * @exception {DeveloperError} start and end must be set before calling function interpolateUsingSurfaceDistance @@ -24793,6 +23948,30 @@ define('Core/EllipsoidGeodesic',[ return EllipsoidGeodesic; }); +/*global define*/ +define('Core/isArray',[ + './defined' + ], function( + defined) { + 'use strict'; + + /** + * Tests an object to see if it is an array. + * @exports isArray + * + * @param {Object} value The value to test. + * @returns {Boolean} true if the value is an array, false otherwise. + */ + var isArray = Array.isArray; + if (!defined(isArray)) { + isArray = function(value) { + return Object.prototype.toString.call(value) === '[object Array]'; + }; + } + + return isArray; +}); + /*global define*/ define('Core/PolylinePipeline',[ './Cartesian3', @@ -24997,10 +24176,10 @@ define('Core/PolylinePipeline',[ /** * Subdivides polyline and raises all points to the specified height. Returns an array of numbers to represent the positions. - * @param {Cartesian3[]} positions The array of type {Cartesian3} representing positions. - * @param {Number|Number[]} [height=0.0] A number or array of numbers representing the heights of each position. - * @param {Number} [granularity = CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. - * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie. + * @param {Cartesian3[]} options.positions The array of type {Cartesian3} representing positions. + * @param {Number|Number[]} [options.height=0.0] A number or array of numbers representing the heights of each position. + * @param {Number} [options.granularity = CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. + * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie. * @returns {Number[]} A new array of positions of type {Number} that have been subdivided and raised to the surface of the ellipsoid. * * @example @@ -25082,10 +24261,10 @@ define('Core/PolylinePipeline',[ /** * Subdivides polyline and raises all points to the specified height. Returns an array of new {Cartesian3} positions. - * @param {Cartesian3[]} positions The array of type {Cartesian3} representing positions. - * @param {Number|Number[]} [height=0.0] A number or array of numbers representing the heights of each position. - * @param {Number} [granularity = CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. - * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie. + * @param {Cartesian3[]} options.positions The array of type {Cartesian3} representing positions. + * @param {Number|Number[]} [options.height=0.0] A number or array of numbers representing the heights of each position. + * @param {Number} [options.granularity = CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. + * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie. * @returns {Cartesian3[]} A new array of cartesian3 positions that have been subdivided and raised to the surface of the ellipsoid. * * @example @@ -25354,7 +24533,7 @@ define('Core/WallGeometry',[ var scratchCartesian3Position3 = new Cartesian3(); var scratchCartesian3Position4 = new Cartesian3(); var scratchCartesian3Position5 = new Cartesian3(); - var scratchBinormal = new Cartesian3(); + var scratchBitangent = new Cartesian3(); var scratchTangent = new Cartesian3(); var scratchNormal = new Cartesian3(); @@ -25685,12 +24864,12 @@ define('Core/WallGeometry',[ var positions = vertexFormat.position ? new Float64Array(size) : undefined; var normals = vertexFormat.normal ? new Float32Array(size) : undefined; var tangents = vertexFormat.tangent ? new Float32Array(size) : undefined; - var binormals = vertexFormat.binormal ? new Float32Array(size) : undefined; + var bitangents = vertexFormat.bitangent ? new Float32Array(size) : undefined; var textureCoordinates = vertexFormat.st ? new Float32Array(size / 3 * 2) : undefined; var positionIndex = 0; var normalIndex = 0; - var binormalIndex = 0; + var bitangentIndex = 0; var tangentIndex = 0; var stIndex = 0; @@ -25698,7 +24877,7 @@ define('Core/WallGeometry',[ // points being even and upper points being odd var normal = scratchNormal; var tangent = scratchTangent; - var binormal = scratchBinormal; + var bitangent = scratchBitangent; var recomputeNormal = true; length /= 3; var i; @@ -25728,7 +24907,7 @@ define('Core/WallGeometry',[ textureCoordinates[stIndex++] = 1.0; } - if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.binormal) { + if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent) { var nextPosition; var nextTop = Cartesian3.clone(Cartesian3.ZERO, scratchCartesian3Position5); var groundPosition = ellipsoid.scaleToGeodeticSurface(Cartesian3.fromArray(topPositions, i3, scratchCartesian3Position2), scratchCartesian3Position2); @@ -25751,8 +24930,8 @@ define('Core/WallGeometry',[ if (vertexFormat.tangent) { tangent = Cartesian3.normalize(Cartesian3.subtract(nextPosition, groundPosition, tangent), tangent); } - if (vertexFormat.binormal) { - binormal = Cartesian3.normalize(Cartesian3.cross(normal, tangent, binormal), binormal); + if (vertexFormat.bitangent) { + bitangent = Cartesian3.normalize(Cartesian3.cross(normal, tangent, bitangent), bitangent); } } @@ -25776,14 +24955,14 @@ define('Core/WallGeometry',[ tangents[tangentIndex++] = tangent.z; } - if (vertexFormat.binormal) { - binormals[binormalIndex++] = binormal.x; - binormals[binormalIndex++] = binormal.y; - binormals[binormalIndex++] = binormal.z; + if (vertexFormat.bitangent) { + bitangents[bitangentIndex++] = bitangent.x; + bitangents[bitangentIndex++] = bitangent.y; + bitangents[bitangentIndex++] = bitangent.z; - binormals[binormalIndex++] = binormal.x; - binormals[binormalIndex++] = binormal.y; - binormals[binormalIndex++] = binormal.z; + bitangents[bitangentIndex++] = bitangent.x; + bitangents[bitangentIndex++] = bitangent.y; + bitangents[bitangentIndex++] = bitangent.z; } } } @@ -25814,11 +24993,11 @@ define('Core/WallGeometry',[ }); } - if (vertexFormat.binormal) { - attributes.binormal = new GeometryAttribute({ + if (vertexFormat.bitangent) { + attributes.bitangent = new GeometryAttribute({ componentDatatype : ComponentDatatype.FLOAT, componentsPerAttribute : 3, - values : binormals + values : bitangents }); } diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createWallOutlineGeometry.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createWallOutlineGeometry.js index 54d2b43f..25cc52b0 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createWallOutlineGeometry.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/createWallOutlineGeometry.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,68 +45,6 @@ define('Core/defined',[],function() { return defined; }); -/*global define*/ -define('Core/freezeObject',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Freezes an object, using Object.freeze if available, otherwise returns - * the object unchanged. This function should be used in setup code to prevent - * errors from completely halting JavaScript execution in legacy browsers. - * - * @private - * - * @exports freezeObject - */ - var freezeObject = Object.freeze; - if (!defined(freezeObject)) { - freezeObject = function(o) { - return o; - }; - } - - return freezeObject; -}); - -/*global define*/ -define('Core/defaultValue',[ - './freezeObject' - ], function( - freezeObject) { - 'use strict'; - - /** - * Returns the first parameter if not undefined, otherwise the second parameter. - * Useful for setting a default value for a parameter. - * - * @exports defaultValue - * - * @param {*} a - * @param {*} b - * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter. - * - * @example - * param = Cesium.defaultValue(param, 'default'); - */ - function defaultValue(a, b) { - if (a !== undefined) { - return a; - } - return b; - } - - /** - * A frozen empty object that can be used as the default value for options passed as - * an object literal. - */ - defaultValue.EMPTY_OBJECT = freezeObject({}); - - return defaultValue; -}); - /*global define*/ define('Core/DeveloperError',[ './defined' @@ -188,41 +126,13 @@ define('Core/DeveloperError',[ return DeveloperError; }); -/*global define*/ -define('Core/isArray',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Tests an object to see if it is an array. - * @exports isArray - * - * @param {Object} value The value to test. - * @returns {Boolean} true if the value is an array, false otherwise. - */ - var isArray = Array.isArray; - if (!defined(isArray)) { - isArray = function(value) { - return Object.prototype.toString.call(value) === '[object Array]'; - }; - } - - return isArray; -}); - /*global define*/ define('Core/Check',[ - './defaultValue', - './defined', - './DeveloperError', - './isArray' + './defined', + './DeveloperError' ], function( - defaultValue, defined, - DeveloperError, - isArray) { + DeveloperError) { 'use strict'; /** @@ -237,111 +147,134 @@ define('Core/Check',[ */ Check.typeOf = {}; - /** - * Contains functions for checking numeric conditions such as minimum and maximum values - */ - Check.numeric = {}; - function getUndefinedErrorMessage(name) { - return name + ' was required but undefined.'; + return name + ' is required, actual value was undefined'; } function getFailedTypeErrorMessage(actual, expected, name) { - return 'Expected ' + name + ' to be typeof ' + expected + ', got ' + actual; + return 'Expected ' + name + ' to be typeof ' + expected + ', actual typeof was ' + actual; } /** * Throws if test is not defined * - * @param {*} test The value that is to be checked * @param {String} name The name of the variable being tested + * @param {*} test The value that is to be checked * @exception {DeveloperError} test must be defined */ - Check.defined = function (test, name) { + Check.defined = function (name, test) { if (!defined(test)) { throw new DeveloperError(getUndefinedErrorMessage(name)); } }; /** - * Throws if test is greater than maximum + * Throws if test is not typeof 'function' * - * @param {Number} test The value to test - * @param {Number} maximum The maximum allowed value - * @exception {DeveloperError} test must not be greater than maximum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'function' */ - Check.numeric.maximum = function (test, maximum) { - Check.typeOf.number(test); - Check.typeOf.number(maximum); - if (test > maximum) { - throw new DeveloperError('Expected ' + test + ' to be at most ' + maximum); + Check.typeOf.func = function (name, test) { + if (typeof test !== 'function') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); } }; /** - * Throws if test is less than minimum + * Throws if test is not typeof 'string' * - * @param {Number} test The value to test - * @param {Number} minimum The minimum allowed value - * @exception {DeveloperError} test must not be less than mininum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'string' */ - Check.numeric.minimum = function (test, minimum) { - Check.typeOf.number(test); - Check.typeOf.number(minimum); - if (test < minimum) { - throw new DeveloperError('Expected ' + test + ' to be at least ' + minimum); + Check.typeOf.string = function (name, test) { + if (typeof test !== 'string') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); } }; /** - * Throws if test is not typeof 'function' + * Throws if test is not typeof 'number' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'function' + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'number' */ - Check.typeOf.function = function (test, name) { - if (typeof test !== 'function') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); + Check.typeOf.number = function (name, test) { + if (typeof test !== 'number') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); } }; /** - * Throws if test is not typeof 'string' + * Throws if test is not typeof 'number' and less than limit * + * @param {String} name The name of the variable being tested * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than limit + */ + Check.typeOf.number.lessThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test >= limit) { + throw new DeveloperError('Expected ' + name + ' to be less than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and less than or equal to limit + * * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'string' + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than or equal to limit */ - Check.typeOf.string = function (test, name) { - if (typeof test !== 'string') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); + Check.typeOf.number.lessThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test > limit) { + throw new DeveloperError('Expected ' + name + ' to be less than or equal to ' + limit + ', actual value was ' + test); } }; /** - * Throws if test is not typeof 'number' + * Throws if test is not typeof 'number' and greater than limit * + * @param {String} name The name of the variable being tested * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than limit + */ + Check.typeOf.number.greaterThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test <= limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and greater than or equal to limit + * * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'number' + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than or equal to limit */ - Check.typeOf.number = function (test, name) { - if (typeof test !== 'number') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); + Check.typeOf.number.greaterThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test < limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than or equal to' + limit + ', actual value was ' + test); } }; /** * Throws if test is not typeof 'object' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested + * @param {*} test The value to test * @exception {DeveloperError} test must be typeof 'object' */ - Check.typeOf.object = function (test, name) { + Check.typeOf.object = function (name, test) { if (typeof test !== 'object') { throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'object', name)); } @@ -350,11 +283,11 @@ define('Core/Check',[ /** * Throws if test is not typeof 'boolean' * - * @param {*} test The value to test * @param {String} name The name of the variable being tested + * @param {*} test The value to test * @exception {DeveloperError} test must be typeof 'boolean' */ - Check.typeOf.boolean = function (test, name) { + Check.typeOf.bool = function (name, test) { if (typeof test !== 'boolean') { throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'boolean', name)); } @@ -363,6 +296,68 @@ define('Core/Check',[ return Check; }); +/*global define*/ +define('Core/freezeObject',[ + './defined' + ], function( + defined) { + 'use strict'; + + /** + * Freezes an object, using Object.freeze if available, otherwise returns + * the object unchanged. This function should be used in setup code to prevent + * errors from completely halting JavaScript execution in legacy browsers. + * + * @private + * + * @exports freezeObject + */ + var freezeObject = Object.freeze; + if (!defined(freezeObject)) { + freezeObject = function(o) { + return o; + }; + } + + return freezeObject; +}); + +/*global define*/ +define('Core/defaultValue',[ + './freezeObject' + ], function( + freezeObject) { + 'use strict'; + + /** + * Returns the first parameter if not undefined, otherwise the second parameter. + * Useful for setting a default value for a parameter. + * + * @exports defaultValue + * + * @param {*} a + * @param {*} b + * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter. + * + * @example + * param = Cesium.defaultValue(param, 'default'); + */ + function defaultValue(a, b) { + if (a !== undefined) { + return a; + } + return b; + } + + /** + * A frozen empty object that can be used as the default value for options passed as + * an object literal. + */ + defaultValue.EMPTY_OBJECT = freezeObject({}); + + return defaultValue; +}); + /* I've wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace so it's better encapsulated. Now you can have multiple random number generators @@ -1047,7 +1042,7 @@ define('Core/Math',[ if (!defined(angle)) { throw new DeveloperError('angle is required.'); } - + return CesiumMath.clamp(angle, -1*CesiumMath.PI_OVER_TWO, CesiumMath.PI_OVER_TWO); }; @@ -1057,11 +1052,11 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [<code>-CesiumMath.PI</code>, <code>CesiumMath.PI</code>]. */ - CesiumMath.negativePiToPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.negativePiToPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - return CesiumMath.zeroToTwoPi(x + CesiumMath.PI) - CesiumMath.PI; + return CesiumMath.zeroToTwoPi(angle + CesiumMath.PI) - CesiumMath.PI; }; /** @@ -1070,12 +1065,12 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [0, <code>CesiumMath.TWO_PI</code>]. */ - CesiumMath.zeroToTwoPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.zeroToTwoPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - var mod = CesiumMath.mod(x, CesiumMath.TWO_PI); - if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(x) > CesiumMath.EPSILON14) { + var mod = CesiumMath.mod(angle, CesiumMath.TWO_PI); + if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(angle) > CesiumMath.EPSILON14) { return CesiumMath.TWO_PI; } return mod; @@ -1145,7 +1140,7 @@ define('Core/Math',[ * @example * //Compute 7!, which is equal to 5040 * var computedFactorial = Cesium.Math.factorial(7); - * + * * @see {@link http://en.wikipedia.org/wiki/Factorial|Factorial on Wikipedia} */ CesiumMath.factorial = function(n) { @@ -1429,7 +1424,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.fromSpherical = function(spherical, result) { - Check.typeOf.object(spherical, 'spherical'); + Check.typeOf.object('spherical', spherical); if (!defined(result)) { result = new Cartesian3(); @@ -1513,8 +1508,8 @@ define('Core/Cartesian3',[ * @returns {Number[]} The array that was packed into */ Cartesian3.pack = function(value, array, startingIndex) { - Check.typeOf.object(value, 'value'); - Check.defined(array, 'array'); + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1534,7 +1529,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.unpack = function(array, startingIndex, result) { - Check.defined(array, 'array'); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1555,7 +1550,7 @@ define('Core/Cartesian3',[ * @returns {Number[]} The packed array. */ Cartesian3.packArray = function(array, result) { - Check.defined(array, 'array'); + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -1578,8 +1573,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3[]} The unpacked array. */ Cartesian3.unpackArray = function(array, result) { - Check.defined(array, 'array'); - Check.numeric.minimum(array.length, 3); + Check.defined('array', array); + Check.typeOf.number.greaterThanOrEquals('array.length', array.length, 3); if (array.length % 3 !== 0) { throw new DeveloperError('array length must be a multiple of 3.'); } @@ -1625,7 +1620,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the maximum component. */ Cartesian3.maximumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z); }; @@ -1637,7 +1632,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the minimum component. */ Cartesian3.minimumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z); }; @@ -1651,9 +1646,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the minimum components. */ Cartesian3.minimumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -1671,9 +1666,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the maximum components. */ Cartesian3.maximumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -1688,7 +1683,7 @@ define('Core/Cartesian3',[ * @returns {Number} The squared magnitude. */ Cartesian3.magnitudeSquared = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z; }; @@ -1717,8 +1712,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distance(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(2.0, 0.0, 0.0)); */ Cartesian3.distance = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitude(distanceScratch); @@ -1737,8 +1732,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distanceSquared(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(3.0, 0.0, 0.0)); */ Cartesian3.distanceSquared = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitudeSquared(distanceScratch); @@ -1752,8 +1747,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.normalize = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian3.magnitude(cartesian); @@ -1776,8 +1771,8 @@ define('Core/Cartesian3',[ * @returns {Number} The dot product. */ Cartesian3.dot = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z; }; @@ -1791,9 +1786,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyComponents = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -1835,9 +1830,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.add = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -1854,9 +1849,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.subtract = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -1873,9 +1868,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -1892,9 +1887,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.divideByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -1910,8 +1905,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.negate = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -1927,8 +1922,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.abs = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -1947,10 +1942,10 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.lerp = function(start, end, t, result) { - Check.typeOf.object(start, 'start'); - Check.typeOf.object(end, 'end'); - Check.typeOf.number(t, 't'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian3.multiplyByScalar(end, t, lerpScratch); result = Cartesian3.multiplyByScalar(start, 1.0 - t, result); @@ -1967,8 +1962,8 @@ define('Core/Cartesian3',[ * @returns {Number} The angle between the Cartesians. */ Cartesian3.angleBetween = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.normalize(left, angleBetweenScratch); Cartesian3.normalize(right, angleBetweenScratch2); @@ -1986,8 +1981,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The most orthogonal axis. */ Cartesian3.mostOrthogonalAxis = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian3.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian3.abs(f, f); @@ -2064,9 +2059,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The cross product. */ Cartesian3.cross = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var leftX = left.x; var leftY = left.y; @@ -2099,8 +2094,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromDegrees(-115.0, 37.0); */ Cartesian3.fromDegrees = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); longitude = CesiumMath.toRadians(longitude); latitude = CesiumMath.toRadians(latitude); @@ -2125,8 +2120,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromRadians(-2.007, 0.645); */ Cartesian3.fromRadians = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); height = defaultValue(height, 0.0); var radiiSquared = defined(ellipsoid) ? ellipsoid.radiiSquared : wgs84RadiiSquared; @@ -2160,7 +2155,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArray([-115.0, 37.0, -107.0, 33.0]); */ Cartesian3.fromDegreesArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -2194,7 +2189,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArray([-2.007, 0.645, -1.867, .575]); */ Cartesian3.fromRadiansArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -2228,7 +2223,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArrayHeights([-115.0, 37.0, 100000.0, -107.0, 33.0, 150000.0]); */ Cartesian3.fromDegreesArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -2263,7 +2258,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArrayHeights([-2.007, 0.645, 100000.0, -1.867, .575, 150000.0]); */ Cartesian3.fromRadiansArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -3010,7 +3005,9 @@ define('Core/Ellipsoid',[ /** * Computes an Ellipsoid from a Cartesian specifying the radii in x, y, and z directions. * - * @param {Cartesian3} [radii=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Cartesian3} [cartesian=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new + * instance should be created. * @returns {Ellipsoid} A new Ellipsoid instance. * * @exception {DeveloperError} All radii components must be greater than or equal to zero. @@ -3650,6 +3647,7 @@ define('Core/Interval',[ /*global define*/ define('Core/Matrix3',[ './Cartesian3', + './Check', './defaultValue', './defined', './defineProperties', @@ -3658,6 +3656,7 @@ define('Core/Matrix3',[ './Math' ], function( Cartesian3, + Check, defaultValue, defined, defineProperties, @@ -3720,13 +3719,8 @@ define('Core/Matrix3',[ * @returns {Number[]} The array that was packed into */ Matrix3.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3752,9 +3746,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. */ Matrix3.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3781,24 +3773,24 @@ define('Core/Matrix3',[ * @param {Matrix3} [result] The object onto which to store the result. * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. (Returns undefined if matrix is undefined) */ - Matrix3.clone = function(values, result) { - if (!defined(values)) { + Matrix3.clone = function(matrix, result) { + if (!defined(matrix)) { return undefined; } if (!defined(result)) { - return new Matrix3(values[0], values[3], values[6], - values[1], values[4], values[7], - values[2], values[5], values[8]); + return new Matrix3(matrix[0], matrix[3], matrix[6], + matrix[1], matrix[4], matrix[7], + matrix[2], matrix[5], matrix[8]); } - result[0] = values[0]; - result[1] = values[1]; - result[2] = values[2]; - result[3] = values[3]; - result[4] = values[4]; - result[5] = values[5]; - result[6] = values[6]; - result[7] = values[7]; - result[8] = values[8]; + result[0] = matrix[0]; + result[1] = matrix[1]; + result[2] = matrix[2]; + result[3] = matrix[3]; + result[4] = matrix[4]; + result[5] = matrix[5]; + result[6] = matrix[6]; + result[7] = matrix[7]; + result[8] = matrix[8]; return result; }; @@ -3824,9 +3816,7 @@ define('Core/Matrix3',[ * var m2 = Cesium.Matrix3.fromArray(v2, 2); */ Matrix3.fromArray = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -3854,9 +3844,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values parameter is required'); - } + Check.defined('values', values); return Matrix3.clone(values, result); }; @@ -3870,9 +3858,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix3(values[0], values[1], values[2], @@ -3899,9 +3885,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this quaternion. */ Matrix3.fromQuaternion = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); var x2 = quaternion.x * quaternion.x; var xy = quaternion.x * quaternion.y; @@ -3951,10 +3935,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this headingPitchRoll. */ Matrix3.fromHeadingPitchRoll = function(headingPitchRoll, result) { - if (!defined(headingPitchRoll)) { - throw new DeveloperError('headingPitchRoll is required'); - } - var cosTheta = Math.cos(-headingPitchRoll.pitch); + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + + var cosTheta = Math.cos(-headingPitchRoll.pitch); var cosPsi = Math.cos(-headingPitchRoll.heading); var cosPhi = Math.cos(headingPitchRoll.roll); var sinTheta = Math.sin(-headingPitchRoll.pitch); @@ -4005,9 +3988,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix3( @@ -4043,9 +4024,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromUniformScale(2.0); */ Matrix3.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix3( @@ -4069,7 +4048,7 @@ define('Core/Matrix3',[ /** * Computes a Matrix3 instance representing the cross product equivalent matrix of a Cartesian3 vector. * - * @param {Cartesian3} the vector on the left hand side of the cross product operation. + * @param {Cartesian3} vector the vector on the left hand side of the cross product operation. * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created. * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. * @@ -4081,9 +4060,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromCrossProduct(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromCrossProduct = function(vector, result) { - if (!defined(vector)) { - throw new DeveloperError('vector is required.'); - } + Check.typeOf.object('vector', vector); if (!defined(result)) { return new Matrix3( @@ -4118,9 +4095,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationX = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4159,9 +4134,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationY = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4200,9 +4173,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationZ = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -4236,9 +4207,7 @@ define('Core/Matrix3',[ * @returns {Number[]} The modified Array parameter or a new Array instance if one was not provided. */ Matrix3.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5], matrix[6], matrix[7], matrix[8]]; @@ -4272,12 +4241,10 @@ define('Core/Matrix3',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix3.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 2) { - throw new DeveloperError('row must be 0, 1, or 2.'); - } - if (typeof column !== 'number' || column < 0 || column > 2) { - throw new DeveloperError('column must be 0, 1, or 2.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 2); + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 2); return column * 3 + row; }; @@ -4293,16 +4260,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var startIndex = index * 3; var x = matrix[startIndex]; @@ -4327,18 +4288,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); var startIndex = index * 3; @@ -4359,15 +4313,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 3]; @@ -4391,18 +4340,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); result[index] = cartesian.x; @@ -4421,12 +4363,8 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[3], matrix[4], matrix[5], scratchColumn)); @@ -4457,15 +4395,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var column0Row0 = left[0] * right[0] + left[3] * right[1] + left[6] * right[2]; var column0Row1 = left[1] * right[0] + left[4] * right[1] + left[7] * right[2]; @@ -4500,15 +4432,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -4531,15 +4457,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -4562,15 +4482,9 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -4595,15 +4509,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -4634,15 +4542,9 @@ define('Core/Matrix3',[ * @see Matrix3.multiplyByUniformScale */ Matrix3.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); result[0] = matrix[0] * scale.x; result[1] = matrix[1] * scale.x; @@ -4664,12 +4566,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -4691,12 +4589,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var column0Row0 = matrix[0]; var column0Row1 = matrix[3]; @@ -4836,9 +4730,7 @@ define('Core/Matrix3',[ * var c = Cesium.Cartesian3.multiplyByScalar(v, lambda, new Cesium.Cartesian3()); // equal to Cesium.Matrix3.multiplyByVector(a, v) */ Matrix3.computeEigenDecomposition = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); // This routine was created based upon Matrix Computations, 3rd ed., by Golub and Van Loan, // section 8.4.3 The Classical Jacobi Algorithm @@ -4882,12 +4774,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -4909,9 +4797,7 @@ define('Core/Matrix3',[ * @returns {Number} The value of the determinant of the matrix. */ Matrix3.determinant = function(matrix) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); var m11 = matrix[0]; var m21 = matrix[3]; @@ -4936,12 +4822,8 @@ define('Core/Matrix3',[ * @exception {DeveloperError} matrix is not invertible. */ Matrix3.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var m11 = matrix[0]; var m21 = matrix[1]; @@ -5007,9 +4889,7 @@ define('Core/Matrix3',[ * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. */ Matrix3.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -5197,12 +5077,14 @@ define('Core/Matrix3',[ /*global define*/ define('Core/Cartesian4',[ + './Check', './defaultValue', './defined', './DeveloperError', './freezeObject', './Math' ], function( + Check, defaultValue, defined, DeveloperError, @@ -5285,9 +5167,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.fromColor = function(color, result) { - if (!defined(color)) { - throw new DeveloperError('color is required'); - } + Check.typeOf.object('color', color); if (!defined(result)) { return new Cartesian4(color.red, color.green, color.blue, color.alpha); } @@ -5339,12 +5219,8 @@ define('Core/Cartesian4',[ * @returns {Number[]} The array that was packed into */ Cartesian4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5365,9 +5241,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -5389,9 +5263,7 @@ define('Core/Cartesian4',[ * @returns {Number[]} The packed array. */ Cartesian4.packArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -5414,9 +5286,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4[]} The unpacked array. */ Cartesian4.unpackArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -5459,9 +5329,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the maximum component. */ Cartesian4.maximumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -5473,9 +5341,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the minimum component. */ Cartesian4.minimumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -5489,15 +5355,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the minimum components. */ Cartesian4.minimumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -5516,15 +5376,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the maximum components. */ Cartesian4.maximumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -5541,9 +5395,7 @@ define('Core/Cartesian4',[ * @returns {Number} The squared magnitude. */ Cartesian4.magnitudeSquared = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z + cartesian.w * cartesian.w; }; @@ -5574,9 +5426,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(2.0, 0.0, 0.0, 0.0)); */ Cartesian4.distance = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitude(distanceScratch); @@ -5597,9 +5448,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(3.0, 0.0, 0.0, 0.0)); */ Cartesian4.distanceSquared = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitudeSquared(distanceScratch); @@ -5613,12 +5463,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.normalize = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian4.magnitude(cartesian); @@ -5642,12 +5488,8 @@ define('Core/Cartesian4',[ * @returns {Number} The dot product. */ Cartesian4.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w; }; @@ -5661,15 +5503,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -5687,15 +5523,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x / right.x; result.y = left.y / right.y; @@ -5713,15 +5543,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -5739,15 +5563,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -5765,15 +5583,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -5791,15 +5603,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -5816,12 +5622,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.negate = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -5838,12 +5640,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.abs = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -5863,18 +5661,10 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian4.multiplyByScalar(end, t, lerpScratch); result = Cartesian4.multiplyByScalar(start, 1.0 - t, result); @@ -5890,12 +5680,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The most orthogonal axis. */ Cartesian4.mostOrthogonalAxis = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian4.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian4.abs(f, f); @@ -6140,6 +5926,7 @@ define('Core/RuntimeError',[ define('Core/Matrix4',[ './Cartesian3', './Cartesian4', + './Check', './defaultValue', './defined', './defineProperties', @@ -6151,6 +5938,7 @@ define('Core/Matrix4',[ ], function( Cartesian3, Cartesian4, + Check, defaultValue, defined, defineProperties, @@ -6241,13 +6029,8 @@ define('Core/Matrix4',[ * @returns {Number[]} The array that was packed into */ Matrix4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -6280,9 +6063,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if one was not provided. */ Matrix4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -6378,9 +6159,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required'); - } + Check.defined('values', values); return Matrix4.clone(values, result); }; @@ -6394,9 +6173,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix4(values[0], values[1], values[2], values[3], @@ -6433,9 +6210,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRotationTranslation = function(rotation, translation, result) { - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } + Check.typeOf.object('rotation', rotation); translation = defaultValue(translation, Cartesian3.ZERO); @@ -6483,15 +6258,9 @@ define('Core/Matrix4',[ * result); */ Matrix4.fromTranslationQuaternionRotationScale = function(translation, rotation, scale, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('translation', translation); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('scale', scale); if (!defined(result)) { result = new Matrix4(); @@ -6552,9 +6321,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromTranslationRotationScale = function(translationRotationScale, result) { - if (!defined(translationRotationScale)) { - throw new DeveloperError('translationRotationScale is required.'); - } + Check.typeOf.object('translationRotationScale', translationRotationScale); return Matrix4.fromTranslationQuaternionRotationScale(translationRotationScale.translation, translationRotationScale.rotation, translationRotationScale.scale, result); }; @@ -6569,9 +6336,7 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByTranslation */ Matrix4.fromTranslation = function(translation, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } + Check.typeOf.object('translation', translation); return Matrix4.fromRotationTranslation(Matrix3.IDENTITY, translation, result); }; @@ -6592,9 +6357,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix4.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix4( @@ -6639,9 +6402,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromUniformScale(2.0); */ Matrix4.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix4(scale, 0.0, 0.0, 0.0, @@ -6681,23 +6442,15 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromCamera = function(camera, result) { - if (!defined(camera)) { - throw new DeveloperError('camera is required.'); - } + Check.typeOf.object('camera', camera); var position = camera.position; var direction = camera.direction; var up = camera.up; - if (!defined(position)) { - throw new DeveloperError('camera.position is required.'); - } - if (!defined(direction)) { - throw new DeveloperError('camera.direction is required.'); - } - if (!defined(up)) { - throw new DeveloperError('camera.up is required.'); - } + Check.typeOf.object('camera.position', position); + Check.typeOf.object('camera.direction', direction); + Check.typeOf.object('camera.up', up); Cartesian3.normalize(direction, fromCameraF); Cartesian3.normalize(Cartesian3.cross(fromCameraF, up, fromCameraR), fromCameraR); @@ -6776,21 +6529,11 @@ define('Core/Matrix4',[ * @exception {DeveloperError} far must be greater than zero. */ Matrix4.computePerspectiveFieldOfView = function(fovY, aspectRatio, near, far, result) { - if (fovY <= 0.0 || fovY > Math.PI) { - throw new DeveloperError('fovY must be in (0, PI].'); - } - if (aspectRatio <= 0.0) { - throw new DeveloperError('aspectRatio must be greater than zero.'); - } - if (near <= 0.0) { - throw new DeveloperError('near must be greater than zero.'); - } - if (far <= 0.0) { - throw new DeveloperError('far must be greater than zero.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThan('fovY', fovY, 0.0); + Check.typeOf.number.lessThan('fovY', fovY, Math.PI); + Check.typeOf.number.greaterThan('near', near, 0.0); + Check.typeOf.number.greaterThan('far', far, 0.0); + Check.typeOf.object('result', result); var bottom = Math.tan(fovY * 0.5); @@ -6831,27 +6574,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeOrthographicOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var a = 1.0 / (right - left); var b = 1.0 / (top - bottom); @@ -6896,27 +6625,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computePerspectiveOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -6946,35 +6661,23 @@ define('Core/Matrix4',[ }; /** - * Computes a Matrix4 instance representing an infinite off center perspective transformation. - * - * @param {Number} left The number of meters to the left of the camera that will be in view. - * @param {Number} right The number of meters to the right of the camera that will be in view. - * @param {Number} bottom The number of meters below of the camera that will be in view. - * @param {Number} top The number of meters above of the camera that will be in view. - * @param {Number} near The distance to the near plane in meters. - * @param {Matrix4} result The object in which the result will be stored. - * @returns {Matrix4} The modified result parameter. - */ - Matrix4.computeInfinitePerspectiveOffCenter = function(left, right, bottom, top, near, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + * Computes a Matrix4 instance representing an infinite off center perspective transformation. + * + * @param {Number} left The number of meters to the left of the camera that will be in view. + * @param {Number} right The number of meters to the right of the camera that will be in view. + * @param {Number} bottom The number of meters below of the camera that will be in view. + * @param {Number} top The number of meters above of the camera that will be in view. + * @param {Number} near The distance to the near plane in meters. + * @param {Matrix4} result The object in which the result will be stored. + * @returns {Matrix4} The modified result parameter. + */ + Matrix4.computeInfinitePerspectiveOffCenter = function(left, right, bottom, top, near, result) { + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -7022,9 +6725,7 @@ define('Core/Matrix4',[ * }, 0.0, 1.0, new Cesium.Matrix4()); */ Matrix4.computeViewportTransformation = function(viewport, nearDepthRange, farDepthRange, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); viewport = defaultValue(viewport, defaultValue.EMPTY_OBJECT); var x = defaultValue(viewport.x, 0.0); @@ -7076,21 +6777,11 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeView = function(position, direction, up, right, result) { - if (!defined(position)) { - throw new DeveloperError('position is required'); - } - if (!defined(direction)) { - throw new DeveloperError('direction is required'); - } - if (!defined(up)) { - throw new DeveloperError('up is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); + Check.typeOf.object('up', up); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = right.x; result[1] = up.x; @@ -7131,9 +6822,7 @@ define('Core/Matrix4',[ * //creates a = [10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0] */ Matrix4.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], @@ -7177,12 +6866,11 @@ define('Core/Matrix4',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix4.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 3) { - throw new DeveloperError('row must be 0, 1, 2, or 3.'); - } - if (typeof column !== 'number' || column < 0 || column > 3) { - throw new DeveloperError('column must be 0, 1, 2, or 3.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 3); + + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 3); return column * 4 + row; }; @@ -7215,16 +6903,12 @@ define('Core/Matrix4',[ * // a.x = 12.0; a.y = 16.0; a.z = 20.0; a.w = 24.0; */ Matrix4.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var startIndex = index * 4; var x = matrix[startIndex]; @@ -7266,18 +6950,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 96.0, 25.0] */ Matrix4.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); var startIndex = index * 4; @@ -7298,15 +6977,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.setTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -7359,16 +7032,12 @@ define('Core/Matrix4',[ * // a.x = 18.0; a.y = 19.0; a.z = 20.0; a.w = 21.0; */ Matrix4.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 4]; @@ -7409,18 +7078,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 24.0, 25.0] */ Matrix4.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); result[index] = cartesian.x; @@ -7440,12 +7104,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter */ Matrix4.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[4], matrix[5], matrix[6], scratchColumn)); @@ -7477,15 +7137,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -7569,15 +7223,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -7607,15 +7255,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -7656,15 +7298,9 @@ define('Core/Matrix4',[ * var m3 = Cesium.Matrix4.multiplyTransformation(m1, m2, new Cesium.Matrix4()); */ Matrix4.multiplyTransformation = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -7742,15 +7378,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByMatrix3(m, rotation, m); */ Matrix4.multiplyByMatrix3 = function(matrix, rotation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('result', result); var left0 = matrix[0]; var left1 = matrix[1]; @@ -7818,15 +7448,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByTranslation(m, position, m); */ Matrix4.multiplyByTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); var x = translation.x; var y = translation.y; @@ -7878,15 +7502,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByScale */ Matrix4.multiplyByUniformScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scale', scale); + Check.typeOf.object('result', result); uniformScaleScratch.x = scale; uniformScaleScratch.y = scale; @@ -7915,15 +7533,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByUniformScale */ Matrix4.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); var scaleX = scale.x; var scaleY = scale.y; @@ -7962,15 +7574,9 @@ define('Core/Matrix4',[ * @returns {Cartesian4} The modified result parameter. */ Matrix4.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8006,15 +7612,9 @@ define('Core/Matrix4',[ * // Cesium.Matrix4.multiplyByVector(matrix, new Cesium.Cartesian4(p.x, p.y, p.z, 0.0), result); */ Matrix4.multiplyByPointAsVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8044,16 +7644,9 @@ define('Core/Matrix4',[ * var result = Cesium.Matrix4.multiplyByPoint(matrix, p, new Cesium.Cartesian3()); */ Matrix4.multiplyByPoint = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -8093,15 +7686,9 @@ define('Core/Matrix4',[ * // [-44.0, -46.0, -48.0, -50.0] */ Matrix4.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -8145,12 +7732,8 @@ define('Core/Matrix4',[ * // [-22.0, -23.0, -24.0, -25.0] */ Matrix4.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -8194,12 +7777,8 @@ define('Core/Matrix4',[ * // [13.0, 17.0, 21.0, 25.0] */ Matrix4.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var matrix1 = matrix[1]; var matrix2 = matrix[2]; @@ -8235,12 +7814,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -8354,9 +7929,7 @@ define('Core/Matrix4',[ * //Prints "Difference between both the matrices is not less than 0.1" on the console */ Matrix4.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -8387,12 +7960,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter. */ Matrix4.getTranslation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = matrix[12]; result.y = matrix[13]; @@ -8423,12 +7992,8 @@ define('Core/Matrix4',[ * // [12.0, 16.0, 20.0] */ Matrix4.getRotation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -8460,12 +8025,8 @@ define('Core/Matrix4',[ * @exception {RuntimeError} matrix is not invertible because its determinate is zero. */ Matrix4.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); // Special case for a zero scale matrix that can occur, for example, // when a model's node has a [0, 0, 0] scale. @@ -8603,12 +8164,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.inverseTransformation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); //This function is an optimized version of the below 4 lines. //var rT = Matrix3.transpose(Matrix4.getRotation(matrix)); @@ -8892,6 +8449,7 @@ define('Core/Matrix4',[ /*global define*/ define('Core/Rectangle',[ './Cartographic', + './Check', './defaultValue', './defined', './defineProperties', @@ -8901,6 +8459,7 @@ define('Core/Rectangle',[ './Math' ], function( Cartographic, + Check, defaultValue, defined, defineProperties, @@ -8997,13 +8556,8 @@ define('Core/Rectangle',[ * @returns {Number[]} The array that was packed into */ Rectangle.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -9024,9 +8578,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -9047,9 +8599,7 @@ define('Core/Rectangle',[ * @returns {Number} The width. */ Rectangle.computeWidth = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; if (east < west) { @@ -9064,9 +8614,7 @@ define('Core/Rectangle',[ * @returns {Number} The height. */ Rectangle.computeHeight = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); return rectangle.north - rectangle.south; }; @@ -9101,6 +8649,32 @@ define('Core/Rectangle',[ return result; }; + /** + * Creates an rectangle given the boundary longitude and latitude in radians. + * + * @param {Number} [west=0.0] The westernmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [south=0.0] The southernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Number} [east=0.0] The easternmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [north=0.0] The northernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Rectangle} [result] The object onto which to store the result, or undefined if a new instance should be created. + * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. + * + * @example + * var rectangle = Cesium.Rectangle.fromRadians(0.0, Math.PI/4, Math.PI/8, 3*Math.PI/4); + */ + Rectangle.fromRadians = function(west, south, east, north, result) { + if (!defined(result)) { + return new Rectangle(west, south, east, north); + } + + result.west = defaultValue(west, 0.0); + result.south = defaultValue(south, 0.0); + result.east = defaultValue(east, 0.0); + result.north = defaultValue(north, 0.0); + + return result; + }; + /** * Creates the smallest possible Rectangle that encloses all positions in the provided array. * @@ -9109,9 +8683,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartographicArray = function(cartographics, result) { - if (!defined(cartographics)) { - throw new DeveloperError('cartographics is required.'); - } + Check.defined('cartographics', cartographics); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -9164,9 +8736,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartesianArray = function(cartesians, ellipsoid, result) { - if (!defined(cartesians)) { - throw new DeveloperError('cartesians is required.'); - } + Check.defined('cartesians', cartesians); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -9282,9 +8852,7 @@ define('Core/Rectangle',[ * @returns {Boolean} <code>true</code> if the Rectangles are within the provided epsilon, <code>false</code> otherwise. */ Rectangle.prototype.equalsEpsilon = function(other, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon is required and must be a number.'); - } + Check.typeOf.number('epsilon', epsilon); return defined(other) && (Math.abs(this.west - other.west) <= epsilon) && @@ -9304,45 +8872,23 @@ define('Core/Rectangle',[ * @exception {DeveloperError} <code>west</code> must be in the interval [<code>-Pi</code>, <code>Pi</code>]. */ Rectangle.validate = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var north = rectangle.north; - if (typeof north !== 'number') { - throw new DeveloperError('north is required to be a number.'); - } - - if (north < -CesiumMath.PI_OVER_TWO || north > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('north must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('north', north, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('north', north, CesiumMath.PI_OVER_TWO); var south = rectangle.south; - if (typeof south !== 'number') { - throw new DeveloperError('south is required to be a number.'); - } - - if (south < -CesiumMath.PI_OVER_TWO || south > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('south must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('south', south, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('south', south, CesiumMath.PI_OVER_TWO); var west = rectangle.west; - if (typeof west !== 'number') { - throw new DeveloperError('west is required to be a number.'); - } - - if (west < -Math.PI || west > Math.PI) { - throw new DeveloperError('west must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('west', west, -Math.PI); + Check.typeOf.number.lessThanOrEquals('west', west, Math.PI); var east = rectangle.east; - if (typeof east !== 'number') { - throw new DeveloperError('east is required to be a number.'); - } - - if (east < -Math.PI || east > Math.PI) { - throw new DeveloperError('east must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('east', east, -Math.PI); + Check.typeOf.number.lessThanOrEquals('east', east, Math.PI); }; /** @@ -9353,9 +8899,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.south); @@ -9374,9 +8918,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.north); @@ -9395,9 +8937,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.north); @@ -9416,9 +8956,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.south); @@ -9437,9 +8975,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.center = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; @@ -9474,12 +9010,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.intersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var rectangleEast = rectangle.east; var rectangleWest = rectangle.west; @@ -9535,12 +9067,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.simpleIntersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var west = Math.max(rectangle.west, otherRectangle.west); var south = Math.max(rectangle.south, otherRectangle.south); @@ -9571,12 +9099,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.union = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); if (!defined(result)) { result = new Rectangle(); @@ -9620,12 +9144,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.expand = function(rectangle, cartographic, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); if (!defined(result)) { result = new Rectangle(); @@ -9645,14 +9165,10 @@ define('Core/Rectangle',[ * @param {Rectangle} rectangle The rectangle * @param {Cartographic} cartographic The cartographic to test. * @returns {Boolean} true if the provided cartographic is inside the rectangle, false otherwise. - */ - Rectangle.contains = function(rectangle, cartographic) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + */ + Rectangle.contains = function(rectangle, cartographic) { + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); var longitude = cartographic.longitude; var latitude = cartographic.latitude; @@ -9685,9 +9201,7 @@ define('Core/Rectangle',[ * @returns {Cartesian3[]} The modified result parameter or a new Array of Cartesians instances if none was provided. */ Rectangle.subsample = function(rectangle, ellipsoid, surfaceHeight, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84); surfaceHeight = defaultValue(surfaceHeight, 0.0); @@ -9765,9 +9279,9 @@ define('Core/Rectangle',[ define('Core/BoundingSphere',[ './Cartesian3', './Cartographic', + './Check', './defaultValue', './defined', - './DeveloperError', './Ellipsoid', './GeographicProjection', './Intersect', @@ -9778,9 +9292,9 @@ define('Core/BoundingSphere',[ ], function( Cartesian3, Cartographic, + Check, defaultValue, defined, - DeveloperError, Ellipsoid, GeographicProjection, Intersect, @@ -10110,9 +9624,7 @@ define('Core/BoundingSphere',[ stride = defaultValue(stride, 3); - if (stride < 3) { - throw new DeveloperError('stride must be 3 or greater.'); - } + Check.typeOf.number.greaterThanOrEquals('stride', stride, 3); var currentPos = fromPointsCurrentPos; currentPos.x = positions[0] + center.x; @@ -10416,9 +9928,8 @@ define('Core/BoundingSphere',[ * var sphere = Cesium.BoundingSphere.fromCornerPoints(new Cesium.Cartesian3(-0.5, -0.5, -0.5), new Cesium.Cartesian3(0.5, 0.5, 0.5)); */ BoundingSphere.fromCornerPoints = function(corner, oppositeCorner, result) { - if (!defined(corner) || !defined(oppositeCorner)) { - throw new DeveloperError('corner and oppositeCorner are required.'); - } + Check.typeOf.object('corner', corner); + Check.typeOf.object('oppositeCorner', oppositeCorner); if (!defined(result)) { result = new BoundingSphere(); @@ -10442,9 +9953,7 @@ define('Core/BoundingSphere',[ * var boundingSphere = Cesium.BoundingSphere.fromEllipsoid(ellipsoid); */ BoundingSphere.fromEllipsoid = function(ellipsoid, result) { - if (!defined(ellipsoid)) { - throw new DeveloperError('ellipsoid is required.'); - } + Check.typeOf.object('ellipsoid', ellipsoid); if (!defined(result)) { result = new BoundingSphere(); @@ -10570,13 +10079,8 @@ define('Core/BoundingSphere',[ * @returns {Number[]} The array that was packed into */ BoundingSphere.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -10598,9 +10102,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if one was not provided. */ BoundingSphere.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -10627,13 +10129,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.union = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); if (!defined(result)) { result = new BoundingSphere(); @@ -10682,13 +10179,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.expand = function(sphere, point, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(point)) { - throw new DeveloperError('point is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('point', point); result = BoundingSphere.clone(sphere, result); @@ -10711,13 +10203,8 @@ define('Core/BoundingSphere',[ * intersects the plane. */ BoundingSphere.intersectPlane = function(sphere, plane) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(plane)) { - throw new DeveloperError('plane is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('plane', plane); var center = sphere.center; var radius = sphere.radius; @@ -10743,13 +10230,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.transform = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -10777,12 +10259,8 @@ define('Core/BoundingSphere',[ * }); */ BoundingSphere.distanceSquaredTo = function(sphere, cartesian) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('cartesian', cartesian); var diff = Cartesian3.subtract(sphere.center, cartesian, distanceSquaredToScratch); return Cartesian3.magnitudeSquared(diff) - sphere.radius * sphere.radius; @@ -10804,13 +10282,8 @@ define('Core/BoundingSphere',[ * var newBoundingSphere = Cesium.BoundingSphere.transformWithoutScale(boundingSphere, modelMatrix); */ BoundingSphere.transformWithoutScale = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -10837,17 +10310,9 @@ define('Core/BoundingSphere',[ * @returns {Interval} The nearest and farthest distances on the bounding sphere from position in direction. */ BoundingSphere.computePlaneDistances = function(sphere, position, direction, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(position)) { - throw new DeveloperError('position is required.'); - } - - if (!defined(direction)) { - throw new DeveloperError('direction is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); if (!defined(result)) { result = new Interval(); @@ -10882,9 +10347,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.projectTo2D = function(sphere, projection, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } + Check.typeOf.object('sphere', sphere); projection = defaultValue(projection, projectTo2DProjection); @@ -10979,12 +10442,8 @@ define('Core/BoundingSphere',[ * @returns {Boolean} <code>true</code> if the sphere is not visible; otherwise <code>false</code>. */ BoundingSphere.isOccluded = function(sphere, occluder) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(occluder)) { - throw new DeveloperError('occluder is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('occluder', occluder); return !occluder.isBoundingSphereVisible(sphere); }; @@ -12193,7 +11652,10 @@ define('Core/WebGLConstants',[ COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : 0x9279, TEXTURE_IMMUTABLE_FORMAT : 0x912F, MAX_ELEMENT_INDEX : 0x8D6B, - TEXTURE_IMMUTABLE_LEVELS : 0x82DF + TEXTURE_IMMUTABLE_LEVELS : 0x82DF, + + // Extensions + MAX_TEXTURE_MAX_ANISOTROPY_EXT : 0x84FF }; return freezeObject(WebGLConstants); @@ -12723,7 +12185,7 @@ define('Core/Geometry',[ * <li><code>position</code> - 3D vertex position. 64-bit floating-point (for precision). 3 components per attribute. See {@link VertexFormat#position}.</li> * <li><code>normal</code> - Normal (normalized), commonly used for lighting. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#normal}.</li> * <li><code>st</code> - 2D texture coordinate. 32-bit floating-point. 2 components per attribute. See {@link VertexFormat#st}.</li> - * <li><code>binormal</code> - Binormal (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#binormal}.</li> + * <li><code>bitangent</code> - Bitangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#bitangent}.</li> * <li><code>tangent</code> - Tangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#tangent}.</li> * </ul> * </p> @@ -12752,7 +12214,7 @@ define('Core/Geometry',[ * componentsPerAttribute : 3, * values : new Float32Array(0) * }); - * + * * @see GeometryAttribute * @see VertexFormat */ @@ -13033,7 +12495,7 @@ define('Core/GeometryAttributes',[ this.st = options.st; /** - * The binormal attribute (normalized), which is used for tangent-space effects like bump mapping. + * The bitangent attribute (normalized), which is used for tangent-space effects like bump mapping. * <p> * 32-bit floating-point. 3 components per attribute. * </p> @@ -13042,7 +12504,7 @@ define('Core/GeometryAttributes',[ * * @default undefined */ - this.binormal = options.binormal; + this.bitangent = options.bitangent; /** * The tangent attribute (normalized), which is used for tangent-space effects like bump mapping. @@ -13453,12 +12915,14 @@ define('Core/AxisAlignedBoundingBox',[ /*global define*/ define('Core/Cartesian2',[ + './Check', './defaultValue', './defined', './DeveloperError', './freezeObject', './Math' ], function( + Check, defaultValue, defined, DeveloperError, @@ -13570,12 +13034,8 @@ define('Core/Cartesian2',[ * @returns {Number[]} The array that was packed into */ Cartesian2.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -13594,9 +13054,7 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided. */ Cartesian2.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -13616,9 +13074,7 @@ define('Core/Cartesian2',[ * @returns {Number[]} The packed array. */ Cartesian2.packArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -13641,9 +13097,7 @@ define('Core/Cartesian2',[ * @returns {Cartesian2[]} The unpacked array. */ Cartesian2.unpackArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -13686,9 +13140,7 @@ define('Core/Cartesian2',[ * @returns {Number} The value of the maximum component. */ Cartesian2.maximumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y); }; @@ -13700,9 +13152,7 @@ define('Core/Cartesian2',[ * @returns {Number} The value of the minimum component. */ Cartesian2.minimumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y); }; @@ -13716,15 +13166,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} A cartesian with the minimum components. */ Cartesian2.minimumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); @@ -13742,15 +13186,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} A cartesian with the maximum components. */ Cartesian2.maximumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -13764,9 +13202,7 @@ define('Core/Cartesian2',[ * @returns {Number} The squared magnitude. */ Cartesian2.magnitudeSquared = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y; }; @@ -13832,12 +13268,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.normalize = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian2.magnitude(cartesian); @@ -13859,12 +13291,8 @@ define('Core/Cartesian2',[ * @returns {Number} The dot product. */ Cartesian2.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y; }; @@ -13878,15 +13306,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.multiplyComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -13902,15 +13324,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.divideComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x / right.x; result.y = left.y / right.y; @@ -13926,15 +13342,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -13950,15 +13360,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -13974,15 +13378,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.multiplyByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -13998,15 +13396,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.divideByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -14021,12 +13413,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.negate = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -14041,12 +13429,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.abs = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -14064,18 +13448,10 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian2.multiplyByScalar(end, t, lerpScratch); result = Cartesian2.multiplyByScalar(start, 1.0 - t, result); @@ -14092,12 +13468,8 @@ define('Core/Cartesian2',[ * @returns {Number} The angle between the Cartesians. */ Cartesian2.angleBetween = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian2.normalize(left, angleBetweenScratch); Cartesian2.normalize(right, angleBetweenScratch2); @@ -14113,12 +13485,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The most orthogonal axis. */ Cartesian2.mostOrthogonalAxis = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian2.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian2.abs(f, f); @@ -15025,6 +14393,7 @@ define('Core/IntersectionTests',[ './defaultValue', './defined', './DeveloperError', + './Interval', './Math', './Matrix3', './QuadraticRealPolynomial', @@ -15036,6 +14405,7 @@ define('Core/IntersectionTests',[ defaultValue, defined, DeveloperError, + Interval, CesiumMath, Matrix3, QuadraticRealPolynomial, @@ -15307,7 +14677,7 @@ define('Core/IntersectionTests',[ function raySphere(ray, sphere, result) { if (!defined(result)) { - result = {}; + result = new Interval(); } var origin = ray.origin; @@ -15338,8 +14708,8 @@ define('Core/IntersectionTests',[ * * @param {Ray} ray The ray. * @param {BoundingSphere} sphere The sphere. - * @param {Object} [result] The result onto which to store the result. - * @returns {Object} An object with the first (<code>start</code>) and the second (<code>stop</code>) intersection scalars for points along the ray or undefined if there are no intersections. + * @param {Interval} [result] The result onto which to store the result. + * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections. */ IntersectionTests.raySphere = function(ray, sphere, result) { if (!defined(ray)) { @@ -15367,8 +14737,8 @@ define('Core/IntersectionTests',[ * @param {Cartesian3} p0 An end point of the line segment. * @param {Cartesian3} p1 The other end point of the line segment. * @param {BoundingSphere} sphere The sphere. - * @param {Object} [result] The result onto which to store the result. - * @returns {Object} An object with the first (<code>start</code>) and the second (<code>stop</code>) intersection scalars for points along the line segment or undefined if there are no intersections. + * @param {Interval} [result] The result onto which to store the result. + * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections. */ IntersectionTests.lineSegmentSphere = function(p0, p1, sphere, result) { if (!defined(p0)) { @@ -15406,7 +14776,7 @@ define('Core/IntersectionTests',[ * * @param {Ray} ray The ray. * @param {Ellipsoid} ellipsoid The ellipsoid. - * @returns {Object} An object with the first (<code>start</code>) and the second (<code>stop</code>) intersection scalars for points along the ray or undefined if there are no intersections. + * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections. */ IntersectionTests.rayEllipsoid = function(ray, ellipsoid) { if (!defined(ray)) { @@ -15448,10 +14818,7 @@ define('Core/IntersectionTests',[ var root0 = temp / w2; var root1 = difference / temp; if (root0 < root1) { - return { - start : root0, - stop : root1 - }; + return new Interval(root0, root1); } return { @@ -15461,10 +14828,7 @@ define('Core/IntersectionTests',[ } else { // qw2 == product. Repeated roots (2 intersections). var root = Math.sqrt(difference / w2); - return { - start : root, - stop : root - }; + return new Interval(root, root); } } else if (q2 < 1.0) { // Inside ellipsoid (2 intersections). @@ -15474,19 +14838,13 @@ define('Core/IntersectionTests',[ discriminant = qw * qw - product; temp = -qw + Math.sqrt(discriminant); // Positively valued. - return { - start : 0.0, - stop : temp / w2 - }; + return new Interval(0.0, temp / w2); } else { // q2 == 1.0. On ellipsoid. if (qw < 0.0) { // Looking inward. w2 = Cartesian3.magnitudeSquared(w); - return { - start : 0.0, - stop : -qw / w2 - }; + return new Interval(0.0, -qw / w2); } // qw >= 0.0. Looking outward or tangent. @@ -16818,138 +16176,26 @@ define('ThirdParty/when',[],function () { // Skip holes if(i in arr) { reduced = reduceFunc(reduced, arr[i], i, arr); - } - } - - return reduced; - }; - - function identity(x) { - return x; - } - - return when; -}); -})(typeof define == 'function' && define.amd - ? define - : function (factory) { typeof exports === 'object' - ? (module.exports = factory()) - : (this.when = factory()); - } - // Boilerplate for AMD, Node, and browser global -); - -/*global define*/ -define('Core/oneTimeWarning',[ - './defaultValue', - './defined', - './DeveloperError' - ], function( - defaultValue, - defined, - DeveloperError) { - "use strict"; - - var warnings = {}; - - /** - * Logs a one time message to the console. Use this function instead of - * <code>console.log</code> directly since this does not log duplicate messages - * unless it is called from multiple workers. - * - * @exports oneTimeWarning - * - * @param {String} identifier The unique identifier for this warning. - * @param {String} [message=identifier] The message to log to the console. - * - * @example - * for(var i=0;i<foo.length;++i) { - * if (!defined(foo[i].bar)) { - * // Something that can be recovered from but may happen a lot - * oneTimeWarning('foo.bar undefined', 'foo.bar is undefined. Setting to 0.'); - * foo[i].bar = 0; - * // ... - * } - * } - * - * @private - */ - function oneTimeWarning(identifier, message) { - if (!defined(identifier)) { - throw new DeveloperError('identifier is required.'); - } - - if (!defined(warnings[identifier])) { - warnings[identifier] = true; - console.log(defaultValue(message, identifier)); - } - } - - oneTimeWarning.geometryOutlines = 'Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.'; + } + } - return oneTimeWarning; -}); + return reduced; + }; -/*global define*/ -define('Core/deprecationWarning',[ - './defined', - './DeveloperError', - './oneTimeWarning' - ], function( - defined, - DeveloperError, - oneTimeWarning) { - 'use strict'; - - /** - * Logs a deprecation message to the console. Use this function instead of - * <code>console.log</code> directly since this does not log duplicate messages - * unless it is called from multiple workers. - * - * @exports deprecationWarning - * - * @param {String} identifier The unique identifier for this deprecated API. - * @param {String} message The message to log to the console. - * - * @example - * // Deprecated function or class - * function Foo() { - * deprecationWarning('Foo', 'Foo was deprecated in Cesium 1.01. It will be removed in 1.03. Use newFoo instead.'); - * // ... - * } - * - * // Deprecated function - * Bar.prototype.func = function() { - * deprecationWarning('Bar.func', 'Bar.func() was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newFunc() instead.'); - * // ... - * }; - * - * // Deprecated property - * defineProperties(Bar.prototype, { - * prop : { - * get : function() { - * deprecationWarning('Bar.prop', 'Bar.prop was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newProp instead.'); - * // ... - * }, - * set : function(value) { - * deprecationWarning('Bar.prop', 'Bar.prop was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newProp instead.'); - * // ... - * } - * } - * }); - * - * @private - */ - function deprecationWarning(identifier, message) { - if (!defined(identifier) || !defined(message)) { - throw new DeveloperError('identifier and message are required.'); - } - - oneTimeWarning(identifier, message); - } + function identity(x) { + return x; + } - return deprecationWarning; + return when; }); +})(typeof define == 'function' && define.amd + ? define + : function (factory) { typeof exports === 'object' + ? (module.exports = factory()) + : (this.when = factory()); + } + // Boilerplate for AMD, Node, and browser global +); /*global define*/ define('Core/binarySearch',[ @@ -20660,6 +19906,7 @@ define('Core/Iau2006XysData',[ /*global define*/ define('Core/Quaternion',[ './Cartesian3', + './Check', './defaultValue', './defined', './DeveloperError', @@ -20669,6 +19916,7 @@ define('Core/Quaternion',[ './Matrix3' ], function( Cartesian3, + Check, defaultValue, defined, DeveloperError, @@ -20731,12 +19979,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided. */ Quaternion.fromAxisAngle = function(axis, angle, result) { - if (!defined(axis)) { - throw new DeveloperError('axis is required.'); - } - if (typeof angle !== 'number') { - throw new DeveloperError('angle is required and must be a number.'); - } + Check.typeOf.object('axis', axis); + Check.typeOf.number('angle', angle); var halfAngle = angle / 2.0; var s = Math.sin(halfAngle); @@ -20768,9 +20012,7 @@ define('Core/Quaternion',[ * @see Matrix3.fromQuaternion */ Quaternion.fromRotationMatrix = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); var root; var x; @@ -20844,15 +20086,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter or a new Quaternion instance if none was provided. */ Quaternion.fromHeadingPitchRoll = function(heading, pitch, roll, result) { - if (!defined(heading)) { - throw new DeveloperError('heading is required.'); - } - if (!defined(pitch)) { - throw new DeveloperError('pitch is required.'); - } - if (!defined(roll)) { - throw new DeveloperError('roll is required.'); - } + Check.typeOf.number('heading', heading); + Check.typeOf.number('pitch', pitch); + Check.typeOf.number('roll', roll); var rollQuaternion = Quaternion.fromAxisAngle(Cartesian3.UNIT_X, roll, scratchHPRQuaternion); var pitchQuaternion = Quaternion.fromAxisAngle(Cartesian3.UNIT_Y, -pitch, result); @@ -20883,13 +20119,8 @@ define('Core/Quaternion',[ * @returns {Number[]} The array that was packed into */ Quaternion.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -20910,9 +20141,7 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided. */ Quaternion.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -20967,7 +20196,7 @@ define('Core/Quaternion',[ * * @param {Number[]} array The array previously packed for interpolation. * @param {Number[]} sourceArray The original packed array. - * @param {Number} [startingIndex=0] The startingIndex used to convert the array. + * @param {Number} [firstIndex=0] The firstIndex used to convert the array. * @param {Number} [lastIndex=packedArray.length] The lastIndex used to convert the array. * @param {Quaternion} [result] The object into which to store the result. * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided. @@ -21021,12 +20250,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.conjugate = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); result.x = -quaternion.x; result.y = -quaternion.y; @@ -21042,9 +20267,7 @@ define('Core/Quaternion',[ * @returns {Number} The magnitude squared. */ Quaternion.magnitudeSquared = function(quaternion) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); return quaternion.x * quaternion.x + quaternion.y * quaternion.y + quaternion.z * quaternion.z + quaternion.w * quaternion.w; }; @@ -21067,9 +20290,7 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.normalize = function(quaternion, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); var inverseMagnitude = 1.0 / Quaternion.magnitude(quaternion); var x = quaternion.x * inverseMagnitude; @@ -21092,9 +20313,7 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.inverse = function(quaternion, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); var magnitudeSquared = Quaternion.magnitudeSquared(quaternion); result = Quaternion.conjugate(quaternion, result); @@ -21110,15 +20329,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -21136,15 +20349,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -21161,12 +20368,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.negate = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); result.x = -quaternion.x; result.y = -quaternion.y; @@ -21183,12 +20386,8 @@ define('Core/Quaternion',[ * @returns {Number} The dot product. */ Quaternion.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w; }; @@ -21202,15 +20401,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var leftX = left.x; var leftY = left.y; @@ -21243,15 +20436,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.multiplyByScalar = function(quaternion, scalar, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = quaternion.x * scalar; result.y = quaternion.y * scalar; @@ -21269,15 +20456,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.divideByScalar = function(quaternion, scalar, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = quaternion.x / scalar; result.y = quaternion.y / scalar; @@ -21294,12 +20475,8 @@ define('Core/Quaternion',[ * @returns {Cartesian3} The modified result parameter. */ Quaternion.computeAxis = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); var w = quaternion.w; if (Math.abs(w - 1.0) < CesiumMath.EPSILON6) { @@ -21322,9 +20499,7 @@ define('Core/Quaternion',[ * @returns {Number} The angle of rotation. */ Quaternion.computeAngle = function(quaternion) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); if (Math.abs(quaternion.w - 1.0) < CesiumMath.EPSILON6) { return 0.0; @@ -21343,18 +20518,10 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); lerpScratch = Quaternion.multiplyByScalar(end, t, lerpScratch); result = Quaternion.multiplyByScalar(start, 1.0 - t, result); @@ -21376,18 +20543,10 @@ define('Core/Quaternion',[ * @see Quaternion#fastSlerp */ Quaternion.slerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var dot = Quaternion.dot(start, end); @@ -21420,12 +20579,8 @@ define('Core/Quaternion',[ * @returns {Cartesian3} The modified result parameter. */ Quaternion.log = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); var theta = CesiumMath.acosClamped(quaternion.w); var thetaOverSinTheta = 0.0; @@ -21445,12 +20600,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.exp = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var theta = Cartesian3.magnitude(cartesian); var sinThetaOverTheta = 0.0; @@ -21485,12 +20636,10 @@ define('Core/Quaternion',[ * @see Quaternion#squad */ Quaternion.computeInnerQuadrangle = function(q0, q1, q2, result) { - if (!defined(q0) || !defined(q1) || !defined(q2)) { - throw new DeveloperError('q0, q1, and q2 are required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('q0', q0); + Check.typeOf.object('q1', q1); + Check.typeOf.object('q2', q2); + Check.typeOf.object('result', result); var qInv = Quaternion.conjugate(q1, squadScratchQuaternion0); Quaternion.multiply(qInv, q2, squadScratchQuaternion1); @@ -21532,15 +20681,12 @@ define('Core/Quaternion',[ * @see Quaternion#computeInnerQuadrangle */ Quaternion.squad = function(q0, q1, s0, s1, t, result) { - if (!defined(q0) || !defined(q1) || !defined(s0) || !defined(s1)) { - throw new DeveloperError('q0, q1, s0, and s1 are required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('q0', q0); + Check.typeOf.object('q1', q1); + Check.typeOf.object('s0', s0); + Check.typeOf.object('s1', s1); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var slerp0 = Quaternion.slerp(q0, q1, t, squadScratchQuaternion0); var slerp1 = Quaternion.slerp(s0, s1, t, squadScratchQuaternion1); @@ -21577,18 +20723,10 @@ define('Core/Quaternion',[ * @see Quaternion#slerp */ Quaternion.fastSlerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var x = Quaternion.dot(start, end); @@ -21637,15 +20775,12 @@ define('Core/Quaternion',[ * @see Quaternion#squad */ Quaternion.fastSquad = function(q0, q1, s0, s1, t, result) { - if (!defined(q0) || !defined(q1) || !defined(s0) || !defined(s1)) { - throw new DeveloperError('q0, q1, s0, and s1 are required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('q0', q0); + Check.typeOf.object('q1', q1); + Check.typeOf.object('s0', s0); + Check.typeOf.object('s1', s1); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var slerp0 = Quaternion.fastSlerp(q0, q1, t, squadScratchQuaternion0); var slerp1 = Quaternion.fastSlerp(s0, s1, t, squadScratchQuaternion1); @@ -21681,9 +20816,7 @@ define('Core/Quaternion',[ * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. */ Quaternion.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon is required and must be a number.'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || ((defined(left)) && @@ -21763,9 +20896,9 @@ define('Core/Transforms',[ './Cartesian3', './Cartesian4', './Cartographic', + './Check', './defaultValue', './defined', - './deprecationWarning', './DeveloperError', './EarthOrientationParameters', './EarthOrientationParametersSample', @@ -21785,9 +20918,9 @@ define('Core/Transforms',[ Cartesian3, Cartesian4, Cartographic, + Check, defaultValue, defined, - deprecationWarning, DeveloperError, EarthOrientationParameters, EarthOrientationParametersSample, @@ -22223,19 +21356,12 @@ define('Core/Transforms',[ * var hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll); * var transform = Cesium.Transforms.headingPitchRollToFixedFrame(center, hpr); */ - Transforms.headingPitchRollToFixedFrame = function(origin, headingPitchRoll, pitch, roll, ellipsoid, result) { - var heading; - if (typeof headingPitchRoll === 'object') { - // Shift arguments using assignments to encourage JIT optimization. - ellipsoid = pitch; - result = roll; - heading = headingPitchRoll.heading; - pitch = headingPitchRoll.pitch; - roll = headingPitchRoll.roll; - } else { - deprecationWarning('headingPitchRollToFixedFrame', 'headingPitchRollToFixedFrame with separate heading, pitch, and roll arguments was deprecated in 1.27. It will be removed in 1.30. Use a HeadingPitchRoll object.'); - heading = headingPitchRoll; - } + Transforms.headingPitchRollToFixedFrame = function(origin, headingPitchRoll, ellipsoid, result) { + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + var heading = headingPitchRoll.heading; + var pitch = headingPitchRoll.pitch; + var roll = headingPitchRoll.roll; + // checks for required parameters happen in the called functions var hprQuaternion = Quaternion.fromHeadingPitchRoll(heading, pitch, roll, scratchHPRQuaternion); var hprMatrix = Matrix4.fromTranslationQuaternionRotationScale(Cartesian3.ZERO, hprQuaternion, scratchScale, scratchHPRMatrix4); @@ -22243,7 +21369,6 @@ define('Core/Transforms',[ return Matrix4.multiply(result, hprMatrix, result); }; - var scratchHPR = new HeadingPitchRoll(); var scratchENUMatrix4 = new Matrix4(); var scratchHPRMatrix3 = new Matrix3(); @@ -22268,22 +21393,10 @@ define('Core/Transforms',[ * var hpr = new HeadingPitchRoll(heading, pitch, roll); * var quaternion = Cesium.Transforms.headingPitchRollQuaternion(center, hpr); */ - Transforms.headingPitchRollQuaternion = function(origin, headingPitchRoll, pitch, roll, ellipsoid, result) { - var hpr; - if (typeof headingPitchRoll === 'object') { - // Shift arguments using assignment to encourage JIT optimization. - hpr = headingPitchRoll; - ellipsoid = pitch; - result = roll; - } else { - deprecationWarning('headingPitchRollQuaternion', 'headingPitchRollQuaternion with separate heading, pitch, and roll arguments was deprecated in 1.27. It will be removed in 1.30. Use a HeadingPitchRoll object.'); - scratchHPR.heading = headingPitchRoll; - scratchHPR.pitch = pitch; - scratchHPR.roll = roll; - hpr = scratchHPR; - } + Transforms.headingPitchRollQuaternion = function(origin, headingPitchRoll, ellipsoid, result) { // checks for required parameters happen in the called functions - var transform = Transforms.headingPitchRollToFixedFrame(origin, hpr, ellipsoid, scratchENUMatrix4); + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + var transform = Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, scratchENUMatrix4); var rotation = Matrix4.getRotation(transform, scratchHPRMatrix3); return Quaternion.fromRotationMatrix(rotation, result); }; @@ -22759,6 +21872,46 @@ define('Core/Transforms',[ return result; }; + var swizzleMatrix = new Matrix4( + 0.0, 0.0, 1.0, 0.0, + 1.0, 0.0, 0.0, 0.0, + 0.0, 1.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + + /** + * @private + */ + Transforms.wgs84To2DModelMatrix = function(projection, center, result) { + if (!defined(projection)) { + throw new DeveloperError('projection is required.'); + } + if (!defined(center)) { + throw new DeveloperError('center is required.'); + } + if (!defined(result)) { + throw new DeveloperError('result is required.'); + } + + var ellipsoid = projection.ellipsoid; + + var fromENU = Transforms.eastNorthUpToFixedFrame(center, ellipsoid, scratchFromENU); + var toENU = Matrix4.inverseTransformation(fromENU, scratchToENU); + + var cartographic = ellipsoid.cartesianToCartographic(center, scratchCartographic); + var projectedPosition = projection.project(cartographic, scratchCartesian3Projection); + var newOrigin = scratchCartesian4NewOrigin; + newOrigin.x = projectedPosition.z; + newOrigin.y = projectedPosition.x; + newOrigin.z = projectedPosition.y; + newOrigin.w = 1.0; + + var translation = Matrix4.fromTranslation(newOrigin, scratchFromENU); + Matrix4.multiply(swizzleMatrix, toENU, result); + Matrix4.multiply(translation, result, result); + + return result; + }; + return Transforms; }); @@ -24405,6 +23558,7 @@ define('Core/EllipsoidGeodesic',[ * Provides the location of a point at the indicated portion along the geodesic. * * @param {Number} fraction The portion of the distance between the initial and final points. + * @param {Cartographic} result The object in which to store the result. * @returns {Cartographic} The location of the point along the geodesic. */ EllipsoidGeodesic.prototype.interpolateUsingFraction = function(fraction, result) { @@ -24415,6 +23569,7 @@ define('Core/EllipsoidGeodesic',[ * Provides the location of a point at the indicated distance along the geodesic. * * @param {Number} distance The distance from the inital point to the point of interest along the geodesic + * @param {Cartographic} result The object in which to store the result. * @returns {Cartographic} The location of the point along the geodesic. * * @exception {DeveloperError} start and end must be set before calling function interpolateUsingSurfaceDistance @@ -24486,6 +23641,30 @@ define('Core/EllipsoidGeodesic',[ return EllipsoidGeodesic; }); +/*global define*/ +define('Core/isArray',[ + './defined' + ], function( + defined) { + 'use strict'; + + /** + * Tests an object to see if it is an array. + * @exports isArray + * + * @param {Object} value The value to test. + * @returns {Boolean} true if the value is an array, false otherwise. + */ + var isArray = Array.isArray; + if (!defined(isArray)) { + isArray = function(value) { + return Object.prototype.toString.call(value) === '[object Array]'; + }; + } + + return isArray; +}); + /*global define*/ define('Core/PolylinePipeline',[ './Cartesian3', @@ -24690,10 +23869,10 @@ define('Core/PolylinePipeline',[ /** * Subdivides polyline and raises all points to the specified height. Returns an array of numbers to represent the positions. - * @param {Cartesian3[]} positions The array of type {Cartesian3} representing positions. - * @param {Number|Number[]} [height=0.0] A number or array of numbers representing the heights of each position. - * @param {Number} [granularity = CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. - * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie. + * @param {Cartesian3[]} options.positions The array of type {Cartesian3} representing positions. + * @param {Number|Number[]} [options.height=0.0] A number or array of numbers representing the heights of each position. + * @param {Number} [options.granularity = CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. + * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie. * @returns {Number[]} A new array of positions of type {Number} that have been subdivided and raised to the surface of the ellipsoid. * * @example @@ -24775,10 +23954,10 @@ define('Core/PolylinePipeline',[ /** * Subdivides polyline and raises all points to the specified height. Returns an array of new {Cartesian3} positions. - * @param {Cartesian3[]} positions The array of type {Cartesian3} representing positions. - * @param {Number|Number[]} [height=0.0] A number or array of numbers representing the heights of each position. - * @param {Number} [granularity = CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. - * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie. + * @param {Cartesian3[]} options.positions The array of type {Cartesian3} representing positions. + * @param {Number|Number[]} [options.height=0.0] A number or array of numbers representing the heights of each position. + * @param {Number} [options.granularity = CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. + * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie. * @returns {Cartesian3[]} A new array of cartesian3 positions that have been subdivided and raised to the surface of the ellipsoid. * * @example diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/transferTypedArrayTest.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/transferTypedArrayTest.js index 27ca3bf2..eb7e9fee 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/transferTypedArrayTest.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/transferTypedArrayTest.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/upsampleQuantizedTerrainMesh.js b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/upsampleQuantizedTerrainMesh.js index d396a1d8..9767fe45 100644 --- a/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/upsampleQuantizedTerrainMesh.js +++ b/gwt-cs-main/src/main/resources/org/cesiumjs/public/cs/CesiumUnminified/Workers/upsampleQuantizedTerrainMesh.js @@ -1,7 +1,7 @@ /** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * - * Copyright 2011-2016 Cesium Contributors + * Copyright 2011-2017 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,68 +45,6 @@ define('Core/defined',[],function() { return defined; }); -/*global define*/ -define('Core/freezeObject',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Freezes an object, using Object.freeze if available, otherwise returns - * the object unchanged. This function should be used in setup code to prevent - * errors from completely halting JavaScript execution in legacy browsers. - * - * @private - * - * @exports freezeObject - */ - var freezeObject = Object.freeze; - if (!defined(freezeObject)) { - freezeObject = function(o) { - return o; - }; - } - - return freezeObject; -}); - -/*global define*/ -define('Core/defaultValue',[ - './freezeObject' - ], function( - freezeObject) { - 'use strict'; - - /** - * Returns the first parameter if not undefined, otherwise the second parameter. - * Useful for setting a default value for a parameter. - * - * @exports defaultValue - * - * @param {*} a - * @param {*} b - * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter. - * - * @example - * param = Cesium.defaultValue(param, 'default'); - */ - function defaultValue(a, b) { - if (a !== undefined) { - return a; - } - return b; - } - - /** - * A frozen empty object that can be used as the default value for options passed as - * an object literal. - */ - defaultValue.EMPTY_OBJECT = freezeObject({}); - - return defaultValue; -}); - /*global define*/ define('Core/DeveloperError',[ './defined' @@ -188,6 +126,238 @@ define('Core/DeveloperError',[ return DeveloperError; }); +/*global define*/ +define('Core/Check',[ + './defined', + './DeveloperError' + ], function( + defined, + DeveloperError) { + 'use strict'; + + /** + * Contains functions for checking that supplied arguments are of a specified type + * or meet specified conditions + * @private + */ + var Check = {}; + + /** + * Contains type checking functions, all using the typeof operator + */ + Check.typeOf = {}; + + function getUndefinedErrorMessage(name) { + return name + ' is required, actual value was undefined'; + } + + function getFailedTypeErrorMessage(actual, expected, name) { + return 'Expected ' + name + ' to be typeof ' + expected + ', actual typeof was ' + actual; + } + + /** + * Throws if test is not defined + * + * @param {String} name The name of the variable being tested + * @param {*} test The value that is to be checked + * @exception {DeveloperError} test must be defined + */ + Check.defined = function (name, test) { + if (!defined(test)) { + throw new DeveloperError(getUndefinedErrorMessage(name)); + } + }; + + /** + * Throws if test is not typeof 'function' + * + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'function' + */ + Check.typeOf.func = function (name, test) { + if (typeof test !== 'function') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); + } + }; + + /** + * Throws if test is not typeof 'string' + * + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'string' + */ + Check.typeOf.string = function (name, test) { + if (typeof test !== 'string') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); + } + }; + + /** + * Throws if test is not typeof 'number' + * + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'number' + */ + Check.typeOf.number = function (name, test) { + if (typeof test !== 'number') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); + } + }; + + /** + * Throws if test is not typeof 'number' and less than limit + * + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than limit + */ + Check.typeOf.number.lessThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test >= limit) { + throw new DeveloperError('Expected ' + name + ' to be less than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and less than or equal to limit + * + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and less than or equal to limit + */ + Check.typeOf.number.lessThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test > limit) { + throw new DeveloperError('Expected ' + name + ' to be less than or equal to ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and greater than limit + * + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than limit + */ + Check.typeOf.number.greaterThan = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test <= limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than ' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'number' and greater than or equal to limit + * + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @param {Number} limit The limit value to compare against + * @exception {DeveloperError} test must be typeof 'number' and greater than or equal to limit + */ + Check.typeOf.number.greaterThanOrEquals = function (name, test, limit) { + Check.typeOf.number(name, test); + if (test < limit) { + throw new DeveloperError('Expected ' + name + ' to be greater than or equal to' + limit + ', actual value was ' + test); + } + }; + + /** + * Throws if test is not typeof 'object' + * + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'object' + */ + Check.typeOf.object = function (name, test) { + if (typeof test !== 'object') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'object', name)); + } + }; + + /** + * Throws if test is not typeof 'boolean' + * + * @param {String} name The name of the variable being tested + * @param {*} test The value to test + * @exception {DeveloperError} test must be typeof 'boolean' + */ + Check.typeOf.bool = function (name, test) { + if (typeof test !== 'boolean') { + throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'boolean', name)); + } + }; + + return Check; +}); + +/*global define*/ +define('Core/freezeObject',[ + './defined' + ], function( + defined) { + 'use strict'; + + /** + * Freezes an object, using Object.freeze if available, otherwise returns + * the object unchanged. This function should be used in setup code to prevent + * errors from completely halting JavaScript execution in legacy browsers. + * + * @private + * + * @exports freezeObject + */ + var freezeObject = Object.freeze; + if (!defined(freezeObject)) { + freezeObject = function(o) { + return o; + }; + } + + return freezeObject; +}); + +/*global define*/ +define('Core/defaultValue',[ + './freezeObject' + ], function( + freezeObject) { + 'use strict'; + + /** + * Returns the first parameter if not undefined, otherwise the second parameter. + * Useful for setting a default value for a parameter. + * + * @exports defaultValue + * + * @param {*} a + * @param {*} b + * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter. + * + * @example + * param = Cesium.defaultValue(param, 'default'); + */ + function defaultValue(a, b) { + if (a !== undefined) { + return a; + } + return b; + } + + /** + * A frozen empty object that can be used as the default value for options passed as + * an object literal. + */ + defaultValue.EMPTY_OBJECT = freezeObject({}); + + return defaultValue; +}); + /* I've wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace so it's better encapsulated. Now you can have multiple random number generators @@ -872,7 +1042,7 @@ define('Core/Math',[ if (!defined(angle)) { throw new DeveloperError('angle is required.'); } - + return CesiumMath.clamp(angle, -1*CesiumMath.PI_OVER_TWO, CesiumMath.PI_OVER_TWO); }; @@ -882,11 +1052,11 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [<code>-CesiumMath.PI</code>, <code>CesiumMath.PI</code>]. */ - CesiumMath.negativePiToPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.negativePiToPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - return CesiumMath.zeroToTwoPi(x + CesiumMath.PI) - CesiumMath.PI; + return CesiumMath.zeroToTwoPi(angle + CesiumMath.PI) - CesiumMath.PI; }; /** @@ -895,12 +1065,12 @@ define('Core/Math',[ * @param {Number} angle in radians * @returns {Number} The angle in the range [0, <code>CesiumMath.TWO_PI</code>]. */ - CesiumMath.zeroToTwoPi = function(x) { - if (!defined(x)) { - throw new DeveloperError('x is required.'); + CesiumMath.zeroToTwoPi = function(angle) { + if (!defined(angle)) { + throw new DeveloperError('angle is required.'); } - var mod = CesiumMath.mod(x, CesiumMath.TWO_PI); - if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(x) > CesiumMath.EPSILON14) { + var mod = CesiumMath.mod(angle, CesiumMath.TWO_PI); + if (Math.abs(mod) < CesiumMath.EPSILON14 && Math.abs(angle) > CesiumMath.EPSILON14) { return CesiumMath.TWO_PI; } return mod; @@ -970,7 +1140,7 @@ define('Core/Math',[ * @example * //Compute 7!, which is equal to 5040 * var computedFactorial = Cesium.Math.factorial(7); - * + * * @see {@link http://en.wikipedia.org/wiki/Factorial|Factorial on Wikipedia} */ CesiumMath.factorial = function(n) { @@ -1195,12 +1365,14 @@ define('Core/Math',[ /*global define*/ define('Core/Cartesian2',[ + './Check', './defaultValue', './defined', './DeveloperError', './freezeObject', './Math' ], function( + Check, defaultValue, defined, DeveloperError, @@ -1309,15 +1481,11 @@ define('Core/Cartesian2',[ * @param {Number[]} array The array to pack into. * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements. * - * @returns {Number[]} The array that was packed into - */ - Cartesian2.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + * @returns {Number[]} The array that was packed into + */ + Cartesian2.pack = function(value, array, startingIndex) { + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1336,9 +1504,7 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided. */ Cartesian2.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -1358,9 +1524,7 @@ define('Core/Cartesian2',[ * @returns {Number[]} The packed array. */ Cartesian2.packArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -1383,9 +1547,7 @@ define('Core/Cartesian2',[ * @returns {Cartesian2[]} The unpacked array. */ Cartesian2.unpackArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -1428,9 +1590,7 @@ define('Core/Cartesian2',[ * @returns {Number} The value of the maximum component. */ Cartesian2.maximumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y); }; @@ -1442,9 +1602,7 @@ define('Core/Cartesian2',[ * @returns {Number} The value of the minimum component. */ Cartesian2.minimumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y); }; @@ -1458,15 +1616,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} A cartesian with the minimum components. */ Cartesian2.minimumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); @@ -1484,15 +1636,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} A cartesian with the maximum components. */ Cartesian2.maximumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -1506,9 +1652,7 @@ define('Core/Cartesian2',[ * @returns {Number} The squared magnitude. */ Cartesian2.magnitudeSquared = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y; }; @@ -1574,12 +1718,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.normalize = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian2.magnitude(cartesian); @@ -1601,12 +1741,8 @@ define('Core/Cartesian2',[ * @returns {Number} The dot product. */ Cartesian2.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y; }; @@ -1620,15 +1756,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.multiplyComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -1644,15 +1774,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.divideComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x / right.x; result.y = left.y / right.y; @@ -1668,15 +1792,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -1692,15 +1810,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -1716,15 +1828,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.multiplyByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -1740,15 +1846,9 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.divideByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -1763,12 +1863,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.negate = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -1783,12 +1879,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.abs = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -1806,18 +1898,10 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The modified result parameter. */ Cartesian2.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian2.multiplyByScalar(end, t, lerpScratch); result = Cartesian2.multiplyByScalar(start, 1.0 - t, result); @@ -1834,12 +1918,8 @@ define('Core/Cartesian2',[ * @returns {Number} The angle between the Cartesians. */ Cartesian2.angleBetween = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian2.normalize(left, angleBetweenScratch); Cartesian2.normalize(right, angleBetweenScratch2); @@ -1855,12 +1935,8 @@ define('Core/Cartesian2',[ * @returns {Cartesian2} The most orthogonal axis. */ Cartesian2.mostOrthogonalAxis = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian2.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian2.abs(f, f); @@ -1936,231 +2012,56 @@ define('Core/Cartesian2',[ /** * An immutable Cartesian2 instance initialized to (0.0, 1.0). * - * @type {Cartesian2} - * @constant - */ - Cartesian2.UNIT_Y = freezeObject(new Cartesian2(0.0, 1.0)); - - /** - * Duplicates this Cartesian2 instance. - * - * @param {Cartesian2} [result] The object onto which to store the result. - * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided. - */ - Cartesian2.prototype.clone = function(result) { - return Cartesian2.clone(this, result); - }; - - /** - * Compares this Cartesian against the provided Cartesian componentwise and returns - * <code>true</code> if they are equal, <code>false</code> otherwise. - * - * @param {Cartesian2} [right] The right hand side Cartesian. - * @returns {Boolean} <code>true</code> if they are equal, <code>false</code> otherwise. - */ - Cartesian2.prototype.equals = function(right) { - return Cartesian2.equals(this, right); - }; - - /** - * Compares this Cartesian against the provided Cartesian componentwise and returns - * <code>true</code> if they pass an absolute or relative tolerance test, - * <code>false</code> otherwise. - * - * @param {Cartesian2} [right] The right hand side Cartesian. - * @param {Number} relativeEpsilon The relative epsilon tolerance to use for equality testing. - * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing. - * @returns {Boolean} <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise. - */ - Cartesian2.prototype.equalsEpsilon = function(right, relativeEpsilon, absoluteEpsilon) { - return Cartesian2.equalsEpsilon(this, right, relativeEpsilon, absoluteEpsilon); - }; - - /** - * Creates a string representing this Cartesian in the format '(x, y)'. - * - * @returns {String} A string representing the provided Cartesian in the format '(x, y)'. - */ - Cartesian2.prototype.toString = function() { - return '(' + this.x + ', ' + this.y + ')'; - }; - - return Cartesian2; -}); - -/*global define*/ -define('Core/isArray',[ - './defined' - ], function( - defined) { - 'use strict'; - - /** - * Tests an object to see if it is an array. - * @exports isArray - * - * @param {Object} value The value to test. - * @returns {Boolean} true if the value is an array, false otherwise. - */ - var isArray = Array.isArray; - if (!defined(isArray)) { - isArray = function(value) { - return Object.prototype.toString.call(value) === '[object Array]'; - }; - } - - return isArray; -}); - -/*global define*/ -define('Core/Check',[ - './defaultValue', - './defined', - './DeveloperError', - './isArray' - ], function( - defaultValue, - defined, - DeveloperError, - isArray) { - 'use strict'; - - /** - * Contains functions for checking that supplied arguments are of a specified type - * or meet specified conditions - * @private - */ - var Check = {}; - - /** - * Contains type checking functions, all using the typeof operator - */ - Check.typeOf = {}; - - /** - * Contains functions for checking numeric conditions such as minimum and maximum values - */ - Check.numeric = {}; - - function getUndefinedErrorMessage(name) { - return name + ' was required but undefined.'; - } - - function getFailedTypeErrorMessage(actual, expected, name) { - return 'Expected ' + name + ' to be typeof ' + expected + ', got ' + actual; - } - - /** - * Throws if test is not defined - * - * @param {*} test The value that is to be checked - * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be defined - */ - Check.defined = function (test, name) { - if (!defined(test)) { - throw new DeveloperError(getUndefinedErrorMessage(name)); - } - }; - - /** - * Throws if test is greater than maximum - * - * @param {Number} test The value to test - * @param {Number} maximum The maximum allowed value - * @exception {DeveloperError} test must not be greater than maximum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' - */ - Check.numeric.maximum = function (test, maximum) { - Check.typeOf.number(test); - Check.typeOf.number(maximum); - if (test > maximum) { - throw new DeveloperError('Expected ' + test + ' to be at most ' + maximum); - } - }; - - /** - * Throws if test is less than minimum - * - * @param {Number} test The value to test - * @param {Number} minimum The minimum allowed value - * @exception {DeveloperError} test must not be less than mininum - * @exception {DeveloperError} Both test and maximum must be typeof 'number' - */ - Check.numeric.minimum = function (test, minimum) { - Check.typeOf.number(test); - Check.typeOf.number(minimum); - if (test < minimum) { - throw new DeveloperError('Expected ' + test + ' to be at least ' + minimum); - } - }; - - /** - * Throws if test is not typeof 'function' - * - * @param {*} test The value to test - * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'function' + * @type {Cartesian2} + * @constant */ - Check.typeOf.function = function (test, name) { - if (typeof test !== 'function') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name)); - } - }; + Cartesian2.UNIT_Y = freezeObject(new Cartesian2(0.0, 1.0)); /** - * Throws if test is not typeof 'string' + * Duplicates this Cartesian2 instance. * - * @param {*} test The value to test - * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'string' + * @param {Cartesian2} [result] The object onto which to store the result. + * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided. */ - Check.typeOf.string = function (test, name) { - if (typeof test !== 'string') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name)); - } + Cartesian2.prototype.clone = function(result) { + return Cartesian2.clone(this, result); }; /** - * Throws if test is not typeof 'number' + * Compares this Cartesian against the provided Cartesian componentwise and returns + * <code>true</code> if they are equal, <code>false</code> otherwise. * - * @param {*} test The value to test - * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'number' + * @param {Cartesian2} [right] The right hand side Cartesian. + * @returns {Boolean} <code>true</code> if they are equal, <code>false</code> otherwise. */ - Check.typeOf.number = function (test, name) { - if (typeof test !== 'number') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name)); - } + Cartesian2.prototype.equals = function(right) { + return Cartesian2.equals(this, right); }; /** - * Throws if test is not typeof 'object' + * Compares this Cartesian against the provided Cartesian componentwise and returns + * <code>true</code> if they pass an absolute or relative tolerance test, + * <code>false</code> otherwise. * - * @param {*} test The value to test - * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'object' + * @param {Cartesian2} [right] The right hand side Cartesian. + * @param {Number} relativeEpsilon The relative epsilon tolerance to use for equality testing. + * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing. + * @returns {Boolean} <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise. */ - Check.typeOf.object = function (test, name) { - if (typeof test !== 'object') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'object', name)); - } + Cartesian2.prototype.equalsEpsilon = function(right, relativeEpsilon, absoluteEpsilon) { + return Cartesian2.equalsEpsilon(this, right, relativeEpsilon, absoluteEpsilon); }; /** - * Throws if test is not typeof 'boolean' + * Creates a string representing this Cartesian in the format '(x, y)'. * - * @param {*} test The value to test - * @param {String} name The name of the variable being tested - * @exception {DeveloperError} test must be typeof 'boolean' + * @returns {String} A string representing the provided Cartesian in the format '(x, y)'. */ - Check.typeOf.boolean = function (test, name) { - if (typeof test !== 'boolean') { - throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'boolean', name)); - } + Cartesian2.prototype.toString = function() { + return '(' + this.x + ', ' + this.y + ')'; }; - return Check; + return Cartesian2; }); /*global define*/ @@ -2224,7 +2125,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.fromSpherical = function(spherical, result) { - Check.typeOf.object(spherical, 'spherical'); + Check.typeOf.object('spherical', spherical); if (!defined(result)) { result = new Cartesian3(); @@ -2308,8 +2209,8 @@ define('Core/Cartesian3',[ * @returns {Number[]} The array that was packed into */ Cartesian3.pack = function(value, array, startingIndex) { - Check.typeOf.object(value, 'value'); - Check.defined(array, 'array'); + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -2329,7 +2230,7 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. */ Cartesian3.unpack = function(array, startingIndex, result) { - Check.defined(array, 'array'); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -2350,7 +2251,7 @@ define('Core/Cartesian3',[ * @returns {Number[]} The packed array. */ Cartesian3.packArray = function(array, result) { - Check.defined(array, 'array'); + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -2373,8 +2274,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3[]} The unpacked array. */ Cartesian3.unpackArray = function(array, result) { - Check.defined(array, 'array'); - Check.numeric.minimum(array.length, 3); + Check.defined('array', array); + Check.typeOf.number.greaterThanOrEquals('array.length', array.length, 3); if (array.length % 3 !== 0) { throw new DeveloperError('array length must be a multiple of 3.'); } @@ -2420,7 +2321,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the maximum component. */ Cartesian3.maximumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z); }; @@ -2432,7 +2333,7 @@ define('Core/Cartesian3',[ * @returns {Number} The value of the minimum component. */ Cartesian3.minimumComponent = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z); }; @@ -2446,9 +2347,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the minimum components. */ Cartesian3.minimumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -2466,9 +2367,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} A cartesian with the maximum components. */ Cartesian3.maximumByComponent = function(first, second, result) { - Check.typeOf.object(first, 'first'); - Check.typeOf.object(second, 'second'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -2483,7 +2384,7 @@ define('Core/Cartesian3',[ * @returns {Number} The squared magnitude. */ Cartesian3.magnitudeSquared = function(cartesian) { - Check.typeOf.object(cartesian, 'cartesian'); + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z; }; @@ -2512,8 +2413,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distance(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(2.0, 0.0, 0.0)); */ Cartesian3.distance = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitude(distanceScratch); @@ -2532,8 +2433,8 @@ define('Core/Cartesian3',[ * var d = Cesium.Cartesian3.distanceSquared(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(3.0, 0.0, 0.0)); */ Cartesian3.distanceSquared = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.subtract(left, right, distanceScratch); return Cartesian3.magnitudeSquared(distanceScratch); @@ -2547,8 +2448,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.normalize = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian3.magnitude(cartesian); @@ -2571,8 +2472,8 @@ define('Core/Cartesian3',[ * @returns {Number} The dot product. */ Cartesian3.dot = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z; }; @@ -2586,9 +2487,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyComponents = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -2630,9 +2531,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.add = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -2649,9 +2550,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.subtract = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -2668,9 +2569,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.multiplyByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -2687,9 +2588,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.divideByScalar = function(cartesian, scalar, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.number(scalar, 'scalar'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -2705,8 +2606,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.negate = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -2722,8 +2623,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.abs = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -2742,10 +2643,10 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The modified result parameter. */ Cartesian3.lerp = function(start, end, t, result) { - Check.typeOf.object(start, 'start'); - Check.typeOf.object(end, 'end'); - Check.typeOf.number(t, 't'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian3.multiplyByScalar(end, t, lerpScratch); result = Cartesian3.multiplyByScalar(start, 1.0 - t, result); @@ -2762,8 +2663,8 @@ define('Core/Cartesian3',[ * @returns {Number} The angle between the Cartesians. */ Cartesian3.angleBetween = function(left, right) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian3.normalize(left, angleBetweenScratch); Cartesian3.normalize(right, angleBetweenScratch2); @@ -2781,8 +2682,8 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The most orthogonal axis. */ Cartesian3.mostOrthogonalAxis = function(cartesian, result) { - Check.typeOf.object(cartesian, 'cartesian'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian3.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian3.abs(f, f); @@ -2859,9 +2760,9 @@ define('Core/Cartesian3',[ * @returns {Cartesian3} The cross product. */ Cartesian3.cross = function(left, right, result) { - Check.typeOf.object(left, 'left'); - Check.typeOf.object(right, 'right'); - Check.typeOf.object(result, 'result'); + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var leftX = left.x; var leftY = left.y; @@ -2894,8 +2795,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromDegrees(-115.0, 37.0); */ Cartesian3.fromDegrees = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); longitude = CesiumMath.toRadians(longitude); latitude = CesiumMath.toRadians(latitude); @@ -2920,8 +2821,8 @@ define('Core/Cartesian3',[ * var position = Cesium.Cartesian3.fromRadians(-2.007, 0.645); */ Cartesian3.fromRadians = function(longitude, latitude, height, ellipsoid, result) { - Check.typeOf.number(longitude, 'longitude'); - Check.typeOf.number(latitude, 'latitude'); + Check.typeOf.number('longitude', longitude); + Check.typeOf.number('latitude', latitude); height = defaultValue(height, 0.0); var radiiSquared = defined(ellipsoid) ? ellipsoid.radiiSquared : wgs84RadiiSquared; @@ -2955,7 +2856,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArray([-115.0, 37.0, -107.0, 33.0]); */ Cartesian3.fromDegreesArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -2989,7 +2890,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArray([-2.007, 0.645, -1.867, .575]); */ Cartesian3.fromRadiansArray = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 2 || coordinates.length % 2 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 2 and at least 2'); } @@ -3023,7 +2924,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromDegreesArrayHeights([-115.0, 37.0, 100000.0, -107.0, 33.0, 150000.0]); */ Cartesian3.fromDegreesArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -3058,7 +2959,7 @@ define('Core/Cartesian3',[ * var positions = Cesium.Cartesian3.fromRadiansArrayHeights([-2.007, 0.645, 100000.0, -1.867, .575, 150000.0]); */ Cartesian3.fromRadiansArrayHeights = function(coordinates, ellipsoid, result) { - Check.defined(coordinates, 'coordinates'); + Check.defined('coordinates', coordinates); if (coordinates.length < 3 || coordinates.length % 3 !== 0) { throw new DeveloperError('the number of coordinates must be a multiple of 3 and at least 3'); } @@ -4102,7 +4003,9 @@ define('Core/Ellipsoid',[ /** * Computes an Ellipsoid from a Cartesian specifying the radii in x, y, and z directions. * - * @param {Cartesian3} [radii=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Cartesian3} [cartesian=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions. + * @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new + * instance should be created. * @returns {Ellipsoid} A new Ellipsoid instance. * * @exception {DeveloperError} All radii components must be greater than or equal to zero. @@ -4742,6 +4645,7 @@ define('Core/Interval',[ /*global define*/ define('Core/Matrix3',[ './Cartesian3', + './Check', './defaultValue', './defined', './defineProperties', @@ -4750,6 +4654,7 @@ define('Core/Matrix3',[ './Math' ], function( Cartesian3, + Check, defaultValue, defined, defineProperties, @@ -4812,13 +4717,8 @@ define('Core/Matrix3',[ * @returns {Number[]} The array that was packed into */ Matrix3.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -4844,9 +4744,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. */ Matrix3.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -4873,24 +4771,24 @@ define('Core/Matrix3',[ * @param {Matrix3} [result] The object onto which to store the result. * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. (Returns undefined if matrix is undefined) */ - Matrix3.clone = function(values, result) { - if (!defined(values)) { + Matrix3.clone = function(matrix, result) { + if (!defined(matrix)) { return undefined; } if (!defined(result)) { - return new Matrix3(values[0], values[3], values[6], - values[1], values[4], values[7], - values[2], values[5], values[8]); + return new Matrix3(matrix[0], matrix[3], matrix[6], + matrix[1], matrix[4], matrix[7], + matrix[2], matrix[5], matrix[8]); } - result[0] = values[0]; - result[1] = values[1]; - result[2] = values[2]; - result[3] = values[3]; - result[4] = values[4]; - result[5] = values[5]; - result[6] = values[6]; - result[7] = values[7]; - result[8] = values[8]; + result[0] = matrix[0]; + result[1] = matrix[1]; + result[2] = matrix[2]; + result[3] = matrix[3]; + result[4] = matrix[4]; + result[5] = matrix[5]; + result[6] = matrix[6]; + result[7] = matrix[7]; + result[8] = matrix[8]; return result; }; @@ -4916,9 +4814,7 @@ define('Core/Matrix3',[ * var m2 = Cesium.Matrix3.fromArray(v2, 2); */ Matrix3.fromArray = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -4946,9 +4842,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values parameter is required'); - } + Check.defined('values', values); return Matrix3.clone(values, result); }; @@ -4962,9 +4856,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. */ Matrix3.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix3(values[0], values[1], values[2], @@ -4991,9 +4883,7 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this quaternion. */ Matrix3.fromQuaternion = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); var x2 = quaternion.x * quaternion.x; var xy = quaternion.x * quaternion.y; @@ -5043,10 +4933,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The 3x3 rotation matrix from this headingPitchRoll. */ Matrix3.fromHeadingPitchRoll = function(headingPitchRoll, result) { - if (!defined(headingPitchRoll)) { - throw new DeveloperError('headingPitchRoll is required'); - } - var cosTheta = Math.cos(-headingPitchRoll.pitch); + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + + var cosTheta = Math.cos(-headingPitchRoll.pitch); var cosPsi = Math.cos(-headingPitchRoll.heading); var cosPhi = Math.cos(headingPitchRoll.roll); var sinTheta = Math.sin(-headingPitchRoll.pitch); @@ -5097,9 +4986,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix3( @@ -5135,9 +5022,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromUniformScale(2.0); */ Matrix3.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix3( @@ -5161,7 +5046,7 @@ define('Core/Matrix3',[ /** * Computes a Matrix3 instance representing the cross product equivalent matrix of a Cartesian3 vector. * - * @param {Cartesian3} the vector on the left hand side of the cross product operation. + * @param {Cartesian3} vector the vector on the left hand side of the cross product operation. * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created. * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided. * @@ -5173,9 +5058,7 @@ define('Core/Matrix3',[ * var m = Cesium.Matrix3.fromCrossProduct(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix3.fromCrossProduct = function(vector, result) { - if (!defined(vector)) { - throw new DeveloperError('vector is required.'); - } + Check.typeOf.object('vector', vector); if (!defined(result)) { return new Matrix3( @@ -5210,9 +5093,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationX = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -5251,9 +5132,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationY = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -5292,9 +5171,7 @@ define('Core/Matrix3',[ * var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3()); */ Matrix3.fromRotationZ = function(angle, result) { - if (!defined(angle)) { - throw new DeveloperError('angle is required.'); - } + Check.typeOf.number('angle', angle); var cosAngle = Math.cos(angle); var sinAngle = Math.sin(angle); @@ -5328,9 +5205,7 @@ define('Core/Matrix3',[ * @returns {Number[]} The modified Array parameter or a new Array instance if one was not provided. */ Matrix3.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5], matrix[6], matrix[7], matrix[8]]; @@ -5364,12 +5239,10 @@ define('Core/Matrix3',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix3.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 2) { - throw new DeveloperError('row must be 0, 1, or 2.'); - } - if (typeof column !== 'number' || column < 0 || column > 2) { - throw new DeveloperError('column must be 0, 1, or 2.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 2); + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 2); return column * 3 + row; }; @@ -5385,16 +5258,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var startIndex = index * 3; var x = matrix[startIndex]; @@ -5419,18 +5286,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); var startIndex = index * 3; @@ -5451,15 +5311,10 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 3]; @@ -5483,18 +5338,11 @@ define('Core/Matrix3',[ * @exception {DeveloperError} index must be 0, 1, or 2. */ Matrix3.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 2) { - throw new DeveloperError('index must be 0, 1, or 2.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 2); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix3.clone(matrix, result); result[index] = cartesian.x; @@ -5513,12 +5361,8 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[3], matrix[4], matrix[5], scratchColumn)); @@ -5549,15 +5393,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var column0Row0 = left[0] * right[0] + left[3] * right[1] + left[6] * right[2]; var column0Row1 = left[1] * right[0] + left[4] * right[1] + left[7] * right[2]; @@ -5592,15 +5430,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -5623,15 +5455,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -5654,15 +5480,9 @@ define('Core/Matrix3',[ * @returns {Cartesian3} The modified result parameter. */ Matrix3.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -5687,15 +5507,9 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -5726,15 +5540,9 @@ define('Core/Matrix3',[ * @see Matrix3.multiplyByUniformScale */ Matrix3.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); result[0] = matrix[0] * scale.x; result[1] = matrix[1] * scale.x; @@ -5756,12 +5564,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -5783,12 +5587,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var column0Row0 = matrix[0]; var column0Row1 = matrix[3]; @@ -5928,9 +5728,7 @@ define('Core/Matrix3',[ * var c = Cesium.Cartesian3.multiplyByScalar(v, lambda, new Cesium.Cartesian3()); // equal to Cesium.Matrix3.multiplyByVector(a, v) */ Matrix3.computeEigenDecomposition = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); // This routine was created based upon Matrix Computations, 3rd ed., by Golub and Van Loan, // section 8.4.3 The Classical Jacobi Algorithm @@ -5974,12 +5772,8 @@ define('Core/Matrix3',[ * @returns {Matrix3} The modified result parameter. */ Matrix3.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -6001,9 +5795,7 @@ define('Core/Matrix3',[ * @returns {Number} The value of the determinant of the matrix. */ Matrix3.determinant = function(matrix) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); var m11 = matrix[0]; var m21 = matrix[3]; @@ -6028,12 +5820,8 @@ define('Core/Matrix3',[ * @exception {DeveloperError} matrix is not invertible. */ Matrix3.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var m11 = matrix[0]; var m21 = matrix[1]; @@ -6099,9 +5887,7 @@ define('Core/Matrix3',[ * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. */ Matrix3.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -6289,12 +6075,14 @@ define('Core/Matrix3',[ /*global define*/ define('Core/Cartesian4',[ + './Check', './defaultValue', './defined', './DeveloperError', './freezeObject', './Math' ], function( + Check, defaultValue, defined, DeveloperError, @@ -6377,9 +6165,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.fromColor = function(color, result) { - if (!defined(color)) { - throw new DeveloperError('color is required'); - } + Check.typeOf.object('color', color); if (!defined(result)) { return new Cartesian4(color.red, color.green, color.blue, color.alpha); } @@ -6431,12 +6217,8 @@ define('Core/Cartesian4',[ * @returns {Number[]} The array that was packed into */ Cartesian4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -6457,9 +6239,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. */ Cartesian4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -6481,9 +6261,7 @@ define('Core/Cartesian4',[ * @returns {Number[]} The packed array. */ Cartesian4.packArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -6506,9 +6284,7 @@ define('Core/Cartesian4',[ * @returns {Cartesian4[]} The unpacked array. */ Cartesian4.unpackArray = function(array, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); var length = array.length; if (!defined(result)) { @@ -6551,9 +6327,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the maximum component. */ Cartesian4.maximumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.max(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -6565,9 +6339,7 @@ define('Core/Cartesian4',[ * @returns {Number} The value of the minimum component. */ Cartesian4.minimumComponent = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return Math.min(cartesian.x, cartesian.y, cartesian.z, cartesian.w); }; @@ -6581,15 +6353,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} A cartesian with the minimum components. */ Cartesian4.minimumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.min(first.x, second.x); result.y = Math.min(first.y, second.y); @@ -6603,20 +6369,14 @@ define('Core/Cartesian4',[ * Compares two Cartesians and computes a Cartesian which contains the maximum components of the supplied Cartesians. * * @param {Cartesian4} first A cartesian to compare. - * @param {Cartesian4} second A cartesian to compare. - * @param {Cartesian4} result The object into which to store the result. - * @returns {Cartesian4} A cartesian with the maximum components. - */ - Cartesian4.maximumByComponent = function(first, second, result) { - if (!defined(first)) { - throw new DeveloperError('first is required.'); - } - if (!defined(second)) { - throw new DeveloperError('second is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + * @param {Cartesian4} second A cartesian to compare. + * @param {Cartesian4} result The object into which to store the result. + * @returns {Cartesian4} A cartesian with the maximum components. + */ + Cartesian4.maximumByComponent = function(first, second, result) { + Check.typeOf.object('first', first); + Check.typeOf.object('second', second); + Check.typeOf.object('result', result); result.x = Math.max(first.x, second.x); result.y = Math.max(first.y, second.y); @@ -6633,9 +6393,7 @@ define('Core/Cartesian4',[ * @returns {Number} The squared magnitude. */ Cartesian4.magnitudeSquared = function(cartesian) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } + Check.typeOf.object('cartesian', cartesian); return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z + cartesian.w * cartesian.w; }; @@ -6666,9 +6424,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(2.0, 0.0, 0.0, 0.0)); */ Cartesian4.distance = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitude(distanceScratch); @@ -6689,9 +6446,8 @@ define('Core/Cartesian4',[ * new Cesium.Cartesian4(3.0, 0.0, 0.0, 0.0)); */ Cartesian4.distanceSquared = function(left, right) { - if (!defined(left) || !defined(right)) { - throw new DeveloperError('left and right are required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); Cartesian4.subtract(left, right, distanceScratch); return Cartesian4.magnitudeSquared(distanceScratch); @@ -6705,12 +6461,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.normalize = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var magnitude = Cartesian4.magnitude(cartesian); @@ -6734,12 +6486,8 @@ define('Core/Cartesian4',[ * @returns {Number} The dot product. */ Cartesian4.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w; }; @@ -6753,15 +6501,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x * right.x; result.y = left.y * right.y; @@ -6779,15 +6521,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideComponents = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x / right.x; result.y = left.y / right.y; @@ -6805,15 +6541,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -6831,15 +6561,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -6857,15 +6581,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.multiplyByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x * scalar; result.y = cartesian.y * scalar; @@ -6883,15 +6601,9 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.divideByScalar = function(cartesian, scalar, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = cartesian.x / scalar; result.y = cartesian.y / scalar; @@ -6908,12 +6620,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.negate = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = -cartesian.x; result.y = -cartesian.y; @@ -6930,12 +6638,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.abs = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result.x = Math.abs(cartesian.x); result.y = Math.abs(cartesian.y); @@ -6955,18 +6659,10 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The modified result parameter. */ Cartesian4.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); Cartesian4.multiplyByScalar(end, t, lerpScratch); result = Cartesian4.multiplyByScalar(start, 1.0 - t, result); @@ -6982,12 +6678,8 @@ define('Core/Cartesian4',[ * @returns {Cartesian4} The most orthogonal axis. */ Cartesian4.mostOrthogonalAxis = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required.'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var f = Cartesian4.normalize(cartesian, mostOrthogonalAxisScratch); Cartesian4.abs(f, f); @@ -7232,6 +6924,7 @@ define('Core/RuntimeError',[ define('Core/Matrix4',[ './Cartesian3', './Cartesian4', + './Check', './defaultValue', './defined', './defineProperties', @@ -7243,6 +6936,7 @@ define('Core/Matrix4',[ ], function( Cartesian3, Cartesian4, + Check, defaultValue, defined, defineProperties, @@ -7333,13 +7027,8 @@ define('Core/Matrix4',[ * @returns {Number[]} The array that was packed into */ Matrix4.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -7372,9 +7061,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if one was not provided. */ Matrix4.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -7470,9 +7157,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromColumnMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required'); - } + Check.defined('values', values); return Matrix4.clone(values, result); }; @@ -7486,9 +7171,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRowMajorArray = function(values, result) { - if (!defined(values)) { - throw new DeveloperError('values is required.'); - } + Check.defined('values', values); if (!defined(result)) { return new Matrix4(values[0], values[1], values[2], values[3], @@ -7525,9 +7208,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromRotationTranslation = function(rotation, translation, result) { - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } + Check.typeOf.object('rotation', rotation); translation = defaultValue(translation, Cartesian3.ZERO); @@ -7575,15 +7256,9 @@ define('Core/Matrix4',[ * result); */ Matrix4.fromTranslationQuaternionRotationScale = function(translation, rotation, scale, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required.'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('translation', translation); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('scale', scale); if (!defined(result)) { result = new Matrix4(); @@ -7644,9 +7319,7 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromTranslationRotationScale = function(translationRotationScale, result) { - if (!defined(translationRotationScale)) { - throw new DeveloperError('translationRotationScale is required.'); - } + Check.typeOf.object('translationRotationScale', translationRotationScale); return Matrix4.fromTranslationQuaternionRotationScale(translationRotationScale.translation, translationRotationScale.rotation, translationRotationScale.scale, result); }; @@ -7661,9 +7334,7 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByTranslation */ Matrix4.fromTranslation = function(translation, result) { - if (!defined(translation)) { - throw new DeveloperError('translation is required.'); - } + Check.typeOf.object('translation', translation); return Matrix4.fromRotationTranslation(Matrix3.IDENTITY, translation, result); }; @@ -7684,9 +7355,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0)); */ Matrix4.fromScale = function(scale, result) { - if (!defined(scale)) { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.object('scale', scale); if (!defined(result)) { return new Matrix4( @@ -7731,9 +7400,7 @@ define('Core/Matrix4',[ * var m = Cesium.Matrix4.fromUniformScale(2.0); */ Matrix4.fromUniformScale = function(scale, result) { - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required.'); - } + Check.typeOf.number('scale', scale); if (!defined(result)) { return new Matrix4(scale, 0.0, 0.0, 0.0, @@ -7773,23 +7440,15 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided. */ Matrix4.fromCamera = function(camera, result) { - if (!defined(camera)) { - throw new DeveloperError('camera is required.'); - } + Check.typeOf.object('camera', camera); var position = camera.position; var direction = camera.direction; var up = camera.up; - if (!defined(position)) { - throw new DeveloperError('camera.position is required.'); - } - if (!defined(direction)) { - throw new DeveloperError('camera.direction is required.'); - } - if (!defined(up)) { - throw new DeveloperError('camera.up is required.'); - } + Check.typeOf.object('camera.position', position); + Check.typeOf.object('camera.direction', direction); + Check.typeOf.object('camera.up', up); Cartesian3.normalize(direction, fromCameraF); Cartesian3.normalize(Cartesian3.cross(fromCameraF, up, fromCameraR), fromCameraR); @@ -7868,21 +7527,11 @@ define('Core/Matrix4',[ * @exception {DeveloperError} far must be greater than zero. */ Matrix4.computePerspectiveFieldOfView = function(fovY, aspectRatio, near, far, result) { - if (fovY <= 0.0 || fovY > Math.PI) { - throw new DeveloperError('fovY must be in (0, PI].'); - } - if (aspectRatio <= 0.0) { - throw new DeveloperError('aspectRatio must be greater than zero.'); - } - if (near <= 0.0) { - throw new DeveloperError('near must be greater than zero.'); - } - if (far <= 0.0) { - throw new DeveloperError('far must be greater than zero.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThan('fovY', fovY, 0.0); + Check.typeOf.number.lessThan('fovY', fovY, Math.PI); + Check.typeOf.number.greaterThan('near', near, 0.0); + Check.typeOf.number.greaterThan('far', far, 0.0); + Check.typeOf.object('result', result); var bottom = Math.tan(fovY * 0.5); @@ -7923,27 +7572,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeOrthographicOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var a = 1.0 / (right - left); var b = 1.0 / (top - bottom); @@ -7988,27 +7623,13 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computePerspectiveOffCenter = function(left, right, bottom, top, near, far, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(far)) { - throw new DeveloperError('far is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.number('far', far); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -8049,24 +7670,12 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeInfinitePerspectiveOffCenter = function(left, right, bottom, top, near, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } - if (!defined(bottom)) { - throw new DeveloperError('bottom is required.'); - } - if (!defined(top)) { - throw new DeveloperError('top is required.'); - } - if (!defined(near)) { - throw new DeveloperError('near is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number('left', left); + Check.typeOf.number('right', right); + Check.typeOf.number('bottom', bottom); + Check.typeOf.number('top', top); + Check.typeOf.number('near', near); + Check.typeOf.object('result', result); var column0Row0 = 2.0 * near / (right - left); var column1Row1 = 2.0 * near / (top - bottom); @@ -8114,9 +7723,7 @@ define('Core/Matrix4',[ * }, 0.0, 1.0, new Cesium.Matrix4()); */ Matrix4.computeViewportTransformation = function(viewport, nearDepthRange, farDepthRange, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); viewport = defaultValue(viewport, defaultValue.EMPTY_OBJECT); var x = defaultValue(viewport.x, 0.0); @@ -8168,21 +7775,11 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.computeView = function(position, direction, up, right, result) { - if (!defined(position)) { - throw new DeveloperError('position is required'); - } - if (!defined(direction)) { - throw new DeveloperError('direction is required'); - } - if (!defined(up)) { - throw new DeveloperError('up is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); + Check.typeOf.object('up', up); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = right.x; result[1] = up.x; @@ -8223,9 +7820,7 @@ define('Core/Matrix4',[ * //creates a = [10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0] */ Matrix4.toArray = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } + Check.typeOf.object('matrix', matrix); if (!defined(result)) { return [matrix[0], matrix[1], matrix[2], matrix[3], @@ -8269,12 +7864,11 @@ define('Core/Matrix4',[ * myMatrix[column1Row0Index] = 10.0; */ Matrix4.getElementIndex = function(column, row) { - if (typeof row !== 'number' || row < 0 || row > 3) { - throw new DeveloperError('row must be 0, 1, 2, or 3.'); - } - if (typeof column !== 'number' || column < 0 || column > 3) { - throw new DeveloperError('column must be 0, 1, 2, or 3.'); - } + Check.typeOf.number.greaterThanOrEquals('row', row, 0); + Check.typeOf.number.lessThanOrEquals('row', row, 3); + + Check.typeOf.number.greaterThanOrEquals('column', column, 0); + Check.typeOf.number.lessThanOrEquals('column', column, 3); return column * 4 + row; }; @@ -8307,16 +7901,12 @@ define('Core/Matrix4',[ * // a.x = 12.0; a.y = 16.0; a.z = 20.0; a.w = 24.0; */ Matrix4.getColumn = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var startIndex = index * 4; var x = matrix[startIndex]; @@ -8358,18 +7948,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 96.0, 25.0] */ Matrix4.setColumn = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); var startIndex = index * 4; @@ -8390,15 +7975,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.setTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -8451,16 +8030,12 @@ define('Core/Matrix4',[ * // a.x = 18.0; a.y = 19.0; a.z = 20.0; a.w = 21.0; */ Matrix4.getRow = function(matrix, index, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('result', result); var x = matrix[index]; var y = matrix[index + 4]; @@ -8501,18 +8076,13 @@ define('Core/Matrix4',[ * // [22.0, 23.0, 24.0, 25.0] */ Matrix4.setRow = function(matrix, index, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (typeof index !== 'number' || index < 0 || index > 3) { - throw new DeveloperError('index must be 0, 1, 2, or 3.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + + Check.typeOf.number.greaterThanOrEquals('index', index, 0); + Check.typeOf.number.lessThanOrEquals('index', index, 3); + + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); result = Matrix4.clone(matrix, result); result[index] = cartesian.x; @@ -8532,12 +8102,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter */ Matrix4.getScale = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = Cartesian3.magnitude(Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)); result.y = Cartesian3.magnitude(Cartesian3.fromElements(matrix[4], matrix[5], matrix[6], scratchColumn)); @@ -8569,15 +8135,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -8658,18 +8218,12 @@ define('Core/Matrix4',[ * @param {Matrix4} left The first matrix. * @param {Matrix4} right The second matrix. * @param {Matrix4} result The object onto which to store the result. - * @returns {Matrix4} The modified result parameter. - */ - Matrix4.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + * @returns {Matrix4} The modified result parameter. + */ + Matrix4.add = function(left, right, result) { + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] + right[0]; result[1] = left[1] + right[1]; @@ -8699,15 +8253,9 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result[0] = left[0] - right[0]; result[1] = left[1] - right[1]; @@ -8748,15 +8296,9 @@ define('Core/Matrix4',[ * var m3 = Cesium.Matrix4.multiplyTransformation(m1, m2, new Cesium.Matrix4()); */ Matrix4.multiplyTransformation = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var left0 = left[0]; var left1 = left[1]; @@ -8834,15 +8376,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByMatrix3(m, rotation, m); */ Matrix4.multiplyByMatrix3 = function(matrix, rotation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(rotation)) { - throw new DeveloperError('rotation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('rotation', rotation); + Check.typeOf.object('result', result); var left0 = matrix[0]; var left1 = matrix[1]; @@ -8910,15 +8446,9 @@ define('Core/Matrix4',[ * Cesium.Matrix4.multiplyByTranslation(m, position, m); */ Matrix4.multiplyByTranslation = function(matrix, translation, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(translation)) { - throw new DeveloperError('translation is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('translation', translation); + Check.typeOf.object('result', result); var x = translation.x; var y = translation.y; @@ -8970,15 +8500,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByScale */ Matrix4.multiplyByUniformScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scale !== 'number') { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scale', scale); + Check.typeOf.object('result', result); uniformScaleScratch.x = scale; uniformScaleScratch.y = scale; @@ -9007,15 +8531,9 @@ define('Core/Matrix4',[ * @see Matrix4.multiplyByUniformScale */ Matrix4.multiplyByScale = function(matrix, scale, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(scale)) { - throw new DeveloperError('scale is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('scale', scale); + Check.typeOf.object('result', result); var scaleX = scale.x; var scaleY = scale.y; @@ -9054,15 +8572,9 @@ define('Core/Matrix4',[ * @returns {Cartesian4} The modified result parameter. */ Matrix4.multiplyByVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -9098,15 +8610,9 @@ define('Core/Matrix4',[ * // Cesium.Matrix4.multiplyByVector(matrix, new Cesium.Cartesian4(p.x, p.y, p.z, 0.0), result); */ Matrix4.multiplyByPointAsVector = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -9136,16 +8642,9 @@ define('Core/Matrix4',[ * var result = Cesium.Matrix4.multiplyByPoint(matrix, p, new Cesium.Cartesian3()); */ Matrix4.multiplyByPoint = function(matrix, cartesian, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var vX = cartesian.x; var vY = cartesian.y; @@ -9185,15 +8684,9 @@ define('Core/Matrix4',[ * // [-44.0, -46.0, -48.0, -50.0] */ Matrix4.multiplyByScalar = function(matrix, scalar, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar must be a number'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result[0] = matrix[0] * scalar; result[1] = matrix[1] * scalar; @@ -9237,12 +8730,8 @@ define('Core/Matrix4',[ * // [-22.0, -23.0, -24.0, -25.0] */ Matrix4.negate = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = -matrix[0]; result[1] = -matrix[1]; @@ -9286,12 +8775,8 @@ define('Core/Matrix4',[ * // [13.0, 17.0, 21.0, 25.0] */ Matrix4.transpose = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); var matrix1 = matrix[1]; var matrix2 = matrix[2]; @@ -9327,12 +8812,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.abs = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = Math.abs(matrix[0]); result[1] = Math.abs(matrix[1]); @@ -9446,9 +8927,7 @@ define('Core/Matrix4',[ * //Prints "Difference between both the matrices is not less than 0.1" on the console */ Matrix4.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon must be a number'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || (defined(left) && @@ -9479,12 +8958,8 @@ define('Core/Matrix4',[ * @returns {Cartesian3} The modified result parameter. */ Matrix4.getTranslation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result.x = matrix[12]; result.y = matrix[13]; @@ -9515,12 +8990,8 @@ define('Core/Matrix4',[ * // [12.0, 16.0, 20.0] */ Matrix4.getRotation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); result[0] = matrix[0]; result[1] = matrix[1]; @@ -9552,12 +9023,8 @@ define('Core/Matrix4',[ * @exception {RuntimeError} matrix is not invertible because its determinate is zero. */ Matrix4.inverse = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); // Special case for a zero scale matrix that can occur, for example, // when a model's node has a [0, 0, 0] scale. @@ -9695,12 +9162,8 @@ define('Core/Matrix4',[ * @returns {Matrix4} The modified result parameter. */ Matrix4.inverseTransformation = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('matrix', matrix); + Check.typeOf.object('result', result); //This function is an optimized version of the below 4 lines. //var rT = Matrix3.transpose(Matrix4.getRotation(matrix)); @@ -9984,6 +9447,7 @@ define('Core/Matrix4',[ /*global define*/ define('Core/Rectangle',[ './Cartographic', + './Check', './defaultValue', './defined', './defineProperties', @@ -9993,6 +9457,7 @@ define('Core/Rectangle',[ './Math' ], function( Cartographic, + Check, defaultValue, defined, defineProperties, @@ -10089,13 +9554,8 @@ define('Core/Rectangle',[ * @returns {Number[]} The array that was packed into */ Rectangle.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -10116,9 +9576,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -10139,9 +9597,7 @@ define('Core/Rectangle',[ * @returns {Number} The width. */ Rectangle.computeWidth = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; if (east < west) { @@ -10156,9 +9612,7 @@ define('Core/Rectangle',[ * @returns {Number} The height. */ Rectangle.computeHeight = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); return rectangle.north - rectangle.south; }; @@ -10193,6 +9647,32 @@ define('Core/Rectangle',[ return result; }; + /** + * Creates an rectangle given the boundary longitude and latitude in radians. + * + * @param {Number} [west=0.0] The westernmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [south=0.0] The southernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Number} [east=0.0] The easternmost longitude in radians in the range [-Math.PI, Math.PI]. + * @param {Number} [north=0.0] The northernmost latitude in radians in the range [-Math.PI/2, Math.PI/2]. + * @param {Rectangle} [result] The object onto which to store the result, or undefined if a new instance should be created. + * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. + * + * @example + * var rectangle = Cesium.Rectangle.fromRadians(0.0, Math.PI/4, Math.PI/8, 3*Math.PI/4); + */ + Rectangle.fromRadians = function(west, south, east, north, result) { + if (!defined(result)) { + return new Rectangle(west, south, east, north); + } + + result.west = defaultValue(west, 0.0); + result.south = defaultValue(south, 0.0); + result.east = defaultValue(east, 0.0); + result.north = defaultValue(north, 0.0); + + return result; + }; + /** * Creates the smallest possible Rectangle that encloses all positions in the provided array. * @@ -10201,9 +9681,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartographicArray = function(cartographics, result) { - if (!defined(cartographics)) { - throw new DeveloperError('cartographics is required.'); - } + Check.defined('cartographics', cartographics); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -10256,9 +9734,7 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.fromCartesianArray = function(cartesians, ellipsoid, result) { - if (!defined(cartesians)) { - throw new DeveloperError('cartesians is required.'); - } + Check.defined('cartesians', cartesians); var west = Number.MAX_VALUE; var east = -Number.MAX_VALUE; @@ -10374,9 +9850,7 @@ define('Core/Rectangle',[ * @returns {Boolean} <code>true</code> if the Rectangles are within the provided epsilon, <code>false</code> otherwise. */ Rectangle.prototype.equalsEpsilon = function(other, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon is required and must be a number.'); - } + Check.typeOf.number('epsilon', epsilon); return defined(other) && (Math.abs(this.west - other.west) <= epsilon) && @@ -10396,45 +9870,23 @@ define('Core/Rectangle',[ * @exception {DeveloperError} <code>west</code> must be in the interval [<code>-Pi</code>, <code>Pi</code>]. */ Rectangle.validate = function(rectangle) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var north = rectangle.north; - if (typeof north !== 'number') { - throw new DeveloperError('north is required to be a number.'); - } - - if (north < -CesiumMath.PI_OVER_TWO || north > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('north must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('north', north, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('north', north, CesiumMath.PI_OVER_TWO); var south = rectangle.south; - if (typeof south !== 'number') { - throw new DeveloperError('south is required to be a number.'); - } - - if (south < -CesiumMath.PI_OVER_TWO || south > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError('south must be in the interval [-Pi/2, Pi/2].'); - } + Check.typeOf.number.greaterThanOrEquals('south', south, -CesiumMath.PI_OVER_TWO); + Check.typeOf.number.lessThanOrEquals('south', south, CesiumMath.PI_OVER_TWO); var west = rectangle.west; - if (typeof west !== 'number') { - throw new DeveloperError('west is required to be a number.'); - } - - if (west < -Math.PI || west > Math.PI) { - throw new DeveloperError('west must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('west', west, -Math.PI); + Check.typeOf.number.lessThanOrEquals('west', west, Math.PI); var east = rectangle.east; - if (typeof east !== 'number') { - throw new DeveloperError('east is required to be a number.'); - } - - if (east < -Math.PI || east > Math.PI) { - throw new DeveloperError('east must be in the interval [-Pi, Pi].'); - } + Check.typeOf.number.greaterThanOrEquals('east', east, -Math.PI); + Check.typeOf.number.lessThanOrEquals('east', east, Math.PI); }; /** @@ -10445,9 +9897,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.south); @@ -10466,9 +9916,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northwest = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.west, rectangle.north); @@ -10487,9 +9935,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.northeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.north); @@ -10508,9 +9954,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.southeast = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); if (!defined(result)) { return new Cartographic(rectangle.east, rectangle.south); @@ -10529,9 +9973,7 @@ define('Core/Rectangle',[ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided. */ Rectangle.center = function(rectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); var east = rectangle.east; var west = rectangle.west; @@ -10566,12 +10008,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.intersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var rectangleEast = rectangle.east; var rectangleWest = rectangle.west; @@ -10627,12 +10065,8 @@ define('Core/Rectangle',[ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection. */ Rectangle.simpleIntersection = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); var west = Math.max(rectangle.west, otherRectangle.west); var south = Math.max(rectangle.south, otherRectangle.south); @@ -10663,12 +10097,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. */ Rectangle.union = function(rectangle, otherRectangle, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(otherRectangle)) { - throw new DeveloperError('otherRectangle is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('otherRectangle', otherRectangle); if (!defined(result)) { result = new Rectangle(); @@ -10712,12 +10142,8 @@ define('Core/Rectangle',[ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided. */ Rectangle.expand = function(rectangle, cartographic, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required.'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); if (!defined(result)) { result = new Rectangle(); @@ -10739,12 +10165,8 @@ define('Core/Rectangle',[ * @returns {Boolean} true if the provided cartographic is inside the rectangle, false otherwise. */ Rectangle.contains = function(rectangle, cartographic) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } - if (!defined(cartographic)) { - throw new DeveloperError('cartographic is required.'); - } + Check.typeOf.object('rectangle', rectangle); + Check.typeOf.object('cartographic', cartographic); var longitude = cartographic.longitude; var latitude = cartographic.latitude; @@ -10777,9 +10199,7 @@ define('Core/Rectangle',[ * @returns {Cartesian3[]} The modified result parameter or a new Array of Cartesians instances if none was provided. */ Rectangle.subsample = function(rectangle, ellipsoid, surfaceHeight, result) { - if (!defined(rectangle)) { - throw new DeveloperError('rectangle is required'); - } + Check.typeOf.object('rectangle', rectangle); ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84); surfaceHeight = defaultValue(surfaceHeight, 0.0); @@ -10857,9 +10277,9 @@ define('Core/Rectangle',[ define('Core/BoundingSphere',[ './Cartesian3', './Cartographic', + './Check', './defaultValue', './defined', - './DeveloperError', './Ellipsoid', './GeographicProjection', './Intersect', @@ -10870,9 +10290,9 @@ define('Core/BoundingSphere',[ ], function( Cartesian3, Cartographic, + Check, defaultValue, defined, - DeveloperError, Ellipsoid, GeographicProjection, Intersect, @@ -11202,9 +10622,7 @@ define('Core/BoundingSphere',[ stride = defaultValue(stride, 3); - if (stride < 3) { - throw new DeveloperError('stride must be 3 or greater.'); - } + Check.typeOf.number.greaterThanOrEquals('stride', stride, 3); var currentPos = fromPointsCurrentPos; currentPos.x = positions[0] + center.x; @@ -11508,9 +10926,8 @@ define('Core/BoundingSphere',[ * var sphere = Cesium.BoundingSphere.fromCornerPoints(new Cesium.Cartesian3(-0.5, -0.5, -0.5), new Cesium.Cartesian3(0.5, 0.5, 0.5)); */ BoundingSphere.fromCornerPoints = function(corner, oppositeCorner, result) { - if (!defined(corner) || !defined(oppositeCorner)) { - throw new DeveloperError('corner and oppositeCorner are required.'); - } + Check.typeOf.object('corner', corner); + Check.typeOf.object('oppositeCorner', oppositeCorner); if (!defined(result)) { result = new BoundingSphere(); @@ -11534,9 +10951,7 @@ define('Core/BoundingSphere',[ * var boundingSphere = Cesium.BoundingSphere.fromEllipsoid(ellipsoid); */ BoundingSphere.fromEllipsoid = function(ellipsoid, result) { - if (!defined(ellipsoid)) { - throw new DeveloperError('ellipsoid is required.'); - } + Check.typeOf.object('ellipsoid', ellipsoid); if (!defined(result)) { result = new BoundingSphere(); @@ -11662,13 +11077,8 @@ define('Core/BoundingSphere',[ * @returns {Number[]} The array that was packed into */ BoundingSphere.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -11690,9 +11100,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if one was not provided. */ BoundingSphere.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -11719,13 +11127,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.union = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required.'); - } - - if (!defined(right)) { - throw new DeveloperError('right is required.'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); if (!defined(result)) { result = new BoundingSphere(); @@ -11774,13 +11177,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.expand = function(sphere, point, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(point)) { - throw new DeveloperError('point is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('point', point); result = BoundingSphere.clone(sphere, result); @@ -11803,13 +11201,8 @@ define('Core/BoundingSphere',[ * intersects the plane. */ BoundingSphere.intersectPlane = function(sphere, plane) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(plane)) { - throw new DeveloperError('plane is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('plane', plane); var center = sphere.center; var radius = sphere.radius; @@ -11835,13 +11228,8 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.transform = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -11869,12 +11257,8 @@ define('Core/BoundingSphere',[ * }); */ BoundingSphere.distanceSquaredTo = function(sphere, cartesian) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('cartesian', cartesian); var diff = Cartesian3.subtract(sphere.center, cartesian, distanceSquaredToScratch); return Cartesian3.magnitudeSquared(diff) - sphere.radius * sphere.radius; @@ -11896,13 +11280,8 @@ define('Core/BoundingSphere',[ * var newBoundingSphere = Cesium.BoundingSphere.transformWithoutScale(boundingSphere, modelMatrix); */ BoundingSphere.transformWithoutScale = function(sphere, transform, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(transform)) { - throw new DeveloperError('transform is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('transform', transform); if (!defined(result)) { result = new BoundingSphere(); @@ -11929,17 +11308,9 @@ define('Core/BoundingSphere',[ * @returns {Interval} The nearest and farthest distances on the bounding sphere from position in direction. */ BoundingSphere.computePlaneDistances = function(sphere, position, direction, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - - if (!defined(position)) { - throw new DeveloperError('position is required.'); - } - - if (!defined(direction)) { - throw new DeveloperError('direction is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('position', position); + Check.typeOf.object('direction', direction); if (!defined(result)) { result = new Interval(); @@ -11974,9 +11345,7 @@ define('Core/BoundingSphere',[ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. */ BoundingSphere.projectTo2D = function(sphere, projection, result) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } + Check.typeOf.object('sphere', sphere); projection = defaultValue(projection, projectTo2DProjection); @@ -12071,12 +11440,8 @@ define('Core/BoundingSphere',[ * @returns {Boolean} <code>true</code> if the sphere is not visible; otherwise <code>false</code>. */ BoundingSphere.isOccluded = function(sphere, occluder) { - if (!defined(sphere)) { - throw new DeveloperError('sphere is required.'); - } - if (!defined(occluder)) { - throw new DeveloperError('occluder is required.'); - } + Check.typeOf.object('sphere', sphere); + Check.typeOf.object('occluder', occluder); return !occluder.isBoundingSphereVisible(sphere); }; @@ -13076,7 +12441,10 @@ define('Core/WebGLConstants',[ COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : 0x9279, TEXTURE_IMMUTABLE_FORMAT : 0x912F, MAX_ELEMENT_INDEX : 0x8D6B, - TEXTURE_IMMUTABLE_LEVELS : 0x82DF + TEXTURE_IMMUTABLE_LEVELS : 0x82DF, + + // Extensions + MAX_TEXTURE_MAX_ANISOTROPY_EXT : 0x84FF }; return freezeObject(WebGLConstants); @@ -14521,6 +13889,7 @@ define('Core/IntersectionTests',[ './defaultValue', './defined', './DeveloperError', + './Interval', './Math', './Matrix3', './QuadraticRealPolynomial', @@ -14532,6 +13901,7 @@ define('Core/IntersectionTests',[ defaultValue, defined, DeveloperError, + Interval, CesiumMath, Matrix3, QuadraticRealPolynomial, @@ -14803,7 +14173,7 @@ define('Core/IntersectionTests',[ function raySphere(ray, sphere, result) { if (!defined(result)) { - result = {}; + result = new Interval(); } var origin = ray.origin; @@ -14834,8 +14204,8 @@ define('Core/IntersectionTests',[ * * @param {Ray} ray The ray. * @param {BoundingSphere} sphere The sphere. - * @param {Object} [result] The result onto which to store the result. - * @returns {Object} An object with the first (<code>start</code>) and the second (<code>stop</code>) intersection scalars for points along the ray or undefined if there are no intersections. + * @param {Interval} [result] The result onto which to store the result. + * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections. */ IntersectionTests.raySphere = function(ray, sphere, result) { if (!defined(ray)) { @@ -14863,8 +14233,8 @@ define('Core/IntersectionTests',[ * @param {Cartesian3} p0 An end point of the line segment. * @param {Cartesian3} p1 The other end point of the line segment. * @param {BoundingSphere} sphere The sphere. - * @param {Object} [result] The result onto which to store the result. - * @returns {Object} An object with the first (<code>start</code>) and the second (<code>stop</code>) intersection scalars for points along the line segment or undefined if there are no intersections. + * @param {Interval} [result] The result onto which to store the result. + * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections. */ IntersectionTests.lineSegmentSphere = function(p0, p1, sphere, result) { if (!defined(p0)) { @@ -14902,7 +14272,7 @@ define('Core/IntersectionTests',[ * * @param {Ray} ray The ray. * @param {Ellipsoid} ellipsoid The ellipsoid. - * @returns {Object} An object with the first (<code>start</code>) and the second (<code>stop</code>) intersection scalars for points along the ray or undefined if there are no intersections. + * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections. */ IntersectionTests.rayEllipsoid = function(ray, ellipsoid) { if (!defined(ray)) { @@ -14944,10 +14314,7 @@ define('Core/IntersectionTests',[ var root0 = temp / w2; var root1 = difference / temp; if (root0 < root1) { - return { - start : root0, - stop : root1 - }; + return new Interval(root0, root1); } return { @@ -14957,10 +14324,7 @@ define('Core/IntersectionTests',[ } else { // qw2 == product. Repeated roots (2 intersections). var root = Math.sqrt(difference / w2); - return { - start : root, - stop : root - }; + return new Interval(root, root); } } else if (q2 < 1.0) { // Inside ellipsoid (2 intersections). @@ -14970,19 +14334,13 @@ define('Core/IntersectionTests',[ discriminant = qw * qw - product; temp = -qw + Math.sqrt(discriminant); // Positively valued. - return { - start : 0.0, - stop : temp / w2 - }; + return new Interval(0.0, temp / w2); } else { // q2 == 1.0. On ellipsoid. if (qw < 0.0) { // Looking inward. w2 = Cartesian3.magnitudeSquared(w); - return { - start : 0.0, - stop : -qw / w2 - }; + return new Interval(0.0, -qw / w2); } // qw >= 0.0. Looking outward or tangent. @@ -16335,118 +15693,6 @@ define('ThirdParty/when',[],function () { // Boilerplate for AMD, Node, and browser global ); -/*global define*/ -define('Core/oneTimeWarning',[ - './defaultValue', - './defined', - './DeveloperError' - ], function( - defaultValue, - defined, - DeveloperError) { - "use strict"; - - var warnings = {}; - - /** - * Logs a one time message to the console. Use this function instead of - * <code>console.log</code> directly since this does not log duplicate messages - * unless it is called from multiple workers. - * - * @exports oneTimeWarning - * - * @param {String} identifier The unique identifier for this warning. - * @param {String} [message=identifier] The message to log to the console. - * - * @example - * for(var i=0;i<foo.length;++i) { - * if (!defined(foo[i].bar)) { - * // Something that can be recovered from but may happen a lot - * oneTimeWarning('foo.bar undefined', 'foo.bar is undefined. Setting to 0.'); - * foo[i].bar = 0; - * // ... - * } - * } - * - * @private - */ - function oneTimeWarning(identifier, message) { - if (!defined(identifier)) { - throw new DeveloperError('identifier is required.'); - } - - if (!defined(warnings[identifier])) { - warnings[identifier] = true; - console.log(defaultValue(message, identifier)); - } - } - - oneTimeWarning.geometryOutlines = 'Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.'; - - return oneTimeWarning; -}); - -/*global define*/ -define('Core/deprecationWarning',[ - './defined', - './DeveloperError', - './oneTimeWarning' - ], function( - defined, - DeveloperError, - oneTimeWarning) { - 'use strict'; - - /** - * Logs a deprecation message to the console. Use this function instead of - * <code>console.log</code> directly since this does not log duplicate messages - * unless it is called from multiple workers. - * - * @exports deprecationWarning - * - * @param {String} identifier The unique identifier for this deprecated API. - * @param {String} message The message to log to the console. - * - * @example - * // Deprecated function or class - * function Foo() { - * deprecationWarning('Foo', 'Foo was deprecated in Cesium 1.01. It will be removed in 1.03. Use newFoo instead.'); - * // ... - * } - * - * // Deprecated function - * Bar.prototype.func = function() { - * deprecationWarning('Bar.func', 'Bar.func() was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newFunc() instead.'); - * // ... - * }; - * - * // Deprecated property - * defineProperties(Bar.prototype, { - * prop : { - * get : function() { - * deprecationWarning('Bar.prop', 'Bar.prop was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newProp instead.'); - * // ... - * }, - * set : function(value) { - * deprecationWarning('Bar.prop', 'Bar.prop was deprecated in Cesium 1.01. It will be removed in 1.03. Use Bar.newProp instead.'); - * // ... - * } - * } - * }); - * - * @private - */ - function deprecationWarning(identifier, message) { - if (!defined(identifier) || !defined(message)) { - throw new DeveloperError('identifier and message are required.'); - } - - oneTimeWarning(identifier, message); - } - - return deprecationWarning; -}); - /*global define*/ define('Core/binarySearch',[ './defined', @@ -20675,6 +19921,7 @@ define('Core/FeatureDetection',[ /*global define*/ define('Core/Quaternion',[ './Cartesian3', + './Check', './defaultValue', './defined', './DeveloperError', @@ -20684,6 +19931,7 @@ define('Core/Quaternion',[ './Matrix3' ], function( Cartesian3, + Check, defaultValue, defined, DeveloperError, @@ -20746,12 +19994,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided. */ Quaternion.fromAxisAngle = function(axis, angle, result) { - if (!defined(axis)) { - throw new DeveloperError('axis is required.'); - } - if (typeof angle !== 'number') { - throw new DeveloperError('angle is required and must be a number.'); - } + Check.typeOf.object('axis', axis); + Check.typeOf.number('angle', angle); var halfAngle = angle / 2.0; var s = Math.sin(halfAngle); @@ -20783,9 +20027,7 @@ define('Core/Quaternion',[ * @see Matrix3.fromQuaternion */ Quaternion.fromRotationMatrix = function(matrix, result) { - if (!defined(matrix)) { - throw new DeveloperError('matrix is required.'); - } + Check.typeOf.object('matrix', matrix); var root; var x; @@ -20859,15 +20101,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter or a new Quaternion instance if none was provided. */ Quaternion.fromHeadingPitchRoll = function(heading, pitch, roll, result) { - if (!defined(heading)) { - throw new DeveloperError('heading is required.'); - } - if (!defined(pitch)) { - throw new DeveloperError('pitch is required.'); - } - if (!defined(roll)) { - throw new DeveloperError('roll is required.'); - } + Check.typeOf.number('heading', heading); + Check.typeOf.number('pitch', pitch); + Check.typeOf.number('roll', roll); var rollQuaternion = Quaternion.fromAxisAngle(Cartesian3.UNIT_X, roll, scratchHPRQuaternion); var pitchQuaternion = Quaternion.fromAxisAngle(Cartesian3.UNIT_Y, -pitch, result); @@ -20898,13 +20134,8 @@ define('Core/Quaternion',[ * @returns {Number[]} The array that was packed into */ Quaternion.pack = function(value, array, startingIndex) { - if (!defined(value)) { - throw new DeveloperError('value is required'); - } - - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.typeOf.object('value', value); + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -20925,9 +20156,7 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided. */ Quaternion.unpack = function(array, startingIndex, result) { - if (!defined(array)) { - throw new DeveloperError('array is required'); - } + Check.defined('array', array); startingIndex = defaultValue(startingIndex, 0); @@ -20982,7 +20211,7 @@ define('Core/Quaternion',[ * * @param {Number[]} array The array previously packed for interpolation. * @param {Number[]} sourceArray The original packed array. - * @param {Number} [startingIndex=0] The startingIndex used to convert the array. + * @param {Number} [firstIndex=0] The firstIndex used to convert the array. * @param {Number} [lastIndex=packedArray.length] The lastIndex used to convert the array. * @param {Quaternion} [result] The object into which to store the result. * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided. @@ -21036,12 +20265,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.conjugate = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); result.x = -quaternion.x; result.y = -quaternion.y; @@ -21057,9 +20282,7 @@ define('Core/Quaternion',[ * @returns {Number} The magnitude squared. */ Quaternion.magnitudeSquared = function(quaternion) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); return quaternion.x * quaternion.x + quaternion.y * quaternion.y + quaternion.z * quaternion.z + quaternion.w * quaternion.w; }; @@ -21082,9 +20305,7 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.normalize = function(quaternion, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); var inverseMagnitude = 1.0 / Quaternion.magnitude(quaternion); var x = quaternion.x * inverseMagnitude; @@ -21107,9 +20328,7 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.inverse = function(quaternion, result) { - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('result', result); var magnitudeSquared = Quaternion.magnitudeSquared(quaternion); result = Quaternion.conjugate(quaternion, result); @@ -21125,15 +20344,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.add = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x + right.x; result.y = left.y + right.y; @@ -21151,15 +20364,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.subtract = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); result.x = left.x - right.x; result.y = left.y - right.y; @@ -21176,12 +20383,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.negate = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); result.x = -quaternion.x; result.y = -quaternion.y; @@ -21198,12 +20401,8 @@ define('Core/Quaternion',[ * @returns {Number} The dot product. */ Quaternion.dot = function(left, right) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); return left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w; }; @@ -21217,15 +20416,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.multiply = function(left, right, result) { - if (!defined(left)) { - throw new DeveloperError('left is required'); - } - if (!defined(right)) { - throw new DeveloperError('right is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('left', left); + Check.typeOf.object('right', right); + Check.typeOf.object('result', result); var leftX = left.x; var leftY = left.y; @@ -21258,15 +20451,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.multiplyByScalar = function(quaternion, scalar, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = quaternion.x * scalar; result.y = quaternion.y * scalar; @@ -21284,15 +20471,9 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.divideByScalar = function(quaternion, scalar, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (typeof scalar !== 'number') { - throw new DeveloperError('scalar is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.number('scalar', scalar); + Check.typeOf.object('result', result); result.x = quaternion.x / scalar; result.y = quaternion.y / scalar; @@ -21309,12 +20490,8 @@ define('Core/Quaternion',[ * @returns {Cartesian3} The modified result parameter. */ Quaternion.computeAxis = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); var w = quaternion.w; if (Math.abs(w - 1.0) < CesiumMath.EPSILON6) { @@ -21337,9 +20514,7 @@ define('Core/Quaternion',[ * @returns {Number} The angle of rotation. */ Quaternion.computeAngle = function(quaternion) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required'); - } + Check.typeOf.object('quaternion', quaternion); if (Math.abs(quaternion.w - 1.0) < CesiumMath.EPSILON6) { return 0.0; @@ -21358,18 +20533,10 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.lerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); lerpScratch = Quaternion.multiplyByScalar(end, t, lerpScratch); result = Quaternion.multiplyByScalar(start, 1.0 - t, result); @@ -21391,18 +20558,10 @@ define('Core/Quaternion',[ * @see Quaternion#fastSlerp */ Quaternion.slerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var dot = Quaternion.dot(start, end); @@ -21435,12 +20594,8 @@ define('Core/Quaternion',[ * @returns {Cartesian3} The modified result parameter. */ Quaternion.log = function(quaternion, result) { - if (!defined(quaternion)) { - throw new DeveloperError('quaternion is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('quaternion', quaternion); + Check.typeOf.object('result', result); var theta = CesiumMath.acosClamped(quaternion.w); var thetaOverSinTheta = 0.0; @@ -21460,12 +20615,8 @@ define('Core/Quaternion',[ * @returns {Quaternion} The modified result parameter. */ Quaternion.exp = function(cartesian, result) { - if (!defined(cartesian)) { - throw new DeveloperError('cartesian is required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('cartesian', cartesian); + Check.typeOf.object('result', result); var theta = Cartesian3.magnitude(cartesian); var sinThetaOverTheta = 0.0; @@ -21500,12 +20651,10 @@ define('Core/Quaternion',[ * @see Quaternion#squad */ Quaternion.computeInnerQuadrangle = function(q0, q1, q2, result) { - if (!defined(q0) || !defined(q1) || !defined(q2)) { - throw new DeveloperError('q0, q1, and q2 are required.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('q0', q0); + Check.typeOf.object('q1', q1); + Check.typeOf.object('q2', q2); + Check.typeOf.object('result', result); var qInv = Quaternion.conjugate(q1, squadScratchQuaternion0); Quaternion.multiply(qInv, q2, squadScratchQuaternion1); @@ -21547,15 +20696,12 @@ define('Core/Quaternion',[ * @see Quaternion#computeInnerQuadrangle */ Quaternion.squad = function(q0, q1, s0, s1, t, result) { - if (!defined(q0) || !defined(q1) || !defined(s0) || !defined(s1)) { - throw new DeveloperError('q0, q1, s0, and s1 are required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('q0', q0); + Check.typeOf.object('q1', q1); + Check.typeOf.object('s0', s0); + Check.typeOf.object('s1', s1); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var slerp0 = Quaternion.slerp(q0, q1, t, squadScratchQuaternion0); var slerp1 = Quaternion.slerp(s0, s1, t, squadScratchQuaternion1); @@ -21592,18 +20738,10 @@ define('Core/Quaternion',[ * @see Quaternion#slerp */ Quaternion.fastSlerp = function(start, end, t, result) { - if (!defined(start)) { - throw new DeveloperError('start is required.'); - } - if (!defined(end)) { - throw new DeveloperError('end is required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('start', start); + Check.typeOf.object('end', end); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var x = Quaternion.dot(start, end); @@ -21652,15 +20790,12 @@ define('Core/Quaternion',[ * @see Quaternion#squad */ Quaternion.fastSquad = function(q0, q1, s0, s1, t, result) { - if (!defined(q0) || !defined(q1) || !defined(s0) || !defined(s1)) { - throw new DeveloperError('q0, q1, s0, and s1 are required.'); - } - if (typeof t !== 'number') { - throw new DeveloperError('t is required and must be a number.'); - } - if (!defined(result)) { - throw new DeveloperError('result is required'); - } + Check.typeOf.object('q0', q0); + Check.typeOf.object('q1', q1); + Check.typeOf.object('s0', s0); + Check.typeOf.object('s1', s1); + Check.typeOf.number('t', t); + Check.typeOf.object('result', result); var slerp0 = Quaternion.fastSlerp(q0, q1, t, squadScratchQuaternion0); var slerp1 = Quaternion.fastSlerp(s0, s1, t, squadScratchQuaternion1); @@ -21696,9 +20831,7 @@ define('Core/Quaternion',[ * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise. */ Quaternion.equalsEpsilon = function(left, right, epsilon) { - if (typeof epsilon !== 'number') { - throw new DeveloperError('epsilon is required and must be a number.'); - } + Check.typeOf.number('epsilon', epsilon); return (left === right) || ((defined(left)) && @@ -21778,9 +20911,9 @@ define('Core/Transforms',[ './Cartesian3', './Cartesian4', './Cartographic', + './Check', './defaultValue', './defined', - './deprecationWarning', './DeveloperError', './EarthOrientationParameters', './EarthOrientationParametersSample', @@ -21800,9 +20933,9 @@ define('Core/Transforms',[ Cartesian3, Cartesian4, Cartographic, + Check, defaultValue, defined, - deprecationWarning, DeveloperError, EarthOrientationParameters, EarthOrientationParametersSample, @@ -22238,19 +21371,12 @@ define('Core/Transforms',[ * var hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll); * var transform = Cesium.Transforms.headingPitchRollToFixedFrame(center, hpr); */ - Transforms.headingPitchRollToFixedFrame = function(origin, headingPitchRoll, pitch, roll, ellipsoid, result) { - var heading; - if (typeof headingPitchRoll === 'object') { - // Shift arguments using assignments to encourage JIT optimization. - ellipsoid = pitch; - result = roll; - heading = headingPitchRoll.heading; - pitch = headingPitchRoll.pitch; - roll = headingPitchRoll.roll; - } else { - deprecationWarning('headingPitchRollToFixedFrame', 'headingPitchRollToFixedFrame with separate heading, pitch, and roll arguments was deprecated in 1.27. It will be removed in 1.30. Use a HeadingPitchRoll object.'); - heading = headingPitchRoll; - } + Transforms.headingPitchRollToFixedFrame = function(origin, headingPitchRoll, ellipsoid, result) { + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + var heading = headingPitchRoll.heading; + var pitch = headingPitchRoll.pitch; + var roll = headingPitchRoll.roll; + // checks for required parameters happen in the called functions var hprQuaternion = Quaternion.fromHeadingPitchRoll(heading, pitch, roll, scratchHPRQuaternion); var hprMatrix = Matrix4.fromTranslationQuaternionRotationScale(Cartesian3.ZERO, hprQuaternion, scratchScale, scratchHPRMatrix4); @@ -22258,7 +21384,6 @@ define('Core/Transforms',[ return Matrix4.multiply(result, hprMatrix, result); }; - var scratchHPR = new HeadingPitchRoll(); var scratchENUMatrix4 = new Matrix4(); var scratchHPRMatrix3 = new Matrix3(); @@ -22283,22 +21408,10 @@ define('Core/Transforms',[ * var hpr = new HeadingPitchRoll(heading, pitch, roll); * var quaternion = Cesium.Transforms.headingPitchRollQuaternion(center, hpr); */ - Transforms.headingPitchRollQuaternion = function(origin, headingPitchRoll, pitch, roll, ellipsoid, result) { - var hpr; - if (typeof headingPitchRoll === 'object') { - // Shift arguments using assignment to encourage JIT optimization. - hpr = headingPitchRoll; - ellipsoid = pitch; - result = roll; - } else { - deprecationWarning('headingPitchRollQuaternion', 'headingPitchRollQuaternion with separate heading, pitch, and roll arguments was deprecated in 1.27. It will be removed in 1.30. Use a HeadingPitchRoll object.'); - scratchHPR.heading = headingPitchRoll; - scratchHPR.pitch = pitch; - scratchHPR.roll = roll; - hpr = scratchHPR; - } + Transforms.headingPitchRollQuaternion = function(origin, headingPitchRoll, ellipsoid, result) { // checks for required parameters happen in the called functions - var transform = Transforms.headingPitchRollToFixedFrame(origin, hpr, ellipsoid, scratchENUMatrix4); + Check.typeOf.object('headingPitchRoll', headingPitchRoll); + var transform = Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, scratchENUMatrix4); var rotation = Matrix4.getRotation(transform, scratchHPRMatrix3); return Quaternion.fromRotationMatrix(rotation, result); }; @@ -22774,6 +21887,46 @@ define('Core/Transforms',[ return result; }; + var swizzleMatrix = new Matrix4( + 0.0, 0.0, 1.0, 0.0, + 1.0, 0.0, 0.0, 0.0, + 0.0, 1.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 1.0); + + /** + * @private + */ + Transforms.wgs84To2DModelMatrix = function(projection, center, result) { + if (!defined(projection)) { + throw new DeveloperError('projection is required.'); + } + if (!defined(center)) { + throw new DeveloperError('center is required.'); + } + if (!defined(result)) { + throw new DeveloperError('result is required.'); + } + + var ellipsoid = projection.ellipsoid; + + var fromENU = Transforms.eastNorthUpToFixedFrame(center, ellipsoid, scratchFromENU); + var toENU = Matrix4.inverseTransformation(fromENU, scratchToENU); + + var cartographic = ellipsoid.cartesianToCartographic(center, scratchCartographic); + var projectedPosition = projection.project(cartographic, scratchCartesian3Projection); + var newOrigin = scratchCartesian4NewOrigin; + newOrigin.x = projectedPosition.z; + newOrigin.y = projectedPosition.x; + newOrigin.z = projectedPosition.y; + newOrigin.w = 1.0; + + var translation = Matrix4.fromTranslation(newOrigin, scratchFromENU); + Matrix4.multiply(swizzleMatrix, toENU, result); + Matrix4.multiply(translation, result, result); + + return result; + }; + return Transforms; }); @@ -23312,6 +22465,7 @@ define('Core/OrientedBoundingBox',[ /** * Computes an OrientedBoundingBox given extents in the east-north-up space of the tangent plane. * + * @param {Plane} tangentPlane The tangent place corresponding to east-north-up. * @param {Number} minimumX Minimum X extent in tangent plane space. * @param {Number} maximumX Maximum X extent in tangent plane space. * @param {Number} minimumY Minimum Y extent in tangent plane space. -- GitLab